@abtnode/blocklet-services 1.16.28-beta-23b06b63 → 1.16.28-beta-bfbab430

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 (174) hide show
  1. package/api/libs/push-kit/index.js +24 -3
  2. package/api/socket/channel/did.js +71 -56
  3. package/dist/assets/{Add-CGjHwYyM.js → Add-BM20NrQO.js} +1 -1
  4. package/dist/assets/{AddBox-u_wqkyL7.js → AddBox--wxfR3G0.js} +1 -1
  5. package/dist/assets/{Alert-CwPUeQTf.js → Alert-DtzaUssX.js} +1 -1
  6. package/dist/assets/{ArrowDropDown-CkIUQSZd.js → ArrowDropDown-Iyfxx2xg.js} +1 -1
  7. package/dist/assets/{Avatar-muG6G3N0.js → Avatar-CUpS4Ilr.js} +1 -1
  8. package/dist/assets/{ButtonGroup-DN2Se0uu.js → ButtonGroup-CYyG5u2K.js} +1 -1
  9. package/dist/assets/{CheckCircle-Djdn9hDj.js → CheckCircle-DoaQShhi.js} +1 -1
  10. package/dist/assets/{ChevronRight-B-tpoPfm.js → ChevronRight-CoSoIqx4.js} +1 -1
  11. package/dist/assets/{Close-CMqfmrhV.js → Close-BLsWc_Tk.js} +1 -1
  12. package/dist/assets/{CloseOutlined-BCWVvCVq.js → CloseOutlined-DW47mLri.js} +1 -1
  13. package/dist/assets/{Delete-DTI_gypW.js → Delete-BeboIHFa.js} +1 -1
  14. package/dist/assets/{DeleteOutline-CChRcfrX.js → DeleteOutline-BaCf1XtY.js} +1 -1
  15. package/dist/assets/{Done-BNlw5zor.js → Done-BEjApK9u.js} +1 -1
  16. package/dist/assets/{Download-DQc7dh43.js → Download-DjWaMhPn.js} +1 -1
  17. package/dist/assets/{Edit-DyMNx1Ce.js → Edit-DyzvkXNJ.js} +1 -1
  18. package/dist/assets/{EditIcon-DjoM4rHm.js → EditIcon-BXRvvSFr.js} +1 -1
  19. package/dist/assets/{Error-Bc_XhHH9.js → Error-DcCaeZ_S.js} +1 -1
  20. package/dist/assets/{ExpandMore-CKq3nKzY.js → ExpandMore-Dw5iC69g.js} +1 -1
  21. package/dist/assets/{FilterList-PGaxs7JY.js → FilterList-B_AYjksa.js} +1 -1
  22. package/dist/assets/{FormControl-DBnW--qW.js → FormControl-CKJrH8LS.js} +1 -1
  23. package/dist/assets/{FormControlLabel-DiZXxoiR.js → FormControlLabel-J_nG7S9r.js} +1 -1
  24. package/dist/assets/{FormGroup-DaYoMAjJ.js → FormGroup-B2XKvk2U.js} +1 -1
  25. package/dist/assets/{Google-DkiSAU8s.js → Google-_J6to4FR.js} +1 -1
  26. package/dist/assets/{Hidden-BsXBUsJf.js → Hidden-BLdLc8h9.js} +1 -1
  27. package/dist/assets/{InfoOutlined-EGrZAKuG.js → InfoOutlined-jXjX6Tro.js} +1 -1
  28. package/dist/assets/{InputAdornment-B9h0Ttvo.js → InputAdornment-DYTxgt6k.js} +1 -1
  29. package/dist/assets/{InputLabel-BXkoZEFw.js → InputLabel-lATzw7NR.js} +1 -1
  30. package/dist/assets/{LastPage-BlsQhAzE.js → LastPage-2k34T11k.js} +1 -1
  31. package/dist/assets/{Launch-D_gZUmVw.js → Launch-DOIBGLzl.js} +1 -1
  32. package/dist/assets/{LaunchOutlined-f7i2PwtL.js → LaunchOutlined-SrMQHpJM.js} +1 -1
  33. package/dist/assets/{Link-DcerCJFu.js → Link-5b2HVhJS.js} +1 -1
  34. package/dist/assets/{ListItemText-BDyQ2J2z.js → ListItemText-BWOzBiMo.js} +1 -1
  35. package/dist/assets/{LoadingButton-CQEzY_7w.js → LoadingButton-CK30gWPr.js} +1 -1
  36. package/dist/assets/{LockIcon-CAM44v0n.js → LockIcon-DSoFeiUW.js} +1 -1
  37. package/dist/assets/{Loop-B92ZF0ZY.js → Loop-CBPEms0Q.js} +1 -1
  38. package/dist/assets/{MoreHoriz-C84g5tnh.js → MoreHoriz-D2VMH51n.js} +1 -1
  39. package/dist/assets/{MoreVert-CmWHvYKq.js → MoreVert-BEZvlzF-.js} +1 -1
  40. package/dist/assets/{OpenInNew-BqRi4pNO.js → OpenInNew-Ck3ijqlL.js} +1 -1
  41. package/dist/assets/{Pagination-Bl0sYNE2.js → Pagination-DYCSDEOZ.js} +1 -1
  42. package/dist/assets/{PlayArrow-nyGVaVTE.js → PlayArrow-Bep57q0l.js} +1 -1
  43. package/dist/assets/{QuestionMarkCircle-BB-ivMSu.js → QuestionMarkCircle-BRJ6UWDC.js} +1 -1
  44. package/dist/assets/{RadioGroup-xJsTr9dY.js → RadioGroup-DjYscIah.js} +1 -1
  45. package/dist/assets/{Search-DtER35HN.js → Search-DFMpNFHb.js} +1 -1
  46. package/dist/assets/{Select-CZWM_yIs.js → Select-B59j8vqU.js} +1 -1
  47. package/dist/assets/{ServerLogo-C_NqeJau.js → ServerLogo-B-brfx83.js} +1 -1
  48. package/dist/assets/{Skeleton-8LdPY1iI.js → Skeleton-CjiEfCyO.js} +1 -1
  49. package/dist/assets/{Slider-vgBd_9Te.js → Slider-BJkaec7K.js} +1 -1
  50. package/dist/assets/{Stepper-D4EaxYmk.js → Stepper-JkeBEOuY.js} +1 -1
  51. package/dist/assets/{TextField-Bnj3w9zC.js → TextField-C5D15Ugf.js} +1 -1
  52. package/dist/assets/{Toolbar-DTVbFTHr.js → Toolbar-CSkIjhiI.js} +1 -1
  53. package/dist/assets/{ViewList-hag6Se2e.js → ViewList-BKInLQTN.js} +1 -1
  54. package/dist/assets/{access-control-K72Yp26V.js → access-control-BCwpKFRG.js} +1 -1
  55. package/dist/assets/{actions-DhviKTN_.js → actions-DPCHP2Zq.js} +1 -1
  56. package/dist/assets/{add-component-core-WuqJofF1.js → add-component-core-07RqFKRp.js} +1 -1
  57. package/dist/assets/{add-resource-CBQzmo6L.js → add-resource-DyhrbJxX.js} +1 -1
  58. package/dist/assets/{addon-DpHkGhu-.js → addon-Dd_1kHaH.js} +1 -1
  59. package/dist/assets/{analytics-C4beBKTQ.js → analytics-CpnXFlCP.js} +1 -1
  60. package/dist/assets/api-BEakJrYk.js +1 -0
  61. package/dist/assets/{audit-logs-rp2fx4nb.js → audit-logs-CcdVOnke.js} +1 -1
  62. package/dist/assets/{button-DEtsUQzZ.js → button-BKUtHuLK.js} +1 -1
  63. package/dist/assets/{click-to-copy-CRTzxc53.js → click-to-copy-C5Z-YhEj.js} +1 -1
  64. package/dist/assets/{complete-BD_nENcN.js → complete-DGbpqS5n.js} +1 -1
  65. package/dist/assets/{component-B1tn_hP5.js → component-DqG0gKuO.js} +33 -33
  66. package/dist/assets/{config-BTEtVukE.js → config-DLELBWuY.js} +1 -1
  67. package/dist/assets/{config-31oYrIaX.js → config-DseId50E.js} +1 -1
  68. package/dist/assets/{config-navigation-D0QM9Tlf.js → config-navigation-D3NGEvCy.js} +1 -1
  69. package/dist/assets/{config-space-CByVoikQ.js → config-space-Dq3sHJW8.js} +1 -1
  70. package/dist/assets/{confirm-DKAx_LOF.js → confirm-Bp1YUyru.js} +1 -1
  71. package/dist/assets/{connect-DewOaYFg.js → connect-CCqeZs4y.js} +1 -1
  72. package/dist/assets/{connect-c6cW4_Ar.js → connect-De6kBvVp.js} +1 -1
  73. package/dist/assets/{connect-to-QdIq3lJf.js → connect-to-DNQSW4Zf.js} +1 -1
  74. package/dist/assets/{content-layout-DSvdV3Fc.js → content-layout-FX0-4e_U.js} +1 -1
  75. package/dist/assets/{dashboard-B1Xb5MJh.js → dashboard-gEbtoKpZ.js} +3 -3
  76. package/dist/assets/{did-address-D9v6XhHB.js → did-address-Etx4oDtC.js} +1 -1
  77. package/dist/assets/{domain-BJe87vEl.js → domain-Bp688Xuz.js} +1 -1
  78. package/dist/assets/{domain-list-Bdex7GXw.js → domain-list-xUOKEmgZ.js} +1 -1
  79. package/dist/assets/{exchange-passport-CRrJTrFH.js → exchange-passport-Ca8hn9GK.js} +1 -1
  80. package/dist/assets/{fallback-BkGdFK9Z.js → fallback-CIBVmJin.js} +1 -1
  81. package/dist/assets/{fuel-Bd4mSR9-.js → fuel-CJOxfEOO.js} +1 -1
  82. package/dist/assets/{fullpage-C2hoRIrp.js → fullpage-D3A4C5-R.js} +1 -1
  83. package/dist/assets/{home-CTMUPBRC.js → home-CjQy6Wn4.js} +1 -1
  84. package/dist/assets/{iframe-DGX84QRH.js → iframe-BBq0Voai.js} +1 -1
  85. package/dist/assets/{index-E1KqmODI.js → index-3J8dxrpv.js} +1 -1
  86. package/dist/assets/{index-Bvv7qWos.js → index-B-MiDNZJ.js} +1 -1
  87. package/dist/assets/{index-hQKQMc9t.js → index-B0YP3d1_.js} +3 -3
  88. package/dist/assets/{index-cS7vAh3l.js → index-B4NnGwvJ.js} +1 -1
  89. package/dist/assets/{index-ClyxMWNb.js → index-BJX9Tvpd.js} +1 -1
  90. package/dist/assets/{index-XGy6tJH9.js → index-BNte_m1O.js} +1 -1
  91. package/dist/assets/{index-g0zhI6md.js → index-BYYybgec.js} +3 -3
  92. package/dist/assets/{index-CbFjUt38.js → index-BgwjaAEK.js} +1 -1
  93. package/dist/assets/{index-CdyYgvov.js → index-BvTERmRP.js} +1 -1
  94. package/dist/assets/{index-CspTZt1s.js → index-BvWO4cX9.js} +1 -1
  95. package/dist/assets/{index-CJG6DxXB.js → index-BvsLirqD.js} +4 -4
  96. package/dist/assets/{index-Blm67jWV.js → index-C2gRwmn2.js} +1 -1
  97. package/dist/assets/{index-BYBypSYm.js → index-C7siWm6R.js} +1 -1
  98. package/dist/assets/{index-COvG2EoD.js → index-CBJAk2V8.js} +1 -1
  99. package/dist/assets/{index-ViXJU-AX.js → index-CR0jMc07.js} +1 -1
  100. package/dist/assets/{index-CYCsdNDo.js → index-CnSZHHme.js} +1 -1
  101. package/dist/assets/{index-C0GGVRtG.js → index-Cy0soagJ.js} +1 -1
  102. package/dist/assets/{index-DLBD5Exg.js → index-CzncbcdH.js} +1 -1
  103. package/dist/assets/{index-67sAUscV.js → index-D4zAIKo5.js} +1 -1
  104. package/dist/assets/{index-CkQ_zCey.js → index-DA6RGcPS.js} +1 -1
  105. package/dist/assets/{index-Ct6pLyhV.js → index-DUsylIII.js} +1 -1
  106. package/dist/assets/{index-gG5WqcuQ.js → index-DWdOmPJK.js} +1 -1
  107. package/dist/assets/index-Dm4QfKgj.js +262 -0
  108. package/dist/assets/{index-C8siP93P.js → index-DxgnjIVN.js} +1 -1
  109. package/dist/assets/{index-T8KhhzyT.js → index-DzIqbqJ_.js} +1 -1
  110. package/dist/assets/{index-BhhvWMdR.js → index-QBptYklD.js} +1 -1
  111. package/dist/assets/{index-fTECGjBy.js → index-QUyszNOn.js} +1 -1
  112. package/dist/assets/{index-CML05j9-.js → index-Ta8CgfK0.js} +1 -1
  113. package/dist/assets/{index-m-fnir8C.js → index-kTvctsLd.js} +1 -1
  114. package/dist/assets/{index-Dzqb9mXT.js → index-lo0p8vGs.js} +1 -1
  115. package/dist/assets/{index-S4IxJvti.js → index-r7u0jEi1.js} +1 -1
  116. package/dist/assets/{index-CVxOUDOJ.js → index-zD9-bZuV.js} +1 -1
  117. package/dist/assets/{index.es-C2wCOFdy.js → index.es-BwRDpSz4.js} +1 -1
  118. package/dist/assets/{index.esm-DlSTABXh.js → index.esm-CpvBYn6L.js} +1 -1
  119. package/dist/assets/{invitation-Df4Cs12X.js → invitation-DmGeq7ty.js} +1 -1
  120. package/dist/assets/{invite-S1srcr2G.js → invite-BHr71ERq.js} +1 -1
  121. package/dist/assets/{issue-passport-C1rFpUNH.js → issue-passport-CVLycMc5.js} +1 -1
  122. package/dist/assets/{item-CNDnGCfY.js → item-BcWo6lea.js} +1 -1
  123. package/dist/assets/{jss-plugin-props-sort.esm-CPaRom1_.js → jss-plugin-props-sort.esm-CS5B424R.js} +1 -1
  124. package/dist/assets/{launch-result-message-BKZO7m6l.js → launch-result-message-CAUmoCmH.js} +1 -1
  125. package/dist/assets/{layout-DTTC2rnt.js → layout-l6KrRo_j.js} +1 -1
  126. package/dist/assets/{list-header-hWlUCiAn.js → list-header-C_S_alCD.js} +1 -1
  127. package/dist/assets/localization-Bewup7q7.js +1 -0
  128. package/dist/assets/{log-2Is9yVie.js → log-Ch42uXqw.js} +1 -1
  129. package/dist/assets/{login-CtHPThli.js → login-BxjyT1qS.js} +1 -1
  130. package/dist/assets/{login-oauth-callback-CmcJVuGC.js → login-oauth-callback-C6s-4b1V.js} +1 -1
  131. package/dist/assets/{logo-uploader-DgciS-Bn.js → logo-uploader-CGtIsD0T.js} +3 -3
  132. package/dist/assets/{lost-passport-XGwclRUF.js → lost-passport-By5cjQFH.js} +3 -3
  133. package/dist/assets/{lottie-CiIb5tX-.js → lottie-DVm7n_Um.js} +1 -1
  134. package/dist/assets/{notifications-1Nh3LWvL.js → notifications-CEpa_xHz.js} +1 -1
  135. package/dist/assets/{overview-BFqUFGF1.js → overview-GOUiKG2a.js} +1 -1
  136. package/dist/assets/{page-header-DWVsf_ju.js → page-header-COyUenU-.js} +1 -1
  137. package/dist/assets/{permission-DuwXRSeD.js → permission-DWzaHXWC.js} +1 -1
  138. package/dist/assets/{preferences-B3Ko8wx4.js → preferences-CE-9QBFo.js} +1 -1
  139. package/dist/assets/publish-resource-UvJbVy1r.js +1 -0
  140. package/dist/assets/{react-DuyTA796.js → react-CY_QENHU.js} +3 -3
  141. package/dist/assets/{redux-inEZ4756.js → redux-CTTkxs7M.js} +1 -1
  142. package/dist/assets/{resource-dialog-_K-j3Qk_.js → resource-dialog-CfRq8NMl.js} +1 -1
  143. package/dist/assets/{selector-EZV0cmfi.js → selector-BEck9RSE.js} +1 -1
  144. package/dist/assets/session-CVIETtuz.js +1 -0
  145. package/dist/assets/{setup-DCrWnBN8.js → setup-CkCZJ55S.js} +3 -3
  146. package/dist/assets/{slicedToArray-DWkDStoK.js → slicedToArray-DCpTgETk.js} +1 -1
  147. package/dist/assets/{spaces-vEbKKcIX.js → spaces-BFbdkHH8.js} +1 -1
  148. package/dist/assets/{start-BmZPEFvM.js → start-CvZw2F8k.js} +1 -1
  149. package/dist/assets/{step-actions-BjzXeqL4.js → step-actions-5tGgPrhF.js} +1 -1
  150. package/dist/assets/{studio-BN0HseSz.js → studio-CGE88nOP.js} +1 -1
  151. package/dist/assets/{switch-control-2jftP8-E.js → switch-control-DBbuPW4q.js} +1 -1
  152. package/dist/assets/{toUpper-Dw_Vex_q.js → toUpper-DTIWej6b.js} +1 -1
  153. package/dist/assets/{transfer-BiNkoNrk.js → transfer-26ConaJn.js} +1 -1
  154. package/dist/assets/{uniqBy-DXylrK-v.js → uniqBy-BF_2_CqX.js} +1 -1
  155. package/dist/assets/{unsubscribe-DvGt2Nbz.js → unsubscribe-Cwx3CGkA.js} +1 -1
  156. package/dist/assets/{use-blocklet-info-for-connect-did-spaces-CsBN3q_W.js → use-blocklet-info-for-connect-did-spaces-DXCdpGY7.js} +1 -1
  157. package/dist/assets/{use-mobile-BJLvYUM8.js → use-mobile-DTODc0Do.js} +1 -1
  158. package/dist/assets/{useAsync-Dfd6Y9G3.js → useAsync-BIhajT1g.js} +1 -1
  159. package/dist/assets/{useFormControl-Dx1QF3eL.js → useFormControl-D74Gykn0.js} +1 -1
  160. package/dist/assets/{useLocalStorage-Ck-HdB2q.js → useLocalStorage-CTTJpYi8.js} +1 -1
  161. package/dist/assets/{useSetState-DLWhgEoo.js → useSetState-B8DWdra7.js} +1 -1
  162. package/dist/assets/{useSlot-CfR_-Pi6.js → useSlot-C0EbF40A.js} +1 -1
  163. package/dist/assets/{user-center-4B87p-Wx.js → user-center-BurgeGnu.js} +1 -1
  164. package/dist/assets/{user-sessions-Bt-MELe3.js → user-sessions-DFuVpXta.js} +1 -1
  165. package/dist/assets/{util-BVAuEbMI.js → util-BfdLSo0f.js} +1 -1
  166. package/dist/assets/{wrap-locale-BRFe_NH_.js → wrap-locale-mANFn3Dq.js} +1 -1
  167. package/dist/index.html +1 -1
  168. package/dist/service-worker.js +1 -1
  169. package/package.json +18 -18
  170. package/dist/assets/api-DPlj8kqR.js +0 -1
  171. package/dist/assets/index-wkSh0NCu.js +0 -262
  172. package/dist/assets/localization-CwJJB4bb.js +0 -1
  173. package/dist/assets/publish-resource-DbsS-U49.js +0 -1
  174. package/dist/assets/session-C-d0ZoFx.js +0 -1
