@abtnode/blocklet-services 1.17.8-beta-20260104-120132-cb5b1914 → 1.17.8-beta-20260106-113136-b3c09e14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AdapterDayjs-DyRP0A_7.js → AdapterDayjs-DafRMFLg.js} +1 -1
- package/dist/assets/Community-3AO97CCq.js +1 -0
- package/dist/assets/{Google-Bjq5o7qL.js → Google-DRu937I3.js} +1 -1
- package/dist/assets/Holiday-CqSw2e8m.js +1 -0
- package/dist/assets/Meeting-DKbNRI16.js +1 -0
- package/dist/assets/OffSick-BvEREz3_.js +1 -0
- package/dist/assets/WorkingRemotely-DNtYHcSB.js +1 -0
- package/dist/assets/{access-control-Cv1j0YWJ.js → access-control-cgo5Z15_.js} +1 -1
- package/dist/assets/{add-component-core-8nx00xJP.js → add-component-core-BfzNEcS5.js} +7 -7
- package/dist/assets/{add-resource-B3-VwSQg.js → add-resource-CYRgZ1ps.js} +1 -1
- package/dist/assets/addon-qN24wAb4.js +14 -0
- package/dist/assets/advanced-1Vu6rcXU.js +14 -0
- package/dist/assets/{aigne-Dehkd-7B.js → aigne-D6MrXXCU.js} +1 -1
- package/dist/assets/api-DwxIBXZs.js +1 -0
- package/dist/assets/{appearance-CkrEEbhp.js → appearance-DOQHBg9p.js} +1 -1
- package/dist/assets/arrow-down.svg-7ME6T1BL.js +1 -0
- package/dist/assets/{audit-logs-XPxQHo2y.js → audit-logs-ISyoqJFp.js} +2 -2
- package/dist/assets/{authorize-ByHCjaXS.js → authorize-B9RLEFal.js} +1 -1
- package/dist/assets/{base-chart-ChBZtUEG.js → base-chart-DhxjAyBU.js} +1 -1
- package/dist/assets/base32-_D4eWUeh.js +1 -0
- package/dist/assets/bind-account-CLIjYy96.js +1 -0
- package/dist/assets/{branding-CBzX3Xum.js → branding-C81Kt22j.js} +1 -1
- package/dist/assets/{branding-khY0G2TO.js → branding-iwUveEf5.js} +2 -2
- package/dist/assets/branding-myiZl37D.js +1 -0
- package/dist/assets/{bundle-avatar-Dtpi1uSw.js → bundle-avatar-Cc_6nw01.js} +1 -1
- package/dist/assets/button-D-lyR9BW.js +1 -0
- package/dist/assets/{click-to-copy-BEM1P78p.js → click-to-copy-CMo42VnK.js} +1 -1
- package/dist/assets/cloneDeep-BY8zW7hH.js +1 -0
- package/dist/assets/{complete-CuyAiV3B.js → complete-CJ_buCAS.js} +4 -4
- package/dist/assets/{component-nxxcEAFR.js → component-Dip3v1Iq.js} +3 -3
- package/dist/assets/config-44sI5I0w.js +53 -0
- package/dist/assets/{config-DOcJbRFr.js → config-D5KnWqfn.js} +1 -1
- package/dist/assets/{config-DweHAJPq.js → config-D8XZj8JI.js} +2 -2
- package/dist/assets/{config-navigation-BG6durqz.js → config-navigation-Ni0iczgA.js} +8 -8
- package/dist/assets/config-space-B6_f52sE.js +1 -0
- package/dist/assets/{confirm-BRnYfcDD.js → confirm-Lb1MrAdS.js} +1 -1
- package/dist/assets/connect-0OZVqJvc.js +1 -0
- package/dist/assets/connect-B9GQZEi7.js +5 -0
- package/dist/assets/connect-BV6BUhDJ.css +1 -0
- package/dist/assets/connect-JAX_oP3o.js +5 -0
- package/dist/assets/{connect-to-BEfFI4oa.js → connect-to-Djgj6TLg.js} +1 -1
- package/dist/assets/{create-passport-svg-BKhJ2ufW.js → create-passport-svg-5AYzBKFb.js} +1 -1
- package/dist/assets/createClass-DXYd7BIe.js +1 -0
- package/dist/assets/{dashboard-CDOqgUmx.js → dashboard-C0l2IWWH.js} +7 -7
- package/dist/assets/{delete-confirm-1vzcMsM2.js → delete-confirm-tbfLqDBI.js} +1 -1
- package/dist/assets/did-address-CsOJBoiY.js +1 -0
- package/dist/assets/{domain-D75xKDoP.js → domain-CnhOsdmM.js} +1 -1
- package/dist/assets/{domain-action-card-BgDPfYMr.js → domain-action-card-BsdHbhEi.js} +2 -2
- package/dist/assets/domains-DRP2VSvO.js +1 -0
- package/dist/assets/edit.svg-CTE5eATX.js +1 -0
- package/dist/assets/email-Dt_DGuhf.js +17 -0
- package/dist/assets/engine-BXGX_w-S.js +1 -0
- package/dist/assets/exchange-passport-DztKvBat.js +1 -0
- package/dist/assets/{form-BblKAylu.js → form-DoC8uBcB.js} +3 -3
- package/dist/assets/{form-text-input-C-JBHNfU.js → form-text-input-XjloVwBd.js} +2 -2
- package/dist/assets/{fuel-BPg61IpB.js → fuel-IaJHNPPW.js} +1 -1
- package/dist/assets/{gen-access-key-B-PvqBv6.js → gen-access-key-BJlDqEhI.js} +1 -1
- package/dist/assets/gen-simple-access-key-lyiUw0C-.js +1 -0
- package/dist/assets/get-safe-url-BiNPujaX.js +1 -0
- package/dist/assets/google-icon-vNOJy67F.js +1 -0
- package/dist/assets/{home-CT38dHBL.js → home-Bs_5YPbK.js} +1 -1
- package/dist/assets/{iframe-D119MMHU.js → iframe-Dqu4MSyW.js} +1 -1
- package/dist/assets/{index-BpWFE-ry.js → index-1HKgA-fz.js} +1 -1
- package/dist/assets/{index-CSCCjNba.js → index-B10SG1vs.js} +1 -1
- package/dist/assets/{index-sBtfsjBo.js → index-B4KKUWng.js} +2 -2
- package/dist/assets/{index-bCC4mzZc.js → index-B4YCnemd.js} +1 -1
- package/dist/assets/index-B6DWjLJS.js +281 -0
- package/dist/assets/{index-DSVwCr5p.js → index-B7_VUEoc.js} +2 -2
- package/dist/assets/index-B9LF8Bep.js +1 -0
- package/dist/assets/index-BDH_LtJL.js +1 -0
- package/dist/assets/{index-CGrk0HiP.js → index-BGhqVqit.js} +1 -1
- package/dist/assets/{index-DdojJXSn.js → index-BNhv-9xy.js} +3 -3
- package/dist/assets/{index-BNAs76qj.js → index-BSZtxRM0.js} +2 -2
- package/dist/assets/{index-BWCHnVga.js → index-BWDWEkUF.js} +1 -1
- package/dist/assets/{index-TzwTiNQ7.js → index-BWL6HE0j.js} +1 -1
- package/dist/assets/{index-E4Hos_Sx.js → index-B_SjLIbT.js} +7 -7
- package/dist/assets/{index-D1f4dwYF.js → index-BhhZ8IDZ.js} +13 -13
- package/dist/assets/{index-arhRQhsc.js → index-BkePHcyK.js} +9 -9
- package/dist/assets/{index-CfA9D2iF.js → index-BmXPp3DU.js} +1 -1
- package/dist/assets/{index-D1SIrheh.js → index-BsohFwTm.js} +1 -1
- package/dist/assets/index-CI_uwh_J.js +81 -0
- package/dist/assets/index-CQgzjKgB.js +1039 -0
- package/dist/assets/{index-8bzrOXqv.js → index-CRZM3CKo.js} +2 -2
- package/dist/assets/index-CbiyJRV7.js +1 -0
- package/dist/assets/{index-VaUGnCuU.js → index-Cp0b8q3A.js} +1 -1
- package/dist/assets/{index-BcIeEF3v.js → index-Cq6z7yeF.js} +4 -4
- package/dist/assets/index-DT5AXPVB.js +200 -0
- package/dist/assets/{index-DGbr3NAq.js → index-DctZHPFL.js} +1 -1
- package/dist/assets/{index-uODjznr3.js → index-Dfx19arA.js} +6 -6
- package/dist/assets/index-DhHvANH8.js +93 -0
- package/dist/assets/index-DrCTi6nm.css +1 -0
- package/dist/assets/{index-DoDx-vpV.js → index-G6Vk78zE.js} +3 -3
- package/dist/assets/{index-OTENuoZ0.js → index-TYwJnR0n.js} +23 -23
- package/dist/assets/{index-CIC0R_Qc.js → index-dbYkWwF4.js} +1 -1
- package/dist/assets/index-vP1T6V7V.js +120 -0
- package/dist/assets/info-outline-rounded-BIwvgXCK.js +1 -0
- package/dist/assets/invitation-CYFN9u5t.js +177 -0
- package/dist/assets/invitations-jY13RXbI.js +3 -0
- package/dist/assets/{invite-uHE_P5fP.js → invite-D72FvaiG.js} +1 -1
- package/dist/assets/{isURL-CRZ7iI7F.js → isURL-CJRImg0N.js} +2 -2
- package/dist/assets/issue-passport-BfqkJF3W.js +1 -0
- package/dist/assets/{item-BJSHAMwK.js → item-5ZWPft2s.js} +1 -1
- package/dist/assets/landing-page-DRtId3hN.js +1 -0
- package/dist/assets/{layout-D9M0eiNw.js → layout-Be1KH57_.js} +1 -1
- package/dist/assets/{list-DVUI92a2.js → list-CHI1rCEg.js} +3 -3
- package/dist/assets/list-CQtiNSih.js +2 -0
- package/dist/assets/localization-CKE-bHgd.js +1 -0
- package/dist/assets/lock.svg-CiT4rEpi.js +1 -0
- package/dist/assets/{log-DbdNMVuv.js → log-BfCFT05M.js} +1 -1
- package/dist/assets/logger-DU7baop2.js +1 -0
- package/dist/assets/login-BtsH3IvI.js +1 -0
- package/dist/assets/{login-oauth-callback-RLp-7ubu.js → login-oauth-callback-Ds4uYiRr.js} +1 -1
- package/dist/assets/{logo-uploader-BFMnNkRn.js → logo-uploader-lepUW_D7.js} +3 -3
- package/dist/assets/{lost-passport-CB5SFq30.js → lost-passport-BtN3h1ya.js} +2 -2
- package/dist/assets/omit-CCIQ0Qdi.js +1 -0
- package/dist/assets/{open-window-xMdq1GjU.js → open-window-CNt8gsrN.js} +1 -1
- package/dist/assets/{over-due-invoice-payment-DvKFY6t9.js → over-due-invoice-payment-7TbnqqKX.js} +1 -1
- package/dist/assets/{overview-DNVfcZQO.js → overview-Be3tncsL.js} +3 -3
- package/dist/assets/passport-CkJ4B4CG.js +1 -0
- package/dist/assets/passport-item-Bhbm8_m6.js +1 -0
- package/dist/assets/{permission-C0rLyhnq.js → permission-BHvrn0M5.js} +1 -1
- package/dist/assets/preferences-TFWtUYLy.js +1 -0
- package/dist/assets/profile-embed-B9f9hlSS.js +1 -0
- package/dist/assets/provider-icon-DQY2_LaP.js +1 -0
- package/dist/assets/publish-resource-CyvkVMG_.js +1 -0
- package/dist/assets/question-mark-circle.svg-GhTaklFN.js +1 -0
- package/dist/assets/{react-beautiful-dnd.esm-BZjy3RlT.js → react-beautiful-dnd.esm-D0JKrMDl.js} +4 -4
- package/dist/assets/revoke.svg-DUoaRyPZ.js +1 -0
- package/dist/assets/runtime-npJC4gp_.js +1 -0
- package/dist/assets/{sanitize-yVk8VEIO.js → sanitize-C-shWbtD.js} +1 -1
- package/dist/assets/sdk-CoWDgSLO.js +1 -0
- package/dist/assets/security-nSKpCl8B.js +22 -0
- package/dist/assets/server-logo-notext.svg-BLAdvsmP.js +1 -0
- package/dist/assets/{session-5s-U-ruq.js → session-C2ZBRIpv.js} +1 -1
- package/dist/assets/{setup-DgF_JFoX.js → setup-krkSJpAg.js} +1 -1
- package/dist/assets/simple-select-i16Vwzvl.js +1 -0
- package/dist/assets/{spaces-BE9CZzeJ.js → spaces-BdZ_Rv3s.js} +1 -1
- package/dist/assets/start-y3zrboBQ.js +187 -0
- package/dist/assets/{starting-progress-MyalFKYG.js → starting-progress-DI-J-VlX.js} +2 -2
- package/dist/assets/status-B8pB_mTB.js +1 -0
- package/dist/assets/{step-actions-X2c_czAD.js → step-actions-B1ufIDaK.js} +1 -1
- package/dist/assets/{studio-BcQoXvqZ.js → studio-1jwq0HOw.js} +1 -1
- package/dist/assets/{switch-BjA8SIAh.js → switch-CetbUrYR.js} +1 -1
- package/dist/assets/{switch-control-D2RiXLWV.js → switch-control-_85hc9FG.js} +1 -1
- package/dist/assets/{table-tips-Dgzi4H1y.js → table-tips-CMt22HEy.js} +1 -1
- package/dist/assets/team-DDjNXwXE.js +146 -0
- package/dist/assets/{traffic-CvgJe_3z.js → traffic-mcbpWOFq.js} +1 -1
- package/dist/assets/transfer-C66c3bWd.js +16 -0
- package/dist/assets/unsubscribe-Cvz0OKhq.js +1 -0
- package/dist/assets/{use-app-logo-Cfo-T8ZY.js → use-app-logo-BuyF983S.js} +1 -1
- package/dist/assets/use-server-logo-Pbr_UuiI.js +1 -0
- package/dist/assets/{use-window-close-4WCUBrSc.js → use-window-close-B16QghYq.js} +1 -1
- package/dist/assets/{useAsync-DVl73fmG.js → useAsync-BVTh1KYj.js} +1 -1
- package/dist/assets/{useAsync-Dotoxibi.js → useAsync-ZGLJQow7.js} +1 -1
- package/dist/assets/{useAsyncRetry-r8dEPb-x.js → useAsyncRetry-BMmRgSGm.js} +1 -1
- package/dist/assets/{useLocalStorage-Cl1rEjxs.js → useLocalStorage-De-EuH_M.js} +1 -1
- package/dist/assets/user-center-DQSoqc_z.js +125 -0
- package/dist/assets/user-follower-TTyja_sV.js +32 -0
- package/dist/assets/{util-CDBgZOAd.js → util-DuMKfKo8.js} +1 -1
- package/dist/assets/{util-BNGEGQGN.js → util-Ff3hwYmy.js} +1 -1
- package/dist/assets/{vendor-arcblock-B1iA4v4a.js → vendor-arcblock-Cnwtqa7s.js} +19 -19
- package/dist/assets/{vendor-hooks-qxhUUbW5.js → vendor-hooks-BQWlJm53.js} +2 -2
- package/dist/assets/{vendor-utils-CxWN1dT3.js → vendor-utils-DCMKu06e.js} +3 -3
- package/dist/assets/{vendor-ux-jvAfFAl1.js → vendor-ux-B0gV9NvH.js} +92 -95
- package/dist/assets/{wait-connect-VFnD4S6k.js → wait-connect-CRZmfXOA.js} +1 -1
- package/dist/assets/{wizard-D6nEp8xR.js → wizard-B41kI39b.js} +1 -1
- package/dist/assets/{wizard-components-CQAhuCn-.js → wizard-components-Bn72hVOe.js} +2 -2
- package/dist/assets/wrap-locale-CF46rj6q.js +1 -0
- package/dist/assets/{zh-LGxmNDus.js → zh-BmX_fuoi.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +46 -46
- package/dist/assets/Community-CELsDteM.js +0 -1
- package/dist/assets/Holiday-DOCjSYjH.js +0 -1
- package/dist/assets/Meeting-BAXt_LiK.js +0 -1
- package/dist/assets/OffSick-BGEr8Nkc.js +0 -1
- package/dist/assets/WorkingRemotely-BcneAIXG.js +0 -1
- package/dist/assets/addon-DckWyYy3.js +0 -14
- package/dist/assets/advanced-BcLdGbJh.js +0 -14
- package/dist/assets/api-FQQlzPOP.js +0 -1
- package/dist/assets/arrow-down.svg-C4FUKwt4.js +0 -1
- package/dist/assets/base32-BPZDlXZz.js +0 -1
- package/dist/assets/bind-account-DtN3r3bu.js +0 -1
- package/dist/assets/branding-Aq4o2tjp.js +0 -1
- package/dist/assets/button-D6aVYj2n.js +0 -1
- package/dist/assets/cloneDeep-C2rlAYcK.js +0 -1
- package/dist/assets/config-n9Go4CIg.js +0 -53
- package/dist/assets/config-space-DNGDnW7P.js +0 -1
- package/dist/assets/connect-B84DSta0.js +0 -1
- package/dist/assets/connect-CmaOf6IU.js +0 -5
- package/dist/assets/createClass-DXSToV70.js +0 -1
- package/dist/assets/did-address-B3eXeL7H.js +0 -1
- package/dist/assets/domains-BmgTqdar.js +0 -1
- package/dist/assets/edit.svg-RRSklUg-.js +0 -1
- package/dist/assets/email-0rfuUid8.js +0 -17
- package/dist/assets/engine-D-_cbl3F.js +0 -1
- package/dist/assets/exchange-passport-DtpDKfXH.js +0 -1
- package/dist/assets/gen-simple-access-key-BRpJnjDR.js +0 -1
- package/dist/assets/get-safe-url-xl2OarvZ.js +0 -1
- package/dist/assets/index-BMtr5-CV.js +0 -1
- package/dist/assets/index-BODmBNkm.js +0 -200
- package/dist/assets/index-C6oxUE_X.js +0 -281
- package/dist/assets/index-DUo9jXH_.js +0 -81
- package/dist/assets/index-DcjD74XY.js +0 -1
- package/dist/assets/index-DrVXX4fX.css +0 -1
- package/dist/assets/index-NWCpUGtr.js +0 -1039
- package/dist/assets/index-TG3kf9io.js +0 -120
- package/dist/assets/index-tfYDa2i6.js +0 -93
- package/dist/assets/invitation-CVulfNR5.js +0 -177
- package/dist/assets/invitations-CuhR5Qhr.js +0 -3
- package/dist/assets/issue-passport-CgdZdVEa.js +0 -1
- package/dist/assets/landing-page-Bu1ZaLGu.js +0 -1
- package/dist/assets/list-BYNjj68R.js +0 -2
- package/dist/assets/localization-CZX-M3IK.js +0 -1
- package/dist/assets/lock.svg-BgybwZNe.js +0 -1
- package/dist/assets/logger-Biwe4SzB.js +0 -1
- package/dist/assets/login-DUYsZ42N.js +0 -1
- package/dist/assets/omit-spWLSLbo.js +0 -1
- package/dist/assets/passport-BNRZfcVH.js +0 -1
- package/dist/assets/passport-item-Bf_kXmId.js +0 -1
- package/dist/assets/preferences-XGJx_7ht.js +0 -1
- package/dist/assets/profile-embed-DROgyynT.js +0 -1
- package/dist/assets/publish-resource-C3tnQoPG.js +0 -1
- package/dist/assets/question-mark-circle.svg-CByEVDhb.js +0 -1
- package/dist/assets/revoke.svg-CNl4LAbv.js +0 -1
- package/dist/assets/runtime-DiEn6rZ9.js +0 -1
- package/dist/assets/sdk-C45BrgFy.js +0 -1
- package/dist/assets/security-Ch3TxRbd.js +0 -22
- package/dist/assets/server-logo-notext.svg-xZ-i1SpD.js +0 -1
- package/dist/assets/simple-select-EppOca29.js +0 -1
- package/dist/assets/start-D6EkscL8.js +0 -187
- package/dist/assets/status-vSa6pwrP.js +0 -1
- package/dist/assets/team-D9lFN8Pe.js +0 -146
- package/dist/assets/transfer-IRaap94c.js +0 -16
- package/dist/assets/unsubscribe-7WUPZn-b.js +0 -1
- package/dist/assets/use-server-logo-Cv1kAPgB.js +0 -1
- package/dist/assets/user-center-BoGQKLvn.js +0 -125
- package/dist/assets/user-follower-D8NzTP2C.js +0 -32
- package/dist/assets/wrap-locale-qgV7mOv6.js +0 -1
|
@@ -1,120 +0,0 @@
|
|
|
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 X,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 Xe,cD as ht,ad as Qe,e4 as gt,e5 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-DnR6WYuU.js";import{e as ee,F as Ct,aB as pe}from"./vendor-utils-CxWN1dT3.js";import{H as q,aV as Nt,V as Y,cN as wt,m as Ye,$ as Ze,w as Ae,aP as Je,bi as be,aL as Rt,aX as Tt,b2 as It,b9 as Et}from"./vendor-ux-jvAfFAl1.js";import{Z as At,Q as H,c as E,C as Dt,a1 as Ue}from"./index-NWCpUGtr.js";import{a as Q,g as De}from"./vendor-hooks-qxhUUbW5.js";import{S as me}from"./shorten-label-C4py9TLA.js";import{v as et}from"./index-BWCHnVga.js";import{R as tt,A as Ot,S as Lt,a as kt,B as Ft}from"./list-DVUI92a2.js";import{i as Pt,e as _t,N as Bt}from"./team-D9lFN8Pe.js";import{W as zt}from"./did-address-B3eXeL7H.js";import{p as st}from"./util-CDBgZOAd.js";import{D as Wt,g as Mt}from"./traffic-CvgJe_3z.js";import{B as nt}from"./bundle-avatar-Dtpi1uSw.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-B1iA4v4a.js";import"./server-logo-notext.svg-xZ-i1SpD.js";import"./session-5s-U-ruq.js";import"./isURL-CRZ7iI7F.js";import"./use-app-logo-Cfo-T8ZY.js";import"./base32-BPZDlXZz.js";import"./useAsyncRetry-r8dEPb-x.js";import"./useAsync-Dotoxibi.js";import"./iframe-D119MMHU.js";import"./index-VaUGnCuU.js";import"./index-DBs9Ljax.js";import"./base-chart-ChBZtUEG.js";import"./index-D1SIrheh.js";import"./vendor-mui-x-CQc01l4r.js";import"./AdapterDayjs-DyRP0A_7.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)}),Xt=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},Yt=(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(X,{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(X,{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}=Y();return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(X,{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}=Y(),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}=Y(),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(X,{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}=Y();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}=Y(),[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(X,{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}=Y(),l=Xe(),b=x.useMemo(()=>Ye(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"?Xt(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(),Yt(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(X,{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(X,{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(X,{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}=Y(),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}=Y(),{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(X,{variant:"h6",children:[h," (",s.total,")"]}),e.jsxs(X,{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}=Y(),{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(X,{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}=Y(),r=Xe(),i=yt(r.breakpoints.down("sm")),l=x.useMemo(()=>Ye(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};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import{r as j,g as ge}from"./vendor-react-CTtPmzVP.js";import{j as o,T as H,z as $,x as ye,cs as ve,ct as Y,ca as je,F as Ce,bf as Te,aZ as Fe,a6 as U,W as C,bX as be,a5 as we,I as K,at as Z,ak as B,Q as Se,bi as Be,J as De,am as Re}from"./vendor-mui-core-DnR6WYuU.js";import{Z as E,aL as ae,G as le,c as Ne}from"./index-NWCpUGtr.js";import{V as M,aL as ce,w as L,H as z,a2 as ee,ba as Pe}from"./vendor-ux-jvAfFAl1.js";import{e as ue}from"./edit.svg-RRSklUg-.js";import{C as He}from"./lock.svg-BgybwZNe.js";import{G as Ie,T as Le}from"./vendor-utils-CxWN1dT3.js";import{f as pe}from"./index-DBs9Ljax.js";import{b as de}from"./team-D9lFN8Pe.js";import{w as me,P as Ee}from"./permission-C0rLyhnq.js";import{C as Me}from"./confirm-BRnYfcDD.js";const _e=u=>j.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...u},j.createElement("path",{d:"M8.4375 4.3125H8.25C8.35313 4.3125 8.4375 4.22812 8.4375 4.125V4.3125H15.5625V4.125C15.5625 4.22812 15.6469 4.3125 15.75 4.3125H15.5625V6H17.25V4.125C17.25 3.29766 16.5773 2.625 15.75 2.625H8.25C7.42266 2.625 6.75 3.29766 6.75 4.125V6H8.4375V4.3125ZM20.25 6H3.75C3.33516 6 3 6.33516 3 6.75V7.5C3 7.60313 3.08437 7.6875 3.1875 7.6875H4.60312L5.18203 19.9453C5.21953 20.7445 5.88047 21.375 6.67969 21.375H17.3203C18.1219 21.375 18.7805 20.7469 18.818 19.9453L19.3969 7.6875H20.8125C20.9156 7.6875 21 7.60313 21 7.5V6.75C21 6.33516 20.6648 6 20.25 6ZM17.1398 19.6875H6.86016L6.29297 7.6875H17.707L17.1398 19.6875Z"}));var A={exports:{}},W={exports:{}},te;function ke(){return te||(te=1,function(){var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m={rotl:function(a,c){return a<<c|a>>>32-c},rotr:function(a,c){return a<<32-c|a>>>c},endian:function(a){if(a.constructor==Number)return m.rotl(a,8)&16711935|m.rotl(a,24)&4278255360;for(var c=0;c<a.length;c++)a[c]=m.endian(a[c]);return a},randomBytes:function(a){for(var c=[];a>0;a--)c.push(Math.floor(Math.random()*256));return c},bytesToWords:function(a){for(var c=[],l=0,p=0;l<a.length;l++,p+=8)c[p>>>5]|=a[l]<<24-p%32;return c},wordsToBytes:function(a){for(var c=[],l=0;l<a.length*32;l+=8)c.push(a[l>>>5]>>>24-l%32&255);return c},bytesToHex:function(a){for(var c=[],l=0;l<a.length;l++)c.push((a[l]>>>4).toString(16)),c.push((a[l]&15).toString(16));return c.join("")},hexToBytes:function(a){for(var c=[],l=0;l<a.length;l+=2)c.push(parseInt(a.substr(l,2),16));return c},bytesToBase64:function(a){for(var c=[],l=0;l<a.length;l+=3)for(var p=a[l]<<16|a[l+1]<<8|a[l+2],d=0;d<4;d++)l*8+d*6<=a.length*8?c.push(u.charAt(p>>>6*(3-d)&63)):c.push("=");return c.join("")},base64ToBytes:function(a){a=a.replace(/[^A-Z0-9+\/]/ig,"");for(var c=[],l=0,p=0;l<a.length;p=++l%4)p!=0&&c.push((u.indexOf(a.charAt(l-1))&Math.pow(2,-2*p+8)-1)<<p*2|u.indexOf(a.charAt(l))>>>6-p*2);return c}};W.exports=m}()),W.exports}var V,re;function ne(){if(re)return V;re=1;var u={utf8:{stringToBytes:function(m){return u.bin.stringToBytes(unescape(encodeURIComponent(m)))},bytesToString:function(m){return decodeURIComponent(escape(u.bin.bytesToString(m)))}},bin:{stringToBytes:function(m){for(var a=[],c=0;c<m.length;c++)a.push(m.charCodeAt(c)&255);return a},bytesToString:function(m){for(var a=[],c=0;c<m.length;c++)a.push(String.fromCharCode(m[c]));return a.join("")}}};return V=u,V}/*!
|
|
2
|
-
* Determine if an object is a Buffer
|
|
3
|
-
*
|
|
4
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
5
|
-
* @license MIT
|
|
6
|
-
*/var O,se;function qe(){if(se)return O;se=1,O=function(a){return a!=null&&(u(a)||m(a)||!!a._isBuffer)};function u(a){return!!a.constructor&&typeof a.constructor.isBuffer=="function"&&a.constructor.isBuffer(a)}function m(a){return typeof a.readFloatLE=="function"&&typeof a.slice=="function"&&u(a.slice(0,0))}return O}var ie;function $e(){return ie||(ie=1,function(){var u=ke(),m=ne().utf8,a=qe(),c=ne().bin,l=function(p,d){p.constructor==String?d&&d.encoding==="binary"?p=c.stringToBytes(p):p=m.stringToBytes(p):a(p)?p=Array.prototype.slice.call(p,0):!Array.isArray(p)&&p.constructor!==Uint8Array&&(p=p.toString());for(var s=u.bytesToWords(p),f=p.length*8,n=1732584193,t=-271733879,r=-1732584194,e=271733878,i=0;i<s.length;i++)s[i]=(s[i]<<8|s[i]>>>24)&16711935|(s[i]<<24|s[i]>>>8)&4278255360;s[f>>>5]|=128<<f%32,s[(f+64>>>9<<4)+14]=f;for(var v=l._ff,g=l._gg,y=l._hh,h=l._ii,i=0;i<s.length;i+=16){var F=n,D=t,R=r,w=e;n=v(n,t,r,e,s[i+0],7,-680876936),e=v(e,n,t,r,s[i+1],12,-389564586),r=v(r,e,n,t,s[i+2],17,606105819),t=v(t,r,e,n,s[i+3],22,-1044525330),n=v(n,t,r,e,s[i+4],7,-176418897),e=v(e,n,t,r,s[i+5],12,1200080426),r=v(r,e,n,t,s[i+6],17,-1473231341),t=v(t,r,e,n,s[i+7],22,-45705983),n=v(n,t,r,e,s[i+8],7,1770035416),e=v(e,n,t,r,s[i+9],12,-1958414417),r=v(r,e,n,t,s[i+10],17,-42063),t=v(t,r,e,n,s[i+11],22,-1990404162),n=v(n,t,r,e,s[i+12],7,1804603682),e=v(e,n,t,r,s[i+13],12,-40341101),r=v(r,e,n,t,s[i+14],17,-1502002290),t=v(t,r,e,n,s[i+15],22,1236535329),n=g(n,t,r,e,s[i+1],5,-165796510),e=g(e,n,t,r,s[i+6],9,-1069501632),r=g(r,e,n,t,s[i+11],14,643717713),t=g(t,r,e,n,s[i+0],20,-373897302),n=g(n,t,r,e,s[i+5],5,-701558691),e=g(e,n,t,r,s[i+10],9,38016083),r=g(r,e,n,t,s[i+15],14,-660478335),t=g(t,r,e,n,s[i+4],20,-405537848),n=g(n,t,r,e,s[i+9],5,568446438),e=g(e,n,t,r,s[i+14],9,-1019803690),r=g(r,e,n,t,s[i+3],14,-187363961),t=g(t,r,e,n,s[i+8],20,1163531501),n=g(n,t,r,e,s[i+13],5,-1444681467),e=g(e,n,t,r,s[i+2],9,-51403784),r=g(r,e,n,t,s[i+7],14,1735328473),t=g(t,r,e,n,s[i+12],20,-1926607734),n=y(n,t,r,e,s[i+5],4,-378558),e=y(e,n,t,r,s[i+8],11,-2022574463),r=y(r,e,n,t,s[i+11],16,1839030562),t=y(t,r,e,n,s[i+14],23,-35309556),n=y(n,t,r,e,s[i+1],4,-1530992060),e=y(e,n,t,r,s[i+4],11,1272893353),r=y(r,e,n,t,s[i+7],16,-155497632),t=y(t,r,e,n,s[i+10],23,-1094730640),n=y(n,t,r,e,s[i+13],4,681279174),e=y(e,n,t,r,s[i+0],11,-358537222),r=y(r,e,n,t,s[i+3],16,-722521979),t=y(t,r,e,n,s[i+6],23,76029189),n=y(n,t,r,e,s[i+9],4,-640364487),e=y(e,n,t,r,s[i+12],11,-421815835),r=y(r,e,n,t,s[i+15],16,530742520),t=y(t,r,e,n,s[i+2],23,-995338651),n=h(n,t,r,e,s[i+0],6,-198630844),e=h(e,n,t,r,s[i+7],10,1126891415),r=h(r,e,n,t,s[i+14],15,-1416354905),t=h(t,r,e,n,s[i+5],21,-57434055),n=h(n,t,r,e,s[i+12],6,1700485571),e=h(e,n,t,r,s[i+3],10,-1894986606),r=h(r,e,n,t,s[i+10],15,-1051523),t=h(t,r,e,n,s[i+1],21,-2054922799),n=h(n,t,r,e,s[i+8],6,1873313359),e=h(e,n,t,r,s[i+15],10,-30611744),r=h(r,e,n,t,s[i+6],15,-1560198380),t=h(t,r,e,n,s[i+13],21,1309151649),n=h(n,t,r,e,s[i+4],6,-145523070),e=h(e,n,t,r,s[i+11],10,-1120210379),r=h(r,e,n,t,s[i+2],15,718787259),t=h(t,r,e,n,s[i+9],21,-343485551),n=n+F>>>0,t=t+D>>>0,r=r+R>>>0,e=e+w>>>0}return u.endian([n,t,r,e])};l._ff=function(p,d,s,f,n,t,r){var e=p+(d&s|~d&f)+(n>>>0)+r;return(e<<t|e>>>32-t)+d},l._gg=function(p,d,s,f,n,t,r){var e=p+(d&f|s&~f)+(n>>>0)+r;return(e<<t|e>>>32-t)+d},l._hh=function(p,d,s,f,n,t,r){var e=p+(d^s^f)+(n>>>0)+r;return(e<<t|e>>>32-t)+d},l._ii=function(p,d,s,f,n,t,r){var e=p+(s^(d|~f))+(n>>>0)+r;return(e<<t|e>>>32-t)+d},l._blocksize=16,l._digestsize=16,A.exports=function(p,d){if(p==null)throw new Error("Illegal argument "+p);var s=u.wordsToBytes(l(p,d));return d&&d.asBytes?s:d&&d.asString?c.bytesToString(s):u.bytesToHex(s)}}()),A.exports}var ze=$e();const Ae=ge(ze);function G({teamDid:u,onCancel:m,onSuccess:a,onError:c=()=>{},mode:l="create",item:p={},orgId:d=""}){const{api:s}=E(),[f,n]=j.useState(!1),[t,r]=j.useState(""),{t:e}=M(),[i,v]=j.useState(p.title||""),[g,y]=j.useState(p.description||""),[h,F]=j.useState(p?.extra?.display||"builtin"),[D,R]=j.useState(p?.extra?.types?p.extra.types.join(","):""),w=async()=>{const x=i.trim();if(!x){r(e("team.passport.error.titleEmpty"));return}if(x.length>64){r(e("team.passport.error.titleTooLong",{length:64}));return}const N=g.replace(/\n/g," ");if(!N){r(e("team.passport.error.descriptionEmpty"));return}const I=l==="create"?Ae(d?`${d}-${x}`:x):p.name;r(null),n(!0);try{if(l==="create"){const S={teamDid:u,name:I,title:x,description:N,...d?{orgId:d}:{}};h==="custom"&&(S.extra=JSON.stringify({display:"custom",types:D.split(",")})),await s.createRole({input:S})}else{const S={teamDid:u,role:{name:I,title:x,description:N},...d?{orgId:d}:{}};await s.updateRole({input:S})}a()}catch(S){const k=pe(S);r(k),c(S)}finally{n(!1)}},_=o.jsxs("div",{children:[l==="update"&&o.jsx(H,{component:"div",style:{paddingTop:16},children:o.jsx($,{label:"ID",autoComplete:"off",variant:"outlined",name:"url","data-cy":"mutate-role-input-name",fullWidth:!0,autoFocus:!0,value:p.name,disabled:!0})}),o.jsx(H,{component:"div",style:{marginTop:16},children:o.jsx($,{label:e("common.title"),autoComplete:"off",variant:"outlined",name:"title","data-cy":"mutate-role-input-title",fullWidth:!0,autoFocus:!0,value:i,onChange:x=>{r(null),v(x.target.value)},disabled:l==="update"||f,helperText:e("team.passport.create.titleTip")})}),o.jsx(H,{component:"div",style:{marginTop:16,marginBottom:16},children:o.jsx($,{label:e("common.description"),autoComplete:"off",variant:"outlined",name:"description","data-cy":"mutate-role-input-description",fullWidth:!0,autoFocus:!0,value:g,onChange:x=>{r(null),y(x.target.value)},disabled:f,multiline:!0,rows:3})}),l==="create"&&o.jsxs("div",{style:{marginBottom:16},children:[o.jsx(ye,{children:e("common.display")}),o.jsxs(ve,{color:"primary",size:"small",value:h,exclusive:!0,style:{marginTop:16},disabled:f,onChange:(x,N)=>F(N),"data-cy":"input-role-display",children:[o.jsx(Y,{value:"builtin","data-cy":"input-role-display-builtin",children:o.jsx(H,{children:e("team.passport.displayBuiltin")})}),o.jsx(Y,{value:"custom","data-cy":"input-role-display-custom",children:o.jsx(H,{children:e("team.passport.displayCustom")})})]}),h==="custom"&&o.jsxs(o.Fragment,{children:[o.jsx(je,{fullWidth:!0,type:"text",style:{marginTop:16},"data-cy":"input-role-types",value:D,disabled:f,onChange:x=>{R(x.target.value)}}),o.jsx(Ce,{children:e("team.passport.typesTip")})]})]})]});return o.jsxs(ce,{title:l==="create"?e("team.passport.create.title"):"",fullWidth:!0,open:!0,onClose:m,showCloseButton:!1,actions:o.jsxs(o.Fragment,{children:[o.jsx(L,{onClick:m,color:"inherit",children:e("common.cancel")}),o.jsxs(L,{"data-cy":"mutate-role-confirm",onClick:w,color:"primary",disabled:f,variant:"contained",autoFocus:!0,children:[f&&o.jsx(U,{size:16}),e(l==="create"?"common.create":"common.update")]})]}),children:[o.jsx(Te,{component:"div",children:_}),!!t&&o.jsx(Fe,{severity:"error",style:{width:"100%",margin:0},children:t})]})}G.propTypes={teamDid:C.string.isRequired,onCancel:C.func.isRequired,onSuccess:C.func.isRequired,onError:C.func,mode:C.oneOf(["create","update"]),item:C.object,orgId:C.string};function J({onCancel:u,onSuccess:m,onDelete:a,roleName:c,roles:l=void 0,hasPermission:p=!1,orgId:d=""}){const{api:s}=E(),{roles:f,permissions:n,teamDid:t,refresh:r,isNodeTeam:e}=de(),{t:i}=M(),[v,g]=j.useState([]),[y,h]=j.useState(!1),[F,D]=j.useState(null),[R,w]=j.useState(!1),_=j.useMemo(()=>l||f,[l,f]),x=Ie(_.find(T=>T.name===c)),N=ae(c),I=async T=>{if(!R)try{w(!0),await s.deleteRole({input:{teamDid:t,name:T}}),a()}catch(b){z.error(b.message)}finally{w(!1),D(null)}},S=async(T,b)=>{const fe=(await s.getPermissionsByRole({input:{teamDid:T,role:{name:b}}})).permissions||[],xe=n.map(X=>({...X,bind:fe.some(he=>he.name===X.name)}));g(xe)},k=async()=>{w(!0);const T=v.filter(b=>b.bind).map(b=>b.name);try{await s.updatePermissionsForRole({input:{teamDid:t,roleName:x.name,grantNames:T}}),z.success(i("common.saveSuccess")),m()}catch(b){z.error(pe(b))}finally{w(!1)}};j.useEffect(()=>{t&&c&&S(t,c)},[t,c]);const q=e||!p;let Q=null;return e&&(Q=o.jsxs("div",{className:"bind",children:[o.jsx("div",{className:"title",children:i("common.permission")}),o.jsx("div",{className:"list",children:v.filter(T=>q?T.bind:!0).map(T=>o.jsx("div",{className:"item",children:o.jsx(be,{control:o.jsx(we,{disabled:q,checked:T.bind,onChange:()=>{g(b=>b.map(P=>(P.name===T.name&&(P.bind=!P.bind),P)))},name:T.name}),label:T.description})}))})]})),o.jsxs(ce,{title:i("common.passport"),onClose:u,open:!0,fullWidth:!0,toolbar:p&&!N&&o.jsxs(o.Fragment,{children:[o.jsx(K,{onClick:()=>h(x),"data-cy":`edit-passport-${x.name}`,size:"large",children:o.jsx(ue,{fill:"#bfbfbf"})}),o.jsx(K,{onClick:()=>D({title:i("team.passport.delete.title"),description:i("team.passport.delete.description",{name:x.title}),confirm:i("common.delConfirm"),cancel:i("common.cancel"),onConfirm:()=>{I(x.name)},onCancel:()=>{w(!1),D(null)}}),"data-cy":`delete-passport-${x.name}`,size:"large",children:o.jsx(_e,{"data-cy":"close-passport-dialog",fill:"#bfbfbf"})})]}),actions:e&&!q&&o.jsxs(o.Fragment,{children:[o.jsx(L,{onClick:u,color:"inherit",children:i("common.cancel")}),o.jsxs(L,{onClick:k,color:"primary",disabled:R||!x,variant:"contained",autoFocus:!0,"data-cy":"bind-permission-btn-confirm",children:[R&&o.jsx(U,{size:16}),i("common.save")]})]}),children:[o.jsxs(Ue,{children:[!x&&o.jsx(Ze,{children:o.jsx(U,{})}),x&&o.jsxs("div",{className:"dialog-content",children:[o.jsxs("div",{className:"header",children:[o.jsx("div",{className:"title",children:x.title}),o.jsx("div",{className:"description",style:{marginTop:e?16:48},children:x.description})]}),Q]})]}),y&&o.jsx(G,{teamDid:t,onCancel:()=>h(null),onSuccess:()=>{h(null),d?m():r()},mode:"update",roleName:y.name,item:y,orgId:d}),F&&o.jsx(Me,{title:F.title,description:F.description,confirm:F.confirm,cancel:F.cancel,params:F.params,onConfirm:F.onConfirm,onCancel:F.onCancel})]})}const We=me(J,"mutate_team"),Ve=me(J,"",le);function Oe(u){const{inService:m}=E();return m?o.jsx(Ve,{...u}):o.jsx(We,{...u})}J.propTypes={roleName:C.string.isRequired,onCancel:C.func.isRequired,onSuccess:C.func.isRequired,onDelete:C.func.isRequired,hasPermission:C.bool,roles:C.array,orgId:C.string};const Ue=Z.div`
|
|
7
|
-
.header {
|
|
8
|
-
.title {
|
|
9
|
-
font-weight: 400;
|
|
10
|
-
font-size: 24px;
|
|
11
|
-
line-height: 28px;
|
|
12
|
-
color: ${({theme:u})=>u.palette.text.primary};
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.description {
|
|
16
|
-
margin-top: 16px;
|
|
17
|
-
font-weight: 400;
|
|
18
|
-
font-size: 16px;
|
|
19
|
-
line-height: 19px;
|
|
20
|
-
color: ${({theme:u})=>u.palette.text.secondary};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.bind {
|
|
25
|
-
margin-top: 24px;
|
|
26
|
-
.title {
|
|
27
|
-
font-weight: 400;
|
|
28
|
-
font-size: 16px;
|
|
29
|
-
line-height: 19px;
|
|
30
|
-
color: ${({theme:u})=>u.palette.text.secondary};
|
|
31
|
-
margin-bottom: 24px;
|
|
32
|
-
}
|
|
33
|
-
.item {
|
|
34
|
-
margin-top: 24px;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.MuiFormControlLabel-label {
|
|
38
|
-
font-weight: 400;
|
|
39
|
-
font-size: 16px;
|
|
40
|
-
line-height: 19px;
|
|
41
|
-
color: ${({theme:u})=>u.palette.text.secondary};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.PrivateSwitchBase-root-45 {
|
|
45
|
-
padding: 0;
|
|
46
|
-
padding-right: 12px;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
`,Ze=Z.div`
|
|
50
|
-
flex: 1;
|
|
51
|
-
display: flex;
|
|
52
|
-
justify-content: center;
|
|
53
|
-
align-items: center;
|
|
54
|
-
height: 200px;
|
|
55
|
-
`,oe=j.memo(({field:u,value:m,copyable:a})=>{const{local:c}=M();return m?o.jsxs(B,{onClick:l=>l.stopPropagation(),sx:{display:"flex",alignItems:"center",gap:1},children:[u?o.jsxs(ee,{variant:"subtitle1",color:"textSecondary",sx:{width:50,textAlign:"right"},children:[u,":"]}):null,o.jsx(ee,{variant:"body1",children:o.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[o.jsx(Re,{title:m,children:o.jsx("span",{className:"value-ellipsis",children:m})}),a?o.jsx(Pe,{content:Le(m),locale:c,style:{marginLeft:"4px",color:"#999",fontSize:"0.8em",verticalAlign:"bottom"}}):null]})})]}):null}),Ge=j.memo(({role:u={},createPassportSvg:m,onUpdate:a,passportProps:c={},actions:l=null})=>{const{inService:p}=E(),d=De(f=>f.breakpoints.down("md")),s=j.useMemo(()=>u.name&&!Ne.ROLES[u.name.toUpperCase()],[u]);return o.jsxs(B,{"data-cy":`passport-${u.name}`,className:"item",onClick:()=>a(u),sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o.jsxs(B,{sx:{display:"flex",alignItems:"center"},children:[o.jsx("div",{style:{width:150},dangerouslySetInnerHTML:{__html:m({title:u.title,ownerName:"Your Name",width:"150px",...c})}}),o.jsxs(B,{className:"title",sx:{ml:3},children:[o.jsx(oe,{value:u.title}),s?o.jsx(oe,{value:u.name,copyable:!0}):null]})]}),!d&&o.jsx(B,{className:"description",children:u.description}),l||o.jsx(Ee,{permission:p?"":"mutate_team",role:p?le:[],children:o.jsx("div",{className:"action",children:ae(u.name)?o.jsx(He,{}):o.jsx(ue,{})})})]},u.name)});function Je({createPassportSvg:u}){const{roles:m,teamIssuerDid:a,teamName:c,refresh:l,passportColor:p,teamDid:d,isNodeTeam:s}=de(),{t:f}=M(),[n,t]=j.useState(!1),[r,e]=j.useState(!1);return o.jsxs(Qe,{sx:{mt:0},children:[o.jsx(B,{sx:{display:"flex",justifyContent:"flex-end"},children:!s&&o.jsxs(Se,{variant:"contained",edge:"end",color:"primary","data-cy":"create-role",onClick:()=>t(!0),children:[o.jsx(Be,{style:{fontSize:16,marginRight:4}}),f("team.passport.create.title")]})}),o.jsx(B,{className:"list",children:m.map(i=>o.jsx(Ge,{role:i,createPassportSvg:u,onUpdate:e,passportProps:{issuer:c,issuerDid:a,ownerDid:a,preferredColor:p}}))}),r&&o.jsx(Oe,{onCancel:()=>e(!1),onSuccess:()=>{e(!1),l()},onDelete:()=>{e(!1),l()},mode:"update",roleName:r.name,item:r}),n&&o.jsx(G,{teamDid:d,onCancel:()=>t(!1),onSuccess:()=>{t(!1),l()}})]})}const Qe=Z(B)`
|
|
56
|
-
.list {
|
|
57
|
-
.item {
|
|
58
|
-
padding: 12px;
|
|
59
|
-
margin: 12px -12px;
|
|
60
|
-
cursor: pointer;
|
|
61
|
-
transition: box-shadow 0.4s;
|
|
62
|
-
&:hover {
|
|
63
|
-
box-shadow: 0 0 10px 4px rgba(0, 0, 0, 0.1);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.value-ellipsis {
|
|
67
|
-
display: inline-block;
|
|
68
|
-
max-width: 290px;
|
|
69
|
-
white-space: nowrap;
|
|
70
|
-
overflow: hidden;
|
|
71
|
-
text-overflow: ellipsis;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.title {
|
|
76
|
-
font-weight: 400;
|
|
77
|
-
font-size: 18px;
|
|
78
|
-
line-height: 21px;
|
|
79
|
-
color: ${({theme:u})=>u.palette.text.primary};
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.description {
|
|
83
|
-
flex: 1;
|
|
84
|
-
margin-left: 24px;
|
|
85
|
-
margin-right: 24px;
|
|
86
|
-
color: ${({theme:u})=>u.palette.text.secondary};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.action {
|
|
90
|
-
fill: ${({theme:u})=>u.palette.text.secondary};
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
`;Je.propTypes={createPassportSvg:C.func.isRequired};export{Qe as D,_e as H,G as M,Ge as P,J as a,Je as b};
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import{r}from"./vendor-react-CTtPmzVP.js";import{j as i,bD as N,at as g,W as t,ak as _,bu as S,a6 as E,s as z}from"./vendor-mui-core-DnR6WYuU.js";import{g as Z,h as $,b as y,q as T}from"./vendor-hooks-qxhUUbW5.js";import{Q as D,s as U,c as q,T as A,U as L,V as H,W as F}from"./index-NWCpUGtr.js";import{aU as W,aL as O,w as B,V as w,$ as Y}from"./vendor-ux-jvAfFAl1.js";import{N as J}from"./index-uODjznr3.js";import{C as K}from"./vendor-utils-CxWN1dT3.js";import{u as Q}from"./use-passport-id-B-b-_oYF.js";import{u as X}from"./session-5s-U-ruq.js";import{b as G}from"./sdk-C45BrgFy.js";import{w as e2}from"./wrap-locale-qgV7mOv6.js";function b({invitation:e,createPassportSvg:o,passportColor:c="auto"}){const[d,n]=r.useState(!1),{t:p}=r.useContext(W),s=r.useMemo(()=>(e.role.title||e.role.name).toUpperCase(),[e.role.title,e.role.name]),C=r.useMemo(()=>o({title:s,issuer:e.info.name,issuerDid:e.info.appDid,ownerName:"Your Name",ownerDid:e.info.appDid,preferredColor:e.info.passportColor||c,extra:e.passportExpireTime?{key:"Exp",value:D(e.passportExpireTime).format("YYYY-MM-DD HH:mm:ss")}:void 0}),[e,s]),m=r.useCallback(()=>{n(!0)},[]),a=r.useCallback(()=>{n(!1)},[]);return i.jsxs(i.Fragment,{children:[i.jsx(i2,{children:i.jsxs("div",{className:"invite-passport__card",onClick:m,children:[!!e.display&&i.jsx(J,{data:e.display,style:{width:"100%",height:"100%"}}),!e.display&&i.jsx("div",{className:"invite-passport__cover",dangerouslySetInnerHTML:{__html:C}})]})}),i.jsx(O,{open:d,title:p("invite.viewPermission"),PaperProps:{style:{minHeight:"auto",paddingBottom:"20px"}},onClose:a,children:e.role.permissions&&e.role.permissions.length>0?i.jsx("ul",{style:{listStyle:"circle",padding:"0 20px"},children:e.role.permissions.map(u=>i.jsx("li",{style:{listStyle:"circle"},children:u.description},u.name))}):i.jsxs("div",{style:{color:"#999",textAlign:"center"},children:[i.jsx(N,{style:{width:"30px",height:"30px"}}),i.jsx("div",{children:p("invite.emptyPermission")})]})})]})}b.propTypes={invitation:t.object.isRequired,createPassportSvg:t.func.isRequired,passportColor:t.string};const i2=g.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
max-width: 350px;
|
|
4
|
-
margin: 30px auto;
|
|
5
|
-
.invite-passport__card {
|
|
6
|
-
margin: 0 auto;
|
|
7
|
-
width: 228px;
|
|
8
|
-
height: 258px;
|
|
9
|
-
flex-shrink: 0;
|
|
10
|
-
.invite-passport__cover {
|
|
11
|
-
cursor: pointer;
|
|
12
|
-
width: 100%;
|
|
13
|
-
height: 100%;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
.invite-passport__content {
|
|
17
|
-
flex: 1;
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
}
|
|
21
|
-
.invite-passport__title {
|
|
22
|
-
font-weight: 700;
|
|
23
|
-
font-size: 16px;
|
|
24
|
-
}
|
|
25
|
-
.invite-passport__description {
|
|
26
|
-
overflow: hidden;
|
|
27
|
-
text-overflow: ellipsis;
|
|
28
|
-
display: -webkit-box;
|
|
29
|
-
-webkit-line-clamp: 2;
|
|
30
|
-
-webkit-box-orient: vertical;
|
|
31
|
-
height: 3em;
|
|
32
|
-
color: #999;
|
|
33
|
-
font-size: 14px;
|
|
34
|
-
}
|
|
35
|
-
.invite-passport__view-permission {
|
|
36
|
-
cursor: pointer;
|
|
37
|
-
font-size: 14px;
|
|
38
|
-
font-weight: 600;
|
|
39
|
-
line-height: 18px;
|
|
40
|
-
color: ${({theme:e})=>e.palette.primary.main};
|
|
41
|
-
}
|
|
42
|
-
`,t2=e=>r.createElement("svg",{width:239,height:42,viewBox:"0 0 239 42",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e},r.createElement("path",{d:"M24.6042 2.26271L28.5233 0H42.7899V41.8617H28.7912C28.6157 41.8617 28.4433 41.8155 28.2912 41.7277L13.1882 33.0079L13.1882 8.85374L15.0055 7.80451L18.2055 9.65203L16.3882 10.7013V31.1604L29.3807 38.6617H39.5899V3.2H29.3807L27.8042 4.11023L24.6042 2.26271Z",fill:"currentColor"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.4018 31.1604V10.7013L13.4092 3.2H3.2V38.6617H13.4092L14.9906 37.7486L18.1906 39.5961L14.2666 41.8617H0V0H14.2666L29.6018 8.85374V33.0079L27.7893 34.0543L24.5893 32.2068L26.4018 31.1604Z",fill:"currentColor"}),r.createElement("path",{d:"M138.44 27.684C138.632 27.684 138.797 27.7587 138.936 27.908L140.28 29.38C139.341 30.4893 138.195 31.348 136.84 31.956C135.496 32.564 133.875 32.868 131.976 32.868C130.312 32.868 128.803 32.58 127.448 32.004C126.104 31.428 124.952 30.6227 123.992 29.588C123.043 28.5533 122.307 27.316 121.784 25.876C121.261 24.436 121 22.852 121 21.124C121 19.396 121.272 17.812 121.816 16.372C122.371 14.932 123.144 13.6947 124.136 12.66C125.128 11.6253 126.312 10.82 127.688 10.244C129.075 9.668 130.605 9.38 132.28 9.38C133.912 9.38 135.363 9.64666 136.632 10.18C137.901 10.7133 139.005 11.4227 139.944 12.308L138.824 13.892C138.749 14.0093 138.653 14.1053 138.536 14.18C138.429 14.2547 138.285 14.292 138.104 14.292C137.901 14.292 137.661 14.1907 137.384 13.988C137.117 13.7853 136.76 13.5613 136.312 13.316C135.875 13.06 135.331 12.8307 134.68 12.628C134.029 12.4253 133.219 12.324 132.248 12.324C131.107 12.324 130.061 12.5267 129.112 12.932C128.163 13.3267 127.341 13.9027 126.648 14.66C125.965 15.4067 125.432 16.3293 125.048 17.428C124.675 18.516 124.488 19.748 124.488 21.124C124.488 22.5213 124.685 23.764 125.08 24.852C125.475 25.94 126.019 26.8627 126.712 27.62C127.405 28.3773 128.221 28.9533 129.16 29.348C130.099 29.7427 131.112 29.94 132.2 29.94C132.861 29.94 133.453 29.9027 133.976 29.828C134.509 29.7427 134.995 29.62 135.432 29.46C135.88 29.3 136.301 29.0973 136.696 28.852C137.091 28.596 137.48 28.292 137.864 27.94C137.949 27.8653 138.04 27.8067 138.136 27.764C138.232 27.7107 138.333 27.684 138.44 27.684Z",fill:"currentColor"}),r.createElement("path",{d:"M149.68 16.1C150.875 16.1 151.952 16.2973 152.912 16.692C153.883 17.076 154.704 17.636 155.376 18.372C156.059 19.0973 156.581 19.9773 156.944 21.012C157.307 22.036 157.488 23.188 157.488 24.468C157.488 25.748 157.307 26.9053 156.944 27.94C156.581 28.9747 156.059 29.8547 155.376 30.58C154.704 31.3053 153.883 31.8653 152.912 32.26C151.952 32.644 150.875 32.836 149.68 32.836C148.475 32.836 147.387 32.644 146.416 32.26C145.456 31.8653 144.635 31.3053 143.952 30.58C143.269 29.8547 142.741 28.9747 142.368 27.94C142.005 26.9053 141.824 25.748 141.824 24.468C141.824 23.188 142.005 22.036 142.368 21.012C142.741 19.9773 143.269 19.0973 143.952 18.372C144.635 17.636 145.456 17.076 146.416 16.692C147.387 16.2973 148.475 16.1 149.68 16.1ZM149.68 30.404C151.216 30.404 152.363 29.8867 153.12 28.852C153.877 27.8173 154.256 26.3613 154.256 24.484C154.256 22.6067 153.877 21.1507 153.12 20.116C152.363 19.0707 151.216 18.548 149.68 18.548C148.123 18.548 146.96 19.0707 146.192 20.116C145.435 21.1507 145.056 22.6067 145.056 24.484C145.056 26.3613 145.435 27.8173 146.192 28.852C146.96 29.8867 148.123 30.404 149.68 30.404Z",fill:"currentColor"}),r.createElement("path",{d:"M163.899 18.612C164.251 18.2387 164.619 17.8973 165.003 17.588C165.387 17.2787 165.792 17.0173 166.219 16.804C166.656 16.58 167.12 16.4093 167.611 16.292C168.112 16.164 168.645 16.1 169.211 16.1C170.107 16.1 170.891 16.2493 171.563 16.548C172.245 16.8467 172.816 17.268 173.275 17.812C173.733 18.3453 174.08 18.9907 174.315 19.748C174.549 20.5053 174.667 21.3427 174.667 22.26V32.612H171.531V22.26C171.531 21.0973 171.264 20.196 170.731 19.556C170.197 18.9053 169.381 18.58 168.283 18.58C167.483 18.58 166.731 18.772 166.027 19.156C165.333 19.5293 164.688 20.0413 164.091 20.692V32.612H160.971V16.356H162.843C163.28 16.356 163.552 16.564 163.659 16.98L163.899 18.612Z",fill:"currentColor"}),r.createElement("path",{d:"M181.805 18.612C182.157 18.2387 182.525 17.8973 182.909 17.588C183.293 17.2787 183.698 17.0173 184.125 16.804C184.562 16.58 185.026 16.4093 185.517 16.292C186.018 16.164 186.552 16.1 187.117 16.1C188.013 16.1 188.797 16.2493 189.469 16.548C190.152 16.8467 190.722 17.268 191.181 17.812C191.64 18.3453 191.986 18.9907 192.221 19.748C192.456 20.5053 192.573 21.3427 192.573 22.26V32.612H189.437V22.26C189.437 21.0973 189.17 20.196 188.637 19.556C188.104 18.9053 187.288 18.58 186.189 18.58C185.389 18.58 184.637 18.772 183.933 19.156C183.24 19.5293 182.594 20.0413 181.997 20.692V32.612H178.877V16.356H180.749C181.186 16.356 181.458 16.564 181.565 16.98L181.805 18.612Z",fill:"currentColor"}),r.createElement("path",{d:"M207.551 22.676C207.551 22.0573 207.461 21.4867 207.279 20.964C207.109 20.4413 206.853 19.988 206.511 19.604C206.17 19.22 205.754 18.9213 205.263 18.708C204.773 18.4947 204.207 18.388 203.567 18.388C202.255 18.388 201.221 18.7667 200.463 19.524C199.717 20.2813 199.242 21.332 199.039 22.676H207.551ZM210.127 30.292C209.743 30.74 209.301 31.1293 208.799 31.46C208.298 31.78 207.765 32.0413 207.199 32.244C206.634 32.4467 206.047 32.596 205.439 32.692C204.842 32.788 204.25 32.836 203.663 32.836C202.543 32.836 201.503 32.6493 200.543 32.276C199.594 31.892 198.767 31.3373 198.063 30.612C197.37 29.876 196.826 28.9693 196.431 27.892C196.047 26.804 195.855 25.556 195.855 24.148C195.855 23.0173 196.031 21.9667 196.383 20.996C196.735 20.0147 197.237 19.1613 197.887 18.436C198.549 17.7107 199.354 17.14 200.303 16.724C201.253 16.308 202.319 16.1 203.503 16.1C204.495 16.1 205.407 16.2653 206.239 16.596C207.082 16.916 207.807 17.3853 208.415 18.004C209.023 18.6227 209.498 19.3853 209.839 20.292C210.191 21.1987 210.367 22.2333 210.367 23.396C210.367 23.876 210.314 24.2013 210.207 24.372C210.101 24.532 209.903 24.612 209.615 24.612H198.959C198.991 25.5827 199.13 26.4307 199.375 27.156C199.621 27.8707 199.957 28.468 200.383 28.948C200.821 29.428 201.338 29.7853 201.935 30.02C202.533 30.2547 203.199 30.372 203.935 30.372C204.629 30.372 205.226 30.292 205.727 30.132C206.239 29.972 206.677 29.8013 207.039 29.62C207.413 29.428 207.722 29.252 207.967 29.092C208.223 28.932 208.447 28.852 208.639 28.852C208.895 28.852 209.093 28.948 209.231 29.14L210.127 30.292Z",fill:"currentColor"}),r.createElement("path",{d:"M225.113 19.396C225.017 19.5133 224.921 19.6093 224.825 19.684C224.739 19.748 224.611 19.78 224.441 19.78C224.27 19.78 224.089 19.716 223.897 19.588C223.715 19.4493 223.481 19.3053 223.193 19.156C222.915 18.996 222.574 18.852 222.169 18.724C221.774 18.5853 221.283 18.516 220.697 18.516C219.929 18.516 219.251 18.6547 218.665 18.932C218.078 19.2093 217.587 19.604 217.193 20.116C216.809 20.628 216.515 21.252 216.313 21.988C216.11 22.724 216.009 23.5507 216.009 24.468C216.009 25.4173 216.115 26.2653 216.329 27.012C216.542 27.748 216.846 28.372 217.241 28.884C217.635 29.3853 218.115 29.7693 218.681 30.036C219.246 30.292 219.875 30.42 220.569 30.42C221.241 30.42 221.795 30.34 222.233 30.18C222.67 30.0093 223.033 29.828 223.321 29.636C223.609 29.444 223.849 29.268 224.041 29.108C224.233 28.9373 224.43 28.852 224.633 28.852C224.889 28.852 225.086 28.948 225.225 29.14L226.121 30.292C225.747 30.7507 225.326 31.14 224.857 31.46C224.398 31.78 223.907 32.0413 223.385 32.244C222.862 32.4467 222.313 32.596 221.737 32.692C221.171 32.788 220.595 32.836 220.009 32.836C218.995 32.836 218.046 32.6493 217.161 32.276C216.286 31.9027 215.523 31.3587 214.873 30.644C214.233 29.9293 213.726 29.0547 213.353 28.02C212.979 26.9747 212.793 25.7907 212.793 24.468C212.793 23.2627 212.958 22.148 213.289 21.124C213.63 20.1 214.126 19.22 214.777 18.484C215.438 17.7373 216.249 17.156 217.209 16.74C218.169 16.3133 219.267 16.1 220.505 16.1C221.667 16.1 222.691 16.2867 223.577 16.66C224.462 17.0333 225.251 17.5613 225.945 18.244L225.113 19.396Z",fill:"currentColor"}),r.createElement("path",{d:"M234.121 32.868C232.809 32.868 231.796 32.5 231.081 31.764C230.377 31.028 230.025 29.9773 230.025 28.612V18.884H228.137C227.956 18.884 227.801 18.8307 227.673 18.724C227.556 18.6067 227.497 18.436 227.497 18.212V16.948L230.137 16.58L230.841 11.732C230.884 11.5507 230.964 11.412 231.081 11.316C231.209 11.2093 231.369 11.156 231.561 11.156H233.145V16.612H237.753V18.884H233.145V28.404C233.145 29.044 233.3 29.524 233.609 29.844C233.929 30.1533 234.335 30.308 234.825 30.308C235.113 30.308 235.359 30.2707 235.561 30.196C235.775 30.1213 235.956 30.0413 236.105 29.956C236.255 29.86 236.383 29.7747 236.489 29.7C236.596 29.6253 236.692 29.588 236.777 29.588C236.884 29.588 236.964 29.6147 237.017 29.668C237.081 29.7107 237.145 29.7853 237.209 29.892L238.137 31.396C237.625 31.8653 237.017 32.228 236.313 32.484C235.609 32.74 234.879 32.868 234.121 32.868Z",fill:"currentColor"}),r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.8154 33.2842V9H70.6597C73.9281 9.22427 76.4828 11.9486 76.4828 15.2433V27.026C76.4828 30.4823 73.6809 33.2842 70.2246 33.2842H57.8154ZM84.5586 9H81.2237V33.3211H84.5586V9ZM61.1503 29.9493V12.32H70.2246C71.8391 12.32 73.1479 13.6288 73.1479 15.2433V27.026C73.1479 28.6405 71.8391 29.9493 70.2246 29.9493H61.1503ZM89.2432 9V33.2842H101.652C105.109 33.2842 107.911 30.4823 107.911 27.026V15.2433C107.911 11.9486 105.356 9.22427 102.087 9H89.2432ZM112.155 14.6355H115.883V18.3639H112.155V14.6355ZM115.883 23.9572H112.155V27.6856H115.883V23.9572ZM92.5781 12.32V29.9493H101.652C103.267 29.9493 104.576 28.6405 104.576 27.026V15.2433C104.576 13.6288 103.267 12.32 101.652 12.32H92.5781Z",fill:"currentColor"}));function j({children:e=null,...o}){return i.jsxs(B,{color:"did",variant:"contained",...o,children:[i.jsx(_,{sx:{fontWeight:400},children:e||"Continue With"}),i.jsx(t2,{style:{width:"auto",height:"1.2em",margin:"0 4px 0 8px"}})]})}j.propTypes={children:t.any};function V({invitation:e,onLogin:o=()=>{},onReceive:c=null,inService:d=!1,action:n="invite",orgId:p=""}){const{t:s,locale:C}=w(),{connectApi:m}=X(),{getPassportId:a}=Q();let u;typeof window<"u"&&(u=window?.blocklet?.componentId);const l=Z({loading:!1,extraParams:{baseUrl:window.location.origin,componentId:u,sourceAppPid:e?.sourceAppPid||null}});$(async()=>{const x=a();if(x&&(l.extraParams.passportId=x),n==="invite"?(l.extraParams.inviteId=e.inviteId,l.extraParams.orgId=p):n==="issue-passport"&&(l.extraParams.inviteId=e.inviteId,l.extraParams.id=e.inviteId),d&&e?.receiver?.did){l.loading=!0;try{const f=await G.user.getUserPublicInfo({did:e.receiver.did});f?.sourceAppPid&&(l.extraParams.sourceAppPid=f.sourceAppPid)}finally{l.loading=!1}}});const v=y(()=>{m.close()}),h=y((...x)=>{m.close(),o(...x)}),M=y(()=>{if(typeof c=="function"){c();return}const x=e?.receiver?.did||!1,f=x?s("receive.dialog.scanWithDid",{did:e?.receiver?.did}):s("receive.dialog.scan");d?m.open({action:n,className:"connect",forceConnected:x,autoConnect:!1,disableSwitchApp:!0,locale:C,extraParams:{provider:"wallet",...l.extraParams},baseUrl:window.location.origin,prefix:K(window.location.origin,q.WELLKNOWN_SERVICE_PATH_PREFIX,U),messages:{title:s("receive.dialog.title"),scan:f,confirm:s("receive.dialog.confirm"),success:s("receive.dialog.success")},onSuccess:h,onClose:v,passkeyBehavior:"both"},{locale:C}):m.open({action:n,className:"connect",forceConnected:x,autoConnect:!1,disableSwitchApp:!0,locale:C,extraParams:l.extraParams,messages:{title:s("receive.dialog.title"),scan:f,confirm:s("receive.dialog.confirm"),success:s("receive.dialog.success")},onSuccess:h,onClose:v,passkeyBehavior:"both"},{locale:C})});return i.jsxs(r2,{children:[i.jsx(j,{loading:l.loading,size:"large",variant:"contained",className:"invite-receive__button","data-cy":"invite-receive-passport",color:"primary",onClick:M,children:s("invite.receive")}),i.jsxs("div",{className:"invite-receive__until",children:[s("invite.validUntil"),A(e.expireDate,C)]})]})}V.propTypes={invitation:t.object.isRequired,onLogin:t.func,onReceive:t.func,inService:t.bool,action:t.oneOf(["invite","issue-passport"]),orgId:t.string};const r2=g.div`
|
|
43
|
-
text-align: center;
|
|
44
|
-
.invite-receive__logo-wrapper {
|
|
45
|
-
display: inline-flex;
|
|
46
|
-
align-items: center;
|
|
47
|
-
color: #9397a1;
|
|
48
|
-
font-size: 14px;
|
|
49
|
-
}
|
|
50
|
-
.invite-receive__logo {
|
|
51
|
-
height: 16px;
|
|
52
|
-
margin-left: 8px;
|
|
53
|
-
}
|
|
54
|
-
.invite-receive__button {
|
|
55
|
-
width: 100%;
|
|
56
|
-
margin: 16px 0;
|
|
57
|
-
white-space: nowrap;
|
|
58
|
-
}
|
|
59
|
-
.invite-receive__until {
|
|
60
|
-
text-align: center;
|
|
61
|
-
font-size: 14px;
|
|
62
|
-
}
|
|
63
|
-
.invite-receive__description {
|
|
64
|
-
color: #999;
|
|
65
|
-
text-align: left;
|
|
66
|
-
list-style: decimal;
|
|
67
|
-
padding: 0;
|
|
68
|
-
padding-left: 1.2em;
|
|
69
|
-
margin: 40px 0;
|
|
70
|
-
}
|
|
71
|
-
.invite-receive__description-item {
|
|
72
|
-
list-style: decimal;
|
|
73
|
-
}
|
|
74
|
-
.invite-receive__link {
|
|
75
|
-
color: ${({theme:e})=>e.palette.primary.main};
|
|
76
|
-
}
|
|
77
|
-
`;function k({onLogin:e=()=>{}}){const{t:o}=w();return i.jsx(s2,{children:i.jsx(j,{size:"large",variant:"contained",className:"invite-receive__button","data-cy":"invite-receive-passport",color:"primary",onClick:()=>e(),children:o("common.connect")})})}k.propTypes={onLogin:t.func};const s2=g.div`
|
|
78
|
-
text-align: center;
|
|
79
|
-
.invite-receive__logo-wrapper {
|
|
80
|
-
display: inline-flex;
|
|
81
|
-
align-items: center;
|
|
82
|
-
color: #9397a1;
|
|
83
|
-
font-size: 14px;
|
|
84
|
-
}
|
|
85
|
-
.invite-receive__logo {
|
|
86
|
-
height: 16px;
|
|
87
|
-
margin-left: 8px;
|
|
88
|
-
}
|
|
89
|
-
.invite-receive__button {
|
|
90
|
-
width: 100%;
|
|
91
|
-
margin: 16px 0;
|
|
92
|
-
white-space: nowrap;
|
|
93
|
-
}
|
|
94
|
-
.invite-receive__until {
|
|
95
|
-
text-align: center;
|
|
96
|
-
font-size: 14px;
|
|
97
|
-
}
|
|
98
|
-
.invite-receive__description {
|
|
99
|
-
color: #999;
|
|
100
|
-
text-align: left;
|
|
101
|
-
list-style: decimal;
|
|
102
|
-
padding: 0;
|
|
103
|
-
padding-left: 1.2em;
|
|
104
|
-
margin: 40px 0;
|
|
105
|
-
}
|
|
106
|
-
.invite-receive__description-item {
|
|
107
|
-
list-style: decimal;
|
|
108
|
-
}
|
|
109
|
-
.invite-receive__link {
|
|
110
|
-
color: ${({theme:e})=>e.palette.primary.main};
|
|
111
|
-
}
|
|
112
|
-
`;function I({invitation:e}){const{t:o}=w(),c=r.useMemo(()=>(e.role.title||e.role.name).toUpperCase(),[e.role.title,e.role.name]),d=r.useMemo(()=>o("invite.message",{name:"{{name}}",role:c,dapp:"{{dapp}}"}),[o,c]),n=L(e.info.chainHost,e.inviter.did,"account"),p=H(d,{name(){return n?i.jsx("a",{target:"_blank",href:n,className:"invite-user__link",rel:"noreferrer",children:e.inviter.fullName},"name"):e.inviter.fullName},dapp(){return i.jsx("a",{target:"_blank",href:e.info.url,className:"invite-user__link",rel:"noreferrer",children:e.info.name},"dapp")}});return i.jsxs(n2,{children:[i.jsx(Y,{did:e.inviter.did,src:encodeURI(e.inviter.avatar),size:80,shape:"circle",variant:"circle"}),i.jsx("div",{className:"invite-user__message",children:p})]})}I.propTypes={invitation:t.object.isRequired};const n2=g.div`
|
|
113
|
-
display: flex;
|
|
114
|
-
flex-direction: column;
|
|
115
|
-
justify-content: center;
|
|
116
|
-
align-items: center;
|
|
117
|
-
.invite-user__name {
|
|
118
|
-
font-weight: 700;
|
|
119
|
-
font-size: 16px;
|
|
120
|
-
margin: 8px 0 2px 0;
|
|
121
|
-
}
|
|
122
|
-
.invite-user__address {
|
|
123
|
-
font-size: 12px;
|
|
124
|
-
}
|
|
125
|
-
.invite-user__message {
|
|
126
|
-
margin-top: 20px;
|
|
127
|
-
font-weight: 700;
|
|
128
|
-
/* width: 90%; */
|
|
129
|
-
text-align: center;
|
|
130
|
-
font-size: 18px;
|
|
131
|
-
}
|
|
132
|
-
.invite-user__link {
|
|
133
|
-
color: ${({theme:e})=>e.palette.primary.main};
|
|
134
|
-
}
|
|
135
|
-
`;function P({invitation:e,type:o="inviter"}){const{t:c}=w(),d=r.useMemo(()=>c("invite.success",{dapp:"{{dapp}}"}),[c]),n=L(e.info.chainHost,e.inviter.did,"account"),p=o==="receiver"?e.receiver:e.inviter,s=H(d,{name(){return n?i.jsx("a",{target:"_blank",href:n,className:"invite-user__link",rel:"noreferrer",children:p.fullName},"name"):p.fullName},dapp(){return i.jsx("a",{target:"_blank",href:e.info.url,className:"invite-user__link",rel:"noreferrer",children:e.info.name},"dapp")}});return i.jsxs(o2,{children:[i.jsx(_,{sx:{pt:1,color:"success.main"},children:i.jsx(S,{style:{fontSize:80}})}),i.jsx("div",{className:"invite-user__message",children:s})]})}P.propTypes={invitation:t.object.isRequired,type:t.oneOf(["inviter","receiver"])};const o2=g.div`
|
|
136
|
-
display: flex;
|
|
137
|
-
flex-direction: column;
|
|
138
|
-
justify-content: center;
|
|
139
|
-
align-items: center;
|
|
140
|
-
.invite-user__name {
|
|
141
|
-
font-weight: 700;
|
|
142
|
-
font-size: 16px;
|
|
143
|
-
margin: 8px 0 2px 0;
|
|
144
|
-
}
|
|
145
|
-
.invite-user__address {
|
|
146
|
-
font-size: 12px;
|
|
147
|
-
}
|
|
148
|
-
.invite-user__message {
|
|
149
|
-
margin-top: 20px;
|
|
150
|
-
font-weight: 700;
|
|
151
|
-
/* width: 90%; */
|
|
152
|
-
text-align: center;
|
|
153
|
-
font-size: 18px;
|
|
154
|
-
}
|
|
155
|
-
.invite-user__link {
|
|
156
|
-
color: ${({theme:e})=>e.palette.primary.main};
|
|
157
|
-
}
|
|
158
|
-
`;function R({getDataFn:e,passportColor:o="auto",createPassportSvg:c,onLoginSuccess:d=()=>{},checkFn:n,onReceive:p=null,inService:s=!1,action:C="invite",status:m=""}){const a=T(e),u=r.useMemo(()=>a?.data?.orgId||"",[a?.data?.orgId]);if(a?.loading)return i.jsx(E,{});if(a?.error)return i.jsx(F,{status:"404",title:a?.error?.response?.data,description:""});const l=m==="success"||a?.data?.status==="success",v=l?P:I,h=l?k:V;return i.jsx(a2,{className:"page-invite__wrapper",children:a?.data?i.jsxs(_,{className:"page-invite__card",children:[i.jsx(v,{invitation:a.data}),i.jsx(b,{invitation:a.data,action:C,createPassportSvg:c,passportColor:o}),i.jsx(h,{invitation:a.data,action:C,onLogin:d,checkFn:n,onReceive:p,inService:s,orgId:u})]}):null})}R.propTypes={getDataFn:t.func.isRequired,checkFn:t.func.isRequired,createPassportSvg:t.func.isRequired,onLoginSuccess:t.func,onReceive:t.func,passportColor:t.string,inService:t.bool,action:t.oneOf(["invite","issue-passpor"]),status:t.oneOf(["success",""])};const a2=z(_)`
|
|
159
|
-
max-width: 460px;
|
|
160
|
-
max-height: 650px;
|
|
161
|
-
min-height: 450px;
|
|
162
|
-
width: 90%;
|
|
163
|
-
height: 80%;
|
|
164
|
-
display: flex;
|
|
165
|
-
flex-direction: column;
|
|
166
|
-
margin: auto;
|
|
167
|
-
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.05);
|
|
168
|
-
.page-invite__card {
|
|
169
|
-
background-color: ${({theme:e})=>e.palette.background.paper};
|
|
170
|
-
border-radius: 12px;
|
|
171
|
-
flex: 1;
|
|
172
|
-
padding: 20px 30px;
|
|
173
|
-
}
|
|
174
|
-
.page-invite__app {
|
|
175
|
-
margin-top: 20px;
|
|
176
|
-
}
|
|
177
|
-
`,h2=e2(R);export{h2 as I};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{r}from"./vendor-react-CTtPmzVP.js";import{j as o,a6 as B,am as D,ak as w,cu as L,at as H,W as x}from"./vendor-mui-core-DnR6WYuU.js";import{aU as P,w as S,aP as T,au as Y}from"./vendor-ux-jvAfFAl1.js";import{Z as z,Q as M,G as N,f as E,br as W}from"./index-NWCpUGtr.js";import{n as A}from"./vendor-utils-CxWN1dT3.js";import{b as G}from"./team-D9lFN8Pe.js";import{C as K}from"./confirm-BRnYfcDD.js";import{P as Q}from"./permission-C0rLyhnq.js";import{C as U}from"./click-to-copy-BEM1P78p.js";function Z({invitations:a=[],onRefresh:v=A}){const{api:C,inService:d}=z(),{t,locale:y}=r.useContext(P),{teamDid:h,invitations:f,refresh:g,endpoint:l,roles:j}=G(),[i,m]=r.useState(null),[I,c]=r.useState(!1),s=r.useMemo(()=>a.length>0?a:f,[a,f]),k=async({inviteId:e})=>{if(!I){c(!0);try{await C.deleteInvitation({input:{teamDid:h,inviteId:e}}),g(),v?.(),await E(800)}catch(n){console.error(n)}finally{c(!1),m(null)}}},R=()=>{c(!1),m(null)},p=e=>l?W({inviteId:e.inviteId,endpoint:l}):"",b=[{label:t("team.inviting.link"),name:"inviteId",options:{sort:!1,customBodyRenderLite:e=>{const n=s[e];return l?o.jsx(U,{children:p(n)}):o.jsx(B,{size:16})}}},{label:t("common.role"),name:"role",widtn:70,options:{sort:!1,customBodyRender:e=>{const n=j.find(u=>u.name===e);return n?.title?o.jsx(D,{title:e,children:n.title}):e||"--"}}},{label:t("common.remark"),name:"remark",options:{sort:!1,customBodyRender:e=>e||"--"}},{label:t("team.inviting.inviter"),name:"inviter.fullName",options:{sort:!1,customBodyRender:(e,{rowIndex:n})=>s[n]?.inviter?.fullName}},{label:t("common.expires"),name:"expireDate",options:{sort:!1,customBodyRender:e=>o.jsx(w,{children:M(e).format("YYYY-MM-DD HH:mm")})}},{label:t("common.actions"),name:"",width:100,align:"center",options:{sort:!1,customBodyRenderLite:e=>{const n=s[e];return o.jsx(Q,{permission:d?"":"mutate_team",role:d?N:[],children:o.jsxs(S,{onClick:()=>m({title:t("team.inviting.delete.title"),description:t("team.inviting.delete.description",{link:p(n)}),confirm:t("common.delConfirm"),cancel:t("common.cancel"),onConfirm:()=>k(n),onCancel:R}),size:"small",color:"error",variant:"text",children:[o.jsx(L,{style:{fontSize:"1.2em"}}),t("common.delete")]})})}}}];return o.jsxs(_,{children:[s.length?o.jsx(T,{locale:y,data:[...s],columns:b,verticalKeyWidth:100,options:{download:!1,filter:!1,print:!1,search:!1,viewColumns:!1}}):o.jsx(Y,{sx:{minHeight:200},children:t("common.empty")}),i&&o.jsx(K,{title:i.title,description:i.description,confirm:i.confirm,cancel:i.cancel,params:i.params,onConfirm:i.onConfirm,onCancel:i.onCancel})]})}Z.propTypes={invitations:x.array,onRefresh:x.func};const _=H.div`
|
|
2
|
-
margin-top: -20px;
|
|
3
|
-
`;export{Z as I};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,a6 as w,ak as x}from"./vendor-mui-core-DnR6WYuU.js";import{g as v,q as k,b as p}from"./vendor-hooks-qxhUUbW5.js";import{I as T}from"./invitation-CVulfNR5.js";import{K as I}from"./landing-page-Bu1ZaLGu.js";import{V as P,a7 as j}from"./vendor-ux-jvAfFAl1.js";import{u as R,b as S,e as E,c as N,H as W}from"./index-NWCpUGtr.js";import{g as b}from"./get-safe-url-xl2OarvZ.js";import{c as C}from"./passport-BNRZfcVH.js";import{u as F}from"./vendor-react-CTtPmzVP.js";import"./vendor-utils-CxWN1dT3.js";import"./index-uODjznr3.js";import"./use-passport-id-B-b-_oYF.js";import"./session-5s-U-ruq.js";import"./sdk-C45BrgFy.js";import"./wrap-locale-qgV7mOv6.js";import"./index-CfA9D2iF.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-B1iA4v4a.js";import"./create-passport-svg-BKhJ2ufW.js";function Z(m){const{searchParams:r}=new URL(window.location.href),{api:a,session:f}=R(),d=F(),{t:u}=P(),n=r.get("id"),c=r.get("redirect"),h=v({state:""}),o=k(async()=>{if(!n)return null;const{data:t}=await a.get("/api/invitation",{params:{inviteId:n,mode:"issue-passport"}});return t}),l=p(()=>{if(o.error)throw o.error;return o?.data}),g=p(async(t,i=s=>s)=>{t&&(t.sessionToken&&S(i(t.sessionToken)),t.refreshToken&&E(i(t.refreshToken)),t.visitorId&&j(i(t.visitorId)),await f.refresh()),setTimeout(()=>{if(c){const s=decodeURIComponent(c);s.startsWith(N.WELLKNOWN_SERVICE_PATH_PREFIX)?d(s,{replace:!0}):window.location.href=b(s)}else window.location.href=window.env.pathPrefix||"/"},50)});return o.loading?e.jsx(w,{}):e.jsxs(I,{did:window.blocklet?.appPid,children:[e.jsx(W,{children:e.jsxs("title",{children:[u("pageTitle.issuePassport")," | ",window.blocklet?.appName]})}),e.jsx(x,{className:"page-invite",sx:{width:"560px",maxWidth:"100%",height:"100%"},children:e.jsx(T,{...m,action:"issue-passport",getDataFn:l,checkFn:a.get,createPassportSvg:C,onLoginSuccess:g,inService:!0,status:h.state})})]})}export{Z as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,T as v,bb as b,D as I,J as T,ak as t}from"./vendor-mui-core-DnR6WYuU.js";import{q as B,g as E,ad as P,$ as j,ac as A}from"./vendor-ux-jvAfFAl1.js";import{a as C}from"./vendor-hooks-qxhUUbW5.js";import{aa as M}from"./index-NWCpUGtr.js";function N({linkProps:s=void 0,showExtra:o=!1,...n}){return e.jsxs(v,{...n,children:["Powered by"," ",e.jsx(b,{href:"https://www.arcblock.io",target:"_blank",...s,children:"ArcBlock"}),"'s"," ",e.jsx(b,{href:"https://www.blocklet.io",target:"_blank",...s,children:"Blocklet Technology"}),o?", the decentralized web engine.":null]})}function W({did:s,children:o,title:n=void 0,description:a=void 0,actions:m=void 0,logo:i=void 0,logoSize:d=50,poweredBy:x=void 0,termsOfUse:g=void 0,standalone:y=!1}){const r=globalThis?.blocklet||globalThis?.env||{},{palette:f}=I(),c=T(l=>l.breakpoints.down("lg")),w=M({meta:r}),k=C(()=>{const l=r.appPid,u=B.isEthereumDid(l),z=u?void 0:E(l);return u?P(l):z.color},[r?.appPid]);if(!s)return o;n===void 0&&(n=r.appName),a===void 0&&(a=r.appDescription),i===void 0&&(i=w||""),typeof i=="string"&&(i?i=e.jsx(t,{sx:{height:d,maxHeight:d,objectFit:"contain"},component:"img",src:i,alt:`${r.appName}'s logo`}):i=e.jsx(j,{size:d,did:s,src:i,variant:"rounded"})),x===void 0&&(x=e.jsx(N,{linkProps:{color:f.text.secondary,sx:{"&:hover":{textDecoration:"underline"}}},showExtra:!c,sx:{textAlign:"center",fontSize:"12px",color:"text.secondary"}}));let p=o;!o&&!c&&(p=e.jsx(t,{sx:{filter:"blur(180px)",display:"flex"},children:e.jsx(j,{size:210,did:s,variant:"rounded"})}));const D=!!o;let h=!y;return c&&(h=!D),e.jsxs(t,{sx:{width:"100%",minHeight:"100vh",display:"flex",justifyContent:"center",alignItems:"center",px:{xs:2,sm:4,md:8},pt:{xs:2,sm:4,md:6},pb:{xs:5,md:8},background:`radial-gradient(circle at bottom right, ${A(k,.3)} 10%, ${f.background.default} 50%)`,position:"relative"},children:[e.jsxs(t,{sx:{maxWidth:1200,display:"flex",alignItems:"center",justifyContent:[h,p].filter(Boolean).length>1?"space-between":"center",width:"100%",margin:"auto"},children:[h?e.jsxs(t,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[e.jsx(t,{sx:{display:"flex",alignItems:"center"},children:i}),e.jsx(v,{variant:"h2",sx:{fontWeight:"bold",fontSize:{sm:"2.25rem",md:"2.75rem",xl:"3.5rem"}},children:n}),a?e.jsx(t,{sx:{mb:2,color:"text.secondary"},children:a}):null,m?e.jsx(t,{sx:{mt:8},children:m}):null,g?e.jsx(t,{sx:{mt:-1,color:"grey"},children:g}):null]}):null,p]}),e.jsx(t,{sx:{position:"absolute",zIndex:10,bottom:10,left:10,right:10,textAlign:"center"},children:x})]})}export{W as K};
|