@abtnode/blocklet-services 1.16.38-beta-20250127-092551-3bb6da3b → 1.16.38-beta-20250206-084543-4d7b4331

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.
Files changed (154) hide show
  1. package/api/socket/channel/did.js +2 -1
  2. package/dist/assets/{Add-0_yO_NcD.js → Add-DTHqaebJ.js} +1 -1
  3. package/dist/assets/{ArrowDropDown-CSe7vdhu.js → ArrowDropDown-DbyzWNvL.js} +1 -1
  4. package/dist/assets/{CheckCircle-C20J4AX-.js → CheckCircle-CFxGo9yf.js} +1 -1
  5. package/dist/assets/{ChevronLeft-CYpg5M_K.js → ChevronLeft-BfXQoYEz.js} +1 -1
  6. package/dist/assets/{ChevronRight-DORpkdoL.js → ChevronRight-CfoEIq_n.js} +1 -1
  7. package/dist/assets/{DeleteOutline-BaOxCgo3.js → DeleteOutline-BmH9ek4A.js} +1 -1
  8. package/dist/assets/{Done-Bsd0QwkQ.js → Done-EMi5bDwr.js} +1 -1
  9. package/dist/assets/{Download-BF8ec3kS.js → Download-Dhtefh1X.js} +1 -1
  10. package/dist/assets/{EditIcon-D6Lk4OxD.js → EditIcon-BGaX97FF.js} +1 -1
  11. package/dist/assets/{Error-CmnuwZkD.js → Error-Djqvk_X8.js} +1 -1
  12. package/dist/assets/{Google-F1HiAjHW.js → Google-MetxIaR3.js} +1 -1
  13. package/dist/assets/{InfoOutlined-DZAeG3v-.js → InfoOutlined-Bd6IN61C.js} +1 -1
  14. package/dist/assets/{Launch-DNY7Ut_B.js → Launch-DC2ZwJy0.js} +1 -1
  15. package/dist/assets/{LaunchOutlined-BUOyH9Rv.js → LaunchOutlined-CYryXNUL.js} +1 -1
  16. package/dist/assets/{LockIcon-BITD3hjp.js → LockIcon-BHLM_myO.js} +1 -1
  17. package/dist/assets/{Loop-gZ2g1v3i.js → Loop-Dwj655TP.js} +1 -1
  18. package/dist/assets/{MoreHoriz-CwoKs0Gg.js → MoreHoriz-B8ywH5RE.js} +1 -1
  19. package/dist/assets/{PlayArrow-C6dXJHO6.js → PlayArrow-vglCW7W4.js} +1 -1
  20. package/dist/assets/{QuestionMarkCircle-SCPzvU7T.js → QuestionMarkCircle-BDO28oyM.js} +1 -1
  21. package/dist/assets/{ServerLogo-DRTZsm8x.js → ServerLogo-D3ppBqIq.js} +1 -1
  22. package/dist/assets/{ViewList-DfGpYdZ-.js → ViewList-BEBx2X_O.js} +1 -1
  23. package/dist/assets/{access-control-DWS7Lowo.js → access-control-C15ttx-y.js} +1 -1
  24. package/dist/assets/{actions-BvtS-2sJ.js → actions-D-mxVcNU.js} +1 -1
  25. package/dist/assets/{add-component-core-DZPE4BRe.js → add-component-core-DNqTsrPg.js} +1 -1
  26. package/dist/assets/add-resource-C6AMLerq.js +1 -0
  27. package/dist/assets/{addon-CDVN9YCj.js → addon-_m1gJFAF.js} +1 -1
  28. package/dist/assets/analytics-DvHwLQn7.js +11 -0
  29. package/dist/assets/{ar-DV4YJwQy.js → ar-C89hW7LF.js} +1 -1
  30. package/dist/assets/{audit-logs-CJvI5okV.js → audit-logs-BCbtyCHg.js} +1 -1
  31. package/dist/assets/{base32-Bl4ek2bl.js → base32-BFfp490K.js} +1 -1
  32. package/dist/assets/{branding-CfeUWBA7.js → branding-D8S6jsa0.js} +2 -2
  33. package/dist/assets/{bundle-avatar-TEUPlhi2.js → bundle-avatar-C9ats955.js} +1 -1
  34. package/dist/assets/button-BmPwSTan.js +1 -0
  35. package/dist/assets/{click-to-copy-Ck4RKrL7.js → click-to-copy-_Hi7Yhx3.js} +1 -1
  36. package/dist/assets/{complete-CPnz5QUF.js → complete-DUg7uJ4N.js} +1 -1
  37. package/dist/assets/{component-Srk2_SVH.js → component-D1agqLE_.js} +1 -1
  38. package/dist/assets/{config-Cp3L8D_L.js → config-S6WZ6U3Y.js} +2 -2
  39. package/dist/assets/{config-navigation-a3GJWM1m.js → config-navigation-CMi0YByE.js} +6 -6
  40. package/dist/assets/{config-space-piVzY5c1.js → config-space-BtoXeFsn.js} +1 -1
  41. package/dist/assets/{config-kJZsVZD6.js → config-xTynYj5F.js} +1 -1
  42. package/dist/assets/{confirm-D7n9Rzfx.js → confirm-yYw8jeh5.js} +1 -1
  43. package/dist/assets/{connect-BZUv1d-6.js → connect-CT8urDCb.js} +1 -1
  44. package/dist/assets/{connect-rdXbvbmJ.js → connect-DMnZDuPy.js} +1 -1
  45. package/dist/assets/{connect-to-BzfmK9yx.js → connect-to-BtXA2Q7q.js} +1 -1
  46. package/dist/assets/{content-layout-CzrxMNjA.js → content-layout-DRV8Bqu8.js} +1 -1
  47. package/dist/assets/dashboard-D7xokuFw.js +217 -0
  48. package/dist/assets/{de-C2Y_05d1.js → de-BScxb0zD.js} +1 -1
  49. package/dist/assets/{did-address-CLeqbWiu.js → did-address-DL8dQh4X.js} +1 -1
  50. package/dist/assets/{domain-DgPzyf2N.js → domain-WlHroGqS.js} +1 -1
  51. package/dist/assets/{domain-list-BiYGOOY3.js → domain-list-CID5R830.js} +2 -2
  52. package/dist/assets/{email-5azpRba_.js → email-XNK7Gwt2.js} +1 -1
  53. package/dist/assets/{es-DPVOSPPn.js → es-B9f-yiTL.js} +1 -1
  54. package/dist/assets/{exchange-passport-Cus1rYsJ.js → exchange-passport-BkvQV3O8.js} +1 -1
  55. package/dist/assets/{form-text-input-Cf1j6PeI.js → form-text-input-B1uYH91s.js} +2 -2
  56. package/dist/assets/{fr-C8dIIOc9.js → fr-BguXQaFu.js} +1 -1
  57. package/dist/assets/{fuel-BaqDy7AE.js → fuel-uFxFD3IR.js} +1 -1
  58. package/dist/assets/{fullpage-Dx8PYbvz.js → fullpage-Dc1dR2nf.js} +1 -1
  59. package/dist/assets/{get-safe-url-BF9qL1PD.js → get-safe-url-B9qOA7gB.js} +1 -1
  60. package/dist/assets/{get-safe-url-BsKINLVF.js → get-safe-url-BTwyxtCV.js} +1 -1
  61. package/dist/assets/{hi-C5r4WQDs.js → hi-7nPwxLb7.js} +1 -1
  62. package/dist/assets/{home-D42zu2I_.js → home-BfUTLxOL.js} +1 -1
  63. package/dist/assets/{id-BQK45J6o.js → id-gU7ysJNs.js} +1 -1
  64. package/dist/assets/{iframe-Cn--d9nR.js → iframe-CDk6_C57.js} +1 -1
  65. package/dist/assets/{index-6oQLUjq6.js → index-1NdG9dcQ.js} +7 -7
  66. package/dist/assets/index-BBlaG9rd.js +77 -0
  67. package/dist/assets/{index-DpNGP1ih.js → index-BNjqST1U.js} +12 -12
  68. package/dist/assets/{index-CXVY5UoP.js → index-BQ9qcXAM.js} +7 -7
  69. package/dist/assets/{index-C0uUrAqS.js → index-BzpSavwm.js} +1 -1
  70. package/dist/assets/{index-DpOEjWGx.js → index-C8bsu4NM.js} +1 -1
  71. package/dist/assets/index-CEYigfYv.js +228 -0
  72. package/dist/assets/{index-BgGF6utP.js → index-CIjk07iX.js} +2 -2
  73. package/dist/assets/{index-CEbjBHHi.js → index-CKIpILov.js} +1 -1
  74. package/dist/assets/{index-BvLMNAG0.js → index-CeDgfE-R.js} +1 -1
  75. package/dist/assets/{index-BDfZ8xEV.js → index-D0faGVLi.js} +3 -3
  76. package/dist/assets/{index-D5mFr1eo.js → index-D4b-IulH.js} +1 -1
  77. package/dist/assets/index-DBoRYbIw.js +1 -0
  78. package/dist/assets/{index-DE_r-gh_.js → index-DGE6IUiK.js} +1 -1
  79. package/dist/assets/{index-CFT-L0SZ.js → index-DUqnq1p0.js} +1 -1
  80. package/dist/assets/{index-kk2gduJr.js → index-DX_lvtWO.js} +1 -1
  81. package/dist/assets/{index-CKsz_iVM.js → index-Hq7kqq19.js} +1 -1
  82. package/dist/assets/{index-uosYiNLl.js → index-QX3ZQRUn.js} +16 -16
  83. package/dist/assets/{index-DTzPwoh8.js → index-cBCi42Bf.js} +1 -1
  84. package/dist/assets/{invitation-DpOgzXor.js → invitation-BkpzegkF.js} +1 -1
  85. package/dist/assets/{invite-DmpCzOPN.js → invite-DSfHEBpk.js} +1 -1
  86. package/dist/assets/{issue-passport--83QQUn2.js → issue-passport-DRO3fhhX.js} +1 -1
  87. package/dist/assets/{item-7Z8_UB5K.js → item-D9PJoNKZ.js} +1 -1
  88. package/dist/assets/{ja-DsJERrpD.js → ja-C4BURK37.js} +1 -1
  89. package/dist/assets/{ko-t760ZSCl.js → ko-CeKzLbt8.js} +1 -1
  90. package/dist/assets/{launch-result-message-C_UhVRcl.js → launch-result-message-0WH2fKJs.js} +1 -1
  91. package/dist/assets/{layout-Dv_7-Fpq.js → layout-KUVrIKnH.js} +1 -1
  92. package/dist/assets/list-BmQp9JBM.js +160 -0
  93. package/dist/assets/{list-header-CfBPZZEw.js → list-header-Cm2JzuBu.js} +1 -1
  94. package/dist/assets/localization-BUyqSLbi.js +1 -0
  95. package/dist/assets/{log-CNjGA-yl.js → log-VT6HCVkp.js} +2 -2
  96. package/dist/assets/{login-DWrSz67b.js → login-BXw8BSYh.js} +1 -1
  97. package/dist/assets/{login-oauth-callback-VNeZxFH0.js → login-oauth-callback-D_ULXKRT.js} +1 -1
  98. package/dist/assets/{logo-uploader-DZm2nb0s.js → logo-uploader-B0QGvHYx.js} +5 -5
  99. package/dist/assets/{lost-passport-DFh2B6Gl.js → lost-passport-CMs5A43o.js} +1 -1
  100. package/dist/assets/{open-window-BvyLumiN.js → open-window-DFVq0Vka.js} +1 -1
  101. package/dist/assets/{overview-DNQZ-tgj.js → overview-JoUamf5H.js} +2 -2
  102. package/dist/assets/{page-header-CJHCTtBc.js → page-header-B2kRYRXR.js} +1 -1
  103. package/dist/assets/{permission-B0xKCybj.js → permission-CtM69wEM.js} +1 -1
  104. package/dist/assets/{preferences-BMgF6Djl.js → preferences-BI2Qy7wd.js} +1 -1
  105. package/dist/assets/{pt-BkjUa7uv.js → pt-o1EeyLhb.js} +1 -1
  106. package/dist/assets/publish-resource-D5Rx9baz.js +1 -0
  107. package/dist/assets/{react-beautiful-dnd.esm-DY38RjFx.js → react-beautiful-dnd.esm-C6Cs2eu-.js} +1 -1
  108. package/dist/assets/{relative-time-C36uWHLw.js → relative-time-D_pFZIBd.js} +1 -1
  109. package/dist/assets/{ru-1WsQFvuL.js → ru-BlfgKyTj.js} +1 -1
  110. package/dist/assets/sdk-DCjm9lEU.js +1 -0
  111. package/dist/assets/session-BTTAIWAT.js +1 -0
  112. package/dist/assets/{setup-lHrzljce.js → setup-C_n4S096.js} +3 -3
  113. package/dist/assets/{shorten-label-CYJeMT7h.js → shorten-label-BPVcqm_d.js} +1 -1
  114. package/dist/assets/{simple-select-CAyDBkK6.js → simple-select-Bly6GilY.js} +1 -1
  115. package/dist/assets/{slicedToArray-CV571vyX.js → slicedToArray--pkkXr1E.js} +2 -2
  116. package/dist/assets/{start-DNIWxyMi.js → start-B0Bo1ke7.js} +1 -1
  117. package/dist/assets/{step-actions-BYFwIhu4.js → step-actions-BdvB3K8O.js} +1 -1
  118. package/dist/assets/{studio-DBfgF1ck.js → studio-DADXtyow.js} +1 -1
  119. package/dist/assets/{switch-control-B8wYzo2_.js → switch-control-3273Ci8c.js} +1 -1
  120. package/dist/assets/{th-CecKmVWf.js → th-BHBtH1Zl.js} +1 -1
  121. package/dist/assets/{traffic-1TtyUzFO.js → traffic-CG1Pxqmj.js} +1 -1
  122. package/dist/assets/{transfer-Bh7VQuKL.js → transfer-O3YQ6b4a.js} +1 -1
  123. package/dist/assets/{unsubscribe-C_eX2N6S.js → unsubscribe-Dx2vvXHo.js} +1 -1
  124. package/dist/assets/{use-mobile-Bk8quGt9.js → use-mobile-CtFE3PKN.js} +1 -1
  125. package/dist/assets/{useAsyncRetry-EMRT9Ldq.js → useAsyncRetry-DO0NcRB-.js} +1 -1
  126. package/dist/assets/{useLocalStorage-tmIJr51I.js → useLocalStorage-BiHNUBhw.js} +1 -1
  127. package/dist/assets/user-center-LYxpEnYV.js +71 -0
  128. package/dist/assets/{util-BY6uUuCk.js → util-CB4v94Ia.js} +1 -1
  129. package/dist/assets/{util-CtKeCk_N.js → util-lgEyE78l.js} +1 -1
  130. package/dist/assets/{vendor-arcblock-Bf7AGBSd.js → vendor-arcblock-ZjreIevk.js} +3 -3
  131. package/dist/assets/{vendor-mui-core-CCMNKHtm.js → vendor-mui-core-DHnPlNQK.js} +8 -8
  132. package/dist/assets/{vendor-mui-x-DmPVvZFJ.js → vendor-mui-x-BcCkWIwf.js} +1 -1
  133. package/dist/assets/{vi-CDrTp7No.js → vi-CuGQRG8r.js} +1 -1
  134. package/dist/assets/wrap-locale-dvgNAAzE.js +1 -0
  135. package/dist/assets/zh-DfOtp2w7.js +4 -0
  136. package/dist/assets/{zh-tw-CUyoe2CD.js → zh-tw-DFpaHA6Z.js} +1 -1
  137. package/dist/index.html +3 -3
  138. package/dist/service-worker.js +1 -1
  139. package/package.json +21 -21
  140. package/dist/assets/add-resource-CYNZTaOG.js +0 -1
  141. package/dist/assets/analytics-0lVXNyXs.js +0 -11
  142. package/dist/assets/button-CzSgwkGN.js +0 -1
  143. package/dist/assets/dashboard-B_hsqmQK.js +0 -86
  144. package/dist/assets/index-BWKYj-2X.js +0 -228
  145. package/dist/assets/index-CSkA6M4K.js +0 -1
  146. package/dist/assets/index-fel1gHRy.js +0 -61
  147. package/dist/assets/list-yjVo8vxH.js +0 -160
  148. package/dist/assets/localization-CRwVeETn.js +0 -1
  149. package/dist/assets/publish-resource-B_OOg2Om.js +0 -1
  150. package/dist/assets/sdk-VtyRZZVE.js +0 -1
  151. package/dist/assets/session-DutPZhUI.js +0 -1
  152. package/dist/assets/user-center-pv7oyGUu.js +0 -71
  153. package/dist/assets/wrap-locale-BjJvyHQM.js +0 -1
  154. package/dist/assets/zh-Bqr2c2To.js +0 -4
