@odigos/ui-kit 0.0.263 → 0.0.264

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 (634) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/docs/api-context.md +1 -1
  3. package/lib/chunks/index-B-zICLj7.js +155 -0
  4. package/lib/chunks/odigos-context-_YAZF63s.js +9 -0
  5. package/lib/chunks/source-instrument-form-context-CZQIaTUV.js +5 -0
  6. package/lib/chunks/ui-components-CAPnizLR.js +1543 -0
  7. package/lib/components/{_v2/cards → _cards}/data-card/index.d.ts +3 -3
  8. package/lib/components/{_v2/cards → _cards}/section-card/index.d.ts +2 -2
  9. package/lib/components/{_v2/cards → _cards}/status-card/index.d.ts +1 -1
  10. package/lib/components/{_v2/autocomplete → autocomplete}/index.d.ts +1 -1
  11. package/lib/components/{_v2/badge → badge}/index.d.ts +1 -1
  12. package/lib/components/{_v2/button → button}/index.d.ts +1 -1
  13. package/lib/components/{_v2/button-tab → button-tab}/index.d.ts +1 -1
  14. package/lib/components/{_v2/checkbox → checkbox}/index.d.ts +1 -1
  15. package/lib/components/code/index.d.ts +3 -4
  16. package/lib/components/code/toggle-code-component/index.d.ts +2 -3
  17. package/lib/components/{_v2/condition → condition}/index.d.ts +1 -1
  18. package/lib/components/{_v2/conditions → conditions}/index.d.ts +1 -1
  19. package/lib/components/divider/index.d.ts +4 -5
  20. package/lib/components/{_v2/drawer → drawer}/header/index.d.ts +1 -1
  21. package/lib/components/{_v2/drop-data → drop-data}/index.d.ts +1 -1
  22. package/lib/components/error-boundary/index.d.ts +2 -3
  23. package/lib/components/icon-button/index.d.ts +15 -11
  24. package/lib/components/icon-group/index.d.ts +6 -7
  25. package/lib/components/index.d.ts +38 -8
  26. package/lib/components/{_v2/input → input}/index.d.ts +1 -1
  27. package/lib/components/{_v2/input-table → input-table}/types.d.ts +1 -1
  28. package/lib/components/{_v2/island → island}/index.d.ts +2 -2
  29. package/lib/components/{_v2/loader → loader}/index.d.ts +1 -1
  30. package/lib/components/{_v2/navbar → navbar}/index.d.ts +1 -1
  31. package/lib/components/{_v2/no-data → no-data}/index.d.ts +1 -1
  32. package/lib/components/{_v2/note → note}/index.d.ts +1 -1
  33. package/lib/components/{_v2/radio → radio}/index.d.ts +1 -1
  34. package/lib/components/scroll-y/index.d.ts +2 -3
  35. package/lib/components/{_v2/segment → segment}/index.d.ts +1 -1
  36. package/lib/components/skeleton-loader/index.d.ts +2 -3
  37. package/lib/components/{_v2/table → table}/table-columns/index.d.ts +1 -1
  38. package/lib/components/{_v2/table → table}/table-columns/sort/index.d.ts +1 -1
  39. package/lib/components/{_v2/tag → tag}/index.d.ts +1 -1
  40. package/lib/components/{_v2/toggle → toggle}/index.d.ts +1 -1
  41. package/lib/components/tooltip/index.d.ts +9 -5
  42. package/lib/components.js +1 -1
  43. package/lib/constants/actions/index.d.ts +1 -1
  44. package/lib/constants/instrumentation-rules/index.d.ts +1 -1
  45. package/lib/constants/regex.d.ts +1 -1
  46. package/lib/constants/sampling/index.d.ts +1 -1
  47. package/lib/constants/signals/index.d.ts +1 -1
  48. package/lib/constants/sources/index.d.ts +2 -2
  49. package/lib/constants.js +1 -1
  50. package/lib/containers/{_v2/_drawers → _drawers}/add-action-drawer/index.d.ts +1 -1
  51. package/lib/containers/{_v2/_drawers → _drawers}/add-destination-drawer/form-column/index.d.ts +1 -1
  52. package/lib/containers/{_v2/_drawers → _drawers}/add-destination-drawer/helpers.d.ts +2 -2
  53. package/lib/containers/{_v2/_drawers → _drawers}/add-destination-drawer/index.d.ts +2 -2
  54. package/lib/containers/{_v2/_drawers → _drawers}/add-destination-drawer/lists-column/index.d.ts +3 -3
  55. package/lib/containers/{_v2/_drawers → _drawers}/add-destination-drawer/lists-filters/index.d.ts +2 -2
  56. package/lib/containers/{_v2/_drawers → _drawers}/add-destination-drawer/types.d.ts +2 -2
  57. package/lib/containers/{_v2/_drawers → _drawers}/add-rule-drawer/index.d.ts +1 -1
  58. package/lib/containers/{_v2/_drawers → _drawers}/add-source-drawer/index.d.ts +2 -2
  59. package/lib/containers/{_v2/_drawers → _drawers}/add-source-drawer/namespaces-column/index.d.ts +1 -1
  60. package/lib/containers/{_v2/_drawers → _drawers}/add-source-drawer/strings.d.ts +2 -1
  61. package/lib/containers/{_v2/_drawers → _drawers}/add-source-drawer/types.d.ts +1 -1
  62. package/lib/containers/{_v2/_drawers → _drawers}/add-source-drawer/utils.d.ts +1 -1
  63. package/lib/containers/{_v2/_drawers → _drawers}/add-source-drawer/workloads-column/index.d.ts +1 -1
  64. package/lib/containers/{_v2/_drawers → _drawers}/edit-action-drawer/helpers.d.ts +2 -2
  65. package/lib/containers/{_v2/_drawers → _drawers}/edit-config-drawer/index.d.ts +2 -2
  66. package/lib/containers/{_v2/_drawers → _drawers}/edit-destination-drawer/helpers.d.ts +2 -2
  67. package/lib/containers/{_v2/_drawers → _drawers}/edit-rule-drawer/helpers.d.ts +2 -2
  68. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/common/pods-header.d.ts +1 -1
  69. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/debug/index.d.ts +1 -1
  70. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/helpers.d.ts +2 -2
  71. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/index.d.ts +1 -1
  72. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/jump-to-target-context.d.ts +1 -1
  73. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/overview/containers-card/distro-override.d.ts +1 -1
  74. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/overview/containers-card/index.d.ts +1 -1
  75. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/overview/containers-card/runtime-override.d.ts +1 -1
  76. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/overview/health-card.d.ts +1 -1
  77. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/overview/index.d.ts +1 -1
  78. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/overview/main-card.d.ts +1 -1
  79. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/overview/pods-card/index.d.ts +1 -1
  80. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/overview/pods-card/pods-list/container-row.d.ts +1 -1
  81. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/overview/pods-card/pods-list/helpers.d.ts +1 -1
  82. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/overview/pods-card/pods-list/index.d.ts +1 -1
  83. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/overview/pods-card/pods-list/pod-row.d.ts +1 -1
  84. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/overview/pods-card/pods-list/process-row.d.ts +1 -1
  85. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/overview/pods-card/pods-list/row-header.d.ts +2 -2
  86. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/overview/pods-card/pods-list/types.d.ts +1 -1
  87. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/overview/statuses-card.d.ts +1 -1
  88. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/peers/index.d.ts +1 -1
  89. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/pods/containers-card/index.d.ts +1 -1
  90. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/pods/containers-card/process-card.d.ts +1 -1
  91. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/pods/index.d.ts +1 -1
  92. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/pods/pod-card.d.ts +1 -1
  93. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/profiling/index.d.ts +1 -1
  94. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/profiling/symbol-table/index.d.ts +2 -2
  95. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/profiling/symbol-table/symbol-instrumentation.d.ts +1 -1
  96. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/profiling/symbol-table/use-symbol-instrumentation.d.ts +1 -1
  97. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/sampling/index.d.ts +1 -1
  98. package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/sampling/rule-row.d.ts +2 -1
  99. package/lib/containers/{_v2/_drawers → _drawers}/sampling-rule-drawer/index.d.ts +2 -2
  100. package/lib/containers/{_v2/_drawers → _drawers}/sampling-rule-drawer/view-footer.d.ts +1 -1
  101. package/lib/containers/{_v2/_drawers → _drawers}/system-drawer/index.d.ts +2 -2
  102. package/lib/containers/{_v2/_drawers → _drawers}/system-drawer/tokens/index.d.ts +1 -1
  103. package/lib/containers/{_v2/_drawers → _drawers}/system-drawer/tokens/token-value.d.ts +1 -1
  104. package/lib/containers/{_v2/_forms → _forms}/add-action-form/custom-fields/add-cluster-info/index.d.ts +1 -1
  105. package/lib/containers/{_v2/_forms → _forms}/add-action-form/custom-fields/delete-attributes/index.d.ts +1 -1
  106. package/lib/containers/{_v2/_forms → _forms}/add-action-form/custom-fields/extract-attribute/index.d.ts +1 -1
  107. package/lib/containers/{_v2/_forms → _forms}/add-action-form/custom-fields/index.d.ts +1 -1
  108. package/lib/containers/{_v2/_forms → _forms}/add-action-form/custom-fields/k8s-attributes/index.d.ts +1 -1
  109. package/lib/containers/{_v2/_forms → _forms}/add-action-form/custom-fields/pii-masking/index.d.ts +1 -1
  110. package/lib/containers/{_v2/_forms → _forms}/add-action-form/custom-fields/rename-attributes/index.d.ts +1 -1
  111. package/lib/containers/{_v2/_forms → _forms}/add-action-form/custom-fields/url-templatization/index.d.ts +1 -1
  112. package/lib/containers/{_v2/_forms → _forms}/add-action-form/dynamic-fields/index.d.ts +1 -1
  113. package/lib/containers/{_v2/_forms → _forms}/add-destination-form/dynamic-fields/index.d.ts +2 -2
  114. package/lib/containers/{_v2/_forms → _forms}/add-destination-form/index.d.ts +1 -1
  115. package/lib/containers/{_v2/_forms → _forms}/add-rule-form/custom-fields/code-attributes/index.d.ts +1 -1
  116. package/lib/containers/{_v2/_forms → _forms}/add-rule-form/custom-fields/custom-instrumentation/index.d.ts +1 -1
  117. package/lib/containers/{_v2/_forms → _forms}/add-rule-form/custom-fields/headers-collection/index.d.ts +1 -1
  118. package/lib/containers/{_v2/_forms → _forms}/add-rule-form/custom-fields/index.d.ts +1 -1
  119. package/lib/containers/{_v2/_forms → _forms}/add-rule-form/custom-fields/payload-collection/index.d.ts +1 -1
  120. package/lib/containers/{_v2/_modals → _modals}/onboarding-done/index.d.ts +0 -1
  121. package/lib/containers/{_v2/_modals → _modals}/sampling-onboarding-modal/preset-row.d.ts +1 -1
  122. package/lib/containers/{_v2/_modals → _modals}/sampling-onboarding-modal/types.d.ts +1 -1
  123. package/lib/containers/{_v2/central-connections → central-connections}/helpers.d.ts +5 -5
  124. package/lib/containers/{_v2/central-connections → central-connections}/index.d.ts +3 -3
  125. package/lib/containers/index.d.ts +9 -0
  126. package/lib/containers/{_v2/onboarding → onboarding}/summary/index.d.ts +2 -2
  127. package/lib/containers/{_v2/overview → overview}/columns/column/empty-add.d.ts +1 -1
  128. package/lib/containers/{_v2/overview → overview}/columns/column/head.d.ts +1 -1
  129. package/lib/containers/{_v2/overview → overview}/columns/column/index.d.ts +1 -1
  130. package/lib/containers/{_v2/overview → overview}/columns/column/list-item.d.ts +1 -1
  131. package/lib/containers/{_v2/overview → overview}/columns/column/source-visual-state.d.ts +1 -1
  132. package/lib/containers/{_v2/overview → overview}/search/builder.d.ts +2 -2
  133. package/lib/containers/{_v2/pipeline-collectors → pipeline-collectors}/general-info/helpers/get-general-badge.d.ts +3 -3
  134. package/lib/containers/{_v2/pipeline-collectors → pipeline-collectors}/general-info/helpers/get-general-gauge-cards.d.ts +2 -2
  135. package/lib/containers/{_v2/pipeline-collectors → pipeline-collectors}/general-info/helpers/get-general-status-card.d.ts +2 -2
  136. package/lib/containers/{_v2/pipeline-collectors → pipeline-collectors}/general-info/helpers/get-general-text-cards.d.ts +2 -2
  137. package/lib/containers/{_v2/pipeline-collectors → pipeline-collectors}/general-info/index.d.ts +1 -1
  138. package/lib/containers/{_v2/pipeline-collectors → pipeline-collectors}/general-info/yaml-drawer/index.d.ts +2 -2
  139. package/lib/containers/{_v2/pipeline-collectors → pipeline-collectors}/index.d.ts +2 -1
  140. package/lib/containers/{_v2/pipeline-collectors → pipeline-collectors}/pods-info/index.d.ts +1 -1
  141. package/lib/containers/{_v2/pipeline-collectors → pipeline-collectors}/pods-info/pod-drawer/index.d.ts +2 -2
  142. package/lib/containers/{_v2/sampling-rules → sampling-rules}/auto-rule-card/index.d.ts +1 -1
  143. package/lib/containers/{_v2/sampling-rules → sampling-rules}/converters.d.ts +1 -1
  144. package/lib/containers/{_v2/sampling-rules → sampling-rules}/helpers.d.ts +3 -3
  145. package/lib/containers/{_v2/sampling-rules → sampling-rules}/rules-table/index.d.ts +1 -1
  146. package/lib/containers/{_v2/sampling-rules → sampling-rules}/toolbar/index.d.ts +1 -1
  147. package/lib/containers/{_v2/sampling-rules → sampling-rules}/types.d.ts +1 -1
  148. package/lib/containers/service-map/helpers/aggregate-service-map.d.ts +1 -1
  149. package/lib/containers/service-map/helpers/build-edges.d.ts +1 -1
  150. package/lib/containers/service-map/helpers/build-map-nodes.d.ts +1 -1
  151. package/lib/containers/service-map/helpers/types.d.ts +2 -2
  152. package/lib/containers/service-map/service-map-context.d.ts +1 -1
  153. package/lib/containers/{_v2/settings → settings}/index.d.ts +2 -1
  154. package/lib/containers.js +1011 -16
  155. package/lib/contexts/action-form-context.d.ts +2 -2
  156. package/lib/contexts/data-stream-form-context.d.ts +2 -2
  157. package/lib/contexts/destination-form-context.d.ts +3 -3
  158. package/lib/contexts/odigos-api/client.d.ts +1 -1
  159. package/lib/contexts/odigos-api/hooks/use-actions-api.d.ts +1 -1
  160. package/lib/contexts/odigos-api/hooks/use-collectors-api.d.ts +1 -1
  161. package/lib/contexts/odigos-api/hooks/use-config-api.d.ts +1 -1
  162. package/lib/contexts/odigos-api/hooks/use-data-streams-api.d.ts +1 -1
  163. package/lib/contexts/odigos-api/hooks/use-describe-api.d.ts +1 -1
  164. package/lib/contexts/odigos-api/hooks/use-destinations-api.d.ts +1 -1
  165. package/lib/contexts/odigos-api/hooks/use-instrumentation-rules-api.d.ts +1 -1
  166. package/lib/contexts/odigos-api/hooks/use-namespace-api.d.ts +1 -1
  167. package/lib/contexts/odigos-api/hooks/use-profiling-api.d.ts +1 -1
  168. package/lib/contexts/odigos-api/hooks/use-sampling-api.d.ts +1 -1
  169. package/lib/contexts/odigos-api/hooks/use-service-map-api.d.ts +1 -1
  170. package/lib/contexts/odigos-api/hooks/use-snapshots-api.d.ts +1 -1
  171. package/lib/contexts/odigos-api/hooks/use-sources-api.d.ts +2 -2
  172. package/lib/contexts/odigos-api/hooks/use-tokens-api.d.ts +1 -1
  173. package/lib/contexts/odigos-api/index.d.ts +2 -4
  174. package/lib/contexts/odigos-api/internal/notify.d.ts +2 -2
  175. package/lib/contexts/odigos-api/internal/source-payloads.d.ts +2 -2
  176. package/lib/contexts/odigos-api/platform-helpers.d.ts +2 -2
  177. package/lib/contexts/odigos-api/runner.d.ts +3 -3
  178. package/lib/contexts/odigos-api/types.d.ts +7 -13
  179. package/lib/contexts/odigos-api/use-api-query.d.ts +11 -10
  180. package/lib/contexts/odigos-context.d.ts +5 -3
  181. package/lib/contexts/rule-form-context.d.ts +3 -3
  182. package/lib/contexts/sampling-rules-form-context.d.ts +2 -2
  183. package/lib/contexts/source-edit-form-context.d.ts +2 -2
  184. package/lib/contexts/source-instrument-form-context.d.ts +2 -2
  185. package/lib/contexts.js +1 -1
  186. package/lib/functions/build-badge-for-desired-status/index.d.ts +2 -2
  187. package/lib/functions/clean-object-empty-strings-values/index.d.ts +1 -1
  188. package/lib/functions/compare-condition/index.d.ts +1 -1
  189. package/lib/functions/filter-actions/index.d.ts +2 -2
  190. package/lib/functions/filter-destinations/index.d.ts +2 -2
  191. package/lib/functions/filter-destinations-by-stream/index.d.ts +1 -1
  192. package/lib/functions/filter-sources/index.d.ts +2 -2
  193. package/lib/functions/filter-sources-by-stream/index.d.ts +1 -1
  194. package/lib/functions/flatten-object-keys/index.d.ts +1 -1
  195. package/lib/functions/get-action-icon/index.d.ts +1 -1
  196. package/lib/functions/get-conditions-booleans/index.d.ts +1 -1
  197. package/lib/functions/get-containers-counts/index.d.ts +1 -1
  198. package/lib/functions/get-containers-icons/index.d.ts +1 -1
  199. package/lib/functions/get-destination-icon/index.d.ts +1 -1
  200. package/lib/functions/get-entity-icon/index.d.ts +1 -1
  201. package/lib/functions/get-entity-id/index.d.ts +1 -1
  202. package/lib/functions/get-entity-label/index.d.ts +1 -1
  203. package/lib/functions/get-health-badge-label/index.d.ts +1 -1
  204. package/lib/functions/get-id-from-sse-target/index.d.ts +1 -1
  205. package/lib/functions/get-instrumentation-rule-icon/index.d.ts +1 -1
  206. package/lib/functions/get-main-container-language/index.d.ts +1 -1
  207. package/lib/functions/get-metric-for-entity/index.d.ts +1 -1
  208. package/lib/functions/get-monitor-icon/index.d.ts +1 -1
  209. package/lib/functions/get-nearest-typography-size/index.d.ts +1 -1
  210. package/lib/functions/get-platform-icon/index.d.ts +1 -1
  211. package/lib/functions/get-platform-label/index.d.ts +1 -1
  212. package/lib/functions/get-programming-language-icon/index.d.ts +1 -1
  213. package/lib/functions/get-sse-target-from-id/index.d.ts +1 -1
  214. package/lib/functions/get-status-color/index.d.ts +1 -1
  215. package/lib/functions/get-status-from-pod-status/index.d.ts +1 -1
  216. package/lib/functions/get-status-icon/index.d.ts +1 -1
  217. package/lib/functions/get-status-type-from-odigos-health/index.d.ts +1 -1
  218. package/lib/functions/get-virtual-service-icon/index.d.ts +1 -1
  219. package/lib/functions/get-workload-id/index.d.ts +1 -1
  220. package/lib/functions/get-yaml-fields-for-destination/index.d.ts +1 -1
  221. package/lib/functions/has-unhealthy-instances/index.d.ts +1 -1
  222. package/lib/functions/instrumentation-rule-source-scopes/index.d.ts +1 -1
  223. package/lib/functions/map-conditions/index.d.ts +1 -1
  224. package/lib/functions/map-desired-status-to-condition-status/index.d.ts +1 -1
  225. package/lib/functions/map-destination-fields-for-display/index.d.ts +1 -1
  226. package/lib/functions/map-signals/index.d.ts +1 -1
  227. package/lib/functions/prepare-destination-form-data/index.d.ts +1 -1
  228. package/lib/functions/remove-empty-values-from-object/index.d.ts +1 -1
  229. package/lib/functions/safe-json-parse/index.d.ts +1 -1
  230. package/lib/functions/safe-json-stringify/index.d.ts +1 -1
  231. package/lib/functions/stringify-non-string-values/index.d.ts +1 -1
  232. package/lib/functions.js +1 -1
  233. package/lib/hooks/index.d.ts +0 -2
  234. package/lib/hooks/useActionFormData.d.ts +2 -2
  235. package/lib/hooks/useCopy.d.ts +1 -1
  236. package/lib/hooks/useDataStreamFormData.d.ts +1 -1
  237. package/lib/hooks/useDestinationFormData.d.ts +1 -1
  238. package/lib/hooks/useGenericForm.d.ts +1 -1
  239. package/lib/hooks/useInstrumentationRuleFormData.d.ts +2 -2
  240. package/lib/hooks/usePopup.d.ts +1 -1
  241. package/lib/hooks/useSourceFormData.d.ts +1 -1
  242. package/lib/hooks.js +1 -1
  243. package/lib/icons/actions/add-cluster-info-icon/index.d.ts +1 -1
  244. package/lib/icons/actions/delete-attribute-icon/index.d.ts +1 -1
  245. package/lib/icons/actions/pii-masking-icon/index.d.ts +1 -1
  246. package/lib/icons/actions/rename-attribute-icon/index.d.ts +1 -1
  247. package/lib/icons/actions/sampler-icon/index.d.ts +1 -1
  248. package/lib/icons/arrows/arrow-down-icon/index.d.ts +1 -1
  249. package/lib/icons/arrows/arrow-down-square-icon/index.d.ts +1 -1
  250. package/lib/icons/arrows/arrow-left-icon/index.d.ts +1 -1
  251. package/lib/icons/arrows/arrow-left-square-icon/index.d.ts +1 -1
  252. package/lib/icons/arrows/arrow-right-icon/index.d.ts +1 -1
  253. package/lib/icons/arrows/arrow-right-square-icon/index.d.ts +1 -1
  254. package/lib/icons/arrows/arrow-up-icon/index.d.ts +1 -1
  255. package/lib/icons/arrows/arrow-up-square-icon/index.d.ts +1 -1
  256. package/lib/icons/arrows/chevron-down-circle-icon/index.d.ts +1 -1
  257. package/lib/icons/arrows/chevron-down-icon/index.d.ts +1 -1
  258. package/lib/icons/arrows/chevron-down-square-icon/index.d.ts +1 -1
  259. package/lib/icons/arrows/chevron-left-circle-icon/index.d.ts +1 -1
  260. package/lib/icons/arrows/chevron-left-icon/index.d.ts +1 -1
  261. package/lib/icons/arrows/chevron-left-square-icon/index.d.ts +1 -1
  262. package/lib/icons/arrows/chevron-right-circle-icon/index.d.ts +1 -1
  263. package/lib/icons/arrows/chevron-right-icon/index.d.ts +1 -1
  264. package/lib/icons/arrows/chevron-right-square-icon/index.d.ts +1 -1
  265. package/lib/icons/arrows/chevron-up-circle-icon/index.d.ts +1 -1
  266. package/lib/icons/arrows/chevron-up-icon/index.d.ts +1 -1
  267. package/lib/icons/arrows/chevron-up-square-icon/index.d.ts +1 -1
  268. package/lib/icons/auth/okta-icon/index.d.ts +1 -1
  269. package/lib/icons/brand/odigos-logo/index.d.ts +1 -1
  270. package/lib/icons/brand/odigos-logo-text/index.d.ts +1 -1
  271. package/lib/icons/brand/odigos-logo-text-central/index.d.ts +1 -1
  272. package/lib/icons/brand/odigos-logo-text-colored-central/index.d.ts +1 -1
  273. package/lib/icons/brand/odigos-logo-text-colored-community/index.d.ts +1 -1
  274. package/lib/icons/brand/odigos-logo-text-colored-enterprise/index.d.ts +1 -1
  275. package/lib/icons/brand/odigos-logo-text-community/index.d.ts +1 -1
  276. package/lib/icons/brand/odigos-logo-text-enterprise/index.d.ts +1 -1
  277. package/lib/icons/common/arrow-icon/index.d.ts +1 -1
  278. package/lib/icons/common/avatar-icon/index.d.ts +1 -1
  279. package/lib/icons/common/book-icon/index.d.ts +1 -1
  280. package/lib/icons/common/code-brackets-icon/index.d.ts +1 -1
  281. package/lib/icons/common/code-icon/index.d.ts +1 -1
  282. package/lib/icons/common/command-icon/index.d.ts +1 -1
  283. package/lib/icons/common/copy-icon/index.d.ts +1 -1
  284. package/lib/icons/common/delete-icon/index.d.ts +1 -1
  285. package/lib/icons/common/diagnose-icon/index.d.ts +1 -1
  286. package/lib/icons/common/dot-icon/index.d.ts +1 -1
  287. package/lib/icons/common/dots-horizontal-icon/index.d.ts +1 -1
  288. package/lib/icons/common/dots-vertical-icon/index.d.ts +1 -1
  289. package/lib/icons/common/download-icon/index.d.ts +1 -1
  290. package/lib/icons/common/edit-icon/index.d.ts +1 -1
  291. package/lib/icons/common/edited-icon/index.d.ts +1 -1
  292. package/lib/icons/common/exclamation-circle-icon/index.d.ts +1 -1
  293. package/lib/icons/common/exclamation-triangle-icon/index.d.ts +1 -1
  294. package/lib/icons/common/expand-icon/index.d.ts +1 -1
  295. package/lib/icons/common/extend-arrow-icon/index.d.ts +1 -1
  296. package/lib/icons/common/filter-icon/index.d.ts +1 -1
  297. package/lib/icons/common/folder-icon/index.d.ts +1 -1
  298. package/lib/icons/common/gear-icon/index.d.ts +1 -1
  299. package/lib/icons/common/home-icon/index.d.ts +1 -1
  300. package/lib/icons/common/i-square-icon/index.d.ts +1 -1
  301. package/lib/icons/common/image-error-icon/index.d.ts +1 -1
  302. package/lib/icons/common/inbound-icon/index.d.ts +1 -1
  303. package/lib/icons/common/key-icon/index.d.ts +1 -1
  304. package/lib/icons/common/list-icon/index.d.ts +1 -1
  305. package/lib/icons/common/lock-icon/index.d.ts +1 -1
  306. package/lib/icons/common/minus-circled-icon/index.d.ts +1 -1
  307. package/lib/icons/common/minus-icon/index.d.ts +1 -1
  308. package/lib/icons/common/no-data-icon/index.d.ts +1 -1
  309. package/lib/icons/common/notebook-icon/index.d.ts +1 -1
  310. package/lib/icons/common/notification-icon/index.d.ts +1 -1
  311. package/lib/icons/common/outbound-icon/index.d.ts +1 -1
  312. package/lib/icons/common/plus-circled-icon/index.d.ts +1 -1
  313. package/lib/icons/common/plus-icon/index.d.ts +1 -1
  314. package/lib/icons/common/question-circle-icon/index.d.ts +1 -1
  315. package/lib/icons/common/refresh-icon/index.d.ts +1 -1
  316. package/lib/icons/common/refresh-left-arrow-icon/index.d.ts +1 -1
  317. package/lib/icons/common/refresh-right-arrow-icon/index.d.ts +1 -1
  318. package/lib/icons/common/role-icon/index.d.ts +1 -1
  319. package/lib/icons/common/rotate-arrows-icon/index.d.ts +1 -1
  320. package/lib/icons/common/search-icon/index.d.ts +1 -1
  321. package/lib/icons/common/server-disconnected-icon/index.d.ts +1 -1
  322. package/lib/icons/common/settings-icon/index.d.ts +1 -1
  323. package/lib/icons/common/sort-arrows-icon/index.d.ts +1 -1
  324. package/lib/icons/common/star-icon/index.d.ts +1 -1
  325. package/lib/icons/common/terminal-icon/index.d.ts +1 -1
  326. package/lib/icons/common/trash-icon/index.d.ts +1 -1
  327. package/lib/icons/common/user-circle-icon/index.d.ts +1 -1
  328. package/lib/icons/common/user-group-icon/index.d.ts +1 -1
  329. package/lib/icons/common/user-icon/index.d.ts +1 -1
  330. package/lib/icons/common/user-settings-icon/index.d.ts +1 -1
  331. package/lib/icons/common/v-icon/index.d.ts +1 -1
  332. package/lib/icons/common/v-square-icon/index.d.ts +1 -1
  333. package/lib/icons/common/x-icon/index.d.ts +1 -1
  334. package/lib/icons/common/x-square-icon/index.d.ts +1 -1
  335. package/lib/icons/compute-platform/k8s-logo/index.d.ts +1 -1
  336. package/lib/icons/compute-platform/vm-logo/index.d.ts +1 -1
  337. package/lib/icons/destinations/alauda-logo/index.d.ts +1 -1
  338. package/lib/icons/destinations/alibaba-cloud-logo/index.d.ts +1 -1
  339. package/lib/icons/destinations/app-dynamics-logo/index.d.ts +1 -1
  340. package/lib/icons/destinations/aws-api-gateway-logo/index.d.ts +1 -1
  341. package/lib/icons/destinations/aws-bedrock-logo/index.d.ts +1 -1
  342. package/lib/icons/destinations/aws-cloudwatch-logo/index.d.ts +1 -1
  343. package/lib/icons/destinations/aws-dynamodb-logo/index.d.ts +1 -1
  344. package/lib/icons/destinations/aws-ec2-logo/index.d.ts +1 -1
  345. package/lib/icons/destinations/aws-eventbridge-logo/index.d.ts +1 -1
  346. package/lib/icons/destinations/aws-kinesis-logo/index.d.ts +1 -1
  347. package/lib/icons/destinations/aws-lambda-logo/index.d.ts +1 -1
  348. package/lib/icons/destinations/aws-s3-logo/index.d.ts +1 -1
  349. package/lib/icons/destinations/aws-secrets-manager-logo/index.d.ts +1 -1
  350. package/lib/icons/destinations/aws-sns-logo/index.d.ts +1 -1
  351. package/lib/icons/destinations/aws-sqs-logo/index.d.ts +1 -1
  352. package/lib/icons/destinations/aws-step-functions-logo/index.d.ts +1 -1
  353. package/lib/icons/destinations/aws-sts-logo/index.d.ts +1 -1
  354. package/lib/icons/destinations/aws-xray-logo/index.d.ts +1 -1
  355. package/lib/icons/destinations/axiom-logo/index.d.ts +1 -1
  356. package/lib/icons/destinations/azure-blob-logo/index.d.ts +1 -1
  357. package/lib/icons/destinations/azure-monitor-logo/index.d.ts +1 -1
  358. package/lib/icons/destinations/better-stack-logo/index.d.ts +1 -1
  359. package/lib/icons/destinations/bonree-logo/index.d.ts +1 -1
  360. package/lib/icons/destinations/causely-logo/index.d.ts +1 -1
  361. package/lib/icons/destinations/checkly-logo/index.d.ts +1 -1
  362. package/lib/icons/destinations/chronosphere-logo/index.d.ts +1 -1
  363. package/lib/icons/destinations/clickhouse-logo/index.d.ts +1 -1
  364. package/lib/icons/destinations/coralogix-logo/index.d.ts +1 -1
  365. package/lib/icons/destinations/dash0-logo/index.d.ts +1 -1
  366. package/lib/icons/destinations/datadog-logo/index.d.ts +1 -1
  367. package/lib/icons/destinations/dynatrace-logo/index.d.ts +1 -1
  368. package/lib/icons/destinations/elastic-apm-logo/index.d.ts +1 -1
  369. package/lib/icons/destinations/elastic-search-logo/index.d.ts +1 -1
  370. package/lib/icons/destinations/gigapipe-logo/index.d.ts +1 -1
  371. package/lib/icons/destinations/google-cloud-platform-logo/index.d.ts +1 -1
  372. package/lib/icons/destinations/google-cloud-storage-logo/index.d.ts +1 -1
  373. package/lib/icons/destinations/grafana-logo/index.d.ts +1 -1
  374. package/lib/icons/destinations/greptime-logo/index.d.ts +1 -1
  375. package/lib/icons/destinations/groundcover-logo/index.d.ts +1 -1
  376. package/lib/icons/destinations/honeycomb-logo/index.d.ts +1 -1
  377. package/lib/icons/destinations/hyperdx-logo/index.d.ts +1 -1
  378. package/lib/icons/destinations/instana-logo/index.d.ts +1 -1
  379. package/lib/icons/destinations/jaeger-logo/index.d.ts +1 -1
  380. package/lib/icons/destinations/kafka-logo/index.d.ts +1 -1
  381. package/lib/icons/destinations/kloudmate-logo/index.d.ts +1 -1
  382. package/lib/icons/destinations/last9-logo/index.d.ts +1 -1
  383. package/lib/icons/destinations/lightstep-logo/index.d.ts +1 -1
  384. package/lib/icons/destinations/logzio-logo/index.d.ts +1 -1
  385. package/lib/icons/destinations/loki-logo/index.d.ts +1 -1
  386. package/lib/icons/destinations/lumigo-logo/index.d.ts +1 -1
  387. package/lib/icons/destinations/middleware-logo/index.d.ts +1 -1
  388. package/lib/icons/destinations/new-relic-logo/index.d.ts +1 -1
  389. package/lib/icons/destinations/observe-logo/index.d.ts +1 -1
  390. package/lib/icons/destinations/odigos-destination-logo/index.d.ts +1 -1
  391. package/lib/icons/destinations/one-uptime-logo/index.d.ts +1 -1
  392. package/lib/icons/destinations/open-observe-logo/index.d.ts +1 -1
  393. package/lib/icons/destinations/open-telemetry-logo/index.d.ts +1 -1
  394. package/lib/icons/destinations/ops-verse-logo/index.d.ts +1 -1
  395. package/lib/icons/destinations/oracle-logo/index.d.ts +1 -1
  396. package/lib/icons/destinations/prometheus-logo/index.d.ts +1 -1
  397. package/lib/icons/destinations/pyroscope-logo/index.d.ts +1 -1
  398. package/lib/icons/destinations/qryn-logo/index.d.ts +1 -1
  399. package/lib/icons/destinations/quickwit-logo/index.d.ts +1 -1
  400. package/lib/icons/destinations/sentry-logo/index.d.ts +1 -1
  401. package/lib/icons/destinations/seq-logo/index.d.ts +1 -1
  402. package/lib/icons/destinations/signoz-logo/index.d.ts +1 -1
  403. package/lib/icons/destinations/splunk-logo/index.d.ts +1 -1
  404. package/lib/icons/destinations/sumo-logic-logo/index.d.ts +1 -1
  405. package/lib/icons/destinations/telemetry-hub-logo/index.d.ts +1 -1
  406. package/lib/icons/destinations/tempo-logo/index.d.ts +1 -1
  407. package/lib/icons/destinations/tingyun-logo/index.d.ts +1 -1
  408. package/lib/icons/destinations/traceloop-logo/index.d.ts +1 -1
  409. package/lib/icons/destinations/uptrace-logo/index.d.ts +1 -1
  410. package/lib/icons/destinations/victoria-metrics-logo/index.d.ts +1 -1
  411. package/lib/icons/instrumentation-rules/code-attributes-icon/index.d.ts +1 -1
  412. package/lib/icons/instrumentation-rules/custom-instrumentation-icon/index.d.ts +1 -1
  413. package/lib/icons/instrumentation-rules/headers-collection-icon/index.d.ts +1 -1
  414. package/lib/icons/instrumentation-rules/payload-collection-icon/index.d.ts +1 -1
  415. package/lib/icons/monitors/logs-icon/index.d.ts +1 -1
  416. package/lib/icons/monitors/metrics-icon/index.d.ts +1 -1
  417. package/lib/icons/monitors/traces-icon/index.d.ts +1 -1
  418. package/lib/icons/on-off/eye-closed-icon/index.d.ts +1 -1
  419. package/lib/icons/on-off/eye-open-icon/index.d.ts +1 -1
  420. package/lib/icons/on-off/light-off-icon/index.d.ts +1 -1
  421. package/lib/icons/on-off/light-on-icon/index.d.ts +1 -1
  422. package/lib/icons/on-off/moon-icon/index.d.ts +1 -1
  423. package/lib/icons/on-off/sound-off-icon/index.d.ts +1 -1
  424. package/lib/icons/on-off/sound-on-icon/index.d.ts +1 -1
  425. package/lib/icons/on-off/sun-icon/index.d.ts +1 -1
  426. package/lib/icons/overview/action-icon/index.d.ts +1 -1
  427. package/lib/icons/overview/connections-icon/index.d.ts +1 -1
  428. package/lib/icons/overview/data-stream-icon/index.d.ts +1 -1
  429. package/lib/icons/overview/destination-icon/index.d.ts +1 -1
  430. package/lib/icons/overview/gateway-icon/index.d.ts +1 -1
  431. package/lib/icons/overview/instrumentation-rule-icon/index.d.ts +1 -1
  432. package/lib/icons/overview/log-icon/index.d.ts +1 -1
  433. package/lib/icons/overview/namespaces-icon/index.d.ts +1 -1
  434. package/lib/icons/overview/overview-icon/index.d.ts +1 -1
  435. package/lib/icons/overview/pipeline-collector-icon/index.d.ts +1 -1
  436. package/lib/icons/overview/pod-icon/index.d.ts +1 -1
  437. package/lib/icons/overview/replica-icon/index.d.ts +1 -1
  438. package/lib/icons/overview/sampling-icon/index.d.ts +1 -1
  439. package/lib/icons/overview/service-map-icon/index.d.ts +1 -1
  440. package/lib/icons/overview/source-icon/index.d.ts +1 -1
  441. package/lib/icons/overview/trace-view-icon/index.d.ts +1 -1
  442. package/lib/icons/overview/yaml-icon/index.d.ts +1 -1
  443. package/lib/icons/programming-languages/aws-logo/index.d.ts +1 -1
  444. package/lib/icons/programming-languages/c-plus-plus-logo/index.d.ts +1 -1
  445. package/lib/icons/programming-languages/c-sharp-logo/index.d.ts +1 -1
  446. package/lib/icons/programming-languages/dotnet-logo/index.d.ts +1 -1
  447. package/lib/icons/programming-languages/elixir-logo/index.d.ts +1 -1
  448. package/lib/icons/programming-languages/go-logo/index.d.ts +1 -1
  449. package/lib/icons/programming-languages/java-logo/index.d.ts +1 -1
  450. package/lib/icons/programming-languages/mysql-logo/index.d.ts +1 -1
  451. package/lib/icons/programming-languages/nginx-logo/index.d.ts +1 -1
  452. package/lib/icons/programming-languages/nodejs-logo/index.d.ts +1 -1
  453. package/lib/icons/programming-languages/php-logo/index.d.ts +1 -1
  454. package/lib/icons/programming-languages/postgres-logo/index.d.ts +1 -1
  455. package/lib/icons/programming-languages/python-logo/index.d.ts +1 -1
  456. package/lib/icons/programming-languages/redis-logo/index.d.ts +1 -1
  457. package/lib/icons/programming-languages/ruby-logo/index.d.ts +1 -1
  458. package/lib/icons/programming-languages/rust-logo/index.d.ts +1 -1
  459. package/lib/icons/programming-languages/swift-logo/index.d.ts +1 -1
  460. package/lib/icons/social/slack-logo/index.d.ts +1 -1
  461. package/lib/snippets/{_v2/actions → actions}/index.d.ts +2 -2
  462. package/lib/snippets/{_v2/cancel-modal → cancel-modal}/index.d.ts +1 -1
  463. package/lib/snippets/{_v2/delete-modal → delete-modal}/index.d.ts +1 -1
  464. package/lib/snippets/{_v2/dynamic-field → dynamic-field}/index.d.ts +6 -2
  465. package/lib/snippets/index.d.ts +13 -1
  466. package/lib/snippets/{_v2/instrumentation-rule-form-sections → instrumentation-rule-form-sections}/instrumentation-preview.d.ts +1 -1
  467. package/lib/snippets/{_v2/rich-title → rich-title}/index.d.ts +3 -3
  468. package/lib/snippets/{_v2/sampling-rule-form-sections → sampling-rule-form-sections}/duration-errors.d.ts +2 -2
  469. package/lib/snippets/{_v2/sampling-rule-form-sections → sampling-rule-form-sections}/operation.d.ts +1 -1
  470. package/lib/snippets/{_v2/sampling-rule-form-sections → sampling-rule-form-sections}/percentage.d.ts +1 -1
  471. package/lib/snippets/{_v2/sampling-rule-form-sections → sampling-rule-form-sections}/preset-with-custom-input.d.ts +1 -1
  472. package/lib/snippets/{_v2/sampling-rule-form-sections → sampling-rule-form-sections}/rule-info.d.ts +1 -1
  473. package/lib/snippets/{_v2/sampling-rule-form-sections → sampling-rule-form-sections}/rule-type.d.ts +1 -1
  474. package/lib/snippets/{_v2/sampling-rule-form-sections → sampling-rule-form-sections}/sampling-preview.d.ts +2 -2
  475. package/lib/snippets/{_v2/sampling-rule-form-sections → sampling-rule-form-sections}/source-scope.d.ts +2 -2
  476. package/lib/snippets/{_v2/signals-checkbox-list → signals-checkbox-list}/index.d.ts +1 -1
  477. package/lib/snippets/{_v2/wide-drawer → wide-drawer}/column-list-item/index.d.ts +1 -1
  478. package/lib/snippets/{_v2/wide-drawer → wide-drawer}/index.d.ts +6 -3
  479. package/lib/snippets/{_v2/yaml-section-card → yaml-section-card}/index.d.ts +1 -1
  480. package/lib/snippets.js +1 -1
  481. package/lib/store/index.d.ts +0 -1
  482. package/lib/store/useDataStreamStore.d.ts +1 -1
  483. package/lib/store/useDrawerStore.d.ts +16 -3
  484. package/lib/store/useFilterStore.d.ts +1 -1
  485. package/lib/store/useNotificationStore.d.ts +1 -1
  486. package/lib/store/useProgressStore.d.ts +1 -1
  487. package/lib/store/useSelectedStore.d.ts +1 -1
  488. package/lib/store/useSetupStore.d.ts +1 -1
  489. package/lib/store.js +1 -1
  490. package/lib/theme.js +1 -1
  491. package/lib/types/actions/index.d.ts +1 -1
  492. package/lib/types/common/index.d.ts +10 -0
  493. package/lib/types/destinations/index.d.ts +1 -1
  494. package/lib/types/sampling.d.ts +1 -1
  495. package/lib/types.js +1 -1
  496. package/lib/visuals/visual-green-rings/index.d.ts +1 -1
  497. package/lib/visuals/visual-purple-rings/index.d.ts +1 -1
  498. package/lib/visuals.js +1 -1
  499. package/package.json +19 -39
  500. package/lib/chunks/connections-scope-JSsSeaII.js +0 -1
  501. package/lib/chunks/consts-D6GCMJ6c.js +0 -1
  502. package/lib/chunks/index-CpvWOJm_.js +0 -155
  503. package/lib/chunks/odigos-context-DGZO6Njm.js +0 -18
  504. package/lib/chunks/source-instrument-form-context-FYKFdAII.js +0 -1
  505. package/lib/chunks/ui-components-D1ehQI2Z.js +0 -1704
  506. package/lib/chunks/use-odigos-api-Ptz3Kdno.js +0 -5
  507. package/lib/chunks/vendor-BFqT13Me.js +0 -1
  508. package/lib/components/_v2/icon-button/index.d.ts +0 -16
  509. package/lib/components/_v2/icon-group/index.d.ts +0 -11
  510. package/lib/components/_v2/index.d.ts +0 -40
  511. package/lib/components/fade-loader/helpers/animation.d.ts +0 -1
  512. package/lib/components/fade-loader/helpers/unitConverter.d.ts +0 -22
  513. package/lib/components/fade-loader/index.d.ts +0 -10
  514. package/lib/components/icon-wrapped/index.d.ts +0 -11
  515. package/lib/components/image-controlled/index.d.ts +0 -8
  516. package/lib/components/loading-text/index.d.ts +0 -9
  517. package/lib/components/notification-note/index.d.ts +0 -22
  518. package/lib/components/popup/index.d.ts +0 -18
  519. package/lib/components/scroll-x/index.d.ts +0 -10
  520. package/lib/components/text/index.d.ts +0 -26
  521. package/lib/components/v2.js +0 -1
  522. package/lib/containers/_v2/index.d.ts +0 -9
  523. package/lib/containers/v2.js +0 -990
  524. package/lib/contexts/odigos-api.js +0 -1
  525. package/lib/hooks/useClickNode.d.ts +0 -6
  526. package/lib/hooks/useClickNotification.d.ts +0 -7
  527. package/lib/snippets/_v2/index.d.ts +0 -13
  528. package/lib/snippets/v2.js +0 -1
  529. package/lib/store/useModalStore.d.ts +0 -6
  530. /package/lib/components/{_v2/cards → _cards}/index.d.ts +0 -0
  531. /package/lib/components/{_v2/cards → _cards}/text-card/index.d.ts +0 -0
  532. /package/lib/components/{_v2/charts → charts}/gauge-chart/index.d.ts +0 -0
  533. /package/lib/components/{_v2/charts → charts}/index.d.ts +0 -0
  534. /package/lib/components/{_v2/cli-command → cli-command}/index.d.ts +0 -0
  535. /package/lib/components/{_v2/drawer → drawer}/footer/index.d.ts +0 -0
  536. /package/lib/components/{_v2/drawer → drawer}/index.d.ts +0 -0
  537. /package/lib/components/{_v2/drop-down → drop-down}/index.d.ts +0 -0
  538. /package/lib/components/{_v2/field-message → field-message}/index.d.ts +0 -0
  539. /package/lib/components/{_v2/field-title → field-title}/index.d.ts +0 -0
  540. /package/lib/components/{_v2/header → header}/index.d.ts +0 -0
  541. /package/lib/components/{_v2/hover-actions → hover-actions}/index.d.ts +0 -0
  542. /package/lib/components/{_v2/input-list → input-list}/index.d.ts +0 -0
  543. /package/lib/components/{_v2/input-table → input-table}/card-table.d.ts +0 -0
  544. /package/lib/components/{_v2/input-table → input-table}/dynamic-field/index.d.ts +0 -0
  545. /package/lib/components/{_v2/input-table → input-table}/index.d.ts +0 -0
  546. /package/lib/components/{_v2/loader → loader}/spinner/index.d.ts +0 -0
  547. /package/lib/components/{_v2/loader → loader}/spinner-old/helpers/animation.d.ts +0 -0
  548. /package/lib/components/{_v2/loader → loader}/spinner-old/helpers/unitConverter.d.ts +0 -0
  549. /package/lib/components/{_v2/loader → loader}/spinner-old/index.d.ts +0 -0
  550. /package/lib/components/{_v2/modal → modal}/index.d.ts +0 -0
  551. /package/lib/components/{_v2/search → search}/index.d.ts +0 -0
  552. /package/lib/components/{_v2/stepper → stepper}/index.d.ts +0 -0
  553. /package/lib/components/{_v2/table → table}/index.d.ts +0 -0
  554. /package/lib/components/{_v2/table → table}/styled.d.ts +0 -0
  555. /package/lib/components/{_v2/table → table}/table-columns/filter/index.d.ts +0 -0
  556. /package/lib/components/{_v2/table → table}/table-rows/index.d.ts +0 -0
  557. /package/lib/components/{_v2/table → table}/types.d.ts +0 -0
  558. /package/lib/components/{_v2/textarea → textarea}/index.d.ts +0 -0
  559. /package/lib/components/{_v2/time-input → time-input}/index.d.ts +0 -0
  560. /package/lib/components/{_v2/typography → typography}/index.d.ts +0 -0
  561. /package/lib/components/{_v2/typography-truncatable → typography-truncatable}/index.d.ts +0 -0
  562. /package/lib/components/{_v2/warning-modal → warning-modal}/index.d.ts +0 -0
  563. /package/lib/containers/{_v2/_drawers → _drawers}/add-source-drawer/namespaces-column/list/index.d.ts +0 -0
  564. /package/lib/containers/{_v2/_drawers → _drawers}/add-source-drawer/namespaces-column/list/list-item/index.d.ts +0 -0
  565. /package/lib/containers/{_v2/_drawers → _drawers}/edit-action-drawer/index.d.ts +0 -0
  566. /package/lib/containers/{_v2/_drawers → _drawers}/edit-destination-drawer/index.d.ts +0 -0
  567. /package/lib/containers/{_v2/_drawers → _drawers}/edit-rule-drawer/index.d.ts +0 -0
  568. /package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/common/index.d.ts +0 -0
  569. /package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/overview/containers-card/popup-form.d.ts +0 -0
  570. /package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/pods/pod-debug-commands.d.ts +0 -0
  571. /package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/profiling/flame-graph-canvas.d.ts +0 -0
  572. /package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/profiling/flamebearer.d.ts +0 -0
  573. /package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/profiling/symbol-table/modify-rules-modal.d.ts +0 -0
  574. /package/lib/containers/{_v2/_drawers → _drawers}/edit-source-drawer/tabs.d.ts +0 -0
  575. /package/lib/containers/{_v2/_drawers → _drawers}/index.d.ts +0 -0
  576. /package/lib/containers/{_v2/_drawers → _drawers}/regex-tester-drawer/highlighter.d.ts +0 -0
  577. /package/lib/containers/{_v2/_drawers → _drawers}/regex-tester-drawer/index.d.ts +0 -0
  578. /package/lib/containers/{_v2/_drawers → _drawers}/system-drawer/describe/index.d.ts +0 -0
  579. /package/lib/containers/{_v2/_drawers → _drawers}/system-drawer/diagnose/index.d.ts +0 -0
  580. /package/lib/containers/{_v2/_drawers → _drawers}/system-drawer/tokens/token-expires-at.d.ts +0 -0
  581. /package/lib/containers/{_v2/_forms → _forms}/add-action-form/index.d.ts +0 -0
  582. /package/lib/containers/{_v2/_forms → _forms}/add-rule-form/index.d.ts +0 -0
  583. /package/lib/containers/{_v2/_forms → _forms}/data-stream-form/index.d.ts +0 -0
  584. /package/lib/containers/{_v2/_forms → _forms}/data-stream-form/merge-warning.d.ts +0 -0
  585. /package/lib/containers/{_v2/_forms → _forms}/edit-source-form/index.d.ts +0 -0
  586. /package/lib/containers/{_v2/_forms → _forms}/index.d.ts +0 -0
  587. /package/lib/containers/{_v2/_forms → _forms}/sampling-rule-form/index.d.ts +0 -0
  588. /package/lib/containers/{_v2/_modals → _modals}/add-data-stream-modal/index.d.ts +0 -0
  589. /package/lib/containers/{_v2/_modals → _modals}/edit-data-stream-modal/index.d.ts +0 -0
  590. /package/lib/containers/{_v2/_modals → _modals}/index.d.ts +0 -0
  591. /package/lib/containers/{_v2/_modals → _modals}/onboarding-done/background.d.ts +0 -0
  592. /package/lib/containers/{_v2/_modals → _modals}/sampling-onboarding-modal/common/chrome.d.ts +0 -0
  593. /package/lib/containers/{_v2/_modals → _modals}/sampling-onboarding-modal/common/footer.d.ts +0 -0
  594. /package/lib/containers/{_v2/_modals → _modals}/sampling-onboarding-modal/common/header.d.ts +0 -0
  595. /package/lib/containers/{_v2/_modals → _modals}/sampling-onboarding-modal/common/index.d.ts +0 -0
  596. /package/lib/containers/{_v2/_modals → _modals}/sampling-onboarding-modal/common/info-card.d.ts +0 -0
  597. /package/lib/containers/{_v2/_modals → _modals}/sampling-onboarding-modal/common/lists.d.ts +0 -0
  598. /package/lib/containers/{_v2/_modals → _modals}/sampling-onboarding-modal/common/primary-banner.d.ts +0 -0
  599. /package/lib/containers/{_v2/_modals → _modals}/sampling-onboarding-modal/common/section.d.ts +0 -0
  600. /package/lib/containers/{_v2/_modals → _modals}/sampling-onboarding-modal/common/sub-title.d.ts +0 -0
  601. /package/lib/containers/{_v2/_modals → _modals}/sampling-onboarding-modal/index.d.ts +0 -0
  602. /package/lib/containers/{_v2/_modals → _modals}/sampling-onboarding-modal/steps/step-advanced.d.ts +0 -0
  603. /package/lib/containers/{_v2/_modals → _modals}/sampling-onboarding-modal/steps/step-drop-list.d.ts +0 -0
  604. /package/lib/containers/{_v2/_modals → _modals}/sampling-onboarding-modal/steps/step-keep-list.d.ts +0 -0
  605. /package/lib/containers/{_v2/_modals → _modals}/sampling-onboarding-modal/steps/step-noisy.d.ts +0 -0
  606. /package/lib/containers/{_v2/_modals → _modals}/sampling-onboarding-modal/steps/step-strategy.d.ts +0 -0
  607. /package/lib/containers/{_v2/_modals → _modals}/sampling-onboarding-modal/steps/step-success.d.ts +0 -0
  608. /package/lib/containers/{_v2/_modals → _modals}/sampling-onboarding-modal/steps/step-welcome.d.ts +0 -0
  609. /package/lib/containers/{_v2/onboarding → onboarding}/background/index.d.ts +0 -0
  610. /package/lib/containers/{_v2/onboarding → onboarding}/get-started/index.d.ts +0 -0
  611. /package/lib/containers/{_v2/onboarding → onboarding}/index.d.ts +0 -0
  612. /package/lib/containers/{_v2/overview → overview}/columns/column/namespace-divider.d.ts +0 -0
  613. /package/lib/containers/{_v2/overview → overview}/columns/index.d.ts +0 -0
  614. /package/lib/containers/{_v2/overview → overview}/data-stream-select/index.d.ts +0 -0
  615. /package/lib/containers/{_v2/overview → overview}/drawers/index.d.ts +0 -0
  616. /package/lib/containers/{_v2/overview → overview}/filters/index.d.ts +0 -0
  617. /package/lib/containers/{_v2/overview → overview}/index.d.ts +0 -0
  618. /package/lib/containers/{_v2/overview → overview}/multi-source-control/index.d.ts +0 -0
  619. /package/lib/containers/{_v2/overview → overview}/search/index.d.ts +0 -0
  620. /package/lib/containers/{_v2/pipeline-collectors → pipeline-collectors}/enum.d.ts +0 -0
  621. /package/lib/containers/{_v2/pipeline-collectors → pipeline-collectors}/general-info/helpers/get-general-title.d.ts +0 -0
  622. /package/lib/containers/{_v2/pipeline-collectors → pipeline-collectors}/general-info/helpers/index.d.ts +0 -0
  623. /package/lib/containers/{_v2/pipeline-collectors → pipeline-collectors}/toolbar/index.d.ts +0 -0
  624. /package/lib/containers/{_v2/sampling-rules → sampling-rules}/index.d.ts +0 -0
  625. /package/lib/containers/{_v2/settings → settings}/side-menu/index.d.ts +0 -0
  626. /package/lib/containers/{_v2/settings → settings}/toolbar/index.d.ts +0 -0
  627. /package/lib/snippets/{_v2/colored-span → colored-span}/index.d.ts +0 -0
  628. /package/lib/snippets/{_v2/instrumentation-rule-form-sections → instrumentation-rule-form-sections}/index.d.ts +0 -0
  629. /package/lib/snippets/{_v2/odigos-logo-text-by-tier → odigos-logo-text-by-tier}/index.d.ts +0 -0
  630. /package/lib/snippets/{_v2/sampling-rule-form-sections → sampling-rule-form-sections}/index.d.ts +0 -0
  631. /package/lib/snippets/{_v2/sampling-rule-form-sections → sampling-rule-form-sections}/styled.d.ts +0 -0
  632. /package/lib/snippets/{_v2/upgrade-modal → upgrade-modal}/index.d.ts +0 -0
  633. /package/lib/snippets/{_v2/wide-drawer → wide-drawer}/column/index.d.ts +0 -0
  634. /package/lib/snippets/{_v2/wide-drawer → wide-drawer}/column-list-collapse/index.d.ts +0 -0
package/lib/containers.js CHANGED
@@ -1,15 +1,963 @@
1
- import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import o,{useTheme as r}from"styled-components";import{memo as n,useState as a,useCallback as s,useEffect as d,useMemo as l,createContext as c,useContext as p,useRef as u}from"react";import{U as h}from"./chunks/consts-D6GCMJ6c.js";import{MarkerType as g,useNodesState as m,useEdgesState as f,Handle as v,Position as y,getSmoothStepPath as b,BaseEdge as x,EdgeLabelRenderer as N,ReactFlowProvider as S,ReactFlow as I,Background as w,Controls as $,ControlButton as k,useReactFlow as M}from"@xyflow/react";import{N as C,o as T,p as A,q as E,r as z,v as X,w as K,T as R,a as V,x as O,y as _,B as q,z as L,L as j,M as H,O as D,Q as G,R as P,U as B,V as F,W as U,X as Y,Y as W}from"./chunks/ui-components-D1ehQI2Z.js";import{UserIcon as Z,ImageErrorIcon as Q,ArrowLeftIcon as J,InboundIcon as ee,OutboundIcon as te,RefreshIcon as ie}from"./icons.js";import oe from"elkjs/lib/elk.bundled.js";import{d as re}from"./chunks/use-odigos-api-Ptz3Kdno.js";import"@xyflow/react/dist/style.css";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"./chunks/vendor-BFqT13Me.js";import"zustand/middleware";import"react-error-boundary";import"react-dom";import"virtua";import"@apollo/client";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";const ne=o.div`
1
+ import{jsxs as e,jsx as t,Fragment as o}from"react/jsx-runtime";import{useEffect as n,useMemo as i,useRef as a,useCallback as l,useState as r,Fragment as s,forwardRef as c,useImperativeHandle as d,Children as u,createContext as p,useContext as h,useLayoutEffect as m,memo as g}from"react";import f,{useTheme as b,css as v,keyframes as y}from"styled-components";import{u as C,n as S,C as w,f as x,e as k,d as T,q as $,g as I,h as E,j as N,p as A,l as O,c as R,r as D,S as P,s as F,R as L,t as M,w as _,o as z,x as B,y as X,z as V,A as U,B as G,D as H,E as j,F as W,G as K,H as Y,I as q,J}from"./chunks/odigos-context-_YAZF63s.js";import{bh as Z,u as Q,v as ee,C as te,aQ as oe,I as ne,br as ie,c as ae,d as le,h as re,aV as se,bs as ce,K as de,N as ue,O as pe,w as he,k as me,l as ge,B as fe,S as be,bt as ve,bu as ye,_ as Ce,bv as Se,bw as we,i as xe,bx as ke,F as Te,by as $e,s as Ie,T as Ee,bz as Ne,bi as Ae,aU as Oe,bA as Re,bB as De,g as Pe,aw as Fe,ay as Le,bC as Me,bn as _e,bo as ze,bm as Be,bD as Xe,q as Ve,H as Ue,p as Ge,G as He,J as je,o as We,n as Ke,bE as Ye,bF as qe,aG as Je,W as Ze,b1 as Qe,b5 as et,bG as tt,bH as ot,bI as nt,bJ as it,bK as at,bL as lt,bM as rt,bN as st,x as ct,bO as dt,bP as ut,bQ as pt,bR as ht,bS as mt,aT as gt,bl as ft,D as bt,bT as vt,bU as yt,aW as Ct,bV as St,bW as wt,aO as xt,bp as kt,b4 as Tt,b as $t,e as It,bX as Et,b6 as Nt,bY as At,bZ as Ot,b8 as Rt,bb as Dt,bg as Pt,b_ as Ft,av as Lt,b$ as Mt,c0 as _t,bf as zt,c1 as Bt,c2 as Xt,c3 as Vt,r as Ut,a$ as Gt,b0 as Ht,aA as jt,c4 as Wt,c5 as Kt,c6 as Yt,c7 as qt,c8 as Jt,c9 as Zt,ca as Qt,cb as eo,cc as to,cd as oo,ce as no,A as io,aX as ao,aS as lo,cf as ro,cg as so,ch as co,ci as uo,cj as po,ck as ho,bq as mo,cl as go,aY as fo,cm as bo,cn as vo,co as yo,cp as Co,cq as So,cr as wo,cs as xo,aF as ko,ct as To,cu as $o,cv as Io,cw as Eo,cx as No,cy as Ao,cz as Oo,cA as Ro,cB as Do,cC as Po,cD as Fo,cE as Lo,al as Mo,cF as _o,cG as zo,cH as Bo,cI as Xo,cJ as Vo,cK as Uo,cL as Go,cM as Ho,cN as jo,cO as Wo,cP as Ko,cQ as Yo,cR as qo,cS as Jo,cT as Zo,a4 as Qo,cU as en,cV as tn,aZ as on,cW as nn,cX as an,cY as ln,cZ as rn,c_ as sn,c$ as cn,d0 as dn,d1 as un,d2 as pn,d3 as hn,d4 as mn,d5 as gn,d6 as fn,d7 as bn,d8 as vn,d9 as yn,da as Cn,db as Sn,dc as wn,dd as xn,de as kn,df as Tn,dg as $n,dh as In,di as En,dj as Nn,dk as An,dl as On,dm as Rn,dn as Dn,dp as Pn,dq as Fn,dr as Ln,ds as Mn,dt as _n,du as zn,dv as Bn,dw as Xn,dx as Vn,dy as Un,dz as Gn,dA as Hn,dB as jn,dC as Wn,dD as Kn,dE as Yn,dF as qn,dG as Jn,dH as Zn,dI as Qn,dJ as ei,dK as ti,dL as oi,dM as ni,dN as ii,dO as ai,dP as li,dQ as ri,dR as si,dS as ci,dT as di,dU as ui,dV as pi,dW as hi,dX as mi,dY as gi,dZ as fi,d_ as bi,d$ as vi,e0 as yi,e1 as Ci,e2 as Si,e3 as wi,e4 as xi,e5 as ki,e6 as Ti,e7 as $i,P as Ii,e8 as Ei,e9 as Ni,ea as Ai,eb as Oi,ec as Ri,aP as Di,ed as Pi,aK as Fi,ee as Li,ef as Mi,eg as _i,eh as zi,ei as Bi,ej as Xi,ek as Vi,el as Ui,em as Gi,en as Hi,eo as ji,ep as Wi,b7 as Ki,eq as Yi,R as qi,a as Ji,er as Zi,es as Qi,et as ea,eu as ta,ev as oa,ew as na,ex as ia,ey as aa,ez as la,eA as ra,eB as sa,eC as ca,eD as da,eE as ua,eF as pa,eG as ha,eH as ma,eI as ga,eJ as fa,eK as ba,eL as va,eM as ya}from"./chunks/ui-components-CAPnizLR.js";import{TrashIcon as Ca,PlusIcon as Sa,ArrowRightIcon as wa,VSquareIcon as xa,XSquareIcon as ka,BookIcon as Ta,DeleteIcon as $a,EditIcon as Ia,GoLogo as Ea,JavaLogo as Na,ChevronRightIcon as Aa,ActionIcon as Oa,DestinationIcon as Ra,ChevronUpIcon as Da,ChevronDownIcon as Pa,VIcon as Fa,XIcon as La,InstrumentationRuleIcon as Ma,SourceIcon as _a,NamespacesIcon as za,SettingsIcon as Ba,PodIcon as Xa,OdigosLogo as Va,K8sLogo as Ua,RefreshIcon as Ga,ExclamationCircleIcon as Ha,QuestionCircleIcon as ja,InboundIcon as Wa,OutboundIcon as Ka,UserIcon as Ya,TerminalIcon as qa,MinusIcon as Ja,SearchIcon as Za,ExpandIcon as Qa,CopyIcon as el,DotIcon as tl,ArrowDownIcon as ol,DownloadIcon as nl,RefreshLeftArrowIcon as il,VmLogo as al,SamplingIcon as ll,ExclamationTriangleIcon as rl,KeyIcon as sl,DiagnoseIcon as cl,StarIcon as dl,ArrowIcon as ul,ConnectionsIcon as pl,FilterIcon as hl,DataStreamIcon as ml,PipelineCollectorIcon as gl,ArrowDownSquareIcon as fl,ArrowUpSquareIcon as bl,GatewayIcon as vl,YamlIcon as yl,ImageErrorIcon as Cl,ArrowLeftIcon as Sl,LockIcon as wl}from"./icons.js";import{h as xl,n as kl,m as Tl,o as $l,l as Il,s as El,q as Nl,S as Al,v as Ol,E as Rl,w as Dl,x as Pl,t as Fl,d as Ll,O as Ml,f as _l,b as zl,A as Bl,R as Xl,e as Vl,D as Ul}from"./chunks/source-instrument-form-context-CZQIaTUV.js";import{c as Gl,h as Hl,I as jl,i as Wl,A as Kl,f as Yl,P as ql,S as Jl,R as Zl,d as Ql,g as er,b as tr,e as or,j as nr,a as ir,C as ar,Y as lr,O as rr,W as sr,U as cr}from"./chunks/index-B-zICLj7.js";import{createPortal as dr}from"react-dom";import{MarkerType as ur,useNodesState as pr,useEdgesState as hr,Handle as mr,Position as gr,getSmoothStepPath as fr,BaseEdge as br,EdgeLabelRenderer as vr,ReactFlowProvider as yr,ReactFlow as Cr,Background as Sr,Controls as wr,ControlButton as xr,useReactFlow as kr}from"@xyflow/react";import Tr from"elkjs/lib/elk.bundled.js";import"@xyflow/react/dist/style.css";import"zustand";import"javascript-time-ago";import"javascript-time-ago/locale/en";import"prism-react-renderer";import"zustand/middleware";import"react-error-boundary";import"virtua";import"@apollo/client/react";import"@apollo/client/link/error";import"@apollo/client/link/context";import"@apollo/client/utilities";import"@apollo/client/errors";import"@apollo/client";const $r=[{id:"CREDIT_CARD",label:"Credit card"}],Ir=[{id:Z.CollectContainerAttributes,label:"Collect container attributes"},{id:Z.CollectReplicaSetAttributes,label:"Collect ReplicaSet attributes"},{id:Z.CollectWorkloadId,label:"Collect workload ID"},{id:Z.CollectClusterId,label:"Collect cluster ID"}],Er=[{id:ie.Pod,label:ie.Pod},{id:ie.Namespace,label:ie.Namespace},{id:ie.Node,label:ie.Node}],Nr=[{label:"Label key",keyName:"labelKey",placeholder:"app.kubernetes.io/name"},{label:"Attribute key",keyName:"attributeKey",placeholder:"app.kubernetes.name"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Er}],Ar=[{label:"Annotation key",keyName:"annotationKey",placeholder:"kubectl.kubernetes.io/restartedAt"},{label:"Attribute key",keyName:"attributeKey",placeholder:"kubectl.kubernetes.restartedAt"},{label:"From sources",keyName:"fromSources",placeholder:"pod, namespace",tooltip:"Select multiple sources. Higher precedence sources (pod > namespace > node) will override lower ones.",componentType:"multi-dropdown",options:Er}],Or=/^[a-zA-Z]$/,Rr=new Set(["*","+","?"]),Dr=new Set(["^","$"]),Pr={group:"rgba(102, 242, 102, 0.5)","anchor-quantifier":"rgba(102, 191, 255, 0.5)","class-bracket":"rgba(255, 153, 153, 0.5)","class-content":"rgba(178, 1, 1, 0.5)",alternation:"rgba(255, 153, 153, 0.5)",literal:"transparent"},Fr=f.div`
2
+ padding: 8px 16px;
3
+ border-radius: 6px;
4
+ border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
5
+ background: ${({theme:e})=>e.v2.colors.black[500]};
6
+ font-family: ${({theme:e})=>e.font_family.code};
7
+ font-size: 12px;
8
+ line-height: 20px;
9
+ color: ${({theme:e})=>e.v2.colors.white[500]};
10
+ word-break: break-all;
11
+ white-space: pre-wrap;
12
+ user-select: text;
13
+
14
+ /* Wraps the background tightly to each visual fragment when a colored
15
+ token gets split across two visual lines. Without this the highlight
16
+ stretches all the way to the right edge of the container. */
17
+ & > span {
18
+ box-decoration-break: clone;
19
+ -webkit-box-decoration-break: clone;
20
+ }
21
+ `,Lr=f.span`
22
+ background: ${({$kind:e})=>Pr[e]};
23
+ `,Mr=({pattern:e,"data-id":o})=>{const n=i(()=>(e=>{const t=[];let o=0,n=!1;const i=(e,o)=>{const n=t[t.length-1];n&&n.kind===o?n.text+=e:t.push({text:e,kind:o})};for(;o<e.length;){const t=e[o];if(n){if("]"===t){i("]","class-bracket"),n=!1,o++;continue}if("\\"===t&&o+1<e.length){i(e.slice(o,o+2),"class-content"),o+=2;continue}i(t,"class-content"),o++}else{if("("===t&&"?"===e[o+1]){let t=2;const n=e[o+2];if(":"===n||"="===n||"!"===n)t=3;else if("<"===n){const n=e[o+3];if("="===n||"!"===n)t=4;else{const n=e.indexOf(">",o+2);-1!==n&&(t=n-o+1)}}i(e.slice(o,o+t),"group"),o+=t;continue}if("("!==t&&")"!==t)if("["!==t)if(Rr.has(t)||Dr.has(t))i(t,"anchor-quantifier"),o++;else{if("{"===t){const t=e.indexOf("}",o);if(t>o&&/^\{\d+,?\d*\}$/.test(e.slice(o,t+1))){i(e.slice(o,t+1),"anchor-quantifier"),o=t+1;continue}}if("\\"===t&&o+1<e.length){const t=e[o+1];Or.test(t)?i(e.slice(o,o+2),"anchor-quantifier"):i(e.slice(o,o+2),"literal"),o+=2;continue}"|"!==t?(i(t,"literal"),o++):(i("|","alternation"),o++)}else"^"===e[o+1]?(i("[^","class-bracket"),o+=2):(i("[","class-bracket"),o++),n=!0;else i(t,"group"),o++}}return t})(e),[e]);return t(Fr,e?{"data-id":o,children:n.map((e,o)=>t(Lr,{$kind:e.kind,children:e.text},o))}:{"data-id":o,children:" "})},_r="rgba(102, 191, 255, 0.5)",zr=v`
24
+ font-family: ${({theme:e})=>e.font_family.code};
25
+ font-size: 12px;
26
+ line-height: 20px;
27
+ letter-spacing: 0;
28
+ white-space: pre-wrap;
29
+ word-wrap: break-word;
30
+ overflow-wrap: break-word;
31
+ /* tab-size keeps tabs visually consistent across the two layers — some
32
+ browsers default to 8 on a textarea but 4 on a div. */
33
+ -moz-tab-size: 4;
34
+ tab-size: 4;
35
+ margin: 0;
36
+ `,Br=f.div`
37
+ position: relative;
38
+ width: 100%;
39
+ min-height: ${({$minHeight:e})=>e}px;
40
+ border-radius: 6px;
41
+ border: 1px solid ${({theme:e})=>e.v2.colors.silver[500]};
42
+ background: ${({theme:e})=>e.v2.colors.black[500]};
43
+
44
+ &:hover,
45
+ &:focus-within {
46
+ border-color: ${({theme:e})=>e.v2.colors.silver[300]};
47
+ }
48
+ `,Xr=f.div`
49
+ ${zr}
50
+ position: absolute;
51
+ inset: 0;
52
+ padding: 12px;
53
+ pointer-events: none;
54
+ color: transparent;
55
+ overflow: hidden;
56
+
57
+ /* Mandatory for backgrounds that wrap across visual lines. */
58
+ & > span {
59
+ box-decoration-break: clone;
60
+ -webkit-box-decoration-break: clone;
61
+ }
62
+ `,Vr=f.textarea`
63
+ ${zr}
64
+ position: relative;
65
+ z-index: 1;
66
+ display: block;
67
+ width: 100%;
68
+ min-height: ${({$minHeight:e})=>e}px;
69
+ padding: 12px;
70
+ border: 0;
71
+ background: transparent;
72
+ outline: none;
73
+ resize: vertical;
74
+ color: ${({theme:e})=>e.v2.colors.white[500]};
75
+ caret-color: ${({theme:e})=>e.v2.colors.white[500]};
76
+ box-sizing: border-box;
77
+
78
+ &::placeholder {
79
+ color: ${({theme:e})=>e.v2.colors.silver[600]};
80
+ }
81
+ `,Ur=e=>({before:e,matchPre:"",capture:"",matchPost:"",after:""}),Gr=({regex:o,value:n,onChange:r,minHeight:s=240,...c})=>{const d=a(null),u=a(null),p=i(()=>((e,t)=>{if(!e||!t)return Ur(t);let o;try{o=new RegExp(e)}catch{return Ur(t)}const n=o.exec(t);if(!n)return Ur(t);const i=n.index,a=n.index+n[0].length;if(n.length<2||null==n[1])return{before:t.slice(0,i),matchPre:"",capture:t.slice(i,a),matchPost:"",after:t.slice(a)};const l=n[0].indexOf(n[1]),r=l>=0?i+l:i,s=r+n[1].length;return{before:t.slice(0,i),matchPre:t.slice(i,r),capture:t.slice(r,s),matchPost:t.slice(s,a),after:t.slice(a)}})(o,n),[o,n]),h=l(()=>{d.current&&u.current&&(d.current.scrollTop=u.current.scrollTop,d.current.scrollLeft=u.current.scrollLeft)},[]);return e(Br,{$minHeight:s,children:[e(Xr,{ref:d,"aria-hidden":!0,children:[p.before,t("span",{style:{background:_r},children:p.matchPre}),t("span",{style:{background:"rgba(102, 242, 102, 0.5)"},children:p.capture}),t("span",{style:{background:_r},children:p.matchPost}),p.after,n.endsWith("\n")?" ":""]}),t(Vr,{ref:u,$minHeight:s,value:n,onChange:e=>r(e.target.value),onScroll:h,spellCheck:!1,...c})]})},Hr=f.div`
82
+ flex: 1;
83
+ min-height: 0;
84
+ overflow-y: auto;
85
+ `,jr=f.div`
86
+ background: ${({theme:e})=>e.v2.colors.silver[900]};
87
+ border-radius: 8px;
88
+ padding: 8px;
89
+ display: flex;
90
+ flex-direction: column;
91
+ gap: 12px;
92
+ `,Wr=f.div`
93
+ padding: 8px 16px;
94
+ border-radius: 8px;
95
+ background: ${({theme:e})=>e.v2.colors.silver[800]};
96
+ font-family: ${({theme:e})=>e.font_family.code};
97
+ font-size: 12px;
98
+ line-height: 20px;
99
+ color: ${({theme:e,$tone:t})=>"error"===t?e.v2.colors.red[500]:"match"===t?e.v2.colors.white[500]:e.v2.colors.silver[200]};
100
+ word-break: break-all;
101
+ white-space: pre-wrap;
102
+ user-select: text;
103
+ `,Kr=({isOpen:o,regex:n,onClose:a,initialTestString:l=""})=>{const[s,c]=r(l),d=i(()=>((e,t)=>{if(!e)return{ok:!0,isMatch:!1,message:ce.RESULT_EMPTY_REGEX};if(!t)return{ok:!0,isMatch:!1,message:ce.RESULT_EMPTY_INPUT};let o;try{o=new RegExp(e)}catch(e){return{ok:!1,message:e instanceof Error?e.message:ce.RESULT_INVALID_REGEX_FALLBACK}}const n=o.exec(t);return n?{ok:!0,isMatch:!0,message:n.length>1?n[1]:n[0]}:{ok:!0,isMatch:!1,message:ce.RESULT_NO_MATCH}})(n,s),[n,s]),u=d.ok?d.isMatch?"match":"neutral":"error";return t(se,{isOpen:o,header:{title:ce.TITLE,onClose:()=>{c(""),a()}},children:t(Hr,{children:e(jr,{children:[e(Q,{$gap:6,children:[t(ee,{label:ce.REGEX_LABEL}),t(Mr,{pattern:n,"data-id":"regex-tester-regex"}),!n&&t(de,{size:pe.XXS,color:ue.Secondary,children:ce.REGEX_EMPTY_HINT})]}),e(Q,{$gap:6,children:[e(he,{$width:"100%",$justifyContent:"space-between",$alignItems:"center",children:[t(ee,{label:ce.TEST_STRING_LABEL}),t(me,{"data-id":"regex-tester-unescape",label:ce.UNESCAPE_LABEL,tooltip:ce.UNESCAPE_TOOLTIP,variant:fe.Secondary,size:ge.S,onClick:()=>c(e=>(e=>{let t="";for(let o=0;o<e.length;o++){if("\\"===e[o]&&o+1<e.length){const n=e[o+1],i="n"===n?"\n":"t"===n?"\t":"r"===n?"\r":'"'===n?'"':"'"===n?"'":"\\"===n?"\\":null;if(null!=i){t+=i,o++;continue}}t+=e[o]}return t})(e)),disabled:(p=s,!/\\["'\\nrt]/.test(p))})]}),t(Gr,{name:"regex-tester-test-string","data-id":"regex-tester-test-string",placeholder:ce.TEST_STRING_PLACEHOLDER,regex:n,value:s,onChange:c,minHeight:240}),t(oe,{helpMessage:ce.TEST_STRING_HELP})]}),e(Q,{$gap:8,children:[t(ee,{label:ce.RESULT_LABEL}),t(Wr,{$tone:u,"data-id":"regex-tester-result",children:d.message}),d.ok&&d.isMatch&&t(de,{size:pe.XXS,color:ue.Secondary,children:ce.RESULT_CAPTURE_HINT})]})]})})});var p},Yr=Z.ExtractAttribute;var qr;(e=>{e.Preset="preset",e.Regex="regex"})(qr||(qr={}));const Jr=[ye.JSON,ye.SQL,ye.ResourcePath],Zr=(e=ye.JSON)=>({targetAttributeName:"",lookupKey:"",dataFormat:e,regex:""}),Qr=e=>!!e.regex&&!e.lookupKey&&!e.dataFormat,es=f.div`
104
+ width: 100%;
105
+ background: ${({theme:e})=>e.v2.colors.silver[800]};
106
+ border-radius: 8px;
107
+ padding: 8px;
108
+ display: flex;
109
+ flex-direction: column;
110
+ gap: 8px;
111
+ `,ts=f.div`
112
+ flex: 1;
113
+ min-width: 0;
114
+ `,os=f.div`
115
+ /* Pushes the arrow down to sit next to the inputs rather than the field titles. */
116
+ padding-top: 24px;
117
+ `,ns=e=>Object.entries(e||{}).map(([e,t])=>({oldKey:e,newKey:t})),is=e=>{const t={};return e.forEach(({oldKey:e,newKey:o})=>{t[e]=o}),t},as=Z.UrlTemplatizationRulesGroups,ls=[{keyName:"kind",label:"Kind",placeholder:"Any kind",componentType:"dropdown",options:[{id:"Deployment",label:"Deployment"},{id:"StatefulSet",label:"StatefulSet"},{id:"DaemonSet",label:"DaemonSet"}]},{keyName:"name",label:"Name",placeholder:"Any name"}],rs=e=>{if(Array.isArray(e))return e.map(e=>"string"==typeof e?{id:e,label:e}:e)},ss=e=>{if(!Array.isArray(e)||e.length<3)return;const[t,o,n]=e;return e=>{const i=null==e?.[t]?"":String(e[t]);switch(o){case"=":case"==":case"===":return i===n;case"!=":case"!==":return i!==n;default:return!0}}},cs=e=>{if(Array.isArray(e))return e.map(e=>{const t=e;return{keyName:String(t.keyName??t.name??""),label:t.label??t.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,componentType:t.componentType,options:rs(t.options??t.values),fullRow:t.fullRow,defaultValue:t.defaultValue,withRegexTester:t.withRegexTester,separator:t.separator,copyByColumn:t.copyByColumn,renderCondition:ss(t.renderCondition)}})},ds=e=>{if(Array.isArray(e))return e.map(e=>{if("string"==typeof e)return{id:e,label:e};const t=e;return{id:String(t.id??t.keyName??t.name??""),label:t.label??t.displayName??String(t.id??""),tooltip:t.tooltip,fields:Array.isArray(t.fields)?t.fields.map(us):void 0}})},us=e=>{const t="string"==typeof e.componentProperties?Ie(e.componentProperties,{}):e.componentProps||{};return{name:e.name,componentType:e.componentType,inputType:e.inputType??t.inputType,title:e.displayName,tooltip:t.tooltip,placeholder:t.placeholder,helpMessage:t.helpMessage,required:t.required,initialValue:e.initialValue,renderCondition:e.renderCondition,options:rs(t.options??t.values),itemWrapperKey:t.itemWrapperKey,columns:cs(t.columns),limitFieldsPerRow:t.limitFieldsPerRow,variant:t.variant,wrapKey:t.wrapKey,checkboxOptions:ds(t.options??t.values),checkedValue:t.checkedValue??"true",valueMode:t.valueMode??"object",fields:Array.isArray(t.fields)?t.fields.map(us):void 0,addLabel:t.addLabel,itemLabel:t.itemLabel,keyLabel:t.titleKey??t.keyLabel,valueLabel:t.titleValue??t.valueLabel}},ps=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),hs=e=>Array.isArray(e)?e:[],ms=e=>{const t={};return e.forEach(e=>{t[String(e.key??"")]=String(e.value??"")}),t},gs=e=>ps(e)?Object.entries(e).map(([e,t])=>({key:e,value:String(t??"")})):[],fs=({field:e,value:o,setValue:i,errorMessage:a,disabled:l})=>{const[s,c]=r(()=>gs(o));return n(()=>{const e=ps(o)?o:{};((e,t)=>{const o=Object.keys(e),n=Object.keys(t);return o.length===n.length&&o.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&t[o]===e[o])})(ms(s),e)||c(gs(o))},[o]),t(ne,{name:e.name,label:e.title,tooltip:e.tooltip,helpMessage:e.helpMessage,required:e.required,disabled:l,limitFieldsPerRow:2,columns:[{keyName:"key",label:e.keyLabel||"Key",placeholder:e.keyLabel||"Key"},{keyName:"value",label:e.valueLabel||"Value",placeholder:e.valueLabel||"Value"}],values:s,setValues:e=>{c(e),i(ms(e))},errorMessage:a})},bs=({field:n,value:i,setValue:a,errorMessage:l,disabled:s})=>{const{name:c,componentType:d,inputType:u,title:p,tooltip:h,placeholder:m,helpMessage:g,required:f,initialValue:b,options:v,itemWrapperKey:y,columns:C,limitFieldsPerRow:S,variant:w,wrapKey:x,checkboxOptions:k}=n,[T,$]=r({open:!1,value:""});if(d===Te.CheckboxList&&"array"===n.valueMode){const o=hs(i),n=(e,t)=>a(t?[...o.filter(t=>t!==e),e]:o.filter(t=>t!==e));return e(Q,{$gap:12,children:[p&&t(ee,{label:p,tooltip:h,required:f}),t(Q,{$gap:8,children:(k||[]).map(e=>{const i=t(te,{name:e.id,label:e.label,value:o.includes(e.id),disabled:s,onChange:t=>n(e.id,t)},e.id);return e.tooltip?t(Ee,{text:e.tooltip,withIcon:!0,children:i},e.id):i})}),t(oe,{errorMessage:l,helpMessage:g})]})}if(d===Te.CheckboxList){const o=ps(i)?i:{},r=(e=>"emptyObject"!==e.checkedValue||{})(n),d=e=>"emptyObject"===n.checkedValue?ps(e):!!e;return e(Q,{$gap:12,children:[p&&t(de,{size:pe.XS,color:ue.Secondary,nowrap:!0,children:p}),t(Q,{$gap:12,children:(k||[]).map(n=>{const i=o[n.id],l=d(i),u=ps(i)?i:{},p=t(te,{label:n.label,value:l,disabled:s,onChange:e=>a({...o,[n.id]:e?ps(i)?i:r:null})}),h=n.tooltip?t(Ee,{text:n.tooltip,withIcon:!0,children:p}):p,m=l&&n.fields?.length?t(Q,{$gap:12,$padding:"0 0 0 24px",children:n.fields.map(e=>t(bs,{field:e,value:u[e.name],setValue:t=>a({...o,[n.id]:{...u,[e.name]:t}}),disabled:s},`${c}-${n.id}-${e.name}`))}):null;return e(Q,{$gap:12,children:[h,m]},n.id)})}),t(oe,{errorMessage:l,helpMessage:g})]})}if(d===Te.MultiTabledInput){const n=hs(x?i?.[x]:i),r=e=>a(x?{...ps(i)?i:{},[x]:e}:e),d=(C||[]).some(e=>e.withRegexTester);return e(o,{children:[t("cards"===w?Ne:ne,{name:c,label:p,tooltip:h,helpMessage:g,required:f,disabled:s,columns:C||[],limitFieldsPerRow:S,values:n,setValues:r,errorMessage:l,onTestRegex:d?e=>$({open:!0,value:e}):void 0}),d&&t(Kr,{isOpen:T.open,regex:T.value,onClose:()=>$({open:!1,value:""})})]})}if(d===Te.MultiInput&&x){const e=hs(i?.[x]);return t(re,{name:c,label:p,tooltip:h,helpMessage:g,required:f,disabled:s,placeholder:m,values:e,setValues:e=>a({...ps(i)?i:{},[x]:e}),errorMessage:l})}if(d===Te.MultiInput&&y){const e=hs(i).map(e=>String(e?.[y]??""));return t(re,{name:c,label:p,tooltip:h,helpMessage:g,required:f,disabled:s,placeholder:m,values:e,setValues:e=>a(e.map(e=>({[y]:e}))),errorMessage:l})}return d===Te.KeyValuePair?t(fs,{field:n,value:i,setValue:a,errorMessage:l,disabled:s}):t(Gl,{componentType:d,inputType:u,name:c,label:p,tooltip:h,helpMessage:g,disabled:s,required:f,placeholder:m,errorMessage:l,dropdownOptions:v,value:(null==i?b:i)??"",setValue:a})},vs=({field:n,value:i,setValue:a,disabled:l})=>{const r=b(),c=hs(i),d=c.length?c:[{}],u=n.fields||[],p=e=>a(e);return e(o,{children:[d.map((o,i)=>e(s,{children:[t(ke,{}),e(Q,{$gap:12,children:[e(he,{$justifyContent:"space-between",$alignItems:"center",children:[t(ee,{label:`${n.itemLabel||n.title||"Item"} ${i+1}`}),t(me,{leftIcon:()=>t(Ca,{fill:r.v2.colors.red[500]}),variant:fe.Secondary,size:ge.S,onClick:()=>(e=>{const t=d.filter((t,o)=>o!==e);p(t)})(i),disabled:l||1===d.length})]}),u.map(e=>t(bs,{field:e,value:o[e.name],setValue:t=>((e,t,o)=>p(d.map((n,i)=>i===e?{...n,[t]:o}:n)))(i,e.name,t),disabled:l},`${n.name}-group-${i}-${e.name}`))]})]},`${n.name}-group-${i}`)),t(me,{variant:fe.Secondary,label:n.addLabel||"Add",leftIcon:Sa,onClick:()=>p([...d,{}]),disabled:l}),t(ke,{})]})},ys=({field:o,value:n,setValue:i,errorMessage:a,disabled:l})=>e(Q,{$gap:12,children:[o.title&&t(ee,{label:o.title,tooltip:o.tooltip,required:o.required}),t(Q,{$gap:8,children:(o.checkboxOptions||[]).map(e=>{const o=t(te,{name:e.id,label:e.label,value:!0===n?.[e.id],disabled:l,onChange:t=>i(e.id,t)},e.id);return e.tooltip?t(Ee,{text:e.tooltip,withIcon:!0,children:o},e.id):o})}),t(oe,{errorMessage:a,helpMessage:o.helpMessage})]}),Cs=({signals:e,fields:i,value:a,setValue:l,formErrors:r,disabled:s,seedInitialValues:c})=>{const d=(i||[]).filter(e=>!!e).map(e=>us(e));return n(()=>{if(!c)return;const e=a||{},t={};d.forEach(o=>{const n=(e=>{const t=e.initialValue;if(void 0!==t&&""!==t)return e.componentType===Te.CheckboxList?"array"===e.valueMode?Ie(t,[]):Ie(t,{}):e.componentType!==Te.MultiInput&&e.componentType!==Te.MultiTabledInput||!e.wrapKey?e.componentType===Te.MultiInput||e.componentType===Te.MultiTabledInput?Ie(t,[]):t:{[e.wrapKey]:Ie(t,[])}})(o);if(void 0===n)return;if(o.componentType===Te.CheckboxList&&"flatFields"===o.valueMode&&ps(n))return void Object.entries(n).forEach(([o,n])=>{void 0!==e[o]&&null!==e[o]||(t[o]=n)});null==e[o.name]&&(t[o.name]=ps(n)&&ps(t[o.name])?{...t[o.name],...n}:n)}),Object.entries(t).forEach(([e,t])=>l(e,t))},[]),t(o,{children:d.map(o=>{const n=Object.entries(a||{}).map(([e,t])=>({name:e,value:t}));if(o.renderCondition&&!$e(o.renderCondition,e,n))return null;const i=a?.[o.name];if(o.componentType===Te.FieldGroup)return t(vs,{field:o,value:i,setValue:e=>l(o.name,e),disabled:s},o.name);if(o.componentType===Te.CheckboxList&&"flatFields"===o.valueMode){const e=o.checkboxOptions?.map(e=>r[e.id]).find(Boolean);return t(ys,{field:o,value:a||{},setValue:l,errorMessage:e,disabled:s},o.name)}return t(bs,{field:o,value:i,setValue:e=>l(o.name,e),errorMessage:r[o.name],disabled:s},o.name)})})},Ss={[Ae.K8sAttributes]:({value:i,setValue:a,formErrors:l})=>(n(()=>{i[Z.CollectContainerAttributes]||i[Z.CollectReplicaSetAttributes]||i[Z.CollectWorkloadId]||i[Z.CollectClusterId]||i[Z.LabelsAttributes]?.length||i[Z.AnnotationsAttributes]?.length||(a(Z.CollectContainerAttributes,!0),a(Z.CollectReplicaSetAttributes,!0),a(Z.CollectWorkloadId,!0),a(Z.CollectClusterId,!0),a(Z.LabelsAttributes,[]),a(Z.AnnotationsAttributes,[]))},[]),e(o,{children:[t(Q,{$gap:6,children:Ir.map(({id:o,label:n})=>e(Q,{children:[t(te,{label:n,value:i[o]||!1,onChange:e=>a(o,e)}),t(oe,{errorMessage:l[o]})]},o))}),t(ne,{name:"labelsAttributes",label:"Label attributes",limitFieldsPerRow:2,columns:Nr,values:i[Z.LabelsAttributes]||[],setValues:e=>a(Z.LabelsAttributes,e),errorMessage:l[Z.LabelsAttributes]}),t(ne,{name:"annotationsAttributes",label:"Annotation attributes",limitFieldsPerRow:2,columns:Ar,values:i[Z.AnnotationsAttributes]||[],setValues:e=>a(Z.AnnotationsAttributes,e),errorMessage:l[Z.AnnotationsAttributes]})]})),[Ae.AddClusterInfo]:({value:n,setValue:i,formErrors:a})=>{const l=b();return e(o,{children:[t(ae,{label:"Overwrite existing values",labelAlign:le.Left,labelColor:l.v2.colors.silver[200],tooltip:"If enabled, the resource attributes will overwrite any existing attributes with the same name.",value:n[Z.OverwriteExistingValues]||!1,onChange:e=>i(Z.OverwriteExistingValues,e)}),t(ne,{name:"clusterAttributes",label:"Resource attributes",limitFieldsPerRow:2,columns:[{keyName:"attributeName",label:"Attribute name",placeholder:"Attribute name"},{keyName:"attributeStringValue",label:"Attribute value",placeholder:"Attribute value"}],values:n[Z.ClusterAttributes]||[],setValues:e=>i(Z.ClusterAttributes,e),errorMessage:a[Z.ClusterAttributes]})]})},[Ae.DeleteAttributes]:({value:e,setValue:o,formErrors:n})=>t(re,{name:"attributeNamesToDelete",label:"Attributes to delete",values:e[Z.AttributeNamesToDelete]||[],setValues:e=>o(Z.AttributeNamesToDelete,e),errorMessage:n[Z.AttributeNamesToDelete]}),[Ae.RenameAttributes]:({value:e,setValue:o,formErrors:i})=>{const a=e[Z.Renames],[l,s]=r(()=>ns(a));return n(()=>{((e,t)=>{const o=Object.keys(e),n=Object.keys(t);return o.length===n.length&&o.every(o=>Object.prototype.hasOwnProperty.call(t,o)&&t[o]===e[o])})(is(l),a||{})||s(ns(a))},[a]),t(ne,{name:"renames",label:"Attributes to rename",limitFieldsPerRow:2,columns:[{keyName:"oldKey",label:"Old key",placeholder:"Old key"},{keyName:"newKey",label:"New key",placeholder:"New key"}],values:l,setValues:e=>{const t=e.map(e=>({oldKey:String(e.oldKey??""),newKey:String(e.newKey??"")}));s(t),o(Z.Renames,is(t))},errorMessage:i[Z.Renames]})},[Ae.PiiMasking]:({value:o,setValue:i,formErrors:a})=>(n(()=>{o[Z.PiiCategories]?.length||i(Z.PiiCategories,$r.map(({id:e})=>e))},[]),e(Q,{$gap:12,children:[t(ee,{label:"Attributes to mask"}),t(Q,{$gap:6,children:$r.map(({id:e,label:n})=>t(te,{label:n,value:o[Z.PiiCategories]?.includes(e)||!1,onChange:t=>{const n=o[Z.PiiCategories]||[],a=t?[...n,e]:n.filter(t=>t!==e);i(Z.PiiCategories,a)}},e))}),t(oe,{errorMessage:a[Z.PiiCategories]})]})),[Ae.URLTemplatization]:({value:n,setValue:i,formErrors:a})=>{const l=b(),r=n[as]||[{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}],c=e=>i(as,e),d=(e,t)=>c(r.map((o,n)=>n===e?{...o,...t}:o));return e(o,{children:[r.map((o,n)=>e(s,{children:[t(ke,{}),e(Q,{$gap:12,children:[e(he,{$justifyContent:"space-between",$alignItems:"center",children:[t(ee,{label:`Rule Group ${n+1}`}),t(me,{leftIcon:()=>t(Ca,{fill:l.v2.colors.red[500]}),variant:fe.Secondary,size:ge.S,onClick:()=>{return e=n,c(r.filter((t,o)=>o!==e));var e},disabled:1===r.length})]}),t(xe,{name:`urlGroup-${n}-namespace`,label:"Namespace",placeholder:"All namespaces",tooltip:"Filter rules to a specific Kubernetes namespace.",value:o.filterK8sNamespace||"",onChange:e=>d(n,{filterK8sNamespace:e.target.value})}),t(ne,{name:`urlGroup-${n}-workloadFilters`,label:"Workload filters",tooltip:"Optionally scope templates to specific workloads.",columns:ls,values:o.workloadFilters||[],setValues:e=>d(n,{workloadFilters:e})}),t(re,{name:`urlGroup-${n}-templates`,label:"Templates",required:!0,placeholder:"e.g. /user/{id}",values:o.templatizationRules.map(e=>e.template),setValues:e=>d(n,{templatizationRules:e.map(e=>({template:e}))})})]}),t(oe,{errorMessage:a[as]})]},`url-templatization-group-${n}`)),t(me,{variant:fe.Secondary,label:"Add rule group",leftIcon:Sa,onClick:()=>c([...r,{filterK8sNamespace:"",workloadFilters:[],templatizationRules:[{template:""}],notes:""}])}),t(ke,{})]})},[Ae.ExtractAttribute]:({value:o,setValue:i,formErrors:a})=>{const l=b(),s=a[Yr],c=o[Yr]?.extractions||[],[d,u]=r(()=>(e=>e.length&&e.some(Qr)?qr.Regex:qr.Preset)(c)),[p,h]=r(null),m=e=>i(Yr,{extractions:e});n(()=>{0===c.length&&m([d===qr.Preset?Zr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},[]);const g=(e,t)=>{m(c.map((o,n)=>n===e?{...o,...t}:o))},f=()=>{m([...c,d===qr.Preset?Zr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])},v=d===qr.Preset,y=c.length?c:[v?Zr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}],C=null!=p&&y[p]?.regex||"";return e(Q,{$gap:16,$width:"100%",children:[t(be,{options:[{value:qr.Preset,label:ve.SEGMENT_PRESET_LABEL,tooltip:ve.SEGMENT_PRESET_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]},{value:qr.Regex,label:ve.SEGMENT_REGEX_LABEL,tooltip:ve.SEGMENT_REGEX_TOOLTIP,selectedBgColor:l.v2.colors.purple[500]}],selected:d,setSelected:e=>{u(e),m([e===qr.Preset?Zr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])}}),e(Q,{$gap:8,$width:"100%",children:[y.map((o,n)=>{const i=n===y.length-1,a=o.dataFormat||ye.JSON,r=Se[a];return e(es,{"data-id":`extract-row-${n}`,children:[e(he,{$gap:10,$alignItems:"flex-start",$width:"100%",$justifyContent:"space-between",children:[e(Q,{$gap:10,children:[t(ee,{label:v?ve.PRESET_ROW_TITLE(n):ve.REGEX_ROW_TITLE(n)}),v&&t(he,{$gap:24,children:Jr.map(e=>t(Ce,{"data-id":`extract-row-${n}-fmt-${e}`,size:we.L,label:Se[e].label,value:a===e,onChange:t=>t&&g(n,{dataFormat:e})},`extract-row-${n}-fmt-${e}`))})]}),e(he,{$gap:4,$alignItems:"center",children:[!v&&t(me,{"data-id":`extract-row-${n}-test-regex`,label:ve.TEST_REGEX_LABEL,variant:fe.Secondary,size:ge.S,onClick:()=>h(n),disabled:!o.regex?.trim()}),t(me,{"data-id":`extract-row-${n}-delete`,leftIcon:()=>t(Ca,{fill:l.v2.colors.red[500]}),variant:fe.Secondary,size:ge.S,onClick:()=>(e=>{const t=c.filter((t,o)=>o!==e);m(t.length?t:[d===qr.Preset?Zr():{targetAttributeName:"",lookupKey:"",dataFormat:"",regex:""}])})(n)}),i&&t(me,{"data-id":`extract-row-${n}-add`,leftIcon:Sa,variant:fe.Secondary,size:ge.S,onClick:f})]})]}),v?e(he,{$gap:8,$alignItems:"flex-start",$width:"100%",children:[t(ts,{children:t(xe,{name:`extract-row-${n}-lookupKey`,label:r.keyLabel,placeholder:r.placeholder,helpMessage:r.helpMessage,width:"100%",value:o.lookupKey||"",onChange:e=>g(n,{lookupKey:e.target.value})})}),t(os,{children:t(wa,{size:24,fill:l.v2.colors.silver[200]})}),t(ts,{children:t(xe,{name:`extract-row-${n}-targetAttributeName`,label:ve.TARGET_LABEL,placeholder:ve.TARGET_PLACEHOLDER,helpMessage:ve.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})})]}):e(Q,{$gap:12,$width:"100%",children:[t(xe,{name:`extract-row-${n}-regex`,label:ve.REGEX_LABEL,placeholder:ve.REGEX_PLACEHOLDER,helpMessage:ve.REGEX_HELP,width:"100%",value:o.regex||"",onChange:e=>g(n,{regex:e.target.value})}),t(xe,{name:`extract-row-${n}-targetAttributeName`,label:ve.TARGET_LABEL,placeholder:ve.TARGET_PLACEHOLDER,helpMessage:ve.TARGET_HELP,width:"100%",value:o.targetAttributeName||"",onChange:e=>g(n,{targetAttributeName:e.target.value})})]})]},`extract-row-${n}`)}),t(oe,{errorMessage:s})]}),t(Kr,{isOpen:null!=p,regex:C,onClose:()=>h(null)})]})}},ws=({actionType:e,value:o,setValue:n,formErrors:i,dynamicFields:a,signals:l})=>{if(!e)return null;if(a?.length)return t(Cs,{fields:a,value:o,setValue:n,formErrors:i||{},signals:l||[],seedInitialValues:!0},e);const r=Ss[e];return r?t(r,{value:o,setValue:n,formErrors:i}):null},xs=()=>{const o=b(),{selectedOption:n,genericForm:i}=xl();if(!i||!n)return t(Oe,{title:"No active form"});const{formData:a,handleFormChange:l,formErrors:r}=i;return e(Q,{$gap:24,children:[e(he,{$gap:12,$justifyContent:"space-between",children:[t(Re,{size:pe.XXXS,maxLines:2,children:n.description}),e(he,{$gap:12,children:[t(be,{options:[{icon:xa,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ka,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:De.S,selected:a.disabled,setSelected:e=>l("disabled",e)}),t(me,{leftIcon:Ta,variant:fe.Secondary,size:ge.S,onClick:()=>n.docsUrl&&window.open(n.docsUrl,"_blank","noopener noreferrer")})]})]}),t(Hl,{title:"Signals for processing",allowedSignals:n.allowedSignals,selectedSignals:a.signals||[],setSelectedSignals:e=>l("signals",e),errorMessage:r.signals}),t(xe,{name:"actionName",label:"Action name",placeholder:"Use a name that describes the action...",value:a.name||"",onChange:({target:{value:e}})=>l("name",e),errorMessage:r.name}),t(ws,{actionType:n.type,dynamicFields:n.fields,signals:a.signals||[],value:a.fields,setValue:(e,t)=>l(`fields.${e}`,t),formErrors:r}),t(Pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:a.notes||"",onChange:({target:{value:e}})=>l("notes",e),errorMessage:r.notes})]})},ks=({signals:e,fields:o,disabled:n,formData:i,handleFormChange:a,formErrors:l})=>o?.map(({renderCondition:o,componentType:r,type:s,name:c,title:d,tooltip:u,placeholder:p,value:h,required:m,options:g})=>{if(o&&!$e(o,e,i.fields))return null;const f=c,b=i.fields.find(e=>e.key===f),v=b?b.value:h;return t(Gl,{componentType:r,inputType:s,name:f,label:d,tooltip:u,disabled:n,required:m,placeholder:p,errorMessage:l[f],dropdownOptions:g,value:v||"",setValue:e=>a(f,e)},f)}),Ts=f(he)`
118
+ position: sticky;
119
+ bottom: 4px;
120
+ align-self: center;
121
+ width: fit-content;
122
+ padding: 12px 16px;
123
+ margin-top: auto;
124
+ border-radius: 8px;
125
+ background-color: ${({theme:e})=>e.v2.colors.black[500]};
126
+ box-shadow: 0 4px 16.7px 0 rgba(0, 0, 0, 0.83);
127
+ z-index: 1;
128
+ `,$s=c(({isEdit:o},i)=>{const a=b(),{isVm:l}=C(),{destinationsApi:s}=kl(),{activeForm:c,genericForm:u,validateFormData:p,thisUnsavedDestination:h,addUnsavedDestination:m,updateUnsavedDestination:g,deleteUnsavedDestination:f}=Tl(),[v,y]=r(h?.testResult),[S,w]=r(!!h);n(()=>{h?(y(h.testResult),w(!0)):(y(void 0),w(!1))},[h]);const x=async()=>{if(!c?.option.testConnectionSupported||!u||l)return;const e=await s.testConnection(Xe(u.formData));return y(e),e};return d(i,()=>({testConnection:x,testConnectionSupported:!!c?.option.testConnectionSupported}),[c?.option.testConnectionSupported,u,s]),u&&c?e(Q,{$gap:24,style:{minHeight:"100%"},children:[e(he,{$gap:12,$justifyContent:"space-between",children:[v?v.succeeded?t(Fe,{status:Le.Success,message:v.message||"Connection OK",fullWidth:!0,smallIcon:!0}):t(Fe,{status:Le.Error,message:v.message||"Connection Failed",fullWidth:!0,smallIcon:!0}):t("div",{}),e(he,{$gap:12,children:[!l&&t(be,{options:[{icon:xa,label:"Enabled",value:!1,selectedBgColor:a.v2.colors.green[800]},{icon:ka,label:"Disabled",value:!0,selectedBgColor:a.v2.colors.red[800]}],size:De.S,selected:u.formData.disabled,setSelected:e=>u.handleFormChange("disabled",e),disabled:S}),t(me,{"data-id":"dest-form-docs",leftIcon:Ta,variant:fe.Secondary,size:ge.S,onClick:()=>window.open(`${Me}/backends/${c.option.type}`,"_blank","noopener noreferrer")})]})]}),t(Hl,{title:"This connection will monitor:",allowedSignals:Be(c.option.supportedSignals),selectedSignals:ze(u.formData.exportedSignals),setSelectedSignals:e=>u.handleFormChange("exportedSignals",{logs:e.includes(_e.Logs),metrics:e.includes(_e.Metrics),traces:e.includes(_e.Traces),profiles:e.includes(_e.Profiles)}),disabled:S,errorMessage:u.formErrors.exportedSignals}),t(xe,{name:"destinationName",label:"Destination name",placeholder:"Use a name that describes the destination...",value:u.formData.name,onChange:({target:{value:e}})=>u.handleFormChange("name",e),disabled:S,errorMessage:u.formErrors.name}),t(ks,{signals:ze(u.formData.exportedSignals),fields:c.dynamicFields,disabled:S,formData:u.formData,handleFormChange:(e,t)=>{u.handleFormChange("fields",u.formData.fields.map(o=>o.key===e?{...o,value:t}:o)),e&&u.formErrors[e]&&u.handleErrorChange(e,void 0)},formErrors:u.formErrors}),!o&&e(Ts,{$gap:8,$justifyContent:"center",children:[h&&t("div",{style:{width:"150px"},children:t(me,{"data-id":"dest-form-delete",fullWidth:!0,label:"Delete",rightIcon:$a,variant:fe.Secondary,textColor:a.v2.colors.red[500],onClick:()=>f(c.unsavedIdx)})}),!l&&(!h||h.option.testConnectionSupported&&!S)&&t("div",{style:{width:"150px"},children:t(me,{"data-id":"dest-form-test-connection",fullWidth:!0,label:"Test Connection",variant:fe.Secondary,onClick:x})}),h&&t("div",S?{style:{width:"150px"},children:t(me,{"data-id":"dest-form-edit",fullWidth:!0,label:"Edit",rightIcon:Ia,variant:fe.Secondary,onClick:()=>w(!1)})}:{style:{width:"150px"},children:t(me,{"data-id":"dest-form-save",fullWidth:!0,label:"Save Changes",variant:fe.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;g(c.unsavedIdx,{formData:t,testResult:e},o)}}})}),!h&&t("div",{style:{width:"150px"},children:t(me,{"data-id":"dest-form-add",fullWidth:!0,label:"Add Destination",variant:fe.Primary,onClick:async()=>{const{errorMessage:e,preparedFormData:t}=p();if(!e){const e=await x(),o=!!e&&!e.succeeded;m({formData:t,testResult:e},o)}}})})]})]}):t(Oe,{title:"No active form"})});$s.displayName="AddDestinationForm";const Is=[{id:Ve.FilePath,label:"Collect file path",tooltip:"Indicates whether to record the `code.filepath` attribute."},{id:Ve.Function,label:"Collect function",tooltip:"Indicates whether to record the `code.function` attribute."},{id:Ve.LineNumber,label:"Collect line number",tooltip:"Indicates whether to record the `code.lineno` attribute."}],Es=[{id:Ve.Column,label:"Collect column",tooltip:"Indicates whether to record the `code.column` attribute."},{id:Ve.Namespace,label:"Collect namespace",tooltip:"Indicates whether to record the `code.namespace` attribute."},{id:Ve.StackTrace,label:"Collect stacktrace",tooltip:"Indicates whether to record the `code.stacktrace` attribute."}],Ns=["*"],As=[{id:Ge.HttpRequest,label:"Collect HTTP request",tooltip:""},{id:Ge.HttpResponse,label:"Collect HTTP response",tooltip:""},{id:Ge.DbQuery,label:"Collect DB query",tooltip:""},{id:Ge.Messaging,label:"Collect messaging",tooltip:""}],Os={[We.Java]:[new je("","")],[We.Golang]:[new He("")]},Rs={[Ke.CodeAttributes]:({value:a,setValue:l,formErrors:r})=>{const s=r.codeAttributes,c=i(()=>Object.entries(a.codeAttributes||{}).filter(([e,t])=>!!t).map(([e])=>e),[a]);n(()=>{if(!c.length&&!s){const e={[Ve.FilePath]:!0,[Ve.Function]:!0,[Ve.LineNumber]:!0,[Ve.Column]:null,[Ve.Namespace]:null,[Ve.StackTrace]:null};l("codeAttributes",e)}},[]);const d=(e,t)=>{const o=t?[...c,e]:c.filter(t=>t!==e),n=Object.values(Ve).reduce((e,t)=>(e[t]=!!o.includes(t)||null,e),{});l("codeAttributes",n)};return e(o,{children:[e(Q,{$gap:12,children:[t(de,{size:pe.XS,color:ue.Secondary,nowrap:!0,children:"Recommended data to collect"}),t(Q,{$gap:6,children:Is.map(({id:e,label:o,tooltip:n})=>t(Ee,{text:n,withIcon:!0,children:t(te,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(oe,{errorMessage:s})]}),e(Q,{$gap:12,children:[t(de,{size:pe.XS,color:ue.Secondary,nowrap:!0,children:"Verbose data to collect"}),t(Q,{$gap:6,children:Es.map(({id:e,label:o,tooltip:n})=>t(Ee,{text:n,withIcon:!0,children:t(te,{label:o,value:c.includes(e),onChange:t=>d(e,t)})},e))}),t(oe,{errorMessage:s})]})]})},[Ke.CustomInstrumentation]:({value:a,setValue:l,formErrors:r})=>{const s=r.customInstrumentations,c=i(()=>(a?.customInstrumentations?.[We.Golang]||[]).map(e=>new He(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),[a]),d=i(()=>(a?.customInstrumentations?.[We.Java]||[]).map(e=>new je(e.className,e.methodName)),[a]);return n(()=>{a?.customInstrumentations||s||l("customInstrumentations",{[We.Golang]:Os[We.Golang],[We.Java]:Os[We.Java]})},[]),e(o,{children:[e(Q,{children:[e(he,{$gap:8,children:[t(Ea,{}),t(ee,{label:"Golang custom probes"})]}),t(ne,{name:"golangProbes",columns:[{keyName:"packageName",label:"Package name",placeholder:"e.g. github.com/my-org/my-package",tooltip:"The full import path of the package containing the function or method to be instrumented."},{keyName:"functionName",label:"Function name",placeholder:"e.g. myFunction",tooltip:"The name of the function to be instrumented. Leave empty if instrumenting a receiver method."},{keyName:"receiverName",label:"Receiver name",placeholder:"e.g. myReceiver",tooltip:"The name of the receiver type if instrumenting a method. Leave empty if instrumenting a standalone function."},{keyName:"receiverMethodName",label:"Receiver method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented. Leave empty if instrumenting a standalone function."}],values:c,setValues:e=>{const t={};t[We.Golang]=e.map(e=>new He(e.packageName,e.functionName,e.receiverName,e.receiverMethodName)),t[We.Java]=d,l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]}),e(Q,{children:[e(he,{$gap:8,children:[t(Na,{}),t(ee,{label:"Java custom probes"})]}),t(ne,{name:"javaProbes",columns:[{keyName:"className",label:"Class name",placeholder:"e.g. com.example.MyClass",tooltip:"The name of the class to be instrumented."},{keyName:"methodName",label:"Method name",placeholder:"e.g. myMethod",tooltip:"The name of the method to be instrumented."}],values:d,setValues:e=>{const t={};t[We.Golang]=c,t[We.Java]=e.map(e=>new je(e.className,e.methodName)),l("customInstrumentations",t)},errorMessage:s,limitFieldsPerRow:2})]})]})},[Ke.HeadersCollection]:({value:e,setValue:o,formErrors:a})=>{const l=a.headersCollection,r=i(()=>e?.headersCollection?.[Ue.HeaderKeys]||[],[e]),s=e=>{const t={[Ue.HeaderKeys]:e};o("headersCollection",t)};return n(()=>{r.length||l||s(Ns)},[]),t(re,{name:"headerKeys",label:"Header keys",tooltip:"Specify which headers you want to collect",helpMessage:"Asterisk (*) will collect all headers",values:r,setValues:s,errorMessage:l})},[Ke.PayloadCollection]:({value:o,setValue:a,formErrors:l})=>{const r=l.payloadCollection,s=i(()=>Object.entries(o.payloadCollection||{}).filter(([e,t])=>!!t).map(([e])=>e),[o]);return n(()=>{if(!s.length&&!r){const e={[Ge.HttpRequest]:{},[Ge.HttpResponse]:{},[Ge.DbQuery]:{},[Ge.Messaging]:{}};a("payloadCollection",e)}},[]),e(Q,{$gap:12,children:[t(de,{size:pe.XS,color:ue.Secondary,nowrap:!0,children:"Type of data to collect"}),t(Q,{$gap:6,children:As.map(({id:e,label:o,tooltip:n})=>t(Ee,{text:n,withIcon:!0,children:t(te,{label:o,value:s.includes(e),onChange:t=>((e,t)=>{const o=t?[...s,e]:s.filter(t=>t!==e),n={[Ge.HttpRequest]:o.includes(Ge.HttpRequest)?{}:null,[Ge.HttpResponse]:o.includes(Ge.HttpResponse)?{}:null,[Ge.DbQuery]:o.includes(Ge.DbQuery)?{}:null,[Ge.Messaging]:o.includes(Ge.Messaging)?{}:null};a("payloadCollection",n)})(e,t)})},e))}),t(oe,{errorMessage:r})]})},[Ke.UnknownType]:null},Ds=({ruleType:e,value:o,setValue:n,formErrors:i,dynamicFields:a})=>{if(!e)return null;if(a?.length)return t(Cs,{fields:a,value:o,setValue:n,formErrors:i||{},signals:[],seedInitialValues:!0});const l=Rs[e];return l?t(l,{value:o,setValue:n,formErrors:i}):null},Ps=()=>{const o=b(),{isVm:n}=C(),{selectedOption:i,genericForm:a,sourceOptions:l,namespaceOptions:r}=$l();if(!a||!i)return t(Oe,{title:"No active form"});const{formData:s,handleFormChange:c,formErrors:d}=a;return e(Q,{$gap:24,children:[e(he,{$gap:12,$justifyContent:"space-between",children:[t(Re,{size:pe.XXXS,maxLines:2,children:i.description}),e(he,{$gap:12,children:[t(be,{options:[{icon:xa,label:"Enabled",value:!1,selectedBgColor:o.v2.colors.green[800]},{icon:ka,label:"Disabled",value:!0,selectedBgColor:o.v2.colors.red[800]}],size:De.S,selected:s.disabled,setSelected:e=>c("disabled",e)}),t(me,{leftIcon:Ta,variant:fe.Secondary,size:ge.S,onClick:()=>i.docsUrl&&window.open(i.docsUrl,"_blank","noopener noreferrer")})]})]}),t(jl,{option:i,formState:s}),e(he,{$gap:12,children:[t(de,{size:pe.XS,color:ue.Secondary,nowrap:!0,children:"Supported Languages:"}),i.supportedLanguages.map(e=>t(Ye,{label:qe[e],leftIcon:Je(e),backgroundColor:o.v2.colors.purple[900]},e))]}),!n&&t(Wl,{scopes:s.sourceScopes,onChange:e=>c("sourceScopes",e),sourceOptions:l,namespaceOptions:r,supportedLanguages:i.type===Ke.CustomInstrumentation?[]:i.supportedLanguages,dataIdPrefix:"instrumentation-rule",slim:!0}),t(xe,{name:"ruleName",label:"Rule name",placeholder:"Use a name that describes the rule...",value:s.ruleName,onChange:({target:{value:e}})=>c("ruleName",e),errorMessage:d.ruleName}),t(Ds,{ruleType:i.type,dynamicFields:i.fields,value:s,setValue:(e,t)=>c(e,t),formErrors:d}),t(Pe,{name:"notes",label:"Notes",placeholder:"Your personal notes...",value:s.notes,onChange:({target:{value:e}})=>c("notes",e),errorMessage:d.notes})]})},Fs=()=>{const{pendingMerge:e,confirmMerge:o,cancelMerge:n}=Il();if(!e)return null;const{existingName:i,editingName:a}=e;return t(Ze,{isOpen:!0,onClose:n,title:"Merge with existing Data Stream?",description:Qe.DATA_STREAM_MERGE_WARNING(a,i),approveButton:{"data-id":"data-stream-merge-confirm",label:"Merge",variant:fe.Primary,onClick:o},denyButton:{"data-id":"data-stream-merge-cancel",label:"Cancel",variant:fe.Secondary,onClick:n}})},Ls=({autoFocus:o})=>{const{dataStreams:n}=et(),{genericForm:a,excludeName:l,editingName:r}=Il(),{formData:s,formErrors:c,handleFormChange:d}=a,u=s.name,p=i(()=>n.find(e=>e.name===u&&e.name!==l),[n,u,l]);return e(Q,{$width:"100%",$gap:12,children:[t(xe,{name:"data-stream-name",label:Qe.STREAM_NAME,placeholder:Qe.NAME_YOUR_STREAM_PLACEHOLDER,tooltip:Qe.STREAM_DESCRIPTION,required:!0,autoFocus:o,value:u,onChange:e=>d("name",e.target.value),errorMessage:c.name}),p&&t(Fe,{status:Le.Warning,message:Qe.DATA_STREAM_MERGE_WARNING(r,p.name),fullWidth:!0})]})},Ms=()=>{const{selectedStreamName:e}=et(),{genericForm:o}=El();if(!o)return t(Oe,{title:"No active form"});const{formData:n,handleFormChange:i,formErrors:a}=o;return t(xe,{name:"sourceName",label:Qe.NAME,tooltip:"This overrides the default service name (service.name) reported in your telemetry.",placeholder:"Use a name that overrides the source name",value:n.otelServiceName,onChange:({target:{value:t}})=>{i("otelServiceName",t),i("currentStreamName",e)},errorMessage:a.otelServiceName})},_s=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],zs=f.div`
129
+ display: flex;
130
+ flex-direction: column;
131
+ gap: 24px;
132
+ `,Bs=f.div`
133
+ display: contents;
134
+ & > * {
135
+ opacity: ${({$faded:e})=>e?.4:1};
136
+ transition: opacity 0.2s ease;
137
+ }
138
+ `,Xs=({value:e})=>{const o=b();return t(Ye,e?{status:Le.Success,label:rt,leftIcon:xa}:{label:st,leftIcon:ka,backgroundColor:o.v2.colors.silver[500],textColor:o.v2.colors.white[500]})},Vs=({value:e,onChange:o})=>{const n=b(),a=i(()=>[{icon:xa,label:rt,value:!0,selectedBgColor:n.v2.colors.green[800]},{icon:ka,label:st,value:!1,selectedBgColor:n.v2.colors.silver[500]}],[n]);return t(be,{options:a,selected:e,setSelected:o??(()=>{}),disabled:!o})},Us=()=>{const e=Nl();switch(e.formType){case Al.Create:return t(Gs,{category:e.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Vs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})});case Al.View:return e.data?e.isEditing?t(Gs,{category:e.data.category,formData:e.formData,onChange:e.handleChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,renderAction:()=>t(Vs,{value:!e.formData.disabled,onChange:t=>e.handleChange({disabled:!t})})}):t(Hs,{data:e.data,renderAction:()=>t(Xs,{value:!e.data?.rule.disabled})}):null;case Al.EditAutoNoisy:return t(js,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:lt,sectionTitle:nt,sectionSubTitle:at,presetLabel:ot,customInputName:"sampling-auto-input-custom-percentage",percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Vs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Al.EditAutoCostReduction:return t(js,{enabled:e.localEnabled,summary:e.summary,inactiveTitle:it,sectionTitle:nt,presetLabel:ot,customInputName:"sampling-cr-auto-input-custom-percentage",showModeToggle:!1,percentageMode:e.percentageMode,setPercentageMode:e.setPercentageMode,percentagePreset:e.percentagePreset,setPercentagePreset:e.setPercentagePreset,customPercentage:e.customPercentage,setCustomPercentage:e.setCustomPercentage,renderAction:()=>t(Vs,{value:e.localEnabled,onChange:e.setLocalEnabled})});case Al.EditAutoHighlyRelevant:return t(zs,{children:t(Kl,{title:e.localEnabled?void 0:tt,summary:e.summary,renderAction:()=>t(Vs,{value:e.localEnabled,onChange:e.setLocalEnabled})})})}},Gs=({category:o,formData:n,onChange:i,sourceOptions:a,namespaceOptions:l,renderAction:r})=>e(zs,{children:[t(Jl,{category:o,formState:n,renderAction:r}),e(Bs,{$faded:!!n.disabled,children:[t(Zl,{category:o,formState:n,onChange:i}),t(Wl,{scopes:n.sourceScopes,onChange:e=>i({sourceScopes:e}),sourceOptions:a,namespaceOptions:l,titleNumber:1,dataIdPrefix:"sampling"}),t(Ql,{category:o,formState:n,onChange:i}),"highlyRelevant"===o&&t(er,{formState:n,onChange:i}),"highlyRelevant"===o&&t(tr,{ruleType:n.ruleType,formState:n,onChange:i}),t(or,{category:o,formState:n,onChange:i})]})]}),Hs=({data:o,renderAction:n})=>e(zs,{children:[t(Jl,{readOnly:!0,summary:o.summary,renderAction:n}),t(Zl,{readOnly:!0,data:o}),t(Wl,{readOnly:!0,scopes:S(o.rule.sourceScopes)}),t(Ql,{readOnly:!0,data:o}),t(or,{readOnly:!0,data:o}),"highlyRelevant"===o.category&&t(tr,{readOnly:!0,rule:o.rule})]}),js=({enabled:o,summary:n,inactiveTitle:i,sectionTitle:a,sectionSubTitle:r,presetLabel:s,customInputName:c,showModeToggle:d=!0,percentageMode:u,setPercentageMode:p,percentagePreset:h,setPercentagePreset:m,customPercentage:g,setCustomPercentage:f,renderAction:b})=>{const v=l(e=>p(e),[p]),y=l(e=>m(e),[m]),C=l(e=>f(e.target.value),[f]),S=!d||"sample"===u;return e(zs,{children:[t(Kl,{title:o?void 0:i,summary:n,renderAction:b}),t(Bs,{$faded:!o,children:e(ct,{richTitle:{title:a,subTitle:r},children:[d&&t(Q,{$alignItems:"flex-start",children:t(be,{options:_s,selected:u,setSelected:v})}),S&&t(Yl,{description:s,options:ql,selected:h,onSelect:y,customName:c,customLabel:dt,customPlaceholder:"5%",customValue:g,onCustomChange:C})]})})]})},Ws=f.div`
139
+ display: flex;
140
+ align-items: center;
141
+ justify-content: space-between;
142
+ gap: 12px;
143
+ padding: 8px 12px;
144
+ border-radius: 12px;
145
+ background-color: ${({$isSelected:e,$purpleColors:t,theme:o})=>e?t?o.v2.colors.purple[800]:o.v2.colors.silver[600]:t?o.v2.colors.purple[900]:"transparent"};
146
+ cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
147
+ opacity: ${({$disabled:e})=>e?.5:1};
148
+ &:hover {
149
+ background-color: ${({$isSelected:e,$purpleColors:t,theme:o})=>o.v2.colors[t?"purple":"silver"][e?"700":"800"]};
150
+ }
151
+ `,Ks=f.div`
152
+ display: flex;
153
+ align-items: center;
154
+ justify-content: center;
155
+ padding: 8px;
156
+ border-radius: 8px;
157
+ background-color: ${({theme:e})=>e.v2.colors.white[500]+ut["004"]};
158
+ `,Ys=({dataId:o,icon:n,title:i,description:a,withCarret:l,purpleColors:r,disabled:s,children:c,isSelected:d,onClick:u,isChecked:p,isPartiallyChecked:h,onCheckboxChange:m})=>e(Ws,{"data-id":o||`list-item-${i}`,$isSelected:d,$purpleColors:r,$disabled:s,onClick:()=>!d&&!s&&u(),children:[e(Q,{$gap:4,children:[e(he,{$gap:12,children:[m&&t(te,{partiallyChecked:h||!1,value:p||!1,onChange:e=>m(e)}),n&&t(Ks,{children:t(n,{size:20})}),t(de,{size:pe.XS,children:i})]}),a&&t(de,{size:pe.XXXS,color:ue.Secondary,children:a})]}),(l||c)&&e(he,{$gap:8,children:[c,l&&t(Aa,{size:18})]})]}),qs=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:l})=>{const{actionsApi:s}=kl(),{platformType:c,version:d}=C(),[u,p]=r(""),h=a(null),{selectedOption:m,onSelectOption:g,genericForm:f,validateFormData:b}=xl(),{options:v,loading:y}=s.useActionTypes(),S=i(()=>v.length?v:pt(c,d),[v,c,d]),w=i(()=>(u?S.filter(e=>e?.label?.toLowerCase().includes(u.toLowerCase())):S).filter(e=>!!e),[S,u]),x=i(()=>y?[t(ht,{$padding:"8px 12px",children:t(mt,{size:6})},"loading")]:w.map(e=>{const o=m?.type===e.type;return t(Ys,{dataId:e.type?`option-${e.type}`:void 0,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{h.current?.clearErrors(),g(e)}},e.type)}),[y,m?.type,w,g]),k=i(()=>y?[t(ht,{$padding:"8px 12px",children:t(mt,{size:4})},"loading")]:m?[t(xs,{},m.type)]:[t(gt,{$height:"100%",children:t(Oe,{icon:Oa,title:"Action not selected",subTitle:"Please select an action to add"})},"no-data")],[y,m]);return t(nr,{ref:h,isOpen:!0,withOverlay:l,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=b();if(e)return!1;await s.create(t)},disableSave:!m||!f?.isFormDirty,isFormDirty:f?.isFormDirty,hideDirtyNote:!0,progress:{title:Qe.CREATING_ACTION,subTitle:Qe.CREATING_ACTION_SUBTITLE},header:{icon:Oa,title:Qe.ADD_ACTION,subTitle:Qe.ADD_ACTION_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:u,onChange:p},leftColumn:{width:"40%",list:x},rightColumn:{width:"60%",list:k}})},Js=({destinationsByCategory:n,filters:a,setFilters:l})=>{const r=i(()=>Object.values(ft).map(e=>({id:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()})).filter(e=>n[e.id]?.length),[n]),s=i(()=>{const e=Object.values(_e).map(e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}));return e.unshift({value:null,label:"All"}),e},[]);return e(o,{children:[t(bt,{placeholder:"Select category",options:r,values:a.categoryType?[a.categoryType]:[],setValues:e=>l({...a,categoryType:a.categoryType===e[0]?null:e[0]})}),t(be,{options:s,selected:a.signalType,setSelected:e=>l({...a,signalType:e})})]})},Zs=f.div`
159
+ display: flex;
160
+ flex-direction: column;
161
+ padding: 8px;
162
+ border-radius: 16px;
163
+ border: ${({$purpleColors:e,theme:t})=>e?`1px solid ${t.v2.colors.purple[500]}`:"1px solid transparent"};
164
+ background-color: ${({$noBgColor:e,$purpleColors:t,theme:o})=>e?"transparent":t?o.v2.colors.purple[900]:o.v2.colors.silver[800]};
165
+ `,Qs=f.div`
166
+ display: flex;
167
+ align-items: center;
168
+ justify-content: space-between;
169
+ gap: 12px;
170
+ padding: ${({$isOpen:e})=>e?"2px 12px 8px 12px":"2px 12px"};
171
+ `,ec=({title:o,tooltip:n,list:i,noBgColor:a,purpleColors:l})=>{const[s,c]=r(!0);return e(Zs,{"data-id":`collapse-${o}`,$noBgColor:a,$purpleColors:l,children:[e(Qs,{$isOpen:s,children:[e(he,{$gap:10,children:[t(de,{size:pe.XS,children:o}),n&&t(Ee,{text:n,withIcon:!0}),t(Ye,{label:i.length,status:l?Le.Default:void 0})]}),t(vt,{icon:s?Da:Pa,size:yt.M,onClick:()=>c(e=>!e)})]}),s?t(Q,{children:i.length?u.toArray(i):t(gt,{$padding:"12px 0",children:t(Oe,{})})}):null]})},tc=(e,t,o)=>t||o.signalType?e.filter(e=>e.displayName.toLowerCase().includes(t.toLowerCase())&&(!o.signalType||Be(e.supportedSignals).includes(o.signalType))):e,oc=({option:e,formData:o,testResult:n,isSelected:i,onSelect:a})=>t(Ys,{icon:wt(e.type).icon,title:o?.name||e.displayName,withCarret:!0,purpleColors:!!o,isSelected:i,onClick:()=>a(),children:n&&t(Ye,{status:n.succeeded?Le.Success:Le.Error,leftIcon:n.succeeded?Fa:La})}),nc=({listType:e,destinationOptions:o,unsavedDestinations:n})=>{const{activeForm:i,onChangeActiveForm:a}=Tl();return o?.length?t(ec,{title:St[e].TITLE,tooltip:St[e].DESCRIPTION,list:o.map((o,n)=>t(oc,{option:o,isSelected:i?.listType===e&&"number"!=typeof i?.unsavedIdx&&(null!=o.id&&""!==o.id?i?.option.id===o.id:i?.option.type===o.type),onSelect:()=>a({listType:e,option:o})},`${e}-${o.id??o.type}-${n}`))}):n?.length?t(ec,{purpleColors:!0,title:St[e].TITLE,tooltip:St[e].DESCRIPTION,list:n.map(({option:o,formData:n,testResult:l},r)=>t(oc,{option:o,formData:n,testResult:l,isSelected:i?.unsavedIdx===r&&i?.listType===e,onSelect:()=>a({listType:e,option:o,unsavedIdx:r})},`${e}-${r}`))},e):void 0};var ic;(e=>{e.SELF_HOSTED="self hosted",e.MANAGED="managed"})(ic||(ic={}));const ac=(e,t)=>{const o=[],n=[],i=[];return e&&e.destinationCategories.categories.forEach(e=>{e.name===ic.SELF_HOSTED?n.push(...e.items):e.name===ic.MANAGED&&i.push(...e.items)}),t&&t?.potentialDestinations.forEach(t=>{for(const n of e?.destinationCategories?.categories||[]){const e=xt(n),i=e.items.findIndex(e=>e.type===t.type);if(-1!==i){const n=Ie(t.fields,{});Object.keys(n).length&&(e.items[i].fields=e.items[i].fields.map(e=>({...e,initialValue:n[e.name]})),o.push(e.items[i]))}}}),{[ft.DETECTED]:o,[ft.SELF_HOSTED]:n,[ft.MANAGED]:i}},lc=({onClose:e,onBack:o,onNext:a,selectedConnectionIds:s,setSelectedConnectionIds:c,initialInputs:d,withOverlay:u,disableAnimation:p})=>{const{destinationsApi:h}=kl(),[m,g]=r(""),[f,b]=r({categoryType:null,signalType:null}),{items:v}=h.useDestinations(),{data:y,loading:C}=h.useDestinationCategories(),{data:S,loading:w}=h.usePotentialDestinations(),{activeForm:x,genericForm:k,unsavedDestinations:T,setUnsavedDestinations:$}=Tl();n(()=>{d&&$(d)},[d]);const I=C||w,E=i(()=>y?.destinationCategories?.categories??[],[y]),[N,A]=r({[ft.ALL]:[],[ft.UNSAVED]:[],[ft.EXISTS]:[],[ft.DETECTED]:[],[ft.SELF_HOSTED]:[],[ft.MANAGED]:[]});n(()=>{const e=v.map(e=>{let t;for(const o of E){const n=o.items.find(t=>t.type===e.destinationType.type);if(n){t=n;break}}const o=Ie(e.fields,{});return{id:e.id,type:e.destinationType.type,displayName:e.name||e.destinationType.displayName,selected:!0,testConnectionSupported:t?.testConnectionSupported??!1,supportedSignals:e.destinationType.supportedSignals,fields:t?t.fields.map(e=>({...e,initialValue:o[e.name]??e.initialValue})):[]}});A(t=>({...t,[ft.EXISTS]:e}))},[v,E]),n(()=>{(y||S)&&A(e=>({...e,...ac(y,S)}))},[y,S]);const O=l(async()=>{for(const{option:e,formData:t}of T){const o=Xe(t);if(e.id){const t=Object.fromEntries(e.fields.map(e=>[e.name,e.initialValue??""])),n=Object.fromEntries(o.fields.map(e=>[e.key,e.value??""]));if(!Object.keys(t).some(e=>t[e]!==n[e])){await h.update(e.id,o);continue}}await h.create(o)}},[T,h]),R=(({isFetching:e,destinationsByCategory:o,searchText:n,filters:a})=>{const{unsavedDestinations:l}=Tl();return{width:"40%",list:i(()=>{const i=[];l.length&&i.push(t(nc,{listType:ft.UNSAVED,unsavedDestinations:l},"unsaved"));for(const e of Object.values(ft)){if(a.categoryType&&a.categoryType!==e)continue;const l=tc(o[e],n,a);l.length&&i.push(t(nc,{listType:e,destinationOptions:l},e))}return e&&i.push(t(gt,{$height:"100%",children:t(Ct,{title:"Fetching destinations",withSpinner:!0})},"loading-more")),i},[l,o,n,a,e])}})({isFetching:I,destinationsByCategory:N,searchText:m,filters:f}),D=(()=>{const{activeForm:e}=Tl();return{width:"60%",list:e?[t($s,{},e.option.type)]:[t(gt,{$height:"100%",children:t(Oe,{icon:Ra,title:"Select destination from the list",subTitle:"Add destination so your data has somewhere to go."})},"no-data")]}})();return t(nr,{isOpen:!0,withOverlay:u,disableAnimation:p,onClose:e,onBack:o?()=>o(T):void 0,onNext:a?()=>a(T):void 0,nextIsSkip:!T.length,onSave:O,disableSave:!x&&!T.length,isFetching:I,isFormDirty:T.length>0||k?.isFormDirty,hideDirtyNote:!0,progress:{title:Qe.CREATING_DESTINATION,subTitle:Qe.CREATING_DESTINATION_SUBTITLE},header:{icon:Ra,title:Qe.ADD_DESTINATIONS,subTitle:Qe.ADD_DESTINATION_DRAWER_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:m,onChange:g},filters:t(Js,{destinationsByCategory:N,filters:f,setFilters:b}),leftColumn:R,rightColumn:D})},rc=({onClose:e,selectedConnectionIds:o,setSelectedConnectionIds:n,withOverlay:l})=>{const{instrumentationRulesApi:s}=kl(),[c,d]=r(""),u=a(null),{selectedOption:p,onSelectOption:h,genericForm:m,validateFormData:g}=$l(),{options:f,loading:b}=s.useRuleTypes(),v=i(()=>f.length?f:kt,[f]),y=i(()=>c?v.filter(e=>e.label.toLowerCase().includes(c.toLowerCase())):v,[v,c]),C=i(()=>b?[t(ht,{$padding:"8px 12px",children:t(mt,{size:4})},"loading")]:y.map(e=>{const o=p?.type===e.type;return t(Ys,{dataId:`option-${e.type}`,title:e.label,description:e.description,withCarret:!0,isSelected:o,onClick:()=>{u.current?.clearErrors(),h(e)}},e.type)}),[b,p?.type,y,h]),S=i(()=>b?[t(ht,{$padding:"8px 12px",children:t(mt,{size:4})},"loading")]:p?[t(Ps,{},p.type)]:[t(gt,{$height:"100%",children:t(Oe,{icon:Ma,title:"Instrumentation rule not selected",subTitle:"Please select an instrumentation rule to add"})},"no-data")],[b,p]);return t(nr,{ref:u,isOpen:!0,withOverlay:l,onClose:e,onSave:async()=>{const{errorMessage:e,preparedFormData:t}=g();if(e)return!1;await s.create(t,p?.type)},disableSave:!p||!m?.isFormDirty,isFormDirty:m?.isFormDirty,hideDirtyNote:!0,progress:{title:Qe.CREATING_INSTRUMENTATION_RULE,subTitle:Qe.CREATING_INSTRUMENTATION_RULE_SUBTITLE},header:{icon:Ma,title:Qe.ADD_INSTRUMENTATION_RULE,subTitle:Qe.ADD_INSTRUMENTATION_RULE_DESCRIPTION},connectionIds:o&&n?{value:o,setValue:n}:void 0,search:{value:c,onChange:d},leftColumn:{width:"40%",list:C},rightColumn:{width:"60%",list:S}})},sc={groupSegmentLabel:"Namespace",itemSegmentLabel:"Source",searchPlaceholder:()=>{},groupColumnHeader:"Namespaces",fetchingGroups:{title:Qe.FETCHING_NAMESPACES,subTitle:Qe.FETCHING_NAMESPACES_SUBTITLE},noGroups:{title:"No namespaces",subTitle:"No namespaces found in this cluster"},noGroupMatchedFilter:e=>`No namespace matched the filter '${e}'`,itemColumnHeader:"Workloads",selectGroupPrompt:{title:Qe.SELECT_NAMESPACE,subTitle:Qe.SELECT_NAMESPACE_SUBTITLE},noItemsInGroupSubTitle:"No sources found in this namespace"},cc={groupSegmentLabel:"Kind",itemSegmentLabel:"Source",searchPlaceholder:e=>"Search by "+(e===Tt.Namespace?"kind":"source"),groupColumnHeader:"Kinds",fetchingGroups:{title:"Fetching kinds",subTitle:"Please wait while we fetch the kinds"},noGroups:{title:"No kinds",subTitle:"No kinds found on this host"},noGroupMatchedFilter:e=>`No kind matched the filter '${e}'`,itemColumnHeader:"Sources",selectGroupPrompt:{title:"Select kind from the list",subTitle:"Pick a kind so you can select sources from it."},noItemsInGroupSubTitle:"No sources found in this kind"},dc=e=>e?cc:sc,uc="No matches",pc=e=>(e?"Unselect":"Select")+" all",hc="Selected",mc=f.div``,gc=f.div`
172
+ visibility: hidden;
173
+
174
+ transition: visibility 0s;
175
+ & * {
176
+ transition-duration: 0s;
177
+ }
178
+
179
+ ${mc}:hover & {
180
+ visibility: visible;
181
+ }
182
+ `,fc=({workloadName:e,workloadKind:o,isChecked:n,onToggle:i,disabled:a})=>{const l=b(),r=()=>{};return t(mc,{children:t(Ys,{dataId:`source-${e}`,title:e,disabled:a,onClick:a?r:i,isChecked:n,onCheckboxChange:a?r:i,children:a?t(Ee,{text:"Static pods can only be instrumented with Odigos Enterprise.",children:t(Ye,{label:"Enterprise only",status:Le.Default,textSize:pe.XXXS})}):t(gc,{children:t(Ye,{label:o,status:Le.Info,textSize:pe.XXXS,backgroundColor:l.v2.colors.blue[900]})})})})},bc=f.div``,vc=f.div`
183
+ visibility: ${({$visible:e})=>e?"visible":"hidden"};
184
+
185
+ transition: visibility 0s;
186
+ ${({$visible:e})=>!e&&"& * {\n transition-duration: 0s !important;\n }"}
187
+
188
+ ${bc}:hover & {
189
+ visibility: visible;
190
+ }
191
+ `,yc=({clusterId:o,namespaceName:n,checkbox:i,isFutureApps:a,selectedCounts:l,isActive:r,onActive:s,handleSourceChange:c})=>{const{isVm:d}=C(),u=e=>{s(),c({clusterId:o,workloadId:{namespace:n},auto:e.auto,selected:e.all})};return t(bc,{children:t(Ys,{dataId:`namespace-${n}`,withCarret:!0,title:n,isSelected:r,onClick:s,isPartiallyChecked:i.partial,isChecked:i.all,onCheckboxChange:e=>u({auto:e,all:e}),children:e(he,{$gap:12,children:[!d&&t(vc,{$visible:r||a,children:t(Ee,{text:"Automatically instrument all workloads currently in the namespace, and all workloads that will be deployed to this namespace in the future",children:t(ae,{label:"Auto",labelAlign:le.Left,size:It.S,value:a,onChange:e=>u({auto:e,all:e||void 0})})})}),e(he,{$gap:8,children:[t(de,{variant:Et.Span,size:pe.XXXS,color:ue.Secondary,align:"right",children:hc}),t(Ye,{label:`${l.sourced}/${l.total}`,status:r?Le.Default:Le.Unknown,minWidth:"42px"})]})]})})})},Cc=({withCollapse:e,clusterId:o,clusterName:n,namespaces:a,selectedArea:l,setSelectedArea:r,handleSourceChange:s})=>{const c=i(()=>a.map(({name:e,totalWorkloads:i,selectedCount:a,isAllSourced:c,isSomeSourced:d,isFutureApps:u})=>t(yc,{clusterId:o,namespaceName:e,isFutureApps:u,checkbox:{all:c||u,partial:d},selectedCounts:{sourced:a,total:i},isActive:l.clusterId===o&&l.namespaceName===e,onActive:()=>r({clusterId:o,clusterName:n,namespaceName:e}),handleSourceChange:s},`${o}#${e}`)),[o,n,a,l]);return e?t(ec,{title:n,list:c,noBgColor:!0}):c},Sc=({onClose:o,onBack:a,onNext:l,selectedConnectionIds:s,setSelectedConnectionIds:c,withOverlay:d,disableAnimation:u})=>{const{isVm:p}=C(),{sourcesApi:h,snapshotsApi:m,namespacesApi:g}=kl(),{data:f,loading:b,refetch:v}=m.useSnapshots(),{items:y,loading:S,refetch:w}=g.useNamespaces(),x=dc(p),{selectedStreamName:k}=et(),{progress:T,resetProgress:$}=Nt(),{isFetching:I,setIsFetching:E,setSnapshots:N,formData:A,handleSourceChange:O,handleSelectAll:R,formDiff:D,isFormDirty:P}=Fl();n(()=>{v(),w()},[]);const F=i(()=>{if(f)return f;const e=y;return e.length?{clusters:[{clusterId:Ot,clusterName:At,namespaces:e.map(e=>({name:e.name,selected:e.markedForInstrumentation&&e.dataStreamNames.includes(k),workloads:e.workloads?.map(e=>({namespace:e.id.namespace,name:e.id.name,kind:e.id.kind,selected:(e.markedForInstrumentation?.markedForInstrumentation??!1)&&(e.dataStreamNames?.includes(k)??!1)}))||[]}))}]}:null},[f,y,k]);n(()=>{E(b||S),F&&N(F)},[F,b,S,E,N]);const[L,M]=r(""),[_,z]=r(Tt.Namespace),[B,X]=r({showOnlySelected:!1}),[V,U]=r({clusterId:"",clusterName:"",namespaceName:""}),G=(({isFetching:o,formData:n,handleSourceChange:a,handleSelectAll:l,selectedArea:r,setSelectedArea:s,searchText:c,searchBy:d,filters:u})=>{const{isVm:p}=C(),h=dc(p),m=i(()=>n.map(e=>{const t=[...e.namespaces].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Dl(e,c,u)).map(e=>({name:e.name,totalWorkloads:e.workloads.length,...Pl(e)}));return{clusterId:e.clusterId,clusterName:e.clusterName,visibleNamespaces:t}}),[n,c,u]),g=i(()=>{let e=!1;for(const{visibleNamespaces:t}of m)for(const{totalWorkloads:o,selectedCount:n}of t)if(e=!0,n!==o)return!1;return e},[m]),{list:f,withFilterCount:b,filteredCount:v,totalCount:y}=i(()=>{const e=m.map(({clusterId:e,clusterName:o,visibleNamespaces:n})=>n.length?t(Cc,{withCollapse:m.length>1,clusterId:e,clusterName:o,namespaces:n,selectedArea:r,setSelectedArea:s,handleSourceChange:a},e):null).filter(e=>null!==e),o=m.reduce((e,{visibleNamespaces:t})=>e+t.length,0),i=n.reduce((e,{namespaces:t})=>e+t.length,0);return{list:e,withFilterCount:o!==i,filteredCount:o,totalCount:i}},[m,n,r]);return{width:"60%",header:e(he,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(he,{$gap:8,children:[t(de,{size:pe.XS,nowrap:!0,children:h.groupColumnHeader}),t(Ee,{text:b?Qe.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ye,{label:`${b?`${v} / ${y}`:y}`,status:Le.Unknown})})]}),t(de,{"data-id":"namespaces-select-all",onClick:()=>l({boolean:!g,searchText:c,searchBy:d,filters:u}),disabled:!f.length,size:pe.XS,children:pc(g)})]}),list:f.length?f:o?[t(gt,{$height:"100%",children:t(Ct,{title:h.fetchingGroups.title,subTitle:h.fetchingGroups.subTitle,withSpinner:!0})},"loading")]:[t(gt,{$height:"100%",children:t(Oe,c?{icon:za,title:uc,subTitle:h.noGroupMatchedFilter(c)}:{icon:za,title:h.noGroups.title,subTitle:h.noGroups.subTitle})},"no-data")]}})({isFetching:I,formData:A,handleSourceChange:O,handleSelectAll:R,selectedArea:V,setSelectedArea:U,searchText:_===Tt.Namespace?L:"",searchBy:_,filters:B}),H=(({formData:o,handleSourceChange:n,handleSelectAll:a,selectedArea:l,searchText:r,searchBy:s,filters:c})=>{const{tier:d,isVm:u}=C(),p=dc(u),h=d===$t.Onprem,m=i(()=>l.value.namespaceName?o.find(({clusterId:e})=>e===l.value.clusterId)?.namespaces.find(({name:e})=>e===l.value.namespaceName):void 0,[o,l.value.clusterId,l.value.namespaceName]),g=i(()=>m?[...m.workloads].sort((e,t)=>e.name.localeCompare(t.name)).filter(e=>Ol(e,r,c)):[],[m,r,c]),f=i(()=>!!g.length&&g.every(({selected:e})=>e),[g]),b=i(()=>{if(!m)return[];const{clusterId:e}=l.value,{name:o}=m;return g.map(({name:i,selected:a,kind:l})=>{const r=!u&&!h&&Rl.has(l);return t(fc,{workloadName:i,workloadKind:l,isChecked:!r&&(a||!1),onToggle:()=>n({clusterId:e,workloadId:{namespace:o,name:i,kind:l}}),disabled:r},`${e}#${o}#${i}#${l}`)})},[g,m,l.value.clusterId]),{withFilterCount:v,filteredCount:y,totalCount:S}=i(()=>{const e=m?.workloads.length??0;return{withFilterCount:g.length!==e,filteredCount:g.length,totalCount:e}},[g,m]);return{width:"40%",header:e(he,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(he,{$gap:8,children:[t(de,{size:pe.XS,nowrap:!0,children:l.value.namespaceName?`${l.value.namespaceName} > ${p.itemColumnHeader}`:p.itemColumnHeader}),t(Ee,{text:v?Qe.FILTERED_COUNT_TOOLTIP:void 0,children:t(Ye,{label:`${v?`${y} / ${S}`:S}`,status:Le.Unknown})})]}),t(de,{"data-id":"workloads-select-all",onClick:()=>a({clusterId:l.value.clusterId,namespaceName:l.value.namespaceName,boolean:!f,searchText:r,searchBy:s,filters:c}),disabled:!b.length,size:pe.XS,children:pc(f)})]}),list:b.length?b:[t(gt,{$height:"100%",children:t(Oe,m?r?{icon:_a,title:uc,subTitle:(w=r,`No sources matched the filter '${w}'`)}:{icon:_a,title:"No sources",subTitle:p.noItemsInGroupSubTitle}:{icon:_a,title:p.selectGroupPrompt.title,subTitle:p.selectGroupPrompt.subTitle})},"no-data")]};var w})({formData:A,handleSourceChange:O,handleSelectAll:R,selectedArea:{value:V},searchText:_===Tt.Source?L:"",searchBy:_,filters:B});return t(nr,{isOpen:!0,withOverlay:d,disableAnimation:u,onClose:o?()=>{$(Rt.BulkInstrumenting),o()}:void 0,onBack:a?()=>a(D):void 0,onNext:l?()=>l(D):void 0,nextIsSkip:!P,onSave:()=>h.persistV2(D),header:{icon:_a,title:Qe.ADD_SOURCE,subTitle:Qe.ADD_SOURCES_DESCRIPTION},connectionIds:s&&c?{value:s,setValue:c}:void 0,search:{value:L,onChange:e=>{M(e),_===Tt.Namespace&&U({clusterId:"",clusterName:"",namespaceName:""})},placeholder:x.searchPlaceholder(_),segment:{options:[{label:x.groupSegmentLabel,value:Tt.Namespace},{label:x.itemSegmentLabel,value:Tt.Source}],selected:_,setSelected:z}},filters:e(he,{$gap:8,children:[t(de,{size:pe.XXXS,color:ue.Secondary,nowrap:!0,children:"Show only:"}),t(ae,{name:"filter-selected",size:It.S,label:hc,value:B.showOnlySelected,onChange:e=>X(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:P,isFetching:I,progress:{title:Qe.CREATING_SOURCES,subTitle:Qe.CREATING_SOURCES_SUBTITLE,percentage:T[Rt.BulkInstrumenting]?.percentage||0},leftColumn:G,rightColumn:H})},wc=(e,t)=>{const o=[{id:"type",title:Qe.TYPE,label:t.label},{id:"status",title:Qe.STATUS,badge:{status:e.disabled?Le.Unknown:Le.Success,label:e.disabled?Qe.DISABLED:Qe.ENABLED}}],n=e.signals?.map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return n&&o.push({id:"signals",title:Qe.SIGNALS_FOR_PROCESSING,label:n}),e.name&&o.push({id:"name",title:Qe.NAME,label:e.name}),e.notes&&o.push({id:"notes",title:Qe.NOTES,label:e.notes}),o},xc=({onClose:a,actionId:s})=>{const c=b(),{isVm:d}=C(),{actionsApi:u}=kl(),{items:p,refetch:h}=u.useActions(),{options:m}=u.useActionTypes(),{selectedOption:g,loadAction:f,validateFormData:v,genericForm:y}=xl();n(()=>{h()},[]);const[S,w]=r(!1),[x,k]=r(!1),[T,$]=r(null),I=S&&!!y?.isFormDirty,E=i(()=>p?.find(e=>Dt(e)===s),[s,p]),N=i(()=>m.find(({type:e})=>e===E?.type)??Pt.find(({type:e})=>e===E?.type)??null,[m,E?.type]);n(()=>{E&&f(E,N)},[E,N]);const A=l(()=>{E&&w(!0)},[E]),O=l(()=>{E&&(f(E,N),w(!1))},[E,N,f]),R=l(()=>{I?$("close"):a()},[I,a]),D=l(()=>{I?$("cancel"):O()},[I,O]),P=l(()=>{const e=T;$(null),"close"===e?(O(),a()):O()},[T,O,a]),F=l(async()=>{if(E){const{errorMessage:e,preparedFormData:t}=v();e||(await u.update(E.id,t),w(!1))}},[E,v,u]),L=l(()=>{E&&k(!0)},[E]),M=l(async()=>{E&&(await u.remove(E.id,E.type),a())},[E,u,a]);if(!E||!N)return null;const _=(e=>{const t=[],{type:o,fields:n}=e,i=e=>({status:e?Le.Success:Le.Unknown,label:e?"True":"False",invertColors:!0});if(o===Ae.K8sAttributes&&(t.push({id:"collectContainerAttributes",title:"Collect Container Attributes",badge:i(n.collectContainerAttributes)}),t.push({id:"collectReplicaSetAttributes",title:"Collect ReplicaSet Attributes",badge:i(n.collectReplicaSetAttributes)}),t.push({id:"collectWorkloadId",title:"Collect Workload ID",badge:i(n.collectWorkloadId)}),t.push({id:"collectClusterId",title:"Collect Cluster ID",badge:i(n.collectClusterId)}),n.labelsAttributes?.forEach(({labelKey:e,attributeKey:o,from:i,fromSources:a},l)=>{const r=a?.length?a.join(", "):i||ie.Pod,s=(n.labelsAttributes?.length??0)>1?`Label #${l+1} `:"Label ";t.push({id:`label-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`label-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`label-${l}-from`,title:`${s}From`,label:r})}),n.annotationsAttributes?.forEach(({annotationKey:e,attributeKey:o,from:i,fromSources:a},l)=>{const r=a?.length?a.join(", "):i||ie.Pod,s=(n.annotationsAttributes?.length??0)>1?`Annotation #${l+1} `:"Annotation ";t.push({id:`annotation-${l}-key`,title:`${s}Key`,label:e}),t.push({id:`annotation-${l}-attr`,title:`${s}Attribute Key`,label:o}),t.push({id:`annotation-${l}-from`,title:`${s}From`,label:r})})),o===Ae.AddClusterInfo&&(t.push({id:"overwriteExistingValues",title:"Overwrite Existing Values",badge:i(n.overwriteExistingValues)}),n.clusterAttributes?.forEach(({attributeName:e,attributeStringValue:o},n)=>{t.push({id:`cluster-attr-${n}`,title:e,label:o})})),o===Ae.DeleteAttributes&&n.attributeNamesToDelete?.forEach((e,o)=>{t.push({id:`del-attr-${o}`,title:"Attribute"+((n.attributeNamesToDelete?.length??0)>1?` #${o+1}`:""),label:e})}),o===Ae.RenameAttributes&&Object.entries(n.renames||{}).forEach(([e,o],n)=>{t.push({id:`rename-${n}`,title:e,label:o})}),o===Ae.PiiMasking&&n.piiCategories?.forEach((e,o)=>{t.push({id:`pii-${o}`,title:"Category"+((n.piiCategories?.length??0)>1?` #${o+1}`:""),label:e})}),o===Ae.ExtractAttribute){const e=n.extractAttribute?.extractions??[];e.forEach(({targetAttributeName:o,lookupKey:n,dataFormat:i,regex:a},l)=>{const r=e.length>1?`Extraction #${l+1} `:"Extraction ";t.push({id:`extract-${l}-target`,title:`${r}New Attribute Name`,label:o||"-"}),n&&t.push({id:`extract-${l}-lookupKey`,title:`${r}Lookup Key`,label:n}),i&&t.push({id:`extract-${l}-format`,title:`${r}Data Format`,label:i}),a&&t.push({id:`extract-${l}-regex`,title:`${r}Regex`,label:a})})}return o===Ae.URLTemplatization&&n.urlTemplatizationRulesGroups?.forEach((e,o)=>{const i=(n.urlTemplatizationRulesGroups?.length??0)>1?`Group #${o+1} `:"Group ";e.filterK8sNamespace&&t.push({id:`group-${o}-ns`,title:`${i}Namespace`,label:e.filterK8sNamespace}),e.workloadFilters?.forEach((n,a)=>{const l=[n.kind,n.name].filter(Boolean).join("/");l&&t.push({id:`group-${o}-wf-${a}`,title:`${i}Workload${(e.workloadFilters?.length??0)>1?` #${a+1}`:""}`,label:l})});const a=e.templatizationRules?.map(e=>e.template).filter(Boolean).join(", ");a&&t.push({id:`group-${o}-templates`,title:`${i}Templates`,label:a}),e.notes&&t.push({id:`group-${o}-notes`,title:`${i}Notes`,label:e.notes})}),t})(E);return e(o,{children:[t(se,{isOpen:!0,header:{icon:_t(E.type),title:N.label,onClose:R,actions:[{id:"edit-action-btn-edit",label:Ft.EDIT,icon:Ia,active:S,onClick:A},{id:"edit-action-btn-delete",label:Ft.DELETE,icon:Ca,color:c.v2.colors.red[500],active:x,onClick:L}]},footer:{actions:S?[{"data-id":"edit-action-btn-cancel",label:Ft.CANCEL,variant:fe.Secondary,onClick:D},{"data-id":"edit-action-btn-save",label:Ft.SAVE,variant:fe.Primary,onClick:F}]:[]},children:t(ht,{$padding:"4px 12px 12px",children:S&&g?t(xs,{}):t(Q,{$gap:16,children:e(Lt,{bgTint:"1000",children:[e(Lt,{bgTint:"900",children:[!d&&t(Mt,{conditions:E.conditions||[]}),t(Lt,{bgTint:"800",cellsPerRow:2,items:wc(E,N)})]}),!!_?.length&&t(Lt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Lt,{bgTint:"800",cellsPerRow:2,items:_})})]})})})}),t(ir,{target:"action",isOpen:x,onClose:()=>k(!1),onApprove:M}),t(ar,{isOpen:null!==T,onClose:()=>$(null),onApprove:P})]})},kc=({onClose:o,connections:l,selectedConnectionIds:s,setSelectedConnectionIds:c})=>{const{configApi:d}=kl(),[u,p]=r(""),[h,m]=r({showOnlySelected:!1}),g=i(()=>l.filter(e=>{const t=!u||e.name.toLowerCase().includes(u.toLowerCase()),o=!h.showOnlySelected||h.showOnlySelected&&s.includes(e.id);return t&&o}),[l.length,s.length,u,h]),f=e=>{c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},b=1===s.length?s[0]:void 0,{data:v,loading:y}=d.useEffectiveConfig(b?{id:b}:void 0,{skip:!b}),C=i(()=>{if(b&&v)return{rollout:{automaticRolloutDisabled:v.rollout?.automaticRolloutDisabled??!1}}},[b,v]),{formData:S,handleFormChange:w,areFormValuesEqual:x,resetFormData:k}=zt(C||{rollout:{automaticRolloutDisabled:!1}}),T=a(k);T.current=k,n(()=>{C&&T.current(C)},[C]);const $=i(()=>s.length>1||void 0!==C&&!x(C,S),[s.length,C,S]);return t(nr,{isOpen:!0,onClose:o,onSave:async()=>await(d.applyConfigurations?.(S,s))??void 0,header:{icon:Ba,title:"Cluster Configuration"},connectionIds:{value:s,setValue:c},search:{placeholder:"Search by cluster name",value:u,onChange:p},filters:e(he,{$gap:8,children:[t(de,{size:pe.XXXS,color:ue.Secondary,nowrap:!0,children:"Show only:"}),t(ae,{size:It.S,label:"Selected",value:h.showOnlySelected,onChange:e=>m(t=>({...t,showOnlySelected:e}))})]}),isFormDirty:$,isFetching:y,leftColumn:{width:"35%",header:e(he,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(he,{$gap:8,children:[t(de,{size:pe.XS,children:"Clusters"}),t(Ye,{label:g.length,status:Le.Unknown})]}),e(he,{$gap:8,children:[t(de,{size:pe.XXXS,color:ue.Secondary,align:"right",children:"Selected clusters"}),t(Ye,{label:`${s.length}/${g.length}`,status:Le.Unknown})]})]}),list:g.map(e=>t(Ys,{title:e.name,isChecked:s.includes(e.id),onClick:()=>f(e.id),onCheckboxChange:()=>f(e.id)},e.id))},rightColumn:{width:"65%",header:t(de,{size:pe.XS,children:"Configurations"}),list:[t(ae,{label:"Automatic rollout disabled",tooltip:"Odigos automatically triggers a one-time rollout for workloads when instrumenting or uninstrumenting, ensuring that changes are applied without requiring manual intervention. When automatic rollout is disabled, Odigos will not restart workloads, and users will need to manually trigger rollouts after adding or removing sources.",value:S.rollout?.automaticRolloutDisabled||!1,onChange:e=>w("rollout.automaticRolloutDisabled",e)},"automatic-rollout-disabled")]}})},Tc=e=>{const t=[{id:"type",title:Qe.TYPE,label:e.destinationType.displayName},{id:"status",title:Qe.STATUS,badge:{status:e.disabled?Le.Unknown:Le.Success,label:e.disabled?Qe.DISABLED:Qe.ENABLED}}],o=ze(e.exportedSignals).map(e=>{let t=e.toLowerCase();return t=`${t.charAt(0).toUpperCase()}${t.slice(1)}`,t}).join(", ");return o&&t.push({id:"monitors",title:Qe.MONITORS,label:o}),e.name&&t.push({id:"name",title:Qe.NAME,label:e.name}),t},$c=({onClose:s,destinationId:c})=>{const d=b(),{isVm:u}=C(),{destinationsApi:p}=kl(),{selectedStreamName:h}=et(),{items:m,refetch:g}=p.useDestinations(),{data:f,loading:v}=p.useDestinationCategories(),{activeForm:y,loadDestination:S,validateFormData:w,genericForm:x}=Tl();n(()=>{g()},[]);const k=a(null),[T,$]=r(!1),[I,E]=r(!1),[N,A]=r(null),O=T&&!!x?.isFormDirty,R=i(()=>Xt(m,h),[m,h]),D=i(()=>R?.find(e=>Dt(e)===c),[c,R]),P=f?.destinationCategories?.categories??null;n(()=>{D&&P&&S(D,P)},[D,P]);const F=i(()=>D&&P?Vt(P,D):[],[D,P]),L=l(()=>{D&&$(!0)},[D]),M=l(()=>{D&&P&&(S(D,P),$(!1))},[D,P,S]),_=l(()=>{O?A("close"):s()},[O,s]),z=l(()=>{O?A("cancel"):M()},[O,M]),B=l(()=>{const e=N;A(null),"close"===e?(M(),s()):M()},[N,M,s]),X=l(async()=>{if(D){const{errorMessage:e,preparedFormData:t}=w();e||(await p.update(D.id,Xe(t)),$(!1))}},[D,w,p]),V=l(()=>{D&&E(!0)},[D]),U=l(async()=>{D&&(await p.remove(D.id),s())},[D,p,s]);if(!D)return null;const{icon:G,iconSrc:H}=wt(D.destinationType.type),j=((e,t)=>{const o=[],n=Bt(e,t),i=n.map(e=>({name:e.key,value:e.value})),a=ze(e.exportedSignals);let l=[];const r=()=>{l.length&&(o.push({kind:"cells",id:`cells-${o.length}`,items:l}),l=[])};return n.forEach(({key:e,name:n,value:s})=>{const c=t.find(t=>t.name===e),{secret:d,componentType:u,componentProperties:p,hideFromReadData:h,customReadDataLabels:m}=c||{};if(h?.length&&$e(h,a,i))return;const{type:g}=Ie(p,{type:""}),f=d||"password"===g;if(m?.length)m.forEach(({condition:t,...o},n)=>{t==s&&l.push({id:`${e}-custom-${n}`,title:o.title,label:o.value})});else if(s)if(f)l.push({id:e,title:n,label:new Array(10).fill("•").join("")});else{if(u===Te.MultiInput){const t=Ie(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"list",id:e,title:n,items:t.map((t,o)=>({id:`${e}-${o}`,label:String(t)}))})}if(u===Te.KeyValuePair){const t=Ie(s,null);if(Array.isArray(t)&&t.length)return r(),void o.push({kind:"pairs",id:e,title:n,items:t.map((t,o)=>{const n=t&&"object"==typeof t?t:{};return{id:`${e}-${o}`,title:null!=n.key?String(n.key):"",label:null!=n.value?String(n.value):""}})})}l.push({id:e,title:n,label:s})}else l.push({id:e,title:n,label:"-"})}),r(),o})(D,F);return e(o,{children:[t(se,{isOpen:!0,header:{icon:G,iconSrc:H,title:D.name||D.destinationType.displayName,onClose:_,actions:[{id:"edit-destination-btn-edit",label:Ft.EDIT,icon:Ia,active:T,onClick:L},{id:"edit-destination-btn-delete",label:Ft.DELETE,icon:Ca,color:d.v2.colors.red[500],active:I,onClick:V}]},footer:{actions:T?[{"data-id":"edit-destination-btn-cancel",label:Ft.CANCEL,variant:fe.Secondary,onClick:z},...y?.option.testConnectionSupported&&!u?[{"data-id":"edit-destination-btn-test-connection",label:Ft.TEST_CONNECTION,variant:fe.Secondary,onClick:()=>k.current?.testConnection()}]:[],{"data-id":"edit-destination-btn-save",label:Ft.SAVE,variant:fe.Primary,onClick:X}]:[]},children:t(ht,{$padding:"4px 12px 12px",children:v?t(gt,{$height:"50vh",children:t(Ct,{withSpinner:!0})}):T&&y?t($s,{ref:k,isEdit:!0}):t(Q,{$gap:16,children:e(Lt,{bgTint:"1000",children:[e(Lt,{bgTint:"900",children:[!u&&t(Mt,{conditions:D.conditions||[]}),t(Lt,{bgTint:"800",cellsPerRow:2,items:Tc(D)})]}),!!j.length&&t(Lt,{bgTint:"900",richTitle:{title:"Configuration"},withCollapse:!0,collapseIsDefaultOpen:!0,children:j.map(e=>"cells"===e.kind?t(Lt,{bgTint:"800",cellsPerRow:2,items:e.items},e.id):(e.kind,t(Lt,{bgTint:"800",richTitle:{title:e.title},cellsPerRow:2,items:e.items},e.id)))})]})})})}),t(ir,{target:"destination",isOpen:I,onClose:()=>E(!1),onApprove:U}),t(ar,{isOpen:null!==N,onClose:()=>A(null),onApprove:B})]})},Ic=(e,t)=>{const o=[{id:"type",title:Qe.TYPE,label:t.label},{id:"status",title:Qe.STATUS,badge:{status:e.disabled?Le.Unknown:Le.Success,label:e.disabled?Qe.DISABLED:Qe.ENABLED}}];return e.ruleName&&o.push({id:"name",title:Qe.NAME,label:e.ruleName}),e.profileName&&o.push({id:"profile",title:Qe.MANAGED_BY_PROFILE,label:e.profileName}),e.notes&&o.push({id:"notes",title:Qe.NOTES,label:e.notes}),o},Ec=({onClose:a,ruleId:s})=>{const c=b(),{addNotification:d}=Gt(),{isVm:u}=C(),{instrumentationRulesApi:p}=kl(),{items:h,refetch:m}=p.useRules(),{selectedOption:g,loadRule:f,validateFormData:v,genericForm:y}=$l();n(()=>{m()},[]);const[S,w]=r(!1),[x,k]=r(!1),[T,$]=r(null),I=S&&!!y?.isFormDirty,E=i(()=>h?.find(e=>Dt(e)===s),[s,h]),N=i(()=>kt.find(({type:e})=>e===E?.type)??null,[E?.type]);n(()=>{E&&f(E)},[E]);const A=l(()=>{if(E){if(!E.mutable)return void d({type:Le.Warning,title:Ht.FORBIDDEN,message:Ht.CANNOT_EDIT_RULE,crdType:Tt.InstrumentationRule,target:E.ruleId,hideFromHistory:!0});w(!0)}},[E,d]),O=l(()=>{E&&(f(E),w(!1))},[E,f]),R=l(()=>{I?$("close"):a()},[I,a]),D=l(()=>{I?$("cancel"):O()},[I,O]),P=l(()=>{const e=T;$(null),"close"===e?(O(),a()):O()},[T,O,a]),F=l(async()=>{if(E){const{errorMessage:e,preparedFormData:t}=v();e||(await p.update(E.ruleId,t,E.type),w(!1))}},[E,v,p]),L=l(()=>{if(E){if(!E.mutable)return void d({type:Le.Warning,title:Ht.FORBIDDEN,message:Ht.CANNOT_DELETE_RULE,crdType:Tt.InstrumentationRule,target:E.ruleId,hideFromHistory:!0});k(!0)}},[E,d]),M=l(async()=>{E&&(await p.remove(E.ruleId,E.type),a())},[E,p,a]);if(!E||!N)return null;const _=((e,o)=>{const n=[];return e.payloadCollection&&Object.entries(e.payloadCollection).forEach(([e,o])=>{o&&n.push(t(de,{size:pe.XS,children:`• ${Ut(e).toLowerCase()}`},`payload-${e}`))}),e.codeAttributes&&Object.entries(e.codeAttributes).forEach(([e,o])=>{o&&n.push(t(de,{size:pe.XS,children:`• ${Ut(e).toLowerCase()}`},`code-${e}`))}),e.headersCollection?.[Ue.HeaderKeys]?.length&&e.headersCollection[Ue.HeaderKeys].forEach((e,o)=>{e&&n.push(t(de,{size:pe.XS,children:e},`header-${o}-${e}`))}),e.customInstrumentations&&(e.customInstrumentations[We.Java]?.forEach((e,i)=>{const a=new je(e.className,e.methodName);if(a.Verify()){0===i&&n.push(t(de,{size:pe.XS,children:"Java Custom Probes:"},"java-custom-probes"));const e=a.toString();n.push(t(de,{size:pe.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`java-probe-${i}-${e}`))}}),e.customInstrumentations[We.Golang]?.forEach((e,i)=>{const a=new He(e.packageName,e.functionName,e.receiverName,e.receiverMethodName);if(a.Verify()){0===i&&n.push(t(de,{size:pe.XS,children:"Golang Custom Probes:"},"golang-custom-probes"));const e=a.toString();n.push(t(de,{size:pe.XXS,color:o.v2.colors.grey[200],children:`• ${e}`},`golang-probe-${i}-${e}`))}})),n})(E,c);return e(o,{children:[t(se,{isOpen:!0,header:{icon:Wt(E.type),title:N.label,onClose:R,actions:[{id:"edit-rule-btn-edit",label:Ft.EDIT,icon:Ia,active:S,onClick:A},{id:"edit-rule-btn-delete",label:Ft.DELETE,icon:Ca,color:c.v2.colors.red[500],active:x,onClick:L}]},footer:{actions:S?[{"data-id":"edit-rule-btn-cancel",label:Ft.CANCEL,variant:fe.Secondary,onClick:D},{"data-id":"edit-rule-btn-save",label:Ft.SAVE,variant:fe.Primary,onClick:F}]:[]},children:t(ht,{$padding:"4px 12px 12px",children:S&&g?t(Ps,{}):t(Q,{$gap:16,children:e(Lt,{bgTint:"1000",children:[e(Lt,{bgTint:"900",children:[!u&&t(Mt,{conditions:E.conditions||[]}),t(Lt,{bgTint:"800",cellsPerRow:2,items:Ic(E,N)})]}),!u&&t(Wl,{readOnly:!0,scopes:E.sourceScopes??null}),!!_.length&&t(Lt,{bgTint:"900",richTitle:{title:"Collect"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Lt,{bgTint:"800",children:_})}),!!N.supportedLanguages.length&&t(Lt,{bgTint:"900",richTitle:{title:"Supported languages"},withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Lt,{bgTint:"800",children:t(he,{$gap:12,$wrap:"wrap",children:N.supportedLanguages.map(e=>t(jt,{label:qe[e],leftIcon:Je(e),flex:"0.5"},e))})})})]})})})}),t(ir,{target:"instrumentation rule",isOpen:x,onClose:()=>k(!1),onApprove:M}),t(ar,{isOpen:null!==T,onClose:()=>$(null),onApprove:P})]})};var Nc;(e=>{e.Overview="overview",e.Pods="pods",e.PeerSources="peer-sources",e.Profiling="profiling",e.Sampling="sampling",e.Debug="debug"})(Nc||(Nc={}));const Ac=({collapseIsDefaultOpen:e,isJumpToTarget:o,onClickRestartPod:n,namespace:a,podName:l,nodeName:r,startTime:s,agentInjectedStatus:c,odigosHealthStatus:d,k8sHealthStatus:u,children:p})=>{const{formatDurationAgo:h}=Kt(),m=Yt(!!o),g=i(()=>({title:l,icon:Xa,withCopy:!0}),[l]),f=i(()=>{const e=[],t=qt(c);t&&e.push(t);const o=qt(d,Va,"health");o&&e.push(o);const n=qt(u,Ua,"health");return n&&e.push(n),e},[c,d,u]),b=i(()=>n?[{id:`restart-pod-${l}`,icon:Ga,label:Ft.RESTART_POD,onClick:()=>n(a,l)}]:void 0,[n,a,l]),v=i(()=>[{id:"nodeName",title:Qe.NODE,label:r,withCopy:!0},{id:"age",title:Qe.AGE,label:s?h(s,{style:"short"}):Qe.NOT_RUNNING,labelTooltip:s}],[r,s,h]);return t("div",{ref:m,children:t(Lt,{bgTint:"900",richTitle:g,badges:f,dropDataActions:b,items:v,withCollapse:!0,collapseIsDefaultOpen:e,children:p})})},Oc=f.div`
192
+ display: flex;
193
+ align-items: center;
194
+ justify-content: space-between;
195
+ gap: 8px;
196
+ padding: ${({$noPadding:e})=>e?"0":"12px"};
197
+ border-radius: 12px;
198
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
199
+ `,Rc=({podsOdigosHealthStatus:o,pods:n,noPadding:a})=>{const l=Qt(o?.status),r=Ut(o?.name),s=o?.message,{totalPodsCount:c,injectionsAsExpectedCount:d,odigosHealthyPodsCount:u,k8sHealthyPodsCount:p}=i(()=>({totalPodsCount:n?.length||0,injectionsAsExpectedCount:n?.reduce((e,t)=>e+(t.agentInjectedStatus?.status===Jt.Success?1:0),0)||0,odigosHealthyPodsCount:n?.reduce((e,t)=>e+(t.odigosHealthStatus?.status===Jt.Success?1:0),0)||0,k8sHealthyPodsCount:n?.reduce((e,t)=>e+(t.k8sHealthStatus?.status===Jt.Success?1:0),0)||0}),[n]);return n?.length&&o&&l?e(Oc,{$noPadding:a,children:[t(Zt,{invertColors:!0,hideBackground:!0,status:l,title:r,subTitle:s}),e(he,{$gap:8,children:[t(Pc,{label:Qe.PODS,count:c}),t(Pc,{label:Qe.INJECTIONS_AS_EXPECTED,count:d,total:c}),t(Pc,{label:Qe.ODIGOS_HEALTHY,icon:Va,count:u,total:c}),t(Pc,{label:Qe.KUBERNETES_HEALTHY,icon:Ua,count:p,total:c})]})]}):null},Dc=f.div`
200
+ display: flex;
201
+ flex-direction: column;
202
+ justify-content: center;
203
+ align-self: stretch;
204
+ gap: 4px;
205
+ padding: 8px 12px;
206
+ min-width: 50px;
207
+ width: fit-content;
208
+ border-radius: 8px;
209
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
210
+ `,Pc=({count:o,total:n,label:i,icon:a})=>{const l=b(),r=void 0===n?void 0:o===n?l.v2.colors.green[500]:l.v2.colors.red[500];return e(Dc,{children:[e(he,{$gap:0,$alignItems:"flex-end",children:[t(de,{size:pe.L,color:r,weight:500,nowrap:!0,children:o}),void 0!==n&&t(de,{size:pe.S,color:r,weight:500,nowrap:!0,children:`/${n}`})]}),e(he,{$alignItems:"center",$gap:4,children:[a&&t(a,{size:16}),t(de,{size:pe.XXXS,nowrap:!0,children:i})]})]})},Fc=e=>{if(e.overrideProcessNum)return e.overrideProcessNum.toString();const t=e.identifyingAttributes?.find(({name:e})=>e===eo.PID)??e.identifyingAttributes?.find(({name:e})=>e===eo.VPID);return t?.value??null};var Lc;(e=>{e.IdentifyingAttributes="identifying-attributes",e.InstrumentationLibraries="instrumentation-libraries"})(Lc||(Lc={}));const Mc=({overrideProcessNum:o,healthy:a,healthStatus:l,identifyingAttributes:s,instrumentations:c,isJumpToTarget:d})=>{const u=b(),[p,h]=r(Lc.IdentifyingAttributes),m=Yt(!!d),{tabOptions:g,firstTabValue:f,bothTabsDisabled:v}=i(()=>{const e=c?.some(e=>!1===e.healthy),o=[{value:Lc.IdentifyingAttributes,label:Qe.IDENTIFYING_ATTRIBUTES,disabled:!s?.length,selectedBgColor:u.v2.colors.purple[500]},{value:Lc.InstrumentationLibraries,label:Qe.INSTRUMENTATION_LIBRARIES,icon:e?e=>t(Ha,{...e,fill:u.v2.colors.red[500]}):void 0,disabled:!c?.length,selectedBgColor:u.v2.colors.purple[500]}];return{tabOptions:o,firstTabValue:o.find(e=>!e.disabled)?.value||o[0].value,bothTabsDisabled:o.every(e=>e.disabled)}},[s,c]);n(()=>{f&&h(f)},[f]);const y=i(()=>{switch(p){case Lc.IdentifyingAttributes:return t(Q,{children:s?.map((e,o)=>t(Vc,{label:e.name,value:e.value},`attr-${o}-${e.name}`))});case Lc.InstrumentationLibraries:return t(Q,{children:c?.map((e,o)=>t(Vc,{label:e.name,isStandardLibrary:e.isStandardLibrary,healthy:e.healthy,message:e.message},`instr-${o}-${e.name}`))});default:return null}},[p,s,c]),C=i(()=>Fc({overrideProcessNum:o,identifyingAttributes:s}),[o,s]);return t("div",{ref:m,children:e(Lt,{bgTint:"800",richTitle:{title:C?`${Qe.PROCESS} ${Qe.PID(C)}`:Qe.PROCESS_FALLBACK_NAME},renderOnRightSide:t(de,{color:a?ue.Success:ue.Error,size:pe.XXXS,children:l?.message}),badges:[{key:"odigos-healthy",status:a?Le.Success:Le.Error,leftIcon:Va,label:a?Qe.HEALTHY:Qe.NOT_HEALTHY,textSize:pe.XXXS,invertColors:!0,useSecondaryTone:!0}],withCollapse:!v,collapseIsDefaultOpen:d,children:[!v&&t(be,{options:g,selected:p,setSelected:h}),!v&&y]})})},_c=f.div`
211
+ display: flex;
212
+ align-items: flex-start;
213
+ gap: 8px;
214
+ padding: 8px;
215
+ border-radius: 4px;
216
+ &:hover {
217
+ background-color: ${({theme:e})=>e.v2.colors.silver[700]};
218
+ }
219
+ `,zc=f(de)`
220
+ flex: 0 0 30%;
221
+ `,Bc=f(de)`
222
+ flex: 1 1 auto;
223
+ min-width: 0;
224
+ `,Xc=f(he)`
225
+ flex: 1 1 auto;
226
+ justify-content: flex-end;
227
+ min-width: 0;
228
+ `,Vc=({label:o,value:n,isStandardLibrary:i,healthy:a,message:l})=>{const r="boolean"==typeof a;return e(_c,{children:[t(zc,{size:pe.XXS,color:ue.Secondary,children:o}),n&&t(Bc,{size:pe.XXS,color:ue.Primary,align:"right",children:n}),(r||i)&&e(Xc,{children:[i&&t(Ye,{status:Le.Info,label:Qe.STANDARD,textSize:pe.XXXS,invertColors:!0}),r&&t(Ye,{status:a?Le.Success:Le.Error,label:a?Qe.HEALTHY:Qe.NOT_HEALTHY,textSize:pe.XXXS,invertColors:!0,tooltip:l??void 0})]})]})},Uc=p(null),Gc=({value:e,children:o})=>t(Uc.Provider,{value:e,children:o}),Hc=({podContainers:e,sourceContainers:o,jumpToTarget:n})=>{const a=e??[],l=i(()=>({title:Qe.CONTAINERS,titleSize:pe.XS,badge:{label:a.length}}),[a.length]),r=i(()=>{const e=new Map;return o?.forEach(t=>e.set(t.containerName,t)),e},[o]);return t(Lt,{bgTint:"800",richTitle:l,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Q,{$gap:8,children:a.map(e=>{const o=n?.containerName===e.containerName;return t(Wc,{...e,language:to(r.get(e.containerName)),jumpToTarget:o?n:null},`pod-container-${e.containerName}`)})})})},jc=f.div`
229
+ display: flex;
230
+ flex-direction: column;
231
+ gap: 12px;
232
+ padding: 8px 12px;
233
+ border-radius: 8px;
234
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
235
+ `,Wc=({language:o,containerName:n,otelDistroName:a,runningStartedTime:l,started:r,ready:s,restartCount:c,isCrashLoop:d,waitingReasonEnum:u,waitingMessage:p,odigosHealthStatus:h,k8sHealthStatus:m,processes:g,jumpToTarget:f})=>{const b=!!f,v=b&&!f?.processPid,{formatDurationAgo:y}=Kt(),C=Yt(v),S=i(()=>({title:n,icon:o?Je(o):ja,iconWithWrapper:!0}),[n,o]),w=i(()=>{const e=[],t=qt({status:a?Jt.Success:Jt.Disabled,reasonEnum:a?Qe.INSTRUMENTED_WITH_DISTRO(a):Qe.UNINSTRUMENTED,message:""});t&&e.push(t);const o=qt(h,Va,"health");o&&e.push(o);const n=qt(m,Ua,"health");return n&&e.push(n),e},[m,h,a]),x=i(()=>[{id:"runningTime",title:Qe.RUNNING_TIME,label:l?y(l,{style:"short"}):Qe.NOT_RUNNING,labelTooltip:`${Qe.RUNNING_TIME_TOOLTIP}. (${l})`},{id:"blank",spacer:!0},{id:"started",badge:{status:r?Le.Success:Le.Disabled,leftIcon:r?xa:ka,label:r?Qe.STARTED:Qe.NOT_STARTED,textSize:pe.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"ready",badge:{status:s?Le.Success:Le.Disabled,leftIcon:s?xa:ka,label:s?Qe.READY:Qe.NOT_READY,textSize:pe.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"isCrashLoop",badge:{status:d?Le.Error:Le.Success,leftIcon:d?ka:xa,label:d?Qe.CRASHLOOP:Qe.NO_CRASHLOOP,textSize:pe.XXXS,invertColors:!0,useSecondaryTone:!0}},{id:"restartCount",title:Qe.RESTARTS,badge:{status:c?Le.Error:void 0,label:c||0,textSize:pe.XXXS}}],[l,y,r,s,d,c]),k=i(()=>p?Ut(u):"",[p,u]);return t("div",{ref:C,children:e(Lt,{bgTint:"750",richTitle:S,badges:w,items:x,withCollapse:!0,collapseIsDefaultOpen:b,children:[p&&t(jc,{children:e(he,{$gap:10,$alignItems:"center",children:[t(jt,{variant:oo.Pink,leftIcon:Ua,label:k}),t(de,{size:pe.XXXS,color:ue.Error,children:p})]})}),(g??[]).map((e,o)=>{const i=o+1,a=b&&(l=f,r=e,!!l?.processPid&&Fc({identifyingAttributes:r.identifyingAttributes})===l.processPid);var l,r;return t(Mc,{...e,overrideProcessNum:i,isJumpToTarget:a},`pod-container-${n}-process-${i}`)})]})})},Kc=({podName:e,namespace:o,hasRestarted:n})=>{const a=i(()=>({title:Qe.DEBUG_COMMANDS,titleSize:pe.XS}),[]),l=i(()=>[{label:Qe.GET_POD_YAML,value:`kubectl get pod ${e} -n ${o} -o yaml`},{label:Qe.DESCRIBE_POD,value:`kubectl describe pod ${e} -n ${o}`},{label:Qe.GET_POD_LOGS,value:`kubectl logs ${e} -n ${o}${n?" -p":""}`}],[e,o,n]);return t(Lt,{bgTint:"800",richTitle:a,withCollapse:!0,children:l.map(({label:e,value:o})=>t(no,{bgTint:"700",label:e,value:o},e))})},Yc=({source:n,onClickRestartPod:a})=>{const{jumpToTarget:l}=(()=>{const e=h(Uc);if(!e)throw new Error("useJumpToTargetContext must be used within a JumpToTargetContextProvider");return e})(),r=l?.tab===Nc.Pods?l:null,s=n?.pods??[],c=s.length>0,d=i(()=>s.some(e=>e.containers?.some(e=>e.restartCount&&e.restartCount>0)),[s]),u=i(()=>({title:Qe.PODS,badge:{label:s.length}}),[s.length]);return t(Q,{$gap:12,children:c?e(o,{children:[t(Rc,{podsOdigosHealthStatus:n.podsOdigosHealthStatus,pods:s}),t(Lt,{bgTint:"1000",richTitle:u,children:s.map(o=>{const i=r?.podName===o.podName,l=i&&!r?.containerName;return e(Ac,{...o,namespace:n.id.namespace,onClickRestartPod:a,collapseIsDefaultOpen:i,isJumpToTarget:l,children:[t(Kc,{podName:o.podName,namespace:n.id.namespace,hasRestarted:d}),t(Hc,{podContainers:o.containers,sourceContainers:n.containers,jumpToTarget:i?r:null})]},`pod-${o.podName}`)})})]}):t(gt,{$height:"70vh",children:t(Oe,{title:Qe.NO_RUNNING_PODS,subTitle:Qe.NO_RUNNING_PODS_SUBTITLE})})})},qc="user",Jc=({source:o})=>{const n=i(()=>o.serviceName||o.id.name,[o]),{sourcesApi:a}=kl(),{data:l,loading:r,refetch:s}=a.usePeerSources({serviceName:n},{fetchPolicy:"network-only"}),c=l?.peerSources??null;return!c||r?t(gt,r?{$height:"70vh",children:t(Ct,{withSpinner:!0})}:{$height:"70vh",children:t(Oe,{subTitle:Qe.COULD_NOT_FETCH_PEER_SOURCES})}):e(he,{$gap:16,$alignItems:"flex-start",children:[t(Zc,{icon:Wa,title:Qe.INBOUND,subTitle:Qe.INBOUND_DESCRIPTION(n),onRefresh:s,items:c?.inbound??[]}),t(Zc,{icon:Ka,title:Qe.OUTBOUND,subTitle:Qe.OUTBOUND_DESCRIPTION(n),onRefresh:s,items:c?.outbound??[]})]})},Zc=({icon:o,title:n,subTitle:a,onRefresh:l,items:s})=>{const[c,d]=r(""),u=i(()=>s.filter(e=>e.serviceName.toLowerCase().includes(c.toLowerCase())),[s,c]);return e(Lt,{bgTint:"1000",richTitle:{icon:o,title:n,titleSize:pe.XS,subTitle:a,subTitleSize:pe.XXXS,badge:{label:s.length}},actions:[{id:"refresh",type:io.Button,buttonProps:{variant:fe.Secondary,size:ge.S,leftIcon:Ga,onClick:l}}],children:[t(ao,{value:c,onChange:d,width:"100%"}),t(lo,{height:"calc(100vh - 284px)",gap:4,elements:u.length||c?!u.length&&c?[t(gt,{$height:"50vh",children:t(Oe,{icon:o,title:Qe.NO_RESULTS,subTitle:Qe.NO_RESULTS_FOR_FILTER(c)})},"no-results")]:u.map(e=>t(ed,{...e},`${n}-${e.serviceName}`)):[t(gt,{$height:"50vh",children:t(Oe,{icon:o,title:`No ${n} connections yet`,subTitle:n===Qe.INBOUND?Qe.NO_INBOUND_CONNECTIONS_DESCRIPTION:Qe.NO_OUTBOUND_CONNECTIONS_DESCRIPTION})},"no-data")]})]})},Qc=f.div`
236
+ display: flex;
237
+ align-items: center;
238
+ justify-content: space-between;
239
+ gap: 8px;
240
+ padding: 8px;
241
+ border-radius: 8px;
242
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
243
+ ${({$withClick:e})=>e&&v`
244
+ cursor: pointer;
245
+ &:hover {
246
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
247
+ }
248
+ `}
249
+ `,ed=({serviceName:o,isVirtual:n,nodeAttributes:a})=>{const l=ro(e=>e.drawerEntityId),{items:r}=kl().sourcesApi.useSources(),s=i(()=>r.find(e=>e.id.name===o||e.serviceName===o),[r,o]),c=i(()=>s&&JSON.stringify(so(s))!==JSON.stringify(so(l)),[s,l]),d=i(()=>{if(n){const e=Object.fromEntries((a??[]).map(({key:e,value:t})=>[e,t]));return[co({serviceName:o,attributes:e})]}if(o?.toLowerCase()===qc)return[Ya];const e=s?uo(s):void 0;return e?.length?e:[ja]},[n,a,o,s]),u=c?()=>{const{setDrawerType:e,setDrawerEntityId:t}=ro.getState();e(ho(Tt.Source)),t({namespace:s?.id.namespace??"",name:s?.id.name??"",kind:s?.id.kind??""})}:void 0;return e(Qc,{onClick:u,$withClick:!!u,children:[e(he,{$gap:8,children:[t(po,{icons:d}),t(de,{size:pe.XXS,children:o})]}),n&&t(Ye,{status:Le.Info,label:Qe.VIRTUAL,textSize:pe.XXXS,invertColors:!0,tooltip:Qe.VIRTUAL_TOOLTIP})]})},td=e=>{if("string"==typeof e)return e;if(e&&"object"==typeof e){const t=e;if("string"==typeof t.k8sActualManifest)return t.k8sActualManifest;if("string"==typeof t.manifest)return t.manifest}},od=({source:o})=>{const a=b(),{k8sManifestApi:l}=kl(),[s,c]=r(!0),[d,u]=r(void 0),[p,h]=r(!0),[m,g]=r(void 0);n(()=>{l.fetch({namespace:o.id.namespace,kind:o.id.kind,name:o.id.name}).then(({data:e})=>u(td(e))).finally(()=>c(!1)),l.fetch({namespace:o.id.namespace,kind:mo.InstrumentationConfig,name:`${o.id.kind}-${o.id.name}`.toLowerCase()}).then(({data:e})=>g(td(e))).finally(()=>h(!1))},[l,o.id.namespace,o.id.kind,o.id.name]);const f=i(()=>[{label:Qe.DESCRIBE_POD,value:`kubectl describe ${o.id.kind} ${o.id.name} -n ${o.id.namespace}`},{label:Qe.GET_POD_YAML,value:`kubectl get ${o.id.kind} ${o.id.name} -n ${o.id.namespace} -o yaml`},{label:Qe.GET_POD_YAML,value:`kubectl get ${mo.InstrumentationConfig} ${o.id.kind}-${o.id.name} -n ${o.id.namespace} -o yaml`}],[o.id.kind,o.id.name,o.id.namespace]);return e(Lt,{bgTint:"1000",children:[t(Lt,{bgTint:"900",richTitle:{icon:qa,title:Qe.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:f.map(({label:e,value:o},n)=>t(no,{label:e,value:o},`debug-cmd-${n}-${e}`))}),s?t(mt,{size:1}):t(lr,{bgTint:"800",codeBgColor:a.v2.colors.silver[900],title:`${o.id.kind} YAML`,yaml:d}),p?t(mt,{size:1}):t(lr,{bgTint:"800",codeBgColor:a.v2.colors.silver[900],title:"Instrumentation Config YAML",yaml:m})]})},nd=({title:o,children:n})=>e(Q,{$gap:8,children:[t(de,{size:pe.XXXS,color:ue.Secondary,children:o}),n]}),id=({source:o})=>{const n=i(()=>{const[e,t]=go(o.telemetryMetrics?.[0]?.throughputBytes||0).split(" ");return{value:e,units:t}},[o]);return t(nd,{title:Qe.THROUGHPUT_LAST_10_SECONDS,children:e(he,{$alignItems:"flex-end",$gap:4,children:[t(de,{size:pe.L,children:n.value}),t(de,{size:pe.XS,variant:Et.Span,children:n.units})]})})},ad=({source:o})=>{const{CopyButton:n}=fo();return t(nd,{title:Qe.NAMESPACE,children:e(he,{children:[t(jt,{variant:oo.Blue,label:o.id.namespace}),t(n,{value:o.id.namespace,size:yt.XS})]})})},ld=({source:e})=>t(nd,{title:Qe.KIND,children:t(he,{children:t(jt,{variant:oo.Blue,label:e.id.kind})})}),rd=({source:o})=>{const{CopyButton:n}=fo();return t(nd,{title:Qe.NAME,children:e(he,{children:[t(jt,{variant:oo.Blue,label:o.id.name}),t(n,{value:o.id.name,size:yt.XS})]})})},sd=({source:o})=>{const{isVm:n}=C();return t(Lt,{children:e(he,{$gap:24,$alignItems:"flex-start",$justifyContent:"flex-start",$wrap:"wrap",children:[!n&&t(id,{source:o}),!n&&t(ad,{source:o}),t(ld,{source:o}),t(rd,{source:o})]})})},cd=({source:e})=>e.pods?.length?t(Lt,{bgTint:"900",children:t(Rc,{podsOdigosHealthStatus:e.podsOdigosHealthStatus,pods:e.pods,noPadding:!0})}):null,dd=({source:e})=>{const o=i(()=>e.workloadOdigosHealthStatus?{status:e.workloadOdigosHealthStatus.status?bo(e.workloadOdigosHealthStatus.status):Le.Unknown,title:Ut(e.workloadOdigosHealthStatus.reasonEnum),subTitle:e.workloadOdigosHealthStatus.message}:null,[e]);return o?t(Zt,{...o,width:"100%"}):null},ud="calc(50% - 6px)",pd=({source:o,onClickRollout:n,onClickRollback:a})=>{const l=i(()=>{const{status:e,reasonEnum:t,message:i}=o.conditions?.rollout||{},a=Qt(e);return a?{status:a,title:t?.toLowerCase().includes("rollout")?Ut(t):`${Qe.ROLLOUT} ${Ut(t)}`,subTitle:i,action:a!==Le.Success?{icon:Ga,tooltip:Qe.ROLLOUT_RESTART,onClick:n}:void 0}:null},[o]),r=i(()=>{const{status:e,reasonEnum:t,message:n}=o.autoRollback?.autoRollbackStatus||{},i=Qt(e);return i?{status:i,title:t?.toLowerCase().includes("rollback")?Ut(t):`${Qe.ROLLBACK} ${Ut(t)}`,subTitle:n,action:i!==Le.Success?{icon:Ga,tooltip:Qe.ROLLBACK_RECOVER,onClick:a}:void 0}:null},[o]);return l||r?e(he,{$gap:12,$alignItems:"stretch",children:[l&&t(Zt,{invertColors:!0,slim:!0,width:r?ud:"100%",...l}),r&&t(Zt,{invertColors:!0,slim:!0,width:ud,...r})]}):null},hd=p(null),md=f.div`
250
+ position: relative;
251
+ `,gd=({children:e})=>{const o=a(null);return t(md,{ref:o,children:t(hd.Provider,{value:o,children:e})})},fd=f.div`
252
+ position: fixed;
253
+ top: ${({$coords:e})=>e.top}px;
254
+ right: ${({$coords:e})=>e.right}px;
255
+ z-index: ${({theme:e})=>e.v2.zIndex.dropdown};
256
+
257
+ display: flex;
258
+ flex-direction: column;
259
+ gap: 12px;
260
+
261
+ width: ${({$width:e})=>e};
262
+ padding: 12px 16px;
263
+ border-radius: 12px;
264
+ background-color: ${({theme:e})=>e.v2.colors.silver[750]};
265
+ `,bd=f.div`
266
+ display: flex;
267
+ align-items: flex-end;
268
+ justify-content: space-between;
269
+ gap: 8px;
270
+ `,vd=f.div`
271
+ flex: 1;
272
+ `,yd=({width:o,onClose:n,onSave:i,saveTooltip:a,onDelete:l,deleteTooltip:s,title:c,subTitle:d,warning:u,children:p,pushButtonsWith:g})=>{const f=b(),v=h(hd),[y,C]=r(null);return vo(v??{current:null},n),m(()=>{const e=v?.current?.getBoundingClientRect();e&&C({top:e.bottom+4,right:window.innerWidth-e.left-24})},[v]),y?dr(e(fd,{$coords:y,$width:o,"data-ignore-outside-click":"true",children:[e(Q,{$gap:4,children:[t(de,{size:pe.XXS,children:c}),t(de,{size:pe.XXXS,color:ue.Secondary,children:d})]}),e(bd,{children:[t(vd,{children:p}),e(he,{$gap:8,$width:"fit-content",$margin:`0 0 ${g||0} 0`,children:[t(me,{variant:fe.Secondary,onClick:l,leftIcon:Ca,tooltip:s,hideTooltipIcon:!0,iconSize:16,size:ge.S,textColor:f.v2.colors.red[500]}),t(me,{variant:fe.Primary,onClick:i,leftIcon:Fa,tooltip:a,hideTooltipIcon:!0,iconSize:16,size:ge.S})]})]}),t("div",{children:t(Fe,{status:Le.Warning,message:u})})]}),document.body):null},Cd=({language:o,overridden:n,onOverride:a,defaultValues:l})=>{const{tier:s}=C(),{formData:c,handleFormChange:d,resetFormData:u}=zt(l),p=i(()=>{if(!o)return[];const e=yo[o].community,t=s===$t.Onprem?yo[o].enterprise:[];return e.concat(t).map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})).sort((e,t)=>e.label.localeCompare(t.label))},[o,s]),[h,m]=r(!1),[g,f]=r(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(he,{$gap:4,$alignItems:"center",children:[n?t(Ye,{status:Le.Info,invertColors:!0,label:Qe.OVERIDDEN}):null,e(gd,{children:[t(Ee,{text:Qe.OVERRIDE_OTEL_DISTRO_NAME,children:t(vt,{icon:Ia,onClick:b})}),g&&t(yd,{width:"500px",onClose:b,onSave:async()=>{m(!0),await a(c),m(!1),b()},saveTooltip:Qe.OVERRIDE_OTEL_DISTRO_NAME_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await a({otelDistroName:null}),m(!1),b()},deleteTooltip:Qe.OVERRIDE_OTEL_DISTRO_NAME_DELETE_TOOLTIP,title:Qe.OVERRIDE_OTEL_DISTRO_NAME,subTitle:Qe.OVERRIDE_OTEL_DISTRO_NAME_SUBTITLE,warning:Qe.OVERRIDE_OTEL_DISTRO_NAME_WARNING,children:t(bt,{label:Qe.OTEL_DISTRO_NAME,options:p,values:c.otelDistroName?[c.otelDistroName]:[],setValues:e=>d("otelDistroName",e[0])})})]})]})},Sd=({overridden:o,onOverride:n,defaultValues:a,originalValues:l})=>{const{addNotification:s}=Gt(),{formData:c,handleFormChange:d,resetFormData:u}=zt(a),p=i(()=>Co.map(e=>({id:e.id,label:e.label,icon:e.icon||void 0})),[]),[h,m]=r(!1),[g,f]=r(!1),b=()=>{h||(g&&u(),f(e=>!e))};return e(he,{children:[o?t(Ye,{status:Le.Info,invertColors:!0,label:Qe.OVERIDDEN}):null,e(gd,{children:[t(Ee,{text:Qe.OVERRIDE_RUNTIME_DETAILS,children:t(vt,{icon:Ia,onClick:b})}),g&&t(yd,{width:"500px",onClose:b,onSave:async()=>{!c.version||So(c.version)?(m(!0),await n(c),m(!1),b()):s({type:Le.Warning,message:Ht.INVALID_VERSION,hideFromHistory:!0})},saveTooltip:Qe.OVERRIDE_RUNTIME_DETAILS_SAVE_TOOLTIP,onDelete:async()=>{m(!0),await n({language:null,version:""}),m(!1),b()},deleteTooltip:Qe.OVERRIDE_RUNTIME_DETAILS_DELETE_TOOLTIP,title:Qe.OVERRIDE_RUNTIME_DETAILS,subTitle:Qe.OVERRIDE_RUNTIME_DETAILS_SUBTITLE,warning:Qe.OVERRIDE_RUNTIME_WARNING,pushButtonsWith:"20px",children:e(he,{$gap:8,children:[t(bt,{label:Qe.LANGUAGE,options:p,values:c.language?[c.language]:[],setValues:e=>d("language",e[0]),helpMessage:`Auto-detected: ${l.language||"none"}`}),t(xe,{label:Qe.RUNTIME_VERSION,placeholder:Qe.VERSION_PLACEHOLDER,value:c.version,onChange:e=>d("version",e.target.value),helpMessage:`Auto-detected: ${l.version||"none"}`})]})})]})]})},wd=({source:e})=>{const{isVm:o}=C(),{containers:n,containersRichTitle:a}=i(()=>{const t=e?.conditions?.runtimeDetection;return{containers:e?.containers??[],containersRichTitle:{title:o?Qe.DETECTED_PROCESSES:`${e.id.kind} ${Qe.CONTAINERS}`,tooltip:t?.message||(o?Qe.DETECTED_PROCESSES_DESCRIPTION:Qe.DETECTED_CONTAINERS_DESCRIPTION),badge:Qt(t?.status)===Le.Loading?{status:Le.Loading,backgroundColor:"transparent"}:{label:e?.containers?.length}}}},[e,o]);return t(Lt,{bgTint:"1000",richTitle:a,withCollapse:!0,collapseIsDefaultOpen:!0,children:t(Q,{$gap:8,children:n.map(o=>o&&t($d,{...o,sourceId:e.id},`source-container-${o.containerName}`))})})},xd=f.div`
273
+ display: flex;
274
+ flex-direction: column;
275
+ align-self: stretch;
276
+ gap: 12px;
277
+ padding: 8px 12px;
278
+ border-radius: 8px;
279
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
280
+ `,kd=f.div`
281
+ display: flex;
282
+ align-items: center;
283
+ justify-content: center;
284
+ padding: 8px;
285
+ border-radius: 10px;
286
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
287
+ `,Td=f.div`
288
+ display: flex;
289
+ flex-direction: column;
290
+ gap: 12px;
291
+ padding: 8px 12px;
292
+ border-radius: 8px;
293
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
294
+ `,$d=({sourceId:o,...n})=>{const{containerName:a,runtimeInfo:l,agentEnabled:r,overrides:s}=n,c=b(),{sourcesApi:d}=kl(),u=i(()=>!!s?.runtimeInfo?.language||!!s?.runtimeInfo?.runtimeVersion,[s]),p=i(()=>({language:to(n),version:wo(n)||void 0}),[n]),h=i(()=>!!s?.otelDistroName,[s]),m=i(()=>({otelDistroName:s?.otelDistroName||n.agentEnabled?.otelDistroName}),[s,n]),g=i(()=>!l&&!u,[l,u]),f=i(()=>g?ja:Je(p.language),[g,p]),v=i(()=>{if(g)return"";const{language:e,version:t}=p;return`${e}${t?` • ${t}`:""}`},[g,p]),y=i(()=>g?{status:Le.Loading,label:Qe.WAITING_FOR_RUNTIME_DETECTION}:{status:r?.otelDistroName?Le.Success:Le.Disabled,leftIcon:r?.otelDistroName?xa:ka,label:r?.otelDistroName?`Instrumented | ${r.otelDistroName}`:"Uninstrumented",tooltip:r?.agentEnabledStatus?.message},[g,r]),C=e=>d.update(o,{containerName:a,...h?m:{},...u?p:{},...e}),S=i(()=>{const e=[];return n.agentConfig?.traces?.headSampling?.noisyOperations?.length&&e.push(Qe.HEAD_SAMPLING),(n.collectorConfig?.tailSampling?.noisyOperations?.length||n.collectorConfig?.tailSampling?.highlyRelevantOperations?.length||n.collectorConfig?.tailSampling?.costReductionRules?.length)&&e.push(Qe.TAIL_SAMPLING),e},[n]);return e(xd,{children:[e(he,{$gap:16,$alignItems:"center",$justifyContent:"space-between",$wrap:"wrap",children:[e(he,{$gap:8,$alignItems:"center",children:[t(kd,{children:t(f,{size:24,fill:l?void 0:c.v2.colors.grey[400]})}),t(de,{children:a}),t(jt,v?{variant:oo.Blue,label:v}:{variant:oo.Loader,label:Qe.DETECTING_RUNTIME_INFO}),t(Sd,{overridden:u,onOverride:C,defaultValues:p,originalValues:{language:n.runtimeInfo?.language,version:n.runtimeInfo?.runtimeVersion||""}})]}),e(he,{$gap:8,$alignItems:"center",children:[t(Ye,{...y,textSize:pe.XXXS}),t(Cd,{language:p.language,overridden:h,onOverride:C,defaultValues:m})]})]}),!r||r.agentEnabled||g?null:t(Td,{children:e(he,{$gap:10,$alignItems:"center",children:[t(jt,{variant:oo.Pink,label:Ut(r.agentEnabledStatus?.reasonEnum)||Qe.NO_AVAILABLE_AGENT}),t(de,{size:pe.XXXS,color:ue.Secondary,children:r?.agentEnabledStatus?.message})]})}),S.length>0&&t(Td,{children:t(he,{$gap:16,$wrap:"wrap",children:S.map((e,o)=>t(Ye,{label:e,leftIcon:xa,status:Le.Success,invertColors:!0,useSecondaryTone:!0},`${a}-rule-${o}`))})})]})},Id=({source:o,onClickRollout:n,onClickRollback:i})=>{const{isVm:a}=C();return e(Q,{$gap:12,children:[t(sd,{source:o}),t(dd,{source:o}),!a&&t(pd,{source:o,onClickRollout:n,onClickRollback:i}),!a&&t(wd,{source:o}),!a&&t(cd,{source:o})]})},Ed=f(Q)`
295
+ width: 100%;
296
+ max-height: 320px;
297
+ overflow-y: auto;
298
+ gap: 8px;
299
+ `,Nd=f(he)`
300
+ width: 100%;
301
+ align-items: center;
302
+ gap: 8px;
303
+ padding: 8px 12px;
304
+ border-radius: 8px;
305
+ background: ${({theme:e})=>e.v2.colors.silver[900]};
306
+ & > * {
307
+ font-family: monospace !important;
308
+ }
309
+ `,Ad=({pendingModify:o,onClose:n,onConfirm:i})=>{const a=b();return t(Ze,{isOpen:!!o,title:'Modify the "Profiling Symbols" rule',description:'These changes are applied immediately to a single custom instrumentation rule named "Profiling Symbols".\nSelected symbols are added to it; unchecked symbols are removed from it (the rule is deleted once empty). Symbols managed by other rules are never touched.',onClose:n,denyButton:{variant:fe.Secondary,label:"Cancel",onClick:n},approveButton:{variant:fe.Primary,label:"Confirm",onClick:i},children:o&&e(Ed,{children:[o.add.map(o=>e(Nd,{children:[t(Ye,{leftIcon:Sa,status:Le.Success,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:pe.XXS}),t(de,{size:pe.XS,color:ue.Primary,children:o})]},`add-${o}`)),o.remove.map(o=>e(Nd,{children:[t(Ye,{leftIcon:Ja,status:Le.Error,useSecondaryTone:!0,textColor:a.v2.colors.white[500],textSize:pe.XXS}),t(de,{size:pe.XS,color:ue.Primary,children:o})]},`remove-${o}`))]})})};function Od(e,t){const o=e.names[t];if(null==o)return"";if("string"==typeof o)return o;if("object"==typeof o&&"name"in o){const e=o.name;if("string"==typeof e)return e}return"number"==typeof o||"boolean"==typeof o?String(o):""}function Rd(e){const t=Math.abs(e);return t>=1e9?`${Dd(e/1e9)}s`:t>=1e6?`${Dd(e/1e6)}ms`:t>=1e3?`${Dd(e/1e3)}μs`:String(Math.round(e))}function Dd(e){return e.toFixed(2).replace(/\.?0+$/,"")}function Pd(e){const t=[];for(let o=0;o<e.levels.length;o++){const n=e.levels[o];let i=0;for(let e=0;e+3<n.length;e+=4){const a=n[e],l=n[e+1],r=n[e+2],s=n[e+3],c=i+a;t.push({level:o,offset:c,size:l,self:r,nameIndex:s}),i=c+l}}return t}function Fd(e){return`${e.level}:${e.offset}:${e.size}:${e.nameIndex}`}function Ld(e,t){const o=e.reduce((e,t)=>Math.max(e,t.level),t.level),n=new Map;for(const t of e){const e=n.get(t.level);e?e.push(t):n.set(t.level,[t])}const i=[t];for(let e=t.level+1;e<=o;e++){const t=i.filter(t=>t.level===e-1);if(0===t.length)break;const o=n.get(e);if(o?.length)for(const e of o)for(const o of t)if(e.offset>=o.offset&&e.offset+e.size<=o.offset+o.size){i.push(e);break}}return i}function Md(e,t){const o=t.trim().toLowerCase();return!o||e.toLowerCase().includes(o)}function _d(e,t){let o=0;for(let t=0;t<e.length;t++)o=31*o+e.charCodeAt(t)>>>0;const n=t.v2.colors.black[500],i=[{fill:t.v2.colors.purple[300],text:n},{fill:t.v2.colors.green[300],text:n},{fill:t.v2.colors.red[300],text:n},{fill:t.v2.colors.blue[300],text:n},{fill:t.v2.colors.yellow[300],text:n}];return i[o%i.length]}var zd,Bd;function Xd(e,t){return t<=0?"0":(100*e/t).toFixed(e/t<.001?2:1)}function Vd(e,t,o){for(const n of o)if(e>=n.x&&e<n.x+n.w&&t>=n.y&&t<n.y+n.h)return n;return null}function Ud(e){return e>=1073741824?`${(e/1073741824).toFixed(1)} GiB`:e>=1048576?`${(e/1048576).toFixed(1)} MiB`:e>=1024?`${(e/1024).toFixed(1)} KiB`:`${e} B`}(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(zd||(zd={})),(e=>{e[e.Fit=1]="Fit",e[e.X10=10]="X10"})(Bd||(Bd={}));const Gd=({flamebearer:o,maxRowPx:s,searchQuery:c="",shouldKeepName:d,minHostHeight:u=200,onFullscreenChange:p,profilingSlots:h,onFrameClick:g,onZoomedSymbolsChange:f,onResetZoom:v})=>{const y=b(),C=a(null),S=a(null),w=a({x:0,y:0}),x=a(o.numTicks),[k,T]=r({w:0,h:0}),[$,I]=r(""),[E,N]=r(null),[A,O]=r([]),[R,D]=r(!1),[P,F]=r(zd.Fit),[L,M]=r(Bd.Fit),[_,z]=r(!1),B=Math.max(1,Math.min(Math.floor(k.w*P),8192)),X=Math.max(1,Math.min(Math.floor(k.h*L),8192)),V=A.length>0?A[A.length-1]:null,U=V?.size??o.numTicks,G=i(()=>Pd(o),[o]);n(()=>{x.current!==o.numTicks&&(x.current=o.numTicks,O([]))},[o.numTicks]),n(()=>{if(!f)return;if(!V)return void f(null);const e=Ld(G,V),t=new Set;for(const n of e){const e=Od(o,n.nameIndex);e&&t.add(e)}f([...t])},[V,o,G,f]),m(()=>{const e=C.current;if(!e)return;const t=new ResizeObserver(()=>{const t=e.getBoundingClientRect();T({w:Math.floor(t.width),h:Math.floor(t.height)})});return t.observe(e),()=>t.disconnect()},[]),n(()=>{if(!R)return;const e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[R]),n(()=>(p?.(R),()=>{R&&p?.(!1)}),[R,p]);const H=i(()=>function(e,t,o,n,i,a={}){if(0===e.levels.length||t<2||o<2)return null;const{zoomRoot:l=null,shouldKeepName:r,collapseRecursive:s=!1,allRects:c}=a,d=c??Pd(e);let u=l?Ld(d,l):d;if(0===u.length)return null;if(r&&(u=u.filter(t=>r(Od(e,t.nameIndex))),0===u.length))return null;if(s&&(u=((e,t)=>{if(0===t.length)return t;const o=[...t].sort((e,t)=>e.level-t.level||e.offset-t.offset),n=new Map;for(const e of o){const t=n.get(e.level);t?t.push(e):n.set(e.level,[e])}const i=new Set;for(const t of o){const o=n.get(t.level+1);if(!o)continue;const a=o.filter(e=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);if(1!==a.length)continue;const l=a[0];l.size===t.size&&Od(e,l.nameIndex)===Od(e,t.nameIndex)&&i.add(Fd(l))}if(0===i.size)return o;const a=[];for(const e of o){if(i.has(Fd(e)))continue;let t=0;for(let o=0;o<e.level;o++){const a=n.get(o);if(!a)continue;const l=a.find(t=>e.offset>=t.offset&&e.offset+e.size<=t.offset+t.size);l&&i.has(Fd(l))&&t++}a.push({...e,level:e.level-t})}return a})(e,u),0===u.length))return null;const p=l?.level??0,h=l?.offset??0,m=l?.size??e.numTicks;if(m<=0)return null;const g=u.reduce((e,t)=>Math.max(e,t.level-p),0)+1,f=n??Number.POSITIVE_INFINITY,b=Math.max(1,Math.min(o/g,f)),v=i.trim(),y=b>8?1:0;return u.map(o=>{const n=o.level-p,i=(o.offset-h)/m*t,a=Math.max(o.size/m*t,1),l=n*b,r=Math.max(b-y,1),s=Od(e,o.nameIndex);return{...o,x:i,y:l,w:a,h:r,name:s,matchesSearch:Md(s,v)}})}(o,B,X,s,c,{zoomRoot:V,shouldKeepName:d,collapseRecursive:_,allRects:G}),[o,s,c,X,B,V,d,_,G]),j=i(()=>(e=>[...e].sort((e,t)=>t.level-e.level))(H?.length?c.trim()?H.filter(e=>e.matchesSearch):H:[]),[H,c]),W=l(e=>{if(B<2||X<2)return;const t=e.currentTarget.getBoundingClientRect();if(t.width<1||t.height<1)return;const n=Vd((e.clientX-t.left)/t.width*B,(e.clientY-t.top)/t.height*X,j);if(n){const e=Fd(n);N(e);const t=U>0?(100*n.size/U).toFixed(1):"0",i=o.numTicks>0?(100*n.size/o.numTicks).toFixed(1):"0";I(`${n.name}\ntotal ${Rd(n.size)} (${t}% of view, ${i}% of profile) · self ${Rd(n.self)}`)}else N(null),I("")},[j,o.numTicks,X,B,U]),K=l(e=>{W(e)},[W]),Y=l(()=>{N(null),I("")},[]),q=l(e=>{w.current={x:e.clientX,y:e.clientY}},[]),J=l(e=>{const{x:t,y:o}=w.current;if(Math.abs(e.clientX-t)>3||Math.abs(e.clientY-o)>3)return;if(B<2||X<2)return;const n=e.currentTarget.getBoundingClientRect();if(n.width<1||n.height<1)return;const i=Vd((e.clientX-n.left)/n.width*B,(e.clientY-n.top)/n.height*X,j);if(!i)return;g?.(i.name);const a=(e=>({level:e.level,offset:e.offset,size:e.size,self:e.self,nameIndex:e.nameIndex}))(i);O(e=>{const t=e.length>0?e[e.length-1]:null;return t&&((e,t)=>e.level===t.level&&e.offset===t.offset&&e.size===t.size&&e.nameIndex===t.nameIndex)(a,t)?e.slice(0,-1):[...e,a]})},[j,X,B,g]);m(()=>{const e=S.current;if(!e||B<2||X<2)return;const t="undefined"!=typeof window&&window.devicePixelRatio||1,n=Math.max(B,X),i=Math.min(t,16384/n);e.width=Math.floor(B*i),e.height=Math.floor(X*i),e.style.width=`${B}px`,e.style.height=`${X}px`;const a=e.getContext("2d");a&&(a.setTransform(i,0,0,i,0,0),a.clearRect(0,0,B,X),H?.length?((e,t,o,n,i,a,l,r)=>{const s=a.v2.colors.silver[900];e.fillStyle=s,e.fillRect(0,0,t,o);const c=i.trim().length>0;e.textRendering="optimizeLegibility";for(const t of n){const{x:o,y:n,w:i,h:l,name:s,size:d,matchesSearch:u}=t;if(c&&!u)continue;const{fill:p,text:h}=_d(s,a);e.fillStyle=p,e.fillRect(o,n,i,l),e.strokeStyle="rgba(255,255,255,0.14)",e.lineWidth=1,e.beginPath(),e.moveTo(o+.5,n+.5),e.lineTo(o+i-.5,n+.5),e.stroke(),e.strokeStyle="rgba(0,0,0,0.45)",e.lineWidth=1,e.strokeRect(o+.5,n+.5,Math.max(i-1,0),Math.max(l-1,0));const m=Xd(d,r),g=`${s} (${Rd(d)}, ${m}%)`,f=a.v2.text.size.xs,b=8,v=5,y=26,C=Math.min(f,Math.floor(l-2));if(i>=y&&C>=b){e.font=`${C}px ${a.font_family.primary}, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif`,e.textBaseline="middle",e.textAlign="left";let t=g;for(;t.length>2&&e.measureText(t).width>i-2*v;)t=`${t.slice(0,-2)}…`;e.measureText(t).width<=i-2*v&&(e.lineWidth=1,e.strokeStyle="rgba(0, 0, 0, 0.5)",e.lineJoin="round",e.miterLimit=1,e.strokeText(t,o+v,n+l/2),e.fillStyle=h,e.fillText(t,o+v,n+l/2))}}if(l)for(const t of n){if(Fd(t)!==l)continue;if(c&&!t.matchesSearch)continue;const{x:o,y:n,w:i,h:a}=t;e.strokeStyle="rgba(255,255,255,0.88)",e.lineWidth=2,e.strokeRect(o+1,n+1,Math.max(i-2,0),Math.max(a-2,0));break}})(a,B,X,H,c,y,E,o.numTicks):(a.fillStyle=y.v2.colors.silver[900],a.fillRect(0,0,B,X)))},[H,o.numTicks,E,c,X,B,y]);const Z=l(()=>D(e=>!e),[]),Q=o.numTicks>0?Math.max(0,Math.min(100,Math.round(U/o.numTicks*100))):100,ee=i(()=>((e,t,o)=>{const n=o??Pd(e),i=t?.offset??0,a=i+(t?.size??e.numTicks),l=(t?.level??-1)+1,r=t?.size??e.numTicks;let s=null;for(const e of n)e.level<l||e.offset<i||e.offset+e.size>a||e.size>=r||(!s||e.size>s.size||e.size===s.size&&e.level<s.level)&&(s=e);return s})(o,V,G),[o,V,G]),te=null!==ee,oe=A.length>0,ne=V?Od(o,V.nameIndex):"",ie=l(()=>{O([]),v?.()},[v]),re=l(()=>O(e=>e.slice(0,-1)),[]),se=l(()=>{ee&&O(e=>[...e,ee])},[ee]);return e("div",{style:R?{position:"fixed",inset:0,zIndex:9999,display:"flex",flexDirection:"column",gap:8,padding:16,background:y.v2.colors.silver[900]}:{flex:1,minHeight:u,minWidth:0,width:"100%",display:"flex",flexDirection:"column",gap:8,position:"relative"},children:[e(he,{$gap:8,$wrap:"nowrap",$justifyContent:"space-between",children:[t(ae,{label:"Collapse recursive",tooltip:"Collapse straight-line recursion (parent → single same-name child of equal width) into a single bar. Helps deep recursive call chains fit on screen.",labelAlign:le.Left,size:It.S,value:_,onChange:z}),e(he,{$gap:8,children:[e(he,{children:[t(me,{variant:fe.Secondary,size:ge.S,label:"Reset zoom",leftIcon:Za,onClick:ie,disabled:!A.length}),t(me,{variant:fe.Secondary,size:ge.S,iconSize:20,leftIcon:Ja,tooltip:"Zoom out",hideTooltipIcon:!0,disabled:!oe,onClick:re}),t("div",{style:{minWidth:36,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:t(de,{size:pe.XXS,color:ue.Secondary,nowrap:!0,align:"center",children:`${Q}%`})}),t(me,{variant:fe.Secondary,size:ge.S,iconSize:20,leftIcon:Sa,tooltip:"Zoom in",hideTooltipIcon:!0,disabled:!te,onClick:se})]}),e(he,{children:[t(Ee,{text:"Horizontal width: stretch the canvas wider than the viewport so narrow stacks become hoverable / readable.",children:t(be,{variant:xo.Filled,options:[{value:zd.Fit,label:"W: Fit"},{value:zd.X10,label:"10x"}],selected:P,setSelected:F})}),t(Ee,{text:"Vertical height: scale rows taller than the viewport for deep call stacks. Scroll vertically to navigate.",children:t(be,{variant:xo.Filled,options:[{value:Bd.Fit,label:"H: Fit"},{value:Bd.X10,label:"10x"}],selected:L,setSelected:M})})]}),t(me,{variant:fe.Secondary,size:ge.S,iconSize:24,leftIcon:R?La:Qa,tooltip:R?"Exit fullscreen (Esc)":"Fullscreen",hideTooltipIcon:!0,onClick:Z})]})]}),t(Ee,{fullWidth:!0,keepAlive:!0,text:$,children:t("div",{ref:C,style:{flex:1,minWidth:0,width:"100%",height:R?"calc(100vh - 80px)":"calc(100vh - 364px)",position:"relative",overflow:"hidden"},children:t("div",{style:{position:"absolute",inset:0,overflowX:P>1?"auto":"hidden",overflowY:L>1?"auto":"hidden"},children:t("div",{style:{width:B||"100%",height:X||"100%",position:"relative"},children:t("canvas",{ref:S,style:{display:"block",position:"absolute",left:0,top:0,width:"100%",height:"100%",borderRadius:8,cursor:E?"pointer":"default"},onPointerDown:q,onPointerMove:K,onPointerLeave:Y,onClick:J})})})})}),e(he,{$justifyContent:"space-between",children:[t(de,V?{size:pe.XXXS,color:y.v2.colors.silver[300],children:`Zoomed: ${ne} • ${Rd(U)} samples in view`}:{size:pe.XXXS,color:y.v2.colors.silver[300],children:g?"Click a frame to zoom in and jump to its row in the symbol table.":"Click a frame to zoom into its subtree (pprof-style)."}),h&&t(de,{size:pe.XXXS,color:y.v2.colors.silver[300],children:`${h.activeKeys.length} / ${h.maxSlots} profiling slots · ${Ud(h.totalBytesUsed)} / ${Ud(h.maxTotalBytesBudget)} budget · TTL ${h.slotTtlSeconds}s`})]})]})},Hd=[ko.Go,ko.Java],jd="Profiling Symbols";function Wd(e,t){if(0===t.length)return null;const o=1===t.length?t[0]:(e=>e.includes("/")||/\.\(\*?[^)]+\)\./.test(e)?ko.Go:e.includes(" ")||e.includes("(")?ko.Java:ko.Go)(e);if(o===ko.Go){const t=(e=>{let t=e.trim();if(!t)return null;t=t.replace(/\[[^\]]*\]/g,"");const o=t.lastIndexOf("/"),n=t.indexOf(".",o+1);if(-1===n)return null;const i=t.slice(0,n),a=t.slice(n+1);if(!i||!a)return null;const l=a.match(/^\(\*?([^)]+)\)\.(.+)$/);if(l){const e=new He(i,"",l[1],l[2]);return e.Verify()?e:null}const r=new He(i,a);return r.Verify()?r:null})(e);return t?{language:o,golang:t}:null}if(o===ko.Java){const t=(e=>{let t=e.trim();if(!t)return null;const o=t.indexOf("(");-1!==o&&(t=t.slice(0,o).trim());const n=t.split(/\s+/);t=n[n.length-1]??"";const i=t.lastIndexOf(".");if(-1===i)return null;const a=t.slice(0,i),l=t.slice(i+1),r=new je(a,l);return r.Verify()?r:null})(e);return t?{language:o,java:t}:null}return null}function Kd(e,t){return e.namespace===t.namespace&&e.name===t.name&&e.kind===t.kind}function Yd(e,t,o){if(!e)return!0;const{sources:n=[],namespaces:i=[],languages:a=[]}=e,l=!n.length||n.some(e=>Kd(e,t.id)),r=!i.length||i.includes(t.id.namespace),s=!a.length||null==o||a.includes(o);return l&&r&&s}function qd(e,t){return e.packageName===t.packageName&&(e.functionName||"")===(t.functionName||"")&&(e.receiverName||"")===(t.receiverName||"")&&(e.receiverMethodName||"")===(t.receiverMethodName||"")}function Jd(e,t){return e.className===t.className&&e.methodName===t.methodName}function Zd(e,t,o,n){const i=Wd(e,o);if(!i)return[];const a=[];for(const e of n){const o=e.customInstrumentations;if(!o)continue;if(!Yd(e.sourceScopes,t,i.language))continue;const n=!!i.golang&&!!o[We.Golang]?.some(e=>qd(e,i.golang)),l=!!i.java&&!!o[We.Java]?.some(e=>Jd(e,i.java));(n||l)&&a.push({rule:e,resolved:i})}return a}var Qd,eu,tu;(e=>{e.Symbol="symbol",e.Self="self",e.Total="total"})(Qd||(Qd={})),(e=>{e.OnlyInstrumentable="only-instrumentable"})(eu||(eu={})),(e=>{e.FilterOutVoid="filter-out-void",e.OnlyWithReturnValues="only-with-return-values"})(tu||(tu={}));const ou=/^[A-Za-z_$][A-Za-z0-9_$]*(\[\])*$/;function nu(e,t){const o=(e=>e.split(" ")[0]??"")(e);return(!t.includes(tu.FilterOutVoid)||"void"!==o)&&!!(!t.includes(tu.OnlyWithReturnValues)||e.includes(" ")&&"void"!==o&&ou.test(o))}const iu=({rows:e,languages:o,instrumentation:n,searchQuery:a,filters:r,onFiltersChange:s,zoomedSymbols:c,highlightSymbol:d,scrollSignal:u})=>{const p=!!o?.includes(ko.Java),h=i(()=>{const t=c?new Set(c):null,o=a?.trim().toLowerCase();return e.filter(e=>(!t||t.has(e.name))&&(!o||e.name.toLowerCase().includes(o)))},[e,a,c]),m=i(()=>{const e=[];if(n.selectionEnabled&&e.push({id:eu.OnlyInstrumentable,label:"Only show instrumentable symbols"}),p&&(e.push({id:tu.FilterOutVoid,label:"Filter out void symbols"}),e.push({id:tu.OnlyWithReturnValues,label:"Only show functions with return values"})),0!==e.length)return{options:e,filterRow:(e,t)=>{const o=e.cells.find(e=>e.key===Qd.Symbol)?.rawValue?.toString()??"";return!(t.includes(eu.OnlyInstrumentable)&&!n.getSymbolState(o).showCheckbox)&&nu(o,t)}}},[n,p]),g=i(()=>[{key:Qd.Symbol,label:"Symbol",flex:"0 0 160px",filterOverride:m,noFilter:!m},{key:Qd.Self,label:"Self",tooltip:"Time spent in this function itself, excluding time in functions it calls.",textAlign:"right",noFilter:!0},{key:Qd.Total,label:"Total",tooltip:"Time spent in this function and all functions it calls (inclusive).",textAlign:"right",noFilter:!0}],[m]),f=i(()=>h.map(e=>{const t=n.getSymbolState(e.name),o=t.showCheckbox;return{id:e.name,cells:[{key:Qd.Symbol,rawValue:e.name},{key:Qd.Self,rawValue:Rd(e.self)},{key:Qd.Total,rawValue:Rd(e.total)}],isSelected:o?n.isSelected(e.name):void 0,onSelect:o?()=>n.onToggleSymbol(e.name,!0):void 0,onDeselect:o?()=>n.onToggleSymbol(e.name,!1):void 0,hideCheckbox:!o,checkboxDisabled:o?t.checkboxDisabled:void 0,checkboxTooltip:o?t.checkboxTooltip:void 0}}),[h,n]),b=l(e=>{const t=e.cells[0].rawValue,o=n.getSymbolState(t),i=[];return o.inManagedRule?i.push({id:`remove-instrumentation-${t}`,label:"",leftIcon:Ca,tooltip:"Remove from the “Profiling Symbols” rule",onClick:()=>n.onRemove(t)}):i.push({id:`add-instrumentation-${t}`,label:"",leftIcon:Sa,tooltip:o.addTooltip,disabled:!o.addEnabled,onClick:()=>n.onAdd(t)}),i.push({id:`copy-${t}`,label:"",leftIcon:el,tooltip:"Copy symbol name",onClick:()=>{navigator.clipboard.writeText(t)}}),i},[n]);return t(To,{variant:$o.Data,maxHeight:"calc(100vh - 306px)",columns:g,rows:f,withCheckboxes:n.selectionEnabled,filters:r,onFiltersChange:s,activeRowId:d,scrollSignal:u,getRowActions:b})};var au;(e=>{e.Table="table",e.Flame="flame",e.Both="both"})(au||(au={}));const lu=f(Q)`
310
+ width: 100%;
311
+ flex: 1;
312
+ border-radius: 16px;
313
+ overflow: hidden;
314
+ background: ${({theme:e})=>e.v2.colors.silver[800]};
315
+ box-shadow: 0 2px 14.1px 0 rgba(0, 0, 0, 0.25);
316
+ `,ru=f.div`
317
+ display: flex;
318
+ align-items: center;
319
+ gap: 10px;
320
+ flex-wrap: wrap;
321
+ padding: 12px 12px 8px;
322
+ background: ${({theme:e})=>e.v2.colors.silver[800]};
323
+ border-radius: 16px 16px 0 0;
324
+ `,su=f(he)`
325
+ flex-shrink: 0;
326
+ align-items: center;
327
+ gap: 4px;
328
+ `,cu=f.div`
329
+ flex: 1;
330
+ display: flex;
331
+ align-items: stretch;
332
+ gap: ${({$gap:e})=>e}px;
333
+ padding: 16px;
334
+ background: ${({theme:e})=>e.v2.colors.silver[800]};
335
+ border-radius: 0 0 16px 16px;
336
+ `,du=f(Q)`
337
+ flex: ${({$splitWithFlame:e})=>e?"0 0 min(413px, 42%)":"1 1 auto"};
338
+ width: ${({$splitWithFlame:e})=>e?"auto":"100%"};
339
+ max-width: ${({$splitWithFlame:e})=>e?"none":"100%"};
340
+ gap: 10px;
341
+ `,uu=f(Q)`
342
+ flex: ${({$splitWithTable:e})=>e?"1":"1 1 auto"};
343
+ width: ${({$splitWithTable:e})=>e?"auto":"100%"};
344
+ gap: 10px;
345
+ `,pu=f(he)`
346
+ width: 100%;
347
+ min-height: 32px;
348
+ flex-shrink: 0;
349
+ `,hu=({source:o,onFlameFullscreenChange:c})=>{const d=b(),u=o.id,{profilingApi:p}=kl(),[h,m]=r(!0),[g,f]=r(au.Both),[v,y]=r(""),[C,S]=r({}),[w,x]=r(!1),k=a(!1);n(()=>{k.current||(k.current=!0,p.enableProfiling?.(u),x(!0))},[p,u]);const{data:T}=p.useSlots({skip:!w,pollInterval:3e3,fetchPolicy:"network-only"}),{data:$,loading:I,refetch:E}=p.useSourceProfiling(u,{skip:!w,pollInterval:h?3e3:0,fetchPolicy:"network-only"}),N=$?.profileJson??null,A=i(()=>(e=>{if(!e?.trim())return null;try{const t=JSON.parse(e),o=t.flamebearer;return!o?.names?.length||!Array.isArray(o.levels)||"number"!=typeof o.numTicks||o.numTicks<=0?null:{flamebearer:o,units:t.metadata?.units}}catch{return null}})(N),[N]),O=i(()=>A?(e=>{const t=new Map;for(let o=0;o<e.levels.length;o++){const n=e.levels[o];for(let o=0;o+3<n.length;o+=4){const i=n[o+1],a=n[o+2],l=Od(e,n[o+3]);if(!l)continue;const r=t.get(l);(!r||i>r.total)&&t.set(l,{self:a,total:i})}}return[...t.entries()].map(([e,t])=>({name:e,self:t.self,total:t.total})).sort((e,t)=>t.self-e.self)})(A.flamebearer):[],[A]),R=g===au.Table||g===au.Both,D=g===au.Flame||g===au.Both,P=R&&D,F=i(()=>o.runtimeInfo?.detectedLanguages||o.containers?.map(e=>e.overrides?.runtimeInfo?.language??e.runtimeInfo?.language??""),[o]),L=i(()=>((e,t)=>{if(!t?.includes(ko.Java))return;const o=(e?.[Qd.Symbol]?.filter(Boolean)??[]).filter(e=>e===tu.FilterOutVoid||e===tu.OnlyWithReturnValues);return 0!==o.length?e=>nu(e,o):void 0})(C,F),[C,F]),{instrumentation:M,pendingCount:_,pendingModify:z,closeModify:B,openBulkModify:X,resetSelection:V,confirmModify:U}=function({source:e,languages:t,rows:o}){const{instrumentationRulesApi:n,capabilities:a}=kl(),{items:s}=n.useRules(),[c,d]=r(new Set),[u,p]=r(new Set),[h,m]=r(null),g=i(()=>(e=>{const t=new Set(e??[]);return Hd.filter(e=>t.has(e))})(t),[t]),f=a.canCreateInstrumentationRule,b=i(()=>((e,t)=>{const o=e.filter(e=>e.type===Ke.CustomInstrumentation&&e.ruleName===jd&&Yd(e.sourceScopes,t));return o.find(e=>e.sourceScopes?.sources?.some(e=>Kd(e,t.id)))??o[0]??null})(s,e),[s,e]),v=f&&g.length>0,y=i(()=>{const t=new Map;for(const n of o){const o=!!Wd(n.name,g),i=Zd(n.name,e,g,s),a=!!b&&i.some(e=>e.rule.ruleId===b.ruleId),l=i.filter(e=>e.rule.ruleId!==b?.ruleId),r=!a&&l.length>0,c=v&&o,d=r;let u;if(r){const e=[...new Set(l.map(e=>e.rule.ruleName))];u=`Managed by ${e.length>1?"rules":"rule"} ${e.map(e=>`“${e}”`).join(", ")}. Edit ${e.length>1?"those rules":"that rule"} to change this symbol.`}let p=!1,h="Add this symbol to the “Profiling Symbols” rule";r?h=u??"Managed by another rule":0===i.length&&(0===g.length?h="Custom instrumentation is only available for Go and Java sources":f?o?p=!0:h="This symbol could not be parsed into a probe automatically":h="You don’t have permission to add custom instrumentation"),t.set(n.name,{parsable:o,inManagedRule:a,otherRules:l,showCheckbox:c,checkboxDisabled:d,checkboxTooltip:u,addEnabled:p,addTooltip:h})}return t},[o,s,e,g,f,v,b]),C=i(()=>{const e=new Set;return y.forEach((t,o)=>{t.inManagedRule&&e.add(o)}),e},[y]),S=i(()=>[...c].filter(e=>y.get(e)?.addEnabled&&!C.has(e)),[c,y,C]),w=i(()=>[...u].filter(e=>C.has(e)),[u,C]),x=S.length+w.length,k=l(e=>{const t=y.get(e);return t?.inManagedRule?!u.has(e):!!(t&&t.otherRules.length>0)||c.has(e)},[y,u,c]),T=l((e,t)=>{const o=y.get(e);o&&!o.checkboxDisabled&&(o.inManagedRule?p(o=>{const n=new Set(o);return t?n.delete(e):n.add(e),n}):d(o=>{const n=new Set(o);return t?n.add(e):n.delete(e),n}))},[y]),$=l(()=>{d(new Set),p(new Set)},[]),I=l(t=>{(async()=>{const o=t.add.map(e=>Wd(e,g)).filter(e=>!!e),i=t.remove.map(e=>Wd(e,g)).filter(e=>!!e);if(b){const{customInstrumentations:e,isEmpty:t}=((e,t,o)=>{const n=e.customInstrumentations??{};let i=[...n[We.Golang]??[]],a=[...n[We.Java]??[]];for(const e of o)e.golang&&(i=i.filter(t=>!qd(t,e.golang))),e.java&&(a=a.filter(t=>!Jd(t,e.java)));for(const e of t)e.golang&&!i.some(t=>qd(t,e.golang))&&i.push(e.golang),e.java&&!a.some(t=>Jd(t,e.java))&&a.push(e.java);return{customInstrumentations:{[We.Golang]:i,[We.Java]:a},isEmpty:0===i.length&&0===a.length}})(b,o,i);t?await n.remove(b.ruleId,Ke.CustomInstrumentation):await n.update(b.ruleId,((e,t)=>({ruleName:e.ruleName,notes:e.notes,disabled:e.disabled,sourceScopes:e.sourceScopes??null,workloads:null,instrumentationLibraries:e.instrumentationLibraries??null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:t}))(b,e),Ke.CustomInstrumentation)}else o.length>0&&await n.create(((e,t)=>{const o=e.map(e=>e.golang).filter(e=>!!e),n=e.map(e=>e.java).filter(e=>!!e),i={sources:[{namespace:t.id.namespace,name:t.id.name,kind:t.id.kind}],namespaces:[],languages:[]};return{ruleName:jd,notes:"Symbols selected from the profiling tab.",disabled:!1,sourceScopes:i,workloads:null,instrumentationLibraries:null,payloadCollection:null,codeAttributes:null,headersCollection:null,customInstrumentations:{[We.Golang]:o,[We.Java]:n}}})(o,e),Ke.CustomInstrumentation)})()},[b,g,e,n]),E=l(()=>{x&&m({add:S,remove:w})},[x,S,w]),N=l(e=>m({add:[e],remove:[]}),[]),A=l(e=>m({add:[],remove:[e]}),[]),O=l(()=>m(null),[]),R=l(()=>{h&&(I(h),m(null),$())},[h,I,$]),D=l(e=>y.get(e)??{parsable:!1,inManagedRule:!1,otherRules:[],showCheckbox:!1,checkboxDisabled:!1,addEnabled:!1,addTooltip:"Custom instrumentation is only available for Go and Java sources"},[y]);return{instrumentation:i(()=>({getSymbolState:D,onAdd:N,onRemove:A,selectionEnabled:v,isSelected:k,onToggleSymbol:T}),[D,N,A,v,k,T]),pendingCount:x,pendingModify:h,closeModify:O,openBulkModify:E,resetSelection:$,confirmModify:R}}({source:o,languages:F,rows:O}),[G,H]=r(null),[j,W]=r(0),[K,Y]=r(null),q=l(e=>{H(e),W(e=>e+1),f(e=>e===au.Flame?au.Both:e)},[]);return!N&&I?t(gt,{$height:"70vh",children:t(Ct,{withSpinner:!0})}):e(lu,{$gap:0,$width:"100%",children:[e(ru,{children:[t(Ee,{text:"Live CPU profile collected from the workload agent. Search symbols, switch between the table and flame graph, or download a JSON snapshot.",withIcon:!0,children:t(su,{children:t(de,{size:pe.S,weight:500,color:ue.Primary,nowrap:!0,children:"CPU Profiling"})})}),e(he,{style:{flex:1,minWidth:200,gap:10,alignItems:"center",flexWrap:"wrap"},children:[t("div",{style:{flex:"1 1 220px",minWidth:180},children:t(ao,{value:v,onChange:y,placeholder:"Search by symbol name",width:"100%",idleBackgroundColor:d.v2.colors.silver[900],emphasizeBackgroundColor:d.v2.colors.silver[800]})}),t(be,{variant:xo.Filled,options:[{value:au.Table,label:"Top table"},{value:au.Flame,label:"Flame graph"},{value:au.Both,label:"Both"}],selected:g,setSelected:f}),t(me,h?{variant:fe.Secondary,size:ge.S,label:"Live",tooltip:"Odigos profiler works in-memory and doesn't store any data on disk, to keep minimum memory footprint we store only last 10 minutes of data on demand",leftIcon:e=>t(tl,{...e,size:8,fill:d.v2.colors.green[500]})}:{variant:fe.Secondary,size:ge.S,label:"Paused",tooltip:"Odigos profiler is still collecting data, but the UI is not updating in real time",leftIcon:e=>t(tl,{...e,size:8,fill:d.v2.colors.red[500]})})]})]}),t(cu,{$gap:R&&D?16:0,children:A?e(s,{children:[R&&e(du,{$splitWithFlame:P,children:[e(pu,{$justifyContent:"space-between",children:[e(Q,{$margin:"0 0 0 20px",children:[t(de,{size:pe.XXXS,nowrap:!0,children:"Please select symbols to"}),e(he,{$gap:8,children:[e(he,{children:[t(ol,{size:24}),t(de,{size:pe.S,color:ue.Success,nowrap:!0,children:"Custom Instrument"})]}),t(me,{leftIcon:Ta,variant:fe.Secondary,size:ge.S,onClick:()=>window.open(`${Me}/enterprise/pipeline/rules/custominstrumentation`,"_blank","noopener noreferrer")})]})]}),e(he,{$gap:8,children:[K&&t(Ee,{text:"The table is scoped to the symbols inside the flame graph’s current zoom. Use “Reset zoom” on the flame graph to show all symbols again.",children:t(Ye,{label:`Zoomed: ${K.length} symbols`,backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:pe.XXS})}),t(me,{variant:fe.Secondary,size:ge.S,label:"Download snapshot",rightIcon:nl,onClick:()=>{if(!N)return;const e=new Blob([N],{type:"application/json"}),t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=`cpu-profile-${o.id.namespace}-${o.id.kind}-${o.id.name}.json`,n.click(),URL.revokeObjectURL(t)},disabled:!N})]})]}),t(iu,{rows:O,languages:F,instrumentation:M,searchQuery:v,filters:C,onFiltersChange:S,zoomedSymbols:K,highlightSymbol:G,scrollSignal:j})]}),D&&e(uu,{$splitWithTable:P,children:[e(pu,{$justifyContent:"space-between",children:[t(Ye,{label:A?`Total in view ${Rd(A.flamebearer.numTicks)}`:"No profile sample yet",backgroundColor:d.v2.colors.silver[750],textColor:d.v2.colors.silver[200],textSize:pe.XXS}),e(he,{$gap:12,children:[!h&&t(me,{variant:fe.Secondary,size:ge.S,label:"Refresh",leftIcon:Ga,onClick:E}),t(ae,{label:"Auto refresh",labelAlign:le.Left,size:It.S,value:h,onChange:m})]})]}),t(Gd,{flamebearer:A.flamebearer,maxRowPx:24,searchQuery:v,shouldKeepName:L,minHostHeight:280,onFullscreenChange:c,profilingSlots:T??null,onFrameClick:q,onZoomedSymbolsChange:Y,onResetZoom:()=>H(null)},g)]})]}):t(gt,{children:t(Oe,{title:"No profile samples yet",subTitle:"Dynamically collecting profiling samples — keep this tab open while the agent sends OTLP profiles."})})}),t(Ad,{pendingModify:z,onClose:B,onConfirm:U}),t(Io,{isOpen:_>0,richTitle:{icon:Ma,title:"Profiling Symbols",badge:{label:_}},actions:[{id:"profiling-bulk-cancel",type:io.Button,buttonProps:{variant:fe.Secondary,size:ge.S,label:"Cancel",onClick:V}},{id:"profiling-bulk-apply",type:io.Button,buttonProps:{variant:fe.Primary,size:ge.S,label:"Modify Rule",leftIcon:Ia,onClick:X}}]})]})},mu=f.div`
350
+ position: relative;
351
+ display: flex;
352
+ align-items: center;
353
+ gap: 8px;
354
+ padding: 8px 16px;
355
+ border-radius: 12px;
356
+ background-color: ${({theme:e})=>e.v2.colors.silver[700]};
357
+ `,gu=f.div`
358
+ display: flex;
359
+ flex-direction: column;
360
+ gap: 4px;
361
+ flex: 1;
362
+ min-width: 0;
363
+ opacity: ${({$disabled:e})=>e?.4:1};
364
+ `,fu=f.div`
365
+ flex-shrink: 0;
366
+ display: flex;
367
+ align-items: center;
368
+ margin-right: ${({$reserveJumpSpace:e})=>e?"32px":"0"};
369
+ `,bu=f.div`
370
+ min-width: 0;
371
+ white-space: pre;
372
+ overflow-x: auto;
373
+ `,vu=f.div`
374
+ position: absolute;
375
+ top: 50%;
376
+ right: 8px;
377
+ transform: translateY(-50%);
378
+ opacity: 0;
379
+ pointer-events: none;
380
+ transition: opacity 0.15s ease;
381
+
382
+ ${mu}:hover & {
383
+ opacity: 1;
384
+ pointer-events: auto;
385
+ }
386
+ `,yu=({name:o,summary:n,disabled:i=!1,onJumpToRule:a})=>{const l=b();return e(mu,{children:[e(gu,{$disabled:i,children:[o&&t(de,{size:pe.XXXS,color:ue.Secondary,nowrap:!0,children:o}),t(bu,{children:t(w,{parts:n})})]}),i&&t(fu,{$reserveJumpSpace:!!a,children:t(Ye,{label:Eo,textSize:pe.XXXS,backgroundColor:l.v2.colors.grey[700],textColor:l.v2.colors.grey[300]})}),a&&t(vu,{children:t(Ee,{text:Qe.OPEN_IN_SAMPLING_PAGE,children:t(me,{"data-id":"sampling-rule-jump",variant:fe.Primary,size:ge.S,leftIcon:Qa,onClick:a})})})]})},Cu=f.div`
387
+ opacity: 0;
388
+ pointer-events: none;
389
+ transition: opacity 0.15s ease;
390
+ `,Su=f.div`
391
+ &:hover ${Cu} {
392
+ opacity: 1;
393
+ pointer-events: auto;
394
+ }
395
+ `,wu=f.div`
396
+ display: flex;
397
+ align-items: center;
398
+ padding: 4px 12px;
399
+ `,xu=({source:e,onRedirectToSampling:o})=>t(Lt,{bgTint:"1000",richTitle:{title:Qe.CONTAINERS,badge:{label:e.containers?.length??0}},children:e.containers?.map(e=>t($u,{container:e,onRedirectToSampling:o},e.containerName))});var ku;(e=>{e.All="all",e.Noisy="noisy",e.HighlyRelevant="highly-relevant",e.CostReduction="cost-reduction"})(ku||(ku={}));const Tu=e=>"noisy"===e.type?x(e.rule,"source"):"highlyRelevant"===e.type?k(e.rule,"source"):"costReduction"===e.type?T(e.rule,"source"):[],$u=({container:o,onRedirectToSampling:n})=>{const[a,l]=r(ku.All),s=ro(e=>e.setPendingViewSamplingRule),c=o.agentConfig?.traces?.headSampling?.noisyOperations??[],d=i(()=>(o.collectorConfig?.tailSampling?.noisyOperations??[]).map(e=>({type:"noisy",rule:e})),[o.agentConfig?.traces?.headSampling?.noisyOperations]),u=i(()=>(o.collectorConfig?.tailSampling?.highlyRelevantOperations??[]).map(e=>({type:"highlyRelevant",rule:e})),[o.collectorConfig?.tailSampling?.highlyRelevantOperations]),p=i(()=>(o.collectorConfig?.tailSampling?.costReductionRules??[]).map(e=>({type:"costReduction",rule:e})),[o.collectorConfig?.tailSampling?.costReductionRules]),h=i(()=>a===ku.Noisy?d:a===ku.HighlyRelevant?u:a===ku.CostReduction?p:[...d,...u,...p],[a,u,p]),m=d.length+u.length+p.length,g=i(()=>(e,t)=>{s({ruleId:e,category:t}),n()},[n,s]),f=t(Cu,{children:t(me,{"data-id":"sampling-container-create-rule",variant:fe.Secondary,size:ge.S,label:No,rightIcon:Sa,onClick:e=>{e.stopPropagation(),n()}})});return t(Su,{children:e(Lt,{bgTint:"900",richTitle:{title:o.containerName},renderOnRightSide:f,withCollapse:!0,collapseIsDefaultOpen:!0,children:[c.length?e(Lt,{bgTint:"800",richTitle:{title:Qe.HEAD_SAMPLING,badge:{label:c.length}},children:[t(de,{size:pe.XXS,children:Qe.NOISY_OPERATIONS}),t(Q,{$gap:4,children:c.map(e=>t(yu,{name:e.name,summary:x(e),disabled:e.disabled,onJumpToRule:()=>g(e.ruleId,"noisy")},e.ruleId))})]}):t(wu,{children:t(de,{size:pe.XS,color:ue.Secondary,children:Qe.HEAD_SAMPLING})}),m?e(Lt,{bgTint:"800",richTitle:{title:Qe.TAIL_SAMPLING,badge:{label:m}},children:[t(be,{options:(b=d.length,v=u.length,y=p.length,[{value:ku.All,label:"All",badge:{label:b+v+y,textSize:pe.XXXS}},{value:ku.Noisy,label:Qe.NOISY_OPERATIONS,badge:{label:b,textSize:pe.XXXS}},{value:ku.HighlyRelevant,label:Qe.HIGHLY_RELEVANT_OPERATIONS,badge:{label:v,textSize:pe.XXXS}},{value:ku.CostReduction,label:Qe.COST_REDUCTION_OPERATIONS,badge:{label:y,textSize:pe.XXXS}}]),selected:a,setSelected:l}),t(Q,{$gap:4,children:h.length?h.map(e=>t(yu,{name:e.rule.name,summary:Tu(e),disabled:e.rule.disabled,onJumpToRule:()=>g(e.rule.ruleId,e.type)},e.rule.ruleId)):t(Oe,{title:`No ${a===ku.All?`${ku.Noisy}, ${ku.HighlyRelevant} and ${ku.CostReduction}`:a} operations`})})]}):t(wu,{children:t(de,{size:pe.XS,color:ue.Secondary,children:Qe.TAIL_SAMPLING})})]})});var b,v,y},Iu=[mo.Deployment,mo.StatefulSet,mo.DaemonSet,mo.DeploymentConfig,mo.Rollout,mo.Pod];var Eu;(e=>{e.Workload="Workload",e.Pod="Pod"})(Eu||(Eu={}));const Nu=e=>!!e&&Qt(e.status)===Le.Error,Au=e=>Nu(e.healthStatus),Ou=e=>Nu(e.odigosHealthStatus)||(e.processes??[]).some(Au),Ru=e=>Nu(e.agentInjectedStatus)||Nu(e.odigosHealthStatus)||(e.containers??[]).some(Ou),Du=({onClose:o,sourceId:s,onRedirectToSampling:c})=>{const d=b(),{isVm:u}=C(),{sourcesApi:p,configApi:h}=kl(),{selectedStreamName:m}=et(),{genericForm:g,loadSource:f,validateFormData:v}=El(),{data:y}=h.useEffectiveConfig(),[S,w]=r(!1),[x,k]=r(!1),[T,$]=r(!1),[I,E]=r(Nc.Overview),[N,A]=r(null),[O,R]=r({openFor:null}),D=(()=>{const[e,t]=r(null),o=l(e=>{t({tab:Nc.Pods,podName:e.podName})},[]),n=l((e,o)=>{t({tab:Nc.Pods,podName:e.podName,containerName:o.containerName})},[]),a=l((e,o,n)=>{const i=Fc({identifyingAttributes:n.identifyingAttributes});t({tab:Nc.Pods,podName:e.podName,containerName:o.containerName,processPid:i})},[]),s=l(()=>t(null),[]);return i(()=>({jumpToTarget:e,jumpToPod:o,jumpToContainer:n,jumpToProcess:a,clearJumpToTarget:s}),[e,o,n,a,s])})();n(()=>{D.jumpToTarget&&E(D.jumpToTarget.tab)},[D.jumpToTarget]),n(()=>{N&&JSON.stringify(so(s))!==JSON.stringify(so(N))&&A(null)},[s,N]);const P=a(!1),F=l(async()=>A(await p.fetchById(s)||null),[s,p]);n(()=>{if(P.current||(F(),P.current=!0),!S){const e=setInterval(()=>F(),3e3);return()=>clearInterval(e)}},[F,S]),n(()=>{N&&f(N)},[N]);const L=N&&Iu.includes(N.id.kind),M=i(()=>{const e=[],o=(N?.pods??[]).some(Ru);return e.push({value:Nc.Overview,label:Qe.OVERVIEW}),u||(e.push({value:Nc.Pods,label:Qe.PODS,icon:o?e=>t(Ha,{...e,fill:d.v2.colors.red[500]}):void 0}),e.push({value:Nc.PeerSources,label:Qe.PEER_SOURCES}),y?.profiling?.enabled&&e.push({value:Nc.Profiling,label:Qe.PROFILING}),e.push({value:Nc.Sampling,label:Qe.SAMPLING}),e.push({value:Nc.Debug,label:Qe.DEBUG})),e},[u,y,N?.pods]),_=l(()=>w(!0),[]),z=i(()=>()=>{o(),c()},[o,c]),B=l(()=>{N&&f(N),w(!1)},[N]),X=l(async()=>{if(!N||!g)return;const{errorMessage:e,preparedFormData:t}=v();if(e)return;const o=t.otelServiceName!==N.id.name?t.otelServiceName:"";await p.update(s,{...t,otelServiceName:o}),w(!1)},[N,g,v,s,p]),V=l(()=>k(!0),[]),U=l(async()=>{N&&(await p.persistV2({[Ot]:[{namespace:N.id.namespace,name:N.id.name,kind:N.id.kind,selected:!1,currentStreamName:m}]}),k(!1),o())},[N,p,m,o]),G=l(()=>{R({openFor:Eu.Workload})},[]),H=l(e=>{E(e),D.clearJumpToTarget()},[D]),j=l(async()=>{await p.recoverFromRollback(s)},[p,s]),W=l(()=>R({openFor:null}),[]),K=l(async()=>{O.openFor===Eu.Workload?await p.restartWorkloads([s]):O.openFor===Eu.Pod&&O.podNamespace&&O.podName&&await p.restartPod(O.podNamespace,O.podName),W()},[O,p,s,W]),Y=i(()=>{const{kind:e,name:t}=s;return{title:`Rollout ${e}`,description:`Are you sure you want to rollout the ${e.toLowerCase()} "${t}"?`}},[s]),q=i(()=>{const e=[];return S||I===Nc.Overview&&(e.push({id:"edit-source-btn-edit",label:Ft.EDIT,icon:Ia,active:S,onClick:_}),!u&&L&&e.push({id:"edit-source-btn-restart",label:Qe.ROLLOUT,icon:il,onClick:G}),e.push({id:"edit-source-btn-delete",label:Ft.UNINSTRUMENT,icon:Ca,color:d.v2.colors.red[500],active:x,onClick:V})),e},[I,S,x,u,L,_,G,V,d]),J=i(()=>{if(!N)return[];const e=[],t={backgroundColor:"transparent",textSize:pe.S};return e.push({...t,label:N.id.name,leftIcon:u?void 0:Ua}),N.serviceName&&N.serviceName!==N.id.name&&e.push({...t,label:N.serviceName,leftIcon:Va,textColor:d.v2.colors.silver[200]}),e},[N,d,u]);if(!N)return t(se,{isOpen:!0,children:t(gt,{$height:"80vh",children:t(Ct,{withSpinner:!0})})});const Z=I===Nc.Profiling?T?"95vw":"fit-content":S?void 0:"60vw";return e(Gc,{value:D,children:[t(se,{isOpen:!0,width:Z,minWidth:"777px",header:{icon:u?al:Ao(N.containers)[0],titleBadges:J,onClose:()=>{H(Nc.Overview),A(null),$(!1),o()},actions:q},footer:{actions:S?[{"data-id":"edit-source-btn-cancel",label:Ft.CANCEL,variant:fe.Secondary,onClick:B},{"data-id":"edit-source-btn-save",label:Ft.SAVE,variant:fe.Primary,onClick:X}]:[]},children:t(ht,{$padding:"4px 12px 12px",children:e(Q,{$gap:16,children:[!S&&M.length>1&&t(be,{options:M,selected:I,setSelected:H}),(()=>{switch(I){case Nc.Overview:return S?t(Ms,{}):t(Id,{source:N,onClickRollout:G,onClickRollback:j});case Nc.Pods:return t(Yc,{source:N,onClickRestartPod:L?(e,t)=>R({openFor:Eu.Pod,podNamespace:e,podName:t}):void 0});case Nc.PeerSources:return t(Jc,{source:N});case Nc.Profiling:return t(hu,{source:N,onFlameFullscreenChange:$});case Nc.Sampling:return t(xu,{source:N,onRedirectToSampling:z});case Nc.Debug:return t(od,{source:N});default:return null}})()]})})}),t(ir,{target:"source",action:"uninstrument",isOpen:x,onClose:()=>k(!1),onApprove:U}),t(Ze,{isOpen:O.openFor===Eu.Workload,title:Y.title,description:Y.description,onClose:W,denyButton:{label:"Go back",variant:fe.Secondary,onClick:W},approveButton:{label:Ft.CONFIRM,variant:fe.Primary,onClick:K}}),t(ir,{target:"pod",action:"restart",description:Qe.ROLLOUT_RESTART_WORKLOADS_DESCRIPTION,isOpen:O.openFor===Eu.Pod,onClose:W,onApprove:K,overrideApproveButtonLabel:Qe.DELETE_POD_TO_RESTART})]})},Pu=f.div`
400
+ display: flex;
401
+ align-items: center;
402
+ gap: 8px;
403
+ padding: 8px;
404
+ cursor: pointer;
405
+ border-radius: 6px;
406
+ &:hover {
407
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
408
+ }
409
+ `,Fu=f.div`
410
+ flex: 1;
411
+ `,Lu=({onClick:o})=>{const n=b().v2.colors.red[500];return e(Pu,{"data-id":"sampling-view-btn-delete",onClick:o,children:[t(de,{size:pe.XS,weight:500,color:n,children:Po}),t(Ca,{size:16,fill:n})]})};const Mu={[Al.EditAutoNoisy]:{title:Ko,subTitle:Wo,cancelId:"sampling-edit-auto-rule-btn-cancel",saveId:"sampling-edit-auto-rule-btn-save"},[Al.EditAutoCostReduction]:{title:jo,subTitle:Ho,cancelId:"sampling-edit-cost-reduction-auto-rule-btn-cancel",saveId:"sampling-edit-cost-reduction-auto-rule-btn-save"},[Al.EditAutoHighlyRelevant]:{title:Go,subTitle:Uo,cancelId:"sampling-edit-highly-relevant-auto-rule-btn-cancel",saveId:"sampling-edit-highly-relevant-auto-rule-btn-save"}},_u=({isOpen:e,title:o,subTitle:n,onClose:i,footer:a,renderBody:l})=>t(se,{isOpen:e,width:qo,header:{icon:ll,title:o,subTitle:n,onClose:i},footer:a,children:l?l():t(ht,{$padding:"12px",children:t(Us,{})})}),zu=({isOpen:a,onClose:s,onSubmit:c,validateForm:d,onNavigateToDuplicate:u})=>{const{category:p,formData:h,resetForm:m,duplicateWarning:g,setDuplicateWarning:f}=Nl(Al.Create),[b,v]=r(!1);n(()=>{a&&(m(),v(!1))},[a]);const y=l(()=>{v(!1),c(h)},[h,c]),C=l(()=>{if(d){const e=d(h);if(e)return void f(e)}((e,t)=>JSON.stringify(e)===JSON.stringify($(t)))(h,p)?v(!0):y()},[h,p,d,f,y]),S=i(()=>b?((e,t)=>{switch(e){case"noisy":return x(N(t));case"highlyRelevant":return k(E(t));case"costReduction":return T(I(t))}})(p,h):[],[b,p,h]),w={note:g?{status:Le.Warning,message:g.message,action:u?{"data-id":"sampling-create-btn-view-duplicate",label:"View rule",onClick:()=>u(g.ruleId)}:void 0}:void 0,actions:[{"data-id":"sampling-create-btn-cancel",label:Oo,variant:fe.Secondary,size:ge.S,onClick:s},{"data-id":"sampling-create-btn-submit",label:No,variant:fe.Primary,size:ge.S,onClick:C,disabled:!!g}]};return e(o,{children:[t(_u,{isOpen:a,title:_o[p],subTitle:Fo[p],onClose:s,footer:w}),t(Ze,{isOpen:b,title:Xo,description:Bo,onClose:()=>v(!1),denyButton:{"data-id":"sampling-create-default-continue-editing",label:zo,variant:fe.Secondary,onClick:()=>v(!1)},approveButton:{"data-id":"sampling-create-default-confirm",label:No,variant:fe.Primary,onClick:y},children:e(Q,{$gap:8,$alignItems:"flex-start",style:{width:"100%"},children:[t(de,{size:pe.XS,weight:500,color:ue.Secondary,children:Vo}),t("div",{style:{width:"100%"},children:t(Kl,{summary:S})})]})})]})},Bu=({onClose:n,onDelete:a,onSaveEdit:r,validateForm:s,onNavigateToDuplicate:c})=>{const{data:d,isEditing:u,formData:p,handleEdit:h,handleCancelEdit:m,duplicateWarning:g,setDuplicateWarning:f}=Nl(Al.View),b=d?.rule.name||Mo,v=u&&d?Lo[d.category]:`${b} preview`,y=l(()=>{if(d&&u){if(s){const e=s(p);if(e)return void f(e)}r(p,d.rule.ruleId,d.samplingId),m()}},[d,u,p,r,s,f,m]),C=l(()=>{d&&a(d.rule.ruleId,d.samplingId)},[d,a]),S=i(()=>{if(!d)return;const i=g?{message:g.message,onViewRule:c?()=>c(g.ruleId):void 0}:null;return function(n){if(n.isEditing){const{onCancelEdit:i,onSave:a,onDelete:l,duplicateWarning:r}=n;return{children:e(o,{children:[t(Lu,{onClick:l}),r&&t(Fe,{status:Le.Warning,message:r.message,action:r.onViewRule?{"data-id":"sampling-view-edit-btn-view-duplicate",label:"View rule",onClick:r.onViewRule}:void 0}),t(Fu,{}),t(me,{"data-id":"sampling-view-edit-btn-cancel",label:Oo,variant:fe.Secondary,size:ge.S,onClick:i}),t(me,{"data-id":"sampling-view-edit-btn-save",label:Ro,variant:fe.Primary,size:ge.S,onClick:a,disabled:!!r})]})}}const{onDelete:i,onCancel:a,onEdit:l}=n;return{children:e(o,{children:[t(Lu,{onClick:i}),t(Fu,{}),t(me,{"data-id":"sampling-view-btn-cancel",label:Oo,variant:fe.Secondary,size:ge.S,onClick:a}),t(me,{"data-id":"sampling-view-btn-edit",label:Do,variant:fe.Primary,size:ge.S,onClick:l})]})}}(u?{isEditing:!0,onCancelEdit:m,onSave:y,onDelete:C,duplicateWarning:i}:{isEditing:!1,onDelete:C,onCancel:n,onEdit:h})},[d,u,g,m,y,C,h,n,c]);return t(_u,{isOpen:!!d,title:v,subTitle:d?Fo[d.category]:"",onClose:n,footer:S})},Xu=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i,resolvedPercentage:a}=Nl(Al.EditAutoNoisy),r=l(()=>n(i,a),[n,i,a]);return t(Gu,{formType:Al.EditAutoNoisy,isOpen:e,onClose:o,onSave:r})},Vu=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i,resolvedPercentage:a}=Nl(Al.EditAutoCostReduction),r=l(()=>n(i,a),[n,i,a]);return t(Gu,{formType:Al.EditAutoCostReduction,isOpen:e,onClose:o,onSave:r})},Uu=({isOpen:e,onClose:o,onSave:n})=>{const{localEnabled:i}=Nl(Al.EditAutoHighlyRelevant),a=l(()=>n(i),[n,i]);return t(Gu,{formType:Al.EditAutoHighlyRelevant,isOpen:e,onClose:o,onSave:a})},Gu=({formType:e,isOpen:o,onClose:n,onSave:i})=>{const a=Mu[e];return t(_u,{isOpen:o,title:a.title,subTitle:a.subTitle,onClose:n,footer:{actions:[{"data-id":a.cancelId,label:Oo,variant:fe.Secondary,size:ge.S,onClick:n},{"data-id":a.saveId,label:Yo,variant:fe.Primary,size:ge.S,onClick:i}]}})},Hu=e=>{switch(e.formType){case Al.Create:return t(Ll,{formType:Al.Create,category:e.category,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(zu,{...e})});case Al.View:return t(Ll,{formType:Al.View,data:e.data,defaultEditMode:e.defaultEditMode,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions,children:t(Bu,{...e})});case Al.EditAutoNoisy:return t(Ll,{formType:Al.EditAutoNoisy,enabled:e.enabled,keepPercentage:e.keepPercentage,children:t(Xu,{...e})});case Al.EditAutoCostReduction:return t(Ll,{formType:Al.EditAutoCostReduction,enabled:e.enabled,dropPercentage:e.dropPercentage,children:t(Vu,{...e})});case Al.EditAutoHighlyRelevant:return t(Ll,{formType:Al.EditAutoHighlyRelevant,enabled:e.enabled,children:t(Uu,{...e})})}},ju=({token:n,isLoading:i,isEditing:a,onEdit:l,onCancel:r,onSave:s,formData:c,handleFormChange:d,handleErrorChange:u,formErrors:p})=>{const{CopyButton:h}=fo(),m=!a||i||!c.newToken;return Jo({key:"Enter",active:!m},s),e(he,a?{$justifyContent:"space-between",$alignItems:"flex-start",$gap:12,children:[t(xe,{type:"password",value:c.newToken,onChange:e=>{d("newToken",e.target.value),u("newToken",void 0)},width:"430px",autoFocus:!0,errorMessage:p.newToken}),t(he,{$margin:i?"8px 0 0 0":"2px 0 0 0",$alignItems:"center",children:i?t(Ct,{title:"Saving...",withGradient:!0}):e(o,{children:[t(me,{variant:fe.Secondary,size:ge.S,leftIcon:La,onClick:r,disabled:i}),t(me,{variant:fe.Primary,size:ge.S,leftIcon:Fa,onClick:s,disabled:m})]})})]}:{$justifyContent:"space-between",$gap:12,children:[t(de,{size:pe.XS,children:new Array(55).fill("•").join("")}),e(he,{$alignItems:"center",$justifyContent:"space-between",children:[t(h,{value:n}),t(vt,{icon:Ia,onClick:l})]})]})},Wu=({expiresAt:e,callbackValid:o,callbackExpired:a})=>{const{formatTimeAgo:l}=Kt(),r=i(()=>l(e),[e,l]),s=i(()=>new Date(e).toDateString().split(" ").slice(1).join(" "),[e]),c=i(()=>Zo(e,0)?Le.Error:Zo(e,2592e6)?Le.Warning:Le.Success,[e]),d=i(()=>c===Le.Success?Fa:c===Le.Warning?rl:Ha,[c]);return n(()=>{c===Le.Success?o():c===Le.Error&&a()},[c]),t(Ee,{text:s,children:t(Ye,{leftIcon:d,label:r,status:c,invertColors:!0,useSecondaryTone:!0})})},Ku=f.div`
412
+ display: flex;
413
+ flex-direction: column;
414
+ gap: 12px;
415
+ padding: 16px;
416
+ border-radius: 12px;
417
+ border: 1px solid ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[500]:e.v2.colors.silver[600]};
418
+ background-color: ${({theme:e,$isExpired:t})=>t?e.v2.colors.red[1e3]:e.v2.colors.silver[800]};
419
+ `,Yu=({children:e})=>{const o=b();return t(de,{size:pe.XXXS,color:o.v2.colors.grey[150],children:e})},qu=({token:o})=>{const{tokensApi:n}=kl(),[i,a]=r(!1),[l,s]=r(!1),[c,d]=r(!1),{formData:u,handleFormChange:p,formErrors:h,handleErrorChange:m,resetFormData:g}=zt({newToken:""});return t(ct,{richTitle:{icon:sl,title:"Odigos Pro Token"},children:e(Ku,{$isExpired:c,children:[e(he,{$justifyContent:"space-between",children:[e(Q,{$gap:4,children:[t(Yu,{children:"Issued for"}),t(de,{size:pe.XS,children:o.name||"N/A"})]}),e(Q,{$gap:4,children:[t(Yu,{children:"Expiration"}),t(Wu,{expiresAt:o.expiresAt,callbackValid:()=>d(!1),callbackExpired:()=>d(!0)})]}),t(Q,{})]}),t(he,{children:e(Q,{children:[t(Yu,{children:"Token"}),t(ju,{token:o.token,newToken:u.newToken,isLoading:i,isEditing:l,onEdit:()=>s(!0),onCancel:()=>(s(!1),void p("newToken","")),onSave:()=>(async()=>{if(!n.updateToken)return;a(!0);const e=await n.updateToken(u.newToken.trim());a(!1),e?.error?m("newToken",e.error):(s(!1),g())})(),formData:u,handleFormChange:p,handleErrorChange:m,formErrors:h})]})})]})})},Ju=f.div`
420
+ display: flex;
421
+ flex-direction: column;
422
+ align-items: center;
423
+ justify-content: center;
424
+ gap: 12px;
425
+ padding: 12px 24px;
426
+ border-radius: 8px;
427
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
428
+ `,Zu=()=>{const{progress:o}=Nt(),{describeApi:n,namespacesApi:i}=kl(),{items:a}=i.useNamespaces(),[l,s]=r(null),{formData:c,handleFormChange:d,resetFormData:u}=zt({includeProfiles:!0,includeMetrics:!0,includeSourceWorkloads:!1,sourceWorkloadNamespaces:[]});return t(ct,{richTitle:{icon:cl,title:"Diagnose"},children:l?e(Ju,{children:[t(Ct,{title:"Creating file...",subTitle:"This may take a few moments. Do not refresh the page.",withGradient:!0,withSpinner:"number"==typeof o[Rt.DownloadingDiagnose]?.percentage,percentage:o[Rt.DownloadingDiagnose]?.percentage,withVisual:"number"!=typeof o[Rt.DownloadingDiagnose]?.percentage,visualIcon:nl,startedAt:l}),o[Rt.DownloadingDiagnose]?.list?.length&&t(Q,{$width:"100%",children:o[Rt.DownloadingDiagnose].list.map((o,n)=>e(he,{$gap:4,$alignItems:"center",children:[o.status===Le.Success?t(Fa,{size:16}):o.status===Le.Error?t(La,{size:16}):t(Ct,{withSpinnerOld:!0,scaleSpinnerOld:.7}),t(de,{size:pe.XXXS,color:ue.Secondary,children:o.label})]},`diagnose-item-${n}-${o.label}`))})]}):e(Q,{$gap:24,children:[t(de,{size:pe.XXS,color:ue.Secondary,children:"Download a tar.gz file with diagnostics from this cluster. Select which data to include before downloading, and share the file with the Odigos support team for troubleshooting."}),e(Q,{$gap:16,children:[e(he,{$gap:8,children:[t(te,{label:"Profiles",value:c.includeProfiles,onChange:e=>d("includeProfiles",e),tooltip:"Note: Adds 30s to diagnose download time to collect Profiles"}),t(de,{size:pe.XXXS,color:ue.Secondary,children:"Include pprof profiles"})]}),e(he,{$gap:8,children:[t(te,{label:"Metrics",value:c.includeMetrics,onChange:e=>d("includeMetrics",e)}),t(de,{size:pe.XXXS,color:ue.Secondary,children:"Include Prometheus metrics"})]}),e(he,{$gap:8,children:[t(te,{label:"Source Workloads",value:c.includeSourceWorkloads,onChange:e=>{d("includeSourceWorkloads",e),e&&d("sourceWorkloadNamespaces",[])}}),t(de,{size:pe.XXXS,color:ue.Secondary,children:"Include workload and pod manifests for instrumented sources"})]})]}),t(Qo,{alignX:tn.Left,alignY:en.Bottom,items:a.map(e=>({id:e.name,label:e.name,withCheckbox:!0})),selectedIds:c.sourceWorkloadNamespaces,setSelectedIds:e=>d("sourceWorkloadNamespaces",e),withMultiSelect:!0,withSearch:!0,fullWidth:!0,buttonProps:{label:(c.sourceWorkloadNamespaces.length?"Selected":"Select")+" Namespaces",variant:fe.Secondary,disabled:c.includeSourceWorkloads,leftIcon:c.sourceWorkloadNamespaces.length?()=>t(Ye,{label:c.sourceWorkloadNamespaces.length,status:Le.Default}):void 0}}),t(he,{$justifyContent:"flex-end",children:t(me,{label:"Download Diagnose",rightIcon:nl,variant:fe.Primary,onClick:async()=>{n.downloadDiagnose&&(s(Date.now()),await n.downloadDiagnose(c),s(null),u())},disabled:null!==l})})]})})},Qu=()=>{const{platformType:e,version:o,tier:i}=C(),{describeApi:a}=kl(),[l,s]=r(null);return n(()=>{a.fetchDescribeOdigos&&a.fetchDescribeOdigos().then(({data:e})=>s(e?.describeOdigos??null))},[]),t(ct,{richTitle:{icon:qa,title:"General Information"},children:t(Lt,{cellsPerRow:2,items:[{id:on(),title:"Odigos Version",label:o},{id:on(),title:`${e.toUpperCase()} Version`,label:l?.kubernetesVersion?.value||"-"},{id:on(),title:"Installation Method",label:l?.installationMethod?.value||"-"},{id:on(),title:"Tier",label:i}]})})},ep=({isOpen:o,onClose:n})=>{const{describeApi:i,tokensApi:a}=kl(),l=a.useTokens().items[0];return e(se,{isOpen:o,header:{icon:qa,title:"System Overview",onClose:n},children:[i.fetchDescribeOdigos&&t(Qu,{}),a.updateToken&&l&&t(qu,{token:l}),i.downloadDiagnose&&t(Zu,{})]})},tp=({isOpen:n,onClose:i,onCloseEnd:a})=>{const{addDataStreams:r,setSelectedStreamName:s}=et(),{dataStreamsApi:c}=kl(),{requestSubmit:d}=Il(),u=l(async e=>{c.create?await c.create(e):(r([e]),s(e.name)),i()},[c,r,s,i]),p=l(()=>d(u),[d,u]);return Jo({key:"Enter",active:n},p),e(o,{children:[t(Ze,{isOpen:n,onClose:i,onCloseEnd:a,title:Qe.NAME_YOUR_STREAM,description:Qe.STREAM_DESCRIPTION,approveButton:{"data-id":"add-stream-btn-done",label:Ft.DONE,variant:fe.Primary,onClick:p},denyButton:{"data-id":"add-stream-btn-cancel",label:Ft.CANCEL,variant:fe.Secondary,onClick:i},children:t(Ls,{autoFocus:!0})}),t(Fs,{})]})},op=({isOpen:i,onClose:a,onCloseEnd:r,dataStreamName:s})=>{const{dataStreamsApi:c}=kl(),{genericForm:d,loadDataStream:u,requestSubmit:p}=Il();n(()=>{i&&s&&u(s)},[i,s]);const h=!!d?.isFormDirty,m=l(async e=>{await c.update(s,e),a()},[c,s,a]),g=l(()=>p(m),[p,m]);return Jo({key:"Enter",active:i},g),e(o,{children:[t(Ze,{isOpen:i,onClose:a,onCloseEnd:r,title:Qe.RENAME_STREAM(s),description:Qe.STREAM_DESCRIPTION,approveButton:{"data-id":"edit-stream-btn-save",label:Ft.SAVE,variant:fe.Primary,onClick:g,disabled:!h},denyButton:{"data-id":"edit-stream-btn-cancel",label:Ft.CANCEL,variant:fe.Secondary,onClick:a},children:t(Ls,{autoFocus:!0})}),t(Fs,{})]})},np=({scale:o=1})=>e("svg",{width:742*o,height:533*o,viewBox:"0 0 742 533",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M0 0H722C733.046 0 742 8.95431 742 20V513C742 524.046 733.046 533 722 533H0V0Z",fill:"url(#paint0_linear_1585_55266)"}),e("g",{clipPath:"url(#clip0_1585_55266)",children:[t("path",{opacity:"0.1",d:"M817.963 1364.02C1052.53 1129.46 1052.53 749.151 817.96 514.585C583.394 280.019 203.089 280.018 -31.4751 514.583C-266.039 749.147 -266.038 1129.45 -31.4725 1364.02C203.093 1598.58 583.398 1598.58 817.963 1364.02Z",fill:"url(#paint1_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M789.266 1335.32C1007.98 1116.61 1007.98 761.998 789.264 543.281C570.547 324.565 215.938 324.563 -2.7781 543.279C-221.494 761.995 -221.493 1116.6 -2.77577 1335.32C215.941 1554.04 570.55 1554.04 789.266 1335.32Z",fill:"url(#paint2_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M736.156 1282.21C925.539 1092.83 925.538 785.776 736.153 596.392C546.769 407.007 239.717 407.006 50.333 596.39C-139.05 785.773 -139.05 1092.83 50.3351 1282.21C239.72 1471.59 546.772 1471.6 736.156 1282.21Z",fill:"url(#paint3_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M628.365 1174.42C758.218 1044.57 758.217 834.036 628.364 704.182C498.51 574.329 287.977 574.328 158.124 704.181C28.2713 834.033 28.272 1044.57 158.125 1174.42C287.979 1304.27 498.512 1304.27 628.365 1174.42Z",fill:"url(#paint4_radial_1585_55266)"}),t("path",{opacity:"0.1",d:"M795.717 29.8993C1030.28 -204.665 1030.28 -584.97 795.714 -819.536C561.148 -1054.1 180.843 -1054.1 -53.7211 -819.539C-288.285 -584.974 -288.284 -204.669 -53.7185 29.8967C180.847 264.462 561.152 264.464 795.717 29.8993Z",fill:"url(#paint5_radial_1585_55266)"}),t("path",{opacity:"0.3",d:"M767.02 1.20219C985.736 -217.513 985.734 -572.123 767.017 -790.84C548.301 -1009.56 193.691 -1009.56 -25.0242 -790.842C-243.74 -572.126 -243.739 -217.517 -25.0219 1.19982C193.695 219.917 548.304 219.918 767.02 1.20219Z",fill:"url(#paint6_radial_1585_55266)"}),t("path",{opacity:"0.5",d:"M713.909 -51.908C903.293 -241.292 903.292 -548.344 713.907 -737.728C524.523 -927.113 217.47 -927.114 28.0869 -737.731C-161.297 -548.347 -161.296 -241.295 28.089 -51.91C217.474 137.475 524.526 137.476 713.909 -51.908Z",fill:"url(#paint7_radial_1585_55266)"}),t("path",{opacity:"0.7",d:"M606.119 -159.699C735.972 -289.552 735.971 -500.085 606.118 -629.939C476.264 -759.792 265.731 -759.793 135.878 -629.94C6.0252 -500.088 6.02586 -289.554 135.879 -159.701C265.733 -29.8472 476.266 -29.8465 606.119 -159.699Z",fill:"url(#paint8_radial_1585_55266)"})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_1585_55266",x1:"371",y1:"0",x2:"371",y2:"533",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0.028197",stopColor:"#0B0517"}),t("stop",{offset:"1",stopColor:"#190D31"})]}),e("radialGradient",{id:"paint1_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(334.074 991.405) rotate(-45) scale(599.732 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint2_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(368.968 957.913) rotate(-45) scale(560.978 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint3_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(351.265 971.313) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint4_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(362.239 963.064) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint5_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(311.828 -342.716) rotate(-45) scale(599.733 599.736)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.41",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.67",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.75",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.83",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.89",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.95",stopColor:"#7C3BFF",stopOpacity:"0.56"}),t("stop",{offset:"1",stopColor:"#7C3BFF",stopOpacity:"0.7"})]}),e("radialGradient",{id:"paint6_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(346.722 -376.208) rotate(-45) scale(560.977 560.981)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.38",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.52",stopColor:"#7C3BFF",stopOpacity:"0.13"}),t("stop",{offset:"0.62",stopColor:"#7C3BFF",stopOpacity:"0.18"}),t("stop",{offset:"0.69",stopColor:"#7C3BFF",stopOpacity:"0.25"}),t("stop",{offset:"0.76",stopColor:"#7C3BFF",stopOpacity:"0.33"}),t("stop",{offset:"0.82",stopColor:"#7C3BFF",stopOpacity:"0.44"}),t("stop",{offset:"0.88",stopColor:"#7C3BFF",stopOpacity:"0.57"}),t("stop",{offset:"0.93",stopColor:"#7C3BFF",stopOpacity:"0.72"}),t("stop",{offset:"0.97",stopColor:"#7C3BFF",stopOpacity:"0.88"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint7_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(329.019 -362.807) rotate(-45) scale(484.947 484.95)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),e("radialGradient",{id:"paint8_radial_1585_55266",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(339.993 -371.057) rotate(-45) scale(332.216 332.218)",children:[t("stop",{stopColor:"#7C3BFF",stopOpacity:"0.1"}),t("stop",{offset:"0.31",stopColor:"#7C3BFF",stopOpacity:"0.11"}),t("stop",{offset:"0.45",stopColor:"#7C3BFF",stopOpacity:"0.14"}),t("stop",{offset:"0.56",stopColor:"#7C3BFF",stopOpacity:"0.19"}),t("stop",{offset:"0.65",stopColor:"#7C3BFF",stopOpacity:"0.26"}),t("stop",{offset:"0.73",stopColor:"#7C3BFF",stopOpacity:"0.35"}),t("stop",{offset:"0.8",stopColor:"#7C3BFF",stopOpacity:"0.46"}),t("stop",{offset:"0.86",stopColor:"#7C3BFF",stopOpacity:"0.6"}),t("stop",{offset:"0.92",stopColor:"#7C3BFF",stopOpacity:"0.76"}),t("stop",{offset:"0.98",stopColor:"#7C3BFF",stopOpacity:"0.93"}),t("stop",{offset:"1",stopColor:"#7C3BFF"})]}),t("clipPath",{id:"clip0_1585_55266",children:t("rect",{width:"929.477",height:"667",fill:"white",transform:"translate(-93.7383 -134)"})})]})]}),ip=f.div`
429
+ position: absolute;
430
+ top: 50%;
431
+ left: 50%;
432
+ transform: translate(-50%, -50%);
433
+ z-index: ${({theme:e})=>e.v2.zIndex.modal};
434
+ `,ap=()=>{const{drawerType:o,setDrawerType:n}=ro(),i=o===an.OnboardingDone,a=()=>n(null);return e(nn,{isOpen:i,onClose:a,children:[t(np,{}),t(ip,{children:e(Q,{$gap:32,$alignItems:"center",children:[e(Q,{$gap:24,$alignItems:"center",children:[t(de,{size:pe.L,weight:500,children:"Welcome to"}),t(rr,{size:260}),t(de,{size:pe.S,weight:400,children:"Your observability control plane is ready."})]}),t(me,{label:"Get Started",rightIcon:wa,onClick:a})]})})]})},lp=f.div`
435
+ display: flex;
436
+ flex-direction: column;
437
+ gap: 8px;
438
+ padding: 4px 8px;
439
+ border-radius: 8px;
440
+ width: 100%;
441
+ `,rp=f.div`
442
+ white-space: pre;
443
+ overflow-x: auto;
444
+ `,sp=({name:o,recommended:n,toggleLabel:i,enabled:a,onEnabledChange:l,summary:r,toggleName:s})=>{const c=b();return e(lp,{children:[e(he,{$gap:8,$justifyContent:"space-between",children:[e(he,{$gap:4,children:[t(de,{size:pe.XS,color:c.v2.colors.white[500],nowrap:!0,children:o}),n&&t(Ye,{label:ln,leftIcon:dl,backgroundColor:c.v2.colors.purple[700],textColor:c.v2.colors.white[500],textSize:pe.XXXS})]}),t(ae,{name:s??`sampling-onboarding-toggle-${o}`,label:i,labelAlign:le.Left,value:a,onChange:l,size:It.S})]}),t(rp,{children:t(w,{parts:r})})]})},cp=f.div`
445
+ position: relative;
446
+ display: flex;
447
+ align-items: center;
448
+ justify-content: center;
449
+ min-height: 32px;
450
+ padding: ${({$hasBack:e})=>e?"16px 68px":"16px"};
451
+ background-color: ${({theme:e})=>e.v2.colors.black[500]};
452
+ border-top-left-radius: 18px;
453
+ border-top-right-radius: 18px;
454
+ `,dp=f.div`
455
+ position: absolute;
456
+ left: 16px;
457
+ top: 50%;
458
+ transform: translateY(-50%);
459
+ `,up=f.div`
460
+ height: 16px;
461
+ width: 100%;
462
+ background-color: ${({theme:e})=>e.v2.colors.black[500]};
463
+ border-top-left-radius: 18px;
464
+ border-top-right-radius: 18px;
465
+ `,pp=f.div`
466
+ width: ${({$width:e})=>e}px;
467
+ display: flex;
468
+ flex-direction: column;
469
+ align-items: center;
470
+ gap: 22px;
471
+ padding: 8px 32px 32px 32px;
472
+ background-color: ${({theme:e})=>e.v2.colors.black[500]};
473
+ `,hp=e=>t(ul,{rotate:90,...e}),mp=({children:o,center:n,onNext:i,nextLabel:a=rn,nextLoading:l})=>e(he,{$gap:8,$justifyContent:n?"center":"flex-end",$padding:"0 16px 16px 16px",children:[o,i&&t(me,{"data-id":"sampling-onboarding-btn-next",label:a,rightIcon:hp,variant:fe.Primary,size:ge.M,onClick:i,loading:l})]}),gp=e=>t(ul,{rotate:-90,...e}),fp=({title:o,onBack:n})=>{const i=b();return e(cp,{$hasBack:!!n,children:[n&&t(dp,{children:t(vt,{"data-id":"sampling-onboarding-back",icon:gp,size:yt.M,onClick:n})}),t(de,{size:pe.M,weight:500,color:i.v2.colors.white[500],align:"center",children:o})]})},bp=f.div`
474
+ box-sizing: border-box;
475
+ width: ${({$width:e})=>e??"100%"};
476
+ ${({$fillHeight:e})=>e&&v`
477
+ align-self: stretch;
478
+ height: auto;
479
+ `}
480
+ display: flex;
481
+ flex-direction: column;
482
+ gap: 24px;
483
+ padding: 16px;
484
+ border-radius: 16px;
485
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
486
+ `,vp=({children:e,fillHeight:o,width:n})=>t(bp,{$fillHeight:o,$width:n,children:e}),yp=f.ul`
487
+ margin: 0;
488
+ padding: 0;
489
+ list-style: disc;
490
+ `,Cp=f.li`
491
+ margin-left: 18px;
492
+ & + & {
493
+ margin-top: 6px;
494
+ }
495
+ `,Sp=({items:e,color:o})=>{const n=b(),i=o||n.v2.colors.silver[200];return t(yp,{children:e.map((e,o)=>t(Cp,{style:{color:i},children:t(de,{size:pe.XXS,color:i,children:e})},o))})},wp=({items:o})=>{const n=b();return t(Q,{$gap:16,children:o.map((o,i)=>e(he,{$gap:8,$alignItems:"flex-start",children:[e(de,{size:pe.XS,color:n.v2.colors.silver[200],weight:400,children:[i+1,"."]}),e(Q,{$gap:2,children:[t(de,{size:pe.XS,color:n.v2.colors.white[500],weight:500,children:o.title}),t(de,{size:pe.XS,color:n.v2.colors.silver[200],children:o.description})]})]},i))})},xp=({message:e})=>t(Fe,{status:Le.Default,message:e,fullWidth:!0,smallIcon:!0}),kp=f.div`
496
+ width: 100%;
497
+ padding: 8px;
498
+ display: flex;
499
+ flex-direction: column;
500
+ gap: 4px;
501
+ border-radius: 16px;
502
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
503
+ `,Tp=f.div`
504
+ display: flex;
505
+ align-items: center;
506
+ gap: 8px;
507
+ padding: 4px 8px 12px 8px;
508
+ `,$p=f.div`
509
+ width: 100%;
510
+ display: flex;
511
+ flex-direction: column;
512
+ gap: 8px;
513
+ padding: 8px;
514
+ border-radius: 12px;
515
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
516
+ `,Ip=({children:e})=>{const o=b();return t(de,{size:pe.S,weight:500,color:o.v2.colors.white[500],align:"center",children:e})},Ep=f.div`
517
+ white-space: pre-line;
518
+ `,Np=({enabled:n,onEnabledChange:a,onBack:l,onNext:r})=>{const s=b(),c=i(()=>A({enabled:n,keepPercentage:0}),[n]);return e(o,{children:[t(fp,{title:sn,onBack:l}),e(pp,{$width:854,children:[t(Ip,{children:cn}),e(Q,{$gap:8,$width:"100%",children:[t(vp,{children:t(Ep,{children:t(de,{size:pe.XXS,color:s.v2.colors.silver[200],children:dn})})}),e(Q,{$gap:8,$width:"100%",children:[e(kp,{children:[t(Tp,{children:t(de,{size:pe.S,weight:500,color:s.v2.colors.white[500],children:un})}),t($p,{children:t(sp,{name:hn,recommended:!0,toggleLabel:pn,enabled:n,onEnabledChange:a,summary:c,toggleName:"sampling-onboarding-noisy-toggle"})})]}),t(xp,{message:mn})]})]})]}),t(mp,{onNext:r})]})},Ap=e=>t(ul,{rotate:90,...e}),Op=({onClose:n})=>{const i=b();return e(o,{children:[t(up,{}),e(pp,{$width:732,children:[t(gn,{icon:ll}),e(Q,{$gap:16,$alignItems:"center",$width:"100%",children:[t(de,{size:pe.M,weight:500,color:i.v2.colors.white[500],children:fn}),bn.split("\n").map((e,o)=>t(Ip,{children:e},`subtitle-${o}-${e}`)),e(vp,{children:[t(de,{size:pe.XS,color:i.v2.colors.silver[200],children:vn}),t(Sp,{color:i.v2.colors.white[500],items:[yn,Cn,Sn]})]})]})]}),t(mp,{center:!0,children:t(me,{"data-id":"sampling-onboarding-btn-go-to",label:wn,rightIcon:Ap,variant:fe.Primary,size:ge.M,onClick:n})})]})},Rp=e=>t(ul,{rotate:90,...e}),Dp=f.div`
519
+ display: flex;
520
+ flex-direction: column;
521
+ align-items: center;
522
+ gap: 8px;
523
+ width: 100%;
524
+ `,Pp=({onSkip:n,onNext:i})=>{const a=b();return e(o,{children:[t(up,{}),e(pp,{$width:732,children:[t(gn,{icon:ll}),e(Q,{$gap:16,$alignItems:"center",$width:"100%",children:[e(Dp,{children:[t(de,{size:pe.M,weight:500,color:a.v2.colors.white[500],children:xn}),t(Ip,{children:kn})]}),e(vp,{children:[t(de,{size:pe.XS,color:a.v2.colors.silver[200],children:Tn}),t(wp,{items:[{title:In,description:$n},{title:Nn,description:En},{title:On,description:An}]}),t(xp,{message:Rn})]})]})]}),e(mp,{center:!0,children:[t(me,{"data-id":"sampling-onboarding-btn-skip",label:Dn,variant:fe.Secondary,onClick:n}),t(me,{"data-id":"sampling-onboarding-btn-start",label:Pn,rightIcon:Rp,variant:fe.Primary,onClick:i})]})]})},Fp=f.div`
525
+ display: flex;
526
+ align-items: stretch;
527
+ gap: 16px;
528
+ width: 100%;
529
+ `,Lp=f.div`
530
+ flex: 1;
531
+ display: flex;
532
+ flex-direction: column;
533
+ border-radius: 16px;
534
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
535
+ border: 1.5px solid transparent;
536
+ cursor: pointer;
537
+ transition:
538
+ background-color 0.15s ease,
539
+ border-color 0.15s ease;
540
+
541
+ ${({$selected:e,theme:t})=>e?v`
542
+ background-color: ${t.v2.colors.purple[900]};
543
+ border-color: ${t.v2.colors.purple[400]};
544
+ `:v`
545
+ &:hover {
546
+ background-color: ${t.v2.colors.silver[700]};
547
+ }
548
+ `}
549
+ `,Mp=f.div`
550
+ display: flex;
551
+ align-items: center;
552
+ gap: 8px;
553
+ padding: 12px 16px;
554
+ `,_p=f.div`
555
+ flex: 1;
556
+ padding: 8px;
557
+ display: flex;
558
+ flex-direction: column;
559
+ gap: 8px;
560
+ `,zp=f.div`
561
+ flex: 1;
562
+ display: flex;
563
+ flex-direction: column;
564
+ gap: 12px;
565
+ padding: 12px;
566
+ border-radius: 12px;
567
+ background-color: ${({theme:e,$selected:t})=>t?e.v2.colors.purple[900]:e.v2.colors.silver[900]};
568
+ `,Bp=f.div`
569
+ display: flex;
570
+ justify-content: flex-end;
571
+ `,Xp=f.div`
572
+ display: flex;
573
+ align-items: center;
574
+ gap: 8px;
575
+ padding: 4px 12px 4px 4px;
576
+ border-radius: 8px;
577
+ background-color: ${({theme:e})=>e.v2.colors.yellow[1e3]};
578
+ `,Vp=f.div`
579
+ display: flex;
580
+ align-items: center;
581
+ justify-content: center;
582
+ width: 24px;
583
+ height: 24px;
584
+ border-radius: 6px;
585
+ background-color: ${({theme:e})=>e.v2.colors.yellow[900]};
586
+ `,Up=({selected:o,onSelect:n,name:i,description:a,badgeProps:l,bullets:r,warning:s,onReadMore:c})=>{const d=b(),u=o?d.v2.colors.white[500]:d.v2.colors.silver[200];return e(Lp,{$selected:o,onClick:n,children:[e(Mp,{children:[t(Ce,{"data-id":`sampling-onboarding-radio-${i}`,value:o,onChange:n,size:we.L}),t(ll,{size:24,fill:d.v2.colors.white[500]}),t(de,{size:pe.S,weight:500,color:d.v2.colors.white[500],children:i})]}),e(_p,{children:[e(zp,{$selected:o,children:[e(Q,{$gap:8,children:[t(Ye,{...l,textSize:pe.XXXS}),t(de,{size:pe.XXS,color:u,children:a})]}),r&&r.length>0&&t(Sp,{color:u,items:r}),s&&e(Xp,{children:[t(Vp,{children:t(rl,{size:18,fill:d.v2.colors.yellow[500]})}),t(de,{size:pe.XXXS,color:d.v2.colors.yellow[500],children:s})]})]}),c&&t(Bp,{children:t(me,{"data-id":`sampling-onboarding-btn-read-more-${i}`,label:Jn,rightIcon:Ta,variant:fe.Text,size:ge.S,onClick:e=>{e.stopPropagation(),c()}})})]})]})},Gp=({strategy:n,onStrategyChange:i,onBack:a,onNext:l,docsUrl:r})=>{const s=b(),c=r?()=>window.open(r,"_blank"):void 0;return e(o,{children:[t(fp,{title:Fn,onBack:a}),e(pp,{$width:854,children:[t(Ip,{children:Ln}),e(Fp,{children:[t(Up,{selected:"keep-list"===n,onSelect:()=>i("keep-list"),name:Vn,description:Xn,badgeProps:{label:Bn,backgroundColor:s.v2.colors.purple[500],textColor:s.v2.colors.white[500]},bullets:[_n,zn],warning:Mn,onReadMore:c}),t(Up,{selected:"drop-list"===n,onSelect:()=>i("drop-list"),name:Wn,description:jn,badgeProps:{label:Hn,backgroundColor:s.v2.colors.green[500],textColor:s.v2.colors.black[500]},bullets:[Un,Gn],onReadMore:c}),t(Up,{selected:"advanced"===n,onSelect:()=>i("advanced"),name:qn,description:Yn,badgeProps:{label:Kn,backgroundColor:s.v2.colors.blue[700],textColor:s.v2.colors.white[500]},onReadMore:c})]})]}),t(mp,{onNext:l})]})},Hp=({onBack:n,onNext:a,submitting:l})=>{const r=b(),s=i(()=>[{title:ti,bullets:[Zn,Qn,ei]},{title:ri,bullets:[oi,ni,ii,ai,li]}],[]);return e(o,{children:[t(fp,{title:si,onBack:n}),e(pp,{$width:854,children:[t(Ip,{children:ci}),t(he,{$gap:16,$width:"100%",$alignItems:"stretch",children:s.map((o,n)=>e(vp,{fillHeight:!0,width:"50%",children:[t(de,{size:pe.XS,color:r.v2.colors.white[500],children:o.title}),t(Sp,{items:o.bullets})]},n))}),t(xp,{message:di})]}),t(mp,{onNext:a,nextLoading:l})]})},jp=f.div`
587
+ white-space: pre-line;
588
+ `,Wp=({errorPresetEnabled:n,onErrorPresetChange:a,onBack:l,onNext:r,submitting:s})=>{const c=b(),d=i(()=>O(n?{disabled:!1}:null),[n]);return e(o,{children:[t(fp,{title:ui,onBack:l}),e(pp,{$width:854,children:[t(Ip,{children:pi}),e(Q,{$gap:8,$width:"100%",children:[e(vp,{children:[t(jp,{children:t(de,{size:pe.XXS,color:c.v2.colors.silver[200],children:hi})}),t(xp,{message:di})]}),e(kp,{children:[e(Tp,{children:[t(de,{size:pe.S,weight:500,color:c.v2.colors.white[500],children:mi}),t(ja,{size:16,fill:c.v2.colors.silver[200]})]}),t($p,{children:t(sp,{name:fi,recommended:!0,toggleLabel:gi,enabled:n,onEnabledChange:a,summary:d,toggleName:"sampling-onboarding-drop-error-preset-toggle"})})]})]})]}),t(mp,{onNext:r,nextLoading:s})]})},Kp=f.div`
589
+ white-space: pre-line;
590
+ `,Yp=f.div`
591
+ width: fit-content;
592
+ `,qp=["50","25","10","1","0.1"],Jp=({value:o,onChange:n,label:a})=>{const l=b(),r=i(()=>qp.map(e=>({value:e,label:`${e}%`,selectedBgColor:l.v2.colors.purple[900],selectedBorderColor:l.v2.colors.purple[400]})),[l]);return e(Q,{$gap:8,children:[t(de,{size:pe.XS,color:l.v2.colors.white[500],children:a}),t(Yp,{children:t(be,{"data-id":"sampling-onboarding-ambient",options:r,selected:o,setSelected:n})})]})},Zp=({errorPresetEnabled:n,onErrorPresetChange:a,ambientPercentage:l,onAmbientPercentageChange:r,onBack:s,onNext:c,submitting:d})=>{const u=b(),p=i(()=>O(n?{disabled:!1}:null),[n]);return e(o,{children:[t(fp,{title:bi,onBack:s}),e(pp,{$width:854,children:[t(Ip,{children:vi}),e(Q,{$gap:8,$width:"100%",children:[e(vp,{children:[t(Kp,{children:t(de,{size:pe.XXS,color:u.v2.colors.silver[200],children:yi})}),t(Sp,{items:[Ci,Si,wi,xi,ki]}),t(xp,{message:di})]}),e(kp,{children:[e(Tp,{children:[t(de,{size:pe.S,weight:500,color:u.v2.colors.white[500],children:Ti}),t(ja,{size:16,fill:u.v2.colors.silver[200]})]}),t($p,{children:t(sp,{name:fi,recommended:!0,toggleLabel:gi,enabled:n,onEnabledChange:a,summary:p,toggleName:"sampling-onboarding-error-preset-toggle"})}),t($p,{children:t(Jp,{value:l,onChange:r,label:$i})})]})]})]}),t(mp,{onNext:c,nextLoading:d})]})},Qp=({isOpen:e,onClose:o,k8sHealthProbesConfig:i,samplingId:a,docsUrl:s})=>{const{samplingApi:c}=kl(),[d,u]=r("welcome"),[p,h]=r(!0),[m,g]=r("keep-list"),[f,b]=r(!0),[v,y]=r("25"),[C,S]=r(!1);n(()=>{e&&(u("welcome"),h(i?.enabled??!0),g("keep-list"),b(!0),y("25"),S(!1))},[e,i?.enabled]);const w=l(async()=>{const e=a??"default",t=[];if(p!==(i?.enabled??!1)){const e=c.updateK8sHealthProbesConfig;e&&t.push(e({enabled:p,keepPercentage:i?.keepPercentage??0}))}if("advanced"!==m&&f){const o=c.createHighlyRelevant;o&&t.push(o({samplingId:e,rule:{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}}))}if("keep-list"===m){const o=c.createCostReduction;o&&t.push(o({samplingId:e,rule:{name:"Onboarding - Ambient sampling",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:parseFloat(v)}}))}S(!0);try{await Promise.all(t),u("success")}catch{}finally{S(!1)}},[a,c,p,i?.enabled,i?.keepPercentage,m,f,v]);let x=null;switch(d){case"welcome":x=t(Pp,{onSkip:o,onNext:()=>u("noisy")});break;case"noisy":x=t(Np,{enabled:p,onEnabledChange:h,onBack:()=>u("welcome"),onNext:()=>u("strategy")});break;case"strategy":x=t(Gp,{strategy:m,onStrategyChange:g,onBack:()=>u("noisy"),onNext:()=>{u("keep-list"===m?"keep-list":"drop-list"===m?"drop-list":"advanced")},docsUrl:s});break;case"keep-list":x=t(Zp,{errorPresetEnabled:f,onErrorPresetChange:b,ambientPercentage:v,onAmbientPercentageChange:y,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"drop-list":x=t(Wp,{errorPresetEnabled:f,onErrorPresetChange:b,onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"advanced":x=t(Hp,{onBack:()=>u("strategy"),onNext:w,submitting:C});break;case"success":x=t(Op,{onClose:o})}return t(nn,{isOpen:e,onClose:o,children:x})};var eh,th;(e=>{e.BulkConfig="bulk-config",e.BulkSource="bulk-source",e.BulkDestination="bulk-destination",e.BulkAction="bulk-action",e.BulkInstrumentationRule="bulk-instrumentation-rule",e.Delete="delete"})(eh||(eh={})),(e=>{e.Id="id",e.Name="name",e.Type="type",e.Status="status",e.OdigosVersion="odigosVersion",e.ConnectedSince="connectedSince",e.LastActivity="lastActivity"})(th||(th={}));const oh=[{key:th.Name,label:"Name"},{key:th.Type,label:"Type"},{key:th.Status,label:"Status"},{key:th.OdigosVersion,label:"Odigos Version"},{key:th.ConnectedSince,label:"Connected Since"},{key:th.LastActivity,label:"Last Activity"}],nh=(e,t)=>{const o=e.find(e=>e.key===th.Id)?.rawValue;return t(o?.toString()||"")},ih=({connections:o,getConnections:a,onClickConnection:s,deleteConnection:c,configMinSupportedVersion:d=0,snapshotMinSupportedVersion:u=0})=>{const p=b(),{formatTimeAgo:h}=Kt(),{capabilities:m}=kl(),[g,f]=r(!1),[v,y]=r(o||[]),C=l(async()=>{try{f(!0),y(await a()??[])}catch(e){}finally{f(!1)}},[]);n(()=>{v.length||C()},[]);const[S,w]=r(""),[x,k]=r(null),[T,$]=r([]),I=i(()=>x===eh.BulkConfig?d:x===eh.BulkSource?u:0,[x,d,u]),{supportedConnections:E,supportedConnectionIds:N}=i(()=>{const e=((e,t)=>e.filter(e=>{const o=e.status===Le.Success,n=R(e.odigosVersion,t,e.type);return o&&n}))(v,I);return{supportedConnections:e,supportedConnectionIds:e.map(e=>e.id)}},[v,I]);n(()=>{if(!x||x===eh.Delete)return;const e=T.filter(e=>!N.includes(e));e.length&&$(t=>t.filter(t=>!e.includes(t)))},[x,T.length,N.length]);const A=i(()=>v.filter(e=>!S||e.name.toLowerCase().includes(S.toLowerCase())).map(e=>({cells:[{key:th.Id,rawValue:e.id},{key:th.Name,rawValue:e.name},{key:th.Type,rawValue:e.type},{key:th.Status,rawValue:e.status,component:()=>(e=>{const o=e===Le.Success?"Connection live":"Connection lost",n=e===Le.Success?Fa:La;return t(Ye,{status:e,label:o,leftIcon:n})})(e.status)},{key:th.OdigosVersion,rawValue:e.odigosVersion},{key:th.ConnectedSince,rawValue:e.connectedAt?h(e.connectedAt):"-"},{key:th.LastActivity,rawValue:e.lastSeenAt?h(e.lastSeenAt):"-"}],onClick:e.status!==Le.Success||x?void 0:()=>s(e),isSelected:T.includes(e.id),onSelect:()=>$(t=>Array.from(new Set([...t,e.id]))),onDeselect:()=>$(t=>t.filter(t=>t!==e.id)),hideCheckbox:e.status!==Le.Success||x===eh.BulkConfig&&!R(e.odigosVersion,d,e.type)||x===eh.BulkSource&&!R(e.odigosVersion,u,e.type)})),[v,T,S,x,d,u,h,s]),O=i(()=>v.length>0&&v.every(e=>e.type===Ii.K8s),[v]),P=i(()=>{const e=(e,t)=>{$([e]),k(t)};return(e=>{const{connections:t,configMinSupportedVersion:o,snapshotMinSupportedVersion:n,onDelete:i,onAddSource:a,onAddDestination:l,onAddAction:r,onAddInstrumentationRule:s,onEditConfiguration:c}=e;return({cells:e})=>{if(!(e=>e.find(e=>e.key===th.Status)?.rawValue===Le.Success)(e))return[{id:on(),label:"Delete Connection",rightIcon:$a,onClick:()=>nh(e,i)}];const d=nh(e,e=>t.find(t=>t.id===e));if(d?.type!==Ii.K8s)return[];const u=!!d&&R(d.odigosVersion,o,d.type),p=!!d&&R(d.odigosVersion,n,d.type),h=D(o,d?.type),m=D(n,d?.type),g=[];return a&&g.push({id:on(),tooltip:p?Qe.ADD_SOURCE:`To use this feature, please upgrade to Odigos v${m} or later.`,rightIcon:_a,disabled:!p,onClick:()=>nh(e,a)}),l&&g.push({id:on(),tooltip:Qe.ADD_DESTINATION,rightIcon:Ra,onClick:()=>nh(e,l)}),r&&g.push({id:on(),tooltip:Qe.ADD_ACTION,rightIcon:Oa,onClick:()=>nh(e,r)}),s&&g.push({id:on(),tooltip:Qe.ADD_INSTRUMENTATION_RULE,rightIcon:Ma,onClick:()=>nh(e,s)}),c&&g.push({id:on(),tooltip:u?"Edit Configuration":`To use this feature, please upgrade to Odigos v${h} or later.`,rightIcon:Ba,disabled:!u,onClick:()=>nh(e,c)}),g}})({connections:v,configMinSupportedVersion:d,snapshotMinSupportedVersion:u,onDelete:t=>e(t,eh.Delete),onAddSource:m.canFetchSnapshots&&m.canBulkPersistSources?t=>e(t,eh.BulkSource):void 0,onAddDestination:m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canCreateDestination?t=>e(t,eh.BulkDestination):void 0,onAddAction:m.canCreateAction?t=>e(t,eh.BulkAction):void 0,onAddInstrumentationRule:m.canCreateInstrumentationRule?t=>e(t,eh.BulkInstrumentationRule):void 0,onEditConfiguration:m.canApplyEffectiveConfig?t=>e(t,eh.BulkConfig):void 0})},[v,d,u,m]),F=i(()=>(e=>{const{onCancel:t,onAddSource:o,onAddDestination:n,onAddAction:i,onAddInstrumentationRule:a,onManageConfigurations:l}=e,r=[];o&&r.push({id:on(),type:io.Button,buttonProps:{variant:fe.Primary,size:ge.S,label:"Add Sources",rightIcon:_a,onClick:o}});const s=[n?{id:eh.BulkDestination,label:Qe.ADD_DESTINATION,icon:Ra}:null,i?{id:eh.BulkAction,label:Qe.ADD_ACTION,icon:Oa}:null,a?{id:eh.BulkInstrumentationRule,label:Qe.ADD_INSTRUMENTATION_RULE,icon:Ma}:null,l?{id:eh.BulkConfig,label:"Manage Configurations",icon:Ba}:null];return s.some(Boolean)&&r.push({id:on(),type:io.ButtonDropData,buttonProps:{variant:fe.Secondary,size:ge.S,label:"Bulk Operations",onClick:e=>{e===eh.BulkSource?o?.():e===eh.BulkDestination?n?.():e===eh.BulkAction?i?.():e===eh.BulkInstrumentationRule?a?.():e===eh.BulkConfig&&l?.()}},dropDataProps:{alignX:tn.Left,items:s}}),r.push({id:on(),type:io.Button,buttonProps:{variant:fe.Text,size:ge.S,label:Ft.CANCEL,onClick:t}}),r})({onCancel:()=>$([]),onAddSource:m.canFetchSnapshots&&m.canBulkPersistSources?()=>k(eh.BulkSource):void 0,onAddDestination:m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canCreateDestination?()=>k(eh.BulkDestination):void 0,onAddAction:m.canCreateAction?()=>k(eh.BulkAction):void 0,onAddInstrumentationRule:m.canCreateInstrumentationRule?()=>k(eh.BulkInstrumentationRule):void 0,onManageConfigurations:m.canApplyEffectiveConfig?()=>k(eh.BulkConfig):void 0}),[m]);return t(Ei,{children:e(ct,{fullHeight:!0,richTitle:{icon:pl,title:Qe.CONNECTIONS,badge:{label:v.length.toString(),status:Le.Unknown}},search:{placeholder:"Search by cluster name",value:S,onChange:e=>w(e),width:"300px"},actions:[{id:on(),type:io.Button,buttonProps:{variant:fe.Secondary,size:ge.S,leftIcon:Ga,onClick:C,disabled:g}}],children:[t(To,{variant:$o.Pretty,headerBackgroundColor:p.v2.colors.silver[1e3],isLoading:g,withCheckboxes:O,columns:oh,rows:A,rowActionsPushRightPosition:x?`calc(${sr} - 24px)`:void 0,getRowActions:P}),x===eh.BulkConfig&&m.canApplyEffectiveConfig&&t(Ml,{connectionIds:T,children:t(kc,{onClose:()=>k(null),connections:E,selectedConnectionIds:T,setSelectedConnectionIds:$})}),x===eh.BulkSource&&m.canFetchSnapshots&&m.canBulkPersistSources&&t(Ml,{connectionIds:T,children:t(_l,{selectedConnectionIds:T,children:t(Sc,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===eh.BulkDestination&&m.canFetchDestinationCategories&&m.canFetchPotentialDestinations&&m.canTestConnection&&m.canCreateDestination&&t(Ml,{connectionIds:T,children:t(zl,{children:t(lc,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===eh.BulkAction&&m.canCreateAction&&t(Ml,{connectionIds:T,children:t(Bl,{children:t(qs,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),x===eh.BulkInstrumentationRule&&m.canCreateInstrumentationRule&&t(Ml,{connectionIds:T,children:t(Xl,{children:t(rc,{onClose:()=>k(null),selectedConnectionIds:T,setSelectedConnectionIds:$})})}),t(ir,{target:"connection",isOpen:x===eh.Delete,onClose:()=>{$([]),k(null)},onApprove:async()=>{const e=T[0];e&&(await c(e),await C())}}),t(Io,{isOpen:!!T.length&&!x,richTitle:{icon:xa,title:"Selected Clusters",badge:{label:T.length}},actions:F})]})})},ah=f.div`
593
+ display: flex;
594
+ align-items: center;
595
+ justify-content: space-between;
596
+ gap: 8px;
597
+ padding: 16px;
598
+ width: 100%;
599
+ border-radius: 16px;
600
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
601
+ `,lh=f.div`
602
+ display: flex;
603
+ align-items: center;
604
+ justify-content: center;
605
+ padding: 8px;
606
+ border-radius: 8px;
607
+ background-color: ${({theme:e})=>e.v2.colors.white[500]+ut["004"]};
608
+ `,rh=({setStep:o,onSave:n,sourcesPayload:a,destinationsPayload:l,disableAnimation:r})=>{const s=b(),c=()=>o(2),d=()=>o(3),u=i(()=>Object.values(a||{}).flatMap((o,n)=>o.map((o,i)=>{if(!o.selected)return null;const a=o.kind||Tt.Namespace,l=a===Tt.Namespace?o.namespace:`${o.namespace} → ${o.name}`;return e(ah,{children:[t(de,{nowrap:!0,children:l}),t(Ye,{label:a,status:Le.Info,backgroundColor:s.v2.colors.blue[900]})]},`source-${n}-${i}`)})).filter(Boolean),[a]),p=i(()=>l?.map((o,n)=>{const i=wt(o.option.type).icon;return e(ah,{children:[e(he,{$gap:8,children:[i&&t(lh,{children:t(i,{size:24})}),t(de,{nowrap:!0,children:o.formData.name||o.option.displayName})]}),void 0!==o.testResult&&t(Ye,{status:o.testResult.succeeded?Le.Success:Le.Error,leftIcon:o.testResult.succeeded?Fa:La})]},`destination-${n}`)})||[],[l]);return t(nr,{isOpen:!0,disableAnimation:r,onBack:()=>o(3),onSave:n,header:{icon:Va,title:Qe.SUMMARY,subTitle:Qe.REVIEW_SETUP},leftColumn:{width:"50%",header:e(he,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(he,{$gap:8,children:[t(_a,{size:24}),t(de,{nowrap:!0,children:Qe.SELECTED_SOURCES}),t(Ye,{label:u.length})]}),t(me,{"data-id":"summary-edit-sources",leftIcon:Ia,variant:fe.Secondary,size:ge.S,onClick:c})]}),list:u.length?u:[t(gt,{$height:"100%",children:t(Oe,{icon:_a,title:Qe.NO_SOURCES_SELECTED,subTitle:Qe.ADD_SOURCE_PROMPT,button:{leftIcon:Sa,label:Qe.ADD_SOURCE,onClick:c}})},"no-sources-data")]},rightColumn:{width:"50%",header:e(he,{$width:"100%",$gap:12,$justifyContent:"space-between",children:[e(he,{$gap:8,children:[t(Ra,{size:24}),t(de,{nowrap:!0,children:Qe.SELECTED_DESTINATIONS}),t(Ye,{label:p.length})]}),t(me,{"data-id":"summary-edit-destinations",leftIcon:Ia,variant:fe.Secondary,size:ge.S,onClick:d})]}),list:p.length?p:[t(gt,{"data-id":"summary-no-destinations",$height:"100%",children:t(Oe,{icon:Ra,title:Qe.NO_DESTINATIONS_SELECTED,subTitle:Qe.ADD_DESTINATION_PROMPT,button:{leftIcon:Sa,label:Qe.ADD_DESTINATIONS,onClick:d}})},"no-destinations-data")]}})},sh=f.div`
609
+ position: relative;
610
+ overflow: hidden;
611
+ width: 100vw;
612
+ height: 100vh;
613
+ box-sizing: border-box;
614
+ `,ch=f.svg`
615
+ position: absolute;
616
+ top: 50%;
617
+ left: 50%;
618
+ transform: translate(-50%, -50%);
619
+ z-index: -1;
620
+ `,dh=[{opacity:"0.1"},{offset:"0.31",opacity:"0.11"},{offset:"0.45",opacity:"0.14"},{offset:"0.56",opacity:"0.19"},{offset:"0.65",opacity:"0.26"},{offset:"0.73",opacity:"0.35"},{offset:"0.8",opacity:"0.46"},{offset:"0.86",opacity:"0.6"},{offset:"0.92",opacity:"0.76"},{offset:"0.98",opacity:"0.93"},{offset:"1"}],uh=[{width:1440,height:900,pathOpacity:.1,path:"M719.992 1169.99C322.351 1169.99 0 847.64 0 450C0 52.3591 322.351 -269.992 719.992 -269.992C1117.63 -269.992 1439.98 52.3591 1439.98 450C1439.98 847.64 1117.63 1169.99 719.992 1169.99Z",gradientTransform:"translate(814.309 444.011) rotate(180) scale(718.904)",stops:[{opacity:"0.1"},{offset:"0.41",opacity:"0.11"},{offset:"0.56",opacity:"0.13"},{offset:"0.67",opacity:"0.18"},{offset:"0.75",opacity:"0.25"},{offset:"0.83",opacity:"0.33"},{offset:"0.89",opacity:"0.44"},{offset:"0.95",opacity:"0.56"},{offset:"1",opacity:"0.7"}]},{width:1343,height:900,pathOpacity:.3,path:"M671.344 1121.34C300.571 1121.34 0 820.773 0 450C0 79.2264 300.571 -221.345 671.344 -221.345C1042.12 -221.345 1342.69 79.2264 1342.69 450C1342.69 820.773 1042.12 1121.34 671.344 1121.34Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:dh},{width:1163,height:900,pathOpacity:.5,path:"M581.31 1031.31C260.261 1031.31 0 771.048 0 449.999C0 128.951 260.261 -131.311 581.31 -131.311C902.358 -131.311 1162.62 128.951 1162.62 449.999C1162.62 771.048 902.358 1031.31 581.31 1031.31Z",gradientTransform:"translate(644.026 441.551) rotate(180) scale(581.31)",stops:dh},{width:798,height:798,pathOpacity:.7,path:"M398.581 797.162C178.451 797.162 0 618.711 0 398.581C0 178.451 178.451 0 398.581 0C618.711 0 797.162 178.451 797.162 398.581C797.162 618.711 618.711 797.162 398.581 797.162Z",gradientTransform:"translate(445.003 392.441) rotate(180) scale(398.23)",stops:dh}],ph=({paddingXAxis:o="0px",paddingYAxis:a="0px",children:l})=>{const[s,c]=r(window.innerWidth),d=i(()=>s/uh[0].width,[s]);return n(()=>{const e=()=>c(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e(sh,{$paddingXAxis:o,$paddingYAxis:a,children:[uh.map(({width:o,height:n,pathOpacity:i,path:a,gradientTransform:l,stops:r},s)=>{const c=`purple-ring-${s}`;return e(ch,{width:o*d,height:"100%",viewBox:`0 0 ${o} ${n}`,fill:"none",children:[t("path",{opacity:i,d:a,fill:`url(#${c})`}),t("defs",{children:t("radialGradient",{id:c,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:l,children:r.map(({offset:e,opacity:o},n)=>t("stop",{offset:e,stopColor:"#7C3BFF",stopOpacity:o},n))})})]},c)}),l]})},hh=f.div`
621
+ display: flex;
622
+ flex-direction: column;
623
+ align-items: center;
624
+ justify-content: center;
625
+ gap: 32px;
626
+ padding: 32px;
627
+ max-width: 700px;
628
+ width: 50vw;
629
+ border-radius: 16px;
630
+ background: ${({theme:e})=>e.v2.colors.silver[900]};
631
+ `,mh=f.div`
632
+ display: flex;
633
+ flex-direction: column;
634
+ align-items: center;
635
+ justify-content: center;
636
+ gap: 24px;
637
+ max-width: 500px;
638
+ & * {
639
+ text-align: center;
640
+ }
641
+ `,gh=({onStart:o})=>t(se,{width:"75vw",isOpen:!0,hideOverlay:!0,disableAnimation:!0,children:t(gt,{$height:"100%",children:e(hh,{children:[e(mh,{children:[t(de,{size:pe.L,weight:500,children:Qe.GET_STARTED_WITH}),t(rr,{size:260}),t(de,{size:pe.S,weight:400,children:Qe.GET_STARTED_DESCRIPTION})]}),t(me,{"data-id":"onboarding-get-started",label:Ft.GET_STARTED,rightIcon:wa,size:ge.L,onClick:o})]})})}),fh=[{step:1,label:Qe.INSTALLATION,forceDoneBadge:!0},{step:2,label:Qe.SOURCES_SETUP},{step:3,label:Qe.DESTINATIONS_SETUP},{step:4,label:Qe.SUMMARY}],bh=f.div`
642
+ display: flex;
643
+ flex-direction: column;
644
+ gap: 32px;
645
+ padding: 64px;
646
+ `,vh=({pagePaddingXAxis:o,pagePaddingYAxis:n,onDone:i})=>{const{setDrawerType:a}=ro(),{sourcesApi:l,destinationsApi:s}=kl(),[c,d]=r(1),[u,p]=r(!1),[h,m]=r(null),[g,f]=r(null),b=()=>d(e=>e+1),v=()=>d(e=>e-1);return e(ph,{paddingXAxis:o,paddingYAxis:n,children:[e(bh,{children:[t(rr,{useInline:!0}),t(Ni,{currentStep:c,data:fh,gap:32})]}),t(_l,{initialInputs:h,children:e(zl,{children:[1===c&&t(gh,{onStart:b}),2===c&&t(Sc,{disableAnimation:!0,onBack:e=>{m(e),v()},onNext:e=>{m(e),b()}}),3===c&&t(lc,{disableAnimation:!0,onBack:e=>{f(e),v()},onNext:e=>{f(e),b()},initialInputs:g}),4===c&&t(rh,{disableAnimation:!0,setStep:d,onSave:async()=>{if(!u){p(!0);try{const e=[];h&&e.push(l.persistV2(h)),g&&e.push(...g.map(e=>s.create(e.formData)));const t=await Promise.allSettled(e),o=[];for(const e of t)"rejected"===e.status?o.push(e.reason?.message||String(e.reason)):e.value&&"object"==typeof e.value&&"error"in e.value&&e.value.error&&o.push(e.value.error);if(o.length)return{error:o.join("\n")};a(an.OnboardingDone),i()}catch(e){return p(!1),{error:e instanceof Error?e.message:String(e)}}}},sourcesPayload:h,destinationsPayload:g})]})})]})},yh=e=>(e||[]).filter(e=>!!e.id).map(e=>String(e.id)),Ch=e=>{let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)&&(t+=e.length)}),e.onlyErrors&&t++,t},Sh=f.div`
647
+ position: relative;
648
+ display: inline-flex;
649
+ `,wh=f.button`
650
+ display: inline-flex;
651
+ align-items: center;
652
+ gap: 8px;
653
+ height: 32px;
654
+ padding: 0 12px;
655
+ border: none;
656
+ border-radius: 6px;
657
+ cursor: pointer;
658
+ background-color: ${({$isOpen:e,theme:t})=>e?t.v2.colors.silver[700]:t.v2.colors.silver[800]};
659
+ &:hover {
660
+ background-color: ${({theme:e})=>e.v2.colors.silver[700]};
661
+ }
662
+ `,xh=f.div`
663
+ position: absolute;
664
+ top: calc(100% + 8px);
665
+ right: 0;
666
+ width: 380px;
667
+ max-width: 90vw;
668
+ z-index: ${({theme:e})=>e.v2.zIndex.popover};
669
+
670
+ display: flex;
671
+ flex-direction: column;
672
+ border-radius: 12px;
673
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
674
+ box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
675
+ `,kh=f.div`
676
+ display: flex;
677
+ flex-direction: column;
678
+ gap: 12px;
679
+ padding: 16px;
680
+ max-height: 60vh;
681
+ overflow-y: auto;
682
+ `,Th=f.div`
683
+ display: flex;
684
+ align-items: center;
685
+ gap: 8px;
686
+ padding: 12px 16px;
687
+ border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
688
+ `,$h=f.div`
689
+ display: flex;
690
+ align-items: center;
691
+ gap: 8px;
692
+ margin-left: auto;
693
+ `,Ih=()=>{const o=b(),{sourcesApi:l,namespacesApi:s}=kl(),c=l.useSources().items,d=s.useNamespaces().items,{selectedStreamName:u}=et(),{getItemSS:p,setItemSS:h,removeItemSS:m}=Pi(),{namespaces:g,kinds:f,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S,setAll:w,clearAll:x,getEmptyState:k}=Ai(),T=i(()=>Oi(c,u),[c,u]);n(()=>{const e=p(Ri.OVERVIEW_FILTERS,k());w(e)},[]);const[$,I]=r({namespaces:g,kinds:f,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S}),[E,N]=r(Ch($)),[A,O]=r(!1);n(()=>{if(!A){const e={namespaces:g,kinds:f,monitors:v,languages:y,onlyErrors:C,podsAgentInjectionStatus:S};I(e),N(Ch(e))}},[A,g,f,v,y,C,S]);const R=a(null);vo(R,()=>O(!1)),Jo({key:"Escape",active:A},()=>O(!1));const D=i(()=>{const e=new Set,t=[];return d.forEach(({name:o})=>{e.has(o)||(e.add(o),t.push({id:o,label:o,withCheckbox:!0}))}),t},[d]),P=i(()=>{const e=new Set,t=[];return T.forEach(({id:o})=>{const{kind:n}=o;e.has(n)||(e.add(n),t.push({id:n,label:n,withCheckbox:!0}))}),t},[T]),F=i(()=>{const e=new Set,t=[];return T.forEach(({runtimeInfo:o})=>{o?.detectedLanguages?.forEach(o=>{e.has(o)||(e.add(o),t.push({id:o,label:qe[o]||o,withCheckbox:!0}))})}),t.sort((e,t)=>e.id.localeCompare(t.id))},[T]),L=i(()=>Di.map(({id:e,value:t})=>({id:e,label:t,withCheckbox:!0})),[]),M=i(()=>{const e=new Set,t=[];return T.forEach(({podsAgentInjectionStatus:o})=>{const{reasonEnum:n,message:i}=o||{};if(n){if(e.has(n))return;e.add(n),t.push({id:n,label:Ut(n)})}else if(i){if(e.has(i))return;e.add(i),t.push({id:i,label:i,withCheckbox:!0})}}),t},[T]),_=(e,t,o)=>{const n=t.filter(e=>o.includes(e.id));I(t=>{return{...t,[e]:(o=n,o.map(({id:e,label:t})=>({id:e,label:t})))};var o})},z=A?Da:Pa,B=i(()=>yh($.languages),[$.languages]);return e(Sh,{ref:R,children:[e(wh,{"data-id":"filters-trigger",$isOpen:A,type:"button",onClick:()=>O(e=>!e),children:[t(hl,{size:16,fill:o.v2.colors.white[500]}),t(de,{size:pe.XS,weight:500,nowrap:!0,children:"Filters"}),E>0&&t(Ye,{label:E,status:Le.Unknown,textSize:pe.XXXS}),t(z,{size:16,fill:o.v2.colors.silver[200]})]}),A&&e(xh,{children:[e(kh,{children:[t(bt,{label:"Namespace",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!D.length,options:D,values:yh($.namespaces),setValues:e=>_("namespaces",D,e)}),t(bt,{label:"Kind",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!P.length,options:P,values:yh($.kinds),setValues:e=>_("kinds",P,e)}),t(bt,{label:"Programming Language",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!F.length,options:F,values:B,setValues:e=>_("languages",F,e)}),t(bt,{label:"Monitors",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!L.length,options:L,values:yh($.monitors),setValues:e=>_("monitors",L,e)}),t(bt,{label:"Agent Injection Status",placeholder:"All",withSearch:!0,withMultiSelect:!0,disabled:!M.length,options:M,values:yh($.podsAgentInjectionStatus),setValues:e=>_("podsAgentInjectionStatus",M,e)}),t(ae,{label:"Show only sources with errors",size:It.L,value:!!$.onlyErrors,onChange:e=>I(t=>({...t,onlyErrors:e}))})]}),e(Th,{children:[t(me,{"data-id":"filters-reset",size:ge.S,variant:fe.Text,label:"Reset",onClick:()=>{m(Ri.OVERVIEW_FILTERS),x(),I(k()),N(0),O(!1)},textColor:o.v2.colors.red[500]}),e($h,{children:[t(me,{"data-id":"filters-cancel",size:ge.S,variant:fe.Secondary,label:"Cancel",onClick:()=>O(!1)}),t(me,{"data-id":"filters-apply",size:ge.S,variant:fe.Primary,label:"Apply",onClick:()=>{h(Ri.OVERVIEW_FILTERS,$),w($),N(Ch($)),O(!1)}})]})]})]})]})},Eh=f.div`
694
+ position: relative;
695
+ display: flex;
696
+ align-items: center;
697
+ gap: 8px;
698
+ width: 100%;
699
+ height: 52px;
700
+ padding: 4px 16px;
701
+ box-sizing: border-box;
702
+ border-radius: 16px 16px 0 0;
703
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
704
+ `,Nh=f.div`
705
+ position: absolute;
706
+ bottom: 0;
707
+ left: 0;
708
+ height: 3px;
709
+ width: ${({$percent:e})=>`${e}%`};
710
+ background-color: ${({theme:e})=>e.v2.colors.purple[500]};
711
+ border-radius: 32px;
712
+ transition: width 0.3s;
713
+ `,Ah=({entityType:o,badge:n,badgeTooltip:i,isLoading:a,refetch:l,partiallySelected:r,allSelected:s,onSelectAll:c,progressPercent:d})=>{const{setDrawerType:u}=ro();return e(Eh,{children:[e(he,{$gap:8,style:{flex:1,minWidth:0},children:[c&&t(te,{size:Fi.S,partiallyChecked:r,value:!!s,onChange:c}),t(de,{size:pe.S,nowrap:!0,children:`${Ut(o)}s`}),t(Ye,{label:n,tooltip:i,status:Le.Unknown,textSize:pe.XXXS})]}),e(he,{children:[t(vt,{"data-id":`add-${o}`,icon:Sa,onClick:()=>u(Li(o))}),t(vt,{"data-id":`refresh-${o}`,icon:Ga,onClick:l,disabled:a})]}),"number"==typeof d&&t(Nh,{$percent:d})]})},Oh=f(Q)`
714
+ align-items: center !important;
715
+ justify-content: center !important;
716
+ align-self: stretch;
717
+ min-height: 80px;
718
+ width: 100%;
719
+ padding: 16px;
720
+ gap: 4px;
721
+ border-radius: 12px;
722
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
723
+ cursor: pointer;
724
+
725
+ &:hover {
726
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
727
+ }
728
+ `,Rh=({entityType:o,description:n})=>{const{setDrawerType:i}=ro();return e(Oh,{onClick:()=>i(Li(o)),children:[e(he,{$gap:4,children:[t(Sa,{size:16}),t(de,{size:pe.S,children:`Add ${Ut(o)}`})]}),t(de,{size:pe.XXS,align:"center",children:n})]})},Dh=f.div`
729
+ display: flex;
730
+ align-items: center;
731
+ gap: 12px;
732
+ width: 100%;
733
+ height: 54px;
734
+ padding: 4px 8px;
735
+ box-sizing: border-box;
736
+ border-radius: 8px;
737
+ cursor: pointer;
738
+ opacity: ${({$faded:e})=>e?.5:1};
739
+
740
+ &:hover {
741
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
742
+ }
743
+ `,Ph=f(he)`
744
+ flex: 1;
745
+ min-width: 0;
746
+ `,Fh=({entityId:o,entityType:n,title:a,status:l,faded:r,tooltip:s,throughput:c,icon:d,icons:u,iconSrc:p,isActive:h,raw:m})=>{const g=b(),f=n===Tt.Source,v="boolean"==typeof h,y=r||v&&!h,{setDrawerType:C,setDrawerEntityId:S}=ro(),{selectedSources:w,setSelectedSources:x}=Mi(),k=m,T=f?k.id.namespace:"",$=i(()=>{if(!f)return-1;const e=w[T];return e?.length?e.findIndex(e=>e.id.name===k.id.name&&e.id.kind===k.id.kind):-1},[f,w,T,k.id]),I=v&&!h?_i(Le.Info,g):l?_i(l,g):void 0,E=f&&"object"==typeof o?`${o.namespace}-${o.name}-${o.kind}`:o;return e(Dh,{"data-id":E,$faded:y,onClick:()=>{C(ho(n)),S(o)},children:[f&&t(te,{size:Fi.S,value:-1!==$,onChange:()=>{const e={...w};e[T]||(e[T]=[]),-1===$?e[T].push(k):e[T].splice($,1),x(e)}}),t(po,{icons:u,icon:d,iconSrc:p}),e(Ph,{$gap:4,children:[t(Re,{size:pe.XS,nowrap:!0,children:a}),t(he,{$gap:6,$justifyContent:"flex-end",style:{marginLeft:"auto",flexShrink:0},children:c&&t(Ee,{text:s||"Heads up! The data-flow metrics you see are calculated over 10-second intervals.",children:t(Ye,{label:c,status:l&&[Le.Error,Le.Warning].includes(l)?l:Le.Unknown,leftIcon:I,textSize:pe.XXXS})})})]})]})};function Lh(e){return Object.values(e.conditions??{}).filter(Boolean).some(({status:e})=>e===Le.Loading)?e:{...e,workloadOdigosHealthStatus:{status:Jt.Pending,name:"WorkloadOdigosHealthStatus",reasonEnum:"Pending",message:""}}}function Mh(e){const t=Object.values(e.conditions??{}).filter(Boolean),o=t.filter(({status:e})=>e!==Le.Loading);return o?.length===t?.length?e:{...e,conditions:o?.length?o.reduce((e,t)=>(e[t.name]=t,e),{}):{}}}const _h=f.div`
747
+ position: absolute;
748
+ top: 0;
749
+ left: 0;
750
+ right: 0;
751
+ z-index: 1;
752
+ padding: 6px 12px;
753
+ border-radius: 12px 12px 0 0;
754
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
755
+ border-bottom: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
756
+ pointer-events: none;
757
+ `,zh=f.div`
758
+ display: flex;
759
+ align-items: center;
760
+ gap: 8px;
761
+ padding: 4px 8px 0;
762
+ `,Bh=f.div`
763
+ flex: 1;
764
+ height: 1px;
765
+ background: ${({theme:e})=>e.v2.colors.silver[700]};
766
+ `,Xh=({namespace:e})=>{const o=b();return t(_h,{children:t(de,{size:pe.XXS,nowrap:!0,color:o.v2.colors.grey[300],children:e})})},Vh=({namespace:o})=>{const n=b();return e(zh,{children:[t(Bh,{}),t(de,{size:pe.XXS,nowrap:!0,color:n.v2.colors.grey[300],children:o}),t(Bh,{})]})},Uh={[Tt.InstrumentationRule]:Qe.NO_DATA_INSTRUMENTATION_RULES,[Tt.Source]:Qe.NO_DATA_SOURCES,[Tt.Action]:Qe.NO_DATA_ACTIONS,[Tt.Destination]:Qe.NO_DATA_DESTINATIONS},Gh=f.div`
767
+ display: flex;
768
+ flex-direction: column;
769
+ flex: 1 0 0;
770
+ min-width: 0;
771
+ `,Hh=f.div`
772
+ display: flex;
773
+ flex-direction: column;
774
+ align-items: stretch;
775
+ width: 100%;
776
+ padding: 8px;
777
+ box-sizing: border-box;
778
+ border-radius: 0 0 16px 16px;
779
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
780
+ overflow: hidden;
781
+ `,jh=f.div`
782
+ position: relative;
783
+ display: flex;
784
+ flex-direction: column;
785
+ align-items: stretch;
786
+ width: 100%;
787
+ padding: ${4}px;
788
+ box-sizing: border-box;
789
+ border-radius: 12px;
790
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
791
+ height: ${({$height:e})=>e}px;
792
+ overflow: hidden;
793
+ `,Wh=({entityType:o,entities:a,unfilteredCount:s,metrics:c,loading:d,maxHeight:u,refetch:p})=>{const h=o===Tt.Source,m=a.length!==s,g=Nt(e=>h?e.progress[Rt.Instrumenting]?.percentage:void 0),f=Nt(e=>h?e.progress[Rt.Uninstrumenting]?.percentage:void 0),b=!h||void 0===g&&void 0===f?void 0:g||f||0,{selectedSources:v,setSelectedSources:y}=Mi(),C=i(()=>h?Object.values(v).reduce((e,t)=>e+t.length,0):0,[h,v]),S=i(()=>{if(!c)return;const e=new Map,t=o===Tt.Source?c.sources:o===Tt.Destination?c.destinations:void 0;if(t)for(const o of t)e.set(zi(o),o.throughput);return e},[c,o]),w=i(()=>a.map(e=>((e,t,o)=>{const n=Dt(e);if(!n)return null;const i=t===Tt.Source;let a,l,r=!1,s=e;if(i){const t=(e=>{const t=e.workloadOdigosHealthStatus?.status;switch(t){case Jt.Failure:return{status:Le.Error,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Jt.Notice:return{status:Le.Warning,faded:!1,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};case Jt.Pending:case Jt.Waiting:return{status:void 0,faded:!1,displaySource:Lh(e)};case Jt.Unsupported:case Jt.Disabled:return{status:void 0,faded:!0,tooltip:e.workloadOdigosHealthStatus?.message,displaySource:e};default:return{status:void 0,faded:!1,displaySource:Mh(e)}}})(e);a=t.status,r=t.faded,l=t.tooltip,s=t.displaySource}else{const{priorotizedStatus:t,hasDisableds:o}=Bi(e.conditions);a=t,r=o}const c=Xi(e,t,{extended:i,prioritizeDisplayName:!i});let d,u,p,h,m;switch(t){case Tt.Source:{d=uo(e),u=Ui(Tt.Source);const t=o?.get(Vi(n));h=go(t);break}case Tt.Destination:{const t=wt(e.destinationType.type);u=t.icon,p=t.iconSrc;const i=o?.get(Vi(n));h=go(i),m=!e.disabled;break}case Tt.Action:u=_t(e.type),m=!e.disabled;break;case Tt.InstrumentationRule:u=Wt(e.type),m=!e.disabled}return{key:Vi(n),entityId:n,namespace:i?e.id.namespace:void 0,raw:s,itemProps:{entityId:n,entityType:t,title:c,status:a,faded:r,tooltip:l,throughput:h,icon:u,icons:d,iconSrc:p,isActive:m,raw:s}}})(e,o,S)).filter(Boolean),[a,o,S]),[x,k]=r(""),{elements:T,indexToNamespace:$,multipleNs:I,dividerCount:E}=i(()=>{const e=[],o=[],n=new Set(w.map(e=>e.namespace).filter(Boolean)).size>1;n&&(o.push(""),e.push(t("div",{style:{height:24}},"ns-spacer")));let i=0,a="";for(const n of w)h&&n.namespace&&n.namespace!==a&&(""!==a&&(o.push(n.namespace),e.push(t(Vh,{namespace:n.namespace},`ns-divider-${n.namespace}`)),i+=1),a=n.namespace),o.push(n.namespace||""),e.push(t(Fh,{...n.itemProps},n.key));return{elements:e,indexToNamespace:o,multipleNs:n,dividerCount:i}},[w,h]);n(()=>{if(h&&$.length&&!x){const e=$.find(Boolean);e&&k(e)}},[h,$]);const N=l(e=>{if(!$.length)return;const t=$[Math.min(e,$.length-1)];t&&t!==x&&k(t)},[$,x]),A=58*w.length+(I?28:0)+32*E,O=Math.max(0,u-52-16),R=Math.min(O,A)+8,D="number"==typeof b?`${b}%`:m?`${a.length}/${s}`:s;return e(Gh,{children:[t(Ah,{entityType:o,badge:D,badgeTooltip:m?Qe.FILTERED_COUNT_TOOLTIP:void 0,isLoading:d,refetch:p,partiallySelected:C>0&&a?.length!==C,allSelected:C>0&&a?.length===C,onSelectAll:h?e=>{if(h)if(e){const e={};a?.forEach(t=>{const{namespace:o}=t.id;e[o]?e[o].push(t):e[o]=[t]}),y(e)}else y({})}:void 0,progressPercent:b}),t(Hh,{children:a.length?e(jh,{$height:R,children:[I&&x&&t(Xh,{namespace:x}),t(lo,{gap:4,elements:T,onTopIndexChange:I?N:void 0})]}):d?t(mt,{size:3}):t(Rh,{entityType:o,description:Uh[o]??Qe.TO_COLLECT_OTEL_DATA})})]})},Kh=f.div`
794
+ width: 100%;
795
+ flex: 1;
796
+ min-height: 0;
797
+ height: 100%;
798
+ display: flex;
799
+ align-items: stretch;
800
+ gap: 16px;
801
+ `,Yh={sources:[],destinations:[]},qh=()=>{const o=Ai(),{selectedStreamName:n}=et(),{containerRef:a,containerHeight:l}=Gi(),{sourcesApi:r,destinationsApi:s,actionsApi:c,instrumentationRulesApi:d,metricsApi:u}=kl(),{items:p,loading:h}=r.useSources(),{items:m,loading:g}=s.useDestinations(),{items:f,loading:b}=c.useActions(),{items:v,loading:y}=d.useRules(),C=ro(e=>e.drawerType),{data:S}=u.useMetrics({skip:!p.length||!m.length||!!C,pollInterval:1e4,fetchPolicy:"network-only"}),w=S?.getOverviewMetrics??Yh,x=i(()=>Oi(p,n),[p,n]),k=i(()=>Xt(m,n),[m,n]),T=i(()=>Hi(x,o),[x,o]),$=i(()=>ji(k,o),[k,o]),I=i(()=>Wi(f,o),[f,o]);return e(Kh,{ref:a,children:[t(Wh,{entityType:Tt.InstrumentationRule,entities:v,unfilteredCount:v.length,loading:y,maxHeight:l,refetch:d.fetchAll}),t(Wh,{entityType:Tt.Source,entities:T,unfilteredCount:x.length,metrics:w,loading:h,maxHeight:l,refetch:r.fetchAll}),t(Wh,{entityType:Tt.Action,entities:I,unfilteredCount:f.length,loading:b,maxHeight:l,refetch:c.fetchAll}),t(Wh,{entityType:Tt.Destination,entities:$,unfilteredCount:k.length,metrics:w,loading:g,maxHeight:l,refetch:s.fetchAll})]})},Jh="40vw",Zh=f.div`
802
+ position: relative;
803
+ width: ${Jh};
804
+ `,Qh=f.div`
805
+ position: absolute;
806
+ top: calc(100% + 8px);
807
+ left: 0;
808
+ z-index: ${({theme:e})=>e.v2.zIndex.popover};
809
+ display: flex;
810
+ flex-direction: column;
811
+ gap: 8px;
812
+ padding: 8px;
813
+ width: calc(${Jh} - 16px);
814
+ border-radius: 12px;
815
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
816
+ box-shadow: 0 12px 24px 24px rgba(0, 0, 0, 0.5);
817
+ `,em=f.div`
818
+ display: flex;
819
+ align-items: center;
820
+ overflow-x: auto;
821
+ `,tm=f.div`
822
+ display: flex;
823
+ flex-direction: column;
824
+ gap: 0;
825
+ max-height: 60vh;
826
+ overflow-y: auto;
827
+ `,om=f.div`
828
+ padding: 8px 12px 4px 12px;
829
+ `,nm=f.div`
830
+ display: flex;
831
+ align-items: center;
832
+ gap: 8px;
833
+ padding: 8px 12px;
834
+ border-radius: 6px;
835
+ cursor: pointer;
836
+ &:hover {
837
+ background-color: ${({theme:e})=>e.v2.colors.silver[700]};
838
+ }
839
+ `,im=f.div`
840
+ padding: 16px 8px;
841
+ `,am=({preventPopup:o=!1})=>{const n=b(),{selectedStreamName:l}=et(),{searchText:c,setSearchText:d}=Ai(),{setDrawerType:u,setDrawerEntityId:p}=ro(),{sourcesApi:h,destinationsApi:m,actionsApi:g,instrumentationRulesApi:f}=kl(),v=h.useSources().items,y=m.useDestinations().items,C=g.useActions().items,S=f.useRules().items,w=a(null),[x,k]=r(!1),[T,$]=r("all"),I=!o&&(!!c||x),E=()=>{d(""),k(!1),$("all")};vo(w,()=>E()),Jo({key:"Escape",active:I},E);const{categories:N,searchResults:A}=i(()=>(({instrumentationRules:e,sources:t,actions:o,destinations:n,searchText:i,selectedCategory:a})=>{const l=i?e.filter(e=>e.type?.toLowerCase().includes(i)||e.ruleName?.toLowerCase().includes(i)):e,r=i?t.filter(e=>e.id.name?.toLowerCase().includes(i)||e.serviceName?.toLowerCase().includes(i)||e.id.namespace?.toLowerCase().includes(i)):t,s=i?o.filter(e=>e.type?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):o,c=i?n.filter(e=>e.destinationType.displayName?.toLowerCase().includes(i)||e.name?.toLowerCase().includes(i)):n,d=[{category:Tt.Source,label:"Sources",count:r.length,entities:[]},{category:Tt.Action,label:"Actions",count:s.length,entities:[]},{category:Tt.Destination,label:"Destinations",count:c.length,entities:[]},{category:Tt.InstrumentationRule,label:"Instrumentation Rules",count:l.length,entities:[]}];d.unshift({category:"all",label:"All",count:l.length+r.length+s.length+c.length,entities:[]});const u=d.filter(({count:e,category:t})=>!!e&&"all"!==t&&["all",t].includes(a)).map(e=>({...e,entities:e.category===Tt.InstrumentationRule?l:e.category===Tt.Source?r:e.category===Tt.Action?s:e.category===Tt.Destination?c:[]}));return{categories:d,searchResults:u}})({instrumentationRules:S,sources:Oi(v,l),actions:C,destinations:Xt(y,l),searchText:c,selectedCategory:T}),[S,v,C,y,l,c,T]),O=i(()=>N.filter(({count:e,category:t})=>!!e||"all"===t).map(({category:e,label:t,count:o})=>({value:e,label:o?`${t} (${o})`:t})),[N]),R=A.some(({entities:e})=>e.length>0);return e(Zh,{ref:w,children:[t(ao,{value:c,onChange:e=>d(e.toLowerCase()),onFocus:()=>k(!0),width:Jh}),I&&e(Qh,{children:[O.length>1&&t(em,{children:t(be,{options:O,selected:T,setSelected:$})}),R?t(tm,{children:A.map(({category:o,label:i,entities:a},l)=>{if(!a.length)return null;const r=Ui(o);return e(s,{children:[t(om,{children:t(de,{size:pe.XXS,color:ue.Secondary,children:i})}),a.map((i,a)=>e(nm,{onClick:()=>{const e=Dt(i);e&&(u(ho(o)),p(e),E())},children:[r&&t(r,{size:16,fill:n.v2.colors.white[500]}),t(de,{size:pe.XS,nowrap:!0,children:Xi(i,o,{extended:!0})})]},`entity-${l}-${a}`))]},`category-list-${o}`)})}):t(im,{children:t(Oe,{hideIcon:!0,title:"No results",subTitle:c?`No matches for "${c}"`:"Start typing to search"})})]})]})},lm=({onRedirectToSampling:n})=>{const{sourcesApi:a}=kl(),{items:l}=a.useSources(),{drawerType:r,drawerEntityId:s,setDrawerType:c,setDrawerEntityId:d}=ro(),u=()=>{c(null),d(null)},p=i(()=>l.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[l]),h=i(()=>Array.from(new Set(l.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[l]);return e(o,{children:[t(ap,{}),r===an.AddSource&&t(_l,{children:t(Sc,{onClose:u,withOverlay:!0})}),r===an.AddDestination&&t(zl,{children:t(lc,{onClose:u,withOverlay:!0})}),r===an.AddInstrumentationRule&&t(Xl,{sourceOptions:p,namespaceOptions:h,children:t(rc,{onClose:u,withOverlay:!0})}),r===an.AddAction&&t(Bl,{children:t(qs,{onClose:u,withOverlay:!0})}),r===an.EditSource&&t(Vl,{children:t(Du,{onClose:u,sourceId:s,onRedirectToSampling:n})}),r===an.EditDestination&&t(zl,{children:t($c,{onClose:u,destinationId:s})}),r===an.EditInstrumentationRule&&t(Xl,{sourceOptions:p,namespaceOptions:h,children:t(Ec,{onClose:u,ruleId:s})}),r===an.EditAction&&t(Bl,{children:t(xc,{onClose:u,actionId:s})})]})},rm=f.div`
842
+ position: relative;
843
+ display: inline-flex;
844
+ `,sm=f.div`
845
+ display: inline-flex;
846
+ align-items: center;
847
+ gap: 6px;
848
+ padding: 4px 8px;
849
+ border-radius: 8px;
850
+ cursor: pointer;
851
+ background-color: ${({$isOpen:e,theme:t})=>e?t.v2.colors.silver[800]:"transparent"};
852
+ &:hover {
853
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
854
+ }
855
+ `,cm=f.div`
856
+ position: absolute;
857
+ top: calc(100% + 8px);
858
+ left: 0;
859
+ min-width: max(100%, 320px);
860
+ z-index: ${({theme:e})=>e.v2.zIndex.popover};
861
+
862
+ display: flex;
863
+ flex-direction: column;
864
+ gap: 8px;
865
+ padding: 8px;
866
+ border-radius: 12px;
867
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
868
+ box-shadow: 0 0 24px 0 rgba(0, 0, 0, 0.3);
869
+ `,dm=f.div`
870
+ display: flex;
871
+ align-items: center;
872
+ gap: 8px;
873
+ width: 100%;
874
+ `,um=f.div`
875
+ display: flex;
876
+ flex-direction: column;
877
+ gap: 0;
878
+ max-height: 240px;
879
+ overflow-y: auto;
880
+ `,pm=f.div`
881
+ display: flex;
882
+ align-items: center;
883
+ gap: 8px;
884
+ padding: 6px 8px;
885
+ border-radius: 6px;
886
+ cursor: pointer;
887
+ background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:"transparent"};
888
+ &:hover {
889
+ background-color: ${({$selected:e,theme:t})=>e?t.v2.colors.silver[600]:t.v2.colors.silver[700]};
890
+ }
891
+ `,hm=f.div`
892
+ flex: 1;
893
+ min-width: 0;
894
+ overflow: hidden;
895
+ text-overflow: ellipsis;
896
+ white-space: nowrap;
897
+ `,mm=f.div`
898
+ display: flex;
899
+ align-items: center;
900
+ gap: 2px;
901
+ flex-shrink: 0;
902
+ `,gm=f.div`
903
+ display: flex;
904
+ padding-top: 4px;
905
+ border-top: 1px solid ${({theme:e})=>e.v2.colors.silver[700]};
906
+ `,fm=()=>{const l=b(),{isVm:s}=C(),{clearStore:c}=Ki(),{dataStreamsApi:d}=kl();d.useDataStreams();const{dataStreams:u,selectedStreamName:p,setSelectedStreamName:h}=et(),m=a(null),[g,f]=r(!1),[v,y]=r(""),[S,w]=r(""),[x,k]=r(!1),[T,$]=r(!1),[I,E]=r(!1),[N,A]=r(""),[O,R]=r(!1);vo(m,()=>f(!1)),n(()=>{g||y("")},[g]);const D=i(()=>{if(!v)return u;const e=v.toLowerCase();return u.filter(({name:t})=>t.toLowerCase().includes(e))},[u,v]),P=g?Da:Pa;return s?null:e(o,{children:[e(rm,{ref:m,children:[e(sm,{"data-id":"data-stream-select",$isOpen:g,onClick:()=>f(e=>!e),children:[t(ml,{size:24}),t(de,{size:pe.S,weight:500,nowrap:!0,children:(F=p,`Data Stream: ${F}`)}),t(Ye,{label:u.length,status:Le.Unknown,textSize:pe.XXXS}),t(P,{size:20,fill:l.v2.colors.silver[200]})]}),g&&e(cm,{children:[t(dm,{children:t(ao,{value:v,onChange:y,placeholder:"Search streams...",width:"100%"})}),t(um,{children:0===D.length?t(pm,{children:t(de,{size:pe.XS,color:ue.Secondary,children:"No streams match"})}):D.map(({name:o})=>{const n=o===Yi;return e(pm,{"data-id":`stream-row-${o}`,$selected:o===p,onClick:()=>(e=>{e!==p&&(c(),h(e)),f(!1)})(o),children:[t(hm,{children:t(de,{size:pe.XS,nowrap:!0,children:o})}),e(mm,{children:[t(vt,{"data-id":`stream-edit-${o}`,icon:Ia,size:yt.XS,onClick:e=>{e.stopPropagation(),f(!1),w(o),k(!0)}}),!n&&t(vt,{"data-id":`stream-delete-${o}`,icon:Ca,size:yt.XS,onClick:e=>{e.stopPropagation(),f(!1),A(o),R(!0)}})]})]},`stream-${o}`)})}),t(gm,{children:t(me,{"data-id":"add-stream-trigger",variant:fe.Secondary,size:ge.S,leftIcon:Sa,label:`${Ft.NEW} ${Qe.STREAM_NAME}`,fullWidth:!0,onClick:()=>{f(!1),c(),E(!0),$(!0)}})})]})]}),I&&t(Ul,{defaultExcludeName:p,children:t(tp,{isOpen:T,onClose:()=>$(!1),onCloseEnd:()=>E(!1)})}),S&&t(Ul,{children:t(op,{isOpen:x,dataStreamName:S,onClose:()=>k(!1),onCloseEnd:()=>w("")})}),t(ir,{target:`${Qe.STREAM_NAME.toLowerCase()} "${N}"`,isOpen:O,onClose:()=>R(!1),onApprove:async()=>{N&&await d.remove(N)}})]});var F},bm=()=>{const{selectedStreamName:a}=et(),{selectedSources:s,setSelectedSources:c}=Mi(),{sourcesApi:d}=kl(),[u,p]=r(!1),[h,m]=r(!1),g=i(()=>Object.values(s).reduce((e,t)=>e+t.length,0),[s]),f=l(()=>{c({})},[c]),b=l(()=>p(!1),[]),v=l(()=>m(!1),[]);n(()=>{f()},[a,f]);const y=l(()=>{d.restartWorkloads(Object.values(s).flat().filter(e=>e.id.kind!==mo.StaticPod).map(so)),f()},[d,s,f]),C=l(()=>{d.persistV2(Object.fromEntries(Object.entries(s).map(([e,t])=>[e,t.map(({id:e})=>({namespace:e.namespace,name:e.name,kind:e.kind||void 0,selected:!1,currentStreamName:a}))]))),f()},[d,s,a,f]),S=i(()=>[{id:"multi-source-deselect",type:io.Button,buttonProps:{variant:fe.Text,size:ge.S,label:"Deselect",onClick:f}},{id:"multi-source-restart",type:io.Button,buttonProps:{variant:fe.Secondary,size:ge.S,label:"Restart",leftIcon:il,onClick:()=>p(!0)}},{id:"multi-source-uninstrument",type:io.Button,buttonProps:{variant:fe.Primary,size:ge.S,label:"Uninstrument",leftIcon:Ca,onClick:()=>m(!0)}}],[f]);return e(o,{children:[t(Io,{isOpen:g>0,richTitle:{icon:_a,title:"Selected sources",badge:{label:g}},actions:S}),t(Ze,{isOpen:u,title:"Rollout Restart Workloads",description:"Are you sure you want to rollout restart these workloads?",onClose:b,denyButton:{label:"Go Back",variant:fe.Secondary,onClick:b},approveButton:{label:"Confirm",variant:fe.Primary,onClick:()=>{y(),b()}}}),t(ir,{isOpen:h,action:"uninstrument",target:`${g} source${1===g?"":"s"}`,onClose:v,onDeny:v,onApprove:C})]})},vm=y`
907
+ 0% {
908
+ background-position: 200% 50%;
909
+ }
910
+ 100% {
911
+ background-position: 0% 50%;
912
+ }
913
+ `,ym=f.div`
914
+ display: flex;
915
+ align-items: center;
916
+ justify-content: space-evenly;
917
+ width: 100%;
918
+ min-height: 12px;
919
+ padding: 2px;
920
+ border-radius: 12px;
921
+
922
+ background: ${({theme:e})=>`linear-gradient(90deg, ${e.v2.colors.pink[500]} 0%, ${e.v2.colors.purple[400]} 25%, ${e.v2.colors.green[500]} 50%, ${e.v2.colors.purple[400]} 75%, ${e.v2.colors.pink[500]} 100%)`};
923
+ background-size: 200% 100%;
924
+ animation: ${vm} 15s linear infinite;
925
+ `,Cm=[Ma,_a,Oa,Ra],Sm=({onRedirectToSampling:o})=>{const n=b();return e(Ei,{children:[e(ct,{fullHeight:!0,customTitle:t(fm,{}),customSearch:t(am,{}),filters:t(Ih,{}),children:[t(ym,{children:Cm.map((o,i)=>e(s,{children:[t(o,{size:24}),i<Cm.length-1&&t(Aa,{fill:n.v2.colors.white[500]+ut["020"],size:24})]},o.name))}),t(qh,{})]}),t(lm,{onRedirectToSampling:o}),t(bm,{})]})};var wm;(e=>{e.Gateway="gateway",e.Node="node"})(wm||(wm={}));const xm=({onClickDownloadDiagnose:o,onClickRefresh:n,loading:a,disabled:l})=>{const r=i(()=>{const e=[];return o&&e.push({id:on(),type:io.Button,buttonProps:{label:"Download Diagnose",leftIcon:nl,size:ge.S,variant:fe.Text,onClick:o,disabled:l}}),n&&e.push({id:on(),type:io.Button,buttonProps:{label:"Refresh",leftIcon:Ga,size:ge.S,variant:fe.Text,onClick:n,disabled:l,loading:a}}),e},[o,n,l,a]);return e(he,{$alignItems:"center",$justifyContent:"space-between",children:[t(qi,{icon:gl,title:"Collectors Pipeline"}),t(Ji,{actions:r})]})},km=({pod:o,onClose:n})=>{const{formatTimeAgo:a}=Kt(),{collectorsApi:l}=kl(),{data:r}=l.usePodInfo(o?{namespace:o.namespace,name:o.name}:void 0,{skip:!o}),s=i(()=>[{id:on(),title:"Node",label:r?.node??"-",withCopy:!0},{id:on(),title:"Status",badge:{status:Zi(r?.status),label:r?.status??"-"}}],[r]),c=i(()=>r?.containers?.map(e=>({id:on(),items:[{id:on(),title:"Container",label:e.name??"-"},{id:on(),title:"Status",label:e.startedAt?`${e.status} (since ${a(e.startedAt)})`:e.status},{id:on(),title:"Ready",badge:{status:e.ready?Le.Success:Le.Error,leftIcon:e.ready?xa:ka,label:e.ready?"True":"False",invertColors:!0}},{id:on(),title:"Started",badge:{status:e.started?Le.Success:Le.Error,leftIcon:e.started?xa:ka,label:e.started?"True":"False",invertColors:!0}},{id:on(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:on(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:on(),title:Qe.RESTARTS,label:e.restarts.toString()},{id:on(),title:"State Reason",label:e.stateReason??"-"},{id:on(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:on(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[r]);return t(se,{isOpen:!!o,header:{icon:Xa,title:"Pod Information",onClose:n},children:r?e(Lt,{bgTint:"1000",richTitle:{icon:Xa,title:r.name,withCopy:!0},children:[t(Lt,{bgTint:"900",cellsPerRow:2,items:s}),e(Lt,{bgTint:"900",richTitle:{icon:qa,title:Qe.DEBUG_COMMANDS},withCollapse:!0,collapseIsDefaultOpen:!0,children:[t(no,{value:`kubectl get pod ${r.name} -n ${r.namespace} -o yaml`}),t(no,{value:`kubectl describe pod ${r.name} -n ${r.namespace}`}),t(no,{value:`kubectl logs ${r.name} -n ${r.namespace}`})]}),t(Lt,{bgTint:"900",richTitle:{title:"Containers Overview"},withCollapse:!0,collapseIsDefaultOpen:!0,children:c.length?c.map(({id:e,items:o})=>t(Lt,{bgTint:"800",cellsPerRow:2,items:o},e)):t(Oe,{title:"No containers",subTitle:"Pod has no containers"})}),t(lr,{bgTint:"900",yaml:r.manifestYAML,defaultOpen:!0})]}):t(gt,{$height:"50vh",children:t(Ct,{withSpinner:!0})})})};var Tm;(e=>{e.PodName="podName",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.SpanDropRate="spanDropRate",e.Age="age",e.DockerImage="dockerImage"})(Tm||(Tm={}));const $m=e=>{const t=[{key:Tm.PodName,label:"Pod Name"},{key:Tm.Status,label:"Status"},{key:Tm.Restarts,label:Qe.RESTARTS},{key:Tm.NodeName,label:"Node Name"},{key:Tm.Age,label:"Age"},{key:Tm.DockerImage,label:"Collector Version"}];return e&&t.splice(4,0,{key:Tm.SpanDropRate,label:"Span Drop Rate",noSort:!0,noFilter:!0}),t},Im=({isLoading:o,pods:n,withSpanDropRate:a})=>{const l=b(),{formatTimeAgo:s}=Kt(),[c,d]=r(null),u=i(()=>n.map(o=>({onClick:()=>d(o),cells:[{key:Tm.PodName,rawValue:o.name},{key:Tm.Status,rawValue:o.status,component:()=>{return e=o.status,t(Ye,{status:Zi(e),label:e});var e}},{key:Tm.Restarts,rawValue:o.restartsCount.toString()},{key:Tm.NodeName,rawValue:o.nodeName},{key:Tm.SpanDropRate,rawValue:0,component:()=>{const{collectorMetrics:n}=o;if(!n)return t(de,{children:"-"});const i=(n?.metricsAcceptedRps??0)+(n?.metricsDroppedRps??0),a=i>0?Math.round((n?.metricsDroppedRps??0)/i*100):0,l=a>0?Le.Error:Le.Success,r=(n?.exporterSuccessRps??0)+(n?.exporterFailedRps??0),s=r>0?Math.round((n?.exporterFailedRps??0)/r*100):0,c=s>0?Le.Error:Le.Success;return e(he,{$gap:4,children:[t(Ee,{text:`Accepted: ${n.metricsAcceptedRps.toLocaleString()} spans/s\nDropped: ${n.metricsDroppedRps.toLocaleString()} spans/s`,children:t(Ye,{status:l,label:`Receiver ${a}%`,leftIcon:l===Le.Error?fl:bl,useSecondaryTone:!0,invertColors:!0})}),t(Ee,{text:`Success: ${n.exporterSuccessRps.toLocaleString()} spans/s\nFailed: ${n.exporterFailedRps.toLocaleString()} spans/s`,children:t(Ye,{status:c,label:`Exporter ${s}%`,leftIcon:c===Le.Error?fl:bl,useSecondaryTone:!0,invertColors:!0})})]})}},{key:Tm.Age,rawValue:s(o.creationTimestamp)},{key:Tm.DockerImage,rawValue:o.image}]})),[n,l]);return e(Lt,{fullHeight:!0,bgTint:"1000",moreSpacing:!0,richTitle:{icon:Xa,title:"Pods"},children:[t(To,{variant:$o.Data,isLoading:o,columns:$m(a),rows:u}),t(km,{pod:c,onClose:()=>d(null)})]})},Em=({isOpen:e,onClose:o,title:n,yaml:i})=>t(se,{isOpen:e,header:{icon:vl,title:n,onClose:o},children:t(lr,{yaml:i,defaultOpen:!0})}),Nm=e=>{switch(e){case Qi.Healthy:return"All desired replicas are updated, available, and ready";case Qi.Updating:return"Workload is progressing towards desired state (e.g., updating pods)";case Qi.Degraded:return"Progressing but with availability issues (e.g., not enough available replicas)";case Qi.Failed:return"Progress deadline exceeded or an unrecoverable error occurred";case Qi.Down:return"No available replicas";case Qi.Unknown:return"Status cannot be determined from current signals";default:return"Status unknown"}};var Am;(e=>{e.ManifestYaml="manifest-yaml",e.ConfigMapYaml="configmap-yaml"})(Am||(Am={}));const Om=f.div`
926
+ flex: 0.5;
927
+ padding: 12px;
928
+ border-radius: 12px;
929
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
930
+ `,Rm=({selectedTab:o,gatewayInfo:n,nodeCollectorInfo:a,isLoading:l})=>{const{formatTimeAgo:s}=Kt(),[c,d]=r(null),u=i(()=>(e=>{switch(e){case wm.Gateway:return"Deployment";case wm.Node:return"DaemonSet";default:return"Pipeline Collectors"}})(o),[o]),p=i(()=>((e,t,o,n)=>{const i={status:Le.Disabled,label:"No rollouts yet"};let a=!1,l=null;switch(e){case wm.Gateway:a=t?.rolloutInProgress??!1,l=t?.lastRolloutAt??null;break;case wm.Node:a=o?.rolloutInProgress??!1,l=o?.lastRolloutAt??null;break;default:return i}return a?{status:Le.Info,label:"Rollout in progress",rightIcon:Ga,useSecondaryTone:!0}:l?{status:Le.Disabled,label:`Last Rollout: ${n(l)}`}:i})(o,n,a,s),[n,a,o,s]),h=i(()=>((e,t,o,n)=>{let i=n?Le.Info:Le.Unknown,a=n?"Loading":Qi.Unknown,l=n?"Fetching data...":Nm(Qi.Unknown);switch(e){case wm.Gateway:i=t?.status?Zi(t?.status):i,a=t?.status??a,l=t?.status?Nm(t.status):l;break;case wm.Node:i=o?.status?Zi(o?.status):i,a=o?.status??a,l=o?.status?Nm(o.status):l}return{status:i,title:a,description:l}})(o,n,a,l),[n,a,o,l]),m=i(()=>((e,t,o)=>{switch(e){case wm.Gateway:return[{gaugeWidth:128,min:0,max:t?.hpa?.max??0,current:t?.hpa?.current??0,title:"HPA Spec",primaryLabel:"Current replicas",secondaryLabel:"Max replicas"}];case wm.Node:return[{gaugeWidth:128,min:0,max:o?.nodes?.desired??0,current:o?.nodes?.ready??0,title:"Nodes",primaryLabel:"Ready nodes",secondaryLabel:"Desired nodes"}];default:return[]}})(o,n,a),[n,a,o]),g=i(()=>((e,t,o,n)=>{switch(e){case wm.Gateway:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${t?.resources?.requests.cpu}/${t?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${t?.resources?.requests.memory}/${t?.resources?.limits.memory}`,isLoading:n}]}];case wm.Node:return[{title:"Resources (request/limit)",cells:[{label:"CPU",value:`${o?.resources?.requests.cpu}/${o?.resources?.limits.cpu}`,isLoading:n},{label:"Memory",value:`${o?.resources?.requests.memory}/${o?.resources?.limits.memory}`,isLoading:n}]}];default:return[]}})(o,n,a,l),[n,a,o,l]),f=i(()=>(o===wm.Gateway?n?.manifestYAML:a?.manifestYAML)??"",[n,a,o]),b=i(()=>(o===wm.Gateway?n?.configMapYAML:a?.configMapYAML)??"",[n,a,o]);return e(Lt,{bgTint:"1000",moreSpacing:!0,richTitle:{icon:vl,title:u,badge:p},actions:[{id:on(),type:io.ButtonDropData,buttonProps:{variant:fe.Secondary,size:ge.S,label:"View YAML",onClick:e=>d(e)},dropDataProps:{items:[{id:Am.ManifestYaml,label:u,icon:yl},{id:Am.ConfigMapYaml,label:"ConfigMap",icon:yl}]}}],children:[e(he,{$gap:16,children:[t("div",{children:t(ea,{...h})}),m.map(e=>t(Om,{children:t("div",{children:t(ta,{...e})})},e.title)),g.map(e=>t(oa,{...e},e.title))]}),t(Em,{isOpen:c===Am.ManifestYaml,onClose:()=>d(null),title:u,yaml:f}),t(Em,{isOpen:c===Am.ConfigMapYaml,onClose:()=>d(null),title:"ConfigMap",yaml:b})]})},Dm=[{value:wm.Gateway,label:"Gateway"},{value:wm.Node,label:"Node Collector"}],Pm=({minSupportedVersion:o})=>{const{isVersionSupported:n,version:a,minSupportedVersion:s}=C(o),[c,d]=r(wm.Gateway),u=c===wm.Gateway,p=c===wm.Node,{collectorsApi:h,configApi:m}=kl(),{data:g}=m.useEffectiveConfig(),{data:f,loading:b,refetch:v}=h.useGatewayInfo({skip:!u}),{data:y=[],loading:S,refetch:w}=h.useGatewayPods({skip:!u}),{data:x,loading:k,refetch:T}=h.useNodeCollectorInfo({skip:!p}),{data:$=[],loading:I,refetch:E}=h.useNodeCollectorPods({skip:!p}),N=u&&(b||S)||p&&(k||I),A=l(()=>{u?(v(),w()):p&&(T(),E())},[u,p,v,w,T,E]),O=i(()=>u?y:$,[y,$,u]);return e(Ei,{children:[t(xm,{disabled:!n,loading:N,onClickDownloadDiagnose:void 0,onClickRefresh:A}),e(na,{children:[e(Q,{children:[t(be,{variant:xo.Underline,size:De.L,options:Dm,selected:c,setSelected:d}),t(Rm,{selectedTab:c,gatewayInfo:f??null,nodeCollectorInfo:x??null,isLoading:N})]}),t(Im,{isLoading:N,pods:O,withSpanDropRate:!1===g?.odigosOwnTelemetryStore?.metricsStoreDisabled}),!n&&t(cr,{minSupportedVersion:s,currentVersion:a||""})]})]})},Fm=f.div`
931
+ display: inline-flex;
932
+ align-items: center;
933
+ min-width: 0;
934
+ overflow: hidden;
935
+ white-space: pre;
936
+ text-overflow: ellipsis;
937
+ `,Lm=f.div`
938
+ display: flex;
939
+ flex-direction: column;
940
+ gap: 4px;
941
+ min-width: 0;
942
+ flex: 1;
943
+ opacity: ${({$disabled:e})=>e?.4:1};
944
+ `,Mm=f(he)`
945
+ flex-shrink: 0;
946
+ gap: 6px;
947
+ align-items: center;
948
+ min-height: 22px;
949
+ `,_m=[{key:"content",label:"Content",noSort:!0,noFilter:!0,flex:1},{key:"badges",label:"Type",noSort:!0,noFilter:!0,flex:"0 0 128px"}],zm=[{value:"all",label:ia},{value:"Relevance",label:"Relevance"},{value:"Duration",label:"Duration"},{value:"Error",label:"Error"}],Bm=({title:o,items:n,isLoading:a,showTypeFilter:s,onRuleClick:c,onCreateRule:d,onEditRule:u,onDeleteRule:p})=>{const h=b(),[m,g]=r(""),[f,v]=r("all"),y=i(()=>{let e=((e,t,o)=>o&&"all"!==t?e.filter(e=>e.typeBadge===t):e)(n,f,s);return e=((e,t)=>{if(!t.trim())return e;const o=t.toLowerCase();return e.filter(e=>{const t=e.name?.toLowerCase().includes(o),n=e.summary.map(e=>e.text).join("").toLowerCase();return t||n.includes(o)})})(e,m),e},[n,f,s,m]),C=i(()=>y.map(o=>{const n=o.typeBadge?((e,t)=>{const o=e.v2.colors;switch(t){case"Relevance":return{bg:o.blue[700],text:o.white[500]};case"Duration":return{bg:o.purple[700],text:o.white[500]};case"Error":return{bg:o.red[500],text:o.black[500]}}})(h,o.typeBadge):void 0;return{cells:[{key:"content",rawValue:o.summary.map(e=>e.text).join(""),component:()=>e(Lm,{$disabled:o.disabled,children:[t(Fm,{children:t(w,{parts:o.summary})}),o.name&&t(de,{size:pe.XXS,color:ue.Secondary,nowrap:!0,children:o.name})]})},{key:"badges",rawValue:o.typeBadge||"",component:()=>e(Mm,{children:[o.disabled&&t(Ye,{label:Eo,textSize:pe.XXXS,backgroundColor:h.v2.colors.grey[700],textColor:h.v2.colors.grey[300]}),o.typeBadge&&n&&t(Ye,{label:o.typeBadge,textSize:pe.XXXS,backgroundColor:n.bg,textColor:n.text})]})}],onClick:()=>c(o)}}),[y,h,c]),S=i(()=>{const e=e=>t($a,{...e,fill:h.v2.colors.red[500]});return e.displayName="RedDeleteIcon",e},[h]),x=l(e=>{const t=C.indexOf(e);if(t<0)return[];const o=y[t];return o?[{id:"edit","data-id":"sampling-rule-action-edit",label:Do,leftIcon:Ia,onClick:()=>u(o.ruleId,o.samplingId)},{id:"delete","data-id":"sampling-rule-action-delete",label:"",leftIcon:S,onClick:()=>p(o.ruleId,o.samplingId)}]:[]},[C,y,u,p,S]);return t(ct,{fullHeight:!0,richTitle:{icon:ll,title:o,badge:{label:n.length,backgroundColor:h.v2.colors.silver[600],textColor:h.v2.colors.white[500]}},search:{"data-id":"sampling-search-rules",value:m,onChange:g,placeholder:"Search..",width:"500px",...s?{segment:{"data-id":"sampling-segment-type-filter",options:zm,selected:f,setSelected:v}}:{}},children:t(To,{variant:$o.Pretty,hideHeader:!0,isLoading:a,noDataProps:m.trim()?{hideIcon:!0,title:aa,subTitle:sa(m)}:{hideIcon:!0,title:ra,button:{label:la,onClick:d}},columns:_m,rows:C,getRowActions:x})})},Xm=({docsUrl:o})=>{const{samplingApi:s,sourcesApi:c}=kl(),{items:d}=c.useSources(),u=i(()=>d.map(e=>({id:e.id})),[d]),{items:p,loading:h,k8sHealthProbesConfig:m,refetch:g}=s.useSamplingRules(),f=l((e,t)=>s.createNoisy?.({samplingId:e,rule:t}),[s]),b=l((e,t,o)=>s.updateNoisy?.(t,{samplingId:e,rule:o}),[s]),v=l((e,t)=>s.createHighlyRelevant?.({samplingId:e,rule:t}),[s]),y=l((e,t,o)=>s.updateHighlyRelevant?.(t,{samplingId:e,rule:o}),[s]),C=l((e,t)=>s.createCostReduction?.({samplingId:e,rule:t}),[s]),S=l((e,t,o)=>s.updateCostReduction?.(t,{samplingId:e,rule:o}),[s]),w=l((e,t,o)=>"noisy"===o?s.deleteNoisy?.(t,e):"highlyRelevant"===o?s.deleteHighlyRelevant?.(t,e):"costReduction"===o?s.deleteCostReduction?.(t,e):void 0,[s]),x=l((e,t)=>s.updateK8sHealthProbesConfig?.({enabled:e,keepPercentage:t}),[s]),k=i(()=>u.map(({id:e})=>({id:`${e.namespace}/${e.kind}/${e.name}`,label:e.name,badge:e.kind,secondaryLabel:e.namespace})),[u]),T=i(()=>Array.from(new Set(u.map(({id:e})=>e.namespace))).sort().map(e=>({id:e,label:e})),[u]),[$,I]=r(P.Noisy),[E,N]=r(null),[R,D]=r(!1),[Z,ee]=r(!1),[te,oe]=r(null),[ne,ie]=r(!1),[ae,le]=r(!1),[re,se]=r(!1),[ce,de]=r(!1);a(!1),n(()=>{},[h,p]);const{pendingViewSamplingRule:ue,setPendingViewSamplingRule:pe}=ro();n(()=>{if(!ue)return;if(h||0===p.length)return;pe(null);const e=F(p,ue.ruleId,ue.category);e&&(I(L[ue.category]),D(!1),N(e))},[h,p,ue,pe]);const ve=i(()=>A(m),[m]),ye=i(()=>M(p),[p]),Ce=i(()=>O(ye?.rule??null),[ye]),Se=i(()=>_(p),[p]),we=i(()=>z(Se?.rule??null),[Se]),xe=a(E);xe.current=E,n(()=>{const e=xe.current;if(!e)return;const t=B(p,e);t?N(t):(N(null),D(!1))},[p]);const ke=i(()=>{const e=new Set;return ye&&e.add(ye.rule.ruleId),Se&&e.add(Se.rule.ruleId),e},[ye,Se]),Te=i(()=>X(p,$,ke),[p,$,ke]),$e=l(()=>ee(!0),[]),Ie=l(()=>ee(!1),[]);l(()=>de(!1),[]);const Ee=l(async e=>{const t=p[0]?.id??"default";switch(W[$]){case"noisy":await f(t,G(e));break;case"highlyRelevant":await v(t,U(e));break;case"costReduction":await C(t,V(e))}ee(!1)},[p,$,f,v,C]),Ne=l(e=>{const t=H(p,e);t&&(D(!1),N(t))},[p]),Ae=l(()=>{N(null),D(!1)},[]),Oe=l((e,t)=>{const o=E;if(o&&o.rule.ruleId===e&&o.samplingId===t)D(!0),N({...o});else for(const o of p){if(o.id!==t)continue;const n=[...o.noisyOperations.map(e=>({category:"noisy",rule:e})),...o.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...o.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(n)return D(!0),void N({category:n.category,rule:n.rule,samplingId:t,summary:j(n.category,n.rule)})}},[E,p]),Re=l(async(e,t,o)=>{const n=E?.category;if(n){switch(n){case"noisy":await b(o,t,G(e));break;case"highlyRelevant":await y(o,t,U(e));break;case"costReduction":await S(o,t,V(e))}D(!1)}},[E,b,y,S]),Pe=l((e,t)=>{oe({ruleId:e,samplingId:t})},[]),Me=l(async()=>{if(!te)return;const{ruleId:e,samplingId:t}=te,o=E?.category||W[$];await w(t,e,o),N(null),D(!1),oe(null)},[te,E,$,w]),_e=l(()=>oe(null),[]),ze=l(async(e,t)=>{await x(e,t),ie(!1)},[x]),Be=l(async e=>{const t=p[0]?.id??"default",o=ye;o?await y(o.samplingId,o.rule.ruleId,{name:o.rule.name,disabled:!e,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null,notes:o.rule.notes}):e&&await v(t,{name:"Auto - Keep All Error Traces",disabled:!1,error:!0,sourceScopes:null,operation:null,percentageAtLeast:null}),le(!1)},[p,ye,v,y]),Xe=l(async(e,t)=>{const o=p[0]?.id??"default",n=Se;n?await S(n.samplingId,n.rule.ruleId,{name:n.rule.name,disabled:!e,sourceScopes:null,operation:null,percentageAtMost:t,notes:n.rule.notes}):e&&await C(o,{name:"Auto - Drop Traces Cluster-Wide",disabled:!1,sourceScopes:null,operation:null,percentageAtMost:t}),se(!1)},[p,Se,C,S]),Ve=l(e=>{const t=W[$];let o=null;switch(t){case"noisy":{const n=G(e);o=K(p,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}case"highlyRelevant":{const n=U(e);o=K(p,t,{sourceScopes:n.sourceScopes,operation:n.operation,error:n.error??!1,durationAtLeastMs:n.durationAtLeastMs});break}case"costReduction":{const n=V(e);o=K(p,t,{sourceScopes:n.sourceScopes,operation:n.operation});break}}return o?{message:ca,ruleId:o}:null},[p,$]),Ue=l(e=>{const t=E?.category,o=E?.rule.ruleId;if(!t)return null;let n=null;switch(t){case"noisy":{const i=G(e);n=K(p,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}case"highlyRelevant":{const i=U(e);n=K(p,t,{sourceScopes:i.sourceScopes,operation:i.operation,error:i.error??!1,durationAtLeastMs:i.durationAtLeastMs},o);break}case"costReduction":{const i=V(e);n=K(p,t,{sourceScopes:i.sourceScopes,operation:i.operation},o);break}}return n?{message:ca,ruleId:n}:null},[p,E]),Ge=l(e=>{ee(!1);for(const t of p){const o=[...t.noisyOperations.map(e=>({category:"noisy",rule:e})),...t.highlyRelevantOperations.map(e=>({category:"highlyRelevant",rule:e})),...t.costReductionRules.map(e=>({category:"costReduction",rule:e}))].find(t=>t.rule.ruleId===e);if(o)return D(!0),void N({category:o.category,rule:o.rule,samplingId:t.id,summary:j(o.category,o.rule)})}},[p]),He=i(()=>{const e=[];return o&&e.push({id:on(),type:io.Button,buttonProps:{"data-id":"sampling-btn-docs",label:da,leftIcon:Ta,size:ge.S,variant:fe.Text,onClick:()=>window.open(o,"_blank")}}),e.push({id:on(),type:io.Button,buttonProps:{"data-id":"sampling-btn-refresh",label:ua,leftIcon:Ga,size:ge.S,variant:fe.Text,onClick:g,loading:h}}),e.push({id:on(),type:io.Button,buttonProps:{"data-id":"sampling-btn-create-rule",label:pa,rightIcon:Sa,size:ge.S,variant:fe.Primary,onClick:$e}}),e},[o,g,h,$e]);return e(Ei,{children:[e(he,{$gap:12,$justifyContent:"space-between",children:[t(qi,{icon:ll,title:ma,subTitle:ha}),t(Ji,{actions:He})]}),e(Q,{$gap:12,$fullHeight:!0,children:[t(be,{variant:xo.Underline,size:De.L,options:Y,selected:$,setSelected:I}),e(he,{$justifyContent:"space-between",children:[t(Fe,{status:Le.Default,message:q[$]}),o&&t(me,{"data-id":"sampling-btn-docs-banner",label:"Docs",leftIcon:Ta,size:ge.S,variant:fe.Text,onClick:()=>window.open(o,"_blank")})]}),$===P.Noisy?t(Kl,{title:lt,summary:ve,onEdit:()=>ie(!0)}):$===P.HighlyRelevant?t(Kl,{title:tt,summary:Ce,onEdit:()=>le(!0)}):$===P.CostReduction?t(Kl,{title:it,summary:we,onEdit:()=>se(!0)}):null,t(Bm,{title:J[$],items:Te,isLoading:h,showTypeFilter:$===P.HighlyRelevant,onRuleClick:Ne,onCreateRule:$e,onEditRule:Oe,onDeleteRule:Pe})]}),t(Hu,{formType:Al.View,data:E,defaultEditMode:R,onClose:Ae,onDelete:Pe,onSaveEdit:Re,sourceOptions:k,namespaceOptions:T,validateForm:Ue,onNavigateToDuplicate:Ge}),t(Hu,{formType:Al.Create,isOpen:Z,category:W[$],onClose:Ie,onSubmit:Ee,sourceOptions:k,namespaceOptions:T,validateForm:Ve,onNavigateToDuplicate:Ge}),t(Hu,{formType:Al.EditAutoNoisy,isOpen:ne,enabled:m?.enabled??!1,keepPercentage:m?.keepPercentage??0,onClose:()=>ie(!1),onSave:ze}),t(Hu,{formType:Al.EditAutoHighlyRelevant,isOpen:ae,enabled:!!ye&&!ye.rule.disabled,onClose:()=>le(!1),onSave:Be}),t(Hu,{formType:Al.EditAutoCostReduction,isOpen:re,enabled:!!Se&&!Se.rule.disabled,dropPercentage:Se?.rule.percentageAtMost??25,onClose:()=>se(!1),onSave:Xe}),t(Ze,{title:va,description:ba,isOpen:!!te,onClose:_e,denyButton:{label:fa,variant:fe.Secondary,onClick:_e},approveButton:{label:ga,variant:fe.Primary,onClick:()=>{Me(),_e()}}}),!1]})},Vm=f.div`
2
950
  padding: 12px;
3
951
  border-radius: 12px;
4
952
  background-color: ${({theme:e})=>e.v2.colors.silver[750]};
5
- `,ae=n(({id:t,data:i})=>e(ne,{"data-id":t,children:e(C,{...i})}));ae.displayName=ae.name;var se,de;!function(e){e.MapItem="map-item",e.NoData="no-data"}(se||(se={})),function(e){e.AnimatedTraffic="animated-traffic"}(de||(de={}));const le=(e,t,i)=>{if(i)return{icons:[Z],aggService:e,selected:!0};const o=e.isVirtual,r=o?[E(e)]:t?z(t):[Q],{priorotizedStatus:n}=o?{priorotizedStatus:void 0}:X(t?.conditions||[]);return{icons:r,status:n,isVirtual:o,aggService:e,selected:!0}},ce=e=>!(!e||e.serviceName!==h||e.id.namespace||e.id.name||e.id.kind),pe=new oe,ue={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},he=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},ge={id:{namespace:"",name:"",kind:""},serviceName:h,markedForInstrumentation:{markedForInstrumentation:!0}},me=c(null),fe=()=>{const e=p(me);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},ve=({serviceMap:t,children:i})=>{const o=r(),{sourcesApi:n}=re(),{items:c}=n.useSources(),[p,u,v]=m([]),[y,b,x]=f([]),[N,S]=a(0),I=s(()=>S(e=>e+1),[]),[w,$]=a(""),[k,M]=a(null),[C,E]=a(null),z=s(e=>E(t=>t===e?null:e),[]),X=s(()=>E(null),[]),K=s((e,t)=>{const i=new Set(e);u(e=>e.map(e=>e.type===se.MapItem&&i.has(e.id)?{...e,data:{...e.data,selected:t}}:e))},[u]);d(()=>{let e=!1;const i=(e=>{const t=new Map,i=new Set,o=(e,i,o=!1)=>{let r=t.get(e);return r||(r={serviceName:i,isVirtual:o,attributes:{},connectionMap:new Map},t.set(e,r)),r},r=(e,t)=>{if(t)for(const{key:i,value:o}of t)i in e||(e[i]=o)};for(const t of e){const{graphKey:e}=he(t.nodeId),n=o(e,t.serviceName);n.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:a}=he(e?.nodeId??"");e.isVirtual&&(i.add(t),r(o(t,e.serviceName,!0).attributes,e.nodeAttributes));let s=n.connectionMap.get(t);if(s||(s={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},n.connectionMap.set(t,s)),s.totalRequests+=e.requests,e.dateTime>s.lastDateTime&&(s.lastDateTime=e.dateTime),a){const t=s.details.find(e=>e.value===a);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):s.details.push({value:a,requests:e.requests,dateTime:e.dateTime})}}}const n=[...t.entries()];for(const[,{connectionMap:e}]of n)for(const[r,n]of e)t.has(r)||o(r,n.targetServiceName,i.has(r));const a=[];for(const[e,{serviceName:i,isVirtual:o,attributes:r,connectionMap:n}]of t){const t=[...n.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),a.push({graphKey:e,serviceName:i,isVirtual:o,connections:t,attributes:r})}return a.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),a})(t),r=(({sources:e,aggregatedServiceMap:t})=>{const i=[],o={x:0,y:0};if(t.length&&e.length)for(const r of t){const t=e.find(e=>r.serviceName===e.serviceName||r.serviceName===e.id.name),n=ce(t);i.push({id:r.graphKey,type:se.MapItem,position:o,data:le(r,t,n),measured:{width:80,height:80}})}else i.push({id:se.NoData,type:se.NoData,position:o,data:{subTitle:A.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return i})({aggregatedServiceMap:i,sources:[ge].concat(c)});if(1===r.length&&r[0].id===se.NoData)return u(r),b([]),$(""),void I();const n=(({theme:e,nodes:t,aggregatedServiceMap:i})=>{const o=[],r=new Map(t.map(e=>[e.id,e]));for(const t of i){const i=t.graphKey,n=r.get(i);if(!n)continue;const a=n.data?.status===T.Error;for(const n of t.connections){const s=n.targetGraphKey;r.has(s)&&o.push({id:`${i}-to-${s}`,type:"smoothstep",source:i,target:s,data:{sourceGraphKey:t.graphKey,targetGraphKey:n.targetGraphKey},markerEnd:{type:g.ArrowClosed},style:{stroke:a?e?.colors.dark_red:e?.colors.border}})}}return o})({theme:o,nodes:r,aggregatedServiceMap:i});b(n);const a=r.map(e=>e.id).sort().join("|");if(a!==w)return(async(e,t,i={})=>{const o={id:"root",layoutOptions:{...ue,...i},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===h?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},r=await pe.layout(o),n=new Map;return r.children?.forEach(e=>{n.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:n.get(e.id)??e.position})),edges:t}})(r,n).then(({nodes:t})=>{e||(u(t),$(a),I())}),()=>{e=!0};u(e=>{const t=new Map(e.map(e=>[e.id,e]));return r.map(e=>{const i=t.get(e.id);return i?e.type===se.MapItem&&i.type===se.MapItem?{...e,position:i.position,data:{...e.data,selected:i.data.selected}}:{...e,position:i.position}:e})})},[o,t,c,w]);const R=l(()=>k||C?y.map(e=>{if(e.source===k||e.target===k||e.source===C||e.target===C)return{...e,type:de.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):y,[y,k,C]),V=l(()=>({nodes:p,edges:R,onNodesChange:v,onEdgesChange:x,setNodesSelected:K,fitViewTrigger:N,hoveredNodeId:k,setHoveredNodeId:M,activeNodeId:C,toggleActiveNode:z,resetActiveNode:X}),[p,R,v,x,K,N,k,C,z,X]);return e(me.Provider,{value:V,children:i})},ye=o.div`
6
- border: 1px ${({theme:e,$isSelected:t,$isVirtual:i})=>t?`solid ${e.v2.colors.blue[300]}`:i?`dashed ${e.v2.colors.silver[300]}`:"solid transparent"};
953
+ `,Um=g(({id:e,data:o})=>t(Vm,{"data-id":e,children:t(Oe,{...o})}));var Gm,Hm;Um.displayName=Um.name,(e=>{e.MapItem="map-item",e.NoData="no-data"})(Gm||(Gm={})),(e=>{e.AnimatedTraffic="animated-traffic"})(Hm||(Hm={}));const jm=(e,t,o)=>{if(o)return{icons:[Ya],aggService:e,selected:!0};const n=e.isVirtual,i=n?[co(e)]:t?uo(t):[Cl],{priorotizedStatus:a}=n?{priorotizedStatus:void 0}:Bi(t?.conditions||[]);return{icons:i,status:a,isVirtual:n,aggService:e,selected:!0}},Wm=e=>!(!e||e.serviceName!==qc||e.id.namespace||e.id.name||e.id.kind),Km=new Tr,Ym={"elk.algorithm":"layered","elk.direction":"RIGHT","elk.layered.spacing.nodeNodeBetweenLayers":"150","elk.spacing.nodeNode":"120","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.layered.spacing.edgeEdgeBetweenLayers":"30","elk.layered.spacing.edgeNodeBetweenLayers":"40"},qm=e=>{const t=e.lastIndexOf("|");return-1===t?{graphKey:e,detail:""}:{graphKey:e.substring(0,t),detail:e.substring(t+1)}},Jm={id:{namespace:"",name:"",kind:""},serviceName:qc,markedForInstrumentation:{markedForInstrumentation:!0}},Zm=p(null),Qm=()=>{const e=h(Zm);if(!e)throw new Error("useServiceMapContext must be used within a ServiceMapProvider");return e},eg=({serviceMap:e,children:o})=>{const a=b(),{sourcesApi:s}=kl(),{items:c}=s.useSources(),[d,u,p]=pr([]),[h,m,g]=hr([]),[f,v]=r(0),y=l(()=>v(e=>e+1),[]),[C,S]=r(""),[w,x]=r(null),[k,T]=r(null),$=l(e=>T(t=>t===e?null:e),[]),I=l(()=>T(null),[]),E=l((e,t)=>{const o=new Set(e);u(e=>e.map(e=>e.type===Gm.MapItem&&o.has(e.id)?{...e,data:{...e.data,selected:t}}:e))},[u]);n(()=>{let t=!1;const o=(e=>{const t=new Map,o=new Set,n=(e,o,n=!1)=>{let i=t.get(e);return i||(i={serviceName:o,isVirtual:n,attributes:{},connectionMap:new Map},t.set(e,i)),i},i=(e,t)=>{if(t)for(const{key:o,value:n}of t)o in e||(e[o]=n)};for(const t of e){const{graphKey:e}=qm(t.nodeId),a=n(e,t.serviceName);a.isVirtual=!1;for(const e of t.services){const{graphKey:t,detail:l}=qm(e?.nodeId??"");e.isVirtual&&(o.add(t),i(n(t,e.serviceName,!0).attributes,e.nodeAttributes));let r=a.connectionMap.get(t);if(r||(r={targetGraphKey:t,targetServiceName:e.serviceName,totalRequests:0,lastDateTime:e.dateTime,details:[]},a.connectionMap.set(t,r)),r.totalRequests+=e.requests,e.dateTime>r.lastDateTime&&(r.lastDateTime=e.dateTime),l){const t=r.details.find(e=>e.value===l);t?(t.requests+=e.requests,e.dateTime>t.dateTime&&(t.dateTime=e.dateTime)):r.details.push({value:l,requests:e.requests,dateTime:e.dateTime})}}}const a=[...t.entries()];for(const[,{connectionMap:e}]of a)for(const[i,a]of e)t.has(i)||n(i,a.targetServiceName,o.has(i));const l=[];for(const[e,{serviceName:o,isVirtual:n,attributes:i,connectionMap:a}]of t){const t=[...a.values()];t.sort((e,t)=>e.targetGraphKey.localeCompare(t.targetGraphKey)),l.push({graphKey:e,serviceName:o,isVirtual:n,connections:t,attributes:i})}return l.sort((e,t)=>e.graphKey.localeCompare(t.graphKey)),l})(e),n=(({sources:e,aggregatedServiceMap:t})=>{const o=[],n={x:0,y:0};if(t.length&&e.length)for(const i of t){const t=e.find(e=>i.serviceName===e.serviceName||i.serviceName===e.id.name),a=Wm(t);o.push({id:i.graphKey,type:Gm.MapItem,position:n,data:jm(i,t,a),measured:{width:80,height:80}})}else o.push({id:Gm.NoData,type:Gm.NoData,position:n,data:{subTitle:Qe.ARE_SERVICES_INSTRUMENTED_AND_PRODUCING_TRAFFIC}});return o})({aggregatedServiceMap:o,sources:[Jm].concat(c)});if(1===n.length&&n[0].id===Gm.NoData)return u(n),m([]),S(""),void y();const i=(({theme:e,nodes:t,aggregatedServiceMap:o})=>{const n=[],i=new Map(t.map(e=>[e.id,e]));for(const t of o){const o=t.graphKey,a=i.get(o);if(!a)continue;const l=a.data?.status===Le.Error;for(const a of t.connections){const r=a.targetGraphKey;i.has(r)&&n.push({id:`${o}-to-${r}`,type:"smoothstep",source:o,target:r,data:{sourceGraphKey:t.graphKey,targetGraphKey:a.targetGraphKey},markerEnd:{type:ur.ArrowClosed},style:{stroke:l?e?.colors.dark_red:e?.colors.border}})}}return n})({theme:a,nodes:n,aggregatedServiceMap:o});m(i);const l=n.map(e=>e.id).sort().join("|");if(l!==C)return(async(e,t,o={})=>{const n={id:"root",layoutOptions:{...Ym,...o},children:e.map(e=>({id:e.id,width:80,height:80,...e.id===qc?{layoutOptions:{"elk.layered.layering.layerConstraint":"FIRST","elk.alignment":"CENTER"}}:{}})),edges:t.map(e=>({id:e.id,sources:[e.source],targets:[e.target]}))},i=await Km.layout(n),a=new Map;return i.children?.forEach(e=>{a.set(e.id,{x:e.x??0,y:e.y??0})}),{nodes:e.map(e=>({...e,position:a.get(e.id)??e.position})),edges:t}})(n,i).then(({nodes:e})=>{t||(u(e),S(l),y())}),()=>{t=!0};u(e=>{const t=new Map(e.map(e=>[e.id,e]));return n.map(e=>{const o=t.get(e.id);return o?e.type===Gm.MapItem&&o.type===Gm.MapItem?{...e,position:o.position,data:{...e.data,selected:o.data.selected}}:{...e,position:o.position}:e})})},[a,e,c,C]);const N=i(()=>w||k?h.map(e=>{if(e.source===w||e.target===w||e.source===k||e.target===k)return{...e,type:Hm.AnimatedTraffic};const t={opacity:.3};return{...e,style:{...e.style,...t},labelStyle:{...e.labelStyle,...t},labelBgStyle:{...e.labelBgStyle,...t}}}):h,[h,w,k]),A=i(()=>({nodes:d,edges:N,onNodesChange:p,onEdgesChange:g,setNodesSelected:E,fitViewTrigger:f,hoveredNodeId:w,setHoveredNodeId:x,activeNodeId:k,toggleActiveNode:$,resetActiveNode:I}),[d,N,p,g,E,f,w,k,$,I]);return t(Zm.Provider,{value:A,children:o})},tg=f.div`
954
+ border: 1px ${({theme:e,$isSelected:t,$isVirtual:o})=>t?`solid ${e.v2.colors.blue[300]}`:o?`dashed ${e.v2.colors.silver[300]}`:"solid transparent"};
7
955
  border-radius: 8px;
8
956
  cursor: pointer;
9
957
  opacity: ${({$isVirtual:e})=>e?.8:1};
10
- `,be=o.div`
958
+ `,og=f.div`
11
959
  position: relative;
12
- `,xe=o.div`
960
+ `,ng=f.div`
13
961
  position: absolute;
14
962
  top: 100%;
15
963
  left: 50%;
@@ -18,7 +966,7 @@ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import o,{useThe
18
966
  align-items: center;
19
967
  gap: 4px;
20
968
  margin-top: 4px;
21
- `,Ne=n(({id:o,data:n})=>{const{icons:a,status:s,isVirtual:d}=n,c=r(),{activeNodeId:p,hoveredNodeId:u}=fe(),{isUserSource:g,isNodeSelected:m,isHovered:f}=l(()=>({isUserSource:o===h,isNodeSelected:p===o,isHovered:u===o}),[o,p,u,o]),{isSelected:b,isHighlighted:x}=l(()=>({isSelected:m||g,isHighlighted:m||f||g}),[m,f,g]),N=s?O(s,c):null;return t(i,{children:[e(v,{type:"source",position:y.Right,style:{visibility:"hidden"}}),e(v,{type:"target",position:y.Left,style:{visibility:"hidden"}}),t(be,{"data-id":o,children:[e(ye,{$isSelected:b,$isVirtual:d,children:e(K,{padding:12,icons:a,status:x?T.Info:s})}),t(xe,{children:[N&&e(N,{}),e(R,{size:V.XXS,nowrap:!0,children:o})]})]})]})});Ne.displayName=Ne.name;const Se=o.div`
969
+ `,ig=g(({id:n,data:a})=>{const{icons:l,status:r,isVirtual:s}=a,c=b(),{activeNodeId:d,hoveredNodeId:u}=Qm(),{isUserSource:p,isNodeSelected:h,isHovered:m}=i(()=>({isUserSource:n===qc,isNodeSelected:d===n,isHovered:u===n}),[n,d,u,n]),{isSelected:g,isHighlighted:f}=i(()=>({isSelected:h||p,isHighlighted:h||m||p}),[h,m,p]),v=r?_i(r,c):null;return e(o,{children:[t(mr,{type:"source",position:gr.Right,style:{visibility:"hidden"}}),t(mr,{type:"target",position:gr.Left,style:{visibility:"hidden"}}),e(og,{"data-id":n,children:[t(tg,{$isSelected:g,$isVirtual:s,children:t(po,{padding:12,icons:l,status:f?Le.Info:r})}),e(ng,{children:[v&&t(v,{}),t(de,{size:pe.XXS,nowrap:!0,children:n})]})]})]})});ig.displayName=ig.name;const ag=f.div`
22
970
  display: flex;
23
971
  flex-direction: column;
24
972
  gap: 12px;
@@ -31,10 +979,10 @@ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import o,{useThe
31
979
  top: 16px;
32
980
  left: 8px;
33
981
  z-index: ${({theme:e})=>e.v2.zIndex.drawer};
34
- `,Ie=({children:t})=>e(Se,{children:t});var we,$e;!function(e){e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"}(we||(we={})),function(e){e.Inbound="Inbound",e.Outbound="Outbound"}($e||($e={}));const ke=o.div`
982
+ `,lg=({children:e})=>t(ag,{children:e});var rg,sg;(e=>{e.All="All",e.Inbound="Inbound",e.Outbound="Outbound"})(rg||(rg={})),(e=>{e.Inbound="Inbound",e.Outbound="Outbound"})(sg||(sg={}));const cg=f.div`
35
983
  flex: 1 1 auto;
36
984
  min-height: 0;
37
- `,Me=()=>{const{nodes:i,activeNodeId:o,resetActiveNode:r}=fe(),[n,s]=a(we.All),d=l(()=>{const e=new Map;for(const t of i)t.type===se.MapItem&&e.set(t.id,t);return e},[i]),c=l(()=>d.get(o??""),[d,o]),{inbound:p,outbound:u}=l(()=>{const e=[],t=[];if(!c)return{inbound:e,outbound:t};for(const e of c.data.aggService?.connections??[])t.push({peerId:e.targetGraphKey,direction:$e.Outbound,totalRequests:e.totalRequests});for(const t of d.values())if(t.id!==c.id)for(const i of t.data.aggService?.connections??[])i.targetGraphKey===c.id&&e.push({peerId:t.id,direction:$e.Inbound,totalRequests:i.totalRequests});return e.sort((e,t)=>e.peerId.localeCompare(t.peerId)),t.sort((e,t)=>e.peerId.localeCompare(t.peerId)),{inbound:e,outbound:t}},[c,d]);if(!c)return null;const h=[we.All,we.Inbound].includes(n)&&p.length>0,g=[we.All,we.Outbound].includes(n)&&u.length>0;return t(Ie,{children:[t(_,{$width:"100%",$gap:8,children:[e(q,{variant:j.Text,size:L.S,leftIcon:J,onClick:r}),e(K,{icons:c.data.icons}),e(R,{size:V.XS,children:c.id})]}),e(H,{fullWidth:!0,options:[{label:`${we.All}`,value:we.All,badge:{label:`${p.length+u.length}`}},{label:`${we.Inbound}`,value:we.Inbound,badge:{label:`${p.length}`}},{label:`${we.Outbound}`,value:we.Outbound,badge:{label:`${u.length}`}}],selected:n,setSelected:s}),h&&e(Te,{halfHeight:g,title:"Inbound",icon:ee,connections:p,mapNodesById:d}),g&&e(Te,{halfHeight:h,title:"Outbound",icon:te,connections:u,mapNodesById:d})]})},Ce=o.div`
985
+ `,dg=()=>{const{nodes:o,activeNodeId:n,resetActiveNode:a}=Qm(),[l,s]=r(rg.All),c=i(()=>{const e=new Map;for(const t of o)t.type===Gm.MapItem&&e.set(t.id,t);return e},[o]),d=i(()=>c.get(n??""),[c,n]),{inbound:u,outbound:p}=i(()=>{const e=[],t=[];if(!d)return{inbound:e,outbound:t};for(const e of d.data.aggService?.connections??[])t.push({peerId:e.targetGraphKey,direction:sg.Outbound,totalRequests:e.totalRequests});for(const t of c.values())if(t.id!==d.id)for(const o of t.data.aggService?.connections??[])o.targetGraphKey===d.id&&e.push({peerId:t.id,direction:sg.Inbound,totalRequests:o.totalRequests});return e.sort((e,t)=>e.peerId.localeCompare(t.peerId)),t.sort((e,t)=>e.peerId.localeCompare(t.peerId)),{inbound:e,outbound:t}},[d,c]);if(!d)return null;const h=[rg.All,rg.Inbound].includes(l)&&u.length>0,m=[rg.All,rg.Outbound].includes(l)&&p.length>0;return e(lg,{children:[e(he,{$width:"100%",$gap:8,children:[t(me,{variant:fe.Text,size:ge.S,leftIcon:Sl,onClick:a}),t(po,{icons:d.data.icons}),t(de,{size:pe.XS,children:d.id})]}),t(be,{fullWidth:!0,options:[{label:`${rg.All}`,value:rg.All,badge:{label:`${u.length+p.length}`}},{label:`${rg.Inbound}`,value:rg.Inbound,badge:{label:`${u.length}`}},{label:`${rg.Outbound}`,value:rg.Outbound,badge:{label:`${p.length}`}}],selected:l,setSelected:s}),h&&t(pg,{halfHeight:m,title:"Inbound",icon:Wa,connections:u,mapNodesById:c}),m&&t(pg,{halfHeight:h,title:"Outbound",icon:Ka,connections:p,mapNodesById:c})]})},ug=f.div`
38
986
  display: flex;
39
987
  flex-direction: column;
40
988
  gap: 8px;
@@ -42,17 +990,17 @@ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import o,{useThe
42
990
  border-radius: 12px;
43
991
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
44
992
  height: ${({$halfHeight:e})=>e?"48%":"100%"};
45
- `,Te=({halfHeight:i,title:o,icon:n,connections:a,mapNodesById:s})=>{const d=r();return t(Ce,{$halfHeight:i,children:[t(_,{children:[e(n,{size:16,fill:d.v2.colors.grey[300]}),e(R,{size:V.XXS,color:D.Secondary,children:o})]}),e(ke,{children:e(G,{gap:4,elements:a.map(t=>e(Ee,{connection:t,peerNode:s.get(t.peerId)},`${t.direction}-${t.peerId}`))})})]})},Ae=o.div`
993
+ `,pg=({halfHeight:o,title:n,icon:i,connections:a,mapNodesById:l})=>{const r=b();return e(ug,{$halfHeight:o,children:[e(he,{children:[t(i,{size:16,fill:r.v2.colors.grey[300]}),t(de,{size:pe.XXS,color:ue.Secondary,children:n})]}),t(cg,{children:t(lo,{gap:4,elements:a.map(e=>t(mg,{connection:e,peerNode:l.get(e.peerId)},`${e.direction}-${e.peerId}`))})})]})},hg=f.div`
46
994
  display: flex;
47
995
  align-items: center;
48
996
  gap: 8px;
49
997
  padding: 8px;
50
998
  border-radius: 8px;
51
999
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
52
- `,Ee=({connection:i,peerNode:o})=>t(Ae,{children:[o&&e(K,{icons:o.data.icons}),t(_,{$gap:4,$width:"100%",$justifyContent:"space-between",children:[e(R,{size:V.XXS,children:i.peerId}),e(P,{label:i.totalRequests,tooltip:"Total requests"})]})]}),ze="0;0.5;1",Xe=n(({id:o,sourceX:n,sourceY:a,targetX:s,targetY:d,sourcePosition:l,targetPosition:c,markerEnd:p})=>{const u=r(),[h]=b({sourceX:n,sourceY:a,targetX:s,targetY:d,sourcePosition:l,targetPosition:c}),g=`${o}__animated-traffic-motion`,m=u.v2.colors.blue[700],f=u.v2.colors.blue[900],v=u.v2.colors.blue[500],y="4s";return t(i,{children:[e(x,{id:o,path:h,markerEnd:p,style:{stroke:m,strokeWidth:1}}),e(N,{children:t("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[e("path",{id:g,d:h,fill:"none",stroke:"none"}),Array.from({length:5}).map((i,o)=>{const r=`-${(.8*o).toFixed(3)}s`;return t("circle",{r:0,fill:f,children:[e("animateMotion",{dur:y,begin:r,repeatCount:"indefinite",children:e("mpath",{href:`#${g}`})}),e("animate",{attributeName:"r",dur:y,begin:r,repeatCount:"indefinite",keyTimes:ze,values:"0;3.5;3.5"}),e("animate",{attributeName:"fill",dur:y,begin:r,repeatCount:"indefinite",keyTimes:ze,values:`${f};${v};${v}`})]},o)})]})})]})});Xe.displayName=Xe.name;const Ke=o.div`
1000
+ `,mg=({connection:o,peerNode:n})=>e(hg,{children:[n&&t(po,{icons:n.data.icons}),e(he,{$gap:4,$width:"100%",$justifyContent:"space-between",children:[t(de,{size:pe.XXS,children:o.peerId}),t(Ye,{label:o.totalRequests,tooltip:"Total requests"})]})]}),gg="0;0.5;1",fg=g(({id:n,sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c,markerEnd:d})=>{const u=b(),[p]=fr({sourceX:i,sourceY:a,targetX:l,targetY:r,sourcePosition:s,targetPosition:c}),h=`${n}__animated-traffic-motion`,m=u.v2.colors.blue[700],g=u.v2.colors.blue[900],f=u.v2.colors.blue[500],v="4s";return e(o,{children:[t(br,{id:n,path:p,markerEnd:d,style:{stroke:m,strokeWidth:1}}),t(vr,{children:e("svg",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[t("path",{id:h,d:p,fill:"none",stroke:"none"}),Array.from({length:5}).map((o,n)=>{const i=`-${(.8*n).toFixed(3)}s`;return e("circle",{r:0,fill:g,children:[t("animateMotion",{dur:v,begin:i,repeatCount:"indefinite",children:t("mpath",{href:`#${h}`})}),t("animate",{attributeName:"r",dur:v,begin:i,repeatCount:"indefinite",keyTimes:gg,values:"0;3.5;3.5"}),t("animate",{attributeName:"fill",dur:v,begin:i,repeatCount:"indefinite",keyTimes:gg,values:`${g};${f};${f}`})]},n)})]})})]})});fg.displayName=fg.name;const bg=f.div`
53
1001
  flex: 1 1 auto;
54
1002
  min-height: 0;
55
- `,Re=({})=>{const{nodes:i,setNodesSelected:o,resetActiveNode:r}=fe(),[n,d]=a(""),c=l(()=>i.filter(e=>e.type===se.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[i]),p=l(()=>c.filter(e=>e.data.selected),[c]),u=l(()=>c.filter(e=>e.id.toLowerCase().includes(n.toLowerCase())),[c,n]),h=l(()=>u.every(e=>e.data.selected),[u]),g=s(()=>{const e=!h;o(u.map(e=>e.id),e),e||r()},[u,h,o,r]);return c.length?t(Ie,{children:[t(_,{$width:"100%",$gap:8,children:[e(R,{size:V.XS,children:"Services"}),e(P,{label:c.length})]}),e(B,{width:"100%",value:n,onChange:d}),t(_,{$width:"100%",$justifyContent:"space-between",children:[e(R,{size:V.XXXS,children:`Showing ${p.length} out of ${c.length}`}),e(R,{"data-id":"namespaces-select-all",onClick:g,disabled:!u.length,size:V.XS,children:h?A.UNSELECT_ALL:A.SELECT_ALL})]}),e(Ke,{children:e(G,{gap:4,elements:u.map(t=>e(Oe,{node:t},t.id))})})]}):null},Ve=o.div`
1003
+ `,vg=({})=>{const{nodes:o,setNodesSelected:n,resetActiveNode:a}=Qm(),[s,c]=r(""),d=i(()=>o.filter(e=>e.type===Gm.MapItem).sort((e,t)=>e.id.localeCompare(t.id)),[o]),u=i(()=>d.filter(e=>e.data.selected),[d]),p=i(()=>d.filter(e=>e.id.toLowerCase().includes(s.toLowerCase())),[d,s]),h=i(()=>p.every(e=>e.data.selected),[p]),m=l(()=>{const e=!h;n(p.map(e=>e.id),e),e||a()},[p,h,n,a]);return d.length?e(lg,{children:[e(he,{$width:"100%",$gap:8,children:[t(de,{size:pe.XS,children:"Services"}),t(Ye,{label:d.length})]}),t(ao,{width:"100%",value:s,onChange:c}),e(he,{$width:"100%",$justifyContent:"space-between",children:[t(de,{size:pe.XXXS,children:`Showing ${u.length} out of ${d.length}`}),t(de,{"data-id":"namespaces-select-all",onClick:m,disabled:!p.length,size:pe.XS,children:h?Qe.UNSELECT_ALL:Qe.SELECT_ALL})]}),t(bg,{children:t(lo,{gap:4,elements:p.map(e=>t(Cg,{node:e},e.id))})})]}):null},yg=f.div`
56
1004
  display: flex;
57
1005
  align-items: center;
58
1006
  gap: 8px;
@@ -60,7 +1008,7 @@ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import o,{useThe
60
1008
  border-radius: 8px;
61
1009
  background-color: ${({theme:e})=>e.v2.colors.silver[900]};
62
1010
  cursor: pointer;
63
- `,Oe=({node:i})=>{const{setNodesSelected:o,activeNodeId:r,resetActiveNode:n}=fe(),a=s(()=>{const e=!i.data.selected,t=r===i.id;o([i.id],e),!e&&t&&n()},[i,r,o,n]);return t(Ve,{onClick:a,children:[e(F,{value:i.data.selected||!1,onChange:a}),e(K,{icons:i.data.icons}),e(R,{size:V.XXS,children:i.id})]},i.id)},_e=o.div`
1011
+ `,Cg=({node:o})=>{const{setNodesSelected:n,activeNodeId:i,resetActiveNode:a}=Qm(),r=l(()=>{const e=!o.data.selected,t=i===o.id;n([o.id],e),!e&&t&&a()},[o,i,n,a]);return e(yg,{onClick:r,children:[t(te,{value:o.data.selected||!1,onChange:r}),t(po,{icons:o.data.icons}),t(de,{size:pe.XXS,children:o.id})]},o.id)},Sg=f.div`
64
1012
  position: relative;
65
1013
  height: 100%;
66
1014
  .react-flow__attribution {
@@ -69,7 +1017,7 @@ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import o,{useThe
69
1017
  * {
70
1018
  transition: none;
71
1019
  }
72
- `,qe=o.div`
1020
+ `,wg=f.div`
73
1021
  .react-flow__controls {
74
1022
  display: flex;
75
1023
  align-items: center;
@@ -95,14 +1043,61 @@ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import o,{useThe
95
1043
  }
96
1044
  }
97
1045
  }
98
- `,Le={[se.MapItem]:Ne,[se.NoData]:ae},je={[de.AnimatedTraffic]:Xe},He={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},De=({trigger:e})=>{const{fitView:t}=M(),i=u(!0);return d(()=>{i.current?i.current=!1:e>0&&requestAnimationFrame(()=>t(He))},[e,t]),null},Ge=({onRefresh:i})=>{const{nodes:o,edges:r,fitViewTrigger:n,onNodesChange:a,onEdgesChange:s,setHoveredNodeId:d,toggleActiveNode:c}=fe(),p=l(()=>{const e=new Set(o.filter(e=>e.type===se.MapItem&&e.data.selected).map(e=>e.id)),t=new Set;for(const i of r)e.has(i.source)&&t.add(i.target),e.has(i.target)&&t.add(i.source);return o.filter(e=>e.type!==se.MapItem||e.data.selected||t.has(e.id))},[o,r]);return t(I,{zoomOnScroll:!0,nodes:p,nodeTypes:Le,edges:r,edgeTypes:je,onNodeClick:(e,t)=>c(t.id),onNodeMouseEnter:(e,t)=>d(t.id),onNodeMouseLeave:()=>d(null),onNodesChange:a,onEdgesChange:s,children:[e(w,{}),e(De,{trigger:n}),e(qe,{children:e($,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:He,children:e(k,{onClick:i,children:e(ie,{})})})})]})},Pe=i=>e(S,{children:t(_e,{children:[e(Ge,{...i}),e(Re,{}),e(Me,{})]})}),Be=o.div`
1046
+ `,xg={[Gm.MapItem]:ig,[Gm.NoData]:Um},kg={[Hm.AnimatedTraffic]:fg},Tg={duration:300,padding:.1,includeHiddenNodes:!0,maxZoom:1},$g=({trigger:e})=>{const{fitView:t}=kr(),o=a(!0);return n(()=>{o.current?o.current=!1:e>0&&requestAnimationFrame(()=>t(Tg))},[e,t]),null},Ig=({onRefresh:o})=>{const{nodes:n,edges:a,fitViewTrigger:l,onNodesChange:r,onEdgesChange:s,setHoveredNodeId:c,toggleActiveNode:d}=Qm(),u=i(()=>{const e=new Set(n.filter(e=>e.type===Gm.MapItem&&e.data.selected).map(e=>e.id)),t=new Set;for(const o of a)e.has(o.source)&&t.add(o.target),e.has(o.target)&&t.add(o.source);return n.filter(e=>e.type!==Gm.MapItem||e.data.selected||t.has(e.id))},[n,a]);return e(Cr,{zoomOnScroll:!0,nodes:u,nodeTypes:xg,edges:a,edgeTypes:kg,onNodeClick:(e,t)=>d(t.id),onNodeMouseEnter:(e,t)=>c(t.id),onNodeMouseLeave:()=>c(null),onNodesChange:r,onEdgesChange:s,children:[t(Sr,{}),t($g,{trigger:l}),t(wg,{children:t(wr,{position:"top-right",orientation:"horizontal",showInteractive:!1,showZoom:!0,showFitView:!0,fitViewOptions:Tg,children:t(xr,{onClick:o,children:t(Ga,{})})})})]})},Eg=o=>t(yr,{children:e(Sg,{children:[t(Ig,{...o}),t(vg,{}),t(dg,{})]})}),Ng=f.div`
99
1047
  width: 100%;
100
1048
  flex: 1;
101
1049
  align-self: stretch;
102
1050
  min-height: 0;
103
1051
  height: 100%;
104
1052
  position: relative;
105
- `,Fe=()=>{const{serviceMapApi:t}=re(),{data:i,refetch:o}=t.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return e(ve,{serviceMap:i?.serviceMap??[],children:e(Be,{children:e(Pe,{onRefresh:o})})})},Ue=o.div`
1053
+ `,Ag=()=>{const{serviceMapApi:e}=kl(),{data:o,refetch:n}=e.useServiceMap({pollInterval:5e3,fetchPolicy:"cache-and-network"});return t(eg,{serviceMap:o?.serviceMap??[],children:t(Ng,{children:t(Eg,{onRefresh:n})})})},Og=f.div`
1054
+ display: flex;
1055
+ align-items: center;
1056
+ justify-content: space-between;
1057
+ padding: 0 12px;
1058
+ `,Rg=f.div`
1059
+ display: flex;
1060
+ align-items: center;
1061
+ gap: 8px;
1062
+ `,Dg=f.div`
1063
+ width: 1px;
1064
+ height: 20px;
1065
+ background-color: ${({theme:e})=>e.v2.colors.silver[500]};
1066
+ `,Pg=({disabled:o,loading:n,onClickShowYaml:a,onClickReset:l,onClickRefresh:s})=>{const c=b(),[d,u]=r(!1),p=i(()=>a?[{id:on(),type:io.Button,buttonProps:{label:"Show Config YAML",leftIcon:yl,size:ge.S,variant:fe.Secondary,onClick:a,disabled:o}}]:[],[a,o]),h=i(()=>{const e=[];return s&&e.push({id:on(),type:io.Button,buttonProps:{leftIcon:Ga,tooltip:"Refresh",hideTooltipIcon:!0,size:ge.S,variant:fe.Text,onClick:s,disabled:o,loading:n}}),l&&e.push({id:on(),type:io.Button,buttonProps:{leftIcon:Ca,tooltip:"Reset to defaults",hideTooltipIcon:!0,size:ge.S,variant:fe.Text,textColor:c.v2.colors.red[500],onClick:()=>u(!0),disabled:o}}),e},[o,n,l,s,c]),m=p.length>0,g=h.length>0;return e(Og,{children:[t(qi,{icon:Ba,title:"Odigos Settings"}),e(Rg,{children:[m&&t(Ji,{actions:p}),m&&g&&t(Dg,{}),g&&t(Ji,{actions:h})]}),t(Ze,{isOpen:d,onClose:()=>u(!1),title:"Reset Settings",description:"Are you sure you want to reset the settings? This will clear the odigos-local-ui-config and reset the settings to the default values.",denyButton:{label:"Deny",variant:fe.Secondary,onClick:()=>u(!1)},approveButton:{label:"Approve",variant:fe.Primary,onClick:()=>{l?.(),u(!1)}}})]})},Fg=f(Q)`
1067
+ width: 220px;
1068
+ flex-shrink: 0;
1069
+ height: 100%;
1070
+ gap: 4px;
1071
+ overflow-y: auto;
1072
+ `,Lg=({options:e,selected:o,setSelected:n,disabled:i})=>t(Fg,{children:e.map(e=>t(Ys,{dataId:`settings-nav-${e.id}`,title:e.label,isSelected:o===e.id,disabled:i,onClick:()=>n(e.id)},e.id))}),Mg=f(Q)`
1073
+ width: 100%;
1074
+ /* side menu (220) + gap (24) + form (600) = 844, so content fills exactly with no dead space */
1075
+ max-width: 844px;
1076
+ /* Bias the content toward the left on wide screens: ~30% of the free space sits on the left, 70% on the right. */
1077
+ margin-left: max(0px, calc((100% - 844px) * 0.3));
1078
+ margin-right: auto;
1079
+ gap: 24px;
1080
+ flex: 1;
1081
+ min-height: 0;
1082
+ `,_g=f(he)`
1083
+ flex: 1;
1084
+ min-height: 0;
1085
+ width: 100%;
1086
+ align-self: stretch;
1087
+ `,zg=f(Q)`
1088
+ flex: 1;
1089
+ min-height: 0;
1090
+ height: 100%;
1091
+ max-width: 600px;
1092
+ overflow-y: auto;
1093
+ `,Bg=f(he)`
1094
+ gap: 8px;
1095
+ width: 100%;
1096
+ align-items: center;
1097
+ `,Xg=f.div`
1098
+ flex: 1;
1099
+ min-width: 0;
1100
+ `,Vg=e=>"general"===e.name?0:"advanced"===e.name?2:1,Ug=({minSupportedVersion:a})=>{const{isVersionSupported:l,version:s,isEnterprise:c,minSupportedVersion:d}=C(a),{configApi:u}=kl(),{data:p,loading:h}=u.useConfigYamls(),{data:m,loading:g,refetch:f}=u.useEffectiveConfig(),b=p?.configYamls??[],[v,y]=r(!1),S=i(()=>{if(!m)return{};const{manifestYAML:e,provenance:t,...o}=m;return o},[m]),{formData:w,handleFormChange:x,getNestedValue:k,getFormDiff:T,isFormDirty:$}=zt(S);n(()=>{"{}"!==JSON.stringify(S)&&"{}"===JSON.stringify(w)&&x(void 0,void 0,S)},[S,w]);const I=i(()=>[...b].sort((e,t)=>Vg(e)-Vg(t)),[b]),E=i(()=>(e=>{if(!e)return{};const t={};for(const o of e)t[o.helmPath]=o.reconciledFrom;return t})(m?.provenance),[m?.provenance]),N=i(()=>{const e=new Set;for(const t of b)for(const o of t.fields)o.componentType===Te.Dropdown&&e.add(o.helmValuePath);return e},[b]),A=i(()=>b.flatMap(e=>e.fields.map(e=>({name:e.helmValuePath,value:k("formData",e.helmValuePath)}))),[b,w,k]),[O,R]=r(!1),[D,P]=r(!1),F=i(()=>[{id:on(),type:io.Button,buttonProps:{"data-id":"settings-save",variant:fe.Primary,size:ge.S,label:"Save Changes",leftIcon:Fa,loading:v,onClick:()=>R(!0)}},{id:on(),type:io.Button,buttonProps:{"data-id":"settings-cancel",variant:fe.Secondary,size:ge.S,label:"Cancel",leftIcon:La,onClick:()=>x(void 0,void 0,S)}}],[v,T,S,w,x]),L=i(()=>I.map(e=>({id:e.name,label:e.displayName})),[I]),M=i(()=>I.map(e=>e.name),[I]),{selectedSection:_,setSelectedSection:z,setSectionRef:B,setScrollContainerRef:X}=ya({sectionNames:M});return t(Ei,{$gap:24,children:e(Mg,{children:[t(Pg,{disabled:!l,loading:h||g,onClickShowYaml:()=>P(!0),onClickReset:async()=>{await(async()=>{u.resetLocalUiConfigToDefaults&&await u.resetLocalUiConfigToDefaults()})(),await(f?.()),x(void 0,void 0,{})},onClickRefresh:f?()=>f():void 0}),e(na,{children:[!l&&t(cr,{minSupportedVersion:d,currentVersion:s||""}),t(Io,{isOpen:$,richTitle:{icon:Ba,title:"Config Settings"},actions:F}),t(Ze,{isOpen:O,title:"Save Changes via UI?",description:"We recommend updating via your Helm values.yaml to ensure changes are version-controlled and go through a proper review process.",onClose:()=>R(!1),denyButton:{label:"Keep editing",variant:fe.Secondary,onClick:()=>R(!1)},approveButton:{label:"Save changes",variant:fe.Primary,onClick:()=>{(async()=>{const e=((e,t)=>{const o=(e,t,o)=>{for(let o=0;o<t.length-1;o++){const n=t[o];n in e&&"object"==typeof e[n]&&null!==e[n]||(e[n]={}),e=e[n]}e[t[t.length-1]]=o},n=JSON.parse(JSON.stringify(e));for(const e of t){const t=e.split(".");let i=n;for(const e of t){if(null==i||"object"!=typeof i){i=void 0;break}i=i[e]}"string"==typeof i&&o(n,t,i.replaceAll("-","_"))}return n})(T(S,w),N);await(async e=>{u.updateLocalUiConfig&&(y(!0),await u.updateLocalUiConfig(e),y(!1),await f())})(e),x(void 0,void 0,{})})(),R(!1)}}}),e(_g,{$gap:24,$alignItems:"stretch",children:[!!b.length&&t(Lg,{options:L,selected:_,setSelected:z,disabled:!l}),t(zg,{ref:X,$gap:24,$width:"100%",children:b.length?I.map(n=>t(ct,{id:n.name,bordered:!0,ref:e=>B(n.name,e),customTitle:t(de,{size:pe.M,weight:500,color:ue.Primary,children:n.displayName}),children:t(Q,{$gap:24,children:n.fields.map(n=>{if(n.isEnterpriseOnly&&!c)return null;if(n.renderCondition&&!$e(n.renderCondition,[],A))return null;const i=Ie(n.componentProps||"{}",{}),a=E[n.helmValuePath],l=n.componentType===Te.Toggle,r=t(de,{size:pe.XS,weight:500,color:ue.Primary,children:n.displayName}),s=(e=>{if(e)return"odigos-local-ui-config"===e?{status:Le.Warning,label:"Edited in UI",tooltip:`Reconciled from ${e}`}:"odigos-configuration"===e?{status:Le.Unknown,useSecondaryTone:!0,label:"Cluster config",tooltip:`Reconciled from ${e}`}:{status:Le.Unknown,useSecondaryTone:!0,label:e,tooltip:`Reconciled from ${e}`}})(a),d=s?t(Ye,{...s}):null,u=n.description?t(de,{size:pe.XXS,color:ue.Secondary,children:n.description}):null,p=e(Q,{$gap:4,children:[e(he,{$gap:8,$alignItems:"center",children:[r,d]}),u]}),h=t(Gl,{componentType:n.componentType,inputType:i.type,name:n.helmValuePath,disabled:n.isHelmOnly||v,value:k("formData",n.helmValuePath),setValue:e=>x(n.helmValuePath,e),dropdownOptions:i.options?.map(e=>({id:e,label:e})),dropdownNoSearch:!0,dropdownNoCheckbox:!0,toggleSize:It.S},n.helmValuePath),m=n.isHelmOnly?t(Ee,{text:"This field can only be updated via the Helm values.yaml file",children:t(wl,{})}):null;return t(Q,{$gap:8,children:l?e(he,{$gap:12,$justifyContent:"space-between",$alignItems:"flex-start",children:[p,e(he,{$gap:8,$alignItems:"center",children:[m,h]})]}):e(o,{children:[p,e(Bg,{children:[t(Xg,{children:h}),m]})]})},n.helmValuePath)})})},n.name)):h?t(gt,{$height:"30vh",children:t(Ct,{withSpinner:!0})}):t(ct,{richTitle:{icon:Ba,title:"Config Settings"},children:t(Oe,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})]}),t(se,{isOpen:D,width:"40vw",minWidth:"480px",header:{icon:yl,title:"Effective Config YAML",onClose:()=>P(!1)},children:g&&!m?.manifestYAML?t(gt,{$height:"30vh",children:t(Ct,{withSpinner:!0})}):t(lr,{yaml:m?.manifestYAML?.replaceAll(" |",""),defaultOpen:!0,fullHeight:!0})})]})]})})},Gg=f.div`
106
1101
  position: fixed;
107
1102
  bottom: 12px;
108
1103
  left: 12px;
@@ -111,4 +1106,4 @@ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import o,{useThe
111
1106
  flex-direction: column-reverse;
112
1107
  gap: 6px;
113
1108
  max-width: 600px;
114
- `,Ye=()=>{const{notifications:t,markAsDismissed:i,markAsSeen:o}=U(),{onClickNotification:r}=Y(),n=t.filter(({dismissed:e})=>!e);return e(Ue,{children:n.map(({id:t,type:a,title:s,message:d,crdType:l,target:c},p)=>{const u=d||s;if(!u)return null;const h=n.length-p;return e(W,{status:a,message:u,action:l&&c?{label:"go to details",onClick:()=>r({id:t,crdType:l,target:c},{dismissToast:!0})}:void 0,onClose:({asSeen:e})=>(({id:e,asSeen:t})=>{i(e),t&&o(e)})({id:t,asSeen:e}),zIndex:h},`toast-${t}`)})})};export{Fe as ServiceMap,Ye as ToastList};
1109
+ `,Hg=()=>{const{notifications:e,markAsDismissed:o,markAsSeen:n}=Gt(),i=e.filter(({dismissed:e})=>!e);return t(Gg,{children:i.map(({id:e,type:a,title:l,message:r},s)=>{const c=r||l;if(!c)return null;const d=i.length-s;return t(Fe,{status:a,message:c,onClose:({asSeen:t})=>(({id:e,asSeen:t})=>{o(e),t&&n(e)})({id:e,asSeen:t}),zIndex:d},`toast-${e}`)})})};export{qs as AddActionDrawer,xs as AddActionForm,tp as AddDataStreamModal,lc as AddDestinationDrawer,$s as AddDestinationForm,rc as AddRuleDrawer,Ps as AddRuleForm,Sc as AddSourceDrawer,ih as CentralConnections,Ls as DataStreamForm,Fs as DataStreamMergeWarning,xc as EditActionDrawer,kc as EditConfigDrawer,op as EditDataStreamModal,$c as EditDestinationDrawer,Ec as EditRuleDrawer,Du as EditSourceDrawer,Ms as EditSourceForm,vh as Onboarding,ap as OnboardingDone,Sm as Overview,Pm as PipelineCollectors,Kr as RegexTesterDrawer,Qp as SamplingOnboardingModal,Hu as SamplingRuleDrawer,Us as SamplingRuleForm,Xm as SamplingRules,Ag as ServiceMap,Ug as Settings,ep as SystemDrawer,Dm as TABS,Hg as ToastList};