@abtnode/blocklet-services 1.17.6-beta-20251217-144034-62fafb94 → 1.17.6-beta-20251218-120326-5b44dadf

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 (169) hide show
  1. package/api/index.js +43 -34
  2. package/api/util/attach-shared-utils.js +8 -2
  3. package/api/util/federated.js +2 -2
  4. package/dist/assets/{AdapterDayjs-DqOr9LFk.js → AdapterDayjs-CyjsNBLx.js} +1 -1
  5. package/dist/assets/{Google-CQ1n6aSx.js → Google-qJPhO3Bv.js} +1 -1
  6. package/dist/assets/{access-control-Br0Q24U5.js → access-control-DnaC-ntN.js} +1 -1
  7. package/dist/assets/{add-component-core-BjIc5CSC.js → add-component-core-DppKYxsT.js} +1 -1
  8. package/dist/assets/{add-resource-Xb-x4g1C.js → add-resource-nZx6jcxt.js} +1 -1
  9. package/dist/assets/{addon-Bb-IvkBm.js → addon-CWepU-kl.js} +1 -1
  10. package/dist/assets/{advanced-J7PaqOkP.js → advanced-D8m1Ueie.js} +1 -1
  11. package/dist/assets/{aigne-BisxPU40.js → aigne-JZcfPzC6.js} +1 -1
  12. package/dist/assets/api-C_w0YD2j.js +1 -0
  13. package/dist/assets/{appearance-DB7npajX.js → appearance-0EszN89M.js} +1 -1
  14. package/dist/assets/{audit-logs-ChUneyZT.js → audit-logs-CI4WysnU.js} +2 -2
  15. package/dist/assets/{authorize-Y82VNxRU.js → authorize-D44ooZQv.js} +1 -1
  16. package/dist/assets/{base-chart-CRe-9w5H.js → base-chart-Cs8rd9f2.js} +1 -1
  17. package/dist/assets/{base32-BqL5pnrU.js → base32-Dms5J8BI.js} +1 -1
  18. package/dist/assets/{bind-account-D6v5gT9Q.js → bind-account-JV34J5Xm.js} +1 -1
  19. package/dist/assets/{branding-DMSOM95n.js → branding-BJCkGiFk.js} +1 -1
  20. package/dist/assets/{branding-CEFq0bR-.js → branding-CWSPHmrR.js} +1 -1
  21. package/dist/assets/branding-DdXH_RvS.js +1 -0
  22. package/dist/assets/{bundle-avatar-B4iapkc8.js → bundle-avatar-BtFusdVR.js} +1 -1
  23. package/dist/assets/{button-C2uxCAba.js → button-dwhnNiIp.js} +1 -1
  24. package/dist/assets/{click-to-copy-03_3P1nz.js → click-to-copy-P5mPeLGL.js} +1 -1
  25. package/dist/assets/{cloneDeep-DqDclz1x.js → cloneDeep-BbaR0xRl.js} +1 -1
  26. package/dist/assets/{complete-8l4TIdOc.js → complete-C2eZZOXC.js} +1 -1
  27. package/dist/assets/{component-wVyJUR9k.js → component-BaU5hHKk.js} +2 -2
  28. package/dist/assets/{config--7XaVDtf.js → config-CCnS9IQP.js} +1 -1
  29. package/dist/assets/{config-Cg-4HKDk.js → config-DVWLcvSS.js} +1 -1
  30. package/dist/assets/config-kfbhKizi.js +53 -0
  31. package/dist/assets/{config-navigation-C25bf49D.js → config-navigation-DGBH-fH3.js} +3 -3
  32. package/dist/assets/{config-space-a5CPzcRH.js → config-space-Cung-olH.js} +1 -1
  33. package/dist/assets/{confirm-Bae4Q6hA.js → confirm-8-up_m-t.js} +1 -1
  34. package/dist/assets/{connect-Kqg-Hvf0.js → connect-CO3sXyDi.js} +1 -1
  35. package/dist/assets/{connect-DcNJuYMP.js → connect-DUE3spg6.js} +1 -1
  36. package/dist/assets/{connect-to-CAxA9YCt.js → connect-to-R3QLEY0t.js} +1 -1
  37. package/dist/assets/{create-passport-svg-Cs4mVLsE.js → create-passport-svg-DisoTWuv.js} +1 -1
  38. package/dist/assets/{createClass-BRKh_6kd.js → createClass-BKsWaCf4.js} +1 -1
  39. package/dist/assets/dashboard-8MVLDFcc.js +103 -0
  40. package/dist/assets/{delete-confirm-BH4us77q.js → delete-confirm-D_45dT2a.js} +1 -1
  41. package/dist/assets/{did-address-DpdRECuJ.js → did-address-BjZvgDzc.js} +1 -1
  42. package/dist/assets/{domain-A_x2C7hZ.js → domain-BraDyagy.js} +1 -1
  43. package/dist/assets/{domain-action-card-qfAg2FOU.js → domain-action-card-BmOv4oe5.js} +2 -2
  44. package/dist/assets/domains-Dy7ECa6U.js +1 -0
  45. package/dist/assets/{email-B41P48YL.js → email-CkeAvsAa.js} +1 -1
  46. package/dist/assets/engine-Cm_CGBhX.js +1 -0
  47. package/dist/assets/{exchange-passport-DmJ-ZNn7.js → exchange-passport-Fp943JxR.js} +1 -1
  48. package/dist/assets/{form--M8l8TAR.js → form-jl_s7BGq.js} +1 -1
  49. package/dist/assets/{form-text-input-CsXLsIFW.js → form-text-input-DTxgomuw.js} +1 -1
  50. package/dist/assets/{fuel-CKdRvbMh.js → fuel-D-LdwjdC.js} +1 -1
  51. package/dist/assets/{gen-access-key-DpcudUJv.js → gen-access-key-BRr17t_H.js} +1 -1
  52. package/dist/assets/{gen-simple-access-key-bBIGQFVa.js → gen-simple-access-key-BxMBs7fK.js} +1 -1
  53. package/dist/assets/get-safe-url-dvWY0L5j.js +1 -0
  54. package/dist/assets/{home-Br4wv3nM.js → home-Bn4iii2m.js} +1 -1
  55. package/dist/assets/{iframe-DEDZfTQS.js → iframe-C0AgQvx8.js} +1 -1
  56. package/dist/assets/{index-CCV_gr1l.js → index-2gt9VfEc.js} +1 -1
  57. package/dist/assets/{index-gb3Omoer.js → index-B-I6un5k.js} +1 -1
  58. package/dist/assets/{index-DZnXlBSX.js → index-B5vc0eG5.js} +1 -1
  59. package/dist/assets/{index-DDNwkWcx.js → index-B8k8ZH-U.js} +1 -1
  60. package/dist/assets/{index-BMx1LEw9.js → index-BAp7_uhB.js} +1 -1
  61. package/dist/assets/{index-B09kmneh.js → index-BFym_Z-b.js} +1 -1
  62. package/dist/assets/{index-Drd8GwRz.js → index-BQ5NNc-7.js} +1 -1
  63. package/dist/assets/{index-D-PNqbj6.js → index-BR0Wem2b.js} +1 -1
  64. package/dist/assets/{index-B4sVJOOj.js → index-BTECQw0p.js} +1 -1
  65. package/dist/assets/{index-BuQB-bBx.js → index-BjNeXyVY.js} +6 -6
  66. package/dist/assets/{index-CbOKD65A.js → index-BjehQLKB.js} +2 -2
  67. package/dist/assets/{index-CCp_Tje1.js → index-BlSveGp8.js} +61 -61
  68. package/dist/assets/{index-DFIvDEic.js → index-C50skInm.js} +1 -1
  69. package/dist/assets/{index-B8FnxSR4.js → index-CJDEYakY.js} +1 -1
  70. package/dist/assets/{index-wfFuxfIU.js → index-CPxL8CpH.js} +1 -1
  71. package/dist/assets/{index-DFNR7XPL.js → index-CTE1ENlu.js} +12 -12
  72. package/dist/assets/{index-BTLkS2yC.js → index-CajO0kKX.js} +4 -4
  73. package/dist/assets/{index-CeGNmiXz.js → index-Cv24xb2K.js} +1 -1
  74. package/dist/assets/index-D0eI1uWt.js +270 -0
  75. package/dist/assets/{index-DzshGHRk.js → index-DIzANfR6.js} +1 -1
  76. package/dist/assets/{index-CiQKtWIW.js → index-DM9inqt9.js} +1 -1
  77. package/dist/assets/{index-ChsRYmOX.js → index-DQ-SL5-m.js} +1 -1
  78. package/dist/assets/{index-suU5cUfF.js → index-DS9mwDyh.js} +1 -1
  79. package/dist/assets/{index-Du-44Mnl.js → index-DoK2Rtvh.js} +2 -2
  80. package/dist/assets/{index-t-iCgvnA.js → index-Dp17qZ6C.js} +1 -1
  81. package/dist/assets/{index-ds5CY5te.js → index-DrhZQ_wV.js} +1 -1
  82. package/dist/assets/{index-BHZ1NI4D.js → index-Dtrjy5pJ.js} +5 -5
  83. package/dist/assets/{index-Dp5SQewL.js → index-DyLgcKhb.js} +1 -1
  84. package/dist/assets/{index-97PFSvcx.js → index-dfs551o8.js} +1 -1
  85. package/dist/assets/{index-Ck7gs4Oo.js → index-kbCgvprY.js} +1 -1
  86. package/dist/assets/{index-DZNC_-b1.js → index-rDhoTVbw.js} +1 -1
  87. package/dist/assets/{invitation-CmMAFxUf.js → invitation-BAxrjUDG.js} +1 -1
  88. package/dist/assets/{invitations-BGoj-6ca.js → invitations-CO0Ty2S9.js} +2 -2
  89. package/dist/assets/{invite-xCk-bD5o.js → invite-CYXl5uc3.js} +1 -1
  90. package/dist/assets/{isURL-FbWmvlGY.js → isURL-BxZzphzW.js} +1 -1
  91. package/dist/assets/{issue-passport-ogite141.js → issue-passport-DYOdrLjy.js} +1 -1
  92. package/dist/assets/{item-DB2BQlzi.js → item-Ccb0OQkt.js} +1 -1
  93. package/dist/assets/{landing-page-_7E5uTzY.js → landing-page-CmKJmT-U.js} +1 -1
  94. package/dist/assets/{layout-bs5efDjb.js → layout-CHuGuIJt.js} +1 -1
  95. package/dist/assets/{list-DzPoX6hE.js → list-B6W2DONO.js} +1 -1
  96. package/dist/assets/{list-CY3qo6ZZ.js → list-miYDTaUU.js} +1 -1
  97. package/dist/assets/localization-C3-q8joh.js +1 -0
  98. package/dist/assets/{log-YDgW4rdG.js → log-DdfRRLsZ.js} +1 -1
  99. package/dist/assets/logger-CzWbEvKU.js +1 -0
  100. package/dist/assets/{login-BX3PcB9B.js → login-92eabaMB.js} +1 -1
  101. package/dist/assets/{login-oauth-callback-74_L5-PV.js → login-oauth-callback-9GVt-otv.js} +1 -1
  102. package/dist/assets/{logo-uploader-BiccA0Y_.js → logo-uploader-ficxc3SB.js} +1 -1
  103. package/dist/assets/{lost-passport-DQpqnLzY.js → lost-passport-BDvFLXED.js} +1 -1
  104. package/dist/assets/{omit-5AwbF-Ja.js → omit-BgmLPtMY.js} +1 -1
  105. package/dist/assets/{open-window-DwdCOSRH.js → open-window-NxoiKlpc.js} +1 -1
  106. package/dist/assets/{over-due-invoice-payment-vMGDLCRH.js → over-due-invoice-payment-Bag2QJw8.js} +1 -1
  107. package/dist/assets/{overview-DlaOwZTf.js → overview-B-FL9Ztc.js} +3 -3
  108. package/dist/assets/{passport-item-D-26SswO.js → passport-item-2TTg8u8i.js} +1 -1
  109. package/dist/assets/passport-ksgWSkVe.js +1 -0
  110. package/dist/assets/{permission-DSq5t-Gl.js → permission-BJlcNSeA.js} +1 -1
  111. package/dist/assets/{preferences-CU_TcWh8.js → preferences-vSJ26-Kf.js} +1 -1
  112. package/dist/assets/profile-embed-q0jzSGic.js +1 -0
  113. package/dist/assets/{publish-resource-CJMQG20J.js → publish-resource-N_xsM7eE.js} +1 -1
  114. package/dist/assets/{react-beautiful-dnd.esm-By1RE6ef.js → react-beautiful-dnd.esm-B8-BZPPH.js} +1 -1
  115. package/dist/assets/runtime-BK5XjM1-.js +1 -0
  116. package/dist/assets/{sanitize-BOo6OPJZ.js → sanitize-DyRfEGVu.js} +1 -1
  117. package/dist/assets/sdk-CIR3zRqK.js +1 -0
  118. package/dist/assets/{security-BtvdwO9M.js → security-CKHrp32s.js} +1 -1
  119. package/dist/assets/{session-BjDe0kgL.js → session-Cqrj8_SK.js} +1 -1
  120. package/dist/assets/{setup-Dznue6f2.js → setup-CHheNDuH.js} +1 -1
  121. package/dist/assets/{spaces-QwBC54Y6.js → spaces-BAJFHyzr.js} +1 -1
  122. package/dist/assets/{start-8dFdO02W.js → start-BOYluYHu.js} +1 -1
  123. package/dist/assets/{starting-progress-SGklUl5j.js → starting-progress-CkCYTd53.js} +1 -1
  124. package/dist/assets/{status-BVh3qQZF.js → status-P5i7qkCz.js} +1 -1
  125. package/dist/assets/{step-actions-YQj43Dic.js → step-actions-DS32mD8U.js} +1 -1
  126. package/dist/assets/{studio-Dse7ZOUk.js → studio-eOX0BkA6.js} +1 -1
  127. package/dist/assets/{switch-wqsJ2qIA.js → switch-BEaA4jUC.js} +1 -1
  128. package/dist/assets/{switch-control-BDwQ53GS.js → switch-control-Cz02PQSr.js} +1 -1
  129. package/dist/assets/{table-tips-BEPJMiqj.js → table-tips-D04ygJ3S.js} +1 -1
  130. package/dist/assets/{team-CMLIpBpv.js → team-BDtQ1KMK.js} +1 -1
  131. package/dist/assets/{traffic-CMz6_p1P.js → traffic-8-96Vd63.js} +1 -1
  132. package/dist/assets/{transfer-ZsNcWxY6.js → transfer-Ctl7gLHf.js} +1 -1
  133. package/dist/assets/{unsubscribe-C6wQSJz0.js → unsubscribe-BdG3wOyd.js} +1 -1
  134. package/dist/assets/{use-app-logo-C6aWxAKK.js → use-app-logo-CSWr6R3N.js} +1 -1
  135. package/dist/assets/{use-window-close-edYntLdV.js → use-window-close-Dyba-7KK.js} +1 -1
  136. package/dist/assets/{useAsync-DOpjtrvS.js → useAsync-VEqKX7rF.js} +1 -1
  137. package/dist/assets/{useAsync-BSd-eaZO.js → useAsync-xXSiXzwr.js} +1 -1
  138. package/dist/assets/{useAsyncRetry-v1aVMcV-.js → useAsyncRetry--1T7wYe2.js} +1 -1
  139. package/dist/assets/{useLocalStorage-8LihN_xG.js → useLocalStorage-C6lmxNb2.js} +1 -1
  140. package/dist/assets/{user-center-CySi62qy.js → user-center-CnMx7tGr.js} +1 -1
  141. package/dist/assets/{user-follower-DaQ4cmnn.js → user-follower-DJYfIqdF.js} +1 -1
  142. package/dist/assets/{util-LZOTlX2w.js → util-B7Ad6Wyn.js} +1 -1
  143. package/dist/assets/{util-CQLL-C6x.js → util-CKkTy1Qb.js} +1 -1
  144. package/dist/assets/{vendor-arcblock-DRfhQ9Yl.js → vendor-arcblock-BwnwoPBM.js} +1 -1
  145. package/dist/assets/{vendor-hooks-DpqqC65c.js → vendor-hooks-cYMUGE4V.js} +1 -1
  146. package/dist/assets/{vendor-utils-BqKQizRf.js → vendor-utils-drLlzTVq.js} +1 -1
  147. package/dist/assets/{vendor-ux-KtPBvlG0.js → vendor-ux-B5w9dHEo.js} +3 -3
  148. package/dist/assets/{wait-connect-D-KXzGB8.js → wait-connect-BqfPKCyo.js} +1 -1
  149. package/dist/assets/{wizard-DplFy6RF.js → wizard-BVhYBjmA.js} +1 -1
  150. package/dist/assets/{wizard-components-D5SEvV5d.js → wizard-components-DL5NPso6.js} +1 -1
  151. package/dist/assets/wrap-locale-PrRlPUBM.js +1 -0
  152. package/dist/assets/{zh-BEQJoajM.js → zh-ChCVOElr.js} +1 -1
  153. package/dist/index.html +1 -1
  154. package/package.json +34 -34
  155. package/dist/assets/api-2a4FTO9k.js +0 -1
  156. package/dist/assets/branding-Beas39XM.js +0 -1
  157. package/dist/assets/config-CAG_E71y.js +0 -53
  158. package/dist/assets/dashboard-4ch_JDWe.js +0 -106
  159. package/dist/assets/domains-BdyK4uC-.js +0 -1
  160. package/dist/assets/engine-ChxMyLlO.js +0 -1
  161. package/dist/assets/get-safe-url-DhW3uplX.js +0 -1
  162. package/dist/assets/index-Csq5V3mf.js +0 -270
  163. package/dist/assets/localization-DNXKCjZt.js +0 -1
  164. package/dist/assets/logger-D3ELa8t7.js +0 -1
  165. package/dist/assets/passport-BpAOwZW1.js +0 -1
  166. package/dist/assets/profile-embed-B0Xzyt0-.js +0 -1
  167. package/dist/assets/runtime-CV7GMTXM.js +0 -1
  168. package/dist/assets/sdk-CfmFeEbO.js +0 -1
  169. package/dist/assets/wrap-locale-BkGdB3jW.js +0 -1
