@abtnode/webapp 1.16.50 → 1.16.51-beta-20250905-023351-70af144b

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 (199) hide show
  1. package/blocklet.js +1 -1
  2. package/blocklet.yml +1 -1
  3. package/dist/assets/{AdapterDayjs-DPswIgNd.js → AdapterDayjs-V7RXKqyP.js} +1 -1
  4. package/dist/assets/{Add-CTkKWsbA.js → Add-7-eXJOKT.js} +1 -1
  5. package/dist/assets/ArrowDropDown-B9aDIKPi.js +1 -0
  6. package/dist/assets/{Autocomplete-BnpjHbVI.js → Autocomplete-CWbaCMBc.js} +1 -1
  7. package/dist/assets/{Breadcrumbs-BcwyHALS.js → Breadcrumbs-BeUS9EzN.js} +1 -1
  8. package/dist/assets/{ButtonGroup-B8CEk0Fm.js → ButtonGroup-88wnT1Nl.js} +1 -1
  9. package/dist/assets/{CSSTransition-CgU-qJG1.js → CSSTransition-BhKCAa_k.js} +1 -1
  10. package/dist/assets/{CallMerge-DG9UCIML.js → CallMerge-DyslC22y.js} +1 -1
  11. package/dist/assets/{CardContent-DUT0SHjO.js → CardContent-CWjONtVx.js} +1 -1
  12. package/dist/assets/{ChevronLeft-Mrf8wNcO.js → ChevronLeft-DsCa_2Hj.js} +1 -1
  13. package/dist/assets/{ChevronRight-CgNj8oK3.js → ChevronRight-Dh1NhSQh.js} +1 -1
  14. package/dist/assets/{Clear-D0eiF7LM.js → Clear-vz3__EK4.js} +1 -1
  15. package/dist/assets/{DeleteOutline-BXGUPwfv.js → DeleteOutline-BQz9po9Q.js} +1 -1
  16. package/dist/assets/{Done-B-4ttL5E.js → Done-Bk5S0dZ-.js} +1 -1
  17. package/dist/assets/{Edit-BDZJlnuz.js → Edit-ZWYQTIT_.js} +1 -1
  18. package/dist/assets/{ErrorOutline-DM8Q-uGO.js → ErrorOutline-CWTup7vD.js} +1 -1
  19. package/dist/assets/{FilterList-BnK3OcNB.js → FilterList-DOLZBYMl.js} +1 -1
  20. package/dist/assets/{Google-BnsccEt-.js → Google-DjCWLWBZ.js} +1 -1
  21. package/dist/assets/{HelpOutline-95P320TL.js → HelpOutline-BIIJduw6.js} +1 -1
  22. package/dist/assets/{Launch-C31ynKKh.js → Launch-DOQcWt9h.js} +1 -1
  23. package/dist/assets/{Link-DKdN2Z0q.js → Link-D0HMFRxo.js} +1 -1
  24. package/dist/assets/{ListItemButton-wejxtEoj.js → ListItemButton-hdq-8LOD.js} +1 -1
  25. package/dist/assets/{ListSubheader-B_qXJClL.js → ListSubheader-OXmzqw9E.js} +1 -1
  26. package/dist/assets/{LoadingButton-Zo_5FEH-.js → LoadingButton-Dd30R6FK.js} +1 -1
  27. package/dist/assets/{MoreVert-Bg7SRP_I.js → MoreVert-CRSB-gtE.js} +1 -1
  28. package/dist/assets/{OpenInNew-C4rxt70p.js → OpenInNew-nb9brzvh.js} +1 -1
  29. package/dist/assets/{Refresh-L5IK_LF1.js → Refresh-DpCUQ-hQ.js} +1 -1
  30. package/dist/assets/{Search-2a28Zd0Q.js → Search-Caj8zEyB.js} +1 -1
  31. package/dist/assets/{Stepper-B6f7_MVS.js → Stepper-xU4PwGHV.js} +1 -1
  32. package/dist/assets/{Switch-iXfQHCNE.js → Switch-Cr0eK23s.js} +1 -1
  33. package/dist/assets/{TableSearch-BfqBG8KC.js → TableSearch-BVy-Zwre.js} +1 -1
  34. package/dist/assets/{ToggleButtonGroup-CAU8g76h.js → ToggleButtonGroup-DfdLS7WR.js} +1 -1
  35. package/dist/assets/{Verified-DFAnifny.js → Verified-QBG89RkJ.js} +1 -1
  36. package/dist/assets/{VerifiedUser-BFvcT9A-.js → VerifiedUser-DRV2TIup.js} +1 -1
  37. package/dist/assets/{ViewList-BF_nxJjM.js → ViewList-D3SEslCd.js} +1 -1
  38. package/dist/assets/{_createAggregator-DTDqEyEr.js → _createAggregator-C1jyyLx1.js} +1 -1
  39. package/dist/assets/{actions-BfeIbo_G.js → actions-BhT4KCkB.js} +1 -1
  40. package/dist/assets/{actions-DcrS1GhL.js → actions-PgvlZmiV.js} +1 -1
  41. package/dist/assets/{agreement-8NAAXeTA.js → agreement-DA33xTFi.js} +1 -1
  42. package/dist/assets/api-BMlRo0OB.js +1 -0
  43. package/dist/assets/{appearance-BiJ6lD1T.js → appearance-BPq1UJTg.js} +1 -1
  44. package/dist/assets/{audit-logs-xPU-sDla.js → audit-logs-Ctg35AJy.js} +2 -2
  45. package/dist/assets/{base-chart-CPd4vePQ.js → base-chart-Dx4PwDO4.js} +1 -1
  46. package/dist/assets/bedrock-yFRPpe__.png +0 -0
  47. package/dist/assets/{blocklet-BwXw89V1.js → blocklet-CdI4-ak7.js} +1 -1
  48. package/dist/assets/chain-CXX76TQL.js +6 -0
  49. package/dist/assets/{click-to-copy-mqyEDC5n.js → click-to-copy-C8Sc78ZH.js} +1 -1
  50. package/dist/assets/client-ChcYsV1G.js +1 -0
  51. package/dist/assets/cloneDeep-CQZK-s_V.js +1 -0
  52. package/dist/assets/{collapse-Co_76D-y.js → collapse-BmNnb9sz.js} +1 -1
  53. package/dist/assets/config-navigation-8rTODeF1.js +457 -0
  54. package/dist/assets/{connect-to-dgAF9yLc.js → connect-to-DfZIDYiw.js} +5 -5
  55. package/dist/assets/{cssMode-C31W-e3q.js → cssMode-BF4q4okU.js} +1 -1
  56. package/dist/assets/deepseek-C3x42pq3.png +0 -0
  57. package/dist/assets/{delete-confirm-BBlDevSj.js → delete-confirm-D-z4OiCT.js} +1 -1
  58. package/dist/assets/{depsEqual-BxsaWGVI.js → depsEqual-Cr14y622.js} +1 -1
  59. package/dist/assets/{detail-DAPMqeRx.js → detail-DST4nwih.js} +3 -3
  60. package/dist/assets/{domains-24jfdV6n.js → domains-DrwaxbvS.js} +1 -1
  61. package/dist/assets/doubao-yPqHSkLx.png +0 -0
  62. package/dist/assets/{download-3kRJTAFI.js → download-OPjh7Dhu.js} +1 -1
  63. package/dist/assets/{edit.svg-BHgQlE3X.js → edit.svg-BhoBkiKe.js} +1 -1
  64. package/dist/assets/emotion-cache.browser.esm-JDbaITlA.js +1 -0
  65. package/dist/assets/engine-siiM_CrH.js +1 -0
  66. package/dist/assets/{freemarker2-JmP3cv2S.js → freemarker2-CsYcx0mG.js} +1 -1
  67. package/dist/assets/gemini-DffKpc81.png +0 -0
  68. package/dist/assets/{get-safe-url-DG3hbVuw.js → get-safe-url-D4QANS7R.js} +1 -1
  69. package/dist/assets/getValidReactChildren-BK9M6ULL.js +1 -0
  70. package/dist/assets/google-DT1VSJ0m.png +0 -0
  71. package/dist/assets/{graphqlMode-C78Ld2Eu.js → graphqlMode-CEuXGwU0.js} +2 -2
  72. package/dist/assets/{handlebars-CKF2hLML.js → handlebars-UHGxvaSD.js} +1 -1
  73. package/dist/assets/{html-CBskQMFu.js → html-C1vTBkRn.js} +1 -1
  74. package/dist/assets/{html-title-F0NEfYXw.js → html-title-CMu--CLy.js} +1 -1
  75. package/dist/assets/{htmlMode-DsG66HOr.js → htmlMode-BggN4Rb6.js} +1 -1
  76. package/dist/assets/ideogram-REIjy0Er.png +0 -0
  77. package/dist/assets/{iframe-B5DJ8-Ji.js → iframe-CvI--k7K.js} +1 -1
  78. package/dist/assets/{index-g2Hjwa9j.js → index-6cB3i_74.js} +1 -1
  79. package/dist/assets/{index-COFGt098.js → index-B1mp7zTp.js} +1 -1
  80. package/dist/assets/{index-Mg5Ud6gu.js → index-B8SKOyVZ.js} +1 -1
  81. package/dist/assets/{index-OdvXHPqT.js → index-BCjznEDD.js} +103 -103
  82. package/dist/assets/{index-B3FIRHqC.js → index-BEUFNuBP.js} +1 -1
  83. package/dist/assets/{index-BShBVqEp.js → index-BNMMf79b.js} +1 -1
  84. package/dist/assets/{index-ChZ3ki2X.js → index-BVkuT-iA.js} +9 -9
  85. package/dist/assets/{index-DKPVTl-I.js → index-BcCAYOEg.js} +1 -1
  86. package/dist/assets/{index-DocroCwn.js → index-BcZW_Njr.js} +1 -1
  87. package/dist/assets/{index-COql_jsK.js → index-BrouHktD.js} +5 -5
  88. package/dist/assets/{index-Dsvvy8_K.js → index-BwjlL2Kh.js} +1 -1
  89. package/dist/assets/{index-BLMobR0e.js → index-C5Qu9Vfw.js} +1 -1
  90. package/dist/assets/{index-BTOhdwnt.js → index-CIUJRz-P.js} +1 -1
  91. package/dist/assets/{index-R68RI5nS.js → index-CIYlTEmt.js} +7 -7
  92. package/dist/assets/{index-Bj_Te32l.js → index-CJBx_cpm.js} +1 -1
  93. package/dist/assets/{index-D-LfiN9o.js → index-COelK26a.js} +1 -1
  94. package/dist/assets/{index-D9XGO23S.js → index-CXFs83DK.js} +18 -18
  95. package/dist/assets/index-CaVHeI69.js +363 -0
  96. package/dist/assets/{index-C-fYS2zX.js → index-Cbv8PaaQ.js} +1 -1
  97. package/dist/assets/{index-C1YX-486.js → index-CcPSAXJC.js} +1 -1
  98. package/dist/assets/{index-H1nowJu-.js → index-Cfv8rye0.js} +1 -1
  99. package/dist/assets/{index-CN-8L-fW.js → index-Cjda8MxV.js} +1 -1
  100. package/dist/assets/{index-D9nLQXCy.js → index-CwJTlpdS.js} +2 -2
  101. package/dist/assets/index-D2gjCQvJ.js +177 -0
  102. package/dist/assets/{index-DPKaJazb.js → index-DFNWDU08.js} +1 -1
  103. package/dist/assets/{index-BUw2Zomp.js → index-DJt0P9UZ.js} +1 -1
  104. package/dist/assets/{index-x8ZFxnS7.js → index-DN15vW-d.js} +1 -1
  105. package/dist/assets/{index-2hrGtHmX.js → index-DVP4mis5.js} +1 -1
  106. package/dist/assets/{index-BMcGNp8z.js → index-DWNLuD8k.js} +3 -3
  107. package/dist/assets/{index-0496i8uI.js → index-D_HvYLZX.js} +2 -2
  108. package/dist/assets/{index-ClLVAMtr.js → index-DlumR6-r.js} +1 -1
  109. package/dist/assets/{index-DCkFWlji.js → index-DxswKF4l.js} +1 -1
  110. package/dist/assets/{index-DDIG3-mk.js → index-JPRaNDiB.js} +1 -1
  111. package/dist/assets/{index-DAw4DSiR.js → index-KlyXfxtH.js} +1 -1
  112. package/dist/assets/{index-4ozQpL9g.js → index-PupDr-tS.js} +1 -1
  113. package/dist/assets/{index-BWyeLBJr.js → index-TD9tpMf3.js} +1 -1
  114. package/dist/assets/{index-Cx9xeHC7.js → index-UUvY9lTK.js} +1 -1
  115. package/dist/assets/{index-CTpUEnRG.js → index-e4cQdlVT.js} +1 -1
  116. package/dist/assets/index-ee21MdrR.js +1 -0
  117. package/dist/assets/{index-OGdXuzH7.js → index-fVX8tL-Q.js} +3 -3
  118. package/dist/assets/{index-DGDUIal5.js → index-gFJpaRWb.js} +1 -1
  119. package/dist/assets/{index-CIOQij4h.js → index-gXZxZJIx.js} +1 -1
  120. package/dist/assets/{index-DpRx2tZw.js → index-hwjSVkr9.js} +1 -1
  121. package/dist/assets/{index-BeVhpCa2.js → index-oN0VLX7B.js} +1 -1
  122. package/dist/assets/{index-Y2ocg0We.js → index-zmLURVwA.js} +1 -1
  123. package/dist/assets/{index.esm-Dt7UO6Gw.js → index.esm-BMMBbvkk.js} +1 -1
  124. package/dist/assets/{install-from-url-DP36MlN0.js → install-from-url-BVVKjfjP.js} +1 -1
  125. package/dist/assets/{invitation-Iv5T__li.js → invitation-COAlxja2.js} +1 -1
  126. package/dist/assets/{is-path-prefix-equal-DVbPRsdH.js → is-path-prefix-equal-DXaCbZpO.js} +1 -1
  127. package/dist/assets/{item-D5nrOHxx.js → item-C-IQVzix.js} +9 -9
  128. package/dist/assets/{javascript-DwMwjVUG.js → javascript-Bgq9DttZ.js} +1 -1
  129. package/dist/assets/{jsonMode-Dw4fMRhD.js → jsonMode-gicj4lsZ.js} +1 -1
  130. package/dist/assets/{liquid-9EaYCIu3.js → liquid-Ci2GleTa.js} +1 -1
  131. package/dist/assets/{list-header-DofW2Ftc.js → list-header-Bimu_qjE.js} +1 -1
  132. package/dist/assets/{log-DaGgK84T.js → log-Do7yF-hd.js} +1 -1
  133. package/dist/assets/{lottie-react.esm-tNmLlP7P.js → lottie-react.esm-DfMKPb7z.js} +1 -1
  134. package/dist/assets/{mdx-WQ_--1yL.js → mdx-eB0FmO6P.js} +1 -1
  135. package/dist/assets/{memory-BPr31Oys.js → memory-BCE6QiNB.js} +1 -1
  136. package/dist/assets/{metric-D2ucAHiH.js → metric-Bk0iXTai.js} +1 -1
  137. package/dist/assets/ollama-C7MZn2d_.png +0 -0
  138. package/dist/assets/omit-DZngMfUZ.js +1 -0
  139. package/dist/assets/openai-DlpqJdrb.png +0 -0
  140. package/dist/assets/{overview-CCPEnAHB.js → overview-DltjzkWj.js} +1 -1
  141. package/dist/assets/{permission-CUvNs2Zv.js → permission-nS6Be9Zz.js} +1 -1
  142. package/dist/assets/poe-B588TgZu.png +0 -0
  143. package/dist/assets/{preference-BN0Jy77b.js → preference-BcV3F-Xa.js} +3 -3
  144. package/dist/assets/{python-C_uQOER7.js → python-EI0UxD3D.js} +1 -1
  145. package/dist/assets/{raf-schd.esm-DUMXV33K.js → raf-schd.esm-D8Xvrzgn.js} +1 -1
  146. package/dist/assets/{razor-Bf6ygvvd.js → razor-BSy3NnVc.js} +1 -1
  147. package/dist/assets/rotate-session-key-6xIXKXc3.js +1 -0
  148. package/dist/assets/{runtime-B54DBemf.js → runtime-Dxydq6o1.js} +1 -1
  149. package/dist/assets/schema-BYsNslfD.js +1 -0
  150. package/dist/assets/sdk-BLZzaYH6.js +1 -0
  151. package/dist/assets/{service-CcQaRfy1.js → service-BiVWc9jf.js} +1 -1
  152. package/dist/assets/{shorten-label-CPrM7klu.js → shorten-label-1yenXb9Y.js} +1 -1
  153. package/dist/assets/{simple-select-Y6nLlyX-.js → simple-select-Bt3Ltwm7.js} +1 -1
  154. package/dist/assets/{spaces-DfU2dhr-.js → spaces-BnSCxjeY.js} +1 -1
  155. package/dist/assets/{status-DjEtZNUr.js → status-BYLk6wlC.js} +1 -1
  156. package/dist/assets/{status-tQggAyS9.js → status-CXAtxXK1.js} +1 -1
  157. package/dist/assets/{switch-control-LS_NeTom.js → switch-control-D5SPzkUx.js} +1 -1
  158. package/dist/assets/{table-icons-LUDdTh3T.js → table-icons-BGs1mthN.js} +1 -1
  159. package/dist/assets/{team-Dyq5wP2P.js → team-BlgLSbQd.js} +1 -1
  160. package/dist/assets/{toLower-B8SBWvWe.js → toLower-BiqFoOo1.js} +1 -1
  161. package/dist/assets/toUpper-BMdlX8ly.js +1 -0
  162. package/dist/assets/{traffic-DgBk3o2N.js → traffic-d8ue0hO5.js} +1 -1
  163. package/dist/assets/{tsMode-_qFiyVuf.js → tsMode-DFSmR0ZD.js} +1 -1
  164. package/dist/assets/{typescript-BClkULc3.js → typescript-Dvh-IrHb.js} +1 -1
  165. package/dist/assets/{url-evaluation-DgbmtLnr.js → url-evaluation-DFEEqTh-.js} +1 -1
  166. package/dist/assets/{url-join-CTs-nsh5.js → url-join-Dra-Zi4G.js} +1 -1
  167. package/dist/assets/{use-mobile-BeKGXAC7.js → use-mobile-BOq_qktK.js} +1 -1
  168. package/dist/assets/{use-mobile-Yz2bScih.js → use-mobile-FV0M1ZqW.js} +1 -1
  169. package/dist/assets/{useAsync-DkpPqR2N.js → useAsync-B7FuCRJD.js} +1 -1
  170. package/dist/assets/{useAsyncRetry-Xbq1Vu1J.js → useAsyncRetry-C1rqgcS3.js} +1 -1
  171. package/dist/assets/{useLocalStorage-BRX7xEeE.js → useLocalStorage-BjyUhOL-.js} +1 -1
  172. package/dist/assets/{useThemeProps-B8kKGfuj.js → useThemeProps-BZz8f5dF.js} +1 -1
  173. package/dist/assets/{util-Cw9ZhkhZ.js → util-vH7l3iJe.js} +1 -1
  174. package/dist/assets/{wait-container-CESBMuDe.js → wait-container-4i1AkyPx.js} +1 -1
  175. package/dist/assets/{without-wallet-DfzBh9gC.js → without-wallet-CG4TWMeN.js} +1 -1
  176. package/dist/assets/{wrap-locale-Bz8sQEwG.js → wrap-locale-CCw957fx.js} +1 -1
  177. package/dist/assets/{xml-DgLvDwTZ.js → xml-7zq5MXwn.js} +1 -1
  178. package/dist/assets/{yaml-CBYpsbMl.js → yaml-DdyDZl-6.js} +1 -1
  179. package/dist/index.html +1 -1
  180. package/dist/service-worker.js +1 -1
  181. package/package.json +1 -1
  182. package/dist/assets/ArrowDropDown-CPMzkOwU.js +0 -1
  183. package/dist/assets/Slider-DfrL_KUv.js +0 -1
  184. package/dist/assets/api-DHdVnqwS.js +0 -1
  185. package/dist/assets/chain-d11c9jLj.js +0 -6
  186. package/dist/assets/client-CSeQ4CUw.js +0 -1
  187. package/dist/assets/cloneDeep-DrWSOVhF.js +0 -1
  188. package/dist/assets/config-navigation-Bxan73e2.js +0 -457
  189. package/dist/assets/emotion-cache.browser.esm-DKCrrwkN.js +0 -1
  190. package/dist/assets/engine-Cere5Eel.js +0 -1
  191. package/dist/assets/getValidReactChildren-UBZRExQI.js +0 -1
  192. package/dist/assets/index-B_D_eWlx.js +0 -1
  193. package/dist/assets/index-C3erfPAZ.js +0 -161
  194. package/dist/assets/index-CPewySJ_.js +0 -363
  195. package/dist/assets/omit-BPHBFoDu.js +0 -1
  196. package/dist/assets/rotate-session-key-BdVsr217.js +0 -1
  197. package/dist/assets/schema-C8eqaAts.js +0 -1
  198. package/dist/assets/sdk-B2QHgBcr.js +0 -1
  199. package/dist/assets/toUpper-z0GOUGgF.js +0 -1
