@abtnode/blocklet-services 1.17.7-beta-20251227-001958-ea2ba3f5 → 1.17.7-beta-20251229-085620-84f09930

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/api/index.js +5 -0
  2. package/api/middlewares/serve-static-engine.js +179 -0
  3. package/api/routes/env.js +3 -4
  4. package/api/services/notification/queue.js +2 -2
  5. package/api/socket/channel/component.js +19 -13
  6. package/api/socket/util.js +6 -1
  7. package/dist/assets/{AdapterDayjs-D3q7r7VE.js → AdapterDayjs-DYIVeXBV.js} +1 -1
  8. package/dist/assets/{Google-DPANLEPw.js → Google-D9N2NN29.js} +1 -1
  9. package/dist/assets/{access-control-DcZTha6L.js → access-control-UTVMJtLa.js} +1 -1
  10. package/dist/assets/{add-component-core-DB6FFHib.js → add-component-core-Cu9Tohbt.js} +1 -1
  11. package/dist/assets/{add-resource-C4N8BQ-X.js → add-resource-CqOi5S87.js} +1 -1
  12. package/dist/assets/{addon-eWPw19hG.js → addon-DSFDYYiP.js} +1 -1
  13. package/dist/assets/{advanced-CLImONQQ.js → advanced-CkJs81iC.js} +1 -1
  14. package/dist/assets/{aigne-CgZvweo2.js → aigne-Dt8mwR8G.js} +1 -1
  15. package/dist/assets/{appearance-CINIZkeA.js → appearance-Bs9dCa2z.js} +1 -1
  16. package/dist/assets/{audit-logs-C2v20KVT.js → audit-logs-Bk0Y0aey.js} +1 -1
  17. package/dist/assets/{authorize-CXXh0DJa.js → authorize-C6B5tUkA.js} +1 -1
  18. package/dist/assets/{base32-D1hrOfad.js → base32-BccrNIeO.js} +1 -1
  19. package/dist/assets/{bind-account-wbTCO99T.js → bind-account-CLV9q3E3.js} +1 -1
  20. package/dist/assets/{branding-CxsPzoRR.js → branding-BGRUKKNR.js} +1 -1
  21. package/dist/assets/{branding-BRnchueB.js → branding-Cwk5a8ly.js} +1 -1
  22. package/dist/assets/{branding-DwUe7Tp9.js → branding-JmTDNoIq.js} +1 -1
  23. package/dist/assets/{bundle-avatar-BcFO2tQG.js → bundle-avatar-CLRiyhwo.js} +1 -1
  24. package/dist/assets/{button-DOFHdsTg.js → button-Bfs8GG-V.js} +1 -1
  25. package/dist/assets/{click-to-copy-Y_g1bzK1.js → click-to-copy-fgcvdv-u.js} +1 -1
  26. package/dist/assets/{complete-BcxUAd9u.js → complete-Bb_Zgfxn.js} +1 -1
  27. package/dist/assets/{component-Da5wpxLf.js → component-BEiiKeGh.js} +2 -2
  28. package/dist/assets/{config-ZxMxtwH7.js → config-CAUPVWd8.js} +1 -1
  29. package/dist/assets/{config-uq3j8VEP.js → config-Crd4mTZS.js} +1 -1
  30. package/dist/assets/{config-6Zu9T00w.js → config-DEeSuJty.js} +1 -1
  31. package/dist/assets/{config-navigation-DguNbGxu.js → config-navigation-DcFoMJlj.js} +2 -2
  32. package/dist/assets/{config-space-LrsWMRQl.js → config-space-DVE2CBUC.js} +1 -1
  33. package/dist/assets/{confirm-CkoSEAQA.js → confirm-BSaTCzrs.js} +1 -1
  34. package/dist/assets/{connect-BdHrAN1y.js → connect-B0W5gXFT.js} +1 -1
  35. package/dist/assets/{connect-Ycl_SRGH.js → connect-ChbbAHB_.js} +1 -1
  36. package/dist/assets/{connect-to-Bimfzs2e.js → connect-to-D7rrqt6m.js} +1 -1
  37. package/dist/assets/{create-passport-svg-DXpLsb6S.js → create-passport-svg-BJX-WFnl.js} +1 -1
  38. package/dist/assets/{createClass-gaMAMqR5.js → createClass-CH1sG4Vj.js} +1 -1
  39. package/dist/assets/{dashboard-ibhYAC79.js → dashboard-DDFp-UB6.js} +2 -2
  40. package/dist/assets/{de-CCwoF0w2.js → de-EFAP4yzZ.js} +1 -1
  41. package/dist/assets/{delete-confirm-CRZxojEX.js → delete-confirm-BzmT7bQV.js} +1 -1
  42. package/dist/assets/{did-address-CQO2MAbB.js → did-address-cHTriZHu.js} +1 -1
  43. package/dist/assets/{domain-BLbfzvQo.js → domain-CLaCd92M.js} +1 -1
  44. package/dist/assets/{domain-action-card-CI8HeDAo.js → domain-action-card-ClVrHE96.js} +1 -1
  45. package/dist/assets/{domains-Cys-hPxm.js → domains-C5X5bi_z.js} +1 -1
  46. package/dist/assets/{email-DR9ulnxn.js → email-DddZUTON.js} +1 -1
  47. package/dist/assets/engine-CvmlyswD.js +1 -0
  48. package/dist/assets/{exchange-passport-f77I2WSo.js → exchange-passport-CKEOdyU9.js} +1 -1
  49. package/dist/assets/{form-BaeH4FDj.js → form-poId1OU3.js} +1 -1
  50. package/dist/assets/{form-text-input-DlypNadC.js → form-text-input-DwerOWgK.js} +1 -1
  51. package/dist/assets/{fuel-oYvuY39p.js → fuel-Bly8lXId.js} +1 -1
  52. package/dist/assets/{gen-access-key-CAPft5rM.js → gen-access-key-5kekGzt_.js} +1 -1
  53. package/dist/assets/{gen-simple-access-key-BLp5Xl3s.js → gen-simple-access-key-l4SGe3J5.js} +1 -1
  54. package/dist/assets/get-safe-url-D7ti-zln.js +1 -0
  55. package/dist/assets/{home-Bk6IzsSO.js → home-yA5fXQmP.js} +1 -1
  56. package/dist/assets/{iframe-Bje7e1bW.js → iframe-XKq6kg_r.js} +1 -1
  57. package/dist/assets/{index-3CTfzyey.js → index--Zp6K5Sp.js} +1 -1
  58. package/dist/assets/{index-DufnOkPH.js → index-5haA_ZtH.js} +1 -1
  59. package/dist/assets/{index-Cx3b_F1g.js → index-9N4EluXF.js} +1 -1
  60. package/dist/assets/{index-DpNE-CDv.js → index-B0wPyjk9.js} +1 -1
  61. package/dist/assets/{index-D_Nnn_Mn.js → index-B1-cYl7K.js} +1 -1
  62. package/dist/assets/{index-CZLUW18F.js → index-BBwTMTLp.js} +1 -1
  63. package/dist/assets/{index-DO00WL8R.js → index-BOWGgkTH.js} +1 -1
  64. package/dist/assets/{index-CrRA4U7x.js → index-BT901ij8.js} +1 -1
  65. package/dist/assets/{index-CNEbBLep.js → index-BjqoIwBE.js} +1 -1
  66. package/dist/assets/{index-Bpw2kPB0.js → index-BotTPbWD.js} +1 -1
  67. package/dist/assets/{index-DSiSlyHN.js → index-Bt8QUMaz.js} +1 -1
  68. package/dist/assets/{index-BZxsCCR_.js → index-CGOBEhzW.js} +76 -76
  69. package/dist/assets/{index-CnCY99ka.js → index-CKhKxswY.js} +1 -1
  70. package/dist/assets/{index-fpjO7dzv.js → index-CQqn5TFD.js} +2 -2
  71. package/dist/assets/{index-CS6lhRSS.js → index-CSwcQdlI.js} +1 -1
  72. package/dist/assets/{index-DDp16vgt.js → index-Ce9omzTp.js} +1 -1
  73. package/dist/assets/{index-n0T59Exz.js → index-ChQX9ze3.js} +1 -1
  74. package/dist/assets/{index-icvBZv9S.js → index-CiKhg0ut.js} +1 -1
  75. package/dist/assets/{index-B6l2pkPi.js → index-Cu8TdzKM.js} +1 -1
  76. package/dist/assets/{index-BbN6pA05.js → index-CuC130U2.js} +3 -3
  77. package/dist/assets/{index-C3WB0h56.js → index-CvVZvUh7.js} +1 -1
  78. package/dist/assets/{index-CMxIK3x4.js → index-CzlJLWz5.js} +1 -1
  79. package/dist/assets/{index-faKDHmeo.js → index-D95ZNJ3d.js} +1 -1
  80. package/dist/assets/{index-CrBdQJWr.js → index-DA8b2Fwx.js} +1 -1
  81. package/dist/assets/{index-CFLdsuFL.js → index-DGd0GDc4.js} +1 -1
  82. package/dist/assets/{index-BqdvWprH.js → index-HU-v7OeI.js} +1 -1
  83. package/dist/assets/{index-VFqVu6RK.js → index-_haoumSc.js} +1 -1
  84. package/dist/assets/{index-CNIPEY43.js → index-pm6H84lU.js} +1 -1
  85. package/dist/assets/{index-CQ7mQ4Da.js → index-tgy1TTjM.js} +1 -1
  86. package/dist/assets/{index-D5sBpp1t.js → index-v9hCHxKp.js} +1 -1
  87. package/dist/assets/{invitation-1uvZN7Wz.js → invitation-OInDimvS.js} +1 -1
  88. package/dist/assets/{invitations-CVBjh7Sp.js → invitations-BFTtG6X1.js} +1 -1
  89. package/dist/assets/{invite-72ju6Nfe.js → invite-sUgPlE4Z.js} +1 -1
  90. package/dist/assets/{isURL-4Bkt0jKV.js → isURL-CJrtALFi.js} +1 -1
  91. package/dist/assets/{issue-passport-BXUkhSQf.js → issue-passport-D779MB0S.js} +1 -1
  92. package/dist/assets/{item-Sc9nk8VE.js → item-D0S77pRh.js} +1 -1
  93. package/dist/assets/{landing-page-CNLD6T-R.js → landing-page-BoqVRFrg.js} +1 -1
  94. package/dist/assets/{layout-Rdrg1NRp.js → layout-BumaOQ7l.js} +1 -1
  95. package/dist/assets/{list-kBEbDlAy.js → list-Bcp4RDC0.js} +1 -1
  96. package/dist/assets/{list-Duwgi0aT.js → list-C0ACtiK5.js} +1 -1
  97. package/dist/assets/localization-DAkSbh2g.js +1 -0
  98. package/dist/assets/{log-D0VXoWik.js → log-CpIPOvLt.js} +1 -1
  99. package/dist/assets/logger-DUjWrC8_.js +1 -0
  100. package/dist/assets/{login-Bk3NsX2t.js → login-cMKzStm-.js} +1 -1
  101. package/dist/assets/{login-oauth-callback-B5t0W6BK.js → login-oauth-callback-I8wjhibA.js} +1 -1
  102. package/dist/assets/{logo-uploader-BksS6OGe.js → logo-uploader-CeXSNxdi.js} +1 -1
  103. package/dist/assets/{lost-passport-N6CO05pB.js → lost-passport-VCPPPILz.js} +1 -1
  104. package/dist/assets/{open-window-BIeXBkgL.js → open-window-DY3mWojp.js} +1 -1
  105. package/dist/assets/{over-due-invoice-payment-UdTfL4Kl.js → over-due-invoice-payment-C9HTfbWA.js} +1 -1
  106. package/dist/assets/{overview-C8MrvmEl.js → overview-Bv3cq2I0.js} +1 -1
  107. package/dist/assets/{passport-VW2_vBcn.js → passport-DMm48qRk.js} +1 -1
  108. package/dist/assets/{passport-item-DT01s3TO.js → passport-item-DD8VG51j.js} +1 -1
  109. package/dist/assets/{permission-B2PLdaCS.js → permission-B3ddwA-4.js} +1 -1
  110. package/dist/assets/{preferences-Bc7rQImd.js → preferences-CmMbfbTw.js} +1 -1
  111. package/dist/assets/{profile-embed-BcR4EOH0.js → profile-embed-DAY5ZrDb.js} +1 -1
  112. package/dist/assets/{publish-resource-0N_Yl_Te.js → publish-resource-DJRigGuM.js} +1 -1
  113. package/dist/assets/{react-beautiful-dnd.esm-BS_uB_lS.js → react-beautiful-dnd.esm-Bn87vJFI.js} +1 -1
  114. package/dist/assets/{runtime-CC4RYhOB.js → runtime-gljMK2qS.js} +1 -1
  115. package/dist/assets/sdk-Be-u0PfZ.js +1 -0
  116. package/dist/assets/{security-BGS9ZBga.js → security-b4k0fa20.js} +1 -1
  117. package/dist/assets/{session-DwQKgNVz.js → session-vM0SwFQZ.js} +1 -1
  118. package/dist/assets/{setup-CGmQpOuI.js → setup-BPnqbGIk.js} +1 -1
  119. package/dist/assets/{simple-select-BCM4gn4x.js → simple-select-6nihrL7w.js} +1 -1
  120. package/dist/assets/{spaces-DBCz6tUn.js → spaces-ypzuCaPe.js} +1 -1
  121. package/dist/assets/{start-i9gTQsll.js → start-CgUu2djm.js} +1 -1
  122. package/dist/assets/{starting-progress-DyH57pR8.js → starting-progress-B15yvlvv.js} +1 -1
  123. package/dist/assets/{status-CXqGL2Pf.js → status-Cy7fzuR3.js} +1 -1
  124. package/dist/assets/{step-actions-Bejkv1Kq.js → step-actions-D3sZvhKo.js} +1 -1
  125. package/dist/assets/{studio-D4gvK_Pm.js → studio-D9ZxOiyo.js} +1 -1
  126. package/dist/assets/{switch-C6tfghh9.js → switch-CjDalLJU.js} +1 -1
  127. package/dist/assets/{switch-control-BHBY0I2i.js → switch-control-CioN_5qg.js} +1 -1
  128. package/dist/assets/{table-tips-NRTE9Y9o.js → table-tips-DEqFBQFt.js} +1 -1
  129. package/dist/assets/{team-DJUogroZ.js → team-DHhtcW5C.js} +1 -1
  130. package/dist/assets/{traffic-BkhPaqCl.js → traffic-DDO0-htp.js} +1 -1
  131. package/dist/assets/{transfer-BphBkT_z.js → transfer-CEk3StHa.js} +1 -1
  132. package/dist/assets/{unsubscribe-BZMHEcjj.js → unsubscribe-DZF4NKei.js} +1 -1
  133. package/dist/assets/{use-app-logo-DbYok-1h.js → use-app-logo-DSdF3M62.js} +1 -1
  134. package/dist/assets/{use-window-close-GjpWo-Lk.js → use-window-close-va-vKf7G.js} +1 -1
  135. package/dist/assets/{useLocalStorage-DzhcQ3lj.js → useLocalStorage-A7dcJ6ce.js} +1 -1
  136. package/dist/assets/{user-center-DRowS1VB.js → user-center-C2hlh2we.js} +1 -1
  137. package/dist/assets/{user-follower-DNh4vPB0.js → user-follower-BmcrANUM.js} +1 -1
  138. package/dist/assets/{util-BYnhSg2W.js → util-C_d0oDd4.js} +1 -1
  139. package/dist/assets/{util-DWbXfz_X.js → util-D9UZY2ZN.js} +1 -1
  140. package/dist/assets/{vendor-arcblock-CIBaEWEy.js → vendor-arcblock-Dr30TSIK.js} +1 -1
  141. package/dist/assets/{vendor-ux-DTEmWsko.js → vendor-ux-7TwTLXf8.js} +1 -1
  142. package/dist/assets/{wait-connect-CBmpE7OF.js → wait-connect-B2sGoXaJ.js} +1 -1
  143. package/dist/assets/{wizard-components-Brz3KBMW.js → wizard-components-BRsabxoD.js} +1 -1
  144. package/dist/assets/{wizard-yWYIVNGQ.js → wizard-qaZ9pS3q.js} +1 -1
  145. package/dist/assets/wrap-locale-DGVkhpYh.js +1 -0
  146. package/dist/assets/{zh-sNz1KN0x.js → zh-D1XHANJI.js} +1 -1
  147. package/dist/index.html +1 -1
  148. package/package.json +31 -31
  149. package/dist/assets/engine-D3NlocNz.js +0 -1
  150. package/dist/assets/get-safe-url-D4mirsKD.js +0 -1
  151. package/dist/assets/localization-5dQbij9B.js +0 -1
  152. package/dist/assets/logger-DwfAFTvh.js +0 -1
  153. package/dist/assets/sdk-ChA0AoUQ.js +0 -1
  154. package/dist/assets/wrap-locale-BUa8dcqX.js +0 -1