@@ -1,4 +1,4 @@
1
- import{r as g}from"./vendor-react-CTtPmzVP.js";import{j as e,y as V,x as X,bZ as Z,M as G,ak as m,W as x,a6 as ke,bi as ve,b6 as Q,z as U,bX as Te,a5 as Ae,at as P,T as E,cv as Ke,cu as Re,aZ as De,Q as Se,cD as Ie}from"./vendor-mui-core-DnR6WYuU.js";import{V as S,b0 as B,w as F,aT as Be,aJ as oe,b9 as H,H as $e,b7 as Ne,K as Ee,ba as _e,aO as Pe,aN as We}from"./vendor-ux-KtPBvlG0.js";import{f as ze}from"./index-DBs9Ljax.js";import{c as z,Z as I,C as qe,bu as Me,Y as Le,ba as ie,bb as ae,bc as re,q as Ue}from"./index-CCp_Tje1.js";import{r as ce}from"./passport-item-D-26SswO.js";import{b as W}from"./team-CMLIpBpv.js";import{l as le}from"./arrow-down.svg-C4FUKwt4.js";import{T as de}from"./index-BMx1LEw9.js";import{C as pe}from"./confirm-Bae4Q6hA.js";import{a4 as Fe,C as _}from"./vendor-utils-BqKQizRf.js";import{u as He}from"./session-BjDe0kgL.js";import{C as O}from"./click-to-copy-03_3P1nz.js";import{f as Oe}from"./index-BojVbZw0.js";import{D as Ve}from"./delete-confirm-BH4us77q.js";import{P as Xe}from"./permission-DSq5t-Gl.js";import{l as q}from"./vendor-arcblock-DRfhQ9Yl.js";import{B as Ze}from"./bundle-avatar-B4iapkc8.js";import{W as Ge}from"./did-address-DpdRECuJ.js";import{u as me}from"./use-mobile-BINJTzMb.js";import{A as Qe}from"./actions-Dfiiwkit.js";import{T as ne}from"./table-tips-BEPJMiqj.js";import{D as Je}from"./vendor-hooks-DpqqC65c.js";import"./lottie-web-4koyQiv_.js";import"./ua-parser-DP5omx3I.js";import"./util-CQLL-C6x.js";import"./base32-BqL5pnrU.js";import"./isURL-FbWmvlGY.js";import"./use-app-logo-C6aWxAKK.js";import"./vendor-mui-x-CQc01l4r.js";import"./AdapterDayjs-DqOr9LFk.js";function J({value:s}){const{t,locale:n}=S(),a=new Date;return new Date(s)<a?e.jsxs("span",{style:{color:"red"},children:[e.jsx(B,{value:s,locale:n}),`${t("setting.accessKey.expired",{time:""})}`]}):e.jsx(B,{mode:"daysLeft",value:s,locale:n,type:"all"})}J.propTypes={value:x.string.isRequired};function Y({value:s,onChange:t,...n}){const{t:a}=S(),i=g.useMemo(()=>[{value:"signature",title:a("setting.accessKey.signature"),description:a("setting.accessKey.signatureDesc")},{value:"simple",title:a("setting.accessKey.simple"),description:a("setting.accessKey.simpleDesc")}],[a]);return e.jsxs(V,{style:{width:"100%"},variant:"outlined",...n,children:[e.jsx(X,{children:a("setting.accessKey.authType")}),e.jsx(Z,{value:s,onChange:t,fullWidth:!0,label:a("setting.accessKey.authType"),IconComponent:l=>e.jsx(le,{...l,width:20,height:20}),children:i.map(l=>e.jsx(G,{value:l.value,children:e.jsxs(m,{children:[e.jsx("span",{children:l.title}),e.jsx(m,{sx:{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal"},children:l.description})]})},l.value))})]})}Y.propTypes={value:x.string.isRequired,onChange:x.func.isRequired};const ee=()=>{const s=z.RBAC_CONFIG.roles.filter(i=>i.passport),{inService:t}=I(),{roles:n}=W(),a=[...s,...t?n:[]];return Fe(a,"name").filter(i=>i.name!==z.ROLES.OWNER)};function ue(){const{session:s}=He(),t=ee();return g.useMemo(()=>{if(!s?.user?.role)return[];if(["owner","admin"].includes(s.user.role))return t;const a=t.filter(l=>l.name==="guest");return[...t.filter(l=>l.name!=="guest").filter(l=>s.user.passports.find(b=>b.role===l.name)),...a]},[t,s?.user?.passports,s?.user?.role])}function xe({onCreate:s=()=>{},remark:t=""}){const{api:n}=I(),{teamDid:a}=W(),{t:i}=S(),[l,b]=g.useState(!1),[p,j]=g.useState(null),u=ue(),K=()=>{b(!1),j(null)},C=async r=>{const{remark:w,passport:f,authType:o}=r;b(!0);const v=await n.createAccessKey({input:{teamDid:a,remark:w.trim(),passport:f,expireAt:r.expireAt?new Date(r.expireAt).getTime():null,authType:o}}),{data:R}=v;s(R),j(null),b(!1)},d={title:`${i("common.create")} ${i("accessKey")}`,description:(r,w,f)=>e.jsxs(Q,{sx:{gap:3},children:[e.jsx(U,{label:i("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,margin:"dense",value:r.remark,onChange:o=>{w({...r,remark:o.target.value,__disableConfirm:!r.passport||!o.target.value.trim()}),o.target.value.trim()?f(""):f(i("setting.accessKey.remarkInvalid"))},slotProps:{htmlInput:{"data-cy":"remark-input"}}}),e.jsxs(V,{style:{width:"100%"},variant:"outlined",children:[e.jsx(X,{sx:{width:"calc(100% - 46px)"},children:i("setting.accessKey.passport")}),e.jsx(Z,{"data-cy":"create-access-key-select-passport",value:r.passport,onChange:o=>{const v=o.target.value;f(null),w({...r,passport:v,__disableConfirm:!r.remark||!v})},fullWidth:!0,label:i("setting.accessKey.passport"),disabled:l,IconComponent:o=>e.jsx(le,{...o,width:20,height:20}),children:u.map(o=>e.jsx(G,{value:o.name,"data-cy":`create-access-key-passport-option-${o.name}`,children:e.jsxs(m,{children:[e.jsx("span",{children:o.title||o.name}),e.jsx(m,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:o.description})]})},o.name))})]}),e.jsx(Y,{value:r.authType,onChange:o=>{w({...r,authType:o.target.value})}}),e.jsx(de,{placeholder:i("setting.accessKey.expireTime"),value:r.expireAt,onChange:o=>{w({...r,expireAt:o,__disableConfirm:!r.passport||!r.remark||!o})}})]}),confirm:i("common.confirm"),cancel:i("common.cancel"),color:"primary",params:{remark:t,authType:"signature",__disableConfirm:!t.trim()},onConfirm:C,onCancel:K};return e.jsxs(e.Fragment,{children:[e.jsxs(F,{edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:r=>{r.stopPropagation(),j(d)},className:"rule-action",children:[l?e.jsx(ke,{size:16}):e.jsx(ve,{style:{fontSize:16}}),i("common.create")]}),p&&e.jsx(pe,{title:p.title,description:p.description,confirm:p.confirm,color:p.color,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel})]})}xe.propTypes={remark:x.string,onCreate:x.func};function fe({onConfirm:s=()=>{},accessKeyId:t,accessKeySecret:n,hideSecret:a=!0}){const{t:i}=g.useContext(Be),[l,b]=g.useState(!1),[p,j]=g.useState(()=>a),u=I(),K=()=>{j(!p)},C=f=>{b(f.target.checked)},d=_(window.location.origin,u?.info?.routing?.adminPath),r=g.useMemo(()=>a?`const Client = require('@blocklet/server-js');
1
+ import{r as g}from"./vendor-react-CTtPmzVP.js";import{j as e,y as O,x as X,bZ as Z,M as G,ak as m,W as x,a6 as ke,bi as ve,b6 as Q,z as U,bX as Te,a5 as Ae,at as P,T as E,cv as Ke,cu as Re,aZ as De,Q as Se,cD as Ie}from"./vendor-mui-core-DnR6WYuU.js";import{V as S,b1 as B,w as F,aT as Be,aJ as oe,ba as H,H as $e,b8 as Ne,K as Ee,aV as _e,aO as Pe,aN as We}from"./vendor-ux-B5w9dHEo.js";import{f as ze}from"./index-DBs9Ljax.js";import{c as z,Z as I,C as qe,bv as Me,Y as Le,ba as ie,bb as ae,bc as re,q as Ue}from"./index-BlSveGp8.js";import{r as ce}from"./passport-item-2TTg8u8i.js";import{b as W}from"./team-BDtQ1KMK.js";import{l as le}from"./arrow-down.svg-C4FUKwt4.js";import{T as de}from"./index-BAp7_uhB.js";import{C as pe}from"./confirm-8-up_m-t.js";import{a4 as Fe,C as _}from"./vendor-utils-drLlzTVq.js";import{u as He}from"./session-Cqrj8_SK.js";import{C as V}from"./click-to-copy-P5mPeLGL.js";import{f as Ve}from"./index-BojVbZw0.js";import{D as Oe}from"./delete-confirm-D_45dT2a.js";import{P as Xe}from"./permission-BJlcNSeA.js";import{l as q}from"./vendor-arcblock-BwnwoPBM.js";import{B as Ze}from"./bundle-avatar-BtFusdVR.js";import{W as Ge}from"./did-address-BjZvgDzc.js";import{u as me}from"./use-mobile-BINJTzMb.js";import{A as Qe}from"./actions-Dfiiwkit.js";import{T as ne}from"./table-tips-D04ygJ3S.js";import{D as Je}from"./vendor-hooks-cYMUGE4V.js";import"./lottie-web-4koyQiv_.js";import"./ua-parser-DP5omx3I.js";import"./util-CKkTy1Qb.js";import"./base32-Dms5J8BI.js";import"./isURL-BxZzphzW.js";import"./use-app-logo-CSWr6R3N.js";import"./vendor-mui-x-CQc01l4r.js";import"./AdapterDayjs-CyjsNBLx.js";function J({value:s}){const{t,locale:n}=S(),a=new Date;return new Date(s)<a?e.jsxs("span",{style:{color:"red"},children:[e.jsx(B,{value:s,locale:n}),`${t("setting.accessKey.expired",{time:""})}`]}):e.jsx(B,{mode:"daysLeft",value:s,locale:n,type:"all"})}J.propTypes={value:x.string.isRequired};function Y({value:s,onChange:t,...n}){const{t:a}=S(),i=g.useMemo(()=>[{value:"signature",title:a("setting.accessKey.signature"),description:a("setting.accessKey.signatureDesc")},{value:"simple",title:a("setting.accessKey.simple"),description:a("setting.accessKey.simpleDesc")}],[a]);return e.jsxs(O,{style:{width:"100%"},variant:"outlined",...n,children:[e.jsx(X,{children:a("setting.accessKey.authType")}),e.jsx(Z,{value:s,onChange:t,fullWidth:!0,label:a("setting.accessKey.authType"),IconComponent:l=>e.jsx(le,{...l,width:20,height:20}),children:i.map(l=>e.jsx(G,{value:l.value,children:e.jsxs(m,{children:[e.jsx("span",{children:l.title}),e.jsx(m,{sx:{maxWidth:510,fontSize:12,color:"#999",whiteSpace:"normal"},children:l.description})]})},l.value))})]})}Y.propTypes={value:x.string.isRequired,onChange:x.func.isRequired};const ee=()=>{const s=z.RBAC_CONFIG.roles.filter(i=>i.passport),{inService:t}=I(),{roles:n}=W(),a=[...s,...t?n:[]];return Fe(a,"name").filter(i=>i.name!==z.ROLES.OWNER)};function ue(){const{session:s}=He(),t=ee();return g.useMemo(()=>{if(!s?.user?.role)return[];if(["owner","admin"].includes(s.user.role))return t;const a=t.filter(l=>l.name==="guest");return[...t.filter(l=>l.name!=="guest").filter(l=>s.user.passports.find(b=>b.role===l.name)),...a]},[t,s?.user?.passports,s?.user?.role])}function xe({onCreate:s=()=>{},remark:t=""}){const{api:n}=I(),{teamDid:a}=W(),{t:i}=S(),[l,b]=g.useState(!1),[p,j]=g.useState(null),u=ue(),K=()=>{b(!1),j(null)},C=async r=>{const{remark:w,passport:f,authType:o}=r;b(!0);const v=await n.createAccessKey({input:{teamDid:a,remark:w.trim(),passport:f,expireAt:r.expireAt?new Date(r.expireAt).getTime():null,authType:o}}),{data:R}=v;s(R),j(null),b(!1)},d={title:`${i("common.create")} ${i("accessKey")}`,description:(r,w,f)=>e.jsxs(Q,{sx:{gap:3},children:[e.jsx(U,{label:i("setting.accessKey.tip"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,margin:"dense",value:r.remark,onChange:o=>{w({...r,remark:o.target.value,__disableConfirm:!r.passport||!o.target.value.trim()}),o.target.value.trim()?f(""):f(i("setting.accessKey.remarkInvalid"))},slotProps:{htmlInput:{"data-cy":"remark-input"}}}),e.jsxs(O,{style:{width:"100%"},variant:"outlined",children:[e.jsx(X,{sx:{width:"calc(100% - 46px)"},children:i("setting.accessKey.passport")}),e.jsx(Z,{"data-cy":"create-access-key-select-passport",value:r.passport,onChange:o=>{const v=o.target.value;f(null),w({...r,passport:v,__disableConfirm:!r.remark||!v})},fullWidth:!0,label:i("setting.accessKey.passport"),disabled:l,IconComponent:o=>e.jsx(le,{...o,width:20,height:20}),children:u.map(o=>e.jsx(G,{value:o.name,"data-cy":`create-access-key-passport-option-${o.name}`,children:e.jsxs(m,{children:[e.jsx("span",{children:o.title||o.name}),e.jsx(m,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:o.description})]})},o.name))})]}),e.jsx(Y,{value:r.authType,onChange:o=>{w({...r,authType:o.target.value})}}),e.jsx(de,{placeholder:i("setting.accessKey.expireTime"),value:r.expireAt,onChange:o=>{w({...r,expireAt:o,__disableConfirm:!r.passport||!r.remark||!o})}})]}),confirm:i("common.confirm"),cancel:i("common.cancel"),color:"primary",params:{remark:t,authType:"signature",__disableConfirm:!t.trim()},onConfirm:C,onCancel:K};return e.jsxs(e.Fragment,{children:[e.jsxs(F,{edge:"end",variant:"contained",color:"primary","data-cy":"add-access-key-btn",onClick:r=>{r.stopPropagation(),j(d)},className:"rule-action",children:[l?e.jsx(ke,{size:16}):e.jsx(ve,{style:{fontSize:16}}),i("common.create")]}),p&&e.jsx(pe,{title:p.title,description:p.description,confirm:p.confirm,color:p.color,cancel:p.cancel,params:p.params,onConfirm:p.onConfirm,onCancel:p.onCancel})]})}xe.propTypes={remark:x.string,onCreate:x.func};function fe({onConfirm:s=()=>{},accessKeyId:t,accessKeySecret:n,hideSecret:a=!0}){const{t:i}=g.useContext(Be),[l,b]=g.useState(!1),[p,j]=g.useState(()=>a),u=I(),K=()=>{j(!p)},C=f=>{b(f.target.checked)},d=_(window.location.origin,u?.info?.routing?.adminPath),r=g.useMemo(()=>a?`const Client = require('@blocklet/server-js');
2
2
  const ensureServerEndpoint = require('@abtnode/util/lib/ensure-server-endpoint');
3
3
  const { joinURL } = require('ufo');
4
4
 
@@ -16,7 +16,7 @@ const result = await client.getBlocklet(
16
16
  { input: { did: rootDid, attachRuntimeInfo: false } },
17
17
  { headers: { 'x-access-blocklet': rootDid } }
18
18
  );
19
- `:u.inService?`curl -H "Authorization: Bearer ${n}" "${_(window.blocklet?.appUrl,z.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/did/session")}"`:`curl -H "Authorization: Bearer ${n}" "${_(d,"/api/did/session")}"`,[a,t,n,u.inService,d]),w=g.useMemo(()=>a?`blocklet deploy --endpoint ${u.inService?window.blocklet?.appUrl:d} --access-key ${t} --access-secret ${n} {blockletPath}/.blocklet/bundle;`:null,[a,t,n,u.inService,d]);return e.jsxs(oe,{title:i("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:(f,o)=>{o!=="backdropClick"&&s()},showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(F,{disabled:a?!l:!1,onClick:s,color:"primary",autoFocus:!0,variant:"contained","data-cy":"submit-confirm-dialog",children:i("common.confirm")})}),"aria-labelledby":"simple-dialog-title",children:[e.jsx("div",{children:e.jsx(Ye,{children:i(a?"setting.accessKey.saveSecretTip":"setting.accessKey.viewSecret")})}),e.jsx("div",{style:{marginTop:"20px"}}),e.jsxs(L,{children:[e.jsx(M,{children:i("setting.accessKey.accessKeyId")}),e.jsx(O,{children:t})]}),e.jsxs(L,{children:[e.jsx(M,{children:i("setting.accessKey.accessKeySecret")}),p?e.jsx(F,{"data-cy":"show-secret-btn",color:"primary",onClick:K,children:i("setting.accessKey.showSecret")}):e.jsx(O,{children:n})]}),!p&&e.jsxs(L,{children:[e.jsx(M,{children:`Access Key ${i("setting.accessKey.usage")}`}),e.jsx(H,{code:r,language:"shell",showDefaultText:!1}),w&&e.jsx(H,{code:w,language:"shell",showDefaultText:!1})]}),a&&e.jsx("div",{children:e.jsx(Te,{value:"end",disabled:p,control:e.jsx(Ae,{checked:l,onChange:C}),label:i("setting.accessKey.iKnow"),labelPlacement:"end"})})]})}fe.propTypes={accessKeyId:x.string.isRequired,accessKeySecret:x.string.isRequired,onConfirm:x.func,hideSecret:x.bool};const M=P.div`
19
+ `:u.inService?`curl -H "Authorization: Bearer ${n}" "${_(window.blocklet?.appUrl,z.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/did/session")}"`:`curl -H "Authorization: Bearer ${n}" "${_(d,"/api/did/session")}"`,[a,t,n,u.inService,d]),w=g.useMemo(()=>a?`blocklet deploy --endpoint ${u.inService?window.blocklet?.appUrl:d} --access-key ${t} --access-secret ${n} {blockletPath}/.blocklet/bundle;`:null,[a,t,n,u.inService,d]);return e.jsxs(oe,{title:i("common.createSuccess"),fullWidth:!0,open:!0,disableEscapeKeyDown:!0,onClose:(f,o)=>{o!=="backdropClick"&&s()},showCloseButton:!1,actions:e.jsx("div",{children:e.jsx(F,{disabled:a?!l:!1,onClick:s,color:"primary",autoFocus:!0,variant:"contained","data-cy":"submit-confirm-dialog",children:i("common.confirm")})}),"aria-labelledby":"simple-dialog-title",children:[e.jsx("div",{children:e.jsx(Ye,{children:i(a?"setting.accessKey.saveSecretTip":"setting.accessKey.viewSecret")})}),e.jsx("div",{style:{marginTop:"20px"}}),e.jsxs(L,{children:[e.jsx(M,{children:i("setting.accessKey.accessKeyId")}),e.jsx(V,{children:t})]}),e.jsxs(L,{children:[e.jsx(M,{children:i("setting.accessKey.accessKeySecret")}),p?e.jsx(F,{"data-cy":"show-secret-btn",color:"primary",onClick:K,children:i("setting.accessKey.showSecret")}):e.jsx(V,{children:n})]}),!p&&e.jsxs(L,{children:[e.jsx(M,{children:`Access Key ${i("setting.accessKey.usage")}`}),e.jsx(H,{code:r,language:"shell",showDefaultText:!1}),w&&e.jsx(H,{code:w,language:"shell",showDefaultText:!1})]}),a&&e.jsx("div",{children:e.jsx(Te,{value:"end",disabled:p,control:e.jsx(Ae,{checked:l,onChange:C}),label:i("setting.accessKey.iKnow"),labelPlacement:"end"})})]})}fe.propTypes={accessKeyId:x.string.isRequired,accessKeySecret:x.string.isRequired,onConfirm:x.func,hideSecret:x.bool};const M=P.div`
20
20
  display: flex;
21
21
  justify-content: space-between;
22
22
  align-items: center;
@@ -27,14 +27,14 @@ const result = await client.getBlocklet(
27
27
  `,Ye=P.div`
28
28
  font-size: 16px;
29
29
  font-weight: bold;
30
- `;function he({accessKeyId:s,time:t,remark:n,onDelete:a=()=>{},onClose:i=()=>{}}){const{t:l,locale:b}=S(),{api:p}=I(),{teamDid:j}=W(),u=()=>{i()},K=async()=>{try{await p.deleteAccessKey({input:{teamDid:j,accessKeyId:s}}),a()}catch(r){$e.error(r?.message)}finally{u()}},C=r=>({key:`<b>${s}</b>`,name:`<b>${n}</b>`,time:qe(r,b),timeAge:Oe(new Date(r),Me(b))}),d={keyName:n,title:l("setting.accessKey.title"),description:t?`${l("setting.accessKey.description",C(t))}`:`${l("setting.accessKey.descriptionNoTime",{key:`<b>${s}</b>`,name:`<b>${n}</b>`})}`,confirmPlaceholder:l("setting.accessKey.confirm_desc",{name:n}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:K,onCancel:u};return e.jsx(Ve,{keyName:d.keyName,title:d.title,description:d.description,confirmPlaceholder:d.confirmPlaceholder,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})}he.propTypes={accessKeyId:x.string.isRequired,time:x.string.isRequired,remark:x.string.isRequired,onDelete:x.func,onClose:x.func};function ge({accessKeyId:s,remark:t="",onUpdate:n=()=>{},passport:a="",expireAt:i="",authType:l="signature",onClose:b=()=>{}}){const{api:p}=I(),{teamDid:j}=W(),{t:u}=S(),[K,C]=g.useState(!1),d=ue(),r=()=>{C(!1),b()},w=async o=>{const{accessKeyId:v,remark:R="",passport:h,expireAt:y,authType:$}=o;C(!0),await p.updateAccessKey({input:{teamDid:j,accessKeyId:v,remark:R.trim(),passport:h,expireAt:y?new Date(y).getTime():null,authType:$}}),n(),r()},f={title:`${u("common.update")} ${u("accessKey")}`,description:(o,v,R)=>e.jsxs(Q,{sx:{gap:3},children:[e.jsx(U,{label:u("setting.accessKey.accessKeyId"),autoComplete:"off",variant:"outlined",name:"accessKeyId",fullWidth:!0,autoFocus:!0,margin:"dense",value:o.accessKeyId,disabled:!0}),e.jsx(U,{label:u("common.remark"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,value:o.remark,onChange:h=>{v({...o,remark:h.target.value,__disableConfirm:!h.target.value.trim()}),h.target.value.trim()?R(""):R(u("setting.accessKey.remarkInvalid"))}}),e.jsxs(V,{style:{width:"100%"},variant:"outlined",children:[e.jsx(X,{children:u("setting.accessKey.passport")}),e.jsx(Z,{"data-cy":"update-access-key-select-passport",value:o.passport,onChange:h=>{const y=h.target.value;R(null),v({...o,passport:y,__disableConfirm:!o.remark||!y})},fullWidth:!0,label:u("setting.accessKey.passport"),disabled:K,children:d.map(h=>e.jsx(G,{value:h.name,"data-cy":`update-access-key-passport-option-${h.name}`,children:e.jsxs(m,{children:[e.jsx("span",{children:h.title||h.name}),e.jsx(m,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:h.description})]})},h.name))})]}),e.jsx(Y,{disabled:!0,value:o.authType,onChange:h=>{v({...o,authType:h.target.value})}}),e.jsx(de,{placeholder:u("setting.accessKey.expireTime"),value:o.expireAt,onChange:h=>{v({...o,expireAt:h,__disableConfirm:!o.passport||!o.remark||!h})}})]}),confirm:u("common.confirm"),cancel:u("common.cancel"),color:"primary",params:{accessKeyId:s,remark:t,passport:a,expireAt:i,authType:l},onConfirm:w,onCancel:r};return e.jsx(pe,{title:f.title,description:f.description,confirm:f.confirm,color:f.color,cancel:f.cancel,params:f.params,onConfirm:f.onConfirm,onCancel:f.onCancel})}ge.propTypes={accessKeyId:x.string.isRequired,remark:x.string,passport:x.string,expireAt:x.string,authType:x.string,onUpdate:x.func,onClose:x.func};function ye({accessKey:s,onCancel:t}){const{t:n}=S();return e.jsx(oe,{title:n("accessKey"),onClose:t,open:!0,PaperProps:{sx:{maxWidth:800,"@media (max-width: 768px)":{margin:"16px",maxWidth:"calc(100vw - 32px)"}}},fullWidth:!0,children:e.jsx(et,{children:e.jsx(be,{accessKey:s})})})}ye.propTypes={accessKey:x.object.isRequired,onCancel:x.func.isRequired};const et=P(m)`
30
+ `;function he({accessKeyId:s,time:t,remark:n,onDelete:a=()=>{},onClose:i=()=>{}}){const{t:l,locale:b}=S(),{api:p}=I(),{teamDid:j}=W(),u=()=>{i()},K=async()=>{try{await p.deleteAccessKey({input:{teamDid:j,accessKeyId:s}}),a()}catch(r){$e.error(r?.message)}finally{u()}},C=r=>({key:`<b>${s}</b>`,name:`<b>${n}</b>`,time:qe(r,b),timeAge:Ve(new Date(r),Me(b))}),d={keyName:n,title:l("setting.accessKey.title"),description:t?`${l("setting.accessKey.description",C(t))}`:`${l("setting.accessKey.descriptionNoTime",{key:`<b>${s}</b>`,name:`<b>${n}</b>`})}`,confirmPlaceholder:l("setting.accessKey.confirm_desc",{name:n}),confirm:l("common.delConfirm"),cancel:l("common.cancel"),onConfirm:K,onCancel:u};return e.jsx(Oe,{keyName:d.keyName,title:d.title,description:d.description,confirmPlaceholder:d.confirmPlaceholder,confirm:d.confirm,cancel:d.cancel,params:d.params,onConfirm:d.onConfirm,onCancel:d.onCancel})}he.propTypes={accessKeyId:x.string.isRequired,time:x.string.isRequired,remark:x.string.isRequired,onDelete:x.func,onClose:x.func};function ge({accessKeyId:s,remark:t="",onUpdate:n=()=>{},passport:a="",expireAt:i="",authType:l="signature",onClose:b=()=>{}}){const{api:p}=I(),{teamDid:j}=W(),{t:u}=S(),[K,C]=g.useState(!1),d=ue(),r=()=>{C(!1),b()},w=async o=>{const{accessKeyId:v,remark:R="",passport:h,expireAt:y,authType:$}=o;C(!0),await p.updateAccessKey({input:{teamDid:j,accessKeyId:v,remark:R.trim(),passport:h,expireAt:y?new Date(y).getTime():null,authType:$}}),n(),r()},f={title:`${u("common.update")} ${u("accessKey")}`,description:(o,v,R)=>e.jsxs(Q,{sx:{gap:3},children:[e.jsx(U,{label:u("setting.accessKey.accessKeyId"),autoComplete:"off",variant:"outlined",name:"accessKeyId",fullWidth:!0,autoFocus:!0,margin:"dense",value:o.accessKeyId,disabled:!0}),e.jsx(U,{label:u("common.remark"),autoComplete:"off",variant:"outlined",name:"remark",fullWidth:!0,autoFocus:!0,value:o.remark,onChange:h=>{v({...o,remark:h.target.value,__disableConfirm:!h.target.value.trim()}),h.target.value.trim()?R(""):R(u("setting.accessKey.remarkInvalid"))}}),e.jsxs(O,{style:{width:"100%"},variant:"outlined",children:[e.jsx(X,{children:u("setting.accessKey.passport")}),e.jsx(Z,{"data-cy":"update-access-key-select-passport",value:o.passport,onChange:h=>{const y=h.target.value;R(null),v({...o,passport:y,__disableConfirm:!o.remark||!y})},fullWidth:!0,label:u("setting.accessKey.passport"),disabled:K,children:d.map(h=>e.jsx(G,{value:h.name,"data-cy":`update-access-key-passport-option-${h.name}`,children:e.jsxs(m,{children:[e.jsx("span",{children:h.title||h.name}),e.jsx(m,{sx:{maxWidth:440,fontSize:12,color:"#999",whiteSpace:"normal",textAlign:"justify"},children:h.description})]})},h.name))})]}),e.jsx(Y,{disabled:!0,value:o.authType,onChange:h=>{v({...o,authType:h.target.value})}}),e.jsx(de,{placeholder:u("setting.accessKey.expireTime"),value:o.expireAt,onChange:h=>{v({...o,expireAt:h,__disableConfirm:!o.passport||!o.remark||!h})}})]}),confirm:u("common.confirm"),cancel:u("common.cancel"),color:"primary",params:{accessKeyId:s,remark:t,passport:a,expireAt:i,authType:l},onConfirm:w,onCancel:r};return e.jsx(pe,{title:f.title,description:f.description,confirm:f.confirm,color:f.color,cancel:f.cancel,params:f.params,onConfirm:f.onConfirm,onCancel:f.onCancel})}ge.propTypes={accessKeyId:x.string.isRequired,remark:x.string,passport:x.string,expireAt:x.string,authType:x.string,onUpdate:x.func,onClose:x.func};function ye({accessKey:s,onCancel:t}){const{t:n}=S();return e.jsx(oe,{title:n("accessKey"),onClose:t,open:!0,PaperProps:{sx:{maxWidth:800,"@media (max-width: 768px)":{margin:"16px",maxWidth:"calc(100vw - 32px)"}}},fullWidth:!0,children:e.jsx(et,{children:e.jsx(be,{accessKey:s})})})}ye.propTypes={accessKey:x.object.isRequired,onCancel:x.func.isRequired};const et=P(m)`
31
31
  margin-top: -16px;
32
32
 
33
33
  .tabs {
34
34
  margin-left: 0;
35
35
  margin-right: 0;
36
36
  }
37
- `;function be({accessKey:s}){const{t,locale:n}=S(),{blocklet:a}=Le(),i=I(),l=ee(),b=me(),p=(a?.children||[]).find(d=>d?.meta?.did===s.componentDid),j=l.find(d=>d.name===s.passport),u=j?j.title:s.passport,K=g.useMemo(()=>i.inService?`curl -H "Authorization: Bearer blocklet-${q.toBase58(s.accessKeyPublic)}" "${_(window.blocklet?.appUrl,z.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/did/session")}"`:`curl -H "Authorization: Bearer blocklet-${q.toBase58(s.accessKeyPublic)}" "${_(window.location.origin,i?.info?.routing?.adminPath,"/api/did/session")}"`,[s.accessKeyPublic,i.inService,i?.info?.routing?.adminPath]),C=[{title:t("common.baseInfo"),items:[{label:t("setting.accessKey.accessKeyId"),content:e.jsx(Ge,{did:s.accessKeyId,showQrcode:!0})},...s.authType==="simple"?[{label:t("setting.accessKey.accessKeySecret"),content:e.jsx(O,{children:`blocklet-${q.toBase58(s.accessKeyPublic)}`})}]:[],{label:t("common.role"),content:e.jsx(m,{children:ce(u,s.passport)})},{label:t("common.createdVia"),content:s.createdVia},{label:t("common.createdBy"),content:s.createdBy?e.jsx(ie,{showDid:!0,did:s.createdBy,cardType:re.Detailed,infoType:ae.Minimal,sx:{border:0,padding:0}}):"-"}]},{title:t("common.timeInfo"),items:[{label:t("common.createdAt"),content:s.createdAt?e.jsx(B,{value:s.createdAt,type:b?"absolute":"all",locale:n}):"-"},{label:t("common.lastUsedAt"),content:s.lastUsedAt?e.jsx(B,{value:s.lastUsedAt,type:b?"absolute":"all",locale:n}):"-"},{label:t("common.expiredAt"),content:s.expireAt?e.jsx(J,{value:s.expireAt}):t("common.neverExpired")}]},{title:t("common.otherInfo"),items:[{label:t("setting.accessKey.authType"),content:s.authType},{label:t("common.remark"),content:s.remark},...s.authType!=="signature"?[{label:t("setting.accessKey.resourceType"),content:s.resourceType||"-"},{label:t("setting.accessKey.resourceId"),content:s.resourceId||"-"}]:[],...p?[{label:t("setting.accessKey.component"),content:e.jsxs(m,{sx:{width:{xs:250,sm:400},display:"flex",alignItems:"center"},children:[e.jsx(Ze,{blocklet:p,ancestors:[a]}),e.jsx(m,{sx:{ml:"16px",minWidth:0},children:e.jsxs(m,{className:"component-header",children:[e.jsx(m,{className:"component-name",children:Ue.getDisplayName(p,!0)}),e.jsx(m,{className:"component-version",children:p?.meta?.version})]})})]},p)}]:[],s.authType!=="signature"?{label:t("setting.accessKey.usage"),content:e.jsx(H,{code:K,language:"shell",showDefaultText:!1})}:null].filter(Boolean)}];return e.jsx(tt,{gap:3,children:e.jsx(m,{className:"info-area",children:C.map(d=>e.jsxs(m,{sx:{mb:3},children:[e.jsx(E,{variant:"h6",sx:{mb:1.5},children:d.title}),e.jsx(m,{className:"info-grid",children:d.items.map(r=>e.jsxs(m,{className:"info-item",children:[e.jsx(m,{className:"info-label",children:e.jsx(E,{variant:"subtitle2",color:"textSecondary",children:r.label})}),e.jsx(m,{className:"info-content",sx:{flex:1,minWidth:0,"@media (max-width: 768px)":{width:"100%",flex:"none"}},children:r.content})]},r.label))})]},d.title))})})}be.propTypes={accessKey:x.object.isRequired};const tt=P(Q)`
37
+ `;function be({accessKey:s}){const{t,locale:n}=S(),{blocklet:a}=Le(),i=I(),l=ee(),b=me(),p=(a?.children||[]).find(d=>d?.meta?.did===s.componentDid),j=l.find(d=>d.name===s.passport),u=j?j.title:s.passport,K=g.useMemo(()=>i.inService?`curl -H "Authorization: Bearer blocklet-${q.toBase58(s.accessKeyPublic)}" "${_(window.blocklet?.appUrl,z.WELLKNOWN_SERVICE_PATH_PREFIX,"/api/did/session")}"`:`curl -H "Authorization: Bearer blocklet-${q.toBase58(s.accessKeyPublic)}" "${_(window.location.origin,i?.info?.routing?.adminPath,"/api/did/session")}"`,[s.accessKeyPublic,i.inService,i?.info?.routing?.adminPath]),C=[{title:t("common.baseInfo"),items:[{label:t("setting.accessKey.accessKeyId"),content:e.jsx(Ge,{did:s.accessKeyId,showQrcode:!0})},...s.authType==="simple"?[{label:t("setting.accessKey.accessKeySecret"),content:e.jsx(V,{children:`blocklet-${q.toBase58(s.accessKeyPublic)}`})}]:[],{label:t("common.role"),content:e.jsx(m,{children:ce(u,s.passport)})},{label:t("common.createdVia"),content:s.createdVia},{label:t("common.createdBy"),content:s.createdBy?e.jsx(ie,{showDid:!0,did:s.createdBy,cardType:re.Detailed,infoType:ae.Minimal,sx:{border:0,padding:0}}):"-"}]},{title:t("common.timeInfo"),items:[{label:t("common.createdAt"),content:s.createdAt?e.jsx(B,{value:s.createdAt,type:b?"absolute":"all",locale:n}):"-"},{label:t("common.lastUsedAt"),content:s.lastUsedAt?e.jsx(B,{value:s.lastUsedAt,type:b?"absolute":"all",locale:n}):"-"},{label:t("common.expiredAt"),content:s.expireAt?e.jsx(J,{value:s.expireAt}):t("common.neverExpired")}]},{title:t("common.otherInfo"),items:[{label:t("setting.accessKey.authType"),content:s.authType},{label:t("common.remark"),content:s.remark},...s.authType!=="signature"?[{label:t("setting.accessKey.resourceType"),content:s.resourceType||"-"},{label:t("setting.accessKey.resourceId"),content:s.resourceId||"-"}]:[],...p?[{label:t("setting.accessKey.component"),content:e.jsxs(m,{sx:{width:{xs:250,sm:400},display:"flex",alignItems:"center"},children:[e.jsx(Ze,{blocklet:p,ancestors:[a]}),e.jsx(m,{sx:{ml:"16px",minWidth:0},children:e.jsxs(m,{className:"component-header",children:[e.jsx(m,{className:"component-name",children:Ue.getDisplayName(p,!0)}),e.jsx(m,{className:"component-version",children:p?.meta?.version})]})})]},p)}]:[],s.authType!=="signature"?{label:t("setting.accessKey.usage"),content:e.jsx(H,{code:K,language:"shell",showDefaultText:!1})}:null].filter(Boolean)}];return e.jsx(tt,{gap:3,children:e.jsx(m,{className:"info-area",children:C.map(d=>e.jsxs(m,{sx:{mb:3},children:[e.jsx(E,{variant:"h6",sx:{mb:1.5},children:d.title}),e.jsx(m,{className:"info-grid",children:d.items.map(r=>e.jsxs(m,{className:"info-item",children:[e.jsx(m,{className:"info-label",children:e.jsx(E,{variant:"subtitle2",color:"textSecondary",children:r.label})}),e.jsx(m,{className:"info-content",sx:{flex:1,minWidth:0,"@media (max-width: 768px)":{width:"100%",flex:"none"}},children:r.content})]},r.label))})]},d.title))})})}be.propTypes={accessKey:x.object.isRequired};const tt=P(Q)`
38
38
  .info-card {
39
39
  margin-bottom: 24px;
40
40
  overflow: hidden;
@@ -1,4 +1,4 @@
1
- import{M as m,j as e,Q as c,b0 as B,P as C,ai as E,o as I,bV as P,O as z}from"./vendor-mui-core-DnR6WYuU.js";import{r as o}from"./vendor-react-CTtPmzVP.js";import{n as A}from"./vendor-utils-BqKQizRf.js";import{l as p}from"./vendor-ux-KtPBvlG0.js";function L({...r}){const{size:d="medium",color:i="primary",menu:a=[],children:s=null,variant:u="contained",onClick:x=A,menuButtonProps:f={},...h}=r,[j,l]=o.useState(!1),n=o.useRef(null),g=Array.isArray(a)?a.map((t,b)=>o.isValidElement(t)?t:o.createElement(m,{...t,key:b})):a,M=()=>{l(t=>!t)},y=t=>{n.current&&n.current.contains(t.target)||l(!1)},k=t=>{t.target.closest(".MuiMenuItem-root")&&l(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(v,{variant:u,size:d,color:i,ref:n,...h,children:[typeof s=="function"?s():e.jsx(c,{onClick:x,color:i,children:s}),e.jsx(c,{onClick:M,color:i,...f,"aria-label":"more functions",children:e.jsx(B,{})})]}),e.jsx(w,{open:j,anchorEl:n.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(C,{children:e.jsx(E,{onClickAway:y,children:e.jsx(I,{onClick:k,children:g})})})})]})}L.Item=m;const v=p(P)`
1
+ import{M as m,j as e,Q as c,b0 as B,P as C,ai as E,o as I,bV as P,O as z}from"./vendor-mui-core-DnR6WYuU.js";import{r as o}from"./vendor-react-CTtPmzVP.js";import{n as A}from"./vendor-utils-drLlzTVq.js";import{l as p}from"./vendor-ux-B5w9dHEo.js";function L({...r}){const{size:d="medium",color:i="primary",menu:a=[],children:s=null,variant:u="contained",onClick:x=A,menuButtonProps:f={},...h}=r,[j,l]=o.useState(!1),n=o.useRef(null),g=Array.isArray(a)?a.map((t,b)=>o.isValidElement(t)?t:o.createElement(m,{...t,key:b})):a,M=()=>{l(t=>!t)},y=t=>{n.current&&n.current.contains(t.target)||l(!1)},k=t=>{t.target.closest(".MuiMenuItem-root")&&l(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(v,{variant:u,size:d,color:i,ref:n,...h,children:[typeof s=="function"?s():e.jsx(c,{onClick:x,color:i,children:s}),e.jsx(c,{onClick:M,color:i,...f,"aria-label":"more functions",children:e.jsx(B,{})})]}),e.jsx(w,{open:j,anchorEl:n.current,placement:"bottom-end",disablePortal:!1,children:e.jsx(C,{children:e.jsx(E,{onClickAway:y,children:e.jsx(I,{onClick:k,children:g})})})})]})}L.Item=m;const v=p(P)`
2
2
  > .MuiButtonBase-root:last-of-type {
3
3
  min-width: 2em;
4
4
  padding-left: 0;
@@ -0,0 +1,270 @@
1
+ import{W as n,j as o,ak as f,f as y,b0 as A,av as v,D as B}from"./vendor-mui-core-DnR6WYuU.js";import{r as N}from"./vendor-react-CTtPmzVP.js";import{l as b,aM as H,V as W,m as V,k as P}from"./vendor-ux-B5w9dHEo.js";import{b0 as Q,bn as Y,bo as G,bp as O,k as J,bq as K,ae as U,a4 as X,aa as Z,a5 as C,a7 as ee}from"./index-BlSveGp8.js";import{ae as ne,Q as oe,I as te}from"./vendor-utils-drLlzTVq.js";import{a as ie}from"./vendor-hooks-cYMUGE4V.js";function L({name:e="",logo:t="",description:i="",...p}){if(!e&&!t&&!i)return null;const c=N.isValidElement(t)?t:o.jsx("img",{src:t,alt:e});return o.jsxs(re,{...p,children:[o.jsxs("div",{children:[t&&o.jsx(f,{component:"a",href:"/",className:"footer-brand-logo",children:c}),e&&o.jsx("div",{className:"footer-brand-name",children:e})]}),i&&o.jsx("div",{className:"footer-brand-desc",children:i})]})}L.propTypes={name:n.node,logo:n.node,description:n.string};const re=b("div")`
2
+ display: flex;
3
+ flex-direction: column;
4
+ font-size: 14px;
5
+ a {
6
+ text-decoration: none;
7
+ color: inherit;
8
+ }
9
+ > div:first-of-type {
10
+ display: flex;
11
+ align-items: center;
12
+ }
13
+ .footer-brand-logo {
14
+ display: flex;
15
+ align-items: center;
16
+ margin-right: 12px;
17
+ line-height: 1;
18
+ img,
19
+ svg {
20
+ width: auto;
21
+ height: 40px;
22
+ max-height: 40px;
23
+ }
24
+ }
25
+ .footer-brand-name {
26
+ font-size: 18px;
27
+ color: ${e=>e.theme.palette.grey[900]};
28
+ }
29
+ .footer-brand-desc {
30
+ white-space: pre-line;
31
+ margin-top: 16px;
32
+ color: ${e=>e.theme.palette.text.secondary};
33
+ }
34
+
35
+ ${e=>e.theme.breakpoints.down("sm")} {
36
+ width: auto;
37
+ }
38
+
39
+ ${e=>e.theme.breakpoints.down("md")} {
40
+ .footer-brand-logo {
41
+ img,
42
+ svg {
43
+ height: 32px;
44
+ max-height: 32px;
45
+ }
46
+ }
47
+ }
48
+ `;function T({links:e=[],flowLayout:t=!1,minColumns:i=1,maxColumns:p=4,...c}){const[d,m]=N.useState(-1),x=Q({key:"md"}),j=e.some(s=>s.items?.length),h=!x&&j&&ne(i)&&i>1&&p>=i,w=h?Math.min(Math.max(e.length,i),p):1,g=({label:s,link:r,icon:l,render:a,props:u})=>{let k=s;if(a)k=a({label:s,link:r,props:u});else if(r&&oe(r)){const M=r.startsWith("http")||r.startsWith("//"),I=G(r)?{}:{target:M?"_blank":"_self",rel:M?"noreferrer noopener":void 0};k=o.jsx("a",{href:r,"aria-label":`Footer link for ${s}`,...I,...u,children:s})}return o.jsxs(o.Fragment,{children:[l&&o.jsx(O,{icon:l,size:20,sx:{mr:.5}}),k]})},$=ie(()=>e?.length?t?e.map((s,r)=>o.jsx("span",{className:"footer-links-item",children:g(s)},r)):h?Y(e,{columns:w}).map((s,r)=>o.jsx("div",{className:"footer-links-column",children:s.filter(l=>l.group).map((l,a)=>{const{items:u}=l;return o.jsxs("div",{className:"footer-links-group",children:[o.jsx("span",{className:"footer-links-item",children:g(l)}),!!u?.length&&o.jsx("div",{className:"footer-links-sub",children:u.map((k,M)=>o.jsx("span",{className:y("footer-links-item",{"footer-links-item--new":k.isNew}),children:g(k)},M))})]},a)})},r)):e.map((s,r)=>{const{items:l}=s,a=r===d;return o.jsxs("div",{className:y("footer-links-group",{"footer-links-group--active":a}),onClick:()=>m(d===r?-1:r),children:[o.jsxs("span",{className:"footer-links-item",children:[g(s),!!l?.length&&o.jsx("span",{className:"footer-links-group-expand-icon",children:o.jsx(A,{style:{transform:`rotate(${a?180:0}deg)`}})})]}),!!l?.length&&o.jsx("div",{className:"footer-links-sub",children:l.map((u,k)=>o.jsx("span",{className:y("footer-links-item",{"footer-links-item--new":u.isNew}),children:g(u)},k))})]},r)}):null,[e,t,h,d]);return e?.length?o.jsx(se,{columns:w,...c,className:y(c.className,{"footer-links--grouped":j,"footer-links--flow":t,"footer-links--columns":h}),children:o.jsx("div",{className:"footer-links-inner",children:$})}):null}T.propTypes={links:n.arrayOf(n.shape({label:n.string,link:n.string,render:n.func,props:n.object})),flowLayout:n.bool,minColumns:n.number,maxColumns:n.number};const se=b("div",{shouldForwardProp:e=>e!=="columns"})`
49
+ overflow: hidden;
50
+ color: ${({theme:e})=>e.palette.text.secondary};
51
+ .footer-links-inner {
52
+ display: flex;
53
+ justify-content: space-between;
54
+ margin: 0 -8px;
55
+ }
56
+ .footer-links-group,
57
+ .footer-links-sub {
58
+ display: flex;
59
+ flex-direction: column;
60
+ }
61
+ .footer-links-group-expand-icon {
62
+ display: none;
63
+ position: absolute;
64
+ right: 16px;
65
+ top: 50%;
66
+ transform: translate(0, -50%);
67
+ line-height: 1;
68
+ svg {
69
+ width: auto;
70
+ height: 0.75em;
71
+ }
72
+ }
73
+ .footer-links-item {
74
+ display: inline-flex;
75
+ align-items: center;
76
+ position: relative;
77
+ padding: 6px 8px;
78
+ font-size: 14px;
79
+ white-space: nowrap;
80
+ &--new::after {
81
+ content: 'New';
82
+ color: ${({theme:e})=>e.palette.info.main};
83
+ background-color: ${({theme:e})=>e.palette.info.light};
84
+ padding: 1px 8px;
85
+ border-radius: 10px/50%;
86
+ margin-left: 8px;
87
+ }
88
+ }
89
+ &.footer-links--grouped {
90
+ .footer-links-group {
91
+ > .footer-links-item {
92
+ font-weight: 600;
93
+ color: ${({theme:e})=>e.palette.text.primary};
94
+ }
95
+ .footer-links-sub {
96
+ margin-top: 8px;
97
+ }
98
+ }
99
+ }
100
+ a {
101
+ display: inline-block;
102
+ max-width: 150px;
103
+ color: inherit;
104
+ text-decoration: none;
105
+ transition: color 0.2s ease-in-out;
106
+ &:hover {
107
+ color: ${({theme:e})=>e.palette.text.primary};
108
+ }
109
+ }
110
+ /* columns 布局 */
111
+ &.footer-links--columns {
112
+ .footer-links-inner {
113
+ gap: ${({columns:e})=>`${288/e}px`};
114
+ }
115
+ .footer-links-column {
116
+ display: flex;
117
+ flex-direction: column;
118
+ }
119
+ .footer-links-group {
120
+ .footer-links-sub {
121
+ margin-top: 2px;
122
+ margin-bottom: 12px;
123
+ }
124
+ }
125
+ }
126
+
127
+ /* flow 布局 */
128
+ &.footer-links--flow {
129
+ display: inline-flex;
130
+ .footer-links-inner {
131
+ justify-content: center;
132
+ flex-wrap: wrap;
133
+ margin: 0 -8px;
134
+ .footer-links-item {
135
+ padding: 0 8px;
136
+ }
137
+ .footer-links-item + .footer-links-item::before {
138
+ content: '';
139
+ position: absolute;
140
+ left: 0;
141
+ top: 50%;
142
+ transform: translate(0, -50%);
143
+ height: 1em;
144
+ border-left: 1px solid ${e=>e.theme.palette.text.secondary};
145
+ }
146
+ }
147
+ }
148
+
149
+ /* 移动端样式 */
150
+ ${e=>e.theme.breakpoints.down("md")} {
151
+ .footer-links-inner {
152
+ flex-direction: column;
153
+ margin: 0;
154
+ }
155
+ .footer-links-sub {
156
+ display: none;
157
+ }
158
+ .footer-links-group {
159
+ position: relative;
160
+ padding: 12px 0;
161
+ .footer-links-item .footer-links-group-expand-icon {
162
+ display: inline-block;
163
+ }
164
+ }
165
+ .footer-links-group + .footer-links-group {
166
+ border-top: 1px solid ${e=>e.theme.palette.grey[200]};
167
+ }
168
+ .footer-links-group--active {
169
+ .footer-links-sub {
170
+ display: flex;
171
+ flex-direction: row;
172
+ flex-wrap: wrap;
173
+ .footer-links-item {
174
+ flex: 0 0 50%;
175
+ }
176
+ }
177
+ }
178
+ .footer-links-item {
179
+ padding-left: 0;
180
+ padding-right: 0;
181
+ font-size: 13px;
182
+ }
183
+ &.footer-links--grouped {
184
+ .footer-links-group {
185
+ > .footer-links-item {
186
+ font-size: 14px;
187
+ }
188
+ }
189
+ }
190
+
191
+ &.footer-links--flow {
192
+ .footer-links-inner {
193
+ flex-direction: row;
194
+ }
195
+ }
196
+ }
197
+ `;function E({items:e=null,...t}){return e?.length?o.jsx(le,{...t,children:e.map((i,p)=>o.jsx("a",{href:i.link,target:"_blank","aria-label":`Social media icon${i.title?` for ${i.title}`:""}`,rel:"noreferrer",children:o.jsx(O,{icon:i.icon||i.title,size:24,component:"span"})},p))}):null}E.propTypes={items:n.arrayOf(n.shape({icon:n.string,link:n.string}))};const le=b("div")`
198
+ display: inline-flex;
199
+ flex-wrap: wrap;
200
+ align-items: center;
201
+ justify-content: center;
202
+ gap: 20px;
203
+ a {
204
+ color: ${e=>e.theme.palette.text.secondary};
205
+ text-decoration: none;
206
+ transition: color 0.2s ease-in-out;
207
+ &:hover {
208
+ color: ${({theme:e})=>e.palette.text.primary};
209
+ }
210
+ }
211
+ ${e=>e.theme.breakpoints.down("md")} {
212
+ gap: 12px;
213
+ }
214
+ `;function F({owner:e="ArcBlock",year:t=`${new Date().getFullYear()}`,...i}){return o.jsxs(ae,{...i,children:["Copyright © ",t," ",e]})}F.propTypes={owner:n.string,year:n.string};const ae=b("p")`
215
+ display: flex;
216
+ align-items: center;
217
+ margin: 0;
218
+ font-size: 13px;
219
+ `;function z({children:e=null,autoCenter:t=!1,...i}){return e?o.jsx(pe,{...i,className:y(i.className,{"footer-row-auto-center":t}),children:e}):null}z.propTypes={children:n.any,autoCenter:n.bool};const pe=b(f)`
220
+ display: flex;
221
+ justify-content: space-between;
222
+ & + & {
223
+ margin-top: 24px;
224
+ }
225
+ &.footer-row-auto-center > *:only-child {
226
+ margin: 0 auto;
227
+ }
228
+
229
+ ${({theme:e})=>e.breakpoints.down("md")} {
230
+ align-items: stretch;
231
+ flex-direction: column;
232
+ gap: ${({theme:e})=>e.spacing(1)};
233
+ > * {
234
+ flex: 1 0 100%;
235
+ }
236
+ &.footer-row-auto-center > * {
237
+ margin: 0 auto;
238
+ }
239
+ }
240
+ `;function _({elements:e,data:t,className:i="",...p}){const c=!!t.navigation?.length;let d=null;return c?d=o.jsxs(v,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},justifyContent:"space-between"},children:[o.jsxs(f,{sx:{flex:"1 1 auto",paddingRight:{xs:0,md:3},display:"flex",flexDirection:"column",alignItems:"flex-start",gap:2,pb:3},children:[o.jsx(f,{children:e.brand}),o.jsx(f,{sx:{lineHeight:1},children:e.socialMedia})]}),o.jsx(f,{sx:({palette:m})=>({mb:3,borderTop:{xs:`1px solid ${m.grey[200]}`,md:0}}),children:e.navigation})]}):d=o.jsxs(v,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:"space-between",gap:2,pb:3},children:[o.jsx(f,{children:e.brand}),o.jsx(f,{sx:{lineHeight:1},children:e.socialMedia})]}),o.jsx(ce,{...p,className:y({"footer--with-navs":c},i),children:o.jsxs(v,{style:{padding:0},children:[d,o.jsx(f,{sx:{pt:3,borderTop:1,borderColor:"divider"}}),o.jsx(v,{children:o.jsxs(z,{autoCenter:!0,children:[e.copyright,e.links]})})]})})}_.propTypes={elements:n.shape({brand:n.element,navigation:n.element,socialMedia:n.element,copyright:n.element,links:n.element}).isRequired,data:n.object.isRequired,className:n.string};const ce=b("div")`
241
+ padding: 32px 0 24px 0;
242
+ .footer-brand-name,
243
+ .footer-brand-desc {
244
+ display: none;
245
+ }
246
+ &.footer--with-navs {
247
+ ${e=>e.theme.breakpoints.up("md")} {
248
+ .footer-brand-desc {
249
+ max-width: 360px;
250
+ display: block;
251
+ }
252
+ }
253
+ }
254
+ && .footer-brand-logo {
255
+ margin-right: 0;
256
+ }
257
+ `;function D({elements:e,data:t,...i}){return o.jsx(de,{...i,children:o.jsx(v,{style:{padding:0},children:o.jsxs(v,{className:"plain-layout-container",children:[e.links&&o.jsxs(z,{sx:{width:1},autoCenter:!0,children:[e.copyright,e.links]}),!e.links&&o.jsxs(o.Fragment,{children:[N.cloneElement(e.brand,{name:null,description:null}),e.copyright]})]})})})}D.propTypes={elements:n.shape({brand:n.element,navigation:n.element,socialMedia:n.element,copyright:n.element,links:n.element}).isRequired,data:n.object.isRequired};const de=b("div")`
258
+ padding: 24px 0;
259
+ .plain-layout-container {
260
+ display: flex;
261
+ justify-content: space-between;
262
+ align-items: center;
263
+ flex-wrap: wrap;
264
+ gap: 8px;
265
+ }
266
+ `,R=[{name:"plain",support:(e,t)=>!t.navigation?.length&&!t.socialMedia?.length,component:D},{name:"standard",support:()=>!0,component:_}],me=R.reduce((e,t)=>({...e,[t.name]:t}),{});function S({...e}){const{brand:t=null,navigation:i=null,socialMedia:p=null,copyright:c=null,links:d=null,layout:m="auto",...x}=e,j=()=>t?o.jsx(L,{...t}):null,h=()=>i?.length?o.jsx(T,{links:i,minColumns:3}):null,w=()=>p?.length?o.jsx(E,{items:p}):null,g=()=>{const l=c?.owner||t?.name;return l?o.jsx(F,{owner:l,year:c?.year||void 0}):null},$=()=>d?.length?o.jsx(T,{flowLayout:!0,links:d}):null,s={brand:j(),navigation:h(),socialMedia:w(),copyright:g(),links:$()};let r=null;if(m==="auto"?r=R.find(l=>l.support(s,e)).component:r=me[m]?.component,!r)throw new Error(`layout ${m} is not supported.`);return o.jsxs(f,{...x,className:y("blocklet__footer",x.className),sx:[{position:"relative"},...Array.isArray(x.sx)?x.sx:[x.sx]],children:[o.jsx(r,{elements:s,data:e}),o.jsx(f,{sx:{position:"absolute",right:16,bottom:0,fontSize:12,color:"transparent","::selection":{background:"#000",color:"#fff"}},children:window?.blocklet?.version})]})}S.propTypes={brand:n.shape({name:n.node,description:n.string,logo:n.node}),navigation:n.arrayOf(n.shape({label:n.node,link:n.string})),socialMedia:n.arrayOf(n.shape({icon:n.node,link:n.string})),copyright:n.shape({owner:n.string,year:n.oneOfType([n.string,n.number])}),links:n.arrayOf(n.shape({label:n.node,link:n.string})),layout:n.oneOf(["auto","standard","plain"])};function q({meta:e={},theme:t={},...i}){const{locale:p,defaultLocale:c}=W()||{},d=B(),m=N.useMemo(()=>{const a=Object.assign({},window.blocklet,e);try{return X(a)}catch(u){return console.error("Failed to format blocklet info",u,a),a}},[e]),x=N.useMemo(()=>V(d,t),[d,t]),j=Z({key:"xs",meta:e,theme:t});if(!m.appName)return null;const{appName:h,appDescription:w,description:g,copyright:$}=m,s=x.palette.background.default,r={footerNav:C({navigation:m?.navigation?.footer,locale:p,defaultLocale:c,section:"footer"})||[],socialMedia:C({navigation:m?.navigation?.social,locale:p,defaultLocale:c,section:"footer"})||[],links:C({navigation:m?.navigation?.bottom,locale:p,defaultLocale:c,section:"footer"})||[]},l={brand:{name:h,description:w||g,logo:j},navigation:ee(r.footerNav,a=>({...a,label:a.title,link:a.link}),"items"),copyright:$,socialMedia:r.socialMedia,links:r.links.map(a=>({...a,label:a.title}))};return o.jsx(P,{theme:x,children:o.jsx(fe,{...l,...te(i,["bordered"]),$bordered:i?.bordered,$bgcolor:s})})}q.propTypes={meta:U,theme:n.object};const fe=b(S)`
267
+ ${({$bordered:e,theme:t})=>`border-top: 1px solid ${e&&t.palette.divider};`}
268
+ color: ${({theme:e})=>e.palette.text.secondary};
269
+ ${({$bgcolor:e})=>e&&`background-color: ${e};`}
270
+ `,ye=H(K(q),{FallbackComponent:J});export{ye as _};
@@ -1,4 +1,4 @@
1
- import{r as x}from"./vendor-react-CTtPmzVP.js";import{j as e,W as d,am as mt,ak as N,T as Q,U as ke,y as Fe,bk as Ve,b$ as Re,bX as Te,a5 as Ie,Q as Ce,dH as Pe,aN as Ee,a6 as Ge,D as Qe,cD as ht,ad as Xe,e4 as gt,e5 as xt,at as ae,b4 as He,n as bt,J as yt,x as jt,bZ as St,M as Ue,cB as vt}from"./vendor-mui-core-DnR6WYuU.js";import{e as ee,F as Ct,aC as pe}from"./vendor-utils-BqKQizRf.js";import{H as U,aV as Nt,V as Y,cM as wt,m as Ye,$ as Je,w as Ae,aO as Ze,bh as be,aJ as Rt,aU as Tt,b0 as It,b7 as Et}from"./vendor-ux-KtPBvlG0.js";import{Z as At,Q as H,c as E,C as Dt,a1 as qe}from"./index-CCp_Tje1.js";import{a as X,g as De}from"./vendor-hooks-DpqqC65c.js";import{S as me}from"./shorten-label-C4py9TLA.js";import{v as et}from"./index-CiQKtWIW.js";import{R as tt,A as Ot,S as Lt,a as kt,B as Ft}from"./list-CY3qo6ZZ.js";import{i as Pt,e as _t,N as Bt}from"./team-CMLIpBpv.js";import{W as zt}from"./did-address-DpdRECuJ.js";import{p as st}from"./util-CQLL-C6x.js";import{D as Wt,g as Mt}from"./traffic-CMz6_p1P.js";import{B as nt}from"./bundle-avatar-B4iapkc8.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-DRfhQ9Yl.js";import"./server-logo-notext.svg-xZ-i1SpD.js";import"./session-BjDe0kgL.js";import"./isURL-FbWmvlGY.js";import"./use-app-logo-C6aWxAKK.js";import"./base32-BqL5pnrU.js";import"./useAsyncRetry-v1aVMcV-.js";import"./useAsync-BSd-eaZO.js";import"./iframe-DEDZfTQS.js";import"./index-B4sVJOOj.js";import"./index-DBs9Ljax.js";import"./base-chart-CRe-9w5H.js";import"./index-DZnXlBSX.js";import"./vendor-mui-x-CQc01l4r.js";import"./AdapterDayjs-DqOr9LFk.js";const at=x.createContext({}),{Provider:Kt,Consumer:Hs}=at;function Ht({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:i}}=At(),[l,b]=x.useState([]),[m,S]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),h=X(()=>s.meta?.did,[s]),[y,v]=x.useState([]),[P,F]=x.useState({}),w=X(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),q=async({page:p=1,pageSize:g=20,...T}={})=>{if(!h)return[];try{const D={paging:{page:p,pageSize:g},...T,teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0},{dids:O,...z}=D;let _="";O&&O.includes("system")&&(_="system");const ie=O?O.filter(oe=>oe!=="system"):[],se={...z,source:_,componentDids:ie},Z=await n.getNotificationSendLog({input:se});return F(se),b(Z.list),S(Z.paging),Z.list}catch(D){return U.error(D.message),[]}},M=async()=>{const p=await n.getNotificationComponents({input:{teamDid:h}});v(p.componentDids)},L=x.useCallback(p=>{const g=s.children.find(T=>T.meta?.did===p);if(g)return g.ancestors=[s],g},[s]),k=async({notificationId:p,receivers:g,channels:T,...D})=>{await n.resendNotification({input:{teamDid:h,notificationId:p,receivers:g,channels:T.map(O=>O==="wallet"?E.NOTIFICATION_SEND_CHANNEL.WALLET:O==="pushKit"?E.NOTIFICATION_SEND_CHANNEL.PUSH:O),...D}})},$=x.useCallback(async p=>(await n.getUser({input:{teamDid:h,user:{did:p},options:{enableConnectedAccount:!0}}})).user,[n,h]),V=x.useCallback(async({page:p=1,pageSize:g=20,...T}={})=>{try{const D={paging:{page:p,pageSize:g},...T,userName:T.searchText||"",teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:D})}catch(D){throw U.error(D.message),D}},[n,h]);x.useEffect(()=>{h&&M()},[h]),i(E.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,p=>{w.has(p.notificationId)&&q(P)},[w,P]),i(E.EVENTS.NOTIFICATION_BLOCKLET_CREATE,p=>{w.has(p.id)||q(P)},[w,P]);const J={fetch:q,data:l,paging:m,blocklet:s,getComponent:L,resendNotification:k,getUser:$,componentDids:y,getReceivers:V,inService:r,teamDid:h};return e.jsx(Kt,{value:{notificationRecords:J},children:t})}function _e(){const{notificationRecords:t}=x.useContext(at);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ut={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(Nt,{type:Ut[t],children:t})}const qt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case E.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function it(t,s,n={}){const{status:r,updatedAt:i,reason:l="",channel:b="wallet"}=n,m=i?t("notification.sendStatus.sentTime",{date:Dt(i,s)}):"",S=qt(t,b,l);return r===E.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:m,reason:S}:r===E.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:m}:{status:"pending",title:t("notification.sendStatus.pending"),reason:S,sentTime:m}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],$e=["info","success","error","warning"],ot=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},rt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},$t=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ot(t),enabled:n}},Vt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:rt(t),enabled:n}},Gt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),Qt=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),ge=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),Xt=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],xe=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},Yt=(t,s="")=>{if(s&&Le.includes(s)){const l=`${s}SendRecord`,b=ee(t,l,[]);return xe(b)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return xe(l)}const i={};return Le.forEach(l=>{const b=`${l}SendRecord`,m=ee(t,b,[]),S=xe(m);i[l]=S}),r.length>0&&r.forEach(l=>{const b=n[l]??[],m=xe(b);i[l]=m}),i},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},je=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},Jt=t=>{switch(t){case E.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case E.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case E.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case E.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},lt=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:i,title:l="",sentTime:b="",reason:m=""}=t,S=[l,m].filter(Boolean).join(", ");return e.jsx(mt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(Q,{color:"inherit",sx:{fontSize:12},children:S}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(N,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(N,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(N,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[i]}}),e.jsx(N,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[i]}})]}),e.jsx(Q,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Se.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Se({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:i}=Y();return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(Q,{children:[s,": "]}),t.map(l=>{const b=it(r,i,{status:l});return e.jsx(ke,{size:"small",label:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:b,enableTooltip:!1,children:b.title})}),onDelete:m=>n(m,l)},l)})]})}Be.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function Be({filterList:t,onChange:s,index:n,column:r,filterValues:i,label:l,renderLabel:b}){return e.jsxs(Fe,{className:"filter-container",children:[e.jsx(Ve,{component:"legend",children:l}),e.jsx(Re,{row:!0,children:i.map(m=>e.jsx(Te,{control:e.jsx(Ie,{checked:t[n].indexOf(m.value??m)>-1,onChange:S=>{const h=[...t];S.target.checked?h[n]=[...h[n],m.value??m]:h[n]=h[n].filter(y=>y!==(m.value??m)),s(h[n],n,r)},name:m.value??m}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(m)})},m.value??m))})]})}function we(t){return e.jsx(Be,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:i}){const{t:l,locale:b}=Y(),m=it(l,b,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(N,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:m,showTitle:!0}),m.status!=="success"&&e.jsx(Ce,{className:"resend-btn",size:"small",startIcon:e.jsx(Pe,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:i,children:l("notification.resend")})]})}ze.propTypes={value:d.array.isRequired,onChange:d.func};function ze({value:t,onChange:s}){const{locale:n}=Y(),r=H().toDate(),[i,l]=x.useState(null),b=x.useCallback(h=>{l(i?null:h.currentTarget)},[i]),m=!!i,S=x.useCallback(h=>{if(!h.startDate||!h.endDate){U.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){U.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(Q,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ce,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ee,{open:m,anchorEl:i,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Wt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Mt(r),onChange:S})})]})}We.propTypes={itemComponent:d.elementType.isRequired};function We({itemComponent:t,...s}){const{t:n}=Y();return!s?.filterList?.filter(i=>i.length).length?null:e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(wt.TableFilterList,{...s,ItemComponent:t})})]})}function Me({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const i=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(ke,{label:t,variant:"outlined",...i&&l?{onDelete:i}:{}})}Me.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const Zt=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];ct.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function ct({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Y(),[i,l]=x.useState(Zt),[b,m]=x.useState(!0),S=(y,v)=>{v.checked=y.target.checked;const P=i.map(F=>({...F,checked:F.value===v.value?v.checked:F.checked}));l(P)},h=y=>{y.stopPropagation(),n({channels:i.filter(v=>v.checked).map(v=>v.value),isResendFailedOnly:b})};return e.jsxs(N,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(Q,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(N,{className:"choose-channel",children:e.jsxs(Fe,{component:"fieldset",variant:"standard",children:[e.jsx(Ve,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Re,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:i.map(y=>e.jsx(Te,{control:e.jsx(Ie,{checked:y.checked,onChange:v=>S(v,y),name:y.value}),label:y.label},y.value))})]})}),e.jsx(N,{className:"resend-config-footer",children:e.jsx(Re,{children:e.jsx(Te,{control:e.jsx(Ie,{checked:b,onChange:y=>m(y.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(N,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ce,{onClick:y=>{y.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ce,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Ge,{size:16}),r("common.confirm")]})]})]})}dt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function dt({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:i}=Y(),l=Qe(),b=x.useMemo(()=>Ye(l,lt()),[l]),{getReceivers:m,inService:S,teamDid:h,getUser:y,blocklet:v}=_e(),[P,F]=x.useState(!1),[w,q]=x.useState([]),M=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[k,$]=x.useState(null),[V,J]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,g]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[T,D]=x.useState([]),O=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],z=async()=>{if(!P&&t)try{F(!0);const a=await m({notificationId:t,...p}),o=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,S)}}));q(o),J(a.paging),F(!1)}catch(a){U.error(a.message),F(!1)}};x.useEffect(()=>{z()},[p]);const _=a=>{a.stopPropagation();const o=a.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ie=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Ae,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(Pe,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:_,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:V.page-1,rowsPerPage:V.pageSize,count:V.total,searchText:p.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:T,onRowSelectionChange:(a,o)=>{D(o.map(c=>c.dataIndex))},customToolbarSelect:ie},Z=({page:a,rowsPerPage:o,searchText:c,filterList:C})=>{const[,B=[],G=[],K=[]]=C;p.pageSize!==o?g(W=>({...W,pageSize:o,page:1})):p.page!==a+1?g(W=>({...W,page:a+1})):p.searchText!==c?g(W=>({...W,searchText:c,page:1})):pe(B,p.walletSendStatus)?pe(G,p.pushKitSendStatus)?pe(K,p.emailSendStatus)||g(W=>({...W,emailSendStatus:K,page:1})):g(W=>({...W,pushKitSendStatus:G,page:1})):g(W=>({...W,walletSendStatus:B,page:1}))},oe=x.useCallback(async(a,o)=>{if(!o)return!1;const c=await y(o);return c?a==="wallet"?Gt(c):a==="email"?$t(v,c):a==="pushKit"?Vt(v,c):a==="webhook"?Qt(c):!0:!1},[y,v]),Ne=x.useCallback(a=>Xt(r,a),[r]),f=()=>{M.anchorEl=null,M.position=null,$(null)},u=()=>{L.anchorEl=null,L.position=null},j=async(a,o,c=!0,C="")=>{if(!(!o.length||!a.length))try{s(a,o,c,C),L.anchorEl||(await ge(.5),f())}catch(B){console.error("handleResend error",{error:B})}},I=async({channels:a,isResendFailedOnly:o})=>{const c=T.map(C=>w[C].receiver);await j(a,c,o),await ge(.5),u(),D([])},A=async(a,o=[],c=!0)=>{try{await j(["webhook"],[a.receiver],c,o)}catch(C){U.error(C.response?C.response.statusText:C.message)}},R=async(a,o,c,C=[],B=!0)=>{if(a.stopPropagation(),Yt(o,c)>=4){U.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await A(o,C,B);return}if(a){const K=a.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}$({channel:c});try{const K=await oe(c,o.receiver);await ge(1),$({channel:c,result:K}),(typeof K=="boolean"&&K||Ct(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[o.receiver],B),L.anchorEl||(await ge(.5),f()))}catch(K){U.error(K.message)}},re=a=>{g(o=>({...o,dateRange:a,page:1}))},ne=(a,o,c,C)=>{a.stopPropagation();const B=c.filter(G=>G!==o);g(G=>({...G,[C]:B,page:1}))},le=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:o,receiver:c}=w[a];return o?e.jsxs(N,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Je,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(zt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:p.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Wallet",filterList:a,onChange:o,index:c,column:C,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"wallet",onResend:B=>R(B,w[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"pushkit",onResend:B=>R(B,w[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Push Kit",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"email",onResend:B=>R(B,w[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Email",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:o}=w[a];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[C,B]=c,G=B[0];return e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(N,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:C},C),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:K=>R(K,w[a],"webhook",[C],!1)})]},C)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:o}=w[a];return e.jsx(tt,{value:o,locale:i,shouldUpdate:!0})}}}],[w,i,p,r]),ft=[e.jsx(ze,{value:p.dateRange,onChange:re},"date-picker"),e.jsx(Ae,{variant:"contained",size:"small",color:"primary",loading:P,startIcon:e.jsx(ht,{}),onClick:()=>z(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(N,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ts,{children:e.jsxs(Xe,{theme:b,children:[e.jsx(Ze,{className:"receivers-table",locale:i,loading:P,columns:le,data:w,onChange:Z,options:se,customButtons:ft,components:{TableFilterList:a=>e.jsx(We,{...a,itemComponent:o=>e.jsx(Me,{...o,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ee,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(ss,{children:[e.jsxs(Q,{variant:"body1",component:"div",className:"check-title",children:[k?.channel," Checking"]}),e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:Ne(k?.channel).map(a=>{const{type:o,pass:c,fail:C}=a;return!k?.result||k?.result?.[o]?e.jsxs(Q,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:k?.result?.[o]?be.success.main:"inherit"},children:[k?.result?e.jsx(gt,{}):e.jsx(Ge,{size:12,sx:{color:be.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs(Q,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:be.error.main},children:[e.jsx(xt,{}),e.jsx("span",{children:C})]},o)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:u,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(ct,{loading:n,onCancel:u,onConfirm:I})})]})})})}const es=x.memo(dt),ts=ae.div`
1
+ import{r as x}from"./vendor-react-CTtPmzVP.js";import{j as e,W as d,am as mt,ak as N,T as Q,U as ke,y as Fe,bk as Ve,b$ as Re,bX as Te,a5 as Ie,Q as Ce,dH as Pe,aN as Ee,a6 as Ge,D as Qe,cD as ht,ad as Xe,e4 as gt,e5 as xt,at as ae,b4 as He,n as bt,J as yt,x as jt,bZ as St,M as Ue,cB as vt}from"./vendor-mui-core-DnR6WYuU.js";import{e as ee,F as Ct,aC as pe}from"./vendor-utils-drLlzTVq.js";import{H as U,aU as Nt,V as Y,cM as wt,m as Ye,$ as Je,w as Ae,aO as Ze,bh as be,aJ as Rt,aW as Tt,b1 as It,b8 as Et}from"./vendor-ux-B5w9dHEo.js";import{Z as At,Q as H,c as E,C as Dt,a1 as qe}from"./index-BlSveGp8.js";import{a as X,g as De}from"./vendor-hooks-cYMUGE4V.js";import{S as me}from"./shorten-label-C4py9TLA.js";import{v as et}from"./index-DM9inqt9.js";import{R as tt,A as Ot,S as Lt,a as kt,B as Ft}from"./list-miYDTaUU.js";import{i as Pt,e as _t,N as Bt}from"./team-BDtQ1KMK.js";import{W as zt}from"./did-address-BjZvgDzc.js";import{p as st}from"./util-CKkTy1Qb.js";import{D as Wt,g as Mt}from"./traffic-8-96Vd63.js";import{B as nt}from"./bundle-avatar-BtFusdVR.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-BwnwoPBM.js";import"./server-logo-notext.svg-xZ-i1SpD.js";import"./session-Cqrj8_SK.js";import"./isURL-BxZzphzW.js";import"./use-app-logo-CSWr6R3N.js";import"./base32-Dms5J8BI.js";import"./useAsyncRetry--1T7wYe2.js";import"./useAsync-xXSiXzwr.js";import"./iframe-C0AgQvx8.js";import"./index-BTECQw0p.js";import"./index-DBs9Ljax.js";import"./base-chart-Cs8rd9f2.js";import"./index-B5vc0eG5.js";import"./vendor-mui-x-CQc01l4r.js";import"./AdapterDayjs-CyjsNBLx.js";const at=x.createContext({}),{Provider:Kt,Consumer:Hs}=at;function Ht({children:t,blocklet:s=""}){const{api:n,inService:r,ws:{useSubscription:i}}=At(),[l,b]=x.useState([]),[m,S]=x.useState({total:0,pageSize:20,pageCount:0,page:1}),h=X(()=>s.meta?.did,[s]),[y,v]=x.useState([]),[P,F]=x.useState({}),w=X(()=>l.length?new Set(l.map(p=>p.id)):new Set,[l]),q=async({page:p=1,pageSize:g=20,...T}={})=>{if(!h)return[];try{const D={paging:{page:p,pageSize:g},...T,teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0},{dids:O,...z}=D;let _="";O&&O.includes("system")&&(_="system");const ie=O?O.filter(oe=>oe!=="system"):[],se={...z,source:_,componentDids:ie},Z=await n.getNotificationSendLog({input:se});return F(se),b(Z.list),S(Z.paging),Z.list}catch(D){return U.error(D.message),[]}},M=async()=>{const p=await n.getNotificationComponents({input:{teamDid:h}});v(p.componentDids)},L=x.useCallback(p=>{const g=s.children.find(T=>T.meta?.did===p);if(g)return g.ancestors=[s],g},[s]),k=async({notificationId:p,receivers:g,channels:T,...D})=>{await n.resendNotification({input:{teamDid:h,notificationId:p,receivers:g,channels:T.map(O=>O==="wallet"?E.NOTIFICATION_SEND_CHANNEL.WALLET:O==="pushKit"?E.NOTIFICATION_SEND_CHANNEL.PUSH:O),...D}})},$=x.useCallback(async p=>(await n.getUser({input:{teamDid:h,user:{did:p},options:{enableConnectedAccount:!0}}})).user,[n,h]),V=x.useCallback(async({page:p=1,pageSize:g=20,...T}={})=>{try{const D={paging:{page:p,pageSize:g},...T,userName:T.searchText||"",teamDid:h,dateRange:T.dateRange?[H(T.dateRange[0]).toISOString(),H(T.dateRange[1]).toISOString()]:void 0};return await n.getReceivers({input:D})}catch(D){throw U.error(D.message),D}},[n,h]);x.useEffect(()=>{h&&M()},[h]),i(E.EVENTS.NOTIFICATION_BLOCKLET_UPDATE,p=>{w.has(p.notificationId)&&q(P)},[w,P]),i(E.EVENTS.NOTIFICATION_BLOCKLET_CREATE,p=>{w.has(p.id)||q(P)},[w,P]);const J={fetch:q,data:l,paging:m,blocklet:s,getComponent:L,resendNotification:k,getUser:$,componentDids:y,getReceivers:V,inService:r,teamDid:h};return e.jsx(Kt,{value:{notificationRecords:J},children:t})}function _e(){const{notificationRecords:t}=x.useContext(at);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const Ut={info:"primary",success:"success",error:"error",warning:"warning"};function he({severity:t="info"}){return e.jsx(Nt,{type:Ut[t],children:t})}const qt=(t,s,n="")=>{if(!n||!s)return"";switch(n){case E.NOTIFICATION_SEND_FAILED_REASON.USER_DISABLED:return t("notification.sendStatus.reason.disabled",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_UNAVAILABLE:return t("notification.sendStatus.reason.unavailable",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.CHANNEL_DISABLED:return t("notification.sendStatus.reason.notSent",{channel:s});case E.NOTIFICATION_SEND_FAILED_REASON.NOT_ONLINE:return t("notification.sendStatus.reason.offline");default:return n}};function it(t,s,n={}){const{status:r,updatedAt:i,reason:l="",channel:b="wallet"}=n,m=i?t("notification.sendStatus.sentTime",{date:Dt(i,s)}):"",S=qt(t,b,l);return r===E.NOTIFICATION_SEND_STATUS.FAILED?{status:"failed",title:t("notification.sendStatus.failed"),sentTime:m,reason:S}:r===E.NOTIFICATION_SEND_STATUS.SENT?{status:"success",title:t("notification.sendStatus.success"),sentTime:m}:{status:"pending",title:t("notification.sendStatus.pending"),reason:S,sentTime:m}}const Oe={pending:"#aaaaaa",success:"#34BE74",failed:"#D0021B"},Le=["wallet","pushKit","email"],$e=["info","success","error","warning"],ot=t=>{const{settings:s}=t;return s?.notification?.email?.enabled},rt=t=>{const{settings:s}=t;return s?.notification?.pushKit?.enabled},$t=(t,s)=>{const n=ee(s,"extra.notifications.email",!0);return{available:ot(t),enabled:n}},Vt=(t,s)=>{const n=ee(s,"extra.notifications.push",!0);return{available:rt(t),enabled:n}},Gt=t=>({enabled:ee(t,"extra.notifications.wallet",!0)}),Qt=t=>({enabled:ee(t,"extra.webhooks",[]).length>0}),ge=(t=3)=>new Promise(s=>{setTimeout(()=>{s()},t*1e3)}),Xt=(t,s)=>s==="wallet"||s==="webhook"?[{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:s==="pushKit"||s==="email"?[{channel:s,type:"available",pass:t("notification.sendStatus.reason.available",{channel:s}),fail:t("notification.sendStatus.reason.unavailable",{channel:s})},{channel:s,type:"enabled",pass:t("notification.sendStatus.reason.enabled",{channel:s}),fail:t("notification.sendStatus.reason.disabled",{channel:s})}]:[],xe=(t=[])=>{const s=H().startOf("day");return t.filter(n=>H(n.sendAt).isSame(s,"day")).length},Yt=(t,s="")=>{if(s&&Le.includes(s)){const l=`${s}SendRecord`,b=ee(t,l,[]);return xe(b)}const n=ee(t,"webhook",{}),r=Object.keys(n??{})??[];if(s&&r.includes(s)){const l=n[s]??[];return xe(l)}const i={};return Le.forEach(l=>{const b=`${l}SendRecord`,m=ee(t,b,[]),S=xe(m);i[l]=S}),r.length>0&&r.forEach(l=>{const b=n[l]??[],m=xe(b);i[l]=m}),i},ye=(t,s,n)=>{if(!Array.isArray(t))throw new Error("Invalid filterList or index");return t[n].splice(s,1),t},je=(t,s)=>{if(!Array.isArray(s))throw new Error("filters must be an array");return s.length?!s.includes(t):!1},Jt=t=>{switch(t){case E.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case E.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case E.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case E.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},lt=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:i,title:l="",sentTime:b="",reason:m=""}=t,S=[l,m].filter(Boolean).join(", ");return e.jsx(mt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(Q,{color:"inherit",sx:{fontSize:12},children:S}),e.jsx("span",{children:b})]}):null,arrow:!0,placement:"top",children:e.jsxs(N,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsxs(N,{sx:{position:"relative",minHeight:14,minWidth:14,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsx(N,{style:{opacity:.15},sx:{position:"absolute",width:"100%",height:"100%",borderRadius:"50%",bgcolor:Oe[i]}}),e.jsx(N,{sx:{position:"absolute",width:"55%",height:"55%",borderRadius:"50%",bgcolor:Oe[i]}})]}),e.jsx(Q,{color:"inherit",sx:{fontSize:12},children:n?l:r})]})})}te.propTypes={config:d.object.isRequired,enableTooltip:d.bool,showTitle:d.bool,children:d.node};Se.propTypes={list:d.array.isRequired,label:d.string.isRequired,onDelete:d.func};function Se({list:t,label:s,onDelete:n=()=>{}}){const{t:r,locale:i}=Y();return e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsxs(Q,{children:[s,": "]}),t.map(l=>{const b=it(r,i,{status:l});return e.jsx(ke,{size:"small",label:e.jsx(N,{sx:{display:"flex",alignItems:"center",gap:"4px"},children:e.jsx(te,{config:b,enableTooltip:!1,children:b.title})}),onDelete:m=>n(m,l)},l)})]})}Be.propTypes={filterList:d.array.isRequired,onChange:d.func.isRequired,index:d.number.isRequired,column:d.object.isRequired,filterValues:d.array.isRequired,label:d.string.isRequired,renderLabel:d.func.isRequired};function Be({filterList:t,onChange:s,index:n,column:r,filterValues:i,label:l,renderLabel:b}){return e.jsxs(Fe,{className:"filter-container",children:[e.jsx(Ve,{component:"legend",children:l}),e.jsx(Re,{row:!0,children:i.map(m=>e.jsx(Te,{control:e.jsx(Ie,{checked:t[n].indexOf(m.value??m)>-1,onChange:S=>{const h=[...t];S.target.checked?h[n]=[...h[n],m.value??m]:h[n]=h[n].filter(y=>y!==(m.value??m)),s(h[n],n,r)},name:m.value??m}),label:e.jsx("span",{style:{display:"flex",alignItems:"center"},children:b(m)})},m.value??m))})]})}function we(t){return e.jsx(Be,{...t,renderLabel:s=>e.jsx(te,{enableTooltip:!1,config:{status:s.status},children:s.label})})}ce.propTypes={status:d.number.isRequired,updatedAt:d.string.isRequired,reason:d.string,channel:d.string,onResend:d.func};function ce({status:t,updatedAt:s,reason:n="",channel:r="wallet",onResend:i}){const{t:l,locale:b}=Y(),m=it(l,b,{status:t,updatedAt:s,reason:n,channel:r});return e.jsxs(N,{sx:{display:"flex",alignItems:"center",gap:1},children:[e.jsx(te,{config:m,showTitle:!0}),m.status!=="success"&&e.jsx(Ce,{className:"resend-btn",size:"small",startIcon:e.jsx(Pe,{}),sx:{fontSize:12,color:"rgba(0, 0, 0, 0.87)",fontWeight:400,".MuiButton-startIcon":{mr:"2px"}},onClick:i,children:l("notification.resend")})]})}ze.propTypes={value:d.array.isRequired,onChange:d.func};function ze({value:t,onChange:s}){const{locale:n}=Y(),r=H().toDate(),[i,l]=x.useState(null),b=x.useCallback(h=>{l(i?null:h.currentTarget)},[i]),m=!!i,S=x.useCallback(h=>{if(!h.startDate||!h.endDate){U.error("Please select a date range");return}if(H(h.startDate).isAfter(h.endDate)||!H(h.startDate).isValid()||!H(h.endDate).isValid()){U.error("Invalid date range");return}s([h.startDate,h.endDate]),l(null)},[s]);return e.jsxs("div",{children:[e.jsx(Q,{component:"div",variant:"h5",color:"textPrimary",style:{fontSize:18,fontWeight:"bold"},sx:{mb:0},children:e.jsxs(Ce,{onClick:b,variant:"outlined",size:"small",color:"inherit",children:[qe(t[0],n)," - ",qe(t[1],n)]})}),e.jsx(Ee,{open:m,anchorEl:i,onClose:()=>{l(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"},children:e.jsx(Wt,{open:!0,maxDate:r,initialDateRange:{startDate:t[0],endDate:t[1]},toggle:b,definedRanges:Mt(r),onChange:S})})]})}We.propTypes={itemComponent:d.elementType.isRequired};function We({itemComponent:t,...s}){const{t:n}=Y();return!s?.filterList?.filter(i=>i.length).length?null:e.jsxs(N,{sx:{display:"flex",gap:1,alignItems:"center"},children:[e.jsx("div",{className:"toolbar-filter-title",children:n("notification.filter")}),e.jsx("div",{className:"toolbar-filter-content",children:e.jsx(wt.TableFilterList,{...s,ItemComponent:t})})]})}function Me({label:t,onDelete:s,canDelete:n=()=>!0,...r}){const i=s&&typeof s=="function"?s:void 0;let l=!0;return n&&typeof n=="function"&&(l=n({label:t,...r})),e.jsx(ke,{label:t,variant:"outlined",...i&&l?{onDelete:i}:{}})}Me.propTypes={label:d.string.isRequired,onDelete:d.func,canDelete:d.func};const Zt=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];ct.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function ct({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Y(),[i,l]=x.useState(Zt),[b,m]=x.useState(!0),S=(y,v)=>{v.checked=y.target.checked;const P=i.map(F=>({...F,checked:F.value===v.value?v.checked:F.checked}));l(P)},h=y=>{y.stopPropagation(),n({channels:i.filter(v=>v.checked).map(v=>v.value),isResendFailedOnly:b})};return e.jsxs(N,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(Q,{variant:"body1",component:"div",className:"check-title",sx:{fontWeight:700,mb:1},children:r("notification.config")}),e.jsx(N,{className:"choose-channel",children:e.jsxs(Fe,{component:"fieldset",variant:"standard",children:[e.jsx(Ve,{component:"legend",children:r("notification.selectChannels")}),e.jsx(Re,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:1},children:i.map(y=>e.jsx(Te,{control:e.jsx(Ie,{checked:y.checked,onChange:v=>S(v,y),name:y.value}),label:y.label},y.value))})]})}),e.jsx(N,{className:"resend-config-footer",children:e.jsx(Re,{children:e.jsx(Te,{control:e.jsx(Ie,{checked:b,onChange:y=>m(y.target.checked)}),label:r("notification.resendFailedOnly")})})}),e.jsxs(N,{className:"resend-config-footer-tip",sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[e.jsx(Ce,{onClick:y=>{y.stopPropagation(),s()},color:"inherit",children:r("common.cancel")}),e.jsxs(Ce,{onClick:h,color:"primary",disabled:t,variant:"contained",autoFocus:!0,style:{marginLeft:8},children:[t&&e.jsx(Ge,{size:16}),r("common.confirm")]})]})]})}dt.propTypes={notificationId:d.string.isRequired,handleResend:d.func,resending:d.bool};function dt({notificationId:t,handleResend:s,resending:n=!1}){const{t:r,locale:i}=Y(),l=Qe(),b=x.useMemo(()=>Ye(l,lt()),[l]),{getReceivers:m,inService:S,teamDid:h,getUser:y,blocklet:v}=_e(),[P,F]=x.useState(!1),[w,q]=x.useState([]),M=De({anchorEl:null,position:null}),L=De({anchorEl:null,position:null}),[k,$]=x.useState(null),[V,J]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,g]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[T,D]=x.useState([]),O=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],z=async()=>{if(!P&&t)try{F(!0);const a=await m({notificationId:t,...p}),o=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,S)}}));q(o),J(a.paging),F(!1)}catch(a){U.error(a.message),F(!1)}};x.useEffect(()=>{z()},[p]);const _=a=>{a.stopPropagation();const o=a.currentTarget;L.anchorEl=o;const c=o.getBoundingClientRect();L.position={top:c.top+window.scrollY,left:c.left+window.scrollX}},ie=a=>a.data.length?e.jsx("div",{style:{display:"flex",alignItems:"center",padding:"10px"},children:e.jsx(Ae,{className:"resend-btn",size:"small",color:"primary",variant:"contained",startIcon:e.jsx(Pe,{}),sx:{".MuiButton-startIcon":{mr:"2px"}},onClick:_,children:r("notification.resend")})}):null,se={sort:!1,download:!1,print:!1,selectableRows:"multiple",searchPlaceholder:r("common.search"),searchAlwaysOpen:!1,filterType:"checkbox",searchDebounceTime:300,page:V.page-1,rowsPerPage:V.pageSize,count:V.total,searchText:p.searchText,tableBodyMaxHeight:"calc(80vh - 260px)",rowsSelected:T,onRowSelectionChange:(a,o)=>{D(o.map(c=>c.dataIndex))},customToolbarSelect:ie},Z=({page:a,rowsPerPage:o,searchText:c,filterList:C})=>{const[,B=[],G=[],K=[]]=C;p.pageSize!==o?g(W=>({...W,pageSize:o,page:1})):p.page!==a+1?g(W=>({...W,page:a+1})):p.searchText!==c?g(W=>({...W,searchText:c,page:1})):pe(B,p.walletSendStatus)?pe(G,p.pushKitSendStatus)?pe(K,p.emailSendStatus)||g(W=>({...W,emailSendStatus:K,page:1})):g(W=>({...W,pushKitSendStatus:G,page:1})):g(W=>({...W,walletSendStatus:B,page:1}))},oe=x.useCallback(async(a,o)=>{if(!o)return!1;const c=await y(o);return c?a==="wallet"?Gt(c):a==="email"?$t(v,c):a==="pushKit"?Vt(v,c):a==="webhook"?Qt(c):!0:!1},[y,v]),Ne=x.useCallback(a=>Xt(r,a),[r]),f=()=>{M.anchorEl=null,M.position=null,$(null)},u=()=>{L.anchorEl=null,L.position=null},j=async(a,o,c=!0,C="")=>{if(!(!o.length||!a.length))try{s(a,o,c,C),L.anchorEl||(await ge(.5),f())}catch(B){console.error("handleResend error",{error:B})}},I=async({channels:a,isResendFailedOnly:o})=>{const c=T.map(C=>w[C].receiver);await j(a,c,o),await ge(.5),u(),D([])},A=async(a,o=[],c=!0)=>{try{await j(["webhook"],[a.receiver],c,o)}catch(C){U.error(C.response?C.response.statusText:C.message)}},R=async(a,o,c,C=[],B=!0)=>{if(a.stopPropagation(),Yt(o,c)>=4){U.warning(r("notification.resendLimit"));return}if(!Le.includes(c)){await A(o,C,B);return}if(a){const K=a.currentTarget,W=K.getBoundingClientRect();M.anchorEl=K,M.position={top:W.top+window.scrollY,left:W.left+window.scrollX}}$({channel:c});try{const K=await oe(c,o.receiver);await ge(1),$({channel:c,result:K}),(typeof K=="boolean"&&K||Ct(K)&&Object.values(K).every(W=>!!W))&&(await s([c],[o.receiver],B),L.anchorEl||(await ge(.5),f()))}catch(K){U.error(K.message)}},re=a=>{g(o=>({...o,dateRange:a,page:1}))},ne=(a,o,c,C)=>{a.stopPropagation();const B=c.filter(G=>G!==o);g(G=>({...G,[C]:B,page:1}))},le=X(()=>[{label:r("notification.receiver"),name:"receiver",width:200,options:{filter:!1,customBodyRenderLite:a=>{const{receiverUser:o,receiver:c}=w[a];return o?e.jsxs(N,{"data-cy":`member-name-${o.fullName}`,sx:{display:"flex",alignItems:"center",gap:1,justifyContent:"flex-start"},children:[e.jsx(Je,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(zt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:p.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Wallet",filterList:a,onChange:o,index:c,column:C,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"wallet",onResend:B=>R(B,w[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"pushkit",onResend:B=>R(B,w[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Push Kit",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"email",onResend:B=>R(B,w[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Email",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:o}=w[a];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[C,B]=c,G=B[0];return e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(N,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:C},C),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:K=>R(K,w[a],"webhook",[C],!1)})]},C)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:o}=w[a];return e.jsx(tt,{value:o,locale:i,shouldUpdate:!0})}}}],[w,i,p,r]),ft=[e.jsx(ze,{value:p.dateRange,onChange:re},"date-picker"),e.jsx(Ae,{variant:"contained",size:"small",color:"primary",loading:P,startIcon:e.jsx(ht,{}),onClick:()=>z(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(N,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ts,{children:e.jsxs(Xe,{theme:b,children:[e.jsx(Ze,{className:"receivers-table",locale:i,loading:P,columns:le,data:w,onChange:Z,options:se,customButtons:ft,components:{TableFilterList:a=>e.jsx(We,{...a,itemComponent:o=>e.jsx(Me,{...o,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ee,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(ss,{children:[e.jsxs(Q,{variant:"body1",component:"div",className:"check-title",children:[k?.channel," Checking"]}),e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:"4px"},children:Ne(k?.channel).map(a=>{const{type:o,pass:c,fail:C}=a;return!k?.result||k?.result?.[o]?e.jsxs(Q,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:k?.result?.[o]?be.success.main:"inherit"},children:[k?.result?e.jsx(gt,{}):e.jsx(Ge,{size:12,sx:{color:be.primary.main}}),e.jsx("span",{children:c})]},o):e.jsxs(Q,{variant:"body1",component:"div",className:"check-item",sx:{display:"flex",alignItems:"center",gap:"4px",color:be.error.main},children:[e.jsx(xt,{}),e.jsx("span",{children:C})]},o)})})]})}),L.anchorEl&&e.jsx(Ee,{open:!!L.anchorEl,anchorReference:"anchorPosition",anchorPosition:L.position,onClose:u,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsx(ct,{loading:n,onCancel:u,onConfirm:I})})]})})})}const es=x.memo(dt),ts=ae.div`
2
2
  td.MuiTableCell-footer {
3
3
  border: none !important;
4
4
  }
@@ -1,4 +1,4 @@
1
- import{j as e,T as i}from"./vendor-mui-core-DnR6WYuU.js";import{aa as p,ag as c}from"./vendor-utils-BqKQizRf.js";import{l as x}from"./vendor-ux-KtPBvlG0.js";function y({name:t,nameFormatter:r=o=>typeof o=="string"?o.split(" ").map(f=>p(c(f))).join(" "):o,layout:n="horizontal",children:a,valueComponent:l="div",nameWidth:m=90,...s}){return e.jsxs(d,{layout:n,width:m,...s,children:[e.jsx(i,{color:"textSecondary",className:"info-row__name",children:r(t)}),a&&e.jsx(i,{color:"textPrimary",component:l,className:"info-row__value",children:a})]})}const d=x("div")`
1
+ import{j as e,T as i}from"./vendor-mui-core-DnR6WYuU.js";import{ab as p,ag as c}from"./vendor-utils-drLlzTVq.js";import{l as x}from"./vendor-ux-B5w9dHEo.js";function y({name:t,nameFormatter:r=o=>typeof o=="string"?o.split(" ").map(f=>p(c(f))).join(" "):o,layout:n="horizontal",children:a,valueComponent:l="div",nameWidth:m=90,...s}){return e.jsxs(d,{layout:n,width:m,...s,children:[e.jsx(i,{color:"textSecondary",className:"info-row__name",children:r(t)}),a&&e.jsx(i,{color:"textPrimary",component:l,className:"info-row__value",children:a})]})}const d=x("div")`
2
2
  display: flex;
3
3
  flex-direction: ${t=>t.layout==="vertical"?"column":"row"};
4
4
  justify-content: flex-start;
@@ -1,4 +1,4 @@
1
- import{D as w1,J as K1,j as r,Y as Y1,$ as W1,I as q1,cE as _1,ar as y1,ak as U,bb as R,bj as I1,b6 as $1,am as B1,T,bf as e6,z as t6,cF as n6,a6,Q as r6}from"./vendor-mui-core-DnR6WYuU.js";import{C as x,a as i6,af as S1,J as M,c as s6,Q as o6,F as c6}from"./vendor-utils-BqKQizRf.js";import{V as l6,x as F1,J as u6,ay as H,l as C6,q as p6,aJ as d6,w as t1,bc as n1}from"./vendor-ux-KtPBvlG0.js";import{r as t}from"./vendor-react-CTtPmzVP.js";import{q as L1,b as v1,a as Z}from"./vendor-hooks-DpqqC65c.js";import{bv as Y,h as W,bw as U1,bx as h6,l as m6,by as E6,az as g6}from"./index-CCp_Tje1.js";import{x as f6}from"./index-DRYJ0xIl.js";import{f as A6}from"./index-BojVbZw0.js";import{v as a1}from"./index-CeGNmiXz.js";const j=Y({});function D6({key:e}={key:"md"}){const n=w1();return K1(n.breakpoints.down(e))}var A=(e=>(e[e.NETWORK_ERROR=1001]="NETWORK_ERROR",e[e.UNAUTHORIZED=1002]="UNAUTHORIZED",e[e.EXPIRED=1003]="EXPIRED",e[e.PAST_DUE=1004]="PAST_DUE",e[e.INVALID=1005]="INVALID",e[e.UNIT_LIMIT=1006]="UNIT_LIMIT",e[e.CORS_BLOCKED=1007]="CORS_BLOCKED",e[e.INCOMPATIBLE=1008]="INCOMPATIBLE",e))(A||{}),O1=(e=>(e.DEFAULT="default",e.SUCCEEDED="succeeded",e.FAILED="failed",e.PENDING="pending",e))(O1||{}),F=(e=>(e.APP_DISCONNECTED="app-disconnected",e.APP_RESTORE="app-restore",e.APP_BACKUP="app-backup",e.APP_CONNECTED="app-connected",e.APP_OBJECTS_SYNC="app-objects-sync",e))(F||{});function x6({endpoint:e,deps:n=[]}){return L1(async()=>{if(!W(e))return;const{headers:a}=await j.head(e,{timeout:1e3*30,params:{withExtras:!0}}),[i,s,c,u,l,C,d,p,m,g]=[a["x-space-name"],a["x-subscription-id"],a["x-listable"]==="true",a["x-readable"]==="true",a["x-writeable"]==="true",a["x-space-version"],a["x-space-owner-did"],a["x-space-is-available"],a["x-error-code"],a["x-is-site-admin"]],h=i?decodeURIComponent(i):"";if(p===void 0||m===void 0){const f=c&&u&&l;return{version:C,name:h,subscriptionId:s,ownerDid:d||"",isAvailable:f,errorCode:f?0:A.UNAUTHORIZED,isSiteAdmin:g==="true"}}return{version:C,name:h,subscriptionId:s,ownerDid:d,isAvailable:p==="true",errorCode:parseInt(m,10),isSiteAdmin:g==="true"}},{refreshDeps:[e].concat(n),onError(a){console.error(a)}})}const w6=U1.flatten({common:{cancel:"Cancel",confirm:"Confirm",delete:"Delete",error:"Error",open:"Open",unknown:"Unknown",invalidUrl:"Invalid url: {url}",upgrade:"Upgrade",viewMore:"View More"},storage:{spaces:{authorize:{title:"Connect {appName} to DID Spaces",scan:"Use your DID Wallet to scan the QR code below to allow the app {appName} to connect to DID Spaces",success:"Connected successfully"},connect:{reconnect:"Reconnect Now",useSpaceGateway:"Connect using the DID Spaces gateway",useWallet:"Connect to DID Spaces",howToGetGatewayUrl:"How to get the url of did spaces",providerForStorage:"Please connect your DID Spaces"},connected:{title:"Connected DID Spaces",tag:"Connected"},disconnected:{tag:"Disconnected"},error:{tag:"Need Attention",blockedByCors:"Access blocked by CORS",unreachable:"DID Space is unreachable",expired:"DID Spaces has expired, click this link to re-subscribe",pastDue:"DID Spaces has unpaid bills, click this link to complete payment",invalid:"DID Spaces subscription anomaly, click this link to check",unitLimit:"DID Spaces free quota has been used up, click this link to pay for the upgrade",cors:`The connection request may fail due to CORS restrictions:
1
+ import{D as w1,J as K1,j as r,Y as Y1,$ as W1,I as q1,cE as _1,ar as y1,ak as U,bb as R,bj as I1,b6 as $1,am as B1,T,bf as e6,z as t6,cF as n6,a6,Q as r6}from"./vendor-mui-core-DnR6WYuU.js";import{C as x,a as i6,af as S1,J as M,c as s6,Q as o6,F as c6}from"./vendor-utils-drLlzTVq.js";import{V as l6,x as F1,J as u6,ay as H,l as C6,q as p6,aJ as d6,w as t1,bc as n1}from"./vendor-ux-B5w9dHEo.js";import{r as t}from"./vendor-react-CTtPmzVP.js";import{q as L1,b as v1,a as Z}from"./vendor-hooks-cYMUGE4V.js";import{bw as Y,h as W,bx as U1,by as h6,l as m6,bz as E6,az as g6}from"./index-BlSveGp8.js";import{x as f6}from"./index-DRYJ0xIl.js";import{f as A6}from"./index-BojVbZw0.js";import{v as a1}from"./index-Cv24xb2K.js";const j=Y({});function D6({key:e}={key:"md"}){const n=w1();return K1(n.breakpoints.down(e))}var A=(e=>(e[e.NETWORK_ERROR=1001]="NETWORK_ERROR",e[e.UNAUTHORIZED=1002]="UNAUTHORIZED",e[e.EXPIRED=1003]="EXPIRED",e[e.PAST_DUE=1004]="PAST_DUE",e[e.INVALID=1005]="INVALID",e[e.UNIT_LIMIT=1006]="UNIT_LIMIT",e[e.CORS_BLOCKED=1007]="CORS_BLOCKED",e[e.INCOMPATIBLE=1008]="INCOMPATIBLE",e))(A||{}),O1=(e=>(e.DEFAULT="default",e.SUCCEEDED="succeeded",e.FAILED="failed",e.PENDING="pending",e))(O1||{}),F=(e=>(e.APP_DISCONNECTED="app-disconnected",e.APP_RESTORE="app-restore",e.APP_BACKUP="app-backup",e.APP_CONNECTED="app-connected",e.APP_OBJECTS_SYNC="app-objects-sync",e))(F||{});function x6({endpoint:e,deps:n=[]}){return L1(async()=>{if(!W(e))return;const{headers:a}=await j.head(e,{timeout:1e3*30,params:{withExtras:!0}}),[i,s,c,u,l,C,d,p,m,g]=[a["x-space-name"],a["x-subscription-id"],a["x-listable"]==="true",a["x-readable"]==="true",a["x-writeable"]==="true",a["x-space-version"],a["x-space-owner-did"],a["x-space-is-available"],a["x-error-code"],a["x-is-site-admin"]],h=i?decodeURIComponent(i):"";if(p===void 0||m===void 0){const f=c&&u&&l;return{version:C,name:h,subscriptionId:s,ownerDid:d||"",isAvailable:f,errorCode:f?0:A.UNAUTHORIZED,isSiteAdmin:g==="true"}}return{version:C,name:h,subscriptionId:s,ownerDid:d,isAvailable:p==="true",errorCode:parseInt(m,10),isSiteAdmin:g==="true"}},{refreshDeps:[e].concat(n),onError(a){console.error(a)}})}const w6=U1.flatten({common:{cancel:"Cancel",confirm:"Confirm",delete:"Delete",error:"Error",open:"Open",unknown:"Unknown",invalidUrl:"Invalid url: {url}",upgrade:"Upgrade",viewMore:"View More"},storage:{spaces:{authorize:{title:"Connect {appName} to DID Spaces",scan:"Use your DID Wallet to scan the QR code below to allow the app {appName} to connect to DID Spaces",success:"Connected successfully"},connect:{reconnect:"Reconnect Now",useSpaceGateway:"Connect using the DID Spaces gateway",useWallet:"Connect to DID Spaces",howToGetGatewayUrl:"How to get the url of did spaces",providerForStorage:"Please connect your DID Spaces"},connected:{title:"Connected DID Spaces",tag:"Connected"},disconnected:{tag:"Disconnected"},error:{tag:"Need Attention",blockedByCors:"Access blocked by CORS",unreachable:"DID Space is unreachable",expired:"DID Spaces has expired, click this link to re-subscribe",pastDue:"DID Spaces has unpaid bills, click this link to complete payment",invalid:"DID Spaces subscription anomaly, click this link to check",unitLimit:"DID Spaces free quota has been used up, click this link to pay for the upgrade",cors:`The connection request may fail due to CORS restrictions:
2
2
  1. Please contact the DID Space administrator to verify the relevant configuration.
3
3
  2. If you are the administrator, click the link below to view the detailed setup guide and resolve the issue.`,networkError:"DID Space is currently unreachable due to potential server issues, network problems, or maintenance. Please click the link to visit the homepage and check its status.",incompatible:`The current connection of DID Spaces version ({spaceVersion}) is not compatible with the component version ({expectVersion}). Please contact the administrator for adjustments.
4
4
  If you are the administrator, you can click the link below to take action.`},gateway:{add:{invalidUrl:"Invalid DID Spaces gateway url",label:"Enter the url of the DID Spaces",title:"Add DID Spaces"}},provideNFT:{title:"Please show the DID Spaces NFT for {appName}",scan:"Use your DID Wallet to scan the QR code below to allow the app {appName} show DID Spaces NFT",success:"Connected successfully"},helperText:{fixCorsError:"Fixing CORS Errors When Connecting to DID Spaces"}}},auditLog:{backup:{description:"A backup operation was completed {relativeTime}"},restore:{description:"A restore operation was completed {relativeTime}"},connected:{description:"A connection was established {relativeTime}"},disconnected:{description:"The connection was disconnected {relativeTime}"},objectsSync:{description:"{totalCount} objects ({size}) were synchronized {relativeTime}"}}}),y6=U1.flatten({common:{cancel:"取消",confirm:"确认",delete:"删除",error:"错误",open:"打开",unknown:"未知",invalidUrl:"无效的 url: {url}",upgrade:"升级",viewMore:"查看更多"},storage:{spaces:{authorize:{title:"连接 {appName} 至 DID Spaces",scan:"使用你的 DID Wallet 扫描下面的二维码以允许应用 {appName} 连接至 DID Spaces",success:"连接成功"},connect:{reconnect:"立即重连",useSpaceGateway:"使用 DID Spaces 网关连接",useWallet:"连接至 DID Spaces",howToGetGatewayUrl:"如何获取 DID Spaces 的网关地址",providerForStorage:"请连接您的 DID Spaces"},connected:{title:"已连接的 DID Spaces",tag:"已连接"},disconnected:{tag:"连接已断开"},error:{tag:"需要关注",blockedByCors:"因 CORS 限制,访问被阻止",unreachable:"DID Space 无法访问",expired:"DID Spaces 已过期,点击此链接重新订阅",pastDue:"DID Spaces 有未支付账单,点击此链接完成支付",invalid:"DID Spaces 订阅异常,点击此链接检查",unitLimit:"DID Spaces 免费额度已用完,点击此链接付费升级",cors:`连接请求可能因 CORS 限制而失败:
@@ -1,4 +1,4 @@
1
- import{B as qr}from"./vendor-utils-BqKQizRf.js";import{p as ae}from"./vendor-react-CTtPmzVP.js";import{bm as Se,cs as jr,j as xr,ct as Nr,cu as _r,cv as Kr,i as Sr,cw as Tr,cx as ke,cy as Ur,cz as Br,bj as Dr,cA as Mr,p as Lr,r as Cr}from"./vendor-ux-KtPBvlG0.js";import{co as Or,cf as Vr}from"./index-CCp_Tje1.js";var Pe={exports:{}},Re={},Je;function Ar(){if(Je)return Re;Je=1;function h(u){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},h(u)}function g(u,p,S){return Object.defineProperty(u,"prototype",{writable:!1}),u}function s(u,p){if(!(u instanceof p))throw new TypeError("Cannot call a class as a function")}function b(u,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(p&&p.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),p&&_(u,p)}function _(u,p){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(N,B){return N.__proto__=B,N},_(u,p)}function L(u){var p=n();return function(){var N=e(u),B;if(p){var K=e(this).constructor;B=Reflect.construct(N,arguments,K)}else B=N.apply(this,arguments);return E(this,B)}}function E(u,p){if(p&&(h(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(u)}function f(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(u){return e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)},e(u)}var r={},d,y;function l(u,p,S){S||(S=Error);function N(K,H,V){return typeof p=="string"?p:p(K,H,V)}var B=function(K){b(V,K);var H=L(V);function V(W,te,Z){var J;return s(this,V),J=H.call(this,N(W,te,Z)),J.code=u,J}return g(V)}(S);r[u]=B}function q(u,p){if(Array.isArray(u)){var S=u.length;return u=u.map(function(N){return String(N)}),S>2?"one of ".concat(p," ").concat(u.slice(0,S-1).join(", "),", or ")+u[S-1]:S===2?"one of ".concat(p," ").concat(u[0]," or ").concat(u[1]):"of ".concat(p," ").concat(u[0])}else return"of ".concat(p," ").concat(String(u))}function O(u,p,S){return u.substr(0,p.length)===p}function A(u,p,S){return(S===void 0||S>u.length)&&(S=u.length),u.substring(S-p.length,S)===p}function j(u,p,S){return typeof S!="number"&&(S=0),S+p.length>u.length?!1:u.indexOf(p,S)!==-1}return l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(u,p,S){d===void 0&&(d=We()),d(typeof u=="string","'name' must be a string");var N;typeof p=="string"&&O(p,"not ")?(N="must not be",p=p.replace(/^not /,"")):N="must be";var B;if(A(u," argument"))B="The ".concat(u," ").concat(N," ").concat(q(p,"type"));else{var K=j(u,".")?"property":"argument";B='The "'.concat(u,'" ').concat(K," ").concat(N," ").concat(q(p,"type"))}return B+=". Received type ".concat(h(S)),B},TypeError),l("ERR_INVALID_ARG_VALUE",function(u,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";y===void 0&&(y=Se());var N=y.inspect(p);return N.length>128&&(N="".concat(N.slice(0,128),"...")),"The argument '".concat(u,"' ").concat(S,". Received ").concat(N)},TypeError),l("ERR_INVALID_RETURN_VALUE",function(u,p,S){var N;return S&&S.constructor&&S.constructor.name?N="instance of ".concat(S.constructor.name):N="type ".concat(h(S)),"Expected ".concat(u,' to be returned from the "').concat(p,'"')+" function but got ".concat(N,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var u=arguments.length,p=new Array(u),S=0;S<u;S++)p[S]=arguments[S];d===void 0&&(d=We()),d(p.length>0,"At least one arg needs to be specified");var N="The ",B=p.length;switch(p=p.map(function(K){return'"'.concat(K,'"')}),B){case 1:N+="".concat(p[0]," argument");break;case 2:N+="".concat(p[0]," and ").concat(p[1]," arguments");break;default:N+=p.slice(0,B-1).join(", "),N+=", and ".concat(p[B-1]," arguments");break}return"".concat(N," must be specified")},TypeError),Re.codes=r,Re}var Ie,Qe;function Fr(){if(Qe)return Ie;Qe=1;function h(v,m){var U=Object.keys(v);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(v);m&&(x=x.filter(function(C){return Object.getOwnPropertyDescriptor(v,C).enumerable})),U.push.apply(U,x)}return U}function g(v){for(var m=1;m<arguments.length;m++){var U=arguments[m]!=null?arguments[m]:{};m%2?h(Object(U),!0).forEach(function(x){s(v,x,U[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(U)):h(Object(U)).forEach(function(x){Object.defineProperty(v,x,Object.getOwnPropertyDescriptor(U,x))})}return v}function s(v,m,U){return m=E(m),m in v?Object.defineProperty(v,m,{value:U,enumerable:!0,configurable:!0,writable:!0}):v[m]=U,v}function b(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function _(v,m){for(var U=0;U<m.length;U++){var x=m[U];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,E(x.key),x)}}function L(v,m,U){return m&&_(v.prototype,m),Object.defineProperty(v,"prototype",{writable:!1}),v}function E(v){var m=f(v,"string");return u(m)==="symbol"?m:String(m)}function f(v,m){if(u(v)!=="object"||v===null)return v;var U=v[Symbol.toPrimitive];if(U!==void 0){var x=U.call(v,m);if(u(x)!=="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}function n(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),Object.defineProperty(v,"prototype",{writable:!1}),m&&A(v,m)}function e(v){var m=q();return function(){var x=j(v),C;if(m){var a=j(this).constructor;C=Reflect.construct(x,arguments,a)}else C=x.apply(this,arguments);return r(this,C)}}function r(v,m){if(m&&(u(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d(v)}function d(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function y(v){var m=typeof Map=="function"?new Map:void 0;return y=function(x){if(x===null||!O(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof m<"u"){if(m.has(x))return m.get(x);m.set(x,C)}function C(){return l(x,arguments,j(this).constructor)}return C.prototype=Object.create(x.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),A(C,x)},y(v)}function l(v,m,U){return q()?l=Reflect.construct.bind():l=function(C,a,i){var c=[null];c.push.apply(c,a);var R=Function.bind.apply(C,c),w=new R;return i&&A(w,i.prototype),w},l.apply(null,arguments)}function q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function O(v){return Function.toString.call(v).indexOf("[native code]")!==-1}function A(v,m){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,C){return x.__proto__=C,x},A(v,m)}function j(v){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},j(v)}function u(v){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},u(v)}var p=Se(),S=p.inspect,N=Ar(),B=N.codes.ERR_INVALID_ARG_TYPE;function K(v,m,U){return(U===void 0||U>v.length)&&(U=v.length),v.substring(U-m.length,U)===m}function H(v,m){if(m=Math.floor(m),v.length==0||m==0)return"";var U=v.length*m;for(m=Math.floor(Math.log(m)/Math.log(2));m;)v+=v,m--;return v+=v.substring(0,U-v.length),v}var V="",W="",te="",Z="",J={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},he=10;function de(v){var m=Object.keys(v),U=Object.create(Object.getPrototypeOf(v));return m.forEach(function(x){U[x]=v[x]}),Object.defineProperty(U,"message",{value:v.message}),U}function oe(v){return S(v,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function ye(v,m,U){var x="",C="",a=0,i="",c=!1,R=oe(v),w=R.split(`
1
+ import{B as qr}from"./vendor-utils-drLlzTVq.js";import{p as ae}from"./vendor-react-CTtPmzVP.js";import{bm as Se,cs as jr,j as xr,ct as Nr,cu as _r,cv as Kr,i as Sr,cw as Tr,cx as ke,cy as Ur,cz as Br,bj as Dr,cA as Mr,p as Lr,r as Cr}from"./vendor-ux-B5w9dHEo.js";import{co as Or,cf as Vr}from"./index-BlSveGp8.js";var Pe={exports:{}},Re={},Je;function Ar(){if(Je)return Re;Je=1;function h(u){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},h(u)}function g(u,p,S){return Object.defineProperty(u,"prototype",{writable:!1}),u}function s(u,p){if(!(u instanceof p))throw new TypeError("Cannot call a class as a function")}function b(u,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(p&&p.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),p&&_(u,p)}function _(u,p){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(N,B){return N.__proto__=B,N},_(u,p)}function L(u){var p=n();return function(){var N=e(u),B;if(p){var K=e(this).constructor;B=Reflect.construct(N,arguments,K)}else B=N.apply(this,arguments);return E(this,B)}}function E(u,p){if(p&&(h(p)==="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(u)}function f(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(u){return e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(S){return S.__proto__||Object.getPrototypeOf(S)},e(u)}var r={},d,y;function l(u,p,S){S||(S=Error);function N(K,H,V){return typeof p=="string"?p:p(K,H,V)}var B=function(K){b(V,K);var H=L(V);function V(W,te,Z){var J;return s(this,V),J=H.call(this,N(W,te,Z)),J.code=u,J}return g(V)}(S);r[u]=B}function q(u,p){if(Array.isArray(u)){var S=u.length;return u=u.map(function(N){return String(N)}),S>2?"one of ".concat(p," ").concat(u.slice(0,S-1).join(", "),", or ")+u[S-1]:S===2?"one of ".concat(p," ").concat(u[0]," or ").concat(u[1]):"of ".concat(p," ").concat(u[0])}else return"of ".concat(p," ").concat(String(u))}function O(u,p,S){return u.substr(0,p.length)===p}function A(u,p,S){return(S===void 0||S>u.length)&&(S=u.length),u.substring(S-p.length,S)===p}function j(u,p,S){return typeof S!="number"&&(S=0),S+p.length>u.length?!1:u.indexOf(p,S)!==-1}return l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",function(u,p,S){d===void 0&&(d=We()),d(typeof u=="string","'name' must be a string");var N;typeof p=="string"&&O(p,"not ")?(N="must not be",p=p.replace(/^not /,"")):N="must be";var B;if(A(u," argument"))B="The ".concat(u," ").concat(N," ").concat(q(p,"type"));else{var K=j(u,".")?"property":"argument";B='The "'.concat(u,'" ').concat(K," ").concat(N," ").concat(q(p,"type"))}return B+=". Received type ".concat(h(S)),B},TypeError),l("ERR_INVALID_ARG_VALUE",function(u,p){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";y===void 0&&(y=Se());var N=y.inspect(p);return N.length>128&&(N="".concat(N.slice(0,128),"...")),"The argument '".concat(u,"' ").concat(S,". Received ").concat(N)},TypeError),l("ERR_INVALID_RETURN_VALUE",function(u,p,S){var N;return S&&S.constructor&&S.constructor.name?N="instance of ".concat(S.constructor.name):N="type ".concat(h(S)),"Expected ".concat(u,' to be returned from the "').concat(p,'"')+" function but got ".concat(N,".")},TypeError),l("ERR_MISSING_ARGS",function(){for(var u=arguments.length,p=new Array(u),S=0;S<u;S++)p[S]=arguments[S];d===void 0&&(d=We()),d(p.length>0,"At least one arg needs to be specified");var N="The ",B=p.length;switch(p=p.map(function(K){return'"'.concat(K,'"')}),B){case 1:N+="".concat(p[0]," argument");break;case 2:N+="".concat(p[0]," and ").concat(p[1]," arguments");break;default:N+=p.slice(0,B-1).join(", "),N+=", and ".concat(p[B-1]," arguments");break}return"".concat(N," must be specified")},TypeError),Re.codes=r,Re}var Ie,Qe;function Fr(){if(Qe)return Ie;Qe=1;function h(v,m){var U=Object.keys(v);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(v);m&&(x=x.filter(function(C){return Object.getOwnPropertyDescriptor(v,C).enumerable})),U.push.apply(U,x)}return U}function g(v){for(var m=1;m<arguments.length;m++){var U=arguments[m]!=null?arguments[m]:{};m%2?h(Object(U),!0).forEach(function(x){s(v,x,U[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(U)):h(Object(U)).forEach(function(x){Object.defineProperty(v,x,Object.getOwnPropertyDescriptor(U,x))})}return v}function s(v,m,U){return m=E(m),m in v?Object.defineProperty(v,m,{value:U,enumerable:!0,configurable:!0,writable:!0}):v[m]=U,v}function b(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}function _(v,m){for(var U=0;U<m.length;U++){var x=m[U];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(v,E(x.key),x)}}function L(v,m,U){return m&&_(v.prototype,m),Object.defineProperty(v,"prototype",{writable:!1}),v}function E(v){var m=f(v,"string");return u(m)==="symbol"?m:String(m)}function f(v,m){if(u(v)!=="object"||v===null)return v;var U=v[Symbol.toPrimitive];if(U!==void 0){var x=U.call(v,m);if(u(x)!=="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(v)}function n(v,m){if(typeof m!="function"&&m!==null)throw new TypeError("Super expression must either be null or a function");v.prototype=Object.create(m&&m.prototype,{constructor:{value:v,writable:!0,configurable:!0}}),Object.defineProperty(v,"prototype",{writable:!1}),m&&A(v,m)}function e(v){var m=q();return function(){var x=j(v),C;if(m){var a=j(this).constructor;C=Reflect.construct(x,arguments,a)}else C=x.apply(this,arguments);return r(this,C)}}function r(v,m){if(m&&(u(m)==="object"||typeof m=="function"))return m;if(m!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d(v)}function d(v){if(v===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v}function y(v){var m=typeof Map=="function"?new Map:void 0;return y=function(x){if(x===null||!O(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof m<"u"){if(m.has(x))return m.get(x);m.set(x,C)}function C(){return l(x,arguments,j(this).constructor)}return C.prototype=Object.create(x.prototype,{constructor:{value:C,enumerable:!1,writable:!0,configurable:!0}}),A(C,x)},y(v)}function l(v,m,U){return q()?l=Reflect.construct.bind():l=function(C,a,i){var c=[null];c.push.apply(c,a);var R=Function.bind.apply(C,c),w=new R;return i&&A(w,i.prototype),w},l.apply(null,arguments)}function q(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function O(v){return Function.toString.call(v).indexOf("[native code]")!==-1}function A(v,m){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,C){return x.__proto__=C,x},A(v,m)}function j(v){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},j(v)}function u(v){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},u(v)}var p=Se(),S=p.inspect,N=Ar(),B=N.codes.ERR_INVALID_ARG_TYPE;function K(v,m,U){return(U===void 0||U>v.length)&&(U=v.length),v.substring(U-m.length,U)===m}function H(v,m){if(m=Math.floor(m),v.length==0||m==0)return"";var U=v.length*m;for(m=Math.floor(Math.log(m)/Math.log(2));m;)v+=v,m--;return v+=v.substring(0,U-v.length),v}var V="",W="",te="",Z="",J={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},he=10;function de(v){var m=Object.keys(v),U=Object.create(Object.getPrototypeOf(v));return m.forEach(function(x){U[x]=v[x]}),Object.defineProperty(U,"message",{value:v.message}),U}function oe(v){return S(v,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function ye(v,m,U){var x="",C="",a=0,i="",c=!1,R=oe(v),w=R.split(`
2
2
  `),I=oe(m).split(`
3
3
  `),D=0,z="";if(U==="strictEqual"&&u(v)==="object"&&u(m)==="object"&&v!==null&&m!==null&&(U="strictEqualObject"),w.length===1&&I.length===1&&w[0]!==I[0]){var k=w[0].length+I[0].length;if(k<=he){if((u(v)!=="object"||v===null)&&(u(m)!=="object"||m===null)&&(v!==0||m!==0))return"".concat(J[U],`
4
4