@abtnode/blocklet-services 1.17.5-beta-20251214-231110-497f8d27 → 1.17.6-beta-20251216-081847-bf91c4db
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/libs/connect/session.js +6 -9
- package/api/routes/federated.js +2 -2
- package/dist/assets/AdapterDayjs-Bfr4sW4C.js +3 -0
- package/dist/assets/{Community-C7CFokDQ.js → Community-CELsDteM.js} +1 -1
- package/dist/assets/{Google-qCiUM9VP.js → Google-DA3WTnLE.js} +1 -1
- package/dist/assets/{Holiday-DyVifdc-.js → Holiday-DOCjSYjH.js} +1 -1
- package/dist/assets/{Meeting-DbtUCCZq.js → Meeting-BAXt_LiK.js} +1 -1
- package/dist/assets/{OffSick-BtITykO3.js → OffSick-BGEr8Nkc.js} +1 -1
- package/dist/assets/{WorkingRemotely-mKvokr6L.js → WorkingRemotely-BcneAIXG.js} +1 -1
- package/dist/assets/access-control-BZvc7AZG.js +14 -0
- package/dist/assets/actions-Dfiiwkit.js +1 -0
- package/dist/assets/{add-component-core-CFL73x1V.js → add-component-core-CNH5E2RR.js} +1 -1
- package/dist/assets/add-resource-BWEvlWkH.js +1 -0
- package/dist/assets/addon-uM70Qwac.js +14 -0
- package/dist/assets/{advanced-Djs25PXG.js → advanced-Caeqx4XB.js} +1 -1
- package/dist/assets/aigne-B9drp8Pq.js +10 -0
- package/dist/assets/api-C75sLx9p.js +1 -0
- package/dist/assets/appearance-DM7p-6Wl.js +1 -0
- package/dist/assets/arrow-down.svg-C4FUKwt4.js +1 -0
- package/dist/assets/{audit-logs-CXjhDj8M.js → audit-logs-L-gO50KL.js} +2 -2
- package/dist/assets/authorize-D2d4GCpP.js +1 -0
- package/dist/assets/{base-chart-BXspUQ5X.js → base-chart-DSDnGziZ.js} +1 -1
- package/dist/assets/{base32-E_M8YiDy.js → base32-B-7CnEFd.js} +1 -1
- package/dist/assets/bind-account-DuzArGdZ.js +1 -0
- package/dist/assets/{branding-B6_O9dwM.js → branding-Dx40btDl.js} +1 -1
- package/dist/assets/{branding-BN5xzu2K.js → branding-aCdIMhb0.js} +5 -5
- package/dist/assets/branding-bYH66Nug.js +1 -0
- package/dist/assets/bundle-avatar-B1jZNqcH.js +1 -0
- package/dist/assets/button-BnSiFtNt.js +1 -0
- package/dist/assets/click-to-copy-CwdgHxjB.js +1 -0
- package/dist/assets/cloneDeep-B_fYlLpl.js +1 -0
- package/dist/assets/{collapse-DRXViE1U.js → collapse-B7gUzFaX.js} +1 -1
- package/dist/assets/{complete-DERkCyic.js → complete-Rr-_Zaon.js} +3 -3
- package/dist/assets/{component-BFEXoFyD.js → component-DZretbSC.js} +2 -2
- package/dist/assets/{config-DBQhYXkx.js → config-Bjbv_xI5.js} +1 -1
- package/dist/assets/config-BkqISfFO.js +53 -0
- package/dist/assets/{config-mfnTXE1f.js → config-Dw0qq-09.js} +2 -2
- package/dist/assets/{config-navigation-CL9YkEzl.js → config-navigation-Dj8qf6cK.js} +8 -8
- package/dist/assets/config-space-Dw6ITGIj.js +1 -0
- package/dist/assets/confirm-Bpit6U3-.js +7 -0
- package/dist/assets/{connect-DXN8mBKc.js → connect-B1ZA3nS8.js} +1 -1
- package/dist/assets/connect-Bl7-1lbc.js +1 -0
- package/dist/assets/connect-to-BsxW3JJi.js +1 -0
- package/dist/assets/{content-layout-B5NObRcH.js → content-layout-DmSBGGVm.js} +1 -1
- package/dist/assets/{create-passport-svg-BwqsyTOz.js → create-passport-svg-DGPNsGUE.js} +1 -1
- package/dist/assets/createClass-B5uCYz0o.js +1 -0
- package/dist/assets/{dashboard-DHhNID_3.js → dashboard-DBwE7l6f.js} +7 -7
- package/dist/assets/{delete-confirm-DSQSBte5.js → delete-confirm-L0HXJtqt.js} +1 -1
- package/dist/assets/did-address-uvYuZ4wv.js +1 -0
- package/dist/assets/domain-BoEowNlU.js +9 -0
- package/dist/assets/domain-action-card-BB0jQwcH.js +28 -0
- package/dist/assets/domains-kgzxNW_C.js +1 -0
- package/dist/assets/{edit.svg-Dz9cVo7r.js → edit.svg-RRSklUg-.js} +1 -1
- package/dist/assets/{email-DDHqRiNE.js → email-BAr61Jer.js} +2 -2
- package/dist/assets/{empty-spinner-0EAHJWBW.js → empty-spinner-BYDonf35.js} +1 -1
- package/dist/assets/engine-DWk3y4cO.js +1 -0
- package/dist/assets/exchange-passport-BuJUAVgN.js +1 -0
- package/dist/assets/{form-C-ZRaynb.js → form-kdwSU-mv.js} +3 -3
- package/dist/assets/form-text-input-B_h8beXh.js +11 -0
- package/dist/assets/{form-wrapper-dz0PgYyA.js → form-wrapper-PT5ZzMQy.js} +1 -1
- package/dist/assets/fuel-C9kfBZ4R.js +32 -0
- package/dist/assets/gen-access-key-Bh-o1OFU.js +1 -0
- package/dist/assets/gen-simple-access-key-DHmIlRFl.js +1 -0
- package/dist/assets/get-safe-url-gaxZoVzJ.js +1 -0
- package/dist/assets/{home-D8RPk4rl.js → home-Cb5I193s.js} +1 -1
- package/dist/assets/{iframe-DbxlfoSv.js → iframe-C233G1py.js} +1 -1
- package/dist/assets/{index-Dnont80V.js → index-B0Q9wWG1.js} +2 -2
- package/dist/assets/{index-BfyoUnq5.js → index-B7DVpLRM.js} +34 -34
- package/dist/assets/index-BScxMPlP.js +1 -0
- package/dist/assets/{index-CiQvt8QY.js → index-BT70k77_.js} +2 -2
- package/dist/assets/index-BaaFi7Vh.js +1 -0
- package/dist/assets/{index-CmT6o_W4.js → index-Bf3Peb0q.js} +5 -5
- package/dist/assets/{index-BIFlvVef.js → index-C-vVEZcs.js} +6 -6
- package/dist/assets/{index-BajjN1HU.js → index-CGP3CGlC.js} +6 -6
- package/dist/assets/{index-Ccjxs0wr.js → index-CI3rRJqa.js} +12 -12
- package/dist/assets/{index-CAtE4xM9.js → index-CK3KHeKw.js} +8 -8
- package/dist/assets/{index-CIvZ7HIX.js → index-CRAuhYSg.js} +1 -1
- package/dist/assets/{index-CJBVOMty.js → index-CUlOq3Sr.js} +4 -4
- package/dist/assets/{index-DK4Rvfj9.js → index-CZBIYuko.js} +1 -1
- package/dist/assets/{index-BjLM8Gon.js → index-CaTDaKrX.js} +1 -1
- package/dist/assets/index-CqD-x8pw.js +7 -0
- package/dist/assets/{index-Bs5xamxm.js → index-CtORPeiq.js} +2 -2
- package/dist/assets/index-D-a8pZtp.js +1 -0
- package/dist/assets/{index-BOiRUuPB.js → index-D24LKXzO.js} +1 -1
- package/dist/assets/{index-C0q1NhNR.js → index-D29her4n.js} +1 -1
- package/dist/assets/index-DACtt7qd.js +102 -0
- package/dist/assets/{index-BRGQOPmE.js → index-D_u0j8BO.js} +1 -1
- package/dist/assets/{index-B6QOO2yw.js → index-DjpxFmgG.js} +7 -7
- package/dist/assets/index-DuDIkjct.js +55 -0
- package/dist/assets/{index-BXtrOI0G.js → index-DwJ_NASi.js} +1 -1
- package/dist/assets/{index-Dijoh4El.js → index-DwyzCfdd.js} +103 -103
- package/dist/assets/index-KIswy2vM.js +120 -0
- package/dist/assets/index-LaMi0T4w.js +1 -0
- package/dist/assets/index-MQEkIEm-.js +1 -0
- package/dist/assets/{index-DHn4LCaq.js → index-OMkyTUNX.js} +4 -4
- package/dist/assets/index-WT6M-zj8.js +6 -0
- package/dist/assets/{index-BsA1v5Kx.js → index-_tncRnTu.js} +1 -1
- package/dist/assets/index-lK6Pf_qM.js +11 -0
- package/dist/assets/{index-CMec_woq.js → index-m1ZQT0sU.js} +1 -1
- package/dist/assets/{index-bb4s-8hu.js → index-oS8X43Pb.js} +6 -6
- package/dist/assets/index-xE7OidBo.js +1 -0
- package/dist/assets/{index.esm-DTmS4tth.js → index.esm-Co8ZxFyk.js} +1 -1
- package/dist/assets/{invitation-Cjg3Rgxl.js → invitation-C2S2tPzG.js} +7 -7
- package/dist/assets/invitations-Dil5QWBY.js +3 -0
- package/dist/assets/invite-GVnju9RQ.js +1 -0
- package/dist/assets/{isURL-wZZwzwyC.js → isURL-ZFgr0DWl.js} +2 -2
- package/dist/assets/issue-passport-BmU6NmKw.js +1 -0
- package/dist/assets/{item-Bpf_gGYt.js → item-DfQKizv4.js} +1 -1
- package/dist/assets/landing-page-C3zTr0-n.js +1 -0
- package/dist/assets/{launch-result-message-BTBdTioQ.js → launch-result-message-MNpx7ysR.js} +1 -1
- package/dist/assets/{layout-CZo9vMzc.js → layout-tkk_Lr2y.js} +1 -1
- package/dist/assets/list-BvgV1Jbh.js +2 -0
- package/dist/assets/list-YOpLH3o0.js +103 -0
- package/dist/assets/{list-header-BQo9L_6R.js → list-header-Cl3jykCe.js} +1 -1
- package/dist/assets/localization-DcnSNZHz.js +1 -0
- package/dist/assets/{lock.svg-BPCZ0CT3.js → lock.svg-BgybwZNe.js} +1 -1
- package/dist/assets/{log-KsUeQx46.js → log-C0zcaEbO.js} +1 -1
- package/dist/assets/logger-BbBkOuwH.js +1 -0
- package/dist/assets/login-BR26IXZx.js +1 -0
- package/dist/assets/login-oauth-callback-DCJMx5J1.js +1 -0
- package/dist/assets/logo-uploader-TLOlwvRt.js +30 -0
- package/dist/assets/{lost-passport-DWR3ith-.js → lost-passport-DE5KGhjz.js} +3 -3
- package/dist/assets/{lottie-react.esm-CD0xFBYg.js → lottie-react.esm-E4oo1jhL.js} +1 -1
- package/dist/assets/omit-D_PYZZLm.js +1 -0
- package/dist/assets/{open-window-Ct_MP3Sx.js → open-window-CPNpPXku.js} +1 -1
- package/dist/assets/over-due-invoice-payment-1EZsSUm4.js +1 -0
- package/dist/assets/{overview-5u7B_D_6.js → overview-CMduEuAK.js} +2 -2
- package/dist/assets/{page-header-Cgwo2np-.js → page-header-CHAwrgX-.js} +1 -1
- package/dist/assets/passport-Dg1YWagy.js +1 -0
- package/dist/assets/passport-item-QbgyHapR.js +1 -0
- package/dist/assets/{permission-BYxNrlaa.js → permission-C0bmOzVj.js} +1 -1
- package/dist/assets/preferences-0l0Zmaom.js +1 -0
- package/dist/assets/profile-embed-BQzLZZkK.js +1 -0
- package/dist/assets/publish-resource-ggObFvMi.js +1 -0
- package/dist/assets/{question-mark-circle.svg-DK9nTUDZ.js → question-mark-circle.svg-CByEVDhb.js} +1 -1
- package/dist/assets/{raf-schd.esm-JNUhxcps.js → raf-schd.esm-XXBRsnmf.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-Cvsu51oI.js → react-beautiful-dnd.esm-zYw9dagY.js} +1 -1
- package/dist/assets/{react-stripe.esm-Dqbe1A8R.js → react-stripe.esm-CVZErl8X.js} +1 -1
- package/dist/assets/{required-B0Gua-D1.js → required-BQln5OcV.js} +1 -1
- package/dist/assets/{revoke.svg-CuiCGfVW.js → revoke.svg-CNl4LAbv.js} +1 -1
- package/dist/assets/runtime-BNKE0VfZ.js +1 -0
- package/dist/assets/{sanitize-D6Abg5_T.js → sanitize-CtCDGQB6.js} +1 -1
- package/dist/assets/sdk-YVE2MSze.js +1 -0
- package/dist/assets/{section-BkMzBpvM.js → section-jXB9AxBb.js} +1 -1
- package/dist/assets/{security-DCG1tmZe.js → security-CWEVWbF4.js} +3 -3
- package/dist/assets/{server-logo-notext.svg-DHxZ1bRk.js → server-logo-notext.svg-xZ-i1SpD.js} +1 -1
- package/dist/assets/session-Des-0R_y.js +1 -0
- package/dist/assets/setup-Cps_vpFS.js +24 -0
- package/dist/assets/{shorten-label-DhOty_4j.js → shorten-label-C4py9TLA.js} +1 -1
- package/dist/assets/{simple-select-D0q2J-Br.js → simple-select-DbXWLzPn.js} +1 -1
- package/dist/assets/{spaces-DM95DgFM.js → spaces-2YPkTkBR.js} +1 -1
- package/dist/assets/start-CuCNmoqX.js +187 -0
- package/dist/assets/{starting-progress-aMYWzin8.js → starting-progress-xuCef6_T.js} +2 -2
- package/dist/assets/status-DleDsf-t.js +1 -0
- package/dist/assets/{step-actions-nHHLzUFh.js → step-actions-AHe2MQxo.js} +1 -1
- package/dist/assets/studio-HfI11Uc3.js +6 -0
- package/dist/assets/{switch-control-BAyRLHvJ.js → switch-control-CzYig10w.js} +1 -1
- package/dist/assets/switch-rIcJ7tho.js +1 -0
- package/dist/assets/{table-tips-BA9A3QDk.js → table-tips-Ba9Kf02z.js} +1 -1
- package/dist/assets/team-BWkxYdcc.js +146 -0
- package/dist/assets/traffic-jB6onGHq.js +1 -0
- package/dist/assets/transfer-DspVAdFc.js +16 -0
- package/dist/assets/unsubscribe-CKdMi1Kx.js +1 -0
- package/dist/assets/use-app-logo-BAGvxEU-.js +1 -0
- package/dist/assets/{use-mobile-Dwc30NoL.js → use-mobile-BINJTzMb.js} +1 -1
- package/dist/assets/{use-mobile-Vtj5nBdp.js → use-mobile-D5clNlrm.js} +1 -1
- package/dist/assets/{use-server-logo-BfNy3Xkj.js → use-server-logo-Cv1kAPgB.js} +1 -1
- package/dist/assets/use-window-close-D7QBHj75.js +1 -0
- package/dist/assets/useAsync-CgTefzpB.js +1 -0
- package/dist/assets/{useAsync-DNDhrs-2.js → useAsync-CxjyODHb.js} +1 -1
- package/dist/assets/{useAsyncRetry-CSW1hopB.js → useAsyncRetry-BnuUJFwY.js} +1 -1
- package/dist/assets/useLocalStorage-Bj52e1ZW.js +1 -0
- package/dist/assets/{useSetState-cWrp7qoX.js → useSetState-L-f8mSga.js} +1 -1
- package/dist/assets/user-center-CL_lKzgJ.js +125 -0
- package/dist/assets/user-follower-CfiG4RXf.js +32 -0
- package/dist/assets/{util-DSnAozzs.js → util-C9cWBCZz.js} +1 -1
- package/dist/assets/{util-BxX0TJKJ.js → util-DXf_zMuU.js} +1 -1
- package/dist/assets/{vendor-arcblock-D4Rvz_D3.js → vendor-arcblock-DkdOhPyM.js} +1 -1
- package/dist/assets/{vendor-hooks-U4TTuKG0.js → vendor-hooks-BZ19vVZ7.js} +2 -2
- package/dist/assets/{vendor-mui-core-B5XNUjey.js → vendor-mui-core-DnR6WYuU.js} +2 -2
- package/dist/assets/{vendor-mui-x-DtPl0qBm.js → vendor-mui-x-CQc01l4r.js} +1 -1
- package/dist/assets/{vendor-react-CUXIiAnY.js → vendor-react-CTtPmzVP.js} +1 -1
- package/dist/assets/{vendor-utils-CFxoplqC.js → vendor-utils-D5UG1a5Y.js} +2 -2
- package/dist/assets/{vendor-ux-BX9dSNUy.js → vendor-ux-DMZIE6wA.js} +2 -2
- package/dist/assets/{wait-connect-CCXiMHZY.js → wait-connect-D2wPrbE3.js} +1 -1
- package/dist/assets/{wizard-TEBzHS-w.js → wizard-EYZCXWG5.js} +2 -2
- package/dist/assets/wizard-components-PMRUmw6U.js +52 -0
- package/dist/assets/wrap-locale-B4E8Yvgz.js +1 -0
- package/dist/assets/{zh-Dr9buZnV.js → zh-CSl2KD_S.js} +1 -1
- package/dist/assets/zh-CXK3bXGt.js +1 -0
- package/dist/assets/{zh-tw-CeXBj2i0.js → zh-tw-BiloxWNq.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +25 -2
- package/package.json +50 -50
- package/dist/assets/AdapterDayjs-p1MGZm94.js +0 -3
- package/dist/assets/access-control-C6MQq9M9.js +0 -14
- package/dist/assets/actions-CiAs-6JM.js +0 -1
- package/dist/assets/add-resource-DVpeKvW6.js +0 -1
- package/dist/assets/addon-B5NG3IsS.js +0 -14
- package/dist/assets/aigne-WBAWm6yx.js +0 -10
- package/dist/assets/api-Cjc501Es.js +0 -1
- package/dist/assets/appearance-CVS4AfPI.js +0 -1
- package/dist/assets/arrow-down.svg-Dhs0HydJ.js +0 -1
- package/dist/assets/authorize-uzVAAuOd.js +0 -1
- package/dist/assets/bind-account-N3cioth0.js +0 -1
- package/dist/assets/branding-BFn6p_xP.js +0 -1
- package/dist/assets/bundle-avatar-CfVy3gda.js +0 -1
- package/dist/assets/button-4KPacREM.js +0 -1
- package/dist/assets/click-to-copy-DXHOGoUP.js +0 -1
- package/dist/assets/cloneDeep-DjDct56M.js +0 -1
- package/dist/assets/config-CwbUhIlW.js +0 -57
- package/dist/assets/config-space-3dNLmLWy.js +0 -1
- package/dist/assets/confirm-BIsS5xyi.js +0 -7
- package/dist/assets/connect-DMt_37_e.js +0 -1
- package/dist/assets/connect-to-D3C0j8V8.js +0 -1
- package/dist/assets/createClass-CkCf2FLT.js +0 -1
- package/dist/assets/did-address-Qmm0nyiR.js +0 -1
- package/dist/assets/domain-DcU9P4mp.js +0 -9
- package/dist/assets/domain-action-card-D9HXIIpd.js +0 -28
- package/dist/assets/domains-DVkGbWo7.js +0 -1
- package/dist/assets/engine-Cx3nUUOw.js +0 -1
- package/dist/assets/exchange-passport-Bxh8blMK.js +0 -1
- package/dist/assets/form-text-input-CbjI2VZQ.js +0 -11
- package/dist/assets/fuel-BdIacIqD.js +0 -32
- package/dist/assets/gen-access-key-DdjBRI5O.js +0 -1
- package/dist/assets/gen-simple-access-key-CBGi0io0.js +0 -1
- package/dist/assets/get-safe-url-pZvXlaJu.js +0 -1
- package/dist/assets/index-5B_H2zYd.js +0 -1
- package/dist/assets/index-6M8OhYM1.js +0 -1
- package/dist/assets/index-BRky7Qm3.js +0 -7
- package/dist/assets/index-CUIcSX4q.js +0 -102
- package/dist/assets/index-CtuxXUm_.js +0 -1
- package/dist/assets/index-DCPJbOWh.js +0 -55
- package/dist/assets/index-DD9ceQKr.js +0 -1
- package/dist/assets/index-Dn_bIjgF.js +0 -6
- package/dist/assets/index-G1If4Shq.js +0 -120
- package/dist/assets/index-RxqUBm3A.js +0 -11
- package/dist/assets/index-SH0LXIEm.js +0 -1
- package/dist/assets/index-mgpYakv8.js +0 -1
- package/dist/assets/invitations-xEsO2f9m.js +0 -3
- package/dist/assets/invite-ChOQtk0E.js +0 -1
- package/dist/assets/issue-passport-CUGjhBZr.js +0 -1
- package/dist/assets/landing-page-zT1Tduxx.js +0 -1
- package/dist/assets/list-Cj5o6_aJ.js +0 -103
- package/dist/assets/list-dBF9Lx52.js +0 -2
- package/dist/assets/localization-BhQNA1fu.js +0 -1
- package/dist/assets/logger-CWdgyrlX.js +0 -1
- package/dist/assets/login-BRtDYFyr.js +0 -1
- package/dist/assets/login-oauth-callback-BVOT5KIP.js +0 -1
- package/dist/assets/logo-uploader-CMuaTg_2.js +0 -30
- package/dist/assets/omit-DZEUV_m7.js +0 -1
- package/dist/assets/over-due-invoice-payment-EIjXZOAF.js +0 -1
- package/dist/assets/passport-BcfDxGFq.js +0 -1
- package/dist/assets/passport-item-BnRaEMVZ.js +0 -1
- package/dist/assets/preferences-BgyNzrci.js +0 -1
- package/dist/assets/profile-embed-C3hI8xed.js +0 -1
- package/dist/assets/publish-resource-CreTipUc.js +0 -1
- package/dist/assets/runtime-BwoZhRe2.js +0 -1
- package/dist/assets/sdk-Do4pV1s0.js +0 -1
- package/dist/assets/session-DUT2afHJ.js +0 -1
- package/dist/assets/setup-ephJCw43.js +0 -24
- package/dist/assets/start-sucUqu8u.js +0 -187
- package/dist/assets/status-BFw6nCWi.js +0 -1
- package/dist/assets/studio-BKkw9WY-.js +0 -6
- package/dist/assets/switch-C5K07M96.js +0 -1
- package/dist/assets/team-HgvOpVEJ.js +0 -146
- package/dist/assets/traffic-BvA-dAE6.js +0 -1
- package/dist/assets/transfer-CiITg5ql.js +0 -16
- package/dist/assets/unsubscribe-2BjO5Axx.js +0 -1
- package/dist/assets/use-app-logo-D9eQSUYq.js +0 -1
- package/dist/assets/use-window-close-DLSxYDw-.js +0 -1
- package/dist/assets/useAsync-Dy8z2Lh_.js +0 -1
- package/dist/assets/useLocalStorage-oIIa9C3F.js +0 -1
- package/dist/assets/user-center-BODNsVgb.js +0 -126
- package/dist/assets/user-follower-ODH9p68y.js +0 -32
- package/dist/assets/wizard-components-MqkmgXy5.js +0 -52
- package/dist/assets/wrap-locale-Dk2yVg3Y.js +0 -1
- package/dist/assets/zh-C6-KWz-k.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./vendor-react-CUXIiAnY.js";import{j as C,bB as w}from"./vendor-mui-core-B5XNUjey.js";import{a as x,Q as B}from"./vendor-utils-CFxoplqC.js";import{ac as u,_ as G,J as k}from"./index-Dijoh4El.js";import{j as L}from"./vendor-hooks-U4TTuKG0.js";import{H as P}from"./vendor-ux-BX9dSNUy.js";import{g as _,a as h,b as A}from"./spaces-DM95DgFM.js";function N(){const[r,c]=e.useState(null),{blocklet:a}=u();return e.useEffect(()=>{c(_(a))},[a]),{storageEndpoint:r}}const l=e.createContext({}),{Provider:T,Consumer:q}=l;function b({children:r}){const[c,a]=e.useState(!1),[o,n]=e.useState(null),{blocklet:f,actions:{refreshBlocklet:i}}=u(),{storageEndpoint:s}=N(),{api:d}=G();L(async()=>{try{if(a(!0),x(s)){n(null);return}const t=await h(s);n(t)}catch(t){console.error(t),P.error(t.message)}finally{a(!1)}},[s]);const m=()=>{n(null),i()},E=async t=>{n(t),await p(t.endpoint),i()},p=async t=>{await d.configBlocklet({input:{did:[f.meta.did],configs:[{key:k.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT,value:t}]}}),i()};e.useEffect(()=>{async function t(){if(!o)return;const g=await A(o.endpoint,o.name),S=B(o,{name:g});n(S)}t()},[]);const y=!!(s&&o);return C.jsx(T,{value:{loading:c,spaceGateway:o,deleteSpaceGateway:m,updateSpaceGateway:E,storageEndpoint:s,settingStorageEndpoint:p,hasStorageEndpoint:y},children:r})}b.propTypes={children:w.node.isRequired};function F(){return e.useContext(l)}export{b as C,F as u};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{r}from"./vendor-react-CUXIiAnY.js";import{D as x,J as b,j as t,bC as z,$ as F,bD as J,aX as L,R as N,a6 as O,at as Q,Y as V,W as o}from"./vendor-mui-core-B5XNUjey.js";import{V as X,n as y}from"./vendor-ux-BX9dSNUy.js";import"./index-Dijoh4El.js";import{f as Y}from"./index-DBs9Ljax.js";function G(){const e=x();return{minWidth:b(e.breakpoints.down("md"))?300:e.breakpoints.values.sm}}function H({title:e,description:s,showCancel:l=!0,showConfirm:C=!0,cancel:j="",confirm:k="Confirm",color:D="error",params:w={},onCancel:S=()=>{},onConfirm:E,loading:c=!1,displayError:P=!0,children:R=void 0,...T}){const[a,W]=r.useState(w),[$,d]=r.useState(!0),[m,p]=r.useState(!1),[u,f]=r.useState(""),{t:v}=X(),q=x(),h=async n=>{if(typeof n=="function"){p(!0);try{if(await n(a)===!1)return;d(!1)}catch(i){f(Y(i)),console.error(i)}finally{p(!1)}}else d(!1)},B=typeof e=="function"?e():e,M=typeof s=="function"?s(a,W,f):s,A=b(q.breakpoints.down("md")),_=n=>{n.stopPropagation()},{minWidth:g}=G();return t.jsxs(I,{onClick:_,fullScreen:A,open:$,style:{minWidth:g},...T,children:[t.jsx(z,{children:B}),t.jsxs(F,{style:{minWidth:g},children:[t.jsx(J,{component:"div",children:M}),!!u&&P&&t.jsx(L,{severity:"error",style:{width:"100%",marginTop:8},children:u}),R]}),t.jsxs(N,{className:"delete-actions",style:{padding:"8px 24px 24px"},children:[l&&t.jsx(y,{onClick:n=>{n.stopPropagation(),h(S)},color:"inherit","data-cy":"cancel-confirm-dialog",children:j||v("common.cancel")}),C&&t.jsxs(y,{onClick:n=>{n.stopPropagation(),h(E)},color:D,disabled:a.__disableConfirm||m||c,variant:"contained","data-cy":"submit-confirm-dialog",autoFocus:!0,children:[(m||c)&&t.jsx(O,{size:16,sx:{mr:1}}),k]})]})]})}H.propTypes={title:o.any.isRequired,description:o.any.isRequired,showCancel:o.bool,showConfirm:o.bool,cancel:o.string,color:o.string,confirm:o.string,params:o.object,onCancel:o.func,onConfirm:o.func.isRequired,loading:o.bool,displayError:o.bool,children:o.any};const I=Q(V)`
|
|
2
|
-
.delete-actions .Mui-disabled {
|
|
3
|
-
color: ${({theme:e})=>`${e.palette.text.primary} !important`};
|
|
4
|
-
box-shadow: none;
|
|
5
|
-
background-color: ${({theme:e})=>`${e.palette.action.disabled} !important`};
|
|
6
|
-
}
|
|
7
|
-
`;export{H as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as Y,j as o,ak as g,J as Z,a6 as ee,ae as ne,Q as oe}from"./vendor-mui-core-B5XNUjey.js";import{i as se,u as te,r as L,L as re}from"./vendor-react-CUXIiAnY.js";import{a as ae,a8 as ce,V as ie,c as le,af as S,H as E,ag as U,K as de,g as pe}from"./index-Dijoh4El.js";import{a as me,b as k,h as fe,m as ge}from"./vendor-hooks-U4TTuKG0.js";import{o as he}from"./vendor-arcblock-D4Rvz_D3.js";import{V as ue,d as we,v as ke,H as x}from"./vendor-ux-BX9dSNUy.js";import{u as xe}from"./use-passport-id-B-b-_oYF.js";import{b as Te,c as ve,I as _e,C as be,A as Ce,O as Ie,P as ye}from"./vendor-utils-CFxoplqC.js";import{g as j}from"./get-safe-url-pZvXlaJu.js";import{K as Pe}from"./landing-page-zT1Tduxx.js";import{d}from"./logger-CWdgyrlX.js";import"./lottie-web-4koyQiv_.js";const De={primary:{light:"#51A2FF"}},R="authorization_response",Le=pe(),Se="blocklet:onLogin",h=new BroadcastChannel(Se);function Ke(){const{getPassportId:M}=xe(),{session:N,connectApi:O}=ae(),{t:a,locale:A}=ue(),F=se(),[i]=te(),{encrypt:B}=ce(),H=Y(),T=we();let p={};try{p=JSON.parse(decodeURIComponent(ie(i.get("params"))))}catch(n){console.error("parse connect params failed",n)}Te(i.get("popup"));const{action:m="login",passkeyBehavior:W="both",extraParams:l={},messages:J,...u}=p;L.useEffect(()=>{l.inviter&&window.localStorage.setItem("inviter",l.inviter)},[l.inviter]);const c=i.get("redirect"),v=i.get("opener"),w=i.get("_ek_");l.passportId=M(),m==="login"&&ve(u.forceConnected)&&(u.forceConnected=!1);const f=n=>w?B(JSON.stringify(n),w):n,_=L.useMemo(()=>c||!window.opener?"redirect":"popup",[c]),b=async n=>{const e=await Le.federated.getTrustedDomains();if(!v){e.forEach(t=>{window.opener.postMessage(n,Ie(t)),window.opener.postMessage(n,ye(t))});return}const s=new URL(v);if(!e.includes(s.hostname))throw x.error(a("login.invalidOpenerUrl")),new Error("Invalid login caller");window.opener.postMessage(n,s.origin)},C=({encrypted:n=!0,...e},s,t)=>{d("connect page onSuccess",{encrypted:n,result:e,options:t}),n&&(e.sessionToken&&(e.sessionToken=s(e.sessionToken)),e.csrfToken&&(e.csrfToken=s(e.csrfToken)),e.refreshToken&&(e.refreshToken=s(e.refreshToken)),e.visitorId&&(e.visitorId=s(e.visitorId)),d("connect page onSuccess decrypt",{result:e})),e.visitorId&&localStorage.setItem("__visitor_id",e.visitorId);const P={type:R,response:e,options:t};({redirect:()=>{d("connect page onSuccess redirect",e),setTimeout(()=>{if(U(),c){const D=decodeURIComponent(c),r=S(D);w&&r.searchParams.set("encrypted",!0),e.sessionToken&&r.searchParams.set("sessionToken",f(e.sessionToken)),e.csrfToken&&r.searchParams.set("csrfToken",f(e.csrfToken)),e.refreshToken&&r.searchParams.set("refreshToken",f(e.refreshToken)),e.visitorId&&r.searchParams.set("visitorId",f(e.visitorId)),t?.connected_did&&r.searchParams.set("connected_did",t.connected_did),t?.connected_pk&&r.searchParams.set("connected_pk",t.connected_pk),t?.connected_app&&r.searchParams.set("connected_app",t.connected_app),t?.connected_wallet_os&&r.searchParams.set("connected_wallet_os",t.connected_wallet_os),t?.saveConnect&&r.searchParams.set("saveConnect",t.saveConnect),h.postMessage({...Ce(e,["sessionToken","refreshToken","visitorId"])}),de(D)?window.location.replace(j(r.href,{allowDomains:null})):F(`${r.pathname}${r.search}`,{replace:!0})}else window.location.replace(window.env.pathPrefix||"/")},3e3)},popup:async()=>{d("connect page onSuccess popup",P),await b(P),U(),setTimeout(()=>{window.open("about:blank","_self"),window.close()},2e3)}})[_]()},K=n=>{const e={type:R,error:n.message,errorDescription:n.message};d("connect page onError",{res:e}),{redirect:()=>{x.error(n.message)},popup:()=>{b(e)}}[_]()},z=me(()=>{if(m!=="login")return null;const n=window.blocklet?.trustedFactories||[];return n?.length>0?o.jsxs(g,{children:[a("exchangePassport.tooltip1"),o.jsx(g,{component:re,reloadDocument:!0,to:_e(be(le.WELLKNOWN_SERVICE_PATH_PREFIX,"/exchange-passport"),{redirect:c||"/"}),sx:{color:De.primary.light,"&:hover":{textDecoration:"underline dashed"}},children:a("exchangePassport.tooltip2")},"exchange-passport"),o.jsx(g,{component:"ul",sx:{pl:1.5},children:n.map(e=>o.jsx(g,{component:"li",children:e},e))})]}):null},[m]),Q=k(async()=>{if(!c)return!0;let n;try{n=new URL(c)}catch{return!1}let e;try{e=new URL(p?.baseUrl)}catch{try{e=new URL(p?.prefix)}catch(s){console.error("baseUrl and prefix are both invalid",s)}}if(e){let s=[];if(e.origin===window.location.origin?s=window.blocklet.domainAliases||[]:s=(await ke(e.origin))?.domainAliases||[],!s.includes(n.hostname))return x.error(a("login.invalidRedirectUrl")),!1}return!0}),I=k(()=>{const n=decodeURIComponent(c),e=S(n);window.location.replace(j(e.href,{allowDomains:null}))}),V=!0,$=!0,G=Z(n=>n.breakpoints.down("lg")),y=k(async()=>{await Q()&&V&&(window.temporaryDIDConnectOnSuccess=(e,s)=>{C(e,s,{saveConnect:!0})},setTimeout(()=>{O.open({locale:A,action:m,passkeyBehavior:W,extraParams:l,...u,className:"connect",popup:!0,messages:J||{title:a("login.connect.title"),scan:a("login.connect.scan"),confirm:a("login.connect.confirm"),success:a("login.connect.success")},extraContent:z,useSocket:!0,allowWallet:["1","true",void 0,null].includes(globalThis.blocklet?.DID_CONNECT_ALLOW_WALLET),onSuccess:C,onError:K,hideCloseButton:$})}))});if(fe(()=>{y(),h.addEventListener("message",I)}),ge(()=>{delete window.temporaryDIDConnectOnSuccess,h.removeEventListener("message",I),h.close()}),N.loading)return o.jsxs(o.Fragment,{children:[o.jsx(E,{children:o.jsx("title",{children:"DID Connect"})}),o.jsx(he,{children:o.jsx(ee,{})})]});const X=globalThis.blocklet.appName,q=globalThis.blocklet.appDescription;return o.jsxs(o.Fragment,{children:[o.jsx(E,{children:o.jsxs("title",{children:[globalThis.blocklet.appName," | DID Connect"]})}),G&&!T.arcSphere?o.jsx(ne,{styles:{"& .did-connect__container-dialog > .MuiBackdrop-root":{backgroundColor:`${H.palette.background.default} !important`}}}):o.jsx(Pe,{did:globalThis.blocklet.appPid,title:X,description:q,actions:T.arcSphere?null:o.jsx(oe,{variant:"contained",disableElevation:!0,color:"primary",size:"large",onClick:y,children:a("login.login")})})]})}export{Ke as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as h}from"./vendor-react-CUXIiAnY.js";import{V as x,W as S,H as f}from"./vendor-ux-BX9dSNUy.js";import{D as w,a as R,b}from"./index-DHn4LCaq.js";import{e as y,J as I,ac as E,_ as T,aQ as P,aR as U}from"./index-Dijoh4El.js";import{j as t,ak as m,T as g,I as B,bX as q,W as r,bB as W}from"./vendor-mui-core-B5XNUjey.js";import"./index-C0q1NhNR.js";import"./index-BojVbZw0.js";import{u as F}from"./config-space-3dNLmLWy.js";import{f as D}from"./index-DBs9Ljax.js";import{a as N,D as O,C as A}from"./vendor-utils-CFxoplqC.js";import"./api-Cjc501Es.js";function K(){const{t:e}=x();return t.jsx(m,{children:t.jsxs(m,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",alignContent:"center"},children:[t.jsx(w,{style:{width:250,height:250}}),t.jsx(g,{sx:{marginTop:"24px"},children:e("storage.spaces.connect.providerForStorage")})]})})}function j({spaceGateway:e,onDeleteSpace:c=()=>{}}){const{t:n}=x(),[a,l]=h.useState(!1),[o,d]=h.useState(!1),u=(s,p)=>{s?.stopPropagation(),l(p)},i=async s=>{try{s?.stopPropagation(),d(!0),await c(e),l(!1)}catch(p){console.error(p),f.error(`${n("storage.spaces.gateway.delete.failed")}: ${D(p)}`)}finally{d(!1)}};return t.jsxs(t.Fragment,{children:[t.jsx(B,{size:"small",onClick:s=>u(s,!0),children:t.jsx(q,{})}),t.jsx(S,{title:n("storage.spaces.gateway.delete.title"),open:a,confirmButton:{text:n("common.confirm"),props:{size:"small",variant:"contained",color:"error",loading:o}},cancelButton:{text:n("common.cancel"),props:{size:"small",variant:"outlined"}},onConfirm:i,onCancel:s=>u(s,!1),children:t.jsx(g,{sx:{wordWrap:"break-word"},children:n("storage.spaces.gateway.delete.descForStorage",{name:`${e?.name}`})})})]})}j.propTypes={onDeleteSpace:r.func,spaceGateway:r.shape({name:r.string.isRequired,url:r.string.isRequired,protected:r.bool}).isRequired};function C({spaceGateway:e,onDisconnect:c=()=>{}}){const{t:n}=x(),a=async()=>{try{await c(),f.success(n("storage.spaces.gateway.delete.succeeded",{name:e.name?`(${e.name})`:""}))}catch(l){console.error(l),f.error(D(l))}};return t.jsx(j,{spaceGateway:e,onDeleteSpace:a})}C.propTypes={spaceGateway:r.shape({did:r.string.isRequired,name:r.string.isRequired,url:r.string.isRequired,endpoint:r.string.isRequired}).isRequired,onDisconnect:r.func};function M(){const{t:e}=x(),{spaceGateway:c,settingStorageEndpoint:n}=F();return t.jsxs(m,{sx:{display:"flex",flexDirection:"column"},children:[t.jsx(m,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},children:t.jsx(g,{sx:{fontSize:"1rem",fontWeight:"bold"},children:e("storage.spaces.connected.title")})}),t.jsx(m,{children:t.jsx(R,{sx:{marginTop:2},endpoint:c.endpoint,selected:!0,action:a=>t.jsx(C,{...a,onDisconnect:()=>n(null)})})})]})}function $({blocklet:e}){if(N(e))return{};const{appDid:c}=e,n=y.getAppName(e),a=y.getAppDescription(e),o=e?.site?.domainAliases?.sort((i,s)=>i.accessibility.accessible&&s.accessibility.accessible?+i.isProtected-+s.isProtected:+s.accessibility.accessible-+i.accessibility.accessible)?.map(i=>{const s=i?.domainStatus?.isHttps?"https://":"http://",p=i?.value;return`${s}${p}`}).filter(Boolean)?.[0],d=I.DID_SPACES.AUTHORIZE.DEFAULT_SCOPE,u=window.location.href;return{appDid:c,appName:n,appDescription:a,appUrl:o,scopes:d,referrer:u,isReady:!!o}}function v({onConnect:e=()=>{},...c}){const{blocklet:n}=E(),{info:a}=T(),{t:l}=x(),o=$({blocklet:n}),d=P(a),u={checkFn:O.create({baseURL:A(window.location.origin,U())}).get,webWalletUrl:d,extraParams:{appPid:n.appPid,appDid:o.appDid,appName:o.appName,appDescription:o.appDescription,appUrl:o.appUrl,referrer:o.referrer,scopes:o.scopes,nodeDid:a.did}},i=async({spaceGateway:s})=>{try{await e(s),f.success(l("storage.spaces.connectedWithName",{name:s.name}))}catch(p){console.error(p),f.error(D(p))}};return t.jsx(b,{...c,options:u,onSuccess:i})}v.propTypes={onConnect:W.func};export{M as C,K as D,v as a,$ as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c9 as u,ca as c}from"./vendor-mui-core-B5XNUjey.js";import{X as f,Z as s}from"./vendor-ux-BX9dSNUy.js";function n(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function y(e,t){if(e){if(typeof e=="string")return n(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}function b(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},a(e)}function _(e,t){if(t&&(f(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,s(o.key),o)}}function O(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}export{O as _,d as a,b,_ as c,a as d,n as e,y as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o,a$ as p,W as r}from"./vendor-mui-core-B5XNUjey.js";import{L as f}from"./vendor-react-CUXIiAnY.js";import{e as l}from"./vendor-ux-BX9dSNUy.js";function m({did:s,href:t="",external:i=!1,avatarProps:n={},to:a="",...d}){const e=o.jsx(l,{did:s,...d,avatarProps:n,to:a});return t?i?o.jsx(p,{target:"_blank",href:t,underline:"hover",children:e}):o.jsx(f,{to:t,children:e}):e}m.propTypes={did:r.string.isRequired,to:r.string,href:r.string,avatarProps:r.object,external:r.bool};export{m as W};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as o,ak as i,at as g,W as u}from"./vendor-mui-core-B5XNUjey.js";import{l as v,e as C,ad as b,d as B}from"./index-Dijoh4El.js";import{D as E,a as I,b as w}from"./domain-action-card-D9HXIIpd.js";import{p as T}from"./vendor-ux-BX9dSNUy.js";import{a as W}from"./page-header-Cgwo2np-.js";import{r,u as A}from"./vendor-react-CUXIiAnY.js";import{u as L}from"./useSetState-cWrp7qoX.js";import{S as x}from"./button-4KPacREM.js";import{S as $}from"./layout-CZo9vMzc.js";import{S as z}from"./step-actions-nHHLzUFh.js";import"./vendor-arcblock-D4Rvz_D3.js";import"./vendor-utils-CFxoplqC.js";import"./vendor-hooks-U4TTuKG0.js";import"./permission-BYxNrlaa.js";import"./session-DUT2afHJ.js";import"./useAsyncRetry-CSW1hopB.js";import"./useAsync-DNDhrs-2.js";import"./confirm-BIsS5xyi.js";import"./index-DBs9Ljax.js";import"./actions-CiAs-6JM.js";import"./delete-confirm-DSQSBte5.js";import"./click-to-copy-DXHOGoUP.js";import"./useAsync-Dy8z2Lh_.js";import"./index-BjLM8Gon.js";import"./util-BxX0TJKJ.js";import"./engine-Cx3nUUOw.js";import"./lottie-web-4koyQiv_.js";import"./content-layout-B5NObRcH.js";import"./use-mobile-Dwc30NoL.js";function h({onNext:a=()=>{},onPrevious:f=()=>{}}){const{t:n}=r.useContext(T),[D,d]=r.useState(!1),{blocklet:e}=v(),[p,S]=r.useState(""),j=((e?.site||{}).domainAliases||[]).map(t=>C.replaceSlotToIp(t.value,p)),[s,m]=L({domain:"",invalidDNSDomain:null,type:"",addDomainState:{text:""}}),c=e.environments?.find(t=>t.key==="BLOCKLET_APP_PK")?.value,y=j.find(t=>b.isDidDomain(t)),[l,P]=A();return r.useEffect(()=>{B.get(`/dns-resolve?hostname=${window.location.hostname}`).then(({data:t})=>{S(t.address||"")}).catch(t=>{console.error(t.message)})},[]),o.jsxs(H,{children:[o.jsx(i,{className:"header",children:o.jsx(W,{title:n("setup.domain.title"),subTitle:n("setup.domain.subTitle"),onClickBack:f})}),o.jsxs(i,{className:"form form-container",sx:{display:"flex",flexDirection:"column",gap:3,overflowY:"auto"},children:[o.jsxs(i,{children:[o.jsx(i,{sx:{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem"},children:o.jsx(i,{sx:{display:"inline"},children:`${n("setup.domain.buyOrConnect")} (${n("common.optional")})`})}),o.jsx(i,{sx:{mt:1},children:o.jsx(I,{blocklet:e,bugDidDomainProps:{appPk:c,appId:e.appPid,siteId:e.site.id,teamDid:e.meta.did,inBlockletSetup:!0},connectDomainProps:{autoFocus:!1,appPk:c,appId:e.appPid,siteId:e.site.id,teamDid:e.meta.did,cnameDomain:y,currentIp:p,inBlockletSetup:!0,shouldCheckDomain:!0,onInputDomain:t=>{m({domain:t.domain,type:t.type}),d(t.error)},onStateChange:t=>m({addDomainState:t}),onSuccess:t=>{const k={domain:t.domain,type:t.type,nftDid:t.nftDid,chainHost:t.chainHost};l.set("redirect",t.domain),P(l,{replace:!0}),m(k),a()},onError:d}})})]}),o.jsx(i,{children:o.jsx(w,{inSetup:!0,showAllDomains:!0,systemTips:o.jsx(i,{sx:{color:"text.primary",fontWeight:"fontWeightBold",fontSize:"1.125rem",mb:1},children:o.jsx(i,{sx:{display:"inline"},children:n("setup.domain.skipDescription")})})})})]}),o.jsx(z,{mt:8,disabled:!!s.addDomainState.text,blocklet:e,onStartNow:()=>a("complete"),children:s.domain?o.jsx(x,{variant:"contained",loading:!!s.addDomainState.text,disabled:D||!!s.addDomainState.text||!s.domain,onClick:()=>a(),children:s.addDomainState.text||n("setup.continue")}):o.jsx(x,{variant:"contained",disabled:!!s.addDomainState.text,onClick:()=>a(),children:n("setup.continue")})})]})}function ht(a){return o.jsx(E,{children:o.jsx(h,{...a})})}h.propTypes={onNext:u.func,onPrevious:u.func};const H=g($)`
|
|
2
|
-
height: 100%;
|
|
3
|
-
overflow-y: hidden;
|
|
4
|
-
|
|
5
|
-
.form {
|
|
6
|
-
width: 100%;
|
|
7
|
-
height: 100%;
|
|
8
|
-
}
|
|
9
|
-
`;export{ht as default};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import{ar as bn,T as vn,V as A,b as Cn,H as E,n as te,i as wn,S as ze}from"./vendor-ux-BX9dSNUy.js";import{j as e,d0 as Ne,d1 as Sn,ak as h,a6 as z,b0 as Rn,T as R,aX as ye,D as H,J as ie,am as L,aN as $e,W as t,bb as _e,M as Oe,aO as An,aP as kn,d2 as Tn,b7 as In,b9 as Pn,d3 as qn,d4 as En,b1 as W,P as We,cj as Ln,bh as Fn,at as Mn,a$ as Bn,c$ as Un,d5 as zn,d6 as Nn,d7 as $n,d8 as Te,d9 as _,da as _n,z as On,n as Wn,bf as Hn,db as Vn,cb as Gn}from"./vendor-mui-core-B5XNUjey.js";import{C as ee,I as Xn,a as Jn,e as Kn,J as je,a5 as Qn,a6 as Zn,n as J}from"./vendor-utils-CFxoplqC.js";import{r as j,e as He,g as Yn}from"./vendor-react-CUXIiAnY.js";import{u as se}from"./useSetState-cWrp7qoX.js";import{l as et,k as nt,b as K,m as tt,w as it}from"./vendor-hooks-U4TTuKG0.js";import{bi as Ve,X as Ge,bj as st,bk as Xe,_ as F,ac as oe,J as Ie,a2 as ot,aS as Pe,bl as rt,B as at,ae as lt,bm as Je,ad as fe,bn as Ke,bo as ct,bp as dt,bq as mt,aX as ut,e as xe,br as pt,bs as ft}from"./index-Dijoh4El.js";import{w as Qe}from"./permission-BYxNrlaa.js";import{u as xt,D as qe}from"./useAsyncRetry-CSW1hopB.js";import{C as re}from"./confirm-BIsS5xyi.js";import{A as ht}from"./actions-CiAs-6JM.js";import{D as gt}from"./delete-confirm-DSQSBte5.js";import{o as Ee}from"./vendor-arcblock-D4Rvz_D3.js";import{u as Dt}from"./useAsync-Dy8z2Lh_.js";import{f as N}from"./index-DBs9Ljax.js";import{v as yt}from"./index-BjLM8Gon.js";import{g as jt,p as Le}from"./util-BxX0TJKJ.js";import{C as bt}from"./click-to-copy-DXHOGoUP.js";const vt=Ve({});vt.interceptors.request.use(n=>{const i=window.blocklet?window.blocklet.prefix:"/";return n.baseURL=i||"",n.url=ee("/api",String(n.url)),n.timeout=2e5,n.params=n.params||{},new URLSearchParams(n.url.split("?")[1]).has("locale")||(n.params.locale=bn()),n},n=>Promise.reject(n));const Ze=(...n)=>Ve(...n),Ct=(n,i)=>i?n?[n,...Array.isArray(i)?i:[i]]:i:n,wt=(n,{width:i=600,height:o=700,name:a="did-domain:popup"}={})=>{const s=window.screenX+(window.innerWidth-i)/2,r=window.screenY+(window.innerHeight-o)/2,u=[`left=${s}`,`top=${r}`,`width=${i}`,`height=${o}`,"resizable=no","scrollbars=yes","status=yes","popup=yes"],l=window.open("",a,u.join(","));if(l===null)throw new Error("Failed to open popup");return l.location.href=Xn(n,{opener:window.location.origin}),l},St="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p",Ye=async n=>{if(!n||!n?.trim())return null;const i=Ze(),o=new URL(n);o.pathname="__blocklet__.js",o.searchParams.set("type","json");const{data:a}=await i.get(o.toString()),s=a?.componentMountPoints?.find(m=>m.did===St),r=new URL(n);r.pathname=s?.mountPoint;const u=r.toString(),l=ee(u,"/api");return{base:u,api:l}},Rt=Ge({embed:{iconTip:"Click to view subscription details"},buy:{button:{title:"Buy DID Domain"},status:{inProgress:"Please wait while we are processing your request, the domain will be automatically resolved to the current app after the purchase...",success:"Purchase completed!"},error:{failedToCreateSession:"Failed to create session"}}}),At=Ge({embed:{iconTip:"点击查看订阅详情"},buy:{button:{title:"购买 DID 域名"},status:{inProgress:"请稍等,我们正在处理您的请求,购买域名后会自动解析到当前的应用...",success:"购买完成!"},error:{failedToCreateSession:"创建会话失败"}}}),kt={zh:At,en:Rt},Tt=async({didDomainURL:n,delegatee:i,delegateePk:o})=>{const a=await Ye(n);if(!a)return null;const s=Ze({baseURL:a.api}),{data:r}=await s.post("/payment/session",{delegatee:i,delegateePk:o});return{sessionId:r.sessionId,baseURL:a.base}};function It({delegatee:n,delegateePk:i,didDomainURL:o,locale:a,title:s="",onSuccess:r=()=>{},...u}){const{t:l}=A(),[m,p]=et({currentState:1}),f=j.useRef(null),c=nt(async()=>{const d=await Tt({didDomainURL:o,delegatee:n,delegateePk:i});return d},{debounceWait:500,debounceLeading:!0,debounceTrailing:!1,debounceMaxWait:3e3,refreshDeps:[],onError(d){console.error(d)}}),g=K(d=>{d.data.type==="didDomain.success"&&(r?.({nftDid:d.data?.nftDid,domain:d.data?.domain,chainHost:d.data?.chainHost}),f.current?.close(),f.current=null,p({currentState:4}),setTimeout(()=>{p({currentState:8})},2e3))});tt(()=>{try{window.removeEventListener("message",g),f.current?.close(),f.current=null}catch(d){console.warn("Failed to close popup",d)}});const y=K(()=>{p({currentState:1})}),x=K(()=>{if(p({currentState:2}),!c.data){console.error("Failed to create session");return}b({sessionId:c.data.sessionId,baseURL:c.data.baseURL})}),b=K(({sessionId:d,baseURL:w})=>{window.addEventListener("message",g);const C=new URL(w);C.searchParams.set("sessionId",d),C.searchParams.set("locale",a),C.searchParams.set("embed","1"),f.current=wt(C.toString());const q=setInterval(()=>{f.current?.closed&&(clearInterval(q),y())},1e3);return()=>clearInterval(q)});return e.jsxs(e.Fragment,{children:[e.jsx(Ne,{loading:c.loading,onClick:x,variant:"contained",startIcon:e.jsx(Sn,{}),...u,children:s||l("buy.button.title")}),e.jsxs(Cn,{fullWidth:!0,maxWidth:"xs",open:m.currentState>1&&m.currentState<8,onClose:y,children:[!c.error&&e.jsxs(h,{sx:{display:"flex",alignItems:"center",flexDirection:"column",gap:2},children:[m.currentState===2&&e.jsx(z,{size:50}),m.currentState===4&&e.jsx(Rn,{sx:{color:"primary.main",fontSize:"5rem"}}),m.currentState===2&&e.jsx(R,{children:l("buy.status.inProgress")}),m.currentState===4&&e.jsx(R,{children:l("buy.status.success")})]}),c.error&&e.jsx(ye,{severity:"error",children:l("buy.error.failedToCreateSession")})]})]})}function Pt(n){return e.jsx(vn,{locale:n.locale,translations:kt,children:e.jsx(It,{...n})})}function qt({nftDid:n,didDomainURL:i,locale:o,sx:a={}}){const{t:s}=A(),[r,u]=se({safeIframeRef:null,popoverAnchorEl:null}),l=j.useRef(null),m=H(),p=ie(m.breakpoints.down("md")),f=x=>{u({popoverAnchorEl:x.currentTarget})},c=()=>{u({popoverAnchorEl:null})},g=it(async()=>{const x=await Ye(i);return x?x.base:null});if(!g.value)return null;if(g.loading)return e.jsx(z,{});const y=ee(g.value,`/embed/domain?nft-did=${n}&locale=${o}`);return e.jsxs(e.Fragment,{children:[e.jsx(L,{title:s("embed.iconTip"),children:e.jsx(h,{component:"img",src:ee(i,"/.well-known/service/blocklet/logo"),alt:"logo",onClick:f,sx:[{width:16,height:16},Ct({cursor:"pointer"},a)]})}),e.jsx($e,{id:"popover-info",open:!!r.popoverAnchorEl,anchorEl:r.popoverAnchorEl,onClose:c,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:e.jsx("iframe",{ref:l,title:s("common.subscription"),width:p?"320px":"400px",height:"350px",style:{border:0,display:"block"},src:y})})]})}const Et=n=>["waiting","creating","renewaling"].includes(n);function en({siteId:n,domain:i,onAdd:o=()=>{},children:a=null,did:s,issuing:r=!1,setIssuing:u=()=>{}}){const{t:l}=A(),[m,p]=j.useState(!1),{inService:f}=F(),[c,g]=j.useState(null),{api:y,ws:{useSubscription:x}}=F(),{mode:b,actions:{refreshDomainStatus:d}}=oe(),w=xt(async()=>{const{cert:T}=await y.findCertificateByDomain({input:{domain:i,did:s}});return T}),C=(T,S)=>{T.domain===i&&(u(!1),p(!1),f&&b!=="setup"&&(S==="success"?E.success(l("setup.domain.genCertSuccess",{domain:T.domain})):S==="error"&&E.error(l("setup.domain.genCertFailed",{domain:T.domain,message:T.message}))))};if(j.useEffect(()=>{w.loading||u(Et(w.value?.status))},[w.loading,w.value?.status,u]),x(Ie.BlockletEvents.certError,T=>C(T,"error")),x(Ie.BlockletEvents.certIssued,T=>{w.retry(),d(T.domain),C(T,"success")}),w.loading||w.value?.status==="normal")return"";const q=()=>{p(!1),g(null)},B=async()=>{p(!0);try{await y.issueLetsEncryptCert({input:{siteId:n,domain:i,did:s,inBlockletSetup:b==="setup"}}),o(),u(!0)}catch(T){console.error(T),u(!1)}finally{p(!1),g(null)}},M={title:l("router.cert.genLetsEncryptCert.title"),description:e.jsxs("div",{children:[e.jsx(ye,{severity:"success",children:l("router.cert.genLetsEncryptCert.dnsTip")}),l("router.cert.genLetsEncryptCert.description")]}),confirm:l("common.confirm"),onConfirm:B,onCancel:q},U=T=>{T.stopPropagation(),g(M)};return e.jsxs(e.Fragment,{children:[r?e.jsx(L,{title:l("router.cert.issuing"),children:e.jsx(z,{size:13,style:{fontSize:"13px"}})}):a({loading:m,open:U}),c&&e.jsx(re,{color:"primary",title:c.title,description:c.description,confirm:c.confirm,params:c.params,onConfirm:c.onConfirm,onCancel:c.onCancel})]})}en.propTypes={domain:t.string.isRequired,did:t.string.isRequired,siteId:t.string.isRequired,onAdd:t.func,children:t.any,issuing:t.bool,setIssuing:t.func};function nn({domain:n,domainStatus:i,did:o,onAdd:a=()=>{},children:s=null,issuing:r=!1,setIssuing:u=()=>{},...l}){return st(n)||!Xe(n)||Jn(i)||i?.isHttps?"":e.jsx(en,{...l,domain:n,did:o,onAdd:a,issuing:r,setIssuing:u,children:s})}nn.propTypes={domain:t.string.isRequired,domainStatus:t.shape({isHttps:t.bool}).isRequired,did:t.string.isRequired,onAdd:t.func,children:t.any,issuing:t.bool,setIssuing:t.func};function tn({id:n,domain:i,children:o=null,teamDid:a="",onDelete:s=null}){const{t:r}=A(),[u,l]=j.useState(!1),[m,p]=j.useState(null),{api:f}=F(),c=()=>{l(!1),p(null)},g=async()=>{l(!0);try{await f.deleteDomainAlias({input:{id:n,domainAlias:i,teamDid:a}}),s?.(),await ot(2e3)}catch(b){E.error(b.message)}finally{p(null),l(!1)}},y={keyName:i,title:r("router.domainAlias.delete.title"),description:r("router.domainAlias.delete.description",{domain:i}),confirmPlaceholder:r("router.domainAlias.delete.confirmPlaceholder",{domain:i}),confirm:r("common.delete"),onConfirm:g,onCancel:c},x=b=>{b.stopPropagation(),p(y)};return e.jsxs(e.Fragment,{children:[typeof o=="function"?o({loading:u,open:x}):e.jsxs(te,{edge:"end",onClick:x,size:"small",className:"rule-action",color:"error","data-cy":"action-delete-domain-alias",children:[u?e.jsx(z,{size:16}):e.jsx(_e,{style:{fontSize:16}}),r("common.delete")]}),m&&e.jsx(gt,{keyName:m.keyName,title:m.title,description:m.description,confirmPlaceholder:m.confirmPlaceholder,confirm:m.confirm,params:m.params,onConfirm:m.onConfirm,onCancel:m.onCancel})]})}tn.propTypes={id:t.string.isRequired,domain:t.string.isRequired,children:t.any,teamDid:t.string,onDelete:t.func};function sn({site:n,domain:i,blocklet:o,onDelete:a=()=>{}}){const{t:s}=A(),r=i.value===window.location.hostname;return e.jsx(ht,{"data-cy":"domain-actions",size:"large",actions:[({close:u})=>e.jsx(tn,{id:n.id,domain:i.value,teamDid:o?.meta?.did,onDelete:a,children:({open:l})=>e.jsx(L,{title:r?s("blocklet.router.currentDomainTip"):"",children:e.jsx("span",{children:e.jsxs(Oe,{disabled:i.isProtected||r,dense:!0,onClick:m=>{u(),l(m)},"data-cy":"action-toggle-block",children:[e.jsx(An,{style:{minWidth:24,marginRight:8},children:e.jsx(_e,{})}),e.jsx(kn,{primary:s("common.delete")})]},"remove")})})})]})}sn.propTypes={site:t.object.isRequired,domain:t.object.isRequired,blocklet:t.object.isRequired,onDelete:t.func};const ae=t.shape({href:t.string,accessibility:t.shape({loading:t.bool,accessible:t.bool}),domainStatus:t.shape({isHttps:t.bool,matchedCert:t.object}),dns:t.shape({resolved:t.bool,ip:t.string})});function on({certificate:n={}}){const[i,o]=j.useState(null),a=F(),{t:s,locale:r}=A(),u=p=>{o(p.currentTarget)},l=()=>{o(null)},m=!!i;return e.jsxs(e.Fragment,{children:[e.jsx(Tn,{"aria-owns":m?"mouse-over-popover":void 0,onMouseEnter:u,onMouseLeave:l,style:{color:"#44cdc6",fontSize:"1em",cursor:"pointer"}}),e.jsx($e,{id:"mouse-over-popover",style:{pointerEvents:"none"},open:m,anchorEl:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:l,disableRestoreFocus:!0,children:e.jsx(In,{children:e.jsxs(Pn,{style:{display:"flex"},children:[e.jsx("div",{children:e.jsx("img",{src:`${a.imgPrefix}/https-certificate-icon.png`,alt:"certificate icon",style:{maxHeight:"100%",maxWidth:"100%"}})}),e.jsxs(R,{component:"div",style:{marginLeft:"16px"},children:[e.jsx(R,{component:"div",style:{fontWeight:"bold"},children:n.domain}),e.jsx(R,{component:"div",children:`${s("common.issuer")}: ${Kn(n,"issuer.commonName","")}`}),e.jsx(R,{component:"div",children:`${s("router.cert.issuedOn")}: ${Pe(n.validFrom,r)}`}),e.jsx(R,{component:"div",children:`${s("router.cert.expiryOn")}: ${Pe(n.validTo,r)}`})]})]})})})]})}on.propTypes={certificate:t.object};function ne({domain:n,filters:i=["domain","http"]}){const{t:o}=A(),{value:a,domainStatus:s}=n;if(!Xe(a))return null;let r=null,u=null;const{isHttps:l,matchedCert:m}=s,{dns:{ip:p,isDnsResolved:f,isCnameMatch:c}={}}=s,g=f&&c;rt(a)||(g||p==="127.0.0.1"?r=e.jsx(L,{title:o("router.domain.verify.ok"),children:e.jsx(qe,{color:"success"})}):r=e.jsx(L,{title:o("router.domain.verify.notResolved"),children:e.jsx(qe,{color:"error"})})),g?l?u=e.jsx(on,{certificate:m}):u=e.jsx(L,{title:o("router.domain.https.bad"),children:e.jsx(qn,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})}):u=e.jsx(L,{title:o("router.domain.verify.notResolved"),children:e.jsx(En,{style:{color:"#D0021B",fontSize:"1em",cursor:"pointer"}})});const y=i.map(x=>x==="domain"?r:x==="http"?u:null);return j.createElement(j.Fragment,null,...y)}ne.propTypes={domain:ae.isRequired,filters:t.array};const Lt=Qe(be,"mutate_blocklets"),Ft=Qe(be,"",at);function pi(n){const{inService:i}=F(),{blocklet:o,loadingRuntimeInfo:a}=oe();let s=Lt;return i&&(s=Ft),e.jsx(s,{...n,blocklet:o,inService:i,loadingRuntimeInfo:a})}const Fe="nft-domain";function be({hasPermission:n=!1,blocklet:i,loadingRuntimeInfo:o=!1,inService:a=!1,showAllDomains:s=!1,updateBlockletDomainAliases:r=()=>{},systemTips:u=null}){const{t:l}=A(),m=ie(d=>d.breakpoints.down("md")),p=j.useMemo(()=>{let d=n;return lt(i)&&(d=d&&a),d},[n,a,i]),{site:f}=i,c=j.useMemo(()=>Je(i.site?.domainAliases),[i.site?.domainAliases]),g=j.useMemo(()=>c.filter(d=>!fe.isCustomDomain(d.value)),[c]),y=j.useMemo(()=>c.filter(d=>fe.isCustomDomain(d.value)),[c]),x=j.useMemo(()=>y.filter(d=>d.type!==Fe),[y]),b=j.useMemo(()=>y.filter(d=>d.type===Fe),[y]);return e.jsxs(e.Fragment,{children:[e.jsxs(W,{sx:{gap:3},children:[!!b.length&&e.jsx(Y,{title:l("common.didDomains"),description:l("common.didDomainsDescription"),domains:b,hasMutatePermission:p,blocklet:i,site:f,mobile:m,showAllDomains:s,updateBlockletDomainAliases:r}),!!x.length&&e.jsx(Y,{title:l("common.manualDomains"),description:l("common.manualDomainsDescription"),domains:x,hasMutatePermission:p,blocklet:i,site:f,mobile:m,showAllDomains:s,updateBlockletDomainAliases:r}),!!g.length&&e.jsxs(h,{children:[u,e.jsx(Y,{title:l("common.systemDomains"),description:l("common.systemDomainsDescription"),domains:g,hasMutatePermission:p,blocklet:i,site:f,mobile:m,updateBlockletDomainAliases:r})]})]}),!c.length&&(o?e.jsx(z,{size:16}):e.jsx(wn,{children:l("common.empty")}))]})}be.propTypes={hasPermission:t.bool,blocklet:t.object.isRequired,loadingRuntimeInfo:t.bool,inService:t.bool.isRequired,showAllDomains:t.bool,updateBlockletDomainAliases:t.func,systemTips:t.node};function Q({children:n=null}){return e.jsx(h,{component:"span",sx:{verticalAlign:"bottom"},children:n})}Q.propTypes={children:t.node};function he({domain:n,children:i,suffix:o=null,...a}){const{t:s,locale:r}=A(),u=H(),{href:l,accessibility:m,value:p}=n,f=j.useCallback(()=>e.jsx(ze,{content:je(p),locale:r,style:{marginLeft:"4px",color:u.palette.text.secondary,fontSize:"0.8em"}}),[p,r,u]);return!m||m.loading?e.jsxs(me,{component:"span",...a,children:[e.jsx(L,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:i})}),f(),e.jsx(Q,{children:o}),e.jsx(L,{title:s("blocklet.router.checkUrlAccessible"),placement:"top-end",children:e.jsx(h,{component:"span",className:"status",children:e.jsx(z,{size:13,style:{fontSize:"13px"}})})})]}):m.accessible?e.jsxs(me,{component:"span",...a,children:[e.jsx(h,{component:"a",href:l,target:"_blank",rel:"noopener noreferrer",sx:{color:n.loading?"text.disabled":void 0},children:e.jsx(L,{title:void 0,placement:"top-end",children:e.jsx(h,{component:"span",children:i})})}),f(),e.jsx(Q,{children:o})]}):e.jsxs(me,{component:"span",...a,children:[e.jsx(L,{title:s("blocklet.router.urlInaccessible"),placement:"top-end",children:e.jsx(h,{component:"span",children:i})}),!n.loading&&f(),e.jsx(Q,{children:o})]})}he.propTypes={domain:ae.isRequired,children:t.any.isRequired,suffix:t.node};const me=Mn(h)`
|
|
2
|
-
display: inline-block;
|
|
3
|
-
vertical-align: middle;
|
|
4
|
-
|
|
5
|
-
& > span {
|
|
6
|
-
line-height: 24px;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
&,
|
|
10
|
-
& > * {
|
|
11
|
-
color: ${({theme:n})=>n.palette.text.primary};
|
|
12
|
-
font-size: 18px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
&,
|
|
16
|
-
& > * {
|
|
17
|
-
word-break: break-all;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
svg {
|
|
21
|
-
vertical-align: text-top;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.status {
|
|
25
|
-
margin-left: 8px;
|
|
26
|
-
font-size: 13px;
|
|
27
|
-
}
|
|
28
|
-
`;function ge({hasMutatePermission:n,site:i,domain:o,blocklet:a,onDelete:s}){return n&&!o.isProtected?e.jsx(sn,{site:i,domain:o,blocklet:a,onDelete:s}):null}ge.propTypes={hasMutatePermission:t.bool.isRequired,site:t.object.isRequired,domain:ae.isRequired,blocklet:t.object.isRequired,onDelete:t.func.isRequired};function Z({siteId:n,domain:i,blocklet:o,hasMutatePermission:a}){const{info:s}=F(),{t:r,locale:u}=A(),[l,m]=j.useState(!1);return e.jsxs(h,{sx:{display:"flex",justifyContent:"flex-start",alignItems:"center",gap:.5,button:{lineHeight:1}},children:[i.type==="nft-domain"&&e.jsx(qt,{locale:u,nftDid:i.nftDid,didDomainURL:s.nftDomainUrl}),e.jsx(h,{sx:{display:"flex",mt:"-1px"},children:e.jsx(ne,{domain:i,filters:["http"]},`${i.value}-http`)}),a&&i.canGenerateCertificate&&e.jsx(nn,{siteId:n,domain:i.value,domainStatus:i.domainStatus,did:o.meta.did,issuing:l,setIssuing:m,children:({open:p})=>e.jsx(te,{sx:{padding:0},size:"small",onClick:f=>p(f),children:r("router.cert.genLetsEncryptCert.title")})})]})}Z.propTypes={siteId:t.string.isRequired,domain:ae.isRequired,blocklet:t.object.isRequired,hasMutatePermission:t.bool.isRequired};function Y({title:n,description:i,domains:o=[],hasMutatePermission:a,blocklet:s,site:r,mobile:u,showAllDomains:l=!1,updateBlockletDomainAliases:m=()=>{}}){const[p,f]=j.useState(!1),c=j.useMemo(()=>l||p?o:o.slice(0,1),[o,p,l]),g=o.length>1,y=x=>a&&!x.isProtected;return e.jsx(We,{elevation:0,sx:{p:3,pb:l?3:1.5,display:"flex",alignItems:"flex-start",gap:3,borderRadius:2,border:"1px solid",borderColor:"divider",transition:"box-shadow 0.2s ease-in-out"},children:e.jsxs(W,{sx:{width:1},children:[e.jsxs(h,{sx:{mb:1.5},children:[e.jsx(R,{variant:"h6",children:n}),e.jsx(R,{sx:{fontSize:12,color:"text.secondary",mt:.5},children:i})]}),c.map((x,b)=>e.jsxs(W,{children:[b!==0&&e.jsx(h,{sx:{my:.75,width:1,height:"1px"}}),!u&&e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(h,{sx:{height:28,display:"flex",alignItems:"center"},children:e.jsx(ne,{domain:x,filters:["domain"]},`${x.value}-domain`)}),e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,svg:{width:"1em",height:"1em"},img:{width:"0.9em",height:"0.9em"}},children:[e.jsx(he,{domain:x,target:"_blank",children:x.value}),e.jsx(h,{sx:{mt:"2px"},children:e.jsx(Z,{siteId:s.site?.id,domain:x,blocklet:s,hasMutatePermission:a})})]})]}),e.jsx(h,{sx:{button:{padding:0}},children:e.jsx(ge,{hasMutatePermission:a,site:r,domain:x,blocklet:s,onDelete:()=>m(x,"delete")})})]}),u&&e.jsxs(h,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs(h,{sx:{display:"flex",justifyContent:"flex-start",gap:1},children:[e.jsx(h,{sx:{height:28,display:"flex",alignItems:"center"},children:e.jsx(ne,{domain:x,filters:["domain"]},`${x.value}-domain`)}),e.jsx(he,{domain:x,target:"_blank",suffix:y(x)?null:e.jsx(h,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"space-between",svg:{width:"1em",height:"1rem"},img:{width:"0.9rem",height:"0.9rem"}},children:e.jsx(Z,{siteId:s.site?.id,domain:x,blocklet:s,hasMutatePermission:a})}),children:x.value})]}),y(x)&&e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",ml:"18px"},children:[e.jsx(h,{sx:{display:"flex",alignItems:"center"},children:e.jsx(Z,{siteId:s.site?.id,domain:x,blocklet:s,hasMutatePermission:a})}),e.jsx(h,{sx:{button:{padding:0}},children:e.jsx(ge,{hasMutatePermission:a,site:r,domain:x,blocklet:s,onDelete:()=>m(x,"delete")})})]})]})]},x.value)),g&&!l&&e.jsx(te,{onClick:()=>f(!p),sx:{p:0,mt:.5,alignSelf:"center"},children:p?e.jsx(Ln,{}):e.jsx(Fn,{})})]})})}Y.propTypes={title:t.string.isRequired,description:t.string.isRequired,domains:t.array.isRequired,hasMutatePermission:t.bool.isRequired,blocklet:t.object.isRequired,site:t.object.isRequired,mobile:t.bool.isRequired,showAllDomains:t.bool,updateBlockletDomainAliases:t.func};const rn=j.createContext({}),{Provider:Mt,Consumer:fi}=rn;function Bt({children:n}){const[i,o]=se({domain:"",error:null}),{locale:a}=A(),s={error:i.error,domain:i.domain,setError:r=>{o({error:r})},setDomain:r=>{const u=je(r),l=Ke(u,a);o({domain:u,error:l})}};return e.jsx(Mt,{value:{value:s},children:n})}function Ut(){const{value:n}=j.useContext(rn);return n}var ue,Me;function zt(){if(Me)return ue;Me=1;const{joinURL:n}=ct(),i=dt(),o="z2qaGosS3rZ7m5ttP3Nd4V4qczR9TryTcRV4p";return ue={DID_DOMAIN_SERVICE_DID:o,getDidDomainServiceURL:async s=>{if(!s||!s?.trim())return null;const r=new URL(s);r.pathname="__blocklet__.js",r.searchParams.set("type","json");const{data:u}=await i.get(r.toString()),l=u?.componentMountPoints?.find(c=>c.did===o),m=new URL(s);m.pathname=l?.mountPoint;const p=m.toString(),f=n(p,"/api");return{base:p,api:f,domain:n(f,"/domains")}}},ue}var Nt=zt();const $t=He(Qn),_t=He(Zn);var pe,Be;function Ot(){if(Be)return pe;Be=1;const n=$t,i=_t;function o(s){return!s||typeof s!="string"?!1:s.split(".").length===2}return pe={isTopLevelDomain:o,formatTopLevelDidDomain:s=>{const r=n(i(s));return r&&(o(r)?`www.${r}`:r)}},pe}var Ue=Ot(),Wt=mt();const Ht=Yn(Wt);function an({domain:n="",resolvedTarget:i,...o}){const{t:a,locale:s}=A();return e.jsxs(h,{sx:{backgroundColor:"rgb(236, 251, 253)",borderColor:"rgb(236, 251, 253)",borderRadius:"8px",padding:"12px"},...o,children:[e.jsxs(h,{sx:{display:"flex",flexWrap:"wrap"},children:[a("router.domain.setup.tipStart"),n&&e.jsx(h,{sx:{mx:.5,color:"primary.main",fontWeight:"fontWeightBold"},children:n}),a("router.domain.setup.tipEnd"),":"]}),e.jsxs(W,{sx:{gap:.5,"&>div":{mb:0},marginTop:"12px"},children:[e.jsx(De,{label:a("router.domain.setup.recordType"),value:"CNAME",locale:s}),e.jsx(De,{label:a("router.domain.setup.recordValue"),value:i,locale:s})]})]})}an.propTypes={domain:t.string,resolvedTarget:t.string.isRequired};function De({locale:n,label:i,value:o}){const a=ie(r=>r.breakpoints.down("md")),s=H();return e.jsx(yt,{name:i,nameWidth:120,children:e.jsxs(h,{sx:{display:"flex",alignItems:"center",lineHeight:1},children:[e.jsx(R,{component:"span",sx:[{color:"primary.main",overflow:"auto"},a?{maxWidth:"95%",wordWrap:"break-word"}:{wordWrap:"break-word"}],children:o}),e.jsx(ze,{content:o,locale:n,style:{marginLeft:"4px",color:s.palette.text.secondary}})]})})}De.propTypes={locale:t.string.isRequired,label:t.string.isRequired,value:t.string.isRequired};function ln({children:n=null,href:i="",sx:o=null,showIcon:a=!1,...s}){const r=H();return e.jsxs(Bn,{href:i,target:"_blank",...s,sx:{display:"inline-flex",alignItems:"center",color:"text.primary",":hover":{color:r.palette.primary.main},...o},children:[n,a&&e.jsx(Un,{fontSize:"small",sx:{ml:"4px",fontSize:"1rem"}})]})}ln.propTypes={children:t.node,sx:t.object,href:t.string,showIcon:t.bool};function cn({records:n}){return e.jsx(zn,{component:h,sx:{".MuiTableCell-root":{color:"text.primary"}},children:e.jsxs(Nn,{children:[e.jsx($n,{children:e.jsxs(Te,{children:[e.jsx(_,{children:"Type"}),e.jsx(_,{children:"Name"}),e.jsx(_,{children:"Data"})]})}),e.jsx(_n,{children:n.map(i=>e.jsxs(Te,{children:[e.jsx(_,{children:i.type}),e.jsx(_,{children:i.name}),e.jsx(_,{sx:{wordBreak:"break-word"},children:e.jsx(bt,{children:i.data})})]},i.name))})]})})}cn.propTypes={records:t.array.isRequired};function dn({url:n,domain:i=""}){const{t:o}=A();return e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:2},children:[e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:1},children:[e.jsx(R,{component:"h3",variant:"h6",children:o("setting.dns.step1Title")}),e.jsxs(R,{component:"section",children:[o("setting.dns.step1Desc1"),e.jsx(ln,{href:"https://lookup.icann.org/",target:"_blank",children:"ICANN"})]})]}),e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:1},children:[e.jsx(R,{component:"h3",variant:"h6",children:o("setting.dns.step2Title",{url:n})}),e.jsx(R,{component:"section",children:o("setting.dns.step2Desc")})]}),e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:1},children:[e.jsx(R,{component:"h3",variant:"h6",children:o("setting.dns.step3Title")}),e.jsx(R,{component:"section",children:o("setting.dns.step3Desc")}),e.jsx(cn,{records:[{type:"CNAME",name:jt(n),data:i}]})]})]})}dn.propTypes={url:t.string.isRequired,domain:t.string};const mn=j.createContext();function Vt({children:n}){const{t:i}=A(),{api:o}=F(),{blocklet:a}=oe(),[s,r]=j.useState(null),u=j.useCallback(async(p,f)=>{try{const c=await o.getBlocklet({input:{domain:p,did:a?.meta?.did}});return c?.blocklet?new Promise(g=>{r({title:i("setting.domain.conflictTitle",{domain:p}),description:i("setting.domain.conflictDescription",{domain:p,title:c.blocklet.meta?.title,from:c.blocklet.meta?.title,to:a.meta?.title}),confirm:i("common.confirm"),cancel:i("common.cancel"),onConfirm:async()=>{r(null),await f?.(),g(!0)},onCancel:()=>{r(null),g(!1)}})}):!1}catch(c){return console.error(c),E.error(N(c)),!1}},[o,i,a]),l=j.useCallback(()=>s?e.jsx(re,{title:s.title,description:s.description,confirm:s.confirm,cancel:s.cancel,onConfirm:s.onConfirm,onCancel:s.onCancel}):null,[s]),m=j.useMemo(()=>({checkConflict:u}),[u]);return e.jsxs(mn.Provider,{value:m,children:[n,l()]})}function un(){return j.useContext(mn)}function pn({siteId:n,teamDid:i,cnameDomain:o,defaultCustomDomain:a="",onInputDomain:s=J,appId:r="",appPk:u="",onSuccess:l=J,onError:m=J,disabled:p=!1,autoFocus:f=!0,inBlockletSetup:c=!1,shouldCheckDomain:g=!1,onStateChange:y=J,currentIp:x="",...b}){const{t:d,locale:w}=A(),{api:C,info:q}=F(),{blocklet:B}=oe(),M=Ut(),U=H(),T=ut({key:"sm"}),[S,P]=se({submittingDomain:!1,domain:a,error:null,type:q?.nftDomainUrl?"nftDomain":"inputDomain",showDnsTip:!1}),le=xe.getDisplayName(B),{checkConflict:ve}=un(),{connectApi:gn}=pt(),V=Dt(()=>Nt.getDidDomainServiceURL(q?.nftDomainUrl));if(q?.nftDomainUrl&&V.loading)return e.jsx(h,{...b,onError:m,currentIp:x,children:e.jsx(Ee,{relative:"parent",children:e.jsx(z,{})})});if(V.error)return e.jsx(h,{...b,onError:m,currentIp:x,children:e.jsx(Ee,{relative:"parent",children:V.error.message})});const Ce=V.value,ce=()=>{P({invalidDNSDomain:null})},we=async(D,v,k=!1)=>{await C.addDomainAlias({input:{id:n,domainAlias:D,teamDid:i,inBlockletSetup:!0,force:k}}),P({submittingDomain:!1}),l({domain:D,type:"inputDomain",canGenerateCertificate:!v})},de=async(D,v)=>{y(d("setting.domain.addingDomain"));try{await we(D,v,!1)}catch(k){if(console.error(k),ce(),N(k).includes("already exists")){await ve(D,()=>we(D,v,!0));return}E.error(N(k))}},Se=async({domain:D,type:v,nftDid:k,chainHost:O})=>{try{if(!g){if(v==="inputDomain"){await de(D);return}l({domain:D,type:v,nftDid:k,chainHost:O});return}y({text:d("setting.domain.checkingResolvable")});let I=30;const $=3e3,jn=I*1e3/$,ke=setInterval(()=>{if(I<=0){clearInterval(ke);return}y({text:`${d("setting.domain.checkingResolvable")} (${I--}s)`})},1e3),G=await Ht(()=>C.getDomainDNS({input:{teamDid:i,domain:D}}),{retries:jn,minTimeout:$,maxTimeout:$,onFailedAttempt:console.error});if(clearInterval(ke),!G?.isDnsResolved||!G?.isCnameMatch){let X="";if(G.isDnsResolved?G.isCnameMatch||(X=d("setting.domain.resolvedAddressError",{domain:D,curDomain:o})):X=d("setting.domain.cannotResolve",{domain:D}),v==="nftDomain"){E.error(X),l({domain:D,type:"nftDomain"});return}y({text:""}),P({invalidDNSDomain:{domain:D,error:X},domain:D,type:v,submittingDomain:!1});return}if(v==="nftDomain"){l({domain:D,type:"nftDomain"});return}await de(D)}catch(I){E.error(I.message),y({text:""}),P({submittingDomain:!1})}},Re=async({domain:D,nftDid:v,chainHost:k,force:O})=>{let I=Le(D);I=Ue.formatTopLevelDidDomain(I),P({submittingDomain:!0}),await C.addDomainAlias({input:{id:n,type:"nft-domain",domainAlias:I,nftDid:v,chainHost:k,teamDid:i,inBlockletSetup:c,force:O}});const $="nftDomain";P({type:$}),await Se({domain:I,type:$,nftDid:v,chainHost:k})},Dn=async({domain:D,nftDid:v,chainHost:k,isDomainOwner:O})=>{if(!O){const I=d("router.domainAlias.addDomainNFT.authorizeFailed");E.error(I),P({submittingDomain:!1,error:I});return}try{await Re({domain:D,nftDid:v,chainHost:k,force:!1})}catch(I){if(console.error(I),ce(),N(I).includes("already exists")){await ve(D,()=>Re({domain:D,nftDid:v,chainHost:k,force:!0}));return}E.error(N(I))}finally{P({submittingDomain:!1})}},yn=async()=>{try{P({submittingDomain:!0});const D=Le(S.domain);if(q.nftDomainUrl&&Ce&&(await C.isDidDomain({input:{domain:D}})).value===!0){gn.openPopup({prefix:"/connect-to-did-domain",custom:!0,locale:w,extraParams:{provider:"wallet",delegatee:r,delegateePk:u,domain:Ue.formatTopLevelDidDomain(S.domain),appName:le,appUrl:xe.getAppUrl(B)},message:{title:d("router.domainAlias.addDomainNFT.connect.title",{appName:le}),scan:d("router.domainAlias.addDomainNFT.connect.scan",{domain:S.domain,appName:le}),confirm:d("router.domainAlias.addDomainNFT.connect.confirm"),success:d("router.domainAlias.addDomainNFT.connect.success")},onSuccess:Dn,onError:k=>{E.error(k.message),P({submittingDomain:!1})},onClose:()=>P({submittingDomain:!1}),checkTimeout:60*5e3},{baseUrl:Ce.base,locale:w});return}await Se({domain:D,type:S.type})}catch(D){P({submittingDomain:!1}),M.setError(D.message)}},Ae=M.error||S.error;return e.jsx(h,{...b,onError:m,currentIp:x,children:e.jsxs(h,{sx:{display:"flex",flexDirection:"column",justifyContent:"flex-start",gap:"1em"},children:[e.jsxs(h,{component:"form",onSubmit:D=>{D.preventDefault(),yn()},sx:{display:"flex",flexDirection:"column",gap:"8px"},children:[e.jsx(R,{sx:{color:U.palette.text.primary},children:d("router.domainAlias.add.tips")}),e.jsx(On,{sx:{display:"block",marginTop:"8px"},label:d("router.domainAlias.add.domainDescription"),helperText:S.type==="inputDomain"&&Ae||d("router.domainAlias.add.helperText"),fullWidth:!0,disabled:p,value:S.domain,size:"small",variant:"outlined",error:!!Ae&&S.type==="inputDomain",onChange:D=>{const v=je(D.target?.value);M.setDomain(v);const k=Ke(v,w);P({domain:v,error:k,type:"inputDomain"}),s({domain:v,error:k,type:"inputDomain"})},autoFocus:f,onBlur:()=>{M.domain||(P({error:null}),M.setError(null))},slotProps:{htmlInput:{"data-cy":"domain-name-input"}}}),e.jsx(h,{sx:{width:"100%",display:"flex",justifyContent:"flex-end"},children:e.jsx(Ne,{"data-cy":"confirm-add-domain",fullWidth:T,variant:"contained",loading:S.submittingDomain,type:"submit",children:d("common.add")})}),e.jsx(h,{sx:{backgroundColor:()=>Wn(U.palette.primary.light,.1),borderRadius:"8px",padding:"12px"},children:d("router.domainAlias.addDomainNFT.topLevelDidDomainHint")}),e.jsxs(h,{sx:{cursor:"pointer",fontSize:"14px",display:"flex",alignItems:"center",gap:"4px",lineHeight:1,color:U.palette.primary.main},onClick:()=>P({showDnsTip:!S.showDnsTip}),children:[e.jsx(Hn,{fontSize:"1em"}),d("router.domainAlias.showTipHint")]}),S.showDnsTip&&e.jsx(an,{domain:S.domain,resolvedTarget:o,style:{marginTop:"4px"}})]}),S.invalidDNSDomain&&e.jsx(re,{maxWidth:"md",title:d("common.reminder"),description:e.jsxs(W,{sx:{gap:2},children:[e.jsx(ye,{severity:"warning",children:d("setting.domain.invalidDNSReminder",{error:S.invalidDNSDomain.error})}),e.jsx(dn,{url:S.domain,domain:o})]}),color:"primary",confirm:d("setting.domain.continueAdd"),onConfirm:()=>de(S.invalidDNSDomain.domain,S.type),onCancel:ce})]})})}pn.propTypes={siteId:t.string.isRequired,currentIp:t.string,teamDid:t.string.isRequired,cnameDomain:t.string.isRequired,defaultCustomDomain:t.string,onInputDomain:t.func,onSuccess:t.func,appId:t.string,appPk:t.string,disabled:t.bool,autoFocus:t.bool,inBlockletSetup:t.bool,shouldCheckDomain:t.bool,onStateChange:t.func,onError:t.func};function fn({id:n,children:i=null,title:o="",teamDid:a="",systemDomains:s,appId:r=null,appPk:u,onAddDomainAlias:l=()=>{},...m}){const{t:p}=A(),[f,c]=se({loading:!1,confirmSetting:null}),g=s.find(d=>fe.isDidDomain(d)),y=()=>{c({loading:!1,confirmSetting:null})},x={title:o||p("router.domainAlias.add.title"),description:function(w,C,q){return e.jsx(pn,{siteId:n,teamDid:a,cnameDomain:g,onSuccess:B=>{l(B),c({confirmSetting:null})},onInputDomain:({domain:B,type:M,error:U})=>{C({...w,domain:B,type:M,__disableConfirm:!!U}),q(U)},appId:r,appPk:u,...m})},confirm:p("common.confirm"),cancel:p("common.cancel"),params:{domain:"",__disableConfirm:!0},onCancel:y},b=d=>{d.stopPropagation(),c({confirmSetting:x})};return e.jsxs(e.Fragment,{children:[typeof i=="function"?i({loading:f.loading,open:b}):e.jsxs(Oe,{onClick:b,className:"rule-action","data-cy":"action-add-domain-alias",children:[f.loading?e.jsx(z,{size:16}):e.jsx(Vn,{style:{fontSize:18,marginRight:5}}),p("router.domainAlias.add.title")]}),f.confirmSetting&&e.jsx(re,{title:f.confirmSetting.title,description:f.confirmSetting.description,confirm:f.confirmSetting.confirm,cancel:f.confirmSetting.cancel,params:f.confirmSetting.params,onCancel:f.confirmSetting.onCancel,showConfirm:!1,showCancel:!0,displayError:!1,color:"primary",loading:f.loading,maxWidth:"sm"})]})}fn.propTypes={id:t.string.isRequired,children:t.any,title:t.string,teamDid:t.string,systemDomains:t.arrayOf(t.string).isRequired,appId:t.string,appPk:t.string.isRequired,onAddDomainAlias:t.func};function Gt(n){return e.jsx(Bt,{children:e.jsx(fn,{...n})})}function xn({appId:n,appPk:i,siteId:o,inBlockletSetup:a,teamDid:s,sx:r={},onAddDomainAlias:u=()=>{},...l}){const{api:m,info:p}=F(),{locale:f,t:c}=A(),{checkConflict:g}=un(),y=async({domain:b,nftDid:d,chainHost:w,force:C})=>{const q={id:o,type:"nft-domain",domainAlias:b,nftDid:d,chainHost:w,teamDid:s,inBlockletSetup:a,force:C};return await m.addDomainAlias({input:q}),q},x=async({domain:b,nftDid:d,chainHost:w})=>{try{const C=await y({domain:b,nftDid:d,chainHost:w,force:!1});u(C)}catch(C){if(N(C).includes("already exists")){await g(b,()=>y({domain:b,nftDid:d,chainHost:w,force:!0}));return}E.error(N(C))}};return e.jsx(Pt,{delegatee:n,delegateePk:i,didDomainURL:p.nftDomainUrl,onSuccess:x,locale:f,variant:"outlined",sx:r,title:c("router.domainAlias.addDomainNFT.buy"),...l})}xn.propTypes={appId:t.string.isRequired,appPk:t.string.isRequired,siteId:t.string.isRequired,inBlockletSetup:t.bool.isRequired,teamDid:t.string.isRequired,sx:t.object,onAddDomainAlias:t.func};function Xt({blocklet:n,bugDidDomainProps:i={},connectDomainProps:o={},updateBlockletDomainAliases:a=()=>{}}){const{t:s}=A(),{info:r}=F(),u=ie(c=>c.breakpoints.down("md")),{site:l}=n,m=j.useMemo(()=>Je(n.site?.domainAliases),[n.site?.domainAliases]),p=n.environments?.find(c=>c.key==="BLOCKLET_APP_PK")?.value,f=ft(m);return e.jsx(Vt,{children:e.jsx(hn,{action:e.jsxs(h,{sx:{display:"flex",alignItems:u?"stretch":"center",flexDirection:u?"column":"row",gap:1},children:[r.nftDomainUrl&&e.jsx(xn,{variant:"contained",appId:n.appPid,appPk:p,siteId:l.id,inBlockletSetup:!1,teamDid:n.meta.did,onAddDomainAlias:c=>{const g={value:c.domainAlias,isProtected:!1,type:c.type,nftDid:c.nftDid,chainHost:c.chainHost,accessibility:{loading:!0}};a(g)},...i}),e.jsx(Gt,{id:l.id,title:s("common.connectExistingDomain"),teamDid:n.meta?.did,appId:n.appPid,appPk:p,systemDomains:f?.map(c=>c.value),onAddDomainAlias:c=>{const g={value:c.domain,isProtected:!1,type:c.type==="nftDomain"?"nft-domain":"",nftDid:c.nftDid,chainHost:c.chainHost,accessibility:{loading:!0},canGenerateCertificate:c.canGenerateCertificate===void 0?!0:c.canGenerateCertificate};a(g)},...o,children:({open:c})=>e.jsxs(te,{variant:"outlined",sx:{borderColor:"#ddd",color:"text.primary","&:hover":{bgcolor:g=>g.palette.primary.main,color:g=>g.palette.primary.contrastText}},"data-cy":"add-domain-alias",onClick:c,disabled:xe.isInProgress(n.status),children:[e.jsx(Gn,{style:{fontSize:"1.3em",marginRight:4}}),s("common.connectExistingDomain")]})})]})})})}Xt.propTypes={blocklet:t.object.isRequired,bugDidDomainProps:t.object,connectDomainProps:t.object,updateBlockletDomainAliases:t.func};function hn({action:n}){const{t:i}=A();return e.jsxs(We,{elevation:0,sx:{p:3,borderRadius:2,border:"1px solid",borderColor:"divider"},children:[e.jsx(h,{sx:{display:"flex",alignItems:"center",gap:2},children:e.jsxs(h,{sx:{flex:1,width:0,mb:1.5},children:[e.jsx(R,{variant:"h6",children:i("common.bugOrConnectDomain")}),e.jsx(R,{sx:{fontSize:12,color:"text.secondary",mt:.5},children:i("common.bugOrConnectDomainTip")})]})}),n]})}hn.propTypes={action:t.element.isRequired};export{Bt as D,Xt as a,pi as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as m}from"./vendor-react-CUXIiAnY.js";import{V as n}from"./vendor-ux-BX9dSNUy.js";import{ac as p,_ as l,ae as c,e as u}from"./index-Dijoh4El.js";import{a as x,b as d}from"./domain-action-card-D9HXIIpd.js";import{j as t,ak as k,b1 as f,aX as h}from"./vendor-mui-core-B5XNUjey.js";import"./vendor-utils-CFxoplqC.js";import"./vendor-hooks-U4TTuKG0.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-D4Rvz_D3.js";import"./useSetState-cWrp7qoX.js";import"./permission-BYxNrlaa.js";import"./session-DUT2afHJ.js";import"./useAsyncRetry-CSW1hopB.js";import"./useAsync-DNDhrs-2.js";import"./confirm-BIsS5xyi.js";import"./index-DBs9Ljax.js";import"./actions-CiAs-6JM.js";import"./delete-confirm-DSQSBte5.js";import"./click-to-copy-DXHOGoUP.js";import"./useAsync-Dy8z2Lh_.js";import"./index-BjLM8Gon.js";import"./util-BxX0TJKJ.js";import"./engine-Cx3nUUOw.js";function z(){const{blocklet:o,actions:{updateBlockletDomainAliases:i}}=p(),{inService:r}=l(),{t:e}=n(),a=m.useMemo(()=>{let s=!0;return c(o)&&(s=s&&r),s},[r,o]);return t.jsxs(k,{component:f,sx:{gap:3,maxWidth:820},children:[t.jsxs(t.Fragment,{children:[u.isAccessible(o.status)===!1&&t.jsx(h,{severity:"warning",children:e("blocklet.router.noRunning")}),a&&t.jsx(x,{blocklet:o,updateBlockletDomainAliases:i,connectDomainProps:{shouldCheckDomain:!0}})]}),t.jsx(d,{showAllDomains:!0,updateBlockletDomainAliases:i})]})}export{z as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a5 as e}from"./index-Dijoh4El.js";var a=e();export{a as e};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,a6 as P,ak as E}from"./vendor-mui-core-B5XNUjey.js";import{r as k,i as T}from"./vendor-react-CUXIiAnY.js";import{o as j}from"./vendor-arcblock-D4Rvz_D3.js";import{V as C,H as d,s as S}from"./vendor-ux-BX9dSNUy.js";import{v as W,c as v,S as I,s as R,b as U}from"./index-Dijoh4El.js";import{K as b}from"./landing-page-zT1Tduxx.js";import{w as L}from"./wrap-locale-Dk2yVg3Y.js";import{g as N}from"./get-safe-url-pZvXlaJu.js";import"./vendor-utils-CFxoplqC.js";import"./vendor-hooks-U4TTuKG0.js";import"./lottie-web-4koyQiv_.js";import"./index-5B_H2zYd.js";function _({SessionContext:n,webWalletUrl:r,onSuccess:o}){const{api:t,session:i}=k.useContext(n),{t:s,locale:h}=C(),f=T(),{searchParams:p}=new URL(window.location.href),l=p.get("redirect"),g=async(a,w)=>{o(a,w),await i.refresh(),d.success(s("exchangePassport.success")),setTimeout(()=>{if(l){const c=decodeURIComponent(l);c.startsWith(v.WELLKNOWN_SERVICE_PATH_PREFIX)?f(c,{replace:!0}):window.location.href=N(c)}else window.location.href=window.env.pathPrefix||window.env.apiPrefix||"/"},3e3)},u=a=>{d.error(a.message)},m={},x=p.get("componentId");return x&&(m.componentId=x),i.loading?e.jsx(j,{children:e.jsx(P,{})}):e.jsx(b,{did:window?.blocklet?.appPid||window?.env?.appPid,children:e.jsx(E,{sx:{maxWidth:"100%",height:"100%"},children:e.jsx(W,{popup:!0,open:!0,className:"connect",action:"exchange-passport",checkFn:t.get,checkTimeout:10*60*1e3,webWalletUrl:r,onSuccess:g,onError:u,locale:h,messages:{title:s("exchangePassport.dialog.title"),scan:s("exchangePassport.dialog.scan"),confirm:s("exchangePassport.dialog.confirm"),success:s("exchangePassport.dialog.success")},extraParams:m,extraContent:null,hideCloseButton:!0})})})}const B=L(_);function G(){const n=S(),r=(o,t)=>{o.sessionToken&&(R(t(o.sessionToken)),U(t(o.refreshToken)))};return e.jsx(B,{SessionContext:I,webWalletUrl:n,onSuccess:r})}export{G as default};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{a as L,r as l}from"./vendor-react-CUXIiAnY.js";import{j as e,I as E,bi as H,Q,bE as $,O as J,P as Y,ai as Z,o as V,M as ee,W as t,z as te,ak as d,a6 as se,bF as ne,aj as ae,F as re,bG as le}from"./vendor-mui-core-B5XNUjey.js";import{p as oe}from"./vendor-ux-BX9dSNUy.js";import{R as ie}from"./required-B0Gua-D1.js";import{F as ce}from"./form-wrapper-dz0PgYyA.js";import{e as ue}from"./edit.svg-Dz9cVo7r.js";function P({triggers:o=[],onEnterEdit:n,disabled:p}){const a=L.useRef(null),[h,u]=L.useState(!1),C=r=>{u(!1),r()},I=()=>{u(r=>!r)},i=r=>{a.current&&a.current.contains(r.target)||u(!1)};return o.length===0?e.jsx(E,{"data-cy":"schema-form-item-edit",onClick:n,disabled:p,size:"large",children:e.jsx(ue,{})}):e.jsxs(e.Fragment,{children:[e.jsx(H,{variant:"outlined",ref:a,"aria-label":"split button",children:e.jsx(Q,{size:"large","aria-controls":h?"split-button-menu":void 0,"aria-expanded":h?"true":void 0,sx:{paddingLeft:"12px",paddingRight:"12px"},onClick:I,children:e.jsx($,{})})}),e.jsx(J,{sx:{zIndex:9999},open:h,anchorEl:a.current,role:void 0,placement:"bottom-end",children:e.jsx(Y,{children:e.jsx(Z,{onClickAway:i,children:e.jsx(V,{id:"split-button-menu",autoFocusItem:!0,children:o.map(r=>e.jsx(ee,{onClick:()=>C(r.handler),children:r.title},r.key))})})})})]})}P.propTypes={triggers:t.arrayOf(t.shape({key:t.string.isRequired,title:t.string.isRequired,handler:t.func.isRequired})),onEnterEdit:t.func.isRequired,disabled:t.bool.isRequired};const B=(o,n,p)=>o===null&&n&&p?"******":o?n?"******":o:"",de=le`
|
|
2
|
-
0%, 100% {
|
|
3
|
-
transform: scale(1) translateX(0);
|
|
4
|
-
}
|
|
5
|
-
50% {
|
|
6
|
-
transform: scale(1.05) translateX(-3px);
|
|
7
|
-
}
|
|
8
|
-
25%, 75% {
|
|
9
|
-
transform: scale(1.1) translateX(3px);
|
|
10
|
-
}
|
|
11
|
-
`;function fe({label:o="",disabled:n=!1,required:p=!1,initialValue:a="",onChange:h=()=>{},placeholder:u="",style:C={},onSubmit:I=()=>{},secure:i=!1,type:r="",triggers:F=[],formatterBeforeSubmit:q=null,directEditing:x=!1,autoFocus:M=!0,errorTips:S="",...b}){const[z,k]=l.useState(x),[g,T]=l.useState(!1),{t:O}=l.useContext(oe),[_,D]=l.useState(""),[f,N]=l.useState(i&&a==="__encrypted__"?null:a),[c,m]=l.useState(f),[y,j]=l.useState(!1),[A,v]=l.useState(!1),R=async()=>{if(b.validate&&typeof b.validate=="function"){const s=b.validate(c);if(s){D(s);return}}D(""),T(!0);try{if(await I(c)===!1)m(f);else{let w=c;typeof q=="function"&&(w=q(c)),m(w),N(w),j(!1)}}catch{m(f)}finally{T(!1),k(!1)}};l.useEffect(()=>{const s=i&&a==="__encrypted__"?null:a;s!==f&&(N(s),m(s),j(!1))},[a,i,f]);const K=s=>{j(s!==c),m(s),h(s)},W=s=>{s.key==="Enter"&&R()},X=l.useCallback(()=>{v(!0),setTimeout(()=>{v(!1)},500)},[]),G=()=>{if(x&&!n&&!g){R();return}y&&X(),!y&&!n&&!g&&(k(!1),j(!1))},U=z||x?e.jsx(te,{style:{flex:1},fullWidth:!0,value:c,onChange:s=>{K(s.target.value)},autoFocus:M,size:"small",variant:"outlined",placeholder:u,onKeyDown:W,onBlur:G,disabled:n,error:!!S,multiline:r==="textarea",type:i?"password":r||"text",...b}):e.jsx(d,{"data-cy":"schema-form-item-edit",className:"form-item-input slot",style:{whiteSpace:"pre-wrap",cursor:"text"},onClick:()=>{n||k(!0)},sx:{px:1},children:B(c,i,a)?B(c,i,a):e.jsx("span",{className:"placeholder",children:O("common.requiredInputPlaceholder",{name:u||o})})});return e.jsx(ce,{className:"form",style:C,children:e.jsxs(d,{children:[e.jsxs(d,{className:"form-item-label",children:[o,p&&e.jsx(ie,{})]}),e.jsxs(d,{className:"form-item-body",style:{alignItems:"flex-start"},children:[e.jsx(d,{className:"form-item-input",children:U}),e.jsx(d,{className:"form-item-action",style:{marginLeft:!F.length||x?0:12},children:z&&!x?e.jsxs(e.Fragment,{children:[y?e.jsx(E,{"data-cy":"schema-form-item-confirm",onClick:R,disabled:n||g||!y,sx:{animation:A?`${de} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:g?e.jsx(se,{size:24}):e.jsx(ne,{})}):null,e.jsx(E,{"data-cy":"schema-form-item-cancel",onClick:()=>{m(f),k(!1),j(!1)},style:{paddingLeft:y?4:8},disabled:n||g,size:"large",children:e.jsx(ae,{})})]}):e.jsx(d,{children:F.length?e.jsx(P,{triggers:F,disabled:n}):null})})]}),(S||_)&&e.jsx(re,{error:!0,children:S||_})]})})}fe.propTypes={style:t.object,onSubmit:t.func,onChange:t.func,label:t.string,initialValue:t.string,placeholder:t.string,required:t.bool,disabled:t.bool,secure:t.bool,triggers:t.array,formatterBeforeSubmit:t.func,directEditing:t.bool,type:t.string,autoFocus:t.bool,errorTips:t.string};export{fe as F,P as I};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import{j as e,ak as s,a6 as w,a$ as B,bd as N,at as v,W as d}from"./vendor-mui-core-B5XNUjey.js";import{r as l}from"./vendor-react-CUXIiAnY.js";import{C as I}from"./vendor-utils-CFxoplqC.js";import{p as $}from"./vendor-ux-BX9dSNUy.js";import{l as L,a as E,v as z}from"./index-Dijoh4El.js";import{W as A}from"./did-address-Qmm0nyiR.js";import{a as D}from"./page-header-Cgwo2np-.js";import{S as F}from"./layout-CZo9vMzc.js";import{S as P}from"./step-actions-nHHLzUFh.js";import{S as m}from"./button-4KPacREM.js";import"./vendor-hooks-U4TTuKG0.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-D4Rvz_D3.js";import"./content-layout-B5NObRcH.js";import"./use-mobile-Dwc30NoL.js";function R({onNext:n=()=>{},onPrevious:x=()=>{}}){const{locale:u,t}=l.useContext($),{blocklet:a,gas:c,tokenInfo:f,actions:h}=L(),{api:j}=E(),[y,o]=l.useState(!1),{need:p="",current:g="",owe:r=99999,deficiency:k,symbol:b="",endpoint:i}=c||{},{origin:C="/"}=i?new URL(i):{};l.useEffect(()=>{const W=setInterval(()=>{h.refreshFuel()},2e3);return()=>{clearInterval(W)}},[]);const S=()=>{o(!1)};return c?e.jsxs(T,{children:[e.jsx("div",{className:"header",children:e.jsx(D,{title:t("setup.fuel.title"),onClickBack:x})}),e.jsxs(s,{className:"qr-body",children:[e.jsxs(s,{className:"tip",sx:{mb:6},children:[t("setup.fuel.tipStart").replace("slot",""),e.jsx("span",{className:"amount",children:`${p} ${b}`}),t("setup.fuel.tipEnd")]}),e.jsx(s,{sx:{fontSize:16,fontWeight:"fontWeightBold",mb:.5},children:t("setup.fuel.addressTitle")}),e.jsxs(s,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(A,{className:"address",did:a.appDid}),e.jsx(B,{style:{lineHeight:1},target:"_blank",href:I(C,"/explorer/accounts/",a.appDid),underline:"hover",children:e.jsx(N,{className:"icon-launch"})})]}),e.jsx(s,{sx:{my:2},children:e.jsx(m,{color:"primary",onClick:()=>o(!0),disabled:!r,children:t("setup.fuel.fuelApp")})}),e.jsx(z,{popup:!0,open:y,action:"fuel",checkFn:j.get,checkTimeout:10*60*1e3,onSuccess:S,onClose:()=>o(!1),locale:u,messages:{title:t("setup.connect.title"),scan:t("setup.connect.scan"),confirm:t("setup.connect.confirm"),success:t("setup.connect.success")},extraParams:{amount:k,...f,endpoint:i}}),e.jsxs(s,{sx:{display:"flex",color:"text.secondary"},children:[e.jsxs(s,{sx:{display:"flex"},children:[e.jsxs(s,{children:[t("setup.fuel.need"),":"]}),e.jsx(s,{sx:{ml:.5,color:"primary.main",fontWeight:"fontWeightBold"},children:p})]}),e.jsxs(s,{sx:{display:"flex",ml:3},children:[e.jsxs(s,{children:[t("setup.fuel.current"),":"]}),e.jsx(s,{sx:{ml:.5,color:r>0?"error.main":"primary.main",fontWeight:"fontWeightBold"},children:g})]})]})]}),e.jsx(P,{mt:8,children:e.jsx(m,{disabled:r>0,onClick:()=>n(),children:t("setup.next")})})]}):e.jsx(s,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},children:e.jsx(w,{})})}R.propTypes={onNext:d.func,onPrevious:d.func};const T=v(F)`
|
|
2
|
-
.qr-body {
|
|
3
|
-
width: 580px;
|
|
4
|
-
${n=>n.theme.breakpoints.down("md")} {
|
|
5
|
-
width: 80%;
|
|
6
|
-
}
|
|
7
|
-
display: flex;
|
|
8
|
-
flex-direction: column;
|
|
9
|
-
align-items: center;
|
|
10
|
-
|
|
11
|
-
.tip {
|
|
12
|
-
font-size: 16px;
|
|
13
|
-
font-weight: bold;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.address {
|
|
17
|
-
width: 100%;
|
|
18
|
-
text-align: center;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.amount {
|
|
22
|
-
color: ${n=>n.theme.palette.primary.main};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.icon-launch {
|
|
26
|
-
font-size: 16px;
|
|
27
|
-
margin-left: 6px;
|
|
28
|
-
line-height: 1;
|
|
29
|
-
color: ${n=>n.theme.palette.primary.main};
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
`;export{R as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as E,j as e,Q as S,b3 as P,b0 as R,ak as r,T as c,a6 as _}from"./vendor-mui-core-B5XNUjey.js";import{a as W,U as I,c as L,t as p,V as N,W as U}from"./index-Dijoh4El.js";import{o as A}from"./vendor-arcblock-D4Rvz_D3.js";import{p as D}from"./vendor-ux-BX9dSNUy.js";import{g as T,b as w}from"./vendor-hooks-U4TTuKG0.js";import{i as z,r as i,u as F}from"./vendor-react-CUXIiAnY.js";import{K as a}from"./landing-page-zT1Tduxx.js";import{C as K}from"./vendor-utils-CFxoplqC.js";import{u as M}from"./use-window-close-DLSxYDw-.js";import"./lottie-web-4koyQiv_.js";function Z(){const m=z(),l=i.useRef(null),{t:s,locale:d}=i.useContext(D),{api:x,connectApi:f}=W(),[h]=F(),j=E(),k=M(),n=T({ready:!1,success:!1,error:null,invalidSession:!1}),b=()=>{try{const t=new URL(window.location.href);if(t.hash.includes("invalid")){n.invalidSession=!0;return}const u=t.searchParams.get("__connect_url__"),v=N(u);if(!U(v))throw new Error("No token");n.ready=!0}catch{n.invalidSession=!0,m("#invalid",{replace:!0})}};i.useLayoutEffect(()=>b(),[]);const C=w(t=>{n.error=t.message,window.opener?.postMessage({type:"connect-endpoint-message",error:n.error},"*"),m("#invalid",{replace:!0})}),g=w(()=>{window.opener?.postMessage({type:"connect-endpoint-message",success:!0},"*"),n.success=!0}),o=h.get("source")||"Generate Access Key";i.useEffect(()=>{l.current&&n.ready&&f.open({locale:d,containerEl:l.current,action:"gen-access-key",extraParams:{remark:o},checkFn:x.get,saveConnect:!1,forceConnected:!1,className:"connect",popup:!1,baseUrl:window.location.origin,prefix:K(window.location.origin,L.WELLKNOWN_SERVICE_PATH_PREFIX,I),messages:{title:s("connectCli.title"),scan:s("connectCli.scan"),confirm:s("auth.confirm"),success:s("connectCli.success")},onSuccess:g,onError:C},{locale:d})},[f,n.ready,x,C,g,d,s,o]);const y=e.jsx(S,{variant:"outlined",color:"primary",size:"small",startIcon:e.jsx(P,{}),href:"/",style:{borderRadius:4},children:s("connectCli.home")});if(n.invalidSession)return e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"error",title:s("connectCli.invalidSession"),description:s("connectCli.invalidSessionDesc"),extra:y})},"invalid");if(n.error){const t=n.error,u=y;return e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"error",title:s("connectCli.connectionError"),description:t,extra:u})},"error")}return n.success?(h.has("closeOnSuccess")&&k(),e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(p,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(R,{style:{color:j.palette.success.main,fontSize:72}}),title:s("connectCli.success",{source:o}),description:`${s("connectCli.successDesc",{source:o})} ${s("connectCli.upload")}`})},"success")):n.ready?e.jsx(a,{did:window.blocklet?.appPid,standalone:!0,children:e.jsxs(r,{sx:{maxWidth:"100%",height:"100%"},children:[e.jsxs(r,{sx:{mb:5},children:[e.jsx(c,{variant:"h4",component:"h1",sx:{mb:1,fontWeight:"bold",textAlign:"center"},children:s("connectCli.tips.title")}),e.jsxs(r,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"center"},children:[e.jsx(c,{sx:{color:"text.secondary"},children:s("connectCli.tips.item1")}),e.jsx(c,{sx:{color:"text.secondary"},children:s("connectCli.tips.item2")}),e.jsx(c,{sx:{color:"text.secondary"},children:s("connectCli.tips.item3")})]})]}),e.jsx(r,{sx:{display:"inline-block"},ref:l})]})},"ready"):e.jsx(A,{children:e.jsx(_,{})})}export{Z as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,ak as a,T as y,a6 as M,b1 as X,Q as O,a$ as Y,D as Z,aX as F,bU as K,b0 as ee}from"./vendor-mui-core-B5XNUjey.js";import{r as d,i as se,u as ne}from"./vendor-react-CUXIiAnY.js";import{Q as te,ar as oe,as as re,at as ie,ay as ae,a as ce,d as le,V as $,t as ue,az as de,c as pe}from"./index-Dijoh4El.js";import{n as v,U as he,C as W}from"./vendor-utils-CFxoplqC.js";import{g as Q,b as p,n as xe,o as fe}from"./vendor-hooks-U4TTuKG0.js";import{M as H,V as J,I as ge,o as V,D as me}from"./vendor-ux-BX9dSNUy.js";import{o as je}from"./vendor-arcblock-D4Rvz_D3.js";import{K as ye}from"./landing-page-zT1Tduxx.js";import{u as we}from"./use-window-close-DLSxYDw-.js";import"./lottie-web-4koyQiv_.js";function Ce({requestAppInfo:l,currentAppInfo:w}){return e.jsxs(a,{sx:{textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[e.jsxs(a,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(H,{src:w.appLogo,alt:"Server",width:48,height:48,useProxyFallback:!0}),e.jsxs(a,{sx:{mx:2,display:"flex",alignItems:"center","& .dot":{width:8,height:8,borderRadius:"50%",bgcolor:"grey.500",mx:.5}},children:[e.jsx(a,{className:"dot"}),e.jsx(a,{className:"dot"}),e.jsx(a,{className:"dot"})]}),e.jsx(H,{src:l.appLogo,alt:l.appName,width:48,height:48,useProxyFallback:!0})]}),e.jsxs(y,{sx:{mb:1,fontSize:"1.2rem"},children:["Authorize"," ",e.jsx(a,{component:"span",sx:{color:"primary.main"},children:l.appName})]})]})}const Ae={en:{notThis:"Not you?",useAnother:"Use another account",authorize:"Authorize",connect:"Connect",cancel:"Cancel"},zh:{notThis:"不是这个?",useAnother:"使用其他账户",authorize:"授权",connect:"Connect",cancel:"取消"}};function Se({session:l,requestAppInfo:w,currentAppInfo:b,children:k=null,userInfo:s=void 0,hideSwitchConnect:N=!1,hideAuthorize:t=!1,hideCancel:L=!1,hideButton:_=!1,notThisText:I=void 0,authorizeText:o=void 0,connectText:c=void 0,cancelText:P=void 0,useAnotherText:C=void 0,slotProps:h=void 0,onConnect:R=v,onAuthorize:f=v,onSwitchConnect:z=v,onSwitchPassport:A=v,onCancel:U=v,ref:D,disableAuthorizeButton:T=!1}){const r=Q({loading:!1}),{locale:S="en"}=J()||{},g=p((B,j={})=>ge(Ae,B,S,"en",j)),x=p(()=>{r.loading=!1}),E=p(()=>{r.loading=!0,R?.(x)}),q=p(()=>{r.loading=!0,z?.(x)}),n=p(()=>{r.loading=!0,f?.(x)}),i=p(()=>{r.loading=!0,A?.(x)}),u=p(()=>{U?.()});if(d.useImperativeHandle(D,()=>({closeLoading:x})),l.loading||!l.initialized)return e.jsx(je,{children:e.jsx(M,{})});const m=s??l?.user;return e.jsx(ye,{did:window.blocklet?.appPid,standalone:!0,children:e.jsx(a,{...h?.root,sx:V({width:420,maxWidth:"100%"},h?.root?.sx),children:e.jsx(te,{hideCloseButton:!0,...h?.didConnectContainer,children:e.jsxs(a,{...h?.contentContainer,sx:V({display:"flex",flexDirection:"column",gap:1.5,p:{xs:2,lg:3,xl:4},pt:{xs:3,xl:4},bgcolor:"background.paper"},h?.contentContainer?.sx),children:[e.jsx(Ce,{requestAppInfo:w,currentAppInfo:b}),m?e.jsxs(e.Fragment,{children:[e.jsx(oe,{user:m,showDid:!0,cardType:ie.Detailed,infoType:re.Minimal,renderTopRightContent:()=>e.jsx(ae,{user:m,switchPassport:i})}),e.jsx(a,{})]}):null,k,_?null:e.jsxs(e.Fragment,{children:[e.jsx(a,{sx:{border:"1px solid",borderColor:"divider",borderRadius:2,overflow:"hidden",my:1}}),e.jsxs(X,{direction:"row",spacing:2,children:[L?null:e.jsx(O,{color:"inherit",variant:"outlined",size:"large",fullWidth:!0,onClick:u,sx:{color:"grey.500"},children:P||g("cancel")}),m&&!t?e.jsxs(O,{variant:"contained",size:"large",fullWidth:!0,onClick:n,disabled:r.loading||T,children:[r.loading?e.jsx(M,{size:20,sx:{mr:1}}):null,o||g("authorize")]}):e.jsxs(O,{variant:"contained",size:"large",fullWidth:!0,disabled:r.loading||T,onClick:E,children:[r.loading?e.jsx(M,{size:20,sx:{mr:1}}):null,c||g("connect")]})]})]}),N||!m?null:e.jsx(a,{sx:{textAlign:"center"},children:e.jsxs(y,{variant:"body2",sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:1},children:[I||g("notThis")," ",e.jsx(Y,{underline:"hover",onClick:q,sx:{cursor:"pointer"},children:C||g("useAnother")})]})})]})})})})}const ve=W(window.location.origin,pe.WELLKNOWN_BLOCKLET_USER_PATH,"settings#user-center-access-key-setting"),G=3e3;function Ue(){const l=d.useRef(null),[w,b]=d.useState(),[k]=xe({targetDate:w}),{session:s}=ce(),N=Z(),t=Q({ready:!1,success:!1,error:null,invalidSession:!1,token:null}),[L,_]=fe("currentUserInfo",{defaultValue:null}),I=se(),{t:o}=J(),[c]=ne(),P=we(),[,C]=d.useState(!0),[h,R]=d.useState({appName:c.get("cli")?c.get("appName")??o("aigne.cli"):"",appLogo:c.get("cli")?c.get("appLogo"):""}),f=c.get("required_roles")||"",z=d.useMemo(()=>{const n=f.split(",")||[];if(n.length===0)return n;const i=he([s.user?.role,(s.user?.passports||[]).map(u=>u.role)].flat().filter(Boolean));return i.length===0?i:n.filter(u=>i.includes(u.toLocaleLowerCase().trim()))},[s.user,f]),A=z.join(","),U=s.user&&f?z.length>0:!0,D=async()=>{C(!0);try{const n=c.get("__url__"),i=n?$(n):null;if(!i){C(!1);return}const u="__blocklet__.js?type=json",B=new URL(i).origin,{data:j}=await de.get(W(B,u));R({appName:j?.appName,appUrl:j?.appUrl,appLogo:W(j?.appUrl,j?.appLogo)})}catch(n){console.error(n)}finally{C(!1)}};d.useEffect(()=>{s.user&&_(s.user)},[s.user]);const T=()=>{D(),s.user&&_(s.user);try{const n=new URL(window.location.href);if(n.hash.includes("invalid")){t.invalidSession=!0;return}const i=n.searchParams.get("__token__"),u=i?$(i):null;if(!u)throw new Error("No token");t.token=u,t.ready=!0}catch(n){t.invalidSession=!0,t.error=n.message,window.opener?.postMessage({type:"connect-aigne-message",error:n.message},"*"),I("#invalid",{replace:!0})}};d.useLayoutEffect(()=>T(),[]);const r=window.blocklet,S=c.get("source")||"Generate Access Key",g=p(async n=>{try{await le.post("/access-key/authorize",{source:S,sid:t.token,requiredRoles:A}),t.success=!0,window.opener?.postMessage({type:"connect-aigne-message",success:!0},"*"),c.has("closeOnSuccess")&&(b(Date.now()+G),setTimeout(()=>P(),G))}catch(i){console.error(i)}finally{n()}}),x=p(()=>{s.login()}),E=p(()=>{window.close()});d.useEffect(()=>{s.initialized&&!s.user&&(me()||x())},[s?.user,s?.initialized,x]),d.useEffect(()=>{s.open||l.current?.closeLoading?.()},[s.open]);const q=()=>t.error?e.jsxs(F,{severity:"error",children:[e.jsx(K,{children:o("aigne.notAuthorized")}),t.error]}):t.success?e.jsx(ue,{style:{backgroundColor:"transparent"},status:"info",icon:e.jsx(ee,{style:{color:N.palette.success.main,fontSize:72}}),title:o("connectCli.success",{source:S}),description:`${o("connectCli.successDesc",{source:S})} ${c.has("closeOnSuccess")?o("connectCli.closeDelay",{seconds:Math.ceil(k/1e3)}):""}`}):e.jsxs(F,{severity:"info",children:[e.jsx(K,{children:o("aigne.connectTo",{appName:r.appName})}),f&&e.jsx(y,{component:"li",variant:"body2",children:A?o("aigne.accessTips.switchPassport",{required_roles:A}):o("aigne.accessTips.switchPassportRequired",{required_roles:f})}),e.jsx(y,{component:"li",variant:"body2",children:o("aigne.accessTips.tips1",{appName:h.appName,accessAppName:r.appName})}),e.jsx(y,{component:"li",variant:"body2",children:o("aigne.accessTips.tips2",{appName:h.appName})}),e.jsx(y,{component:"li",variant:"body2",sx:{"& a":{color:"inherit",textDecoration:"underline"}},dangerouslySetInnerHTML:{__html:o("aigne.accessTips.tips3",{url:ve,accessAppName:r.appName})}})]});return e.jsx(Se,{ref:l,session:s,requestAppInfo:h,currentAppInfo:r,userInfo:L,onAuthorize:g,onConnect:x,onSwitchConnect:s.switchDid,onCancel:E,hideAuthorize:!!t.error,hideSwitchConnect:t.success,hideButton:t.success,authorizeText:o("common.approve"),onSwitchPassport:s.switchDid,slotProps:{root:{sx:{width:500}}},disableAuthorizeButton:!U,children:q()})}export{Ue as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{T as t}from"./index-Dijoh4El.js";import{H as e}from"./vendor-ux-BX9dSNUy.js";function c(...o){try{return t(...o)}catch(r){throw e.error("Invalid redirect url"),console.error("Invalid redirect url",r),r}}export{c as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as r}from"./vendor-ux-BX9dSNUy.js";import{X as _,Y as e}from"./index-Dijoh4El.js";const m={en:_(e),ar:()=>r(()=>import("./ar-BBr9bsOg.js"),[],import.meta.url).then(t=>_(t.default)),de:()=>r(()=>import("./de-CDBOH3k5.js"),[],import.meta.url).then(t=>_(t.default)),es:()=>r(()=>import("./es-BJ8CsIZi.js"),[],import.meta.url).then(t=>_(t.default)),fr:()=>r(()=>import("./fr-DSXQFpNy.js"),[],import.meta.url).then(t=>_(t.default)),hi:()=>r(()=>import("./hi-DLsQ4VdX.js"),[],import.meta.url).then(t=>_(t.default)),id:()=>r(()=>import("./id-AzAQyOHL.js"),[],import.meta.url).then(t=>_(t.default)),ja:()=>r(()=>import("./ja-C3ccbBe-.js"),[],import.meta.url).then(t=>_(t.default)),ko:()=>r(()=>import("./ko-9Vbo8tR2.js"),[],import.meta.url).then(t=>_(t.default)),pt:()=>r(()=>import("./pt-iqygmSLa.js"),[],import.meta.url).then(t=>_(t.default)),ru:()=>r(()=>import("./ru-BkfMvpq6.js"),[],import.meta.url).then(t=>_(t.default)),th:()=>r(()=>import("./th-D-pgFsDa.js"),[],import.meta.url).then(t=>_(t.default)),vi:()=>r(()=>import("./vi-BuffIn3I.js"),[],import.meta.url).then(t=>_(t.default)),"zh-TW":()=>r(()=>import("./zh-tw-CeXBj2i0.js"),[],import.meta.url).then(t=>_(t.default)),zh:()=>r(()=>import("./zh-Dr9buZnV.js"),[],import.meta.url).then(t=>_(t.default))};export{m as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{X as z}from"./vendor-ux-BX9dSNUy.js";function w(a){if(a===null||a===!0||a===!1)return NaN;var e=Number(a);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function s(a,e){if(e.length<a)throw new TypeError(a+" argument"+(a>1?"s":"")+" required, but only "+e.length+" present")}function f(a){s(1,arguments);var e=Object.prototype.toString.call(a);return a instanceof Date||z(a)==="object"&&e==="[object Date]"?new Date(a.getTime()):typeof a=="number"||e==="[object Number]"?new Date(a):((typeof a=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function se(a,e){s(2,arguments);var t=f(a),r=w(e);return isNaN(r)?new Date(NaN):(r&&t.setDate(t.getDate()+r),t)}function de(a,e){s(2,arguments);var t=f(a).getTime(),r=w(e);return new Date(t+r)}function Et(a,e){s(2,arguments);var t=w(e),r=t*7;return se(a,r)}function le(a,e){s(2,arguments);var t=f(a),r=w(e);if(isNaN(r))return new Date(NaN);if(!r)return t;var n=t.getDate(),i=new Date(t.getTime());i.setMonth(t.getMonth()+r+1,0);var o=i.getDate();return n>=o?i:(t.setFullYear(i.getFullYear(),i.getMonth(),n),t)}function Ft(a,e){s(2,arguments);var t=w(e);return le(a,t*12)}function $t(a,e){s(2,arguments);var t=f(a),r=f(e),n=t.getFullYear()-r.getFullYear(),i=t.getMonth()-r.getMonth();return n*12+i}function It(a){s(1,arguments);var e=f(a),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function fe(a){var e=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()));return e.setUTCFullYear(a.getFullYear()),a.getTime()-e.getTime()}function X(a){s(1,arguments);var e=f(a);return e.setHours(0,0,0,0),e}var J=6e4,Z=36e5,Ht=1e3,ce={};function C(){return ce}function qt(a,e){var t,r,n,i,o,u,l,d;s(1,arguments);var v=C(),c=w((t=(r=(n=(i=e?.weekStartsOn)!==null&&i!==void 0?i:e==null||(o=e.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:v.weekStartsOn)!==null&&r!==void 0?r:(l=v.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&t!==void 0?t:0);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=f(a),g=h.getDay(),y=(g<c?-7:0)+6-(g-c);return h.setDate(h.getDate()+y),h.setHours(23,59,59,999),h}function Rt(a){s(1,arguments);var e=f(a),t=e.getFullYear();return e.setFullYear(t+1,0,0),e.setHours(23,59,59,999),e}function ve(a){return s(1,arguments),a instanceof Date||z(a)==="object"&&Object.prototype.toString.call(a)==="[object Date]"}function me(a){if(s(1,arguments),!ve(a)&&typeof a!="number")return!1;var e=f(a);return!isNaN(Number(e))}function he(a,e){s(2,arguments);var t=w(e);return de(a,-t)}var ge=864e5;function we(a){s(1,arguments);var e=f(a),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),n=t-r;return Math.floor(n/ge)+1}function F(a){s(1,arguments);var e=1,t=f(a),r=t.getUTCDay(),n=(r<e?7:0)+r-e;return t.setUTCDate(t.getUTCDate()-n),t.setUTCHours(0,0,0,0),t}function K(a){s(1,arguments);var e=f(a),t=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(t+1,0,4),r.setUTCHours(0,0,0,0);var n=F(r),i=new Date(0);i.setUTCFullYear(t,0,4),i.setUTCHours(0,0,0,0);var o=F(i);return e.getTime()>=n.getTime()?t+1:e.getTime()>=o.getTime()?t:t-1}function ye(a){s(1,arguments);var e=K(a),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var r=F(t);return r}var be=6048e5;function Te(a){s(1,arguments);var e=f(a),t=F(e).getTime()-ye(e).getTime();return Math.round(t/be)+1}function $(a,e){var t,r,n,i,o,u,l,d;s(1,arguments);var v=C(),c=w((t=(r=(n=(i=e?.weekStartsOn)!==null&&i!==void 0?i:e==null||(o=e.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:v.weekStartsOn)!==null&&r!==void 0?r:(l=v.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&t!==void 0?t:0);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=f(a),g=h.getUTCDay(),y=(g<c?7:0)+g-c;return h.setUTCDate(h.getUTCDate()-y),h.setUTCHours(0,0,0,0),h}function ee(a,e){var t,r,n,i,o,u,l,d;s(1,arguments);var v=f(a),c=v.getUTCFullYear(),h=C(),g=w((t=(r=(n=(i=e?.firstWeekContainsDate)!==null&&i!==void 0?i:e==null||(o=e.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:h.firstWeekContainsDate)!==null&&r!==void 0?r:(l=h.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(g>=1&&g<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=new Date(0);y.setUTCFullYear(c+1,0,g),y.setUTCHours(0,0,0,0);var S=$(y,e),p=new Date(0);p.setUTCFullYear(c,0,g),p.setUTCHours(0,0,0,0);var k=$(p,e);return v.getTime()>=S.getTime()?c+1:v.getTime()>=k.getTime()?c:c-1}function De(a,e){var t,r,n,i,o,u,l,d;s(1,arguments);var v=C(),c=w((t=(r=(n=(i=e?.firstWeekContainsDate)!==null&&i!==void 0?i:e==null||(o=e.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:v.firstWeekContainsDate)!==null&&r!==void 0?r:(l=v.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&t!==void 0?t:1),h=ee(a,e),g=new Date(0);g.setUTCFullYear(h,0,c),g.setUTCHours(0,0,0,0);var y=$(g,e);return y}var pe=6048e5;function Oe(a,e){s(1,arguments);var t=f(a),r=$(t,e).getTime()-De(t,e).getTime();return Math.round(r/pe)+1}function m(a,e){for(var t=a<0?"-":"",r=Math.abs(a).toString();r.length<e;)r="0"+r;return t+r}var D={y:function(e,t){var r=e.getUTCFullYear(),n=r>0?r:1-r;return m(t==="yy"?n%100:n,t.length)},M:function(e,t){var r=e.getUTCMonth();return t==="M"?String(r+1):m(r+1,2)},d:function(e,t){return m(e.getUTCDate(),t.length)},a:function(e,t){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(e,t){return m(e.getUTCHours()%12||12,t.length)},H:function(e,t){return m(e.getUTCHours(),t.length)},m:function(e,t){return m(e.getUTCMinutes(),t.length)},s:function(e,t){return m(e.getUTCSeconds(),t.length)},S:function(e,t){var r=t.length,n=e.getUTCMilliseconds(),i=Math.floor(n*Math.pow(10,r-3));return m(i,t.length)}},M={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Me={G:function(e,t,r){var n=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){var n=e.getUTCFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return D.y(e,t)},Y:function(e,t,r,n){var i=ee(e,n),o=i>0?i:1-i;if(t==="YY"){var u=o%100;return m(u,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):m(o,t.length)},R:function(e,t){var r=K(e);return m(r,t.length)},u:function(e,t){var r=e.getUTCFullYear();return m(r,t.length)},Q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return m(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return m(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){var n=e.getUTCMonth();switch(t){case"M":case"MM":return D.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){var n=e.getUTCMonth();switch(t){case"L":return String(n+1);case"LL":return m(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){var i=Oe(e,n);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):m(i,t.length)},I:function(e,t,r){var n=Te(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):m(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):D.d(e,t)},D:function(e,t,r){var n=we(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):m(n,t.length)},E:function(e,t,r){var n=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){var i=e.getUTCDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return m(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){var i=e.getUTCDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return m(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){var n=e.getUTCDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return m(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){var n=e.getUTCHours(),i=n/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,r){var n=e.getUTCHours(),i;switch(n===12?i=M.noon:n===0?i=M.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){var n=e.getUTCHours(),i;switch(n>=17?i=M.evening:n>=12?i=M.afternoon:n>=4?i=M.morning:i=M.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){var n=e.getUTCHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return D.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):D.H(e,t)},K:function(e,t,r){var n=e.getUTCHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):m(n,t.length)},k:function(e,t,r){var n=e.getUTCHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):m(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):D.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):D.s(e,t)},S:function(e,t){return D.S(e,t)},X:function(e,t,r,n){var i=n._originalDate||e,o=i.getTimezoneOffset();if(o===0)return"Z";switch(t){case"X":return A(o);case"XXXX":case"XX":return O(o);case"XXXXX":case"XXX":default:return O(o,":")}},x:function(e,t,r,n){var i=n._originalDate||e,o=i.getTimezoneOffset();switch(t){case"x":return A(o);case"xxxx":case"xx":return O(o);case"xxxxx":case"xxx":default:return O(o,":")}},O:function(e,t,r,n){var i=n._originalDate||e,o=i.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+G(o,":");case"OOOO":default:return"GMT"+O(o,":")}},z:function(e,t,r,n){var i=n._originalDate||e,o=i.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+G(o,":");case"zzzz":default:return"GMT"+O(o,":")}},t:function(e,t,r,n){var i=n._originalDate||e,o=Math.floor(i.getTime()/1e3);return m(o,t.length)},T:function(e,t,r,n){var i=n._originalDate||e,o=i.getTime();return m(o,t.length)}};function G(a,e){var t=a>0?"-":"+",r=Math.abs(a),n=Math.floor(r/60),i=r%60;if(i===0)return t+String(n);var o=e;return t+String(n)+o+m(i,2)}function A(a,e){if(a%60===0){var t=a>0?"-":"+";return t+m(Math.abs(a)/60,2)}return O(a,e)}function O(a,e){var t=e||"",r=a>0?"-":"+",n=Math.abs(a),i=m(Math.floor(n/60),2),o=m(n%60,2);return r+i+t+o}var B=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},te=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Ce=function(e,t){var r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return B(e,t);var o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",B(n,t)).replace("{{time}}",te(i,t))},Se={p:te,P:Ce},ke=["D","DD"],Pe=["YY","YYYY"];function Ye(a){return ke.indexOf(a)!==-1}function We(a){return Pe.indexOf(a)!==-1}function V(a,e,t){if(a==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(a==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(a==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(a==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var _e={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},xe=function(e,t,r){var n,i=_e[e];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function j(a){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.width?String(e.width):a.defaultWidth,r=a.formats[t]||a.formats[a.defaultWidth];return r}}var Ne={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ue={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ee={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Fe={date:j({formats:Ne,defaultWidth:"full"}),time:j({formats:Ue,defaultWidth:"full"}),dateTime:j({formats:Ee,defaultWidth:"full"})},$e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ie=function(e,t,r,n){return $e[e]};function W(a){return function(e,t){var r=t!=null&&t.context?String(t.context):"standalone",n;if(r==="formatting"&&a.formattingValues){var i=a.defaultFormattingWidth||a.defaultWidth,o=t!=null&&t.width?String(t.width):i;n=a.formattingValues[o]||a.formattingValues[i]}else{var u=a.defaultWidth,l=t!=null&&t.width?String(t.width):a.defaultWidth;n=a.values[l]||a.values[u]}var d=a.argumentCallback?a.argumentCallback(e):e;return n[d]}}var He={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},qe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Re={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Le={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},je={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Qe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Xe=function(e,t){var r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Ge={ordinalNumber:Xe,era:W({values:He,defaultWidth:"wide"}),quarter:W({values:qe,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:W({values:Re,defaultWidth:"wide"}),day:W({values:Le,defaultWidth:"wide"}),dayPeriod:W({values:je,defaultWidth:"wide",formattingValues:Qe,defaultFormattingWidth:"wide"})};function _(a){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.width,n=r&&a.matchPatterns[r]||a.matchPatterns[a.defaultMatchWidth],i=e.match(n);if(!i)return null;var o=i[0],u=r&&a.parsePatterns[r]||a.parsePatterns[a.defaultParseWidth],l=Array.isArray(u)?Be(u,function(c){return c.test(o)}):Ae(u,function(c){return c.test(o)}),d;d=a.valueCallback?a.valueCallback(l):l,d=t.valueCallback?t.valueCallback(d):d;var v=e.slice(o.length);return{value:d,rest:v}}}function Ae(a,e){for(var t in a)if(a.hasOwnProperty(t)&&e(a[t]))return t}function Be(a,e){for(var t=0;t<a.length;t++)if(e(a[t]))return t}function Ve(a){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.match(a.matchPattern);if(!r)return null;var n=r[0],i=e.match(a.parsePattern);if(!i)return null;var o=a.valueCallback?a.valueCallback(i[0]):i[0];o=t.valueCallback?t.valueCallback(o):o;var u=e.slice(n.length);return{value:o,rest:u}}}var ze=/^(\d+)(th|st|nd|rd)?/i,Je=/\d+/i,Ze={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ke={any:[/^b/i,/^(a|c)/i]},et={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},tt={any:[/1/i,/2/i,/3/i,/4/i]},at={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},rt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},nt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},it={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},ot={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ut={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},st={ordinalNumber:Ve({matchPattern:ze,parsePattern:Je,valueCallback:function(e){return parseInt(e,10)}}),era:_({matchPatterns:Ze,defaultMatchWidth:"wide",parsePatterns:Ke,defaultParseWidth:"any"}),quarter:_({matchPatterns:et,defaultMatchWidth:"wide",parsePatterns:tt,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:_({matchPatterns:at,defaultMatchWidth:"wide",parsePatterns:rt,defaultParseWidth:"any"}),day:_({matchPatterns:nt,defaultMatchWidth:"wide",parsePatterns:it,defaultParseWidth:"any"}),dayPeriod:_({matchPatterns:ot,defaultMatchWidth:"any",parsePatterns:ut,defaultParseWidth:"any"})},dt={code:"en-US",formatDistance:xe,formatLong:Fe,formatRelative:Ie,localize:Ge,match:st,options:{weekStartsOn:0,firstWeekContainsDate:1}},lt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ft=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ct=/^'([^]*?)'?$/,vt=/''/g,mt=/[a-zA-Z]/;function ht(a,e,t){var r,n,i,o,u,l,d,v,c,h,g,y,S,p,k,I,H,q;s(2,arguments);var re=String(e),P=C(),Y=(r=(n=t?.locale)!==null&&n!==void 0?n:P.locale)!==null&&r!==void 0?r:dt,R=w((i=(o=(u=(l=t?.firstWeekContainsDate)!==null&&l!==void 0?l:t==null||(d=t.locale)===null||d===void 0||(v=d.options)===null||v===void 0?void 0:v.firstWeekContainsDate)!==null&&u!==void 0?u:P.firstWeekContainsDate)!==null&&o!==void 0?o:(c=P.locale)===null||c===void 0||(h=c.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(R>=1&&R<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var L=w((g=(y=(S=(p=t?.weekStartsOn)!==null&&p!==void 0?p:t==null||(k=t.locale)===null||k===void 0||(I=k.options)===null||I===void 0?void 0:I.weekStartsOn)!==null&&S!==void 0?S:P.weekStartsOn)!==null&&y!==void 0?y:(H=P.locale)===null||H===void 0||(q=H.options)===null||q===void 0?void 0:q.weekStartsOn)!==null&&g!==void 0?g:0);if(!(L>=0&&L<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!Y.localize)throw new RangeError("locale must contain localize property");if(!Y.formatLong)throw new RangeError("locale must contain formatLong property");var N=f(a);if(!me(N))throw new RangeError("Invalid time value");var ne=fe(N),ie=he(N,ne),oe={firstWeekContainsDate:R,weekStartsOn:L,locale:Y,_originalDate:N},ue=re.match(ft).map(function(b){var T=b[0];if(T==="p"||T==="P"){var U=Se[T];return U(b,Y.formatLong)}return b}).join("").match(lt).map(function(b){if(b==="''")return"'";var T=b[0];if(T==="'")return gt(b);var U=Me[T];if(U)return!(t!=null&&t.useAdditionalWeekYearTokens)&&We(b)&&V(b,e,String(a)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&Ye(b)&&V(b,e,String(a)),U(ie,b,Y.localize,oe);if(T.match(mt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+T+"`");return b}).join("");return ue}function gt(a){var e=a.match(ct);return e?e[1].replace(vt,"'"):a}const Lt=Object.freeze(Object.defineProperty({__proto__:null,default:ht},Symbol.toStringTag,{value:"Module"}));function jt(a){s(1,arguments);var e=f(a),t=e.getDate();return t}function wt(a){s(1,arguments);var e=f(a),t=e.getFullYear(),r=e.getMonth(),n=new Date(0);return n.setFullYear(t,r+1,0),n.setHours(0,0,0,0),n.getDate()}function Qt(a){s(1,arguments);var e=f(a),t=e.getMonth();return t}function Xt(a){return s(1,arguments),f(a).getFullYear()}function Gt(a,e){s(2,arguments);var t=f(a),r=f(e);return t.getTime()>r.getTime()}function At(a,e){s(2,arguments);var t=f(a),r=f(e);return t.getTime()<r.getTime()}function Bt(a,e){s(2,arguments);var t=X(a),r=X(e);return t.getTime()===r.getTime()}function Vt(a,e){s(2,arguments);var t=f(a),r=f(e);return t.getFullYear()===r.getFullYear()&&t.getMonth()===r.getMonth()}function zt(a,e){s(2,arguments);var t=f(a),r=w(e),n=t.getFullYear(),i=t.getDate(),o=new Date(0);o.setFullYear(n,r,15),o.setHours(0,0,0,0);var u=wt(o);return t.setMonth(r,Math.min(i,u)),t}function Jt(a,e){s(2,arguments);var t=f(a),r=w(e);return isNaN(t.getTime())?new Date(NaN):(t.setFullYear(r),t)}function Zt(a){s(1,arguments);var e=f(a);return e.setDate(1),e.setHours(0,0,0,0),e}function Kt(a,e){var t,r,n,i,o,u,l,d;s(1,arguments);var v=C(),c=w((t=(r=(n=(i=e?.weekStartsOn)!==null&&i!==void 0?i:e==null||(o=e.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:v.weekStartsOn)!==null&&r!==void 0?r:(l=v.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&t!==void 0?t:0);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=f(a),g=h.getDay(),y=(g<c?7:0)+g-c;return h.setDate(h.getDate()-y),h.setHours(0,0,0,0),h}function ea(a){s(1,arguments);var e=f(a),t=new Date(0);return t.setFullYear(e.getFullYear(),0,1),t.setHours(0,0,0,0),t}function yt(a,e){var t;s(1,arguments);var r=w((t=e?.additionalDigits)!==null&&t!==void 0?t:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof a=="string"||Object.prototype.toString.call(a)==="[object String]"))return new Date(NaN);var n=pt(a),i;if(n.date){var o=Ot(n.date,r);i=Mt(o.restDateString,o.year)}if(!i||isNaN(i.getTime()))return new Date(NaN);var u=i.getTime(),l=0,d;if(n.time&&(l=Ct(n.time),isNaN(l)))return new Date(NaN);if(n.timezone){if(d=St(n.timezone),isNaN(d))return new Date(NaN)}else{var v=new Date(u+l),c=new Date(0);return c.setFullYear(v.getUTCFullYear(),v.getUTCMonth(),v.getUTCDate()),c.setHours(v.getUTCHours(),v.getUTCMinutes(),v.getUTCSeconds(),v.getUTCMilliseconds()),c}return new Date(u+l+d)}var E={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},bt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Tt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Dt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function pt(a){var e={},t=a.split(E.dateTimeDelimiter),r;if(t.length>2)return e;if(/:/.test(t[0])?r=t[0]:(e.date=t[0],r=t[1],E.timeZoneDelimiter.test(e.date)&&(e.date=a.split(E.timeZoneDelimiter)[0],r=a.substr(e.date.length,a.length))),r){var n=E.timezone.exec(r);n?(e.time=r.replace(n[1],""),e.timezone=n[1]):e.time=r}return e}function Ot(a,e){var t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=a.match(t);if(!r)return{year:NaN,restDateString:""};var n=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?n:i*100,restDateString:a.slice((r[1]||r[2]).length)}}function Mt(a,e){if(e===null)return new Date(NaN);var t=a.match(bt);if(!t)return new Date(NaN);var r=!!t[4],n=x(t[1]),i=x(t[2])-1,o=x(t[3]),u=x(t[4]),l=x(t[5])-1;if(r)return _t(e,u,l)?kt(e,u,l):new Date(NaN);var d=new Date(0);return!Yt(e,i,o)||!Wt(e,n)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(n,o)),d)}function x(a){return a?parseInt(a):1}function Ct(a){var e=a.match(Tt);if(!e)return NaN;var t=Q(e[1]),r=Q(e[2]),n=Q(e[3]);return xt(t,r,n)?t*Z+r*J+n*1e3:NaN}function Q(a){return a&&parseFloat(a.replace(",","."))||0}function St(a){if(a==="Z")return 0;var e=a.match(Dt);if(!e)return 0;var t=e[1]==="+"?-1:1,r=parseInt(e[2]),n=e[3]&&parseInt(e[3])||0;return Nt(r,n)?t*(r*Z+n*J):NaN}function kt(a,e,t){var r=new Date(0);r.setUTCFullYear(a,0,4);var n=r.getUTCDay()||7,i=(e-1)*7+t+1-n;return r.setUTCDate(r.getUTCDate()+i),r}var Pt=[31,null,31,30,31,30,31,31,30,31,30,31];function ae(a){return a%400===0||a%4===0&&a%100!==0}function Yt(a,e,t){return e>=0&&e<=11&&t>=1&&t<=(Pt[e]||(ae(a)?29:28))}function Wt(a,e){return e>=1&&e<=(ae(a)?366:365)}function _t(a,e,t){return e>=1&&e<=53&&t>=0&&t<=6}function xt(a,e,t){return a===24?e===0&&t===0:t>=0&&t<60&&e>=0&&e<60&&a>=0&&a<25}function Nt(a,e){return e>=0&&e<=59}const ta=Object.freeze(Object.defineProperty({__proto__:null,default:yt},Symbol.toStringTag,{value:"Module"}));function aa(a,e){s(2,arguments);var t=f(a).getTime(),r=f(e.start).getTime(),n=f(e.end).getTime();if(!(r<=n))throw new RangeError("Invalid interval");return t>=r&&t<=n}export{de as A,w as B,X as C,fe as D,Z as E,J as F,Ht as G,ee as H,$ as I,F as J,Oe as K,Te as L,C as M,dt as N,Se as O,We as P,V as Q,Ye as R,he as S,m as T,wt as U,ta as V,Lt as W,se as a,Et as b,It as c,Zt as d,qt as e,Rt as f,ea as g,Ft as h,Bt as i,le as j,Gt as k,aa as l,me as m,Vt as n,$t as o,yt as p,ht as q,s as r,Kt as s,f as t,At as u,jt as v,Qt as w,Xt as x,zt as y,Jt as z};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{V as B,H as q,U as N,k as Y,i as Ce,h as Se,a2 as Te}from"./vendor-ux-BX9dSNUy.js";import{q as Ie,k as ae,t as Re}from"./vendor-hooks-U4TTuKG0.js";import{r as v,a as ce}from"./vendor-react-CUXIiAnY.js";import{D as We,J as de,j as e,Y as ze,bC as De,$ as Oe,ak as d,z as ne,T as C,a6 as U,aX as te,R as Ae,Q as F,b6 as ie,am as P,bf as _,a5 as J,V as G,S as Z,b4 as $e,U as L,I as M,cj as Pe,bh as qe,a7 as Le,F as Be,W as t,b1 as W,a3 as pe,c2 as ee,ck as Me,aO as Fe,aP as Ne,cl as He,cm as Ue,cn as _e,s as oe,aU as Ve,aj as Ke,cc as Ye,bb as Je,cb as Qe}from"./vendor-mui-core-B5XNUjey.js";import{_ as V,c as ue,a1 as Xe,ac as Ge,b4 as Q,ar as xe,as as he,at as me}from"./index-Dijoh4El.js";import{S as Ze}from"./switch-C5K07M96.js";import{u as K}from"./team-HgvOpVEJ.js";import{u as et}from"./use-mobile-Vtj5nBdp.js";import{u as tt,C as X}from"./index.esm-DTmS4tth.js";import{C as ge,a as be,I as ot}from"./vendor-utils-CFxoplqC.js";import{C as st}from"./confirm-BIsS5xyi.js";import{A as nt}from"./actions-CiAs-6JM.js";import{T as re}from"./table-tips-BA9A3QDk.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-D4Rvz_D3.js";import"./session-DUT2afHJ.js";import"./isURL-wZZwzwyC.js";import"./use-app-logo-D9eQSUYq.js";import"./index-DBs9Ljax.js";const it=n=>{const[p,c]=v.useState(null),[f,r]=v.useState(!0),[w,u]=v.useState(null),j=window.blocklet?.appUrl,a=v.useMemo(()=>{const g={};return p&&(p.sources.forEach(y=>{g[y.did]={source:y,events:[],count:0}}),p.events.forEach(y=>{g[y.source]&&(g[y.source].events.push(y),g[y.source].count+=1)})),g},[p]),b=async()=>{try{if(r(!0),!j)return;const y=await(await fetch(ge(j,ue.WELLKNOWN_SERVICE_PATH_PREFIX,"/openevent.json"))).json();c(y),u(null)}catch(g){u(g instanceof Error?g:new Error(String(g)))}finally{r(!1)}};return v.useEffect(()=>{b()},[j]),{openEvent:p,setOpenEvent:c,eventsBySource:a,loading:f,error:w,loadData:b}};function fe({eventsBySource:n,selectedEvents:p,setSelectedEvents:c,error:f=null}){const{t:r}=B(),[w,u]=v.useState({}),j=v.useMemo(()=>{const s={};return Object.entries(n).forEach(([l,{events:m}])=>{const k=m.filter(S=>p[`${S.type}-${S.source}`]).length;s[l]=k}),s},[n,p]),a=v.useMemo(()=>Object.values(j).reduce((s,l)=>s+l,0),[j]),b=v.useMemo(()=>Object.values(n).reduce((s,{events:l})=>s+l.length,0),[n]),g=(s,l)=>{l.stopPropagation(),u({...w,[s]:!w[s]})},y=s=>{const l=`${s.type}-${s.source}`;c(m=>({...m,[l]:!m[l]}))},z=(s,l)=>{const m={};s.forEach(k=>{const S=`${k.type}-${k.source}`;m[S]=!l}),c(k=>({...k,...m}))},I=s=>{const l={};Object.values(n).forEach(({events:m})=>{m.forEach(k=>{const S=`${k.type}-${k.source}`;l[S]=s.target.checked})}),c(l)};return e.jsxs(d,{sx:{width:"100%"},children:[e.jsxs(d,{sx:{display:"flex",alignItems:"center",mb:1,mt:1},children:[e.jsx(ie,{control:e.jsx(J,{onChange:I,checked:a>0&&a===b}),label:e.jsxs(d,{sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:[r("webhookEndpoint.selectAllEvents"),e.jsx(d,{sx:{display:"flex",alignItems:"center"},children:e.jsx(P,{title:r("webhookEndpoint.selectAllEventsTooltip"),placement:"right",children:e.jsx(_,{fontSize:"small",sx:{ml:.5,cursor:"help"}})})})]}),sx:{m:0}}),a>0&&e.jsx(C,{variant:"body2",color:"primary",sx:{ml:"auto"},children:r("webhookEndpoint.selectedEventsCount",{count:a})})]}),e.jsx(d,{className:"webhook-event-selector",sx:{maxHeight:"50vh",overflowY:"auto",overflowX:"hidden"},children:e.jsx(G,{disablePadding:!0,sx:{border:"1px solid",borderColor:"divider",borderRadius:.5},children:Object.entries(n).map(([s,{source:l,events:m,count:k}],S)=>{const D=j[s]>0,R=j[s]===m.length&&m.length>0,O=w[s];return e.jsxs(ce.Fragment,{children:[e.jsx(Z,{sx:{borderBottom:({palette:i})=>S<Object.keys(n).length-1?`1px solid ${i.divider}`:"none",px:0,py:1,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.02)"}},children:e.jsxs(d,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center"},onClick:i=>{i.target.closest(".MuiFormControlLabel-root")||g(s,i)},children:[e.jsx(d,{sx:{display:"flex",alignItems:"center"},children:m.length>0&&e.jsx(ie,{control:e.jsx(J,{checked:R,indeterminate:D&&!R,onChange:i=>{i.stopPropagation(),z(m,R)}}),label:e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[l.logo&&e.jsx($e,{src:l.logo,sx:{width:24,height:24}}),e.jsx(d,{children:l.title||s}),D&&e.jsx(L,{label:r("webhookEndpoint.selectedCount",{count:j[s]}),size:"small",sx:{mt:"2px",height:"20px",fontSize:"12px",bgcolor:i=>`${i.palette.primary.main}20`,color:"primary.main",fontWeight:500}})]}),sx:{m:0,"& .MuiFormControlLabel-label":{flex:1}}})}),e.jsxs(d,{sx:{display:"flex",alignItems:"center"},children:[e.jsx(C,{variant:"body2",sx:{color:"text.secondary",mr:1},children:r("webhookEndpoint.eventsCount",{count:k})}),m.length>0&&e.jsx(M,{size:"small",edge:"end",children:O?e.jsx(Pe,{}):e.jsx(qe,{})})]})]})}),m.length>0&&e.jsx(Le,{in:O,timeout:"auto",unmountOnExit:!0,children:e.jsx(G,{disablePadding:!0,sx:{p:0,bgcolor:"rgba(0, 0, 0, 0.01)"},children:m.map(i=>{const h=`${i.type}-${i.source}`,o=!!p[h];return e.jsx(Z,{dense:!0,sx:{py:.75,px:1},onClick:()=>y(i),children:e.jsxs(d,{sx:{display:"flex",alignItems:"flex-start",width:"100%"},children:[e.jsx(J,{checked:o,sx:{flexShrink:0}}),e.jsxs(d,{sx:{flex:1,minWidth:0},children:[e.jsx(C,{variant:"body1",className:"webhook-event-type",sx:{cursor:"pointer",color:"text.primary",wordBreak:"break-word",overflowWrap:"break-word"},children:i.type}),e.jsx(C,{variant:"caption",sx:{color:"text.secondary",display:"block",cursor:"pointer",wordBreak:"break-word",overflowWrap:"break-word"},children:i.description})]})]})},h)})})})]},s)})})}),f&&e.jsx(Be,{error:!0,sx:{mt:1},children:f})]})}fe.propTypes={eventsBySource:t.objectOf(t.shape({source:t.shape({did:t.string.isRequired,title:t.string,description:t.string,version:t.string,logo:t.string}).isRequired,events:t.arrayOf(t.shape({type:t.string.isRequired,description:t.string.isRequired,source:t.string.isRequired})).isRequired,count:t.number.isRequired})).isRequired,selectedEvents:t.objectOf(t.bool).isRequired,setSelectedEvents:t.func.isRequired,error:t.string};function je({id:n=null,url:p="",description:c="",enabledEvents:f=[],onSubmit:r,onClose:w=()=>{}}){const{t:u}=B(),[j,a]=v.useState({}),{teamDid:b}=K(),{api:g}=V(),{loading:y,error:z,eventsBySource:I}=it(),s=We(),{control:l,handleSubmit:m,formState:{errors:k},reset:S,setValue:D,trigger:R}=tt({defaultValues:{url:"",description:""}}),O=de(s.breakpoints.down("md"));v.useEffect(()=>{const o=Object.values(j).some(x=>x);D("selectedEvents",o?"valid":""),R("selectedEvents")},[j,D,R]);const i=()=>{a({}),S(),w()},h=async o=>{const x=Object.keys(j).filter(T=>j[T]),E={url:o.url,description:o.description,enabledEvents:x.map(T=>{const[A,se]=T.split("-");return!A||!se?null:{type:A,source:se}}).filter(Boolean)};try{if(n){const T=await g.updateWebhookEndpoint({input:{teamDid:b,id:n,data:E}});q.success(`${u("webhookEndpoint.updateWebhook")} ${u("webhookEndpoint.success")}`),r(T)}else{const T=await g.createWebhookEndpoint({input:{teamDid:b,input:E}});q.success(`${u("webhookEndpoint.createWebhook")} ${u("webhookEndpoint.success")}`),r(T)}}catch(T){q.error(T?.message)}i()};return v.useEffect(()=>{S({url:p,description:c}),a(f.reduce((o,x)=>(o[`${x.type}-${x.source}`]=!0,o),{}))},[S,a,p,c,f]),e.jsx(ze,{open:!0,onClose:i,maxWidth:"lg",fullWidth:!0,fullScreen:O,children:e.jsxs("form",{onSubmit:m(h),children:[e.jsx(De,{children:u(n?"webhookEndpoint.editWebhookTitle":"webhookEndpoint.createWebhookTitle")}),e.jsx(Oe,{children:e.jsxs(d,{sx:{display:"flex",flexDirection:"column",gap:2,mt:2},children:[e.jsx(X,{name:"url",control:l,rules:{required:u("webhookEndpoint.validation.urlRequired"),pattern:{value:/^(http|https):\/\/[^ "]+$/,message:u("webhookEndpoint.validation.urlInvalid")}},render:({field:o})=>e.jsx(ne,{...o,label:u("webhookEndpoint.url.label"),fullWidth:!0,error:!!k.url,helperText:k.url?.message})}),e.jsx(X,{name:"description",control:l,rules:{required:u("webhookEndpoint.validation.descriptionRequired")},render:({field:o})=>e.jsx(ne,{...o,label:u("webhookEndpoint.description.label"),fullWidth:!0,multiline:!0,minRows:2,maxRows:4,error:!!k.description,helperText:k.description?.message})}),e.jsx(X,{name:"selectedEvents",control:l,rules:{required:u("webhookEndpoint.validation.eventRequired")},render:({field:o})=>e.jsx("input",{type:"hidden",...o})}),!y&&I&&Object.keys(I).length>0&&e.jsx(fe,{eventsBySource:I,selectedEvents:j,setSelectedEvents:a,error:k.selectedEvents?.message}),!y&&(!I||Object.keys(I).length===0)&&e.jsx(C,{sx:{color:"text.secondary"},children:u("webhookEndpoint.noAvailableEvents")}),y&&e.jsx(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"500px",width:"100%"},children:e.jsx(U,{size:20})}),z&&e.jsx(te,{severity:"error",children:u("webhookEndpoint.loadingError",{message:z?.message})})]})}),e.jsxs(Ae,{sx:{p:"8px 24px 24px"},children:[e.jsx(F,{onClick:i,children:u("common.cancel")}),e.jsx(F,{type:"submit",variant:"contained",color:"primary",children:u(n?"webhookEndpoint.updateWebhook":"webhookEndpoint.saveWebhook")})]})]})})}je.propTypes={onSubmit:t.func.isRequired,id:t.string,url:t.string,description:t.string,enabledEvents:t.arrayOf(t.shape({type:t.string.isRequired,source:t.string.isRequired})),onClose:t.func};function rt(n){switch(n){case"enabled":return"success";case"disabled":default:return"default"}}const lt=(n="en")=>n==="tw"?"zh":n;function H(n,p="YYYY-MM-DD HH:mm:ss",c="en"){return n?Xe(n).locale(lt(c)).format(p):"-"}function at(n){return typeof n=="number"?!1:be(n)}function ct(n){return n>=200&&n<300}function $({value:n,label:p,tip:c="",divider:f=!1}){const r=at(n);return e.jsxs(e.Fragment,{children:[e.jsxs(W,{direction:"column",alignItems:"flex-start",children:[e.jsxs(C,{component:"div",variant:"body1",mb:1,color:"text.primary",sx:{fontWeight:500},children:[p,!!c&&e.jsx(P,{title:c,children:e.jsx(_,{fontSize:"small"})})]}),e.jsx(C,{component:"div",variant:"body1",color:r?"text.disabled":"text.secondary",sx:{width:"100%",minHeight:"24px"},children:r?"-":n})]}),f&&e.jsx(pe,{orientation:"vertical",flexItem:!0})]})}$.propTypes={label:t.oneOfType([t.string,t.node]).isRequired,value:t.oneOfType([t.string,t.node]).isRequired,tip:t.oneOfType([t.string,t.node]),divider:t.bool};function ye({title:n,children:p=null,mb:c=1.5,mt:f=1.5}){return e.jsxs(W,{className:"section-header",direction:"row",sx:{justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,mb:c,mt:f,pb:1},children:[e.jsx(C,{variant:"h3",sx:{fontSize:{xs:"18px",md:"1.09375rem"}},component:"div",children:n}),p]})}ye.propTypes={title:t.oneOfType([t.string,t.node]).isRequired,children:t.node,mb:t.number,mt:t.number};const dt={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/>'},pt=n=>{const p={};return n.forEach(c=>{const f=new Date(c.createdAt).toLocaleDateString();p[f]||(p[f]=[]),p[f]?.push(c)}),p};function we({eventId:n="",webhookEndpointId:p="",event:c=null}){const{api:f,ws:{useSubscription:r}}=V(),{t:w}=B(),{teamDid:u}=K(),{blocklet:j}=Ge(),{data:a,loadMore:b,loadingMore:g,loading:y,mutate:z}=Ie(o=>{const E=o?Math.ceil(o.list.length/15)+1:1;return f.getWebhookAttempts({input:{teamDid:u,input:{eventId:n,webhookId:p},paging:{page:E,pageSize:15}}})},{reloadDeps:[n,p]}),I=a?.list||[],[s,l]=v.useState(null),[m,k]=v.useState(!1),S=pt(I);if(v.useEffect(()=>{!s&&a?.list.length&&l(a.list[0])},[a?.list.length,s]),r(ue.EVENTS.WEBHOOK_ATTEMPT,o=>{z(x=>{if(x.list.find(T=>T.id===o.id)){const T=x.list.map(A=>A.id===o.id?{...A,...o}:A);return{...x,list:T}}return o.endpoint=x.list[0]?.endpoint,o.event=x.list[0]?.event,{...x,list:[o,...x.list]}})},[]),y)return e.jsx(U,{});const D=a&&a.list.length<a.paging.total,R=async()=>{s&&(k(!0),await f.retryWebhookAttempt({input:{teamDid:u,eventId:s.event.id,webhookId:p,attemptId:s.id}}).finally(()=>{setTimeout(()=>{k(!1)},1e3)}))},O=o=>{if(o.responseBody&&o.responseBody?.sessionId&&o.responseBody?.projectId&&o.responseBody?.agentId){const x=j?.site?.domainAliases[0]?.value,E=(j.children||[]).find(A=>A?.meta?.name==="ai-studio"),T=ot(ge(`https://${x}`,E?.mountPoint||"","projects",o.responseBody.projectId,"logs/main"),{sessionId:o.responseBody.sessionId,agentId:o.responseBody.agentId});return e.jsx(M,{sx:{fontSize:20},onClick:()=>window.open(T,"_blank"),children:e.jsx(d,{component:N,icon:Q})})}return null},i=o=>o.status==="pending"?e.jsx(He,{color:"warning"}):ct(o.responseStatus)?e.jsx(Ue,{color:"success"}):e.jsx(_e,{color:"error"}),h=s?.triggeredFrom&&(a?.list||[]).find(o=>o.id===s.triggeredFrom);return e.jsxs(ut,{container:!0,spacing:{xs:0,md:1},sx:{height:1},children:[e.jsx(ee,{size:{xs:12,md:4},sx:{height:1},children:be(Object.keys(S))?e.jsx(C,{sx:{color:"text.secondary"},children:w("webhookEndpoint.waitingForEvents")}):e.jsxs(e.Fragment,{children:[e.jsx(G,{sx:{maxHeight:"calc(100% - 40px)",py:0,overflowY:"auto"},children:Object.entries(S).map(([o,x])=>e.jsxs(ce.Fragment,{children:[e.jsx(Me,{sx:{p:0},children:o}),x.map(E=>e.jsxs(Z,{sx:{cursor:"pointer",px:1},onClick:()=>l(E),selected:s&&s?.id===E?.id,secondaryAction:e.jsx(C,{sx:{color:"text.secondary"},children:H(E.createdAt,"HH:mm:ss")}),children:[e.jsx(Fe,{sx:{minWidth:0,mr:1.5},children:i(E)}),e.jsx(Ne,{primary:e.jsx(C,{sx:{color:"text.primary"},children:E.event.type})})]},E.id))]},o))}),D&&e.jsx(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:1},children:e.jsx(F,{variant:"text",type:"button",color:"inherit",onClick:b,disabled:g,sx:{color:o=>o.palette.text.disabled},children:w(g?"webhookEndpoint.loadingMore":"webhookEndpoint.loadMore")})})]})}),e.jsxs(ee,{size:{xs:12,md:8},sx:{height:1},children:[s&&e.jsxs(W,{direction:"column",spacing:2,sx:{height:1,overflow:"auto",pl:{xs:0,md:1},mt:{xs:2,md:0},borderLeft:{xs:"none"}},children:[e.jsxs(d,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"h4",children:w(`common.${s.status}`)}),e.jsx(d,{children:O(s)})]}),e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[h&&e.jsx(P,{placement:"left",title:e.jsxs(W,{onClick:()=>l(h),sx:{gap:1,cursor:"pointer",".did-address-text":{color:"common.white"}},children:[e.jsx(xe,{showDid:!0,did:s.triggeredBy,cardType:me.Detailed,infoType:he.Minimal,sx:{border:0,padding:0,minWidth:0,".MuiTypography-root":{color:"common.white",fontWeight:400}}}),e.jsx(pe,{}),e.jsxs(d,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(C,{variant:"body2",sx:{color:"primary.main"},children:w("webhookEndpoint.triggeredFrom")}),e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"body2",children:s.id}),e.jsx(M,{onClick:()=>l(h),children:e.jsx(d,{component:N,icon:Q,sx:{fontSize:16,color:"common.white"}})})]})]})]}),slotProps:{tooltip:{sx:{maxWidth:400}}},children:e.jsx(M,{onClick:()=>l(h),children:e.jsx(d,{component:N,icon:Q,sx:{fontSize:16}})})}),e.jsxs(F,{variant:"outlined",color:"primary",size:"small",onClick:R,disabled:m,children:[e.jsx(d,{component:N,icon:dt,sx:{fontSize:16,animation:m?"spin 1s linear infinite":"none",mr:.5}}),w("notification.resend")]})]})]}),e.jsxs(d,{children:[e.jsxs(C,{variant:"h6",children:[w("webhookEndpoint.response")," (",s.responseStatus,")"]}),e.jsx(Y,{language:"json",children:JSON.stringify(s.responseBody,null,2)})]}),e.jsxs(d,{children:[e.jsx(W,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.request")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(s.event,null,2)})]})]}),a?.list.length===0&&c&&e.jsxs(d,{children:[e.jsx(W,{direction:"row",spacing:1,sx:{alignItems:"center"},children:e.jsx(C,{variant:"h6",children:w("webhookEndpoint.eventData")})}),e.jsx(Y,{language:"json",sx:{margin:0},children:JSON.stringify(c.data,null,2)})]})]})]})}we.propTypes={eventId:t.string,webhookEndpointId:t.string,event:t.shape({type:t.string,data:t.object,request:t.object,requestInfo:t.object})};const ut=oe(ee)`
|
|
2
|
-
@keyframes spin {
|
|
3
|
-
to {
|
|
4
|
-
transform: rotate(360deg);
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
`;function ke({id:n,onClose:p}){const{t:c}=B(),{api:f}=V(),{teamDid:r}=K(),{loading:w,error:u,data:j}=ae(()=>f.getWebhookEndpoint({input:{teamDid:r,id:n}})),a=j?.data;return u?e.jsx(te,{severity:"error",children:u.message}):w||!a?e.jsx(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:1,width:1},children:e.jsx(U,{})}):e.jsxs(xt,{direction:"column",sx:{height:{xs:"auto",md:1}},children:[e.jsxs(d,{children:[e.jsxs(W,{direction:"row",sx:{justifyContent:"space-between",alignItems:"center"},children:[e.jsx(W,{sx:{flex:1,width:0},children:e.jsxs(d,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(C,{variant:"h5",sx:{fontWeight:600,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:a.description}),e.jsx(P,{title:a.url,children:e.jsx(_,{sx:{fontSize:"16px",marginTop:"2px"}})})]})}),e.jsx(W,{direction:"row",sx:{alignItems:"center"},children:e.jsx(M,{edge:"end",color:"inherit",onClick:p,children:e.jsx(Ke,{})})})]}),e.jsx(d,{sx:{mt:2},children:e.jsxs(W,{className:"section-body",direction:{xs:"column",md:"row"},spacing:{xs:1,md:3},sx:{justifyContent:"flex-start",flexWrap:"wrap",pt:2,mt:2,borderTop:"1px solid #eee"},children:[e.jsx($,{label:c("common.status"),value:e.jsx(L,{size:"small",variant:"filled",label:a.status,color:rt(a.status),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}}),divider:!0}),e.jsx($,{label:c("webhookEndpoint.listen"),value:e.jsx(P,{arrow:!0,title:e.jsx("ul",{style:{padding:0,margin:0},children:a.enabledEvents.map(b=>e.jsx("li",{style:{fontSize:"0.7875rem"},children:b?.type},b))}),children:e.jsx(L,{size:"small",variant:"filled",label:c("webhookEndpoint.eventsCount",{count:a.enabledEvents.length}),sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx($,{label:c("webhookEndpoint.version"),value:a.apiVersion,divider:!0}),e.jsx($,{label:c("common.createdAt"),value:H(a.createdAt),divider:!0}),e.jsx($,{label:c("common.updatedAt"),value:H(a.updatedAt),divider:!0}),e.jsx($,{label:c("common.createdBy"),value:e.jsx(P,{arrow:!0,title:a.createUser?.did,children:e.jsx(L,{size:"small",variant:"filled",label:a.createUser?.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})}),divider:!0}),e.jsx($,{label:c("common.updatedBy"),value:e.jsx(P,{arrow:!0,title:a.updateUser?.did,children:e.jsx(L,{size:"small",variant:"filled",label:a.updateUser?.fullName,sx:{borderRadius:"4px",lineHeight:"20px",textTransform:"capitalize"}})})})]})})]}),e.jsxs(W,{className:"section",sx:{flex:1,height:0,overflow:"hidden"},children:[e.jsx(ye,{title:c("webhookEndpoint.attempts"),mb:0,mt:4}),e.jsx(W,{sx:{height:0,flex:1,overflow:"hidden"},children:e.jsx(we,{webhookEndpointId:a.id})})]})]})}ke.propTypes={id:t.string.isRequired,onClose:t.func.isRequired};const xt=oe(W)``;function Ee({open:n,onClose:p,id:c}){return e.jsx(Ve,{anchor:"right",open:n,onClose:p,slotProps:{paper:{sx:{width:"90vw",maxWidth:"1200px"}}},children:e.jsx(d,{sx:{height:"100vh",p:3},children:e.jsx(ke,{id:c,onClose:p})})})}Ee.propTypes={open:t.bool.isRequired,onClose:t.func.isRequired,id:t.string.isRequired};function le(){return null}function ve({options:n={},columns:p=[],toolbar:c=!0,footer:f=!0,hasRowLink:r=!1,emptyNodeText:w="",durable:u="",durableKeys:j=[],data:a=[],loading:b=!1,...g}){const{locale:y}=B(),z=de(l=>l.breakpoints.down("md")),I={print:!1,download:!1,filter:!1,selectableRows:"none",rowsPerPage:z?5:10,rowsPerPageOptions:[5,10,20,50,100],searchDebounceTime:300,tableBodyHeight:"100%",loading:!0},s={};return c||(s.TableToolbar=le),f||(s.TableFooter=le),e.jsx(ht,{locale:y,options:{...I,...n},columns:(p||[]).map(l=>(l.options=l.options||{},l.options.filter=l.options.filter||!1,l.options.sort=l.options.sort||!1,l)),emptyNode:e.jsx(Ce,{children:w}),...g,durable:u,durableKeys:j,data:a,loading:b,components:s,hasRowLink:r,isMobile:z})}ve.propTypes={options:t.object,columns:t.array,toolbar:t.bool,footer:t.bool,hasRowLink:t.bool,emptyNodeText:t.node,durable:t.string,durableKeys:t.array,data:t.array,loading:t.bool,onChange:t.func,title:t.node,components:t.object};const ht=oe(Se)``,mt=v.memo(ve);function $t(){const{teamDid:n}=K(),p=et(),c=`webhook-endpoints-${n}`,f=Te(c),{t:r,locale:w}=B(),{api:u}=V(),[j,a]=v.useState(""),[b,g]=v.useState({webhookDetail:{open:!1,id:null},createEdit:{open:!1,id:null,url:"",description:"",enabledEvents:[]},deleteConfirm:null}),[y,z]=Re(c,{defaultValue:{pageSize:f.rowsPerPage||20,page:f.page?f.page+1:1}}),{loading:I,error:s,data:l,refresh:m}=ae(()=>u.getWebhookEndpoints({input:{teamDid:n,paging:{page:y.page,pageSize:y.pageSize}}}));v.useEffect(()=>{m()},[y,m]);const k=v.useCallback(async(i,h)=>{try{await u.updateWebhookEndpoint({input:{teamDid:n,id:i.id,data:{status:h?"disabled":"enabled"}}}),m(),q.success(`${r(h?"webhookEndpoint.disable":"webhookEndpoint.enable")}${r("webhookEndpoint.success")}`)}catch(o){q.error(o?.message)}},[u,n,m,r]),S=v.useCallback(async i=>{try{await u.deleteWebhookEndpoint({input:{teamDid:n,id:i}}),m(),g(h=>({...h,deleteConfirm:null})),q.success(`${r("common.delete")}${r("webhookEndpoint.success")}`)}catch(h){q.error(h?.message)}},[u,n,m,r]),D=(i,h)=>{let o=i.page+1;const x=i.searchText||"";if(x!==j){a(x);return}if(h==="changePage"||h==="changeRowsPerPage"){h!=="changePage"&&(o=1);const E={page:o,pageSize:i.rowsPerPage};a(""),z(E)}};if(s)return e.jsx(te,{severity:"error",children:s.message});const R=(l?.list||[]).filter(i=>{if(!j)return!0;const h=j.toLowerCase();return i.description.toLowerCase().includes(h)||i.url.toLowerCase().includes(h)}),O=[{label:"URL",name:"url",options:{customBodyRenderLite:(i,h)=>{const o=R[h];return e.jsxs(d,{sx:{display:"flex",alignItems:"center",cursor:"pointer",gap:.5},children:[e.jsx(C,{variant:"body2",children:o.description}),e.jsx(d,{sx:{display:"flex"},onClick:x=>{x.stopPropagation()},children:e.jsx(P,{title:o.url,children:e.jsx(_,{sx:{fontSize:"15px",marginTop:"1px"}})})})]})}}},{label:"Events",name:"events",options:{customBodyRenderLite:(i,h)=>{const o=R[h];return e.jsx(d,{sx:{display:"flex",alignItems:"center",gap:1,flexWrap:"wrap"},children:o.enabledEvents.map(x=>e.jsx(L,{size:"small",variant:"filled",label:x.type,sx:{borderRadius:"4px",textTransform:"capitalize"}},`${o.source}-${x.type}`))})}}},{label:r("common.status"),name:"status",options:{customBodyRenderLite:(i,h)=>{const o=R[h],x=o?.status==="enabled";return e.jsx(d,{onClick:E=>E.stopPropagation(),children:e.jsx(Ze,{checked:x,onChange:()=>k(o,x)},`status-${o.status}`)})}}},{label:r("common.createdAt"),name:"createdAt",minWidth:200,options:{customBodyRender:i=>H(i)}},{label:r("common.createdBy"),name:"createUser",width:100,options:{customBodyRender:i=>i?e.jsx(xe,{showDid:!0,did:i?.did,cardType:me.Detailed,infoType:he.Minimal,sx:{border:0,padding:0}}):"-"}},{label:r("common.actions"),name:"actions",width:100,align:"center",verticalKeyAlign:"center",options:{customBodyRenderLite:(i,h)=>{const o=R[h];return e.jsx(nt,{actions:[{icon:e.jsx(Ye,{}),text:r("common.edit"),onClick:x=>{x.stopPropagation(),g(E=>({...E,createEdit:{open:!0,id:o.id,url:o.url,description:o.description,enabledEvents:o.enabledEvents}}))}},{icon:e.jsx(Je,{}),text:r("common.delete"),onClick:x=>{x.stopPropagation(),g(E=>({...E,deleteConfirm:{title:r("webhookEndpoint.deleteWebhook.title"),description:r("webhookEndpoint.deleteWebhook.description"),confirm:r("common.confirm"),cancel:r("common.cancel"),onConfirm:()=>S(o.id),onCancel:()=>g(T=>({...T,deleteConfirm:null}))}}))}}]})}}}];return e.jsxs(d,{sx:{".custom-toobar-btns":{gap:"8px"},".custom-toobar-title .custom-toobar-title-inner>span":{display:"flex",alignItems:"center","white-space":"inherit",height:"100%"}},children:[p?e.jsx(re,{title:r("webhookEndpoint.listTitle"),tooltipTitle:r("webhookEndpoint.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${w}/webhook`}):null,e.jsx(mt,{durable:c,durableKeys:["page","rowsPerPage"],data:R,columns:O,options:{count:l?.count||0,page:y.page-1,rowsPerPage:y.pageSize,viewColumns:!1,onRowClick:(i,{dataIndex:h})=>{const o=l.list[h];g(x=>({...x,webhookDetail:{open:!0,id:o.id}}))}},loading:I||!l,onChange:D,emptyNodeText:e.jsx(W,{sx:{gap:1},children:r("webhookEndpoint.noWebhooksAdded")}),title:p?null:e.jsx(re,{title:r("webhookEndpoint.listTitle"),tooltipTitle:r("webhookEndpoint.tooltipTitle"),link:`https://www.arcblock.io/docs/blocklet-developer/${w}/webhook`}),customButtons:[e.jsxs(F,{edge:"end",variant:"contained",color:"primary",onClick:()=>g(i=>({...i,createEdit:{...i.createEdit,open:!0}})),className:"rule-action",children:[I?e.jsx(U,{size:16}):e.jsx(Qe,{style:{fontSize:16}}),r("common.create")]},"add")]}),b.webhookDetail.open&&e.jsx(Ee,{open:!0,onClose:()=>g(i=>({...i,webhookDetail:{open:!1,id:null}})),id:b.webhookDetail.id}),b.createEdit.open&&e.jsx(je,{onSubmit:m,...b.createEdit,onClose:()=>g(i=>({...i,createEdit:{id:null,url:"",description:"",enabledEvents:[],open:!1}}))}),b.deleteConfirm&&e.jsx(st,{title:b.deleteConfirm.title,description:b.deleteConfirm.description,confirm:b.deleteConfirm.confirm,cancel:b.deleteConfirm.cancel,params:b.deleteConfirm.params,onConfirm:b.deleteConfirm.onConfirm,onCancel:b.deleteConfirm.onCancel})]})}export{$t as default};
|