@@ -1 +1 @@
1
- import{u as U,h as w,f as k,bj as me,j as o,B as h,A as be,bx as N,T as B,be as ke,M as m,by as I,bz as ye,D as Ce,az as O,bA as L,bB as Pe,bC as ve,bD as pe,bE as X,c as Se,bF as Ie,bG as Ae,N as K,l as oe,aQ as ue,bH as Be,bI as Re,O as Y,bJ as xe,aP as Te,a1 as te,q as W,r as G,bK as je,bL as re,bM as ze,a as he,bN as C,bO as Ue,bP as Le,bQ as De,bR as Ee,p as Fe,o as Me,b9 as _e,bS as Oe,bT as We,bU as He,bV as $e,bW as Ne,bX as Ge,k as Ve,w as qe,bu as Qe,H as Xe}from"./index-CJG6DxXB.js";import{H as Je,F as Ke}from"./index-ClyxMWNb.js";import{f as Ye,g as Ze}from"./index-CkQ_zCey.js";import{S as eo,t as D,a as oo,b as to,M as ro,C as no,P as ao,c as io,E as so,D as lo,A as co,d as H,I as po,L as uo,e as xo,f as ho}from"./resource-dialog-_K-j3Qk_.js";import{T as we}from"./index-fTECGjBy.js";import{E as J}from"./index-m-fnir8C.js";import{E as fo}from"./fallback-BkGdFK9Z.js";import{u as go}from"./uniqBy-DXylrK-v.js";import{S as Z}from"./index-cS7vAh3l.js";import{i as mo}from"./index-CdyYgvov.js";import{S as bo}from"./Select-CZWM_yIs.js";import{T as vo}from"./TextField-Bnj3w9zC.js";import{M as jo}from"./InputAdornment-B9h0Ttvo.js";import{A as wo}from"./Alert-CwPUeQTf.js";import{S as ko}from"./FormControlLabel-DiZXxoiR.js";import{U as yo}from"./user-sessions-Bt-MELe3.js";import"./index-Bvv7qWos.js";import"./index-gG5WqcuQ.js";import"./Toolbar-DTVbFTHr.js";import"./Hidden-BsXBUsJf.js";import"./MoreHoriz-C84g5tnh.js";import"./ExpandMore-CKq3nKzY.js";import"./Avatar-muG6G3N0.js";import"./useSlot-CfR_-Pi6.js";import"./MoreVert-CmWHvYKq.js";import"./selector-EZV0cmfi.js";import"./use-mobile-BJLvYUM8.js";import"./OpenInNew-BqRi4pNO.js";import"./CloseOutlined-BCWVvCVq.js";import"./FormControl-DBnW--qW.js";import"./useFormControl-Dx1QF3eL.js";import"./InputLabel-BXkoZEFw.js";import"./FilterList-PGaxs7JY.js";import"./toPropertyKey-hKuLU48H.js";import"./FormGroup-DaYoMAjJ.js";import"./ListItemText-BDyQ2J2z.js";import"./LastPage-BlsQhAzE.js";import"./index-BhhvWMdR.js";import"./redux-inEZ4756.js";import"./Search-DtER35HN.js";import"./Delete-DTI_gypW.js";function fe({user:e,isMyself:i=!0,showFullDid:l=!0,switchPassport:u,switchProfile:c,openSettings:d,...g}){const{locale:n}=U(),x=w((b,s={})=>L(D,b,n,"en",s)),t=k(()=>{var b;return(b=(e==null?void 0:e.passports)||[])==null?void 0:b.find(s=>s.name===e.role)},[e==null?void 0:e.passports,e==null?void 0:e.role]),f=me().breakpoints.down("md");return e?o.jsxs(h,{...g,sx:{position:"relative",...g.sx},children:[o.jsx(be,{src:e==null?void 0:e.avatar,did:e==null?void 0:e.did,size:f?64:80,variant:"circle",shape:"circle",sx:{borderRadius:"100%",backgroundColor:"#fff",position:"relative",overflow:"hidden",mb:1.5,...i?{cursor:"pointer","&:hover":{"&::after":{content:`"${x("switchProfile")}"`}},"&::after":{color:"white",position:"absolute",fontSize:"12px",bottom:0,left:0,right:0,height:"50%",backgroundColor:"rgba(0, 0, 0, 0.3)",display:"flex",justifyContent:"center",alignItems:"center"}}:{}},onClick:i?c:N}),o.jsxs(B,{variant:"h6",sx:{fontWeight:"bold",display:"flex",alignItems:"center",gap:1,fontSize:"24px !important"},children:[e==null?void 0:e.fullName,i?o.jsx(ke,{label:(t==null?void 0:t.title)||(e==null?void 0:e.role)||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:m.textBase,borderColor:m.strokeBorderStrong,backgroundColor:"transparent",textTransform:"capitalize",pr:1,pl:.5,"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)"},"&:active":{boxShadow:"none"}},clickable:!0,deleteIcon:o.jsx(I,{icon:ye,color:m.textBase}),onDelete:u,onClick:u}):null]}),o.jsx(Ce,{did:e.did,showQrcode:!0,copyable:!0,compact:!l,responsive:!l,locale:n}),i?o.jsx(O,{sx:{borderRadius:2,color:m.textBase,backgroundColor:"white",border:`1px solid ${m.strokeBorderBase}`,position:"absolute",top:0,right:0},disableFocusRipple:!0,onClick:d,children:o.jsx(I,{icon:eo})}):null]}):null}function Co({data:e,...i}){return o.jsxs(h,{...i,sx:{display:"flex",alignItems:"center",justifyContent:"space-between",...i.sx},children:[o.jsxs(B,{sx:{display:"flex",alignItems:"center",color:m.textBase,fontSize:"14px",gap:1,fontWeight:500},children:[e.icon,e.title]}),o.jsx(B,{sx:{color:m.textSubtitle,whiteSpace:"pre-wrap",fontSize:"14px"},children:e.content})]})}function Po({user:e,...i}){const{locale:l}=U(),u=w((g,n={})=>L(D,g,l,"en",n)),c=k(()=>(e==null?void 0:e.sourceProvider)&&Pe[e.sourceProvider]||u("unknown"),[e==null?void 0:e.sourceProvider]),d=[];return d.push({icon:o.jsx(I,{fontSize:16,icon:ve}),title:u("email"),content:(e==null?void 0:e.email)||u("emptyField")}),d.push({icon:o.jsx(I,{fontSize:16,icon:oo}),title:u("lastLoginAt"),content:e!=null&&e.lastLoginAt?o.jsx(pe,{locale:l,value:e==null?void 0:e.lastLoginAt,relativeRange:3*86400*1e3}):u("unknown")}),d.push({icon:o.jsx(I,{fontSize:16,icon:to}),title:u("lastLoginIp"),content:(e==null?void 0:e.lastLoginIp)||u("unknown")}),d.push({icon:o.jsx(I,{fontSize:16,icon:ro}),title:u("createdAt"),content:e!=null&&e.createdAt?o.jsx(pe,{locale:l,value:e==null?void 0:e.createdAt}):u("unknown")}),d.push({icon:o.jsx(I,{fontSize:16,icon:no}),title:u("registerFrom"),content:c}),o.jsx(h,{...i,sx:{display:"flex",flexDirection:"column",gap:1.5,...i==null?void 0:i.sx},children:d.map(g=>o.jsx(Co,{data:g,sx:{flex:1}},g.title))})}const So=(e,i)=>{let l;return e==="default"?l=X.DEFAULT_COLORS["app-passport"]:e==="auto"?l=X.getNftBGColorFromDid(i):l=X.getNftBGColor(e),l},Io=({issuer:e="",title:i="",issuerDid:l="",issuerAvatarUrl:u="",ownerDid:c="",ownerName:d="",ownerAvatarUrl:g="",preferredColor:n="default",revoked:x=!1,isDataUrl:t=!1,width:p="100%",height:f="100%"})=>{const b=So(n,l),s=X.getSvg({width:p,height:f,tag:x?"revoked":"",tagVariant:x?"error":"info",color:b,did:c,variant:"app-passport",verifiable:!0,issuer:{name:e,icon:u},header:{name:i,icon:g},extra:{key:"Exp",value:"2123-01-01"}});return t?`data:image/svg+xml;utf8,${encodeURIComponent(s)}`:s},ee=e=>{const{response:i}=e;return i?`Request failed: ${i.status} ${i.statusText}: ${JSON.stringify(i.data)}`:e.message},Ao=e=>Io({...e,issuerAvatarUrl:Se(window.location.origin,Ie,"/blocklet/logo")});function Bo({user:e,...i}){var x,t;const{locale:l}=U(),u=w((p,f={})=>L(D,p,l,"en",f)),c=me(),d=k(()=>{const p=((e==null?void 0:e.passports)||[]).map(f=>({...f,revoked:f.status===Ae.REVOKED}));return p.sort((f,b)=>f.revoked===b.revoked?0:f.revoked?1:-1),go(p,"role")},[e==null?void 0:e.passports]),g=k(()=>d==null?void 0:d.find(p=>p.name===e.role),[d,e==null?void 0:e.role]),n=k(()=>{var p,f;return((f=(p=c==null?void 0:c.palette)==null?void 0:p.primary)==null?void 0:f.main)||m.textBase},[(t=(x=c==null?void 0:c.palette)==null?void 0:x.primary)==null?void 0:t.main]);return d.length===0?o.jsx(h,{children:o.jsx(J,{children:u("noPassport")})}):o.jsx(h,{...i,sx:{display:"grid",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(3, 1fr)",md:"repeat(2, 1fr)"},gap:2.5,...i.sx},children:d.map(p=>o.jsx(ao,{passport:p,user:e,color:window.blocklet.passportColor,createPassportSvg:Ao,title:g&&g.role===p.role?u("currentPassport"):"",sx:{flexDirection:"column",alignItems:"center",gap:1,".passport-item__display":{width:166,height:166,borderRadius:2,px:2,display:"flex",justifyContent:"center",backgroundColor:m.backgroundsBgComponent,boxShadow:g&&g.role===p.role?`0px 2px 4px 0px ${n}, 0px 1px 2px -1px ${n}, 0px 0px 0px 1px ${n} !important`:"unset"},".passport-item__body":{marginLeft:"0 !important"}}},p.id))})}function ge({onTest:e=N,onDelete:i=N,onSave:l=N,onCancel:u=N,type:c="slack",url:d="",edit:g=!1}){const{locale:n}=U(),x=w((r,v={})=>L(D,r,n,"en",v)),t=K({type:c||"slack",url:d||"",edit:g??!1,error:"",loading:!1}),p=w(()=>t.url?mo(t.url)?(t.error="",!0):(t.error=x("common.invalid"),!1):(t.error=x("common.required"),!1)),f=w(()=>{t.edit=!1,t.url=d||"",t.type=c||"slack",t.error="",t.loading=!1,u()}),b=w(async r=>{t.loading=!0,await e(r),t.loading=!1}),s=w(r=>()=>{p()&&r({type:t.type,url:t.url})}),a=k(()=>t.error?o.jsx(B,{component:"span",color:"error",children:t.error}):t.edit?t.loading?o.jsx(oe,{size:16}):o.jsx(O,{size:"small",onClick:s(b),sx:{mr:-1},children:o.jsx(I,{icon:io})}):null,[t.error,t.edit,t.loading]);return o.jsxs(h,{sx:{display:"flex",gap:1.5,width:"100%",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},children:[o.jsxs(bo,{sx:{borderRadius:2,"&.Mui-disabled":{backgroundColor:m.backgroundsBgField}},disabled:!t.edit||t.loading,size:"small",value:t.type,onChange:r=>{t.type=r.target.value},children:[o.jsx(ue,{value:"api",children:x("webhook.url")}),o.jsx(ue,{value:"slack",children:x("webhook.slack")})]}),o.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"},children:[o.jsx(vo,{sx:{flex:1,".MuiInputBase-root":{borderRadius:2,"&.Mui-disabled":{backgroundColor:m.backgroundsBgField}}},disabled:!t.edit||t.loading,fullWidth:!0,size:"small",required:!0,value:t.url,onChange:r=>{t.url=r.target.value,p()},error:!!t.error,InputProps:{endAdornment:o.jsx(jo,{position:"end",children:a})}}),o.jsx(h,{sx:{display:"flex",gap:.5},children:t.edit?o.jsxs(o.Fragment,{children:[o.jsx(O,{color:"success",onClick:s((...r)=>{l(...r),t.edit=!1}),sx:{borderRadius:2,border:`1px solid ${m.strokeBorderBase}`},children:o.jsx(I,{icon:Be})}),o.jsx(O,{color:"error",onClick:f,sx:{borderRadius:2,border:`1px solid ${m.strokeBorderBase}`},children:o.jsx(I,{icon:Re})})]}):o.jsxs(o.Fragment,{children:[o.jsx(O,{onClick:()=>{t.edit=!0},sx:{borderRadius:2,border:`1px solid ${m.strokeBorderBase}`},children:o.jsx(I,{icon:so})}),o.jsx(O,{color:"error",onClick:()=>{i({type:t.type,url:t.url})},sx:{borderRadius:2,border:`1px solid ${m.strokeBorderBase}`},children:o.jsx(I,{icon:lo})})]})})]})]})}function Ro({user:e}){var s,a;const{locale:i}=U(),l=w((r,v={})=>L(D,r,i,"en",v)),u=K({showAdd:!1}),c=Y(async()=>await H.user.getUserNotificationConfig(),{refreshDeps:[e],loadingDelay:300}),d=k(()=>{var r;return{wallet:!0,email:!0,phone:!1,...((r=c==null?void 0:c.data)==null?void 0:r.notifications)||{}}},[(s=c==null?void 0:c.data)==null?void 0:s.notifications]),g=k(()=>{var r;return((r=c==null?void 0:c.data)==null?void 0:r.webhooks)||[]},[(a=c==null?void 0:c.data)==null?void 0:a.webhooks]),n=w(async r=>{try{await H.user.saveUserNotificationConfig(r),W.success(l("saveSuccess")),c.run()}catch(v){W.error(ee(v))}}),x=w(async(r,v)=>{await n({notifications:{[r]:v}})}),t=async r=>{try{await H.user.testNotificationWebhook(r),W.success(l("webhookTested"))}catch(v){W.error(ee(v))}},p=w(async r=>{await n({webhooks:g.filter((v,j)=>j!==r)})}),f=w(async(r,v)=>{await n({webhooks:g.map((j,S)=>S===r?v:j)})}),b=w(async r=>{await n({webhooks:[...g,r]}),u.showAdd=!1});return c.error?o.jsx(wo,{severity:"error",children:c.error.message}):c.loading||!c.data?o.jsx(h,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:o.jsx(oe,{})}):o.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:2},children:[o.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:[o.jsx(Z,{checked:d.wallet,labelProps:{label:o.jsxs(B,{color:"text.primary",sx:{fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:[l("walletNotification"),xe(e)&&o.jsx(B,{component:"span",color:"text.secondary",fontSize:13,children:xe(e)})]})},size:"small",onChange:r=>x("wallet",r.target.checked)}),o.jsx(Z,{checked:d.email,labelProps:{label:o.jsxs(B,{color:"text.primary",sx:{fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:[l("emailNotification"),(e==null?void 0:e.email)&&o.jsx(B,{component:"span",color:"text.secondary",fontSize:13,children:e==null?void 0:e.email})]})},size:"small",onChange:r=>x("email",r.target.checked)})]}),o.jsx(Te,{}),o.jsxs(ko,{spacing:1.5,useFlexGap:!0,direction:"column",alignItems:"start",children:[g.map((r,v)=>o.jsx(ge,{onTest:t,onDelete:()=>p(v),onSave:(...j)=>f(v,...j),type:r.type,url:r.url,edit:!1},`${v}_${r.url}`)),u.showAdd&&o.jsx(ge,{onTest:t,onCancel:()=>{u.showAdd=!1},onSave:(...r)=>b(...r),edit:!0},"add"),o.jsx(te,{variant:"outlined",size:"small",sx:{color:m.foregroundsFgBase,borderColor:m.strokeBorderBase,backgroundColor:m.buttonsButtonNeutral,"&:hover":{borderColor:m.strokeBorderBase,backgroundColor:m.buttonsButtonNeutralHover},py:.5,borderRadius:2},startIcon:o.jsx(I,{icon:co}),onClick:()=>{u.showAdd=!0},children:l("addWebhook")})]})]})}function To({configList:e,onSave:i}){const[l,u]=G.useState(e),{locale:c}=U(),d=w((n,x={})=>L(D,n,c,"en",x)),g=w(async(n,x)=>{try{const t=await H.user.saveUserPrivacyConfig({[n]:!x});u(l.map(p=>({...p,value:(t==null?void 0:t[p.key])??p.value}))),W.success(d("saveSuccess")),i()}catch(t){W.error(ee(t))}});return o.jsx(h,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:l.map(n=>o.jsx(Z,{checked:!n.value,labelProps:{label:o.jsx(B,{color:"text.primary",sx:{fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:d("toPublic",{name:n.name})})},size:"small",onChange:x=>g(n.key,x.target.checked)},n.key))})}function zo({item:e}){var r,v,j,S,V;const{confirmApi:i,confirmHolder:l}=je(),u=K({loading:!1}),{locale:c}=U(),d=w((R,A={})=>L(D,R,c,"en",A)),{session:g}=G.useContext(re),{bindOAuth:n,unbindOAuth:x,setBaseUrl:t,baseUrl:p}=g.useOAuth(),f={[C.AUTH0]:ve,[C.APPLE]:Ue,[C.GITHUB]:Le,[C.GOOGLE]:De},b=k(()=>f[e==null?void 0:e.provider],[e==null?void 0:e.provider]),s=k(()=>ze[e==null?void 0:e.provider]||"unknown",[e==null?void 0:e.provider]),a=w(async()=>{try{u.loading=!0,await new Promise((R,A)=>{var T;if(e!=null&&e._bind)i.open({title:d("thirdPartyLogin.confirmUnbind",{name:s}),content:d("thirdPartyLogin.confirmUnbindDescription",{name:s}),confirmButtonText:d("common.confirm"),cancelButtonText:d("common.cancel"),onConfirm(E){x({session:g,connectedAccount:{...Ee(e,["did","pk"]),showProvider:e.provider,provider:e._rawProvider}}).then(R).catch(A),E()},onCancel:R});else{const E=p,q=window==null?void 0:window.blocklet;let M="/";const $=Fe(q),_=Me(q);$&&(_!=null&&_.appPid)&&((T=g==null?void 0:g.user)!=null&&T.sourceAppPid)&&(M=_.appUrl),t(M),n({session:g,oauthItem:{...e,provider:e._rawProvider}}).then(R).catch(A).finally(()=>{t(E)})}})}catch(R){console.error(`Failed to ${e!=null&&e._bind?"unbind":"bind"} oauth account`,R)}finally{u.loading=!1}});return o.jsxs(o.Fragment,{children:[o.jsxs(h,{sx:{borderRadius:2,border:`1px solid ${m.strokeBorderBase}`,background:m.backgroundsBgField,display:"flex",alignItems:"center",py:1,px:1.5,gap:.75,fontSize:"14px",lineHeight:1,overflow:"hidden"},children:[o.jsx(h,{component:I,icon:b,width:"1em",height:"1em",sx:{flexShrink:0,fontSize:16}}),o.jsx(h,{sx:{flex:1},children:s}),o.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:.5},children:[o.jsx(h,{sx:{flex:1,textOverflow:"ellipsis",overflow:"hidden",lineHeight:"normal"},children:((r=e.userInfo)==null?void 0:r.email)||e.did}),(v=e.userInfo)!=null&&v.email?o.jsx(he,{title:o.jsx(o.Fragment,{children:o.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.jsx(be,{size:36,variant:"circle",shape:"circle",src:(j=e.userInfo)==null?void 0:j.picture,did:e.did}),o.jsxs(h,{children:[o.jsx(B,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:(S=e.userInfo)==null?void 0:S.name}),o.jsx(B,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:(V=e.userInfo)==null?void 0:V.email})]})]})}),children:o.jsx(h,{component:I,icon:po,color:m.textSubtitle,fontSize:16,sx:{cursor:"pointer",flexShrink:0}})}):null]})]}),o.jsx(he,{title:e._mainProvider?d("thirdPartyLogin.mainProviderCantRemove"):"",children:o.jsx(h,{children:o.jsx(te,{variant:"outlined",size:"small",sx:{color:e!=null&&e._bind?m.red:m.foregroundsFgBase,borderColor:e!=null&&e._bind?m.red:m.strokeBorderBase,backgroundColor:m.buttonsButtonNeutral,"&:hover":{borderColor:e!=null&&e._bind?m.red:m.strokeBorderBase,backgroundColor:m.buttonsButtonNeutralHover},py:.5,borderRadius:2,fontWeight:500,whiteSpace:"nowrap"},fullWidth:!0,startIcon:u.loading?null:o.jsx(I,{icon:uo}),onClick:a,disabled:e._mainProvider,loading:u.loading,children:e!=null&&e._bind?d("thirdPartyLogin.disconnect"):d("thirdPartyLogin.connect")})})}),l]})}function Uo({user:e}){const{session:i}=G.useContext(re),[l,u]=G.useState({}),{getOAuthConfigs:c}=i.useOAuth();_e(async()=>{const n=await c({sourceAppPid:e==null?void 0:e.sourceAppPid});u(n)},[e==null?void 0:e.sourceAppPid]);const d=k(()=>Object.keys(l).map(x=>({...l[x],provider:x})).filter(x=>x.enabled),[l]),g=k(()=>{const n=Oe(e);let x=!1,t="",p=We(e);const f=n.find(s=>s.provider===C.AUTH0);return f&&(f.id.startsWith("google-oauth2|")&&(n.some(s=>s.provider==="google")||(x=!0,t=C.GOOGLE,p===C.AUTH0&&(p=C.GOOGLE))),f.id.startsWith("appleid|")&&(n.some(s=>s.provider===C.APPLE)||(x=!0,t=C.APPLE,p===C.AUTH0&&(p=C.APPLE))),f.id.startsWith("github|")&&(n.some(s=>s.provider===C.GITHUB)||(x=!0,t=C.GITHUB,p===C.AUTH0&&(p=C.GITHUB)))),d.map(s=>{if(s.provider===C.AUTH0&&x)return null;const a=x&&s.provider===t?n.find(r=>r.provider===C.AUTH0):n.find(r=>r.provider===s.provider);return a?{...s,provider:s.provider,did:a.did,pk:a.pk,userInfo:a.userInfo,_bind:!0,_rawProvider:a.provider,_mainProvider:s.provider===p}:{...s,provider:s.provider,_rawProvider:s.provider,_mainProvider:s.provider===p}}).filter(Boolean).sort((s,a)=>(s==null?void 0:s.order)!==void 0&&(a==null?void 0:a.order)!==void 0?s.order-a.order:(s==null?void 0:s.order)!==void 0?-1:1)},[e==null?void 0:e.connectedAccounts,d]);return o.jsx(h,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:g.map(n=>o.jsx(zo,{item:n},n==null?void 0:n.provider))})}function Lo({user:e,settings:i,onSave:l,...u}){const{locale:c}=U(),d=w((f,b={})=>L(D,f,c,"en",b)),g=k(()=>((i==null?void 0:i.userCenterTabs)||[]).map(b=>({key:b.value,name:b.label,value:b.protected})),[i==null?void 0:i.userCenterTabs]),n=k(()=>{var f;return[{label:d("notificationManagement"),value:"notification",content:o.jsx(Ro,{user:e})},{label:d("thirdPartyLogin.title"),value:"thirdPartyLogin",content:o.jsx(Uo,{user:e})},{label:d("privacyManagement"),value:"privacy",content:o.jsx(To,{configList:g,onSave:l})},((f=e==null?void 0:e.didSpace)==null?void 0:f.endpoint)&&{label:d("storageManagement"),value:"storage",content:o.jsx(xo,{children:o.jsx(ho,{})})},{label:d("sessionManagement"),value:"session",content:o.jsx(yo,{user:e})}].filter(Boolean)},[e,g]),x=K({tab:n[0].value}),t=k(()=>n.find(f=>f.value===x.tab),[x.tab,n]),p=w(f=>{x.tab=f});return t&&o.jsxs(h,{...u,sx:{...u==null?void 0:u.sx,minWidth:{md:500},maxWidth:"100%"},children:[o.jsx(we,{variant:"card",tabs:n,current:t.value,onChange:p}),o.jsx(h,{mt:2.5,children:t.content})]})}function Do({children:e,notLoginContent:i=null,currentTab:l,contentProps:u={},disableAutoRedirect:c=!1,autoPopupSetting:d=!1,hideFooter:g=!1,headerProps:n={},footerProps:x={},userDid:t=void 0,stickySidebar:p=!1}){var ne,ae,ie,se,le,de;const{locale:f}=U(),b=w((y,P={})=>L(D,y,f,"en",P)),s=G.useContext(re),a=s==null?void 0:s.session,r=k(()=>{var z;if(t)return t;const y=window.location.href,P=He(y);return P!=null&&P.did?Array.isArray(P.did)?P.did[0]:P.did:(z=a==null?void 0:a.user)==null?void 0:z.did},[(ne=a==null?void 0:a.user)==null?void 0:ne.did,t]),v=k(()=>{var y;return a!=null&&a.user?r===((y=a==null?void 0:a.user)==null?void 0:y.did):!1},[r,(ae=a==null?void 0:a.user)==null?void 0:ae.did]),j=Y(async()=>{if(await $e(()=>a==null?void 0:a.initialized),v)return a.user;if(r)return H.user.getUserPublicInfo({did:r})},{refreshDeps:[r,v,a==null?void 0:a.initialized,a==null?void 0:a.user]}),S=Y(async()=>j.data&&l?await H.user.getUserPrivacyConfig({did:r}):null,{refreshDeps:[r,j.data,l],loadingDelay:300}),{confirmHolder:V,confirmApi:R}=je({sx:{".MuiDialog-paper":{borderRadius:2,maxWidth:1200},".ux-dialog_title":{fontWeight:600},".ux-dialog_closeButton":{p:1},".MuiDialogActions-root":{display:{xs:"none",md:"flex"}}}}),A=k(()=>{const y=Ne(window.blocklet);try{return Ye(y)}catch(P){return console.error("Failed to format blocklet info",P,y),y}},[]),T=k(()=>{var z;const y=((z=A==null?void 0:A.navigation)==null?void 0:z.userCenter)||[];return(Ze(y,f)||[]).map(F=>{var ce;const Q=F._rawLink??F.link;return{value:Q,label:F.title,url:F.link,protected:((ce=S==null?void 0:S.data)==null?void 0:ce[Q])??!1}})},[A,j.data,S==null?void 0:S.data,f]),E=k(()=>T.find(y=>y.value===l),[T]),q=w(y=>{const P=T.find(z=>z.value===y);P&&(window.location.href=qe(P.url,{did:v?void 0:r}))}),M=k(()=>o.jsx(Lo,{user:j.data,settings:{userCenterTabs:T},onSave:async()=>(await S.runAsync(),S.data)}),[j.data]),$=w(()=>{R.open({title:b("settings"),content:M,showCancelButton:!1,confirmButtonText:b("done"),onConfirm:R.close})});Ge(()=>{R.update({content:M})},[M]),Ve(()=>{d&&$()});const _=k(()=>{var y,P,z;if(j.loading||a.loading)return null;if(j.error){const Q={message:((P=(y=j.error.response)==null?void 0:y.data)==null?void 0:P.error)||j.error.message||"error occurred"};return o.jsx(h,{sx:{width:"100%"},children:o.jsx(fo,{error:Q})})}return!r&&!j.data?i||o.jsx(h,{sx:{width:"100%"},children:o.jsxs(h,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:1},children:[o.jsx(J,{children:b("viewAfterLogin")}),o.jsx(te,{size:"small",variant:"contained",onClick:()=>a.login(),children:b("loginNow")})]})}):o.jsxs(o.Fragment,{children:[o.jsxs(h,{sx:{flex:1,overflow:"hidden"},children:[(z=j==null?void 0:j.data)!=null&&z.fullName?o.jsx(B,{variant:"h4",sx:{py:1.5,fontWeight:700,display:{xs:"none",md:"block"}},children:j.data.fullName}):null,o.jsx(fe,{isMyself:v,switchPassport:a.switchPassport,switchProfile:a.switchProfile,openSettings:$,user:j.data,showFullDid:!1,sx:{display:{md:"none",xs:"block"},mb:1.5}}),T.length>0&&l?o.jsxs(h,{sx:{overflow:"auto",padding:"1px"},children:[o.jsx(we,{variant:"line",tabs:T,current:l,onChange:q,sx:{mb:1.5}}),!S.data||S.loading?o.jsx(h,{sx:{height:"100%",minWidth:"160px",minHeight:"160px",display:"flex",justifyContent:"center",alignItems:"center"},children:o.jsx(oe,{sx:{color:m.primary100}})}):o.jsx(o.Fragment,{children:E!=null&&E.protected&&!v?o.jsx(h,{children:o.jsx(J,{children:b("underProtected")})}):o.jsx(o.Fragment,{children:e&&o.jsx(h,{...u,children:e})})})]}):null,T.length===0?o.jsx(h,{sx:{display:{xs:v?"none":"block",md:"block"},py:3},children:o.jsx(J,{children:b("emptyContent")})}):null]}),o.jsx(h,{sx:{display:{xs:"none",md:"block"},width:"1px",my:-3,backgroundColor:m.strokeSep}}),o.jsx(h,{sx:{width:{sx:"100%",md:420},maxWidth:"100%",position:"relative"},children:o.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:2.5,position:{xs:"static",md:p?"sticky":"static"},top:F=>p?F.spacing(3):"unset"},children:[o.jsx(fe,{isMyself:v,switchPassport:a.switchPassport,switchProfile:a.switchProfile,openSettings:$,user:j.data,sx:{display:{xs:"none",md:"block"}}}),v?o.jsxs(o.Fragment,{children:[o.jsxs(h,{children:[o.jsx(B,{sx:{fontWeight:600,mb:1.5},children:b("myInfo")}),o.jsx(Po,{user:j.data})]}),o.jsxs(h,{children:[o.jsx(B,{sx:{fontWeight:600,mb:1.5},children:b("passport")}),o.jsx(Bo,{user:j.data})]})]}):null]})})]})},[j,T,v,E,S,l,p]);return!c&&!l&&((se=(ie=A==null?void 0:A.navigation)==null?void 0:ie.userCenter)==null?void 0:se.length)>0?(window.location.replace((de=(le=A==null?void 0:A.navigation)==null?void 0:le.userCenter[0])==null?void 0:de.link),null):o.jsxs(h,{sx:{backgroundColor:m.backgroundsBgSubtitle,minHeight:"100vh",display:"flex",flexDirection:"column"},children:[o.jsx(Je,{bordered:!0,...n}),o.jsxs(h,{flex:1,sx:{width:"100%",maxWidth:1200,margin:"0 auto",p:3,display:"flex",alignItems:"stretch",flexDirection:{xs:"column",md:"row"},gap:2.5},children:[_,V]}),g?null:o.jsx(Ke,{bordered:!0,...x})]})}function yt(){const i=Qe().tab,{t:l}=U();return o.jsxs(o.Fragment,{children:[o.jsx(Xe,{children:o.jsx("title",{children:l("pageTitle.userCenter")})}),o.jsx(Do,{disableAutoRedirect:i==="settings",autoPopupSetting:i==="settings"})]})}export{yt as default};
1
+ import{u as U,h as w,f as k,bj as me,j as o,B as h,A as be,bx as N,T as B,be as ke,M as m,by as I,bz as ye,D as Ce,az as O,bA as L,bB as Pe,bC as ve,bD as pe,bE as X,c as Se,bF as Ie,bG as Ae,N as K,l as oe,aQ as ue,bH as Be,bI as Re,O as Y,bJ as xe,aP as Te,a1 as te,q as W,r as G,bK as je,bL as re,bM as ze,a as he,bN as C,bO as Ue,bP as Le,bQ as De,bR as Ee,p as Fe,o as Me,b9 as _e,bS as Oe,bT as We,bU as He,bV as $e,bW as Ne,bX as Ge,k as Ve,w as qe,bu as Qe,H as Xe}from"./index-BvsLirqD.js";import{H as Je,F as Ke}from"./index-BJX9Tvpd.js";import{f as Ye,g as Ze}from"./index-DA6RGcPS.js";import{S as eo,t as D,a as oo,b as to,M as ro,C as no,P as ao,c as io,E as so,D as lo,A as co,d as H,I as po,L as uo,e as xo,f as ho}from"./resource-dialog-CfRq8NMl.js";import{T as we}from"./index-QUyszNOn.js";import{E as J}from"./index-kTvctsLd.js";import{E as fo}from"./fallback-CIBVmJin.js";import{u as go}from"./uniqBy-BF_2_CqX.js";import{S as Z}from"./index-B4NnGwvJ.js";import{i as mo}from"./index-BvTERmRP.js";import{S as bo}from"./Select-B59j8vqU.js";import{T as vo}from"./TextField-C5D15Ugf.js";import{M as jo}from"./InputAdornment-DYTxgt6k.js";import{A as wo}from"./Alert-DtzaUssX.js";import{S as ko}from"./FormControlLabel-J_nG7S9r.js";import{U as yo}from"./user-sessions-DFuVpXta.js";import"./index-B-MiDNZJ.js";import"./index-DWdOmPJK.js";import"./Toolbar-CSkIjhiI.js";import"./Hidden-BLdLc8h9.js";import"./MoreHoriz-D2VMH51n.js";import"./ExpandMore-Dw5iC69g.js";import"./Avatar-CUpS4Ilr.js";import"./useSlot-C0EbF40A.js";import"./MoreVert-BEZvlzF-.js";import"./selector-BEck9RSE.js";import"./use-mobile-DTODc0Do.js";import"./OpenInNew-Ck3ijqlL.js";import"./CloseOutlined-DW47mLri.js";import"./FormControl-CKJrH8LS.js";import"./useFormControl-D74Gykn0.js";import"./InputLabel-lATzw7NR.js";import"./FilterList-B_AYjksa.js";import"./toPropertyKey-hKuLU48H.js";import"./FormGroup-B2XKvk2U.js";import"./ListItemText-BWOzBiMo.js";import"./LastPage-2k34T11k.js";import"./index-QBptYklD.js";import"./redux-CTTkxs7M.js";import"./Search-DFMpNFHb.js";import"./Delete-BeboIHFa.js";function fe({user:e,isMyself:i=!0,showFullDid:l=!0,switchPassport:u,switchProfile:c,openSettings:d,...g}){const{locale:n}=U(),x=w((b,s={})=>L(D,b,n,"en",s)),t=k(()=>{var b;return(b=(e==null?void 0:e.passports)||[])==null?void 0:b.find(s=>s.name===e.role)},[e==null?void 0:e.passports,e==null?void 0:e.role]),f=me().breakpoints.down("md");return e?o.jsxs(h,{...g,sx:{position:"relative",...g.sx},children:[o.jsx(be,{src:e==null?void 0:e.avatar,did:e==null?void 0:e.did,size:f?64:80,variant:"circle",shape:"circle",sx:{borderRadius:"100%",backgroundColor:"#fff",position:"relative",overflow:"hidden",mb:1.5,...i?{cursor:"pointer","&:hover":{"&::after":{content:`"${x("switchProfile")}"`}},"&::after":{color:"white",position:"absolute",fontSize:"12px",bottom:0,left:0,right:0,height:"50%",backgroundColor:"rgba(0, 0, 0, 0.3)",display:"flex",justifyContent:"center",alignItems:"center"}}:{}},onClick:i?c:N}),o.jsxs(B,{variant:"h6",sx:{fontWeight:"bold",display:"flex",alignItems:"center",gap:1,fontSize:"24px !important"},children:[e==null?void 0:e.fullName,i?o.jsx(ke,{label:(t==null?void 0:t.title)||(e==null?void 0:e.role)||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:m.textBase,borderColor:m.strokeBorderStrong,backgroundColor:"transparent",textTransform:"capitalize",pr:1,pl:.5,"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)"},"&:active":{boxShadow:"none"}},clickable:!0,deleteIcon:o.jsx(I,{icon:ye,color:m.textBase}),onDelete:u,onClick:u}):null]}),o.jsx(Ce,{did:e.did,showQrcode:!0,copyable:!0,compact:!l,responsive:!l,locale:n}),i?o.jsx(O,{sx:{borderRadius:2,color:m.textBase,backgroundColor:"white",border:`1px solid ${m.strokeBorderBase}`,position:"absolute",top:0,right:0},disableFocusRipple:!0,onClick:d,children:o.jsx(I,{icon:eo})}):null]}):null}function Co({data:e,...i}){return o.jsxs(h,{...i,sx:{display:"flex",alignItems:"center",justifyContent:"space-between",...i.sx},children:[o.jsxs(B,{sx:{display:"flex",alignItems:"center",color:m.textBase,fontSize:"14px",gap:1,fontWeight:500},children:[e.icon,e.title]}),o.jsx(B,{sx:{color:m.textSubtitle,whiteSpace:"pre-wrap",fontSize:"14px"},children:e.content})]})}function Po({user:e,...i}){const{locale:l}=U(),u=w((g,n={})=>L(D,g,l,"en",n)),c=k(()=>(e==null?void 0:e.sourceProvider)&&Pe[e.sourceProvider]||u("unknown"),[e==null?void 0:e.sourceProvider]),d=[];return d.push({icon:o.jsx(I,{fontSize:16,icon:ve}),title:u("email"),content:(e==null?void 0:e.email)||u("emptyField")}),d.push({icon:o.jsx(I,{fontSize:16,icon:oo}),title:u("lastLoginAt"),content:e!=null&&e.lastLoginAt?o.jsx(pe,{locale:l,value:e==null?void 0:e.lastLoginAt,relativeRange:3*86400*1e3}):u("unknown")}),d.push({icon:o.jsx(I,{fontSize:16,icon:to}),title:u("lastLoginIp"),content:(e==null?void 0:e.lastLoginIp)||u("unknown")}),d.push({icon:o.jsx(I,{fontSize:16,icon:ro}),title:u("createdAt"),content:e!=null&&e.createdAt?o.jsx(pe,{locale:l,value:e==null?void 0:e.createdAt}):u("unknown")}),d.push({icon:o.jsx(I,{fontSize:16,icon:no}),title:u("registerFrom"),content:c}),o.jsx(h,{...i,sx:{display:"flex",flexDirection:"column",gap:1.5,...i==null?void 0:i.sx},children:d.map(g=>o.jsx(Co,{data:g,sx:{flex:1}},g.title))})}const So=(e,i)=>{let l;return e==="default"?l=X.DEFAULT_COLORS["app-passport"]:e==="auto"?l=X.getNftBGColorFromDid(i):l=X.getNftBGColor(e),l},Io=({issuer:e="",title:i="",issuerDid:l="",issuerAvatarUrl:u="",ownerDid:c="",ownerName:d="",ownerAvatarUrl:g="",preferredColor:n="default",revoked:x=!1,isDataUrl:t=!1,width:p="100%",height:f="100%"})=>{const b=So(n,l),s=X.getSvg({width:p,height:f,tag:x?"revoked":"",tagVariant:x?"error":"info",color:b,did:c,variant:"app-passport",verifiable:!0,issuer:{name:e,icon:u},header:{name:i,icon:g},extra:{key:"Exp",value:"2123-01-01"}});return t?`data:image/svg+xml;utf8,${encodeURIComponent(s)}`:s},ee=e=>{const{response:i}=e;return i?`Request failed: ${i.status} ${i.statusText}: ${JSON.stringify(i.data)}`:e.message},Ao=e=>Io({...e,issuerAvatarUrl:Se(window.location.origin,Ie,"/blocklet/logo")});function Bo({user:e,...i}){var x,t;const{locale:l}=U(),u=w((p,f={})=>L(D,p,l,"en",f)),c=me(),d=k(()=>{const p=((e==null?void 0:e.passports)||[]).map(f=>({...f,revoked:f.status===Ae.REVOKED}));return p.sort((f,b)=>f.revoked===b.revoked?0:f.revoked?1:-1),go(p,"role")},[e==null?void 0:e.passports]),g=k(()=>d==null?void 0:d.find(p=>p.name===e.role),[d,e==null?void 0:e.role]),n=k(()=>{var p,f;return((f=(p=c==null?void 0:c.palette)==null?void 0:p.primary)==null?void 0:f.main)||m.textBase},[(t=(x=c==null?void 0:c.palette)==null?void 0:x.primary)==null?void 0:t.main]);return d.length===0?o.jsx(h,{children:o.jsx(J,{children:u("noPassport")})}):o.jsx(h,{...i,sx:{display:"grid",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(3, 1fr)",md:"repeat(2, 1fr)"},gap:2.5,...i.sx},children:d.map(p=>o.jsx(ao,{passport:p,user:e,color:window.blocklet.passportColor,createPassportSvg:Ao,title:g&&g.role===p.role?u("currentPassport"):"",sx:{flexDirection:"column",alignItems:"center",gap:1,".passport-item__display":{width:166,height:166,borderRadius:2,px:2,display:"flex",justifyContent:"center",backgroundColor:m.backgroundsBgComponent,boxShadow:g&&g.role===p.role?`0px 2px 4px 0px ${n}, 0px 1px 2px -1px ${n}, 0px 0px 0px 1px ${n} !important`:"unset"},".passport-item__body":{marginLeft:"0 !important"}}},p.id))})}function ge({onTest:e=N,onDelete:i=N,onSave:l=N,onCancel:u=N,type:c="slack",url:d="",edit:g=!1}){const{locale:n}=U(),x=w((r,v={})=>L(D,r,n,"en",v)),t=K({type:c||"slack",url:d||"",edit:g??!1,error:"",loading:!1}),p=w(()=>t.url?mo(t.url)?(t.error="",!0):(t.error=x("common.invalid"),!1):(t.error=x("common.required"),!1)),f=w(()=>{t.edit=!1,t.url=d||"",t.type=c||"slack",t.error="",t.loading=!1,u()}),b=w(async r=>{t.loading=!0,await e(r),t.loading=!1}),s=w(r=>()=>{p()&&r({type:t.type,url:t.url})}),a=k(()=>t.error?o.jsx(B,{component:"span",color:"error",children:t.error}):t.edit?t.loading?o.jsx(oe,{size:16}):o.jsx(O,{size:"small",onClick:s(b),sx:{mr:-1},children:o.jsx(I,{icon:io})}):null,[t.error,t.edit,t.loading]);return o.jsxs(h,{sx:{display:"flex",gap:1.5,width:"100%",alignItems:{xs:"flex-start",md:"center"},flexDirection:{xs:"column",md:"row"}},children:[o.jsxs(bo,{sx:{borderRadius:2,"&.Mui-disabled":{backgroundColor:m.backgroundsBgField}},disabled:!t.edit||t.loading,size:"small",value:t.type,onChange:r=>{t.type=r.target.value},children:[o.jsx(ue,{value:"api",children:x("webhook.url")}),o.jsx(ue,{value:"slack",children:x("webhook.slack")})]}),o.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:.5,width:"100%"},children:[o.jsx(vo,{sx:{flex:1,".MuiInputBase-root":{borderRadius:2,"&.Mui-disabled":{backgroundColor:m.backgroundsBgField}}},disabled:!t.edit||t.loading,fullWidth:!0,size:"small",required:!0,value:t.url,onChange:r=>{t.url=r.target.value,p()},error:!!t.error,InputProps:{endAdornment:o.jsx(jo,{position:"end",children:a})}}),o.jsx(h,{sx:{display:"flex",gap:.5},children:t.edit?o.jsxs(o.Fragment,{children:[o.jsx(O,{color:"success",onClick:s((...r)=>{l(...r),t.edit=!1}),sx:{borderRadius:2,border:`1px solid ${m.strokeBorderBase}`},children:o.jsx(I,{icon:Be})}),o.jsx(O,{color:"error",onClick:f,sx:{borderRadius:2,border:`1px solid ${m.strokeBorderBase}`},children:o.jsx(I,{icon:Re})})]}):o.jsxs(o.Fragment,{children:[o.jsx(O,{onClick:()=>{t.edit=!0},sx:{borderRadius:2,border:`1px solid ${m.strokeBorderBase}`},children:o.jsx(I,{icon:so})}),o.jsx(O,{color:"error",onClick:()=>{i({type:t.type,url:t.url})},sx:{borderRadius:2,border:`1px solid ${m.strokeBorderBase}`},children:o.jsx(I,{icon:lo})})]})})]})]})}function Ro({user:e}){var s,a;const{locale:i}=U(),l=w((r,v={})=>L(D,r,i,"en",v)),u=K({showAdd:!1}),c=Y(async()=>await H.user.getUserNotificationConfig(),{refreshDeps:[e],loadingDelay:300}),d=k(()=>{var r;return{wallet:!0,email:!0,phone:!1,...((r=c==null?void 0:c.data)==null?void 0:r.notifications)||{}}},[(s=c==null?void 0:c.data)==null?void 0:s.notifications]),g=k(()=>{var r;return((r=c==null?void 0:c.data)==null?void 0:r.webhooks)||[]},[(a=c==null?void 0:c.data)==null?void 0:a.webhooks]),n=w(async r=>{try{await H.user.saveUserNotificationConfig(r),W.success(l("saveSuccess")),c.run()}catch(v){W.error(ee(v))}}),x=w(async(r,v)=>{await n({notifications:{[r]:v}})}),t=async r=>{try{await H.user.testNotificationWebhook(r),W.success(l("webhookTested"))}catch(v){W.error(ee(v))}},p=w(async r=>{await n({webhooks:g.filter((v,j)=>j!==r)})}),f=w(async(r,v)=>{await n({webhooks:g.map((j,S)=>S===r?v:j)})}),b=w(async r=>{await n({webhooks:[...g,r]}),u.showAdd=!1});return c.error?o.jsx(wo,{severity:"error",children:c.error.message}):c.loading||!c.data?o.jsx(h,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px"},children:o.jsx(oe,{})}):o.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:2},children:[o.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:[o.jsx(Z,{checked:d.wallet,labelProps:{label:o.jsxs(B,{color:"text.primary",sx:{fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:[l("walletNotification"),xe(e)&&o.jsx(B,{component:"span",color:"text.secondary",fontSize:13,children:xe(e)})]})},size:"small",onChange:r=>x("wallet",r.target.checked)}),o.jsx(Z,{checked:d.email,labelProps:{label:o.jsxs(B,{color:"text.primary",sx:{fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:[l("emailNotification"),(e==null?void 0:e.email)&&o.jsx(B,{component:"span",color:"text.secondary",fontSize:13,children:e==null?void 0:e.email})]})},size:"small",onChange:r=>x("email",r.target.checked)})]}),o.jsx(Te,{}),o.jsxs(ko,{spacing:1.5,useFlexGap:!0,direction:"column",alignItems:"start",children:[g.map((r,v)=>o.jsx(ge,{onTest:t,onDelete:()=>p(v),onSave:(...j)=>f(v,...j),type:r.type,url:r.url,edit:!1},`${v}_${r.url}`)),u.showAdd&&o.jsx(ge,{onTest:t,onCancel:()=>{u.showAdd=!1},onSave:(...r)=>b(...r),edit:!0},"add"),o.jsx(te,{variant:"outlined",size:"small",sx:{color:m.foregroundsFgBase,borderColor:m.strokeBorderBase,backgroundColor:m.buttonsButtonNeutral,"&:hover":{borderColor:m.strokeBorderBase,backgroundColor:m.buttonsButtonNeutralHover},py:.5,borderRadius:2},startIcon:o.jsx(I,{icon:co}),onClick:()=>{u.showAdd=!0},children:l("addWebhook")})]})]})}function To({configList:e,onSave:i}){const[l,u]=G.useState(e),{locale:c}=U(),d=w((n,x={})=>L(D,n,c,"en",x)),g=w(async(n,x)=>{try{const t=await H.user.saveUserPrivacyConfig({[n]:!x});u(l.map(p=>({...p,value:(t==null?void 0:t[p.key])??p.value}))),W.success(d("saveSuccess")),i()}catch(t){W.error(ee(t))}});return o.jsx(h,{sx:{display:"flex",flexDirection:"column",gap:1,alignItems:"start",".MuiFormControlLabel-root":{gap:1,m:0,flexDirection:{xs:"row-reverse",md:"row"},width:{xs:"100%",md:"unset"}},".MuiSwitch-track":{borderRadius:"100vw"},".MuiSwitch-thumb":{borderRadius:"100%"},".MuiSwitch-root.MuiSwitch-sizeSmall":{height:"20px",width:"36px",".MuiSwitch-thumb":{width:"16px",height:"16px"}}},children:l.map(n=>o.jsx(Z,{checked:!n.value,labelProps:{label:o.jsx(B,{color:"text.primary",sx:{fontSize:14,display:"flex",flexFlow:"wrap",columnGap:1,flex:1},children:d("toPublic",{name:n.name})})},size:"small",onChange:x=>g(n.key,x.target.checked)},n.key))})}function zo({item:e}){var r,v,j,S,V;const{confirmApi:i,confirmHolder:l}=je(),u=K({loading:!1}),{locale:c}=U(),d=w((R,A={})=>L(D,R,c,"en",A)),{session:g}=G.useContext(re),{bindOAuth:n,unbindOAuth:x,setBaseUrl:t,baseUrl:p}=g.useOAuth(),f={[C.AUTH0]:ve,[C.APPLE]:Ue,[C.GITHUB]:Le,[C.GOOGLE]:De},b=k(()=>f[e==null?void 0:e.provider],[e==null?void 0:e.provider]),s=k(()=>ze[e==null?void 0:e.provider]||"unknown",[e==null?void 0:e.provider]),a=w(async()=>{try{u.loading=!0,await new Promise((R,A)=>{var T;if(e!=null&&e._bind)i.open({title:d("thirdPartyLogin.confirmUnbind",{name:s}),content:d("thirdPartyLogin.confirmUnbindDescription",{name:s}),confirmButtonText:d("common.confirm"),cancelButtonText:d("common.cancel"),onConfirm(E){x({session:g,connectedAccount:{...Ee(e,["did","pk"]),showProvider:e.provider,provider:e._rawProvider}}).then(R).catch(A),E()},onCancel:R});else{const E=p,q=window==null?void 0:window.blocklet;let M="/";const $=Fe(q),_=Me(q);$&&(_!=null&&_.appPid)&&((T=g==null?void 0:g.user)!=null&&T.sourceAppPid)&&(M=_.appUrl),t(M),n({session:g,oauthItem:{...e,provider:e._rawProvider}}).then(R).catch(A).finally(()=>{t(E)})}})}catch(R){console.error(`Failed to ${e!=null&&e._bind?"unbind":"bind"} oauth account`,R)}finally{u.loading=!1}});return o.jsxs(o.Fragment,{children:[o.jsxs(h,{sx:{borderRadius:2,border:`1px solid ${m.strokeBorderBase}`,background:m.backgroundsBgField,display:"flex",alignItems:"center",py:1,px:1.5,gap:.75,fontSize:"14px",lineHeight:1,overflow:"hidden"},children:[o.jsx(h,{component:I,icon:b,width:"1em",height:"1em",sx:{flexShrink:0,fontSize:16}}),o.jsx(h,{sx:{flex:1},children:s}),o.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:.5},children:[o.jsx(h,{sx:{flex:1,textOverflow:"ellipsis",overflow:"hidden",lineHeight:"normal"},children:((r=e.userInfo)==null?void 0:r.email)||e.did}),(v=e.userInfo)!=null&&v.email?o.jsx(he,{title:o.jsx(o.Fragment,{children:o.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.jsx(be,{size:36,variant:"circle",shape:"circle",src:(j=e.userInfo)==null?void 0:j.picture,did:e.did}),o.jsxs(h,{children:[o.jsx(B,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:(S=e.userInfo)==null?void 0:S.name}),o.jsx(B,{sx:{whiteSpace:"normal",wordBreak:"break-all",fontSize:"0.9rem"},children:(V=e.userInfo)==null?void 0:V.email})]})]})}),children:o.jsx(h,{component:I,icon:po,color:m.textSubtitle,fontSize:16,sx:{cursor:"pointer",flexShrink:0}})}):null]})]}),o.jsx(he,{title:e._mainProvider?d("thirdPartyLogin.mainProviderCantRemove"):"",children:o.jsx(h,{children:o.jsx(te,{variant:"outlined",size:"small",sx:{color:e!=null&&e._bind?m.red:m.foregroundsFgBase,borderColor:e!=null&&e._bind?m.red:m.strokeBorderBase,backgroundColor:m.buttonsButtonNeutral,"&:hover":{borderColor:e!=null&&e._bind?m.red:m.strokeBorderBase,backgroundColor:m.buttonsButtonNeutralHover},py:.5,borderRadius:2,fontWeight:500,whiteSpace:"nowrap"},fullWidth:!0,startIcon:u.loading?null:o.jsx(I,{icon:uo}),onClick:a,disabled:e._mainProvider,loading:u.loading,children:e!=null&&e._bind?d("thirdPartyLogin.disconnect"):d("thirdPartyLogin.connect")})})}),l]})}function Uo({user:e}){const{session:i}=G.useContext(re),[l,u]=G.useState({}),{getOAuthConfigs:c}=i.useOAuth();_e(async()=>{const n=await c({sourceAppPid:e==null?void 0:e.sourceAppPid});u(n)},[e==null?void 0:e.sourceAppPid]);const d=k(()=>Object.keys(l).map(x=>({...l[x],provider:x})).filter(x=>x.enabled),[l]),g=k(()=>{const n=Oe(e);let x=!1,t="",p=We(e);const f=n.find(s=>s.provider===C.AUTH0);return f&&(f.id.startsWith("google-oauth2|")&&(n.some(s=>s.provider==="google")||(x=!0,t=C.GOOGLE,p===C.AUTH0&&(p=C.GOOGLE))),f.id.startsWith("appleid|")&&(n.some(s=>s.provider===C.APPLE)||(x=!0,t=C.APPLE,p===C.AUTH0&&(p=C.APPLE))),f.id.startsWith("github|")&&(n.some(s=>s.provider===C.GITHUB)||(x=!0,t=C.GITHUB,p===C.AUTH0&&(p=C.GITHUB)))),d.map(s=>{if(s.provider===C.AUTH0&&x)return null;const a=x&&s.provider===t?n.find(r=>r.provider===C.AUTH0):n.find(r=>r.provider===s.provider);return a?{...s,provider:s.provider,did:a.did,pk:a.pk,userInfo:a.userInfo,_bind:!0,_rawProvider:a.provider,_mainProvider:s.provider===p}:{...s,provider:s.provider,_rawProvider:s.provider,_mainProvider:s.provider===p}}).filter(Boolean).sort((s,a)=>(s==null?void 0:s.order)!==void 0&&(a==null?void 0:a.order)!==void 0?s.order-a.order:(s==null?void 0:s.order)!==void 0?-1:1)},[e==null?void 0:e.connectedAccounts,d]);return o.jsx(h,{sx:{gap:1,display:"grid",gridTemplateColumns:"1fr min-content"},children:g.map(n=>o.jsx(zo,{item:n},n==null?void 0:n.provider))})}function Lo({user:e,settings:i,onSave:l,...u}){const{locale:c}=U(),d=w((f,b={})=>L(D,f,c,"en",b)),g=k(()=>((i==null?void 0:i.userCenterTabs)||[]).map(b=>({key:b.value,name:b.label,value:b.protected})),[i==null?void 0:i.userCenterTabs]),n=k(()=>{var f;return[{label:d("notificationManagement"),value:"notification",content:o.jsx(Ro,{user:e})},{label:d("thirdPartyLogin.title"),value:"thirdPartyLogin",content:o.jsx(Uo,{user:e})},{label:d("privacyManagement"),value:"privacy",content:o.jsx(To,{configList:g,onSave:l})},((f=e==null?void 0:e.didSpace)==null?void 0:f.endpoint)&&{label:d("storageManagement"),value:"storage",content:o.jsx(xo,{children:o.jsx(ho,{})})},{label:d("sessionManagement"),value:"session",content:o.jsx(yo,{user:e})}].filter(Boolean)},[e,g]),x=K({tab:n[0].value}),t=k(()=>n.find(f=>f.value===x.tab),[x.tab,n]),p=w(f=>{x.tab=f});return t&&o.jsxs(h,{...u,sx:{...u==null?void 0:u.sx,minWidth:{md:500},maxWidth:"100%"},children:[o.jsx(we,{variant:"card",tabs:n,current:t.value,onChange:p}),o.jsx(h,{mt:2.5,children:t.content})]})}function Do({children:e,notLoginContent:i=null,currentTab:l,contentProps:u={},disableAutoRedirect:c=!1,autoPopupSetting:d=!1,hideFooter:g=!1,headerProps:n={},footerProps:x={},userDid:t=void 0,stickySidebar:p=!1}){var ne,ae,ie,se,le,de;const{locale:f}=U(),b=w((y,P={})=>L(D,y,f,"en",P)),s=G.useContext(re),a=s==null?void 0:s.session,r=k(()=>{var z;if(t)return t;const y=window.location.href,P=He(y);return P!=null&&P.did?Array.isArray(P.did)?P.did[0]:P.did:(z=a==null?void 0:a.user)==null?void 0:z.did},[(ne=a==null?void 0:a.user)==null?void 0:ne.did,t]),v=k(()=>{var y;return a!=null&&a.user?r===((y=a==null?void 0:a.user)==null?void 0:y.did):!1},[r,(ae=a==null?void 0:a.user)==null?void 0:ae.did]),j=Y(async()=>{if(await $e(()=>a==null?void 0:a.initialized),v)return a.user;if(r)return H.user.getUserPublicInfo({did:r})},{refreshDeps:[r,v,a==null?void 0:a.initialized,a==null?void 0:a.user]}),S=Y(async()=>j.data&&l?await H.user.getUserPrivacyConfig({did:r}):null,{refreshDeps:[r,j.data,l],loadingDelay:300}),{confirmHolder:V,confirmApi:R}=je({sx:{".MuiDialog-paper":{borderRadius:2,maxWidth:1200},".ux-dialog_title":{fontWeight:600},".ux-dialog_closeButton":{p:1},".MuiDialogActions-root":{display:{xs:"none",md:"flex"}}}}),A=k(()=>{const y=Ne(window.blocklet);try{return Ye(y)}catch(P){return console.error("Failed to format blocklet info",P,y),y}},[]),T=k(()=>{var z;const y=((z=A==null?void 0:A.navigation)==null?void 0:z.userCenter)||[];return(Ze(y,f)||[]).map(F=>{var ce;const Q=F._rawLink??F.link;return{value:Q,label:F.title,url:F.link,protected:((ce=S==null?void 0:S.data)==null?void 0:ce[Q])??!1}})},[A,j.data,S==null?void 0:S.data,f]),E=k(()=>T.find(y=>y.value===l),[T]),q=w(y=>{const P=T.find(z=>z.value===y);P&&(window.location.href=qe(P.url,{did:v?void 0:r}))}),M=k(()=>o.jsx(Lo,{user:j.data,settings:{userCenterTabs:T},onSave:async()=>(await S.runAsync(),S.data)}),[j.data]),$=w(()=>{R.open({title:b("settings"),content:M,showCancelButton:!1,confirmButtonText:b("done"),onConfirm:R.close})});Ge(()=>{R.update({content:M})},[M]),Ve(()=>{d&&$()});const _=k(()=>{var y,P,z;if(j.loading||a.loading)return null;if(j.error){const Q={message:((P=(y=j.error.response)==null?void 0:y.data)==null?void 0:P.error)||j.error.message||"error occurred"};return o.jsx(h,{sx:{width:"100%"},children:o.jsx(fo,{error:Q})})}return!r&&!j.data?i||o.jsx(h,{sx:{width:"100%"},children:o.jsxs(h,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:1},children:[o.jsx(J,{children:b("viewAfterLogin")}),o.jsx(te,{size:"small",variant:"contained",onClick:()=>a.login(),children:b("loginNow")})]})}):o.jsxs(o.Fragment,{children:[o.jsxs(h,{sx:{flex:1,overflow:"hidden"},children:[(z=j==null?void 0:j.data)!=null&&z.fullName?o.jsx(B,{variant:"h4",sx:{py:1.5,fontWeight:700,display:{xs:"none",md:"block"}},children:j.data.fullName}):null,o.jsx(fe,{isMyself:v,switchPassport:a.switchPassport,switchProfile:a.switchProfile,openSettings:$,user:j.data,showFullDid:!1,sx:{display:{md:"none",xs:"block"},mb:1.5}}),T.length>0&&l?o.jsxs(h,{sx:{overflow:"auto",padding:"1px"},children:[o.jsx(we,{variant:"line",tabs:T,current:l,onChange:q,sx:{mb:1.5}}),!S.data||S.loading?o.jsx(h,{sx:{height:"100%",minWidth:"160px",minHeight:"160px",display:"flex",justifyContent:"center",alignItems:"center"},children:o.jsx(oe,{sx:{color:m.primary100}})}):o.jsx(o.Fragment,{children:E!=null&&E.protected&&!v?o.jsx(h,{children:o.jsx(J,{children:b("underProtected")})}):o.jsx(o.Fragment,{children:e&&o.jsx(h,{...u,children:e})})})]}):null,T.length===0?o.jsx(h,{sx:{display:{xs:v?"none":"block",md:"block"},py:3},children:o.jsx(J,{children:b("emptyContent")})}):null]}),o.jsx(h,{sx:{display:{xs:"none",md:"block"},width:"1px",my:-3,backgroundColor:m.strokeSep}}),o.jsx(h,{sx:{width:{sx:"100%",md:420},maxWidth:"100%",position:"relative"},children:o.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:2.5,position:{xs:"static",md:p?"sticky":"static"},top:F=>p?F.spacing(3):"unset"},children:[o.jsx(fe,{isMyself:v,switchPassport:a.switchPassport,switchProfile:a.switchProfile,openSettings:$,user:j.data,sx:{display:{xs:"none",md:"block"}}}),v?o.jsxs(o.Fragment,{children:[o.jsxs(h,{children:[o.jsx(B,{sx:{fontWeight:600,mb:1.5},children:b("myInfo")}),o.jsx(Po,{user:j.data})]}),o.jsxs(h,{children:[o.jsx(B,{sx:{fontWeight:600,mb:1.5},children:b("passport")}),o.jsx(Bo,{user:j.data})]})]}):null]})})]})},[j,T,v,E,S,l,p]);return!c&&!l&&((se=(ie=A==null?void 0:A.navigation)==null?void 0:ie.userCenter)==null?void 0:se.length)>0?(window.location.replace((de=(le=A==null?void 0:A.navigation)==null?void 0:le.userCenter[0])==null?void 0:de.link),null):o.jsxs(h,{sx:{backgroundColor:m.backgroundsBgSubtitle,minHeight:"100vh",display:"flex",flexDirection:"column"},children:[o.jsx(Je,{bordered:!0,...n}),o.jsxs(h,{flex:1,sx:{width:"100%",maxWidth:1200,margin:"0 auto",p:3,display:"flex",alignItems:"stretch",flexDirection:{xs:"column",md:"row"},gap:2.5},children:[_,V]}),g?null:o.jsx(Ke,{bordered:!0,...x})]})}function yt(){const i=Qe().tab,{t:l}=U();return o.jsxs(o.Fragment,{children:[o.jsx(Xe,{children:o.jsx("title",{children:l("pageTitle.userCenter")})}),o.jsx(Do,{disableAutoRedirect:i==="settings",autoPopupSetting:i==="settings"})]})}export{yt as default};
@@ -1 +1 @@
1
- import{f as S,j as a,B as m,A as J,a as R,T as B,be as q,M as L,g as G,u as H,bK as Y,h as E,O as K,b as O,bD as k,bA as Q,dJ as U}from"./index-CJG6DxXB.js";import{D as X}from"./index-Bvv7qWos.js";import{U as T,d as F}from"./resource-dialog-_K-j3Qk_.js";class Z extends Error{constructor(n){super(),this.name="AbortError",this.message=n}}const N=e=>globalThis.DOMException===void 0?new Z(e):new DOMException(e),M=e=>{const n=e.reason===void 0?N("This operation was aborted."):e.reason;return n instanceof Error?n:N(n)};async function ee(e,n,{concurrency:s=Number.POSITIVE_INFINITY,stopOnError:i=!0,signal:u}={}){return new Promise((w,C)=>{if(e[Symbol.iterator]===void 0&&e[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof e})`);if(typeof n!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(s)||s===Number.POSITIVE_INFINITY)&&s>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${s}\` (${typeof s})`);const r=[],A=[],g=new Map;let c=!1,x=!1,v=!1,y=0,b=0;const D=e[Symbol.iterator]===void 0?e[Symbol.asyncIterator]():e[Symbol.iterator](),h=t=>{c=!0,x=!0,C(t)};u&&(u.aborted&&h(M(u)),u.addEventListener("abort",()=>{h(M(u))}));const I=async()=>{if(x)return;const t=await D.next(),o=b;if(b++,t.done){if(v=!0,y===0&&!x){if(!i&&A.length>0){h(new AggregateError(A));return}if(x=!0,g.size===0){w(r);return}const l=[];for(const[d,p]of r.entries())g.get(d)!==z&&l.push(p);w(l)}return}y++,(async()=>{try{const l=await t.value;if(x)return;const d=await n(l,o);d===z&&g.set(o,d),r[o]=d,y--,await I()}catch(l){if(i)h(l);else{A.push(l),y--;try{await I()}catch(d){h(d)}}}})()};(async()=>{for(let t=0;t<s;t++){try{await I()}catch(o){h(o);break}if(v||c)break}})()})}const z=Symbol("skip");async function te(e,n){return ee(e,s=>s(),n)}function oe({user:e,sessionUser:n}){const s=S(()=>{var i;return(i=(e==null?void 0:e.passports)||[])==null?void 0:i.find(u=>u.name===n.role)},[e==null?void 0:e.passports,n==null?void 0:n.role]);return a.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(J,{size:40,variant:"circle",shape:"circle",src:n.avatar,did:n.did,sx:{flexShrink:0}}),a.jsxs(m,{sx:{flex:1,overflow:"hidden"},children:[a.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(R,{title:n.fullName,children:a.jsx(B,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:n.fullName})}),a.jsx(q,{label:(s==null?void 0:s.title)||(s==null?void 0:s.name)||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:L.textBase,borderColor:L.strokeBorderStrong,backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),a.jsx(R,{title:n.email,children:a.jsx(B,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.email})})]})]})}const ne={zh:{confirm:"确认",cancel:"取消",visitorId:"设备标识",deviceType:"设备类型",platform:"操作系统",walletOS:"钱包类型",role:"角色",fullname:"姓名",email:"邮箱",avatar:"头像",user:"用户",createdAt:"首次活动时间",updatedAt:"最近活动时间",lastLoginIp:"最近活动地址",actions:"操作",logoutAll:"注销所有会话",logoutAllTips:"不会注销当前会话",logout:"注销",currentSession:"当前会话",unknown:"未知",expired:"已过期",remove:"删除",logoutThisSession:"注销指定会话",logoutThisSessionConfirm:"确定要注销此会话吗?",logoutAllSession:"注销所有会话",logoutAllSessionConfirm:"确定要注销所有会话吗?"},en:{confirm:"Confirm",cancel:"Cancel",visitorId:"Device ID",deviceType:"Device Type",platform:"Platform",walletOS:"Wallet OS",role:"Role",fullname:"Fullname",email:"Email",avatar:"Avatar",user:"User",createdAt:"First Active Time",updatedAt:"Last Active Time",actions:"Actions",lastLoginIp:"Last Login IP",logoutAll:"Logout all",logoutAllTips:"Will not logout current session",logout:"Logout",currentSession:"Current Session",unknown:"Unknown",expired:"Expired",remove:"Remove",logoutThisSession:"Logout this session",logoutThisSessionConfirm:"Are you sure to logout this session?",logoutAllSession:"Logout all sessions",logoutAllSessionConfirm:"Are you sure to logout all sessions?"}},V="Reserved IP",P="ip-region-cache";async function re(e){const n=`https://ipapi.co/${e}/json/`,i=await(await fetch(n)).json();let u="";return i.error?i.reserved&&(u=V):u=[i.country_name,i.region,i.city].filter(Boolean).join("/"),u}async function se(e){const n=`https://api.ip.sb/geoip/${e}`,i=await(await fetch(n)).json();let u="";return i.error?i.reserved&&(u=V):u=[i.country,i.region,i.city].filter(Boolean).join("/"),u}async function ie(e){let n="",s={};try{const i=localStorage.getItem(P);i&&(s=JSON.parse(i))}catch{s={}}if(s[e])n=s[e];else{try{n=await se(e)}catch{console.warn("Fail to get ip region from ip.sb")}if(!n)try{n=await re(e)}catch{console.warn("Fail to get ip region from ip-api.co")}}if(n){const i=Object.keys(s);i.length>100&&delete s[i[0]],s[e]&&delete s[e],s[e]=n,localStorage.setItem(P,JSON.stringify(s))}return n}async function ae(e){return Promise.all(e.map(n=>ie(n)))}const W=e=>new T(e,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[T.BROWSER.NAME,T.BROWSER.VERSION]]}).getResult();function de({user:e,showAction:n=!0,showUser:s=!0}){const i=G(),{locale:u}=H(),{confirmApi:w,confirmHolder:C}=Y(),r=E((t,o={})=>Q(ne,t,u,"en",o)),A=E(async()=>{let t=e==null?void 0:e.userSessions;t||(t=await F.userSession.getUserSessions({did:e.did}));try{const l=t==null?void 0:t.map((f,j)=>[j,f.lastLoginIp]).filter(f=>!!f[1]),d=l==null?void 0:l.map(f=>f[1]),p=await ae(d);for(let f=0;f<p.length;f++){const j=p[f],_=l[f],$=t[_[0]];$.ipRegion=j}}catch(l){console.warn("Failed to convert ip to region"),console.error(l)}const o=new Date().getTime();return U(t,l=>l.visitorId===i?-1:o-new Date(l.updatedAt).getTime())}),g=K(A),c=S(()=>g.data||[],[g.data]),x=S(()=>c.reduce((t,o)=>(t[o.lastLoginIp]=o.ipRegion,t),{}),[c]),v=E(({visitorId:t})=>{w.open({title:r("logoutThisSession"),content:r("logoutThisSessionConfirm"),confirmButtonText:r("confirm"),cancelButtonText:r("cancel"),onConfirm:async()=>{await F.user.logout({visitorId:t}),g.refresh(),w.close()}})}),y=S(()=>c.filter(o=>o.visitorId!==i),[c]),b=E(()=>{w.open({title:r("logoutAllSession"),content:r("logoutAllSessionConfirm"),confirmButtonText:r("confirm"),cancelButtonText:r("cancel"),onConfirm:async()=>{const t=y.map(o=>()=>F.user.logout({visitorId:o.visitorId}));await te(t,{concurrency:3,stopOnError:!1}),g.refresh(),w.close()}})}),D=[];n&&D.push(a.jsx(R,{title:r("logoutAllTips"),children:a.jsx(O,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:b,disabled:y.length===0,children:r("logoutAll")})},"logoutAll"));const h=S(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600}),[]),I=[{label:r("platform"),name:"platform",options:{customBodyRenderLite:t=>{var d,p;const o=c[t],l=W(o.ua);return a.jsx(m,{children:[(d=l.os)==null?void 0:d.name,(p=l.os)==null?void 0:p.version].filter(Boolean).join("/")||r("unknown")})}}},{label:r("deviceType"),name:"deviceType",options:{customBodyRenderLite:t=>{var d,p;const o=c[t],l=W(o.ua);return a.jsx(m,{children:[(d=l.browser)==null?void 0:d.name,(p=l.browser)==null?void 0:p.version].filter(Boolean).join("/")||r("unknown")})}}},{label:r("walletOS"),name:"walletOS",options:{customBodyRenderLite:t=>{var l;const o=c[t];return a.jsx(m,{children:((l=o.extra)==null?void 0:l.walletOS)||r("unknown")})}}},s&&{label:r("user"),name:"user",options:{customBodyRenderLite:t=>{const o=c[t];return a.jsx(m,{sx:{minWidth:150,maxWidth:250},children:a.jsx(oe,{sessionUser:o.user,user:e})})}}},{label:r("createdAt"),name:"createdAt",options:{customBodyRenderLite:t=>{const o=c[t];return o.createdAt?a.jsx(k,{value:o.createdAt,relativeRange:3*86400*1e3,locale:u}):r("unknown")}}},{label:r("updatedAt"),name:"updatedAt",options:{customBodyRenderLite:t=>{const o=c[t];return o.status==="expired"?r("expired"):a.jsx(k,{value:o.updatedAt,relativeRange:3*86400*1e3,locale:u})}}},{label:r("lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:t=>{const o=c[t];return a.jsx(m,{children:x[o.lastLoginIp]?a.jsxs(a.Fragment,{children:[a.jsx(B,{variant:"body2",children:x[o.lastLoginIp]}),a.jsx(B,{variant:"body2",color:"grey",children:o.lastLoginIp||r("unknown")})]}):a.jsx(B,{children:o.lastLoginIp||r("unknown")})})}}},n&&{label:r("actions"),name:"actions",options:{customBodyRenderLite:t=>{const o=c[t];return a.jsx(m,{children:a.jsx(O,{sx:{whiteSpace:"nowrap",fontSize:"12px",px:1},disabled:i===o.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>v({visitorId:o.visitorId}),children:o.status==="expired"?r("remove"):i===o.visitorId?r("currentSession"):r("logout")})})}}}].filter(Boolean);return a.jsxs(m,{sx:{".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"}},children:[C,a.jsx(X,{locale:u,data:c,columns:I,customButtons:D,options:h,loading:g.loading})]})}export{de as U};
1
+ import{f as S,j as a,B as m,A as J,a as R,T as B,be as q,M as L,g as G,u as H,bK as Y,h as E,O as K,b as O,bD as k,bA as Q,dJ as U}from"./index-BvsLirqD.js";import{D as X}from"./index-B-MiDNZJ.js";import{U as T,d as F}from"./resource-dialog-CfRq8NMl.js";class Z extends Error{constructor(n){super(),this.name="AbortError",this.message=n}}const N=e=>globalThis.DOMException===void 0?new Z(e):new DOMException(e),M=e=>{const n=e.reason===void 0?N("This operation was aborted."):e.reason;return n instanceof Error?n:N(n)};async function ee(e,n,{concurrency:s=Number.POSITIVE_INFINITY,stopOnError:i=!0,signal:u}={}){return new Promise((w,C)=>{if(e[Symbol.iterator]===void 0&&e[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof e})`);if(typeof n!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(s)||s===Number.POSITIVE_INFINITY)&&s>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${s}\` (${typeof s})`);const r=[],A=[],g=new Map;let c=!1,x=!1,v=!1,y=0,b=0;const D=e[Symbol.iterator]===void 0?e[Symbol.asyncIterator]():e[Symbol.iterator](),h=t=>{c=!0,x=!0,C(t)};u&&(u.aborted&&h(M(u)),u.addEventListener("abort",()=>{h(M(u))}));const I=async()=>{if(x)return;const t=await D.next(),o=b;if(b++,t.done){if(v=!0,y===0&&!x){if(!i&&A.length>0){h(new AggregateError(A));return}if(x=!0,g.size===0){w(r);return}const l=[];for(const[d,p]of r.entries())g.get(d)!==z&&l.push(p);w(l)}return}y++,(async()=>{try{const l=await t.value;if(x)return;const d=await n(l,o);d===z&&g.set(o,d),r[o]=d,y--,await I()}catch(l){if(i)h(l);else{A.push(l),y--;try{await I()}catch(d){h(d)}}}})()};(async()=>{for(let t=0;t<s;t++){try{await I()}catch(o){h(o);break}if(v||c)break}})()})}const z=Symbol("skip");async function te(e,n){return ee(e,s=>s(),n)}function oe({user:e,sessionUser:n}){const s=S(()=>{var i;return(i=(e==null?void 0:e.passports)||[])==null?void 0:i.find(u=>u.name===n.role)},[e==null?void 0:e.passports,n==null?void 0:n.role]);return a.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(J,{size:40,variant:"circle",shape:"circle",src:n.avatar,did:n.did,sx:{flexShrink:0}}),a.jsxs(m,{sx:{flex:1,overflow:"hidden"},children:[a.jsxs(m,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(R,{title:n.fullName,children:a.jsx(B,{sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",flex:1},children:n.fullName})}),a.jsx(q,{label:(s==null?void 0:s.title)||(s==null?void 0:s.name)||"Guest",size:"small",variant:"outlined",sx:{flexShrink:0,fontWeight:"bold",fontSize:"12px",color:L.textBase,borderColor:L.strokeBorderStrong,backgroundColor:"transparent",textTransform:"capitalize",pr:.5,pl:0,height:"auto"}})]}),a.jsx(R,{title:n.email,children:a.jsx(B,{variant:"body2",color:"grey",sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n.email})})]})]})}const ne={zh:{confirm:"确认",cancel:"取消",visitorId:"设备标识",deviceType:"设备类型",platform:"操作系统",walletOS:"钱包类型",role:"角色",fullname:"姓名",email:"邮箱",avatar:"头像",user:"用户",createdAt:"首次活动时间",updatedAt:"最近活动时间",lastLoginIp:"最近活动地址",actions:"操作",logoutAll:"注销所有会话",logoutAllTips:"不会注销当前会话",logout:"注销",currentSession:"当前会话",unknown:"未知",expired:"已过期",remove:"删除",logoutThisSession:"注销指定会话",logoutThisSessionConfirm:"确定要注销此会话吗?",logoutAllSession:"注销所有会话",logoutAllSessionConfirm:"确定要注销所有会话吗?"},en:{confirm:"Confirm",cancel:"Cancel",visitorId:"Device ID",deviceType:"Device Type",platform:"Platform",walletOS:"Wallet OS",role:"Role",fullname:"Fullname",email:"Email",avatar:"Avatar",user:"User",createdAt:"First Active Time",updatedAt:"Last Active Time",actions:"Actions",lastLoginIp:"Last Login IP",logoutAll:"Logout all",logoutAllTips:"Will not logout current session",logout:"Logout",currentSession:"Current Session",unknown:"Unknown",expired:"Expired",remove:"Remove",logoutThisSession:"Logout this session",logoutThisSessionConfirm:"Are you sure to logout this session?",logoutAllSession:"Logout all sessions",logoutAllSessionConfirm:"Are you sure to logout all sessions?"}},V="Reserved IP",P="ip-region-cache";async function re(e){const n=`https://ipapi.co/${e}/json/`,i=await(await fetch(n)).json();let u="";return i.error?i.reserved&&(u=V):u=[i.country_name,i.region,i.city].filter(Boolean).join("/"),u}async function se(e){const n=`https://api.ip.sb/geoip/${e}`,i=await(await fetch(n)).json();let u="";return i.error?i.reserved&&(u=V):u=[i.country,i.region,i.city].filter(Boolean).join("/"),u}async function ie(e){let n="",s={};try{const i=localStorage.getItem(P);i&&(s=JSON.parse(i))}catch{s={}}if(s[e])n=s[e];else{try{n=await se(e)}catch{console.warn("Fail to get ip region from ip.sb")}if(!n)try{n=await re(e)}catch{console.warn("Fail to get ip region from ip-api.co")}}if(n){const i=Object.keys(s);i.length>100&&delete s[i[0]],s[e]&&delete s[e],s[e]=n,localStorage.setItem(P,JSON.stringify(s))}return n}async function ae(e){return Promise.all(e.map(n=>ie(n)))}const W=e=>new T(e,{browser:[[/(ArcWallet)\/([\w\.]+)/i],[T.BROWSER.NAME,T.BROWSER.VERSION]]}).getResult();function de({user:e,showAction:n=!0,showUser:s=!0}){const i=G(),{locale:u}=H(),{confirmApi:w,confirmHolder:C}=Y(),r=E((t,o={})=>Q(ne,t,u,"en",o)),A=E(async()=>{let t=e==null?void 0:e.userSessions;t||(t=await F.userSession.getUserSessions({did:e.did}));try{const l=t==null?void 0:t.map((f,j)=>[j,f.lastLoginIp]).filter(f=>!!f[1]),d=l==null?void 0:l.map(f=>f[1]),p=await ae(d);for(let f=0;f<p.length;f++){const j=p[f],_=l[f],$=t[_[0]];$.ipRegion=j}}catch(l){console.warn("Failed to convert ip to region"),console.error(l)}const o=new Date().getTime();return U(t,l=>l.visitorId===i?-1:o-new Date(l.updatedAt).getTime())}),g=K(A),c=S(()=>g.data||[],[g.data]),x=S(()=>c.reduce((t,o)=>(t[o.lastLoginIp]=o.ipRegion,t),{}),[c]),v=E(({visitorId:t})=>{w.open({title:r("logoutThisSession"),content:r("logoutThisSessionConfirm"),confirmButtonText:r("confirm"),cancelButtonText:r("cancel"),onConfirm:async()=>{await F.user.logout({visitorId:t}),g.refresh(),w.close()}})}),y=S(()=>c.filter(o=>o.visitorId!==i),[c]),b=E(()=>{w.open({title:r("logoutAllSession"),content:r("logoutAllSessionConfirm"),confirmButtonText:r("confirm"),cancelButtonText:r("cancel"),onConfirm:async()=>{const t=y.map(o=>()=>F.user.logout({visitorId:o.visitorId}));await te(t,{concurrency:3,stopOnError:!1}),g.refresh(),w.close()}})}),D=[];n&&D.push(a.jsx(R,{title:r("logoutAllTips"),children:a.jsx(O,{sx:{ml:.5},size:"small",variant:"contained",color:"error",onClick:b,disabled:y.length===0,children:r("logoutAll")})},"logoutAll"));const h=S(()=>({search:!1,sort:!1,download:!1,filter:!1,print:!1,expandableRowsOnClick:!1,searchDebounceTime:600}),[]),I=[{label:r("platform"),name:"platform",options:{customBodyRenderLite:t=>{var d,p;const o=c[t],l=W(o.ua);return a.jsx(m,{children:[(d=l.os)==null?void 0:d.name,(p=l.os)==null?void 0:p.version].filter(Boolean).join("/")||r("unknown")})}}},{label:r("deviceType"),name:"deviceType",options:{customBodyRenderLite:t=>{var d,p;const o=c[t],l=W(o.ua);return a.jsx(m,{children:[(d=l.browser)==null?void 0:d.name,(p=l.browser)==null?void 0:p.version].filter(Boolean).join("/")||r("unknown")})}}},{label:r("walletOS"),name:"walletOS",options:{customBodyRenderLite:t=>{var l;const o=c[t];return a.jsx(m,{children:((l=o.extra)==null?void 0:l.walletOS)||r("unknown")})}}},s&&{label:r("user"),name:"user",options:{customBodyRenderLite:t=>{const o=c[t];return a.jsx(m,{sx:{minWidth:150,maxWidth:250},children:a.jsx(oe,{sessionUser:o.user,user:e})})}}},{label:r("createdAt"),name:"createdAt",options:{customBodyRenderLite:t=>{const o=c[t];return o.createdAt?a.jsx(k,{value:o.createdAt,relativeRange:3*86400*1e3,locale:u}):r("unknown")}}},{label:r("updatedAt"),name:"updatedAt",options:{customBodyRenderLite:t=>{const o=c[t];return o.status==="expired"?r("expired"):a.jsx(k,{value:o.updatedAt,relativeRange:3*86400*1e3,locale:u})}}},{label:r("lastLoginIp"),name:"lastLoginIp",options:{customBodyRenderLite:t=>{const o=c[t];return a.jsx(m,{children:x[o.lastLoginIp]?a.jsxs(a.Fragment,{children:[a.jsx(B,{variant:"body2",children:x[o.lastLoginIp]}),a.jsx(B,{variant:"body2",color:"grey",children:o.lastLoginIp||r("unknown")})]}):a.jsx(B,{children:o.lastLoginIp||r("unknown")})})}}},n&&{label:r("actions"),name:"actions",options:{customBodyRenderLite:t=>{const o=c[t];return a.jsx(m,{children:a.jsx(O,{sx:{whiteSpace:"nowrap",fontSize:"12px",px:1},disabled:i===o.visitorId,variant:"outlined",size:"small",color:"error",onClick:()=>v({visitorId:o.visitorId}),children:o.status==="expired"?r("remove"):i===o.visitorId?r("currentSession"):r("logout")})})}}}].filter(Boolean);return a.jsxs(m,{sx:{".MuiTableCell-head":{whiteSpace:"nowrap",fontWeight:"bold"}},children:[C,a.jsx(X,{locale:u,data:c,columns:I,customButtons:D,options:h,loading:g.loading})]})}export{de as U};
@@ -1 +1 @@
1
- import{b4 as s,e$ as h,f0 as l,a9 as P,E as u}from"./index-CJG6DxXB.js";const d=h;var E=(e,r)=>d(e)===d(r);const c=s(E),x=(e,r)=>{if(e.type===u.ROUTING_RULE_TYPES.REDIRECT){if(!e.url)return new Error(`${r("router.validation.redirectUrlRequired")}`);if(!e.redirectCode)return new Error(`redirect ${r("router.validation.redirectCodeRequired")}`)}else if(e.type===u.ROUTING_RULE_TYPES.BLOCKLET&&!e.did)return new Error(r("router.validation.didRequired"));return null},R=(e,r)=>{const t=x(e,r);return t||(e.pathPrefix.length?e.pathPrefix.length>150?new Error(r("router.validation.pathPrefixTooLong",{length:150})):null:new Error(r("router.validation.pathPrefixCannotBeEmpty")))},v=({params:e,blocklets:r,blocklet:t,locale:o="en"})=>{if(t){let i=(t.children||[]).find(f=>l.hasStartEngine(f.meta)&&c(f.mountPoint,e.pathPrefix));if(t.meta.group!=="gateway"&&e.pathPrefix==="/"&&(i="/"),i)return{zh:`挂载点 ${e.pathPrefix} 已存在,请使用其他挂载点`,en:`The mount point ${e.pathPrefix} already exist, please use another mount point`}[o]}const a=r.find(i=>i.meta.did===e.did);if(!a)return"";const n=a.meta.interfaces.find(i=>i.type==="web");return n&&n.prefix!==P.BLOCKLET_DYNAMIC_PATH_PREFIX&&e.pathPrefix!==n.prefix?{zh:`该 blocklet 只能挂载在 ${n.prefix}`,en:`This blocklet can only be mounted on ${n.prefix}`}[o]:""},T=e=>{if(!e||typeof e!="string")return e;let r=e.trim();try{return r=r.toLowerCase(),r.startsWith("http://")||r.startsWith("https://")?new URL(r).hostname:r}catch(t){return console.error("format domain failed",t),r}};export{R as a,T as p,v};
1
+ import{b4 as s,e$ as h,f0 as l,a9 as P,E as u}from"./index-BvsLirqD.js";const d=h;var E=(e,r)=>d(e)===d(r);const c=s(E),x=(e,r)=>{if(e.type===u.ROUTING_RULE_TYPES.REDIRECT){if(!e.url)return new Error(`${r("router.validation.redirectUrlRequired")}`);if(!e.redirectCode)return new Error(`redirect ${r("router.validation.redirectCodeRequired")}`)}else if(e.type===u.ROUTING_RULE_TYPES.BLOCKLET&&!e.did)return new Error(r("router.validation.didRequired"));return null},R=(e,r)=>{const t=x(e,r);return t||(e.pathPrefix.length?e.pathPrefix.length>150?new Error(r("router.validation.pathPrefixTooLong",{length:150})):null:new Error(r("router.validation.pathPrefixCannotBeEmpty")))},v=({params:e,blocklets:r,blocklet:t,locale:o="en"})=>{if(t){let i=(t.children||[]).find(f=>l.hasStartEngine(f.meta)&&c(f.mountPoint,e.pathPrefix));if(t.meta.group!=="gateway"&&e.pathPrefix==="/"&&(i="/"),i)return{zh:`挂载点 ${e.pathPrefix} 已存在,请使用其他挂载点`,en:`The mount point ${e.pathPrefix} already exist, please use another mount point`}[o]}const a=r.find(i=>i.meta.did===e.did);if(!a)return"";const n=a.meta.interfaces.find(i=>i.type==="web");return n&&n.prefix!==P.BLOCKLET_DYNAMIC_PATH_PREFIX&&e.pathPrefix!==n.prefix?{zh:`该 blocklet 只能挂载在 ${n.prefix}`,en:`This blocklet can only be mounted on ${n.prefix}`}[o]:""},T=e=>{if(!e||typeof e!="string")return e;let r=e.trim();try{return r=r.toLowerCase(),r.startsWith("http://")||r.startsWith("https://")?new URL(r).hostname:r}catch(t){return console.error("format domain failed",t),r}};export{R as a,T as p,v};
@@ -1 +1 @@
1
- import{av as _,aw as i,a2 as e,j as r,ax as a}from"./index-CJG6DxXB.js";const u={en:_(i),ar:()=>e(()=>import("./ar-DXpJw3XU.js"),[]).then(t=>_(t.default)),de:()=>e(()=>import("./de-CWxlIdre.js"),[]).then(t=>_(t.default)),es:()=>e(()=>import("./es-BmrvDK07.js"),[]).then(t=>_(t.default)),fr:()=>e(()=>import("./fr-B7SxgRy3.js"),[]).then(t=>_(t.default)),hi:()=>e(()=>import("./hi-BRRtNIB_.js"),[]).then(t=>_(t.default)),id:()=>e(()=>import("./id-D6-Qi7Q1.js"),[]).then(t=>_(t.default)),ja:()=>e(()=>import("./ja--dtwu5Xy.js"),[]).then(t=>_(t.default)),ko:()=>e(()=>import("./ko-DpRJDWhF.js"),[]).then(t=>_(t.default)),pt:()=>e(()=>import("./pt-BxA88dKG.js"),[]).then(t=>_(t.default)),ru:()=>e(()=>import("./ru-C9WJaQoQ.js"),[]).then(t=>_(t.default)),th:()=>e(()=>import("./th-z7LSYRZi.js"),[]).then(t=>_(t.default)),vi:()=>e(()=>import("./vi-CAtyUyNW.js"),[]).then(t=>_(t.default)),"zh-TW":()=>e(()=>import("./zh-tw-CoStw7dd.js"),[]).then(t=>_(t.default)),zh:()=>e(()=>import("./zh-BVBeddUa.js"),[]).then(t=>_(t.default))};function E(t){return function(o){return r.jsx(a,{translations:u,children:r.jsx(t,{...o})})}}export{E as w};
1
+ import{av as _,aw as i,a2 as e,j as r,ax as a}from"./index-BvsLirqD.js";const u={en:_(i),ar:()=>e(()=>import("./ar-DXpJw3XU.js"),[]).then(t=>_(t.default)),de:()=>e(()=>import("./de-CWxlIdre.js"),[]).then(t=>_(t.default)),es:()=>e(()=>import("./es-BmrvDK07.js"),[]).then(t=>_(t.default)),fr:()=>e(()=>import("./fr-B7SxgRy3.js"),[]).then(t=>_(t.default)),hi:()=>e(()=>import("./hi-BRRtNIB_.js"),[]).then(t=>_(t.default)),id:()=>e(()=>import("./id-D6-Qi7Q1.js"),[]).then(t=>_(t.default)),ja:()=>e(()=>import("./ja--dtwu5Xy.js"),[]).then(t=>_(t.default)),ko:()=>e(()=>import("./ko-DpRJDWhF.js"),[]).then(t=>_(t.default)),pt:()=>e(()=>import("./pt-BxA88dKG.js"),[]).then(t=>_(t.default)),ru:()=>e(()=>import("./ru-C9WJaQoQ.js"),[]).then(t=>_(t.default)),th:()=>e(()=>import("./th-z7LSYRZi.js"),[]).then(t=>_(t.default)),vi:()=>e(()=>import("./vi-CAtyUyNW.js"),[]).then(t=>_(t.default)),"zh-TW":()=>e(()=>import("./zh-tw-CoStw7dd.js"),[]).then(t=>_(t.default)),zh:()=>e(()=>import("./zh-BVBeddUa.js"),[]).then(t=>_(t.default))};function E(t){return function(o){return r.jsx(a,{translations:u,children:r.jsx(t,{...o})})}}export{E as w};
package/dist/index.html CHANGED
@@ -13,7 +13,7 @@
13
13
  padding: 0;
14
14
  }
15
15
  </style>
16
- <script type="module" crossorigin src="/.well-known/service/static/assets/index-CJG6DxXB.js"></script>
16
+ <script type="module" crossorigin src="/.well-known/service/static/assets/index-BvsLirqD.js"></script>
17
17
  <link rel="stylesheet" crossorigin href="/.well-known/service/static/assets/index-CCovGSMB.css">
18
18
  <link rel="manifest" href="/.well-known/service/static/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/.well-known/service/static/registerSW.js"></script></head>
19
19
 
@@ -1,2 +1,2 @@
1
1
  try{self["workbox:core:7.0.0"]&&_()}catch{}const ae=(s,...e)=>{let t=s;return e.length>0&&(t+=` :: ${JSON.stringify(e)}`),t},ne=ae;let y=class extends Error{constructor(e,t){const r=ne(e,t);super(r),this.name=e,this.details=t}};const ie=new Set,d={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:typeof registration<"u"?registration.scope:""},N=s=>[d.prefix,s,d.suffix].filter(e=>e&&e.length>0).join("-"),ce=s=>{for(const e of Object.keys(d))s(e)},oe={updateDetails:s=>{ce(e=>{typeof s[e]=="string"&&(d[e]=s[e])})},getGoogleAnalyticsName:s=>s||N(d.googleAnalytics),getPrecacheName:s=>s||N(d.precache),getPrefix:()=>d.prefix,getRuntimeName:s=>s||N(d.runtime),getSuffix:()=>d.suffix};function $(s,e){const t=new URL(s);for(const r of e)t.searchParams.delete(r);return t.href}async function le(s,e,t,r){const a=$(e.url,t);if(e.url===a)return s.match(e,r);const i=Object.assign(Object.assign({},r),{ignoreSearch:!0}),n=await s.keys(e,i);for(const c of n){const o=$(c.url,t);if(a===o)return s.match(c,r)}}let he=class{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};async function ue(){for(const s of ie)await s()}const fe=s=>new URL(String(s),location.href).href.replace(new RegExp(`^${location.origin}`),"");function de(s){return new Promise(e=>setTimeout(e,s))}function pe(){self.addEventListener("activate",()=>self.clients.claim())}try{self["workbox:core:7.0.0"]&&_()}catch{}const ge=(s,...e)=>{let t=s;return e.length>0&&(t+=` :: ${JSON.stringify(e)}`),t},me=ge;let u=class extends Error{constructor(e,t){const r=me(e,t);super(r),this.name=e,this.details=t}};const p={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:typeof registration<"u"?registration.scope:""},M=s=>[p.prefix,s,p.suffix].filter(e=>e&&e.length>0).join("-"),we=s=>{for(const e of Object.keys(p))s(e)},j={updateDetails:s=>{we(e=>{typeof s[e]=="string"&&(p[e]=s[e])})},getGoogleAnalyticsName:s=>s||M(p.googleAnalytics),getPrecacheName:s=>s||M(p.precache),getPrefix:()=>p.prefix,getRuntimeName:s=>s||M(p.runtime),getSuffix:()=>p.suffix};function H(s,e){const t=e();return s.waitUntil(t),t}try{self["workbox:precaching:7.0.0"]&&_()}catch{}const ye="__WB_REVISION__";function _e(s){if(!s)throw new u("add-to-cache-list-unexpected-type",{entry:s});if(typeof s=="string"){const i=new URL(s,location.href);return{cacheKey:i.href,url:i.href}}const{revision:e,url:t}=s;if(!t)throw new u("add-to-cache-list-unexpected-type",{entry:s});if(!e){const i=new URL(t,location.href);return{cacheKey:i.href,url:i.href}}const r=new URL(t,location.href),a=new URL(t,location.href);return r.searchParams.set(ye,e),{cacheKey:r.href,url:a.href}}class Re{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:r})=>{if(e.type==="install"&&t&&t.originalRequest&&t.originalRequest instanceof Request){const a=t.originalRequest.url;r?this.notUpdatedURLs.push(a):this.updatedURLs.push(a)}return r}}}class be{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:t,params:r})=>{const a=(r==null?void 0:r.cacheKey)||this._precacheController.getCacheKeyForURL(t.url);return a?new Request(a,{headers:t.headers}):t},this._precacheController=e}}let b;function Ce(){if(b===void 0){const s=new Response("");if("body"in s)try{new Response(s.body),b=!0}catch{b=!1}b=!1}return b}async function xe(s,e){let t=null;if(s.url&&(t=new URL(s.url).origin),t!==self.location.origin)throw new u("cross-origin-copy-response",{origin:t});const r=s.clone(),a={headers:new Headers(r.headers),status:r.status,statusText:r.statusText},i=e?e(a):a,n=Ce()?r.body:await r.blob();return new Response(n,i)}const ke=s=>new URL(String(s),location.href).href.replace(new RegExp(`^${location.origin}`),"");function B(s,e){const t=new URL(s);for(const r of e)t.searchParams.delete(r);return t.href}async function Ee(s,e,t,r){const a=B(e.url,t);if(e.url===a)return s.match(e,r);const i=Object.assign(Object.assign({},r),{ignoreSearch:!0}),n=await s.keys(e,i);for(const c of n){const o=B(c.url,t);if(a===o)return s.match(c,r)}}class De{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}const Ue=new Set;async function Le(){for(const s of Ue)await s()}function Pe(s){return new Promise(e=>setTimeout(e,s))}try{self["workbox:strategies:7.0.0"]&&_()}catch{}function D(s){return typeof s=="string"?new Request(s):s}let ve=class{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new De,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const r of this._plugins)this._pluginStateMap.set(r,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:t}=this;let r=D(e);if(r.mode==="navigate"&&t instanceof FetchEvent&&t.preloadResponse){const n=await t.preloadResponse;if(n)return n}const a=this.hasCallback("fetchDidFail")?r.clone():null;try{for(const n of this.iterateCallbacks("requestWillFetch"))r=await n({request:r.clone(),event:t})}catch(n){if(n instanceof Error)throw new u("plugin-error-request-will-fetch",{thrownErrorMessage:n.message})}const i=r.clone();try{let n;n=await fetch(r,r.mode==="navigate"?void 0:this._strategy.fetchOptions);for(const c of this.iterateCallbacks("fetchDidSucceed"))n=await c({event:t,request:i,response:n});return n}catch(n){throw a&&await this.runCallbacks("fetchDidFail",{error:n,event:t,originalRequest:a.clone(),request:i.clone()}),n}}async fetchAndCachePut(e){const t=await this.fetch(e),r=t.clone();return this.waitUntil(this.cachePut(e,r)),t}async cacheMatch(e){const t=D(e);let r;const{cacheName:a,matchOptions:i}=this._strategy,n=await this.getCacheKey(t,"read"),c=Object.assign(Object.assign({},i),{cacheName:a});r=await caches.match(n,c);for(const o of this.iterateCallbacks("cachedResponseWillBeUsed"))r=await o({cacheName:a,matchOptions:i,cachedResponse:r,request:n,event:this.event})||void 0;return r}async cachePut(e,t){const r=D(e);await Pe(0);const a=await this.getCacheKey(r,"write");if(!t)throw new u("cache-put-with-no-response",{url:ke(a.url)});const i=await this._ensureResponseSafeToCache(t);if(!i)return!1;const{cacheName:n,matchOptions:c}=this._strategy,o=await self.caches.open(n),l=this.hasCallback("cacheDidUpdate"),f=l?await Ee(o,a.clone(),["__WB_REVISION__"],c):null;try{await o.put(a,l?i.clone():i)}catch(h){if(h instanceof Error)throw h.name==="QuotaExceededError"&&await Le(),h}for(const h of this.iterateCallbacks("cacheDidUpdate"))await h({cacheName:n,oldResponse:f,newResponse:i.clone(),request:a,event:this.event});return!0}async getCacheKey(e,t){const r=`${e.url} | ${t}`;if(!this._cacheKeys[r]){let a=e;for(const i of this.iterateCallbacks("cacheKeyWillBeUsed"))a=D(await i({mode:t,request:a,event:this.event,params:this.params}));this._cacheKeys[r]=a}return this._cacheKeys[r]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const r of this.iterateCallbacks(e))await r(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if(typeof t[e]=="function"){const r=this._pluginStateMap.get(t);yield i=>{const n=Object.assign(Object.assign({},i),{state:r});return t[e](n)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,r=!1;for(const a of this.iterateCallbacks("cacheWillUpdate"))if(t=await a({request:this.request,response:t,event:this.event})||void 0,r=!0,!t)break;return r||t&&t.status!==200&&(t=void 0),t}},Ne=class{constructor(e={}){this.cacheName=j.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,r=typeof e.request=="string"?new Request(e.request):e.request,a="params"in e?e.params:void 0,i=new ve(this,{event:t,request:r,params:a}),n=this._getResponse(i,r,t),c=this._awaitComplete(n,i,r,t);return[n,c]}async _getResponse(e,t,r){await e.runCallbacks("handlerWillStart",{event:r,request:t});let a;try{if(a=await this._handle(t,e),!a||a.type==="error")throw new u("no-response",{url:t.url})}catch(i){if(i instanceof Error){for(const n of e.iterateCallbacks("handlerDidError"))if(a=await n({error:i,event:r,request:t}),a)break}if(!a)throw i}for(const i of e.iterateCallbacks("handlerWillRespond"))a=await i({event:r,request:t,response:a});return a}async _awaitComplete(e,t,r,a){let i,n;try{i=await e}catch{}try{await t.runCallbacks("handlerDidRespond",{event:a,request:r,response:i}),await t.doneWaiting()}catch(c){c instanceof Error&&(n=c)}if(await t.runCallbacks("handlerDidComplete",{event:a,request:r,response:i,error:n}),t.destroy(),n)throw n}};class w extends Ne{constructor(e={}){e.cacheName=j.getPrecacheName(e.cacheName),super(e),this._fallbackToNetwork=e.fallbackToNetwork!==!1,this.plugins.push(w.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const r=await t.cacheMatch(e);return r||(t.event&&t.event.type==="install"?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,t){let r;const a=t.params||{};if(this._fallbackToNetwork){const i=a.integrity,n=e.integrity,c=!n||n===i;r=await t.fetch(new Request(e,{integrity:e.mode!=="no-cors"?n||i:void 0})),i&&c&&e.mode!=="no-cors"&&(this._useDefaultCacheabilityPluginIfNeeded(),await t.cachePut(e,r.clone()))}else throw new u("missing-precache-entry",{cacheName:this.cacheName,url:e.url});return r}async _handleInstall(e,t){this._useDefaultCacheabilityPluginIfNeeded();const r=await t.fetch(e);if(!await t.cachePut(e,r.clone()))throw new u("bad-precaching-response",{url:e.url,status:r.status});return r}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[r,a]of this.plugins.entries())a!==w.copyRedirectedCacheableResponsesPlugin&&(a===w.defaultPrecacheCacheabilityPlugin&&(e=r),a.cacheWillUpdate&&t++);t===0?this.plugins.push(w.defaultPrecacheCacheabilityPlugin):t>1&&e!==null&&this.plugins.splice(e,1)}}w.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:s}){return!s||s.status>=400?null:s}};w.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:s}){return s.redirected?await xe(s):s}};class Me{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:r=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new w({cacheName:j.getPrecacheName(e),plugins:[...t,new be({precacheController:this})],fallbackToNetwork:r}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){const t=[];for(const r of e){typeof r=="string"?t.push(r):r&&r.revision===void 0&&t.push(r.url);const{cacheKey:a,url:i}=_e(r),n=typeof r!="string"&&r.revision?"reload":"default";if(this._urlsToCacheKeys.has(i)&&this._urlsToCacheKeys.get(i)!==a)throw new u("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(i),secondEntry:a});if(typeof r!="string"&&r.integrity){if(this._cacheKeysToIntegrities.has(a)&&this._cacheKeysToIntegrities.get(a)!==r.integrity)throw new u("add-to-cache-list-conflicting-integrities",{url:i});this._cacheKeysToIntegrities.set(a,r.integrity)}if(this._urlsToCacheKeys.set(i,a),this._urlsToCacheModes.set(i,n),t.length>0){const c=`Workbox is precaching URLs without revision info: ${t.join(", ")}
2
- This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(c)}}}install(e){return H(e,async()=>{const t=new Re;this.strategy.plugins.push(t);for(const[i,n]of this._urlsToCacheKeys){const c=this._cacheKeysToIntegrities.get(n),o=this._urlsToCacheModes.get(i),l=new Request(i,{integrity:c,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:n},request:l,event:e}))}const{updatedURLs:r,notUpdatedURLs:a}=t;return{updatedURLs:r,notUpdatedURLs:a}})}activate(e){return H(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),r=await t.keys(),a=new Set(this._urlsToCacheKeys.values()),i=[];for(const n of r)a.has(n.url)||(await t.delete(n),i.push(n.url));return{deletedURLs:i}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,r=this.getCacheKeyForURL(t);if(r)return(await self.caches.open(this.strategy.cacheName)).match(r)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new u("non-precached-url",{url:e});return r=>(r.request=new Request(e),r.params=Object.assign({cacheKey:t},r.params),this.strategy.handle(r))}}let T;const J=()=>(T||(T=new Me),T);try{self["workbox:routing:7.0.0"]&&_()}catch{}const z="GET",P=s=>s&&typeof s=="object"?s:{handle:s};let E=class{constructor(e,t,r=z){this.handler=P(t),this.match=e,this.method=r}setCatchHandler(e){this.catchHandler=P(e)}},Te=class extends E{constructor(e,t,r){const a=({url:i})=>{const n=e.exec(i.href);if(n&&!(i.origin!==location.origin&&n.index!==0))return n.slice(1)};super(a,t,r)}},Oe=class{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{const{request:t}=e,r=this.handleRequest({request:t,event:e});r&&e.respondWith(r)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,r=Promise.all(t.urlsToCache.map(a=>{typeof a=="string"&&(a=[a]);const i=new Request(...a);return this.handleRequest({request:i,event:e})}));e.waitUntil(r),e.ports&&e.ports[0]&&r.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){const r=new URL(e.url,location.href);if(!r.protocol.startsWith("http"))return;const a=r.origin===location.origin,{params:i,route:n}=this.findMatchingRoute({event:t,request:e,sameOrigin:a,url:r});let c=n&&n.handler;const o=e.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return;let l;try{l=c.handle({url:r,request:e,event:t,params:i})}catch(h){l=Promise.reject(h)}const f=n&&n.catchHandler;return l instanceof Promise&&(this._catchHandler||f)&&(l=l.catch(async h=>{if(f)try{return await f.handle({url:r,request:e,event:t,params:i})}catch(R){R instanceof Error&&(h=R)}if(this._catchHandler)return this._catchHandler.handle({url:r,request:e,event:t});throw h})),l}findMatchingRoute({url:e,sameOrigin:t,request:r,event:a}){const i=this._routes.get(r.method)||[];for(const n of i){let c;const o=n.match({url:e,sameOrigin:t,request:r,event:a});if(o)return c=o,(Array.isArray(c)&&c.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(c=void 0),{route:n,params:c}}return{}}setDefaultHandler(e,t=z){this._defaultHandlerMap.set(t,P(e))}setCatchHandler(e){this._catchHandler=P(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new u("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new u("unregister-route-route-not-registered")}},C;const Se=()=>(C||(C=new Oe,C.addFetchListener(),C.addCacheListener()),C);function Ae(s,e,t){let r;if(typeof s=="string"){const i=new URL(s,location.href),n=({url:c})=>c.href===i.href;r=new E(n,e,t)}else if(s instanceof RegExp)r=new Te(s,e,t);else if(typeof s=="function")r=new E(s,e,t);else if(s instanceof E)r=s;else throw new u("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return Se().registerRoute(r),r}function Ke(s,e=[]){for(const t of[...s.searchParams.keys()])e.some(r=>r.test(t))&&s.searchParams.delete(t);return s}function*Ie(s,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:r=!0,urlManipulation:a}={}){const i=new URL(s,location.href);i.hash="",yield i.href;const n=Ke(i,e);if(yield n.href,t&&n.pathname.endsWith("/")){const c=new URL(n.href);c.pathname+=t,yield c.href}if(r){const c=new URL(n.href);c.pathname+=".html",yield c.href}if(a){const c=a({url:i});for(const o of c)yield o.href}}class We extends E{constructor(e,t){const r=({request:a})=>{const i=e.getURLsToCacheKeys();for(const n of Ie(a.url,t)){const c=i.get(n);if(c){const o=e.getIntegrityForCacheKey(c);return{cacheKey:c,integrity:o}}}};super(r,e.strategy)}}function je(s){const e=J(),t=new We(e,s);Ae(t)}function qe(s){J().precache(s)}function $e(s,e){qe(s),je(e)}try{self["workbox:core:7.0.0"]&&_()}catch{}const He=(s,...e)=>{let t=s;return e.length>0&&(t+=` :: ${JSON.stringify(e)}`),t},Be=He;class Fe extends Error{constructor(e,t){const r=Be(e,t);super(r),this.name=e,this.details=t}}function X(s){s.then(()=>{})}const Ve=(s,e)=>e.some(t=>s instanceof t);let F,V;function Ge(){return F||(F=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Qe(){return V||(V=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Y=new WeakMap,I=new WeakMap,Z=new WeakMap,O=new WeakMap,q=new WeakMap;function Je(s){const e=new Promise((t,r)=>{const a=()=>{s.removeEventListener("success",i),s.removeEventListener("error",n)},i=()=>{t(m(s.result)),a()},n=()=>{r(s.error),a()};s.addEventListener("success",i),s.addEventListener("error",n)});return e.then(t=>{t instanceof IDBCursor&&Y.set(t,s)}).catch(()=>{}),q.set(e,s),e}function ze(s){if(I.has(s))return;const e=new Promise((t,r)=>{const a=()=>{s.removeEventListener("complete",i),s.removeEventListener("error",n),s.removeEventListener("abort",n)},i=()=>{t(),a()},n=()=>{r(s.error||new DOMException("AbortError","AbortError")),a()};s.addEventListener("complete",i),s.addEventListener("error",n),s.addEventListener("abort",n)});I.set(s,e)}let W={get(s,e,t){if(s instanceof IDBTransaction){if(e==="done")return I.get(s);if(e==="objectStoreNames")return s.objectStoreNames||Z.get(s);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return m(s[e])},set(s,e,t){return s[e]=t,!0},has(s,e){return s instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in s}};function Xe(s){W=s(W)}function Ye(s){return s===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const r=s.call(S(this),e,...t);return Z.set(r,e.sort?e.sort():[e]),m(r)}:Qe().includes(s)?function(...e){return s.apply(S(this),e),m(Y.get(this))}:function(...e){return m(s.apply(S(this),e))}}function Ze(s){return typeof s=="function"?Ye(s):(s instanceof IDBTransaction&&ze(s),Ve(s,Ge())?new Proxy(s,W):s)}function m(s){if(s instanceof IDBRequest)return Je(s);if(O.has(s))return O.get(s);const e=Ze(s);return e!==s&&(O.set(s,e),q.set(e,s)),e}const S=s=>q.get(s);function et(s,e,{blocked:t,upgrade:r,blocking:a,terminated:i}={}){const n=indexedDB.open(s,e),c=m(n);return r&&n.addEventListener("upgradeneeded",o=>{r(m(n.result),o.oldVersion,o.newVersion,m(n.transaction),o)}),t&&n.addEventListener("blocked",o=>t(o.oldVersion,o.newVersion,o)),c.then(o=>{i&&o.addEventListener("close",()=>i()),a&&o.addEventListener("versionchange",l=>a(l.oldVersion,l.newVersion,l))}).catch(()=>{}),c}function tt(s,{blocked:e}={}){const t=indexedDB.deleteDatabase(s);return e&&t.addEventListener("blocked",r=>e(r.oldVersion,r)),m(t).then(()=>{})}const st=["get","getKey","getAll","getAllKeys","count"],rt=["put","add","delete","clear"],A=new Map;function G(s,e){if(!(s instanceof IDBDatabase&&!(e in s)&&typeof e=="string"))return;if(A.get(e))return A.get(e);const t=e.replace(/FromIndex$/,""),r=e!==t,a=rt.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(a||st.includes(t)))return;const i=async function(n,...c){const o=this.transaction(n,a?"readwrite":"readonly");let l=o.store;return r&&(l=l.index(c.shift())),(await Promise.all([l[t](...c),a&&o.done]))[0]};return A.set(e,i),i}Xe(s=>({...s,get:(e,t,r)=>G(e,t)||s.get(e,t,r),has:(e,t)=>!!G(e,t)||s.has(e,t)}));try{self["workbox:expiration:7.0.0"]&&_()}catch{}const at="workbox-expiration",x="cache-entries",Q=s=>{const e=new URL(s,location.href);return e.hash="",e.href};class nt{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){const t=e.createObjectStore(x,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&tt(this._cacheName)}async setTimestamp(e,t){e=Q(e);const r={url:e,timestamp:t,cacheName:this._cacheName,id:this._getId(e)},i=(await this.getDb()).transaction(x,"readwrite",{durability:"relaxed"});await i.store.put(r),await i.done}async getTimestamp(e){const r=await(await this.getDb()).get(x,this._getId(e));return r==null?void 0:r.timestamp}async expireEntries(e,t){const r=await this.getDb();let a=await r.transaction(x).store.index("timestamp").openCursor(null,"prev");const i=[];let n=0;for(;a;){const o=a.value;o.cacheName===this._cacheName&&(e&&o.timestamp<e||t&&n>=t?i.push(a.value):n++),a=await a.continue()}const c=[];for(const o of i)await r.delete(x,o.id),c.push(o.url);return c}_getId(e){return this._cacheName+"|"+Q(e)}async getDb(){return this._db||(this._db=await et(at,1,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}}class it{constructor(e,t={}){this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new nt(e)}async expireEntries(){if(this._isRunning){this._rerunRequested=!0;return}this._isRunning=!0;const e=this._maxAgeSeconds?Date.now()-this._maxAgeSeconds*1e3:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),r=await self.caches.open(this._cacheName);for(const a of t)await r.delete(a,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,X(this.expireEntries()))}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(this._maxAgeSeconds){const t=await this._timestampModel.getTimestamp(e),r=Date.now()-this._maxAgeSeconds*1e3;return t!==void 0?t<r:!0}else return!1}async delete(){this._rerunRequested=!1,await this._timestampModel.expireEntries(1/0)}}const g={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:typeof registration<"u"?registration.scope:""},K=s=>[g.prefix,s,g.suffix].filter(e=>e&&e.length>0).join("-"),ct=s=>{for(const e of Object.keys(g))s(e)},ot={updateDetails:s=>{ct(e=>{typeof s[e]=="string"&&(g[e]=s[e])})},getGoogleAnalyticsName:s=>s||K(g.googleAnalytics),getPrecacheName:s=>s||K(g.precache),getPrefix:()=>g.prefix,getRuntimeName:s=>s||K(g.runtime),getSuffix:()=>g.suffix},lt=new Set;function ht(s){lt.add(s)}class ut{constructor(e={}){this.cachedResponseWillBeUsed=async({event:t,request:r,cacheName:a,cachedResponse:i})=>{if(!i)return null;const n=this._isResponseDateFresh(i),c=this._getCacheExpiration(a);X(c.expireEntries());const o=c.updateTimestamp(r.url);if(t)try{t.waitUntil(o)}catch{}return n?i:null},this.cacheDidUpdate=async({cacheName:t,request:r})=>{const a=this._getCacheExpiration(t);await a.updateTimestamp(r.url),await a.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&ht(()=>this.deleteCacheAndMetadata())}_getCacheExpiration(e){if(e===ot.getRuntimeName())throw new Fe("expire-custom-caches-only");let t=this._cacheExpirations.get(e);return t||(t=new it(e,this._config),this._cacheExpirations.set(e,t)),t}_isResponseDateFresh(e){if(!this._maxAgeSeconds)return!0;const t=this._getDateHeaderTimestamp(e);if(t===null)return!0;const r=Date.now();return t>=r-this._maxAgeSeconds*1e3}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;const t=e.headers.get("date"),a=new Date(t).getTime();return isNaN(a)?null:a}async deleteCacheAndMetadata(){for(const[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}}try{self["workbox:routing:7.0.0"]&&_()}catch{}const ee="GET",v=s=>s&&typeof s=="object"?s:{handle:s};class L{constructor(e,t,r=ee){this.handler=v(t),this.match=e,this.method=r}setCatchHandler(e){this.catchHandler=v(e)}}class ft extends L{constructor(e,t,r){const a=({url:i})=>{const n=e.exec(i.href);if(n&&!(i.origin!==location.origin&&n.index!==0))return n.slice(1)};super(a,t,r)}}class dt{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{const{request:t}=e,r=this.handleRequest({request:t,event:e});r&&e.respondWith(r)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,r=Promise.all(t.urlsToCache.map(a=>{typeof a=="string"&&(a=[a]);const i=new Request(...a);return this.handleRequest({request:i,event:e})}));e.waitUntil(r),e.ports&&e.ports[0]&&r.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){const r=new URL(e.url,location.href);if(!r.protocol.startsWith("http"))return;const a=r.origin===location.origin,{params:i,route:n}=this.findMatchingRoute({event:t,request:e,sameOrigin:a,url:r});let c=n&&n.handler;const o=e.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return;let l;try{l=c.handle({url:r,request:e,event:t,params:i})}catch(h){l=Promise.reject(h)}const f=n&&n.catchHandler;return l instanceof Promise&&(this._catchHandler||f)&&(l=l.catch(async h=>{if(f)try{return await f.handle({url:r,request:e,event:t,params:i})}catch(R){R instanceof Error&&(h=R)}if(this._catchHandler)return this._catchHandler.handle({url:r,request:e,event:t});throw h})),l}findMatchingRoute({url:e,sameOrigin:t,request:r,event:a}){const i=this._routes.get(r.method)||[];for(const n of i){let c;const o=n.match({url:e,sameOrigin:t,request:r,event:a});if(o)return c=o,(Array.isArray(c)&&c.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(c=void 0),{route:n,params:c}}return{}}setDefaultHandler(e,t=ee){this._defaultHandlerMap.set(t,v(e))}setCatchHandler(e){this._catchHandler=v(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new y("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new y("unregister-route-route-not-registered")}}let k;const pt=()=>(k||(k=new dt,k.addFetchListener(),k.addCacheListener()),k);function te(s,e,t){let r;if(typeof s=="string"){const i=new URL(s,location.href),n=({url:c})=>c.href===i.href;r=new L(n,e,t)}else if(s instanceof RegExp)r=new ft(s,e,t);else if(typeof s=="function")r=new L(s,e,t);else if(s instanceof L)r=s;else throw new y("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return pt().registerRoute(r),r}try{self["workbox:strategies:7.0.0"]&&_()}catch{}function U(s){return typeof s=="string"?new Request(s):s}class gt{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new he,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const r of this._plugins)this._pluginStateMap.set(r,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:t}=this;let r=U(e);if(r.mode==="navigate"&&t instanceof FetchEvent&&t.preloadResponse){const n=await t.preloadResponse;if(n)return n}const a=this.hasCallback("fetchDidFail")?r.clone():null;try{for(const n of this.iterateCallbacks("requestWillFetch"))r=await n({request:r.clone(),event:t})}catch(n){if(n instanceof Error)throw new y("plugin-error-request-will-fetch",{thrownErrorMessage:n.message})}const i=r.clone();try{let n;n=await fetch(r,r.mode==="navigate"?void 0:this._strategy.fetchOptions);for(const c of this.iterateCallbacks("fetchDidSucceed"))n=await c({event:t,request:i,response:n});return n}catch(n){throw a&&await this.runCallbacks("fetchDidFail",{error:n,event:t,originalRequest:a.clone(),request:i.clone()}),n}}async fetchAndCachePut(e){const t=await this.fetch(e),r=t.clone();return this.waitUntil(this.cachePut(e,r)),t}async cacheMatch(e){const t=U(e);let r;const{cacheName:a,matchOptions:i}=this._strategy,n=await this.getCacheKey(t,"read"),c=Object.assign(Object.assign({},i),{cacheName:a});r=await caches.match(n,c);for(const o of this.iterateCallbacks("cachedResponseWillBeUsed"))r=await o({cacheName:a,matchOptions:i,cachedResponse:r,request:n,event:this.event})||void 0;return r}async cachePut(e,t){const r=U(e);await de(0);const a=await this.getCacheKey(r,"write");if(!t)throw new y("cache-put-with-no-response",{url:fe(a.url)});const i=await this._ensureResponseSafeToCache(t);if(!i)return!1;const{cacheName:n,matchOptions:c}=this._strategy,o=await self.caches.open(n),l=this.hasCallback("cacheDidUpdate"),f=l?await le(o,a.clone(),["__WB_REVISION__"],c):null;try{await o.put(a,l?i.clone():i)}catch(h){if(h instanceof Error)throw h.name==="QuotaExceededError"&&await ue(),h}for(const h of this.iterateCallbacks("cacheDidUpdate"))await h({cacheName:n,oldResponse:f,newResponse:i.clone(),request:a,event:this.event});return!0}async getCacheKey(e,t){const r=`${e.url} | ${t}`;if(!this._cacheKeys[r]){let a=e;for(const i of this.iterateCallbacks("cacheKeyWillBeUsed"))a=U(await i({mode:t,request:a,event:this.event,params:this.params}));this._cacheKeys[r]=a}return this._cacheKeys[r]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const r of this.iterateCallbacks(e))await r(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if(typeof t[e]=="function"){const r=this._pluginStateMap.get(t);yield i=>{const n=Object.assign(Object.assign({},i),{state:r});return t[e](n)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,r=!1;for(const a of this.iterateCallbacks("cacheWillUpdate"))if(t=await a({request:this.request,response:t,event:this.event})||void 0,r=!0,!t)break;return r||t&&t.status!==200&&(t=void 0),t}}class se{constructor(e={}){this.cacheName=oe.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,r=typeof e.request=="string"?new Request(e.request):e.request,a="params"in e?e.params:void 0,i=new gt(this,{event:t,request:r,params:a}),n=this._getResponse(i,r,t),c=this._awaitComplete(n,i,r,t);return[n,c]}async _getResponse(e,t,r){await e.runCallbacks("handlerWillStart",{event:r,request:t});let a;try{if(a=await this._handle(t,e),!a||a.type==="error")throw new y("no-response",{url:t.url})}catch(i){if(i instanceof Error){for(const n of e.iterateCallbacks("handlerDidError"))if(a=await n({error:i,event:r,request:t}),a)break}if(!a)throw i}for(const i of e.iterateCallbacks("handlerWillRespond"))a=await i({event:r,request:t,response:a});return a}async _awaitComplete(e,t,r,a){let i,n;try{i=await e}catch{}try{await t.runCallbacks("handlerDidRespond",{event:a,request:r,response:i}),await t.doneWaiting()}catch(c){c instanceof Error&&(n=c)}if(await t.runCallbacks("handlerDidComplete",{event:a,request:r,response:i,error:n}),t.destroy(),n)throw n}}class mt extends se{async _handle(e,t){let r=await t.cacheMatch(e),a;if(!r)try{r=await t.fetchAndCachePut(e)}catch(i){i instanceof Error&&(a=i)}if(!r)throw new y("no-response",{url:e.url,error:a});return r}}const wt={cacheWillUpdate:async({response:s})=>s.status===200||s.status===0?s:null};class yt extends se{constructor(e={}){super(e),this.plugins.some(t=>"cacheWillUpdate"in t)||this.plugins.unshift(wt)}async _handle(e,t){const r=t.fetchAndCachePut(e).catch(()=>{});t.waitUntil(r);let a=await t.cacheMatch(e),i;if(!a)try{a=await r}catch(n){n instanceof Error&&(i=n)}if(!a)throw new y("no-response",{url:e.url,error:i});return a}}$e(([{"revision":null,"url":"assets/access-control-K72Yp26V.js"},{"revision":null,"url":"assets/actions-DhviKTN_.js"},{"revision":null,"url":"assets/Add-CGjHwYyM.js"},{"revision":null,"url":"assets/add-component-core-CxkJY_14.css"},{"revision":null,"url":"assets/add-component-core-WuqJofF1.js"},{"revision":null,"url":"assets/add-resource-CBQzmo6L.js"},{"revision":null,"url":"assets/AddBox-u_wqkyL7.js"},{"revision":null,"url":"assets/addon-DpHkGhu-.js"},{"revision":null,"url":"assets/Alert-CwPUeQTf.js"},{"revision":null,"url":"assets/analytics-C4beBKTQ.js"},{"revision":null,"url":"assets/api-DPlj8kqR.js"},{"revision":null,"url":"assets/ar-B34f4HdK.js"},{"revision":null,"url":"assets/ar-DXpJw3XU.js"},{"revision":null,"url":"assets/ArrowDropDown-CkIUQSZd.js"},{"revision":null,"url":"assets/audit-logs-rp2fx4nb.js"},{"revision":null,"url":"assets/Avatar-muG6G3N0.js"},{"revision":null,"url":"assets/button-DEtsUQzZ.js"},{"revision":null,"url":"assets/ButtonGroup-DN2Se0uu.js"},{"revision":null,"url":"assets/CheckCircle-Djdn9hDj.js"},{"revision":null,"url":"assets/ChevronRight-B-tpoPfm.js"},{"revision":null,"url":"assets/click-to-copy-CRTzxc53.js"},{"revision":null,"url":"assets/Close-CMqfmrhV.js"},{"revision":null,"url":"assets/CloseOutlined-BCWVvCVq.js"},{"revision":null,"url":"assets/complete-BD_nENcN.js"},{"revision":null,"url":"assets/component-B1tn_hP5.js"},{"revision":null,"url":"assets/config-31oYrIaX.js"},{"revision":null,"url":"assets/config-BTEtVukE.js"},{"revision":null,"url":"assets/config-navigation-D0QM9Tlf.js"},{"revision":null,"url":"assets/config-space-CByVoikQ.js"},{"revision":null,"url":"assets/confirm-DKAx_LOF.js"},{"revision":null,"url":"assets/connect-c6cW4_Ar.js"},{"revision":null,"url":"assets/connect-DewOaYFg.js"},{"revision":null,"url":"assets/connect-to-QdIq3lJf.js"},{"revision":null,"url":"assets/content-layout-DSvdV3Fc.js"},{"revision":null,"url":"assets/dashboard-B1Xb5MJh.js"},{"revision":null,"url":"assets/de-CbWSpQPN.js"},{"revision":null,"url":"assets/de-CWxlIdre.js"},{"revision":null,"url":"assets/Delete-DTI_gypW.js"},{"revision":null,"url":"assets/DeleteOutline-CChRcfrX.js"},{"revision":null,"url":"assets/did-address-D9v6XhHB.js"},{"revision":null,"url":"assets/domain-BJe87vEl.js"},{"revision":null,"url":"assets/domain-list-Bdex7GXw.js"},{"revision":null,"url":"assets/Done-BNlw5zor.js"},{"revision":null,"url":"assets/Download-DQc7dh43.js"},{"revision":null,"url":"assets/Edit-DyMNx1Ce.js"},{"revision":null,"url":"assets/EditIcon-DjoM4rHm.js"},{"revision":null,"url":"assets/Error-Bc_XhHH9.js"},{"revision":null,"url":"assets/es-BmrvDK07.js"},{"revision":null,"url":"assets/es-D2WPMiOg.js"},{"revision":null,"url":"assets/exchange-passport-CRrJTrFH.js"},{"revision":null,"url":"assets/ExpandMore-CKq3nKzY.js"},{"revision":null,"url":"assets/fallback-BkGdFK9Z.js"},{"revision":null,"url":"assets/FilterList-PGaxs7JY.js"},{"revision":null,"url":"assets/FormControl-DBnW--qW.js"},{"revision":null,"url":"assets/FormControlLabel-DiZXxoiR.js"},{"revision":null,"url":"assets/FormGroup-DaYoMAjJ.js"},{"revision":null,"url":"assets/fr-B7SxgRy3.js"},{"revision":null,"url":"assets/fr-BU_67rSB.js"},{"revision":null,"url":"assets/fuel-Bd4mSR9-.js"},{"revision":null,"url":"assets/fullpage-C2hoRIrp.js"},{"revision":null,"url":"assets/Google-DkiSAU8s.js"},{"revision":null,"url":"assets/hi-BRRtNIB_.js"},{"revision":null,"url":"assets/hi-D5wWKqkp.js"},{"revision":null,"url":"assets/Hidden-BsXBUsJf.js"},{"revision":null,"url":"assets/home-CTMUPBRC.js"},{"revision":null,"url":"assets/id-D6-Qi7Q1.js"},{"revision":null,"url":"assets/id-Do44PG5N.js"},{"revision":null,"url":"assets/iframe-DGX84QRH.js"},{"revision":null,"url":"assets/index-67sAUscV.js"},{"revision":null,"url":"assets/index-BhhvWMdR.js"},{"revision":null,"url":"assets/index-Blm67jWV.js"},{"revision":null,"url":"assets/index-Bvv7qWos.js"},{"revision":null,"url":"assets/index-BYBypSYm.js"},{"revision":null,"url":"assets/index-C0GGVRtG.js"},{"revision":null,"url":"assets/index-C8siP93P.js"},{"revision":null,"url":"assets/index-CbFjUt38.js"},{"revision":null,"url":"assets/index-CCovGSMB.css"},{"revision":null,"url":"assets/index-CdyYgvov.js"},{"revision":null,"url":"assets/index-CJG6DxXB.js"},{"revision":null,"url":"assets/index-CkQ_zCey.js"},{"revision":null,"url":"assets/index-ClyxMWNb.js"},{"revision":null,"url":"assets/index-CML05j9-.js"},{"revision":null,"url":"assets/index-COvG2EoD.js"},{"revision":null,"url":"assets/index-cS7vAh3l.js"},{"revision":null,"url":"assets/index-CspTZt1s.js"},{"revision":null,"url":"assets/index-Ct6pLyhV.js"},{"revision":null,"url":"assets/index-CVxOUDOJ.js"},{"revision":null,"url":"assets/index-CYCsdNDo.js"},{"revision":null,"url":"assets/index-D4PP6P2d.css"},{"revision":null,"url":"assets/index-DLBD5Exg.js"},{"revision":null,"url":"assets/index-DTEEl-sV.js"},{"revision":null,"url":"assets/index-DU3JORH0.css"},{"revision":null,"url":"assets/index-Dzqb9mXT.js"},{"revision":null,"url":"assets/index-E1KqmODI.js"},{"revision":null,"url":"assets/index-fTECGjBy.js"},{"revision":null,"url":"assets/index-g0zhI6md.js"},{"revision":null,"url":"assets/index-gG5WqcuQ.js"},{"revision":null,"url":"assets/index-hQKQMc9t.js"},{"revision":null,"url":"assets/index-m-fnir8C.js"},{"revision":null,"url":"assets/index-S4IxJvti.js"},{"revision":null,"url":"assets/index-T8KhhzyT.js"},{"revision":null,"url":"assets/index-ViXJU-AX.js"},{"revision":null,"url":"assets/index-wkSh0NCu.js"},{"revision":null,"url":"assets/index-XGy6tJH9.js"},{"revision":null,"url":"assets/index.es-C2wCOFdy.js"},{"revision":null,"url":"assets/index.esm-DlSTABXh.js"},{"revision":null,"url":"assets/InfoOutlined-EGrZAKuG.js"},{"revision":null,"url":"assets/InputAdornment-B9h0Ttvo.js"},{"revision":null,"url":"assets/InputLabel-BXkoZEFw.js"},{"revision":null,"url":"assets/invitation-Df4Cs12X.js"},{"revision":null,"url":"assets/invite-S1srcr2G.js"},{"revision":null,"url":"assets/issue-passport-C1rFpUNH.js"},{"revision":null,"url":"assets/item-CNDnGCfY.js"},{"revision":null,"url":"assets/ja--dtwu5Xy.js"},{"revision":null,"url":"assets/ja-D8qblxbX.js"},{"revision":null,"url":"assets/jss-plugin-props-sort.esm-CPaRom1_.js"},{"revision":null,"url":"assets/ko-C8eR3MIF.js"},{"revision":null,"url":"assets/ko-DpRJDWhF.js"},{"revision":null,"url":"assets/LastPage-BlsQhAzE.js"},{"revision":null,"url":"assets/Launch-D_gZUmVw.js"},{"revision":null,"url":"assets/launch-result-message-BKZO7m6l.js"},{"revision":null,"url":"assets/LaunchOutlined-f7i2PwtL.js"},{"revision":null,"url":"assets/layout-DTTC2rnt.js"},{"revision":null,"url":"assets/Link-DcerCJFu.js"},{"revision":null,"url":"assets/list-header-hWlUCiAn.js"},{"revision":null,"url":"assets/ListItemText-BDyQ2J2z.js"},{"revision":null,"url":"assets/LoadingButton-CQEzY_7w.js"},{"revision":null,"url":"assets/localization-CwJJB4bb.js"},{"revision":null,"url":"assets/LockIcon-CAM44v0n.js"},{"revision":null,"url":"assets/log-2Is9yVie.js"},{"revision":null,"url":"assets/log-D33dFtt_.css"},{"revision":null,"url":"assets/login-CtHPThli.js"},{"revision":null,"url":"assets/login-oauth-callback-CmcJVuGC.js"},{"revision":null,"url":"assets/logo-uploader-DgciS-Bn.js"},{"revision":null,"url":"assets/Loop-B92ZF0ZY.js"},{"revision":null,"url":"assets/lost-passport-XGwclRUF.js"},{"revision":null,"url":"assets/lottie-CiIb5tX-.js"},{"revision":null,"url":"assets/mode-B2dWMeTO.js"},{"revision":null,"url":"assets/MoreHoriz-C84g5tnh.js"},{"revision":null,"url":"assets/MoreVert-CmWHvYKq.js"},{"revision":null,"url":"assets/notifications-1Nh3LWvL.js"},{"revision":null,"url":"assets/OpenInNew-BqRi4pNO.js"},{"revision":null,"url":"assets/overview-BFqUFGF1.js"},{"revision":null,"url":"assets/page-header-DWVsf_ju.js"},{"revision":null,"url":"assets/Pagination-Bl0sYNE2.js"},{"revision":null,"url":"assets/permission-DuwXRSeD.js"},{"revision":null,"url":"assets/PlayArrow-nyGVaVTE.js"},{"revision":null,"url":"assets/preact.module-B1z5cdvs.js"},{"revision":null,"url":"assets/preferences-B3Ko8wx4.js"},{"revision":null,"url":"assets/pt-BxA88dKG.js"},{"revision":null,"url":"assets/pt-Dly5Myel.js"},{"revision":null,"url":"assets/publish-resource-DbsS-U49.js"},{"revision":null,"url":"assets/QuestionMarkCircle-BB-ivMSu.js"},{"revision":null,"url":"assets/RadioGroup-xJsTr9dY.js"},{"revision":null,"url":"assets/react-BW7E7-P9.css"},{"revision":null,"url":"assets/react-DuyTA796.js"},{"revision":null,"url":"assets/redux-inEZ4756.js"},{"revision":null,"url":"assets/resource-dialog-_K-j3Qk_.js"},{"revision":null,"url":"assets/ru-C9Wh9IKf.js"},{"revision":null,"url":"assets/ru-C9WJaQoQ.js"},{"revision":null,"url":"assets/Search-DtER35HN.js"},{"revision":null,"url":"assets/Select-CZWM_yIs.js"},{"revision":null,"url":"assets/selector-EZV0cmfi.js"},{"revision":null,"url":"assets/ServerLogo-C_NqeJau.js"},{"revision":null,"url":"assets/session-C-d0ZoFx.js"},{"revision":null,"url":"assets/setup-DCrWnBN8.js"},{"revision":null,"url":"assets/Skeleton-8LdPY1iI.js"},{"revision":null,"url":"assets/slicedToArray-DWkDStoK.js"},{"revision":null,"url":"assets/Slider-vgBd_9Te.js"},{"revision":null,"url":"assets/spaces-vEbKKcIX.js"},{"revision":null,"url":"assets/start-BmZPEFvM.js"},{"revision":null,"url":"assets/step-actions-BjzXeqL4.js"},{"revision":null,"url":"assets/Stepper-D4EaxYmk.js"},{"revision":null,"url":"assets/studio-BN0HseSz.js"},{"revision":null,"url":"assets/switch-control-2jftP8-E.js"},{"revision":null,"url":"assets/TextField-Bnj3w9zC.js"},{"revision":null,"url":"assets/th-B6Z2fc62.js"},{"revision":null,"url":"assets/th-z7LSYRZi.js"},{"revision":null,"url":"assets/Toolbar-DTVbFTHr.js"},{"revision":null,"url":"assets/toPropertyKey-hKuLU48H.js"},{"revision":null,"url":"assets/toUpper-Dw_Vex_q.js"},{"revision":null,"url":"assets/transfer-BiNkoNrk.js"},{"revision":null,"url":"assets/uniqBy-DXylrK-v.js"},{"revision":null,"url":"assets/unsubscribe-DvGt2Nbz.js"},{"revision":null,"url":"assets/use-blocklet-info-for-connect-did-spaces-CsBN3q_W.js"},{"revision":null,"url":"assets/use-mobile-BJLvYUM8.js"},{"revision":null,"url":"assets/use-passport-id-B-b-_oYF.js"},{"revision":null,"url":"assets/useAsync-Dfd6Y9G3.js"},{"revision":null,"url":"assets/useFormControl-Dx1QF3eL.js"},{"revision":null,"url":"assets/useLocalStorage-Ck-HdB2q.js"},{"revision":null,"url":"assets/user-center-4B87p-Wx.js"},{"revision":null,"url":"assets/user-sessions-Bt-MELe3.js"},{"revision":null,"url":"assets/useSetState-DLWhgEoo.js"},{"revision":null,"url":"assets/useSlot-CfR_-Pi6.js"},{"revision":null,"url":"assets/util-BVAuEbMI.js"},{"revision":null,"url":"assets/vi-CAtyUyNW.js"},{"revision":null,"url":"assets/vi-Di0ynKe6.js"},{"revision":null,"url":"assets/ViewList-hag6Se2e.js"},{"revision":null,"url":"assets/wrap-locale-BRFe_NH_.js"},{"revision":null,"url":"assets/zh-BVBeddUa.js"},{"revision":null,"url":"assets/zh-e04FR-Ps.js"},{"revision":null,"url":"assets/zh-tw-CoStw7dd.js"},{"revision":null,"url":"assets/zh-tw-DlepKNg6.js"},{"revision":"0e75b29330d251e2fe6390d51ef0fe6e","url":"index.html"},{"revision":"186b2f1889d7c89ecd30e422ab415c8a","url":"registerSW.js"},{"revision":"07a287e43ae8e959a20d6b367a581667","url":"router-template-styles/styles.css"},{"revision":"ecdddc9b1297e7511cad18529d5cfd89","url":"manifest.webmanifest"}]||[]).filter(s=>s.url!=="/"&&!s.url.includes("index.html")));pe();self.addEventListener("activate",()=>{console.log("Service Worker activated")});self.addEventListener("install",s=>{console.log("Service Worker installed"),s.waitUntil(self.skipWaiting())});const re=s=>!!(s.method!=="GET"||s.url.includes("/api")||s.url.includes("__meta__.js")||s.url.includes("__blocklet__.js"));te(s=>{const{request:e}=s;return re(e)?!1:e.url.includes("/static/")},new mt({cacheName:"static",plugins:[new ut({maxEntries:200})]}));te(s=>{const{request:e}=s;return re(e)?!1:e.url.includes("/images/")||e.url.includes("/router/-template-styles/")},new yt);
2
+ This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(c)}}}install(e){return H(e,async()=>{const t=new Re;this.strategy.plugins.push(t);for(const[i,n]of this._urlsToCacheKeys){const c=this._cacheKeysToIntegrities.get(n),o=this._urlsToCacheModes.get(i),l=new Request(i,{integrity:c,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:n},request:l,event:e}))}const{updatedURLs:r,notUpdatedURLs:a}=t;return{updatedURLs:r,notUpdatedURLs:a}})}activate(e){return H(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),r=await t.keys(),a=new Set(this._urlsToCacheKeys.values()),i=[];for(const n of r)a.has(n.url)||(await t.delete(n),i.push(n.url));return{deletedURLs:i}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,r=this.getCacheKeyForURL(t);if(r)return(await self.caches.open(this.strategy.cacheName)).match(r)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new u("non-precached-url",{url:e});return r=>(r.request=new Request(e),r.params=Object.assign({cacheKey:t},r.params),this.strategy.handle(r))}}let T;const J=()=>(T||(T=new Me),T);try{self["workbox:routing:7.0.0"]&&_()}catch{}const z="GET",P=s=>s&&typeof s=="object"?s:{handle:s};let E=class{constructor(e,t,r=z){this.handler=P(t),this.match=e,this.method=r}setCatchHandler(e){this.catchHandler=P(e)}},Te=class extends E{constructor(e,t,r){const a=({url:i})=>{const n=e.exec(i.href);if(n&&!(i.origin!==location.origin&&n.index!==0))return n.slice(1)};super(a,t,r)}},Oe=class{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{const{request:t}=e,r=this.handleRequest({request:t,event:e});r&&e.respondWith(r)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,r=Promise.all(t.urlsToCache.map(a=>{typeof a=="string"&&(a=[a]);const i=new Request(...a);return this.handleRequest({request:i,event:e})}));e.waitUntil(r),e.ports&&e.ports[0]&&r.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){const r=new URL(e.url,location.href);if(!r.protocol.startsWith("http"))return;const a=r.origin===location.origin,{params:i,route:n}=this.findMatchingRoute({event:t,request:e,sameOrigin:a,url:r});let c=n&&n.handler;const o=e.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return;let l;try{l=c.handle({url:r,request:e,event:t,params:i})}catch(h){l=Promise.reject(h)}const f=n&&n.catchHandler;return l instanceof Promise&&(this._catchHandler||f)&&(l=l.catch(async h=>{if(f)try{return await f.handle({url:r,request:e,event:t,params:i})}catch(R){R instanceof Error&&(h=R)}if(this._catchHandler)return this._catchHandler.handle({url:r,request:e,event:t});throw h})),l}findMatchingRoute({url:e,sameOrigin:t,request:r,event:a}){const i=this._routes.get(r.method)||[];for(const n of i){let c;const o=n.match({url:e,sameOrigin:t,request:r,event:a});if(o)return c=o,(Array.isArray(c)&&c.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(c=void 0),{route:n,params:c}}return{}}setDefaultHandler(e,t=z){this._defaultHandlerMap.set(t,P(e))}setCatchHandler(e){this._catchHandler=P(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new u("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new u("unregister-route-route-not-registered")}},C;const Se=()=>(C||(C=new Oe,C.addFetchListener(),C.addCacheListener()),C);function Ae(s,e,t){let r;if(typeof s=="string"){const i=new URL(s,location.href),n=({url:c})=>c.href===i.href;r=new E(n,e,t)}else if(s instanceof RegExp)r=new Te(s,e,t);else if(typeof s=="function")r=new E(s,e,t);else if(s instanceof E)r=s;else throw new u("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return Se().registerRoute(r),r}function Ke(s,e=[]){for(const t of[...s.searchParams.keys()])e.some(r=>r.test(t))&&s.searchParams.delete(t);return s}function*Ie(s,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:r=!0,urlManipulation:a}={}){const i=new URL(s,location.href);i.hash="",yield i.href;const n=Ke(i,e);if(yield n.href,t&&n.pathname.endsWith("/")){const c=new URL(n.href);c.pathname+=t,yield c.href}if(r){const c=new URL(n.href);c.pathname+=".html",yield c.href}if(a){const c=a({url:i});for(const o of c)yield o.href}}class We extends E{constructor(e,t){const r=({request:a})=>{const i=e.getURLsToCacheKeys();for(const n of Ie(a.url,t)){const c=i.get(n);if(c){const o=e.getIntegrityForCacheKey(c);return{cacheKey:c,integrity:o}}}};super(r,e.strategy)}}function je(s){const e=J(),t=new We(e,s);Ae(t)}function qe(s){J().precache(s)}function $e(s,e){qe(s),je(e)}try{self["workbox:core:7.0.0"]&&_()}catch{}const He=(s,...e)=>{let t=s;return e.length>0&&(t+=` :: ${JSON.stringify(e)}`),t},Be=He;class Fe extends Error{constructor(e,t){const r=Be(e,t);super(r),this.name=e,this.details=t}}function X(s){s.then(()=>{})}const Ve=(s,e)=>e.some(t=>s instanceof t);let F,V;function Ge(){return F||(F=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Qe(){return V||(V=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const Y=new WeakMap,I=new WeakMap,Z=new WeakMap,O=new WeakMap,q=new WeakMap;function Je(s){const e=new Promise((t,r)=>{const a=()=>{s.removeEventListener("success",i),s.removeEventListener("error",n)},i=()=>{t(m(s.result)),a()},n=()=>{r(s.error),a()};s.addEventListener("success",i),s.addEventListener("error",n)});return e.then(t=>{t instanceof IDBCursor&&Y.set(t,s)}).catch(()=>{}),q.set(e,s),e}function ze(s){if(I.has(s))return;const e=new Promise((t,r)=>{const a=()=>{s.removeEventListener("complete",i),s.removeEventListener("error",n),s.removeEventListener("abort",n)},i=()=>{t(),a()},n=()=>{r(s.error||new DOMException("AbortError","AbortError")),a()};s.addEventListener("complete",i),s.addEventListener("error",n),s.addEventListener("abort",n)});I.set(s,e)}let W={get(s,e,t){if(s instanceof IDBTransaction){if(e==="done")return I.get(s);if(e==="objectStoreNames")return s.objectStoreNames||Z.get(s);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return m(s[e])},set(s,e,t){return s[e]=t,!0},has(s,e){return s instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in s}};function Xe(s){W=s(W)}function Ye(s){return s===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const r=s.call(S(this),e,...t);return Z.set(r,e.sort?e.sort():[e]),m(r)}:Qe().includes(s)?function(...e){return s.apply(S(this),e),m(Y.get(this))}:function(...e){return m(s.apply(S(this),e))}}function Ze(s){return typeof s=="function"?Ye(s):(s instanceof IDBTransaction&&ze(s),Ve(s,Ge())?new Proxy(s,W):s)}function m(s){if(s instanceof IDBRequest)return Je(s);if(O.has(s))return O.get(s);const e=Ze(s);return e!==s&&(O.set(s,e),q.set(e,s)),e}const S=s=>q.get(s);function et(s,e,{blocked:t,upgrade:r,blocking:a,terminated:i}={}){const n=indexedDB.open(s,e),c=m(n);return r&&n.addEventListener("upgradeneeded",o=>{r(m(n.result),o.oldVersion,o.newVersion,m(n.transaction),o)}),t&&n.addEventListener("blocked",o=>t(o.oldVersion,o.newVersion,o)),c.then(o=>{i&&o.addEventListener("close",()=>i()),a&&o.addEventListener("versionchange",l=>a(l.oldVersion,l.newVersion,l))}).catch(()=>{}),c}function tt(s,{blocked:e}={}){const t=indexedDB.deleteDatabase(s);return e&&t.addEventListener("blocked",r=>e(r.oldVersion,r)),m(t).then(()=>{})}const st=["get","getKey","getAll","getAllKeys","count"],rt=["put","add","delete","clear"],A=new Map;function G(s,e){if(!(s instanceof IDBDatabase&&!(e in s)&&typeof e=="string"))return;if(A.get(e))return A.get(e);const t=e.replace(/FromIndex$/,""),r=e!==t,a=rt.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(a||st.includes(t)))return;const i=async function(n,...c){const o=this.transaction(n,a?"readwrite":"readonly");let l=o.store;return r&&(l=l.index(c.shift())),(await Promise.all([l[t](...c),a&&o.done]))[0]};return A.set(e,i),i}Xe(s=>({...s,get:(e,t,r)=>G(e,t)||s.get(e,t,r),has:(e,t)=>!!G(e,t)||s.has(e,t)}));try{self["workbox:expiration:7.0.0"]&&_()}catch{}const at="workbox-expiration",x="cache-entries",Q=s=>{const e=new URL(s,location.href);return e.hash="",e.href};class nt{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){const t=e.createObjectStore(x,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&tt(this._cacheName)}async setTimestamp(e,t){e=Q(e);const r={url:e,timestamp:t,cacheName:this._cacheName,id:this._getId(e)},i=(await this.getDb()).transaction(x,"readwrite",{durability:"relaxed"});await i.store.put(r),await i.done}async getTimestamp(e){const r=await(await this.getDb()).get(x,this._getId(e));return r==null?void 0:r.timestamp}async expireEntries(e,t){const r=await this.getDb();let a=await r.transaction(x).store.index("timestamp").openCursor(null,"prev");const i=[];let n=0;for(;a;){const o=a.value;o.cacheName===this._cacheName&&(e&&o.timestamp<e||t&&n>=t?i.push(a.value):n++),a=await a.continue()}const c=[];for(const o of i)await r.delete(x,o.id),c.push(o.url);return c}_getId(e){return this._cacheName+"|"+Q(e)}async getDb(){return this._db||(this._db=await et(at,1,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}}class it{constructor(e,t={}){this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new nt(e)}async expireEntries(){if(this._isRunning){this._rerunRequested=!0;return}this._isRunning=!0;const e=this._maxAgeSeconds?Date.now()-this._maxAgeSeconds*1e3:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),r=await self.caches.open(this._cacheName);for(const a of t)await r.delete(a,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,X(this.expireEntries()))}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(this._maxAgeSeconds){const t=await this._timestampModel.getTimestamp(e),r=Date.now()-this._maxAgeSeconds*1e3;return t!==void 0?t<r:!0}else return!1}async delete(){this._rerunRequested=!1,await this._timestampModel.expireEntries(1/0)}}const g={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:typeof registration<"u"?registration.scope:""},K=s=>[g.prefix,s,g.suffix].filter(e=>e&&e.length>0).join("-"),ct=s=>{for(const e of Object.keys(g))s(e)},ot={updateDetails:s=>{ct(e=>{typeof s[e]=="string"&&(g[e]=s[e])})},getGoogleAnalyticsName:s=>s||K(g.googleAnalytics),getPrecacheName:s=>s||K(g.precache),getPrefix:()=>g.prefix,getRuntimeName:s=>s||K(g.runtime),getSuffix:()=>g.suffix},lt=new Set;function ht(s){lt.add(s)}class ut{constructor(e={}){this.cachedResponseWillBeUsed=async({event:t,request:r,cacheName:a,cachedResponse:i})=>{if(!i)return null;const n=this._isResponseDateFresh(i),c=this._getCacheExpiration(a);X(c.expireEntries());const o=c.updateTimestamp(r.url);if(t)try{t.waitUntil(o)}catch{}return n?i:null},this.cacheDidUpdate=async({cacheName:t,request:r})=>{const a=this._getCacheExpiration(t);await a.updateTimestamp(r.url),await a.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&ht(()=>this.deleteCacheAndMetadata())}_getCacheExpiration(e){if(e===ot.getRuntimeName())throw new Fe("expire-custom-caches-only");let t=this._cacheExpirations.get(e);return t||(t=new it(e,this._config),this._cacheExpirations.set(e,t)),t}_isResponseDateFresh(e){if(!this._maxAgeSeconds)return!0;const t=this._getDateHeaderTimestamp(e);if(t===null)return!0;const r=Date.now();return t>=r-this._maxAgeSeconds*1e3}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;const t=e.headers.get("date"),a=new Date(t).getTime();return isNaN(a)?null:a}async deleteCacheAndMetadata(){for(const[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}}try{self["workbox:routing:7.0.0"]&&_()}catch{}const ee="GET",v=s=>s&&typeof s=="object"?s:{handle:s};class L{constructor(e,t,r=ee){this.handler=v(t),this.match=e,this.method=r}setCatchHandler(e){this.catchHandler=v(e)}}class ft extends L{constructor(e,t,r){const a=({url:i})=>{const n=e.exec(i.href);if(n&&!(i.origin!==location.origin&&n.index!==0))return n.slice(1)};super(a,t,r)}}class dt{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{const{request:t}=e,r=this.handleRequest({request:t,event:e});r&&e.respondWith(r)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,r=Promise.all(t.urlsToCache.map(a=>{typeof a=="string"&&(a=[a]);const i=new Request(...a);return this.handleRequest({request:i,event:e})}));e.waitUntil(r),e.ports&&e.ports[0]&&r.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){const r=new URL(e.url,location.href);if(!r.protocol.startsWith("http"))return;const a=r.origin===location.origin,{params:i,route:n}=this.findMatchingRoute({event:t,request:e,sameOrigin:a,url:r});let c=n&&n.handler;const o=e.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return;let l;try{l=c.handle({url:r,request:e,event:t,params:i})}catch(h){l=Promise.reject(h)}const f=n&&n.catchHandler;return l instanceof Promise&&(this._catchHandler||f)&&(l=l.catch(async h=>{if(f)try{return await f.handle({url:r,request:e,event:t,params:i})}catch(R){R instanceof Error&&(h=R)}if(this._catchHandler)return this._catchHandler.handle({url:r,request:e,event:t});throw h})),l}findMatchingRoute({url:e,sameOrigin:t,request:r,event:a}){const i=this._routes.get(r.method)||[];for(const n of i){let c;const o=n.match({url:e,sameOrigin:t,request:r,event:a});if(o)return c=o,(Array.isArray(c)&&c.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(c=void 0),{route:n,params:c}}return{}}setDefaultHandler(e,t=ee){this._defaultHandlerMap.set(t,v(e))}setCatchHandler(e){this._catchHandler=v(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new y("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new y("unregister-route-route-not-registered")}}let k;const pt=()=>(k||(k=new dt,k.addFetchListener(),k.addCacheListener()),k);function te(s,e,t){let r;if(typeof s=="string"){const i=new URL(s,location.href),n=({url:c})=>c.href===i.href;r=new L(n,e,t)}else if(s instanceof RegExp)r=new ft(s,e,t);else if(typeof s=="function")r=new L(s,e,t);else if(s instanceof L)r=s;else throw new y("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return pt().registerRoute(r),r}try{self["workbox:strategies:7.0.0"]&&_()}catch{}function U(s){return typeof s=="string"?new Request(s):s}class gt{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new he,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const r of this._plugins)this._pluginStateMap.set(r,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:t}=this;let r=U(e);if(r.mode==="navigate"&&t instanceof FetchEvent&&t.preloadResponse){const n=await t.preloadResponse;if(n)return n}const a=this.hasCallback("fetchDidFail")?r.clone():null;try{for(const n of this.iterateCallbacks("requestWillFetch"))r=await n({request:r.clone(),event:t})}catch(n){if(n instanceof Error)throw new y("plugin-error-request-will-fetch",{thrownErrorMessage:n.message})}const i=r.clone();try{let n;n=await fetch(r,r.mode==="navigate"?void 0:this._strategy.fetchOptions);for(const c of this.iterateCallbacks("fetchDidSucceed"))n=await c({event:t,request:i,response:n});return n}catch(n){throw a&&await this.runCallbacks("fetchDidFail",{error:n,event:t,originalRequest:a.clone(),request:i.clone()}),n}}async fetchAndCachePut(e){const t=await this.fetch(e),r=t.clone();return this.waitUntil(this.cachePut(e,r)),t}async cacheMatch(e){const t=U(e);let r;const{cacheName:a,matchOptions:i}=this._strategy,n=await this.getCacheKey(t,"read"),c=Object.assign(Object.assign({},i),{cacheName:a});r=await caches.match(n,c);for(const o of this.iterateCallbacks("cachedResponseWillBeUsed"))r=await o({cacheName:a,matchOptions:i,cachedResponse:r,request:n,event:this.event})||void 0;return r}async cachePut(e,t){const r=U(e);await de(0);const a=await this.getCacheKey(r,"write");if(!t)throw new y("cache-put-with-no-response",{url:fe(a.url)});const i=await this._ensureResponseSafeToCache(t);if(!i)return!1;const{cacheName:n,matchOptions:c}=this._strategy,o=await self.caches.open(n),l=this.hasCallback("cacheDidUpdate"),f=l?await le(o,a.clone(),["__WB_REVISION__"],c):null;try{await o.put(a,l?i.clone():i)}catch(h){if(h instanceof Error)throw h.name==="QuotaExceededError"&&await ue(),h}for(const h of this.iterateCallbacks("cacheDidUpdate"))await h({cacheName:n,oldResponse:f,newResponse:i.clone(),request:a,event:this.event});return!0}async getCacheKey(e,t){const r=`${e.url} | ${t}`;if(!this._cacheKeys[r]){let a=e;for(const i of this.iterateCallbacks("cacheKeyWillBeUsed"))a=U(await i({mode:t,request:a,event:this.event,params:this.params}));this._cacheKeys[r]=a}return this._cacheKeys[r]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const r of this.iterateCallbacks(e))await r(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if(typeof t[e]=="function"){const r=this._pluginStateMap.get(t);yield i=>{const n=Object.assign(Object.assign({},i),{state:r});return t[e](n)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,r=!1;for(const a of this.iterateCallbacks("cacheWillUpdate"))if(t=await a({request:this.request,response:t,event:this.event})||void 0,r=!0,!t)break;return r||t&&t.status!==200&&(t=void 0),t}}class se{constructor(e={}){this.cacheName=oe.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,r=typeof e.request=="string"?new Request(e.request):e.request,a="params"in e?e.params:void 0,i=new gt(this,{event:t,request:r,params:a}),n=this._getResponse(i,r,t),c=this._awaitComplete(n,i,r,t);return[n,c]}async _getResponse(e,t,r){await e.runCallbacks("handlerWillStart",{event:r,request:t});let a;try{if(a=await this._handle(t,e),!a||a.type==="error")throw new y("no-response",{url:t.url})}catch(i){if(i instanceof Error){for(const n of e.iterateCallbacks("handlerDidError"))if(a=await n({error:i,event:r,request:t}),a)break}if(!a)throw i}for(const i of e.iterateCallbacks("handlerWillRespond"))a=await i({event:r,request:t,response:a});return a}async _awaitComplete(e,t,r,a){let i,n;try{i=await e}catch{}try{await t.runCallbacks("handlerDidRespond",{event:a,request:r,response:i}),await t.doneWaiting()}catch(c){c instanceof Error&&(n=c)}if(await t.runCallbacks("handlerDidComplete",{event:a,request:r,response:i,error:n}),t.destroy(),n)throw n}}class mt extends se{async _handle(e,t){let r=await t.cacheMatch(e),a;if(!r)try{r=await t.fetchAndCachePut(e)}catch(i){i instanceof Error&&(a=i)}if(!r)throw new y("no-response",{url:e.url,error:a});return r}}const wt={cacheWillUpdate:async({response:s})=>s.status===200||s.status===0?s:null};class yt extends se{constructor(e={}){super(e),this.plugins.some(t=>"cacheWillUpdate"in t)||this.plugins.unshift(wt)}async _handle(e,t){const r=t.fetchAndCachePut(e).catch(()=>{});t.waitUntil(r);let a=await t.cacheMatch(e),i;if(!a)try{a=await r}catch(n){n instanceof Error&&(i=n)}if(!a)throw new y("no-response",{url:e.url,error:i});return a}}$e(([{"revision":null,"url":"assets/access-control-BCwpKFRG.js"},{"revision":null,"url":"assets/actions-DPCHP2Zq.js"},{"revision":null,"url":"assets/Add-BM20NrQO.js"},{"revision":null,"url":"assets/add-component-core-07RqFKRp.js"},{"revision":null,"url":"assets/add-component-core-CxkJY_14.css"},{"revision":null,"url":"assets/add-resource-DyhrbJxX.js"},{"revision":null,"url":"assets/AddBox--wxfR3G0.js"},{"revision":null,"url":"assets/addon-Dd_1kHaH.js"},{"revision":null,"url":"assets/Alert-DtzaUssX.js"},{"revision":null,"url":"assets/analytics-CpnXFlCP.js"},{"revision":null,"url":"assets/api-BEakJrYk.js"},{"revision":null,"url":"assets/ar-B34f4HdK.js"},{"revision":null,"url":"assets/ar-DXpJw3XU.js"},{"revision":null,"url":"assets/ArrowDropDown-Iyfxx2xg.js"},{"revision":null,"url":"assets/audit-logs-CcdVOnke.js"},{"revision":null,"url":"assets/Avatar-CUpS4Ilr.js"},{"revision":null,"url":"assets/button-BKUtHuLK.js"},{"revision":null,"url":"assets/ButtonGroup-CYyG5u2K.js"},{"revision":null,"url":"assets/CheckCircle-DoaQShhi.js"},{"revision":null,"url":"assets/ChevronRight-CoSoIqx4.js"},{"revision":null,"url":"assets/click-to-copy-C5Z-YhEj.js"},{"revision":null,"url":"assets/Close-BLsWc_Tk.js"},{"revision":null,"url":"assets/CloseOutlined-DW47mLri.js"},{"revision":null,"url":"assets/complete-DGbpqS5n.js"},{"revision":null,"url":"assets/component-DqG0gKuO.js"},{"revision":null,"url":"assets/config-DLELBWuY.js"},{"revision":null,"url":"assets/config-DseId50E.js"},{"revision":null,"url":"assets/config-navigation-D3NGEvCy.js"},{"revision":null,"url":"assets/config-space-Dq3sHJW8.js"},{"revision":null,"url":"assets/confirm-Bp1YUyru.js"},{"revision":null,"url":"assets/connect-CCqeZs4y.js"},{"revision":null,"url":"assets/connect-De6kBvVp.js"},{"revision":null,"url":"assets/connect-to-DNQSW4Zf.js"},{"revision":null,"url":"assets/content-layout-FX0-4e_U.js"},{"revision":null,"url":"assets/dashboard-gEbtoKpZ.js"},{"revision":null,"url":"assets/de-CbWSpQPN.js"},{"revision":null,"url":"assets/de-CWxlIdre.js"},{"revision":null,"url":"assets/Delete-BeboIHFa.js"},{"revision":null,"url":"assets/DeleteOutline-BaCf1XtY.js"},{"revision":null,"url":"assets/did-address-Etx4oDtC.js"},{"revision":null,"url":"assets/domain-Bp688Xuz.js"},{"revision":null,"url":"assets/domain-list-xUOKEmgZ.js"},{"revision":null,"url":"assets/Done-BEjApK9u.js"},{"revision":null,"url":"assets/Download-DjWaMhPn.js"},{"revision":null,"url":"assets/Edit-DyzvkXNJ.js"},{"revision":null,"url":"assets/EditIcon-BXRvvSFr.js"},{"revision":null,"url":"assets/Error-DcCaeZ_S.js"},{"revision":null,"url":"assets/es-BmrvDK07.js"},{"revision":null,"url":"assets/es-D2WPMiOg.js"},{"revision":null,"url":"assets/exchange-passport-Ca8hn9GK.js"},{"revision":null,"url":"assets/ExpandMore-Dw5iC69g.js"},{"revision":null,"url":"assets/fallback-CIBVmJin.js"},{"revision":null,"url":"assets/FilterList-B_AYjksa.js"},{"revision":null,"url":"assets/FormControl-CKJrH8LS.js"},{"revision":null,"url":"assets/FormControlLabel-J_nG7S9r.js"},{"revision":null,"url":"assets/FormGroup-B2XKvk2U.js"},{"revision":null,"url":"assets/fr-B7SxgRy3.js"},{"revision":null,"url":"assets/fr-BU_67rSB.js"},{"revision":null,"url":"assets/fuel-CJOxfEOO.js"},{"revision":null,"url":"assets/fullpage-D3A4C5-R.js"},{"revision":null,"url":"assets/Google-_J6to4FR.js"},{"revision":null,"url":"assets/hi-BRRtNIB_.js"},{"revision":null,"url":"assets/hi-D5wWKqkp.js"},{"revision":null,"url":"assets/Hidden-BLdLc8h9.js"},{"revision":null,"url":"assets/home-CjQy6Wn4.js"},{"revision":null,"url":"assets/id-D6-Qi7Q1.js"},{"revision":null,"url":"assets/id-Do44PG5N.js"},{"revision":null,"url":"assets/iframe-BBq0Voai.js"},{"revision":null,"url":"assets/index-3J8dxrpv.js"},{"revision":null,"url":"assets/index-B-MiDNZJ.js"},{"revision":null,"url":"assets/index-B0YP3d1_.js"},{"revision":null,"url":"assets/index-B4NnGwvJ.js"},{"revision":null,"url":"assets/index-BgwjaAEK.js"},{"revision":null,"url":"assets/index-BJX9Tvpd.js"},{"revision":null,"url":"assets/index-BNte_m1O.js"},{"revision":null,"url":"assets/index-BvsLirqD.js"},{"revision":null,"url":"assets/index-BvTERmRP.js"},{"revision":null,"url":"assets/index-BvWO4cX9.js"},{"revision":null,"url":"assets/index-BYYybgec.js"},{"revision":null,"url":"assets/index-C2gRwmn2.js"},{"revision":null,"url":"assets/index-C7siWm6R.js"},{"revision":null,"url":"assets/index-CBJAk2V8.js"},{"revision":null,"url":"assets/index-CCovGSMB.css"},{"revision":null,"url":"assets/index-CnSZHHme.js"},{"revision":null,"url":"assets/index-CR0jMc07.js"},{"revision":null,"url":"assets/index-Cy0soagJ.js"},{"revision":null,"url":"assets/index-CzncbcdH.js"},{"revision":null,"url":"assets/index-D4PP6P2d.css"},{"revision":null,"url":"assets/index-D4zAIKo5.js"},{"revision":null,"url":"assets/index-DA6RGcPS.js"},{"revision":null,"url":"assets/index-Dm4QfKgj.js"},{"revision":null,"url":"assets/index-DTEEl-sV.js"},{"revision":null,"url":"assets/index-DU3JORH0.css"},{"revision":null,"url":"assets/index-DUsylIII.js"},{"revision":null,"url":"assets/index-DWdOmPJK.js"},{"revision":null,"url":"assets/index-DxgnjIVN.js"},{"revision":null,"url":"assets/index-DzIqbqJ_.js"},{"revision":null,"url":"assets/index-kTvctsLd.js"},{"revision":null,"url":"assets/index-lo0p8vGs.js"},{"revision":null,"url":"assets/index-QBptYklD.js"},{"revision":null,"url":"assets/index-QUyszNOn.js"},{"revision":null,"url":"assets/index-r7u0jEi1.js"},{"revision":null,"url":"assets/index-Ta8CgfK0.js"},{"revision":null,"url":"assets/index-zD9-bZuV.js"},{"revision":null,"url":"assets/index.es-BwRDpSz4.js"},{"revision":null,"url":"assets/index.esm-CpvBYn6L.js"},{"revision":null,"url":"assets/InfoOutlined-jXjX6Tro.js"},{"revision":null,"url":"assets/InputAdornment-DYTxgt6k.js"},{"revision":null,"url":"assets/InputLabel-lATzw7NR.js"},{"revision":null,"url":"assets/invitation-DmGeq7ty.js"},{"revision":null,"url":"assets/invite-BHr71ERq.js"},{"revision":null,"url":"assets/issue-passport-CVLycMc5.js"},{"revision":null,"url":"assets/item-BcWo6lea.js"},{"revision":null,"url":"assets/ja--dtwu5Xy.js"},{"revision":null,"url":"assets/ja-D8qblxbX.js"},{"revision":null,"url":"assets/jss-plugin-props-sort.esm-CS5B424R.js"},{"revision":null,"url":"assets/ko-C8eR3MIF.js"},{"revision":null,"url":"assets/ko-DpRJDWhF.js"},{"revision":null,"url":"assets/LastPage-2k34T11k.js"},{"revision":null,"url":"assets/Launch-DOIBGLzl.js"},{"revision":null,"url":"assets/launch-result-message-CAUmoCmH.js"},{"revision":null,"url":"assets/LaunchOutlined-SrMQHpJM.js"},{"revision":null,"url":"assets/layout-l6KrRo_j.js"},{"revision":null,"url":"assets/Link-5b2HVhJS.js"},{"revision":null,"url":"assets/list-header-C_S_alCD.js"},{"revision":null,"url":"assets/ListItemText-BWOzBiMo.js"},{"revision":null,"url":"assets/LoadingButton-CK30gWPr.js"},{"revision":null,"url":"assets/localization-Bewup7q7.js"},{"revision":null,"url":"assets/LockIcon-DSoFeiUW.js"},{"revision":null,"url":"assets/log-Ch42uXqw.js"},{"revision":null,"url":"assets/log-D33dFtt_.css"},{"revision":null,"url":"assets/login-BxjyT1qS.js"},{"revision":null,"url":"assets/login-oauth-callback-C6s-4b1V.js"},{"revision":null,"url":"assets/logo-uploader-CGtIsD0T.js"},{"revision":null,"url":"assets/Loop-CBPEms0Q.js"},{"revision":null,"url":"assets/lost-passport-By5cjQFH.js"},{"revision":null,"url":"assets/lottie-DVm7n_Um.js"},{"revision":null,"url":"assets/mode-B2dWMeTO.js"},{"revision":null,"url":"assets/MoreHoriz-D2VMH51n.js"},{"revision":null,"url":"assets/MoreVert-BEZvlzF-.js"},{"revision":null,"url":"assets/notifications-CEpa_xHz.js"},{"revision":null,"url":"assets/OpenInNew-Ck3ijqlL.js"},{"revision":null,"url":"assets/overview-GOUiKG2a.js"},{"revision":null,"url":"assets/page-header-COyUenU-.js"},{"revision":null,"url":"assets/Pagination-DYCSDEOZ.js"},{"revision":null,"url":"assets/permission-DWzaHXWC.js"},{"revision":null,"url":"assets/PlayArrow-Bep57q0l.js"},{"revision":null,"url":"assets/preact.module-B1z5cdvs.js"},{"revision":null,"url":"assets/preferences-CE-9QBFo.js"},{"revision":null,"url":"assets/pt-BxA88dKG.js"},{"revision":null,"url":"assets/pt-Dly5Myel.js"},{"revision":null,"url":"assets/publish-resource-UvJbVy1r.js"},{"revision":null,"url":"assets/QuestionMarkCircle-BRJ6UWDC.js"},{"revision":null,"url":"assets/RadioGroup-DjYscIah.js"},{"revision":null,"url":"assets/react-BW7E7-P9.css"},{"revision":null,"url":"assets/react-CY_QENHU.js"},{"revision":null,"url":"assets/redux-CTTkxs7M.js"},{"revision":null,"url":"assets/resource-dialog-CfRq8NMl.js"},{"revision":null,"url":"assets/ru-C9Wh9IKf.js"},{"revision":null,"url":"assets/ru-C9WJaQoQ.js"},{"revision":null,"url":"assets/Search-DFMpNFHb.js"},{"revision":null,"url":"assets/Select-B59j8vqU.js"},{"revision":null,"url":"assets/selector-BEck9RSE.js"},{"revision":null,"url":"assets/ServerLogo-B-brfx83.js"},{"revision":null,"url":"assets/session-CVIETtuz.js"},{"revision":null,"url":"assets/setup-CkCZJ55S.js"},{"revision":null,"url":"assets/Skeleton-CjiEfCyO.js"},{"revision":null,"url":"assets/slicedToArray-DCpTgETk.js"},{"revision":null,"url":"assets/Slider-BJkaec7K.js"},{"revision":null,"url":"assets/spaces-BFbdkHH8.js"},{"revision":null,"url":"assets/start-CvZw2F8k.js"},{"revision":null,"url":"assets/step-actions-5tGgPrhF.js"},{"revision":null,"url":"assets/Stepper-JkeBEOuY.js"},{"revision":null,"url":"assets/studio-CGE88nOP.js"},{"revision":null,"url":"assets/switch-control-DBbuPW4q.js"},{"revision":null,"url":"assets/TextField-C5D15Ugf.js"},{"revision":null,"url":"assets/th-B6Z2fc62.js"},{"revision":null,"url":"assets/th-z7LSYRZi.js"},{"revision":null,"url":"assets/Toolbar-CSkIjhiI.js"},{"revision":null,"url":"assets/toPropertyKey-hKuLU48H.js"},{"revision":null,"url":"assets/toUpper-DTIWej6b.js"},{"revision":null,"url":"assets/transfer-26ConaJn.js"},{"revision":null,"url":"assets/uniqBy-BF_2_CqX.js"},{"revision":null,"url":"assets/unsubscribe-Cwx3CGkA.js"},{"revision":null,"url":"assets/use-blocklet-info-for-connect-did-spaces-DXCdpGY7.js"},{"revision":null,"url":"assets/use-mobile-DTODc0Do.js"},{"revision":null,"url":"assets/use-passport-id-B-b-_oYF.js"},{"revision":null,"url":"assets/useAsync-BIhajT1g.js"},{"revision":null,"url":"assets/useFormControl-D74Gykn0.js"},{"revision":null,"url":"assets/useLocalStorage-CTTJpYi8.js"},{"revision":null,"url":"assets/user-center-BurgeGnu.js"},{"revision":null,"url":"assets/user-sessions-DFuVpXta.js"},{"revision":null,"url":"assets/useSetState-B8DWdra7.js"},{"revision":null,"url":"assets/useSlot-C0EbF40A.js"},{"revision":null,"url":"assets/util-BfdLSo0f.js"},{"revision":null,"url":"assets/vi-CAtyUyNW.js"},{"revision":null,"url":"assets/vi-Di0ynKe6.js"},{"revision":null,"url":"assets/ViewList-BKInLQTN.js"},{"revision":null,"url":"assets/wrap-locale-mANFn3Dq.js"},{"revision":null,"url":"assets/zh-BVBeddUa.js"},{"revision":null,"url":"assets/zh-e04FR-Ps.js"},{"revision":null,"url":"assets/zh-tw-CoStw7dd.js"},{"revision":null,"url":"assets/zh-tw-DlepKNg6.js"},{"revision":"2d0b0c1e97840c857577864652106b74","url":"index.html"},{"revision":"186b2f1889d7c89ecd30e422ab415c8a","url":"registerSW.js"},{"revision":"07a287e43ae8e959a20d6b367a581667","url":"router-template-styles/styles.css"},{"revision":"ecdddc9b1297e7511cad18529d5cfd89","url":"manifest.webmanifest"}]||[]).filter(s=>s.url!=="/"&&!s.url.includes("index.html")));pe();self.addEventListener("activate",()=>{console.log("Service Worker activated")});self.addEventListener("install",s=>{console.log("Service Worker installed"),s.waitUntil(self.skipWaiting())});const re=s=>!!(s.method!=="GET"||s.url.includes("/api")||s.url.includes("__meta__.js")||s.url.includes("__blocklet__.js"));te(s=>{const{request:e}=s;return re(e)?!1:e.url.includes("/static/")},new mt({cacheName:"static",plugins:[new ut({maxEntries:200})]}));te(s=>{const{request:e}=s;return re(e)?!1:e.url.includes("/images/")||e.url.includes("/router/-template-styles/")},new yt);
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.28-beta-23b06b63",
6
+ "version": "1.16.28-beta-bfbab430",
7
7
  "description": "Provide unified services for every blocklet",
8
8
  "main": "api/index.js",
9
9
  "files": [
@@ -33,17 +33,17 @@
33
33
  "author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
34
34
  "license": "Apache-2.0",
35
35
  "dependencies": {
36
- "@abtnode/analytics": "1.16.28-beta-23b06b63",
37
- "@abtnode/auth": "1.16.28-beta-23b06b63",
38
- "@abtnode/client": "1.16.28-beta-23b06b63",
39
- "@abtnode/connect-storage": "1.16.28-beta-23b06b63",
40
- "@abtnode/constant": "1.16.28-beta-23b06b63",
41
- "@abtnode/core": "1.16.28-beta-23b06b63",
42
- "@abtnode/cron": "1.16.28-beta-23b06b63",
43
- "@abtnode/logger": "1.16.28-beta-23b06b63",
44
- "@abtnode/models": "1.16.28-beta-23b06b63",
45
- "@abtnode/router-templates": "1.16.28-beta-23b06b63",
46
- "@abtnode/util": "1.16.28-beta-23b06b63",
36
+ "@abtnode/analytics": "1.16.28-beta-bfbab430",
37
+ "@abtnode/auth": "1.16.28-beta-bfbab430",
38
+ "@abtnode/client": "1.16.28-beta-bfbab430",
39
+ "@abtnode/connect-storage": "1.16.28-beta-bfbab430",
40
+ "@abtnode/constant": "1.16.28-beta-bfbab430",
41
+ "@abtnode/core": "1.16.28-beta-bfbab430",
42
+ "@abtnode/cron": "1.16.28-beta-bfbab430",
43
+ "@abtnode/logger": "1.16.28-beta-bfbab430",
44
+ "@abtnode/models": "1.16.28-beta-bfbab430",
45
+ "@abtnode/router-templates": "1.16.28-beta-bfbab430",
46
+ "@abtnode/util": "1.16.28-beta-bfbab430",
47
47
  "@arcblock/did": "^1.18.123",
48
48
  "@arcblock/did-auth": "1.18.123",
49
49
  "@arcblock/did-ext": "^1.18.123",
@@ -52,11 +52,11 @@
52
52
  "@arcblock/jwt": "1.18.123",
53
53
  "@arcblock/validator": "^1.18.123",
54
54
  "@arcblock/ws": "1.18.123",
55
- "@blocklet/constant": "1.16.28-beta-23b06b63",
55
+ "@blocklet/constant": "1.16.28-beta-bfbab430",
56
56
  "@blocklet/form-builder": "^0.1.11",
57
57
  "@blocklet/form-collector": "^0.1.8",
58
- "@blocklet/meta": "1.16.28-beta-23b06b63",
59
- "@blocklet/sdk": "1.16.28-beta-23b06b63",
58
+ "@blocklet/meta": "1.16.28-beta-bfbab430",
59
+ "@blocklet/sdk": "1.16.28-beta-bfbab430",
60
60
  "@did-connect/authenticator": "^2.2.4",
61
61
  "@did-connect/relay-adapter-express": "^2.2.4",
62
62
  "@ocap/client": "1.18.123",
@@ -98,14 +98,14 @@
98
98
  "minimatch": "9.0.4"
99
99
  },
100
100
  "devDependencies": {
101
- "@abtnode/ux": "1.16.28-beta-23b06b63",
101
+ "@abtnode/ux": "1.16.28-beta-bfbab430",
102
102
  "@arcblock/bridge": "^2.9.90",
103
103
  "@arcblock/did-connect": "^2.9.90",
104
104
  "@arcblock/icons": "^2.9.90",
105
105
  "@arcblock/react-hooks": "^2.9.90",
106
106
  "@arcblock/ux": "^2.9.90",
107
107
  "@blocklet/launcher-layout": "2.3.21",
108
- "@blocklet/tracker": "1.16.28-beta-23b06b63",
108
+ "@blocklet/tracker": "1.16.28-beta-bfbab430",
109
109
  "@blocklet/ui-react": "^2.9.90",
110
110
  "@emotion/react": "^11.11.4",
111
111
  "@emotion/styled": "^11.11.5",
@@ -178,5 +178,5 @@
178
178
  "url": "https://github.com/ArcBlock/blocklet-server/issues",
179
179
  "email": "shijun@arcblock.io"
180
180
  },
181
- "gitHead": "4e16d8cb992139e25f6702268895917561a1d2f1"
181
+ "gitHead": "f1fbf0752de46be00d1faa0d54eb7d28016e0bb9"
182
182
  }
@@ -1 +0,0 @@
1
- import{bY as a}from"./index-CJG6DxXB.js";a.defaults.timeout=10*1e3;const o=a.create();export{o as a};