@@ -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,aB as pe}from"./vendor-utils-CxWN1dT3.js";import{H as U,aU as Nt,V as Y,cM as wt,m as Ye,$ as Ze,w as Ae,aO as Je,bh as be,aK as Rt,aW as Tt,b1 as It,b8 as Et}from"./vendor-ux-DTEmWsko.js";import{Z as At,Q as H,c as E,C as Dt,a1 as qe}from"./index-BZxsCCR_.js";import{a as X,g as De}from"./vendor-hooks-qxhUUbW5.js";import{S as me}from"./shorten-label-C4py9TLA.js";import{v as et}from"./index-icvBZv9S.js";import{R as tt,A as Ot,S as Lt,a as kt,B as Ft}from"./list-Duwgi0aT.js";import{i as Pt,e as _t,N as Bt}from"./team-DJUogroZ.js";import{W as zt}from"./did-address-CQO2MAbB.js";import{p as st}from"./util-DWbXfz_X.js";import{D as Wt,g as Mt}from"./traffic-BkhPaqCl.js";import{B as nt}from"./bundle-avatar-BcFO2tQG.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CIBaEWEy.js";import"./server-logo-notext.svg-xZ-i1SpD.js";import"./session-DwQKgNVz.js";import"./isURL-4Bkt0jKV.js";import"./use-app-logo-DbYok-1h.js";import"./base32-D1hrOfad.js";import"./useAsyncRetry-r8dEPb-x.js";import"./useAsync-Dotoxibi.js";import"./iframe-Bje7e1bW.js";import"./index-CNIPEY43.js";import"./index-DBs9Ljax.js";import"./base-chart-ChBZtUEG.js";import"./index-D1SIrheh.js";import"./vendor-mui-x-CQc01l4r.js";import"./AdapterDayjs-D3q7r7VE.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},J=await n.getNotificationSendLog({input:se});return F(se),b(J.list),S(J.paging),J.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 Z={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:Z},children:t})}function _e(){const{notificationRecords:t}=x.useContext(at);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const 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},Zt=t=>{switch(t){case E.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case E.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case E.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case E.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},lt=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:i,title:l="",sentTime:b="",reason:m=""}=t,S=[l,m].filter(Boolean).join(", ");return e.jsx(mt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(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 Jt=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];ct.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function ct({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Y(),[i,l]=x.useState(Jt),[b,m]=x.useState(!0),S=(y,v)=>{v.checked=y.target.checked;const P=i.map(F=>({...F,checked:F.value===v.value?v.checked:F.checked}));l(P)},h=y=>{y.stopPropagation(),n({channels:i.filter(v=>v.checked).map(v=>v.value),isResendFailedOnly:b})};return e.jsxs(N,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(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,Z]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,g]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[T,D]=x.useState([]),O=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],z=async()=>{if(!P&&t)try{F(!0);const a=await m({notificationId:t,...p}),o=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,S)}}));q(o),Z(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},J=({page:a,rowsPerPage:o,searchText:c,filterList:C})=>{const[,B=[],G=[],K=[]]=C;p.pageSize!==o?g(W=>({...W,pageSize:o,page:1})):p.page!==a+1?g(W=>({...W,page:a+1})):p.searchText!==c?g(W=>({...W,searchText:c,page:1})):pe(B,p.walletSendStatus)?pe(G,p.pushKitSendStatus)?pe(K,p.emailSendStatus)||g(W=>({...W,emailSendStatus:K,page:1})):g(W=>({...W,pushKitSendStatus:G,page:1})):g(W=>({...W,walletSendStatus:B,page:1}))},oe=x.useCallback(async(a,o)=>{if(!o)return!1;const c=await y(o);return c?a==="wallet"?Gt(c):a==="email"?$t(v,c):a==="pushKit"?Vt(v,c):a==="webhook"?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(Ze,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(zt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:p.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Wallet",filterList:a,onChange:o,index:c,column:C,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"wallet",onResend:B=>R(B,w[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"pushkit",onResend:B=>R(B,w[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Push Kit",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"email",onResend:B=>R(B,w[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Email",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:o}=w[a];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[C,B]=c,G=B[0];return e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(N,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:C},C),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:K=>R(K,w[a],"webhook",[C],!1)})]},C)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:o}=w[a];return e.jsx(tt,{value:o,locale:i,shouldUpdate:!0})}}}],[w,i,p,r]),ft=[e.jsx(ze,{value:p.dateRange,onChange:re},"date-picker"),e.jsx(Ae,{variant:"contained",size:"small",color:"primary",loading:P,startIcon:e.jsx(ht,{}),onClick:()=>z(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(N,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ts,{children:e.jsxs(Xe,{theme:b,children:[e.jsx(Je,{className:"receivers-table",locale:i,loading:P,columns:le,data:w,onChange:J,options:se,customButtons:ft,components:{TableFilterList:a=>e.jsx(We,{...a,itemComponent:o=>e.jsx(Me,{...o,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ee,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(ss,{children:[e.jsxs(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,aB as pe}from"./vendor-utils-CxWN1dT3.js";import{H as U,aU as Nt,V as Y,cM as wt,m as Ye,$ as Ze,w as Ae,aO as Je,bh as be,aK as Rt,aW as Tt,b1 as It,b8 as Et}from"./vendor-ux-7TwTLXf8.js";import{Z as At,Q as H,c as E,C as Dt,a1 as qe}from"./index-CGOBEhzW.js";import{a as X,g as De}from"./vendor-hooks-qxhUUbW5.js";import{S as me}from"./shorten-label-C4py9TLA.js";import{v as et}from"./index-CiKhg0ut.js";import{R as tt,A as Ot,S as Lt,a as kt,B as Ft}from"./list-C0ACtiK5.js";import{i as Pt,e as _t,N as Bt}from"./team-DHhtcW5C.js";import{W as zt}from"./did-address-cHTriZHu.js";import{p as st}from"./util-D9UZY2ZN.js";import{D as Wt,g as Mt}from"./traffic-DDO0-htp.js";import{B as nt}from"./bundle-avatar-CLRiyhwo.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-Dr30TSIK.js";import"./server-logo-notext.svg-xZ-i1SpD.js";import"./session-vM0SwFQZ.js";import"./isURL-CJrtALFi.js";import"./use-app-logo-DSdF3M62.js";import"./base32-BccrNIeO.js";import"./useAsyncRetry-r8dEPb-x.js";import"./useAsync-Dotoxibi.js";import"./iframe-XKq6kg_r.js";import"./index-pm6H84lU.js";import"./index-DBs9Ljax.js";import"./base-chart-ChBZtUEG.js";import"./index-D1SIrheh.js";import"./vendor-mui-x-CQc01l4r.js";import"./AdapterDayjs-DYIVeXBV.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},J=await n.getNotificationSendLog({input:se});return F(se),b(J.list),S(J.paging),J.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 Z={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:Z},children:t})}function _e(){const{notificationRecords:t}=x.useContext(at);return t}he.propTypes={severity:d.oneOf(Object.values(["info","success","error","warning"])).isRequired};const 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},Zt=t=>{switch(t){case E.NOTIFICATION_SEND_CHANNEL.WALLET:return"Wallet";case E.NOTIFICATION_SEND_CHANNEL.PUSH:return"Push Kit";case E.NOTIFICATION_SEND_CHANNEL.EMAIL:return"Email";case E.NOTIFICATION_SEND_CHANNEL.WEBHOOK:return"Webhook";default:return""}},lt=()=>({components:{MUIDataTableFilter:{styleOverrides:{header:{marginBottom:0,p:{margin:0}},root:{"& .MuiGrid-container":{marginTop:0,"& .MuiGrid-item":{paddingTop:0}}}}},MuiPopover:{styleOverrides:{root:{"&.MuiPopover-root":{"& .MuiPaper-root:has(.filter-container)":{width:"420px"}}}}}}});function te({config:t,enableTooltip:s=!0,showTitle:n=!1,children:r=null}){const{status:i,title:l="",sentTime:b="",reason:m=""}=t,S=[l,m].filter(Boolean).join(", ");return e.jsx(mt,{title:s?e.jsxs(e.Fragment,{children:[e.jsx(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 Jt=[{label:"Wallet",value:"app",checked:!0},{label:"Email",value:"email",checked:!0},{label:"Push Kit",value:"push",checked:!0},{label:"Webhook",value:"webhook",checked:!0}];ct.propTypes={loading:d.bool,onCancel:d.func,onConfirm:d.func};function ct({loading:t=!1,onCancel:s=()=>{},onConfirm:n=()=>{}}){const{t:r}=Y(),[i,l]=x.useState(Jt),[b,m]=x.useState(!0),S=(y,v)=>{v.checked=y.target.checked;const P=i.map(F=>({...F,checked:F.value===v.value?v.checked:F.checked}));l(P)},h=y=>{y.stopPropagation(),n({channels:i.filter(v=>v.checked).map(v=>v.value),isResendFailedOnly:b})};return e.jsxs(N,{className:"resend-config",sx:{padding:"16px 24px"},children:[e.jsx(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,Z]=x.useState({total:0,pageSize:10,pageCount:0,page:1}),[p,g]=x.useState({searchText:"",page:1,pageSize:10,walletSendStatus:[],pushKitSendStatus:[],emailSendStatus:[],dateRange:[H().subtract(1,"month").startOf("day").toDate(),H().endOf("day").toDate()]}),[T,D]=x.useState([]),O=[{label:r("notification.sendStatus.pending"),value:0,status:"pending"},{label:r("notification.sendStatus.success"),value:1,status:"success"},{label:r("notification.sendStatus.failed"),value:2,status:"failed"}],z=async()=>{if(!P&&t)try{F(!0);const a=await m({notificationId:t,...p}),o=a.list.map(c=>({...c,receiverUser:{...c.receiverUser,avatar:st(c.receiverUser.avatar,h,S)}}));q(o),Z(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},J=({page:a,rowsPerPage:o,searchText:c,filterList:C})=>{const[,B=[],G=[],K=[]]=C;p.pageSize!==o?g(W=>({...W,pageSize:o,page:1})):p.page!==a+1?g(W=>({...W,page:a+1})):p.searchText!==c?g(W=>({...W,searchText:c,page:1})):pe(B,p.walletSendStatus)?pe(G,p.pushKitSendStatus)?pe(K,p.emailSendStatus)||g(W=>({...W,emailSendStatus:K,page:1})):g(W=>({...W,pushKitSendStatus:G,page:1})):g(W=>({...W,walletSendStatus:B,page:1}))},oe=x.useCallback(async(a,o)=>{if(!o)return!1;const c=await y(o);return c?a==="wallet"?Gt(c):a==="email"?$t(v,c):a==="pushKit"?Vt(v,c):a==="webhook"?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(Ze,{src:`${o.avatar}?imageFilter=resize&w=48&h=48`,size:32,did:c,shape:"circle",style:{borderRadius:"100%",overflow:"hidden"}}),e.jsx(me,{children:o.fullName})]},c):e.jsx(zt,{size:14,responsive:!1,compact:!0,copyable:!1,did:c})}}},{label:"Wallet",name:"walletSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),filter:!0,filterType:"custom",filterList:p.walletSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Wallet",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[1].options.filterList,"walletSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Wallet",filterList:a,onChange:o,index:c,column:C,filterValues:O})},customBodyRenderLite:a=>{const{walletSendStatus:o,walletSendAt:c,walletSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"wallet",onResend:B=>R(B,w[a],"wallet",[],!1)})}}},{label:"Push Kit",name:"pushKitSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{pushKitSendStatus:o,pushKitSendAt:c,pushKitSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"pushkit",onResend:B=>R(B,w[a],"pushKit",[],!1)})},filter:!0,filterType:"custom",filterList:p.pushKitSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Push Kit",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[2].options.filterList,"pushKitSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Push Kit",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Email",name:"emailSendStatus",width:200,options:{setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{emailSendStatus:o,emailSendAt:c,emailSendFailedReason:C}=w[a];return e.jsx(ce,{status:o,updatedAt:c,reason:C,channel:"email",onResend:B=>R(B,w[a],"email",[],!1)})},filter:!0,filterType:"custom",filterList:p.emailSendStatus??[],customFilterListOptions:{render:a=>e.jsx(Se,{list:a,label:"Email",onDelete:(o,c)=>{o.stopPropagation(),ne(o,c,le[3].options.filterList,"emailSendStatus")}}),update:ye},filterOptions:{names:O,fullWidth:!0,logic:je,display:(a,o,c,C)=>e.jsx(we,{label:"Email",filterList:a,onChange:o,index:c,column:C,filterValues:O})}}},{label:"Webhook",name:"webhook",width:200,options:{filter:!1,setCellProps:()=>({className:"sent-status-cell"}),customBodyRenderLite:a=>{const{webhook:o}=w[a];if(!o)return null;const c=Object.entries(o)[0];if(!c)return null;const[C,B]=c,G=B[0];return e.jsx(N,{sx:{display:"flex",flexDirection:"column",gap:1},children:e.jsxs(N,{className:"webhook-item",sx:{fontSize:12},children:[e.jsx(me,{maxLength:30,children:C},C),e.jsx(ce,{status:G.status,updatedAt:G.sendAt,reason:G.failedReason,channel:"webhook",onResend:K=>R(K,w[a],"webhook",[C],!1)})]},C)})}}},{label:r("common.createdAt"),name:"createdAt",width:100,options:{filter:!1,customBodyRenderLite:a=>{const{createdAt:o}=w[a];return e.jsx(tt,{value:o,locale:i,shouldUpdate:!0})}}}],[w,i,p,r]),ft=[e.jsx(ze,{value:p.dateRange,onChange:re},"date-picker"),e.jsx(Ae,{variant:"contained",size:"small",color:"primary",loading:P,startIcon:e.jsx(ht,{}),onClick:()=>z(),sx:{".MuiButton-startIcon":{mr:"2px"}},style:{marginLeft:8},children:r("common.refresh")},"refresh")];return e.jsx(N,{sx:{overflow:"auto",".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"},".MuiTableCell-root":{paddingRight:"8px",whiteSpace:"nowrap"}},children:e.jsx(ts,{children:e.jsxs(Xe,{theme:b,children:[e.jsx(Je,{className:"receivers-table",locale:i,loading:P,columns:le,data:w,onChange:J,options:se,customButtons:ft,components:{TableFilterList:a=>e.jsx(We,{...a,itemComponent:o=>e.jsx(Me,{...o,canDelete:()=>!1})})}}),M.anchorEl&&e.jsx(Ee,{open:!!M.anchorEl,anchorReference:"anchorPosition",anchorPosition:M.position,onClose:f,anchorOrigin:{vertical:"center",horizontal:"right"},transformOrigin:{vertical:"center",horizontal:"left"},children:e.jsxs(ss,{children:[e.jsxs(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 +1 @@
1
- import{j as t,at as r}from"./vendor-mui-core-DnR6WYuU.js";import{r as s}from"./vendor-react-CTtPmzVP.js";import{aT as a}from"./vendor-ux-DTEmWsko.js";import{V as n}from"./index-BZxsCCR_.js";import"./vendor-utils-CxWN1dT3.js";import"./vendor-hooks-qxhUUbW5.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CIBaEWEy.js";function l(){const{t:o}=s.useContext(a);return t.jsx(p,{style:{paddingTop:"25vh"},children:t.jsx(n,{status:"404",description:o("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const p=r.main``;export{l as default};
1
+ import{j as t,at as r}from"./vendor-mui-core-DnR6WYuU.js";import{r as s}from"./vendor-react-CTtPmzVP.js";import{aT as a}from"./vendor-ux-7TwTLXf8.js";import{V as n}from"./index-CGOBEhzW.js";import"./vendor-utils-CxWN1dT3.js";import"./vendor-hooks-qxhUUbW5.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-Dr30TSIK.js";function l(){const{t:o}=s.useContext(a);return t.jsx(p,{style:{paddingTop:"25vh"},children:t.jsx(n,{status:"404",description:o("noMatch.desc"),style:{backgroundColor:"transparent"}})})}const p=r.main``;export{l as default};
@@ -1,4 +1,4 @@
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,aN as H,V as W,m as V,k as P}from"./vendor-ux-DTEmWsko.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 M,a7 as ee}from"./index-BZxsCCR_.js";import{ad as ne,Q as oe,I as te}from"./vendor-utils-CxWN1dT3.js";import{a as ie}from"./vendor-hooks-qxhUUbW5.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")`
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,aN as H,V as W,m as V,k as P}from"./vendor-ux-7TwTLXf8.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 M,a7 as ee}from"./index-CGOBEhzW.js";import{ad as ne,Q as oe,I as te}from"./vendor-utils-CxWN1dT3.js";import{a as ie}from"./vendor-hooks-qxhUUbW5.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
2
  display: flex;
3
3
  flex-direction: column;
4
4
  font-size: 14px;
@@ -1,4 +1,4 @@
1
- import{r as v,g as $e,a as qe}from"./vendor-react-CTtPmzVP.js";import{g as Ue,q as V}from"./vendor-hooks-qxhUUbW5.js";import{j as e,ak as t,at as $,b6 as K,a6 as E,aZ as He,am as G,br as Ge,U as Ke,T as B,a3 as Ye,W as S,z as O,M as J,I as W,dZ as ge,bi as ye,A as Ze,x as Ve,cs as Je,ct as ee,ca as Qe,F as Xe,bZ as es,s as ss}from"./vendor-mui-core-DnR6WYuU.js";import{V as A,aK as _,aW as ts,aO as ae,b1 as se,H as D,w as N,at as re,bp as je,q as ve,aU as as,b8 as rs}from"./vendor-ux-DTEmWsko.js";import{Z as P,C as os,Q as be,c as M,G as X,Y as ns,q as is,J as ls,e as Z,ck as cs}from"./index-BZxsCCR_.js";import{W as oe}from"./did-address-CQO2MAbB.js";import{b as z}from"./team-DJUogroZ.js";import{r as ne,a as ie,b as le,c as Se,d as Q,e as ds,u as ps,f as us}from"./passport-item-DT01s3TO.js";import{p as Ce}from"./util-DWbXfz_X.js";import{u as ms}from"./use-mobile-BINJTzMb.js";import{v as H}from"./index-BqdvWprH.js";import{w as q,P as fs}from"./permission-B2PLdaCS.js";import{C as xs}from"./Google-DPANLEPw.js";import{c as hs}from"./create-passport-svg-DXpLsb6S.js";import{A as gs}from"./vendor-arcblock-CIBaEWEy.js";import{G as Y,ay as ys}from"./vendor-utils-CxWN1dT3.js";import{e as we}from"./edit.svg-RRSklUg-.js";import{H as ce,b as js}from"./index-D_Nnn_Mn.js";import{C as Te}from"./confirm-CkoSEAQA.js";import{L as Ie}from"./list-header-Cl3jykCe.js";import{f as te}from"./index-DBs9Ljax.js";import{u as vs}from"./useSetState-L-f8mSga.js";import"./lottie-web-4koyQiv_.js";import"./session-DwQKgNVz.js";import"./isURL-4Bkt0jKV.js";import"./use-app-logo-DbYok-1h.js";import"./ua-parser-DP5omx3I.js";import"./base32-D1hrOfad.js";import"./cloneDeep-C2rlAYcK.js";import"./lock.svg-BgybwZNe.js";const me="info";function De({createPassportSvg:c,passport:s,onCancel:p,onSwitchPassport:u=()=>{}}){const{t:f}=A(),i=Ue({tab:me}),d={info:{label:f("common.basicInfo"),value:me,component:()=>e.jsx(Pe,{passport:s,createPassportSvg:c})},logs:{label:f("common.logs"),value:"logs",component:()=>e.jsx(Ae,{passport:s})},related:{label:f("team.passport.related"),value:"related",component:()=>e.jsx(Le,{passport:s,onSwitchPassport:u})}},l=Object.values(d).map(({label:h,value:m})=>({label:h,value:m})).filter(h=>h.value==="related"?s.parentDid:!0),r=d[i.tab]||d.info,n=h=>{i.tab=h};return e.jsx(_,{title:f("common.passport"),onClose:p,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(bs,{children:[e.jsx(t,{className:"tabs",children:e.jsx(ts,{tabs:l,current:i.tab,onChange:n,scrollButtons:"auto"})}),e.jsx(t,{className:"body",children:e.jsx(r.component,{})})]})})}De.propTypes={createPassportSvg:S.func.isRequired,passport:S.object.isRequired,onCancel:S.func.isRequired,onSwitchPassport:S.func};const bs=$(t)`
1
+ import{r as v,g as $e,a as qe}from"./vendor-react-CTtPmzVP.js";import{g as Ue,q as V}from"./vendor-hooks-qxhUUbW5.js";import{j as e,ak as t,at as $,b6 as K,a6 as E,aZ as He,am as G,br as Ge,U as Ke,T as B,a3 as Ye,W as S,z as O,M as J,I as W,dZ as ge,bi as ye,A as Ze,x as Ve,cs as Je,ct as ee,ca as Qe,F as Xe,bZ as es,s as ss}from"./vendor-mui-core-DnR6WYuU.js";import{V as A,aK as _,aW as ts,aO as ae,b1 as se,H as D,w as N,at as re,bp as je,q as ve,aU as as,b8 as rs}from"./vendor-ux-7TwTLXf8.js";import{Z as P,C as os,Q as be,c as M,G as X,Y as ns,q as is,J as ls,e as Z,ck as cs}from"./index-CGOBEhzW.js";import{W as oe}from"./did-address-cHTriZHu.js";import{b as z}from"./team-DHhtcW5C.js";import{r as ne,a as ie,b as le,c as Se,d as Q,e as ds,u as ps,f as us}from"./passport-item-DD8VG51j.js";import{p as Ce}from"./util-D9UZY2ZN.js";import{u as ms}from"./use-mobile-BINJTzMb.js";import{v as H}from"./index-HU-v7OeI.js";import{w as q,P as fs}from"./permission-B3ddwA-4.js";import{C as xs}from"./Google-D9N2NN29.js";import{c as hs}from"./create-passport-svg-BJX-WFnl.js";import{A as gs}from"./vendor-arcblock-Dr30TSIK.js";import{G as Y,ay as ys}from"./vendor-utils-CxWN1dT3.js";import{e as we}from"./edit.svg-RRSklUg-.js";import{H as ce,b as js}from"./index-B1-cYl7K.js";import{C as Te}from"./confirm-BSaTCzrs.js";import{L as Ie}from"./list-header-Cl3jykCe.js";import{f as te}from"./index-DBs9Ljax.js";import{u as vs}from"./useSetState-L-f8mSga.js";import"./lottie-web-4koyQiv_.js";import"./session-vM0SwFQZ.js";import"./isURL-CJrtALFi.js";import"./use-app-logo-DSdF3M62.js";import"./ua-parser-DP5omx3I.js";import"./base32-BccrNIeO.js";import"./cloneDeep-C2rlAYcK.js";import"./lock.svg-BgybwZNe.js";const me="info";function De({createPassportSvg:c,passport:s,onCancel:p,onSwitchPassport:u=()=>{}}){const{t:f}=A(),i=Ue({tab:me}),d={info:{label:f("common.basicInfo"),value:me,component:()=>e.jsx(Pe,{passport:s,createPassportSvg:c})},logs:{label:f("common.logs"),value:"logs",component:()=>e.jsx(Ae,{passport:s})},related:{label:f("team.passport.related"),value:"related",component:()=>e.jsx(Le,{passport:s,onSwitchPassport:u})}},l=Object.values(d).map(({label:h,value:m})=>({label:h,value:m})).filter(h=>h.value==="related"?s.parentDid:!0),r=d[i.tab]||d.info,n=h=>{i.tab=h};return e.jsx(_,{title:f("common.passport"),onClose:p,open:!0,PaperProps:{style:{maxWidth:800,minHeight:"80vh"}},fullWidth:!0,children:e.jsxs(bs,{children:[e.jsx(t,{className:"tabs",children:e.jsx(ts,{tabs:l,current:i.tab,onChange:n,scrollButtons:"auto"})}),e.jsx(t,{className:"body",children:e.jsx(r.component,{})})]})})}De.propTypes={createPassportSvg:S.func.isRequired,passport:S.object.isRequired,onCancel:S.func.isRequired,onSwitchPassport:S.func};const bs=$(t)`
2
2
  margin-top: -16px;
3
3
 
4
4
  .tabs {
@@ -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-CxWN1dT3.js";import{l as p}from"./vendor-ux-DTEmWsko.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-CxWN1dT3.js";import{l as p}from"./vendor-ux-7TwTLXf8.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;
@@ -1 +1 @@
1
- import{j as i,bX as e,bn as a,W as s}from"./vendor-mui-core-DnR6WYuU.js";import{l}from"./vendor-ux-DTEmWsko.js";const r=l(t=>i.jsx(a,{focusVisibleClassName:".Mui-focusVisible",disableRipple:!0,...t}))(({theme:t})=>({width:42,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:2,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:t.palette.primary.main,opacity:1,border:0},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"&.Mui-focusVisible .MuiSwitch-thumb":{color:t.palette.primary.main,border:"6px solid #fff"},"&.Mui-disabled .MuiSwitch-thumb":{color:t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]},"&.Mui-disabled + .MuiSwitch-track":{opacity:t.palette.mode==="light"?.7:.3}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:22,height:22},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:t.palette.grey[200],opacity:1,transition:t.transitions.create(["background-color"],{duration:500})}}));function c({labelProps:t=null,...o}){return t?i.jsx(e,{control:i.jsx(r,{...o}),...t}):i.jsx(r,{...o})}c.propTypes={labelProps:s.object};export{c as u};
1
+ import{j as i,bX as e,bn as a,W as s}from"./vendor-mui-core-DnR6WYuU.js";import{l}from"./vendor-ux-7TwTLXf8.js";const r=l(t=>i.jsx(a,{focusVisibleClassName:".Mui-focusVisible",disableRipple:!0,...t}))(({theme:t})=>({width:42,height:26,padding:0,"& .MuiSwitch-switchBase":{padding:0,margin:2,transitionDuration:"300ms","&.Mui-checked":{transform:"translateX(16px)",color:"#fff","& + .MuiSwitch-track":{backgroundColor:t.palette.primary.main,opacity:1,border:0},"&.Mui-disabled + .MuiSwitch-track":{opacity:.5}},"&.Mui-focusVisible .MuiSwitch-thumb":{color:t.palette.primary.main,border:"6px solid #fff"},"&.Mui-disabled .MuiSwitch-thumb":{color:t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]},"&.Mui-disabled + .MuiSwitch-track":{opacity:t.palette.mode==="light"?.7:.3}},"& .MuiSwitch-thumb":{boxSizing:"border-box",width:22,height:22},"& .MuiSwitch-track":{borderRadius:26/2,backgroundColor:t.palette.grey[200],opacity:1,transition:t.transitions.create(["background-color"],{duration:500})}}));function c({labelProps:t=null,...o}){return t?i.jsx(e,{control:i.jsx(r,{...o}),...t}):i.jsx(r,{...o})}c.propTypes={labelProps:s.object};export{c as u};
@@ -1 +1 @@
1
- import{bU as z}from"./vendor-ux-DTEmWsko.js";function w(a){if(a===null||a===!0||a===!1)return NaN;var e=Number(a);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function s(a,e){if(e.length<a)throw new TypeError(a+" argument"+(a>1?"s":"")+" required, but only "+e.length+" present")}function f(a){s(1,arguments);var e=Object.prototype.toString.call(a);return a instanceof Date||z(a)==="object"&&e==="[object Date]"?new Date(a.getTime()):typeof a=="number"||e==="[object Number]"?new Date(a):((typeof a=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function se(a,e){s(2,arguments);var t=f(a),r=w(e);return isNaN(r)?new Date(NaN):(r&&t.setDate(t.getDate()+r),t)}function de(a,e){s(2,arguments);var t=f(a).getTime(),r=w(e);return new Date(t+r)}function Et(a,e){s(2,arguments);var t=w(e),r=t*7;return se(a,r)}function le(a,e){s(2,arguments);var t=f(a),r=w(e);if(isNaN(r))return new Date(NaN);if(!r)return t;var n=t.getDate(),i=new Date(t.getTime());i.setMonth(t.getMonth()+r+1,0);var o=i.getDate();return n>=o?i:(t.setFullYear(i.getFullYear(),i.getMonth(),n),t)}function Ft(a,e){s(2,arguments);var t=w(e);return le(a,t*12)}function $t(a,e){s(2,arguments);var t=f(a),r=f(e),n=t.getFullYear()-r.getFullYear(),i=t.getMonth()-r.getMonth();return n*12+i}function It(a){s(1,arguments);var e=f(a),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function fe(a){var e=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()));return e.setUTCFullYear(a.getFullYear()),a.getTime()-e.getTime()}function X(a){s(1,arguments);var e=f(a);return e.setHours(0,0,0,0),e}var J=6e4,Z=36e5,Ht=1e3,ce={};function C(){return ce}function qt(a,e){var t,r,n,i,o,u,l,d;s(1,arguments);var v=C(),c=w((t=(r=(n=(i=e?.weekStartsOn)!==null&&i!==void 0?i:e==null||(o=e.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:v.weekStartsOn)!==null&&r!==void 0?r:(l=v.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&t!==void 0?t:0);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=f(a),g=h.getDay(),b=(g<c?-7:0)+6-(g-c);return h.setDate(h.getDate()+b),h.setHours(23,59,59,999),h}function Rt(a){s(1,arguments);var e=f(a),t=e.getFullYear();return e.setFullYear(t+1,0,0),e.setHours(23,59,59,999),e}function ve(a){return s(1,arguments),a instanceof Date||z(a)==="object"&&Object.prototype.toString.call(a)==="[object Date]"}function me(a){if(s(1,arguments),!ve(a)&&typeof a!="number")return!1;var e=f(a);return!isNaN(Number(e))}function he(a,e){s(2,arguments);var t=w(e);return de(a,-t)}var ge=864e5;function we(a){s(1,arguments);var e=f(a),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),n=t-r;return Math.floor(n/ge)+1}function F(a){s(1,arguments);var e=1,t=f(a),r=t.getUTCDay(),n=(r<e?7:0)+r-e;return t.setUTCDate(t.getUTCDate()-n),t.setUTCHours(0,0,0,0),t}function K(a){s(1,arguments);var e=f(a),t=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(t+1,0,4),r.setUTCHours(0,0,0,0);var n=F(r),i=new Date(0);i.setUTCFullYear(t,0,4),i.setUTCHours(0,0,0,0);var o=F(i);return e.getTime()>=n.getTime()?t+1:e.getTime()>=o.getTime()?t:t-1}function be(a){s(1,arguments);var e=K(a),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var r=F(t);return r}var ye=6048e5;function Te(a){s(1,arguments);var e=f(a),t=F(e).getTime()-be(e).getTime();return Math.round(t/ye)+1}function $(a,e){var t,r,n,i,o,u,l,d;s(1,arguments);var v=C(),c=w((t=(r=(n=(i=e?.weekStartsOn)!==null&&i!==void 0?i:e==null||(o=e.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:v.weekStartsOn)!==null&&r!==void 0?r:(l=v.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&t!==void 0?t:0);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=f(a),g=h.getUTCDay(),b=(g<c?7:0)+g-c;return h.setUTCDate(h.getUTCDate()-b),h.setUTCHours(0,0,0,0),h}function ee(a,e){var t,r,n,i,o,u,l,d;s(1,arguments);var v=f(a),c=v.getUTCFullYear(),h=C(),g=w((t=(r=(n=(i=e?.firstWeekContainsDate)!==null&&i!==void 0?i:e==null||(o=e.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:h.firstWeekContainsDate)!==null&&r!==void 0?r:(l=h.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(g>=1&&g<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var b=new Date(0);b.setUTCFullYear(c+1,0,g),b.setUTCHours(0,0,0,0);var S=$(b,e),p=new Date(0);p.setUTCFullYear(c,0,g),p.setUTCHours(0,0,0,0);var k=$(p,e);return v.getTime()>=S.getTime()?c+1:v.getTime()>=k.getTime()?c:c-1}function De(a,e){var t,r,n,i,o,u,l,d;s(1,arguments);var v=C(),c=w((t=(r=(n=(i=e?.firstWeekContainsDate)!==null&&i!==void 0?i:e==null||(o=e.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:v.firstWeekContainsDate)!==null&&r!==void 0?r:(l=v.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&t!==void 0?t:1),h=ee(a,e),g=new Date(0);g.setUTCFullYear(h,0,c),g.setUTCHours(0,0,0,0);var b=$(g,e);return b}var pe=6048e5;function Oe(a,e){s(1,arguments);var t=f(a),r=$(t,e).getTime()-De(t,e).getTime();return Math.round(r/pe)+1}function m(a,e){for(var t=a<0?"-":"",r=Math.abs(a).toString();r.length<e;)r="0"+r;return t+r}var D={y:function(e,t){var r=e.getUTCFullYear(),n=r>0?r:1-r;return m(t==="yy"?n%100:n,t.length)},M:function(e,t){var r=e.getUTCMonth();return t==="M"?String(r+1):m(r+1,2)},d:function(e,t){return m(e.getUTCDate(),t.length)},a:function(e,t){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(e,t){return m(e.getUTCHours()%12||12,t.length)},H:function(e,t){return m(e.getUTCHours(),t.length)},m:function(e,t){return m(e.getUTCMinutes(),t.length)},s:function(e,t){return m(e.getUTCSeconds(),t.length)},S:function(e,t){var r=t.length,n=e.getUTCMilliseconds(),i=Math.floor(n*Math.pow(10,r-3));return m(i,t.length)}},M={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Me={G:function(e,t,r){var n=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){var n=e.getUTCFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return D.y(e,t)},Y:function(e,t,r,n){var i=ee(e,n),o=i>0?i:1-i;if(t==="YY"){var u=o%100;return m(u,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):m(o,t.length)},R:function(e,t){var r=K(e);return m(r,t.length)},u:function(e,t){var r=e.getUTCFullYear();return m(r,t.length)},Q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return m(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return m(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){var n=e.getUTCMonth();switch(t){case"M":case"MM":return D.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){var n=e.getUTCMonth();switch(t){case"L":return String(n+1);case"LL":return m(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){var i=Oe(e,n);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):m(i,t.length)},I:function(e,t,r){var n=Te(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):m(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):D.d(e,t)},D:function(e,t,r){var n=we(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):m(n,t.length)},E:function(e,t,r){var n=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){var i=e.getUTCDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return m(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){var i=e.getUTCDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return m(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){var n=e.getUTCDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return m(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){var n=e.getUTCHours(),i=n/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,r){var n=e.getUTCHours(),i;switch(n===12?i=M.noon:n===0?i=M.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){var n=e.getUTCHours(),i;switch(n>=17?i=M.evening:n>=12?i=M.afternoon:n>=4?i=M.morning:i=M.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){var n=e.getUTCHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return D.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):D.H(e,t)},K:function(e,t,r){var n=e.getUTCHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):m(n,t.length)},k:function(e,t,r){var n=e.getUTCHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):m(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):D.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):D.s(e,t)},S:function(e,t){return D.S(e,t)},X:function(e,t,r,n){var i=n._originalDate||e,o=i.getTimezoneOffset();if(o===0)return"Z";switch(t){case"X":return A(o);case"XXXX":case"XX":return O(o);case"XXXXX":case"XXX":default:return O(o,":")}},x:function(e,t,r,n){var i=n._originalDate||e,o=i.getTimezoneOffset();switch(t){case"x":return A(o);case"xxxx":case"xx":return O(o);case"xxxxx":case"xxx":default:return O(o,":")}},O:function(e,t,r,n){var i=n._originalDate||e,o=i.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+G(o,":");case"OOOO":default:return"GMT"+O(o,":")}},z:function(e,t,r,n){var i=n._originalDate||e,o=i.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+G(o,":");case"zzzz":default:return"GMT"+O(o,":")}},t:function(e,t,r,n){var i=n._originalDate||e,o=Math.floor(i.getTime()/1e3);return m(o,t.length)},T:function(e,t,r,n){var i=n._originalDate||e,o=i.getTime();return m(o,t.length)}};function G(a,e){var t=a>0?"-":"+",r=Math.abs(a),n=Math.floor(r/60),i=r%60;if(i===0)return t+String(n);var o=e;return t+String(n)+o+m(i,2)}function A(a,e){if(a%60===0){var t=a>0?"-":"+";return t+m(Math.abs(a)/60,2)}return O(a,e)}function O(a,e){var t=e||"",r=a>0?"-":"+",n=Math.abs(a),i=m(Math.floor(n/60),2),o=m(n%60,2);return r+i+t+o}var B=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},te=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Ce=function(e,t){var r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return B(e,t);var o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",B(n,t)).replace("{{time}}",te(i,t))},Se={p:te,P:Ce},ke=["D","DD"],Pe=["YY","YYYY"];function Ye(a){return ke.indexOf(a)!==-1}function We(a){return Pe.indexOf(a)!==-1}function V(a,e,t){if(a==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(a==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(a==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(a==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var _e={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},xe=function(e,t,r){var n,i=_e[e];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function j(a){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.width?String(e.width):a.defaultWidth,r=a.formats[t]||a.formats[a.defaultWidth];return r}}var Ne={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ue={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ee={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Fe={date:j({formats:Ne,defaultWidth:"full"}),time:j({formats:Ue,defaultWidth:"full"}),dateTime:j({formats:Ee,defaultWidth:"full"})},$e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ie=function(e,t,r,n){return $e[e]};function W(a){return function(e,t){var r=t!=null&&t.context?String(t.context):"standalone",n;if(r==="formatting"&&a.formattingValues){var i=a.defaultFormattingWidth||a.defaultWidth,o=t!=null&&t.width?String(t.width):i;n=a.formattingValues[o]||a.formattingValues[i]}else{var u=a.defaultWidth,l=t!=null&&t.width?String(t.width):a.defaultWidth;n=a.values[l]||a.values[u]}var d=a.argumentCallback?a.argumentCallback(e):e;return n[d]}}var He={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},qe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Re={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Le={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},je={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Qe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Xe=function(e,t){var r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Ge={ordinalNumber:Xe,era:W({values:He,defaultWidth:"wide"}),quarter:W({values:qe,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:W({values:Re,defaultWidth:"wide"}),day:W({values:Le,defaultWidth:"wide"}),dayPeriod:W({values:je,defaultWidth:"wide",formattingValues:Qe,defaultFormattingWidth:"wide"})};function _(a){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.width,n=r&&a.matchPatterns[r]||a.matchPatterns[a.defaultMatchWidth],i=e.match(n);if(!i)return null;var o=i[0],u=r&&a.parsePatterns[r]||a.parsePatterns[a.defaultParseWidth],l=Array.isArray(u)?Be(u,function(c){return c.test(o)}):Ae(u,function(c){return c.test(o)}),d;d=a.valueCallback?a.valueCallback(l):l,d=t.valueCallback?t.valueCallback(d):d;var v=e.slice(o.length);return{value:d,rest:v}}}function Ae(a,e){for(var t in a)if(a.hasOwnProperty(t)&&e(a[t]))return t}function Be(a,e){for(var t=0;t<a.length;t++)if(e(a[t]))return t}function Ve(a){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.match(a.matchPattern);if(!r)return null;var n=r[0],i=e.match(a.parsePattern);if(!i)return null;var o=a.valueCallback?a.valueCallback(i[0]):i[0];o=t.valueCallback?t.valueCallback(o):o;var u=e.slice(n.length);return{value:o,rest:u}}}var ze=/^(\d+)(th|st|nd|rd)?/i,Je=/\d+/i,Ze={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ke={any:[/^b/i,/^(a|c)/i]},et={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},tt={any:[/1/i,/2/i,/3/i,/4/i]},at={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},rt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},nt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},it={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},ot={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ut={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},st={ordinalNumber:Ve({matchPattern:ze,parsePattern:Je,valueCallback:function(e){return parseInt(e,10)}}),era:_({matchPatterns:Ze,defaultMatchWidth:"wide",parsePatterns:Ke,defaultParseWidth:"any"}),quarter:_({matchPatterns:et,defaultMatchWidth:"wide",parsePatterns:tt,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:_({matchPatterns:at,defaultMatchWidth:"wide",parsePatterns:rt,defaultParseWidth:"any"}),day:_({matchPatterns:nt,defaultMatchWidth:"wide",parsePatterns:it,defaultParseWidth:"any"}),dayPeriod:_({matchPatterns:ot,defaultMatchWidth:"any",parsePatterns:ut,defaultParseWidth:"any"})},dt={code:"en-US",formatDistance:xe,formatLong:Fe,formatRelative:Ie,localize:Ge,match:st,options:{weekStartsOn:0,firstWeekContainsDate:1}},lt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ft=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ct=/^'([^]*?)'?$/,vt=/''/g,mt=/[a-zA-Z]/;function ht(a,e,t){var r,n,i,o,u,l,d,v,c,h,g,b,S,p,k,I,H,q;s(2,arguments);var re=String(e),P=C(),Y=(r=(n=t?.locale)!==null&&n!==void 0?n:P.locale)!==null&&r!==void 0?r:dt,R=w((i=(o=(u=(l=t?.firstWeekContainsDate)!==null&&l!==void 0?l:t==null||(d=t.locale)===null||d===void 0||(v=d.options)===null||v===void 0?void 0:v.firstWeekContainsDate)!==null&&u!==void 0?u:P.firstWeekContainsDate)!==null&&o!==void 0?o:(c=P.locale)===null||c===void 0||(h=c.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(R>=1&&R<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var L=w((g=(b=(S=(p=t?.weekStartsOn)!==null&&p!==void 0?p:t==null||(k=t.locale)===null||k===void 0||(I=k.options)===null||I===void 0?void 0:I.weekStartsOn)!==null&&S!==void 0?S:P.weekStartsOn)!==null&&b!==void 0?b:(H=P.locale)===null||H===void 0||(q=H.options)===null||q===void 0?void 0:q.weekStartsOn)!==null&&g!==void 0?g:0);if(!(L>=0&&L<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!Y.localize)throw new RangeError("locale must contain localize property");if(!Y.formatLong)throw new RangeError("locale must contain formatLong property");var N=f(a);if(!me(N))throw new RangeError("Invalid time value");var ne=fe(N),ie=he(N,ne),oe={firstWeekContainsDate:R,weekStartsOn:L,locale:Y,_originalDate:N},ue=re.match(ft).map(function(y){var T=y[0];if(T==="p"||T==="P"){var U=Se[T];return U(y,Y.formatLong)}return y}).join("").match(lt).map(function(y){if(y==="''")return"'";var T=y[0];if(T==="'")return gt(y);var U=Me[T];if(U)return!(t!=null&&t.useAdditionalWeekYearTokens)&&We(y)&&V(y,e,String(a)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&Ye(y)&&V(y,e,String(a)),U(ie,y,Y.localize,oe);if(T.match(mt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+T+"`");return y}).join("");return ue}function gt(a){var e=a.match(ct);return e?e[1].replace(vt,"'"):a}const Lt=Object.freeze(Object.defineProperty({__proto__:null,default:ht},Symbol.toStringTag,{value:"Module"}));function jt(a){s(1,arguments);var e=f(a),t=e.getDate();return t}function wt(a){s(1,arguments);var e=f(a),t=e.getFullYear(),r=e.getMonth(),n=new Date(0);return n.setFullYear(t,r+1,0),n.setHours(0,0,0,0),n.getDate()}function Qt(a){s(1,arguments);var e=f(a),t=e.getMonth();return t}function Xt(a){return s(1,arguments),f(a).getFullYear()}function Gt(a,e){s(2,arguments);var t=f(a),r=f(e);return t.getTime()>r.getTime()}function At(a,e){s(2,arguments);var t=f(a),r=f(e);return t.getTime()<r.getTime()}function Bt(a,e){s(2,arguments);var t=X(a),r=X(e);return t.getTime()===r.getTime()}function Vt(a,e){s(2,arguments);var t=f(a),r=f(e);return t.getFullYear()===r.getFullYear()&&t.getMonth()===r.getMonth()}function zt(a,e){s(2,arguments);var t=f(a),r=w(e),n=t.getFullYear(),i=t.getDate(),o=new Date(0);o.setFullYear(n,r,15),o.setHours(0,0,0,0);var u=wt(o);return t.setMonth(r,Math.min(i,u)),t}function Jt(a,e){s(2,arguments);var t=f(a),r=w(e);return isNaN(t.getTime())?new Date(NaN):(t.setFullYear(r),t)}function Zt(a){s(1,arguments);var e=f(a);return e.setDate(1),e.setHours(0,0,0,0),e}function Kt(a,e){var t,r,n,i,o,u,l,d;s(1,arguments);var v=C(),c=w((t=(r=(n=(i=e?.weekStartsOn)!==null&&i!==void 0?i:e==null||(o=e.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:v.weekStartsOn)!==null&&r!==void 0?r:(l=v.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&t!==void 0?t:0);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=f(a),g=h.getDay(),b=(g<c?7:0)+g-c;return h.setDate(h.getDate()-b),h.setHours(0,0,0,0),h}function ea(a){s(1,arguments);var e=f(a),t=new Date(0);return t.setFullYear(e.getFullYear(),0,1),t.setHours(0,0,0,0),t}function bt(a,e){var t;s(1,arguments);var r=w((t=e?.additionalDigits)!==null&&t!==void 0?t:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof a=="string"||Object.prototype.toString.call(a)==="[object String]"))return new Date(NaN);var n=pt(a),i;if(n.date){var o=Ot(n.date,r);i=Mt(o.restDateString,o.year)}if(!i||isNaN(i.getTime()))return new Date(NaN);var u=i.getTime(),l=0,d;if(n.time&&(l=Ct(n.time),isNaN(l)))return new Date(NaN);if(n.timezone){if(d=St(n.timezone),isNaN(d))return new Date(NaN)}else{var v=new Date(u+l),c=new Date(0);return c.setFullYear(v.getUTCFullYear(),v.getUTCMonth(),v.getUTCDate()),c.setHours(v.getUTCHours(),v.getUTCMinutes(),v.getUTCSeconds(),v.getUTCMilliseconds()),c}return new Date(u+l+d)}var E={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},yt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Tt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Dt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function pt(a){var e={},t=a.split(E.dateTimeDelimiter),r;if(t.length>2)return e;if(/:/.test(t[0])?r=t[0]:(e.date=t[0],r=t[1],E.timeZoneDelimiter.test(e.date)&&(e.date=a.split(E.timeZoneDelimiter)[0],r=a.substr(e.date.length,a.length))),r){var n=E.timezone.exec(r);n?(e.time=r.replace(n[1],""),e.timezone=n[1]):e.time=r}return e}function Ot(a,e){var t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=a.match(t);if(!r)return{year:NaN,restDateString:""};var n=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?n:i*100,restDateString:a.slice((r[1]||r[2]).length)}}function Mt(a,e){if(e===null)return new Date(NaN);var t=a.match(yt);if(!t)return new Date(NaN);var r=!!t[4],n=x(t[1]),i=x(t[2])-1,o=x(t[3]),u=x(t[4]),l=x(t[5])-1;if(r)return _t(e,u,l)?kt(e,u,l):new Date(NaN);var d=new Date(0);return!Yt(e,i,o)||!Wt(e,n)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(n,o)),d)}function x(a){return a?parseInt(a):1}function Ct(a){var e=a.match(Tt);if(!e)return NaN;var t=Q(e[1]),r=Q(e[2]),n=Q(e[3]);return xt(t,r,n)?t*Z+r*J+n*1e3:NaN}function Q(a){return a&&parseFloat(a.replace(",","."))||0}function St(a){if(a==="Z")return 0;var e=a.match(Dt);if(!e)return 0;var t=e[1]==="+"?-1:1,r=parseInt(e[2]),n=e[3]&&parseInt(e[3])||0;return Nt(r,n)?t*(r*Z+n*J):NaN}function kt(a,e,t){var r=new Date(0);r.setUTCFullYear(a,0,4);var n=r.getUTCDay()||7,i=(e-1)*7+t+1-n;return r.setUTCDate(r.getUTCDate()+i),r}var Pt=[31,null,31,30,31,30,31,31,30,31,30,31];function ae(a){return a%400===0||a%4===0&&a%100!==0}function Yt(a,e,t){return e>=0&&e<=11&&t>=1&&t<=(Pt[e]||(ae(a)?29:28))}function Wt(a,e){return e>=1&&e<=(ae(a)?366:365)}function _t(a,e,t){return e>=1&&e<=53&&t>=0&&t<=6}function xt(a,e,t){return a===24?e===0&&t===0:t>=0&&t<60&&e>=0&&e<60&&a>=0&&a<25}function Nt(a,e){return e>=0&&e<=59}const ta=Object.freeze(Object.defineProperty({__proto__:null,default:bt},Symbol.toStringTag,{value:"Module"}));function aa(a,e){s(2,arguments);var t=f(a).getTime(),r=f(e.start).getTime(),n=f(e.end).getTime();if(!(r<=n))throw new RangeError("Invalid interval");return t>=r&&t<=n}export{Et as A,le as B,Ft as C,me as D,Gt as E,At as F,Bt as G,Vt as H,ea as I,Rt as J,Zt as K,Kt as L,qt as M,Xt as N,Jt as O,ht as P,aa as Q,jt as R,Qt as S,wt as T,zt as U,ta as V,Lt as W,de as a,f as b,J as c,$t as d,It as e,Ht as f,fe as g,ee as h,$ as i,F as j,Oe as k,Te as l,Z as m,C as n,dt as o,Se as p,We as q,s as r,X as s,w as t,V as u,Ye as v,he as w,m as x,bt as y,se as z};
1
+ import{bU as z}from"./vendor-ux-7TwTLXf8.js";function w(a){if(a===null||a===!0||a===!1)return NaN;var e=Number(a);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function s(a,e){if(e.length<a)throw new TypeError(a+" argument"+(a>1?"s":"")+" required, but only "+e.length+" present")}function f(a){s(1,arguments);var e=Object.prototype.toString.call(a);return a instanceof Date||z(a)==="object"&&e==="[object Date]"?new Date(a.getTime()):typeof a=="number"||e==="[object Number]"?new Date(a):((typeof a=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function se(a,e){s(2,arguments);var t=f(a),r=w(e);return isNaN(r)?new Date(NaN):(r&&t.setDate(t.getDate()+r),t)}function de(a,e){s(2,arguments);var t=f(a).getTime(),r=w(e);return new Date(t+r)}function Et(a,e){s(2,arguments);var t=w(e),r=t*7;return se(a,r)}function le(a,e){s(2,arguments);var t=f(a),r=w(e);if(isNaN(r))return new Date(NaN);if(!r)return t;var n=t.getDate(),i=new Date(t.getTime());i.setMonth(t.getMonth()+r+1,0);var o=i.getDate();return n>=o?i:(t.setFullYear(i.getFullYear(),i.getMonth(),n),t)}function Ft(a,e){s(2,arguments);var t=w(e);return le(a,t*12)}function $t(a,e){s(2,arguments);var t=f(a),r=f(e),n=t.getFullYear()-r.getFullYear(),i=t.getMonth()-r.getMonth();return n*12+i}function It(a){s(1,arguments);var e=f(a),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function fe(a){var e=new Date(Date.UTC(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds(),a.getMilliseconds()));return e.setUTCFullYear(a.getFullYear()),a.getTime()-e.getTime()}function X(a){s(1,arguments);var e=f(a);return e.setHours(0,0,0,0),e}var J=6e4,Z=36e5,Ht=1e3,ce={};function C(){return ce}function qt(a,e){var t,r,n,i,o,u,l,d;s(1,arguments);var v=C(),c=w((t=(r=(n=(i=e?.weekStartsOn)!==null&&i!==void 0?i:e==null||(o=e.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:v.weekStartsOn)!==null&&r!==void 0?r:(l=v.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&t!==void 0?t:0);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=f(a),g=h.getDay(),b=(g<c?-7:0)+6-(g-c);return h.setDate(h.getDate()+b),h.setHours(23,59,59,999),h}function Rt(a){s(1,arguments);var e=f(a),t=e.getFullYear();return e.setFullYear(t+1,0,0),e.setHours(23,59,59,999),e}function ve(a){return s(1,arguments),a instanceof Date||z(a)==="object"&&Object.prototype.toString.call(a)==="[object Date]"}function me(a){if(s(1,arguments),!ve(a)&&typeof a!="number")return!1;var e=f(a);return!isNaN(Number(e))}function he(a,e){s(2,arguments);var t=w(e);return de(a,-t)}var ge=864e5;function we(a){s(1,arguments);var e=f(a),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),n=t-r;return Math.floor(n/ge)+1}function F(a){s(1,arguments);var e=1,t=f(a),r=t.getUTCDay(),n=(r<e?7:0)+r-e;return t.setUTCDate(t.getUTCDate()-n),t.setUTCHours(0,0,0,0),t}function K(a){s(1,arguments);var e=f(a),t=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(t+1,0,4),r.setUTCHours(0,0,0,0);var n=F(r),i=new Date(0);i.setUTCFullYear(t,0,4),i.setUTCHours(0,0,0,0);var o=F(i);return e.getTime()>=n.getTime()?t+1:e.getTime()>=o.getTime()?t:t-1}function be(a){s(1,arguments);var e=K(a),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var r=F(t);return r}var ye=6048e5;function Te(a){s(1,arguments);var e=f(a),t=F(e).getTime()-be(e).getTime();return Math.round(t/ye)+1}function $(a,e){var t,r,n,i,o,u,l,d;s(1,arguments);var v=C(),c=w((t=(r=(n=(i=e?.weekStartsOn)!==null&&i!==void 0?i:e==null||(o=e.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:v.weekStartsOn)!==null&&r!==void 0?r:(l=v.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&t!==void 0?t:0);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=f(a),g=h.getUTCDay(),b=(g<c?7:0)+g-c;return h.setUTCDate(h.getUTCDate()-b),h.setUTCHours(0,0,0,0),h}function ee(a,e){var t,r,n,i,o,u,l,d;s(1,arguments);var v=f(a),c=v.getUTCFullYear(),h=C(),g=w((t=(r=(n=(i=e?.firstWeekContainsDate)!==null&&i!==void 0?i:e==null||(o=e.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:h.firstWeekContainsDate)!==null&&r!==void 0?r:(l=h.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(g>=1&&g<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var b=new Date(0);b.setUTCFullYear(c+1,0,g),b.setUTCHours(0,0,0,0);var S=$(b,e),p=new Date(0);p.setUTCFullYear(c,0,g),p.setUTCHours(0,0,0,0);var k=$(p,e);return v.getTime()>=S.getTime()?c+1:v.getTime()>=k.getTime()?c:c-1}function De(a,e){var t,r,n,i,o,u,l,d;s(1,arguments);var v=C(),c=w((t=(r=(n=(i=e?.firstWeekContainsDate)!==null&&i!==void 0?i:e==null||(o=e.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:v.firstWeekContainsDate)!==null&&r!==void 0?r:(l=v.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&t!==void 0?t:1),h=ee(a,e),g=new Date(0);g.setUTCFullYear(h,0,c),g.setUTCHours(0,0,0,0);var b=$(g,e);return b}var pe=6048e5;function Oe(a,e){s(1,arguments);var t=f(a),r=$(t,e).getTime()-De(t,e).getTime();return Math.round(r/pe)+1}function m(a,e){for(var t=a<0?"-":"",r=Math.abs(a).toString();r.length<e;)r="0"+r;return t+r}var D={y:function(e,t){var r=e.getUTCFullYear(),n=r>0?r:1-r;return m(t==="yy"?n%100:n,t.length)},M:function(e,t){var r=e.getUTCMonth();return t==="M"?String(r+1):m(r+1,2)},d:function(e,t){return m(e.getUTCDate(),t.length)},a:function(e,t){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(e,t){return m(e.getUTCHours()%12||12,t.length)},H:function(e,t){return m(e.getUTCHours(),t.length)},m:function(e,t){return m(e.getUTCMinutes(),t.length)},s:function(e,t){return m(e.getUTCSeconds(),t.length)},S:function(e,t){var r=t.length,n=e.getUTCMilliseconds(),i=Math.floor(n*Math.pow(10,r-3));return m(i,t.length)}},M={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Me={G:function(e,t,r){var n=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){var n=e.getUTCFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return D.y(e,t)},Y:function(e,t,r,n){var i=ee(e,n),o=i>0?i:1-i;if(t==="YY"){var u=o%100;return m(u,2)}return t==="Yo"?r.ordinalNumber(o,{unit:"year"}):m(o,t.length)},R:function(e,t){var r=K(e);return m(r,t.length)},u:function(e,t){var r=e.getUTCFullYear();return m(r,t.length)},Q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return m(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return m(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){var n=e.getUTCMonth();switch(t){case"M":case"MM":return D.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){var n=e.getUTCMonth();switch(t){case"L":return String(n+1);case"LL":return m(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){var i=Oe(e,n);return t==="wo"?r.ordinalNumber(i,{unit:"week"}):m(i,t.length)},I:function(e,t,r){var n=Te(e);return t==="Io"?r.ordinalNumber(n,{unit:"week"}):m(n,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):D.d(e,t)},D:function(e,t,r){var n=we(e);return t==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):m(n,t.length)},E:function(e,t,r){var n=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){var i=e.getUTCDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return m(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});case"eeee":default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){var i=e.getUTCDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return m(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});case"cccc":default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){var n=e.getUTCDay(),i=n===0?7:n;switch(t){case"i":return String(i);case"ii":return m(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){var n=e.getUTCHours(),i=n/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,r){var n=e.getUTCHours(),i;switch(n===12?i=M.noon:n===0?i=M.midnight:i=n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,r){var n=e.getUTCHours(),i;switch(n>=17?i=M.evening:n>=12?i=M.afternoon:n>=4?i=M.morning:i=M.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){var n=e.getUTCHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return D.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):D.H(e,t)},K:function(e,t,r){var n=e.getUTCHours()%12;return t==="Ko"?r.ordinalNumber(n,{unit:"hour"}):m(n,t.length)},k:function(e,t,r){var n=e.getUTCHours();return n===0&&(n=24),t==="ko"?r.ordinalNumber(n,{unit:"hour"}):m(n,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):D.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):D.s(e,t)},S:function(e,t){return D.S(e,t)},X:function(e,t,r,n){var i=n._originalDate||e,o=i.getTimezoneOffset();if(o===0)return"Z";switch(t){case"X":return A(o);case"XXXX":case"XX":return O(o);case"XXXXX":case"XXX":default:return O(o,":")}},x:function(e,t,r,n){var i=n._originalDate||e,o=i.getTimezoneOffset();switch(t){case"x":return A(o);case"xxxx":case"xx":return O(o);case"xxxxx":case"xxx":default:return O(o,":")}},O:function(e,t,r,n){var i=n._originalDate||e,o=i.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+G(o,":");case"OOOO":default:return"GMT"+O(o,":")}},z:function(e,t,r,n){var i=n._originalDate||e,o=i.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+G(o,":");case"zzzz":default:return"GMT"+O(o,":")}},t:function(e,t,r,n){var i=n._originalDate||e,o=Math.floor(i.getTime()/1e3);return m(o,t.length)},T:function(e,t,r,n){var i=n._originalDate||e,o=i.getTime();return m(o,t.length)}};function G(a,e){var t=a>0?"-":"+",r=Math.abs(a),n=Math.floor(r/60),i=r%60;if(i===0)return t+String(n);var o=e;return t+String(n)+o+m(i,2)}function A(a,e){if(a%60===0){var t=a>0?"-":"+";return t+m(Math.abs(a)/60,2)}return O(a,e)}function O(a,e){var t=e||"",r=a>0?"-":"+",n=Math.abs(a),i=m(Math.floor(n/60),2),o=m(n%60,2);return r+i+t+o}var B=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},te=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Ce=function(e,t){var r=e.match(/(P+)(p+)?/)||[],n=r[1],i=r[2];if(!i)return B(e,t);var o;switch(n){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",B(n,t)).replace("{{time}}",te(i,t))},Se={p:te,P:Ce},ke=["D","DD"],Pe=["YY","YYYY"];function Ye(a){return ke.indexOf(a)!==-1}function We(a){return Pe.indexOf(a)!==-1}function V(a,e,t){if(a==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(a==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(a==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(a==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var _e={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},xe=function(e,t,r){var n,i=_e[e];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function j(a){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.width?String(e.width):a.defaultWidth,r=a.formats[t]||a.formats[a.defaultWidth];return r}}var Ne={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ue={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ee={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Fe={date:j({formats:Ne,defaultWidth:"full"}),time:j({formats:Ue,defaultWidth:"full"}),dateTime:j({formats:Ee,defaultWidth:"full"})},$e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ie=function(e,t,r,n){return $e[e]};function W(a){return function(e,t){var r=t!=null&&t.context?String(t.context):"standalone",n;if(r==="formatting"&&a.formattingValues){var i=a.defaultFormattingWidth||a.defaultWidth,o=t!=null&&t.width?String(t.width):i;n=a.formattingValues[o]||a.formattingValues[i]}else{var u=a.defaultWidth,l=t!=null&&t.width?String(t.width):a.defaultWidth;n=a.values[l]||a.values[u]}var d=a.argumentCallback?a.argumentCallback(e):e;return n[d]}}var He={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},qe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Re={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Le={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},je={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Qe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Xe=function(e,t){var r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Ge={ordinalNumber:Xe,era:W({values:He,defaultWidth:"wide"}),quarter:W({values:qe,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:W({values:Re,defaultWidth:"wide"}),day:W({values:Le,defaultWidth:"wide"}),dayPeriod:W({values:je,defaultWidth:"wide",formattingValues:Qe,defaultFormattingWidth:"wide"})};function _(a){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.width,n=r&&a.matchPatterns[r]||a.matchPatterns[a.defaultMatchWidth],i=e.match(n);if(!i)return null;var o=i[0],u=r&&a.parsePatterns[r]||a.parsePatterns[a.defaultParseWidth],l=Array.isArray(u)?Be(u,function(c){return c.test(o)}):Ae(u,function(c){return c.test(o)}),d;d=a.valueCallback?a.valueCallback(l):l,d=t.valueCallback?t.valueCallback(d):d;var v=e.slice(o.length);return{value:d,rest:v}}}function Ae(a,e){for(var t in a)if(a.hasOwnProperty(t)&&e(a[t]))return t}function Be(a,e){for(var t=0;t<a.length;t++)if(e(a[t]))return t}function Ve(a){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.match(a.matchPattern);if(!r)return null;var n=r[0],i=e.match(a.parsePattern);if(!i)return null;var o=a.valueCallback?a.valueCallback(i[0]):i[0];o=t.valueCallback?t.valueCallback(o):o;var u=e.slice(n.length);return{value:o,rest:u}}}var ze=/^(\d+)(th|st|nd|rd)?/i,Je=/\d+/i,Ze={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ke={any:[/^b/i,/^(a|c)/i]},et={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},tt={any:[/1/i,/2/i,/3/i,/4/i]},at={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},rt={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},nt={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},it={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},ot={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ut={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},st={ordinalNumber:Ve({matchPattern:ze,parsePattern:Je,valueCallback:function(e){return parseInt(e,10)}}),era:_({matchPatterns:Ze,defaultMatchWidth:"wide",parsePatterns:Ke,defaultParseWidth:"any"}),quarter:_({matchPatterns:et,defaultMatchWidth:"wide",parsePatterns:tt,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:_({matchPatterns:at,defaultMatchWidth:"wide",parsePatterns:rt,defaultParseWidth:"any"}),day:_({matchPatterns:nt,defaultMatchWidth:"wide",parsePatterns:it,defaultParseWidth:"any"}),dayPeriod:_({matchPatterns:ot,defaultMatchWidth:"any",parsePatterns:ut,defaultParseWidth:"any"})},dt={code:"en-US",formatDistance:xe,formatLong:Fe,formatRelative:Ie,localize:Ge,match:st,options:{weekStartsOn:0,firstWeekContainsDate:1}},lt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ft=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ct=/^'([^]*?)'?$/,vt=/''/g,mt=/[a-zA-Z]/;function ht(a,e,t){var r,n,i,o,u,l,d,v,c,h,g,b,S,p,k,I,H,q;s(2,arguments);var re=String(e),P=C(),Y=(r=(n=t?.locale)!==null&&n!==void 0?n:P.locale)!==null&&r!==void 0?r:dt,R=w((i=(o=(u=(l=t?.firstWeekContainsDate)!==null&&l!==void 0?l:t==null||(d=t.locale)===null||d===void 0||(v=d.options)===null||v===void 0?void 0:v.firstWeekContainsDate)!==null&&u!==void 0?u:P.firstWeekContainsDate)!==null&&o!==void 0?o:(c=P.locale)===null||c===void 0||(h=c.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&i!==void 0?i:1);if(!(R>=1&&R<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var L=w((g=(b=(S=(p=t?.weekStartsOn)!==null&&p!==void 0?p:t==null||(k=t.locale)===null||k===void 0||(I=k.options)===null||I===void 0?void 0:I.weekStartsOn)!==null&&S!==void 0?S:P.weekStartsOn)!==null&&b!==void 0?b:(H=P.locale)===null||H===void 0||(q=H.options)===null||q===void 0?void 0:q.weekStartsOn)!==null&&g!==void 0?g:0);if(!(L>=0&&L<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!Y.localize)throw new RangeError("locale must contain localize property");if(!Y.formatLong)throw new RangeError("locale must contain formatLong property");var N=f(a);if(!me(N))throw new RangeError("Invalid time value");var ne=fe(N),ie=he(N,ne),oe={firstWeekContainsDate:R,weekStartsOn:L,locale:Y,_originalDate:N},ue=re.match(ft).map(function(y){var T=y[0];if(T==="p"||T==="P"){var U=Se[T];return U(y,Y.formatLong)}return y}).join("").match(lt).map(function(y){if(y==="''")return"'";var T=y[0];if(T==="'")return gt(y);var U=Me[T];if(U)return!(t!=null&&t.useAdditionalWeekYearTokens)&&We(y)&&V(y,e,String(a)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&Ye(y)&&V(y,e,String(a)),U(ie,y,Y.localize,oe);if(T.match(mt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+T+"`");return y}).join("");return ue}function gt(a){var e=a.match(ct);return e?e[1].replace(vt,"'"):a}const Lt=Object.freeze(Object.defineProperty({__proto__:null,default:ht},Symbol.toStringTag,{value:"Module"}));function jt(a){s(1,arguments);var e=f(a),t=e.getDate();return t}function wt(a){s(1,arguments);var e=f(a),t=e.getFullYear(),r=e.getMonth(),n=new Date(0);return n.setFullYear(t,r+1,0),n.setHours(0,0,0,0),n.getDate()}function Qt(a){s(1,arguments);var e=f(a),t=e.getMonth();return t}function Xt(a){return s(1,arguments),f(a).getFullYear()}function Gt(a,e){s(2,arguments);var t=f(a),r=f(e);return t.getTime()>r.getTime()}function At(a,e){s(2,arguments);var t=f(a),r=f(e);return t.getTime()<r.getTime()}function Bt(a,e){s(2,arguments);var t=X(a),r=X(e);return t.getTime()===r.getTime()}function Vt(a,e){s(2,arguments);var t=f(a),r=f(e);return t.getFullYear()===r.getFullYear()&&t.getMonth()===r.getMonth()}function zt(a,e){s(2,arguments);var t=f(a),r=w(e),n=t.getFullYear(),i=t.getDate(),o=new Date(0);o.setFullYear(n,r,15),o.setHours(0,0,0,0);var u=wt(o);return t.setMonth(r,Math.min(i,u)),t}function Jt(a,e){s(2,arguments);var t=f(a),r=w(e);return isNaN(t.getTime())?new Date(NaN):(t.setFullYear(r),t)}function Zt(a){s(1,arguments);var e=f(a);return e.setDate(1),e.setHours(0,0,0,0),e}function Kt(a,e){var t,r,n,i,o,u,l,d;s(1,arguments);var v=C(),c=w((t=(r=(n=(i=e?.weekStartsOn)!==null&&i!==void 0?i:e==null||(o=e.locale)===null||o===void 0||(u=o.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:v.weekStartsOn)!==null&&r!==void 0?r:(l=v.locale)===null||l===void 0||(d=l.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&t!==void 0?t:0);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=f(a),g=h.getDay(),b=(g<c?7:0)+g-c;return h.setDate(h.getDate()-b),h.setHours(0,0,0,0),h}function ea(a){s(1,arguments);var e=f(a),t=new Date(0);return t.setFullYear(e.getFullYear(),0,1),t.setHours(0,0,0,0),t}function bt(a,e){var t;s(1,arguments);var r=w((t=e?.additionalDigits)!==null&&t!==void 0?t:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof a=="string"||Object.prototype.toString.call(a)==="[object String]"))return new Date(NaN);var n=pt(a),i;if(n.date){var o=Ot(n.date,r);i=Mt(o.restDateString,o.year)}if(!i||isNaN(i.getTime()))return new Date(NaN);var u=i.getTime(),l=0,d;if(n.time&&(l=Ct(n.time),isNaN(l)))return new Date(NaN);if(n.timezone){if(d=St(n.timezone),isNaN(d))return new Date(NaN)}else{var v=new Date(u+l),c=new Date(0);return c.setFullYear(v.getUTCFullYear(),v.getUTCMonth(),v.getUTCDate()),c.setHours(v.getUTCHours(),v.getUTCMinutes(),v.getUTCSeconds(),v.getUTCMilliseconds()),c}return new Date(u+l+d)}var E={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},yt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Tt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Dt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function pt(a){var e={},t=a.split(E.dateTimeDelimiter),r;if(t.length>2)return e;if(/:/.test(t[0])?r=t[0]:(e.date=t[0],r=t[1],E.timeZoneDelimiter.test(e.date)&&(e.date=a.split(E.timeZoneDelimiter)[0],r=a.substr(e.date.length,a.length))),r){var n=E.timezone.exec(r);n?(e.time=r.replace(n[1],""),e.timezone=n[1]):e.time=r}return e}function Ot(a,e){var t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=a.match(t);if(!r)return{year:NaN,restDateString:""};var n=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?n:i*100,restDateString:a.slice((r[1]||r[2]).length)}}function Mt(a,e){if(e===null)return new Date(NaN);var t=a.match(yt);if(!t)return new Date(NaN);var r=!!t[4],n=x(t[1]),i=x(t[2])-1,o=x(t[3]),u=x(t[4]),l=x(t[5])-1;if(r)return _t(e,u,l)?kt(e,u,l):new Date(NaN);var d=new Date(0);return!Yt(e,i,o)||!Wt(e,n)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(n,o)),d)}function x(a){return a?parseInt(a):1}function Ct(a){var e=a.match(Tt);if(!e)return NaN;var t=Q(e[1]),r=Q(e[2]),n=Q(e[3]);return xt(t,r,n)?t*Z+r*J+n*1e3:NaN}function Q(a){return a&&parseFloat(a.replace(",","."))||0}function St(a){if(a==="Z")return 0;var e=a.match(Dt);if(!e)return 0;var t=e[1]==="+"?-1:1,r=parseInt(e[2]),n=e[3]&&parseInt(e[3])||0;return Nt(r,n)?t*(r*Z+n*J):NaN}function kt(a,e,t){var r=new Date(0);r.setUTCFullYear(a,0,4);var n=r.getUTCDay()||7,i=(e-1)*7+t+1-n;return r.setUTCDate(r.getUTCDate()+i),r}var Pt=[31,null,31,30,31,30,31,31,30,31,30,31];function ae(a){return a%400===0||a%4===0&&a%100!==0}function Yt(a,e,t){return e>=0&&e<=11&&t>=1&&t<=(Pt[e]||(ae(a)?29:28))}function Wt(a,e){return e>=1&&e<=(ae(a)?366:365)}function _t(a,e,t){return e>=1&&e<=53&&t>=0&&t<=6}function xt(a,e,t){return a===24?e===0&&t===0:t>=0&&t<60&&e>=0&&e<60&&a>=0&&a<25}function Nt(a,e){return e>=0&&e<=59}const ta=Object.freeze(Object.defineProperty({__proto__:null,default:bt},Symbol.toStringTag,{value:"Module"}));function aa(a,e){s(2,arguments);var t=f(a).getTime(),r=f(e.start).getTime(),n=f(e.end).getTime();if(!(r<=n))throw new RangeError("Invalid interval");return t>=r&&t<=n}export{Et as A,le as B,Ft as C,me as D,Gt as E,At as F,Bt as G,Vt as H,ea as I,Rt as J,Zt as K,Kt as L,qt as M,Xt as N,Jt as O,ht as P,aa as Q,jt as R,Qt as S,wt as T,zt as U,ta as V,Lt as W,de as a,f as b,J as c,$t as d,It as e,Ht as f,fe as g,ee as h,$ as i,F as j,Oe as k,Te as l,Z as m,C as n,dt as o,Se as p,We as q,s as r,X as s,w as t,V as u,Ye as v,he as w,m as x,bt as y,se as z};
@@ -1,4 +1,4 @@
1
- import{V as M,H as P,z as te,b9 as me,cB as nt,cC as it,aT as Q,aj as B,aK as pe,w as W,W as $,cD as ot,cE as rt,aV as Se,cF as at,aO as st,aW as De}from"./vendor-ux-DTEmWsko.js";import{b as h,a as ne,f as lt,g as ae,c as ct}from"./vendor-hooks-qxhUUbW5.js";import{r as D,L as dt}from"./vendor-react-CTtPmzVP.js";import{j as e,ak as a,y as U,z as E,W as k,bX as K,Q as X,T as oe,I as ue,a3 as de,D as xe,b6 as H,cu as Pe,bi as Ae,d_ as ut,at as Ee,ah as Re,d$ as We,a6 as Le,am as mt,e0 as ht,bb as pt}from"./vendor-mui-core-DnR6WYuU.js";import{Z as _,Y as z,c as J,cn as Ie,aD as Ue,am as Z,bC as xt,J as ft,h as gt}from"./index-BZxsCCR_.js";import{A as Y,n as O,C as ie,I as ze,b as re,_ as _e,az as bt,a as jt}from"./vendor-utils-CxWN1dT3.js";import{u as G,C as I,a as Fe}from"./index.esm-Co8ZxFyk.js";import{S as w}from"./section-jXB9AxBb.js";import{S as vt}from"./switch-control-BHBY0I2i.js";import{d as kt,a as yt}from"./edit-rounded-CnMn6J-D.js";import{S as wt}from"./simple-select-BCM4gn4x.js";import{u as Ne}from"./index-VFqVu6RK.js";import{v as St}from"./index-icvBZv9S.js";import{r as Lt}from"./base32-D1hrOfad.js";import{C as It}from"./click-to-copy-Y_g1bzK1.js";import{u as Tt}from"./use-mobile-BINJTzMb.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-CIBaEWEy.js";import"./required-BQln5OcV.js";import"./arrow-down.svg-C4FUKwt4.js";const fe={domain:"",clientId:"",clientSecret:""};function He({ref:u=null,onSuccess:d=O,sortMaps:c={}}){const{api:o}=_(),{blocklet:i}=z(),{t,locale:f}=M(),s=i?.meta?.did,j=Object.assign({...fe},i?.settings?.authentication?.auth0||{}),l=(i.environments||[]).find(r=>r.key==="BLOCKLET_APP_URL")?.value||window.location.origin,{handleSubmit:g,control:v,formState:m,reset:y}=G({defaultValues:Y(j,Object.keys(fe))}),b=h(async r=>{try{const{blocklet:n}=await o.configAuthentication({input:{did:s,authentication:JSON.stringify({...c,auth0:{...r,order:c.auth0?.order??Object.keys(c).length,enabled:!0,type:"oauth"}})}}),L=Object.assign({...fe},n?.settings?.authentication?.auth0||{});y(L),P.success(t("common.saveSuccess")),d()}catch(n){P.error(n.message||t("common.saveFailed"))}}),T=h(r=>r?.trim()?!0:t("authentication.auth0.domainDescription")),S=h(r=>r?.trim()?!0:t("authentication.auth0.clientIdDescription")),C=h(r=>r?.trim()?!0:t("authentication.auth0.clientSecretDescription")),x=ne(()=>f==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-auth0":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-auth0",[f]),p=ie(l,J.WELLKNOWN_SERVICE_PATH_PREFIX,"oauth/callback/auth0");return D.useImperativeHandle(u,()=>({submit:g(b)}),[g,b]),e.jsx(a,{children:e.jsxs("form",{onSubmit:g(b),disabled:!0,children:[e.jsx(w,{title:t("authentication.viewDocument"),children:e.jsxs(a,{component:"a",href:x,target:"_blank",rel:"noopener noreferrer",sx:{verticalAlign:"middle",color:"inherit",fontSize:"14px","&:hover":{textDecoration:"underline"}},children:[x,e.jsx(a,{component:te,icon:Ie,sx:{marginLeft:"6px",verticalAlign:"middle",lineHeight:1,scale:1.1}})]})}),e.jsx(w,{title:t("authentication.oauthCallbackUrl"),children:e.jsxs(a,{sx:{mb:1,verticalAlign:"middle",fontSize:"14px",wordBreak:"break-all"},children:[p,e.jsx(me,{locale:f,content:p,style:{marginLeft:"6px",verticalAlign:"middle",scale:.8,lineHeight:1}})]})}),e.jsx(w,{title:t("authentication.auth0.domain"),children:e.jsx(I,{name:"domain",control:v,rules:{validate:T},render:({field:r})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...r,size:"small",label:t("authentication.auth0.domain"),error:!!m.errors[r.name],helperText:m.errors[r.name]?.message||" "})})})}),e.jsx(w,{title:t("authentication.auth0.clientId"),children:e.jsx(I,{name:"clientId",control:v,rules:{validate:S},render:({field:r})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...r,size:"small",label:t("authentication.auth0.clientId"),error:!!m.errors[r.name],helperText:m.errors[r.name]?.message||" "})})})}),e.jsx(w,{title:t("authentication.auth0.clientSecret"),children:e.jsx(I,{name:"clientSecret",control:v,rules:{validate:C},render:({field:r})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...r,size:"small",type:"password",label:t("authentication.auth0.clientSecret"),error:!!m.errors[r.name],helperText:m.errors[r.name]?.message||" "})})})})]})})}He.propTypes={ref:k.any,onSuccess:k.func,sortMaps:k.object};const ge={clientId:"",clientSecret:""};function Ve({ref:u=null,onSuccess:d=O,sortMaps:c={}}){const{api:o}=_(),{blocklet:i}=z(),{t,locale:f}=M(),s=i?.meta?.did,j=Object.assign({...ge},i?.settings?.authentication?.github||{}),l=(i.environments||[]).find(p=>p.key==="BLOCKLET_APP_URL")?.value||window.location.origin,{handleSubmit:g,control:v,formState:m,reset:y}=G({defaultValues:Y(j,Object.keys(ge))}),b=h(async p=>{try{const{blocklet:r}=await o.configAuthentication({input:{did:s,authentication:JSON.stringify({...c,github:{...p,order:c.github?.order??Object.keys(c).length,enabled:!0,type:"oauth"}})}}),n=Object.assign({...ge},r?.settings?.authentication?.github||{});y(n),P.success(t("common.saveSuccess")),d()}catch(r){P.error(r.message||t("common.saveFailed"))}}),T=h(p=>p?.trim()?!0:t("authentication.github.clientIdDescription")),S=h(p=>p?.trim()?!0:t("authentication.github.clientSecretDescription")),C=ne(()=>f==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-github":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-github",[f]),x=ie(l,J.WELLKNOWN_SERVICE_PATH_PREFIX,"oauth/callback/github");return D.useImperativeHandle(u,()=>({submit:g(b)}),[g,b]),e.jsx(a,{children:e.jsxs("form",{disabled:!0,children:[e.jsx(w,{title:t("authentication.viewDocument"),children:e.jsxs(a,{component:"a",href:C,target:"_blank",rel:"noopener noreferrer",sx:{verticalAlign:"middle",color:"inherit",fontSize:"14px","&:hover":{textDecoration:"underline"}},children:[C,e.jsx(a,{component:te,icon:Ie,sx:{marginLeft:"6px",verticalAlign:"middle",lineHeight:1,scale:1.1}})]})}),e.jsx(w,{title:t("authentication.oauthCallbackUrl"),children:e.jsxs(a,{sx:{mb:1,verticalAlign:"middle",fontSize:"14px",wordBreak:"break-all"},children:[x,e.jsx(me,{locale:f,content:x,style:{marginLeft:"6px",verticalAlign:"middle",scale:.8,lineHeight:1}})]})}),e.jsx(w,{title:t("authentication.github.clientId"),children:e.jsx(I,{name:"clientId",control:v,rules:{validate:T},render:({field:p})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...p,size:"small",label:t("authentication.github.clientId"),error:!!m.errors[p.name],helperText:m.errors[p.name]?.message||" "})})})}),e.jsx(w,{title:t("authentication.github.clientSecret"),children:e.jsx(I,{name:"clientSecret",control:v,rules:{validate:S},render:({field:p})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...p,size:"small",type:"password",label:t("authentication.github.clientSecret"),error:!!m.errors[p.name],helperText:m.errors[p.name]?.message||" "})})})})]})})}Ve.propTypes={ref:k.any,onSuccess:k.func,sortMaps:k.object};const be={showQrcode:!0};function Me({ref:u=null,onSuccess:d=O,sortMaps:c={}}){const{api:o}=_(),{blocklet:i}=z(),{t}=M(),f=i?.meta?.did,s=Object.assign({...be},i?.settings?.authentication?.wallet||{}),{handleSubmit:j,control:l,reset:g}=G({defaultValues:Y(s,Object.keys(be))}),v=h(async m=>{try{const{blocklet:y}=await o.configAuthentication({input:{did:f,authentication:JSON.stringify({...c,wallet:{...m,order:c.wallet?.order??Object.keys(c).length,enabled:!0,type:"builtin"}})}}),b=Object.assign({...be},y?.settings?.authentication?.wallet||{});g(b),P.success(t("common.saveSuccess")),d()}catch(y){P.error(y.message||t("common.saveFailed"))}});return D.useImperativeHandle(u,()=>({submit:j(v)}),[j,v]),e.jsx(a,{children:e.jsx("form",{children:e.jsx(w,{title:t("authentication.wallet.showQrcode"),children:e.jsx(I,{name:"showQrcode",control:l,render:({field:m})=>e.jsx(K,{control:e.jsx(vt,{sx:{ml:1},checked:m.value,...m})})})})})})}Me.propTypes={ref:k.any,onSuccess:k.func,sortMaps:k.object};function $e({ref:u=null,onSuccess:d=O,sortMaps:c={}}){const{api:o}=_(),{blocklet:i}=z(),{t}=M(),f=i?.meta?.did,s=h(async()=>{try{await o.configAuthentication({input:{did:f,authentication:JSON.stringify({...c,email:{order:c.email?.order??Object.keys(c).length,enabled:!0,type:"builtin"}})}}),P.success(t("common.saveSuccess")),d()}catch(j){P.error(j.message||t("common.saveFailed"))}});return D.useImperativeHandle(u,()=>({submit:s}),[s]),e.jsxs(a,{children:[t("authentication.emailLoginDescription"),e.jsx("br",{}),t("authentication.emailNotificationRequired"),e.jsx("br",{}),e.jsx(a,{component:dt,to:ie(J.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/notification/settings"),sx:{mt:1,display:"inline-block"},children:e.jsx(X,{size:"small",variant:"outlined",children:t("authentication.gotoEmailNotification")})})]})}$e.propTypes={ref:k.any,onSuccess:k.func,sortMaps:k.object};function Ke({ref:u=null,onSuccess:d=O,sortMaps:c={}}){const{api:o}=_(),{blocklet:i}=z(),{t}=M(),f=i?.meta?.did,s=h(async()=>{try{await o.configAuthentication({input:{did:f,authentication:JSON.stringify({...c,passkey:{order:c.passkey?.order??Object.keys(c).length,enabled:!0,type:"builtin"}})}}),P.success(t("common.saveSuccess")),d()}catch(j){P.error(j.message||t("common.saveFailed"))}});return D.useImperativeHandle(u,()=>({submit:s}),[s]),null}Ke.propTypes={ref:k.any,onSuccess:k.func,sortMaps:k.object};const je={clientId:"",clientSecret:""};function Je({ref:u=null,onSuccess:d=O,sortMaps:c={}}){const{api:o}=_(),{blocklet:i}=z(),{t,locale:f}=M(),s=i?.meta?.did,j=Object.assign({...je},i?.settings?.authentication?.google||{}),l=(i.environments||[]).find(p=>p.key==="BLOCKLET_APP_URL")?.value||window.location.origin,{handleSubmit:g,control:v,formState:m,reset:y}=G({defaultValues:Y(j,Object.keys(je))}),b=h(async p=>{try{const{blocklet:r}=await o.configAuthentication({input:{did:s,authentication:JSON.stringify({...c,google:{...p,order:c.google?.order??Object.keys(c).length,enabled:!0,type:"oauth"}})}}),n=Object.assign({...je},r?.settings?.authentication?.google||{});y(n),P.success(t("common.saveSuccess")),d()}catch(r){P.error(r.message||t("common.saveFailed"))}}),T=h(p=>p?.trim()?!0:t("authentication.google.clientIdDescription")),S=h(p=>p?.trim()?!0:t("authentication.google.clientSecretDescription")),C=ne(()=>f==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-google":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-google",[f]),x=ie(l,J.WELLKNOWN_SERVICE_PATH_PREFIX,"oauth/callback/google");return D.useImperativeHandle(u,()=>({submit:g(b)}),[g,b]),e.jsx(a,{children:e.jsxs("form",{onSubmit:g(b),disabled:!0,children:[e.jsx(w,{title:t("authentication.viewDocument"),children:e.jsxs(a,{component:"a",href:C,target:"_blank",rel:"noopener noreferrer",sx:{verticalAlign:"middle",color:"inherit",fontSize:"14px","&:hover":{textDecoration:"underline"}},children:[C,e.jsx(a,{component:te,icon:Ie,sx:{marginLeft:"6px",verticalAlign:"middle",lineHeight:1,scale:1.1}})]})}),e.jsx(w,{title:t("authentication.oauthCallbackUrl"),children:e.jsxs(a,{sx:{mb:1,verticalAlign:"middle",fontSize:"14px",wordBreak:"break-all"},children:[x,e.jsx(me,{locale:f,content:x,style:{marginLeft:"6px",verticalAlign:"middle",scale:.8,lineHeight:1}})]})}),e.jsx(w,{title:t("authentication.google.clientId"),children:e.jsx(I,{name:"clientId",control:v,rules:{validate:T},render:({field:p})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...p,size:"small",label:t("authentication.google.clientId"),error:!!m.errors[p.name],helperText:m.errors[p.name]?.message||" "})})})}),e.jsx(w,{title:t("authentication.google.clientSecret"),children:e.jsx(I,{name:"clientSecret",control:v,rules:{validate:S},render:({field:p})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...p,size:"small",type:"password",label:t("authentication.google.clientSecret"),error:!!m.errors[p.name],helperText:m.errors[p.name]?.message||" "})})})})]})})}Je.propTypes={ref:k.any,onSuccess:k.func,sortMaps:k.object};const ve={teamId:"",serviceId:"",keyId:"",authKey:"",bundleId:""};function Ge({ref:u=null,onSuccess:d=O,sortMaps:c={}}){const{api:o}=_(),{blocklet:i}=z(),{t,locale:f}=M(),s=i?.meta?.did,j=Object.assign({...ve},i?.settings?.authentication?.apple||{}),l=(i.environments||[]).find(n=>n.key==="BLOCKLET_APP_URL")?.value||window.location.origin,{handleSubmit:g,control:v,formState:m,reset:y}=G({defaultValues:Y(j,Object.keys(ve))}),b=h(async n=>{try{const{blocklet:L}=await o.configAuthentication({input:{did:s,authentication:JSON.stringify({...c,apple:{...n,order:c.apple?.order??Object.keys(c).length,enabled:!0,type:"oauth"}})}}),R=Object.assign({...ve},L?.settings?.authentication?.apple||{});y(R),P.success(t("common.saveSuccess")),d()}catch(L){P.error(L.message||t("common.saveFailed"))}}),T=h(n=>n?.trim()?!0:t("authentication.apple.teamIdDescription")),S=h(n=>n?.trim()?!0:t("authentication.apple.serviceIdDescription")),C=h(n=>n?.trim()?!0:t("authentication.apple.keyIdDescription")),x=h(n=>n?.trim()?!0:t("authentication.apple.authKeyDescription")),p=h(n=>n?.trim()?!0:t("authentication.apple.bundleIdDescription")),r=ie(l,J.WELLKNOWN_SERVICE_PATH_PREFIX,"oauth/callback/apple");return D.useImperativeHandle(u,()=>({submit:g(b)}),[g,b]),e.jsx(a,{children:e.jsxs("form",{children:[e.jsx(w,{title:t("authentication.oauthCallbackUrl"),children:e.jsxs(a,{sx:{mb:1,verticalAlign:"middle",fontSize:"14px",wordBreak:"break-all"},children:[r,e.jsx(me,{locale:f,content:r,style:{marginLeft:"6px",verticalAlign:"middle",scale:.8,lineHeight:1}})]})}),e.jsx(w,{title:t("authentication.apple.teamId"),children:e.jsx(I,{name:"teamId",control:v,rules:{validate:T},render:({field:n})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...n,size:"small",label:t("authentication.apple.teamId"),error:!!m.errors[n.name],helperText:m.errors[n.name]?.message||" "})})})}),e.jsx(w,{title:t("authentication.apple.bundleId"),children:e.jsx(I,{name:"bundleId",control:v,rules:{validate:p},render:({field:n})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...n,size:"small",label:t("authentication.apple.bundleId"),error:!!m.errors[n.name],helperText:m.errors[n.name]?.message||" "})})})}),e.jsx(w,{title:t("authentication.apple.serviceId"),children:e.jsx(I,{name:"serviceId",control:v,rules:{validate:S},render:({field:n})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...n,size:"small",label:t("authentication.apple.serviceId"),error:!!m.errors[n.name],helperText:m.errors[n.name]?.message||" "})})})}),e.jsx(w,{title:t("authentication.apple.keyId"),children:e.jsx(I,{name:"keyId",control:v,rules:{validate:C},render:({field:n})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...n,size:"small",label:t("authentication.apple.keyId"),error:!!m.errors[n.name],helperText:m.errors[n.name]?.message||" "})})})}),e.jsx(w,{title:t("authentication.apple.authKey"),children:e.jsx(I,{name:"authKey",control:v,rules:{validate:x},render:({field:n})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...n,size:"small",type:"password",label:t("authentication.apple.authKey"),multiline:!0,rows:4,error:!!m.errors[n.name],helperText:m.errors[n.name]?.message||" ",slotProps:{input:{sx:{WebkitTextSecurity:"disc",fontFamily:"text-security-disc, monospace"}}}})})})})]})})}Ge.propTypes={ref:k.any,onSuccess:k.func,sortMaps:k.object};const ke={clientId:"",clientSecret:""};function Ze({ref:u=null,onSuccess:d=O,sortMaps:c={}}){const{api:o}=_(),{blocklet:i}=z(),{t,locale:f}=M(),s=i?.meta?.did,j=Object.assign({...ke},i?.settings?.authentication?.twitter||{}),l=(i.environments||[]).find(x=>x.key==="BLOCKLET_APP_URL")?.value||window.location.origin,{handleSubmit:g,control:v,formState:m,reset:y}=G({defaultValues:Y(j,Object.keys(ke))}),b=h(async x=>{try{const{blocklet:p}=await o.configAuthentication({input:{did:s,authentication:JSON.stringify({...c,twitter:{...x,order:c.twitter?.order??Object.keys(c).length,enabled:!0,type:"oauth"}})}}),r=Object.assign({...ke},p?.settings?.authentication?.twitter||{});y(r),P.success(t("common.saveSuccess")),d()}catch(p){P.error(p.message||t("common.saveFailed"))}}),T=h(x=>x?.trim()?!0:t("authentication.twitter.clientIdDescription")),S=h(x=>x?.trim()?!0:t("authentication.twitter.clientSecretDescription")),C=ie(l,J.WELLKNOWN_SERVICE_PATH_PREFIX,"oauth/callback/twitter");return D.useImperativeHandle(u,()=>({submit:g(b)}),[g,b]),e.jsx(a,{children:e.jsxs("form",{onSubmit:g(b),disabled:!0,children:[e.jsx(w,{title:t("authentication.oauthCallbackUrl"),children:e.jsxs(a,{sx:{mb:1,verticalAlign:"middle",fontSize:"14px",wordBreak:"break-all"},children:[C,e.jsx(me,{locale:f,content:C,style:{marginLeft:"6px",verticalAlign:"middle",scale:.8,lineHeight:1}})]})}),e.jsx(w,{title:t("authentication.twitter.clientId"),children:e.jsx(I,{name:"clientId",control:v,rules:{validate:T},render:({field:x})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...x,size:"small",label:t("authentication.twitter.clientId"),error:!!m.errors[x.name],helperText:m.errors[x.name]?.message||" "})})})}),e.jsx(w,{title:t("authentication.twitter.clientSecret"),children:e.jsx(I,{name:"clientSecret",control:v,rules:{validate:S},render:({field:x})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...x,size:"small",type:"password",label:t("authentication.twitter.clientSecret"),error:!!m.errors[x.name],helperText:m.errors[x.name]?.message||" "})})})})]})})}Ze.propTypes={ref:k.any,onSuccess:k.func,sortMaps:k.object};const Ct={width:24,height:24,body:'<path fill="currentColor" d="M9 20q-.825 0-1.413-.588T7 18q0-.825.588-1.413T9 16q.825 0 1.413.588T11 18q0 .825-.588 1.413T9 20Zm6 0q-.825 0-1.413-.588T13 18q0-.825.588-1.413T15 16q.825 0 1.413.588T17 18q0 .825-.588 1.413T15 20Zm-6-6q-.825 0-1.413-.588T7 12q0-.825.588-1.413T9 10q.825 0 1.413.588T11 12q0 .825-.588 1.413T9 14Zm6 0q-.825 0-1.413-.588T13 12q0-.825.588-1.413T15 10q.825 0 1.413.588T17 12q0 .825-.588 1.413T15 14ZM9 8q-.825 0-1.413-.588T7 6q0-.825.588-1.413T9 4q.825 0 1.413.588T11 6q0 .825-.588 1.413T9 8Zm6 0q-.825 0-1.413-.588T13 6q0-.825.588-1.413T15 4q.825 0 1.413.588T17 6q0 .825-.588 1.413T15 8Z"/>'};function Xe({id:u,title:d,index:c,onBegin:o=O,onMove:i,onEnd:t,onEditItem:f=O,onDeleteItem:s=O,disableDelete:j=!1,icon:l=null}){const g=D.useRef(null),v=D.useRef(null),[{handlerId:m},y]=nt({accept:"dragItem",collect(C){return{handlerId:C.getHandlerId()}},hover(C,x){if(!g.current)return;const p=C.index,r=c;if(p===r)return;const n=g.current?.getBoundingClientRect(),L=v.current?.getBoundingClientRect(),R=(L.bottom-L.top)/2,he=x.getClientOffset().y-n.top;p<r&&he<R||p>r&&he>R||(i(p,r),C.index=r)}}),[{isDragging:b},T]=it({item:{index:c,type:"dragItem"},collect:C=>({isDragging:C.isDragging()}),begin:o,end:t});T(v),y(g);const S=b?.3:1;return e.jsx(a,{ref:g,children:e.jsxs(a,{sx:{cursor:"pointer","&:hover":{backgroundColor:"grey.100"}},ref:v,"data-handler-id":m,children:[e.jsxs(a,{sx:{py:2,px:1,opacity:S,display:"flex",alignItems:"center",gap:.5},draggable:!1,children:[e.jsx(a,{sx:{pointerEvents:"auto",cursor:"grab","&:active":{cursor:"grabbing"},fontSize:0,color:"text.hint","&:hover":{color:"text.secondary"}},children:e.jsx(te,{fontSize:20,icon:Ct})}),e.jsx(a,{sx:{display:"flex",alignItems:"center",flexShrink:0,mr:.5,transform:"translateY(-1px)"},children:l}),e.jsx(oe,{sx:{flex:1},children:d}),e.jsx(ue,{size:"small",color:"primary",onClick:()=>{f(u)},children:e.jsx(te,{icon:kt})}),e.jsx(ue,{size:"small",color:"error",onClick:()=>{s(u)},disabled:j,children:e.jsx(te,{icon:yt})})]}),e.jsx(de,{})]})})}Xe.propTypes={title:k.string.isRequired,id:k.string.isRequired,index:k.number.isRequired,onBegin:k.func,onMove:k.func.isRequired,onEnd:k.func.isRequired,onEditItem:k.func,onDeleteItem:k.func,disableDelete:k.bool,icon:k.any};function Ye({ref:u=null,providers:d=[],sortMaps:c={}}){const o=D.useRef(null),{t:i}=D.useContext(Q),t=xe(),{control:f,watch:s,setValue:j,reset:l}=G({mode:"onChange",defaultValues:{provider:""}}),g=s("provider"),v=d.find(r=>r.name===g),m=lt(v),y=t?.transitions?.duration?.leavingScreen||300,b=ae({initMode:"add",mode:"add",show:!1,callback:O,get dialogTitle(){return this.mode==="edit"?i("authentication.updateLoginProvider",{provider:m.current?.title}):i("authentication.addLoginProvider")}}),T=h(()=>{l(),b.mode="add",b.initMode="add"}),S=h(()=>{b.show=!1,setTimeout(()=>{T()},y)}),C=h((r,n=null)=>{if(b.show=!0,n)b.initMode="edit",b.mode="edit",j("provider",n.provider);else{const L=d.find(R=>R.enabled===!1)?.name||d[0]?.name||B.WALLET;j("provider",L)}r?b.callback=r:b.callback=O});D.useImperativeHandle(u,()=>({open:C,close:S}),[C,S]);const x=h(()=>{o.current.submit()}),p=d.map(r=>({value:r.name,title:r.title,description:r.enabled?i("common.enabled"):""}));return D.useEffect(()=>{v?.enabled?b.mode="edit":b.mode="add"},[v?.enabled]),e.jsxs(pe,{open:b.show,title:b.dialogTitle,onClose:S,fullWidth:!0,maxWidth:"sm",PaperProps:{style:{minHeight:"unset"}},actions:e.jsx(W,{color:"primary",autoFocus:!0,variant:"contained",onClick:x,disabled:!g,children:b.mode==="add"?i("common.confirm"):i("common.update")}),children:[b.initMode==="edit"?null:e.jsx(I,{name:"provider",control:f,render:({field:r})=>e.jsx(wt,{required:!0,fullWidth:!0,margin:"dense",size:"small",label:i("authentication.chooseProvider"),placeholder:i("authentication.chooseProviderPlaceholder"),options:p,...ze(r,"ref"),slotProps:{optionItem:{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%"}}}})}),e.jsx(a,{sx:{mt:2,".section":{mb:1,gap:4},".section-left":{width:150}},children:v?.component&&e.jsx(v.component,{ref:o,onSuccess:S,sortMaps:c})})]})}Ye.propTypes={ref:k.any,providers:k.array,sortMaps:k.object};function Dt(){const{confirmApi:u,confirmHolder:d}=Ue(),c=D.useRef(),{t:o}=M(),{api:i}=_(),{blocklet:t}=z(),f=t?.meta?.did,s=t?.settings?.authentication||{},j=[{name:B.WALLET,title:$[B.WALLET],icon:e.jsx(Z,{provider:"wallet",sx:{width:20,height:20,scale:.9}}),component:Me},{name:B.EMAIL,title:$[B.EMAIL],icon:e.jsx(Z,{provider:"email",sx:{width:20,height:20,scale:.9}}),component:$e},{name:B.PASSKEY,title:$[B.PASSKEY],icon:e.jsx(Z,{provider:"passkey",sx:{width:20,height:20,scale:.9}}),component:Ke},{name:B.GOOGLE,title:$[B.GOOGLE],icon:e.jsx(Z,{provider:"google",sx:{width:20,height:20}}),component:Je},{name:B.APPLE,title:$[B.APPLE],icon:e.jsx(Z,{provider:"apple",sx:{width:20,height:20}}),component:Ge},{name:B.GITHUB,title:$[B.GITHUB],icon:e.jsx(Z,{provider:"github",sx:{width:20,height:20}}),component:Ve},{name:B.TWITTER,title:$[B.TWITTER],icon:e.jsx(Z,{provider:"twitter",sx:{width:20,height:20}}),component:Ze},{name:B.AUTH0,title:$[B.AUTH0],icon:e.jsx(Z,{provider:"auth0",sx:{width:20,height:20}}),component:He,hidden:!0}].map(r=>({...r,enabled:s[r.name]?.enabled??!1,order:s[r.name]?.order??null})),l=j.filter(r=>r.enabled),g=l.sort((r,n)=>!re(r?.order)&&!re(n?.order)?r.order-n.order:re(r?.order)?1:-1),v=g.reduce((r,n,L)=>Object.assign(r,{[n.name]:{order:L}}),{}),m=ae(g.reduce((r,n,L)=>Object.assign(r,{[n.name]:L}),{})),y=[...l].sort((r,n)=>m[r.name]-m[n.name]),b={};typeof window<"u"&&(b.context=window);const T=h((r,n)=>{const L=y[r],R=y[n];m[L.name]=n,m[R.name]=r}),S=h(async()=>{const r=Object.keys(m).reduce((n,L)=>(n[L]={order:m[L]},n),{});await i.configAuthentication({input:{did:f,authentication:JSON.stringify(r)}})}),C=()=>{c.current.open(()=>{c.current.close()})},x=h(r=>{c.current.open(O,{provider:r})}),p=h(r=>{u.open({title:o("authentication.deleteLoginProvider",{provider:$[r]}),content:o("authentication.deleteLoginProviderDescription",{provider:$[r]}),confirmButtonText:o("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:o("common.cancel"),async onConfirm(n){try{await i.configAuthentication({input:{did:f,authentication:JSON.stringify({[r]:{enabled:!1,order:null}})}}),delete m[r],P.success(o("common.deleteSuccess")),n()}catch(L){P.error(L.message||o("common.deleteFailed"))}}})});return e.jsxs(a,{children:[e.jsx(W,{variant:"contained",onClick:C,sx:{mb:1},children:o("authentication.addLoginProvider")}),e.jsx(ot,{backend:rt,...b,children:y.map((r,n)=>e.jsx(Xe,{index:n,id:r.name,title:r.title,icon:r.icon,onMove:T,onEnd:S,onEditItem:x,onDeleteItem:p,disableDelete:g.length<=1,children:r.component},r.name))}),e.jsx(Ye,{ref:c,providers:j,sortMaps:v}),d]})}const ee={ttl:J.SESSION_TTL,cacheTtl:J.SESSION_CACHE_TTL,email:{enabled:!1,requireVerified:!1,requireUnique:!1,trustOauthProviders:!1,trustedIssuers:[],enableDomainBlackList:!1,domainBlackList:[],enableDomainWhiteList:!1,domainWhiteList:[]},phone:{enabled:!1,requireVerified:!1,requireUnique:!1,regionBlackList:[],trustedIssuers:[]},enableBlacklist:!1};function V(u){return e.jsx(Ne,{...u,sx:{transform:"scale(0.75)"}})}function ye(u,d=!1){const c=d?u.ttl*86400:u.ttl/86400;return{...u,ttl:c}}function Pt(){const{api:u}=_(),{blocklet:d}=z(),c=d?.meta?.did,o=_e({},ee,d?.settings?.session||{});re(o.ttl)&&(o.ttl=ee.ttl),re(o.cacheTtl)&&(o.cacheTtl=ee.cacheTtl),o.phone||(o.phone=ee.phone),o.email||(o.email=ee.email),re(o.enableBlacklist)&&(o.enableBlacklist=ee.enableBlacklist);const{handleSubmit:i,control:t,formState:f,reset:s,watch:j}=G({defaultValues:Y(ye(o),["ttl","cacheTtl","email","phone","enableBlacklist"])}),{t:l}=M(),g=j("email.enabled"),v=j("phone.enabled"),m=j("email.enableDomainBlackList"),y=j("email.enableDomainWhiteList"),{fields:b,append:T,remove:S}=Fe({control:t,name:"email.domainBlackList"}),{fields:C,append:x,remove:p}=Fe({control:t,name:"email.domainWhiteList"}),r=h(async n=>{try{const{blocklet:L}=await u.updateAppSessionConfig({input:{did:c,config:ze(ye(n,!0),["phone"])}}),R=Object.assign({},ee,Y(L?.settings?.session||{},["ttl","cacheTtl","email","phone","enableBlacklist"]));s(ye(R)),P.success(l("common.configSuccess"))}catch(L){P.error(L.message)}});return e.jsx(At,{onSubmit:i(r),children:e.jsxs(H,{direction:"column",sx:{gap:6},children:[e.jsxs(a,{children:[e.jsxs(a,{children:[e.jsx(oe,{variant:"h6",sx:{fontWeight:600},children:l("blocklet.config.session.profile")}),e.jsx(a,{component:de,sx:{my:3}})]}),e.jsxs(H,{sx:{gap:2},children:[e.jsx(w,{title:l("blocklet.config.session.fullNameEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(V,{disabled:!0,checked:!0})})}),e.jsx(w,{title:l("blocklet.config.session.avatarEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(V,{disabled:!0,checked:!0})})}),e.jsx(w,{title:l("blocklet.config.session.emailEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.enabled",control:t,render:({field:n})=>e.jsx(V,{...n,checked:n.value})})})}),g&&e.jsxs(H,{direction:"column",sx:{ml:2,gap:.5},children:[e.jsx(w,{title:l("blocklet.config.session.emailRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.requireVerified",control:t,render:({field:n})=>e.jsx(K,{sx:{ml:0},control:e.jsx(V,{...n,checked:n.value})})})})}),e.jsx(w,{title:l("blocklet.config.session.emailRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.requireUnique",control:t,render:({field:n})=>e.jsx(K,{sx:{ml:0},control:e.jsx(V,{...n,checked:n.value})})})})}),e.jsx(w,{title:l("blocklet.config.session.emailTrustOauthProviders"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.trustOauthProviders",control:t,render:({field:n})=>e.jsx(K,{sx:{ml:0},control:e.jsx(V,{...n,checked:n.value})})})})}),e.jsx(w,{title:l("blocklet.config.session.enableDomainBlackList"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.enableDomainBlackList",control:t,render:({field:n})=>e.jsx(K,{sx:{ml:0},control:e.jsx(V,{...n,checked:n.value})})})})}),m&&e.jsxs(a,{children:[b.map((n,L)=>e.jsxs(H,{direction:"row",sx:{alignItems:"center",my:1,maxWidth:"720px"},children:[e.jsx(I,{name:`email.domainBlackList.${L}`,control:t,render:R=>e.jsx(E,{...R.field,size:"small",fullWidth:!0})}),e.jsx(ue,{onClick:()=>S(L),children:e.jsx(Pe,{})})]},n.id)),e.jsx(X,{startIcon:e.jsx(Ae,{}),onClick:()=>T(""),children:l("blocklet.config.session.addDomain")})]}),e.jsx(w,{title:l("blocklet.config.session.enableDomainWhiteList"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.enableDomainWhiteList",control:t,render:({field:n})=>e.jsx(K,{sx:{ml:0},control:e.jsx(V,{...n,checked:n.value})})})})}),y&&e.jsxs(a,{children:[C.map((n,L)=>e.jsxs(H,{direction:"row",sx:{alignItems:"center",my:1,maxWidth:"720px"},children:[e.jsx(I,{name:`email.domainWhiteList.${L}`,control:t,render:R=>e.jsx(E,{...R.field,size:"small",fullWidth:!0})}),e.jsx(ue,{onClick:()=>p(L),children:e.jsx(Pe,{})})]},n.id)),e.jsx(X,{startIcon:e.jsx(Ae,{}),onClick:()=>x(""),children:l("blocklet.config.session.addDomain")})]})]}),e.jsxs(a,{sx:{display:"none"},children:[e.jsx(w,{title:l("blocklet.config.session.phoneEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"phone.enabled",control:t,disabled:!0,render:({field:n})=>e.jsx(K,{sx:{ml:0},control:e.jsx(V,{...n,checked:n.value})})})})}),v&&e.jsxs(H,{direction:"column",sx:{ml:2,mt:1},children:[e.jsx(w,{title:l("blocklet.config.session.phoneRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"phone.requireVerified",control:t,render:({field:n})=>e.jsx(K,{sx:{ml:0},control:e.jsx(V,{...n,checked:n.value})})})})}),e.jsx(w,{title:l("blocklet.config.session.phoneRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"phone.requireUnique",control:t,render:({field:n})=>e.jsx(K,{sx:{ml:0},control:e.jsx(V,{...n,checked:n.value})})})})})]})]})]})]}),e.jsxs(a,{children:[e.jsx(oe,{variant:"h6",sx:{fontWeight:600},children:l("blocklet.config.session.period")}),e.jsx(a,{component:de,sx:{my:3}}),e.jsx(H,{direction:"column",spacing:2,children:e.jsx(I,{name:"ttl",control:t,rules:{min:1,max:30},render:({field:n})=>e.jsx(U,{fullWidth:!0,sx:{mb:2},children:e.jsx(w,{title:l("blocklet.config.session.ttl",{day:n.value}),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{width:"100%",maxWidth:500,px:2},children:e.jsx(ut,{...n,defaultValue:7,step:1,marks:[{value:1,label:l("blocklet.config.session.day",{day:1})},{value:7,label:l("blocklet.config.session.days",{day:7})},{value:14,label:l("blocklet.config.session.days",{day:14})},{value:21,label:l("blocklet.config.session.days",{day:21})},{value:30,label:l("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto"})})})})})})]}),e.jsxs(a,{children:[e.jsx(oe,{variant:"h6",sx:{fontWeight:600},children:l("blocklet.config.session.experimentalSettings")}),e.jsx(a,{component:de,sx:{my:3}}),e.jsx(H,{direction:"column",spacing:2,children:e.jsx(w,{title:l("blocklet.config.session.enableBlacklist"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"enableBlacklist",control:t,render:({field:n})=>e.jsx(K,{sx:{ml:0},control:e.jsx(V,{...n,checked:n.value})})})})})})]}),e.jsx(a,{children:e.jsx(X,{type:"submit",variant:"contained",disabled:!f.isDirty,children:l("common.save")})})]})})}const At=Ee.form`
1
+ import{V as M,H as P,z as te,b9 as me,cB as nt,cC as it,aT as Q,aj as B,aK as pe,w as W,W as $,cD as ot,cE as rt,aV as Se,cF as at,aO as st,aW as De}from"./vendor-ux-7TwTLXf8.js";import{b as h,a as ne,f as lt,g as ae,c as ct}from"./vendor-hooks-qxhUUbW5.js";import{r as D,L as dt}from"./vendor-react-CTtPmzVP.js";import{j as e,ak as a,y as U,z as E,W as k,bX as K,Q as X,T as oe,I as ue,a3 as de,D as xe,b6 as H,cu as Pe,bi as Ae,d_ as ut,at as Ee,ah as Re,d$ as We,a6 as Le,am as mt,e0 as ht,bb as pt}from"./vendor-mui-core-DnR6WYuU.js";import{Z as _,Y as z,c as J,cn as Ie,aD as Ue,am as Z,bC as xt,J as ft,h as gt}from"./index-CGOBEhzW.js";import{A as Y,n as O,C as ie,I as ze,b as re,_ as _e,az as bt,a as jt}from"./vendor-utils-CxWN1dT3.js";import{u as G,C as I,a as Fe}from"./index.esm-Co8ZxFyk.js";import{S as w}from"./section-jXB9AxBb.js";import{S as vt}from"./switch-control-CioN_5qg.js";import{d as kt,a as yt}from"./edit-rounded-CnMn6J-D.js";import{S as wt}from"./simple-select-6nihrL7w.js";import{u as Ne}from"./index-_haoumSc.js";import{v as St}from"./index-CiKhg0ut.js";import{r as Lt}from"./base32-BccrNIeO.js";import{C as It}from"./click-to-copy-fgcvdv-u.js";import{u as Tt}from"./use-mobile-BINJTzMb.js";import"./lottie-web-4koyQiv_.js";import"./vendor-arcblock-Dr30TSIK.js";import"./required-BQln5OcV.js";import"./arrow-down.svg-C4FUKwt4.js";const fe={domain:"",clientId:"",clientSecret:""};function He({ref:u=null,onSuccess:d=O,sortMaps:c={}}){const{api:o}=_(),{blocklet:i}=z(),{t,locale:f}=M(),s=i?.meta?.did,j=Object.assign({...fe},i?.settings?.authentication?.auth0||{}),l=(i.environments||[]).find(r=>r.key==="BLOCKLET_APP_URL")?.value||window.location.origin,{handleSubmit:g,control:v,formState:m,reset:y}=G({defaultValues:Y(j,Object.keys(fe))}),b=h(async r=>{try{const{blocklet:n}=await o.configAuthentication({input:{did:s,authentication:JSON.stringify({...c,auth0:{...r,order:c.auth0?.order??Object.keys(c).length,enabled:!0,type:"oauth"}})}}),L=Object.assign({...fe},n?.settings?.authentication?.auth0||{});y(L),P.success(t("common.saveSuccess")),d()}catch(n){P.error(n.message||t("common.saveFailed"))}}),T=h(r=>r?.trim()?!0:t("authentication.auth0.domainDescription")),S=h(r=>r?.trim()?!0:t("authentication.auth0.clientIdDescription")),C=h(r=>r?.trim()?!0:t("authentication.auth0.clientSecretDescription")),x=ne(()=>f==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-auth0":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-auth0",[f]),p=ie(l,J.WELLKNOWN_SERVICE_PATH_PREFIX,"oauth/callback/auth0");return D.useImperativeHandle(u,()=>({submit:g(b)}),[g,b]),e.jsx(a,{children:e.jsxs("form",{onSubmit:g(b),disabled:!0,children:[e.jsx(w,{title:t("authentication.viewDocument"),children:e.jsxs(a,{component:"a",href:x,target:"_blank",rel:"noopener noreferrer",sx:{verticalAlign:"middle",color:"inherit",fontSize:"14px","&:hover":{textDecoration:"underline"}},children:[x,e.jsx(a,{component:te,icon:Ie,sx:{marginLeft:"6px",verticalAlign:"middle",lineHeight:1,scale:1.1}})]})}),e.jsx(w,{title:t("authentication.oauthCallbackUrl"),children:e.jsxs(a,{sx:{mb:1,verticalAlign:"middle",fontSize:"14px",wordBreak:"break-all"},children:[p,e.jsx(me,{locale:f,content:p,style:{marginLeft:"6px",verticalAlign:"middle",scale:.8,lineHeight:1}})]})}),e.jsx(w,{title:t("authentication.auth0.domain"),children:e.jsx(I,{name:"domain",control:v,rules:{validate:T},render:({field:r})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...r,size:"small",label:t("authentication.auth0.domain"),error:!!m.errors[r.name],helperText:m.errors[r.name]?.message||" "})})})}),e.jsx(w,{title:t("authentication.auth0.clientId"),children:e.jsx(I,{name:"clientId",control:v,rules:{validate:S},render:({field:r})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...r,size:"small",label:t("authentication.auth0.clientId"),error:!!m.errors[r.name],helperText:m.errors[r.name]?.message||" "})})})}),e.jsx(w,{title:t("authentication.auth0.clientSecret"),children:e.jsx(I,{name:"clientSecret",control:v,rules:{validate:C},render:({field:r})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...r,size:"small",type:"password",label:t("authentication.auth0.clientSecret"),error:!!m.errors[r.name],helperText:m.errors[r.name]?.message||" "})})})})]})})}He.propTypes={ref:k.any,onSuccess:k.func,sortMaps:k.object};const ge={clientId:"",clientSecret:""};function Ve({ref:u=null,onSuccess:d=O,sortMaps:c={}}){const{api:o}=_(),{blocklet:i}=z(),{t,locale:f}=M(),s=i?.meta?.did,j=Object.assign({...ge},i?.settings?.authentication?.github||{}),l=(i.environments||[]).find(p=>p.key==="BLOCKLET_APP_URL")?.value||window.location.origin,{handleSubmit:g,control:v,formState:m,reset:y}=G({defaultValues:Y(j,Object.keys(ge))}),b=h(async p=>{try{const{blocklet:r}=await o.configAuthentication({input:{did:s,authentication:JSON.stringify({...c,github:{...p,order:c.github?.order??Object.keys(c).length,enabled:!0,type:"oauth"}})}}),n=Object.assign({...ge},r?.settings?.authentication?.github||{});y(n),P.success(t("common.saveSuccess")),d()}catch(r){P.error(r.message||t("common.saveFailed"))}}),T=h(p=>p?.trim()?!0:t("authentication.github.clientIdDescription")),S=h(p=>p?.trim()?!0:t("authentication.github.clientSecretDescription")),C=ne(()=>f==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-github":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-github",[f]),x=ie(l,J.WELLKNOWN_SERVICE_PATH_PREFIX,"oauth/callback/github");return D.useImperativeHandle(u,()=>({submit:g(b)}),[g,b]),e.jsx(a,{children:e.jsxs("form",{disabled:!0,children:[e.jsx(w,{title:t("authentication.viewDocument"),children:e.jsxs(a,{component:"a",href:C,target:"_blank",rel:"noopener noreferrer",sx:{verticalAlign:"middle",color:"inherit",fontSize:"14px","&:hover":{textDecoration:"underline"}},children:[C,e.jsx(a,{component:te,icon:Ie,sx:{marginLeft:"6px",verticalAlign:"middle",lineHeight:1,scale:1.1}})]})}),e.jsx(w,{title:t("authentication.oauthCallbackUrl"),children:e.jsxs(a,{sx:{mb:1,verticalAlign:"middle",fontSize:"14px",wordBreak:"break-all"},children:[x,e.jsx(me,{locale:f,content:x,style:{marginLeft:"6px",verticalAlign:"middle",scale:.8,lineHeight:1}})]})}),e.jsx(w,{title:t("authentication.github.clientId"),children:e.jsx(I,{name:"clientId",control:v,rules:{validate:T},render:({field:p})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...p,size:"small",label:t("authentication.github.clientId"),error:!!m.errors[p.name],helperText:m.errors[p.name]?.message||" "})})})}),e.jsx(w,{title:t("authentication.github.clientSecret"),children:e.jsx(I,{name:"clientSecret",control:v,rules:{validate:S},render:({field:p})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...p,size:"small",type:"password",label:t("authentication.github.clientSecret"),error:!!m.errors[p.name],helperText:m.errors[p.name]?.message||" "})})})})]})})}Ve.propTypes={ref:k.any,onSuccess:k.func,sortMaps:k.object};const be={showQrcode:!0};function Me({ref:u=null,onSuccess:d=O,sortMaps:c={}}){const{api:o}=_(),{blocklet:i}=z(),{t}=M(),f=i?.meta?.did,s=Object.assign({...be},i?.settings?.authentication?.wallet||{}),{handleSubmit:j,control:l,reset:g}=G({defaultValues:Y(s,Object.keys(be))}),v=h(async m=>{try{const{blocklet:y}=await o.configAuthentication({input:{did:f,authentication:JSON.stringify({...c,wallet:{...m,order:c.wallet?.order??Object.keys(c).length,enabled:!0,type:"builtin"}})}}),b=Object.assign({...be},y?.settings?.authentication?.wallet||{});g(b),P.success(t("common.saveSuccess")),d()}catch(y){P.error(y.message||t("common.saveFailed"))}});return D.useImperativeHandle(u,()=>({submit:j(v)}),[j,v]),e.jsx(a,{children:e.jsx("form",{children:e.jsx(w,{title:t("authentication.wallet.showQrcode"),children:e.jsx(I,{name:"showQrcode",control:l,render:({field:m})=>e.jsx(K,{control:e.jsx(vt,{sx:{ml:1},checked:m.value,...m})})})})})})}Me.propTypes={ref:k.any,onSuccess:k.func,sortMaps:k.object};function $e({ref:u=null,onSuccess:d=O,sortMaps:c={}}){const{api:o}=_(),{blocklet:i}=z(),{t}=M(),f=i?.meta?.did,s=h(async()=>{try{await o.configAuthentication({input:{did:f,authentication:JSON.stringify({...c,email:{order:c.email?.order??Object.keys(c).length,enabled:!0,type:"builtin"}})}}),P.success(t("common.saveSuccess")),d()}catch(j){P.error(j.message||t("common.saveFailed"))}});return D.useImperativeHandle(u,()=>({submit:s}),[s]),e.jsxs(a,{children:[t("authentication.emailLoginDescription"),e.jsx("br",{}),t("authentication.emailNotificationRequired"),e.jsx("br",{}),e.jsx(a,{component:dt,to:ie(J.WELLKNOWN_BLOCKLET_ADMIN_PATH,"/notification/settings"),sx:{mt:1,display:"inline-block"},children:e.jsx(X,{size:"small",variant:"outlined",children:t("authentication.gotoEmailNotification")})})]})}$e.propTypes={ref:k.any,onSuccess:k.func,sortMaps:k.object};function Ke({ref:u=null,onSuccess:d=O,sortMaps:c={}}){const{api:o}=_(),{blocklet:i}=z(),{t}=M(),f=i?.meta?.did,s=h(async()=>{try{await o.configAuthentication({input:{did:f,authentication:JSON.stringify({...c,passkey:{order:c.passkey?.order??Object.keys(c).length,enabled:!0,type:"builtin"}})}}),P.success(t("common.saveSuccess")),d()}catch(j){P.error(j.message||t("common.saveFailed"))}});return D.useImperativeHandle(u,()=>({submit:s}),[s]),null}Ke.propTypes={ref:k.any,onSuccess:k.func,sortMaps:k.object};const je={clientId:"",clientSecret:""};function Je({ref:u=null,onSuccess:d=O,sortMaps:c={}}){const{api:o}=_(),{blocklet:i}=z(),{t,locale:f}=M(),s=i?.meta?.did,j=Object.assign({...je},i?.settings?.authentication?.google||{}),l=(i.environments||[]).find(p=>p.key==="BLOCKLET_APP_URL")?.value||window.location.origin,{handleSubmit:g,control:v,formState:m,reset:y}=G({defaultValues:Y(j,Object.keys(je))}),b=h(async p=>{try{const{blocklet:r}=await o.configAuthentication({input:{did:s,authentication:JSON.stringify({...c,google:{...p,order:c.google?.order??Object.keys(c).length,enabled:!0,type:"oauth"}})}}),n=Object.assign({...je},r?.settings?.authentication?.google||{});y(n),P.success(t("common.saveSuccess")),d()}catch(r){P.error(r.message||t("common.saveFailed"))}}),T=h(p=>p?.trim()?!0:t("authentication.google.clientIdDescription")),S=h(p=>p?.trim()?!0:t("authentication.google.clientSecretDescription")),C=ne(()=>f==="zh"?"https://www.arcblock.io/blog/docs/did-connect/zh/oauth-config-google":"https://www.arcblock.io/blog/docs/did-connect/en/oauth-config-google",[f]),x=ie(l,J.WELLKNOWN_SERVICE_PATH_PREFIX,"oauth/callback/google");return D.useImperativeHandle(u,()=>({submit:g(b)}),[g,b]),e.jsx(a,{children:e.jsxs("form",{onSubmit:g(b),disabled:!0,children:[e.jsx(w,{title:t("authentication.viewDocument"),children:e.jsxs(a,{component:"a",href:C,target:"_blank",rel:"noopener noreferrer",sx:{verticalAlign:"middle",color:"inherit",fontSize:"14px","&:hover":{textDecoration:"underline"}},children:[C,e.jsx(a,{component:te,icon:Ie,sx:{marginLeft:"6px",verticalAlign:"middle",lineHeight:1,scale:1.1}})]})}),e.jsx(w,{title:t("authentication.oauthCallbackUrl"),children:e.jsxs(a,{sx:{mb:1,verticalAlign:"middle",fontSize:"14px",wordBreak:"break-all"},children:[x,e.jsx(me,{locale:f,content:x,style:{marginLeft:"6px",verticalAlign:"middle",scale:.8,lineHeight:1}})]})}),e.jsx(w,{title:t("authentication.google.clientId"),children:e.jsx(I,{name:"clientId",control:v,rules:{validate:T},render:({field:p})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...p,size:"small",label:t("authentication.google.clientId"),error:!!m.errors[p.name],helperText:m.errors[p.name]?.message||" "})})})}),e.jsx(w,{title:t("authentication.google.clientSecret"),children:e.jsx(I,{name:"clientSecret",control:v,rules:{validate:S},render:({field:p})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...p,size:"small",type:"password",label:t("authentication.google.clientSecret"),error:!!m.errors[p.name],helperText:m.errors[p.name]?.message||" "})})})})]})})}Je.propTypes={ref:k.any,onSuccess:k.func,sortMaps:k.object};const ve={teamId:"",serviceId:"",keyId:"",authKey:"",bundleId:""};function Ge({ref:u=null,onSuccess:d=O,sortMaps:c={}}){const{api:o}=_(),{blocklet:i}=z(),{t,locale:f}=M(),s=i?.meta?.did,j=Object.assign({...ve},i?.settings?.authentication?.apple||{}),l=(i.environments||[]).find(n=>n.key==="BLOCKLET_APP_URL")?.value||window.location.origin,{handleSubmit:g,control:v,formState:m,reset:y}=G({defaultValues:Y(j,Object.keys(ve))}),b=h(async n=>{try{const{blocklet:L}=await o.configAuthentication({input:{did:s,authentication:JSON.stringify({...c,apple:{...n,order:c.apple?.order??Object.keys(c).length,enabled:!0,type:"oauth"}})}}),R=Object.assign({...ve},L?.settings?.authentication?.apple||{});y(R),P.success(t("common.saveSuccess")),d()}catch(L){P.error(L.message||t("common.saveFailed"))}}),T=h(n=>n?.trim()?!0:t("authentication.apple.teamIdDescription")),S=h(n=>n?.trim()?!0:t("authentication.apple.serviceIdDescription")),C=h(n=>n?.trim()?!0:t("authentication.apple.keyIdDescription")),x=h(n=>n?.trim()?!0:t("authentication.apple.authKeyDescription")),p=h(n=>n?.trim()?!0:t("authentication.apple.bundleIdDescription")),r=ie(l,J.WELLKNOWN_SERVICE_PATH_PREFIX,"oauth/callback/apple");return D.useImperativeHandle(u,()=>({submit:g(b)}),[g,b]),e.jsx(a,{children:e.jsxs("form",{children:[e.jsx(w,{title:t("authentication.oauthCallbackUrl"),children:e.jsxs(a,{sx:{mb:1,verticalAlign:"middle",fontSize:"14px",wordBreak:"break-all"},children:[r,e.jsx(me,{locale:f,content:r,style:{marginLeft:"6px",verticalAlign:"middle",scale:.8,lineHeight:1}})]})}),e.jsx(w,{title:t("authentication.apple.teamId"),children:e.jsx(I,{name:"teamId",control:v,rules:{validate:T},render:({field:n})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...n,size:"small",label:t("authentication.apple.teamId"),error:!!m.errors[n.name],helperText:m.errors[n.name]?.message||" "})})})}),e.jsx(w,{title:t("authentication.apple.bundleId"),children:e.jsx(I,{name:"bundleId",control:v,rules:{validate:p},render:({field:n})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...n,size:"small",label:t("authentication.apple.bundleId"),error:!!m.errors[n.name],helperText:m.errors[n.name]?.message||" "})})})}),e.jsx(w,{title:t("authentication.apple.serviceId"),children:e.jsx(I,{name:"serviceId",control:v,rules:{validate:S},render:({field:n})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...n,size:"small",label:t("authentication.apple.serviceId"),error:!!m.errors[n.name],helperText:m.errors[n.name]?.message||" "})})})}),e.jsx(w,{title:t("authentication.apple.keyId"),children:e.jsx(I,{name:"keyId",control:v,rules:{validate:C},render:({field:n})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...n,size:"small",label:t("authentication.apple.keyId"),error:!!m.errors[n.name],helperText:m.errors[n.name]?.message||" "})})})}),e.jsx(w,{title:t("authentication.apple.authKey"),children:e.jsx(I,{name:"authKey",control:v,rules:{validate:x},render:({field:n})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...n,size:"small",type:"password",label:t("authentication.apple.authKey"),multiline:!0,rows:4,error:!!m.errors[n.name],helperText:m.errors[n.name]?.message||" ",slotProps:{input:{sx:{WebkitTextSecurity:"disc",fontFamily:"text-security-disc, monospace"}}}})})})})]})})}Ge.propTypes={ref:k.any,onSuccess:k.func,sortMaps:k.object};const ke={clientId:"",clientSecret:""};function Ze({ref:u=null,onSuccess:d=O,sortMaps:c={}}){const{api:o}=_(),{blocklet:i}=z(),{t,locale:f}=M(),s=i?.meta?.did,j=Object.assign({...ke},i?.settings?.authentication?.twitter||{}),l=(i.environments||[]).find(x=>x.key==="BLOCKLET_APP_URL")?.value||window.location.origin,{handleSubmit:g,control:v,formState:m,reset:y}=G({defaultValues:Y(j,Object.keys(ke))}),b=h(async x=>{try{const{blocklet:p}=await o.configAuthentication({input:{did:s,authentication:JSON.stringify({...c,twitter:{...x,order:c.twitter?.order??Object.keys(c).length,enabled:!0,type:"oauth"}})}}),r=Object.assign({...ke},p?.settings?.authentication?.twitter||{});y(r),P.success(t("common.saveSuccess")),d()}catch(p){P.error(p.message||t("common.saveFailed"))}}),T=h(x=>x?.trim()?!0:t("authentication.twitter.clientIdDescription")),S=h(x=>x?.trim()?!0:t("authentication.twitter.clientSecretDescription")),C=ie(l,J.WELLKNOWN_SERVICE_PATH_PREFIX,"oauth/callback/twitter");return D.useImperativeHandle(u,()=>({submit:g(b)}),[g,b]),e.jsx(a,{children:e.jsxs("form",{onSubmit:g(b),disabled:!0,children:[e.jsx(w,{title:t("authentication.oauthCallbackUrl"),children:e.jsxs(a,{sx:{mb:1,verticalAlign:"middle",fontSize:"14px",wordBreak:"break-all"},children:[C,e.jsx(me,{locale:f,content:C,style:{marginLeft:"6px",verticalAlign:"middle",scale:.8,lineHeight:1}})]})}),e.jsx(w,{title:t("authentication.twitter.clientId"),children:e.jsx(I,{name:"clientId",control:v,rules:{validate:T},render:({field:x})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...x,size:"small",label:t("authentication.twitter.clientId"),error:!!m.errors[x.name],helperText:m.errors[x.name]?.message||" "})})})}),e.jsx(w,{title:t("authentication.twitter.clientSecret"),children:e.jsx(I,{name:"clientSecret",control:v,rules:{validate:S},render:({field:x})=>e.jsx(U,{fullWidth:!0,children:e.jsx(E,{...x,size:"small",type:"password",label:t("authentication.twitter.clientSecret"),error:!!m.errors[x.name],helperText:m.errors[x.name]?.message||" "})})})})]})})}Ze.propTypes={ref:k.any,onSuccess:k.func,sortMaps:k.object};const Ct={width:24,height:24,body:'<path fill="currentColor" d="M9 20q-.825 0-1.413-.588T7 18q0-.825.588-1.413T9 16q.825 0 1.413.588T11 18q0 .825-.588 1.413T9 20Zm6 0q-.825 0-1.413-.588T13 18q0-.825.588-1.413T15 16q.825 0 1.413.588T17 18q0 .825-.588 1.413T15 20Zm-6-6q-.825 0-1.413-.588T7 12q0-.825.588-1.413T9 10q.825 0 1.413.588T11 12q0 .825-.588 1.413T9 14Zm6 0q-.825 0-1.413-.588T13 12q0-.825.588-1.413T15 10q.825 0 1.413.588T17 12q0 .825-.588 1.413T15 14ZM9 8q-.825 0-1.413-.588T7 6q0-.825.588-1.413T9 4q.825 0 1.413.588T11 6q0 .825-.588 1.413T9 8Zm6 0q-.825 0-1.413-.588T13 6q0-.825.588-1.413T15 4q.825 0 1.413.588T17 6q0 .825-.588 1.413T15 8Z"/>'};function Xe({id:u,title:d,index:c,onBegin:o=O,onMove:i,onEnd:t,onEditItem:f=O,onDeleteItem:s=O,disableDelete:j=!1,icon:l=null}){const g=D.useRef(null),v=D.useRef(null),[{handlerId:m},y]=nt({accept:"dragItem",collect(C){return{handlerId:C.getHandlerId()}},hover(C,x){if(!g.current)return;const p=C.index,r=c;if(p===r)return;const n=g.current?.getBoundingClientRect(),L=v.current?.getBoundingClientRect(),R=(L.bottom-L.top)/2,he=x.getClientOffset().y-n.top;p<r&&he<R||p>r&&he>R||(i(p,r),C.index=r)}}),[{isDragging:b},T]=it({item:{index:c,type:"dragItem"},collect:C=>({isDragging:C.isDragging()}),begin:o,end:t});T(v),y(g);const S=b?.3:1;return e.jsx(a,{ref:g,children:e.jsxs(a,{sx:{cursor:"pointer","&:hover":{backgroundColor:"grey.100"}},ref:v,"data-handler-id":m,children:[e.jsxs(a,{sx:{py:2,px:1,opacity:S,display:"flex",alignItems:"center",gap:.5},draggable:!1,children:[e.jsx(a,{sx:{pointerEvents:"auto",cursor:"grab","&:active":{cursor:"grabbing"},fontSize:0,color:"text.hint","&:hover":{color:"text.secondary"}},children:e.jsx(te,{fontSize:20,icon:Ct})}),e.jsx(a,{sx:{display:"flex",alignItems:"center",flexShrink:0,mr:.5,transform:"translateY(-1px)"},children:l}),e.jsx(oe,{sx:{flex:1},children:d}),e.jsx(ue,{size:"small",color:"primary",onClick:()=>{f(u)},children:e.jsx(te,{icon:kt})}),e.jsx(ue,{size:"small",color:"error",onClick:()=>{s(u)},disabled:j,children:e.jsx(te,{icon:yt})})]}),e.jsx(de,{})]})})}Xe.propTypes={title:k.string.isRequired,id:k.string.isRequired,index:k.number.isRequired,onBegin:k.func,onMove:k.func.isRequired,onEnd:k.func.isRequired,onEditItem:k.func,onDeleteItem:k.func,disableDelete:k.bool,icon:k.any};function Ye({ref:u=null,providers:d=[],sortMaps:c={}}){const o=D.useRef(null),{t:i}=D.useContext(Q),t=xe(),{control:f,watch:s,setValue:j,reset:l}=G({mode:"onChange",defaultValues:{provider:""}}),g=s("provider"),v=d.find(r=>r.name===g),m=lt(v),y=t?.transitions?.duration?.leavingScreen||300,b=ae({initMode:"add",mode:"add",show:!1,callback:O,get dialogTitle(){return this.mode==="edit"?i("authentication.updateLoginProvider",{provider:m.current?.title}):i("authentication.addLoginProvider")}}),T=h(()=>{l(),b.mode="add",b.initMode="add"}),S=h(()=>{b.show=!1,setTimeout(()=>{T()},y)}),C=h((r,n=null)=>{if(b.show=!0,n)b.initMode="edit",b.mode="edit",j("provider",n.provider);else{const L=d.find(R=>R.enabled===!1)?.name||d[0]?.name||B.WALLET;j("provider",L)}r?b.callback=r:b.callback=O});D.useImperativeHandle(u,()=>({open:C,close:S}),[C,S]);const x=h(()=>{o.current.submit()}),p=d.map(r=>({value:r.name,title:r.title,description:r.enabled?i("common.enabled"):""}));return D.useEffect(()=>{v?.enabled?b.mode="edit":b.mode="add"},[v?.enabled]),e.jsxs(pe,{open:b.show,title:b.dialogTitle,onClose:S,fullWidth:!0,maxWidth:"sm",PaperProps:{style:{minHeight:"unset"}},actions:e.jsx(W,{color:"primary",autoFocus:!0,variant:"contained",onClick:x,disabled:!g,children:b.mode==="add"?i("common.confirm"):i("common.update")}),children:[b.initMode==="edit"?null:e.jsx(I,{name:"provider",control:f,render:({field:r})=>e.jsx(wt,{required:!0,fullWidth:!0,margin:"dense",size:"small",label:i("authentication.chooseProvider"),placeholder:i("authentication.chooseProviderPlaceholder"),options:p,...ze(r,"ref"),slotProps:{optionItem:{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%"}}}})}),e.jsx(a,{sx:{mt:2,".section":{mb:1,gap:4},".section-left":{width:150}},children:v?.component&&e.jsx(v.component,{ref:o,onSuccess:S,sortMaps:c})})]})}Ye.propTypes={ref:k.any,providers:k.array,sortMaps:k.object};function Dt(){const{confirmApi:u,confirmHolder:d}=Ue(),c=D.useRef(),{t:o}=M(),{api:i}=_(),{blocklet:t}=z(),f=t?.meta?.did,s=t?.settings?.authentication||{},j=[{name:B.WALLET,title:$[B.WALLET],icon:e.jsx(Z,{provider:"wallet",sx:{width:20,height:20,scale:.9}}),component:Me},{name:B.EMAIL,title:$[B.EMAIL],icon:e.jsx(Z,{provider:"email",sx:{width:20,height:20,scale:.9}}),component:$e},{name:B.PASSKEY,title:$[B.PASSKEY],icon:e.jsx(Z,{provider:"passkey",sx:{width:20,height:20,scale:.9}}),component:Ke},{name:B.GOOGLE,title:$[B.GOOGLE],icon:e.jsx(Z,{provider:"google",sx:{width:20,height:20}}),component:Je},{name:B.APPLE,title:$[B.APPLE],icon:e.jsx(Z,{provider:"apple",sx:{width:20,height:20}}),component:Ge},{name:B.GITHUB,title:$[B.GITHUB],icon:e.jsx(Z,{provider:"github",sx:{width:20,height:20}}),component:Ve},{name:B.TWITTER,title:$[B.TWITTER],icon:e.jsx(Z,{provider:"twitter",sx:{width:20,height:20}}),component:Ze},{name:B.AUTH0,title:$[B.AUTH0],icon:e.jsx(Z,{provider:"auth0",sx:{width:20,height:20}}),component:He,hidden:!0}].map(r=>({...r,enabled:s[r.name]?.enabled??!1,order:s[r.name]?.order??null})),l=j.filter(r=>r.enabled),g=l.sort((r,n)=>!re(r?.order)&&!re(n?.order)?r.order-n.order:re(r?.order)?1:-1),v=g.reduce((r,n,L)=>Object.assign(r,{[n.name]:{order:L}}),{}),m=ae(g.reduce((r,n,L)=>Object.assign(r,{[n.name]:L}),{})),y=[...l].sort((r,n)=>m[r.name]-m[n.name]),b={};typeof window<"u"&&(b.context=window);const T=h((r,n)=>{const L=y[r],R=y[n];m[L.name]=n,m[R.name]=r}),S=h(async()=>{const r=Object.keys(m).reduce((n,L)=>(n[L]={order:m[L]},n),{});await i.configAuthentication({input:{did:f,authentication:JSON.stringify(r)}})}),C=()=>{c.current.open(()=>{c.current.close()})},x=h(r=>{c.current.open(O,{provider:r})}),p=h(r=>{u.open({title:o("authentication.deleteLoginProvider",{provider:$[r]}),content:o("authentication.deleteLoginProviderDescription",{provider:$[r]}),confirmButtonText:o("common.confirm"),confirmButtonProps:{color:"error"},cancelButtonText:o("common.cancel"),async onConfirm(n){try{await i.configAuthentication({input:{did:f,authentication:JSON.stringify({[r]:{enabled:!1,order:null}})}}),delete m[r],P.success(o("common.deleteSuccess")),n()}catch(L){P.error(L.message||o("common.deleteFailed"))}}})});return e.jsxs(a,{children:[e.jsx(W,{variant:"contained",onClick:C,sx:{mb:1},children:o("authentication.addLoginProvider")}),e.jsx(ot,{backend:rt,...b,children:y.map((r,n)=>e.jsx(Xe,{index:n,id:r.name,title:r.title,icon:r.icon,onMove:T,onEnd:S,onEditItem:x,onDeleteItem:p,disableDelete:g.length<=1,children:r.component},r.name))}),e.jsx(Ye,{ref:c,providers:j,sortMaps:v}),d]})}const ee={ttl:J.SESSION_TTL,cacheTtl:J.SESSION_CACHE_TTL,email:{enabled:!1,requireVerified:!1,requireUnique:!1,trustOauthProviders:!1,trustedIssuers:[],enableDomainBlackList:!1,domainBlackList:[],enableDomainWhiteList:!1,domainWhiteList:[]},phone:{enabled:!1,requireVerified:!1,requireUnique:!1,regionBlackList:[],trustedIssuers:[]},enableBlacklist:!1};function V(u){return e.jsx(Ne,{...u,sx:{transform:"scale(0.75)"}})}function ye(u,d=!1){const c=d?u.ttl*86400:u.ttl/86400;return{...u,ttl:c}}function Pt(){const{api:u}=_(),{blocklet:d}=z(),c=d?.meta?.did,o=_e({},ee,d?.settings?.session||{});re(o.ttl)&&(o.ttl=ee.ttl),re(o.cacheTtl)&&(o.cacheTtl=ee.cacheTtl),o.phone||(o.phone=ee.phone),o.email||(o.email=ee.email),re(o.enableBlacklist)&&(o.enableBlacklist=ee.enableBlacklist);const{handleSubmit:i,control:t,formState:f,reset:s,watch:j}=G({defaultValues:Y(ye(o),["ttl","cacheTtl","email","phone","enableBlacklist"])}),{t:l}=M(),g=j("email.enabled"),v=j("phone.enabled"),m=j("email.enableDomainBlackList"),y=j("email.enableDomainWhiteList"),{fields:b,append:T,remove:S}=Fe({control:t,name:"email.domainBlackList"}),{fields:C,append:x,remove:p}=Fe({control:t,name:"email.domainWhiteList"}),r=h(async n=>{try{const{blocklet:L}=await u.updateAppSessionConfig({input:{did:c,config:ze(ye(n,!0),["phone"])}}),R=Object.assign({},ee,Y(L?.settings?.session||{},["ttl","cacheTtl","email","phone","enableBlacklist"]));s(ye(R)),P.success(l("common.configSuccess"))}catch(L){P.error(L.message)}});return e.jsx(At,{onSubmit:i(r),children:e.jsxs(H,{direction:"column",sx:{gap:6},children:[e.jsxs(a,{children:[e.jsxs(a,{children:[e.jsx(oe,{variant:"h6",sx:{fontWeight:600},children:l("blocklet.config.session.profile")}),e.jsx(a,{component:de,sx:{my:3}})]}),e.jsxs(H,{sx:{gap:2},children:[e.jsx(w,{title:l("blocklet.config.session.fullNameEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(V,{disabled:!0,checked:!0})})}),e.jsx(w,{title:l("blocklet.config.session.avatarEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(V,{disabled:!0,checked:!0})})}),e.jsx(w,{title:l("blocklet.config.session.emailEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.enabled",control:t,render:({field:n})=>e.jsx(V,{...n,checked:n.value})})})}),g&&e.jsxs(H,{direction:"column",sx:{ml:2,gap:.5},children:[e.jsx(w,{title:l("blocklet.config.session.emailRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.requireVerified",control:t,render:({field:n})=>e.jsx(K,{sx:{ml:0},control:e.jsx(V,{...n,checked:n.value})})})})}),e.jsx(w,{title:l("blocklet.config.session.emailRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.requireUnique",control:t,render:({field:n})=>e.jsx(K,{sx:{ml:0},control:e.jsx(V,{...n,checked:n.value})})})})}),e.jsx(w,{title:l("blocklet.config.session.emailTrustOauthProviders"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.trustOauthProviders",control:t,render:({field:n})=>e.jsx(K,{sx:{ml:0},control:e.jsx(V,{...n,checked:n.value})})})})}),e.jsx(w,{title:l("blocklet.config.session.enableDomainBlackList"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.enableDomainBlackList",control:t,render:({field:n})=>e.jsx(K,{sx:{ml:0},control:e.jsx(V,{...n,checked:n.value})})})})}),m&&e.jsxs(a,{children:[b.map((n,L)=>e.jsxs(H,{direction:"row",sx:{alignItems:"center",my:1,maxWidth:"720px"},children:[e.jsx(I,{name:`email.domainBlackList.${L}`,control:t,render:R=>e.jsx(E,{...R.field,size:"small",fullWidth:!0})}),e.jsx(ue,{onClick:()=>S(L),children:e.jsx(Pe,{})})]},n.id)),e.jsx(X,{startIcon:e.jsx(Ae,{}),onClick:()=>T(""),children:l("blocklet.config.session.addDomain")})]}),e.jsx(w,{title:l("blocklet.config.session.enableDomainWhiteList"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"email.enableDomainWhiteList",control:t,render:({field:n})=>e.jsx(K,{sx:{ml:0},control:e.jsx(V,{...n,checked:n.value})})})})}),y&&e.jsxs(a,{children:[C.map((n,L)=>e.jsxs(H,{direction:"row",sx:{alignItems:"center",my:1,maxWidth:"720px"},children:[e.jsx(I,{name:`email.domainWhiteList.${L}`,control:t,render:R=>e.jsx(E,{...R.field,size:"small",fullWidth:!0})}),e.jsx(ue,{onClick:()=>p(L),children:e.jsx(Pe,{})})]},n.id)),e.jsx(X,{startIcon:e.jsx(Ae,{}),onClick:()=>x(""),children:l("blocklet.config.session.addDomain")})]})]}),e.jsxs(a,{sx:{display:"none"},children:[e.jsx(w,{title:l("blocklet.config.session.phoneEnabled"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"phone.enabled",control:t,disabled:!0,render:({field:n})=>e.jsx(K,{sx:{ml:0},control:e.jsx(V,{...n,checked:n.value})})})})}),v&&e.jsxs(H,{direction:"column",sx:{ml:2,mt:1},children:[e.jsx(w,{title:l("blocklet.config.session.phoneRequireVerified"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"phone.requireVerified",control:t,render:({field:n})=>e.jsx(K,{sx:{ml:0},control:e.jsx(V,{...n,checked:n.value})})})})}),e.jsx(w,{title:l("blocklet.config.session.phoneRequireUnique"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"phone.requireUnique",control:t,render:({field:n})=>e.jsx(K,{sx:{ml:0},control:e.jsx(V,{...n,checked:n.value})})})})})]})]})]})]}),e.jsxs(a,{children:[e.jsx(oe,{variant:"h6",sx:{fontWeight:600},children:l("blocklet.config.session.period")}),e.jsx(a,{component:de,sx:{my:3}}),e.jsx(H,{direction:"column",spacing:2,children:e.jsx(I,{name:"ttl",control:t,rules:{min:1,max:30},render:({field:n})=>e.jsx(U,{fullWidth:!0,sx:{mb:2},children:e.jsx(w,{title:l("blocklet.config.session.ttl",{day:n.value}),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{width:"100%",maxWidth:500,px:2},children:e.jsx(ut,{...n,defaultValue:7,step:1,marks:[{value:1,label:l("blocklet.config.session.day",{day:1})},{value:7,label:l("blocklet.config.session.days",{day:7})},{value:14,label:l("blocklet.config.session.days",{day:14})},{value:21,label:l("blocklet.config.session.days",{day:21})},{value:30,label:l("blocklet.config.session.days",{day:30})}],min:1,max:30,valueLabelDisplay:"auto"})})})})})})]}),e.jsxs(a,{children:[e.jsx(oe,{variant:"h6",sx:{fontWeight:600},children:l("blocklet.config.session.experimentalSettings")}),e.jsx(a,{component:de,sx:{my:3}}),e.jsx(H,{direction:"column",spacing:2,children:e.jsx(w,{title:l("blocklet.config.session.enableBlacklist"),sectionLeftSx:{width:"600px"},children:e.jsx(a,{sx:{alignSelf:"flex-start"},children:e.jsx(I,{name:"enableBlacklist",control:t,render:({field:n})=>e.jsx(K,{sx:{ml:0},control:e.jsx(V,{...n,checked:n.value})})})})})})]}),e.jsx(a,{children:e.jsx(X,{type:"submit",variant:"contained",disabled:!f.isDirty,children:l("common.save")})})]})})}const At=Ee.form`
2
2
  max-width: 1536px;
3
3
 
4
4
  .advanced-config {
@@ -1,4 +1,4 @@
1
- import{r as u}from"./vendor-react-CTtPmzVP.js";import{W as o,j as e,ak as j,aN as L,z as A,at as K,cZ as B,I as P,a6 as W,by as M,aj as X,cH as H}from"./vendor-mui-core-DnR6WYuU.js";import{C as G}from"./Google-DPANLEPw.js";import{aT as U}from"./vendor-ux-DTEmWsko.js";import{c as Y}from"./create-passport-svg-DXpLsb6S.js";import{A as Z}from"./vendor-arcblock-CIBaEWEy.js";import{q as $}from"./index-BZxsCCR_.js";import{R as J}from"./required-BQln5OcV.js";import{F as Q}from"./form-wrapper-PT5ZzMQy.js";import{L as v}from"./logo-uploader-BksS6OGe.js";import{A as ee,a as ne,b as te}from"./collapse-B7gUzFaX.js";const T={description:o.string,editing:o.bool,onChange:o.func,required:o.bool,value:o.any,componentProps:o.object,render:o.func,renderFormItem:o.func};function S({editing:n,value:s,onChange:l}){const[i,c]=u.useState(!1),m=u.useRef(),f=u.useRef(s);u.useEffect(()=>{let a=null;return n&&(a=setTimeout(()=>{c(!0)},50)),()=>{clearTimeout(a)}},[n]);const h=a=>{f.current=a,l(a)},b=()=>{c(!1),l(f.current)},y=e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[s,s!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:s,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),p=e.jsxs(j,{onKeyDown:b,sx:{display:"flex",flexGrow:1,alignItems:"center",height:"40px"},children:[e.jsx(j,{onClick:()=>c(!0),sx:{display:"flex",alignItems:"center"},children:e.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:s,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:s==="auto"?"default":"pointer"}})}),e.jsx(L,{open:i,anchorEl:m.current,onClose:()=>c(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(G,{color:s,onChange:a=>h(a.hex)})})]});return n?p:y}S.propTypes=T;function D({editing:n,description:s,value:l,onChange:i,componentProps:c={},...m}){const{placeholder:f}=c,h=u.useRef(l),{t:b}=u.useContext(U),y=a=>{a.key==="Enter"&&i(h.current,"confirm")},p=a=>{h.current=a,i(a)};return n?e.jsx(A,{style:{flex:1},fullWidth:!0,value:l,onChange:a=>{a.persist(),p(a.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:s||f,onKeyDown:y,...m}):e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:l||e.jsx("span",{className:"placeholder",children:b("common.requiredInputPlaceholder",{name:s||f})})})}D.propTypes=T;function O({editing:n,value:s,onChange:l,componentProps:i,...c}){const{blocklet:m}=i,f=s==="auto"?Z(m.appDid):s;return e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Y({title:"Owner",issuer:$.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:s||"auto"})}}),e.jsx(S,{...c,editing:n,value:n?f:s,onChange:l,componentProps:i})]})}O.propTypes={...T,componentProps:o.shape({blocklet:o.object.isRequired}).isRequired};const re=H`
1
+ import{r as u}from"./vendor-react-CTtPmzVP.js";import{W as o,j as e,ak as j,aN as L,z as A,at as K,cZ as B,I as P,a6 as W,by as M,aj as X,cH as H}from"./vendor-mui-core-DnR6WYuU.js";import{C as G}from"./Google-D9N2NN29.js";import{aT as U}from"./vendor-ux-7TwTLXf8.js";import{c as Y}from"./create-passport-svg-BJX-WFnl.js";import{A as Z}from"./vendor-arcblock-Dr30TSIK.js";import{q as $}from"./index-CGOBEhzW.js";import{R as J}from"./required-BQln5OcV.js";import{F as Q}from"./form-wrapper-PT5ZzMQy.js";import{L as v}from"./logo-uploader-CeXSNxdi.js";import{A as ee,a as ne,b as te}from"./collapse-B7gUzFaX.js";const T={description:o.string,editing:o.bool,onChange:o.func,required:o.bool,value:o.any,componentProps:o.object,render:o.func,renderFormItem:o.func};function S({editing:n,value:s,onChange:l}){const[i,c]=u.useState(!1),m=u.useRef(),f=u.useRef(s);u.useEffect(()=>{let a=null;return n&&(a=setTimeout(()=>{c(!0)},50)),()=>{clearTimeout(a)}},[n]);const h=a=>{f.current=a,l(a)},b=()=>{c(!1),l(f.current)},y=e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[s,s!=="auto"&&e.jsx("div",{style:{marginLeft:4,backgroundColor:s,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),p=e.jsxs(j,{onKeyDown:b,sx:{display:"flex",flexGrow:1,alignItems:"center",height:"40px"},children:[e.jsx(j,{onClick:()=>c(!0),sx:{display:"flex",alignItems:"center"},children:e.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:s,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:s==="auto"?"default":"pointer"}})}),e.jsx(L,{open:i,anchorEl:m.current,onClose:()=>c(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:e.jsx(G,{color:s,onChange:a=>h(a.hex)})})]});return n?p:y}S.propTypes=T;function D({editing:n,description:s,value:l,onChange:i,componentProps:c={},...m}){const{placeholder:f}=c,h=u.useRef(l),{t:b}=u.useContext(U),y=a=>{a.key==="Enter"&&i(h.current,"confirm")},p=a=>{h.current=a,i(a)};return n?e.jsx(A,{style:{flex:1},fullWidth:!0,value:l,onChange:a=>{a.persist(),p(a.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:s||f,onKeyDown:y,...m}):e.jsx(j,{className:"form-item-input slot",sx:{px:1},children:l||e.jsx("span",{className:"placeholder",children:b("common.requiredInputPlaceholder",{name:s||f})})})}D.propTypes=T;function O({editing:n,value:s,onChange:l,componentProps:i,...c}){const{blocklet:m}=i,f=s==="auto"?Z(m.appDid):s;return e.jsxs(j,{sx:{display:"flex",alignItems:"center"},children:[e.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:Y({title:"Owner",issuer:$.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:s||"auto"})}}),e.jsx(S,{...c,editing:n,value:n?f:s,onChange:l,componentProps:i})]})}O.propTypes={...T,componentProps:o.shape({blocklet:o.object.isRequired}).isRequired};const re=H`
2
2
  0%, 100% {
3
3
  transform: scale(1) translateX(0);
4
4
  }
