@undefineds.co/xpod 0.4.3 → 0.4.5

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 (223) hide show
  1. package/config/cloud.json +1 -1
  2. package/config/main.json +36 -2
  3. package/dist/api/ai-gateway/auth/GatewayApiKeyAuthenticator.d.ts +3 -0
  4. package/dist/api/ai-gateway/auth/GatewayApiKeyAuthenticator.js +1 -1
  5. package/dist/api/ai-gateway/auth/PodGatewayAccessKeyRepository.d.ts +2 -1
  6. package/dist/api/ai-gateway/auth/PodGatewayAccessKeyRepository.js +101 -32
  7. package/dist/api/ai-gateway/connect/DeviceCodeProtocol.d.ts +80 -0
  8. package/dist/api/ai-gateway/connect/DeviceCodeProtocol.js +3 -0
  9. package/dist/api/ai-gateway/connect/FileSessionImportAdapter.d.ts +38 -0
  10. package/dist/api/ai-gateway/connect/FileSessionImportAdapter.js +63 -0
  11. package/dist/api/ai-gateway/connect/LoopbackAuthorizationCallbackReceiver.d.ts +24 -0
  12. package/dist/api/ai-gateway/connect/LoopbackAuthorizationCallbackReceiver.js +136 -0
  13. package/dist/api/ai-gateway/connect/OAuthConnectAdapter.d.ts +2 -0
  14. package/dist/api/ai-gateway/connect/OAuthConnectAdapter.js +2 -1
  15. package/dist/api/ai-gateway/connect/OAuthIntegrationRegistry.d.ts +17 -13
  16. package/dist/api/ai-gateway/connect/OAuthIntegrationRegistry.js +52 -19
  17. package/dist/api/ai-gateway/connect/OpenAiSubscriptionSessionImportAdapter.d.ts +4 -28
  18. package/dist/api/ai-gateway/connect/OpenAiSubscriptionSessionImportAdapter.js +7 -58
  19. package/dist/api/ai-gateway/connect/ProviderAuthorizationProfiles.d.ts +4 -0
  20. package/dist/api/ai-gateway/connect/ProviderAuthorizationProfiles.js +116 -0
  21. package/dist/api/ai-gateway/connect/SessionImportProfiles.d.ts +10 -0
  22. package/dist/api/ai-gateway/connect/SessionImportProfiles.js +112 -0
  23. package/dist/api/ai-gateway/connect/index.d.ts +125 -23
  24. package/dist/api/ai-gateway/connect/index.js +1277 -260
  25. package/dist/api/ai-gateway/models/PodModelSelectionRepository.d.ts +4 -1
  26. package/dist/api/ai-gateway/models/PodModelSelectionRepository.js +154 -19
  27. package/dist/api/ai-gateway/providers/DeepSeekRuntimeAdapter.js +10 -6
  28. package/dist/api/ai-gateway/providers/ModelsDevCatalog.d.ts +7 -0
  29. package/dist/api/ai-gateway/providers/ModelsDevCatalog.js +25 -1
  30. package/dist/api/ai-gateway/providers/OfferingAuthorization.d.ts +24 -0
  31. package/dist/api/ai-gateway/providers/OfferingAuthorization.js +37 -0
  32. package/dist/api/ai-gateway/providers/OpenAiRuntimeAdapter.d.ts +1 -1
  33. package/dist/api/ai-gateway/providers/OpenAiRuntimeAdapter.js +5 -3
  34. package/dist/api/ai-gateway/providers/ProviderRegistry.d.ts +6 -3
  35. package/dist/api/ai-gateway/providers/ProviderRegistry.js +55 -16
  36. package/dist/api/ai-gateway/providers/ProviderRuntimeAdapter.d.ts +2 -0
  37. package/dist/api/ai-gateway/providers/ProviderRuntimeAdapter.js +37 -4
  38. package/dist/api/ai-gateway/providers/ProviderRuntimeRegistry.js +7 -0
  39. package/dist/api/ai-gateway/quota/SubscriptionQuotaAdapters.js +2 -1
  40. package/dist/api/ai-gateway/routing/ModelRouter.js +3 -1
  41. package/dist/api/container/common.js +30 -40
  42. package/dist/api/container/index.js +6 -2
  43. package/dist/api/container/routes.js +5 -22
  44. package/dist/api/handlers/AiClientConfigurationHandler.js +39 -1
  45. package/dist/api/handlers/AiGatewayManagementHandler.d.ts +3 -0
  46. package/dist/api/handlers/AiGatewayManagementHandler.js +173 -58
  47. package/dist/api/service/AiClientConfigurationService.d.ts +4 -15
  48. package/dist/api/service/AiClientConfigurationService.js +17 -64
  49. package/dist/cli/commands/start.js +2 -0
  50. package/dist/components/components.jsonld +1 -0
  51. package/dist/components/context.jsonld +80 -0
  52. package/dist/http/InternalPodDataHttpHandler.d.ts +3 -0
  53. package/dist/http/InternalPodDataHttpHandler.js +13 -2
  54. package/dist/http/InternalPodDataHttpHandler.jsonld +12 -0
  55. package/dist/identity/oidc/RememberedClientPromptFactory.d.ts +1 -1
  56. package/dist/identity/oidc/RememberedClientPromptFactory.js +5 -2
  57. package/dist/identity/oidc/RememberedConsentHandler.js +1 -1
  58. package/dist/identity/oidc/ScopedPickWebIdHandler.d.ts +1 -0
  59. package/dist/identity/oidc/ScopedPickWebIdHandler.js +26 -0
  60. package/dist/identity/oidc/ScopedPickWebIdHandler.jsonld +4 -0
  61. package/dist/identity/oidc/SessionBoundIdentityProviderFactory.d.ts +10 -0
  62. package/dist/identity/oidc/SessionBoundIdentityProviderFactory.js +21 -0
  63. package/dist/identity/oidc/SessionBoundIdentityProviderFactory.jsonld +172 -0
  64. package/dist/index.d.ts +2 -1
  65. package/dist/index.js +4 -2
  66. package/dist/runtime/component-parameter-keys.js +18 -2
  67. package/dist/storage/accessors/MixDataAccessor.js +6 -2
  68. package/dist/storage/rdf/PostgresRdfEngine.js +10 -2
  69. package/dist/storage/rdf/RdfContentTypes.js +4 -0
  70. package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.d.ts +3 -0
  71. package/node_modules/@undefineds.co/ai-connections/dist/AiClientConfigurationSection.js +13 -16
  72. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsList.js +1 -3
  73. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsMain.d.ts +2 -1
  74. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsMain.js +2 -2
  75. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.d.ts +4 -1
  76. package/node_modules/@undefineds.co/ai-connections/dist/AiConnectionsPanel.js +127 -57
  77. package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialPoolSection.d.ts +6 -4
  78. package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialPoolSection.js +436 -83
  79. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeysSection.d.ts +3 -2
  80. package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeysSection.js +212 -76
  81. package/node_modules/@undefineds.co/ai-connections/dist/AiProviderCard.d.ts +6 -4
  82. package/node_modules/@undefineds.co/ai-connections/dist/AiProviderCard.js +58 -41
  83. package/node_modules/@undefineds.co/ai-connections/dist/AiQuotaCard.d.ts +4 -1
  84. package/node_modules/@undefineds.co/ai-connections/dist/AiQuotaCard.js +63 -4
  85. package/node_modules/@undefineds.co/ai-connections/dist/ai-connections-client.d.ts +46 -6
  86. package/node_modules/@undefineds.co/ai-connections/dist/ai-connections-client.js +143 -14
  87. package/node_modules/@undefineds.co/ai-connections/dist/client-config/base-adapter.d.ts +19 -3
  88. package/node_modules/@undefineds.co/ai-connections/dist/client-config/base-adapter.js +45 -7
  89. package/node_modules/@undefineds.co/ai-connections/dist/client-config/codex.d.ts +7 -1
  90. package/node_modules/@undefineds.co/ai-connections/dist/client-config/codex.js +305 -40
  91. package/node_modules/@undefineds.co/ai-connections/dist/client-config/index.cjs +383 -50
  92. package/node_modules/@undefineds.co/ai-connections/dist/client-config/json-env-adapter.js +3 -2
  93. package/node_modules/@undefineds.co/ai-connections/dist/client-config/pi.js +12 -3
  94. package/node_modules/@undefineds.co/ai-connections/dist/client-config/transaction.d.ts +2 -0
  95. package/node_modules/@undefineds.co/ai-connections/dist/client-config/transaction.js +39 -4
  96. package/node_modules/@undefineds.co/ai-connections/dist/client-config/types.d.ts +8 -1
  97. package/node_modules/@undefineds.co/ai-connections/dist/client-visuals.d.ts +2 -0
  98. package/node_modules/@undefineds.co/ai-connections/dist/client-visuals.js +14 -0
  99. package/node_modules/@undefineds.co/ai-connections/dist/controller.d.ts +2 -2
  100. package/node_modules/@undefineds.co/ai-connections/dist/controller.js +216 -57
  101. package/node_modules/@undefineds.co/ai-connections/dist/index.d.ts +3 -1
  102. package/node_modules/@undefineds.co/ai-connections/dist/index.js +16 -2
  103. package/node_modules/@undefineds.co/ai-connections/dist/provider-visuals.js +6 -1
  104. package/node_modules/@undefineds.co/drizzle-solid/dist/core/execution/ldp-executor.js +27 -6
  105. package/node_modules/@undefineds.co/drizzle-solid/dist/core/pod-database.js +1 -1
  106. package/node_modules/@undefineds.co/drizzle-solid/dist/core/query-builders/select-query-builder.js +2 -2
  107. package/node_modules/@undefineds.co/drizzle-solid/dist/core/sparql/builder/update-builder.js +12 -1
  108. package/node_modules/@undefineds.co/drizzle-solid/dist/core/triple/builder.js +1 -1
  109. package/node_modules/@undefineds.co/drizzle-solid/dist/core/triple/handlers/array.js +8 -0
  110. package/node_modules/@undefineds.co/drizzle-solid/dist/core/triple/handlers/default.js +9 -1
  111. package/node_modules/@undefineds.co/drizzle-solid/dist/core/triple/handlers/inline.js +3 -3
  112. package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/execution/ldp-executor.js +27 -6
  113. package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/pod-database.js +1 -1
  114. package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/query-builders/select-query-builder.js +2 -2
  115. package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/sparql/builder/update-builder.js +12 -1
  116. package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/triple/builder.js +1 -1
  117. package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/triple/handlers/array.js +8 -0
  118. package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/triple/handlers/default.js +9 -1
  119. package/node_modules/@undefineds.co/drizzle-solid/dist/esm/core/triple/handlers/inline.js +3 -3
  120. package/node_modules/@undefineds.co/extension-sdk/dist/web.d.ts +31 -0
  121. package/package.json +2 -2
  122. package/static/app/assets/{index-BikOyGPu.js → index-BCZVzMpj.js} +44 -44
  123. package/static/app/assets/inrupt-smoke.js +2 -2
  124. package/static/app/assets/main.css +1 -1
  125. package/static/app/assets/main.js +10 -10
  126. package/static/auth-callback/assets/{AiConfigContext-DrCH6ckh.js → AiConfigContext-DVkh8Kg2.js} +1 -1
  127. package/static/auth-callback/assets/{AiConfigPage-DVrlSSdA.js → AiConfigPage-HWVWpe-P.js} +1 -1
  128. package/static/auth-callback/assets/{DocumentProcessingPanel-_Md-v2R2.js → DocumentProcessingPanel-DDq-mH17.js} +1 -1
  129. package/static/auth-callback/assets/{IndexLifecyclePanel-BbWwe23H.js → IndexLifecyclePanel-Cx4cjrdP.js} +1 -1
  130. package/static/auth-callback/assets/{IndexSubjectPanel-upH9MjU-.js → IndexSubjectPanel-DzSw8M9j.js} +1 -1
  131. package/static/auth-callback/assets/{ModelAssignmentsPanel-CVGH4t4g.js → ModelAssignmentsPanel-BsRxGc2p.js} +1 -1
  132. package/static/auth-callback/assets/ModelsPage-DEe1lo6Q.js +10 -0
  133. package/static/auth-callback/assets/{NetworkPage-Dcbrb1fd.js → NetworkPage-DBiEh1Oz.js} +1 -1
  134. package/static/auth-callback/assets/{PaneListHeader-DrY-1wBq.js → PaneListHeader-lEEgjyN9.js} +1 -1
  135. package/static/auth-callback/assets/{SearchIndexingPanel-Dw25y53v.js → SearchIndexingPanel-CZCUUGt6.js} +1 -1
  136. package/static/auth-callback/assets/{StatusSubjectPanel-BHlz9rNF.js → StatusSubjectPanel-21qdueMr.js} +1 -1
  137. package/static/auth-callback/assets/{StatusWorkspace-BH7exQP5.js → StatusWorkspace-R8RKsqVz.js} +1 -1
  138. package/static/auth-callback/assets/{SystemSettingsPage-BYLKnM9f.js → SystemSettingsPage-BQ4e-4Wy.js} +1 -1
  139. package/static/auth-callback/assets/{SystemSettingsSubjectPanel-DT34LKku.js → SystemSettingsSubjectPanel-BopXD7SE.js} +1 -1
  140. package/static/auth-callback/assets/{activity-DdULRcSI.js → activity-DSfmTGfY.js} +1 -1
  141. package/static/auth-callback/assets/ai-connections-C03UWyPh.js +1 -0
  142. package/static/auth-callback/assets/{auth-callback-D7l2P25I.js → auth-callback-DleaitAS.js} +91 -91
  143. package/static/auth-callback/assets/auth-callback-vPSC2d2F.css +1 -0
  144. package/static/auth-callback/assets/{badge-j4zjFnmg.js → badge-B0aLu1sl.js} +1 -1
  145. package/static/auth-callback/assets/{download-DGXoks01.js → download-D_bFwdYJ.js} +1 -1
  146. package/static/auth-callback/assets/{external-link-CvbgXXaI.js → external-link-DRfjTaQu.js} +1 -1
  147. package/static/auth-callback/assets/{index-LRWvKJ2i.js → index-CG23cLYQ.js} +1 -1
  148. package/static/auth-callback/assets/{index-BOK3j1dz.js → index-CyV9ejwx.js} +1 -1
  149. package/static/auth-callback/assets/{index-browser-C1Qpe0g4.js → index-browser-D70paxIg.js} +1 -1
  150. package/static/auth-callback/assets/{key-round-CmgS5UdQ.js → key-round-BjV_mVYH.js} +1 -1
  151. package/static/auth-callback/assets/{rotate-ccw-c4CSG6Rq.js → rotate-ccw-CKoOAfse.js} +1 -1
  152. package/static/auth-callback/assets/{skeleton-ZPMTiRSM.js → skeleton-BZNjZaHx.js} +1 -1
  153. package/static/auth-callback/assets/{waypoints-xjyBflU5.js → waypoints-DoaJVzZv.js} +1 -1
  154. package/static/auth-callback/assets/{workspace-layout-B9nj6F5J.js → workspace-layout-CaP46_ZR.js} +1 -1
  155. package/static/auth-callback/auth-callback.html +2 -2
  156. package/static/dashboard/assets/{AiConfigContext-BWOOSYNr.js → AiConfigContext-BSrR27yD.js} +1 -1
  157. package/static/dashboard/assets/{AiConfigPage-CG2kQ9Wy.js → AiConfigPage-D65Z2LET.js} +1 -1
  158. package/static/dashboard/assets/{DocumentProcessingPanel-B4VXajfj.js → DocumentProcessingPanel-DyTe7Nei.js} +1 -1
  159. package/static/dashboard/assets/{IndexLifecyclePanel-CWCy0CC8.js → IndexLifecyclePanel-fK8ZGlrL.js} +1 -1
  160. package/static/dashboard/assets/{IndexSubjectPanel-CSgyQnG_.js → IndexSubjectPanel-CZPGor7v.js} +1 -1
  161. package/static/dashboard/assets/{ModelAssignmentsPanel-CdGIGidT.js → ModelAssignmentsPanel-CfYn5LMQ.js} +1 -1
  162. package/static/dashboard/assets/ModelsPage-djlJsghe.js +25 -0
  163. package/static/dashboard/assets/{NetworkPage-COia9NCH.js → NetworkPage-Coj6GnPl.js} +1 -1
  164. package/static/dashboard/assets/{PaneListHeader-SZWyr602.js → PaneListHeader-CUuFNSsZ.js} +1 -1
  165. package/static/dashboard/assets/{SearchIndexingPanel-D6PZtG6k.js → SearchIndexingPanel-CyJLioXS.js} +1 -1
  166. package/static/dashboard/assets/{StatusSubjectPanel-CxRD4kv0.js → StatusSubjectPanel-Cv26GSVC.js} +1 -1
  167. package/static/dashboard/assets/{StatusWorkspace-D3PfmY9-.js → StatusWorkspace-CDjFrsmB.js} +1 -1
  168. package/static/dashboard/assets/{SystemSettingsPage-COg1MmMj.js → SystemSettingsPage-BuNOyNoa.js} +1 -1
  169. package/static/dashboard/assets/{SystemSettingsSubjectPanel-BSVVB9Ol.js → SystemSettingsSubjectPanel-B2dasdez.js} +1 -1
  170. package/static/dashboard/assets/{activity-BJJx5cN-.js → activity-D1d2j_4Z.js} +1 -1
  171. package/static/dashboard/assets/ai-connections-C03UWyPh.js +1 -0
  172. package/static/dashboard/assets/{badge-elmrFSCj.js → badge-BeAAv6sp.js} +1 -1
  173. package/static/dashboard/assets/{dashboard-IvQrNmru.js → dashboard-BnGrUGv8.js} +68 -68
  174. package/static/dashboard/assets/dashboard-vPSC2d2F.css +1 -0
  175. package/static/dashboard/assets/{download-C3FH2KzG.js → download-DfFGiZRn.js} +1 -1
  176. package/static/dashboard/assets/{external-link-Bx7F0uKb.js → external-link-IsjU_LC9.js} +1 -1
  177. package/static/dashboard/assets/{index-liRoRIP1.js → index-BWQTucPe.js} +1 -1
  178. package/static/dashboard/assets/{index-M4-kWiGz.js → index-Dj75OjnW.js} +1 -1
  179. package/static/dashboard/assets/{key-round-CXg0bKAj.js → key-round-BJ_9wmQ_.js} +1 -1
  180. package/static/dashboard/assets/{rotate-ccw-yxJKOBrX.js → rotate-ccw-D3JGiFbR.js} +1 -1
  181. package/static/dashboard/assets/{skeleton-x9jNGrQT.js → skeleton-CC4nc-z-.js} +1 -1
  182. package/static/dashboard/assets/{waypoints-CTKeRsGp.js → waypoints-h7sqFqiG.js} +1 -1
  183. package/static/dashboard/assets/{workspace-layout--YkgkS38.js → workspace-layout-ZAPTOHhs.js} +1 -1
  184. package/static/dashboard/dashboard.html +2 -2
  185. package/static/settings/assets/{AiConfigContext-CelxXFcQ.js → AiConfigContext-lGkWpvKP.js} +1 -1
  186. package/static/settings/assets/{AiConfigPage-BaP-EovM.js → AiConfigPage-BbZWIBZq.js} +1 -1
  187. package/static/settings/assets/{DocumentProcessingPanel-DzLZluFv.js → DocumentProcessingPanel-DvYdjT-V.js} +1 -1
  188. package/static/settings/assets/{IndexLifecyclePanel-Bzj1-_oI.js → IndexLifecyclePanel-W5OGQZj7.js} +1 -1
  189. package/static/settings/assets/{IndexSubjectPanel-B263QLUh.js → IndexSubjectPanel-g_Aa5soq.js} +1 -1
  190. package/static/settings/assets/{ModelAssignmentsPanel-BAdT4UR0.js → ModelAssignmentsPanel-COlMBKXj.js} +1 -1
  191. package/static/settings/assets/ModelsPage-mApKi-aw.js +10 -0
  192. package/static/settings/assets/{NetworkPage-BK6a7l4g.js → NetworkPage-BDT05JUq.js} +1 -1
  193. package/static/settings/assets/{PaneListHeader-BAS2ICPq.js → PaneListHeader-CByhNpMG.js} +1 -1
  194. package/static/settings/assets/{SearchIndexingPanel-Cb_p-NgW.js → SearchIndexingPanel-BFAyzXls.js} +1 -1
  195. package/static/settings/assets/{StatusSubjectPanel-CcjqUua6.js → StatusSubjectPanel-Bz_XZ3VU.js} +1 -1
  196. package/static/settings/assets/{StatusWorkspace-7Ibty3_k.js → StatusWorkspace-CeVypHcW.js} +1 -1
  197. package/static/settings/assets/{SystemSettingsPage-DPSz4dg4.js → SystemSettingsPage-Dh7cQIfx.js} +1 -1
  198. package/static/settings/assets/{SystemSettingsSubjectPanel-Cb4HkKT5.js → SystemSettingsSubjectPanel-CSnpciO0.js} +1 -1
  199. package/static/settings/assets/{activity-Qhsr5Pxu.js → activity-DXz3EfFN.js} +1 -1
  200. package/static/settings/assets/ai-connections-C03UWyPh.js +1 -0
  201. package/static/settings/assets/{badge-B1vf2qCl.js → badge-1ZA144i4.js} +1 -1
  202. package/static/settings/assets/{download-CYNt0aZ-.js → download-CUHimlYa.js} +1 -1
  203. package/static/settings/assets/{external-link-ClKb39NT.js → external-link-BYHSVj2Z.js} +1 -1
  204. package/static/settings/assets/{index-y8ew3MLM.js → index-DKPDMdW5.js} +1 -1
  205. package/static/settings/assets/{index-browser-DJhvgpNI.js → index-browser-BaEFz0e0.js} +1 -1
  206. package/static/settings/assets/{index-BgiIDSch.js → index-viSgSvbO.js} +1 -1
  207. package/static/settings/assets/{key-round-5d-DrJz-.js → key-round-COByPOg8.js} +1 -1
  208. package/static/settings/assets/{rotate-ccw-CHZY7kS5.js → rotate-ccw-BC2EN6cE.js} +1 -1
  209. package/static/settings/assets/{settings-D5VRWyx6.js → settings-DLH9XUoT.js} +86 -86
  210. package/static/settings/assets/settings-vPSC2d2F.css +1 -0
  211. package/static/settings/assets/{skeleton-FNabNxNE.js → skeleton-B0-FOhKL.js} +1 -1
  212. package/static/settings/assets/{waypoints-BnL_8ljo.js → waypoints-DGMsvqWo.js} +1 -1
  213. package/static/settings/assets/{workspace-layout-D5q3F59S.js → workspace-layout-B0SVrJIu.js} +1 -1
  214. package/static/settings/settings.html +2 -2
  215. package/static/auth-callback/assets/ModelsPage-BpkVFKbf.js +0 -10
  216. package/static/auth-callback/assets/ai-connections-Bm52UO7Y.js +0 -1
  217. package/static/auth-callback/assets/auth-callback-01yz-UDU.css +0 -1
  218. package/static/dashboard/assets/ModelsPage-Chd5UK0D.js +0 -25
  219. package/static/dashboard/assets/ai-connections-Bm52UO7Y.js +0 -1
  220. package/static/dashboard/assets/dashboard-01yz-UDU.css +0 -1
  221. package/static/settings/assets/ModelsPage-C0NFa1zq.js +0 -10
  222. package/static/settings/assets/ai-connections-Bm52UO7Y.js +0 -1
  223. package/static/settings/assets/settings-01yz-UDU.css +0 -1
@@ -0,0 +1,25 @@
1
+ import{j as y,r as Q,P as bn,o as zs,q as Si,x as jd,z as Cp,X as Mp,f as Ue,i as Dp,E as Pp,F as Nd,H as Ws,I as Hs,J as Fd,K as Ld,M as et,Q as Qr,T as tu,U as Vs,V as ct,W as Co,Y as we,Z as ui,_ as Hr,$ as ws,a0 as bo,a1 as mn,a2 as tr,a3 as kp,a4 as Tp,a5 as Et,a6 as ur,a7 as Ud,a8 as Op,a9 as Qs,aa as Qt,ab as Ur,ac as Mo,ad as Bd,ae as qd,af as Kd,B as Ae,ag as jp,ah as ru,ai as st,aj as er,ak as nu,t as pt,al as Np,am as Fp,an as Lp,ao as zd,ap as or,aq as vt,ar as Gt,as as St,at as Wd,au as Ie,av as ke,aw as yt,ax as Up,ay as Bp,az as qp,u as Kp}from"./dashboard-BnGrUGv8.js";import{A as Hd,a as zp,b as Wp,n as Vd,d as Hp,e as Vp}from"./ai-connections-C03UWyPh.js";import{W as Qp,T as Gp}from"./workspace-layout-ZAPTOHhs.js";import{a as Do,P as Jp,c as Lt,h as Yp,g as Xp,R as Zp,d as $p,F as ey,D as Qd,e as Gd,u as yo,C as ty,i as ry,b as Jd,f as ny,A as iy}from"./index-BWQTucPe.js";import{B as na}from"./badge-BeAAv6sp.js";import{QueryEngine as oy}from"@comunica/query-sparql-solid";var ay=Object.defineProperty,Mt=(e,t)=>ay(e,"name",{value:t,configurable:!0}),Gs="Dialog",[Yd,Z_]=jd(Gs),[sy,Kt]=Yd(Gs),ly=Mt(e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,s=Q.useRef(null),c=Q.useRef(null),[d,p]=Gd({prop:n,defaultProp:i??!1,onChange:o,caller:Gs}),[g,A]=Q.useState(0),[I,M]=Q.useState(0);return y.jsx(sy,{scope:t,triggerRef:s,contentRef:c,contentId:yo(),titleId:yo(),descriptionId:yo(),titlePresent:g>0,descriptionPresent:I>0,setTitleCount:A,setDescriptionCount:M,open:d,onOpenChange:p,onOpenToggle:Q.useCallback(()=>p(E=>!E),[p]),modal:a,children:r})},"Dialog"),uy="DialogTrigger",cy=Q.forwardRef(Mt(function(t,r){const{__scopeDialog:n,...i}=t,o=Kt(uy,n),a=Si(r,o.triggerRef);return y.jsx(bn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":Po(o.open),...i,ref:a,onClick:Lt(t.onClick,o.onOpenToggle)})},"DialogTrigger")),Xd="DialogPortal",[dy,Zd]=Yd(Xd,{forceMount:void 0}),fy=Mt(e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,o=Kt(Xd,t);return y.jsx(dy,{scope:t,forceMount:r,children:Q.Children.map(n,a=>y.jsx(Do,{present:r||o.open,children:y.jsx(Jp,{asChild:!0,container:i,children:a})}))})},"DialogPortal"),_s="DialogOverlay",$d=Q.forwardRef(Mt(function(t,r){const n=Zd(_s,t.__scopeDialog),{forceMount:i=n.forceMount,...o}=t,a=Kt(_s,t.__scopeDialog);return a.modal?y.jsx(Do,{present:i||a.open,children:y.jsx(py,{...o,ref:r})}):null},"DialogOverlay")),hy=Cp("DialogOverlay.RemoveScroll"),py=Q.forwardRef(Mt(function(t,r){const{__scopeDialog:n,...i}=t,o=Kt(_s,n),a=Xp(),s=Si(r,a);return y.jsx(Zp,{as:hy,allowPinchZoom:!0,shards:[o.contentRef],children:y.jsx(bn.div,{"data-state":Po(o.open),...i,ref:s,style:{pointerEvents:"auto",...i.style}})})},"DialogOverlayImpl")),hi="DialogContent",ef=Q.forwardRef(Mt(function(t,r){const n=Zd(hi,t.__scopeDialog),{forceMount:i=n.forceMount,...o}=t,a=Kt(hi,t.__scopeDialog);return y.jsx(Do,{present:i||a.open,children:a.modal?y.jsx(yy,{...o,ref:r}):y.jsx(gy,{...o,ref:r})})},"DialogContent")),yy=Q.forwardRef(Mt(function(t,r){const n=Kt(hi,t.__scopeDialog),i=Q.useRef(null),o=Si(r,n.contentRef,i);return Q.useEffect(()=>{const a=i.current;if(a)return Yp(a)},[]),y.jsx(tf,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Lt(t.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Lt(t.onPointerDownOutside,a=>{const s=a.detail.originalEvent,c=s.button===0&&s.ctrlKey===!0;(s.button===2||c)&&a.preventDefault()}),onFocusOutside:Lt(t.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),gy=Q.forwardRef(Mt(function(t,r){const n=Kt(hi,t.__scopeDialog),i=Q.useRef(!1),o=Q.useRef(!1);return y.jsx(tf,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),a.defaultPrevented||(i.current||n.triggerRef.current?.focus(),a.preventDefault()),i.current=!1,o.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),a.defaultPrevented||(i.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=a.target;n.triggerRef.current?.contains(s)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})},"DialogContentNonModal")),tf=Q.forwardRef(Mt(function(t,r){const{__scopeDialog:n,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:a,...s}=t,c=Kt(hi,n);return $p(),y.jsx(y.Fragment,{children:y.jsx(ey,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:o,onUnmountAutoFocus:a,children:y.jsx(Qd,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionPresent?c.descriptionId:void 0,"aria-labelledby":c.titlePresent?c.titleId:void 0,"data-state":Po(c.open),...s,ref:r,deferPointerDownOutside:!0,onDismiss:()=>c.onOpenChange(!1)})})})},"DialogContentImpl")),by="DialogTitle",rf=Q.forwardRef(Mt(function(t,r){const{__scopeDialog:n,...i}=t,o=Kt(by,n),{setTitleCount:a}=o;return zs(()=>(a(s=>s+1),()=>a(s=>s-1)),[a]),y.jsx(bn.h2,{id:o.titleId,...i,ref:r})},"DialogTitle")),my="DialogDescription",nf=Q.forwardRef(Mt(function(t,r){const{__scopeDialog:n,...i}=t,o=Kt(my,n),{setDescriptionCount:a}=o;return zs(()=>(a(s=>s+1),()=>a(s=>s-1)),[a]),y.jsx(bn.p,{id:o.descriptionId,...i,ref:r})},"DialogDescription")),wy="DialogClose",_y=Q.forwardRef(Mt(function(t,r){const{__scopeDialog:n,...i}=t,o=Kt(wy,n);return y.jsx(bn.button,{type:"button",...i,ref:r,onClick:Lt(t.onClick,()=>o.onOpenChange(!1))})},"DialogClose"));function Po(e){return e?"open":"closed"}Mt(Po,"getState");const Ei=ly,Ay=cy,vy=fy,of=Q.forwardRef(({className:e,...t},r)=>y.jsx($d,{ref:r,className:Ue("fixed inset-0 z-50 bg-black/40","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));of.displayName=$d.displayName;const wn=Q.forwardRef(({className:e,children:t,variant:r="center",...n},i)=>y.jsxs(vy,{children:[y.jsx(of,{}),y.jsxs(ef,{ref:i,className:Ue(r==="sheet-left"?"fixed inset-y-0 left-0 z-50 flex h-dvh w-[min(88vw,320px)] flex-col border-r bg-background p-0 shadow-[16px_0_30px_rgba(15,23,42,0.08)] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:slide-out-to-left-full data-[state=open]:slide-in-from-left-full rounded-none":r==="sheet-right"?"fixed inset-y-0 right-0 z-50 flex h-dvh w-full max-w-4xl flex-col border-l bg-background p-0 shadow-[-16px_0_30px_rgba(15,23,42,0.08)] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-right-full rounded-none":"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",e),...n,children:[t,y.jsxs(_y,{className:Ue("absolute right-4 top-4 rounded-xl opacity-70 transition-all hover:opacity-100 hover:bg-muted/50 p-1 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",Dp),children:[y.jsx(Mp,{className:"h-4 w-4"}),y.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));wn.displayName=ef.displayName;const xi=({className:e,...t})=>y.jsx("div",{className:Ue("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});xi.displayName="DialogHeader";const ko=({className:e,...t})=>y.jsx("div",{className:Ue("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ko.displayName="DialogFooter";const _n=Q.forwardRef(({className:e,...t},r)=>y.jsx(rf,{ref:r,className:Ue("text-lg font-semibold leading-none tracking-tight",e),...t}));_n.displayName=rf.displayName;const Sy=Q.forwardRef(({className:e,...t},r)=>y.jsx(nf,{ref:r,className:Ue("text-sm text-muted-foreground",e),...t}));Sy.displayName=nf.displayName;var Ey=Object.defineProperty,Xe=(e,t)=>Ey(e,"name",{value:t,configurable:!0}),[Js,$_]=jd("Tooltip",[Jd]),Ys=Jd(),xy="TooltipProvider",Iy=700,As="tooltip.open",[Ry,Xs]=Js(xy),Cy=Xe(e=>{const{__scopeTooltip:t,delayDuration:r=Iy,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:o}=e,a=Q.useRef(!0),s=Q.useRef(!1),c=Q.useRef(0);return Q.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),y.jsx(Ry,{scope:t,isOpenDelayedRef:a,delayDuration:r,onOpen:Q.useCallback(()=>{n<=0||(window.clearTimeout(c.current),a.current=!1)},[n]),onClose:Q.useCallback(()=>{n<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,n))},[n]),isPointerInTransitRef:s,onPointerInTransitChange:Q.useCallback(d=>{s.current=d},[]),disableHoverableContent:i,children:o})},"TooltipProvider"),vs="Tooltip",[My,To]=Js(vs),Dy=Xe(e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:i,onOpenChange:o,disableHoverableContent:a,delayDuration:s}=e,c=Xs(vs,e.__scopeTooltip),d=Ys(t),[p,g]=Q.useState(null),[A,I]=Q.useState(void 0),M=yo(),E=Q.useRef(0),_=a??c.disableHoverableContent,R=s??c.delayDuration,S=Q.useRef(!1),[v,V]=Gd({prop:n,defaultProp:i??!1,onChange:Xe(T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(As))):c.onClose(),o?.(T)},"onChange"),caller:vs}),X=Q.useMemo(()=>v?S.current?"delayed-open":"instant-open":"closed",[v]),re=Q.useCallback(()=>{window.clearTimeout(E.current),E.current=0,S.current=!1,V(!0)},[V]),ie=Q.useCallback(()=>{window.clearTimeout(E.current),E.current=0,V(!1)},[V]),G=Q.useCallback(()=>{window.clearTimeout(E.current),E.current=window.setTimeout(()=>{S.current=!0,V(!0),E.current=0},R)},[R,V]);Q.useEffect(()=>()=>{E.current&&(window.clearTimeout(E.current),E.current=0)},[]);const fe=A??M;return y.jsx(ny,{...d,children:y.jsx(My,{scope:t,contentId:fe,setContentId:I,open:v,stateAttribute:X,trigger:p,onTriggerChange:g,onTriggerEnter:Q.useCallback(()=>{c.isOpenDelayedRef.current?G():re()},[c.isOpenDelayedRef,G,re]),onTriggerLeave:Q.useCallback(()=>{_?ie():(window.clearTimeout(E.current),E.current=0)},[ie,_]),onOpen:re,onClose:ie,disableHoverableContent:_,children:r})})},"Tooltip"),iu="TooltipTrigger",Py=Q.forwardRef(Xe(function(t,r){const{__scopeTooltip:n,...i}=t,o=To(iu,n),a=Xs(iu,n),s=Ys(n),c=Q.useRef(null),d=Si(r,c,o.onTriggerChange),p=Q.useRef(!1),g=Q.useRef(!1),A=Q.useCallback(()=>p.current=!1,[]);return Q.useEffect(()=>()=>document.removeEventListener("pointerup",A),[A]),y.jsx(iy,{asChild:!0,...s,children:y.jsx(bn.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...i,ref:d,onPointerMove:Lt(t.onPointerMove,I=>{I.pointerType!=="touch"&&!g.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),g.current=!0)}),onPointerLeave:Lt(t.onPointerLeave,()=>{o.onTriggerLeave(),g.current=!1}),onPointerDown:Lt(t.onPointerDown,()=>{o.open&&o.onClose(),p.current=!0,document.addEventListener("pointerup",A,{once:!0})}),onFocus:Lt(t.onFocus,()=>{p.current||o.onOpen()}),onBlur:Lt(t.onBlur,o.onClose),onClick:Lt(t.onClick,o.onClose)})})},"TooltipTrigger")),ky="TooltipPortal",[e2,Ty]=Js(ky,{forceMount:void 0}),pi="TooltipContent",Oy=Q.forwardRef(Xe(function(t,r){const n=Ty(pi,t.__scopeTooltip),{forceMount:i=n.forceMount,side:o="top",...a}=t,s=To(pi,t.__scopeTooltip);return y.jsx(Do,{present:i||s.open,children:s.disableHoverableContent?y.jsx(af,{side:o,...a,ref:r}):y.jsx(jy,{side:o,...a,ref:r})})},"TooltipContent")),jy=Q.forwardRef(Xe(function(t,r){const n=To(pi,t.__scopeTooltip),i=Xs(pi,t.__scopeTooltip),o=Q.useRef(null),a=Si(r,o),[s,c]=Q.useState(null),{trigger:d,onClose:p}=n,g=o.current,{onPointerInTransitChange:A}=i,I=Q.useCallback(()=>{c(null),A(!1)},[A]),M=Q.useCallback((E,_)=>{const R=E.currentTarget,S={x:E.clientX,y:E.clientY},v=sf(S,R.getBoundingClientRect()),V=lf(S,v),X=uf(_.getBoundingClientRect()),re=df([...V,...X]);c(re),A(!0)},[A]);return Q.useEffect(()=>()=>I(),[I]),Q.useEffect(()=>{if(d&&g){const E=Xe(R=>M(R,g),"handleTriggerLeave"),_=Xe(R=>M(R,d),"handleContentLeave");return d.addEventListener("pointerleave",E),g.addEventListener("pointerleave",_),()=>{d.removeEventListener("pointerleave",E),g.removeEventListener("pointerleave",_)}}},[d,g,M,I]),Q.useEffect(()=>{if(s){const E=Xe(_=>{const R=_.target,S={x:_.clientX,y:_.clientY},v=d?.contains(R)||g?.contains(R),V=!cf(S,s);v?I():V&&(I(),p())},"handleTrackPointerGrace");return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[d,g,s,p,I]),y.jsx(af,{...t,ref:a})},"TooltipContentHoverable")),Ny=Pp("TooltipContent"),af=Q.forwardRef(Xe(function(t,r){const{__scopeTooltip:n,children:i,"aria-label":o,id:a,onEscapeKeyDown:s,onPointerDownOutside:c,...d}=t,p=To(pi,n),g=Ys(n),{onClose:A}=p;Q.useEffect(()=>(document.addEventListener(As,A),()=>document.removeEventListener(As,A)),[A]),Q.useEffect(()=>{if(p.trigger){const M=Xe(E=>{E.target instanceof Node&&E.target.contains(p.trigger)&&A()},"handleScroll");return window.addEventListener("scroll",M,{capture:!0}),()=>window.removeEventListener("scroll",M,{capture:!0})}},[p.trigger,A]);const{setContentId:I}=p;return zs(()=>(I(a),()=>{I(void 0)}),[a,I]),y.jsx(Qd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:M=>M.preventDefault(),onDismiss:A,children:y.jsxs(ty,{"data-state":p.stateAttribute,role:o?void 0:"tooltip",id:o?void 0:p.contentId,...g,...d,ref:r,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[y.jsx(Ny,{children:i}),o?y.jsx(ry,{id:p.contentId,role:"tooltip",children:o}):null]})})},"TooltipContentImpl"));function sf(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,i,o)){case o:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}Xe(sf,"getExitSideFromRect");function lf(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}Xe(lf,"getPaddedExitPoints");function uf(e){const{top:t,right:r,bottom:n,left:i}=e;return[{x:i,y:t},{x:r,y:t},{x:r,y:n},{x:i,y:n}]}Xe(uf,"getPointsFromRect");function cf(e,t){const{x:r,y:n}=e;let i=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const s=t[o],c=t[a],d=s.x,p=s.y,g=c.x,A=c.y;p>n!=A>n&&r<(g-d)*(n-p)/(A-p)+d&&(i=!i)}return i}Xe(cf,"isPointInPolygon");function df(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),ff(t)}Xe(df,"getHull");function ff(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const i=e[n];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))t.pop();else break}t.push(i)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const i=e[n];for(;r.length>=2;){const o=r[r.length-1],a=r[r.length-2];if((o.x-a.x)*(i.y-a.y)>=(o.y-a.y)*(i.x-a.x))r.pop();else break}r.push(i)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}Xe(ff,"getHullPresorted");var Fy=Cy,Ly=Dy,Uy=Py,hf=Oy;const pf=Fy,Oo=Ly,jo=Uy,Ii=Q.forwardRef(({className:e,sideOffset:t=4,...r},n)=>y.jsx(hf,{ref:n,sideOffset:t,className:Ue("z-50 overflow-hidden rounded-md border border-border/50 bg-popover","px-2 py-1 text-xs text-popover-foreground shadow-md","animate-in fade-in-0 zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));Ii.displayName=hf.displayName;function By(e){const t=Nd(e).type;return Array.isArray(t)&&t.includes(Ws.AccessControlResource)}async function No(e,t){if(!ki(e))return{resourceAcl:null,fallbackAcl:null};try{const r=await yf(e,t);return r===null?{resourceAcl:null,fallbackAcl:await gf(e,t)}:{resourceAcl:r,fallbackAcl:null}}catch(r){if(r instanceof Ss)return{resourceAcl:null,fallbackAcl:null};throw r}}async function yf(e,t){if(!ki(e))return null;try{const r=await Fd(e.internal_resourceInfo.aclUrl,t);if(By(r))throw new Ss(e,r);return Ld({...r,internal_accessTo:et(e)})}catch(r){if(r instanceof Ss)throw r;return null}}async function gf(e,t){const r=new URL(et(e)),n=r.pathname;if(n==="/")return null;const i=qy(n),o=new URL(i,r.origin).href,a=await Qr(o,t);if(!ki(a))return null;const s=await yf(a,t);return s===null?gf(a,t):s}function qy(e){const t=e.substring(e.length-1)==="/"?e.substring(0,e.length-1):e;return`${e.substring(0,t.lastIndexOf("/"))}/`}function wr(e){return Vs(e).filter(Ky)}function Ky(e){return ct(e,Co.type).includes(we.Authorization)}function Zs(e,t){return e.filter(r=>zy(r,t))}function zy(e,t){return ct(e,we.accessTo).includes(t)}function Fo(e,t){return e.filter(r=>Wy(r,t))}function Wy(e,t){return ct(e,we.default).includes(t)||ct(e,we.defaultForNew).includes(t)}function Ri(e){const t=ct(e,we.mode);return t.includes(Ut.write)?{read:t.includes(Ut.read),append:!0,write:!0,control:t.includes(Ut.control)}:{read:t.includes(Ut.read),append:t.includes(Ut.append),write:!1,control:t.includes(Ut.control)}}function Ci(e){return e.reduce((t,r)=>t.write||r.write?{read:t.read||r.read,append:!0,write:!0,control:t.control||r.control}:{read:t.read||r.read,append:t.append||r.append,write:!1,control:t.control||r.control},{read:!1,append:!1,write:!1,control:!1})}function Hy(e){return wr(e).filter(Vy).reduce(kp,e)}function Vy(e){return Tp(e.predicates,Et.namedNode(e.url),Et.defaultGraph()).some(t=>!Qy(t))?!1:ur(e,we.accessTo)===null&&ur(e,we.default)===null&&ur(e,we.defaultForNew)===null||ur(e,we.mode)===null||ur(e,we.agent)===null&&ur(e,we.agentGroup)===null&&ur(e,we.agentClass)===null}function Qy(e){const{predicate:t}=e,{object:r}=e;return!!(t.equals(Et.namedNode(Co.type))&&r.equals(Et.namedNode(we.Authorization))||t.equals(Et.namedNode(we.accessTo))||t.equals(Et.namedNode(we.default))||t.equals(Et.namedNode(we.defaultForNew))||t.equals(Et.namedNode(we.mode))&&Object.values(Ut).some(n=>r.equals(Et.namedNode(n)))||t.equals(Et.namedNode(we.agent))||t.equals(Et.namedNode(we.agentGroup))||t.equals(Et.namedNode(we.agentClass))||t.equals(Et.namedNode(we.origin)))}const Ut={read:"http://www.w3.org/ns/auth/acl#Read",append:"http://www.w3.org/ns/auth/acl#Append",write:"http://www.w3.org/ns/auth/acl#Write",control:"http://www.w3.org/ns/auth/acl#Control"};function Gy(e,t,r){return e.filter(n=>ct(n,r).includes(t))}function Jy(e,t){const r={};return e.forEach(n=>{const i=ct(n,t),o=Ri(n);i.forEach(a=>{r[a]=typeof r[a]>"u"?o:Ci([r[a],o])})}),r}function bf(e){let t=mn();return t=Hr(t,Co.type,we.Authorization),e.read&&(t=tr(t,we.mode,Ut.read)),e.append&&!e.write&&(t=tr(t,we.mode,Ut.append)),e.write&&(t=tr(t,we.mode,Ut.write)),e.control&&(t=tr(t,we.mode,Ut.control)),t}function Yy(e){let t=mn();t=Hr(t,Co.type,we.Authorization);function r(n,i,o){return ct(n,o).reduce((a,s)=>tr(a,o,s),i)}return t=r(e,t,we.accessTo),t=r(e,t,we.default),t=r(e,t,we.defaultForNew),t=r(e,t,we.agent),t=r(e,t,we.agentGroup),t=r(e,t,we.agentClass),t=r(e,t,we.origin),t=r(e,t,we.mode),t}function Mi(e,t){return Object.assign(Hs(e),{internal_acl:t})}const Xy=[we.agent,we.agentClass,we.agentGroup,we.origin];function Zy(e,t,r,n,i){if(!ct(e,r).includes(t)){const s=bf({read:!1,append:!1,write:!1,control:!1});return[e,s]}const o=ws(e,r,t);let a=Yy(e);return a=ws(a,we.accessTo,n),a=Hr(a,r,t),Xy.filter(s=>s!==r).forEach(s=>{a=bo(a,s)}),[o,a]}function mf(e,t,r,n,i){let o=e;Vs(e).forEach(c=>{const[d,p]=Zy(c,i,r,e.internal_accessTo);o=ui(o,d),o=ui(o,p)});let a=bf(t);a=Hr(a,we.accessTo,e.internal_accessTo),a=Hr(a,r,i);const s=ui(o,a);return Hy(s)}function wf(e,t){return Mi(e,{resourceAcl:t,fallbackAcl:null})}function $y(e){return e.internal_acl.resourceAcl}class Ss extends Error{constructor(t,r){super(`[${tu(t)}] is governed by Access Control Policies in [${tu(r)}] rather than by Web Access Control.`)}}function Di(e){return e.internal_acl.resourceAcl!==null&&et(e)===e.internal_acl.resourceAcl.internal_accessTo&&e.internal_resourceInfo.aclUrl===et(e.internal_acl.resourceAcl)}function $s(e){return Di(e)?e.internal_acl.resourceAcl:null}function Pi(e){return e.internal_acl.fallbackAcl!==null}function eg(e){return Pi(e)?e.internal_acl.fallbackAcl:null}function tg(e){return Ld({...Op(),internal_accessTo:et(e),internal_resourceInfo:{sourceIri:e.internal_resourceInfo.aclUrl,isRawData:!1,linkedResources:{}}})}function rg(e){const t=tg(e),r=wr(e.internal_acl.fallbackAcl);return Fo(r,e.internal_acl.fallbackAcl.internal_accessTo).map(a=>(a=bo(a,we.default),a=bo(a,we.defaultForNew),a=Hr(a,we.accessTo,et(e)),a=Hr(a,we.default,et(e)),a)).reduce(ui,t)}async function ng(e,t,r){if(!ki(e))throw new Error(`Could not determine the location of the ACL for the Resource at [${et(e)}]; possibly the current user does not have Control access to that Resource. Try calling \`hasAccessibleAcl()\` before calling \`saveAclFor()\`.`);return{...await Ud(e.internal_resourceInfo.aclUrl,t,r),internal_accessTo:et(e)}}function ki(e){return typeof e.internal_resourceInfo.aclUrl=="string"}function _f(e,t){return Di(e)?og(e.internal_acl.resourceAcl,t):Pi(e)?lg(e.internal_acl.fallbackAcl,t):null}function ig(e){if(Di(e)){const t=$s(e);return ag(t)}if(Pi(e)){const t=eg(e);return ug(t)}return null}function og(e,t){const r=wr(e),n=Zs(r,e.internal_accessTo),o=Af(n,t).map(Ri);return Ci(o)}function ag(e){const t=wr(e),r=Zs(t,e.internal_accessTo),n=vf(r);return Sf(n)}function sg(e,t,r){return mf(e,r,we.agent,"resource",t)}function lg(e,t){const r=wr(e),n=Fo(r,e.internal_accessTo),o=Af(n,t).map(Ri);return Ci(o)}function ug(e){const t=wr(e),r=Fo(t,e.internal_accessTo),n=vf(r);return Sf(n)}function Af(e,t){return Gy(e,t,we.agent)}function vf(e){return e.filter(cg)}function cg(e){return ur(e,we.agent)!==null}function Sf(e){return Jy(e,we.agent)}function Ef(e){return Di(e)?dg(e.internal_acl.resourceAcl):Pi(e)?fg(e.internal_acl.fallbackAcl):null}function dg(e){const t=wr(e),r=Zs(t,e.internal_accessTo),i=xf(r,Qs.Agent).map(Ri);return Ci(i)}function fg(e){const t=wr(e),r=Fo(t,e.internal_accessTo),i=xf(r,Qs.Agent).map(Ri);return Ci(i)}function hg(e,t){return mf(e,t,we.agentClass,"resource",Qs.Agent)}function xf(e,t){return e.filter(r=>pg(r,t))}function pg(e,t){return ct(e,we.agentClass).includes(t)}async function If(e,t){if(typeof e.internal_resourceInfo.aclUrl!="string")return null;try{return await Qr(e.internal_resourceInfo.aclUrl,t)}catch{return null}}const Dt="http://www.w3.org/ns/solid/acp#",Ke={AccessControlResource:Dt.concat("AccessControlResource"),PublicAgent:Dt.concat("PublicAgent"),access:Dt.concat("access"),accessControl:Dt.concat("accessControl"),agent:Dt.concat("agent"),allOf:Dt.concat("allOf"),allow:Dt.concat("allow"),anyOf:Dt.concat("anyOf"),apply:Dt.concat("apply"),deny:Dt.concat("deny"),memberAccessControl:Dt.concat("memberAccessControl"),noneOf:Dt.concat("noneOf")},ia="http://www.w3.org/ns/auth/acl#",on={Append:ia.concat("Append"),Read:ia.concat("Read"),Write:ia.concat("Write")};async function Rf(e,t){const r=bt(e),n=await Ud(et(r),r,t);return gg(e,n)}function yg(e){return typeof e.internal_acp=="object"&&e.internal_acp!==null&&typeof e.internal_acp.acr=="object"&&e.internal_acp.acr!==null}function bt(e){if(!yg(e))throw new Error(`An Access Control Resource for [${et(e)}] is not available. This could be because the current user is not allowed to see it, or because their Pod Server does not support Access Control Resources.`);return e.internal_acp.acr}function gg(e,t){return Object.assign(Hs(e),{internal_acp:{...e.internal_acp,acr:t}})}function Cf(e){const t=bt(e),r=et(t);return Qt(t,r)}function Mf(e){const t=Cf(e);return t===null?[]:ct(t,Ke.accessControl)}function Df(e,t,r){const n=bt(e);return Array.from(new Set(t.map(i=>{const o=Qt(n,i);return o!==null?ct(o,r):[]}).reduce((i,o)=>i.concat(o),[])))}function bg(e){return Df(e,Mf(e),Ke.apply)}function mg(e){return Df(e,Mf(e),Ke.access)}function Pf(e,t){const r=ct(e,t);return{read:r.includes(on.Read),append:r.includes(on.Append),write:r.includes(on.Write),controlRead:!1,controlWrite:!1}}function wg(e){return Pf(e,Ke.allow)}function _g(e){return Pf(e,Ke.deny)}function ou(e,t,r){const n=Ur(t,Ke.allOf).map(d=>Qt(bt(e),d)).filter(d=>d!==null),i=n.every(d=>Ur(d,Ke.agent).includes(r)),o=Ur(t,Ke.anyOf).map(d=>Qt(bt(e),d)).filter(d=>d!==null),a=o.some(d=>Ur(d,Ke.agent).includes(r)),s=Ur(t,Ke.noneOf).map(d=>Qt(bt(e),d)).filter(d=>d!==null),c=s.some(d=>Ur(d,Ke.agent).includes(r));return n.length+o.length>0&&(n.length===0||i)&&(o.length===0||a)&&(s.length===0||!c)}function au(e,t,r){const n=wg(e),i=_g(e);return r==="control"?{read:t.read,append:t.append,write:t.write,controlRead:(t.controlRead||n.read)&&!i.read,controlWrite:(t.controlWrite||n.write)&&!i.write}:{read:(t.read||n.read)&&!i.read,append:(t.append||n.append)&&!i.append,write:(t.write||n.write)&&!i.write,controlRead:t.controlRead,controlWrite:t.controlWrite}}async function Lo(e,t){let r={read:!1,append:!1,write:!1,controlRead:!1,controlWrite:!1};return bg(e).map(o=>Qt(bt(e),o)).filter(o=>o!==null).forEach(o=>{ou(e,o,t)&&(r=au(o,r,"resource"))}),mg(e).map(o=>Qt(bt(e),o)).filter(o=>o!==null).forEach(o=>{ou(e,o,t)&&(r=au(o,r,"control"))}),r}function kf(e,t){var r,n,i,o;if(e.controlRead!==e.controlWrite)throw new Error("For Pods using Web Access Control, controlRead and controlWrite must be equal.");return{read:(r=e.read)!==null&&r!==void 0?r:t.read,append:(n=e.append)!==null&&n!==void 0?n:t.append,write:(i=e.write)!==null&&i!==void 0?i:t.write,control:(o=e.controlRead)!==null&&o!==void 0?o:t.control}}function el(e){return{read:e.read,write:e.write,append:e.append,controlRead:e.control,controlWrite:e.control}}async function Ag(e,t,r,n){const i=await No(e,n),o=r(Mi(e,i),t);return o===null?null:el(o)}async function vg(e,t,r){const n=await No(e,r),i=t(Mi(e,n));return i===null?null:el(i)}async function Sg(e,t,r){const n=await No(e,r),i=t(Mi(e,n));if(i===null)return null;const o={};for(const[a,s]of Object.entries(i))o[a]=el(s);return o}function Tf(e,t,r){return Ag(e,t,_f,r)}function Of(e,t){return vg(e,Ef,t)}function Eg(e,t){return Sg(e,ig,t)}async function jf(e,t){if(!ki(e))return null;const r=await No(e,t),n=Mi(e,r);let i;if(Di(n))i=$y(n);else if(Pi(n))i=rg(n);else return null;return wf(n,i)}async function Nf(e,t,r){let n=null;try{return n=await ng(e,t,r),wf(e,n)}catch{return null}}async function xg(e,t,r,n,i){const o=await jf(e,i);if(o===null)return null;const a=$s(o),s=r(o),c=kf(t,s),d=n(a,c);return Nf(o,d,i)}async function Ig(e,t,r,n,i,o){const a=await jf(e,o);if(a===null)return null;const s=n(a,t),c=$s(a),d=kf(r,s),p=i(c,t,d);return Nf(a,p,o)}async function Rg(e,t,r,n){return Ig(e,t,r,_f,sg,n)}async function Cg(e,t,r){return xg(e,t,Ef,hg,r)}async function Mg(e,t){const r=await If(e,t);if(r===null)return null;const n=Nd(r).type;return Array.isArray(n)&&n.includes(Ke.AccessControlResource)?et(r):null}async function Ti(e,t){const r=await Mg(e,t);if(r===null)return null;let n;try{n=await Fd(r,t)}catch{return null}return{...e,internal_acp:{acr:{...n,accessTo:et(e)}}}}async function Ff(e,t,r){const n=await Qr(e,r),i=await Ti(n,r);return i===null?Tf(n,t,r):Lo(i,t)}function Dg(e){return Array.from(new Set(Vs(bt(e)).map(t=>Ur(t,Ke.agent)).reduce((t,r)=>t.concat(r),[])))}async function Pg(e){return(await Promise.all(Dg(e).map(async t=>({[t]:await Lo(e,t)})))).reduce((t,r)=>({...t,...r}),{})}async function kg(e,t){const r=await Qr(e,t),n=await Ti(r,t);return n===null?Eg(r,t):Pg(n)}async function Tg(e){return Lo(e,Ke.PublicAgent)}async function Lf(e,t){const r=await Qr(e,t),n=await Ti(r,t);return n===null?Of(r,t):Tg(n)}function Oi(e,t){return Object.assign(Hs(e),{internal_acp:{...e.internal_acp,acr:ui(e.internal_acp.acr,t)}})}const ci="defaultAccessControl",mo="defaultAcrAccessControl";function tl(e,t){const r=bt(e);return et(r).concat("#").concat(t)}function rl(e,t,r){return tl(e,t).concat("AgentMatcher").concat(r.charAt(0).toUpperCase()+r.slice(1)).concat("Policy")}function Uf(e,t){const r=bt(e),n=tl(e,t),i=Qt(r,n);return i===null||typeof i>"u"?mn({url:n}):i}function su(e){return e.includes("Member")?Ke.memberAccessControl:Ke.accessControl}function Bf(e,t){const r=tl(e,t),n=bt(e);let i=Cf(e);return(i===null||typeof i>"u")&&(i=mn({url:et(n)})),ct(i,su(t)).includes(r)?e:(i=Mo(i).addUrl(su(t),r).build(),Oi(e,i))}function Og(e,t){const r=Bf(e,mo),n=Uf(r,mo);return Oi(r,Mo(n).addUrl(Ke.access,t).build())}function jg(e,t){const r=Bf(e,ci),n=Uf(r,ci);return Oi(r,Mo(n).addUrl(Ke.apply,t).build())}function Ng(e,t,r){const n=rl(e,t,r);return n.includes("Acr")?Og(e,n):jg(e,n)}function qf(e,t,r){return rl(e,t,r).concat("Matcher")}function Fg(e,t,r){let n=bo(e,r);return(t.read||t.controlRead)&&(n=tr(n,r,on.Read)),t.append&&(n=tr(n,r,on.Append)),(t.write||t.controlWrite)&&(n=tr(n,r,on.Write)),n}const lu=Ke.anyOf;function Lg(e,t,r){const n=rl(e,t,r),i=qf(e,t,r);let o=Qt(bt(e),n);return o||(e=Ng(e,t,r),o=mn({url:n}),o=Fg(o,{[r]:!0},Ke.allow)),ct(o,lu).includes(i)?e:(o=Mo(o).addUrl(lu,i).build(),Oi(e,o))}function Ug(e,t){return tr(e,Ws.agent,t)}function Bg(e,t){return ws(e,Ws.agent,t)}function Ln(e,t,r,n,i){var o;const a=qf(e,r,n),s=Lg(e,r,n),c=(o=Qt(bt(s),a))!==null&&o!==void 0?o:mn({url:a});return Oi(s,i==="add"?Ug(c,t):Bg(c,t))}async function Kf(e,t,r){const n=await Lo(e,t);return typeof r.read=="boolean"&&n.read!==r.read&&(e=Ln(e,t,ci,"read",r.read?"add":"remove")),typeof r.append=="boolean"&&n.append!==r.append&&(e=Ln(e,t,ci,"append",r.append?"add":"remove")),typeof r.write=="boolean"&&n.write!==r.write&&(e=Ln(e,t,ci,"write",r.write?"add":"remove")),typeof r.controlRead=="boolean"&&n.controlRead!==r.controlRead&&(e=Ln(e,t,mo,"controlRead",r.controlRead?"add":"remove")),typeof r.controlWrite=="boolean"&&n.controlWrite!==r.controlWrite&&(e=Ln(e,t,mo,"controlWrite",r.controlWrite?"add":"remove")),e}async function qg(e,t,r,n){const i=await Qr(e,n),o=await Ti(i,n);if(o===null)return await Rg(i,t,r,n),Tf(i,t,n);try{return await Rf(await Kf(o,t,r),n),await Ff(e,t,n)}catch{return null}}async function Kg(e,t){return Kf(e,Ke.PublicAgent,t)}async function zg(e,t,r){const n=await Qr(e,r),i=await Ti(n,r);if(i===null)return await Cg(n,t,r),Of(n,r);try{return await Rf(await Kg(i,t),r),await Lf(e,r)}catch{return null}}const Wg=Object.freeze(Object.defineProperty({__proto__:null,getAclServerResourceInfo:If,getAgentAccess:Ff,getAgentAccessAll:kg,getPublicAccess:Lf,setAgentAccess:qg,setPublicAccess:zg},Symbol.toStringTag,{value:"Module"}));function Hg(e){if(!zf(e))throw new Error("Applet layout descriptor must be an object");if(typeof e.type!="string")throw new Error("Applet layout descriptor type must be a string");switch(e.type){case"single-pane":case"two-pane":return uu(e.context),e;case"three-pane":return uu(e.context),e;default:throw new Error(`Unsupported applet layout type: ${e.type}`)}}function zf(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function uu(e){if(e!==void 0){if(!zf(e))throw new Error("Applet layout descriptor context must be an object");if("collapsible"in e&&typeof e.collapsible!="boolean")throw new Error("Applet layout descriptor context.collapsible must be a boolean");if("initiallyCollapsed"in e&&typeof e.initiallyCollapsed!="boolean")throw new Error("Applet layout descriptor context.initiallyCollapsed must be a boolean")}}function Vg(e){const t=e.access??Wg;return{inspectAgentAccess:r=>Qg(r,e.fetch,t),ensureAgentAccess:async r=>{try{for(const n of r.resources){await Gg(n.url,n.mediaType,e.fetch);const i=await t.setAgentAccess(n.url,r.service.webId,Yg(n.access),{fetch:e.fetch});if(!i||!Wf(i,n.access))return $t("permissionDenied",r,"Pod did not grant the requested service access.")}return $t("granted",r)}catch(n){return $t("permissionDenied",r,Es(n))}},revokeAgentAccess:async r=>{try{for(const n of r.resources)if(!await t.setAgentAccess(n.url,r.service.webId,{read:!1,append:!1,write:!1,controlRead:!1,controlWrite:!1},{fetch:e.fetch}))return $t("permissionDenied",r,"Pod did not revoke the service access.");return $t("missing",r)}catch(n){return $t("permissionDenied",r,Es(n))}}}}async function Qg(e,t,r){try{for(const n of e.resources){const i=await r.getAgentAccess(n.url,e.service.webId,{fetch:t});if(!i||!Wf(i,n.access))return $t("missing",e)}return $t("granted",e)}catch(n){return $t("permissionDenied",e,Es(n))}}async function Gg(e,t,r){const n=await r(e,{method:"HEAD"});if(n.ok)return;if(n.status!==404)throw new Error(`Unable to inspect Pod resource (${n.status}).`);await Jg(e,r);const i=await r(e,{method:"PUT",headers:{"content-type":t},body:`# Created by the Xpod applet permission broker.
2
+ `});if(!i.ok)throw new Error(`Unable to create Pod resource (${i.status}).`)}async function Jg(e,t){const r=new URL(e),n=[];let i=new URL("./",r);for(;i.pathname!=="/";){const o=await t(i.href,{method:"HEAD"});if(o.ok)break;if(o.status!==404)throw new Error(`Unable to inspect Pod container (${o.status}).`);n.push(i.href),i=new URL("../",i)}for(const o of n.reverse()){const a=await t(o,{method:"PUT",headers:{"content-type":"text/turtle",link:'<http://www.w3.org/ns/ldp#BasicContainer>; rel="type"'},body:""});if(!a.ok&&a.status!==409)throw new Error(`Unable to create Pod container (${a.status}).`)}}function Yg(e){return{read:e.read===!0,append:e.append===!0,write:e.write===!0,controlRead:!1,controlWrite:!1}}function Wf(e,t){return(!t.read||e.read===!0)&&(!t.append||e.append===!0)&&(!t.write||e.write===!0)}function $t(e,t,r){return{status:e,resources:t.resources,...r?{message:r}:{}}}function Es(e){return e instanceof Error?e.message:"Unable to update Pod service access."}const Xg=Hg;function Zg(e,t){return $g(e,t)}function $g(e,t){const r=eb(e),n=e.createController(t);return r.type==="single-pane"?{layout:"single-pane",controller:n,element:Q.createElement(r.render,{controller:n,host:t})}:r.type==="two-pane"?{layout:"two-pane",controller:n,slots:{listHeader:Q.createElement(r.slots.listHeader,{controller:n,host:t}),list:Q.createElement(r.slots.list,{controller:n,host:t}),mainHeader:Q.createElement(r.slots.mainHeader,{controller:n,host:t}),main:Q.createElement(r.slots.main,{controller:n,host:t})}}:{layout:"three-pane",controller:n,contextConfig:r.contextConfig,slots:{listHeader:Q.createElement(r.slots.listHeader,{controller:n,host:t}),list:Q.createElement(r.slots.list,{controller:n,host:t}),mainHeader:Q.createElement(r.slots.mainHeader,{controller:n,host:t}),main:Q.createElement(r.slots.main,{controller:n,host:t}),context:Q.createElement(r.slots.context,{controller:n,host:t})}}}function eb(e){if("layout"in e){const t=nb(e.layout),r=Xg(t.descriptor),n=r.type;if(e.manifest.layout!==n)throw new Error(`Applet manifest layout ${e.manifest.layout} does not match descriptor layout ${n}`);if(n==="single-pane"){if(!("render"in t))throw new Error("Applet descriptor single-pane render must be a function");return zr(t.render,"Applet descriptor single-pane render"),{type:"single-pane",render:t.render}}if(!("slots"in t))throw new Error(`Applet descriptor declares ${n} but no slots were provided`);return n==="two-pane"?(xs(t.slots,"Applet descriptor two-pane"),{type:"two-pane",slots:t.slots}):(tb(t.slots,"Applet descriptor three-pane"),{type:"three-pane",contextConfig:r.context,slots:t.slots})}if(e.manifest.layout==="single-pane"){if(!("render"in e))throw new Error("Applet manifest declares single-pane but no single-pane renderer was provided");return zr(e.render,"Applet single-pane render"),{type:"single-pane",render:e.render}}if(e.manifest.layout==="two-pane"&&"slots"in e)return xs(e.slots,"Applet two-pane"),{type:"two-pane",slots:e.slots};throw new Error(`Applet manifest declares ${e.manifest.layout} but no supported applet layout was provided`)}function xs(e,t){rb(e,t),zr(e.listHeader,`${t} slot listHeader`),zr(e.list,`${t} slot list`),zr(e.mainHeader,`${t} slot mainHeader`),zr(e.main,`${t} slot main`)}function tb(e,t){xs(e,t),zr(e.context,`${t} slot context`)}function rb(e,t){if(typeof e!="object"||e===null)throw new Error(`${t} slots must be an object`)}function zr(e,t){if(typeof e!="function")throw new Error(`${t} must be a function`)}function nb(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new Error("Applet descriptor layout must be an object");if(!("descriptor"in e)||e.descriptor===void 0)throw new Error("Applet descriptor required");return e}const ib=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Hf=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();var ob={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const ab=Q.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:o,iconNode:a,...s},c)=>Q.createElement("svg",{ref:c,...ob,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Hf("lucide",i),...s},[...a.map(([d,p])=>Q.createElement(d,p)),...Array.isArray(o)?o:[o]]));const De=(e,t)=>{const r=Q.forwardRef(({className:n,...i},o)=>Q.createElement(ab,{ref:o,iconNode:t,className:Hf(`lucide-${ib(e)}`,n),...i}));return r.displayName=`${e}`,r};const sb=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],wo=De("Box",sb);const lb=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]],Vf=De("Brain",lb);const ub=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],tn=De("Check",ub);const cb=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],db=De("ChevronDown",cb);const fb=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Is=De("Copy",fb);const hb=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Uo=De("ExternalLink",hb);const pb=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],yb=De("EyeOff",pb);const gb=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],bb=De("Eye",gb);const mb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Qf=De("Globe",mb);const wb=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],_b=De("GripVertical",wb);const Ab=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Gf=De("Image",Ab);const vb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Jf=De("Info",vb);const Sb=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],_o=De("KeyRound",Sb);const Eb=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Bt=De("LoaderCircle",Eb);const xb=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],Ib=De("LogOut",xb);const Rb=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],Cb=De("Pause",Rb);const Mb=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Yf=De("Pencil",Mb);const Db=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Pb=De("Play",Db);const kb=[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]],Tb=De("PlugZap",kb);const Ob=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ji=De("Plus",Ob);const jb=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],Nb=De("Power",jb);const Fb=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],cu=De("RefreshCcw",Fb);const Lb=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Ub=De("RefreshCw",Lb);const Bb=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Rs=De("RotateCw",Bb);const qb=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Xf=De("Search",qb);const Kb=[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],zb=De("Settings2",Kb);const Wb=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],Hb=De("SquareTerminal",Wb);const Vb=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],nl=De("Trash2",Vb);const Qb=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1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/CsmVLqZnsSeuxsbFIJ3/Stba2obn5K2rm23BMQYosePQ5J+cAZs6cSc8NBI/HY8mnCHt4mxXnrFvxd2G6HFGQvr5+nKjmjc6c4pZ7H7/m4EEvwsO5f0T19RfxhDgdZsvmTfSDgU5Un0RfXz81c7ocUZDjx6swNMSb5wQAGzZ8jFUrP6BmBlpCQgL27N5FzZyatM7i8Xjod9aHhl7iuEMW644oSFEx/yOVffSyXay4J8KeUJmb46Vfylrxd2I6bC9IS8s3uHXrNjVzVlQU/VRZu3z22S4kxMdTMzs6vkfd+XpaXlzcXKSmptDyAODWrdtoafmGmjkdthfEin3JVozMtEt4eDhycg/Qc/m7DfmfdE7Ys25rQQYGBlBVxTuEcorbF+e/ZMVfvro67qT17du3YunSJbQ8AKiqqqGe4jsdthakorKaejISAKxYsRyJiRupmXZbvnwZ/f+JPWnd4/HQx5QODg6iorKamvmmbC2IFTNarVjUOoEV9xvYk9Zzc730Y7TtnuNr25bbzs5OLFy0AAsXLaDm5mRzp5E7RXraXpw5U0s/OqC9/T5WrFhOyYqPn4cvvvhH3Lr1LSVvSmdnJxISEqiZr8vT29Ph3JESIjaz/VssESdTQUQMVBARAxVExEAFETFQQUQMVBARAxVExEAFETFQQUQMVBARAxVExEAFETFQQUQMVBARAxVExEAFETFQQUQMVBARAxVExEAFETFQQUQMVBARAxVExEAFETFQQUQMVBARAxVExEAFETFQQUQMVBARAxVExEAFETFQQUQMVBARAxVExEAFETFQQUQMVBARAxVExEAFETFQQUQMVBARAxVExEAFETFQQUQMVBARAxVExEAFETFQQUQMVBARg/8H+vaH9zU+MiYAAAAASUVORK5CYII=",Xb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAABf4UlEQVR4nO2dCXwURfb4q2cmIZAgIKfc942CgOItwqJyeCG4uKugsIt4oIgiq66gizcgcq14/rw51PUWXQXBVURAFAQ5REREFBJBjgSSmen/51v0m3+lnZlMkplczPt8OjPp6a6urnr3e/XKUkkoDF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MGixknPK8vxvEX4lFpfzl53daXtyQWxQrEYfKCojHT94tMo6YaydOQFMnyXe0RcmbWKdirYRLN26zXHE+vGexoVcPEUk5mQTxmES+Vq4VcRw6kvt7uPcXKm1TdjvIqfSvgisvMpw7S2zwUheKmzPZXwe3PWB5YU35J+sKSdkLxGXYQLj8PMM5s6BbZemZXrGomFT1R+HR5+CBP9tOEUUqNJ1GICD+ycB+UoB36WJx6v0MgQaBG1atOwxPvwSPv2DZvb/Qo+o8dCqBtKZ/X5g/XU77jR56cr7gjKHPEDBGolGt7w3Z9CasWmd55uX8z7Ao+dNpBeISjcCIwTBvmmSvRw+VUm835+C2E/J7h4lEWgThPivjSMnIzhpp9rB2k2Xdls4Tri5GOr1AWhOJQL8+MHUsjB0u1ysM6Ccn7s7UILv1TtNGrg1jzpzgS6Wl1urQEakertlv2bJdzq0frC9ek6+zoQLxIBqB7t2kZGNwNVT3leLIvr3kqyIu5pDrQLuFgo7TEgRIpaUk48hRyVfUHrQcOCyHj2pq5bCWhlqLl7LLg/hJxpFMcn2DNHJrvU9EI5BIiEgScRFJvHmXSaZEHMmUtBtKpXVHKFVUIHmSccREOt5U6JEoQVJUvXkVpdhQgSiKByoQRfFABaIoHqhAFMUDFYiieKACURQPVCCK4oEKRFE8UIEoigcqEEXxQAWiKB6oQBTFAxWIonigAlEUD1QgiuKBCkRRPFCBKIoHKhBF8UAFoigeqEAUxQMViKJ4oAJRFA9UIIrigQpEUTxQgSiKB7FYtP0fUpRyIpfrJGJ694SitI2aWIrigQpEUTxQgSiKByoQRfFABaIoHqhAFMUDFYiieKACURQPVCCK4oEKRFE8+F/HlmZaTNWRSgAAAABJRU5ErkJggg==",$b="data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%20200%20200%27%3E%3Crect%20width%3D%27200%27%20height%3D%27200%27%20fill%3D%27%23FF6A00%27/%3E%3Cpath%20d%3D%27M%2062%2066%20L%2036%20100%20L%2062%20134%27%20fill%3D%27none%27%20stroke%3D%27%23FFFFFF%27%20stroke-width%3D%2716%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27/%3E%3Cpath%20d%3D%27M%20138%2066%20L%20164%20100%20L%20138%20134%27%20fill%3D%27none%27%20stroke%3D%27%23FFFFFF%27%20stroke-width%3D%2716%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27/%3E%3Crect%20x%3D%2782%27%20y%3D%2791%27%20width%3D%2736%27%20height%3D%2718%27%20rx%3D%279%27%20fill%3D%27%23FFFFFF%27/%3E%3C/svg%3E",em="data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%20200%20200%27%3E%3Cdefs%3E%3ClinearGradient%20id%3D%27g%27%20x1%3D%270%27%20y1%3D%270%27%20x2%3D%271%27%20y2%3D%271%27%3E%3Cstop%20offset%3D%270%27%20stop-color%3D%27%237A5CFF%27/%3E%3Cstop%20offset%3D%271%27%20stop-color%3D%27%234A6CF7%27/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect%20width%3D%27200%27%20height%3D%27200%27%20fill%3D%27url%28%23g%29%27/%3E%3Cpath%20fill%3D%27%23FFFFFF%27%20fill-rule%3D%27evenodd%27%20d%3D%27M100%2036%20L156%2068%20L156%20132%20L100%20164%20L44%20132%20L44%2068%20Z%20M100%2064%20C102.5%2086%20114%2097.5%20136%20100%20C114%20102.5%20102.5%20114%20100%20136%20C97.5%20114%2086%20102.5%2064%20100%20C86%2097.5%2097.5%2086%20100%2064%20Z%27/%3E%3C/svg%3E",tm="data:image/svg+xml;utf8,%3Csvg%20viewBox%3D%220%200%2024%2024%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M16.361%2010.26a.894.894%200%200%200-.558.47l-.072.148.001.207c0%20.193.004.217.059.353.076.193.152.312.291.448.24.238.51.3.872.205a.86.86%200%200%200%20.517-.436.752.752%200%200%200%20.08-.498c-.064-.453-.33-.782-.724-.897a1.06%201.06%200%200%200-.466%200zm-9.203.005c-.305.096-.533.32-.65.639a1.187%201.187%200%200%200-.06.52c.057.309.31.59.598.667.362.095.632.033.872-.205.14-.136.215-.255.291-.448.055-.136.059-.16.059-.353l.001-.207-.072-.148a.894.894%200%200%200-.565-.472%201.02%201.02%200%200%200-.474.007Zm4.184%202c-.131.071-.223.25-.195.383.031.143.157.288.353.407.105.063.112.072.117.136.004.038-.01.146-.029.243-.02.094-.036.194-.036.222.002.074.07.195.143.253.064.052.076.054.255.059.164.005.198.001.264-.03.169-.082.212-.234.15-.525-.052-.243-.042-.28.087-.355.137-.08.281-.219.324-.314a.365.365%200%200%200-.175-.48.394.394%200%200%200-.181-.033c-.126%200-.207.03-.355.124l-.085.053-.053-.032c-.219-.13-.259-.145-.391-.143a.396.396%200%200%200-.193.032zm.39-2.195c-.373.036-.475.05-.654.086-.291.06-.68.195-.951.328-.94.46-1.589%201.226-1.787%202.114-.04.176-.045.234-.045.53%200%20.294.005.357.043.524.264%201.16%201.332%202.017%202.714%202.173.3.033%201.596.033%201.896%200%201.11-.125%202.064-.727%202.493-1.571.114-.226.169-.372.22-.602.039-.167.044-.23.044-.523%200-.297-.005-.355-.045-.531-.288-1.29-1.539-2.304-3.072-2.497a6.873%206.873%200%200%200-.855-.031zm.645.937a3.283%203.283%200%200%201%201.44.514c.223.148.537.458.671.662.166.251.26.508.303.82.02.143.01.251-.043.482-.08.345-.332.705-.672.957a3.115%203.115%200%200%201-.689.348c-.382.122-.632.144-1.525.138-.582-.006-.686-.01-.853-.042-.57-.107-1.022-.334-1.35-.68-.264-.28-.385-.535-.45-.946-.03-.192.025-.509.137-.776.136-.326.488-.73.836-.963.403-.269.934-.46%201.422-.512.187-.02.586-.02.773-.002zm-5.503-11a1.653%201.653%200%200%200-.683.298C5.617.74%205.173%201.666%204.985%202.819c-.07.436-.119%201.04-.119%201.503%200%20.544.064%201.24.155%201.721.02.107.031.202.023.208a8.12%208.12%200%200%201-.187.152%205.324%205.324%200%200%200-.949%201.02%205.49%205.49%200%200%200-.94%202.339%206.625%206.625%200%200%200-.023%201.357c.091.78.325%201.438.727%202.04l.13.195-.037.064c-.269.452-.498%201.105-.605%201.732-.084.496-.095.629-.095%201.294%200%20.67.009.803.088%201.266.095.555.288%201.143.503%201.534.071.128.243.393.264.407.007.003-.014.067-.046.141a7.405%207.405%200%200%200-.548%201.873c-.062.417-.071.552-.071.991%200%20.56.031.832.148%201.279L3.42%2024h1.478l-.05-.091c-.297-.552-.325-1.575-.068-2.597.117-.472.25-.819.498-1.296l.148-.29v-.177c0-.165-.003-.184-.057-.293a.915.915%200%200%200-.194-.25%201.74%201.74%200%200%201-.385-.543c-.424-.92-.506-2.286-.208-3.451.124-.486.329-.918.544-1.154a.787.787%200%200%200%20.223-.531c0-.195-.07-.355-.224-.522a3.136%203.136%200%200%201-.817-1.729c-.14-.96.114-2.005.69-2.834.563-.814%201.353-1.336%202.237-1.475.199-.033.57-.028.776.01.226.04.367.028.512-.041.179-.085.268-.19.374-.431.093-.215.165-.333.36-.576.234-.29.46-.489.822-.729.413-.27.884-.467%201.352-.561.17-.035.25-.04.569-.04.319%200%20.398.005.569.04a4.07%204.07%200%200%201%201.914.997c.117.109.398.457.488.602.034.057.095.177.132.267.105.241.195.346.374.43.14.068.286.082.503.045.343-.058.607-.053.943.016%201.144.23%202.14%201.173%202.581%202.437.385%201.108.276%202.267-.296%203.153-.097.15-.193.27-.333.419-.301.322-.301.722-.001%201.053.493.539.801%201.866.708%203.036-.062.772-.26%201.463-.533%201.854a2.096%202.096%200%200%201-.224.258.916.916%200%200%200-.194.25c-.054.109-.057.128-.057.293v.178l.148.29c.248.476.38.823.498%201.295.253%201.008.231%202.01-.059%202.581a.845.845%200%200%200-.044.098c0%20.006.329.009.732.009h.73l.02-.074.036-.134c.019-.076.057-.3.088-.516.029-.217.029-1.016%200-1.258-.11-.875-.295-1.57-.597-2.226-.032-.074-.053-.138-.046-.141.008-.005.057-.074.108-.152.376-.569.607-1.284.724-2.228.031-.26.031-1.378%200-1.628-.083-.645-.182-1.082-.348-1.525a6.083%206.083%200%200%200-.329-.7l-.038-.064.131-.194c.402-.604.636-1.262.727-2.04a6.625%206.625%200%200%200-.024-1.358%205.512%205.512%200%200%200-.939-2.339%205.325%205.325%200%200%200-.95-1.02%208.097%208.097%200%200%201-.186-.152.692.692%200%200%201%20.023-.208c.208-1.087.201-2.443-.017-3.503-.19-.924-.535-1.658-.98-2.082-.354-.338-.716-.482-1.15-.455-.996.059-1.8%201.205-2.116%203.01a6.805%206.805%200%200%200-.097.726c0%20.036-.007.066-.015.066a.96.96%200%200%201-.149-.078A4.857%204.857%200%200%200%2012%203.03c-.832%200-1.687.243-2.456.698a.958.958%200%200%201-.148.078c-.008%200-.015-.03-.015-.066a6.71%206.71%200%200%200-.097-.725C8.997%201.392%208.337.319%207.46.048a2.096%202.096%200%200%200-.585-.041Zm.293%201.402c.248.197.523.759.682%201.388.03.113.06.244.069.292.007.047.026.152.041.233.067.365.098.76.102%201.24l.002.475-.12.175-.118.178h-.278c-.324%200-.646.041-.954.124l-.238.06c-.033.007-.038-.003-.057-.144a8.438%208.438%200%200%201%20.016-2.323c.124-.788.413-1.501.696-1.711.067-.05.079-.049.157.013zm9.825-.012c.17.126.358.46.498.888.28.854.36%202.028.212%203.145-.019.14-.024.151-.057.144l-.238-.06a3.693%203.693%200%200%200-.954-.124h-.278l-.119-.178-.119-.175.002-.474c.004-.669.066-1.19.214-1.772.157-.623.434-1.185.68-1.382.078-.062.09-.063.159-.012z%22/%3E%3C/svg%3E",rm={openai:Jb,anthropic:Yb,kimi:Xb,bailian:$b,zhipu:em,ollama:tm,deepseek:Zb},nm={kimi:"#000000",ollama:"#FFFFFF"};function Ao(e){return rm[e]}function vo(e){return nm[e]}const at=[{id:"openai",name:"OpenAI",browserMode:"browserAssistedApiKey",browserLabel:"登录",description:"OpenAI 模型与编码能力",homeUrl:"https://openai.com",apiKeyUrl:"https://platform.openai.com/api-keys",apiKeyPlaceholder:"sk-...",defaultBaseUrl:"https://api.openai.com/v1"},{id:"anthropic",name:"Anthropic",browserMode:"browserAssistedApiKey",browserLabel:"登录",description:"Claude 模型与编码能力",homeUrl:"https://www.anthropic.com",apiKeyUrl:"https://console.anthropic.com/settings/keys",apiKeyPlaceholder:"sk-ant-...",defaultBaseUrl:"https://api.anthropic.com"},{id:"kimi",name:"Kimi",browserMode:"browserAssistedApiKey",browserLabel:"登录",description:"Moonshot AI 模型服务",homeUrl:"https://www.moonshot.cn",apiKeyUrl:"https://platform.moonshot.cn/console/api-keys",apiKeyPlaceholder:"sk-...",defaultBaseUrl:"https://api.moonshot.cn/v1"},{id:"bailian",name:"百炼",browserMode:"browserAssistedApiKey",browserLabel:"登录",description:"阿里云百炼模型服务",homeUrl:"https://www.aliyun.com/product/bailian",apiKeyUrl:"https://bailian.console.aliyun.com/#/api-key",apiKeyPlaceholder:"sk-...",defaultBaseUrl:"https://dashscope.aliyuncs.com/compatible-mode/v1"},{id:"deepseek",name:"DeepSeek",browserMode:"connectUnsupported",browserLabel:"不支持登录",description:"DeepSeek 模型服务",homeUrl:"https://www.deepseek.com",apiKeyUrl:"https://platform.deepseek.com/api_keys",apiKeyPlaceholder:"sk-...",defaultBaseUrl:"https://api.deepseek.com/v1"},{id:"zhipu",name:"智谱 AI",browserMode:"browserAssistedApiKey",browserLabel:"登录",description:"智谱 AI / GLM 模型服务",homeUrl:"https://open.bigmodel.cn",apiKeyUrl:"https://open.bigmodel.cn/usercenter/apikeys",apiKeyPlaceholder:"id.secret-...",defaultBaseUrl:"https://open.bigmodel.cn/api/paas/v4"},{id:"ollama",name:"Ollama",browserMode:"connectUnsupported",browserLabel:"本地服务",description:"本地 Ollama 模型服务",homeUrl:"https://ollama.com",defaultBaseUrl:"http://localhost:11434/v1"},{id:"custom",name:"Custom",browserMode:"browserAssistedApiKey",browserLabel:"配置",description:"OpenAI / Anthropic 兼容的自定义模型服务",homeUrl:"https://undefineds.co",apiKeyPlaceholder:"sk-...",defaultBaseUrl:"https://example.com/v1"}],il=[{id:"keys",label:"API Keys",title:"API KEYS"}];if(at.map(e=>e.id).join(",")!==Hd.join(","))throw new Error("AI Connection provider UI is out of sync with the client catalog");function im(e){const t=e.solid.session.getSnapshot(),r=e.solid.pod,n=r?.status==="ready"?r:void 0,o=t.status==="authenticated"&&n!==void 0?am(om(zp({webId:t.webId,podBaseUrl:n.current.podUrl,authenticatedFetch:e.solid.session.fetch}),e.capabilities.aiClientCredentials),e.capabilities.aiConnectionsPodStore):null;let a="keys",s="openai",c,d="",p={},g={},A,I=0,M;const E=new Set,_=()=>E.forEach(S=>S()),R={client:o,openExternal:e.navigation.openExternal,clientConfigurationBridge:e.capabilities.aiClientConfiguration,get selectedSection(){return a},get selectedProvider(){return s},get selectedCredentialId(){return c},get searchQuery(){return d},get providerStates(){return p},get providerSummaries(){return g},get providerLoadError(){return A},selectSection(S){a!==S&&(a=S,_())},selectProvider(S,v){const V=S==="custom"?v:void 0;a==="provider"&&s===S&&c===V||(a="provider",s=S,c=V,_())},selectFirstUnconfiguredProvider(){const S=at.findIndex(X=>X.id===s),V=(S<0?at:[...at.slice(S+1),...at.slice(0,S+1)]).find(X=>p[X.id]==="unconfigured"&&X.id!==s)??at.find(X=>p[X.id]==="unconfigured")??at[0];V&&R.selectProvider(V.id)},setSearchQuery(S){d!==S&&(d=S,_())},setProviderState(S,v){if(p[S]===v)return;I+=1,p={...p,[S]:v};const V=g[S]?void 0:pm(S,v);V&&(g={...g,[S]:V}),_()},async loadProviders(){if(o)return M||(M=(async()=>{const S=I+1;I=S,A=void 0,_();try{const v=await o.listProviders();if(S!==I)return;g=Object.fromEntries(v.map(V=>[V.id,V])),p=Object.fromEntries(at.map(V=>[V.id,um(g[V.id])])),_()}catch(v){if(S!==I)return;A=ym(v),_()}finally{M=void 0}})(),M)},subscribe(S){return E.add(S),()=>E.delete(S)}};return R}function om(e,t){return{...e,async createGatewayKey({name:r}){if(!t)throw new Error("当前账号登录状态不支持创建客户端凭据。");const n=await t.create({name:r,webId:e.webId});try{return await e.createGatewayKey({name:r,apiKey:n.apiKey,credentialResource:n.resource})}catch(i){try{await t.revoke({...n,webId:e.webId})}catch{throw new Error("API Key 未能保存到 Pod,且账号凭据撤销失败。该凭据尚未应用到客户端。")}throw i}},async deleteGatewayKey(r){const n=(await e.listGatewayKeys()).find(i=>i.id===r);if(n?.kind==="client-credentials"){if(!t||!n.credentialResource)throw new Error("当前账号登录状态无法撤销此客户端凭据,Key 记录已保留。");const i=await e.revealGatewayKey(r);await t.revoke({apiKey:i,resource:n.credentialResource,webId:e.webId})}await e.deleteGatewayKey(r)}}}function am(e,t){if(!t)return e;const r=new Map,n=t.readCredentialSecret&&t.updateOAuthCredential?(o,a)=>{const s=JSON.stringify([o,a]),c=r.get(s);if(c)return c;const d=(async()=>{const g=(await t.listProviders()).find(R=>R.id===o)?.credentials.find(R=>R.id===a);if(!g)throw new Error("oauth_credential_not_found");const A=await t.readCredentialSecret(o,a),I=typeof A.refreshToken=="string"?A.refreshToken:void 0;if(!I)throw new Error("oauth_refresh_token_required");const M=await e.refreshOAuthCredential(o,a,I,g.version,g.offeringId,A.authorizationMethodId==="browser-oauth"?"authorizationCodeOAuth":void 0);if(M.status!=="completed"||!M.oauthCredential)throw new Error("oauth_refresh_failed");await t.updateOAuthCredential(o,a,g.version,M.oauthCredential);const{oauthCredential:E,..._}=M;return _})().finally(()=>{r.delete(s)});return r.set(s,d),d}:e.refreshOAuthCredential,i=async(o,a,s=!1)=>{let c=!1,d=await t.readCredentialSecret(o,a.id);const p=typeof d.expiresAt=="string"?d.expiresAt:a.expiresAt;if((a.authMode==="oauth"||a.authMode==="deviceCode")&&(s||p&&Date.parse(p)<=Date.now()+6e4)){if(!t.updateOAuthCredential)throw new Error("oauth_refresh_unavailable");await n(o,a.id,"",a.version);const A=(await t.listProviders()).find(I=>I.id===o)?.credentials.find(I=>I.id===a.id);if(!A)throw new Error("oauth_credential_not_found");c=!0,a=A,d=await t.readCredentialSecret(o,a.id)}return{credential:a,secret:d,didRefresh:c}};return{...e,listProviders:async()=>fm(await t.listProviders(),e.listAuthorizationMethods?await e.listAuthorizationMethods():[]),listModels:t.listModels?async()=>t.listModels():e.listModels,createApiKeyCredential:t.createApiKeyCredential?async(o,a)=>t.createApiKeyCredential(o,a):e.createApiKeyCredential,createLocalCredential:t.createLocalCredential?async(o,a)=>a.authorizationMethodId==="local-session-import"||!a.authorizationMethodId&&a.offeringId==="official-subscription"?e.createLocalCredential(o,a):t.createLocalCredential(o,a):e.createLocalCredential,updateProviderCredential:t.updateProviderCredential?async(o,a,s)=>t.updateProviderCredential(o,a,s):e.updateProviderCredential,deleteProviderCredential:t.deleteProviderCredential?async(o,a)=>t.deleteProviderCredential(o,a):e.deleteProviderCredential,pollDevice:t.saveOAuthCredential?async(o,a)=>{const s=await e.pollDevice(o,a);if(s.status!=="completed"||!s.oauthCredential)return s;const c=await t.saveOAuthCredential(o,s.oauthCredential),{oauthCredential:d,...p}=s;return{...p,credentialId:c?.id??s.credentialId}}:e.pollDevice,refreshOAuthCredential:n,quota:t.readCredentialSecret?async(o,a=!1,s)=>{const d=(await t.listProviders()).find(M=>M.id===o)?.credentials??[],p=s?.credentialId??s?.credentialIri,g=p?d.find(M=>M.id===p):d.find(M=>M.enabled&&(!s?.offeringId||M.offeringId===s.offeringId));if(!g)throw new Error("quota_credential_not_found");const{secret:A}=await i(o,g),I=aa(A,g.authMode);if(!I)throw new Error("credential_secret_unavailable");return e.quotaFromSecret(o,{credentialId:g.id,credentialIri:g.id,authMode:g.authMode==="deviceCode"||g.authMode==="oauth"?"deviceCodeOAuth":"apiKey",offeringId:g.offeringId,baseUrl:g.baseUrl,proxyUrl:g.proxyUrl,compatibility:g.compatibility,secret:I})}:e.quota,disconnect:async(o,a)=>!a||!t.deleteProviderCredential?e.disconnect(o,a):await t.deleteProviderCredential(o,a),testProviderCredential:t.readCredentialSecret?async(o,a)=>{let c=(await t.listProviders()).find(M=>M.id===o)?.credentials.find(M=>M.id===a.credentialId);if(!c)throw new Error("test_credential_not_found");const d=await i(o,c);c=d.credential;const{secret:p}=d,g=aa(p,c.authMode);if(!g)throw new Error("test_secret_missing");let A;try{A=await e.discoverModels(o,{credentialId:c.id,offeringId:c.offeringId,authMode:c.authMode==="deviceCode"||c.authMode==="oauth"?"deviceCodeOAuth":c.authMode==="local"?"local":"apiKey",secret:g,baseUrl:c.baseUrl,proxyUrl:c.proxyUrl,compatibility:c.compatibility})}catch(M){throw await t.markCredentialHealth?.(o,c.id,"invalid",c.version).catch(()=>{}),M}const I=await t.markCredentialHealth?.(o,c.id,"healthy",c.version);return{ok:!0,credentialId:c.id,...I?{credential:I}:{},modelCount:A.models.length,observedAt:A.observedAt}}:e.testProviderCredential,discoverModels:t.readCredentialSecret?async(o,a)=>{const d=(await t.listProviders()).find(_=>_.id===o)?.credentials.filter(_=>_.enabled&&(!a?.offeringId||_.offeringId===a.offeringId)&&(!a?.credentialId||_.id===a.credentialId))??[];if(d.length===0)throw new Error("models_credential_not_found");const p=_=>JSON.stringify([o,_.offeringId,(_.baseUrl??"").trim().replace(/\/+$/u,""),a?.compatibility??_.compatibility??"auto",o==="custom"?_.id:void 0]),g=new Map;for(const _ of[...d].sort((R,S)=>R.priority-S.priority)){const R=p(_),S=g.get(R)??[];S.push(_),g.set(R,S)}const A=await Promise.allSettled([...g.values()].map(async _=>{let R;for(const S of _)try{let v=await i(o,S);const V=()=>{const re=aa(v.secret,S.authMode);if(!re)throw new Error("models_secret_missing");return e.discoverModels(o,{credentialId:S.id,offeringId:S.offeringId,authMode:S.authMode==="deviceCode"||S.authMode==="oauth"?"deviceCodeOAuth":S.authMode==="local"?"local":"apiKey",secret:re,baseUrl:S.baseUrl,proxyUrl:S.proxyUrl,compatibility:a?.compatibility??S.compatibility})};let X;try{X=await V()}catch(re){if(v.didRefresh||!(re instanceof Wp)||re.code!=="provider_models_fetch_failed"||re.providerStatus!==401||S.authMode!=="oauth"&&S.authMode!=="deviceCode")throw re;v=await i(o,v.credential,!0),X=await V()}return{...X,credential:S.id,credentialVersion:v.credential.version,models:X.models.map(re=>({...re,offeringId:S.offeringId,...o==="custom"?{credentialId:S.id}:{}}))}}catch(v){R=v}throw R})),I=A.flatMap(_=>_.status==="fulfilled"?[_.value]:[]);if(I.length===0)throw A[0].reason;for(const _ of I)await t.markCredentialHealth?.(o,_.credential,"healthy",_.credentialVersion);const M=_=>`${_.offeringId}\0${_.credentialId??""}\0${("resourceId"in _?_.resourceId:void 0)??_.id}`;if(t.saveDiscoveredModels)try{const _=new Set([...g.values()].flatMap((S,v)=>A[v]?.status==="rejected"?[S[0].offeringId]:[])),R=new Map;for(const S of I){const v=d.find(re=>re.id===S.credential);if(o!=="custom"&&_.has(v.offeringId))continue;const V=o==="custom"?v.id:v.offeringId,X=R.get(V)??{credential:v.id,models:[]};X.models.push(...S.models),R.set(V,X)}for(const S of R.values())await t.saveDiscoveredModels(o,S.credential,[...new Map(S.models.map(v=>[M(v),v])).values()])}catch{throw new Error("models_persistence_failed")}const E=[...new Map(I.flatMap(_=>_.models).map(_=>[M(_),_])).values()];return{...I[0],models:E,complete:I.length===g.size}}:e.discoverModels,saveModelSelection:t.saveModelSelection?async(o,a,s)=>t.saveModelSelection(o,a,s):e.saveModelSelection}}function ol(e){return Q.useSyncExternalStore(e.subscribe,()=>e.selectedSection??"provider",()=>e.selectedSection??"provider")}function al(e){return Q.useSyncExternalStore(e.subscribe,()=>e.selectedProvider,()=>e.selectedProvider)}function Zf(e){return Q.useSyncExternalStore(e.subscribe,()=>e.selectedCredentialId,()=>e.selectedCredentialId)}function $f(e){return Q.useSyncExternalStore(e.subscribe,()=>e.searchQuery,()=>e.searchQuery)}function sm(e){return Q.useSyncExternalStore(e.subscribe,()=>e.providerStates,()=>e.providerStates)}function lm(e){return Q.useSyncExternalStore(e.subscribe,()=>fu(e.providerSummaries),()=>fu(e.providerSummaries))}function sl(e){return Q.useSyncExternalStore(e.subscribe,()=>e.providerSummaries,()=>e.providerSummaries)}function eh(e){return Q.useSyncExternalStore(e.subscribe,()=>e.providerLoadError,()=>e.providerLoadError)}function um(e){if(!e||e.status==="unconfigured"||e.status==="unavailable")return"unconfigured";if(e.status==="configured")return"configured";if(e.status==="attention")return"attention";const t=th(e);return t?.authMode==="oauth"||t?.authMode==="deviceCode"?"connected":"configured"}const du=new WeakMap;function fu(e){const t=du.get(e);if(t)return t;const r=Object.fromEntries(Object.values(e).filter(rh).map(n=>[n.id,cm(n)]));return du.set(e,r),r}function cm(e){const t=th(e),r=e.status==="available"?"connected":e.status==="attention"?"reauthRequired":"disconnected",n=t?.authMode;return{provider:e.id,status:r,authMode:n==="oauth"||n==="deviceCode"?"deviceCodeOAuth":n?"browserAssistedApiKey":void 0,accountLabel:t?.label,expiresAt:t?.expiresAt,reauthRequired:r==="reauthRequired"?!0:void 0,credentialIri:t?.id,version:t?.version,connect:{modes:dm(e),configured:e.status!=="unavailable"}}}function dm(e){const t=[...e.offerings.flatMap(r=>r.authModes??[]),...e.credentials.map(r=>r.authMode)].map(r=>r==="oauth"||r==="deviceCode"?"deviceCodeOAuth":r==="apiKey"||r==="local"?"browserAssistedApiKey":void 0).filter(rh);return t.length>0?[...new Set(t)]:["browserAssistedApiKey"]}function th(e){return e.credentials.find(t=>t.enabled)??e.credentials[0]}function fm(e,t){if(t.length===0)return e;const r=new Map(t.map(n=>[`${n.provider}:${n.offeringId}`,n]));return e.map(n=>({...n,offerings:n.offerings.map(i=>{const o=r.get(`${n.id}:${i.id}`);if(!o)return i;const a=o.authorizationMethods;return{...i,...o.endpoints?{endpoints:o.endpoints}:{},...a.length?{authorizationMethods:a,authModes:hm(i.authModes,a.map(s=>s.authMode))}:{}}})}))}function hm(e,t){return Array.from(new Set([...e??[],...t]))}function pm(e,t){if(t==="configured")return{id:e,name:oa(e),offerings:[],credentials:[hu(e,"apiKey")],selectedModels:[],status:"available"};if(t==="connected")return{id:e,name:oa(e),offerings:[],credentials:[hu(e,"deviceCode")],selectedModels:[],status:"available"};if(t!=="attention"&&t!=="loading")return{id:e,name:oa(e),offerings:[],credentials:[],selectedModels:[],status:"unconfigured"}}function hu(e,t){return{id:`${e}:current`,offeringId:t==="deviceCode"||t==="oauth"?"official-subscription":"api-platform",authMode:t,enabled:!0,priority:0,health:"healthy",version:0}}function oa(e){return at.find(t=>t.id===e)?.name??e}function aa(e,t){if(t==="deviceCode"||t==="oauth"){const n=typeof e.accessToken=="string"&&e.accessToken.trim()?e.accessToken:void 0;return n?{type:"oauth",accessToken:n}:void 0}if(t==="local")return{type:"local"};const r=typeof e.apiKey=="string"&&e.apiKey.trim()?e.apiKey:void 0;return r?{type:"apiKey",apiKey:r}:void 0}function rh(e){return e!==void 0}function ym(e){return Vd(e)}function gm({controller:e}){const t=Q.useContext(Qp),r=ol(e),n=al(e),i=Zf(e),o=$f(e).trim().toLocaleLowerCase(),a=sm(e),s=sl(e),c=eh(e),d=at.reduce((E,_)=>{if(_.id!=="custom")return[...E,{..._}];const R=s.custom?.credentials??[];return[...E,...R.map(S=>({..._,name:S.label||_.name,credentialId:S.id}))]},[]),p=o?d.filter(E=>sa(E,s).toLocaleLowerCase().includes(o)):d,g=[...il.map(E=>({kind:"section",id:E.id,label:E.label})),...p.map(E=>({kind:"provider",provider:E}))],A=Q.useRef([]),I=g.findIndex(E=>E.kind==="section"?r===E.id:r==="provider"&&E.provider.id===n&&E.provider.credentialId===i),M=E=>{E.kind==="section"?e.selectSection(E.id):e.selectProvider(E.provider.id,E.provider.credentialId),t?.mode==="stack"&&t.openMain()};return y.jsxs("div",{role:"listbox","aria-label":"AI 服务","aria-orientation":"vertical",className:"py-2",children:[y.jsx("section",{className:"mb-3","aria-label":"API Keys",children:g.filter(E=>E.kind==="section").map(E=>{const _=g.indexOf(E);return y.jsxs(pu,{index:_,selected:r===E.id,tabbable:I===_||I<0&&_===0,label:E.label,optionRefs:A,onActivate:()=>M(E),onMove:R=>yu(g,R,e,A),children:[y.jsx(bm,{section:E.id}),y.jsx("span",{className:Ue("min-w-0 flex-1 truncate text-sm font-medium",r===E.id?"text-foreground":"text-foreground/80"),children:E.label})]},E.id)})}),y.jsxs("section",{children:[y.jsx("h2",{className:"px-5 py-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Provider"}),p.map(E=>{const _=g.findIndex(v=>v.kind==="provider"&&v.provider.id===E.id&&v.provider.credentialId===E.credentialId),R=r==="provider"&&n===E.id&&E.credentialId===i,S=a[E.id]??"loading";return y.jsxs(pu,{index:_,selected:R,tabbable:R||I<0&&_===0,label:sa(E,s),describedBy:`ai-connections-provider-${E.id}-${E.credentialId??"default"}-status`,optionRefs:A,onActivate:()=>M({kind:"provider",provider:E}),onMove:v=>yu(g,v,e,A),children:[y.jsxs(Bd,{className:"h-9 w-9 shrink-0 rounded-md border border-border/20",style:vo(E.id)?{backgroundColor:vo(E.id)}:void 0,children:[y.jsx(qd,{src:Ao(E.id),className:"object-cover"}),y.jsx(Kd,{className:"rounded-md bg-muted text-[10px] font-bold uppercase text-muted-foreground",children:wm(E.id)})]}),y.jsx("span",{className:Ue("min-w-0 flex-1 truncate text-sm font-medium",R?"text-foreground":"text-foreground/80"),children:sa(E,s)}),y.jsx(mm,{state:S,statusId:`ai-connections-provider-${E.id}-${E.credentialId??"default"}-status`})]},`${E.id}:${E.credentialId??"default"}`)}),p.length===0?y.jsx("p",{className:"p-8 text-center text-xs text-muted-foreground",children:"无结果"}):null]}),c?y.jsxs("p",{className:"px-4 py-2 text-xs text-destructive",children:["Provider 状态读取失败:",c]}):null]})}function pu({index:e,selected:t,tabbable:r,label:n,describedBy:i,statusId:o,optionRefs:a,onActivate:s,onMove:c,children:d}){const p=g=>{if(g.key==="ArrowDown")c(e+1);else if(g.key==="ArrowUp")c(e-1);else if(g.key==="Home")c(0);else if(g.key==="End")c(Number.POSITIVE_INFINITY);else if(g.key==="Enter"||g.key===" "){g.preventDefault(),s();return}else return;g.preventDefault()};return y.jsx("button",{ref:g=>{a.current[e]=g},type:"button",role:"option","aria-selected":t,"aria-label":n,"aria-describedby":i??o,tabIndex:r?0:-1,onClick:s,onKeyDown:p,className:Ue("group flex w-full items-center gap-3 border-l-[3px] border-transparent px-4 py-3 text-left transition-colors",t?"border-l-primary bg-accent/80":"hover:bg-muted/40"),children:d})}function yu(e,t,r,n){const i=Math.min(Math.max(t,0),e.length-1),o=e[i];o&&(o.kind==="section"?r.selectSection(o.id):r.selectProvider(o.provider.id,o.provider.credentialId),n.current[i]?.focus())}function bm({section:e}){return y.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-border/20 bg-muted text-muted-foreground",children:y.jsx(_o,{className:"h-4 w-4","aria-hidden":"true"})})}function mm({state:e,statusId:t}){const r=e==="configured"||e==="connected";return y.jsxs("span",{id:t,role:"status","aria-live":"polite",className:"flex shrink-0 items-center gap-1.5",children:[r?y.jsx("span",{className:"h-2 w-2 rounded-full bg-primary","aria-hidden":"true"}):null,y.jsx("span",{className:"text-[11px] font-normal text-muted-foreground",children:_m(e)})]})}function wm(e){switch(e){case"openai":return"OA";case"anthropic":return"A";case"kimi":return"K";case"bailian":return"百";case"deepseek":return"DS";case"zhipu":return"智";case"ollama":return"O";case"custom":return"C"}}function sa(e,t){return e.name||t[e.id]?.name||e.id}function _m(e){switch(e){case"unconfigured":return"未设置";case"configured":return"已配置";case"connected":return"已连接";case"attention":return"需处理";default:return"读取中"}}const Am={"official-subscription":"账号订阅","subscription-key":"Token 套餐","api-platform":"API 平台","pay-as-you-go":"按量付费","token-plan":"Token 套餐","token-plan-team":"Token 套餐(团队版)","coding-plan":"Coding 套餐",local:"本地服务","openai-compatible":"OpenAI 兼容","anthropic-compatible":"Anthropic 兼容"},vm=/[一-鿿]/u;function $e(e){const t=e.label?.trim();return t&&vm.test(t)?t:Am[e.id]??t??Sm(e)}function Sm(e){return e.kind==="oauth-subscription"?"账号订阅":e.kind==="api-platform"?"API 平台":e.kind==="token-plan"?"Token 套餐":e.label?e.label:e.authModes?.some(t=>t==="oauth"||t==="deviceCode")?"账号登录":e.authModes?.some(t=>t==="apiKey")?"API Key":e.id}function Em({providerName:e,offeringName:t,quota:r,busy:n,disabled:i=!1,credentialLabel:o,multiple:a=!1,compact:s=!1,paused:c=!1,error:d,onRefresh:p}){if(s){const g=!n&&!d&&r?.status==="available";return y.jsx("div",{className:`min-w-0 text-xs text-muted-foreground ${c?"opacity-60":""}`,children:y.jsxs("div",{className:"flex items-start gap-1",children:[y.jsxs("div",{className:"min-w-0 flex-1 truncate py-1 [&>span+span]:ml-3",children:[c?y.jsx("span",{children:"已停用 · 不参与全部刷新"}):null,n?y.jsx("span",{role:"status",children:"正在查询额度…"}):d?y.jsx("span",{role:"alert",title:d,className:"text-destructive",children:d}):r?r.status==="unsupported"?y.jsx("span",{children:"官方额度接口不支持"}):r.status==="error"?y.jsx("span",{role:"alert",className:"text-destructive",children:"额度查询失败"}):y.jsx(gu,{quota:r}):y.jsx("span",{children:o?"尚未检查":`连接${t}后可查询`}),g&&r.stale?y.jsx("span",{children:"数据可能已过期"}):null]}),y.jsx(xm,{quota:r,label:o??t}),y.jsx(Ae,{className:"h-6 w-6 shrink-0 p-0",variant:"ghost",size:"sm","aria-label":`刷新 ${e} ${t}${o?` ${o}`:""}额度`,disabled:n||i,onClick:p,children:n?y.jsx(Bt,{"aria-hidden":"true",className:"h-3 w-3 animate-spin"}):y.jsx(cu,{"aria-hidden":"true",className:"h-3 w-3"})})]})})}return y.jsxs("div",{className:`${a?"space-y-1.5":"space-y-3"} border-t border-border/40 pt-3 ${c?"opacity-60":""}`,children:[y.jsxs("div",{className:"flex items-center justify-between gap-2",children:[y.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a?null:y.jsx(Gb,{className:"h-4 w-4 shrink-0 text-primary"}),y.jsxs("div",{className:"min-w-0",children:[y.jsx("div",{className:"break-all text-sm font-medium text-foreground/90",children:a?`凭证:${o}`:"剩余额度"}),a&&!n&&!d&&r?.status==="available"?y.jsx("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground",children:y.jsx(gu,{quota:r})}):null]})]}),y.jsxs(Ae,{className:"shrink-0",variant:"ghost",size:"sm","aria-label":`刷新 ${e} ${t}${a?` ${o}`:""}额度`,disabled:n||i,onClick:p,children:[n?y.jsx(Bt,{"aria-hidden":"true",className:"mr-2 h-3.5 w-3.5 animate-spin"}):y.jsx(cu,{"aria-hidden":"true",className:"mr-2 h-3.5 w-3.5"}),n?"查询中":"刷新"]})]}),o&&!a?y.jsxs("p",{className:"text-xs text-muted-foreground",children:["凭证:",o]}):null,c?y.jsx("p",{className:"text-xs text-muted-foreground",children:"已停用 · 不参与全部刷新"}):null,n?y.jsx("p",{role:"status",className:"text-xs text-muted-foreground",children:"正在查询额度…"}):d?y.jsx("p",{role:"alert",className:"text-sm text-destructive",children:d}):r?r.status==="unsupported"?y.jsxs(y.Fragment,{children:[y.jsx("p",{className:"text-sm",children:"官方额度接口不支持"}),y.jsxs("p",{className:"text-xs text-muted-foreground",children:["来源:",r.source]})]}):r.status==="error"?y.jsx("p",{className:"text-sm text-destructive",children:"额度查询失败"}):a?y.jsxs("details",{className:"text-xs text-muted-foreground",children:[y.jsx("summary",{className:"cursor-pointer","aria-label":`${o}额度详情`,children:"详情"}),y.jsx("div",{className:"pt-3",children:y.jsx(Cs,{quota:r,hideBalance:!0})})]}):y.jsx(Cs,{quota:r}):y.jsx("p",{className:"text-xs text-muted-foreground",children:o?"尚未检查":`连接${t}后可查询`})]})}function xm({quota:e,label:t}){const[r,n]=Q.useState({left:16,top:16,maxHeight:400}),[i,o]=Q.useState(!1),a=Q.useRef(null),s=Q.useRef(null),c=Q.useRef(!1);return Q.useEffect(()=>{if(!i)return;const d=g=>{!(g.target instanceof Node)||a.current?.contains(g.target)||s.current?.contains(g.target)||(c.current=!0,o(!1))},p=g=>{g.type==="scroll"&&g.target instanceof Node&&s.current?.contains(g.target)||(c.current=!0,o(!1))};return document.addEventListener("pointerdown",d,!0),document.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{document.removeEventListener("pointerdown",d,!0),document.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[i]),y.jsxs(Ei,{modal:!1,open:i,onOpenChange:d=>{c.current=!1,o(d)},children:[y.jsx(Ay,{asChild:!0,children:y.jsx(Ae,{ref:a,className:"h-6 w-6 shrink-0 p-0",variant:"ghost",size:"sm","aria-label":`${t}额度详情`,disabled:!e||e.status==="error",onClick:d=>{const p=d.currentTarget.getBoundingClientRect(),g=Math.min(320,window.innerWidth-32),A=Math.max(16,Math.min(p.right-g,window.innerWidth-g-16)),I=Math.max(16,Math.min(p.bottom+8,window.innerHeight-320));n({left:A,top:I,maxHeight:window.innerHeight-I-16})},children:y.jsx(Jf,{"aria-hidden":"true",className:"h-3 w-3"})})}),y.jsxs(wn,{ref:s,className:"w-[calc(100vw-2rem)] max-w-xs overflow-y-auto p-4",onEscapeKeyDown:()=>a.current?.focus(),onCloseAutoFocus:d=>{c.current&&d.preventDefault()},style:{...r,transform:"none",animation:"none"},"aria-describedby":void 0,children:[y.jsx(_n,{className:"pr-8 text-sm",children:"额度详情"}),e?.status==="available"?y.jsx(Cs,{quota:e}):e?y.jsxs("p",{className:"break-words text-xs text-muted-foreground",children:["来源:",e.source]}):null]})]})}function gu({quota:e}){return y.jsxs(y.Fragment,{children:[typeof e.balance=="number"?y.jsxs("span",{children:["余额:",e.balance]}):null,e.windows.map((t,r)=>y.jsxs("span",{children:[Ms(t.name)," · ",nh(t)]},r)),typeof e.balance!="number"&&e.windows.length===0?y.jsx("span",{children:"服务商未返回额度数据"}):null]})}function Cs({quota:e,hideBalance:t=!1}){return y.jsxs("div",{className:"space-y-3 text-sm",children:[!t&&typeof e.balance=="number"?y.jsxs("div",{children:["余额:",e.balance]}):null,e.windows.map((r,n)=>y.jsxs("div",{className:"space-y-1.5",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsx("span",{className:"font-medium text-foreground",children:Ms(r.name)}),y.jsx("span",{className:"text-muted-foreground",children:nh(r)})]}),ri(r)!==void 0?y.jsx("div",{"aria-label":`${Ms(r.name)}剩余 ${String(ri(r))}%`,className:"h-1.5 overflow-hidden rounded-full bg-muted",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":ri(r),children:y.jsx("div",{className:"h-full rounded-full bg-primary",style:{width:`${String(ri(r))}%`}})}):null,r.resetsAt?y.jsxs("p",{className:"text-xs text-muted-foreground",children:["重置:",bu(r.resetsAt)]}):null]},`${String(r.name)}-${n}`)),y.jsxs("p",{className:"text-xs text-muted-foreground",children:["更新:",bu(e.observedAt)]}),y.jsxs("p",{className:"break-words text-xs text-muted-foreground",children:["来源:",e.source,e.stale?" · 数据可能已过期":""]})]})}function Ms(e){switch(e){case"five-hour":return"5 小时限制";case"weekly":return"周限制";case"monthly":return"月限制";case"weekly-opus":return"Opus 周限制";case"weekly-sonnet":return"Sonnet 周限制";case"available_balance":return"可用余额";case"voucher_balance":return"赠送余额";case"cash_balance":return"现金余额";default:return typeof e=="string"&&e?e:"额度"}}function ri(e){if(!(typeof e.remaining!="number"||typeof e.limit!="number"||e.limit<=0))return Math.max(0,Math.min(100,Math.round(e.remaining/e.limit*1e4)/100))}function nh(e){const t=ri(e);if(t!==void 0)return`剩余 ${String(t)}%`;if(typeof e.remaining=="number"){const r=typeof e.currency=="string"?` ${e.currency}`:"";return`剩余 ${String(e.remaining)}${r}`}return"官方数据可用"}function bu(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function Im({definition:e,product:t,status:r,accountLabel:n,attempt:i,attemptOfferingId:o,apiKey:a,baseUrl:s="",busy:c,disabled:d=!1,error:p,suppressError:g=!1,quotas:A={},onApiKeyChange:I,onBaseUrlChange:M,onBeginApiKey:E,onBeginOffering:_,onCancelConnect:R,onBeginBrowser:S,onSaveApiKey:v,onDisconnect:V,onCreateApiKeyCredential:X,onCreateLocalCredential:re,onUpdateCredential:ie,onDeleteCredential:G,onTestCredential:fe,onReorderCredentials:T,onRefreshQuota:k,onDismissError:H}){const x=[{id:"api-platform",label:"API Key",kind:"api-platform",authModes:["apiKey"]}],$=t?.credentials??[],oe=t?.offerings.length?t.offerings:x,[ae,he]=Q.useState(),[B,le]=Q.useState(!1),[b,z]=Q.useState(),[ne,L]=Q.useState(),[se,ce]=Q.useState(!1),Y=Q.useRef(i),te=oe.filter(l=>rn(l).some(f=>f.lifecycle==="active"&&mu(f))),C=Zi(i)&&qr(i?.mode),O=B||!!ae||!!b,Z=()=>{le(!1),z(void 0),he(void 0),L(void 0)};Q.useEffect(()=>{const l=Y.current;Y.current=i,O&&i!==l&&i?.status==="completed"&&Z()},[i,O]);const ue=[...$].sort((l,f)=>l.priority-f.priority),j=$.some(l=>A[l.id]?.busy);return y.jsx(pf,{children:y.jsxs("section",{className:"space-y-3","aria-label":"当前连接",children:[y.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[y.jsxs("h3",{className:"flex items-center gap-2 text-sm font-medium text-foreground/90",children:[y.jsx(zb,{className:"h-4 w-4 text-primary"}),"当前连接"]}),y.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[$.length>1?y.jsx(Ae,{variant:"ghost",size:"sm","aria-label":`刷新全部 ${e.name}额度`,disabled:d||j||!$.some(l=>l.enabled)||!k,onClick:()=>oe.forEach(l=>k?.(l)),children:j?"查询中":"刷新全部额度"}):null,oe.map(l=>{const f=rn(l).filter(w=>w.lifecycle==="active"&&(la(w)||Ds(w)));return f.length?y.jsx("div",{role:"group","aria-label":`${$e(l)}快捷接入`,children:y.jsx(Cm,{methods:f,offering:l,hasCredentials:$.some(w=>w.offeringId===l.id),busy:c||se,disabled:d||C,onBeginOffering:_?(w,P,N)=>{L(void 0),H?.(),z(w.id),_(w,P,N)}:void 0,onCreateLocalCredential:re?async(w,P)=>{ce(!0),L(void 0),H?.();try{await re(w,P)}catch(N){L(N instanceof Error?N.message:"连接失败,请重试")}finally{ce(!1)}}:void 0})},l.id):null}),te.length>0&&!oe.some(l=>rn(l).some(f=>f.lifecycle==="active"&&(la(f)||Ds(f))))&&e.browserMode==="browserAssistedApiKey"?y.jsxs(Ae,{variant:"outline",size:"sm",className:"h-8 gap-1.5 text-xs","aria-label":`${e.name} 登录`,disabled:c||se||d||C,onClick:()=>{L(void 0),H?.(),S()},children:[y.jsx(Uo,{className:"h-3.5 w-3.5"}),e.browserLabel]}):null,te.length>0?y.jsxs(Ae,{variant:"outline",size:"sm",className:"h-8 gap-1.5 text-xs","aria-label":"新建 API Key 连接",disabled:c||se||d||C||!t&&r==="pending"&&!i,onClick:()=>{L(void 0),H?.(),le(!0)},children:[y.jsx(ji,{className:"h-3.5 w-3.5"}),"API Key"]}):null]})]}),y.jsxs("div",{"aria-label":"凭据列表",className:"space-y-2",children:[y.jsx(Rm,{credentials:ue,disabled:c||d,onMove:T?(l,f)=>{const w=oe.find(P=>P.id===ue[l]?.offeringId);w&&T(w,ue,l,f)}:void 0,children:(l,f)=>{const w=oe.find(m=>m.id===l.offeringId);if(!w)return null;const P=l.authMode==="apiKey"?an(l):l.label?wu(l.label):an(l),N=A[l.id],q=N?.credentialId===l.id?N:void 0;return y.jsx(Nm,{credential:l,label:P,dragHandle:f,kindLabel:l.authMode==="apiKey"?"API Key":$e(w),busy:c,disabled:d,onToggle:ie,onTest:fe,onEdit:l.authMode==="apiKey"?()=>he(l):void 0,onDelete:()=>l.authMode==="apiKey"?G?.(l):V(l),deleteAriaLabel:l.authMode==="apiKey"?`删除 ${P}`:`${P} 移除`,quota:y.jsx(Em,{compact:!0,providerName:e.name,offeringName:$e(w),credentialLabel:an(l),multiple:$.length>1,quota:q?.quota,busy:q?.busy??!1,error:q?.error,paused:!l.enabled,disabled:d||!k,onRefresh:()=>k?.(w,l)})})}}),$.length?null:y.jsx("p",{className:"py-2 text-xs text-muted-foreground",children:n?wu(n):"尚未添加连接"}),$.length===0&&(r==="configured"||r==="connected")?y.jsx(Ae,{variant:"ghost",size:"sm",disabled:c||d,onClick:()=>V(),children:r==="configured"?"移除配置":"断开连接"}):null]}),y.jsx(Ei,{open:O,onOpenChange:l=>{l||se||(i&&Zi(i)&&qr(i.mode)&&R?.({mode:i.mode,attemptId:i.attemptId,state:i.state,signature:i.signature,...i.offeringId?{offeringId:i.offeringId}:{}}),Z())},children:y.jsxs(wn,{className:"max-h-[85vh] overflow-y-auto sm:max-w-lg","aria-describedby":void 0,children:[y.jsx(xi,{children:y.jsx(_n,{children:ae?"编辑连接":b?"连接账号":"新建连接"})}),y.jsx("div",{className:"space-y-5","aria-label":"添加连接",children:(ae||b?oe.filter(l=>l.id===(ae?.offeringId??b)):te).map(l=>{const f=Zi(i)&&qr(i?.mode)&&(o??i?.offeringId)!==l.id,w=d||se||f,P=rn(l),N=P.filter(pe=>pe.lifecycle==="active"),q=N.some(mu),m=o===l.id?i:void 0,U=p?.offeringId===l.id?p.authorization:void 0,J=P.find(pe=>pe.id===(U?.authorizationMethodId??m?.authorizationMethodId))??N.find(la),K=U?.mode??m?.mode??(J?Bo(J):Um(l,e)),de=p?.offeringId===l.id?p.message:void 0;if(l.lifecycle==="unavailable"&&N.length===0)return y.jsxs("fieldset",{"data-create-offering":l.id,className:"space-y-2 border-t border-border/50 pt-3 first:border-t-0 first:pt-0",children:[y.jsx("legend",{className:"px-1 text-sm font-medium",children:$e(l)}),y.jsx("p",{className:"text-xs text-muted-foreground",children:l.kind==="oauth-subscription"?"暂不可用:账号订阅需在 Xpod 桌面版中导入本机客户端(如 Codex CLI)的登录态,浏览器中无法完成。":"暂不可用:该接入方式尚未提供可用的连接流程。"})]},l.id);const me=U?.mode;return de&&qr(me)?y.jsxs("fieldset",{"data-create-offering":l.id,disabled:w,className:"space-y-3 border-t border-border/50 pt-3 first:border-t-0 first:pt-0","aria-label":`${$e(l)}接入操作`,children:[y.jsx("legend",{className:"px-1 text-sm font-medium",children:$e(l)}),m?.status==="unsupported"?y.jsx("p",{className:"text-sm",children:"当前部署未启用账号授权"}):y.jsx(jp,{title:"登录未完成",description:de,primaryLabel:"重试登录",onPrimary:()=>_?.(l,me,J),secondaryLabel:"关闭",onSecondary:()=>{H?.(),Z()}})]},l.id):Zi(m)&&qr(K)?y.jsxs("fieldset",{"data-create-offering":l.id,disabled:w,className:"space-y-3 border-t border-border/50 pt-3 first:border-t-0 first:pt-0","aria-label":`${$e(l)}接入操作`,children:[y.jsx("legend",{className:"px-1 text-sm font-medium",children:$e(l)}),y.jsx(ru,{title:"正在连接",detail:K==="authorizationCodeOAuth"?"等待网页授权,请在打开的页面完成登录。":m?.userCode?`验证码:${m.userCode}`:"请在打开的页面完成授权。",providerLabel:J?.label??$e(l),providerHost:e.name}),y.jsx(Ae,{variant:"ghost",size:"sm",disabled:d,onClick:()=>{m&&R?.({mode:m.mode,attemptId:m.attemptId,state:m.state,signature:m.signature,...m.offeringId?{offeringId:m.offeringId}:{}}),Z()},children:"取消连接"})]},l.id):y.jsxs("fieldset",{"data-create-offering":l.id,disabled:w,className:"space-y-3 border-t border-border/50 pt-3 first:border-t-0 first:pt-0","aria-label":`${$e(l)}接入操作`,children:[y.jsx("legend",{className:"px-1 text-sm font-medium",children:$e(l)}),q?y.jsx(jm,{definition:e,offering:l,status:r,createOfferings:[l],initialCreate:!ae,credentials:$,initialEditing:ae?.offeringId===l.id?ae:void 0,onCloseEdit:Z,onSavingChange:ce,attempt:m??(i?.mode==="browserAssistedApiKey"?i:void 0),apiKey:a,baseUrl:s,busy:c,disabled:w,onApiKeyChange:I,onBaseUrlChange:M,onBeginApiKey:E,onBeginBrowser:S,onSaveApiKey:v,onDisconnect:V,onUpdateCredential:ie,onCreateApiKeyCredential:X},`${l.id}:${ae?.id??""}`):null,b&&!de?y.jsx(ru,{title:"正在连接",detail:"正在启动授权,请稍候。",providerLabel:$e(l),providerHost:e.name}):null,de?y.jsx("p",{className:"w-full text-sm text-destructive",children:de}):null]},l.id)})}),ne?y.jsx("p",{role:"alert",className:"text-sm text-destructive",children:ne}):null]})}),y.jsxs("details",{className:"text-xs text-muted-foreground",children:[y.jsx("summary",{className:"w-fit cursor-pointer",children:"接入信息"}),y.jsx("div",{className:"mt-2 space-y-3",children:oe.map(l=>y.jsx(Mm,{offering:l},l.id))})]}),ne&&!O&&ne!==p?.message?y.jsx("p",{role:"alert",className:"text-sm text-destructive",children:ne}):null,p&&(p.offeringId?!O:!g)?y.jsx("p",{role:"alert",className:"text-sm text-destructive",children:p.message}):null]})})}function Rm({credentials:e,disabled:t,onMove:r,children:n}){const i=Q.useRef(null),o=Q.useRef(null),a=Q.useRef(void 0),s=Q.useRef(void 0),c=Q.useRef(null),d=Q.useRef(void 0),p=Q.useRef(t),[g,A]=Q.useState(""),I=t||!r||e.length<2,M=e.map(re=>re.id).join("\0"),E=()=>Array.from(i.current?.querySelectorAll("[data-sortable-credential]")??[]),_=()=>{a.current!==void 0&&cancelAnimationFrame(a.current),s.current!==void 0&&clearTimeout(s.current),a.current=void 0,s.current=void 0;for(const re of E()){for(const ie of["transform","transition","zIndex","position","boxShadow","willChange","backgroundColor"])re.style[ie]="";delete re.dataset.dragging}},R=()=>{const re=c.current;if(!re)return;c.current=null,_();const ie=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1,G=E();for(const fe of G){const T=re.get(fe.dataset.sortableCredential);if(!T||ie)continue;const k=fe.getBoundingClientRect();fe.style.transition="none",fe.style.transform=`translateY(${T.top-k.top}px)`}i.current?.getBoundingClientRect(),a.current=requestAnimationFrame(()=>{a.current=void 0;for(const fe of G)fe.style.transition=ie?"none":"transform 160ms ease-out, box-shadow 160ms ease-out",fe.style.transform="translateY(0px)";s.current=setTimeout(_,ie?0:180)})},S=re=>{const ie=o.current;if(ie){if(a.current!==void 0&&cancelAnimationFrame(a.current),c.current=new Map(ie.rows.map(G=>[G.dataset.sortableCredential,G.getBoundingClientRect()])),d.current=M,re&&ie.from!==ie.to&&!I){const G=ie.rects[ie.from],fe=ie.rects[ie.to],T=Math.max(0,ie.rects[1].top-ie.rects[0].bottom),k=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1;ie.rows.forEach((H,x)=>{const $=x===ie.from?ie.from<ie.to?fe.bottom-G.bottom:fe.top-G.top:ie.from<x&&x<=ie.to?-(G.height+T):ie.to<=x&&x<ie.from?G.height+T:0;H.style.transition=k?"none":"transform 160ms ease-out",H.style.transform=`translateY(${$}px)`;const oe=ie.rects[x];c.current.set(H.dataset.sortableCredential,{...oe,top:oe.top+$,bottom:oe.bottom+$})})}o.current=null,ie.handle.hasPointerCapture?.(ie.pointerId)&&ie.handle.releasePointerCapture?.(ie.pointerId),re&&!I&&e[ie.from]?.id===ie.id&&v(ie.from,ie.to),a.current=requestAnimationFrame(()=>{a.current=void 0,(!re||!p.current)&&R()}),s.current=setTimeout(R,1e4)}},v=(re,ie)=>{I||re===ie||ie<0||ie>=e.length||(r?.(re,ie),A(`已请求将${an(e[re])}移至第 ${ie+1} 位`))},V=Q.useRef({finish:S,settle:R,clearMotion:_});Q.useLayoutEffect(()=>{V.current={finish:S,settle:R,clearMotion:_},p.current=t}),Q.useLayoutEffect(()=>{o.current&&V.current.finish(!1),c.current&&(d.current!==M||!t)&&V.current.settle()},[M,I,t]),Q.useEffect(()=>()=>{const re=o.current;o.current=null,c.current=null,re?.handle.hasPointerCapture?.(re.pointerId)&&re.handle.releasePointerCapture?.(re.pointerId),V.current.clearMotion()},[]);const X=()=>{a.current=void 0;const re=o.current;if(!re)return;const ie=re.rects[re.from],G=re.rects.length>1?Math.max(0,re.rects[1].top-re.rects[0].bottom):0;re.rows.forEach((fe,T)=>{const k=T===re.from?re.y-re.startY:re.from<T&&T<=re.to?-(ie.height+G):re.to<=T&&T<re.from?ie.height+G:0;fe.style.transform=`translateY(${k}px)`})};return y.jsxs("div",{ref:i,className:"space-y-2",children:[y.jsx("span",{className:"sr-only",role:"status",children:g}),e.map((re,ie)=>y.jsx("div",{"data-sortable-credential":re.id,className:"rounded-lg",children:n(re,r?y.jsx("button",{type:"button",disabled:I,"aria-label":`拖动排序 ${an(re)}`,title:e.length<2?"至少添加两条连接后可拖动排序":"拖动调整优先级,或使用方向键、Home / End 排序",className:"flex h-8 w-6 shrink-0 touch-none select-none items-center justify-center rounded text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:opacity-40 enabled:cursor-grab active:cursor-grabbing",onKeyDown:G=>{if(G.key==="Escape"){S(!1);return}const fe=G.key==="ArrowUp"?ie-1:G.key==="ArrowDown"?ie+1:G.key==="Home"?0:G.key==="End"?e.length-1:void 0;fe!==void 0&&(G.preventDefault(),v(ie,fe))},onPointerDown:G=>{if(I||G.button!==0||o.current)return;G.preventDefault(),c.current=null,_(),G.currentTarget.focus(),G.currentTarget.setPointerCapture?.(G.pointerId);const fe=E(),T=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1;o.current={id:re.id,from:ie,to:ie,pointerId:G.pointerId,startY:G.clientY,y:G.clientY,handle:G.currentTarget,rows:fe,rects:fe.map(k=>k.getBoundingClientRect())};for(const[k,H]of fe.entries())H.style.willChange="transform",H.style.transition=T||k===ie?"none":"transform 160ms ease-out",k===ie&&(H.dataset.dragging="true",H.style.position="relative",H.style.zIndex="10",H.style.boxShadow="0 8px 24px rgb(0 0 0 / 0.18)",H.style.backgroundColor="hsl(var(--card))")},onPointerMove:G=>{const fe=o.current;if(!fe||fe.pointerId!==G.pointerId||I)return;fe.y=G.clientY;let T=1/0;fe.rects.forEach((k,H)=>{const x=Math.abs(G.clientY-(k.top+k.bottom)/2);x<T&&(T=x,fe.to=H)}),a.current===void 0&&(a.current=requestAnimationFrame(X))},onPointerUp:G=>{o.current?.pointerId===G.pointerId&&S(!0)},onPointerCancel:G=>{o.current?.pointerId===G.pointerId&&S(!1)},onLostPointerCapture:G=>{o.current?.pointerId===G.pointerId&&S(!1)},children:y.jsx(_b,{"aria-hidden":"true",className:"h-4 w-4"})}):null)},re.id))]})}function Cm({methods:e,offering:t,hasCredentials:r,busy:n,disabled:i,onBeginOffering:o,onCreateLocalCredential:a}){return e.length===0?null:y.jsx("div",{className:"space-y-2",children:y.jsx("div",{className:"flex flex-wrap gap-2",children:e.map(s=>{const c=Bo(s);return qr(c)?y.jsxs(Ae,{variant:"outline",size:"sm",className:"h-8 gap-1.5 text-xs",disabled:n||i||!o,onClick:()=>o?.(t,c,s),children:[n?y.jsx(Bt,{className:"h-3.5 w-3.5 animate-spin"}):y.jsx(Uo,{className:"h-3.5 w-3.5"}),s.label||(r?"添加账号":"登录")]},s.id):Ds(s)?y.jsxs(Ae,{variant:"outline",size:"sm",className:"h-8 gap-1.5 text-xs",title:"导入当前设备已有登录态,不会发起新的浏览器授权。",disabled:n||i||!a,onClick:()=>{a?.(t,s)},children:[n?y.jsx(Bt,{className:"h-3.5 w-3.5 animate-spin"}):y.jsx(ji,{className:"h-3.5 w-3.5"}),s.label||"已有登录态"]},s.id):null})})})}function Mm({offering:e,methods:t}){const r=e.endpoints??[],n=$e(e),i=e.kind?Tm(e.kind):void 0,o=i&&i!==n?[i]:[];return y.jsxs("section",{className:"space-y-2","aria-labelledby":`offering-${e.id}`,children:[y.jsxs("div",{className:"flex items-start justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("h4",{id:`offering-${e.id}`,className:"text-sm font-medium text-foreground",children:n}),o.length?y.jsx("div",{className:"mt-1 flex items-center gap-2 text-xs text-muted-foreground",children:o.map(a=>y.jsx("span",{children:a},a))}):null]}),y.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-x-3 gap-y-1 text-xs",children:[y.jsx("span",{className:"text-muted-foreground",children:Om(e,t)}),e.consoleUrl?y.jsx(Yi,{href:e.consoleUrl,label:"控制台"}):null,e.subscriptionUrl?y.jsx(Yi,{href:e.subscriptionUrl,label:"订阅与账单"}):null,e.quota?.url?y.jsx(Yi,{href:e.quota.url,label:"额度与用量"}):null,e.usagePolicyUrl?y.jsx(Yi,{href:e.usagePolicyUrl,label:"使用政策"}):null]})]}),e.lifecycle==="unavailable"&&!rn(e).some(a=>a.lifecycle==="active")?y.jsx("p",{className:"text-xs text-muted-foreground",children:e.kind==="oauth-subscription"?"暂不可用:账号订阅需在 Xpod 桌面版中导入本机客户端(如 Codex CLI)的登录态,浏览器中无法完成。":"暂不可用:该接入方式尚未提供可用的连接流程。"}):null,r.length?y.jsx("dl",{className:"space-y-1 text-[11px] text-muted-foreground",children:r.map(a=>y.jsxs("div",{className:"flex min-w-0 items-baseline gap-2",children:[y.jsx("dt",{className:"shrink-0 text-foreground/70",children:km(a.protocol)}),y.jsx("dd",{className:"min-w-0 truncate font-mono",title:a.baseUrl,children:Pm(a.baseUrl)})]},`${a.protocol}:${a.baseUrl}`))}):null]})}function Yi({href:e,label:t}){return y.jsx("a",{href:e,target:"_blank",rel:"noreferrer",className:"text-primary hover:underline",children:t})}function Dm(e){const t=e.modelDiscovery?.endpointProtocol;return e.endpoints?.find(r=>r.protocol===t)?.baseUrl??e.endpoints?.[0]?.baseUrl}function Pm(e){try{const t=new URL(e);return`${t.host}${t.pathname.replace(/\/$/u,"")}`}catch{return e}}function km(e){return e==="responses"?"Responses API":e==="chatCompletions"?"Chat API":e==="anthropic"?"Anthropic API":e}function Tm(e){return e==="oauth-subscription"?"账号订阅":e==="api-platform"?"API 平台":e==="token-plan"?"Token 套餐":e}function Om(e,t){const r=(t?.length?t:rn(e)).map(n=>n.authMode==="apiKey"?"API Key":n.authMode==="local"?n.label:"账号授权");return[...new Set(r)].join(" / ")}function rn(e,t){if(e.authorizationMethods?.length)return e.authorizationMethods;const r=e.lifecycle==="unavailable"?"unavailable":"active";return[...new Set(e.authModes??[])].map(n=>{if(n==="apiKey")return{id:"api-key",authMode:"apiKey",connectMode:"browserAssistedApiKey",label:"API Key",lifecycle:r};if(n==="local"){const i=e.kind==="local";return{id:i?"local-service":"local-session-import",authMode:"local",label:i?"本地服务":"已有登录态",lifecycle:r}}return{id:"device-code",authMode:n,connectMode:"deviceCodeOAuth",label:"",lifecycle:r}})}function Bo(e){if(e.connectMode)return e.connectMode;if(e.authMode==="oauth"||e.authMode==="deviceCode")return"deviceCodeOAuth";if(e.authMode==="apiKey")return"browserAssistedApiKey"}function qr(e){return e==="deviceCodeOAuth"||e==="authorizationCodeOAuth"}function la(e){return qr(Bo(e))}function mu(e){return e.authMode==="apiKey"||Bo(e)==="browserAssistedApiKey"}function Ds(e){return e.authMode==="local"}function jm({definition:e,offering:t,createOfferings:r,status:n,credentials:i,attempt:o,apiKey:a,baseUrl:s,busy:c,disabled:d,error:p,onApiKeyChange:g,onBaseUrlChange:A,onBeginApiKey:I,onBeginBrowser:M,onSaveApiKey:E,onDisconnect:_,onCreateApiKeyCredential:R,onUpdateCredential:S,initialEditing:v,initialCreate:V=!1,onSavingChange:X,onCloseEdit:re}){const ie=o?.mode==="browserAssistedApiKey"&&o.status==="pending",G=n==="configured",fe=n==="connected",T=!!R,[k,H]=Q.useState(t.id),x=r.find(m=>m.id===k)??t,[$,oe]=Q.useState(!1),[ae,he]=Q.useState(v?"edit":V&&R?"create":void 0),[B,le]=Q.useState(v),[b,z]=Q.useState(v?.label??""),[ne,L]=Q.useState(""),[se,ce]=Q.useState(v?.baseUrl??""),[Y,te]=Q.useState(v?.proxyUrl??""),[C,O]=Q.useState(),[Z,ue]=Q.useState(!1),[j,l]=Q.useState(!1),f=Q.useRef(!1),w=Q.useRef(!1);Q.useEffect(()=>{V&&!R&&!w.current&&(w.current=!0,I())},[V,R,I]);const P=()=>{H(t.id),he("create"),le(void 0),z(""),L(""),ce(""),te(""),O(void 0),ue(!1)},N=()=>{re(),he(void 0),le(void 0),z(""),L(""),ce(""),te(""),O(void 0),ue(!1)},q=async()=>{if(c||d||f.current)return;let m;try{m=Hp(Y)}catch{O("Proxy URL 格式无效(支持 http、https)");return}if(O(void 0),ae==="create"){const U=ne.trim();if(!U||!R)return;f.current=!0,l(!0),X?.(!0);try{await R(x,{apiKey:U,label:b.trim()||void 0,baseUrl:se.trim()||void 0,proxyUrl:m,priority:Bm(i.filter(J=>J.offeringId===x.id))}),N()}catch(J){O(J instanceof Error?J.message:"保存失败,请重试")}finally{f.current=!1,l(!1),X?.(!1)}return}if(ae==="edit"&&B&&S){const U=Y.trim()!==(B.proxyUrl??"").trim();f.current=!0,l(!0),X?.(!0);try{await S(B,{label:b.trim()||void 0,baseUrl:se.trim()||void 0,...U?{proxyUrl:m}:{}}),N()}catch(J){O(J instanceof Error?J.message:"保存失败,请重试")}finally{f.current=!1,l(!1),X?.(!1)}}};return y.jsxs("div",{className:Ue("space-y-3",ae&&"w-full"),children:[o?.userCode?y.jsxs("div",{className:"border-l-2 border-primary bg-muted/30 px-3 py-2 text-sm",children:["验证码:",y.jsx("strong",{className:"font-mono",children:o.userCode})]}):null,!V&&!v?y.jsxs("div",{className:"flex flex-wrap gap-2",children:[R&&r.length>0?y.jsxs(Ae,{variant:"outline",size:"sm",disabled:c||d||j,onClick:P,children:[y.jsx(ji,{className:"mr-2 h-4 w-4"}),"添加 API Key"]}):null,T?null:fe?y.jsxs(y.Fragment,{children:[y.jsxs(Ae,{variant:"outline",size:"sm",disabled:c||d||j,onClick:M,children:[c?y.jsx(Bt,{className:"mr-2 h-4 w-4 animate-spin"}):y.jsx(Rs,{className:"mr-2 h-4 w-4"}),"重新连接"]}),y.jsxs(Ae,{variant:"ghost",size:"sm",disabled:c||d||j,onClick:_,children:[y.jsx(Ib,{className:"mr-2 h-4 w-4"}),"断开连接"]})]}):G?y.jsxs(y.Fragment,{children:[y.jsxs(Ae,{variant:"outline",size:"sm","aria-label":"更新 API Key",disabled:c||d||j,onClick:I,children:[y.jsx(_o,{className:"mr-2 h-4 w-4"}),"更新 API Key"]}),y.jsx(Ae,{variant:"ghost",size:"sm",disabled:c||d||j,onClick:_,children:"移除配置"})]}):y.jsxs(y.Fragment,{children:[y.jsxs(Ae,{variant:"outline",size:"sm",disabled:c||d||j||e.browserMode==="connectUnsupported",onClick:M,children:[c?y.jsx(Bt,{className:"mr-2 h-4 w-4 animate-spin"}):y.jsx(Uo,{className:"mr-2 h-4 w-4"}),e.browserLabel]}),y.jsxs(Ae,{variant:"outline",size:"sm","aria-label":`${e.name} API Key`,disabled:c||d||j,onClick:I,children:[y.jsx(_o,{className:"mr-2 h-4 w-4"}),"配置 API Key"]})]})]}):null,ae?y.jsxs("div",{className:"space-y-2 rounded-lg border border-border/50 bg-muted/10 p-3",children:[ae==="create"&&r.length>1?y.jsxs("label",{className:"block space-y-1 text-xs text-muted-foreground",children:[y.jsx("span",{children:"套餐 / 区域"}),y.jsx("select",{"aria-label":`${e.name} 套餐 / 区域`,value:k,disabled:c||d||j,onChange:m=>{H(m.target.value),O(void 0)},className:"h-9 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground",children:r.map(m=>y.jsx("option",{value:m.id,children:$e(m)},m.id))})]}):null,ae==="edit"?y.jsx(st,{disabled:c||d||j,autoComplete:"off","aria-label":`${e.name} API Key 标签`,placeholder:"名称,例如 Work key",value:b,onChange:m=>z(m.target.value)}):null,ae==="create"?y.jsx(st,{disabled:c||d||j,type:$?"text":"password",autoComplete:"new-password","data-lpignore":"true","data-1p-ignore":!0,"aria-label":`${e.name} API Key 输入`,placeholder:e.apiKeyPlaceholder||"从官方控制台复制 API Key",value:ne,onChange:m=>L(m.target.value),className:"font-mono"}):null,ae==="edit"||Z?y.jsxs(y.Fragment,{children:[y.jsx(st,{disabled:c||d||j,autoComplete:"off","data-lpignore":"true","data-1p-ignore":!0,"aria-label":`${e.name} Base URL 输入`,placeholder:Dm(ae==="edit"?t:x)||e.defaultBaseUrl||"默认服务地址",value:se,onChange:m=>ce(m.target.value),className:"font-mono text-xs"}),y.jsx(st,{disabled:c||d||j,autoComplete:"off","data-lpignore":"true","data-1p-ignore":!0,"aria-label":`${e.name} Proxy URL 输入`,placeholder:"http://127.0.0.1:7890",value:Y,onChange:m=>te(m.target.value),className:"font-mono text-xs"})]}):null,C?y.jsx("p",{className:"text-xs text-destructive",children:C}):null,y.jsxs("div",{className:"flex flex-wrap gap-2",children:[y.jsx(Ae,{size:"sm","aria-label":ae==="create"?`保存 ${e.name} API Key`:"保存凭证",disabled:c||d||j||ae==="create"&&!ne.trim(),onClick:q,children:ae==="create"?"保存 API Key":"保存凭证"}),y.jsx(Ae,{variant:"ghost",size:"sm",disabled:j,onClick:N,children:"取消"}),ae==="create"?y.jsx(Ae,{variant:"ghost",size:"sm",disabled:j,onClick:()=>ue(m=>!m),children:Z?"收起高级设置":"高级设置"}):null]})]}):null,ie&&!ae?y.jsxs("div",{className:"space-y-2",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("span",{className:"text-sm font-medium",children:"API Key"}),e.apiKeyUrl?y.jsx("a",{href:e.apiKeyUrl,target:"_blank",rel:"noreferrer",className:"text-xs text-primary hover:underline",children:"获取 API Key"}):null]}),y.jsxs("div",{className:"group relative",children:[y.jsx(st,{disabled:c||d||j,type:$?"text":"password",autoComplete:"new-password","data-lpignore":"true","data-1p-ignore":!0,"aria-label":`${e.name} API Key 输入`,placeholder:e.apiKeyPlaceholder||"从官方控制台复制 API Key",value:a,onChange:m=>g(m.target.value),className:"border-border/60 bg-muted/20 pr-10 font-mono transition-colors focus:border-primary/50 focus:bg-background"}),y.jsx("div",{className:"absolute bottom-1 right-1 top-1 flex items-center",children:y.jsx(Ae,{variant:"ghost",size:"icon",className:"h-full w-8 rounded hover:bg-muted",onClick:()=>oe(m=>!m),"aria-label":$?"隐藏 API Key":"显示 API Key",children:$?y.jsx(yb,{className:"h-4 w-4 text-muted-foreground"}):y.jsx(bb,{className:"h-4 w-4 text-muted-foreground"})})})]}),A?y.jsxs("div",{className:"space-y-1.5",children:[y.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Base URL(选填)"}),y.jsx(st,{disabled:c||d||j,autoComplete:"off","data-lpignore":"true","data-1p-ignore":!0,"aria-label":`${e.name} Base URL 输入`,placeholder:e.defaultBaseUrl||"默认服务地址",value:s,onChange:m=>A(m.target.value),className:"border-border/60 bg-muted/20 font-mono text-xs transition-colors focus:border-primary/50 focus:bg-background"}),y.jsxs("p",{className:"break-all font-mono text-[11px] text-muted-foreground opacity-80",children:[y.jsx("span",{className:"mr-1 select-none opacity-50",children:"预览:"}),(s.trim()||e.defaultBaseUrl||"").replace(/\/+$/,""),"/chat/completions"]})]}):null,y.jsx(Ae,{size:"sm","aria-label":`保存 ${e.name} API Key`,disabled:!a.trim()||c||d,onClick:E,children:"保存 API Key"})]}):null,p?y.jsx("p",{className:"text-sm text-destructive",children:p}):null]})}function Nm({credential:e,label:t,busy:r,disabled:n,dragHandle:i,kindLabel:o,quota:a,onToggle:s,onTest:c,onEdit:d,onDelete:p,deleteAriaLabel:g}){const A=n||r,I=Lm(e.health),M=`${e.enabled?"已启用":"已停用"} · ${Fm(e.health)}`;return y.jsxs("div",{"data-credential-state":e.enabled?"enabled":"disabled",className:Ue("flex flex-wrap items-center gap-x-3 gap-y-2 rounded-lg border px-3 py-2.5 transition-colors",e.enabled?I.row:"border-border/50 bg-muted/40 opacity-70"),children:[i,y.jsxs(Oo,{children:[y.jsx(jo,{asChild:!0,children:y.jsx("span",{"aria-label":M,className:Ue("h-2 w-2 shrink-0 rounded-full",e.enabled?I.dot:"bg-muted-foreground/40")})}),y.jsx(Ii,{className:"text-xs",children:M})]}),y.jsxs("div",{className:"min-w-0 flex-1 basis-24",children:[y.jsx("p",{className:"truncate text-sm font-medium text-foreground",children:t}),o?y.jsx("p",{className:"text-xs text-muted-foreground",children:o}):null,e.maskedHint&&!t.includes(e.maskedHint)?y.jsx("p",{className:"mt-1 truncate font-mono text-xs text-muted-foreground",children:e.maskedHint}):null]}),y.jsx("div",{className:"order-last w-full min-w-0 sm:order-none sm:w-auto sm:max-w-[45%]",role:"group","aria-label":`${an(e)}额度`,children:a}),y.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[c?y.jsx(Xi,{label:`测试连接 ${t}`,disabled:A,onClick:()=>c(e),children:y.jsx(Tb,{"aria-hidden":"true",className:"h-3.5 w-3.5"})}):null,d?y.jsx(Xi,{label:`编辑 ${t}`,disabled:A,onClick:d,children:y.jsx(Yf,{"aria-hidden":"true",className:"h-3.5 w-3.5"})}):null,s?y.jsx(Xi,{label:`${e.enabled?"停用":"启用"} ${t}`,disabled:A,onClick:()=>s(e,{enabled:!e.enabled}),children:e.enabled?y.jsx(Cb,{"aria-hidden":"true",className:"h-3.5 w-3.5"}):y.jsx(Pb,{"aria-hidden":"true",className:"h-3.5 w-3.5"})}):null,p?y.jsx(Xi,{label:g??`删除 ${t}`,disabled:A,onClick:p,children:y.jsx(nl,{"aria-hidden":"true",className:"h-3.5 w-3.5"})}):null]})]})}function Xi({label:e,disabled:t,onClick:r,children:n}){return y.jsxs(Oo,{children:[y.jsx(jo,{asChild:!0,children:y.jsx(Ae,{variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":e,disabled:t,onClick:r,children:n})}),y.jsx(Ii,{className:"text-xs",children:e})]})}function Fm(e){return e==="healthy"?"有效":e==="unknown"?"未验证":e==="expired"?"已过期":"错误"}function Lm(e){return e==="healthy"?{row:"border-emerald-500/40 bg-emerald-500/5",dot:"bg-emerald-500"}:e==="unknown"?{row:"border-border/50 bg-background",dot:"bg-muted-foreground/50"}:{row:"border-destructive/40 bg-destructive/5",dot:"bg-destructive"}}function Um(e,t){const r=e.authModes??[];return r.some(n=>n==="oauth"||n==="deviceCode")?"deviceCodeOAuth":r.some(n=>n==="apiKey"||n==="local")||t.browserMode==="connectUnsupported"?"browserAssistedApiKey":t.browserMode}function Zi(e){return e?.status==="pending"||e?.status==="authorization_pending"||e?.status==="slow_down"}function Bm(e){return e.length===0?10:Math.max(...e.map(t=>t.priority))+10}function an(e){return e.label?.trim()?e.label:e.maskedHint?`API Key · ${e.maskedHint}`:e.authMode==="oauth"||e.authMode==="deviceCode"?"已授权账号":"API Key"}function wu(e){const t=e.indexOf("@");if(t>0){const r=e.slice(0,t);return`${r.length>6?`${r.slice(0,3)}***${r.slice(-2)}`:r.length>1?`${r[0]}***${r[r.length-1]}`:`${r[0]}***`}${e.slice(t)}`}return e}function qm({definition:e,product:t,status:r,accountLabel:n,attempt:i,attemptOfferingId:o,apiKey:a,baseUrl:s="",busy:c,disabled:d=!1,error:p,quotas:g,models:A,verifyPending:I=!1,onApiKeyChange:M,onBaseUrlChange:E,onBeginApiKey:_,onBeginOffering:R,onCancelConnect:S,onBeginBrowser:v,onSaveApiKey:V,onDisconnect:X,onCreateApiKeyCredential:re,onCreateLocalCredential:ie,onUpdateCredential:G,onDeleteCredential:fe,onTestCredential:T,onReorderCredentials:k,onRefreshQuota:H,onVerify:x,onAddModel:$,onEditModel:oe,onDeleteModel:ae,selectedModelIds:he,modelSelectionStatus:B,onModelSelectionChange:le,onDismissError:b}){const z=r==="configured",ne=r==="connected",L=A.length===0&&p?.message&&!p.offeringId?p.message:void 0,[se,ce]=Q.useState(""),[Y,te]=Q.useState(),[C,O]=Q.useState(he??[]),Z=he??C,ue=Q.useMemo(()=>Wm(A),[A]),j=de=>de.selectionIds.some(me=>Z.includes(me)),l=Q.useMemo(()=>{const de=se.trim().toLocaleLowerCase();return de?ue.filter(me=>me.searchText.includes(de)):ue},[ue,se]),f=l.filter(de=>de.availability!=="unavailable"),w=f.filter(j).length,P=f.length>0&&w===f.length,N=w>0&&!P,q=ue.filter(j).length,m=ue.filter(de=>de.availability==="unavailable").length,U=async de=>{try{await navigator.clipboard.writeText(de),te(de),setTimeout(()=>te(me=>me===de?void 0:me),1500)}catch{te(void 0)}},J=de=>{const me=new Set(Z),pe=j(de);for(const _e of pe?de.selectionIds:de.availableSelectionIds)pe?me.delete(_e):me.add(_e);const ve=[...me];he===void 0&&O(ve),le?.(e.id,ve)},K=()=>{const de=new Set(Z);for(const pe of f)for(const ve of P?pe.selectionIds:pe.availableSelectionIds)P?de.delete(ve):de.add(ve);const me=[...de];he===void 0&&O(me),le?.(e.id,me)};return y.jsx(pf,{children:y.jsxs("div",{className:"space-y-8",children:[y.jsxs("header",{className:"flex items-start justify-between gap-4",children:[y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsxs(Bd,{className:"h-9 w-9 shrink-0 rounded-lg border border-border/50 bg-muted/50 shadow-sm",style:vo(e.id)?{backgroundColor:vo(e.id)}:void 0,children:[y.jsx(qd,{src:Ao(e.id),className:"object-cover"}),y.jsx(Kd,{className:"rounded-lg bg-transparent text-sm font-bold uppercase text-muted-foreground",children:zm(e.id)})]}),y.jsxs("div",{className:"flex flex-col justify-center gap-0.5",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("h2",{className:"text-base font-semibold leading-none tracking-tight text-foreground",children:e.name}),y.jsxs(Oo,{children:[y.jsx(jo,{asChild:!0,children:y.jsx("button",{type:"button","aria-label":"提供商说明",className:"cursor-help rounded-sm text-muted-foreground/50 focus:outline-none focus-visible:text-foreground",children:y.jsx(Jf,{"aria-hidden":"true",className:"h-3.5 w-3.5"})})}),y.jsxs(Ii,{className:"max-w-xs space-y-2 text-xs",children:[y.jsx("p",{children:e.description}),y.jsx("p",{children:"Provider 凭证保存在当前 Pod,由 Pod 权限保护。"})]})]})]}),y.jsxs("a",{href:e.homeUrl,target:"_blank",rel:"noreferrer",className:"flex items-center gap-0.5 text-[10px] leading-none text-muted-foreground transition-colors hover:text-primary",children:["访问官网 ",y.jsx(Uo,{"aria-hidden":"true",className:"h-2.5 w-2.5"})]})]})]}),y.jsx(na,{variant:ne||z?"default":"secondary",children:Hm(r)})]}),y.jsx(Im,{definition:e,product:t,status:r,accountLabel:n,attempt:i,attemptOfferingId:o,apiKey:a,baseUrl:s,busy:c,disabled:d,error:p,suppressError:!!L,quotas:g,onApiKeyChange:M,onBaseUrlChange:E,onBeginApiKey:_,onBeginOffering:R,onCancelConnect:S,onBeginBrowser:v,onSaveApiKey:V,onDisconnect:X,onCreateApiKeyCredential:t?.offerings.length?re:void 0,onCreateLocalCredential:t?.offerings.length?ie:void 0,onUpdateCredential:G,onDeleteCredential:fe,onTestCredential:T,onReorderCredentials:k,onRefreshQuota:H,onDismissError:b}),y.jsxs("section",{className:"space-y-4",children:[y.jsxs("div",{"data-testid":"provider-models-header",className:"flex flex-col gap-3 border-b border-border/40 pb-4 sm:flex-row sm:items-center sm:justify-between",children:[y.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[y.jsx(wo,{className:"h-4 w-4 shrink-0 text-primary"}),y.jsx("h3",{className:"shrink-0 text-sm font-medium text-foreground/90",children:"可用模型"}),y.jsxs("span",{className:"text-xs text-muted-foreground",children:["共 ",ue.length," · 已加入 ",q," · 已失效 ",m]}),y.jsxs("span",{role:"status","aria-live":"polite","aria-atomic":"true",className:Ue("inline-flex items-center gap-1 text-xs",B==="error"?"text-destructive":"text-muted-foreground"),children:[B==="saving"?y.jsx(Bt,{"aria-hidden":"true",className:"h-3 w-3 animate-spin motion-reduce:animate-none"}):B==="saved"?y.jsx(tn,{"aria-hidden":"true",className:"h-3 w-3"}):null,B==="saving"?"保存中…":B==="saved"?"已保存":B==="error"?"保存失败,请重试":"选择后自动保存"]})]}),y.jsxs("div",{"data-testid":"provider-models-actions",className:"flex w-full flex-wrap items-center gap-2 sm:w-auto sm:flex-nowrap sm:justify-end",children:[(z||ne)&&(x||$)?y.jsxs(y.Fragment,{children:[$?y.jsxs(Ae,{variant:"outline",size:"sm",className:"h-8 gap-1.5 text-xs",disabled:d||c,onClick:$,children:[y.jsx(ji,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),"添加模型"]}):null,x&&A.length>0?y.jsxs(Ae,{variant:"outline",size:"sm",className:"h-8 gap-1.5 text-xs",disabled:d||c||I,onClick:x,children:[I?y.jsx(Bt,{"aria-hidden":"true",className:"h-3.5 w-3.5 animate-spin"}):y.jsx(Rs,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),I?"同步中...":"刷新模型"]}):x?y.jsxs(Ae,{variant:"outline",size:"sm",className:"h-8 gap-1.5 text-xs",disabled:d||c||I,onClick:x,children:[I?y.jsx(Bt,{"aria-hidden":"true",className:"h-3.5 w-3.5 animate-spin"}):y.jsx(Rs,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),I?"同步中...":"同步模型"]}):null]}):null,y.jsxs("div",{className:"relative w-full sm:w-auto",children:[y.jsx(Xf,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),y.jsx(st,{value:se,onChange:de=>ce(de.target.value),placeholder:"搜索模型...",className:"h-8 w-full bg-background pl-8 text-xs sm:w-[232px]",autoComplete:"off","data-lpignore":"true","data-1p-ignore":!0})]})]})]}),A.length===0?y.jsx("div",{className:"rounded-lg border border-dashed border-border/50 bg-muted/5 py-12 text-center text-sm text-muted-foreground",children:L?y.jsx("p",{className:"text-destructive",children:L}):"暂无可用模型"}):l.length===0?y.jsx("div",{className:"rounded-lg border border-dashed border-border/50 bg-muted/5 py-12 text-center text-sm text-muted-foreground",children:"未找到匹配的模型"}):y.jsxs("div",{className:"grid gap-2",children:[y.jsx("div",{className:"flex items-center justify-between px-1 py-1",children:y.jsxs("button",{type:"button",role:"checkbox","aria-label":"全选当前结果","aria-checked":N?"mixed":P,disabled:d||c||f.length===0,onClick:K,className:"flex items-center gap-2 text-xs text-muted-foreground disabled:opacity-50",children:[y.jsx("span",{className:Ue("flex h-4 w-4 items-center justify-center rounded border",P||N?"border-primary bg-primary text-primary-foreground":"border-border"),children:N?y.jsx("span",{"aria-hidden":"true",children:"−"}):y.jsx(tn,{"aria-hidden":"true",className:Ue("h-3 w-3",!P&&"invisible")})}),"全选当前结果"]})}),l.map(de=>{const me=ih(de),pe=j(de),ve=de.availability==="unavailable",_e=de.displayName??de.id,Ce=[...(de.inputModalities??[]).filter(Pe=>Pe!=="text"),...de.capabilities??[]];return y.jsxs("div",{className:Ue("group flex items-center gap-3 rounded-lg border bg-card p-3 transition-all duration-200 hover:border-border/60 hover:bg-accent/30",pe?"border-primary/40 bg-primary/[0.03]":"border-border/40",ve&&"opacity-75"),children:[y.jsx("button",{type:"button",role:"checkbox","aria-checked":pe,"aria-label":`${pe?"取消选择":"选择"} ${_e}`,className:Ue("flex h-5 w-5 shrink-0 items-center justify-center rounded border transition-colors focus:outline-none focus-visible:border-ring",pe?"border-primary bg-primary text-primary-foreground":"border-border text-transparent hover:border-primary/60"),disabled:d||c||ve&&!pe,onClick:()=>J(de),children:y.jsx(tn,{"aria-hidden":"true",className:"h-3.5 w-3.5"})}),y.jsx("div",{className:"shrink-0 rounded bg-muted/50 p-2 text-muted-foreground transition-colors group-hover:text-primary",children:y.jsx(wo,{className:"h-4 w-4"})}),y.jsxs("div",{className:"min-w-0 flex-1",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("span",{className:"truncate text-sm font-medium text-foreground/90",children:_e}),y.jsx("div",{className:"flex items-center gap-1",children:Ce.map(Pe=>y.jsx(Km,{type:Pe},Pe))}),de.custom?y.jsx(na,{variant:"outline",className:"shrink-0 text-[10px] font-normal",children:"手工"}):null,ve?y.jsx(na,{variant:"destructive",className:"shrink-0 text-[10px] font-normal",children:"已失效"}):null]}),de.displayName?y.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5",children:[y.jsx("code",{className:"max-w-[300px] truncate font-mono text-[10px] text-muted-foreground opacity-70",children:de.id}),y.jsx("button",{type:"button",onClick:()=>{U(de.id)},className:"rounded p-0.5 text-muted-foreground opacity-0 transition-opacity hover:bg-muted hover:text-foreground group-hover:opacity-100 group-focus-within:opacity-100 focus:opacity-100","aria-label":`复制 ${de.displayName} ID`,title:"复制 ID",children:Y===de.id?y.jsx(tn,{"aria-hidden":"true",className:"h-3 w-3 text-primary"}):y.jsx(Is,{"aria-hidden":"true",className:"h-3 w-3"})})]}):null]}),de.custom&&(oe||ae)?y.jsxs("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100 focus-within:opacity-100",children:[oe?y.jsx(Ae,{variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":`编辑 ${de.displayName??de.id}`,onClick:()=>oe(de),children:y.jsx(Yf,{"aria-hidden":"true",className:"h-3.5 w-3.5 text-muted-foreground"})}):null,ae?y.jsx(Ae,{variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":`删除 ${de.displayName??de.id}`,onClick:()=>ae(de),children:y.jsx(nl,{"aria-hidden":"true",className:"h-3.5 w-3.5 text-muted-foreground"})}):null]}):null]},me)})]})]})]})})}function Km({type:e}){const t={image:{icon:Gf,label:"视觉识别",className:"text-green-500"},web:{icon:Qf,label:"联网搜索",className:"text-blue-500"},tool_call:{icon:wo,label:"函数调用",className:"text-orange-500"},reasoning:{icon:Vf,label:"推理",className:"text-purple-500"}}[e];if(!t)return null;const r=t.icon;return y.jsxs(Oo,{children:[y.jsx(jo,{asChild:!0,children:y.jsx("button",{type:"button","aria-label":t.label,className:"flex cursor-help items-center justify-center rounded-sm opacity-80 transition-opacity hover:opacity-100 focus:outline-none focus-visible:opacity-100",children:y.jsx(r,{"aria-hidden":"true",className:Ue("h-3.5 w-3.5",t.className)})})}),y.jsx(Ii,{children:t.label})]})}function zm(e){switch(e){case"openai":return"OA";case"anthropic":return"A";case"kimi":return"K";case"bailian":return"百";case"deepseek":return"DS";case"zhipu":return"智";case"ollama":return"O";case"custom":return"C"}}function ih(e){return e.resourceId??(e.offeringId?`${e.offeringId}:${e.id}`:e.id)}function Wm(e){const t=new Map;for(const r of e){const n=`${r.provider}\0${r.id}`,i=ih(r),o=t.get(n),a=[r.id,r.displayName].filter(Boolean).join(`
3
+ `).toLocaleLowerCase();if(!o){t.set(n,{...r,selectionIds:[i],availableSelectionIds:r.availability==="unavailable"?[]:[i],searchText:a});continue}o.selectionIds.includes(i)||o.selectionIds.push(i),r.availability!=="unavailable"&&!o.availableSelectionIds.includes(i)&&o.availableSelectionIds.push(i),r.availability!=="unavailable"&&(o.availability=r.availability),o.capabilities=[...new Set([...o.capabilities??[],...r.capabilities??[]])],o.inputModalities=[...new Set([...o.inputModalities??[],...r.inputModalities??[]])],o.searchText+=`
4
+ ${a}`}return[...t.values()]}function Hm(e){switch(e){case"pending":return"连接中";case"configured":return"已配置";case"connected":return"已连接";case"disconnected":return"未设置";case"reauthRequired":return"需要重新登录";case"failed":return"连接失败";default:return"未检查"}}const Vm=[{id:"image",label:"视觉识别",icon:Gf}],Qm=[{id:"tool_call",label:"函数调用",icon:wo},{id:"reasoning",label:"推理",icon:Vf},{id:"web",label:"联网搜索",icon:Qf}];function Gm({open:e,providerName:t,initialValue:r,error:n,saving:i=!1,onOpenChange:o,onSave:a}){const s=!!r,[c,d]=Q.useState(""),[p,g]=Q.useState(""),[A,I]=Q.useState([]),[M,E]=Q.useState([]);Q.useEffect(()=>{e&&(d(r?.id??""),g(r?.name??""),I(r?.inputModalities??[]),E(r?.capabilities??[]))},[r,e]);const _=c.trim(),R=!!_&&!i,S=(V,X,re)=>{X(V.includes(re)?V.filter(ie=>ie!==re):[...V,re])},v=(V,X,re)=>{const ie=X.includes(V.id),G=V.icon;return y.jsxs("button",{type:"button","aria-pressed":ie,disabled:i,onClick:()=>S(X,re,V.id),className:Ue("flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs transition-colors",ie?"border-primary/50 bg-primary/10 text-primary":"border-border/60 text-muted-foreground hover:border-border hover:text-foreground"),children:[y.jsx(G,{"aria-hidden":"true",className:"h-3.5 w-3.5"}),V.label]},V.id)};return y.jsx(Ei,{open:e,onOpenChange:o,children:y.jsxs(wn,{className:"max-w-md",children:[y.jsx(xi,{children:y.jsxs(_n,{children:[s?"编辑模型":"添加模型"," · ",t]})}),y.jsxs("div",{className:"flex flex-col gap-4 py-2",children:[y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(er,{htmlFor:"ai-model-id",children:"模型 ID"}),y.jsx(st,{id:"ai-model-id",value:c,disabled:s||i,placeholder:"例如 gpt-4o-mini",onChange:V=>d(V.target.value)})]}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(er,{htmlFor:"ai-model-name",children:"显示名称"}),y.jsx(st,{id:"ai-model-name",value:p,disabled:i,placeholder:"留空则使用模型 ID",onChange:V=>g(V.target.value)})]}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(er,{children:"输入模态"}),y.jsx("div",{className:"flex flex-wrap gap-2",children:Vm.map(V=>v(V,A,I))})]}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(er,{children:"能力标记"}),y.jsx("div",{className:"flex flex-wrap gap-2",children:Qm.map(V=>v(V,M,E))})]}),n?y.jsx("p",{className:"text-xs text-destructive",role:"alert",children:n}):null]}),y.jsxs(ko,{children:[y.jsx(Ae,{variant:"outline",disabled:i,onClick:()=>o(!1),children:"取消"}),y.jsx(Ae,{disabled:!R,onClick:()=>a({id:_,name:p.trim(),inputModalities:A,capabilities:M}),children:i?"保存中...":"保存"})]})]})})}const Jm="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20800%20800%22%3E%3Crect%20width%3D%22800%22%20height%3D%22800%22%20rx%3D%22120%22%20fill%3D%22%2309090b%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20fill-rule%3D%22evenodd%22%20d%3D%22%20M165.29%20165.29%20H517.36%20V400%20H400%20V517.36%20H282.65%20V634.72%20H165.29%20Z%20M282.65%20282.65%20V400%20H400%20V282.65%20Z%20%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M517.36%20400%20H634.72%20V634.72%20H517.36%20Z%22%2F%3E%3C%2Fsvg%3E",Ym="data:image/svg+xml,%3Csvg%20width%3D%2240%22%20height%3D%2240%22%20viewBox%3D%220%200%2040%2040%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url(%23clip0_5110_14771)%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2220%22%20fill%3D%22url(%23paint0_linear_5110_14771)%22%2F%3E%3Cg%20filter%3D%22url(%23filter0_f_5110_14771)%22%3E%3Ccircle%20cx%3D%2212.6071%22%20cy%3D%2234.9794%22%20r%3D%2214.081%22%20fill%3D%22%2332E6B9%22%20fill-opacity%3D%220.4%22%2F%3E%3C%2Fg%3E%3Cg%20filter%3D%22url(%23filter1_f_5110_14771)%22%3E%3Ccircle%20cx%3D%2233.3404%22%20cy%3D%2243.6185%22%20r%3D%2212.8704%22%20fill%3D%22%2332E6B9%22%2F%3E%3C%2Fg%3E%3Cpath%20d%3D%22M27.6897%203.3426C28.057%203.01322%2028.0795%202.99983%2028.3485%202.98366C28.7851%202.95177%2029.1858%203.16107%2029.8664%203.78072C31.4566%205.22574%2033.6703%208.19724%2035.047%2010.7343L35.5796%2011.7191L36.3309%2012.0927C37.0562%2012.4593%2038.2459%2013.2111%2038.7428%2013.614C38.9673%2013.7997%2038.9992%2013.8032%2039.2326%2013.7124C40.2872%2013.3017%2041.7982%2013.846%2043.1307%2015.1244C44.3302%2016.274%2045.479%2018.2384%2045.9191%2019.8778C45.9833%2020.1417%2046.0683%2020.709%2046.0994%2021.1314C46.1997%2022.6144%2045.7243%2023.7986%2044.8085%2024.3349C44.6213%2024.443%2044.6085%2024.4725%2044.6137%2024.939C44.6559%2027.1604%2044.0571%2029.3777%2042.8543%2031.54C41.4965%2033.9678%2039.0794%2036.4798%2035.8073%2038.846C34.0502%2040.1247%2029.8918%2042.5469%2028.0122%2043.3973C23.5096%2045.4244%2019.8999%2046.2022%2016.7645%2045.8181C14.8943%2045.5915%2012.7771%2044.8611%2011.5246%2044.0137C11.1951%2043.786%2011.1428%2043.7719%2010.8909%2043.8439C9.55017%2044.2289%207.79442%2043.4374%206.30272%2041.7817C5.70771%2041.1197%204.74709%2039.4939%204.43575%2038.6241C3.71569%2036.5887%203.85859%2034.752%204.81783%2033.6551C5.0657%2033.3725%205.07387%2033.3607%205.01972%2032.8856C4.93033%2032.1079%204.88982%2030.9566%204.93066%2030.2138L4.96343%2029.5205L3.92091%2027.6777C2.3078%2024.8074%201.28326%2022.3968%200.887982%2020.5554C0.679402%2019.546%200.692781%2019.0981%200.949061%2018.7667C1.10529%2018.5666%201.61622%2018.3594%202.23252%2018.2455C3.78518%2017.9729%207.17203%2018.2198%2010.9394%2018.885L11.3303%2018.9525L12.1903%2018.1921C13.6179%2016.9275%2014.5665%2016.2176%2016.315%2015.1274C18.1373%2013.9872%2020.1943%2013.0498%2022.5103%2012.3071L23.2533%2012.0687L23.6615%2010.9964C25.1239%207.13587%2026.6218%204.28969%2027.6897%203.3426ZM15.4393%2023.1261C13.7864%2024.0804%2012.9602%2024.5582%2012.3529%2025.093C9.89364%2027.2585%208.9738%2030.6888%2010.0208%2033.7938C10.2794%2034.5606%2010.7568%2035.387%2011.7111%2037.0398C12.6653%2038.6926%2013.1424%2039.5194%2013.6771%2040.1267C15.8426%2042.5859%2019.2732%2043.5045%2022.3783%2042.4574C23.145%2042.1989%2023.972%2041.7223%2025.6248%2040.768L35.1333%2035.2783C36.7862%2034.324%2037.6124%2033.8462%2038.2196%2033.3114C40.6789%2031.1459%2041.5988%2027.7156%2040.5518%2024.6105C40.2932%2023.8438%2039.8157%2023.0174%2038.8615%2021.3646C37.9072%2019.7117%2037.4302%2018.885%2036.8955%2018.2777C34.7299%2015.8185%2031.2993%2014.8999%2028.1943%2015.947C27.4275%2016.2055%2026.6006%2016.6821%2024.9478%2017.6364L15.4393%2023.1261Z%22%20fill%3D%22url(%23paint1_linear_5110_14771)%22%2F%3E%3Crect%20x%3D%2215.8816%22%20y%3D%2230.0273%22%20width%3D%224.00904%22%20height%3D%228.32646%22%20rx%3D%222.00452%22%20transform%3D%22rotate(-30%2015.8816%2030.0273)%22%20fill%3D%22white%22%2F%3E%3Crect%20x%3D%2226.6978%22%20y%3D%2223.7812%22%20width%3D%224.00904%22%20height%3D%228.32646%22%20rx%3D%222.00452%22%20transform%3D%22rotate(-30%2026.6978%2023.7812)%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3Cfilter%20id%3D%22filter0_f_5110_14771%22%20x%3D%22-14.9163%22%20y%3D%227.45599%22%20width%3D%2255.0468%22%20height%3D%2255.047%22%20filterUnits%3D%22userSpaceOnUse%22%20color-interpolation-filters%3D%22sRGB%22%3E%3CfeFlood%20flood-opacity%3D%220%22%20result%3D%22BackgroundImageFix%22%2F%3E%3CfeBlend%20mode%3D%22normal%22%20in%3D%22SourceGraphic%22%20in2%3D%22BackgroundImageFix%22%20result%3D%22shape%22%2F%3E%3CfeGaussianBlur%20stdDeviation%3D%226.72123%22%20result%3D%22effect1_foregroundBlur_5110_14771%22%2F%3E%3C%2Ffilter%3E%3Cfilter%20id%3D%22filter1_f_5110_14771%22%20x%3D%229.46959%22%20y%3D%2219.7477%22%20width%3D%2247.7417%22%20height%3D%2247.741%22%20filterUnits%3D%22userSpaceOnUse%22%20color-interpolation-filters%3D%22sRGB%22%3E%3CfeFlood%20flood-opacity%3D%220%22%20result%3D%22BackgroundImageFix%22%2F%3E%3CfeBlend%20mode%3D%22normal%22%20in%3D%22SourceGraphic%22%20in2%3D%22BackgroundImageFix%22%20result%3D%22shape%22%2F%3E%3CfeGaussianBlur%20stdDeviation%3D%225.50019%22%20result%3D%22effect1_foregroundBlur_5110_14771%22%2F%3E%3C%2Ffilter%3E%3ClinearGradient%20id%3D%22paint0_linear_5110_14771%22%20x1%3D%2220%22%20y1%3D%220%22%20x2%3D%2220%22%20y2%3D%2240%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%236C4DFF%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23583ED3%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22paint1_linear_5110_14771%22%20x1%3D%2214.639%22%20y1%3D%2210.7917%22%20x2%3D%2232.1712%22%20y2%3D%2241.1585%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22white%22%20stop-opacity%3D%220.8%22%2F%3E%3Cstop%20offset%3D%220.437689%22%20stop-color%3D%22white%22%2F%3E%3C%2FlinearGradient%3E%3CclipPath%20id%3D%22clip0_5110_14771%22%3E%3Crect%20width%3D%2240%22%20height%3D%2240%22%20rx%3D%2220%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",Xm={codex:Ao("openai"),"claude-code":Ao("anthropic"),pi:Jm,codebuddy:Ym};function Zm(e){return Xm[e]}const ua=["codex","claude-code","pi","codebuddy"],Wt={codex:"Codex","claude-code":"Claude Code",pi:"Pi",codebuddy:"CodeBuddy"};function $m({client:e,className:t="h-4 w-4"}){const r=Zm(e);return r?y.jsx("img",{src:r,alt:"","aria-hidden":"true",className:`${t} shrink-0 rounded-[3px] object-cover`}):y.jsx(Hb,{className:t,"aria-hidden":"true"})}function e0(e,t,r){const n=r??"<粘贴 Xpod API Key>",i=t.trim().replace(/\/+$/,""),o=i.endsWith("/v1")?i:`${i}/v1`,a=i.replace(/\/v1$/,"");switch(e){case"codex":return["# ~/.codex/config.toml","# 将 model_provider 放在第一个配置节之前;已有同名顶层字段时替换",'model_provider = "xpod"',"","[model_providers.xpod]",'name = "Xpod AI Connection"',`base_url = ${JSON.stringify(o)}`,'wire_api = "responses"',"requires_openai_auth = false",`experimental_bearer_token = ${JSON.stringify(n)}`,"# 保留现有订阅登录,Xpod 单独使用此 provider 的 Key"].join(`
5
+ `);case"claude-code":return["# ~/.claude/settings.json(合并 env 到现有 JSON)",JSON.stringify({env:{ANTHROPIC_BASE_URL:a,ANTHROPIC_AUTH_TOKEN:n}},null,2)].join(`
6
+ `);case"pi":return["# ~/.pi/agent/settings.json(合并到现有 JSON,并将 <model-id> 替换为实际模型)",JSON.stringify({defaultProvider:"xpod",defaultModel:"<model-id>"},null,2),"","# ~/.pi/agent/models.json(合并 providers.xpod 到现有 JSON)",JSON.stringify({providers:{xpod:{baseUrl:o,apiKey:n,authHeader:!0,api:"openai-responses",models:[{id:"<model-id>",name:"<model-id>"}]}}},null,2)].join(`
7
+ `);case"codebuddy":return["# ~/.codebuddy/settings.json(合并 env 到现有 JSON)",JSON.stringify({env:{CODEBUDDY_BASE_URL:o,CODEBUDDY_API_KEY:n}},null,2)].join(`
8
+ `)}}const ca="我的 API Key";function t0({client:e,clientConfigurationBridge:t,gatewayModels:r}){const[n,i]=Q.useState([]),[o,a]=Q.useState(!0),[s,c]=Q.useState(ca),[d,p]=Q.useState(!1),g=Q.useRef({}),[A,I]=Q.useState(),[M,E]=Q.useState({}),_=Q.useRef(new Map),R=Q.useRef(!1),[S,v]=Q.useState(!1),[V,X]=Q.useState(),[re,ie]=Q.useState(),[G,fe]=Q.useState(),[T,k]=Q.useState({}),H=Q.useRef(new Map),x=Q.useRef(0),$=Q.useRef(void 0),oe=Q.useCallback(Y=>{$.current&&nu($.current),$.current=pt(Y)},[]),ae=Q.useCallback(Y=>{oe({variant:"destructive",description:_u(Y),duration:8e3})},[oe]),he=Y=>{clearTimeout(H.current.get(Y)),H.current.delete(Y),k(te=>{const C={...te};return delete C[Y],C})};Q.useEffect(()=>{let Y=!0;x.current+=1;const te=H.current;a(!0),fe(void 0),E({}),_.current.clear();const C={...g.current};return e.listGatewayKeys().then(O=>{if(!Y)return;const Z=O.filter(ue=>!ue.revokedAt);i(Z),t&&Promise.all(ua.map(async ue=>{try{const j=await t.inspect(ue);if(!Y||g.current[ue]!==C[ue]||j.status!=="configured"||!j.appliedKeyFingerprint)return;const l=Z.filter(w=>w.fingerprint===j.appliedKeyFingerprint);if(l.length!==1)return;const f=l[0].id;E(w=>({...w,[ue]:f}))}catch{}}))}).catch(O=>{Y&&ae(O)}).finally(()=>{Y&&(k({}),I(void 0),a(!1))}),()=>{Y=!1,x.current+=1,te.forEach(clearTimeout),te.clear(),$.current&&nu($.current)}},[e,t,ae]),Q.useEffect(()=>{if(!A)return;const Y=te=>{const C=te.target;C instanceof Element&&C.closest("[data-client-menu]")?.getAttribute("data-client-menu")===A||I(void 0)};return document.addEventListener("pointerdown",Y),()=>document.removeEventListener("pointerdown",Y)},[A]);const B=async(Y,te)=>{if(!R.current){R.current=!0,X(Y),fe(void 0);try{await te()}catch(C){ae(C)}finally{R.current=!1,X(void 0),ie(void 0)}}},le=async(Y,te,C=!1)=>{if(!t)return;ie({keyId:Y,clientId:te.client});const O=_.current.get(Y)??await e.revealGatewayKey(Y);await t.apply({client:te.client,planId:te.planId,apiKey:O,...te.confirmation?.required?{confirmation:{token:te.confirmation.token,targetHash:te.confirmation.targetHash}}:{}}),E(Z=>({...Z,[te.client]:Y})),oe({variant:"success",description:te.client==="codex"&&r===void 0?"Codex 连接配置已应用,模型目录尚未加载,请稍后刷新配置。":`${Wt[te.client]} ${C?"endpoint 已刷新。":"配置已应用。"}`})},b=(Y,te,C=!1)=>B(Y.id,async()=>{if(!t||C&&M[te]!==Y.id)return;ie({keyId:Y.id,clientId:te}),g.current[te]=(g.current[te]??0)+1;const O=await t.plan({client:te,endpoint:e.apiBase,...te==="codex"&&r!==void 0?{activeModels:r.map(({id:Z,provider:ue,displayName:j,availability:l,contextWindow:f,inputModalities:w,capabilities:P})=>({id:Z,provider:ue,displayName:j,availability:l,contextWindow:f,inputModalities:w,capabilities:P}))}:{}});await le(Y.id,O,C)}),z=(Y,te)=>B(Y.id,async()=>{if(!t||M[te]!==Y.id)return;g.current[te]=(g.current[te]??0)+1;const C=await t.restore(te);if(C.status!=="notConfigured"&&C.status!=="failedAndRestored")throw new Error(C.message??"撤回未完成,请重试。");E(O=>{const Z={...O};return delete Z[te],Z}),oe({description:`${Wt[te]} 配置已撤回,API Key 已保留。`})}),ne=async()=>{const Y=s.trim();if(!Y){fe("请填写 API Key 名称。");return}v(!0),fe(void 0);try{const te=await e.createGatewayKey({name:Y});i(C=>[te.record,...C.filter(O=>O.id!==te.record.id)]),_.current.set(te.record.id,te.plaintext),oe({variant:"success",description:"API Key 已创建,可在列表中复制或应用配置。"}),c(ca),p(!1)}catch(te){fe(_u(te))}finally{v(!1)}},L=async(Y,te)=>{X(Y.id),fe(void 0);try{const C=await e.updateGatewayKey(Y.id,{enabled:te});i(O=>O.map(Z=>Z.id===Y.id?C:Z))}catch(C){ae(C)}finally{X(void 0)}},se=(Y,te)=>B(Y.id,async()=>{const C=x.current,O=_.current.get(Y.id)??await e.revealGatewayKey(Y.id);if(C===x.current){if(!navigator.clipboard?.writeText)throw new Error("当前浏览器无法访问剪贴板,请允许剪贴板访问后重试。");await navigator.clipboard.writeText(te==="key"?O:e0(te,e.apiBase,O)),C===x.current&&(clearTimeout(H.current.get(Y.id)),k(Z=>({...Z,[Y.id]:te})),H.current.set(Y.id,setTimeout(()=>he(Y.id),2e3)))}}),ce=async Y=>{X(Y.id),fe(void 0);try{await e.deleteGatewayKey(Y.id),_.current.delete(Y.id),he(Y.id),i(te=>te.filter(C=>C.id!==Y.id))}catch(te){ae(te)}finally{X(void 0)}};return y.jsxs("section",{className:"[container-type:inline-size] space-y-6","aria-label":"API Keys",children:[y.jsx("p",{className:"max-w-3xl text-sm text-muted-foreground",children:"API Key 用于访问 Xpod Gateway。Provider 密钥不会写入客户端;客户端只获得 Xpod 地址和这里创建的 Key。"}),y.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border/60 pb-2",children:[y.jsxs("span",{className:"text-xs text-muted-foreground",children:[n.length," 个 API Key"]}),y.jsxs(Ae,{size:"sm","aria-label":"新建 API Key",disabled:S||o,onClick:()=>{fe(void 0),c(ca),p(!0)},children:[y.jsx(_o,{className:"mr-2 h-4 w-4"}),"新建 API Key"]})]}),y.jsx(Ei,{open:d,onOpenChange:Y=>{S||p(Y)},children:y.jsxs(wn,{className:"sm:max-w-md","aria-describedby":void 0,children:[y.jsx(xi,{children:y.jsx(_n,{children:"新建 API Key"})}),y.jsxs("form",{className:"space-y-5",onSubmit:Y=>{Y.preventDefault(),S||ne()},children:[y.jsxs("label",{className:"block space-y-2",children:[y.jsx("span",{className:"text-sm font-medium",children:"名称"}),y.jsx(st,{autoFocus:!0,"aria-label":"API Key 名称",value:s,disabled:S,onChange:Y=>c(Y.target.value)})]}),G?y.jsx("p",{role:"alert",className:"text-sm text-destructive",children:G}):null,y.jsxs(ko,{children:[y.jsx(Ae,{type:"button",variant:"outline",disabled:S,onClick:()=>p(!1),children:"取消"}),y.jsxs(Ae,{type:"submit","aria-label":"创建 API Key",disabled:S||!s.trim(),children:[S?y.jsx(Bt,{className:"mr-2 h-4 w-4 animate-spin"}):null,S?"正在创建…":"创建 API Key"]})]})]})]})}),t?null:y.jsx("p",{className:"text-xs text-muted-foreground",children:"当前 Web 环境可复制配置;自动应用和撤回需要本机连接。"}),y.jsx("div",{className:"space-y-2",children:o?y.jsxs("div",{className:"flex items-center gap-2 py-6 text-sm text-muted-foreground",children:[y.jsx(Bt,{className:"h-4 w-4 animate-spin"}),"正在读取 API Keys"]}):n.length===0?y.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"尚未创建 API Key。"}):y.jsx("div",{className:"rounded-xl border border-border/70",children:n.map(Y=>{const te=!!Y.disabledAt,C=Y.name||"未命名 API Key",O=!!V,Z=ua.filter(j=>M[j]===Y.id),ue=Z.length>0;return y.jsxs("div",{"data-key-state":te?"disabled":"active",className:Ue("flex min-w-0 items-center gap-1 border-b border-border/60 px-2 py-2.5 sm:gap-2 sm:px-4 first:rounded-t-xl last:rounded-b-xl last:border-b-0",te?"bg-muted/30 text-muted-foreground":"bg-emerald-500/[0.035]"),children:[y.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1 sm:gap-2",children:[y.jsx("span",{className:"min-w-0 truncate text-sm font-medium",title:C,children:C}),y.jsx("code",{dir:"rtl",className:"min-w-0 max-w-36 truncate text-left text-xs text-muted-foreground",children:y.jsx("span",{dir:"ltr",children:Y.maskedHint??r0(Y.id)})}),y.jsx(Ae,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0","aria-label":`复制 ${C}`,title:T[Y.id]==="key"?"已复制":"复制 API Key",disabled:O,onClick:()=>{se(Y,"key")},children:T[Y.id]==="key"?y.jsx(tn,{className:"h-4 w-4 text-emerald-600"}):y.jsx(Is,{className:"h-4 w-4"})}),y.jsx("span",{role:"status","aria-live":"polite",className:"sr-only",children:T[Y.id]==="key"?"API Key 已复制":""}),ue?y.jsx("div",{className:"flex shrink-0 items-center gap-1 text-muted-foreground",children:Z.map(j=>y.jsx("span",{role:"img","aria-label":`${Wt[j]} 已应用`,title:`${Wt[j]} 已应用`,className:"shrink-0",children:y.jsx($m,{client:j})},j))}):null]}),y.jsx("span",{className:"hidden shrink-0 text-xs text-muted-foreground [@container(min-width:850px)]:inline",children:Y.lastUsedAt?`最后使用 ${n0(Y.lastUsedAt)}`:"暂无调用记录 · 尚未使用"}),y.jsxs("details",{"data-client-menu":Y.id,open:A===Y.id,className:"relative shrink-0",onKeyDown:j=>{j.key==="Escape"&&(j.preventDefault(),I(void 0),j.currentTarget.querySelector("summary")?.focus())},children:[y.jsxs("summary",{role:"button","aria-label":`${C} 客户端配置`,"aria-expanded":A===Y.id,onClick:j=>{j.preventDefault(),!(O&&A!==Y.id)&&I(l=>l===Y.id?void 0:Y.id)},className:"inline-flex min-h-9 max-w-full cursor-pointer list-none items-center gap-2 rounded-md border border-input bg-background px-2 text-sm outline-none hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden",children:[y.jsx("span",{children:"应用"}),y.jsx(db,{"aria-hidden":"true",className:"h-3.5 w-3.5 shrink-0"})]}),y.jsx("div",{role:"group","aria-label":`${C} 客户端选项`,className:"absolute right-0 top-full z-20 mt-1 w-72 max-w-[calc(100cqw-6rem)] space-y-1 rounded-lg border border-border bg-popover p-2 text-popover-foreground shadow-lg",children:ua.map(j=>{const f=M[j]===Y.id,w=T[Y.id]===j;return y.jsxs("div",{className:"flex items-center gap-2 rounded-md px-2 py-1.5",children:[t?y.jsxs("label",{className:"flex min-w-0 flex-1 cursor-pointer items-center gap-2 text-sm",children:[y.jsx("input",{type:"checkbox","aria-label":`${C} 应用到 ${Wt[j]}`,checked:f,disabled:O||te&&!f,className:"h-4 w-4 shrink-0 accent-primary",onChange:P=>{P.target.checked?b(Y,j):z(Y,j)}}),y.jsx("span",{children:Wt[j]}),re?.keyId===Y.id&&re.clientId===j?y.jsx("span",{role:"status",className:"text-xs text-muted-foreground",children:"应用中…"}):null]}):y.jsx("span",{className:"min-w-0 flex-1 text-sm",children:Wt[j]}),t?y.jsx(Ae,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0","aria-label":`刷新 ${C} 的 ${Wt[j]} endpoint`,title:f?"保留当前 Key,刷新客户端连接地址":"应用后可刷新连接地址",disabled:O||te||!f,onClick:()=>{b(Y,j,!0)},children:y.jsx(Ub,{className:Ue("h-4 w-4",re?.keyId===Y.id&&re.clientId===j&&"animate-spin")})}):null,y.jsx("span",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:w?"已复制":""}),y.jsx(Ae,{variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0","aria-label":`复制 ${C} 的 ${Wt[j]} 配置`,title:w?"已复制":`复制 ${Wt[j]} 配置`,disabled:O,onClick:()=>{se(Y,j)},children:w?y.jsx(tn,{className:"h-4 w-4 text-emerald-600"}):y.jsx(Is,{className:"h-4 w-4"})})]},j)})})]}),y.jsxs("div",{className:"flex shrink-0 items-center",children:[Y.kind!=="client-credentials"?y.jsx(Ae,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-pressed":!te,"aria-label":`${te?"启用":"停用"} ${C}`,title:`${te?"启用":"停用"} ${C}`,disabled:O,onClick:()=>{L(Y,te)},children:y.jsx(Nb,{className:Ue("h-4 w-4",!te&&"text-emerald-600")})}):null,y.jsx(Ae,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":`删除 ${C}`,title:ue?"请先撤回已应用的配置":`删除 ${C}`,disabled:O||ue,onClick:()=>{ce(Y)},children:y.jsx(nl,{className:"h-4 w-4"})})]})]},Y.id)})})})]})}function r0(e){return`••••••••${e.slice(-8)}`}function n0(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function _u(e){const t=e instanceof Error?e.message.trim():"";return/failed to fetch|networkerror|load failed/i.test(t)?"无法连接配置服务,请检查连接后重试。":/EACCES|permission denied/i.test(t)?"没有权限写入配置文件,请检查文件权限后重试。":t==="Client configuration could not be verified locally."?"配置文件写入后的本地检查未通过,请检查文件内容和权限后重试。":!t||/^(?:AI Connection |AI client configuration )?request failed(?:\. Please try again\.)?$/i.test(t)?"API Key 操作失败,请重试。":t}const i0={};function o0({client:e,renderToaster:t=!0,openExternal:r=d0,clientConfigurationBridge:n,selectedSection:i="provider",selectedProvider:o,selectedCredentialId:a,providerSummaries:s=i0,providerProducts:c={},providerLoadError:d,providerLoading:p=!1,onProviderStateChange:g,onModelSelectionChange:A}){const[I,M]=Q.useState({}),[E,_]=Q.useState([]),[R,S]=Q.useState(),[v,V]=Q.useState(0),[X,re]=Q.useState({}),[ie,G]=Q.useState({}),[fe,T]=Q.useState({}),[k,H]=Q.useState({}),[x,$]=Q.useState({}),[oe,ae]=Q.useState({}),[he,B]=Q.useState({}),[le,b]=Q.useState({}),[z,ne]=Q.useState({}),[L,se]=Q.useState({}),[ce,Y]=Q.useState(),[te,C]=Q.useState(),[O,Z]=Q.useState(!1),[ue,j]=Q.useState({}),l=Q.useRef(0),f=Q.useRef({}),w={...c,...ue},P=Q.useCallback((D,u)=>{M(h=>({...h,[D]:u})),g?.(D,l0(u))},[g]);Q.useEffect(()=>{M(Object.fromEntries(Object.values(s).filter(Iu).map(D=>[D.provider,D.status==="connected"&&D.authMode==="browserAssistedApiKey"?"configured":D.status]))),ae(Object.fromEntries(Object.values(s).filter(Iu).map(D=>[D.provider,D.baseUrl??""])))},[s]),Q.useEffect(()=>{re(D=>{const u={...D};let h=!1;for(const[W,F]of Object.entries(c)){if(!F)continue;const ee=F.selectedModels.map(dr),ge=D[W];(!ge||ge.join("\0")!==ee.join("\0"))&&(u[W]=ee,h=!0)}return h?u:D})},[c]),Q.useEffect(()=>{let D=!0;return e.listModels().then(u=>{D&&_(u)}).catch(()=>{}),()=>{D=!1,l.current+=1}},[e]),Q.useEffect(()=>{let D=!0;return S(void 0),e.listGatewayModels?.().then(u=>{D&&S(u)}).catch(()=>{}),()=>{D=!1}},[e,v]);const N=(D,u)=>{B(h=>({...h,[D]:u}))},q=(D,u,h,W)=>{b(F=>({...F,[D]:u?{message:u,offeringId:h,authorization:W}:void 0}))},m=Q.useCallback(async D=>{const u=D.verificationUriComplete??D.authorizationUrl??D.verificationUri;u&&await r(u)},[r]),U=async D=>{N(D,!0),q(D),H(u=>({...u,[D]:void 0}));try{const u=await e.beginConnect(D,"browserAssistedApiKey");T(W=>({...W,[D]:u}));const h=Ps(u.status);if(P(D,h?"pending":u.status==="completed"?"configured":"failed"),!h&&u.status!=="completed"){q(D,u.message??Au(u.status));return}await m(u)}catch(u){P(D,"failed"),q(D,Qe(u))}finally{N(D,!1)}},J=async D=>{if(D.browserMode!=="connectUnsupported"){if(D.browserMode==="browserAssistedApiKey"){await U(D.id);return}await de(D.id,D.browserMode)}},K=async(D,u,h,W)=>{if(h==="browserAssistedApiKey"){await U(D);return}await de(D,h,u.id,W?.id)},de=async(D,u,h,W)=>{if(u==="connectUnsupported")return;N(D,!0),q(D),H(ee=>({...ee,[D]:h}));const F=l.current+1;l.current=F;try{const ee=await e.beginConnect(D,u,{offeringId:h,authorizationMethodId:W});if(T(ge=>({...ge,[D]:ee})),!Ps(ee.status)){const ge=ee.status==="completed";ge?await me(D):P(D,"failed"),ge||q(D,ee.status==="unsupported"?"当前部署未启用账号授权":ee.message??Au(ee.status),h,{mode:u,authorizationMethodId:W}),N(D,!1);return}P(D,"pending"),await m(ee),s0(e,D,ee,F,l,{onAttempt:ge=>T(be=>({...be,[D]:ge})),onConnected:()=>me(D),onFailed:ge=>{P(D,"failed"),q(D,ge,h,{mode:u,authorizationMethodId:W})},onFinished:()=>N(D,!1)})}catch(ee){P(D,"failed"),q(D,Qe(ee),h,{mode:u,authorizationMethodId:W}),N(D,!1)}},me=async D=>{P(D,"connected");try{const u=(await e.listProviders()).find(h=>h.id===D);u&&j(h=>({...h,[D]:u}))}catch(u){q(D,`账号已连接,连接信息刷新失败:${Qe(u)}`)}},pe=async(D,u)=>{l.current+=1,N(D,!1),T(h=>({...h,[D]:void 0})),H(h=>({...h,[D]:void 0})),P(D,"failed");try{await e.cancelConnect?.(D,u),q(D,"连接已取消")}catch(h){q(D,Qe(h))}},ve=async D=>{const u=x[D.id]?.trim(),h=oe[D.id]??s[D.id]?.baseUrl??"",W=fe[D.id];if(!(!u||!W)){N(D.id,!0),q(D.id);try{const F=await e.completeApiKey(D.id,W,u,void 0,h.trim());T(ee=>({...ee,[D.id]:F})),$(ee=>({...ee,[D.id]:""})),P(D.id,"configured"),pt({description:"API Key 已保存"})}catch(F){q(D.id,Qe(F)),P(D.id,"failed")}finally{N(D.id,!1)}}},_e=async(D,u)=>{const h=u?w[D]?.credentials.find(W=>W.id===u)?.offeringId:void 0;N(D,!0),q(D);try{await e.disconnect(D,u),T(W=>({...W,[D]:void 0})),H(W=>({...W,[D]:void 0})),ne(W=>({...W,[D]:h?{...W[D],[h]:void 0}:void 0})),u?(j(W=>({...W,[D]:Su(w[D],D,u)})),pt({description:"已从当前 Pod 移除账号"})):(P(D,"disconnected"),pt({description:"已断开连接"}))}catch(W){q(D,Qe(W),h)}finally{N(D,!1)}},Ce=(D,u)=>{j(h=>({...h,[D]:vu(w[D],D,u)})),P(D,u.authMode==="apiKey"||u.authMode==="local"?"configured":"connected")},Pe=async(D,u,h=!1,W="")=>{se(F=>({...F,[D]:!0})),q(D);try{const F=u?await e.discoverModels(D,u):await e.discoverModels(D);V(be=>be+1);const ee=w[D]?.selectedModels??[],ge={...h0(D,u),...F.complete===!1?{markMissing:!1}:{}};try{const ze=(await e.listModels()).filter(Re=>Re.provider===D);_(Re=>{const zt=da(Re,D,ze,ge),jn=da(zt,D,F.models,ge);return xu(jn,D,ee,F.models,ge)})}catch{_(be=>xu(da(be,D,F.models,ge),D,ee,F.models,ge))}try{const ze=(await e.listProviders()).find(Re=>Re.id===D);ze&&j(Re=>({...Re,[D]:ze}))}catch{}return F.complete===!1?q(D,"部分连接同步失败,已保留原有模型目录,可稍后重试。",u?.offeringId):h&&pt({variant:F.models.length>0?"success":"default",description:F.models.length>0?`连接成功,已同步 ${F.models.length} 个模型`:"连接成功,但服务商未返回任何模型。请确认该服务支持 /models 接口,或使用「添加模型」手工录入。"}),!0}catch(F){const ee=Qe(F);return q(D,`${W}${ee}`,u?.offeringId),!1}finally{se(F=>({...F,[D]:!1}))}},Nt=async(D,u,h)=>{N(D,!0),q(D);try{const W=await e.createApiKeyCredential(D,{offeringId:u.id,apiKey:h.apiKey,label:h.label,baseUrl:h.baseUrl,proxyUrl:h.proxyUrl,priority:h.priority});Ce(D,W),pt({description:"API Key 已添加"}),await Pe(D,{offeringId:W.offeringId,credentialId:W.id})}catch(W){const F=Qe(W);throw q(D,F,u.id),new Error(F)}finally{N(D,!1)}},Me=async(D,u,h)=>{N(D,!0),q(D);try{const W=u.kind==="local",F=await e.createLocalCredential(D,{offeringId:u.id,authorizationMethodId:h?.id,label:u.label??$e(u),...W?{baseUrl:u.endpoints?.[0]?.baseUrl}:{},priority:10});Ce(D,F),pt({description:`${$e(u)} 已连接`}),u.modelDiscovery?.strategy!=="unsupported"&&await Pe(D,{offeringId:F.offeringId,credentialId:F.id},!1,W?"本地服务已连接,模型获取失败:":"订阅已读取,模型获取失败:")}catch(W){const F=Qe(W);throw q(D,F,u.id),new Error(F)}finally{N(D,!1)}},Mn=async(D,u,h)=>{N(D,!0),q(D);try{const W=await e.updateProviderCredential(D,u.id,{expectedVersion:u.version,...h});Ce(D,W),pt({description:"凭证已更新"}),W.enabled&&await Pe(D,{offeringId:W.offeringId,credentialId:W.id})}catch(W){const F=Qe(W);throw q(D,F,u.offeringId),new Error(F)}finally{N(D,!1)}},Dn=async(D,u)=>{if(u.id===`${D}:current`&&u.version===0){if(w[D]?.credentials.some(h=>h.id!==u.id)){q(D,"请重新加载连接后再移除旧连接。",u.offeringId);return}await _e(D);return}N(D,!0),q(D);try{await e.deleteProviderCredential(D,u.id);const h=Su(w[D],D,u.id);j(W=>({...W,[D]:h})),P(D,oh(h)),pt({description:"凭证已删除"})}catch(h){q(D,Qe(h),u.offeringId)}finally{N(D,!1)}},xr=async(D,u)=>{N(D,!0),q(D);try{const h=await e.testProviderCredential(D,{credentialId:u.id}),W=u0(h);j(F=>({...F,[D]:W?vu(w[D],D,W):Eu(w[D],D,u.id,"healthy")})),pt({variant:"success",description:"测试通过"})}catch(h){const W=(await e.listProviders().catch(()=>[])).find(F=>F.id===D);j(F=>({...F,[D]:W??Eu(w[D],D,u.id,"invalid")})),q(D,Qe(h),u.offeringId)}finally{N(D,!1)}},Pn=async(D,u,h,W,F)=>{if(F<0||F>=h.length)return;const ee=[...h],[ge]=ee.splice(W,1);if(ge){ee.splice(F,0,ge),N(D,!0),q(D);try{const be=[];for(const[ze,Re]of ee.entries()){const zt=(ze+1)*10;if(Re.priority===zt){be.push(Re);continue}be.push(await e.updateProviderCredential(D,Re.id,{expectedVersion:Re.version,priority:zt}))}j(ze=>({...ze,[D]:c0(w[D],D,u,be)})),pt({description:"顺序已保存"})}catch(be){q(D,Qe(be),u.id)}finally{N(D,!1)}}},Ir=Q.useRef(new Set),kn=async(D,u,h)=>{const W=h?[h]:(w[D]?.credentials??[]).filter(F=>F.enabled&&F.offeringId===u.id);await Promise.all(W.map(async F=>{const ee=`${D}\0${F.id}`;if(Ir.current.has(ee))return;Ir.current.add(ee);const ge=be=>{ne(ze=>({...ze,[D]:{...ze[D],[F.id]:be}}))};ge({busy:!0,credentialId:F.id});try{const be=await e.quota(D,!0,{offeringId:u.id,credentialId:F.id,credentialIri:F.id});ge({quota:be,busy:!1,credentialId:F.id})}catch(be){ge({busy:!1,error:Qe(be),credentialId:F.id})}finally{Ir.current.delete(ee)}}))},Rr=async D=>{await Pe(D,D==="custom"&&a?{credentialId:a}:void 0,!0)},lr=Q.useCallback(async()=>{V(D=>D+1);try{_(await e.listModels())}catch{}},[e]),$r=(D,u)=>{C(void 0),Y({provider:D,model:u})},Cr=async D=>{if(!ce)return;const u=!!ce.model;Z(!0),C(void 0);try{await e.saveProviderModel(ce.provider,{id:D.id,displayName:D.name||void 0,inputModalities:D.inputModalities.length>0?D.inputModalities:void 0,capabilities:D.capabilities.length>0?D.capabilities:void 0}),Y(void 0),pt({description:u?"模型已更新":"模型已添加"}),await lr()}catch(h){C(Qe(h))}finally{Z(!1)}},Xt=async(D,u)=>{q(D);try{await e.deleteProviderModel(D,u.id),_(h=>h.filter(W=>!(W.provider===D&&W.id===u.id))),pt({description:"模型已移除"}),lr()}catch(h){q(D,Qe(h))}},Tn=Q.useCallback((D,u)=>{const h=[...new Set(u)],W=X[D]??w[D]?.selectedModels.map(dr)??[],F=(f.current[D]??0)+1;f.current[D]=F,re(ee=>({...ee,[D]:h})),G(ee=>({...ee,[D]:"saving"})),(async()=>{try{const ee=[...E.filter(be=>be.provider===D),...w[D]?.selectedModels??[]],ge=h.map(be=>{const ze=ee.find(Re=>dr(Re)===be);return ze?y0(ze):{id:be}});D==="custom"?await e.saveModelSelection?.(D,ge,a):await e.saveModelSelection?.(D,ge),f.current[D]===F&&(V(be=>be+1),G(be=>({...be,[D]:"saved"})),A?.(D,h))}catch(ee){if(f.current[D]!==F)return;G(ge=>({...ge,[D]:"error"})),re(ge=>({...ge,[D]:W})),A?.(D,W),pt({variant:"destructive",description:Qe(ee)})}})()},[e,w,f,E,A,a,X]),On=y.jsxs("section",{children:[d?y.jsxs("p",{className:"mb-4 rounded-md border border-destructive/30 px-3 py-2 text-sm text-destructive",children:["Provider 状态读取失败:",d]}):null,at.filter(D=>D.id===(o??"openai")).map(D=>{const u=w[D.id],h=p0(E.filter(F=>F.provider===D.id&&(D.id!=="custom"||!a||F.credentialId===a)),u?.selectedModels??[]),W=X[D.id]??u?.selectedModels.map(dr)??[];return y.jsx(qm,{definition:D,product:u,status:a0(I[D.id],u),accountLabel:s[D.id]?.accountLabel,attempt:fe[D.id],attemptOfferingId:k[D.id],apiKey:x[D.id]??"",baseUrl:oe[D.id]??s[D.id]?.baseUrl??"",busy:!!(he[D.id]||L[D.id]),disabled:p,error:le[D.id],quotas:z[D.id],models:h,selectedModelIds:W,modelSelectionStatus:ie[D.id],onApiKeyChange:F=>$(ee=>({...ee,[D.id]:F})),onBaseUrlChange:F=>ae(ee=>({...ee,[D.id]:F})),onBeginApiKey:()=>{U(D.id)},onBeginOffering:(F,ee,ge)=>{K(D.id,F,ee,ge)},onCancelConnect:F=>{pe(D.id,F)},onBeginBrowser:()=>{J(D)},onSaveApiKey:()=>{ve(D)},onDisconnect:F=>{_e(D.id,F?.id)},onCreateApiKeyCredential:(F,ee)=>Nt(D.id,F,ee),onCreateLocalCredential:(F,ee)=>Me(D.id,F,ee),onUpdateCredential:(F,ee)=>Mn(D.id,F,ee),onDeleteCredential:F=>{Dn(D.id,F)},onTestCredential:F=>{xr(D.id,F)},onReorderCredentials:(F,ee,ge,be)=>{Pn(D.id,F,ee,ge,be)},onRefreshQuota:(F,ee)=>{kn(D.id,F,ee)},verifyPending:!!L[D.id],onVerify:()=>{Rr(D.id)},onAddModel:()=>$r(D.id),onEditModel:F=>$r(D.id,F),onDeleteModel:F=>{Xt(D.id,F)},onModelSelectionChange:Tn,onDismissError:()=>q(D.id)},D.id)})]}),Zt=y.jsx(t0,{client:e,clientConfigurationBridge:n,gatewayModels:R});return y.jsxs("div",{"data-testid":"ai-connections-panel",className:"mx-auto w-full max-w-5xl space-y-10 px-4 py-6 sm:px-8 sm:py-8",children:[t?y.jsx(Np,{}):null,i==="keys"?Zt:null,i==="provider"?On:null,i==="provider"&&ce?y.jsx(Gm,{open:!0,providerName:at.find(D=>D.id===ce.provider)?.name??ce.provider,initialValue:ce.model?{id:ce.model.id,name:ce.model.displayName??"",inputModalities:ce.model.inputModalities??[],capabilities:ce.model.capabilities??[]}:void 0,error:te,saving:O,onOpenChange:D=>{D||Y(void 0)},onSave:D=>{Cr(D)}}):null]})}function oh(e){if(!e||e.status==="unconfigured"||e.status==="unavailable")return"disconnected";if(e.status==="configured")return"configured";if(e.status==="attention")return"reauthRequired";const t=e.credentials.find(r=>r.enabled)??e.credentials[0];return t?.authMode==="oauth"||t?.authMode==="deviceCode"?"connected":"configured"}function a0(e,t){return e==="pending"||e==="failed"?e:t?oh(t):e??"unknown"}async function s0(e,t,r,n,i,o){let a=r;try{for(;i.current===n&&Ps(a.status);){if(await f0(Math.max(1,a.intervalSeconds??2)*1e3),i.current!==n)return;a={...a,...await e.pollDevice(t,a)},o.onAttempt(a)}a.status==="completed"?await o.onConnected():i.current===n&&o.onFailed(a.message||`连接${a.status==="expired"?"已过期":"失败"}`)}catch(s){i.current===n&&o.onFailed(Qe(s))}finally{i.current===n&&o.onFinished()}}function Ps(e){return e==="pending"||e==="authorization_pending"||e==="slow_down"}function Au(e){return e==="expired"?"连接已过期,请重新开始":e==="cancelled"?"连接已取消":e==="unsupported"?"当前 Provider 不支持此连接方式":"连接失败"}function l0(e){return e==="configured"?"configured":e==="connected"?"connected":e==="failed"||e==="reauthRequired"?"attention":e==="pending"?"loading":"unconfigured"}function vu(e,t,r){const n=e??qo(t),i=ah([...n.credentials.filter(o=>o.id!==r.id),r]);return{...n,credentials:i,status:ll(i)}}function Su(e,t,r){const n=e??qo(t),i=n.credentials.filter(o=>o.id!==r);return{...n,credentials:i,status:ll(i)}}function Eu(e,t,r,n){const i=e??qo(t),o=i.credentials.map(a=>a.id===r?{...a,health:n}:a);return{...i,credentials:o,status:o.some(a=>a.enabled&&a.health==="invalid")?"attention":ll(o)}}function u0(e){const t=e.credential;if(!t||typeof t!="object")return;const r=t;return typeof r.id=="string"&&typeof r.offeringId=="string"&&(r.authMode==="oauth"||r.authMode==="deviceCode"||r.authMode==="apiKey"||r.authMode==="local")&&typeof r.version=="number"?r:void 0}function ll(e){if(e.length===0)return"unconfigured";const t=e.filter(r=>r.enabled);return t.length===0?"configured":t.some(r=>r.health==="expired"||r.health==="invalid")?"attention":"available"}function c0(e,t,r,n){const i=e??qo(t),o=new Set(n.map(a=>a.id));return{...i,offerings:i.offerings.some(a=>a.id===r.id)?i.offerings:[...i.offerings,r],credentials:ah([...i.credentials.filter(a=>!o.has(a.id)),...n])}}function qo(e){return{id:e,name:at.find(t=>t.id===e)?.name??e,offerings:[],credentials:[],selectedModels:[],status:"unconfigured"}}function ah(e){return[...e].sort((t,r)=>t.priority-r.priority)}function d0(e){window.open(e,"_blank","noopener,noreferrer")}function f0(e){return new Promise(t=>window.setTimeout(t,e))}function Qe(e){const t=Vd(e);return t==="AI Connection request failed. Please try again."?"请求未完成。请确认 Xpod 正在运行且登录仍有效,然后重试。":t}function h0(e,t){return e==="custom"?t?.credentialId?{markMissing:!0,credentialId:t.credentialId}:{markMissing:!t}:t?.offeringId?{markMissing:!0,offeringId:t.offeringId}:{markMissing:!t}}function da(e,t,r,n={markMissing:!1}){const i=new Set(r.map(a=>a.id)),o=e.map(a=>n.markMissing&&a.provider===t&&!a.custom&&!i.has(a.id)&&(n.offeringId===void 0||a.offeringId===n.offeringId)&&(n.credentialId===void 0||a.credentialId===n.credentialId)?sn({...a,availability:"unavailable"}):a);for(const a of r){const s=a,c="provider"in a,d=s.offeringId??(c?void 0:n.offeringId),p=s.credentialId??(c?void 0:n.credentialId),g=o.findIndex(A=>A.provider!==t?!1:s.resourceId&&A.resourceId?s.resourceId===A.resourceId:p!==void 0?A.id===s.id&&A.credentialId===p:d!==void 0?A.id===s.id&&A.offeringId===d:A.id===s.id&&A.offeringId===void 0);g===-1?o.push(sn({...s,id:s.id,provider:t,availability:s.availability??"available",...d?{offeringId:d}:{},...p?{credentialId:p}:{}})):o[g]=sn({...o[g],...s,provider:t,displayName:s.displayName??o[g].displayName,availability:s.availability??"available",...d?{offeringId:d}:{},...p?{credentialId:p}:{}})}return o}function xu(e,t,r,n,i){if(!i.markMissing||r.length===0)return e;const o=new Set(n.map(s=>s.id)),a=[...e];for(const s of r.filter(c=>c.provider===t)){if(s.custom||i.offeringId!==void 0&&s.offeringId!==i.offeringId||i.credentialId!==void 0&&s.credentialId!==i.credentialId||o.has(s.id))continue;const c=dr(s),d=a.findIndex(g=>g.provider===t&&dr(g)===c),p=sn({...s,availability:"unavailable"});d===-1?a.push(p):a[d]=sn({...a[d],...p,displayName:a[d].displayName??p.displayName})}return a}function p0(e,t){const r=[...e];for(const n of t){const i=r.findIndex(o=>dr(o)===dr(n));if(i===-1){r.push(n);continue}r[i]=sn({...r[i],...n,displayName:r[i].displayName??n.displayName,availability:r[i].availability==="unavailable"?"unavailable":n.availability})}return r}function sn(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}function dr(e){return e.resourceId??(e.offeringId?`${e.offeringId}:${e.id}`:e.id)}function y0(e){return{id:e.id,...e.offeringId?{offeringId:e.offeringId}:{},...e.resourceId?{resourceId:e.resourceId}:{}}}function Iu(e){return e!==void 0}function sh({controller:e,renderToaster:t=!0}){const r=ol(e),n=al(e),i=Zf(e),o=lm(e),a=sl(e),s=eh(e),c=at.find(M=>M.id===n),d=n==="custom"?a.custom?.credentials.find(M=>M.id===i):void 0,p=il.find(M=>M.id===r)?.title,g=d?.label??a[n]?.name??c?.name??n,A=p??`${g} 详情`,I=n==="custom"&&i&&a.custom?{...a,custom:{...a.custom,name:g,offerings:g0(a.custom,d),credentials:a.custom.credentials.filter(M=>M.id===i),selectedModels:a.custom.selectedModels.filter(M=>M.credentialId===i)}}:a;return Q.useEffect(()=>{e.client&&e.loadProviders()},[e]),e.client?y.jsx("section",{role:"region","aria-label":A,children:y.jsx(o0,{client:e.client,renderToaster:t,clientConfigurationBridge:e.clientConfigurationBridge,selectedSection:r,selectedProvider:n,selectedCredentialId:i,openExternal:e.openExternal,providerSummaries:o,providerProducts:I,providerLoadError:s,providerLoading:!a[n]&&!s,onProviderStateChange:e.setProviderState})}):y.jsxs("section",{role:"alert","aria-label":"AI Connections unavailable",children:[y.jsx("h2",{children:"AI Connections 尚未就绪"}),y.jsx("p",{children:"宿主需要先提供已登录的 WebID 和可用的 Pod。"})]})}function g0(e,t){if(!t)return e.offerings;const r=t.compatibility??(t.offeringId==="anthropic-compatible"?"anthropic":"openai"),n=e.offerings.find(i=>i.id===t.offeringId)??e.offerings[0];return n?[{...n,id:t.offeringId,label:r==="auto"?"自动探测":r==="anthropic"?"Anthropic 兼容":"OpenAI 兼容",endpoints:t.baseUrl?[{protocol:r==="anthropic"?"anthropic":"chatCompletions",baseUrl:t.baseUrl}]:n.endpoints,modelDiscovery:r==="anthropic"?{strategy:"anthropic",path:"/models",endpointProtocol:"anthropic"}:r==="auto"?{strategy:"auto",path:"/models",endpointProtocol:"auto"}:{strategy:"openaiCompatible",path:"/models",endpointProtocol:"chatCompletions"}}]:[]}function b0({open:e,saving:t=!1,error:r,onOpenChange:n,onSave:i}){const[o,a]=Q.useState(""),[s,c]=Q.useState("auto"),[d,p]=Q.useState(""),[g,A]=Q.useState(""),[I,M]=Q.useState(""),[E,_]=Q.useState();Q.useEffect(()=>{e&&(a(""),c("auto"),p(""),A(""),M(""),_(void 0))},[e]);const R=()=>{_(void 0);let S;try{S=m0(d)}catch{_("Base URL 必须是有效的 http(s) 地址。");return}const v=o.trim(),V=g.trim();if(!v){_("请输入 Provider 名称。");return}if(!V){_("请输入 API Key。");return}i({offeringId:w0(s),apiKey:V,label:v,baseUrl:S,priority:10,compatibility:s,...I.trim()?{proxyUrl:I.trim()}:{}})};return y.jsx(Ei,{open:e,onOpenChange:n,children:y.jsxs(wn,{className:"max-w-md",style:{maxHeight:"calc(100vh - 2rem)",overflowY:"auto"},"aria-describedby":"ai-custom-provider-description",children:[y.jsx(xi,{children:y.jsx(_n,{children:"添加自定义 Provider"})}),y.jsx("p",{id:"ai-custom-provider-description",className:"text-sm text-muted-foreground",children:"用 OpenAI/Anthropic 兼容协议接入第三方模型服务。Xpod 会把真实 API Key 存进当前 Pod。"}),y.jsxs("div",{className:"flex flex-col gap-4 py-2",children:[y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(er,{htmlFor:"ai-custom-provider-name",children:"Provider 名称"}),y.jsx(st,{id:"ai-custom-provider-name",value:o,disabled:t,placeholder:"例如 OpenRouter",onChange:S=>a(S.target.value)})]}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(er,{htmlFor:"ai-custom-provider-compatibility",children:"兼容协议"}),y.jsxs("select",{id:"ai-custom-provider-compatibility",value:s,disabled:t,"aria-label":"兼容协议",className:"h-9 rounded-md border border-input bg-background px-3 text-sm",onChange:S=>c(S.target.value),children:[y.jsx("option",{value:"auto",children:"自动探测"}),y.jsx("option",{value:"openai",children:"OpenAI 兼容优先"}),y.jsx("option",{value:"anthropic",children:"Anthropic 兼容优先"})]})]}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(er,{htmlFor:"ai-custom-provider-base-url",children:"Base URL"}),y.jsx(st,{id:"ai-custom-provider-base-url",value:d,disabled:t,placeholder:"https://openrouter.ai/api 或 https://openrouter.ai/api/v1",onChange:S=>p(S.target.value)}),y.jsx("p",{className:"text-xs text-muted-foreground",children:"裸域名会自动补齐为 /v1。"})]}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(er,{htmlFor:"ai-custom-provider-api-key",children:"API Key"}),y.jsx(st,{id:"ai-custom-provider-api-key",type:"password",value:g,disabled:t,autoComplete:"new-password","data-lpignore":"true",onChange:S=>A(S.target.value)})]}),y.jsxs("div",{className:"flex flex-col gap-2",children:[y.jsx(er,{htmlFor:"ai-custom-provider-proxy-url",children:"Proxy URL(可选)"}),y.jsx(st,{id:"ai-custom-provider-proxy-url",value:I,disabled:t,placeholder:"http://127.0.0.1:7890",onChange:S=>M(S.target.value)})]}),E||r?y.jsx("p",{className:"text-sm text-destructive",children:E??r}):null]}),y.jsxs(ko,{children:[y.jsx(Ae,{type:"button",variant:"outline",disabled:t,onClick:()=>n(!1),children:"取消"}),y.jsx(Ae,{type:"button",disabled:t,onClick:R,children:"保存自定义 Provider"})]})]})})}function m0(e){const t=e.trim(),r=new URL(t);if(r.protocol!=="http:"&&r.protocol!=="https:")throw new Error("invalid_custom_base_url");r.hash="";const n=r.pathname.replace(/\/+$/u,"");return!n||n===""?r.pathname="/v1":r.pathname=n,r.href.replace(/\/$/u,"")}function w0(e){return e==="anthropic"?"anthropic-compatible":"openai-compatible"}function _0({controller:e}){const t=$f(e),[r,n]=Q.useState(!1),[i,o]=Q.useState(!1),[a,s]=Q.useState(),c=async d=>{if(!e.client){s("请先登录后再添加自定义 Provider。");return}o(!0),s(void 0);let p;try{const g=await e.client.createApiKeyCredential("custom",d);p=g.id,await e.client.discoverModels("custom",{offeringId:g.offeringId,credentialId:g.id,compatibility:d.compatibility}),e.selectProvider("custom",g.id),await e.loadProviders(),n(!1)}catch(g){p&&await e.client.deleteProviderCredential("custom",p).catch(()=>{}),s(g instanceof Error?g.message:"AI Connection request failed. Please try again.")}finally{o(!1)}};return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"flex h-full min-w-0 items-center gap-2 px-3",children:[y.jsxs("div",{className:"relative min-w-0 flex-1",children:[y.jsx(Xf,{"aria-hidden":"true",className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),y.jsx(st,{type:"search","aria-label":"搜索 Provider",placeholder:"搜索 Provider",value:t,onChange:d=>e.setSearchQuery(d.target.value),className:"h-8 border-transparent bg-muted/50 pl-8 text-xs focus-visible:bg-background"})]}),y.jsx(Ae,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 shrink-0","aria-label":"添加 AI Connection",title:"添加 AI Connection",onClick:()=>n(!0),children:y.jsx(ji,{className:"h-4 w-4","aria-hidden":"true"})})]}),y.jsx(b0,{open:r,saving:i,error:a,onOpenChange:n,onSave:d=>{c(d)}})]})}function A0({controller:e}){const t=ol(e),r=al(e),n=sl(e),i=at.find(a=>a.id===r),o=il.find(a=>a.id===t)?.title??n[r]?.name??i?.name??r;return y.jsx("div",{className:"flex h-full min-w-0 items-center px-4",children:y.jsx("h1",{className:"truncate text-sm font-medium text-foreground",children:o})})}const v0=["navigation.openExternal","aiClientConfiguration"];function S0(e){const t=fa(e,"Extension manifest");Ru(t.extensionId,"extensionId"),en(t.name,"name"),en(t.version,"version"),en(t.sdkVersion,"sdkVersion");const r=fa(t.contributes,"contributes");if(!Array.isArray(r.applets)||r.applets.length===0)throw new Error("Extension manifest must contribute at least one Applet");const n=new Set;for(const i of r.applets){const o=fa(i,"Applet manifest"),a=Ru(o.appId,"appId");if(n.has(a))throw new Error(`Extension manifest has duplicate appId: ${a}`);if(n.add(a),en(o.name,"Applet name"),en(o.entry,"Applet entry"),!Array.isArray(o.commands))throw new Error("Applet commands must be an array");if(o.layout!=="single-pane"&&o.layout!=="two-pane")throw new Error("Applet layout must be single-pane or two-pane")}if(!Array.isArray(t.dataModels))throw new Error("Extension dataModels must be an array");if(!Array.isArray(t.hostCapabilities))throw new Error("Extension hostCapabilities must be an array");for(const i of t.hostCapabilities)if(!v0.includes(i))throw new Error(`Extension manifest requested unknown Host capability: ${String(i)}`);return e}function fa(e,t){if(!e||typeof e!="object"||Array.isArray(e))throw new Error(`${t} must be an object`);return e}function en(e,t){if(typeof e!="string"||e.trim().length===0)throw new Error(`${t} must be a non-empty string`);return e}function Ru(e,t){const r=en(e,t);let n;try{n=new URL(r)}catch{throw new Error(`${t} must be a valid HTTPS URL`)}if(n.protocol!=="https:")throw new Error(`${t} must be a valid HTTPS URL`);return r}const lh=S0({extensionId:"https://undefineds.co/extensions/ai-connections",name:"AI Connection",version:"0.1.0",sdkVersion:"1",contributes:{applets:[{appId:"https://undefineds.co/applets/ai-connections",name:"AI Connection",entry:".",commands:[],layout:"two-pane"}]},dataModels:[],hostCapabilities:["navigation.openExternal","aiClientConfiguration"]}),ul=lh.contributes.applets[0],ks={manifest:ul,createController:im,activate(e){e.loadProviders()},slots:{listHeader:_0,list:gm,mainHeader:A0,main:sh}},Cu={manifest:lh,applets:{[ul.appId]:ks}};function E0(e={}){return e.renderToaster!==!1?Cu:{...Cu,applets:{[ul.appId]:{...ks,slots:{...ks.slots,main:({controller:t})=>Q.createElement(sh,{controller:t,renderToaster:!1})}}}}}function x0({collection:e,accountIndex:t,fetch:r=window.fetch.bind(window)}){const n=new Set,i=async a=>{const s=await Fp(a,r,t);if(!s||!new URL(s).pathname.startsWith("/.account/"))throw new Error("客户端凭据地址不属于可信账号服务。");return s},o=(a,s,c)=>r(a,{method:s,credentials:"include",redirect:"error",headers:Lp({Accept:"application/json",...c?{"Content-Type":"application/json"}:{}}),...c?{body:JSON.stringify(c)}:{}});return{async create({name:a,webId:s}){if(!a.trim()||!s)throw new Error("创建客户端凭据需要名称和当前 WebID。");const c=await o(await i(e),"POST",{name:a.trim(),webId:s});if(!c.ok)throw new Error(`创建客户端凭据失败(HTTP ${c.status})。`);const d=await c.json();if(typeof d.id!="string"||!d.id||d.id.includes(":")||typeof d.secret!="string"||!d.secret||typeof d.resource!="string"||!d.resource)throw new Error("账号服务未返回有效的客户端凭据。");const p=await i(d.resource),g=new TextEncoder().encode(`${d.id}:${d.secret}`);return{apiKey:`sk-${btoa(Array.from(g,I=>String.fromCharCode(I)).join(""))}`,resource:p}},async revoke({apiKey:a,resource:s,webId:c}){const d=I0(a),p=await i(s),g=JSON.stringify([p,d,c]),A=await o(p,"GET");if(A.status===404||A.status===410){if(n.has(g))return;throw new Error("无法确认客户端凭据已撤销,请检查当前 Account 登录;Key 记录已保留。")}if(!A.ok)throw new Error(`读取客户端凭据失败(HTTP ${A.status})。`);const I=await A.json();if(I.id!==d||I.webId!==c)throw new Error("客户端凭据与当前 Key 或 WebID 不匹配,未执行删除。");const M=await o(p,"DELETE");if(!M.ok)throw new Error(`撤销客户端凭据失败(HTTP ${M.status})。`);n.add(g)}}}function I0(e){try{if(!e.startsWith("sk-"))throw new Error;const t=e.slice(3),r=Uint8Array.from(atob(t),o=>o.charCodeAt(0)),n=new TextDecoder("utf-8",{fatal:!0}).decode(r),i=n.indexOf(":");if(i<=0||i===n.length-1)throw new Error;return n.slice(0,i)}catch{throw new Error("API Key 不是有效的客户端凭据。")}}var kr={},Un={},Tr={},Or={};var So="@@__IMMUTABLE_INDEXED__@@";function _t(e){return!!(e&&e[So])}var Eo="@@__IMMUTABLE_KEYED__@@";function je(e){return!!(e&&e[Eo])}function Ko(e){return je(e)||_t(e)}var uh="@@__IMMUTABLE_ITERABLE__@@";function At(e){return!!(e&&e[uh])}var Je=function(t){return At(t)?t:rt(t)},Tt=(function(e){function t(r){return je(r)?r:Ar(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t})(Je),Gr=(function(e){function t(r){return _t(r)?r:jt(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t})(Je),An=(function(e){function t(r){return At(r)&&!Ko(r)?r:xn(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t})(Je);Je.Keyed=Tt;Je.Indexed=Gr;Je.Set=An;var vn=0,Rt=1,Ct=2,Ts=typeof Symbol=="function"&&Symbol.iterator,ch="@@iterator",zo=Ts||ch,Ee=function(t){this.next=t};Ee.prototype.toString=function(){return"[Iterator]"};Ee.KEYS=vn;Ee.VALUES=Rt;Ee.ENTRIES=Ct;Ee.prototype.inspect=Ee.prototype.toSource=function(){return this.toString()};Ee.prototype[zo]=function(){return this};function Fe(e,t,r,n){var i=e===vn?t:e===Rt?r:[t,r];return n?n.value=i:n={value:i,done:!1},n}function tt(){return{value:void 0,done:!0}}function cl(e){return Array.isArray(e)?!0:!!Wo(e)}function Mu(e){return!!(e&&typeof e.next=="function")}function Os(e){var t=Wo(e);return t&&t.call(e)}function Wo(e){var t=e&&(Ts&&e[Ts]||e[ch]);if(typeof t=="function")return t}function R0(e){var t=Wo(e);return t&&t===e.entries}function C0(e){var t=Wo(e);return t&&t===e.keys}var Ni="delete",Oe=5,It=1<<Oe,ut=It-1,Se={};function js(){return{value:!1}}function kt(e){e&&(e.value=!0)}function dl(){}function un(e){return e.size===void 0&&(e.size=e.__iterate(dh)),e.size}function pr(e,t){if(typeof t!="number"){var r=t>>>0;if(""+r!==t||r===4294967295)return NaN;t=r}return t<0?un(e)+t:t}function dh(){return!0}function Fi(e,t,r){return(e===0&&!hh(e)||r!==void 0&&e<=-r)&&(t===void 0||r!==void 0&&t>=r)}function Sn(e,t){return fh(e,t,0)}function Li(e,t){return fh(e,t,t)}function fh(e,t,r){return e===void 0?r:hh(e)?t===1/0?t:Math.max(0,t+e)|0:t===void 0||t===e?e:Math.min(t,e)|0}function hh(e){return e<0||e===0&&1/e===-1/0}var ph="@@__IMMUTABLE_RECORD__@@";function _r(e){return!!(e&&e[ph])}function Ot(e){return At(e)||_r(e)}var yr="@@__IMMUTABLE_ORDERED__@@";function qt(e){return!!(e&&e[yr])}var yh="@@__IMMUTABLE_SEQ__@@";function Ho(e){return!!(e&&e[yh])}var En=Object.prototype.hasOwnProperty;function fl(e){return Array.isArray(e)||typeof e=="string"?!0:e&&typeof e=="object"&&Number.isInteger(e.length)&&e.length>=0&&(e.length===0?Object.keys(e).length===1:e.hasOwnProperty(e.length-1))}var rt=(function(e){function t(r){return r==null?pl():Ot(r)?r.toSeq():D0(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(n,i){var o=this._cache;if(o){for(var a=o.length,s=0;s!==a;){var c=o[i?a-++s:s++];if(n(c[1],c[0],this)===!1)break}return s}return this.__iterateUncached(n,i)},t.prototype.__iterator=function(n,i){var o=this._cache;if(o){var a=o.length,s=0;return new Ee(function(){if(s===a)return tt();var c=o[i?a-++s:s++];return Fe(n,c[0],c[1])})}return this.__iteratorUncached(n,i)},t})(Je),Ar=(function(e){function t(r){return r==null?pl().toKeyedSeq():At(r)?je(r)?r.toSeq():r.fromEntrySeq():_r(r)?r.toSeq():yl(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t})(rt),jt=(function(e){function t(r){return r==null?pl():At(r)?je(r)?r.entrySeq():r.toIndexedSeq():_r(r)?r.toSeq().entrySeq():gh(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t})(rt),xn=(function(e){function t(r){return(At(r)&&!Ko(r)?r:jt(r)).toSetSeq()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t})(rt);rt.isSeq=Ho;rt.Keyed=Ar;rt.Set=xn;rt.Indexed=jt;rt.prototype[yh]=!0;var cn=(function(e){function t(r){this._array=r,this.size=r.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,i){return this.has(n)?this._array[pr(this,n)]:i},t.prototype.__iterate=function(n,i){for(var o=this._array,a=o.length,s=0;s!==a;){var c=i?a-++s:s++;if(n(o[c],c,this)===!1)break}return s},t.prototype.__iterator=function(n,i){var o=this._array,a=o.length,s=0;return new Ee(function(){if(s===a)return tt();var c=i?a-++s:s++;return Fe(n,c,o[c])})},t})(jt),hl=(function(e){function t(r){var n=Object.keys(r).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r):[]);this._object=r,this._keys=n,this.size=n.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,i){return i!==void 0&&!this.has(n)?i:this._object[n]},t.prototype.has=function(n){return En.call(this._object,n)},t.prototype.__iterate=function(n,i){for(var o=this._object,a=this._keys,s=a.length,c=0;c!==s;){var d=a[i?s-++c:c++];if(n(o[d],d,this)===!1)break}return c},t.prototype.__iterator=function(n,i){var o=this._object,a=this._keys,s=a.length,c=0;return new Ee(function(){if(c===s)return tt();var d=a[i?s-++c:c++];return Fe(n,d,o[d])})},t})(Ar);hl.prototype[yr]=!0;var M0=(function(e){function t(r){this._collection=r,this.size=r.length||r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(n,i){if(i)return this.cacheResult().__iterate(n,i);var o=this._collection,a=Os(o),s=0;if(Mu(a))for(var c;!(c=a.next()).done&&n(c.value,s++,this)!==!1;);return s},t.prototype.__iteratorUncached=function(n,i){if(i)return this.cacheResult().__iterator(n,i);var o=this._collection,a=Os(o);if(!Mu(a))return new Ee(tt);var s=0;return new Ee(function(){var c=a.next();return c.done?c:Fe(n,s++,c.value)})},t})(jt),Du;function pl(){return Du||(Du=new cn([]))}function yl(e){var t=gl(e);if(t)return t.fromEntrySeq();if(typeof e=="object")return new hl(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function gh(e){var t=gl(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function D0(e){var t=gl(e);if(t)return R0(e)?t.fromEntrySeq():C0(e)?t.toSetSeq():t;if(typeof e=="object")return new hl(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}function gl(e){return fl(e)?new cn(e):cl(e)?new M0(e):void 0}function Ui(){return this.__ensureOwner()}function Bi(){return this.__ownerID?this:this.__ensureOwner(new dl)}var Bn=typeof Math.imul=="function"&&Math.imul(4294967295,2)===-2?Math.imul:function(t,r){t|=0,r|=0;var n=t&65535,i=r&65535;return n*i+((t>>>16)*i+n*(r>>>16)<<16>>>0)|0};function Vo(e){return e>>>1&1073741824|e&3221225471}var P0=Object.prototype.valueOf;function lt(e){if(e==null)return Pu(e);if(typeof e.hashCode=="function")return Vo(e.hashCode(e));var t=L0(e);if(t==null)return Pu(t);switch(typeof t){case"boolean":return t?1108378657:1108378656;case"number":return k0(t);case"string":return t.length>U0?T0(t):Ns(t);case"object":case"function":return N0(t);case"symbol":return j0(t);default:if(typeof t.toString=="function")return Ns(t.toString());throw new Error("Value type "+typeof t+" cannot be hashed.")}}function Pu(e){return e===null?1108378658:1108378659}function k0(e){if(e!==e||e===1/0)return 0;var t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)e/=4294967295,t^=e;return Vo(t)}function T0(e){var t=ya[e];return t===void 0&&(t=Ns(e),pa===B0&&(pa=0,ya={}),pa++,ya[e]=t),t}function Ns(e){for(var t=0,r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)|0;return Vo(t)}var O0=(Math.random()*1048576|1)%1048576||40503;function bl(e){if(typeof e!="string")return lt(e);for(var t=0,r=0;r<e.length;r++)t=O0*t+e.charCodeAt(r)|0;return t}function j0(e){var t=Ou[e];return t!==void 0||(t=bh(),Ou[e]=t),t}function N0(e){var t;if(Fs&&(t=Ls.get(e),t!==void 0)||(t=e[Kr],t!==void 0)||!Tu&&(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[Kr],t!==void 0||(t=F0(e),t!==void 0)))return t;if(t=bh(),Fs)Ls.set(e,t);else{if(ku!==void 0&&ku(e)===!1)throw new Error("Non-extensible objects are not allowed as keys.");if(Tu)Object.defineProperty(e,Kr,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(e.propertyIsEnumerable!==void 0&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[Kr]=t;else if(e.nodeType!==void 0)e[Kr]=t;else throw new Error("Unable to set a non-enumerable property on object.")}return t}var ku=Object.isExtensible,Tu=(function(){try{return Object.defineProperty({},"@",{}),!0}catch{return!1}})();function F0(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}function L0(e){return e.valueOf!==P0&&typeof e.valueOf=="function"?e.valueOf(e):e}function bh(){var e=++ha;return ha&1073741824&&(ha=0),e}var Fs=typeof WeakMap=="function",Ls;Fs&&(Ls=new WeakMap);var Ou=Object.create(null),ha=0,Kr="__immutablehash__";typeof Symbol=="function"&&(Kr=Symbol(Kr));var U0=16,B0=255,pa=0,ya={},Qo=(function(e){function t(r,n){this._iter=r,this._useKeys=n,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,i){return this._iter.get(n,i)},t.prototype.has=function(n){return this._iter.has(n)},t.prototype.valueSeq=function(){return this._iter.valueSeq()},t.prototype.reverse=function(){var n=this,i=ml(this,!0);return this._useKeys||(i.valueSeq=function(){return n._iter.toSeq().reverse()}),i},t.prototype.map=function(n,i){var o=this,a=vh(this,n,i);return this._useKeys||(a.valueSeq=function(){return o._iter.toSeq().map(n,i)}),a},t.prototype.__iterate=function(n,i){var o=this;return this._iter.__iterate(function(a,s){return n(a,s,o)},i)},t.prototype.__iterator=function(n,i){return this._iter.__iterator(n,i)},t})(Ar);Qo.prototype[yr]=!0;var mh=(function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.includes=function(n){return this._iter.includes(n)},t.prototype.__iterate=function(n,i){var o=this,a=0;return i&&un(this),this._iter.__iterate(function(s){return n(s,i?o.size-++a:a++,o)},i)},t.prototype.__iterator=function(n,i){var o=this,a=this._iter.__iterator(Rt,i),s=0;return i&&un(this),new Ee(function(){var c=a.next();return c.done?c:Fe(n,i?o.size-++s:s++,c.value,c)})},t})(jt),wh=(function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.has=function(n){return this._iter.includes(n)},t.prototype.__iterate=function(n,i){var o=this;return this._iter.__iterate(function(a){return n(a,a,o)},i)},t.prototype.__iterator=function(n,i){var o=this._iter.__iterator(Rt,i);return new Ee(function(){var a=o.next();return a.done?a:Fe(n,a.value,a.value,a)})},t})(xn),_h=(function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.entrySeq=function(){return this._iter.toSeq()},t.prototype.__iterate=function(n,i){var o=this;return this._iter.__iterate(function(a){if(a){Nu(a);var s=At(a);return n(s?a.get(1):a[1],s?a.get(0):a[0],o)}},i)},t.prototype.__iterator=function(n,i){var o=this._iter.__iterator(Rt,i);return new Ee(function(){for(;;){var a=o.next();if(a.done)return a;var s=a.value;if(s){Nu(s);var c=At(s);return Fe(n,c?s.get(0):s[0],c?s.get(1):s[1],a)}}})},t})(Ar);mh.prototype.cacheResult=Qo.prototype.cacheResult=wh.prototype.cacheResult=_h.prototype.cacheResult=Al;function Ah(e){var t=Yt(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var r=e.reverse.apply(this);return r.flip=function(){return e.reverse()},r},t.has=function(r){return e.includes(r)},t.includes=function(r){return e.has(r)},t.cacheResult=Al,t.__iterateUncached=function(r,n){var i=this;return e.__iterate(function(o,a){return r(a,o,i)!==!1},n)},t.__iteratorUncached=function(r,n){if(r===Ct){var i=e.__iterator(r,n);return new Ee(function(){var o=i.next();if(!o.done){var a=o.value[0];o.value[0]=o.value[1],o.value[1]=a}return o})}return e.__iterator(r===Rt?vn:Rt,n)},t}function vh(e,t,r){var n=Yt(e);return n.size=e.size,n.has=function(i){return e.has(i)},n.get=function(i,o){var a=e.get(i,Se);return a===Se?o:t.call(r,a,i,e)},n.__iterateUncached=function(i,o){var a=this;return e.__iterate(function(s,c,d){return i(t.call(r,s,c,d),c,a)!==!1},o)},n.__iteratorUncached=function(i,o){var a=e.__iterator(Ct,o);return new Ee(function(){var s=a.next();if(s.done)return s;var c=s.value,d=c[0];return Fe(i,d,t.call(r,c[1],d,e),s)})},n}function ml(e,t){var r=Yt(e);return r._iter=e,r.size=e.size,r.reverse=function(){return e},e.flip&&(r.flip=function(){var n=Ah(e);return n.reverse=function(){return e.flip()},n}),r.get=function(n,i){return e.get(t?n:-1-n,i)},r.has=function(n){return e.has(t?n:-1-n)},r.includes=function(n){return e.includes(n)},r.cacheResult=Al,r.__iterate=function(n,i){var o=this,a=0;return i&&un(e),e.__iterate(function(s,c){return n(s,t?c:i?o.size-++a:a++,o)},!i)},r.__iterator=function(n,i){var o=0;i&&un(e);var a=e.__iterator(Ct,!i);return new Ee(function(){var s=a.next();if(s.done)return s;var c=s.value;return Fe(n,t?c[0]:i?r.size-++o:o++,c[1],s)})},r}function Sh(e,t,r,n){var i=Yt(e);return n&&(i.has=function(o){var a=e.get(o,Se);return a!==Se&&!!t.call(r,a,o,e)},i.get=function(o,a){var s=e.get(o,Se);return s!==Se&&t.call(r,s,o,e)?s:a}),i.__iterateUncached=function(o,a){var s=this,c=0;return e.__iterate(function(d,p,g){if(t.call(r,d,p,g))return c++,o(d,n?p:c-1,s)},a),c},i.__iteratorUncached=function(o,a){var s=e.__iterator(Ct,a),c=0;return new Ee(function(){for(;;){var d=s.next();if(d.done)return d;var p=d.value,g=p[0],A=p[1];if(t.call(r,A,g,e))return Fe(o,n?g:c++,A,d)}})},i}function q0(e,t,r){var n=Jr().asMutable();return e.__iterate(function(i,o){n.update(t.call(r,i,o,e),0,function(a){return a+1})}),n.asImmutable()}function K0(e,t,r){var n=je(e),i=(qt(e)?Jt():Jr()).asMutable();e.__iterate(function(a,s){i.update(t.call(r,a,s,e),function(c){return c=c||[],c.push(n?[s,a]:a),c})});var o=_l(e);return i.map(function(a){return Te(e,o(a))}).asImmutable()}function z0(e,t,r){var n=je(e),i=[[],[]];e.__iterate(function(a,s){i[t.call(r,a,s,e)?1:0].push(n?[s,a]:a)});var o=_l(e);return i.map(function(a){return Te(e,o(a))})}function wl(e,t,r,n){var i=e.size;if(Fi(t,r,i))return e;if(typeof i>"u"&&(t<0||r<0))return wl(e.toSeq().cacheResult(),t,r,n);var o=Sn(t,i),a=Li(r,i),s=a-o,c;s===s&&(c=s<0?0:s);var d=Yt(e);return d.size=c===0?c:e.size&&c||void 0,!n&&Ho(e)&&c>=0&&(d.get=function(p,g){return p=pr(this,p),p>=0&&p<c?e.get(p+o,g):g}),d.__iterateUncached=function(p,g){var A=this;if(c===0)return 0;if(g)return this.cacheResult().__iterate(p,g);var I=0,M=!0,E=0;return e.__iterate(function(_,R){if(!(M&&(M=I++<o)))return E++,p(_,n?R:E-1,A)!==!1&&E!==c}),E},d.__iteratorUncached=function(p,g){if(c!==0&&g)return this.cacheResult().__iterator(p,g);if(c===0)return new Ee(tt);var A=e.__iterator(p,g),I=0,M=0;return new Ee(function(){for(;I++<o;)A.next();if(++M>c)return tt();var E=A.next();return n||p===Rt||E.done?E:p===vn?Fe(p,M-1,void 0,E):Fe(p,M-1,E.value[1],E)})},d}function W0(e,t,r){var n=Yt(e);return n.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=0;return e.__iterate(function(c,d,p){return t.call(r,c,d,p)&&++s&&i(c,d,a)}),s},n.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(Ct,o),c=!0;return new Ee(function(){if(!c)return tt();var d=s.next();if(d.done)return d;var p=d.value,g=p[0],A=p[1];return t.call(r,A,g,a)?i===Ct?d:Fe(i,g,A,d):(c=!1,tt())})},n}function Eh(e,t,r,n){var i=Yt(e);return i.__iterateUncached=function(o,a){var s=this;if(a)return this.cacheResult().__iterate(o,a);var c=!0,d=0;return e.__iterate(function(p,g,A){if(!(c&&(c=t.call(r,p,g,A))))return d++,o(p,n?g:d-1,s)}),d},i.__iteratorUncached=function(o,a){var s=this;if(a)return this.cacheResult().__iterator(o,a);var c=e.__iterator(Ct,a),d=!0,p=0;return new Ee(function(){var g,A,I;do{if(g=c.next(),g.done)return n||o===Rt?g:o===vn?Fe(o,p++,void 0,g):Fe(o,p++,g.value[1],g);var M=g.value;A=M[0],I=M[1],d&&(d=t.call(r,I,A,s))}while(d);return o===Ct?g:Fe(o,A,I,g)})},i}var H0=(function(e){function t(r){this._wrappedIterables=r.flatMap(function(n){return n._wrappedIterables?n._wrappedIterables:[n]}),this.size=this._wrappedIterables.reduce(function(n,i){if(n!==void 0){var o=i.size;if(o!==void 0)return n+o}},0),this[Eo]=this._wrappedIterables[0][Eo],this[So]=this._wrappedIterables[0][So],this[yr]=this._wrappedIterables[0][yr]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(n,i){if(this._wrappedIterables.length!==0){if(i)return this.cacheResult().__iterate(n,i);for(var o=0,a=je(this),s=a?Ct:Rt,c=this._wrappedIterables[o].__iterator(s,i),d=!0,p=0;d;){for(var g=c.next();g.done;){if(o++,o===this._wrappedIterables.length)return p;c=this._wrappedIterables[o].__iterator(s,i),g=c.next()}var A=a?n(g.value[1],g.value[0],this):n(g.value,p,this);d=A!==!1,p++}return p}},t.prototype.__iteratorUncached=function(n,i){var o=this;if(this._wrappedIterables.length===0)return new Ee(tt);if(i)return this.cacheResult().__iterator(n,i);var a=0,s=this._wrappedIterables[a].__iterator(n,i);return new Ee(function(){for(var c=s.next();c.done;){if(a++,a===o._wrappedIterables.length)return c;s=o._wrappedIterables[a].__iterator(n,i),c=s.next()}return c})},t})(rt);function V0(e,t){var r=je(e),n=[e].concat(t).map(function(o){return At(o)?r&&(o=Tt(o)):o=r?yl(o):gh(Array.isArray(o)?o:[o]),o}).filter(function(o){return o.size!==0});if(n.length===0)return e;if(n.length===1){var i=n[0];if(i===e||r&&je(i)||_t(e)&&_t(i))return i}return new H0(n)}function xh(e,t,r){var n=Yt(e);return n.__iterateUncached=function(i,o){if(o)return this.cacheResult().__iterate(i,o);var a=0,s=!1;function c(d,p){d.__iterate(function(g,A){return(!t||p<t)&&At(g)?c(g,p+1):(a++,i(g,r?A:a-1,n)===!1&&(s=!0)),!s},o)}return c(e,0),a},n.__iteratorUncached=function(i,o){if(o)return this.cacheResult().__iterator(i,o);var a=e.__iterator(i,o),s=[],c=0;return new Ee(function(){for(;a;){var d=a.next();if(d.done!==!1){a=s.pop();continue}var p=d.value;if(i===Ct&&(p=p[1]),(!t||s.length<t)&&At(p))s.push(a),a=p.__iterator(i,o);else return r?d:Fe(i,c++,p,d)}return tt()})},n}function Q0(e,t,r){var n=_l(e);return e.toSeq().map(function(i,o){return n(t.call(r,i,o,e))}).flatten(!0)}function G0(e,t){var r=Yt(e);return r.size=e.size&&e.size*2-1,r.__iterateUncached=function(n,i){var o=this,a=0;return e.__iterate(function(s){return(!a||n(t,a++,o)!==!1)&&n(s,a++,o)!==!1},i),a},r.__iteratorUncached=function(n,i){var o=e.__iterator(Rt,i),a=0,s;return new Ee(function(){return(!s||a%2)&&(s=o.next(),s.done)?s:a%2?Fe(n,a++,t):Fe(n,a++,s.value,s)})},r}function dn(e,t,r){t||(t=Ih);var n=je(e),i=0,o=e.toSeq().map(function(a,s){return[s,a,i++,r?r(a,s,e):a]}).valueSeq().toArray();return o.sort(function(a,s){return t(a[3],s[3])||a[2]-s[2]}).forEach(n?function(a,s){o[s].length=2}:function(a,s){o[s]=a[1]}),n?Ar(o):_t(e)?jt(o):xn(o)}function $i(e,t,r){if(t||(t=Ih),r){var n=e.toSeq().map(function(i,o){return[i,r(i,o,e)]}).reduce(function(i,o){return ju(t,i[1],o[1])?o:i});return n&&n[0]}return e.reduce(function(i,o){return ju(t,i,o)?o:i})}function ju(e,t,r){var n=e(r,t);return n===0&&r!==t&&(r==null||r!==r)||n>0}function eo(e,t,r,n){var i=Yt(e),o=new cn(r).map(function(a){return a.size});return i.size=n?o.max():o.min(),i.__iterate=function(a,s){for(var c=this.__iterator(Rt,s),d,p=0;!(d=c.next()).done&&a(d.value,p++,this)!==!1;);return p},i.__iteratorUncached=function(a,s){var c=r.map(function(g){return g=Je(g),Os(s?g.reverse():g)}),d=0,p=!1;return new Ee(function(){var g;return p||(g=c.map(function(A){return A.next()}),p=n?g.every(function(A){return A.done}):g.some(function(A){return A.done})),p?tt():Fe(a,d++,t.apply(null,g.map(function(A){return A.value})))})},i}function Te(e,t){return e===t?e:Ho(e)?t:e.constructor(t)}function Nu(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function _l(e){return je(e)?Tt:_t(e)?Gr:An}function Yt(e){return Object.create((je(e)?Ar:_t(e)?jt:xn).prototype)}function Al(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):rt.prototype.cacheResult.call(this)}function Ih(e,t){return e===void 0&&t===void 0?0:e===void 0?1:t===void 0?-1:e>t?1:e<t?-1:0}function Us(e){return!!(e&&typeof e.equals=="function"&&typeof e.hashCode=="function")}function Ge(e,t){if(e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1;if(typeof e.valueOf=="function"&&typeof t.valueOf=="function"){if(e=e.valueOf(),t=t.valueOf(),e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1}return!!(Us(e)&&Us(t)&&e.equals(t))}function vl(e,t,r,n){return Yr(e,[t],r,n)}function Rh(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return Mh(this,e)}function Ch(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];if(typeof e!="function")throw new TypeError("Invalid merger function: "+e);return Mh(this,t,e)}function Mh(e,t,r){for(var n=[],i=0;i<t.length;i++){var o=Tt(t[i]);o.size!==0&&n.push(o)}return n.length===0?e:e.toSeq().size===0&&!e.__ownerID&&n.length===1?_r(e)?e:e.constructor(n[0]):e.withMutations(function(a){for(var s=r?function(d,p){vl(a,p,Se,function(g){return g===Se?d:r(g,d,p)})}:function(d,p){a.set(p,d)},c=0;c<n.length;c++)n[c].forEach(s)})}var J0=Object.prototype.toString;function Sl(e){if(!e||typeof e!="object"||J0.call(e)!=="[object Object]")return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var r=t,n=Object.getPrototypeOf(t);n!==null;)r=n,n=Object.getPrototypeOf(r);return r===t}function gr(e){return typeof e=="object"&&(Ot(e)||Array.isArray(e)||Sl(e))}function qi(e){return typeof e=="string"&&(e==="__proto__"||e==="constructor")}function Ht(e,t){t=t||0;for(var r=Math.max(0,e.length-t),n=new Array(r),i=0;i<r;i++)n[i]=e[i+t];return n}function xo(e){if(Array.isArray(e))return Ht(e);var t={};for(var r in e)qi(r)||En.call(e,r)&&(t[r]=e[r]);return t}function Y0(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return zi(e,t)}function X0(e,t){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return zi(t,r,e)}function Z0(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Ki(e,t)}function $0(e,t){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return Ki(t,r,e)}function Ki(e,t,r){return zi(e,t,ew(r))}function zi(e,t,r){if(!gr(e))throw new TypeError("Cannot merge into non-data-structure value: "+e);if(Ot(e))return typeof r=="function"&&e.mergeWith?e.mergeWith.apply(e,[r].concat(t)):e.merge?e.merge.apply(e,t):e.concat.apply(e,t);for(var n=Array.isArray(e),i=e,o=n?Gr:Tt,a=n?function(c){i===e&&(i=xo(i)),i.push(c)}:function(c,d){if(!qi(d)){var p=En.call(i,d),g=p&&r?r(i[d],c,d):c;(!p||g!==i[d])&&(i===e&&(i=xo(i)),i[d]=g)}},s=0;s<t.length;s++)o(t[s]).forEach(a);return i}function ew(e){function t(r,n,i){return gr(r)&&gr(n)&&tw(r,n)?zi(r,[n],t):e?e(r,n,i):n}return t}function tw(e,t){var r=rt(e),n=rt(t);return _t(r)===_t(n)&&je(r)===je(n)}function Dh(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return Ki(this,e)}function Ph(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Ki(this,t,e)}function El(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Yr(this,e,Vt(),function(n){return Ki(n,t)})}function xl(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return Yr(this,e,Vt(),function(n){return zi(n,t)})}function kh(e,t,r){return Yr(e,t,Se,function(){return r})}function Il(e,t){return kh(this,e,t)}function Rl(e,t,r){return arguments.length===1?e(this):vl(this,e,t,r)}function Cl(e,t,r){return Yr(this,e,t,r)}function Ml(){return this.__altered}function Wi(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}var Th="@@__IMMUTABLE_MAP__@@";function Go(e){return!!(e&&e[Th])}function di(e,t){if(!e)throw new Error(t)}function xt(e){di(e!==1/0,"Cannot perform this action with an infinite size.")}var Jr=(function(e){function t(r){return r==null?Vt():Go(r)&&!qt(r)?r:Vt().withMutations(function(n){var i=e(r);xt(i.size),i.forEach(function(o,a){return n.set(a,o)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(n,i){return this._root?this._root.get(0,void 0,n,i):i},t.prototype.set=function(n,i){return Uu(this,n,i)},t.prototype.remove=function(n){return Uu(this,n,Se)},t.prototype.deleteAll=function(n){var i=Je(n);return i.size===0?this:this.withMutations(function(o){i.forEach(function(a){return o.remove(a)})})},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Vt()},t.prototype.sort=function(n){return Jt(dn(this,n))},t.prototype.sortBy=function(n,i){return Jt(dn(this,i,n))},t.prototype.map=function(n,i){var o=this;return this.withMutations(function(a){a.forEach(function(s,c){a.set(c,n.call(i,s,c,o))})})},t.prototype.__iterator=function(n,i){return new rw(this,n,i)},t.prototype.__iterate=function(n,i){var o=this,a=0;return this._root&&this._root.iterate(function(s){return a++,n(s[1],s[0],o)},i),a},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?Dl(this.size,this._root,n,this.__hash):this.size===0?Vt():(this.__ownerID=n,this.__altered=!1,this)},t})(Tt);Jr.isMap=Go;var Le=Jr.prototype;Le[Th]=!0;Le[Ni]=Le.remove;Le.removeAll=Le.deleteAll;Le.setIn=Il;Le.removeIn=Le.deleteIn=Ol;Le.update=Rl;Le.updateIn=Cl;Le.merge=Le.concat=Rh;Le.mergeWith=Ch;Le.mergeDeep=Dh;Le.mergeDeepWith=Ph;Le.mergeIn=xl;Le.mergeDeepIn=El;Le.withMutations=Wi;Le.wasAltered=Ml;Le.asImmutable=Ui;Le["@@transducer/init"]=Le.asMutable=Bi;Le["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])};Le["@@transducer/result"]=function(e){return e.asImmutable()};var yi=function(t,r){this.ownerID=t,this.entries=r};yi.prototype.get=function(t,r,n,i){for(var o=this.entries,a=0,s=o.length;a<s;a++)if(Ge(n,o[a][0]))return o[a][1];return i};yi.prototype.update=function(t,r,n,i,o,a,s){for(var c=o===Se,d=this.entries,p=0,g=d.length;p<g&&!Ge(i,d[p][0]);p++);var A=p<g;if(A?d[p][1]===o:c)return this;if(kt(s),(c||!A)&&kt(a),!(c&&d.length===1)){if(!A&&!c&&d.length>=lw)return nw(t,d,i,o);var I=t&&t===this.ownerID,M=I?d:Ht(d);return A?c?p===g-1?M.pop():M[p]=M.pop():M[p]=[i,o]:M.push([i,o]),I?(this.entries=M,this):new yi(t,M)}};var fn=function(t,r,n){this.ownerID=t,this.bitmap=r,this.nodes=n};fn.prototype.get=function(t,r,n,i){r===void 0&&(r=lt(n));var o=1<<((t===0?r:r>>>t)&ut),a=this.bitmap;return(a&o)===0?i:this.nodes[Oh(a&o-1)].get(t+Oe,r,n,i)};fn.prototype.update=function(t,r,n,i,o,a,s){n===void 0&&(n=lt(i));var c=(r===0?n:n>>>r)&ut,d=1<<c,p=this.bitmap,g=(p&d)!==0;if(!g&&o===Se)return this;var A=Oh(p&d-1),I=this.nodes,M=g?I[A]:void 0,E=Pl(M,t,r+Oe,n,i,o,a,s);if(E===M)return this;if(!g&&E&&I.length>=uw)return ow(t,I,p,c,E);if(g&&!E&&I.length===2&&Bu(I[A^1]))return I[A^1];if(g&&E&&I.length===1&&Bu(E))return E;var _=t&&t===this.ownerID,R=g?E?p:p^d:p|d,S=g?E?jh(I,A,E,_):sw(I,A,_):aw(I,A,E,_);return _?(this.bitmap=R,this.nodes=S,this):new fn(t,R,S)};var gi=function(t,r,n){this.ownerID=t,this.count=r,this.nodes=n};gi.prototype.get=function(t,r,n,i){r===void 0&&(r=lt(n));var o=(t===0?r:r>>>t)&ut,a=this.nodes[o];return a?a.get(t+Oe,r,n,i):i};gi.prototype.update=function(t,r,n,i,o,a,s){n===void 0&&(n=lt(i));var c=(r===0?n:n>>>r)&ut,d=o===Se,p=this.nodes,g=p[c];if(d&&!g)return this;var A=Pl(g,t,r+Oe,n,i,o,a,s);if(A===g)return this;var I=this.count;if(!g)I++;else if(!A&&(I--,I<cw))return iw(t,p,I,c);var M=t&&t===this.ownerID,E=jh(p,c,A,M);return M?(this.count=I,this.nodes=E,this):new gi(t,I,E)};var br=function(t,r,n){this.ownerID=t,this.keyHash=r,this.entries=n,this._index=void 0};br.prototype._positionOf=function(t,r){var n=this.entries,i=this._index;if(i===void 0&&r&&n.length>=dw&&(i=this._buildIndex()),i!==void 0){var o=i[bl(t)];if(o!==void 0)for(var a=0;a<o.length;a++){var s=o[a];if(Ge(t,n[s][0]))return s}return-1}for(var c=0,d=n.length;c<d;c++)if(Ge(t,n[c][0]))return c;return-1};br.prototype._buildIndex=function(){for(var t=Object.create(null),r=this.entries,n=0,i=r.length;n<i;n++){var o=bl(r[n][0]),a=t[o];a!==void 0?a.push(n):t[o]=[n]}return this._index=t,t};br.prototype.get=function(t,r,n,i){var o=this._positionOf(n,!0);return o===-1?i:this.entries[o][1]};br.prototype.update=function(t,r,n,i,o,a,s){n===void 0&&(n=lt(i));var c=o===Se;if(n!==this.keyHash)return c?this:(kt(s),kt(a),kl(this,t,r,n,[i,o]));var d=this.entries,p=d.length,g=t&&t===this.ownerID,A=this._positionOf(i,g),I=A===-1?p:A,M=A!==-1;if(M?d[I][1]===o:c)return this;if(kt(s),(c||!M)&&kt(a),c&&p===2)return new rr(t,this.keyHash,d[I^1]);var E=g?d:Ht(d);if(M)c?(I===p-1?E.pop():E[I]=E.pop(),g&&(this._index=void 0)):E[I]=[i,o];else if(E.push([i,o]),g&&this._index!==void 0){var _=bl(i),R=this._index[_];R!==void 0?R.push(p):this._index[_]=[p]}return g?(this.entries=E,this):new br(t,this.keyHash,E)};var rr=function(t,r,n){this.ownerID=t,this.keyHash=r,this.entry=n};rr.prototype.get=function(t,r,n,i){return Ge(n,this.entry[0])?this.entry[1]:i};rr.prototype.update=function(t,r,n,i,o,a,s){var c=o===Se,d=Ge(i,this.entry[0]);if(d?o===this.entry[1]:c)return this;if(kt(s),c){kt(a);return}return d?t&&t===this.ownerID?(this.entry[1]=o,this):new rr(t,this.keyHash,[i,o]):(kt(a),kl(this,t,r,lt(i),[i,o]))};yi.prototype.iterate=br.prototype.iterate=function(e,t){for(var r=this.entries,n=0,i=r.length-1;n<=i;n++)if(e(r[t?i-n:n])===!1)return!1};fn.prototype.iterate=gi.prototype.iterate=function(e,t){for(var r=this.nodes,n=0,i=r.length-1;n<=i;n++){var o=r[t?i-n:n];if(o&&o.iterate(e,t)===!1)return!1}};rr.prototype.iterate=function(e,t){return e(this.entry)};var rw=(function(e){function t(r,n,i){this._type=n,this._reverse=i,this._stack=r._root&&Fu(r._root)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.next=function(){for(var n=this._type,i=this._stack;i;){var o=i.node,a=i.index++,s=void 0;if(o.entry){if(a===0)return ga(n,o.entry)}else if(o.entries){if(s=o.entries.length-1,a<=s)return ga(n,o.entries[this._reverse?s-a:a])}else if(s=o.nodes.length-1,a<=s){var c=o.nodes[this._reverse?s-a:a];if(c){if(c.entry)return ga(n,c.entry);i=this._stack=Fu(c,i)}continue}i=this._stack=this._stack.__prev}return tt()},t})(Ee);function ga(e,t){return Fe(e,t[0],t[1])}function Fu(e,t){return{node:e,index:0,__prev:t}}function Dl(e,t,r,n){var i=Object.create(Le);return i.size=e,i._root=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}var Lu;function Vt(){return Lu||(Lu=Dl(0))}function Uu(e,t,r){var n,i;if(e._root){var o=js(),a=js();if(n=Pl(e._root,e.__ownerID,0,void 0,t,r,o,a),!a.value)return e;i=e.size+(o.value?r===Se?-1:1:0)}else{if(r===Se)return e;i=1,n=new yi(e.__ownerID,[[t,r]])}return e.__ownerID?(e.size=i,e._root=n,e.__hash=void 0,e.__altered=!0,e):n?Dl(i,n):Vt()}function Pl(e,t,r,n,i,o,a,s){return e?e.update(t,r,n,i,o,a,s):o===Se?e:(kt(s),kt(a),new rr(t,n,[i,o]))}function Bu(e){return e.constructor===rr||e.constructor===br}function kl(e,t,r,n,i){if(e.keyHash===n)return new br(t,n,[e.entry,i]);var o=(r===0?e.keyHash:e.keyHash>>>r)&ut,a=(r===0?n:n>>>r)&ut,s,c=o===a?[kl(e,t,r+Oe,n,i)]:(s=new rr(t,n,i),o<a?[e,s]:[s,e]);return new fn(t,1<<o|1<<a,c)}function nw(e,t,r,n){e||(e=new dl);for(var i=new rr(e,lt(r),[r,n]),o=0;o<t.length;o++){var a=t[o];i=i.update(e,0,void 0,a[0],a[1])}return i}function iw(e,t,r,n){for(var i=0,o=0,a=new Array(r),s=0,c=1,d=t.length;s<d;s++,c<<=1){var p=t[s];p!==void 0&&s!==n&&(i|=c,a[o++]=p)}return new fn(e,i,a)}function ow(e,t,r,n,i){for(var o=0,a=new Array(It),s=0;r!==0;s++,r>>>=1)a[s]=r&1?t[o++]:void 0;return a[n]=i,new gi(e,o+1,a)}function Oh(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,e+=e>>16,e&127}function jh(e,t,r,n){var i=n?e:Ht(e);return i[t]=r,i}function aw(e,t,r,n){var i=e.length+1;if(n&&t+1===i)return e[t]=r,e;for(var o=new Array(i),a=0,s=0;s<i;s++)s===t?(o[s]=r,a=-1):o[s]=e[s+a];return o}function sw(e,t,r){var n=e.length-1;if(r&&t===n)return e.pop(),e;for(var i=new Array(n),o=0,a=0;a<n;a++)a===t&&(o=1),i[a]=e[a+o];return i}var lw=It/4,uw=It/2,cw=It/4,dw=16;function Nh(e){if(fl(e)&&typeof e!="string")return e;if(qt(e))return e.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+e)}function bi(e){try{return typeof e=="string"?JSON.stringify(e):String(e)}catch{return JSON.stringify(e)}}function Fh(e,t){return Ot(e)?e.has(t):gr(e)&&En.call(e,t)}function Tl(e,t,r){return Ot(e)?e.get(t,r):Fh(e,t)?typeof e.get=="function"?e.get(t):e[t]:r}function Lh(e,t){if(!gr(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(Ot(e)){if(!e.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+e);return e.remove(t)}if(!En.call(e,t))return e;var r=xo(e);return Array.isArray(r)?r.splice(t,1):delete r[t],r}function Uh(e,t,r){if(qi(t))return e;if(!gr(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(Ot(e)){if(!e.set)throw new TypeError("Cannot update immutable value without .set() method: "+e);return e.set(t,r)}if(En.call(e,t)&&r===e[t])return e;var n=xo(e);return n[t]=r,n}function Yr(e,t,r,n){n||(n=r,r=void 0);var i=Bh(Ot(e),e,Nh(t),0,r,n);return i===Se?r:i}function Bh(e,t,r,n,i,o){var a=t===Se;if(n===r.length){var s=a?i:t,c=o(s);return c===s?t:c}if(!a&&!gr(t))throw new TypeError("Cannot update within non-data-structure value in path ["+Array.from(r).slice(0,n).map(bi)+"]: "+t);var d=r[n],p=a?Se:Tl(t,d,Se),g=Bh(p===Se?e:Ot(p),p,r,n+1,i,o);return g===p?t:g===Se?Lh(t,d):Uh(a?e?Vt():{}:t,d,g)}function qh(e,t){return Yr(e,t,function(){return Se})}function Ol(e){return qh(this,e)}var Kh="@@__IMMUTABLE_LIST__@@";function jl(e){return!!(e&&e[Kh])}var Hi=(function(e){function t(r){var n=go();if(r==null)return n;if(jl(r))return r;var i=e(r),o=i.size;return o===0?n:(xt(o),o>0&&o<It?mi(0,o,Oe,void 0,new hr(i.toArray())):n.withMutations(function(a){a.setSize(o),i.forEach(function(s,c){return a.set(c,s)})}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("List [","]")},t.prototype.get=function(n,i){if(n=pr(this,n),n>=0&&n<this.size){n+=this._origin;var o=zh(this,n);return o&&o.array[n&ut]}return i},t.prototype.set=function(n,i){return fw(this,n,i)},t.prototype.remove=function(n){return this.has(n)?n===0?this.shift():n===this.size-1?this.pop():this.splice(n,1):this},t.prototype.insert=function(n,i){return this.splice(n,0,i)},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=Oe,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):go()},t.prototype.push=function(){var n=arguments,i=this.size;return this.withMutations(function(o){cr(o,0,i+n.length);for(var a=0;a<n.length;a++)o.set(i+a,n[a])})},t.prototype.pop=function(){return cr(this,0,-1)},t.prototype.unshift=function(){var n=arguments;return this.withMutations(function(i){cr(i,-n.length);for(var o=0;o<n.length;o++)i.set(o,n[o])})},t.prototype.shift=function(){return cr(this,1)},t.prototype.shuffle=function(n){return n===void 0&&(n=Math.random),this.withMutations(function(i){for(var o=i.size,a,s;o;)a=Math.floor(n()*o--),s=i.get(a),i.set(a,i.get(o)),i.set(o,s)})},t.prototype.concat=function(){for(var n=arguments,i=[],o=0;o<arguments.length;o++){var a=n[o],s=e(typeof a!="string"&&cl(a)?a:[a]);s.size!==0&&i.push(s)}return i.length===0?this:this.size===0&&!this.__ownerID&&i.length===1?this.constructor(i[0]):this.withMutations(function(c){i.forEach(function(d){return d.forEach(function(p){return c.push(p)})})})},t.prototype.setSize=function(n){return cr(this,0,n)},t.prototype.map=function(n,i){var o=this;return this.withMutations(function(a){for(var s=0;s<o.size;s++)a.set(s,n.call(i,a.get(s),s,o))})},t.prototype.slice=function(n,i){var o=this.size;return Fi(n,i,o)?this:cr(this,Sn(n,o),Li(i,o))},t.prototype.__iterator=function(n,i){var o=i?this.size:0,a=qu(this,i);return new Ee(function(){var s=a();return s===fi?tt():Fe(n,i?--o:o++,s)})},t.prototype.__iterate=function(n,i){for(var o=i?this.size:0,a=qu(this,i),s;(s=a())!==fi&&n(s,i?--o:o++,this)!==!1;);return o},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?mi(this._origin,this._capacity,this._level,this._root,this._tail,n,this.__hash):this.size===0?go():(this.__ownerID=n,this.__altered=!1,this)},t})(Gr);Hi.isList=jl;var We=Hi.prototype;We[Kh]=!0;We[Ni]=We.remove;We.merge=We.concat;We.setIn=Il;We.deleteIn=We.removeIn=Ol;We.update=Rl;We.updateIn=Cl;We.mergeIn=xl;We.mergeDeepIn=El;We.withMutations=Wi;We.wasAltered=Ml;We.asImmutable=Ui;We["@@transducer/init"]=We.asMutable=Bi;We["@@transducer/step"]=function(e,t){return e.push(t)};We["@@transducer/result"]=function(e){return e.asImmutable()};var hr=function(t,r){this.array=t,this.ownerID=r};hr.prototype.removeBefore=function(t,r,n){if((n&(1<<r+Oe)-1)===0||this.array.length===0)return this;var i=n>>>r&ut;if(i>=this.array.length)return new hr([],t);var o=i===0,a;if(r>0){var s=this.array[i];if(a=s&&s.removeBefore(t,r-Oe,n),a===s&&o)return this}if(o&&!a)return this;var c=hn(this,t);if(!o)for(var d=0;d<i;d++)c.array[d]=void 0;return a&&(c.array[i]=a),c};hr.prototype.removeAfter=function(t,r,n){if(n===(r?1<<r+Oe:It)||this.array.length===0)return this;var i=n-1>>>r&ut;if(i>=this.array.length)return this;var o;if(r>0){var a=this.array[i];if(o=a&&a.removeAfter(t,r-Oe,n),o===a&&i===this.array.length-1)return this}var s=hn(this,t);return s.array.splice(i+1),o&&(s.array[i]=o),s};var fi={};function qu(e,t){var r=e._origin,n=e._capacity,i=wi(n),o=e._tail;return a(e._root,e._level,0);function a(d,p,g){return p===0?s(d,g):c(d,p,g)}function s(d,p){var g=p===i?o&&o.array:d&&d.array,A=p>r?0:r-p,I=n-p;return I>It&&(I=It),function(){if(A===I)return fi;var M=t?--I:A++;return g&&g[M]}}function c(d,p,g){var A,I=d&&d.array,M=g>r?0:r-g>>p,E=(n-g>>p)+1;return E>It&&(E=It),function(){for(;;){if(A){var _=A();if(_!==fi)return _;A=null}if(M===E)return fi;var R=t?--E:M++;A=a(I&&I[R],p-Oe,g+(R<<p))}}}}function mi(e,t,r,n,i,o,a){var s=Object.create(We);return s.size=t-e,s._origin=e,s._capacity=t,s._level=r,s._root=n,s._tail=i,s.__ownerID=o,s.__hash=a,s.__altered=!1,s}function go(){return mi(0,0,Oe)}function fw(e,t,r){if(t=pr(e,t),t!==t)return e;if(t>=e.size||t<0)return e.withMutations(function(a){t<0?cr(a,t).set(0,r):cr(a,0,t+1).set(t,r)});t+=e._origin;var n=e._tail,i=e._root,o=js();return t>=wi(e._capacity)?n=Bs(n,e.__ownerID,0,t,r,o):i=Bs(i,e.__ownerID,e._level,t,r,o),o.value?e.__ownerID?(e._root=i,e._tail=n,e.__hash=void 0,e.__altered=!0,e):mi(e._origin,e._capacity,e._level,i,n):e}function Bs(e,t,r,n,i,o){var a=n>>>r&ut,s=e&&a<e.array.length;if(!s&&i===void 0)return e;var c;if(r>0){var d=e&&e.array[a],p=Bs(d,t,r-Oe,n,i,o);return p===d?e:(c=hn(e,t),c.array[a]=p,c)}return s&&e.array[a]===i?e:(o&&kt(o),c=hn(e,t),i===void 0&&a===c.array.length-1?c.array.pop():c.array[a]=i,c)}function hn(e,t){return t&&e&&t===e.ownerID?e:new hr(e?e.array.slice():[],t)}function zh(e,t){if(t>=wi(e._capacity))return e._tail;if(t<1<<e._level+Oe){for(var r=e._root,n=e._level;r&&n>0;)r=r.array[t>>>n&ut],n-=Oe;return r}}function hw(e,t,r){var n=e._origin+(t===void 0?0:t),i=r===void 0?e._capacity:r<0?e._capacity+r:e._origin+r;if(Number.isFinite(i)&&i>to||Number.isFinite(n)&&n<-to||Number.isFinite(i)&&Number.isFinite(n)&&i-n>to)throw new RangeError("Invalid List size: a List cannot hold more than "+to+" (2 ** 30) values.")}function cr(e,t,r){hw(e,t,r),t!==void 0&&(t|=0),r!==void 0&&(r|=0);var n=e.__ownerID||new dl,i=e._origin,o=e._capacity,a=i+t,s=r===void 0?o:r<0?o+r:i+r;if(a===i&&s===o)return e;if(a>=s)return e.clear();for(var c=e._level,d=e._root,p=0;a+p<0;)d=new hr(d&&d.array.length?[void 0,d]:[],n),c+=Oe,p+=Ku(c);p&&(a+=p,i+=p,s+=p,o+=p);for(var g=wi(o),A=wi(s);A>=Ku(c+Oe);)d=new hr(d&&d.array.length?[d]:[],n),c+=Oe;var I=e._tail,M=A<g?zh(e,s-1):A>g?new hr([],n):I;if(I&&A>g&&a<o&&I.array.length){d=hn(d,n);for(var E=d,_=c;_>Oe;_-=Oe){var R=g>>>_&ut;E=E.array[R]=hn(E.array[R],n)}E.array[g>>>Oe&ut]=I}if(s<o&&(M=M&&M.removeAfter(n,0,s)),a>=A)a-=A,s-=A,c=Oe,d=void 0,M=M&&M.removeBefore(n,0,a);else if(a>i||A<g){for(p=0;d;){var S=a>>>c&ut;if(S!==A>>>c&ut)break;S&&(p+=(1<<c)*S),c-=Oe,d=d.array[S]}d&&a>i&&(d=d.removeBefore(n,c,a-p)),d&&A<g&&(d=d.removeAfter(n,c,A-p)),p&&(a-=p,s-=p)}return e.__ownerID?(e.size=s-a,e._origin=a,e._capacity=s,e._level=c,e._root=d,e._tail=M,e.__hash=void 0,e.__altered=!0,e):mi(a,s,c,d,M)}function wi(e){return e<It?0:e-1>>>Oe<<Oe}var to=Math.pow(2,30);function Ku(e){return e<31?1<<e:Math.pow(2,e)}function Nl(e){return Go(e)&&qt(e)}var Jt=(function(e){function t(r){return r==null?ni():Nl(r)?r:ni().withMutations(function(n){var i=Tt(r);xt(i.size),i.forEach(function(o,a){return n.set(a,o)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("OrderedMap {","}")},t.prototype.get=function(n,i){var o=this._map.get(n);return o!==void 0?this._list.get(o)[1]:i},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):ni()},t.prototype.set=function(n,i){return Wu(this,n,i)},t.prototype.remove=function(n){return Wu(this,n,Se)},t.prototype.__iterate=function(n,i){var o=this;return this._list.__iterate(function(a){return a&&n(a[1],a[0],o)},i)},t.prototype.__iterator=function(n,i){return this._list.fromEntrySeq().__iterator(n,i)},t.prototype.__ensureOwner=function(n){if(n===this.__ownerID)return this;var i=this._map.__ensureOwner(n),o=this._list.__ensureOwner(n);return n?Fl(i,o,n,this.__hash):this.size===0?ni():(this.__ownerID=n,this.__altered=!1,this._map=i,this._list=o,this)},t})(Jr);Jt.isOrderedMap=Nl;Jt.prototype[yr]=!0;Jt.prototype[Ni]=Jt.prototype.remove;function Fl(e,t,r,n){var i=Object.create(Jt.prototype);return i.size=e?e.size:0,i._map=e,i._list=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}var zu;function ni(){return zu||(zu=Fl(Vt(),go()))}function Wu(e,t,r){var n=e._map,i=e._list,o=n.get(t),a=o!==void 0,s,c;if(r===Se){if(!a)return e;i.size>=It&&i.size>=n.size*2?(c=i.filter(function(d,p){return d!==void 0&&o!==p}),s=c.toKeyedSeq().map(function(d){return d[0]}).flip().toMap(),e.__ownerID&&(s.__ownerID=c.__ownerID=e.__ownerID)):(s=n.remove(t),c=o===i.size-1?i.pop():i.set(o,void 0))}else if(a){if(r===i.get(o)[1])return e;s=n,c=i.set(o,[t,r])}else s=n.set(t,i.size),c=i.set(i.size,[t,r]);return e.__ownerID?(e.size=s.size,e._map=s,e._list=c,e.__hash=void 0,e.__altered=!0,e):Fl(s,c)}var Wh="@@__IMMUTABLE_STACK__@@";function Io(e){return!!(e&&e[Wh])}var Jo=(function(e){function t(r){return r==null?ro():Io(r)?r:ro().pushAll(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(n,i){var o=this._head;for(n=pr(this,n);o&&n--;)o=o.next;return o?o.value:i},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var n=arguments;if(arguments.length===0)return this;for(var i=this.size+arguments.length,o=this._head,a=arguments.length-1;a>=0;a--)o={value:n[a],next:o};return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):ii(i,o)},t.prototype.pushAll=function(n){if(n=e(n),n.size===0)return this;if(this.size===0&&Io(n))return n;xt(n.size);var i=this.size,o=this._head;return n.__iterate(function(a){i++,o={value:a,next:o}},!0),this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):ii(i,o)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):ro()},t.prototype.slice=function(n,i){if(Fi(n,i,this.size))return this;var o=Sn(n,this.size),a=Li(i,this.size);if(a!==this.size)return e.prototype.slice.call(this,n,i);for(var s=this.size-o,c=this._head;o--;)c=c.next;return this.__ownerID?(this.size=s,this._head=c,this.__hash=void 0,this.__altered=!0,this):ii(s,c)},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?ii(this.size,this._head,n,this.__hash):this.size===0?ro():(this.__ownerID=n,this.__altered=!1,this)},t.prototype.__iterate=function(n,i){var o=this;if(i)return new cn(this.toArray()).__iterate(function(c,d){return n(c,d,o)},i);for(var a=0,s=this._head;s&&n(s.value,a++,this)!==!1;)s=s.next;return a},t.prototype.__iterator=function(n,i){if(i)return new cn(this.toArray()).__iterator(n,i);var o=0,a=this._head;return new Ee(function(){if(a){var s=a.value;return a=a.next,Fe(n,o++,s)}return tt()})},t})(Gr);Jo.isStack=Io;var dt=Jo.prototype;dt[Wh]=!0;dt.shift=dt.pop;dt.unshift=dt.push;dt.unshiftAll=dt.pushAll;dt.withMutations=Wi;dt.wasAltered=Ml;dt.asImmutable=Ui;dt["@@transducer/init"]=dt.asMutable=Bi;dt["@@transducer/step"]=function(e,t){return e.unshift(t)};dt["@@transducer/result"]=function(e){return e.asImmutable()};function ii(e,t,r,n){var i=Object.create(dt);return i.size=e,i._head=t,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}var Hu;function ro(){return Hu||(Hu=ii(0))}function Vu(e,t,r,n,i,o){return xt(e.size),e.__iterate(function(a,s,c){i?(i=!1,r=a):r=t.call(n,r,a,s,c)},o),r}function pw(e,t){return t}function yw(e,t){return[t,e]}function ba(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return!e.apply(this,t)}}function Qu(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return-e.apply(this,t)}}function Gu(e,t){return e<t?1:e>t?-1:0}function Ll(e,t){if(e===t)return!0;if(!At(t)||e.size!==void 0&&t.size!==void 0&&e.size!==t.size||e.__hash!==void 0&&t.__hash!==void 0&&e.__hash!==t.__hash||je(e)!==je(t)||_t(e)!==_t(t)||qt(e)!==qt(t))return!1;if(e.size===0&&t.size===0)return!0;var r=!Ko(e);if(qt(e)){var n=e.entries();return t.every(function(c,d){var p=n.next().value;return p&&Ge(p[1],c)&&(r||Ge(p[0],d))})&&n.next().done}var i=!1;if(e.size===void 0)if(t.size===void 0)typeof e.cacheResult=="function"&&e.cacheResult();else{i=!0;var o=e;e=t,t=o}var a=!0,s=t.__iterate(function(c,d){if(r?!e.has(c):i?!Ge(c,e.get(d,Se)):!Ge(e.get(d,Se),c))return a=!1,!1});return a&&e.size===s}var Hh=(function(e){function t(r,n,i){if(i===void 0&&(i=1),!(this instanceof t))return new t(r,n,i);if(di(i!==0,"Cannot step a Range by 0"),di(r!==void 0,"You must define a start value when using Range"),di(n!==void 0,"You must define an end value when using Range"),i=Math.abs(i),n<r&&(i=-i),this._start=r,this._end=n,this._step=i,this.size=Math.max(0,Math.ceil((n-r)/i-1)+1),this.size===0){if(ma)return ma;ma=this}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.size===0?"Range []":"Range [ "+this._start+"..."+this._end+(this._step!==1?" by "+this._step:"")+" ]"},t.prototype.get=function(n,i){return this.has(n)?this._start+pr(this,n)*this._step:i},t.prototype.includes=function(n){var i=(n-this._start)/this._step;return i>=0&&i<this.size&&i===Math.floor(i)},t.prototype.slice=function(n,i){return Fi(n,i,this.size)?this:(n=Sn(n,this.size),i=Li(i,this.size),i<=n?new t(0,0):new t(this.get(n,this._end),this.get(i,this._end),this._step))},t.prototype.indexOf=function(n){var i=n-this._start;if(i%this._step===0){var o=i/this._step;if(o>=0&&o<this.size)return o}return-1},t.prototype.lastIndexOf=function(n){return this.indexOf(n)},t.prototype.__iterate=function(n,i){for(var o=this.size,a=this._step,s=i?this._start+(o-1)*a:this._start,c=0;c!==o&&n(s,i?o-++c:c++,this)!==!1;)s+=i?-a:a;return c},t.prototype.__iterator=function(n,i){var o=this.size,a=this._step,s=i?this._start+(o-1)*a:this._start,c=0;return new Ee(function(){if(c===o)return tt();var d=s;return s+=i?-a:a,Fe(n,i?o-++c:c++,d)})},t.prototype.equals=function(n){return n instanceof t?this._start===n._start&&this._end===n._end&&this._step===n._step:Ll(this,n)},t})(jt),ma,Vh="@@__IMMUTABLE_SET__@@";function Yo(e){return!!(e&&e[Vh])}var Vi=(function(e){function t(r){return r==null?oi():Yo(r)&&!qt(r)?r:oi().withMutations(function(n){var i=e(r);xt(i.size),i.forEach(function(o){return n.add(o)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(n){return this(Tt(n).keySeq())},t.intersect=function(n){return n=Je(n).toArray(),n.length?Ze.intersect.apply(t(n.pop()),n):oi()},t.union=function(n){return n=Je(n).toArray(),n.length?Ze.union.apply(t(n.pop()),n):oi()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(n){return this._map.has(n)},t.prototype.add=function(n){return no(this,this._map.set(n,n))},t.prototype.remove=function(n){return no(this,this._map.remove(n))},t.prototype.clear=function(){return no(this,this._map.clear())},t.prototype.map=function(n,i){var o=this,a=!1,s=no(this,this._map.mapEntries(function(c){var d=c[1],p=n.call(i,d,d,o);return p!==d&&(a=!0),[p,p]},i));return a?s:this},t.prototype.union=function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];return n=n.filter(function(o){return o.size!==0}),n.length===0?this:this.size===0&&!this.__ownerID&&n.length===1?this.constructor(n[0]):this.withMutations(function(o){for(var a=0;a<n.length;a++)typeof n[a]=="string"?o.add(n[a]):e(n[a]).forEach(function(s){return o.add(s)})})},t.prototype.intersect=function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];if(n.length===0)return this;n=n.map(function(a){return e(a)});var o=[];return this.forEach(function(a){n.every(function(s){return s.includes(a)})||o.push(a)}),this.withMutations(function(a){o.forEach(function(s){a.remove(s)})})},t.prototype.subtract=function(){for(var n=[],i=arguments.length;i--;)n[i]=arguments[i];if(n.length===0)return this;n=n.map(function(a){return e(a)});var o=[];return this.forEach(function(a){n.some(function(s){return s.includes(a)})&&o.push(a)}),this.withMutations(function(a){o.forEach(function(s){a.remove(s)})})},t.prototype.sort=function(n){return yn(dn(this,n))},t.prototype.sortBy=function(n,i){return yn(dn(this,i,n))},t.prototype.wasAltered=function(){return this._map.wasAltered()},t.prototype.__iterate=function(n,i){var o=this;return this._map.__iterate(function(a){return n(a,a,o)},i)},t.prototype.__iterator=function(n,i){return this._map.__iterator(n,i)},t.prototype.__ensureOwner=function(n){if(n===this.__ownerID)return this;var i=this._map.__ensureOwner(n);return n?this.__make(i,n):this.size===0?this.__empty():(this.__ownerID=n,this._map=i,this)},t})(An);Vi.isSet=Yo;var Ze=Vi.prototype;Ze[Vh]=!0;Ze[Ni]=Ze.remove;Ze.merge=Ze.concat=Ze.union;Ze.withMutations=Wi;Ze.asImmutable=Ui;Ze["@@transducer/init"]=Ze.asMutable=Bi;Ze["@@transducer/step"]=function(e,t){return e.add(t)};Ze["@@transducer/result"]=function(e){return e.asImmutable()};Ze.__empty=oi;Ze.__make=Qh;function no(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:t.size===0?e.__empty():e.__make(t)}function Qh(e,t){var r=Object.create(Ze);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}var Ju;function oi(){return Ju||(Ju=Qh(Vt()))}function Ul(e,t,r){for(var n=Nh(t),i=0;i!==n.length;)if(e=Tl(e,n[i++],Se),e===Se)return r;return e}function Gh(e,t){return Ul(this,e,t)}function Jh(e,t){return Ul(e,t,Se)!==Se}function gw(e){return Jh(this,e)}function Yh(){xt(this.size);var e={};return this.__iterate(function(t,r){qi(r)||(e[r]=t)}),e}function Ro(e){if(!e||typeof e!="object")return e;if(!At(e)){if(!gr(e))return e;e=rt(e)}if(je(e)){var t={};return e.__iterate(function(n,i){qi(i)||(t[i]=Ro(n))}),t}var r=[];return e.__iterate(function(n){r.push(Ro(n))}),r}function bw(e){if(e.size===1/0)return 0;var t=qt(e),r=je(e),n=t?1:0;return e.__iterate(r?t?function(i,o){n=31*n+Yu(lt(i),lt(o))|0}:function(i,o){n=n+Yu(lt(i),lt(o))|0}:t?function(i){n=31*n+lt(i)|0}:function(i){n=n+lt(i)|0}),mw(e.size,n)}function mw(e,t){return t=Bn(t,3432918353),t=Bn(t<<15|t>>>-15,461845907),t=Bn(t<<13|t>>>-13,5),t=(t+3864292196|0)^e,t=Bn(t^t>>>16,2246822507),t=Bn(t^t>>>13,3266489909),t=Vo(t^t>>>16),t}function Yu(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}function Xr(e,t){var r=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(r),e}Je.Iterator=Ee;Xr(Je,{toArray:function(){xt(this.size);var t=new Array(this.size||0),r=je(this),n=0;return this.__iterate(function(i,o){t[n++]=r?[o,i]:i}),t},toIndexedSeq:function(){return new mh(this)},toJS:function(){return Ro(this)},toKeyedSeq:function(){return new Qo(this,!0)},toMap:function(){return Jr(this.toKeyedSeq())},toObject:Yh,toOrderedMap:function(){return Jt(this.toKeyedSeq())},toOrderedSet:function(){return yn(je(this)?this.valueSeq():this)},toSet:function(){return Vi(je(this)?this.valueSeq():this)},toSetSeq:function(){return new wh(this)},toSeq:function(){return _t(this)?this.toIndexedSeq():je(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Jo(je(this)?this.valueSeq():this)},toList:function(){return Hi(je(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(t,r){return this.size===0?t+r:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+r},concat:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return Te(this,V0(this,t))},includes:function(t){return this.some(function(r){return Ge(r,t)})},entries:function(){return this.__iterator(Ct)},every:function(t,r){xt(this.size);var n=!0;return this.__iterate(function(i,o,a){if(!t.call(r,i,o,a))return n=!1,!1}),n},filter:function(t,r){return Te(this,Sh(this,t,r,!0))},partition:function(t,r){return z0(this,t,r)},find:function(t,r,n){var i=this.findEntry(t,r);return i?i[1]:n},forEach:function(t,r){return xt(this.size),this.__iterate(r?t.bind(r):t)},join:function(t){xt(this.size),t=t!==void 0?""+t:",";var r="",n=!0;return this.__iterate(function(i){n?n=!1:r+=t,r+=i!=null?i.toString():""}),r},keys:function(){return this.__iterator(vn)},map:function(t,r){return Te(this,vh(this,t,r))},reduce:function(t,r,n){return Vu(this,t,r,n,arguments.length<2,!1)},reduceRight:function(t,r,n){return Vu(this,t,r,n,arguments.length<2,!0)},reverse:function(){return Te(this,ml(this,!0))},slice:function(t,r){return Te(this,wl(this,t,r,!0))},some:function(t,r){xt(this.size);var n=!1;return this.__iterate(function(i,o,a){if(t.call(r,i,o,a))return n=!0,!1}),n},sort:function(t){return Te(this,dn(this,t))},values:function(){return this.__iterator(Rt)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return this.size!==void 0?this.size===0:!this.some(function(){return!0})},count:function(t,r){return un(t?this.toSeq().filter(t,r):this)},countBy:function(t,r){return q0(this,t,r)},equals:function(t){return Ll(this,t)},entrySeq:function(){var t=this;if(t._cache)return new cn(t._cache);var r=t.toSeq().map(yw).toIndexedSeq();return r.fromEntrySeq=function(){return t.toSeq()},r},filterNot:function(t,r){return this.filter(ba(t),r)},findEntry:function(t,r,n){var i=n;return this.__iterate(function(o,a,s){if(t.call(r,o,a,s))return i=[a,o],!1}),i},findKey:function(t,r){var n=this.findEntry(t,r);return n&&n[0]},findLast:function(t,r,n){return this.toKeyedSeq().reverse().find(t,r,n)},findLastEntry:function(t,r,n){return this.toKeyedSeq().reverse().findEntry(t,r,n)},findLastKey:function(t,r){return this.toKeyedSeq().reverse().findKey(t,r)},first:function(t){return this.find(dh,null,t)},flatMap:function(t,r){return Te(this,Q0(this,t,r))},flatten:function(t){return Te(this,xh(this,t,!0))},fromEntrySeq:function(){return new _h(this)},get:function(t,r){return this.find(function(n,i){return Ge(i,t)},void 0,r)},getIn:Gh,groupBy:function(t,r){return K0(this,t,r)},has:function(t){return this.get(t,Se)!==Se},hasIn:gw,isSubset:function(t){return t=typeof t.includes=="function"?t:Je(t),this.every(function(r){return t.includes(r)})},isSuperset:function(t){return t=typeof t.isSubset=="function"?t:Je(t),t.isSubset(this)},keyOf:function(t){return this.findKey(function(r){return Ge(r,t)})},keySeq:function(){return this.toSeq().map(pw).toIndexedSeq()},last:function(t){return this.toSeq().reverse().first(t)},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return $i(this,t)},maxBy:function(t,r){return $i(this,r,t)},min:function(t){return $i(this,t?Qu(t):Gu)},minBy:function(t,r){return $i(this,r?Qu(r):Gu,t)},rest:function(){return this.slice(1)},skip:function(t){return t===0?this:this.slice(Math.max(0,t))},skipLast:function(t){return t===0?this:this.slice(0,-Math.max(0,t))},skipWhile:function(t,r){return Te(this,Eh(this,t,r,!0))},skipUntil:function(t,r){return this.skipWhile(ba(t),r)},sortBy:function(t,r){return Te(this,dn(this,r,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return this.slice(-Math.max(0,t))},takeWhile:function(t,r){return Te(this,W0(this,t,r))},takeUntil:function(t,r){return this.takeWhile(ba(t),r)},update:function(t){return t(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=bw(this))}});var nt=Je.prototype;nt[uh]=!0;nt[zo]=nt.values;nt.toJSON=nt.toArray;nt.__toStringMapper=bi;nt.inspect=nt.toSource=function(){return this.toString()};nt.chain=nt.flatMap;nt.contains=nt.includes;Xr(Tt,{flip:function(){return Te(this,Ah(this))},mapEntries:function(t,r){var n=this,i=0;return Te(this,this.toSeq().map(function(o,a){return t.call(r,[a,o],i++,n)}).fromEntrySeq())},mapKeys:function(t,r){var n=this;return Te(this,this.toSeq().flip().map(function(i,o){return t.call(r,i,o,n)}).flip())}});var Qi=Tt.prototype;Qi[Eo]=!0;Qi[zo]=nt.entries;Qi.toJSON=Yh;Qi.__toStringMapper=function(e,t){return bi(t)+": "+bi(e)};Xr(Gr,{toKeyedSeq:function(){return new Qo(this,!1)},filter:function(t,r){return Te(this,Sh(this,t,r,!1))},findIndex:function(t,r){var n=this.findEntry(t,r);return n?n[0]:-1},indexOf:function(t){var r=this.keyOf(t);return r===void 0?-1:r},lastIndexOf:function(t){var r=this.lastKeyOf(t);return r===void 0?-1:r},reverse:function(){return Te(this,ml(this,!1))},slice:function(t,r){return Te(this,wl(this,t,r,!1))},splice:function(t,r){var n=arguments.length;if(r=Math.max(r||0,0),n===0||n===2&&!r)return this;t=Sn(t,t<0?this.count():this.size);var i=this.slice(0,t);return Te(this,n===1?i:i.concat(Ht(arguments,2),this.slice(t+r)))},findLastIndex:function(t,r){var n=this.findLastEntry(t,r);return n?n[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return Te(this,xh(this,t,!1))},get:function(t,r){return t=pr(this,t),t<0||this.size===1/0||this.size!==void 0&&t>this.size?r:this.find(function(n,i){return i===t},void 0,r)},has:function(t){return t=pr(this,t),t>=0&&(this.size!==void 0?this.size===1/0||t<this.size:this.find(function(r,n){return n===t},void 0,Se)!==Se)},interpose:function(t){return Te(this,G0(this,t))},interleave:function(){var t=[this].concat(Ht(arguments)),r=eo(this.toSeq(),jt.of,t),n=r.flatten(!0);return r.size&&(n.size=r.size*t.length),Te(this,n)},keySeq:function(){return Hh(0,this.size)},last:function(t){return this.get(-1,t)},skipWhile:function(t,r){return Te(this,Eh(this,t,r,!1))},zip:function(){var t=[this].concat(Ht(arguments));return Te(this,eo(this,Xu,t))},zipAll:function(){var t=[this].concat(Ht(arguments));return Te(this,eo(this,Xu,t,!0))},zipWith:function(t){var r=Ht(arguments);return r[0]=this,Te(this,eo(this,t,r))}});var In=Gr.prototype;In[So]=!0;In[yr]=!0;Xr(An,{get:function(t,r){return this.has(t)?t:r},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}});var pn=An.prototype;pn.has=nt.includes;pn.contains=pn.includes;pn.keys=pn.values;Xr(Ar,Qi);Xr(jt,In);Xr(xn,pn);function Xu(){return Ht(arguments)}function Bl(e){return Yo(e)&&qt(e)}var yn=(function(e){function t(r){return r==null?qs():Bl(r)?r:qs().withMutations(function(n){var i=An(r);xt(i.size),i.forEach(function(o){return n.add(o)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(n){return this(Tt(n).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t})(Vi);yn.isOrderedSet=Bl;var Zr=yn.prototype;Zr[yr]=!0;Zr.zip=In.zip;Zr.zipWith=In.zipWith;Zr.zipAll=In.zipAll;Zr.__empty=qs;Zr.__make=Xh;function Xh(e,t){var r=Object.create(Zr);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}var Zu;function qs(){return Zu||(Zu=Xh(ni()))}var ww={LeftThenRight:-1,RightThenLeft:1};function _w(e){if(_r(e))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(Ot(e))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(e===null||typeof e!="object")throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}var Ve=function(t,r){var n;_w(t);var i=function(s){var c=this;if(s instanceof i)return s;if(!(this instanceof i))return new i(s);if(!n){n=!0;var d=Object.keys(t),p=o._indices={};o._name=r,o._keys=d,o._defaultValues=t;for(var g=0;g<d.length;g++){var A=d[g];p[A]=g,o[A]?typeof console=="object"&&console.warn&&console.warn("Cannot define "+Kl(this)+' with property "'+A+'" since that property name is part of the Record API.'):Aw(o,A)}}return this.__ownerID=void 0,this._values=Hi().withMutations(function(I){I.setSize(c._keys.length),Tt(s).forEach(function(M,E){I.set(c._indices[E],M===c._defaultValues[E]?void 0:M)})}),this},o=i.prototype=Object.create(Ne);return o.constructor=i,r&&(i.displayName=r),i};Ve.prototype.toString=function(){for(var t=Kl(this)+" { ",r=this._keys,n,i=0,o=r.length;i!==o;i++)n=r[i],t+=(i?", ":"")+n+": "+bi(this.get(n));return t+" }"};Ve.prototype.equals=function(t){return this===t||_r(t)&&gn(this).equals(gn(t))};Ve.prototype.hashCode=function(){return gn(this).hashCode()};Ve.prototype.has=function(t){return this._indices.hasOwnProperty(t)};Ve.prototype.get=function(t,r){if(!this.has(t))return r;var n=this._indices[t],i=this._values.get(n);return i===void 0?this._defaultValues[t]:i};Ve.prototype.set=function(t,r){if(this.has(t)){var n=this._values.set(this._indices[t],r===this._defaultValues[t]?void 0:r);if(n!==this._values&&!this.__ownerID)return ql(this,n)}return this};Ve.prototype.remove=function(t){return this.set(t)};Ve.prototype.clear=function(){var t=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:ql(this,t)};Ve.prototype.wasAltered=function(){return this._values.wasAltered()};Ve.prototype.toSeq=function(){return gn(this)};Ve.prototype.toJS=function(){return Ro(this)};Ve.prototype.entries=function(){return this.__iterator(Ct)};Ve.prototype.__iterator=function(t,r){return gn(this).__iterator(t,r)};Ve.prototype.__iterate=function(t,r){return gn(this).__iterate(t,r)};Ve.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var r=this._values.__ensureOwner(t);return t?ql(this,r,t):(this.__ownerID=t,this._values=r,this)};Ve.isRecord=_r;Ve.getDescriptiveName=Kl;var Ne=Ve.prototype;Ne[ph]=!0;Ne[Ni]=Ne.remove;Ne.deleteIn=Ne.removeIn=Ol;Ne.getIn=Gh;Ne.hasIn=nt.hasIn;Ne.merge=Rh;Ne.mergeWith=Ch;Ne.mergeIn=xl;Ne.mergeDeep=Dh;Ne.mergeDeepWith=Ph;Ne.mergeDeepIn=El;Ne.setIn=Il;Ne.update=Rl;Ne.updateIn=Cl;Ne.withMutations=Wi;Ne.asMutable=Bi;Ne.asImmutable=Ui;Ne[zo]=Ne.entries;Ne.toJSON=Ne.toObject=nt.toObject;Ne.inspect=Ne.toSource=function(){return this.toString()};function ql(e,t,r){var n=Object.create(Object.getPrototypeOf(e));return n._values=t,n.__ownerID=r,n}function Kl(e){return e.constructor.displayName||e.constructor.name||"Record"}function gn(e){return yl(e._keys.map(function(t){return[t,e.get(t)]}))}function Aw(e,t){try{Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(r){di(this.__ownerID,"Cannot set on an immutable record."),this.set(t,r)}})}catch{}}var vw=(function(e){function t(r,n){if(!(this instanceof t))return new t(r,n);if(this._value=r,this.size=n===void 0?1/0:Math.max(0,n),this.size===0){if(wa)return wa;wa=this}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.size===0?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},t.prototype.get=function(n,i){return this.has(n)?this._value:i},t.prototype.includes=function(n){return Ge(this._value,n)},t.prototype.slice=function(n,i){var o=this.size;return Fi(n,i,o)?this:new t(this._value,Li(i,o)-Sn(n,o))},t.prototype.reverse=function(){return this},t.prototype.indexOf=function(n){return this.size!==0&&Ge(this._value,n)?0:-1},t.prototype.lastIndexOf=function(n){return this.size!==0&&Ge(this._value,n)?this.size-1:-1},t.prototype.__iterate=function(n,i){for(var o=this.size,a=0;a!==o&&n(this._value,i?o-++a:a++,this)!==!1;);return a},t.prototype.__iterator=function(n,i){var o=this,a=this.size,s=0;return new Ee(function(){return s===a?tt():Fe(n,i?a-++s:s++,o._value)})},t.prototype.equals=function(n){return n instanceof t?Ge(this._value,n._value):Ll(this,n)},t})(jt),wa;function Sw(e,t){return Zh([],t||Ew,e,"",t&&t.length>2?[]:void 0,{"":e})}function Zh(e,t,r,n,i,o){if(typeof r!="string"&&!Ot(r)&&(fl(r)||cl(r)||Sl(r))){if(~e.indexOf(r))throw new TypeError("Cannot convert circular structure to Immutable");e.push(r),i&&n!==""&&i.push(n);var a=t.call(o,n,rt(r).map(function(s,c){return Zh(e,t,s,c,i,r)}),i&&i.slice());return e.pop(),i&&i.pop(),a}return r}function Ew(e,t){return _t(t)?t.toList():je(t)?t.toMap():t.toSet()}var xw="5.1.9",Iw=Je;const Rw=Object.freeze(Object.defineProperty({__proto__:null,Collection:Je,Iterable:Iw,List:Hi,Map:Jr,OrderedMap:Jt,OrderedSet:yn,PairSorting:ww,Range:Hh,Record:Ve,Repeat:vw,Seq:rt,Set:Vi,Stack:Jo,fromJS:Sw,get:Tl,getIn:Ul,has:Fh,hasIn:Jh,hash:lt,is:Ge,isAssociative:Ko,isCollection:At,isImmutable:Ot,isIndexed:_t,isKeyed:je,isList:jl,isMap:Go,isOrdered:qt,isOrderedMap:Nl,isOrderedSet:Bl,isPlainObject:Sl,isRecord:_r,isSeq:Ho,isSet:Yo,isStack:Io,isValueObject:Us,merge:Y0,mergeDeep:Z0,mergeDeepWith:$0,mergeWith:X0,remove:Lh,removeIn:qh,set:Uh,setIn:kh,update:vl,updateIn:Yr,version:xw},Symbol.toStringTag,{value:"Module"})),Cw=zd(Rw);var $u;function $h(){if($u)return Or;$u=1,Object.defineProperty(Or,"__esModule",{value:!0}),Or.ActionContextKey=Or.ActionContext=void 0;const e=Cw;let t=class ai{constructor(i={}){this.map=(0,e.Map)(i)}setDefault(i,o){return this.has(i)?this:this.set(i,o)}set(i,o){return this.setRaw(i.name,o)}setRaw(i,o){return new ai(this.map.set(i,o))}delete(i){return new ai(this.map.delete(i.name))}get(i){return this.getRaw(i.name)}getRaw(i){return this.map.get(i)}getSafe(i){if(!this.has(i))throw new Error(`Context entry ${i.name} is required but not available`);return this.get(i)}has(i){return this.hasRaw(i.name)}hasRaw(i){return this.map.has(i)}merge(...i){let o=this;for(const a of i)for(const s of a.keys())o=o.set(s,a.get(s));return o}keys(){return[...this.map.keys()].map(i=>new r(i))}toJS(){return this.map.toJS()}toString(){return`ActionContext(${JSON.stringify(this.map.toJS())})`}[Symbol.for("nodejs.util.inspect.custom")](){return`ActionContext(${JSON.stringify(this.map.toJS(),null," ")})`}static ensureActionContext(i){return i instanceof ai?i:new ai((0,e.Map)(i??{}))}};Or.ActionContext=t;class r{constructor(i){this.name=i}}return Or.ActionContextKey=r,Or}var qn={},ec;function ep(){if(ec)return qn;ec=1,Object.defineProperty(qn,"__esModule",{value:!0}),qn.Bus=void 0;let e=class{constructor(r){this.actors=[],this.observers=[],this.dependencyLinks=new Map,Object.assign(this,r),this.failMessage=`All actors over bus ${this.name} failed to handle an action`}subscribe(r){this.actors.push(r),this.reorderForDependencies()}subscribeObserver(r){this.observers.push(r)}unsubscribe(r){const n=this.actors.indexOf(r);return n>=0?(this.actors.splice(n,1),!0):!1}unsubscribeObserver(r){const n=this.observers.indexOf(r);return n>=0?(this.observers.splice(n,1),!0):!1}publish(r){return this.actors.map(n=>({actor:n,reply:n.test(r)}))}onRun(r,n,i){for(const o of this.observers)o.onRun(r,n,i)}addDependencies(r,n){for(const i of n){let o=this.dependencyLinks.get(i);o||(o=[],this.dependencyLinks.set(i,o)),o.push(r)}this.reorderForDependencies()}reorderForDependencies(){if(this.dependencyLinks.size>0){const r=[];for(const n of this.dependencyLinks.keys()){const i=this.actors.indexOf(n);i>=0&&(this.actors.splice(i,1),r.push(n))}for(;r.length>0;){let n=-1;for(let o=0;o<r.length;o++){let a=!0;for(const s of this.dependencyLinks.get(r[o]))if(!this.actors.includes(s)&&r.includes(s)){a=!1;break}if(a){n=o;break}}if(n<0)throw new Error(`Cyclic dependency links detected in bus ${this.name}`);const i=r.splice(n,1)[0];this.actors.push(i)}}}};return qn.Bus=e,qn}var Kn={},tc;function Mw(){if(tc)return Kn;tc=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.BusIndexed=void 0;const e=ep();let t=class extends e.Bus{constructor(n){super(n),this.actorsIndex={}}subscribe(n){const i=this.getActorIdentifiers(n)??["_undefined_"];for(const o of i){let a=this.actorsIndex[o];a||(a=this.actorsIndex[o]=[]),a.push(n),super.subscribe(n)}}unsubscribe(n){const i=this.getActorIdentifiers(n)??["_undefined_"];let o=!1;for(const a of i){const s=this.actorsIndex[a];if(s){const c=s.indexOf(n);c>=0&&s.splice(c,1),s.length===0&&delete this.actorsIndex[a]}o=o||super.unsubscribe(n)}return o}publish(n){const i=this.getActionIdentifier(n);return i?[...this.actorsIndex[i]||[],...this.actorsIndex._undefined_||[]].map(a=>({actor:a,reply:a.test(n)})):super.publish(n)}getActorIdentifiers(n){const i=this.actorIdentifierFields.reduce((o,a)=>o[a],n);if(i)return Array.isArray(i)?i:[i]}getActionIdentifier(n){return this.actionIdentifierFields.reduce((i,o)=>i[o],n)}};return Kn.BusIndexed=t,Kn}var zn={},rc;function tp(){if(rc)return zn;rc=1,Object.defineProperty(zn,"__esModule",{value:!0}),zn.CONTEXT_KEY_LOGGER=void 0;const e=$h();return zn.CONTEXT_KEY_LOGGER=new e.ActionContextKey("@comunica/core:log"),zn}var Wn={},nc;function Dw(){if(nc)return Wn;nc=1,Object.defineProperty(Wn,"__esModule",{value:!0}),Wn.ActionObserver=void 0;let e=class{constructor(r){Object.assign(this,r)}};return Wn.ActionObserver=e,Wn}var Hn={},ic;function Pw(){if(ic)return Hn;ic=1,Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.Actor=void 0;const e=tp();let t=class Br{constructor(n){this.beforeActors=[],Object.assign(this,n),this.bus.subscribe(this),this.beforeActors.length>0&&this.bus.addDependencies(this,this.beforeActors),n.busFailMessage&&(this.bus.failMessage=n.busFailMessage)}static getContextLogger(n){return n.get(e.CONTEXT_KEY_LOGGER)}runObservable(n,i){const o=this.run(n,i);return this.bus.onRun(this,n,o),o}getDefaultLogData(n,i){const o=i?i():{};return o.actor=this.name,o}logTrace(n,i,o){const a=Br.getContextLogger(n);a&&a.trace(i,this.getDefaultLogData(n,o))}logDebug(n,i,o){const a=Br.getContextLogger(n);a&&a.debug(i,this.getDefaultLogData(n,o))}logInfo(n,i,o){const a=Br.getContextLogger(n);a&&a.info(i,this.getDefaultLogData(n,o))}logWarn(n,i,o){const a=Br.getContextLogger(n);a&&a.warn(i,this.getDefaultLogData(n,o))}logError(n,i,o){const a=Br.getContextLogger(n);a&&a.error(i,this.getDefaultLogData(n,o))}logFatal(n,i,o){const a=Br.getContextLogger(n);a&&a.fatal(i,this.getDefaultLogData(n,o))}};return Hn.Actor=t,Hn}var Vn={},oc;function kw(){if(oc)return Vn;oc=1,Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.Mediator=void 0;let e=class Ks{constructor(r){Object.assign(this,r)}publish(r){const n=this.bus.publish(r);if(n.length===0)throw new Error(`No actors are able to reply to a message in the bus ${this.bus.name}`);return n}async mediateActor(r){return await this.mediateWith(r,this.publish(r))}async mediateTestable(r){return(await this.mediateActor(r)).mapAsync((i,o)=>i.runObservable(r,o))}async mediate(r){return(await this.mediateTestable(r)).getOrThrow()}constructFailureMessage(r,n){const i=`
9
+ `;return`${this.bus.failMessage.replaceAll(/\$\{(.*?)\}/gu,(a,s)=>Ks.getObjectValue({action:r},s.split("."))||a)}
10
+ Error messages of failing actors:${i}${n.join(i)}`}static getObjectValue(r,n){if(n.length===0)return r;if(r)return Ks.getObjectValue(r[n[0]],n.slice(1))}};return Vn.Mediator=e,Vn}var Ye={},ac;function Tw(){if(ac)return Ye;ac=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.TestResultFailed=Ye.TestResultPassed=Ye.failTest=Ye.passTestVoidWithSideData=Ye.passTestWithSideData=Ye.passTestVoid=Ye.passTest=void 0;function e(s){return new o(s,void 0)}Ye.passTest=e;function t(){return new o(!0,void 0)}Ye.passTestVoid=t;function r(s,c){return new o(s,c)}Ye.passTestWithSideData=r;function n(s){return new o(!0,s)}Ye.passTestVoidWithSideData=n;function i(s){return new a(s)}Ye.failTest=i;class o{constructor(c,d){this.value=c,this.sideData=d}isPassed(){return!0}isFailed(){return!1}get(){return this.value}getOrThrow(){return this.value}getSideData(){return this.sideData}getFailMessage(){}map(c){return new o(c(this.value,this.sideData),this.sideData)}async mapAsync(c){return new o(await c(this.value,this.sideData),this.sideData)}}Ye.TestResultPassed=o;class a{constructor(c){this.failMessage=c}isPassed(){return!1}isFailed(){return!0}get(){}getOrThrow(){throw new Error(this.getFailMessage())}getSideData(){throw new Error(this.getFailMessage())}getFailMessage(){return this.failMessage}map(){return this}async mapAsync(){return this}}return Ye.TestResultFailed=a,Ye}var sc;function vr(){return sc||(sc=1,(function(e){var t=Tr&&Tr.__createBinding||(Object.create?(function(n,i,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(i,o);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,a,s)}):(function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]})),r=Tr&&Tr.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r($h(),e),r(ep(),e),r(Mw(),e),r(tp(),e),r(Dw(),e),r(Pw(),e),r(kw(),e),r(Tw(),e)})(Tr)),Tr}var lc;function Ow(){if(lc)return Un;lc=1,Object.defineProperty(Un,"__esModule",{value:!0}),Un.ActionObserverHttp=void 0;const e=vr();class t extends e.ActionObserver{constructor(n){super(n),this.requests=0,this.bus.subscribeObserver(this),this.httpInvalidator.addInvalidateListener(()=>{this.requests=0})}onRun(n,i,o){this.observedActors.includes(n.name)&&this.requests++}}return Un.ActionObserverHttp=t,Un}var Qn={},jr={},Gn={},Nr={},Jn={},uc;function rp(){if(uc)return Jn;uc=1,Object.defineProperty(Jn,"__esModule",{value:!0}),Jn.ActorAbstractMediaTyped=void 0;const e=vr();let t=class extends e.Actor{constructor(n){super(n)}async run(n){if("handle"in n){const i=n;return{handle:await this.runHandle(i.handle,i.handleMediaType,n.context)}}if("mediaTypes"in n)return{mediaTypes:await this.getMediaTypes(n.context)};if("mediaTypeFormats"in n)return{mediaTypeFormats:await this.getMediaTypeFormats(n.context)};throw new Error("Either a handle, mediaTypes or mediaTypeFormats action needs to be provided")}async test(n){if("handle"in n){const i=n;return(await this.testHandle(i.handle,i.handleMediaType,n.context)).map(o=>({handle:o}))}return"mediaTypes"in n?(await this.testMediaType(n.context)).map(i=>({mediaTypes:i})):"mediaTypeFormats"in n?(await this.testMediaTypeFormats(n.context)).map(i=>({mediaTypeFormats:i})):(0,e.failTest)("Either a handle, mediaTypes or mediaTypeFormats action needs to be provided")}};return Jn.ActorAbstractMediaTyped=t,Jn}var Yn={},cc;function jw(){if(cc)return Yn;cc=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.ActorAbstractMediaTypedFixed=void 0;const e=vr(),t=rp();let r=class extends t.ActorAbstractMediaTyped{constructor(i){super(i);const o=this.priorityScale||this.priorityScale===0?this.priorityScale:1;if(this.mediaTypePriorities)for(const[a,[s,c]]of Object.entries(this.mediaTypePriorities).entries())this.mediaTypePriorities[s]=o*c;this.mediaTypePriorities=Object.freeze(this.mediaTypePriorities),this.mediaTypeFormats=Object.freeze(this.mediaTypeFormats)}async testHandle(i,o,a){return!o||!(o in this.mediaTypePriorities)?(0,e.failTest)(`Unrecognized media type: ${o}`):await this.testHandleChecked(i,a)}async testMediaType(i){return(0,e.passTestVoid)()}async getMediaTypes(i){return this.mediaTypePriorities}async testMediaTypeFormats(i){return(0,e.passTestVoid)()}async getMediaTypeFormats(i){return this.mediaTypeFormats}};return Yn.ActorAbstractMediaTypedFixed=r,Yn}var dc;function np(){return dc||(dc=1,(function(e){var t=Nr&&Nr.__createBinding||(Object.create?(function(n,i,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(i,o);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,a,s)}):(function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]})),r=Nr&&Nr.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(rp(),e),r(jw(),e)})(Nr)),Nr}var fc;function Nw(){if(fc)return Gn;fc=1,Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.ActorQueryResultSerialize=void 0;const e=np();let t=class extends e.ActorAbstractMediaTyped{constructor(n){super(n)}};return Gn.ActorQueryResultSerialize=t,Gn}var Xn={},hc;function Fw(){if(hc)return Xn;hc=1,Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.ActorQueryResultSerializeFixedMediaTypes=void 0;const e=np(),t=vr();let r=class extends e.ActorAbstractMediaTypedFixed{constructor(i){super(i)}async testHandleChecked(i,o){return(0,t.passTestVoid)()}};return Xn.ActorQueryResultSerializeFixedMediaTypes=r,Xn}var pc;function ip(){return pc||(pc=1,(function(e){var t=jr&&jr.__createBinding||(Object.create?(function(n,i,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(i,o);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,a,s)}):(function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]})),r=jr&&jr.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(Nw(),e),r(Fw(),e)})(jr)),jr}var Fr={},xe={},yc;function Lw(){if(yc)return xe;yc=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.KeysStatistics=xe.KeysRdfJoin=xe.KeysMergeBindingsContext=xe.KeysRdfUpdateQuads=xe.KeysQuerySourceIdentify=xe.KeysRdfParseHtmlScript=xe.KeysRdfParseJsonLd=xe.KeysQueryOperation=xe.KeysExpressionEvaluator=xe.KeysInitQuery=xe.KeysHttpProxy=xe.KeysHttpMemento=xe.KeysHttpWayback=xe.KeysHttp=xe.KeysCore=void 0;const e=vr();return xe.KeysCore={log:e.CONTEXT_KEY_LOGGER},xe.KeysHttp={includeCredentials:new e.ActionContextKey("@comunica/bus-http:include-credentials"),auth:new e.ActionContextKey("@comunica/bus-http:auth"),fetch:new e.ActionContextKey("@comunica/bus-http:fetch"),httpTimeout:new e.ActionContextKey("@comunica/bus-http:http-timeout"),httpBodyTimeout:new e.ActionContextKey("@comunica/bus-http:http-body-timeout"),httpRetryCount:new e.ActionContextKey("@comunica/bus-http:http-retry-count"),httpRetryDelayFallback:new e.ActionContextKey("@comunica/bus-http:http-retry-delay-fallback"),httpRetryDelayLimit:new e.ActionContextKey("@comunica/bus-http:http-retry-delay-limit"),httpRetryStatusCodes:new e.ActionContextKey("@comunica/bus-http:http-retry-status-codes")},xe.KeysHttpWayback={recoverBrokenLinks:new e.ActionContextKey("@comunica/bus-http:recover-broken-links")},xe.KeysHttpMemento={datetime:new e.ActionContextKey("@comunica/actor-http-memento:datetime")},xe.KeysHttpProxy={httpProxyHandler:new e.ActionContextKey("@comunica/actor-http-proxy:httpProxyHandler")},xe.KeysInitQuery={querySourcesUnidentified:new e.ActionContextKey("@comunica/actor-init-query:querySourcesUnidentified"),initialBindings:new e.ActionContextKey("@comunica/actor-init-query:initialBindings"),queryFormat:new e.ActionContextKey("@comunica/actor-init-query:queryFormat"),graphqlSingularizeVariables:new e.ActionContextKey("@comunica/actor-init-query:singularizeVariables"),lenient:new e.ActionContextKey("@comunica/actor-init-query:lenient"),queryString:new e.ActionContextKey("@comunica/actor-init-query:queryString"),query:new e.ActionContextKey("@comunica/actor-init-query:query"),baseIRI:new e.ActionContextKey("@comunica/actor-init-query:baseIRI"),fileBaseIRI:new e.ActionContextKey("@comunica/actor-init-query:fileBaseIRI"),functionArgumentsCache:new e.ActionContextKey("@comunica/actor-init-query:functionArgumentsCache"),queryTimestamp:new e.ActionContextKey("@comunica/actor-init-query:queryTimestamp"),queryTimestampHighResolution:new e.ActionContextKey("@comunica/actor-init-query:queryTimestampHighResolution"),extensionFunctionCreator:new e.ActionContextKey("@comunica/actor-init-query:extensionFunctionCreator"),extensionFunctions:new e.ActionContextKey("@comunica/actor-init-query:extensionFunctions"),extensionFunctionsAlwaysPushdown:new e.ActionContextKey("@comunica/actor-init-query:extensionFunctionsAlwaysPushdown"),cliArgsHandlers:new e.ActionContextKey("@comunica/actor-init-query:cliArgsHandlers"),explain:new e.ActionContextKey("@comunica/actor-init-query:explain"),physicalQueryPlanLogger:new e.ActionContextKey("@comunica/actor-init-query:physicalQueryPlanLogger"),physicalQueryPlanNode:new e.ActionContextKey("@comunica/actor-init-query:physicalQueryPlanNode"),jsonLdContext:new e.ActionContextKey("@context"),invalidateCache:new e.ActionContextKey("@comunica/actor-init-query:invalidateCache"),dataFactory:new e.ActionContextKey("@comunica/actor-init-query:dataFactory"),distinctConstruct:new e.ActionContextKey("@comunica/actor-init-query:distinctConstruct")},xe.KeysExpressionEvaluator={extensionFunctionCreator:new e.ActionContextKey("@comunica/utils-expression-evaluator:extensionFunctionCreator"),superTypeProvider:new e.ActionContextKey("@comunica/utils-expression-evaluator:superTypeProvider"),defaultTimeZone:new e.ActionContextKey("@comunica/utils-expression-evaluator:defaultTimeZone"),actionContext:new e.ActionContextKey("@comunica/utils-expression-evaluator:actionContext")},xe.KeysQueryOperation={operation:new e.ActionContextKey("@comunica/bus-query-operation:operation"),joinLeftMetadata:new e.ActionContextKey("@comunica/bus-query-operation:joinLeftMetadata"),joinRightMetadatas:new e.ActionContextKey("@comunica/bus-query-operation:joinRightMetadatas"),joinBindings:new e.ActionContextKey("@comunica/bus-query-operation:joinBindings"),readOnly:new e.ActionContextKey("@comunica/bus-query-operation:readOnly"),isPathArbitraryLengthDistinctKey:new e.ActionContextKey("@comunica/bus-query-operation:isPathArbitraryLengthDistinct"),limitIndicator:new e.ActionContextKey("@comunica/bus-query-operation:limitIndicator"),unionDefaultGraph:new e.ActionContextKey("@comunica/bus-query-operation:unionDefaultGraph"),querySources:new e.ActionContextKey("@comunica/bus-query-operation:querySources")},xe.KeysRdfParseJsonLd={documentLoader:new e.ActionContextKey("@comunica/actor-rdf-parse-jsonld:documentLoader"),strictValues:new e.ActionContextKey("@comunica/actor-rdf-parse-jsonld:strictValues"),parserOptions:new e.ActionContextKey("@comunica/actor-rdf-parse-jsonld:parserOptions")},xe.KeysRdfParseHtmlScript={processingHtmlScript:new e.ActionContextKey("@comunica/actor-rdf-parse-html-script:processingHtmlScript"),extractAllScripts:new e.ActionContextKey("extractAllScripts")},xe.KeysQuerySourceIdentify={sourceIds:new e.ActionContextKey("@comunica/bus-query-source-identify:sourceIds"),hypermediaSourcesAggregatedStores:new e.ActionContextKey("@comunica/bus-query-source-identify:hypermediaSourcesAggregatedStores"),traverse:new e.ActionContextKey("@comunica/bus-query-source-identify:traverse")},xe.KeysRdfUpdateQuads={destination:new e.ActionContextKey("@comunica/bus-rdf-update-quads:destination")},xe.KeysMergeBindingsContext={sourcesBinding:new e.ActionContextKey("@comunica/bus-merge-bindings-context:sourcesBinding")},xe.KeysRdfJoin={lastPhysicalJoin:new e.ActionContextKey("@comunica/bus-rdf-join:lastPhysicalJoin")},xe.KeysStatistics={discoveredLinks:new e.ActionContextKey("@comunica/statistic:discoveredLinks"),dereferencedLinks:new e.ActionContextKey("@comunica/statistic:dereferencedLinks"),intermediateResults:new e.ActionContextKey("@comunica/statistic:intermediateResults")},xe}var gc;function Uw(){return gc||(gc=1,(function(e){var t=Fr&&Fr.__createBinding||(Object.create?(function(n,i,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(i,o);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,a,s)}):(function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]})),r=Fr&&Fr.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(Lw(),e)})(Fr)),Fr}var _a={},Zn={},bc;function Bw(){if(bc)return Zn;bc=1,Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.LinkedList=void 0;class e{constructor(){this._length=0,this._head=null,this._tail=null}get length(){return this._length}get first(){var r;return(r=this._head)===null||r===void 0?void 0:r.value}get last(){var r;return(r=this._tail)===null||r===void 0?void 0:r.value}get empty(){return this._head===null}push(r){const n={value:r,next:null};this._tail===null?this._head=this._tail=n:this._tail.next=this._tail=n,this._length++}shift(){if(this._head===null)return;const{value:r,next:n}=this._head;return this._head=n,n===null&&(this._tail=null),this._length--,r}clear(){this._length=0,this._head=this._tail=null}}return Zn.LinkedList=e,Zn}var $n={};let Aa=1;const zl=new Map;let va=!1,Wl,op=(e,...t)=>(zl.set(Aa,[e,t]),Wl(Aa),Aa++),Hl=e=>{zl.delete(e)};function Vl(e){if(va)setTimeout(Vl,0,e);else{const t=zl.get(e);if(t){va=!0;try{t[0](...t[1])}finally{Hl(e),va=!1}}}}function qw(){const e=new MessageChannel;e.port1.onmessage=t=>{Vl(t.data)},Wl=t=>{e.port2.postMessage(t)}}function Kw(){const e=`setImmediate$${Math.random()}$`;window.addEventListener("message",t=>{typeof t.data=="string"&&t.data.startsWith(e)&&Vl(+t.data.slice(e.length))}),Wl=t=>{window.postMessage(e+t,"*")}}const io=typeof self>"u"?typeof global>"u"?void 0:global:self;io.setImmediate?(op=io.setImmediate,Hl=io.clearImmediate):io.importScripts?qw():Kw();const zw=Object.freeze(Object.defineProperty({__proto__:null,get clearImmediate(){return Hl},get setImmediate(){return op}},Symbol.toStringTag,{value:"Module"})),Ww=zd(zw);var mc;function Hw(){if(mc)return $n;mc=1,Object.defineProperty($n,"__esModule",{value:!0}),$n.createTaskScheduler=void 0;const e=Ww,t=Promise.resolve(void 0);function r(n=e.setImmediate){const i=typeof queueMicrotask=="function"?queueMicrotask:s=>t.then(s);let o=0,a=null;return s=>{a!==null?a.push(s):++o<100?i(s):(a=[s],n(()=>{for(const c of a)i(c);a=null,o=0}))}}return $n.createTaskScheduler=r,$n}var wc;function ap(){return wc||(wc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isIterator=e.isIterable=e.isSourceExpression=e.isPromise=e.isEventEmitter=e.isFunction=e.range=e.union=e.fromIterable=e.fromIterator=e.fromArray=e.single=e.empty=e.wrap=e.WrappingIterator=e.ClonedIterator=e.UnionIterator=e.MultiTransformIterator=e.SimpleTransformIterator=e.TransformIterator=e.BufferedIterator=e.MappingIterator=e.DESTINATION=e.identity=e.IntegerIterator=e.ArrayIterator=e.SingletonIterator=e.EmptyIterator=e.AsyncIterator=e.DESTROYED=e.ENDED=e.CLOSED=e.CLOSING=e.OPEN=e.INIT=e.setTaskScheduler=e.getTaskScheduler=e.scheduleTask=e.LinkedList=void 0;const t=or(),r=Bw();Object.defineProperty(e,"LinkedList",{enumerable:!0,get:function(){return r.LinkedList}});let i=Hw().createTaskScheduler();function o(j){i(j)}e.scheduleTask=o;function a(){return i}e.getTaskScheduler=a;function s(j){i=j}e.setTaskScheduler=s,e.INIT=1,e.OPEN=2,e.CLOSING=4,e.CLOSED=8,e.ENDED=16,e.DESTROYED=32;class c extends t.EventEmitter{constructor(l=e.OPEN){super(),this._readable=!1,this._state=l,this.on("newListener",d)}_changeState(l,f=!1){const w=l>this._state&&this._state<e.ENDED;return w&&(this._state=l,l===e.ENDED&&(f?i(()=>this.emit("end")):this.emit("end"))),w}read(){return null}forEach(l,f){this.on("data",ce(l,f))}close(){this._changeState(e.CLOSED)&&this._endAsync()}destroy(l){this.done||this._destroy(l,f=>{l=l||f,l&&this.emit("error",l),this._end(!0)})}_destroy(l,f){f()}_end(l=!1){this._changeState(l?e.DESTROYED:e.ENDED)&&(this._readable=!1,this.removeAllListeners("readable"),this.removeAllListeners("data"),this.removeAllListeners("end"))}_endAsync(){i(()=>this._end())}get readable(){return this._readable}set readable(l){l=!!l&&!this.done,this._readable!==l&&(this._readable=l,l&&i(()=>this.emit("readable")))}get closed(){return this._state>=e.CLOSING}get ended(){return this._state===e.ENDED}get destroyed(){return this._state===e.DESTROYED}get done(){return this._state>=e.ENDED}toString(){const l=this._toStringDetails();return`[${this.constructor.name}${l?` ${l}`:""}]`}_toStringDetails(){return""}toArray(l){const f=[],w=typeof l?.limit=="number"?l.limit:1/0;return this.ended||w<=0?Promise.resolve(f):new Promise((P,N)=>{const q=()=>P(f),m=U=>{f.push(U),f.length>=w&&(this.removeListener("error",N),this.removeListener("data",m),this.removeListener("end",q),P(f))};this.on("error",N),this.on("data",m),this.on("end",q)})}getProperty(l,f){const w=this._properties;if(!f)return w&&w[l];if(w&&l in w)i(()=>f(w[l]));else{let P;(P=this._propertyCallbacks)||(this._propertyCallbacks=P=Object.create(null)),l in P?P[l].push(f):P[l]=[f]}}setProperty(l,f){const w=this._properties||(this._properties=Object.create(null));w[l]=f;const P=this._propertyCallbacks||{},N=P[l];if(N){delete P[l],i(()=>{for(const q of N)q(f)});for(l in P)return;delete this._propertyCallbacks}}getProperties(){const l=this._properties,f={};for(const w in l)f[w]=l[w];return f}setProperties(l){for(const f in l)this.setProperty(f,l[f])}copyProperties(l,f){for(const w of f)l.getProperty(w,P=>this.setProperty(w,P))}transform(l){return new T(this,l)}map(l,f){return new R(this,ce(l,f))}filter(l,f){return this.map(function(w){return l.call(f||this,w)?w:null})}uniq(l=_){const f=new Set;return this.filter(function(w){const P=l.call(this,w);return f.has(P)?!1:(f.add(P),!0)})}prepend(l){return this.transform({prepend:l})}append(l){return this.transform({append:l})}surround(l,f){return this.transform({prepend:l,append:f})}skip(l){return this.map(f=>l-- >0?null:f)}take(l){return this.transform({limit:l})}range(l,f){return this.transform({offset:l,limit:Math.max(f-l+1,0)})}clone(){return new $(this)}[Symbol.asyncIterator](){const l=this;let f=null,w=null,P=null;l.addListener("readable",N),l.addListener("end",N),l.addListener("error",q);function N(){if(f!==null)if(P!==null)q(P);else if(l.done)f({done:!0,value:void 0}),f=w=null,m();else{const U=l.read();U!==null&&(f({done:!1,value:U}),f=w=null)}}function q(U){w!==null?(w(U),f=w=P=null,m()):P===null&&(P=U)}function m(){l.removeListener("readable",N),l.removeListener("end",N),l.removeListener("error",q)}return{next(){return new Promise((U,J)=>{f=U,w=J,N()})}}}}e.AsyncIterator=c;function d(j){j==="data"&&(this.removeListener("newListener",d),g(this,"readable",p),this.readable&&i(()=>p.call(this)))}function p(){let j;for(;this.listenerCount("data")!==0&&(j=this.read())!==null;)this.emit("data",j);this.listenerCount("data")===0&&!this.done&&(this.removeListener("readable",p),g(this,"newListener",d))}function g(j,l,f){j.listeners(l).includes(f)||j.on(l,f)}class A extends c{constructor(){super(),this._changeState(e.ENDED,!0)}}e.EmptyIterator=A;class I extends c{constructor(l){super(),this._item=l,l===null?this.close():this.readable=!0}read(){const l=this._item;return this._item=null,this.close(),l}_toStringDetails(){return this._item===null?"":`(${this._item})`}}e.SingletonIterator=I;class M extends c{constructor(l=[],{autoStart:f=!0,preserve:w=!0}={}){super();const P=w||!Array.isArray(l)?[...l]:l;this._index=0,this._sourceStarted=f!==!1,this._truncateThreshold=w?-1:64,this._sourceStarted&&P.length===0?this.close():this._buffer=P,this.readable=!0}read(){this._sourceStarted||(this._sourceStarted=!0);let l=null;return this._buffer&&(this._index<this._buffer.length&&(l=this._buffer[this._index++]),this._index===this._buffer.length?(delete this._buffer,this.close()):this._index===this._truncateThreshold&&(this._buffer.splice(0,this._truncateThreshold),this._index=0)),l}_toStringDetails(){return`(${this._buffer?this._buffer.length-this._index:0})`}_destroy(l,f){delete this._buffer,f()}toArray(l={}){if(!this._buffer)return Promise.resolve([]);const{length:f}=this._buffer,w=this._index,P=typeof l.limit!="number"?f:w+l.limit,N=this._buffer.slice(w,P);return this._index=P,P>=f&&this.close(),Promise.resolve(N)}}e.ArrayIterator=M;class E extends c{constructor({start:l=0,step:f=1,end:w}={}){super(),Number.isFinite(l)&&(l=Math.trunc(l)),this._next=l,Number.isFinite(f)&&(f=Math.trunc(f)),this._step=f;const P=f>=0,N=P?1/0:-1/0;Number.isFinite(w)?w=Math.trunc(w):w!==-N&&(w=N),this._last=w,!Number.isFinite(l)||(P?l>w:l<w)?this.close():this.readable=!0}read(){if(this.closed)return null;const l=this._next,f=this._step,w=this._last,P=this._next+=f;return(f>=0?P>w:P<w)&&this.close(),l}_toStringDetails(){return`(${this._next}...${this._last})`}}e.IntegerIterator=E;function _(j){return j}e.identity=_,e.DESTINATION=Symbol("destination");class R extends c{constructor(l,f=_,w={}){super(),this._map=f,this._source=S(l),this._destroySource=w.destroySource!==!1,l.done?this.close():(this._source[e.DESTINATION]=this,this._source.on("end",ie),this._source.on("error",re),this._source.on("readable",X),this.readable=this._source.readable)}read(){if(!this.done){if(this._source.readable){let l,f;for(;(l=this._source.read())!==null;)if((f=this._map(l))!==null)return f}this.readable=!1,this._source.done&&this.close()}return null}_end(l){this._source.removeListener("end",ie),this._source.removeListener("error",re),this._source.removeListener("readable",X),delete this._source[e.DESTINATION],this._destroySource&&this._source.destroy(),super._end(l)}}e.MappingIterator=R;function S(j,l=!1){if(!j||!Y(j.read)||!Y(j.on))throw new TypeError(`Invalid source: ${j}`);if(!l&&j[e.DESTINATION])throw new Error("The source already has a destination");return j}class v extends c{constructor({maxBufferSize:l=4,autoStart:f=!0}={}){super(e.INIT),this._buffer=new r.LinkedList,this._maxBufferSize=4,this._reading=!0,this._pushedCount=0,this.maxBufferSize=l,i(()=>this._init(f)),this._sourceStarted=f!==!1}get maxBufferSize(){return this._maxBufferSize}set maxBufferSize(l){l!==1/0&&(l=Number.isFinite(l)?Math.max(Math.trunc(l),1):4),this._maxBufferSize!==l&&(this._maxBufferSize=l,this._state===e.OPEN&&this._fillBuffer())}_init(l){let f=!1;this._reading=!0,this._begin(()=>{if(f)throw new Error("done callback called multiple times");f=!0,this._reading=!1,this._changeState(e.OPEN),l?this._fillBufferAsync():this.readable=!0})}_begin(l){l()}read(){if(this.done)return null;this._sourceStarted||(this._sourceStarted=!0);const l=this._buffer;let f;return l.empty?(f=null,this.readable=!1):f=l.shift(),!this._reading&&l.length<this._maxBufferSize&&(this.closed?l.empty&&this._endAsync():this._fillBufferAsync()),f}_read(l,f){f()}_push(l){this.done||(this._pushedCount++,this._buffer.push(l),this.readable=!0)}_fillBuffer(){let l;this._reading||(this.closed?this._completeClose():(l=Math.min(this._maxBufferSize-this._buffer.length,128))>0&&(this._pushedCount=0,this._reading=!0,this._read(l,()=>{if(!l)throw new Error("done callback called multiple times");l=0,this._reading=!1,this.closed?this._completeClose():this._pushedCount&&(this.readable=!0,this._buffer.length<this._maxBufferSize/2&&this._fillBufferAsync())})))}_fillBufferAsync(){this._reading||(this._reading=!0,i(()=>{this._reading=!1,this._fillBuffer()}))}close(){this._reading?this._changeState(e.CLOSING):this._completeClose()}_completeClose(){this._changeState(e.CLOSED)&&(this._reading=!0,this._flush(()=>{if(!this._reading)throw new Error("done callback called multiple times");this._reading=!1,this._buffer.empty&&this._endAsync()}))}_destroy(l,f){this._buffer.clear(),f()}_flush(l){l()}_toStringDetails(){const l=this._buffer;return`{${l.empty?"":`next: ${l.first}, `}buffer: ${l.length}}`}}e.BufferedIterator=v;class V extends v{constructor(l,f=l||{}){super(f),this._boundPush=w=>this._push(w),O(l)||(l=f.source),te(l)?this.source=l:l&&(this._createSource=C(l)?()=>l:l,this._sourceStarted&&this._loadSourceAsync()),this._optional=!!f.optional,this._destroySource=f.destroySource!==!1}get source(){return Y(this._createSource)&&this._loadSourceAsync(),this._source}set source(l){const f=this._source=this._validateSource(l);f[e.DESTINATION]=this,this.done?this._destroySource&&f.destroy():f.done?this.close():(f.on("end",G),f.on("readable",fe),f.on("error",re))}_loadSourceAsync(){Y(this._createSource)&&(Promise.resolve(this._createSource()).then(l=>{delete this._createSource,this.source=l,this._fillBuffer()},l=>this.emit("error",l)),this._createSource=null)}_validateSource(l,f=!1){if(this._source||typeof this._createSource<"u")throw new Error("The source cannot be changed after it has been set");return S(l,f)}_read(l,f){const w=()=>{this._pushedCount<l&&!this.closed?i(()=>this._readAndTransform(w,f)):f()};this._readAndTransform(w,f)}_readAndTransform(l,f){let w;const P=this.source;!P||P.done||(w=P.read())===null?f():this._optional?this._optionalTransform(w,l):this._transform(w,l,this._boundPush)}_optionalTransform(l,f){const w=this._pushedCount;this._transform(l,()=>{w===this._pushedCount&&this._push(l),f()},this._boundPush)}_transform(l,f,w){w(l),f()}_closeWhenDone(){this.close()}_end(l){const f=this._source;f&&(f.removeListener("end",G),f.removeListener("error",re),f.removeListener("readable",fe),delete f[e.DESTINATION],this._destroySource&&f.destroy()),super._end(l)}}e.TransformIterator=V;function X(){this[e.DESTINATION].readable=!0}function re(j){this[e.DESTINATION].emit("error",j)}function ie(){this[e.DESTINATION].close()}function G(){this[e.DESTINATION]._closeWhenDone()}function fe(){this[e.DESTINATION]._sourceStarted!==!1&&this[e.DESTINATION]._fillBuffer()}class T extends V{constructor(l,f){if(super(l,f),this._offset=0,this._limit=1/0,this._filter=w=>!0,f=f||(O(l)?null:l),f){const w=Y(f)?f:f.transform,{limit:P,offset:N,filter:q,map:m,prepend:U,append:J}=f;N===1/0||P===-1/0?this._limit=0:(Number.isFinite(N)&&(this._offset=Math.max(Math.trunc(N),0)),Number.isFinite(P)&&(this._limit=Math.max(Math.trunc(P),0)),Y(q)&&(this._filter=q),Y(m)&&(this._map=m),this._transform=Y(w)?w:null),U&&(this._prepender=te(U)?U:b(U)),J&&(this._appender=te(J)?J:b(J))}}_read(l,f){const w=()=>this._readAndTransformSimple(l,P,f);this._readAndTransformSimple(l,P,f);function P(){i(w)}}_readAndTransformSimple(l,f,w){let P;const{source:N}=this;if(!N||N.done){w();return}for(this._limit===0&&this.close();!this.closed&&this._pushedCount<l&&(P=N.read())!==null;){if(!this._filter(P)||this._offset!==0&&this._offset--)continue;const q=typeof this._map>"u"?P:this._map(P);if(q===null)this._optional&&this._push(P);else if(!Y(this._transform))this._push(q);else{this._optional?this._optionalTransform(q,f):this._transform(q,f,this._boundPush);return}--this._limit===0&&this.close()}w()}_begin(l){this._insert(this._prepender,l),delete this._prepender}_flush(l){this._insert(this._appender,l),delete this._appender}_insert(l,f){const w=N=>this._push(N);!l||l.done?f():(l.on("data",w),l.on("end",P));function P(){l.removeListener("data",w),l.removeListener("end",P),f()}}}e.SimpleTransformIterator=T;class k extends V{constructor(l,f){if(super(l,f),this._transformerQueue=[],f){const w=Y(f)?f:f.multiTransform;w&&(this._createTransformer=w)}}_read(l,f){const w=this._transformerQueue,P=this._optional;let N,q;for(;(N=w[0])&&N.transformer.done;){P&&N.item!==null&&(l--,this._push(N.item)),w.shift();const{transformer:U}=N;U.removeListener("end",fe),U.removeListener("readable",fe),U.removeListener("error",re)}const{source:m}=this;for(;m&&!m.done&&w.length<this.maxBufferSize&&(q=m.read(),q!==null);){const U=this._createTransformer(q)||new A;U[e.DESTINATION]=this,U.on("end",fe),U.on("readable",fe),U.on("error",re),w.push({transformer:U,item:q})}if(N=w[0],N){const{transformer:U}=N;for(;l-- >0&&(q=U.read())!==null;)this._push(q),P&&(N.item=null)}else m&&m.done&&this.close();f()}_createTransformer(l){return new I(l)}_closeWhenDone(){this._transformerQueue.length||this.close()}_end(l){if(super._end(l),this._destroySource)for(const f of this._transformerQueue)f.transformer.destroy()}}e.MultiTransformIterator=k;class H extends v{constructor(l,f={}){super(f),this._sources=[],this._currentSource=-1;const w=f.autoStart!==!1;if(te(l))l.on("error",P=>this.emit("error",P)),this._pending={loading:!1,sources:l},w&&this._loadSources();else if(Array.isArray(l)&&l.length>0)for(const P of l)this._addSource(P);else w&&this.close();this._destroySources=f.destroySources!==!1}_loadSources(){const l=this._pending.sources;this._pending.loading=!0,l.done?(delete this._pending,this.close()):(l.on("data",f=>{this._addSource(f),this._fillBufferAsync()}),l.on("end",()=>{delete this._pending,this._fillBuffer()}))}_addSource(l){C(l)&&(l=he(l)),l.done||(this._sources.push(l),l[e.DESTINATION]=this,l.on("error",re),l.on("readable",fe),l.on("end",x))}_removeEmptySources(){this._sources=this._sources.filter((l,f)=>(l.done&&f<=this._currentSource&&this._currentSource--,!l.done)),this._fillBuffer()}_read(l,f){var w;((w=this._pending)===null||w===void 0?void 0:w.loading)===!1&&this._loadSources();let P=0,N;for(;P!==(P=l);)for(let q=0;q<this._sources.length&&l>0;q++)this._currentSource=(this._currentSource+1)%this._sources.length,(N=this._sources[this._currentSource].read())!==null&&(l--,this._push(N));!this._pending&&this._sources.length===0&&this.close(),f()}_end(l=!1){if(super._end(l),this._destroySources){for(const f of this._sources)f.destroy();this._pending&&(this._pending.sources.destroy(),delete this._pending)}}}e.UnionIterator=H;function x(){this[e.DESTINATION]._removeEmptySources()}class $ extends V{constructor(l){super(l,{autoStart:!1}),this._readPosition=0,this._reading=!1,l&&(this.readable=!0)}_init(){}close(){c.prototype.close.call(this)}get source(){return super.source}set source(l){const f=this._source=this._validateSource(l),w=f&&f[e.DESTINATION]||(f[e.DESTINATION]=new oe(f));this.done?this._destroySource&&f.destroy():w.endsAt(0)?this.close():(w.register(this),(f._sourceStarted===!1||w.readAt(0)!==null)&&(this.readable=!0));const P=this._propertyCallbacks;for(const N in P){const q=P[N];for(const m of q)this._getSourceProperty(N,m)}}_validateSource(l,f=!1){const w=l&&l[e.DESTINATION];return super._validateSource(l,!w||w instanceof oe)}getProperty(l,f){const{source:w}=this,P=this._properties,N=P&&l in P;if(!f)return N?P&&P[l]:w&&w.getProperty(l);super.getProperty(l,f),w&&!N&&this._getSourceProperty(l,f)}_getSourceProperty(l,f){this.source.getProperty(l,w=>{(!this._properties||!(l in this._properties))&&f(w)})}getProperties(){const l=this.source?this.source.getProperties():{},f=this._properties;for(const w in f)l[w]=f[w];return l}_toStringDetails(){return`{source: ${this.source?this.source.toString():"none"}}`}read(){this._sourceStarted||(this._sourceStarted=!0);const l=this.source;let f=null;if(!this.done&&l){const w=l[e.DESTINATION];(f=w.readAt(this._readPosition))!==null?this._readPosition++:this.readable=!1,w.endsAt(this._readPosition)&&this.close()}return f}_end(l){const f=this.source,w=f?.[e.DESTINATION];w&&w.unregister(this),v.prototype._end.call(this,l)}}e.ClonedIterator=$;class oe{constructor(l){if(this._history=[],this._trackers=new Set,this._source=l,!l.done){const f=()=>{for(const N of this._trackers)N.readable=!0},w=N=>{for(const q of this._trackers)q.emit("error",N)},P=()=>{for(const N of this._trackers)N._sourceStarted!==!1&&N._readPosition===this._history.length&&N.close();this._trackers.clear(),l.removeListener("end",P),l.removeListener("error",w),l.removeListener("readable",f)};l.on("end",P),l.on("error",w),l.on("readable",f)}}register(l){this._source.done||this._trackers.add(l)}unregister(l){this._trackers.delete(l)}readAt(l){let f=null;return l<this._history.length?f=this._history[l]:!this._source.done&&(f=this._source.read())!==null&&(this._history[l]=f),f}endsAt(l){return this._source.done&&this._history.length===l}}class ae extends c{constructor(l,f){super(),this._source=null,this._destroySource=f?.destroySource!==!1,C(l)?(this._source=new c,l.then(w=>{this._source=null,this.source=w}).catch(w=>this.emit("error",w))):l&&(this.source=l)}set source(l){let f=l;if(this._source!==null)throw new Error("The source cannot be changed after it has been set");if(Z(f)&&(f=f[Symbol.iterator]()),ue(f)){let w=f;f=new t.EventEmitter,f.read=()=>{if(w!==null){let P;for(;!(P=w.next()).done;)if(P.value!==null)return P.value;w=null,this.close()}return null}}else f=S(f);if(this.done){this._destroySource&&Y(f.destroy)&&f.destroy();return}f[e.DESTINATION]=this,f.on("end",ie),f.on("error",re),f.on("readable",X),this._source=f,this.readable=f.readable!==!1}read(){if(this._source!==null&&this._source.readable!==!1){const l=this._source.read();if(l!==null)return l;this.readable=!1}return null}_end(l=!1){this._source!==null&&(this._source.removeListener("end",ie),this._source.removeListener("error",re),this._source.removeListener("readable",X),delete this._source[e.DESTINATION],this._destroySource&&Y(this._source.destroy)&&this._source.destroy(),this._source=null),super._end(l)}}e.WrappingIterator=ae;function he(j,l){if(l&&("autoStart"in l||"optional"in l||"source"in l||"maxBufferSize"in l))return j&&!te(j)&&(j=new ae(j)),new V(j,l);if(!j)return B();if(C(j))return new ae(j,l);if(j instanceof c)return j;if(Array.isArray(j))return b(j);if(Z(j)||ue(j)||te(j))return new ae(j,l);throw new TypeError(`Invalid source: ${j}`)}e.wrap=he;function B(){return new A}e.empty=B;function le(j){return new I(j)}e.single=le;function b(j){return new M(j)}e.fromArray=b;function z(j){return new ae(j)}e.fromIterator=z;function ne(j){return new ae(j)}e.fromIterable=ne;function L(j){return new H(j)}e.union=L;function se(j,l,f){return new E({start:j,end:l,step:f})}e.range=se;function ce(j,l){return l?j.bind(l):j}function Y(j){return typeof j=="function"}e.isFunction=Y;function te(j){return Y(j?.on)}e.isEventEmitter=te;function C(j){return Y(j?.then)}e.isPromise=C;function O(j){return j&&(te(j)||C(j)||Y(j))}e.isSourceExpression=O;function Z(j){return j&&Symbol.iterator in j}e.isIterable=Z;function ue(j){return Y(j?.next)}e.isIterator=ue})(_a)),_a}var Sa={exports:{}},Ea={exports:{}},xa,_c;function Be(){if(_c)return xa;_c=1;class e extends Error{constructor(r){if(!Array.isArray(r))throw new TypeError(`Expected input to be an Array, got ${typeof r}`);let n="";for(let i=0;i<r.length;i++)n+=` ${r[i].stack}
11
+ `;super(n),this.name="AggregateError",this.errors=r}}return xa={AggregateError:e,ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,r){return t.includes(r)},ArrayPrototypeIndexOf(t,r){return t.indexOf(r)},ArrayPrototypeJoin(t,r){return t.join(r)},ArrayPrototypeMap(t,r){return t.map(r)},ArrayPrototypePop(t,r){return t.pop(r)},ArrayPrototypePush(t,r){return t.push(r)},ArrayPrototypeSlice(t,r,n){return t.slice(r,n)},Error,FunctionPrototypeCall(t,r,...n){return t.call(r,...n)},FunctionPrototypeSymbolHasInstance(t,r){return Function.prototype[Symbol.hasInstance].call(t,r)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,r){return Object.defineProperties(t,r)},ObjectDefineProperty(t,r,n){return Object.defineProperty(t,r,n)},ObjectGetOwnPropertyDescriptor(t,r){return Object.getOwnPropertyDescriptor(t,r)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,r){return Object.setPrototypeOf(t,r)},Promise,PromisePrototypeCatch(t,r){return t.catch(r)},PromisePrototypeThen(t,r,n){return t.then(r,n)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,r){return t.test(r)},SafeSet:Set,String,StringPrototypeSlice(t,r,n){return t.slice(r,n)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,r,n){return t.set(r,n)},Boolean,Uint8Array},xa}var Ia={exports:{}},Ra,Ac;function sp(){return Ac||(Ac=1,Ra={format(e,...t){return e.replace(/%([sdifj])/g,function(...[r,n]){const i=t.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}),Ra}var Ca,vc;function ft(){if(vc)return Ca;vc=1;const{format:e,inspect:t}=sp(),{AggregateError:r}=Be(),n=globalThis.AggregateError||r,i=Symbol("kIsNodeError"),o=["string","function","number","object","Function","Object","boolean","bigint","symbol"],a=/^([A-Z][a-z0-9]*)+$/,s="__node_internal_",c={};function d(_,R){if(!_)throw new c.ERR_INTERNAL_ASSERTION(R)}function p(_){let R="",S=_.length;const v=_[0]==="-"?1:0;for(;S>=v+4;S-=3)R=`_${_.slice(S-3,S)}${R}`;return`${_.slice(0,S)}${R}`}function g(_,R,S){if(typeof R=="function")return d(R.length<=S.length,`Code: ${_}; The provided arguments length (${S.length}) does not match the required ones (${R.length}).`),R(...S);const v=(R.match(/%[dfijoOs]/g)||[]).length;return d(v===S.length,`Code: ${_}; The provided arguments length (${S.length}) does not match the required ones (${v}).`),S.length===0?R:e(R,...S)}function A(_,R,S){S||(S=Error);class v extends S{constructor(...X){super(g(_,R,X))}toString(){return`${this.name} [${_}]: ${this.message}`}}Object.defineProperties(v.prototype,{name:{value:S.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${_}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),v.prototype.code=_,v.prototype[i]=!0,c[_]=v}function I(_){const R=s+_.name;return Object.defineProperty(_,"name",{value:R}),_}function M(_,R){if(_&&R&&_!==R){if(Array.isArray(R.errors))return R.errors.push(_),R;const S=new n([R,_],R.message);return S.code=R.code,S}return _||R}class E extends Error{constructor(R="The operation was aborted",S=void 0){if(S!==void 0&&typeof S!="object")throw new c.ERR_INVALID_ARG_TYPE("options","Object",S);super(R,S),this.code="ABORT_ERR",this.name="AbortError"}}return A("ERR_ASSERTION","%s",Error),A("ERR_INVALID_ARG_TYPE",(_,R,S)=>{d(typeof _=="string","'name' must be a string"),Array.isArray(R)||(R=[R]);let v="The ";_.endsWith(" argument")?v+=`${_} `:v+=`"${_}" ${_.includes(".")?"property":"argument"} `,v+="must be ";const V=[],X=[],re=[];for(const G of R)d(typeof G=="string","All expected entries have to be of type string"),o.includes(G)?V.push(G.toLowerCase()):a.test(G)?X.push(G):(d(G!=="object",'The value "object" should be written as "Object"'),re.push(G));if(X.length>0){const G=V.indexOf("object");G!==-1&&(V.splice(V,G,1),X.push("Object"))}if(V.length>0){switch(V.length){case 1:v+=`of type ${V[0]}`;break;case 2:v+=`one of type ${V[0]} or ${V[1]}`;break;default:{const G=V.pop();v+=`one of type ${V.join(", ")}, or ${G}`}}(X.length>0||re.length>0)&&(v+=" or ")}if(X.length>0){switch(X.length){case 1:v+=`an instance of ${X[0]}`;break;case 2:v+=`an instance of ${X[0]} or ${X[1]}`;break;default:{const G=X.pop();v+=`an instance of ${X.join(", ")}, or ${G}`}}re.length>0&&(v+=" or ")}switch(re.length){case 0:break;case 1:re[0].toLowerCase()!==re[0]&&(v+="an "),v+=`${re[0]}`;break;case 2:v+=`one of ${re[0]} or ${re[1]}`;break;default:{const G=re.pop();v+=`one of ${re.join(", ")}, or ${G}`}}if(S==null)v+=`. Received ${S}`;else if(typeof S=="function"&&S.name)v+=`. Received function ${S.name}`;else if(typeof S=="object"){var ie;if((ie=S.constructor)!==null&&ie!==void 0&&ie.name)v+=`. Received an instance of ${S.constructor.name}`;else{const G=t(S,{depth:-1});v+=`. Received ${G}`}}else{let G=t(S,{colors:!1});G.length>25&&(G=`${G.slice(0,25)}...`),v+=`. Received type ${typeof S} (${G})`}return v},TypeError),A("ERR_INVALID_ARG_VALUE",(_,R,S="is invalid")=>{let v=t(R);return v.length>128&&(v=v.slice(0,128)+"..."),`The ${_.includes(".")?"property":"argument"} '${_}' ${S}. Received ${v}`},TypeError),A("ERR_INVALID_RETURN_VALUE",(_,R,S)=>{var v;const V=S!=null&&(v=S.constructor)!==null&&v!==void 0&&v.name?`instance of ${S.constructor.name}`:`type ${typeof S}`;return`Expected ${_} to be returned from the "${R}" function but got ${V}.`},TypeError),A("ERR_MISSING_ARGS",(..._)=>{d(_.length>0,"At least one arg needs to be specified");let R;const S=_.length;switch(_=(Array.isArray(_)?_:[_]).map(v=>`"${v}"`).join(" or "),S){case 1:R+=`The ${_[0]} argument`;break;case 2:R+=`The ${_[0]} and ${_[1]} arguments`;break;default:{const v=_.pop();R+=`The ${_.join(", ")}, and ${v} arguments`}break}return`${R} must be specified`},TypeError),A("ERR_OUT_OF_RANGE",(_,R,S)=>{d(R,'Missing "range" argument');let v;if(Number.isInteger(S)&&Math.abs(S)>2**32)v=p(String(S));else if(typeof S=="bigint"){v=String(S);const V=BigInt(2)**BigInt(32);(S>V||S<-V)&&(v=p(v)),v+="n"}else v=t(S);return`The value of "${_}" is out of range. It must be ${R}. Received ${v}`},RangeError),A("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),A("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),A("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),A("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),A("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),A("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),A("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),A("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),A("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),A("ERR_STREAM_WRITE_AFTER_END","write after end",Error),A("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),Ca={AbortError:E,aggregateTwoErrors:I(M),hideStackFrames:I,codes:c},Ca}var Sc;function mt(){return Sc||(Sc=1,(function(e){const t=vt(),{format:r,inspect:n}=sp(),{codes:{ERR_INVALID_ARG_TYPE:i}}=ft(),{kResistStopPropagation:o,AggregateError:a,SymbolDispose:s}=Be(),c=globalThis.AbortSignal||Gt().AbortSignal,d=globalThis.AbortController||Gt().AbortController,p=Object.getPrototypeOf(async function(){}).constructor,g=globalThis.Blob||t.Blob,A=typeof g<"u"?function(_){return _ instanceof g}:function(_){return!1},I=(E,_)=>{if(E!==void 0&&(E===null||typeof E!="object"||!("aborted"in E)))throw new i(_,"AbortSignal",E)},M=(E,_)=>{if(typeof E!="function")throw new i(_,"Function",E)};e.exports={AggregateError:a,kEmptyObject:Object.freeze({}),once(E){let _=!1;return function(...R){_||(_=!0,E.apply(this,R))}},createDeferredPromise:function(){let E,_;return{promise:new Promise((S,v)=>{E=S,_=v}),resolve:E,reject:_}},promisify(E){return new Promise((_,R)=>{E((S,...v)=>S?R(S):_(...v))})},debuglog(){return function(){}},format:r,inspect:n,types:{isAsyncFunction(E){return E instanceof p},isArrayBufferView(E){return ArrayBuffer.isView(E)}},isBlob:A,deprecate(E,_){return E},addAbortListener:or().addAbortListener||function(_,R){if(_===void 0)throw new i("signal","AbortSignal",_);I(_,"signal"),M(R,"listener");let S;return _.aborted?queueMicrotask(()=>R()):(_.addEventListener("abort",R,{__proto__:null,once:!0,[o]:!0}),S=()=>{_.removeEventListener("abort",R)}),{__proto__:null,[s](){var v;(v=S)===null||v===void 0||v()}}},AbortSignalAny:c.any||function(_){if(_.length===1)return _[0];const R=new d,S=()=>R.abort();return _.forEach(v=>{I(v,"signals"),v.addEventListener("abort",S,{once:!0})}),R.signal.addEventListener("abort",()=>{_.forEach(v=>v.removeEventListener("abort",S))},{once:!0}),R.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(Ia)),Ia.exports}var oo={},Ma,Ec;function Gi(){if(Ec)return Ma;Ec=1;const{ArrayIsArray:e,ArrayPrototypeIncludes:t,ArrayPrototypeJoin:r,ArrayPrototypeMap:n,NumberIsInteger:i,NumberIsNaN:o,NumberMAX_SAFE_INTEGER:a,NumberMIN_SAFE_INTEGER:s,NumberParseInt:c,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:p,String:g,StringPrototypeToUpperCase:A,StringPrototypeTrim:I}=Be(),{hideStackFrames:M,codes:{ERR_SOCKET_BAD_PORT:E,ERR_INVALID_ARG_TYPE:_,ERR_INVALID_ARG_VALUE:R,ERR_OUT_OF_RANGE:S,ERR_UNKNOWN_SIGNAL:v}}=ft(),{normalizeEncoding:V}=mt(),{isAsyncFunction:X,isArrayBufferView:re}=mt().types,ie={};function G(m){return m===(m|0)}function fe(m){return m===m>>>0}const T=/^[0-7]+$/,k="must be a 32-bit unsigned integer or an octal string";function H(m,U,J){if(typeof m>"u"&&(m=J),typeof m=="string"){if(p(T,m)===null)throw new R(U,m,k);m=c(m,8)}return oe(m,U),m}const x=M((m,U,J=s,K=a)=>{if(typeof m!="number")throw new _(U,"number",m);if(!i(m))throw new S(U,"an integer",m);if(m<J||m>K)throw new S(U,`>= ${J} && <= ${K}`,m)}),$=M((m,U,J=-2147483648,K=2147483647)=>{if(typeof m!="number")throw new _(U,"number",m);if(!i(m))throw new S(U,"an integer",m);if(m<J||m>K)throw new S(U,`>= ${J} && <= ${K}`,m)}),oe=M((m,U,J=!1)=>{if(typeof m!="number")throw new _(U,"number",m);if(!i(m))throw new S(U,"an integer",m);const K=J?1:0,de=4294967295;if(m<K||m>de)throw new S(U,`>= ${K} && <= ${de}`,m)});function ae(m,U){if(typeof m!="string")throw new _(U,"string",m)}function he(m,U,J=void 0,K){if(typeof m!="number")throw new _(U,"number",m);if(J!=null&&m<J||K!=null&&m>K||(J!=null||K!=null)&&o(m))throw new S(U,`${J!=null?`>= ${J}`:""}${J!=null&&K!=null?" && ":""}${K!=null?`<= ${K}`:""}`,m)}const B=M((m,U,J)=>{if(!t(J,m)){const de="must be one of: "+r(n(J,me=>typeof me=="string"?`'${me}'`:g(me)),", ");throw new R(U,m,de)}});function le(m,U){if(typeof m!="boolean")throw new _(U,"boolean",m)}function b(m,U,J){return m==null||!d(m,U)?J:m[U]}const z=M((m,U,J=null)=>{const K=b(J,"allowArray",!1),de=b(J,"allowFunction",!1);if(!b(J,"nullable",!1)&&m===null||!K&&e(m)||typeof m!="object"&&(!de||typeof m!="function"))throw new _(U,"Object",m)}),ne=M((m,U)=>{if(m!=null&&typeof m!="object"&&typeof m!="function")throw new _(U,"a dictionary",m)}),L=M((m,U,J=0)=>{if(!e(m))throw new _(U,"Array",m);if(m.length<J){const K=`must be longer than ${J}`;throw new R(U,m,K)}});function se(m,U){L(m,U);for(let J=0;J<m.length;J++)ae(m[J],`${U}[${J}]`)}function ce(m,U){L(m,U);for(let J=0;J<m.length;J++)le(m[J],`${U}[${J}]`)}function Y(m,U){L(m,U);for(let J=0;J<m.length;J++){const K=m[J],de=`${U}[${J}]`;if(K==null)throw new _(de,"AbortSignal",K);ue(K,de)}}function te(m,U="signal"){if(ae(m,U),ie[m]===void 0)throw ie[A(m)]!==void 0?new v(m+" (signals must use all capital letters)"):new v(m)}const C=M((m,U="buffer")=>{if(!re(m))throw new _(U,["Buffer","TypedArray","DataView"],m)});function O(m,U){const J=V(U),K=m.length;if(J==="hex"&&K%2!==0)throw new R("encoding",U,`is invalid for data of length ${K}`)}function Z(m,U="Port",J=!0){if(typeof m!="number"&&typeof m!="string"||typeof m=="string"&&I(m).length===0||+m!==+m>>>0||m>65535||m===0&&!J)throw new E(U,m,J);return m|0}const ue=M((m,U)=>{if(m!==void 0&&(m===null||typeof m!="object"||!("aborted"in m)))throw new _(U,"AbortSignal",m)}),j=M((m,U)=>{if(typeof m!="function")throw new _(U,"Function",m)}),l=M((m,U)=>{if(typeof m!="function"||X(m))throw new _(U,"Function",m)}),f=M((m,U)=>{if(m!==void 0)throw new _(U,"undefined",m)});function w(m,U,J){if(!t(J,m))throw new _(U,`('${r(J,"|")}')`,m)}const P=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function N(m,U){if(typeof m>"u"||!p(P,m))throw new R(U,m,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function q(m){if(typeof m=="string")return N(m,"hints"),m;if(e(m)){const U=m.length;let J="";if(U===0)return J;for(let K=0;K<U;K++){const de=m[K];N(de,"hints"),J+=de,K!==U-1&&(J+=", ")}return J}throw new R("hints",m,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return Ma={isInt32:G,isUint32:fe,parseFileMode:H,validateArray:L,validateStringArray:se,validateBooleanArray:ce,validateAbortSignalArray:Y,validateBoolean:le,validateBuffer:C,validateDictionary:ne,validateEncoding:O,validateFunction:j,validateInt32:$,validateInteger:x,validateNumber:he,validateObject:z,validateOneOf:B,validatePlainFunction:l,validatePort:Z,validateSignalName:te,validateString:ae,validateUint32:oe,validateUndefined:f,validateUnion:w,validateAbortSignal:ue,validateLinkHeaderValue:q},Ma}var ao={exports:{}},Da,xc;function ar(){if(xc)return Da;xc=1;const{SymbolAsyncIterator:e,SymbolIterator:t,SymbolFor:r}=Be(),n=r("nodejs.stream.destroyed"),i=r("nodejs.stream.errored"),o=r("nodejs.stream.readable"),a=r("nodejs.stream.writable"),s=r("nodejs.stream.disturbed"),c=r("nodejs.webstream.isClosedPromise"),d=r("nodejs.webstream.controllerErrorFunction");function p(b,z=!1){var ne;return!!(b&&typeof b.pipe=="function"&&typeof b.on=="function"&&(!z||typeof b.pause=="function"&&typeof b.resume=="function")&&(!b._writableState||((ne=b._readableState)===null||ne===void 0?void 0:ne.readable)!==!1)&&(!b._writableState||b._readableState))}function g(b){var z;return!!(b&&typeof b.write=="function"&&typeof b.on=="function"&&(!b._readableState||((z=b._writableState)===null||z===void 0?void 0:z.writable)!==!1))}function A(b){return!!(b&&typeof b.pipe=="function"&&b._readableState&&typeof b.on=="function"&&typeof b.write=="function")}function I(b){return b&&(b._readableState||b._writableState||typeof b.write=="function"&&typeof b.on=="function"||typeof b.pipe=="function"&&typeof b.on=="function")}function M(b){return!!(b&&!I(b)&&typeof b.pipeThrough=="function"&&typeof b.getReader=="function"&&typeof b.cancel=="function")}function E(b){return!!(b&&!I(b)&&typeof b.getWriter=="function"&&typeof b.abort=="function")}function _(b){return!!(b&&!I(b)&&typeof b.readable=="object"&&typeof b.writable=="object")}function R(b){return M(b)||E(b)||_(b)}function S(b,z){return b==null?!1:z===!0?typeof b[e]=="function":z===!1?typeof b[t]=="function":typeof b[e]=="function"||typeof b[t]=="function"}function v(b){if(!I(b))return null;const z=b._writableState,ne=b._readableState,L=z||ne;return!!(b.destroyed||b[n]||L!=null&&L.destroyed)}function V(b){if(!g(b))return null;if(b.writableEnded===!0)return!0;const z=b._writableState;return z!=null&&z.errored?!1:typeof z?.ended!="boolean"?null:z.ended}function X(b,z){if(!g(b))return null;if(b.writableFinished===!0)return!0;const ne=b._writableState;return ne!=null&&ne.errored?!1:typeof ne?.finished!="boolean"?null:!!(ne.finished||z===!1&&ne.ended===!0&&ne.length===0)}function re(b){if(!p(b))return null;if(b.readableEnded===!0)return!0;const z=b._readableState;return!z||z.errored?!1:typeof z?.ended!="boolean"?null:z.ended}function ie(b,z){if(!p(b))return null;const ne=b._readableState;return ne!=null&&ne.errored?!1:typeof ne?.endEmitted!="boolean"?null:!!(ne.endEmitted||z===!1&&ne.ended===!0&&ne.length===0)}function G(b){return b&&b[o]!=null?b[o]:typeof b?.readable!="boolean"?null:v(b)?!1:p(b)&&b.readable&&!ie(b)}function fe(b){return b&&b[a]!=null?b[a]:typeof b?.writable!="boolean"?null:v(b)?!1:g(b)&&b.writable&&!V(b)}function T(b,z){return I(b)?v(b)?!0:!(z?.readable!==!1&&G(b)||z?.writable!==!1&&fe(b)):null}function k(b){var z,ne;return I(b)?b.writableErrored?b.writableErrored:(z=(ne=b._writableState)===null||ne===void 0?void 0:ne.errored)!==null&&z!==void 0?z:null:null}function H(b){var z,ne;return I(b)?b.readableErrored?b.readableErrored:(z=(ne=b._readableState)===null||ne===void 0?void 0:ne.errored)!==null&&z!==void 0?z:null:null}function x(b){if(!I(b))return null;if(typeof b.closed=="boolean")return b.closed;const z=b._writableState,ne=b._readableState;return typeof z?.closed=="boolean"||typeof ne?.closed=="boolean"?z?.closed||ne?.closed:typeof b._closed=="boolean"&&$(b)?b._closed:null}function $(b){return typeof b._closed=="boolean"&&typeof b._defaultKeepAlive=="boolean"&&typeof b._removedConnection=="boolean"&&typeof b._removedContLen=="boolean"}function oe(b){return typeof b._sent100=="boolean"&&$(b)}function ae(b){var z;return typeof b._consuming=="boolean"&&typeof b._dumped=="boolean"&&((z=b.req)===null||z===void 0?void 0:z.upgradeOrConnect)===void 0}function he(b){if(!I(b))return null;const z=b._writableState,ne=b._readableState,L=z||ne;return!L&&oe(b)||!!(L&&L.autoDestroy&&L.emitClose&&L.closed===!1)}function B(b){var z;return!!(b&&((z=b[s])!==null&&z!==void 0?z:b.readableDidRead||b.readableAborted))}function le(b){var z,ne,L,se,ce,Y,te,C,O,Z;return!!(b&&((z=(ne=(L=(se=(ce=(Y=b[i])!==null&&Y!==void 0?Y:b.readableErrored)!==null&&ce!==void 0?ce:b.writableErrored)!==null&&se!==void 0?se:(te=b._readableState)===null||te===void 0?void 0:te.errorEmitted)!==null&&L!==void 0?L:(C=b._writableState)===null||C===void 0?void 0:C.errorEmitted)!==null&&ne!==void 0?ne:(O=b._readableState)===null||O===void 0?void 0:O.errored)!==null&&z!==void 0?z:!((Z=b._writableState)===null||Z===void 0)&&Z.errored))}return Da={isDestroyed:v,kIsDestroyed:n,isDisturbed:B,kIsDisturbed:s,isErrored:le,kIsErrored:i,isReadable:G,kIsReadable:o,kIsClosedPromise:c,kControllerErrorFunction:d,kIsWritable:a,isClosed:x,isDuplexNodeStream:A,isFinished:T,isIterable:S,isReadableNodeStream:p,isReadableStream:M,isReadableEnded:re,isReadableFinished:ie,isReadableErrored:H,isNodeStream:I,isWebStream:R,isWritable:fe,isWritableNodeStream:g,isWritableStream:E,isWritableEnded:V,isWritableFinished:X,isWritableErrored:k,isServerRequest:ae,isServerResponse:oe,willEmitClose:he,isTransformStream:_},Da}var Ic;function Sr(){if(Ic)return ao.exports;Ic=1;const e=St(),{AbortError:t,codes:r}=ft(),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_PREMATURE_CLOSE:i}=r,{kEmptyObject:o,once:a}=mt(),{validateAbortSignal:s,validateFunction:c,validateObject:d,validateBoolean:p}=Gi(),{Promise:g,PromisePrototypeThen:A,SymbolDispose:I}=Be(),{isClosed:M,isReadable:E,isReadableNodeStream:_,isReadableStream:R,isReadableFinished:S,isReadableErrored:v,isWritable:V,isWritableNodeStream:X,isWritableStream:re,isWritableFinished:ie,isWritableErrored:G,isNodeStream:fe,willEmitClose:T,kIsClosedPromise:k}=ar();let H;function x(B){return B.setHeader&&typeof B.abort=="function"}const $=()=>{};function oe(B,le,b){var z,ne;if(arguments.length===2?(b=le,le=o):le==null?le=o:d(le,"options"),c(b,"callback"),s(le.signal,"options.signal"),b=a(b),R(B)||re(B))return ae(B,le,b);if(!fe(B))throw new n("stream",["ReadableStream","WritableStream","Stream"],B);const L=(z=le.readable)!==null&&z!==void 0?z:_(B),se=(ne=le.writable)!==null&&ne!==void 0?ne:X(B),ce=B._writableState,Y=B._readableState,te=()=>{B.writable||Z()};let C=T(B)&&_(B)===L&&X(B)===se,O=ie(B,!1);const Z=()=>{O=!0,B.destroyed&&(C=!1),!(C&&(!B.readable||L))&&(!L||ue)&&b.call(B)};let ue=S(B,!1);const j=()=>{ue=!0,B.destroyed&&(C=!1),!(C&&(!B.writable||se))&&(!se||O)&&b.call(B)},l=m=>{b.call(B,m)};let f=M(B);const w=()=>{f=!0;const m=G(B)||v(B);if(m&&typeof m!="boolean")return b.call(B,m);if(L&&!ue&&_(B,!0)&&!S(B,!1))return b.call(B,new i);if(se&&!O&&!ie(B,!1))return b.call(B,new i);b.call(B)},P=()=>{f=!0;const m=G(B)||v(B);if(m&&typeof m!="boolean")return b.call(B,m);b.call(B)},N=()=>{B.req.on("finish",Z)};x(B)?(B.on("complete",Z),C||B.on("abort",w),B.req?N():B.on("request",N)):se&&!ce&&(B.on("end",te),B.on("close",te)),!C&&typeof B.aborted=="boolean"&&B.on("aborted",w),B.on("end",j),B.on("finish",Z),le.error!==!1&&B.on("error",l),B.on("close",w),f?e.nextTick(w):ce!=null&&ce.errorEmitted||Y!=null&&Y.errorEmitted?C||e.nextTick(P):(!L&&(!C||E(B))&&(O||V(B)===!1)||!se&&(!C||V(B))&&(ue||E(B)===!1)||Y&&B.req&&B.aborted)&&e.nextTick(P);const q=()=>{b=$,B.removeListener("aborted",w),B.removeListener("complete",Z),B.removeListener("abort",w),B.removeListener("request",N),B.req&&B.req.removeListener("finish",Z),B.removeListener("end",te),B.removeListener("close",te),B.removeListener("finish",Z),B.removeListener("end",j),B.removeListener("error",l),B.removeListener("close",w)};if(le.signal&&!f){const m=()=>{const U=b;q(),U.call(B,new t(void 0,{cause:le.signal.reason}))};if(le.signal.aborted)e.nextTick(m);else{H=H||mt().addAbortListener;const U=H(le.signal,m),J=b;b=a((...K)=>{U[I](),J.apply(B,K)})}}return q}function ae(B,le,b){let z=!1,ne=$;if(le.signal)if(ne=()=>{z=!0,b.call(B,new t(void 0,{cause:le.signal.reason}))},le.signal.aborted)e.nextTick(ne);else{H=H||mt().addAbortListener;const se=H(le.signal,ne),ce=b;b=a((...Y)=>{se[I](),ce.apply(B,Y)})}const L=(...se)=>{z||e.nextTick(()=>b.apply(B,se))};return A(B[k].promise,L,L),$}function he(B,le){var b;let z=!1;return le===null&&(le=o),(b=le)!==null&&b!==void 0&&b.cleanup&&(p(le.cleanup,"cleanup"),z=le.cleanup),new g((ne,L)=>{const se=oe(B,le,ce=>{z&&se(),ce?L(ce):ne()})})}return ao.exports=oe,ao.exports.finished=he,ao.exports}var Pa,Rc;function Rn(){if(Rc)return Pa;Rc=1;const e=St(),{aggregateTwoErrors:t,codes:{ERR_MULTIPLE_CALLBACK:r},AbortError:n}=ft(),{Symbol:i}=Be(),{kIsDestroyed:o,isDestroyed:a,isFinished:s,isServerRequest:c}=ar(),d=i("kDestroy"),p=i("kConstruct");function g(T,k,H){T&&(T.stack,k&&!k.errored&&(k.errored=T),H&&!H.errored&&(H.errored=T))}function A(T,k){const H=this._readableState,x=this._writableState,$=x||H;return x!=null&&x.destroyed||H!=null&&H.destroyed?(typeof k=="function"&&k(),this):(g(T,x,H),x&&(x.destroyed=!0),H&&(H.destroyed=!0),$.constructed?I(this,T,k):this.once(d,function(oe){I(this,t(oe,T),k)}),this)}function I(T,k,H){let x=!1;function $(oe){if(x)return;x=!0;const ae=T._readableState,he=T._writableState;g(oe,he,ae),he&&(he.closed=!0),ae&&(ae.closed=!0),typeof H=="function"&&H(oe),oe?e.nextTick(M,T,oe):e.nextTick(E,T)}try{T._destroy(k||null,$)}catch(oe){$(oe)}}function M(T,k){_(T,k),E(T)}function E(T){const k=T._readableState,H=T._writableState;H&&(H.closeEmitted=!0),k&&(k.closeEmitted=!0),(H!=null&&H.emitClose||k!=null&&k.emitClose)&&T.emit("close")}function _(T,k){const H=T._readableState,x=T._writableState;x!=null&&x.errorEmitted||H!=null&&H.errorEmitted||(x&&(x.errorEmitted=!0),H&&(H.errorEmitted=!0),T.emit("error",k))}function R(){const T=this._readableState,k=this._writableState;T&&(T.constructed=!0,T.closed=!1,T.closeEmitted=!1,T.destroyed=!1,T.errored=null,T.errorEmitted=!1,T.reading=!1,T.ended=T.readable===!1,T.endEmitted=T.readable===!1),k&&(k.constructed=!0,k.destroyed=!1,k.closed=!1,k.closeEmitted=!1,k.errored=null,k.errorEmitted=!1,k.finalCalled=!1,k.prefinished=!1,k.ended=k.writable===!1,k.ending=k.writable===!1,k.finished=k.writable===!1)}function S(T,k,H){const x=T._readableState,$=T._writableState;if($!=null&&$.destroyed||x!=null&&x.destroyed)return this;x!=null&&x.autoDestroy||$!=null&&$.autoDestroy?T.destroy(k):k&&(k.stack,$&&!$.errored&&($.errored=k),x&&!x.errored&&(x.errored=k),H?e.nextTick(_,T,k):_(T,k))}function v(T,k){if(typeof T._construct!="function")return;const H=T._readableState,x=T._writableState;H&&(H.constructed=!1),x&&(x.constructed=!1),T.once(p,k),!(T.listenerCount(p)>1)&&e.nextTick(V,T)}function V(T){let k=!1;function H(x){if(k){S(T,x??new r);return}k=!0;const $=T._readableState,oe=T._writableState,ae=oe||$;$&&($.constructed=!0),oe&&(oe.constructed=!0),ae.destroyed?T.emit(d,x):x?S(T,x,!0):e.nextTick(X,T)}try{T._construct(x=>{e.nextTick(H,x)})}catch(x){e.nextTick(H,x)}}function X(T){T.emit(p)}function re(T){return T?.setHeader&&typeof T.abort=="function"}function ie(T){T.emit("close")}function G(T,k){T.emit("error",k),e.nextTick(ie,T)}function fe(T,k){!T||a(T)||(!k&&!s(T)&&(k=new n),c(T)?(T.socket=null,T.destroy(k)):re(T)?T.abort():re(T.req)?T.req.abort():typeof T.destroy=="function"?T.destroy(k):typeof T.close=="function"?T.close():k?e.nextTick(G,T,k):e.nextTick(ie,T),T.destroyed||(T[o]=!0))}return Pa={construct:v,destroyer:fe,destroy:A,undestroy:R,errorOrDestroy:S},Pa}var ka,Cc;function Ql(){if(Cc)return ka;Cc=1;const{ArrayIsArray:e,ObjectSetPrototypeOf:t}=Be(),{EventEmitter:r}=or();function n(o){r.call(this,o)}t(n.prototype,r.prototype),t(n,r),n.prototype.pipe=function(o,a){const s=this;function c(E){o.writable&&o.write(E)===!1&&s.pause&&s.pause()}s.on("data",c);function d(){s.readable&&s.resume&&s.resume()}o.on("drain",d),!o._isStdio&&(!a||a.end!==!1)&&(s.on("end",g),s.on("close",A));let p=!1;function g(){p||(p=!0,o.end())}function A(){p||(p=!0,typeof o.destroy=="function"&&o.destroy())}function I(E){M(),r.listenerCount(this,"error")===0&&this.emit("error",E)}i(s,"error",I),i(o,"error",I);function M(){s.removeListener("data",c),o.removeListener("drain",d),s.removeListener("end",g),s.removeListener("close",A),s.removeListener("error",I),o.removeListener("error",I),s.removeListener("end",M),s.removeListener("close",M),o.removeListener("close",M)}return s.on("end",M),s.on("close",M),o.on("close",M),o.emit("pipe",s),o};function i(o,a,s){if(typeof o.prependListener=="function")return o.prependListener(a,s);!o._events||!o._events[a]?o.on(a,s):e(o._events[a])?o._events[a].unshift(s):o._events[a]=[s,o._events[a]]}return ka={Stream:n,prependListener:i},ka}var Ta={exports:{}},Mc;function Xo(){return Mc||(Mc=1,(function(e){const{SymbolDispose:t}=Be(),{AbortError:r,codes:n}=ft(),{isNodeStream:i,isWebStream:o,kControllerErrorFunction:a}=ar(),s=Sr(),{ERR_INVALID_ARG_TYPE:c}=n;let d;const p=(g,A)=>{if(typeof g!="object"||!("aborted"in g))throw new c(A,"AbortSignal",g)};e.exports.addAbortSignal=function(A,I){if(p(A,"signal"),!i(I)&&!o(I))throw new c("stream",["ReadableStream","WritableStream","Stream"],I);return e.exports.addAbortSignalNoValidate(A,I)},e.exports.addAbortSignalNoValidate=function(g,A){if(typeof g!="object"||!("aborted"in g))return A;const I=i(A)?()=>{A.destroy(new r(void 0,{cause:g.reason}))}:()=>{A[a](new r(void 0,{cause:g.reason}))};if(g.aborted)I();else{d=d||mt().addAbortListener;const M=d(g,I);s(A,M[t])}return A}})(Ta)),Ta.exports}var Oa,Dc;function Vw(){if(Dc)return Oa;Dc=1;const{StringPrototypeSlice:e,SymbolIterator:t,TypedArrayPrototypeSet:r,Uint8Array:n}=Be(),{Buffer:i}=vt(),{inspect:o}=mt();return Oa=class{constructor(){this.head=null,this.tail=null,this.length=0}push(s){const c={data:s,next:null};this.length>0?this.tail.next=c:this.head=c,this.tail=c,++this.length}unshift(s){const c={data:s,next:this.head};this.length===0&&(this.tail=c),this.head=c,++this.length}shift(){if(this.length===0)return;const s=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,s}clear(){this.head=this.tail=null,this.length=0}join(s){if(this.length===0)return"";let c=this.head,d=""+c.data;for(;(c=c.next)!==null;)d+=s+c.data;return d}concat(s){if(this.length===0)return i.alloc(0);const c=i.allocUnsafe(s>>>0);let d=this.head,p=0;for(;d;)r(c,d.data,p),p+=d.data.length,d=d.next;return c}consume(s,c){const d=this.head.data;if(s<d.length){const p=d.slice(0,s);return this.head.data=d.slice(s),p}return s===d.length?this.shift():c?this._getString(s):this._getBuffer(s)}first(){return this.head.data}*[t](){for(let s=this.head;s;s=s.next)yield s.data}_getString(s){let c="",d=this.head,p=0;do{const g=d.data;if(s>g.length)c+=g,s-=g.length;else{s===g.length?(c+=g,++p,d.next?this.head=d.next:this.head=this.tail=null):(c+=e(g,0,s),this.head=d,d.data=e(g,s));break}++p}while((d=d.next)!==null);return this.length-=p,c}_getBuffer(s){const c=i.allocUnsafe(s),d=s;let p=this.head,g=0;do{const A=p.data;if(s>A.length)r(c,A,d-s),s-=A.length;else{s===A.length?(r(c,A,d-s),++g,p.next?this.head=p.next:this.head=this.tail=null):(r(c,new n(A.buffer,A.byteOffset,s),d-s),this.head=p,p.data=A.slice(s));break}++g}while((p=p.next)!==null);return this.length-=g,c}[Symbol.for("nodejs.util.inspect.custom")](s,c){return o(this,{...c,depth:0,customInspect:!1})}},Oa}var ja,Pc;function Zo(){if(Pc)return ja;Pc=1;const{MathFloor:e,NumberIsInteger:t}=Be(),{validateInteger:r}=Gi(),{ERR_INVALID_ARG_VALUE:n}=ft().codes;let i=16*1024,o=16;function a(p,g,A){return p.highWaterMark!=null?p.highWaterMark:g?p[A]:null}function s(p){return p?o:i}function c(p,g){r(g,"value",0),p?o=g:i=g}function d(p,g,A,I){const M=a(g,I,A);if(M!=null){if(!t(M)||M<0){const E=I?`options.${A}`:"options.highWaterMark";throw new n(E,M)}return e(M)}return s(p.objectMode)}return ja={getHighWaterMark:d,getDefaultHighWaterMark:s,setDefaultHighWaterMark:c},ja}var Na,kc;function lp(){if(kc)return Na;kc=1;const e=St(),{PromisePrototypeThen:t,SymbolAsyncIterator:r,SymbolIterator:n}=Be(),{Buffer:i}=vt(),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_NULL_VALUES:a}=ft().codes;function s(c,d,p){let g;if(typeof d=="string"||d instanceof i)return new c({objectMode:!0,...p,read(){this.push(d),this.push(null)}});let A;if(d&&d[r])A=!0,g=d[r]();else if(d&&d[n])A=!1,g=d[n]();else throw new o("iterable",["Iterable"],d);const I=new c({objectMode:!0,highWaterMark:1,...p});let M=!1;I._read=function(){M||(M=!0,_())},I._destroy=function(R,S){t(E(R),()=>e.nextTick(S,R),v=>e.nextTick(S,v||R))};async function E(R){const S=R!=null,v=typeof g.throw=="function";if(S&&v){const{value:V,done:X}=await g.throw(R);if(await V,X)return}if(typeof g.return=="function"){const{value:V}=await g.return();await V}}async function _(){for(;;){try{const{value:R,done:S}=A?await g.next():g.next();if(S)I.push(null);else{const v=R&&typeof R.then=="function"?await R:R;if(v===null)throw M=!1,new a;if(I.push(v))continue;M=!1}}catch(R){I.destroy(R)}break}}return I}return Na=s,Na}var Fa,Tc;function $o(){if(Tc)return Fa;Tc=1;const e=St(),{ArrayPrototypeIndexOf:t,NumberIsInteger:r,NumberIsNaN:n,NumberParseInt:i,ObjectDefineProperties:o,ObjectKeys:a,ObjectSetPrototypeOf:s,Promise:c,SafeSet:d,SymbolAsyncDispose:p,SymbolAsyncIterator:g,Symbol:A}=Be();Fa=K,K.ReadableState=J;const{EventEmitter:I}=or(),{Stream:M,prependListener:E}=Ql(),{Buffer:_}=vt(),{addAbortSignal:R}=Xo(),S=Sr();let v=mt().debuglog("stream",u=>{v=u});const V=Vw(),X=Rn(),{getHighWaterMark:re,getDefaultHighWaterMark:ie}=Zo(),{aggregateTwoErrors:G,codes:{ERR_INVALID_ARG_TYPE:fe,ERR_METHOD_NOT_IMPLEMENTED:T,ERR_OUT_OF_RANGE:k,ERR_STREAM_PUSH_AFTER_EOF:H,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:x},AbortError:$}=ft(),{validateObject:oe}=Gi(),ae=A("kPaused"),{StringDecoder:he}=Wd(),B=lp();s(K.prototype,M.prototype),s(K,M);const le=()=>{},{errorOrDestroy:b}=X,z=1,ne=2,L=4,se=8,ce=16,Y=32,te=64,C=128,O=256,Z=512,ue=1024,j=2048,l=4096,f=8192,w=16384,P=32768,N=65536,q=1<<17,m=1<<18;function U(u){return{enumerable:!1,get(){return(this.state&u)!==0},set(h){h?this.state|=u:this.state&=~u}}}o(J.prototype,{objectMode:U(z),ended:U(ne),endEmitted:U(L),reading:U(se),constructed:U(ce),sync:U(Y),needReadable:U(te),emittedReadable:U(C),readableListening:U(O),resumeScheduled:U(Z),errorEmitted:U(ue),emitClose:U(j),autoDestroy:U(l),destroyed:U(f),closed:U(w),closeEmitted:U(P),multiAwaitDrain:U(N),readingMore:U(q),dataEmitted:U(m)});function J(u,h,W){typeof W!="boolean"&&(W=h instanceof nr()),this.state=j|l|ce|Y,u&&u.objectMode&&(this.state|=z),W&&u&&u.readableObjectMode&&(this.state|=z),this.highWaterMark=u?re(this,u,"readableHighWaterMark",W):ie(!1),this.buffer=new V,this.length=0,this.pipes=[],this.flowing=null,this[ae]=null,u&&u.emitClose===!1&&(this.state&=~j),u&&u.autoDestroy===!1&&(this.state&=~l),this.errored=null,this.defaultEncoding=u&&u.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,u&&u.encoding&&(this.decoder=new he(u.encoding),this.encoding=u.encoding)}function K(u){if(!(this instanceof K))return new K(u);const h=this instanceof nr();this._readableState=new J(u,this,h),u&&(typeof u.read=="function"&&(this._read=u.read),typeof u.destroy=="function"&&(this._destroy=u.destroy),typeof u.construct=="function"&&(this._construct=u.construct),u.signal&&!h&&R(u.signal,this)),M.call(this,u),X.construct(this,()=>{this._readableState.needReadable&&Me(this,this._readableState)})}K.prototype.destroy=X.destroy,K.prototype._undestroy=X.undestroy,K.prototype._destroy=function(u,h){h(u)},K.prototype[I.captureRejectionSymbol]=function(u){this.destroy(u)},K.prototype[p]=function(){let u;return this.destroyed||(u=this.readableEnded?null:new $,this.destroy(u)),new c((h,W)=>S(this,F=>F&&F!==u?W(F):h(null)))},K.prototype.push=function(u,h){return de(this,u,h,!1)},K.prototype.unshift=function(u,h){return de(this,u,h,!0)};function de(u,h,W,F){v("readableAddChunk",h);const ee=u._readableState;let ge;if((ee.state&z)===0&&(typeof h=="string"?(W=W||ee.defaultEncoding,ee.encoding!==W&&(F&&ee.encoding?h=_.from(h,W).toString(ee.encoding):(h=_.from(h,W),W=""))):h instanceof _?W="":M._isUint8Array(h)?(h=M._uint8ArrayToBuffer(h),W=""):h!=null&&(ge=new fe("chunk",["string","Buffer","Uint8Array"],h))),ge)b(u,ge);else if(h===null)ee.state&=~se,Ce(u,ee);else if((ee.state&z)!==0||h&&h.length>0)if(F)if((ee.state&L)!==0)b(u,new x);else{if(ee.destroyed||ee.errored)return!1;me(u,ee,h,!0)}else if(ee.ended)b(u,new H);else{if(ee.destroyed||ee.errored)return!1;ee.state&=~se,ee.decoder&&!W?(h=ee.decoder.write(h),ee.objectMode||h.length!==0?me(u,ee,h,!1):Me(u,ee)):me(u,ee,h,!1)}else F||(ee.state&=~se,Me(u,ee));return!ee.ended&&(ee.length<ee.highWaterMark||ee.length===0)}function me(u,h,W,F){h.flowing&&h.length===0&&!h.sync&&u.listenerCount("data")>0?((h.state&N)!==0?h.awaitDrainWriters.clear():h.awaitDrainWriters=null,h.dataEmitted=!0,u.emit("data",W)):(h.length+=h.objectMode?1:W.length,F?h.buffer.unshift(W):h.buffer.push(W),(h.state&te)!==0&&Pe(u)),Me(u,h)}K.prototype.isPaused=function(){const u=this._readableState;return u[ae]===!0||u.flowing===!1},K.prototype.setEncoding=function(u){const h=new he(u);this._readableState.decoder=h,this._readableState.encoding=this._readableState.decoder.encoding;const W=this._readableState.buffer;let F="";for(const ee of W)F+=h.write(ee);return W.clear(),F!==""&&W.push(F),this._readableState.length=F.length,this};const pe=1073741824;function ve(u){if(u>pe)throw new k("size","<= 1GiB",u);return u--,u|=u>>>1,u|=u>>>2,u|=u>>>4,u|=u>>>8,u|=u>>>16,u++,u}function _e(u,h){return u<=0||h.length===0&&h.ended?0:(h.state&z)!==0?1:n(u)?h.flowing&&h.length?h.buffer.first().length:h.length:u<=h.length?u:h.ended?h.length:0}K.prototype.read=function(u){v("read",u),u===void 0?u=NaN:r(u)||(u=i(u,10));const h=this._readableState,W=u;if(u>h.highWaterMark&&(h.highWaterMark=ve(u)),u!==0&&(h.state&=~C),u===0&&h.needReadable&&((h.highWaterMark!==0?h.length>=h.highWaterMark:h.length>0)||h.ended))return v("read: emitReadable",h.length,h.ended),h.length===0&&h.ended?Xt(this):Pe(this),null;if(u=_e(u,h),u===0&&h.ended)return h.length===0&&Xt(this),null;let F=(h.state&te)!==0;if(v("need readable",F),(h.length===0||h.length-u<h.highWaterMark)&&(F=!0,v("length less than watermark",F)),h.ended||h.reading||h.destroyed||h.errored||!h.constructed)F=!1,v("reading, ended or constructing",F);else if(F){v("do read"),h.state|=se|Y,h.length===0&&(h.state|=te);try{this._read(h.highWaterMark)}catch(ge){b(this,ge)}h.state&=~Y,h.reading||(u=_e(W,h))}let ee;return u>0?ee=Cr(u,h):ee=null,ee===null?(h.needReadable=h.length<=h.highWaterMark,u=0):(h.length-=u,h.multiAwaitDrain?h.awaitDrainWriters.clear():h.awaitDrainWriters=null),h.length===0&&(h.ended||(h.needReadable=!0),W!==u&&h.ended&&Xt(this)),ee!==null&&!h.errorEmitted&&!h.closeEmitted&&(h.dataEmitted=!0,this.emit("data",ee)),ee};function Ce(u,h){if(v("onEofChunk"),!h.ended){if(h.decoder){const W=h.decoder.end();W&&W.length&&(h.buffer.push(W),h.length+=h.objectMode?1:W.length)}h.ended=!0,h.sync?Pe(u):(h.needReadable=!1,h.emittedReadable=!0,Nt(u))}}function Pe(u){const h=u._readableState;v("emitReadable",h.needReadable,h.emittedReadable),h.needReadable=!1,h.emittedReadable||(v("emitReadable",h.flowing),h.emittedReadable=!0,e.nextTick(Nt,u))}function Nt(u){const h=u._readableState;v("emitReadable_",h.destroyed,h.length,h.ended),!h.destroyed&&!h.errored&&(h.length||h.ended)&&(u.emit("readable"),h.emittedReadable=!1),h.needReadable=!h.flowing&&!h.ended&&h.length<=h.highWaterMark,Rr(u)}function Me(u,h){!h.readingMore&&h.constructed&&(h.readingMore=!0,e.nextTick(Mn,u,h))}function Mn(u,h){for(;!h.reading&&!h.ended&&(h.length<h.highWaterMark||h.flowing&&h.length===0);){const W=h.length;if(v("maybeReadMore read 0"),u.read(0),W===h.length)break}h.readingMore=!1}K.prototype._read=function(u){throw new T("_read()")},K.prototype.pipe=function(u,h){const W=this,F=this._readableState;F.pipes.length===1&&(F.multiAwaitDrain||(F.multiAwaitDrain=!0,F.awaitDrainWriters=new d(F.awaitDrainWriters?[F.awaitDrainWriters]:[]))),F.pipes.push(u),v("pipe count=%d opts=%j",F.pipes.length,h);const ge=(!h||h.end!==!1)&&u!==e.stdout&&u!==e.stderr?ze:Ft;F.endEmitted?e.nextTick(ge):W.once("end",ge),u.on("unpipe",be);function be(it,He){v("onunpipe"),it===W&&He&&He.hasUnpiped===!1&&(He.hasUnpiped=!0,jn())}function ze(){v("onend"),u.end()}let Re,zt=!1;function jn(){v("cleanup"),u.removeListener("close",Dr),u.removeListener("finish",Pr),Re&&u.removeListener("drain",Re),u.removeListener("error",Mr),u.removeListener("unpipe",be),W.removeListener("end",ze),W.removeListener("end",Ft),W.removeListener("data",Fn),zt=!0,Re&&F.awaitDrainWriters&&(!u._writableState||u._writableState.needDrain)&&Re()}function Nn(){zt||(F.pipes.length===1&&F.pipes[0]===u?(v("false write response, pause",0),F.awaitDrainWriters=u,F.multiAwaitDrain=!1):F.pipes.length>1&&F.pipes.includes(u)&&(v("false write response, pause",F.awaitDrainWriters.size),F.awaitDrainWriters.add(u)),W.pause()),Re||(Re=Dn(W,u),u.on("drain",Re))}W.on("data",Fn);function Fn(it){v("ondata");const He=u.write(it);v("dest.write",He),He===!1&&Nn()}function Mr(it){if(v("onerror",it),Ft(),u.removeListener("error",Mr),u.listenerCount("error")===0){const He=u._writableState||u._readableState;He&&!He.errorEmitted?b(u,it):u.emit("error",it)}}E(u,"error",Mr);function Dr(){u.removeListener("finish",Pr),Ft()}u.once("close",Dr);function Pr(){v("onfinish"),u.removeListener("close",Dr),Ft()}u.once("finish",Pr);function Ft(){v("unpipe"),W.unpipe(u)}return u.emit("pipe",W),u.writableNeedDrain===!0?Nn():F.flowing||(v("pipe resume"),W.resume()),u};function Dn(u,h){return function(){const F=u._readableState;F.awaitDrainWriters===h?(v("pipeOnDrain",1),F.awaitDrainWriters=null):F.multiAwaitDrain&&(v("pipeOnDrain",F.awaitDrainWriters.size),F.awaitDrainWriters.delete(h)),(!F.awaitDrainWriters||F.awaitDrainWriters.size===0)&&u.listenerCount("data")&&u.resume()}}K.prototype.unpipe=function(u){const h=this._readableState,W={hasUnpiped:!1};if(h.pipes.length===0)return this;if(!u){const ee=h.pipes;h.pipes=[],this.pause();for(let ge=0;ge<ee.length;ge++)ee[ge].emit("unpipe",this,{hasUnpiped:!1});return this}const F=t(h.pipes,u);return F===-1?this:(h.pipes.splice(F,1),h.pipes.length===0&&this.pause(),u.emit("unpipe",this,W),this)},K.prototype.on=function(u,h){const W=M.prototype.on.call(this,u,h),F=this._readableState;return u==="data"?(F.readableListening=this.listenerCount("readable")>0,F.flowing!==!1&&this.resume()):u==="readable"&&!F.endEmitted&&!F.readableListening&&(F.readableListening=F.needReadable=!0,F.flowing=!1,F.emittedReadable=!1,v("on readable",F.length,F.reading),F.length?Pe(this):F.reading||e.nextTick(Pn,this)),W},K.prototype.addListener=K.prototype.on,K.prototype.removeListener=function(u,h){const W=M.prototype.removeListener.call(this,u,h);return u==="readable"&&e.nextTick(xr,this),W},K.prototype.off=K.prototype.removeListener,K.prototype.removeAllListeners=function(u){const h=M.prototype.removeAllListeners.apply(this,arguments);return(u==="readable"||u===void 0)&&e.nextTick(xr,this),h};function xr(u){const h=u._readableState;h.readableListening=u.listenerCount("readable")>0,h.resumeScheduled&&h[ae]===!1?h.flowing=!0:u.listenerCount("data")>0?u.resume():h.readableListening||(h.flowing=null)}function Pn(u){v("readable nexttick read 0"),u.read(0)}K.prototype.resume=function(){const u=this._readableState;return u.flowing||(v("resume"),u.flowing=!u.readableListening,Ir(this,u)),u[ae]=!1,this};function Ir(u,h){h.resumeScheduled||(h.resumeScheduled=!0,e.nextTick(kn,u,h))}function kn(u,h){v("resume",h.reading),h.reading||u.read(0),h.resumeScheduled=!1,u.emit("resume"),Rr(u),h.flowing&&!h.reading&&u.read(0)}K.prototype.pause=function(){return v("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(v("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[ae]=!0,this};function Rr(u){const h=u._readableState;for(v("flow",h.flowing);h.flowing&&u.read()!==null;);}K.prototype.wrap=function(u){let h=!1;u.on("data",F=>{!this.push(F)&&u.pause&&(h=!0,u.pause())}),u.on("end",()=>{this.push(null)}),u.on("error",F=>{b(this,F)}),u.on("close",()=>{this.destroy()}),u.on("destroy",()=>{this.destroy()}),this._read=()=>{h&&u.resume&&(h=!1,u.resume())};const W=a(u);for(let F=1;F<W.length;F++){const ee=W[F];this[ee]===void 0&&typeof u[ee]=="function"&&(this[ee]=u[ee].bind(u))}return this},K.prototype[g]=function(){return lr(this)},K.prototype.iterator=function(u){return u!==void 0&&oe(u,"options"),lr(this,u)};function lr(u,h){typeof u.read!="function"&&(u=K.wrap(u,{objectMode:!0}));const W=$r(u,h);return W.stream=u,W}async function*$r(u,h){let W=le;function F(be){this===u?(W(),W=le):W=be}u.on("readable",F);let ee;const ge=S(u,{writable:!1},be=>{ee=be?G(ee,be):null,W(),W=le});try{for(;;){const be=u.destroyed?null:u.read();if(be!==null)yield be;else{if(ee)throw ee;if(ee===null)return;await new c(F)}}}catch(be){throw ee=G(ee,be),ee}finally{(ee||h?.destroyOnReturn!==!1)&&(ee===void 0||u._readableState.autoDestroy)?X.destroyer(u,null):(u.off("readable",F),ge())}}o(K.prototype,{readable:{__proto__:null,get(){const u=this._readableState;return!!u&&u.readable!==!1&&!u.destroyed&&!u.errorEmitted&&!u.endEmitted},set(u){this._readableState&&(this._readableState.readable=!!u)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(u){this._readableState&&(this._readableState.flowing=u)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(u){this._readableState&&(this._readableState.destroyed=u)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),o(J.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[ae]!==!1},set(u){this[ae]=!!u}}}),K._fromList=Cr;function Cr(u,h){if(h.length===0)return null;let W;return h.objectMode?W=h.buffer.shift():!u||u>=h.length?(h.decoder?W=h.buffer.join(""):h.buffer.length===1?W=h.buffer.first():W=h.buffer.concat(h.length),h.buffer.clear()):W=h.buffer.consume(u,h.decoder),W}function Xt(u){const h=u._readableState;v("endReadable",h.endEmitted),h.endEmitted||(h.ended=!0,e.nextTick(Tn,h,u))}function Tn(u,h){if(v("endReadableNT",u.endEmitted,u.length),!u.errored&&!u.closeEmitted&&!u.endEmitted&&u.length===0){if(u.endEmitted=!0,h.emit("end"),h.writable&&h.allowHalfOpen===!1)e.nextTick(On,h);else if(u.autoDestroy){const W=h._writableState;(!W||W.autoDestroy&&(W.finished||W.writable===!1))&&h.destroy()}}}function On(u){u.writable&&!u.writableEnded&&!u.destroyed&&u.end()}K.from=function(u,h){return B(K,u,h)};let Zt;function D(){return Zt===void 0&&(Zt={}),Zt}return K.fromWeb=function(u,h){return D().newStreamReadableFromReadableStream(u,h)},K.toWeb=function(u,h){return D().newReadableStreamFromStreamReadable(u,h)},K.wrap=function(u,h){var W,F;return new K({objectMode:(W=(F=u.readableObjectMode)!==null&&F!==void 0?F:u.objectMode)!==null&&W!==void 0?W:!0,...h,destroy(ee,ge){X.destroyer(u,ee),ge(ee)}}).wrap(u)},Fa}var La,Oc;function Gl(){if(Oc)return La;Oc=1;const e=St(),{ArrayPrototypeSlice:t,Error:r,FunctionPrototypeSymbolHasInstance:n,ObjectDefineProperty:i,ObjectDefineProperties:o,ObjectSetPrototypeOf:a,StringPrototypeToLowerCase:s,Symbol:c,SymbolHasInstance:d}=Be();La=oe,oe.WritableState=x;const{EventEmitter:p}=or(),g=Ql().Stream,{Buffer:A}=vt(),I=Rn(),{addAbortSignal:M}=Xo(),{getHighWaterMark:E,getDefaultHighWaterMark:_}=Zo(),{ERR_INVALID_ARG_TYPE:R,ERR_METHOD_NOT_IMPLEMENTED:S,ERR_MULTIPLE_CALLBACK:v,ERR_STREAM_CANNOT_PIPE:V,ERR_STREAM_DESTROYED:X,ERR_STREAM_ALREADY_FINISHED:re,ERR_STREAM_NULL_VALUES:ie,ERR_STREAM_WRITE_AFTER_END:G,ERR_UNKNOWN_ENCODING:fe}=ft().codes,{errorOrDestroy:T}=I;a(oe.prototype,g.prototype),a(oe,g);function k(){}const H=c("kOnFinished");function x(l,f,w){typeof w!="boolean"&&(w=f instanceof nr()),this.objectMode=!!(l&&l.objectMode),w&&(this.objectMode=this.objectMode||!!(l&&l.writableObjectMode)),this.highWaterMark=l?E(this,l,"writableHighWaterMark",w):_(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const P=!!(l&&l.decodeStrings===!1);this.decodeStrings=!P,this.defaultEncoding=l&&l.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=b.bind(void 0,f),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,$(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!l||l.emitClose!==!1,this.autoDestroy=!l||l.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[H]=[]}function $(l){l.buffered=[],l.bufferedIndex=0,l.allBuffers=!0,l.allNoop=!0}x.prototype.getBuffer=function(){return t(this.buffered,this.bufferedIndex)},i(x.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function oe(l){const f=this instanceof nr();if(!f&&!n(oe,this))return new oe(l);this._writableState=new x(l,this,f),l&&(typeof l.write=="function"&&(this._write=l.write),typeof l.writev=="function"&&(this._writev=l.writev),typeof l.destroy=="function"&&(this._destroy=l.destroy),typeof l.final=="function"&&(this._final=l.final),typeof l.construct=="function"&&(this._construct=l.construct),l.signal&&M(l.signal,this)),g.call(this,l),I.construct(this,()=>{const w=this._writableState;w.writing||se(this,w),C(this,w)})}i(oe,d,{__proto__:null,value:function(l){return n(this,l)?!0:this!==oe?!1:l&&l._writableState instanceof x}}),oe.prototype.pipe=function(){T(this,new V)};function ae(l,f,w,P){const N=l._writableState;if(typeof w=="function")P=w,w=N.defaultEncoding;else{if(!w)w=N.defaultEncoding;else if(w!=="buffer"&&!A.isEncoding(w))throw new fe(w);typeof P!="function"&&(P=k)}if(f===null)throw new ie;if(!N.objectMode)if(typeof f=="string")N.decodeStrings!==!1&&(f=A.from(f,w),w="buffer");else if(f instanceof A)w="buffer";else if(g._isUint8Array(f))f=g._uint8ArrayToBuffer(f),w="buffer";else throw new R("chunk",["string","Buffer","Uint8Array"],f);let q;return N.ending?q=new G:N.destroyed&&(q=new X("write")),q?(e.nextTick(P,q),T(l,q,!0),q):(N.pendingcb++,he(l,N,f,w,P))}oe.prototype.write=function(l,f,w){return ae(this,l,f,w)===!0},oe.prototype.cork=function(){this._writableState.corked++},oe.prototype.uncork=function(){const l=this._writableState;l.corked&&(l.corked--,l.writing||se(this,l))},oe.prototype.setDefaultEncoding=function(f){if(typeof f=="string"&&(f=s(f)),!A.isEncoding(f))throw new fe(f);return this._writableState.defaultEncoding=f,this};function he(l,f,w,P,N){const q=f.objectMode?1:w.length;f.length+=q;const m=f.length<f.highWaterMark;return m||(f.needDrain=!0),f.writing||f.corked||f.errored||!f.constructed?(f.buffered.push({chunk:w,encoding:P,callback:N}),f.allBuffers&&P!=="buffer"&&(f.allBuffers=!1),f.allNoop&&N!==k&&(f.allNoop=!1)):(f.writelen=q,f.writecb=N,f.writing=!0,f.sync=!0,l._write(w,P,f.onwrite),f.sync=!1),m&&!f.errored&&!f.destroyed}function B(l,f,w,P,N,q,m){f.writelen=P,f.writecb=m,f.writing=!0,f.sync=!0,f.destroyed?f.onwrite(new X("write")):w?l._writev(N,f.onwrite):l._write(N,q,f.onwrite),f.sync=!1}function le(l,f,w,P){--f.pendingcb,P(w),L(f),T(l,w)}function b(l,f){const w=l._writableState,P=w.sync,N=w.writecb;if(typeof N!="function"){T(l,new v);return}w.writing=!1,w.writecb=null,w.length-=w.writelen,w.writelen=0,f?(f.stack,w.errored||(w.errored=f),l._readableState&&!l._readableState.errored&&(l._readableState.errored=f),P?e.nextTick(le,l,w,f,N):le(l,w,f,N)):(w.buffered.length>w.bufferedIndex&&se(l,w),P?w.afterWriteTickInfo!==null&&w.afterWriteTickInfo.cb===N?w.afterWriteTickInfo.count++:(w.afterWriteTickInfo={count:1,cb:N,stream:l,state:w},e.nextTick(z,w.afterWriteTickInfo)):ne(l,w,1,N))}function z({stream:l,state:f,count:w,cb:P}){return f.afterWriteTickInfo=null,ne(l,f,w,P)}function ne(l,f,w,P){for(!f.ending&&!l.destroyed&&f.length===0&&f.needDrain&&(f.needDrain=!1,l.emit("drain"));w-- >0;)f.pendingcb--,P();f.destroyed&&L(f),C(l,f)}function L(l){if(l.writing)return;for(let N=l.bufferedIndex;N<l.buffered.length;++N){var f;const{chunk:q,callback:m}=l.buffered[N],U=l.objectMode?1:q.length;l.length-=U,m((f=l.errored)!==null&&f!==void 0?f:new X("write"))}const w=l[H].splice(0);for(let N=0;N<w.length;N++){var P;w[N]((P=l.errored)!==null&&P!==void 0?P:new X("end"))}$(l)}function se(l,f){if(f.corked||f.bufferProcessing||f.destroyed||!f.constructed)return;const{buffered:w,bufferedIndex:P,objectMode:N}=f,q=w.length-P;if(!q)return;let m=P;if(f.bufferProcessing=!0,q>1&&l._writev){f.pendingcb-=q-1;const U=f.allNoop?k:K=>{for(let de=m;de<w.length;++de)w[de].callback(K)},J=f.allNoop&&m===0?w:t(w,m);J.allBuffers=f.allBuffers,B(l,f,!0,f.length,J,"",U),$(f)}else{do{const{chunk:U,encoding:J,callback:K}=w[m];w[m++]=null;const de=N?1:U.length;B(l,f,!1,de,U,J,K)}while(m<w.length&&!f.writing);m===w.length?$(f):m>256?(w.splice(0,m),f.bufferedIndex=0):f.bufferedIndex=m}f.bufferProcessing=!1}oe.prototype._write=function(l,f,w){if(this._writev)this._writev([{chunk:l,encoding:f}],w);else throw new S("_write()")},oe.prototype._writev=null,oe.prototype.end=function(l,f,w){const P=this._writableState;typeof l=="function"?(w=l,l=null,f=null):typeof f=="function"&&(w=f,f=null);let N;if(l!=null){const q=ae(this,l,f);q instanceof r&&(N=q)}return P.corked&&(P.corked=1,this.uncork()),N||(!P.errored&&!P.ending?(P.ending=!0,C(this,P,!0),P.ended=!0):P.finished?N=new re("end"):P.destroyed&&(N=new X("end"))),typeof w=="function"&&(N||P.finished?e.nextTick(w,N):P[H].push(w)),this};function ce(l){return l.ending&&!l.destroyed&&l.constructed&&l.length===0&&!l.errored&&l.buffered.length===0&&!l.finished&&!l.writing&&!l.errorEmitted&&!l.closeEmitted}function Y(l,f){let w=!1;function P(N){if(w){T(l,N??v());return}if(w=!0,f.pendingcb--,N){const q=f[H].splice(0);for(let m=0;m<q.length;m++)q[m](N);T(l,N,f.sync)}else ce(f)&&(f.prefinished=!0,l.emit("prefinish"),f.pendingcb++,e.nextTick(O,l,f))}f.sync=!0,f.pendingcb++;try{l._final(P)}catch(N){P(N)}f.sync=!1}function te(l,f){!f.prefinished&&!f.finalCalled&&(typeof l._final=="function"&&!f.destroyed?(f.finalCalled=!0,Y(l,f)):(f.prefinished=!0,l.emit("prefinish")))}function C(l,f,w){ce(f)&&(te(l,f),f.pendingcb===0&&(w?(f.pendingcb++,e.nextTick((P,N)=>{ce(N)?O(P,N):N.pendingcb--},l,f)):ce(f)&&(f.pendingcb++,O(l,f))))}function O(l,f){f.pendingcb--,f.finished=!0;const w=f[H].splice(0);for(let P=0;P<w.length;P++)w[P]();if(l.emit("finish"),f.autoDestroy){const P=l._readableState;(!P||P.autoDestroy&&(P.endEmitted||P.readable===!1))&&l.destroy()}}o(oe.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(l){this._writableState&&(this._writableState.destroyed=l)}},writable:{__proto__:null,get(){const l=this._writableState;return!!l&&l.writable!==!1&&!l.destroyed&&!l.errored&&!l.ending&&!l.ended},set(l){this._writableState&&(this._writableState.writable=!!l)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const l=this._writableState;return l?!l.destroyed&&!l.ending&&l.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const Z=I.destroy;oe.prototype.destroy=function(l,f){const w=this._writableState;return!w.destroyed&&(w.bufferedIndex<w.buffered.length||w[H].length)&&e.nextTick(L,w),Z.call(this,l,f),this},oe.prototype._undestroy=I.undestroy,oe.prototype._destroy=function(l,f){f(l)},oe.prototype[p.captureRejectionSymbol]=function(l){this.destroy(l)};let ue;function j(){return ue===void 0&&(ue={}),ue}return oe.fromWeb=function(l,f){return j().newStreamWritableFromWritableStream(l,f)},oe.toWeb=function(l){return j().newWritableStreamFromStreamWritable(l)},La}var Ua,jc;function Qw(){if(jc)return Ua;jc=1;const e=St(),t=vt(),{isReadable:r,isWritable:n,isIterable:i,isNodeStream:o,isReadableNodeStream:a,isWritableNodeStream:s,isDuplexNodeStream:c,isReadableStream:d,isWritableStream:p}=ar(),g=Sr(),{AbortError:A,codes:{ERR_INVALID_ARG_TYPE:I,ERR_INVALID_RETURN_VALUE:M}}=ft(),{destroyer:E}=Rn(),_=nr(),R=$o(),S=Gl(),{createDeferredPromise:v}=mt(),V=lp(),X=globalThis.Blob||t.Blob,re=typeof X<"u"?function(x){return x instanceof X}:function(x){return!1},ie=globalThis.AbortController||Gt().AbortController,{FunctionPrototypeCall:G}=Be();class fe extends _{constructor(x){super(x),x?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),x?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}Ua=function H(x,$){if(c(x))return x;if(a(x))return k({readable:x});if(s(x))return k({writable:x});if(o(x))return k({writable:!1,readable:!1});if(d(x))return k({readable:R.fromWeb(x)});if(p(x))return k({writable:S.fromWeb(x)});if(typeof x=="function"){const{value:ae,write:he,final:B,destroy:le}=T(x);if(i(ae))return V(fe,ae,{objectMode:!0,write:he,final:B,destroy:le});const b=ae?.then;if(typeof b=="function"){let z;const ne=G(b,ae,L=>{if(L!=null)throw new M("nully","body",L)},L=>{E(z,L)});return z=new fe({objectMode:!0,readable:!1,write:he,final(L){B(async()=>{try{await ne,e.nextTick(L,null)}catch(se){e.nextTick(L,se)}})},destroy:le})}throw new M("Iterable, AsyncIterable or AsyncFunction",$,ae)}if(re(x))return H(x.arrayBuffer());if(i(x))return V(fe,x,{objectMode:!0,writable:!1});if(d(x?.readable)&&p(x?.writable))return fe.fromWeb(x);if(typeof x?.writable=="object"||typeof x?.readable=="object"){const ae=x!=null&&x.readable?a(x?.readable)?x?.readable:H(x.readable):void 0,he=x!=null&&x.writable?s(x?.writable)?x?.writable:H(x.writable):void 0;return k({readable:ae,writable:he})}const oe=x?.then;if(typeof oe=="function"){let ae;return G(oe,x,he=>{he!=null&&ae.push(he),ae.push(null)},he=>{E(ae,he)}),ae=new fe({objectMode:!0,writable:!1,read(){}})}throw new I($,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],x)};function T(H){let{promise:x,resolve:$}=v();const oe=new ie,ae=oe.signal;return{value:H((async function*(){for(;;){const B=x;x=null;const{chunk:le,done:b,cb:z}=await B;if(e.nextTick(z),b)return;if(ae.aborted)throw new A(void 0,{cause:ae.reason});({promise:x,resolve:$}=v()),yield le}})(),{signal:ae}),write(B,le,b){const z=$;$=null,z({chunk:B,done:!1,cb:b})},final(B){const le=$;$=null,le({done:!0,cb:B})},destroy(B,le){oe.abort(),le(B)}}}function k(H){const x=H.readable&&typeof H.readable.read!="function"?R.wrap(H.readable):H.readable,$=H.writable;let oe=!!r(x),ae=!!n($),he,B,le,b,z;function ne(L){const se=b;b=null,se?se(L):L&&z.destroy(L)}return z=new fe({readableObjectMode:!!(x!=null&&x.readableObjectMode),writableObjectMode:!!($!=null&&$.writableObjectMode),readable:oe,writable:ae}),ae&&(g($,L=>{ae=!1,L&&E(x,L),ne(L)}),z._write=function(L,se,ce){$.write(L,se)?ce():he=ce},z._final=function(L){$.end(),B=L},$.on("drain",function(){if(he){const L=he;he=null,L()}}),$.on("finish",function(){if(B){const L=B;B=null,L()}})),oe&&(g(x,L=>{oe=!1,L&&E(x,L),ne(L)}),x.on("readable",function(){if(le){const L=le;le=null,L()}}),x.on("end",function(){z.push(null)}),z._read=function(){for(;;){const L=x.read();if(L===null){le=z._read;return}if(!z.push(L))return}}),z._destroy=function(L,se){!L&&b!==null&&(L=new A),le=null,he=null,B=null,b===null?se(L):(b=se,E($,L),E(x,L))},z}return Ua}var Ba,Nc;function nr(){if(Nc)return Ba;Nc=1;const{ObjectDefineProperties:e,ObjectGetOwnPropertyDescriptor:t,ObjectKeys:r,ObjectSetPrototypeOf:n}=Be();Ba=a;const i=$o(),o=Gl();n(a.prototype,i.prototype),n(a,i);{const p=r(o.prototype);for(let g=0;g<p.length;g++){const A=p[g];a.prototype[A]||(a.prototype[A]=o.prototype[A])}}function a(p){if(!(this instanceof a))return new a(p);i.call(this,p),o.call(this,p),p?(this.allowHalfOpen=p.allowHalfOpen!==!1,p.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),p.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}e(a.prototype,{writable:{__proto__:null,...t(o.prototype,"writable")},writableHighWaterMark:{__proto__:null,...t(o.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...t(o.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...t(o.prototype,"writableBuffer")},writableLength:{__proto__:null,...t(o.prototype,"writableLength")},writableFinished:{__proto__:null,...t(o.prototype,"writableFinished")},writableCorked:{__proto__:null,...t(o.prototype,"writableCorked")},writableEnded:{__proto__:null,...t(o.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...t(o.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(p){this._readableState&&this._writableState&&(this._readableState.destroyed=p,this._writableState.destroyed=p)}}});let s;function c(){return s===void 0&&(s={}),s}a.fromWeb=function(p,g){return c().newStreamDuplexFromReadableWritablePair(p,g)},a.toWeb=function(p){return c().newReadableWritablePairFromDuplex(p)};let d;return a.from=function(p){return d||(d=Qw()),d(p,"body")},Ba}var qa,Fc;function up(){if(Fc)return qa;Fc=1;const{ObjectSetPrototypeOf:e,Symbol:t}=Be();qa=a;const{ERR_METHOD_NOT_IMPLEMENTED:r}=ft().codes,n=nr(),{getHighWaterMark:i}=Zo();e(a.prototype,n.prototype),e(a,n);const o=t("kCallback");function a(d){if(!(this instanceof a))return new a(d);const p=d?i(this,d,"readableHighWaterMark",!0):null;p===0&&(d={...d,highWaterMark:null,readableHighWaterMark:p,writableHighWaterMark:d.writableHighWaterMark||0}),n.call(this,d),this._readableState.sync=!1,this[o]=null,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",c)}function s(d){typeof this._flush=="function"&&!this.destroyed?this._flush((p,g)=>{if(p){d?d(p):this.destroy(p);return}g!=null&&this.push(g),this.push(null),d&&d()}):(this.push(null),d&&d())}function c(){this._final!==s&&s.call(this)}return a.prototype._final=s,a.prototype._transform=function(d,p,g){throw new r("_transform()")},a.prototype._write=function(d,p,g){const A=this._readableState,I=this._writableState,M=A.length;this._transform(d,p,(E,_)=>{if(E){g(E);return}_!=null&&this.push(_),I.ended||M===A.length||A.length<A.highWaterMark?g():this[o]=g})},a.prototype._read=function(){if(this[o]){const d=this[o];this[o]=null,d()}},qa}var Ka,Lc;function cp(){if(Lc)return Ka;Lc=1;const{ObjectSetPrototypeOf:e}=Be();Ka=r;const t=up();e(r.prototype,t.prototype),e(r,t);function r(n){if(!(this instanceof r))return new r(n);t.call(this,n)}return r.prototype._transform=function(n,i,o){o(null,n)},Ka}var za,Uc;function Jl(){if(Uc)return za;Uc=1;const e=St(),{ArrayIsArray:t,Promise:r,SymbolAsyncIterator:n,SymbolDispose:i}=Be(),o=Sr(),{once:a}=mt(),s=Rn(),c=nr(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:p,ERR_INVALID_RETURN_VALUE:g,ERR_MISSING_ARGS:A,ERR_STREAM_DESTROYED:I,ERR_STREAM_PREMATURE_CLOSE:M},AbortError:E}=ft(),{validateFunction:_,validateAbortSignal:R}=Gi(),{isIterable:S,isReadable:v,isReadableNodeStream:V,isNodeStream:X,isTransformStream:re,isWebStream:ie,isReadableStream:G,isReadableFinished:fe}=ar(),T=globalThis.AbortController||Gt().AbortController;let k,H,x;function $(L,se,ce){let Y=!1;L.on("close",()=>{Y=!0});const te=o(L,{readable:se,writable:ce},C=>{Y=!C});return{destroy:C=>{Y||(Y=!0,s.destroyer(L,C||new I("pipe")))},cleanup:te}}function oe(L){return _(L[L.length-1],"streams[stream.length - 1]"),L.pop()}function ae(L){if(S(L))return L;if(V(L))return he(L);throw new p("val",["Readable","Iterable","AsyncIterable"],L)}async function*he(L){H||(H=$o()),yield*H.prototype[n].call(L)}async function B(L,se,ce,{end:Y}){let te,C=null;const O=j=>{if(j&&(te=j),C){const l=C;C=null,l()}},Z=()=>new r((j,l)=>{te?l(te):C=()=>{te?l(te):j()}});se.on("drain",O);const ue=o(se,{readable:!1},O);try{se.writableNeedDrain&&await Z();for await(const j of L)se.write(j)||await Z();Y&&(se.end(),await Z()),ce()}catch(j){ce(te!==j?d(te,j):j)}finally{ue(),se.off("drain",O)}}async function le(L,se,ce,{end:Y}){re(se)&&(se=se.writable);const te=se.getWriter();try{for await(const C of L)await te.ready,te.write(C).catch(()=>{});await te.ready,Y&&await te.close(),ce()}catch(C){try{await te.abort(C),ce(C)}catch(O){ce(O)}}}function b(...L){return z(L,a(oe(L)))}function z(L,se,ce){if(L.length===1&&t(L[0])&&(L=L[0]),L.length<2)throw new A("streams");const Y=new T,te=Y.signal,C=ce?.signal,O=[];R(C,"options.signal");function Z(){N(new E)}x=x||mt().addAbortListener;let ue;C&&(ue=x(C,Z));let j,l;const f=[];let w=0;function P(J){N(J,--w===0)}function N(J,K){var de;if(J&&(!j||j.code==="ERR_STREAM_PREMATURE_CLOSE")&&(j=J),!(!j&&!K)){for(;f.length;)f.shift()(j);(de=ue)===null||de===void 0||de[i](),Y.abort(),K&&(j||O.forEach(me=>me()),e.nextTick(se,j,l))}}let q;for(let J=0;J<L.length;J++){const K=L[J],de=J<L.length-1,me=J>0,pe=de||ce?.end!==!1,ve=J===L.length-1;if(X(K)){let _e=function(Ce){Ce&&Ce.name!=="AbortError"&&Ce.code!=="ERR_STREAM_PREMATURE_CLOSE"&&P(Ce)};if(pe){const{destroy:Ce,cleanup:Pe}=$(K,de,me);f.push(Ce),v(K)&&ve&&O.push(Pe)}K.on("error",_e),v(K)&&ve&&O.push(()=>{K.removeListener("error",_e)})}if(J===0)if(typeof K=="function"){if(q=K({signal:te}),!S(q))throw new g("Iterable, AsyncIterable or Stream","source",q)}else S(K)||V(K)||re(K)?q=K:q=c.from(K);else if(typeof K=="function"){if(re(q)){var m;q=ae((m=q)===null||m===void 0?void 0:m.readable)}else q=ae(q);if(q=K(q,{signal:te}),de){if(!S(q,!0))throw new g("AsyncIterable",`transform[${J-1}]`,q)}else{var U;k||(k=cp());const _e=new k({objectMode:!0}),Ce=(U=q)===null||U===void 0?void 0:U.then;if(typeof Ce=="function")w++,Ce.call(q,Me=>{l=Me,Me!=null&&_e.write(Me),pe&&_e.end(),e.nextTick(P)},Me=>{_e.destroy(Me),e.nextTick(P,Me)});else if(S(q,!0))w++,B(q,_e,P,{end:pe});else if(G(q)||re(q)){const Me=q.readable||q;w++,B(Me,_e,P,{end:pe})}else throw new g("AsyncIterable or Promise","destination",q);q=_e;const{destroy:Pe,cleanup:Nt}=$(q,!1,!0);f.push(Pe),ve&&O.push(Nt)}}else if(X(K)){if(V(q)){w+=2;const _e=ne(q,K,P,{end:pe});v(K)&&ve&&O.push(_e)}else if(re(q)||G(q)){const _e=q.readable||q;w++,B(_e,K,P,{end:pe})}else if(S(q))w++,B(q,K,P,{end:pe});else throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],q);q=K}else if(ie(K)){if(V(q))w++,le(ae(q),K,P,{end:pe});else if(G(q)||S(q))w++,le(q,K,P,{end:pe});else if(re(q))w++,le(q.readable,K,P,{end:pe});else throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],q);q=K}else q=c.from(K)}return(te!=null&&te.aborted||C!=null&&C.aborted)&&e.nextTick(Z),q}function ne(L,se,ce,{end:Y}){let te=!1;if(se.on("close",()=>{te||ce(new M)}),L.pipe(se,{end:!1}),Y){let C=function(){te=!0,se.end()};fe(L)?e.nextTick(C):L.once("end",C)}else ce();return o(L,{readable:!0,writable:!1},C=>{const O=L._readableState;C&&C.code==="ERR_STREAM_PREMATURE_CLOSE"&&O&&O.ended&&!O.errored&&!O.errorEmitted?L.once("end",ce).once("error",ce):ce(C)}),o(se,{readable:!1,writable:!0},ce)}return za={pipelineImpl:z,pipeline:b},za}var Wa,Bc;function dp(){if(Bc)return Wa;Bc=1;const{pipeline:e}=Jl(),t=nr(),{destroyer:r}=Rn(),{isNodeStream:n,isReadable:i,isWritable:o,isWebStream:a,isTransformStream:s,isWritableStream:c,isReadableStream:d}=ar(),{AbortError:p,codes:{ERR_INVALID_ARG_VALUE:g,ERR_MISSING_ARGS:A}}=ft(),I=Sr();return Wa=function(...E){if(E.length===0)throw new A("streams");if(E.length===1)return t.from(E[0]);const _=[...E];if(typeof E[0]=="function"&&(E[0]=t.from(E[0])),typeof E[E.length-1]=="function"){const k=E.length-1;E[k]=t.from(E[k])}for(let k=0;k<E.length;++k)if(!(!n(E[k])&&!a(E[k]))){if(k<E.length-1&&!(i(E[k])||d(E[k])||s(E[k])))throw new g(`streams[${k}]`,_[k],"must be readable");if(k>0&&!(o(E[k])||c(E[k])||s(E[k])))throw new g(`streams[${k}]`,_[k],"must be writable")}let R,S,v,V,X;function re(k){const H=V;V=null,H?H(k):k?X.destroy(k):!T&&!fe&&X.destroy()}const ie=E[0],G=e(E,re),fe=!!(o(ie)||c(ie)||s(ie)),T=!!(i(G)||d(G)||s(G));if(X=new t({writableObjectMode:!!(ie!=null&&ie.writableObjectMode),readableObjectMode:!!(G!=null&&G.readableObjectMode),writable:fe,readable:T}),fe){if(n(ie))X._write=function(H,x,$){ie.write(H,x)?$():R=$},X._final=function(H){ie.end(),S=H},ie.on("drain",function(){if(R){const H=R;R=null,H()}});else if(a(ie)){const x=(s(ie)?ie.writable:ie).getWriter();X._write=async function($,oe,ae){try{await x.ready,x.write($).catch(()=>{}),ae()}catch(he){ae(he)}},X._final=async function($){try{await x.ready,x.close().catch(()=>{}),S=$}catch(oe){$(oe)}}}const k=s(G)?G.readable:G;I(k,()=>{if(S){const H=S;S=null,H()}})}if(T){if(n(G))G.on("readable",function(){if(v){const k=v;v=null,k()}}),G.on("end",function(){X.push(null)}),X._read=function(){for(;;){const k=G.read();if(k===null){v=X._read;return}if(!X.push(k))return}};else if(a(G)){const H=(s(G)?G.readable:G).getReader();X._read=async function(){for(;;)try{const{value:x,done:$}=await H.read();if(!X.push(x))return;if($){X.push(null);return}}catch{return}}}}return X._destroy=function(k,H){!k&&V!==null&&(k=new p),v=null,R=null,S=null,V===null?H(k):(V=H,n(G)&&r(G,k))},X},Wa}var qc;function Gw(){if(qc)return oo;qc=1;const e=globalThis.AbortController||Gt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:t,ERR_INVALID_ARG_TYPE:r,ERR_MISSING_ARGS:n,ERR_OUT_OF_RANGE:i},AbortError:o}=ft(),{validateAbortSignal:a,validateInteger:s,validateObject:c}=Gi(),d=Be().Symbol("kWeak"),p=Be().Symbol("kResistStopPropagation"),{finished:g}=Sr(),A=dp(),{addAbortSignalNoValidate:I}=Xo(),{isWritable:M,isNodeStream:E}=ar(),{deprecate:_}=mt(),{ArrayPrototypePush:R,Boolean:S,MathFloor:v,Number:V,NumberIsNaN:X,Promise:re,PromiseReject:ie,PromiseResolve:G,PromisePrototypeThen:fe,Symbol:T}=Be(),k=T("kEmpty"),H=T("kEof");function x(C,O){if(O!=null&&c(O,"options"),O?.signal!=null&&a(O.signal,"options.signal"),E(C)&&!M(C))throw new t("stream",C,"must be writable");const Z=A(this,C);return O!=null&&O.signal&&I(O.signal,Z),Z}function $(C,O){if(typeof C!="function")throw new r("fn",["Function","AsyncFunction"],C);O!=null&&c(O,"options"),O?.signal!=null&&a(O.signal,"options.signal");let Z=1;O?.concurrency!=null&&(Z=v(O.concurrency));let ue=Z-1;return O?.highWaterMark!=null&&(ue=v(O.highWaterMark)),s(Z,"options.concurrency",1),s(ue,"options.highWaterMark",0),ue+=Z,(async function*(){const l=mt().AbortSignalAny([O?.signal].filter(S)),f=this,w=[],P={signal:l};let N,q,m=!1,U=0;function J(){m=!0,K()}function K(){U-=1,de()}function de(){q&&!m&&U<Z&&w.length<ue&&(q(),q=null)}async function me(){try{for await(let pe of f){if(m)return;if(l.aborted)throw new o;try{if(pe=C(pe,P),pe===k)continue;pe=G(pe)}catch(ve){pe=ie(ve)}U+=1,fe(pe,K,J),w.push(pe),N&&(N(),N=null),!m&&(w.length>=ue||U>=Z)&&await new re(ve=>{q=ve})}w.push(H)}catch(pe){const ve=ie(pe);fe(ve,K,J),w.push(ve)}finally{m=!0,N&&(N(),N=null)}}me();try{for(;;){for(;w.length>0;){const pe=await w[0];if(pe===H)return;if(l.aborted)throw new o;pe!==k&&(yield pe),w.shift(),de()}await new re(pe=>{N=pe})}}finally{m=!0,q&&(q(),q=null)}}).call(this)}function oe(C=void 0){return C!=null&&c(C,"options"),C?.signal!=null&&a(C.signal,"options.signal"),(async function*(){let Z=0;for await(const j of this){var ue;if(C!=null&&(ue=C.signal)!==null&&ue!==void 0&&ue.aborted)throw new o({cause:C.signal.reason});yield[Z++,j]}}).call(this)}async function ae(C,O=void 0){for await(const Z of b.call(this,C,O))return!0;return!1}async function he(C,O=void 0){if(typeof C!="function")throw new r("fn",["Function","AsyncFunction"],C);return!await ae.call(this,async(...Z)=>!await C(...Z),O)}async function B(C,O){for await(const Z of b.call(this,C,O))return Z}async function le(C,O){if(typeof C!="function")throw new r("fn",["Function","AsyncFunction"],C);async function Z(ue,j){return await C(ue,j),k}for await(const ue of $.call(this,Z,O));}function b(C,O){if(typeof C!="function")throw new r("fn",["Function","AsyncFunction"],C);async function Z(ue,j){return await C(ue,j)?ue:k}return $.call(this,Z,O)}class z extends n{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function ne(C,O,Z){var ue;if(typeof C!="function")throw new r("reducer",["Function","AsyncFunction"],C);Z!=null&&c(Z,"options"),Z?.signal!=null&&a(Z.signal,"options.signal");let j=arguments.length>1;if(Z!=null&&(ue=Z.signal)!==null&&ue!==void 0&&ue.aborted){const N=new o(void 0,{cause:Z.signal.reason});throw this.once("error",()=>{}),await g(this.destroy(N)),N}const l=new e,f=l.signal;if(Z!=null&&Z.signal){const N={once:!0,[d]:this,[p]:!0};Z.signal.addEventListener("abort",()=>l.abort(),N)}let w=!1;try{for await(const N of this){var P;if(w=!0,Z!=null&&(P=Z.signal)!==null&&P!==void 0&&P.aborted)throw new o;j?O=await C(O,N,{signal:f}):(O=N,j=!0)}if(!w&&!j)throw new z}finally{l.abort()}return O}async function L(C){C!=null&&c(C,"options"),C?.signal!=null&&a(C.signal,"options.signal");const O=[];for await(const ue of this){var Z;if(C!=null&&(Z=C.signal)!==null&&Z!==void 0&&Z.aborted)throw new o(void 0,{cause:C.signal.reason});R(O,ue)}return O}function se(C,O){const Z=$.call(this,C,O);return(async function*(){for await(const j of Z)yield*j}).call(this)}function ce(C){if(C=V(C),X(C))return 0;if(C<0)throw new i("number",">= 0",C);return C}function Y(C,O=void 0){return O!=null&&c(O,"options"),O?.signal!=null&&a(O.signal,"options.signal"),C=ce(C),(async function*(){var ue;if(O!=null&&(ue=O.signal)!==null&&ue!==void 0&&ue.aborted)throw new o;for await(const l of this){var j;if(O!=null&&(j=O.signal)!==null&&j!==void 0&&j.aborted)throw new o;C--<=0&&(yield l)}}).call(this)}function te(C,O=void 0){return O!=null&&c(O,"options"),O?.signal!=null&&a(O.signal,"options.signal"),C=ce(C),(async function*(){var ue;if(O!=null&&(ue=O.signal)!==null&&ue!==void 0&&ue.aborted)throw new o;for await(const l of this){var j;if(O!=null&&(j=O.signal)!==null&&j!==void 0&&j.aborted)throw new o;if(C-- >0&&(yield l),C<=0)return}}).call(this)}return oo.streamReturningOperators={asIndexedPairs:_(oe,"readable.asIndexedPairs will be removed in a future version."),drop:Y,filter:b,flatMap:se,map:$,take:te,compose:x},oo.promiseReturningOperators={every:he,forEach:le,reduce:ne,toArray:L,some:ae,find:B},oo}var Ha,Kc;function fp(){if(Kc)return Ha;Kc=1;const{ArrayPrototypePop:e,Promise:t}=Be(),{isIterable:r,isNodeStream:n,isWebStream:i}=ar(),{pipelineImpl:o}=Jl(),{finished:a}=Sr();hp();function s(...c){return new t((d,p)=>{let g,A;const I=c[c.length-1];if(I&&typeof I=="object"&&!n(I)&&!r(I)&&!i(I)){const M=e(c);g=M.signal,A=M.end}o(c,(M,E)=>{M?p(M):d(E)},{signal:g,end:A})})}return Ha={finished:a,pipeline:s},Ha}var zc;function hp(){if(zc)return Ea.exports;zc=1;const{Buffer:e}=vt(),{ObjectDefineProperty:t,ObjectKeys:r,ReflectApply:n}=Be(),{promisify:{custom:i}}=mt(),{streamReturningOperators:o,promiseReturningOperators:a}=Gw(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:s}}=ft(),c=dp(),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:p}=Zo(),{pipeline:g}=Jl(),{destroyer:A}=Rn(),I=Sr(),M=fp(),E=ar(),_=Ea.exports=Ql().Stream;_.isDestroyed=E.isDestroyed,_.isDisturbed=E.isDisturbed,_.isErrored=E.isErrored,_.isReadable=E.isReadable,_.isWritable=E.isWritable,_.Readable=$o();for(const S of r(o)){let V=function(...X){if(new.target)throw s();return _.Readable.from(n(v,this,X))};const v=o[S];t(V,"name",{__proto__:null,value:v.name}),t(V,"length",{__proto__:null,value:v.length}),t(_.Readable.prototype,S,{__proto__:null,value:V,enumerable:!1,configurable:!0,writable:!0})}for(const S of r(a)){let V=function(...X){if(new.target)throw s();return n(v,this,X)};const v=a[S];t(V,"name",{__proto__:null,value:v.name}),t(V,"length",{__proto__:null,value:v.length}),t(_.Readable.prototype,S,{__proto__:null,value:V,enumerable:!1,configurable:!0,writable:!0})}_.Writable=Gl(),_.Duplex=nr(),_.Transform=up(),_.PassThrough=cp(),_.pipeline=g;const{addAbortSignal:R}=Xo();return _.addAbortSignal=R,_.finished=I,_.destroy=A,_.compose=c,_.setDefaultHighWaterMark=d,_.getDefaultHighWaterMark=p,t(_,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return M}}),t(g,i,{__proto__:null,enumerable:!0,get(){return M.pipeline}}),t(I,i,{__proto__:null,enumerable:!0,get(){return M.finished}}),_.Stream=_,_._isUint8Array=function(v){return v instanceof Uint8Array},_._uint8ArrayToBuffer=function(v){return e.from(v.buffer,v.byteOffset,v.byteLength)},Ea.exports}var Wc;function Jw(){return Wc||(Wc=1,(function(e){const t=hp(),r=fp(),n=t.Readable.destroy;e.exports=t.Readable,e.exports._uint8ArrayToBuffer=t._uint8ArrayToBuffer,e.exports._isUint8Array=t._isUint8Array,e.exports.isDisturbed=t.isDisturbed,e.exports.isErrored=t.isErrored,e.exports.isReadable=t.isReadable,e.exports.Readable=t.Readable,e.exports.Writable=t.Writable,e.exports.Duplex=t.Duplex,e.exports.Transform=t.Transform,e.exports.PassThrough=t.PassThrough,e.exports.addAbortSignal=t.addAbortSignal,e.exports.finished=t.finished,e.exports.destroy=t.destroy,e.exports.destroy=n,e.exports.pipeline=t.pipeline,e.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return r}}),e.exports.Stream=t.Stream,e.exports.default=e.exports})(Sa)),Sa.exports}var Hc;function Yw(){if(Hc)return Qn;Hc=1,Object.defineProperty(Qn,"__esModule",{value:!0}),Qn.ActorQueryResultSerializeStats=void 0;const e=ip(),t=Uw(),r=vr(),n=ap(),i=Jw();let o=class extends e.ActorQueryResultSerializeFixedMediaTypes{constructor(s){super(s)}async testHandleChecked(s,c){return["bindings","quads"].includes(s.type)?(0,r.passTestVoid)():(0,r.failTest)("This actor can only handle bindings streams or quad streams.")}pushHeader(s){const c=["Result","Delay (ms)","HTTP requests"].join(",");s.push(`${c}
12
+ `)}createStat(s,c){return`${[c,this.delay(s),this.httpObserver.requests].join(",")}
13
+ `}createSpecialLine(s,c){return`${[s,this.delay(c),this.httpObserver.requests].join(",")}
14
+ `}async runHandle(s,c,d){const p=new i.Readable,g=s.type==="bindings"?s.bindingsStream:s.quadStream,A=s.context.getSafe(t.KeysInitQuery.queryTimestampHighResolution);let I=1;function*M(_){yield _()}const E=(0,n.wrap)(g).map(()=>this.createStat(A,I++)).prepend([this.createSpecialLine("PLANNING",A)]).append((0,n.wrap)(M(()=>this.createSpecialLine("TOTAL",A))));return this.pushHeader(p),p.wrap(E),{data:p}}now(){return performance.now()}delay(s){return this.now()-s}};return Qn.ActorQueryResultSerializeStats=o,Qn}var Vc;function Xw(){return Vc||(Vc=1,(function(e){var t=kr&&kr.__createBinding||(Object.create?(function(n,i,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(i,o);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,a,s)}):(function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]})),r=kr&&kr.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r(Ow(),e),r(Yw(),e)})(kr)),kr}var Zw=Xw(),Lr={},ei={},Qc;function $w(){if(Qc)return ei;Qc=1,Object.defineProperty(ei,"__esModule",{value:!0}),ei.ActionObserverHttp=void 0;const e=vr();let t=class extends e.ActionObserver{constructor(n){super(n),this.requests=0,this.bus.subscribeObserver(this),this.httpInvalidator.addInvalidateListener(()=>{this.requests=0})}onRun(n,i,o){this.observedActors.includes(n.name)&&this.requests++}};return ei.ActionObserverHttp=t,ei}var ti={},Va={exports:{}},Qa={exports:{}},Ga,Gc;function qe(){if(Gc)return Ga;Gc=1;class e extends Error{constructor(r){if(!Array.isArray(r))throw new TypeError(`Expected input to be an Array, got ${typeof r}`);let n="";for(let i=0;i<r.length;i++)n+=` ${r[i].stack}
15
+ `;super(n),this.name="AggregateError",this.errors=r}}return Ga={AggregateError:e,ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,r){return t.includes(r)},ArrayPrototypeIndexOf(t,r){return t.indexOf(r)},ArrayPrototypeJoin(t,r){return t.join(r)},ArrayPrototypeMap(t,r){return t.map(r)},ArrayPrototypePop(t,r){return t.pop(r)},ArrayPrototypePush(t,r){return t.push(r)},ArrayPrototypeSlice(t,r,n){return t.slice(r,n)},Error,FunctionPrototypeCall(t,r,...n){return t.call(r,...n)},FunctionPrototypeSymbolHasInstance(t,r){return Function.prototype[Symbol.hasInstance].call(t,r)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,r){return Object.defineProperties(t,r)},ObjectDefineProperty(t,r,n){return Object.defineProperty(t,r,n)},ObjectGetOwnPropertyDescriptor(t,r){return Object.getOwnPropertyDescriptor(t,r)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,r){return Object.setPrototypeOf(t,r)},Promise,PromisePrototypeCatch(t,r){return t.catch(r)},PromisePrototypeThen(t,r,n){return t.then(r,n)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,r){return t.test(r)},SafeSet:Set,String,StringPrototypeSlice(t,r,n){return t.slice(r,n)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,r,n){return t.set(r,n)},Boolean,Uint8Array},Ga}var Ja={exports:{}},Ya,Jc;function pp(){return Jc||(Jc=1,Ya={format(e,...t){return e.replace(/%([sdifj])/g,function(...[r,n]){const i=t.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}),Ya}var Xa,Yc;function ht(){if(Yc)return Xa;Yc=1;const{format:e,inspect:t}=pp(),{AggregateError:r}=qe(),n=globalThis.AggregateError||r,i=Symbol("kIsNodeError"),o=["string","function","number","object","Function","Object","boolean","bigint","symbol"],a=/^([A-Z][a-z0-9]*)+$/,s="__node_internal_",c={};function d(_,R){if(!_)throw new c.ERR_INTERNAL_ASSERTION(R)}function p(_){let R="",S=_.length;const v=_[0]==="-"?1:0;for(;S>=v+4;S-=3)R=`_${_.slice(S-3,S)}${R}`;return`${_.slice(0,S)}${R}`}function g(_,R,S){if(typeof R=="function")return d(R.length<=S.length,`Code: ${_}; The provided arguments length (${S.length}) does not match the required ones (${R.length}).`),R(...S);const v=(R.match(/%[dfijoOs]/g)||[]).length;return d(v===S.length,`Code: ${_}; The provided arguments length (${S.length}) does not match the required ones (${v}).`),S.length===0?R:e(R,...S)}function A(_,R,S){S||(S=Error);class v extends S{constructor(...X){super(g(_,R,X))}toString(){return`${this.name} [${_}]: ${this.message}`}}Object.defineProperties(v.prototype,{name:{value:S.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${_}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),v.prototype.code=_,v.prototype[i]=!0,c[_]=v}function I(_){const R=s+_.name;return Object.defineProperty(_,"name",{value:R}),_}function M(_,R){if(_&&R&&_!==R){if(Array.isArray(R.errors))return R.errors.push(_),R;const S=new n([R,_],R.message);return S.code=R.code,S}return _||R}class E extends Error{constructor(R="The operation was aborted",S=void 0){if(S!==void 0&&typeof S!="object")throw new c.ERR_INVALID_ARG_TYPE("options","Object",S);super(R,S),this.code="ABORT_ERR",this.name="AbortError"}}return A("ERR_ASSERTION","%s",Error),A("ERR_INVALID_ARG_TYPE",(_,R,S)=>{d(typeof _=="string","'name' must be a string"),Array.isArray(R)||(R=[R]);let v="The ";_.endsWith(" argument")?v+=`${_} `:v+=`"${_}" ${_.includes(".")?"property":"argument"} `,v+="must be ";const V=[],X=[],re=[];for(const G of R)d(typeof G=="string","All expected entries have to be of type string"),o.includes(G)?V.push(G.toLowerCase()):a.test(G)?X.push(G):(d(G!=="object",'The value "object" should be written as "Object"'),re.push(G));if(X.length>0){const G=V.indexOf("object");G!==-1&&(V.splice(V,G,1),X.push("Object"))}if(V.length>0){switch(V.length){case 1:v+=`of type ${V[0]}`;break;case 2:v+=`one of type ${V[0]} or ${V[1]}`;break;default:{const G=V.pop();v+=`one of type ${V.join(", ")}, or ${G}`}}(X.length>0||re.length>0)&&(v+=" or ")}if(X.length>0){switch(X.length){case 1:v+=`an instance of ${X[0]}`;break;case 2:v+=`an instance of ${X[0]} or ${X[1]}`;break;default:{const G=X.pop();v+=`an instance of ${X.join(", ")}, or ${G}`}}re.length>0&&(v+=" or ")}switch(re.length){case 0:break;case 1:re[0].toLowerCase()!==re[0]&&(v+="an "),v+=`${re[0]}`;break;case 2:v+=`one of ${re[0]} or ${re[1]}`;break;default:{const G=re.pop();v+=`one of ${re.join(", ")}, or ${G}`}}if(S==null)v+=`. Received ${S}`;else if(typeof S=="function"&&S.name)v+=`. Received function ${S.name}`;else if(typeof S=="object"){var ie;if((ie=S.constructor)!==null&&ie!==void 0&&ie.name)v+=`. Received an instance of ${S.constructor.name}`;else{const G=t(S,{depth:-1});v+=`. Received ${G}`}}else{let G=t(S,{colors:!1});G.length>25&&(G=`${G.slice(0,25)}...`),v+=`. Received type ${typeof S} (${G})`}return v},TypeError),A("ERR_INVALID_ARG_VALUE",(_,R,S="is invalid")=>{let v=t(R);return v.length>128&&(v=v.slice(0,128)+"..."),`The ${_.includes(".")?"property":"argument"} '${_}' ${S}. Received ${v}`},TypeError),A("ERR_INVALID_RETURN_VALUE",(_,R,S)=>{var v;const V=S!=null&&(v=S.constructor)!==null&&v!==void 0&&v.name?`instance of ${S.constructor.name}`:`type ${typeof S}`;return`Expected ${_} to be returned from the "${R}" function but got ${V}.`},TypeError),A("ERR_MISSING_ARGS",(..._)=>{d(_.length>0,"At least one arg needs to be specified");let R;const S=_.length;switch(_=(Array.isArray(_)?_:[_]).map(v=>`"${v}"`).join(" or "),S){case 1:R+=`The ${_[0]} argument`;break;case 2:R+=`The ${_[0]} and ${_[1]} arguments`;break;default:{const v=_.pop();R+=`The ${_.join(", ")}, and ${v} arguments`}break}return`${R} must be specified`},TypeError),A("ERR_OUT_OF_RANGE",(_,R,S)=>{d(R,'Missing "range" argument');let v;if(Number.isInteger(S)&&Math.abs(S)>2**32)v=p(String(S));else if(typeof S=="bigint"){v=String(S);const V=BigInt(2)**BigInt(32);(S>V||S<-V)&&(v=p(v)),v+="n"}else v=t(S);return`The value of "${_}" is out of range. It must be ${R}. Received ${v}`},RangeError),A("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),A("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),A("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),A("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),A("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),A("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),A("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),A("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),A("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),A("ERR_STREAM_WRITE_AFTER_END","write after end",Error),A("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),Xa={AbortError:E,aggregateTwoErrors:I(M),hideStackFrames:I,codes:c},Xa}var Xc;function wt(){return Xc||(Xc=1,(function(e){const t=vt(),{format:r,inspect:n}=pp(),{codes:{ERR_INVALID_ARG_TYPE:i}}=ht(),{kResistStopPropagation:o,AggregateError:a,SymbolDispose:s}=qe(),c=globalThis.AbortSignal||Gt().AbortSignal,d=globalThis.AbortController||Gt().AbortController,p=Object.getPrototypeOf(async function(){}).constructor,g=globalThis.Blob||t.Blob,A=typeof g<"u"?function(_){return _ instanceof g}:function(_){return!1},I=(E,_)=>{if(E!==void 0&&(E===null||typeof E!="object"||!("aborted"in E)))throw new i(_,"AbortSignal",E)},M=(E,_)=>{if(typeof E!="function")throw new i(_,"Function",E)};e.exports={AggregateError:a,kEmptyObject:Object.freeze({}),once(E){let _=!1;return function(...R){_||(_=!0,E.apply(this,R))}},createDeferredPromise:function(){let E,_;return{promise:new Promise((S,v)=>{E=S,_=v}),resolve:E,reject:_}},promisify(E){return new Promise((_,R)=>{E((S,...v)=>S?R(S):_(...v))})},debuglog(){return function(){}},format:r,inspect:n,types:{isAsyncFunction(E){return E instanceof p},isArrayBufferView(E){return ArrayBuffer.isView(E)}},isBlob:A,deprecate(E,_){return E},addAbortListener:or().addAbortListener||function(_,R){if(_===void 0)throw new i("signal","AbortSignal",_);I(_,"signal"),M(R,"listener");let S;return _.aborted?queueMicrotask(()=>R()):(_.addEventListener("abort",R,{__proto__:null,once:!0,[o]:!0}),S=()=>{_.removeEventListener("abort",R)}),{__proto__:null,[s](){var v;(v=S)===null||v===void 0||v()}}},AbortSignalAny:c.any||function(_){if(_.length===1)return _[0];const R=new d,S=()=>R.abort();return _.forEach(v=>{I(v,"signals"),v.addEventListener("abort",S,{once:!0})}),R.signal.addEventListener("abort",()=>{_.forEach(v=>v.removeEventListener("abort",S))},{once:!0}),R.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(Ja)),Ja.exports}var so={},Za,Zc;function Ji(){if(Zc)return Za;Zc=1;const{ArrayIsArray:e,ArrayPrototypeIncludes:t,ArrayPrototypeJoin:r,ArrayPrototypeMap:n,NumberIsInteger:i,NumberIsNaN:o,NumberMAX_SAFE_INTEGER:a,NumberMIN_SAFE_INTEGER:s,NumberParseInt:c,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:p,String:g,StringPrototypeToUpperCase:A,StringPrototypeTrim:I}=qe(),{hideStackFrames:M,codes:{ERR_SOCKET_BAD_PORT:E,ERR_INVALID_ARG_TYPE:_,ERR_INVALID_ARG_VALUE:R,ERR_OUT_OF_RANGE:S,ERR_UNKNOWN_SIGNAL:v}}=ht(),{normalizeEncoding:V}=wt(),{isAsyncFunction:X,isArrayBufferView:re}=wt().types,ie={};function G(m){return m===(m|0)}function fe(m){return m===m>>>0}const T=/^[0-7]+$/,k="must be a 32-bit unsigned integer or an octal string";function H(m,U,J){if(typeof m>"u"&&(m=J),typeof m=="string"){if(p(T,m)===null)throw new R(U,m,k);m=c(m,8)}return oe(m,U),m}const x=M((m,U,J=s,K=a)=>{if(typeof m!="number")throw new _(U,"number",m);if(!i(m))throw new S(U,"an integer",m);if(m<J||m>K)throw new S(U,`>= ${J} && <= ${K}`,m)}),$=M((m,U,J=-2147483648,K=2147483647)=>{if(typeof m!="number")throw new _(U,"number",m);if(!i(m))throw new S(U,"an integer",m);if(m<J||m>K)throw new S(U,`>= ${J} && <= ${K}`,m)}),oe=M((m,U,J=!1)=>{if(typeof m!="number")throw new _(U,"number",m);if(!i(m))throw new S(U,"an integer",m);const K=J?1:0,de=4294967295;if(m<K||m>de)throw new S(U,`>= ${K} && <= ${de}`,m)});function ae(m,U){if(typeof m!="string")throw new _(U,"string",m)}function he(m,U,J=void 0,K){if(typeof m!="number")throw new _(U,"number",m);if(J!=null&&m<J||K!=null&&m>K||(J!=null||K!=null)&&o(m))throw new S(U,`${J!=null?`>= ${J}`:""}${J!=null&&K!=null?" && ":""}${K!=null?`<= ${K}`:""}`,m)}const B=M((m,U,J)=>{if(!t(J,m)){const de="must be one of: "+r(n(J,me=>typeof me=="string"?`'${me}'`:g(me)),", ");throw new R(U,m,de)}});function le(m,U){if(typeof m!="boolean")throw new _(U,"boolean",m)}function b(m,U,J){return m==null||!d(m,U)?J:m[U]}const z=M((m,U,J=null)=>{const K=b(J,"allowArray",!1),de=b(J,"allowFunction",!1);if(!b(J,"nullable",!1)&&m===null||!K&&e(m)||typeof m!="object"&&(!de||typeof m!="function"))throw new _(U,"Object",m)}),ne=M((m,U)=>{if(m!=null&&typeof m!="object"&&typeof m!="function")throw new _(U,"a dictionary",m)}),L=M((m,U,J=0)=>{if(!e(m))throw new _(U,"Array",m);if(m.length<J){const K=`must be longer than ${J}`;throw new R(U,m,K)}});function se(m,U){L(m,U);for(let J=0;J<m.length;J++)ae(m[J],`${U}[${J}]`)}function ce(m,U){L(m,U);for(let J=0;J<m.length;J++)le(m[J],`${U}[${J}]`)}function Y(m,U){L(m,U);for(let J=0;J<m.length;J++){const K=m[J],de=`${U}[${J}]`;if(K==null)throw new _(de,"AbortSignal",K);ue(K,de)}}function te(m,U="signal"){if(ae(m,U),ie[m]===void 0)throw ie[A(m)]!==void 0?new v(m+" (signals must use all capital letters)"):new v(m)}const C=M((m,U="buffer")=>{if(!re(m))throw new _(U,["Buffer","TypedArray","DataView"],m)});function O(m,U){const J=V(U),K=m.length;if(J==="hex"&&K%2!==0)throw new R("encoding",U,`is invalid for data of length ${K}`)}function Z(m,U="Port",J=!0){if(typeof m!="number"&&typeof m!="string"||typeof m=="string"&&I(m).length===0||+m!==+m>>>0||m>65535||m===0&&!J)throw new E(U,m,J);return m|0}const ue=M((m,U)=>{if(m!==void 0&&(m===null||typeof m!="object"||!("aborted"in m)))throw new _(U,"AbortSignal",m)}),j=M((m,U)=>{if(typeof m!="function")throw new _(U,"Function",m)}),l=M((m,U)=>{if(typeof m!="function"||X(m))throw new _(U,"Function",m)}),f=M((m,U)=>{if(m!==void 0)throw new _(U,"undefined",m)});function w(m,U,J){if(!t(J,m))throw new _(U,`('${r(J,"|")}')`,m)}const P=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function N(m,U){if(typeof m>"u"||!p(P,m))throw new R(U,m,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function q(m){if(typeof m=="string")return N(m,"hints"),m;if(e(m)){const U=m.length;let J="";if(U===0)return J;for(let K=0;K<U;K++){const de=m[K];N(de,"hints"),J+=de,K!==U-1&&(J+=", ")}return J}throw new R("hints",m,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return Za={isInt32:G,isUint32:fe,parseFileMode:H,validateArray:L,validateStringArray:se,validateBooleanArray:ce,validateAbortSignalArray:Y,validateBoolean:le,validateBuffer:C,validateDictionary:ne,validateEncoding:O,validateFunction:j,validateInt32:$,validateInteger:x,validateNumber:he,validateObject:z,validateOneOf:B,validatePlainFunction:l,validatePort:Z,validateSignalName:te,validateString:ae,validateUint32:oe,validateUndefined:f,validateUnion:w,validateAbortSignal:ue,validateLinkHeaderValue:q},Za}var lo={exports:{}},$a,$c;function sr(){if($c)return $a;$c=1;const{SymbolAsyncIterator:e,SymbolIterator:t,SymbolFor:r}=qe(),n=r("nodejs.stream.destroyed"),i=r("nodejs.stream.errored"),o=r("nodejs.stream.readable"),a=r("nodejs.stream.writable"),s=r("nodejs.stream.disturbed"),c=r("nodejs.webstream.isClosedPromise"),d=r("nodejs.webstream.controllerErrorFunction");function p(b,z=!1){var ne;return!!(b&&typeof b.pipe=="function"&&typeof b.on=="function"&&(!z||typeof b.pause=="function"&&typeof b.resume=="function")&&(!b._writableState||((ne=b._readableState)===null||ne===void 0?void 0:ne.readable)!==!1)&&(!b._writableState||b._readableState))}function g(b){var z;return!!(b&&typeof b.write=="function"&&typeof b.on=="function"&&(!b._readableState||((z=b._writableState)===null||z===void 0?void 0:z.writable)!==!1))}function A(b){return!!(b&&typeof b.pipe=="function"&&b._readableState&&typeof b.on=="function"&&typeof b.write=="function")}function I(b){return b&&(b._readableState||b._writableState||typeof b.write=="function"&&typeof b.on=="function"||typeof b.pipe=="function"&&typeof b.on=="function")}function M(b){return!!(b&&!I(b)&&typeof b.pipeThrough=="function"&&typeof b.getReader=="function"&&typeof b.cancel=="function")}function E(b){return!!(b&&!I(b)&&typeof b.getWriter=="function"&&typeof b.abort=="function")}function _(b){return!!(b&&!I(b)&&typeof b.readable=="object"&&typeof b.writable=="object")}function R(b){return M(b)||E(b)||_(b)}function S(b,z){return b==null?!1:z===!0?typeof b[e]=="function":z===!1?typeof b[t]=="function":typeof b[e]=="function"||typeof b[t]=="function"}function v(b){if(!I(b))return null;const z=b._writableState,ne=b._readableState,L=z||ne;return!!(b.destroyed||b[n]||L!=null&&L.destroyed)}function V(b){if(!g(b))return null;if(b.writableEnded===!0)return!0;const z=b._writableState;return z!=null&&z.errored?!1:typeof z?.ended!="boolean"?null:z.ended}function X(b,z){if(!g(b))return null;if(b.writableFinished===!0)return!0;const ne=b._writableState;return ne!=null&&ne.errored?!1:typeof ne?.finished!="boolean"?null:!!(ne.finished||z===!1&&ne.ended===!0&&ne.length===0)}function re(b){if(!p(b))return null;if(b.readableEnded===!0)return!0;const z=b._readableState;return!z||z.errored?!1:typeof z?.ended!="boolean"?null:z.ended}function ie(b,z){if(!p(b))return null;const ne=b._readableState;return ne!=null&&ne.errored?!1:typeof ne?.endEmitted!="boolean"?null:!!(ne.endEmitted||z===!1&&ne.ended===!0&&ne.length===0)}function G(b){return b&&b[o]!=null?b[o]:typeof b?.readable!="boolean"?null:v(b)?!1:p(b)&&b.readable&&!ie(b)}function fe(b){return b&&b[a]!=null?b[a]:typeof b?.writable!="boolean"?null:v(b)?!1:g(b)&&b.writable&&!V(b)}function T(b,z){return I(b)?v(b)?!0:!(z?.readable!==!1&&G(b)||z?.writable!==!1&&fe(b)):null}function k(b){var z,ne;return I(b)?b.writableErrored?b.writableErrored:(z=(ne=b._writableState)===null||ne===void 0?void 0:ne.errored)!==null&&z!==void 0?z:null:null}function H(b){var z,ne;return I(b)?b.readableErrored?b.readableErrored:(z=(ne=b._readableState)===null||ne===void 0?void 0:ne.errored)!==null&&z!==void 0?z:null:null}function x(b){if(!I(b))return null;if(typeof b.closed=="boolean")return b.closed;const z=b._writableState,ne=b._readableState;return typeof z?.closed=="boolean"||typeof ne?.closed=="boolean"?z?.closed||ne?.closed:typeof b._closed=="boolean"&&$(b)?b._closed:null}function $(b){return typeof b._closed=="boolean"&&typeof b._defaultKeepAlive=="boolean"&&typeof b._removedConnection=="boolean"&&typeof b._removedContLen=="boolean"}function oe(b){return typeof b._sent100=="boolean"&&$(b)}function ae(b){var z;return typeof b._consuming=="boolean"&&typeof b._dumped=="boolean"&&((z=b.req)===null||z===void 0?void 0:z.upgradeOrConnect)===void 0}function he(b){if(!I(b))return null;const z=b._writableState,ne=b._readableState,L=z||ne;return!L&&oe(b)||!!(L&&L.autoDestroy&&L.emitClose&&L.closed===!1)}function B(b){var z;return!!(b&&((z=b[s])!==null&&z!==void 0?z:b.readableDidRead||b.readableAborted))}function le(b){var z,ne,L,se,ce,Y,te,C,O,Z;return!!(b&&((z=(ne=(L=(se=(ce=(Y=b[i])!==null&&Y!==void 0?Y:b.readableErrored)!==null&&ce!==void 0?ce:b.writableErrored)!==null&&se!==void 0?se:(te=b._readableState)===null||te===void 0?void 0:te.errorEmitted)!==null&&L!==void 0?L:(C=b._writableState)===null||C===void 0?void 0:C.errorEmitted)!==null&&ne!==void 0?ne:(O=b._readableState)===null||O===void 0?void 0:O.errored)!==null&&z!==void 0?z:!((Z=b._writableState)===null||Z===void 0)&&Z.errored))}return $a={isDestroyed:v,kIsDestroyed:n,isDisturbed:B,kIsDisturbed:s,isErrored:le,kIsErrored:i,isReadable:G,kIsReadable:o,kIsClosedPromise:c,kControllerErrorFunction:d,kIsWritable:a,isClosed:x,isDuplexNodeStream:A,isFinished:T,isIterable:S,isReadableNodeStream:p,isReadableStream:M,isReadableEnded:re,isReadableFinished:ie,isReadableErrored:H,isNodeStream:I,isWebStream:R,isWritable:fe,isWritableNodeStream:g,isWritableStream:E,isWritableEnded:V,isWritableFinished:X,isWritableErrored:k,isServerRequest:ae,isServerResponse:oe,willEmitClose:he,isTransformStream:_},$a}var ed;function Er(){if(ed)return lo.exports;ed=1;const e=St(),{AbortError:t,codes:r}=ht(),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_PREMATURE_CLOSE:i}=r,{kEmptyObject:o,once:a}=wt(),{validateAbortSignal:s,validateFunction:c,validateObject:d,validateBoolean:p}=Ji(),{Promise:g,PromisePrototypeThen:A,SymbolDispose:I}=qe(),{isClosed:M,isReadable:E,isReadableNodeStream:_,isReadableStream:R,isReadableFinished:S,isReadableErrored:v,isWritable:V,isWritableNodeStream:X,isWritableStream:re,isWritableFinished:ie,isWritableErrored:G,isNodeStream:fe,willEmitClose:T,kIsClosedPromise:k}=sr();let H;function x(B){return B.setHeader&&typeof B.abort=="function"}const $=()=>{};function oe(B,le,b){var z,ne;if(arguments.length===2?(b=le,le=o):le==null?le=o:d(le,"options"),c(b,"callback"),s(le.signal,"options.signal"),b=a(b),R(B)||re(B))return ae(B,le,b);if(!fe(B))throw new n("stream",["ReadableStream","WritableStream","Stream"],B);const L=(z=le.readable)!==null&&z!==void 0?z:_(B),se=(ne=le.writable)!==null&&ne!==void 0?ne:X(B),ce=B._writableState,Y=B._readableState,te=()=>{B.writable||Z()};let C=T(B)&&_(B)===L&&X(B)===se,O=ie(B,!1);const Z=()=>{O=!0,B.destroyed&&(C=!1),!(C&&(!B.readable||L))&&(!L||ue)&&b.call(B)};let ue=S(B,!1);const j=()=>{ue=!0,B.destroyed&&(C=!1),!(C&&(!B.writable||se))&&(!se||O)&&b.call(B)},l=m=>{b.call(B,m)};let f=M(B);const w=()=>{f=!0;const m=G(B)||v(B);if(m&&typeof m!="boolean")return b.call(B,m);if(L&&!ue&&_(B,!0)&&!S(B,!1))return b.call(B,new i);if(se&&!O&&!ie(B,!1))return b.call(B,new i);b.call(B)},P=()=>{f=!0;const m=G(B)||v(B);if(m&&typeof m!="boolean")return b.call(B,m);b.call(B)},N=()=>{B.req.on("finish",Z)};x(B)?(B.on("complete",Z),C||B.on("abort",w),B.req?N():B.on("request",N)):se&&!ce&&(B.on("end",te),B.on("close",te)),!C&&typeof B.aborted=="boolean"&&B.on("aborted",w),B.on("end",j),B.on("finish",Z),le.error!==!1&&B.on("error",l),B.on("close",w),f?e.nextTick(w):ce!=null&&ce.errorEmitted||Y!=null&&Y.errorEmitted?C||e.nextTick(P):(!L&&(!C||E(B))&&(O||V(B)===!1)||!se&&(!C||V(B))&&(ue||E(B)===!1)||Y&&B.req&&B.aborted)&&e.nextTick(P);const q=()=>{b=$,B.removeListener("aborted",w),B.removeListener("complete",Z),B.removeListener("abort",w),B.removeListener("request",N),B.req&&B.req.removeListener("finish",Z),B.removeListener("end",te),B.removeListener("close",te),B.removeListener("finish",Z),B.removeListener("end",j),B.removeListener("error",l),B.removeListener("close",w)};if(le.signal&&!f){const m=()=>{const U=b;q(),U.call(B,new t(void 0,{cause:le.signal.reason}))};if(le.signal.aborted)e.nextTick(m);else{H=H||wt().addAbortListener;const U=H(le.signal,m),J=b;b=a((...K)=>{U[I](),J.apply(B,K)})}}return q}function ae(B,le,b){let z=!1,ne=$;if(le.signal)if(ne=()=>{z=!0,b.call(B,new t(void 0,{cause:le.signal.reason}))},le.signal.aborted)e.nextTick(ne);else{H=H||wt().addAbortListener;const se=H(le.signal,ne),ce=b;b=a((...Y)=>{se[I](),ce.apply(B,Y)})}const L=(...se)=>{z||e.nextTick(()=>b.apply(B,se))};return A(B[k].promise,L,L),$}function he(B,le){var b;let z=!1;return le===null&&(le=o),(b=le)!==null&&b!==void 0&&b.cleanup&&(p(le.cleanup,"cleanup"),z=le.cleanup),new g((ne,L)=>{const se=oe(B,le,ce=>{z&&se(),ce?L(ce):ne()})})}return lo.exports=oe,lo.exports.finished=he,lo.exports}var es,td;function Cn(){if(td)return es;td=1;const e=St(),{aggregateTwoErrors:t,codes:{ERR_MULTIPLE_CALLBACK:r},AbortError:n}=ht(),{Symbol:i}=qe(),{kIsDestroyed:o,isDestroyed:a,isFinished:s,isServerRequest:c}=sr(),d=i("kDestroy"),p=i("kConstruct");function g(T,k,H){T&&(T.stack,k&&!k.errored&&(k.errored=T),H&&!H.errored&&(H.errored=T))}function A(T,k){const H=this._readableState,x=this._writableState,$=x||H;return x!=null&&x.destroyed||H!=null&&H.destroyed?(typeof k=="function"&&k(),this):(g(T,x,H),x&&(x.destroyed=!0),H&&(H.destroyed=!0),$.constructed?I(this,T,k):this.once(d,function(oe){I(this,t(oe,T),k)}),this)}function I(T,k,H){let x=!1;function $(oe){if(x)return;x=!0;const ae=T._readableState,he=T._writableState;g(oe,he,ae),he&&(he.closed=!0),ae&&(ae.closed=!0),typeof H=="function"&&H(oe),oe?e.nextTick(M,T,oe):e.nextTick(E,T)}try{T._destroy(k||null,$)}catch(oe){$(oe)}}function M(T,k){_(T,k),E(T)}function E(T){const k=T._readableState,H=T._writableState;H&&(H.closeEmitted=!0),k&&(k.closeEmitted=!0),(H!=null&&H.emitClose||k!=null&&k.emitClose)&&T.emit("close")}function _(T,k){const H=T._readableState,x=T._writableState;x!=null&&x.errorEmitted||H!=null&&H.errorEmitted||(x&&(x.errorEmitted=!0),H&&(H.errorEmitted=!0),T.emit("error",k))}function R(){const T=this._readableState,k=this._writableState;T&&(T.constructed=!0,T.closed=!1,T.closeEmitted=!1,T.destroyed=!1,T.errored=null,T.errorEmitted=!1,T.reading=!1,T.ended=T.readable===!1,T.endEmitted=T.readable===!1),k&&(k.constructed=!0,k.destroyed=!1,k.closed=!1,k.closeEmitted=!1,k.errored=null,k.errorEmitted=!1,k.finalCalled=!1,k.prefinished=!1,k.ended=k.writable===!1,k.ending=k.writable===!1,k.finished=k.writable===!1)}function S(T,k,H){const x=T._readableState,$=T._writableState;if($!=null&&$.destroyed||x!=null&&x.destroyed)return this;x!=null&&x.autoDestroy||$!=null&&$.autoDestroy?T.destroy(k):k&&(k.stack,$&&!$.errored&&($.errored=k),x&&!x.errored&&(x.errored=k),H?e.nextTick(_,T,k):_(T,k))}function v(T,k){if(typeof T._construct!="function")return;const H=T._readableState,x=T._writableState;H&&(H.constructed=!1),x&&(x.constructed=!1),T.once(p,k),!(T.listenerCount(p)>1)&&e.nextTick(V,T)}function V(T){let k=!1;function H(x){if(k){S(T,x??new r);return}k=!0;const $=T._readableState,oe=T._writableState,ae=oe||$;$&&($.constructed=!0),oe&&(oe.constructed=!0),ae.destroyed?T.emit(d,x):x?S(T,x,!0):e.nextTick(X,T)}try{T._construct(x=>{e.nextTick(H,x)})}catch(x){e.nextTick(H,x)}}function X(T){T.emit(p)}function re(T){return T?.setHeader&&typeof T.abort=="function"}function ie(T){T.emit("close")}function G(T,k){T.emit("error",k),e.nextTick(ie,T)}function fe(T,k){!T||a(T)||(!k&&!s(T)&&(k=new n),c(T)?(T.socket=null,T.destroy(k)):re(T)?T.abort():re(T.req)?T.req.abort():typeof T.destroy=="function"?T.destroy(k):typeof T.close=="function"?T.close():k?e.nextTick(G,T,k):e.nextTick(ie,T),T.destroyed||(T[o]=!0))}return es={construct:v,destroyer:fe,destroy:A,undestroy:R,errorOrDestroy:S},es}var ts,rd;function Yl(){if(rd)return ts;rd=1;const{ArrayIsArray:e,ObjectSetPrototypeOf:t}=qe(),{EventEmitter:r}=or();function n(o){r.call(this,o)}t(n.prototype,r.prototype),t(n,r),n.prototype.pipe=function(o,a){const s=this;function c(E){o.writable&&o.write(E)===!1&&s.pause&&s.pause()}s.on("data",c);function d(){s.readable&&s.resume&&s.resume()}o.on("drain",d),!o._isStdio&&(!a||a.end!==!1)&&(s.on("end",g),s.on("close",A));let p=!1;function g(){p||(p=!0,o.end())}function A(){p||(p=!0,typeof o.destroy=="function"&&o.destroy())}function I(E){M(),r.listenerCount(this,"error")===0&&this.emit("error",E)}i(s,"error",I),i(o,"error",I);function M(){s.removeListener("data",c),o.removeListener("drain",d),s.removeListener("end",g),s.removeListener("close",A),s.removeListener("error",I),o.removeListener("error",I),s.removeListener("end",M),s.removeListener("close",M),o.removeListener("close",M)}return s.on("end",M),s.on("close",M),o.on("close",M),o.emit("pipe",s),o};function i(o,a,s){if(typeof o.prependListener=="function")return o.prependListener(a,s);!o._events||!o._events[a]?o.on(a,s):e(o._events[a])?o._events[a].unshift(s):o._events[a]=[s,o._events[a]]}return ts={Stream:n,prependListener:i},ts}var rs={exports:{}},nd;function ea(){return nd||(nd=1,(function(e){const{SymbolDispose:t}=qe(),{AbortError:r,codes:n}=ht(),{isNodeStream:i,isWebStream:o,kControllerErrorFunction:a}=sr(),s=Er(),{ERR_INVALID_ARG_TYPE:c}=n;let d;const p=(g,A)=>{if(typeof g!="object"||!("aborted"in g))throw new c(A,"AbortSignal",g)};e.exports.addAbortSignal=function(A,I){if(p(A,"signal"),!i(I)&&!o(I))throw new c("stream",["ReadableStream","WritableStream","Stream"],I);return e.exports.addAbortSignalNoValidate(A,I)},e.exports.addAbortSignalNoValidate=function(g,A){if(typeof g!="object"||!("aborted"in g))return A;const I=i(A)?()=>{A.destroy(new r(void 0,{cause:g.reason}))}:()=>{A[a](new r(void 0,{cause:g.reason}))};if(g.aborted)I();else{d=d||wt().addAbortListener;const M=d(g,I);s(A,M[t])}return A}})(rs)),rs.exports}var ns,id;function e_(){if(id)return ns;id=1;const{StringPrototypeSlice:e,SymbolIterator:t,TypedArrayPrototypeSet:r,Uint8Array:n}=qe(),{Buffer:i}=vt(),{inspect:o}=wt();return ns=class{constructor(){this.head=null,this.tail=null,this.length=0}push(s){const c={data:s,next:null};this.length>0?this.tail.next=c:this.head=c,this.tail=c,++this.length}unshift(s){const c={data:s,next:this.head};this.length===0&&(this.tail=c),this.head=c,++this.length}shift(){if(this.length===0)return;const s=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,s}clear(){this.head=this.tail=null,this.length=0}join(s){if(this.length===0)return"";let c=this.head,d=""+c.data;for(;(c=c.next)!==null;)d+=s+c.data;return d}concat(s){if(this.length===0)return i.alloc(0);const c=i.allocUnsafe(s>>>0);let d=this.head,p=0;for(;d;)r(c,d.data,p),p+=d.data.length,d=d.next;return c}consume(s,c){const d=this.head.data;if(s<d.length){const p=d.slice(0,s);return this.head.data=d.slice(s),p}return s===d.length?this.shift():c?this._getString(s):this._getBuffer(s)}first(){return this.head.data}*[t](){for(let s=this.head;s;s=s.next)yield s.data}_getString(s){let c="",d=this.head,p=0;do{const g=d.data;if(s>g.length)c+=g,s-=g.length;else{s===g.length?(c+=g,++p,d.next?this.head=d.next:this.head=this.tail=null):(c+=e(g,0,s),this.head=d,d.data=e(g,s));break}++p}while((d=d.next)!==null);return this.length-=p,c}_getBuffer(s){const c=i.allocUnsafe(s),d=s;let p=this.head,g=0;do{const A=p.data;if(s>A.length)r(c,A,d-s),s-=A.length;else{s===A.length?(r(c,A,d-s),++g,p.next?this.head=p.next:this.head=this.tail=null):(r(c,new n(A.buffer,A.byteOffset,s),d-s),this.head=p,p.data=A.slice(s));break}++g}while((p=p.next)!==null);return this.length-=g,c}[Symbol.for("nodejs.util.inspect.custom")](s,c){return o(this,{...c,depth:0,customInspect:!1})}},ns}var is,od;function ta(){if(od)return is;od=1;const{MathFloor:e,NumberIsInteger:t}=qe(),{validateInteger:r}=Ji(),{ERR_INVALID_ARG_VALUE:n}=ht().codes;let i=16*1024,o=16;function a(p,g,A){return p.highWaterMark!=null?p.highWaterMark:g?p[A]:null}function s(p){return p?o:i}function c(p,g){r(g,"value",0),p?o=g:i=g}function d(p,g,A,I){const M=a(g,I,A);if(M!=null){if(!t(M)||M<0){const E=I?`options.${A}`:"options.highWaterMark";throw new n(E,M)}return e(M)}return s(p.objectMode)}return is={getHighWaterMark:d,getDefaultHighWaterMark:s,setDefaultHighWaterMark:c},is}var os,ad;function yp(){if(ad)return os;ad=1;const e=St(),{PromisePrototypeThen:t,SymbolAsyncIterator:r,SymbolIterator:n}=qe(),{Buffer:i}=vt(),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_NULL_VALUES:a}=ht().codes;function s(c,d,p){let g;if(typeof d=="string"||d instanceof i)return new c({objectMode:!0,...p,read(){this.push(d),this.push(null)}});let A;if(d&&d[r])A=!0,g=d[r]();else if(d&&d[n])A=!1,g=d[n]();else throw new o("iterable",["Iterable"],d);const I=new c({objectMode:!0,highWaterMark:1,...p});let M=!1;I._read=function(){M||(M=!0,_())},I._destroy=function(R,S){t(E(R),()=>e.nextTick(S,R),v=>e.nextTick(S,v||R))};async function E(R){const S=R!=null,v=typeof g.throw=="function";if(S&&v){const{value:V,done:X}=await g.throw(R);if(await V,X)return}if(typeof g.return=="function"){const{value:V}=await g.return();await V}}async function _(){for(;;){try{const{value:R,done:S}=A?await g.next():g.next();if(S)I.push(null);else{const v=R&&typeof R.then=="function"?await R:R;if(v===null)throw M=!1,new a;if(I.push(v))continue;M=!1}}catch(R){I.destroy(R)}break}}return I}return os=s,os}var as,sd;function ra(){if(sd)return as;sd=1;const e=St(),{ArrayPrototypeIndexOf:t,NumberIsInteger:r,NumberIsNaN:n,NumberParseInt:i,ObjectDefineProperties:o,ObjectKeys:a,ObjectSetPrototypeOf:s,Promise:c,SafeSet:d,SymbolAsyncDispose:p,SymbolAsyncIterator:g,Symbol:A}=qe();as=K,K.ReadableState=J;const{EventEmitter:I}=or(),{Stream:M,prependListener:E}=Yl(),{Buffer:_}=vt(),{addAbortSignal:R}=ea(),S=Er();let v=wt().debuglog("stream",u=>{v=u});const V=e_(),X=Cn(),{getHighWaterMark:re,getDefaultHighWaterMark:ie}=ta(),{aggregateTwoErrors:G,codes:{ERR_INVALID_ARG_TYPE:fe,ERR_METHOD_NOT_IMPLEMENTED:T,ERR_OUT_OF_RANGE:k,ERR_STREAM_PUSH_AFTER_EOF:H,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:x},AbortError:$}=ht(),{validateObject:oe}=Ji(),ae=A("kPaused"),{StringDecoder:he}=Wd(),B=yp();s(K.prototype,M.prototype),s(K,M);const le=()=>{},{errorOrDestroy:b}=X,z=1,ne=2,L=4,se=8,ce=16,Y=32,te=64,C=128,O=256,Z=512,ue=1024,j=2048,l=4096,f=8192,w=16384,P=32768,N=65536,q=1<<17,m=1<<18;function U(u){return{enumerable:!1,get(){return(this.state&u)!==0},set(h){h?this.state|=u:this.state&=~u}}}o(J.prototype,{objectMode:U(z),ended:U(ne),endEmitted:U(L),reading:U(se),constructed:U(ce),sync:U(Y),needReadable:U(te),emittedReadable:U(C),readableListening:U(O),resumeScheduled:U(Z),errorEmitted:U(ue),emitClose:U(j),autoDestroy:U(l),destroyed:U(f),closed:U(w),closeEmitted:U(P),multiAwaitDrain:U(N),readingMore:U(q),dataEmitted:U(m)});function J(u,h,W){typeof W!="boolean"&&(W=h instanceof ir()),this.state=j|l|ce|Y,u&&u.objectMode&&(this.state|=z),W&&u&&u.readableObjectMode&&(this.state|=z),this.highWaterMark=u?re(this,u,"readableHighWaterMark",W):ie(!1),this.buffer=new V,this.length=0,this.pipes=[],this.flowing=null,this[ae]=null,u&&u.emitClose===!1&&(this.state&=~j),u&&u.autoDestroy===!1&&(this.state&=~l),this.errored=null,this.defaultEncoding=u&&u.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,u&&u.encoding&&(this.decoder=new he(u.encoding),this.encoding=u.encoding)}function K(u){if(!(this instanceof K))return new K(u);const h=this instanceof ir();this._readableState=new J(u,this,h),u&&(typeof u.read=="function"&&(this._read=u.read),typeof u.destroy=="function"&&(this._destroy=u.destroy),typeof u.construct=="function"&&(this._construct=u.construct),u.signal&&!h&&R(u.signal,this)),M.call(this,u),X.construct(this,()=>{this._readableState.needReadable&&Me(this,this._readableState)})}K.prototype.destroy=X.destroy,K.prototype._undestroy=X.undestroy,K.prototype._destroy=function(u,h){h(u)},K.prototype[I.captureRejectionSymbol]=function(u){this.destroy(u)},K.prototype[p]=function(){let u;return this.destroyed||(u=this.readableEnded?null:new $,this.destroy(u)),new c((h,W)=>S(this,F=>F&&F!==u?W(F):h(null)))},K.prototype.push=function(u,h){return de(this,u,h,!1)},K.prototype.unshift=function(u,h){return de(this,u,h,!0)};function de(u,h,W,F){v("readableAddChunk",h);const ee=u._readableState;let ge;if((ee.state&z)===0&&(typeof h=="string"?(W=W||ee.defaultEncoding,ee.encoding!==W&&(F&&ee.encoding?h=_.from(h,W).toString(ee.encoding):(h=_.from(h,W),W=""))):h instanceof _?W="":M._isUint8Array(h)?(h=M._uint8ArrayToBuffer(h),W=""):h!=null&&(ge=new fe("chunk",["string","Buffer","Uint8Array"],h))),ge)b(u,ge);else if(h===null)ee.state&=~se,Ce(u,ee);else if((ee.state&z)!==0||h&&h.length>0)if(F)if((ee.state&L)!==0)b(u,new x);else{if(ee.destroyed||ee.errored)return!1;me(u,ee,h,!0)}else if(ee.ended)b(u,new H);else{if(ee.destroyed||ee.errored)return!1;ee.state&=~se,ee.decoder&&!W?(h=ee.decoder.write(h),ee.objectMode||h.length!==0?me(u,ee,h,!1):Me(u,ee)):me(u,ee,h,!1)}else F||(ee.state&=~se,Me(u,ee));return!ee.ended&&(ee.length<ee.highWaterMark||ee.length===0)}function me(u,h,W,F){h.flowing&&h.length===0&&!h.sync&&u.listenerCount("data")>0?((h.state&N)!==0?h.awaitDrainWriters.clear():h.awaitDrainWriters=null,h.dataEmitted=!0,u.emit("data",W)):(h.length+=h.objectMode?1:W.length,F?h.buffer.unshift(W):h.buffer.push(W),(h.state&te)!==0&&Pe(u)),Me(u,h)}K.prototype.isPaused=function(){const u=this._readableState;return u[ae]===!0||u.flowing===!1},K.prototype.setEncoding=function(u){const h=new he(u);this._readableState.decoder=h,this._readableState.encoding=this._readableState.decoder.encoding;const W=this._readableState.buffer;let F="";for(const ee of W)F+=h.write(ee);return W.clear(),F!==""&&W.push(F),this._readableState.length=F.length,this};const pe=1073741824;function ve(u){if(u>pe)throw new k("size","<= 1GiB",u);return u--,u|=u>>>1,u|=u>>>2,u|=u>>>4,u|=u>>>8,u|=u>>>16,u++,u}function _e(u,h){return u<=0||h.length===0&&h.ended?0:(h.state&z)!==0?1:n(u)?h.flowing&&h.length?h.buffer.first().length:h.length:u<=h.length?u:h.ended?h.length:0}K.prototype.read=function(u){v("read",u),u===void 0?u=NaN:r(u)||(u=i(u,10));const h=this._readableState,W=u;if(u>h.highWaterMark&&(h.highWaterMark=ve(u)),u!==0&&(h.state&=~C),u===0&&h.needReadable&&((h.highWaterMark!==0?h.length>=h.highWaterMark:h.length>0)||h.ended))return v("read: emitReadable",h.length,h.ended),h.length===0&&h.ended?Xt(this):Pe(this),null;if(u=_e(u,h),u===0&&h.ended)return h.length===0&&Xt(this),null;let F=(h.state&te)!==0;if(v("need readable",F),(h.length===0||h.length-u<h.highWaterMark)&&(F=!0,v("length less than watermark",F)),h.ended||h.reading||h.destroyed||h.errored||!h.constructed)F=!1,v("reading, ended or constructing",F);else if(F){v("do read"),h.state|=se|Y,h.length===0&&(h.state|=te);try{this._read(h.highWaterMark)}catch(ge){b(this,ge)}h.state&=~Y,h.reading||(u=_e(W,h))}let ee;return u>0?ee=Cr(u,h):ee=null,ee===null?(h.needReadable=h.length<=h.highWaterMark,u=0):(h.length-=u,h.multiAwaitDrain?h.awaitDrainWriters.clear():h.awaitDrainWriters=null),h.length===0&&(h.ended||(h.needReadable=!0),W!==u&&h.ended&&Xt(this)),ee!==null&&!h.errorEmitted&&!h.closeEmitted&&(h.dataEmitted=!0,this.emit("data",ee)),ee};function Ce(u,h){if(v("onEofChunk"),!h.ended){if(h.decoder){const W=h.decoder.end();W&&W.length&&(h.buffer.push(W),h.length+=h.objectMode?1:W.length)}h.ended=!0,h.sync?Pe(u):(h.needReadable=!1,h.emittedReadable=!0,Nt(u))}}function Pe(u){const h=u._readableState;v("emitReadable",h.needReadable,h.emittedReadable),h.needReadable=!1,h.emittedReadable||(v("emitReadable",h.flowing),h.emittedReadable=!0,e.nextTick(Nt,u))}function Nt(u){const h=u._readableState;v("emitReadable_",h.destroyed,h.length,h.ended),!h.destroyed&&!h.errored&&(h.length||h.ended)&&(u.emit("readable"),h.emittedReadable=!1),h.needReadable=!h.flowing&&!h.ended&&h.length<=h.highWaterMark,Rr(u)}function Me(u,h){!h.readingMore&&h.constructed&&(h.readingMore=!0,e.nextTick(Mn,u,h))}function Mn(u,h){for(;!h.reading&&!h.ended&&(h.length<h.highWaterMark||h.flowing&&h.length===0);){const W=h.length;if(v("maybeReadMore read 0"),u.read(0),W===h.length)break}h.readingMore=!1}K.prototype._read=function(u){throw new T("_read()")},K.prototype.pipe=function(u,h){const W=this,F=this._readableState;F.pipes.length===1&&(F.multiAwaitDrain||(F.multiAwaitDrain=!0,F.awaitDrainWriters=new d(F.awaitDrainWriters?[F.awaitDrainWriters]:[]))),F.pipes.push(u),v("pipe count=%d opts=%j",F.pipes.length,h);const ge=(!h||h.end!==!1)&&u!==e.stdout&&u!==e.stderr?ze:Ft;F.endEmitted?e.nextTick(ge):W.once("end",ge),u.on("unpipe",be);function be(it,He){v("onunpipe"),it===W&&He&&He.hasUnpiped===!1&&(He.hasUnpiped=!0,jn())}function ze(){v("onend"),u.end()}let Re,zt=!1;function jn(){v("cleanup"),u.removeListener("close",Dr),u.removeListener("finish",Pr),Re&&u.removeListener("drain",Re),u.removeListener("error",Mr),u.removeListener("unpipe",be),W.removeListener("end",ze),W.removeListener("end",Ft),W.removeListener("data",Fn),zt=!0,Re&&F.awaitDrainWriters&&(!u._writableState||u._writableState.needDrain)&&Re()}function Nn(){zt||(F.pipes.length===1&&F.pipes[0]===u?(v("false write response, pause",0),F.awaitDrainWriters=u,F.multiAwaitDrain=!1):F.pipes.length>1&&F.pipes.includes(u)&&(v("false write response, pause",F.awaitDrainWriters.size),F.awaitDrainWriters.add(u)),W.pause()),Re||(Re=Dn(W,u),u.on("drain",Re))}W.on("data",Fn);function Fn(it){v("ondata");const He=u.write(it);v("dest.write",He),He===!1&&Nn()}function Mr(it){if(v("onerror",it),Ft(),u.removeListener("error",Mr),u.listenerCount("error")===0){const He=u._writableState||u._readableState;He&&!He.errorEmitted?b(u,it):u.emit("error",it)}}E(u,"error",Mr);function Dr(){u.removeListener("finish",Pr),Ft()}u.once("close",Dr);function Pr(){v("onfinish"),u.removeListener("close",Dr),Ft()}u.once("finish",Pr);function Ft(){v("unpipe"),W.unpipe(u)}return u.emit("pipe",W),u.writableNeedDrain===!0?Nn():F.flowing||(v("pipe resume"),W.resume()),u};function Dn(u,h){return function(){const F=u._readableState;F.awaitDrainWriters===h?(v("pipeOnDrain",1),F.awaitDrainWriters=null):F.multiAwaitDrain&&(v("pipeOnDrain",F.awaitDrainWriters.size),F.awaitDrainWriters.delete(h)),(!F.awaitDrainWriters||F.awaitDrainWriters.size===0)&&u.listenerCount("data")&&u.resume()}}K.prototype.unpipe=function(u){const h=this._readableState,W={hasUnpiped:!1};if(h.pipes.length===0)return this;if(!u){const ee=h.pipes;h.pipes=[],this.pause();for(let ge=0;ge<ee.length;ge++)ee[ge].emit("unpipe",this,{hasUnpiped:!1});return this}const F=t(h.pipes,u);return F===-1?this:(h.pipes.splice(F,1),h.pipes.length===0&&this.pause(),u.emit("unpipe",this,W),this)},K.prototype.on=function(u,h){const W=M.prototype.on.call(this,u,h),F=this._readableState;return u==="data"?(F.readableListening=this.listenerCount("readable")>0,F.flowing!==!1&&this.resume()):u==="readable"&&!F.endEmitted&&!F.readableListening&&(F.readableListening=F.needReadable=!0,F.flowing=!1,F.emittedReadable=!1,v("on readable",F.length,F.reading),F.length?Pe(this):F.reading||e.nextTick(Pn,this)),W},K.prototype.addListener=K.prototype.on,K.prototype.removeListener=function(u,h){const W=M.prototype.removeListener.call(this,u,h);return u==="readable"&&e.nextTick(xr,this),W},K.prototype.off=K.prototype.removeListener,K.prototype.removeAllListeners=function(u){const h=M.prototype.removeAllListeners.apply(this,arguments);return(u==="readable"||u===void 0)&&e.nextTick(xr,this),h};function xr(u){const h=u._readableState;h.readableListening=u.listenerCount("readable")>0,h.resumeScheduled&&h[ae]===!1?h.flowing=!0:u.listenerCount("data")>0?u.resume():h.readableListening||(h.flowing=null)}function Pn(u){v("readable nexttick read 0"),u.read(0)}K.prototype.resume=function(){const u=this._readableState;return u.flowing||(v("resume"),u.flowing=!u.readableListening,Ir(this,u)),u[ae]=!1,this};function Ir(u,h){h.resumeScheduled||(h.resumeScheduled=!0,e.nextTick(kn,u,h))}function kn(u,h){v("resume",h.reading),h.reading||u.read(0),h.resumeScheduled=!1,u.emit("resume"),Rr(u),h.flowing&&!h.reading&&u.read(0)}K.prototype.pause=function(){return v("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(v("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[ae]=!0,this};function Rr(u){const h=u._readableState;for(v("flow",h.flowing);h.flowing&&u.read()!==null;);}K.prototype.wrap=function(u){let h=!1;u.on("data",F=>{!this.push(F)&&u.pause&&(h=!0,u.pause())}),u.on("end",()=>{this.push(null)}),u.on("error",F=>{b(this,F)}),u.on("close",()=>{this.destroy()}),u.on("destroy",()=>{this.destroy()}),this._read=()=>{h&&u.resume&&(h=!1,u.resume())};const W=a(u);for(let F=1;F<W.length;F++){const ee=W[F];this[ee]===void 0&&typeof u[ee]=="function"&&(this[ee]=u[ee].bind(u))}return this},K.prototype[g]=function(){return lr(this)},K.prototype.iterator=function(u){return u!==void 0&&oe(u,"options"),lr(this,u)};function lr(u,h){typeof u.read!="function"&&(u=K.wrap(u,{objectMode:!0}));const W=$r(u,h);return W.stream=u,W}async function*$r(u,h){let W=le;function F(be){this===u?(W(),W=le):W=be}u.on("readable",F);let ee;const ge=S(u,{writable:!1},be=>{ee=be?G(ee,be):null,W(),W=le});try{for(;;){const be=u.destroyed?null:u.read();if(be!==null)yield be;else{if(ee)throw ee;if(ee===null)return;await new c(F)}}}catch(be){throw ee=G(ee,be),ee}finally{(ee||h?.destroyOnReturn!==!1)&&(ee===void 0||u._readableState.autoDestroy)?X.destroyer(u,null):(u.off("readable",F),ge())}}o(K.prototype,{readable:{__proto__:null,get(){const u=this._readableState;return!!u&&u.readable!==!1&&!u.destroyed&&!u.errorEmitted&&!u.endEmitted},set(u){this._readableState&&(this._readableState.readable=!!u)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(u){this._readableState&&(this._readableState.flowing=u)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(u){this._readableState&&(this._readableState.destroyed=u)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),o(J.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[ae]!==!1},set(u){this[ae]=!!u}}}),K._fromList=Cr;function Cr(u,h){if(h.length===0)return null;let W;return h.objectMode?W=h.buffer.shift():!u||u>=h.length?(h.decoder?W=h.buffer.join(""):h.buffer.length===1?W=h.buffer.first():W=h.buffer.concat(h.length),h.buffer.clear()):W=h.buffer.consume(u,h.decoder),W}function Xt(u){const h=u._readableState;v("endReadable",h.endEmitted),h.endEmitted||(h.ended=!0,e.nextTick(Tn,h,u))}function Tn(u,h){if(v("endReadableNT",u.endEmitted,u.length),!u.errored&&!u.closeEmitted&&!u.endEmitted&&u.length===0){if(u.endEmitted=!0,h.emit("end"),h.writable&&h.allowHalfOpen===!1)e.nextTick(On,h);else if(u.autoDestroy){const W=h._writableState;(!W||W.autoDestroy&&(W.finished||W.writable===!1))&&h.destroy()}}}function On(u){u.writable&&!u.writableEnded&&!u.destroyed&&u.end()}K.from=function(u,h){return B(K,u,h)};let Zt;function D(){return Zt===void 0&&(Zt={}),Zt}return K.fromWeb=function(u,h){return D().newStreamReadableFromReadableStream(u,h)},K.toWeb=function(u,h){return D().newReadableStreamFromStreamReadable(u,h)},K.wrap=function(u,h){var W,F;return new K({objectMode:(W=(F=u.readableObjectMode)!==null&&F!==void 0?F:u.objectMode)!==null&&W!==void 0?W:!0,...h,destroy(ee,ge){X.destroyer(u,ee),ge(ee)}}).wrap(u)},as}var ss,ld;function Xl(){if(ld)return ss;ld=1;const e=St(),{ArrayPrototypeSlice:t,Error:r,FunctionPrototypeSymbolHasInstance:n,ObjectDefineProperty:i,ObjectDefineProperties:o,ObjectSetPrototypeOf:a,StringPrototypeToLowerCase:s,Symbol:c,SymbolHasInstance:d}=qe();ss=oe,oe.WritableState=x;const{EventEmitter:p}=or(),g=Yl().Stream,{Buffer:A}=vt(),I=Cn(),{addAbortSignal:M}=ea(),{getHighWaterMark:E,getDefaultHighWaterMark:_}=ta(),{ERR_INVALID_ARG_TYPE:R,ERR_METHOD_NOT_IMPLEMENTED:S,ERR_MULTIPLE_CALLBACK:v,ERR_STREAM_CANNOT_PIPE:V,ERR_STREAM_DESTROYED:X,ERR_STREAM_ALREADY_FINISHED:re,ERR_STREAM_NULL_VALUES:ie,ERR_STREAM_WRITE_AFTER_END:G,ERR_UNKNOWN_ENCODING:fe}=ht().codes,{errorOrDestroy:T}=I;a(oe.prototype,g.prototype),a(oe,g);function k(){}const H=c("kOnFinished");function x(l,f,w){typeof w!="boolean"&&(w=f instanceof ir()),this.objectMode=!!(l&&l.objectMode),w&&(this.objectMode=this.objectMode||!!(l&&l.writableObjectMode)),this.highWaterMark=l?E(this,l,"writableHighWaterMark",w):_(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const P=!!(l&&l.decodeStrings===!1);this.decodeStrings=!P,this.defaultEncoding=l&&l.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=b.bind(void 0,f),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,$(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!l||l.emitClose!==!1,this.autoDestroy=!l||l.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[H]=[]}function $(l){l.buffered=[],l.bufferedIndex=0,l.allBuffers=!0,l.allNoop=!0}x.prototype.getBuffer=function(){return t(this.buffered,this.bufferedIndex)},i(x.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function oe(l){const f=this instanceof ir();if(!f&&!n(oe,this))return new oe(l);this._writableState=new x(l,this,f),l&&(typeof l.write=="function"&&(this._write=l.write),typeof l.writev=="function"&&(this._writev=l.writev),typeof l.destroy=="function"&&(this._destroy=l.destroy),typeof l.final=="function"&&(this._final=l.final),typeof l.construct=="function"&&(this._construct=l.construct),l.signal&&M(l.signal,this)),g.call(this,l),I.construct(this,()=>{const w=this._writableState;w.writing||se(this,w),C(this,w)})}i(oe,d,{__proto__:null,value:function(l){return n(this,l)?!0:this!==oe?!1:l&&l._writableState instanceof x}}),oe.prototype.pipe=function(){T(this,new V)};function ae(l,f,w,P){const N=l._writableState;if(typeof w=="function")P=w,w=N.defaultEncoding;else{if(!w)w=N.defaultEncoding;else if(w!=="buffer"&&!A.isEncoding(w))throw new fe(w);typeof P!="function"&&(P=k)}if(f===null)throw new ie;if(!N.objectMode)if(typeof f=="string")N.decodeStrings!==!1&&(f=A.from(f,w),w="buffer");else if(f instanceof A)w="buffer";else if(g._isUint8Array(f))f=g._uint8ArrayToBuffer(f),w="buffer";else throw new R("chunk",["string","Buffer","Uint8Array"],f);let q;return N.ending?q=new G:N.destroyed&&(q=new X("write")),q?(e.nextTick(P,q),T(l,q,!0),q):(N.pendingcb++,he(l,N,f,w,P))}oe.prototype.write=function(l,f,w){return ae(this,l,f,w)===!0},oe.prototype.cork=function(){this._writableState.corked++},oe.prototype.uncork=function(){const l=this._writableState;l.corked&&(l.corked--,l.writing||se(this,l))},oe.prototype.setDefaultEncoding=function(f){if(typeof f=="string"&&(f=s(f)),!A.isEncoding(f))throw new fe(f);return this._writableState.defaultEncoding=f,this};function he(l,f,w,P,N){const q=f.objectMode?1:w.length;f.length+=q;const m=f.length<f.highWaterMark;return m||(f.needDrain=!0),f.writing||f.corked||f.errored||!f.constructed?(f.buffered.push({chunk:w,encoding:P,callback:N}),f.allBuffers&&P!=="buffer"&&(f.allBuffers=!1),f.allNoop&&N!==k&&(f.allNoop=!1)):(f.writelen=q,f.writecb=N,f.writing=!0,f.sync=!0,l._write(w,P,f.onwrite),f.sync=!1),m&&!f.errored&&!f.destroyed}function B(l,f,w,P,N,q,m){f.writelen=P,f.writecb=m,f.writing=!0,f.sync=!0,f.destroyed?f.onwrite(new X("write")):w?l._writev(N,f.onwrite):l._write(N,q,f.onwrite),f.sync=!1}function le(l,f,w,P){--f.pendingcb,P(w),L(f),T(l,w)}function b(l,f){const w=l._writableState,P=w.sync,N=w.writecb;if(typeof N!="function"){T(l,new v);return}w.writing=!1,w.writecb=null,w.length-=w.writelen,w.writelen=0,f?(f.stack,w.errored||(w.errored=f),l._readableState&&!l._readableState.errored&&(l._readableState.errored=f),P?e.nextTick(le,l,w,f,N):le(l,w,f,N)):(w.buffered.length>w.bufferedIndex&&se(l,w),P?w.afterWriteTickInfo!==null&&w.afterWriteTickInfo.cb===N?w.afterWriteTickInfo.count++:(w.afterWriteTickInfo={count:1,cb:N,stream:l,state:w},e.nextTick(z,w.afterWriteTickInfo)):ne(l,w,1,N))}function z({stream:l,state:f,count:w,cb:P}){return f.afterWriteTickInfo=null,ne(l,f,w,P)}function ne(l,f,w,P){for(!f.ending&&!l.destroyed&&f.length===0&&f.needDrain&&(f.needDrain=!1,l.emit("drain"));w-- >0;)f.pendingcb--,P();f.destroyed&&L(f),C(l,f)}function L(l){if(l.writing)return;for(let N=l.bufferedIndex;N<l.buffered.length;++N){var f;const{chunk:q,callback:m}=l.buffered[N],U=l.objectMode?1:q.length;l.length-=U,m((f=l.errored)!==null&&f!==void 0?f:new X("write"))}const w=l[H].splice(0);for(let N=0;N<w.length;N++){var P;w[N]((P=l.errored)!==null&&P!==void 0?P:new X("end"))}$(l)}function se(l,f){if(f.corked||f.bufferProcessing||f.destroyed||!f.constructed)return;const{buffered:w,bufferedIndex:P,objectMode:N}=f,q=w.length-P;if(!q)return;let m=P;if(f.bufferProcessing=!0,q>1&&l._writev){f.pendingcb-=q-1;const U=f.allNoop?k:K=>{for(let de=m;de<w.length;++de)w[de].callback(K)},J=f.allNoop&&m===0?w:t(w,m);J.allBuffers=f.allBuffers,B(l,f,!0,f.length,J,"",U),$(f)}else{do{const{chunk:U,encoding:J,callback:K}=w[m];w[m++]=null;const de=N?1:U.length;B(l,f,!1,de,U,J,K)}while(m<w.length&&!f.writing);m===w.length?$(f):m>256?(w.splice(0,m),f.bufferedIndex=0):f.bufferedIndex=m}f.bufferProcessing=!1}oe.prototype._write=function(l,f,w){if(this._writev)this._writev([{chunk:l,encoding:f}],w);else throw new S("_write()")},oe.prototype._writev=null,oe.prototype.end=function(l,f,w){const P=this._writableState;typeof l=="function"?(w=l,l=null,f=null):typeof f=="function"&&(w=f,f=null);let N;if(l!=null){const q=ae(this,l,f);q instanceof r&&(N=q)}return P.corked&&(P.corked=1,this.uncork()),N||(!P.errored&&!P.ending?(P.ending=!0,C(this,P,!0),P.ended=!0):P.finished?N=new re("end"):P.destroyed&&(N=new X("end"))),typeof w=="function"&&(N||P.finished?e.nextTick(w,N):P[H].push(w)),this};function ce(l){return l.ending&&!l.destroyed&&l.constructed&&l.length===0&&!l.errored&&l.buffered.length===0&&!l.finished&&!l.writing&&!l.errorEmitted&&!l.closeEmitted}function Y(l,f){let w=!1;function P(N){if(w){T(l,N??v());return}if(w=!0,f.pendingcb--,N){const q=f[H].splice(0);for(let m=0;m<q.length;m++)q[m](N);T(l,N,f.sync)}else ce(f)&&(f.prefinished=!0,l.emit("prefinish"),f.pendingcb++,e.nextTick(O,l,f))}f.sync=!0,f.pendingcb++;try{l._final(P)}catch(N){P(N)}f.sync=!1}function te(l,f){!f.prefinished&&!f.finalCalled&&(typeof l._final=="function"&&!f.destroyed?(f.finalCalled=!0,Y(l,f)):(f.prefinished=!0,l.emit("prefinish")))}function C(l,f,w){ce(f)&&(te(l,f),f.pendingcb===0&&(w?(f.pendingcb++,e.nextTick((P,N)=>{ce(N)?O(P,N):N.pendingcb--},l,f)):ce(f)&&(f.pendingcb++,O(l,f))))}function O(l,f){f.pendingcb--,f.finished=!0;const w=f[H].splice(0);for(let P=0;P<w.length;P++)w[P]();if(l.emit("finish"),f.autoDestroy){const P=l._readableState;(!P||P.autoDestroy&&(P.endEmitted||P.readable===!1))&&l.destroy()}}o(oe.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(l){this._writableState&&(this._writableState.destroyed=l)}},writable:{__proto__:null,get(){const l=this._writableState;return!!l&&l.writable!==!1&&!l.destroyed&&!l.errored&&!l.ending&&!l.ended},set(l){this._writableState&&(this._writableState.writable=!!l)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const l=this._writableState;return l?!l.destroyed&&!l.ending&&l.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const Z=I.destroy;oe.prototype.destroy=function(l,f){const w=this._writableState;return!w.destroyed&&(w.bufferedIndex<w.buffered.length||w[H].length)&&e.nextTick(L,w),Z.call(this,l,f),this},oe.prototype._undestroy=I.undestroy,oe.prototype._destroy=function(l,f){f(l)},oe.prototype[p.captureRejectionSymbol]=function(l){this.destroy(l)};let ue;function j(){return ue===void 0&&(ue={}),ue}return oe.fromWeb=function(l,f){return j().newStreamWritableFromWritableStream(l,f)},oe.toWeb=function(l){return j().newWritableStreamFromStreamWritable(l)},ss}var ls,ud;function t_(){if(ud)return ls;ud=1;const e=St(),t=vt(),{isReadable:r,isWritable:n,isIterable:i,isNodeStream:o,isReadableNodeStream:a,isWritableNodeStream:s,isDuplexNodeStream:c,isReadableStream:d,isWritableStream:p}=sr(),g=Er(),{AbortError:A,codes:{ERR_INVALID_ARG_TYPE:I,ERR_INVALID_RETURN_VALUE:M}}=ht(),{destroyer:E}=Cn(),_=ir(),R=ra(),S=Xl(),{createDeferredPromise:v}=wt(),V=yp(),X=globalThis.Blob||t.Blob,re=typeof X<"u"?function(x){return x instanceof X}:function(x){return!1},ie=globalThis.AbortController||Gt().AbortController,{FunctionPrototypeCall:G}=qe();class fe extends _{constructor(x){super(x),x?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),x?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}ls=function H(x,$){if(c(x))return x;if(a(x))return k({readable:x});if(s(x))return k({writable:x});if(o(x))return k({writable:!1,readable:!1});if(d(x))return k({readable:R.fromWeb(x)});if(p(x))return k({writable:S.fromWeb(x)});if(typeof x=="function"){const{value:ae,write:he,final:B,destroy:le}=T(x);if(i(ae))return V(fe,ae,{objectMode:!0,write:he,final:B,destroy:le});const b=ae?.then;if(typeof b=="function"){let z;const ne=G(b,ae,L=>{if(L!=null)throw new M("nully","body",L)},L=>{E(z,L)});return z=new fe({objectMode:!0,readable:!1,write:he,final(L){B(async()=>{try{await ne,e.nextTick(L,null)}catch(se){e.nextTick(L,se)}})},destroy:le})}throw new M("Iterable, AsyncIterable or AsyncFunction",$,ae)}if(re(x))return H(x.arrayBuffer());if(i(x))return V(fe,x,{objectMode:!0,writable:!1});if(d(x?.readable)&&p(x?.writable))return fe.fromWeb(x);if(typeof x?.writable=="object"||typeof x?.readable=="object"){const ae=x!=null&&x.readable?a(x?.readable)?x?.readable:H(x.readable):void 0,he=x!=null&&x.writable?s(x?.writable)?x?.writable:H(x.writable):void 0;return k({readable:ae,writable:he})}const oe=x?.then;if(typeof oe=="function"){let ae;return G(oe,x,he=>{he!=null&&ae.push(he),ae.push(null)},he=>{E(ae,he)}),ae=new fe({objectMode:!0,writable:!1,read(){}})}throw new I($,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],x)};function T(H){let{promise:x,resolve:$}=v();const oe=new ie,ae=oe.signal;return{value:H((async function*(){for(;;){const B=x;x=null;const{chunk:le,done:b,cb:z}=await B;if(e.nextTick(z),b)return;if(ae.aborted)throw new A(void 0,{cause:ae.reason});({promise:x,resolve:$}=v()),yield le}})(),{signal:ae}),write(B,le,b){const z=$;$=null,z({chunk:B,done:!1,cb:b})},final(B){const le=$;$=null,le({done:!0,cb:B})},destroy(B,le){oe.abort(),le(B)}}}function k(H){const x=H.readable&&typeof H.readable.read!="function"?R.wrap(H.readable):H.readable,$=H.writable;let oe=!!r(x),ae=!!n($),he,B,le,b,z;function ne(L){const se=b;b=null,se?se(L):L&&z.destroy(L)}return z=new fe({readableObjectMode:!!(x!=null&&x.readableObjectMode),writableObjectMode:!!($!=null&&$.writableObjectMode),readable:oe,writable:ae}),ae&&(g($,L=>{ae=!1,L&&E(x,L),ne(L)}),z._write=function(L,se,ce){$.write(L,se)?ce():he=ce},z._final=function(L){$.end(),B=L},$.on("drain",function(){if(he){const L=he;he=null,L()}}),$.on("finish",function(){if(B){const L=B;B=null,L()}})),oe&&(g(x,L=>{oe=!1,L&&E(x,L),ne(L)}),x.on("readable",function(){if(le){const L=le;le=null,L()}}),x.on("end",function(){z.push(null)}),z._read=function(){for(;;){const L=x.read();if(L===null){le=z._read;return}if(!z.push(L))return}}),z._destroy=function(L,se){!L&&b!==null&&(L=new A),le=null,he=null,B=null,b===null?se(L):(b=se,E($,L),E(x,L))},z}return ls}var us,cd;function ir(){if(cd)return us;cd=1;const{ObjectDefineProperties:e,ObjectGetOwnPropertyDescriptor:t,ObjectKeys:r,ObjectSetPrototypeOf:n}=qe();us=a;const i=ra(),o=Xl();n(a.prototype,i.prototype),n(a,i);{const p=r(o.prototype);for(let g=0;g<p.length;g++){const A=p[g];a.prototype[A]||(a.prototype[A]=o.prototype[A])}}function a(p){if(!(this instanceof a))return new a(p);i.call(this,p),o.call(this,p),p?(this.allowHalfOpen=p.allowHalfOpen!==!1,p.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),p.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}e(a.prototype,{writable:{__proto__:null,...t(o.prototype,"writable")},writableHighWaterMark:{__proto__:null,...t(o.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...t(o.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...t(o.prototype,"writableBuffer")},writableLength:{__proto__:null,...t(o.prototype,"writableLength")},writableFinished:{__proto__:null,...t(o.prototype,"writableFinished")},writableCorked:{__proto__:null,...t(o.prototype,"writableCorked")},writableEnded:{__proto__:null,...t(o.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...t(o.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(p){this._readableState&&this._writableState&&(this._readableState.destroyed=p,this._writableState.destroyed=p)}}});let s;function c(){return s===void 0&&(s={}),s}a.fromWeb=function(p,g){return c().newStreamDuplexFromReadableWritablePair(p,g)},a.toWeb=function(p){return c().newReadableWritablePairFromDuplex(p)};let d;return a.from=function(p){return d||(d=t_()),d(p,"body")},us}var cs,dd;function gp(){if(dd)return cs;dd=1;const{ObjectSetPrototypeOf:e,Symbol:t}=qe();cs=a;const{ERR_METHOD_NOT_IMPLEMENTED:r}=ht().codes,n=ir(),{getHighWaterMark:i}=ta();e(a.prototype,n.prototype),e(a,n);const o=t("kCallback");function a(d){if(!(this instanceof a))return new a(d);const p=d?i(this,d,"readableHighWaterMark",!0):null;p===0&&(d={...d,highWaterMark:null,readableHighWaterMark:p,writableHighWaterMark:d.writableHighWaterMark||0}),n.call(this,d),this._readableState.sync=!1,this[o]=null,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",c)}function s(d){typeof this._flush=="function"&&!this.destroyed?this._flush((p,g)=>{if(p){d?d(p):this.destroy(p);return}g!=null&&this.push(g),this.push(null),d&&d()}):(this.push(null),d&&d())}function c(){this._final!==s&&s.call(this)}return a.prototype._final=s,a.prototype._transform=function(d,p,g){throw new r("_transform()")},a.prototype._write=function(d,p,g){const A=this._readableState,I=this._writableState,M=A.length;this._transform(d,p,(E,_)=>{if(E){g(E);return}_!=null&&this.push(_),I.ended||M===A.length||A.length<A.highWaterMark?g():this[o]=g})},a.prototype._read=function(){if(this[o]){const d=this[o];this[o]=null,d()}},cs}var ds,fd;function bp(){if(fd)return ds;fd=1;const{ObjectSetPrototypeOf:e}=qe();ds=r;const t=gp();e(r.prototype,t.prototype),e(r,t);function r(n){if(!(this instanceof r))return new r(n);t.call(this,n)}return r.prototype._transform=function(n,i,o){o(null,n)},ds}var fs,hd;function Zl(){if(hd)return fs;hd=1;const e=St(),{ArrayIsArray:t,Promise:r,SymbolAsyncIterator:n,SymbolDispose:i}=qe(),o=Er(),{once:a}=wt(),s=Cn(),c=ir(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:p,ERR_INVALID_RETURN_VALUE:g,ERR_MISSING_ARGS:A,ERR_STREAM_DESTROYED:I,ERR_STREAM_PREMATURE_CLOSE:M},AbortError:E}=ht(),{validateFunction:_,validateAbortSignal:R}=Ji(),{isIterable:S,isReadable:v,isReadableNodeStream:V,isNodeStream:X,isTransformStream:re,isWebStream:ie,isReadableStream:G,isReadableFinished:fe}=sr(),T=globalThis.AbortController||Gt().AbortController;let k,H,x;function $(L,se,ce){let Y=!1;L.on("close",()=>{Y=!0});const te=o(L,{readable:se,writable:ce},C=>{Y=!C});return{destroy:C=>{Y||(Y=!0,s.destroyer(L,C||new I("pipe")))},cleanup:te}}function oe(L){return _(L[L.length-1],"streams[stream.length - 1]"),L.pop()}function ae(L){if(S(L))return L;if(V(L))return he(L);throw new p("val",["Readable","Iterable","AsyncIterable"],L)}async function*he(L){H||(H=ra()),yield*H.prototype[n].call(L)}async function B(L,se,ce,{end:Y}){let te,C=null;const O=j=>{if(j&&(te=j),C){const l=C;C=null,l()}},Z=()=>new r((j,l)=>{te?l(te):C=()=>{te?l(te):j()}});se.on("drain",O);const ue=o(se,{readable:!1},O);try{se.writableNeedDrain&&await Z();for await(const j of L)se.write(j)||await Z();Y&&(se.end(),await Z()),ce()}catch(j){ce(te!==j?d(te,j):j)}finally{ue(),se.off("drain",O)}}async function le(L,se,ce,{end:Y}){re(se)&&(se=se.writable);const te=se.getWriter();try{for await(const C of L)await te.ready,te.write(C).catch(()=>{});await te.ready,Y&&await te.close(),ce()}catch(C){try{await te.abort(C),ce(C)}catch(O){ce(O)}}}function b(...L){return z(L,a(oe(L)))}function z(L,se,ce){if(L.length===1&&t(L[0])&&(L=L[0]),L.length<2)throw new A("streams");const Y=new T,te=Y.signal,C=ce?.signal,O=[];R(C,"options.signal");function Z(){N(new E)}x=x||wt().addAbortListener;let ue;C&&(ue=x(C,Z));let j,l;const f=[];let w=0;function P(J){N(J,--w===0)}function N(J,K){var de;if(J&&(!j||j.code==="ERR_STREAM_PREMATURE_CLOSE")&&(j=J),!(!j&&!K)){for(;f.length;)f.shift()(j);(de=ue)===null||de===void 0||de[i](),Y.abort(),K&&(j||O.forEach(me=>me()),e.nextTick(se,j,l))}}let q;for(let J=0;J<L.length;J++){const K=L[J],de=J<L.length-1,me=J>0,pe=de||ce?.end!==!1,ve=J===L.length-1;if(X(K)){let _e=function(Ce){Ce&&Ce.name!=="AbortError"&&Ce.code!=="ERR_STREAM_PREMATURE_CLOSE"&&P(Ce)};if(pe){const{destroy:Ce,cleanup:Pe}=$(K,de,me);f.push(Ce),v(K)&&ve&&O.push(Pe)}K.on("error",_e),v(K)&&ve&&O.push(()=>{K.removeListener("error",_e)})}if(J===0)if(typeof K=="function"){if(q=K({signal:te}),!S(q))throw new g("Iterable, AsyncIterable or Stream","source",q)}else S(K)||V(K)||re(K)?q=K:q=c.from(K);else if(typeof K=="function"){if(re(q)){var m;q=ae((m=q)===null||m===void 0?void 0:m.readable)}else q=ae(q);if(q=K(q,{signal:te}),de){if(!S(q,!0))throw new g("AsyncIterable",`transform[${J-1}]`,q)}else{var U;k||(k=bp());const _e=new k({objectMode:!0}),Ce=(U=q)===null||U===void 0?void 0:U.then;if(typeof Ce=="function")w++,Ce.call(q,Me=>{l=Me,Me!=null&&_e.write(Me),pe&&_e.end(),e.nextTick(P)},Me=>{_e.destroy(Me),e.nextTick(P,Me)});else if(S(q,!0))w++,B(q,_e,P,{end:pe});else if(G(q)||re(q)){const Me=q.readable||q;w++,B(Me,_e,P,{end:pe})}else throw new g("AsyncIterable or Promise","destination",q);q=_e;const{destroy:Pe,cleanup:Nt}=$(q,!1,!0);f.push(Pe),ve&&O.push(Nt)}}else if(X(K)){if(V(q)){w+=2;const _e=ne(q,K,P,{end:pe});v(K)&&ve&&O.push(_e)}else if(re(q)||G(q)){const _e=q.readable||q;w++,B(_e,K,P,{end:pe})}else if(S(q))w++,B(q,K,P,{end:pe});else throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],q);q=K}else if(ie(K)){if(V(q))w++,le(ae(q),K,P,{end:pe});else if(G(q)||S(q))w++,le(q,K,P,{end:pe});else if(re(q))w++,le(q.readable,K,P,{end:pe});else throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],q);q=K}else q=c.from(K)}return(te!=null&&te.aborted||C!=null&&C.aborted)&&e.nextTick(Z),q}function ne(L,se,ce,{end:Y}){let te=!1;if(se.on("close",()=>{te||ce(new M)}),L.pipe(se,{end:!1}),Y){let C=function(){te=!0,se.end()};fe(L)?e.nextTick(C):L.once("end",C)}else ce();return o(L,{readable:!0,writable:!1},C=>{const O=L._readableState;C&&C.code==="ERR_STREAM_PREMATURE_CLOSE"&&O&&O.ended&&!O.errored&&!O.errorEmitted?L.once("end",ce).once("error",ce):ce(C)}),o(se,{readable:!1,writable:!0},ce)}return fs={pipelineImpl:z,pipeline:b},fs}var hs,pd;function mp(){if(pd)return hs;pd=1;const{pipeline:e}=Zl(),t=ir(),{destroyer:r}=Cn(),{isNodeStream:n,isReadable:i,isWritable:o,isWebStream:a,isTransformStream:s,isWritableStream:c,isReadableStream:d}=sr(),{AbortError:p,codes:{ERR_INVALID_ARG_VALUE:g,ERR_MISSING_ARGS:A}}=ht(),I=Er();return hs=function(...E){if(E.length===0)throw new A("streams");if(E.length===1)return t.from(E[0]);const _=[...E];if(typeof E[0]=="function"&&(E[0]=t.from(E[0])),typeof E[E.length-1]=="function"){const k=E.length-1;E[k]=t.from(E[k])}for(let k=0;k<E.length;++k)if(!(!n(E[k])&&!a(E[k]))){if(k<E.length-1&&!(i(E[k])||d(E[k])||s(E[k])))throw new g(`streams[${k}]`,_[k],"must be readable");if(k>0&&!(o(E[k])||c(E[k])||s(E[k])))throw new g(`streams[${k}]`,_[k],"must be writable")}let R,S,v,V,X;function re(k){const H=V;V=null,H?H(k):k?X.destroy(k):!T&&!fe&&X.destroy()}const ie=E[0],G=e(E,re),fe=!!(o(ie)||c(ie)||s(ie)),T=!!(i(G)||d(G)||s(G));if(X=new t({writableObjectMode:!!(ie!=null&&ie.writableObjectMode),readableObjectMode:!!(G!=null&&G.readableObjectMode),writable:fe,readable:T}),fe){if(n(ie))X._write=function(H,x,$){ie.write(H,x)?$():R=$},X._final=function(H){ie.end(),S=H},ie.on("drain",function(){if(R){const H=R;R=null,H()}});else if(a(ie)){const x=(s(ie)?ie.writable:ie).getWriter();X._write=async function($,oe,ae){try{await x.ready,x.write($).catch(()=>{}),ae()}catch(he){ae(he)}},X._final=async function($){try{await x.ready,x.close().catch(()=>{}),S=$}catch(oe){$(oe)}}}const k=s(G)?G.readable:G;I(k,()=>{if(S){const H=S;S=null,H()}})}if(T){if(n(G))G.on("readable",function(){if(v){const k=v;v=null,k()}}),G.on("end",function(){X.push(null)}),X._read=function(){for(;;){const k=G.read();if(k===null){v=X._read;return}if(!X.push(k))return}};else if(a(G)){const H=(s(G)?G.readable:G).getReader();X._read=async function(){for(;;)try{const{value:x,done:$}=await H.read();if(!X.push(x))return;if($){X.push(null);return}}catch{return}}}}return X._destroy=function(k,H){!k&&V!==null&&(k=new p),v=null,R=null,S=null,V===null?H(k):(V=H,n(G)&&r(G,k))},X},hs}var yd;function r_(){if(yd)return so;yd=1;const e=globalThis.AbortController||Gt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:t,ERR_INVALID_ARG_TYPE:r,ERR_MISSING_ARGS:n,ERR_OUT_OF_RANGE:i},AbortError:o}=ht(),{validateAbortSignal:a,validateInteger:s,validateObject:c}=Ji(),d=qe().Symbol("kWeak"),p=qe().Symbol("kResistStopPropagation"),{finished:g}=Er(),A=mp(),{addAbortSignalNoValidate:I}=ea(),{isWritable:M,isNodeStream:E}=sr(),{deprecate:_}=wt(),{ArrayPrototypePush:R,Boolean:S,MathFloor:v,Number:V,NumberIsNaN:X,Promise:re,PromiseReject:ie,PromiseResolve:G,PromisePrototypeThen:fe,Symbol:T}=qe(),k=T("kEmpty"),H=T("kEof");function x(C,O){if(O!=null&&c(O,"options"),O?.signal!=null&&a(O.signal,"options.signal"),E(C)&&!M(C))throw new t("stream",C,"must be writable");const Z=A(this,C);return O!=null&&O.signal&&I(O.signal,Z),Z}function $(C,O){if(typeof C!="function")throw new r("fn",["Function","AsyncFunction"],C);O!=null&&c(O,"options"),O?.signal!=null&&a(O.signal,"options.signal");let Z=1;O?.concurrency!=null&&(Z=v(O.concurrency));let ue=Z-1;return O?.highWaterMark!=null&&(ue=v(O.highWaterMark)),s(Z,"options.concurrency",1),s(ue,"options.highWaterMark",0),ue+=Z,(async function*(){const l=wt().AbortSignalAny([O?.signal].filter(S)),f=this,w=[],P={signal:l};let N,q,m=!1,U=0;function J(){m=!0,K()}function K(){U-=1,de()}function de(){q&&!m&&U<Z&&w.length<ue&&(q(),q=null)}async function me(){try{for await(let pe of f){if(m)return;if(l.aborted)throw new o;try{if(pe=C(pe,P),pe===k)continue;pe=G(pe)}catch(ve){pe=ie(ve)}U+=1,fe(pe,K,J),w.push(pe),N&&(N(),N=null),!m&&(w.length>=ue||U>=Z)&&await new re(ve=>{q=ve})}w.push(H)}catch(pe){const ve=ie(pe);fe(ve,K,J),w.push(ve)}finally{m=!0,N&&(N(),N=null)}}me();try{for(;;){for(;w.length>0;){const pe=await w[0];if(pe===H)return;if(l.aborted)throw new o;pe!==k&&(yield pe),w.shift(),de()}await new re(pe=>{N=pe})}}finally{m=!0,q&&(q(),q=null)}}).call(this)}function oe(C=void 0){return C!=null&&c(C,"options"),C?.signal!=null&&a(C.signal,"options.signal"),(async function*(){let Z=0;for await(const j of this){var ue;if(C!=null&&(ue=C.signal)!==null&&ue!==void 0&&ue.aborted)throw new o({cause:C.signal.reason});yield[Z++,j]}}).call(this)}async function ae(C,O=void 0){for await(const Z of b.call(this,C,O))return!0;return!1}async function he(C,O=void 0){if(typeof C!="function")throw new r("fn",["Function","AsyncFunction"],C);return!await ae.call(this,async(...Z)=>!await C(...Z),O)}async function B(C,O){for await(const Z of b.call(this,C,O))return Z}async function le(C,O){if(typeof C!="function")throw new r("fn",["Function","AsyncFunction"],C);async function Z(ue,j){return await C(ue,j),k}for await(const ue of $.call(this,Z,O));}function b(C,O){if(typeof C!="function")throw new r("fn",["Function","AsyncFunction"],C);async function Z(ue,j){return await C(ue,j)?ue:k}return $.call(this,Z,O)}class z extends n{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function ne(C,O,Z){var ue;if(typeof C!="function")throw new r("reducer",["Function","AsyncFunction"],C);Z!=null&&c(Z,"options"),Z?.signal!=null&&a(Z.signal,"options.signal");let j=arguments.length>1;if(Z!=null&&(ue=Z.signal)!==null&&ue!==void 0&&ue.aborted){const N=new o(void 0,{cause:Z.signal.reason});throw this.once("error",()=>{}),await g(this.destroy(N)),N}const l=new e,f=l.signal;if(Z!=null&&Z.signal){const N={once:!0,[d]:this,[p]:!0};Z.signal.addEventListener("abort",()=>l.abort(),N)}let w=!1;try{for await(const N of this){var P;if(w=!0,Z!=null&&(P=Z.signal)!==null&&P!==void 0&&P.aborted)throw new o;j?O=await C(O,N,{signal:f}):(O=N,j=!0)}if(!w&&!j)throw new z}finally{l.abort()}return O}async function L(C){C!=null&&c(C,"options"),C?.signal!=null&&a(C.signal,"options.signal");const O=[];for await(const ue of this){var Z;if(C!=null&&(Z=C.signal)!==null&&Z!==void 0&&Z.aborted)throw new o(void 0,{cause:C.signal.reason});R(O,ue)}return O}function se(C,O){const Z=$.call(this,C,O);return(async function*(){for await(const j of Z)yield*j}).call(this)}function ce(C){if(C=V(C),X(C))return 0;if(C<0)throw new i("number",">= 0",C);return C}function Y(C,O=void 0){return O!=null&&c(O,"options"),O?.signal!=null&&a(O.signal,"options.signal"),C=ce(C),(async function*(){var ue;if(O!=null&&(ue=O.signal)!==null&&ue!==void 0&&ue.aborted)throw new o;for await(const l of this){var j;if(O!=null&&(j=O.signal)!==null&&j!==void 0&&j.aborted)throw new o;C--<=0&&(yield l)}}).call(this)}function te(C,O=void 0){return O!=null&&c(O,"options"),O?.signal!=null&&a(O.signal,"options.signal"),C=ce(C),(async function*(){var ue;if(O!=null&&(ue=O.signal)!==null&&ue!==void 0&&ue.aborted)throw new o;for await(const l of this){var j;if(O!=null&&(j=O.signal)!==null&&j!==void 0&&j.aborted)throw new o;if(C-- >0&&(yield l),C<=0)return}}).call(this)}return so.streamReturningOperators={asIndexedPairs:_(oe,"readable.asIndexedPairs will be removed in a future version."),drop:Y,filter:b,flatMap:se,map:$,take:te,compose:x},so.promiseReturningOperators={every:he,forEach:le,reduce:ne,toArray:L,some:ae,find:B},so}var ps,gd;function wp(){if(gd)return ps;gd=1;const{ArrayPrototypePop:e,Promise:t}=qe(),{isIterable:r,isNodeStream:n,isWebStream:i}=sr(),{pipelineImpl:o}=Zl(),{finished:a}=Er();_p();function s(...c){return new t((d,p)=>{let g,A;const I=c[c.length-1];if(I&&typeof I=="object"&&!n(I)&&!r(I)&&!i(I)){const M=e(c);g=M.signal,A=M.end}o(c,(M,E)=>{M?p(M):d(E)},{signal:g,end:A})})}return ps={finished:a,pipeline:s},ps}var bd;function _p(){if(bd)return Qa.exports;bd=1;const{Buffer:e}=vt(),{ObjectDefineProperty:t,ObjectKeys:r,ReflectApply:n}=qe(),{promisify:{custom:i}}=wt(),{streamReturningOperators:o,promiseReturningOperators:a}=r_(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:s}}=ht(),c=mp(),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:p}=ta(),{pipeline:g}=Zl(),{destroyer:A}=Cn(),I=Er(),M=wp(),E=sr(),_=Qa.exports=Yl().Stream;_.isDestroyed=E.isDestroyed,_.isDisturbed=E.isDisturbed,_.isErrored=E.isErrored,_.isReadable=E.isReadable,_.isWritable=E.isWritable,_.Readable=ra();for(const S of r(o)){let V=function(...X){if(new.target)throw s();return _.Readable.from(n(v,this,X))};const v=o[S];t(V,"name",{__proto__:null,value:v.name}),t(V,"length",{__proto__:null,value:v.length}),t(_.Readable.prototype,S,{__proto__:null,value:V,enumerable:!1,configurable:!0,writable:!0})}for(const S of r(a)){let V=function(...X){if(new.target)throw s();return n(v,this,X)};const v=a[S];t(V,"name",{__proto__:null,value:v.name}),t(V,"length",{__proto__:null,value:v.length}),t(_.Readable.prototype,S,{__proto__:null,value:V,enumerable:!1,configurable:!0,writable:!0})}_.Writable=Xl(),_.Duplex=ir(),_.Transform=gp(),_.PassThrough=bp(),_.pipeline=g;const{addAbortSignal:R}=ea();return _.addAbortSignal=R,_.finished=I,_.destroy=A,_.compose=c,_.setDefaultHighWaterMark=d,_.getDefaultHighWaterMark=p,t(_,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return M}}),t(g,i,{__proto__:null,enumerable:!0,get(){return M.pipeline}}),t(I,i,{__proto__:null,enumerable:!0,get(){return M.finished}}),_.Stream=_,_._isUint8Array=function(v){return v instanceof Uint8Array},_._uint8ArrayToBuffer=function(v){return e.from(v.buffer,v.byteOffset,v.byteLength)},Qa.exports}var md;function n_(){return md||(md=1,(function(e){const t=_p(),r=wp(),n=t.Readable.destroy;e.exports=t.Readable,e.exports._uint8ArrayToBuffer=t._uint8ArrayToBuffer,e.exports._isUint8Array=t._isUint8Array,e.exports.isDisturbed=t.isDisturbed,e.exports.isErrored=t.isErrored,e.exports.isReadable=t.isReadable,e.exports.Readable=t.Readable,e.exports.Writable=t.Writable,e.exports.Duplex=t.Duplex,e.exports.Transform=t.Transform,e.exports.PassThrough=t.PassThrough,e.exports.addAbortSignal=t.addAbortSignal,e.exports.finished=t.finished,e.exports.destroy=t.destroy,e.exports.destroy=n,e.exports.pipeline=t.pipeline,e.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return r}}),e.exports.Stream=t.Stream,e.exports.default=e.exports})(Va)),Va.exports}var wd;function i_(){if(wd)return ti;wd=1,Object.defineProperty(ti,"__esModule",{value:!0}),ti.ActorQueryResultSerializeSparqlJson=void 0;const e=ip(),t=vr(),r=ap(),n=n_();let i=class si extends e.ActorQueryResultSerializeFixedMediaTypes{constructor(a){super(a)}static bindingToJsonBindings(a){if(a.termType==="Literal"){const s=a,c={value:s.value,type:"literal"},{language:d,datatype:p}=s;return d?c["xml:lang"]=d:p&&p.value!=="http://www.w3.org/2001/XMLSchema#string"&&(c.datatype=p.value),c}return a.termType==="BlankNode"?{value:a.value,type:"bnode"}:a.termType==="Quad"?{value:{subject:si.bindingToJsonBindings(a.subject),predicate:si.bindingToJsonBindings(a.predicate),object:si.bindingToJsonBindings(a.object)},type:"triple"}:{value:a.value,type:"uri"}}async testHandleChecked(a,s){return["bindings","boolean"].includes(a.type)?(0,t.passTestVoid)():(0,t.failTest)("This actor can only handle bindings streams or booleans.")}async runHandle(a,s,c){const d=new n.Readable,p={};if(a.type==="bindings"){const g=await a.metadata();g.variables.length>0&&(p.vars=g.variables.map(A=>A.variable.value))}if(d.push(`{"head": ${JSON.stringify(p)},
16
+ `),a.type==="bindings"){const g=a.bindingsStream;d.push(`"results": { "bindings": [
17
+ `);let A=!0;function*I(M){yield M()}d.wrap((0,r.wrap)(g).map(M=>{const E=`${A?"":`,
18
+ `}${JSON.stringify(Object.fromEntries([...M].map(([_,R])=>[_.value,si.bindingToJsonBindings(R)])))}`;return A=!1,E}).append((0,r.wrap)(I(()=>`
19
+ ]}${this.emitMetadata?`,
20
+ "metadata": { "httpRequests": ${this.httpObserver.requests} }`:""}}
21
+ `))))}else d.wrap((0,r.wrap)(a.execute().then(g=>[`"boolean":${g}
22
+ }
23
+ `])));return{data:d}}};return ti.ActorQueryResultSerializeSparqlJson=i,ti}var _d;function o_(){return _d||(_d=1,(function(e){var t=Lr&&Lr.__createBinding||(Object.create?(function(n,i,o,a){a===void 0&&(a=o);var s=Object.getOwnPropertyDescriptor(i,o);(!s||("get"in s?!i.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(n,a,s)}):(function(n,i,o,a){a===void 0&&(a=o),n[a]=i[o]})),r=Lr&&Lr.__exportStar||function(n,i){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,n,o)};Object.defineProperty(e,"__esModule",{value:!0}),r($w(),e),r(i_(),e)})(Lr)),Lr}var a_=o_();const _i=Array.from(new Set([...Hd,"zhipu","ollama","custom"])),Ad=new WeakMap;function s_(e){c_(),Up({createQueryEngine:async()=>new oy});const t=new URL("settings/-/sparql",e.podUrl).toString();return Ie.setSparqlEndpoint(t),ke.setSparqlEndpoint(t),yt.setSparqlEndpoint(t),{async listModels(){return await e.database.init?.(yt),(await e.database.select().from(yt).execute()).map(g_).filter(ln)},async listProviders(){await e.database.init?.(Ie,ke,yt);const r=await e.database.select().from(Ie).execute(),n=await e.database.select().from(ke).execute(),i=await e.database.select().from(yt).execute();return d_(e,r,n,i)},async createApiKeyCredential(r,n){const i=Pt(r);if(!i)throw new Error("unsupported_provider");await e.database.init?.(Ie,ke);const o=Ie.buildId({id:`${i}-${crypto.randomUUID()}`}),a=1,s=n.offeringId??nn(i,"apiKey"),c=n.baseUrl??Dd(i,s),d=ms(n.proxyUrl),p={id:o,provider:i==="custom"?m_(o):gs(i,s),service:"ai",authMode:"apiKey",status:"active",accountLabel:n.label,label:n.label,baseUrl:c,proxyUrl:d,keyVersion:String(a),reauthRequired:!1,encryptedSecret:uo(e,i,o,{type:"apiKey",apiKey:n.apiKey}),encryptionAlgorithm:"PLAINTEXT",metadata:{offeringId:s,priority:n.priority??100,enabled:!0,health:"unknown",baseUrl:c,...n.compatibility?{compatibility:n.compatibility}:{}}};return await e.database.insert(Ie).values(p).execute(),ot(e,i,p)},async createLocalCredential(r,n){const i=Pt(r);if(!i)throw new Error("unsupported_provider");await e.database.init?.(Ie,ke);const o=Ie.buildId({id:`${i}-local-${crypto.randomUUID()}`}),a=n.offeringId??nn(i,"local"),s=n.baseUrl??Dd(i,a),c={id:o,provider:gs(i,a),service:"ai",authMode:"local",status:"active",accountLabel:n.label??"Local",label:n.label??"Local",baseUrl:s,keyVersion:"1",reauthRequired:!1,encryptedSecret:uo(e,i,o,{type:"local"}),encryptionAlgorithm:"PLAINTEXT",metadata:{offeringId:a,priority:n.priority??100,enabled:!0,health:"unknown",baseUrl:s}};return await e.database.insert(Ie).values(c).execute(),ot(e,i,c)},async saveOAuthCredential(r,n){const i=Pt(r);if(!i)throw new Error("unsupported_provider");const a=(Ad.get(e.database)??Promise.resolve()).then(async()=>{await e.database.init?.(Ie,ke);const s=Ai(i,n.offeringId??nn(i,"deviceCode"))??nn(i,"deviceCode"),d=(await e.database.select().from(Ie).execute()).find(S=>{const v=ot(e,i,S);if(!v||v.authMode!=="deviceCode"&&v.authMode!=="oauth"||Ai(i,v.offeringId)!==s||S.status!=="active"&&S.status!=="disabled")return!1;const V=li(e,i,v.id,S.encryptedSecret);return h_(n,gt(S.metadata),V)}),p=d&&ot(e,i,d),g=gt(d?.metadata),A=p&&li(e,i,p.id,d?.encryptedSecret),I=p?.id??Ie.buildId({id:`${i}-oauth-${crypto.randomUUID()}`}),M=n.accountLabel??"OAuth",E=n.accountId??ye(g?.accountId)??ye(A?.accountId),_=n.accountSubject??ye(g?.authoritativeSubject)??ye(A?.accountSubject)??ye(A?.authoritativeSubject),R={...d,id:I,provider:gs(i,s),service:"ai",authMode:"deviceCodeOAuth",status:p?.enabled===!1?"disabled":"active",accountLabel:d?.accountLabel??M,label:d?.label??M,expiresAt:n.expiresAt,scopes:n.scope?n.scope.split(/\s+/u).filter(Boolean):void 0,keyVersion:String((p?.version??0)+1),reauthRequired:!1,encryptedSecret:uo(e,i,I,{type:"deviceCodeOAuth",accessToken:n.accessToken,refreshToken:n.refreshToken,expiresAt:n.expiresAt,scope:n.scope,idToken:n.idToken,accountId:E,accountSubject:_,accountLabel:n.accountLabel,offeringId:s,authorizationMethodId:n.authorizationMethodId}),encryptionAlgorithm:"PLAINTEXT",metadata:{...g,offeringId:s,priority:p?.priority??100,enabled:p?.enabled??!0,health:"healthy",authoritativeSubject:_,accountId:E,authorizationMethodId:n.authorizationMethodId}};if(d){const S={...R};if(delete S.id,!await e.database.updateById(Ie,I,S))throw new Error("credential_version_conflict")}else await e.database.insert(Ie).values(R).execute();return ot(e,i,R)});return Ad.set(e.database,a.then(()=>{},()=>{})),a},async updateOAuthCredential(r,n,i,o){const a=Pt(r);if(!a)throw new Error("unsupported_provider");await e.database.init?.(Ie,ke);const s=await e.database.findById(Ie,n),c=s&&ot(e,a,s);if(!s||!c||c.authMode!=="deviceCode")throw new Error("oauth_credential_not_found");if(c.version!==i)throw new Error("credential_version_conflict");const d=li(e,a,n,s.encryptedSecret),p=o.accountId??ye(gt(s.metadata)?.accountId)??ye(d?.accountId),g=o.accountSubject??ye(gt(s.metadata)?.authoritativeSubject)??ye(d?.accountSubject)??ye(d?.authoritativeSubject),A={expiresAt:o.expiresAt,scopes:o.scope?o.scope.split(/\s+/u).filter(Boolean):void 0,keyVersion:String(i+1),reauthRequired:!1,status:"active",encryptedSecret:uo(e,a,n,{type:"deviceCodeOAuth",accessToken:o.accessToken,refreshToken:o.refreshToken,expiresAt:o.expiresAt,scope:o.scope,idToken:o.idToken,accountId:p,accountSubject:g,accountLabel:o.accountLabel??ye(s.accountLabel),offeringId:o.offeringId??c.offeringId,authorizationMethodId:o.authorizationMethodId??ye(gt(s.metadata)?.authorizationMethodId)}),accountLabel:o.accountLabel??ye(s.accountLabel),label:o.accountLabel??ye(s.label),metadata:{...gt(s.metadata),offeringId:o.offeringId??c.offeringId,enabled:!0,health:"healthy",authoritativeSubject:g,accountId:p,authorizationMethodId:o.authorizationMethodId??ye(gt(s.metadata)?.authorizationMethodId)}},I=await e.database.updateById(Ie,n,A);if(!I)throw new Error("credential_version_conflict");return ot(e,a,I)},async updateProviderCredential(r,n,i){const o=Pt(r);if(!o)throw new Error("unsupported_provider");await e.database.init?.(Ie,ke);const a=await e.database.findById(Ie,n),s=a&&ot(e,o,a);if(!a||!s)throw new Error("credential_not_found");if(s.version!==i.expectedVersion)throw new Error("credential_version_conflict");const c={...gt(a.metadata),...i.priority===void 0?{}:{priority:i.priority},...i.enabled===void 0?{}:{enabled:i.enabled},...i.baseUrl===void 0?{}:{baseUrl:i.baseUrl},...i.proxyUrl===void 0?{}:{proxyUrl:ms(i.proxyUrl)}},d={...i.label===void 0?{}:{accountLabel:i.label,label:i.label},...i.baseUrl===void 0?{}:{baseUrl:i.baseUrl},...i.proxyUrl===void 0?{}:{proxyUrl:ms(i.proxyUrl)},...i.enabled===void 0?{}:{status:i.enabled?"active":"disabled"},keyVersion:String(s.version+1),metadata:c},p=await e.database.updateById(Ie,n,d);if(!p)throw new Error("credential_update_failed");const g=ot(e,o,p);if(!g)throw new Error("credential_update_failed");return g},async markCredentialHealth(r,n,i,o){const a=Pt(r);if(!a)throw new Error("unsupported_provider");await e.database.init?.(Ie);const s=await e.database.findById(Ie,n),c=s&&ot(e,a,s);if(!s||!c)throw new Error("credential_not_found");if(c.version!==o)throw new Error("credential_version_conflict");const d=await e.database.updateById(Ie,n,{keyVersion:String(c.version+1),metadata:{...gt(s.metadata),health:i}});if(!d)throw new Error("credential_update_failed");const p=ot(e,a,d);if(!p)throw new Error("credential_update_failed");return p},async deleteProviderCredential(r,n){const i=Pt(r);if(!i)throw new Error("unsupported_provider");await e.database.init?.(Ie,ke);const o=await e.database.findById(Ie,n),a=o&&ot(e,i,o);if(a)return await e.database.deleteById(Ie,n),a},async readCredentialSecret(r,n){const i=Pt(r);if(!i)throw new Error("unsupported_provider");const o=await e.database.findById(Ie,n);if(!o||!ot(e,i,o))throw new Error("credential_not_found");const a=li(e,i,n,o.encryptedSecret);if(!a)throw new Error("credential_secret_unavailable");return a},async saveDiscoveredModels(r,n,i){const o=Pt(r);if(!o)throw new Error("unsupported_provider");await e.database.init?.(Ie,ke,yt),await __(e.database,o);const a=await vd(e,n),s=Ed(o,a);await xd(e.database,s,vi(o));const c=await e.database.select().from(yt).execute(),d=new Set(c.map(A=>ye(A.id)).filter(ln)),p=i.map(b_).filter(ln),g=new Set(p.map(A=>A.id));for(const A of c.filter(I=>fr(ye(I.isProvidedBy),s))){const I=Wr(ye(A.id),s);I&&!g.has(I)&&ye(A.status)!=="unavailable"&&await e.database.updateById(yt,String(A.id),{status:"unavailable"})}for(const A of p)await A_(e.database,s,A,d)},async saveModelSelection(r,n,i){const o=Pt(r);if(!o)throw new Error("unsupported_provider");await e.database.init?.(ke,yt);const a=o==="custom"&&i?await vd(e,i):null;if(o==="custom"&&i&&!a)throw new Error("credential_not_found");const s=a?Ed(o,a):ke.buildId({id:o});await xd(e.database,s,vi(o));const d=(await e.database.select().from(ke).execute()).find(E=>fr(ye(E.id),s)),p=ye(d?.id)??s,g=Sp(d?.hasModel),A=await e.database.select().from(yt).execute(),I=[...new Set(n.map(E=>v_(o,E,A,a?s:void 0)))];if(!await e.database.updateById(ke,p,{hasModel:I}))throw new Error("provider_model_selection_update_failed");e.authenticatedFetch&&await u_(e,p,g,I)}}}const l_="https://undefineds.co/ns#hasModel";async function u_(e,t,r,n){const i=ys(ke,e.podUrl,t),o=r.map(p=>ys(yt,e.podUrl,p)),a=n.map(p=>ys(yt,e.podUrl,p)),s=p=>p.map(g=>`<${i}> <${l_}> <${g}> .`).join(`
24
+ `),c=[o.length>0?`DELETE DATA { ${s(o)} }`:void 0,a.length>0?`INSERT DATA { ${s(a)} }`:void 0].filter(p=>!!p);if(c.length===0)return;const d=await e.authenticatedFetch(i.split("#",1)[0],{method:"PATCH",headers:{"content-type":"application/sparql-update"},body:c.join(`;
25
+ `)});if(!d.ok)throw new Error(`provider_model_selection_persist_failed:${d.status}`)}function ys(e,t,r){return/^https?:\/\//u.test(r)?r:e.buildIri(t,{id:r})}async function vd(e,t){const r=await e.database.findById(Ie,t);return r||((await e.database.select().from(Ie).execute()).find(i=>{const o=ye(i.id);return o===t||(o?Ie.buildIri(e.podUrl,{id:o})===t:!1)})??null)}function c_(){Sd(Zw.ActionObserverHttp.prototype),Sd(a_.ActionObserverHttp.prototype)}function Sd(e){const t=e;if(t.__xpodObservedActorsPatch)return;const r=t.onRun;t.onRun=function(n,i,o){return Array.isArray(this.observedActors)||(this.observedActors=[]),r.call(this,n,i,o)},t.__xpodObservedActorsPatch=!0}function d_(e,t,r,n){const i=t.filter(o=>ye(o.service)==="ai").filter(o=>ye(o.status)!=="revoked");return _i.map(o=>{const a=i.map(p=>ot(e,o,p)).filter(ln).sort((p,g)=>p.priority-g.priority||p.id.localeCompare(g.id)),s=r.find(p=>Vr(ye(p.id))===o),d=Sp(s?.hasModel).map(p=>y_(o,p,n));return{id:o,name:o==="custom"?a.find(p=>p.label)?.label??vi(o):vi(o),offerings:o==="custom"?S_(i.filter(p=>ot(e,o,p))):Ep(o,e.openAiSubscriptionImportAvailable===!0),credentials:a,selectedModels:d,status:j_(a)}})}function uo(e,t,r,n){return JSON.stringify({algorithm:"PLAINTEXT",encoding:"base64",ciphertext:f_(n),webId:e.webId,credentialIri:Ie.buildIri(e.podUrl,{id:r}),provider:t})}function f_(e){const t=new TextEncoder().encode(JSON.stringify(e));let r="";for(const n of t)r+=String.fromCharCode(n);return btoa(r)}function h_(e,t,r){let n=!1;for(const[i,o]of[[e.accountId,[t?.accountId,r?.accountId]],[e.accountSubject,[t?.authoritativeSubject,r?.accountSubject,r?.authoritativeSubject]]]){const a=[...new Set(o.map(ye).filter(ln).filter(s=>s.trim()))];if(a.length>1)return!1;if(!(!i?.trim()||!a.length)){if(a[0]!==i)return!1;n=!0}}return n}function ot(e,t,r){const n=ye(r.id);if(!n)return;const i=$l(ye(r.provider))??L_(n);if(i!==t)return;const o=gt(r.metadata),a=B_(r.authMode);if(a)return{id:n,provider:i,offeringId:ye(o?.offeringId)??eu(ye(r.provider))??nn(i,a),authMode:a,label:ye(r.accountLabel)??ye(r.label),enabled:kd(o?.enabled)??ye(r.status)==="active",priority:Pd(o?.priority)??100,health:q_(o?.health)??(kd(r.reauthRequired)?"expired":"healthy"),maskedHint:N_(e,i,n,r.encryptedSecret),baseUrl:ye(r.baseUrl),proxyUrl:U_(ye(r.proxyUrl)??ye(o?.proxyUrl)),compatibility:p_(o?.compatibility),expiresAt:K_(r.expiresAt),version:Pd(r.keyVersion)??0}}function p_(e){return e==="auto"||e==="openai"||e==="anthropic"?e:void 0}function y_(e,t,r){const n=r.find(s=>mr(ye(s.id))===mr(t)),i=ye(n?.isProvidedBy),o=n?Wr(t,i??e)??t:Wr(t,e)??t,a=n??r.find(s=>{const c=ye(s.id),d=ye(s.isProvidedBy);return c===t||Wr(c,e)===o||$l(d)===e&&Wr(c,d??e)===o});return{id:o,provider:e,offeringId:eu(ye(a?.isProvidedBy)),credentialId:Ap(i),resourceId:ye(a?.id)??t,displayName:ye(a?.displayName),availability:ye(a?.status)==="unavailable"||!a?"unavailable":"available"}}function g_(e){const t=ye(e.isProvidedBy),r=$l(t),n=r&&Wr(ye(e.id),t??r);if(!(!r||!n))return{id:n,provider:r,offeringId:eu(t),credentialId:Ap(t),resourceId:ye(e.id),displayName:ye(e.displayName),availability:ye(e.status)==="unavailable"?"unavailable":"available"}}function b_(e){const t=gt(e),r=ye(t?.id);if(r)return{id:r,displayName:ye(t?.displayName)}}function Ed(e,t){const r=ye(t?.provider),n=mr(r),i=Vr(r);if(n&&i&&i!==e&&n.includes("#"))return ke.buildId({id:n});const o=ye(gt(t?.metadata)?.offeringId),a=Ai(e,o??w_(e,i));return a?ke.buildId({id:`${e}-${a}.ttl#this`}):ke.buildId({id:e})}function gs(e,t){const r=Ai(e,t)??t;return ke.buildId({id:`${e}-${r}.ttl#this`})}function m_(e){return ke.buildId({id:`custom-instance-${encodeURIComponent(e)}.ttl#this`})}function Ap(e){const t=Vr(e),r=t?.startsWith("custom-instance-")?t.slice(16):void 0;if(r)try{return decodeURIComponent(r)}catch{return}}function Ai(e,t){if(!t)return;const r=t.trim().toLowerCase();if(e==="bailian"){if(r==="token-plan")return"token-plan-personal";if(r==="coding-plan")return"coding-plan-pro";if(r==="payg")return"pay-as-you-go"}return r}function w_(e,t){if(!(!t||t===e)&&e==="bailian"){if(t==="bailian-token-plan")return"token-plan-personal";if(t==="bailian-coding-plan")return"coding-plan-pro"}}function fr(e,t){const r=mr(e),n=mr(t);return r!==void 0&&r===n}async function __(e,t){const r=ke.buildId({id:t});(await e.select().from(ke).execute()).some(i=>fr(ye(i.id),r))||await e.insert(ke).values({id:r,displayName:vi(t)}).execute()}async function xd(e,t,r){(await e.select().from(ke).execute()).some(i=>fr(ye(i.id),t))||await e.insert(ke).values({id:t,displayName:r}).execute()}async function A_(e,t,r,n){const i=vp(t,r.id),o={displayName:r.displayName??r.id,isProvidedBy:t,status:"active"};if(n.has(i)){await e.updateById(yt,i,o);return}await e.insert(yt).values({id:i,...o}).execute(),n.add(i)}function vp(e,t){const r=mr(e)??`${e}.ttl`;return`${r.split("#",1)[0]??r}#${encodeURIComponent(t)}`}function v_(e,t,r,n){const i=ye(t.resourceId),o=Ai(e,ye(t.offeringId)),a=n??(o?ke.buildId({id:`${e}-${o}.ttl#this`}):ke.buildId({id:e})),s=ye(t.id),c=s?r.filter(p=>{const g=ye(p.isProvidedBy),A=Vr(g);return(n?fr(g,n):A===e||A?.startsWith(`${e}-`)===!0)&&Wr(ye(p.id),g??a)===s}):[],d=n?c[0]:o?c.find(p=>fr(ye(p.isProvidedBy),a)):c.length===1?c[0]:void 0;if(i){const p=r.find(E=>ye(E.id)===i);if(!p&&d)return String(d.id);const g=ye(p?.isProvidedBy),A=Vr(g),I=n?fr(g,n):A===e||A?.startsWith(`${e}-`)===!0,M=!!n||!o||fr(g,a);if(!p||!I||!M)throw new Error("invalid_model_selection_resource");return i}if(!s)throw new Error("invalid_model_selection_resource");return ye(d?.id)??vp(a,s)}function Wr(e,t){if(!e)return;const n=mr(t)?.split("#",1)[0]??t,i=n.endsWith(".ttl")?`${n}#`:`${n}.ttl#`,o=e.lastIndexOf(i);if(!(o<0))try{return decodeURIComponent(e.slice(o+i.length))}catch{return e.slice(o+i.length)}}function Sp(e){if(Array.isArray(e))return e.map(ye).filter(ln);const t=ye(e);return t?[t]:[]}function Ep(e,t=!1){return(O_[e]??x_).map(r=>e==="openai"&&r.id==="official-subscription"&&t?{...r,lifecycle:"active",authModes:Array.from(new Set([...r.authModes??[],"local"])),authorizationMethods:[{id:"device-code",authMode:"deviceCode",connectMode:"deviceCodeOAuth",label:"设备码登录",lifecycle:"active"},{id:"local-session-import",authMode:"local",label:"已有登录态",lifecycle:"active"}]}:{...r})}function S_(e){const t=new Map;for(const r of e){const n=gt(r.metadata),i=ye(n?.offeringId)??"openai-compatible",o=E_(n?.compatibility,i),a=ye(r.baseUrl)??ye(n?.baseUrl),s=co.find(c=>c.id===i)??co.find(c=>c.id===`${o}-compatible`)??co[0];t.set(i,{...s,id:i,endpoints:a?[{protocol:o==="anthropic"?"anthropic":"chatCompletions",baseUrl:a}]:s.endpoints,modelDiscovery:o==="anthropic"?{strategy:"anthropic",path:"/models",endpointProtocol:"anthropic"}:{strategy:"openaiCompatible",path:"/models",endpointProtocol:"chatCompletions"}})}return t.size>0?[...t.values()]:co}function E_(e,t){return e==="anthropic"||t==="anthropic-compatible"?"anthropic":"openai"}const x_=[{id:"api-platform",label:"API 平台",kind:"api-platform",lifecycle:"active",authModes:["apiKey"]}],co=[{id:"openai-compatible",label:"OpenAI 兼容",kind:"api-platform",lifecycle:"active",authModes:["apiKey"],runtimeProviderIds:["custom"],endpoints:[],modelDiscovery:{strategy:"openaiCompatible",path:"/models",endpointProtocol:"chatCompletions"},quota:{strategy:"openaiCompatible",url:"/usage"}},{id:"anthropic-compatible",label:"Anthropic 兼容",kind:"api-platform",lifecycle:"active",authModes:["apiKey"],runtimeProviderIds:["custom"],endpoints:[],modelDiscovery:{strategy:"anthropic",path:"/models",endpointProtocol:"anthropic"},quota:{strategy:"console",url:""}}],bs="https://www.kimi.com/code",I_="https://www.kimi.com/user/agreement",R_="https://api.kimi.com/coding/v1",C_="https://api.kimi.com/coding/",M_="https://platform.moonshot.cn/console/api-keys",Id="https://platform.moonshot.cn/console/account",D_="https://platform.moonshot.cn/docs/intro",P_="https://api.moonshot.ai/v1",fo="https://bailian.console.aliyun.com/",ho="https://help.aliyun.com/zh/model-studio/",Rd="https://open.bigmodel.cn/usercenter/apikeys",Cd="https://open.bigmodel.cn/",k_="https://open.bigmodel.cn/api/paas/v4",T_="https://open.bigmodel.cn/api/coding/paas/v4",O_={openai:[{id:"official-subscription",label:"OpenAI Subscription",kind:"oauth-subscription",lifecycle:"unavailable",authModes:["oauth"],productLabel:"OpenAI",runtimeProviderIds:["openai"],credentialPrefixHints:[],consoleUrl:"https://chatgpt.com/codex",subscriptionUrl:"https://chatgpt.com/codex",endpoints:[],modelDiscovery:{strategy:"unsupported",path:"/models",endpointProtocol:"responses"},quota:{strategy:"subscription",url:"https://chatgpt.com/codex"},usagePolicyUrl:"https://openai.com/policies/usage-policies/",region:"global"},{id:"api-platform",label:"API 平台",kind:"api-platform",lifecycle:"active",authModes:["apiKey"],productLabel:"OpenAI",runtimeProviderIds:["openai"],credentialPrefixHints:["sk-"],consoleUrl:"https://platform.openai.com/api-keys",subscriptionUrl:"https://platform.openai.com/settings/organization/billing/overview",endpoints:[{protocol:"responses",baseUrl:"https://api.openai.com/v1"},{protocol:"chatCompletions",baseUrl:"https://api.openai.com/v1"}],modelDiscovery:{strategy:"openaiCompatible",path:"/models",endpointProtocol:"responses"},quota:{strategy:"providerApi",url:"https://platform.openai.com/usage"},usagePolicyUrl:"https://openai.com/policies/usage-policies/",region:"global"}],anthropic:[{id:"official-subscription",label:"Claude Code 订阅",kind:"oauth-subscription",lifecycle:"unavailable",authModes:["oauth"],productLabel:"Anthropic",runtimeProviderIds:["anthropic"],credentialPrefixHints:[],consoleUrl:"https://claude.ai/",subscriptionUrl:"https://claude.ai/settings/billing",endpoints:[],modelDiscovery:{strategy:"unsupported",path:"/models",endpointProtocol:"anthropic"},quota:{strategy:"subscription",url:"https://claude.ai/settings/usage"},usagePolicyUrl:"https://www.anthropic.com/legal/aup",region:"global"},{id:"api-platform",label:"API 平台",kind:"api-platform",lifecycle:"active",authModes:["apiKey"],productLabel:"Anthropic",runtimeProviderIds:["anthropic"],credentialPrefixHints:["sk-ant-"],consoleUrl:"https://console.anthropic.com/settings/keys",subscriptionUrl:"https://console.anthropic.com/settings/plans",endpoints:[{protocol:"anthropic",baseUrl:"https://api.anthropic.com/v1"}],modelDiscovery:{strategy:"anthropic",path:"/models",endpointProtocol:"anthropic"},quota:{strategy:"console",url:"https://console.anthropic.com/settings/limits"},usagePolicyUrl:"https://www.anthropic.com/legal/aup",region:"global"}],kimi:[Md({id:"subscription-key",label:"Token 套餐",kind:"token-plan",authModes:["apiKey"],productLabel:"Kimi Coding",runtimeProviderIds:["kimi"],credentialPrefixHints:["sk-kimi-"],baseUrl:R_,anthropicBaseUrl:C_,quotaStrategy:"subscription",quotaUrl:bs,consoleUrl:bs,subscriptionUrl:bs,usagePolicyUrl:I_}),Md({id:"api-platform",label:"API 平台",kind:"api-platform",authModes:["apiKey"],productLabel:"Moonshot AI",runtimeProviderIds:["kimi"],credentialPrefixHints:["sk-"],baseUrl:P_,quotaStrategy:"console",quotaUrl:Id,consoleUrl:M_,subscriptionUrl:Id,usagePolicyUrl:D_})],bailian:[po({id:"pay-as-you-go",label:"Pay as You Go",kind:"api-platform",runtimeProviderIds:["bailian"],credentialPrefixHints:["sk-"],region:"cn",baseUrl:"https://dashscope.aliyuncs.com/compatible-mode/v1",anthropicBaseUrl:"https://dashscope.aliyuncs.com/apps/anthropic",quotaStrategy:"console",consoleUrl:fo,usagePolicyUrl:ho}),po({id:"token-plan",label:"Token Plan Personal",kind:"token-plan",runtimeProviderIds:["bailian-token-plan"],credentialPrefixHints:["sk-"],region:"cn-beijing",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",anthropicBaseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/apps/anthropic",quotaStrategy:"subscription",consoleUrl:fo,usagePolicyUrl:ho}),po({id:"token-plan-team",label:"Token Plan Team",kind:"token-plan",runtimeProviderIds:["bailian-token-plan"],credentialPrefixHints:["sk-"],region:"cn-beijing",baseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",anthropicBaseUrl:"https://token-plan.cn-beijing.maas.aliyuncs.com/apps/anthropic",quotaStrategy:"subscription",consoleUrl:fo,usagePolicyUrl:ho}),po({id:"coding-plan",label:"Coding Plan Pro",kind:"token-plan",runtimeProviderIds:["bailian-coding-plan"],credentialPrefixHints:["sk-sp-"],region:"cn",baseUrl:"https://coding.dashscope.aliyuncs.com/v1",anthropicBaseUrl:"https://coding.dashscope.aliyuncs.com/apps/anthropic",quotaStrategy:"subscription",consoleUrl:fo,usagePolicyUrl:ho})],deepseek:[{id:"api-platform",label:"API 平台",kind:"api-platform",lifecycle:"active",authModes:["apiKey"],productLabel:"DeepSeek",runtimeProviderIds:["deepseek"],credentialPrefixHints:["sk-"],consoleUrl:"https://platform.deepseek.com/api_keys",subscriptionUrl:"https://platform.deepseek.com/usage",endpoints:[{protocol:"chatCompletions",baseUrl:"https://api.deepseek.com/v1"}],modelDiscovery:{strategy:"openaiCompatible",path:"/models",endpointProtocol:"chatCompletions"},quota:{strategy:"console",url:"https://platform.deepseek.com/usage"},usagePolicyUrl:"https://cdn.deepseek.com/policies/en-US/deepseek-open-platform-terms-of-use.html",region:"global"}],ollama:[{id:"local",label:"Local Ollama",kind:"local",lifecycle:"active",authModes:["local"],productLabel:"Ollama",runtimeProviderIds:["ollama"],credentialPrefixHints:[],consoleUrl:"https://ollama.com",subscriptionUrl:"https://ollama.com",endpoints:[{protocol:"chatCompletions",baseUrl:"http://localhost:11434/v1"}],modelDiscovery:{strategy:"openaiCompatible",path:"/models",endpointProtocol:"chatCompletions"},quota:{strategy:"unsupported",url:"https://ollama.com"},region:"local"}],zhipu:[{id:"api-platform",label:"API 平台",kind:"api-platform",lifecycle:"active",authModes:["apiKey"],productLabel:"智谱 AI",runtimeProviderIds:["zhipu"],credentialPrefixHints:["id."],consoleUrl:Rd,subscriptionUrl:"https://open.bigmodel.cn/finance-center/expense-manage",endpoints:[{protocol:"chatCompletions",baseUrl:k_,region:"cn"}],modelDiscovery:{strategy:"openaiCompatible",path:"/models",endpointProtocol:"chatCompletions"},quota:{strategy:"console",url:"https://open.bigmodel.cn/finance-center/expense-manage"},usagePolicyUrl:Cd,region:"cn"},{id:"coding-plan",label:"GLM Coding Plan",kind:"token-plan",lifecycle:"active",authModes:["apiKey"],productLabel:"智谱 AI",runtimeProviderIds:["zhipu"],credentialPrefixHints:["id."],consoleUrl:Rd,subscriptionUrl:"https://bigmodel.cn/glm-coding",endpoints:[{protocol:"chatCompletions",baseUrl:T_,region:"cn"}],modelDiscovery:{strategy:"openaiCompatible",path:"/models",endpointProtocol:"chatCompletions"},quota:{strategy:"subscription",url:"https://bigmodel.cn/glm-coding"},usagePolicyUrl:Cd,region:"cn"}]};function Md(e){return{id:e.id,label:e.label,kind:e.kind,lifecycle:"active",authModes:e.authModes,productLabel:e.productLabel,runtimeProviderIds:e.runtimeProviderIds,credentialPrefixHints:e.credentialPrefixHints,consoleUrl:e.consoleUrl,subscriptionUrl:e.subscriptionUrl,endpoints:xp(e.baseUrl,e.anthropicBaseUrl,"cn"),modelDiscovery:{strategy:"openaiCompatible",path:"/models",endpointProtocol:"chatCompletions"},quota:{strategy:e.quotaStrategy,url:e.quotaUrl},usagePolicyUrl:e.usagePolicyUrl,region:"cn"}}function po(e){return{id:e.id,label:e.label,lifecycle:"active",productLabel:"Alibaba Bailian",kind:e.kind,authModes:["apiKey"],runtimeProviderIds:e.runtimeProviderIds,credentialPrefixHints:e.credentialPrefixHints,consoleUrl:e.consoleUrl,subscriptionUrl:e.consoleUrl,endpoints:xp(e.baseUrl,e.anthropicBaseUrl,e.region),modelDiscovery:{strategy:"openaiCompatible",path:"/models",endpointProtocol:"chatCompletions"},quota:{strategy:e.quotaStrategy,url:e.consoleUrl},usagePolicyUrl:e.usagePolicyUrl,region:e.region}}function xp(e,t,r){return[{protocol:"chatCompletions",baseUrl:e,region:r},...t?[{protocol:"anthropic",baseUrl:t,region:r}]:[]]}function j_(e){return e.some(t=>t.health==="expired"||t.health==="invalid")?"attention":e.some(t=>t.enabled)?"available":e.length>0?"configured":"unconfigured"}function vi(e){switch(e){case"openai":return"OpenAI";case"anthropic":return"Anthropic";case"kimi":return"Kimi";case"bailian":return"百炼";case"deepseek":return"DeepSeek";case"zhipu":return"智谱 AI";case"ollama":return"Ollama";case"custom":return"Custom"}}function nn(e,t){return e==="openai"&&(t==="local"||t==="oauth"||t==="deviceCode")?"official-subscription":e==="kimi"&&(t==="oauth"||t==="deviceCode")?"subscription-key":e==="bailian"?"pay-as-you-go":e==="ollama"?"local":e==="custom"?"openai-compatible":"api-platform"}function Dd(e,t){const r=Ep(e).find(i=>i.id===(t??nn(e,"apiKey")));if(!r)return;const n=r.modelDiscovery?.endpointProtocol;return r.endpoints?.find(i=>i.protocol===n)?.baseUrl??r.endpoints?.[0]?.baseUrl}function N_(e,t,r,n){const i=li(e,t,r,n),o=ye(i?.apiKey);if(o)return o.length<=8?`${o.slice(0,2)}…`:`${o.slice(0,3)}...${o.slice(-4)}`}function li(e,t,r,n){if(!(typeof n!="string"||!n.trim()))try{const i=JSON.parse(n);if(i.algorithm!=="PLAINTEXT"||i.webId!==e.webId||i.provider!==t)return;const o=Ie.buildIri(e.podUrl,{id:r});if(i.credentialIri!==o)return;const a=i.encoding==="base64"?F_(String(i.ciphertext)):JSON.parse(String(i.ciphertext));return gt(a)}catch{return}}function F_(e){const t=atob(e),r=Uint8Array.from(t,n=>n.charCodeAt(0));return JSON.parse(new TextDecoder().decode(r))}function $l(e){const t=Vr(e),r=Pt(t);return r||_i.find(n=>t?.startsWith(`${n}-`))}function eu(e){const t=Vr(e);if(t&&!t.startsWith("custom-instance-")){if(t==="bailian-token-plan-personal")return"token-plan";if(t==="bailian-token-plan-team")return"token-plan-team";if(t==="bailian-coding-plan-pro")return"coding-plan";if(t==="bailian-pay-as-you-go")return"pay-as-you-go";for(const r of _i)if(t.startsWith(`${r}-`))return t.slice(r.length+1)}}function L_(e){const t=/\/([^/#]+)\.ttl#/u.exec(e);return Pt(t?.[1])}function Pt(e){if(typeof e!="string"||!e.trim())return;const t=e.trim().toLowerCase();if(t==="zhipu"||t.startsWith("zhipu-"))return"zhipu";if(_i.includes(t))return t;for(const r of _i)if(t.startsWith(`${r}-`)||r==="bailian"&&(t==="bailian-token-plan"||t==="bailian-coding-plan"))return r}function ms(e){if(e==null||!e.trim())return;let t;try{t=new URL(e.trim())}catch{throw new Error("invalid_proxy_url")}if(!["http:","https:"].includes(t.protocol)||t.username||t.password||t.hash||!t.hostname)throw new Error("invalid_proxy_url");return t.toString().replace(/\/$/u,"")}function U_(e){if(e==null||!e.trim())return;let t;try{t=new URL(e.trim())}catch{return}if(!(!["http:","https:"].includes(t.protocol)||!t.hostname))return t.username="",t.password="",t.search="",t.hash="",t.toString().replace(/\/$/u,"")}function mr(e){if(!e)return;const t=e.split("#",1)[0]??e,r=t.split("/").filter(Boolean).at(-1)??t;if(!r)return;const n=r.endsWith(".ttl")?r:`${r}.ttl`,i=e.indexOf("#");return i<0?n:`${n}${e.slice(i)}`}function Vr(e){const t=mr(e);if(t)return(t.split("#",1)[0]??t).replace(/\.ttl$/u,"")}function B_(e){if(e==="oauth"||e==="deviceCode"||e==="apiKey"||e==="local")return e;if(e==="deviceCodeOAuth")return"deviceCode"}function q_(e){if(e==="healthy"||e==="expired"||e==="invalid"||e==="unknown")return e;if(e==="reauthRequired")return"expired";if(e==="disabled")return"unknown"}function gt(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function ye(e){return typeof e=="string"&&e.trim()?e:void 0}function Pd(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()){const t=Number(e);return Number.isFinite(t)?t:void 0}}function kd(e){if(typeof e=="boolean")return e;if(e==="true")return!0;if(e==="false")return!1}function K_(e){return e instanceof Date?e.toISOString():ye(e)}function ln(e){return e!==void 0}const Ip=E0({renderToaster:!1}),Td=Ip.manifest.contributes.applets[0]?.appId,Rp=Td?Ip.applets[Td]:void 0;if(!Rp)throw new Error("AI Connection extension did not contribute an applet");const z_=Rp;function Od(e){switch(e.state.status){case"loading":return{status:"initializing"};case"anonymous":return{status:"anonymous"};case"authenticated":return{status:"authenticated",webId:e.state.webId};case"expired":return e.state.webId?{status:"expired",webId:e.state.webId}:{status:"expired"};case"error":return e.state.webId?{status:"error",webId:e.state.webId,error:e.state.error}:{status:"error",error:e.state.error}}}function W_(e,t){const r=qp({runtime:e}),n=e.currentPod?.podUrl??e.selectedStorage?.storageUrl??e.podUrl,i=e.currentPod?{status:"ready",current:e.currentPod}:e.podError?{status:"error",error:e.podError.error}:e.state.status==="authenticated"?{status:"opening"}:e.state.status==="error"?{status:"error",error:e.state.error}:{status:"unavailable"},o=window.fetch.bind(window);return{solid:{session:{getSnapshot:()=>Od(e),subscribe:a=>e.session.subscribe(()=>{a(Od(e))}),fetch:e.fetch},pod:i,permissions:{...Vg({fetch:e.fetch})},requireLogin:async()=>{await r.startLogin()}},navigation:{openExternal:async a=>{window.open(a,"_blank","noopener,noreferrer")}},capabilities:{aiClientCredentials:t?.controls?.account?.clientCredentials?x0({collection:t.controls.account.clientCredentials,accountIndex:t.idpIndex,fetch:o}):void 0,aiConnectionsPodStore:e.currentPod?s_({database:e.currentPod.database,authenticatedFetch:e.fetch,podUrl:e.currentPod.podUrl,webId:e.currentPod.webId}):void 0,aiClientConfiguration:n&&(globalThis.xpodDesktop!==void 0||e.aiClientConfiguration?.available===!0&&e.aiClientConfiguration.authority==="local-filesystem")?Vp({podUrl:n,controlPlaneOrigin:window.location.origin,authenticatedFetch:e.fetch,invocationFetch:o}):void 0}}}function H_(e){const t=Q.useContext(Bp),r=Q.useMemo(()=>W_(e,t),[e,t]);return Q.useMemo(()=>{const n=Zg(z_,r);if(n.layout!=="two-pane")throw new Error("AI Connection applet must use a two-pane layout");return n},[r])}function f2(){const e=Kp(),t=H_(e);return y.jsx(Gp,{listHeader:t.slots.listHeader,list:t.slots.list,mainHeader:t.slots.mainHeader,main:t.slots.main,mode:"auto"})}export{f2 as default};