@@ -1,4 +1,4 @@
1
- import{ak as ee,A as T,r as f,a as te,b as se,m as S,u as j,x as oe,aw as A,J as F,j as t,w as q,ax as re,T as R,y as k,$,o as m,ay as ne,az as ae,v as _,C as N,aA as ie,H as O,Y as W,aB as le,aC as ce,N as B,aD as ue,E as de,L as pe,aE as he,aa as fe,s as M,a7 as me,a8 as ge,aF as xe,a9 as be}from"./index-OdvXHPqT.js";import{u as L}from"./useLocalStorage-BRX7xEeE.js";import{C as ke,c as ye,e as Se,_ as je,a as we,d as ve,s as Pe,S as z,b as Re,A as Ce}from"./item-D5nrOHxx.js";import{e as D}from"./engine-Cere5Eel.js";import{g as U}from"./get-safe-url-DG3hbVuw.js";import{P as V}from"./permission-CUvNs2Zv.js";import{A as Le}from"./ArrowDropDown-CPMzkOwU.js";import{B as Ee}from"./Breadcrumbs-BcwyHALS.js";import"./Verified-DFAnifny.js";import"./ChevronLeft-Mrf8wNcO.js";import"./ChevronRight-CgNj8oK3.js";import"./Search-2a28Zd0Q.js";import"./index-BShBVqEp.js";import"./blocklet-BwXw89V1.js";import"./Autocomplete-BnpjHbVI.js";import"./ListSubheader-B_qXJClL.js";import"./VerifiedUser-BFvcT9A-.js";import"./Add-CTkKWsbA.js";import"./Launch-C31ynKKh.js";import"./Done-B-4ttL5E.js";import"./DeleteOutline-BXGUPwfv.js";import"./delete-confirm-BBlDevSj.js";import"./click-to-copy-mqyEDC5n.js";import"./MoreVert-Bg7SRP_I.js";import"./ButtonGroup-B8CEk0Fm.js";import"./getValidReactChildren-UBZRExQI.js";function De(e){const n=ee(),l=T(),[s,r]=L(`sid:blocklet:purchase:${e}`),[i,c]=f.useState(!1),[u,a]=f.useState(null),d=()=>{const{pathname:o,searchParams:g}=new URL(window.location.href),x=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";g.get("sid")&&(r(""),l(o.replace(x,"/"),{replace:!0}))},p=!!(n.get("assetDid")&&s&&n.get("sid")===s);return te(se.BlockletEvents.purchaseChange,o=>{o.did===e&&(a(o.session),["declined","confirmed","error"].includes(o.session.status)&&(c(!0),setTimeout(d,2e3)))}),f.useEffect(()=>{u&&u.id!==s&&r(u.id)},[u]),{hasCompleted:i,hasPurchased:p,session:u,setSession:a,doRedirect:d}}function Be(e){setTimeout(()=>{window.location.href=U(e,{allowDomains:null})},1e3)}function H({meta:e,onCancel:n,handlePaySuccess:l=Be,storeUrl:s}){const{t:r}=S(),{info:i}=j(),[c,u]=f.useState("both"),[a,d]=f.useState(1),p=oe(i),o=A(e,i,s),g=P=>{P!==c&&u(P)},x=()=>{c&&(d(2),c==="verify"&&(window.location.href=U(o)))},w=(P,E)=>{E!=="backdropClick"&&n()},b=()=>{l(o)},h=F.getDisplayName({meta:e});if(c==="purchase"&&a===2)return t.jsx(q,{open:!0,popup:!0,baseUrl:s,action:"acquire-asset",checkFn:re.create({baseURL:k(s,"/store")}).get,onSuccess:b,onClose:n,checkTimeout:60*5e3,extraParams:{factory:e.nftFactory},webWalletUrl:p,disableClose:!0,saveConnect:!1,showDownload:!1,messages:{title:r("store.purchase.auth.title",{name:h}),scan:r("store.purchase.auth.scan"),confirm:r("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx(R,{gutterBottom:!0,children:r("store.purchase.auth.success")}),t.jsxs(R,{variant:"subtitle2",children:[" ",r("store.purchase.autoLaunch",{name:h})]})]})}});const v=$;return t.jsx(v,{title:r("store.purchase.title",{name:h}),disableEscapeKeyDown:!0,open:!0,fullWidth:!0,onClose:w,children:t.jsx("div",{style:{marginBottom:16},children:t.jsx(ke,{action:c,onNext:x,onSelect:g})})})}H.propTypes={...ye,storeUrl:m.string.isRequired,handlePaySuccess:m.func};function K({meta:e,buttonText:n,storeUrl:l,isResource:s=!1}){const{t:r}=S(),i=T(),{info:c}=j(),{api:u}=ne(),a=F.isFreeBlocklet(e)===!1,[d,p]=f.useState(!1),{hasPurchased:o}=De(e.did),[g,x]=f.useState(!1),[w]=L("instant-blocklet-install",!1),[b,h]=f.useState(!1),v=f.useMemo(()=>d?r(a?"blocklet.status.purchasing":"blocklet.status.waiting"):"",[d,r,a]),P=f.useMemo(()=>s?r("blocklet.status.resource"):a?n.purchase:n.launch,[a,n,s]),E=y=>{y.preventDefault(),y.stopPropagation();try{if(p(!0),a){x(!0);return}if(w){h(!0);return}if(!a){const C=A(e,c,l);window.location.href=U(C)}}catch(C){O.error(W(C),{autoHideDuration:5e3}),console.error("Blocklet installed failed",C)}finally{p(!1)}},Q=()=>{p(!1),x(!1)},X=y=>{p(!1),h(!1),i(`/blocklets/${y.appDid}/components`)},Z=()=>{p(!1),h(!1)};return t.jsxs(t.Fragment,{children:[t.jsx(Se,{children:t.jsx(V,{permission:"mutate_blocklets",children:y=>t.jsx(ae,{title:s?r("launchBlocklet.error.resourceBlocklet"):"",children:t.jsx(_,{onClick:E,size:"small",sx:{cursor:s?"not-allowed":"pointer",overflow:"hidden"},disabled:!!(v||!y),variant:"outlined",color:"primary","data-cy":"install-blocklet",children:v?t.jsxs(t.Fragment,{children:[t.jsx(N,{size:16,style:{marginRight:3}}),v]}):P},e.did)})})}),(o||g)&&t.jsx(H,{method:"launch",meta:e,mode:"both",onCancel:Q,storeUrl:l}),b&&t.jsx(q,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:u.get,checkTimeout:5*60*1e3,onSuccess:X,extraParams:{title:e.title,blockletMetaUrl:decodeURIComponent(ie(l,e.did).trim())},messages:{title:r("setup.keyPair.title"),scan:r("setup.keyPair.scan"),confirm:r("setup.keyPair.confirm"),success:r("setup.keyPair.success")},onClose:Z})]})}K.propTypes={isResource:m.bool,meta:m.object.isRequired,buttonText:m.shape({purchase:m.string.isRequired,launch:m.string.isRequired}).isRequired,storeUrl:m.string.isRequired};const Ue=(e,n,l)=>{const s=fe(n);return k(l,`/blocklets/${e.did}/?server-url=${s}`)},I=({meta:e,attribute:n,value:l})=>e._formatted?e._formatted[n]:l,Ie=(e,n)=>{if(!e||!n)return"";try{return k(n,e)}catch(l){return console.warn("Failed to construct avatar URL:",l),""}};function G({blocklet:e,endpoint:n="",serverVersion:l=""}){const{t:s}=S(),r=j();let i=k(r.imgPrefix,"blocklet.png");const c=n;if(c.startsWith("http")&&e.logo)i=k(c,ue(e.did,e.logo,e.version));else{let g=(window.env.apiPrefix||"/").replace(/^\/+/,"").replace(/\/+$/,"");g&&(g=`/${g}`),i=k(g,`/blocklet/logo/${e.did}`)}try{const o=new URL(i);o.searchParams.set("v",e.version||+new Date),i=o.href}catch{}const u=r?.info.mode!==de.NODE_MODES.SERVERLESS,a=o=>o.currentTarget.contains(o.target)?!0:(o.preventDefault(),!1),d={meta:e,buttonText:{purchase:s("common.purchase"),launch:s("common.launch")},storeUrl:c};let p=null;return u&&(p=t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(we,{serverVersion:l,requirementVersion:e.requirements?.server,size:"small",children:t.jsx(K,{isResource:!(D.hasStartEngine(e)||D.isGatewayBlocklet(e)||D.isPackBlocklet(e)),...d})})})),t.jsx(pe,{href:Ue(e,r.info,n),style:{color:"initial",textDecoration:"none"},onClick:a,target:"_blank",children:t.jsx(Te,{title:I({meta:e,attribute:"title",value:e.title||e.name}),did:e.did,description:I({meta:e,attribute:"description",value:e.description}),cover:e.logo?i:"",version:e.version,onButtonClick:null,icons:e.docker?.image?[{key:"docker",icon:t.jsx(B,{sx:{display:"flex",color:"primary.main"},children:t.jsx(he,{icon:ve})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,author:e.owner.fullName,avatar:Ie(e.owner.avatar,n),download:e.stats.downloads,button:p})})}G.propTypes={blocklet:m.object.isRequired,serverVersion:m.string,endpoint:m.string};function Y({storeUrl:e,handleSearchSelect:n=null,extraFilter:l=void 0,...s}){const{locale:r}=S(),i=j(),[c,u]=f.useState({}),a=o=>{u(o)},d=e,p=i?.info?.version;return f.useEffect(()=>{u({})},[d]),t.jsx(le,{FallbackComponent:ce,resetKeys:[d],children:t.jsx(B,{...s,sx:{"& .title-bar":{pt:0},".blocklet-list":{mt:0},"& h2":{display:"none"}},children:t.jsx(je,{layout:{showExplore:!1,showTitle:!0},blockletRender:o=>t.jsx(G,{...o,endpoint:d}),baseSearch:!0,endpoint:d,locale:r,onFilterChange:a,onSearchSelect:n,filters:c,extraFilter:l,serverVersion:p})})})}Y.propTypes={storeUrl:m.string.isRequired,handleSearchSelect:m.func,extraFilter:m.func};const Te=M(Pe)`
1
+ import{ak as ee,A as T,r as f,a as te,b as se,m as S,u as j,x as oe,aw as A,J as F,j as t,w as q,ax as re,T as R,y as k,$,o as m,ay as ne,az as ae,v as _,C as N,aA as ie,H as O,Y as W,aB as le,aC as ce,N as B,aD as ue,E as de,L as pe,aE as he,aa as fe,s as M,a7 as me,a8 as ge,aF as xe,a9 as be}from"./index-BCjznEDD.js";import{u as L}from"./useLocalStorage-BjyUhOL-.js";import{C as ke,c as ye,e as Se,_ as je,a as we,d as ve,s as Pe,S as z,b as Re,A as Ce}from"./item-C-IQVzix.js";import{e as D}from"./engine-siiM_CrH.js";import{g as U}from"./get-safe-url-D4QANS7R.js";import{P as V}from"./permission-nS6Be9Zz.js";import{A as Le}from"./ArrowDropDown-B9aDIKPi.js";import{B as Ee}from"./Breadcrumbs-BeUS9EzN.js";import"./Verified-QBG89RkJ.js";import"./ChevronLeft-DsCa_2Hj.js";import"./ChevronRight-Dh1NhSQh.js";import"./Search-Caj8zEyB.js";import"./index-BNMMf79b.js";import"./blocklet-CdI4-ak7.js";import"./Autocomplete-CWbaCMBc.js";import"./ListSubheader-OXmzqw9E.js";import"./VerifiedUser-DRV2TIup.js";import"./Add-7-eXJOKT.js";import"./Launch-DOQcWt9h.js";import"./Done-Bk5S0dZ-.js";import"./DeleteOutline-BQz9po9Q.js";import"./delete-confirm-D-z4OiCT.js";import"./click-to-copy-C8Sc78ZH.js";import"./MoreVert-CRSB-gtE.js";import"./ButtonGroup-88wnT1Nl.js";import"./getValidReactChildren-BK9M6ULL.js";function De(e){const n=ee(),l=T(),[s,r]=L(`sid:blocklet:purchase:${e}`),[i,c]=f.useState(!1),[u,a]=f.useState(null),d=()=>{const{pathname:o,searchParams:g}=new URL(window.location.href),x=window.env&&window.env.apiPrefix?window.env.apiPrefix:"/";g.get("sid")&&(r(""),l(o.replace(x,"/"),{replace:!0}))},p=!!(n.get("assetDid")&&s&&n.get("sid")===s);return te(se.BlockletEvents.purchaseChange,o=>{o.did===e&&(a(o.session),["declined","confirmed","error"].includes(o.session.status)&&(c(!0),setTimeout(d,2e3)))}),f.useEffect(()=>{u&&u.id!==s&&r(u.id)},[u]),{hasCompleted:i,hasPurchased:p,session:u,setSession:a,doRedirect:d}}function Be(e){setTimeout(()=>{window.location.href=U(e,{allowDomains:null})},1e3)}function H({meta:e,onCancel:n,handlePaySuccess:l=Be,storeUrl:s}){const{t:r}=S(),{info:i}=j(),[c,u]=f.useState("both"),[a,d]=f.useState(1),p=oe(i),o=A(e,i,s),g=P=>{P!==c&&u(P)},x=()=>{c&&(d(2),c==="verify"&&(window.location.href=U(o)))},w=(P,E)=>{E!=="backdropClick"&&n()},b=()=>{l(o)},h=F.getDisplayName({meta:e});if(c==="purchase"&&a===2)return t.jsx(q,{open:!0,popup:!0,baseUrl:s,action:"acquire-asset",checkFn:re.create({baseURL:k(s,"/store")}).get,onSuccess:b,onClose:n,checkTimeout:60*5e3,extraParams:{factory:e.nftFactory},webWalletUrl:p,disableClose:!0,saveConnect:!1,showDownload:!1,messages:{title:r("store.purchase.auth.title",{name:h}),scan:r("store.purchase.auth.scan"),confirm:r("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx(R,{gutterBottom:!0,children:r("store.purchase.auth.success")}),t.jsxs(R,{variant:"subtitle2",children:[" ",r("store.purchase.autoLaunch",{name:h})]})]})}});const v=$;return t.jsx(v,{title:r("store.purchase.title",{name:h}),disableEscapeKeyDown:!0,open:!0,fullWidth:!0,onClose:w,children:t.jsx("div",{style:{marginBottom:16},children:t.jsx(ke,{action:c,onNext:x,onSelect:g})})})}H.propTypes={...ye,storeUrl:m.string.isRequired,handlePaySuccess:m.func};function K({meta:e,buttonText:n,storeUrl:l,isResource:s=!1}){const{t:r}=S(),i=T(),{info:c}=j(),{api:u}=ne(),a=F.isFreeBlocklet(e)===!1,[d,p]=f.useState(!1),{hasPurchased:o}=De(e.did),[g,x]=f.useState(!1),[w]=L("instant-blocklet-install",!1),[b,h]=f.useState(!1),v=f.useMemo(()=>d?r(a?"blocklet.status.purchasing":"blocklet.status.waiting"):"",[d,r,a]),P=f.useMemo(()=>s?r("blocklet.status.resource"):a?n.purchase:n.launch,[a,n,s]),E=y=>{y.preventDefault(),y.stopPropagation();try{if(p(!0),a){x(!0);return}if(w){h(!0);return}if(!a){const C=A(e,c,l);window.location.href=U(C)}}catch(C){O.error(W(C),{autoHideDuration:5e3}),console.error("Blocklet installed failed",C)}finally{p(!1)}},Q=()=>{p(!1),x(!1)},X=y=>{p(!1),h(!1),i(`/blocklets/${y.appDid}/components`)},Z=()=>{p(!1),h(!1)};return t.jsxs(t.Fragment,{children:[t.jsx(Se,{children:t.jsx(V,{permission:"mutate_blocklets",children:y=>t.jsx(ae,{title:s?r("launchBlocklet.error.resourceBlocklet"):"",children:t.jsx(_,{onClick:E,size:"small",sx:{cursor:s?"not-allowed":"pointer",overflow:"hidden"},disabled:!!(v||!y),variant:"outlined",color:"primary","data-cy":"install-blocklet",children:v?t.jsxs(t.Fragment,{children:[t.jsx(N,{size:16,style:{marginRight:3}}),v]}):P},e.did)})})}),(o||g)&&t.jsx(H,{method:"launch",meta:e,mode:"both",onCancel:Q,storeUrl:l}),b&&t.jsx(q,{popup:!0,open:!0,forceConnected:!1,className:"launch-from-url-auth",action:"launch-free-blocklet-by-session",checkFn:u.get,checkTimeout:5*60*1e3,onSuccess:X,extraParams:{title:e.title,blockletMetaUrl:decodeURIComponent(ie(l,e.did).trim())},messages:{title:r("setup.keyPair.title"),scan:r("setup.keyPair.scan"),confirm:r("setup.keyPair.confirm"),success:r("setup.keyPair.success")},onClose:Z})]})}K.propTypes={isResource:m.bool,meta:m.object.isRequired,buttonText:m.shape({purchase:m.string.isRequired,launch:m.string.isRequired}).isRequired,storeUrl:m.string.isRequired};const Ue=(e,n,l)=>{const s=fe(n);return k(l,`/blocklets/${e.did}/?server-url=${s}`)},I=({meta:e,attribute:n,value:l})=>e._formatted?e._formatted[n]:l,Ie=(e,n)=>{if(!e||!n)return"";try{return k(n,e)}catch(l){return console.warn("Failed to construct avatar URL:",l),""}};function G({blocklet:e,endpoint:n="",serverVersion:l=""}){const{t:s}=S(),r=j();let i=k(r.imgPrefix,"blocklet.png");const c=n;if(c.startsWith("http")&&e.logo)i=k(c,ue(e.did,e.logo,e.version));else{let g=(window.env.apiPrefix||"/").replace(/^\/+/,"").replace(/\/+$/,"");g&&(g=`/${g}`),i=k(g,`/blocklet/logo/${e.did}`)}try{const o=new URL(i);o.searchParams.set("v",e.version||+new Date),i=o.href}catch{}const u=r?.info.mode!==de.NODE_MODES.SERVERLESS,a=o=>o.currentTarget.contains(o.target)?!0:(o.preventDefault(),!1),d={meta:e,buttonText:{purchase:s("common.purchase"),launch:s("common.launch")},storeUrl:c};let p=null;return u&&(p=t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(we,{serverVersion:l,requirementVersion:e.requirements?.server,size:"small",children:t.jsx(K,{isResource:!(D.hasStartEngine(e)||D.isGatewayBlocklet(e)||D.isPackBlocklet(e)),...d})})})),t.jsx(pe,{href:Ue(e,r.info,n),style:{color:"initial",textDecoration:"none"},onClick:a,target:"_blank",children:t.jsx(Te,{title:I({meta:e,attribute:"title",value:e.title||e.name}),did:e.did,description:I({meta:e,attribute:"description",value:e.description}),cover:e.logo?i:"",version:e.version,onButtonClick:null,icons:e.docker?.image?[{key:"docker",icon:t.jsx(B,{sx:{display:"flex",color:"primary.main"},children:t.jsx(he,{icon:ve})}),title:s("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:s("blocklet.component.isOfficial")}:void 0,author:e.owner.fullName,avatar:Ie(e.owner.avatar,n),download:e.stats.downloads,button:p})})}G.propTypes={blocklet:m.object.isRequired,serverVersion:m.string,endpoint:m.string};function Y({storeUrl:e,handleSearchSelect:n=null,extraFilter:l=void 0,...s}){const{locale:r}=S(),i=j(),[c,u]=f.useState({}),a=o=>{u(o)},d=e,p=i?.info?.version;return f.useEffect(()=>{u({})},[d]),t.jsx(le,{FallbackComponent:ce,resetKeys:[d],children:t.jsx(B,{...s,sx:{"& .title-bar":{pt:0},".blocklet-list":{mt:0},"& h2":{display:"none"}},children:t.jsx(je,{layout:{showExplore:!1,showTitle:!0},blockletRender:o=>t.jsx(G,{...o,endpoint:d}),baseSearch:!0,endpoint:d,locale:r,onFilterChange:a,onSearchSelect:n,filters:c,extraFilter:l,serverVersion:p})})})}Y.propTypes={storeUrl:m.string.isRequired,handleSearchSelect:m.func,extraFilter:m.func};const Te=M(Pe)`
2
2
  .ms-highlight {
3
3
  color: ${e=>e.theme.palette.primary.main};
4
4
  }
@@ -1,4 +1,4 @@
1
- import{aG as Ge,j as e,bn as gt,r as g,by as X,bf as K,H as q,E as D,p as xt,o as d,h as te,au as bt,az as jt,N as y,T as $,m as Q,eN as Fe,Q as Pe,ig as Ye,bj as Te,aU as Ie,V as Ee,dH as we,b3 as Ue,b1 as Ae,C as Xe,f as Qe,e$ as Je,aP as De,W as yt,at as Ze,ih as et,v as Oe,f1 as tt,fn as ye,fH as st,dB as St,s as ie,ag as pe,G as qe,av as vt,ii as Ct,ij as Nt,$ as nt,ik as wt,il as Rt,im as Tt,io as It,P as Et,bt as it,M as At,R as Dt,S as Ot,U as $e,ip as Lt,a4 as kt}from"./index-OdvXHPqT.js";import{d as Ft,H as at,g as Pt}from"./index-Y2ocg0We.js";import{R as _e,S as _t}from"./actions-BfeIbo_G.js";import{B as Bt}from"./index-ClLVAMtr.js";import{S as me}from"./shorten-label-CPrM7klu.js";import{v as ot}from"./index-C1YX-486.js";import{T as zt}from"./html-title-F0NEfYXw.js";import{R as Wt}from"./Refresh-L5IK_LF1.js";import{D as Mt,g as Ht}from"./traffic-DgBk3o2N.js";import{u as Kt}from"./use-mobile-Yz2bScih.js";import"./FilterList-BnK3OcNB.js";import"./CSSTransition-CgU-qJG1.js";import"./emotion-cache.browser.esm-DKCrrwkN.js";import"./index-2hrGtHmX.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-BxsaWGVI.js";import"./index-BShBVqEp.js";import"./TableSearch-BfqBG8KC.js";import"./Search-2a28Zd0Q.js";import"./Clear-D0eiF7LM.js";import"./MoreVert-Bg7SRP_I.js";import"./useLocalStorage-BRX7xEeE.js";import"./url-evaluation-DgbmtLnr.js";import"./get-safe-url-DG3hbVuw.js";import"./ButtonGroup-B8CEk0Fm.js";import"./getValidReactChildren-UBZRExQI.js";import"./permission-CUvNs2Zv.js";import"./index.esm-Dt7UO6Gw.js";import"./collapse-Co_76D-y.js";import"./blocklet-BwXw89V1.js";import"./Switch-iXfQHCNE.js";import"./iframe-B5DJ8-Ji.js";import"./ChevronLeft-Mrf8wNcO.js";import"./ChevronRight-CgNj8oK3.js";import"./index-DBii9-f-.js";import"./base-chart-CPd4vePQ.js";import"./index-DDIG3-mk.js";import"./AdapterDayjs-DPswIgNd.js";import"./useThemeProps-B8kKGfuj.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=Ge(e.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"})),qt=Ge(e.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"})),rt=g.createContext({}),{Provider:$t,Consumer:an}=rt;function Vt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:a}}=gt(),[l,x]=g.useState([]),[u,T]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),f=X(()=>s.meta?.did,[s]),[v,C]=g.useState([]),[F,_]=g.useState({}),N=X(()=>l.length?new Set(l.map(h=>h.id)):new Set,[l]),V=async({page:h=1,pageSize:S=20,...I}={})=>{if(!f)return[];try{const w={paging:{page:h,pageSize:S},...I,teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0},{dids:E,...k}=w;let B="";E&&E.includes("system")&&(B="system");const ae=E?E.filter(oe=>oe!=="system"):[],ne={...k,source:B,componentDids:ae},ee=await n.getNotificationSendLog({input:ne});return _(ne),x(ee.list),T(ee.paging),ee.list}catch(w){return q.error(w.message),[]}},P=async()=>{const h=await n.getNotificationComponents({input:{teamDid:f}});C(h.componentDids)},L=g.useCallback(h=>{const S=s.children.find(I=>I.meta?.did===h);if(S)return S.ancestors=[s],S},[s]),W=async({notificationId:h,receivers:S,channels:I,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:h,receivers:S,channels:I.map(E=>E==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:E==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:E),...w}})},U=g.useCallback(async h=>(await n.getUser({input:{teamDid:f,user:{did:h}}})).user,[n,f]),Y=g.useCallback(async({page:h=1,pageSize:S=20,...I}={})=>{try{const w={paging:{page:h,pageSize:S},...I,userName:I.searchText||"",teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw q.error(w.message),w}},[n,f]);g.useEffect(()=>{f&&P()},[f]),a(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{N.has(h.notificationId)&&V(F)},[N,F]),a(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{N.has(h.id)||V(F)},[N,F]);const Z={fetch:V,data:l,paging:u,blocklet:s,getComponent:L,resendNotification:W,getUser:U,componentDids:v,getReceivers:Y,inService:r,teamDid:f};return e.jsx($t,{value:{notificationRecords:Z},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Gt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Gt[t],children:t})}const Yt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:a,reason:l="",channel:x="wallet"}=n,u=a?t("notification.sendStatus.sentTime",{date:bt(a,s)}):"",T=Yt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:T,sentTime:u}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=te(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Qt=(t,s)=>{const n=te(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Jt=t=>({enabled:te(t,"extra.notifications.wallet",!0)}),Zt=t=>({enabled:te(t,"extra.webhooks",[]).length>0}),be=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),es=(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})}]:[],je=(t=[])=>{const s=K().startOf("day");return t.filter(n=>K(n.sendAt).isSame(s,"day")).length},ts=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=te(t,l,[]);return je(x)}const n=te(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return je(l)}const a={};return ke.forEach(l=>{const x=`${l}SendRecord`,u=te(t,x,[]),T=je(u);a[l]=T}),r.length>0&&r.forEach(l=>{const x=n[l]??[],u=je(x);a[l]=u}),a},Se=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ss=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({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 se({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:a,title:l="",sentTime:x="",reason:u=""}=t,T=[l,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(y,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(y,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(y,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[a]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]}})]}),e.jsx($,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}se.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Ce.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Ce({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:a}=Q();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs($,{children:[s,": "]}),t.map(l=>{const x=lt(r,a,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(se,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,l)},l)})]})}ze.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 ze({filterList:t,onChange:s,index:n,column:r,filterValues:a,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:a.map(u=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const f=[...t];T.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(v=>v!==(u.value??u)),s(f[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(se,{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:a}){const{t:l,locale:x}=Q(),u=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(se,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=K().toDate(),[a,l]=g.useState(null),x=g.useCallback(f=>{l(a?null:f.currentTarget)},[a]),u=!!a,T=g.useCallback(f=>{if(!f.startDate||!f.endDate){q.error("Please select a date range");return}if(K(f.startDate).isAfter(f.endDate)||!K(f.startDate).isValid()||!K(f.endDate).isValid()){q.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx($,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(we,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[Ue(t[0],n)," - ",Ue(t[1],n)]})}),e.jsx(Ae,{open:u,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Mt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:T})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(a=>a.length).length?null:e.jsxs(y,{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(Ft.TableFilterList,{...s,ItemComponent:t})})]})}function He({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const a=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...a&&l?{onDelete:a}:{}})}He.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const ns=[{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}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[a,l]=g.useState(ns),[x,u]=g.useState(!0),T=(v,C)=>{C.checked=v.target.checked;const F=a.map(_=>({..._,checked:_.value===C.value?C.checked:_.checked}));l(F)},f=v=>{v.stopPropagation(),n({channels:a.filter(C=>C.checked).map(C=>C.value),isResendFailedOnly:x})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx($,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(y,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:a.map(v=>e.jsx(Ie,{control:e.jsx(Ee,{checked:v.checked,onChange:C=>T(C,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:v=>u(v.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(y,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(we,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Xe,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:a}=Q(),l=Qe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:u,inService:T,teamDid:f,getUser:v,blocklet:C}=Be(),[F,_]=g.useState(!1),[N,V]=g.useState([]),P=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[W,U]=g.useState(null),[Y,Z]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[h,S]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[K().subtract(1,"month").startOf("day").toDate(),K().endOf("day").toDate()]}),[I,w]=g.useState([]),E=[{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"}],k=async()=>{if(!F&&t)try{_(!0);const i=await u({notificationId:t,...h}),o=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,f,T)}}));V(o),Z(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{k()},[h]);const B=i=>{i.stopPropagation();const o=i.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,ne={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Y.page-1,rowsPerPage:Y.pageSize,count:Y.total,searchText:h.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:I,onRowSelectionChange:(i,o)=>{w(o.map(c=>c.dataIndex))},customToolbarSelect:ae},ee=({page:i,rowsPerPage:o,searchText:c,filterList:j})=>{const[,z=[],G=[],H=[]]=j;h.pageSize!==o?S(M=>({...M,pageSize:o,page:1})):h.page!==i+1?S(M=>({...M,page:i+1})):h.searchText!==c?S(M=>({...M,searchText:c,page:1})):pe(z,h.walletSendStatus)?pe(G,h.pushKitSendStatus)?pe(H,h.emailSendStatus)||S(M=>({...M,emailSendStatus:H,page:1})):S(M=>({...M,pushKitSendStatus:G,page:1})):S(M=>({...M,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,o)=>{if(!o)return!1;const c=await v(o);return c?i==="wallet"?Jt(c):i==="email"?Xt(C,c):i==="pushKit"?Qt(C,c):i==="webhook"?Zt(c):!0:!1},[v,C]),ge=g.useCallback(i=>es(r,i),[r]),re=()=>{P.anchorEl=null,P.position=null,U(null)},le=()=>{L.anchorEl=null,L.position=null},m=async(i,o,c=!0,j="")=>{if(!(!o.length||!i.length))try{s(i,o,c,j),L.anchorEl||(await be(.5),re())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:o})=>{const c=I.map(j=>N[j].receiver);await m(i,c,o),await be(.5),le(),w([])},b=async(i,o=[],c=!0)=>{try{await m(["webhook"],[i.receiver],c,o)}catch(j){q.error(j.response?j.response.statusText:j.message)}},R=async(i,o,c,j=[],z=!0)=>{if(i.stopPropagation(),ts(o,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await b(o,j,z);return}if(i){const H=i.currentTarget,M=H.getBoundingClientRect();P.anchorEl=H,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}U({channel:c});try{const H=await oe(c,o.receiver);await be(1),U({channel:c,result:H}),(typeof H=="boolean"&&H||St(H)&&Object.values(H).every(M=>!!M))&&(await s([c],[o.receiver],z),L.anchorEl||(await be(.5),re()))}catch(H){q.error(H.message)}},O=i=>{S(o=>({...o,dateRange:i,page:1}))},A=(i,o,c,j)=>{i.stopPropagation();const z=c.filter(G=>G!==o);S(G=>({...G,[j]:z,page:1}))},J=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:o,receiver:c}=N[i];return o?e.jsxs(y,{"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(yt,{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:h.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[1].options.filterList,"walletSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:o,index:c,column:j,filterValues:E})},customBodyRenderLite:i=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"wallet",onResend:z=>R(z,N[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"pushkit",onResend:z=>R(z,N[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:h.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[2].options.filterList,"pushKitSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"email",onResend:z=>R(z,N[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:h.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[3].options.filterList,"emailSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Email",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:o}=N[i];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[j,z]=c,G=z[0];return e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(y,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:j},j),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:H=>R(H,N[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:o}=N[i];return e.jsx(et,{value:o,locale:a,shouldUpdate:!0})}}}],[N,a,h,r]),xe=[e.jsx(We,{value:h.dateRange,onChange:O},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:F,startIcon:e.jsx(Wt,{}),onClick:()=>k(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(y,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(as,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:a,loading:F,columns:J,data:N,onChange:ee,options:ne,customButtons:xe,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:o=>e.jsx(He,{...o,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Ae,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(os,{children:[e.jsxs($,{variant:"body1",component:"div",className:"check-title",children:[W?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:ge(W?.channel).map(i=>{const{type:o,pass:c,fail:j}=i;return!W?.result||W?.result?.[o]?e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:W?.result?.[o]?ye.success.main:"inherit"},children:[W?.result?e.jsx(qt,{}):e.jsx(Xe,{size:12,sx:{color:ye.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:ye.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:j})]},o)})})]})}),L.anchorEl&&e.jsx(Ae,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:le,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:le,onConfirm:p})})]})})})}const is=g.memo(ft),as=ie.div`
1
+ import{aG as Ge,j as e,bn as gt,r as g,by as X,bf as K,H as q,E as D,p as xt,o as d,h as te,au as bt,az as jt,N as y,T as $,m as Q,eN as Fe,Q as Pe,ie as Ye,bj as Te,aU as Ie,V as Ee,dH as we,b3 as Ue,b1 as Ae,C as Xe,f as Qe,e$ as Je,aP as De,W as yt,at as Ze,ig as et,v as Oe,f1 as tt,fo as ye,fI as st,dB as St,s as ie,ag as pe,G as qe,av as vt,ih as Ct,ii as Nt,$ as nt,ij as wt,ik as Rt,il as Tt,im as It,P as Et,bt as it,M as At,R as Dt,S as Ot,U as $e,io as Lt,a4 as kt}from"./index-BCjznEDD.js";import{d as Ft,H as at,g as Pt}from"./index-zmLURVwA.js";import{R as _e,S as _t}from"./actions-BhT4KCkB.js";import{B as Bt}from"./index-DlumR6-r.js";import{S as me}from"./shorten-label-1yenXb9Y.js";import{v as ot}from"./index-CcPSAXJC.js";import{T as zt}from"./html-title-CMu--CLy.js";import{R as Wt}from"./Refresh-DpCUQ-hQ.js";import{D as Mt,g as Ht}from"./traffic-d8ue0hO5.js";import{u as Kt}from"./use-mobile-FV0M1ZqW.js";import"./FilterList-DOLZBYMl.js";import"./CSSTransition-BhKCAa_k.js";import"./emotion-cache.browser.esm-JDbaITlA.js";import"./index-DVP4mis5.js";import"./redux-DfszZyTl.js";import"./typeof-QjJsDpFa.js";import"./depsEqual-Cr14y622.js";import"./index-BNMMf79b.js";import"./TableSearch-BVy-Zwre.js";import"./Search-Caj8zEyB.js";import"./Clear-vz3__EK4.js";import"./MoreVert-CRSB-gtE.js";import"./useLocalStorage-BjyUhOL-.js";import"./url-evaluation-DFEEqTh-.js";import"./get-safe-url-D4QANS7R.js";import"./ButtonGroup-88wnT1Nl.js";import"./getValidReactChildren-BK9M6ULL.js";import"./permission-nS6Be9Zz.js";import"./index.esm-BMMBbvkk.js";import"./collapse-BmNnb9sz.js";import"./blocklet-CdI4-ak7.js";import"./Switch-Cr0eK23s.js";import"./iframe-CvI--k7K.js";import"./ChevronLeft-DsCa_2Hj.js";import"./ChevronRight-Dh1NhSQh.js";import"./index-DBii9-f-.js";import"./base-chart-Dx4PwDO4.js";import"./index-JPRaNDiB.js";import"./AdapterDayjs-V7RXKqyP.js";import"./useThemeProps-BZz8f5dF.js";import"./visuallyHidden-Dan1xhjv.js";const Ut=Ge(e.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"})),qt=Ge(e.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"})),rt=g.createContext({}),{Provider:$t,Consumer:an}=rt;function Vt({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:a}}=gt(),[l,x]=g.useState([]),[u,T]=g.useState({total:0,pageSize:20,pageCount:0,page:1}),f=X(()=>s.meta?.did,[s]),[v,C]=g.useState([]),[F,_]=g.useState({}),N=X(()=>l.length?new Set(l.map(h=>h.id)):new Set,[l]),V=async({page:h=1,pageSize:S=20,...I}={})=>{if(!f)return[];try{const w={paging:{page:h,pageSize:S},...I,teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0},{dids:E,...k}=w;let B="";E&&E.includes("system")&&(B="system");const ae=E?E.filter(oe=>oe!=="system"):[],ne={...k,source:B,componentDids:ae},ee=await n.getNotificationSendLog({input:ne});return _(ne),x(ee.list),T(ee.paging),ee.list}catch(w){return q.error(w.message),[]}},P=async()=>{const h=await n.getNotificationComponents({input:{teamDid:f}});C(h.componentDids)},L=g.useCallback(h=>{const S=s.children.find(I=>I.meta?.did===h);if(S)return S.ancestors=[s],S},[s]),W=async({notificationId:h,receivers:S,channels:I,...w})=>{await n.resendNotification({input:{teamDid:f,notificationId:h,receivers:S,channels:I.map(E=>E==="wallet"?D.NOTIFICATION_SEND_CHANNEL.WALLET:E==="pushKit"?D.NOTIFICATION_SEND_CHANNEL.PUSH:E),...w}})},U=g.useCallback(async h=>(await n.getUser({input:{teamDid:f,user:{did:h}}})).user,[n,f]),Y=g.useCallback(async({page:h=1,pageSize:S=20,...I}={})=>{try{const w={paging:{page:h,pageSize:S},...I,userName:I.searchText||"",teamDid:f,dateRange:I.dateRange?[K(I.dateRange[0]).toISOString(),K(I.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:w})}catch(w){throw q.error(w.message),w}},[n,f]);g.useEffect(()=>{f&&P()},[f]),a(D.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,h=>{N.has(h.notificationId)&&V(F)},[N,F]),a(D.EVENTS.NOTIFICATION_BLOCKLET_CREATE,h=>{N.has(h.id)||V(F)},[N,F]);const Z={fetch:V,data:l,paging:u,blocklet:s,getComponent:L,resendNotification:W,getUser:U,componentDids:v,getReceivers:Y,inService:r,teamDid:f};return e.jsx($t,{value:{notificationRecords:Z},children:t})}function Be(){const{notificationRecords:t}=g.useContext(rt);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Gt={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(xt,{type:Gt[t],children:t})}const Yt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case D.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case D.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function lt(t,s,n={}){const{status:r,updatedAt:a,reason:l="",channel:x="wallet"}=n,u=a?t("notification.sendStatus.sentTime",{date:bt(a,s)}):"",T=Yt(t,x,l);return r===D.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:u,reason:T}:r===D.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:u}:{status:"pending",title:t("notification.sendStatus.pending"),reason:T,sentTime:u}}const Le={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},ke=["wallet","pushKit","email"],Ve=["info","success","error","warning"],ct=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},dt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},Xt=(t,s)=>{const n=te(s,"extra.notifications.email",!0);return{available:ct(t),enabled:n}},Qt=(t,s)=>{const n=te(s,"extra.notifications.push",!0);return{available:dt(t),enabled:n}},Jt=t=>({enabled:te(t,"extra.notifications.wallet",!0)}),Zt=t=>({enabled:te(t,"extra.webhooks",[]).length>0}),be=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),es=(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})}]:[],je=(t=[])=>{const s=K().startOf("day");return t.filter(n=>K(n.sendAt).isSame(s,"day")).length},ts=(t,s="")=>{if(s&&ke.includes(s)){const l=`${s}SendRecord`,x=te(t,l,[]);return je(x)}const n=te(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return je(l)}const a={};return ke.forEach(l=>{const x=`${l}SendRecord`,u=te(t,x,[]),T=je(u);a[l]=T}),r.length>0&&r.forEach(l=>{const x=n[l]??[],u=je(x);a[l]=u}),a},Se=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},ve=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},ss=t=>{switch(t){case D.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case D.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case D.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case D.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},ut=()=>({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 se({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:a,title:l="",sentTime:x="",reason:u=""}=t,T=[l,u].filter(Boolean).join(", ");return e.jsx(jt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx($,{color:"inherit",sx:{fontSize:12},children:T}),e.jsx("span",{children:x})]}):null,arrow:!0,placement:"top",children:e.jsxs(y,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(y,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(y,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Le[a]}}),e.jsx(y,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Le[a]}})]}),e.jsx($,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}se.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Ce.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Ce({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:a}=Q();return e.jsxs(y,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs($,{children:[s,": "]}),t.map(l=>{const x=lt(r,a,{status:l});return e.jsx(Fe,{size:"small",label:e.jsx(y,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(se,{config:x,enableTooltip:!1,children:x.title})}),onDelete:u=>n(u,l)},l)})]})}ze.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 ze({filterList:t,onChange:s,index:n,column:r,filterValues:a,label:l,renderLabel:x}){return e.jsxs(Pe,{className:"filter-container",children:[e.jsx(Ye,{component:"legend",children:l}),e.jsx(Te,{row:!0,children:a.map(u=>e.jsx(Ie,{control:e.jsx(Ee,{checked:t[n].indexOf(u.value??u)>-1,onChange:T=>{const f=[...t];T.target.checked?f[n]=[...f[n],u.value??u]:f[n]=f[n].filter(v=>v!==(u.value??u)),s(f[n],n,r)},name:u.value??u}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:x(u)})},u.value??u))})]})}function Re(t){return e.jsx(ze,{...t,renderLabel:s=>e.jsx(se,{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:a}){const{t:l,locale:x}=Q(),u=lt(l,x,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(y,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(se,{config:u,showTitle:!0}),u.status!=="success"&&e.jsx(we,{className:"resend-btn",size:"small",startIcon:e.jsx(_e,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:a,children:l("notification.resend")})]})}We.propTypes={value:d.array.isRequired,onChange:d.func};function We({value:t,onChange:s}){const{locale:n}=Q(),r=K().toDate(),[a,l]=g.useState(null),x=g.useCallback(f=>{l(a?null:f.currentTarget)},[a]),u=!!a,T=g.useCallback(f=>{if(!f.startDate||!f.endDate){q.error("Please select a date range");return}if(K(f.startDate).isAfter(f.endDate)||!K(f.startDate).isValid()||!K(f.endDate).isValid()){q.error("Invalid date range");return}s([f.startDate,f.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx($,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(we,{onClick:x,variant:"outlined",size:"small",color:"inherit",children:[Ue(t[0],n)," - ",Ue(t[1],n)]})}),e.jsx(Ae,{open:u,anchorEl:a,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Mt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:x,definedRanges:Ht(r),onChange:T})})]})}Me.propTypes={itemComponent:d.elementType.isRequired};function Me({itemComponent:t,...s}){const{t:n}=Q();return!s?.filterList?.filter(a=>a.length).length?null:e.jsxs(y,{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(Ft.TableFilterList,{...s,ItemComponent:t})})]})}function He({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const a=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(Fe,{label:t,variant:"outlined",...a&&l?{onDelete:a}:{}})}He.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const ns=[{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}];pt.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function pt({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Q(),[a,l]=g.useState(ns),[x,u]=g.useState(!0),T=(v,C)=>{C.checked=v.target.checked;const F=a.map(_=>({..._,checked:_.value===C.value?C.checked:_.checked}));l(F)},f=v=>{v.stopPropagation(),n({channels:a.filter(C=>C.checked).map(C=>C.value),isResendFailedOnly:x})};return e.jsxs(y,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx($,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(y,{className:"choose-channel",children:e.jsxs(Pe,{component:"fieldset",variant:"standard",children:[e.jsx(Ye,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Te,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:a.map(v=>e.jsx(Ie,{control:e.jsx(Ee,{checked:v.checked,onChange:C=>T(C,v),name:v.value}),label:v.label},v.value))})]})}),e.jsx(y,{className:"resend-config-footer",children:e.jsx(Te,{children:e.jsx(Ie,{control:e.jsx(Ee,{checked:x,onChange:v=>u(v.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(y,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(we,{onClick:v=>{v.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(we,{onClick:f,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Xe,{size:16}),r("common.confirm")]})]})]})}ft.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function ft({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:a}=Q(),l=Qe(),x=g.useMemo(()=>Je(l,ut()),[l]),{getReceivers:u,inService:T,teamDid:f,getUser:v,blocklet:C}=Be(),[F,_]=g.useState(!1),[N,V]=g.useState([]),P=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[W,U]=g.useState(null),[Y,Z]=g.useState({total:0,pageSize:10,pageCount:0,page:1}),[h,S]=g.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[K().subtract(1,"month").startOf("day").toDate(),K().endOf("day").toDate()]}),[I,w]=g.useState([]),E=[{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"}],k=async()=>{if(!F&&t)try{_(!0);const i=await u({notificationId:t,...h}),o=i.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,f,T)}}));V(o),Z(i.paging),_(!1)}catch(i){q.error(i.message),_(!1)}};g.useEffect(()=>{k()},[h]);const B=i=>{i.stopPropagation();const o=i.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ae=i=>i.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Oe,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(_e,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:B,children:r("notification.resend")})}):null,ne={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:Y.page-1,rowsPerPage:Y.pageSize,count:Y.total,searchText:h.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:I,onRowSelectionChange:(i,o)=>{w(o.map(c=>c.dataIndex))},customToolbarSelect:ae},ee=({page:i,rowsPerPage:o,searchText:c,filterList:j})=>{const[,z=[],G=[],H=[]]=j;h.pageSize!==o?S(M=>({...M,pageSize:o,page:1})):h.page!==i+1?S(M=>({...M,page:i+1})):h.searchText!==c?S(M=>({...M,searchText:c,page:1})):pe(z,h.walletSendStatus)?pe(G,h.pushKitSendStatus)?pe(H,h.emailSendStatus)||S(M=>({...M,emailSendStatus:H,page:1})):S(M=>({...M,pushKitSendStatus:G,page:1})):S(M=>({...M,walletSendStatus:z,page:1}))},oe=g.useCallback(async(i,o)=>{if(!o)return!1;const c=await v(o);return c?i==="wallet"?Jt(c):i==="email"?Xt(C,c):i==="pushKit"?Qt(C,c):i==="webhook"?Zt(c):!0:!1},[v,C]),ge=g.useCallback(i=>es(r,i),[r]),re=()=>{P.anchorEl=null,P.position=null,U(null)},le=()=>{L.anchorEl=null,L.position=null},m=async(i,o,c=!0,j="")=>{if(!(!o.length||!i.length))try{s(i,o,c,j),L.anchorEl||(await be(.5),re())}catch(z){console.error("handleResend error",{error:z})}},p=async({channels:i,isResendFailedOnly:o})=>{const c=I.map(j=>N[j].receiver);await m(i,c,o),await be(.5),le(),w([])},b=async(i,o=[],c=!0)=>{try{await m(["webhook"],[i.receiver],c,o)}catch(j){q.error(j.response?j.response.statusText:j.message)}},R=async(i,o,c,j=[],z=!0)=>{if(i.stopPropagation(),ts(o,c)>=4){q.warning(r("notification.resendLimit"));return}if(!ke.includes(c)){await b(o,j,z);return}if(i){const H=i.currentTarget,M=H.getBoundingClientRect();P.anchorEl=H,P.position={top:M.top+window.scrollY,left:M.left+window.scrollX}}U({channel:c});try{const H=await oe(c,o.receiver);await be(1),U({channel:c,result:H}),(typeof H=="boolean"&&H||St(H)&&Object.values(H).every(M=>!!M))&&(await s([c],[o.receiver],z),L.anchorEl||(await be(.5),re()))}catch(H){q.error(H.message)}},O=i=>{S(o=>({...o,dateRange:i,page:1}))},A=(i,o,c,j)=>{i.stopPropagation();const z=c.filter(G=>G!==o);S(G=>({...G,[j]:z,page:1}))},J=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:i=>{const{receiverUser:o,receiver:c}=N[i];return o?e.jsxs(y,{"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(yt,{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:h.walletSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[1].options.filterList,"walletSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Wallet",filterList:i,onChange:o,index:c,column:j,filterValues:E})},customBodyRenderLite:i=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"wallet",onResend:z=>R(z,N[i],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"pushkit",onResend:z=>R(z,N[i],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:h.pushKitSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[2].options.filterList,"pushKitSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Push Kit",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:j}=N[i];return e.jsx(ce,{status:o,updatedAt:c,reason:j,channel:"email",onResend:z=>R(z,N[i],"email",[],!1)})},filter:!0,filterType:"custom",filterList:h.emailSendStatus??[],customFilterListOptions:{render:i=>e.jsx(Ce,{list:i,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),A(o,c,J[3].options.filterList,"emailSendStatus")}}),update:Se},filterOptions:{names:E,fullWidth:!0,logic:ve,display:(i,o,c,j)=>e.jsx(Re,{label:"Email",filterList:i,onChange:o,index:c,column:j,filterValues:E})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:i=>{const{webhook:o}=N[i];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[j,z]=c,G=z[0];return e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(y,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:j},j),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:H=>R(H,N[i],"webhook",[j],!1)})]},j)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:i=>{const{createdAt:o}=N[i];return e.jsx(et,{value:o,locale:a,shouldUpdate:!0})}}}],[N,a,h,r]),xe=[e.jsx(We,{value:h.dateRange,onChange:O},"date-picker"),e.jsx(Oe,{variant:"contained",size:"small",color:"primary",loading:F,startIcon:e.jsx(Wt,{}),onClick:()=>k(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(y,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(as,{children:e.jsxs(tt,{theme:x,children:[e.jsx(at,{className:"receivers-table",locale:a,loading:F,columns:J,data:N,onChange:ee,options:ne,customButtons:xe,components:{TableFilterList:i=>e.jsx(Me,{...i,itemComponent:o=>e.jsx(He,{...o,canDelete:()=>!1})})}}),P.anchorEl&&e.jsx(Ae,{open:!!P.anchorEl,anchorReference:"anchorPosition",anchorPosition:P.position,onClose:re,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(os,{children:[e.jsxs($,{variant:"body1",component:"div",className:"check-title",children:[W?.channel," Checking"]}),e.jsx(y,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:ge(W?.channel).map(i=>{const{type:o,pass:c,fail:j}=i;return!W?.result||W?.result?.[o]?e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:W?.result?.[o]?ye.success.main:"inherit"},children:[W?.result?e.jsx(qt,{}):e.jsx(Xe,{size:12,sx:{color:ye.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs($,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:ye.error.main},children:[e.jsx(Ut,{}),e.jsx("span",{children:j})]},o)})})]})}),L.anchorEl&&e.jsx(Ae,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:le,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(pt,{loading:n,onCancel:le,onConfirm:p})})]})})})}const is=g.memo(ft),as=ie.div`
2
2
  td.MuiTableCell-footer {
3
3
  border: none !important;
4
4
  }