@@ -1,4 +1,4 @@
1
- import{r}from"./vendor-react-CTtPmzVP.js";import{j as i,bD as N,at as g,W as t,ak as _,bu as S,a6 as E,s as z}from"./vendor-mui-core-DnR6WYuU.js";import{g as Z,h as $,b as y,q as T}from"./vendor-hooks-qxhUUbW5.js";import{Q as D,s as q,c as A,R as U,T as L,U as H,V as F}from"./index-BZxsCCR_.js";import{aT as O,aK as W,w as B,V as w,$ as Y}from"./vendor-ux-DTEmWsko.js";import{N as K}from"./index-CrRA4U7x.js";import{C as J}from"./vendor-utils-CxWN1dT3.js";import{u as Q}from"./use-passport-id-B-b-_oYF.js";import{u as X}from"./session-DwQKgNVz.js";import{b as G}from"./sdk-ChA0AoUQ.js";import{w as e2}from"./wrap-locale-BUa8dcqX.js";function b({invitation:e,createPassportSvg:o,passportColor:c="auto"}){const[d,n]=r.useState(!1),{t:p}=r.useContext(O),s=r.useMemo(()=>(e.role.title||e.role.name).toUpperCase(),[e.role.title,e.role.name]),C=r.useMemo(()=>o({title:s,issuer:e.info.name,issuerDid:e.info.appDid,ownerName:"Your Name",ownerDid:e.info.appDid,preferredColor:e.info.passportColor||c,extra:e.passportExpireTime?{key:"Exp",value:D(e.passportExpireTime).format("YYYY-MM-DD HH:mm:ss")}:void 0}),[e,s]),m=r.useCallback(()=>{n(!0)},[]),a=r.useCallback(()=>{n(!1)},[]);return i.jsxs(i.Fragment,{children:[i.jsx(i2,{children:i.jsxs("div",{className:"invite-passport__card",onClick:m,children:[!!e.display&&i.jsx(K,{data:e.display,style:{width:"100%",height:"100%"}}),!e.display&&i.jsx("div",{className:"invite-passport__cover",dangerouslySetInnerHTML:{__html:C}})]})}),i.jsx(W,{open:d,title:p("invite.viewPermission"),PaperProps:{style:{minHeight:"auto",paddingBottom:"20px"}},onClose:a,children:e.role.permissions&&e.role.permissions.length>0?i.jsx("ul",{style:{listStyle:"circle",padding:"0 20px"},children:e.role.permissions.map(u=>i.jsx("li",{style:{listStyle:"circle"},children:u.description},u.name))}):i.jsxs("div",{style:{color:"#999",textAlign:"center"},children:[i.jsx(N,{style:{width:"30px",height:"30px"}}),i.jsx("div",{children:p("invite.emptyPermission")})]})})]})}b.propTypes={invitation:t.object.isRequired,createPassportSvg:t.func.isRequired,passportColor:t.string};const i2=g.div`
1
+ import{r}from"./vendor-react-CTtPmzVP.js";import{j as i,bD as N,at as g,W as t,ak as _,bu as S,a6 as E,s as z}from"./vendor-mui-core-DnR6WYuU.js";import{g as Z,h as $,b as y,q as T}from"./vendor-hooks-qxhUUbW5.js";import{Q as D,s as q,c as A,R as U,T as L,U as H,V as F}from"./index-CGOBEhzW.js";import{aT as O,aK as W,w as B,V as w,$ as Y}from"./vendor-ux-7TwTLXf8.js";import{N as K}from"./index-BT901ij8.js";import{C as J}from"./vendor-utils-CxWN1dT3.js";import{u as Q}from"./use-passport-id-B-b-_oYF.js";import{u as X}from"./session-vM0SwFQZ.js";import{b as G}from"./sdk-Be-u0PfZ.js";import{w as e2}from"./wrap-locale-DGVkhpYh.js";function b({invitation:e,createPassportSvg:o,passportColor:c="auto"}){const[d,n]=r.useState(!1),{t:p}=r.useContext(O),s=r.useMemo(()=>(e.role.title||e.role.name).toUpperCase(),[e.role.title,e.role.name]),C=r.useMemo(()=>o({title:s,issuer:e.info.name,issuerDid:e.info.appDid,ownerName:"Your Name",ownerDid:e.info.appDid,preferredColor:e.info.passportColor||c,extra:e.passportExpireTime?{key:"Exp",value:D(e.passportExpireTime).format("YYYY-MM-DD HH:mm:ss")}:void 0}),[e,s]),m=r.useCallback(()=>{n(!0)},[]),a=r.useCallback(()=>{n(!1)},[]);return i.jsxs(i.Fragment,{children:[i.jsx(i2,{children:i.jsxs("div",{className:"invite-passport__card",onClick:m,children:[!!e.display&&i.jsx(K,{data:e.display,style:{width:"100%",height:"100%"}}),!e.display&&i.jsx("div",{className:"invite-passport__cover",dangerouslySetInnerHTML:{__html:C}})]})}),i.jsx(W,{open:d,title:p("invite.viewPermission"),PaperProps:{style:{minHeight:"auto",paddingBottom:"20px"}},onClose:a,children:e.role.permissions&&e.role.permissions.length>0?i.jsx("ul",{style:{listStyle:"circle",padding:"0 20px"},children:e.role.permissions.map(u=>i.jsx("li",{style:{listStyle:"circle"},children:u.description},u.name))}):i.jsxs("div",{style:{color:"#999",textAlign:"center"},children:[i.jsx(N,{style:{width:"30px",height:"30px"}}),i.jsx("div",{children:p("invite.emptyPermission")})]})})]})}b.propTypes={invitation:t.object.isRequired,createPassportSvg:t.func.isRequired,passportColor:t.string};const i2=g.div`
2
2
  display: flex;
3
3
  max-width: 350px;
4
4
  margin: 30px auto;