@abtnode/blocklet-services 1.17.8-beta-20260104-120132-cb5b1914 → 1.17.8-beta-20260108-021819-e099f0ca
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AdapterDayjs-DyRP0A_7.js → AdapterDayjs-C1bdndja.js} +1 -1
- package/dist/assets/Community-3AO97CCq.js +1 -0
- package/dist/assets/{Google-Bjq5o7qL.js → Google-JbLVL0lz.js} +1 -1
- package/dist/assets/Holiday-CqSw2e8m.js +1 -0
- package/dist/assets/Meeting-DKbNRI16.js +1 -0
- package/dist/assets/OffSick-BvEREz3_.js +1 -0
- package/dist/assets/WorkingRemotely-DNtYHcSB.js +1 -0
- package/dist/assets/{access-control-Cv1j0YWJ.js → access-control-DMsY0Jfu.js} +1 -1
- package/dist/assets/{actions-Dfiiwkit.js → actions-m1acuA78.js} +1 -1
- package/dist/assets/{add-component-core-8nx00xJP.js → add-component-core-DXBsHpN1.js} +7 -7
- package/dist/assets/add-resource-B1owMSeP.js +1 -0
- package/dist/assets/addon-B42_QFF5.js +14 -0
- package/dist/assets/advanced-BnFynWN7.js +14 -0
- package/dist/assets/aigne-Qq2FBVAW.js +10 -0
- package/dist/assets/api-B24x7kOD.js +1 -0
- package/dist/assets/{appearance-CkrEEbhp.js → appearance-Dnc6HNzY.js} +1 -1
- package/dist/assets/{ar-BukCw0OI.js → ar-BHqjWgUQ.js} +2 -2
- package/dist/assets/arrow-down.svg-7ME6T1BL.js +1 -0
- package/dist/assets/{audit-logs-XPxQHo2y.js → audit-logs-Cfw8JmA4.js} +2 -2
- package/dist/assets/{authorize-ByHCjaXS.js → authorize-B_1efpwx.js} +1 -1
- package/dist/assets/{base-chart-ChBZtUEG.js → base-chart-DT--nPCU.js} +1 -1
- package/dist/assets/base32-r3F0yIbl.js +1 -0
- package/dist/assets/bind-account-Cw-tBmC3.js +1 -0
- package/dist/assets/{branding-khY0G2TO.js → branding-BxEmV2m2.js} +2 -2
- package/dist/assets/{branding-CBzX3Xum.js → branding-CBavw5s2.js} +1 -1
- package/dist/assets/branding-CbYOEW_s.js +1 -0
- package/dist/assets/bundle-avatar-1zs0l21j.js +1 -0
- package/dist/assets/button-LwkniwV9.js +1 -0
- package/dist/assets/{click-to-copy-BEM1P78p.js → click-to-copy-Dk6ZAJOw.js} +1 -1
- package/dist/assets/cloneDeep-rgNCMFod.js +1 -0
- package/dist/assets/{collapse-B7gUzFaX.js → collapse-D72lnPa9.js} +1 -1
- package/dist/assets/{complete-CuyAiV3B.js → complete-CIQgRJri.js} +4 -4
- package/dist/assets/{component-nxxcEAFR.js → component-qZAbczHw.js} +3 -3
- package/dist/assets/{config-DweHAJPq.js → config-BaKRlJau.js} +2 -2
- package/dist/assets/config-CoSaZVwp.js +53 -0
- package/dist/assets/{config-DOcJbRFr.js → config-btuzRTop.js} +1 -1
- package/dist/assets/{config-navigation-BG6durqz.js → config-navigation-BNsZpUQd.js} +8 -8
- package/dist/assets/config-space-BZQrckxG.js +1 -0
- package/dist/assets/{confirm-BRnYfcDD.js → confirm-D6AvlbAp.js} +1 -1
- package/dist/assets/connect-BC85oS0g.js +1 -0
- package/dist/assets/connect-BV6BUhDJ.css +1 -0
- package/dist/assets/connect-Dv4BPfET.js +5 -0
- package/dist/assets/connect-_I5q1wXN.js +5 -0
- package/dist/assets/connect-to-CVH3cw77.js +1 -0
- package/dist/assets/{content-layout-DmSBGGVm.js → content-layout-Dtfb5X6M.js} +1 -1
- package/dist/assets/{create-passport-svg-BKhJ2ufW.js → create-passport-svg-DeDfPZeD.js} +1 -1
- package/dist/assets/createClass-07c4wbGU.js +1 -0
- package/dist/assets/{dashboard-CDOqgUmx.js → dashboard-BQgUp8NI.js} +7 -7
- package/dist/assets/{de-Br0tDZam.js → de-QUGQFv2K.js} +1 -1
- package/dist/assets/{delete-confirm-1vzcMsM2.js → delete-confirm-BLy-Oo1o.js} +1 -1
- package/dist/assets/did-address-Cq16cwTy.js +1 -0
- package/dist/assets/{domain-D75xKDoP.js → domain-BqtauLm5.js} +1 -1
- package/dist/assets/{domain-action-card-BgDPfYMr.js → domain-action-card-nuzd77mn.js} +2 -2
- package/dist/assets/domains-Cg8723ho.js +1 -0
- package/dist/assets/edit.svg-CTE5eATX.js +1 -0
- package/dist/assets/email-CCNEyVGq.js +17 -0
- package/dist/assets/{empty-spinner-BYDonf35.js → empty-spinner-BClWI15N.js} +1 -1
- package/dist/assets/engine-DOYgeVKF.js +1 -0
- package/dist/assets/{es-D_e0gGgp.js → es-C4w6cL07.js} +2 -2
- package/dist/assets/exchange-passport-DR-pKNHM.js +1 -0
- package/dist/assets/{form-BblKAylu.js → form-Bkig0Zr5.js} +3 -3
- package/dist/assets/{form-text-input-C-JBHNfU.js → form-text-input-BsCymY_c.js} +2 -2
- package/dist/assets/{form-wrapper-PT5ZzMQy.js → form-wrapper-pwkkz4we.js} +1 -1
- package/dist/assets/{fr-DXizOT4b.js → fr-Bq3UipEu.js} +2 -2
- package/dist/assets/{fuel-BPg61IpB.js → fuel-tC2bCgpP.js} +1 -1
- package/dist/assets/{gen-access-key-B-PvqBv6.js → gen-access-key-BbtCn0wJ.js} +1 -1
- package/dist/assets/gen-simple-access-key-DbKaLz9m.js +1 -0
- package/dist/assets/get-safe-url-DxqVk96E.js +1 -0
- package/dist/assets/google-icon-vNOJy67F.js +1 -0
- package/dist/assets/{hi-D2FEb_Tx.js → hi-DGZy0DLh.js} +2 -2
- package/dist/assets/{home-CT38dHBL.js → home-BdXWvJM-.js} +1 -1
- package/dist/assets/{id-Dw9URVwP.js → id-DOzDilAf.js} +2 -2
- package/dist/assets/{iframe-D119MMHU.js → iframe-BHP6CYbe.js} +1 -1
- package/dist/assets/index-5IYIk-ZG.js +150 -0
- package/dist/assets/{index-OTENuoZ0.js → index-B0O4cfgn.js} +22 -22
- package/dist/assets/index-B3RkYGd7.js +1 -0
- package/dist/assets/{index-BcIeEF3v.js → index-B7hLDto7.js} +4 -4
- package/dist/assets/{index-BpWFE-ry.js → index-BB8sYq-N.js} +1 -1
- package/dist/assets/index-BEfIUbZC.js +1039 -0
- package/dist/assets/{index-CIC0R_Qc.js → index-BGo7DXlf.js} +1 -1
- package/dist/assets/{index-arhRQhsc.js → index-BHnD9G0G.js} +8 -8
- package/dist/assets/index-BPZITdMW.js +200 -0
- package/dist/assets/{index-BWCHnVga.js → index-BSZ3mQac.js} +2 -2
- package/dist/assets/{index-tfYDa2i6.js → index-BasnkqHA.js} +5 -5
- package/dist/assets/index-BbSDwNE6.js +120 -0
- package/dist/assets/index-Bm1VCAzZ.js +81 -0
- package/dist/assets/{index-bCC4mzZc.js → index-BnOC3Ium.js} +1 -1
- package/dist/assets/index-BoLm67SH.js +1 -0
- package/dist/assets/{index-DSVwCr5p.js → index-BrDWLIA2.js} +2 -2
- package/dist/assets/{index-DoDx-vpV.js → index-Bv2O-NCZ.js} +3 -3
- package/dist/assets/{index-D1f4dwYF.js → index-BvB9yPsA.js} +12 -12
- package/dist/assets/{index-uODjznr3.js → index-C96Fw4Lj.js} +6 -6
- package/dist/assets/{index-DdojJXSn.js → index-CNGNZ6kv.js} +3 -3
- package/dist/assets/{index-D1SIrheh.js → index-CaQuyP_U.js} +1 -1
- package/dist/assets/{index-DGbr3NAq.js → index-Cvt4JvUl.js} +1 -1
- package/dist/assets/{index-CRAuhYSg.js → index-D-O_eFad.js} +1 -1
- package/dist/assets/index-D320ZZ3W.js +281 -0
- package/dist/assets/index-D3L_FG1K.js +1 -0
- package/dist/assets/{index-sBtfsjBo.js → index-DTdf57JC.js} +2 -2
- package/dist/assets/{index-BNAs76qj.js → index-DUL9RfTo.js} +2 -2
- package/dist/assets/{index-CSCCjNba.js → index-DVrxzIzr.js} +1 -1
- package/dist/assets/index-DixUQBnm.js +1 -0
- package/dist/assets/index-DrCTi6nm.css +1 -0
- package/dist/assets/{index-VaUGnCuU.js → index-KUC3HPt0.js} +1 -1
- package/dist/assets/{index-8bzrOXqv.js → index-Ly6A31IO.js} +2 -2
- package/dist/assets/{index-TzwTiNQ7.js → index-dC2vB2_g.js} +1 -1
- package/dist/assets/{index-B0Q9wWG1.js → index-oucqu2vy.js} +1 -1
- package/dist/assets/{index-CGrk0HiP.js → index-yvRJAzQn.js} +1 -1
- package/dist/assets/info-outline-rounded-YiCh4oGg.js +1 -0
- package/dist/assets/invitation-CnuNtRnn.js +177 -0
- package/dist/assets/invitations-D_3NLIPO.js +3 -0
- package/dist/assets/{invite-uHE_P5fP.js → invite-CUVHQCSI.js} +1 -1
- package/dist/assets/{isURL-CRZ7iI7F.js → isURL-vNa-ZfGd.js} +2 -2
- package/dist/assets/issue-passport-Do2LhI-f.js +1 -0
- package/dist/assets/{item-BJSHAMwK.js → item-BabsiwzU.js} +1 -1
- package/dist/assets/{ja-DBxpsmGJ.js → ja-DMq-YXDX.js} +2 -2
- package/dist/assets/{ko-CCAdSyce.js → ko-BrYbXurh.js} +2 -2
- package/dist/assets/landing-page-B5QvkHHO.js +1 -0
- package/dist/assets/{launch-result-message-MNpx7ysR.js → launch-result-message-C04PaKk0.js} +1 -1
- package/dist/assets/{layout-D9M0eiNw.js → layout-DRVZ4L0D.js} +1 -1
- package/dist/assets/list-B22ZyQqz.js +2 -0
- package/dist/assets/{list-DVUI92a2.js → list-BbHzj-7w.js} +3 -3
- package/dist/assets/{list-header-Cl3jykCe.js → list-header-wJF4c6BN.js} +1 -1
- package/dist/assets/localization-BFHoFo4B.js +1 -0
- package/dist/assets/lock.svg-CiT4rEpi.js +1 -0
- package/dist/assets/{log-DbdNMVuv.js → log-BigiLZw2.js} +1 -1
- package/dist/assets/logger-DhW79f4a.js +1 -0
- package/dist/assets/login-DeBY1fPe.js +1 -0
- package/dist/assets/{login-oauth-callback-RLp-7ubu.js → login-oauth-callback-Du-bMipe.js} +1 -1
- package/dist/assets/{logo-uploader-BFMnNkRn.js → logo-uploader-DEFzQY0j.js} +3 -3
- package/dist/assets/{lost-passport-CB5SFq30.js → lost-passport-DkN5GdCK.js} +2 -2
- package/dist/assets/omit-BeaKJrg9.js +1 -0
- package/dist/assets/{open-window-xMdq1GjU.js → open-window-CdadJ5vo.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-DvKFY6t9.js → over-due-invoice-payment-CXZ42RZu.js} +1 -1
- package/dist/assets/{overview-DNVfcZQO.js → overview-a9TXaGnH.js} +3 -3
- package/dist/assets/{page-header-CHAwrgX-.js → page-header-BZv-tfgN.js} +1 -1
- package/dist/assets/passport-C_PAxd9K.js +1 -0
- package/dist/assets/passport-item-BudJHbYX.js +1 -0
- package/dist/assets/{permission-C0rLyhnq.js → permission-CeqEAPPT.js} +1 -1
- package/dist/assets/preferences-ixUbb8gE.js +1 -0
- package/dist/assets/profile-embed-BIwa1Yt3.js +1 -0
- package/dist/assets/provider-icon-CkqIY6iX.js +1 -0
- package/dist/assets/{pt-CrMGrBZ6.js → pt-Dl6732JN.js} +2 -2
- package/dist/assets/publish-resource-BpvxLOlV.js +1 -0
- package/dist/assets/question-mark-circle.svg-GhTaklFN.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-BZjy3RlT.js → react-beautiful-dnd.esm-BwIgGfYj.js} +4 -4
- package/dist/assets/{react-stripe.esm-CVZErl8X.js → react-stripe.esm-5Snjx_mn.js} +1 -1
- package/dist/assets/{required-BQln5OcV.js → required-DHjZE3-Y.js} +1 -1
- package/dist/assets/revoke.svg-DUoaRyPZ.js +1 -0
- package/dist/assets/{ru-up3R57Pv.js → ru-CVUeN9AX.js} +2 -2
- package/dist/assets/runtime-TkU2snTc.js +1 -0
- package/dist/assets/{sanitize-yVk8VEIO.js → sanitize-yX1j-ggS.js} +1 -1
- package/dist/assets/sdk-CMvNWVGa.js +1 -0
- package/dist/assets/{section-jXB9AxBb.js → section-CenHBXqj.js} +1 -1
- package/dist/assets/{security-Ch3TxRbd.js → security-Dw0iwARQ.js} +3 -3
- package/dist/assets/server-logo-notext.svg-BLAdvsmP.js +1 -0
- package/dist/assets/{session-5s-U-ruq.js → session-Cin9Rizr.js} +1 -1
- package/dist/assets/setup-Daw0Bdkr.js +24 -0
- package/dist/assets/{shorten-label-C4py9TLA.js → shorten-label-DXFyDHDr.js} +1 -1
- package/dist/assets/simple-select-DtCsUIHR.js +1 -0
- package/dist/assets/{spaces-BE9CZzeJ.js → spaces-DghHe7uP.js} +1 -1
- package/dist/assets/start-SLdZOtVD.js +187 -0
- package/dist/assets/{starting-progress-MyalFKYG.js → starting-progress-BiI8hmaj.js} +2 -2
- package/dist/assets/status-DRNtY6SL.js +1 -0
- package/dist/assets/{step-actions-X2c_czAD.js → step-actions-Cb6B0FCJ.js} +1 -1
- package/dist/assets/{studio-BcQoXvqZ.js → studio-CVfdma-R.js} +1 -1
- package/dist/assets/{switch-BjA8SIAh.js → switch-C49IloVU.js} +1 -1
- package/dist/assets/{switch-control-D2RiXLWV.js → switch-control-npfWE_aC.js} +1 -1
- package/dist/assets/{table-tips-Dgzi4H1y.js → table-tips-DMrnJF8e.js} +1 -1
- package/dist/assets/team-DkV63Yjl.js +146 -0
- package/dist/assets/{th-DdNj2Ao6.js → th-32eBNQes.js} +2 -2
- package/dist/assets/{traffic-CvgJe_3z.js → traffic-C8BReAMz.js} +1 -1
- package/dist/assets/transfer-Dt4V38KL.js +16 -0
- package/dist/assets/unsubscribe-rCcvC6Dj.js +1 -0
- package/dist/assets/{use-app-logo-Cfo-T8ZY.js → use-app-logo-DnCfhAzv.js} +1 -1
- package/dist/assets/{use-mobile-BINJTzMb.js → use-mobile-Bz2ML4Gk.js} +1 -1
- package/dist/assets/{use-mobile-D5clNlrm.js → use-mobile-_vjPRYx2.js} +1 -1
- package/dist/assets/use-server-logo-Da86xnyt.js +1 -0
- package/dist/assets/{use-window-close-4WCUBrSc.js → use-window-close-DUJmRIjM.js} +1 -1
- package/dist/assets/{useAsync-DVl73fmG.js → useAsync-D0xh4Var.js} +1 -1
- package/dist/assets/{useAsync-Dotoxibi.js → useAsync-D6IP8T2e.js} +1 -1
- package/dist/assets/{useAsyncRetry-r8dEPb-x.js → useAsyncRetry-B_bXUXWM.js} +1 -1
- package/dist/assets/{useLocalStorage-Cl1rEjxs.js → useLocalStorage-Brr2PSz9.js} +1 -1
- package/dist/assets/user-center-Cnc61do7.js +125 -0
- package/dist/assets/user-follower-Cc2pWcSL.js +32 -0
- package/dist/assets/{util-CDBgZOAd.js → util-BgLSp_5A.js} +1 -1
- package/dist/assets/{util-BNGEGQGN.js → util-CMCJQTXJ.js} +1 -1
- package/dist/assets/{vendor-arcblock-B1iA4v4a.js → vendor-arcblock-BCP2x3BR.js} +19 -19
- package/dist/assets/{vendor-hooks-qxhUUbW5.js → vendor-hooks-DQAdyHrE.js} +2 -2
- package/dist/assets/{vendor-mui-core-DnR6WYuU.js → vendor-mui-core-CKKG_1TN.js} +2 -2
- package/dist/assets/{vendor-mui-x-CQc01l4r.js → vendor-mui-x-DHGvg6Bj.js} +1 -1
- package/dist/assets/{vendor-utils-CxWN1dT3.js → vendor-utils-CUs2ebe7.js} +17 -17
- package/dist/assets/vendor-ux-DjXlxcvL.js +1560 -0
- package/dist/assets/{vi-HNh41Xxk.js → vi-DF8IinAc.js} +2 -2
- package/dist/assets/{wait-connect-VFnD4S6k.js → wait-connect-TKbZWSFd.js} +1 -1
- package/dist/assets/{wizard-D6nEp8xR.js → wizard-BSaM_cSr.js} +1 -1
- package/dist/assets/wizard-components-BOHnkwWH.js +52 -0
- package/dist/assets/wrap-locale-CFhaO2KZ.js +1 -0
- package/dist/assets/{zh-MM5bvwO_.js → zh-ByJkLAV1.js} +2 -2
- package/dist/assets/{zh-LGxmNDus.js → zh-DG89vJJ6.js} +1 -1
- package/dist/assets/{zh-tw-Dr5DyPwA.js → zh-tw-34G9tsUP.js} +2 -2
- package/dist/index.html +2 -2
- package/package.json +46 -46
- package/dist/assets/Community-CELsDteM.js +0 -1
- package/dist/assets/Holiday-DOCjSYjH.js +0 -1
- package/dist/assets/Meeting-BAXt_LiK.js +0 -1
- package/dist/assets/OffSick-BGEr8Nkc.js +0 -1
- package/dist/assets/WorkingRemotely-BcneAIXG.js +0 -1
- package/dist/assets/add-resource-B3-VwSQg.js +0 -1
- package/dist/assets/addon-DckWyYy3.js +0 -14
- package/dist/assets/advanced-BcLdGbJh.js +0 -14
- package/dist/assets/aigne-Dehkd-7B.js +0 -10
- package/dist/assets/api-FQQlzPOP.js +0 -1
- package/dist/assets/arrow-down.svg-C4FUKwt4.js +0 -1
- package/dist/assets/base32-BPZDlXZz.js +0 -1
- package/dist/assets/bind-account-DtN3r3bu.js +0 -1
- package/dist/assets/branding-Aq4o2tjp.js +0 -1
- package/dist/assets/bundle-avatar-Dtpi1uSw.js +0 -1
- package/dist/assets/button-D6aVYj2n.js +0 -1
- package/dist/assets/cloneDeep-C2rlAYcK.js +0 -1
- package/dist/assets/config-n9Go4CIg.js +0 -53
- package/dist/assets/config-space-DNGDnW7P.js +0 -1
- package/dist/assets/connect-B84DSta0.js +0 -1
- package/dist/assets/connect-CmaOf6IU.js +0 -5
- package/dist/assets/connect-to-BEfFI4oa.js +0 -1
- package/dist/assets/createClass-DXSToV70.js +0 -1
- package/dist/assets/did-address-B3eXeL7H.js +0 -1
- package/dist/assets/domains-BmgTqdar.js +0 -1
- package/dist/assets/edit.svg-RRSklUg-.js +0 -1
- package/dist/assets/email-0rfuUid8.js +0 -17
- package/dist/assets/engine-D-_cbl3F.js +0 -1
- package/dist/assets/exchange-passport-DtpDKfXH.js +0 -1
- package/dist/assets/gen-simple-access-key-BRpJnjDR.js +0 -1
- package/dist/assets/get-safe-url-xl2OarvZ.js +0 -1
- package/dist/assets/index-BMtr5-CV.js +0 -1
- package/dist/assets/index-BODmBNkm.js +0 -200
- package/dist/assets/index-C6oxUE_X.js +0 -281
- package/dist/assets/index-CfA9D2iF.js +0 -1
- package/dist/assets/index-DUo9jXH_.js +0 -81
- package/dist/assets/index-DcjD74XY.js +0 -1
- package/dist/assets/index-DrVXX4fX.css +0 -1
- package/dist/assets/index-E4Hos_Sx.js +0 -150
- package/dist/assets/index-NWCpUGtr.js +0 -1039
- package/dist/assets/index-TG3kf9io.js +0 -120
- package/dist/assets/invitation-CVulfNR5.js +0 -177
- package/dist/assets/invitations-CuhR5Qhr.js +0 -3
- package/dist/assets/issue-passport-CgdZdVEa.js +0 -1
- package/dist/assets/landing-page-Bu1ZaLGu.js +0 -1
- package/dist/assets/list-BYNjj68R.js +0 -2
- package/dist/assets/localization-CZX-M3IK.js +0 -1
- package/dist/assets/lock.svg-BgybwZNe.js +0 -1
- package/dist/assets/logger-Biwe4SzB.js +0 -1
- package/dist/assets/login-DUYsZ42N.js +0 -1
- package/dist/assets/omit-spWLSLbo.js +0 -1
- package/dist/assets/passport-BNRZfcVH.js +0 -1
- package/dist/assets/passport-item-Bf_kXmId.js +0 -1
- package/dist/assets/preferences-XGJx_7ht.js +0 -1
- package/dist/assets/profile-embed-DROgyynT.js +0 -1
- package/dist/assets/publish-resource-C3tnQoPG.js +0 -1
- package/dist/assets/question-mark-circle.svg-CByEVDhb.js +0 -1
- package/dist/assets/revoke.svg-CNl4LAbv.js +0 -1
- package/dist/assets/runtime-DiEn6rZ9.js +0 -1
- package/dist/assets/sdk-C45BrgFy.js +0 -1
- package/dist/assets/server-logo-notext.svg-xZ-i1SpD.js +0 -1
- package/dist/assets/setup-DgF_JFoX.js +0 -24
- package/dist/assets/simple-select-EppOca29.js +0 -1
- package/dist/assets/start-D6EkscL8.js +0 -187
- package/dist/assets/status-vSa6pwrP.js +0 -1
- package/dist/assets/team-D9lFN8Pe.js +0 -146
- package/dist/assets/transfer-IRaap94c.js +0 -16
- package/dist/assets/unsubscribe-7WUPZn-b.js +0 -1
- package/dist/assets/use-server-logo-Cv1kAPgB.js +0 -1
- package/dist/assets/user-center-BoGQKLvn.js +0 -125
- package/dist/assets/user-follower-D8NzTP2C.js +0 -32
- package/dist/assets/vendor-ux-jvAfFAl1.js +0 -1563
- package/dist/assets/wizard-components-CQAhuCn-.js +0 -52
- package/dist/assets/wrap-locale-qgV7mOv6.js +0 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import{r as x}from"./vendor-react-CTtPmzVP.js";import{j as e,W as d,am as mt,ak as N,T as Y,U as ke,y as Fe,bk as Ve,b$ as Re,bX as Te,a5 as Ie,Q as Ce,dH as Pe,aN as Ee,a6 as Ge,D as Ye,cD as ht,ad as Qe,e5 as gt,e6 as xt,at as ae,b4 as He,n as bt,J as yt,x as jt,bZ as St,M as qe,cB as vt}from"./vendor-mui-core-CKKG_1TN.js";import{e as ee,l as Ct,w as pe}from"./vendor-utils-CUs2ebe7.js";import{W as q,ba as Nt,V as X,dg as wt,m as Xe,Y as Ze,F as Ae,b3 as Je,bE as be,a_ as Rt,bc as Tt,bk as It,bu as Et}from"./vendor-ux-DjXlxcvL.js";import{Z as At,Q as H,c as E,C as Dt,a1 as Ue}from"./index-BEfIUbZC.js";import{a as Q,g as De}from"./vendor-hooks-DQAdyHrE.js";import{S as me}from"./shorten-label-DXFyDHDr.js";import{v as et}from"./index-BSZ3mQac.js";import{R as tt,A as Ot,S as Lt,a as kt,B as Ft}from"./list-BbHzj-7w.js";import{i as Pt,e as _t,N as Bt}from"./team-DkV63Yjl.js";import{W as zt}from"./did-address-Cq16cwTy.js";import{p as st}from"./util-BgLSp_5A.js";import{D as Wt,g as Mt}from"./traffic-C8BReAMz.js";import{B as nt}from"./bundle-avatar-1zs0l21j.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BCP2x3BR.js";import"./server-logo-notext.svg-BLAdvsmP.js";import"./session-Cin9Rizr.js";import"./isURL-vNa-ZfGd.js";import"./use-app-logo-DnCfhAzv.js";import"./base32-r3F0yIbl.js";import"./useAsyncRetry-B_bXUXWM.js";import"./useAsync-D6IP8T2e.js";import"./iframe-BHP6CYbe.js";import"./index-KUC3HPt0.js";import"./index-DBs9Ljax.js";import"./base-chart-DT--nPCU.js";import"./index-CaQuyP_U.js";import"./vendor-mui-x-DHGvg6Bj.js";import"./AdapterDayjs-C1bdndja.js";const at=x.createContext({}),{Provider:Kt,Consumer:Hs}=at;function Ht({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:i}}=At(),[l,b]=x.useState([]),[m,S]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),h=Q(()=>s.meta?.did,[s]),[y,v]=x.useState([]),[P,F]=x.useState({}),w=Q(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),U=async({page:p=1,pageSize:g=20,...T}={})=>{if(!h)return[];try{const D={paging:{page:p,pageSize:g},...T,teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0},{dids:O,...z}=D;let _="";O&&O.includes("system")&&(_="system");const ie=O?O.filter(oe=>oe!=="system"):[],se={...z,source:_,componentDids:ie},J=await n.getNotificationSendLog({input:se});return F(se),b(J.list),S(J.paging),J.list}catch(D){return q.error(D.message),[]}},M=async()=>{const p=await n.getNotificationComponents({input:{teamDid:h}});v(p.componentDids)},L=x.useCallback(p=>{const g=s.children.find(T=>T.meta?.did===p);if(g)return g.ancestors=[s],g},[s]),k=async({notificationId:p,receivers:g,channels:T,...D})=>{await n.resendNotification({input:{teamDid:h,notificationId:p,receivers:g,channels:T.map(O=>O==="wallet"?E.NOTIFICATION_SEND_CHANNEL.WALLET:O==="pushKit"?E.NOTIFICATION_SEND_CHANNEL.PUSH:O),...D}})},$=x.useCallback(async p=>(await n.getUser({input:{teamDid:h,user:{did:p},options:{enableConnectedAccount:!0}}})).user,[n,h]),V=x.useCallback(async({page:p=1,pageSize:g=20,...T}={})=>{try{const D={paging:{page:p,pageSize:g},...T,userName:T.searchText||"",teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:D})}catch(D){throw q.error(D.message),D}},[n,h]);x.useEffect(()=>{h&&M()},[h]),i(E.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,p=>{w.has(p.notificationId)&&U(P)},[w,P]),i(E.EVENTS.NOTIFICATION_BLOCKLET_CREATE,p=>{w.has(p.id)||U(P)},[w,P]);const Z={fetch:U,data:l,paging:m,blocklet:s,getComponent:L,resendNotification:k,getUser:$,componentDids:y,getReceivers:V,inService:r,teamDid:h};return e.jsx(Kt,{value:{notificationRecords:Z},children:t})}function _e(){const{notificationRecords:t}=x.useContext(at);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const qt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(Nt,{type:qt[t],children:t})}const Ut=(t,s,n="")=>{if(!n||!s)return"";switch(n){case E.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function it(t,s,n={}){const{status:r,updatedAt:i,reason:l="",channel:b="wallet"}=n,m=i?t("notification.sendStatus.sentTime",{date:Dt(i,s)}):"",S=Ut(t,b,l);return r===E.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:m,reason:S}:r===E.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:m}:{status:"pending",title:t("notification.sendStatus.pending"),reason:S,sentTime:m}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],$e=["info","success","error","warning"],ot=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},rt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},$t=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ot(t),enabled:n}},Vt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:rt(t),enabled:n}},Gt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),Yt=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),ge=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),Qt=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],xe=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},Xt=(t,s="")=>{if(s&&Le.includes(s)){const l=`${s}SendRecord`,b=ee(t,l,[]);return xe(b)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return xe(l)}const i={};return Le.forEach(l=>{const b=`${l}SendRecord`,m=ee(t,b,[]),S=xe(m);i[l]=S}),r.length>0&&r.forEach(l=>{const b=n[l]??[],m=xe(b);i[l]=m}),i},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},je=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},Zt=t=>{switch(t){case E.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case E.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case E.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case E.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},lt=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:i,title:l="",sentTime:b="",reason:m=""}=t,S=[l,m].filter(Boolean).join(", ");return e.jsx(mt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(Y,{color:"inherit",sx:{fontSize:12},children:S}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(N,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(N,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(N,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[i]}}),e.jsx(N,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[i]}})]}),e.jsx(Y,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Se.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Se({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:i}=X();return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(Y,{children:[s,": "]}),t.map(l=>{const b=it(r,i,{status:l});return e.jsx(ke,{size:"small",label:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:b,enableTooltip:!1,children:b.title})}),onDelete:m=>n(m,l)},l)})]})}Be.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function Be({filterList:t,onChange:s,index:n,column:r,filterValues:i,label:l,renderLabel:b}){return e.jsxs(Fe,{className:"filter-container",children:[e.jsx(Ve,{component:"legend",children:l}),e.jsx(Re,{row:!0,children:i.map(m=>e.jsx(Te,{control:e.jsx(Ie,{checked:t[n].indexOf(m.value??m)>-1,onChange:S=>{const h=[...t];S.target.checked?h[n]=[...h[n],m.value??m]:h[n]=h[n].filter(y=>y!==(m.value??m)),s(h[n],n,r)},name:m.value??m}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(m)})},m.value??m))})]})}function we(t){return e.jsx(Be,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:i}){const{t:l,locale:b}=X(),m=it(l,b,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(N,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:m,showTitle:!0}),m.status!=="success"&&e.jsx(Ce,{className:"resend-btn",size:"small",startIcon:e.jsx(Pe,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:i,children:l("notification.resend")})]})}ze.propTypes={value:d.array.isRequired,onChange:d.func};function ze({value:t,onChange:s}){const{locale:n}=X(),r=H().toDate(),[i,l]=x.useState(null),b=x.useCallback(h=>{l(i?null:h.currentTarget)},[i]),m=!!i,S=x.useCallback(h=>{if(!h.startDate||!h.endDate){q.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){q.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(Y,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ce,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[Ue(t[0],n)," - ",Ue(t[1],n)]})}),e.jsx(Ee,{open:m,anchorEl:i,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Wt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Mt(r),onChange:S})})]})}We.propTypes={itemComponent:d.elementType.isRequired};function We({itemComponent:t,...s}){const{t:n}=X();return!s?.filterList?.filter(i=>i.length).length?null:e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(wt.TableFilterList,{...s,ItemComponent:t})})]})}function Me({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const i=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(ke,{label:t,variant:"outlined",...i&&l?{onDelete:i}:{}})}Me.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const Jt=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];ct.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function ct({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=X(),[i,l]=x.useState(Jt),[b,m]=x.useState(!0),S=(y,v)=>{v.checked=y.target.checked;const P=i.map(F=>({...F,checked:F.value===v.value?v.checked:F.checked}));l(P)},h=y=>{y.stopPropagation(),n({channels:i.filter(v=>v.checked).map(v=>v.value),isResendFailedOnly:b})};return e.jsxs(N,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(Y,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(N,{className:"choose-channel",children:e.jsxs(Fe,{component:"fieldset",variant:"standard",children:[e.jsx(Ve,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Re,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:i.map(y=>e.jsx(Te,{control:e.jsx(Ie,{checked:y.checked,onChange:v=>S(v,y),name:y.value}),label:y.label},y.value))})]})}),e.jsx(N,{className:"resend-config-footer",children:e.jsx(Re,{children:e.jsx(Te,{control:e.jsx(Ie,{checked:b,onChange:y=>m(y.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(N,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ce,{onClick:y=>{y.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ce,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Ge,{size:16}),r("common.confirm")]})]})]})}dt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function dt({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:i}=X(),l=Ye(),b=x.useMemo(()=>Xe(l,lt()),[l]),{getReceivers:m,inService:S,teamDid:h,getUser:y,blocklet:v}=_e(),[P,F]=x.useState(!1),[w,U]=x.useState([]),M=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[k,$]=x.useState(null),[V,Z]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,g]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[T,D]=x.useState([]),O=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],z=async()=>{if(!P&&t)try{F(!0);const a=await m({notificationId:t,...p}),o=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,S)}}));U(o),Z(a.paging),F(!1)}catch(a){q.error(a.message),F(!1)}};x.useEffect(()=>{z()},[p]);const _=a=>{a.stopPropagation();const o=a.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ie=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Ae,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(Pe,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:_,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:V.page-1,rowsPerPage:V.pageSize,count:V.total,searchText:p.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:T,onRowSelectionChange:(a,o)=>{D(o.map(c=>c.dataIndex))},customToolbarSelect:ie},J=({page:a,rowsPerPage:o,searchText:c,filterList:C})=>{const[,B=[],G=[],K=[]]=C;p.pageSize!==o?g(W=>({...W,pageSize:o,page:1})):p.page!==a+1?g(W=>({...W,page:a+1})):p.searchText!==c?g(W=>({...W,searchText:c,page:1})):pe(B,p.walletSendStatus)?pe(G,p.pushKitSendStatus)?pe(K,p.emailSendStatus)||g(W=>({...W,emailSendStatus:K,page:1})):g(W=>({...W,pushKitSendStatus:G,page:1})):g(W=>({...W,walletSendStatus:B,page:1}))},oe=x.useCallback(async(a,o)=>{if(!o)return!1;const c=await y(o);return c?a==="wallet"?Gt(c):a==="email"?$t(v,c):a==="pushKit"?Vt(v,c):a==="webhook"?Yt(c):!0:!1},[y,v]),Ne=x.useCallback(a=>Qt(r,a),[r]),f=()=>{M.anchorEl=null,M.position=null,$(null)},u=()=>{L.anchorEl=null,L.position=null},j=async(a,o,c=!0,C="")=>{if(!(!o.length||!a.length))try{s(a,o,c,C),L.anchorEl||(await ge(.5),f())}catch(B){console.error("handleResend error",{error:B})}},I=async({channels:a,isResendFailedOnly:o})=>{const c=T.map(C=>w[C].receiver);await j(a,c,o),await ge(.5),u(),D([])},A=async(a,o=[],c=!0)=>{try{await j(["webhook"],[a.receiver],c,o)}catch(C){q.error(C.response?C.response.statusText:C.message)}},R=async(a,o,c,C=[],B=!0)=>{if(a.stopPropagation(),Xt(o,c)>=4){q.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await A(o,C,B);return}if(a){const K=a.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}$({channel:c});try{const K=await oe(c,o.receiver);await ge(1),$({channel:c,result:K}),(typeof K=="boolean"&&K||Ct(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[o.receiver],B),L.anchorEl||(await ge(.5),f()))}catch(K){q.error(K.message)}},re=a=>{g(o=>({...o,dateRange:a,page:1}))},ne=(a,o,c,C)=>{a.stopPropagation();const B=c.filter(G=>G!==o);g(G=>({...G,[C]:B,page:1}))},le=Q(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:o,receiver:c}=w[a];return o?e.jsxs(N,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Ze,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(zt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:p.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Wallet",filterList:a,onChange:o,index:c,column:C,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"wallet",onResend:B=>R(B,w[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"pushkit",onResend:B=>R(B,w[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Push Kit",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"email",onResend:B=>R(B,w[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Email",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:o}=w[a];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[C,B]=c,G=B[0];return e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(N,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:C},C),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:K=>R(K,w[a],"webhook",[C],!1)})]},C)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:o}=w[a];return e.jsx(tt,{value:o,locale:i,shouldUpdate:!0})}}}],[w,i,p,r]),ft=[e.jsx(ze,{value:p.dateRange,onChange:re},"date-picker"),e.jsx(Ae,{variant:"contained",size:"small",color:"primary",loading:P,startIcon:e.jsx(ht,{}),onClick:()=>z(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(N,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ts,{children:e.jsxs(Qe,{theme:b,children:[e.jsx(Je,{className:"receivers-table",locale:i,loading:P,columns:le,data:w,onChange:J,options:se,customButtons:ft,components:{TableFilterList:a=>e.jsx(We,{...a,itemComponent:o=>e.jsx(Me,{...o,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ee,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(ss,{children:[e.jsxs(Y,{variant:"body1",component:"div",className:"check-title",children:[k?.channel," Checking"]}),e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:Ne(k?.channel).map(a=>{const{type:o,pass:c,fail:C}=a;return!k?.result||k?.result?.[o]?e.jsxs(Y,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:k?.result?.[o]?be.success.main:"inherit"},children:[k?.result?e.jsx(gt,{}):e.jsx(Ge,{size:12,sx:{color:be.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs(Y,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:be.error.main},children:[e.jsx(xt,{}),e.jsx("span",{children:C})]},o)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:u,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(ct,{loading:n,onCancel:u,onConfirm:I})})]})})})}const es=x.memo(dt),ts=ae.div`
|
|
2
|
+
td.MuiTableCell-footer {
|
|
3
|
+
border: none !important;
|
|
4
|
+
}
|
|
5
|
+
.sent-status-cell {
|
|
6
|
+
.resend-btn {
|
|
7
|
+
display: none;
|
|
8
|
+
}
|
|
9
|
+
&:hover {
|
|
10
|
+
.resend-btn {
|
|
11
|
+
display: flex;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`,ss=ae.div`
|
|
16
|
+
padding: 8px 16px;
|
|
17
|
+
.check-title {
|
|
18
|
+
font-weight: 500;
|
|
19
|
+
margin-bottom: 8px;
|
|
20
|
+
&::first-letter {
|
|
21
|
+
text-transform: uppercase;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
.check-item {
|
|
25
|
+
svg {
|
|
26
|
+
font-size: 16px;
|
|
27
|
+
}
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
}
|
|
30
|
+
`,fe=t=>t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t;function ns(t){const{wallet:s,push:n,email:r,webhook:i}=t;return[{name:"Wallet",value:e.jsx(de,{item:s})},{name:"Push",value:e.jsx(de,{item:n})},{name:"Email",value:e.jsx(de,{item:r})},...i.total>0?[{name:"Webhook",value:e.jsx(de,{item:i,isWebhook:!0})}]:[]]}function as(t,s,n){const{wallet:r,push:i,email:l,webhook:b}=t;return[{name:"Wallet",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.WALLET,item:r,onResend:s})},{name:"Push",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.PUSH,item:i,onResend:s})},{name:"Email",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.EMAIL,item:l,onResend:s})},...b.total>0?[{name:"Webhook",value:e.jsx(ue,{loading:n,channel:E.NOTIFICATION_SEND_CHANNEL.WEBHOOK,item:b,isWebhook:!0,onResend:s})}]:[]]}Ke.propTypes={statistics:d.object.isRequired,onResend:d.func,mode:d.oneOf(["simple","detail"]),resending:d.bool};de.propTypes={item:d.object.isRequired,isWebhook:d.bool};function de({item:t,isWebhook:s=!1}){const{t:n}=X(),r=s?t.success.length:t.success,i=t.total,l=r===i?"success":"failed";return e.jsx(N,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2},children:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:1},children:e.jsxs(te,{config:{status:l},enableTooltip:!1,children:[fe(r)," / ",fe(i)," ",n("notification.sendStatus.success")]})})})}ue.propTypes={item:d.object.isRequired,isWebhook:d.bool,channel:d.string,onResend:d.func,loading:d.bool};function ue({channel:t=E.NOTIFICATION_SEND_CHANNEL.WALLET,item:s,isWebhook:n=!1,onResend:r=()=>{},loading:i=!1}){const{t:l}=X(),{success:b,failed:m,pending:S}=s,h=Zt(t),y=n?b.length:b,v=n?m.length:m,P=n?S.length:S,F=async L=>{L.stopPropagation();const k=n?[...new Set([...b,...m].map($=>$))]:[];await r([t],[],!0,k)},w=y+v,U=w>0?y/w*100:0,M=w>0?v/w*100:0;return e.jsxs(is,{successRatio:U,failedRatio:M,children:[e.jsxs(Y,{variant:"h6",children:[h," (",s.total,")"]}),e.jsxs(Y,{variant:"body1",sx:{mb:2},children:[e.jsx("span",{style:{color:Oe.success,fontWeight:600,fontSize:24},children:fe(y)}),e.jsx("small",{style:{paddingLeft:4},children:l("notification.sendStatus.success")})]}),e.jsxs(N,{className:"unsent-area",children:[e.jsxs(N,{children:[e.jsxs(te,{config:{status:"failed"},enableTooltip:!1,children:[fe(v)," ",l("notification.sendStatus.failed")]}),e.jsxs(te,{config:{status:"pending"},enableTooltip:!1,children:[fe(P)," ",l("notification.sendStatus.pending")]})]}),v>0&&e.jsx(N,{className:"resend-btn",children:e.jsx(Ae,{size:"small",color:"primary",loading:i,variant:"contained",startIcon:e.jsx(Pe,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:F,children:l("notification.resend")})})]})]})}function Ke({statistics:t,mode:s="simple",onResend:n=()=>{},resending:r=!1}){const i=Q(()=>s==="simple"?ns(t):as(t,n,r),[t,s]);return s==="simple"?e.jsx("div",{children:i.map(l=>e.jsx(et,{style:{alignItems:"flex-start",marginBottom:s==="simple"?0:16},valueComponent:"div",nameWidth:100,name:l.name,children:l.value},l.name))}):e.jsx(He,{container:!0,spacing:2,children:i.map(l=>e.jsx(He,{size:{md:4,sm:6,xs:12},children:l.value},l.name))})}const is=ae(N)`
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
align-items: flex-start;
|
|
34
|
+
padding: 16px;
|
|
35
|
+
border-radius: 8px;
|
|
36
|
+
background: ${({successRatio:t,failedRatio:s,theme:n})=>t===0&&s===0?n.palette.grey[300]:`linear-gradient(to right, ${bt(n.palette.success.light,.4)} ${t}%, ${n.palette.grey[100]} ${t}%)`};
|
|
37
|
+
transition: 'background 0.5s ease';
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
.unsent-area {
|
|
40
|
+
width: 100%;
|
|
41
|
+
position: relative;
|
|
42
|
+
.resend-btn {
|
|
43
|
+
position: absolute;
|
|
44
|
+
right: 0;
|
|
45
|
+
bottom: 0;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
`;ut.propTypes={notification:d.object.isRequired,onCancel:d.func,blocklet:d.object.isRequired,tab:d.string};function ut({notification:t,onCancel:s=()=>{},blocklet:n,tab:r="info"}){const{t:i,locale:l}=X(),{getComponent:b,resendNotification:m}=_e(),[S,h]=x.useState(!1),y=Q(()=>b(t.componentDid)||n,[n,t.componentDid]),v=De({tab:r||"info"}),P=x.useCallback(async(p,g,T=!0,D=[])=>{if(!p.length||!t.id)return;const O=g.length>0?g:t?.receivers?.map(_=>_.receiver);if(!O.length)return;let z=[...p];if(z.includes(E.NOTIFICATION_SEND_CHANNEL.PUSH)&&!rt(n)&&(q.warning(i("notification.sendStatus.reason.unavailable",{channel:"Push Kit"})),z=z.filter(_=>_!==E.NOTIFICATION_SEND_CHANNEL.PUSH)),z.includes(E.NOTIFICATION_SEND_CHANNEL.EMAIL)&&!ot(n)&&(q.warning(i("notification.sendStatus.reason.unavailable",{channel:"Email"})),z=z.filter(_=>_!==E.NOTIFICATION_SEND_CHANNEL.EMAIL)),!!z.length)try{h(!0),await m({notificationId:t.id,receivers:O,channels:z,resendFailedOnly:T,...z.includes("webhook")&&D.length?{webhookUrls:D}:{}}),q.success("Message has been sent!")}catch(_){console.error("handleResend error",{error:_}),q.error(_.response?_.response.statusText:_.message)}finally{h(!1)}},[n,t.id,t?.receivers,m,i]),F=Q(()=>Pt(t),[t]),w=Q(()=>_t(t),[t]),U=Q(()=>F?t?.actorInfo:[],[t]),M=Q(()=>n?.did||n?.meta?.did||"",[n]);function L(){return[{name:i("notification.from"),value:F&&w?e.jsx(Ot,{actors:U,teamDid:M,size:32,showName:!0}):e.jsx(Lt,{size:32,blocklet:y,showName:!0,hideDot:!0})},{name:i("notification.notificationTitle"),value:e.jsx(me,{maxLength:50,children:t.title})},{name:i("notification.body"),value:F?e.jsx(kt,{notification:t,blocklet:n}):e.jsx(Bt,{notification:t,rows:0})},{name:i("notification.severity"),value:e.jsx(he,{severity:t.severity})},{name:i("notification.createdAt"),value:e.jsx(It,{value:t.createdAt,locale:l,shouldUpdate:!0,type:"all"})}].map(g=>e.jsx(et,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:120,name:g.name,children:g.value},g.name))}const k={info:{label:i("common.basicInfo"),value:"info",component:L},receivers:{label:i("notification.receiver"),value:"receivers"},statistics:{label:i("notification.statistics"),value:"statistics"}},$=Object.values(k).map(({label:p,value:g})=>({label:p,value:g})),V=k[v.tab]||k.info,Z=p=>{v.tab=p};return e.jsx(Rt,{title:i("notification.notificationDetails"),fullWidth:!0,maxWidth:"lg",onClose:()=>{v.tab="info",s()},open:!0,actionsPosition:"left",sx:{".ux-dialog_header":{paddingBottom:0},".MuiDialogContent-root":{paddingTop:0}},children:e.jsxs(rs,{children:[e.jsx(N,{className:"tabs",sx:{mx:3},children:e.jsx(Tt,{tabs:$,current:v.tab,onChange:Z,scrollButtons:"auto"})}),e.jsxs("div",{className:"body",children:[v.tab==="receivers"&&e.jsx(es,{notificationId:t.id,resending:S,handleResend:P}),v.tab==="statistics"&&e.jsx(Ke,{statistics:t.statistics,mode:"detail",resending:S,onResend:P}),v.tab==="info"&&e.jsx(V.component,{})]})]})})}const os=x.memo(ut),rs=ae.div`
|
|
49
|
+
& > .notification-row {
|
|
50
|
+
padding: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.tabs {
|
|
54
|
+
margin: 0;
|
|
55
|
+
}
|
|
56
|
+
.body {
|
|
57
|
+
margin-top: 16px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.channel-item {
|
|
61
|
+
display: flex;
|
|
62
|
+
padding: 4px;
|
|
63
|
+
justify-content: flex-start;
|
|
64
|
+
align-items: center;
|
|
65
|
+
gap: 8px;
|
|
66
|
+
> p {
|
|
67
|
+
font-size: 15px;
|
|
68
|
+
}
|
|
69
|
+
.resend-btn {
|
|
70
|
+
svg {
|
|
71
|
+
font-size: 16px;
|
|
72
|
+
}
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
font-size: 12px;
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
&.disabled {
|
|
78
|
+
cursor: not-allowed;
|
|
79
|
+
color: ${be.text.disabled};
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`;ve.propTypes={blocklet:d.object,label:d.string};const ls=ae.div`
|
|
84
|
+
display: flex;
|
|
85
|
+
justify-items: flex-start;
|
|
86
|
+
align-items: center;
|
|
87
|
+
gap: 8px;
|
|
88
|
+
.name {
|
|
89
|
+
display: block;
|
|
90
|
+
max-width: 260px;
|
|
91
|
+
white-space: nowrap;
|
|
92
|
+
overflow: hidden;
|
|
93
|
+
text-overflow: ellipsis;
|
|
94
|
+
}
|
|
95
|
+
`;function ve({blocklet:t=null,label:s=""}){return e.jsx(ls,{children:t?e.jsxs(e.Fragment,{children:[e.jsx(nt,{size:24,blocklet:t,ancestors:t.ancestors}),e.jsx("span",{className:"name",children:t.title||t.meta?.title})]}):e.jsx("span",{className:"name",children:s})})}pt.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function pt({list:t,label:s,onDelete:n=()=>{}}){return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(Y,{children:[s,": "]}),t.map(r=>e.jsx(ke,{size:"small",label:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(he,{severity:r})}),onDelete:i=>n(i,r)},r))]})}function cs(t){return e.jsx(Be,{...t,renderLabel:s=>e.jsx(he,{severity:s})})}function ds({customTableButtons:t}){const{t:s,locale:n}=X(),r=Ye(),i=yt(r.breakpoints.down("sm")),l=x.useMemo(()=>Xe(r,lt()),[r]),[b,m]=x.useState(!1),{data:S,paging:h,blocklet:y,fetch:v,getComponent:P,componentDids:F,inService:w,teamDid:U}=_e(),M=x.useRef(null),[L,k]=x.useState(null),[$,V]=x.useState("info"),Z=`notification-records-${y.meta?.did}`,p=Et(Z),[g,T]=x.useState({pageSize:p.rowsPerPage||10,page:p.page?p.page+1:1,dids:p.dids||[],dateRange:p.dateRange||[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),D=Q(()=>{if(!y.children||!y.children.length)return[];const f=[];return y.children.forEach(u=>{const j=u.did||u.meta?.did;F.includes(j)&&(u.ancestors=[y],f.push(u))}),f},[F,y]),O=async f=>{try{m(!0),await v(f),m(!1)}finally{m(!1)}};x.useEffect(()=>{O(g)},[g]),x.useEffect(()=>{const f=S.find(u=>u.id===L?.id);L&&f&&k({...f})},[S]);const z=(f,u,j,I)=>{f.stopPropagation();const A=j.filter(R=>R!==u);T(R=>({...R,[I]:A,page:1}))},_=({page:f,rowsPerPage:u,filterList:j})=>{const[I=[],,,,A=[]]=j;g.pageSize!==u?T(R=>({...R,pageSize:u,page:1})):g.page!==f+1?T(R=>({...R,page:f+1})):pe(g.dids,I)?pe(g.severities,A)||T(R=>({...R,severities:A,page:1})):T(R=>({...R,dids:I,page:1}))},ie=x.useCallback(()=>{k(null),V("info")},[]),se=x.useCallback(()=>{v(g)},[v,g]),J=[{label:s("notification.from"),name:"sender",width:400,options:{filter:!0,filterType:"custom",customFilterListOptions:{render:f=>f.map((u,j)=>{if(u==="system")return e.jsx("span",{children:s("notification.system")},`system-${j}`);const I=D.find(A=>(A.did||A.meta?.did)===u);return e.jsx(ve,{blocklet:I,label:I?.title||I?.meta?.title},u)}),update:(f,u,j)=>(f[j].splice(u,1),f)},filterOptions:{names:D,logic:(f,u)=>u.length?!u.includes(f):!1,display:(f,u,j,I)=>e.jsxs(Fe,{style:{width:"380px"},children:[e.jsx(jt,{id:"demo-simple-select-label",style:{background:"#ffffff"},children:"Sender"}),e.jsxs(St,{multiple:!0,value:f[j],renderValue:A=>e.jsx(N,{style:{overflow:"hidden",textOverflow:"ellipsis"},sx:{display:"flex",gap:1,alignItems:"center"},children:A.map(R=>{if(R==="system")return e.jsx("span",{children:s("notification.system")},R);const re=D.find(ne=>(ne.did||ne.meta?.did)===R);return e.jsx(ve,{blocklet:re,label:re?.title||re?.meta?.title},R)})}),onChange:A=>{f[j]=A.target.value,u(f[j],j,I)},children:[e.jsx(qe,{value:"system",children:s("notification.system")}),D.map(A=>{const R=A.did||A.meta?.did;return e.jsx(qe,{value:R,children:e.jsx(ve,{blocklet:A,label:A.title||A.meta?.title})},R)})]})]})},customBodyRenderLite:f=>{const u=S[f],j=P(u.componentDid);return e.jsxs(N,{sx:{display:"flex",alignItems:"center",gap:1},children:[j?e.jsx(nt,{size:32,blocklet:j,ancestors:j.ancestors??[]}):e.jsx(Ft,{blocklet:y,size:32}),e.jsx(me,{maxLength:50,children:j?.meta?.title||y?.meta?.title})]})}}},{label:s("notification.receiver"),name:"receivers",width:300,options:{filter:!1,customBodyRenderLite:f=>{const u=S[f],{receivers:j}=u;return e.jsx(vt,{total:j.length,renderSurplus:I=>I<100?e.jsxs("span",{children:["+",I]}):e.jsx("span",{children:"99+"}),max:3,sx:{justifyContent:"flex-end",height:"32px",".MuiAvatar-root":{width:"32px",height:"32px",fontSize:"12px",border:0,zIndex:2}},onClick:I=>{I.stopPropagation(),k(u),V("receivers")},children:j.map(I=>{const{receiverUser:A}=I,R=st(A.avatar,U,w);return e.jsx(Ze,{alt:A.fullName,src:`${R}?imageFilter=resize&w=48&h=48`,size:32,did:I.receiver,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}},I.receiver)})})}}},{label:s("notification.statistics"),name:"statistics",width:400,options:{filter:!1,customBodyRenderLite:f=>{const u=S[f];return e.jsx(N,{onClick:j=>{j.stopPropagation(),k(u),V("statistics")},children:e.jsx(Ke,{statistics:u.statistics})})}}},{label:s("notification.notificationPreview"),name:"data",options:{filter:!1,customBodyRenderLite:f=>{const u=S[f];return e.jsx(me,{maxLength:50,children:u.title})}}},{label:s("notification.severity"),name:"severity",width:200,options:{setCellProps:()=>({className:"severity-cell"}),customBodyRenderLite:f=>{const u=S[f];return e.jsx(he,{severity:u.severity})},filter:!0,filterType:"custom",filterList:g.severities??[],customFilterListOptions:{render:f=>e.jsx(pt,{list:f,label:s("notification.severity"),onDelete:(u,j)=>{u.stopPropagation(),z(u,j,J[4].options.filterList,"severities")}}),update:ye},filterOptions:{names:$e,fullWidth:!0,logic:je,display:(f,u,j,I)=>e.jsx(cs,{label:s("notification.severity"),filterList:f,onChange:u,index:j,column:I,filterValues:$e})}}},{label:s("common.createdAt"),name:"createdAt",width:300,options:{filter:!1,customBodyRenderLite:f=>{const{createdAt:u}=S[f];return e.jsx(tt,{value:u,locale:n,shouldUpdate:!0})}}}],oe=f=>{T(u=>({...u,dateRange:f,page:1}))},Ne=[...t||[]];return e.jsxs(N,{ref:M,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(us,{isBreakpointsDownSm:i,children:e.jsx(Qe,{theme:l,children:e.jsx(Je,{className:"main-table",verticalKeyWidth:100,loading:b,locale:n,columns:J,data:S,durable:Z,onChange:_,options:{sort:!1,download:!1,print:!1,search:!1,expandableRowsOnClick:!0,page:h.page-1,rowsPerPage:h.pageSize,count:h.total,...p,onRowClick:(f,{dataIndex:u})=>{k(S[u])}},title:e.jsx(ze,{value:g.dateRange,onChange:oe}),customButtons:Ne,components:{TableFilterList:f=>e.jsx(We,{...f,itemComponent:u=>e.jsx(Me,{...u,canDelete:j=>j?.columnNames?.[j?.index||0]?.name==="sender"})})}})})}),L&&e.jsx(os,{refresh:se,onCancel:ie,notification:L,blocklet:y,tab:$})]})}const us=ae.div`
|
|
96
|
+
td.MuiTableCell-footer {
|
|
97
|
+
border: none !important;
|
|
98
|
+
}
|
|
99
|
+
.sent-status-cell {
|
|
100
|
+
.resend-btn {
|
|
101
|
+
display: none;
|
|
102
|
+
}
|
|
103
|
+
&:hover {
|
|
104
|
+
.resend-btn {
|
|
105
|
+
display: flex;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.custom-toobar-btns {
|
|
111
|
+
gap: 4px;
|
|
112
|
+
}
|
|
113
|
+
.custom-toobar-title-inner {
|
|
114
|
+
display: flex;
|
|
115
|
+
justify-content: ${({isBreakpointsDownSm:t})=>t?"space-between":"flex-end"};
|
|
116
|
+
padding-right: ${({isBreakpointsDownSm:t})=>t?"0":"8px"};
|
|
117
|
+
flex-wrap: wrap;
|
|
118
|
+
gap: 8px;
|
|
119
|
+
}
|
|
120
|
+
`;ps.propTypes={blocklet:d.object.isRequired,customTableButtons:d.array};function ps({blocklet:t={},customTableButtons:s=[]}){return e.jsx(Ht,{blocklet:t,children:e.jsx(ds,{customTableButtons:s})})}export{ps as default};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import{V as $,W as P,K as me,bv as ke,d6 as St,d7 as Lt,b9 as le,ay as N,a_ as we,F as M,a8 as Y,d8 as It,d9 as Ct,bb as Fe,da as Dt,b3 as Tt,bc as Ne}from"./vendor-ux-DjXlxcvL.js";import{b as g,a as se,f as At,g as be,c as Pt}from"./vendor-hooks-DQAdyHrE.js";import{r as L,L as Et}from"./vendor-react-CTtPmzVP.js";import{j as e,ak as m,y as V,z as q,W as u,bX as Q,Q as X,T as te,I as pe,a3 as he,D as Le,b6 as _,cu as _e,bi as qe,d_ as Ot,at as $e,ah as Je,d$ as Ke,a6 as Be,am as Ft,e0 as qt,bb as Bt,d2 as Rt,d3 as Wt,dV as zt,bO as Ut,b0 as Nt,d4 as _t,U as Ge,Y as Vt,b5 as Ht,$ as Mt,bZ as $t,M as Jt,R as Kt,e1 as Gt}from"./vendor-mui-core-CKKG_1TN.js";import{M as ae}from"./provider-icon-CkqIY6iX.js";import{x as re,n as B,z as ge,E as Ze,b as je,a3 as Xe,aD as Zt,a as Ye}from"./vendor-utils-CUs2ebe7.js";import{Z as K,Y as J,c as ne,cH as Re,aB as Qe,bA as Xt,J as We,l as Yt}from"./index-BEfIUbZC.js";import{u as ie,C as A,a as Ve}from"./index.esm-Co8ZxFyk.js";import{S as C}from"./section-CenHBXqj.js";import{S as Qt}from"./switch-control-npfWE_aC.js";import{d as en,a as tn}from"./edit-rounded-CnMn6J-D.js";import{S as nn}from"./simple-select-DtCsUIHR.js";import{u as et}from"./index-BnOC3Ium.js";import{v as on}from"./index-BSZ3mQac.js";import{r as an}from"./base32-r3F0yIbl.js";import{C as sn}from"./click-to-copy-Dk6ZAJOw.js";import{u as rn}from"./use-mobile-_vjPRYx2.js";import"./lottie-web-4koyQiv_.js";import"./google-icon-vNOJy67F.js";import"./vendor-arcblock-BCP2x3BR.js";import"./required-DHjZE3-Y.js";import"./arrow-down.svg-7ME6T1BL.js";const Ie={domain:"",clientId:"",clientSecret:""};function tt({ref:r=null,onSuccess:s=B,sortMaps:l={}}){const{api:i}=K(),{blocklet:n}=J(),{t,locale:d}=$(),c=n?.meta?.did,f=Object.assign({...Ie},n?.settings?.authentication?.auth0||{}),p=(n.environments||[]).find(a=>a.key==="BLOCKLET_APP_URL")?.value||window.location.origin,{handleSubmit:y,control:w,formState:h,reset:b}=ie({defaultValues:re(f,Object.keys(Ie))}),x=g(async a=>{try{const{blocklet:o}=await i.configAuthentication({input:{did:c,authentication:JSON.stringify({...l,auth0:{...a,order:l.auth0?.order??Object.keys(l).length,enabled:!0,type:"oauth"}})}}),I=Object.assign({...Ie},o?.settings?.authentication?.auth0||{});b(I),P.success(t("common.saveSuccess")),s()}catch(o){P.error(o.message||t("common.saveFailed"))}}),D=g(a=>a?.trim()?!0:t("authentication.auth0.domainDescription")),S=g(a=>a?.trim()?!0:t("authentication.auth0.clientIdDescription")),T=g(a=>a?.trim()?!0:t("authentication.auth0.clientSecretDescription")),v=se(()=>d==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-auth0":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-auth0",[d]),j=ge(p,ne.WELLKNOWN_SERVICE_PATH_PREFIX,"oauth/callback/auth0");return L.useImperativeHandle(r,()=>({submit:y(x)}),[y,x]),e.jsx(m,{children:e.jsxs("form",{onSubmit:y(x),disabled:!0,children:[e.jsx(C,{title:t("authentication.viewDocument"),children:e.jsxs(m,{component:"a",href:v,target:"_blank",rel:"noopener noreferrer",sx:{verticalAlign:"middle",color:"inherit",fontSize:"14px","&:hover":{textDecoration:"underline"}},children:[v,e.jsx(m,{component:me,icon:Re,sx:{marginLeft:"6px",verticalAlign:"middle",lineHeight:1,scale:1.1}})]})}),e.jsx(C,{title:t("authentication.oauthCallbackUrl"),children:e.jsxs(m,{sx:{mb:1,verticalAlign:"middle",fontSize:"14px",wordBreak:"break-all"},children:[j,e.jsx(ke,{locale:d,content:j,style:{marginLeft:"6px",verticalAlign:"middle",scale:.8,lineHeight:1}})]})}),e.jsx(C,{title:t("authentication.auth0.domain"),children:e.jsx(A,{name:"domain",control:w,rules:{validate:D},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(q,{...a,size:"small",label:t("authentication.auth0.domain"),error:!!h.errors[a.name],helperText:h.errors[a.name]?.message||" "})})})}),e.jsx(C,{title:t("authentication.auth0.clientId"),children:e.jsx(A,{name:"clientId",control:w,rules:{validate:S},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(q,{...a,size:"small",label:t("authentication.auth0.clientId"),error:!!h.errors[a.name],helperText:h.errors[a.name]?.message||" "})})})}),e.jsx(C,{title:t("authentication.auth0.clientSecret"),children:e.jsx(A,{name:"clientSecret",control:w,rules:{validate:T},render:({field:a})=>e.jsx(V,{fullWidth:!0,children:e.jsx(q,{...a,size:"small",type:"password",label:t("authentication.auth0.clientSecret"),error:!!h.errors[a.name],helperText:h.errors[a.name]?.message||" "})})})})]})})}tt.propTypes={ref:u.any,onSuccess:u.func,sortMaps:u.object};const Ce={clientId:"",clientSecret:""};function nt({ref:r=null,onSuccess:s=B,sortMaps:l={}}){const{api:i}=K(),{blocklet:n}=J(),{t,locale:d}=$(),c=n?.meta?.did,f=Object.assign({...Ce},n?.settings?.authentication?.github||{}),p=(n.environments||[]).find(j=>j.key==="BLOCKLET_APP_URL")?.value||window.location.origin,{handleSubmit:y,control:w,formState:h,reset:b}=ie({defaultValues:re(f,Object.keys(Ce))}),x=g(async j=>{try{const{blocklet:a}=await i.configAuthentication({input:{did:c,authentication:JSON.stringify({...l,github:{...j,order:l.github?.order??Object.keys(l).length,enabled:!0,type:"oauth"}})}}),o=Object.assign({...Ce},a?.settings?.authentication?.github||{});b(o),P.success(t("common.saveSuccess")),s()}catch(a){P.error(a.message||t("common.saveFailed"))}}),D=g(j=>j?.trim()?!0:t("authentication.github.clientIdDescription")),S=g(j=>j?.trim()?!0:t("authentication.github.clientSecretDescription")),T=se(()=>d==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-github":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-github",[d]),v=ge(p,ne.WELLKNOWN_SERVICE_PATH_PREFIX,"oauth/callback/github");return L.useImperativeHandle(r,()=>({submit:y(x)}),[y,x]),e.jsx(m,{children:e.jsxs("form",{disabled:!0,children:[e.jsx(C,{title:t("authentication.viewDocument"),children:e.jsxs(m,{component:"a",href:T,target:"_blank",rel:"noopener noreferrer",sx:{verticalAlign:"middle",color:"inherit",fontSize:"14px","&:hover":{textDecoration:"underline"}},children:[T,e.jsx(m,{component:me,icon:Re,sx:{marginLeft:"6px",verticalAlign:"middle",lineHeight:1,scale:1.1}})]})}),e.jsx(C,{title:t("authentication.oauthCallbackUrl"),children:e.jsxs(m,{sx:{mb:1,verticalAlign:"middle",fontSize:"14px",wordBreak:"break-all"},children:[v,e.jsx(ke,{locale:d,content:v,style:{marginLeft:"6px",verticalAlign:"middle",scale:.8,lineHeight:1}})]})}),e.jsx(C,{title:t("authentication.github.clientId"),children:e.jsx(A,{name:"clientId",control:w,rules:{validate:D},render:({field:j})=>e.jsx(V,{fullWidth:!0,children:e.jsx(q,{...j,size:"small",label:t("authentication.github.clientId"),error:!!h.errors[j.name],helperText:h.errors[j.name]?.message||" "})})})}),e.jsx(C,{title:t("authentication.github.clientSecret"),children:e.jsx(A,{name:"clientSecret",control:w,rules:{validate:S},render:({field:j})=>e.jsx(V,{fullWidth:!0,children:e.jsx(q,{...j,size:"small",type:"password",label:t("authentication.github.clientSecret"),error:!!h.errors[j.name],helperText:h.errors[j.name]?.message||" "})})})})]})})}nt.propTypes={ref:u.any,onSuccess:u.func,sortMaps:u.object};const De={showQrcode:!0};function it({ref:r=null,onSuccess:s=B,sortMaps:l={}}){const{api:i}=K(),{blocklet:n}=J(),{t}=$(),d=n?.meta?.did,c=Object.assign({...De},n?.settings?.authentication?.wallet||{}),{handleSubmit:f,control:p,reset:y}=ie({defaultValues:re(c,Object.keys(De))}),w=g(async h=>{try{const{blocklet:b}=await i.configAuthentication({input:{did:d,authentication:JSON.stringify({...l,wallet:{...h,order:l.wallet?.order??Object.keys(l).length,enabled:!0,type:"builtin"}})}}),x=Object.assign({...De},b?.settings?.authentication?.wallet||{});y(x),P.success(t("common.saveSuccess")),s()}catch(b){P.error(b.message||t("common.saveFailed"))}});return L.useImperativeHandle(r,()=>({submit:f(w)}),[f,w]),e.jsx(m,{children:e.jsx("form",{children:e.jsx(C,{title:t("authentication.wallet.showQrcode"),children:e.jsx(A,{name:"showQrcode",control:p,render:({field:h})=>e.jsx(Q,{control:e.jsx(Qt,{sx:{ml:1},checked:h.value,...h})})})})})})}it.propTypes={ref:u.any,onSuccess:u.func,sortMaps:u.object};function ot({ref:r=null,onSuccess:s=B,sortMaps:l={}}){const{api:i}=K(),{blocklet:n}=J(),{t}=$(),d=n?.meta?.did,c=g(async()=>{try{await i.configAuthentication({input:{did:d,authentication:JSON.stringify({...l,email:{order:l.email?.order??Object.keys(l).length,enabled:!0,type:"builtin"}})}}),P.success(t("common.saveSuccess")),s()}catch(f){P.error(f.message||t("common.saveFailed"))}});return L.useImperativeHandle(r,()=>({submit:c}),[c]),e.jsxs(m,{children:[t("authentication.emailLoginDescription"),e.jsx("br",{}),t("authentication.emailNotificationRequired"),e.jsx("br",{}),e.jsx(m,{component:Et,to:ge(ne.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/notification/settings"),sx:{mt:1,display:"inline-block"},children:e.jsx(X,{size:"small",variant:"outlined",children:t("authentication.gotoEmailNotification")})})]})}ot.propTypes={ref:u.any,onSuccess:u.func,sortMaps:u.object};function at({ref:r=null,onSuccess:s=B,sortMaps:l={}}){const{api:i}=K(),{blocklet:n}=J(),{t}=$(),d=n?.meta?.did,c=g(async()=>{try{await i.configAuthentication({input:{did:d,authentication:JSON.stringify({...l,passkey:{order:l.passkey?.order??Object.keys(l).length,enabled:!0,type:"builtin"}})}}),P.success(t("common.saveSuccess")),s()}catch(f){P.error(f.message||t("common.saveFailed"))}});return L.useImperativeHandle(r,()=>({submit:c}),[c]),null}at.propTypes={ref:u.any,onSuccess:u.func,sortMaps:u.object};const Te={clientId:"",clientSecret:""};function st({ref:r=null,onSuccess:s=B,sortMaps:l={}}){const{api:i}=K(),{blocklet:n}=J(),{t,locale:d}=$(),c=n?.meta?.did,f=Object.assign({...Te},n?.settings?.authentication?.google||{}),p=(n.environments||[]).find(j=>j.key==="BLOCKLET_APP_URL")?.value||window.location.origin,{handleSubmit:y,control:w,formState:h,reset:b}=ie({defaultValues:re(f,Object.keys(Te))}),x=g(async j=>{try{const{blocklet:a}=await i.configAuthentication({input:{did:c,authentication:JSON.stringify({...l,google:{...j,order:l.google?.order??Object.keys(l).length,enabled:!0,type:"oauth"}})}}),o=Object.assign({...Te},a?.settings?.authentication?.google||{});b(o),P.success(t("common.saveSuccess")),s()}catch(a){P.error(a.message||t("common.saveFailed"))}}),D=g(j=>j?.trim()?!0:t("authentication.google.clientIdDescription")),S=g(j=>j?.trim()?!0:t("authentication.google.clientSecretDescription")),T=se(()=>d==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-google":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-google",[d]),v=ge(p,ne.WELLKNOWN_SERVICE_PATH_PREFIX,"oauth/callback/google");return L.useImperativeHandle(r,()=>({submit:y(x)}),[y,x]),e.jsx(m,{children:e.jsxs("form",{onSubmit:y(x),disabled:!0,children:[e.jsx(C,{title:t("authentication.viewDocument"),children:e.jsxs(m,{component:"a",href:T,target:"_blank",rel:"noopener noreferrer",sx:{verticalAlign:"middle",color:"inherit",fontSize:"14px","&:hover":{textDecoration:"underline"}},children:[T,e.jsx(m,{component:me,icon:Re,sx:{marginLeft:"6px",verticalAlign:"middle",lineHeight:1,scale:1.1}})]})}),e.jsx(C,{title:t("authentication.oauthCallbackUrl"),children:e.jsxs(m,{sx:{mb:1,verticalAlign:"middle",fontSize:"14px",wordBreak:"break-all"},children:[v,e.jsx(ke,{locale:d,content:v,style:{marginLeft:"6px",verticalAlign:"middle",scale:.8,lineHeight:1}})]})}),e.jsx(C,{title:t("authentication.google.clientId"),children:e.jsx(A,{name:"clientId",control:w,rules:{validate:D},render:({field:j})=>e.jsx(V,{fullWidth:!0,children:e.jsx(q,{...j,size:"small",label:t("authentication.google.clientId"),error:!!h.errors[j.name],helperText:h.errors[j.name]?.message||" "})})})}),e.jsx(C,{title:t("authentication.google.clientSecret"),children:e.jsx(A,{name:"clientSecret",control:w,rules:{validate:S},render:({field:j})=>e.jsx(V,{fullWidth:!0,children:e.jsx(q,{...j,size:"small",type:"password",label:t("authentication.google.clientSecret"),error:!!h.errors[j.name],helperText:h.errors[j.name]?.message||" "})})})})]})})}st.propTypes={ref:u.any,onSuccess:u.func,sortMaps:u.object};const Ae={teamId:"",serviceId:"",keyId:"",authKey:"",bundleId:""};function rt({ref:r=null,onSuccess:s=B,sortMaps:l={}}){const{api:i}=K(),{blocklet:n}=J(),{t,locale:d}=$(),c=n?.meta?.did,f=Object.assign({...Ae},n?.settings?.authentication?.apple||{}),p=(n.environments||[]).find(o=>o.key==="BLOCKLET_APP_URL")?.value||window.location.origin,{handleSubmit:y,control:w,formState:h,reset:b}=ie({defaultValues:re(f,Object.keys(Ae))}),x=g(async o=>{try{const{blocklet:I}=await i.configAuthentication({input:{did:c,authentication:JSON.stringify({...l,apple:{...o,order:l.apple?.order??Object.keys(l).length,enabled:!0,type:"oauth"}})}}),W=Object.assign({...Ae},I?.settings?.authentication?.apple||{});b(W),P.success(t("common.saveSuccess")),s()}catch(I){P.error(I.message||t("common.saveFailed"))}}),D=g(o=>o?.trim()?!0:t("authentication.apple.teamIdDescription")),S=g(o=>o?.trim()?!0:t("authentication.apple.serviceIdDescription")),T=g(o=>o?.trim()?!0:t("authentication.apple.keyIdDescription")),v=g(o=>o?.trim()?!0:t("authentication.apple.authKeyDescription")),j=g(o=>o?.trim()?!0:t("authentication.apple.bundleIdDescription")),a=ge(p,ne.WELLKNOWN_SERVICE_PATH_PREFIX,"oauth/callback/apple");return L.useImperativeHandle(r,()=>({submit:y(x)}),[y,x]),e.jsx(m,{children:e.jsxs("form",{children:[e.jsx(C,{title:t("authentication.oauthCallbackUrl"),children:e.jsxs(m,{sx:{mb:1,verticalAlign:"middle",fontSize:"14px",wordBreak:"break-all"},children:[a,e.jsx(ke,{locale:d,content:a,style:{marginLeft:"6px",verticalAlign:"middle",scale:.8,lineHeight:1}})]})}),e.jsx(C,{title:t("authentication.apple.teamId"),children:e.jsx(A,{name:"teamId",control:w,rules:{validate:D},render:({field:o})=>e.jsx(V,{fullWidth:!0,children:e.jsx(q,{...o,size:"small",label:t("authentication.apple.teamId"),error:!!h.errors[o.name],helperText:h.errors[o.name]?.message||" "})})})}),e.jsx(C,{title:t("authentication.apple.bundleId"),children:e.jsx(A,{name:"bundleId",control:w,rules:{validate:j},render:({field:o})=>e.jsx(V,{fullWidth:!0,children:e.jsx(q,{...o,size:"small",label:t("authentication.apple.bundleId"),error:!!h.errors[o.name],helperText:h.errors[o.name]?.message||" "})})})}),e.jsx(C,{title:t("authentication.apple.serviceId"),children:e.jsx(A,{name:"serviceId",control:w,rules:{validate:S},render:({field:o})=>e.jsx(V,{fullWidth:!0,children:e.jsx(q,{...o,size:"small",label:t("authentication.apple.serviceId"),error:!!h.errors[o.name],helperText:h.errors[o.name]?.message||" "})})})}),e.jsx(C,{title:t("authentication.apple.keyId"),children:e.jsx(A,{name:"keyId",control:w,rules:{validate:T},render:({field:o})=>e.jsx(V,{fullWidth:!0,children:e.jsx(q,{...o,size:"small",label:t("authentication.apple.keyId"),error:!!h.errors[o.name],helperText:h.errors[o.name]?.message||" "})})})}),e.jsx(C,{title:t("authentication.apple.authKey"),children:e.jsx(A,{name:"authKey",control:w,rules:{validate:v},render:({field:o})=>e.jsx(V,{fullWidth:!0,children:e.jsx(q,{...o,size:"small",type:"password",label:t("authentication.apple.authKey"),multiline:!0,rows:4,error:!!h.errors[o.name],helperText:h.errors[o.name]?.message||" ",slotProps:{input:{sx:{WebkitTextSecurity:"disc",fontFamily:"text-security-disc, monospace"}}}})})})})]})})}rt.propTypes={ref:u.any,onSuccess:u.func,sortMaps:u.object};const Pe={clientId:"",clientSecret:""};function lt({ref:r=null,onSuccess:s=B,sortMaps:l={}}){const{api:i}=K(),{blocklet:n}=J(),{t,locale:d}=$(),c=n?.meta?.did,f=Object.assign({...Pe},n?.settings?.authentication?.twitter||{}),p=(n.environments||[]).find(v=>v.key==="BLOCKLET_APP_URL")?.value||window.location.origin,{handleSubmit:y,control:w,formState:h,reset:b}=ie({defaultValues:re(f,Object.keys(Pe))}),x=g(async v=>{try{const{blocklet:j}=await i.configAuthentication({input:{did:c,authentication:JSON.stringify({...l,twitter:{...v,order:l.twitter?.order??Object.keys(l).length,enabled:!0,type:"oauth"}})}}),a=Object.assign({...Pe},j?.settings?.authentication?.twitter||{});b(a),P.success(t("common.saveSuccess")),s()}catch(j){P.error(j.message||t("common.saveFailed"))}}),D=g(v=>v?.trim()?!0:t("authentication.twitter.clientIdDescription")),S=g(v=>v?.trim()?!0:t("authentication.twitter.clientSecretDescription")),T=ge(p,ne.WELLKNOWN_SERVICE_PATH_PREFIX,"oauth/callback/twitter");return L.useImperativeHandle(r,()=>({submit:y(x)}),[y,x]),e.jsx(m,{children:e.jsxs("form",{onSubmit:y(x),disabled:!0,children:[e.jsx(C,{title:t("authentication.oauthCallbackUrl"),children:e.jsxs(m,{sx:{mb:1,verticalAlign:"middle",fontSize:"14px",wordBreak:"break-all"},children:[T,e.jsx(ke,{locale:d,content:T,style:{marginLeft:"6px",verticalAlign:"middle",scale:.8,lineHeight:1}})]})}),e.jsx(C,{title:t("authentication.twitter.clientId"),children:e.jsx(A,{name:"clientId",control:w,rules:{validate:D},render:({field:v})=>e.jsx(V,{fullWidth:!0,children:e.jsx(q,{...v,size:"small",label:t("authentication.twitter.clientId"),error:!!h.errors[v.name],helperText:h.errors[v.name]?.message||" "})})})}),e.jsx(C,{title:t("authentication.twitter.clientSecret"),children:e.jsx(A,{name:"clientSecret",control:w,rules:{validate:S},render:({field:v})=>e.jsx(V,{fullWidth:!0,children:e.jsx(q,{...v,size:"small",type:"password",label:t("authentication.twitter.clientSecret"),error:!!h.errors[v.name],helperText:h.errors[v.name]?.message||" "})})})})]})})}lt.propTypes={ref:u.any,onSuccess:u.func,sortMaps:u.object};const ln={width:24,height:24,body:'<path fill="currentColor" d="M9 20q-.825 0-1.413-.588T7 18q0-.825.588-1.413T9 16q.825 0 1.413.588T11 18q0 .825-.588 1.413T9 20Zm6 0q-.825 0-1.413-.588T13 18q0-.825.588-1.413T15 16q.825 0 1.413.588T17 18q0 .825-.588 1.413T15 20Zm-6-6q-.825 0-1.413-.588T7 12q0-.825.588-1.413T9 10q.825 0 1.413.588T11 12q0 .825-.588 1.413T9 14Zm6 0q-.825 0-1.413-.588T13 12q0-.825.588-1.413T15 10q.825 0 1.413.588T17 12q0 .825-.588 1.413T15 14ZM9 8q-.825 0-1.413-.588T7 6q0-.825.588-1.413T9 4q.825 0 1.413.588T11 6q0 .825-.588 1.413T9 8Zm6 0q-.825 0-1.413-.588T13 6q0-.825.588-1.413T15 4q.825 0 1.413.588T17 6q0 .825-.588 1.413T15 8Z"/>'};function ct({id:r,title:s,index:l,onBegin:i=B,onMove:n,onEnd:t,onEditItem:d=B,onDeleteItem:c=B,disableDelete:f=!1,icon:p=null}){const y=L.useRef(null),w=L.useRef(null),[{handlerId:h},b]=St({accept:"dragItem",collect(T){return{handlerId:T.getHandlerId()}},hover(T,v){if(!y.current)return;const j=T.index,a=l;if(j===a)return;const o=y.current?.getBoundingClientRect(),I=w.current?.getBoundingClientRect(),W=(I.bottom-I.top)/2,fe=v.getClientOffset().y-o.top;j<a&&fe<W||j>a&&fe>W||(n(j,a),T.index=a)}}),[{isDragging:x},D]=Lt({item:{index:l,type:"dragItem"},collect:T=>({isDragging:T.isDragging()}),begin:i,end:t});D(w),b(y);const S=x?.3:1;return e.jsx(m,{ref:y,children:e.jsxs(m,{sx:{cursor:"pointer","&:hover":{backgroundColor:"grey.100"}},ref:w,"data-handler-id":h,children:[e.jsxs(m,{sx:{py:2,px:1,opacity:S,display:"flex",alignItems:"center",gap:.5},draggable:!1,children:[e.jsx(m,{sx:{pointerEvents:"auto",cursor:"grab","&:active":{cursor:"grabbing"},fontSize:0,color:"text.hint","&:hover":{color:"text.secondary"}},children:e.jsx(me,{fontSize:20,icon:ln})}),e.jsx(m,{sx:{display:"flex",alignItems:"center",flexShrink:0,mr:.5,transform:"translateY(-1px)"},children:p}),e.jsx(te,{sx:{flex:1},children:s}),e.jsx(pe,{size:"small",color:"primary",onClick:()=>{d(r)},children:e.jsx(me,{icon:en})}),e.jsx(pe,{size:"small",color:"error",onClick:()=>{c(r)},disabled:f,children:e.jsx(me,{icon:tn})})]}),e.jsx(he,{})]})})}ct.propTypes={title:u.string.isRequired,id:u.string.isRequired,index:u.number.isRequired,onBegin:u.func,onMove:u.func.isRequired,onEnd:u.func.isRequired,onEditItem:u.func,onDeleteItem:u.func,disableDelete:u.bool,icon:u.any};function dt({ref:r=null,providers:s=[],sortMaps:l={}}){const i=L.useRef(null),{t:n}=L.useContext(le),t=Le(),{control:d,watch:c,setValue:f,reset:p}=ie({mode:"onChange",defaultValues:{provider:""}}),y=c("provider"),w=s.find(a=>a.name===y),h=At(w),b=t?.transitions?.duration?.leavingScreen||300,x=be({initMode:"add",mode:"add",show:!1,callback:B,get dialogTitle(){return this.mode==="edit"?n("authentication.updateLoginProvider",{provider:h.current?.title}):n("authentication.addLoginProvider")}}),D=g(()=>{p(),x.mode="add",x.initMode="add"}),S=g(()=>{x.show=!1,setTimeout(()=>{D()},b)}),T=g((a,o=null)=>{if(x.show=!0,o)x.initMode="edit",x.mode="edit",f("provider",o.provider);else{const I=s.find(W=>W.enabled===!1)?.name||s[0]?.name||N.WALLET;f("provider",I)}a?x.callback=a:x.callback=B});L.useImperativeHandle(r,()=>({open:T,close:S}),[T,S]);const v=g(()=>{i.current.submit()}),j=s.map(a=>({value:a.name,title:a.title,description:a.enabled?n("common.enabled"):""}));return L.useEffect(()=>{w?.enabled?x.mode="edit":x.mode="add"},[w?.enabled]),e.jsxs(we,{open:x.show,title:x.dialogTitle,onClose:S,fullWidth:!0,maxWidth:"sm",PaperProps:{style:{minHeight:"unset"}},actions:e.jsx(M,{color:"primary",autoFocus:!0,variant:"contained",onClick:v,disabled:!y,children:x.mode==="add"?n("common.confirm"):n("common.update")}),children:[x.initMode==="edit"?null:e.jsx(A,{name:"provider",control:d,render:({field:a})=>e.jsx(nn,{required:!0,fullWidth:!0,margin:"dense",size:"small",label:n("authentication.chooseProvider"),placeholder:n("authentication.chooseProviderPlaceholder"),options:j,...Ze(a,"ref"),slotProps:{optionItem:{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%"}}}})}),e.jsx(m,{sx:{mt:2,".section":{mb:1,gap:4},".section-left":{width:150}},children:w?.component&&e.jsx(w.component,{ref:i,onSuccess:S,sortMaps:l})})]})}dt.propTypes={ref:u.any,providers:u.array,sortMaps:u.object};function cn(){const{confirmApi:r,confirmHolder:s}=Qe(),l=L.useRef(),{t:i}=$(),{api:n}=K(),{blocklet:t}=J(),d=t?.meta?.did,c=t?.settings?.authentication||{},f=[{name:N.WALLET,title:Y[N.WALLET],icon:e.jsx(ae,{provider:"wallet",sx:{width:20,height:20,scale:.9}}),component:it},{name:N.EMAIL,title:Y[N.EMAIL],icon:e.jsx(ae,{provider:"email",sx:{width:20,height:20,scale:.9}}),component:ot},{name:N.PASSKEY,title:Y[N.PASSKEY],icon:e.jsx(ae,{provider:"passkey",sx:{width:20,height:20,scale:.9}}),component:at},{name:N.GOOGLE,title:Y[N.GOOGLE],icon:e.jsx(ae,{provider:"google",sx:{width:20,height:20}}),component:st},{name:N.APPLE,title:Y[N.APPLE],icon:e.jsx(ae,{provider:"apple",sx:{width:20,height:20}}),component:rt},{name:N.GITHUB,title:Y[N.GITHUB],icon:e.jsx(ae,{provider:"github",sx:{width:20,height:20}}),component:nt},{name:N.TWITTER,title:Y[N.TWITTER],icon:e.jsx(ae,{provider:"twitter",sx:{width:20,height:20}}),component:lt},{name:N.AUTH0,title:Y[N.AUTH0],icon:e.jsx(ae,{provider:"auth0",sx:{width:20,height:20}}),component:tt,hidden:!0}].map(a=>({...a,enabled:c[a.name]?.enabled??!1,order:c[a.name]?.order??null})),p=f.filter(a=>a.enabled),y=p.sort((a,o)=>!je(a?.order)&&!je(o?.order)?a.order-o.order:je(a?.order)?1:-1),w=y.reduce((a,o,I)=>Object.assign(a,{[o.name]:{order:I}}),{}),h=be(y.reduce((a,o,I)=>Object.assign(a,{[o.name]:I}),{})),b=[...p].sort((a,o)=>h[a.name]-h[o.name]),x={};typeof window<"u"&&(x.context=window);const D=g((a,o)=>{const I=b[a],W=b[o];h[I.name]=o,h[W.name]=a}),S=g(async()=>{const a=Object.keys(h).reduce((o,I)=>(o[I]={order:h[I]},o),{});await n.configAuthentication({input:{did:d,authentication:JSON.stringify(a)}})}),T=()=>{l.current.open(()=>{l.current.close()})},v=g(a=>{l.current.open(B,{provider:a})}),j=g(a=>{r.open({title:i("authentication.deleteLoginProvider",{provider:Y[a]}),content:i("authentication.deleteLoginProviderDescription",{provider:Y[a]}),confirmButtonText:i("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:i("common.cancel"),async onConfirm(o){try{await n.configAuthentication({input:{did:d,authentication:JSON.stringify({[a]:{enabled:!1,order:null}})}}),delete h[a],P.success(i("common.deleteSuccess")),o()}catch(I){P.error(I.message||i("common.deleteFailed"))}}})});return e.jsxs(m,{children:[e.jsx(M,{variant:"contained",onClick:T,sx:{mb:1},children:i("authentication.addLoginProvider")}),e.jsx(It,{backend:Ct,...x,children:b.map((a,o)=>e.jsx(ct,{index:o,id:a.name,title:a.title,icon:a.icon,onMove:D,onEnd:S,onEditItem:v,onDeleteItem:j,disableDelete:y.length<=1,children:a.component},a.name))}),e.jsx(dt,{ref:l,providers:f,sortMaps:w}),s]})}const ue={ttl:ne.SESSION_TTL,cacheTtl:ne.SESSION_CACHE_TTL,email:{enabled:!1,requireVerified:!1,requireUnique:!1,trustOauthProviders:!1,trustedIssuers:[],enableDomainBlackList:!1,domainBlackList:[],enableDomainWhiteList:!1,domainWhiteList:[]},phone:{enabled:!1,requireVerified:!1,requireUnique:!1,regionBlackList:[],trustedIssuers:[]},enableBlacklist:!1};function Z(r){return e.jsx(et,{...r,sx:{transform:"scale(0.75)"}})}function Ee(r,s=!1){const l=s?r.ttl*86400:r.ttl/86400;return{...r,ttl:l}}function dn(){const{api:r}=K(),{blocklet:s}=J(),l=s?.meta?.did,i=Xe({},ue,s?.settings?.session||{});je(i.ttl)&&(i.ttl=ue.ttl),je(i.cacheTtl)&&(i.cacheTtl=ue.cacheTtl),i.phone||(i.phone=ue.phone),i.email||(i.email=ue.email),je(i.enableBlacklist)&&(i.enableBlacklist=ue.enableBlacklist);const{handleSubmit:n,control:t,formState:d,reset:c,watch:f}=ie({defaultValues:re(Ee(i),["ttl","cacheTtl","email","phone","enableBlacklist"])}),{t:p}=$(),y=f("email.enabled"),w=f("phone.enabled"),h=f("email.enableDomainBlackList"),b=f("email.enableDomainWhiteList"),{fields:x,append:D,remove:S}=Ve({control:t,name:"email.domainBlackList"}),{fields:T,append:v,remove:j}=Ve({control:t,name:"email.domainWhiteList"}),a=g(async o=>{try{const{blocklet:I}=await r.updateAppSessionConfig({input:{did:l,config:Ze(Ee(o,!0),["phone"])}}),W=Object.assign({},ue,re(I?.settings?.session||{},["ttl","cacheTtl","email","phone","enableBlacklist"]));c(Ee(W)),P.success(p("common.configSuccess"))}catch(I){P.error(I.message)}});return e.jsx(un,{onSubmit:n(a),children:e.jsxs(_,{direction:"column",sx:{gap:6},children:[e.jsxs(m,{children:[e.jsxs(m,{children:[e.jsx(te,{variant:"h6",sx:{fontWeight:600},children:p("blocklet.config.session.profile")}),e.jsx(m,{component:he,sx:{my:3}})]}),e.jsxs(_,{sx:{gap:2},children:[e.jsx(C,{title:p("blocklet.config.session.fullNameEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(Z,{disabled:!0,checked:!0})})}),e.jsx(C,{title:p("blocklet.config.session.avatarEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(Z,{disabled:!0,checked:!0})})}),e.jsx(C,{title:p("blocklet.config.session.emailEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(A,{name:"email.enabled",control:t,render:({field:o})=>e.jsx(Z,{...o,checked:o.value})})})}),y&&e.jsxs(_,{direction:"column",sx:{ml:2,gap:.5},children:[e.jsx(C,{title:p("blocklet.config.session.emailRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(A,{name:"email.requireVerified",control:t,render:({field:o})=>e.jsx(Q,{sx:{ml:0},control:e.jsx(Z,{...o,checked:o.value})})})})}),e.jsx(C,{title:p("blocklet.config.session.emailRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(A,{name:"email.requireUnique",control:t,render:({field:o})=>e.jsx(Q,{sx:{ml:0},control:e.jsx(Z,{...o,checked:o.value})})})})}),e.jsx(C,{title:p("blocklet.config.session.emailTrustOauthProviders"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(A,{name:"email.trustOauthProviders",control:t,render:({field:o})=>e.jsx(Q,{sx:{ml:0},control:e.jsx(Z,{...o,checked:o.value})})})})}),e.jsx(C,{title:p("blocklet.config.session.enableDomainBlackList"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(A,{name:"email.enableDomainBlackList",control:t,render:({field:o})=>e.jsx(Q,{sx:{ml:0},control:e.jsx(Z,{...o,checked:o.value})})})})}),h&&e.jsxs(m,{children:[x.map((o,I)=>e.jsxs(_,{direction:"row",sx:{alignItems:"center",my:1,maxWidth:"720px"},children:[e.jsx(A,{name:`email.domainBlackList.${I}`,control:t,render:W=>e.jsx(q,{...W.field,size:"small",fullWidth:!0})}),e.jsx(pe,{onClick:()=>S(I),children:e.jsx(_e,{})})]},o.id)),e.jsx(X,{startIcon:e.jsx(qe,{}),onClick:()=>D(""),children:p("blocklet.config.session.addDomain")})]}),e.jsx(C,{title:p("blocklet.config.session.enableDomainWhiteList"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(A,{name:"email.enableDomainWhiteList",control:t,render:({field:o})=>e.jsx(Q,{sx:{ml:0},control:e.jsx(Z,{...o,checked:o.value})})})})}),b&&e.jsxs(m,{children:[T.map((o,I)=>e.jsxs(_,{direction:"row",sx:{alignItems:"center",my:1,maxWidth:"720px"},children:[e.jsx(A,{name:`email.domainWhiteList.${I}`,control:t,render:W=>e.jsx(q,{...W.field,size:"small",fullWidth:!0})}),e.jsx(pe,{onClick:()=>j(I),children:e.jsx(_e,{})})]},o.id)),e.jsx(X,{startIcon:e.jsx(qe,{}),onClick:()=>v(""),children:p("blocklet.config.session.addDomain")})]})]}),e.jsxs(m,{sx:{display:"none"},children:[e.jsx(C,{title:p("blocklet.config.session.phoneEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(A,{name:"phone.enabled",control:t,disabled:!0,render:({field:o})=>e.jsx(Q,{sx:{ml:0},control:e.jsx(Z,{...o,checked:o.value})})})})}),w&&e.jsxs(_,{direction:"column",sx:{ml:2,mt:1},children:[e.jsx(C,{title:p("blocklet.config.session.phoneRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(A,{name:"phone.requireVerified",control:t,render:({field:o})=>e.jsx(Q,{sx:{ml:0},control:e.jsx(Z,{...o,checked:o.value})})})})}),e.jsx(C,{title:p("blocklet.config.session.phoneRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(A,{name:"phone.requireUnique",control:t,render:({field:o})=>e.jsx(Q,{sx:{ml:0},control:e.jsx(Z,{...o,checked:o.value})})})})})]})]})]})]}),e.jsxs(m,{children:[e.jsx(te,{variant:"h6",sx:{fontWeight:600},children:p("blocklet.config.session.period")}),e.jsx(m,{component:he,sx:{my:3}}),e.jsx(_,{direction:"column",spacing:2,children:e.jsx(A,{name:"ttl",control:t,rules:{min:1,max:30},render:({field:o})=>e.jsx(V,{fullWidth:!0,sx:{mb:2},children:e.jsx(C,{title:p("blocklet.config.session.ttl",{day:o.value}),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{width:"100%",maxWidth:500,px:2},children:e.jsx(Ot,{...o,defaultValue:7,step:1,marks:[{value:1,label:p("blocklet.config.session.day",{day:1})},{value:7,label:p("blocklet.config.session.days",{day:7})},{value:14,label:p("blocklet.config.session.days",{day:14})},{value:21,label:p("blocklet.config.session.days",{day:21})},{value:30,label:p("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto"})})})})})})]}),e.jsxs(m,{children:[e.jsx(te,{variant:"h6",sx:{fontWeight:600},children:p("blocklet.config.session.experimentalSettings")}),e.jsx(m,{component:he,sx:{my:3}}),e.jsx(_,{direction:"column",spacing:2,children:e.jsx(C,{title:p("blocklet.config.session.enableBlacklist"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(A,{name:"enableBlacklist",control:t,render:({field:o})=>e.jsx(Q,{sx:{ml:0},control:e.jsx(Z,{...o,checked:o.value})})})})})})]}),e.jsx(m,{children:e.jsx(X,{type:"submit",variant:"contained",disabled:!d.isDirty,children:p("common.save")})})]})})}const un=$e.form`
|
|
2
|
+
max-width: 1536px;
|
|
3
|
+
|
|
4
|
+
.advanced-config {
|
|
5
|
+
border: 0;
|
|
6
|
+
padding: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.config-form {
|
|
10
|
+
flex-grow: 1;
|
|
11
|
+
overflow-y: auto;
|
|
12
|
+
will-change: transform;
|
|
13
|
+
|
|
14
|
+
&:first-child {
|
|
15
|
+
margin: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
${r=>r.theme.breakpoints.down("md")} {
|
|
19
|
+
width: 100%;
|
|
20
|
+
flex-shrink: 0;
|
|
21
|
+
padding: 0 24px;
|
|
22
|
+
transform: translate(0, 0);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.config-item {
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: space-between;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.config-desc {
|
|
33
|
+
font-weight: normal;
|
|
34
|
+
font-size: 12px;
|
|
35
|
+
color: #666;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.form-item {
|
|
39
|
+
margin-top: 0;
|
|
40
|
+
}
|
|
41
|
+
`,mn={width:24,height:24,body:'<path fill="currentColor" d="M6 12.05q0 1.125.425 2.188T7.75 16.2l.25.25V15q0-.425.288-.713T9 14q.425 0 .713.288T10 15v4q0 .425-.288.713T9 20H5q-.425 0-.713-.288T4 19q0-.425.288-.713T5 18h1.75l-.4-.35q-1.3-1.15-1.825-2.625T4 12.05Q4 9.7 5.2 7.787T8.425 4.85q.35-.2.738-.025t.512.575q.125.375-.013.75t-.487.575q-1.45.8-2.313 2.213T6 12.05Zm12-.1q0-1.125-.425-2.187T16.25 7.8L16 7.55V9q0 .425-.288.713T15 10q-.425 0-.713-.288T14 9V5q0-.425.288-.713T15 4h4q.425 0 .713.288T20 5q0 .425-.288.713T19 6h-1.75l.4.35q1.225 1.225 1.788 2.663T20 11.95q0 2.35-1.2 4.263t-3.225 2.937q-.35.2-.737.025t-.513-.575q-.125-.375.013-.75t.487-.575q1.45-.8 2.313-2.212T18 11.95Z"/>'};var Oe,He;function hn(){if(He)return Oe;He=1;const{DEFAULT_IP_DOMAIN_SUFFIX:r,SLOT_FOR_IP_DNS_SITE:s,DEFAULT_DID_DOMAIN:l}=Xt(),{encode:i}=an();return Oe={getIpDnsDomainForBlocklet:d=>`${i(d.meta.did)}-${s}.${r}`,getDidDomainForBlocklet:({did:d,didDomain:c=l})=>`${i(d)}.${c}`},Oe}var pn=hn();function ut({ref:r=null}){const{t:s}=L.useContext(le),{blocklet:l}=J(),{api:i}=K(),n=be({loadingReject:!1,loadingApprove:!1,mode:"view",show:!1,data:{},callback:B}),d=Le()?.transitions?.duration?.leavingScreen||300,c=g(()=>{n.mode="view",n.data={},n.callback=B}),f=g(()=>{n.show=!1,setTimeout(()=>{c()},d)}),p=g(D=>{n.mode="view",n.show=!0,n.data=D}),y=g((D,S=B)=>{n.mode="approve",n.show=!0,n.data=D,n.callback=S});L.useImperativeHandle(r,()=>({open:p,close:f,approve:y}),[p,f,y]);const w=se(()=>{if(!n.show)return[];n.data.migratedFrom=[n.data.appId,n.data.appPid];const D=["appName","appLogo","appId","appPid","migratedFrom","appDescription","appUrl","version","appliedAt","status","serverId","serverVersion"];return n.data.isMaster!==!1&&Zt(D,"appliedAt","status"),D.map(S=>{const T=s(`federated.info.${S}`);let v=n.data[S];if(S==="appName"&&n.data.isMaster&&(v=e.jsxs(m,{children:[e.jsx(Je,{component:Ke}),v]})),["appId","appPid","serverId"].includes(S)&&(v=e.jsx(Fe,{children:v})),["appUrl"].includes(S)&&(v=e.jsx(m,{component:"a",href:v,target:"_blank",children:v})),["appLogo"].includes(S)){const j=ge(`https://${pn.getDidDomainForBlocklet({did:n.data.appPid})}`,ne.WELLKNOWN_SERVICE_PATH_PREFIX,"/blocklet/logo");try{const a=new URL(j);a.searchParams.set("imageFilter","resize"),a.searchParams.set("w","80"),a.searchParams.set("h","80"),v=e.jsx("img",{src:a.href,width:"60",height:"60",alt:n.data.appName})}catch{v=e.jsx("img",{src:j,width:"60",height:"60",alt:n.data.appName})}}return S==="status"&&(v=v&&s(`federated.status.${v}`)),S==="migratedFrom"&&(v=(n.data.migratedFrom||[]).filter(o=>![n.data.appId,n.data.appPid].includes(o)).map(o=>e.jsx(Fe,{children:o}))),Ye(v)&&(v="-"),{name:T,value:v}})},[n.data]),h=n.mode==="approve",b=g(async()=>{try{n.loadingReject=!0,await i.auditFederatedLogin({input:{memberPid:n.data.appPid,did:l.appPid,status:"rejected"}}),f(),n?.callback(!1)}finally{n.loadingReject=!1}}),x=g(async()=>{try{n.loadingApprove=!0,await i.auditFederatedLogin({input:{memberPid:n.data.appPid,did:l.appPid,status:"approved"}}),f(),n?.callback(!0)}finally{n.loadingApprove=!1}});return e.jsx(we,{open:n.show,title:s(h?"federated.approveToJoinLogin":"federated.siteDetail"),onClose:f,actions:h?e.jsxs(e.Fragment,{children:[e.jsxs(X,{color:"error",variant:"contained",onClick:b,disabled:n.loadingReject,children:[n.loadingReject?e.jsx(Be,{size:16,color:"grey"}):null,s("common.reject")]}),e.jsxs(X,{variant:"contained",onClick:x,disabled:n.loadingApprove,children:[n.loadingApprove?e.jsx(Be,{size:16,color:"grey"}):null,s("common.approve")]})]}):e.jsx(X,{variant:"outlined",onClick:f,children:s("common.close")}),children:w.map(D=>e.jsx(on,{style:{alignItems:"flex-start"},valueComponent:"div",nameWidth:180,name:D.name,children:D.value},D.name))})}ut.propTypes={ref:u.any};function ze({ref:r=null}){const l=Le()?.transitions?.duration?.leavingScreen||300,{t:i}=L.useContext(le),n=be({show:!1,data:{link:""}}),t=g(()=>{n.data.link=""}),d=g(()=>{n.show=!1,setTimeout(()=>{t()},l)}),c=g(({link:p})=>{n.show=!0,n.data.link=p});L.useImperativeHandle(r,()=>({open:c,close:d}),[c,d]);const f=g(()=>{Pt(n.data.link),d()});return e.jsxs(we,{open:n.show,title:i("federated.joinFederatedLogin"),onClose:d,PaperProps:{style:{minHeight:"unset"}},actions:e.jsx(M,{color:"primary",autoFocus:!0,variant:"contained",onClick:f,children:i("common.copyAndClose")}),children:[e.jsx(m,{sx:{mb:2},children:i("federated.inviteJoinFederatedLoginDescription")}),e.jsx(m,{sx:{"& .copy-button":{display:"none !important"}},children:e.jsx(sn,{children:n.data.link})})]})}ze.propTypes={ref:u.any};function mt({mode:r="member"}){const s=L.useRef(null),l=L.useRef(null),{t:i,locale:n}=L.useContext(le),{blocklet:t,actions:{refreshBlocklet:d}}=J(),{confirmApi:c,confirmHolder:f}=Qe(),{api:p}=K(),y=t.settings.federated?.sites||[],w=t.settings.federated?.config||{},h=w.isMaster!==!1,b=y.find(E=>E.appPid===t.appPid),x=be({loadingSync:!1}),D=g(E=>{l.current?.open(E)}),S=g(E=>{l.current?.approve(E,d)}),T=g(E=>{c.open({title:i("federated.removeFederatedLogin"),content:i("federated.removeFederatedLoginDescription"),confirmButtonText:i("common.confirm"),cancelButtonText:i("common.cancel"),confirmButtonProps:{color:"error"},async onConfirm(R){await p.quitFederatedLogin({input:{did:t.appPid,targetDid:E.appPid}}),R()}})}),v=g(E=>{c.open({title:i("federated.disableFederatedLogin"),content:i("federated.disableFederatedLoginDescription"),confirmButtonText:i("common.confirm"),cancelButtonText:i("common.cancel"),confirmButtonProps:{color:"error"},async onConfirm(R){await p.auditFederatedLogin({input:{memberPid:E.appPid,did:t.appPid,status:"revoked"}}),R()}})}),j=g(E=>{c.open({title:i("federated.enableFederatedLogin"),content:i("federated.enableFederatedLoginDescription"),confirmButtonText:i("common.confirm"),cancelButtonText:i("common.cancel"),async onConfirm(R){await p.auditFederatedLogin({input:{memberPid:E.appPid,did:t.appPid,status:"approved"}}),R()}})}),a=se(()=>{const E=[{label:i("common.name"),name:"appName",options:{customBodyRenderLite:R=>{const O=y[R],ce=O.isMaster!==!1;return e.jsx(m,{sx:{display:"inline-block"},children:e.jsxs(m,{component:"a",href:O.appUrl,target:"_blank",onClick:H=>{H.stopPropagation()},sx:{display:"flex",alignItems:"center"},children:[ce&&e.jsx(Je,{component:Ke,style:{marginRight:"4px"}}),O.appName]})})}}},{label:i("common.did"),name:"appId",options:{customBodyRenderLite:R=>{const O=y[R];return e.jsx(Fe,{children:O.appId})}}},{label:i("common.status"),name:"status",options:{customBodyRenderLite:R=>{const O=y[R],ce=O.isMaster!==!1;return e.jsx(m,{children:ce?"-":i(`federated.status.${O.status}`)})}}}];return h&&E.push({label:i("common.actions"),name:"actions",options:{customBodyRenderLite:R=>{const O=y[R],ce=O.isMaster!==!1;return e.jsx(m,{sx:{display:"flex",gap:1},children:ce?e.jsxs(e.Fragment,{children:[O.status==="rejected"&&e.jsx(M,{variant:"contained",color:"error",size:"small",onClick:H=>{H.stopPropagation()},children:i("federated.status.rejected")}),O.status==="revoked"&&e.jsx(M,{variant:"contained",color:"secondary",size:"small",onClick:H=>{H.stopPropagation()},children:i("federated.status.revoked")})]}):e.jsxs(e.Fragment,{children:[e.jsx(M,{variant:"contained",color:"error",size:"small",onClick:H=>{H.stopPropagation(),T(O)},children:i("federated.quitMember")},"quiteSite"),O.status==="pending"&&e.jsx(M,{variant:"contained",color:"primary",size:"small",onClick:H=>{H.stopPropagation(),S(O)},children:i("federated.status.pending")},"auditSite"),O.status==="approved"&&e.jsx(M,{variant:"contained",color:"error",size:"small",onClick:H=>{H.stopPropagation(),v(O)},style:{whiteSpace:"nowrap"},children:i("federated.revoke")},"revokeSite"),O.status==="revoked"&&e.jsx(M,{variant:"contained",color:"warning",size:"small",onClick:H=>{H.stopPropagation(),j(O)},style:{whiteSpace:"nowrap"},children:i("federated.approve")},"approveSite")]})})}}}),E},[w.appId,y,h,i]),o=se(()=>({sort:!0,download:!1,filter:!1,print:!1,expandableRowsOnClick:!0,onRowClick(E,{dataIndex:R}){const O=y[R];D(O)}}),[]),I=g(()=>{const E=t.environments.find(R=>R.key===We.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_URL);E?.value?s.current?.open({link:E.value}):P.error(i("federated.failedToGetFederatedLoginLink"))},[t.site?.domainAliases?.[0]?.href]),W=g(()=>{c.open({title:i("federated.quitFederatedLogin"),content:i("federated.quitFederatedLoginDescription"),confirmButtonText:i("common.confirm"),cancelButtonText:i("common.cancel"),confirmButtonProps:{color:"error"},async onConfirm(E){await p.quitFederatedLogin({input:{did:t.appPid}}),E()}})}),ve=g(()=>{c.open({title:i("federated.disbandFederatedLogin"),content:i("federated.disbandFederatedLoginDescription"),confirmButtonText:i("common.confirm"),cancelButtonText:i("common.cancel"),confirmButtonProps:{color:"error"},async onConfirm(E){await p.disbandFederatedLogin({input:{did:t.appPid}}),E()}})}),fe=g(async()=>{try{x.loadingSync=!0,await Promise.all([await p.syncFederatedConfig({input:{did:t.appPid}}),Dt(500)]),P.success(i("common.succeeded"))}finally{x.loadingSync=!1}}),oe=[];return b.status!=="pending"&&oe.push(e.jsx(Ft,{title:i("federated.syncConfig"),children:e.jsx(pe,{size:"small",onClick:fe,disabled:x.loadingSync,sx:[{"@keyframes spin":{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}}},x.loadingSync?{animation:"spin 1s linear infinite"}:{}],children:e.jsx(me,{icon:mn,style:{fontSize:24}})},"syncConfig")})),r==="master"?(oe.push(e.jsx(M,{size:"small",variant:"contained",onClick:I,sx:{ml:1},children:i("federated.inviteJoinFederatedLogin")},"inviteJoinFederatedLogin")),oe.push(e.jsx(M,{color:"error",size:"small",variant:"contained",onClick:ve,sx:{ml:1},children:i("federated.disbandFederatedLogin")},"disbandFederatedLogin"))):oe.push(e.jsx(M,{size:"small",variant:"contained",color:"error",onClick:W,sx:{ml:1},children:i("federated.quitFederatedLogin")},"quitFederatedLogin")),e.jsxs(e.Fragment,{children:[e.jsx(Tt,{className:"main-table",locale:n,data:y,columns:a,customButtons:oe,title:e.jsx(m,{className:"table-toolbar-left",children:i("authentication.federated")}),options:o}),f,e.jsx(ze,{ref:s}),e.jsx(ut,{ref:l})]})}mt.propTypes={mode:u.oneOf(["member","master"])};function ht({ref:r=null}){const{t:s}=L.useContext(le),{api:l}=K(),{blocklet:i}=J(),n=i?.appPid,d=Le()?.transitions?.duration?.leavingScreen||300,c=be({loading:!1,show:!1,appUrl:"",appUrlError:"",callback:B}),f=g(()=>{c.appUrl="",c.appUrlError="",c.callback=B}),p=g(()=>{c.show=!1,setTimeout(()=>{f()},d)}),y=g((b=B)=>{c.show=!0,c.callback=b});L.useImperativeHandle(r,()=>({open:y,close:p}),[y,p]);const w=g(b=>{if(!b)throw new Error(s("federated.federatedJoinAppUrlRequired"));if(!Yt(b))throw new Error(s("federated.federatedJoinAppUrlInvalid"))}),h=g(async()=>{try{w(c.appUrl),c.loading=!0;const b=await l.joinFederatedLogin({input:{did:n,appUrl:c.appUrl}});c.show=!1,p(),c?.callback(b)}catch(b){c.appUrlError=b.message}finally{c.loading=!1}});return e.jsxs(we,{open:c.show,title:s("federated.joinFederatedLogin"),onClose:p,PaperProps:{style:{minHeight:"unset"}},actions:e.jsxs(M,{color:"primary",autoFocus:!0,variant:"contained",onClick:h,disabled:c.loading,children:[c.loading?e.jsx(Be,{size:16,sx:{mr:1},color:"grey"}):null,s("common.confirm")]}),children:[e.jsx(m,{sx:{mb:1},children:s("federated.joinFederatedLoginDescription")}),e.jsx(q,{fullWidth:!0,variant:"outlined",margin:"dense",placeholder:s("federated.federatedJoinAppUrl"),label:s("federated.federatedJoinAppUrl"),value:c.appUrl,error:!!c.appUrlError,helperText:c.appUrlError||"eg: https://www.arcblock.io",onChange:b=>{c.appUrl=b.target.value}})]})}ht.propTypes={ref:u.any};function gn(){const{t:r}=L.useContext(le);return e.jsxs(_,{direction:"row",spacing:2,sx:{alignItems:"flex-start",p:2},children:[e.jsx(qt,{fontSize:"large",color:"primary"}),e.jsxs(m,{children:[e.jsx(te,{variant:"h6",gutterBottom:!0,children:r("federated.title")}),e.jsx(te,{variant:"body2",sx:{color:"text.secondary"},children:r("federated.description")}),e.jsx(Bt,{href:"https://www.arcblock.io/blog/zh/did-connect-federated-login-support",underline:"hover",variant:"body2",color:"primary",target:"_blank",sx:{display:"inline-flex",alignItems:"center",mt:1},children:r("federated.link")})]})]})}function fn(){const r=L.useRef(null),s=L.useRef(null),{t:l}=L.useContext(le),{blocklet:i,actions:{refreshBlocklet:n}}=J(),t=g(()=>{const c=i.site?.domainAliases?.[0]?.href;if(c)try{const f=new URL(c);r.current?.open({link:f.origin})}catch{P.error(l("federated.failedToGetFederatedLoginLink"))}},[i.site?.domainAliases?.[0]?.href]),d=g(()=>{s.current?.open(()=>{n()})});if(i.settings.federated?.sites.length>0){const c=i.settings.federated?.config.isMaster!==!1;return e.jsx(mt,{mode:c?"master":"member"})}return e.jsxs(e.Fragment,{children:[e.jsx(m,{sx:{display:"flex",flexDirection:"column",gap:2,justifyContent:"center",alignItems:"center",minHeight:"200px"},children:e.jsxs(m,{sx:{maxWidth:400,borderRadius:2,border:"1px solid",borderColor:"divider"},children:[e.jsx(gn,{}),e.jsx(he,{sx:{width:1}}),e.jsxs(_,{sx:{width:1,p:2,gap:1.5},children:[e.jsx(M,{variant:"contained",onClick:t,sx:{width:1},children:l("federated.inviteJoinFederatedLogin")}),e.jsx(M,{variant:"outlined",onClick:d,sx:{width:1},children:l("federated.joinFederatedLogin")})]})]})}),e.jsx(ze,{ref:r}),e.jsx(ht,{ref:s})]})}const Ue={login:{en:{title:"Login",scan:"Login with one of the following methods",confirm:"Confirm connection in your DID Wallet",success:"Successfully logged in"},zh:{title:"登录",scan:"请使用下面的方式完成登录",confirm:"在 DID Wallet 中确认连接",success:"登录成功"}},"switch-profile":{en:{title:"Switch Profile",scan:"Use DID Wallet to switch profile",confirm:"Select profile in your DID Wallet",success:"Profile updated"},zh:{title:"切换个人信息",scan:"请使用 DID Wallet 来切换个人信息",confirm:"在 DID Wallet 中选择个人信息",success:"个人信息已经更新"}},"switch-passport":{en:{title:"Switch Passport",scan:"Use DID Wallet to switch passport",confirm:"Select passport in your DID Wallet",success:"Passport and session updated"},zh:{title:"切换通行证",scan:"请使用 DID Wallet 来切换通行证",confirm:"在 DID Wallet 中选择通行证",success:"通行证和会话已经更新"}}},xn={en:{title:"",scan:"",confirm:"",success:""},zh:{title:"",scan:"",confirm:"",success:""}},xe="new-action",pt=Object.keys(Ue),gt=["zh","en"],ft=r=>/^[a-z][a-z-]*$/.test(r),jn=r=>{const s=[];return r.includes("zh")&&s.push("zh"),r.includes("en")&&s.push("en"),r.filter(l=>!gt.includes(l)).forEach(l=>s.push(l)),s},xt=r=>{const s=We.baseLanguages.find(l=>l.code===r);return s?s.name:r};function jt({value:r="",onChange:s=()=>{},onBlur:l=()=>{},onKeyDown:i=()=>{},isDuplicate:n=!1}){const{t}=$(),d=r&&!ft(r);let c="";return d?c=t("authentication.didConnect.actionNameError"):n&&(c=t("authentication.didConnect.actionNameDuplicate")),e.jsx(q,{value:r,onChange:s,onBlur:l,onKeyDown:i,onClick:f=>f.stopPropagation(),size:"small",variant:"standard",autoFocus:!0,placeholder:"action-name",helperText:c,error:d||n,sx:{"& .MuiInputBase-input":{py:0,fontSize:14,fontWeight:500}}})}jt.propTypes={value:u.string,onChange:u.func,onBlur:u.func,onKeyDown:u.func,isDuplicate:u.bool};function bt({langCode:r,isSelected:s=!1,canDelete:l=!1,onSelect:i=()=>{},onDelete:n=()=>{}}){return e.jsx(Ge,{label:xt(r),onClick:i,onDelete:l?n:void 0,size:"small",sx:{bgcolor:s?"primary.main":"grey.100",color:s?"primary.contrastText":"text.primary","&:hover":{bgcolor:s?"primary.dark":"grey.200"},"& .MuiChip-deleteIcon":{color:s?"primary.contrastText":"text.secondary","&:hover":{color:s?"primary.contrastText":"error.main"}}}})}bt.propTypes={langCode:u.string.isRequired,isSelected:u.bool,canDelete:u.bool,onSelect:u.func,onDelete:u.func};function vt({actionKey:r,actionData:s={},expanded:l=!1,selectedLang:i="",editing:n={},onChange:t={}}){const{t:d}=$(),c=!pt.includes(r),f=jn(Object.keys(s)),p=s[i]||{},y=n?.actionKey===r,w=n?.name&&n.name!==r&&n.allActions?.[n.name];return e.jsxs(Rt,{expanded:l,onChange:(h,b)=>t.accordion(b),elevation:0,sx:{border:"1px solid",borderColor:"grey.200",borderRadius:"8px !important","&:before":{display:"none"},"&.Mui-expanded":{margin:0}},children:[e.jsxs(Wt,{expandIcon:e.jsx(Nt,{}),sx:{minHeight:48,"& .MuiAccordionSummary-content":{alignItems:"center",gap:1}},children:[y?e.jsx(jt,{value:n.name,onChange:t.editingName,onBlur:t.finishEditing,onKeyDown:t.editingKeyDown,isDuplicate:w}):e.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:.5,"&:hover .edit-icon":{opacity:1}},children:[e.jsx(te,{sx:{fontWeight:500},children:r}),c&&e.jsx(pe,{className:"edit-icon",size:"small",onClick:t.startEditing,sx:{p:.25,opacity:0,transition:"opacity 0.2s",color:"text.secondary","&:hover":{color:"primary.main",bgcolor:"transparent"}},children:e.jsx(zt,{sx:{fontSize:16}})})]}),c&&e.jsx(pe,{size:"small",onClick:t.delete,sx:{ml:"auto",mr:1,p:.5,color:"error.main","&:hover":{bgcolor:"error.lighter"}},children:e.jsx(Ut,{sx:{fontSize:20}})})]}),e.jsxs(_t,{sx:{pt:0},children:[e.jsxs(m,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:1,mb:2},children:[e.jsx(te,{variant:"body2",color:"text.secondary",sx:{flexShrink:0},children:"Languages:"}),f.map(h=>e.jsx(bt,{langCode:h,isSelected:i===h,canDelete:!gt.includes(h),onSelect:()=>t.language(h),onDelete:b=>t.deleteLanguage(h,b)},h)),e.jsx(Ge,{label:`${d("common.add")}`,onClick:t.addLanguage,size:"small",variant:"outlined",icon:e.jsx(qe,{sx:{fontSize:16}}),sx:{borderStyle:"dashed","&:hover":{bgcolor:"action.hover"}}})]}),e.jsxs(_,{spacing:2,children:[e.jsx(q,{label:"Title",value:p.title||"",onChange:h=>t.field("title",h.target.value),fullWidth:!0,size:"small"}),e.jsx(q,{label:"Scan",value:p.scan||"",onChange:h=>t.field("scan",h.target.value),fullWidth:!0,size:"small",multiline:!0,minRows:2})]})]})]})}vt.propTypes={actionKey:u.string.isRequired,actionData:u.object,expanded:u.bool,selectedLang:u.string,editing:u.shape({actionKey:u.string,name:u.string,allActions:u.object}),onChange:u.shape({accordion:u.func,language:u.func,field:u.func,startEditing:u.func,editingName:u.func,finishEditing:u.func,editingKeyDown:u.func,delete:u.func,addLanguage:u.func,deleteLanguage:u.func})};function yt({open:r,onClose:s,existingLanguages:l,selectedLanguage:i,onLanguageChange:n,onAdd:t}){const{t:d}=$(),c=We.baseLanguages.filter(f=>!l.includes(f.code));return e.jsxs(Vt,{open:r,onClose:s,maxWidth:"xs",fullWidth:!0,children:[e.jsx(Ht,{children:d("authentication.didConnect.addLanguage")}),e.jsx(Mt,{children:e.jsx(V,{fullWidth:!0,sx:{mt:1},children:e.jsx($t,{value:i,onChange:f=>n(f.target.value),displayEmpty:!0,size:"small",renderValue:f=>f?xt(f):e.jsx(te,{color:"text.secondary",children:d("authentication.didConnect.selectLanguage")}),children:c.map(f=>e.jsx(Jt,{value:f.code,children:f.name},f.code))})})}),e.jsxs(Kt,{children:[e.jsx(X,{onClick:s,children:d("common.cancel")}),e.jsx(X,{onClick:t,variant:"contained",disabled:!i,children:d("common.add")})]})]})}yt.propTypes={open:u.bool.isRequired,onClose:u.func.isRequired,existingLanguages:u.array.isRequired,selectedLanguage:u.string.isRequired,onLanguageChange:u.func.isRequired,onAdd:u.func.isRequired};function kt({open:r=!1,onClose:s=()=>{},onSave:l=()=>{},initialConfig:i=null}){const{t:n,locale:t}=$(),[d,c]=L.useState({}),[f,p]=L.useState("login"),[y,w]=L.useState({}),[h,b]=L.useState(!1),[x,D]=L.useState(""),[S,T]=L.useState(""),[v,j]=L.useState(null),[a,o]=L.useState(""),I=t||"en";L.useEffect(()=>{if(!r)return;const k=i||Ue;c(k);const F=Object.keys(k);p(F[0]||"login");const z={};F.forEach(G=>{const U=Object.keys(k[G]||{});z[G]=U.includes(I)?I:U[0]||"en"}),w(z),j(null)},[r,i,I]);const W=g(k=>k?Object.values(k).every(F=>!F?.title?.trim()&&!F?.scan?.trim()):!0),ve=g(()=>!Object.keys(d).some(F=>!pt.includes(F)&&W(d[F]))&&!d[xe]);g(()=>{ve()&&(c(k=>({...k,[xe]:xn})),p(xe),w(k=>({...k,[xe]:I})),j(xe),o(xe))});const fe=g(k=>{const{value:F}=k.target;(F===""||/^[a-z-]*$/.test(F))&&o(F)}),oe=g(()=>{const k=a.trim();if(!k||!ft(k)||k!==v&&d[k]){j(null);return}if(k!==v){const F={};Object.keys(d).forEach(z=>{F[z===v?k:z]=d[z]}),c(F),f===v&&p(k),y[v]&&w(z=>{const G={...z,[k]:z[v]};return delete G[v],G})}j(null)}),E=g(k=>{k.key==="Enter"?oe():k.key==="Escape"&&j(null)}),R=g((k,F)=>{F.stopPropagation();const z={...d};delete z[k],c(z),f===k&&p(Object.keys(z)[0]||!1)}),O=g(()=>{!S||!x||(c(k=>({...k,[x]:{...k[x],[S]:{title:"",scan:"",confirm:"",success:""}}})),w(k=>({...k,[x]:S})),b(!1))}),ce=g((k,F,z)=>{z.stopPropagation();const G=d[k];if(Object.keys(G||{}).length<=1)return;const ee={...G};delete ee[F],c(de=>({...de,[k]:ee})),y[k]===F&&w(de=>({...de,[k]:Object.keys(ee)[0]||"en"}))}),H=g(()=>{l(JSON.stringify(d)),s()});ve();const wt=e.jsxs(e.Fragment,{children:[e.jsx(X,{onClick:s,variant:"outlined",children:n("common.cancel")}),e.jsx(X,{onClick:H,variant:"contained",startIcon:e.jsx(Gt,{}),children:n("common.confirm")})]});return e.jsxs(we,{open:r,onClose:s,maxWidth:"md",fullWidth:!0,title:n("authentication.didConnect.configDialogTitle"),actions:wt,children:[e.jsxs(_,{spacing:1.5,children:[Object.keys(d).map(k=>{const F=d[k]||{},z=Object.keys(F),G=y[k]||z[0]||"en";return e.jsx(vt,{actionKey:k,actionData:F,expanded:f===k,selectedLang:G,editing:{actionKey:v,name:a,allActions:d},onChange:{accordion:U=>p(U?k:!1),language:U=>w(ee=>({...ee,[k]:U})),field:(U,ee)=>c(de=>({...de,[k]:{...de[k],[G]:{...de[k]?.[G],[U]:ee}}})),startEditing:U=>{U.stopPropagation(),j(k),o(k)},editingName:fe,finishEditing:oe,editingKeyDown:E,delete:U=>R(k,U),addLanguage:U=>{U.stopPropagation(),D(k),T(""),b(!0)},deleteLanguage:(U,ee)=>ce(k,U,ee)}},k)}),!1]}),e.jsx(yt,{open:h,onClose:()=>b(!1),existingLanguages:Object.keys(d[x]||{}),selectedLanguage:S,onLanguageChange:T,onAdd:O})]})}kt.propTypes={open:u.bool,onClose:u.func,onSave:u.func,initialConfig:u.object};const Se={showDidColor:!0,showAppInfo:!0};function Me(r){return e.jsx(et,{...r,sx:{transform:"scale(0.75)"}})}function bn(){const{api:r}=K(),{blocklet:s}=J(),l=s?.meta?.did,{control:i,reset:n}=ie({defaultValues:Xe({},Se,s?.settings?.didConnect||{})}),t=se(()=>{const b=s?.settings?.actionConfig;return b&&!Ye(b)?b:Ue},[s?.settings?.actionConfig]),{t:d}=$(),[c,f]=L.useState(!1),p=g(async(b,x)=>{try{const D={showDidColor:i._defaultValues?.showDidColor??Se.showDidColor,showAppInfo:i._defaultValues?.showAppInfo??Se.showAppInfo};D[b]=x;const{blocklet:S}=await r.configDidConnect({input:{did:l,didConnect:JSON.stringify(D)}}),T=Object.assign({},Se,S?.settings?.didConnect||{});n(T),P.success(d("common.configSuccess"))}catch(D){P.error(D.message),n(i._defaultValues)}}),y=g(()=>{f(!1)}),w=g(()=>{f(!0)}),h=g(async b=>{try{await r.configDidConnectActions({input:{did:l,actionConfig:b}}),P.success(d("common.configSuccess"))}catch(x){console.error(x),P.error(x.message)}});return e.jsxs(vn,{children:[e.jsxs(_,{direction:"column",sx:{gap:4},children:[e.jsxs(m,{children:[e.jsx(m,{children:d("authentication.didConnect.basicSettings")}),e.jsx(he,{sx:{my:2}}),e.jsxs(_,{sx:{gap:2},children:[e.jsx(C,{title:d("authentication.didConnect.showDidColor"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(A,{name:"showDidColor",control:i,render:({field:b})=>e.jsx(Me,{...b,checked:b.value,onChange:x=>{p("showDidColor",x.target.checked),b.onChange(x)}})})})}),e.jsx(C,{title:d("authentication.didConnect.showAppInfo"),sectionLeftSx:{width:"600px"},children:e.jsx(m,{sx:{alignSelf:"flex-start"},children:e.jsx(A,{name:"showAppInfo",control:i,render:({field:b})=>e.jsx(Me,{...b,checked:b.value,onChange:x=>{p("showAppInfo",x.target.checked),b.onChange(x)}})})})})]})]}),e.jsxs(m,{children:[e.jsx(m,{children:d("authentication.didConnect.customSettings")}),e.jsx(he,{sx:{my:2}}),e.jsx(_,{direction:"row",sx:{gap:2},children:e.jsx(X,{variant:"outlined",onClick:w,children:d("authentication.didConnect.configDialogTitle")})})]})]}),e.jsx(kt,{open:c,onClose:y,onSave:h,initialConfig:t})]})}const vn=$e.div`
|
|
42
|
+
max-width: 1536px;
|
|
43
|
+
|
|
44
|
+
.advanced-config {
|
|
45
|
+
border: 0;
|
|
46
|
+
padding: 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.config-form {
|
|
50
|
+
flex-grow: 1;
|
|
51
|
+
overflow-y: auto;
|
|
52
|
+
will-change: transform;
|
|
53
|
+
|
|
54
|
+
&:first-child {
|
|
55
|
+
margin: 0;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
${r=>r.theme.breakpoints.down("md")} {
|
|
59
|
+
width: 100%;
|
|
60
|
+
flex-shrink: 0;
|
|
61
|
+
padding: 0 24px;
|
|
62
|
+
transform: translate(0, 0);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.config-item {
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
justify-content: space-between;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.config-desc {
|
|
73
|
+
font-weight: normal;
|
|
74
|
+
font-size: 12px;
|
|
75
|
+
color: #666;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.form-item {
|
|
79
|
+
margin-top: 0;
|
|
80
|
+
}
|
|
81
|
+
`;function ye({label:r}){return e.jsx(m,{sx:{textAlign:"center",width:"100%"},children:r})}ye.propTypes={label:u.any.isRequired};function yn({orientation:r="horizontal"}){const{t:s}=L.useContext(le),l=rn({key:"lg"}),i=[{label:e.jsx(ye,{label:s("authentication.didConnectSettings")}),value:"didConnect"},{label:e.jsx(ye,{label:s("authentication.loginProviders")}),value:"loginProviders"},{label:e.jsx(ye,{label:s("authentication.federated")}),value:"federated"},{label:e.jsx(ye,{label:s("authentication.sessionSettings")}),value:"session"}],[n,t]=L.useState(i[0].value),d=se(()=>({didConnect:e.jsx(bn,{}),loginProviders:e.jsx(cn,{}),federated:e.jsx(fn,{}),session:e.jsx(dn,{})}),[s]);return r==="vertical"?e.jsx(m,{sx:{".MuiTab-root":{textAlign:"left",alignItems:"flex-start",fontWeight:"normal",div:{textAlign:"left"}},".Mui-selected":{fontWeight:"bold"}},children:e.jsxs(_,{direction:{md:"column",lg:"row"},sx:{gap:2},children:[e.jsx(m,{sx:{minWidth:"240px",flexShrink:0},children:e.jsx(Ne,{tabs:i,current:n,orientation:l?"horizontal":"vertical",onChange:t,sx:{borderRight:l?0:1,height:"100%",borderColor:"divider"}})}),e.jsx(m,{sx:{flexGrow:1,minWidth:0},children:e.jsx(m,{sx:{maxWidth:"1200px"},children:d[n]})})]})}):e.jsxs(m,{children:[e.jsx(Ne,{tabs:i,current:n,onChange:t}),e.jsx(m,{sx:{marginTop:"10px"},children:d[n]})]})}yn.propTypes={orientation:u.oneOf(["horizontal","vertical"])};export{yn as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i,bX as e,bn as a,W as s}from"./vendor-mui-core-
|
|
1
|
+
import{j as i,bX as e,bn as a,W as s}from"./vendor-mui-core-CKKG_1TN.js";import{l}from"./vendor-ux-DjXlxcvL.js";const r=l(t=>i.jsx(a,{focusVisibleClassName:".Mui-focusVisible",disableRipple:!0,...t}))(({theme:t})=>({width:42,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:2,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:t.palette.primary.main,opacity:1,border:0},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"&.Mui-focusVisible .MuiSwitch-thumb":{color:t.palette.primary.main,border:"6px solid #fff"},"&.Mui-disabled .MuiSwitch-thumb":{color:t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]},"&.Mui-disabled + .MuiSwitch-track":{opacity:t.palette.mode==="light"?.7:.3}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:22,height:22},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:t.palette.grey[200],opacity:1,transition:t.transitions.create(["background-color"],{duration:500})}}));function c({labelProps:t=null,...o}){return t?i.jsx(e,{control:i.jsx(r,{...o}),...t}):i.jsx(r,{...o})}c.propTypes={labelProps:s.object};export{c as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as r}from"./vendor-ux-DjXlxcvL.js";import{b8 as _,b9 as e}from"./index-BEfIUbZC.js";const m={en:_(e),ar:()=>r(()=>import("./ar-BHqjWgUQ.js"),[],import.meta.url).then(t=>_(t.default)),de:()=>r(()=>import("./de-QUGQFv2K.js"),[],import.meta.url).then(t=>_(t.default)),es:()=>r(()=>import("./es-C4w6cL07.js"),[],import.meta.url).then(t=>_(t.default)),fr:()=>r(()=>import("./fr-Bq3UipEu.js"),[],import.meta.url).then(t=>_(t.default)),hi:()=>r(()=>import("./hi-DGZy0DLh.js"),[],import.meta.url).then(t=>_(t.default)),id:()=>r(()=>import("./id-DOzDilAf.js"),[],import.meta.url).then(t=>_(t.default)),ja:()=>r(()=>import("./ja-DMq-YXDX.js"),[],import.meta.url).then(t=>_(t.default)),ko:()=>r(()=>import("./ko-BrYbXurh.js"),[],import.meta.url).then(t=>_(t.default)),pt:()=>r(()=>import("./pt-Dl6732JN.js"),[],import.meta.url).then(t=>_(t.default)),ru:()=>r(()=>import("./ru-CVUeN9AX.js"),[],import.meta.url).then(t=>_(t.default)),th:()=>r(()=>import("./th-32eBNQes.js"),[],import.meta.url).then(t=>_(t.default)),vi:()=>r(()=>import("./vi-DF8IinAc.js"),[],import.meta.url).then(t=>_(t.default)),"zh-TW":()=>r(()=>import("./zh-tw-34G9tsUP.js"),[],import.meta.url).then(t=>_(t.default)),zh:()=>r(()=>import("./zh-ByJkLAV1.js"),[],import.meta.url).then(t=>_(t.default))};export{m as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as u}from"./vendor-react-CTtPmzVP.js";import{W as o,j as e,ak as j,aN as L,z as A,at as K,cZ as B,I as P,a6 as W,by as M,aj as X,cH as H}from"./vendor-mui-core-
|
|
1
|
+
import{r as u}from"./vendor-react-CTtPmzVP.js";import{W as o,j as e,ak as j,aN as L,z as A,at as K,cZ as B,I as P,a6 as W,by as M,aj as X,cH as H}from"./vendor-mui-core-CKKG_1TN.js";import{C as G}from"./Google-JbLVL0lz.js";import{b9 as U}from"./vendor-ux-DjXlxcvL.js";import{c as Y}from"./create-passport-svg-DeDfPZeD.js";import{A as Z}from"./vendor-arcblock-BCP2x3BR.js";import{q as $}from"./index-BEfIUbZC.js";import{R as J}from"./required-DHjZE3-Y.js";import{F as Q}from"./form-wrapper-pwkkz4we.js";import{L as v}from"./logo-uploader-DEFzQY0j.js";import{A as ee,a as ne,b as te}from"./collapse-D72lnPa9.js";const S={description:o.string,editing:o.bool,onChange:o.func,required:o.bool,value:o.any,componentProps:o.object,render:o.func,renderFormItem:o.func};function T({editing:n,value:s,onChange:l}){const[i,c]=u.useState(!1),m=u.useRef(),f=u.useRef(s);u.useEffect(()=>{let a=null;return n&&(a=setTimeout(()=>{c(!0)},50)),()=>{clearTimeout(a)}},[n]);const h=a=>{f.current=a,l(a)},b=()=>{c(!1),l(f.current)},y=e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[s,s!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:s,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),p=e.jsxs(j,{onKeyDown:b,sx:{display:"flex",flexGrow:1,alignItems:"center",height:"40px"},children:[e.jsx(j,{onClick:()=>c(!0),sx:{display:"flex",alignItems:"center"},children:e.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:s,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:s==="auto"?"default":"pointer"}})}),e.jsx(L,{open:i,anchorEl:m.current,onClose:()=>c(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(G,{color:s,onChange:a=>h(a.hex)})})]});return n?p:y}T.propTypes=S;function D({editing:n,description:s,value:l,onChange:i,componentProps:c={},...m}){const{placeholder:f}=c,h=u.useRef(l),{t:b}=u.useContext(U),y=a=>{a.key==="Enter"&&i(h.current,"confirm")},p=a=>{h.current=a,i(a)};return n?e.jsx(A,{style:{flex:1},fullWidth:!0,value:l,onChange:a=>{a.persist(),p(a.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:s||f,onKeyDown:y,...m}):e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:l||e.jsx("span",{className:"placeholder",children:b("common.requiredInputPlaceholder",{name:s||f})})})}D.propTypes=S;function O({editing:n,value:s,onChange:l,componentProps:i,...c}){const{blocklet:m}=i,f=s==="auto"?Z(m.appDid):s;return e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Y({title:"Owner",issuer:$.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:s||"auto"})}}),e.jsx(T,{...c,editing:n,value:n?f:s,onChange:l,componentProps:i})]})}O.propTypes={...S,componentProps:o.shape({blocklet:o.object.isRequired}).isRequired};const re=H`
|
|
2
2
|
0%, 100% {
|
|
3
3
|
transform: scale(1) translateX(0);
|
|
4
4
|
}
|
|
@@ -8,4 +8,4 @@ import{r as u}from"./vendor-react-CTtPmzVP.js";import{W as o,j as e,ak as j,aN a
|
|
|
8
8
|
25%, 75% {
|
|
9
9
|
transform: scale(1.1) translateX(3px);
|
|
10
10
|
}
|
|
11
|
-
`,oe={input:D,color:T,passport:O,uploader:n=>e.jsx(v,{...n.componentProps})};function se(n,{editing:s=!1}){const{componentType:l="input",render:i,renderFormItem:c}=n;return s&&c?c:!s&&i?i:oe[l?.toLowerCase()]}V.propTypes={item:o.object.isRequired,findEditingItem:o.func.isRequired,getItemValue:o.func.isRequired,onFormItemChange:o.func.isRequired,onFocusOut:o.func.isRequired,disabled:o.bool,loading:o.bool,onCancel:o.func,formValues:o.object.isRequired};function V({item:n,findEditingItem:s,getItemValue:l,onFormItemChange:i,onFocusOut:c,disabled:m=!1,loading:f=!1,onCancel:h=()=>{},formValues:b}){const{key:y,description:p,required:a,solo:R=!1,hidden:g=!1,componentProps:C={},skipButtonDisabled:w=!1}=n;if(g)return null;const
|
|
11
|
+
`,oe={input:D,color:T,passport:O,uploader:n=>e.jsx(v,{...n.componentProps})};function se(n,{editing:s=!1}){const{componentType:l="input",render:i,renderFormItem:c}=n;return s&&c?c:!s&&i?i:oe[l?.toLowerCase()]}V.propTypes={item:o.object.isRequired,findEditingItem:o.func.isRequired,getItemValue:o.func.isRequired,onFormItemChange:o.func.isRequired,onFocusOut:o.func.isRequired,disabled:o.bool,loading:o.bool,onCancel:o.func,formValues:o.object.isRequired};function V({item:n,findEditingItem:s,getItemValue:l,onFormItemChange:i,onFocusOut:c,disabled:m=!1,loading:f=!1,onCancel:h=()=>{},formValues:b}){const{key:y,description:p,required:a,solo:R=!1,hidden:g=!1,componentProps:C={},skipButtonDisabled:w=!1}=n;if(g)return null;const q=s(y),{editing:I,shaking:E}=q??{},F=l(n,{editing:I}),r=se(n,{editing:I}),t={inputProps:{"data-cy":"schema-form-item-component"},key:y,description:p,editing:I,value:F,onChange:(x,d="change")=>i(n,x,d),componentProps:C,skipButtonDisabled:w,onBlur:()=>c(n)};return n.componentType==="collapse"&&n.children?.length>0?e.jsxs(ee,{children:[e.jsx(ne,{expandIcon:e.jsx(B,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:n.description}),e.jsx(te,{children:n.children.map(x=>e.jsx(V,{item:x,findEditingItem:s,getItemValue:l,onFormItemChange:i,onFocusOut:c,formValues:b,disabled:m,loading:f,onCancel:h},x.key))})]}):e.jsxs(j,{className:"form-item",children:[!R&&e.jsxs(j,{className:"form-item-label",sx:{color:a&&!F?"error.main":"text.secondary"},children:[p,a&&e.jsx(J,{})]}),e.jsxs(j,{className:"form-item-body",children:[e.jsx(j,{className:"form-item-input","data-cy":"schema-form-item-edit",sx:{textAlign:R?"center":"left"},style:{cursor:"text"},onClick:()=>{m||q?.edited||w||i(n,b[y],"edit")},children:e.jsx(r,{...t})}),!R&&e.jsx(j,{className:"form-item-action",style:{marginLeft:0},children:I?e.jsxs(e.Fragment,{children:[q.edited?e.jsx(P,{"data-cy":"schema-form-item-confirm",onClick:()=>{i(n,F,"confirm")},disabled:m||f,sx:{animation:E?`${re} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:f?e.jsx(W,{size:24}):e.jsx(M,{})}):null,e.jsx(P,{"data-cy":"schema-form-item-cancel",onClick:()=>h(n),style:{paddingLeft:q.edited?4:8},disabled:m||f,size:"large",children:e.jsx(X,{})})]}):null})]})]},y)}function ie({schema:n,loading:s=!1,value:l=void 0,defaultValue:i={},onChange:c,style:m={},disabled:f=!1}){const h=Object.prototype.toString.call(l)==="[object Object]",[b,y]=u.useState([]),[p,a]=u.useState(h?l:i),R=u.useMemo(()=>n.length===1,[n]),g=u.useCallback(r=>b.find(t=>t.key===r),[b]);u.useEffect(()=>{R&&n[0]?.required&&y([{key:n[0].key,editing:!0,initialValue:i[n[0].key]}])},[n,R,i]);const C=u.useCallback(r=>{y(t=>t.find(d=>d.key===r.key)?t.map(d=>d.key===r.key?r:{...d}):[r].concat(t))},[]),w=u.useCallback((r,t,x)=>{const{key:d,secure:_}=r,k=g(d)??{...r};k.editing=!0;const z=p[d]!==t;k.edited=t&&k.initialValue!==t,k.initialValue=i[d];const N={...p,[d]:t};z&&a(N),c({[d]:t},{allValues:N,action:x,currentItem:r}),x==="confirm"&&_&&a({...p,[d]:"__encrypted__"}),x==="confirm"&&(k.initialValue=p[d]),["confirm","cancel"].includes(x)&&(k.editing=!1,k.edited=!1),C(k)},[i,p,c,C,g]),q=u.useCallback((r,{editing:t=!1})=>{const{key:x}=r,d=h?l[x]:p[x];return d==="__encrypted__"?t?"":"******":d},[h,l,p]),I=u.useCallback(r=>{const t=g(r.key);t&&w(r,t.initialValue,"cancel")},[g,w]),E=u.useCallback(r=>{const t=g(r.key);!t||!t.edited||(t.shaking=!0,C(t),setTimeout(()=>{t.shaking=!1,C(t)},500))},[g,C]),F=u.useCallback(r=>{const t=g(r.key);!t||!t.edited?I(r):E(r)},[g,E,I]);return e.jsx(ae,{className:"form",style:m,children:n?.map(r=>{const{hidden:t=!1}=r;return t?null:e.jsx(V,{item:r,findEditingItem:g,getItemValue:q,onFormItemChange:w,onFocusOut:F,formValues:p,disabled:f,loading:s,onCancel:I})})})}ie.propTypes={schema:o.array.isRequired,loading:o.bool,onChange:o.func.isRequired,value:o.object,defaultValue:o.object,style:o.object,disabled:o.bool};const ae=K(Q)``;export{ie as S};
|