@abtnode/blocklet-services 1.16.34-beta-20241204-140321-4d75ca21 → 1.16.34-beta-20241205-145120-3a7aa096

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 (285) hide show
  1. package/api/libs/connect/session.js +4 -4
  2. package/api/middlewares/check-federated.js +157 -0
  3. package/api/routes/federated.js +529 -573
  4. package/api/routes/oauth.js +32 -54
  5. package/api/routes/user-session.js +239 -214
  6. package/api/routes/user.js +52 -45
  7. package/api/services/auth/connect/invite.js +1 -1
  8. package/api/services/auth/connect/issue-passport.js +1 -1
  9. package/api/services/auth/session.js +31 -9
  10. package/api/util/attach-shared-utils.js +6 -6
  11. package/api/util/federated.js +28 -72
  12. package/dist/assets/Add-CEkiASJk.js +1 -0
  13. package/dist/assets/{Alert-XwCbbCdw.js → Alert-D7cZ7kYh.js} +1 -1
  14. package/dist/assets/ArrowDropDown-CNA2YBpw.js +1 -0
  15. package/dist/assets/{Autocomplete-CtKfl8OV.js → Autocomplete-DqOPJmfP.js} +1 -1
  16. package/dist/assets/{Avatar-BuTYVz6S.js → Avatar-CC2uCgJO.js} +1 -1
  17. package/dist/assets/{ButtonGroup-9mTO_MUt.js → ButtonGroup-DVkbPyCf.js} +1 -1
  18. package/dist/assets/{CSSTransition-VPmtoKE7.js → CSSTransition-CAyoWadY.js} +1 -1
  19. package/dist/assets/CheckCircle-ne5PaInr.js +1 -0
  20. package/dist/assets/ChevronLeft-CzFyG6B9.js +1 -0
  21. package/dist/assets/ChevronRight-D28wkT_7.js +1 -0
  22. package/dist/assets/Delete-W0XHLr5E.js +1 -0
  23. package/dist/assets/DeleteOutline-CBAPet9Y.js +1 -0
  24. package/dist/assets/DialogContentText-DF6wXq4v.js +1 -0
  25. package/dist/assets/Done-BMgw3G29.js +1 -0
  26. package/dist/assets/Download-CWu1DNgF.js +1 -0
  27. package/dist/assets/{EditIcon-D5uy6dXe.js → EditIcon-L7k3tqrQ.js} +1 -1
  28. package/dist/assets/Error-DewSa72i.js +1 -0
  29. package/dist/assets/ExpandMore-dR0m3faK.js +1 -0
  30. package/dist/assets/FormControl-C3U9aSdK.js +1 -0
  31. package/dist/assets/{FormControlLabel-Ka9Y3VW4.js → FormControlLabel-uhzkWhIR.js} +1 -1
  32. package/dist/assets/FormGroup-zmk2zBRp.js +1 -0
  33. package/dist/assets/{Google-fmIzZ4SE.js → Google-BJOVX6-i.js} +1 -1
  34. package/dist/assets/{Grid-CLg9BKgo.js → Grid-CRcYquo8.js} +1 -1
  35. package/dist/assets/HelpOutline-1C4eFcXT.js +1 -0
  36. package/dist/assets/Hidden-C6Nsczh0.js +1 -0
  37. package/dist/assets/InfoOutlined-0F0dMk0M.js +1 -0
  38. package/dist/assets/{InputAdornment-7bcT-OxU.js → InputAdornment-HjZlszj5.js} +1 -1
  39. package/dist/assets/{LastPage-BNIPjfIv.js → LastPage-C8Ibu_ZS.js} +1 -1
  40. package/dist/assets/Launch-_9WY6qT8.js +1 -0
  41. package/dist/assets/LaunchOutlined-DpBWMSDU.js +1 -0
  42. package/dist/assets/{Link-Dgz_hg-A.js → Link-BHzX6Bty.js} +1 -1
  43. package/dist/assets/{ListItemButton-COVroopz.js → ListItemButton-Bg2hcpe4.js} +1 -1
  44. package/dist/assets/{ListSubheader-DoFPqSxT.js → ListSubheader-BnOsaMFL.js} +1 -1
  45. package/dist/assets/{LoadingButton-Cpsng3ic.js → LoadingButton-DHvQ4mj0.js} +1 -1
  46. package/dist/assets/{LockIcon-xMd6TgDT.js → LockIcon-BF2LVzIr.js} +1 -1
  47. package/dist/assets/Loop-DwW0YmEY.js +1 -0
  48. package/dist/assets/MarkEmailRead-BUgtVfuj.js +1 -0
  49. package/dist/assets/Menu-C0_eNw-R.js +1 -0
  50. package/dist/assets/MoreHoriz-B3eBOSmM.js +1 -0
  51. package/dist/assets/MoreVert-9FUIKqvo.js +1 -0
  52. package/dist/assets/OpenInNew-IfJ9_ovA.js +1 -0
  53. package/dist/assets/{Pagination-BdODbVsE.js → Pagination-KTMAbLPe.js} +1 -1
  54. package/dist/assets/PlayArrow-BzCvLnOA.js +1 -0
  55. package/dist/assets/{QuestionMarkCircle-CeLvEIhA.js → QuestionMarkCircle-Bp1qdiMj.js} +1 -1
  56. package/dist/assets/{RadioGroup-CkuUb_-r.js → RadioGroup-D6iB2v9N.js} +1 -1
  57. package/dist/assets/Search-CeQJr6Zd.js +1 -0
  58. package/dist/assets/{Select-BM5xijW7.js → Select-63T17LTs.js} +2 -2
  59. package/dist/assets/{ServerLogo-CocwN-L6.js → ServerLogo-BjD55kNo.js} +1 -1
  60. package/dist/assets/{Skeleton-BQ4gLbdR.js → Skeleton-Cguhg4Uf.js} +5 -5
  61. package/dist/assets/{Stack-690-8aHU.js → Stack-B2wvO5ch.js} +1 -1
  62. package/dist/assets/{Stepper-DPFFvB9h.js → Stepper-Cf6EXzKT.js} +1 -1
  63. package/dist/assets/{TextField-CFRK87D0.js → TextField-DaxOve82.js} +1 -1
  64. package/dist/assets/{Toolbar-Ba22YRhW.js → Toolbar-CbY6pPMn.js} +1 -1
  65. package/dist/assets/ViewColumn-BSkUFzQn.js +1 -0
  66. package/dist/assets/ViewList-BJW4-xJh.js +1 -0
  67. package/dist/assets/{_createAggregator-Ct5VkIH5.js → _createAggregator-gmWpxOiT.js} +1 -1
  68. package/dist/assets/access-control-hkwSmrDz.js +13 -0
  69. package/dist/assets/{actions-R7d7-bh3.js → actions-mviDIL98.js} +1 -1
  70. package/dist/assets/{add-component-core-qARkFBQB.js → add-component-core-D8ycTCOD.js} +10 -10
  71. package/dist/assets/add-resource-Dvlc6tV9.js +1 -0
  72. package/dist/assets/{addon-BJli1WRW.js → addon-CBWbLYEt.js} +1 -1
  73. package/dist/assets/{analytics-B3iUwhYK.js → analytics-DEYYvSpr.js} +7 -7
  74. package/dist/assets/api-09lpjN_y.js +1 -0
  75. package/dist/assets/{ar-7AvHBDLJ.js → ar-BENken66.js} +1 -1
  76. package/dist/assets/audit-logs-CKasQ1r7.js +58 -0
  77. package/dist/assets/{base32-Mo2B3fHT.js → base32-BodeVrwr.js} +1 -1
  78. package/dist/assets/{branding-BThKyvoW.js → branding-C6L3eHHi.js} +2 -2
  79. package/dist/assets/bundle-avatar-DGCY6XtV.js +1 -0
  80. package/dist/assets/{button-eTEsJSJ0.js → button-_kh3esRx.js} +1 -1
  81. package/dist/assets/{click-to-copy-CkFI8a1W.js → click-to-copy-Dhz68Zb7.js} +1 -1
  82. package/dist/assets/{complete-Bb-6z_26.js → complete-CbF_9acR.js} +4 -4
  83. package/dist/assets/{component-kGv-hUvT.js → component-TW3Q8q-H.js} +2 -2
  84. package/dist/assets/{config-BVYueZpV.js → config-DOKBlczF.js} +2 -2
  85. package/dist/assets/config-NLq72VC7.js +1 -0
  86. package/dist/assets/{config-navigation-NUbYVs4N.js → config-navigation-BrZYJfdX.js} +5 -5
  87. package/dist/assets/config-space-CgNK0LkG.js +1 -0
  88. package/dist/assets/{confirm-CIF7Vu-X.js → confirm-CgBlPewa.js} +1 -1
  89. package/dist/assets/{connect-Dj-BrpmM.js → connect-BLWlkmzZ.js} +2 -2
  90. package/dist/assets/connect-BoJDz_r9.js +1 -0
  91. package/dist/assets/{connect-to-ZJr8_Nq9.js → connect-to-Bjjro7dm.js} +1 -1
  92. package/dist/assets/{content-layout-DSpN7kL2.js → content-layout-De6X9MfH.js} +1 -1
  93. package/dist/assets/{dashboard-BUsMb2Wm.js → dashboard-DNfo36ET.js} +7 -7
  94. package/dist/assets/{de-S6ufmRx0.js → de-C8d8saMJ.js} +1 -1
  95. package/dist/assets/{deprecate-W6wP2f1U.js → deprecate-C8CVzteH.js} +1 -1
  96. package/dist/assets/{did-address-DpP51eII.js → did-address-CQAHayeq.js} +1 -1
  97. package/dist/assets/domain-4tz_iUAg.js +9 -0
  98. package/dist/assets/domain-list-CSCowbSF.js +15 -0
  99. package/dist/assets/{email-DETfN-BC.js → email-B7GCHFcD.js} +3 -3
  100. package/dist/assets/emotion-cache.browser.esm-7imm0F3K.js +1 -0
  101. package/dist/assets/{es-Sth9cv6C.js → es-8ZzWXB3U.js} +1 -1
  102. package/dist/assets/exchange-passport-BMGoDnTe.js +1 -0
  103. package/dist/assets/{fallback-CTOpqcoo.js → fallback-xgYg9R2J.js} +1 -1
  104. package/dist/assets/form-text-input-D8gtQI8g.js +11 -0
  105. package/dist/assets/{format-error-jTY-wvGv.js → format-error-kGGriKiA.js} +2 -2
  106. package/dist/assets/{fr-BX6bo8e1.js → fr-CDmTLuDM.js} +1 -1
  107. package/dist/assets/{fuel-Dx06V-YR.js → fuel-NUdjiJCN.js} +1 -1
  108. package/dist/assets/{fullpage-Dz8PPWdq.js → fullpage-BVHpRAYk.js} +1 -1
  109. package/dist/assets/{hi-pYobKga6.js → hi-DfYUKMCb.js} +1 -1
  110. package/dist/assets/{home-BCoo1Guo.js → home-rJKruo1j.js} +1 -1
  111. package/dist/assets/{id-Xei40tOm.js → id-BeY7iur-.js} +1 -1
  112. package/dist/assets/{iframe-GN8AUKA4.js → iframe-Cv3PJcvz.js} +1 -1
  113. package/dist/assets/index-6GwWrwWj.js +16 -0
  114. package/dist/assets/{index-cIe0Ged1.js → index-B2zxMB5n.js} +1 -1
  115. package/dist/assets/{index-B019qXp1.js → index-BHrceiDz.js} +1 -1
  116. package/dist/assets/{index-BDxuBkP1.js → index-BIDxxb9t.js} +1 -1
  117. package/dist/assets/{index-COdSzYad.js → index-BILgagmI.js} +2 -2
  118. package/dist/assets/{index-Bs9TLgSC.js → index-BM0eHOUA.js} +2 -2
  119. package/dist/assets/index-BaLRQJTh.js +102 -0
  120. package/dist/assets/{index-B3pPqycI.js → index-BlTIDXDG.js} +1 -1
  121. package/dist/assets/{index-BidszMO2.js → index-BnljNGH7.js} +38 -38
  122. package/dist/assets/{index-W2CQmt_X.js → index-BxZgdCUX.js} +2 -2
  123. package/dist/assets/{index-delqLXRr.js → index-C-s0lU62.js} +8 -8
  124. package/dist/assets/index-CBp5iNXP.js +1 -0
  125. package/dist/assets/{index-4RJk4AiM.js → index-CETPQNRT.js} +1 -1
  126. package/dist/assets/{index-yi-655mj.js → index-CKLF9fLH.js} +1 -1
  127. package/dist/assets/{index-BjfhU-QW.js → index-CMY8zSjT.js} +1 -1
  128. package/dist/assets/{index-ZPFypmuO.js → index-CTGtgEeG.js} +1 -1
  129. package/dist/assets/{index-BXHMtAUn.js → index-C_vk9fqw.js} +2 -2
  130. package/dist/assets/{index-q1m8Euwz.js → index-CuHWguJg.js} +1 -1
  131. package/dist/assets/{index-BxKrUgd9.js → index-Cu_bNPbk.js} +70 -70
  132. package/dist/assets/index-D1YHjvRT.js +4 -0
  133. package/dist/assets/{index-CG1XIXZC.js → index-D1YU1vFk.js} +1 -1
  134. package/dist/assets/{index-BzVm0XuZ.js → index-D2d4qfN2.js} +1 -1
  135. package/dist/assets/{index-UEoZJA9L.js → index-DAKGZhdR.js} +1 -1
  136. package/dist/assets/index-DQrMXKph.js +1 -0
  137. package/dist/assets/{index-CYQV6023.js → index-DToO2H3Q.js} +12 -12
  138. package/dist/assets/{index-DgonWrzm.js → index-DeYzXL4z.js} +4 -4
  139. package/dist/assets/{index-BP0LEaeg.js → index-DpZHKufu.js} +8 -8
  140. package/dist/assets/index-DqjLLD7P.js +5 -0
  141. package/dist/assets/{index-CjkNshyI.js → index-Dt4OruAC.js} +1 -1
  142. package/dist/assets/{index-B_EeAcSB.js → index-HYjTpFy9.js} +1 -1
  143. package/dist/assets/index-J3ZVv3j-.js +316 -0
  144. package/dist/assets/{index-rA_BKM5G.js → index-MtDT2QJN.js} +3 -3
  145. package/dist/assets/{index-8OiEpVkg.js → index-ag_Qlo60.js} +1 -1
  146. package/dist/assets/{index-B3Z8DzsY.js → index-mFPL7bdj.js} +3 -3
  147. package/dist/assets/{index-Db_Y81_-.js → index-nKobfUQ1.js} +1 -1
  148. package/dist/assets/{invitation-BPrK4inJ.js → invitation-DLNLgy6r.js} +5 -5
  149. package/dist/assets/invite-DPYR6t3s.js +5 -0
  150. package/dist/assets/{isEmail-BnC4loew.js → isEmail-i2tngnJi.js} +1 -1
  151. package/dist/assets/{issue-passport-573OuQnm.js → issue-passport-CBrIp3jc.js} +1 -1
  152. package/dist/assets/item-Brjh4PLo.js +1 -0
  153. package/dist/assets/{ja-DG0a06x8.js → ja-DvJTZg_Q.js} +1 -1
  154. package/dist/assets/{jss-plugin-props-sort.esm-Bp0MqRVc.js → jss-plugin-props-sort.esm-BX_bur4g.js} +4 -4
  155. package/dist/assets/{ko-BBC-RcU5.js → ko-C1lnK-Gx.js} +1 -1
  156. package/dist/assets/{launch-result-message-4m30f0Ag.js → launch-result-message-DF58OHNC.js} +1 -1
  157. package/dist/assets/{layout-Btp-_hcD.js → layout-BZwnld0E.js} +2 -2
  158. package/dist/assets/{list-header-DQEePd_T.js → list-header-DKFtTh4o.js} +1 -1
  159. package/dist/assets/localization-DIaD7pty.js +1 -0
  160. package/dist/assets/{log-DGIf8qzM.js → log-DcFRCLCX.js} +1 -1
  161. package/dist/assets/login-Bf5SQlPn.js +1 -0
  162. package/dist/assets/login-oauth-callback-BU7Pl33l.js +1 -0
  163. package/dist/assets/{logo-uploader-CC8WqbW-.js → logo-uploader-BbCcpszA.js} +4 -4
  164. package/dist/assets/{lost-passport-D_HnDqKr.js → lost-passport-D3RvUegp.js} +4 -4
  165. package/dist/assets/{lottie-react.esm-CtltdV0t.js → lottie-react.esm-ZH4Wk5XO.js} +1 -1
  166. package/dist/assets/notifications-BkSUBEzY.js +65 -0
  167. package/dist/assets/{open-window-CmBy5HkH.js → open-window-CSdTLwaf.js} +1 -1
  168. package/dist/assets/overview-DXC_j46y.js +12 -0
  169. package/dist/assets/{page-header-B5a7RE0E.js → page-header-Cri_UHX5.js} +1 -1
  170. package/dist/assets/{permission-CBfa-qlX.js → permission-DSn8EOQ9.js} +1 -1
  171. package/dist/assets/{preferences-CuRLxM0K.js → preferences-JFVWkPL4.js} +1 -1
  172. package/dist/assets/{pt-CNmFfxJU.js → pt-C86mXB8Z.js} +1 -1
  173. package/dist/assets/publish-resource-gk91W1J0.js +1 -0
  174. package/dist/assets/{raf-schd.esm-KaxPdV64.js → raf-schd.esm-CpouI05w.js} +1 -1
  175. package/dist/assets/{react-beautiful-dnd.esm-BlBywA4z.js → react-beautiful-dnd.esm-ChA2xoay.js} +1 -1
  176. package/dist/assets/refType-BXcUP-YS.js +1 -0
  177. package/dist/assets/{resource-dialog-DpLtB_Fw.js → resource-dialog-DZPqi5pw.js} +1 -1
  178. package/dist/assets/{ru-BVNv9w91.js → ru-Dxm-iAqn.js} +1 -1
  179. package/dist/assets/sdk-neE1aE7y.js +1 -0
  180. package/dist/assets/{selector-Drr6pXp9.js → selector--uPvisem.js} +4 -4
  181. package/dist/assets/session-D7-00CVs.js +1 -0
  182. package/dist/assets/{setup-cPNeqLVK.js → setup-CMaryrU8.js} +3 -3
  183. package/dist/assets/{shorten-label-DK0L2sJV.js → shorten-label-uAzGTCBy.js} +1 -1
  184. package/dist/assets/{simple-select-CHsQAOYZ.js → simple-select-M9sKVVQT.js} +1 -1
  185. package/dist/assets/{slicedToArray-n9LJBwV4.js → slicedToArray-CHm_9UsL.js} +2 -2
  186. package/dist/assets/{start-CcvndivR.js → start-D5P3Y_Mp.js} +1 -1
  187. package/dist/assets/{step-actions-D_1mpc4C.js → step-actions-DRDtE9i9.js} +2 -2
  188. package/dist/assets/studio-DDRR9uTH.js +6 -0
  189. package/dist/assets/{switch-control-2C3bwebR.js → switch-control-C8d_eiWi.js} +1 -1
  190. package/dist/assets/{th-CObnQ6OH.js → th-BamIf1b8.js} +1 -1
  191. package/dist/assets/{toUpper-DtTJYJCz.js → toUpper-Bq-NIfax.js} +1 -1
  192. package/dist/assets/{transfer-BNPHc5-e.js → transfer-COMtxr-_.js} +2 -2
  193. package/dist/assets/{trim-Boaje3e9.js → trim-Bn0r8NiZ.js} +1 -1
  194. package/dist/assets/{uniqBy-B2B_OSuq.js → uniqBy-Baa3ApX9.js} +1 -1
  195. package/dist/assets/unsubscribe-BUf0fqE6.js +1 -0
  196. package/dist/assets/{url-join-aL0dlRwK.js → url-join-BUPuIN5Z.js} +1 -1
  197. package/dist/assets/use-mobile-BexDu-6x.js +1 -0
  198. package/dist/assets/use-mobile-CUJBViwc.js +1 -0
  199. package/dist/assets/{useAsync-B5aCa8BU.js → useAsync-DlT-wYlz.js} +1 -1
  200. package/dist/assets/{useFormControl-De83T2k8.js → useFormControl-CW2PoJes.js} +1 -1
  201. package/dist/assets/{useLocalStorage-Cg4UWbtJ.js → useLocalStorage-BfN8jDuG.js} +1 -1
  202. package/dist/assets/{useSetState-C5EefhmT.js → useSetState-CKmZy4S9.js} +1 -1
  203. package/dist/assets/useSlot-BDokg4R-.js +1 -0
  204. package/dist/assets/{useSlotProps-9EZsnKiK.js → useSlotProps-BvV0G0yb.js} +1 -1
  205. package/dist/assets/{useThemeProps-DFbMvLjq.js → useThemeProps-28x2bH1r.js} +1 -1
  206. package/dist/assets/user-center-D6WQO8xG.js +1 -0
  207. package/dist/assets/user-sessions-DRnCKb0z.js +1 -0
  208. package/dist/assets/util-ZRcOJEuz.js +1 -0
  209. package/dist/assets/{vi-DPE1cpvE.js → vi-CTEgHnG8.js} +1 -1
  210. package/dist/assets/wrap-locale-Bsx6I5ww.js +1 -0
  211. package/dist/assets/{zh-ZJh718gR.js → zh-C9pcKSvk.js} +1 -1
  212. package/dist/assets/{zh-tw-q3KEUdcz.js → zh-tw-CuhSzmQN.js} +1 -1
  213. package/dist/index.html +1 -1
  214. package/dist/service-worker.js +1 -1
  215. package/package.json +26 -25
  216. package/api/middlewares/verify-federated-call.js +0 -36
  217. package/dist/assets/Add-DtejxYv7.js +0 -1
  218. package/dist/assets/ArrowDropDown-DLu5ghJ6.js +0 -1
  219. package/dist/assets/CheckCircle-BvTAg_Vb.js +0 -1
  220. package/dist/assets/ChevronLeft-CogeEPev.js +0 -1
  221. package/dist/assets/ChevronRight-BATWClLP.js +0 -1
  222. package/dist/assets/Delete-BvK_hDyw.js +0 -1
  223. package/dist/assets/DeleteOutline-CFkN2u6G.js +0 -1
  224. package/dist/assets/DialogContentText-BSTFqlB8.js +0 -1
  225. package/dist/assets/Done-BCayGyaP.js +0 -1
  226. package/dist/assets/Download-3v1IPpRg.js +0 -1
  227. package/dist/assets/Error-KMHXOqQS.js +0 -1
  228. package/dist/assets/ExpandMore-XeiYcXA0.js +0 -1
  229. package/dist/assets/FormControl-D9UzJGr3.js +0 -1
  230. package/dist/assets/FormGroup-BqZ71koG.js +0 -1
  231. package/dist/assets/HelpOutline-D-mVzldg.js +0 -1
  232. package/dist/assets/Hidden-B_FCIv2F.js +0 -1
  233. package/dist/assets/InfoOutlined-fhivWooJ.js +0 -1
  234. package/dist/assets/Launch-B6-uAhbQ.js +0 -1
  235. package/dist/assets/LaunchOutlined-BEenLVbN.js +0 -1
  236. package/dist/assets/Loop-tJ6uJkRI.js +0 -1
  237. package/dist/assets/MarkEmailRead-BNHtpgz2.js +0 -1
  238. package/dist/assets/Menu-CkD81HZ5.js +0 -1
  239. package/dist/assets/MoreHoriz-qqmi4YRC.js +0 -1
  240. package/dist/assets/MoreVert-BZZ4IBOf.js +0 -1
  241. package/dist/assets/OpenInNew-C5XvRsRC.js +0 -1
  242. package/dist/assets/PlayArrow-Cn0cfGNW.js +0 -1
  243. package/dist/assets/Search-DXRr3XZy.js +0 -1
  244. package/dist/assets/ViewColumn-GTnSFOFd.js +0 -1
  245. package/dist/assets/ViewList-BtVWmZJ0.js +0 -1
  246. package/dist/assets/access-control-BmMbklSe.js +0 -13
  247. package/dist/assets/add-resource-lnxpvPO7.js +0 -1
  248. package/dist/assets/api-lbSHYKYc.js +0 -1
  249. package/dist/assets/audit-logs-0TJ_0Mvw.js +0 -58
  250. package/dist/assets/bundle-avatar-CcIs5XOV.js +0 -1
  251. package/dist/assets/config-kysZ8p5u.js +0 -1
  252. package/dist/assets/config-space-BPpdFWKx.js +0 -1
  253. package/dist/assets/connect-DPIWGg69.js +0 -1
  254. package/dist/assets/domain-CcBPnmmR.js +0 -9
  255. package/dist/assets/domain-list-CVn1TPCl.js +0 -15
  256. package/dist/assets/emotion-cache.browser.esm-DkJEKl9I.js +0 -1
  257. package/dist/assets/exchange-passport-BetHiKY_.js +0 -1
  258. package/dist/assets/form-text-input-BUB_rL9o.js +0 -11
  259. package/dist/assets/index-B2fUK0Jg.js +0 -16
  260. package/dist/assets/index-BArNVkrG.js +0 -1
  261. package/dist/assets/index-CQSz6hXt.js +0 -316
  262. package/dist/assets/index-CRK13xk6.js +0 -102
  263. package/dist/assets/index-D_g2YpF8.js +0 -1
  264. package/dist/assets/index-De1VedzO.js +0 -5
  265. package/dist/assets/index-PD8enw5a.js +0 -4
  266. package/dist/assets/invite-VzUmhGJg.js +0 -5
  267. package/dist/assets/item-BoFU04RW.js +0 -1
  268. package/dist/assets/localization-BJhiRnk-.js +0 -1
  269. package/dist/assets/login-Cu5oiCaE.js +0 -1
  270. package/dist/assets/login-oauth-callback-Dim9h4c3.js +0 -1
  271. package/dist/assets/notifications-tGIsoEd6.js +0 -65
  272. package/dist/assets/overview-CmwcUtDq.js +0 -12
  273. package/dist/assets/publish-resource-aoq2ZIeT.js +0 -1
  274. package/dist/assets/refType-CNi4gHMp.js +0 -1
  275. package/dist/assets/sdk-CrAhZvgC.js +0 -1
  276. package/dist/assets/session-BGDxwrDP.js +0 -1
  277. package/dist/assets/studio-BdIpZDRv.js +0 -6
  278. package/dist/assets/unsubscribe-eud8OqTh.js +0 -1
  279. package/dist/assets/use-mobile-D7IK9xm6.js +0 -1
  280. package/dist/assets/use-mobile-TJQ6s1hH.js +0 -1
  281. package/dist/assets/useSlot-DebDFCUQ.js +0 -1
  282. package/dist/assets/user-center-BWtnQHWR.js +0 -1
  283. package/dist/assets/user-sessions-DTvyZm5S.js +0 -1
  284. package/dist/assets/util-BBKZBp8H.js +0 -1
  285. package/dist/assets/wrap-locale-Ci8gmRb6.js +0 -1