@@ -1,61 +0,0 @@
1
- import{r as f}from"./vendor-react-D-afvo_7.js";import{j as e,a1 as xe,E as x,a4 as Te,T as k,a3 as y,aa as ce,A as ue,a2 as ne,ah as De,aj as be,x as Se,R as Ae,V as Ee,bD as Ie,cn as Le,cl as ke,aN as Oe,bJ as Pe}from"./vendor-mui-core-CCMNKHtm.js";import{b as M,z as Fe,A as ze,ap as ae}from"./vendor-utils-5TjOM6td.js";import{b as z,j as q,_ as ye,ay as W,e as V,a5 as _e,bg as Be,B as Ke,aR as We,bv as qe}from"./vendor-arcblock-Bf7AGBSd.js";import{y as Ue,E as L,m as $e,G as fe}from"./index-uosYiNLl.js";import{b as re}from"./dashboard-B_hsqmQK.js";import{d as Q}from"./vendor-hooks-BKxTDk_P.js";import{p as Me}from"./util-BY6uUuCk.js";import{W as Ve}from"./did-address-CLeqbWiu.js";import{S as X}from"./shorten-label-CYJeMT7h.js";import{c as me}from"./index-DoZ2YM4T.js";import{a as He}from"./list-yjVo8vxH.js";import{D as Ge,g as Je}from"./traffic-1TtyUzFO.js";import{R as Qe}from"./relative-time-C36uWHLw.js";import{B as Xe}from"./bundle-avatar-TEUPlhi2.js";import{B as Ye}from"./index-CSkA6M4K.js";import"./useLocalStorage-tmIJr51I.js";import"./confirm-D7n9Rzfx.js";import"./format-error-C0Ke3VXF.js";import"./PlayArrow-C6dXJHO6.js";import"./get-safe-url-BsKINLVF.js";import"./session-DutPZhUI.js";import"./useAsyncRetry-EMRT9Ldq.js";import"./useAsync-Ua5iss51.js";import"./useSetState-Crt4S51m.js";import"./index-DE_r-gh_.js";import"./InfoOutlined-DZAeG3v-.js";import"./iframe-Cn--d9nR.js";import"./LaunchOutlined-BUOyH9Rv.js";import"./ChevronLeft-CYpg5M_K.js";import"./ChevronRight-DORpkdoL.js";import"./index-D5mFr1eo.js";import"./vendor-mui-x-DmPVvZFJ.js";const je=f.createContext({}),{Provider:Ze,Consumer:ss}=je;function et({children:t,blocklet:i=""}){const{api:o,inService:u,ws:{useSubscription:d}}=Ue(),[c,p]=f.useState([]),[S,w]=f.useState({total:0,pageSize:20,pageCount:0,page:1}),[b,E]=f.useState(!1),T=Q(()=>{var C;return(C=i.meta)==null?void 0:C.did},[i]),[_,D]=f.useState({}),B=async({page:C=1,pageSize:h=20,...v}={})=>{if(!(b||!T))try{E(!0);const R={paging:{page:C,pageSize:h},...v,userName:v.searchText||"",teamDid:T,dateRange:v.dateRange?[L(v.dateRange[0]).toISOString(),L(v.dateRange[1]).toISOString()]:void 0},P=await o.getNotificationSendLog({input:R});D(R);const F=P.list.map(K=>({...K,receiverUser:{...K.receiverUser,avatar:Me(K.receiverUser.avatar,T,u)}}));p(F),w(P.paging),E(!1)}catch(R){q.error(R.message),E(!1)}},O=f.useCallback(C=>{const h=i.children.find(v=>{var R;return((R=v.meta)==null?void 0:R.did)===C});if(h)return h.ancestors=[i],h},[i]),m=async({notificationReceiverIds:C,channels:h,...v})=>{await o.resendNotification({input:{teamDid:T,notificationReceiverIds:C,channels:h.map(R=>R==="wallet"?z.NOTIFICATION_SEND_CHANNEL.WALLET:R==="pushKit"?z.NOTIFICATION_SEND_CHANNEL.PUSH:R),...v}})},j=f.useCallback(async C=>(await o.getUser({input:{teamDid:T,user:{did:C}}})).user,[o,T]);d(`${z.EVENTS.NOTIFICATION_BLOCKLET_CREATE}`,C=>{C&&B(_)},[_]);const N={loading:b,fetch:B,data:c,paging:S,blocklet:i,getComponent:O,resendNotification:m,getUser:j};return e.jsx(Ze,{value:{notificationRecords:N},children:t})}function Re(){const{notificationRecords:t}=f.useContext(je);return t}var de={},tt=xe;Object.defineProperty(de,"__esModule",{value:!0});var Ce=de.default=void 0,st=tt(ye()),nt=e;Ce=de.default=(0,st.default)((0,nt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12m8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8"}),"Block");var pe={},at=xe;Object.defineProperty(pe,"__esModule",{value:!0});var we=pe.default=void 0,it=at(ye()),ot=e;we=pe.default=(0,it.default)((0,ot.jsx)("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"CheckCircleOutline");const rt=(t,i,o="")=>{if(!o||!i)return"";switch(o){case z.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:i});case z.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:i});case z.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:i});case z.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return o}};function ee(t,i,o={}){const{status:u,updatedAt:d,reason:c="",channel:p="wallet"}=o,S=d?t("notification.sendStatus.sentTime",{date:$e(d,i)}):"",w=rt(t,p,c);return u===z.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:S,reason:w}:u===z.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:S}:{status:"unsent",title:t("notification.sendStatus.unsent"),reason:w,sentTime:S}}const he={unsent:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},le=["wallet","pushKit","email"],lt=(t,i)=>{var d,c;const{settings:o}=t,u=M(i,"extra.notifications.email",!0);return{available:(c=(d=o==null?void 0:o.notification)==null?void 0:d.email)==null?void 0:c.enabled,enabled:u}},ct=(t,i)=>{var d,c;const{settings:o}=t,u=M(i,"extra.notifications.push",!0);return{available:(c=(d=o==null?void 0:o.notification)==null?void 0:d.pushKit)==null?void 0:c.enabled,enabled:u}},ut=t=>({enabled:M(t,"extra.notifications.wallet",!0)}),dt=t=>({enabled:M(t,"extra.webhooks",[]).length>0}),ge=(t=3e3)=>new Promise(i=>{setTimeout(()=>{i()},t)}),pt=(t,i)=>i==="wallet"||i==="webhook"?[{channel:i,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:i}),fail:t("notification.sendStatus.reason.disabled",{channel:i})}]:i==="pushKit"||i==="email"?[{channel:i,type:"available",pass:t("notification.sendStatus.reason.available",{channel:i}),fail:t("notification.sendStatus.reason.unavailable",{channel:i})},{channel:i,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:i}),fail:t("notification.sendStatus.reason.disabled",{channel:i})}]:[],ft=t=>{const i={},o=L().startOf("day");le.forEach(c=>{const p=`${c}SendRecord`,w=M(t,p,[]).filter(b=>L(b.sendAt).isSame(o,"day")).length;i[c]=w});const u=M(t,"webhook",{}),d=Object.keys(u??{})??[];return d.length>0&&d.forEach(c=>{const S=(u[c]??[]).filter(w=>L(w.sendAt).isSame(o,"day")).length;i[c]=S}),i};function U({config:t,enableTooltip:i=!0}){const{status:o,title:u="",sentTime:d="",reason:c=""}=t,p=[u,c].filter(Boolean).join(", ");return e.jsx(Te,{title:i?e.jsxs(e.Fragment,{children:[e.jsx(k,{color:"inherit",sx:{fontSize:12},children:p}),e.jsx("span",{children:d})]}):null,arrow:!0,placement:"top",children:e.jsxs(y,{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center",children:[e.jsx(y,{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:he[o],style:{opacity:.15}}),e.jsx(y,{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:he[o]})]})})}U.propTypes={config:x.object.isRequired,enableTooltip:x.bool};U.defaultProps={enableTooltip:!0};ve.propTypes={notification:x.object.isRequired,onCancel:x.func,blocklet:x.object.isRequired,resendChannel:x.array,refresh:x.func};function ve({notification:t,onCancel:i=()=>{},blocklet:o,resendChannel:u="",refresh:d=()=>{}}){const{t:c,locale:p}=V(),{getComponent:S,resendNotification:w,getUser:b}=Re(),[E,T]=f.useState([]),[_,D]=f.useState([]),[B,O]=f.useState(null),[m,j]=f.useState(null),N=f.useRef({}),C=Q(()=>S(t.componentId)||o,[o,t.componentId]),h=Q(()=>{var r;return(r=t==null?void 0:t.receivers)==null?void 0:r[0]},[t.receivers]),v=Q(()=>ft(h),[h]),R=f.useCallback(async r=>{const{receiver:s}=h??{};if(!s)return!1;const n=await b(s);return n?r==="wallet"?ut(n):r==="email"?lt(o,n):r==="pushKit"?ct(o,n):r==="webhook"?dt(n):!0:!1},[h,b,o]);f.useEffect(()=>{if(!h)T([]);else{const r=le.map(n=>{const a=h[`${n}SendStatus`],l=h[`${n}SendAt`],g=h[`${n}SendFailedReason`],A=ee(c,p,{status:a,updatedAt:l,reason:g,channel:n});return{type:n,extra:A}});T(r);const s=(h==null?void 0:h.webhook)||{};D(Object.entries(s))}},[h,p,c]);const P=f.useCallback(async(r,s="")=>{const{id:n}=h??{};if(n)try{await w({notificationReceiverIds:[n],channels:[r],...r==="webhook"&&s?{webhookUrls:[s]}:{}}),q.success("Message has been sent!"),r!=="webhook"&&(await ge(1e3),O(null))}catch(a){console.error("handleResend error",{error:a}),q.error(a.response?a.response.statusText:a.message)}},[w,h]),F=async(r,s)=>{if(s==null||s.stopPropagation(),v[r.type]>=4){q.warning(c("notification.resendLimit"));return}if(s&&O(s==null?void 0:s.currentTarget),j({channel:r.type}),!(!r||r.checking)){T(a=>a.map(l=>r.type===l.type?{...l,checking:!0}:l));try{const a=await R(r.type);await ge(),j({channel:r.type,result:a}),(typeof a=="boolean"&&a||Fe(a)&&Object.values(a).every(l=>!!l))&&(await P(r.type),d()),T(l=>l.map(g=>r.type===g.type?{...g,checking:!1}:g))}catch(a){console.error("handleResend error",{error:a})}}},K=async(r,s=null)=>{if(s==null||s.stopPropagation(),v[r]>=4){q.warning(c("notification.resendLimit"));return}D(a=>a.map(l=>r===l[0]?[...l.slice(0,2),!0]:l));try{await P("webhook",r),D(a=>a.map(l=>r===l[0]?[...l.slice(0,2),!0]:l)),d()}catch(a){console.error("handleResend error",{error:a})}};f.useEffect(()=>{u&&setTimeout(()=>{const r=N.current[u];r&&(le.includes(u)?(O(r),F({type:u})):K(u))},500)},[u]);const te=()=>{O(null)},$=f.useCallback(r=>pt(c,r),[c]),G=!!B,se=G?"check-resend-popover":void 0;return e.jsx(_e,{title:c("notification.notificationDetails"),onClose:i,open:!0,PaperProps:{style:{maxWidth:832,maxHeight:"80vh"}},fullWidth:!0,actionsPosition:"left",children:e.jsxs(mt,{children:[e.jsx(He,{notification:t,blocklet:C}),E.length>0&&e.jsx(y,{className:"notification-resend-section",display:"flex",flexDirection:"column",gap:1,children:E.map(r=>e.jsxs(y,{className:"channel-item",children:[e.jsx(ue,{size:"small",label:e.jsxs(y,{color:"inherit",sx:{fontSize:12,display:"flex",alignItems:"center"},children:[e.jsxs(k,{component:"span",style:{display:"inline-block",fontSize:12,textTransform:"capitalize",fontWeight:500,marginRight:4},children:[r.type,":"," "]}),e.jsxs(y,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:[e.jsx(U,{config:r.extra}),e.jsx("span",{children:r.extra.title})]})]})},r.type),r.extra.status!=="success"&&e.jsxs(k,{ref:s=>{N.current[r.type]=s},component:"span",sx:{color:W.primary.main},className:me("resend-btn",{disabled:r.checking||v[r.type]>=4}),onClick:s=>F(r,s),children:[r.checking?e.jsx(ne,{size:12,sx:{color:W.primary.main}}):e.jsx(re,{}),e.jsx("span",{style:{marginLeft:4},children:c("notification.resend")})]})]},r.type))}),_.length>0&&e.jsxs(y,{className:"webhook-section",sx:{paddingLeft:"56px"},children:[e.jsx(De,{textAlign:"left",sx:{mt:1,mb:1},children:"Webhook"}),e.jsx(y,{className:"notification-resend-section",display:"flex",flexDirection:"column",gap:1,style:{paddingLeft:0},children:_.map(([r,s,n])=>{const a=s[0],l=ee(c,p,{...a,updatedAt:a.sendAt,reason:a.failedReason,channel:"webhook"});return e.jsxs(y,{className:"channel-item",display:"flex",alignItems:"center",sx:{gap:"4px",fontSize:12},children:[e.jsx(X,{maxLength:30,children:r}),e.jsxs(y,{display:"flex",alignItems:"center",sx:{gap:"4px"},children:[e.jsx(U,{config:l}),e.jsx("span",{children:l.title})]}),l.status!=="success"&&e.jsxs(k,{ref:g=>{N.current[r]=g},component:"span",sx:{color:W.primary.main},className:me("resend-btn",{disabled:n||v[r]>=4}),onClick:g=>K(r,g),children:[n?e.jsx(ne,{size:12,sx:{color:W.primary.main}}):e.jsx(re,{}),e.jsx("span",{style:{marginLeft:4},children:c("notification.resend")})]})]},r)})})]}),e.jsx(be,{id:se,open:G,anchorEl:B,onClose:te,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(ht,{children:[e.jsxs(k,{variant:"body1",component:"div",className:"check-title",children:[m==null?void 0:m.channel," Checking"]}),e.jsx(y,{display:"flex",flexDirection:"column",sx:{gap:"4px"},children:$(m==null?void 0:m.channel).map(r=>{var l,g;const{type:s,pass:n,fail:a}=r;return!(m!=null&&m.result)||(l=m==null?void 0:m.result)!=null&&l[s]?e.jsxs(k,{variant:"body1",component:"div",className:"check-item",display:"flex",alignItems:"center",sx:{gap:"4px",color:(g=m==null?void 0:m.result)!=null&&g[s]?W.success.main:"inherit"},children:[m!=null&&m.result?e.jsx(we,{}):e.jsx(ne,{size:12,sx:{color:W.primary.main}}),e.jsx("span",{children:n})]},s):e.jsxs(k,{variant:"body1",component:"div",display:"flex",alignItems:"center",className:"check-item",sx:{gap:"4px",color:W.error.main},children:[e.jsx(Ce,{}),e.jsx("span",{children:a})]},s)})})]})})]})})}const mt=ce.div`
2
- & > .notification-row {
3
- padding: 0;
4
- }
5
-
6
- .notification-resend-section {
7
- padding-left: 56px;
8
- .channel-item {
9
- display: flex;
10
- padding: 4px;
11
- justify-content: flex-start;
12
- align-items: center;
13
- gap: 8px;
14
- > p {
15
- font-size: 15px;
16
- }
17
- .resend-btn {
18
- svg {
19
- font-size: 16px;
20
- }
21
- display: flex;
22
- align-items: center;
23
- font-size: 12px;
24
- cursor: pointer;
25
- &.disabled {
26
- cursor: not-allowed;
27
- color: ${W.text.disabled};
28
- }
29
- }
30
- }
31
- }
32
- `,ht=ce.div`
33
- padding: 8px 16px;
34
- .check-title {
35
- font-weight: 500;
36
- margin-bottom: 8px;
37
- &::first-letter {
38
- text-transform: uppercase;
39
- }
40
- }
41
- .check-item {
42
- svg {
43
- font-size: 16px;
44
- }
45
- font-size: 12px;
46
- }
47
- `;Ne.propTypes={value:x.array.isRequired,onChange:x.func};function Ne({value:t,onChange:i}){const{locale:o}=V(),u=L().toDate(),[d,c]=f.useState(null),p=f.useCallback(b=>{c(d?null:b.currentTarget)},[d]),S=!!d,w=f.useCallback(b=>{if(!b.startDate||!b.endDate){q.error("Please select a date range");return}if(L(b.startDate).isAfter(b.endDate)||!L(b.startDate).isValid()||!L(b.endDate).isValid()){q.error("Invalid date range");return}i([b.startDate,b.endDate]),c(null)},[i]);return e.jsxs("div",{children:[e.jsx(k,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},mb:0,children:e.jsxs(Se,{onClick:p,variant:"outlined",size:"small",color:"inherit",children:[fe(t[0],o)," - ",fe(t[1],o)]})}),e.jsx(be,{open:S,anchorEl:d,onClose:()=>{c(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Ge,{open:!0,maxDate:u,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:p,definedRanges:Je(u),onChange:w})})]})}const gt=["receiver","data","createdAt","walletSendStatus","pushKitSendStatus","emailSendStatus"],xt=()=>Ae({components:{MuiPopover:{styleOverrides:{root:{"& .MuiPaper-root:has(.filter-container)":{width:"420rpx"}}}}}}),ie=(t,i,o)=>(t[o].splice(i,1),t),oe=(t,i)=>i.length?!i.includes(t):!1;function bt({label:t}){return e.jsx(ue,{label:t,variant:"outlined"})}function St(t){var u;const{t:i}=V();return!((u=t==null?void 0:t.filterList)!=null&&u.filter(d=>d.length).length)?null:e.jsxs(y,{display:"flex",gap:1,alignItems:"center",children:[e.jsx("div",{className:"toolbar-filter-title",children:i("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(qe.TableFilterList,{...t,ItemComponent:bt})})]})}H.propTypes={status:x.number.isRequired,updatedAt:x.string.isRequired,reason:x.string,channel:x.string,onResend:x.func};function H({status:t,updatedAt:i,reason:o="",channel:u="wallet",onResend:d}){const{t:c,locale:p}=V(),S=ee(c,p,{status:t,updatedAt:i,reason:o,channel:u});return e.jsxs(y,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(U,{config:S}),e.jsx(k,{color:"inherit",sx:{fontSize:12},children:S.title}),S.status!=="success"&&e.jsx(Se,{className:"resend-btn",size:"small",startIcon:e.jsx(re,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2rpx"}},onClick:d,children:c("notification.resend")})]})}Y.propTypes={filterList:x.array.isRequired,onChange:x.func.isRequired,index:x.number.isRequired,column:x.object.isRequired,statusFilterValues:x.array.isRequired,label:x.string.isRequired};function Y({filterList:t,onChange:i,index:o,column:u,statusFilterValues:d,label:c}){return e.jsxs(Ie,{className:"filter-container",children:[e.jsx(Le,{component:"legend",children:c}),e.jsx(ke,{row:!0,children:d.map(p=>{const S={status:p.status};return e.jsx(Oe,{control:e.jsx(Pe,{checked:t[o].indexOf(p.value)>-1,onChange:w=>{w.target.checked?t[o].push(p.value):t[o]=t[o].filter(b=>b!==p.value),i(t[o],o,u)},name:p.value}),label:e.jsxs("span",{style:{display:"flex",alignItems:"center"},children:[e.jsx(U,{enableTooltip:!1,config:S}),p.label]})},p.value)})})]})}Z.propTypes={list:x.array.isRequired,label:x.string.isRequired,onDelete:x.func.isRequired};function Z({list:t,label:i,onDelete:o}){const{t:u,locale:d}=V();return e.jsxs(y,{display:"flex",gap:1,alignItems:"center",children:[e.jsxs(k,{children:[i,": "]}),t.map(c=>{const p=ee(u,d,{status:c});return e.jsx(ue,{size:"small",label:e.jsxs(y,{display:"flex",alignItems:"center",sx:{gap:"4rpx"},children:[e.jsx(U,{config:p,enableTooltip:!1}),e.jsx("span",{children:p.title})]}),onDelete:S=>o(S,c)},c)})]})}function yt(){var r;const{t,locale:i}=V(),{data:o,paging:u,loading:d,blocklet:c,fetch:p,getComponent:S}=Re(),w=f.useRef(null),[b,E]=f.useState(null),[T,_]=f.useState([]),[D,B]=f.useState(gt),O=`notification-records-${(r=c.meta)==null?void 0:r.did}`,m=Be(O),[j,N]=f.useState({searchText:m.searchText||"",pageSize:m.rowsPerPage||10,page:m.page?m.page+1:1,walletSendStatus:m.walletSendStatus||[],pushKitSendStatus:m.pushKitSendStatus||[],emailSendStatus:m.emailSendStatus||[],dateRange:m.dateRange||[L().subtract(1,"month").startOf("day").toDate(),L().endOf("day").toDate()]}),C=f.useCallback(s=>{const{notification:n}=s,a=ze(s,"notification");return a.read=!0,n.receivers=[a],n},[]),h=f.useCallback(s=>{const n=C(s);E(n)},[C]);f.useEffect(()=>{p(j)},[j]),f.useEffect(()=>{E(s=>{if(!s)return null;const n=o.find(a=>a.notification.id===s.id);return n?h(n):s})},[o,h]);const v=({page:s,rowsPerPage:n,searchText:a,filterList:l})=>{const[,,,g=[],A=[],J=[]]=l;j.pageSize!==n?N(I=>({...I,pageSize:n,page:1})):j.page!==s+1?N(I=>({...I,page:s+1})):j.searchText!==a?N(I=>({...I,searchText:a,page:1})):ae(j.walletSendStatus,g)?ae(j.pushKitSendStatus,A)?ae(j.emailSendStatus,J)||N(I=>({...I,emailSendStatus:J,page:1})):N(I=>({...I,pushKitSendStatus:A,page:1})):N(I=>({...I,walletSendStatus:g,page:1}))},R=[{label:t("notification.sendStatus.unsent"),value:0,status:"unsent"},{label:t("notification.sendStatus.success"),value:1,status:"success"},{label:t("notification.sendStatus.failed"),value:2,status:"failed"}],P=(s,n,a,l)=>{s.stopPropagation();const g=a.filter(A=>A!==n);N(A=>({...A,[l]:g,page:1}))},F=(s,n,a)=>{s.stopPropagation();const l=C(n);E(l),_(a)},K=()=>{E(null),_("")},te=f.useCallback(()=>{p(j)},[p,j]),$=[{label:t("notification.receiver"),name:"receiver",width:200,options:{filter:!1,display:D.includes("receiver"),customBodyRenderLite:s=>{const{receiverUser:n,receiver:a}=o[s];return n?e.jsxs(y,{"data-cy":`member-name-${n.fullName}`,display:"flex",alignItems:"center",gap:2,justifyContent:"flex-start",children:[e.jsx(Ke,{src:`${n.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:a,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(X,{children:n.fullName})]},a):e.jsx(Ve,{size:14,responsive:!1,compact:!0,copyable:!1,did:a})}}},{label:t("notification.notificationPreview"),name:"data",width:300,options:{filter:!1,display:D.includes("data"),customBodyRenderLite:s=>{const n=o[s],{notification:a}=n,l=S(a.componentDid);return e.jsxs(y,{display:"flex",alignItems:"center",gap:1,onClick:g=>{g.stopPropagation(),h(n)},children:[l?e.jsx(Xe,{size:32,blocklet:l,ancestors:l.ancestors??[]}):e.jsx(Ye,{blocklet:c,size:32}),e.jsx(X,{maxLength:50,children:a.title})]})}}},{label:t("common.createdAt"),name:"createdAt",width:200,options:{filter:!1,display:D.includes("createdAt"),customBodyRenderLite:s=>{const{createdAt:n}=o[s];return e.jsx(Qe,{value:n,locale:i,shouldUpdate:!0})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{display:D.includes("walletSendStatus"),setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:j.walletSendStatus??[],customFilterListOptions:{render:s=>e.jsx(Z,{list:s,label:"Wallet",onDelete:(n,a)=>{n.stopPropagation(),P(n,a,$[3].options.filterList,"walletSendStatus")}}),update:ie},filterOptions:{names:R,fullWidth:!0,logic:oe,display:(s,n,a,l)=>e.jsx(Y,{label:"Wallet",filterList:s,onChange:n,index:a,column:l,statusFilterValues:R})},customBodyRenderLite:s=>{const{walletSendStatus:n,walletSendAt:a,walletSendFailedReason:l}=o[s];return e.jsx(H,{status:n,updatedAt:a,reason:l,channel:"wallet",onResend:g=>F(g,o[s],"wallet")})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{display:D.includes("pushKitSendStatus"),setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:s=>{const{pushKitSendStatus:n,pushKitSendAt:a,pushKitSendFailedReason:l}=o[s];return e.jsx(H,{status:n,updatedAt:a,reason:l,channel:"pushkit",onResend:g=>F(g,o[s],"pushKit")})},filter:!0,filterType:"custom",filterList:j.pushKitSendStatus??[],customFilterListOptions:{render:s=>e.jsx(Z,{list:s,label:"PushKit",onDelete:(n,a)=>{n.stopPropagation(),P(n,a,$[4].options.filterList,"pushKitSendStatus")}}),update:ie},filterOptions:{names:R,fullWidth:!0,logic:oe,display:(s,n,a,l)=>e.jsx(Y,{label:"PushKit",filterList:s,onChange:n,index:a,column:l,statusFilterValues:R})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),display:D.includes("emailSendStatus"),customBodyRenderLite:s=>{const{emailSendStatus:n,emailSendAt:a,emailSendFailedReason:l}=o[s];return e.jsx(H,{status:n,updatedAt:a,reason:l,channel:"email",onResend:g=>F(g,o[s],"email")})},filter:!0,filterType:"custom",filterList:j.emailSendStatus??[],customFilterListOptions:{render:s=>e.jsx(Z,{list:s,label:"Email",onDelete:(n,a)=>{n.stopPropagation(),P(n,a,$[5].options.filterList,"emailSendStatus")}}),update:ie},filterOptions:{names:R,fullWidth:!0,logic:oe,display:(s,n,a,l)=>e.jsx(Y,{label:"Email",filterList:s,onChange:n,index:a,column:l,statusFilterValues:R})}}},{label:"Webhook",name:"webhook",width:200,options:{display:D.includes("webhook"),filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:s=>{const{webhook:n}=o[s];if(!n)return null;const a=Object.entries(n)[0];if(!a)return null;const[l,g]=a,A=g[0];return e.jsx(y,{display:"flex",flexDirection:"column",gap:1,children:e.jsxs(y,{className:"webhook-item",fontSize:12,children:[e.jsx(X,{maxLength:30,children:l},l),e.jsx(H,{status:A.status,updatedAt:A.sendAt,reason:A.failedReason,channel:"webhook",onResend:J=>F(J,o[s],l)})]},l)})}}}],G=s=>{N(n=>({...n,dateRange:s,page:1}))},se=[e.jsx(Ne,{value:j.dateRange,onChange:G})];return e.jsxs(y,{ref:w,sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:[e.jsx(jt,{children:e.jsx(Ee,{theme:xt(),children:e.jsx(We,{className:"main-data",verticalKeyWidth:100,loading:d,locale:i,columns:$,data:o,durable:O,onChange:v,options:{sort:!1,download:!1,print:!1,responsive:!1,expandableRowsOnClick:!0,searchPlaceholder:t("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:u.page-1,rowsPerPage:u.pageSize,count:u.total,...m,searchText:j.searchText,onViewColumnsChange:(s,n)=>{B(n==="add"?a=>[...a,s]:a=>a.filter(l=>l!==s))}},customButtons:se,components:{TableFilterList:St}})})}),b&&e.jsx(ve,{refresh:te,onCancel:K,notification:b,blocklet:c,resendChannel:T})]})}const jt=ce.div`
48
- td.MuiTableCell-footer {
49
- border: none !important;
50
- }
51
- .sent-status-cell {
52
- .resend-btn {
53
- display: none;
54
- }
55
- &:hover {
56
- .resend-btn {
57
- display: flex;
58
- }
59
- }
60
- }
61
- `;Rt.propTypes={blocklet:x.object.isRequired};function Rt({blocklet:t={}}){return e.jsx(et,{blocklet:t,children:e.jsx(yt,{})})}export{Rt as default,xt as getMuiTheme};
@@ -1,160 +0,0 @@
1
- import{g as we,r as x}from"./vendor-react-D-afvo_7.js";import{E as d,j as s,bp as te,a3 as f,T,aa as C,t as E,ah as z,am as ne,a4 as je,bI as Le,aq as Se,as as Te,e as Ee}from"./vendor-mui-core-CCMNKHtm.js";import{n as Ce,D as W,a0 as re,am as se,ao as Re,e as ie,ap as ke,aq as $e}from"./vendor-arcblock-Bf7AGBSd.js";import{S as Ne}from"./index-DE_r-gh_.js";import{B as _e}from"./bundle-avatar-TEUPlhi2.js";import{B as Oe}from"./index-CSkA6M4K.js";import{R as Pe}from"./relative-time-C36uWHLw.js";import{a7 as Me,y as _}from"./vendor-utils-5TjOM6td.js";import{R as He,T as $,U as Ie}from"./index-uosYiNLl.js";import{d as oe}from"./vendor-hooks-BKxTDk_P.js";import{d as De}from"./InfoOutlined-DZAeG3v-.js";var Ae=x;function Ue(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var H=Ue(Ae);function A(){return A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},A.apply(this,arguments)}function ze(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,U(e,t)}function U(e,t){return U=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},U(e,t)}function We(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o<n.length;o++)i=n[o],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}var Z={position:"absolute",bottom:0,left:0,height:0,overflow:"hidden","padding-top":0,"padding-bottom":0,border:"none"},Be=["box-sizing","width","font-size","font-weight","font-family","font-style","letter-spacing","text-indent","white-space","word-break","overflow-wrap","padding-left","padding-right"];function Fe(e,t){if(!e||typeof e!="object")return e;var r={};return Object.keys(e).forEach(function(n){t.indexOf(n)>-1||(r[n]=e[n])}),r}var qe=["component","className","unsafeHTML"];function ae(e,t){if(t!=="letters"&&t!=="words")throw new Error("Unsupported options basedOn: "+t);if(e.nodeType===Node.TEXT_NODE){var r=document.createDocumentFragment(),n;switch(t){case"words":n=e.textContent.split(/\b|(?=\W)/);break;case"letters":n=Array.from(e.textContent);break}n.forEach(function(l){r.appendChild(Ge(l))}),e.parentNode.replaceChild(r,e)}else if(e.nodeType===Node.ELEMENT_NODE)for(var i=[].slice.call(e.childNodes),o=i.length,a=0;a<o;a++)ae(i[a],t)}function Ge(e){var t=document.createElement("span");return t.className="LinesEllipsis-unit",t.textContent=e,t}function ee(e){e.parentNode.replaceChild(document.createTextNode(e.textContent),e)}function le(e,t){if(!(!t.contains(e)||e===t)){for(;e.nextElementSibling;)e.parentNode.removeChild(e.nextElementSibling);le(e.parentNode,t)}}function Ke(e){for(var t=e;t=t.parentNode;)if(/p|div|main|section|h\d|ul|ol|li/.test(t.tagName.toLowerCase()))return t}function I(e){return!!(e.offsetHeight&&(e.offsetWidth||/\S/.test(e.textContent)))}var ce={component:"div",unsafeHTML:"",maxLine:1,ellipsis:"…",ellipsisHTML:void 0,className:"",basedOn:void 0,onReflow:function(){},winWidth:void 0},Qe=Object.keys(ce),pe=function(e){ze(t,e);function t(n){var i;return i=e.call(this,n)||this,i.state={html:n.unsafeHTML,clamped:!1},i.canvas=null,i.maxLine=0,i.nlUnits=[],i}var r=t.prototype;return r.componentDidMount=function(){this.initCanvas(),this.reflow(this.props)},r.componentDidUpdate=function(i){i.winWidth!==this.props.winWidth&&this.copyStyleToCanvas(),this.props!==i&&this.reflow(this.props)},r.componentWillUnmount=function(){this.canvas.parentNode.removeChild(this.canvas),this.canvas=null},r.setState=function(i,o){return typeof i.clamped<"u"&&(this.clamped=i.clamped),e.prototype.setState.call(this,i,o)},r.initCanvas=function(){if(!this.canvas){var i=this.canvas=document.createElement("div");i.className="LinesEllipsis-canvas "+this.props.className,i.setAttribute("aria-hidden","true"),this.copyStyleToCanvas(),Object.keys(Z).forEach(function(o){i.style[o]=Z[o]}),document.body.appendChild(i)}},r.copyStyleToCanvas=function(){var i=this,o=window.getComputedStyle(this.target);Be.forEach(function(a){i.canvas.style[a]=o[a]})},r.reflow=function(i){this.maxLine=+i.maxLine||1,this.canvas.innerHTML=i.unsafeHTML;var o=i.basedOn||(/^[\x00-\x7F]+$/.test(i.unsafeHTML)?"words":"letters");ae(this.canvas,o);var a=this.putEllipsis(this.calcIndexes()),l={clamped:a,html:this.canvas.innerHTML};this.setState(l,i.onReflow.bind(this,l))},r.calcIndexes=function(){var i=[0],o=this.nlUnits=Array.from(this.canvas.querySelectorAll(".LinesEllipsis-unit")),a=o.length;if(!o.length)return i;var l=o.find(I);if(!l)return i;for(var c=1,u=l.offsetTop,p=1;p<a&&!(I(o[p])&&o[p].offsetTop-u>1&&(c++,i.push(p),u=o[p].offsetTop,c>this.maxLine));p++);return i},r.putEllipsis=function(i){if(i.length<=this.maxLine)return!1;this.nlUnits=this.nlUnits.slice(0,i[this.maxLine]);var o=this.nlUnits.pop(),a=this.makeEllipsisSpan();do le(o,this.canvas),Ke(o).appendChild(a),o=this.nlUnits.pop();while(o&&(!I(o)||a.offsetHeight>o.offsetHeight||a.offsetTop>o.offsetTop));return o&&ee(o),this.nlUnits.forEach(ee),!0},r.makeEllipsisSpan=function(){var i=this.props,o=i.ellipsisHTML,a=i.ellipsis,l=document.createElement("span");l.appendChild(document.createElement("wbr"));var c=document.createElement("span");return c.className="LinesEllipsis-ellipsis",o?c.innerHTML=o:c.textContent=a,l.appendChild(c),l},r.isClamped=function(){return this.clamped},r.render=function(){var i=this,o=this.state,a=o.html,l=o.clamped,c=this.props,u=c.component,p=c.className,h=c.unsafeHTML,y=We(c,qe);return H.default.createElement(u,A({className:"LinesEllipsis "+(l?"LinesEllipsis--clamped":"")+" "+p,ref:function(g){return i.target=g}},Fe(y,Qe)),H.default.createElement("div",{dangerouslySetInnerHTML:{__html:l?a:h}}))},t}(H.default.Component);pe.defaultProps=ce;var Ve=pe;const Xe=we(Ve),{joinURL:v,withQuery:j}=He,{toTypeInfo:Ye}=Ce,{isEVMChain:Je,getExplorerUrl:Ze}=$,{arcChainConfig:et}=Ie,tt={ROLE_ACCOUNT:"number",ROLE_NODE:"number",ROLE_DEVICE:"number",ROLE_APPLICATION:"number",ROLE_SMART_CONTRACT:"number",ROLE_BOT:"number",ROLE_ASSET:"number",ROLE_STAKE:"number",ROLE_VALIDATOR:"number",ROLE_GROUP:"number",ROLE_TX:"number",ROLE_TETHER:"number",ROLE_SWAP:"number",ROLE_DELEGATION:"number",ROLE_VC:"number",ROLE_BLOCKLET:"number",ROLE_STORE:"number",ROLE_TOKEN:"number",ROLE_FACTORY:"number",ROLE_ROLLUP:"number",ROLE_STORAGE:"number",ROLE_PROFILE:"number",ROLE_ANY:"number"},L="https://explorer.abtnetwork.io/explorer/";var nt=function({hash:t,asset:r,rollup:n,address:i,token:o,stake:a,chainId:l=""}){if(Je(l)){const h=Ze(l);return t?v(h,`tx/${t}`):r?v(h,`token/${r}`):v(h,`address/${i}`)}const c=et[l],u=c==null?void 0:c.defaultRPC,p=u?`${u}`:void 0;return n&&Ye(n).role===tt.ROLE_ROLLUP?t?j(v(L,`rollups/${n}/moves/${t}`),{host:p}):j(v(L,`rollups/${n}`),{host:p}):r?j(v(L,`assets/${r}`),{host:p}):t?j(v(L,`txs/${t}`),{host:p}):o?j(v(L,`tokens/${o}/tx`),{host:p}):a?j(v(L,`stakes/${a}`),{host:p}):j(v(L,`accounts/${i}`),{host:p})},B={isSameAddr:(e,t)=>String(e).toLowerCase()===String(t).toLowerCase()};const k=nt,{isSameAddr:S}=B;class M{constructor({type:t,did:r,chainId:n,text:i}){this.text=i,this.did=r,this.type=t,this.chainId=n}}const F=e=>{const t=[];try{let r=0;const n=/<(.+?)\(?[tx|nft|token|stake|did|dapp|link]+[:](.+?)\)?>/gi,i=e.matchAll(n);for(const o of i){const a=/\([tx|nft|token|stake|did|dapp|link]+[:](.+?)\)/gi,l=o[0],c=o.index||r,u=c+l.length;if([...l.matchAll(a)].length>1)return[e];let h="";const y=a.exec(l);let b="";if(y){const J=y[0];h=l.replace(J,"").replace(/^</,"").replace(/(>)$/,""),b=J.replace(/\)$/,"").replace(/^\(/,"")}else b=l;const g=b.split(":"),m=(g[0]||"").replace(/^</,"").replace(/^\(/,"").toUpperCase(),w=(g[1]||"").replace(/>$/,"").replace(/\)$/,""),R=(g[g.length-1]||"").replace(/>$/,"").replace(/\)$/,"");t.push(e.substring(r,c)),t.push(new M({type:m,chainId:w,did:R,text:h||m})),r=u}return r<e.length&&t.push(e.substring(r)),t}catch(r){return console.error(r==null?void 0:r.message),[e]}},q=e=>{let t;const{type:r,chainId:n,did:i}=e;return S(r,"link")?t=`${n}:${i}`:S(r,"tx")?t=k({hash:i,chainId:n}):S(r,"stake")?t=k({stake:i,chainId:n}):S(r,"nft")?t=k({asset:i,chainId:n}):S(r,"token")?t=k({token:i,chainId:n}):S(r,"did")&&(t=k({address:i,chainId:n})),t},rt=(e,t=!0)=>F(e).map(n=>{if(n instanceof M){if(t){const i=q(n),{type:o,chainId:a,did:l}=n;return S(o,"dapp")?`<em style="font-weight:bold;" data-type="${o}" data-chain-id="${a}" data-did="${l}">${n.text}</em>`:i?`<a target="_blank" rel="noopener noreferrer" style="color:#4598fa;font-weight:bold;" href="${i}">${n.text}</a>`:`<em style="font-weight:bold;" data-type="${o}" data-chain-id="${a}" data-did="${l}">${n.text}</em>`}return n.text}return n}).join(""),st=e=>F(e).map(r=>r instanceof M?`<${q(r)}|${r.text}>`:r.replace(/:\n/g,": ")).join("");var O={toClickableSpan:rt,toTextList:F,toSlackLink:st,Link:M,getLink:q};function de({attachment:e}){const{data:t}=e;let r="";try{r=new URL(t.url).host}catch{r=t.url}return s.jsxs(te,{target:"_blank",rel:"noopener noreferrer",href:t.url,className:"link",style:{wordBreak:"break-all"},children:[!!r&&s.jsx("span",{className:"url",children:r}),!!t.title&&s.jsx(f,{className:"title",style:{whiteSpace:"unset"},children:t.title}),!!t.description&&s.jsx(f,{className:"description",style:{whiteSpace:"unset",color:"rgba(75, 85, 99, 1)"},children:t.description}),!!t.image&&s.jsx("img",{srcSet:`${$.getImagePath(t.image)}?w=128&h=128&fit=crop&auto=format&dpr=2 2x`,src:`${$.getImagePath(t.image)}?w=128&h=128&fit=crop&auto=format`,alt:t.title||"",loading:"lazy",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"}})]})}de.propTypes={attachment:d.object.isRequired};function ue({attachment:e}){const{data:t}=e;return s.jsx("img",{srcSet:`${$.getImagePath(t.url)}?w=128&h=128&fit=crop&auto=format&dpr=2 2x`,src:`${$.getImagePath(t.url)}?w=128&h=128&fit=crop&auto=format`,alt:t.title||"",loading:"lazy",height:128,style:{borderRadius:"8px",maxWidth:"256px",objectFit:"cover"}})}ue.propTypes={attachment:d.object.isRequired};function G({attachment:e,...t}){var l;const{data:r}=e,n=((l=r.color)==null?void 0:l.toLowerCase())||t.color,i=r.size||t.size,o=r.fontWeight||t.fontWeight||400;let a="14px";return i==="small"?a="12px":i==="normal"?a="14px":i==="big"?a="16px":i==="large"&&(a="18px"),s.jsx("span",{className:"title",style:{fontSize:a,color:n,whiteSpace:"unset",fontWeight:o},children:r.text})}G.propTypes={attachment:d.object.isRequired};const it=e=>{const t="explorer.arcblockio.cn";return e&&{beta:"beta.abtnetwork.io",main:"main.abtnetwork.io"}[e]||t},ot=e=>{try{return new URL(e).host}catch{return e}};var N={getChainHost:it,getUrlHost:ot},P={linkStyle:{color:"#2754C5",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"14px",textDecoration:"underline"},actionsStyle:{margin:"20px -8px 0px"},actionStyle:{color:"#4598fa",fontSize:14,border:"1px solid #4598fa",display:"inline-block",borderRadius:"4px",margin:"8px",marginTop:"8px",marginBottom:"8px",marginLeft:"8px",marginRight:"8px"},assetStyle:{backgroundColor:"#f6f6f6",borderRadius:"8px",padding:"8px"},remarkStyle:{color:"#9397a1",fontSize:"12px",margin:0,whiteSpace:"pre-line!important"},summaryStyle:{color:"#49c3ad",fontWeight:700},titleStyle:{marginBottom:"6px"},severityColorMap:{normal:"#C4C5CA",success:"#25C99B",error:"#F16E6E",warning:"#DE9E37"},attachmentsStyle:{borderLeft:"2px solid transparent",paddingLeft:"20px"},h1Style:{color:"#333",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"24px",fontWeight:"bold",margin:"40px 0",padding:"0"},footerStyle:{color:"#898989",fontFamily:"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",fontSize:"12px",lineHeight:"22px",margin:0}};K.propTypes={locale:d.string,data:d.object.isRequired};K.defaultProps={locale:"en"};function K({locale:e="en",data:t}){const r={zh:"来自",en:"from"}[e]||"from",n={zh:"接收",en:"Received"}[e]||"Received",o=`https://${N.getUrlHost(t.chainHost)||N.getChainHost(t.chainId)}/explorer/tokens/${t.address}/tx`;let a=t.amount;t.decimal&&(a=t.amount/10**t.decimal);const l=oe(()=>({display:"flex",alignItems:"center",rowGap:2,columnGap:4,justifyContent:"space-between",flexWrap:"wrap"}));return s.jsx("a",{href:o,target:"_blank",rel:"noreferrer",children:s.jsxs(f,{display:"flex",flexDirection:"column",children:[s.jsxs(f,{sx:l,children:[s.jsx(T,{component:"div",sx:{fontWeight:700,color:"rgba(3, 7, 18, 1)"},children:n}),s.jsxs(T,{component:"div",align:"right",style:P.summaryStyle,flex:1,children:["+",a," ",t.symbol]})]}),s.jsxs(f,{sx:l,children:[s.jsx(T,{component:"div",style:{...P.remarkStyle,fontSize:14},children:r}),s.jsx(f,{sx:{maxWidth:"252px",fontSize:"14px"},children:s.jsx(W,{did:t.address,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:e})})]})]})})}Q.propTypes={locale:d.string,data:d.object.isRequired};Q.defaultProps={locale:"en"};function Q({locale:e,data:t}){var c,u;const r={zh:"接收",en:"Received"}[e]||"Received",n={zh:"来自",en:"from"}[e]||"from",i=N.getUrlHost(t.chainHost)||N.getChainHost(t.chainId),o=t.did||((u=(c=t==null?void 0:t.credential)==null?void 0:c.issuer)==null?void 0:u.id)||"",a=`https://${i}/explorer/assets/${o}`,l=oe(()=>({display:"flex",alignItems:"center",rowGap:2,columnGap:4,justifyContent:"space-between",flexWrap:"wrap"}));return s.jsx(f,{sx:{pr:1},children:s.jsx("a",{href:a,target:"_blank",style:{textDecoration:"none",color:"initial",display:"block"},rel:"noreferrer",children:s.jsxs(f,{display:"flex",flexDirection:"column",children:[s.jsxs(f,{sx:l,children:[s.jsx(T,{component:"div",sx:{fontWeight:700,color:"rgba(3, 7, 18, 1)"},children:r}),s.jsx(T,{component:"div",align:"right",style:P.summaryStyle,children:"+1 Asset"})]}),o?s.jsxs(f,{sx:l,children:[s.jsx(T,{component:"div",style:{...P.remarkStyle,fontSize:14},children:n}),s.jsx(f,{sx:{maxWidth:"252px",fontSize:"14px"},children:s.jsx(W,{did:o,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:e})})]}):null]})})})}fe.propTypes={data:d.object.isRequired,locale:d.string};function fe({data:e,locale:t="en"}){return s.jsxs("a",{href:e.url,target:"_blank",style:{display:"flex",textDecoration:"none",color:"initial"},rel:"noreferrer",children:[s.jsx("img",{className:"image",src:e.logo,width:50,height:50,alt:""}),s.jsxs("div",{style:{flex:1,marginLeft:"10px"},children:[s.jsx("div",{style:{marginBottom:"6px"},children:e.title}),s.jsx("div",{style:{color:"#a5a5a5",fontSize:10,maxWidth:"252px"},children:s.jsx(W,{did:e.appDID,showQrcode:!0,copyable:!0,compact:!0,responsive:!0,locale:t})})]})]})}V.propTypes={locale:d.string,data:d.object.isRequired};V.defaultProps={locale:"en"};function V({locale:e,data:t}){const r=N.getChainHost(t.chainId),n=`https://${r}/explorer/txs/${t.hash}`,i={zh:"交易详情",en:"Transaction Details"}[e]||"Transaction Details",o={zh:"交易哈希",en:"Transaction Hash"}[e]||"Transaction Hash";return s.jsxs("a",{href:n,target:"_blank",style:{textDecoration:"none",color:"initial",display:"block",fontSize:14},rel:"noreferrer",children:[s.jsx("h6",{style:{color:"#a5a5a5",margin:0},children:r}),s.jsx("p",{style:{color:"#4598fa",margin:0},children:i}),s.jsxs("div",{style:{wordBreak:"break-all"},children:[o,": ",t.hash]})]})}function he({data:e,isMd:t=!1}){return s.jsx(f,{display:"flex",flexDirection:t?"row":"column",justifyContent:"space-between",sx:{width:t?"100%":"auto"},children:e.items.map((r,n)=>s.jsx(G,{attachment:r,color:n===0?"rgba(156, 163, 175, 1)":"",size:n===0?"normal":"big",fontWeight:n===0?400:600},n))})}he.propTypes={data:d.array.isRequired,isMd:d.bool};function me({attachment:e,...t}){const{local:r}=x.useContext(re),n=E(i=>i.breakpoints.down("md"));return s.jsxs(at,{"data-testid":"attachment-preview",...t,isMd:n,children:[e.type==="link"&&s.jsx(de,{attachment:e,...t,isMd:n}),e.type==="image"&&s.jsx(ue,{attachment:e,isMd:n}),e.type==="text"&&s.jsx(G,{attachment:e,isMd:n}),e.type==="token"&&s.jsx(K,{data:e.data,local:r,isMd:n}),e.type==="asset"||e.type==="vc"?s.jsx(Q,{data:e.data,local:r,isMd:n}):null,e.type==="dapp"&&s.jsx(fe,{data:e.data,local:r,isMd:n}),e.type==="transaction"&&s.jsx(V,{data:e.data,local:r,...t,isMd:n}),e.type==="divider"&&s.jsx(z,{sx:{mb:1,mt:1},style:{color:se.dividerColor}}),e.type==="combined"&&s.jsx(he,{data:e,isMd:n})]})}const at=C.div`
2
- display: ${({sx:e={}})=>e.display||"flex"};
3
- flex-direction: ${({sx:e={}})=>e.flexDirection||"column"};
4
- gap: ${({sx:e={}})=>e.gap||1};
5
- width: ${({isMd:e=!1})=>e?"100%":"auto"};
6
- &:last-child {
7
- margin-bottom: 0;
8
- }
9
- `;me.propTypes={attachment:d.object.isRequired};function xe({data:e,...t}){const{items:r}=e;return s.jsx(lt,{...t,children:r.map(n=>s.jsxs(ne,{variant:"outlined",sx:{p:2,borderRadius:"8px",minWidth:128},children:[s.jsxs(f,{display:"flex",alignItems:"center",gap:1,children:[n.icon?s.jsx("img",{src:n.icon,alt:n.title,style:{width:16,height:16}}):null,s.jsxs(f,{className:"metric-name",display:"flex",alignItems:"center",children:[n.title,n.subtitle?s.jsx(je,{title:n.subtitle,arrow:!0,placement:"top",children:s.jsx(De,{fontSize:"small",sx:{fontSize:14,ml:.5}})}):null]})]}),s.jsxs(f,{className:"metric-number",sx:{color:n.content_color||"rgba(3, 7, 18, 1)"},children:[n.content,n.sub_content?s.jsxs("span",{className:"sub-content",style:{color:n.sub_content_color||"rgba(156, 163, 175, 1)"},children:["(",n.sub_content,")"]}):null]})]},n.title))})}const lt=C(f)`
10
- display: flex;
11
- justify-content: flex-start;
12
- flex-wrap: wrap;
13
- gap: 16px;
14
- .metric-number {
15
- font-size: 18px;
16
- font-weight: 600;
17
- .sub-content {
18
- font-size: 12px;
19
- font-weight: 400;
20
- margin-left: 4px;
21
- }
22
- }
23
- .metric-name {
24
- font-size: 14px;
25
- color: rgba(156, 163, 175, 1);
26
- }
27
- `;xe.propTypes={data:d.object.isRequired};function ge({data:e}){const{items:t}=e,r=E(a=>a.breakpoints.down("sm")),n=E(a=>a.breakpoints.down("md")),i=E(a=>a.breakpoints.down("lg")),o=()=>r?1:n?3:i?4:6;return s.jsx(Le,{variant:"quilted",cols:o(),gap:8,rowHeight:128,sx:{margin:0},children:t.map(a=>{const l=a.cover||a.display;return l?s.jsx("a",{href:a.link,target:"_blank",rel:"noopener noreferrer",children:s.jsx(Se,{children:s.jsx("img",{srcSet:`${l}?w=128&h=128&fit=crop&auto=format&dpr=2 2x`,src:`${l}?w=128&h=128&fit=crop&auto=format`,alt:a.title||"",loading:"lazy",style:{borderRadius:"8px"}})})},l):null})})}ge.propTypes={data:d.object.isRequired};function X({data:e,feedType:t,...r}){return s.jsxs(ct,{...r,children:[t==="data-tracker"&&e.type==="table"&&s.jsx(xe,{data:e}),(t==="graphic"||t==="gallery")&&s.jsx(ge,{data:e})]})}const ct=C.div`
28
- display: flex;
29
- flex-direction: column;
30
- width: 100%;
31
- margin-bottom: 4px;
32
- &:last-child {
33
- margin-bottom: 0;
34
- }
35
- `;X.propTypes={data:d.object.isRequired,feedType:d.string};X.defaultProps={feedType:"data-tracker"};const pt=e=>{let t="rgba(0, 0, 0, 0.12)";return e==="warning"?t="#DE9E37":e==="error"?t="#F16E6E":t="rgba(0, 0, 0, 0.12)",t},dt=e=>e.every(t=>t.type==="text"),ut=e=>e.every(t=>t.type==="image"),ft=e=>Me(e,2).map(t=>({type:"combined",items:t})),ht=e=>{if(!e.length||e.length<=1)return!1;const t=e[0].type;return e.every(r=>r.type===t)},mt=async(e,t)=>{const n=new Re().user;if(n)try{return await n.getUserPublicInfo({did:e})?await n.getProfileUrl({did:e,locale:t}):void 0}catch(i){console.error(i);return}};function Y({notification:e,severity:t,showSke:r=!0}){const{attachments:n,data:i,...o}=e,a=E(p=>p.breakpoints.down("md"));if((!n||!n.length)&&_(i))return null;const l=pt(t),c=(p,h=!1)=>{if(!p&&!Array.isArray(p))return null;let y=p,b={},g="horizontal";h&&dt(p)&&(y=ft(p),g="vertical",b={display:"flex",gap:1,flexDirection:"row",justifyContent:"flex-start",flexWrap:"wrap",height:"100%"});const m=ht(y);return s.jsx(f,{sx:{display:"flex",gap:1,flexDirection:h?"row":"column",justifyContent:"flex-start",alignItems:h?"center":"unset",flexWrap:"wrap"},children:y.map((w,R)=>w.type==="section"?s.jsx(x.Fragment,{children:c(w.fields,!0)},R):s.jsxs(x.Fragment,{children:[s.jsx(me,{attachment:w,sx:b,...o}),!(a&&g==="vertical")&&m&&y.length>1&&R!==y.length-1?s.jsx(z,{orientation:g,style:{color:se.dividerColor},sx:g==="vertical"?{ml:2,mr:2,height:32}:{}}):null]},R))})},u=ut(n);return s.jsx(xt,{children:s.jsxs("div",{className:"message-in-list",children:[n.length>0&&s.jsx("div",{className:"message-container",children:u?c(n):s.jsx(ne,{variant:"outlined",sx:{p:2,borderRadius:"8px",minWidth:128,borderColor:l},children:c(n)})}),!_(i)&&s.jsx("div",{className:"message-container",children:s.jsx("div",{className:"data-container",children:s.jsx(X,{data:i,feedType:e.feedType})})}),n.length===0&&_(i)&&r&&s.jsx(Te,{className:"attach-ske",style:{marginTop:10},variant:"rectangular",height:150})]})})}const xt=C.div`
36
- display: flex;
37
- flex-direction: column;
38
- .message-in-list {
39
- padding: 8px 8px 8px 0;
40
- display: flex;
41
- border-radius: 8px;
42
- }
43
- .message-title {
44
- color: #25292f;
45
- font-size: 18px;
46
- font-weight: bold;
47
- word-break: break-all;
48
- }
49
-
50
- .attach-ske {
51
- position: relative;
52
- margin-left: 10px;
53
- &::after {
54
- content: '';
55
- position: absolute;
56
- left: -10px;
57
- top: 0;
58
- height: 100%;
59
- width: 4px;
60
- background-color: ${e=>e.leftLineColor};
61
- }
62
- }
63
-
64
- .message-body {
65
- color: #25292f;
66
- font-size: 16px;
67
- word-break: break-all;
68
- white-space: pre-line;
69
- }
70
- .message-container {
71
- display: flex;
72
- flex-direction: column;
73
- justify-content: flex-start;
74
- .data-container,
75
- .attachment-container {
76
- display: flex;
77
- flex-direction: column;
78
- width: 100%;
79
- }
80
- }
81
- .actions-container {
82
- margin-top: 10px;
83
- .actions-item {
84
- margin-right: 8px;
85
- }
86
- }
87
- `;Y.propTypes={severity:d.string.isRequired,notification:d.object.isRequired,showSke:d.bool};Y.defaultProps={showSke:!0};const D=e=>ke.sanitize(e,{ALLOWED_ATTR:["href","target","rel","class","id","style"]}),gt=async(e,t)=>{const{type:r,did:n}=e;return B.isSameAddr(r,"did")&&await mt(n,t)||O.getLink(e)},yt=async(e,t,r=!0)=>{const n=O.toTextList(e);return await Promise.all(n.map(async o=>{if(o instanceof O.Link){if(r){const a=await gt(o,t),{type:l,chainId:c,did:u}=o;return B.isSameAddr(l,"dapp")?`<em style="font-weight:bold;" data-type="${l}" data-chain-id="${c}" data-did="${u}">${o.text}</em>`:a?`<a target="_blank" rel="noopener noreferrer" style="color:#4598fa;font-weight:bold;" href="${a}">${o.text}</a>`:`<em style="font-weight:bold;" data-type="${l}" data-chain-id="${c}" data-did="${u}">${o.text}</em>`}return o.text}return o})).then(o=>o.join(""))};ye.propTypes={notification:d.object,rows:d.number};function ye({notification:e,rows:t=2}){const[r,n]=x.useState(!1),[i,o]=x.useState(""),{t:a,locale:l}=ie(),c=x.useMemo(()=>{const{attachments:m}=e||{};if(!m)return!1;try{return m.length>0}catch{return!1}},[e]),u=x.useMemo(()=>{const{blocks:m}=e||{};if(!m)return!1;try{return m.length>0}catch{return!1}},[e]),p=x.useMemo(()=>{const{description:m}=e||{};return!!m},[e]),h=x.useMemo(()=>{const{data:m}=e||{};return!_(m)},[e]),y=x.useMemo(()=>c||u||p||h,[c,u,p,h]);if(x.useEffect(()=>{yt((e==null?void 0:e.description)??"",l).then(m=>{o(m)})},[e==null?void 0:e.description,l]),!y)return null;const b=()=>t===0?"":r?`<span class='toggle-btn' data-name='toggle-expanded'>${a("common.collapse")}</span>`:`...<span class='toggle-btn' data-name='toggle-expanded'>${a("common.expand")}</span>`,g=m=>{const{target:w}=m;w.getAttribute("data-name")==="toggle-expanded"&&n(!r)};return s.jsxs(bt,{children:[s.jsx(f,{className:"text-container",children:s.jsx(f,{component:"div",sx:{marginBottom:"4px"},onClick:g,children:i&&(!r&&t>0?s.jsx(Xe,{basedOn:"letters",unsafeHTML:D(i),maxLine:t,ellipsisHTML:D(b())}):s.jsx(T,{component:"div",className:`content ${t===0?"ellipsis":""}`,style:{whiteSpace:"pre-line!important",fontSize:"14px"},dangerouslySetInnerHTML:{__html:D(`${i}${b()}`)}}))})}),c||h?s.jsx(Y,{severity:e.severity,notification:e}):null]})}const bt=C(f)`
88
- margin-bottom: 6px;
89
- color: rgba(75, 85, 99, 1);
90
- .text-container {
91
- word-wrap: break-word;
92
- font-size: 14px;
93
- color: rgba(75, 85, 99, 1);
94
- .toggle-btn {
95
- display: inline-block;
96
- white-space: nowrap;
97
- cursor: pointer;
98
- margin-left: 4px;
99
- font-size: 14px;
100
- color: rgba(59, 130, 246, 1);
101
- }
102
- .content.ellipsis {
103
- overflow: hidden;
104
- text-overflow: ellipsis;
105
- display: block
106
- display: -webkit-box;
107
- -webkit-box-orient: vertical;
108
- max-height: 3em;
109
- line-height: 1.5em;
110
- }
111
- }
112
- `,vt=x.memo(ye);wt.propTypes={data:d.array,blockletMap:d.object,onReadNotification:d.func,inDialog:d.bool};ve.propTypes={notification:d.object,blocklet:d.object,onReadNotification:d.func,inDialog:d.bool};be.propTypes={blocklet:d.object,size:d.number};function be({blocklet:e,size:t=40}){var i;const r=(e==null?void 0:e.did)||((i=e==null?void 0:e.meta)==null?void 0:i.did)||"",n=((e==null?void 0:e.alsoKnownAs)||[]).concat((e==null?void 0:e.appId)||(e==null?void 0:e.appDid)||(e==null?void 0:e.appPid)||"");return s.jsxs(f,{className:"component-avatar",display:"flex",alignItems:"center",sx:{gap:"4px"},children:[s.jsx("span",{className:"dot"}),e?s.jsx(f,{children:n.includes(r)?s.jsx(Oe,{blocklet:e,size:t}):s.jsx(_e,{blocklet:e,ancestors:e.ancestors??[],size:t})}):s.jsx(Ne,{width:t,height:t})]})}function ve({notification:e,blocklet:t,onReadNotification:r=()=>{},inDialog:n=!1}){const{locale:i}=x.useContext(re),o=Ee(),a=E(u=>u.breakpoints.down("sm")),l=x.useMemo(()=>{const{receivers:u=[]}=e;return u.length?u[0].read:!0},[e]),c=x.useMemo(()=>{const{actions:u,action:p}=e;let h=u??[];return!h.length&&p&&(h=[{name:"Visit",link:p}]),h},[e]);return s.jsxs(jt,{className:"notification-row",display:"flex",alignItems:"flex-start",gap:a?1:1.5,sx:{padding:"8px"},isRead:l,onClick:()=>r(e),children:[s.jsx(be,{blocklet:t,size:a?32:40,isSm:a}),s.jsxs(f,{className:"notification",display:"flex",flexDirection:"column",alignItems:"start",children:[s.jsxs(f,{display:"flex",justifyContent:"start",alignItems:"center",gap:1,className:"header",children:[s.jsx(f,{className:"title",children:e.title}),"·",s.jsx(Pe,{value:e.createdAt,locale:i,shouldUpdate:!0,style:{color:o.palette.text.secondary,fontSize:"0.875rem",minWidth:"50px",whiteSpace:"nowrap"}})]}),s.jsx(vt,{notification:e,rows:n?0:2}),c.length>0?s.jsx(f,{display:"flex",justifyContent:"start",alignItems:"center",gap:1,children:c.map((u,p)=>s.jsxs(x.Fragment,{children:[s.jsx(te,{href:u.link,target:"_blank",className:"link",sx:{fontSize:"15px"},children:u.name},u.link),p<c.length-1?s.jsx(z,{orientation:"vertical",sx:{ml:1,mr:1,height:12,borderWidth:"1px"}}):null]},u.link))}):null]})]})}function wt({data:e,blockletMap:t,onReadNotification:r=()=>{},inDialog:n=!1}){const{t:i}=ie(),o=x.useMemo(()=>n?e==null?void 0:e.slice(0,5):e,[n,e]);return e!=null&&e.length?s.jsx(f,{display:"flex",flexDirection:"column",sx:{mt:1,...n?{maxHeight:"calc(-200px + 100vh)",overflow:"auto"}:{}},children:o==null?void 0:o.map(a=>{var c;const l=a.source==="system"?t.get(a.entityId||a.sender):t.get(a.componentDid||a.sender);return((c=a==null?void 0:a.type)==null?void 0:c.toLowerCase())==="passthrough"?null:s.jsx(ve,{inDialog:n,notification:a,blocklet:l,onReadNotification:()=>r(a)},a.id)})}):s.jsx($e,{children:i("common.emptyData")})}const jt=C(f)`
113
- cursor: pointer;
114
-
115
- .component-avatar {
116
- .dot {
117
- width: 8px;
118
- height: 8px;
119
- border-radius: 50%;
120
- background-color: rgba(59, 130, 246, 1);
121
- visibility: ${e=>e.isRead?"hidden":"visible"};
122
- }
123
- }
124
-
125
- .notification {
126
- width: calc(100% - 50px);
127
-
128
- > .header {
129
- @media (min-width: 900px) {
130
- .title {
131
- max-width: calc(100vw - 400px);
132
- }
133
- }
134
- @media (min-width: 1200px) {
135
- .title {
136
- max-width: 820px;
137
- }
138
- }
139
- @media (max-width: 900px) {
140
- .title {
141
- max-width: calc(100vw - 200px);
142
- }
143
- }
144
- }
145
-
146
- .title {
147
- min-width: 0;
148
- overflow: hidden;
149
- text-overflow: ellipsis;
150
- white-space: nowrap;
151
- color: rgba(3, 7, 18, 1);
152
- font-size: 16px;
153
- }
154
- .link {
155
- color: rgba(59, 130, 246, 1);
156
- font-size: 14px;
157
- text-decoration: none;
158
- }
159
- }
160
- `;export{wt as N,ve as a};
@@ -1 +0,0 @@
1
- import{j as o}from"./vendor-mui-core-CCMNKHtm.js";import"./vendor-react-D-afvo_7.js";import{S as t}from"./studio-DBfgF1ck.js";import"./vendor-arcblock-Bf7AGBSd.js";import"./vendor-utils-5TjOM6td.js";import"./vendor-hooks-BKxTDk_P.js";function u(){return o.jsx(t,{children:"Coming soon..."})}export{u as default};
@@ -1 +0,0 @@
1
- import{t as n,j as i,a3 as l}from"./vendor-mui-core-CCMNKHtm.js";import{l as d,r as c}from"./vendor-react-D-afvo_7.js";import{e as u,a5 as h}from"./vendor-arcblock-Bf7AGBSd.js";import g from"./index-BWKYj-2X.js";import"./vendor-utils-5TjOM6td.js";import"./vendor-hooks-BKxTDk_P.js";import"./index-uosYiNLl.js";import"./Add-0_yO_NcD.js";import"./Error-CmnuwZkD.js";import"./confirm-D7n9Rzfx.js";import"./format-error-C0Ke3VXF.js";import"./session-DutPZhUI.js";import"./did-address-CLeqbWiu.js";import"./react-beautiful-dnd.esm-DY38RjFx.js";import"./raf-schd.esm-Cxhj8umC.js";import"./bundle-avatar-TEUPlhi2.js";import"./shorten-label-CYJeMT7h.js";import"./Download-BF8ec3kS.js";import"./QuestionMarkCircle-SCPzvU7T.js";import"./useSetState-Crt4S51m.js";import"./index-DoZ2YM4T.js";import"./index-DE_r-gh_.js";import"./index-DpOEjWGx.js";import"./api-K65cLqol.js";import"./ChevronRight-DORpkdoL.js";import"./vendor-mui-x-DmPVvZFJ.js";import"./DeleteOutline-BaOxCgo3.js";import"./item-7Z8_UB5K.js";import"./Launch-DNY7Ut_B.js";import"./Done-Bsd0QwkQ.js";import"./click-to-copy-Ck4RKrL7.js";import"./get-safe-url-BsKINLVF.js";import"./ArrowDropDown-CSe7vdhu.js";import"./index-BvLMNAG0.js";import"./index-C0uUrAqS.js";const r=new URL(window.location.href),s=r.searchParams.get("mode")==="dialog",w=s?"":r.searchParams.get("padding")||"";function _(){const{t:p}=u(),{componentDid:o}=d(),a=n(t=>t.breakpoints.down("md")),m=t=>{t.stopPropagation(),window.parent.postMessage({event:"resourceDialog.close",componentDid:o},"*")};c.useEffect(()=>{window.parent.postMessage({event:"resourceDialog.loaded",componentDid:o},"*")},[o]);const e=i.jsx(g,{padding:w,initUrl:r});return s?i.jsx(h,{className:"studio-dialog",title:p("blocklet.publish.blockletStudio"),maxWidth:!1,fullWidth:!1,PaperProps:{style:a?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:m,showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:i.jsx(l,{sx:{height:"72vh",overflow:"auto",position:"relative"},children:e})}):e}export{_ as default};
@@ -1 +0,0 @@
1
- import{ao as o}from"./vendor-arcblock-Bf7AGBSd.js";const e=new o;export{e as b};
@@ -1 +0,0 @@
1
- import{r as o}from"./vendor-react-D-afvo_7.js";import{an as t}from"./vendor-arcblock-Bf7AGBSd.js";function r(){return o.useContext(t)}export{r as u};
@@ -1,71 +0,0 @@
1
- import{E as i,j as n,a3 as A,x as R,bC as G,aa as $,bD as J,bE as Z,aP as ee,bF as ne,M as te,al as D,t as oe,a2 as L}from"./vendor-mui-core-CCMNKHtm.js";import{a0 as B,e as ae,H as se,ag as ie,b as re}from"./vendor-arcblock-Bf7AGBSd.js";import{r as u,l as le}from"./vendor-react-D-afvo_7.js";import{d as W}from"./vendor-hooks-BKxTDk_P.js";import{x as ce}from"./vendor-utils-5TjOM6td.js";import{N as de}from"./list-yjVo8vxH.js";import{B as ue}from"./bundle-avatar-TEUPlhi2.js";import{O as pe}from"./index-uosYiNLl.js";import"./index-DE_r-gh_.js";import"./index-CSkA6M4K.js";import"./relative-time-C36uWHLw.js";import"./InfoOutlined-DZAeG3v-.js";H.propTypes={theme:i.string,type:i.oneOf(["button","line"]),onSelectType:i.func,extra:i.node,loading:i.bool,currentTab:i.oneOf(["info","success","warning","error",""])};function H({theme:g="dark",type:s="button",onSelectType:p,extra:x=void 0,currentTab:m="",loading:r=!1,...c}){const h=[{label:"All",value:""},{label:"Info",value:"info"},{label:"Success",value:"success"},{label:"Warning",value:"warning"},{label:"Error",value:"error"}],f=e=>{(e!==m||!r)&&p(e)},b=u.useMemo(()=>{const e={width:"100%",bgcolor:g==="dark"?"#F9FAFB":"",overflowY:"auto",paddingTop:"5px",whiteSpace:"nowrap",borderRadius:0,display:"flex",justifyContent:"space-between",alignItems:"flex-end",flexWrap:"wrap",gap:"8px"};return s==="line"?Object.assign(e,{}):e},[s,g]),v=(e,l,d)=>n.jsx(R,{disabled:r,onClick:()=>f(e.value),className:`profile-button ${l?"active":""}`,...c,children:e.label},e.value||d),t=(e,l,d)=>n.jsx(R,{variant:"text",disabled:r,onClick:()=>f(e.value),className:`profile-line-button ${l?"active":""}`,...c,children:e.label},e.value||d);return n.jsxs(A,{className:"severity-tabs",sx:b,children:[n.jsx("div",{style:c.isMd?{flex:"0 0 100%"}:{},children:h==null?void 0:h.map((e,l)=>{const d=m===(e==null?void 0:e.value);return s==="line"?n.jsx(u.Fragment,{children:t(e,d,l)},e.value||l):n.jsx(u.Fragment,{children:v(e,d,l)},e.value||l)})}),x]})}q.propTypes={paging:i.objectOf(i.any).isRequired,loading:i.bool.isRequired,onChange:i.func.isRequired};function q({loading:g,paging:s,onChange:p}){const{t:x}=u.useContext(B);if(s.pageCount<=0)return null;const m=(h,f)=>{p({page:f+1})},r=h=>{const f=Number(h.target.value);p({page:1,pageSize:f})},c=s.page-1<=0?0:s.page-1;return n.jsx(A,{mt:2,display:"flex",justifyContent:"flex-end",children:n.jsx(G,{disabled:g,count:s.total,page:c,rowsPerPageOptions:[10,20,50,100],labelRowsPerPage:x("pagination.rowsPerPage"),labelDisplayedRows:({from:h,to:f,count:b})=>`${h}–${f} / ${b!==-1?b:`${x()}more than ${f}`}`,rowsPerPage:s.pageSize,onPageChange:m,onRowsPerPageChange:r})})}const fe=u.memo(q);K.propTypes={selectedId:i.string,blockletMap:i.object,onSelectChange:i.func,loading:i.bool,filterType:i.oneOf(["component","entity"])};const ge=$.div`
2
- display: flex;
3
- justify-items: flex-start;
4
- align-items: center;
5
- gap: 8px;
6
- .name {
7
- display: block;
8
- max-width: 260px;
9
- white-space: nowrap;
10
- overflow: hidden;
11
- text-overflow: ellipsis;
12
- }
13
- `;function K({selectedId:g="",filterType:s="component",blockletMap:p=new Map,onSelectChange:x=()=>{},loading:m=!1}){const[r,c]=u.useState(""),{t:h}=u.useContext(B),f=t=>{if(m)return;const e=t.target.value;x(e==="all"?"":e)},b=u.useMemo(()=>{if(!p.size)return[];const t=[];return Array.from(p).forEach(([,e])=>{var P,M;const l=e.did||((P=e.meta)==null?void 0:P.did),d=e.title||((M=e.meta)==null?void 0:M.title)||"",C=e.appPid||e.appDid,k=d.toLowerCase().includes(r.toLowerCase());(s==="component"&&C!==l&&k||s==="entity"&&C===l&&k)&&t.push(e)}),t},[p,r,s]),v=u.useMemo(()=>{var e;const t=b.find(l=>{var d;return(l.did||((d=l.meta)==null?void 0:d.did))===g});return(t==null?void 0:t.did)||((e=t==null?void 0:t.meta)==null?void 0:e.did)||"all"},[b,g]);return p.size?n.jsxs(J,{sx:{minWidth:240,maxWidth:300},children:[n.jsx(Z,{id:"demo-simple-select-label",children:"Sender"}),n.jsxs(ee,{MenuProps:{autoFocus:!1},value:v,onChange:f,onClose:()=>c(""),size:"small",label:"Sender",variant:"outlined",children:[n.jsx(ne,{children:n.jsx(te,{autoFocus:!0,value:r,placeholder:"Search",variant:"outlined",size:"small",fullWidth:!0,onChange:t=>c(t.target.value),onKeyDown:t=>{t.key!=="Escape"&&t.stopPropagation()}})}),n.jsx(D,{value:"all",children:h("common.all")}),b.map(t=>{var d,C;const e=t.did||((d=t.meta)==null?void 0:d.did),l=t.title||((C=t.meta)==null?void 0:C.title);return n.jsx(D,{value:e,children:n.jsxs(ge,{children:[n.jsx(ue,{size:24,blocklet:t,ancestors:t.ancestors}),n.jsx("span",{className:"name",children:l})]})},e)})]})]}):null}const me=u.memo(K),he=$.div`
14
- .MuiContainer-root {
15
- padding-right: 0;
16
- }
17
-
18
- .profile-button.MuiButtonBase-root {
19
- border-radius: 9999px;
20
- margin-right: 2px;
21
- color: #4b5563;
22
- padding: 5px 12px;
23
- line-height: 22px;
24
- font-size: 13px;
25
- border: 1px solid transparent;
26
- }
27
- .profile-button.active.MuiButtonBase-root {
28
- background-color: #ffffff;
29
- color: #030712;
30
- border: 1px solid #e5e7eb !important;
31
- }
32
-
33
- .profile-line-button.MuiButtonBase-root {
34
- margin-right: 2px;
35
- color: #4b5563;
36
- padding: 5px 12px;
37
- line-height: 22px;
38
- font-size: 13px;
39
- border: none !important;
40
- border-radius: 0;
41
- }
42
-
43
- .profile-line-button.active.MuiButtonBase-root {
44
- color: rgba(3, 7, 18, 1);
45
- border-bottom: 1px solid rgba(3, 7, 18, 1) !important;
46
- }
47
-
48
- .profile-button.MuiButtonBase-root:last-of-type,
49
- .profile-line-button.MuiButtonBase-root {
50
- margin-right: 0;
51
- }
52
-
53
- .profile-button.MuiButtonBase-root:hover {
54
- background-color: #ffffff;
55
- color: #030712;
56
- border: 1px solid #e5e7eb;
57
- }
58
- .profile-line-button.MuiButtonBase-root:hover {
59
- color: rgba(3, 7, 18, 1);
60
- background-color: unset;
61
- }
62
-
63
- * {
64
- scrollbar-width: none; /* Firefox */
65
- -ms-overflow-style: none; /* IE and Edge */
66
- }
67
-
68
- *::-webkit-scrollbar {
69
- display: none; /* Chrome, Safari and Opera */
70
- }
71
- `;U.propTypes={blocklets:i.array,context:i.object,pagination:i.bool,inDialog:i.bool,filterType:i.oneOf(["component","entity"]),toViewAll:i.func,tabType:i.oneOf(["button","line"]),enableMarkAllAsRead:i.bool};function U({blocklets:g=[],context:s,pagination:p=!0,tabType:x="button",inDialog:m=!1,filterType:r="component",toViewAll:c=()=>{},enableMarkAllAsRead:h=!0}){const{data:f,paging:b,refresh:v,loading:t,params:e,onReadNotification:l,unReadCount:d,componentDids:C}=s,k=a=>{v({...e,severity:a,paging:{...e.paging,page:1}})},P=oe(a=>a.breakpoints.down("md")),{t:M}=u.useContext(B),[N,T]=u.useState(!1),_=async()=>{T(!0),s.makeAllAsRead&&typeof s.makeAllAsRead=="function"&&await s.makeAllAsRead(),T(!1)},E=u.useCallback(a=>{const{blocklet:o={}}=window,j=[o==null?void 0:o.did,...((o==null?void 0:o.ancestors)||[]).map(y=>y)];return(C==null?void 0:C.includes(a))||j.findIndex(y=>y===a)>-1},[C]),I=u.useMemo(()=>{const a=new Map;return g.length&&g.forEach(o=>{var y,F,O;const j=(o==null?void 0:o.did)||((y=o.meta)==null?void 0:y.did);j&&!a.has(j)&&(o.ancestors=[],a.set(j,o),((F=o==null?void 0:o.alsoKnownAs)==null?void 0:F.length)>0&&o.alsoKnownAs.forEach(w=>{a.has(w)||a.set(w,o)})),((O=o==null?void 0:o.children)==null?void 0:O.length)>0&&o.children.forEach(w=>{var z;const S=(w==null?void 0:w.did)||((z=w.meta)==null?void 0:z.did);S&&!a.has(S)&&E(S)&&(w.ancestors=[o],a.set(S,w))})}),a},[g,E]),V=a=>{v({...e,paging:{...e.paging,...a}})},Q=a=>{var o,j;!a||(j=(o=a.receivers)==null?void 0:o[0])!=null&&j.read||l(a.id).then(()=>{m&&c()})},X=a=>{if(t)return;let o={};r==="component"?o={entityId:"",componentDid:a}:r==="entity"&&(o={componentDid:"",entityId:a}),v({...e,...o,paging:{...e.paging,page:1}})},Y=W(()=>r==="component"?e.componentDid||"":r==="entity"&&e.entityId||"",[e,r]);return n.jsxs(he,{children:[n.jsx(H,{currentTab:e.severity,type:x,theme:"light",isMd:P,onSelectType:k,extra:m?null:[d>0&&h&&n.jsxs(R,{disabled:N||t,onClick:_,sx:{ml:P?0:"auto"},children:[N&&n.jsx(L,{size:16,style:{marginRight:"1em"}}),M("notification.markAllAsRead")]},"make-all-read"),n.jsx(me,{onSelectChange:X,selectedId:Y,filterType:r,blockletMap:I,loading:t},"component-filter")]}),t?n.jsx(A,{sx:{display:"flex",width:"100%",minHeight:400,justifyContent:"center",alignItems:"center"},children:n.jsx(L,{sx:{color:"#4598fa"}})}):n.jsx(de,{data:f,blockletMap:I,onReadNotification:Q,inDialog:m}),p?n.jsx(fe,{loading:t,paging:b,onChange:V}):null]})}const xe=u.memo(U);function Be(){const s=le().tab,{t:p}=ae(),x=pe(),m=W(()=>{var r;return{...window.blocklet,meta:{did:window.blocklet.did,name:window.blocklet.did},children:(r=window==null?void 0:window.blocklet)==null?void 0:r.componentMountPoints.map(c=>({...c,meta:{...c,did:c.did,name:c.name||c.title||"",logo:"logo.png"}}))}});return n.jsxs(n.Fragment,{children:[n.jsx(se,{children:n.jsx("title",{children:p("pageTitle.userCenter")})}),n.jsx(ie,{currentTab:s?ce(re.WELLKNOWN_SERVICE_PATH_PREFIX,"user",s):"",disableAutoRedirect:s==="settings",children:s==="notifications"?n.jsx(xe,{blocklets:[m],context:x}):null})]})}export{Be as default};
@@ -1 +0,0 @@
1
- import{f as _,L as i}from"./vendor-arcblock-Bf7AGBSd.js";import{x as u,_ as e}from"./index-uosYiNLl.js";import{j as r}from"./vendor-mui-core-CCMNKHtm.js";const a={en:_(u),ar:()=>e(()=>import("./ar-DV4YJwQy.js"),[]).then(t=>_(t.default)),de:()=>e(()=>import("./de-C2Y_05d1.js"),[]).then(t=>_(t.default)),es:()=>e(()=>import("./es-DPVOSPPn.js"),[]).then(t=>_(t.default)),fr:()=>e(()=>import("./fr-C8dIIOc9.js"),[]).then(t=>_(t.default)),hi:()=>e(()=>import("./hi-C5r4WQDs.js"),[]).then(t=>_(t.default)),id:()=>e(()=>import("./id-BQK45J6o.js"),[]).then(t=>_(t.default)),ja:()=>e(()=>import("./ja-DsJERrpD.js"),[]).then(t=>_(t.default)),ko:()=>e(()=>import("./ko-t760ZSCl.js"),[]).then(t=>_(t.default)),pt:()=>e(()=>import("./pt-BkjUa7uv.js"),[]).then(t=>_(t.default)),ru:()=>e(()=>import("./ru-1WsQFvuL.js"),[]).then(t=>_(t.default)),th:()=>e(()=>import("./th-CecKmVWf.js"),[]).then(t=>_(t.default)),vi:()=>e(()=>import("./vi-CDrTp7No.js"),[]).then(t=>_(t.default)),"zh-TW":()=>e(()=>import("./zh-tw-CUyoe2CD.js"),[]).then(t=>_(t.default)),zh:()=>e(()=>import("./zh-Bqr2c2To.js"),[]).then(t=>_(t.default))};function f(t){return function(o){return r.jsx(i,{translations:a,children:r.jsx(t,{...o})})}}export{f as w};