@inkeep/open-knowledge 0.53.0-beta.0 → 0.53.0

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 (228) hide show
  1. package/dist/{acp-harness-probe-DvXLWBwm.mjs → acp-harness-probe-B5_ar7rl.mjs} +2 -2
  2. package/dist/assets/skills/project/references/linking.md +1 -1
  3. package/dist/cli.mjs +62 -62
  4. package/dist/constants-BGKDDuS6.mjs +2 -0
  5. package/dist/{git-handle-VuHcNtS4.mjs → git-handle-CH1DpBYP.mjs} +2 -2
  6. package/dist/git-handle-D_uW8fTU.mjs +1 -0
  7. package/dist/index.mjs +1 -1
  8. package/dist/{init-ja0T-etx.mjs → init-BGPdBpY7.mjs} +4 -4
  9. package/dist/init-CJLXPIkG.mjs +1 -0
  10. package/dist/{launch-json-removal-DaMY_ELf.mjs → launch-json-removal-BYbu5C86.mjs} +2 -2
  11. package/dist/{loader-CZJtDyW1.mjs → loader-ejjX_n1a.mjs} +2 -2
  12. package/dist/loader-gRh8KR8b.mjs +1 -0
  13. package/dist/md-manager-CUGZ0GRt.mjs +2 -0
  14. package/dist/{open-browser-BfbWvPXH.mjs → open-browser-CtVpc_8x.mjs} +2 -2
  15. package/dist/parse-worker.mjs +1 -1
  16. package/dist/preview-Ddz36Ink.mjs +1 -0
  17. package/dist/{preview-DZFeEN5M.mjs → preview-R6iAeACo.mjs} +2 -2
  18. package/dist/public/assets/{ActivityModeContent-BMqdsZEQ.js → ActivityModeContent-rgEhhGgw.js} +1 -1
  19. package/dist/public/assets/{AgentDiffPane-D_ubtipg.js → AgentDiffPane-DtG18o1u.js} +1 -1
  20. package/dist/public/assets/{AgentThreadClientBinder-B7pwGsKU.js → AgentThreadClientBinder-DkD2M_dd.js} +1 -1
  21. package/dist/public/assets/{BugReportHistory-CDRTpJV0.js → BugReportHistory-C59fSH13.js} +1 -1
  22. package/dist/public/assets/{BugReportHistoryDialog--YdGm_GJ.js → BugReportHistoryDialog-C2b4xA3d.js} +1 -1
  23. package/dist/public/assets/{ChangedOutsideBadge-4TgQdQOf.js → ChangedOutsideBadge-DdpCQcxq.js} +1 -1
  24. package/dist/public/assets/CodeMirrorPropInput-Cydg0jHr.js +3 -0
  25. package/dist/public/assets/{ConfigSharingInfoTooltip-CuqrTakc.js → ConfigSharingInfoTooltip-4T5uhyyt.js} +1 -1
  26. package/dist/public/assets/{ConsentDialogBody-CmMu4IpT.js → ConsentDialogBody-DfhGpXdb.js} +1 -1
  27. package/dist/public/assets/{DiffView-BcZip7m3.js → DiffView-C-imhjB8.js} +1 -1
  28. package/dist/public/assets/DocumentContext-BN8gSwJ-.js +38 -0
  29. package/dist/public/assets/{EditorModeToggle-CFFhQhHA.js → EditorModeToggle-CrnEz11k.js} +1 -1
  30. package/dist/public/assets/{EnableSyncConfirmDialog-BiThAkoH.js → EnableSyncConfirmDialog-623sSYbd.js} +1 -1
  31. package/dist/public/assets/FeedbackForm-CiQQiFp-.js +1 -0
  32. package/dist/public/assets/{GraphPanel-CsRKre3D.js → GraphPanel-C-3KrSdC.js} +1 -1
  33. package/dist/public/assets/{ImportSkillDialog-DcZoBHf-.js → ImportSkillDialog-B7gKx_GY.js} +1 -1
  34. package/dist/public/assets/{LintConfigEditor--yFdaWpg.js → LintConfigEditor-B-XaVu0m.js} +1 -1
  35. package/dist/public/assets/ManagedArtifactProperties-CUMQh4tz.js +1 -0
  36. package/dist/public/assets/{ManagedArtifactProperties-CIVfnd15.js → ManagedArtifactProperties-iclZPRJv.js} +1 -1
  37. package/dist/public/assets/{McpConsentDialogBody-DEhSeOSg.js → McpConsentDialogBody-BS3RE3LY.js} +1 -1
  38. package/dist/public/assets/{Mermaid-mUyEEsA0.js → Mermaid-BHfANkja.js} +1 -1
  39. package/dist/public/assets/{MermaidDocEditor-civq6mkL.js → MermaidDocEditor-CI90q10w.js} +1 -1
  40. package/dist/public/assets/{RegisteredAgentIcon-BxpJAHOj.js → RegisteredAgentIcon-gjOJZp_B.js} +1 -1
  41. package/dist/public/assets/{ReportBugDialogBody-DO7eotFd.js → ReportBugDialogBody-BWXO0gto.js} +1 -1
  42. package/dist/public/assets/{SchemaConfigEditor-NxaI-Jdd.js → SchemaConfigEditor-eh-ijdLu.js} +1 -1
  43. package/dist/public/assets/{SessionsHost-PjSsebux.js → SessionsHost-BOgQOcv6.js} +2 -2
  44. package/dist/public/assets/SettingsDialogBody-BaYDHshm.js +12 -0
  45. package/dist/public/assets/{ShareBranchSwitchDialog-B7Bl6qR0.js → ShareBranchSwitchDialog-DpmQmmrq.js} +1 -1
  46. package/dist/public/assets/{ShareReceiveDialog-BmMkjWTr.js → ShareReceiveDialog-C3fS1Ax2.js} +1 -1
  47. package/dist/public/assets/{ShareReceiveMissDialog-R20sy2ia.js → ShareReceiveMissDialog-DzeOwnyS.js} +1 -1
  48. package/dist/public/assets/{SkillEditBanner-B2U7UdOB.js → SkillEditBanner-DGB_nnDm.js} +1 -1
  49. package/dist/public/assets/{SkillOriginInline-B3wOLT3t.js → SkillOriginInline-C4x3nMIH.js} +1 -1
  50. package/dist/public/assets/{SkillToolbarControls-B_RJpm5V.js → SkillToolbarControls-DXBGIWug.js} +1 -1
  51. package/dist/public/assets/{SlidesToolbarControls-56-P71vE.js → SlidesToolbarControls-Buv-SEot.js} +1 -1
  52. package/dist/public/assets/{SourceEditor-BW7yuIvG.js → SourceEditor-B64VJl_F.js} +1 -1
  53. package/dist/public/assets/{TerminalPanel-Clr6j-jo.js → TerminalPanel-Bch10p1r.js} +3 -3
  54. package/dist/public/assets/{TerminalWindowApp-DRbYHuvS.js → TerminalWindowApp-s4mNyUki.js} +1 -1
  55. package/dist/public/assets/{TextDocEditor-Bwwrrcn5.js → TextDocEditor-DtDvo7eF.js} +1 -1
  56. package/dist/public/assets/{ThreadView-BA7gxPI6.js → ThreadView-CGOz1ms_.js} +2 -2
  57. package/dist/public/assets/{TimelineDiffPane-CTJnk9me.js → TimelineDiffPane-B7aD7QN-.js} +1 -1
  58. package/dist/public/assets/{agent-diff-store-BvxTke2d.js → agent-diff-store-BJiYj2BI.js} +1 -1
  59. package/dist/public/assets/{auth-state-cache-DrAhOPTB.js → auth-state-cache-5wocICj2.js} +3 -3
  60. package/dist/public/assets/{checkbox-Bxl4H4lV.js → checkbox-vidgONxv.js} +1 -1
  61. package/dist/public/assets/client-version---DsZj2h.js +1 -0
  62. package/dist/public/assets/{cm-theme-BygK2tYf.js → cm-theme-DZT10ikr.js} +1 -1
  63. package/dist/public/assets/{comment-chips-W2ozPSpm.js → comment-chips-BjkVSykR.js} +1 -1
  64. package/dist/public/assets/{config-provider-DamFbxl8.js → config-provider-DGQwNZtP.js} +3 -3
  65. package/dist/public/assets/{dialog-R8GugqUq.js → dialog-DztIj-ZS.js} +1 -1
  66. package/dist/public/assets/{dist-BZW14CKf.js → dist-BRmJz2fY.js} +1 -1
  67. package/dist/public/assets/{dist-DRufJFR7.js → dist-BVpMlVG3.js} +1 -1
  68. package/dist/public/assets/{dist-BE8rPie-.js → dist-BgBcg3TP.js} +1 -1
  69. package/dist/public/assets/{dist-Dm-VLxvd.js → dist-BiwzWInZ.js} +1 -1
  70. package/dist/public/assets/{dist-BR5M-SiF.js → dist-CkFATl39.js} +1 -1
  71. package/dist/public/assets/{dist-Cfmj7R4I.js → dist-DM6osNK2.js} +1 -1
  72. package/dist/public/assets/{dist-DBhufbLS.js → dist-DQyQPRvE.js} +1 -1
  73. package/dist/public/assets/{dist-BTo1AB3U.js → dist-DfLFtHzK.js} +1 -1
  74. package/dist/public/assets/{dist-CUhsr-gg.js → dist-DsH7eETa.js} +1 -1
  75. package/dist/public/assets/{dist-ILlrHFKs.js → dist-GenOktAv.js} +183 -183
  76. package/dist/public/assets/{dist-CcIAtWVJ.js → dist-dO0W-CVt.js} +1 -1
  77. package/dist/public/assets/{dist-D7MIhDGJ.js → dist-ofeGnIBD.js} +1 -1
  78. package/dist/public/assets/{dist-CElLQlwI.js → dist-z-y_5Bgj.js} +1 -1
  79. package/dist/public/assets/{doc-paths-DAh95jxf.js → doc-paths-CB3USVY1.js} +1 -1
  80. package/dist/public/assets/{documents-events-CCW6R-r2.js → documents-events-rgFBXE2Z.js} +1 -1
  81. package/dist/public/assets/{file-tree-adapter-Bf1ZqkPA.js → file-tree-adapter-4JTjxhHS.js} +1 -1
  82. package/dist/public/assets/{file-tree-utils-CgJ4lrP9.js → file-tree-utils-CYn1f82_.js} +1 -1
  83. package/dist/public/assets/{folder-config-api-CKV5STj1.js → folder-config-api-ByqyyP9w.js} +1 -1
  84. package/dist/public/assets/follow-file-kuGZjRsi.js +4 -0
  85. package/dist/public/assets/globals-tIUZlcbW.css +1 -0
  86. package/dist/public/assets/i18n-CrYaxckE.js +1 -0
  87. package/dist/public/assets/{index-qtxLhYJO.js → index-DmXrGqKD.js} +17 -17
  88. package/dist/public/assets/{input-group-ClrIuhWi.js → input-group-BiaQ-rIw.js} +1 -1
  89. package/dist/public/assets/{lint-config-client-xawAT1mQ.js → lint-config-client-DydgEnDK.js} +1 -1
  90. package/dist/public/assets/lint-plugin-meta-FPoTE-0t.js +1 -0
  91. package/dist/public/assets/{markdownlint-rule-browser-B3UPVPG_.js → markdownlint-rule-browser-DwEGxp2H.js} +1 -1
  92. package/dist/public/assets/messages-7cAk2vbZ.js +1 -0
  93. package/dist/public/assets/messages-BNv51jKY.js +1 -0
  94. package/dist/public/assets/messages-BS_zCLy8.js +1 -0
  95. package/dist/public/assets/messages-BmYExk_R.js +1 -0
  96. package/dist/public/assets/messages-C3vvvgBK.js +1 -0
  97. package/dist/public/assets/messages-CmD7dBQ3.js +1 -0
  98. package/dist/public/assets/messages-CpVNkvrj.js +1 -0
  99. package/dist/public/assets/messages-CxF28E4J.js +1 -0
  100. package/dist/public/assets/messages-D9UyuwOS.js +1 -0
  101. package/dist/public/assets/messages-DQ5yKIrs.js +1 -0
  102. package/dist/public/assets/messages-DdBrUUBf.js +1 -0
  103. package/dist/public/assets/navigation-targets-iVnea4YK.js +1 -0
  104. package/dist/public/assets/{open-managed-artifact-tab-G7xdjHph.js → open-managed-artifact-tab-DpfEVLG-.js} +1 -1
  105. package/dist/public/assets/{pending-receive-nav-store-CpVItLnx.js → pending-receive-nav-store-BHeTqy0Z.js} +1 -1
  106. package/dist/public/assets/{project-paths-DOOtPmjl.js → project-paths-_w2mRvRX.js} +1 -1
  107. package/dist/public/assets/prop-types-ClS-DLuz.js +1 -0
  108. package/dist/public/assets/{receive-store-BrOspwat.js → receive-store-R5sEQn80.js} +1 -1
  109. package/dist/public/assets/{schema-fields-view-intent-D0jz38_6.js → schema-fields-view-intent-DiE8NL9y.js} +1 -1
  110. package/dist/public/assets/{selection-context-nm7zlSXJ.js → selection-context-CHJ-gfRx.js} +1 -1
  111. package/dist/public/assets/{skill-actions-e3PRoOA3.js → skill-actions-B9BGbzJZ.js} +2 -2
  112. package/dist/public/assets/{skill-scope-8PP6d5Gw.js → skill-scope-CFwClOyk.js} +1 -1
  113. package/dist/public/assets/{skills-api-DQ0PK-8O.js → skills-api-B41p5sp3.js} +1 -1
  114. package/dist/public/assets/{src-BKQkpwCc.js → src-gXOrH5MP.js} +1 -1
  115. package/dist/public/assets/{tag-pill-input-BHj2SAnj.js → tag-pill-input-BTKlFD92.js} +1 -1
  116. package/dist/public/assets/{target-navigation-intent-DpIU3fe6.js → target-navigation-intent-CIjVZTkZ.js} +1 -1
  117. package/dist/public/assets/{telemetry-impl-Byic_ID0.js → telemetry-impl-Bvv5kEhb.js} +1 -1
  118. package/dist/public/assets/{telemetry-startup-D_ttbNLC.js → telemetry-startup-C8JOSRcr.js} +1 -1
  119. package/dist/public/assets/{terminal-cli-display-CgJpdKCI.js → terminal-cli-display-CW7j5kqb.js} +1 -1
  120. package/dist/public/assets/{terminal-launch-events-DQ0KtteM.js → terminal-launch-events-CW7Dk9L6.js} +1 -1
  121. package/dist/public/assets/{terminal-telemetry-CE1yzjKD.js → terminal-telemetry-CxkpCpp5.js} +1 -1
  122. package/dist/public/assets/{text-viewer-languages-epnUVwhY.js → text-viewer-languages-oVDGEYYY.js} +2 -2
  123. package/dist/public/assets/{typing-burst-detector-B6UhFT8T.js → typing-burst-detector-fIHJv2J1.js} +4 -4
  124. package/dist/public/assets/{uninstall-BE8yLKij.js → uninstall-CYpAgTNE.js} +1 -1
  125. package/dist/public/assets/{use-activity-panel-CF6Guvjl.js → use-activity-panel-BEnqyFcJ.js} +1 -1
  126. package/dist/public/assets/{use-apply-config-color-theme-BatIDUX7.js → use-apply-config-color-theme-Dw8J4H8Z.js} +1 -1
  127. package/dist/public/assets/{use-collab-url-7XE2_0_k.js → use-collab-url-CbdhvhFJ.js} +1 -1
  128. package/dist/public/assets/{use-live-xterm-theme-DS89T4Os.js → use-live-xterm-theme-B_qB957b.js} +1 -1
  129. package/dist/public/assets/{use-open-skill-CtzMj-sg.js → use-open-skill-Ca4D1I53.js} +1 -1
  130. package/dist/public/assets/{use-popular-skills-BY0ulPzk.js → use-popular-skills-ByV4BHXd.js} +1 -1
  131. package/dist/public/assets/{use-settings-route-DN0TWdfX.js → use-settings-route-4qI--CpZ.js} +1 -1
  132. package/dist/public/assets/{use-skill-origin-COh1_mOK.js → use-skill-origin-DGj0sj4C.js} +1 -1
  133. package/dist/public/assets/{use-skills-C_HuRxth.js → use-skills-WWbAKl3q.js} +1 -1
  134. package/dist/public/assets/{use-terminal-enabled-CIQB6jgW.js → use-terminal-enabled-Dz_qAFuD.js} +1 -1
  135. package/dist/public/assets/use-timeline-entry-diff-RrvwSA9l.js +6 -0
  136. package/dist/public/assets/{use-workspace-CNCW4CS8.js → use-workspace-BRfhPAI8.js} +1 -1
  137. package/dist/public/index.html +104 -104
  138. package/dist/public/uninstall.html +12 -12
  139. package/dist/{repair-launch-json-D0g7JIQF.mjs → repair-launch-json-D4L6s57C.mjs} +2 -2
  140. package/dist/{repair-mcp-configs-hbX7fywV.mjs → repair-mcp-configs-1m14wb_8.mjs} +2 -2
  141. package/dist/{repair-skills-BVCJQr-D.mjs → repair-skills-Dn9wtbHi.mjs} +2 -2
  142. package/dist/repair-skills-cJ41S9pk.mjs +1 -0
  143. package/dist/server-lock-CTrzO_5l.mjs +1 -0
  144. package/dist/{server-lock-CeKMy65H.mjs → server-lock-D8tFCW-G.mjs} +2 -2
  145. package/dist/{skill-teardown-CybJJo-5.mjs → skill-teardown-riJHlPak.mjs} +2 -2
  146. package/dist/{src--OhnhRml.mjs → src-BVxZYLJj.mjs} +328 -328
  147. package/dist/src-CclRwMug.mjs +1 -0
  148. package/dist/{src-3gxGmFyn.mjs → src-CeMQBLDa.mjs} +1 -1
  149. package/dist/{src-DNgZpbWL.mjs → src-ISYL0cXX.mjs} +4 -4
  150. package/dist/{src-Dj6UxpKM.mjs → src-RGB2pEts.mjs} +124 -124
  151. package/dist/start-8PynebPz.mjs +1 -0
  152. package/dist/start-DqsRiUST.mjs +12 -0
  153. package/dist/{ui-DXs7IMUP.mjs → ui-CyO6JCpp.mjs} +3 -3
  154. package/dist/{write-project-skill-B4M4CzQe.mjs → write-project-skill-Bx22NW0a.mjs} +3 -3
  155. package/package.json +5 -5
  156. package/dist/constants-GVvlP0F1.mjs +0 -2
  157. package/dist/git-handle-CEoe8TIl.mjs +0 -1
  158. package/dist/init-CXnCnSQu.mjs +0 -1
  159. package/dist/loader-zzsiCoMM.mjs +0 -1
  160. package/dist/md-manager-45eVlaBq.mjs +0 -2
  161. package/dist/preview-BqJFFDSI.mjs +0 -1
  162. package/dist/public/assets/CodeMirrorPropInput-CjgqNZXo.js +0 -3
  163. package/dist/public/assets/DocumentContext-tOm4SkOp.js +0 -38
  164. package/dist/public/assets/FeedbackForm-tTwFtkKO.js +0 -1
  165. package/dist/public/assets/ManagedArtifactProperties-Bb9ghWb1.js +0 -1
  166. package/dist/public/assets/SettingsDialogBody-BNYz-D4X.js +0 -12
  167. package/dist/public/assets/client-version-DFQNNQh_.js +0 -1
  168. package/dist/public/assets/follow-file-D0HdtSlc.js +0 -4
  169. package/dist/public/assets/globals-CZFxK0Rt.css +0 -1
  170. package/dist/public/assets/i18n-CUKvPzxt.js +0 -1
  171. package/dist/public/assets/lint-plugin-meta-CsGPauME.js +0 -1
  172. package/dist/public/assets/messages-BD6xU0hl.js +0 -1
  173. package/dist/public/assets/messages-BrOihCC2.js +0 -1
  174. package/dist/public/assets/messages-CeGZ3qGI.js +0 -1
  175. package/dist/public/assets/messages-DLAxD4Ea.js +0 -1
  176. package/dist/public/assets/messages-DiRAd1Pa.js +0 -1
  177. package/dist/public/assets/messages-DoSs73jK.js +0 -1
  178. package/dist/public/assets/messages-FGGtYX0Z.js +0 -1
  179. package/dist/public/assets/messages-QNJusJtV.js +0 -1
  180. package/dist/public/assets/messages-T7J7xjCi.js +0 -1
  181. package/dist/public/assets/messages-rE7VifgH.js +0 -1
  182. package/dist/public/assets/messages-zscDryNK.js +0 -1
  183. package/dist/public/assets/navigation-targets-C1boWExT.js +0 -1
  184. package/dist/public/assets/prop-types-BIrEWnOv.js +0 -1
  185. package/dist/public/assets/use-timeline-entry-diff-CDFU16yg.js +0 -6
  186. package/dist/repair-skills-BmAntgZP.mjs +0 -1
  187. package/dist/server-lock-CDm0H6LS.mjs +0 -1
  188. package/dist/src-BqNFscyh.mjs +0 -1
  189. package/dist/start-DYelgMjm.mjs +0 -1
  190. package/dist/start-xJV4Y-0A.mjs +0 -12
  191. /package/dist/public/assets/{CopyButton-CKyZY1PL.js → CopyButton-ByR_1gcU.js} +0 -0
  192. /package/dist/public/assets/{asset-dispatch-Ccnji1rt.js → asset-dispatch-Cz1weVX3.js} +0 -0
  193. /package/dist/public/assets/{auth-prompt-store-C4YJf5De.js → auth-prompt-store-BYOv6_8O.js} +0 -0
  194. /package/dist/public/assets/{badge-BYteLKha.js → badge-DFX4S3a5.js} +0 -0
  195. /package/dist/public/assets/{copilot-CmkvU8CH.js → copilot-Dh1BU6kS.js} +0 -0
  196. /package/dist/public/assets/{cursor-CIl_AjI1.js → cursor-B6reg1lS.js} +0 -0
  197. /package/dist/public/assets/{dist-sSZdzHur.js → dist-DAqA-GDU.js} +0 -0
  198. /package/dist/public/assets/{documents-fetch-DnpUYK4R.js → documents-fetch-CV8lWh8v.js} +0 -0
  199. /package/dist/public/assets/{download-Dn5ulvxm.js → download-C3PYuI1f.js} +0 -0
  200. /package/dist/public/assets/{external-link-3El87eIe.js → external-link-BIMZpgNa.js} +0 -0
  201. /package/dist/public/assets/{eye-DmhHKPNd.js → eye-CSz7ogHo.js} +0 -0
  202. /package/dist/public/assets/{field-CvwbVfuf.js → field-CtVP3IIV.js} +0 -0
  203. /package/dist/public/assets/{file-tree-rename-validation-C2Ibtqn6.js → file-tree-rename-validation-CCqiFGp1.js} +0 -0
  204. /package/dist/public/assets/{folder-CWlDik9N.js → folder-CopDpuy5.js} +0 -0
  205. /package/dist/public/assets/{folder-open-BTTec8yg.js → folder-open-DUSc8NL8.js} +0 -0
  206. /package/dist/public/assets/{globals-CfOSCw3_.js → globals-CLY_4Hw9.js} +0 -0
  207. /package/dist/public/assets/{hash-PyoMEEnH.js → hash-DI30zEBt.js} +0 -0
  208. /package/dist/public/assets/{info-w0kv2CeC.js → info-CV59RycV.js} +0 -0
  209. /package/dist/public/assets/{input-BFt4qZaV.js → input-BYiOK210.js} +0 -0
  210. /package/dist/public/assets/{list-plus-2r7_ATZj.js → list-plus-DBdmIc6v.js} +0 -0
  211. /package/dist/public/assets/{minus-DNhR60ON.js → minus-D07ZsfDZ.js} +0 -0
  212. /package/dist/public/assets/{miss-dialog-store-DzXIxgCB.js → miss-dialog-store-sSyy54tn.js} +0 -0
  213. /package/dist/public/assets/{panel-D2VXQC58.js → panel-CbGx_cRv.js} +0 -0
  214. /package/dist/public/assets/{panel-right-open-DAyUhiQN.js → panel-right-open-B66oA9M1.js} +0 -0
  215. /package/dist/public/assets/{paperclip-B6sgPA4f.js → paperclip-BlKB6Xwa.js} +0 -0
  216. /package/dist/public/assets/{refresh-cw-CR2QWccs.js → refresh-cw-DQervzDZ.js} +0 -0
  217. /package/dist/public/assets/{spinner-CHTY-VE-.js → spinner-BqySY7qY.js} +0 -0
  218. /package/dist/public/assets/{square-pen-DdAKbKU7.js → square-pen-Cb57Y3fg.js} +0 -0
  219. /package/dist/public/assets/{startup-marks-CTM7uDIJ.js → startup-marks-Cdkh8q3E.js} +0 -0
  220. /package/dist/public/assets/{stex-s_JxeNEZ.js → stex-PMopVeEZ.js} +0 -0
  221. /package/dist/public/assets/{terminal-DRi0ugpC.js → terminal-Cvoe7pfU.js} +0 -0
  222. /package/dist/public/assets/{textarea-CzW0aR0j.js → textarea-yZk4yd9U.js} +0 -0
  223. /package/dist/public/assets/{trash-2-BWJWOK8-.js → trash-2-N0ilsnnr.js} +0 -0
  224. /package/dist/public/assets/{triangle-alert-DV20-jn9.js → triangle-alert-COo6wbUK.js} +0 -0
  225. /package/dist/public/assets/{undo-2-CMyZc9mZ.js → undo-2-WGCwknr8.js} +0 -0
  226. /package/dist/public/assets/{use-installed-clis-DmyaQmU9.js → use-installed-clis-Cydpb5jd.js} +0 -0
  227. /package/dist/public/assets/{wrench-C3BL-uHg.js → wrench-CP2MIQHF.js} +0 -0
  228. /package/dist/public/assets/{x-BaJrHZK_.js → x-DS57FvHW.js} +0 -0
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./__vite-browser-external-DD8Jl_VU.js","./chunk-CYidjpOJ.js"])))=>i.map(i=>d[i]);
2
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{a as n,c as r,d as i,f as a,i as o,l as s,n as c,o as l,p as u,r as d,t as f,u as p}from"./trace-api-18gcBe0u.js";import{n as m,r as ee,t as h}from"./propagation-api-PBYTadVM.js";var te=class{constructor(){}createGauge(e,t){return fe}createHistogram(e,t){return pe}createCounter(e,t){return de}createUpDownCounter(e,t){return me}createObservableGauge(e,t){return ge}createObservableCounter(e,t){return he}createObservableUpDownCounter(e,t){return _e}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},g=class{},ne=class extends g{add(e,t){}},re=class extends g{add(e,t){}},ie=class extends g{record(e,t){}},ae=class extends g{record(e,t){}},oe=class{addCallback(e){}removeCallback(e){}},se=class extends oe{},ce=class extends oe{},le=class extends oe{},ue=new te,de=new ne,fe=new ie,pe=new ae,me=new re,he=new se,ge=new ce,_e=new le;function ve(){return ue}var ye;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(ye||={});var be;(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(be||={});var _=p.instance(),xe=new class{getMeter(e,t,n){return ue}},Se=`metrics`,Ce=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalMeterProvider(e){return a(Se,e,p.instance())}getMeterProvider(){return i(Se)||xe}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){u(Se,p.instance())}}.getInstance(),we=class{_delegate;constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}},Te=class extends Error{code;name=`OTLPExporterError`;data;constructor(e,t,n){super(e),this.data=n,this.code=t}};function Ee(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function De(e){if(e!=null)return()=>e}function Oe(e,t,n){return{timeoutMillis:Ee(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}function ke(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}var Ae=class{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw Error(`Concurrency Limit reached`);this._sendingPromises.push(e);let t=()=>{let t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}};function je(e){return new Ae(e.concurrencyLimit)}var Me=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},Ne=performance,Pe=`http.url`,Fe=`http.user_agent`,Ie=Pe,Le=Fe,Re=`deployment.environment.name`,ze=`error.type`,Be=`exception.message`,Ve=`exception.stacktrace`,He=`exception.type`,Ue=`http.request.method`,We=`http.request.method_original`,Ge=`http.response.status_code`,Ke=`server.address`,qe=`server.port`,Je=`service.name`,Ye=`service.version`,Xe=`telemetry.sdk.language`,Ze=`webjs`,Qe=`telemetry.sdk.name`,$e=`telemetry.sdk.version`,et=`url.full`,tt=9,nt=10**6,rt=10**tt;function v(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*nt)]}function it(){let e=Ne.timeOrigin;if(typeof e!=`number`){let t=Ne;e=t.timing&&t.timing.fetchStart}return e}function at(e){return st(v(it()),v(typeof e==`number`?e:Ne.now()))}function y(e){if(ot(e))return e;if(typeof e==`number`)return e<it()?at(e):v(e);if(e instanceof Date)return v(e.getTime());throw TypeError(`Invalid input type`)}function b(e){return e[0]*rt+e[1]}function ot(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function st(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=rt&&(n[1]-=rt,n[0]+=1),n}var x;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(x||={});function ct(e,t){return typeof t==`string`?e===t:!!e.match(t)}function lt(e,t){if(!t)return!1;for(let n of t)if(ct(e,n))return!0;return!1}function ut(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function dt(){return{handleResponse(e){e==null||!ut(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||_.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}var ft=class{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,t,n,r,i){this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=i,this._diagLogger=_.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:x.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:x.FAILED,error:Error(`Nothing to send`)});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if(e.status===`success`){if(e.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn(`Export succeeded but could not deserialize response - is the response specification compliant?`,t,e.data)}t({code:x.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:x.FAILED,error:e.error});return}else e.status===`retryable`?t({code:x.FAILED,error:new Te(`Export failed with retryable status`)}):t({code:x.FAILED,error:new Te(`Export failed with unknown error`)})},e=>t({code:x.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug(`shutdown started`),await this.forceFlush(),this._transport.shutdown()}};function pt(e,t){return new ft(e.transport,e.serializer,dt(),e.promiseHandler,t.timeout)}function mt(e,t,n){return pt({transport:n,serializer:t,promiseHandler:je(e)},{timeout:e.timeoutMillis})}function ht(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function gt(e){let t=new Uint8Array(e.length/2),n=0;for(let r=0;r<e.length;r+=2){let i=ht(e.charCodeAt(r)),a=ht(e.charCodeAt(r+1));t[n++]=i<<4|a}return t}function _t(e){let t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}function vt(e){return{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}function yt(e){return vt(_t(e))}function bt(e){return _t(e).toString()}var xt=typeof BigInt<`u`?bt:b;function St(e){return e}function Ct(e){if(e!==void 0)return gt(e)}var wt={encodeHrTime:yt,encodeSpanContext:gt,encodeOptionalSpanContext:Ct};function Tt(e){if(e===void 0)return wt;let t=e.useLongBits??!0,n=e.useHex??!1;return{encodeHrTime:t?yt:xt,encodeSpanContext:n?St:gt,encodeOptionalSpanContext:n?St:Ct}}function Et(e){let t={attributes:S(e.attributes),droppedAttributesCount:0},n=e.schemaUrl;return n&&n!==``&&(t.schemaUrl=n),t}function Dt(e){return{name:e.name,version:e.version}}function S(e){return Object.keys(e).map(t=>Ot(t,e[t]))}function Ot(e,t){return{key:e,value:kt(t)}}function kt(e){let t=typeof e;return t===`string`?{stringValue:e}:t===`number`?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:t===`boolean`?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(kt)}}:t===`object`&&e!=null?{kvlistValue:{values:Object.entries(e).map(([e,t])=>Ot(e,t))}}:{}}function At(e,t){let n=e.spanContext(),r=e.status,i=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(n.traceId),spanId:t.encodeSpanContext(n.spanId),parentSpanId:i,traceState:n.traceState?.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:S(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>Mt(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>jt(e,t)),droppedLinksCount:e.droppedLinksCount}}function jt(e,t){return{attributes:e.attributes?S(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}function Mt(e,t){return{attributes:e.attributes?S(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function Nt(e,t){return{resourceSpans:Ft(e,Tt(t))}}function Pt(e){let t=new Map;for(let n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));let r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||``}:${n.instrumentationScope.schemaUrl||``}`,i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}function Ft(e,t){let n=Pt(e),r=[],i=n.entries(),a=i.next();for(;!a.done;){let[e,n]=a.value,o=[],s=n.values(),c=s.next();for(;!c.done;){let e=c.value;if(e.length>0){let n=e.map(e=>At(e,t));o.push({scope:Dt(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=Et(e),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}var It={serializeRequest:e=>{let t=Nt(e,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;return JSON.parse(t.decode(e))}},Lt=5,Rt=1e3,zt=5e3,Bt=1.5,Vt=.2;function Ht(){return 2*Vt*Math.random()-Vt}var Ut=class{_transport;constructor(e){this._transport=e}retry(e,t,n){return new Promise((r,i)=>{setTimeout(()=>{this._transport.send(e,t).then(r,i)},n)})}async send(e,t){let n=Date.now()+t,r=await this._transport.send(e,t),i=Lt,a=Rt;for(;r.status===`retryable`&&i>0;){i--;let t=Math.max(Math.min(a,zt)+Ht(),0);a*=Bt;let o=r.retryInMillis??t,s=n-Date.now();if(o>s)return r;r=await this.retry(e,s,o)}return r}shutdown(){return this._transport.shutdown()}};function Wt(e){return new Ut(e.transport)}function Gt(e){return[429,502,503,504].includes(e)}function Kt(e){if(e==null)return;let t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;let n=new Date(e).getTime()-Date.now();return n>=0?n:0}var qt=class{_parameters;constructor(e){this._parameters=e}send(e,t){return new Promise(n=>{let r=new XMLHttpRequest;r.timeout=t,r.open(`POST`,this._parameters.url);let i=this._parameters.headers();Object.entries(i).forEach(([e,t])=>{r.setRequestHeader(e,t)}),r.ontimeout=e=>{n({status:`failure`,error:Error(`XHR request timed out`)})},r.onreadystatechange=()=>{r.status>=200&&r.status<=299?(_.debug(`XHR success`),n({status:`success`})):r.status&&Gt(r.status)?n({status:`retryable`,retryInMillis:Kt(r.getResponseHeader(`Retry-After`))}):r.status!==0&&n({status:`failure`,error:Error(`XHR request failed with non-retryable status`)})},r.onabort=()=>{n({status:`failure`,error:Error(`XHR request aborted`)})},r.onerror=()=>{n({status:`failure`,error:Error(`XHR request errored`)})},r.send(e)})}shutdown(){}};function Jt(e){return new qt(e)}var Yt=class{_params;constructor(e){this._params=e}send(e){return new Promise(t=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(_.debug(`SendBeacon success`),t({status:`success`})):t({status:`failure`,error:Error(`SendBeacon failed`)})})}shutdown(){}};function Xt(e){return new Yt(e)}var Zt=class{_parameters;constructor(e){this._parameters=e}async send(e,t){let n=new AbortController,r=setTimeout(()=>n.abort(),t);try{let t=!!globalThis.location,r=new URL(this._parameters.url),i=await fetch(r.href,{method:`POST`,headers:this._parameters.headers(),body:e,signal:n.signal,keepalive:t,mode:t?globalThis.location?.origin===r.origin?`same-origin`:`cors`:`no-cors`});return i.status>=200&&i.status<=299?(_.debug(`response success`),{status:`success`}):Gt(i.status)?{status:`retryable`,retryInMillis:Kt(i.headers.get(`Retry-After`))}:{status:`failure`,error:Error(`Fetch request failed with non-retryable status`)}}catch(e){return e?.name===`AbortError`?{status:`failure`,error:Error(`Fetch request timed out`,{cause:e})}:{status:`failure`,error:Error(`Fetch request errored`,{cause:e})}}finally{clearTimeout(r)}}shutdown(){}};function Qt(e){return new Zt(e)}function $t(e,t){return mt(e,t,Wt({transport:Jt(e)}))}function en(e,t){return mt(e,t,Wt({transport:Qt(e)}))}function tn(e,t){return mt(e,t,Wt({transport:Xt({url:e.url,blobType:e.headers()[`Content-Type`]})}))}function nn(e){return()=>{let t={};return Object.entries(e?.()??{}).forEach(([e,n])=>{n===void 0?_.warn(`Header "${e}" has invalid value (${n}) and will be ignored`):t[e]=String(n)}),t}}function rn(e,t,n){let r={...n()},i={};return()=>(t!=null&&Object.assign(i,t()),e!=null&&Object.assign(i,e()),Object.assign(i,r))}function an(e){if(e!=null)try{let t=globalThis.location?.href;return new URL(e,t).href}catch{throw Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function on(n){return async r=>{let{Agent:i}=await t(()=>import(`./__vite-browser-external-DD8Jl_VU.js`).then(t=>e(t.default)),__vite__mapDeps([0,1]),import.meta.url);return new i(n)}}function sn(e,t,n){return{...Oe(e,t,n),headers:rn(nn(e.headers),t.headers,n.headers),url:an(e.url)??t.url??n.url,agentFactory:e.agentFactory??t.agentFactory??n.agentFactory}}function cn(e,t){return{...ke(),headers:()=>e,url:`http://localhost:4318/`+t,agentFactory:on({keepAlive:!0})}}function ln(e,t,n){return sn({url:e.url,timeoutMillis:e.timeoutMillis,headers:De(e.headers),concurrencyLimit:e.concurrencyLimit},{},cn(n,t))}function un(e,t,n,r){return dn(e.headers)(ln(e,n,r),t)}function dn(e){return!e&&typeof navigator.sendBeacon==`function`?tn:globalThis.fetch===void 0?$t:en}var fn=class extends we{constructor(e={}){super(un(e,It,`v1/traces`,{"Content-Type":`application/json`}))}},pn=class{emit(e){}},mn=new pn,hn=new class{getLogger(e,t,n){return new pn}},gn=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):mn}},_n=class{getLogger(e,t,n){return this._getDelegateLogger(e,t,n)??new gn(this,e,t,n)}_getDelegate(){return this._delegate??hn}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}},vn=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},C=Symbol.for(`io.opentelemetry.js.api.logs`),w=vn;function yn(e,t,n){return r=>r===e?t:n}var bn=class e{constructor(){this._proxyLoggerProvider=new _n}static getInstance(){return this._instance||=new e,this._instance}setGlobalLoggerProvider(e){return w[C]?this.getLoggerProvider():(w[C]=yn(1,e,hn),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return w[C]?.call(w,1)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete w[C],this._proxyLoggerProvider=new _n}}.getInstance();function xn(e,t,n,r){for(let i=0,a=e.length;i<a;i++){let a=e[i];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}function Sn(e){e.forEach(e=>e.disable())}function Cn(e){let t=e.tracerProvider||f.getTracerProvider(),n=e.meterProvider||Ce.getMeterProvider(),r=e.loggerProvider||bn.getLoggerProvider(),i=e.instrumentations?.flat()??[];return xn(i,t,n,r),()=>{Sn(i)}}var T=console.error.bind(console);function E(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}var wn=(e,t,n)=>{if(!e||!e[t]){T(`no original function `+String(t)+` to wrap`);return}if(!n){T(`no wrapper function`),T(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){T(`original object and wrapper must be functions`);return}let i=n(r,t);return E(i,`__original`,r),E(i,`__unwrap`,()=>{e[t]===i&&E(e,t,r)}),E(i,`__wrapped`,!0),E(e,t,i),i},Tn=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{T(`must provide one or more modules to patch`),T(Error().stack);return}if(!(t&&Array.isArray(t))){T(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{wn(e,t,n)})})},En=(e,t)=>{if(!e||!e[t]){T(`no function to unwrap.`),T(Error().stack);return}let n=e[t];if(!n.__unwrap)T(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},Dn=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{T(`must provide one or more modules to patch`),T(Error().stack);return}if(!(t&&Array.isArray(t))){T(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{En(e,t)})})};function D(e){e&&e.logger&&(typeof e.logger==`function`?T=e.logger:T(`new logger isn't a function, not replacing`))}D.wrap=wn,D.massWrap=Tn,D.unwrap=En,D.massUnwrap=Dn;var On=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=_.createComponentLogger({namespace:e}),this._tracer=f.getTracer(e,t),this._meter=Ce.getMeter(e,t),this._logger=bn.getLogger(e,t),this._updateMetricInstruments()}_wrap=wn;_unwrap=En;_massWrap=Tn;_massUnwrap=Dn;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}},kn=class extends On{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}};function O(e,t,n){let r,i;try{i=e()}catch(e){r=e}finally{if(t(r,i),r&&!n)throw r;return i}}function k(e){return typeof e==`function`&&typeof e.__original==`function`&&typeof e.__unwrap==`function`&&e.__wrapped===!0}var A;(function(e){e[e.STABLE=1]=`STABLE`,e[e.OLD=2]=`OLD`,e[e.DUPLICATE=3]=`DUPLICATE`})(A||={});function An(e,t){let n=A.OLD,r=t?.split(`,`).map(e=>e.trim()).filter(e=>e!==``);for(let t of r??[])if(t.toLowerCase()===e+`/dup`){n=A.DUPLICATE;break}else t.toLowerCase()===e&&(n=A.STABLE);return n}var jn=s(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function Mn(e){return e.setValue(jn,!0)}function Nn(e){return e.getValue(jn)===!0}var Pn=`baggage`,Fn=4096;function In(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function Ln(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=`;`+t.metadata.toString()),n})}function Rn(e){if(!e)return;let t=e.indexOf(`;`),n=t===-1?e:e.substring(0,t),r=n.indexOf(`=`);if(r<=0)return;let i=n.substring(0,r).trim(),a=n.substring(r+1).trim();if(!i||!a)return;let o,s;try{o=decodeURIComponent(i),s=decodeURIComponent(a)}catch{return}let c;return t!==-1&&t<e.length-1&&(c=ee(e.substring(t+1))),{key:o,value:s,metadata:c}}function zn(e,t,n,r){let i=0;for(;i<e.length&&n<180;){let a=e.indexOf(`,`,i),o=a===-1?e.length:a,s=o-i;if(s<=4096){let a=Rn(e.substring(i,o));if(a){let e=(n===0?0:1)+s;if(r+e>8192)break;t[a.key]=a.metadata?{value:a.value,metadata:a.metadata}:{value:a.value},n++,r+=e}}if(a===-1)break;i=a+1}return[n,r]}var Bn=class{inject(e,t,n){let r=h.getBaggage(e);if(!r||Nn(e))return;let i=In(Ln(r).filter(e=>e.length<=Fn).slice(0,180));i.length>0&&n.set(t,Pn,i)}extract(e,t,n){let r=n.get(t,Pn);if(!r)return e;let i={},a=0,o=0;if(Array.isArray(r))for(let e=0;e<r.length;e++)[a,o]=zn(r[e],i,a,o);else [a]=zn(r,i,a,o);return a===0?e:h.setBaggage(e,h.createBaggage(i))}fields(){return[Pn]}};function j(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Vn(n)){_.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Hn(r)){_.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function Vn(e){return typeof e==`string`&&e!==``}function Hn(e){return e==null?!0:Array.isArray(e)?Un(e):Wn(typeof e)}function Un(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(Wn(e)){t=e;continue}return!1}return!1}}return!0}function Wn(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function Gn(){return e=>{_.error(Kn(e))}}function Kn(e){return typeof e==`string`?e:JSON.stringify(qn(e))}function qn(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var Jn=Gn();function M(e){try{Jn(e)}catch{}}var Yn=`2.9.0`,Xn=`process.runtime.name`,Zn={[Qe]:`opentelemetry`,[Xn]:`browser`,[Xe]:Ze,[$e]:Yn},N=performance,Qn=9,$n=10**6,er=10**Qn;function P(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*$n)]}function tr(e){return ar(P(N.timeOrigin),P(typeof e==`number`?e:N.now()))}function nr(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=er),[n,r]}function rr(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function ir(e){return rr(e)||typeof e==`number`||e instanceof Date}function ar(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=er&&(n[1]-=er,n[0]+=1),n}var or;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(or||={});var sr=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[];let t=new Set;for(let e of this._propagators){let n=typeof e.fields==`function`?e.fields():[];for(let e of n)t.add(e)}this._fields=Array.from(t)}inject(e,t,n){for(let r of this._propagators)try{r.inject(e,t,n)}catch(e){_.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){_.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}},cr=`[_0-9a-z-*/]`,lr=`[a-z]${cr}{0,255}`,ur=`[a-z0-9]${cr}{0,240}@[a-z]${cr}{0,13}`,dr=RegExp(`^(?:${lr}|${ur})$`),fr=/^[ -~]{0,255}[!-~]$/,pr=/,|=/;function mr(e){return dr.test(e)}function hr(e){return fr.test(e)&&!pr.test(e)}var gr=32,_r=512,vr=`,`,yr=`=`,br=class e{_length;_rawTraceState;_internalState;constructor(e){this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,t){if(!mr(e)||!hr(t))return this;let n=this._getState(),r=n.get(e),i=this._length;if(typeof r==`string`?i+=t.length-r.length:i+=e.length+t.length+(n.size>0?2:1),i>_r)return this;let a=new Map(n);return a.delete(e),a.set(e,t),this._fromState(a,i)}unset(e){let t=this._getState(),n=t.get(e);if(typeof n!=`string`)return this;let r=this._length-(e.length+n.length+1);t.size>1&&--r;let i=new Map(t);return i.delete(e),this._fromState(i,r)}get(e){return this._getState().get(e)}serialize(){let e=``,t=0;for(let n of this._getState())t>0&&(e=vr+e),e=`${n[0]}${yr}${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(vr),t=new Map,n=0;for(let r of e){let e=r.trim(),i=e.indexOf(yr);if(i===-1)continue;let a=e.slice(0,i),o=e.slice(i+1);if(!mr(a)||!hr(o))continue;let s=n+e.length+ +(t.size>0);if(!(s>_r)&&(t.set(a,o),n=s,t.size>=gr))break}return this._length=n,this._internalState=new Map(Array.from(t.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}},F=`traceparent`,xr=`tracestate`,Sr=`00`,Cr=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function wr(e){let t=Cr.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var Tr=class{inject(e,t,n){let r=f.getSpanContext(e);if(!r||Nn(e)||!d(r))return;let i=`${Sr}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||l.NONE).toString(16)}`;n.set(t,F,i),r.traceState&&n.set(t,xr,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,F);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=wr(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,xr);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new br(typeof e==`string`?e:void 0)}return f.setSpanContext(e,a)}fields(){return[F,xr]}},Er=`[object Object]`,Dr=`[object Null]`,Or=`[object Undefined]`,kr=Function.prototype.toString,Ar=kr.call(Object),jr=Object.getPrototypeOf,Mr=Object.prototype,Nr=Mr.hasOwnProperty,I=Symbol?Symbol.toStringTag:void 0,Pr=Mr.toString;function Fr(e){if(!Ir(e)||Lr(e)!==Er)return!1;let t=jr(e);if(t===null)return!0;let n=Nr.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&kr.call(n)===Ar}function Ir(e){return typeof e==`object`&&!!e}function Lr(e){return e==null?e===void 0?Or:Dr:I&&I in Object(e)?Rr(e):zr(e)}function Rr(e){let t=Nr.call(e,I),n=e[I],r=!1;try{e[I]=void 0,r=!0}catch{}let i=Pr.call(e);return r&&(t?e[I]=n:delete e[I]),i}function zr(e){return Pr.call(e)}var Br=20;function Vr(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=Ur(t,e.shift(),0,n);return t}function Hr(e){return L(e)?e.slice():e}function Ur(e,t,n=0,r){let i;if(!(n>Br)){if(n++,z(e)||z(t)||Gr(t))i=Hr(t);else if(L(e)){if(i=e.slice(),L(t))for(let e=0,n=t.length;e<n;e++)i.push(Hr(t[e]));else if(R(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=Hr(t[r]))}}}else if(R(e))if(R(t)){if(!Kr(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(z(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(Wr(e,s,r)||Wr(t,s,r))delete i[s];else{if(R(a)&&R(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=Ur(i[s],c,n,r)}}}}else i=t;return i}}function Wr(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function L(e){return Array.isArray(e)}function Gr(e){return typeof e==`function`}function R(e){return!z(e)&&!L(e)&&!Gr(e)&&typeof e==`object`}function z(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function Kr(e,t){return!(!Fr(e)||!Fr(t))}var qr=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}},Jr=class{_isCalled=!1;_deferred=new qr;_callback;_that;constructor(e,t){this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}},B;function Yr(){if(B===void 0)try{let e=globalThis.process.argv0;B=e?`unknown_service:${e}`:`unknown_service`}catch{B=`unknown_service`}return B}var V=e=>typeof e==`object`&&!!e&&typeof e.then==`function`,Xr=class e{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=$r(t),r._asyncAttributesPending=t.filter(([e,t])=>V(t)).length>0,r}constructor(e,t){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(V(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=$r(this._rawAttributes),this._schemaUrl=ei(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,V(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&_.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(V(n)){_.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]??=n)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=ti(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function Zr(e,t){return Xr.FromAttributeList(Object.entries(e),t)}function Qr(){return Zr({[Je]:Yr(),[Xe]:Zn[Xe],[Qe]:Zn[Qe],[$e]:Zn[$e]})}function $r(e){return e.map(([e,t])=>V(t)?[e,t.catch(t=>{_.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function ei(e){if(typeof e==`string`||e===void 0)return e;_.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function ti(e,t){let n=e?.schemaUrl,r=t?.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;_.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var ni=`exception`,ri=Symbol.for(`nodejs.util.inspect.custom`);function ii(e){let t={};for(let[n,r]of e.getRawAttributes())typeof r?.then!=`function`&&r!=null&&(t[n]??=r);return t}function ai(e,t,n,r,i){if(typeof n==`number`&&n<0){let t=`[${e}]`;return r?.stylize?r.stylize(t,`special`):t}return typeof i!=`function`||!r?t:`${e} ${i(t,{...r,depth:r.depth==null?r.depth:r.depth-1})}`}var oi=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:c.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){let t=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=N.now(),this._performanceOffset=t-(this._performanceStartTime+N.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let t of e.links)this.addLink(t);this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(t==null||this._isSpanEnded())return this;if(e.length===0)return _.warn(`Invalid attribute key: ${e}`),this;if(!Hn(t))return _.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return _.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&_.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),ir(t)&&(ir(n)||(n=t),t=void 0);let i=j(t),{attributePerEventCountLimit:a}=this._spanLimits,o={},s=0,c=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];if(a!==void 0&&c>=a){s++;continue}o[e]=this._truncateToSize(t),c++}return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:s}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(t===0)return this._droppedLinksCount++,this;t!==void 0&&this.links.length>=t&&(this._droppedLinksCount===0&&_.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=j(e.attributes),i={},a=0,o=0;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=r[e];if(n!==void 0&&o>=n){a++;continue}i[e]=this._truncateToSize(t),o++}let s={context:e.context};return o>0&&(s.attributes=i),a>0&&(s.droppedAttributesCount=a),this.links.push(s),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===c.UNSET||this.status.code===c.OK)return this;let t={code:e.code};return e.code===c.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&_.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){if(this._isSpanEnded()){_.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=nr(this.startTime,this.endTime),this._duration[0]<0&&(_.warn(`Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.`,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&_.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&_.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==`number`&&e<=N.now())return tr(e+this._performanceOffset);if(typeof e==`number`)return P(e);if(e instanceof Date)return P(e.getTime());if(rr(e))return e;if(this._startTimeProvided)return P(Date.now());let t=N.now()-this._performanceStartTime;return ar(this.startTime,P(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[Be]=e:e&&(e.code?n[He]=e.code.toString():e.name&&(n[He]=e.name),e.message&&(n[Be]=e.message),e.stack&&(n[Ve]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(ni,n,t):_.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);_.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(_.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==`string`?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>typeof e==`string`?this._truncateToLimitUtil(e,t):e):e}[ri](e,t,n){return ai(`SpanImpl`,{name:this.name,kind:this.kind,spanContext:this._spanContext,parentSpanContext:this.parentSpanContext,status:this.status,startTime:this.startTime,endTime:this.endTime,duration:this._duration,ended:this._ended,attributes:this.attributes,events:this.events,links:this.links,droppedAttributesCount:this._droppedAttributesCount,droppedEventsCount:this._droppedEventsCount,droppedLinksCount:this._droppedLinksCount,instrumentationScope:this.instrumentationScope,resource:{attributes:ii(this.resource)}},e,t,n)}},H;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(H||={});var si=`otel.component.name`,ci=`otel.component.type`,li=`otel.span.parent.origin`,ui=`otel.span.sampling_result`,di=`otel.sdk.processor.span.processed`,fi=`otel.sdk.processor.span.queue.capacity`,pi=`otel.sdk.processor.span.queue.size`,mi=`otel.sdk.span.live`,hi=`otel.sdk.span.started`,gi=`batching_span_processor`,_i=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(hi,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(mi,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=yi(t);if(this.startedSpans.add(1,{[li]:vi(e),[ui]:n}),t===H.NOT_RECORD)return()=>{};let r={[ui]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function vi(e){return e?e.isRemote?`remote`:`local`:`none`}function yi(e){switch(e){case H.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case H.RECORD:return`RECORD_ONLY`;case H.NOT_RECORD:return`DROP`}}var bi=`2.9.0`,xi=class{_sampler;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,t){this.instrumentationScope=e,this._sampler=t.sampler,this._spanLimits=t.spanLimits,this._resource=t.resource,this._idGenerator=t.idGenerator,this._spanProcessor=t.spanProcessor,this._tracerMetrics=new _i(t.meterProvider.getMeter(`@opentelemetry/sdk-trace`,bi))}startSpan(e,t={},r=m.active()){t.root&&(r=f.deleteSpan(r));let i=f.getSpan(r);if(Nn(r))return _.debug(`Instrumentation suppressed, returning Noop Span`),f.wrapSpanContext(n);let a=i?.spanContext(),o=this._idGenerator.generateSpanId(),s,c,u;!a||!f.isSpanContextValid(a)?c=this._idGenerator.generateTraceId():(c=a.traceId,u=a.traceState,s=a);let d=t.kind??be.INTERNAL,p=(t.links??[]).map(e=>({context:e.context,attributes:j(e.attributes)})),ee=j(t.attributes),h=this._sampler.shouldSample(r,c,e,d,ee,p),te=this._tracerMetrics.startSpan(a,h.decision);u=h.traceState??u;let g=h.decision===ye.RECORD_AND_SAMPLED?l.SAMPLED:l.NONE,ne={traceId:c,spanId:o,traceFlags:g,traceState:u};if(h.decision===ye.NOT_RECORD)return _.debug(`Recording is off, propagating context in a non-recording span`),f.wrapSpanContext(ne);let re=j(Object.assign(ee,h.attributes));return new oi({resource:this._resource,scope:this.instrumentationScope,context:r,spanContext:ne,name:e,kind:d,links:p,parentSpanContext:s,attributes:re,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:te})}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a??m.active(),c=this.startSpan(e,i,s),l=f.setSpan(s,c);return m.with(l,o,void 0,c)}[ri](e,t,n){return ai(`Tracer`,{instrumentationScope:this.instrumentationScope,resource:{attributes:ii(this._resource)},spanLimits:this._spanLimits},e,t,n)}},Si=class{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{M(e||Error(`MultiSpanProcessor: forceFlush failed`)),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}},U=class{shouldSample(){return{decision:H.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},W=class{shouldSample(){return{decision:H.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}},G=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||=(M(Error(`ParentBasedSampler must have a root sampler configured`)),new W),this._remoteParentSampled=e.remoteParentSampled??new W,this._remoteParentNotSampled=e.remoteParentNotSampled??new U,this._localParentSampled=e.localParentSampled??new W,this._localParentNotSampled=e.localParentNotSampled??new U}shouldSample(e,t,n,r,i,a){let o=f.getSpanContext(e);return!o||!d(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&l.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&l.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,i,a):this._localParentNotSampled.shouldSample(e,t,n,r,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}},Ci=new Map,wi=class{processedSpans;queueSize;queueSizeCallback;standardAttrs;droppedAttrs;constructor(e,t,n){let r=Ci.get(e)??0;if(Ci.set(e,r+1),this.standardAttrs={[ci]:e,[si]:`${e}/${r}`},this.droppedAttrs={...this.standardAttrs,[ze]:`queue_full`},this.processedSpans=t.createCounter(di,{unit:`{span}`,description:`The number of spans for which the processing has finished, either successful or failed.`}),n){let{capacity:e,getQueueSize:r}=n;t.createUpDownCounter(fi,{unit:`{span}`,description:`The maximum number of spans the queue of a given instance of an SDK span processor can hold.`}).add(e,this.standardAttrs),this.queueSize=t.createObservableUpDownCounter(pi,{unit:`{span}`,description:`The number of spans in the queue of a given instance of an SDK span processor.`}),this.queueSizeCallback=e=>e.observe(r(),this.standardAttrs),this.queueSize.addCallback(this.queueSizeCallback)}}dropSpans(e){this.processedSpans.add(e,this.droppedAttrs)}finishSpans(e,t){if(!t){this.processedSpans.add(e,this.standardAttrs);return}let n={...this.standardAttrs,[ze]:t.name};this.processedSpans.add(e,n)}shutdown(){this.queueSize&&this.queueSizeCallback&&this.queueSize.removeCallback(this.queueSizeCallback)}},Ti=class{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_metrics;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e){this._exporter=e.exporter,this._maxExportBatchSize=e.maxExportBatchSize??512,this._maxQueueSize=e.maxQueueSize??2048,this._scheduledDelayMillis=e.scheduledDelayMillis??5e3,this._exportTimeoutMillis=e.exportTimeoutMillis??3e4,this._shutdownOnce=new Jr(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(_.warn(`BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize),this._metrics=new wi(gi,e.selfObsMeterProvider?e.selfObsMeterProvider.getMeter(`@opentelemetry/sdk-trace`):ve(),{capacity:this._maxQueueSize,getQueueSize:()=>this._finishedSpans.length})}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&l.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>(this._metrics.shutdown(),this._exporter.shutdown()))}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&_.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++,this._metrics.dropSpans(1);return}this._droppedSpansCount>0&&(_.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let e=0,t=r;e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`Timeout`))},this._exportTimeoutMillis);m.with(Mn(m.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(r,i=>{clearTimeout(n),this._metrics.finishSpans(r.length,i.error),i.code===or.SUCCESS?e():t(i.error??Error(`BatchSpanProcessor: span export failed`))}),a=null;for(let e=0,t=r.length;e<t;e++){let t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(a??=[],a.push(t.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,e=>{M(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,M(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},Ei=class extends Ti{_visibilityChangeListener;_pageHideListener;constructor(e){super(e),this.onInit(e)}onInit(e){e.disableAutoFlushOnDocumentHide!==!0&&typeof document<`u`&&(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush().catch(e=>{M(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{M(e)})},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}onShutdown(){typeof document<`u`&&(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}},Di=16,Oi=8,ki=new Uint8Array(Di),Ai=new Uint8Array(Oi),ji=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Mi(e){for(let t=0;t<e.length;t++)e[t]=Math.random()*256>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function Ni(e){let t=``;for(let n=0;n<e.length;n++)t+=ji[e[n]];return t}var Pi=class{generateTraceId(){return Mi(ki),Ni(ki)}generateSpanId(){return Mi(Ai),Ni(Ai)}},K;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(K||={});var Fi=class{_resource;_activeSpanProcessor;_forceFlushTimeoutMillis;_tracerOptions;_tracers=new Map;constructor(e={}){this._forceFlushTimeoutMillis=e.forceFlushTimeoutMillis??3e4,this._resource=e.resource??Qr(),this._activeSpanProcessor=new Si(e.spanProcessors??[]),this._tracerOptions={resource:this._resource,sampler:e.sampler??new G({root:new W}),spanLimits:{attributeCountLimit:e.spanLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.spanLimits?.attributeValueLengthLimit??1/0,eventCountLimit:e.spanLimits?.eventCountLimit??128,linkCountLimit:e.spanLimits?.linkCountLimit??128,attributePerEventCountLimit:e.spanLimits?.attributePerEventCountLimit??128,attributePerLinkCountLimit:e.spanLimits?.attributePerLinkCountLimit??128},idGenerator:e.idGenerator||new Pi,spanProcessor:this._activeSpanProcessor,meterProvider:e.meterProvider??{getMeter(){return ve()}}}}getTracer(e,t,n){let r=`${e}@${t||``}:${n?.schemaUrl||``}`;return this._tracers.has(r)||this._tracers.set(r,new xi({name:e,version:t,schemaUrl:n?.schemaUrl},this._tracerOptions)),this._tracers.get(r)}forceFlush(){let e=this._forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r,i=setTimeout(()=>{n(Error(`Span processor did not completed within timeout period of ${e} ms`)),r=K.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==K.timeout&&(r=K.resolved,n(r))}).catch(e=>{clearTimeout(i),r=K.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==K.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}[ri](e,t,n){let r=this._activeSpanProcessor._spanProcessors;return ai(`TracerProvider`,{resource:{attributes:ii(this._resource)},tracers:Array.from(this._tracers.keys()),spanProcessors:r.map(e=>e.constructor?.name??`SpanProcessor`)},e,t,n)}},Ii=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:o(t)&&this._accumulate(t)<this._upperBound?H.RECORD_AND_SAMPLED:H.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=`number`||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<32;n+=8){let r=0;for(let t=0;t<8;t++){let i=e.charCodeAt(n+t),a=i<58?i-48:i<71?i-55:i-87;r=r<<4|a}t=(t^r)>>>0}return t}},q;(function(e){e.AlwaysOff=`always_off`,e.AlwaysOn=`always_on`,e.ParentBasedAlwaysOff=`parentbased_always_off`,e.ParentBasedAlwaysOn=`parentbased_always_on`,e.ParentBasedTraceIdRatio=`parentbased_traceidratio`,e.TraceIdRatio=`traceidratio`})(q||={});var Li=1;function Ri(){return{sampler:zi(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function zi(){let e=q.ParentBasedAlwaysOn;switch(e){case q.AlwaysOn:return new W;case q.AlwaysOff:return new U;case q.ParentBasedAlwaysOn:return new G({root:new W});case q.ParentBasedAlwaysOff:return new G({root:new U});case q.TraceIdRatio:return new Ii(Bi());case q.ParentBasedTraceIdRatio:return new G({root:new Ii(Bi())});default:return _.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${q.ParentBasedAlwaysOn}".`),new G({root:new W})}}function Bi(){return _.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Li}.`),Li}function Vi(e){let t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??void 0??void 0??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??void 0??void 0??1/0,Object.assign({},e,{spanLimits:t})}var Hi=class extends Fi{constructor(e={}){let t=Vr({},Ri(),Vi(e));delete t.generalLimits,super(t)}},Ui=class extends Ei{constructor(e,t){t||={};for(let[e,n]of[[`maxExportBatchSize`,`OTEL_BSP_MAX_EXPORT_BATCH_SIZE`],[`maxQueueSize`,`OTEL_BSP_MAX_QUEUE_SIZE`],[`scheduledDelayMillis`,`OTEL_BSP_SCHEDULE_DELAY`],[`exportTimeoutMillis`,`OTEL_BSP_EXPORT_TIMEOUT`]])t[e];super({exporter:e,...t})}},Wi=class{_enabled=!1;_currentContext=r;_bindFunction(e=r,t){let n=this,i=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(i,`length`,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),i}active(){return this._currentContext}bind(e,t){return e===void 0&&(e=this.active()),typeof t==`function`?this._bindFunction(e,t):t}disable(){return this._currentContext=r,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=r,this)}with(e,t,n,...i){let a=this._currentContext;this._currentContext=e||r;try{return t.call(n,...i)}finally{this._currentContext=a}}};function Gi(e){if(e!==null){if(e===void 0){let e=new Wi;e.enable(),m.setGlobalContextManager(e);return}e.enable(),m.setGlobalContextManager(e)}}function Ki(e){if(e!==null){if(e===void 0){h.setGlobalPropagator(new sr({propagators:[new Tr,new Bn]}));return}h.setGlobalPropagator(e)}}var qi=class extends Hi{constructor(e={}){super(e)}register(e={}){f.setGlobalTracerProvider(this),Ki(e.propagator),Gi(e.contextManager)}},J;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(J||={});var Ji=`http.response_content_length`,Yi=`http.response_content_length_uncompressed`;function Y(e,t){return t in e}function X(e,t,n,r=!0){if(Y(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function Xi(e,t,n=!1,r,i){if(r===void 0&&(r=t[J.START_TIME]!==0),n||(X(e,J.FETCH_START,t,r),X(e,J.DOMAIN_LOOKUP_START,t,r),X(e,J.DOMAIN_LOOKUP_END,t,r),X(e,J.CONNECT_START,t,r),X(e,J.SECURE_CONNECTION_START,t,r),X(e,J.CONNECT_END,t,r),X(e,J.REQUEST_START,t,r),X(e,J.RESPONSE_START,t,r),X(e,J.RESPONSE_END,t,r)),!i){let n=t[J.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(Ji,n);let r=t[J.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(Yi,r)}}function Zi(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return`/`;let n=$i(e,t);if(t&&n.indexOf(`@id`)>0)return n;let r=``;return e.parentNode&&(r+=Zi(e.parentNode,t)),r+=n,r}function Qi(e){if(!e.parentNode)return 0;let t=[e.nodeType];e.nodeType===Node.CDATA_SECTION_NODE&&t.push(Node.TEXT_NODE);let n=Array.from(e.parentNode.childNodes);return n=n.filter(n=>{let r=n.localName;return t.indexOf(n.nodeType)>=0&&r===e.localName}),n.length>=1?n.indexOf(e)+1:0}function $i(e,t){let n=e.nodeType,r=Qi(e),i;if(n===Node.ELEMENT_NODE){let n=e.getAttribute(`id`);if(t&&n)return`//*[@id="${n}"]`;i=e.localName}else if(n===Node.TEXT_NODE||n===Node.CDATA_SECTION_NODE)i=`text()`;else if(n===Node.COMMENT_NODE)i=`comment()`;else return``;return i&&r>1?`/${i}[${r}]`:`/${i}`}var ea;(function(e){e.DOCUMENT_LOAD=`documentLoad`,e.DOCUMENT_FETCH=`documentFetch`,e.RESOURCE_FETCH=`resourceFetch`})(ea||={});var ta=`0.49.0`,na=`@opentelemetry/instrumentation-document-load`,ra;(function(e){e.FIRST_PAINT=`firstPaint`,e.FIRST_CONTENTFUL_PAINT=`firstContentfulPaint`})(ra||={});var ia=()=>{let e={},t=N.getEntriesByType?.(`navigation`)[0];if(t)Object.values(J).forEach(n=>{if(Y(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}});else{let t=N.timing;t&&Object.values(J).forEach(n=>{if(Y(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}})}return e},aa={"first-paint":ra.FIRST_PAINT,"first-contentful-paint":ra.FIRST_CONTENTFUL_PAINT},oa=e=>{let t=N.getEntriesByType?.(`paint`);t&&t.forEach(({name:t,startTime:n})=>{Y(aa,t)&&e.addEvent(aa[t],n)})},sa=class extends kn{component=`document-load`;version=`1`;moduleName=this.component;constructor(e={}){super(na,ta,e)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(e){let t=N.getEntriesByType?.(`resource`);t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){let e=Array.from(document.getElementsByTagName(`meta`)).find(e=>e.getAttribute(`name`)===F),t=ia(),n=e&&e.content||``;m.with(h.extract(r,{traceparent:n}),()=>{let e=this._startSpan(ea.DOCUMENT_LOAD,J.FETCH_START,t);e&&(m.with(f.setSpan(m.active(),e),()=>{let e=this._startSpan(ea.DOCUMENT_FETCH,J.FETCH_START,t);e&&(e.setAttribute(Ie,location.href),m.with(f.setSpan(m.active(),e),()=>{Xi(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,J.RESPONSE_END,t)}))}),e.setAttribute(Ie,location.href),e.setAttribute(Le,navigator.userAgent),this._addResourcesSpans(e),this.getConfig().ignoreNetworkEvents||(X(e,J.FETCH_START,t),X(e,J.UNLOAD_EVENT_START,t),X(e,J.UNLOAD_EVENT_END,t),X(e,J.DOM_INTERACTIVE,t),X(e,J.DOM_CONTENT_LOADED_EVENT_START,t),X(e,J.DOM_CONTENT_LOADED_EVENT_END,t),X(e,J.DOM_COMPLETE,t),X(e,J.LOAD_EVENT_START,t),X(e,J.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||oa(e),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(e,J.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(Y(n,t)?e.end(n[t]):e.end())}_initResourceSpan(e,t){let n=this._startSpan(ea.RESOURCE_FETCH,J.FETCH_START,e,t);n&&(n.setAttribute(Ie,e.name),Xi(n,e,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(n,e,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(n,J.RESPONSE_END,e))}_startSpan(e,t,n,r){if(Y(n,t)&&typeof n[t]==`number`)return this.tracer.startSpan(e,{startTime:n[t]},r?f.setSpan(m.active(),r):void 0)}_waitForPageLoad(){window.document.readyState===`complete`?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener(`load`,this._onDocumentLoaded))}_addCustomAttributesOnSpan(e,t){t&&O(()=>t(e),e=>{e&&this._diag.error(`addCustomAttributesOnSpan`,e)},!0)}_addCustomAttributesOnResourceSpan(e,t,n){n&&O(()=>n(e,t),e=>{e&&this._diag.error(`addCustomAttributesOnResourceSpan`,e)},!0)}enable(){window.removeEventListener(`load`,this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener(`load`,this._onDocumentLoaded)}},Z;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(Z||={});var ca=`http.response_content_length`,la=`http.response_content_length_uncompressed`,ua;function da(){return ua||=document.createElement(`a`),ua}function fa(e,t){return t in e}function Q(e,t,n,r=!0){if(fa(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function pa(e,t,n=!1,r,i){if(r===void 0&&(r=t[Z.START_TIME]!==0),n||(Q(e,Z.FETCH_START,t,r),Q(e,Z.DOMAIN_LOOKUP_START,t,r),Q(e,Z.DOMAIN_LOOKUP_END,t,r),Q(e,Z.CONNECT_START,t,r),Q(e,Z.SECURE_CONNECTION_START,t,r),Q(e,Z.CONNECT_END,t,r),Q(e,Z.REQUEST_START,t,r),Q(e,Z.RESPONSE_START,t,r),Q(e,Z.RESPONSE_END,t,r)),!i){let n=t[Z.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(ca,n);let r=t[Z.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(la,r)}}function ma(e){return e.slice().sort((e,t)=>{let n=e[Z.FETCH_START],r=t[Z.FETCH_START];return n>r?1:n<r?-1:0})}function ha(){return typeof location<`u`?location.origin:void 0}function ga(e,t,n,r,i=new WeakSet,a){let o=ya(e);e=o.toString();let s=va(e,t,n,r,i,a);if(s.length===0)return{mainRequest:void 0};if(s.length===1)return{mainRequest:s[0]};let c=ma(s);if(o.origin!==ha()&&c.length>1){let e=c[0],t=_a(c,e[Z.RESPONSE_END],n),r=e[Z.RESPONSE_END];return t[Z.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}else return{mainRequest:s[0]}}function _a(e,t,n){let r=b(n),i=b(y(t)),a=e[1],o,s=e.length;for(let t=1;t<s;t++){let n=e[t],s=b(y(n[Z.FETCH_START])),c=r-b(y(n[Z.RESPONSE_END]));s>=i&&(!o||c<o)&&(o=c,a=n)}return a}function va(e,t,n,r,i,a){let o=b(t),s=b(n),c=r.filter(t=>{let n=b(y(t[Z.FETCH_START])),r=b(y(t[Z.RESPONSE_END]));return t.initiatorType.toLowerCase()===(a||`xmlhttprequest`)&&t.name===e&&n>=o&&r<=s});return c.length>0&&(c=c.filter(e=>!i.has(e))),c}function ya(e){if(typeof URL==`function`)return new URL(e,typeof document<`u`?document.baseURI:typeof location<`u`?location.href:void 0);let t=da();return t.href=e,t}function ba(e,t){let n=t||[];return(typeof n==`string`||n instanceof RegExp)&&(n=[n]),ya(e).origin===ha()?!0:n.some(t=>ct(e,t))}var xa;(function(e){e.COMPONENT=`component`,e.HTTP_STATUS_TEXT=`http.status_text`})(xa||={});var Sa=`http.host`,Ca=`http.method`,wa=`http.request.body.size`,Ta=`http.request_content_length_uncompressed`,Ea=`http.scheme`,Da=`http.status_code`,Oa=`http.url`,ka=`http.user_agent`,Aa=_.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-fetch/utils`});function ja(...e){if(e[0]instanceof URL||typeof e[0]==`string`){let t=e[1];if(!t?.body)return Promise.resolve();if(t.body instanceof ReadableStream){let{body:e,length:n}=Ma(t.body);return t.body=e,n}else return Promise.resolve(Pa(t.body))}else{let t=e[0];return t?.body?t.clone().text().then(e=>Ia(e)):Promise.resolve()}}function Ma(e){if(!e.pipeThrough)return Aa.warn(`Platform has ReadableStream but not pipeThrough!`),{body:e,length:Promise.resolve(void 0)};let t=0,n,r=new Promise(e=>{n=e}),i=new TransformStream({start(){},async transform(e,n){let r=await e;t+=r.byteLength,n.enqueue(e)},flush(){n(t)}});return{body:e.pipeThrough(i),length:r}}function Na(e){return typeof Document<`u`&&e instanceof Document}function Pa(e){if(Na(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return Ia(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return La(e);if(e instanceof URLSearchParams)return Ia(e.toString());if(e.byteLength!==void 0)return e.byteLength;Aa.warn(`unknown body type`)}var Fa=new TextEncoder;function Ia(e){return Fa.encode(e).byteLength}function La(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function Ra(e){let t=Va(),n=e.toUpperCase();return n in t?n:`_OTHER`}var za={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0},Ba;function Va(){return Ba===void 0&&(Ba=za),Ba}var Ha={"https:":`443`,"http:":`80`};function Ua(e){let t=Number(e.port||Ha[e.protocol]);if(t&&!isNaN(t))return t}var Wa=`0.204.0`,Ga=300,Ka=typeof process==`object`&&process.release?.name===`node`,qa=class extends kn{component=`fetch`;version=Wa;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super(`@opentelemetry/instrumentation-fetch`,Wa,e),this._semconvStability=An(`http`,e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){let n=this.tracer.startSpan(`CORS Preflight`,{startTime:t[Z.FETCH_START]},f.setSpan(m.active(),e)),r=!(this._semconvStability&A.OLD);pa(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[Z.RESPONSE_END])}_addFinalSpanAttributes(e,t){let n=ya(t.url);if(this._semconvStability&A.OLD&&(e.setAttribute(Da,t.status),t.statusText!=null&&e.setAttribute(xa.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(Sa,n.host),e.setAttribute(Ea,n.protocol.replace(`:`,``)),typeof navigator<`u`&&e.setAttribute(ka,navigator.userAgent)),this._semconvStability&A.STABLE){e.setAttribute(Ge,t.status),e.setAttribute(Ke,n.hostname);let r=Ua(n);r&&e.setAttribute(qe,r)}}_addHeaders(e,t){if(!ba(t,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};h.inject(m.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}if(e instanceof Request)h.inject(m.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Headers)h.inject(m.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Map)h.inject(m.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else{let t={};h.inject(m.active(),t),e.headers=Object.assign({},t,e.headers||{})}}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(lt(e,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let n=``,r={};if(this._semconvStability&A.OLD){let i=(t.method||`GET`).toUpperCase();n=`HTTP ${i}`,r[xa.COMPONENT]=this.moduleName,r[Ca]=i,r[Oa]=e}if(this._semconvStability&A.STABLE){let i=t.method,a=Ra(t.method||`GET`);n||=a,r[Ue]=a,a!==i&&(r[We]=i),r[et]=e}return this.tracer.startSpan(n,{kind:be.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType(`resource`)}let i=ga(t.spanUrl,t.startTime,n,r,this._usedResources,`fetch`);if(i.mainRequest){let t=i.mainRequest;this._markResourceAsUsed(t);let n=i.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&A.OLD);pa(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){let r=v(Date.now()),i=at();this._addFinalSpanAttributes(e,n),this._semconvStability&A.STABLE&&n.status>=400&&(e.setStatus({code:c.ERROR}),e.setAttribute(ze,String(n.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,i),this._tasksCount--,this._clearResources(),e.end(r)},Ga)}_patchConstructor(){return e=>{let t=this;return function(...n){let r=this,i=ya(n[0]instanceof Request?n[0].url:String(n[0])).href,a=n[0]instanceof Request?n[0]:n[1]||{},o=t._createSpan(i,a);if(!o)return e.apply(this,n);let s=t._prepareSpanData(i);t.getConfig().measureRequestSize&&ja(...n).then(e=>{e&&(t._semconvStability&A.OLD&&o.setAttribute(Ta,e),t._semconvStability&A.STABLE&&o.setAttribute(wa,e))}).catch(e=>{t._diag.warn(`getFetchBodyLength`,e)});function c(e,n){t._applyAttributesAfterFetch(e,a,n),t._endSpan(e,s,{status:n.status||0,statusText:n.message,url:i})}function l(e,n){t._applyAttributesAfterFetch(e,a,n),n.status>=200&&n.status<400?t._endSpan(e,s,n):t._endSpan(e,s,{status:n.status,statusText:n.statusText,url:i})}function u(e,t,n){try{let t=n.clone().body;if(t){let r=t.getReader(),i=()=>{r.read().then(({done:t})=>{t?l(e,n):i()},t=>{c(e,t)})};i()}else l(e,n)}finally{t(n)}}function d(e,t,n){try{c(e,n)}finally{t(n)}}return new Promise((n,s)=>m.with(f.setSpan(m.active(),o),()=>(t._addHeaders(a,i),t._callRequestHook(o,a),t._tasksCount++,e.apply(r,a instanceof Request?[a]:[i,a]).then(u.bind(r,o,n),d.bind(r,o,s)))))}}}_applyAttributesAfterFetch(e,t,n){let r=this.getConfig().applyCustomAttributesOnSpan;r&&O(()=>r(e,t,n),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_callRequestHook(e,t){let n=this.getConfig().requestHook;n&&O(()=>n(e,t),e=>{e&&this._diag.error(`requestHook`,e)},!0)}_prepareSpanData(e){let t=at(),n=[];if(typeof PerformanceObserver!=`function`)return{entries:n,startTime:t,spanUrl:e};let r=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{t.initiatorType===`fetch`&&t.name===e&&n.push(t)})});return r.observe({entryTypes:[`resource`]}),{entries:n,observer:r,startTime:t,spanUrl:e}}enable(){if(Ka){this._diag.warn(`this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()`);return}k(fetch)&&(this._unwrap(Me,`fetch`),this._diag.debug(`removing previous patch for constructor`)),this._wrap(Me,`fetch`,this._patchConstructor())}disable(){Ka||(this._unwrap(Me,`fetch`),this._usedResources=new WeakSet)}},$;(function(e){e.EVENT_TYPE=`event_type`,e.TARGET_ELEMENT=`target_element`,e.TARGET_XPATH=`target_xpath`,e.HTTP_URL=`http.url`})($||={});var Ja=`0.49.0`,Ya=`@opentelemetry/instrumentation-user-interaction`,Xa=`OT_ZONE_CONTEXT`,Za=`Navigation:`,Qa=[`click`];function $a(){return!1}var eo=class extends kn{version=Ja;moduleName=`user-interaction`;_spansData=new WeakMap;_wrappedListeners=new WeakMap;_eventsSpanMap=new WeakMap;_eventNames;_shouldPreventSpanCreation;constructor(e={}){super(Ya,Ja,e),this._eventNames=new Set(e?.eventNames??Qa),this._shouldPreventSpanCreation=typeof e?.shouldPreventSpanCreation==`function`?e.shouldPreventSpanCreation:$a}init(){}_checkForTimeout(e,t){let n=this._spansData.get(t);n&&(e.source===`setTimeout`?n.hrTimeLastTimeout=tr():e.source!==`Promise.then`&&e.source!==`setTimeout`&&(n.hrTimeLastTimeout=void 0))}_allowEventName(e){return this._eventNames.has(e)}_createSpan(e,t,n){if(!(e instanceof HTMLElement)||!e.getAttribute||e.hasAttribute(`disabled`)||!this._allowEventName(t))return;let r=Zi(e,!0);try{let i=this.tracer.startSpan(t,{attributes:{[$.EVENT_TYPE]:t,[$.TARGET_ELEMENT]:e.tagName,[$.TARGET_XPATH]:r,[$.HTTP_URL]:window.location.href}},n?f.setSpan(m.active(),n):void 0);return this._shouldPreventSpanCreation(t,e,i)===!0?void 0:(this._spansData.set(i,{taskCount:0}),i)}catch(e){this._diag.error(`failed to start create new user interaction span`,e)}}_decrementTask(e){let t=this._spansData.get(e);t&&(t.taskCount--,t.taskCount===0&&this._tryToEndSpan(e,t.hrTimeLastTimeout))}_getCurrentSpan(e){let t=e.get(Xa);return t&&f.getSpan(t)}_incrementTask(e){let t=this._spansData.get(e);t&&t.taskCount++}addPatchedListener(e,t,n,r){let i=this._wrappedListeners.get(n);i||(i=new Map,this._wrappedListeners.set(n,i));let a=i.get(t);return a||(a=new Map,i.set(t,a)),a.has(e)?!1:(a.set(e,r),!0)}removePatchedListener(e,t,n){let r=this._wrappedListeners.get(n);if(!r)return;let i=r.get(t);if(!i)return;let a=i.get(e);return a&&(i.delete(e),i.size===0&&(r.delete(t),r.size===0&&this._wrappedListeners.delete(n))),a}_invokeListener(e,t,n){return typeof e==`function`?e.apply(t,n):e.handleEvent(n[0])}_patchAddEventListener(){let e=this;return t=>function(n,r,i){if(!r)return t.call(this,n,r,i);let a=i&&typeof i==`object`&&i.once,o=function(...t){let i,o=t[0],s=o?.target;o&&(i=e._eventsSpanMap.get(o)),a&&e.removePatchedListener(this,n,r);let c=e._createSpan(s,n,i);return c?(o&&e._eventsSpanMap.set(o,c),m.with(f.setSpan(m.active(),c),()=>{let n=e._invokeListener(r,this,t);return c.end(),n})):e._invokeListener(r,this,t)};if(e.addPatchedListener(this,n,r,o))return t.call(this,n,o,i)}}_patchRemoveEventListener(){let e=this;return t=>function(n,r,i){let a=e.removePatchedListener(this,n,r);return a?t.call(this,n,a,i):t.call(this,n,r,i)}}_getPatchableEventTargets(){return window.EventTarget?[EventTarget.prototype]:[Node.prototype,Window.prototype]}_patchHistoryApi(){this._unpatchHistoryApi(),this._wrap(history,`replaceState`,this._patchHistoryMethod()),this._wrap(history,`pushState`,this._patchHistoryMethod()),this._wrap(history,`back`,this._patchHistoryMethod()),this._wrap(history,`forward`,this._patchHistoryMethod()),this._wrap(history,`go`,this._patchHistoryMethod())}_patchHistoryMethod(){let e=this;return t=>function(...n){let r=`${location.pathname}${location.hash}${location.search}`,i=t.apply(this,n),a=`${location.pathname}${location.hash}${location.search}`;return r!==a&&e._updateInteractionName(a),i}}_unpatchHistoryApi(){k(history.replaceState)&&this._unwrap(history,`replaceState`),k(history.pushState)&&this._unwrap(history,`pushState`),k(history.back)&&this._unwrap(history,`back`),k(history.forward)&&this._unwrap(history,`forward`),k(history.go)&&this._unwrap(history,`go`)}_updateInteractionName(e){let t=f.getSpan(m.active());t&&typeof t.updateName==`function`&&t.updateName(`${Za} ${e}`)}_patchZoneCancelTask(){let e=this;return t=>function(n){let r=Zone.current,i=e._getCurrentSpan(r);return i&&e._shouldCountTask(n,r)&&e._decrementTask(i),t.call(this,n)}}_patchZoneScheduleTask(){let e=this;return t=>function(n){let r=Zone.current,i=e._getCurrentSpan(r);return i&&e._shouldCountTask(n,r)&&(e._incrementTask(i),e._checkForTimeout(n,i)),t.call(this,n)}}_patchZoneRunTask(){let e=this;return t=>function(n,r,i){let a=(Array.isArray(i)&&i[0]instanceof Event?i[0]:void 0)?.target,o,s=this;if(a){if(o=e._createSpan(a,n.eventName),o)return e._incrementTask(o),s.run(()=>{try{return m.with(f.setSpan(m.active(),o),()=>{let e=Zone.current;return n._zone=e,t.call(e,n,r,i)})}finally{e._decrementTask(o)}})}else o=e._getCurrentSpan(s);try{return t.call(s,n,r,i)}finally{o&&e._shouldCountTask(n,s)&&e._decrementTask(o)}}}_shouldCountTask(e,t){if(e._zone&&(t=e._zone),!t||!e.data||e.data.isPeriodic)return!1;let n=this._getCurrentSpan(t);return!n||!this._spansData.get(n)?!1:e.type===`macroTask`||e.type===`microTask`}_tryToEndSpan(e,t){e&&this._spansData.get(e)&&(e.end(t),this._spansData.delete(e))}enable(){let e=this._getZoneWithPrototype();this._diag.debug(`applying patch to`,this.moduleName,this.version,`zone:`,!!e),e?(k(e.prototype.runTask)&&(this._unwrap(e.prototype,`runTask`),this._diag.debug(`removing previous patch from method runTask`)),k(e.prototype.scheduleTask)&&(this._unwrap(e.prototype,`scheduleTask`),this._diag.debug(`removing previous patch from method scheduleTask`)),k(e.prototype.cancelTask)&&(this._unwrap(e.prototype,`cancelTask`),this._diag.debug(`removing previous patch from method cancelTask`)),this._zonePatched=!0,this._wrap(e.prototype,`runTask`,this._patchZoneRunTask()),this._wrap(e.prototype,`scheduleTask`,this._patchZoneScheduleTask()),this._wrap(e.prototype,`cancelTask`,this._patchZoneCancelTask())):(this._zonePatched=!1,this._getPatchableEventTargets().forEach(e=>{k(e.addEventListener)&&(this._unwrap(e,`addEventListener`),this._diag.debug(`removing previous patch from method addEventListener`)),k(e.removeEventListener)&&(this._unwrap(e,`removeEventListener`),this._diag.debug(`removing previous patch from method removeEventListener`)),this._wrap(e,`addEventListener`,this._patchAddEventListener()),this._wrap(e,`removeEventListener`,this._patchRemoveEventListener())})),this._patchHistoryApi()}disable(){let e=this._getZoneWithPrototype();this._diag.debug(`removing patch from`,this.moduleName,this.version,`zone:`,!!e),e&&this._zonePatched?(k(e.prototype.runTask)&&this._unwrap(e.prototype,`runTask`),k(e.prototype.scheduleTask)&&this._unwrap(e.prototype,`scheduleTask`),k(e.prototype.cancelTask)&&this._unwrap(e.prototype,`cancelTask`)):this._getPatchableEventTargets().forEach(e=>{k(e.addEventListener)&&this._unwrap(e,`addEventListener`),k(e.removeEventListener)&&this._unwrap(e,`removeEventListener`)}),this._unpatchHistoryApi()}_getZoneWithPrototype(){return window.Zone}},to=`open-knowledge-app`,no=!1;function ro(){return{BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.52.1`}?.VITE_OTEL_COLLECTOR_URL??`http://localhost:14318`}function io(){if(no)return;no=!0;let e=null,t=!1;try{let n=ro(),r={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.52.1`};e=new qi({resource:Zr({[Je]:`open-knowledge-app`,[Ye]:r?.VITE_APP_VERSION??`dev`,[Re]:r?.MODE??`dev`}),spanProcessors:[new Ui(new fn({url:`${n}/v1/traces`}),{maxExportBatchSize:50,scheduledDelayMillis:2e3})]}),e.register(),t=!0,Cn({instrumentations:[new sa,new eo({eventNames:[`click`,`submit`]}),new qa({propagateTraceHeaderCorsUrls:[/^https?:\/\/localhost(:\d+)?\/api\//,/^https?:\/\/127\.0\.0\.1(:\d+)?\/api\//,/^\/api\//],clearTimingResources:!0})]}),console.info(`[otel] frontend telemetry initialized — OTLP/HTTP → ${n}/v1/traces`)}catch(n){console.warn(`[otel] frontend telemetry init failed — continuing without`,n),t&&e&&e.shutdown().catch(()=>{}),no=!1}}function ao(){return f.getTracer(to)}export{ao as getAppTracer,io as install};
2
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{a as n,c as r,d as i,f as a,i as o,l as s,n as c,o as l,p as u,r as d,t as f,u as p}from"./trace-api-18gcBe0u.js";import{n as m,r as ee,t as h}from"./propagation-api-PBYTadVM.js";var te=class{constructor(){}createGauge(e,t){return fe}createHistogram(e,t){return pe}createCounter(e,t){return de}createUpDownCounter(e,t){return me}createObservableGauge(e,t){return ge}createObservableCounter(e,t){return he}createObservableUpDownCounter(e,t){return _e}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},g=class{},ne=class extends g{add(e,t){}},re=class extends g{add(e,t){}},ie=class extends g{record(e,t){}},ae=class extends g{record(e,t){}},oe=class{addCallback(e){}removeCallback(e){}},se=class extends oe{},ce=class extends oe{},le=class extends oe{},ue=new te,de=new ne,fe=new ie,pe=new ae,me=new re,he=new se,ge=new ce,_e=new le;function ve(){return ue}var ye;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(ye||={});var be;(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(be||={});var _=p.instance(),xe=new class{getMeter(e,t,n){return ue}},Se=`metrics`,Ce=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalMeterProvider(e){return a(Se,e,p.instance())}getMeterProvider(){return i(Se)||xe}getMeter(e,t,n){return this.getMeterProvider().getMeter(e,t,n)}disable(){u(Se,p.instance())}}.getInstance(),we=class{_delegate;constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}},Te=class extends Error{code;name=`OTLPExporterError`;data;constructor(e,t,n){super(e),this.data=n,this.code=t}};function Ee(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function De(e){if(e!=null)return()=>e}function Oe(e,t,n){return{timeoutMillis:Ee(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}function ke(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}var Ae=class{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw Error(`Concurrency Limit reached`);this._sendingPromises.push(e);let t=()=>{let t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}};function je(e){return new Ae(e.concurrencyLimit)}var Me=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},Ne=performance,Pe=`http.url`,Fe=`http.user_agent`,Ie=Pe,Le=Fe,Re=`deployment.environment.name`,ze=`error.type`,Be=`exception.message`,Ve=`exception.stacktrace`,He=`exception.type`,Ue=`http.request.method`,We=`http.request.method_original`,Ge=`http.response.status_code`,Ke=`server.address`,qe=`server.port`,Je=`service.name`,Ye=`service.version`,Xe=`telemetry.sdk.language`,Ze=`webjs`,Qe=`telemetry.sdk.name`,$e=`telemetry.sdk.version`,et=`url.full`,tt=9,nt=10**6,rt=10**tt;function v(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*nt)]}function it(){let e=Ne.timeOrigin;if(typeof e!=`number`){let t=Ne;e=t.timing&&t.timing.fetchStart}return e}function at(e){return st(v(it()),v(typeof e==`number`?e:Ne.now()))}function y(e){if(ot(e))return e;if(typeof e==`number`)return e<it()?at(e):v(e);if(e instanceof Date)return v(e.getTime());throw TypeError(`Invalid input type`)}function b(e){return e[0]*rt+e[1]}function ot(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function st(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=rt&&(n[1]-=rt,n[0]+=1),n}var x;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(x||={});function ct(e,t){return typeof t==`string`?e===t:!!e.match(t)}function lt(e,t){if(!t)return!1;for(let n of t)if(ct(e,n))return!0;return!1}function ut(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function dt(){return{handleResponse(e){e==null||!ut(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||_.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}var ft=class{_transport;_serializer;_responseHandler;_promiseQueue;_timeout;_diagLogger;constructor(e,t,n,r,i){this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=i,this._diagLogger=_.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:x.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:x.FAILED,error:Error(`Nothing to send`)});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if(e.status===`success`){if(e.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn(`Export succeeded but could not deserialize response - is the response specification compliant?`,t,e.data)}t({code:x.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:x.FAILED,error:e.error});return}else e.status===`retryable`?t({code:x.FAILED,error:new Te(`Export failed with retryable status`)}):t({code:x.FAILED,error:new Te(`Export failed with unknown error`)})},e=>t({code:x.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug(`shutdown started`),await this.forceFlush(),this._transport.shutdown()}};function pt(e,t){return new ft(e.transport,e.serializer,dt(),e.promiseHandler,t.timeout)}function mt(e,t,n){return pt({transport:n,serializer:t,promiseHandler:je(e)},{timeout:e.timeoutMillis})}function ht(e){return e>=48&&e<=57?e-48:e>=97&&e<=102?e-87:e-55}function gt(e){let t=new Uint8Array(e.length/2),n=0;for(let r=0;r<e.length;r+=2){let i=ht(e.charCodeAt(r)),a=ht(e.charCodeAt(r+1));t[n++]=i<<4|a}return t}function _t(e){let t=BigInt(1e9);return BigInt(e[0])*t+BigInt(e[1])}function vt(e){return{low:Number(BigInt.asUintN(32,e)),high:Number(BigInt.asUintN(32,e>>BigInt(32)))}}function yt(e){return vt(_t(e))}function bt(e){return _t(e).toString()}var xt=typeof BigInt<`u`?bt:b;function St(e){return e}function Ct(e){if(e!==void 0)return gt(e)}var wt={encodeHrTime:yt,encodeSpanContext:gt,encodeOptionalSpanContext:Ct};function Tt(e){if(e===void 0)return wt;let t=e.useLongBits??!0,n=e.useHex??!1;return{encodeHrTime:t?yt:xt,encodeSpanContext:n?St:gt,encodeOptionalSpanContext:n?St:Ct}}function Et(e){let t={attributes:S(e.attributes),droppedAttributesCount:0},n=e.schemaUrl;return n&&n!==``&&(t.schemaUrl=n),t}function Dt(e){return{name:e.name,version:e.version}}function S(e){return Object.keys(e).map(t=>Ot(t,e[t]))}function Ot(e,t){return{key:e,value:kt(t)}}function kt(e){let t=typeof e;return t===`string`?{stringValue:e}:t===`number`?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:t===`boolean`?{boolValue:e}:e instanceof Uint8Array?{bytesValue:e}:Array.isArray(e)?{arrayValue:{values:e.map(kt)}}:t===`object`&&e!=null?{kvlistValue:{values:Object.entries(e).map(([e,t])=>Ot(e,t))}}:{}}function At(e,t){let n=e.spanContext(),r=e.status,i=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(n.traceId),spanId:t.encodeSpanContext(n.spanId),parentSpanId:i,traceState:n.traceState?.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:S(e.attributes),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>Mt(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>jt(e,t)),droppedLinksCount:e.droppedLinksCount}}function jt(e,t){return{attributes:e.attributes?S(e.attributes):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0}}function Mt(e,t){return{attributes:e.attributes?S(e.attributes):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function Nt(e,t){return{resourceSpans:Ft(e,Tt(t))}}function Pt(e){let t=new Map;for(let n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));let r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||``}:${n.instrumentationScope.schemaUrl||``}`,i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}function Ft(e,t){let n=Pt(e),r=[],i=n.entries(),a=i.next();for(;!a.done;){let[e,n]=a.value,o=[],s=n.values(),c=s.next();for(;!c.done;){let e=c.value;if(e.length>0){let n=e.map(e=>At(e,t));o.push({scope:Dt(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=Et(e),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}var It={serializeRequest:e=>{let t=Nt(e,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;return JSON.parse(t.decode(e))}},Lt=5,Rt=1e3,zt=5e3,Bt=1.5,Vt=.2;function Ht(){return 2*Vt*Math.random()-Vt}var Ut=class{_transport;constructor(e){this._transport=e}retry(e,t,n){return new Promise((r,i)=>{setTimeout(()=>{this._transport.send(e,t).then(r,i)},n)})}async send(e,t){let n=Date.now()+t,r=await this._transport.send(e,t),i=Lt,a=Rt;for(;r.status===`retryable`&&i>0;){i--;let t=Math.max(Math.min(a,zt)+Ht(),0);a*=Bt;let o=r.retryInMillis??t,s=n-Date.now();if(o>s)return r;r=await this.retry(e,s,o)}return r}shutdown(){return this._transport.shutdown()}};function Wt(e){return new Ut(e.transport)}function Gt(e){return[429,502,503,504].includes(e)}function Kt(e){if(e==null)return;let t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;let n=new Date(e).getTime()-Date.now();return n>=0?n:0}var qt=class{_parameters;constructor(e){this._parameters=e}send(e,t){return new Promise(n=>{let r=new XMLHttpRequest;r.timeout=t,r.open(`POST`,this._parameters.url);let i=this._parameters.headers();Object.entries(i).forEach(([e,t])=>{r.setRequestHeader(e,t)}),r.ontimeout=e=>{n({status:`failure`,error:Error(`XHR request timed out`)})},r.onreadystatechange=()=>{r.status>=200&&r.status<=299?(_.debug(`XHR success`),n({status:`success`})):r.status&&Gt(r.status)?n({status:`retryable`,retryInMillis:Kt(r.getResponseHeader(`Retry-After`))}):r.status!==0&&n({status:`failure`,error:Error(`XHR request failed with non-retryable status`)})},r.onabort=()=>{n({status:`failure`,error:Error(`XHR request aborted`)})},r.onerror=()=>{n({status:`failure`,error:Error(`XHR request errored`)})},r.send(e)})}shutdown(){}};function Jt(e){return new qt(e)}var Yt=class{_params;constructor(e){this._params=e}send(e){return new Promise(t=>{navigator.sendBeacon(this._params.url,new Blob([e],{type:this._params.blobType}))?(_.debug(`SendBeacon success`),t({status:`success`})):t({status:`failure`,error:Error(`SendBeacon failed`)})})}shutdown(){}};function Xt(e){return new Yt(e)}var Zt=class{_parameters;constructor(e){this._parameters=e}async send(e,t){let n=new AbortController,r=setTimeout(()=>n.abort(),t);try{let t=!!globalThis.location,r=new URL(this._parameters.url),i=await fetch(r.href,{method:`POST`,headers:this._parameters.headers(),body:e,signal:n.signal,keepalive:t,mode:t?globalThis.location?.origin===r.origin?`same-origin`:`cors`:`no-cors`});return i.status>=200&&i.status<=299?(_.debug(`response success`),{status:`success`}):Gt(i.status)?{status:`retryable`,retryInMillis:Kt(i.headers.get(`Retry-After`))}:{status:`failure`,error:Error(`Fetch request failed with non-retryable status`)}}catch(e){return e?.name===`AbortError`?{status:`failure`,error:Error(`Fetch request timed out`,{cause:e})}:{status:`failure`,error:Error(`Fetch request errored`,{cause:e})}}finally{clearTimeout(r)}}shutdown(){}};function Qt(e){return new Zt(e)}function $t(e,t){return mt(e,t,Wt({transport:Jt(e)}))}function en(e,t){return mt(e,t,Wt({transport:Qt(e)}))}function tn(e,t){return mt(e,t,Wt({transport:Xt({url:e.url,blobType:e.headers()[`Content-Type`]})}))}function nn(e){return()=>{let t={};return Object.entries(e?.()??{}).forEach(([e,n])=>{n===void 0?_.warn(`Header "${e}" has invalid value (${n}) and will be ignored`):t[e]=String(n)}),t}}function rn(e,t,n){let r={...n()},i={};return()=>(t!=null&&Object.assign(i,t()),e!=null&&Object.assign(i,e()),Object.assign(i,r))}function an(e){if(e!=null)try{let t=globalThis.location?.href;return new URL(e,t).href}catch{throw Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function on(n){return async r=>{let{Agent:i}=await t(()=>import(`./__vite-browser-external-DD8Jl_VU.js`).then(t=>e(t.default)),__vite__mapDeps([0,1]),import.meta.url);return new i(n)}}function sn(e,t,n){return{...Oe(e,t,n),headers:rn(nn(e.headers),t.headers,n.headers),url:an(e.url)??t.url??n.url,agentFactory:e.agentFactory??t.agentFactory??n.agentFactory}}function cn(e,t){return{...ke(),headers:()=>e,url:`http://localhost:4318/`+t,agentFactory:on({keepAlive:!0})}}function ln(e,t,n){return sn({url:e.url,timeoutMillis:e.timeoutMillis,headers:De(e.headers),concurrencyLimit:e.concurrencyLimit},{},cn(n,t))}function un(e,t,n,r){return dn(e.headers)(ln(e,n,r),t)}function dn(e){return!e&&typeof navigator.sendBeacon==`function`?tn:globalThis.fetch===void 0?$t:en}var fn=class extends we{constructor(e={}){super(un(e,It,`v1/traces`,{"Content-Type":`application/json`}))}},pn=class{emit(e){}},mn=new pn,hn=new class{getLogger(e,t,n){return new pn}},gn=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):mn}},_n=class{getLogger(e,t,n){return this._getDelegateLogger(e,t,n)??new gn(this,e,t,n)}_getDelegate(){return this._delegate??hn}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,n){return this._delegate?.getLogger(e,t,n)}},vn=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{},C=Symbol.for(`io.opentelemetry.js.api.logs`),w=vn;function yn(e,t,n){return r=>r===e?t:n}var bn=class e{constructor(){this._proxyLoggerProvider=new _n}static getInstance(){return this._instance||=new e,this._instance}setGlobalLoggerProvider(e){return w[C]?this.getLoggerProvider():(w[C]=yn(1,e,hn),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){return w[C]?.call(w,1)??this._proxyLoggerProvider}getLogger(e,t,n){return this.getLoggerProvider().getLogger(e,t,n)}disable(){delete w[C],this._proxyLoggerProvider=new _n}}.getInstance();function xn(e,t,n,r){for(let i=0,a=e.length;i<a;i++){let a=e[i];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}function Sn(e){e.forEach(e=>e.disable())}function Cn(e){let t=e.tracerProvider||f.getTracerProvider(),n=e.meterProvider||Ce.getMeterProvider(),r=e.loggerProvider||bn.getLoggerProvider(),i=e.instrumentations?.flat()??[];return xn(i,t,n,r),()=>{Sn(i)}}var T=console.error.bind(console);function E(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}var wn=(e,t,n)=>{if(!e||!e[t]){T(`no original function `+String(t)+` to wrap`);return}if(!n){T(`no wrapper function`),T(Error().stack);return}let r=e[t];if(typeof r!=`function`||typeof n!=`function`){T(`original object and wrapper must be functions`);return}let i=n(r,t);return E(i,`__original`,r),E(i,`__unwrap`,()=>{e[t]===i&&E(e,t,r)}),E(i,`__wrapped`,!0),E(e,t,i),i},Tn=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{T(`must provide one or more modules to patch`),T(Error().stack);return}if(!(t&&Array.isArray(t))){T(`must provide one or more functions to wrap on modules`);return}e.forEach(e=>{t.forEach(t=>{wn(e,t,n)})})},En=(e,t)=>{if(!e||!e[t]){T(`no function to unwrap.`),T(Error().stack);return}let n=e[t];if(!n.__unwrap)T(`no original to unwrap to -- has `+String(t)+` already been unwrapped?`);else{n.__unwrap();return}},Dn=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{T(`must provide one or more modules to patch`),T(Error().stack);return}if(!(t&&Array.isArray(t))){T(`must provide one or more functions to unwrap on modules`);return}e.forEach(e=>{t.forEach(t=>{En(e,t)})})};function D(e){e&&e.logger&&(typeof e.logger==`function`?T=e.logger:T(`new logger isn't a function, not replacing`))}D.wrap=wn,D.massWrap=Tn,D.unwrap=En,D.massUnwrap=Dn;var On=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,t,n){this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(n),this._diag=_.createComponentLogger({namespace:e}),this._tracer=f.getTracer(e,t),this._meter=Ce.getMeter(e,t),this._logger=bn.getLogger(e,t),this._updateMetricInstruments()}_wrap=wn;_unwrap=En;_massWrap=Tn;_massUnwrap=Dn;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,n,r){if(e)try{e(n,r)}catch(e){this._diag.error(`Error running span customization hook due to exception in handler`,{triggerName:t},e)}}},kn=class extends On{constructor(e,t,n){super(e,t,n),this._config.enabled&&this.enable()}};function O(e,t,n){let r,i;try{i=e()}catch(e){r=e}finally{if(t(r,i),r&&!n)throw r;return i}}function k(e){return typeof e==`function`&&typeof e.__original==`function`&&typeof e.__unwrap==`function`&&e.__wrapped===!0}var A;(function(e){e[e.STABLE=1]=`STABLE`,e[e.OLD=2]=`OLD`,e[e.DUPLICATE=3]=`DUPLICATE`})(A||={});function An(e,t){let n=A.OLD,r=t?.split(`,`).map(e=>e.trim()).filter(e=>e!==``);for(let t of r??[])if(t.toLowerCase()===e+`/dup`){n=A.DUPLICATE;break}else t.toLowerCase()===e&&(n=A.STABLE);return n}var jn=s(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function Mn(e){return e.setValue(jn,!0)}function Nn(e){return e.getValue(jn)===!0}var Pn=`baggage`,Fn=4096;function In(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function Ln(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=`;`+t.metadata.toString()),n})}function Rn(e){if(!e)return;let t=e.indexOf(`;`),n=t===-1?e:e.substring(0,t),r=n.indexOf(`=`);if(r<=0)return;let i=n.substring(0,r).trim(),a=n.substring(r+1).trim();if(!i||!a)return;let o,s;try{o=decodeURIComponent(i),s=decodeURIComponent(a)}catch{return}let c;return t!==-1&&t<e.length-1&&(c=ee(e.substring(t+1))),{key:o,value:s,metadata:c}}function zn(e,t,n,r){let i=0;for(;i<e.length&&n<180;){let a=e.indexOf(`,`,i),o=a===-1?e.length:a,s=o-i;if(s<=4096){let a=Rn(e.substring(i,o));if(a){let e=(n===0?0:1)+s;if(r+e>8192)break;t[a.key]=a.metadata?{value:a.value,metadata:a.metadata}:{value:a.value},n++,r+=e}}if(a===-1)break;i=a+1}return[n,r]}var Bn=class{inject(e,t,n){let r=h.getBaggage(e);if(!r||Nn(e))return;let i=In(Ln(r).filter(e=>e.length<=Fn).slice(0,180));i.length>0&&n.set(t,Pn,i)}extract(e,t,n){let r=n.get(t,Pn);if(!r)return e;let i={},a=0,o=0;if(Array.isArray(r))for(let e=0;e<r.length;e++)[a,o]=zn(r[e],i,a,o);else [a]=zn(r,i,a,o);return a===0?e:h.setBaggage(e,h.createBaggage(i))}fields(){return[Pn]}};function j(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!Vn(n)){_.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Hn(r)){_.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function Vn(e){return typeof e==`string`&&e!==``}function Hn(e){return e==null?!0:Array.isArray(e)?Un(e):Wn(typeof e)}function Un(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(Wn(e)){t=e;continue}return!1}return!1}}return!0}function Wn(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function Gn(){return e=>{_.error(Kn(e))}}function Kn(e){return typeof e==`string`?e:JSON.stringify(qn(e))}function qn(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var Jn=Gn();function M(e){try{Jn(e)}catch{}}var Yn=`2.9.0`,Xn=`process.runtime.name`,Zn={[Qe]:`opentelemetry`,[Xn]:`browser`,[Xe]:Ze,[$e]:Yn},N=performance,Qn=9,$n=10**6,er=10**Qn;function P(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*$n)]}function tr(e){return ar(P(N.timeOrigin),P(typeof e==`number`?e:N.now()))}function nr(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=er),[n,r]}function rr(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function ir(e){return rr(e)||typeof e==`number`||e instanceof Date}function ar(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=er&&(n[1]-=er,n[0]+=1),n}var or;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(or||={});var sr=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[];let t=new Set;for(let e of this._propagators){let n=typeof e.fields==`function`?e.fields():[];for(let e of n)t.add(e)}this._fields=Array.from(t)}inject(e,t,n){for(let r of this._propagators)try{r.inject(e,t,n)}catch(e){_.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){_.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}},cr=`[_0-9a-z-*/]`,lr=`[a-z]${cr}{0,255}`,ur=`[a-z0-9]${cr}{0,240}@[a-z]${cr}{0,13}`,dr=RegExp(`^(?:${lr}|${ur})$`),fr=/^[ -~]{0,255}[!-~]$/,pr=/,|=/;function mr(e){return dr.test(e)}function hr(e){return fr.test(e)&&!pr.test(e)}var gr=32,_r=512,vr=`,`,yr=`=`,br=class e{_length;_rawTraceState;_internalState;constructor(e){this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,t){if(!mr(e)||!hr(t))return this;let n=this._getState(),r=n.get(e),i=this._length;if(typeof r==`string`?i+=t.length-r.length:i+=e.length+t.length+(n.size>0?2:1),i>_r)return this;let a=new Map(n);return a.delete(e),a.set(e,t),this._fromState(a,i)}unset(e){let t=this._getState(),n=t.get(e);if(typeof n!=`string`)return this;let r=this._length-(e.length+n.length+1);t.size>1&&--r;let i=new Map(t);return i.delete(e),this._fromState(i,r)}get(e){return this._getState().get(e)}serialize(){let e=``,t=0;for(let n of this._getState())t>0&&(e=vr+e),e=`${n[0]}${yr}${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(vr),t=new Map,n=0;for(let r of e){let e=r.trim(),i=e.indexOf(yr);if(i===-1)continue;let a=e.slice(0,i),o=e.slice(i+1);if(!mr(a)||!hr(o))continue;let s=n+e.length+ +(t.size>0);if(!(s>_r)&&(t.set(a,o),n=s,t.size>=gr))break}return this._length=n,this._internalState=new Map(Array.from(t.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}},F=`traceparent`,xr=`tracestate`,Sr=`00`,Cr=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function wr(e){let t=Cr.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var Tr=class{inject(e,t,n){let r=f.getSpanContext(e);if(!r||Nn(e)||!d(r))return;let i=`${Sr}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||l.NONE).toString(16)}`;n.set(t,F,i),r.traceState&&n.set(t,xr,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,F);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=wr(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,xr);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new br(typeof e==`string`?e:void 0)}return f.setSpanContext(e,a)}fields(){return[F,xr]}},Er=`[object Object]`,Dr=`[object Null]`,Or=`[object Undefined]`,kr=Function.prototype.toString,Ar=kr.call(Object),jr=Object.getPrototypeOf,Mr=Object.prototype,Nr=Mr.hasOwnProperty,I=Symbol?Symbol.toStringTag:void 0,Pr=Mr.toString;function Fr(e){if(!Ir(e)||Lr(e)!==Er)return!1;let t=jr(e);if(t===null)return!0;let n=Nr.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&kr.call(n)===Ar}function Ir(e){return typeof e==`object`&&!!e}function Lr(e){return e==null?e===void 0?Or:Dr:I&&I in Object(e)?Rr(e):zr(e)}function Rr(e){let t=Nr.call(e,I),n=e[I],r=!1;try{e[I]=void 0,r=!0}catch{}let i=Pr.call(e);return r&&(t?e[I]=n:delete e[I]),i}function zr(e){return Pr.call(e)}var Br=20;function Vr(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=Ur(t,e.shift(),0,n);return t}function Hr(e){return L(e)?e.slice():e}function Ur(e,t,n=0,r){let i;if(!(n>Br)){if(n++,z(e)||z(t)||Gr(t))i=Hr(t);else if(L(e)){if(i=e.slice(),L(t))for(let e=0,n=t.length;e<n;e++)i.push(Hr(t[e]));else if(R(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=Hr(t[r]))}}}else if(R(e))if(R(t)){if(!Kr(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(z(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(Wr(e,s,r)||Wr(t,s,r))delete i[s];else{if(R(a)&&R(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=Ur(i[s],c,n,r)}}}}else i=t;return i}}function Wr(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function L(e){return Array.isArray(e)}function Gr(e){return typeof e==`function`}function R(e){return!z(e)&&!L(e)&&!Gr(e)&&typeof e==`object`}function z(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function Kr(e,t){return!(!Fr(e)||!Fr(t))}var qr=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}},Jr=class{_isCalled=!1;_deferred=new qr;_callback;_that;constructor(e,t){this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}},B;function Yr(){if(B===void 0)try{let e=globalThis.process.argv0;B=e?`unknown_service:${e}`:`unknown_service`}catch{B=`unknown_service`}return B}var V=e=>typeof e==`object`&&!!e&&typeof e.then==`function`,Xr=class e{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=$r(t),r._asyncAttributesPending=t.filter(([e,t])=>V(t)).length>0,r}constructor(e,t){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(V(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=$r(this._rawAttributes),this._schemaUrl=ei(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,V(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&_.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(V(n)){_.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]??=n)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=ti(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function Zr(e,t){return Xr.FromAttributeList(Object.entries(e),t)}function Qr(){return Zr({[Je]:Yr(),[Xe]:Zn[Xe],[Qe]:Zn[Qe],[$e]:Zn[$e]})}function $r(e){return e.map(([e,t])=>V(t)?[e,t.catch(t=>{_.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function ei(e){if(typeof e==`string`||e===void 0)return e;_.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function ti(e,t){let n=e?.schemaUrl,r=t?.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;_.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var ni=`exception`,ri=Symbol.for(`nodejs.util.inspect.custom`);function ii(e){let t={};for(let[n,r]of e.getRawAttributes())typeof r?.then!=`function`&&r!=null&&(t[n]??=r);return t}function ai(e,t,n,r,i){if(typeof n==`number`&&n<0){let t=`[${e}]`;return r?.stylize?r.stylize(t,`special`):t}return typeof i!=`function`||!r?t:`${e} ${i(t,{...r,depth:r.depth==null?r.depth:r.depth-1})}`}var oi=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:c.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){let t=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=N.now(),this._performanceOffset=t-(this._performanceStartTime+N.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let t of e.links)this.addLink(t);this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(t==null||this._isSpanEnded())return this;if(e.length===0)return _.warn(`Invalid attribute key: ${e}`),this;if(!Hn(t))return _.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return _.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&_.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),ir(t)&&(ir(n)||(n=t),t=void 0);let i=j(t),{attributePerEventCountLimit:a}=this._spanLimits,o={},s=0,c=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];if(a!==void 0&&c>=a){s++;continue}o[e]=this._truncateToSize(t),c++}return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:s}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(t===0)return this._droppedLinksCount++,this;t!==void 0&&this.links.length>=t&&(this._droppedLinksCount===0&&_.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=j(e.attributes),i={},a=0,o=0;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=r[e];if(n!==void 0&&o>=n){a++;continue}i[e]=this._truncateToSize(t),o++}let s={context:e.context};return o>0&&(s.attributes=i),a>0&&(s.droppedAttributesCount=a),this.links.push(s),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===c.UNSET||this.status.code===c.OK)return this;let t={code:e.code};return e.code===c.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&_.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){if(this._isSpanEnded()){_.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=nr(this.startTime,this.endTime),this._duration[0]<0&&(_.warn(`Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.`,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&_.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&_.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==`number`&&e<=N.now())return tr(e+this._performanceOffset);if(typeof e==`number`)return P(e);if(e instanceof Date)return P(e.getTime());if(rr(e))return e;if(this._startTimeProvided)return P(Date.now());let t=N.now()-this._performanceStartTime;return ar(this.startTime,P(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[Be]=e:e&&(e.code?n[He]=e.code.toString():e.name&&(n[He]=e.name),e.message&&(n[Be]=e.message),e.stack&&(n[Ve]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(ni,n,t):_.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);_.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(_.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==`string`?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>typeof e==`string`?this._truncateToLimitUtil(e,t):e):e}[ri](e,t,n){return ai(`SpanImpl`,{name:this.name,kind:this.kind,spanContext:this._spanContext,parentSpanContext:this.parentSpanContext,status:this.status,startTime:this.startTime,endTime:this.endTime,duration:this._duration,ended:this._ended,attributes:this.attributes,events:this.events,links:this.links,droppedAttributesCount:this._droppedAttributesCount,droppedEventsCount:this._droppedEventsCount,droppedLinksCount:this._droppedLinksCount,instrumentationScope:this.instrumentationScope,resource:{attributes:ii(this.resource)}},e,t,n)}},H;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(H||={});var si=`otel.component.name`,ci=`otel.component.type`,li=`otel.span.parent.origin`,ui=`otel.span.sampling_result`,di=`otel.sdk.processor.span.processed`,fi=`otel.sdk.processor.span.queue.capacity`,pi=`otel.sdk.processor.span.queue.size`,mi=`otel.sdk.span.live`,hi=`otel.sdk.span.started`,gi=`batching_span_processor`,_i=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(hi,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(mi,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=yi(t);if(this.startedSpans.add(1,{[li]:vi(e),[ui]:n}),t===H.NOT_RECORD)return()=>{};let r={[ui]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function vi(e){return e?e.isRemote?`remote`:`local`:`none`}function yi(e){switch(e){case H.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case H.RECORD:return`RECORD_ONLY`;case H.NOT_RECORD:return`DROP`}}var bi=`2.9.0`,xi=class{_sampler;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,t){this.instrumentationScope=e,this._sampler=t.sampler,this._spanLimits=t.spanLimits,this._resource=t.resource,this._idGenerator=t.idGenerator,this._spanProcessor=t.spanProcessor,this._tracerMetrics=new _i(t.meterProvider.getMeter(`@opentelemetry/sdk-trace`,bi))}startSpan(e,t={},r=m.active()){t.root&&(r=f.deleteSpan(r));let i=f.getSpan(r);if(Nn(r))return _.debug(`Instrumentation suppressed, returning Noop Span`),f.wrapSpanContext(n);let a=i?.spanContext(),o=this._idGenerator.generateSpanId(),s,c,u;!a||!f.isSpanContextValid(a)?c=this._idGenerator.generateTraceId():(c=a.traceId,u=a.traceState,s=a);let d=t.kind??be.INTERNAL,p=(t.links??[]).map(e=>({context:e.context,attributes:j(e.attributes)})),ee=j(t.attributes),h=this._sampler.shouldSample(r,c,e,d,ee,p),te=this._tracerMetrics.startSpan(a,h.decision);u=h.traceState??u;let g=h.decision===ye.RECORD_AND_SAMPLED?l.SAMPLED:l.NONE,ne={traceId:c,spanId:o,traceFlags:g,traceState:u};if(h.decision===ye.NOT_RECORD)return _.debug(`Recording is off, propagating context in a non-recording span`),f.wrapSpanContext(ne);let re=j(Object.assign(ee,h.attributes));return new oi({resource:this._resource,scope:this.instrumentationScope,context:r,spanContext:ne,name:e,kind:d,links:p,parentSpanContext:s,attributes:re,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:te})}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a??m.active(),c=this.startSpan(e,i,s),l=f.setSpan(s,c);return m.with(l,o,void 0,c)}[ri](e,t,n){return ai(`Tracer`,{instrumentationScope:this.instrumentationScope,resource:{attributes:ii(this._resource)},spanLimits:this._spanLimits},e,t,n)}},Si=class{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{M(e||Error(`MultiSpanProcessor: forceFlush failed`)),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}},U=class{shouldSample(){return{decision:H.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},W=class{shouldSample(){return{decision:H.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}},G=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||=(M(Error(`ParentBasedSampler must have a root sampler configured`)),new W),this._remoteParentSampled=e.remoteParentSampled??new W,this._remoteParentNotSampled=e.remoteParentNotSampled??new U,this._localParentSampled=e.localParentSampled??new W,this._localParentNotSampled=e.localParentNotSampled??new U}shouldSample(e,t,n,r,i,a){let o=f.getSpanContext(e);return!o||!d(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&l.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&l.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,i,a):this._localParentNotSampled.shouldSample(e,t,n,r,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}},Ci=new Map,wi=class{processedSpans;queueSize;queueSizeCallback;standardAttrs;droppedAttrs;constructor(e,t,n){let r=Ci.get(e)??0;if(Ci.set(e,r+1),this.standardAttrs={[ci]:e,[si]:`${e}/${r}`},this.droppedAttrs={...this.standardAttrs,[ze]:`queue_full`},this.processedSpans=t.createCounter(di,{unit:`{span}`,description:`The number of spans for which the processing has finished, either successful or failed.`}),n){let{capacity:e,getQueueSize:r}=n;t.createUpDownCounter(fi,{unit:`{span}`,description:`The maximum number of spans the queue of a given instance of an SDK span processor can hold.`}).add(e,this.standardAttrs),this.queueSize=t.createObservableUpDownCounter(pi,{unit:`{span}`,description:`The number of spans in the queue of a given instance of an SDK span processor.`}),this.queueSizeCallback=e=>e.observe(r(),this.standardAttrs),this.queueSize.addCallback(this.queueSizeCallback)}}dropSpans(e){this.processedSpans.add(e,this.droppedAttrs)}finishSpans(e,t){if(!t){this.processedSpans.add(e,this.standardAttrs);return}let n={...this.standardAttrs,[ze]:t.name};this.processedSpans.add(e,n)}shutdown(){this.queueSize&&this.queueSizeCallback&&this.queueSize.removeCallback(this.queueSizeCallback)}},Ti=class{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_metrics;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(e){this._exporter=e.exporter,this._maxExportBatchSize=e.maxExportBatchSize??512,this._maxQueueSize=e.maxQueueSize??2048,this._scheduledDelayMillis=e.scheduledDelayMillis??5e3,this._exportTimeoutMillis=e.exportTimeoutMillis??3e4,this._shutdownOnce=new Jr(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(_.warn(`BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize`),this._maxExportBatchSize=this._maxQueueSize),this._metrics=new wi(gi,e.selfObsMeterProvider?e.selfObsMeterProvider.getMeter(`@opentelemetry/sdk-trace`):ve(),{capacity:this._maxQueueSize,getQueueSize:()=>this._finishedSpans.length})}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&l.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>(this._metrics.shutdown(),this._exporter.shutdown()))}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&_.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++,this._metrics.dropSpans(1);return}this._droppedSpansCount>0&&(_.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let e=0,t=r;e<t;e++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`Timeout`))},this._exportTimeoutMillis);m.with(Mn(m.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(r,i=>{clearTimeout(n),this._metrics.finishSpans(r.length,i.error),i.code===or.SUCCESS?e():t(i.error??Error(`BatchSpanProcessor: span export failed`))}),a=null;for(let e=0,t=r.length;e<t;e++){let t=r[e];t.resource.asyncAttributesPending&&t.resource.waitForAsyncAttributes&&(a??=[],a.push(t.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,e=>{M(e),t(e)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{this._isExporting=!1,M(e)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},Ei=class extends Ti{_visibilityChangeListener;_pageHideListener;constructor(e){super(e),this.onInit(e)}onInit(e){e.disableAutoFlushOnDocumentHide!==!0&&typeof document<`u`&&(this._visibilityChangeListener=()=>{document.visibilityState===`hidden`&&this.forceFlush().catch(e=>{M(e)})},this._pageHideListener=()=>{this.forceFlush().catch(e=>{M(e)})},document.addEventListener(`visibilitychange`,this._visibilityChangeListener),document.addEventListener(`pagehide`,this._pageHideListener))}onShutdown(){typeof document<`u`&&(this._visibilityChangeListener&&document.removeEventListener(`visibilitychange`,this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener(`pagehide`,this._pageHideListener))}},Di=16,Oi=8,ki=new Uint8Array(Di),Ai=new Uint8Array(Oi),ji=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Mi(e){for(let t=0;t<e.length;t++)e[t]=Math.random()*256>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function Ni(e){let t=``;for(let n=0;n<e.length;n++)t+=ji[e[n]];return t}var Pi=class{generateTraceId(){return Mi(ki),Ni(ki)}generateSpanId(){return Mi(Ai),Ni(Ai)}},K;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(K||={});var Fi=class{_resource;_activeSpanProcessor;_forceFlushTimeoutMillis;_tracerOptions;_tracers=new Map;constructor(e={}){this._forceFlushTimeoutMillis=e.forceFlushTimeoutMillis??3e4,this._resource=e.resource??Qr(),this._activeSpanProcessor=new Si(e.spanProcessors??[]),this._tracerOptions={resource:this._resource,sampler:e.sampler??new G({root:new W}),spanLimits:{attributeCountLimit:e.spanLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.spanLimits?.attributeValueLengthLimit??1/0,eventCountLimit:e.spanLimits?.eventCountLimit??128,linkCountLimit:e.spanLimits?.linkCountLimit??128,attributePerEventCountLimit:e.spanLimits?.attributePerEventCountLimit??128,attributePerLinkCountLimit:e.spanLimits?.attributePerLinkCountLimit??128},idGenerator:e.idGenerator||new Pi,spanProcessor:this._activeSpanProcessor,meterProvider:e.meterProvider??{getMeter(){return ve()}}}}getTracer(e,t,n){let r=`${e}@${t||``}:${n?.schemaUrl||``}`;return this._tracers.has(r)||this._tracers.set(r,new xi({name:e,version:t,schemaUrl:n?.schemaUrl},this._tracerOptions)),this._tracers.get(r)}forceFlush(){let e=this._forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r,i=setTimeout(()=>{n(Error(`Span processor did not completed within timeout period of ${e} ms`)),r=K.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==K.timeout&&(r=K.resolved,n(r))}).catch(e=>{clearTimeout(i),r=K.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==K.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}[ri](e,t,n){let r=this._activeSpanProcessor._spanProcessors;return ai(`TracerProvider`,{resource:{attributes:ii(this._resource)},tracers:Array.from(this._tracers.keys()),spanProcessors:r.map(e=>e.constructor?.name??`SpanProcessor`)},e,t,n)}},Ii=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:o(t)&&this._accumulate(t)<this._upperBound?H.RECORD_AND_SAMPLED:H.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=`number`||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<32;n+=8){let r=0;for(let t=0;t<8;t++){let i=e.charCodeAt(n+t),a=i<58?i-48:i<71?i-55:i-87;r=r<<4|a}t=(t^r)>>>0}return t}},q;(function(e){e.AlwaysOff=`always_off`,e.AlwaysOn=`always_on`,e.ParentBasedAlwaysOff=`parentbased_always_off`,e.ParentBasedAlwaysOn=`parentbased_always_on`,e.ParentBasedTraceIdRatio=`parentbased_traceidratio`,e.TraceIdRatio=`traceidratio`})(q||={});var Li=1;function Ri(){return{sampler:zi(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function zi(){let e=q.ParentBasedAlwaysOn;switch(e){case q.AlwaysOn:return new W;case q.AlwaysOff:return new U;case q.ParentBasedAlwaysOn:return new G({root:new W});case q.ParentBasedAlwaysOff:return new G({root:new U});case q.TraceIdRatio:return new Ii(Bi());case q.ParentBasedTraceIdRatio:return new G({root:new Ii(Bi())});default:return _.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${q.ParentBasedAlwaysOn}".`),new G({root:new W})}}function Bi(){return _.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Li}.`),Li}function Vi(e){let t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??void 0??void 0??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??void 0??void 0??1/0,Object.assign({},e,{spanLimits:t})}var Hi=class extends Fi{constructor(e={}){let t=Vr({},Ri(),Vi(e));delete t.generalLimits,super(t)}},Ui=class extends Ei{constructor(e,t){t||={};for(let[e,n]of[[`maxExportBatchSize`,`OTEL_BSP_MAX_EXPORT_BATCH_SIZE`],[`maxQueueSize`,`OTEL_BSP_MAX_QUEUE_SIZE`],[`scheduledDelayMillis`,`OTEL_BSP_SCHEDULE_DELAY`],[`exportTimeoutMillis`,`OTEL_BSP_EXPORT_TIMEOUT`]])t[e];super({exporter:e,...t})}},Wi=class{_enabled=!1;_currentContext=r;_bindFunction(e=r,t){let n=this,i=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(i,`length`,{enumerable:!1,configurable:!0,writable:!1,value:t.length}),i}active(){return this._currentContext}bind(e,t){return e===void 0&&(e=this.active()),typeof t==`function`?this._bindFunction(e,t):t}disable(){return this._currentContext=r,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=r,this)}with(e,t,n,...i){let a=this._currentContext;this._currentContext=e||r;try{return t.call(n,...i)}finally{this._currentContext=a}}};function Gi(e){if(e!==null){if(e===void 0){let e=new Wi;e.enable(),m.setGlobalContextManager(e);return}e.enable(),m.setGlobalContextManager(e)}}function Ki(e){if(e!==null){if(e===void 0){h.setGlobalPropagator(new sr({propagators:[new Tr,new Bn]}));return}h.setGlobalPropagator(e)}}var qi=class extends Hi{constructor(e={}){super(e)}register(e={}){f.setGlobalTracerProvider(this),Ki(e.propagator),Gi(e.contextManager)}},J;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(J||={});var Ji=`http.response_content_length`,Yi=`http.response_content_length_uncompressed`;function Y(e,t){return t in e}function X(e,t,n,r=!0){if(Y(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function Xi(e,t,n=!1,r,i){if(r===void 0&&(r=t[J.START_TIME]!==0),n||(X(e,J.FETCH_START,t,r),X(e,J.DOMAIN_LOOKUP_START,t,r),X(e,J.DOMAIN_LOOKUP_END,t,r),X(e,J.CONNECT_START,t,r),X(e,J.SECURE_CONNECTION_START,t,r),X(e,J.CONNECT_END,t,r),X(e,J.REQUEST_START,t,r),X(e,J.RESPONSE_START,t,r),X(e,J.RESPONSE_END,t,r)),!i){let n=t[J.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(Ji,n);let r=t[J.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(Yi,r)}}function Zi(e,t){if(e.nodeType===Node.DOCUMENT_NODE)return`/`;let n=$i(e,t);if(t&&n.indexOf(`@id`)>0)return n;let r=``;return e.parentNode&&(r+=Zi(e.parentNode,t)),r+=n,r}function Qi(e){if(!e.parentNode)return 0;let t=[e.nodeType];e.nodeType===Node.CDATA_SECTION_NODE&&t.push(Node.TEXT_NODE);let n=Array.from(e.parentNode.childNodes);return n=n.filter(n=>{let r=n.localName;return t.indexOf(n.nodeType)>=0&&r===e.localName}),n.length>=1?n.indexOf(e)+1:0}function $i(e,t){let n=e.nodeType,r=Qi(e),i;if(n===Node.ELEMENT_NODE){let n=e.getAttribute(`id`);if(t&&n)return`//*[@id="${n}"]`;i=e.localName}else if(n===Node.TEXT_NODE||n===Node.CDATA_SECTION_NODE)i=`text()`;else if(n===Node.COMMENT_NODE)i=`comment()`;else return``;return i&&r>1?`/${i}[${r}]`:`/${i}`}var ea;(function(e){e.DOCUMENT_LOAD=`documentLoad`,e.DOCUMENT_FETCH=`documentFetch`,e.RESOURCE_FETCH=`resourceFetch`})(ea||={});var ta=`0.49.0`,na=`@opentelemetry/instrumentation-document-load`,ra;(function(e){e.FIRST_PAINT=`firstPaint`,e.FIRST_CONTENTFUL_PAINT=`firstContentfulPaint`})(ra||={});var ia=()=>{let e={},t=N.getEntriesByType?.(`navigation`)[0];if(t)Object.values(J).forEach(n=>{if(Y(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}});else{let t=N.timing;t&&Object.values(J).forEach(n=>{if(Y(t,n)){let r=t[n];typeof r==`number`&&(e[n]=r)}})}return e},aa={"first-paint":ra.FIRST_PAINT,"first-contentful-paint":ra.FIRST_CONTENTFUL_PAINT},oa=e=>{let t=N.getEntriesByType?.(`paint`);t&&t.forEach(({name:t,startTime:n})=>{Y(aa,t)&&e.addEvent(aa[t],n)})},sa=class extends kn{component=`document-load`;version=`1`;moduleName=this.component;constructor(e={}){super(na,ta,e)}init(){}_onDocumentLoaded(){window.setTimeout(()=>{this._collectPerformance()})}_addResourcesSpans(e){let t=N.getEntriesByType?.(`resource`);t&&t.forEach(t=>{this._initResourceSpan(t,e)})}_collectPerformance(){let e=Array.from(document.getElementsByTagName(`meta`)).find(e=>e.getAttribute(`name`)===F),t=ia(),n=e&&e.content||``;m.with(h.extract(r,{traceparent:n}),()=>{let e=this._startSpan(ea.DOCUMENT_LOAD,J.FETCH_START,t);e&&(m.with(f.setSpan(m.active(),e),()=>{let e=this._startSpan(ea.DOCUMENT_FETCH,J.FETCH_START,t);e&&(e.setAttribute(Ie,location.href),m.with(f.setSpan(m.active(),e),()=>{Xi(e,t,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentFetch),this._endSpan(e,J.RESPONSE_END,t)}))}),e.setAttribute(Ie,location.href),e.setAttribute(Le,navigator.userAgent),this._addResourcesSpans(e),this.getConfig().ignoreNetworkEvents||(X(e,J.FETCH_START,t),X(e,J.UNLOAD_EVENT_START,t),X(e,J.UNLOAD_EVENT_END,t),X(e,J.DOM_INTERACTIVE,t),X(e,J.DOM_CONTENT_LOADED_EVENT_START,t),X(e,J.DOM_CONTENT_LOADED_EVENT_END,t),X(e,J.DOM_COMPLETE,t),X(e,J.LOAD_EVENT_START,t),X(e,J.LOAD_EVENT_END,t)),this.getConfig().ignorePerformancePaintEvents||oa(e),this._addCustomAttributesOnSpan(e,this.getConfig().applyCustomAttributesOnSpan?.documentLoad),this._endSpan(e,J.LOAD_EVENT_END,t))})}_endSpan(e,t,n){e&&(Y(n,t)?e.end(n[t]):e.end())}_initResourceSpan(e,t){let n=this._startSpan(ea.RESOURCE_FETCH,J.FETCH_START,e,t);n&&(n.setAttribute(Ie,e.name),Xi(n,e,this.getConfig().ignoreNetworkEvents),this._addCustomAttributesOnResourceSpan(n,e,this.getConfig().applyCustomAttributesOnSpan?.resourceFetch),this._endSpan(n,J.RESPONSE_END,e))}_startSpan(e,t,n,r){if(Y(n,t)&&typeof n[t]==`number`)return this.tracer.startSpan(e,{startTime:n[t]},r?f.setSpan(m.active(),r):void 0)}_waitForPageLoad(){window.document.readyState===`complete`?this._onDocumentLoaded():(this._onDocumentLoaded=this._onDocumentLoaded.bind(this),window.addEventListener(`load`,this._onDocumentLoaded))}_addCustomAttributesOnSpan(e,t){t&&O(()=>t(e),e=>{e&&this._diag.error(`addCustomAttributesOnSpan`,e)},!0)}_addCustomAttributesOnResourceSpan(e,t,n){n&&O(()=>n(e,t),e=>{e&&this._diag.error(`addCustomAttributesOnResourceSpan`,e)},!0)}enable(){window.removeEventListener(`load`,this._onDocumentLoaded),this._waitForPageLoad()}disable(){window.removeEventListener(`load`,this._onDocumentLoaded)}},Z;(function(e){e.CONNECT_END=`connectEnd`,e.CONNECT_START=`connectStart`,e.DECODED_BODY_SIZE=`decodedBodySize`,e.DOM_COMPLETE=`domComplete`,e.DOM_CONTENT_LOADED_EVENT_END=`domContentLoadedEventEnd`,e.DOM_CONTENT_LOADED_EVENT_START=`domContentLoadedEventStart`,e.DOM_INTERACTIVE=`domInteractive`,e.DOMAIN_LOOKUP_END=`domainLookupEnd`,e.DOMAIN_LOOKUP_START=`domainLookupStart`,e.ENCODED_BODY_SIZE=`encodedBodySize`,e.FETCH_START=`fetchStart`,e.LOAD_EVENT_END=`loadEventEnd`,e.LOAD_EVENT_START=`loadEventStart`,e.NAVIGATION_START=`navigationStart`,e.REDIRECT_END=`redirectEnd`,e.REDIRECT_START=`redirectStart`,e.REQUEST_START=`requestStart`,e.RESPONSE_END=`responseEnd`,e.RESPONSE_START=`responseStart`,e.SECURE_CONNECTION_START=`secureConnectionStart`,e.START_TIME=`startTime`,e.UNLOAD_EVENT_END=`unloadEventEnd`,e.UNLOAD_EVENT_START=`unloadEventStart`})(Z||={});var ca=`http.response_content_length`,la=`http.response_content_length_uncompressed`,ua;function da(){return ua||=document.createElement(`a`),ua}function fa(e,t){return t in e}function Q(e,t,n,r=!0){if(fa(n,t)&&typeof n[t]==`number`&&!(r&&n[t]===0))return e.addEvent(t,n[t])}function pa(e,t,n=!1,r,i){if(r===void 0&&(r=t[Z.START_TIME]!==0),n||(Q(e,Z.FETCH_START,t,r),Q(e,Z.DOMAIN_LOOKUP_START,t,r),Q(e,Z.DOMAIN_LOOKUP_END,t,r),Q(e,Z.CONNECT_START,t,r),Q(e,Z.SECURE_CONNECTION_START,t,r),Q(e,Z.CONNECT_END,t,r),Q(e,Z.REQUEST_START,t,r),Q(e,Z.RESPONSE_START,t,r),Q(e,Z.RESPONSE_END,t,r)),!i){let n=t[Z.ENCODED_BODY_SIZE];n!==void 0&&e.setAttribute(ca,n);let r=t[Z.DECODED_BODY_SIZE];r!==void 0&&n!==r&&e.setAttribute(la,r)}}function ma(e){return e.slice().sort((e,t)=>{let n=e[Z.FETCH_START],r=t[Z.FETCH_START];return n>r?1:n<r?-1:0})}function ha(){return typeof location<`u`?location.origin:void 0}function ga(e,t,n,r,i=new WeakSet,a){let o=ya(e);e=o.toString();let s=va(e,t,n,r,i,a);if(s.length===0)return{mainRequest:void 0};if(s.length===1)return{mainRequest:s[0]};let c=ma(s);if(o.origin!==ha()&&c.length>1){let e=c[0],t=_a(c,e[Z.RESPONSE_END],n),r=e[Z.RESPONSE_END];return t[Z.FETCH_START]<r&&(t=e,e=void 0),{corsPreFlightRequest:e,mainRequest:t}}else return{mainRequest:s[0]}}function _a(e,t,n){let r=b(n),i=b(y(t)),a=e[1],o,s=e.length;for(let t=1;t<s;t++){let n=e[t],s=b(y(n[Z.FETCH_START])),c=r-b(y(n[Z.RESPONSE_END]));s>=i&&(!o||c<o)&&(o=c,a=n)}return a}function va(e,t,n,r,i,a){let o=b(t),s=b(n),c=r.filter(t=>{let n=b(y(t[Z.FETCH_START])),r=b(y(t[Z.RESPONSE_END]));return t.initiatorType.toLowerCase()===(a||`xmlhttprequest`)&&t.name===e&&n>=o&&r<=s});return c.length>0&&(c=c.filter(e=>!i.has(e))),c}function ya(e){if(typeof URL==`function`)return new URL(e,typeof document<`u`?document.baseURI:typeof location<`u`?location.href:void 0);let t=da();return t.href=e,t}function ba(e,t){let n=t||[];return(typeof n==`string`||n instanceof RegExp)&&(n=[n]),ya(e).origin===ha()?!0:n.some(t=>ct(e,t))}var xa;(function(e){e.COMPONENT=`component`,e.HTTP_STATUS_TEXT=`http.status_text`})(xa||={});var Sa=`http.host`,Ca=`http.method`,wa=`http.request.body.size`,Ta=`http.request_content_length_uncompressed`,Ea=`http.scheme`,Da=`http.status_code`,Oa=`http.url`,ka=`http.user_agent`,Aa=_.createComponentLogger({namespace:`@opentelemetry/opentelemetry-instrumentation-fetch/utils`});function ja(...e){if(e[0]instanceof URL||typeof e[0]==`string`){let t=e[1];if(!t?.body)return Promise.resolve();if(t.body instanceof ReadableStream){let{body:e,length:n}=Ma(t.body);return t.body=e,n}else return Promise.resolve(Pa(t.body))}else{let t=e[0];return t?.body?t.clone().text().then(e=>Ia(e)):Promise.resolve()}}function Ma(e){if(!e.pipeThrough)return Aa.warn(`Platform has ReadableStream but not pipeThrough!`),{body:e,length:Promise.resolve(void 0)};let t=0,n,r=new Promise(e=>{n=e}),i=new TransformStream({start(){},async transform(e,n){let r=await e;t+=r.byteLength,n.enqueue(e)},flush(){n(t)}});return{body:e.pipeThrough(i),length:r}}function Na(e){return typeof Document<`u`&&e instanceof Document}function Pa(e){if(Na(e))return new XMLSerializer().serializeToString(document).length;if(typeof e==`string`)return Ia(e);if(e instanceof Blob)return e.size;if(e instanceof FormData)return La(e);if(e instanceof URLSearchParams)return Ia(e.toString());if(e.byteLength!==void 0)return e.byteLength;Aa.warn(`unknown body type`)}var Fa=new TextEncoder;function Ia(e){return Fa.encode(e).byteLength}function La(e){let t=0;for(let[n,r]of e.entries())t+=n.length,r instanceof Blob?t+=r.size:t+=r.length;return t}function Ra(e){let t=Va(),n=e.toUpperCase();return n in t?n:`_OTHER`}var za={CONNECT:!0,DELETE:!0,GET:!0,HEAD:!0,OPTIONS:!0,PATCH:!0,POST:!0,PUT:!0,TRACE:!0},Ba;function Va(){return Ba===void 0&&(Ba=za),Ba}var Ha={"https:":`443`,"http:":`80`};function Ua(e){let t=Number(e.port||Ha[e.protocol]);if(t&&!isNaN(t))return t}var Wa=`0.204.0`,Ga=300,Ka=typeof process==`object`&&process.release?.name===`node`,qa=class extends kn{component=`fetch`;version=Wa;moduleName=this.component;_usedResources=new WeakSet;_tasksCount=0;_semconvStability;constructor(e={}){super(`@opentelemetry/instrumentation-fetch`,Wa,e),this._semconvStability=An(`http`,e?.semconvStabilityOptIn)}init(){}_addChildSpan(e,t){let n=this.tracer.startSpan(`CORS Preflight`,{startTime:t[Z.FETCH_START]},f.setSpan(m.active(),e)),r=!(this._semconvStability&A.OLD);pa(n,t,this.getConfig().ignoreNetworkEvents,void 0,r),n.end(t[Z.RESPONSE_END])}_addFinalSpanAttributes(e,t){let n=ya(t.url);if(this._semconvStability&A.OLD&&(e.setAttribute(Da,t.status),t.statusText!=null&&e.setAttribute(xa.HTTP_STATUS_TEXT,t.statusText),e.setAttribute(Sa,n.host),e.setAttribute(Ea,n.protocol.replace(`:`,``)),typeof navigator<`u`&&e.setAttribute(ka,navigator.userAgent)),this._semconvStability&A.STABLE){e.setAttribute(Ge,t.status),e.setAttribute(Ke,n.hostname);let r=Ua(n);r&&e.setAttribute(qe,r)}}_addHeaders(e,t){if(!ba(t,this.getConfig().propagateTraceHeaderCorsUrls)){let e={};h.inject(m.active(),e),Object.keys(e).length>0&&this._diag.debug(`headers inject skipped due to CORS policy`);return}if(e instanceof Request)h.inject(m.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Headers)h.inject(m.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else if(e.headers instanceof Map)h.inject(m.active(),e.headers,{set:(e,t,n)=>e.set(t,typeof n==`string`?n:String(n))});else{let t={};h.inject(m.active(),t),e.headers=Object.assign({},t,e.headers||{})}}_clearResources(){this._tasksCount===0&&this.getConfig().clearTimingResources&&(performance.clearResourceTimings(),this._usedResources=new WeakSet)}_createSpan(e,t={}){if(lt(e,this.getConfig().ignoreUrls)){this._diag.debug(`ignoring span as url matches ignored url`);return}let n=``,r={};if(this._semconvStability&A.OLD){let i=(t.method||`GET`).toUpperCase();n=`HTTP ${i}`,r[xa.COMPONENT]=this.moduleName,r[Ca]=i,r[Oa]=e}if(this._semconvStability&A.STABLE){let i=t.method,a=Ra(t.method||`GET`);n||=a,r[Ue]=a,a!==i&&(r[We]=i),r[et]=e}return this.tracer.startSpan(n,{kind:be.CLIENT,attributes:r})}_findResourceAndAddNetworkEvents(e,t,n){let r=t.entries;if(!r.length){if(!performance.getEntriesByType)return;r=performance.getEntriesByType(`resource`)}let i=ga(t.spanUrl,t.startTime,n,r,this._usedResources,`fetch`);if(i.mainRequest){let t=i.mainRequest;this._markResourceAsUsed(t);let n=i.corsPreFlightRequest;n&&(this._addChildSpan(e,n),this._markResourceAsUsed(n));let r=!(this._semconvStability&A.OLD);pa(e,t,this.getConfig().ignoreNetworkEvents,void 0,r)}}_markResourceAsUsed(e){this._usedResources.add(e)}_endSpan(e,t,n){let r=v(Date.now()),i=at();this._addFinalSpanAttributes(e,n),this._semconvStability&A.STABLE&&n.status>=400&&(e.setStatus({code:c.ERROR}),e.setAttribute(ze,String(n.status))),setTimeout(()=>{t.observer?.disconnect(),this._findResourceAndAddNetworkEvents(e,t,i),this._tasksCount--,this._clearResources(),e.end(r)},Ga)}_patchConstructor(){return e=>{let t=this;return function(...n){let r=this,i=ya(n[0]instanceof Request?n[0].url:String(n[0])).href,a=n[0]instanceof Request?n[0]:n[1]||{},o=t._createSpan(i,a);if(!o)return e.apply(this,n);let s=t._prepareSpanData(i);t.getConfig().measureRequestSize&&ja(...n).then(e=>{e&&(t._semconvStability&A.OLD&&o.setAttribute(Ta,e),t._semconvStability&A.STABLE&&o.setAttribute(wa,e))}).catch(e=>{t._diag.warn(`getFetchBodyLength`,e)});function c(e,n){t._applyAttributesAfterFetch(e,a,n),t._endSpan(e,s,{status:n.status||0,statusText:n.message,url:i})}function l(e,n){t._applyAttributesAfterFetch(e,a,n),n.status>=200&&n.status<400?t._endSpan(e,s,n):t._endSpan(e,s,{status:n.status,statusText:n.statusText,url:i})}function u(e,t,n){try{let t=n.clone().body;if(t){let r=t.getReader(),i=()=>{r.read().then(({done:t})=>{t?l(e,n):i()},t=>{c(e,t)})};i()}else l(e,n)}finally{t(n)}}function d(e,t,n){try{c(e,n)}finally{t(n)}}return new Promise((n,s)=>m.with(f.setSpan(m.active(),o),()=>(t._addHeaders(a,i),t._callRequestHook(o,a),t._tasksCount++,e.apply(r,a instanceof Request?[a]:[i,a]).then(u.bind(r,o,n),d.bind(r,o,s)))))}}}_applyAttributesAfterFetch(e,t,n){let r=this.getConfig().applyCustomAttributesOnSpan;r&&O(()=>r(e,t,n),e=>{e&&this._diag.error(`applyCustomAttributesOnSpan`,e)},!0)}_callRequestHook(e,t){let n=this.getConfig().requestHook;n&&O(()=>n(e,t),e=>{e&&this._diag.error(`requestHook`,e)},!0)}_prepareSpanData(e){let t=at(),n=[];if(typeof PerformanceObserver!=`function`)return{entries:n,startTime:t,spanUrl:e};let r=new PerformanceObserver(t=>{t.getEntries().forEach(t=>{t.initiatorType===`fetch`&&t.name===e&&n.push(t)})});return r.observe({entryTypes:[`resource`]}),{entries:n,observer:r,startTime:t,spanUrl:e}}enable(){if(Ka){this._diag.warn(`this instrumentation is intended for web usage only, it does not instrument Node.js's fetch()`);return}k(fetch)&&(this._unwrap(Me,`fetch`),this._diag.debug(`removing previous patch for constructor`)),this._wrap(Me,`fetch`,this._patchConstructor())}disable(){Ka||(this._unwrap(Me,`fetch`),this._usedResources=new WeakSet)}},$;(function(e){e.EVENT_TYPE=`event_type`,e.TARGET_ELEMENT=`target_element`,e.TARGET_XPATH=`target_xpath`,e.HTTP_URL=`http.url`})($||={});var Ja=`0.49.0`,Ya=`@opentelemetry/instrumentation-user-interaction`,Xa=`OT_ZONE_CONTEXT`,Za=`Navigation:`,Qa=[`click`];function $a(){return!1}var eo=class extends kn{version=Ja;moduleName=`user-interaction`;_spansData=new WeakMap;_wrappedListeners=new WeakMap;_eventsSpanMap=new WeakMap;_eventNames;_shouldPreventSpanCreation;constructor(e={}){super(Ya,Ja,e),this._eventNames=new Set(e?.eventNames??Qa),this._shouldPreventSpanCreation=typeof e?.shouldPreventSpanCreation==`function`?e.shouldPreventSpanCreation:$a}init(){}_checkForTimeout(e,t){let n=this._spansData.get(t);n&&(e.source===`setTimeout`?n.hrTimeLastTimeout=tr():e.source!==`Promise.then`&&e.source!==`setTimeout`&&(n.hrTimeLastTimeout=void 0))}_allowEventName(e){return this._eventNames.has(e)}_createSpan(e,t,n){if(!(e instanceof HTMLElement)||!e.getAttribute||e.hasAttribute(`disabled`)||!this._allowEventName(t))return;let r=Zi(e,!0);try{let i=this.tracer.startSpan(t,{attributes:{[$.EVENT_TYPE]:t,[$.TARGET_ELEMENT]:e.tagName,[$.TARGET_XPATH]:r,[$.HTTP_URL]:window.location.href}},n?f.setSpan(m.active(),n):void 0);return this._shouldPreventSpanCreation(t,e,i)===!0?void 0:(this._spansData.set(i,{taskCount:0}),i)}catch(e){this._diag.error(`failed to start create new user interaction span`,e)}}_decrementTask(e){let t=this._spansData.get(e);t&&(t.taskCount--,t.taskCount===0&&this._tryToEndSpan(e,t.hrTimeLastTimeout))}_getCurrentSpan(e){let t=e.get(Xa);return t&&f.getSpan(t)}_incrementTask(e){let t=this._spansData.get(e);t&&t.taskCount++}addPatchedListener(e,t,n,r){let i=this._wrappedListeners.get(n);i||(i=new Map,this._wrappedListeners.set(n,i));let a=i.get(t);return a||(a=new Map,i.set(t,a)),a.has(e)?!1:(a.set(e,r),!0)}removePatchedListener(e,t,n){let r=this._wrappedListeners.get(n);if(!r)return;let i=r.get(t);if(!i)return;let a=i.get(e);return a&&(i.delete(e),i.size===0&&(r.delete(t),r.size===0&&this._wrappedListeners.delete(n))),a}_invokeListener(e,t,n){return typeof e==`function`?e.apply(t,n):e.handleEvent(n[0])}_patchAddEventListener(){let e=this;return t=>function(n,r,i){if(!r)return t.call(this,n,r,i);let a=i&&typeof i==`object`&&i.once,o=function(...t){let i,o=t[0],s=o?.target;o&&(i=e._eventsSpanMap.get(o)),a&&e.removePatchedListener(this,n,r);let c=e._createSpan(s,n,i);return c?(o&&e._eventsSpanMap.set(o,c),m.with(f.setSpan(m.active(),c),()=>{let n=e._invokeListener(r,this,t);return c.end(),n})):e._invokeListener(r,this,t)};if(e.addPatchedListener(this,n,r,o))return t.call(this,n,o,i)}}_patchRemoveEventListener(){let e=this;return t=>function(n,r,i){let a=e.removePatchedListener(this,n,r);return a?t.call(this,n,a,i):t.call(this,n,r,i)}}_getPatchableEventTargets(){return window.EventTarget?[EventTarget.prototype]:[Node.prototype,Window.prototype]}_patchHistoryApi(){this._unpatchHistoryApi(),this._wrap(history,`replaceState`,this._patchHistoryMethod()),this._wrap(history,`pushState`,this._patchHistoryMethod()),this._wrap(history,`back`,this._patchHistoryMethod()),this._wrap(history,`forward`,this._patchHistoryMethod()),this._wrap(history,`go`,this._patchHistoryMethod())}_patchHistoryMethod(){let e=this;return t=>function(...n){let r=`${location.pathname}${location.hash}${location.search}`,i=t.apply(this,n),a=`${location.pathname}${location.hash}${location.search}`;return r!==a&&e._updateInteractionName(a),i}}_unpatchHistoryApi(){k(history.replaceState)&&this._unwrap(history,`replaceState`),k(history.pushState)&&this._unwrap(history,`pushState`),k(history.back)&&this._unwrap(history,`back`),k(history.forward)&&this._unwrap(history,`forward`),k(history.go)&&this._unwrap(history,`go`)}_updateInteractionName(e){let t=f.getSpan(m.active());t&&typeof t.updateName==`function`&&t.updateName(`${Za} ${e}`)}_patchZoneCancelTask(){let e=this;return t=>function(n){let r=Zone.current,i=e._getCurrentSpan(r);return i&&e._shouldCountTask(n,r)&&e._decrementTask(i),t.call(this,n)}}_patchZoneScheduleTask(){let e=this;return t=>function(n){let r=Zone.current,i=e._getCurrentSpan(r);return i&&e._shouldCountTask(n,r)&&(e._incrementTask(i),e._checkForTimeout(n,i)),t.call(this,n)}}_patchZoneRunTask(){let e=this;return t=>function(n,r,i){let a=(Array.isArray(i)&&i[0]instanceof Event?i[0]:void 0)?.target,o,s=this;if(a){if(o=e._createSpan(a,n.eventName),o)return e._incrementTask(o),s.run(()=>{try{return m.with(f.setSpan(m.active(),o),()=>{let e=Zone.current;return n._zone=e,t.call(e,n,r,i)})}finally{e._decrementTask(o)}})}else o=e._getCurrentSpan(s);try{return t.call(s,n,r,i)}finally{o&&e._shouldCountTask(n,s)&&e._decrementTask(o)}}}_shouldCountTask(e,t){if(e._zone&&(t=e._zone),!t||!e.data||e.data.isPeriodic)return!1;let n=this._getCurrentSpan(t);return!n||!this._spansData.get(n)?!1:e.type===`macroTask`||e.type===`microTask`}_tryToEndSpan(e,t){e&&this._spansData.get(e)&&(e.end(t),this._spansData.delete(e))}enable(){let e=this._getZoneWithPrototype();this._diag.debug(`applying patch to`,this.moduleName,this.version,`zone:`,!!e),e?(k(e.prototype.runTask)&&(this._unwrap(e.prototype,`runTask`),this._diag.debug(`removing previous patch from method runTask`)),k(e.prototype.scheduleTask)&&(this._unwrap(e.prototype,`scheduleTask`),this._diag.debug(`removing previous patch from method scheduleTask`)),k(e.prototype.cancelTask)&&(this._unwrap(e.prototype,`cancelTask`),this._diag.debug(`removing previous patch from method cancelTask`)),this._zonePatched=!0,this._wrap(e.prototype,`runTask`,this._patchZoneRunTask()),this._wrap(e.prototype,`scheduleTask`,this._patchZoneScheduleTask()),this._wrap(e.prototype,`cancelTask`,this._patchZoneCancelTask())):(this._zonePatched=!1,this._getPatchableEventTargets().forEach(e=>{k(e.addEventListener)&&(this._unwrap(e,`addEventListener`),this._diag.debug(`removing previous patch from method addEventListener`)),k(e.removeEventListener)&&(this._unwrap(e,`removeEventListener`),this._diag.debug(`removing previous patch from method removeEventListener`)),this._wrap(e,`addEventListener`,this._patchAddEventListener()),this._wrap(e,`removeEventListener`,this._patchRemoveEventListener())})),this._patchHistoryApi()}disable(){let e=this._getZoneWithPrototype();this._diag.debug(`removing patch from`,this.moduleName,this.version,`zone:`,!!e),e&&this._zonePatched?(k(e.prototype.runTask)&&this._unwrap(e.prototype,`runTask`),k(e.prototype.scheduleTask)&&this._unwrap(e.prototype,`scheduleTask`),k(e.prototype.cancelTask)&&this._unwrap(e.prototype,`cancelTask`)):this._getPatchableEventTargets().forEach(e=>{k(e.addEventListener)&&this._unwrap(e,`addEventListener`),k(e.removeEventListener)&&this._unwrap(e,`removeEventListener`)}),this._unpatchHistoryApi()}_getZoneWithPrototype(){return window.Zone}},to=`open-knowledge-app`,no=!1;function ro(){return{BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.51.4`}?.VITE_OTEL_COLLECTOR_URL??`http://localhost:14318`}function io(){if(no)return;no=!0;let e=null,t=!1;try{let n=ro(),r={BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.51.4`};e=new qi({resource:Zr({[Je]:`open-knowledge-app`,[Ye]:r?.VITE_APP_VERSION??`dev`,[Re]:r?.MODE??`dev`}),spanProcessors:[new Ui(new fn({url:`${n}/v1/traces`}),{maxExportBatchSize:50,scheduledDelayMillis:2e3})]}),e.register(),t=!0,Cn({instrumentations:[new sa,new eo({eventNames:[`click`,`submit`]}),new qa({propagateTraceHeaderCorsUrls:[/^https?:\/\/localhost(:\d+)?\/api\//,/^https?:\/\/127\.0\.0\.1(:\d+)?\/api\//,/^\/api\//],clearTimingResources:!0})]}),console.info(`[otel] frontend telemetry initialized — OTLP/HTTP → ${n}/v1/traces`)}catch(n){console.warn(`[otel] frontend telemetry init failed — continuing without`,n),t&&e&&e.shutdown().catch(()=>{}),no=!1}}function ao(){return f.getTracer(to)}export{ao as getAppTracer,io as install};
@@ -1 +1 @@
1
- import{n as e,t}from"./propagation-api-PBYTadVM.js";import{n}from"./startup-marks-CTM7uDIJ.js";import{getAppTracer as r}from"./telemetry-impl-Byic_ID0.js";var i;function a(){if(!i)try{let a=typeof window<`u`?window.okDesktop?.config.startupTraceparent:void 0;if(!a)return;let o=t.extract(e.active(),{traceparent:a}),s=r().startSpan(`ok.app-startup`,void 0,o);i=s,n(e=>{try{s.end(e)}catch{}i=void 0})}catch{}}export{a as initStartupTrace};
1
+ import{n as e,t}from"./propagation-api-PBYTadVM.js";import{n}from"./startup-marks-Cdkh8q3E.js";import{getAppTracer as r}from"./telemetry-impl-Bvv5kEhb.js";var i;function a(){if(!i)try{let a=typeof window<`u`?window.okDesktop?.config.startupTraceparent:void 0;if(!a)return;let o=t.extract(e.active(),{traceparent:a}),s=r().startSpan(`ok.app-startup`,void 0,o);i=s,n(e=>{try{s.end(e)}catch{}i=void 0})}catch{}}export{a as initStartupTrace};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import"./dropdown-menu-CLgDYkh1.js";import{Gt as s,Kt as c,n as l,t as ee}from"./dist-ILlrHFKs.js";import{t as u}from"./badge-BYteLKha.js";import{i as d,n as f,t as p}from"./cursor-CIl_AjI1.js";import{t as te}from"./copilot-CmkvU8CH.js";var m=e(n(),1),h=`ok-acp-registered-agents-v1`,g={agents:[],defaultKey:null};function _(e){return`${e.source}:${e.id}`}function v(e){if(typeof e!=`object`||!e)return!1;let t=e;return(t.source===`registry`||t.source===`custom`)&&typeof t.id==`string`&&t.id!==``&&typeof t.name==`string`&&t.name!==``&&(t.iconUrl===void 0||typeof t.iconUrl==`string`)&&(t.lastUsedAt===void 0||typeof t.lastUsedAt==`number`)&&(t.featured===void 0||typeof t.featured==`boolean`)}function y(){let e;try{e=localStorage.getItem(h)}catch{return g}if(e===null)return g;try{let t=JSON.parse(e),n=Array.isArray(t.agents)?t.agents.filter(v):[];return{agents:n,defaultKey:typeof t.defaultKey==`string`&&n.some(e=>_(e)===t.defaultKey)?t.defaultKey:null}}catch(e){return console.warn(`[registered-agents] discarding corrupt localStorage payload`,e),g}}function b(e){try{localStorage.setItem(h,JSON.stringify(e))}catch(e){console.warn(`[registered-agents] failed to persist registration`,e)}}var x=null,S=[],C=null,w=new Set;function T(){return x===null&&(x=y()),x}function E(e){x=e,C=M(e.agents,S);for(let e of w)e()}function ne(){E(y())}typeof window<`u`&&typeof window.addEventListener==`function`&&window.addEventListener(`storage`,e=>{(e.key===h||e.key===null)&&ne()});function D(e){return w.add(e),()=>w.delete(e)}var O=()=>(C===null&&(C=M(T().agents,S)),C),k=()=>{let{agents:e,defaultKey:t}=T();return t===null?null:e.find(e=>_(e)===t)??null};function A(e,t={}){let{makeDefault:n=!0}=t,r=_(e),i=T();if(!n){let t={agents:i.agents.some(e=>_(e)===r)?i.agents.map(t=>_(t)===r?{...e,...t.lastUsedAt===void 0?{}:{lastUsedAt:t.lastUsedAt}}:t):[...i.agents,e],defaultKey:i.defaultKey};b(t),E(t);return}let a=i.agents.filter(e=>_(e)!==r),o={agents:[{...e,lastUsedAt:Date.now()},...a],defaultKey:r};b(o),E(o)}function j(e,t){let n=e.lastUsedAt??0,r=t.lastUsedAt??0;if(n!==r)return r-n;let i=e.featured===!0?0:1,a=t.featured===!0?0:1;return i===a?e.name.localeCompare(t.name,void 0,{numeric:!0,sensitivity:`base`}):i-a}function M(e,t){let n=new Set(e.map(_));return[...e,...t.filter(e=>!n.has(_(e)))].sort(j)}function N(e){S=[...e],C=M(T().agents,S);for(let e of w)e()}function P(e,t){let n=T();if(n.defaultKey!==e)return;let r=n.agents.find(n=>_(n)!==e&&t(n))??null,i={agents:n.agents,defaultKey:r?_(r):null};b(i),E(i)}function re(e,t){return t!==null&&e.some(e=>e.source===t.source&&e.id===t.id)?t:e[0]??null}function ie(e){let t=new Map(e.map(e=>[_(e),e])),n=T(),r=!1,i=n.agents.map(e=>{let n=t.get(_(e));if(n===void 0)return e;let i=n.name??e.name,a=n.iconUrl??e.iconUrl,o=n.supported??e.supported,s=n.featured??e.featured;return i===e.name&&a===e.iconUrl&&o===e.supported&&s===e.featured?e:(r=!0,{...e,name:i,...a===void 0?{}:{iconUrl:a},...o===void 0?{}:{supported:o},...s===void 0?{}:{featured:s}})});if(!r)return;let a={agents:i,defaultKey:n.defaultKey};b(a),E(a)}function ae(){return(0,m.useSyncExternalStore)(D,O,O)}function oe(){return(0,m.useSyncExternalStore)(D,k,k)}var F=t(),I=a();async function se(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.openExternal)try{return await n.shell.openExternal(e),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:L(e)}}let r=t.doc??(typeof document<`u`?document:void 0);if(!r)return{ok:!1,reason:`dispatch-error`,detail:`no DOM available`};try{let t=r.createElement(`a`);return t.href=e,t.rel=`noopener noreferrer`,/^https?:/i.test(e)&&(t.target=`_blank`),r.body.appendChild(t),t.click(),t.remove(),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:L(e)}}}function L(e){if(e instanceof Error)return e.message;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}var R=[{id:`claude-cowork`,displayName:`Claude Cowork`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,tagline:`Conversational pairing in Claude Desktop's Cowork tab.`},{id:`claude-code`,displayName:`Claude`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,tagline:`Agentic coding in Claude Desktop's Code tab.`},{id:`codex`,displayName:`Codex`,appBrandName:`Codex Desktop`,schemes:[`codex:`],installUrl:`https://openai.com/codex`,tagline:`OpenAI's coding agent, terminal-native.`},{id:`cursor`,displayName:`Cursor`,schemes:[`cursor:`],installUrl:`https://cursor.com/`,tagline:`AI-first VS Code fork with multi-file edits.`},{id:`copilot`,displayName:`GitHub Copilot`,schemes:[],installUrl:`https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-getting-started`,tagline:`GitHub's terminal-native coding agent.`},{id:`opencode`,displayName:`OpenCode`,schemes:[],installUrl:`https://opencode.ai`,tagline:`Open-source terminal coding agent; bring any local model.`},{id:`pi`,displayName:`Pi`,schemes:[],installUrl:`https://pi.dev`,tagline:`Minimal open-source terminal coding agent, extensible in TypeScript.`},{id:`antigravity`,displayName:`Antigravity`,schemes:[],installUrl:`https://antigravity.google`,tagline:"Google's agentic IDE + `agy` terminal agent."},{id:`openclaw`,displayName:`OpenClaw`,schemes:[],installUrl:`https://openclaw.ai`,tagline:`Open-source agent gateway; runs agents against your MCP servers.`},{id:`hermes`,displayName:`Hermes`,schemes:[],installUrl:`https://hermes-agent.nousresearch.com`,tagline:`Nous Research's terminal coding agent.`}],z=R.filter(e=>e.id!==`claude-cowork`&&e.id!==`copilot`&&e.id!==`opencode`&&e.id!==`pi`&&e.id!==`antigravity`&&e.id!==`openclaw`&&e.id!==`hermes`),B=`ok-acp-enabled-agents-v1`,V={};function H(e,t){return`in-app:${e}:${t}`}function U(e){return`terminal:${e}`}function W(e){return`desktop:${e}`}function G(e,t){return e??t}function K(){let e;try{e=localStorage.getItem(B)}catch(e){return console.warn(`[enabled-agents] localStorage unavailable; treating overrides as empty`,e),V}if(e===null)return V;try{let t=JSON.parse(e);if(typeof t!=`object`||!t)return V;let n={};for(let[e,r]of Object.entries(t))typeof r==`boolean`&&(n[e]=r);return n}catch(e){return console.warn(`[enabled-agents] discarding corrupt localStorage payload`,e),V}}function q(e){try{localStorage.setItem(B,JSON.stringify(e))}catch(e){console.warn(`[enabled-agents] failed to persist override`,e)}}var J=null,Y=new Set;function X(){return J===null&&(J=K()),J}function Z(e){J=e;for(let e of Y)e()}function ce(){Z(K())}typeof window<`u`&&typeof window.addEventListener==`function`&&window.addEventListener(`storage`,e=>{(e.key===B||e.key===null)&&ce()});function le(e){return Y.add(e),()=>Y.delete(e)}var Q=()=>X();function ue(e,t){let n=X();if(t===void 0){if(!(e in n))return;let{[e]:t,...r}=n;q(r),Z(r);return}if(n[e]===t)return;let r={...n,[e]:t};q(r),Z(r)}function de(){return(0,m.useSyncExternalStore)(le,Q,Q)}function fe(e,t,n,r,i){return i===!1?!1:G(e[H(t,n)],r)}function pe(e,t,n){return G(e[U(t)],n[t]!==!1)}function $(e,t){return G(e[W(t)],!1)}function me(e){let t=(0,I.c)(5),{className:n}=e,i;t[0]===n?i=t[1]:(i=o(`h-4 px-1 text-[10px]`,n),t[0]=n,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,F.jsx)(r,{id:`YBt9YP`}),t[2]=a):a=t[2];let s;return t[3]===i?s=t[4]:(s=(0,F.jsx)(u,{variant:`gray`,className:i,children:a}),t[3]=i,t[4]=s),s}function he(e){let t=(0,I.c)(5),n,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsx)(`title`,{children:`Antigravity icon`}),r=(0,F.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 2.5a1.5 1.5 0 0 1 1.28.72l8.5 14A1.5 1.5 0 0 1 20.5 19.5h-17a1.5 1.5 0 0 1-1.28-2.28l8.5-14A1.5 1.5 0 0 1 12 2.5Zm0 4.42L5.83 17h12.34L12 6.92Z`}),i=(0,F.jsx)(`path`,{fill:`currentColor`,d:`M12 9.6 15.6 17h-7.2L12 9.6Z`}),t[0]=n,t[1]=r,t[2]=i):(n=t[0],r=t[1],i=t[2]);let a;return t[3]===e?a=t[4]:(a=(0,F.jsxs)(`svg`,{role:`img`,"aria-label":`Antigravity icon`,xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,fill:`none`,viewBox:`0 0 24 24`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}function ge(e){let t=(0,I.c)(6),n,r,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsx)(`title`,{children:`Hermes icon`}),r=(0,F.jsx)(`path`,{d:`M5.938 12.835c.127-.039.285.02.373.143.028.038.036.092.046.14.003.014-.02.033-.04.05-.124-.098-.24-.194-.354-.291-.011-.01-.016-.027-.025-.042zM8.396 9.412c.195-.032.39-.06.588-.05a.54.54 0 01.148.026c.202.071.402.147.601.224.028.01.05.036.075.055l-.013.027a9.203 9.203 0 01-.26-.089c-.115-.038-.213-.077-.315-.098-.25-.05-.25-.046-.292-.014l.574.144c.275.139.55.276.823.417.042.022.09.057.107.098.026.06.063.076.117.072.066-.006.132-.017.213-.027l-.04.086c.051.08.142.02.216.064-.074.13-.247.09-.334.199l.061.074-.12.087c0 .106-.038.168-.306.243l.026.085-.196.042.07.124h-.25l-.007.137c-.081-.01-.161-.018-.244-.027l-.053.123c-.027-.008-.052-.011-.073-.023-.067-.038-.128-.056-.195.006-.019.017-.063.014-.093.008-.026-.006-.05-.029-.07-.042-.11.095-.11.095-.208.003-.057.046-.12.074-.186.011-.063.027-.123-.02-.178-.014-.07.007-.097-.035-.133-.07l-.13.033c-.013-.236-.194-.19-.34-.203.005-.072.05-.092.095-.094a.474.474 0 01.159.022c.164.05.32.12.496.138.203.021.405.029.601-.015.265-.059.52-.149.707-.365.049-.056.083-.127.117-.195.019-.038.02-.084-.02-.116a1.397 1.397 0 00-.382-.217c.024.12-.031.182-.115.221 0 .014-.004.025 0 .03.08.115.084.16-.007.267a1.39 1.39 0 01-.218.211.477.477 0 01-.641-.05 1.36 1.36 0 01-.133-.152c-.078-.107-.076-.108-.033-.236-.165-.08-.128-.226-.104-.364.008-.05.028-.096.049-.163-.04.014-.067.017-.087.032a.897.897 0 00-.316.357c-.007.016-.01.034-.02.047-.012.015-.034.038-.045.035-.02-.006-.037-.027-.05-.045-.008-.012-.007-.032-.012-.057h-.126l.053-.172a14.82 14.82 0 00-.039-.049l.11-.284c-.06.026-.091.044-.124.051-.03.007-.064 0-.095 0 0-.031-.01-.07.004-.092.149-.22.305-.428.593-.476z`}),i=(0,F.jsx)(`path`,{d:`M8.06 10.788c-.003-.038-.004-.075.037-.062.016.006.034.048.028.067-.01.04-.038.032-.064-.005z`}),a=(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M11.981.009c.226-.012.453-.011.679 0 .247.01.495.024.74.062.401.064.798.157 1.19.273.463.138.92.299 1.356.511a7.31 7.31 0 012.948 2.642c.292.469.536.963.739 1.479.219.556.446 1.11.623 1.683.204.654.329 1.326.458 1.997.097.504.182 1.01.29 1.511.156.722.329 1.44.494 2.16.186.812.4 1.615.63 2.415.102.355.193.713.282 1.072.11.436.202.876.254 1.323.031.278.066.557.073.837a7.56 7.56 0 01-.017.88c-.037.413-.1.818-.226 1.212a5.017 5.017 0 01-.915 1.649l-.13.156.018.023c.043-.023.088-.041.127-.068.2-.138.373-.307.531-.49.4-.46.721-.973.975-1.529a3.59 3.59 0 00.325-1.72c-.024-.424-.097-.834-.3-1.213-.013-.027-.015-.06-.03-.121.05.035.082.048.101.072.107.13.22.258.315.398.33.494.46 1.052.486 1.64a3.75 3.75 0 01-.47 1.97c-.36.655-.887 1.14-1.526 1.506-.193.111-.394.21-.595.308-.157.078-.248.211-.318.365a.522.522 0 00-.033.406.359.359 0 01.013.139c-.005.077-.077.155-.14.162-.054.006-.125-.043-.15-.116a1.206 1.206 0 01-.06-.233c-.04-.314-.155-.6-.308-.87a3.906 3.906 0 00-.73-.91 2.129 2.129 0 00-.897-.524 4.093 4.093 0 00-.692-.131c-.075-.008-.15-.04-.22.01.18.06.363.11.538.18.434.173.82.43 1.18.728.308.255.58.543.794.884.098.155.186.315.227.496.027.123.042.25.067.375.013.062-.002.109-.053.144-.047.033-.122.034-.163-.01a.455.455 0 01-.08-.14c-.03-.073-.038-.159-.078-.225a7.314 7.314 0 00-1.423-1.664c-.16-.137-.329-.26-.537-.323-.376-.114-.753-.203-1.15-.154-.213.025-.427.032-.64.053a1.6 1.6 0 00-.736.278 5.14 5.14 0 00-.834.72c-.329.342-.642.699-.955 1.055-.136.155-.264.319-.314.531a5.227 5.227 0 00-.012.051.096.096 0 01-.09.076h-.31c-.046 0-.082-.048-.072-.094.023-.108.045-.216.07-.324.075-.325.19-.635.368-.917.024-.039.04-.088.104-.08l.01.049.027.077c.28-.435.571-.834.996-1.135.283-.204.584-.378.89-.55a.196.196 0 00-.098-.002c-.162.043-.325.084-.485.134-.402.124-.764.33-1.11.566-.147.1-.298.193-.414.333a7.314 7.314 0 00-1.07 1.767.845.845 0 00-.04.12.075.075 0 01-.072.056h-.494c-.04 0-.062-.051-.036-.082.123-.14.246-.282.377-.415.275-.281.58-.532.777-.884.027-.048.063-.09.095-.135.238-.333.54-.607.818-.902.082-.086.175-.16.26-.24.029-.027.053-.057.079-.085l-.018-.025-.135.041c-.034.017-.07.031-.102.05-.248.144-.494.292-.743.433-.408.23-.825.439-1.209.711-.281.2-.591.358-.889.533-.02.012-.044.015-.08.028-.015-.135.143-.201.108-.336-.033.014-.064.02-.085.038-.111.096-.227.19-.328.296-.148.157-.284.325-.425.488-.125.143-.25.286-.373.431A.153.153 0 019.89 24H8.762a.316.316 0 00.016-.042c.028-.09.085-.172.083-.28-.091-.018-.162.001-.212.077a4.45 4.45 0 00-.136.215c-.01.016-.024.03-.042.03h-.093c-.019 0-.029-.022-.017-.037.071-.088.14-.178.209-.268.001-.002-.006-.012-.012-.024-.014.004-.03.006-.045.013-.176.09-.352.181-.527.274a.363.363 0 01-.168.042H5.202c-.026 0-.039-.036-.019-.053.21-.178.402-.374.558-.605.335-.496.538-1.047.667-1.629.004-.02-.003-.043-.006-.091-.037.048-.059.072-.076.1a1.943 1.943 0 01-.334.415c-.28.258-.59.448-.983.464-.297.012-.588 0-.865-.127-.46-.21-.722-.57-.794-1.072-.025-.17-.017-.171-.182-.219A3.513 3.513 0 011.97 20.6a2.286 2.286 0 01-.808-1.13 3.569 3.569 0 01-.16-1.245c.002-.034.016-.067.024-.1.032.023.046.043.05.066.033.153.059.308.096.46.086.355.257.664.516.92.258.256.571.419.91.532.358.118.717.138 1.07-.016a1.89 1.89 0 00.621-.452c.328-.348.533-.76.648-1.223.009-.034.005-.071.007-.11-.015.006-.026.006-.03.011-.031.05-.064.1-.093.152-.284.502-.679.887-1.196 1.135-.351.17-.718.255-1.11.159a1.607 1.607 0 01-.971-.64 2.006 2.006 0 01-.368-.924 2.903 2.903 0 01.02-.886c.05-.439.466-1.17.742-1.271-.02.063-.035.112-.053.16-.043.116-.097.227-.13.345a1.901 1.901 0 00-.05.82c.033.212.09.416.204.6.147.236.346.407.62.465.11.023.225.014.338.018a.576.576 0 00.386-.131c.164-.128.282-.292.366-.481.168-.375.24-.777.309-1.179.05-.296.093-.594.133-.893.039-.281.071-.563.104-.845.026-.232.048-.464.074-.696.024-.228.052-.455.076-.683.024-.227.047-.455.069-.683.013-.14.022-.28.034-.42l.037-.417c.022-.25.041-.5.065-.748.008-.082-.02-.132-.09-.177a2.46 2.46 0 01-.492-.418c-.1-.109-.188-.228-.282-.342-.035-.042-.056-.097-.116-.118a2.084 2.084 0 00.275.597c.06.092.131.176.196.265.063.086.182.115.234.226-.028.003-.046.01-.06.006a4.74 4.74 0 01-.22-.057 2.71 2.71 0 01-1.287-.819c-.435-.487-.656-1.076-.71-1.723a5.206 5.206 0 01.014-1.06c.072-.602.22-1.186.45-1.745.155-.376.338-.741.526-1.102.205-.393.466-.75.765-1.076.512-.559 1.104-1.024 1.726-1.448.717-.49 1.478-.898 2.277-1.233C8.244.828 8.767.632 9.31.494c.655-.166 1.31-.33 1.982-.415.229-.03.458-.058.688-.07zm-1.847 22.82c-.07.06-.147.111-.207.18-.238.27-.464.549-.668.869l-.044.108a.177.177 0 00.093-.057c.174-.19.351-.378.519-.574.104-.122.195-.255.288-.386.024-.034.03-.08.046-.12l-.027-.02zm1.65-3.695a5.51 5.51 0 00-.653.593l-.37.386a.963.963 0 01-.377.25 1.372 1.372 0 01-.467.09c-.044 0-.087.006-.151.012.028.058.043.097.064.131.15.242.301.482.45.724.136.22.276.438.399.666.068.125.105.267.156.404.077.027.14-.018.202-.048.29-.135.579-.274.867-.412.213-.101.437-.186.636-.31.347-.215.68-.455 1.018-.685.015-.01.026-.028.042-.046-.023-.019-.038-.037-.056-.044-.287-.111-.527-.3-.77-.482a5.319 5.319 0 01-.506-.42 1.757 1.757 0 01-.41-.653c-.019-.049-.045-.095-.075-.156zm-5.847.264c-.06.096-.097.194-.132.293a3.38 3.38 0 01-.555 1.01c-.2.25-.455.412-.762.493-.23.06-.464.076-.7.07-.048-.002-.097.002-.158.005.016.04.021.066.035.085.1.145.23.246.4.295.157.046.316.034.498.023.181-.037.343-.115.485-.234.238-.199.402-.454.536-.732.175-.363.264-.751.342-1.144.01-.053.008-.11.011-.164zm14.945-4.586c.008.029.016.057.027.107.024.155.051.31.072.464.03.219.067.437.078.657.017.344.027.689-.014 1.033-.037.315-.063.633-.116.946a6.153 6.153 0 01-.46 1.518c-.008.018-.01.039-.02.082.047-.03.077-.042.098-.064.085-.083.17-.167.248-.255.271-.305.458-.66.596-1.043.18-.498.228-1.011.145-1.531-.103-.65-.33-1.263-.597-1.881a9.055 9.055 0 00-.024-.055l-.033.022zM5.797 8.29a.26.26 0 00.018.153c.124.251.25.501.379.75.025.049.066.09.03.163-.284.06-.578.119-.88.255.059.038.097.06.132.087.042.032.112.058.09.12-.01.033-.075.048-.117.072.017.01.043.021.067.036.166.102.33.207.447.368.138.192.229.404.188.644-.079.469-.306.85-.69 1.132-.054.04-.106.083-.161.122a.243.243 0 00-.103.245.77.77 0 00.055.195c.083.196.22.35.375.492.083.076.159.164.222.257a.37.37 0 01.025.377c-.023.05-.05.099-.076.148-.03.06-.028.111.022.162.041.042.08.089.112.138.038.058.078.079.147.05a.486.486 0 01.333-.006c.16.046.302.126.444.21.13.077.264.149.4.219.067.035.14.05.219.026.071-.022.124.01.145.076.02.064-.003.108-.074.139-.07.03-.137.063-.209.088-.1.035-.201.073-.314.077-.013-.107.11-.088.127-.159-.206-.126-.643-.145-.801-.034.063.112.035.21-.096.313-.13-.1-.025-.202.002-.3a.209.209 0 00-.249.17c-.015.101.067.216.178.224.108.007.218-.005.326-.012.06-.005.12-.027.199 0-.103.123-.248.127-.357.19.002.05.07.086.019.131-.053.048-.095-.001-.132-.03-.08-.063-.16-.126-.231-.197a.474.474 0 01-.157-.311.52.52 0 00-.043-.172c-.032-.074-.032-.137.033-.19-.018-.03-.028-.053-.045-.072a1.222 1.222 0 01-.196-.369c-.053-.137-.046-.264.048-.381.024-.03.05-.06.064-.095a.664.664 0 00.047-.168c.017-.165-.064-.287-.182-.387-.186-.156-.36-.322-.46-.551-.005-.011-.024-.017-.037-.026-.011.017-.024.027-.025.038-.019.185-.045.37-.052.557-.014.377.058.743.162 1.104.118.41.289.798.488 1.173.267.502.537 1.002.812 1.5.055.098.13.189.208.27.198.202.452.272.724.273.202 0 .404-.006.605-.026.295-.03.59-.073.884-.113.183-.025.365-.057.548-.08.21-.026.38.073.522.21.16.156.305.327.447.5.22.265.397.56.554.867.05.098.07.1.147.03.13-.121.26-.242.394-.36.067-.059.088-.12.067-.213a3.535 3.535 0 01-.085-.796c.002-.157.006-.314.018-.471.015-.224.03-.45.06-.672a59.114 59.114 0 01.362-2.298c.087-.493.182-.984.268-1.477.06-.347.118-.694.162-1.043.034-.273.055-.55.063-.825.011-.332.003-.665.002-.998 0-.077.004-.155-.01-.23-.028-.142-.01-.155-.162-.19a5.826 5.826 0 00-.607-.107c-.146-.018-.207-.053-.221-.19-.006-.049-.025-.098-.041-.146-.009-.025-.024-.048-.046-.09l-.025.264c-.009.096-.029.116-.127.115-.055 0-.11-.008-.164-.008-.476 0-.952-.008-1.426.032-.095.008-.173-.015-.226-.103-.04-.066-.088-.126-.134-.186-.063-.084-.086-.093-.182-.06-.195.068-.388.138-.582.21a2.71 2.71 0 00-.675.394.986.986 0 01-.323.168c-.033.01-.07.008-.127.013.02-.066.024-.114.047-.15.064-.105.135-.205.205-.306.023-.033.049-.063.073-.095l-.015-.023-.201.037c-.146.04-.296.07-.437.122-.148.053-.266.023-.386-.072a3.623 3.623 0 01-.733-.786l-.093-.132zm8.592 8.963l-.147.09c-.22.134-.44.266-.659.402-.093.058-.184.12-.27.188-.085.07-.124.161-.072.272.047.1.093.2.147.294.047.08.124.138.213.147.11.01.228.012.336-.012.217-.05.372-.205.528-.357a.291.291 0 00.087-.308c-.046-.18-.079-.365-.118-.547-.011-.052-.027-.103-.045-.169zm-.257-2.409c-.12.291-.205.597-.325.91-.151.433-.294.87-.435 1.323.036-.01.054-.01.067-.018.261-.16.522-.324.785-.484.054-.033.071-.078.065-.138-.012-.13-.024-.262-.034-.393l-.068-.886c-.008-.103-.02-.206-.029-.31-.009 0-.017-.002-.026-.004zm3.081-8.13l.099.285c.08.231.159.463.24.714l.58 1.952c.187.63.372 1.262.558 1.893.114.382.235.762.343 1.146.072.257.126.519.186.799.044.206.087.413.127.64.034.106.023.226.077.325l.025-.006-.068-.362c-.038-.206-.077-.412-.113-.638-.015-.07-.029-.141-.046-.211-.095-.396-.177-.796-.29-1.187-.196-.685-.413-1.364-.618-2.046-.165-.549-.322-1.1-.488-1.648-.069-.227-.15-.45-.226-.695l-.117-.336c-.037-.107-.075-.216-.115-.322-.04-.106-.084-.21-.127-.314a7.558 7.558 0 01-.027.01zM6.225 14.304c-.063-.001-.115.014-.134.083a.35.35 0 00.41.012 4.533 4.533 0 00-.276-.095zM5.23 11.98c-.026-.027-.057-.048-.075.002-.012.032-.007.07-.01.113.082-.037.082-.037.085-.115zm.062-1.189a.135.135 0 00-.088.056.197.197 0 00-.025.11c.005.152.01.306.026.457a.751.751 0 00.066.218c.061.136.157.167.288.101.055-.027.06-.054.025-.11a4.52 4.52 0 01-.129-.211c-.015-.068-.066-.131-.033-.207.04-.09-.076-.116-.074-.19V10.874c-.003-.038-.006-.087-.056-.083zm-.017-.968a.867.867 0 00-.467.127c-.076.045-.084.07-.05.158.034.087.07.173.115.254.064.117.09.125.21.077a.657.657 0 01.336-.053c.202.022.357.136.504.264l.092.077c.007-.006.014-.013.022-.018-.019-.105-.035-.226-.149-.264-.157-.053-.324-.075-.508-.117l-.24-.005c.24-.169.452-.044.687.009-.063-.115-.153-.147-.23-.193-.082-.05-.17-.092-.25-.144-.06-.037-.12-.08-.072-.172zm10.233.325c-.23-.01-.427.08-.608.211-.034.026-.06.065-.105.117.087.026.15.046.232.065.044-.015.088-.03.13-.046.306-.114.61-.115.904.031.126.063.237.04.366-.005-.02-.031-.03-.054-.045-.071a.986.986 0 00-.448-.273c-.14-.044-.284-.024-.426-.03zM7.99 6.483a.308.308 0 00.002.133c.08.321.156.643.242.962.104.387.27.75.456 1.103.02.037.061.08.098.087a.404.404 0 00.253-.051l-.472-.84c-.23-.448-.405-.92-.579-1.394zM10.397.497c-.2-.008-.405.004-.603.034-.236.035-.47.087-.7.152-.287.08-.569.18-.852.273-.04.013-.074.038-.11.058.028.014.05.018.07.014.287-.068.58-.085.873-.09.134-.002.269.009.402.025.19.024.382.048.57.09.456.104.874.3 1.265.556.464.306.888.66 1.257 1.078.205.232.395.475.56.739.17.274.315.561.449.856.273.601.456 1.232.6 1.876.04.173.07.348.1.524.017.104.065.167.17.19.122.028.2.105.22.251-.003.102-.06.174-.129.24a1.065 1.065 0 00-.268.358.164.164 0 00.083-.039c.08-.086.162-.172.235-.265a.56.56 0 00.13-.333c.009-.05.022-.1.024-.15.007-.124-.017-.15-.143-.168-.025-.004-.049-.014-.073-.015-.082-.007-.125-.063-.137-.131-.033-.198-.004-.355.247-.408.086-.018.174-.03.26-.042.158-.023.315-.053.473-.067.14-.012.19.033.226.167.008.029.018.057.021.087.019.179-.008.225-.141.288-.027.013-.055.024-.078.042a.148.148 0 00-.051.067c-.039.144.073.382.206.445l.673.32c.023.011.05.015.075.023l.018-.026c-.015-.008-.032-.013-.044-.024a2.27 2.27 0 00-.544-.32 4.898 4.898 0 00-.173-.075.203.203 0 01-.126-.191c-.003-.085.045-.154.128-.187l.059-.025c.099-.044.118-.076.112-.187a.384.384 0 00-.008-.063c-.067-.294-.123-.59-.205-.88a9.478 9.478 0 00-.826-2.036 7.465 7.465 0 00-1.39-1.805 4.536 4.536 0 00-1.177-.824 3.656 3.656 0 00-1.016-.328 6.155 6.155 0 00-.712-.074zm6.719 5.955c.01.014.018.028.038.034l-.022-.044-.016.01zM4.103 3.917a.062.062 0 01-.03.012.455.455 0 01-.04.039c-.01.01-.02.02-.045.04l-.363.354c-.088.085-.17.178-.266.253-.284.22-.425.53-.544.855a.132.132 0 00-.007.071c.013.055.033.108.052.168l.074.026c-.017.056-.03.105-.047.152-.058.164-.118.327-.175.491-.005.015.008.036.019.077.08-.175.158-.33.225-.489.228-.544.484-1.074.819-1.561.09-.133.182-.266.283-.401.004-.006.007-.013.022-.03.001-.016.003-.032.015-.04l.008-.017zm12.976 2.408a.023.023 0 01.009.019.073.073 0 00-.006.01.188.188 0 00.007.02l.018.022c.002-.007.007-.016.005-.021-.003-.01-.012-.018-.02-.038a1.331 1.331 0 01-.013-.012zM4.199 4.48c-.003.004-.008.008-.027.014-.005.013-.011.025-.031.047a2.085 2.085 0 01-.124.167c-.048.07-.116.055-.181.041-.134-.028-.228.016-.287.143-.089.187-.187.37-.273.56-.049.108-.11.216-.118.36.081.003.154.007.228.008h.228a2.563 2.563 0 01-.079.264c-.01.052-.022.103-.033.155l.02.004c.018-.046.037-.092.067-.153.066-.142.13-.285.2-.426.02-.04.034-.1.116-.092 0 .043.004.084 0 .124-.005.045-.017.09-.028.143.141.043.086.174.115.269.102-.022.104-.195.248-.144v.205l.017.002.439-1.059c-.13 0-.246-.02-.358.033-.024.011-.058-.001-.108-.004.075-.15.139-.278.211-.417a.128.128 0 01.025-.036c0-.015-.001-.03.008-.038l.006-.02c-.005.006-.01.011-.028.017-.004.012-.009.024-.026.045a.085.085 0 01-.032.033c-.123.157-.09.164-.258.106-.079-.027-.078-.028-.047-.144.028-.046.056-.093.098-.15 0-.016-.001-.032.007-.042L4.2 4.48zm2.073-.67c-.003.006-.007.011-.027.016-.094.125-.194.246-.28.377-.155.238-.301.481-.451.723-.14.224-.345.368-.575.481-.017.008-.04.006-.079.011.012-.059.016-.109.033-.153a6.076 6.076 0 01.229-.518l-.007-.02a.138.138 0 01-.035.025c-.028.05-.055.1-.093.164-.26.424-.443.817-.442.95.024.004.048.011.073.013.177.013.188.007.26-.165.03-.07.077-.12.147-.15l.175-.07c.044-.018.085-.057.146-.032.003.05-.01.11.014.145.042.062.044.125.047.193.002.049.017.098.026.147.029-.034.039-.065.05-.097.142-.39.277-.782.428-1.17.1-.256.22-.504.33-.756.013-.03.013-.067.03-.092V3.81zm3.987-.34c0 .045.01.084.021.123.042.16.094.318.124.48.024.133.023.27.028.406 0 .033-.019.067-.032.11-.094-.058-.047-.158-.106-.215h-.125c-.015.072-.01.152-.046.2-.066.085-.155.154-.236.227-.043.038-.078.018-.103-.025l-.046-.087c-.065.035-.117.069-.172.093-.116.051-.235.095-.35.147-.085.038-.09.053-.07.147.014.075.034.148.047.223.013.072.05.109.123.124.233.05.462.115.657.265.058-.102.058-.102.168-.151.03-.014.06-.03.092-.042.08-.03.115-.017.15.06.023.048.041.098.066.158.06-.14-.042-.267.017-.416.157.18.24.39.375.567a.235.235 0 00.022-.098c.002-.124 0-.247.002-.371 0-.034.013-.067.02-.1l.032-.003c.11.155.13.354.226.52a3.036 3.036 0 00-.01-.392c-.004-.045 0-.074.05-.088.08.036.116.14.215.158-.03-.275-.423-1.137-.798-1.635-.114-.127-.2-.28-.34-.386zm-2.667.696c-.019.034-.03.05-.037.067-.061.185-.125.37-.18.556-.031.105-.087.169-.195.19-.09.019-.178.052-.268.073-.038.009-.089.015-.118-.003-.024-.016-.025-.069-.036-.106-.064.076-.082.087-.17.047-.133-.062-.262-.135-.393-.201-.048-.025-.093-.063-.17-.03-.043.12-.091.25-.137.382-.099.28-.087.242.095.453.046.048.102.03.154.023.054-.009.106-.03.16-.036.13-.013.26-.08.367-.015.204-.064.387-.122.571-.178.05-.015.089.005.114.054.022.042.034.093.082.121.038-.056-.013-.128.063-.178l.14.241-.042-1.46zm.278.358c-.096-.01-.107.01-.11.108-.002.038-.003.078.002.115.03.2.099.386.174.57.002.006.012.01.022.015l.078-.05c.052.036.081.088.153.088.205-.002.41.014.616.012.099-.001.158.042.205.12.018.03.024.077.088.066l-.08-.394c-.05-.195-.085-.395-.172-.589-.057.057-.114.068-.18.046a.72.72 0 00-.135-.028c-.22-.028-.44-.059-.66-.08zm10.254-1.727c.089.163.155.316.139.491-.016.168.026.342-.044.516-.047-.033-.088-.082-.112-.075-.117.035-.164-.057-.227-.115a4.772 4.772 0 01-.286-.29l-.104-.113a4.856 4.856 0 01-.023.019c.035.046.07.093.11.156.04.064.084.127.122.193.034.058.065.118.031.205-.082-.01-.164-.019-.246-.032-.06-.01-.101 0-.124.07-.031.098-.037.096-.15.09.02.042.036.08.057.116.041.074.03.138-.03.196-.06.06-.118.122-.178.181a.175.175 0 01-.185.046c-.222-.061-.447-.113-.67-.174-.032-.009-.063-.04-.086-.068-.03-.04-.052-.087-.08-.13-.044-.07-.09-.138-.136-.207a.18.18 0 00-.014.105c.012.127.03.253.035.38.005.1-.024.12-.121.104-.104-.017-.206-.04-.31-.058-.064-.012-.131-.028-.202.03l.081.208c.09 0 .166-.01.237.002a.819.819 0 01.458.251c.078.083.154.168.241.26l.018-.005c-.004-.006-.008-.013-.01-.04.014-.056-.062-.118.018-.178.031.03.064.057.088.09.058.078.111.159.169.257l.089.141.024-.013a2093.819 2093.819 0 01-.427-.934c.055.007.083.007.108.016.193.07.385.142.577.216.074.028.147.06.219.094.062.028.112.018.157-.033.05-.056.102-.112.154-.167.05-.051.095-.046.132.014.016.025.026.053.04.08.071.138.143.277.217.433l.159.308.025-.011c-.044-.106-.07-.218-.138-.334-.057-.182-.168-.346-.206-.545.136.034.362.326.567.732l.057.074.018-.011a1.563 1.563 0 01-.052-.127c-.046-.145-.097-.29-.136-.436-.022-.083-.036-.173.022-.26l.109.058-.026-.207.027-.016c.022.02.05.036.065.06.073.108.143.22.215.33.01.016.029.029.043.043-.036-.217-.2-.38-.229-.626l.155.112c.014-.166.012-.319.042-.465.032-.158-.023-.297-.063-.445.024.004.036.006.055.025.092.124.183.249.277.371.02.027.05.047.069.087l.04.063.019-.015a.293.293 0 01-.053-.082 27.922 27.922 0 01-.332-.49c-.221-.311-.363-.467-.485-.521zm-6.57.327c-.003.161.092.275.069.415l-.368.087c.09.139.032.237-.052.331-.05.057-.092.122-.143.178-.037.04-.046.078-.018.126l.16.275c.029.048.072.066.128.064.076-.003.152 0 .228-.001.116-.003.216.022.275.137.006.014.02.024.044.052.004-.059-.003-.098.01-.13.016-.04.04-.099.072-.108.084-.023.173-.024.26-.03.013-.001.027.018.04.029l.071.065c.019-.11-.082-.198-.024-.31l.126.04c-.026-.123-.07-.245-.071-.366 0-.123.051-.243.115-.36.107.062.16.156.234.253.183.265.36.533.494.834.165-.078.27.068.407.088-.003-.106-.133-.441-.197-.492a.142.142 0 00-.102-.028c-.06.011-.119.039-.191.063-.025-.039-.056-.078-.077-.122a3.936 3.936 0 00-.473-.783c-.076-.094-.16-.182-.228-.26l-.391.285c-.049.035-.094.03-.132-.017l-.169-.207c-.025-.03-.053-.059-.097-.108z`}),t[0]=n,t[1]=r,t[2]=i,t[3]=a):(n=t[0],r=t[1],i=t[2],a=t[3]);let o;return t[4]===e?o=t[5]:(o=(0,F.jsxs)(`svg`,{role:`img`,"aria-label":`Hermes icon`,xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,fill:`currentColor`,fillRule:`evenodd`,viewBox:`0 0 24 24`,...e,children:[n,r,i,a]}),t[4]=e,t[5]=o),o}function _e(e){let t=(0,I.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsx)(`title`,{children:`OpenClaw icon`}),t[0]=n):n=t[0];let r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,F.jsxs)(`mask`,{id:`openclaw-eyes`,maskUnits:`userSpaceOnUse`,x:0,y:0,width:120,height:120,children:[(0,F.jsx)(`rect`,{width:120,height:120,fill:`white`}),(0,F.jsx)(`circle`,{cx:45,cy:35,r:6,fill:`black`}),(0,F.jsx)(`circle`,{cx:75,cy:35,r:6,fill:`black`})]}),t[1]=r):r=t[1];let i,a,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,F.jsxs)(`g`,{fill:`currentColor`,mask:`url(#openclaw-eyes)`,children:[(0,F.jsx)(`path`,{d:`M60 10 C30 10 15 35 15 55 C15 75 30 95 45 100 L45 110 L55 110 L55 100 C55 100 60 102 65 100 L65 110 L75 110 L75 100 C90 95 105 75 105 55 C105 35 90 10 60 10Z`}),(0,F.jsx)(`path`,{d:`M20 45 C5 40 0 50 5 60 C10 70 20 65 25 55 C28 48 25 45 20 45Z`}),(0,F.jsx)(`path`,{d:`M100 45 C115 40 120 50 115 60 C110 70 100 65 95 55 C92 48 95 45 100 45Z`})]}),a=(0,F.jsx)(`path`,{d:`M45 15 Q35 5 30 8`,fill:`none`,stroke:`currentColor`,strokeWidth:3,strokeLinecap:`round`}),o=(0,F.jsx)(`path`,{d:`M75 15 Q85 5 90 8`,fill:`none`,stroke:`currentColor`,strokeWidth:3,strokeLinecap:`round`}),t[2]=i,t[3]=a,t[4]=o):(i=t[2],a=t[3],o=t[4]);let s;return t[5]===e?s=t[6]:(s=(0,F.jsxs)(`svg`,{role:`img`,"aria-label":`OpenClaw icon`,xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,fill:`none`,viewBox:`0 0 120 120`,...e,children:[n,r,i,a,o]}),t[5]=e,t[6]=s),s}function ve(e){let t=(0,I.c)(5),n,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsx)(`title`,{children:`OpenCode icon`}),r=(0,F.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M384 416H128V96H384V416ZM320 160H192V352H320V160Z`}),i=(0,F.jsx)(`path`,{fill:`currentColor`,fillOpacity:.55,d:`M320 224V352H192V224H320Z`}),t[0]=n,t[1]=r,t[2]=i):(n=t[0],r=t[1],i=t[2]);let a;return t[3]===e?a=t[4]:(a=(0,F.jsxs)(`svg`,{role:`img`,"aria-label":`OpenCode icon`,xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,fill:`none`,viewBox:`0 0 512 512`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}function ye(e){let t=(0,I.c)(5),n,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsx)(`title`,{children:`Pi icon`}),r=(0,F.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M165.29 165.29H517.36V400H400V517.36H282.65V634.72H165.29ZM282.65 282.65V400H400V282.65Z`}),i=(0,F.jsx)(`path`,{fill:`currentColor`,d:`M517.36 400H634.72V634.72H517.36Z`}),t[0]=n,t[1]=r,t[2]=i):(n=t[0],r=t[1],i=t[2]);let a;return t[3]===e?a=t[4]:(a=(0,F.jsxs)(`svg`,{role:`img`,"aria-label":`Pi icon`,xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,fill:`none`,viewBox:`0 0 800 800`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}var be={"claude-cowork":`claude`,"claude-code":`claude`,codex:`openai`,cursor:`cursor`,copilot:`github`,opencode:`opencode`,pi:`pi`,antigravity:`antigravity`,openclaw:`openclaw`,hermes:`hermes`};function xe(e){let t=(0,I.c)(47),n,r,a,s;t[0]===e?(n=t[1],r=t[2],a=t[3],s=t[4]):({id:r,style:s,className:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=s);let{resolvedTheme:c}=i(),u=be[r],m=u?(c===`dark`?l[u]:void 0)??ee[u]:void 0,h;t[5]!==m||t[6]!==s?(h=m?{...s,"--ok-brand-color":m}:s,t[5]=m,t[6]=s,t[7]=h):h=t[7];let g=h,_=m&&`[&_*]:![color:var(--ok-brand-color)]`,v;t[8]!==n||t[9]!==_?(v=o(_,n),t[8]=n,t[9]=_,t[10]=v):v=t[10];let y=v;if(r===`claude-cowork`||r===`claude-code`){let e;return t[11]!==y||t[12]!==g||t[13]!==a?(e=(0,F.jsx)(d,{style:g,className:y,...a}),t[11]=y,t[12]=g,t[13]=a,t[14]=e):e=t[14],e}if(r===`codex`){let e;return t[15]!==y||t[16]!==g||t[17]!==a?(e=(0,F.jsx)(f,{style:g,className:y,...a}),t[15]=y,t[16]=g,t[17]=a,t[18]=e):e=t[18],e}if(r===`cursor`){let e;return t[19]!==y||t[20]!==g||t[21]!==a?(e=(0,F.jsx)(p,{style:g,className:y,...a}),t[19]=y,t[20]=g,t[21]=a,t[22]=e):e=t[22],e}if(r===`copilot`){let e;return t[23]!==y||t[24]!==g||t[25]!==a?(e=(0,F.jsx)(te,{style:g,className:y,...a}),t[23]=y,t[24]=g,t[25]=a,t[26]=e):e=t[26],e}if(r===`opencode`){let e;return t[27]!==y||t[28]!==g||t[29]!==a?(e=(0,F.jsx)(ve,{style:g,className:y,...a}),t[27]=y,t[28]=g,t[29]=a,t[30]=e):e=t[30],e}if(r===`pi`){let e;return t[31]!==y||t[32]!==g||t[33]!==a?(e=(0,F.jsx)(ye,{style:g,className:y,...a}),t[31]=y,t[32]=g,t[33]=a,t[34]=e):e=t[34],e}if(r===`antigravity`){let e;return t[35]!==y||t[36]!==g||t[37]!==a?(e=(0,F.jsx)(he,{style:g,className:y,...a}),t[35]=y,t[36]=g,t[37]=a,t[38]=e):e=t[38],e}if(r===`openclaw`){let e;return t[39]!==y||t[40]!==g||t[41]!==a?(e=(0,F.jsx)(_e,{style:g,className:y,...a}),t[39]=y,t[40]=g,t[41]=a,t[42]=e):e=t[42],e}if(r===`hermes`){let e;return t[43]!==y||t[44]!==g||t[45]!==a?(e=(0,F.jsx)(ge,{style:g,className:y,...a}),t[43]=y,t[44]=g,t[45]=a,t[46]=e):e=t[46],e}return null}var Se=c;function Ce(e){return s[e].handoffTarget}export{ae as S,re as _,$ as a,N as b,W as c,U as d,de as f,ie as g,se as h,me as i,H as l,z as m,Ce as n,fe as o,R as p,xe as r,pe as s,Se as t,ue as u,P as v,oe as x,A as y};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./utils-CPqDy6Hr.js";import"./dropdown-menu-CLgDYkh1.js";import{Gt as s,Kt as c,n as l,t as ee}from"./dist-GenOktAv.js";import{t as u}from"./badge-DFX4S3a5.js";import{i as d,n as f,t as p}from"./cursor-B6reg1lS.js";import{t as te}from"./copilot-Dh1BU6kS.js";var m=e(n(),1),h=`ok-acp-registered-agents-v1`,g={agents:[],defaultKey:null};function _(e){return`${e.source}:${e.id}`}function v(e){if(typeof e!=`object`||!e)return!1;let t=e;return(t.source===`registry`||t.source===`custom`)&&typeof t.id==`string`&&t.id!==``&&typeof t.name==`string`&&t.name!==``&&(t.iconUrl===void 0||typeof t.iconUrl==`string`)&&(t.lastUsedAt===void 0||typeof t.lastUsedAt==`number`)&&(t.featured===void 0||typeof t.featured==`boolean`)}function y(){let e;try{e=localStorage.getItem(h)}catch{return g}if(e===null)return g;try{let t=JSON.parse(e),n=Array.isArray(t.agents)?t.agents.filter(v):[];return{agents:n,defaultKey:typeof t.defaultKey==`string`&&n.some(e=>_(e)===t.defaultKey)?t.defaultKey:null}}catch(e){return console.warn(`[registered-agents] discarding corrupt localStorage payload`,e),g}}function b(e){try{localStorage.setItem(h,JSON.stringify(e))}catch(e){console.warn(`[registered-agents] failed to persist registration`,e)}}var x=null,S=[],C=null,w=new Set;function T(){return x===null&&(x=y()),x}function E(e){x=e,C=M(e.agents,S);for(let e of w)e()}function ne(){E(y())}typeof window<`u`&&typeof window.addEventListener==`function`&&window.addEventListener(`storage`,e=>{(e.key===h||e.key===null)&&ne()});function D(e){return w.add(e),()=>w.delete(e)}var O=()=>(C===null&&(C=M(T().agents,S)),C),k=()=>{let{agents:e,defaultKey:t}=T();return t===null?null:e.find(e=>_(e)===t)??null};function A(e,t={}){let{makeDefault:n=!0}=t,r=_(e),i=T();if(!n){let t={agents:i.agents.some(e=>_(e)===r)?i.agents.map(t=>_(t)===r?{...e,...t.lastUsedAt===void 0?{}:{lastUsedAt:t.lastUsedAt}}:t):[...i.agents,e],defaultKey:i.defaultKey};b(t),E(t);return}let a=i.agents.filter(e=>_(e)!==r),o={agents:[{...e,lastUsedAt:Date.now()},...a],defaultKey:r};b(o),E(o)}function j(e,t){let n=e.lastUsedAt??0,r=t.lastUsedAt??0;if(n!==r)return r-n;let i=e.featured===!0?0:1,a=t.featured===!0?0:1;return i===a?e.name.localeCompare(t.name,void 0,{numeric:!0,sensitivity:`base`}):i-a}function M(e,t){let n=new Set(e.map(_));return[...e,...t.filter(e=>!n.has(_(e)))].sort(j)}function N(e){S=[...e],C=M(T().agents,S);for(let e of w)e()}function P(e,t){let n=T();if(n.defaultKey!==e)return;let r=n.agents.find(n=>_(n)!==e&&t(n))??null,i={agents:n.agents,defaultKey:r?_(r):null};b(i),E(i)}function re(e,t){return t!==null&&e.some(e=>e.source===t.source&&e.id===t.id)?t:e[0]??null}function ie(e){let t=new Map(e.map(e=>[_(e),e])),n=T(),r=!1,i=n.agents.map(e=>{let n=t.get(_(e));if(n===void 0)return e;let i=n.name??e.name,a=n.iconUrl??e.iconUrl,o=n.supported??e.supported,s=n.featured??e.featured;return i===e.name&&a===e.iconUrl&&o===e.supported&&s===e.featured?e:(r=!0,{...e,name:i,...a===void 0?{}:{iconUrl:a},...o===void 0?{}:{supported:o},...s===void 0?{}:{featured:s}})});if(!r)return;let a={agents:i,defaultKey:n.defaultKey};b(a),E(a)}function ae(){return(0,m.useSyncExternalStore)(D,O,O)}function oe(){return(0,m.useSyncExternalStore)(D,k,k)}var F=t(),I=a();async function se(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.openExternal)try{return await n.shell.openExternal(e),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:L(e)}}let r=t.doc??(typeof document<`u`?document:void 0);if(!r)return{ok:!1,reason:`dispatch-error`,detail:`no DOM available`};try{let t=r.createElement(`a`);return t.href=e,t.rel=`noopener noreferrer`,/^https?:/i.test(e)&&(t.target=`_blank`),r.body.appendChild(t),t.click(),t.remove(),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:L(e)}}}function L(e){if(e instanceof Error)return e.message;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}var R=[{id:`claude-cowork`,displayName:`Claude Cowork`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,tagline:`Conversational pairing in Claude Desktop's Cowork tab.`},{id:`claude-code`,displayName:`Claude`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,tagline:`Agentic coding in Claude Desktop's Code tab.`},{id:`codex`,displayName:`Codex`,appBrandName:`Codex Desktop`,schemes:[`codex:`],installUrl:`https://openai.com/codex`,tagline:`OpenAI's coding agent, terminal-native.`},{id:`cursor`,displayName:`Cursor`,schemes:[`cursor:`],installUrl:`https://cursor.com/`,tagline:`AI-first VS Code fork with multi-file edits.`},{id:`copilot`,displayName:`GitHub Copilot`,schemes:[],installUrl:`https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-getting-started`,tagline:`GitHub's terminal-native coding agent.`},{id:`opencode`,displayName:`OpenCode`,schemes:[],installUrl:`https://opencode.ai`,tagline:`Open-source terminal coding agent; bring any local model.`},{id:`pi`,displayName:`Pi`,schemes:[],installUrl:`https://pi.dev`,tagline:`Minimal open-source terminal coding agent, extensible in TypeScript.`},{id:`antigravity`,displayName:`Antigravity`,schemes:[],installUrl:`https://antigravity.google`,tagline:"Google's agentic IDE + `agy` terminal agent."},{id:`openclaw`,displayName:`OpenClaw`,schemes:[],installUrl:`https://openclaw.ai`,tagline:`Open-source agent gateway; runs agents against your MCP servers.`},{id:`hermes`,displayName:`Hermes`,schemes:[],installUrl:`https://hermes-agent.nousresearch.com`,tagline:`Nous Research's terminal coding agent.`}],z=R.filter(e=>e.id!==`claude-cowork`&&e.id!==`copilot`&&e.id!==`opencode`&&e.id!==`pi`&&e.id!==`antigravity`&&e.id!==`openclaw`&&e.id!==`hermes`),B=`ok-acp-enabled-agents-v1`,V={};function H(e,t){return`in-app:${e}:${t}`}function U(e){return`terminal:${e}`}function W(e){return`desktop:${e}`}function G(e,t){return e??t}function K(){let e;try{e=localStorage.getItem(B)}catch(e){return console.warn(`[enabled-agents] localStorage unavailable; treating overrides as empty`,e),V}if(e===null)return V;try{let t=JSON.parse(e);if(typeof t!=`object`||!t)return V;let n={};for(let[e,r]of Object.entries(t))typeof r==`boolean`&&(n[e]=r);return n}catch(e){return console.warn(`[enabled-agents] discarding corrupt localStorage payload`,e),V}}function q(e){try{localStorage.setItem(B,JSON.stringify(e))}catch(e){console.warn(`[enabled-agents] failed to persist override`,e)}}var J=null,Y=new Set;function X(){return J===null&&(J=K()),J}function Z(e){J=e;for(let e of Y)e()}function ce(){Z(K())}typeof window<`u`&&typeof window.addEventListener==`function`&&window.addEventListener(`storage`,e=>{(e.key===B||e.key===null)&&ce()});function le(e){return Y.add(e),()=>Y.delete(e)}var Q=()=>X();function ue(e,t){let n=X();if(t===void 0){if(!(e in n))return;let{[e]:t,...r}=n;q(r),Z(r);return}if(n[e]===t)return;let r={...n,[e]:t};q(r),Z(r)}function de(){return(0,m.useSyncExternalStore)(le,Q,Q)}function fe(e,t,n,r,i){return i===!1?!1:G(e[H(t,n)],r)}function pe(e,t,n){return G(e[U(t)],n[t]!==!1)}function $(e,t){return G(e[W(t)],!1)}function me(e){let t=(0,I.c)(5),{className:n}=e,i;t[0]===n?i=t[1]:(i=o(`h-4 px-1 text-[10px]`,n),t[0]=n,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,F.jsx)(r,{id:`YBt9YP`}),t[2]=a):a=t[2];let s;return t[3]===i?s=t[4]:(s=(0,F.jsx)(u,{variant:`gray`,className:i,children:a}),t[3]=i,t[4]=s),s}function he(e){let t=(0,I.c)(5),n,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsx)(`title`,{children:`Antigravity icon`}),r=(0,F.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 2.5a1.5 1.5 0 0 1 1.28.72l8.5 14A1.5 1.5 0 0 1 20.5 19.5h-17a1.5 1.5 0 0 1-1.28-2.28l8.5-14A1.5 1.5 0 0 1 12 2.5Zm0 4.42L5.83 17h12.34L12 6.92Z`}),i=(0,F.jsx)(`path`,{fill:`currentColor`,d:`M12 9.6 15.6 17h-7.2L12 9.6Z`}),t[0]=n,t[1]=r,t[2]=i):(n=t[0],r=t[1],i=t[2]);let a;return t[3]===e?a=t[4]:(a=(0,F.jsxs)(`svg`,{role:`img`,"aria-label":`Antigravity icon`,xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,fill:`none`,viewBox:`0 0 24 24`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}function ge(e){let t=(0,I.c)(6),n,r,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsx)(`title`,{children:`Hermes icon`}),r=(0,F.jsx)(`path`,{d:`M5.938 12.835c.127-.039.285.02.373.143.028.038.036.092.046.14.003.014-.02.033-.04.05-.124-.098-.24-.194-.354-.291-.011-.01-.016-.027-.025-.042zM8.396 9.412c.195-.032.39-.06.588-.05a.54.54 0 01.148.026c.202.071.402.147.601.224.028.01.05.036.075.055l-.013.027a9.203 9.203 0 01-.26-.089c-.115-.038-.213-.077-.315-.098-.25-.05-.25-.046-.292-.014l.574.144c.275.139.55.276.823.417.042.022.09.057.107.098.026.06.063.076.117.072.066-.006.132-.017.213-.027l-.04.086c.051.08.142.02.216.064-.074.13-.247.09-.334.199l.061.074-.12.087c0 .106-.038.168-.306.243l.026.085-.196.042.07.124h-.25l-.007.137c-.081-.01-.161-.018-.244-.027l-.053.123c-.027-.008-.052-.011-.073-.023-.067-.038-.128-.056-.195.006-.019.017-.063.014-.093.008-.026-.006-.05-.029-.07-.042-.11.095-.11.095-.208.003-.057.046-.12.074-.186.011-.063.027-.123-.02-.178-.014-.07.007-.097-.035-.133-.07l-.13.033c-.013-.236-.194-.19-.34-.203.005-.072.05-.092.095-.094a.474.474 0 01.159.022c.164.05.32.12.496.138.203.021.405.029.601-.015.265-.059.52-.149.707-.365.049-.056.083-.127.117-.195.019-.038.02-.084-.02-.116a1.397 1.397 0 00-.382-.217c.024.12-.031.182-.115.221 0 .014-.004.025 0 .03.08.115.084.16-.007.267a1.39 1.39 0 01-.218.211.477.477 0 01-.641-.05 1.36 1.36 0 01-.133-.152c-.078-.107-.076-.108-.033-.236-.165-.08-.128-.226-.104-.364.008-.05.028-.096.049-.163-.04.014-.067.017-.087.032a.897.897 0 00-.316.357c-.007.016-.01.034-.02.047-.012.015-.034.038-.045.035-.02-.006-.037-.027-.05-.045-.008-.012-.007-.032-.012-.057h-.126l.053-.172a14.82 14.82 0 00-.039-.049l.11-.284c-.06.026-.091.044-.124.051-.03.007-.064 0-.095 0 0-.031-.01-.07.004-.092.149-.22.305-.428.593-.476z`}),i=(0,F.jsx)(`path`,{d:`M8.06 10.788c-.003-.038-.004-.075.037-.062.016.006.034.048.028.067-.01.04-.038.032-.064-.005z`}),a=(0,F.jsx)(`path`,{clipRule:`evenodd`,d:`M11.981.009c.226-.012.453-.011.679 0 .247.01.495.024.74.062.401.064.798.157 1.19.273.463.138.92.299 1.356.511a7.31 7.31 0 012.948 2.642c.292.469.536.963.739 1.479.219.556.446 1.11.623 1.683.204.654.329 1.326.458 1.997.097.504.182 1.01.29 1.511.156.722.329 1.44.494 2.16.186.812.4 1.615.63 2.415.102.355.193.713.282 1.072.11.436.202.876.254 1.323.031.278.066.557.073.837a7.56 7.56 0 01-.017.88c-.037.413-.1.818-.226 1.212a5.017 5.017 0 01-.915 1.649l-.13.156.018.023c.043-.023.088-.041.127-.068.2-.138.373-.307.531-.49.4-.46.721-.973.975-1.529a3.59 3.59 0 00.325-1.72c-.024-.424-.097-.834-.3-1.213-.013-.027-.015-.06-.03-.121.05.035.082.048.101.072.107.13.22.258.315.398.33.494.46 1.052.486 1.64a3.75 3.75 0 01-.47 1.97c-.36.655-.887 1.14-1.526 1.506-.193.111-.394.21-.595.308-.157.078-.248.211-.318.365a.522.522 0 00-.033.406.359.359 0 01.013.139c-.005.077-.077.155-.14.162-.054.006-.125-.043-.15-.116a1.206 1.206 0 01-.06-.233c-.04-.314-.155-.6-.308-.87a3.906 3.906 0 00-.73-.91 2.129 2.129 0 00-.897-.524 4.093 4.093 0 00-.692-.131c-.075-.008-.15-.04-.22.01.18.06.363.11.538.18.434.173.82.43 1.18.728.308.255.58.543.794.884.098.155.186.315.227.496.027.123.042.25.067.375.013.062-.002.109-.053.144-.047.033-.122.034-.163-.01a.455.455 0 01-.08-.14c-.03-.073-.038-.159-.078-.225a7.314 7.314 0 00-1.423-1.664c-.16-.137-.329-.26-.537-.323-.376-.114-.753-.203-1.15-.154-.213.025-.427.032-.64.053a1.6 1.6 0 00-.736.278 5.14 5.14 0 00-.834.72c-.329.342-.642.699-.955 1.055-.136.155-.264.319-.314.531a5.227 5.227 0 00-.012.051.096.096 0 01-.09.076h-.31c-.046 0-.082-.048-.072-.094.023-.108.045-.216.07-.324.075-.325.19-.635.368-.917.024-.039.04-.088.104-.08l.01.049.027.077c.28-.435.571-.834.996-1.135.283-.204.584-.378.89-.55a.196.196 0 00-.098-.002c-.162.043-.325.084-.485.134-.402.124-.764.33-1.11.566-.147.1-.298.193-.414.333a7.314 7.314 0 00-1.07 1.767.845.845 0 00-.04.12.075.075 0 01-.072.056h-.494c-.04 0-.062-.051-.036-.082.123-.14.246-.282.377-.415.275-.281.58-.532.777-.884.027-.048.063-.09.095-.135.238-.333.54-.607.818-.902.082-.086.175-.16.26-.24.029-.027.053-.057.079-.085l-.018-.025-.135.041c-.034.017-.07.031-.102.05-.248.144-.494.292-.743.433-.408.23-.825.439-1.209.711-.281.2-.591.358-.889.533-.02.012-.044.015-.08.028-.015-.135.143-.201.108-.336-.033.014-.064.02-.085.038-.111.096-.227.19-.328.296-.148.157-.284.325-.425.488-.125.143-.25.286-.373.431A.153.153 0 019.89 24H8.762a.316.316 0 00.016-.042c.028-.09.085-.172.083-.28-.091-.018-.162.001-.212.077a4.45 4.45 0 00-.136.215c-.01.016-.024.03-.042.03h-.093c-.019 0-.029-.022-.017-.037.071-.088.14-.178.209-.268.001-.002-.006-.012-.012-.024-.014.004-.03.006-.045.013-.176.09-.352.181-.527.274a.363.363 0 01-.168.042H5.202c-.026 0-.039-.036-.019-.053.21-.178.402-.374.558-.605.335-.496.538-1.047.667-1.629.004-.02-.003-.043-.006-.091-.037.048-.059.072-.076.1a1.943 1.943 0 01-.334.415c-.28.258-.59.448-.983.464-.297.012-.588 0-.865-.127-.46-.21-.722-.57-.794-1.072-.025-.17-.017-.171-.182-.219A3.513 3.513 0 011.97 20.6a2.286 2.286 0 01-.808-1.13 3.569 3.569 0 01-.16-1.245c.002-.034.016-.067.024-.1.032.023.046.043.05.066.033.153.059.308.096.46.086.355.257.664.516.92.258.256.571.419.91.532.358.118.717.138 1.07-.016a1.89 1.89 0 00.621-.452c.328-.348.533-.76.648-1.223.009-.034.005-.071.007-.11-.015.006-.026.006-.03.011-.031.05-.064.1-.093.152-.284.502-.679.887-1.196 1.135-.351.17-.718.255-1.11.159a1.607 1.607 0 01-.971-.64 2.006 2.006 0 01-.368-.924 2.903 2.903 0 01.02-.886c.05-.439.466-1.17.742-1.271-.02.063-.035.112-.053.16-.043.116-.097.227-.13.345a1.901 1.901 0 00-.05.82c.033.212.09.416.204.6.147.236.346.407.62.465.11.023.225.014.338.018a.576.576 0 00.386-.131c.164-.128.282-.292.366-.481.168-.375.24-.777.309-1.179.05-.296.093-.594.133-.893.039-.281.071-.563.104-.845.026-.232.048-.464.074-.696.024-.228.052-.455.076-.683.024-.227.047-.455.069-.683.013-.14.022-.28.034-.42l.037-.417c.022-.25.041-.5.065-.748.008-.082-.02-.132-.09-.177a2.46 2.46 0 01-.492-.418c-.1-.109-.188-.228-.282-.342-.035-.042-.056-.097-.116-.118a2.084 2.084 0 00.275.597c.06.092.131.176.196.265.063.086.182.115.234.226-.028.003-.046.01-.06.006a4.74 4.74 0 01-.22-.057 2.71 2.71 0 01-1.287-.819c-.435-.487-.656-1.076-.71-1.723a5.206 5.206 0 01.014-1.06c.072-.602.22-1.186.45-1.745.155-.376.338-.741.526-1.102.205-.393.466-.75.765-1.076.512-.559 1.104-1.024 1.726-1.448.717-.49 1.478-.898 2.277-1.233C8.244.828 8.767.632 9.31.494c.655-.166 1.31-.33 1.982-.415.229-.03.458-.058.688-.07zm-1.847 22.82c-.07.06-.147.111-.207.18-.238.27-.464.549-.668.869l-.044.108a.177.177 0 00.093-.057c.174-.19.351-.378.519-.574.104-.122.195-.255.288-.386.024-.034.03-.08.046-.12l-.027-.02zm1.65-3.695a5.51 5.51 0 00-.653.593l-.37.386a.963.963 0 01-.377.25 1.372 1.372 0 01-.467.09c-.044 0-.087.006-.151.012.028.058.043.097.064.131.15.242.301.482.45.724.136.22.276.438.399.666.068.125.105.267.156.404.077.027.14-.018.202-.048.29-.135.579-.274.867-.412.213-.101.437-.186.636-.31.347-.215.68-.455 1.018-.685.015-.01.026-.028.042-.046-.023-.019-.038-.037-.056-.044-.287-.111-.527-.3-.77-.482a5.319 5.319 0 01-.506-.42 1.757 1.757 0 01-.41-.653c-.019-.049-.045-.095-.075-.156zm-5.847.264c-.06.096-.097.194-.132.293a3.38 3.38 0 01-.555 1.01c-.2.25-.455.412-.762.493-.23.06-.464.076-.7.07-.048-.002-.097.002-.158.005.016.04.021.066.035.085.1.145.23.246.4.295.157.046.316.034.498.023.181-.037.343-.115.485-.234.238-.199.402-.454.536-.732.175-.363.264-.751.342-1.144.01-.053.008-.11.011-.164zm14.945-4.586c.008.029.016.057.027.107.024.155.051.31.072.464.03.219.067.437.078.657.017.344.027.689-.014 1.033-.037.315-.063.633-.116.946a6.153 6.153 0 01-.46 1.518c-.008.018-.01.039-.02.082.047-.03.077-.042.098-.064.085-.083.17-.167.248-.255.271-.305.458-.66.596-1.043.18-.498.228-1.011.145-1.531-.103-.65-.33-1.263-.597-1.881a9.055 9.055 0 00-.024-.055l-.033.022zM5.797 8.29a.26.26 0 00.018.153c.124.251.25.501.379.75.025.049.066.09.03.163-.284.06-.578.119-.88.255.059.038.097.06.132.087.042.032.112.058.09.12-.01.033-.075.048-.117.072.017.01.043.021.067.036.166.102.33.207.447.368.138.192.229.404.188.644-.079.469-.306.85-.69 1.132-.054.04-.106.083-.161.122a.243.243 0 00-.103.245.77.77 0 00.055.195c.083.196.22.35.375.492.083.076.159.164.222.257a.37.37 0 01.025.377c-.023.05-.05.099-.076.148-.03.06-.028.111.022.162.041.042.08.089.112.138.038.058.078.079.147.05a.486.486 0 01.333-.006c.16.046.302.126.444.21.13.077.264.149.4.219.067.035.14.05.219.026.071-.022.124.01.145.076.02.064-.003.108-.074.139-.07.03-.137.063-.209.088-.1.035-.201.073-.314.077-.013-.107.11-.088.127-.159-.206-.126-.643-.145-.801-.034.063.112.035.21-.096.313-.13-.1-.025-.202.002-.3a.209.209 0 00-.249.17c-.015.101.067.216.178.224.108.007.218-.005.326-.012.06-.005.12-.027.199 0-.103.123-.248.127-.357.19.002.05.07.086.019.131-.053.048-.095-.001-.132-.03-.08-.063-.16-.126-.231-.197a.474.474 0 01-.157-.311.52.52 0 00-.043-.172c-.032-.074-.032-.137.033-.19-.018-.03-.028-.053-.045-.072a1.222 1.222 0 01-.196-.369c-.053-.137-.046-.264.048-.381.024-.03.05-.06.064-.095a.664.664 0 00.047-.168c.017-.165-.064-.287-.182-.387-.186-.156-.36-.322-.46-.551-.005-.011-.024-.017-.037-.026-.011.017-.024.027-.025.038-.019.185-.045.37-.052.557-.014.377.058.743.162 1.104.118.41.289.798.488 1.173.267.502.537 1.002.812 1.5.055.098.13.189.208.27.198.202.452.272.724.273.202 0 .404-.006.605-.026.295-.03.59-.073.884-.113.183-.025.365-.057.548-.08.21-.026.38.073.522.21.16.156.305.327.447.5.22.265.397.56.554.867.05.098.07.1.147.03.13-.121.26-.242.394-.36.067-.059.088-.12.067-.213a3.535 3.535 0 01-.085-.796c.002-.157.006-.314.018-.471.015-.224.03-.45.06-.672a59.114 59.114 0 01.362-2.298c.087-.493.182-.984.268-1.477.06-.347.118-.694.162-1.043.034-.273.055-.55.063-.825.011-.332.003-.665.002-.998 0-.077.004-.155-.01-.23-.028-.142-.01-.155-.162-.19a5.826 5.826 0 00-.607-.107c-.146-.018-.207-.053-.221-.19-.006-.049-.025-.098-.041-.146-.009-.025-.024-.048-.046-.09l-.025.264c-.009.096-.029.116-.127.115-.055 0-.11-.008-.164-.008-.476 0-.952-.008-1.426.032-.095.008-.173-.015-.226-.103-.04-.066-.088-.126-.134-.186-.063-.084-.086-.093-.182-.06-.195.068-.388.138-.582.21a2.71 2.71 0 00-.675.394.986.986 0 01-.323.168c-.033.01-.07.008-.127.013.02-.066.024-.114.047-.15.064-.105.135-.205.205-.306.023-.033.049-.063.073-.095l-.015-.023-.201.037c-.146.04-.296.07-.437.122-.148.053-.266.023-.386-.072a3.623 3.623 0 01-.733-.786l-.093-.132zm8.592 8.963l-.147.09c-.22.134-.44.266-.659.402-.093.058-.184.12-.27.188-.085.07-.124.161-.072.272.047.1.093.2.147.294.047.08.124.138.213.147.11.01.228.012.336-.012.217-.05.372-.205.528-.357a.291.291 0 00.087-.308c-.046-.18-.079-.365-.118-.547-.011-.052-.027-.103-.045-.169zm-.257-2.409c-.12.291-.205.597-.325.91-.151.433-.294.87-.435 1.323.036-.01.054-.01.067-.018.261-.16.522-.324.785-.484.054-.033.071-.078.065-.138-.012-.13-.024-.262-.034-.393l-.068-.886c-.008-.103-.02-.206-.029-.31-.009 0-.017-.002-.026-.004zm3.081-8.13l.099.285c.08.231.159.463.24.714l.58 1.952c.187.63.372 1.262.558 1.893.114.382.235.762.343 1.146.072.257.126.519.186.799.044.206.087.413.127.64.034.106.023.226.077.325l.025-.006-.068-.362c-.038-.206-.077-.412-.113-.638-.015-.07-.029-.141-.046-.211-.095-.396-.177-.796-.29-1.187-.196-.685-.413-1.364-.618-2.046-.165-.549-.322-1.1-.488-1.648-.069-.227-.15-.45-.226-.695l-.117-.336c-.037-.107-.075-.216-.115-.322-.04-.106-.084-.21-.127-.314a7.558 7.558 0 01-.027.01zM6.225 14.304c-.063-.001-.115.014-.134.083a.35.35 0 00.41.012 4.533 4.533 0 00-.276-.095zM5.23 11.98c-.026-.027-.057-.048-.075.002-.012.032-.007.07-.01.113.082-.037.082-.037.085-.115zm.062-1.189a.135.135 0 00-.088.056.197.197 0 00-.025.11c.005.152.01.306.026.457a.751.751 0 00.066.218c.061.136.157.167.288.101.055-.027.06-.054.025-.11a4.52 4.52 0 01-.129-.211c-.015-.068-.066-.131-.033-.207.04-.09-.076-.116-.074-.19V10.874c-.003-.038-.006-.087-.056-.083zm-.017-.968a.867.867 0 00-.467.127c-.076.045-.084.07-.05.158.034.087.07.173.115.254.064.117.09.125.21.077a.657.657 0 01.336-.053c.202.022.357.136.504.264l.092.077c.007-.006.014-.013.022-.018-.019-.105-.035-.226-.149-.264-.157-.053-.324-.075-.508-.117l-.24-.005c.24-.169.452-.044.687.009-.063-.115-.153-.147-.23-.193-.082-.05-.17-.092-.25-.144-.06-.037-.12-.08-.072-.172zm10.233.325c-.23-.01-.427.08-.608.211-.034.026-.06.065-.105.117.087.026.15.046.232.065.044-.015.088-.03.13-.046.306-.114.61-.115.904.031.126.063.237.04.366-.005-.02-.031-.03-.054-.045-.071a.986.986 0 00-.448-.273c-.14-.044-.284-.024-.426-.03zM7.99 6.483a.308.308 0 00.002.133c.08.321.156.643.242.962.104.387.27.75.456 1.103.02.037.061.08.098.087a.404.404 0 00.253-.051l-.472-.84c-.23-.448-.405-.92-.579-1.394zM10.397.497c-.2-.008-.405.004-.603.034-.236.035-.47.087-.7.152-.287.08-.569.18-.852.273-.04.013-.074.038-.11.058.028.014.05.018.07.014.287-.068.58-.085.873-.09.134-.002.269.009.402.025.19.024.382.048.57.09.456.104.874.3 1.265.556.464.306.888.66 1.257 1.078.205.232.395.475.56.739.17.274.315.561.449.856.273.601.456 1.232.6 1.876.04.173.07.348.1.524.017.104.065.167.17.19.122.028.2.105.22.251-.003.102-.06.174-.129.24a1.065 1.065 0 00-.268.358.164.164 0 00.083-.039c.08-.086.162-.172.235-.265a.56.56 0 00.13-.333c.009-.05.022-.1.024-.15.007-.124-.017-.15-.143-.168-.025-.004-.049-.014-.073-.015-.082-.007-.125-.063-.137-.131-.033-.198-.004-.355.247-.408.086-.018.174-.03.26-.042.158-.023.315-.053.473-.067.14-.012.19.033.226.167.008.029.018.057.021.087.019.179-.008.225-.141.288-.027.013-.055.024-.078.042a.148.148 0 00-.051.067c-.039.144.073.382.206.445l.673.32c.023.011.05.015.075.023l.018-.026c-.015-.008-.032-.013-.044-.024a2.27 2.27 0 00-.544-.32 4.898 4.898 0 00-.173-.075.203.203 0 01-.126-.191c-.003-.085.045-.154.128-.187l.059-.025c.099-.044.118-.076.112-.187a.384.384 0 00-.008-.063c-.067-.294-.123-.59-.205-.88a9.478 9.478 0 00-.826-2.036 7.465 7.465 0 00-1.39-1.805 4.536 4.536 0 00-1.177-.824 3.656 3.656 0 00-1.016-.328 6.155 6.155 0 00-.712-.074zm6.719 5.955c.01.014.018.028.038.034l-.022-.044-.016.01zM4.103 3.917a.062.062 0 01-.03.012.455.455 0 01-.04.039c-.01.01-.02.02-.045.04l-.363.354c-.088.085-.17.178-.266.253-.284.22-.425.53-.544.855a.132.132 0 00-.007.071c.013.055.033.108.052.168l.074.026c-.017.056-.03.105-.047.152-.058.164-.118.327-.175.491-.005.015.008.036.019.077.08-.175.158-.33.225-.489.228-.544.484-1.074.819-1.561.09-.133.182-.266.283-.401.004-.006.007-.013.022-.03.001-.016.003-.032.015-.04l.008-.017zm12.976 2.408a.023.023 0 01.009.019.073.073 0 00-.006.01.188.188 0 00.007.02l.018.022c.002-.007.007-.016.005-.021-.003-.01-.012-.018-.02-.038a1.331 1.331 0 01-.013-.012zM4.199 4.48c-.003.004-.008.008-.027.014-.005.013-.011.025-.031.047a2.085 2.085 0 01-.124.167c-.048.07-.116.055-.181.041-.134-.028-.228.016-.287.143-.089.187-.187.37-.273.56-.049.108-.11.216-.118.36.081.003.154.007.228.008h.228a2.563 2.563 0 01-.079.264c-.01.052-.022.103-.033.155l.02.004c.018-.046.037-.092.067-.153.066-.142.13-.285.2-.426.02-.04.034-.1.116-.092 0 .043.004.084 0 .124-.005.045-.017.09-.028.143.141.043.086.174.115.269.102-.022.104-.195.248-.144v.205l.017.002.439-1.059c-.13 0-.246-.02-.358.033-.024.011-.058-.001-.108-.004.075-.15.139-.278.211-.417a.128.128 0 01.025-.036c0-.015-.001-.03.008-.038l.006-.02c-.005.006-.01.011-.028.017-.004.012-.009.024-.026.045a.085.085 0 01-.032.033c-.123.157-.09.164-.258.106-.079-.027-.078-.028-.047-.144.028-.046.056-.093.098-.15 0-.016-.001-.032.007-.042L4.2 4.48zm2.073-.67c-.003.006-.007.011-.027.016-.094.125-.194.246-.28.377-.155.238-.301.481-.451.723-.14.224-.345.368-.575.481-.017.008-.04.006-.079.011.012-.059.016-.109.033-.153a6.076 6.076 0 01.229-.518l-.007-.02a.138.138 0 01-.035.025c-.028.05-.055.1-.093.164-.26.424-.443.817-.442.95.024.004.048.011.073.013.177.013.188.007.26-.165.03-.07.077-.12.147-.15l.175-.07c.044-.018.085-.057.146-.032.003.05-.01.11.014.145.042.062.044.125.047.193.002.049.017.098.026.147.029-.034.039-.065.05-.097.142-.39.277-.782.428-1.17.1-.256.22-.504.33-.756.013-.03.013-.067.03-.092V3.81zm3.987-.34c0 .045.01.084.021.123.042.16.094.318.124.48.024.133.023.27.028.406 0 .033-.019.067-.032.11-.094-.058-.047-.158-.106-.215h-.125c-.015.072-.01.152-.046.2-.066.085-.155.154-.236.227-.043.038-.078.018-.103-.025l-.046-.087c-.065.035-.117.069-.172.093-.116.051-.235.095-.35.147-.085.038-.09.053-.07.147.014.075.034.148.047.223.013.072.05.109.123.124.233.05.462.115.657.265.058-.102.058-.102.168-.151.03-.014.06-.03.092-.042.08-.03.115-.017.15.06.023.048.041.098.066.158.06-.14-.042-.267.017-.416.157.18.24.39.375.567a.235.235 0 00.022-.098c.002-.124 0-.247.002-.371 0-.034.013-.067.02-.1l.032-.003c.11.155.13.354.226.52a3.036 3.036 0 00-.01-.392c-.004-.045 0-.074.05-.088.08.036.116.14.215.158-.03-.275-.423-1.137-.798-1.635-.114-.127-.2-.28-.34-.386zm-2.667.696c-.019.034-.03.05-.037.067-.061.185-.125.37-.18.556-.031.105-.087.169-.195.19-.09.019-.178.052-.268.073-.038.009-.089.015-.118-.003-.024-.016-.025-.069-.036-.106-.064.076-.082.087-.17.047-.133-.062-.262-.135-.393-.201-.048-.025-.093-.063-.17-.03-.043.12-.091.25-.137.382-.099.28-.087.242.095.453.046.048.102.03.154.023.054-.009.106-.03.16-.036.13-.013.26-.08.367-.015.204-.064.387-.122.571-.178.05-.015.089.005.114.054.022.042.034.093.082.121.038-.056-.013-.128.063-.178l.14.241-.042-1.46zm.278.358c-.096-.01-.107.01-.11.108-.002.038-.003.078.002.115.03.2.099.386.174.57.002.006.012.01.022.015l.078-.05c.052.036.081.088.153.088.205-.002.41.014.616.012.099-.001.158.042.205.12.018.03.024.077.088.066l-.08-.394c-.05-.195-.085-.395-.172-.589-.057.057-.114.068-.18.046a.72.72 0 00-.135-.028c-.22-.028-.44-.059-.66-.08zm10.254-1.727c.089.163.155.316.139.491-.016.168.026.342-.044.516-.047-.033-.088-.082-.112-.075-.117.035-.164-.057-.227-.115a4.772 4.772 0 01-.286-.29l-.104-.113a4.856 4.856 0 01-.023.019c.035.046.07.093.11.156.04.064.084.127.122.193.034.058.065.118.031.205-.082-.01-.164-.019-.246-.032-.06-.01-.101 0-.124.07-.031.098-.037.096-.15.09.02.042.036.08.057.116.041.074.03.138-.03.196-.06.06-.118.122-.178.181a.175.175 0 01-.185.046c-.222-.061-.447-.113-.67-.174-.032-.009-.063-.04-.086-.068-.03-.04-.052-.087-.08-.13-.044-.07-.09-.138-.136-.207a.18.18 0 00-.014.105c.012.127.03.253.035.38.005.1-.024.12-.121.104-.104-.017-.206-.04-.31-.058-.064-.012-.131-.028-.202.03l.081.208c.09 0 .166-.01.237.002a.819.819 0 01.458.251c.078.083.154.168.241.26l.018-.005c-.004-.006-.008-.013-.01-.04.014-.056-.062-.118.018-.178.031.03.064.057.088.09.058.078.111.159.169.257l.089.141.024-.013a2093.819 2093.819 0 01-.427-.934c.055.007.083.007.108.016.193.07.385.142.577.216.074.028.147.06.219.094.062.028.112.018.157-.033.05-.056.102-.112.154-.167.05-.051.095-.046.132.014.016.025.026.053.04.08.071.138.143.277.217.433l.159.308.025-.011c-.044-.106-.07-.218-.138-.334-.057-.182-.168-.346-.206-.545.136.034.362.326.567.732l.057.074.018-.011a1.563 1.563 0 01-.052-.127c-.046-.145-.097-.29-.136-.436-.022-.083-.036-.173.022-.26l.109.058-.026-.207.027-.016c.022.02.05.036.065.06.073.108.143.22.215.33.01.016.029.029.043.043-.036-.217-.2-.38-.229-.626l.155.112c.014-.166.012-.319.042-.465.032-.158-.023-.297-.063-.445.024.004.036.006.055.025.092.124.183.249.277.371.02.027.05.047.069.087l.04.063.019-.015a.293.293 0 01-.053-.082 27.922 27.922 0 01-.332-.49c-.221-.311-.363-.467-.485-.521zm-6.57.327c-.003.161.092.275.069.415l-.368.087c.09.139.032.237-.052.331-.05.057-.092.122-.143.178-.037.04-.046.078-.018.126l.16.275c.029.048.072.066.128.064.076-.003.152 0 .228-.001.116-.003.216.022.275.137.006.014.02.024.044.052.004-.059-.003-.098.01-.13.016-.04.04-.099.072-.108.084-.023.173-.024.26-.03.013-.001.027.018.04.029l.071.065c.019-.11-.082-.198-.024-.31l.126.04c-.026-.123-.07-.245-.071-.366 0-.123.051-.243.115-.36.107.062.16.156.234.253.183.265.36.533.494.834.165-.078.27.068.407.088-.003-.106-.133-.441-.197-.492a.142.142 0 00-.102-.028c-.06.011-.119.039-.191.063-.025-.039-.056-.078-.077-.122a3.936 3.936 0 00-.473-.783c-.076-.094-.16-.182-.228-.26l-.391.285c-.049.035-.094.03-.132-.017l-.169-.207c-.025-.03-.053-.059-.097-.108z`}),t[0]=n,t[1]=r,t[2]=i,t[3]=a):(n=t[0],r=t[1],i=t[2],a=t[3]);let o;return t[4]===e?o=t[5]:(o=(0,F.jsxs)(`svg`,{role:`img`,"aria-label":`Hermes icon`,xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,fill:`currentColor`,fillRule:`evenodd`,viewBox:`0 0 24 24`,...e,children:[n,r,i,a]}),t[4]=e,t[5]=o),o}function _e(e){let t=(0,I.c)(7),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsx)(`title`,{children:`OpenClaw icon`}),t[0]=n):n=t[0];let r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,F.jsxs)(`mask`,{id:`openclaw-eyes`,maskUnits:`userSpaceOnUse`,x:0,y:0,width:120,height:120,children:[(0,F.jsx)(`rect`,{width:120,height:120,fill:`white`}),(0,F.jsx)(`circle`,{cx:45,cy:35,r:6,fill:`black`}),(0,F.jsx)(`circle`,{cx:75,cy:35,r:6,fill:`black`})]}),t[1]=r):r=t[1];let i,a,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,F.jsxs)(`g`,{fill:`currentColor`,mask:`url(#openclaw-eyes)`,children:[(0,F.jsx)(`path`,{d:`M60 10 C30 10 15 35 15 55 C15 75 30 95 45 100 L45 110 L55 110 L55 100 C55 100 60 102 65 100 L65 110 L75 110 L75 100 C90 95 105 75 105 55 C105 35 90 10 60 10Z`}),(0,F.jsx)(`path`,{d:`M20 45 C5 40 0 50 5 60 C10 70 20 65 25 55 C28 48 25 45 20 45Z`}),(0,F.jsx)(`path`,{d:`M100 45 C115 40 120 50 115 60 C110 70 100 65 95 55 C92 48 95 45 100 45Z`})]}),a=(0,F.jsx)(`path`,{d:`M45 15 Q35 5 30 8`,fill:`none`,stroke:`currentColor`,strokeWidth:3,strokeLinecap:`round`}),o=(0,F.jsx)(`path`,{d:`M75 15 Q85 5 90 8`,fill:`none`,stroke:`currentColor`,strokeWidth:3,strokeLinecap:`round`}),t[2]=i,t[3]=a,t[4]=o):(i=t[2],a=t[3],o=t[4]);let s;return t[5]===e?s=t[6]:(s=(0,F.jsxs)(`svg`,{role:`img`,"aria-label":`OpenClaw icon`,xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,fill:`none`,viewBox:`0 0 120 120`,...e,children:[n,r,i,a,o]}),t[5]=e,t[6]=s),s}function ve(e){let t=(0,I.c)(5),n,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsx)(`title`,{children:`OpenCode icon`}),r=(0,F.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M384 416H128V96H384V416ZM320 160H192V352H320V160Z`}),i=(0,F.jsx)(`path`,{fill:`currentColor`,fillOpacity:.55,d:`M320 224V352H192V224H320Z`}),t[0]=n,t[1]=r,t[2]=i):(n=t[0],r=t[1],i=t[2]);let a;return t[3]===e?a=t[4]:(a=(0,F.jsxs)(`svg`,{role:`img`,"aria-label":`OpenCode icon`,xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,fill:`none`,viewBox:`0 0 512 512`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}function ye(e){let t=(0,I.c)(5),n,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsx)(`title`,{children:`Pi icon`}),r=(0,F.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M165.29 165.29H517.36V400H400V517.36H282.65V634.72H165.29ZM282.65 282.65V400H400V282.65Z`}),i=(0,F.jsx)(`path`,{fill:`currentColor`,d:`M517.36 400H634.72V634.72H517.36Z`}),t[0]=n,t[1]=r,t[2]=i):(n=t[0],r=t[1],i=t[2]);let a;return t[3]===e?a=t[4]:(a=(0,F.jsxs)(`svg`,{role:`img`,"aria-label":`Pi icon`,xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,fill:`none`,viewBox:`0 0 800 800`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}var be={"claude-cowork":`claude`,"claude-code":`claude`,codex:`openai`,cursor:`cursor`,copilot:`github`,opencode:`opencode`,pi:`pi`,antigravity:`antigravity`,openclaw:`openclaw`,hermes:`hermes`};function xe(e){let t=(0,I.c)(47),n,r,a,s;t[0]===e?(n=t[1],r=t[2],a=t[3],s=t[4]):({id:r,style:s,className:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=a,t[4]=s);let{resolvedTheme:c}=i(),u=be[r],m=u?(c===`dark`?l[u]:void 0)??ee[u]:void 0,h;t[5]!==m||t[6]!==s?(h=m?{...s,"--ok-brand-color":m}:s,t[5]=m,t[6]=s,t[7]=h):h=t[7];let g=h,_=m&&`[&_*]:![color:var(--ok-brand-color)]`,v;t[8]!==n||t[9]!==_?(v=o(_,n),t[8]=n,t[9]=_,t[10]=v):v=t[10];let y=v;if(r===`claude-cowork`||r===`claude-code`){let e;return t[11]!==y||t[12]!==g||t[13]!==a?(e=(0,F.jsx)(d,{style:g,className:y,...a}),t[11]=y,t[12]=g,t[13]=a,t[14]=e):e=t[14],e}if(r===`codex`){let e;return t[15]!==y||t[16]!==g||t[17]!==a?(e=(0,F.jsx)(f,{style:g,className:y,...a}),t[15]=y,t[16]=g,t[17]=a,t[18]=e):e=t[18],e}if(r===`cursor`){let e;return t[19]!==y||t[20]!==g||t[21]!==a?(e=(0,F.jsx)(p,{style:g,className:y,...a}),t[19]=y,t[20]=g,t[21]=a,t[22]=e):e=t[22],e}if(r===`copilot`){let e;return t[23]!==y||t[24]!==g||t[25]!==a?(e=(0,F.jsx)(te,{style:g,className:y,...a}),t[23]=y,t[24]=g,t[25]=a,t[26]=e):e=t[26],e}if(r===`opencode`){let e;return t[27]!==y||t[28]!==g||t[29]!==a?(e=(0,F.jsx)(ve,{style:g,className:y,...a}),t[27]=y,t[28]=g,t[29]=a,t[30]=e):e=t[30],e}if(r===`pi`){let e;return t[31]!==y||t[32]!==g||t[33]!==a?(e=(0,F.jsx)(ye,{style:g,className:y,...a}),t[31]=y,t[32]=g,t[33]=a,t[34]=e):e=t[34],e}if(r===`antigravity`){let e;return t[35]!==y||t[36]!==g||t[37]!==a?(e=(0,F.jsx)(he,{style:g,className:y,...a}),t[35]=y,t[36]=g,t[37]=a,t[38]=e):e=t[38],e}if(r===`openclaw`){let e;return t[39]!==y||t[40]!==g||t[41]!==a?(e=(0,F.jsx)(_e,{style:g,className:y,...a}),t[39]=y,t[40]=g,t[41]=a,t[42]=e):e=t[42],e}if(r===`hermes`){let e;return t[43]!==y||t[44]!==g||t[45]!==a?(e=(0,F.jsx)(ge,{style:g,className:y,...a}),t[43]=y,t[44]=g,t[45]=a,t[46]=e):e=t[46],e}return null}var Se=c;function Ce(e){return s[e].handoffTarget}export{ae as S,re as _,$ as a,N as b,W as c,U as d,de as f,ie as g,se as h,me as i,H as l,z as m,Ce as n,fe as o,R as p,xe as r,pe as s,Se as t,ue as u,P as v,oe as x,A as y};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./utils-CPqDy6Hr.js";import{a as r,m as i,s as a}from"./terminal-cli-display-CgJpdKCI.js";import{Kt as o}from"./dist-ILlrHFKs.js";import{t as s}from"./createLucideIcon-Bhw2PmPp.js";import{_ as c,f as l,l as u}from"./sortable.esm-Dd5A8_XI.js";var d=e(t(),1),f=new Map,p=null,m=new Set;function h(){return f.get(`agents`)??f.get(`terminal`)??null}function g(e,t){return e===null||t===null?e===t:e.id!==t.id||e.kind!==t.kind||e.label!==t.label?!1:e.kind===`thread`&&t.kind===`thread`?e.agentId===t.agentId&&e.iconUrl===t.iconUrl:e.kind===`terminal`&&t.kind===`terminal`?e.cli===t.cli:!1}function _(e,t){if(f.has(e)&&g(f.get(e)??null,t))return;f.set(e,t);let n=h();if(!g(p,n)){p=n;for(let e of m)e()}}function v(){return p}function y(e){return m.add(e),()=>{m.delete(e)}}function b(){return(0,d.useSyncExternalStore)(y,v,ee)}function ee(){return null}var te=s(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),ne=s(`square-terminal`,[[`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`}]]),x={},S=new Set;function C(){return x}function w(e){x={...x,...e};for(let e of S)e()}function T(e){return S.add(e),()=>{S.delete(e)}}function E(){return(0,d.useSyncExternalStore)(T,C,C)}var D=`ok-ask-ai-agent-v2`,O=`ok-ask-ai-default-agent-v1`,re=`ok-preferred-agent-v1`,ie=`terminal-cli`;function k(e){return`${ie}:${e}`}var A=`in-app-thread`;function j(e){return`${A}:${e.source}:${e.id}`}function M(e){if(e===null)return null;if(e===`in-app-thread`)return{kind:`default`};let t=`${A}:`;if(!e.startsWith(t))return null;let n=e.slice(t.length),r=n.indexOf(`:`);if(r<=0)return null;let i=n.slice(0,r),a=n.slice(r+1);return i!==`registry`&&i!==`custom`||a===``?null:{kind:`concrete`,source:i,id:a}}function N(e){return e===null?null:e===`terminal-cli`?`claude`:o.find(t=>e===k(t))??null}function P(e){if(e)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function F(e){let t=P(e);if(!t)return null;try{let e=t.getItem(D);return e===null?t.getItem(O)??t.getItem(re):e}catch{return null}}function I(e,t){let n=P(t);if(n)try{n.setItem(D,e)}catch(e){console.warn(`[ask-ai] Failed to persist default agent:`,e)}for(let e of L)e()}var L=new Set;function R(){return F()}function z(){for(let e of L)e()}typeof window<`u`&&typeof window.addEventListener==`function`&&window.addEventListener(`storage`,e=>{(e.key===`ok-ask-ai-agent-v2`||e.key===null)&&z()});function B(e){return L.add(e),()=>L.delete(e)}function V(){return(0,d.useSyncExternalStore)(B,R,R)}var H=`open-knowledge:active-terminal-input`;function U(e,t,n=typeof window>`u`?new EventTarget:window){n.dispatchEvent(new CustomEvent(H,{detail:{text:e,newTab:t?.newTab===!0,submit:t?.submit===!0,...t?.target===`agents`?{target:`agents`}:{}}}))}function W(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;n!==void 0&&typeof n.text==`string`&&e({text:n.text,newTab:n.newTab===!0,submit:n.submit===!0,...n.target===`agents`?{target:`agents`}:{}})};return t.addEventListener(H,n),()=>t.removeEventListener(H,n)}function G(e,t){return o.filter(n=>a(e,n,t))}function K(e){return i.filter(t=>r(e,t.id)).map(e=>e.id)}function q(e){let{sticky:t,effectiveThreadAgent:n,enabledClis:r,enabledDesktopTargets:i,installedClis:a,terminalAvailable:o,threadsAvailable:s,desktopSelectable:c,preferBareTerminal:l,bareTerminalFallback:u}=e;if(l&&o)return{kind:`terminal`};if(s&&M(t)!==null&&n!==null)return{kind:`thread`,agent:n};if(o){let e=N(t);if(e!==null&&r.includes(e))return{kind:`cli`,cli:e}}return c&&t!==null&&i.includes(t)?{kind:`desktop`,target:t}:s&&n!==null?{kind:`thread`,agent:n}:o&&r.length>0?{kind:`cli`,cli:r.find(e=>a[e]===!0)??r[0]}:c&&i.length>0?{kind:`desktop`,target:i[0]}:u&&o?{kind:`terminal`}:{kind:`none`}}var J=`flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm text-muted-foreground outline-none hover:bg-foreground/10 hover:text-foreground hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring/50`,ae=`border-border bg-background text-foreground hover:bg-background focus-visible:bg-background`,oe={start:[u.Space],cancel:[u.Esc],end:[u.Space,u.Enter]};function se(e){return n(J,e?`mr-1 opacity-100`:`pointer-events-none absolute right-1 opacity-0 group-hover:pointer-events-auto group-hover:opacity-100`)}function ce(e){return e?void 0:-1}function le({className:e,isDragging:t}){return n(e,t&&ae)}function ue(e){return e.code===u.Enter&&e.target===e.currentTarget}function de(e){return e.key===`ContextMenu`||e.shiftKey&&e.key===`F10`}function fe(e,t,n){for(let r of e.querySelectorAll(`[data-editor-tab-id]`))if(r.dataset.editorPaneId===t&&r.dataset.editorTabId===n)return r;return null}function pe({event:e,hasKeyboardActivation:t,isDragging:n}){return e.defaultPrevented?`ignore`:!n&&t&&ue(e)?`activate-tab`:`delegate-sortable`}function me({activeWidth:e,disableMovement:t=!1,isDragging:n,outerStyle:r,transform:i,transition:a}){let o=n&&e?e:void 0;return{...r,transform:t?void 0:c.Transform.toString(i?{...i,scaleX:1,scaleY:1}:null),transition:t?void 0:a,flexBasis:o??r?.flexBasis,maxWidth:o??r?.maxWidth,minWidth:o??r?.minWidth,opacity:r?.opacity,width:o??r?.width,zIndex:n?20:r?.zIndex}}function he(e,t){let n=e?.querySelectorAll(t)??[],r=1/0,i=-1/0;for(let e of n){let t=e.getBoundingClientRect();r=Math.min(r,t.left),i=Math.max(i,t.right)}return Number.isFinite(r)&&Number.isFinite(i)?{left:r,right:i}:null}function ge(e){return({activeNodeRect:t,transform:n})=>{let r={...n,y:0};if(!e||!t)return r;let i=e.left-t.left,a=e.right-t.right;return r.x=Math.min(Math.max(r.x,i),a),r}}function Y(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.kind===`editor-tab`&&typeof t.paneId==`string`&&typeof t.tabId==`string`&&typeof t.splittable==`boolean`&&typeof t.label==`string`}function _e(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.kind===`pane-edge`?typeof t.paneId==`string`&&(t.side===`left`||t.side===`right`):t.kind===`pane-strip`&&typeof t.paneId==`string`&&typeof t.index==`number`&&Number.isInteger(t.index)}function X(e,t){return e.x>=t.left&&e.x<=t.right&&e.y>=t.top&&e.y<=t.bottom}function Z(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}var ve=e=>{let t=e.droppableContainers.filter(e=>e.data.current?.kind===`pane-edge`),n=e.droppableContainers.filter(e=>e.data.current?.kind!==`pane-edge`),r=e.active.data.current,i=e.pointerCoordinates;if(i&&Y(r)&&r.splittable){let n=t.find(t=>{let n=e.droppableRects.get(t.id);return n?X(i,n):!1});if(n)return[{id:n.id,data:{droppableContainer:n,value:0}}]}if(i){let t=n.filter(t=>{let n=e.droppableRects.get(t.id);return n?X(i,n):!1});if(t.length>0){let n=t.filter(e=>Y(e.data.current));return l({...e,droppableContainers:n.length>0?n:t})}let r=n.filter(t=>{let n=t.data.current,r=e.droppableRects.get(t.id);return n?.kind!==`pane-strip`||!r?!1:Z(e.collisionRect,r)});if(r.length===0)return[];let a=new Set(r.map(e=>e.data.current?.paneId)),o=n.filter(t=>{let n=t.data.current,r=e.droppableRects.get(t.id);return!Y(n)||!a.has(n.paneId)||!r?!1:Z(e.collisionRect,r)});return l({...e,droppableContainers:o.length>0?o:r})}return l({...e,droppableContainers:n})},ye=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(r){let e=1/0,i=-1/0,a=null,o=null;for(let r of t){let t=n.get(r.id);t&&(t.left<e&&(e=t.left,a=r),t.right>i&&(i=t.right,o=r))}if(!Number.isFinite(e)||!Number.isFinite(i))return[];let s=r.x<e?a:r.x>i?o:null;if(s)return[{id:s.id,data:{droppableContainer:s,value:0}}]}return l(e)};function be(e){Math.abs(e.deltaX)>=Math.abs(e.deltaY)||e.currentTarget.scrollWidth<=e.currentTarget.clientWidth||(e.preventDefault(),e.currentTarget.scrollLeft+=e.deltaY)}var Q=`open-knowledge:new-preferred-session`;function xe(e=typeof window>`u`?new EventTarget:window){e.dispatchEvent(new CustomEvent(Q))}function Se(e,t=typeof window>`u`?new EventTarget:window){let n=()=>e();return t.addEventListener(Q,n),()=>t.removeEventListener(Q,n)}var $=`open-knowledge:terminal-launch`;function Ce(e,t,n,r=typeof window>`u`?new EventTarget:window){r.dispatchEvent(new CustomEvent($,{detail:{prompt:e,cli:t,stage:n?.stage===!0}}))}function we(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;n&&typeof n.prompt==`string`&&e(n.prompt,n.cli,{stage:n.stage===!0})};return t.addEventListener($,n),()=>t.removeEventListener($,n)}export{j as A,U as C,N as D,F as E,te as F,_ as I,b as L,w as M,E as N,I as O,ne as P,q as S,A as T,he as _,be as a,K as b,ve as c,pe as d,me as f,_e as g,Y as h,Se as i,V as j,k,fe as l,ce as m,we as n,oe as o,se as p,xe as r,ge as s,Ce as t,le as u,de as v,W as w,G as x,ye as y};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./utils-CPqDy6Hr.js";import{a as r,m as i,s as a}from"./terminal-cli-display-CW7j5kqb.js";import{Kt as o}from"./dist-GenOktAv.js";import{t as s}from"./createLucideIcon-Bhw2PmPp.js";import{_ as c,f as l,l as u}from"./sortable.esm-Dd5A8_XI.js";var d=e(t(),1),f=new Map,p=null,m=new Set;function h(){return f.get(`agents`)??f.get(`terminal`)??null}function g(e,t){return e===null||t===null?e===t:e.id!==t.id||e.kind!==t.kind||e.label!==t.label?!1:e.kind===`thread`&&t.kind===`thread`?e.agentId===t.agentId&&e.iconUrl===t.iconUrl:e.kind===`terminal`&&t.kind===`terminal`?e.cli===t.cli:!1}function _(e,t){if(f.has(e)&&g(f.get(e)??null,t))return;f.set(e,t);let n=h();if(!g(p,n)){p=n;for(let e of m)e()}}function v(){return p}function y(e){return m.add(e),()=>{m.delete(e)}}function b(){return(0,d.useSyncExternalStore)(y,v,ee)}function ee(){return null}var te=s(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),ne=s(`square-terminal`,[[`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`}]]),x={},S=new Set;function C(){return x}function w(e){x={...x,...e};for(let e of S)e()}function T(e){return S.add(e),()=>{S.delete(e)}}function E(){return(0,d.useSyncExternalStore)(T,C,C)}var D=`ok-ask-ai-agent-v2`,O=`ok-ask-ai-default-agent-v1`,re=`ok-preferred-agent-v1`,ie=`terminal-cli`;function k(e){return`${ie}:${e}`}var A=`in-app-thread`;function j(e){return`${A}:${e.source}:${e.id}`}function M(e){if(e===null)return null;if(e===`in-app-thread`)return{kind:`default`};let t=`${A}:`;if(!e.startsWith(t))return null;let n=e.slice(t.length),r=n.indexOf(`:`);if(r<=0)return null;let i=n.slice(0,r),a=n.slice(r+1);return i!==`registry`&&i!==`custom`||a===``?null:{kind:`concrete`,source:i,id:a}}function N(e){return e===null?null:e===`terminal-cli`?`claude`:o.find(t=>e===k(t))??null}function P(e){if(e)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function F(e){let t=P(e);if(!t)return null;try{let e=t.getItem(D);return e===null?t.getItem(O)??t.getItem(re):e}catch{return null}}function I(e,t){let n=P(t);if(n)try{n.setItem(D,e)}catch(e){console.warn(`[ask-ai] Failed to persist default agent:`,e)}for(let e of L)e()}var L=new Set;function R(){return F()}function z(){for(let e of L)e()}typeof window<`u`&&typeof window.addEventListener==`function`&&window.addEventListener(`storage`,e=>{(e.key===`ok-ask-ai-agent-v2`||e.key===null)&&z()});function B(e){return L.add(e),()=>L.delete(e)}function V(){return(0,d.useSyncExternalStore)(B,R,R)}var H=`open-knowledge:active-terminal-input`;function U(e,t,n=typeof window>`u`?new EventTarget:window){n.dispatchEvent(new CustomEvent(H,{detail:{text:e,newTab:t?.newTab===!0,submit:t?.submit===!0,...t?.target===`agents`?{target:`agents`}:{}}}))}function W(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;n!==void 0&&typeof n.text==`string`&&e({text:n.text,newTab:n.newTab===!0,submit:n.submit===!0,...n.target===`agents`?{target:`agents`}:{}})};return t.addEventListener(H,n),()=>t.removeEventListener(H,n)}function G(e,t){return o.filter(n=>a(e,n,t))}function K(e){return i.filter(t=>r(e,t.id)).map(e=>e.id)}function q(e){let{sticky:t,effectiveThreadAgent:n,enabledClis:r,enabledDesktopTargets:i,installedClis:a,terminalAvailable:o,threadsAvailable:s,desktopSelectable:c,preferBareTerminal:l,bareTerminalFallback:u}=e;if(l&&o)return{kind:`terminal`};if(s&&M(t)!==null&&n!==null)return{kind:`thread`,agent:n};if(o){let e=N(t);if(e!==null&&r.includes(e))return{kind:`cli`,cli:e}}return c&&t!==null&&i.includes(t)?{kind:`desktop`,target:t}:s&&n!==null?{kind:`thread`,agent:n}:o&&r.length>0?{kind:`cli`,cli:r.find(e=>a[e]===!0)??r[0]}:c&&i.length>0?{kind:`desktop`,target:i[0]}:u&&o?{kind:`terminal`}:{kind:`none`}}var J=`flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm text-muted-foreground outline-none hover:bg-foreground/10 hover:text-foreground hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring/50`,ae=`border-border bg-background text-foreground hover:bg-background focus-visible:bg-background`,oe={start:[u.Space],cancel:[u.Esc],end:[u.Space,u.Enter]};function se(e){return n(J,e?`mr-1 opacity-100`:`pointer-events-none absolute right-1 opacity-0 group-hover:pointer-events-auto group-hover:opacity-100`)}function ce(e){return e?void 0:-1}function le({className:e,isDragging:t}){return n(e,t&&ae)}function ue(e){return e.code===u.Enter&&e.target===e.currentTarget}function de(e){return e.key===`ContextMenu`||e.shiftKey&&e.key===`F10`}function fe(e,t,n){for(let r of e.querySelectorAll(`[data-editor-tab-id]`))if(r.dataset.editorPaneId===t&&r.dataset.editorTabId===n)return r;return null}function pe({event:e,hasKeyboardActivation:t,isDragging:n}){return e.defaultPrevented?`ignore`:!n&&t&&ue(e)?`activate-tab`:`delegate-sortable`}function me({activeWidth:e,disableMovement:t=!1,isDragging:n,outerStyle:r,transform:i,transition:a}){let o=n&&e?e:void 0;return{...r,transform:t?void 0:c.Transform.toString(i?{...i,scaleX:1,scaleY:1}:null),transition:t?void 0:a,flexBasis:o??r?.flexBasis,maxWidth:o??r?.maxWidth,minWidth:o??r?.minWidth,opacity:r?.opacity,width:o??r?.width,zIndex:n?20:r?.zIndex}}function he(e,t){let n=e?.querySelectorAll(t)??[],r=1/0,i=-1/0;for(let e of n){let t=e.getBoundingClientRect();r=Math.min(r,t.left),i=Math.max(i,t.right)}return Number.isFinite(r)&&Number.isFinite(i)?{left:r,right:i}:null}function ge(e){return({activeNodeRect:t,transform:n})=>{let r={...n,y:0};if(!e||!t)return r;let i=e.left-t.left,a=e.right-t.right;return r.x=Math.min(Math.max(r.x,i),a),r}}function Y(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.kind===`editor-tab`&&typeof t.paneId==`string`&&typeof t.tabId==`string`&&typeof t.splittable==`boolean`&&typeof t.label==`string`}function _e(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.kind===`pane-edge`?typeof t.paneId==`string`&&(t.side===`left`||t.side===`right`):t.kind===`pane-strip`&&typeof t.paneId==`string`&&typeof t.index==`number`&&Number.isInteger(t.index)}function X(e,t){return e.x>=t.left&&e.x<=t.right&&e.y>=t.top&&e.y<=t.bottom}function Z(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}var ve=e=>{let t=e.droppableContainers.filter(e=>e.data.current?.kind===`pane-edge`),n=e.droppableContainers.filter(e=>e.data.current?.kind!==`pane-edge`),r=e.active.data.current,i=e.pointerCoordinates;if(i&&Y(r)&&r.splittable){let n=t.find(t=>{let n=e.droppableRects.get(t.id);return n?X(i,n):!1});if(n)return[{id:n.id,data:{droppableContainer:n,value:0}}]}if(i){let t=n.filter(t=>{let n=e.droppableRects.get(t.id);return n?X(i,n):!1});if(t.length>0){let n=t.filter(e=>Y(e.data.current));return l({...e,droppableContainers:n.length>0?n:t})}let r=n.filter(t=>{let n=t.data.current,r=e.droppableRects.get(t.id);return n?.kind!==`pane-strip`||!r?!1:Z(e.collisionRect,r)});if(r.length===0)return[];let a=new Set(r.map(e=>e.data.current?.paneId)),o=n.filter(t=>{let n=t.data.current,r=e.droppableRects.get(t.id);return!Y(n)||!a.has(n.paneId)||!r?!1:Z(e.collisionRect,r)});return l({...e,droppableContainers:o.length>0?o:r})}return l({...e,droppableContainers:n})},ye=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(r){let e=1/0,i=-1/0,a=null,o=null;for(let r of t){let t=n.get(r.id);t&&(t.left<e&&(e=t.left,a=r),t.right>i&&(i=t.right,o=r))}if(!Number.isFinite(e)||!Number.isFinite(i))return[];let s=r.x<e?a:r.x>i?o:null;if(s)return[{id:s.id,data:{droppableContainer:s,value:0}}]}return l(e)};function be(e){Math.abs(e.deltaX)>=Math.abs(e.deltaY)||e.currentTarget.scrollWidth<=e.currentTarget.clientWidth||(e.preventDefault(),e.currentTarget.scrollLeft+=e.deltaY)}var Q=`open-knowledge:new-preferred-session`;function xe(e=typeof window>`u`?new EventTarget:window){e.dispatchEvent(new CustomEvent(Q))}function Se(e,t=typeof window>`u`?new EventTarget:window){let n=()=>e();return t.addEventListener(Q,n),()=>t.removeEventListener(Q,n)}var $=`open-knowledge:terminal-launch`;function Ce(e,t,n,r=typeof window>`u`?new EventTarget:window){r.dispatchEvent(new CustomEvent($,{detail:{prompt:e,cli:t,stage:n?.stage===!0}}))}function we(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;n&&typeof n.prompt==`string`&&e(n.prompt,n.cli,{stage:n.stage===!0})};return t.addEventListener($,n),()=>t.removeEventListener($,n)}export{j as A,U as C,N as D,F as E,te as F,_ as I,b as L,w as M,E as N,I as O,ne as P,q as S,A as T,he as _,be as a,K as b,ve as c,pe as d,me as f,_e as g,Y as h,Se as i,V as j,k,fe as l,ce as m,we as n,oe as o,se as p,xe as r,ge as s,Ce as t,le as u,de as v,W as w,G as x,ye as y};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./useQuery-ZeEDLtxh.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{g as i}from"./terminal-cli-display-CgJpdKCI.js";import{t as a}from"./trace-api-18gcBe0u.js";var o=r(),s=e(t(),1);function c(e){let t=[`claude-acp`,`codex-acp`,`cursor`,`opencode`],n=e=>{let n=t.indexOf(e);return n===-1?t.length:n};return e.filter(e=>e.supported&&e.harness?.availability===`present`).sort((e,t)=>n(e.id)-n(t.id))}async function l(e){let t=await fetch(`/api/acp/catalog`,{signal:e??AbortSignal.timeout(2e4)});if(!t.ok)throw Error(`agent catalog request failed: HTTP ${t.status}`);let n=await t.json();return{agents:Array.isArray(n.agents)?n.agents:[],stale:n.stale===!0,maxThreads:typeof n.maxThreads==`number`?n.maxThreads:8}}function u(){let e=(0,o.c)(4),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={queryKey:[`acp-catalog`],queryFn:f,staleTime:3e5},e[0]=t):t=e[0];let{data:r}=n(t),a=r?.agents,c,l;e[1]===a?(c=e[2],l=e[3]):(c=()=>{a&&i(a.map(d))},l=[a],e[1]=a,e[2]=c,e[3]=l),(0,s.useEffect)(c,l)}function d(e){return{source:e.source,id:e.id,name:e.name,supported:e.supported,featured:e.featured,...e.iconUrl===void 0?{}:{iconUrl:e.iconUrl}}}function f(e){let{signal:t}=e;return l(t)}var p=`open-knowledge-app`;function m(e){try{a.getTracer(p).startSpan(e).end()}catch(e){console.warn(`[terminal-telemetry] span emit failed:`,e instanceof Error?e:String(e))}}function h(){m(`ok.desktop.terminalOpened`)}function g(){m(`ok.desktop.shellConsentGranted`)}export{u as a,l as i,h as n,c as r,g as t};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./useQuery-ZeEDLtxh.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{g as i}from"./terminal-cli-display-CW7j5kqb.js";import{t as a}from"./trace-api-18gcBe0u.js";var o=r(),s=e(t(),1);function c(e){let t=[`claude-acp`,`codex-acp`,`cursor`,`opencode`],n=e=>{let n=t.indexOf(e);return n===-1?t.length:n};return e.filter(e=>e.supported&&e.harness?.availability===`present`).sort((e,t)=>n(e.id)-n(t.id))}async function l(e){let t=await fetch(`/api/acp/catalog`,{signal:e??AbortSignal.timeout(2e4)});if(!t.ok)throw Error(`agent catalog request failed: HTTP ${t.status}`);let n=await t.json();return{agents:Array.isArray(n.agents)?n.agents:[],stale:n.stale===!0,maxThreads:typeof n.maxThreads==`number`?n.maxThreads:8}}function u(){let e=(0,o.c)(4),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={queryKey:[`acp-catalog`],queryFn:f,staleTime:3e5},e[0]=t):t=e[0];let{data:r}=n(t),a=r?.agents,c,l;e[1]===a?(c=e[2],l=e[3]):(c=()=>{a&&i(a.map(d))},l=[a],e[1]=a,e[2]=c,e[3]=l),(0,s.useEffect)(c,l)}function d(e){return{source:e.source,id:e.id,name:e.name,supported:e.supported,featured:e.featured,...e.iconUrl===void 0?{}:{iconUrl:e.iconUrl}}}function f(e){let{signal:t}=e;return l(t)}var p=`open-knowledge-app`;function m(e){try{a.getTracer(p).startSpan(e).end()}catch(e){console.warn(`[terminal-telemetry] span emit failed:`,e instanceof Error?e:String(e))}}function h(){m(`ok.desktop.terminalOpened`)}function g(){m(`ok.desktop.shellConsentGranted`)}export{u as a,l as i,h as n,c as r,g as t};