@@ -1,4 +1,4 @@
1
- var Ie=n=>{throw TypeError(n)};var $=(n,t,e)=>t.has(n)||Ie("Cannot "+e);var u=(n,t,e)=>($(n,t,"read from private field"),e?e.call(n):t.get(n)),M=(n,t,e)=>t.has(n)?Ie("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),R=(n,t,e,r)=>($(n,t,"write to private field"),r?r.call(n,e):t.set(n,e),e),A=(n,t,e)=>($(n,t,"access private method"),e);var ee=(n,t,e,r)=>({set _(o){R(n,t,o,e)},get _(){return u(n,t,r)}});import{c3 as _t,c as I,w as j,al as Ot,a1 as Rt,U as It,eI as Qe,u as Lt,l as Dt,bG as qe,bF as Nt,r as c,Z as wt,$ as yt,j as a,c2 as xt,d1 as vt,aE as kt,bu as bt,B as k,i as Ft,eJ as $e,a as Ce,bh as Bt,D as Ut,k as Le,cE as Mt,eK as Pt,cD as Ht,T as Q,aw as jt,a3 as De,n as Vt,eL as Ne,N as Kt,b as Gt}from"./index-BxKrUgd9.js";import{d as zt}from"./OpenInNew-C5XvRsRC.js";import{i as et}from"./index-CG1XIXZC.js";import{L as q}from"./Link-Dgz_hg-A.js";import{S as Wt}from"./Stack-690-8aHU.js";import{S as Xt}from"./Skeleton-BQ4gLbdR.js";import{d as Jt}from"./HelpOutline-D-mVzldg.js";import{S as we}from"./index-B2fUK0Jg.js";import{D as Zt}from"./DialogContentText-BSTFqlB8.js";import{T as Yt}from"./TextField-CFRK87D0.js";const Qt=Object.freeze({AUTH:"auth"}),fe=Object.freeze({OWNER:"owner",ADMIN:"admin",MEMBER:"member",GUEST:"guest"}),C=Object.freeze({...fe,CI:"ci",CERTIFICATE:"certificate",BLOCKLET_OWNER:"blocklet-owner",BLOCKLET_ADMIN:"blocklet-admin",BLOCKLET_MEMBER:"blocklet-member",BLOCKLET_SDK:"blocklet-sdk",EXTERNAL_BLOCKLET_CONTROLLER:"external-blocklet-controller",EXTERNAL_BLOCKLETS_MANAGER:"external-blocklets-manager"}),qt=Object.freeze({BLOCKLET_GUEST:"blocklet-guest"}),tt=[C.BLOCKLET_OWNER,C.BLOCKLET_ADMIN,C.BLOCKLET_MEMBER,C.BLOCKLET_SDK],$t=n=>n&&tt.includes(n),en=[C.BLOCKLET_OWNER,C.BLOCKLET_ADMIN,C.BLOCKLET_MEMBER,C.BLOCKLET_SDK,qt.BLOCKLET_GUEST],tn=n=>n&&en.includes(n),nn={USER:"user",OWNERSHIP_NFT:"ownership_nft",BLOCKLET_USER:"blocklet_user",BLOCKLET_CONTROLLER:"blocklet_controller"},rn={roles:Object.freeze([{name:C.OWNER,title:"Owner",description:"Has full administrative access to the Blocklet Server",passport:!0},{name:C.ADMIN,title:"Admin",description:"Has full permissions to manage blocklet and Blocklet Server such as install/remove/start/stop blocklet, manage blocklet URL mapping and certificates, manage blocklet team, manage node integrations and access keys, upgrade node to a new version",passport:!0},{name:C.MEMBER,title:"Member",description:"Has permissions to manage blocklets, such as install/remove/start/stop blocklet, manage blocklet URL mapping and certificates",passport:!0},{name:C.GUEST,title:"Guest",description:"Has all read permissions on Blocklet Server",passport:!0},{name:C.CI,title:"CI",description:"Deploy blocklet to Blocklet Server",passport:!0,noHuman:!0},{name:C.CERTIFICATE,title:"Certificate",description:"Manage https certificates for blocklets on the Blocklet Server",passport:!0,noHuman:!0},{name:C.BLOCKLET_OWNER,title:"Blocklet Owner"},{name:C.BLOCKLET_ADMIN,title:"Blocklet Admin"},{name:C.BLOCKLET_MEMBER,title:"Blocklet Member"},{name:C.BLOCKLET_SDK,title:"Blocklet SDK"},{name:C.EXTERNAL_BLOCKLET_CONTROLLER,title:"External Blocklet Controller"},{name:C.EXTERNAL_BLOCKLETS_MANAGER,title:"External Blocklets Manager",description:"Manage external blocklets in the Blocklet Server",passport:!0,noHuman:!0}]),permissions:Object.freeze([{name:"query_node",description:"View node data, include dashboard and node settings, log stream for both Blocklet Server and blocklets"},{name:"mutate_node",description:"Change node settings, upgrade node to a new version"},{name:"query_session",description:"Get data from a long running session"},{name:"mutate_session",description:"Start/update/end a long running session"},{name:"query_accessKey",description:"View access keys for Blocklet Server"},{name:"mutate_accessKey",description:"Manage access keys for Blocklet Server, such as create/update/delete"},{name:"query_team",description:"View team data(members/roles/permissions) for Blocklet Server and blocklets"},{name:"mutate_team",description:"Manage team data(members/roles/permissions) for Blocklet Server and blocklets"},{name:"query_blocklets",description:"View store and installed blocklets, including blocklet runtime configuration, domains and urls"},{name:"mutate_blocklets",description:"Perform state changing actions on blocklets, such as install/upgrade/config/start/stop/remove"},{name:"query_router",description:"View sites, URL mapping and certificates in service gateway"},{name:"mutate_router",description:"Manage sites, URL mapping and certificates in service gateway"},{name:"query_certificate",description:"View certificates in service gateway"},{name:"mutate_certificate",description:"Manage certificates in service gateway"},{name:"query_notification",description:"View notifications"},{name:"mutate_notification",description:"Manage notifications, such as mark notifications as read"},{name:"query_webhook",description:"View integrations"},{name:"mutate_webhook",description:"Manage integrations"},{name:"query_blocklet",description:"View a blocklet, including blocklet runtime configuration, domains and urls"},{name:"mutate_blocklet",description:"Perform state changing actions on a blocklet, such as upgrade/config/start/stop"}]),grants:Object.freeze({[C.GUEST]:["query_blocklets","query_router","query_webhook","query_notification","query_team","query_accessKey","query_node","query_session"],[C.MEMBER]:[C.GUEST,"mutate_blocklets","mutate_router","mutate_notification","mutate_session"],[C.ADMIN]:[C.MEMBER,"mutate_team","mutate_webhook","mutate_accessKey","mutate_node","mutate_certificate"],[C.OWNER]:[fe.ADMIN],[C.CI]:["query_blocklets","mutate_blocklets"],[C.CERTIFICATE]:["query_certificate","mutate_certificate"],[C.BLOCKLET_SDK]:["query_team","mutate_team","query_blocklet"],[C.BLOCKLET_OWNER]:[C.BLOCKLET_ADMIN],[C.BLOCKLET_ADMIN]:[C.BLOCKLET_MEMBER,"mutate_team","mutate_blocklet","mutate_notification"],[C.BLOCKLET_MEMBER]:["query_team","query_blocklet","query_notification"],[C.EXTERNAL_BLOCKLET_CONTROLLER]:["query_blocklets","mutate_blocklets"],[C.EXTERNAL_BLOCKLETS_MANAGER]:["query_blocklets","mutate_blocklets"]})},ye=24*60*60*1e3,on={NOTIFICATION_CREATE:"notification.create",NOTIFICATION_BLOCKLET_CREATE:"notification.blockletCreate",ROUTING_UPDATED:"routing.updated",NODE_UPDATED:"node.updated",NODE_MAINTAIN_PROGRESS:"node.upgrade.progress",NODE_STARTED:"node.started",NODE_STOPPED:"node.stopped",NODE_ADDED_OWNER:"node.addedOwner",NODE_RUNTIME_INFO:"node.runtimeInfo",BLOCKLETS_RUNTIME_INFO:"node.blockletsRuntimeInfo",DOMAIN_STATUS:"domain.status",CERT_ADDED:"cert.added",CERT_ISSUED:"cert.issued",CERT_UPDATED:"cert.updated",CERT_REMOVED:"cert.removed",CERT_ERROR:"cert.error",RELOAD_GATEWAY:"gateway.reload"},sn=Object.freeze({OWNER:"owner",ADMIN:"admin",INVITED:"invited",ALL:"all"}),xe="https://store.blocklet.dev",ve="https://dev.store.blocklet.dev",an="https://main.abtnetwork.io/api/",cn=Object.freeze({DERIVED:"derived",WALLET:"wallet"}),ln={STATUS:{PROGRESS:null,SUCCEEDED:0,FAILED:1},TIMEOUT_HOURS:6,STRATEGY:{AUTO:0,MANUAL:1},JOB:{INTERVAL:2*60*60}},un={STATUS:{PROGRESS:null,SUCCEEDED:0,FAILED:1},TIMEOUT_HOURS:6,STRATEGY:{AUTO:0,MANUAL:1},JOB:{INTERVAL:2*60*60}},nt=10,pn=86400/nt,dn={SYNC_LIMIT:3},En=[{text:"Plain Text",value:"text/plain"},{text:"JSON",value:"application/json"},{text:"XML",value:"application/xml"},{text:"HTML Document",value:"text/html"},{text:"YAML",value:"application/x-yaml"},{text:"TOML",value:"application/toml"},{text:"CSS",value:"text/css"},{text:"JavaScript",value:"application/javascript"},{text:"CSV",value:"text/csv"},{text:"Markdown",value:"text/markdown"},{text:"SVG",value:"image/svg+xml"}],Cn=30,fn=Object.freeze({created:0,selected:10,connected:20,timeout:25,paid:30,nftMinted:35,allocated:40,consuming:46,installed:50,overdue:60,canceled:65,terminated:70,transferred:90}),hn="default",mn="public",Sn="invited-only",gn="owner-only",An="admin-only",Tn="simple-cors",_n="security-header",On="simple-cors-and-security-header";var v=Object.freeze({NODE_MODES:Object.freeze({PRODUCTION:"production",DEBUG:"debug",MAINTENANCE:"maintenance",SERVERLESS:"serverless"}),DEFAULT_DESCRIPTION:"Web Interface to manage your Blocklet Server",NODE_MAINTAIN_PROGRESS:Object.freeze({SETUP:"setup",INSTALLING:"installing",VERIFYING:"verifying",RESTARTING:"restarting",CLEANUP:"cleanup",COMPLETE:"complete",ROLLBACK:"rollback"}),VC_TYPE_BLOCKLET_PURCHASE:"BlockletPurchaseCredential",VC_TYPE_NODE_PASSPORT:"ABTNodePassport",VC_TYPE_GENERAL_PASSPORT:"NFTPassport",NFT_TYPE_SERVER_OWNERSHIP:"BlockletServerOwnershipNFT",NFT_TYPE_SERVERLESS:"BlockletServerServerlessNFT",NODE_PACKAGE_NAME:"@abtnode/cli",NODE_COMMAND_NAME:"abtnode",NODE_DATA_DIR_NAME:"_abtnode",USER_AVATAR_DIR:"/.assets/avatar",USER_AVATAR_URL_PREFIX:"bn://avatar",USER_AVATAR_PATH_PREFIX:"/user/avatar",USER_MAX_INVITE_DEPTH:8,PROCESS_NAME_DAEMON:"abt-node-daemon",PROCESS_NAME_PROXY:"abt-node-db-hub",PROCESS_NAME_UPDATER:"abt-node-updater",PROCESS_NAME_SERVICE:"abt-node-service",PROCESS_NAME_ROUTER:"abt-node-router",PROCESS_NAME_LOG_ROTATE:"abt-node-log-rotate",PROCESS_NAME_EVENT_HUB:"abt-node-event-hub",NODE_REGISTER_URL:"https://install.arcblock.io/",WEB_WALLET_URL:"https://web.abtwallet.io",BLOCKLET_STORE_URL:xe,BLOCKLET_STORE_URL_DEV:ve,BLOCKLET_STORE_DID:"z8ia29UsENBg6tLZUKi2HABj38Cw1LmHZocbQ",BLOCKLET_STORE_API_PREFIX:"/api",BLOCKLET_STORE_API_BLOCKLET_PREFIX:"/api/blocklets",BLOCKLET_STORE_META_PATH:"/api/store.json",BLOCKLET_STORE:{id:"zNKqX7D8ZAYa77HgzpoFfnV3BFbcmSRrE9aT",name:"Official Store",description:"ArcBlock official blocklet registry",url:xe,logoUrl:"/logo.png",maintainer:"arcblock"},BLOCKLET_STORE_DEV:{id:"zNKmfUatDhzfMVACfr3u97eqndj8f1yXXw3m",name:"Dev Store",description:"ArcBlock dev registry that contains demo and example blocklets",url:ve,maintainer:"arcblock",logoUrl:"/logo.png"},APP_STRUCT_VERSION:"2",DEFAULT_DID_REGISTRY:"https://registry.abtnet.io",DEFAULT_SLP_DOMAIN:"slp.abtnet.io",DEFAULT_DID_DOMAIN:"did.abtnet.io",DEFAULT_IP_DOMAIN:"*.ip.abtnet.io",DEFAULT_IP_DOMAIN_SUFFIX:"ip.abtnet.io",DEFAULT_WILDCARD_CERT_HOST:"https://releases.arcblock.io/",DEFAULT_NFT_DOMAIN_URL:"https://domain.didlabs.org/",DEFAULT_CERTIFICATE_EMAIL:"certs@arcblock.io",CONFIG_FILENAME:"config.yml",CONFIG_FILENAME_OLD:"abtnode.yml",CONFIG_FOLDER_NAME:".blocklet-server",CONFIG_FOLDER_NAME_OLD:".abtnode",EXPORTED_FOLDER_NAME:"exported_blocklet_server",StatusCode:Object.freeze({ok:0,blocklet_not_found:1,blocklet_not_purchased:2,forbidden:403,internal:500,timeout:504}),IP:new RegExp("-(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\-(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}"),DOMAIN_FOR_IP_SITE:"",DOMAIN_FOR_IP_SITE_REGEXP:"~^\\d+.\\d+.\\d+.\\d+$",DOMAIN_FOR_DEFAULT_SITE:"*",DOMAIN_FOR_INTERNAL_SITE:"127.0.0.1",NAME_FOR_WELLKNOWN_SITE:"wellknown",WELLKNOWN_PATH_PREFIX:"/.well-known",WELLKNOWN_ACME_CHALLENGE_PREFIX:"/.well-known/acme-challenge",WELLKNOWN_DID_RESOLVER_PREFIX:"/.well-known/did.json",WELLKNOWN_PING_PREFIX:"/.well-known/ping",WELLKNOWN_ANALYTICS_PREFIX:"/.well-known/analytics",WELLKNOWN_SERVICE_PATH_PREFIX:"/.well-known/service",WELLKNOWN_BLOCKLET_ADMIN_PATH:"/.well-known/service/admin",WELLKNOWN_BLOCKLET_HEALTH_PATH:"/.well-known/service/health",WELLKNOWN_BLOCKLET_LOGO_PATH:"/.well-known/service/blocklet/logo",SLOT_FOR_IP_DNS_SITE:"888-888-888-888",DEFAULT_ADMIN_PATH:"/admin",WELLKNOWN_SERVER_ADMIN_PATH:"/.well-known/server/admin",DEFAULT_SERVICE_PATH:"/.abtnode/service",DEFAULT_HTTP_PORT:80,DEFAULT_HTTPS_PORT:443,MAX_UPLOAD_FILE_SIZE:500,DEFAULT_DAEMON_PORT:8089,MAX_NGINX_WORKER_CONNECTIONS:10240,BLOCKLET_PROXY_PATH_PREFIX:"/.blocklet/proxy",BLOCKLET_SITE_GROUP_SUFFIX:".blocklet-domain-group",DAY_IN_MS:ye,DAEMON_MAX_MEM_LIMIT_IN_MB:800,PROXY_MAX_MEM_LIMIT_IN_MB:800,BLOCKLET_MAX_MEM_LIMIT_IN_MB:800,CERTIFICATE_EXPIRES_OFFSET:10*ye,ROUTING_RESPONSE_TYPES:En,ROUTING_RULE_TYPES:Object.freeze({NONE:"none",DAEMON:"daemon",SERVICE:"service",BLOCKLET:"blocklet",REDIRECT:"redirect",GENERAL_REWRITE:"rewrite",GENERAL_PROXY:"general_proxy",DIRECT_RESPONSE:"direct_response",COMPONENT:"component"}),ROLES:fe,SERVER_ROLES:C,BLOCKLET_ROLES:tt,isBlockletRole:$t,isBlockletMultipleTenantRole:tn,AUTH_CERT_TYPE:nn,RBAC_CONFIG:rn,genPermissionName:(n,t="access")=>`${t}_${n.replace("_","-")}`,PASSPORT_STATUS:{VALID:"valid",REVOKED:"revoked"},NODE_SERVICES:Qt,DISK_ALERT_THRESHOLD_PERCENT:80,EVENTS:on,WHO_CAN_ACCESS:sn,WHO_CAN_ACCESS_PREFIX_ROLES:"roles:",GATEWAY_REQ_LIMIT:Object.freeze({min:10,max:100}),STORE_DETAIL_PAGE_PATH_PREFIX:"/blocklets",MAX_USER_PAGE_SIZE:100,SERVER_STATUS:{RUNNING:1,STOPPED:2,START_FROM_CRASH:3},LOG_RETAIN_IN_DAYS:60,BLOCKLET_INSTALL_TYPE:{STORE:"store",URL:"url",DEV:"dev",CREATE:"create",RESTORE:"restore"},ROUTER_CACHE_GROUPS:{blockletProxy:{minSize:"1m",maxSize:"2g",period:"30d"}},MAIN_CHAIN_ENDPOINT:an,USER_TYPE:cn,SERVER_CACHE_TTL:300*1e3,BLOCKLET_CACHE_TTL:3600*1e3,SESSION_CACHE_TTL:3600,SESSION_TTL:7*86400,BACKUPS:ln,CHECK_UPDATE:un,MONITOR_HISTORY_LENGTH:pn,MONITOR_RECORD_INTERVAL_SEC:nt,INSTALL_ACTIONS:{INSTALL:"install",INSTALL_COMPONENT:"installComponent",UPGRADE_COMPONENT:"upgradeComponent"},COPYRIGHT_OWNER:"ArcBlock",FEDERATED:dn,SESSION_TOKEN_STORAGE_KEY:"login_token",REFRESH_TOKEN_STORAGE_KEY:"refresh_token",SERVERLESS_BLOCKLET_DATA_RETENTION_DAYS:Cn,LAUNCH_SESSION_STATUS:fn,UNOWNED_DID:"z".repeat(35),STUDIO_CONNECTED_STORE:"studio_connected_store",STUDIO_CONNECTED_AND_DEVELOPED:"studio_connected_and_developed",VERIFY_CODE_LENGTH:6,VERIFY_CODE_TTL:30*60*1e3,VERIFY_SEND_TTL:1*60*1e3,SECURITY_RULE_DEFAULT_ID:hn,ACCESS_POLICY_PUBLIC:mn,ACCESS_POLICY_INVITED_ONLY:Sn,ACCESS_POLICY_OWNER_ONLY:gn,ACCESS_POLICY_ADMIN_ONLY:An,RESPONSE_HEADER_POLICY_SIMPLE_CORS:Tn,RESPONSE_HEADER_POLICY_SECURITY_HEADER:_n,RESPONSE_HEADER_POLICY_SIMPLE_CORS_AND_SECURITY_HEADER:On});/*! js-cookie v3.0.5 | MIT */function Y(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)n[r]=e[r]}return n}var Rn={read:function(n){return n[0]==='"'&&(n=n.slice(1,-1)),n.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(n){return encodeURIComponent(n).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function re(n,t){function e(o,i,s){if(!(typeof document>"u")){s=Y({},t,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var d="";for(var l in s)s[l]&&(d+="; "+l,s[l]!==!0&&(d+="="+s[l].split(";")[0]));return document.cookie=o+"="+n.write(i,o)+d}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],s={},d=0;d<i.length;d++){var l=i[d].split("="),f=l.slice(1).join("=");try{var E=decodeURIComponent(l[0]);if(s[E]=n.read(f,E),o===E)break}catch{}}return o?s[o]:s}}return Object.create({set:e,get:r,remove:function(o,i){e(o,"",Y({},i,{expires:-1}))},withAttributes:function(o){return re(this.converter,Y({},this.attributes,o))},withConverter:function(o){return re(Y({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(n)}})}var X=re(Rn,{path:"/"}),N,g,T,P,J,H,h,oe,x,rt,se,ae,ie,ot,ce;class In extends Map{constructor(e={}){super();M(this,h);M(this,N,0);M(this,g,new Map);M(this,T,new Map);M(this,P);M(this,J);M(this,H);if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof e.maxAge=="number"&&e.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");R(this,P,e.maxSize),R(this,J,e.maxAge||Number.POSITIVE_INFINITY),R(this,H,e.onEviction)}get __oldCache(){return u(this,T)}get(e){if(u(this,g).has(e)){const r=u(this,g).get(e);return A(this,h,se).call(this,e,r)}if(u(this,T).has(e)){const r=u(this,T).get(e);if(A(this,h,x).call(this,e,r)===!1)return A(this,h,ot).call(this,e,r),r.value}}set(e,r,{maxAge:o=u(this,J)}={}){const i=typeof o=="number"&&o!==Number.POSITIVE_INFINITY?Date.now()+o:void 0;return u(this,g).has(e)?u(this,g).set(e,{value:r,expiry:i}):A(this,h,ie).call(this,e,{value:r,expiry:i}),this}has(e){return u(this,g).has(e)?!A(this,h,x).call(this,e,u(this,g).get(e)):u(this,T).has(e)?!A(this,h,x).call(this,e,u(this,T).get(e)):!1}peek(e){if(u(this,g).has(e))return A(this,h,ae).call(this,e,u(this,g));if(u(this,T).has(e))return A(this,h,ae).call(this,e,u(this,T))}delete(e){const r=u(this,g).delete(e);return r&&ee(this,N)._--,u(this,T).delete(e)||r}clear(){u(this,g).clear(),u(this,T).clear(),R(this,N,0)}resize(e){if(!(e&&e>0))throw new TypeError("`maxSize` must be a number greater than 0");const r=[...A(this,h,ce).call(this)],o=r.length-e;o<0?(R(this,g,new Map(r)),R(this,T,new Map),R(this,N,r.length)):(o>0&&A(this,h,oe).call(this,r.slice(0,o)),R(this,T,new Map(r.slice(o))),R(this,g,new Map),R(this,N,0)),R(this,P,e)}*keys(){for(const[e]of this)yield e}*values(){for(const[,e]of this)yield e}*[Symbol.iterator](){for(const e of u(this,g)){const[r,o]=e;A(this,h,x).call(this,r,o)===!1&&(yield[r,o.value])}for(const e of u(this,T)){const[r,o]=e;u(this,g).has(r)||A(this,h,x).call(this,r,o)===!1&&(yield[r,o.value])}}*entriesDescending(){let e=[...u(this,g)];for(let r=e.length-1;r>=0;--r){const o=e[r],[i,s]=o;A(this,h,x).call(this,i,s)===!1&&(yield[i,s.value])}e=[...u(this,T)];for(let r=e.length-1;r>=0;--r){const o=e[r],[i,s]=o;u(this,g).has(i)||A(this,h,x).call(this,i,s)===!1&&(yield[i,s.value])}}*entriesAscending(){for(const[e,r]of A(this,h,ce).call(this))yield[e,r.value]}get size(){if(!u(this,N))return u(this,T).size;let e=0;for(const r of u(this,T).keys())u(this,g).has(r)||e++;return Math.min(u(this,N)+e,u(this,P))}get maxSize(){return u(this,P)}entries(){return this.entriesAscending()}forEach(e,r=this){for(const[o,i]of this.entriesAscending())e.call(r,i,o,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}}N=new WeakMap,g=new WeakMap,T=new WeakMap,P=new WeakMap,J=new WeakMap,H=new WeakMap,h=new WeakSet,oe=function(e){if(typeof u(this,H)=="function")for(const[r,o]of e)u(this,H).call(this,r,o.value)},x=function(e,r){return typeof r.expiry=="number"&&r.expiry<=Date.now()?(typeof u(this,H)=="function"&&u(this,H).call(this,e,r.value),this.delete(e)):!1},rt=function(e,r){if(A(this,h,x).call(this,e,r)===!1)return r.value},se=function(e,r){return r.expiry?A(this,h,rt).call(this,e,r):r.value},ae=function(e,r){const o=r.get(e);return A(this,h,se).call(this,e,o)},ie=function(e,r){u(this,g).set(e,r),ee(this,N)._++,u(this,N)>=u(this,P)&&(R(this,N,0),A(this,h,oe).call(this,u(this,T)),R(this,T,u(this,g)),R(this,g,new Map))},ot=function(e,r){u(this,T).delete(e),A(this,h,ie).call(this,e,r)},ce=function*(){for(const e of u(this,T)){const[r,o]=e;u(this,g).has(r)||A(this,h,x).call(this,r,o)===!1&&(yield e)}for(const e of u(this,g)){const[r,o]=e;A(this,h,x).call(this,r,o)===!1&&(yield e)}};var Ln=Object.defineProperty,Dn=(n,t,e)=>t in n?Ln(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Nn=(n,t,e)=>(Dn(n,t+"",e),e);class wn{constructor({api:t}){Nn(this,"api"),this.api=t}async getUserPublicInfo({did:t}){const{data:e}=await this.api.get("/api/user",{params:{did:t}});return e}async getUserPrivacyConfig({did:t}){const{data:e}=await this.api.get("/api/user/privacy/config",{params:{did:t}});return e}async saveUserPrivacyConfig(t){const{data:e}=await this.api.post("/api/user/privacy/config",t);return e}async getUserNotificationConfig(){const{data:t}=await this.api.get("/api/user/notification/config");return t}async saveUserNotificationConfig(t){const{data:e}=await this.api.post("/api/user/notification/config",t);return e}async testNotificationWebhook(t){const{data:e}=await this.api.put("/api/user/notification/webhook",t);return e}async getProfileUrl({did:t,locale:e}){const r=`${v.WELLKNOWN_SERVICE_PATH_PREFIX}/user`;return j(r,{did:t,locale:e})}async getProfile(){const{data:t}=await this.api.get("/api/user/profile");return t}async refreshProfile(){await this.api.put("/api/user/refreshProfile")}async saveProfile({locale:t,inviter:e}){const{data:r}=await this.api.put("/api/user/profile",{locale:t,inviter:e});return r}async updateDidSpace({spaceGateway:t}){await this.api.put("/api/user/updateDidSpace",{spaceGateway:t})}async logout({visitorId:t}){const{data:e}=await this.api.post("/api/user/logout",{visitorId:t});return e}}class st{getSessionToken(){return X.get(v.SESSION_TOKEN_STORAGE_KEY)}setSessionToken(t){X.set(v.SESSION_TOKEN_STORAGE_KEY,t)}removeSessionToken(){X.remove(v.SESSION_TOKEN_STORAGE_KEY)}getRefreshToken(){return localStorage.getItem(v.REFRESH_TOKEN_STORAGE_KEY)}setRefreshToken(t){localStorage.setItem(v.REFRESH_TOKEN_STORAGE_KEY,t)}removeRefreshToken(){localStorage.removeItem(v.REFRESH_TOKEN_STORAGE_KEY)}}const te=new In({maxSize:30,maxAge:60*1e3});class at{async getBlocklet(t,e=!1){if(!t){if(typeof window>"u"||typeof document>"u")throw new Error("Cannot get blocklet in server side without baseUrl");return window.blocklet}if(!e&&te.has(t))return te.get(t);const r=j(I(t,"__blocklet__.js"),{type:"json",t:Date.now()}),i=await(await fetch(r)).json();return te.set(t,i),i}async loadBlocklet(){return new Promise((t,e)=>{if(typeof window>"u"||typeof document>"u"){e();return}const r=document.createElement("script");let o="/";window.blocklet&&window.blocklet.prefix&&(o=window.blocklet.prefix),r.src=j(I(o,"__blocklet__.js"),{t:Date.now()}),r.onload=()=>{t()},r.onerror=()=>{e()},document.head.append(r)})}getPrefix(t){var e;return t?(t==null?void 0:t.prefix)||"/":typeof window>"u"||typeof document>"u"?null:((e=window.blocklet)==null?void 0:e.prefix)||"/"}}var yn=Object.defineProperty,xn=(n,t,e)=>t in n?yn(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,ke=(n,t,e)=>(xn(n,typeof t!="symbol"?t+"":t,e),e);class vn{constructor({api:t,blocklet:e}){ke(this,"api"),ke(this,"blocklet"),this.api=t,this.blocklet=e||new at}getBaseUrl(t){return t?I(t,v.WELLKNOWN_SERVICE_PATH_PREFIX):void 0}async getUserSessions({did:t,appUrl:e}){const r=this.getBaseUrl(e),o=await this.blocklet.getBlocklet(),{data:i}=await this.api.get("/api/user-session",{baseURL:r,params:{userDid:t,appPid:o.appPid}});return i}async loginByUserSession({appPid:t,userDid:e,visitorId:r,passportId:o,appUrl:i}){const s=this.getBaseUrl(i),{data:d}=await this.api.post("/api/user-session/login",{appPid:t,userDid:e,visitorId:r,passportId:o},{baseURL:s});return d}}var kn=Object.defineProperty,bn=(n,t,e)=>t in n?kn(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Fn=(n,t,e)=>(bn(n,t+"",e),e);class Bn{constructor({blocklet:t=window.blocklet}={}){Fn(this,"blocklet"),this.blocklet=t}getComponent(t){var o;return(((o=this.blocklet)==null?void 0:o.componentMountPoints)||[]).find(i=>[i.title,i.name,i.did].includes(t))}getComponentMountPoint(t){const e=this.getComponent(t);return(e==null?void 0:e.mountPoint)||""}getUrl(t,...e){var i;const r=this.getComponentMountPoint(t),o=((i=this.blocklet)==null?void 0:i.appUrl)||"";return I(o,r,...e)}}const Un="1.16.33",Mn=(n=0)=>new Promise(t=>{setTimeout(()=>{t()},n)}),it=n=>`Bearer ${encodeURIComponent(n)}`,Pn="__visitor_id",Hn=()=>localStorage.getItem(Pn);function jn(){return X.get("x-csrf-token")}async function be(n,t=300){n.metaData.endTime=+new Date;const{startTime:e,endTime:r}=n.metaData,o=r-e;o<t&&await Mn(t-o),delete n.metaData}const ct=(n,t)=>{const e={...n==null?void 0:n.headers,"x-blocklet-js-sdk-version":Un},r=new Bn,o=Hn();[void 0,null].includes(o)||(e["x-blocklet-visitor-id"]=o);const i=_t.create({...n,headers:e});return t!=null&&t.lazy&&(i.interceptors.request.use(s=>(s.metaData={startTime:+new Date},s),s=>Promise.reject(s)),i.interceptors.response.use(async s=>(s.config&&await be(s.config,t==null?void 0:t.lazyTime),s),async s=>(s.response&&await be(s.response.config,t==null?void 0:t.lazyTime),Promise.reject(s)))),i.interceptors.request.use(s=>{var l,f;const d=(t==null?void 0:t.componentDid)??((f=(l=window.blocklet)==null?void 0:l.componentId)==null?void 0:f.split("/").pop());return s.baseURL=s.baseURL||r.getComponentMountPoint(d),s.timeout=s.timeout||20*1e3,s.headers["x-csrf-token"]=jn(),s},s=>Promise.reject(s)),i};async function Vn(n){if(!n)throw new Error("Refresh token not found");const t=ct({baseURL:v.WELLKNOWN_SERVICE_PATH_PREFIX,timeout:10*1e3,headers:{authorization:it(n)}}),{data:e}=await t.post("/api/did/refreshSession");return e}function lt({getSessionToken:n,setSessionToken:t,removeSessionToken:e,getRefreshToken:r,setRefreshToken:o,removeRefreshToken:i,onRefreshTokenError:s,onRefreshTokenSuccess:d},l,f){let E=null;const m=ct({timeout:30*1e3,...l},f);return m.interceptors.request.use(async p=>{if(!X.get(v.SESSION_TOKEN_STORAGE_KEY)){const S=n();S&&(p.headers.authorization=it(S))}return E&&await E,p},p=>Promise.reject(p)),m.interceptors.response.use(p=>p,async p=>{var L;const S=p.config;if(S&&(S.headers=S!=null&&S.headers?{...S.headers}:{},((L=p==null?void 0:p.response)==null?void 0:L.status)===401&&!S._retry)){S._retry=!0;try{E||(E=Vn(r()));const D=await E;return t(D.nextToken),o(D.nextRefreshToken),typeof d=="function"&&d(D),m(S)}catch(D){return e(),i(),typeof s=="function"&&s(D),Promise.reject(p)}finally{E=null}}return Promise.reject(p)}),m}var Kn=Object.defineProperty,Gn=(n,t,e)=>t in n?Kn(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,z=(n,t,e)=>(Gn(n,typeof t!="symbol"?t+"":t,e),e);class ut{constructor(){z(this,"api"),z(this,"user"),z(this,"userSession"),z(this,"token"),z(this,"blocklet");const t=new st,e=lt({getSessionToken:t.getSessionToken,setSessionToken:t.setSessionToken,removeSessionToken:t.removeSessionToken,getRefreshToken:t.getRefreshToken,setRefreshToken:t.setRefreshToken,removeRefreshToken:t.removeRefreshToken,onRefreshTokenError:()=>{console.error("Failed to refresh token")},onRefreshTokenSuccess:()=>{}},{baseURL:v.WELLKNOWN_SERVICE_PATH_PREFIX});this.user=new wn({api:e});const r=new at;this.userSession=new vn({api:e,blocklet:r}),this.token=t,this.api=e,this.blocklet=r}}function he(n={},t={}){const e=new st;return lt({getSessionToken:e.getSessionToken,setSessionToken:e.setSessionToken,removeSessionToken:e.removeSessionToken,getRefreshToken:e.getRefreshToken,setRefreshToken:e.setRefreshToken,removeRefreshToken:e.removeRefreshToken,onRefreshTokenError:()=>{console.error("Failed to refresh token")},onRefreshTokenSuccess:()=>{}},n,t)}const me=he({});function zn({key:n}={key:"md"}){const t=Ot();return Rt(t.breakpoints.down(n))}const b={NETWORK_ERROR:1001,UNAUTHORIZED:1002,EXPIRED:1003,PAST_DUE:1004,INVALID:1005,UNIT_LIMIT:1006,CORS_BLOCKED:1007},Wn={DEFAULT_SCOPE:"list:object read:object write:object"},Xn="https://www.arcblock.io/content/docs/did-spaces/how-to-obtain-space-gateway-url",pt="https://www.arcblock.io/docs/did-spaces/fixing-cors-errors-when-connecting-to-space";function Jn({endpoint:n,deps:t=[]}){return It(async()=>{if(!et(n))return;const{headers:e}=await me.head(n,{timeout:1e3*30,params:{withExtras:!0}}),[r,o,i,s,d,l,f,E,m]=[e["x-space-name"],e["x-subscription-id"],e["x-listable"]==="true",e["x-readable"]==="true",e["x-writeable"]==="true",e["x-space-version"],e["x-space-owner-did"],e["x-space-is-available"],e["x-error-code"]],p=r?decodeURIComponent(r):"";if(E===void 0){const S=i&&s&&d;return{version:l||"",name:p,subscriptionId:o,ownerDid:f||"",isAvailable:S,errorCode:S?0:b.UNAUTHORIZED}}return{version:l||"",name:p,subscriptionId:o,ownerDid:f,isAvailable:E==="true",errorCode:parseInt(m,10)}},{refreshDeps:[n].concat(t),onError(e){console.error(e)}})}const Zn=Qe.flatten({common:{cancel:"Cancel",confirm:"Confirm",delete:"Delete",error:"Error",open:"Open",unknown:"Unknown",invalidUrl:"Invalid url: {url}",upgrade:"Upgrade"},storage:{spaces:{authorize:{title:"Connect {appName} to DID Spaces",scan:"Use your DID Wallet to scan the QR code below to allow the app {appName} to connect to DID Spaces",success:"Connected successfully"},connect:{reconnect:"Reconnect Now",useSpaceGateway:"Connect using the DID Spaces gateway",useWallet:"Connect with DID Wallet",howToGetGatewayUrl:"How to get the url of did spaces",providerForStorage:"Please connect your DID Spaces"},connected:{title:"Connected DID Spaces",tag:"Connected"},disconnected:{tag:"Disconnected"},error:{tag:"Need Attention",expired:"DID Spaces has expired, click this link to re-subscribe",pastDue:"DID Spaces has unpaid bills, click this link to complete payment",invalid:"DID Spaces subscription anomaly, click this link to check",unitLimit:"DID Spaces free quota has been used up, click this link to pay for the upgrade",corsBlocked:`The connection request may fail due to CORS restrictions:
1
+ var Ie=n=>{throw TypeError(n)};var $=(n,t,e)=>t.has(n)||Ie("Cannot "+e);var u=(n,t,e)=>($(n,t,"read from private field"),e?e.call(n):t.get(n)),M=(n,t,e)=>t.has(n)?Ie("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),R=(n,t,e,r)=>($(n,t,"write to private field"),r?r.call(n,e):t.set(n,e),e),A=(n,t,e)=>($(n,t,"access private method"),e);var ee=(n,t,e,r)=>({set _(o){R(n,t,o,e)},get _(){return u(n,t,r)}});import{c5 as _t,c as I,w as j,ao as Ot,a4 as Rt,X as It,eK as Qe,u as Lt,l as Dt,bJ as qe,bI as Nt,r as c,a1 as wt,a2 as yt,j as a,c4 as xt,d3 as vt,aH as kt,bx as bt,B as k,i as Ft,eL as $e,a as Ce,bk as Bt,D as Ut,k as Le,cG as Mt,eM as Pt,cF as Ht,T as Q,az as jt,a6 as De,n as Vt,eN as Ne,U as Kt,b as Gt}from"./index-Cu_bNPbk.js";import{d as zt}from"./OpenInNew-IfJ9_ovA.js";import{i as et}from"./index-D1YU1vFk.js";import{L as q}from"./Link-BHzX6Bty.js";import{S as Wt}from"./Stack-B2wvO5ch.js";import{S as Xt}from"./Skeleton-Cguhg4Uf.js";import{d as Jt}from"./HelpOutline-1C4eFcXT.js";import{S as we}from"./index-6GwWrwWj.js";import{D as Zt}from"./DialogContentText-DF6wXq4v.js";import{T as Yt}from"./TextField-DaxOve82.js";const Qt=Object.freeze({AUTH:"auth"}),fe=Object.freeze({OWNER:"owner",ADMIN:"admin",MEMBER:"member",GUEST:"guest"}),C=Object.freeze({...fe,CI:"ci",CERTIFICATE:"certificate",BLOCKLET_OWNER:"blocklet-owner",BLOCKLET_ADMIN:"blocklet-admin",BLOCKLET_MEMBER:"blocklet-member",BLOCKLET_SDK:"blocklet-sdk",EXTERNAL_BLOCKLET_CONTROLLER:"external-blocklet-controller",EXTERNAL_BLOCKLETS_MANAGER:"external-blocklets-manager"}),qt=Object.freeze({BLOCKLET_GUEST:"blocklet-guest"}),tt=[C.BLOCKLET_OWNER,C.BLOCKLET_ADMIN,C.BLOCKLET_MEMBER,C.BLOCKLET_SDK],$t=n=>n&&tt.includes(n),en=[C.BLOCKLET_OWNER,C.BLOCKLET_ADMIN,C.BLOCKLET_MEMBER,C.BLOCKLET_SDK,qt.BLOCKLET_GUEST],tn=n=>n&&en.includes(n),nn={USER:"user",OWNERSHIP_NFT:"ownership_nft",BLOCKLET_USER:"blocklet_user",BLOCKLET_CONTROLLER:"blocklet_controller"},rn={roles:Object.freeze([{name:C.OWNER,title:"Owner",description:"Has full administrative access to the Blocklet Server",passport:!0},{name:C.ADMIN,title:"Admin",description:"Has full permissions to manage blocklet and Blocklet Server such as install/remove/start/stop blocklet, manage blocklet URL mapping and certificates, manage blocklet team, manage node integrations and access keys, upgrade node to a new version",passport:!0},{name:C.MEMBER,title:"Member",description:"Has permissions to manage blocklets, such as install/remove/start/stop blocklet, manage blocklet URL mapping and certificates",passport:!0},{name:C.GUEST,title:"Guest",description:"Has all read permissions on Blocklet Server",passport:!0},{name:C.CI,title:"CI",description:"Deploy blocklet to Blocklet Server",passport:!0,noHuman:!0},{name:C.CERTIFICATE,title:"Certificate",description:"Manage https certificates for blocklets on the Blocklet Server",passport:!0,noHuman:!0},{name:C.BLOCKLET_OWNER,title:"Blocklet Owner"},{name:C.BLOCKLET_ADMIN,title:"Blocklet Admin"},{name:C.BLOCKLET_MEMBER,title:"Blocklet Member"},{name:C.BLOCKLET_SDK,title:"Blocklet SDK"},{name:C.EXTERNAL_BLOCKLET_CONTROLLER,title:"External Blocklet Controller"},{name:C.EXTERNAL_BLOCKLETS_MANAGER,title:"External Blocklets Manager",description:"Manage external blocklets in the Blocklet Server",passport:!0,noHuman:!0}]),permissions:Object.freeze([{name:"query_node",description:"View node data, include dashboard and node settings, log stream for both Blocklet Server and blocklets"},{name:"mutate_node",description:"Change node settings, upgrade node to a new version"},{name:"query_session",description:"Get data from a long running session"},{name:"mutate_session",description:"Start/update/end a long running session"},{name:"query_accessKey",description:"View access keys for Blocklet Server"},{name:"mutate_accessKey",description:"Manage access keys for Blocklet Server, such as create/update/delete"},{name:"query_team",description:"View team data(members/roles/permissions) for Blocklet Server and blocklets"},{name:"mutate_team",description:"Manage team data(members/roles/permissions) for Blocklet Server and blocklets"},{name:"query_blocklets",description:"View store and installed blocklets, including blocklet runtime configuration, domains and urls"},{name:"mutate_blocklets",description:"Perform state changing actions on blocklets, such as install/upgrade/config/start/stop/remove"},{name:"query_router",description:"View sites, URL mapping and certificates in service gateway"},{name:"mutate_router",description:"Manage sites, URL mapping and certificates in service gateway"},{name:"query_certificate",description:"View certificates in service gateway"},{name:"mutate_certificate",description:"Manage certificates in service gateway"},{name:"query_notification",description:"View notifications"},{name:"mutate_notification",description:"Manage notifications, such as mark notifications as read"},{name:"query_webhook",description:"View integrations"},{name:"mutate_webhook",description:"Manage integrations"},{name:"query_blocklet",description:"View a blocklet, including blocklet runtime configuration, domains and urls"},{name:"mutate_blocklet",description:"Perform state changing actions on a blocklet, such as upgrade/config/start/stop"}]),grants:Object.freeze({[C.GUEST]:["query_blocklets","query_router","query_webhook","query_notification","query_team","query_accessKey","query_node","query_session"],[C.MEMBER]:[C.GUEST,"mutate_blocklets","mutate_router","mutate_notification","mutate_session"],[C.ADMIN]:[C.MEMBER,"mutate_team","mutate_webhook","mutate_accessKey","mutate_node","mutate_certificate"],[C.OWNER]:[fe.ADMIN],[C.CI]:["query_blocklets","mutate_blocklets"],[C.CERTIFICATE]:["query_certificate","mutate_certificate"],[C.BLOCKLET_SDK]:["query_team","mutate_team","query_blocklet"],[C.BLOCKLET_OWNER]:[C.BLOCKLET_ADMIN],[C.BLOCKLET_ADMIN]:[C.BLOCKLET_MEMBER,"mutate_team","mutate_blocklet","mutate_notification"],[C.BLOCKLET_MEMBER]:["query_team","query_blocklet","query_notification"],[C.EXTERNAL_BLOCKLET_CONTROLLER]:["query_blocklets","mutate_blocklets"],[C.EXTERNAL_BLOCKLETS_MANAGER]:["query_blocklets","mutate_blocklets"]})},ye=24*60*60*1e3,on={NOTIFICATION_CREATE:"notification.create",NOTIFICATION_BLOCKLET_CREATE:"notification.blockletCreate",ROUTING_UPDATED:"routing.updated",NODE_UPDATED:"node.updated",NODE_MAINTAIN_PROGRESS:"node.upgrade.progress",NODE_STARTED:"node.started",NODE_STOPPED:"node.stopped",NODE_ADDED_OWNER:"node.addedOwner",NODE_RUNTIME_INFO:"node.runtimeInfo",BLOCKLETS_RUNTIME_INFO:"node.blockletsRuntimeInfo",DOMAIN_STATUS:"domain.status",CERT_ADDED:"cert.added",CERT_ISSUED:"cert.issued",CERT_UPDATED:"cert.updated",CERT_REMOVED:"cert.removed",CERT_ERROR:"cert.error",RELOAD_GATEWAY:"gateway.reload"},sn=Object.freeze({OWNER:"owner",ADMIN:"admin",INVITED:"invited",ALL:"all"}),xe="https://store.blocklet.dev",ve="https://dev.store.blocklet.dev",an="https://main.abtnetwork.io/api/",cn=Object.freeze({DERIVED:"derived",WALLET:"wallet"}),ln={STATUS:{PROGRESS:null,SUCCEEDED:0,FAILED:1},TIMEOUT_HOURS:6,STRATEGY:{AUTO:0,MANUAL:1},JOB:{INTERVAL:2*60*60}},un={STATUS:{PROGRESS:null,SUCCEEDED:0,FAILED:1},TIMEOUT_HOURS:6,STRATEGY:{AUTO:0,MANUAL:1},JOB:{INTERVAL:2*60*60}},nt=10,pn=86400/nt,dn={SYNC_LIMIT:3},En=[{text:"Plain Text",value:"text/plain"},{text:"JSON",value:"application/json"},{text:"XML",value:"application/xml"},{text:"HTML Document",value:"text/html"},{text:"YAML",value:"application/x-yaml"},{text:"TOML",value:"application/toml"},{text:"CSS",value:"text/css"},{text:"JavaScript",value:"application/javascript"},{text:"CSV",value:"text/csv"},{text:"Markdown",value:"text/markdown"},{text:"SVG",value:"image/svg+xml"}],Cn=30,fn=Object.freeze({created:0,selected:10,connected:20,timeout:25,paid:30,nftMinted:35,allocated:40,consuming:46,installed:50,overdue:60,canceled:65,terminated:70,transferred:90}),hn="default",mn="public",Sn="invited-only",gn="owner-only",An="admin-only",Tn="simple-cors",_n="security-header",On="simple-cors-and-security-header";var v=Object.freeze({NODE_MODES:Object.freeze({PRODUCTION:"production",DEBUG:"debug",MAINTENANCE:"maintenance",SERVERLESS:"serverless"}),DEFAULT_DESCRIPTION:"Web Interface to manage your Blocklet Server",NODE_MAINTAIN_PROGRESS:Object.freeze({SETUP:"setup",INSTALLING:"installing",VERIFYING:"verifying",RESTARTING:"restarting",CLEANUP:"cleanup",COMPLETE:"complete",ROLLBACK:"rollback"}),VC_TYPE_BLOCKLET_PURCHASE:"BlockletPurchaseCredential",VC_TYPE_NODE_PASSPORT:"ABTNodePassport",VC_TYPE_GENERAL_PASSPORT:"NFTPassport",NFT_TYPE_SERVER_OWNERSHIP:"BlockletServerOwnershipNFT",NFT_TYPE_SERVERLESS:"BlockletServerServerlessNFT",NODE_PACKAGE_NAME:"@abtnode/cli",NODE_COMMAND_NAME:"abtnode",NODE_DATA_DIR_NAME:"_abtnode",USER_AVATAR_DIR:"/.assets/avatar",USER_AVATAR_URL_PREFIX:"bn://avatar",USER_AVATAR_PATH_PREFIX:"/user/avatar",USER_MAX_INVITE_DEPTH:8,PROCESS_NAME_DAEMON:"abt-node-daemon",PROCESS_NAME_PROXY:"abt-node-db-hub",PROCESS_NAME_UPDATER:"abt-node-updater",PROCESS_NAME_SERVICE:"abt-node-service",PROCESS_NAME_ROUTER:"abt-node-router",PROCESS_NAME_LOG_ROTATE:"abt-node-log-rotate",PROCESS_NAME_EVENT_HUB:"abt-node-event-hub",NODE_REGISTER_URL:"https://install.arcblock.io/",WEB_WALLET_URL:"https://web.abtwallet.io",BLOCKLET_STORE_URL:xe,BLOCKLET_STORE_URL_DEV:ve,BLOCKLET_STORE_DID:"z8ia29UsENBg6tLZUKi2HABj38Cw1LmHZocbQ",BLOCKLET_STORE_API_PREFIX:"/api",BLOCKLET_STORE_API_BLOCKLET_PREFIX:"/api/blocklets",BLOCKLET_STORE_META_PATH:"/api/store.json",BLOCKLET_STORE:{id:"zNKqX7D8ZAYa77HgzpoFfnV3BFbcmSRrE9aT",name:"Official Store",description:"ArcBlock official blocklet registry",url:xe,logoUrl:"/logo.png",maintainer:"arcblock"},BLOCKLET_STORE_DEV:{id:"zNKmfUatDhzfMVACfr3u97eqndj8f1yXXw3m",name:"Dev Store",description:"ArcBlock dev registry that contains demo and example blocklets",url:ve,maintainer:"arcblock",logoUrl:"/logo.png"},APP_STRUCT_VERSION:"2",DEFAULT_DID_REGISTRY:"https://registry.abtnet.io",DEFAULT_SLP_DOMAIN:"slp.abtnet.io",DEFAULT_DID_DOMAIN:"did.abtnet.io",DEFAULT_IP_DOMAIN:"*.ip.abtnet.io",DEFAULT_IP_DOMAIN_SUFFIX:"ip.abtnet.io",DEFAULT_WILDCARD_CERT_HOST:"https://releases.arcblock.io/",DEFAULT_NFT_DOMAIN_URL:"https://domain.didlabs.org/",DEFAULT_CERTIFICATE_EMAIL:"certs@arcblock.io",CONFIG_FILENAME:"config.yml",CONFIG_FILENAME_OLD:"abtnode.yml",CONFIG_FOLDER_NAME:".blocklet-server",CONFIG_FOLDER_NAME_OLD:".abtnode",EXPORTED_FOLDER_NAME:"exported_blocklet_server",StatusCode:Object.freeze({ok:0,blocklet_not_found:1,blocklet_not_purchased:2,forbidden:403,internal:500,timeout:504}),IP:new RegExp("-(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\-(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}"),DOMAIN_FOR_IP_SITE:"",DOMAIN_FOR_IP_SITE_REGEXP:"~^\\d+.\\d+.\\d+.\\d+$",DOMAIN_FOR_DEFAULT_SITE:"*",DOMAIN_FOR_INTERNAL_SITE:"127.0.0.1",NAME_FOR_WELLKNOWN_SITE:"wellknown",WELLKNOWN_PATH_PREFIX:"/.well-known",WELLKNOWN_ACME_CHALLENGE_PREFIX:"/.well-known/acme-challenge",WELLKNOWN_DID_RESOLVER_PREFIX:"/.well-known/did.json",WELLKNOWN_PING_PREFIX:"/.well-known/ping",WELLKNOWN_ANALYTICS_PREFIX:"/.well-known/analytics",WELLKNOWN_SERVICE_PATH_PREFIX:"/.well-known/service",WELLKNOWN_BLOCKLET_ADMIN_PATH:"/.well-known/service/admin",WELLKNOWN_BLOCKLET_HEALTH_PATH:"/.well-known/service/health",WELLKNOWN_BLOCKLET_LOGO_PATH:"/.well-known/service/blocklet/logo",SLOT_FOR_IP_DNS_SITE:"888-888-888-888",DEFAULT_ADMIN_PATH:"/admin",WELLKNOWN_SERVER_ADMIN_PATH:"/.well-known/server/admin",DEFAULT_SERVICE_PATH:"/.abtnode/service",DEFAULT_HTTP_PORT:80,DEFAULT_HTTPS_PORT:443,MAX_UPLOAD_FILE_SIZE:500,DEFAULT_DAEMON_PORT:8089,MAX_NGINX_WORKER_CONNECTIONS:10240,BLOCKLET_PROXY_PATH_PREFIX:"/.blocklet/proxy",BLOCKLET_SITE_GROUP_SUFFIX:".blocklet-domain-group",DAY_IN_MS:ye,DAEMON_MAX_MEM_LIMIT_IN_MB:800,PROXY_MAX_MEM_LIMIT_IN_MB:800,BLOCKLET_MAX_MEM_LIMIT_IN_MB:800,CERTIFICATE_EXPIRES_OFFSET:10*ye,ROUTING_RESPONSE_TYPES:En,ROUTING_RULE_TYPES:Object.freeze({NONE:"none",DAEMON:"daemon",SERVICE:"service",BLOCKLET:"blocklet",REDIRECT:"redirect",GENERAL_REWRITE:"rewrite",GENERAL_PROXY:"general_proxy",DIRECT_RESPONSE:"direct_response",COMPONENT:"component"}),ROLES:fe,SERVER_ROLES:C,BLOCKLET_ROLES:tt,isBlockletRole:$t,isBlockletMultipleTenantRole:tn,AUTH_CERT_TYPE:nn,RBAC_CONFIG:rn,genPermissionName:(n,t="access")=>`${t}_${n.replace("_","-")}`,PASSPORT_STATUS:{VALID:"valid",REVOKED:"revoked"},NODE_SERVICES:Qt,DISK_ALERT_THRESHOLD_PERCENT:80,EVENTS:on,WHO_CAN_ACCESS:sn,WHO_CAN_ACCESS_PREFIX_ROLES:"roles:",GATEWAY_REQ_LIMIT:Object.freeze({min:10,max:100}),STORE_DETAIL_PAGE_PATH_PREFIX:"/blocklets",MAX_USER_PAGE_SIZE:100,SERVER_STATUS:{RUNNING:1,STOPPED:2,START_FROM_CRASH:3},LOG_RETAIN_IN_DAYS:60,BLOCKLET_INSTALL_TYPE:{STORE:"store",URL:"url",DEV:"dev",CREATE:"create",RESTORE:"restore"},ROUTER_CACHE_GROUPS:{blockletProxy:{minSize:"1m",maxSize:"2g",period:"30d"}},MAIN_CHAIN_ENDPOINT:an,USER_TYPE:cn,SERVER_CACHE_TTL:300*1e3,BLOCKLET_CACHE_TTL:3600*1e3,SESSION_CACHE_TTL:3600,SESSION_TTL:7*86400,BACKUPS:ln,CHECK_UPDATE:un,MONITOR_HISTORY_LENGTH:pn,MONITOR_RECORD_INTERVAL_SEC:nt,INSTALL_ACTIONS:{INSTALL:"install",INSTALL_COMPONENT:"installComponent",UPGRADE_COMPONENT:"upgradeComponent"},COPYRIGHT_OWNER:"ArcBlock",FEDERATED:dn,SESSION_TOKEN_STORAGE_KEY:"login_token",REFRESH_TOKEN_STORAGE_KEY:"refresh_token",SERVERLESS_BLOCKLET_DATA_RETENTION_DAYS:Cn,LAUNCH_SESSION_STATUS:fn,UNOWNED_DID:"z".repeat(35),STUDIO_CONNECTED_STORE:"studio_connected_store",STUDIO_CONNECTED_AND_DEVELOPED:"studio_connected_and_developed",VERIFY_CODE_LENGTH:6,VERIFY_CODE_TTL:30*60*1e3,VERIFY_SEND_TTL:1*60*1e3,SECURITY_RULE_DEFAULT_ID:hn,ACCESS_POLICY_PUBLIC:mn,ACCESS_POLICY_INVITED_ONLY:Sn,ACCESS_POLICY_OWNER_ONLY:gn,ACCESS_POLICY_ADMIN_ONLY:An,RESPONSE_HEADER_POLICY_SIMPLE_CORS:Tn,RESPONSE_HEADER_POLICY_SECURITY_HEADER:_n,RESPONSE_HEADER_POLICY_SIMPLE_CORS_AND_SECURITY_HEADER:On});/*! js-cookie v3.0.5 | MIT */function Y(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var r in e)n[r]=e[r]}return n}var Rn={read:function(n){return n[0]==='"'&&(n=n.slice(1,-1)),n.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(n){return encodeURIComponent(n).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function re(n,t){function e(o,i,s){if(!(typeof document>"u")){s=Y({},t,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var d="";for(var l in s)s[l]&&(d+="; "+l,s[l]!==!0&&(d+="="+s[l].split(";")[0]));return document.cookie=o+"="+n.write(i,o)+d}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],s={},d=0;d<i.length;d++){var l=i[d].split("="),f=l.slice(1).join("=");try{var E=decodeURIComponent(l[0]);if(s[E]=n.read(f,E),o===E)break}catch{}}return o?s[o]:s}}return Object.create({set:e,get:r,remove:function(o,i){e(o,"",Y({},i,{expires:-1}))},withAttributes:function(o){return re(this.converter,Y({},this.attributes,o))},withConverter:function(o){return re(Y({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(n)}})}var X=re(Rn,{path:"/"}),N,g,T,P,J,H,h,oe,x,rt,se,ae,ie,ot,ce;class In extends Map{constructor(e={}){super();M(this,h);M(this,N,0);M(this,g,new Map);M(this,T,new Map);M(this,P);M(this,J);M(this,H);if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof e.maxAge=="number"&&e.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");R(this,P,e.maxSize),R(this,J,e.maxAge||Number.POSITIVE_INFINITY),R(this,H,e.onEviction)}get __oldCache(){return u(this,T)}get(e){if(u(this,g).has(e)){const r=u(this,g).get(e);return A(this,h,se).call(this,e,r)}if(u(this,T).has(e)){const r=u(this,T).get(e);if(A(this,h,x).call(this,e,r)===!1)return A(this,h,ot).call(this,e,r),r.value}}set(e,r,{maxAge:o=u(this,J)}={}){const i=typeof o=="number"&&o!==Number.POSITIVE_INFINITY?Date.now()+o:void 0;return u(this,g).has(e)?u(this,g).set(e,{value:r,expiry:i}):A(this,h,ie).call(this,e,{value:r,expiry:i}),this}has(e){return u(this,g).has(e)?!A(this,h,x).call(this,e,u(this,g).get(e)):u(this,T).has(e)?!A(this,h,x).call(this,e,u(this,T).get(e)):!1}peek(e){if(u(this,g).has(e))return A(this,h,ae).call(this,e,u(this,g));if(u(this,T).has(e))return A(this,h,ae).call(this,e,u(this,T))}delete(e){const r=u(this,g).delete(e);return r&&ee(this,N)._--,u(this,T).delete(e)||r}clear(){u(this,g).clear(),u(this,T).clear(),R(this,N,0)}resize(e){if(!(e&&e>0))throw new TypeError("`maxSize` must be a number greater than 0");const r=[...A(this,h,ce).call(this)],o=r.length-e;o<0?(R(this,g,new Map(r)),R(this,T,new Map),R(this,N,r.length)):(o>0&&A(this,h,oe).call(this,r.slice(0,o)),R(this,T,new Map(r.slice(o))),R(this,g,new Map),R(this,N,0)),R(this,P,e)}*keys(){for(const[e]of this)yield e}*values(){for(const[,e]of this)yield e}*[Symbol.iterator](){for(const e of u(this,g)){const[r,o]=e;A(this,h,x).call(this,r,o)===!1&&(yield[r,o.value])}for(const e of u(this,T)){const[r,o]=e;u(this,g).has(r)||A(this,h,x).call(this,r,o)===!1&&(yield[r,o.value])}}*entriesDescending(){let e=[...u(this,g)];for(let r=e.length-1;r>=0;--r){const o=e[r],[i,s]=o;A(this,h,x).call(this,i,s)===!1&&(yield[i,s.value])}e=[...u(this,T)];for(let r=e.length-1;r>=0;--r){const o=e[r],[i,s]=o;u(this,g).has(i)||A(this,h,x).call(this,i,s)===!1&&(yield[i,s.value])}}*entriesAscending(){for(const[e,r]of A(this,h,ce).call(this))yield[e,r.value]}get size(){if(!u(this,N))return u(this,T).size;let e=0;for(const r of u(this,T).keys())u(this,g).has(r)||e++;return Math.min(u(this,N)+e,u(this,P))}get maxSize(){return u(this,P)}entries(){return this.entriesAscending()}forEach(e,r=this){for(const[o,i]of this.entriesAscending())e.call(r,i,o,this)}get[Symbol.toStringTag](){return JSON.stringify([...this.entriesAscending()])}}N=new WeakMap,g=new WeakMap,T=new WeakMap,P=new WeakMap,J=new WeakMap,H=new WeakMap,h=new WeakSet,oe=function(e){if(typeof u(this,H)=="function")for(const[r,o]of e)u(this,H).call(this,r,o.value)},x=function(e,r){return typeof r.expiry=="number"&&r.expiry<=Date.now()?(typeof u(this,H)=="function"&&u(this,H).call(this,e,r.value),this.delete(e)):!1},rt=function(e,r){if(A(this,h,x).call(this,e,r)===!1)return r.value},se=function(e,r){return r.expiry?A(this,h,rt).call(this,e,r):r.value},ae=function(e,r){const o=r.get(e);return A(this,h,se).call(this,e,o)},ie=function(e,r){u(this,g).set(e,r),ee(this,N)._++,u(this,N)>=u(this,P)&&(R(this,N,0),A(this,h,oe).call(this,u(this,T)),R(this,T,u(this,g)),R(this,g,new Map))},ot=function(e,r){u(this,T).delete(e),A(this,h,ie).call(this,e,r)},ce=function*(){for(const e of u(this,T)){const[r,o]=e;u(this,g).has(r)||A(this,h,x).call(this,r,o)===!1&&(yield e)}for(const e of u(this,g)){const[r,o]=e;A(this,h,x).call(this,r,o)===!1&&(yield e)}};var Ln=Object.defineProperty,Dn=(n,t,e)=>t in n?Ln(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Nn=(n,t,e)=>(Dn(n,t+"",e),e);class wn{constructor({api:t}){Nn(this,"api"),this.api=t}async getUserPublicInfo({did:t}){const{data:e}=await this.api.get("/api/user",{params:{did:t}});return e}async getUserPrivacyConfig({did:t}){const{data:e}=await this.api.get("/api/user/privacy/config",{params:{did:t}});return e}async saveUserPrivacyConfig(t){const{data:e}=await this.api.post("/api/user/privacy/config",t);return e}async getUserNotificationConfig(){const{data:t}=await this.api.get("/api/user/notification/config");return t}async saveUserNotificationConfig(t){const{data:e}=await this.api.post("/api/user/notification/config",t);return e}async testNotificationWebhook(t){const{data:e}=await this.api.put("/api/user/notification/webhook",t);return e}async getProfileUrl({did:t,locale:e}){const r=`${v.WELLKNOWN_SERVICE_PATH_PREFIX}/user`;return j(r,{did:t,locale:e})}async getProfile(){const{data:t}=await this.api.get("/api/user/profile");return t}async refreshProfile(){await this.api.put("/api/user/refreshProfile")}async saveProfile({locale:t,inviter:e}){const{data:r}=await this.api.put("/api/user/profile",{locale:t,inviter:e});return r}async updateDidSpace({spaceGateway:t}){await this.api.put("/api/user/updateDidSpace",{spaceGateway:t})}async logout({visitorId:t}){const{data:e}=await this.api.post("/api/user/logout",{visitorId:t});return e}}class st{getSessionToken(){return X.get(v.SESSION_TOKEN_STORAGE_KEY)}setSessionToken(t){X.set(v.SESSION_TOKEN_STORAGE_KEY,t)}removeSessionToken(){X.remove(v.SESSION_TOKEN_STORAGE_KEY)}getRefreshToken(){return localStorage.getItem(v.REFRESH_TOKEN_STORAGE_KEY)}setRefreshToken(t){localStorage.setItem(v.REFRESH_TOKEN_STORAGE_KEY,t)}removeRefreshToken(){localStorage.removeItem(v.REFRESH_TOKEN_STORAGE_KEY)}}const te=new In({maxSize:30,maxAge:60*1e3});class at{async getBlocklet(t,e=!1){if(!t){if(typeof window>"u"||typeof document>"u")throw new Error("Cannot get blocklet in server side without baseUrl");return window.blocklet}if(!e&&te.has(t))return te.get(t);const r=j(I(t,"__blocklet__.js"),{type:"json",t:Date.now()}),i=await(await fetch(r)).json();return te.set(t,i),i}async loadBlocklet(){return new Promise((t,e)=>{if(typeof window>"u"||typeof document>"u"){e();return}const r=document.createElement("script");let o="/";window.blocklet&&window.blocklet.prefix&&(o=window.blocklet.prefix),r.src=j(I(o,"__blocklet__.js"),{t:Date.now()}),r.onload=()=>{t()},r.onerror=()=>{e()},document.head.append(r)})}getPrefix(t){var e;return t?(t==null?void 0:t.prefix)||"/":typeof window>"u"||typeof document>"u"?null:((e=window.blocklet)==null?void 0:e.prefix)||"/"}}var yn=Object.defineProperty,xn=(n,t,e)=>t in n?yn(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,ke=(n,t,e)=>(xn(n,typeof t!="symbol"?t+"":t,e),e);class vn{constructor({api:t,blocklet:e}){ke(this,"api"),ke(this,"blocklet"),this.api=t,this.blocklet=e||new at}getBaseUrl(t){return t?I(t,v.WELLKNOWN_SERVICE_PATH_PREFIX):void 0}async getUserSessions({did:t,appUrl:e}){const r=this.getBaseUrl(e),o=await this.blocklet.getBlocklet(),{data:i}=await this.api.get("/api/user-session",{baseURL:r,params:{userDid:t,appPid:o.appPid}});return i}async loginByUserSession({appPid:t,userDid:e,visitorId:r,passportId:o,appUrl:i}){const s=this.getBaseUrl(i),{data:d}=await this.api.post("/api/user-session/login",{appPid:t,userDid:e,visitorId:r,passportId:o},{baseURL:s});return d}}var kn=Object.defineProperty,bn=(n,t,e)=>t in n?kn(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Fn=(n,t,e)=>(bn(n,t+"",e),e);class Bn{constructor({blocklet:t=window.blocklet}={}){Fn(this,"blocklet"),this.blocklet=t}getComponent(t){var o;return(((o=this.blocklet)==null?void 0:o.componentMountPoints)||[]).find(i=>[i.title,i.name,i.did].includes(t))}getComponentMountPoint(t){const e=this.getComponent(t);return(e==null?void 0:e.mountPoint)||""}getUrl(t,...e){var i;const r=this.getComponentMountPoint(t),o=((i=this.blocklet)==null?void 0:i.appUrl)||"";return I(o,r,...e)}}const Un="1.16.33",Mn=(n=0)=>new Promise(t=>{setTimeout(()=>{t()},n)}),it=n=>`Bearer ${encodeURIComponent(n)}`,Pn="__visitor_id",Hn=()=>localStorage.getItem(Pn);function jn(){return X.get("x-csrf-token")}async function be(n,t=300){n.metaData.endTime=+new Date;const{startTime:e,endTime:r}=n.metaData,o=r-e;o<t&&await Mn(t-o),delete n.metaData}const ct=(n,t)=>{const e={...n==null?void 0:n.headers,"x-blocklet-js-sdk-version":Un},r=new Bn,o=Hn();[void 0,null].includes(o)||(e["x-blocklet-visitor-id"]=o);const i=_t.create({...n,headers:e});return t!=null&&t.lazy&&(i.interceptors.request.use(s=>(s.metaData={startTime:+new Date},s),s=>Promise.reject(s)),i.interceptors.response.use(async s=>(s.config&&await be(s.config,t==null?void 0:t.lazyTime),s),async s=>(s.response&&await be(s.response.config,t==null?void 0:t.lazyTime),Promise.reject(s)))),i.interceptors.request.use(s=>{var l,f;const d=(t==null?void 0:t.componentDid)??((f=(l=window.blocklet)==null?void 0:l.componentId)==null?void 0:f.split("/").pop());return s.baseURL=s.baseURL||r.getComponentMountPoint(d),s.timeout=s.timeout||20*1e3,s.headers["x-csrf-token"]=jn(),s},s=>Promise.reject(s)),i};async function Vn(n){if(!n)throw new Error("Refresh token not found");const t=ct({baseURL:v.WELLKNOWN_SERVICE_PATH_PREFIX,timeout:10*1e3,headers:{authorization:it(n)}}),{data:e}=await t.post("/api/did/refreshSession");return e}function lt({getSessionToken:n,setSessionToken:t,removeSessionToken:e,getRefreshToken:r,setRefreshToken:o,removeRefreshToken:i,onRefreshTokenError:s,onRefreshTokenSuccess:d},l,f){let E=null;const m=ct({timeout:30*1e3,...l},f);return m.interceptors.request.use(async p=>{if(!X.get(v.SESSION_TOKEN_STORAGE_KEY)){const S=n();S&&(p.headers.authorization=it(S))}return E&&await E,p},p=>Promise.reject(p)),m.interceptors.response.use(p=>p,async p=>{var L;const S=p.config;if(S&&(S.headers=S!=null&&S.headers?{...S.headers}:{},((L=p==null?void 0:p.response)==null?void 0:L.status)===401&&!S._retry)){S._retry=!0;try{E||(E=Vn(r()));const D=await E;return t(D.nextToken),o(D.nextRefreshToken),typeof d=="function"&&d(D),m(S)}catch(D){return e(),i(),typeof s=="function"&&s(D),Promise.reject(p)}finally{E=null}}return Promise.reject(p)}),m}var Kn=Object.defineProperty,Gn=(n,t,e)=>t in n?Kn(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,z=(n,t,e)=>(Gn(n,typeof t!="symbol"?t+"":t,e),e);class ut{constructor(){z(this,"api"),z(this,"user"),z(this,"userSession"),z(this,"token"),z(this,"blocklet");const t=new st,e=lt({getSessionToken:t.getSessionToken,setSessionToken:t.setSessionToken,removeSessionToken:t.removeSessionToken,getRefreshToken:t.getRefreshToken,setRefreshToken:t.setRefreshToken,removeRefreshToken:t.removeRefreshToken,onRefreshTokenError:()=>{console.error("Failed to refresh token")},onRefreshTokenSuccess:()=>{}},{baseURL:v.WELLKNOWN_SERVICE_PATH_PREFIX});this.user=new wn({api:e});const r=new at;this.userSession=new vn({api:e,blocklet:r}),this.token=t,this.api=e,this.blocklet=r}}function he(n={},t={}){const e=new st;return lt({getSessionToken:e.getSessionToken,setSessionToken:e.setSessionToken,removeSessionToken:e.removeSessionToken,getRefreshToken:e.getRefreshToken,setRefreshToken:e.setRefreshToken,removeRefreshToken:e.removeRefreshToken,onRefreshTokenError:()=>{console.error("Failed to refresh token")},onRefreshTokenSuccess:()=>{}},n,t)}const me=he({});function zn({key:n}={key:"md"}){const t=Ot();return Rt(t.breakpoints.down(n))}const b={NETWORK_ERROR:1001,UNAUTHORIZED:1002,EXPIRED:1003,PAST_DUE:1004,INVALID:1005,UNIT_LIMIT:1006,CORS_BLOCKED:1007},Wn={DEFAULT_SCOPE:"list:object read:object write:object"},Xn="https://www.arcblock.io/content/docs/did-spaces/how-to-obtain-space-gateway-url",pt="https://www.arcblock.io/docs/did-spaces/fixing-cors-errors-when-connecting-to-space";function Jn({endpoint:n,deps:t=[]}){return It(async()=>{if(!et(n))return;const{headers:e}=await me.head(n,{timeout:1e3*30,params:{withExtras:!0}}),[r,o,i,s,d,l,f,E,m]=[e["x-space-name"],e["x-subscription-id"],e["x-listable"]==="true",e["x-readable"]==="true",e["x-writeable"]==="true",e["x-space-version"],e["x-space-owner-did"],e["x-space-is-available"],e["x-error-code"]],p=r?decodeURIComponent(r):"";if(E===void 0){const S=i&&s&&d;return{version:l||"",name:p,subscriptionId:o,ownerDid:f||"",isAvailable:S,errorCode:S?0:b.UNAUTHORIZED}}return{version:l||"",name:p,subscriptionId:o,ownerDid:f,isAvailable:E==="true",errorCode:parseInt(m,10)}},{refreshDeps:[n].concat(t),onError(e){console.error(e)}})}const Zn=Qe.flatten({common:{cancel:"Cancel",confirm:"Confirm",delete:"Delete",error:"Error",open:"Open",unknown:"Unknown",invalidUrl:"Invalid url: {url}",upgrade:"Upgrade"},storage:{spaces:{authorize:{title:"Connect {appName} to DID Spaces",scan:"Use your DID Wallet to scan the QR code below to allow the app {appName} to connect to DID Spaces",success:"Connected successfully"},connect:{reconnect:"Reconnect Now",useSpaceGateway:"Connect using the DID Spaces gateway",useWallet:"Connect with DID Wallet",howToGetGatewayUrl:"How to get the url of did spaces",providerForStorage:"Please connect your DID Spaces"},connected:{title:"Connected DID Spaces",tag:"Connected"},disconnected:{tag:"Disconnected"},error:{tag:"Need Attention",expired:"DID Spaces has expired, click this link to re-subscribe",pastDue:"DID Spaces has unpaid bills, click this link to complete payment",invalid:"DID Spaces subscription anomaly, click this link to check",unitLimit:"DID Spaces free quota has been used up, click this link to pay for the upgrade",corsBlocked:`The connection request may fail due to CORS restrictions:
2
2
  1. Please contact the DID Space administrator to verify the relevant configuration.
3
3
  2. If you are the administrator, click the link below to view the detailed setup guide and resolve the issue.`,networkError:"Network error"},gateway:{add:{invalidUrl:"Invalid DID Spaces gateway url",label:"Enter the url of the DID Spaces",title:"Add DID Spaces"}},provideNFT:{title:"Please show the DID Spaces NFT for {appName}",scan:"Use your DID Wallet to scan the QR code below to allow the app {appName} show DID space NFT",success:"Connected successfully"},helperText:{fixCorsError:"Fixing CORS Errors When Connecting to Space",outdatedSpace:`The current version of DID Spaces is too low, please contact your administrator to upgrade for the best experience!
4
4
  If you are an administrator, you can upgrade by clicking the following link`,upgradeSpace:"Upgrade DID Spaces"}}}}),Yn=Qe.flatten({common:{cancel:"取消",confirm:"确认",delete:"删除",error:"错误",open:"打开",unknown:"未知",invalidUrl:"无效的 url: {url}",upgrade:"升级"},storage:{spaces:{authorize:{title:"连接 {appName} 至 DID Spaces",scan:"使用你的 DID Wallet 扫描下面的二维码以允许应用 {appName} 连接至 DID Spaces",success:"连接成功"},connect:{reconnect:"立即重连",useSpaceGateway:"使用 DID Spaces 网关连接",useWallet:"使用 DID Wallet 连接",howToGetGatewayUrl:"如何获取 DID Spaces 的网关地址",providerForStorage:"请连接您的 DID Spaces"},connected:{title:"已连接的 DID Spaces",tag:"已连接"},disconnected:{tag:"连接已断开"},error:{tag:"需要关注",expired:"DID Spaces 已过期,点击此链接重新订阅",pastDue:"DID Spaces 有未支付账单,点击此链接完成支付",invalid:"DID Spaces 订阅异常,点击此链接检查",unitLimit:"DID Spaces 免费额度已用完,点击此链接付费升级",corsBlocked:`连接请求可能因 CORS 限制而失败:
@@ -1,4 +1,4 @@
1
- var ft=Object.defineProperty;var dt=(e,n,t)=>n in e?ft(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var D=(e,n,t)=>dt(e,typeof n!="symbol"?n+"":n,t);import{P as f,r as P,Q as ht,l as pt,j as g,aE as gt,bD as ye,bo as mt,bp as yt,di as bt,ak as xt,bC as A,bm as wt,B as It,dj as St,T as vt,dk as Tt,dl as Ct,a3 as At,dm as jt,bA as Ne,u as Fe,aF as Pt,f as kt,E as Lt,ae as Mt}from"./index-BxKrUgd9.js";import{D as Et}from"./index-CYQV6023.js";import{L as Ot}from"./MoreVert-BZZ4IBOf.js";import{L as Rt}from"./ListItemButton-COVroopz.js";import{L as _t}from"./selector-Drr6pXp9.js";/**
1
+ var ft=Object.defineProperty;var dt=(e,n,t)=>n in e?ft(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var D=(e,n,t)=>dt(e,typeof n!="symbol"?n+"":n,t);import{P as f,r as P,I as ht,l as pt,j as g,aH as gt,bG as ye,br as mt,bs as yt,dk as bt,an as xt,bF as A,bp as wt,B as It,dl as St,T as vt,dm as Tt,dn as Ct,a6 as At,dp as jt,bD as Ne,u as Fe,aI as Pt,f as kt,F as Lt,ah as Mt}from"./index-Cu_bNPbk.js";import{D as Et}from"./index-DToO2H3Q.js";import{L as Ot}from"./MoreVert-9FUIKqvo.js";import{L as Rt}from"./ListItemButton-Bg2hcpe4.js";import{L as _t}from"./selector--uPvisem.js";/**
2
2
  * (c) Iconify
3
3
  *
4
4
  * For the full copyright and license information, please view the license.txt
@@ -8,4 +8,4 @@ var ft=Object.defineProperty;var dt=(e,n,t)=>n in e?ft(e,n,{enumerable:!0,config
8
8
  *
9
9
  * @license MIT
10
10
  * @version 1.0.8
11
- */const ze=Object.freeze({left:0,top:0,width:16,height:16}),V=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),F=Object.freeze({...ze,...V}),te=Object.freeze({...F,body:"",hidden:!1}),qt=Object.freeze({width:null,height:null}),He=Object.freeze({...qt,...V});function Nt(e,n=0){const t=e.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(t===""){const o=parseInt(e);return isNaN(o)?0:r(o)}else if(t!==e){let o=0;switch(t){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(e.slice(0,e.length-t.length));return isNaN(s)?0:(s=s/o,s%1===0?r(s):0)}}return n}const Ft=/[\s,]+/;function zt(e,n){n.split(Ft).forEach(t=>{switch(t.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const Be={...He,preserveAspectRatio:""};function be(e){const n={...Be},t=(r,o)=>e.getAttribute(r)||o;return n.width=t("width",null),n.height=t("height",null),n.rotate=Nt(t("rotate","")),zt(n,t("flip","")),n.preserveAspectRatio=t("preserveAspectRatio",t("preserveaspectratio","")),n}function Ht(e,n){for(const t in Be)if(e[t]!==n[t])return!0;return!1}const O=/^[a-z0-9]+(-[a-z0-9]+)*$/,z=(e,n,t,r="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const a=o.pop(),c=o.pop(),l={provider:o.length>0?o[0]:r,prefix:c,name:a};return n&&!U(l)?null:l}const s=o[0],i=s.split("-");if(i.length>1){const a={provider:r,prefix:i.shift(),name:i.join("-")};return n&&!U(a)?null:a}if(t&&r===""){const a={provider:r,prefix:"",name:s};return n&&!U(a,t)?null:a}return null},U=(e,n)=>e?!!((e.provider===""||e.provider.match(O))&&(n&&e.prefix===""||e.prefix.match(O))&&e.name.match(O)):!1;function Bt(e,n){const t={};!e.hFlip!=!n.hFlip&&(t.hFlip=!0),!e.vFlip!=!n.vFlip&&(t.vFlip=!0);const r=((e.rotate||0)+(n.rotate||0))%4;return r&&(t.rotate=r),t}function xe(e,n){const t=Bt(e,n);for(const r in te)r in V?r in e&&!(r in t)&&(t[r]=V[r]):r in n?t[r]=n[r]:r in e&&(t[r]=e[r]);return t}function Dt(e,n){const t=e.icons,r=e.aliases||Object.create(null),o=Object.create(null);function s(i){if(t[i])return o[i]=[];if(!(i in o)){o[i]=null;const a=r[i]&&r[i].parent,c=a&&s(a);c&&(o[i]=[a].concat(c))}return o[i]}return Object.keys(t).concat(Object.keys(r)).forEach(s),o}function $t(e,n,t){const r=e.icons,o=e.aliases||Object.create(null);let s={};function i(a){s=xe(r[a]||o[a],s)}return i(n),t.forEach(i),xe(e,s)}function De(e,n){const t=[];if(typeof e!="object"||typeof e.icons!="object")return t;e.not_found instanceof Array&&e.not_found.forEach(o=>{n(o,null),t.push(o)});const r=Dt(e);for(const o in r){const s=r[o];s&&(n(o,$t(e,o,s)),t.push(o))}return t}const Ut={provider:"",aliases:{},not_found:{},...ze};function X(e,n){for(const t in n)if(t in e&&typeof e[t]!=typeof n[t])return!1;return!0}function $e(e){if(typeof e!="object"||e===null)return null;const n=e;if(typeof n.prefix!="string"||!e.icons||typeof e.icons!="object"||!X(e,Ut))return null;const t=n.icons;for(const o in t){const s=t[o];if(!o.match(O)||typeof s.body!="string"||!X(s,te))return null}const r=n.aliases||Object.create(null);for(const o in r){const s=r[o],i=s.parent;if(!o.match(O)||typeof i!="string"||!t[i]&&!r[i]||!X(s,te))return null}return n}const W=Object.create(null);function Qt(e,n){return{provider:e,prefix:n,icons:Object.create(null),missing:new Set}}function L(e,n){const t=W[e]||(W[e]=Object.create(null));return t[n]||(t[n]=Qt(e,n))}function ue(e,n){return $e(n)?De(n,(t,r)=>{r?e.icons[t]=r:e.missing.add(t)}):[]}function Vt(e,n,t){try{if(typeof t.body=="string")return e.icons[n]={...t},!0}catch{}return!1}function Wt(e,n){let t=[];return(typeof e=="string"?[e]:Object.keys(W)).forEach(o=>{(typeof o=="string"&&typeof n=="string"?[n]:Object.keys(W[o]||{})).forEach(i=>{const a=L(o,i);t=t.concat(Object.keys(a.icons).map(c=>(o!==""?"@"+o+":":"")+i+":"+c))})}),t}let _=!1;function Ue(e){return typeof e=="boolean"&&(_=e),_}function q(e){const n=typeof e=="string"?z(e,!0,_):e;if(n){const t=L(n.provider,n.prefix),r=n.name;return t.icons[r]||(t.missing.has(r)?null:void 0)}}function Qe(e,n){const t=z(e,!0,_);if(!t)return!1;const r=L(t.provider,t.prefix);return Vt(r,t.name,n)}function we(e,n){if(typeof e!="object")return!1;if(typeof n!="string"&&(n=e.provider||""),_&&!n&&!e.prefix){let o=!1;return $e(e)&&(e.prefix="",De(e,(s,i)=>{i&&Qe(s,i)&&(o=!0)})),o}const t=e.prefix;if(!U({provider:n,prefix:t,name:"a"}))return!1;const r=L(n,t);return!!ue(r,e)}function Zt(e){return!!q(e)}function Gt(e){const n=q(e);return n?{...F,...n}:null}function Jt(e){const n={loaded:[],missing:[],pending:[]},t=Object.create(null);e.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(o=>{if(r.name===o.name&&r.prefix===o.prefix&&r.provider===o.provider)return;r=o;const s=o.provider,i=o.prefix,a=o.name,c=t[s]||(t[s]=Object.create(null)),l=c[i]||(c[i]=L(s,i));let u;a in l.icons?u=n.loaded:i===""||l.missing.has(a)?u=n.missing:u=n.pending;const d={provider:s,prefix:i,name:a};u.push(d)}),n}function Ve(e,n){e.forEach(t=>{const r=t.loaderCallbacks;r&&(t.loaderCallbacks=r.filter(o=>o.id!==n))})}function Xt(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const n=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!n.length)return;let t=!1;const r=e.provider,o=e.prefix;n.forEach(s=>{const i=s.icons,a=i.pending.length;i.pending=i.pending.filter(c=>{if(c.prefix!==o)return!0;const l=c.name;if(e.icons[l])i.loaded.push({provider:r,prefix:o,name:l});else if(e.missing.has(l))i.missing.push({provider:r,prefix:o,name:l});else return t=!0,!0;return!1}),i.pending.length!==a&&(t||Ve([e],s.id),s.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),s.abort))})}))}let Yt=0;function Kt(e,n,t){const r=Yt++,o=Ve.bind(null,t,r);if(!n.pending.length)return o;const s={id:r,icons:n,callback:e,abort:o};return t.forEach(i=>{(i.loaderCallbacks||(i.loaderCallbacks=[])).push(s)}),o}const ne=Object.create(null);function Ie(e,n){ne[e]=n}function oe(e){return ne[e]||ne[""]}function en(e,n=!0,t=!1){const r=[];return e.forEach(o=>{const s=typeof o=="string"?z(o,n,t):o;s&&r.push(s)}),r}var tn={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function nn(e,n,t,r){const o=e.resources.length,s=e.random?Math.floor(Math.random()*o):e.index;let i;if(e.random){let h=e.resources.slice(0);for(i=[];h.length>1;){const S=Math.floor(Math.random()*h.length);i.push(h[S]),h=h.slice(0,S).concat(h.slice(S+1))}i=i.concat(h)}else i=e.resources.slice(s).concat(e.resources.slice(0,s));const a=Date.now();let c="pending",l=0,u,d=null,p=[],m=[];typeof r=="function"&&m.push(r);function b(){d&&(clearTimeout(d),d=null)}function x(){c==="pending"&&(c="aborted"),b(),p.forEach(h=>{h.status==="pending"&&(h.status="aborted")}),p=[]}function T(h,S){S&&(m=[]),typeof h=="function"&&m.push(h)}function j(){return{startTime:a,payload:n,status:c,queriesSent:l,queriesPending:p.length,subscribe:T,abort:x}}function I(){c="failed",m.forEach(h=>{h(void 0,u)})}function y(){p.forEach(h=>{h.status==="pending"&&(h.status="aborted")}),p=[]}function B(h,S,k){const w=S!=="success";switch(p=p.filter(C=>C!==h),c){case"pending":break;case"failed":if(w||!e.dataAfterTimeout)return;break;default:return}if(S==="abort"){u=k,I();return}if(w){u=k,p.length||(i.length?v():I());return}if(b(),y(),!e.random){const C=e.resources.indexOf(h.resource);C!==-1&&C!==e.index&&(e.index=C)}c="completed",m.forEach(C=>{C(k)})}function v(){if(c!=="pending")return;b();const h=i.shift();if(h===void 0){if(p.length){d=setTimeout(()=>{b(),c==="pending"&&(y(),I())},e.timeout);return}I();return}const S={status:"pending",resource:h,callback:(k,w)=>{B(S,k,w)}};p.push(S),l++,d=setTimeout(v,e.rotate),t(h,n,S.callback)}return setTimeout(v),j}function We(e){const n={...tn,...e};let t=[];function r(){t=t.filter(a=>a().status==="pending")}function o(a,c,l){const u=nn(n,a,c,(d,p)=>{r(),l&&l(d,p)});return t.push(u),u}function s(a){return t.find(c=>a(c))||null}return{query:o,find:s,setIndex:a=>{n.index=a},getIndex:()=>n.index,cleanup:r}}function fe(e){let n;if(typeof e.resources=="string")n=[e.resources];else if(n=e.resources,!(n instanceof Array)||!n.length)return null;return{resources:n,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const G=Object.create(null),E=["https://api.simplesvg.com","https://api.unisvg.com"],Q=[];for(;E.length>0;)E.length===1||Math.random()>.5?Q.push(E.shift()):Q.push(E.pop());G[""]=fe({resources:["https://api.iconify.design"].concat(Q)});function Se(e,n){const t=fe(n);return t===null?!1:(G[e]=t,!0)}function J(e){return G[e]}function on(){return Object.keys(G)}function ve(){}const Y=Object.create(null);function rn(e){if(!Y[e]){const n=J(e);if(!n)return;const t=We(n),r={config:n,redundancy:t};Y[e]=r}return Y[e]}function Ze(e,n,t){let r,o;if(typeof e=="string"){const s=oe(e);if(!s)return t(void 0,424),ve;o=s.send;const i=rn(e);i&&(r=i.redundancy)}else{const s=fe(e);if(s){r=We(s);const i=e.resources?e.resources[0]:"",a=oe(i);a&&(o=a.send)}}return!r||!o?(t(void 0,424),ve):r.query(n,o,t)().abort}const Te="iconify2",N="iconify",Ge=N+"-count",Ce=N+"-version",Je=36e5,sn=168;function re(e,n){try{return e.getItem(n)}catch{}}function de(e,n,t){try{return e.setItem(n,t),!0}catch{}}function Ae(e,n){try{e.removeItem(n)}catch{}}function se(e,n){return de(e,Ge,n.toString())}function ie(e){return parseInt(re(e,Ge))||0}const M={local:!0,session:!0},Xe={local:new Set,session:new Set};let he=!1;function cn(e){he=e}let $=typeof window>"u"?{}:window;function Ye(e){const n=e+"Storage";try{if($&&$[n]&&typeof $[n].length=="number")return $[n]}catch{}M[e]=!1}function Ke(e,n){const t=Ye(e);if(!t)return;const r=re(t,Ce);if(r!==Te){if(r){const a=ie(t);for(let c=0;c<a;c++)Ae(t,N+c.toString())}de(t,Ce,Te),se(t,0);return}const o=Math.floor(Date.now()/Je)-sn,s=a=>{const c=N+a.toString(),l=re(t,c);if(typeof l=="string"){try{const u=JSON.parse(l);if(typeof u=="object"&&typeof u.cached=="number"&&u.cached>o&&typeof u.provider=="string"&&typeof u.data=="object"&&typeof u.data.prefix=="string"&&n(u,a))return!0}catch{}Ae(t,c)}};let i=ie(t);for(let a=i-1;a>=0;a--)s(a)||(a===i-1?(i--,se(t,i)):Xe[e].add(a))}function et(){if(!he){cn(!0);for(const e in M)Ke(e,n=>{const t=n.data,r=n.provider,o=t.prefix,s=L(r,o);if(!ue(s,t).length)return!1;const i=t.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,i):i,!0})}}function an(e,n){const t=e.lastModifiedCached;if(t&&t>=n)return t===n;if(e.lastModifiedCached=n,t)for(const r in M)Ke(r,o=>{const s=o.data;return o.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===n});return!0}function ln(e,n){he||et();function t(r){let o;if(!M[r]||!(o=Ye(r)))return;const s=Xe[r];let i;if(s.size)s.delete(i=Array.from(s).shift());else if(i=ie(o),!se(o,i+1))return;const a={cached:Math.floor(Date.now()/Je),provider:e.provider,data:n};return de(o,N+i.toString(),JSON.stringify(a))}n.lastModified&&!an(e,n.lastModified)||Object.keys(n.icons).length&&(n.not_found&&(n=Object.assign({},n),delete n.not_found),t("local")||t("session"))}function je(){}function un(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Xt(e)}))}function fn(e,n){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(n).sort():e.iconsToLoad=n,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:t,prefix:r}=e,o=e.iconsToLoad;delete e.iconsToLoad;let s;if(!o||!(s=oe(t)))return;s.prepare(t,r,o).forEach(a=>{Ze(t,a,c=>{if(typeof c!="object")a.icons.forEach(l=>{e.missing.add(l)});else try{const l=ue(e,c);if(!l.length)return;const u=e.pendingIcons;u&&l.forEach(d=>{u.delete(d)}),ln(e,c)}catch(l){console.error(l)}un(e)})})}))}const pe=(e,n)=>{const t=en(e,!0,Ue()),r=Jt(t);if(!r.pending.length){let c=!0;return n&&setTimeout(()=>{c&&n(r.loaded,r.missing,r.pending,je)}),()=>{c=!1}}const o=Object.create(null),s=[];let i,a;return r.pending.forEach(c=>{const{provider:l,prefix:u}=c;if(u===a&&l===i)return;i=l,a=u,s.push(L(l,u));const d=o[l]||(o[l]=Object.create(null));d[u]||(d[u]=[])}),r.pending.forEach(c=>{const{provider:l,prefix:u,name:d}=c,p=L(l,u),m=p.pendingIcons||(p.pendingIcons=new Set);m.has(d)||(m.add(d),o[l][u].push(d))}),s.forEach(c=>{const{provider:l,prefix:u}=c;o[l][u].length&&fn(c,o[l][u])}),n?Kt(n,r,s):je},dn=e=>new Promise((n,t)=>{const r=typeof e=="string"?z(e,!0):e;if(!r){t(e);return}pe([r||e],o=>{if(o.length&&r){const s=q(r);if(s){n({...F,...s});return}}t(e)})});function hn(e){try{const n=typeof e=="string"?JSON.parse(e):e;if(typeof n.body=="string")return{...n}}catch{}}function pn(e,n){const t=typeof e=="string"?z(e,!0,!0):null;if(!t){const s=hn(e);return{value:e,data:s}}const r=q(t);if(r!==void 0||!t.prefix)return{value:e,name:t,data:r};const o=pe([t],()=>n(e,t,q(t)));return{value:e,name:t,loading:o}}function K(e){return e.hasAttribute("inline")}let tt=!1;try{tt=navigator.vendor.indexOf("Apple")===0}catch{}function gn(e,n){switch(n){case"svg":case"bg":case"mask":return n}return n!=="style"&&(tt||e.indexOf("<a")===-1)?"svg":e.indexOf("currentColor")===-1?"bg":"mask"}const mn=/(-?[0-9.]*[0-9]+[0-9.]*)/g,yn=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ce(e,n,t){if(n===1)return e;if(t=t||100,typeof e=="number")return Math.ceil(e*n*t)/t;if(typeof e!="string")return e;const r=e.split(mn);if(r===null||!r.length)return e;const o=[];let s=r.shift(),i=yn.test(s);for(;;){if(i){const a=parseFloat(s);isNaN(a)?o.push(s):o.push(Math.ceil(a*n*t)/t)}else o.push(s);if(s=r.shift(),s===void 0)return o.join("");i=!i}}const bn=e=>e==="unset"||e==="undefined"||e==="none";function nt(e,n){const t={...F,...e},r={...He,...n},o={left:t.left,top:t.top,width:t.width,height:t.height};let s=t.body;[t,r].forEach(b=>{const x=[],T=b.hFlip,j=b.vFlip;let I=b.rotate;T?j?I+=2:(x.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),x.push("scale(-1 1)"),o.top=o.left=0):j&&(x.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),x.push("scale(1 -1)"),o.top=o.left=0);let y;switch(I<0&&(I-=Math.floor(I/4)*4),I=I%4,I){case 1:y=o.height/2+o.top,x.unshift("rotate(90 "+y.toString()+" "+y.toString()+")");break;case 2:x.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:y=o.width/2+o.left,x.unshift("rotate(-90 "+y.toString()+" "+y.toString()+")");break}I%2===1&&(o.left!==o.top&&(y=o.left,o.left=o.top,o.top=y),o.width!==o.height&&(y=o.width,o.width=o.height,o.height=y)),x.length&&(s='<g transform="'+x.join(" ")+'">'+s+"</g>")});const i=r.width,a=r.height,c=o.width,l=o.height;let u,d;i===null?(d=a===null?"1em":a==="auto"?l:a,u=ce(d,c/l)):(u=i==="auto"?c:i,d=a===null?ce(u,l/c):a==="auto"?l:a);const p={},m=(b,x)=>{bn(x)||(p[b]=x.toString())};return m("width",u),m("height",d),p.viewBox=o.left.toString()+" "+o.top.toString()+" "+c.toString()+" "+l.toString(),{attributes:p,body:s}}const xn=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let Z=xn();function wn(e){Z=e}function In(){return Z}function Sn(e,n){const t=J(e);if(!t)return 0;let r;if(!t.maxURL)r=0;else{let o=0;t.resources.forEach(i=>{o=Math.max(o,i.length)});const s=n+".json?icons=";r=t.maxURL-o-t.path.length-s.length}return r}function vn(e){return e===404}const Tn=(e,n,t)=>{const r=[],o=Sn(e,n),s="icons";let i={type:s,provider:e,prefix:n,icons:[]},a=0;return t.forEach((c,l)=>{a+=c.length+1,a>=o&&l>0&&(r.push(i),i={type:s,provider:e,prefix:n,icons:[]},a=c.length),i.icons.push(c)}),r.push(i),r};function Cn(e){if(typeof e=="string"){const n=J(e);if(n)return n.path}return"/"}const An=(e,n,t)=>{if(!Z){t("abort",424);return}let r=Cn(n.provider);switch(n.type){case"icons":{const s=n.prefix,a=n.icons.join(","),c=new URLSearchParams({icons:a});r+=s+".json?"+c.toString();break}case"custom":{const s=n.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:t("abort",400);return}let o=503;Z(e+r).then(s=>{const i=s.status;if(i!==200){setTimeout(()=>{t(vn(i)?"abort":"next",i)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?t("abort",s):t("next",o)});return}setTimeout(()=>{t("success",s)})}).catch(()=>{t("next",o)})},jn={prepare:Tn,send:An};function Pe(e,n){switch(e){case"local":case"session":M[e]=n;break;case"all":for(const t in M)M[t]=n;break}}const ee="data-style";let ot="";function Pn(e){ot=e}function ke(e,n){let t=Array.from(e.childNodes).find(r=>r.hasAttribute&&r.hasAttribute(ee));t||(t=document.createElement("style"),t.setAttribute(ee,ee),e.appendChild(t)),t.textContent=":host{display:inline-block;vertical-align:"+(n?"-0.125em":"0")+"}span,svg{display:block}"+ot}function rt(){Ie("",jn),Ue(!0);let e;try{e=window}catch{}if(e){if(et(),e.IconifyPreload!==void 0){const t=e.IconifyPreload,r="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!we(o))&&console.error(r)}catch{console.error(r)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(const r in t){const o="IconifyProviders["+r+"] is invalid.";try{const s=t[r];if(typeof s!="object"||!s||s.resources===void 0)continue;Se(r,s)||console.error(o)}catch{console.error(o)}}}}return{enableCache:t=>Pe(t,!0),disableCache:t=>Pe(t,!1),iconExists:Zt,getIcon:Gt,listIcons:Wt,addIcon:Qe,addCollection:we,calculateSize:ce,buildIcon:nt,loadIcons:pe,loadIcon:dn,addAPIProvider:Se,appendCustomStyle:Pn,_api:{getAPIConfig:J,setAPIModule:Ie,sendAPIQuery:Ze,setFetch:wn,getFetch:In,listAPIProviders:on}}}function st(e,n){let t=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in n)t+=" "+r+'="'+n[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+t+">"+e+"</svg>"}function kn(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Ln(e){return"data:image/svg+xml,"+kn(e)}function Mn(e){return'url("'+Ln(e)+'")'}const ae={"background-color":"currentColor"},it={"background-color":"transparent"},Le={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Me={"-webkit-mask":ae,mask:ae,background:it};for(const e in Me){const n=Me[e];for(const t in Le)n[e+"-"+t]=Le[t]}function Ee(e){return e?e+(e.match(/^[-0-9.]+$/)?"px":""):"inherit"}function En(e,n,t){const r=document.createElement("span");let o=e.body;o.indexOf("<a")!==-1&&(o+="<!-- "+Date.now()+" -->");const s=e.attributes,i=st(o,{...s,width:n.width+"",height:n.height+""}),a=Mn(i),c=r.style,l={"--svg":a,width:Ee(s.width),height:Ee(s.height),...t?ae:it};for(const u in l)c.setProperty(u,l[u]);return r}let R;function On(){try{R=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{R=null}}function Rn(e){return R===void 0&&On(),R?R.createHTML(e):e}function _n(e){const n=document.createElement("span"),t=e.attributes;let r="";t.width||(r="width: inherit;"),t.height||(r+="height: inherit;"),r&&(t.style=r);const o=st(e.body,t);return n.innerHTML=Rn(o),n.firstChild}function Oe(e,n){const t=n.icon.data,r=n.customisations,o=nt(t,r);r.preserveAspectRatio&&(o.attributes.preserveAspectRatio=r.preserveAspectRatio);const s=n.renderedMode;let i;switch(s){case"svg":i=_n(o);break;default:i=En(o,{...F,...t},s==="mask")}const a=Array.from(e.childNodes).find(c=>{const l=c.tagName&&c.tagName.toUpperCase();return l==="SPAN"||l==="SVG"});a?i.tagName==="SPAN"&&a.tagName===i.tagName?a.setAttribute("style",i.getAttribute("style")):e.replaceChild(i,a):e.appendChild(i)}function Re(e,n,t){const r=t&&(t.rendered?t:t.lastRender);return{rendered:!1,inline:n,icon:e,lastRender:r}}function qn(e="iconify-icon"){let n,t;try{n=window.customElements,t=window.HTMLElement}catch{return}if(!n||!t)return;const r=n.get(e);if(r)return r;const o=["icon","mode","inline","width","height","rotate","flip"],s=class extends t{constructor(){super();D(this,"_shadowRoot");D(this,"_state");D(this,"_checkQueued",!1);const c=this._shadowRoot=this.attachShadow({mode:"open"}),l=K(this);ke(c,l),this._state=Re({value:""},l),this._queueCheck()}static get observedAttributes(){return o.slice(0)}attributeChangedCallback(c){if(c==="inline"){const l=K(this),u=this._state;l!==u.inline&&(u.inline=l,ke(this._shadowRoot,l))}else this._queueCheck()}get icon(){const c=this.getAttribute("icon");if(c&&c.slice(0,1)==="{")try{return JSON.parse(c)}catch{}return c}set icon(c){typeof c=="object"&&(c=JSON.stringify(c)),this.setAttribute("icon",c)}get inline(){return K(this)}set inline(c){c?this.setAttribute("inline","true"):this.removeAttribute("inline")}restartAnimation(){const c=this._state;if(c.rendered){const l=this._shadowRoot;if(c.renderedMode==="svg")try{l.lastChild.setCurrentTime(0);return}catch{}Oe(l,c)}}get status(){const c=this._state;return c.rendered?"rendered":c.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const c=this._state,l=this.getAttribute("icon");if(l!==c.icon.value){this._iconChanged(l);return}if(!c.rendered)return;const u=this.getAttribute("mode"),d=be(this);(c.attrMode!==u||Ht(c.customisations,d))&&this._renderIcon(c.icon,d,u)}_iconChanged(c){const l=pn(c,(u,d,p)=>{const m=this._state;if(m.rendered||this.getAttribute("icon")!==u)return;const b={value:u,name:d,data:p};b.data?this._gotIconData(b):m.icon=b});l.data?this._gotIconData(l):this._state=Re(l,this._state.inline,this._state)}_gotIconData(c){this._checkQueued=!1,this._renderIcon(c,be(this),this.getAttribute("mode"))}_renderIcon(c,l,u){const d=gn(c.data.body,u),p=this._state.inline;Oe(this._shadowRoot,this._state={rendered:!0,icon:c,inline:p,customisations:l,attrMode:u,renderedMode:d})}};o.forEach(a=>{a in s.prototype||Object.defineProperty(s.prototype,a,{get:function(){return this.getAttribute(a)},set:function(c){c!==null?this.setAttribute(a,c):this.removeAttribute(a)}})});const i=rt();for(const a in i)s[a]=s.prototype[a]=i[a];return n.define(e,s),s}qn()||rt();const Nn=f.shape({appLogo:f.node,appName:f.string,theme:f.shape({background:f.string}),enableConnect:f.bool,enableLocale:f.bool,navigation:f.arrayOf(f.shape({title:f.oneOfType([f.string,f.object]),link:f.oneOfType([f.string,f.object]),icon:f.string,items:f.arrayOf(f.shape({title:f.oneOfType([f.string,f.object]),link:f.oneOfType([f.string,f.object])}))}))}),ct=f.shape({showText:f.bool,showRole:f.bool,switchDid:f.bool,switchProfile:f.bool,switchPassport:f.bool,disableLogout:f.bool,onLogin:f.func,onLogout:f.func,onSwitchDid:f.func,onSwitchProfile:f.func,onSwitchPassport:f.func,menu:f.array,menuRender:f.func,dark:f.bool,size:f.number}),H=(e,n,t="children")=>e.map(r=>Array.isArray(r[t])?n({...r,[t]:H(r[t],n,t)}):n(r)),Fn=(e,n="children")=>{const t=[];return H(e,r=>t.push(r),n),t},ge=(e,n,t="children")=>e.map(r=>({...r})).filter(r=>{const o=r[t];if(Array.isArray(o)){const i=ge(o,n,t);r[t]=i!=null&&i.length?i:void 0}const s={filteredChildren:r[t],isLeaf:!(o!=null&&o.length)};return n(r,s)}),zn=e=>/^https?:\/\//.test(e),Hn=e=>{if(!e||!(e!=null&&e.startsWith("/")))return!1;const n=o=>o.endsWith("/")?o:`${o}/`,t=n(window.location.pathname),r=n(new URL(e,window.location.origin).pathname);return t.startsWith(r)},Bn=(e=[])=>{const n=e.map((r,o)=>({path:r,index:o})).filter(r=>Hn(r.path));return n!=null&&n.length?n.slice(1).reduce((r,o)=>r.path.length>=o.path.length?r:o,n[0]).index:-1};var _e,qe;const le=((_e=window==null?void 0:window.blocklet)==null?void 0:_e.groupPrefix)||((qe=window==null?void 0:window.blocklet)==null?void 0:qe.prefix)||"/",Dn=e=>{const n={...e},t=e==null?void 0:e.background;return typeof t=="string"?n.background={header:t,footer:t,default:t}:t&&typeof t=="object"&&(n.background={header:t.header||t.default,footer:t.footer||t.default,default:t.default}),n},at=(e,n="en")=>{if(!(e!=null&&e.length))return e;const t=(o,s)=>typeof o=="string"?o:typeof o=="object"?o[s]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o,r=(o,s)=>{if(typeof o=="string"){if(zn(o)){const a=new URL(o);return a.searchParams.set("locale",s),a.href}const i=new URL(o,window.location.origin);return i.searchParams.set("locale",s),i.pathname+i.search}return typeof o=="object"?o[s]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o};return H(e,o=>{var s;return{...o,title:t(o.title,n),link:(s=o.items)!=null&&s.length?o.link:r(o.link,n),_rawLink:o.link}},"items")},$n=e=>H(e,n=>n.role?{...n,role:Array.isArray(n.role)?n.role:[n.role]}:n,"items"),Un=e=>{if(!(e!=null&&e.length))return null;const n=$n(e),t={header:[],footer:[],social:[],bottom:[],dashboard:[],sessionManager:[],userCenter:[]};return n.forEach(r=>{var o;r.section?Array.isArray(r.section)?r.section.forEach(s=>{var i;(i=t[s])==null||i.push(r)}):typeof r.section=="string"&&((o=t[r.section])==null||o.push(r)):t.header.push(r)}),t},Qn=e=>{if(!e)return null;const n={...e};return n.theme=Dn(n.theme),n.navigation=Un(Vn(n.navigation)),n},Vn=(e=[])=>ge(e,(n,t)=>{var r;return!!n.link||((r=t.filteredChildren)==null?void 0:r.length)},"items"),lt=(e,n)=>ge(e,(t,r)=>{var s;const o=!t.role||n&&(t.role.includes(n)||t.role.includes("guest"));return r.isLeaf?o:o&&((s=r.filteredChildren)==null?void 0:s.length)},"items"),Wn={top:-960,width:960,height:960,body:'<path fill="currentColor" d="M510-600v-210q0-12.75 8.625-21.375T540-840h270q12.75 0 21.375 8.625T840-810v210q0 12.75-8.625 21.375T810-570H540q-12.75 0-21.375-8.625T510-600M120-480v-330q0-12.75 8.625-21.375T150-840h270q12.75 0 21.375 8.625T450-810v330q0 12.75-8.625 21.375T420-450H150q-12.75 0-21.375-8.625T120-480m390 330v-330q0-12.75 8.625-21.375T540-510h270q12.75 0 21.375 8.625T840-480v330q0 12.75-8.625 21.375T810-120H540q-12.75 0-21.375-8.625T510-150m-390 0v-210q0-12.75 8.625-21.375T150-390h270q12.75 0 21.375 8.625T450-360v210q0 12.75-8.625 21.375T420-120H150q-12.75 0-21.375-8.625T120-150m60-360h210v-270H180zm390 330h210v-270H570zm0-450h210v-150H570zM180-180h210v-150H180zm210-150"/>'},Zn={width:24,height:24,body:'<path fill="currentColor" d="M15.95 12.3L11.7 8.05q-.15-.15-.212-.325t-.063-.375q0-.2.063-.375t.212-.325l4.25-4.25q.15-.15.325-.212t.375-.063q.2 0 .375.063t.325.212l4.25 4.25q.15.15.213.325t.062.375q0 .2-.063.375t-.212.325l-4.25 4.25q-.15.15-.325.213t-.375.062q-.2 0-.375-.062t-.325-.213ZM3 10V4q0-.425.288-.713T4 3h6q.425 0 .713.288T11 4v6q0 .425-.288.713T10 11H4q-.425 0-.713-.288T3 10Zm10 10v-6q0-.425.288-.713T14 13h6q.425 0 .713.288T21 14v6q0 .425-.288.713T20 21h-6q-.425 0-.713-.288T13 20ZM3 20v-6q0-.425.288-.713T4 13h6q.425 0 .713.288T11 14v6q0 .425-.288.713T10 21H4q-.425 0-.713-.288T3 20ZM5 9h4V5H5v4Zm11.675 1.2L19.5 7.375L16.675 4.55L13.85 7.375l2.825 2.825ZM15 19h4v-4h-4v4ZM5 19h4v-4H5v4ZM9 9Zm4.85-1.625ZM9 15Zm6 0Z"/>'};function Gn({session:e,locale:n="zh",size:t=24}){const r=(window==null?void 0:window.blocklet)||{},o=(r.navigation||[]).filter(c=>c.section==="sessionManager"&&!["/sessionManager"].includes(c.id)).filter(c=>{var l;return!!((c==null?void 0:c.role)||[]).includes(((l=e==null?void 0:e.user)==null?void 0:l.role)||"guest")}).map(c=>{const l=((r==null?void 0:r.componentMountPoints)||[]).find(u=>c.component===u.name);return{...c,component:l}}),s=P.useRef(null),i=ht({open:!1}),a=pt((c=!i.open)=>{i.open=c});return o.length===0||!(e!=null&&e.user)?null:g.jsxs(g.Fragment,{children:[g.jsx(gt,{size:"medium",ref:s,onClick:()=>a(),children:g.jsx(ye,{icon:Wn,fontSize:t,style:{transform:"scale(1.08)"}})}),g.jsx(mt,{open:i.open,anchorEl:s.current,transition:!0,placement:"bottom-end",sx:{zIndex:1600},children:({TransitionProps:c})=>g.jsx(yt,{onClickAway:l=>{l.preventDefault(),l.stopPropagation(),a(!1)},children:g.jsx(bt,{...c,timeout:350,children:g.jsxs(xt,{variant:"outlined",sx:{borderRadius:3,width:350,maxWidth:"90vw",borderColor:A.lineStep,p:2,border:"0 !important",boxShadow:`0px 8px 16px 0px ${A.gray6}, 0px 0px 0px 1px ${A.gray6}`},children:[g.jsx(wt,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, 100px)",gridAutoRows:"minmax(100px, max-content)",justifyContent:"space-between",maxHeight:350,overflowY:"auto",p:0},children:o.map(l=>{var u;return g.jsx(Ot,{disablePadding:!0,children:g.jsxs(Rt,{href:l.link,sx:{p:1,display:"flex",flexDirection:"column",alignItems:"center",gap:1,width:"100%",height:"100%",borderRadius:2,"&:hover":{backgroundColor:A.surfacePrimarySubtitle}},children:[(u=l==null?void 0:l.component)!=null&&u.did?g.jsx(It,{component:"img",src:`${St}/blocklet/logo-bundle/${l.component.did}`,sx:{borderRadius:2,width:50,height:50,objectFit:"contain"},alt:"SessionBlocklet component icon"}):g.jsx(ye,{fontSize:50,icon:l.icon||Zn,color:A.textSubtitle}),g.jsx(vt,{sx:{fontSize:"12px",color:A.textBase,textAlign:"center",lineHeight:"normal"},children:Tt(l.title,n)})]})},l.id)})}),g.jsx(Ct,{session:e,children:g.jsx(At,{variant:"outlined",fullWidth:!0,href:jt,sx:{mt:1,borderRadius:2,color:A.textBase,borderColor:A.lineBorderStrong,"&:hover":{color:A.primaryBase,borderColor:A.primaryBase}},children:n==="zh"?"管理":"Manage"})})]})})})})]})}function me({formattedBlocklet:e,addons:n,sessionManagerProps:t}){var p,m,b,x;const r=P.useContext(Ne),{locale:o}=Fe()||{},{enableConnect:s=!0,enableLocale:i=!0}=e,a=!!((p=r==null?void 0:r.session)!=null&&p.user);let c=at((m=e==null?void 0:e.navigation)==null?void 0:m.sessionManager,o)||[];c=lt(c,(x=(b=r==null?void 0:r.session)==null?void 0:b.user)==null?void 0:x.role);const u=(()=>{if(n&&typeof n!="function")return Array.isArray(n)?n:[n];let T=[];if(i&&o&&T.push(g.jsx(_t,{showText:!1},"locale-selector")),s&&r){const j=[];a&&(c?c.slice(0,5):[]).forEach(y=>{j.push({label:y.title,icon:y.icon?g.jsx("iconify-icon",{icon:y.icon,height:24,style:{marginRight:8}}):null,component:"a",href:y.link,key:y.link})}),T.push(g.jsx(Gn,{session:r.session,locale:o},"session-blocklet")),T.push(g.jsx(Pt,{session:r.session,locale:o,menu:j,showRole:!0,...t},"session-user"))}return typeof n=="function"&&(T=n(T)||[]),T})();return P.createElement(g.Fragment,null,...Array.isArray(u)?u:[u])}me.propTypes={formattedBlocklet:f.object.isRequired,addons:f.oneOfType([f.func,f.node]),sessionManagerProps:ct};me.defaultProps={addons:null,sessionManagerProps:{showRole:!0}};const Jn=()=>{const e=kt();P.useEffect(()=>{e.wallet&&Lt.call("arcHideTopBar","{}")},[e])};function ut({meta:e,fallbackUrl:n,invalidPathFallback:t,headerAddons:r,sessionManagerProps:o,links:s,...i}){var B;Jn();const a=P.useContext(Ne),c=(B=a==null?void 0:a.session)==null?void 0:B.user,l=c==null?void 0:c.role,{locale:u}=Fe()||{},d=P.useMemo(()=>{const v=Object.assign({},window.blocklet,e);try{return Qn(v)}catch(h){return console.error("Failed to format blocklet info",h,v),v}},[e]),{localizedNav:p,flattened:m,matchedIndex:b}=P.useMemo(()=>{var k;let v=at((k=d==null?void 0:d.navigation)==null?void 0:k.dashboard,u)||[];v=lt(v,l),v=H(v,w=>{let C=null;return w.icon&&(w.icon.startsWith("http")||w.icon.startsWith("data:")?C=g.jsx(Mt,{src:w.icon}):C=g.jsx("iconify-icon",{height:"100%",width:"100%",icon:w.icon})),{title:w.title,url:w.link,icon:C,external:!0,children:w.items}},"items");const h=Fn(v).filter(w=>!!w.url),S=Bn(h.map(w=>w.url));return S!==-1&&(h[S].active=!0),{localizedNav:v,flattened:h,matchedIndex:S}},[d,u,l]),x=typeof s=="function"?s(p):[...p,...s];if(P.useLayoutEffect(()=>{c&&!(m!=null&&m.length)&&n&&(window.location.href=n)},[n]),P.useLayoutEffect(()=>{c&&(m!=null&&m.length)&&b===-1&&t&&t()},[t,m,b]),!d.appName)return null;const{appLogo:T,appLogoRect:j,appName:I}=d,y=g.jsx(me,{formattedBlocklet:d,addons:r,sessionManagerProps:o});return g.jsx(Et,{title:I,fullWidth:!0,sidebarWidth:128,legacy:!1,links:x,...i,headerProps:{homeLink:le,logo:g.jsx("img",{src:j||T,alt:"logo"}),addons:y,...i.headerProps}})}ut.propTypes={meta:Nn,fallbackUrl:f.string,invalidPathFallback:f.func,headerAddons:f.oneOfType([f.func,f.node]),sessionManagerProps:ct,links:f.oneOfType([f.array,f.func])};ut.defaultProps={meta:{},fallbackUrl:le,invalidPathFallback:null,headerAddons:void 0,sessionManagerProps:{showRole:!0,onLogout:()=>{window.location.href=le}},links:[]};export{Nn as B,ut as D,me as H,Fn as a,Bn as b,Qn as f,at as g,zn as i,H as m,le as p,Jn as u};
11
+ */const He=Object.freeze({left:0,top:0,width:16,height:16}),V=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),F=Object.freeze({...He,...V}),te=Object.freeze({...F,body:"",hidden:!1}),qt=Object.freeze({width:null,height:null}),ze=Object.freeze({...qt,...V});function Nt(e,n=0){const t=e.replace(/^-?[0-9.]*/,"");function r(o){for(;o<0;)o+=4;return o%4}if(t===""){const o=parseInt(e);return isNaN(o)?0:r(o)}else if(t!==e){let o=0;switch(t){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(e.slice(0,e.length-t.length));return isNaN(s)?0:(s=s/o,s%1===0?r(s):0)}}return n}const Ft=/[\s,]+/;function Ht(e,n){n.split(Ft).forEach(t=>{switch(t.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const Be={...ze,preserveAspectRatio:""};function be(e){const n={...Be},t=(r,o)=>e.getAttribute(r)||o;return n.width=t("width",null),n.height=t("height",null),n.rotate=Nt(t("rotate","")),Ht(n,t("flip","")),n.preserveAspectRatio=t("preserveAspectRatio",t("preserveaspectratio","")),n}function zt(e,n){for(const t in Be)if(e[t]!==n[t])return!0;return!1}const O=/^[a-z0-9]+(-[a-z0-9]+)*$/,H=(e,n,t,r="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const a=o.pop(),c=o.pop(),l={provider:o.length>0?o[0]:r,prefix:c,name:a};return n&&!U(l)?null:l}const s=o[0],i=s.split("-");if(i.length>1){const a={provider:r,prefix:i.shift(),name:i.join("-")};return n&&!U(a)?null:a}if(t&&r===""){const a={provider:r,prefix:"",name:s};return n&&!U(a,t)?null:a}return null},U=(e,n)=>e?!!((e.provider===""||e.provider.match(O))&&(n&&e.prefix===""||e.prefix.match(O))&&e.name.match(O)):!1;function Bt(e,n){const t={};!e.hFlip!=!n.hFlip&&(t.hFlip=!0),!e.vFlip!=!n.vFlip&&(t.vFlip=!0);const r=((e.rotate||0)+(n.rotate||0))%4;return r&&(t.rotate=r),t}function xe(e,n){const t=Bt(e,n);for(const r in te)r in V?r in e&&!(r in t)&&(t[r]=V[r]):r in n?t[r]=n[r]:r in e&&(t[r]=e[r]);return t}function Dt(e,n){const t=e.icons,r=e.aliases||Object.create(null),o=Object.create(null);function s(i){if(t[i])return o[i]=[];if(!(i in o)){o[i]=null;const a=r[i]&&r[i].parent,c=a&&s(a);c&&(o[i]=[a].concat(c))}return o[i]}return Object.keys(t).concat(Object.keys(r)).forEach(s),o}function $t(e,n,t){const r=e.icons,o=e.aliases||Object.create(null);let s={};function i(a){s=xe(r[a]||o[a],s)}return i(n),t.forEach(i),xe(e,s)}function De(e,n){const t=[];if(typeof e!="object"||typeof e.icons!="object")return t;e.not_found instanceof Array&&e.not_found.forEach(o=>{n(o,null),t.push(o)});const r=Dt(e);for(const o in r){const s=r[o];s&&(n(o,$t(e,o,s)),t.push(o))}return t}const Ut={provider:"",aliases:{},not_found:{},...He};function X(e,n){for(const t in n)if(t in e&&typeof e[t]!=typeof n[t])return!1;return!0}function $e(e){if(typeof e!="object"||e===null)return null;const n=e;if(typeof n.prefix!="string"||!e.icons||typeof e.icons!="object"||!X(e,Ut))return null;const t=n.icons;for(const o in t){const s=t[o];if(!o.match(O)||typeof s.body!="string"||!X(s,te))return null}const r=n.aliases||Object.create(null);for(const o in r){const s=r[o],i=s.parent;if(!o.match(O)||typeof i!="string"||!t[i]&&!r[i]||!X(s,te))return null}return n}const W=Object.create(null);function Qt(e,n){return{provider:e,prefix:n,icons:Object.create(null),missing:new Set}}function L(e,n){const t=W[e]||(W[e]=Object.create(null));return t[n]||(t[n]=Qt(e,n))}function ue(e,n){return $e(n)?De(n,(t,r)=>{r?e.icons[t]=r:e.missing.add(t)}):[]}function Vt(e,n,t){try{if(typeof t.body=="string")return e.icons[n]={...t},!0}catch{}return!1}function Wt(e,n){let t=[];return(typeof e=="string"?[e]:Object.keys(W)).forEach(o=>{(typeof o=="string"&&typeof n=="string"?[n]:Object.keys(W[o]||{})).forEach(i=>{const a=L(o,i);t=t.concat(Object.keys(a.icons).map(c=>(o!==""?"@"+o+":":"")+i+":"+c))})}),t}let _=!1;function Ue(e){return typeof e=="boolean"&&(_=e),_}function q(e){const n=typeof e=="string"?H(e,!0,_):e;if(n){const t=L(n.provider,n.prefix),r=n.name;return t.icons[r]||(t.missing.has(r)?null:void 0)}}function Qe(e,n){const t=H(e,!0,_);if(!t)return!1;const r=L(t.provider,t.prefix);return Vt(r,t.name,n)}function we(e,n){if(typeof e!="object")return!1;if(typeof n!="string"&&(n=e.provider||""),_&&!n&&!e.prefix){let o=!1;return $e(e)&&(e.prefix="",De(e,(s,i)=>{i&&Qe(s,i)&&(o=!0)})),o}const t=e.prefix;if(!U({provider:n,prefix:t,name:"a"}))return!1;const r=L(n,t);return!!ue(r,e)}function Zt(e){return!!q(e)}function Gt(e){const n=q(e);return n?{...F,...n}:null}function Jt(e){const n={loaded:[],missing:[],pending:[]},t=Object.create(null);e.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let r={provider:"",prefix:"",name:""};return e.forEach(o=>{if(r.name===o.name&&r.prefix===o.prefix&&r.provider===o.provider)return;r=o;const s=o.provider,i=o.prefix,a=o.name,c=t[s]||(t[s]=Object.create(null)),l=c[i]||(c[i]=L(s,i));let u;a in l.icons?u=n.loaded:i===""||l.missing.has(a)?u=n.missing:u=n.pending;const d={provider:s,prefix:i,name:a};u.push(d)}),n}function Ve(e,n){e.forEach(t=>{const r=t.loaderCallbacks;r&&(t.loaderCallbacks=r.filter(o=>o.id!==n))})}function Xt(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const n=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!n.length)return;let t=!1;const r=e.provider,o=e.prefix;n.forEach(s=>{const i=s.icons,a=i.pending.length;i.pending=i.pending.filter(c=>{if(c.prefix!==o)return!0;const l=c.name;if(e.icons[l])i.loaded.push({provider:r,prefix:o,name:l});else if(e.missing.has(l))i.missing.push({provider:r,prefix:o,name:l});else return t=!0,!0;return!1}),i.pending.length!==a&&(t||Ve([e],s.id),s.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),s.abort))})}))}let Yt=0;function Kt(e,n,t){const r=Yt++,o=Ve.bind(null,t,r);if(!n.pending.length)return o;const s={id:r,icons:n,callback:e,abort:o};return t.forEach(i=>{(i.loaderCallbacks||(i.loaderCallbacks=[])).push(s)}),o}const ne=Object.create(null);function Ie(e,n){ne[e]=n}function oe(e){return ne[e]||ne[""]}function en(e,n=!0,t=!1){const r=[];return e.forEach(o=>{const s=typeof o=="string"?H(o,n,t):o;s&&r.push(s)}),r}var tn={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function nn(e,n,t,r){const o=e.resources.length,s=e.random?Math.floor(Math.random()*o):e.index;let i;if(e.random){let h=e.resources.slice(0);for(i=[];h.length>1;){const S=Math.floor(Math.random()*h.length);i.push(h[S]),h=h.slice(0,S).concat(h.slice(S+1))}i=i.concat(h)}else i=e.resources.slice(s).concat(e.resources.slice(0,s));const a=Date.now();let c="pending",l=0,u,d=null,p=[],m=[];typeof r=="function"&&m.push(r);function b(){d&&(clearTimeout(d),d=null)}function x(){c==="pending"&&(c="aborted"),b(),p.forEach(h=>{h.status==="pending"&&(h.status="aborted")}),p=[]}function T(h,S){S&&(m=[]),typeof h=="function"&&m.push(h)}function j(){return{startTime:a,payload:n,status:c,queriesSent:l,queriesPending:p.length,subscribe:T,abort:x}}function I(){c="failed",m.forEach(h=>{h(void 0,u)})}function y(){p.forEach(h=>{h.status==="pending"&&(h.status="aborted")}),p=[]}function B(h,S,k){const w=S!=="success";switch(p=p.filter(C=>C!==h),c){case"pending":break;case"failed":if(w||!e.dataAfterTimeout)return;break;default:return}if(S==="abort"){u=k,I();return}if(w){u=k,p.length||(i.length?v():I());return}if(b(),y(),!e.random){const C=e.resources.indexOf(h.resource);C!==-1&&C!==e.index&&(e.index=C)}c="completed",m.forEach(C=>{C(k)})}function v(){if(c!=="pending")return;b();const h=i.shift();if(h===void 0){if(p.length){d=setTimeout(()=>{b(),c==="pending"&&(y(),I())},e.timeout);return}I();return}const S={status:"pending",resource:h,callback:(k,w)=>{B(S,k,w)}};p.push(S),l++,d=setTimeout(v,e.rotate),t(h,n,S.callback)}return setTimeout(v),j}function We(e){const n={...tn,...e};let t=[];function r(){t=t.filter(a=>a().status==="pending")}function o(a,c,l){const u=nn(n,a,c,(d,p)=>{r(),l&&l(d,p)});return t.push(u),u}function s(a){return t.find(c=>a(c))||null}return{query:o,find:s,setIndex:a=>{n.index=a},getIndex:()=>n.index,cleanup:r}}function fe(e){let n;if(typeof e.resources=="string")n=[e.resources];else if(n=e.resources,!(n instanceof Array)||!n.length)return null;return{resources:n,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const G=Object.create(null),E=["https://api.simplesvg.com","https://api.unisvg.com"],Q=[];for(;E.length>0;)E.length===1||Math.random()>.5?Q.push(E.shift()):Q.push(E.pop());G[""]=fe({resources:["https://api.iconify.design"].concat(Q)});function Se(e,n){const t=fe(n);return t===null?!1:(G[e]=t,!0)}function J(e){return G[e]}function on(){return Object.keys(G)}function ve(){}const Y=Object.create(null);function rn(e){if(!Y[e]){const n=J(e);if(!n)return;const t=We(n),r={config:n,redundancy:t};Y[e]=r}return Y[e]}function Ze(e,n,t){let r,o;if(typeof e=="string"){const s=oe(e);if(!s)return t(void 0,424),ve;o=s.send;const i=rn(e);i&&(r=i.redundancy)}else{const s=fe(e);if(s){r=We(s);const i=e.resources?e.resources[0]:"",a=oe(i);a&&(o=a.send)}}return!r||!o?(t(void 0,424),ve):r.query(n,o,t)().abort}const Te="iconify2",N="iconify",Ge=N+"-count",Ce=N+"-version",Je=36e5,sn=168;function re(e,n){try{return e.getItem(n)}catch{}}function de(e,n,t){try{return e.setItem(n,t),!0}catch{}}function Ae(e,n){try{e.removeItem(n)}catch{}}function se(e,n){return de(e,Ge,n.toString())}function ie(e){return parseInt(re(e,Ge))||0}const M={local:!0,session:!0},Xe={local:new Set,session:new Set};let he=!1;function cn(e){he=e}let $=typeof window>"u"?{}:window;function Ye(e){const n=e+"Storage";try{if($&&$[n]&&typeof $[n].length=="number")return $[n]}catch{}M[e]=!1}function Ke(e,n){const t=Ye(e);if(!t)return;const r=re(t,Ce);if(r!==Te){if(r){const a=ie(t);for(let c=0;c<a;c++)Ae(t,N+c.toString())}de(t,Ce,Te),se(t,0);return}const o=Math.floor(Date.now()/Je)-sn,s=a=>{const c=N+a.toString(),l=re(t,c);if(typeof l=="string"){try{const u=JSON.parse(l);if(typeof u=="object"&&typeof u.cached=="number"&&u.cached>o&&typeof u.provider=="string"&&typeof u.data=="object"&&typeof u.data.prefix=="string"&&n(u,a))return!0}catch{}Ae(t,c)}};let i=ie(t);for(let a=i-1;a>=0;a--)s(a)||(a===i-1?(i--,se(t,i)):Xe[e].add(a))}function et(){if(!he){cn(!0);for(const e in M)Ke(e,n=>{const t=n.data,r=n.provider,o=t.prefix,s=L(r,o);if(!ue(s,t).length)return!1;const i=t.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,i):i,!0})}}function an(e,n){const t=e.lastModifiedCached;if(t&&t>=n)return t===n;if(e.lastModifiedCached=n,t)for(const r in M)Ke(r,o=>{const s=o.data;return o.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===n});return!0}function ln(e,n){he||et();function t(r){let o;if(!M[r]||!(o=Ye(r)))return;const s=Xe[r];let i;if(s.size)s.delete(i=Array.from(s).shift());else if(i=ie(o),!se(o,i+1))return;const a={cached:Math.floor(Date.now()/Je),provider:e.provider,data:n};return de(o,N+i.toString(),JSON.stringify(a))}n.lastModified&&!an(e,n.lastModified)||Object.keys(n.icons).length&&(n.not_found&&(n=Object.assign({},n),delete n.not_found),t("local")||t("session"))}function je(){}function un(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Xt(e)}))}function fn(e,n){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(n).sort():e.iconsToLoad=n,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:t,prefix:r}=e,o=e.iconsToLoad;delete e.iconsToLoad;let s;if(!o||!(s=oe(t)))return;s.prepare(t,r,o).forEach(a=>{Ze(t,a,c=>{if(typeof c!="object")a.icons.forEach(l=>{e.missing.add(l)});else try{const l=ue(e,c);if(!l.length)return;const u=e.pendingIcons;u&&l.forEach(d=>{u.delete(d)}),ln(e,c)}catch(l){console.error(l)}un(e)})})}))}const pe=(e,n)=>{const t=en(e,!0,Ue()),r=Jt(t);if(!r.pending.length){let c=!0;return n&&setTimeout(()=>{c&&n(r.loaded,r.missing,r.pending,je)}),()=>{c=!1}}const o=Object.create(null),s=[];let i,a;return r.pending.forEach(c=>{const{provider:l,prefix:u}=c;if(u===a&&l===i)return;i=l,a=u,s.push(L(l,u));const d=o[l]||(o[l]=Object.create(null));d[u]||(d[u]=[])}),r.pending.forEach(c=>{const{provider:l,prefix:u,name:d}=c,p=L(l,u),m=p.pendingIcons||(p.pendingIcons=new Set);m.has(d)||(m.add(d),o[l][u].push(d))}),s.forEach(c=>{const{provider:l,prefix:u}=c;o[l][u].length&&fn(c,o[l][u])}),n?Kt(n,r,s):je},dn=e=>new Promise((n,t)=>{const r=typeof e=="string"?H(e,!0):e;if(!r){t(e);return}pe([r||e],o=>{if(o.length&&r){const s=q(r);if(s){n({...F,...s});return}}t(e)})});function hn(e){try{const n=typeof e=="string"?JSON.parse(e):e;if(typeof n.body=="string")return{...n}}catch{}}function pn(e,n){const t=typeof e=="string"?H(e,!0,!0):null;if(!t){const s=hn(e);return{value:e,data:s}}const r=q(t);if(r!==void 0||!t.prefix)return{value:e,name:t,data:r};const o=pe([t],()=>n(e,t,q(t)));return{value:e,name:t,loading:o}}function K(e){return e.hasAttribute("inline")}let tt=!1;try{tt=navigator.vendor.indexOf("Apple")===0}catch{}function gn(e,n){switch(n){case"svg":case"bg":case"mask":return n}return n!=="style"&&(tt||e.indexOf("<a")===-1)?"svg":e.indexOf("currentColor")===-1?"bg":"mask"}const mn=/(-?[0-9.]*[0-9]+[0-9.]*)/g,yn=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function ce(e,n,t){if(n===1)return e;if(t=t||100,typeof e=="number")return Math.ceil(e*n*t)/t;if(typeof e!="string")return e;const r=e.split(mn);if(r===null||!r.length)return e;const o=[];let s=r.shift(),i=yn.test(s);for(;;){if(i){const a=parseFloat(s);isNaN(a)?o.push(s):o.push(Math.ceil(a*n*t)/t)}else o.push(s);if(s=r.shift(),s===void 0)return o.join("");i=!i}}const bn=e=>e==="unset"||e==="undefined"||e==="none";function nt(e,n){const t={...F,...e},r={...ze,...n},o={left:t.left,top:t.top,width:t.width,height:t.height};let s=t.body;[t,r].forEach(b=>{const x=[],T=b.hFlip,j=b.vFlip;let I=b.rotate;T?j?I+=2:(x.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),x.push("scale(-1 1)"),o.top=o.left=0):j&&(x.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),x.push("scale(1 -1)"),o.top=o.left=0);let y;switch(I<0&&(I-=Math.floor(I/4)*4),I=I%4,I){case 1:y=o.height/2+o.top,x.unshift("rotate(90 "+y.toString()+" "+y.toString()+")");break;case 2:x.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:y=o.width/2+o.left,x.unshift("rotate(-90 "+y.toString()+" "+y.toString()+")");break}I%2===1&&(o.left!==o.top&&(y=o.left,o.left=o.top,o.top=y),o.width!==o.height&&(y=o.width,o.width=o.height,o.height=y)),x.length&&(s='<g transform="'+x.join(" ")+'">'+s+"</g>")});const i=r.width,a=r.height,c=o.width,l=o.height;let u,d;i===null?(d=a===null?"1em":a==="auto"?l:a,u=ce(d,c/l)):(u=i==="auto"?c:i,d=a===null?ce(u,l/c):a==="auto"?l:a);const p={},m=(b,x)=>{bn(x)||(p[b]=x.toString())};return m("width",u),m("height",d),p.viewBox=o.left.toString()+" "+o.top.toString()+" "+c.toString()+" "+l.toString(),{attributes:p,body:s}}const xn=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let Z=xn();function wn(e){Z=e}function In(){return Z}function Sn(e,n){const t=J(e);if(!t)return 0;let r;if(!t.maxURL)r=0;else{let o=0;t.resources.forEach(i=>{o=Math.max(o,i.length)});const s=n+".json?icons=";r=t.maxURL-o-t.path.length-s.length}return r}function vn(e){return e===404}const Tn=(e,n,t)=>{const r=[],o=Sn(e,n),s="icons";let i={type:s,provider:e,prefix:n,icons:[]},a=0;return t.forEach((c,l)=>{a+=c.length+1,a>=o&&l>0&&(r.push(i),i={type:s,provider:e,prefix:n,icons:[]},a=c.length),i.icons.push(c)}),r.push(i),r};function Cn(e){if(typeof e=="string"){const n=J(e);if(n)return n.path}return"/"}const An=(e,n,t)=>{if(!Z){t("abort",424);return}let r=Cn(n.provider);switch(n.type){case"icons":{const s=n.prefix,a=n.icons.join(","),c=new URLSearchParams({icons:a});r+=s+".json?"+c.toString();break}case"custom":{const s=n.uri;r+=s.slice(0,1)==="/"?s.slice(1):s;break}default:t("abort",400);return}let o=503;Z(e+r).then(s=>{const i=s.status;if(i!==200){setTimeout(()=>{t(vn(i)?"abort":"next",i)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?t("abort",s):t("next",o)});return}setTimeout(()=>{t("success",s)})}).catch(()=>{t("next",o)})},jn={prepare:Tn,send:An};function Pe(e,n){switch(e){case"local":case"session":M[e]=n;break;case"all":for(const t in M)M[t]=n;break}}const ee="data-style";let ot="";function Pn(e){ot=e}function ke(e,n){let t=Array.from(e.childNodes).find(r=>r.hasAttribute&&r.hasAttribute(ee));t||(t=document.createElement("style"),t.setAttribute(ee,ee),e.appendChild(t)),t.textContent=":host{display:inline-block;vertical-align:"+(n?"-0.125em":"0")+"}span,svg{display:block}"+ot}function rt(){Ie("",jn),Ue(!0);let e;try{e=window}catch{}if(e){if(et(),e.IconifyPreload!==void 0){const t=e.IconifyPreload,r="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!we(o))&&console.error(r)}catch{console.error(r)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(const r in t){const o="IconifyProviders["+r+"] is invalid.";try{const s=t[r];if(typeof s!="object"||!s||s.resources===void 0)continue;Se(r,s)||console.error(o)}catch{console.error(o)}}}}return{enableCache:t=>Pe(t,!0),disableCache:t=>Pe(t,!1),iconExists:Zt,getIcon:Gt,listIcons:Wt,addIcon:Qe,addCollection:we,calculateSize:ce,buildIcon:nt,loadIcons:pe,loadIcon:dn,addAPIProvider:Se,appendCustomStyle:Pn,_api:{getAPIConfig:J,setAPIModule:Ie,sendAPIQuery:Ze,setFetch:wn,getFetch:In,listAPIProviders:on}}}function st(e,n){let t=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const r in n)t+=" "+r+'="'+n[r]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+t+">"+e+"</svg>"}function kn(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}function Ln(e){return"data:image/svg+xml,"+kn(e)}function Mn(e){return'url("'+Ln(e)+'")'}const ae={"background-color":"currentColor"},it={"background-color":"transparent"},Le={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Me={"-webkit-mask":ae,mask:ae,background:it};for(const e in Me){const n=Me[e];for(const t in Le)n[e+"-"+t]=Le[t]}function Ee(e){return e?e+(e.match(/^[-0-9.]+$/)?"px":""):"inherit"}function En(e,n,t){const r=document.createElement("span");let o=e.body;o.indexOf("<a")!==-1&&(o+="<!-- "+Date.now()+" -->");const s=e.attributes,i=st(o,{...s,width:n.width+"",height:n.height+""}),a=Mn(i),c=r.style,l={"--svg":a,width:Ee(s.width),height:Ee(s.height),...t?ae:it};for(const u in l)c.setProperty(u,l[u]);return r}let R;function On(){try{R=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{R=null}}function Rn(e){return R===void 0&&On(),R?R.createHTML(e):e}function _n(e){const n=document.createElement("span"),t=e.attributes;let r="";t.width||(r="width: inherit;"),t.height||(r+="height: inherit;"),r&&(t.style=r);const o=st(e.body,t);return n.innerHTML=Rn(o),n.firstChild}function Oe(e,n){const t=n.icon.data,r=n.customisations,o=nt(t,r);r.preserveAspectRatio&&(o.attributes.preserveAspectRatio=r.preserveAspectRatio);const s=n.renderedMode;let i;switch(s){case"svg":i=_n(o);break;default:i=En(o,{...F,...t},s==="mask")}const a=Array.from(e.childNodes).find(c=>{const l=c.tagName&&c.tagName.toUpperCase();return l==="SPAN"||l==="SVG"});a?i.tagName==="SPAN"&&a.tagName===i.tagName?a.setAttribute("style",i.getAttribute("style")):e.replaceChild(i,a):e.appendChild(i)}function Re(e,n,t){const r=t&&(t.rendered?t:t.lastRender);return{rendered:!1,inline:n,icon:e,lastRender:r}}function qn(e="iconify-icon"){let n,t;try{n=window.customElements,t=window.HTMLElement}catch{return}if(!n||!t)return;const r=n.get(e);if(r)return r;const o=["icon","mode","inline","width","height","rotate","flip"],s=class extends t{constructor(){super();D(this,"_shadowRoot");D(this,"_state");D(this,"_checkQueued",!1);const c=this._shadowRoot=this.attachShadow({mode:"open"}),l=K(this);ke(c,l),this._state=Re({value:""},l),this._queueCheck()}static get observedAttributes(){return o.slice(0)}attributeChangedCallback(c){if(c==="inline"){const l=K(this),u=this._state;l!==u.inline&&(u.inline=l,ke(this._shadowRoot,l))}else this._queueCheck()}get icon(){const c=this.getAttribute("icon");if(c&&c.slice(0,1)==="{")try{return JSON.parse(c)}catch{}return c}set icon(c){typeof c=="object"&&(c=JSON.stringify(c)),this.setAttribute("icon",c)}get inline(){return K(this)}set inline(c){c?this.setAttribute("inline","true"):this.removeAttribute("inline")}restartAnimation(){const c=this._state;if(c.rendered){const l=this._shadowRoot;if(c.renderedMode==="svg")try{l.lastChild.setCurrentTime(0);return}catch{}Oe(l,c)}}get status(){const c=this._state;return c.rendered?"rendered":c.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const c=this._state,l=this.getAttribute("icon");if(l!==c.icon.value){this._iconChanged(l);return}if(!c.rendered)return;const u=this.getAttribute("mode"),d=be(this);(c.attrMode!==u||zt(c.customisations,d))&&this._renderIcon(c.icon,d,u)}_iconChanged(c){const l=pn(c,(u,d,p)=>{const m=this._state;if(m.rendered||this.getAttribute("icon")!==u)return;const b={value:u,name:d,data:p};b.data?this._gotIconData(b):m.icon=b});l.data?this._gotIconData(l):this._state=Re(l,this._state.inline,this._state)}_gotIconData(c){this._checkQueued=!1,this._renderIcon(c,be(this),this.getAttribute("mode"))}_renderIcon(c,l,u){const d=gn(c.data.body,u),p=this._state.inline;Oe(this._shadowRoot,this._state={rendered:!0,icon:c,inline:p,customisations:l,attrMode:u,renderedMode:d})}};o.forEach(a=>{a in s.prototype||Object.defineProperty(s.prototype,a,{get:function(){return this.getAttribute(a)},set:function(c){c!==null?this.setAttribute(a,c):this.removeAttribute(a)}})});const i=rt();for(const a in i)s[a]=s.prototype[a]=i[a];return n.define(e,s),s}qn()||rt();const Nn=f.shape({appLogo:f.node,appName:f.string,theme:f.shape({background:f.string}),enableConnect:f.bool,enableLocale:f.bool,navigation:f.arrayOf(f.shape({title:f.oneOfType([f.string,f.object]),link:f.oneOfType([f.string,f.object]),icon:f.string,items:f.arrayOf(f.shape({title:f.oneOfType([f.string,f.object]),link:f.oneOfType([f.string,f.object])}))}))}),ct=f.shape({showText:f.bool,showRole:f.bool,switchDid:f.bool,switchProfile:f.bool,switchPassport:f.bool,disableLogout:f.bool,onLogin:f.func,onLogout:f.func,onSwitchDid:f.func,onSwitchProfile:f.func,onSwitchPassport:f.func,menu:f.array,menuRender:f.func,dark:f.bool,size:f.number}),z=(e,n,t="children")=>e.map(r=>Array.isArray(r[t])?n({...r,[t]:z(r[t],n,t)}):n(r)),Fn=(e,n="children")=>{const t=[];return z(e,r=>t.push(r),n),t},ge=(e,n,t="children")=>e.map(r=>({...r})).filter(r=>{const o=r[t];if(Array.isArray(o)){const i=ge(o,n,t);r[t]=i!=null&&i.length?i:void 0}const s={filteredChildren:r[t],isLeaf:!(o!=null&&o.length)};return n(r,s)}),Hn=e=>/^https?:\/\//.test(e),zn=e=>{if(!e||!(e!=null&&e.startsWith("/")))return!1;const n=o=>o.endsWith("/")?o:`${o}/`,t=n(window.location.pathname),r=n(new URL(e,window.location.origin).pathname);return t.startsWith(r)},Bn=(e=[])=>{const n=e.map((r,o)=>({path:r,index:o})).filter(r=>zn(r.path));return n!=null&&n.length?n.slice(1).reduce((r,o)=>r.path.length>=o.path.length?r:o,n[0]).index:-1};var _e,qe;const le=((_e=window==null?void 0:window.blocklet)==null?void 0:_e.groupPrefix)||((qe=window==null?void 0:window.blocklet)==null?void 0:qe.prefix)||"/",Dn=e=>{const n={...e},t=e==null?void 0:e.background;return typeof t=="string"?n.background={header:t,footer:t,default:t}:t&&typeof t=="object"&&(n.background={header:t.header||t.default,footer:t.footer||t.default,default:t.default}),n},at=(e,n="en")=>{if(!(e!=null&&e.length))return e;const t=(o,s)=>typeof o=="string"?o:typeof o=="object"?o[s]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o,r=(o,s)=>{if(typeof o=="string"){if(Hn(o)){const a=new URL(o);return a.searchParams.set("locale",s),a.href}const i=new URL(o,window.location.origin);return i.searchParams.set("locale",s),i.pathname+i.search}return typeof o=="object"?o[s]||(o==null?void 0:o.en)||(o==null?void 0:o.zh):o};return z(e,o=>{var s;return{...o,title:t(o.title,n),link:(s=o.items)!=null&&s.length?o.link:r(o.link,n),_rawLink:o.link}},"items")},$n=e=>z(e,n=>n.role?{...n,role:Array.isArray(n.role)?n.role:[n.role]}:n,"items"),Un=e=>{if(!(e!=null&&e.length))return null;const n=$n(e),t={header:[],footer:[],social:[],bottom:[],dashboard:[],sessionManager:[],userCenter:[]};return n.forEach(r=>{var o;r.section?Array.isArray(r.section)?r.section.forEach(s=>{var i;(i=t[s])==null||i.push(r)}):typeof r.section=="string"&&((o=t[r.section])==null||o.push(r)):t.header.push(r)}),t},Qn=e=>{if(!e)return null;const n={...e};return n.theme=Dn(n.theme),n.navigation=Un(Vn(n.navigation)),n},Vn=(e=[])=>ge(e,(n,t)=>{var r;return!!n.link||((r=t.filteredChildren)==null?void 0:r.length)},"items"),lt=(e,n)=>ge(e,(t,r)=>{var s;const o=!t.role||n&&(t.role.includes(n)||t.role.includes("guest"));return r.isLeaf?o:o&&((s=r.filteredChildren)==null?void 0:s.length)},"items"),Wn={top:-960,width:960,height:960,body:'<path fill="currentColor" d="M510-600v-210q0-12.75 8.625-21.375T540-840h270q12.75 0 21.375 8.625T840-810v210q0 12.75-8.625 21.375T810-570H540q-12.75 0-21.375-8.625T510-600M120-480v-330q0-12.75 8.625-21.375T150-840h270q12.75 0 21.375 8.625T450-810v330q0 12.75-8.625 21.375T420-450H150q-12.75 0-21.375-8.625T120-480m390 330v-330q0-12.75 8.625-21.375T540-510h270q12.75 0 21.375 8.625T840-480v330q0 12.75-8.625 21.375T810-120H540q-12.75 0-21.375-8.625T510-150m-390 0v-210q0-12.75 8.625-21.375T150-390h270q12.75 0 21.375 8.625T450-360v210q0 12.75-8.625 21.375T420-120H150q-12.75 0-21.375-8.625T120-150m60-360h210v-270H180zm390 330h210v-270H570zm0-450h210v-150H570zM180-180h210v-150H180zm210-150"/>'},Zn={width:24,height:24,body:'<path fill="currentColor" d="M15.95 12.3L11.7 8.05q-.15-.15-.212-.325t-.063-.375q0-.2.063-.375t.212-.325l4.25-4.25q.15-.15.325-.212t.375-.063q.2 0 .375.063t.325.212l4.25 4.25q.15.15.213.325t.062.375q0 .2-.063.375t-.212.325l-4.25 4.25q-.15.15-.325.213t-.375.062q-.2 0-.375-.062t-.325-.213ZM3 10V4q0-.425.288-.713T4 3h6q.425 0 .713.288T11 4v6q0 .425-.288.713T10 11H4q-.425 0-.713-.288T3 10Zm10 10v-6q0-.425.288-.713T14 13h6q.425 0 .713.288T21 14v6q0 .425-.288.713T20 21h-6q-.425 0-.713-.288T13 20ZM3 20v-6q0-.425.288-.713T4 13h6q.425 0 .713.288T11 14v6q0 .425-.288.713T10 21H4q-.425 0-.713-.288T3 20ZM5 9h4V5H5v4Zm11.675 1.2L19.5 7.375L16.675 4.55L13.85 7.375l2.825 2.825ZM15 19h4v-4h-4v4ZM5 19h4v-4H5v4ZM9 9Zm4.85-1.625ZM9 15Zm6 0Z"/>'};function Gn({session:e,locale:n="zh",size:t=24}){const r=(window==null?void 0:window.blocklet)||{},o=(r.navigation||[]).filter(c=>c.section==="sessionManager"&&!["/sessionManager"].includes(c.id)).filter(c=>{var l;return!!((c==null?void 0:c.role)||[]).includes(((l=e==null?void 0:e.user)==null?void 0:l.role)||"guest")}).map(c=>{const l=((r==null?void 0:r.componentMountPoints)||[]).find(u=>c.component===u.name);return{...c,component:l}}),s=P.useRef(null),i=ht({open:!1}),a=pt((c=!i.open)=>{i.open=c});return o.length===0||!(e!=null&&e.user)?null:g.jsxs(g.Fragment,{children:[g.jsx(gt,{size:"medium",ref:s,onClick:()=>a(),children:g.jsx(ye,{icon:Wn,fontSize:t,style:{transform:"scale(1.08)"}})}),g.jsx(mt,{open:i.open,anchorEl:s.current,transition:!0,placement:"bottom-end",sx:{zIndex:1600},children:({TransitionProps:c})=>g.jsx(yt,{onClickAway:l=>{l.preventDefault(),l.stopPropagation(),a(!1)},children:g.jsx(bt,{...c,timeout:350,children:g.jsxs(xt,{variant:"outlined",sx:{borderRadius:3,width:350,maxWidth:"90vw",borderColor:A.lineStep,p:2,border:"0 !important",boxShadow:`0px 8px 16px 0px ${A.gray6}, 0px 0px 0px 1px ${A.gray6}`},children:[g.jsx(wt,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, 100px)",gridAutoRows:"minmax(100px, max-content)",justifyContent:"space-between",maxHeight:350,overflowY:"auto",p:0},children:o.map(l=>{var u;return g.jsx(Ot,{disablePadding:!0,children:g.jsxs(Rt,{href:l.link,sx:{p:1,display:"flex",flexDirection:"column",alignItems:"center",gap:1,width:"100%",height:"100%",borderRadius:2,"&:hover":{backgroundColor:A.surfacePrimarySubtitle}},children:[(u=l==null?void 0:l.component)!=null&&u.did?g.jsx(It,{component:"img",src:`${St}/blocklet/logo-bundle/${l.component.did}`,sx:{borderRadius:2,width:50,height:50,objectFit:"contain"},alt:"SessionBlocklet component icon"}):g.jsx(ye,{fontSize:50,icon:l.icon||Zn,color:A.textSubtitle}),g.jsx(vt,{sx:{fontSize:"12px",color:A.textBase,textAlign:"center",lineHeight:"normal"},children:Tt(l.title,n)})]})},l.id)})}),g.jsx(Ct,{session:e,children:g.jsx(At,{variant:"outlined",fullWidth:!0,href:jt,sx:{mt:1,borderRadius:2,color:A.textBase,borderColor:A.lineBorderStrong,"&:hover":{color:A.primaryBase,borderColor:A.primaryBase}},children:n==="zh"?"管理":"Manage"})})]})})})})]})}function me({formattedBlocklet:e,addons:n,sessionManagerProps:t}){var p,m,b,x;const r=P.useContext(Ne),{locale:o}=Fe()||{},{enableConnect:s=!0,enableLocale:i=!0}=e,a=!!((p=r==null?void 0:r.session)!=null&&p.user);let c=at((m=e==null?void 0:e.navigation)==null?void 0:m.sessionManager,o)||[];c=lt(c,(x=(b=r==null?void 0:r.session)==null?void 0:b.user)==null?void 0:x.role);const u=(()=>{if(n&&typeof n!="function")return Array.isArray(n)?n:[n];let T=[];if(i&&o&&T.push(g.jsx(_t,{showText:!1},"locale-selector")),s&&r){const j=[];a&&(c?c.slice(0,5):[]).forEach(y=>{j.push({label:y.title,icon:y.icon?g.jsx("iconify-icon",{icon:y.icon,height:24,style:{marginRight:8}}):null,component:"a",href:y.link,key:y.link})}),T.push(g.jsx(Gn,{session:r.session,locale:o},"session-blocklet")),T.push(g.jsx(Pt,{session:r.session,locale:o,menu:j,showRole:!0,...t},"session-user"))}return typeof n=="function"&&(T=n(T)||[]),T})();return P.createElement(g.Fragment,null,...Array.isArray(u)?u:[u])}me.propTypes={formattedBlocklet:f.object.isRequired,addons:f.oneOfType([f.func,f.node]),sessionManagerProps:ct};me.defaultProps={addons:null,sessionManagerProps:{showRole:!0}};const Jn=()=>{const e=kt();P.useEffect(()=>{e.wallet&&Lt.call("arcHideTopBar","{}")},[e])};function ut({meta:e,fallbackUrl:n,invalidPathFallback:t,headerAddons:r,sessionManagerProps:o,links:s,...i}){var B;Jn();const a=P.useContext(Ne),c=(B=a==null?void 0:a.session)==null?void 0:B.user,l=c==null?void 0:c.role,{locale:u}=Fe()||{},d=P.useMemo(()=>{const v=Object.assign({},window.blocklet,e);try{return Qn(v)}catch(h){return console.error("Failed to format blocklet info",h,v),v}},[e]),{localizedNav:p,flattened:m,matchedIndex:b}=P.useMemo(()=>{var k;let v=at((k=d==null?void 0:d.navigation)==null?void 0:k.dashboard,u)||[];v=lt(v,l),v=z(v,w=>{let C=null;return w.icon&&(w.icon.startsWith("http")||w.icon.startsWith("data:")?C=g.jsx(Mt,{src:w.icon}):C=g.jsx("iconify-icon",{height:"100%",width:"100%",icon:w.icon})),{title:w.title,url:w.link,icon:C,external:!0,children:w.items}},"items");const h=Fn(v).filter(w=>!!w.url),S=Bn(h.map(w=>w.url));return S!==-1&&(h[S].active=!0),{localizedNav:v,flattened:h,matchedIndex:S}},[d,u,l]),x=typeof s=="function"?s(p):[...p,...s];if(P.useLayoutEffect(()=>{c&&!(m!=null&&m.length)&&n&&(window.location.href=n)},[n]),P.useLayoutEffect(()=>{c&&(m!=null&&m.length)&&b===-1&&t&&t()},[t,m,b]),!d.appName)return null;const{appLogo:T,appLogoRect:j,appName:I}=d,y=g.jsx(me,{formattedBlocklet:d,addons:r,sessionManagerProps:o});return g.jsx(Et,{title:I,fullWidth:!0,sidebarWidth:128,legacy:!1,links:x,...i,headerProps:{homeLink:le,logo:g.jsx("img",{src:j||T,alt:"logo"}),addons:y,...i.headerProps}})}ut.propTypes={meta:Nn,fallbackUrl:f.string,invalidPathFallback:f.func,headerAddons:f.oneOfType([f.func,f.node]),sessionManagerProps:ct,links:f.oneOfType([f.array,f.func])};ut.defaultProps={meta:{},fallbackUrl:le,invalidPathFallback:null,headerAddons:void 0,sessionManagerProps:{showRole:!0,onLogout:()=>{window.location.href=le}},links:[]};export{Nn as B,ut as D,me as H,Fn as a,Bn as b,Qn as f,at as g,Hn as i,z as m,le as p,Jn as u};
@@ -1,5 +1,5 @@
1
- import{fK as w,b9 as b}from"./index-BxKrUgd9.js";var x=(n,t=1,e)=>{if(e={indent:" ",includeEmptyLines:!1,...e},typeof n!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof n}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof e.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof e.indent}\``);if(t===0)return n;const r=e.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return n.replace(r,e.indent.repeat(t))};const m=w,E=/\s+at.*(?:\(|\s)(.*)\)?/,$=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,j=typeof m.homedir>"u"?"":m.homedir();var v=(n,t)=>(t=Object.assign({pretty:!1},t),n.replace(/\\/g,"/").split(`
1
+ import{fL as w,bc as b}from"./index-Cu_bNPbk.js";var x=(n,t=1,e)=>{if(e={indent:" ",includeEmptyLines:!1,...e},typeof n!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof n}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof e.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof e.indent}\``);if(t===0)return n;const r=e.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return n.replace(r,e.indent.repeat(t))};const m=w,E=/\s+at.*(?:\(|\s)(.*)\)?/,$=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,j=typeof m.homedir>"u"?"":m.homedir();var v=(n,t)=>(t=Object.assign({pretty:!1},t),n.replace(/\\/g,"/").split(`
2
2
  `).filter(e=>{const r=e.match(E);if(r===null||!r[1])return!0;const a=r[1];return a.includes(".app/Contents/Resources/electron.asar")||a.includes(".app/Contents/Resources/default_app.asar")?!1:!$.test(a)}).filter(e=>e.trim()!=="").map(e=>t.pretty?e.replace(E,(r,a)=>r.replace(a,a.replace(j,"~"))):e).join(`
3
3
  `));const A=x,S=v,I=n=>n.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,"");let k=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);t=[...t].map(r=>r instanceof Error?r:r!==null&&typeof r=="object"?Object.assign(new Error(r.message),r):new Error(r));let e=t.map(r=>typeof r.stack=="string"?I(S(r.stack)):String(r)).join(`
4
4
  `);e=`
5
- `+A(e,4),super(e),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:t})}*[Symbol.iterator](){for(const t of this._errors)yield t}};var T=k;const R=T;var C=async(n,t,{concurrency:e=1/0,stopOnError:r=!0}={})=>new Promise((a,f)=>{if(typeof t!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(e)||e===1/0)&&e>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${e}\` (${typeof e})`);const c=[],l=[],h=n[Symbol.iterator]();let g=!1,u=!1,s=0,d=0;const p=()=>{if(g)return;const o=h.next(),y=d;if(d++,o.done){u=!0,s===0&&(!r&&l.length!==0?f(new R(l)):a(c));return}s++,(async()=>{try{const i=await o.value;c[y]=await t(i,y),s--,p()}catch(i){r?(g=!0,f(i)):(l.push(i),s--,p())}})()};for(let o=0;o<e&&(p(),!u);o++);});const M=C;var _=(n,t)=>M(n,e=>e(),t);const L=b(_);export{L as p};
5
+ `+A(e,4),super(e),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:t})}*[Symbol.iterator](){for(const t of this._errors)yield t}};var T=k;const R=T;var C=async(n,t,{concurrency:e=1/0,stopOnError:r=!0}={})=>new Promise((a,f)=>{if(typeof t!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(e)||e===1/0)&&e>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${e}\` (${typeof e})`);const c=[],l=[],h=n[Symbol.iterator]();let g=!1,u=!1,s=0,d=0;const p=()=>{if(g)return;const o=h.next(),y=d;if(d++,o.done){u=!0,s===0&&(!r&&l.length!==0?f(new R(l)):a(c));return}s++,(async()=>{try{const i=await o.value;c[y]=await t(i,y),s--,p()}catch(i){r?(g=!0,f(i)):(l.push(i),s--,p())}})()};for(let o=0;o<e&&(p(),!u);o++);});const M=C;var _=(n,t)=>M(n,e=>e(),t);const P=b(_);export{P as p};