@openshift-assisted/ui-lib 2.7.11-cim

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 (599) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +99 -0
  3. package/dist/cim/index.css +2 -0
  4. package/dist/cim/index.css.map +7 -0
  5. package/dist/cim/index.js +25 -0
  6. package/dist/cim/index.js.map +7 -0
  7. package/dist/index.css +2 -0
  8. package/dist/index.css.map +7 -0
  9. package/dist/index.js +37 -0
  10. package/dist/index.js.map +7 -0
  11. package/dist/locales/en/translation.json +763 -0
  12. package/dist/locales/ja/translation.json +763 -0
  13. package/dist/locales/ko/translation.json +763 -0
  14. package/dist/locales/zh/translation.json +763 -0
  15. package/dist/ocm/index.css +2 -0
  16. package/dist/ocm/index.css.map +7 -0
  17. package/dist/ocm/index.js +34 -0
  18. package/dist/ocm/index.js.map +7 -0
  19. package/dist/src/cim/components/Agent/AgentStatus.d.ts +14 -0
  20. package/dist/src/cim/components/Agent/AgentTable.d.ts +12 -0
  21. package/dist/src/cim/components/Agent/AgentsSelectionHostCountAlerts.d.ts +8 -0
  22. package/dist/src/cim/components/Agent/AgentsSelectionHostCountLabelIcon.d.ts +2 -0
  23. package/dist/src/cim/components/Agent/AgentsSelectionTable.d.ts +16 -0
  24. package/dist/src/cim/components/Agent/AgentsSelectionUtils.d.ts +7 -0
  25. package/dist/src/cim/components/Agent/BMCForm.d.ts +4 -0
  26. package/dist/src/cim/components/Agent/BMHStatus.d.ts +7 -0
  27. package/dist/src/cim/components/Agent/MinimalHWRequirements.d.ts +15 -0
  28. package/dist/src/cim/components/Agent/NoAgentsAlert.d.ts +5 -0
  29. package/dist/src/cim/components/Agent/index.d.ts +3 -0
  30. package/dist/src/cim/components/Agent/tableUtils.d.ts +51 -0
  31. package/dist/src/cim/components/Agent/types.d.ts +36 -0
  32. package/dist/src/cim/components/ClusterDeployment/ACMClusterDeploymentDetailsStep.d.ts +23 -0
  33. package/dist/src/cim/components/ClusterDeployment/AdditionalNTPSourcesDialogToggle.d.ts +2 -0
  34. package/dist/src/cim/components/ClusterDeployment/ArmCheckbox.d.ts +7 -0
  35. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentCreateProgress.d.ts +9 -0
  36. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentCredentials.d.ts +13 -0
  37. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentDetails.d.ts +13 -0
  38. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.d.ts +13 -0
  39. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.d.ts +19 -0
  40. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentDetailsTable.d.ts +10 -0
  41. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentHostDiscoveryTable.d.ts +4 -0
  42. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentHostSelectionStep.d.ts +14 -0
  43. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscovery.d.ts +4 -0
  44. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentHostsDiscoveryStep.d.ts +4 -0
  45. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentHostsNetworkTable.d.ts +10 -0
  46. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentHostsSelection.d.ts +4 -0
  47. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentHostsSelectionAdvanced.d.ts +15 -0
  48. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentHostsSelectionBasic.d.ts +8 -0
  49. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentKubeconfigDownload.d.ts +10 -0
  50. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentNetworkingForm.d.ts +20 -0
  51. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentNetworkingStep.d.ts +4 -0
  52. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentProgress.d.ts +13 -0
  53. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentReviewStep.d.ts +13 -0
  54. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentValidationsOverview.d.ts +9 -0
  55. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentWizard.d.ts +4 -0
  56. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentWizardContext.d.ts +10 -0
  57. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentWizardFooter.d.ts +12 -0
  58. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentWizardNavigation.d.ts +3 -0
  59. package/dist/src/cim/components/ClusterDeployment/ClusterDeploymentWizardStep.d.ts +6 -0
  60. package/dist/src/cim/components/ClusterDeployment/ClusterDetailsFormFields.d.ts +16 -0
  61. package/dist/src/cim/components/ClusterDeployment/ClusterInstallationError.d.ts +7 -0
  62. package/dist/src/cim/components/ClusterDeployment/ClusterScaleUpAutoHostsSelection.d.ts +7 -0
  63. package/dist/src/cim/components/ClusterDeployment/LabelsSelector.d.ts +13 -0
  64. package/dist/src/cim/components/ClusterDeployment/LocationsSelector.d.ts +6 -0
  65. package/dist/src/cim/components/ClusterDeployment/LogsDownloadButton.d.ts +11 -0
  66. package/dist/src/cim/components/ClusterDeployment/NetworkConfiguration.d.ts +9 -0
  67. package/dist/src/cim/components/ClusterDeployment/ScaleUpForm.d.ts +9 -0
  68. package/dist/src/cim/components/ClusterDeployment/ShortCapacitySummary.d.ts +9 -0
  69. package/dist/src/cim/components/ClusterDeployment/constants.d.ts +14 -0
  70. package/dist/src/cim/components/ClusterDeployment/helpers.d.ts +23 -0
  71. package/dist/src/cim/components/ClusterDeployment/index.d.ts +17 -0
  72. package/dist/src/cim/components/ClusterDeployment/networkConfigurationValidation.d.ts +5 -0
  73. package/dist/src/cim/components/ClusterDeployment/types.d.ts +174 -0
  74. package/dist/src/cim/components/ClusterDeployment/use-networking-formik.d.ts +39 -0
  75. package/dist/src/cim/components/ClusterDeployment/validationSchemas.d.ts +3 -0
  76. package/dist/src/cim/components/ClusterDeployment/wizardTransition.d.ts +10 -0
  77. package/dist/src/cim/components/Hypershift/DetailsPage/ClusterInstallationProgress.d.ts +21 -0
  78. package/dist/src/cim/components/Hypershift/DetailsPage/ConditionsTable.d.ts +11 -0
  79. package/dist/src/cim/components/Hypershift/DetailsPage/HostedClusterProgress.d.ts +7 -0
  80. package/dist/src/cim/components/Hypershift/DetailsPage/HypershiftKubeconfigDownload.d.ts +8 -0
  81. package/dist/src/cim/components/Hypershift/DetailsPage/NodePoolStatus.d.ts +8 -0
  82. package/dist/src/cim/components/Hypershift/DetailsPage/NodePoolsProgress.d.ts +18 -0
  83. package/dist/src/cim/components/Hypershift/DetailsPage/NodePoolsTable.d.ts +25 -0
  84. package/dist/src/cim/components/Hypershift/DetailsPage/index.d.ts +2 -0
  85. package/dist/src/cim/components/Hypershift/HostedClusterWizard/DetailsStep/DetailsForm.d.ts +4 -0
  86. package/dist/src/cim/components/Hypershift/HostedClusterWizard/DetailsStep/DetailsStep.d.ts +4 -0
  87. package/dist/src/cim/components/Hypershift/HostedClusterWizard/DetailsStep/index.d.ts +1 -0
  88. package/dist/src/cim/components/Hypershift/HostedClusterWizard/DetailsStep/types.d.ts +35 -0
  89. package/dist/src/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsForm.d.ts +4 -0
  90. package/dist/src/cim/components/Hypershift/HostedClusterWizard/HostsStep/HostsStep.d.ts +4 -0
  91. package/dist/src/cim/components/Hypershift/HostedClusterWizard/HostsStep/NodePoolForm.d.ts +11 -0
  92. package/dist/src/cim/components/Hypershift/HostedClusterWizard/HostsStep/index.d.ts +1 -0
  93. package/dist/src/cim/components/Hypershift/HostedClusterWizard/HostsStep/types.d.ts +30 -0
  94. package/dist/src/cim/components/Hypershift/HostedClusterWizard/NetworkStep/NetworkForm.d.ts +5 -0
  95. package/dist/src/cim/components/Hypershift/HostedClusterWizard/NetworkStep/NetworkStep.d.ts +4 -0
  96. package/dist/src/cim/components/Hypershift/HostedClusterWizard/NetworkStep/index.d.ts +2 -0
  97. package/dist/src/cim/components/Hypershift/HostedClusterWizard/NetworkStep/types.d.ts +23 -0
  98. package/dist/src/cim/components/Hypershift/HostedClusterWizard/index.d.ts +3 -0
  99. package/dist/src/cim/components/Hypershift/forms/NodePoolAgentsForm.d.ts +10 -0
  100. package/dist/src/cim/components/Hypershift/hooks/useSupportedOCPVersions.d.ts +3 -0
  101. package/dist/src/cim/components/Hypershift/hooks/useTemptiflySync.d.ts +6 -0
  102. package/dist/src/cim/components/Hypershift/index.d.ts +4 -0
  103. package/dist/src/cim/components/Hypershift/modals/AddNodePoolModal.d.ts +12 -0
  104. package/dist/src/cim/components/Hypershift/modals/ManageHostsModal.d.ts +16 -0
  105. package/dist/src/cim/components/Hypershift/modals/NodePoolForm.d.ts +18 -0
  106. package/dist/src/cim/components/Hypershift/modals/RemoveNodePoolModal.d.ts +8 -0
  107. package/dist/src/cim/components/Hypershift/types.d.ts +195 -0
  108. package/dist/src/cim/components/Hypershift/utils/index.d.ts +3 -0
  109. package/dist/src/cim/components/Hypershift/utils/labels.d.ts +10 -0
  110. package/dist/src/cim/components/Hypershift/utils/nodepool.d.ts +3 -0
  111. package/dist/src/cim/components/Hypershift/utils/status.d.ts +10 -0
  112. package/dist/src/cim/components/InfraEnv/AddHostDropdown.d.ts +4 -0
  113. package/dist/src/cim/components/InfraEnv/AgentAlerts.d.ts +9 -0
  114. package/dist/src/cim/components/InfraEnv/EnvironmentDetails.d.ts +16 -0
  115. package/dist/src/cim/components/InfraEnv/EnvironmentErrors.d.ts +9 -0
  116. package/dist/src/cim/components/InfraEnv/InfraEnvAgentTable.d.ts +4 -0
  117. package/dist/src/cim/components/InfraEnv/InfraEnvFormPage.d.ts +31 -0
  118. package/dist/src/cim/components/InfraEnv/InfraEnvHostsTabAgentsWarning.d.ts +8 -0
  119. package/dist/src/cim/components/InfraEnv/InfraTableToolbar.d.ts +16 -0
  120. package/dist/src/cim/components/InfraEnv/index.d.ts +8 -0
  121. package/dist/src/cim/components/InfraEnv/types.d.ts +12 -0
  122. package/dist/src/cim/components/InfraEnv/utils.d.ts +13 -0
  123. package/dist/src/cim/components/YamlPreview/YamlPreview.d.ts +8 -0
  124. package/dist/src/cim/components/YamlPreview/index.d.ts +2 -0
  125. package/dist/src/cim/components/YamlPreview/useYAMLPreview.d.ts +14 -0
  126. package/dist/src/cim/components/common/InfoAndTroubleshootingNotification.d.ts +7 -0
  127. package/dist/src/cim/components/common/ResourceAlerts.d.ts +7 -0
  128. package/dist/src/cim/components/common/SpecSyncErrAlert.d.ts +5 -0
  129. package/dist/src/cim/components/common/ValidationsRunningAlert.d.ts +2 -0
  130. package/dist/src/cim/components/common/constants.d.ts +10 -0
  131. package/dist/src/cim/components/common/index.d.ts +2 -0
  132. package/dist/src/cim/components/featureSupportLevels/ACMFeatureSupportLevelProvider.d.ts +8 -0
  133. package/dist/src/cim/components/featureSupportLevels/featureStateUtils.d.ts +4 -0
  134. package/dist/src/cim/components/featureSupportLevels/index.d.ts +1 -0
  135. package/dist/src/cim/components/helpers/agentClusterInstall.d.ts +3 -0
  136. package/dist/src/cim/components/helpers/agentStatus.d.ts +3 -0
  137. package/dist/src/cim/components/helpers/agents.d.ts +15 -0
  138. package/dist/src/cim/components/helpers/clusterDeployment.d.ts +38 -0
  139. package/dist/src/cim/components/helpers/conditions.d.ts +9 -0
  140. package/dist/src/cim/components/helpers/index.d.ts +11 -0
  141. package/dist/src/cim/components/helpers/labels.d.ts +3 -0
  142. package/dist/src/cim/components/helpers/network.d.ts +6 -0
  143. package/dist/src/cim/components/helpers/proxy.d.ts +1 -0
  144. package/dist/src/cim/components/helpers/status.d.ts +26 -0
  145. package/dist/src/cim/components/helpers/storage.d.ts +1 -0
  146. package/dist/src/cim/components/helpers/toAssisted.d.ts +12 -0
  147. package/dist/src/cim/components/helpers/units.d.ts +50 -0
  148. package/dist/src/cim/components/helpers/versions.d.ts +7 -0
  149. package/dist/src/cim/components/index.d.ts +8 -0
  150. package/dist/src/cim/components/modals/AddBmcHostModal.d.ts +4 -0
  151. package/dist/src/cim/components/modals/AddBmcHostYamlForm.d.ts +5 -0
  152. package/dist/src/cim/components/modals/AddBmcHostYamlModal.d.ts +4 -0
  153. package/dist/src/cim/components/modals/AddHostModal.d.ts +4 -0
  154. package/dist/src/cim/components/modals/CimConfiguration/CimConfigDisconnectedAlert.d.ts +4 -0
  155. package/dist/src/cim/components/modals/CimConfiguration/CimConfigProgressAlert.d.ts +4 -0
  156. package/dist/src/cim/components/modals/CimConfiguration/CimConfigurationForm.d.ts +4 -0
  157. package/dist/src/cim/components/modals/CimConfiguration/CimConfigurationModal.d.ts +4 -0
  158. package/dist/src/cim/components/modals/CimConfiguration/CimIsMissingAlert.d.ts +2 -0
  159. package/dist/src/cim/components/modals/CimConfiguration/CimStorageMissingAlert.d.ts +5 -0
  160. package/dist/src/cim/components/modals/CimConfiguration/constants.d.ts +4 -0
  161. package/dist/src/cim/components/modals/CimConfiguration/index.d.ts +6 -0
  162. package/dist/src/cim/components/modals/CimConfiguration/persist.d.ts +23 -0
  163. package/dist/src/cim/components/modals/CimConfiguration/types.d.ts +43 -0
  164. package/dist/src/cim/components/modals/CimConfiguration/utils.d.ts +15 -0
  165. package/dist/src/cim/components/modals/EditAgentModal.d.ts +4 -0
  166. package/dist/src/cim/components/modals/EditBMHModal.d.ts +4 -0
  167. package/dist/src/cim/components/modals/EditNtpSourcesModal.d.ts +11 -0
  168. package/dist/src/cim/components/modals/EditPullSecretModal.d.ts +19 -0
  169. package/dist/src/cim/components/modals/EditSSHKeyModal.d.ts +13 -0
  170. package/dist/src/cim/components/modals/MassApproveAction.d.ts +8 -0
  171. package/dist/src/cim/components/modals/MassApproveAgentModal.d.ts +10 -0
  172. package/dist/src/cim/components/modals/MassDeleteAgentModal.d.ts +13 -0
  173. package/dist/src/cim/components/modals/ScaleUpModal.d.ts +13 -0
  174. package/dist/src/cim/components/modals/constants.d.ts +63 -0
  175. package/dist/src/cim/components/modals/index.d.ts +10 -0
  176. package/dist/src/cim/components/modals/types.d.ts +45 -0
  177. package/dist/src/cim/components/modals/utils.d.ts +28 -0
  178. package/dist/src/cim/config/constants.d.ts +9 -0
  179. package/dist/src/cim/index.d.ts +13 -0
  180. package/dist/src/cim/types/fromOCP/index.d.ts +1 -0
  181. package/dist/src/cim/types/fromOCP/k8sTypes.d.ts +46 -0
  182. package/dist/src/cim/types/index.d.ts +4 -0
  183. package/dist/src/cim/types/k8s/agent-cluster-install.d.ts +68 -0
  184. package/dist/src/cim/types/k8s/agent-service-config.d.ts +23 -0
  185. package/dist/src/cim/types/k8s/agent.d.ts +48 -0
  186. package/dist/src/cim/types/k8s/bare-metal-host.d.ts +31 -0
  187. package/dist/src/cim/types/k8s/cluster-deployment.d.ts +41 -0
  188. package/dist/src/cim/types/k8s/cluster-image-set.d.ts +6 -0
  189. package/dist/src/cim/types/k8s/cluster-version.d.ts +45 -0
  190. package/dist/src/cim/types/k8s/index.d.ts +12 -0
  191. package/dist/src/cim/types/k8s/infra-env-k8s-resource.d.ts +36 -0
  192. package/dist/src/cim/types/k8s/infrastructure.d.ts +22 -0
  193. package/dist/src/cim/types/k8s/nm-state.d.ts +10 -0
  194. package/dist/src/cim/types/k8s/shared.d.ts +13 -0
  195. package/dist/src/cim/types/k8s/storage-class.d.ts +8 -0
  196. package/dist/src/cim/types/metal3.d.ts +86 -0
  197. package/dist/src/cim/types/resources.d.ts +44 -0
  198. package/dist/src/cim/utils.d.ts +2 -0
  199. package/dist/src/common/api/index.d.ts +2 -0
  200. package/dist/src/common/api/types.d.ts +2241 -0
  201. package/dist/src/common/api/utils.d.ts +2 -0
  202. package/dist/src/common/components/AddHosts/AddHostsContext.d.ts +9 -0
  203. package/dist/src/common/components/AddHosts/index.d.ts +1 -0
  204. package/dist/src/common/components/AlertsContextProvider.d.ts +10 -0
  205. package/dist/src/common/components/ErrorHandling/ErrorMonitorContext.d.ts +12 -0
  206. package/dist/src/common/components/ErrorHandling/WithErrorBoundary.d.ts +5 -0
  207. package/dist/src/common/components/clusterConfiguration/AdvancedNetworkFields.d.ts +7 -0
  208. package/dist/src/common/components/clusterConfiguration/DiscoveryImageConfigForm.d.ts +16 -0
  209. package/dist/src/common/components/clusterConfiguration/DiscoveryImageCpuArchitectureControlGroup.d.ts +8 -0
  210. package/dist/src/common/components/clusterConfiguration/DiscoveryImageTypeControlGroup.d.ts +2 -0
  211. package/dist/src/common/components/clusterConfiguration/DiscoveryInstructions.d.ts +6 -0
  212. package/dist/src/common/components/clusterConfiguration/DiscoveryTroubleshootingModal.d.ts +13 -0
  213. package/dist/src/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionControlGroup.d.ts +8 -0
  214. package/dist/src/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionMode.d.ts +6 -0
  215. package/dist/src/common/components/clusterConfiguration/DiskEncryptionFields/DiskEncryptionValues.d.ts +11 -0
  216. package/dist/src/common/components/clusterConfiguration/DiskEncryptionFields/TangServers.d.ts +3 -0
  217. package/dist/src/common/components/clusterConfiguration/DownloadIso.d.ts +10 -0
  218. package/dist/src/common/components/clusterConfiguration/DownloadIsoModal.d.ts +7 -0
  219. package/dist/src/common/components/clusterConfiguration/FormatDiskWarning.d.ts +5 -0
  220. package/dist/src/common/components/clusterConfiguration/OpenShiftVersionSelect.d.ts +7 -0
  221. package/dist/src/common/components/clusterConfiguration/ProxyFields.d.ts +5 -0
  222. package/dist/src/common/components/clusterConfiguration/SNOControlGroup.d.ts +8 -0
  223. package/dist/src/common/components/clusterConfiguration/SNODisclaimer.d.ts +8 -0
  224. package/dist/src/common/components/clusterConfiguration/SecurityFields.d.ts +12 -0
  225. package/dist/src/common/components/clusterConfiguration/UploadSSH.d.ts +6 -0
  226. package/dist/src/common/components/clusterConfiguration/index.d.ts +13 -0
  227. package/dist/src/common/components/clusterConfiguration/utils.d.ts +20 -0
  228. package/dist/src/common/components/clusterDetail/ClusterCredentials.d.ts +12 -0
  229. package/dist/src/common/components/clusterDetail/ClusterProgress.d.ts +9 -0
  230. package/dist/src/common/components/clusterDetail/ClusterProgressItem.d.ts +6 -0
  231. package/dist/src/common/components/clusterDetail/ClusterProgressItems.d.ts +11 -0
  232. package/dist/src/common/components/clusterDetail/ClusterPropertiesList.d.ts +11 -0
  233. package/dist/src/common/components/clusterDetail/ConsoleModal.d.ts +20 -0
  234. package/dist/src/common/components/clusterDetail/FinalizingProgress.d.ts +14 -0
  235. package/dist/src/common/components/clusterDetail/KubeconfigDownload.d.ts +10 -0
  236. package/dist/src/common/components/clusterDetail/OperatorsProgressItem.d.ts +13 -0
  237. package/dist/src/common/components/clusterDetail/ProgressBarTexts.d.ts +7 -0
  238. package/dist/src/common/components/clusterDetail/index.d.ts +4 -0
  239. package/dist/src/common/components/clusterWizard/ClusterWizardStep.d.ts +8 -0
  240. package/dist/src/common/components/clusterWizard/ClusterWizardStepHeader.d.ts +3 -0
  241. package/dist/src/common/components/clusterWizard/ClusterWizardStepValidationsAlert.d.ts +15 -0
  242. package/dist/src/common/components/clusterWizard/ReviewHostsInventory.d.ts +6 -0
  243. package/dist/src/common/components/clusterWizard/ReviewValidations.d.ts +3 -0
  244. package/dist/src/common/components/clusterWizard/clusterDetailsValidation.d.ts +24 -0
  245. package/dist/src/common/components/clusterWizard/index.d.ts +8 -0
  246. package/dist/src/common/components/clusterWizard/networkingSteps/AvailableSubnetsControl.d.ts +9 -0
  247. package/dist/src/common/components/clusterWizard/networkingSteps/ManagedNetworkingControlGroup.d.ts +5 -0
  248. package/dist/src/common/components/clusterWizard/networkingSteps/NetworkTypeControlGroup.d.ts +5 -0
  249. package/dist/src/common/components/clusterWizard/networkingSteps/UserManagedNetworkingTextContent.d.ts +4 -0
  250. package/dist/src/common/components/clusterWizard/networkingSteps/VirtualIPControlGroup.d.ts +8 -0
  251. package/dist/src/common/components/clusterWizard/networkingSteps/index.d.ts +8 -0
  252. package/dist/src/common/components/clusterWizard/types.d.ts +62 -0
  253. package/dist/src/common/components/clusterWizard/validationsInfoUtils.d.ts +35 -0
  254. package/dist/src/common/components/clusters/PullSecret.d.ts +7 -0
  255. package/dist/src/common/components/clusters/index.d.ts +1 -0
  256. package/dist/src/common/components/constants.d.ts +2 -0
  257. package/dist/src/common/components/featureSupportLevels/FeatureSupportLevelBadge.d.ts +8 -0
  258. package/dist/src/common/components/featureSupportLevels/FeatureSupportLevelContext.d.ts +15 -0
  259. package/dist/src/common/components/featureSupportLevels/index.d.ts +2 -0
  260. package/dist/src/common/components/featureSupportLevels/utils.d.ts +5 -0
  261. package/dist/src/common/components/fetching/EventListFetch.d.ts +3 -0
  262. package/dist/src/common/components/fetching/index.d.ts +1 -0
  263. package/dist/src/common/components/hosts/AITable.d.ts +51 -0
  264. package/dist/src/common/components/hosts/AdditionalNTPSourcesDialog.d.ts +12 -0
  265. package/dist/src/common/components/hosts/DiskLimitations.d.ts +7 -0
  266. package/dist/src/common/components/hosts/DiskRole.d.ts +14 -0
  267. package/dist/src/common/components/hosts/EditHostForm.d.ts +13 -0
  268. package/dist/src/common/components/hosts/EditHostModal.d.ts +15 -0
  269. package/dist/src/common/components/hosts/FormatDiskCheckbox.d.ts +16 -0
  270. package/dist/src/common/components/hosts/HostProgress.d.ts +5 -0
  271. package/dist/src/common/components/hosts/HostPropertyValidationPopover.d.ts +12 -0
  272. package/dist/src/common/components/hosts/HostRequirements.d.ts +15 -0
  273. package/dist/src/common/components/hosts/HostRowDetail.d.ts +13 -0
  274. package/dist/src/common/components/hosts/HostStatus.d.ts +4 -0
  275. package/dist/src/common/components/hosts/HostToolbarActions.d.ts +10 -0
  276. package/dist/src/common/components/hosts/HostValidationGroups.d.ts +20 -0
  277. package/dist/src/common/components/hosts/Hostname.d.ts +13 -0
  278. package/dist/src/common/components/hosts/HostsCount.d.ts +9 -0
  279. package/dist/src/common/components/hosts/HostsTable.d.ts +19 -0
  280. package/dist/src/common/components/hosts/HostsTableDetailContext.d.ts +11 -0
  281. package/dist/src/common/components/hosts/MassChangeHostnameModal.d.ts +14 -0
  282. package/dist/src/common/components/hosts/MassDeleteHostModal.d.ts +10 -0
  283. package/dist/src/common/components/hosts/NtpValidationStatus.d.ts +9 -0
  284. package/dist/src/common/components/hosts/OcpConsoleNodesSectionLink.d.ts +6 -0
  285. package/dist/src/common/components/hosts/RoleCell.d.ts +13 -0
  286. package/dist/src/common/components/hosts/RoleDropdown.d.ts +11 -0
  287. package/dist/src/common/components/hosts/TableToolbar.d.ts +18 -0
  288. package/dist/src/common/components/hosts/VMRebootConfigurationInfo.d.ts +3 -0
  289. package/dist/src/common/components/hosts/hardwareInfo.d.ts +19 -0
  290. package/dist/src/common/components/hosts/index.d.ts +16 -0
  291. package/dist/src/common/components/hosts/status.d.ts +3 -0
  292. package/dist/src/common/components/hosts/tableUtils.d.ts +22 -0
  293. package/dist/src/common/components/hosts/types.d.ts +72 -0
  294. package/dist/src/common/components/hosts/usePagination.d.ts +9 -0
  295. package/dist/src/common/components/hosts/utils.d.ts +36 -0
  296. package/dist/src/common/components/index.d.ts +11 -0
  297. package/dist/src/common/components/storage/DisksTable.d.ts +13 -0
  298. package/dist/src/common/components/storage/StorageDetail.d.ts +11 -0
  299. package/dist/src/common/components/storage/StorageTable.d.ts +11 -0
  300. package/dist/src/common/components/storage/StorageUtils.d.ts +6 -0
  301. package/dist/src/common/components/ui/Alerts.d.ts +5 -0
  302. package/dist/src/common/components/ui/BorderedIcon/BorderedIcon.d.ts +10 -0
  303. package/dist/src/common/components/ui/ClusterEventsList.d.ts +9 -0
  304. package/dist/src/common/components/ui/ClusterEventsToolbar.d.ts +12 -0
  305. package/dist/src/common/components/ui/ConfirmationModal.d.ts +13 -0
  306. package/dist/src/common/components/ui/DetailList.d.ts +21 -0
  307. package/dist/src/common/components/ui/EventsList.d.ts +8 -0
  308. package/dist/src/common/components/ui/ExternalLink.d.ts +8 -0
  309. package/dist/src/common/components/ui/GridGap.d.ts +7 -0
  310. package/dist/src/common/components/ui/ModalProgress.d.ts +10 -0
  311. package/dist/src/common/components/ui/OpenShiftVersionDropown.d.ts +17 -0
  312. package/dist/src/common/components/ui/PopoverIcon.d.ts +14 -0
  313. package/dist/src/common/components/ui/PreviewBadge.d.ts +14 -0
  314. package/dist/src/common/components/ui/PrismCode.d.ts +11 -0
  315. package/dist/src/common/components/ui/RenderIf.d.ts +6 -0
  316. package/dist/src/common/components/ui/SectionTitle.d.ts +6 -0
  317. package/dist/src/common/components/ui/SimpleDropdown.d.ts +15 -0
  318. package/dist/src/common/components/ui/StaticTextField.d.ts +23 -0
  319. package/dist/src/common/components/ui/Toolbar/ToolbarButton.d.ts +4 -0
  320. package/dist/src/common/components/ui/Toolbar/ToolbarProgress.d.ts +4 -0
  321. package/dist/src/common/components/ui/Toolbar/ToolbarSecondaryGroup.d.ts +3 -0
  322. package/dist/src/common/components/ui/Toolbar/ToolbarText.d.ts +4 -0
  323. package/dist/src/common/components/ui/Toolbar/index.d.ts +4 -0
  324. package/dist/src/common/components/ui/ViewClusterEventsButton.d.ts +8 -0
  325. package/dist/src/common/components/ui/WizardFooter.d.ts +22 -0
  326. package/dist/src/common/components/ui/WizardNavItem.d.ts +7 -0
  327. package/dist/src/common/components/ui/eventsModal.d.ts +29 -0
  328. package/dist/src/common/components/ui/formik/AddButton.d.ts +7 -0
  329. package/dist/src/common/components/ui/formik/AdditionalNTPSourcesField.d.ts +10 -0
  330. package/dist/src/common/components/ui/formik/CheckboxField.d.ts +4 -0
  331. package/dist/src/common/components/ui/formik/CodeField.d.ts +3 -0
  332. package/dist/src/common/components/ui/formik/FormikAutoSave.d.ts +7 -0
  333. package/dist/src/common/components/ui/formik/HelperText.d.ts +11 -0
  334. package/dist/src/common/components/ui/formik/InputField.d.ts +8 -0
  335. package/dist/src/common/components/ui/formik/LabelField.d.ts +13 -0
  336. package/dist/src/common/components/ui/formik/MultiSelectField.d.ts +4 -0
  337. package/dist/src/common/components/ui/formik/NumberInputField.d.ts +4 -0
  338. package/dist/src/common/components/ui/formik/PencilEditField.d.ts +8 -0
  339. package/dist/src/common/components/ui/formik/PullSecretField.d.ts +12 -0
  340. package/dist/src/common/components/ui/formik/RadioField.d.ts +3 -0
  341. package/dist/src/common/components/ui/formik/RadioFieldWithTooltip.d.ts +7 -0
  342. package/dist/src/common/components/ui/formik/RemovableField.d.ts +10 -0
  343. package/dist/src/common/components/ui/formik/RichInputField.d.ts +17 -0
  344. package/dist/src/common/components/ui/formik/SelectField.d.ts +4 -0
  345. package/dist/src/common/components/ui/formik/SingleNodeCheckbox.d.ts +8 -0
  346. package/dist/src/common/components/ui/formik/SwitchField.d.ts +4 -0
  347. package/dist/src/common/components/ui/formik/TextAreaField.d.ts +4 -0
  348. package/dist/src/common/components/ui/formik/TextAreaSecretField.d.ts +4 -0
  349. package/dist/src/common/components/ui/formik/UploadField.d.ts +4 -0
  350. package/dist/src/common/components/ui/formik/constants.d.ts +50 -0
  351. package/dist/src/common/components/ui/formik/index.d.ts +25 -0
  352. package/dist/src/common/components/ui/formik/types.d.ts +117 -0
  353. package/dist/src/common/components/ui/formik/utils.d.ts +24 -0
  354. package/dist/src/common/components/ui/formik/validationSchemas.d.ts +33 -0
  355. package/dist/src/common/components/ui/index.d.ts +23 -0
  356. package/dist/src/common/components/ui/table/index.d.ts +2 -0
  357. package/dist/src/common/components/ui/table/utils.d.ts +17 -0
  358. package/dist/src/common/components/ui/table/wrappable.d.ts +8 -0
  359. package/dist/src/common/components/ui/uiState/EmptyState.d.ts +11 -0
  360. package/dist/src/common/components/ui/uiState/ErrorState.d.ts +14 -0
  361. package/dist/src/common/components/ui/uiState/LoadingState.d.ts +8 -0
  362. package/dist/src/common/components/ui/uiState/index.d.ts +3 -0
  363. package/dist/src/common/components/ui/utils.d.ts +2 -0
  364. package/dist/src/common/config/constants.d.ts +204 -0
  365. package/dist/src/common/config/index.d.ts +1 -0
  366. package/dist/src/common/features/featureGate.d.ts +25 -0
  367. package/dist/src/common/features/index.d.ts +1 -0
  368. package/dist/src/common/hacks.d.ts +1 -0
  369. package/dist/src/common/hooks/index.d.ts +2 -0
  370. package/dist/src/common/hooks/use-translation-wrapper.d.ts +1 -0
  371. package/dist/src/common/hooks/useDeepCompareMemoize.d.ts +2 -0
  372. package/dist/src/common/hooks/useFieldErrorMsg.d.ts +8 -0
  373. package/dist/src/common/hooks/useFormikHelpers.d.ts +6 -0
  374. package/dist/src/common/hooks/useStateSafely.d.ts +3 -0
  375. package/dist/src/common/index.d.ts +10 -0
  376. package/dist/src/common/reducers/alertsSlice.d.ts +18 -0
  377. package/dist/src/common/reducers/dialogsSlice.d.ts +9 -0
  378. package/dist/src/common/reducers/index.d.ts +2 -0
  379. package/dist/src/common/selectors/clusterSelectors.d.ts +28 -0
  380. package/dist/src/common/selectors/index.d.ts +1 -0
  381. package/dist/src/common/sevices/DateAndTime.d.ts +2 -0
  382. package/dist/src/common/types/clusters.d.ts +53 -0
  383. package/dist/src/common/types/events.d.ts +22 -0
  384. package/dist/src/common/types/featureSupportLevel.d.ts +23 -0
  385. package/dist/src/common/types/hosts.d.ts +19 -0
  386. package/dist/src/common/types/index.d.ts +16 -0
  387. package/dist/src/common/types/proxyFields.d.ts +7 -0
  388. package/dist/src/common/types/typescriptExtensions.d.ts +9 -0
  389. package/dist/src/common/types/versions.d.ts +10 -0
  390. package/dist/src/common/utils.d.ts +2 -0
  391. package/dist/src/index.d.ts +2 -0
  392. package/dist/src/ocm/api/axiosClient.d.ts +6 -0
  393. package/dist/src/ocm/api/axiosExtensions.d.ts +2 -0
  394. package/dist/src/ocm/api/index.d.ts +2 -0
  395. package/dist/src/ocm/api/types.d.ts +5 -0
  396. package/dist/src/ocm/api/utils.d.ts +8 -0
  397. package/dist/src/ocm/components/AddHosts/AddHosts.d.ts +1 -0
  398. package/dist/src/ocm/components/AddHosts/InventoryAddHost.d.ts +5 -0
  399. package/dist/src/ocm/components/AddHosts/day2Wizard/Day2ClusterDetails.d.ts +2 -0
  400. package/dist/src/ocm/components/AddHosts/day2Wizard/Day2DiscoveryImageModalButton.d.ts +5 -0
  401. package/dist/src/ocm/components/AddHosts/day2Wizard/Day2DownloadISO.d.ts +2 -0
  402. package/dist/src/ocm/components/AddHosts/day2Wizard/Day2GenerateISO.d.ts +2 -0
  403. package/dist/src/ocm/components/AddHosts/day2Wizard/Day2StaticIP.d.ts +2 -0
  404. package/dist/src/ocm/components/AddHosts/day2Wizard/Day2StaticIpHostConfigurations.d.ts +2 -0
  405. package/dist/src/ocm/components/AddHosts/day2Wizard/Day2Wizard.d.ts +2 -0
  406. package/dist/src/ocm/components/AddHosts/day2Wizard/Day2WizardContext.d.ts +21 -0
  407. package/dist/src/ocm/components/AddHosts/day2Wizard/Day2WizardContextProvider.d.ts +8 -0
  408. package/dist/src/ocm/components/AddHosts/day2Wizard/Day2WizardNav.d.ts +2 -0
  409. package/dist/src/ocm/components/AddHosts/day2Wizard/constants.d.ts +6 -0
  410. package/dist/src/ocm/components/AddHosts/index.d.ts +2 -0
  411. package/dist/src/ocm/components/AddHosts/types.d.ts +46 -0
  412. package/dist/src/ocm/components/HostsClusterDetailTab/HostsClusterDetailTab.d.ts +3 -0
  413. package/dist/src/ocm/components/HostsClusterDetailTab/HostsClusterDetailTabContent.d.ts +2 -0
  414. package/dist/src/ocm/components/HostsClusterDetailTab/index.d.ts +2 -0
  415. package/dist/src/ocm/components/HostsClusterDetailTab/types.d.ts +6 -0
  416. package/dist/src/ocm/components/HostsClusterDetailTab/utils.d.ts +4 -0
  417. package/dist/src/ocm/components/Router.d.ts +8 -0
  418. package/dist/src/ocm/components/SentryErrorMonitorContextProvider.d.ts +2 -0
  419. package/dist/src/ocm/components/SingleCluster.d.ts +2 -0
  420. package/dist/src/ocm/components/clusterConfiguration/ArmCheckbox.d.ts +7 -0
  421. package/dist/src/ocm/components/clusterConfiguration/ClusterDefaultConfigurationContext.d.ts +8 -0
  422. package/dist/src/ocm/components/clusterConfiguration/DiscoveryImageForm.d.ts +9 -0
  423. package/dist/src/ocm/components/clusterConfiguration/DiscoveryImageModal.d.ts +11 -0
  424. package/dist/src/ocm/components/clusterConfiguration/DiscoveryImageSummary.d.ts +11 -0
  425. package/dist/src/ocm/components/clusterConfiguration/HostInventory.d.ts +5 -0
  426. package/dist/src/ocm/components/clusterConfiguration/HostsNetworkConfigurationControlGroup.d.ts +4 -0
  427. package/dist/src/ocm/components/clusterConfiguration/InformationAndAlerts.d.ts +5 -0
  428. package/dist/src/ocm/components/clusterConfiguration/OcmClusterDetailsFormFields.d.ts +13 -0
  429. package/dist/src/ocm/components/clusterConfiguration/OcmOpenShiftVersionSelect.d.ts +7 -0
  430. package/dist/src/ocm/components/clusterConfiguration/ReviewCluster.d.ts +6 -0
  431. package/dist/src/ocm/components/clusterConfiguration/ReviewStep.d.ts +6 -0
  432. package/dist/src/ocm/components/clusterConfiguration/networkConfiguration/AdvancedNetworkFields.d.ts +2 -0
  433. package/dist/src/ocm/components/clusterConfiguration/networkConfiguration/AvailableSubnetsControl.d.ts +8 -0
  434. package/dist/src/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.d.ts +9 -0
  435. package/dist/src/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.d.ts +5 -0
  436. package/dist/src/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationTable.d.ts +3 -0
  437. package/dist/src/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationTableBase.d.ts +18 -0
  438. package/dist/src/ocm/components/clusterConfiguration/networkConfiguration/StackTypeControl.d.ts +8 -0
  439. package/dist/src/ocm/components/clusterConfiguration/networkConfiguration/VirtualIPControlGroup.d.ts +6 -0
  440. package/dist/src/ocm/components/clusterConfiguration/networkConfiguration/networkConfigurationValidation.d.ts +4 -0
  441. package/dist/src/ocm/components/clusterConfiguration/operators/CnvCheckbox.d.ts +3 -0
  442. package/dist/src/ocm/components/clusterConfiguration/operators/CnvHostRequirements.d.ts +5 -0
  443. package/dist/src/ocm/components/clusterConfiguration/operators/LvmCheckbox.d.ts +3 -0
  444. package/dist/src/ocm/components/clusterConfiguration/operators/LvmHostRequirements.d.ts +5 -0
  445. package/dist/src/ocm/components/clusterConfiguration/operators/OdfCheckbox.d.ts +4 -0
  446. package/dist/src/ocm/components/clusterConfiguration/platformIntegration/PlatformIntegration.d.ts +5 -0
  447. package/dist/src/ocm/components/clusterConfiguration/platformIntegration/PlatformIntegrationVsphere.d.ts +2 -0
  448. package/dist/src/ocm/components/clusterConfiguration/staticIp/commonValidationSchemas.d.ts +11 -0
  449. package/dist/src/ocm/components/clusterConfiguration/staticIp/components/CollapsedHost.d.ts +11 -0
  450. package/dist/src/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/FormViewHosts.d.ts +3 -0
  451. package/dist/src/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/FormViewHostsFields.d.ts +5 -0
  452. package/dist/src/ocm/components/clusterConfiguration/staticIp/components/FormViewHosts/formViewHostsValidationSchema.d.ts +5 -0
  453. package/dist/src/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/FormViewNetworkWide.d.ts +3 -0
  454. package/dist/src/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/FormViewNetworkWideFields.d.ts +6 -0
  455. package/dist/src/ocm/components/clusterConfiguration/staticIp/components/FormViewNetworkWide/formViewNetworkWideValidationSchema.d.ts +13 -0
  456. package/dist/src/ocm/components/clusterConfiguration/staticIp/components/StaticIpForm.d.ts +3 -0
  457. package/dist/src/ocm/components/clusterConfiguration/staticIp/components/StaticIpHostsArray.d.ts +19 -0
  458. package/dist/src/ocm/components/clusterConfiguration/staticIp/components/StaticIpPage.d.ts +4 -0
  459. package/dist/src/ocm/components/clusterConfiguration/staticIp/components/StaticIpViewRadioGroup.d.ts +8 -0
  460. package/dist/src/ocm/components/clusterConfiguration/staticIp/components/YamlView/MacIpMapping.d.ts +6 -0
  461. package/dist/src/ocm/components/clusterConfiguration/staticIp/components/YamlView/YamlView.d.ts +3 -0
  462. package/dist/src/ocm/components/clusterConfiguration/staticIp/components/YamlView/YamlViewFields.d.ts +1 -0
  463. package/dist/src/ocm/components/clusterConfiguration/staticIp/components/YamlView/yamlViewValidationSchema.d.ts +3 -0
  464. package/dist/src/ocm/components/clusterConfiguration/staticIp/components/propTypes.d.ts +28 -0
  465. package/dist/src/ocm/components/clusterConfiguration/staticIp/data/dataTypes.d.ts +53 -0
  466. package/dist/src/ocm/components/clusterConfiguration/staticIp/data/dummyData.d.ts +20 -0
  467. package/dist/src/ocm/components/clusterConfiguration/staticIp/data/emptyData.d.ts +9 -0
  468. package/dist/src/ocm/components/clusterConfiguration/staticIp/data/formDataFromInfraEnvField.d.ts +3 -0
  469. package/dist/src/ocm/components/clusterConfiguration/staticIp/data/formDataToInfraEnvField.d.ts +4 -0
  470. package/dist/src/ocm/components/clusterConfiguration/staticIp/data/fromInfraEnv.d.ts +13 -0
  471. package/dist/src/ocm/components/clusterConfiguration/staticIp/data/machineNetwork.d.ts +2 -0
  472. package/dist/src/ocm/components/clusterConfiguration/staticIp/data/nmstateTypes.d.ts +60 -0
  473. package/dist/src/ocm/components/clusterConfiguration/staticIp/data/nmstateYaml.d.ts +16 -0
  474. package/dist/src/ocm/components/clusterConfiguration/staticIp/data/protocolVersion.d.ts +8 -0
  475. package/dist/src/ocm/components/clusterDetail/AssistedInstallerDetailCard.d.ts +8 -0
  476. package/dist/src/ocm/components/clusterDetail/AssistedInstallerExtraDetailCard.d.ts +7 -0
  477. package/dist/src/ocm/components/clusterDetail/CancelInstallationModal.d.ts +3 -0
  478. package/dist/src/ocm/components/clusterDetail/ClusterDetail.d.ts +7 -0
  479. package/dist/src/ocm/components/clusterDetail/ClusterDetailStatusMessages.d.ts +8 -0
  480. package/dist/src/ocm/components/clusterDetail/ClusterDetailStatusVarieties.d.ts +18 -0
  481. package/dist/src/ocm/components/clusterDetail/ClusterDetailsButtonGroup.d.ts +7 -0
  482. package/dist/src/ocm/components/clusterDetail/ClusterInstallationProgressCard.d.ts +6 -0
  483. package/dist/src/ocm/components/clusterDetail/ClusterPollingErrorModal.d.ts +2 -0
  484. package/dist/src/ocm/components/clusterDetail/ClusterProperties.d.ts +7 -0
  485. package/dist/src/ocm/components/clusterDetail/OpenShiftVersionDetail.d.ts +5 -0
  486. package/dist/src/ocm/components/clusterDetail/ProgressBarAlerts.d.ts +15 -0
  487. package/dist/src/ocm/components/clusterDetail/ResetClusterModal.d.ts +3 -0
  488. package/dist/src/ocm/components/clusterDetail/getProgressBarAlerts.d.ts +3 -0
  489. package/dist/src/ocm/components/clusterDetail/index.d.ts +5 -0
  490. package/dist/src/ocm/components/clusterDetail/utils.d.ts +7 -0
  491. package/dist/src/ocm/components/clusterWizard/ClusterDetails.d.ts +8 -0
  492. package/dist/src/ocm/components/clusterWizard/ClusterDetailsForm.d.ts +17 -0
  493. package/dist/src/ocm/components/clusterWizard/ClusterPlatformIntegrationHint.d.ts +8 -0
  494. package/dist/src/ocm/components/clusterWizard/ClusterWizard.d.ts +8 -0
  495. package/dist/src/ocm/components/clusterWizard/ClusterWizardContext.d.ts +16 -0
  496. package/dist/src/ocm/components/clusterWizard/ClusterWizardContextProvider.d.ts +8 -0
  497. package/dist/src/ocm/components/clusterWizard/ClusterWizardFooter.d.ts +11 -0
  498. package/dist/src/ocm/components/clusterWizard/ClusterWizardNavigation.d.ts +5 -0
  499. package/dist/src/ocm/components/clusterWizard/HostDiscovery.d.ts +5 -0
  500. package/dist/src/ocm/components/clusterWizard/NewClusterWizard.d.ts +3 -0
  501. package/dist/src/ocm/components/clusterWizard/Operators.d.ts +6 -0
  502. package/dist/src/ocm/components/clusterWizard/OperatorsStep.d.ts +2 -0
  503. package/dist/src/ocm/components/clusterWizard/StaticIp.d.ts +7 -0
  504. package/dist/src/ocm/components/clusterWizard/Storage.d.ts +5 -0
  505. package/dist/src/ocm/components/clusterWizard/constants.d.ts +6 -0
  506. package/dist/src/ocm/components/clusterWizard/index.d.ts +1 -0
  507. package/dist/src/ocm/components/clusterWizard/wizardTransition.d.ts +19 -0
  508. package/dist/src/ocm/components/clusters/ClusterBreadcrumbs.d.ts +7 -0
  509. package/dist/src/ocm/components/clusters/ClusterLoading.d.ts +2 -0
  510. package/dist/src/ocm/components/clusters/ClusterPage.d.ts +7 -0
  511. package/dist/src/ocm/components/clusters/ClusterPageErrors.d.ts +2 -0
  512. package/dist/src/ocm/components/clusters/ClusterStatus.d.ts +15 -0
  513. package/dist/src/ocm/components/clusters/ClusterToolbar.d.ts +7 -0
  514. package/dist/src/ocm/components/clusters/Clusters.d.ts +4 -0
  515. package/dist/src/ocm/components/clusters/ClustersListToolbar.d.ts +12 -0
  516. package/dist/src/ocm/components/clusters/ClustersTable.d.ts +8 -0
  517. package/dist/src/ocm/components/clusters/DeleteClusterModal.d.ts +8 -0
  518. package/dist/src/ocm/components/clusters/NewClusterPage.d.ts +2 -0
  519. package/dist/src/ocm/components/clusters/clusterPolling.d.ts +17 -0
  520. package/dist/src/ocm/components/clusters/index.d.ts +5 -0
  521. package/dist/src/ocm/components/clusters/utils.d.ts +11 -0
  522. package/dist/src/ocm/components/featureSupportLevels/FeatureSupportLevelProvider.d.ts +11 -0
  523. package/dist/src/ocm/components/featureSupportLevels/ReviewClusterFeatureSupportLevels.d.ts +13 -0
  524. package/dist/src/ocm/components/featureSupportLevels/featureStateUtils.d.ts +6 -0
  525. package/dist/src/ocm/components/featureSupportLevels/index.d.ts +2 -0
  526. package/dist/src/ocm/components/fetching/fetchEvents.d.ts +2 -0
  527. package/dist/src/ocm/components/hosts/AdditionaNTPSourceDialogToggle.d.ts +1 -0
  528. package/dist/src/ocm/components/hosts/ClusterHostsTable.d.ts +9 -0
  529. package/dist/src/ocm/components/hosts/DeleteHostModal.d.ts +8 -0
  530. package/dist/src/ocm/components/hosts/HardwareStatus.d.ts +21 -0
  531. package/dist/src/ocm/components/hosts/HostRequirementsContent.d.ts +8 -0
  532. package/dist/src/ocm/components/hosts/HostsDiscoveryTable.d.ts +6 -0
  533. package/dist/src/ocm/components/hosts/HostsDiscoveryTroubleshootingInfoLinkWithModal.d.ts +5 -0
  534. package/dist/src/ocm/components/hosts/HostsStorageTable.d.ts +7 -0
  535. package/dist/src/ocm/components/hosts/HostsTableEmptyState.d.ts +5 -0
  536. package/dist/src/ocm/components/hosts/ModalDialogsContext.d.ts +53 -0
  537. package/dist/src/ocm/components/hosts/NetworkingStatus.d.ts +4 -0
  538. package/dist/src/ocm/components/hosts/OdfDisksManualFormattingHint.d.ts +2 -0
  539. package/dist/src/ocm/components/hosts/ResetHostModal.d.ts +9 -0
  540. package/dist/src/ocm/components/hosts/StorageAlerts.d.ts +5 -0
  541. package/dist/src/ocm/components/hosts/UpdateDay2ApiVipDialogToggle.d.ts +2 -0
  542. package/dist/src/ocm/components/hosts/UpdateDay2ApiVipForm.d.ts +11 -0
  543. package/dist/src/ocm/components/hosts/UpdateDay2ApiVipModal.d.ts +7 -0
  544. package/dist/src/ocm/components/hosts/use-hosts-table.d.ts +39 -0
  545. package/dist/src/ocm/components/hosts/utils.d.ts +4 -0
  546. package/dist/src/ocm/components/index.d.ts +7 -0
  547. package/dist/src/ocm/components/ui/AssistedUILibVersion.d.ts +2 -0
  548. package/dist/src/ocm/components/ui/InfoLinkWithModal.d.ts +11 -0
  549. package/dist/src/ocm/components/ui/OcmFormFields.d.ts +22 -0
  550. package/dist/src/ocm/components/ui/index.d.ts +1 -0
  551. package/dist/src/ocm/config/constants.d.ts +8 -0
  552. package/dist/src/ocm/config/index.d.ts +2 -0
  553. package/dist/src/ocm/config/routeBaseBath.d.ts +2 -0
  554. package/dist/src/ocm/hooks/index.d.ts +7 -0
  555. package/dist/src/ocm/hooks/useClusterPreflightRequirements.d.ts +7 -0
  556. package/dist/src/ocm/hooks/useClusterSupportedPlatforms.d.ts +10 -0
  557. package/dist/src/ocm/hooks/useInfraEnv.d.ts +7 -0
  558. package/dist/src/ocm/hooks/useInfraEnvId.d.ts +5 -0
  559. package/dist/src/ocm/hooks/useInfraEnvImageUrl.d.ts +9 -0
  560. package/dist/src/ocm/hooks/useManagedDomains.d.ts +2 -0
  561. package/dist/src/ocm/hooks/useOpenshiftVersions.d.ts +15 -0
  562. package/dist/src/ocm/hooks/usePullSecret.d.ts +1 -0
  563. package/dist/src/ocm/hooks/useSetClusterPermissions.d.ts +2 -0
  564. package/dist/src/ocm/hooks/useUsedClusterNames.d.ts +4 -0
  565. package/dist/src/ocm/index.d.ts +11 -0
  566. package/dist/src/ocm/reducers/clusters/clustersSlice.d.ts +25 -0
  567. package/dist/src/ocm/reducers/clusters/currentClusterSlice.d.ts +130 -0
  568. package/dist/src/ocm/reducers/clusters/index.d.ts +2 -0
  569. package/dist/src/ocm/selectors/clusters.d.ts +61 -0
  570. package/dist/src/ocm/selectors/currentCluster.d.ts +13 -0
  571. package/dist/src/ocm/selectors/index.d.ts +2 -0
  572. package/dist/src/ocm/sentry.d.ts +2 -0
  573. package/dist/src/ocm/services/ClusterDetailsService.d.ts +14 -0
  574. package/dist/src/ocm/services/ClustersService.d.ts +16 -0
  575. package/dist/src/ocm/services/CpuArchitectureService.d.ts +14 -0
  576. package/dist/src/ocm/services/Day2ClusterService.d.ts +87 -0
  577. package/dist/src/ocm/services/DiscoveryImageFormService.d.ts +9 -0
  578. package/dist/src/ocm/services/DiskEncryptionService.d.ts +6 -0
  579. package/dist/src/ocm/services/HostDiscoveryService.d.ts +6 -0
  580. package/dist/src/ocm/services/HostsService.d.ts +20 -0
  581. package/dist/src/ocm/services/InfraEnvIdsCacheService.d.ts +9 -0
  582. package/dist/src/ocm/services/InfraEnvsService.d.ts +13 -0
  583. package/dist/src/ocm/services/OperatorsService.d.ts +11 -0
  584. package/dist/src/ocm/services/apis/ClustersAPI.d.ts +35 -0
  585. package/dist/src/ocm/services/apis/ComponentVersionsAPI.d.ts +6 -0
  586. package/dist/src/ocm/services/apis/EventsAPI.d.ts +7 -0
  587. package/dist/src/ocm/services/apis/FeatureSupportLevelsAPI.d.ts +6 -0
  588. package/dist/src/ocm/services/apis/HostsAPI.d.ts +14 -0
  589. package/dist/src/ocm/services/apis/InfraEnvsAPI.d.ts +17 -0
  590. package/dist/src/ocm/services/apis/ManagedDomainsAPI.d.ts +6 -0
  591. package/dist/src/ocm/services/apis/SupportedOpenshiftVersionsAPI.d.ts +6 -0
  592. package/dist/src/ocm/services/apis/index.d.ts +8 -0
  593. package/dist/src/ocm/services/apis/types.d.ts +13 -0
  594. package/dist/src/ocm/services/index.d.ts +10 -0
  595. package/dist/src/ocm/services/types.d.ts +11 -0
  596. package/dist/src/ocm/store/index.d.ts +36 -0
  597. package/dist/src/ocm/store/slices/infraEnvs/slice.d.ts +3 -0
  598. package/dist/src/ocm/types.d.ts +5 -0
  599. package/package.json +148 -0
package/dist/index.js ADDED
@@ -0,0 +1,37 @@
1
+ var GM=Object.create;var Tm=Object.defineProperty;var UM=Object.getOwnPropertyDescriptor;var KM=Object.getOwnPropertyNames;var $M=Object.getPrototypeOf,qM=Object.prototype.hasOwnProperty;var JI=e=>Tm(e,"__esModule",{value:!0});var YM=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Zr=(e,t)=>{JI(e);for(var o in t)Tm(e,o,{get:t[o],enumerable:!0})},jM=(e,t,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of KM(t))!qM.call(e,r)&&r!=="default"&&Tm(e,r,{get:()=>t[r],enumerable:!(o=UM(t,r))||o.enumerable});return e},XM=e=>jM(JI(Tm(e!=null?GM($M(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var gx=YM((Wxe,Nd)=>{var Yk,jk,Xk,Jk,Zk,Qk,ex,tx,ox,Ed,vy,rx,sx,nx,ql,ix,ax,lx,px,cx,ux,mx,dx,fx,Fd;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(r){e(o(t,o(r)))}):typeof Nd=="object"&&typeof Nd.exports=="object"?e(o(t,o(Nd.exports))):e(o(t));function o(r,s){return r!==t&&(typeof Object.create=="function"?Object.defineProperty(r,"__esModule",{value:!0}):r.__esModule=!0),function(n,i){return r[n]=s?s(n,i):i}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(r[n]=s[n])};Yk=function(r,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");t(r,s);function n(){this.constructor=r}r.prototype=s===null?Object.create(s):(n.prototype=s.prototype,new n)},jk=Object.assign||function(r){for(var s,n=1,i=arguments.length;n<i;n++){s=arguments[n];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(r[a]=s[a])}return r},Xk=function(r,s){var n={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&s.indexOf(i)<0&&(n[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,i=Object.getOwnPropertySymbols(r);a<i.length;a++)s.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(r,i[a])&&(n[i[a]]=r[i[a]]);return n},Jk=function(r,s,n,i){var a=arguments.length,l=a<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,n):i,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(r,s,n,i);else for(var c=r.length-1;c>=0;c--)(p=r[c])&&(l=(a<3?p(l):a>3?p(s,n,l):p(s,n))||l);return a>3&&l&&Object.defineProperty(s,n,l),l},Zk=function(r,s){return function(n,i){s(n,i,r)}},Qk=function(r,s){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,s)},ex=function(r,s,n,i){function a(l){return l instanceof n?l:new n(function(p){p(l)})}return new(n||(n=Promise))(function(l,p){function c(d){try{m(i.next(d))}catch(g){p(g)}}function u(d){try{m(i.throw(d))}catch(g){p(g)}}function m(d){d.done?l(d.value):a(d.value).then(c,u)}m((i=i.apply(r,s||[])).next())})},tx=function(r,s){var n={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},i,a,l,p;return p={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function c(m){return function(d){return u([m,d])}}function u(m){if(i)throw new TypeError("Generator is already executing.");for(;n;)try{if(i=1,a&&(l=m[0]&2?a.return:m[0]?a.throw||((l=a.return)&&l.call(a),0):a.next)&&!(l=l.call(a,m[1])).done)return l;switch(a=0,l&&(m=[m[0]&2,l.value]),m[0]){case 0:case 1:l=m;break;case 4:return n.label++,{value:m[1],done:!1};case 5:n.label++,a=m[1],m=[0];continue;case 7:m=n.ops.pop(),n.trys.pop();continue;default:if(l=n.trys,!(l=l.length>0&&l[l.length-1])&&(m[0]===6||m[0]===2)){n=0;continue}if(m[0]===3&&(!l||m[1]>l[0]&&m[1]<l[3])){n.label=m[1];break}if(m[0]===6&&n.label<l[1]){n.label=l[1],l=m;break}if(l&&n.label<l[2]){n.label=l[2],n.ops.push(m);break}l[2]&&n.ops.pop(),n.trys.pop();continue}m=s.call(r,n)}catch(d){m=[6,d],a=0}finally{i=l=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},ox=function(r,s){for(var n in r)n!=="default"&&!Object.prototype.hasOwnProperty.call(s,n)&&Fd(s,r,n)},Fd=Object.create?function(r,s,n,i){i===void 0&&(i=n);var a=Object.getOwnPropertyDescriptor(s,n);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[n]}}),Object.defineProperty(r,i,a)}:function(r,s,n,i){i===void 0&&(i=n),r[i]=s[n]},Ed=function(r){var s=typeof Symbol=="function"&&Symbol.iterator,n=s&&r[s],i=0;if(n)return n.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},vy=function(r,s){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var i=n.call(r),a,l=[],p;try{for(;(s===void 0||s-- >0)&&!(a=i.next()).done;)l.push(a.value)}catch(c){p={error:c}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(p)throw p.error}}return l},rx=function(){for(var r=[],s=0;s<arguments.length;s++)r=r.concat(vy(arguments[s]));return r},sx=function(){for(var r=0,s=0,n=arguments.length;s<n;s++)r+=arguments[s].length;for(var i=Array(r),a=0,s=0;s<n;s++)for(var l=arguments[s],p=0,c=l.length;p<c;p++,a++)i[a]=l[p];return i},nx=function(r,s,n){if(n||arguments.length===2)for(var i=0,a=s.length,l;i<a;i++)(l||!(i in s))&&(l||(l=Array.prototype.slice.call(s,0,i)),l[i]=s[i]);return r.concat(l||Array.prototype.slice.call(s))},ql=function(r){return this instanceof ql?(this.v=r,this):new ql(r)},ix=function(r,s,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(r,s||[]),a,l=[];return a={},p("next"),p("throw"),p("return"),a[Symbol.asyncIterator]=function(){return this},a;function p(C){i[C]&&(a[C]=function(h){return new Promise(function(S,v){l.push([C,h,S,v])>1||c(C,h)})})}function c(C,h){try{u(i[C](h))}catch(S){g(l[0][3],S)}}function u(C){C.value instanceof ql?Promise.resolve(C.value.v).then(m,d):g(l[0][2],C)}function m(C){c("next",C)}function d(C){c("throw",C)}function g(C,h){C(h),l.shift(),l.length&&c(l[0][0],l[0][1])}},ax=function(r){var s,n;return s={},i("next"),i("throw",function(a){throw a}),i("return"),s[Symbol.iterator]=function(){return this},s;function i(a,l){s[a]=r[a]?function(p){return(n=!n)?{value:ql(r[a](p)),done:a==="return"}:l?l(p):p}:l}},lx=function(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=r[Symbol.asyncIterator],n;return s?s.call(r):(r=typeof Ed=="function"?Ed(r):r[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(l){n[l]=r[l]&&function(p){return new Promise(function(c,u){p=r[l](p),a(c,u,p.done,p.value)})}}function a(l,p,c,u){Promise.resolve(u).then(function(m){l({value:m,done:c})},p)}},px=function(r,s){return Object.defineProperty?Object.defineProperty(r,"raw",{value:s}):r.raw=s,r};var o=Object.create?function(r,s){Object.defineProperty(r,"default",{enumerable:!0,value:s})}:function(r,s){r.default=s};cx=function(r){if(r&&r.__esModule)return r;var s={};if(r!=null)for(var n in r)n!=="default"&&Object.prototype.hasOwnProperty.call(r,n)&&Fd(s,r,n);return o(s,r),s},ux=function(r){return r&&r.__esModule?r:{default:r}},mx=function(r,s,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof s=="function"?r!==s||!i:!s.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(r):i?i.value:s.get(r)},dx=function(r,s,n,i,a){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof s=="function"?r!==s||!a:!s.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?a.call(r,n):a?a.value=n:s.set(r,n),n},fx=function(r,s){if(s===null||typeof s!="object"&&typeof s!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?s===r:r.has(s)},e("__extends",Yk),e("__assign",jk),e("__rest",Xk),e("__decorate",Jk),e("__param",Zk),e("__metadata",Qk),e("__awaiter",ex),e("__generator",tx),e("__exportStar",ox),e("__createBinding",Fd),e("__values",Ed),e("__read",vy),e("__spread",rx),e("__spreadArrays",sx),e("__spreadArray",nx),e("__await",ql),e("__asyncGenerator",ix),e("__asyncDelegator",ax),e("__asyncValues",lx),e("__makeTemplateObject",px),e("__importStar",cx),e("__importDefault",ux),e("__classPrivateFieldGet",mx),e("__classPrivateFieldSet",dx),e("__classPrivateFieldIn",fx)})});var cE={};Zr(cE,{ACMClusterDeploymentDetailsStep:()=>rD,ACMFeatureSupportLevelProvider:()=>qf,ACM_ENABLED_FEATURES:()=>Ab,AGENT_AUTO_SELECT_ANNOTATION_KEY:()=>rp,AGENT_BMH_NAME_LABEL_KEY:()=>zo,AGENT_LOCATION_LABEL_KEY:()=>st,AGENT_NOLOCATION_VALUE:()=>wi,AGENT_SELECTOR:()=>op,AddBmcHostModal:()=>kf,AddBmcHostYamlModal:()=>Tf,AddButton:()=>hc,AddHostDropdown:()=>Ef,AddHostModal:()=>df,AdditionalNTPSourcesDialogToggle:()=>nu,AdditionalNTPSourcesField:()=>xn,AgentAlerts:()=>HA,AgentTable:()=>uD,Alerts:()=>mr,AlertsContextProvider:()=>ur,BMCForm:()=>mp,BMH_HOSTNAME_ANNOTATION:()=>js,CPU_ARCHITECTURE_ANNOTATION_KEY:()=>Ky,ChangeHostnameAction:()=>Kl,CheckboxField:()=>eo,CimConfigProgressAlert:()=>E4,CimConfigurationModal:()=>j4,CimIsMissingAlert:()=>Q4,CimStorageMissingAlert:()=>I4,ClusterCredentials:()=>jl,ClusterDeploymentCreateProgress:()=>pD,ClusterDeploymentCredentials:()=>Vf,ClusterDeploymentDetails:()=>YA,ClusterDeploymentKubeconfigDownload:()=>Hf,ClusterDeploymentProgress:()=>iw,ClusterDeploymentValidationsOverview:()=>UA,ClusterDeploymentWizard:()=>Qw,ClusterEventsList:()=>Hc,ClusterEventsToolbar:()=>Vc,ClusterInstallationError:()=>oD,ClusterInstallationProgress:()=>pE,ClusterProgress:()=>xi,ClusterPropertiesList:()=>Bd,ClusterVersionConditionType:()=>Oh,CodeField:()=>Ca,ConfirmationModal:()=>Fn,CpuArchitecture:()=>_,DeleteHostAction:()=>$l,DetailItem:()=>N,DetailList:()=>bt,DeveloperPreview:()=>dc,DiscoveryImageConfigForm:()=>Jc,DiscoveryInstructions:()=>ep,DiscoveryTroubleshootingModal:()=>Ln,DiscoveryTroubleshootingModalContent:()=>qd,DownloadIso:()=>Ai,DownloadIsoModal:()=>bT,EditAgentModal:()=>pp,EditBMHModal:()=>ff,EditHostModal:()=>Wl,EmptyState:()=>ot,EnvironmentDetails:()=>GT,EnvironmentErrors:()=>Va,ErrorState:()=>j,EventsList:()=>ka,EventsModal:()=>xa,EventsModalButton:()=>Ol,ExternalLink:()=>tt,FORBIDDEN_HOSTNAMES:()=>Pl,FeatureGateContext:()=>zm,FeatureGateContextProvider:()=>ci,FormatDiskWarning:()=>tp,FormikAutoSave:()=>pa,FormikStaticField:()=>hi,GridGap:()=>Pa,HelperText:()=>Q,HostRequirements:()=>Dd,HostRequirementsList:()=>Sy,HostStatus:()=>Ls,HostValidationGroups:()=>fy,HostedClusterDetailsStep:()=>CD,HostedClusterHostsStep:()=>AD,HostedClusterNetworkStep:()=>FD,Hostname:()=>vi,HostsCount:()=>Bl,HostsNotShowingLink:()=>Zc,INFRAENV_AGENTINSTALL_LABEL_KEY:()=>Co,INFRAENV_GENERATED_AI_FLOW:()=>Uy,IPv4ValidationSchema:()=>Fl,InfoAndTroubleshootingNotification:()=>ET,InfraEnvAgentTable:()=>FA,InfraEnvFormPage:()=>e6,InfraEnvHostsTabAgentsWarning:()=>NA,InputField:()=>J,KubeconfigDownload:()=>Ti,LOCAL_STORAGE_ID_LAST_UPDATE_TIMESTAMP:()=>Pf,LabelField:()=>ud,LabelValue:()=>Pc,LoadingState:()=>z,LogsDownloadButton:()=>GS,MassApproveAgentModal:()=>hp,MassChangeHostnameModal:()=>ki,MassDeleteAgentModal:()=>bf,MassDeleteHostModal:()=>Yl,ModalProgress:()=>En,MultiSelectField:()=>la,NetworkConfiguration:()=>Gf,NodePoolsTable:()=>sg,NonPlatformIntegrations:()=>bC,NumberInputField:()=>ns,OcmCpuArchitecture:()=>Nr,OpenShiftVersionSelect:()=>Jl,PencilEditField:()=>Cc,PopoverIcon:()=>H,PreviewBadgePosition:()=>ha,PrismCode:()=>kt,ProxyFields:()=>Gs,ProxyInputFields:()=>Ql,PullSecretField:()=>As,PullSecretInfo:()=>uc,REQUIRED_AGENT_CONDITION_TYPES:()=>NT,RadioField:()=>ie,Reducers:()=>Oc,RemovableField:()=>ya,RenderIf:()=>ae,ResourceUIState:()=>ue,RichInputField:()=>fo,RoleCell:()=>zc,RoleDropdown:()=>Td,SINGLE_CLUSTER_ENABLED_FEATURES:()=>wb,SNOControlGroup:()=>Xl,SNODisclaimer:()=>Gd,STANDALONE_DEPLOYMENT_ENABLED_FEATURES:()=>Db,ScaleUpModal:()=>XP,SecurityFields:()=>Zl,SelectField:()=>es,SimpleDropdown:()=>Cd,SingleNodeCheckbox:()=>gc,StaticField:()=>md,StaticIPInfo:()=>$d,StaticTextField:()=>Vs,SupportedCpuArchitectures:()=>ga,SupportedPlatformIntegrations:()=>IC,SwitchField:()=>Fr,TableToolbar:()=>bi,TechnologyPreview:()=>fc,TextAreaField:()=>Qr,TextAreaSecretField:()=>Xh,ToolbarButton:()=>Rt,ToolbarSecondaryGroup:()=>wc,ToolbarText:()=>ty,ToolbarrProgress:()=>ry,UploadField:()=>oc,UploadSSH:()=>Ws,VMRebootConfigurationInfo:()=>Ul,WizardFooter:()=>Lr,WizardNavItem:()=>Oo,acmClusterNameValidationMessages:()=>td,allClusterWizardSoftValidationIds:()=>Uh,allSubnetsIPv4:()=>Vm,areOnlySoftValidationsFailing:()=>BC,bmcAddressValidationMessages:()=>od,bmcAddressValidationSchema:()=>nd,breakWord:()=>Jb,canBeDualStack:()=>KC,canDelete:()=>NC,canDisable:()=>FC,canDownloadClusterLogs:()=>di,canDownloadHostLogs:()=>Xm,canDownloadKubeconfig:()=>Il,canEditDisks:()=>LC,canEditHost:()=>Sc,canEditHostname:()=>MC,canEditRole:()=>HC,canEnable:()=>EC,canHostnameBeChanged:()=>OC,canInstallHost:()=>vc,canNextFromHostDiscoveryStep:()=>$h,canNextFromHostSelectionStep:()=>Kh,canNextFromNetworkingStep:()=>qh,canNextFromReviewStep:()=>Yh,canReset:()=>VC,canSelectNetworkTypeSDN:()=>kc,clusterNameValidationMessages:()=>xo,clusterNetworksEqual:()=>GC,clusterNetworksValidationSchema:()=>ld,convertOCPtoCIMResourceHeader:()=>Pm,convertToBaseValue:()=>Wh,day2ApiVipValidationSchema:()=>Dl,dnsNameValidationSchema:()=>ba,dualStackValidationSchema:()=>El,fileSize:()=>_t,filterByHostname:()=>RC,filterValidationsInfoByGroup:()=>hR,filterValidationsInfoByStatus:()=>jC,fitContent:()=>fd,formatBytesAsGiB:()=>bL,formatBytesAsMiB:()=>IL,formatCores:()=>kL,formatEventsData:()=>rP,formatToFractionalDigits:()=>wm,getAICluster:()=>Gt,getAIHosts:()=>Xs,getAgentClusterInstall:()=>l6,getAgentClusterInstallOfAgent:()=>oS,getAgentLocationMatchExpression:()=>w8,getAgentProgress:()=>qy,getAgentRole:()=>$y,getAgentSelectorFieldsFromAnnotations:()=>eu,getAgentStatus:()=>ut,getAgentStatusFromConditions:()=>i8,getAgentsForSelection:()=>ps,getAgentsHostsNames:()=>pu,getAnnotationsFromAgentSelector:()=>b8,getBMHStatus:()=>Ys,getBareMetalHost:()=>E8,getBareMetalHostCredentialsSecret:()=>D8,getClusterApiUrl:()=>k8,getClusterDeploymentCpuArchitecture:()=>Rn,getClusterDeploymentForInfraEnv:()=>a6,getClusterDeploymentResource:()=>Xy,getClusterNameOfAgent:()=>Yy,getClusterProperties:()=>Zy,getClusterStatus:()=>Wt,getClusterStatusFromConditions:()=>s8,getColSpanRow:()=>dd,getConsoleUrl:()=>Jy,getCurrentClusterVersion:()=>P8,getDateTimeCell:()=>Ll,getDefaultNetworkType:()=>fi,getDefaultOpenShiftVersion:()=>ml,getDuplicates:()=>tc,getEnabledHostCount:()=>kl,getEnabledHosts:()=>An,getFailingAgentConditions:()=>x8,getFailingHostValidations:()=>Gb,getFailingResourceConditions:()=>eS,getFieldId:()=>E,getFormikArrayItemFieldName:()=>aa,getFormikErrorFields:()=>uo,getFormikObjectItemFieldName:()=>cb,getGridSpans:()=>cu,getHardwareTypeText:()=>_C,getHostDiscoveryInitialValues:()=>qC,getHostNetworks:()=>Gy,getHostProgress:()=>Ym,getHostProgressStageNumber:()=>Ic,getHostProgressStages:()=>bl,getHostRole:()=>jm,getHostSubnets:()=>wn,getHostname:()=>Ot,getHumanizedDateTime:()=>to,getHumanizedSubnet:()=>Ub,getHumanizedSubnetRange:()=>Zm,getHumanizedTime:()=>Xb,getInfraEnv:()=>c6,getInfraEnvDocs:()=>Qc,getInfraEnvNameOfAgent:()=>_n,getInventory:()=>we,getIsSNOCluster:()=>_r,getLabels:()=>WS,getLocationsFromMatchExpressions:()=>A8,getMajorMinorVersion:()=>tS,getNetworkConfigurationValidationSchema:()=>g6,getNetworkInitialValues:()=>US,getOCPVersions:()=>Js,getOnFetchEventsHandler:()=>Q1,getReadyHostCount:()=>bc,getRichTextValidation:()=>mo,getSecret:()=>p6,getSelectedVersion:()=>tu,getStorageInitialValues:()=>YC,getStorageSizeGiB:()=>ou,getSubnet:()=>as,getSubnetFromMachineNetworkCidr:()=>zC,getSupportedCM:()=>dD,getTotalCompute:()=>bS,getTotalHostCount:()=>xl,getType:()=>Rh,getVersionFromReleaseImage:()=>sp,getWarningMessage:()=>ru,getWizardStepAgentStatus:()=>qs,hasProp:()=>xC,hostPrefixValidationSchema:()=>Dn,hostStatus:()=>Vn,hostSubnetValidationSchema:()=>Ia,hostToAgent:()=>p8,hostnameValidationMessages:()=>Mr,httpProxyValidationSchema:()=>Mo,humanizeBinaryBytes:()=>sL,humanizeBinaryBytesWithoutB:()=>rL,humanizeCpuCores:()=>uL,humanizeDecimalBytes:()=>nL,humanizeDecimalBytesPerSec:()=>iL,humanizeNumber:()=>lL,humanizeNumberSI:()=>pL,humanizePacketsPerSec:()=>aL,humanizePercentage:()=>mL,humanizeSeconds:()=>cL,ipBlockValidationSchema:()=>pr,ipValidationSchema:()=>sd,isAdvNetworkConf:()=>UC,isAgentOfCluster:()=>lu,isAgentOfInfraEnv:()=>au,isCIMConfigProgressing:()=>Cu,isCIMConfigured:()=>wS,isCIMEnabled:()=>k4,isCIMFlow:()=>Na,isDraft:()=>n8,isDualStack:()=>va,isInstallationInProgress:()=>cS,isInstallationReady:()=>uS,isNonNullObject:()=>kC,isPreviewSupportLevel:()=>mc,isStorageConfigured:()=>x4,isSubnetInIPv6:()=>xc,labelsToArray:()=>ub,locationValidationMessages:()=>Tl,locationValidationSchema:()=>id,macAddressValidationSchema:()=>Ds,machineNetworksValidationSchema:()=>ad,nameValidationMessages:()=>gi,nameValidationSchema:()=>Al,noPadding:()=>gd,noProxyValidationSchema:()=>Fs,nowrap:()=>Zb,ntpSourceValidationSchema:()=>wl,ocmClusterNameValidationMessages:()=>Qm,parseStringLabels:()=>Nm,pullSecretValidationSchema:()=>ws,removeProtocolFromURL:()=>Dm,resetCimConfigProgressAlertSuccessStatus:()=>NS,richNameValidationSchema:()=>Es,rowSorter:()=>Ml,secondsToNanoSeconds:()=>vL,serviceNetworkValidationSchema:()=>pd,serviceNetworksEqual:()=>WC,shouldShowClusterCredentials:()=>lS,shouldShowClusterDeploymentValidationOverview:()=>X1,shouldShowClusterInstallationError:()=>J1,shouldShowClusterInstallationProgress:()=>pS,sshPublicKeyValidationSchema:()=>go,stringToJSON:()=>G,toSentence:()=>To,trimCommaSeparatedList:()=>Er,trimSshPublicKey:()=>Sn,truncate:()=>Qb,uniqueOcmClusterNameValidationMessages:()=>ed,units:()=>SL,useAlerts:()=>M,useFeature:()=>rs,useFormikAutoSave:()=>lr,validate:()=>ec,vipRangeValidationSchema:()=>ZC,vipValidationSchema:()=>ls,wizardStepsValidationsMap:()=>Dr,wrappable:()=>ek});var Oh;(function(i){i.Available="Available",i.Failing="Failing",i.Progressing="Progressing",i.RetrievedUpdates="RetrievedUpdates",i.Invalid="Invalid",i.Upgradeable="Upgradeable"})(Oh||(Oh={}));var Pm=e=>({apiVersion:e.apiVersion||"",kind:e.kind||"",metadata:e.metadata});import ZI from"lodash/defaults";import JM from"lodash/findIndex";import ZM from"lodash/isPlainObject";import QM from"lodash/isString";import eL from"lodash/toNumber";var _h={numeric:{units:["","k","m","b"],space:!1,divisor:1e3},decimalBytes:{units:["B","KB","MB","GB","TB","PB","EB"],space:!0,divisor:1e3},decimalBytesWithoutB:{units:["","k","M","G","T","P","E"],space:!0,divisor:1e3},binaryBytes:{units:["B","KiB","MiB","GiB","TiB","PiB"],space:!0,divisor:1024},binaryBytesWithoutB:{units:["i","Ki","Mi","Gi","Ti","Pi","Ei"],space:!0,divisor:1024},SI:{units:["","k","M","G","T","P","E"],space:!1,divisor:1e3},decimalBytesPerSec:{units:["Bps","KBps","MBps","GBps","TBps","PBps","EBps"],space:!0,divisor:1e3},packetsPerSec:{units:["pps","kpps"],space:!0,divisor:1e3},seconds:{units:["ns","\u03BCs","ms","s"],space:!0,divisor:1e3}},Rh=e=>{let t=_h[e];return ZM(t)?t:{units:[],space:!1,divisor:1e3}},QI=(e,t,o,r,s)=>{let n=r?t.indexOf(r):0,i=t.slice(n);if(s||s===""){let l=i.indexOf(s);if(l!==-1)return{value:e/o**l,unit:s}}let a=i.shift();for(;e>=o&&i.length>0;)e=e/o,a=i.shift();return{value:e,unit:a}},tL=(e,t,o)=>{let r={value:0,unit:void 0};if(typeof e!="string")return r;let s=t.slice().reverse(),n=-1,i=JM(s,function(p){let c=e.indexOf(p);return c>-1?(n=c,!0):!1});if(i<=0)return r;s=s.slice(i),e=e.substring(0,n);let a=eL(e),l=s.shift();for(;s.length>0;)a=a*o,l=s.shift();return{value:a,unit:l}},eb=e=>e<1?3:e<100?2:1,tb=(e,t)=>{let o=eb(e),{locales:r,...s}=ZI(t,{maximumFractionDigits:o});return(!isFinite(e)||e===0)&&(e=0),Intl.NumberFormat(r,s).format(e)},Am=(e,t=10)=>{if(!isFinite(e))return 0;let o=Math.pow(10,t||eb(e));return Math.round(e*o)/o},yn=(e,t,o=!1,r,s)=>{let n=Rh(t);isFinite(e)||(e=0);let i=QI(e,n.units,n.divisor,r,s);return o&&(i.value=Am(i.value),i=QI(i.value,n.units,n.divisor,i.unit,s)),{string:`${tb(i.value)}${n.space?" ":""}${i.unit||""}`,unit:i.unit,value:i.value}},Bh=(e,t)=>{let o=Rh(t);return tL(e,o.units,o.divisor)},oL=(e,t)=>{let{locales:o,...r}=ZI({style:"percent"},t,{maximumFractionDigits:1});return Intl.NumberFormat(o,r).format(e)},rL=(e,t,o)=>yn(e,"binaryBytesWithoutB",!0,t,o),sL=(e,t,o)=>yn(e,"binaryBytes",!0,t,o),nL=(e,t,o)=>yn(e,"decimalBytes",!0,t,o),iL=(e,t,o)=>yn(e,"decimalBytesPerSec",!0,t,o),aL=(e,t,o)=>yn(e,"packetsPerSec",!0,t,o),lL=(e,t,o)=>yn(e,"numeric",!0,t,o),pL=(e,t,o)=>yn(e,"SI",!0,t,o),cL=(e,t,o)=>yn(e,"seconds",!0,t,o),uL=e=>{let t=e<1?Am(e*1e3):e,o=e<1?"m":"";return{string:`${tb(t)}${o}`,unit:o,value:t}},mL=e=>((!isFinite(e)||e===0)&&(e=0),{string:oL(e/100),unit:"%",value:Am(e,1)}),zh=e=>{if(!(e===null||e.length===0)&&e.search(/\s/g)!==-1)return"white space is not allowed"},cl=e=>{if(e<0)return"must be positive";if(!isFinite(e))return"must be a number"},dL=new Set(["m",""]),fL=(e="")=>{if(!dL.has(e))return`unrecongnized unit: ${e}`},gL=new Set(["E","P","T","G","M","k","Pi","Ti","Gi","Mi","Ki"]),hL=(e="")=>{if(!gL.has(e))return`unrecongnized unit: ${e}`},CL=new Set(["s","m","h","d","M","y"]),yL=(e="")=>{if(!CL.has(e))return`unrecongnized unit: ${e}`},SL={round:Am,humanize:yn,dehumanize:Bh},ec={split:e=>{let t=e.search(/([a-zA-Z]+)/g),o,r;return t===-1?o=e:(o=e.slice(0,t),r=e.slice(t)),[parseFloat(o),r]},CPU:(e="")=>{if(!e)return;let t=zh(e);if(t)return t;let[o,r]=ec.split(e),s=parseFloat(o||"");return r?cl(s)||fL(r):cl(s)},time:(e="")=>{if(!e)return;let t=zh(e);if(t)return t;let[o,r]=ec.split(e),s=parseFloat(o||"");return r?cl(s)||yL(r):"number and unit required"},memory:(e="")=>{if(!e)return;let t=zh(e);if(t)return t;let[o,r]=ec.split(e),s=parseFloat(o||"");return r?cl(s)||hL(r):cl(parseFloat(e))}},Wh=e=>{if(!QM(e))return null;let[t,o]=ec.split(e),r=parseFloat(t||"");return cl(r)?null:o?o==="m"?r/1e3:_h.binaryBytesWithoutB.units.includes(o)?Bh(e,"binaryBytesWithoutB").value:_h.decimalBytesWithoutB.units.includes(o)?Bh(e,"decimalBytesWithoutB").value:null:r},vL=e=>{let t=Number(e);return Number.isFinite(t)?t*1e3**3:0},wm=(e,t)=>Intl.NumberFormat(void 0,{minimumFractionDigits:t,maximumFractionDigits:t}).format(e),IL=e=>{let t=e/1024/1024;return wm(t,1)},bL=e=>{let t=e/1024/1024/1024;return wm(t,2)},kL=e=>wm(e,3);import ob from"lodash/values";import rb from"lodash/keys";import sb from"lodash/reduce";import xL from"lodash/camelCase";var G=e=>{let t;if(e)try{let o=e.replace(/"([\w-]+)":/g,(r,s)=>`"${xL(s)}":`);t=JSON.parse(o)}catch(o){console.error("Failed to parse api string",o,e)}else console.info("Empty api string received.");return t},Dm=(e="")=>e.replace(/^(http|https):\/\//,"");var nb=({validationId:e,hostGroup:t,clusterGroup:o},r)=>rb(r).find(n=>{let{cluster:i,host:a}=r[n];return i.validationIds.includes(e)||a.validationIds.includes(e)||o&&i.groups.includes(o)||t&&a.groups.includes(t)}),TL=(e,t)=>{let o=ob(e).flat().filter(r=>r&&t.includes(r.id));return o.length===t.length&&o.every(r=>r?.status==="disabled"||r?.status==="success")},PL=(e,t,o)=>t.every(r=>e[r]?.every(s=>s.status==="disabled"||s.status==="success"||o.includes(s.id))),Gh=(e,t)=>{let o=ob(e).flat().filter(r=>r&&t.includes(r.id));return o.length===t.length&&o.every(r=>r?.status==="disabled"||r?.status==="success")},AL=(e,t,o)=>t.every(r=>e[r]?.every(s=>s.status==="disabled"||s.status==="success"||o.includes(s.id))),na=(e,t,o)=>{let{groups:r,validationIds:s}=o[t].host;return sb(e,(n,i,a)=>{if(r.includes(a))return n[a]=i,n;let l=(i||[]).filter(p=>s.includes(p.id));return l.length&&(n[a]=l),n},{})},ia=(e,t,o)=>{let{status:r}=o;if(["insufficient","pending-for-input"].includes(r)){let{softValidationIds:s}=t[e],n=(typeof o.validationsInfo=="string"?G(o.validationsInfo):o.validationsInfo)||{},{groups:i,validationIds:a}=t[e].host;return AL(n,i,s)&&Gh(n,a)?"known":r}return r},ib=(e,t,o)=>{let{groups:r,validationIds:s}=o[t].cluster;return sb(e,(n,i,a)=>{if(r.includes(a))return n[a]=i,n;let l=(i||[]).filter(p=>s.includes(p.id));return l.length&&(n[a]=l),n},{})},xs=(e,t,o,r=[])=>{let{status:s}=o;if(["insufficient","pending-for-input"].includes(s)){let n=(typeof o.validationsInfo=="string"?G(o.validationsInfo):o.validationsInfo)||{},{groups:i,validationIds:a}=t[e].cluster,{softValidationIds:l}=t[e],{allowedStatuses:p}=t[e].host;return r.every(u=>p.length===0||p.includes(ia(e,t,u)))&&PL(n,i,l)&&TL(n,a)?"ready":s}return s},Em=e=>Object.keys(e).reduce((t,o)=>[...t,...e[o].softValidationIds],[]),wL=e=>Object.keys(e).reduce((t,o)=>{let r=e[o].filter(s=>s.status==="failure");return[...t,...r]},[]),ul=(e,t,o)=>{let r=na(e,t,o),s=wL(r).map(n=>n.id);if(!s.length)return!1;for(let n of s)if(!o[t].softValidationIds.includes(n))return!1;return!0},ab=(e,t,o)=>{let r=rb(t),s=!0;return r.find(n=>{if(n===o&&(s=!1),s)return!1;let{host:i}=t[n];return i.validationIds.includes(e)})};var DL={cluster:{groups:[],validationIds:["pull-secret-set","dns-domain-defined"]},host:{allowedStatuses:[],groups:[],validationIds:[]},softValidationIds:[]},lb={cluster:{groups:[],validationIds:["sufficient-masters-count","odf-requirements-satisfied","lso-requirements-satisfied","cnv-requirements-satisfied"]},host:{allowedStatuses:["known","known-unbound","disabled"],groups:["hardware"],validationIds:["connected","odf-requirements-satisfied","lso-requirements-satisfied","cnv-requirements-satisfied"]},softValidationIds:[]},EL={cluster:{groups:["network"],validationIds:[]},host:{allowedStatuses:["known","disabled"],groups:["network"],validationIds:[]},softValidationIds:["ntp-synced","container-images-available"]},FL={cluster:{groups:[],validationIds:["all-hosts-are-ready-to-install"]},host:{allowedStatuses:["known","disabled"],groups:[],validationIds:[]},softValidationIds:[]},Dr={"cluster-details":DL,"hosts-discovery":lb,"hosts-selection":lb,networking:EL,review:FL},Uh=Em(Dr),Fm=(e,t,o)=>{let r=e?.status?.debugInfo?.state,s=e?.status?.validationsInfo,n=t.reduce((i,a)=>{let l=a.status?.debugInfo?.state;return l&&i.push({status:l,validationsInfo:a.status?.validationsInfo}),i},[]);return r?xs(o,Dr,{status:r,validationsInfo:s||{}},n)==="ready":!1},Kh=(e,t)=>Fm(e,t,"hosts-selection"),$h=(e,t)=>Fm(e,t,"hosts-discovery"),qh=(e,t)=>Fm(e,t,"networking"),Yh=(e,t)=>Fm(e,t,"review");import{createElement as TT}from"react";import{ConnectedIcon as t8,ExclamationCircleIcon as o8}from"@patternfly/react-icons";import{global_danger_color_100 as r8}from"@patternfly/react-tokens";import NL from"react";window.Fragment=NL.Fragment;import VL from"lodash/isString";var U=e=>e instanceof Error?e.message:VL(e)?e:"Unexpected error",pb=e=>Array(e+1).join((Math.random().toString(36)+"00000000000000000").slice(2,18)).slice(0,e);import{createElement as li,forwardRef as QL}from"react";import{useField as qL}from"formik";import{FormGroup as YL,HelperTextItem as jL,Split as XL,SplitItem as mb,TextInput as JL}from"@patternfly/react-core";import{Address4 as HL}from"ip-address";import ML from"lodash/set";import LL from"lodash/groupBy";import OL from"lodash/pickBy";var E=(e,t,o)=>(o=o?`${o}-`:"",`form-${t}-${e.replace(/\./g,"-")}-${o}field`),Sn=e=>e.split(`
2
+ `).map(t=>t.trim()).filter(Boolean).join(`
3
+ `),Er=e=>e.split(",").map(t=>t.trim()).filter(Boolean).join(","),uo=(e,t)=>Object.keys(e).filter(o=>t[o]),ml=e=>e.find(t=>t.default)?.value||e[0]?.value||"",Nm=e=>e.reduce((o,r)=>{let s=r.split("=");return o[s[0]]=s[1],o},{}),_L=e=>e.reduce((t,{path:o,message:r})=>({...t,[o]:(t[o]||[]).concat(r)}),{}),tc=e=>{let t=OL(LL(e),o=>o.length>1);return Object.keys(t)},mo=e=>async t=>{try{await e.validate(t,{abortEarly:!1})}catch(o){let{inner:r}=o;if(!r||r.length===0)return{};let s=[],n=[];r.forEach(l=>{/\.|\[/.test(l.path)?n.push(l):s.push(l)});let i=_L(s);if(n.length===0)return i;let a={};return n.forEach(l=>{ML(a,l.path,[l.message])}),{...i,...a}}},aa=(e,t)=>`${e}[${t}]`,cb=(e,t)=>`${e}.${t}`,Vm=e=>!!e?.every(t=>t.cidr&&HL.isValid(t.cidr)),ub=(e={})=>{let t=[];for(let o in e)t.push(`${o}=${e[o]}`);return t};import RL from"react";import{css as BL}from"@patternfly/react-styles";var zL=({fieldId:e,children:t,isError:o=!1})=>RL.createElement("div",{className:BL("pf-c-form__helper-text",{"pf-m-error":o}),id:`${e}-helper`,"aria-live":"polite"},t),Q=zL;import{useEffect as $L,useState as KL}from"react";import{useField as WL}from"formik";var GL=e=>Array.isArray(e)?e.join(". "):e,UL=({name:e,inputError:t,validate:o})=>{let[r,{error:s}]=WL({name:e,validate:o}),[n,i]=KL(!1);$L(()=>{r.value&&i(r.value)},[r.value,i]);let a=r.value||!r.value&&n;return GL((a?s:"")||t)},vn=UL;var ZL=QL(({label:e,labelIcon:t,helperText:o,isRequired:r,onChange:s,validate:n,idPostfix:i,children:a,noDefaultOnChange:l,inputError:p,description:c,labelInfo:u,showErrorMessage:m=!0,...d},g)=>{let[C]=qL({name:d.name,validate:n}),h=E(d.name,"input",i),S=vn({name:d.name,inputError:p,validate:n}),v=!S;return li(YL,{fieldId:h,label:e,helperText:typeof o=="string"?o:li(Q,{fieldId:h},o),helperTextInvalid:m?S:void 0,validated:v?"default":"error",isRequired:r,labelIcon:t,labelInfo:u},c&&li(Q,{fieldId:h},li(jL,{variant:"indeterminate"},c)),li(XL,null,li(mb,{isFilled:!0},li(JL,{...C,...d,ref:g,id:h,validated:v?"default":"error",isRequired:r,"aria-describedby":`${h}-helper`,onChange:(y,I)=>{d.isDisabled||(!l&&C.onChange(I),s&&s(I))}})),li(mb,null,a)))}),J=ZL;import{createElement as jh}from"react";import{useField as eO}from"formik";import{Checkbox as tO,FormGroup as oO}from"@patternfly/react-core";var rO=({label:e,helperText:t,onChange:o,validate:r,idPostfix:s,...n})=>{let[i,{touched:a,error:l}]=eO({name:n.name,validate:r}),p=E(n.name,"checkbox",s),c=!(a&&l);return jh(oO,{fieldId:p,helperTextInvalid:c?"":l,validated:c?"default":"error"},jh(tO,{...i,...n,id:p,label:e,"aria-describedby":`${p}-helper`,description:typeof t=="string"?t:jh(Q,{fieldId:p},t),isValid:c,isChecked:i.value,onChange:(m,d)=>{i.onChange(d),o&&o(m,d)}}))},eo=rO;import{createElement as Hm}from"react";import{useField as sO}from"formik";import{FormGroup as nO,TextArea as iO}from"@patternfly/react-core";var aO=({label:e,helperText:t,getErrorText:o,isRequired:r,children:s,idPostfix:n,labelIcon:i,groupClassName:a,...l})=>{let[p,{touched:c,error:u}]=sO(l.name),m=E(l.name,"input",n),d=!(c&&u),C=(()=>!d&&u?o?o(u):u:"")(),{isDisabled:h,...S}=l;return Hm(nO,{fieldId:m,label:e,helperText:typeof t=="string"?t:Hm(Q,{fieldId:m},t),helperTextInvalid:typeof C=="string"?C:Hm(Q,{fieldId:m,isError:!0},C),validated:d?"default":"error",isRequired:r,labelIcon:i,className:a},s,Hm(iO,{...p,...S,id:m,style:{resize:"vertical"},validated:d?"default":"error",isRequired:r,"aria-describedby":`${m}-helper`,onChange:(v,y)=>p.onChange(y),disabled:h}))},Qr=aO;import{createElement as Mm}from"react";import{useField as lO}from"formik";import{FormGroup as pO,FormSelect as cO,FormSelectOption as uO}from"@patternfly/react-core";var mO=({label:e,options:t,helperText:o,isRequired:r,onChange:s,getHelperText:n,idPostfix:i,labelIcon:a,callFormikOnChange:l=!0,...p})=>{let[c,{touched:u,error:m}]=lO(p.name),d=E(p.name,"input",i),g=!(u&&m),C=g?"":m,h=n?n(c.value):o;return Mm(pO,{fieldId:d,label:e,helperText:typeof h=="string"?h:Mm(Q,{fieldId:d},h),helperTextInvalid:C,validated:g?"default":"error",isRequired:r,labelIcon:a},Mm(cO,{...c,...p,id:d,validated:g?"default":"error",isRequired:r,"aria-describedby":`${d}-helper`,onChange:(S,v)=>{l&&c.onChange(v),s&&s(v)}},t.map((S,v)=>Mm(uO,{key:S.id||v,...S}))))},es=mO;import dl from"react";import{useField as fO}from"formik";import gO from"fuse.js";import{FormGroup as hO,Select as CO,SelectOption as yO,SelectVariant as SO}from"@patternfly/react-core";import{useTranslation as dO}from"react-i18next";function f(){return dO(process.env.TRANSLATION_NAMESPACE)}var vO=({label:e,options:t,helperText:o,placeholderText:r,isRequired:s,onChange:n,getHelperText:i,idPostfix:a,labelIcon:l,...p})=>{let[c,u]=dl.useState(!1),[m,{touched:d,error:g},{setValue:C}]=fO(p.name),h=E(p.name,"multiinput",a),S=!(d&&g),v=S?"":g,y=i?i(m.value):o,I=V=>u(V),b=()=>{C([]),n&&n([]),u(!1)},k=(V,Y)=>{let he=m.value,Z=Y.value||Y,x;he.includes(Z)?x=he.filter(P=>P!==Z):x=[...m.value,Z],C(x),n&&n(x)},T=m.value.map(V=>{let Y=t.find(he=>he.value===V);return Y?{value:Y.value,toString:()=>Y.displayName,compareTo:he=>he.value===V}:V}),w=t.filter(V=>!(m.value||[]).includes(V.value)).map(V=>dl.createElement(yO,{key:V.id,id:V.id,value:V.value},V.displayName)),F=new gO(t,{ignoreLocation:!0,keys:["displayName"]}),{t:O}=f();return dl.createElement(hO,{fieldId:h,label:e,helperText:typeof y=="string"?y:dl.createElement(Q,{fieldId:h},y),helperTextInvalid:v,validated:S?"default":"error",isRequired:s,labelIcon:l},dl.createElement(CO,{...m,...p,id:h,variant:SO.typeaheadMulti,typeAheadAriaLabel:O("ai:Select a state"),validated:S?"default":"error","aria-describedby":`${h}-helper`,isCreatable:!1,placeholderText:r,isOpen:c,onToggle:I,onSelect:k,onClear:b,selections:T,onFilter:(V,Y)=>{if(!Y||Y==="")return w;let he=F.search(Y).map(Z=>Z.item.id);return dl.Children.toArray(w).filter(({props:Z})=>he.includes(Z.id))}},w))},la=vO;import{createElement as Lm}from"react";import{FormGroup as IO,Button as db}from"@patternfly/react-core";var bO=({isSet:e,isEdit:t,helperTextHidden:o,onToggle:r,idPostfix:s,...n})=>{let{label:i,name:a}=n,l=E(a,"input",s);return t?Lm(Qr,{...n},e&&Lm(db,{onClick:()=>r(!0),variant:"link"},"Keep existing value")):Lm(IO,{fieldId:l,label:i,helperText:o,isRequired:n.isRequired},Lm(db,{onClick:()=>r(!1),variant:"link"},"Change"))},Xh=bO;import{createElement as Om,useState as fb}from"react";import{useField as kO}from"formik";import{FormGroup as xO,FileUpload as TO}from"@patternfly/react-core";var PO=({label:e,labelIcon:t,helperText:o,getErrorText:r,isRequired:s,children:n,idPostfix:i,isDisabled:a,name:l,onBlur:p,allowEdittingUploadedText:c=!0,dropzoneProps:u,transformValue:m})=>{let{t:d}=f(),[g,C]=fb(),[h,S]=fb(!1),[v,{touched:y,error:I},b]=kO(l),k=E(l,"input",i),T=!((y||g)&&I),F=(()=>!T&&I?r?r(I):I:"")();return Om(xO,{fieldId:k,label:e,helperText:typeof o=="string"?o:Om(Q,{fieldId:k},o),helperTextInvalid:typeof F=="string"?F:Om(Q,{fieldId:k,isError:!0},F),validated:T?"default":"error",isRequired:s,labelIcon:t},n,Om(TO,{filenamePlaceholder:d("ai:Drag a file here or browse to upload"),browseButtonText:d("ai:Browse..."),clearButtonText:d("ai:Clear"),id:v.name,style:{resize:"vertical"},validated:T?"default":"error",isRequired:s,"aria-describedby":`${k}-helper`,type:"text",value:v.value,filename:g,onChange:(O,V)=>{C(V),b.setTouched(!0),m&&typeof O=="string"?b.setValue(m(O)):b.setValue(O)},onBlur:O=>{v.onBlur(O),p&&p(O)},onReadStarted:()=>S(!0),onReadFinished:()=>S(!1),isLoading:h,disabled:a,dropzoneProps:{...u,onDropRejected:u?.onDropRejected&&u?.onDropRejected(b)},allowEditingUploadedText:c}))},oc=PO;import{createElement as rc}from"react";import{useField as AO}from"formik";import{FormGroup as wO,Switch as gb,Tooltip as DO}from"@patternfly/react-core";var EO=({label:e,helperText:t,isRequired:o,onChange:r,onChangeCustomOverride:s,getHelperText:n,idPostfix:i,labelIcon:a,tooltipProps:l,switchOuiaId:p,...c})=>{let[u,{touched:m,error:d}]=AO(c.name),g=E(c.name,"input",i),C=!(m&&d),h=C?"":d,S=n?n(u.value):t,v={...u,id:g,label:e,isDisabled:c.isDisabled,isChecked:Boolean(u.value),hasCheckIcon:Boolean(u.value),ouiaId:p,onChange:(y,I)=>{s?s(y,I):(u.onChange(I),r&&r(y,I))}};return rc(wO,{fieldId:g,helperText:typeof S=="string"?S:rc(Q,{fieldId:g},S),helperTextInvalid:h,validated:C?"default":"error",isRequired:o,labelIcon:a},l?rc(DO,{...l},rc(gb,{...v})):rc(gb,{...v}))},Fr=EO;import In from"react";import{shallowEqual as hb}from"react-redux";import Cb from"lodash/debounce";import{useFormikContext as yb}from"formik";var lr=(e=1e3)=>{let[t,o]=In.useState([]),{values:r,isSubmitting:s,submitForm:n}=yb(),i=In.useRef(r),a=In.useRef(Cb(async l=>{await n(),o(p=>p.filter(c=>c>l))},e));return In.useEffect(()=>{if(!hb(i.current,r)&&!s){let l=Date.now();o(p=>(p.push(l),p)),a.current(l)}s||(i.current=r)},[r,s,o]),In.useEffect(()=>{let l=a.current;return()=>l.cancel()},[]),!!t.length},FO=({debounce:e=1e3})=>{let{values:t,dirty:o,isSubmitting:r,submitForm:s}=yb(),n=In.useRef(t),i=In.useRef(Cb(s,e));return In.useEffect(()=>{!hb(n.current,t)&&o&&!r&&i.current(),r||(n.current=t)},[t,o,r]),In.useEffect(()=>{let a=i.current;return()=>a.cancel()},[]),null},pa=FO;import et from"react";import{ExternalLinkAltIcon as bb}from"@patternfly/react-icons";var CC={};Zr(CC,{AI_UI_TAG:()=>hl,APPROVE_NODES_IN_CL_LINK:()=>iC,CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV4:()=>uC,CLUSTER_DEFAULT_NETWORK_SETTINGS_IPV6:()=>MO,CLUSTER_MANAGER_SITE_LINK:()=>_m,CNV_LINK:()=>rC,DUAL_STACK:()=>Vo,ENCRYPTING_DISK_DURING_INSTALLATION:()=>Rm,EVENTS_POLLING_INTERVAL:()=>aC,EVENT_SEVERITIES:()=>dC,FEEDBACK_FORM_LINK:()=>VO,IPV4_STACK:()=>os,MS_PER_DAY:()=>fC,NETWORK_TYPE_OVN:()=>kn,NETWORK_TYPE_SDN:()=>ts,NMSTATE_EXAMPLES_LINK:()=>nC,NO_SUBNET_SET:()=>Ue,NUTANIX_CONFIG_LINK:()=>hC,OCP_RELEASES_PAGE:()=>gC,OCP_STATIC_IP_DOC:()=>cc,ODF_LINK:()=>sC,ODF_REQUIREMENTS_LINK:()=>Qh,OPENSHIFT_LIFE_CYCLE_DATES_LINK:()=>sc,OPENSHIFT_NETWORKING_DOCS_LINK:()=>Jh,OPERATOR_NAME_CNV:()=>pi,OPERATOR_NAME_CONSOLE:()=>Ib,OPERATOR_NAME_CVO:()=>vb,OPERATOR_NAME_LSO:()=>Bm,OPERATOR_NAME_LVM:()=>Ps,OPERATOR_NAME_ODF:()=>Ts,POLLING_INTERVAL:()=>ua,PREFIX_MAX_RESTRICTION:()=>fa,PULL_SECRET_INFO_LINK:()=>Zh,REDHAT_CONSOLE_OPENSHIFT:()=>tC,SSH_GENERATION_DOC_LINK:()=>oC,TECH_SUPPORT_LEVEL_LINK:()=>ic,TIME_ZERO:()=>gl,VSPHERE_CONFIG_LINK:()=>ca,clusterFieldLabels:()=>ac,clusterStatusLabels:()=>bn,clusterValidationGroupLabels:()=>cC,clusterValidationLabels:()=>pC,diskRoleLabels:()=>lc,getAssistedUiLibVersion:()=>mC,getOcpConsoleNodesPage:()=>eC,getProductBrandingCode:()=>HO,getReportIssueLink:()=>nc,hostRoles:()=>ma,hostValidationFailureHints:()=>fl,hostValidationGroupLabels:()=>lC,hostValidationLabels:()=>da,operatorLabels:()=>pc});var Sb="2.7.11-cim";var sc="https://access.redhat.com/support/policy/updates/openshift#dates",Jh="https://docs.openshift.com/container-platform/4.7/installing/installing_bare_metal/installing-bare-metal.html#installation-network-user-infra_installing-bare-metal",_m="https://console.redhat.com/openshift/install/pull-secret",Zh=_m,Qh="https://access.redhat.com/documentation/en-us/red_hat_openshift_data_foundation/4.9/html/planning_your_deployment/infrastructure-requirements_rhodf#resource-requirements_rhodf",ca="https://access.redhat.com/solutions/6677901",nc=()=>"https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332330&issuetype=1&components=12370775",VO="https://docs.google.com/forms/d/e/1FAIpQLSfg9M8wRW4m_HkWeAl6KpB5dTcMu8iI3iJ29GlLfZpF2hnjng/viewform",ic="https://access.redhat.com/support/offerings/techpreview",Rm="https://docs.openshift.com/container-platform/4.7/installing/install_config/installing-customizing.html#installation-special-config-encrypt-disk_installing-customizing",eC=e=>`${e}/k8s/cluster/nodes`,tC="https://console.redhat.com/openshift",oC="https://www.redhat.com/sysadmin/configure-ssh-keygen",rC="https://cloud.redhat.com/learn/topics/virtualization/",sC="https://www.redhat.com/en/resources/openshift-data-foundation-datasheet",nC="https://nmstate.io/examples.html",iC="https://docs.openshift.com/container-platform/4.11/installing/installing_platform_agnostic/installing-platform-agnostic.html#installation-approve-csrs_installing-platform-agnostic",HO=()=>"redhat",ua=10*1e3,aC=10*1e3,ma=e=>[{value:"auto-assign",label:e("ai:Auto-assign"),description:e("ai:A role will be chosen automatically based on detected hardware and network latency.")},{value:"master",label:e("ai:Control plane node"),description:e("ai:Runs the control plane components of OpenShift, including the API server.")},{value:"worker",label:e("ai:Worker"),description:e("ai:Runs application workloads. Connect at least 5 hosts to enable dedicated workers.")}],bn=e=>({"pending-for-input":e("ai:Draft"),insufficient:e("ai:Draft"),ready:e("ai:Draft"),"preparing-for-installation":e("ai:Preparing for installation"),installing:e("ai:Installing"),"installing-pending-user-action":e("ai:Installing (pending action)"),finalizing:e("ai:Finalizing"),cancelled:e("ai:Installation cancelled"),error:e("ai:Error"),installed:e("ai:Installed"),"adding-hosts":e("ai:Adding hosts")}),ac=e=>({name:e("ai:Cluster name"),baseDnsDomain:e("ai:Base domain"),clusterNetworkCidr:e("ai:Cluster network CIDR"),clusterNetworkHostPrefix:e("ai:Cluster network host prefix"),serviceNetworkCidr:e("ai:Service network CIDR"),apiVip:e("ai:API IP"),ingressVip:e("ai:Ingress IP"),pullSecret:e("ai:Pull secret"),sshPublicKey:e("ai:SSH public key"),SNODisclaimer:e("ai:Single Node OpenShift disclaimer"),diskEncryptionTangServers:e("ai:Tang servers' URLs or thumbprints"),selectedHostIds:e("ai:Hosts selection"),httpProxy:e("ai:HTTP proxy"),httpsProxy:e("ai:HTTPS proxy"),noProxy:e("ai:No proxy"),machineNetworks:e("ai:Machine networks"),clusterNetworks:e("ai:Cluster networks"),serviceNetworks:e("ai:Service networks")}),lC=e=>({hardware:e("ai:Hardware"),network:e("ai:Network"),operators:e("ai:Operators"),infrastructure:e("ai:Infrastructure")}),da=e=>({"compatible-with-cluster-platform":e("ai:Compatible with cluster platform"),"has-default-route":e("ai:Default route to host"),"sufficient-network-latency-requirement-for-role":e("ai:Network latency"),"sufficient-packet-loss-requirement-for-role":e("ai:Packet loss"),"has-inventory":e("ai:Hardware information"),"has-min-cpu-cores":e("ai:Minimum CPU cores"),"has-min-memory":e("ai:Minimum Memory"),"has-min-valid-disks":e("ai:Minimum disks of required size"),"has-cpu-cores-for-role":e("ai:Minimum CPU cores for selected role"),"has-memory-for-role":e("ai:Minimum memory for selected role"),"hostname-unique":e("ai:Unique hostname"),"hostname-valid":e("ai:Valid hostname"),connected:e("ai:Connected"),"media-connected":e("ai:Media Connected"),"machine-cidr-defined":e("ai:Machine CIDR"),"belongs-to-machine-cidr":e("ai:Belongs to machine CIDR"),"ignition-downloadable":e("ai:Ignition file downloadable"),"belongs-to-majority-group":e("ai:Belongs to majority connected group"),"valid-platform-network-settings":e("ai:Platform network settings"),"ntp-synced":e("ai:NTP synchronization"),"container-images-available":e("ai:Container images availability"),"lso-requirements-satisfied":e("ai:LSO requirements"),"ocs-requirements-satisfied":e("ai:OCS requirements"),"odf-requirements-satisfied":e("ai:ODF requirements"),"lvm-requirements-satisfied":e("ai:LVM requirements"),"cnv-requirements-satisfied":e("ai:CNV requirements"),"disk-encryption-requirements-satisfied":e("ai:Disk encryption requirements"),"sufficient-installation-disk-speed":e("ai:Installation disk speed"),"api-domain-name-resolved-correctly":e("ai:API domain name resolution"),"api-int-domain-name-resolved-correctly":e("ai:API internal domain name resolution"),"apps-domain-name-resolved-correctly":e("ai:Application ingress domain name resolution"),"dns-wildcard-not-configured":e("ai:DNS wildcard not configured"),"non-overlapping-subnets":e("ai:Non overlapping subnets"),"vsphere-disk-uuid-enabled":e("ai:Vsphere disk uuid enabled"),"compatible-agent":e("ai:Agent compatibility"),"no-skip-installation-disk":e("ai:No skip installation disk"),"no-skip-missing-disk":e("ai:No skip missing disk"),"service-has-sufficient-spoke-kube-api-access":e("ai:Service has sufficient spoke kube api access")}),fl=e=>({"compatible-with-cluster-platform":"","has-default-route":"","sufficient-network-latency-requirement-for-role":"","sufficient-packet-loss-requirement-for-role":"","has-inventory":"","has-min-cpu-cores":"","has-min-memory":"","has-min-valid-disks":"","has-cpu-cores-for-role":"","has-memory-for-role":"","hostname-unique":"","hostname-valid":"",connected:"","media-connected":"","machine-cidr-defined":"","belongs-to-machine-cidr":"","ignition-downloadable":"","belongs-to-majority-group":"","valid-platform-network-settings":"","ntp-synced":e("ai:Please manually fix host's NTP configuration or provide additional NTP sources."),"container-images-available":"","lso-requirements-satisfied":"","ocs-requirements-satisfied":"","odf-requirements-satisfied":"","lvm-requirements-satisfied":"","cnv-requirements-satisfied":"","disk-encryption-requirements-satisfied":"","sufficient-installation-disk-speed":"","api-domain-name-resolved-correctly":"","api-int-domain-name-resolved-correctly":"","apps-domain-name-resolved-correctly":"","dns-wildcard-not-configured":"","non-overlapping-subnets":"","vsphere-disk-uuid-enabled":"","compatible-agent":"","no-skip-installation-disk":"","no-skip-missing-disk":"","service-has-sufficient-spoke-kube-api-access":""}),pC=e=>({"network-type-valid":e("ai:Valid network type"),"machine-cidr-defined":e("ai:Machine CIDR"),"cluster-cidr-defined":e("ai:Cluster CIDR"),"service-cidr-defined":e("ai:Service CIDR"),"no-cidrs-overlapping":e("ai:No overlapping CIDR"),"networks-same-address-families":e("ai:Networks same address families"),"network-prefix-valid":e("ai:Valid network prefix"),"machine-cidr-equals-to-calculated-cidr":e("ai:Machine CIDR conforms expected"),"api-vip-defined":e("ai:API IP"),"api-vip-valid":e("ai:API IP validity"),"ingress-vip-defined":e("ai:Ingress IP"),"ingress-vip-valid":e("ai:Ingress IP validity"),"all-hosts-are-ready-to-install":e("ai:All hosts are ready to install"),"sufficient-masters-count":e("ai:Control plane nodes count"),"dns-domain-defined":e("ai:DNS domain"),"pull-secret-set":e("ai:Pull secret"),"ntp-server-configured":e("ai:NTP server"),"lso-requirements-satisfied":e("ai:LSO requirements"),"ocs-requirements-satisfied":e("ai:OCS requirements"),"odf-requirements-satisfied":e("ai:ODF requirements"),"lvm-requirements-satisfied":e("ai:LVM requirements"),"cnv-requirements-satisfied":e("ai:CNV requirements")}),cC=e=>({configuration:e("ai:General configuration"),hostsData:e("ai:Hosts"),"hosts-data":e("ai:Hosts"),network:e("ai:Networking"),operators:e("ai:Operators")}),uC={clusterNetworkCidr:"10.128.0.0/14",clusterNetworkHostPrefix:23,serviceNetworkCidr:"172.30.0.0/16"},MO={clusterNetworkCidr:"2002:db8::/53",clusterNetworkHostPrefix:64,serviceNetworkCidr:"2003:db8::/112"},mC=()=>Sb,dC=["info","warning","error","critical"],gl="0001-01-01T00:00:00.000Z",fC=1e3*60*60*24,Ue="NO_SUBNET_SET",kn="OVNKubernetes",ts="OpenShiftSDN",os="singleStack",Vo="dualStack",fa={IPv6:128,IPv4:25},lc=e=>({none:e("ai:None"),install:e("ai:Installation disk")}),pi="cnv",Bm="lso",Ts="odf",Ps="lvm",vb="cvo",Ib="console",pc=e=>({[Ib]:e("ai:OpenShift Console"),[vb]:e("ai:OpenShift Cluster Version Operator"),[Bm]:e("ai:OpenShift Local Storage"),[Ts]:e("ai:OpenShift Data Foundation"),[Ps]:e("ai:OpenShift Data Foundation Logical Volume Manager"),[pi]:e("ai:OpenShift Virtualization")}),cc="https://docs.openshift.com/container-platform/latest/scalability_and_performance/ztp-deploying-disconnected.html#ztp-configuring-a-static-ip_ztp-deploying-disconnected",hl="ui_ocm",gC="openshift/releases",hC="https://access.redhat.com/solutions/6983944";import yC from"react";import LO from"classnames";import{Button as OO,Popover as _O}from"@patternfly/react-core";import{OutlinedQuestionCircleIcon as RO}from"@patternfly/react-icons";var BO=({component:e,variant:t="plain",IconComponent:o=RO,noVerticalAlign:r=!1,buttonClassName:s,buttonOuiaId:n,...i})=>yC.createElement(_O,{...i},yC.createElement(OO,{component:e,variant:t,onClick:a=>a.preventDefault(),className:LO("pf-c-form__group-label-help","pf-u-p-0",s),ouiaId:n},yC.createElement(o,{noVerticalAlign:r}))),H=BO;import{Trans as kb}from"react-i18next";var uc=({isOcm:e})=>{let{t}=f();return et.createElement(H,{noVerticalAlign:!0,bodyContent:et.createElement(et.Fragment,null,et.createElement(kb,{t},"ai:Pull secrets are used to download OpenShift Container Platform components and connect clusters to a Red Hat account."," "),e?et.createElement(Tb,null):et.createElement(et.Fragment,null,et.createElement(kb,{t},"ai:Pull secrets can be found in")," ",et.createElement(xb,null)))})},xb=()=>{let{t:e}=f();return et.createElement("a",{href:_m,target:"_blank",rel:"noopener noreferrer"},e("ai:OpenShift Cluster Manager")," ",et.createElement(bb,null))},Tb=()=>{let{t:e}=f();return et.createElement("a",{href:Zh,target:"_blank",rel:"noopener noreferrer"},e("ai:Learn more about pull secrets and view examples")," ",et.createElement(bb,null),".")},Pb=({isOcm:e})=>{let{t}=f();return e?et.createElement(Tb,null):et.createElement(et.Fragment,null,t("ai:A Red Hat account's pull secret can be found in "),"\xA0",et.createElement(xb,null))},zO=({isOcm:e})=>{let{t}=f();return et.createElement(Qr,{name:"pullSecret",label:t("ai:Pull secret"),labelIcon:e?void 0:et.createElement(uc,{isOcm:e}),getErrorText:o=>et.createElement(et.Fragment,null,o," ",et.createElement(Pb,{isOcm:e})),helperText:et.createElement(Pb,{isOcm:e}),rows:10,isRequired:!0})},As=zO;import WO from"react";import{useField as GO}from"formik";import{Radio as UO}from"@patternfly/react-core";var KO=({callFormikOnChange:e=!0,name:t,value:o,onChange:r,...s})=>{let[n]=GO({name:t,value:o,type:"radio"}),i=E(t,"radio",n.value);return WO.createElement(UO,{...n,...s,id:i,isChecked:!!n.checked,onChange:(a,l)=>{r?.(a,l),e&&n.onChange(l)}})},ie=KO;import{Fragment as l_,createElement as Cl,useCallback as i_,useEffect as a_,useRef as n_}from"react";import{useField as QO,useFormikContext as e_}from"formik";import{Checkbox as t_,FormGroup as o_,Tooltip as r_}from"@patternfly/react-core";var vC={};Zr(vC,{ACM_ENABLED_FEATURES:()=>Ab,FeatureGateContext:()=>zm,FeatureGateContextProvider:()=>ci,SINGLE_CLUSTER_ENABLED_FEATURES:()=>wb,STANDALONE_DEPLOYMENT_ENABLED_FEATURES:()=>Db,useFeature:()=>rs});import SC from"react";var Ab={ASSISTED_INSTALLER_SNO_FEATURE:!0,ASSISTED_INSTALLER_OCS_FEATURE:!1,ASSISTED_INSTALLER_ODF_FEATURE:!1,ASSISTED_INSTALLER_CNV_FEATURE:!1,ASSISTED_INSTALLER_NETWORK_TYPE_SELECTION_FEATURE:!1,ASSISTED_INSTALLER_PLATFORM_INTEGRATION_FEATURE:!1},wb={ASSISTED_INSTALLER_SNO_FEATURE:!1,ASSISTED_INSTALLER_OCS_FEATURE:!1,ASSISTED_INSTALLER_ODF_FEATURE:!1,ASSISTED_INSTALLER_CNV_FEATURE:!1,ASSISTED_INSTALLER_NETWORK_TYPE_SELECTION_FEATURE:!1,ASSISTED_INSTALLER_PLATFORM_INTEGRATION_FEATURE:!1},Db={ASSISTED_INSTALLER_SNO_FEATURE:!0,ASSISTED_INSTALLER_OCS_FEATURE:!0,ASSISTED_INSTALLER_ODF_FEATURE:!0,ASSISTED_INSTALLER_CNV_FEATURE:!0,ASSISTED_INSTALLER_NETWORK_TYPE_SELECTION_FEATURE:!0,ASSISTED_INSTALLER_PLATFORM_INTEGRATION_FEATURE:!0},zm=SC.createContext({isFeatureEnabled:()=>!1}),ci=({features:e,children:t})=>{let o={ASSISTED_INSTALLER_OCS_FEATURE:!1,ASSISTED_INSTALLER_ODF_FEATURE:!1,ASSISTED_INSTALLER_CNV_FEATURE:!1,...e},r=s=>!!o[s];return SC.createElement(zm.Provider,{value:{isFeatureEnabled:r}},t)},rs=e=>{let{isFeatureEnabled:t}=SC.useContext(zm);return t(e)};import PC from"react";var _;(function(s){s.x86="x86_64",s.ARM="arm64",s.DAY1_CLUSTER_USES_MULTI="multi",s.USE_DAY1_ARCHITECTURE="cluster-day1-cpu-architecture"})(_||(_={}));var Nr;(function(r){r.x86="amd64",r.ARM="arm64",r.MULTI="multi"})(Nr||(Nr={}));var ga=[_.x86,_.ARM],IC=["vsphere","nutanix"],bC=["baremetal","none"];var mc=e=>e==="dev-preview"||e==="tech-preview";function kC(e){return typeof e=="object"&&e!==null}function xC(e,t){return t in e}var ue;(function(n){n.LOADING="LOADING",n.RELOADING="RELOADING",n.ERROR="ERROR",n.EMPTY="EMPTY",n.LOADED="LOADED"})(ue||(ue={}));import ss from"react";import{Label as jO,Popover as XO}from"@patternfly/react-core";import{InfoCircleIcon as JO}from"@patternfly/react-icons";import Eb from"react";import{Text as $O}from"@patternfly/react-core";import{ExternalLinkAltIcon as qO}from"@patternfly/react-icons";var YO=({href:e,children:t,onClick:o})=>Eb.createElement($O,{component:"a",href:e,onClick:o,target:"_blank",rel:"noopener noreferrer"},t||e," ",Eb.createElement(qO,{color:"rgb(0, 123, 186)"})),tt=YO;var ha;(function(r){r[r.default=0]="default",r[r.inline=1]="inline",r[r.inlineRight=2]="inlineRight"})(ha||(ha={}));var Fb=({position:e=1,className:t="pf-u-ml-md",text:o,popoverText:r,externalLink:s,testId:n})=>{let i=t,{t:a}=f();switch(e){case 2:i+=" pf-u-float-right";break;case 1:i+=" pf-u-display-inline";break}let l=ss.createElement(ss.Fragment,null,ss.createElement("div",{style:{marginBottom:"var(--pf-global--spacer--sm)"}},r),s&&ss.createElement(ss.Fragment,null,ss.createElement(tt,{href:s},a("ai:Learn more"))));return ss.createElement(XO,{bodyContent:l,position:"top"},ss.createElement(jO,{style:{cursor:"pointer"},color:"orange",onClick:p=>p.preventDefault(),icon:ss.createElement(JO,{color:"var(--pf-c-label__content--Color)"}),className:i,"data-testid":`${n}`},o))},dc=e=>{let{t}=f();return ss.createElement(Fb,{text:t("ai:Developer Preview"),popoverText:t("ai:Developer preview features are not intended to be used in production environments. The clusters deployed with the developer preview features are considered to be development clusters and are not supported through the Red Hat Customer Portal case management system."),...e})};dc.displayName="DeveloperPreview";var fc=e=>{let{t}=f();return ss.createElement(Fb,{text:t("ai:Technology Preview"),popoverText:t("ai:Technology preview features provide early access to upcoming product innovations, enabling you to test functionality and provide feedback during the development process."),externalLink:ic,...e})};fc.displayName="TechnologyPreview";import TC from"react";var Nb=TC.createContext(null),Wm=({value:e,children:t})=>TC.createElement(Nb.Provider,{value:e},t),Pe=()=>{let e=TC.useContext(Nb),{t}=f();if(!e)throw new Error(t("ai:useFeatureSupportLevel must be used within FeatureSupportLevelContextProvider."));return e};var ZO=({featureId:e,openshiftVersion:t})=>{let o=Pe(),r=PC.useMemo(()=>{if(!!t)return o.getFeatureSupportLevel(t,e)},[t,e,o]);if(!mc(r))return null;let s=`${e}-support-level`;return r==="tech-preview"?PC.createElement(fc,{testId:s}):PC.createElement(dc,{testId:s})},ko=ZO;var s_=({versions:e,validate:t,idPostfix:o,...r})=>{let{values:{openshiftVersion:s}}=e_(),n=rs("ASSISTED_INSTALLER_SNO_FEATURE"),[i,a,l]=QO({name:r.name,validate:t}),p=Pe(),c=n_(s),u=E(r.name,"input",o),{t:m}=f(),{value:d}=a,{setValue:g}=l,C=!!e.find(v=>p.isFeatureSupported(v.value,"SNO")),h=i_(v=>g(v?"None":"Full"),[g]),S=p.getFeatureDisabledReason(s,"SNO",m);return a_(()=>{c.current!==s&&!p.isFeatureSupported(s,"SNO")&&h(!1),c.current=s},[s,h,p]),n&&C?Cl(o_,{isInline:!0,fieldId:u},Cl(r_,{hidden:!S,content:S},Cl(t_,{...i,...r,id:u,label:Cl(l_,null,m("ai:Install single node OpenShift (SNO)"),"\xA0",Cl(ko,{featureId:"SNO",openshiftVersion:s})),"aria-describedby":`${u}-helper`,description:Cl(Q,{fieldId:u},m("ai:SNO enables you to install OpenShift using only one host.")),isChecked:d==="None",onChange:h,className:"with-tooltip"}))):null},gc=s_;import{createElement as yl,forwardRef as f_}from"react";import{useField as p_}from"formik";import{FormGroup as c_,NumberInput as u_,Split as m_,SplitItem as Vb}from"@patternfly/react-core";var d_=f_(({label:e,labelIcon:t,helperText:o,isRequired:r,validate:s,idPostfix:n,minValue:i=0,maxValue:a,children:l,formatValue:p,onChange:c,...u},m)=>{let[d,{touched:g,error:C},{setValue:h}]=p_({name:u.name,validate:s}),S=E(u.name,"numberinput",n),v=!(g&&C),y=v?"":C,I=w=>{let F=w<i?i:w;F=a&&F>a?a:F,F=p?p(F):F,h(F),c?.(F)},b=()=>{I(d.value+1)},k=()=>{I(d.value-1)},T=w=>{let F=w.target.value;I(isNaN(F)?0:Number(F))};return yl(c_,{fieldId:S,label:e,helperText:typeof o=="string"?o:yl(Q,{fieldId:S},o),helperTextInvalid:y,validated:v?"default":"error",isRequired:r,labelIcon:t},yl(m_,null,yl(Vb,{isFilled:!0},yl(u_,{...u,value:d.value,onMinus:k,onChange:T,onPlus:b,min:i,max:a,ref:m,id:S,"aria-describedby":`${S}-helper`})),yl(Vb,null,l)))}),ns=d_;import{Fragment as I_,createElement as Sl,useEffect as v_,useState as Hb}from"react";import{useField as g_}from"formik";import{FormGroup as h_,HelperTextItem as C_}from"@patternfly/react-core";import{CodeEditor as y_}from"@patternfly/react-code-editor";var S_=({label:e,labelIcon:t,helperText:o,isRequired:r,validate:s,idPostfix:n,language:i,name:a,description:l,isDisabled:p})=>{let[c,,{setValue:u,setTouched:m}]=g_({name:a,validate:s}),d=E(a,"input",n),[g,C]=Hb(),[h,S]=Hb(),v=vn({name:a,validate:s});return v_(()=>{if(!!h)return g&&g.dispose(),C(h.onDidChangeModelContent(()=>{m(!0),u(h.getModel()?.getValue(),!0)})),()=>{g&&g.dispose()}},[h]),Sl(I_,null,Sl(h_,{fieldId:d,label:e,helperText:typeof o=="string"?o:Sl(Q,{fieldId:d},o),helperTextInvalid:v,validated:!v?"default":"error",isRequired:r,labelIcon:t},l&&Sl(Q,{fieldId:d},Sl(C_,{variant:"indeterminate"},l)),Sl(y_,{code:c.value,isUploadEnabled:!p,isDownloadEnabled:!0,isCopyEnabled:!0,isLanguageLabelVisible:!0,height:"400px",language:i,onEditorDidMount:I=>S(I)})))},Ca=S_;import{createElement as Ho,forwardRef as G_,useState as U_}from"react";import{useField as b_}from"formik";import k_ from"classnames";import{FormGroup as x_,HelperTextItem as T_,TextInput as P_,HelperText as A_,Popover as w_,PopoverPosition as D_,InputGroup as E_,Button as F_}from"@patternfly/react-core";import{CheckCircleIcon as N_,CheckIcon as V_,ExclamationCircleIcon as H_,InfoCircleIcon as M_,TimesIcon as L_}from"@patternfly/react-icons";import{global_palette_green_500 as O_}from"@patternfly/react-tokens/dist/js/global_palette_green_500";import{global_danger_color_100 as __}from"@patternfly/react-tokens/dist/js/global_danger_color_100";import{global_palette_blue_300 as R_}from"@patternfly/react-tokens/dist/js/global_palette_blue_300";var B_=(e,t,o)=>{if(t){if(o?.includes(e))return{variant:"error",icon:Ho(L_,null)}}else return{variant:"indeterminate"};return{variant:"success",icon:Ho(V_,null)}},z_=({value:e,error:t,richValidationMessages:o})=>Ho(A_,{component:"ul",className:"rich-input__rules"},Object.keys(o).map(r=>{let s=B_(o[r],e,t);return Ho(T_,{key:r,isDynamic:!0,component:"li",...s},o[r])})),W_=G_(({label:e,labelIcon:t,helperText:o,isRequired:r,onChange:s,validate:n,idPostfix:i,noDefaultOnChange:a,richValidationMessages:l,...p},c)=>{let[u,m]=U_(!1),[d,{error:g,value:C,touched:h},{setTouched:S}]=b_({name:p.name,validate:n}),v=E(p.name,"input",i),y=!h||!g?.length;return Ho(x_,{fieldId:v,label:e,helperText:typeof o=="string"?o:Ho(Q,{fieldId:v},o),validated:y?"default":"error",isRequired:r,labelIcon:t},Ho(E_,{className:k_("rich-input__group",{"rich_input__group--invalid":!y})},Ho(P_,{...d,...p,ref:c,id:v,isRequired:r,"aria-describedby":`${v}-helper`,onChange:(I,b)=>{!u&&m(!0),!a&&d.onChange(b),S(!0,!1),s&&s(b)},className:"rich-input__text",onBlur:()=>m(!1)}),Ho(w_,{isVisible:u,shouldClose:()=>m(!1),shouldOpen:()=>m(!0),"aria-label":"validation popover",position:D_.top,bodyContent:Ho(z_,{value:C,error:g,richValidationMessages:l})},Ho(F_,{variant:"plain","aria-label":"Validation"},y?C?Ho(N_,{color:O_.value}):Ho(M_,{color:R_.value}):Ho(H_,{color:__.value})))))}),fo=W_;import{useField as K_}from"formik";import{createElement as q_}from"react";var $_=({name:e,label:t,isRequired:o,isDisabled:r,helperText:s})=>{let[n,,{setValue:i,setTouched:a}]=K_(e);return q_(Qr,{name:e,label:t,helperText:s,onBlur:()=>{n.value&&(i(Er(n.value)),a(!0))},spellCheck:!1,isRequired:o,isDisabled:r})},xn=$_;import AC from"react";import{Button as Y_,ButtonVariant as j_,Tooltip as X_}from"@patternfly/react-core";import{MinusCircleIcon as J_}from"@patternfly/react-icons";import Z_ from"classnames";var Q_=1500,eR=({onRemove:e,hideRemoveButton:t=!0,children:o,className:r,removeButtonDataTestId:s,...n})=>AC.createElement(X_,{hidden:t,exitDelay:Q_,flipBehavior:["right","bottom"],position:"right-start",distance:0,content:AC.createElement(Y_,{variant:j_.plain,onClick:e,"data-testid":s},AC.createElement(J_,{size:"sm"})),className:Z_("ai-remove-button__tooltip ",r),...n},o),ya=eR;import{Button as tR,ButtonVariant as oR}from"@patternfly/react-core";import{PlusCircleIcon as rR}from"@patternfly/react-icons";import Mb from"react";var sR=({onAdd:e,variant:t=oR.link,children:o,...r})=>Mb.createElement(tR,{icon:Mb.createElement(rR,null),onClick:e,variant:t,...r},o),hc=sR;import{useField as nR}from"formik";import{Fragment as Ob,createElement as Tn,useEffect as uR,useRef as cR,useState as mR}from"react";import{PencilAltIcon as iR}from"@patternfly/react-icons";import{Split as aR,SplitItem as Lb}from"@patternfly/react-core";var lR=({name:e,isRequired:t,onBlur:o,showErrorMessage:r})=>{let s=cR();return uR(()=>s?.current?.focus(),[]),Tn(J,{name:e,isRequired:t,onBlur:o,ref:s,showErrorMessage:r})},pR=({name:e,isRequired:t,showErrorMessage:o})=>{let[r,s]=mR(!1),[n]=nR({name:e}),i=vn({name:e});return Tn(Ob,null,r?Tn(lR,{name:e,isRequired:t,onBlur:()=>s(!1),showErrorMessage:o}):Tn(Ob,null,Tn(aR,null,Tn(Lb,{className:"ai-pencil-field__text"},n.value),Tn(Lb,null,Tn(iR,{onClick:()=>s(!0)})))),Tn("div",{className:"pf-c-form__helper-text pf-m-error"},i))},Cc=pR;import{overlap as CR}from"cidr-tools";import{Address4 as XC,Address6 as JC}from"ip-address";import rd from"is-cidr";import{isInSubnet as yR}from"is-in-subnet";import{array as Tc,lazy as LR,mixed as MR,number as cd,object as ey,string as Ke}from"yup";import{Address4 as Jm,Address6 as Sa}from"ip-address";import ui from"lodash/fp/head";var Pn=({machineNetworks:e,machineNetworkCidr:t})=>ui(e)?.cidr??t,Gm=({clusterNetworks:e,clusterNetworkCidr:t})=>ui(e)?.cidr??t,Um=({clusterNetworks:e,clusterNetworkHostPrefix:t})=>ui(e)?.hostPrefix??t,Km=({serviceNetworks:e,serviceNetworkCidr:t})=>ui(e)?.cidr??t,vl=e=>e||[],mi=e=>vl(e?.monitoredOperators).filter(t=>t.operatorType==="olm"),$m=(e,t)=>vl(e).some(o=>o.name&&o.name===t),_b=e=>!e.hosts||e.hosts.length<=3,ne=({highAvailabilityMode:e})=>e==="None",Rb=({validationsInfo:e})=>G(e),wC=({machineNetworks:e,serviceNetworks:t,clusterNetworks:o},r)=>{switch(r){case"machineNetworks":return ui(e)?.cidr;case"clusterNetworks":return ui(o)?.cidr;case"serviceNetworks":return ui(t)?.cidr}},DC=({machineNetworks:e,serviceNetworks:t,clusterNetworks:o},r)=>{switch(r){case"machineNetworks":return e&&e[1].cidr;case"clusterNetworks":return o&&o[1].cidr;case"serviceNetworks":return t&&t[1].cidr}},Bb=({clusterNetworks:e})=>ui(e)?.hostPrefix,zb=({clusterNetworks:e})=>e&&e[1].hostPrefix,Vr=({cpuArchitecture:e})=>e===_.ARM,dR=e=>e.hosts?e.hosts.length<5:!0,yc=e=>e.schedulableMastersForcedTrue===void 0?dR(e):e.schedulableMastersForcedTrue,Hr=e=>yc(e)?!0:e.schedulableMasters||!1,is=({platform:e})=>IC.includes(e?.type??"none"),qm=e=>e.canSelectCpuArch!==!1;import fR from"filesize.js";import gR from"fuse.js";var be="-",Wb="ODD";var EC=(e,t)=>["pending-for-input","insufficient","ready","adding-hosts"].includes(e)&&["disabled","disabled-unbound"].includes(t),FC=(e,t)=>["pending-for-input","insufficient","ready","adding-hosts"].includes(e)&&["discovering","discovering-unbound","disconnected","disconnected-unbound","known","known-unbound","insufficient","insufficient-unbound","pending-for-input"].includes(t),NC=(e,t)=>["pending-for-input","insufficient","ready","adding-hosts"].includes(e)&&["discovering","discovering-unbound","known","known-unbound","disconnected","disconnected-unbound","disabled","disabled-unbound","insufficient","insufficient-unbound","resetting","resetting-pending-user-input","resetting-pending-user-action","installing-pending-user-action","pending-for-input","added-to-existing-cluster","error"].includes(t),VC=(e,t)=>["adding-hosts"].includes(e)&&["error","installing-pending-user-action"].includes(t),Sc=(e,t)=>["pending-for-input","insufficient","ready","adding-hosts"].includes(e)&&["discovering","discovering-unbound","known","known-unbound","disconnected","disconnected-unbound","disabled","disabled-unbound","insufficient","insufficient-unbound","pending-for-input"].includes(t),HC=(e,t,o)=>Sc(e,t)&&!o,MC=e=>["insufficient","adding-hosts","ready","pending-for-input"].includes(e),LC=Sc,Il=e=>["installing","finalizing","error","cancelled","installed","adding-hosts"].includes(e),vc=(e,t)=>e.kind==="AddHostsCluster"&&e.status==="adding-hosts"&&t==="known",bl=e=>e.progressStages||[],Ym=e=>e.progress?.currentStage?e.progress:{currentStage:"Starting installation",progressInfo:void 0,installationPercentage:void 0},Ic=e=>{let t=bl(e),o=Ym(e);return Math.round((o?.installationPercentage||0)/100*t.length)},OC=e=>["discovering","discovering-unbound","known","known-unbound","disconnected","disconnected-unbound","insufficient","insufficient-unbound","pending-for-input"].includes(e),jm=(e,t,o)=>{let r=`${ma(t).find(s=>s.value===e.role)?.label||ma(t)[0].label}`;return o&&e.role==="master"&&(r=t("ai:Control plane node, Worker")),`${r}${e.bootstrap?" (bootstrap)":""}`},Xm=e=>!!e.logsCollectedAt&&e.logsCollectedAt!==gl,di=e=>e.controllerLogsCollectedAt!==gl||!!(e.hosts||[]).find(t=>Xm(t)),bc=e=>e.readyHostCount||0,kl=e=>e.enabledHostCount||0,xl=e=>e.totalHostCount||0,An=(e=[])=>e.filter(t=>t.status!=="disabled"),Ot=(e,t)=>e.requestedHostname||t.hostname||"",_C=(e,t)=>{let o=be,{systemVendor:r}=e;return r!==void 0&&(r.virtual?o=t("ai:Virtual machine"):o=t("ai:Bare metal")),o},_t=(...e)=>fR.call(null,...e).toUpperCase().replace(/I/,"i"),we=e=>{let{inventory:t=""}=e;return G(t)||{}},RC=(e,t)=>{if(!t)return e;let o=e.map(s=>{let{inventory:n=""}=s,i=G(n)||{};return{hostname:Ot(s,i),host:s}});return new gR(o,{ignoreLocation:!0,keys:["hostname"]}).search(t).map(({item:s})=>s.host)},Gb=e=>Object.keys(e).reduce((t,o)=>{let r=e[o].filter(s=>s.status==="failure");return[...t,...r]},[]),BC=e=>{let t=Gb(e).map(o=>o.id);if(!t.length)return!1;for(let o of t)if(!["ntp-synced","container-images-available"].includes(o))return!1;return!0};var as=e=>Jm.isValid(e)?new Jm(e):Sa.isValid(e)?new Sa(e):null,Zm=e=>{if(e){let t=e.startAddress().correctForm(),o=e.endAddress().correctForm();return`(${t} - ${o})`}return""},Ub=e=>e?`${e.address} ${Zm(e)}`:"",wn=e=>{let t=e.hosts?.reduce((o,r)=>{let s=G(r.inventory)||{};return o={...o,[r.id]:Ot(r,s)},o},{})||{};return e.hostNetworks?.map(o=>({subnet:o.cidr||"",hostIDs:o.hostIds?.map(r=>t[r]||r)||[],humanized:Ub(as(o.cidr))}))||[]},zC=e=>e?as(e)?.address:Ue,WC=(e,t)=>{let o=t.map(r=>r.cidr);return e.length===t.length&&e.every(r=>o.includes(r.cidr))},GC=(e,t)=>e.length===t.length&&e.every(o=>t.find(r=>r.cidr===o.cidr&&r.hostPrefix===o.hostPrefix)),UC=(e,t,o)=>Gm(e)!==t.clusterNetworkCidr||Um(e)!==t.clusterNetworkHostPrefix||Km(e)!==t.serviceNetworkCidr||Boolean(e.networkType)&&e.networkType!==o,kc=(e,t=!1)=>!(e||t),fi=(e,t=!1)=>e||t?kn:ts,KC=e=>e.some(t=>Jm.isValid(t.subnet))&&e.some(t=>Sa.isValid(t.subnet)),$C=e=>e&&e.length>1&&Jm.isValid(e[0].cidr||"")&&Sa.isValid(e[1].cidr||""),va=({machineNetworks:e,clusterNetworks:t,serviceNetworks:o})=>$C(e)&&$C(t)&&$C(o),xc=({clusterNetworkCidr:e,machineNetworkCidr:t,serviceNetworkCidr:o})=>Sa.isValid(e||"")||Sa.isValid(t||"")||Sa.isValid(o||""),qC=e=>({usePlatformIntegration:is(e),schedulableMasters:Hr(e)}),YC=()=>({nodeLabeling:""});function hR(e,t=["configuration","hosts-data","network","operators"]){let o={};return Object.keys(e).forEach(r=>{t.includes(r)&&(o[r]=e[r])}),o}function jC(e,t=["failure","pending","error"]){let o={};return Object.entries(e).forEach(([r,s=[]])=>{let n=s.filter(i=>t.includes(i.status));n.length&&(o[r]=n)}),o}var xo=e=>({INVALID_LENGTH_OCM:e("ai:1-54 characters"),INVALID_LENGTH_ACM:e("ai:2-54 characters"),INVALID_VALUE_OCM:gi(e).INVALID_VALUE,INVALID_VALUE_ACM:e("ai:Use lowercase alphanumeric characters or hyphen (-)"),INVALID_START_END:e("ai:Start and end with a lowercase letter or a number."),NOT_UNIQUE:e("ai:Must be unique")}),Qm=e=>({INVALID_LENGTH:xo(e).INVALID_LENGTH_OCM,INVALID_VALUE:xo(e).INVALID_VALUE_OCM,INVALID_START_END:xo(e).INVALID_START_END}),ed=e=>({INVALID_LENGTH:xo(e).INVALID_LENGTH_OCM,INVALID_VALUE:xo(e).INVALID_VALUE_OCM,INVALID_START_END:xo(e).INVALID_START_END,NOT_UNIQUE:xo(e).NOT_UNIQUE}),td=e=>({INVALID_LENGTH:xo(e).INVALID_LENGTH_ACM,INVALID_VALUE:xo(e).INVALID_VALUE_ACM,INVALID_START_END:xo(e).INVALID_START_END,NOT_UNIQUE:xo(e).NOT_UNIQUE}),gi=e=>({INVALID_LENGTH:e("ai:1-253 characters"),NOT_UNIQUE:e("ai:Must be unique"),INVALID_VALUE:e("ai:Use lowercase alphanumeric characters, dot (.) or hyphen (-)"),INVALID_START_END:e("ai:Must start and end with an lowercase alphanumeric character"),INVALID_FORMAT:e("ai:Number of characters between dots (.) must be 1-63")}),Mr=e=>({...gi(e),LOCALHOST_ERR:e('ai:Do not use forbidden words, for example: "localhost".')}),Tl=e=>({INVALID_LENGTH:e("ai:1-63 characters"),INVALID_VALUE:e("ai:Use alphanumeric characters, dot (.), underscore (_) or hyphen (-)"),INVALID_START_END:e("ai:Must start and end with an alphanumeric character")}),od=e=>({INVALID_VALUE:e("ai:The Value is not valid BMC address, supported protocols are redfish-virtualmedia or idrac-virtualmedia.")}),Pl=["localhost","localhost.localdomain","localhost4","localhost4.localdomain4","localhost6","localhost6.localdomain6"];var Kb=/^[a-zA-Z0-9]+$/,$b=/^[a-z0-9](.*[a-z0-9])?$/,SR=/^[a-z0-9-.]*$/,vR=/^[a-z0-9](.*[a-z0-9])?$/,IR=/^[.-a-z0-9]?(([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)*)[.-a-z0-9]?$/,bR=/^[a-z0-9-]*$/,kR=/^(ssh-rsa|ssh-ed25519|ecdsa-[-a-z0-9]*) AAAA[0-9A-Za-z+/]+[=]{0,3}( .+)?$/,qb=/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/,xR=/^([a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62}){1}(\.[a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62})*[._]?$/,TR="0.0.0.0",PR="0000:0000:0000:0000:0000:0000:0000:0000",AR=/^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$/,wR=/^[^.]{1,63}(?:[.][^.]{1,63})*$/,DR=/^((redfish-virtualmedia|idrac-virtualmedia)(\+https?)?:(\/\/([a-z0-9\-._~%!$&'()*+,;=]+@)?([a-z0-9\-._~%]+|\[[a-f0-9:.]+\]|\[v[a-f0-9][a-z0-9\-._~%!$&'()*+,;=:]+\])(:[0-9]+)?(\/[a-z0-9\-._~%!$&'()*+,;=:@]+)*\/?|(\/?[a-z0-9\-._~%!$&'()*+,;=:@]+(\/[a-z0-9\-._~%!$&'()*+,;=:@]+)*\/?)?)|([a-z0-9\-._~%!$&'()*+,;=@]+(\/[a-z0-9\-._~%!$&'()*+,;=:@]+)*\/?|(\/[a-z0-9\-._~%!$&'()*+,;=:@]+)+\/?))(\?[a-z0-9\-._~%!$&'()*+,;=:@/?]*)?(#[a-z0-9\-._~%!$&'()*+,;=:@/?]*)?$/i,ER=/^[a-zA-Z0-9-._]*$/,Al=(e,t,o="",r,s=!1)=>{let n=xo(e);return Ke().required("Required").matches(s?IR:bR,{message:s?n.INVALID_VALUE_OCM:n.INVALID_VALUE_ACM,excludeEmptyString:!0}).matches(vR,{message:n.INVALID_START_END,excludeEmptyString:!0}).min(s?1:2,s?n.INVALID_LENGTH_OCM:n.INVALID_LENGTH_ACM).max(54,s?n.INVALID_LENGTH_OCM:n.INVALID_LENGTH_ACM).when("useRedHatDnsService",{is:!0,then:Ke().test("is-name-unique",n.NOT_UNIQUE,i=>{let a=`${i}.${o}`;return!i||!t.includes(a)}),otherwise:Ke().test("is-name-unique",n.NOT_UNIQUE,i=>r?!i||!t.includes(i):!0)})},go=Ke().test("ssh-public-key",'SSH public key must consist of "[TYPE] key [[EMAIL]]", supported types are: ssh-rsa, ssh-ed25519, ecdsa-[VARIANT]. A single key can be provided only.',e=>e?!!Sn(e).match(kR):!0),ws=Ke().test("is-well-formed-json","Invalid pull secret format. You must use your Red Hat account's pull secret.",e=>{let t=!0;if(!e)return t;try{let o=JSON.parse(e);return o.constructor.name==="Object"&&!!o?.auths&&o.auths.constructor.name==="Object"}catch{return!t}}),sd=Ke().test("ip-validation","Not a valid IP address",e=>XC.isValid(e)||JC.isValid(e)),Ds=Ke().matches(AR,{message:'Value "${value}" is not valid MAC address.',excludeEmptyString:!0}),ZC=(e,{machineNetworks:t,hostSubnet:o})=>Ke().test("vip-validation","IP Address is outside of selected subnet",function(r){if(!r)return!0;try{sd.validateSync(r)}catch(n){return this.createError({message:U(n)})}let s=[];if(t){let n=t?.map(i=>i.cidr);s.push(...e.filter(i=>n?.includes(i.subnet)))}else{let n=e.find(i=>i.subnet===o);n&&s.push(n)}for(let n of s)if(n?.subnet)if(n.hostIDs.length){if(yR(r,n.subnet))return!0}else return!0;return!1}),FR=({ingressVip:e,apiVip:t})=>Ke().test("vip-uniqueness-validation","The Ingress and API IP addresses cannot be the same.",o=>o?e!==t:!0),NR=(e,t)=>Ke().test("required-once-set",t||"The value is required.",o=>o||!e),Ia=Ke().when(["managedNetworkingType"],{is:"clusterManaged",then:Ke().notOneOf([Ue],"Host subnet must be selected.")}),ls=(e,t,o)=>MR().when(["vipDhcpAllocation","managedNetworkingType"],{is:(r,s)=>!r&&s!=="userManaged",then:NR(o,"Required. Please provide an IP address").concat(ZC(e,t)).concat(FR(t)).when("hostSubnet",{is:r=>r!==Ue,then:Ke().required("Required. Please provide an IP address")})}),pr=e=>Ke().required("A value is required.").test("valid-ip-address","Invalid IP address block. Expected value is a network expressed in CIDR notation (IP/netmask). For example: 123.123.123.0/24, 2055:d7a::/116",(t="")=>rd.v4(t)||rd.v6(t)).test("valid-netmask",`IPv4 netmask must be between 1-25 and include at least 128 addresses.
4
+ IPv6 netmask must be between 8-128 and include at least 256 addresses.`,(t="")=>{let o=parseInt(t.split("/")[1]);return rd.v4(t)&&0<o&&o<26||rd.v6(t)&&7<o&&o<129}).test("cidr-is-not-unspecified","The specified CIDR is invalid because its resulting routing prefix matches the unspecified address.",(t="")=>{let o=as(t);if(o===null)return!1;let r=o.startAddress().address;return r!==TR&&r!==PR}).test("valid-cidr-base-address",({value:t})=>`${t} is not a valid CIDR`,(t="")=>{let o=as(t);if(o===null)return!1;let r=o.startAddress().parsedAddress;return o.parsedAddress.every((i,a)=>i===r[a])}).test("cidrs-can-not-overlap","Provided CIDRs can not overlap.",t=>{try{if(t&&e&&e.length>0)return!CR(t,e)}catch{return!1}return!0}),ba=Ke().test("dns-name-label-length","Single label of the DNS name can not be longer than 63 characters.",(e="")=>e.split(".").every(t=>t.length<=63)).matches(qb,{message:'Value "${value}" is not valid DNS name. Example: basedomain.example.com',excludeEmptyString:!0}),Dn=e=>{let t="The host prefix is required.",o="The host prefix is a number between 1 and 32 for IPv4 and between 8 and 128 for IPv6.",r=(e||"").split("/")[1];if(!r)return cd().required(t).min(1,o).max(32,o);let s=parseInt(r);isNaN(s)&&(s=1);let n="The host prefix is a number between size of the cluster network CIDR range",i=`${n} (${s}) and 25.`,a=`${n} (8) and 128.`;return JC.isValid(e||"")?cd().required(t).min(8,a).max(128,a):XC.isValid(e||"")?cd().required(t).min(s,i).max(25,i):cd().required(t)},Es=(e,t,o)=>{let r=gi(e);return Ke().min(1,r.INVALID_LENGTH).max(253,r.INVALID_LENGTH).test(r.INVALID_START_END,r.INVALID_START_END,s=>{let n=s?.trim();return n?!!n[0].match($b)&&(n[n.length-1]?!!n[n.length-1].match($b):!0):!0}).matches(wR,r.INVALID_FORMAT).matches(SR,{message:r.INVALID_VALUE,excludeEmptyString:!0}).test(r.NOT_UNIQUE,r.NOT_UNIQUE,s=>!s||s===o?!0:!t.find(n=>n===s)).notOneOf(Pl,Mr(e).LOCALHOST_ERR)},VR="Provide a valid HTTP URL.",Mo=(e,t)=>Ke().test("http-proxy-no-empty-validation","At least one of the HTTP or HTTPS proxy URLs is required.",o=>!e.enableProxy||o||e[t]).test("http-proxy-validation",VR,o=>{if(!o)return!0;try{return new URL(o).protocol==="http:"}catch{return!1}}),HR=e=>!e||e!=="",QC=(e,t=qb)=>{if(!e||e.match(t))return!0;try{sd.validateSync(e)}catch{return!1}return!0},Fs=Ke().test("no-proxy-validation","Provide a comma separated list of valid DNS names or IP addresses.",e=>{if(!e||e==="*")return!0;let t=Er(e).split(",").map(o=>o.charAt(0)==="."?o.substring(1):o);return t.every(HR)&&t.every(o=>QC(o,xR))}),wl=Ke().test("ntp-source-validation","Provide a comma separated list of valid DNS names or IP addresses.",e=>e?Er(e).split(",").every(t=>QC(t)):!0),Dl=Ke().test("day2-api-vip","Provide a valid DNS name or IP Address",e=>e?QC(e):!0),nd=e=>{let t=od(e);return Ke().matches(DR,{message:t.INVALID_VALUE,excludeEmptyString:!0})},id=e=>{let t=Tl(e);return Ke().min(1,t.INVALID_LENGTH).max(63,t.INVALID_LENGTH).test(t.INVALID_START_END,t.INVALID_START_END,o=>{let r=o?.trim();return r?!!r[0].match(Kb)&&(r[r.length-1]?!!r[r.length-1].match(Kb):!0):!0}).matches(ER,{message:t.INVALID_VALUE,excludeEmptyString:!0})},ad=Tc().of(ey({cidr:Ia,clusterId:Ke()})),ld=Tc().of(LR(e=>ey({cidr:pr(void 0),hostPrefix:Dn(e.cidr),clusterId:Ke()}))),pd=Tc().of(ey({cidr:pr(void 0),clusterId:Ke()})),El=e=>Tc().max(2,`Maximum number of ${e} subnets in dual stack is 2.`).test("dual-stack-ipv4","First network has to be IPv4 subnet.",t=>t[0].cidr&&XC.isValid(t[0].cidr)).test("dual-stack-ipv6","Second network has to be IPv6 subnet.",t=>t[1].cidr&&JC.isValid(t[1].cidr)),Fl=Tc().test("single-stack","All network subnets must be IPv4.",e=>Vm(e));import{createElement as Nl,useState as zR}from"react";import{useField as OR}from"formik";import{FormGroup as _R,Label as RR}from"@patternfly/react-core";import BR from"react-tagsinput";var Pc=({value:e,onClose:t})=>Nl(RR,{className:"label-field__value",variant:"outline",onClose:t},e),ud=({label:e,labelIcon:t,helperText:o,isRequired:r,onChange:s,validate:n,idPostfix:i,...a})=>{let{t:l}=f(),[p,c]=zR(""),[u,{touched:m,error:d},{setValue:g,setTouched:C}]=OR({name:a.name,validate:n}),h=E(a.name,"input",i),S=!(m&&d);return Nl(_R,{fieldId:h,label:e,helperText:typeof o=="string"?o:Nl(Q,{fieldId:h},o),helperTextInvalid:S?"":d,validated:S?"default":"error",isRequired:r,labelIcon:t},l("ai:Enter key=value and then press 'enter' or 'space' or use a ',' to input the label."),Nl("div",{className:"co-search-input pf-c-form-control"},Nl(BR,{...u,onChange:y=>{g(y),c(""),s&&s(y),!m&&C(!0)},addKeys:[13,32,188],renderTag:({tag:y,key:I,onRemove:b,getTagDisplayValue:k})=>Nl(Pc,{key:I,onClose:()=>b(I),value:k(y)}),addOnBlur:!0,inputProps:{autoFocus:!1,className:"label-field__input",placeholder:u.value?.length?"":"app=frontend",spellCheck:"false",id:"tags-input",value:p,onChange:y=>c(y.target.value),["data-test"]:"tags-input"}})))};import Vl from"react";import{Title as WR,EmptyState as GR,EmptyStateBody as UR,Bullseye as KR,EmptyStateIcon as $R,EmptyStateSecondaryActions as qR}from"@patternfly/react-core";import{SearchIcon as YR}from"@patternfly/react-icons";var jR=({title:e="No results found",content:t,icon:o=YR,primaryAction:r,secondaryActions:s})=>Vl.createElement(KR,null,Vl.createElement(GR,null,Vl.createElement($R,{icon:o}),Vl.createElement(WR,{headingLevel:"h2"},e),t&&Vl.createElement(UR,null,t),r,s&&Vl.createElement(qR,null,s))),ot=jR;import Ns from"react";import{Title as XR,EmptyState as JR,EmptyStateBody as ZR,Bullseye as QR,EmptyStateIcon as eB,EmptyStateVariant as tB,Button as oB,ButtonVariant as rB,EmptyStateSecondaryActions as sB}from"@patternfly/react-core";import{ExclamationCircleIcon as nB}from"@patternfly/react-icons";import{global_danger_color_200 as iB}from"@patternfly/react-tokens";var aB=({fetchData:e})=>{let{t}=f();return Ns.createElement(Ns.Fragment,null,t("ai:There was an error retrieving data. Check your connection and")," ",e?Ns.createElement(oB,{onClick:e,variant:rB.link,isInline:!0},t("ai:try again")):t("ai:try again"),".")},lB=({title:e="Error loading data",content:t,fetchData:o,icon:r=nB,iconColor:s=iB.value,variant:n=tB.small,primaryAction:i,actions:a})=>Ns.createElement(QR,null,Ns.createElement(JR,{variant:n},Ns.createElement(eB,{icon:r,color:s}),Ns.createElement(XR,{headingLevel:"h2"},e),Ns.createElement(ZR,null,t||Ns.createElement(aB,{fetchData:o})),i,a&&Ns.createElement(sB,null,a))),j=lB;import Ac from"react";import{EmptyState as pB,EmptyStateBody as cB,Bullseye as uB,EmptyStateVariant as mB,Spinner as dB,EmptyStateSecondaryActions as fB}from"@patternfly/react-core";var gB=({content:e,primaryAction:t,secondaryActions:o})=>Ac.createElement(uB,null,Ac.createElement(pB,{variant:mB.small},Ac.createElement(dB,{size:"xl"}),e&&Ac.createElement(cB,null,e),t,o&&Ac.createElement(fB,null,o))),z=gB;import Yb from"react";import{Button as hB,ToolbarItem as CB}from"@patternfly/react-core";var yB=({...e})=>Yb.createElement(CB,null,Yb.createElement(hB,{...e})),Rt=yB;import jb from"react";import{ToolbarItem as SB,Text as vB}from"@patternfly/react-core";var IB=e=>jb.createElement(SB,null,jb.createElement(vB,{...e})),ty=IB;import oy from"react";import{ToolbarGroup as bB,ToolbarItem as kB,Progress as xB,ProgressSize as TB}from"@patternfly/react-core";var PB=({style:e,size:t=TB.sm})=>oy.createElement(bB,{style:{flexGrow:1}},oy.createElement(kB,{style:{flexGrow:1}},oy.createElement(xB,{style:{...e,gridGap:0},size:t}))),ry=PB;import AB from"react";import{ToolbarGroup as wB}from"@patternfly/react-core";var DB=({children:e})=>AB.createElement(wB,{alignment:{md:"alignRight"}},e),wc=DB;import{createElement as Hl,useEffect as HB}from"react";import{useField as EB}from"formik";import{FormGroup as FB,TextContent as NB,Text as VB}from"@patternfly/react-core";var md=({label:e,name:t,children:o,helperText:r,helperTextInvalid:s,isRequired:n,isValid:i=!0})=>{let a=E(t,"static");return Hl(FB,{fieldId:a,label:e,helperText:typeof r=="string"?r:Hl(Q,{fieldId:a},r),helperTextInvalid:s,validated:i?"default":"error",isRequired:n},o)},hi=({value:e,...t})=>{let[,,o]=EB({name:t.name});return HB(()=>{o.setValue(e)},[e]),Hl(md,{...t})},Vs=({children:e,...t})=>{let o=E(t.name,"static");return Hl(md,{...t},Hl(NB,null,Hl(VB,{component:"p",id:o,"aria-describedby":`${o}-helper`},e)))};import{createElement as oo}from"react";import{ActionList as Pz,ActionListItem as Lc,Button as iy,ButtonVariant as ay,Spinner as Az,SplitItem as wz,Stack as Dz,StackItem as ly,Text as Ez,TextVariants as Fz}from"@patternfly/react-core";import ik from"react";import{ButtonVariant as kz}from"@patternfly/react-core";import Lo from"react";import{Button as gz,Modal as hz,ButtonVariant as Cz,ModalVariant as yz,ModalBoxBody as Sz}from"@patternfly/react-core";import{ExclamationTriangleIcon as vz}from"@patternfly/react-icons";import{global_warning_color_100 as Iz}from"@patternfly/react-tokens";import Mc,{useEffect as fz,useState as ny}from"react";import cr from"react";import{Label as _B}from"@patternfly/react-core";import{TableVariant as RB,Table as BB,TableBody as zB,breakWord as WB}from"@patternfly/react-table";import{InfoCircleIcon as GB,ExclamationTriangleIcon as UB,ExclamationCircleIcon as KB,SearchIcon as $B}from"@patternfly/react-icons";var to=e=>e?new Date(e).toLocaleString():be,Xb=e=>e?new Date(e).toLocaleTimeString():be;import MB from"lodash/upperFirst";import LB from"lodash/endsWith";import{SortByDirection as OB}from"@patternfly/react-table";var dd=(e,t)=>[{heightAuto:!0,cells:[{props:{colSpan:t},title:e}]}],Ml=(e,t)=>(o,r)=>{let s=e.direction===OB.asc?1:-1,n=t(o,e.index),i=t(r,e.index),a=typeof n=="string"?n:n?.sortableValue,l=typeof i=="string"?i:i?.sortableValue;return typeof a=="string"||typeof l=="string"?(a=a||"",a.localeCompare(l)*s):(a=a||0,l=l||0,(a-l)*s)},To=e=>`${MB(e)}${LB(e,".")||e===""?"":"."}`,Ll=e=>({title:to(e),sortableValue:e?new Date(e).getTime():0});var Jb=()=>({className:"pf-m-break-word"}),fd=()=>({className:"pf-m-fit-content"}),Zb=()=>({className:"pf-m-nowrap"}),Qb=()=>({className:"pf-m-truncate"}),ek=()=>({className:"pf-m-wrap"}),gd=()=>({className:"table-no-padding"});var qB=({rowData:e})=>e?.props?.event.sortableTime+e?.props?.event.message,YB=e=>{switch(e){case"info":return"blue";case"warning":return"orange";case"error":return"red";case"critical":return"purple"}},jB=e=>{switch(e){case"info":return cr.createElement(GB,null);case"warning":return cr.createElement(UB,null);case"error":case"critical":return cr.createElement(KB,null)}},XB=({events:e,className:t})=>{let{t:o}=f();if(e.length===0)return cr.createElement(ot,{icon:$B,title:o("ai:No events found"),content:o("ai:There are no events found.")});let s=e.map(n=>({...n,sortableTime:new Date(n.eventTime).getTime()})).sort((n,i)=>i.sortableTime-n.sortableTime).map(n=>({cells:[{title:cr.createElement("strong",null,to(n.eventTime))},{title:cr.createElement(cr.Fragment,null,n.severity!=="info"&&cr.createElement(cr.Fragment,null,cr.createElement(_B,{color:YB(n.severity),icon:jB(n.severity)},n.severity)," "),n.message)}],props:{event:n}}));return cr.createElement("div",{className:t},cr.createElement(BB,{rows:s,cells:[{title:o("ai:Time"),cellTransforms:[fd,gd]},{title:o("ai:Message"),cellTransforms:[WB]}],variant:RB.compact,"aria-label":o("ai:Events table"),borders:!1},cr.createElement(zB,{rowKey:qB})))},ka=XB;import Ci from"react";import{Button as pz,ButtonVariant as cz}from"@patternfly/react-core";import{SearchIcon as uz}from"@patternfly/react-icons";import $e from"react";import tk from"lodash/capitalize";import{Toolbar as JB,ToolbarItem as ZB,ToolbarContent as QB,ToolbarFilter as ok,Button as ez,ButtonVariant as tz,InputGroup as oz,Select as rk,SelectOption as Dc,TextInput as rz,Badge as sz}from"@patternfly/react-core";import{SearchIcon as nz,FilterIcon as iz}from"@patternfly/react-icons";var sk=({text:e})=>$e.createElement($e.Fragment,null,$e.createElement(iz,null)," ",e),Ec="select-all-actions",Fc="cluster-level-action",Nc="deleted-hosts-action",sy=e=>(e||[]).map(t=>{let o=G(t.inventory)||{},r=t.requestedHostname;return o.hostname!==t.requestedHostname&&(r+=` (${o.hostname})`),{hostname:r,id:t.id}}),hd=e=>({fulltext:"",hosts:sy(e.hosts).map(t=>t.id),severity:[],clusterLevel:!0,orphanedHosts:!0,selectAll:!0}),az=(e,t)=>t.filter(o=>o.severity===e).length,lz=({filters:e,setFilters:t,cluster:o,events:r})=>{let[s,n]=$e.useState(!1),[i,a]=$e.useState(!1),l=$e.useMemo(()=>sy(o.hosts),[o.hosts]),p=()=>{t(hd(o))},c=(I,b,k)=>{let T=(O,V,Y,he)=>({...he,[O]:V?[...he[O],Y]:he[O].filter(Z=>Z!==Y)}),w=(O,V)=>({...V,selectAll:I==="severity"?V.selectAll:V.hosts.length===O&&V.orphanedHosts&&V.clusterLevel}),F=T(I,b,k,e);F=w(o.hosts?.length||0,F),t(F)},u=()=>n(!s),m=(I,b)=>{let k=I.target.checked;switch(b){case Ec:t(k?{...e,hosts:sy(o.hosts).map(T=>T.id),clusterLevel:!0,orphanedHosts:!0,selectAll:!0}:{...e,clusterLevel:!1,orphanedHosts:!1,selectAll:!1,hosts:[]});break;case Nc:t({...e,orphanedHosts:k,selectAll:k&&e.clusterLevel&&e.hosts.length===o.hosts?.length});break;case Fc:t({...e,clusterLevel:k,selectAll:k&&e.orphanedHosts&&e.hosts.length===o.hosts?.length});break;default:c("hosts",k,b)}},d=()=>a(!i),g=(I,b)=>{c("severity",I.target.checked,b)},C=I=>{t({...e,fulltext:I})},h=(I,b)=>{if(I){let k=b.key||b;t({...e,[I]:e[I].filter(T=>T!==k)})}else p()},S=I=>{t({...e,[I]:[]})},v=()=>{let I=e.clusterLevel?[...e.hosts,Fc]:e.hosts;return I=e.orphanedHosts?[...I,Nc]:I,I=e.selectAll?[...I,Ec]:I,I},{t:y}=f();return $e.createElement(JB,{id:"clusters-events-toolbar",className:"pf-m-toggle-group-container",collapseListedFiltersBreakpoint:"xl",clearAllFilters:p},$e.createElement(QB,null,$e.createElement(ok,{categoryName:"hosts"},$e.createElement(rk,{variant:"checkbox","aria-label":"hosts",onToggle:u,onSelect:m,selections:v(),customBadgeText:e.hosts?.length||0,isOpen:s,placeholderText:$e.createElement(sk,{text:"Hosts"}),isDisabled:l.length===0},[$e.createElement(Dc,{inputId:`checkbox-${Ec}`,key:Ec,value:Ec},y("ai:Select All")),$e.createElement(Dc,{inputId:`checkbox-${Fc}`,key:Fc,value:Fc},y("ai:Cluster-level events")),$e.createElement(Dc,{inputId:`checkbox-${Nc}`,key:Nc,value:Nc},y("ai:Deleted hosts")),...l.map(I=>$e.createElement(Dc,{key:I.id,value:I.id},I.hostname))])),$e.createElement(ok,{chips:e.severity.map(I=>({key:I,node:tk(I)})),deleteChip:h,deleteChipGroup:S,categoryName:"severity"},$e.createElement(rk,{variant:"checkbox","aria-label":"Severity",onToggle:d,onSelect:g,selections:e.severity,isOpen:i,placeholderText:$e.createElement(sk,{text:"Severity"})},dC.map(I=>$e.createElement(Dc,{"data-testid":`${I}-filter-option`,key:I,value:I},tk(I)," ",$e.createElement(sz,{isRead:!0},az(I,r)))))),$e.createElement(ZB,null,$e.createElement(oz,null,$e.createElement(rz,{name:"search-text",id:"search-text",type:"search","aria-label":"text to be searched",onChange:C,value:e.fulltext,placeholder:y("ai:Filter by text")}),$e.createElement(ez,{variant:tz.control,"aria-label":"search text button"},$e.createElement(nz,null))))))},Vc=lz;var mz=(e,t=[],o)=>t.filter(r=>e.severity.length===0||e.severity.includes(r.severity)).filter(r=>!r.hostId||e.hosts.includes(r.hostId)||e.orphanedHosts&&!(o||[]).find(s=>s.id===r.hostId)).filter(r=>r.hostId||e.clusterLevel).filter(r=>!e.fulltext||(r.message||"").toLowerCase().includes(e.fulltext.toLowerCase())),dz=({events:e,cluster:t,className:o})=>{let[r,s]=Ci.useState(()=>hd(t)),n=Ci.useMemo(()=>mz(r,e,t.hosts),[r,e,t.hosts]),{t:i}=f();return Ci.createElement(Ci.Fragment,null,Ci.createElement(Vc,{filters:r,setFilters:s,cluster:t,events:e}),n.length===0&&e.length>0?Ci.createElement(ot,{icon:uz,title:i("ai:No matching events"),content:i("ai:There are no events that match the current filters. Adjust or clear the filters to view events."),primaryAction:Ci.createElement(pz,{variant:cz.primary,onClick:()=>s(hd(t)),id:"empty-state-cluster-events-clear-filters-button","data-ouia-id":"button-clear-events-filter"},i("ai:Clear filters"))}):Ci.createElement(ka,{events:n,className:o}))},Hc=dz;var nk=({onFetchEvents:e,...t})=>{let[o,r]=ny(),[s,n]=ny(0),[i,a]=ny(""),{cluster:l,hostId:p,entityKind:c,className:u}=t;fz(()=>{let d;return e({clusterId:l.id,hostId:p},g=>{r(g),a(""),d=setTimeout(()=>n(Date.now()),aC)},a),()=>clearTimeout(d)},[s,l.id,p,e]);let m=Mc.useCallback(()=>{n(Date.now())},[n]);return i?Mc.createElement(j,{title:i,fetchData:m}):o?c==="cluster"?Mc.createElement(Hc,{events:o,cluster:l,className:u}):Mc.createElement(ka,{events:o,className:u}):Mc.createElement(z,null)};import{Trans as bz}from"react-i18next";var Ol=({ButtonComponent:e=Rt,onFetchEvents:t,onClick:o,hostId:r,cluster:s,entityKind:n,children:i,title:a,fallbackEventsURL:l,...p})=>{let[c,u]=Lo.useState(!1),m=()=>u(!1);return Lo.createElement(Lo.Fragment,null,Lo.createElement(e,{...p,onClick:o||(()=>u(!0))},i||a),Lo.createElement(xa,{title:a,isOpen:c,onClose:m,hostId:r,cluster:s,entityKind:n,onFetchEvents:t,fallbackEventsURL:l}))},xa=({onFetchEvents:e,hostId:t,cluster:o,entityKind:r,onClose:s,isOpen:n,title:i,fallbackEventsURL:a})=>{let{t:l}=f();return Lo.createElement(hz,{title:i,isOpen:n,"aria-label":l("ai:Displays events"),hasNoBodyWrapper:!0,actions:[Lo.createElement(gz,{key:"close",variant:Cz.primary,onClick:s},l("ai:Close"))],onClose:s,variant:yz.large,className:"events-modal"},Lo.createElement(Sz,{className:"events-modal__body"},a?Lo.createElement(j,{title:l("ai:Could not load events"),content:Lo.createElement(Lo.Fragment,null,Lo.createElement(bz,{t:l},"ai:Could not load events from the standard location. You can check the events in the ",Lo.createElement(tt,{href:a},"raw format"),".")),icon:vz,iconColor:Iz.value}):Lo.createElement(nk,{hostId:t,cluster:o,entityKind:r,onFetchEvents:e,className:"events-modal__event-list"})))};import{MonitoringIcon as xz}from"@patternfly/react-icons";var Tz=({cluster:e,onFetchEvents:t})=>ik.createElement(Ol,{id:"cluster-events-button",entityKind:"cluster",icon:ik.createElement(xz,null),cluster:e,title:"Cluster Events",variant:kz.secondary,onFetchEvents:t},"View Cluster Events"),yi=Tz;var Lr=({alerts:e,errors:t,onNext:o,onBack:r,onCancel:s,isNextDisabled:n,isBackDisabled:i,leftExtraActions:a,isSubmitting:l,submittingText:p,nextButtonText:c,cluster:u,onFetchEvents:m})=>{let{t:d}=f();return p=p||d("ai:Saving changes..."),oo(Dz,{hasGutter:!0},e&&oo(ly,null,e),t&&oo(ly,null,t),oo(ly,null,oo(Pz,{"data-testid":"wizard-step-actions"},a,o&&oo(Lc,null,oo(iy,{variant:ay.primary,name:"next",onClick:o,isDisabled:n},c||d("ai:Next"))),r&&oo(Lc,null,oo(iy,{variant:ay.secondary,name:"back",onClick:r,isDisabled:i},d("ai:Back"))),oo(Lc,null,oo(iy,{variant:ay.link,name:"cancel",onClick:s,isDisabled:!1},d("ai:Cancel"))),l&&oo(Lc,null,oo(Ez,{component:Fz.small},oo(Az,{size:"sm"})," ",p)),oo(wz,{isFilled:!0}),u&&m&&oo(Lc,null,oo(yi,{cluster:u,onFetchEvents:m})))))};import ak from"react";var ae=({condition:e=!1,children:t})=>e?ak.createElement(ak.Fragment,null,t):null;import _l from"react";import{DropdownItem as Nz,DropdownToggle as Vz,Dropdown as Hz}from"@patternfly/react-core";import{CaretDownIcon as Mz}from"@patternfly/react-icons";var Cd=({current:e,defaultValue:t,items:o,setValue:r,isDisabled:s,idPrefix:n,position:i,menuAppendTo:a})=>{let[l,p]=_l.useState(!1),c=o.map(({value:d,label:g,description:C})=>_l.createElement(Nz,{key:d,id:d,description:C},g)),u=_l.useCallback(d=>{r(d?.currentTarget.id),p(!1)},[r,p]),m=_l.useMemo(()=>_l.createElement(Vz,{onToggle:d=>p(!s&&d),toggleIndicator:Mz,isDisabled:s,id:n?`${n}-dropdown-toggle-items`:void 0,className:"role-dropdown"},e||t),[p,e,s,t,n]);return _l.createElement(Hz,{onSelect:u,dropdownItems:c,toggle:m,isOpen:l,isPlain:!0,id:n?`${n}-dropdown-toggle`:void 0,position:i,menuAppendTo:a})};import Hs from"react";import{TextContent as Lz,TextList as lk,TextListVariants as pk,TextListItem as yd,TextListItemVariants as Sd,Text as Oz}from"@patternfly/react-core";var bt=({children:e,title:t,titleComponent:o="h2"})=>Hs.createElement(Lz,null,t&&Hs.createElement(Oz,{component:o},t),Hs.createElement(lk,{component:pk.dl,className:"detail-list"},e)),N=({title:e,value:t="",idPrefix:o,testId:r,isHidden:s=!1,classNameValue:n})=>s?null:Hs.createElement(Hs.Fragment,null,Hs.createElement(yd,{component:Sd.dt,id:o?`${o}-title`:void 0,"data-testid":r?`${r}-title`:void 0},e),Hs.createElement(yd,{component:Sd.dd,id:o?`${o}-value`:void 0,"data-testid":r?`${r}-value`:void 0,className:n},Array.isArray(t)?Hs.createElement(lk,{component:pk.dl},t.map((i,a)=>[Hs.createElement(yd,{"data-testid":r?`${r}-title-${a}`:void 0,key:i.title,component:Sd.dt},i.title),Hs.createElement(yd,{"data-testid":r?`${r}-value-${a}`:void 0,key:`dd-${i.title}`,component:Sd.dd},i.value)])):t));import vd from"react";import{WizardNavItem as _z}from"@patternfly/react-core";import{ExclamationCircleIcon as Rz}from"@patternfly/react-icons";import{global_danger_color_100 as Bz}from"@patternfly/react-tokens";var zz=(e,t,o,r)=>!o&&!r&&!t()?vd.createElement(vd.Fragment,null,e,vd.createElement(Rz,{className:"wizard-nav-item-warning-icon",color:Bz.value,size:"sm"})):e,Wz=({isValid:e=()=>!0,children:t,...o})=>{let{content:r,isDisabled:s,isCurrent:n}=o;return vd.createElement(_z,{...o,content:zz(r,e,s,n)},t)},Oo=Wz;import py from"react";import{AlertGroup as Zz,AlertActionCloseButton as Qz,Alert as eW}from"@patternfly/react-core";import Ta from"react";var Oc={};Zr(Oc,{alertsSlice:()=>Si,dialogsSlice:()=>Id});import{v4 as Gz}from"uuid";import{createSlice as Uz}from"@reduxjs/toolkit";import{AlertVariant as Kz}from"@patternfly/react-core";var ck=[],Si=Uz({initialState:ck,name:"alerts",reducers:{addAlert:(e,t)=>[{key:Gz(),variant:Kz.danger,...t.payload},...e],removeAlert:(e,t)=>e.filter(o=>o.key!==t.payload),clearAlerts:()=>ck}});import{createSlice as $z}from"@reduxjs/toolkit";var qz={},Id=$z({initialState:qz,name:"alerts",reducers:{openDialog:(e,t)=>(e[t.payload.dialogId]=t.payload.data||{},e),closeDialog:(e,t)=>(e[t.payload.dialogId]=void 0,e)}});var{addAlert:Yz,removeAlert:jz,clearAlerts:Xz}=Si.actions,Jz=Si.reducer,uk=Ta.createContext(null),ur=({children:e})=>{let[t,o]=Ta.useReducer(Jz,[]),r={alerts:t,addAlert:Ta.useCallback(s=>o(Yz(s)),[]),removeAlert:Ta.useCallback(s=>o(jz(s)),[]),clearAlerts:Ta.useCallback(()=>o(Xz()),[])};return Ta.createElement(uk.Provider,{value:r},e)},M=()=>{let e=Ta.useContext(uk),{t}=f();if(!e)throw new Error(t("ai:useAlerts must be used within AlertsContextProvider"));return e};var tW=({className:e})=>{let{alerts:t,removeAlert:o}=M(),r=s=>o(s.key);return t.length?py.createElement(Zz,{className:e},t.map(s=>py.createElement(eW,{actionClose:py.createElement(Qz,{onClose:()=>r(s)}),isInline:!0,...s},s.message))):null},mr=tW;import _c from"react";import oW,{defaultProps as rW}from"prism-react-renderer";import{Text as sW,TextVariants as nW,ClipboardCopy as iW,clipboardCopyFunc as aW}from"@patternfly/react-core";import lW from"prism-react-renderer/themes/github";var pW=({code:e,language:t="bash",theme:o=lW,copiable:r=!1})=>_c.createElement(oW,{...rW,code:e,language:t,theme:o},({className:s,style:n,tokens:i,getLineProps:a,getTokenProps:l})=>_c.createElement(sW,{component:nW.pre,className:s,style:n},r&&_c.createElement(iW,{isReadOnly:!0,variant:"inline-compact",onCopy:p=>aW(p,e),style:{float:"right",background:"inherit"}}),i.map((p,c)=>_c.createElement("div",{key:c,...a({line:p,key:c})},p.map((u,m)=>_c.createElement("span",{key:m,...l({token:u,key:m})})))))),kt=pW;import cW from"react";var uW=e=>cW.createElement("div",{...e,className:"pf-c-form"}),Pa=uW;import{createElement as Rc}from"react";import{Alert as mW,AlertVariant as dW,Progress as fW,ProgressMeasureLocation as gW,Stack as hW,StackItem as mk}from"@patternfly/react-core";var CW=({error:e,progress:t})=>{let{t:o}=f();return Rc(hW,{hasGutter:!0},e&&Rc(mk,null,Rc(mW,{variant:dW.danger,title:e.title,isInline:!0},e.message)),t!==null&&Rc(mk,null,Rc(fW,{value:t,measureLocation:gW.outside,"aria-label":o("ai:Progress")})))},En=CW;import{createElement as cy}from"react";import{Modal as yW,Button as dk,ModalVariant as SW}from"@patternfly/react-core";var vW=({title:e,titleIconVariant:t,content:o,confirmationButtonText:r="Yes",confirmationButtonVariant:s="danger",onClose:n,onConfirm:i})=>{let{t:a}=f();return cy(yW,{title:e,titleIconVariant:t,isOpen:!0,onClose:n,variant:SW.small,actions:[cy(dk,{"data-testid":"confirm-modal-submit",key:"confirm",variant:s,onClick:i},r),cy(dk,{key:"cancel",variant:"link",onClick:n},a("ai:Cancel"))]},o)},Fn=vW;import fk from"react";import{Text as IW,TextContent as bW}from"@patternfly/react-core";var kW=({children:e})=>fk.createElement(bW,null,fk.createElement(IW,{component:"h2"},e)),De=kW;import bd from"react";import{WizardBody as xW}from"@patternfly/react-core";import{css as gk}from"@patternfly/react-styles";import hk from"@patternfly/react-styles/css/components/Wizard/wizard";var TW=({navigation:e,footer:t,children:o})=>bd.createElement("div",{className:gk(hk.wizardOuterWrap,"cluster-wizard-step")},bd.createElement("div",{className:gk(hk.wizardInnerWrap)},e,bd.createElement(xW,{"aria-labelledby":"step-id",hasNoBodyPadding:!1},o)),t&&bd.createElement("div",{className:"pf-c-wizard__footer cluster-wizard-step__footer"},t)),Ee=TW;import PW from"lodash/values";import _o from"react";import{Alert as Ck,AlertGroup as AW,AlertVariant as yk,Flex as wW,FlexItem as uy,List as DW,ListItem as EW}from"@patternfly/react-core";var FW=({currentStepId:e,clusterStatus:t,validationsInfo:o,hosts:r,wizardStepsValidationsMap:s,children:n})=>{let{failedClusterValidations:i,failedHostnameValidations:a}=_o.useMemo(()=>{let c=ib(o||{},e,s),u=PW(c).flat(),m=r.some(d=>{let g=typeof d.validationsInfo=="string"?G(d.validationsInfo):d.validationsInfo;return!Gh(g||{},["hostname-valid","hostname-unique"])});return{failedClusterValidations:u.filter(d=>d?.status==="failure"),failedHostnameValidations:m}},[o,e,s,r]),l=xs(e,s,{status:t,validationsInfo:o||{}},r)==="ready",{t:p}=f();return _o.createElement(_o.Fragment,null,!o&&_o.createElement(Ck,{variant:yk.info,title:"Cluster validations are initializing.",isInline:!0},p("ai:Please hold on till background checks are started.")),!l&&_o.createElement(AW,null,n,_o.createElement(Ck,{variant:yk.warning,title:"Cluster is not ready yet.",isInline:!0},_o.createElement(wW,{spaceItems:{default:"spaceItemsSm"},direction:{default:"column"}},!!i.length&&_o.createElement(_o.Fragment,null,_o.createElement(uy,null,p("ai:The following requirements must be met:")),_o.createElement(uy,null,_o.createElement(DW,null,i.filter(Boolean).map(c=>_o.createElement(EW,{key:c.id},c.message))))),a&&_o.createElement(uy,null,p("ai:The cluster is not ready yet. Some hosts have an ineligible name. To change the hostname, click on it."))))))},Bc=FW;import{Table as JG,TableBody as ZG,TableVariant as QG}from"@patternfly/react-table";import{createElement as Wx,useMemo as tU}from"react";import me,{Fragment as HW}from"react";import{Alert as xd,AlertGroup as MW,AlertVariant as bk,Level as LW,LevelItem as kk}from"@patternfly/react-core";import{global_warning_color_100 as OW,global_success_color_100 as _W}from"@patternfly/react-tokens";import{PendingIcon as RW,CheckCircleIcon as BW,ExclamationTriangleIcon as zW}from"@patternfly/react-icons";import Or from"react";import{Button as my,ButtonVariant as dy,Flex as Sk,FlexItem as kd,Popover as NW}from"@patternfly/react-core";import{ExclamationTriangleIcon as vk}from"@patternfly/react-icons";import{global_warning_color_100 as Ik}from"@patternfly/react-tokens";var VW=({host:e,inventory:t={},onEditHostname:o,title:r,className:s,hosts:n,readonly:i=!1})=>{let a=r||Ot(e,t)||be,l=a!=="localhost",c=(n?!n.find(d=>{let g=G(d.inventory||"")||{};return d.id!==e.id&&Ot(d,g)===a}):!0)&&l,u=Or.createElement(Sk,{alignItems:{default:"alignItemsCenter"}},o&&!c&&Or.createElement(kd,{className:"pf-u-mr-xs"},Or.createElement(vk,{color:Ik.value})),Or.createElement(kd,null,a)),{t:m}=f();return!i&&o?c?Or.createElement(my,{variant:dy.link,isInline:!0,onClick:o,className:s},u):Or.createElement(NW,{headerContent:Or.createElement(Sk,{alignItems:{default:"alignItemsCenter"}},Or.createElement(kd,{className:"pf-u-mr-xs"},Or.createElement(vk,{color:Ik.value})),Or.createElement(kd,null,m("ai:Hostname is not valid"))),bodyContent:m(l?"ai:Hostname is not unique":"ai:Hostname can not be localhost"),footerContent:Or.createElement(my,{variant:dy.link,isInline:!0,className:s,onClick:o},m("ai:Change hostname")),minWidth:"30rem",maxWidth:"50rem",hideOnOutsideClick:!0,zIndex:300},Or.createElement(my,{variant:dy.link,isInline:!0,className:s},u)):u},vi=VW;var xk=({validations:e,variant:t,title:o,actionLinks:r=[]})=>{let{t:s}=f();return me.createElement(xd,{title:o,variant:t,actionLinks:r,isInline:!0},me.createElement("ul",null,e.map(n=>me.createElement("li",{key:n.id},me.createElement("strong",null,da(s)[n.id]||n.id,":"),"\xA0",To(n.message)," ",n.status==="failure"&&fl(s)[n.id]))))},WW=({onEditHostname:e,host:t,hostnameValidations:o,variant:r})=>{let{t:s}=f(),n=[me.createElement(vi,{key:"change-hostname",title:s("ai:Change hostname"),onEditHostname:e,host:t})],i=s("ai:Illegal hostname");return o.length===1?me.createElement(xd,{title:i,variant:r,actionLinks:n,isInline:!0},To(o[0].message)):me.createElement(xk,{title:i,validations:o,variant:r,actionLinks:n})},GW=({AdditionalNTPSourcesDialogToggleComponent:e,variant:t,validation:o})=>{let r=[me.createElement(e,{key:"add-ntp-sources"})],{t:s}=f();return me.createElement(xd,{title:s("ai:NTP synchronization failure"),variant:t,actionLinks:r,isInline:!0},To(o.message)," ",fl(s)[o.id])},UW=({UpdateDay2ApiVipDialogToggleComponent:e,variant:t,validation:o})=>{let r=[me.createElement(e,{key:"update-api-vip"})],{t:s}=f();return me.createElement(xd,{title:s("ai:API connectivity failure"),variant:t,actionLinks:r,isInline:!0},To(o.message))},Tk=({validations:e,title:t,variant:o,onEditHostname:r,AdditionalNTPSourcesDialogToggleComponent:s,UpdateDay2ApiVipDialogToggleComponent:n,host:i})=>{if(!e.length)return null;let a={["hostname-unique"]:void 0,["hostname-valid"]:void 0,["ntp-synced"]:void 0,["ignition-downloadable"]:void 0},l=[],p=[];for(let u of e)u.id in a&&u.status==="failure"?a[u.id]=u:p.push(u);let c=[];return a["hostname-unique"]&&c.push(a["hostname-unique"]),a["hostname-valid"]&&c.push(a["hostname-valid"]),c.length>0&&r&&l.push(me.createElement(WW,{hostnameValidations:c,variant:o,onEditHostname:r,host:i,key:"hostname-alert"})),a["ignition-downloadable"]&&n&&l.push(me.createElement(UW,{UpdateDay2ApiVipDialogToggleComponent:n,validation:a["ignition-downloadable"],variant:o,key:"ignition-downloadable-alert"})),a["ntp-synced"]&&s&&l.push(me.createElement(GW,{AdditionalNTPSourcesDialogToggleComponent:s,validation:a["ntp-synced"],variant:o,key:"ntp-sync-alert"})),p.length>0&&l.push(me.createElement(xk,{validations:p,variant:o,title:t,key:"insufficient-alert"})),me.createElement(MW,null,l)},fy=({validationsInfo:e,...t})=>{let{t:o}=f();return me.createElement(me.Fragment,null,Object.keys(e).map(r=>{let s=lC(o)[r],n=e[r].filter(l=>l.status==="pending"),i=e[r].filter(l=>l.status==="failure"||l.status==="error");return me.createElement(HW,{key:r},me.createElement(LW,{className:"host-validation-groups__validation-group"},me.createElement(kk,null,me.createElement("strong",null,s)),me.createElement(kk,null,(()=>i.length?me.createElement(me.Fragment,null,o("ai:Failed")," ",me.createElement(zW,{color:OW.value})):n.length?me.createElement(me.Fragment,null,o("ai:Pending input")," ",me.createElement(RW,null)):me.createElement(me.Fragment,null,o("ai:Ready")," ",me.createElement(BW,{color:_W.value})))())),!i.length&&me.createElement(Tk,{variant:bk.info,title:o("ai:Pending validations:"),validations:n,...t}),me.createElement(Tk,{variant:bk.warning,title:o("ai:Failed validations:"),validations:i,...t}))}))};import Pk from"react";import QW from"react";import{useCallback as KW,useEffect as $W,useRef as qW,useState as YW}from"react";var jW=e=>{let t=qW(!1);$W(()=>(t.current=!0,()=>{t.current=!1}),[]);let[o,r]=YW(e),s=KW(n=>{t.current&&r(n)},[]);return[o,s]},Ms=jW;import{useRef as ZW}from"react";import XW from"lodash/isEqual";var JW=e=>{let t=ZW(e);return XW(e,t.current)||(t.current=e),t.current},gy=JW;var e0=({host:e,onEditRole:t,current:o,position:r})=>{let[s,n]=Ms(!1),i=async l=>{n(!0);try{await t(l)}finally{n(!1)}},{t:a}=f();return QW.createElement(Cd,{defaultValue:ma(a)[0].value,current:o,items:ma(a),setValue:i,isDisabled:s,idPrefix:`role-${e.requestedHostname}`,position:r,menuAppendTo:()=>document.body})},Td=e0;var t0=({host:e,role:t,readonly:o=!1,onEditRole:r,position:s})=>!o&&r?Pk.createElement(Td,{host:e,onEditRole:r,current:t,position:s}):Pk.createElement("span",null,t),zc=t0;import dr from"react";import{Popover as o0,Level as hy,LevelItem as Rl}from"@patternfly/react-core";var r0=({cluster:e,inParenthesis:t=!1,valueId:o="hosts-count"})=>{let{t:r}=f(),s=dr.createElement(dr.Fragment,null,"readyHostCount"in e&&dr.createElement(hy,null,dr.createElement(Rl,null,r("ai:Ready for the installation")),dr.createElement(Rl,null,bc(e))),"enabledHostCount"in e&&dr.createElement(hy,null,dr.createElement(Rl,null,r("ai:Enabled for the installation")),dr.createElement(Rl,null,kl(e))),dr.createElement(hy,null,dr.createElement(Rl,null,r("ai:All discovered")),dr.createElement(Rl,null,xl(e)))),n="enabledHostCount"in e?kl(e):xl(e);return dr.createElement(o0,{headerContent:r("ai:Hosts in the cluster"),bodyContent:s},dr.createElement("a",{id:o},t&&"(",n,t&&")"))},Bl=r0;import q from"react";import{Popover as f0,Button as g0,Text as Gc,TextContent as zl,FlexItem as Ad,Flex as Fk,Stack as h0,StackItem as C0}from"@patternfly/react-core";import y0 from"human-date";import s0 from"react";import{Progress as n0,ProgressVariant as Ak,ProgressMeasureLocation as wk,ProgressSize as i0}from"@patternfly/react-core";var a0=e=>{switch(e){case"cancelled":case"error":return Ak.danger;case"installed":return Ak.success;default:return}},l0=e=>e==="installed"?wk.none:wk.top,p0=({host:e})=>{let{status:t}=e,o=bl(e),{currentStage:r,progressInfo:s}=Ym(e),n=Ic(e),i=`${r}${s?`: ${s}`:" "}`;return s0.createElement(n0,{title:i,value:n,min:1,max:o.length,label:`Step ${n} of ${o.length}`,valueText:`Step ${n} of ${o.length}: ${i}`,variant:a0(t),measureLocation:l0(t),size:i0.sm})},Wc=p0;import Cy from"react";import{ExternalLinkAltIcon as c0}from"@patternfly/react-icons";import{Button as u0,ButtonVariant as m0}from"@patternfly/react-core";import Dk from"react";var Ii=Dk.createContext({}),Pd=({cluster:e,resetCluster:t,ocpConsoleUrl:o,children:r})=>Dk.createElement(Ii.Provider,{value:{cluster:e,resetCluster:t,ocpConsoleUrl:o}},r);var d0=({id:e,title:t="OpenShift console"})=>{let{ocpConsoleUrl:o}=Cy.useContext(Ii)||{};return o?Cy.createElement(u0,{variant:m0.link,onClick:()=>window.open(eC(o),"_blank","noopener noreferrer"),id:e},t," ",Cy.createElement(c0,null)):null},Ek=d0;import{UnknownIcon as S0}from"@patternfly/react-icons";var v0=(e,t)=>{let o=bl(e),r=Ic(e);return t.withProgress?`${t.title} ${r}/${o.length}`:t.title},I0=({details:e,autoCSR:t,additionalPopoverContent:o,...r})=>{let{host:s}=r,{status:n,statusInfo:i}=s,{t:a}=f();return["installing-in-progress"].includes(n)?q.createElement(zl,null,q.createElement(Wc,{host:s})):["error","cancelled","installing-pending-user-action"].includes(n)?q.createElement(zl,null,q.createElement(Gc,null,e,q.createElement("br",null),To(i)),q.createElement(Wc,{host:s})):["installed"].includes(n)?q.createElement(zl,null,q.createElement(Gc,null,e),q.createElement(Wc,{host:s})):["added-to-existing-cluster"].includes(n)?q.createElement(zl,null,q.createElement(Gc,null,e),!t&&q.createElement(q.Fragment,null,q.createElement("br",null),a("ai:To finish adding nodes to the cluster, approve the join request inside OpenShift Console's Nodes section."),q.createElement("br",null),a("ai:It may take a few minutes for the join request to appear."),q.createElement("br",null),a("ai:If you prefer using the CLI, follow the instructions in"),"\xA0",q.createElement(tt,{href:iC},a("ai:How to approve nodes using the CLI"))),q.createElement(Wc,{host:s})):["preparing-for-installation","preparing-successful","installing","unbinding-pending-user-action","binding","unbinding","reclaiming","reclaiming-rebooting"].includes(n)?q.createElement(zl,null,q.createElement(Gc,null,e)):q.createElement(h0,{hasGutter:!0},o,q.createElement(C0,null,e&&q.createElement(zl,null,q.createElement(Gc,null,e)),q.createElement(fy,{...r})))},b0=({host:e})=>{let{progress:t,statusUpdatedAt:o}=e,{t:r}=f();if(e.status==="added-to-existing-cluster")return q.createElement(Ek,{id:`host-status-detail-link-to-ocp-nodes-${e.requestedHostname||e.id}`});let s;return e.status==="installing-in-progress"?t?.stageUpdatedAt&&t.stageUpdatedAt!==t.stageStartedAt?s=r("ai:Step started at {{startedAt}}, updated {{updatedAt}}",{startedAt:to(t.stageStartedAt),updatedAt:y0.relativeTime(t.stageUpdatedAt)}):s=r("ai:Step started at {{startedAt}}",{startedAt:to(t?.stageStartedAt||o)}):o&&(s=r("ai:Status updated at {{humanizedDataTime}}",{humanizedDataTime:to(o)})),q.createElement(q.Fragment,null,!!s&&q.createElement("small",null,s))},Nk=e=>q.createElement(f0,{headerContent:q.createElement("div",null,e.title),bodyContent:q.createElement(I0,{...e}),footerContent:q.createElement(b0,{host:e.host}),minWidth:"30rem",maxWidth:"50rem",hideOnOutsideClick:e.hideOnOutsideClick,zIndex:e.zIndex||300},q.createElement(g0,{variant:"link",isInline:!0,isSmall:e.isSmall},e.children)),k0=({host:e,validationsInfo:t,status:o,onEditHostname:r,AdditionalNTPSourcesDialogToggleComponent:s,UpdateDay2ApiVipDialogToggleComponent:n,children:i,zIndex:a,autoCSR:l,additionalPopoverContent:p})=>{let[c,u]=q.useState(!1),m=q.useCallback(()=>{u(!c),r?.()},[c,r]),{title:d,icon:g,sublabel:C,details:h,noPopover:S}=o,v=v0(e,o),y={hideOnOutsideClick:!c,host:e,onEditHostname:m,AdditionalNTPSourcesDialogToggleComponent:s,title:d,validationsInfo:t,details:h,UpdateDay2ApiVipDialogToggleComponent:n,zIndex:a,autoCSR:l,additionalPopoverContent:p};return q.createElement(Fk,{alignItems:{default:"alignItemsCenter"},spaceItems:{default:"spaceItemsXs"}},q.createElement(Ad,null,g||q.createElement(S0,null)),q.createElement(Fk,{direction:{default:"column"},spaceItems:{default:"spaceItemsXs"}},!i&&!C&&!S?q.createElement(Nk,{...y},v):q.createElement(Ad,null,v),i&&q.createElement(Ad,null,i),C&&q.createElement(Ad,{className:"pf-u-font-size-xs",style:{marginTop:"calc(-1 * var(--pf-l-flex--spacer--xs))"}},q.createElement(Nk,{...y},C))))},Ls=k0;import Ok from"react";import{Modal as H0,ModalVariant as M0}from"@patternfly/react-core";import Ro from"react";import{object as V0}from"yup";import{Button as Vk,ButtonVariant as x0,ButtonType as T0,Form as P0,ModalBoxBody as A0,ModalBoxFooter as w0,AlertVariant as Hk,Alert as Mk,AlertActionCloseButton as D0}from"@patternfly/react-core";import{Formik as E0}from"formik";var F0=(e,t,o=[])=>V0().shape({hostname:Es(e,o,t.hostname)}),N0=({host:e,inventory:t,usedHostnames:o,onCancel:r,onSave:s,onFormSaveError:n})=>{let i=Ro.useRef();Ro.useEffect(()=>{i.current?.focus(),i.current?.select()},[]);let{requestedHostname:a}=e,{hostname:l}=t,p={hostId:e.id,hostname:a||""},{t:c}=f();return Ro.createElement(E0,{validateOnMount:!0,initialValues:p,initialStatus:{error:null},validate:mo(F0(c,p,o)),onSubmit:async(u,m)=>{if(u.hostname===p.hostname){r();return}try{await s(u),r()}catch(d){let g=n&&n(d)||c("ai:Host update failed.");m.setStatus({error:{title:c("ai:Failed to update host"),message:g}})}}},({handleSubmit:u,status:m,setStatus:d,isSubmitting:g,isValid:C,dirty:h})=>Ro.createElement(P0,{onSubmit:u},Ro.createElement(A0,null,Ro.createElement(Pa,null,m.error&&Ro.createElement(Mk,{variant:Hk.danger,title:m.error.title,actionClose:Ro.createElement(D0,{onClose:()=>d({error:null})}),isInline:!0},m.error.message),Ro.createElement(Mk,{variant:Hk.info,title:c("ai:This name will replace the original discovered hostname."),isInline:!0}),Ro.createElement(Vs,{name:"discoveredHostname",label:"Discovered hostname"},l||""),Ro.createElement(fo,{label:c("ai:New hostname"),name:"hostname",ref:i,isRequired:!0,isDisabled:!OC(e.status),richValidationMessages:Mr(c)}))),Ro.createElement(w0,null,Ro.createElement(Vk,{key:"submit",type:T0.submit,isDisabled:g||!C||!h},c("ai:Change")),Ro.createElement(Vk,{key:"cancel",variant:x0.link,onClick:r},c("ai:Cancel")))))},Lk=N0;var L0=({isOpen:e,host:t,inventory:o,usedHostnames:r,onClose:s,onSave:n,onFormSaveError:i})=>t&&o?Ok.createElement(H0,{"aria-label":"Change hostname dialog",title:"Change hostname",isOpen:e,onClose:s,variant:M0.small,hasNoBodyWrapper:!0},Ok.createElement(Lk,{host:t,inventory:o,usedHostnames:r,onCancel:s,onSave:n,onFormSaveError:i})):null,Wl=L0;import{List as O0,ListItem as wd,TextContent as _0}from"@patternfly/react-core";import{Fragment as _k,createElement as Os}from"react";var yy=e=>_t((e?.ramMib||16*1024)*1024*1024,2,"iec"),Sy=({master:e,worker:t,sno:o,isSNOCluster:r})=>{let s=yy(e),n=yy(t),i=yy(o),{t:a}=f();return Os(O0,null,!r&&Os(_k,null,Os(wd,null,a("ai:Control plane nodes: At least {{master_cpu_cores}} CPU cores, {{master_ram}} RAM, {{master_disksize}} GB disk size for every control plane node.",{master_cpu_cores:e?.cpuCores||4,master_ram:s,master_disksize:e?.diskSizeGb||120})),Os(wd,null,a("ai:Workers: At least {{worker_cpu_cores}} CPU cores, {{worker_ram}} RAM, {{worker_disksize}} GB disk size for each worker ",{worker_cpu_cores:t?.cpuCores||2,worker_ram:n,worker_disksize:t?.diskSizeGb||12}))),(r===!0||r===void 0)&&Os(_k,null,Os(wd,null,a("ai:SNO: One host is required with at least {{sno_cpu_cores}} CPU cores, {{snoRam}} of RAM, and {{sno_disksize}} GB of disk size storage.",{sno_cpu_cores:o?.cpuCores||4,snoRam:i,sno_disksize:o?.diskSizeGb||120}))),Os(wd,null,a("ai:Also note that each host's disk write speed should meet the minimum requirements to run OpenShift. "),Os(tt,{href:"https://access.redhat.com/solutions/4885641"},a("ai:Learn more"))))},R0=e=>Os(_0,null,Os(Sy,{...e})),Dd=R0;import ro from"react";import{Button as B0,ButtonVariant as z0,Popover as W0,Text as Gl,TextContent as G0,TextVariants as Uc}from"@patternfly/react-core";import{InfoCircleIcon as U0}from"@patternfly/react-icons";import{Trans as K0}from"react-i18next";var $0=()=>{let{t:e}=f();return ro.createElement(G0,null,ro.createElement(Gl,{component:Uc.p},e("ai:Your libvirt virtual machines should be configured to restart automatically after a reboot. You can check this by running:")),ro.createElement(kt,{code:"virsh dumpxml <name> | grep on_reboot"}),ro.createElement(Gl,{component:Uc.p},e("ai:And verify that this is the output:")),ro.createElement(kt,{code:"<on_reboot>restart</on_reboot>"}),ro.createElement(Gl,{component:Uc.p},e("ai:If not, please start your VMs with the following configuration:")),ro.createElement(kt,{code:"--events on_reboot=restart"}),ro.createElement(Gl,{component:Uc.p},ro.createElement(K0,{t:e,components:{code:ro.createElement("code",null)},i18nKey:"ai:When using <code>{{executionCommand}}</code>, please run:",values:{executionCommand:"virt-install"}})),ro.createElement(kt,{code:"virt-install --wait -1 <rest of the command>"}),ro.createElement(Gl,{component:Uc.p},e("ai:Otherwise, the VMs will not be able to reboot during the installation process.")))},q0=()=>{let{t:e}=f();return ro.createElement(Gl,{component:"p"},ro.createElement(W0,{bodyContent:ro.createElement($0,null),minWidth:"35rem"},ro.createElement(B0,{variant:z0.link,isInline:!0},ro.createElement(U0,{size:"sm"}),"\xA0",e("ai:Check your VM reboot configuration"))))},Ul=q0;import{createElement as ho,useCallback as Kk,useEffect as oG,useState as Uk}from"react";import{Dropdown as Rk,DropdownItem as Bk,DropdownToggle as zk,DropdownToggleCheckbox as Y0,Pagination as j0,Split as X0,SplitItem as Wk,Toolbar as J0,ToolbarContent as Z0,ToolbarItem as Gk,Tooltip as Q0}from"@patternfly/react-core";import{CaretDownIcon as eG}from"@patternfly/react-icons";var tG=({itemIDs:e,selectedIDs:t,setSelectedIDs:o,actions:r,showPagination:s,clearAllFilters:n,children:i,...a})=>{let[l,p]=Uk(!1),[c,u]=Uk(!1),m=Kk(()=>u(!c),[c]),d=Kk(()=>p(!l),[l]);oG(()=>{t.every(I=>e.includes(I))||o(t.filter(I=>e.includes(I)))},[t,e,o]);let g=!1;t.length&&(g=t.length===e.length&&e.every(I=>t.includes(I))?!0:null);let C=g===!1,h=ho(Rk,{onSelect:d,toggle:ho(zk,{onToggle:d,toggleIndicator:eG,isDisabled:C},"Actions"),isOpen:l,dropdownItems:r}),S=()=>o(e),v=()=>o([]),{t:y}=f();return ho(X0,{hasGutter:!0},ho(Wk,{isFilled:!0},ho(J0,{className:"table-toolbar",clearAllFilters:n},ho(Z0,{className:"table-toolbar__content"},ho(Gk,null,ho(Rk,{onSelect:m,toggle:ho(zk,{splitButtonItems:[ho(Y0,{id:"select-checkbox",key:"select-checkbox","aria-label":y("ai:Select all"),onChange:I=>I?S():v(),isChecked:g},t.length," ",y("ai:selected"))],onToggle:m}),isOpen:c,dropdownItems:[ho(Bk,{key:"select-all",onClick:S},y("ai:Select all")),ho(Bk,{key:"select-none",onClick:v},y("ai:Select none"))]})),i,ho(Gk,null,C?ho(Q0,{content:"Select one or more hosts"},h):h)))),s&&ho(Wk,null,ho(j0,{itemCount:e.length,...a,isCompact:!0})))},bi=tG;import{createElement as qk}from"react";import{DropdownItem as $k}from"@patternfly/react-core";var Kl=({onChangeHostname:e})=>qk($k,{onClick:e},"Change hostname"),$l=({onDeleteHost:e})=>qk($k,{onClick:e},"Delete");import{createElement as de,useCallback as MG,useEffect as HG,useRef as Fx,useState as LG}from"react";import{Button as Py,ButtonType as fG,ButtonVariant as gG,Form as hG,HelperText as CG,HelperTextItem as yG,Modal as SG,ModalBoxBody as vG,ModalBoxFooter as IG,Popover as bG,Split as kG,SplitItem as Ay,Stack as xG,StackItem as Md}from"@patternfly/react-core";import{Formik as TG,useFormikContext as PG}from"formik";import{object as VG}from"yup";import{global_palette_blue_300 as AG}from"@patternfly/react-tokens/dist/js/global_palette_blue_300";import{InfoCircleIcon as wG}from"@patternfly/react-icons";var Ty={};Zr(Ty,{BASE_PATH:()=>kx,FETCH_ABORTED_ERROR_CODE:()=>Kc,FETCH_CONNECTIVITY_ERROR_CODE:()=>ky,client:()=>K,getApiErrorCode:()=>xy,getApiErrorMessage:()=>R,handleApiError:()=>D,ocmClient:()=>Ce,setAuthInterceptor:()=>lG});import by from"axios";import bx from"axios-case-converter";var hx=XM(gx()),{__extends:Gxe,__assign:Vd,__rest:Uxe,__decorate:Kxe,__param:$xe,__metadata:qxe,__awaiter:Yxe,__generator:jxe,__exportStar:Xxe,__createBinding:Jxe,__values:Zxe,__read:Qxe,__spread:eTe,__spreadArrays:tTe,__spreadArray:oTe,__await:rTe,__asyncGenerator:sTe,__asyncDelegator:nTe,__asyncValues:iTe,__makeTemplateObject:aTe,__importStar:lTe,__importDefault:pTe,__classPrivateFieldGet:cTe,__classPrivateFieldSet:uTe,__classPrivateFieldIn:mTe}=hx.default;function Cx(e){return e.toLowerCase()}var rG=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],sG=/[^A-Z0-9]+/gi;function yx(e,t){t===void 0&&(t={});for(var o=t.splitRegexp,r=o===void 0?rG:o,s=t.stripRegexp,n=s===void 0?sG:s,i=t.transform,a=i===void 0?Cx:i,l=t.delimiter,p=l===void 0?" ":l,c=Sx(Sx(e,r,"$1\0$2"),n,"\0"),u=0,m=c.length;c.charAt(u)==="\0";)u++;for(;c.charAt(m-1)==="\0";)m--;return c.slice(u,m).split("\0").map(a).join(p)}function Sx(e,t,o){return t instanceof RegExp?e.replace(t,o):t.reduce(function(r,s){return r.replace(s,o)},e)}function Iy(e,t){var o=e.charAt(0),r=e.substr(1).toLowerCase();return t>0&&o>="0"&&o<="9"?"_"+o+r:""+o.toUpperCase()+r}function vx(e,t){return t===void 0&&(t={}),yx(e,Vd({delimiter:"",transform:Iy},t))}function nG(e,t){return t===0?e.toLowerCase():Iy(e,t)}function Ix(e,t){return t===void 0&&(t={}),vx(e,Vd({transform:nG},t))}var kx="/api/assisted-install",xx={caseFunctions:{camel:e=>Ix(e,{stripRegexp:/[^A-Z0-9.-]+/gi})}},iG=()=>{let e=by.create();return e.interceptors.request.use(t=>({...t,url:`${process.env.REACT_APP_API_ROOT}${t.url}`})),bx(e,xx)},K=iG(),Ce,aG=e=>(e.interceptors.request.use(t=>({...t,url:`${kx}${t.url}`})),e),lG=e=>{Ce=e(by.create()),K=bx(aG(e(by.create())),xx)};import uG from"axios";import{Severity as mG}from"@sentry/browser";import dG from"lodash/pick";import{Severity as Tx,captureException as cG,captureMessage as pG}from"@sentry/browser";var _s=(e,t,o=Tx.Error)=>{Ce?(t&&pG(t,o),cG(e)):o===Tx.Error?console.error(t,e):console.warn(t,e)};function Hd(e){return kC(e)&&xC(e,"isAxiosError")&&e.isAxiosError===!0}var Aa=e=>Hd(e)?typeof e.response?.data=="object":!1;var Kc="ERR_CANCELED",ky="CONNECTIVITY_ERROR",D=(e,t)=>{if(uG.isCancel(e))_s(e,"Request canceled",mG.Info);else if(Aa(e)){let o=`URL: ${JSON.stringify(e.config.url,null,1)}
5
+ `;o+=`Method: ${JSON.stringify(e.config.method,null,1)}
6
+ `,e.response?(o+=`Status: ${e.response.status}
7
+ `,o+=`Response: ${JSON.stringify(dG(e.response.data,["code","message","reason"]),null,1)}
8
+ `):e.request&&(o+=`Status Code: ${JSON.stringify(e.request.__sentry_xhr__.status_code,null,1)}`),_s(e,o)}else _s(e);if(t)return t(e)},R=e=>Aa(e)?e.response?.data?.message||e.response?.data.reason||e.message:U(e),xy=e=>{if(!Hd(e))return ky;let t=e.response?.status||0;return t>=400&&t<500?t:e.code===Kc?Kc:ky};var Px=e=>{let t=we(e);return Ot(e,t)||""},Ax=(e,t)=>t.hostname.replace(/{{n+}}/g,`${e+1}`),wx=(e,t,o)=>{let r=0;return t.map(s=>{let[n,i]=o(s),a={newHostname:n?Ax(r,e):void 0,reason:n?void 0:i};return n&&r++,a})},Dx={hostname:""},DG=(e,t,o)=>VG().shape({hostname:Es(o,t,e.hostname).required(o("ai:Required field"))}),Ex=(e,t)=>(e={...e||{},hostname:(e?.hostname||[]).concat(t)},e),EG=(e,t,o,r,s)=>async n=>{let i=wx(n,e,r).filter(p=>!p.reason).map(({newHostname:p})=>p),a=t.reduce((p,c)=>(e.find(u=>u.id===c.id)||p.push(Px(c)),p),[]),l=await mo(o)({...n,hostname:i[0]||""});return(i.some(p=>a.includes(p||""))||new Set(i).size!==i.length)&&(l=Ex(l,Mr(s).NOT_UNIQUE)),i.some(p=>Pl.includes(p||""))&&(l=Ex(l,Mr(s).LOCALHOST_ERR)),l},FG=({selectedHosts:e,isOpen:t,patchingHost:o,onClose:r,canChangeHostname:s})=>{let{values:n,handleSubmit:i,isSubmitting:a,status:l,isValid:p}=PG(),c=Fx(),u=Fx(e);HG(()=>{t&&c.current?.focus()},[t]),MG(()=>{a||(u.current=e)},[e,a]);let m=u.current,d=wx(n,m,s),{t:g}=f();return de(hG,{onSubmit:i},de(vG,null,de(xG,{hasGutter:!0},de(Md,null,de("div",null,g("ai:Rename hostnames using the custom template:")),de("div",null,de("strong",null,"{{n}}")," ",g("ai:to add a number."))),de(Md,null,de(fo,{name:"hostname",ref:c,isRequired:!0,richValidationMessages:Mr(g)}),de(CG,null,de(yG,{variant:"indeterminate"},g("ai:For example: host-{{n}}",{interpolation:{suffix:"###",prefix:"###"}})))),de(Md,null,g("ai:Preview"),de("div",{className:"hostname-preview"},m.map((C,h)=>{let{newHostname:S,reason:v}=d[h];return de(kG,{key:C.id||h,hasGutter:!0},de(Ay,{className:"hostname-column"},de("div",{className:"hostname-column__text"},de("strong",null,Px(C)))),de(Ay,null,de("div",null,de("strong",null,">"))),de(Ay,{isFilled:!0},v?de(bG,{"aria-label":g("ai:Cannot change hostname popover"),headerContent:de("div",null,g("ai:Hostname cannot be changed")),bodyContent:de("div",null,v)},de(Py,{variant:"link",icon:de(wG,{color:AG.value}),isInline:!0},g("ai:Not changeable"))):S||g("ai:New hostname will appear here...")))}))),de(Md,null,de(En,{error:l?.error,progress:a?100*(o+1)/m.length:null})))),de(IG,null,de(Py,{key:"submit",type:fG.submit,isDisabled:a||!p},g("ai:Change")),de(Py,{onClick:r,variant:gG.secondary,isDisabled:a},g("ai:Cancel"))))},NG=({isOpen:e,onClose:t,selectedHostIDs:o,hosts:r,onChangeHostname:s,canChangeHostname:n})=>{let[i,a]=LG(0),l=r.filter(c=>o.includes(c.id)),{t:p}=f();return de(SG,{"aria-label":p("ai:Change hostnames dialog"),title:p("ai:Change hostnames"),isOpen:e,onClose:t,hasNoBodyWrapper:!0,id:"mass-change-hostname-modal",variant:"small"},de(TG,{initialValues:Dx,validate:EG(l,r,DG(Dx,[],p),n,p),onSubmit:async(c,u)=>{let m=0;try{for(let d of l){a(m);let g=Ax(m,c);await s(d,g),m++}t()}catch(d){u.setStatus({error:{title:p("ai:Failed to update host"),message:R(d)}})}}},de(FG,{isOpen:e,selectedHosts:l,patchingHost:i,onClose:t,canChangeHostname:n})))},ki=NG;import{createElement as Rs,useState as Hx}from"react";import{Button as Nx,ButtonVariant as Vx,Modal as OG,ModalBoxBody as _G,ModalBoxFooter as RG,Stack as BG,StackItem as wy}from"@patternfly/react-core";var zG=({isOpen:e,onClose:t,onDelete:o,hosts:r,children:s})=>{let[n,i]=Hx(null),[a,l]=Hx(),{t:p}=f(),c=async()=>{l(void 0);let u=0;try{for(let m of r)i(100*(u+1)/r.length),await o(m);i(null),t()}catch(m){l({title:p("ai:Failed to delete host"),message:U(m)}),i(null)}};return Rs(OG,{"aria-label":p("ai:Delete hosts dialog"),title:p("ai:Delete hosts"),isOpen:e,onClose:t,hasNoBodyWrapper:!0,id:"mass-delete-modal",variant:"medium",titleIconVariant:"warning"},Rs(_G,null,Rs(BG,{hasGutter:!0},Rs(wy,null,p("ai:You are deleting multiple resources. All resources listed below will be deleted if you continue. This action cannot be undone.")),Rs(wy,null,s),Rs(wy,null,Rs(En,{error:a,progress:n})))),Rs(RG,null,Rs(Nx,{onClick:c,isDisabled:n!==null,variant:Vx.danger},p("ai:Delete hosts")),Rs(Nx,{onClick:t,variant:Vx.secondary,isDisabled:n!==null},p("ai:Cancel"))))},Yl=zG;import{createElement as _e}from"react";import{AddCircleOIcon as WG,BanIcon as Dy,CheckCircleIcon as Mx,ConnectedIcon as Lx,DisconnectedIcon as Ox,ExclamationCircleIcon as GG,ExclamationTriangleIcon as Ld,InProgressIcon as Nn,LinkIcon as UG,PendingIcon as KG,PlusIcon as $G}from"@patternfly/react-icons";import{global_danger_color_100 as qG,global_warning_color_100 as Od,global_success_color_100 as _x,chart_color_blue_300 as YG}from"@patternfly/react-tokens";var Vn=Object.freeze({"unbinding-pending-user-action":{key:"unbinding-pending-user-action",title:"Removing from cluster",category:"Discovery related",icon:_e(Nn,null),details:"This host is being removed from the cluster. To finish, reboot the host with the infrastructure environment ISO."},reclaiming:{key:"reclaiming",title:"Returning to the infrastructure environment",category:"Discovery related",icon:_e(Nn,null),details:"This host is being removed from the cluster."},"reclaiming-rebooting":{key:"reclaiming-rebooting",title:"Rebooting while returning to the infrastructure environment",category:"Discovery related",icon:_e(Nn,null),details:"This host is being rebooted to be available for reuse in another cluster."},"preparing-failed":{key:"preparing-failed",title:"Preparing step failed",category:"Installation related",details:"Preparing step failed"},unbinding:{key:"unbinding",title:"Removing from cluster",category:"Discovery related",icon:_e(Nn,null),details:"This host is being removed from the cluster."},"disabled-unbound":{key:"disabled-unbound",title:"Disabled",category:"Discovery related",icon:_e(Dy,null),details:"This host was manually removed from a cluster and can not be included in another one. Enable this host to make it available again."},"disconnected-unbound":{key:"disconnected-unbound",title:"Disconnected",category:"Discovery related",icon:_e(Ox,null),details:"Ensure the host is running, responsive, and is able to contact the installer."},"discovering-unbound":{key:"discovering-unbound",title:"Discovering",category:"Discovery related",icon:_e(Lx,null),details:"This host is transmitting its hardware and networking information to the installer. Please wait while this information is received."},"insufficient-unbound":{key:"insufficient-unbound",title:"Insufficient",category:"Discovery related",icon:_e(Ld,{color:Od.value}),details:"This host does not meet the minimum hardware or networking requirements and can not be included in the cluster."},"known-unbound":{key:"known-unbound",title:"Available",category:"Discovery related",icon:_e($G,{color:YG.value}),details:"This host meets the minimum hardware and networking requirements and can be included in the cluster."},binding:{key:"binding",title:"Binding",category:"Discovery related",icon:_e(UG,null),details:"This host is being added to the cluster."},discovering:{key:"discovering",title:"Discovering",category:"Discovery related",icon:_e(Lx,null),details:"This host is transmitting its hardware and networking information to the installer. Please wait while this information is received."},"pending-for-input":{key:"pending-for-input",title:"Pending input",category:"Discovery related",icon:_e(KG,null)},known:{key:"known",title:"Ready",category:"Discovery related",icon:_e(Mx,{color:_x.value}),details:"This host meets the minimum hardware and networking requirements and will be included in the cluster."},disconnected:{key:"disconnected",title:"Disconnected",category:"Discovery related",icon:_e(Ox,null),details:"This host has lost its connection to the installer and will not be included in the cluster unless connectivity is restored."},insufficient:{key:"insufficient",title:"Insufficient",category:"Discovery related",icon:_e(Ld,{color:Od.value}),details:"This host does not meet the minimum hardware or networking requirements and will not be included in the cluster."},disabled:{key:"disabled",title:"Disabled",category:"Discovery related",icon:_e(Dy,null),details:"This host was manually disabled and will not be included in the cluster. Enable this host to include it again."},"preparing-for-installation":{key:"preparing-for-installation",title:"Preparing for installation",category:"Installation related",icon:_e(Nn,null)},"preparing-successful":{key:"preparing-successful",title:"Preparing step successful",category:"Installation related",icon:_e(Nn,null)},installing:{key:"installing",title:"Starting installation",category:"Installation related",icon:_e(Nn,null)},"installing-in-progress":{key:"installing-in-progress",title:"Installing",category:"Installation related",icon:_e(Nn,null),withProgress:!0},"installing-pending-user-action":{key:"installing-pending-user-action",title:"Pending user action",category:"Installation related",icon:_e(Ld,{color:Od.value}),details:"This host is pending user action"},installed:{key:"installed",title:"Installed",category:"Installation related",icon:_e(Mx,{color:_x.value}),details:"This host completed its installation successfully."},cancelled:{key:"cancelled",title:"Installation cancelled",category:"Installation related",icon:_e(Dy,null),details:"This host installation has been cancelled.",withProgress:!0},error:{key:"error",title:"Error",category:"Installation related",icon:_e(GG,{color:qG.value}),details:"This host failed its installation.",withProgress:!0},resetting:{key:"resetting",title:"Resetting",category:"Installation related",icon:_e(Nn,null),details:"This host is resetting the installation."},"resetting-pending-user-action":{key:"resetting-pending-user-action",title:"Reboot required",category:"Installation related",icon:_e(Ld,{color:Od.value}),details:"Host already booted from disk during previous installation. To finish resetting the installation please boot the host into Discovery ISO."},"added-to-existing-cluster":{key:"added-to-existing-cluster",title:"Installed",category:"Installation related",icon:_e(WG,null),details:"This host completed its installation successfully."}});import jG from"humanize-plus";var Rx=e=>e.memory?.physicalBytes||0,Bx=e=>e.disks?.filter(t=>t.driveType!==Wb).reduce((t,o)=>t+(o.sizeBytes||0),0)||0,XG=e=>jG.formatNumber(e.cpu?.frequency||0),zx=e=>({cores:e.cpu?.count||0,memory:Rx(e),disks:Bx(e)}),Ey={title:be,sortableValue:0},Hn=e=>{let t=Ey,o=Ey,r=Ey,s=be;if(e.cpu?.count){let a=e.cpu?.flags?.includes("ht")?" (hyper-threaded)":"";s=`${e.cpu?.count} cores${a} at ${XG(e)} MHz`,t={title:e.cpu?.count.toString(),sortableValue:e.cpu?.count}}let n=Rx(e);n&&(o={title:_t(n,2,"iec"),sortableValue:n});let i=Bx(e);return i&&(r={title:_t(i,2,"si"),sortableValue:i}),{serialNumber:e.systemVendor?.serialNumber||be,cores:t,cpuSpeed:s,memory:o,disk:r}};var eU=({hosts:e=[]})=>{let t=tU(()=>{let o=An(e).reduce((r,s)=>{r.count++;let n=G(s.inventory);if(n){let i=zx(n);r.cores+=i.cores,r.memory+=i.memory,r.fs+=i.disks}return r},{count:0,cores:0,memory:0,fs:0});return[{cells:["Hosts",o.count]},{cells:["Cores",o.cores]},{cells:["Memory",_t(o.memory,2,"iec")]},{cells:["Storage",_t(o.fs,2,"si")]}]},[e]);return Wx(JG,{rows:t,cells:["",""],variant:QG.compact,borders:!1,"aria-label":"Cluster summary table",className:"review-hosts-table"},Wx(ZG,null))},$c=eU;import pt from"react";import oU from"lodash/values";import{Button as rU,ButtonVariant as sU}from"@patternfly/react-core";import{CheckCircleIcon as nU,ExclamationCircleIcon as iU,ExclamationTriangleIcon as aU}from"@patternfly/react-icons";import{global_success_color_100 as lU,global_danger_color_100 as pU,global_warning_color_100 as cU}from"@patternfly/react-tokens";import{Trans as uU}from"react-i18next";var Gx=()=>{let{t:e}=f();return pt.createElement(pt.Fragment,null,pt.createElement(nU,{color:lU.value})," ",e("ai:All validations passed"))},mU=({id:e,count:t})=>{let{t:o}=f();return pt.createElement("div",{id:e},o("ai:There is still {{count}} pending validation",{count:t}))},dU=({step:e,setCurrentStepId:t,wizardStepNames:o})=>pt.createElement(rU,{variant:sU.link,onClick:()=>t(e),isInline:!0},o[e]),Ux=({validation:e,clusterGroup:t,hostGroup:o,severity:r="danger",setCurrentStepId:s,wizardStepNames:n,wizardStepsValidationsMap:i})=>{let{t:a}=f(),l=a("ai:{{check_failed}} check failed",{check_failed:da(a)[e.id]||pC(a)[e.id]||e.id}),p,c=nb({validationId:e.id,clusterGroup:t,hostGroup:o},i);c==="review"?p=a("ai:Please wait till all validations are finished."):c?p=pt.createElement(pt.Fragment,null,pt.createElement(uU,{t:a},"ai:It can be fixed in the"," ",pt.createElement(dU,{step:c,setCurrentStepId:s,wizardStepNames:n})," ","step.")):console.error("Unknown validation ID detected in the ",t||o," group:",JSON.stringify(e));let u;return r==="warning"?u=pt.createElement(aU,{color:cU.value}):u=pt.createElement(iU,{color:pU.value,size:"sm"}),pt.createElement("div",{id:`failing-validation-${e.id}`},u," ",l,p?".":""," ",p)},qc=({validationsInfo:e="",setCurrentStepId:t,wizardStepNames:o,wizardStepsValidationsMap:r})=>{let s=G(e)||{},n=[],i=0;return Object.keys(s).forEach(a=>{let l=p=>{p.status==="pending"&&i++,p.status==="failure"&&n.push(pt.createElement(Ux,{key:p.id,validation:p,clusterGroup:a,setCurrentStepId:t,wizardStepNames:o,wizardStepsValidationsMap:r}))};s[a].forEach(l)}),i&&n.unshift(pt.createElement(mU,{key:"pending-validations",id:"cluster-pending-validations",count:i})),n.length===0?pt.createElement(Gx,null):pt.createElement(pt.Fragment,null,n)},Yc=({hosts:e=[],setCurrentStepId:t,wizardStepNames:o,allClusterWizardSoftValidationIds:r,wizardStepsValidationsMap:s})=>{let n={};An(e).forEach(a=>{let l=G(a.validationsInfo)||{};Object.keys(l).forEach(p=>{let c=u=>{if(u.status==="failure"){let m=r.includes(u.id)?"warning":"danger";n[u.id]=n[u.id]||pt.createElement(Ux,{key:u.id,validation:u,hostGroup:p,severity:m,setCurrentStepId:t,wizardStepNames:o,wizardStepsValidationsMap:s})}};l[p].forEach(c)})});let i=oU(n);return i.length===0?pt.createElement(Gx,null):pt.createElement(pt.Fragment,null,i)};import{array as $x,bool as CU,boolean as hU,lazy as gU,object as Fy,string as qx}from"yup";var Kx=()=>[{url:"",thumbprint:""}],fU=e=>{if(!e)return Kx();let t=Kx();try{t=JSON.parse(e)}catch{console.warn("Tang Servers can not be parsed")}return t},_d=({cluster:e,pullSecret:t,managedDomains:o,ocpVersions:r,baseDomain:s})=>{let{name:n="",highAvailabilityMode:i="Full",baseDnsDomain:a=s||"",openshiftVersion:l=ml(r)}=e||{};return{name:n,highAvailabilityMode:i,openshiftVersion:l,pullSecret:t||"",baseDnsDomain:a,SNODisclaimer:i==="None",useRedHatDnsService:!!a&&o.map(p=>p.domain).includes(a),enableDiskEncryptionOnMasters:["all","masters"].includes(e?.diskEncryption?.enableOn??"none"),enableDiskEncryptionOnWorkers:["all","workers"].includes(e?.diskEncryption?.enableOn??"none"),diskEncryptionMode:e?.diskEncryption?.mode??"tpmv2",diskEncryptionTangServers:fU(e?.diskEncryption?.tangServers),diskEncryption:e?.diskEncryption??{},cpuArchitecture:e?.cpuArchitecture||_.x86}},Rd=({usedClusterNames:e,featureSupportLevels:t,pullSecretSet:o,ocpVersions:r,validateUniqueName:s,isOcm:n,t:i})=>gU(a=>{let l=()=>Al(i,e,a.baseDnsDomain,s,n);return o?Fy({name:l(),baseDnsDomain:ba.required("Required")}):Fy({name:l(),baseDnsDomain:ba.required("Required"),pullSecret:ws.required("Required."),SNODisclaimer:hU().when(["highAvailabilityMode","openshiftVersion"],{is:(p,c)=>{let u=(r||[]).find(m=>m.value===c);return p==="None"&&u&&t.getFeatureSupportLevel(u.value,"SNO")==="dev-preview"},then:CU().oneOf([!0],i("ai:Confirm the Single Node OpenShift disclaimer to continue."))}),diskEncryptionTangServers:$x().when("diskEncryptionMode",{is:p=>p==="tang",then:$x().of(Fy().shape({url:qx().url(i('ai:Tang Server URL must be a valid URL starting with "http://" or "https://"')).required(i("ai:Required.")),thumbprint:qx().required(i("ai:Required."))}))})})});import Bs from"react";import{DescriptionList as Yx,DescriptionListDescription as yU,DescriptionListGroup as SU,DescriptionListTerm as vU,Grid as IU,GridItem as jx}from"@patternfly/react-core";var Xx=({item:e})=>Bs.createElement(SU,null,Bs.createElement(vU,null,e.key),Bs.createElement(yU,null,e.value||be)),bU=({leftItems:e,rightItems:t=[]})=>Bs.createElement(IU,{hasGutter:!0},Bs.createElement(jx,{span:t.length?6:12},Bs.createElement(Yx,null,e.map(o=>Bs.createElement(Xx,{key:o.key,item:o})))),t.length&&Bs.createElement(jx,{span:6},Bs.createElement(Yx,null,t.map(o=>Bs.createElement(Xx,{key:o.key,item:o}))))),Bd=bU;import zs from"react";import{Flex as kU,FlexItem as Jx,Progress as xU,ProgressMeasureLocation as Zx,ProgressVariant as Qx}from"@patternfly/react-core";var TU=e=>{switch(e){case"cancelled":case"error":return Qx.danger;case"installed":case"adding-hosts":return Qx.success;default:return}},PU=e=>["installed","adding-hosts"].includes(e)?Zx.none:Zx.top,AU=(e,t,o)=>e==="installed"||e==="adding-hosts"?o("ai:Installed on {{humanizedDataTime}}",{humanizedDataTime:to(t)}):e==="error"?o("ai:Failed on {{humanizedDataTime}}",{humanizedDataTime:to(t)}):e==="cancelled"?o("ai:Cancelled on {{humanizedDataTime}}",{humanizedDataTime:to(t)}):bn(o)[e]||e,wU=({cluster:e,minimizedView:t=!1,totalPercentage:o})=>{let{status:r}=e,{t:s}=f();return zs.createElement(zs.Fragment,null,zs.createElement(bt,null,zs.createElement(kU,{direction:{default:t?"row":"column"}},zs.createElement(Jx,null,zs.createElement(N,{title:s("ai:Started on"),value:to(e.installStartedAt),idPrefix:"cluster-progress-started-on"})),zs.createElement(Jx,null,zs.createElement(N,{title:s("ai:Status"),value:AU(e.status,e.installCompletedAt,s),idPrefix:"cluster-progress-status"})))),zs.createElement(ae,{condition:!t},zs.createElement(xU,{value:o||0,label:`${o||0}%`,title:" ",measureLocation:PU(r),variant:TU(r),className:"cluster-progress-bar"})))},xi=wU;import xt from"react";import{GridItem as LU,ClipboardCopy as OU,clipboardCopyFunc as _U,Button as RU,Alert as BU}from"@patternfly/react-core";import rt from"react";import{Modal as DU,Button as Ny,ButtonVariant as Vy,Text as EU,ModalVariant as FU,ExpandableSection as NU}from"@patternfly/react-core";import{InfoCircleIcon as VU}from"@patternfly/react-icons";var HU=e=>e&&e.length>0?[...e.slice(1)].reduce((t,o)=>`${t}
9
+ ${o}`,e[0]):"",eT=e=>{let{requiredList:t,...o}=e;return rt.createElement(NU,{...o},rt.createElement(kt,{code:HU(t),language:"markup",copiable:!0}))},MU=({cluster:e,consoleUrl:t})=>{let[o,r]=rt.useState(!0),s=()=>r(!o),[n="",i=""]=[e.apiVip,e.ingressVip],a=`${e.name}.${e.baseDnsDomain}`,l=`apps.${a}`,p=[`${n} api.${a}`,`${i} oauth-openshift.${l}`,`${i} ${Dm(t)}`,`${i} grafana-openshift-monitoring.${l}`,`${i} thanos-querier-openshift-monitoring.${l}`,`${i} prometheus-k8s-openshift-monitoring.${l}`,`${i} alertmanager-main-openshift-monitoring.${l}`],c=`*.${l}.`.length+2,u=[`api.${a}`.padEnd(c)+`A ${n}`,`*.${l}`.padEnd(c)+`A ${i}`],{t:m}=f();return rt.createElement(rt.Fragment,null,rt.createElement(EU,{component:"p"},m("ai:In order to access the OpenShift Web Console, use external DNS server or local configuration to resolve its hostname. To do so, either:")),rt.createElement(eT,{toggleText:m("ai:Option 1: Add the following records to your DNS server (recommended)"),className:"pf-u-pb-md",isExpanded:o,onToggle:s,requiredList:u}),rt.createElement(eT,{toggleText:m("ai:Option 2: Update your local /etc/hosts or /etc/resolv.conf files"),className:"pf-u-pb-md",isExpanded:!o,onToggle:s,requiredList:p}))},tT=({cluster:e,consoleUrl:t,isDisabled:o,id:r})=>{let[s,n]=rt.useState(!1),{t:i}=f();return rt.createElement(rt.Fragment,null,rt.createElement(Rt,{type:"button",variant:Vy.primary,isDisabled:o,onClick:()=>n(!0),"data-testid":r},i("ai:Launch OpenShift Console")),rt.createElement(rT,{closeModal:()=>n(!1),consoleUrl:t,cluster:e,isOpen:s}))},oT=({cluster:e,consoleUrl:t,idPrefix:o})=>{let[r,s]=rt.useState(!1),{t:n}=f();return rt.createElement(rt.Fragment,null,rt.createElement(Ny,{variant:"link",icon:rt.createElement(VU,null),iconPosition:"left",isInline:!0,onClick:()=>s(!0),"data-testid":`${o}-troubleshooting-hint-open`},n("ai:Not able to access the Web Console?")),rt.createElement(rT,{closeModal:()=>s(!1),consoleUrl:t,cluster:e,isOpen:r}))},rT=({closeModal:e,cluster:t,consoleUrl:o,isOpen:r})=>{let{t:s}=f(),n=[rt.createElement(Ny,{type:"submit",key:"launch",variant:Vy.primary,onClick:()=>window.open(o,"_blank","noopener"),isDisabled:!o},s("ai:Launch OpenShift Console")),rt.createElement(Ny,{variant:Vy.secondary,onClick:()=>e(),key:"close"},s("ai:Close"))];return rt.createElement(DU,{title:s("ai:OpenShift Web Console troubleshooting"),isOpen:r,onClose:e,actions:n,variant:FU.large},rt.createElement(MU,{cluster:t,consoleUrl:o}))};import{ExternalLinkAltIcon as zU}from"@patternfly/react-icons";var WU=({cluster:e,credentials:t,error:o=!1,retry:r,idPrefix:s="cluster-creds",credentialsError:n=""})=>{let i,{t:a}=f();if(o)n.includes("403")?i=xt.createElement(BU,{variant:"info",isInline:!0,title:"You do not have permission to view the cluster credentials"},"For more information, contact your organization administrator"):i=xt.createElement(j,{title:a("ai:Failed to fetch cluster credentials."),fetchData:r});else if(!t)i=xt.createElement(z,null);else{if(!t.username&&!t.consoleUrl)return xt.createElement(xt.Fragment,null,"N/A");i=xt.createElement(bt,null,t.consoleUrl&&xt.createElement(N,{title:a("ai:Web Console URL"),value:xt.createElement(xt.Fragment,null,xt.createElement(RU,{variant:"link",icon:xt.createElement(zU,null),iconPosition:"right",isInline:!0,onClick:()=>window.open(t.consoleUrl,"_blank","noopener"),"data-testid":`${s}-link-console-url`},t.consoleUrl),xt.createElement("br",null),e.apiVip&&e.ingressVip&&xt.createElement(oT,{consoleUrl:t.consoleUrl,cluster:e,idPrefix:s}))}),t.username&&xt.createElement(xt.Fragment,null,xt.createElement(N,{title:"Username",value:t.username}),xt.createElement(N,{title:a("ai:Password"),value:xt.createElement(OU,{isReadOnly:!0,onCopy:l=>_U(l,t.password)},"\u2022\u2022\u2022\u2022\u2022")})))}return xt.createElement(LU,{span:12},i)},jl=WU;import sT from"react";import{saveAs as nT}from"file-saver";import{Button as GU,ButtonVariant as UU}from"@patternfly/react-core";var zd=new AbortController,Ve={abortLastGetRequest(){zd.abort(),zd=new AbortController},makeBaseURI(e){return`/v2/clusters/${e||""}`},makeDownloadsBaseURI(e){return`${Ve.makeBaseURI(e)}/downloads`},makeLogsBaseURI(e){return`${Ve.makeBaseURI(e)}/logs`},makeDownloadsCredentialsBaseURI(e){return`${Ve.makeDownloadsBaseURI(e)}/credentials`},makeDownloadsCredentialsPresignedBaseURI(e){return`${Ve.makeDownloadsBaseURI(e)}/credentials-presigned`},makeDownloadsFilesPresignedBaseURI(e){return`${Ve.makeDownloadsBaseURI(e)}/files-presigned`},makeSupportedPlatformsBaseURI(e){return`${Ve.makeBaseURI(e)}/supported-platforms`},makeActionsBaseURI(e){return`${Ve.makeBaseURI(e)}/actions`},downloadClusterCredentials(e,t){return K.get(`${Ve.makeDownloadsCredentialsBaseURI(e)}?file_name=${t}`,{responseType:"blob",headers:{Accept:"application/octet-stream"}})},getPresignedForClusterCredentials({clusterId:e,fileName:t,hostId:o,logsType:r}){let s=`${r?`&logs_type=${r}`:""}${o?`&host_id=${o}`:""}`;return K.get(`${Ve.makeDownloadsCredentialsPresignedBaseURI(e)}?file_name=${t}${s}`)},getPresignedForClusterFiles({clusterId:e,fileName:t,hostId:o,logsType:r}){let s=`${r?`&logs_type=${r}`:""}${o?`&host_id=${o}`:""}`;return K.get(`${Ve.makeDownloadsFilesPresignedBaseURI(e)}?file_name=${t}${s}`)},list(){return K.get(`${Ve.makeBaseURI()}`,{signal:zd.signal})},get(e){return K.get(`${Ve.makeBaseURI(e)}`,{signal:zd.signal})},getSupportedPlatforms(e){return K.get(`${Ve.makeSupportedPlatformsBaseURI(e)}`)},getPreflightRequirements(e){return K.get(`${Ve.makeBaseURI(e)}/preflight-requirements`)},getDefaultConfig(){return K.get(`${Ve.makeBaseURI()}/default-config`)},deregister(e){return K.delete(`${Ve.makeBaseURI(e)}`)},register(e){return K.post(`${Ve.makeBaseURI()}`,e)},update(e,t){return K.patch(`${Ve.makeBaseURI(e)}`,t)},install(e){return K.post(`${Ve.makeActionsBaseURI(e)}/install`)},cancel(e){return K.post(`${Ve.makeActionsBaseURI(e)}/cancel`)},reset(e){return K.post(`${Ve.makeActionsBaseURI(e)}/reset`)},registerAddHosts(e){return K.post(`${Ve.makeBaseURI()}import`,e)},allowAddHosts(e){return K.post(`${Ve.makeActionsBaseURI(e)}/allow-add-workers`)},downloadLogs(e,t){let o=`logs_type=${t?`host&host_id=${t}`:"all"}`;return K.get(`${Ve.makeLogsBaseURI(e)}?${o}`,{responseType:"blob",headers:{Accept:"application/octet-stream"}})},getCredentials(e){return K.get(`${Ve.makeBaseURI(e)}/credentials`)},listByOpenshiftId(e){return K.get(`${Ve.makeBaseURI()}?openshift_cluster_id=${e||""}`)},listBySubscriptionIds(e){return K.get(`${Ve.makeBaseURI()}?ams_subscription_ids=${e.toString()}`)}},X=Ve;var KU=e=>{let t=e["content-disposition"]&&e["content-disposition"].match(/filename=".*"/);return t?t[0].slice(10,-1):"kubeconfig"},$U=({clusterId:e,status:t,id:o,handleDownload:r})=>{let{addAlert:s}=M(),n=sT.useCallback(async(a,l)=>{try{if(Ce){let{data:p}=await X.getPresignedForClusterCredentials({clusterId:a,fileName:"kubeconfig"});nT(p.url)}else{let p=await X.downloadClusterCredentials(a,"kubeconfig"),c=KU(p.headers);nT(p.data,c)}}catch(p){D(p,c=>{s({title:l("ai:Could not download kubeconfig"),message:R(c)})})}},[s]),{t:i}=f();return sT.createElement(GU,{variant:UU.secondary,onClick:r||(()=>n(e,i)),isDisabled:!Il(t),id:o,"data-testid":o},"Download kubeconfig")},Ti=$U;import Ud from"react";import{useFormikContext as JU}from"formik";import Bo from"react";import{Alert as qU,AlertVariant as iT,List as YU,ListItem as Wd,Stack as jU,StackItem as aT}from"@patternfly/react-core";var XU=({snoSupportLevel:e,isDisabled:t=!1,snoExpansionSupported:o=!1})=>{let{t:r}=f();if(!["dev-preview","supported"].includes(e))return null;let s=e==="dev-preview",n=Bo.createElement(Bo.Fragment,null,Bo.createElement(Wd,null,r("ai:Installing SNO will result in a non-highly available OpenShift deployment.")),!o&&Bo.createElement(Wd,null,r("ai:Currently, adding additional machines to your cluster is not supported."))),i=Bo.createElement(Bo.Fragment,null,Bo.createElement(Wd,null,r("ai:SNO is in a proof-of-concept stage and is not supported in any way.")),Bo.createElement(Wd,null,r("ai:OpenShift in-place upgrades aren't expected to work with SNO. If an upgrade is needed, your system will need a redeployment.")));return Bo.createElement(qU,{variant:s?iT.warning:iT.info,title:r("ai:Limitations for using Single Node OpenShift"),isInline:!0},Bo.createElement(jU,{hasGutter:!0},Bo.createElement(aT,null,Bo.createElement(YU,null,n,s&&i)),s&&Bo.createElement(aT,null,Bo.createElement(eo,{name:"SNODisclaimer",label:r("ai:I understand, accept, and agree to the limitations associated with using Single Node OpenShift."),isDisabled:t}))))},Gd=XU;var ZU=({versions:e,highAvailabilityMode:t})=>{let{values:o}=JU(),r=Pe(),s=r.getFeatureSupportLevel(o.openshiftVersion,"SNO"),n=r.isFeatureSupported(o.openshiftVersion,"SINGLE_NODE_EXPANSION"),i=r.isFeatureDisabled(o.openshiftVersion,"SNO");return Ud.createElement(Ud.Fragment,null,Ud.createElement(gc,{name:"highAvailabilityMode",versions:e,isDisabled:i}),t==="None"&&s&&Ud.createElement(Gd,{isDisabled:i,snoSupportLevel:s,snoExpansionSupported:n}))},Xl=ZU;import Po from"react";import{ExclamationCircleIcon as tK,ExclamationTriangleIcon as pT,ExternalLinkAltIcon as oK}from"@patternfly/react-icons";import{global_warning_color_100 as cT,global_danger_color_100 as rK}from"@patternfly/react-tokens";var QU="name-of-month DD, YYYY",eK={"4.8":"January 27, 2023","4.7":"August 24, 2022","4.6":"October 27, 2022"},Pi={"dates format":QU,versions:eK};function jc(e){let t=new Date(e),o=new Date;return Math.floor(Math.abs(o.valueOf()-t.valueOf())/fC)}function lT(e,t){return t&&t!==gl?e-jc(t):e}var uT=()=>{let{t:e}=f();return Po.createElement("a",{href:sc,target:"_blank",rel:"noopener noreferrer"},e("ai:Learn more")," ",Po.createElement(oK,null))},sK=e=>t=>{let{t:o}=f();if(!e.length)return Po.createElement(Po.Fragment,null,Po.createElement(tK,{color:rK.value,size:"sm"}),"\xA0 ",o("ai:No release image is available."));let r=null;return e.find(n=>n.value===t)?.supportLevel!=="production"?r=Po.createElement(Po.Fragment,null,Po.createElement(pT,{color:cT.value,size:"sm"}),"\xA0",o("ai:Please note that this version is not production-ready."),"\xA0",Po.createElement(uT,null)):t in Pi.versions&&jc(Pi.versions[t])<=30&&(r=Po.createElement(Po.Fragment,null,Po.createElement(pT,{color:cT.value,size:"sm"}),"\xA0",o("ai:Full support for this version ends on {{openshiftversion}} and won't be available as an installation option afterwards.",{openshiftversion:Pi.versions[t]}),"\xA0",Po.createElement(uT,null))),r},nK=({versions:e})=>{let t=Po.useMemo(()=>e.filter(r=>r.supportLevel!=="maintenance").map(r=>({label:r.label,value:r.value})),[e]),{t:o}=f();return Po.createElement(es,{label:o("ai:OpenShift version"),name:"openshiftVersion",options:t,getHelperText:sK(e),isDisabled:e.length===0,isRequired:!0})},Jl=nK;import{Fragment as gK,createElement as Kd}from"react";import{useField as dK}from"formik";import{Fragment as mK,createElement as Mn,useEffect as uK,useState as cK}from"react";import{useFormikContext as iK}from"formik";import{Checkbox as aK,FormGroup as lK}from"@patternfly/react-core";var My=({fieldId:e="sshPublicKey"})=>{let{t}=f();return Mn(Q,{fieldId:e},t("ai:Paste the content of a public ssh key you want to use to connect to the hosts into this field.")," ",Mn(tt,{href:oC},t("ai:Learn more")))},pK=({clusterSshKey:e,imageSshKey:t,isDisabled:o=!1})=>{let r=!!t&&(e===t||!e),[s,n]=cK(r),{values:i,setFieldValue:a,errors:l,touched:p}=iK(),c=l.sshPublicKey,u=()=>{i.sshPublicKey&&a("sshPublicKey",Sn(i.sshPublicKey))};uK(()=>{!o&&s&&a("sshPublicKey",t)},[s,t,a,o]);let m=E("shareDiscoverySshKey","checkbox"),{t:d}=f();return Mn(mK,null,Mn(lK,{fieldId:m,label:d("ai:Host SSH Public Key for troubleshooting after installation"),helperTextInvalid:c,validated:p&&c?"error":"default"},Mn(ae,{condition:Boolean(t)},Mn(aK,{name:"shareDiscoverySshKey",id:m,label:d("ai:Use the same host discovery SSH key"),"aria-describedby":`${m}-helper`,isChecked:s,isDisabled:o,onChange:n})),Mn(ae,{condition:!s},Mn(Qr,{name:"sshPublicKey",helperText:Mn(My,null),onBlur:u,isDisabled:o}))))},Zl=pK;var fK=({isRequired:e})=>{let[{name:t,value:o},,{setValue:r}]=dK("sshPublicKey"),{t:s}=f();return Kd(oc,{label:Kd(gK,null,s("ai:SSH public key")," ",Kd(H,{bodyContent:s("ai:Provide an SSH key to be able to connect to the hosts for debugging purposes during the discovery process")})),name:t,helperText:Kd(My,null),idPostfix:"discovery",onBlur:()=>o&&r(Sn(o)),dropzoneProps:{accept:".pub",maxSize:2048,onDropRejected:({setError:n})=>()=>n(s("ai:File not supported."))},transformValue:Sn,isRequired:e})},Ws=fK;import Re from"react";import{useFormikContext as mT}from"formik";import{Grid as hK}from"@patternfly/react-core";import{Trans as Ly}from"react-i18next";var Ql=()=>{let{setFieldValue:e,values:t}=mT(),o=()=>{t.noProxy&&e("noProxy",Er(t.noProxy))},{t:r}=f();return Re.createElement(hK,{hasGutter:!0},Re.createElement(J,{label:Re.createElement(Re.Fragment,null,r("ai:HTTP proxy URL")," ",Re.createElement(H,{bodyContent:r("ai:The HTTP proxy URL that agents should use to access the discovery service.")})),name:"httpProxy",placeholder:"http://<user>:<password>@<ipaddr>:<port>",helperText:Re.createElement("div",null,Re.createElement(Ly,{t:r,components:{bold:Re.createElement("strong",null)},i18nKey:"ai:URL must start with <bold>http</bold>."}))}),Re.createElement(J,{label:Re.createElement(Re.Fragment,null,r("ai:HTTPS proxy URL")," ",Re.createElement(H,{bodyContent:r("ai:Specify the HTTPS proxy that agents should use to access the discovery service. If you don't provide a value, your HTTP proxy URL will be used by default for both HTTP and HTTPS connections.")})),name:"httpsProxy",placeholder:"http://<user>:<password>@<ipaddr>:<port>",helperText:Re.createElement("div",null,Re.createElement(Ly,{t:r,components:{bold:Re.createElement("strong",null)},i18nKey:"ai:URL must start with <bold>http</bold> (https schemes are not currently supported)."}))}),Re.createElement(J,{label:Re.createElement(Re.Fragment,null,r("ai:No proxy domains")," ",Re.createElement(H,{bodyContent:r("ai:Exclude destination domain names, IP addresses, or other network CIDRs from proxying by adding them to this comma-separated list.")})),name:"noProxy",placeholder:"one.domain.com,second.domain.com",helperText:Re.createElement("div",null,Re.createElement(Ly,{t:r,components:{bold:Re.createElement("strong",null)},i18nKey:"ai:Use a comma to separate each listed domain. Preface a domain with <bold>.</bold> to include its subdomains. Use <bold>*</bold> to bypass the proxy for all destinations."})),onBlur:o}))},CK=()=>{let{setFieldValue:e,values:t,initialValues:o}=mT(),r=n=>{n?(e("httpProxy",o.httpProxy),e("httpsProxy",o.httpsProxy),e("noProxy",o.noProxy)):(e("httpProxy",""),e("httpsProxy",""),e("noProxy",""))},{t:s}=f();return Re.createElement(Re.Fragment,null,Re.createElement(eo,{label:s("ai:Configure cluster-wide proxy settings"),name:"enableProxy",className:"ai-proxy-fields",helperText:Re.createElement("p",null,s("ai:If hosts are behind a firewall that requires the use of a proxy, provide additional information about the proxy.")),onChange:n=>r(n),body:t.enableProxy&&Re.createElement(Ql,null)}))},Gs=CK;import IT from"react";import{Modal as BK,ModalVariant as zK}from"@patternfly/react-core";import it from"react";import{saveAs as MK}from"file-saver";import{Alert as yT,Button as By,ButtonVariant as zy,ClipboardCopy as ST,clipboardCopyFunc as vT,ModalBoxBody as LK,ModalBoxFooter as OK,Stack as _K,StackItem as Wy}from"@patternfly/react-core";import Us from"react";import{TextListItem as Xc,OrderType as yK,Text as SK,TextContent as vK,TextList as IK}from"@patternfly/react-core";import{Trans as bK}from"react-i18next";var kK=({showAllInstructions:e=!1,isSNO:t=!1})=>{let{t:o}=f();return Us.createElement(vK,null,Us.createElement(SK,{component:"h3"},o("ai:Adding hosts instructions")),Us.createElement(IK,{component:"ol",type:yK.number,style:{marginLeft:0}},Us.createElement(Xc,{hidden:!e},o("ai:Click the Add host button.",{count:+t})),Us.createElement(Xc,{hidden:!e},o("ai:Configure the SSH key and proxy settings after the modal appears (optional).")),Us.createElement(Xc,null,o("ai:Download the Discovery ISO (onto a USB drive, attach it to a virtual media, etc.) and use it to boot your hosts.")),Us.createElement(Xc,null,Us.createElement(bK,{t:o,count:+t,components:{bold:Us.createElement("strong",null)},i18nKey:"ai:Keep the Discovery ISO media connected to the device throughout the installation process and set each host to boot <bold>only one time</bold> from this device. "})),Us.createElement(Xc,null,o("ai:Booted hosts should appear in the host inventory table. This may take a few minutes."))))},ep=kK;import ct from"react";import{lazy as VK,object as HK}from"yup";import{Button as Oy,Form as PK,ModalBoxBody as AK,ModalBoxFooter as wK,AlertVariant as CT,Alert as _y,Stack as DK,StackItem as Ry}from"@patternfly/react-core";import{ExternalLinkAltIcon as EK}from"@patternfly/react-icons";import{Formik as FK}from"formik";import Ks from"react";import{Stack as xK,StackItem as dT}from"@patternfly/react-core";var fT="imageType",gT=({text:e,popoverContent:t})=>Ks.createElement(Ks.Fragment,null,e," ",Ks.createElement(H,{component:"a",bodyContent:t,noVerticalAlign:!0})),TK=()=>{let{t:e}=f();return Ks.createElement(xK,{hasGutter:!0},Ks.createElement(dT,null,Ks.createElement(ie,{name:fT,id:"minimal-iso",value:"minimal-iso",label:Ks.createElement(gT,{text:e("ai:Minimal image file: Provision with virtual media"),popoverContent:e("ai:Recommended option. The generated discovery ISO will be smaller, but will need to download additional data during boot. This option is useful if ISO storage capacity is limited or if it's being served over a constrained network.")})})),Ks.createElement(dT,null,Ks.createElement(ie,{name:fT,id:"full-iso",value:"full-iso",label:Ks.createElement(gT,{text:e("ai:Full image file: Provision with physical media"),popoverContent:e("ai:The generated discovery ISO will contain everything needed to boot.")})})))},hT=TK;var $d=()=>{let{t:e}=f();return ct.createElement(_y,{title:e("ai:To use static network configuration, follow the steps listed in the documentation."),isInline:!0,variant:"info"},ct.createElement(Oy,{variant:"link",icon:ct.createElement(EK,null),iconPosition:"right",isInline:!0,onClick:()=>window.open(cc,"_blank","noopener")},e("ai:View documentation")))},NK=VK(e=>HK().shape({sshPublicKey:go,httpProxy:Mo(e,"httpsProxy"),httpsProxy:Mo(e,"httpProxy"),noProxy:Fs})),Jc=({handleSubmit:e,onCancel:t,sshPublicKey:o,httpProxy:r,httpsProxy:s,noProxy:n,imageType:i,hideDiscoveryImageType:a,hasDHCP:l})=>{let p={sshPublicKey:o||"",httpProxy:r||"",httpsProxy:s||"",noProxy:n||"",enableProxy:!!(r||s||n),imageType:i||"minimal-iso"},{t:c}=f();return ct.createElement(FK,{initialValues:p,initialStatus:{error:null},validationSchema:NK,onSubmit:e},({submitForm:u,isSubmitting:m,status:d})=>ct.createElement(ct.Fragment,null,ct.createElement(AK,null,ct.createElement(DK,{hasGutter:!0},ct.createElement(Ry,null,ct.createElement(_y,{variant:CT.info,isInline:!0,title:c("ai:Generate a Discovery ISO in order to add hosts to the cluster.")})),l===!1&&ct.createElement(Ry,null,ct.createElement($d,null)),ct.createElement(Ry,null,ct.createElement(PK,null,d?.error&&ct.createElement(_y,{variant:CT.danger,title:d.error.title,isInline:!0},d.error.message),!a&&ct.createElement(hT,null),ct.createElement(Ws,null),ct.createElement(Gs,null))))),ct.createElement(wK,null,ct.createElement(Oy,{onClick:u,isDisabled:m,isLoading:m},c(m?"ai:Generating":"ai:Generate Discovery ISO")),ct.createElement(Oy,{key:"cancel",variant:"link",onClick:t},c("ai:Cancel")))))};var RK=({fileName:e="discovery.iso",downloadUrl:t,onClose:o,onReset:r,hasDHCP:s,isSNO:n=!1})=>{let i=`wget -O ${e} '${t||""}'`,{t:a}=f();return it.createElement(it.Fragment,null,it.createElement(LK,null,it.createElement(_K,{hasGutter:!0},it.createElement(Wy,null,it.createElement(yT,{isInline:!0,variant:"success",title:a("ai:Discovery ISO is ready to be downloaded")},it.createElement(it.Fragment,null,"\xA0",it.createElement(ep,{isSNO:n})))),s===!1&&it.createElement(Wy,null,it.createElement($d,null)),it.createElement(Wy,null,it.createElement(bt,null,it.createElement(N,{title:a("ai:Discovery ISO URL"),value:it.createElement(ST,{isReadOnly:!0,onCopy:l=>vT(l,t)},t)}),it.createElement(N,{title:a("ai:Command to download the ISO:"),value:it.createElement(ST,{isReadOnly:!0,onCopy:l=>vT(l,i)},i)})),it.createElement(yT,{variant:"info",isInline:!0,title:`${a("ai:Never share your downloaded ISO with anyone else.")} ${a("ai:Forwarding it could put your credentials and personal data at risk.")}`})))),it.createElement(OK,null,it.createElement(By,{variant:zy.primary,onClick:()=>t&&MK(t),"data-testid":"download-iso-btn",isDisabled:!t},a("ai:Download Discovery ISO")),it.createElement(By,{variant:zy.secondary,onClick:o,"data-testid":"close-iso-btn"},a("ai:Close")),r&&it.createElement(By,{variant:zy.link,onClick:r,"data-testid":"edit-iso-btn"},a("ai:Edit ISO configuration"))))},Ai=RK;var WK=({isOpen:e,...t})=>{let{t:o}=f();return IT.createElement(BK,{"aria-label":o("ai:Download host discovery ISO dialog"),title:o("ai:Add host"),isOpen:e,onClose:t.onClose,variant:zK.small,hasNoBodyWrapper:!0,id:"download-discovery-iso-modal"},IT.createElement(Ai,{...t}))},bT=WK;import GK from"react";import{Alert as UK,AlertVariant as KK}from"@patternfly/react-core";var $K=({someDisksAreSkipFormatting:e})=>{let{t}=f();return GK.createElement(UK,{variant:KK.warning,isInline:!0,title:t(e?"ai:There may be issues with the boot order":"ai:All bootable disks will be formatted during installation. Make sure to backup any sensitive data.")},e?t("ai:You have opted out of formatting bootable disks on some hosts. To ensure the hosts reboot into the expected installation disk, manual user intervention may be required during OpenShift installation."):"")},tp=$K;import le from"react";import{Button as kT,Modal as qK,ButtonVariant as xT,ModalVariant as YK,TextContent as jK,Text as Bt,TextVariants as zt}from"@patternfly/react-core";import{InfoCircleIcon as XK}from"@patternfly/react-icons";import{Trans as JK}from"react-i18next";var qd=()=>{let{t:e}=f();return le.createElement(jK,null,le.createElement(Bt,{component:zt.p},e("ai:To troubleshoot host discovery issues, complete the following steps:")),le.createElement(Bt,{component:zt.h2},e("ai:Verify that your host machine is powered on")),le.createElement(Bt,{component:zt.p},e("ai:Note: Boot time depends on several factors such as your hardware and network configuration, and if you are booting from an ISO.")),le.createElement(Bt,{component:zt.h2},e("ai:If you used DHCP networking, verify that your DHCP server is enabled")),le.createElement(Bt,{component:zt.h2},e("ai:If you used static IP, bridges, and bonds networking, verify that your configurations are correct")),le.createElement(Bt,{component:zt.h2},e("ai:SSH into your machine")),le.createElement(Bt,{component:zt.p},e("ai:Verify that you can access your host machine using SSH, or a console such as BMC or virtual machine console. In the CLI, enter the following command:")),le.createElement(kt,{code:"ssh -i <identity_file> core@<machine-ip>"}),le.createElement(Bt,{component:zt.p},e("ai:NOTE: Authentication is provided by the discovery ISO, therefore when you access your host using SSH, a password is not required. Optional -i parameter can be used to specify the private key that matches the public key provided when generating Discovery ISO.")),le.createElement(Bt,{component:zt.h2},e("ai:Verify that the discovery agent is running with the correct parameters")),le.createElement(kt,{code:"ps -ef | grep agent"}),le.createElement(Bt,{component:zt.p},e("ai:The output displays the following:")),le.createElement(kt,{code:`root 1786 1 0 08:03 ? 00:00:00 /usr/local/bin/agent --url https://api.openshift.com --cluster-id e4c85fbe-77c7-411e-b107-5120f615c4fb --agent-version registry.redhat.io/openshift4/assisted-installer-agent-rhel8:v4.6.0-17 --insecure=false
10
+ core 2362 2311 0 08:04 pts/0 00:00:00 grep --color=auto agent`}),le.createElement(Bt,{component:zt.h2},e("ai:Verify that the agent ran successfully")),le.createElement(Bt,{component:zt.p},e("ai:To verify that the agent ran successfully, check the logs:")),le.createElement(kt,{code:"sudo journalctl -u agent.service"}),le.createElement(Bt,{component:zt.p},e("ai:In the following example, the errors indicate there is a network issue:")),le.createElement(kt,{code:`Oct 15 11:26:35 localhost systemd[1]: agent.service: Service RestartSec=3s expired, scheduling restart.
11
+ Oct 15 11:26:35 localhost systemd[1]: agent.service: Scheduled restart job, restart counter is at 9.
12
+ Oct 15 11:26:35 localhost systemd[1]: Stopped agent.service.
13
+ Oct 15 11:26:35 localhost systemd[1]: Starting agent.service...
14
+ Oct 15 11:26:35 localhost podman[1834]: Trying to pull quay.io/ocpmetal/assisted-installer-agent:latest...
15
+ Oct 15 11:26:35 localhost podman[1834]: Get "https://quay.io/v2/": dial tcp: lookup quay.io on [::1]:53: read udp [::1]:58297->[::1]:53: read: connection refused
16
+ Oct 15 11:26:35 localhost podman[1834]: Error: unable to pull quay.io/ocpmetal/assisted-installer-agent:latest: unable to pull image: Error initializing source docker://quay.io/ocpmetal/assisted-installer-agent:latest: error pinging dock>
17
+ Oct 15 11:26:35 localhost systemd[1]: agent.service: Control process exited, code=exited status=125
18
+ Oct 15 11:26:35 localhost systemd[1]: agent.service: Failed with result 'exit-code'.
19
+ Oct 15 11:26:35 localhost systemd[1]: Failed to start agent.service.`}),le.createElement(Bt,{component:zt.p},le.createElement(JK,{t:e,components:{code:le.createElement("code",null)},i18nKey:"ai:Check the proxy settings and verify that the assisted installer service is connected to a network. You can use <code>nmcli</code> to get additional information about your network configuration."})),le.createElement(Bt,{component:zt.h2},e("ai:Check agent logs")),le.createElement(Bt,{component:zt.p},e("ai:To view detailed agent logs and communication use following command:")),le.createElement(kt,{code:"sudo journalctl TAG=agent | less"}),le.createElement(Bt,{component:zt.h2},e("ai:Check assisted-installer logs")),le.createElement(kt,{code:`sudo su
20
+ podman ps -a | grep assisted-installer
21
+ podman logs <container id>`}),le.createElement(Bt,{component:zt.h2},e("ai:Check bootkube logs")),le.createElement(kt,{code:"sudo journalctl -u bootkube"}))},Zc=({setDiscoveryHintModalOpen:e,isSNO:t=!1})=>{let{t:o}=f();return le.createElement(kT,{variant:xT.link,onClick:()=>e(!0),isInline:!0},le.createElement(XK,{size:"sm"}),"\xA0",o("ai:Host not showing up?",{count:+t}))},Ln=({setDiscoveryHintModalOpen:e,isOpen:t})=>{let o=le.useCallback(()=>e(!1),[e]),{t:r}=f();return le.createElement(qK,{title:r("ai:Troubleshooting Host Discovery Issues"),isOpen:t,actions:[le.createElement(kT,{key:"close",variant:xT.primary,onClick:o},r("ai:Close"))],onClose:o,variant:YK.large},le.createElement(qd,null))};import On from"react";import{Checkbox as ZK}from"@patternfly/react-core";import{useFormikContext as QK}from"formik";var e8=({defaultPullSecret:e,isOcm:t=!1})=>{let[o,r]=On.useState(!e),{setFieldValue:s}=QK(),{t:n}=f();if(t){let i=()=>{o&&s("pullSecret",e),r(!o)};return On.createElement(On.Fragment,null,On.createElement(ZK,{id:"checkbox-pull-secret",className:"pf-u-display-inline-flex","aria-label":n("ai:edit pull secret"),isChecked:o,onChange:i,label:On.createElement(On.Fragment,null,n("ai:Edit pull secret")," ",On.createElement(uc,{isOcm:t}))}),o&&On.createElement(As,{isOcm:t}))}return On.createElement(As,{isOcm:t})},wa=e8;var $s={"bmh-error":{key:"bmh-error",title:"Error",category:"Bare Metal Host related"},registering:{key:"registering",title:"Registering",category:"Bare Metal Host related"},provisioning:{key:"provisioning",title:"Provisioning",category:"Bare Metal Host related"},provisioned:{key:"provisioned",title:"Provisioned",category:"Bare Metal Host related"},deprovisioning:{key:"deprovisioning",title:"Deprovisioning",category:"Bare Metal Host related"},inspecting:{key:"inspecting",title:"Inspecting",category:"Bare Metal Host related"},pending:{key:"pending",title:"Pending",category:"Bare Metal Host related"}},Tt={...Vn,discovered:{key:"discovered",title:"Discovered",icon:TT(t8,null),noPopover:!0,category:"Discovery related",details:"The host has been discovered and needs to be approved to before further use."},...$s,specSyncErr:{key:"spec-sync-err",title:"Sync error",icon:TT(o8,{color:r8.value}),category:"Discovery related"}};var PT=(e,t)=>({...e,[t.type]:t}),s8=(e,t)=>{let r=(e?.status?.conditions||[]).reduce(PT,{}),{Validated:s,RequirementsMet:n,Completed:i,Stopped:a}=r;return!s||!n||!i||!a?["insufficient",t("ai:AgentClusterInstall conditions are missing.")]:a.status==="True"&&a.reason==="InstallationCancelled"?["cancelled",a.message]:a.status==="True"&&a.reason==="InstallationFailed"?["error",a.message]:i.status==="True"&&i.reason==="InstallationCompleted"?["installed",i.message]:i.status==="False"&&i.reason==="InstallationInProgress"?["installing",i.message]:s.status==="False"&&s.reason==="ValidationsFailing"?["insufficient",s.message]:s.status==="False"&&s.reason==="ValidationsUserPending"?["pending-for-input",s.message]:s.status==="False"&&s.reason==="ValidationsUnknown"?["insufficient",s.message]:n.status==="False"&&n.reason==="ClusterNotReady"?["insufficient",n.message]:n.status==="False"&&n.reason==="InsufficientAgents"?["insufficient",n.message]:n.status==="False"&&n.reason==="UnapprovedAgents"?["insufficient",n.message]:i.status==="False"&&i.reason==="UnapprovedAgents"?["insufficient",i.message]:(console.error("Unhandled conditions to cluster status mapping: ",r),["insufficient",t("ai:Unexpected AgentClusterInstall conditions.")])},Wt=e=>{let{state:t,stateInfo:o}=e?.status?.debugInfo||{};return[t||"insufficient",o||""]},n8=e=>!!e&&["pending-for-input","insufficient","ready"].includes(Wt(e)[0]),i8=(e,t)=>{let r=(e.status?.conditions||[]).reduce(PT,{}),{Installed:s,Connected:n,ReadyForInstallation:i}=r;return s?.status==="True"?["installed",s.message]:s?.status==="False"&&s.reason==="InstallationFailed"?["error",s.message]:s?.status==="False"&&s?.reason==="InstallationInProgress"?["installing",s?.message]:n?.status==="False"?["disconnected",n.message]:i?.status==="True"?["known",i.message]:i?.status==="False"&&i?.reason==="AgentIsNotApproved"?["pending-for-input",i.message]:i?.status==="False"&&i?.reason==="AgentNotReady"?["insufficient",i.message]:(console.error("Unhandled conditions to agent status mapping: ",r),["insufficient",t("ai:Unexpected Agent conditions.")])},a8=e=>e?.spec?.clusterDeploymentName?.name?"insufficient":"insufficient-unbound",ut=(e,t=!1)=>{let o=e.status?.conditions?.find(n=>n.type==="SpecSynced"&&n.status==="False"),r,s={};return o?r=Tt.specSyncErr:(r=Tt[e.status?.debugInfo?.state||a8(e)],s=e.status?.validationsInfo||{},!t&&!e.spec.approved&&(r=Tt.discovered)),{status:r,validationsInfo:s}},qs=(e,t,o,r=!1)=>{let s=ut(e,r);if([Tt.discovered,Tt.specSyncErr].includes(s.status))return s;let n=Tt[ia(t,Dr,{status:s.status.key,validationsInfo:s.validationsInfo})],i=na(s.validationsInfo,t,Dr);return n.sublabel=ul(s.validationsInfo,t,Dr)?o("ai:Some validations failed"):void 0,{status:n,validationsInfo:i}},Ys=e=>{let t=$s.pending;return e.status?.errorType?t=$s["bmh-error"]:e.status?.provisioning?.state&&(t=$s[e.status?.provisioning?.state]||$s.pending),{state:t,errorMessage:e.status?.errorMessage}};import Qy from"lodash/cloneDeep";var Gy=(e,t)=>{if(!e?.length||!t?.status?.connectivityMajorityGroups)return[];let o=JSON.parse(t.status.connectivityMajorityGroups);return Object.keys(o).filter(r=>!["IPv4","IPv6"].includes(r)).map(r=>{let s=[];return o[r].forEach(n=>{let i=e.find(a=>a.metadata?.name===n);i?.metadata?.uid?s.push(i.metadata.uid):console.warn(`Can not find agent of ${n} name.`)}),{cidr:r,hostIds:s}})};var st="agentclusterinstalls.extensions.hive.openshift.io/location",op="agentBareMetal-agentSelector-",rp="agentBareMetal-agentSelector/autoSelect",wi="NOLOCATION",Co="infraenvs.agent-install.openshift.io",zo="agent-install.openshift.io/bmh",Uy="agentBareMetal-generated-infraenv-ai-flow",Ky="agentBareMetal-cpuArchitecture",Qc=e=>`https://access.redhat.com/documentation/en-us/red_hat_advanced_cluster_management_for_kubernetes/${e}/html-single/clusters/index#enable-cim`,js="bmac.agent-install.openshift.io/hostname";var l8=["known","known-unbound","insufficient","pending-for-input","binding","unbinding","discovering","reclaiming","reclaiming-rebooting"],p8=(e=[],t)=>e.find(o=>o.metadata?.uid===t.id),ps=e=>e.filter(t=>{let{status:o}=ut(t);return l8.includes(o.key)}),$y=e=>e.spec.role||e.status?.role,qy=e=>e.status?.progress,_n=e=>e?.metadata?.labels?.[Co],Yy=e=>e?.spec?.clusterDeploymentName?.name;import v8 from"lodash/isEqual";import I8 from"lodash/pick";import{Alert as C8,AlertActionLink as DT,AlertVariant as y8}from"@patternfly/react-core";import cs from"react";import{Fragment as h8,createElement as Da,useState as g8}from"react";import{Button as AT,ButtonVariant as wT,Modal as c8,ModalVariant as u8}from"@patternfly/react-core";import{InfoCircleIcon as m8}from"@patternfly/react-icons";var d8=e=>{let t;try{t=JSON.parse(e.data?.HW_VALIDATOR_REQUIREMENTS||"[]").find(r=>r.version==="default")}catch{console.error("Failed to parse hw requirements config map"),t=void 0}return{master:{cpuCores:t?.master?.cpu_cores,ramMib:t?.master?.ram_mib,diskSizeGb:t?.master?.disk_size_gb},worker:{cpuCores:t?.worker?.cpu_cores,ramMib:t?.worker?.ram_mib,diskSizeGb:t?.worker?.disk_size_gb},sno:{cpuCores:t?.sno?.cpu_cores,ramMib:t?.sno?.ram_mib,diskSizeGb:t?.sno?.disk_size_gb}}},f8=({aiConfigMap:e,isSNOCluster:t})=>{let[o,r]=g8(!1),{t:s}=f();return Da(h8,null,Da(AT,{variant:wT.link,onClick:()=>r(!0),isInline:!0,className:"host-requirements-link"},Da(m8,{size:"sm"}),"\xA0",s("ai:Minimum hardware requirements")),Da(jy,{isOpen:o,onClose:()=>r(!1),aiConfigMap:e,isSNOCluster:t}))},jy=({isOpen:e,aiConfigMap:t,isSNOCluster:o,onClose:r})=>{let{t:s}=f();return Da(c8,{title:s("ai:Minimum hardware requirements"),isOpen:e,actions:[Da(AT,{key:"close",variant:wT.primary,onClick:r},s("ai:Close"))],onClose:r,variant:u8.medium},Da(Dd,{...d8(t),isSNOCluster:o}))},Yd=f8;var S8=({isSNO:e=!1,assistedServiceConfigMap:t})=>{let{t:o}=f(),[r,s]=cs.useState(!1),[n,i]=cs.useState(!1);return cs.createElement(cs.Fragment,null,cs.createElement(C8,{variant:y8.info,title:o("ai:Information & Troubleshooting"),actionLinks:cs.createElement(cs.Fragment,null,cs.createElement(DT,{onClick:()=>i(!0)},o("ai:Minimum hardware requirements")),cs.createElement(DT,{onClick:()=>s(!0)},o("ai:Host not showing up?",{count:+e}))),isInline:!0}),r&&cs.createElement(Ln,{isOpen:r,setDiscoveryHintModalOpen:s}),n&&cs.createElement(jy,{isSNOCluster:e,aiConfigMap:t,isOpen:n,onClose:()=>i(!1)}))},ET=S8;var eu=(e={})=>{let t=e[st]?.split(",")||[];return{labels:Object.keys(e).map(r=>{if(r.startsWith(op))return`${r.substr(op.length)}=${e[r]}`}).filter(Boolean),locations:t,autoSelect:!e[rp]||e[rp]==="true"}},b8=(e,t)=>{let{agentLabels:o,locations:r,autoSelectHosts:s}=t,n=Nm(o||[]),i={...e?.metadata?.annotations||{}};return Object.keys(i).forEach(a=>{a.startsWith(op)&&delete i[a]}),Object.keys(n).forEach(a=>{i[`${op}${a}`]=n[a]}),delete i[rp],r.length?i[st]=r.join(","):delete i[st],s||(i[rp]="false"),i},Xy=({name:e,namespace:t,baseDnsDomain:o,annotations:r,pullSecretName:s})=>({apiVersion:"hive.openshift.io/v1",kind:"ClusterDeployment",metadata:{name:e,namespace:t,annotations:r},spec:{baseDomain:o,clusterInstallRef:{group:"extensions.hive.openshift.io",kind:"AgentClusterInstall",name:e,version:"v1beta1"},clusterName:e,platform:{agentBareMetal:{agentSelector:{}}},pullSecretRef:{name:s}}}),FT=["adding-hosts","installed","finalizing"],Jy=(e,t)=>e?.status?.webConsoleURL||(FT.includes(Wt(t)[0])?`https://console-openshift-console.apps.${e?.spec?.clusterName}.${e?.spec?.baseDomain}`:void 0),k8=(e,t)=>e?.status?.apiURL||(FT.includes(Wt(t)[0])?`https://api.${e?.spec?.clusterName}.${e?.spec?.baseDomain}`:void 0),Zy=(e,t)=>{let o=t.spec?.networking?.serviceNetwork,r=t.spec?.networking?.clusterNetwork;return{name:{key:"Name",value:e.metadata?.name},openshiftVersion:{key:"OpenShift version",value:e.status?.installVersion},clusterId:{key:"Cluster ID",value:e.metadata?.uid},baseDnsDomain:{key:"Base DNS domain",value:e.spec?.baseDomain},apiVip:{key:"API IP",value:t?.spec?.apiVIP},ingressVip:{key:"Ingress IP",value:t?.spec?.ingressVIP},clusterNetworkCidr:{key:(r?.length||0)>1?"Cluster network CIDRs":"Cluster network CIDR",value:r?.map(s=>s.cidr).join(", ")},clusterNetworkHostPrefix:{key:(r?.length||0)>1?"Cluster network host prefixes":"Cluster network host prefix",value:r?.map(s=>s.hostPrefix).join(", ")},serviceNetworkCidr:{key:(o?.length||0)>1?"Service network CIDRs":"Service network CIDR",value:o?.join(", ")},installedTimestamp:{key:"Installed at",value:to(e.status?.installedTimestamp)}}},Rn=(e,t)=>{let o;return t&&v8(t.spec?.clusterRef,I8(e.metadata,["name","namespace"]))?o=t.spec?.cpuArchitecture:o=e.metadata?.annotations?.[Ky],o===_.ARM?_.ARM:_.x86};var Xs=(e,t,o)=>{let r=[],s=e.map(i=>{let{status:a}=ut(i,!0),l=i.status?.debugInfo?.stateInfo||"",p=Qy(i.status?.inventory||{});if(p.interfaces?.forEach(u=>{u.ipv4Addresses=Qy(u.ipV4Addresses),u.ipv6Addresses=Qy(u.ipV6Addresses)}),i.metadata?.labels?.[zo]){let u=i.metadata?.labels?.[zo];r.push(u);let m=t?.find(d=>d.metadata?.name===u&&d.metadata?.namespace===i.metadata?.namespace);m?.spec?.bmc?.address&&(p.bmcAddress=m.spec.bmc.address)}let c=qy(i);return{kind:"Host",id:i.metadata?.uid||"",href:"",status:a.key,statusInfo:l,role:$y(i),requestedHostname:i.spec.hostname||p.hostname,createdAt:i.metadata?.creationTimestamp,validationsInfo:JSON.stringify(i.status?.validationsInfo||{}),inventory:JSON.stringify(p),progress:c&&{currentStage:c.currentStage,installationPercentage:c.installationPercentage,progressInfo:c.progressInfo,stageStartedAt:c.stageStartTime,stageUpdatedAt:c.stageUpdateTime},progressStages:c?.progressStages,bootstrap:i.status?.bootstrap,installationDiskId:i.spec.installation_disk_id}}),n=o&&t?t?.filter(i=>i.metadata?.namespace===o.metadata?.namespace&&_n(i)===o.metadata?.name&&i.metadata?.name?!r.includes(i.metadata.name):!0).map(i=>{let a={hostname:i.metadata?.annotations?.[js]||i.metadata?.name,bmcAddress:i.spec?.bmc?.address,systemVendor:{virtual:!1,productName:"Bare Metal Host"}};return{id:i.metadata?.uid||"",href:"bmc",kind:"Host",status:"known",statusInfo:"",inventory:JSON.stringify(a),requestedHostname:i.metadata?.annotations?.[js]||i.metadata?.name,role:void 0,createdAt:i.metadata?.creationTimestamp}}):[];return[...s,...n]},Gt=({clusterDeployment:e,agentClusterInstall:t,agents:o=[],infraEnv:r})=>{let s=e.status?.installVersion,[n,i]=Wt(t);return{id:e.metadata?.uid||"",kind:"Cluster",href:"",name:e.spec?.clusterName,baseDnsDomain:e.spec?.baseDomain,openshiftVersion:s,apiVip:t?.status?.apiVIP||t?.spec?.apiVIP,ingressVip:t?.status?.ingressVIP||t?.spec?.apiVIP,highAvailabilityMode:t?.spec?.provisionRequirements?.controlPlaneAgents===1?"None":"Full",status:n,statusInfo:i,imageInfo:{sshPublicKey:t?.spec?.sshPublicKey},sshPublicKey:t?.spec?.sshPublicKey,clusterNetworkHostPrefix:t?.spec?.networking?.clusterNetwork?.[0]?.hostPrefix,clusterNetworkCidr:t?.spec?.networking?.clusterNetwork?.[0]?.cidr,serviceNetworkCidr:t?.spec?.networking?.serviceNetwork?.[0],machineNetworkCidr:t?.spec?.networking?.machineNetwork?.[0]?.cidr,monitoredOperators:[],vipDhcpAllocation:!1,userManagedNetworking:t?.spec?.provisionRequirements?.controlPlaneAgents===1,hostNetworks:Gy(o,t),totalHostCount:o?.length,hosts:Xs(o),installStartedAt:e.status?.installStartedTimestamp,installCompletedAt:e.status?.installedTimestamp,validationsInfo:JSON.stringify(t?.status?.validationsInfo||{}),cpuArchitecture:Rn(e,r)}};var NT=["SpecSynced","Connected","Validated"],x8=(e=[])=>{let t={},o=NT;return e.forEach(r=>{let s=r.status?.conditions?.filter(n=>o.includes(n.type)&&n.status==="False");s?.length&&(t[r.metadata?.name||"unknownname"]=s)}),t},eS=(e={},t)=>e.status?.conditions?.filter(o=>(!t||t?.includes(o.type))&&o.status==="False")||[];import T8 from"lodash/uniqBy";var sp=(e="")=>{let t=/.+:(.*)-/gm.exec(e);if(t&&t[1])return t[1]};var Js=e=>{let t=e.filter(r=>r.metadata?.labels?.visible!=="false").map(r=>{let s=sp(r.spec?.releaseImage);return{label:`OpenShift ${s||r.metadata?.name}`,version:s||r.metadata?.name||"",value:r.metadata?.name,default:!1,supportLevel:"production"}}).sort((r,s)=>-1*r.label.localeCompare(s.label));return t.length&&(t[0].default=!0),T8(t,r=>r.version)},tu=(e,t)=>{let o=e.find(r=>r.metadata?.name===t?.spec?.imageSetRef?.name);return o?Js([o])?.[0]?.version:t?.spec?.imageSetRef?.name},P8=e=>e?.status?.history?.[0]?.version||e?.spec?.desiredUpdate?.version,tS=(e="")=>/[0-9].[0-9][0-9]?/g.exec(e)?.[0]||"";var A8=(e=[])=>e.find(t=>t.key===st)?.values||[],w8=e=>e?.length?[{key:st,operator:"In",values:e}]:void 0;var _r=e=>e?.spec?.provisionRequirements?.controlPlaneAgents===1,oS=(e,t)=>{if(!t)return;let o=Yy(t);if(!!o)return e.find(r=>!!r.metadata?.ownerReferences?.find(n=>n.kind==="ClusterDeployment"&&n.name===o))};var ou=(e,t)=>{if(!t)return e;let o=Wh(t);return o?o/1024/1024/1024:e};import{Fragment as UT,createElement as W,useEffect as T1,useState as np}from"react";import{Button as f1,DescriptionList as WT,DescriptionListDescription as Zs,DescriptionListGroup as Qs,DescriptionListTerm as en,Grid as g1,GridItem as nS,Spinner as h1,Title as C1,TitleSizes as y1}from"@patternfly/react-core";import{CheckCircleIcon as S1,ExclamationTriangleIcon as v1,PencilAltIcon as I1}from"@patternfly/react-icons";import{global_palette_green_500 as b1}from"@patternfly/react-tokens/dist/js/global_palette_green_500";import{global_warning_color_100 as k1}from"@patternfly/react-tokens/dist/js/global_warning_color_100";import{Fragment as G8,createElement as Pt,useEffect as W8,useState as U8}from"react";import{object as z8}from"yup";import{Alert as rS,Button as VT,ButtonVariant as F8,Modal as N8,ModalBoxBody as V8,ModalBoxFooter as H8,ModalVariant as M8,Stack as HT,StackItem as jd}from"@patternfly/react-core";import{Formik as L8,useFormikContext as O8}from"formik";var D8=(e,t)=>({apiVersion:"v1",kind:"Secret",data:{username:btoa(e.username),password:btoa(e.password)},metadata:{generateName:`bmc-${e.hostname.split(".").shift()}-`,namespace:t},type:"Opaque"}),E8=(e,t,o)=>({apiVersion:"metal3.io/v1alpha1",kind:"BareMetalHost",metadata:{name:e.name,namespace:t.metadata?.namespace,labels:{[Co]:t.metadata?.name||""},annotations:{"inspect.metal3.io":"disabled",[js]:e.hostname}},spec:{bmc:{address:e.bmcAddress,credentialsName:o.metadata?.name,disableCertificateVerification:!!e.disableCertificateVerification},bootMACAddress:e.bootMACAddress,description:"",online:!!e.online,automatedCleaningMode:"disabled"}}),ru=(e,t,o)=>o(t&&e?"ai:The resource you are changing is already in use by hosts in the infrastructure environment. A change will require booting the hosts with a new discovery ISO file. Hosts will be rebooted automatically after the change is applied if using BMC.":t?"ai:The resource you are changing is already in use by hosts in the infrastructure environment. The hosts will be rebooted automatically after the change is applied.":e?"ai:The resource you are changing is already in use by hosts in the infrastructure environment. A change will require booting the hosts with a new discovery ISO file.":"ai:A change will require booting hosts with a new discovery ISO file.");var _8=e=>z8({pullSecret:ws.required(e("ai:Pull secret is a required field."))}),R8=({pullSecret:e,pullSecretError:t,pullSecretLoading:o,onClose:r,error:s,hasAgents:n,hasBMHs:i})=>{let{isSubmitting:a,isValid:l,submitForm:p,setFieldValue:c}=O8();W8(()=>{if(!o&&!t){let g=atob(e?.data?.[".dockerconfigjson"]||"");c("pullSecret",g),e||c("createSecret",!0)}},[e,o,t,c]);let{t:u}=f(),m=ru(n,i,u),d=Pt(HT,{hasGutter:!0},Pt(jd,null,Pt(rS,{isInline:!0,variant:"warning",title:m})),Pt(jd,null,Pt(As,{isOcm:!1})));return o?d=Pt(z,null):t&&(d=Pt(rS,{title:t,variant:"danger",isInline:!0})),Pt(G8,null,Pt(V8,null,Pt(HT,{hasGutter:!0},Pt(jd,null,d)),s&&Pt(jd,null,Pt(rS,{title:s,variant:"danger",isInline:!0}))),Pt(H8,null,Pt(VT,{onClick:p,isDisabled:o||!!t||a||!l},u("ai:Save")),Pt(VT,{onClick:r,variant:F8.secondary},u("ai:Cancel"))))},B8=({isOpen:e,onClose:t,onSubmit:o,infraEnv:r,...s})=>{let[n,i]=U8(),{t:a}=f();return Pt(N8,{"aria-label":a("ai:Edit pull secret dialog"),title:a("ai:Edit pull secret"),isOpen:e,onClose:t,variant:M8.small,hasNoBodyWrapper:!0,id:"edit-pull-secret-modal"},Pt(L8,{initialValues:{pullSecret:void 0,createSecret:!1},validationSchema:_8(a),onSubmit:async l=>{try{await o(l,r),t()}catch(p){i(U(p))}},validateOnMount:!0},Pt(R8,{...s,onClose:t,error:n})))},MT=B8;import{Fragment as o1,createElement as Wo,useState as t1}from"react";import{object as e1}from"yup";import{Alert as LT,Button as OT,ButtonVariant as K8,Modal as $8,ModalBoxBody as q8,ModalBoxFooter as Y8,ModalVariant as j8,Stack as X8,StackItem as sS}from"@patternfly/react-core";import{Formik as J8}from"formik";var Z8=e1({sshPublicKey:go.required("An SSH key is required to debug hosts as they register.")}),Q8=({isOpen:e,onClose:t,infraEnv:o,onSubmit:r,hasAgents:s,hasBMHs:n})=>{let[i,a]=t1(),{t:l}=f(),p=ru(s,n,l);return Wo($8,{"aria-label":l("ai:Edit SSH public key dialog"),title:l("ai:Edit SSH public key"),isOpen:e,onClose:t,variant:j8.small,hasNoBodyWrapper:!0,id:"edit-ssh-key-modal"},Wo(J8,{initialValues:{sshPublicKey:o.spec?.sshAuthorizedKey||""},validationSchema:Z8,onSubmit:async c=>{try{await r(c,o),t()}catch(u){a(u?.message||l("ai:An error occured"))}},validateOnMount:!0},({isSubmitting:c,isValid:u,submitForm:m})=>Wo(o1,null,Wo(q8,null,Wo(X8,{hasGutter:!0},Wo(sS,null,Wo(LT,{isInline:!0,variant:"warning",title:p})),Wo(sS,null,Wo(Ws,null)),i&&Wo(sS,null,Wo(LT,{title:i,variant:"danger",isInline:!0})))),Wo(Y8,null,Wo(OT,{onClick:m,isDisabled:c||!u},l("ai:Save")),Wo(OT,{onClick:t,variant:K8.secondary},l("ai:Cancel"))))))},_T=Q8;import{Fragment as d1,createElement as At,useState as m1}from"react";import{Alert as r1,Button as RT,ButtonVariant as s1,Form as n1,Modal as i1,ModalBoxBody as a1,ModalBoxFooter as l1,ModalVariant as p1,Stack as BT,StackItem as su}from"@patternfly/react-core";import{Formik as c1}from"formik";var u1=({isOpen:e,onClose:t,onSubmit:o,infraEnv:r})=>{let[s,n]=m1(),{t:i}=f();return At(i1,{"aria-label":i("ai:Edit Ntp sources dialog"),title:i("ai:Edit NTP sources"),isOpen:e,onClose:t,variant:p1.small,hasNoBodyWrapper:!0,id:"edit-ntp-sources-modal"},At(c1,{initialValues:{enableNtpSources:r.spec?.additionalNTPSources?"additional":"auto",additionalNtpSources:r.spec?.additionalNTPSources?.join(",")||""},onSubmit:async a=>{try{await o(a,r),t()}catch(l){n(U(l))}},validateOnMount:!0},({isSubmitting:a,isValid:l,values:p,submitForm:c})=>At(d1,null,At(a1,null,At(n1,null,At(BT,{hasGutter:!0},At(su,null,At(ie,{label:i("ai:Auto synchronized NTP (Network Time Protocol) sources"),value:"auto",name:"enableNtpSources"})),At(su,null,At(ie,{name:"enableNtpSources",value:"additional",description:At(BT,{hasGutter:!0},At(su,null,i("ai:Configure your own NTP sources to sychronize the time between the hosts that will be added to this infrastructure environment.")),At(su,null,At(xn,{name:"additionalNtpSources",isDisabled:p.enableNtpSources==="auto",helperText:i("ai:A comma separated list of IP or domain names of the NTP pools or servers.")}))),label:i("ai:Your own NTP (Network Time Protocol) sources")})),s&&At(su,null,At(r1,{variant:"danger",title:s}))))),At(l1,null,At(RT,{onClick:c,isDisabled:a||!l},i("ai:Save")),At(RT,{onClick:t,variant:s1.secondary},i("ai:Cancel"))))))},zT=u1;var iS=({title:e,onEdit:t,isLoading:o,isWarning:r})=>{let s=W(S1,{color:b1.value});return o?s=W(h1,{isSVG:!0,size:"md"}):r&&(s=W(v1,{color:k1.value})),W("div",null,s,"\xA0",e,"\xA0",W(f1,{variant:"plain",onClick:t},W(I1,null)))},x1=({infraEnv:e,fetchSecret:t,onEditPullSecret:o,onEditSSHKey:r,onEditNtpSources:s,hasAgents:n,hasBMHs:i})=>{let[a,l]=np(!1),[p,c]=np(!1),[u,m]=np(!1),[d,g]=np(),[C,h]=np(),[S,v]=np(!0),y=e.metadata?.namespace??"",I=e.spec?.pullSecretRef?.name??"",{t:b}=f();return T1(()=>{(async()=>{try{if(y&&I){let T=await t(y,I);g(T)}}catch(T){g(void 0),T.code!==404&&h(T.message||b("ai:Could not fetch pull secret"))}finally{v(!1)}})()},[y,I,t,a,b]),W(UT,null,W(g1,{hasGutter:!0},W(nS,{span:12},W(C1,{headingLevel:"h1",size:y1.lg},b("ai:Environment details"))),W(nS,{span:6},W(WT,null,W(Qs,null,W(en,null,b("ai:Infrastructure Environment name")),W(Zs,null,e.metadata?.name)),W(Qs,null,W(en,null,b("ai:Location")),W(Zs,null,e.metadata?.labels?.[st]??b("ai:No location"))),W(Qs,null,W(en,null,b("ai:Network type")),W(Zs,null,e.metadata?.labels?.networkType==="static"?b("ai:Static IP, bridges and bonds"):b("ai:DHCP only"))),W(Qs,null,W(en,null,b("ai:CPU architecture")),W(Zs,null,e.spec?.cpuArchitecture??_.x86)),W(Qs,null,W(en,null,b("ai:Labels")),W(Zs,null,Object.keys(e.metadata?.labels||{}).map(k=>W(Pc,{key:k,value:`${k}=${e.metadata?.labels?.[k]}`})))),e.metadata?.creationTimestamp&&W(Qs,null,W(en,null,b("ai:Created at")),W(Zs,null,new Date(e.metadata.creationTimestamp).toString())))),W(nS,{span:6},W(WT,null,e.spec?.proxy?.httpProxy&&W(Qs,null,W(en,null,b("ai:HTTP Proxy URL")),W(Zs,null,e.spec.proxy.httpProxy)),e.spec?.proxy?.httpsProxy&&W(Qs,null,W(en,null,b("ai:HTTPS Proxy URL")),W(Zs,null,e.spec.proxy.httpsProxy)),e.spec?.proxy?.noProxy&&W(Qs,null,W(en,null,b("ai:No proxy domains")),W(Zs,null,e.spec.proxy.noProxy)),W(Qs,null,W(en,null,b("ai:Secret and keys")),W(Zs,null,W(UT,null,W(iS,{title:b("ai:Pull secret"),onEdit:()=>l(!0),isLoading:S,isWarning:!d}),W(iS,{title:b("ai:SSH public key"),onEdit:()=>c(!0),isWarning:!e.spec?.sshAuthorizedKey}),W(iS,{title:b("ai:NTP sources"),onEdit:()=>m(!0)}))))))),W(MT,{isOpen:a,onClose:()=>l(!1),pullSecret:d,pullSecretError:C,pullSecretLoading:S,onSubmit:o,infraEnv:e,hasAgents:n,hasBMHs:i}),W(_T,{isOpen:p,onClose:()=>c(!1),infraEnv:e,onSubmit:r,hasAgents:n,hasBMHs:i}),W(zT,{isOpen:u,onClose:()=>m(!1),infraEnv:e,onSubmit:s}))},GT=x1;import{Fragment as Aj,createElement as no,useCallback as Tj,useMemo as Pj,useRef as xj,useState as vu}from"react";import{Button as yj,DropdownItem as Sj,Stack as vj,StackItem as EA}from"@patternfly/react-core";import Ij from"lodash/noop";import{createElement as mu,useMemo as aP,useState as lP}from"react";import{sortable as uu,expandable as s$,breakWord as n$}from"@patternfly/react-table";import{Link as sP}from"react-router-dom";import{Button as qT,Popover as N1,Stack as V1,StackItem as Xd}from"@patternfly/react-core";import{Fragment as M1,createElement as fr}from"react";import"@patternfly/react-styles/css/utilities/Text/text.css";import KT from"react";var nu=()=>{let{t:e}=f();return KT.createElement(KT.Fragment,null,e("ai:NTP sources can be edited in Host's Infrastructure environment. After updating the NTP sources, make sure to restart the host."))};import{Alert as P1}from"@patternfly/react-core";import{createElement as w1}from"react";var A1=()=>{let{t:e}=f();return w1(P1,{variant:"info",isInline:!0,title:e("ai:Validations are running. If they take more than 2 minutes, please attend to the alert below.")})},Ea=A1;import{Alert as D1}from"@patternfly/react-core";import{createElement as F1}from"react";var E1=({agent:e})=>{let{t}=f();return F1(D1,{variant:"danger",isInline:!0,title:t("ai:Host specification sync error")},e.status?.conditions?.find(o=>o.type==="SpecSynced")?.message)},$T=E1;var H1=({agent:e,onApprove:t,onEditHostname:o,zIndex:r,wizardStepId:s,isDay2:n})=>{let[i]=Xs([e]),a=o?()=>o(e):void 0,l=!e.spec.approved,p=Ot(i,e.status?.inventory||{}),{t:c}=f(),u=s?qs(e,s,c):ut(e,!1),m=n&&Object.values(u.validationsInfo).some(d=>d.some(g=>["pending","error","failure"].includes(g.status)));return fr(Ls,{host:i,onEditHostname:a,zIndex:r,AdditionalNTPSourcesDialogToggleComponent:nu,autoCSR:!0,additionalPopoverContent:u.status===Tt.specSyncErr?fr(Xd,null,fr($T,{agent:e})):m?fr(Xd,null,fr(Ea,null)):void 0,...u},l&&t&&fr(N1,{"aria-label":c("ai:Approve host popover"),minWidth:"30rem",maxWidth:"50rem",headerContent:fr("div",null,c("ai:Approve host to join infrastructure environment")),bodyContent:fr(V1,{hasGutter:!0},fr(Xd,null,c("ai:Make sure that you expect and recognize the host before approving.")),fr(Xd,null,p&&fr(M1,null,c("ai:Hostname: {{hostname}}",{hostname:p})))),footerContent:fr(qT,{variant:"link",onClick:()=>t(e),isInline:!0},c("ai:Approve host"))},fr(qT,{variant:"link",isInline:!0,className:"pf-u-font-size-xs"},c("ai:Approve host"))))},Fa=H1;import{breakWord as K1,expandable as $1,sortable as Br}from"@patternfly/react-table";import{Fragment as tP,createElement as Ko}from"react";import{Address4 as YT,Address6 as jT}from"ip-address";import Rr from"react";import{Button as L1,ButtonVariant as O1,Popover as _1}from"@patternfly/react-core";import{CheckCircleIcon as R1,ExclamationCircleIcon as B1,PendingIcon as z1}from"@patternfly/react-icons";import{global_danger_color_100 as W1,global_success_color_100 as G1}from"@patternfly/react-tokens";var aS=({validation:e,actions:t,children:o})=>{let{t:r}=f(),s=fl(r)[e.id];return Rr.createElement(_1,{headerContent:Rr.createElement("div",null,da(r)[e.id]),bodyContent:Rr.createElement("div",null,To(e.message),e.status==="failure"&&s&&` ${s}`),footerContent:t,zIndex:300},Rr.createElement(L1,{variant:O1.link,isInline:!0},o))},U1=({validation:e,failureActions:t,pendingActions:o,children:r,showFailure:s=!0,showPending:n=!1,showSuccess:i=!1})=>{if(e){if(s&&e.status==="failure")return Rr.createElement(aS,{validation:e,actions:t},Rr.createElement(B1,{color:W1.value})," ",r);if(n&&e.status==="pending")return Rr.createElement(aS,{validation:e,actions:o},Rr.createElement(z1,null)," ",r);if(i&&e.status==="success")return Rr.createElement(aS,{validation:e},Rr.createElement(R1,{color:G1.value})," ",r)}return Rr.createElement(Rr.Fragment,null,r)},ip=U1;var Jd=(e,t)=>e.find(o=>(o.ipv4Addresses||[]).reduce((n,i)=>(YT.isValid(i)&&n.push(new YT(i)),n),[]).find(n=>n.isInSubnet(t))?!0:(o.ipv6Addresses||[]).reduce((n,i)=>(jT.isValid(i)&&n.push(new jT(i)),n),[]).find(n=>n.isInSubnet(t))),wt=(e,t,o,r)=>({header:{title:e("ai:Hostname"),props:{id:"col-header-hostname"},transforms:[Br],cellFormatters:[$1],cellTransforms:[K1]},cell:s=>{let n=we(s),i=t?()=>t(s):void 0,a=Ot(s,n);return{title:Ko(vi,{host:s,inventory:n,onEditHostname:i,hosts:o,readonly:r?!r():!1}),props:{"data-testid":"host-name"},sortableValue:a||""}}}),Ut=(e,t,o,r,s)=>({header:{title:e("ai:Role"),props:{id:"col-header-role"},transforms:[Br]},cell:n=>{let i=o?p=>o(n,p):void 0,a=t?.(n),l=jm(n,e,r);return{title:Ko(zc,{host:n,readonly:!a,role:l,onEditRole:i,position:s}),props:{"data-testid":"host-role"},sortableValue:l}}}),XT=(e,t,o,r)=>({header:{title:e("ai:Status"),props:{id:"col-header-status"},transforms:[Br]},cell:s=>{let n=G(s.validationsInfo)||{},i=o?()=>o(s):void 0,a=BC(n)&&["known","known-unbound"].includes(s.status)?"Some validations failed":void 0;return{title:Ko(Ls,{host:s,status:{...Vn[s.status],sublabel:a},onEditHostname:i,validationsInfo:n,AdditionalNTPSourcesDialogToggleComponent:t,UpdateDay2ApiVipDialogToggleComponent:r}),props:{"data-testid":"host-status"},sortableValue:s.status}}}),Di={header:{title:"Discovered on",props:{id:"col-header-discoveredat"},transforms:[Br]},cell:e=>{let{createdAt:t}=e,o=Ll(t);return{title:o.title,props:{"data-testid":"host-discovered-time"},sortableValue:o.sortableValue}}},JT=e=>({header:{title:e("ai:CPU Architecture"),props:{id:"col-header-cpuarchitecture"},transforms:[Br]},cell:t=>{let o=we(t);return{title:o.cpu?.architecture,props:{"data-testid":"host-cpu-architecture"},sortableValue:o.cpu?.architecture}}}),Go={header:{title:"CPU Cores",props:{id:"col-header-cpucores"},transforms:[Br]},cell:e=>{let t=we(e),{cores:o}=Hn(t),s=(G(e.validationsInfo)||{})?.hardware?.find(n=>n.id==="has-cpu-cores-for-role");return{title:Ko(ip,{validation:s},o.title),props:{"data-testid":"host-cpu-cores"},sortableValue:o.sortableValue}}},Uo={header:{title:"Memory",props:{id:"col-header-memory"},transforms:[Br]},cell:e=>{let t=we(e),{memory:o}=Hn(t),s=(G(e.validationsInfo)||{})?.hardware?.find(n=>n.id==="has-memory-for-role");return{title:Ko(ip,{validation:s},o.title),props:{"data-testid":"host-memory"},sortableValue:o.sortableValue}}},yo={header:{title:"Total storage",props:{id:"col-header-disk"},transforms:[Br]},cell:e=>{let t=we(e),{disk:o}=Hn(t),s=(G(e.validationsInfo)||{})?.hardware?.find(n=>n.id==="has-min-valid-disks");return{title:Ko(ip,{validation:s},o.title),props:{"data-testid":"host-disks"},sortableValue:o.sortableValue}}},Ei=e=>({header:{title:Ko(Bl,{cluster:e,inParenthesis:!0})}}),iu=e=>({header:{title:"Active NIC",transforms:[Br]},cell:t=>{let r=we(t).interfaces||[],s=Pn(e),n=s?as(s):null,i=n?Jd(r,n):null;return{title:i?.name||be,props:{"data-testid":"nic-name"},sortableValue:i?.name||be}}}),ZT=e=>({header:{title:"IPv4 address",transforms:[Br]},cell:t=>{let r=we(t).interfaces||[],s=Pn(e),n=s?as(s):null,i=n?Jd(r,n):null;return{title:(i?.ipv4Addresses||[]).join(", ")||be,props:{"data-testid":"nic-ipv4"},sortableValue:(i?.ipv4Addresses||[]).join(", ")||be}}}),QT=e=>({header:{title:"IPv6 address",transforms:[Br]},cell:t=>{let r=we(t).interfaces||[],s=Pn(e),n=s?as(s):null,i=n?Jd(r,n):null;return{title:(i?.ipv6Addresses||[]).join(", ")||be,props:{"data-testid":"nic-ipv6"},sortableValue:(i?.ipv6Addresses||[]).join(", ")||be}}}),eP=e=>({header:{title:"MAC address",transforms:[Br]},cell:t=>{let r=we(t).interfaces||[],s=Pn(e),n=s?as(s):null,i=n?Jd(r,n):null;return{title:i?.macAddress||be,props:{"data-testid":"nic-mac-address"},sortableValue:i?.macAddress||be}}}),Zd=({title:e,description:t,disabled:o})=>Ko(tP,null,e,o&&Ko(tP,null,Ko("br",null),t)),Qd=({onInstallHost:e,canInstallHost:t,onEditHost:o,canEditHost:r,onHostEnable:s,canEnable:n,onHostDisable:i,canDisable:a,onHostReset:l,canReset:p,onViewHostEvents:c,onDownloadHostLogs:u,canDownloadHostLogs:m,onDeleteHost:d,canDelete:g,onEditBMH:C,canEditBMH:h,canUnbindHost:S,onUnbindHost:v})=>y=>{let I=[];if(y){let b=we(y),k=Ot(y,b);if(e&&t?.(y)&&I.push({title:"Install host",id:`button-install-host-${k}`,onClick:()=>e(y)}),o&&r){let T=r(y);if(typeof T=="boolean")T&&I.push({title:"Change hostname",id:`button-edit-host-${k}`,onClick:()=>o(y)});else{let[w,F]=T;I.push({title:Ko(Zd,{disabled:!w,description:F,title:"Change hostname"}),id:`button-edit-host-${k}`,onClick:()=>o(y),isDisabled:!w})}}if(s&&n?.(y)&&I.push({title:"Enable in cluster",id:`button-enable-in-cluster-${k}`,onClick:()=>s(y)}),i&&a?.(y)&&I.push({title:"Disable in cluster",id:`button-disable-in-cluster-${k}`,onClick:()=>i(y)}),l&&p?.(y)&&I.push({title:"Reset host",id:`button-reset-host-${k}`,onClick:()=>l(y)}),c&&I.push({title:"View host events",id:`button-view-host-events-${k}`,onClick:()=>c(y)}),u&&m?.(y)&&I.push({title:"Download host logs",id:`button-download-host-installation-logs-${k}`,onClick:()=>u(y)}),d&&g){let T=g(y);if(typeof T=="boolean")T&&I.push({title:"Delete host",id:`button-delete-host-${k}`,onClick:()=>d(y)});else{let[w,F]=T;I.push({title:Ko(Zd,{disabled:!w,description:F,title:"Delete host"}),id:`button-delete-host-${k}`,onClick:()=>d(y),isDisabled:!w})}}if(C&&y.href==="bmc"&&h){let[T,w]=h(y);I.push({title:Ko(Zd,{disabled:!T,description:w,title:"Edit BMC"}),id:`button-edit-bmh-host-${k}`,onClick:()=>C(y),isDisabled:!T})}if(v&&S){let[T,w]=S(y);I.push({title:Ko(Zd,{disabled:!T,description:w,title:"Remove from the cluster"}),id:`button-unbind-host-${k}`,onClick:()=>v(y),isDisabled:!T})}}return I};import q1 from"lodash/mapKeys";import Y1 from"lodash/camelCase";import j1 from"lodash/uniq";var oP=(e="open-cluster-management")=>`/api/v1/namespaces/${e}/services/https:assisted-service:8090/proxy`;var X1=e=>{let[t]=Wt(e);return e?.status?.validationsInfo&&(["insufficient","pending-for-input"].includes(t)||t==="ready"&&e.spec?.holdInstallation)},lS=e=>{let[t]=Wt(e);return["installed","adding-hosts"].includes(t)},pS=e=>{let[t]=Wt(e);return["preparing-for-installation","installing","installing-pending-user-action","finalizing","installed","error","cancelled","adding-hosts"].includes(t)},cS=e=>{let[t]=Wt(e);return!e?.spec?.holdInstallation&&["insufficient","ready"].includes(t)?!0:["preparing-for-installation","installing","finalizing","installing-pending-user-action"].includes(t)},uS=e=>{let[t]=Wt(e);return["ready","error","preparing-for-installation","installing","finalizing","installed","adding-hosts","cancelled","installing-pending-user-action"].includes(t)},J1=e=>{let[t]=Wt(e);return["error","cancelled"].includes(t)},rP=e=>e.map(t=>q1(t,(o,r)=>Y1(r))),Z1=(e,t)=>{if(t?.status?.debugInfo?.eventsURL){let o=new URL(t.status?.debugInfo?.eventsURL);return`${oP(e)}${o.pathname}${o.search}`}return null},Q1=(e,t,o)=>async(r,s,n)=>{let i=Z1(t,o);if(!i){n("Cannot determine events URL");return}try{let a=await e(i),l=rP(a);s(l)}catch(a){n(U(a))}},Na=e=>!e?.spec?.platform?.agentBareMetal?.agentSelector?.matchLabels?.[Uy],au=(e,t)=>_n(t)===e?.metadata?.name&&t?.metadata?.namespace===e?.metadata?.namespace,lu=(e,t,o)=>e.spec?.clusterDeploymentName?.name===t&&e.spec?.clusterDeploymentName?.namespace===o,pu=(e=[],t=[])=>{let o=e.map(r=>r.spec?.hostname||r.status?.inventory?.hostname);return t.forEach(r=>{let s=r.metadata?.annotations?.[js];s&&o.push(s)}),j1(o.filter(Boolean))},cu=e=>e?{span:12}:{span:12,lg:10,xl:9,xl2:7};import{Button as e$,Popover as t$}from"@patternfly/react-core";import{Fragment as r$,createElement as mS}from"react";var o$=({bmhStatus:e})=>e.errorMessage?mS(t$,{headerContent:"Error",bodyContent:e.errorMessage,minWidth:"30rem",maxWidth:"50rem",hideOnOutsideClick:!0,zIndex:300},mS(e$,{variant:"link",isInline:!0},e.state.title)):mS(r$,null,e.state.title),ef=o$;import tf from"lodash/noop";var of=(e,t,o,r,s,n)=>({header:{title:"Hostname",props:{id:"col-header-hostname"},transforms:[uu],cellFormatters:[s$],cellTransforms:[n$]},cell:i=>{let a=we(i),l=r?()=>r(i):void 0,p=Ot(i,a),c=!0;return t.find(m=>m.metadata?.uid===i.id)?c=s?!s(i):!1:o.find(d=>d.metadata?.uid===i.id)&&n&&(c=!n(i)),{title:mu(vi,{host:i,inventory:a,onEditHostname:l,hosts:e,readonly:c}),props:{"data-testid":"host-name"},sortableValue:p||""}}}),rf=(e,t,o)=>({header:{title:o("ai:Discovery type"),props:{id:"col-header-discovery-type"},transforms:[uu]},cell:r=>{let s=e.find(i=>i.metadata?.uid===r.id),n=o("ai:Unknown");return s?n=s?.metadata?.labels?.hasOwnProperty(zo)?"BMC":"Discovery ISO":t.find(a=>a.metadata?.uid===r.id)&&(n="BMC"),{title:n,props:{"data-testid":"discovery-type"},sortableValue:n}}}),gr=({agents:e,bareMetalHosts:t,onEditHostname:o,onApprove:r,wizardStepId:s,t:n,isDay2:i})=>({header:{title:"Status",props:{id:"col-header-infraenvstatus"},transforms:[uu]},cell:a=>{let l=e.find(m=>m.metadata?.uid===a.id),p=t?.find(m=>m.metadata?.uid===a.id),c,u="--";return l?u=mu(Fa,{agent:l,onApprove:r,onEditHostname:o?()=>o(l):void 0,wizardStepId:s,isDay2:i}):p&&(c=Ys(p),u=mu(ef,{bmhStatus:c})),{title:u,props:{"data-testid":"host-status"},sortableValue:l?s?qs(l,s,n).status.title:ut(l).status.title:c?.state.title||""}}}),nP=(e,t,o,r)=>({header:{title:r("ai:Cluster"),props:{id:"col-header-cluster"},transforms:[uu]},cell:s=>{let n=e.find(a=>a.metadata?.uid===s.id),i;if(n?.spec?.clusterDeploymentName)if(n.metadata?.annotations?.agentMachineRefNamespace){let p=t.find(c=>c.status?.agentRef?.name===n.metadata?.name&&c.status?.agentRef?.namespace===n.metadata?.namespace)?.metadata?.annotations?.["hypershift.openshift.io/nodePool"];if(p){let c=p.split("/")[0],u=n.spec.clusterDeploymentName.name;i=o({name:u,namespace:c})}}else i=o(n.spec.clusterDeploymentName);return{title:i?mu(sP,{to:i},n?.spec?.clusterDeploymentName?.name):"--",props:{"data-testid":"cluster"},sortableValue:n?.spec?.clusterDeploymentName?.name??"--"}}}),ap=(e,t)=>({header:{title:t("ai:Infrastructure env"),props:{id:"col-header-infraenv"},transforms:[uu]},cell:o=>{let r=e.find(i=>i.metadata?.uid===o.id),s=_n(r);return{title:s?mu(sP,{to:`/multicloud/infrastructure/environments/details/${r.metadata?.namespace}/${s}/overview`},s):"N/A",props:{"data-testid":"infra-env"},sortableValue:s}}}),sf=(e,t)=>{let o=[$s.deprovisioning.key,$s.pending.key,$s.registering.key].includes(Ys(e).state.key);return[o,o?void 0:t("ai:Bare metal host cannot be edited. Remove this host and add it again if a change is needed.")]},nf=(e,t)=>{let o=ut(e).status.category!=="Installation related";return[o,o?void 0:t("ai:Hostname cannot be edited while host is either installed or being installed.")]},af=(e,t,o)=>r=>{let s=e.find(i=>i.metadata?.uid===r.id);if(s)return nf(s,o);let n=t.find(i=>i.metadata?.uid===r.id);return n?sf(n,o):[!0,void 0]},i$=(e,t,o)=>{if(!t?.spec.clusterDeploymentName?.name)return[!1,o("ai:The agent is not bound to a cluster.")];let{status:r}=ut(t);if(["preparing-for-installation","installing","installing-in-progress","installing-pending-user-action","resetting-pending-user-action"].includes(r.key))return[!1,o("ai:It is not possible to remove a host which is being installed.")];if(["installed","error","cancelled"].includes(r.key)&&(t.status?.role==="master"||t.status?.role==="bootstrap"))return[!1,o("ai:It is not possible to remove control plane node from an installed cluster.")];if(e){let s=oS(e,t);if(s&&cS(s))return[!1,o("ai:It is not possible to remove a node from a cluster during installation.")]}return[!0,void 0]},a$=(e,t)=>{let o=ut(e).status.category!=="Installation related";return[o,o?void 0:t("ai:Host cannot be deleted while host is either installed or being installed.")]},$o=({agents:e,bmhs:t,infraEnv:o,agentClusterInstalls:r},s)=>{let{onEditHost:n,onDeleteHost:i,onEditRole:a,onSelect:l,onEditBMH:p,onUnbindHost:c,onSetInstallationDiskId:u}=s||{},{t:m}=f(),[d,g]=aP(()=>[Xs(e,t,o),{onEditHost:n?h=>{let S=e.find(y=>y.metadata?.uid===h.id);if(S)return n(S);let v=t?.find(y=>y.metadata?.uid===h.id);return v&&p?p(v):tf}:void 0,canEditHost:h=>{let S=e.find(v=>v.metadata?.uid===h.id);return S?nf(S,m):!1},onDeleteHost:i?h=>{let S=e.find(y=>y.metadata?.uid===h.id),v=t?.find(y=>y.metadata?.uid===h.id);return i(S,v)}:void 0,canDelete:h=>{let S=e.find(y=>y.metadata?.uid===h.id),v=t?.find(y=>y.metadata?.uid===h.id);return S?a$(S,m):v?[!0,void 0]:[!1,m("ai:Host not found")]},onEditRole:a?(h,S)=>{let v=e.find(y=>y.metadata?.uid===h.id);return v?a(v,S):Promise.resolve(v)}:void 0,canEditRole:()=>!!a,onDiskRole:u?(h,S)=>{let v=e.find(y=>y.metadata?.uid===h);return v&&S?u(v,S):Promise.resolve(v)}:void 0,canEditDisks:()=>!!u,onSelect:l?(h,S)=>{let v=e.find(y=>y.metadata?.uid===h.id);return v?l(v,S):tf}:void 0,onEditBMH:p?h=>{let S=t?.find(v=>v.metadata?.uid===h.id);return S?p(S):tf}:void 0,canEditBMH:h=>{let S=t?.find(v=>v.metadata?.uid===h.id);return S?sf(S,m):[!1,m("ai:Bare metal host not found")]},onUnbindHost:c?h=>{let S=e.find(v=>v.metadata?.uid===h.id);return S?c(S):tf}:void 0,canUnbindHost:h=>{let S=e.find(y=>y.metadata?.uid===h.id);return S?i$(r,S,m):t?.find(y=>y.metadata?.uid===h.id)?[!1,m("ai:Bare metal host cannot be removed from cluster.")]:[!1,m("ai:Host not found")]}}],[e,t,o,n,i,a,u,l,p,c,m,r]),C=aP(()=>Qd(g),[g]);return[d,g,C]},l$=(e,t,o,r)=>{if(!r?.length)return e;let s=Object.keys(Tt).filter(n=>r.includes(Tt[n].title));return e.filter(n=>{let i=t.find(l=>l.metadata?.uid===n.id);if(!i){let l=o.find(c=>c.metadata?.uid===n.id);if(!l)return!1;let p=Ys(l);return s.includes(p.state.key)}let{status:a}=ut(i);return s.includes(a.key)})},p$=(e,t,o,r,s)=>{let n=RC(e,r);return l$(n,t,o,s)},iP=({agents:e,bmhs:t,hosts:o})=>{let[r,s]=lP(),[n,i]=lP([]),a=Object.keys(Tt).reduce((p,c)=>(p[Tt[c].title]=0,p),{});o.forEach(p=>{let c=e.find(m=>m.metadata?.uid===p.id),u=t.find(m=>m.metadata?.uid===p.id);if(c){let{status:m}=ut(c);a[m.title]++}else if(u){let{state:m}=Ys(u);a[m.title]++}});let l=p$(o,e,t,r,n);return{statusCount:a,hostnameFilter:r,setHostnameFilter:s,statusFilter:n,setStatusFilter:i,filteredHosts:l}};import{createElement as mf,useMemo as Vq}from"react";import{ConnectedIcon as Eq}from"@patternfly/react-icons";import ye from"react";import{Checkbox as pP,Pagination as c$,PaginationVariant as u$}from"@patternfly/react-core";import{Table as m$,TableHeader as d$,TableBody as f$,SortByDirection as g$,RowWrapper as h$,InnerScrollContainer as C$}from"@patternfly/react-table";import y$ from"lodash/xor";import S$ from"classnames";var v$=({rowData:e})=>e?.key,cP=ye.memo(({rows:e,cells:t,onCollapse:o,className:r,sortBy:s,onSort:n,rowWrapper:i,testId:a,actionResolver:l})=>{let p=ye.useCallback(u=>l?.(u.obj),[l]),c={canCollapseAll:!1};return ye.createElement(C$,null,ye.createElement(m$,{rows:e,cells:t,onCollapse:o,"aria-label":"Hosts table",className:S$(r,"hosts-table"),sortBy:s,onSort:n,rowWrapper:i,"data-testid":a,actionResolver:l?p:void 0,...c},ye.createElement(d$,null),ye.createElement(f$,{rowKey:v$})))});cP.displayName="tableMemo";var I$=(e,t)=>e&&t?2:e||t?1:0,b$=e=>ye.createElement(h$,{...e,"data-testid":`host-row-${Number(e.rowProps?.rowIndex)}`}),dS=ye.createContext({selectedIDs:[],allIDs:[]}),k$=({onSelect:e,id:t})=>{let{selectedIDs:o}=ye.useContext(dS),r=o?.includes(t);return ye.createElement(pP,{id:`select-${t}`,onChange:()=>e(!r),isChecked:r})},x$=({onSelect:e})=>{let{allIDs:t,selectedIDs:o}=ye.useContext(dS),r=y$(t,o).length===0;return t.length?ye.createElement(pP,{id:"select-all",onChange:()=>e(!r),isChecked:r}):ye.createElement("div",null)},T$=({data:e,testId:t="hosts-table",className:o,content:r,ExpandComponent:s,getDataId:n,actionResolver:i,onSelect:a,children:l,selectedIDs:p,setSelectedIDs:c,perPage:u,page:m,onSetPage:d,onPerPageSelect:g,showPagination:C,perPageOptions:h,canSelectAll:S})=>{let v=ye.useMemo(()=>e.map(n),[e,n]);ye.useEffect(()=>{if(p&&c){let x=[];p.forEach(P=>{e.find(B=>n(B)===P)||x.push(P)}),x.length&&c(p.filter(P=>!x.includes(P)))}},[e,c,p,n]);let[y,I]=ye.useState({}),[b,k]=ye.useState({index:I$(!!a,!!s),direction:g$.asc}),T=ye.useRef(e);T.current!==e&&(T.current=e);let w=ye.useCallback(x=>{c?.(x?T.current.map(n):[])},[c,n]),[F,O]=ye.useMemo(()=>{let x=r;a&&(x=[{header:{title:S?ye.createElement(x$,{onSelect:w}):"",cellFormatters:[],props:{style:{width:"30px"}}},cell:A=>{let B=n(A),Oe=`select-${B}`;return{title:ye.createElement(k$,{id:B,onSelect:It=>a(A,It)}),props:{"data-testid":Oe}}}},...r]);let P=x.map(A=>A.header);return[x,P]},[r,a,n,w,S]),V=ye.useMemo(()=>{let x=(e||[]).map(P=>{let A=n(P),B=F.filter(It=>!!It.cell).map(It=>It.cell?.(P));return{isOpen:!!y[A],cells:B,key:`${A}-master`,obj:P,id:A}}).sort(Ml(b,(P,A=1)=>s?P.cells?.[A-1]:P.cells?.[A])).slice((m-1)*u,m*u);return s&&(x=x.reduce((P,A,B)=>(P.push(A),s&&P.push({fullWidth:!0,cells:[{title:A.isOpen?ye.createElement(s,{obj:A.obj}):void 0}],key:`${A.id||""}-detail`,parent:B*2}),P),[])),x},[F,s,n,e,y,b,m,u]),Y=ye.useMemo(()=>V.length?V:dd(l,O.length),[V,O,l]),he=ye.useCallback((x,P)=>{let A=V[P].id;A&&I(Object.assign({},y,{[A]:!y[A]}))},[V,y]),Z=ye.useCallback((x,P,A)=>{I({}),k({index:P,direction:A})},[]);return ye.createElement(ye.Fragment,null,ye.createElement(dS.Provider,{value:{selectedIDs:p,allIDs:v}},ye.createElement(cP,{rows:Y,cells:O,onCollapse:s?he:void 0,className:o,sortBy:b,onSort:Z,rowWrapper:b$,"data-testid":t,actionResolver:i})),C&&ye.createElement(c$,{variant:u$.bottom,itemCount:v.length,perPage:u,onPerPageSelect:g,page:m,onSetPage:d,perPageOptions:h}))},lf=T$;import ke from"react";import{Grid as vq,GridItem as vP}from"@patternfly/react-core";import{Table as Iq,TableHeader as bq,TableBody as kq,TableVariant as xq,RowWrapper as Tq}from"@patternfly/react-table";import uP from"react";var P$=(e,t)=>{switch(t){case"failure":return e("ai:Unreachable");case"success":return e("ai:Synced");default:return e("ai:Not available")}},A$=({validationsInfo:e,AdditionalNTPSourcesDialogToggleComponent:t})=>{let o=e.network?.find(n=>n.id==="ntp-synced"),r=[];t&&r.push(uP.createElement(t,{key:"add-ntp-sources"}));let{t:s}=f();return uP.createElement(ip,{validation:o,failureActions:r,pendingActions:r,showSuccess:!0,showPending:!0},P$(s,o?.status))},mP=A$;import cf from"react";import{Grid as Cq,GridItem as yq}from"@patternfly/react-core";import qo from"react";import{TextContent as X$,Text as J$,TextVariants as Z$,Popover as Q$}from"@patternfly/react-core";import{Table as eq,TableHeader as tq,TableBody as oq,TableVariant as rq,RowWrapper as sq}from"@patternfly/react-table";import Fi from"react";import{Dropdown as w$,DropdownItem as D$,DropdownToggle as E$}from"@patternfly/react-core";import{CaretDownIcon as F$}from"@patternfly/react-icons";var dP=(e,t,o)=>e.id===t?lc(o).install:lc(o).none,N$=({host:e,disk:t,installationDiskId:o,isEditable:r,onDiskRole:s})=>{let{t:n}=f(),i=dP(t,o,n);return r&&t.id!==o&&s?Fi.createElement(V$,{host:e,disk:t,installationDiskId:o,onDiskRole:s}):Fi.createElement(Fi.Fragment,null,i)},V$=({host:e,disk:t,installationDiskId:o,onDiskRole:r})=>{let[s,n]=Ms(!1),[i,a]=Ms(!1),{t:l}=f(),p=[Fi.createElement(D$,{key:"install",id:"install",isDisabled:!t.installationEligibility?.eligible,description:!t.installationEligibility?.eligible&&l("ai:Disk is not eligible for installation")},lc(l).install)],c=Fi.useCallback(d=>{(async()=>{d?.currentTarget.id&&(a(!0),await r(e.id,t.id,d.currentTarget.id),a(!1)),n(!1)})()},[n,a,r,e.id,t.id]),u=dP(t,o,l),m=Fi.useMemo(()=>Fi.createElement(E$,{onToggle:d=>n(d),toggleIndicator:F$,isDisabled:i,className:"pf-c-button pf-m-link pf-m-inline"},u),[n,u,i]);return Fi.createElement(w$,{onSelect:c,dropdownItems:p,toggle:m,isOpen:s,isPlain:!0})},fP=N$;import Bn from"react";import{Alert as H$,AlertVariant as M$,Button as L$,ButtonVariant as O$,List as _$,ListItem as R$,Popover as B$}from"@patternfly/react-core";var z$=({disk:e})=>{if(!e.installationEligibility?.eligible){let t=e.installationEligibility?.notEligibleReasons?.length||0;return Bn.createElement(B$,{headerContent:Bn.createElement("div",null,"Disk limitations"),bodyContent:Bn.createElement(W$,{...e.installationEligibility}),minWidth:"30rem",maxWidth:"50rem"},Bn.createElement(L$,{variant:O$.link,isInline:!0},t))}return null},gP=z$,W$=({eligible:e,notEligibleReasons:t})=>{let o=[],{t:r}=f();return e||o.push(Bn.createElement(H$,{key:"install-eligibility",variant:M$.warning,title:r("ai:Disk is not eligible for installation"),isInline:!0},t&&Bn.createElement(_$,null,t.map(s=>Bn.createElement(R$,{key:s},s))))),Bn.createElement(Bn.Fragment,null,o)};import{ExclamationTriangleIcon as nq}from"@patternfly/react-icons";import{global_warning_color_100 as iq}from"@patternfly/react-tokens/dist/js/global_warning_color_100";import hP from"react";import{Checkbox as G$,Tooltip as U$}from"@patternfly/react-core";var pf=(e,t)=>e===t,du=(e,t)=>Er(e.skipFormattingDisks?e.skipFormattingDisks:"").split(",").filter(o=>o===t).length>0,CP=(e,t)=>Er(e.disksToBeFormatted?e.disksToBeFormatted:"").split(",").filter(o=>o===t).length>0,K$=(e,t,o)=>pf(t,o)?du(e,t):!1,$$=(e,t,o)=>(pf(t,o)||CP(e,t))&&!du(e,t),q$=(e,t,o)=>pf(t,o)?!K$(e,t,o):!CP(e,t),Y$=(e,t,o,r)=>{r&&r(e,t,o)},j$=({host:e,diskId:t,installationDiskId:o,index:r,updateDiskSkipFormatting:s})=>hP.createElement(U$,{hidden:!pf(t,o),content:"Installation disks are always being formatted"},hP.createElement(G$,{id:`select-formatted-${e.id}-${r}`,isChecked:$$(e,t,o),isDisabled:q$(e,t,o),onChange:n=>Y$(n,e.id,t,s)})),yP=j$;var aq=[{title:"Name"},{title:"Role"},{title:"Limitations"},{title:"Format?"},{title:"Drive type"},{title:"Size"},{title:"Serial"},{title:"Model"},{title:"WWN"}],lq=({rowData:e})=>e?.key,pq=e=>qo.createElement(sq,{...e,"data-testid":`disk-row-${e.row?.key||""}`}),cq=()=>qo.createElement(X$,null,qo.createElement(J$,{component:Z$.p},"This bootable disk will skip formatting")),uq=({canEditDisks:e,host:t,disks:o,installationDiskId:r,testId:s,onDiskRole:n,updateDiskSkipFormatting:i})=>{let a=!!e?.(t),l=[...o].sort((p,c)=>p.name?.localeCompare(c.name||"")||0).map((p,c)=>({cells:[{title:qo.createElement(qo.Fragment,null,du(t,p.id)&&qo.createElement(Q$,{bodyContent:qo.createElement(cq,null),minWidth:"20rem",maxWidth:"30rem"},qo.createElement(nq,{color:iq.value,size:"sm"}))," ",p.bootable?`${p.name||""} (bootable)`:p.name),props:{"data-testid":"disk-name"}},{title:qo.createElement(fP,{host:t,disk:p,installationDiskId:r,isEditable:a,onDiskRole:n}),props:{"data-testid":"disk-role"}},{title:qo.createElement(gP,{disk:p}),props:{"data-testid":"disk-limitations"}},{title:qo.createElement(yP,{host:t,diskId:p.id,installationDiskId:r,index:c,updateDiskSkipFormatting:i}),props:{"data-testid":"disk-formatted"}},{title:p.driveType,props:{"data-testid":"drive-type"}},{title:_t(p.sizeBytes||0,2,"si"),props:{"data-testid":"disk-size"}},{title:p.serial,props:{"data-testid":"disk-serial"}},{title:p.model,props:{"data-testid":"disk-model"}},{title:p.wwn,props:{"data-testid":"disk-wwn"}}],key:p.path}));return qo.createElement(eq,{"data-testid":s,rows:l,cells:aq,variant:rq.compact,"aria-label":"Host's disks table",borders:!1,rowWrapper:pq},qo.createElement(tq,null),qo.createElement(oq,{rowKey:lq}))},SP=uq;import fS from"react";import{TextContent as mq,Text as dq,TextVariants as fq,GridItem as gq}from"@patternfly/react-core";var hq=({title:e,testId:t})=>fS.createElement(gq,null,fS.createElement(mq,null,fS.createElement(dq,{"data-testid":t,component:fq.h3},e))),fu=hq;var Sq=({host:e,canEditDisks:t,onDiskRole:o,updateDiskSkipFormatting:r})=>{let n=we(e).disks||[];return cf.createElement(Cq,{hasGutter:!0},cf.createElement(fu,{testId:"disks-section",title:`${n.length} Disk${n.length===1?"":"s"}`}),cf.createElement(yq,null,cf.createElement(SP,{testId:"disks-table",canEditDisks:t,host:e,disks:n,installationDiskId:e.installationDiskId,onDiskRole:o,updateDiskSkipFormatting:r})))},uf=Sq;var gS=({children:e})=>ke.createElement(vP,{span:4},ke.createElement(bt,null,e)),Pq=[{title:"Name"},{title:"MAC address"},{title:"IPv4 address"},{title:"IPv6 address"},{title:"Speed"}],Aq=({rowData:e})=>e?.name?.title,wq=e=>ke.createElement(Tq,{...e,"data-testid":`nic-row:${e.row?.key}`}),Dq=({interfaces:e,testId:t})=>{let o=e.sort((s,n)=>s.name?.localeCompare(n.name||"")||0).map(s=>({cells:[{title:s.name,props:{"data-testid":"nic-name"}},{title:s.macAddress,props:{"data-testid":"nic-mac"}},{title:(s.ipv4Addresses||[]).join(", "),props:{"data-testid":"nic-ipv4"}},{title:(s.ipv6Addresses||[]).join(", "),props:{"data-testid":"nic-ipv6"}},{title:s.speedMbps&&s.speedMbps>0?`${s.speedMbps} Mbps`:"N/A",props:{"data-testid":"nic-speed"}}],key:s.name})),{t:r}=f();return ke.createElement(Iq,{"data-testid":t,rows:o,cells:Pq,variant:xq.compact,"aria-label":r("ai:Host's network interfaces table"),borders:!1,rowWrapper:wq},ke.createElement(bq,null),ke.createElement(kq,{rowKey:Aq}))},zr=({host:e,canEditDisks:t,onDiskRole:o,AdditionalNTPSourcesDialogToggleComponent:r,hideNTPStatus:s=!1,updateDiskSkipFormatting:n})=>{let{t:i}=f(),{id:a,validationsInfo:l}=e,p=we(e),c=ke.useMemo(()=>G(l)||{},[l]),u=Hn(p),m=p.interfaces||[],d=p.bmcAddress;p.bmcV6address&&(d=d?`${d}, ${p.bmcV6address}`:p.bmcV6address),d=d||be;let g=_C(p,i),C=ke.useMemo(()=>ke.createElement(mP,{AdditionalNTPSourcesDialogToggleComponent:r,validationsInfo:c}),[r,c]);return ke.createElement(vq,{hasGutter:!0},ke.createElement(fu,{testId:"host-details-section",title:"Host details"}),ke.createElement(gS,null,ke.createElement(N,{testId:"uuid",title:"UUID",value:a}),ke.createElement(N,{testId:"manufacturer",title:i("ai:Manufacturer"),value:p.systemVendor?.manufacturer||be}),ke.createElement(N,{testId:"product",title:i("ai:Product"),value:p.systemVendor?.productName||be}),ke.createElement(N,{testId:"serial-number",title:"Serial number",value:u.serialNumber})),ke.createElement(gS,null,ke.createElement(N,{testId:"memory-capacity",title:i("ai:Memory capacity"),value:u.memory.title}),ke.createElement(N,{testId:"cpu-model",title:i("ai:CPU model name"),value:p.cpu?.modelName||be}),ke.createElement(N,{testId:"cpu-cores-and-clock",title:i("ai:CPU cores and clock speed"),value:u.cpuSpeed}),ke.createElement(N,{testId:"cpu-arch",title:i("ai:CPU architecture"),value:p.cpu?.architecture||be})),ke.createElement(gS,null,ke.createElement(N,{testId:"hw-type",title:"Hardware type",value:g}),ke.createElement(N,{testId:"bmc-address",title:"BMC address",value:d}),ke.createElement(N,{testId:"boot-mode",title:i("ai:Boot mode"),value:p.boot?.currentBootMode||be}),p.boot?.pxeInterface&&ke.createElement(N,{testId:"pxe-interface",title:i("ai:PXE interface"),value:p.boot?.pxeInterface}),ke.createElement(N,{isHidden:s,testId:"ntp-status",title:i("ai:NTP status"),value:C})),ke.createElement(uf,{host:e,onDiskRole:o,canEditDisks:t,updateDiskSkipFormatting:n}),ke.createElement(fu,{testId:"nics-section",title:`${m.length} NIC${m.length===1?"":"s"}`}),ke.createElement(vP,null,ke.createElement(Dq,{interfaces:m,testId:"nics-table"})))};var Fq=e=>e.id,lp=({setDiscoveryHintModalOpen:e,isSNO:t=!1})=>{let{t:o}=f();return mf(ot,{icon:Eq,title:o("ai:Waiting for host...",{count:+t}),content:o("ai:Hosts may take a few minutes to appear here after booting."),secondaryActions:e&&[mf(Zc,{key:"hosts-not-showing",isSNO:t,setDiscoveryHintModalOpen:e})]})},tn=({obj:e})=>mf(zr,{key:e.id,host:e}),Nq=({hosts:e,skipDisabled:t,...o})=>{let r=Vq(()=>(e||[]).filter(s=>!t||s.status!=="disabled"),[e,t]);return mf(lf,{getDataId:Fq,data:r,...o})},Xe=Nq;import{createElement as Mq}from"react";var Hq=({agent:e,onSave:t,...o})=>{let[r]=e?Xs([e]):[];return Mq(Wl,{host:r,inventory:e?.status?.inventory,...o,onSave:async({hostname:s})=>e&&t(e,s)})},pp=Hq;import{createElement as Vi,useState as Zq}from"react";import{EmptyState as Uq,EmptyStateBody as Kq,EmptyStateIcon as $q,Modal as qq,ModalVariant as Yq,Spinner as jq}from"@patternfly/react-core";import{Fragment as xP,createElement as cp}from"react";import Ni from"react";import{Alert as Lq,AlertVariant as Oq,TextContent as _q,TextList as Rq,TextListItem as IP,TextListItemVariants as bP,TextListVariants as Bq}from"@patternfly/react-core";var kP=({title:e,conditions:t})=>t.length?Ni.createElement(Lq,{title:e,variant:Oq.danger,isInline:!0,className:"cim-resource-alerts cim-resource-alerts--noul"},Ni.createElement(_q,null,Ni.createElement(Rq,{component:Bq.ul},t.map(o=>{let[r,...s]=o.message.split(/:|\.,/);return Ni.createElement(Ni.Fragment,{key:r},Ni.createElement(IP,{component:bP.li},Ni.createElement("strong",null,r)),s.map(n=>Ni.createElement(IP,{key:n,component:bP.li},n)))})))):null;import{Alert as zq,AlertVariant as Wq,ModalBoxBody as Gq}from"@patternfly/react-core";var Va=({infraEnv:e,docVersion:t,children:o,inModal:r})=>{let s=eS(e,void 0),{t:n}=f();if(e.status&&!s.length)return cp(xP,null,o);let i=cp(xP,null,!e.status&&cp(zq,{title:n("ai:Central infrastructure management is not running"),variant:Wq.warning,isInline:!0,className:"cim-resource-alerts",actionLinks:cp("a",{href:Qc(t),target:"_blank",rel:"noopener noreferrer"},n("ai:Open documentation"))},n("ai:It seems the Central infrastructure management is not configured which will prevent its features to be used. Please refer to the documentation for the first time setup steps.")),cp(kP,{title:n("ai:Failing infrastructure environment"),conditions:s}));return r?cp(Gq,null,i):i};var Xq=({isOpen:e,onClose:t,infraEnv:o,agentClusterInstall:r,onSaveISOParams:s,docVersion:n})=>{let i=o.metadata?.labels?.networkType!=="static",a=o.spec?.sshAuthorizedKey||r?.spec?.sshPublicKey,{httpProxy:l,httpsProxy:p,noProxy:c}=o.spec?.proxy||{},m=!!a||!!l||!!p||!!c?"iso-download":"iso-config",[d,g]=Zq(m),{t:C}=f(),h=async(S,v)=>{try{await s(S),g("iso-download")}catch(y){v.setStatus({error:{title:C("ai:Failed to download the discovery Image"),message:y}})}};return Vi(qq,{"aria-label":C("ai:Add host dialog"),title:C("ai:Add host"),isOpen:e,onClose:t,variant:Yq.small,hasNoBodyWrapper:!0,id:"add-host-modal"},Vi(Va,{infraEnv:o,docVersion:n,inModal:!0},d==="iso-config"&&Vi(Jc,{onCancel:t,handleSubmit:h,hideDiscoveryImageType:!0,imageType:"full-iso",sshPublicKey:a,httpProxy:l,httpsProxy:p,noProxy:c,hasDHCP:i}),d==="iso-download"&&Vi(Jq,{onClose:t,infraEnv:o,onReset:()=>g("iso-config"),hasDHCP:i})))},Jq=({infraEnv:e,onClose:t,onReset:o,hasDHCP:r})=>{let{t:s}=f();return e.status?.isoDownloadURL?Vi(Ai,{onClose:t,downloadUrl:e.status.isoDownloadURL,onReset:o,hasDHCP:r}):Vi(Uq,null,Vi($q,{icon:jq}),Vi(Kq,null,s("ai:Generating discovery ISO")))},df=Xq;import{createElement as yS,useEffect as E2,useState as wP}from"react";import{Modal as A2,ModalVariant as w2}from"@patternfly/react-core";import{Fragment as CS,createElement as pe,useMemo as P2,useState as T2}from"react";import{dump as x2,load as b2}from"js-yaml";import{Alert as Qq,AlertActionCloseButton as e2,AlertVariant as t2,Button as hS,ButtonVariant as o2,Form as r2,FormGroup as s2,Grid as n2,GridItem as up,ModalBoxBody as i2,ModalBoxFooter as a2,Text as TP,TextInputTypes as l2,TextVariants as PP}from"@patternfly/react-core";import{Formik as p2,FieldArray as c2,useField as u2,useFormikContext as m2}from"formik";import{array as k2,object as AP,string as dp}from"yup";import{Language as d2}from"@patternfly/react-code-editor";import{MinusCircleIcon as f2,PlusCircleIcon as g2}from"@patternfly/react-icons";var h2=()=>{let[e,{touched:t,error:o}]=u2({name:"macMapping"}),{errors:r}=m2(),s=E("macMapping","input"),n=!(t&&o),{t:i}=f();return pe(s2,{fieldId:s,label:i("ai:MAC to interface name mapping"),validated:n?"default":"error"},pe(c2,{name:"macMapping",render:({push:a,remove:l})=>pe(n2,{hasGutter:!0},pe(up,{span:5},pe(TP,{component:PP.small},"MAC address")),pe(up,{span:5},pe(TP,{component:PP.small},"NIC")),e.value.map((p,c)=>{let u=`macMapping[${c}].macAddress`,m=`macMapping[${c}].name`;return pe(CS,{key:c},pe(up,{span:5},pe(J,{name:u,inputError:r[u]?.[0]})),pe(up,{span:5},pe(J,{name:m,inputError:r[m]?.[0]})),c!==0&&pe(up,{span:2},pe(f2,{onClick:()=>l(c)})))}),pe(up,{span:6},pe(hS,{icon:pe(g2,null),onClick:()=>a({macAddress:"",name:""}),variant:"link",isInline:!0},i("ai:Add more"))))}))},C2=(e,t)=>{let o=b2(e.nmState);return{apiVersion:"agent-install.openshift.io/v1beta1",kind:"NMStateConfig",metadata:{generateName:`${t.metadata?.name}-`,namespace:t.metadata?.namespace,labels:{[zo]:e.name,[Co]:t?.metadata?.name||""}},spec:{config:o,interfaces:e.macMapping.filter(s=>s.macAddress.length&&s.name.length)}}},y2=(e,t,o)=>AP({name:dp().required(o("ai:Required field")),hostname:Es(o,e,t),bmcAddress:nd(o).required(o("ai:Required field")),username:dp().required(o("ai:Required field")),password:dp().required(o("ai:Required field")),bootMACAddress:Ds,nmState:dp(),macMapping:k2().of(AP().shape({macAddress:Ds.when(["name"],{is:r=>!!r,then:Ds.required(o("ai:MAC has to be specified"))}),name:dp().when(["macAddress"],{is:r=>!!r,then:dp().required(o("ai:Name has to be specified"))})},[["name","macAddress"]]))}),S2={name:"",hostname:"",bmcAddress:"",username:"",password:"",bootMACAddress:"",disableCertificateVerification:!0,online:!1,nmState:"",macMapping:[{macAddress:"",name:""}]},v2=(e,t,o,r)=>r?{name:e?.metadata?.name||"",hostname:e?.metadata?.annotations?.[js]||"",bmcAddress:e?.spec?.bmc?.address||"",username:o?.data?.username?atob(o.data.username):"",password:o?.data?.password?atob(o.data.password):"",bootMACAddress:e?.spec?.bootMACAddress||"",disableCertificateVerification:!!e?.spec?.bmc?.disableCertificateVerification,online:!!e?.spec?.online,nmState:t?x2(t?.spec?.config):"",macMapping:t?.spec?.interfaces||[{macAddress:"",name:""}]}:S2,I2=({onCreateBMH:e,onClose:t,hasDHCP:o,infraEnv:r,bmh:s,nmState:n,secret:i,isEdit:a,usedHostnames:l})=>{let[p,c]=T2(),u=async C=>{try{c(void 0);let h=C.nmState?C2(C,r):void 0;await e(C,h),t()}catch(h){c(U(h))}},{t:m}=f(),{initValues:d,validationSchema:g}=P2(()=>{let C=v2(s,n,i,a),h=y2(l,C.hostname,m);return{initValues:C,validationSchema:h}},[l,s,n,i,a,m]);return pe(p2,{initialValues:d,isInitialValid:!1,validate:mo(g),onSubmit:u},({isSubmitting:C,isValid:h,submitForm:S})=>pe(CS,null,pe(i2,null,pe(r2,{id:"add-bmc-form"},pe(J,{label:m("ai:Name"),name:"name",placeholder:m("ai:Enter the name for the Host"),isRequired:!0,isDisabled:a}),pe(fo,{label:m("ai:Hostname"),name:"hostname",placeholder:m("ai:Enter the hostname for the Host"),richValidationMessages:Mr(m),isRequired:!0}),pe(J,{label:m("ai:Baseboard Management Controller Address"),name:"bmcAddress",placeholder:m("ai:Enter an address"),isRequired:!0}),pe(J,{label:m("ai:Boot NIC MAC Address"),name:"bootMACAddress",placeholder:m("ai:Enter an address"),description:m("ai:The MAC address of the host's network connected NIC that wll be used to provision the host.")}),pe(J,{label:m("ai:Username"),name:"username",placeholder:m("ai:Enter a username for the BMC"),isRequired:!0}),pe(J,{type:l2.password,label:m("ai:Password"),name:"password",placeholder:m("ai:Enter a password for the BMC"),isRequired:!0}),!o&&pe(CS,null,pe(Ca,{label:m("ai:NMState"),name:"nmState",language:d2.yaml,description:m("ai:Upload a YAML file in NMstate format that includes your network configuration (static IPs, bonds, etc.).")}),pe(h2,null))),p&&pe(Qq,{title:m("ai:Failed to add host"),variant:t2.danger,isInline:!0,actionClose:pe(e2,{onClose:()=>c(void 0)})},p)),pe(a2,null,pe(hS,{onClick:S,isDisabled:C||!h},m(a?"ai:Submit":"ai:Create")),pe(hS,{onClick:t,variant:o2.secondary},"Cancel"))))},mp=I2;var D2=({isOpen:e,onClose:t,onEdit:o,infraEnv:r,bmh:s,nmStates:n,fetchSecret:i,usedHostnames:a})=>{let[l,p]=wP(),[c,u]=wP(!0),m=r.metadata?.labels?.networkType!=="static",d=s?.metadata?.name,g=s?.metadata?.namespace,C=s?.spec?.bmc?.credentialsName,h=n.find(v=>v.metadata?.labels?.[zo]===d),{t:S}=f();return E2(()=>{p(void 0);let v=async()=>{if(C&&g)try{let y=await i(g,C);p(y)}catch(y){console.error(S("ai:Could not get secret"),y)}u(!1)};g&&d&&(u(!0),v())},[d,g,i,C,m,S]),yS(A2,{"aria-label":S("ai:Edit BMH dialog"),title:S("ai:Edit BMH"),isOpen:e,onClose:t,variant:w2.small,hasNoBodyWrapper:!0,id:"edit-bmh-modal"},c?yS(z,null):yS(mp,{isEdit:!0,onCreateBMH:o({bmh:s,secret:l,nmState:h}),onClose:t,hasDHCP:m,infraEnv:r,bmh:s,secret:l,nmState:h,usedHostnames:a}))},ff=D2;import ht from"react";import{array as If,lazy as wY,number as EY,object as DY}from"yup";import{Modal as hY,ModalBoxBody as CY,ModalBoxFooter as yY,Button as YP,ButtonVariant as SY,Alert as vY,AlertVariant as IY,AlertActionCloseButton as bY,Stack as kY,StackItem as jP}from"@patternfly/react-core";import{Formik as xY}from"formik";import yr from"react";import{useFormikContext as uY}from"formik";import{Flex as mY,FlexItem as $P,Form as dY,FormGroup as fY}from"@patternfly/react-core";import q2 from"lodash/isMatch";import{useFormikContext as Y2}from"formik";import Cr from"react";import j2 from"react-measure";import{Alert as X2,AlertVariant as J2,Grid as Z2,GridItem as IS}from"@patternfly/react-core";import us from"react";import F2 from"lodash/countBy";import{Trans as DP}from"react-i18next";var N2=()=>{let{t:e}=f();return us.createElement(H,{position:"right",bodyContent:us.createElement(us.Fragment,null,e("ai:Select one or multiple locations to choose the hosts from."),us.createElement("br",null),us.createElement(DP,{t:e,components:{bold:us.createElement("strong",null)},i18nKey:"ai:Keep the field empty to match <bold>any</bold> location."}),us.createElement("br",null),us.createElement(DP,{t:e,components:{bold:us.createElement("strong",null)},i18nKey:"ai:Set <bold>{{agent_location_label_key}}</bold> label in Agent resource to specify it's location.",values:{agent_location_label_key:st}}))})},V2=(e,t)=>e===0?t("ai:(no hosts available)"):e===1?t("ai:(1 host available)"):t("ai:({{size}} hosts available)",{size:e}),H2=({agents:e})=>{let t=F2(e,({metadata:s})=>s?.labels?.[st]||wi),{t:o}=f(),r=Object.keys(t).map(s=>({isLastOptionBeforeFooter:n=>n===t.length,id:s,value:s,displayName:`${s===wi?o("ai:No location"):s} ${V2(t[s],o)}`}));return us.createElement(la,{idPostfix:"locations",name:"locations",label:o("ai:Host locations"),labelIcon:us.createElement(N2,null),placeholderText:o("ai:Type or select location(s)"),helperText:o("ai:Select one or more locations to view hosts"),options:r})},fp=H2;import hr from"react";import M2 from"lodash/flatten";import{Dropdown as L2,DropdownItem as EP,DropdownToggle as O2,Label as FP,LabelGroup as _2,Split as R2,SplitItem as NP}from"@patternfly/react-core";import{useField as B2}from"formik";var VP=[Co,st],HP=(e,t)=>Array.from(new Set(M2(e.map(o=>Object.keys(o.metadata?.labels||{}).filter(r=>!t?.includes(r)).map(r=>`${r}=${o.metadata?.labels?.[r]||""}`))))).map(o=>({id:o,value:o,displayName:o})),z2=({agents:e,labelKeysFilter:t,name:o="agentLabels",label:r})=>{let{t:s}=f(),n=HP(e,t);return hr.createElement(la,{idPostfix:"agentLabels",name:o,label:r||s("ai:Labels matching hosts"),placeholderText:"app=frontend",helperText:s("ai:Provide as many labels as you can to narrow the list to relevant hosts only."),options:n})},MP=z2,LP=({agents:e,labelKeysFilter:t,name:o="agentLabels",label:r})=>{let{t:s}=f(),[n,i]=hr.useState(!1),[a,,{setValue:l}]=B2(o),c=HP(e,t).filter(d=>!(a.value||[]).map(({key:g,value:C})=>`${g}=${C}`).includes(d.value)),u=c.length?c.map(d=>hr.createElement(EP,{key:d.id,id:d.id,onClick:()=>{let g=d.value.split("=",2);l([...a.value,{key:g[0],value:g[1]}])}},d.displayName)):[hr.createElement(EP,{key:"no-option",isDisabled:!0},s("ai:No label available"))],m=r||s("ai:Filter hosts by existing labels");return hr.createElement(R2,{hasGutter:!0,className:"pf-c-label-group pf-m-category ai-split-filter-hosts"},hr.createElement(NP,null,a.value.length?hr.createElement(_2,{categoryName:m,className:"ai-group-label-selector"},a.value.map(({key:d,value:g})=>hr.createElement(FP,{key:d,onClose:()=>l(a.value.filter(C=>C.key!==d)),isTruncated:!0},`${d}=${g}`))):hr.createElement("span",{className:"pf-c-label-group__label"},m)),hr.createElement(NP,null,hr.createElement(L2,{onSelect:()=>i(!1),toggle:hr.createElement(O2,{toggleIndicator:null,onToggle:i,style:{padding:0}},hr.createElement(FP,{color:"blue",variant:"outline",className:"pf-m-overflow"},s("ai:Add label"))),isOpen:n,isPlain:!0,dropdownItems:u,menuAppendTo:()=>document.body})))};import zn from"react";import{useField as K2}from"formik";import{useMemo as G2,useState as OP}from"react";var W2=[{title:"10",value:10},{title:"20",value:20}],Be=e=>{let[t,o]=OP(10),[r,s]=OP(1),{onSetPage:n,onPerPageSelect:i}=G2(()=>({onSetPage:(l,p)=>s(p),onPerPageSelect:(l,p)=>o(p)}),[]);return{showPagination:e>10,perPage:t,page:r,onSetPage:n,onPerPageSelect:i,perPageOptions:W2}};import{useField as U2}from"formik";import{useCallback as _P,useRef as hf}from"react";var gf=e=>{let[{value:t},,{setValue:o,setTouched:r}]=U2(e),s=hf(t);s.current=t;let n=hf(o);n.current=o;let i=hf(r);i.current=r;let a=_P((c,u)=>{n.current(c,u)},[]),l=_P((c,u)=>i.current(c,u),[]),p=hf(t);return p.current=t,{setValue:a,setTouched:l,valueRef:p}};import SS from"react";var RP=SS.createContext(void 0),Hi=({canEditDisks:e,onDiskRole:t,updateDiskSkipFormatting:o,children:r})=>{let s={canEditDisks:e,onDiskRole:t,updateDiskSkipFormatting:o};return SS.createElement(RP.Provider,{value:s},r)},gp=()=>{let e=SS.useContext(RP);if(e===void 0)throw new Error("useHostTableDetailContext must be used within a HostsTableDetailContextProvider");return e};function vS({obj:e}){let{onDiskRole:t,canEditDisks:o}=gp();return zn.createElement(zr,{key:e.id,host:e,onDiskRole:t,canEditDisks:o})}var $2=({matchingAgents:e,onEditRole:t,width:o,onEditHost:r,onHostSelect:s,onSetInstallationDiskId:n})=>{let{t:i}=f(),[{value:a}]=K2("selectedHostIds"),l=zn.useRef(a);l.current=a;let{setValue:p,setTouched:c}=gf("selectedHostIds"),u=zn.useCallback(y=>{p(y,!0),c(!0,!1)},[p,c]);zn.useEffect(()=>{let y=e.map(b=>b.metadata?.uid),I=a.filter(b=>y.includes(b));I.length!==a.length&&u(I)},[e,u,a]);let m=zn.useCallback((y,I)=>{let b=I?[...l.current,y.metadata?.uid||""]:l.current.filter(k=>k!==y.metadata?.uid);u(b),s?.()},[u,s]),[d,g,C]=$o({agents:e},{onSelect:m,onEditRole:t,onEditHost:r,onSetInstallationDiskId:n}),h=o&&o>700,S=zn.useMemo(()=>[of(d,e,[],g.onEditHost,g.canEditHostname),...h?[ap(e,i)]:[],gr({agents:e,wizardStepId:"hosts-selection",t:i}),Ut(i,g.canEditRole,g.onEditRole,void 0,void 0),...h?[Go,Uo,yo]:[]],[e,g.canEditRole,g.onEditRole,h,d,g.onEditHost,g.canEditHostname,i]),v=Be(d.length);return zn.createElement(Hi,{canEditDisks:g.canEditDisks,onDiskRole:g.onDiskRole},zn.createElement(Xe,{hosts:d,content:S,selectedIDs:a,actionResolver:C,ExpandComponent:g.onDiskRole?vS:tn,...g,...v},zn.createElement(ot,{title:i("ai:No hosts found"),content:i("ai:No host matches provided labels/locations")})))},BP=$2;var Q2=({availableAgents:e,onEditRole:t,onSetInstallationDiskId:o,onEditHost:r,onHostSelect:s,cpuArchitecture:n})=>{let{t:i}=f(),{values:a}=Y2(),{locations:l,agentLabels:p}=a,c=Cr.useMemo(()=>e.filter(u=>{let m=p.reduce((C,h)=>{let S=h.split("=");return C[S[0]]=S[1],C},{}),d=l.length?l.includes(u.metadata?.labels?.[st]||wi):!0,g=u.metadata?.labels?q2(u.metadata?.labels,m):!0;return d&&g}),[e,l,p]);return Cr.createElement(Cr.Fragment,null,Cr.createElement(Z2,{hasGutter:!0},Cr.createElement(IS,null,Cr.createElement(fp,{agents:e})),Cr.createElement(IS,null,Cr.createElement(MP,{agents:c,name:"agentLabels",labelKeysFilter:VP})),n&&Cr.createElement(X2,{variant:J2.info,title:i("ai:Displaying only hosts with {{cpuArchitecture}} architecture in the table.",{cpuArchitecture:n}),isInline:!0}),Cr.createElement(IS,null,Cr.createElement(j2,{bounds:!0},({measureRef:u,contentRect:m})=>Cr.createElement("div",{ref:u},Cr.createElement(BP,{matchingAgents:c,onEditRole:t,onSetInstallationDiskId:o,width:m.bounds?.width,onEditHost:r,onHostSelect:s}))))))},Cf=Q2;import Wn from"react";import{Grid as pY,GridItem as UP}from"@patternfly/react-core";import gu from"react";import{Alert as zP,AlertGroup as oY,AlertVariant as WP}from"@patternfly/react-core";import eY from"react";var bS=(e,t)=>{let o=e.reduce((r,s)=>(r.cpus+=s.status?.inventory.cpu?.count||0,r.memory+=s.status?.inventory.memory?.usableBytes||0,r),{cpus:0,memory:0});return t("ai:{{cpus}} CPUs | {{memory}} Memory",{cpus:o.cpus,memory:_t(o.memory,2,"iec")})},tY=({selectedAgents:e})=>{let{t}=f();return eY.createElement("div",null,t("ai:Total compute"),": ",bS(e,t))},kS=tY;var rY=(e,t)=>{switch(e){case 0:return t("ai:No host is selected.")}return t("ai:Only {{hostsSelected}} host is selected.",{count:e,hostsSelected:e})},sY=({matchingAgentsCount:e,selectedAgents:t,targetHostCount:o})=>{let r=t.length,{t:s}=f();return gu.createElement(oY,null,r===o&&gu.createElement(zP,{variant:WP.success,title:s("ai:{{selectedAgentsCount}} host selected out of {{matchingAgentsCount}} matching.",{count:r,selectedAgentsCount:r,matchingAgentsCount:e}),isInline:!0},gu.createElement(kS,{selectedAgents:t})),r<o&&gu.createElement(zP,{variant:WP.warning,title:rY(r,s),isInline:!0},gu.createElement(kS,{selectedAgents:t})))},yf=sY;import nY from"react";var iY=()=>{let{t:e}=f();return nY.createElement(H,{position:"right",bodyContent:e("ai:Total count of hosts to be included in the cluster.")})},Sf=iY;import GP from"react";import{useFormikContext as aY}from"formik";import lY from"lodash/isEqual";var vf=e=>{let{setFieldValue:t,values:o}=aY(),{hostCount:r,locations:s,autoSelectedHostIds:n}=o,[i,a]=GP.useMemo(()=>{let l=e.filter(c=>{let u=c.metadata?.labels?.[st]||wi;return s.length?s.includes(u):!0}),p=l.filter(c=>n.includes(c.metadata?.uid||""));return[l,p]},[e,s,n]);return GP.useEffect(()=>{let l=i.map(p=>p.metadata?.uid).splice(0,r);lY(l,n)||setTimeout(()=>t("autoSelectedHostIds",l,!0))},[i,t,n,r]),{matchingAgents:i,selectedAgents:a,hostCount:r}};var cY=({availableAgents:e})=>{let{matchingAgents:t,selectedAgents:o,hostCount:r}=vf(e),{t:s}=f();return Wn.createElement(Wn.Fragment,null,Wn.createElement(pY,{hasGutter:!0},Wn.createElement(UP,{span:12,lg:10,xl:9,xl2:7},Wn.createElement(ns,{label:s("ai:Number of hosts"),labelIcon:Wn.createElement(Sf,null),idPostfix:"hostcount",name:"hostCount",minValue:1,maxValue:t.length,isRequired:!0})),Wn.createElement(UP,{span:12,lg:10,xl:9,xl2:7},Wn.createElement(fp,{agents:e}))),Wn.createElement(yf,{matchingAgentsCount:t.length,selectedAgents:o,targetHostCount:r}))},KP=cY;var gY=({agents:e,onEditHost:t})=>{let{values:o}=uY(),{autoSelectHosts:r}=o,s=yr.useMemo(()=>ps(e).filter(i=>!(i.spec?.clusterDeploymentName?.name||i.spec?.clusterDeploymentName?.namespace)&&i.status?.inventory.cpu?.architecture===o.cpuArchitecture),[e,o.cpuArchitecture]),{t:n}=f();return yr.createElement(dY,null,yr.createElement(Fr,{name:"autoSelectHosts",label:n("ai:Auto-select hosts")}),yr.createElement(fY,{fieldId:"cpuArchitecture",label:n("ai:CPU architecture")},yr.createElement(mY,{justifyContent:{default:"justifyContentFlexStart"}},yr.createElement($P,null,yr.createElement(ie,{name:"cpuArchitecture",id:"x86_64",value:"x86_64",label:n("ai:x86_64")})),yr.createElement($P,null,yr.createElement(ie,{name:"cpuArchitecture",id:"arm64",value:"arm64",label:yr.createElement(yr.Fragment,null,n("ai:arm64"),"\xA0")})))),r&&yr.createElement(KP,{availableAgents:s}),!r&&yr.createElement(Cf,{availableAgents:s,onEditHost:t}))},qP=gY;var TY=(e,t)=>t.filter(o=>e.includes(o.metadata?.uid||"")&&!(o.spec?.clusterDeploymentName?.name||o.spec?.clusterDeploymentName?.namespace)),PY=e=>wY(t=>DY().shape({hostCount:EY().min(1).max(e),autoSelectedHostIds:t.autoSelectHosts?If().min(1).max(e):If(),selectedHostIds:t.autoSelectHosts?If():If().min(1).max(e)})),AY=({isOpen:e,onClose:t,addHostsToCluster:o,clusterDeployment:r,agents:s,onChangeHostname:n})=>{let[i,a]=ht.useState(),[l,p]=ht.useState(),{t:c}=f(),u=()=>{let C=eu(r?.metadata?.annotations);return{autoSelectHosts:C.autoSelect,hostCount:1,agentLabels:C.labels,locations:C.locations,cpuArchitecture:Rn(r),selectedHostIds:[],autoSelectedHostIds:[]}},m=ht.useMemo(()=>PY(s.length),[s.length]),d=async C=>{let{autoSelectHosts:h,autoSelectedHostIds:S,selectedHostIds:v}=C;try{p(void 0);let y=TY(h?S:v,s);await o(y),t()}catch(y){p(U(y))}},g=s.filter(C=>C.spec.clusterDeploymentName?.name===r.metadata?.name&&C.spec.clusterDeploymentName?.namespace===r.metadata?.namespace);return ht.createElement(ht.Fragment,null,ht.createElement(hY,{"aria-label":c("ai:Add worker host dialog"),title:c("ai:Add worker hosts"),isOpen:e,onClose:t,hasNoBodyWrapper:!0,id:"scale-up-modal"},ht.createElement(xY,{initialValues:u(),validationSchema:m,onSubmit:d,validateOnMount:!0},({isSubmitting:C,isValid:h,submitForm:S})=>ht.createElement(ht.Fragment,null,ht.createElement(CY,null,ht.createElement(kY,{hasGutter:!0},ht.createElement(jP,null,ht.createElement(qP,{agents:s,onEditHost:a})),l&&ht.createElement(jP,null,ht.createElement(vY,{title:c("ai:Failed to add hosts to the cluster"),variant:IY.danger,actionClose:ht.createElement(bY,{onClose:()=>p(void 0)}),isInline:!0},l)))),ht.createElement(yY,null,ht.createElement(YP,{onClick:S,isDisabled:C||!h},c("ai:Submit")),ht.createElement(YP,{onClick:t,variant:SY.secondary},c("ai:Cancel")))))),i&&ht.createElement(pp,{agent:i,isOpen:!0,onClose:()=>a(void 0),onSave:n,usedHostnames:pu(g)}))},XP=AY;import{Fragment as BY,createElement as so,useMemo as zY,useState as eA}from"react";import{Alert as FY,Button as JP,ButtonVariant as NY,Modal as VY,ModalBoxBody as HY,ModalBoxFooter as MY,Stack as LY,StackItem as xS}from"@patternfly/react-core";import{sortable as ZP}from"@patternfly/react-table";var QP=({agent:e,children:t})=>so("div",{className:e?.spec.approved?"pf-u-color-200":void 0},t),OY=(e,t)=>({header:{title:t("ai:Hostname"),props:{id:"col-header-hostname"},transforms:[ZP]},cell:o=>{let r=e.find(n=>n.metadata?.uid===o.id),s=r?.spec.hostname||r?.status?.inventory.hostname;return{title:so(QP,{agent:r},s),props:{"data-testid":"hostname"},sortableValue:s}}}),_Y=(e,t)=>({header:{title:t("ai:Status"),props:{id:"col-header-status"},transforms:[ZP]},cell:o=>{let r=e.find(i=>i.metadata?.uid===o.id),s=r?.spec.approved?t("ai:Already approved"):Tt.discovered.title,n=Tt.discovered.icon;return{title:so(QP,{agent:r},r?.spec.approved?s:so(BY,null,n," ",s)),props:{"data-testid":"status"},sortableValue:s}}}),RY=({agents:e,onApprove:t,isOpen:o,onClose:r})=>{let[s,n]=eA(null),[i,a]=eA(),{t:l}=f(),p=async()=>{a(void 0);let d=0;try{for(let g of e)g.spec.approved||(n(100*(d+1)/e.length),await t(g)),d++;n(null),r()}catch(g){a({title:l("ai:An error occured while approving agents"),message:U(g)}),n(null)}},{content:c,hosts:u}=zY(()=>({content:[OY(e,l),_Y(e,l)],hosts:Xs(e)}),[e,l]),m=Be(u.length);return so(VY,{"aria-label":l("ai:Approve hosts dialog"),title:l("ai:Approve hosts to join infrastructure environment"),isOpen:o,onClose:r,hasNoBodyWrapper:!0,id:"mass-approve-modal",variant:"medium"},so(HY,null,so(LY,{hasGutter:!0},so(xS,null,so(FY,{isInline:!0,variant:"info",title:l("ai:You are approving multiple hosts. All hosts listed below will be approved to join the infrastructure environment if you continue. Make sure that you expect and recognize the hosts before approving.")})),so(xS,null,so(Xe,{hosts:u,content:c,...m},so("div",null,l("ai:No hosts selected")))),so(xS,null,so(En,{error:i,progress:s})))),so(MY,null,so(JP,{onClick:p,isDisabled:s!==null},l("ai:Approve all hosts")),so(JP,{onClick:r,variant:NY.secondary,isDisabled:s!==null},l("ai:Cancel"))))},hp=RY;import{createElement as So,useMemo as ZY}from"react";import{Button as WY,Flex as GY,FlexItem as tA,Popover as UY}from"@patternfly/react-core";import{InfoCircleIcon as KY}from"@patternfly/react-icons";import{Link as $Y}from"react-router-dom";import{sortable as oA}from"@patternfly/react-table";import{global_palette_blue_300 as qY}from"@patternfly/react-tokens/dist/js/global_palette_blue_300";var YY=(e,t)=>({header:{title:t("ai:Hostname"),props:{id:"col-header-hostname"},transforms:[oA]},cell:o=>{let r=we(o),s=Ot(o,r),n=e.find(i=>i.metadata?.uid===o.id)?.spec?.clusterDeploymentName?.name;return{title:So("div",{className:n?"pf-u-color-200":void 0},s),props:{"data-testid":"hostname"},sortableValue:s}}}),jY=(e,t,o)=>({header:{title:o("ai:Status"),props:{id:"col-header-status"},transforms:[oA]},cell:r=>{let s=e.find(p=>p.metadata?.uid===r.id),n=s?.spec.clusterDeploymentName?.name,i=t?.find(p=>p.metadata?.uid===r.id),a,l="--";return s?l=n?So(GY,null,So(tA,null,So(Fa,{agent:s,zIndex:7e3})),So(tA,{align:{default:"alignRight"}},So(UY,{"aria-label":o("ai:Cluster popover"),headerContent:So("div",null,o("ai:Cannot be deleted")),bodyContent:So("div",null,o("ai:Hosts that are bound to a cluster cannot be deleted. Remove the host from the cluster and try again.")),footerContent:So($Y,{to:`/multicloud/infrastructure/clusters/details/${n}/`},o("ai:Go to cluster {{clusterName}}",{clusterName:n}))},So(WY,{variant:"link",icon:So(KY,{color:qY.value})},o("ai:Cannot be deleted"))))):So(Fa,{agent:s}):i&&(a=Ys(i),l=So(ef,{bmhStatus:a})),{title:l,props:{"data-testid":"host-status"},sortableValue:s?ut(s).status.title:a?.state.title||""}}}),XY=(e,t,o)=>[YY(e,o),jY(e,t,o)],JY=({isOpen:e,onClose:t,onDelete:o,agents:r,bmhs:s,infraEnv:n,nmStates:i})=>{let[a]=$o({agents:r,bmhs:s,infraEnv:n}),l=async m=>{let d=r.find(h=>h.metadata?.uid===m.id),g=d?.metadata?.labels?.[zo],C;if(d?g&&(C=s.find(h=>h?.metadata?.name===g&&d.metadata?.namespace===h.metadata?.namespace)):C=s.find(h=>h.metadata?.uid===m.id),!d?.spec?.clusterDeploymentName?.name)return o(d,C,i)},{t:p}=f(),c=ZY(()=>XY(r,s,p),[r,s,p]),u=Be(a.length);return So(Yl,{hosts:a,isOpen:e,onClose:t,onDelete:l},So(Xe,{hosts:a,content:c,...u},So("div",null,p("ai:No hosts selected"))))},bf=JY;import{createElement as TS}from"react";import{Modal as QY,ModalVariant as e4}from"@patternfly/react-core";var t4=({isOpen:e,onClose:t,infraEnv:o,onCreateBMH:r,usedHostnames:s,docVersion:n})=>{let i=o.metadata?.labels?.networkType!=="static",{t:a}=f();return TS(QY,{"aria-label":a("ai:Add BMC host dialog"),title:a("ai:Add host using Baseboard Management Controller (BMC)"),isOpen:e,onClose:t,variant:e4.medium,hasNoBodyWrapper:!0,id:"add-host-modal"},TS(Va,{infraEnv:o,docVersion:n,inModal:!0},TS(mp,{onCreateBMH:r,onClose:t,hasDHCP:i,infraEnv:o,usedHostnames:s})))},kf=t4;import{createElement as AS}from"react";import{Modal as f4,ModalVariant as g4}from"@patternfly/react-core";import{Fragment as mA,createElement as He,useState as yp}from"react";import{Alert as iA,AlertActionCloseButton as aA,AlertVariant as lA,Button as xf,ButtonVariant as PS,EmptyState as o4,EmptyStateBody as r4,EmptyStateIcon as s4,EmptyStateVariant as n4,ModalBoxBody as i4,ModalBoxFooter as a4,Spinner as l4,Stack as pA,StackItem as Cp,Title as p4}from"@patternfly/react-core";import{ErrorCircleOIcon as c4,UploadIcon as u4}from"@patternfly/react-icons";import cA from"js-yaml";import{saveAs as m4}from"file-saver";var rA={apiVersion:"v1",data:{username:"<<base64 of the username>>",password:"<<base64 of the password>>"},kind:"Secret",metadata:{name:"<<name of credentials. Should be unique>>",namespace:"<<name of namespace - usually the same as the name of the infra env>>"},type:"Opaque"},sA={apiVersion:"metal3.io/v1alpha1",kind:"BareMetalHost",metadata:{annotations:{"bmac.agent-install.openshift.io/hostname":"<<hostname of the host>>","inspect.metal3.io":"disabled"},labels:{"infraenvs.agent-install.openshift.io":"<<the name of the infra env in which this host will be>>"},name:"<<the name of the BareMetalHost CR>>",namespace:"<<name of namespace - usually the same as the name of the infra env>>"},spec:{automatedCleaningMode:"disabled",bmc:{address:"<<Baseboard Management Controller Address>>",credentialsName:"<<the name of the secret containing the credentials (defined in line 7)>>",disableCertificateVerification:!0},bootMACAddress:"<<The MAC address of the host's network connected NIC that wll be used to provision the host.>>",online:!1}},nA={apiVersion:"metal3.io/v1alpha1",kind:"BareMetalHost",metadata:{annotations:{"bmac.agent-install.openshift.io/hostname":"<<hostname of the host>>","inspect.metal3.io":"disabled"},labels:{"infraenvs.agent-install.openshift.io":"<<the name of the infra env in which this host will be>>"},name:"<<the name of the BareMetalHost CR>>",namespace:"<<name of namespace - usually the same as the name of the infra env>>"},spec:{automatedCleaningMode:"disabled",bmc:{address:"<<Baseboard Management Controller Address>>",credentialsName:"<<the name of the secret containing the credentials (defined in line 7)>>",disableCertificateVerification:!0},bootMACAddress:"<<The MAC address of the host's network connected NIC that wll be used to provision the host.>>",online:!1}};var d4=({onClose:e,onCreateBmcByYaml:t})=>{let[o,r]=yp(),[s,n]=yp(),[i,a]=yp(!0),[l,p]=yp(!1),[c,u]=yp(),[m,d]=yp(),{t:g}=f(),C=()=>{let y=[rA,sA,nA].map(b=>cA.dump(b)).join(`---
22
+ `),I=new Blob([y],{type:"text/plain;charset=utf-8"});m4(I,"bmc_hosts_template.yaml")},h=()=>{let y=document.createElement("input");y.setAttribute("id","importBMAsYaml"),y.type="file",y.accept=".yaml",y.style.visibility="hidden",document.querySelector("body")?.appendChild(y),y.onchange=b=>{p(!0),y.remove();let T=b.target.files[0],w=12582912;if(T.size>w)a(!1),r(T.name),n(g("ai:The file is too big. Upload a file up to 12 MiB.")),u(void 0);else{let F=new FileReader;F.readAsText(T,"UTF-8"),F.onload=O=>{let V=O.target?.result;if(V&&typeof V=="string")try{let Y=cA.loadAll(V);r(T.name),n(void 0),u(Y)}catch{r(T.name),n(g("ai:File is not structured correctly. Use the template to use the right file structure.")),u(void 0)}else u(void 0),r(T.name),n(g("ai:File is not structured correctly. Use the template to use the right file structure."));a(!1)}}},y.click()},S=()=>{n(void 0),d(void 0),r(void 0),a(!0),p(!1)},v=async()=>{try{p(!1),d(void 0),c!==void 0&&await t(c),e()}catch(y){d(U(y))}};return He(mA,null,He(i4,null,He(pA,{hasGutter:!0},He(Cp,null,He(o4,{variant:n4.large},He(s4,{icon:u4}),He(p4,{headingLevel:"h4",size:"lg"},g("ai:Upload a YAML file")),He(r4,null,He("p",null,g("ai:Upload a YAML file with BareMetalHost and Secret resource definitions. Use the provided template as a reference.")),He(pA,{hasGutter:!0},He(Cp,null,He(xf,{variant:PS.link,onClick:C},g("ai:Download template"))),i&&He(Cp,null,He(xf,{variant:PS.secondary,onClick:()=>{try{h()}catch(y){d(U(y))}},isDisabled:l},l?He(mA,null,g("ai:Opening file")," ",He(l4,{size:"sm"})):g("ai:Open file"))),o&&He(Cp,null,o,"\xA0",He(c4,{onClick:S})))))),m&&He(Cp,null,He(iA,{title:g("ai:Failed to add host by YAML"),variant:lA.danger,isInline:!0,actionClose:He(aA,{onClose:()=>d(void 0)})},g("ai:The YAML file might not be formatted correctly. Use the template to format and try again."),He("br",null),g("ai:Received error:"),"\xA0",m)),s&&He(Cp,null,He(iA,{title:g("ai:The file cannot be uploaded"),variant:lA.danger,isInline:!0,actionClose:He(aA,null)},s)))),He(a4,null,He(xf,{onClick:()=>{v()},isDisabled:!o||!!s},g("ai:Upload")),He(xf,{onClick:e,variant:PS.secondary},g("ai:Cancel"))))},uA=d4;var h4=({isOpen:e,onClose:t,onCreateBmcByYaml:o,infraEnv:r,docVersion:s})=>{let{t:n}=f();return AS(f4,{"aria-label":n("ai:Add host dialog"),title:n("ai:Add hosts by uploading YAML (BMC)"),variant:g4.medium,isOpen:e,onClose:t,hasNoBodyWrapper:!0},AS(Va,{infraEnv:r,docVersion:s,inModal:!0},AS(uA,{onClose:t,onCreateBmcByYaml:o})))},Tf=h4;import{Fragment as b4,createElement as hu}from"react";import{useHistory as C4}from"react-router-dom";import{Alert as y4,AlertActionLink as dA,AlertVariant as S4}from"@patternfly/react-core";import{ExternalLinkAltIcon as v4}from"@patternfly/react-icons";var I4=({docStorageUrl:e,storageOperatorUrl:t})=>{let{t:o}=f(),r=C4(),s=hu(b4,null,o("ai:Learn more about storage class"),"\xA0\xA0",hu(v4,null)),n=[hu(dA,{key:"install-storage-operator",onClick:()=>r.push(t)},o("ai:Install storage operator")),hu(dA,{key:"storage-class",onClick:()=>window.open(e,"_blank")},s)];return hu(y4,{title:o("ai:Must have a storage class"),variant:S4.warning,isInline:!0,actionLinks:n},o("ai:You'll first need to have a storage operator in order to create the storage class. If you don't have one installed, we recommend OpenShift Data Foundation operator, but you may use any."))};import{createElement as Ha,useEffect as N4,useState as F4}from"react";import{useHistory as T4}from"react-router-dom";import{Alert as DS,AlertVariant as ES,Button as P4,ButtonVariant as A4,AlertActionCloseButton as w4}from"@patternfly/react-core";import{ExternalLinkAltIcon as D4}from"@patternfly/react-icons";function Sp(e,t){return e.find(o=>o.type===t)}var fA=1,gA=1,hA=10,CA=3*60*1e3;var Pf="cim-config-configuring-started-at",k4=({agentServiceConfig:e})=>!!e,wS=({agentServiceConfig:e})=>Sp(e?.status?.conditions||[],"DeploymentsHealthy")?.status==="True",Cu=({agentServiceConfig:e})=>{if(!e)return!1;let t=Sp(e?.status?.conditions||[],"DeploymentsHealthy"),o=Date.now(),r=new Date(window.localStorage.getItem(Pf)||0),s=o-r.valueOf()<CA;return!t||t.status==="Unknown"||t.status==="False"&&s},x4=({storageClasses:e})=>!!e&&e.length>0;var FS="cim-config-progress-alert",NS=()=>{window.localStorage.setItem(FS,"")},E4=({agentServiceConfig:e,assistedServiceDeploymentUrl:t})=>{let{t:o}=f(),r=T4(),[s,n]=F4(!0);if(N4(()=>{n(window.localStorage.getItem(FS)==="closed")},void 0),!e)return null;if(wS({agentServiceConfig:e})){if(s)return null;let c=()=>{window.localStorage.setItem(FS,"closed"),n(!0)};return Ha(DS,{variant:ES.success,isInline:!0,title:o("ai:Host inventory configured successfully."),actionClose:Ha(w4,{onClose:c})})}let i=Ha(P4,{variant:A4.link,isInline:!0,key:"assisted-service-deployment",onClick:()=>r.push(t)},o("ai:Troubleshoot in the assisted service deployment")," ",Ha(D4,null));if(Cu({agentServiceConfig:e})){let c=[i];return Ha(DS,{variant:ES.info,isInline:!0,title:o("ai:Configuration may take a few minutes."),actionLinks:c},o("ai:If the configuration is taking longer than 3 minutes, you'll need to troubleshoot."))}let a=Sp(e.status?.conditions||[],"DeploymentsHealthy"),l=Sp(e.status?.conditions||[],"ReconcileCompleted"),p=[i];return Ha(DS,{title:o("ai:Configuration is hanging for a long time."),variant:ES.danger,isInline:!0,actionLinks:p},o("ai:Last observed condition:")," ",a?.message||l?.message,Ha("br",null),o("ai:You can either wait or investigate. A common issue can be misconfigured storage. Once you fix the issue, you can delete AgentServiceConfig to try again."))};import{createElement as Mi,useEffect as X4,useState as on}from"react";import{Alert as xA,AlertVariant as TA,Button as LS,ButtonVariant as OS,Modal as q4,ModalVariant as Y4}from"@patternfly/react-core";import{createElement as te}from"react";import{Trans as yA}from"react-i18next";import{Flex as V4,FlexItem as VS,Form as H4,FormGroup as Af,Popover as yu,Checkbox as M4,TextInput as HS}from"@patternfly/react-core";import{ExternalLinkAltIcon as SA,HelpIcon as Su}from"@patternfly/react-icons";var vA=({docConfigUrl:e,docConfigAwsUrl:t,isEdit:o,isInProgressPeriod:r,dbVolSize:s,dbVolSizeValidation:n,setDbVolSize:i,fsVolSize:a,fsVolSizeValidation:l,setFsVolSize:p,imgVolSize:c,imgVolSizeValidation:u,setImgVolSize:m,configureLoadBalancer:d,configureLoadBalancerInitial:g,setConfigureLoadBalancer:C})=>{let{t:h}=f(),S=(y,I)=>{let b=parseFloat(y);return isNaN(b)?I:b},v=te(yu,{bodyContent:h("ai:If you're running your hub cluster of Amazon Web Services and want to enable the CIM service, we recommend you to configure your load balancer if it is not already configured. Learn more about enabling CIM on AWS."),footerContent:te("a",{href:t,target:"_blank",rel:"noreferrer"},te(yA,{t:h},"ai:Learn more about enabling CIM on AWS ",te(SA,null)))},te("button",{type:"button","aria-label":h("ai:More info for load balancer on Amazon web services"),"aria-describedby":"cim-config-form-aws-title",onClick:y=>y.preventDefault(),className:"pf-c-form__group-label-help"},te(Su,{noVerticalAlign:!0})));return te(H4,null,te(Af,{fieldId:"cim-config-form-storage-title",label:h("ai:Storage sizes"),className:"cim-config-form-title",labelIcon:te(yu,{bodyContent:h("ai:The storage sizes will be used to store different files and data for cluster creation."),footerContent:te("a",{href:e,target:"_blank",rel:"noreferrer"},te(yA,{t:h},"ai:Learn more about storage sizes. ",te(SA,null)))},te("button",{type:"button","aria-label":h("ai:More info for configure storage sizes"),"aria-describedby":"cim-config-form-storage-title",onClick:y=>y.preventDefault(),className:"pf-c-form__group-label-help"},te(Su,{noVerticalAlign:!0})))},h("ai:If there are many clusters, use higher values for the storage fields.")),te(V4,{justifyContent:{default:"justifyContentSpaceBetween"}},te(VS,null,te(Af,{label:h("ai:Database storage"),fieldId:"cim-config-form-storage-db",labelIcon:te(yu,{bodyContent:h("ai:Specify how much storage is allocated for storing files such as database tables and database views for the clusters. Recommended is 10Gi or more. The value can not be updated later.")},te("button",{type:"button","aria-label":h("ai:More info for database storage"),"aria-describedby":"cim-config-form-storage-db",onClick:y=>y.preventDefault(),className:"pf-c-form__group-label-help"},te(Su,{noVerticalAlign:!0}))),helperTextInvalid:n,validated:n?"error":"default",isRequired:!0},te("span",{className:"cim-config-form-volume"},te(HS,{isRequired:!0,isDisabled:o,type:"number",id:"cim-config-form-storage-db",name:"cim-config-form-storage-db",value:s,onChange:y=>i(S(y,1)),min:0})," ","Gi"))),te(VS,null,te(Af,{label:h("ai:System storage"),fieldId:"cim-config-form-storage-sys",labelIcon:te(yu,{bodyContent:h('ai:Specify how much storage is allocated for storing logs, manifests and "kubeconfig" files for the clusters. Recommended is 100Gi or more. The value can not be updated later.')},te("button",{type:"button","aria-label":h("ai:More info for system storage"),"aria-describedby":"cim-config-form-storage-sys",onClick:y=>y.preventDefault(),className:"pf-c-form__group-label-help"},te(Su,{noVerticalAlign:!0}))),helperTextInvalid:l,validated:l?"error":"default",isRequired:!0},te("span",{className:"cim-config-form-volume"},te(HS,{isRequired:!0,isDisabled:o,type:"number",id:"cim-config-form-storage-sys",name:"cim-config-form-storage-sys",value:a,onChange:y=>p(S(y,1)),min:0})," ","Gi"))),te(VS,null,te(Af,{label:h("ai:Image storage"),fieldId:"cim-config-form-storage-img",labelIcon:te(yu,{bodyContent:h("ai:Specify how much storage to allocate for the images of the clusters. There must be 1G of image storage for each instance of Red Hat Enterprise Linux CoreOS that is running. Recommended is 50Gi or more. The value can not be updated later.")},te("button",{type:"button","aria-label":h("ai:More info for image storage"),"aria-describedby":"cim-config-form-storage-img",onClick:y=>y.preventDefault(),className:"pf-c-form__group-label-help"},te(Su,{noVerticalAlign:!0}))),helperTextInvalid:u,validated:u?"error":"default",isRequired:!0},te("span",{className:"cim-config-form-volume"},te(HS,{isRequired:!0,isDisabled:o,type:"number",id:"cim-config-form-storage-img",name:"cim-config-form-storage-img",value:c,onChange:y=>m(S(y,10)),min:0})," ","Gi")))),te(M4,{label:te("span",{className:"cim-config-form-aws-label"},h("ai:Configure load balancer on Amazon Web Services for me."),"\xA0",v),id:"cim-config-form-aws",className:"cim-config-form-aws",name:"aws-loadbalancer-checkbox",isChecked:d,isDisabled:r||o&&g,onChange:C}))};import{AlertVariant as L4}from"@patternfly/react-core";var IA="assisted-image-service-multicluster-engine",O4=async(e,t,o)=>{let r;try{r=await o({kind:"Route",apiVersion:"route.openshift.io/v1"})}catch{console.error("Failed to read all routes: ",r),t({title:e("ai:Failed to save configuration"),message:e("ai:Can not query routes.")});return}let s=r?.find(n=>n.metadata?.name==="assisted-image-service");if(!s?.spec?.host){t({title:e("ai:Failed to save configuration"),message:e("ai:Can not find host of the assisted-image-service route")});return}return s},_4=(e,t,o)=>{let r=`${IA}.`,s=o.spec?.host||"",n=s.substring(s.indexOf(r)+r.length),i=n.substring(n.indexOf(".")+1);return i||(console.error("Can not find domain in assistedImageServiceRoute: ",o),t({title:e("ai:Can not find cluster domain.")})),i},R4=async(e,t,o,r,s)=>{let n=`${IA}.nlb-apps.${s}`,i=r.metadata?.labels||{};i["router-type"]="nlb";let a=[{op:"replace",path:"/spec/host",value:n},{op:r.metadata?.labels?"replace":"add",path:"/metadata/labels",value:i}];try{await o(Pm(r),a)}catch(l){return console.error("Failed to patch assisted-image-service route: ",l,a),t({title:e("ai:Failed to patch assisted-image-service route for new domain.")}),!1}return!0},MS=async e=>{try{return await e({apiVersion:"operator.openshift.io/v1",kind:"IngressController",metadata:{name:"ingress-controller-with-nlb",namespace:"openshift-ingress-operator"}}),!0}catch{return!1}},B4=async(e,t,o,r)=>{let s={apiVersion:"operator.openshift.io/v1",kind:"IngressController",metadata:{name:"ingress-controller-with-nlb",namespace:"openshift-ingress-operator"},spec:{domain:`nlb-apps.${r}`,routeSelector:{matchLabels:{"router-type":"nlb"}},endpointPublishingStrategy:{type:"LoadBalancerService",loadBalancer:{scope:"External",providerParameters:{type:"AWS",aws:{type:"NLB"}}}}}};try{return await o(s),!0}catch(n){console.error("Create IngressController error: ",n),t({title:e("ai:Failed to create IngressController")})}return!1},z4=async({t:e,setError:t,patchResource:o,getResource:r})=>{try{let s=await r({kind:"Provisioning",apiVersion:"metal3.io/v1alpha1",metadata:{name:"provisioning-configuration"}}),n=[{op:s.spec?.watchAllNamespaces?"replace":"add",path:"/spec/watchAllNamespaces",value:!0}];await o(Pm(s),n)}catch(s){console.error("Failed to patch provisioning-configuration: ",s),t({title:e("ai:Failed to configure provisioning to enable registering hosts via BMC."),message:U(s),variant:L4.warning})}},W4=async({t:e,setError:t,createResource:o,dbVolSizeGiB:r,fsVolSizeGiB:s,imgVolSizeGiB:n})=>{try{let i={apiVersion:"agent-install.openshift.io/v1beta1",kind:"AgentServiceConfig",metadata:{name:"agent"},spec:{databaseStorage:{accessModes:["ReadWriteOnce"],resources:{requests:{storage:`${r}Gi`}}},filesystemStorage:{accessModes:["ReadWriteOnce"],resources:{requests:{storage:`${s}Gi`}}},imageStorage:{accessModes:["ReadWriteOnce"],resources:{requests:{storage:`${n}Gi`}}}}};return await o(i),!0}catch(i){return console.error("Failed to create AgentServiceConfig: ",i),t({title:e("ai:Failed to create AgentServiceConfig"),message:U(i)}),!1}},bA=async({t:e,setError:t,createResource:o,getResource:r,listResources:s,patchResource:n,agentServiceConfig:i,platform:a,dbVolSizeGiB:l,fsVolSizeGiB:p,imgVolSizeGiB:c,configureLoadBalancer:u})=>{if(["none","baremetal","openstack","vsphere"].includes(a.toLocaleLowerCase())&&await z4({t:e,setError:t,patchResource:n,getResource:r}),i)console.log("The AgentServiceConfig recently can not be patched. Delete and create instead.");else if(!await W4({t:e,setError:t,createResource:o,dbVolSizeGiB:l,fsVolSizeGiB:p,imgVolSizeGiB:c}))return!1;if(window.localStorage.setItem(Pf,new Date().toISOString()),u){if(await MS(r))return console.log("IngressController already present, we do not patch it."),!0;let m=await O4(e,t,s);if(!m)return!1;let d=_4(e,t,m);if(!d||!await B4(e,t,o,d)||!await R4(e,t,n,m,d))return!1}return!0};import{createElement as wf}from"react";import{Alert as G4,AlertVariant as U4}from"@patternfly/react-core";import{ExternalLinkAltIcon as K4}from"@patternfly/react-icons";import{Trans as $4}from"react-i18next";var kA=({docDisconnectedUrl:e})=>{let{t}=f();return wf(G4,{title:wf($4,{t},"ai:To configure for disconnected environments,"," ",wf("a",{href:e,target:"_blank",rel:"noreferrer"},"view documentation ",wf(K4,null))),variant:U4.info,isInline:!0})};var j4=({isOpen:e,onClose:t,agentServiceConfig:o,platform:r,docDisconnectedUrl:s,docConfigUrl:n,docConfigAwsUrl:i,getResource:a,listResources:l,patchResource:p,createResource:c})=>{let{t:u}=f(),[m,d]=on(),[g,C]=on(!1),[h,S]=on(()=>ou(10,o?.spec?.databaseStorage?.resources?.requests?.storage)),[v,y]=on(),[I,b]=on(()=>ou(100,o?.spec?.filesystemStorage?.resources?.requests?.storage)),[k,T]=on(),[w,F]=on(()=>ou(50,o?.spec?.imageStorage?.resources?.requests?.storage)),[O,V]=on(),[Y,he]=on(r==="AWS"),[Z,x]=on(!0),P=ir=>{ir<fA?y(u("ai:Minimal value is 1Gi")):y(void 0),S(ir)},A=ir=>{ir<gA?T(u("ai:Minimal value is 1Gi")):T(void 0),b(ir)},B=ir=>{ir<hA?V(u("ai:Minimal value is 10Gi")):V(void 0),F(ir)},Oe=!!o;X4(()=>{(async()=>{if(r==="AWS"&&(!Oe||await MS(a))){he(!0),x(!0);return}he(!1),x(!1)})()},[r]);let It={dbVolSize:h,dbVolSizeValidation:v,setDbVolSize:P,fsVolSize:I,fsVolSizeValidation:k,setFsVolSize:A,imgVolSize:w,imgVolSizeValidation:O,setImgVolSize:B,configureLoadBalancer:Y,configureLoadBalancerInitial:Z,setConfigureLoadBalancer:he},Mh=()=>{(async()=>{C(!0),d(void 0),NS(),await bA({t:u,setError:d,getResource:a,listResources:l,patchResource:p,createResource:c,agentServiceConfig:o,platform:r,dbVolSizeGiB:h,fsVolSizeGiB:I,imgVolSizeGiB:w,configureLoadBalancer:Y})&&t(),x(Y),C(!1)})()},pl=!!m?.title,Zp=!Oe||!Z,Im=!!(g||v||k||O||Oe&&Z===Y),Lh=Cu({agentServiceConfig:o}),Qp;return Zp?Qp=[Mi(LS,{key:"configure",variant:OS.primary,isDisabled:Im,onClick:Mh},u("ai:Configure")),Mi(LS,{key:"cancel",variant:OS.link,onClick:t},u("ai:Cancel"))]:Qp=[Mi(LS,{key:"close",variant:OS.primary,onClick:t},u("ai:Close"))],Mi(q4,{"aria-label":u("ai:Configure host inventory settings"),title:u("ai:Configure host inventory settings"),isOpen:e,onClose:t,actions:Qp,variant:Y4.medium,id:"cim-config-modal",className:"cim-config-modal"},u("ai:Configuring the host inventory settings will enable the Central Infrastructure Management."),pl&&Mi(xA,{title:m.title,variant:m.variant||TA.danger,isInline:!0},m.message),Mi(kA,{docDisconnectedUrl:s}),Mi(vA,{isEdit:Oe,isInProgressPeriod:Lh,onClose:t,docConfigUrl:n,docConfigAwsUrl:i,...It}),Zp&&Mi(xA,{variant:TA.warning,title:u("ai:Storage sizes cannot be changed once you configure."),isInline:!0}))};import{createElement as ej}from"react";import{Alert as J4,AlertVariant as Z4}from"@patternfly/react-core";var Q4=()=>{let{t:e}=f();return ej(J4,{isInline:!0,variant:Z4.warning,title:e("ai:Can not manage hosts until Central Infrastructure Management is set up.")})};import{createElement as rj}from"react";import{DropdownItem as tj}from"@patternfly/react-core";var oj=({onApprove:e,selectedAgents:t})=>{let{t:o}=f(),r=t.every(s=>s.spec.approved)?o("ai:All selected hosts are already approved."):void 0;return rj(tj,{onClick:e,isDisabled:!!r,description:r},o("ai:Approve"))},Df=oj;import{Badge as sj,Grid as nj,GridItem as ij,SearchInput as aj,Select as lj,SelectGroup as pj,SelectOption as cj,SelectVariant as uj,Split as mj,SplitItem as PA,ToolbarFilter as dj,ToolbarItem as AA}from"@patternfly/react-core";import{FilterIcon as fj}from"@patternfly/react-icons";import{createElement as Ao,useMemo as DA,useState as Cj}from"react";var gj=e=>{let t={};return Object.keys(e).sort((r,s)=>e[r].title.localeCompare(e[s].title)).forEach(r=>{let{category:s,title:n}=e[r];t[s]?t[s][n]?t[s][n].push(r):t[s]={...t[s],[n]:[r]}:t[s]={[n]:[r]}}),t},hj=({setSelectedHostIDs:e,massActions:t,hosts:o,statusFilter:r,statusCount:s,hostnameFilter:n,setHostnameFilter:i,setStatusFilter:a,selectedHostIDs:l,...p})=>{let[c,u]=Cj(!1),m=DA(()=>gj(Tt),[]),{t:d}=f(),g=DA(()=>o.map(C=>C.id),[o]);return Ao(bi,{selectedIDs:l||[],itemIDs:g,setSelectedIDs:e,actions:t,clearAllFilters:()=>a([]),...p},Ao(AA,null,Ao(aj,{placeholder:d("ai:Find by hostname"),value:n,onChange:i,onClear:()=>i(void 0)})),Ao(AA,null,Ao(dj,{chips:r,deleteChip:(C,h)=>a(r?.filter(S=>S!==h)),deleteChipGroup:()=>a([]),categoryName:"Status"},Ao(lj,{variant:uj.checkbox,"aria-label":d("ai:Status"),onToggle:u,onSelect:(C,h)=>{if(C.target.checked){let S=r?[...r,h]:[h];a(S)}else a(r?.filter(S=>S!==h))},selections:r,isOpen:c,placeholderText:d("ai:Status"),toggleIcon:Ao(fj,null)},[Ao(nj,{key:"statuses",hasGutter:!0,className:"table-toolbar__dropdown"},Object.keys(m).map(C=>Ao(ij,{key:C,span:4},Ao(pj,{label:C},Object.keys(m[C]).map(h=>Ao(cj,{key:h,value:h,isChecked:r?.includes(h)},Ao(mj,{hasGutter:!0},Ao(PA,null,h),Ao(PA,null,Ao(sj,{isRead:!0},s[h]||0)))))))))]))))},wA=hj;var bj=({onClearFilters:e})=>{let{t}=f();return no(ot,{title:t("ai:No results found"),content:t("ai:No results match the filter criteria. Clear filters to show results."),secondaryActions:[no(yj,{key:"clear-filters",variant:"link",onClick:e},t("ai:Clear all filters"))]})},kj=({agents:e,agentMachines:t,getClusterDeploymentLink:o,bareMetalHosts:r,infraEnv:s,nmStates:n,onChangeHostname:i,onChangeBMHHostname:a,onMassDeleteHost:l,agentClusterInstalls:p,onApprove:c,onDeleteHost:u,onEditBMH:m,onEditHost:d,onUnbindHost:g})=>{let[C,h]=vu(!1),[S,v]=vu(!1),[y,I]=vu(!1),[b,k]=vu(!1),[T,w]=vu([]),F=xj(T);F.current=T;let O=Tj((ar,bm)=>{w(bm?[...F.current,ar.id]:F.current.filter(km=>km!==ar.id))},[]),[V,Y,he]=$o({agents:e,bmhs:r,infraEnv:s,agentClusterInstalls:p},{onApprove:c,onDeleteHost:u,onEditBMH:m,onEditHost:d,onUnbindHost:g}),{t:Z}=f(),{statusCount:x,hostnameFilter:P,setHostnameFilter:A,setStatusFilter:B,statusFilter:Oe,filteredHosts:It}=iP({agents:e,bmhs:r,hosts:V}),Mh=Pj(()=>[of(It,e,r,Y.onEditHost,Y.canEditHostname,Y.canEditBMH),rf(e,r,Z),gr({agents:e,bareMetalHosts:r,onEditHostname:d,onApprove:c,t:Z}),nP(e,t,o,Z),Di,Go,Uo,yo].filter(Boolean),[It,e,t,d,c,o,Y,r,Z]),pl=e.filter(ar=>T.includes(ar.metadata?.uid||"")),Zp=r.filter(ar=>T.includes(ar.metadata?.uid||"")),Im=Zp.some(ar=>sf(ar,Z)[0])||pl.some(ar=>nf(ar,Z)[0]),Lh=[no(Sj,{key:"hostname",onClick:()=>v(!S),isDisabled:!Im,description:Im?void 0:Z("ai:Hostname cannot be changed for selected hosts.")},"Change hostname"),no(Df,{key:"approve",onApprove:()=>I(!y),selectedAgents:pl}),no($l,{key:"delete",onDeleteHost:()=>k(!b)})],Qp=async(ar,bm)=>{let km=e.find(xm=>xm.metadata?.uid===ar.id);if(km)return i(km,bm);{let xm=r.find(WM=>WM.metadata?.uid===ar.id);return xm?a(xm,bm):Ij}},ir=Be(It.length);return no(Aj,null,no(vj,{hasGutter:!0},no(EA,null,no(wA,{hosts:It,setSelectedHostIDs:w,massActions:Lh,statusCount:x,hostnameFilter:P,statusFilter:Oe,setStatusFilter:B,selectedHostIDs:T,setHostnameFilter:A,...ir})),no(EA,null,no(Xe,{hosts:It,content:Mh,actionResolver:he,selectedIDs:T,setSelectedIDs:w,onSelect:O,ExpandComponent:tn,...ir},V.length!==It.length?no(bj,{onClearFilters:()=>{A(void 0),B([])}}):no(lp,{setDiscoveryHintModalOpen:h})))),C&&no(Ln,{isOpen:C,setDiscoveryHintModalOpen:h}),S&&no(ki,{isOpen:S,hosts:It,selectedHostIDs:T,onChangeHostname:Qp,onClose:()=>v(!1),canChangeHostname:af(e,r,Z)}),b&&no(bf,{isOpen:b,agents:pl,bmhs:Zp,infraEnv:s,nmStates:n,onDelete:l,onClose:()=>k(!1)}),y&&no(hp,{isOpen:y,agents:pl,onApprove:c,onClose:()=>I(!1)}))},FA=kj;import{createElement as VA}from"react";import{ExclamationTriangleIcon as wj}from"@patternfly/react-icons";import{global_warning_color_100 as Dj}from"@patternfly/react-tokens";import{Tooltip as Ej}from"@patternfly/react-core";var Fj=({infraAgents:e,infraBMHs:t})=>{let{t:o}=f(),r=e.reduce((c,u)=>{let m=u.metadata?.labels?.[zo];return m&&c.push(m),c},[]),s=t.filter(c=>r.includes(c.metadata?.name||"")),n=e.map(c=>ut(c,!0).status),i=s.map(c=>Ys(c).state),a=[...n,...i],l=["bmh-error","preparing-failed","disconnected-unbound","disconnected","insufficient-unbound","insufficient","cancelled","error"],p=a.filter(({key:c})=>l.includes(c)).length;return p?VA(Ej,{content:o("ai:{{count}} host has problems",{count:p})},VA(wj,{color:Dj.value,className:"infra-env-hosts-tab-title__icon"})):null},NA=Fj;import{Fragment as Mj,createElement as _S}from"react";import{Alert as Nj,AlertVariant as Vj}from"@patternfly/react-core";var Hj=({infraEnv:e,bareMetalHosts:t,docVersion:o})=>{let r=e&&t?.filter(n=>n.metadata?.namespace===e.metadata?.namespace&&_n(n)===e.metadata?.name),{t:s}=f();return _S(Mj,null,r?.some(n=>!n.status)&&_S(Nj,{title:s("ai:Metal3 operator is not configured"),variant:Vj.warning,isInline:!0,className:"cim-resource-alerts",actionLinks:_S("a",{href:Qc(o),target:"_blank",rel:"noopener noreferrer"},s("ai:Open documentation"))},s("ai:It seems the Metal3 operator is missing configuration which will prevent it to find bare metal hosts in this namespace. Please refer to the documentation for the first time setup steps.")))},HA=Hj;import{Dropdown as Lj,DropdownGroup as Oj,DropdownItem as RS,DropdownSeparator as _j,DropdownToggle as Rj,Split as Bj,SplitItem as MA}from"@patternfly/react-core";import{Fragment as OA,createElement as io,useState as LA}from"react";var zj=({infraEnv:e,agentClusterInstall:t,onSaveISOParams:o,usedHostnames:r,onCreateBMH:s,docVersion:n,onCreateBmcByYaml:i,isBMPlatform:a})=>{let[l,p]=LA(void 0),[c,u]=LA(!1),{t:m}=f();return io(OA,null,io(Lj,{id:"infraenv-actions",toggle:io(Rj,{id:"dropdown-basic",onToggle:u,toggleVariant:"primary"},m("ai:Add hosts")),isOpen:c,dropdownItems:[io(RS,{key:"discovery-iso",onClick:()=>{u(!1),p("iso")},description:m("ai:Discover hosts by booting a discovery image")},m("ai:With Discovery ISO")),io(_j,{key:"separator"}),io(Oj,{id:"discovery-bmc",key:"discovery-bmc",className:"ai-discovery-bmc__group",label:io(Bj,{hasGutter:!0},io(MA,null,m("ai:Baseboard Management Controller (BMC)")),io(MA,null,!a&&io(OA,null," ",io(H,{noVerticalAlign:!0,bodyContent:io("p",null,m("ai:To enable the host's baseboard management controller (BMC) on the hub cluster, deploy the hub cluster on vSphere, BareMetal, OpenStack, or platform-agnostic (none type)."))}))))},io(RS,{key:"with-credentials",onClick:()=>{u(!1),p("bmc")},description:m("ai:Discover a single host via Baseboard Management Controller"),isDisabled:!a},m("ai:With BMC form")),io(RS,{key:"upload-yaml",onClick:()=>{u(!1),p("yaml")},description:m("ai:Discover multiple hosts by providing yaml with Bare Metal Host definitions"),isDisabled:!a},m("ai:By uploading a YAML")))],position:"right"}),l==="iso"&&io(df,{infraEnv:e,agentClusterInstall:t,isOpen:!0,onClose:()=>p(void 0),onSaveISOParams:o,docVersion:n}),l==="bmc"&&io(kf,{infraEnv:e,isOpen:!0,onClose:()=>p(void 0),onCreateBMH:s,usedHostnames:r,docVersion:n}),l==="yaml"&&io(Tf,{infraEnv:e,isOpen:!0,onClose:()=>p(void 0),onCreateBmcByYaml:i,docVersion:n}))},Ef=zj;import{Fragment as Ff,createElement as L,useEffect as n6,useState as i6}from"react";import{array as r6,lazy as t6,object as o6,string as s6}from"yup";import{Alert as Wj,AlertActionCloseButton as Gj,AlertVariant as Uj,Button as BS,Flex as _A,FlexItem as vp,Form as Kj,FormGroup as RA,Grid as BA,GridItem as zA,Spinner as $j,Stack as zS,StackItem as Ma,Title as qj,TitleSizes as Yj}from"@patternfly/react-core";import{Formik as jj,useFormikContext as Xj}from"formik";import{ExternalLinkAltIcon as Jj}from"@patternfly/react-icons";var Zj=(e,t)=>t6(o=>o6().shape({name:Es(t,e),location:id(t).required(t("ai:Location is a required field.")),pullSecret:ws.required(t("ai:Pull secret is a required field.")),sshPublicKey:go,httpProxy:Mo(o,"httpsProxy"),httpsProxy:Mo(o,"httpProxy"),noProxy:Fs,labels:r6().of(s6()).test("label-equals-validation","Label selector needs to be in a `key=value` form",r=>r.every(s=>s.split("=").length===2)),additionalNtpSources:wl})),Qj={name:"",location:"",pullSecret:"",sshPublicKey:"",httpProxy:"",httpsProxy:"",noProxy:"",enableProxy:!1,labels:[],networkType:"dhcp",cpuArchitecture:_.x86,enableNtpSources:!1,additionalNtpSources:""},WA=({onValuesChanged:e})=>{let{values:t}=Xj(),{t:o}=f();return n6(()=>e?.(t),[e,t]),L(zS,{hasGutter:!0},L(Ma,null,o("ai:Infrastructure environments are used by clusters. Create an infrastructure environment to add resources to your cluster.")),L(Ma,null,L(Kj,null,L(fo,{label:o("ai:Name"),name:"name",isRequired:!0,richValidationMessages:gi(o),placeholder:o("ai:Enter infrastructure environment name")}),L(RA,{fieldId:"network-type",label:o("ai:Network type"),labelIcon:L(H,{noVerticalAlign:!0,bodyContent:L(Ff,null,o("ai:This will determine for the infrastructure environment which kind of hosts would be able to be added. If the hosts that you want to add are using DHCP server, select this option, else, select the static IP."))})},L(_A,{justifyContent:{default:"justifyContentFlexStart"}},L(vp,null,L(ie,{name:"networkType",id:"dhcp",value:"dhcp",label:o("ai:DHCP only")})),L(vp,{spacer:{default:"spacer4xl"}}),L(vp,null,L(ie,{name:"networkType",id:"static-ip",value:"static",label:L(Ff,null,o("ai:Static IP, bridges and bonds"),"\xA0",L(H,{noVerticalAlign:!0,bodyContent:L(zS,{hasGutter:!0},L(Ma,null,o("ai:To use static network configuration, follow the steps listed in the documentation.")),L(Ma,null,L(BS,{variant:"link",icon:L(Jj,null),iconPosition:"right",isInline:!0,onClick:()=>window.open(cc,"_blank","noopener")},o("ai:View documentation"))))}))})))),L(RA,{fieldId:"cpuArchitecture",label:o("ai:CPU architecture")},L(_A,{justifyContent:{default:"justifyContentFlexStart"}},L(vp,null,L(ie,{name:"cpuArchitecture",id:"x86_64",value:"x86_64",label:o("ai:x86_64")})),L(vp,{spacer:{default:"spacer4xl"}}),L(vp,null,L(ie,{name:"cpuArchitecture",id:"arm64",value:"arm64",label:L(Ff,null,o("ai:arm64"),"\xA0")})))),L(fo,{label:o("ai:Location"),name:"location",isRequired:!0,richValidationMessages:Tl(o),placeholder:o("ai:Enter geographic location for the environment"),helperText:o("ai:Used to describe hosts' physical location. Helps for quicker host selection during cluster creation.")}),L(ud,{label:o("ai:Labels"),name:"labels"}),L(As,{isOcm:!1}),L(Ws,null),L(Gs,null),L(eo,{label:o("ai:Add your own NTP (Network Time Protocol) sources"),name:"enableNtpSources",helperText:L("p",null,o("ai:Configure your own NTP sources to synchronize the time between the hosts that will be added to this infrastructure environment.")),body:t.enableNtpSources&&L(BA,{hasGutter:!0},L(xn,{name:"additionalNtpSources",helperText:o("ai:A comma separated list of IP or domain names of the NTP pools or servers.")}))}))))},e6=({usedNames:e,onSubmit:t,onClose:o,onFinish:r,onValuesChanged:s,formRef:n})=>{let[i,a]=i6(),{t:l}=f();return L(jj,{initialValues:Qj,initialStatus:{error:null},validate:mo(Zj(e,l)),onSubmit:async p=>{try{await t?.(p),r?.(p)}catch(c){a(U(c))}},innerRef:n},({isValid:p,isSubmitting:c,submitForm:u})=>L(zS,{hasGutter:!0},L(Ma,null,t&&o?L(BA,{hasGutter:!0,span:8},L(zA,null,L(qj,{headingLevel:"h1",size:Yj.xl},l("ai:Configure environment"))),L(zA,null,L(WA,{onValuesChanged:s}))):L("div",{className:"infra-env__form"},L(WA,{onValuesChanged:s}))),i&&L(Ma,null,L(Wj,{variant:Uj.danger,actionClose:L(Gj,{onClose:()=>a(void 0)}),title:l("ai:Error creating InfraEnv")},i)),t&&o&&L(Ma,null,L(Ff,null,L(BS,{variant:"primary",type:"submit",isDisabled:!p||c,onClick:u},l("ai:Create")," ",c&&L($j,{isSVG:!0,size:"md"})),L(BS,{variant:"link",onClick:o,isDisabled:c},l("ai:Cancel"))))))};var WS=e=>e.labels.reduce((t,o)=>{let r=o.split("=");return t[r[0]]=r[1],t},{}),a6=(e,t,o)=>Xy({name:o.name,namespace:t,baseDnsDomain:"",annotations:WS(o),pullSecretName:e}),l6=({clusterDeploymentName:e,namespace:t,values:o})=>{let r={apiVersion:"extensions.hive.openshift.io/v1beta1",kind:"AgentClusterInstall",metadata:{name:o.name,namespace:t},spec:{holdInstallation:!0,clusterDeploymentRef:e?{name:e,namespace:t}:{},networking:{clusterNetwork:[{cidr:"10.128.0.0/14",hostPrefix:23}],serviceNetwork:["172.30.0.0/16"]},provisionRequirements:{controlPlaneAgents:3},imageSetRef:{name:"openshift-v4.8.0"}}};return r.spec&&o.sshPublicKey&&(r.spec.sshPublicKey=o.sshPublicKey),r},p6=(e,t)=>({kind:"Secret",apiVersion:"v1",metadata:{name:t.name,namespace:e},data:{".dockerconfigjson":btoa(t.pullSecret)},type:"kubernetes.io/dockerconfigjson"}),c6=(e,t)=>{let o=WS(t);t.location&&(o[st]=o[st]||t.location);let r={apiVersion:"agent-install.openshift.io/v1beta1",kind:"InfraEnv",metadata:{name:t.name,namespace:e,labels:{[st]:t.location}},spec:{agentLabels:o,clusterRef:{name:t.name,namespace:e},pullSecretRef:{name:t.name},sshAuthorizedKey:t.sshPublicKey},status:{agentLabelSelector:{matchLabels:o}}};return r.spec&&t.enableProxy&&(r.spec.proxy={httpProxy:t.httpProxy,httpsProxy:t.httpsProxy,noProxy:t.noProxy}),r};import u6 from"react";import{saveAs as m6}from"file-saver";import{Button as d6}from"@patternfly/react-core";var GS=({Component:e=d6,agentClusterInstall:t,id:o,variant:r})=>{let{t:s}=f(),n=t?.status?.debugInfo?.logsURL;return u6.createElement(e,{onClick:()=>n&&m6(n,"logs.tar"),isDisabled:!n,id:o,variant:r},s("ai:Download Installation Logs"))};import{lazy as h6,object as C6}from"yup";var f6=(e,t)=>{if(!ne(e)&&t==="userManaged")return Ue;let o=Pn(e);if(o)return zC(o);if(t==="clusterManaged")return wn(e)?.[0]?.subnet},US=(e,t)=>{let o=e.userManagedNetworking?"userManaged":"clusterManaged",r=xc(e),s=ne(e);return{clusterNetworkCidr:Gm(e)||t.clusterNetworkCidr,clusterNetworkHostPrefix:Um(e)||t.clusterNetworkHostPrefix,serviceNetworkCidr:Km(e)||t.serviceNetworkCidr,apiVip:e.apiVip||"",ingressVip:e.ingressVip||"",sshPublicKey:e.sshPublicKey||"",hostSubnet:f6(e,o)||Ue,vipDhcpAllocation:e.vipDhcpAllocation,managedNetworkingType:o,networkType:e.networkType||fi(s,r)}},g6=(e,t)=>h6(o=>C6().shape({clusterNetworkHostPrefix:Dn(o.clusterNetworkCidr),clusterNetworkCidr:pr(o.serviceNetworkCidr),serviceNetworkCidr:pr(o.clusterNetworkCidr),apiVip:ls(t,o,e.apiVip),ingressVip:ls(t,o,e.ingressVip),sshPublicKey:go,hostSubnet:Ia}));import rn from"react";import{Alert as y6,AlertActionLink as S6,AlertVariant as GA,DescriptionList as v6,DescriptionListDescription as I6,DescriptionListGroup as b6,DescriptionListTerm as k6,List as x6,ListItem as T6}from"@patternfly/react-core";function P6(e,t){switch(e){case"pending-for-input":case"insufficient":return t("ai:The cluster is not ready for installation.");default:return t("ai:Cluster configured and ready for installation.")}}function A6(e){switch(e){case"pending-for-input":case"insufficient":return GA.danger;default:return GA.success}}function w6(e,t){switch(e){case"pending-for-input":case"insufficient":return t("ai:Continue cluster configuration");default:return t("ai:Go to cluster configuration to start the installation")}}var D6=({validationsInfo:e,clusterStatus:t,onContinueClusterConfiguration:o})=>{let{t:r}=f(),[s]=t,n=P6(s,r),i=jC(e);return rn.createElement(y6,{isExpandable:["pending-for-input","insufficient"].includes(s),isInline:!0,variant:A6(s),title:n,actionLinks:rn.createElement(rn.Fragment,null,rn.createElement(S6,{onClick:o},w6(s,r)))},!!Object.entries(i).length&&rn.createElement(v6,null,Object.entries(i).map(([a,l])=>rn.createElement(b6,{key:a},rn.createElement(k6,null,cC(r)[a]),rn.createElement(I6,null,l&&rn.createElement(x6,null,l.map(p=>rn.createElement(T6,{key:p.id},p.message))))))))},UA=D6;import xe from"react";import{Button as O6,ButtonVariant as _6,Card as $S,CardBody as qS,CardExpandableContent as YS,CardHeader as jS,CardTitle as XS,Stack as qA,StackItem as Iu}from"@patternfly/react-core";import Nf from"react";var E6=({clusterDeployment:e,agentClusterInstall:t,agents:o,consoleUrl:r,fetchSecret:s})=>{let[n,i]=Nf.useState(),[a,l]=Nf.useState(!1),p=Gt({clusterDeployment:e,agentClusterInstall:t,agents:o}),c=t.spec?.clusterMetadata?.adminPasswordSecretRef?.name||e.spec?.clusterMetadata?.adminPasswordSecretRef?.name,u=e.metadata?.namespace,{t:m}=f();return Nf.useEffect(()=>{(async()=>{if(c&&u)try{let g=await s(c,u);i({username:atob(g?.data?.username||""),password:atob(g?.data?.password||""),consoleUrl:r})}catch(g){l(!0),console.error(m("ai:Failed to fetch adminPasswordSecret secret."),g)}})()},[c,u,s,r,m]),Nf.createElement(jl,{cluster:p,credentials:n,error:a})},Vf=E6;import{createElement as KS,useMemo as $A}from"react";import{ConnectedIcon as F6}from"@patternfly/react-icons";var N6=()=>{let{t:e}=f();return KS(ot,{icon:F6,title:e("ai:Waiting for hosts..."),content:e("ai:Hosts may take a few minutes to appear here after booting.")})},V6=({agents:e,agentClusterInstall:t})=>{let o=$A(()=>[t],[t]),[r,,s]=$o({agents:e,agentClusterInstalls:o}),{t:n}=f(),i=$A(()=>[wt(n),Ut(n),gr({agents:e,t:n}),ap(e,n),Go,Uo,yo],[e,n]),a=Be(e.length);return KS(Xe,{hosts:r,content:i,actionResolver:s,ExpandComponent:tn,...a},KS(N6,null))},KA=V6;import H6 from"react";import{saveAs as M6}from"file-saver";var L6=({clusterDeployment:e,agentClusterInstall:t,fetchSecret:o})=>{let[r]=Wt(t),{t:s}=f();return H6.createElement(Ti,{handleDownload:async()=>{let i=t.spec?.clusterMetadata?.adminKubeconfigSecretRef?.name||e.spec?.clusterMetadata?.adminKubeconfigSecretRef?.name,a=e.metadata?.namespace;if(i&&a)try{let p=(await o(i,a)).data?.kubeconfig;if(!p)throw new Error(s("ai:Kubeconfig is empty."));let c=new Blob([atob(p)],{type:"text/plain;charset=utf-8"});M6(c,"kubeconfig.yaml")}catch(l){console.error("Failed to fetch kubeconfig secret.",l)}},clusterId:e.metadata?.uid||"",status:r})},Hf=L6;var R6=({clusterDeployment:e,agentClusterInstall:t,agents:o,fetchSecret:r,onFetchEvents:s})=>{let[n,i]=xe.useState(!0),[a,l]=xe.useState(!0),[p,c]=xe.useState(!0),u=o.filter(C=>C.spec.clusterDeploymentName?.name===e.metadata?.name&&C.spec.clusterDeploymentName?.namespace===e.metadata?.namespace),m=Gt({clusterDeployment:e,agentClusterInstall:t,agents:u}),d=xe.useMemo(()=>Zy(e,t),[e,t]),{t:g}=f();return xe.createElement(qA,{hasGutter:!0},pS(t)&&xe.createElement(Iu,null,xe.createElement($S,{id:"cluster-installation-progress-card",isExpanded:n},xe.createElement(jS,{onExpand:()=>i(!n),toggleButtonProps:{id:"progress-card-toggle-button","aria-label":"Cluster installation process","aria-labelledby":"titleId progress-card-toggle-button","aria-expanded":n}},xe.createElement(XS,{id:"titleId"},g("ai:Cluster installation process"))),xe.createElement(YS,null,xe.createElement(qS,null,xe.createElement(qA,{hasGutter:!0},lS(t)&&xe.createElement(Iu,null,xe.createElement(Vf,{clusterDeployment:e,agentClusterInstall:t,agents:u,fetchSecret:r,consoleUrl:Jy(e)})),xe.createElement(Iu,null,xe.createElement(Hf,{clusterDeployment:e,agentClusterInstall:t,fetchSecret:r})," ",xe.createElement(Ol,{id:"cluster-events-button",entityKind:"cluster",cluster:m,title:g("ai:Cluster Events"),variant:_6.link,style:{textAlign:"right"},onFetchEvents:s,ButtonComponent:O6},g("ai:View Cluster Events")))))))),xe.createElement(Iu,null,xe.createElement($S,{id:"cluster-inventory-card",isExpanded:a},xe.createElement(jS,{onExpand:()=>l(!a),toggleButtonProps:{id:"inventory-card-toggle-button","aria-label":"Hosts inventory","aria-labelledby":"titleId inventory-card-toggle-button","aria-expanded":a}},xe.createElement(XS,{id:"titleId"},g("ai:Hosts inventory"))),xe.createElement(YS,null,xe.createElement(qS,null,xe.createElement(KA,{agents:u,agentClusterInstall:t}))))),xe.createElement(Iu,null,xe.createElement($S,{id:"cluster-details-card",isExpanded:p},xe.createElement(jS,{onExpand:()=>c(!p),toggleButtonProps:{id:"details-card-toggle-button","aria-label":"Details","aria-labelledby":"titleId details-card-toggle-button","aria-expanded":p}},xe.createElement(XS,{id:"titleId"},g("ai:Details"))),xe.createElement(YS,null,xe.createElement(qS,null,xe.createElement(Bd,{leftItems:[d.name,d.openshiftVersion,d.clusterId,d.installedTimestamp,d.baseDnsDomain],rightItems:[d.apiVip,d.ingressVip,d.clusterNetworkCidr,d.clusterNetworkHostPrefix,d.serviceNetworkCidr]}))))))},YA=R6;import ku from"react";import{Grid as x3,GridItem as Mf}from"@patternfly/react-core";import Kt from"react";import{CheckCircleIcon as q6,ExclamationCircleIcon as Y6,InProgressIcon as j6}from"@patternfly/react-icons";import{global_danger_color_100 as X6}from"@patternfly/react-tokens/dist/esm/global_danger_color_100";import{global_success_color_100 as J6}from"@patternfly/react-tokens/dist/esm/global_success_color_100";import bu from"react";import{Stack as U6,StackItem as XA,TextContent as K6}from"@patternfly/react-core";import B6 from"react";import{IconSize as Gn}from"@patternfly/react-icons";var z6=e=>{switch(e){case Gn.sm:return"0.3em";case Gn.md:return"1.5em";case Gn.lg:return"2em";case Gn.xl:return"3em";default:return"1em"}},W6=e=>{switch(e){case Gn.sm:return"-0.3em";case Gn.md:return"-1.5em";case Gn.lg:return"-2em";case Gn.xl:return"-3em";default:return"-1em"}},G6=({children:e,iconSize:t=Gn.sm})=>{let o={padding:`${z6(t)}`,borderRadius:"50%",border:"2px solid",borderColor:"#D2D2D2",boxSizing:"content-box",verticalAlign:`${W6(t)}`};return B6.cloneElement(e,{style:o})},jA=G6;var $6=({icon:e,children:t})=>bu.createElement(U6,null,bu.createElement(XA,null,bu.createElement(jA,null,e)),bu.createElement(XA,null,bu.createElement(K6,null,t))),Li=$6;var JS=({hosts:e,hostRole:t})=>{let{t:o}=f(),r=t==="master"?o("ai:Control Plane",{count:e.length}):o("ai:Worker",{count:e.length});if(e.some(i=>["cancelled","error"].includes(i.status))){let i=e.filter(a=>a.status==="error").length;return Kt.createElement(Li,{icon:Kt.createElement(Y6,{color:X6.value})},Kt.createElement(Kt.Fragment,null,r,Kt.createElement("br",null),Kt.createElement("small",null,i,"/",t==="master"?o("ai:{{count}} control plane node failed",{count:e.length}):o("ai:{{count}} worker failed",{count:e.length}))))}let s=e.filter(i=>["installed","added-to-existing-cluster"].includes(i.status)),n=e.filter(i=>["preparing-for-installation","preparing-successful","pending-for-input","installing","installing-in-progress","installing-pending-user-action","resetting-pending-user-action","resetting"].includes(i.status));return n.length>0?Kt.createElement(Li,{icon:Kt.createElement(j6,null)},Kt.createElement(Kt.Fragment,null,r,Kt.createElement("br",null),Kt.createElement("small",null,t==="master"?o("ai:Installing {{count}} control plane node",{count:n.length}):o("ai:Installing {{count}} worker",{count:n.length})))):Kt.createElement(Li,{icon:Kt.createElement(q6,{color:J6.value})},Kt.createElement(Kt.Fragment,null,r,Kt.createElement("br",null),Kt.createElement("small",null,t==="master"?o("ai:{{count}} control plane node installed",{count:s.length}):o("ai:{{count}} worker installed",{count:s.length}))))};import Ct from"react";import{Button as JA,ButtonVariant as ZA,Popover as Z6,Text as Q6,TextContent as e3}from"@patternfly/react-core";import{CheckCircleIcon as QA,ExclamationCircleIcon as t3,InProgressIcon as o3,PendingIcon as r3}from"@patternfly/react-icons";import{global_success_color_100 as ew}from"@patternfly/react-tokens/dist/esm/global_success_color_100";import{global_danger_color_100 as s3}from"@patternfly/react-tokens/dist/esm/global_danger_color_100";import n3 from"lodash/capitalize";var i3=(e=[])=>e.length?e.filter(t=>t.operatorType==="builtin").every(t=>t.status==="available"):!1,a3=e=>{let t,o;if(i3(e.monitoredOperators))t=Ct.createElement(QA,{color:ew.value}),o="completed";else switch(e.status){case"finalizing":t=Ct.createElement(o3,null),o="finalizing";break;case"error":case"cancelled":t=Ct.createElement(t3,{color:s3.value}),o="failed";break;case"installed":case"adding-hosts":t=Ct.createElement(QA,{color:ew.value}),o="completed";break;default:t=Ct.createElement(r3,null),o="pending"}return{finalizingIcon:t,initializationStatus:o}},tw=({cluster:e,onFetchEvents:t,fallbackEventsURL:o})=>{let[r,s]=Ct.useState(!1),{finalizingIcon:n,initializationStatus:i}=a3(e),a=()=>s(!1),{t:l}=f();return Ct.createElement(Ct.Fragment,null,Ct.createElement(xa,{title:l("ai:Cluster Events"),isOpen:r,onClose:a,hostId:void 0,cluster:e,entityKind:"cluster",onFetchEvents:t,fallbackEventsURL:o}),Ct.createElement(Li,{icon:n},Ct.createElement(Ct.Fragment,null,["finalizing","pending"].includes(i)?Ct.createElement(Z6,{zIndex:300,headerContent:Ct.createElement(Ct.Fragment,null,l("ai:Initialization")),bodyContent:Ct.createElement(e3,null,Ct.createElement(Q6,null,l("ai:This stage may take a while to finish. To view detailed information, click the events log link below."))),footerContent:Ct.createElement(JA,{variant:ZA.link,isInline:!0,onClick:()=>s(!0)},l("ai:Open Events Log"))},Ct.createElement(JA,{variant:ZA.link,isInline:!0},l("ai:Initialization"))):l("ai:Initialization"),Ct.createElement("small",null,n3(i)))))};import Yo from"react";import{Button as l3,ButtonVariant as p3,List as c3,ListItem as u3,Popover as m3}from"@patternfly/react-core";import{CheckCircleIcon as d3,ExclamationCircleIcon as f3,InProgressIcon as g3,PendingIcon as h3}from"@patternfly/react-icons";import{global_danger_color_100 as C3,global_success_color_100 as y3}from"@patternfly/react-tokens";import{pluralize as S3}from"humanize-plus";function ow(e){let t=e.map(o=>o.status||"pending");return t.includes("failed")?"failed":t.includes("progressing")?"progressing":t.includes("pending")?"pending":"available"}var rw=e=>`${e} ${S3(e,"operator")}`;function v3(e,t){let o=e.filter(n=>n.status==="failed").length,r=ow(e),s=rw(e.length);switch(r){case"available":return t("ai:{{operatorsCountString}} installed",{operatorsCountString:s});case"failed":return e.length>1?`${o}/${s} failed`:`${rw(o)} failed`;case"progressing":return t("ai:Installing {{operatorsCountString}}",{operatorsCountString:s});default:return t("ai:Pending - {{operatorsCountString}}",{operatorsCountString:s})}}function I3(e){switch(e){case"available":return Yo.createElement(d3,{color:y3.value});case"failed":return Yo.createElement(f3,{color:C3.value});case"progressing":return Yo.createElement(g3,null);default:return Yo.createElement(h3,null)}}var b3=({operators:e,children:t})=>{let{t:o}=f();return Yo.createElement(m3,{headerContent:Yo.createElement("div",null,o("ai:Operators")),bodyContent:Yo.createElement(c3,{className:"operators-progress-item__operators-list"},e.map(r=>{let s=r.status??"pending";r.status==="available"&&(s="installed");let n=r.name&&pc(o)[r.name];return Yo.createElement(u3,{key:r.name,title:r.statusInfo},n," ",s)})),minWidth:"30rem",maxWidth:"50rem"},t)},k3=({operators:e})=>{let{t}=f(),o=I3(ow(e)),r=v3(e,t);return Yo.createElement(Li,{icon:o},Yo.createElement(Yo.Fragment,null,Yo.createElement(b3,{operators:e},Yo.createElement(l3,{variant:p3.link,isInline:!0,"data-testid":"operators-progress-item"},t("ai:Operators"))),Yo.createElement("small",null,r)))},sw=k3;import jo from"react";var T3=({cluster:e,minimizedView:t=!1,onFetchEvents:o,fallbackEventsURL:r})=>{let s=An(e.hosts),n=mi(e),i=s.filter(l=>l.role&&l.role==="master"),a=s.filter(l=>l.role&&l.role==="worker");return jo.createElement(jo.Fragment,null,jo.createElement(ae,{condition:!t},jo.createElement(x3,{hasGutter:!0},jo.createElement(Mf,{span:3},jo.createElement(JS,{hosts:i,hostRole:"master"})),jo.createElement(ae,{condition:a.length>0},jo.createElement(Mf,{span:3},jo.createElement(JS,{hosts:a,hostRole:"worker"}))),jo.createElement(Mf,{span:3},jo.createElement(tw,{cluster:e,onFetchEvents:o,fallbackEventsURL:r})),jo.createElement(ae,{condition:n.length>0},jo.createElement(Mf,{span:3},jo.createElement(sw,{operators:n}))))))},Lf=T3;import{Stack as P3,StackItem as nw}from"@patternfly/react-core";var A3=({clusterDeployment:e,agentClusterInstall:t,agents:o,onFetchEvents:r,fallbackEventsURL:s})=>{let n=Gt({clusterDeployment:e,agentClusterInstall:t,agents:o});return ku.createElement(P3,{hasGutter:!0},ku.createElement(nw,null,ku.createElement(xi,{totalPercentage:t.status?.progress?.totalPercentage||0,cluster:n})),ku.createElement(nw,null,ku.createElement(Lf,{cluster:n,onFetchEvents:r,fallbackEventsURL:s})))},iw=A3;import{createElement as Io,useState as EX}from"react";import AX from"classnames";import{Grid as wX,GridItem as Zw}from"@patternfly/react-core";import w3 from"react";var D3=w3.createContext({currentStepId:"cluster-details",setCurrentStepId:()=>{console.error("Tried to use ClusterDeploymentWizardContext but there was no provider rendered.")}}),vo=D3;import Wr from"react";import{Formik as s5}from"formik";import{Grid as n5,GridItem as gw}from"@patternfly/react-core";import sn from"react";import{Alert as E3,AlertGroup as F3,AlertVariant as N3}from"@patternfly/react-core";var V3=({currentStepId:e,clusterStatus:t,validationsInfo:o,hosts:r,children:s})=>sn.createElement(F3,null,s,t&&sn.createElement(Bc,{currentStepId:e,clusterStatus:t,hosts:r,validationsInfo:o,wizardStepsValidationsMap:Dr},sn.createElement(Ea,null))),H3=({agentClusterInstall:e,agents:t,showClusterErrors:o,children:r,onSyncError:s,isNextDisabled:n,...i})=>{let{alerts:a}=M(),{currentStepId:l}=sn.useContext(vo),p=o?e?.status?.debugInfo?.state:void 0,c=o?e?.status?.validationsInfo:void 0,u=sn.useMemo(()=>(t||[]).reduce((h,S)=>{let v=S.status?.debugInfo?.state;return v&&h.push({status:v,validationsInfo:S.status?.validationsInfo}),h},[]),[t]),m=e?.status?.conditions?.find(h=>h.type==="SpecSynced"&&h.status==="False")?.message,{t:d}=f();sn.useEffect(()=>{m&&s&&s()},[m,s]);let g=a.length?sn.createElement(mr,null):void 0,C=sn.createElement(V3,{currentStepId:l,clusterStatus:p,validationsInfo:c,hosts:u},m&&sn.createElement(E3,{variant:N3.danger,title:d("ai:An error occured"),isInline:!0},m),r);return sn.createElement(Lr,{alerts:g,errors:C,isNextDisabled:n||!!m,...i})},nn=H3;import{createElement as lw}from"react";import Un from"react";import{WizardNav as M3}from"@patternfly/react-core";var Ip=e=>({"cluster-details":e("ai:Cluster details"),"hosts-selection":e("ai:Cluster hosts"),"hosts-discovery":e("ai:Cluster hosts"),networking:e("ai:Networking"),review:e("ai:Review and create")}),xu=1024,Tu=3;var Of=Object.keys(Ip),L3=()=>{let{currentStepId:e,setCurrentStepId:t,clusterDeployment:o}=Un.useContext(vo),{t:r}=f(),s=Ip(r);return Un.createElement(M3,null,Un.createElement(Oo,{key:"installation-type",content:"Installation type",step:0,isDisabled:!0}),Un.createElement(Oo,{key:"cluster-details",content:s["cluster-details"],isCurrent:e==="cluster-details",isDisabled:!1,step:1,onNavItemClick:()=>t("cluster-details")}),Un.createElement(Oo,{key:"automation",content:"Automation",step:2,isDisabled:!0}),Na(o)?Un.createElement(Oo,{key:"hosts-selection",content:s["hosts-selection"],isDisabled:!Of.slice(1).includes(e),isCurrent:e==="hosts-selection",step:2,onNavItemClick:()=>t("hosts-selection")}):Un.createElement(Oo,{key:"hosts-discovery",content:s["hosts-discovery"],isDisabled:!Of.slice(1).includes(e),isCurrent:e==="hosts-discovery",step:2,onNavItemClick:()=>t("hosts-discovery")}),Un.createElement(Oo,{key:"networking",content:s.networking,isDisabled:!Of.slice(2).includes(e),isCurrent:e==="networking",step:3,onNavItemClick:()=>t("networking")}),Un.createElement(Oo,{key:"review",content:s.review,isDisabled:!Of.slice(3).includes(e),isCurrent:e==="review",step:4,onNavItemClick:()=>t("review")}))},aw=L3;var O3=e=>lw(Ee,{navigation:lw(aw,null),...e}),an=O3;import{createElement as Pu,useMemo as r5}from"react";import{Alert as e5,Stack as t5,StackItem as fw}from"@patternfly/react-core";import{Fragment as J3,createElement as Dt,useEffect as Q3,useRef as Z3}from"react";import{Alert as cw,AlertVariant as uw,FlexItem as mw,Form as j3}from"@patternfly/react-core";import{useFormikContext as X3}from"formik";import{Fragment as K3,createElement as Kn,useCallback as q3,useEffect as Y3,useRef as $3}from"react";import{Checkbox as _3,FormGroup as R3,Tooltip as B3}from"@patternfly/react-core";import{useField as z3,useFormikContext as W3}from"formik";var G3=({version:e})=>{let{t}=f();return Kn(K3,null,t("ai:Use arm64 CPU architecture")," ",Kn(H,{noVerticalAlign:!0,bodyContent:Kn("p",null,t("ai:Check this option if you want to use the arm64 CPU architecture instead of the default x86_64 CPU architecture. Please note that some features will not be available."))}),Kn(ko,{featureId:"ARM64_ARCHITECTURE",openshiftVersion:e}))},U3=({versions:e})=>{let{t}=f(),{values:{openshiftVersion:o}}=W3(),[{name:r,value:s},,{setValue:n}]=z3("cpuArchitecture"),i=E(r,"input"),a=Pe(),l=!!e.find(m=>a.isFeatureSupported(m.value,"ARM64_ARCHITECTURE")),p=$3(o),c=q3(m=>n(m?_.ARM:_.x86),[n]);if(Y3(()=>{p.current!==o&&!a.isFeatureSupported(o,"ARM64_ARCHITECTURE")&&c(!1),p.current=o},[o,c,a]),!l)return null;let u=a.getFeatureDisabledReason(o,"ARM64_ARCHITECTURE");return Kn(R3,{isInline:!0,fieldId:i},Kn(B3,{hidden:!u,content:u},Kn(_3,{id:i,name:r,isDisabled:a.isFeatureDisabled(o,"ARM64_ARCHITECTURE"),label:Kn(G3,{version:o}),"aria-describedby":`${i}-helper`,description:Kn(Q,{fieldId:i},t("ai:Make sure all the hosts are using arm64 CPU architecture.")),isChecked:Vr({cpuArchitecture:s}),onChange:c})))},pw=U3;var _f=({name:e,baseDnsDomain:t})=>{let{t:o}=f();return Dt(J3,null,o("ai:All DNS records must be subdomains of this base and include the cluster name. This cannot be changed after cluster installation. The full cluster address will be:")," ",Dt("br",null),Dt("strong",null,e||"[Cluster Name]",".",t||"[example.com]"))},dw=({isEditFlow:e,versions:t,defaultPullSecret:o,forceOpenshiftVersion:r,extensionAfter:s})=>{let{values:n}=X3(),{name:i,baseDnsDomain:a,highAvailabilityMode:l}=n,p=Z3();Q3(()=>{p.current?.focus()},[]);let c=n.enableDiskEncryptionOnMasters||n.enableDiskEncryptionOnWorkers,{t:u}=f();return Dt(j3,{id:"wizard-cluster-details__form"},e?Dt(Vs,{name:"name",label:u("ai:Cluster name"),isRequired:!0},i):Dt(fo,{ref:p,label:u("ai:Cluster name"),name:"name",placeholder:u("ai:Enter cluster name"),richValidationMessages:td(u),isRequired:!0}),s?.name&&s.name,e?Dt(Vs,{name:"baseDnsDomain",label:u("ai:Base domain"),helperText:Dt(_f,{name:i,baseDnsDomain:a}),isRequired:!0},a):Dt(J,{label:u("ai:Base domain"),name:"baseDnsDomain",helperText:Dt(_f,{name:i,baseDnsDomain:a}),placeholder:"example.com",isRequired:!0}),r?Dt(Vs,{name:"openshiftVersion",label:"OpenShift version",isRequired:!0},u("ai:OpenShift")," ",r):Dt(Jl,{versions:t}),Dt(Xl,{versions:t,highAvailabilityMode:l}),Dt(pw,{versions:t}),s?.openshiftVersion&&s.openshiftVersion,!e&&Dt(wa,{defaultPullSecret:o}),s?.pullSecret&&s.pullSecret,c&&n.diskEncryptionMode==="tpmv2"&&Dt(cw,{variant:uw.warning,isInline:!0,title:Dt(mw,null,u("ai:To use this encryption method, enable TPMv2 encryption in the BIOS of each selected host."))}),c&&n.diskEncryptionMode==="tang"&&Dt(cw,{variant:uw.warning,isInline:!0,title:Dt(mw,null,u("ai:The use of Tang encryption mode to encrypt your disks is only supported for bare metal or vSphere installations on user-provisioned infrastructure."))}))};var o5=({agentClusterInstall:e,clusterDeployment:t,clusterImages:o,pullSecret:r,extensionAfter:s})=>{let n=r5(()=>Js(o),[o]),i=e?tu(o,e):void 0,a=!!t,{t:l}=f();return Pu(t5,{hasGutter:!0},a&&Pu(fw,null,Pu(e5,{isInline:!0,variant:"info",title:l("ai:Some details are not editable after the draft cluster was created.")})),Pu(fw,null,Pu(dw,{versions:n,isEditFlow:a,forceOpenshiftVersion:i,defaultPullSecret:r,extensionAfter:s})))},Rf=o5;var ZS=({clusterDeployment:e,agentClusterInstall:t,agents:o,clusterImages:r,usedClusterNames:s,defaultBaseDomain:n,pullSecret:i,infraEnv:a})=>{let{t:l}=f(),p=Pe(),c=Js(r),u=Wr.useMemo(()=>e&&t?Gt({clusterDeployment:e,agentClusterInstall:t,agents:o,infraEnv:a}):void 0,[t,e,o,a]),m=Wr.useMemo(()=>_d({managedDomains:[],cluster:u,ocpVersions:c,baseDomain:n,pullSecret:i}),[]),d=Wr.useMemo(()=>Rd({usedClusterNames:s,featureSupportLevels:p,pullSecretSet:!0,ocpVersions:c,validateUniqueName:!0,t:l}),[s,c,p,l]);return[m,d]},i5=({clusterImages:e,clusterDeployment:t,agentClusterInstall:o,agents:r,usedClusterNames:s,onSaveDetails:n,onClose:i,pullSecret:a,isPreviewOpen:l,infraEnv:p})=>{let{addAlert:c}=M(),{setCurrentStepId:u}=Wr.useContext(vo),{t:m}=f(),[d,g]=ZS({clusterDeployment:t,agentClusterInstall:o,agents:r,clusterImages:e,usedClusterNames:s,infraEnv:p}),C=()=>Na(t)?u("hosts-selection"):u("hosts-discovery"),h=async S=>{try{await n(S),C()}catch(v){c({title:m("ai:Failed to save ClusterDeployment"),message:v})}};return Wr.createElement(s5,{initialValues:d,validate:mo(g),onSubmit:h},({submitForm:S,isSubmitting:v,isValid:y,isValidating:I,dirty:b})=>{let T=Wr.createElement(nn,{agentClusterInstall:o,isSubmitting:v,isNextDisabled:!y||I||v,onNext:()=>{b?S():C()},onCancel:i}),w=cu(l);return Wr.createElement(an,{footer:T},Wr.createElement(n5,{hasGutter:!0},Wr.createElement(gw,null,Wr.createElement(De,null,"Cluster Details")),Wr.createElement(gw,{...w},Wr.createElement(Rf,{agentClusterInstall:o,clusterDeployment:t,clusterImages:e,pullSecret:a}))))})},hw=i5;import Et from"react";import{Formik as n9,useFormikContext as i9}from"formik";import{Alert as a9,AlertVariant as l9,Grid as p9,GridItem as ww}from"@patternfly/react-core";import{Fragment as Tw,createElement as Fe,useEffect as xw,useMemo as e9,useState as Q5}from"react";import{Alert as z5,Form as W5,Grid as G5,GridItem as U5,Spinner as K5,Text as iv,TextContent as Iw,TextVariants as $5,Checkbox as q5,Split as Y5,SplitItem as bw,Stack as j5,StackItem as Uf}from"@patternfly/react-core";import $n,{useEffect as sv}from"react";import{useFormikContext as N5}from"formik";import{Checkbox as V5,Grid as H5}from"@patternfly/react-core";import wu from"react";import{Grid as c5,TextInputTypes as u5}from"@patternfly/react-core";import{useFormikContext as m5}from"formik";import Xo from"react";import{Split as a5,SplitItem as QS,Tooltip as l5,FormGroup as p5}from"@patternfly/react-core";var Au="networkType",Bf=({isDisabled:e=!1,isSDNSelectable:t})=>{let{t:o}=f();return Xo.createElement(p5,{fieldId:Au,label:"Network type"},Xo.createElement(a5,{hasGutter:!0},Xo.createElement(QS,null,Xo.createElement(l5,{hidden:t,content:o("ai:Software-Defined Networking (SDN) cannot be selected for SNO clusters or when IPv6 is detected.")},Xo.createElement(ie,{id:Au,name:Au,isDisabled:e||!t,value:ts,label:Xo.createElement(Xo.Fragment,null,o("ai:Software-Defined Networking (SDN)")," ",Xo.createElement(H,{noVerticalAlign:!0,bodyContent:"The classic bullet-proof networking type"}))}))),Xo.createElement(QS,null),Xo.createElement(QS,null,Xo.createElement(ie,{id:Au,name:Au,isDisabled:e,value:kn,label:Xo.createElement(Xo.Fragment,null,o("ai:Open Virtual Networking (OVN)")," ",Xo.createElement(H,{noVerticalAlign:!0,bodyContent:"The next generation networking type, select this when you're using new features and telco features"}))}))))};var d5=({isSDNSelectable:e,isClusterCIDRIPv6:t})=>{let o=rs("ASSISTED_INSTALLER_NETWORK_TYPE_SELECTION_FEATURE"),{setFieldValue:r,values:s}=m5(),n=parseInt((s.clusterNetworkCidr||"").split("/")[1])||1,{t:i}=f(),a=p=>{isNaN(parseInt(p.target.value))&&r("clusterNetworkHostPrefix",n)},l=i(t?"ai:The subnet prefix length to assign to each individual node. For example, if Cluster Network Host Prefix is set to 116, then each node is assigned a /116 subnet out of the given cidr (clusterNetworkCIDR), which allows for 4,094 (2^(128 - 116) - 2) pod IPs addresses. If you are required to provide access to nodes from an external network, configure load balancers and routers to manage the traffic.":"ai:The subnet prefix length to assign to each individual node. For example, if Cluster Network Host Prefix is set to 23, then each node is assigned a /23 subnet out of the given cidr (clusterNetworkCIDR), which allows for 510 (2^(32 - 23) - 2) pod IPs addresses. If you are required to provide access to nodes from an external network, configure load balancers and routers to manage the traffic.");return wu.createElement(c5,{hasGutter:!0},wu.createElement(J,{name:"clusterNetworkCidr",label:i("ai:Cluster network CIDR"),helperText:i("ai:IP address block from which Pod IPs are allocated This block must not overlap with existing physical networks. These IP addresses are used for the Pod network, and if you need to access the Pods from an external network, configure load balancers and routers to manage the traffic."),isRequired:!0}),wu.createElement(J,{name:"clusterNetworkHostPrefix",label:i("ai:Cluster network host prefix"),type:u5.number,min:n,max:t?fa.IPv6:fa.IPv4,onBlur:p=>a(p),helperText:l,isRequired:!0}),wu.createElement(J,{name:"serviceNetworkCidr",label:i("ai:Service network CIDR"),helperText:i("ai:The IP address pool to use for service IP addresses. You can enter only one IP address pool. If you need to access the services from an external network, configure load balancers and routers to manage the traffic."),isRequired:!0}),o&&wu.createElement(Bf,{isSDNSelectable:e}))},zf=d5;import{Address6 as M5}from"ip-address";import La from"react";import{Alert as f5,AlertActionLink as g5,AlertVariant as h5,Popover as C5}from"@patternfly/react-core";var y5=({matchingSubnet:e,hosts:t})=>{let{t:o}=f(),r=t?.filter(n=>!["disabled","disconnected"].includes(n.status)&&!e.hostIDs.includes(n.requestedHostname||""))||[];if(r.length===0||!e.hostIDs.length)return null;let s=La.createElement(C5,{position:"right",bodyContent:La.createElement("ul",null,r.sort((n,i)=>n.requestedHostname?.localeCompare(i.requestedHostname||"")||0).map(n=>La.createElement("li",{key:n.id},n.requestedHostname||n.id))),minWidth:"30rem",maxWidth:"50rem"},La.createElement(g5,{id:"form-input-hostSubnet-field-helper-view-excluded"},o("ai:View {{count}} affected host",{count:r.length})));return La.createElement(f5,{title:o("ai:This subnet range is not available on all hosts"),variant:h5.warning,actionLinks:s,isInline:!0},o("ai:Hosts outside of this range will not be included in the new cluster."))},ev=({hostSubnets:e,hosts:t,isRequired:o=!1,isMultiNodeCluster:r})=>{let{t:s}=f(),n=a=>{let l=e.find(p=>p.subnet===a);if(l)return r&&La.createElement(y5,{matchingSubnet:l,hosts:t})},i=e.length;return La.createElement(es,{name:"hostSubnet",label:s("ai:Available subnets"),options:e.length?[{label:s("ai:Please select a subnet. ({{hostSubnetLength}} available)",{hostSubnetLength:i}),value:Ue,isDisabled:!0,id:"form-input-hostSubnet-field-option-no-subnet"},...e.sort((a,l)=>a.humanized.localeCompare(l.humanized)).map((a,l)=>({label:a.humanized,value:a.subnet,id:`form-input-hostSubnet-field-option-${l}`}))]:[{label:s("ai:No subnets are currently available"),value:Ue}],getHelperText:n,isDisabled:!e.length,isRequired:o})};import ln from"react";import{List as S5,ListItem as Wf,Text as v5,TextContent as I5}from"@patternfly/react-core";import{Trans as b5}from"react-i18next";var Du=({shouldDisplayLoadBalancersBullet:e=!1})=>{let{t}=f();return ln.createElement(I5,null,ln.createElement(v5,{component:"p"},ln.createElement(b5,{t},"ai:Please refer to the"," ",ln.createElement(tt,{href:Jh},"OpenShift networking documentation")," ","to configure your cluster's networking, including:")),ln.createElement(S5,null,ln.createElement(Wf,null,t("ai:DHCP or static IP Addresses")),ln.createElement(ae,{condition:e},ln.createElement(Wf,null,t("ai:Load balancers"))),ln.createElement(Wf,null,t("ai:Network ports")),ln.createElement(Wf,null,t("ai:DNS"))))};import tv from"react";import{FormGroup as T5}from"@patternfly/react-core";import Cw from"react";import{Tooltip as k5}from"@patternfly/react-core";var x5=({tooltipProps:e,...t})=>Cw.createElement(k5,{...e},Cw.createElement(ie,{...t})),bp=x5;var ov="managedNetworkingType",Eu=({disabled:e=!1,tooltip:t})=>{let o={hidden:!t||!e,content:t,position:"top"},{t:r}=f();return tv.createElement(T5,{label:r("ai:Network Management"),fieldId:E(ov,"radio"),isInline:!0},tv.createElement(bp,{tooltipProps:o,name:ov,isDisabled:e,value:"clusterManaged",label:r("ai:Cluster-Managed Networking")}),tv.createElement(bp,{tooltipProps:o,name:ov,isDisabled:e,value:"userManaged",label:r("ai:User-Managed Networking")}))};import at from"react";import{useFormikContext as P5}from"formik";import{Spinner as A5,Alert as w5,AlertVariant as D5}from"@patternfly/react-core";var yw=({vipName:e,cluster:t,validationErrorMessage:o})=>{let{vipDhcpAllocation:r,machineNetworkCidr:s}=t,{t:n}=f();return r&&t[e]?t[e]:r&&o?at.createElement(w5,{variant:D5.danger,title:n("ai:The DHCP server failed to allocate the IP"),isInline:!0},o):r&&s?at.createElement(at.Fragment,null,at.createElement(A5,{size:"md"}),at.createElement("i",null,n("ai:This IP is being allocated by the DHCP server"))):n("ai:<i>This IP will be allocated by the DHCP server</i>")},E5=(e,t,o,r)=>r?o&&t?e("ai:This IP was allocated by the DHCP server."):"":e("ai:Make sure that the VIP is unique and not used by any other device on your network."),F5=(e,t)=>{let o=G(t)||{},r=[e("ai:VIP IP allocation from DHCP server has been timed out"),e("ai:IP allocation from the DHCP server timed out.")];return(o.network||[]).reduce((s,n)=>(["api-vip-defined","ingress-vip-defined"].includes(n.id)&&(s[n.id]=n.status==="failure"&&r.find(i=>n.message.match(i))?n.message:void 0),s),{})},rv=({cluster:e,hostSubnets:t,isVipDhcpAllocationDisabled:o})=>{let{values:r}=P5(),{t:s}=f(),n=E5(s,e.apiVip,e.vipDhcpAllocation,r.vipDhcpAllocation),i=s("ai:Provide an endpoint for users, both human and machine, to interact with and configure the platform. If needed, contact your IT manager for more information. {{vipHelperSufix}}",{vipHelperSuffix:n}),a=s("ai:Provide an endpoint for application traffic flowing in from outside the cluster. If needed, contact your IT manager for more information. {{vipHelperSufix}}",{vipHelperSuffix:n}),{"api-vip-defined":l,"ingress-vip-defined":p}=at.useMemo(()=>F5(s,e.validationsInfo),[s,e.validationsInfo]);return at.createElement(at.Fragment,null,!o&&at.createElement(eo,{label:at.createElement(at.Fragment,null,s("ai:Allocate IPs via DHCP server"),at.createElement(ko,{featureId:"VIP_AUTO_ALLOC",openshiftVersion:e.openshiftVersion})),name:"vipDhcpAllocation"}),r.vipDhcpAllocation?at.createElement(at.Fragment,null,at.createElement(hi,{label:s("ai:API IP"),name:"apiVip",helperText:i,value:e.apiVip||"",isValid:!l,isRequired:!0},at.createElement(yw,{vipName:"apiVip",cluster:e,validationErrorMessage:l})),at.createElement(hi,{label:s("ai:Ingress IP"),name:"ingressVip",helperText:a,value:e.ingressVip||"",isValid:!p,isRequired:!0},at.createElement(yw,{vipName:"ingressVip",cluster:e,validationErrorMessage:p}))):at.createElement(at.Fragment,null,at.createElement(J,{label:s("ai:API IP"),name:"apiVip",helperText:i,isRequired:!0,isDisabled:!t.length||r.hostSubnet===Ue}),at.createElement(J,{name:"ingressVip",label:s("ai:Ingress IP"),helperText:a,isRequired:!0,isDisabled:!t.length||r.hostSubnet===Ue})))};var L5=({cluster:e,hostSubnets:t,isVipDhcpAllocationDisabled:o,defaultNetworkSettings:r,hideManagedNetworking:s,children:n})=>{let{t:i}=f(),{setFieldValue:a,values:l,touched:p,validateField:c}=N5(),u=!ne(e),m=M5.isValid(l.clusterNetworkCidr||""),{isIPv6:d,defaultNetworkType:g,isSDNSelectable:C}=$n.useMemo(()=>{let b=xc({machineNetworkCidr:e.machineNetworkCidr,clusterNetworkCidr:l.clusterNetworkCidr,serviceNetworkCidr:l.serviceNetworkCidr});return{isIPv6:b,defaultNetworkType:fi(!u,b),isSDNSelectable:kc(!u,b)}},[u,l.clusterNetworkCidr,e.machineNetworkCidr,l.serviceNetworkCidr]),[h,S]=$n.useState(UC(e,r,g)),v=b=>{S(b),b||(a("clusterNetworkCidr",r.clusterNetworkCidr),a("serviceNetworkCidr",r.serviceNetworkCidr),a("clusterNetworkHostPrefix",r.clusterNetworkHostPrefix),a("networkType",g))},y=l.managedNetworkingType==="userManaged",I=t[0]?.subnet;return sv(()=>{y&&u?l.hostSubnet!==Ue&&a("hostSubnet",Ue,!1):l.hostSubnet===Ue&&I&&a("hostSubnet",I,!1)},[y,u,l.hostSubnet,a,I]),sv(()=>{e.networkType?C||a("networkType",kn):a("networkType",fi(!u,d))},[d,u,a]),sv(()=>{if(y){let b=!!p.hostSubnet;a("vipDhcpAllocation",!1),a("ingressVip","",b),a("apiVip","",b)}else!l.vipDhcpAllocation&&p.hostSubnet&&(c("ingressVip"),c("apiVip"))},[p.hostSubnet,u,y,a,l.vipDhcpAllocation,c]),$n.createElement(H5,{hasGutter:!0},!s&&$n.createElement(Eu,{disabled:!!e.openshiftVersion}),y&&$n.createElement(Du,{shouldDisplayLoadBalancersBullet:u}),n,!(u&&y)&&$n.createElement(ev,{hostSubnets:t,hosts:e.hosts||[],isRequired:!y,isMultiNodeCluster:u}),!y&&$n.createElement(rv,{cluster:e,hostSubnets:t,isVipDhcpAllocationDisabled:o}),$n.createElement(V5,{id:"useAdvancedNetworking",label:i("ai:Use advanced networking"),description:i("ai:Configure advanced networking properties (e.g. CIDR ranges)."),isChecked:h,onChange:v,body:h&&$n.createElement(zf,{isSDNSelectable:C,isClusterCIDRIPv6:m})}))},Gf=L5;import{createElement as nv,memo as B5,useMemo as vw}from"react";import{ConnectedIcon as O5}from"@patternfly/react-icons";var _5=({obj:e})=>nv(zr,{host:e,AdditionalNTPSourcesDialogToggleComponent:nu}),R5=B5(({clusterDeployment:e,agentClusterInstall:t,agents:o,onEditHost:r,onEditRole:s})=>{let{t:n}=f(),i=vw(()=>Gt({clusterDeployment:e,agentClusterInstall:t,agents:o}),[e,t,o]),[a,l,p]=$o({agents:o},{onEditHost:r,onEditRole:s}),c=_r(t),u=vw(()=>c?[wt(n,l.onEditHost,a),gr({agents:o,onEditHostname:r,wizardStepId:"networking",t:n}),iu(i)]:[wt(n,l.onEditHost,a),Ut(n,l.canEditRole,l.onEditRole),gr({agents:o,onEditHostname:r,wizardStepId:"networking",t:n}),iu(i)],[c,r,a,o,l,i,n]),m=Be(a.length);return nv(Xe,{testId:"networking-host-table",hosts:a,ExpandComponent:_5,content:u,actionResolver:p,...m},nv(ot,{icon:O5,title:n("ai:Waiting for hosts..."),content:n("ai:Hosts may take a few minutes to appear here after booting.")}))}),Sw=R5;import{useFormikContext as X5}from"formik";import{Trans as J5}from"react-i18next";var av=uC,Z5=({clusterDeployment:e,agentClusterInstall:t,agents:o,onValuesChanged:r,infraEnvWithProxy:s,sameProxies:n,infraEnvsError:i,infraEnvsLoading:a,isPreviewOpen:l,onEditHost:p,onEditRole:c})=>{let{values:u,touched:m,setFieldValue:d,setFieldTouched:g}=X5();xw(()=>r?.(u),[r,u]);let[C,h]=Q5(!1),S=Gt({clusterDeployment:e,agentClusterInstall:t,agents:o}),v=e9(()=>wn(S),[S]),{t:y}=f();xw(()=>{!!s&&!m.enableProxy&&(d("enableProxy",!0,!1),n&&(d("httpProxy",s.spec?.proxy?.httpProxy,!1),d("httpsProxy",s.spec?.proxy?.httpsProxy,!1),d("noProxy",s.spec?.proxy?.noProxy,!1)))},[s,n,d,m.enableProxy,g]);let I=Fe(Gs,null);s&&(n?I=Fe(Tw,null,Fe(q5,{id:"edit-proxy",label:y("ai:Edit cluster-wide proxy settings"),onChange:h,isChecked:C,body:C&&Fe(Ql,null)})):I=Fe(Tw,null,Fe(Iw,null,Fe(iv,{component:"h2"},y("ai:Cluster-wide proxy")),Fe(iv,{component:$5.p},Fe(J5,{t:y,components:{bold:Fe("strong",null)},i18nKey:"ai:The hosts you selected are using different proxy settings. Configure a proxy that will be applied for these hosts. <bold>Configure at least one of the proxy settings below.</bold>"}))),Fe(Ql,null)));let b=cu(l);return Fe(W5,null,Fe(j5,{hasGutter:!0},Fe(Uf,null,Fe(G5,{hasGutter:!0},Fe(U5,{...b},Fe(Gf,{cluster:S,hostSubnets:v,isVipDhcpAllocationDisabled:!0,defaultNetworkSettings:av,hideManagedNetworking:!0})))),Fe(Uf,null,i?Fe(z5,{title:i,variant:"danger",isInline:!0}):a?Fe(Y5,{hasGutter:!0},Fe(bw,null,Fe(K5,{isSVG:!0,size:"md"})),Fe(bw,null,y("ai:Loading proxy configuration"))):I),Fe(Uf,null,Fe(Zl,{clusterSshKey:S.sshPublicKey})),Fe(Uf,null,Fe(Iw,null,Fe(iv,{component:"h2"},y("ai:Host inventory"))),Fe(Sw,{clusterDeployment:e,agentClusterInstall:t,agents:o,onEditHost:p,onEditRole:c}))))},kw=Z5;import Fu from"react";import{lazy as r9,object as s9}from"yup";var t9=e=>{let t=e.find(o=>o.spec?.proxy?.httpProxy||o.spec?.proxy?.httpsProxy||o.spec?.proxy?.noProxy);return{infraEnvWithProxy:t,sameProxies:e.every(o=>o.spec?.proxy?.httpProxy===t?.spec?.proxy?.httpProxy&&o.spec?.proxy?.httpsProxy===t?.spec?.proxy?.httpsProxy&&o.spec?.proxy?.noProxy===t?.spec?.proxy?.noProxy)}},o9=(e,t)=>r9(o=>s9().shape({clusterNetworkHostPrefix:Dn(o.clusterNetworkCidr),clusterNetworkCidr:pr(o.serviceNetworkCidr),serviceNetworkCidr:pr(o.clusterNetworkCidr),apiVip:ls(t,o,e.apiVip),ingressVip:ls(t,o,e.ingressVip),sshPublicKey:go,hostSubnet:Ia,httpProxy:Mo(o,"httpsProxy"),httpsProxy:Mo(o,"httpProxy"),noProxy:Fs})),Pw=({clusterDeployment:e,agentClusterInstall:t,agents:o})=>{let r=Fu.useMemo(()=>{let n=Gt({clusterDeployment:e,agentClusterInstall:t,agents:o});return{...US(n,av),enableProxy:!1,editProxy:!1}},[]),s=Fu.useMemo(()=>{let n=Gt({clusterDeployment:e,agentClusterInstall:t,agents:o}),i=wn(n);return o9(r,i)},[r,e,t,o]);return{initialValues:r,validationSchema:s}},Aw=({agents:e,fetchInfraEnv:t})=>{let[o,r]=Fu.useState(),[s,n]=Fu.useState(),{infraEnvWithProxy:i,sameProxies:a}=t9(o||[]),l=e.map(u=>({name:u.metadata?.labels?.[Co],namespace:u.metadata?.namespace})).filter(u=>u.name&&u.namespace).sort(),p=gy(l),{t:c}=f();return Fu.useEffect(()=>{(async()=>{r(void 0),n(void 0);let m=p.map(d=>t(d.name,d.namespace));try{let d=await Promise.all(m);r(d)}catch(d){n(d.message||c("ai:Could not fetch infra environments"))}})()},[p,t,r,n,c]),{infraEnvWithProxy:i,sameProxies:a,infraEnvsError:s,infraEnvsLoading:!o}};var c9=({clusterDeployment:e,agentClusterInstall:t,agents:o,onClose:r,fetchInfraEnv:s,onEditHost:n,onEditRole:i,isPreviewOpen:a})=>{let[l,p]=Et.useState(!1),[c,u]=Et.useState(!1),[m,d]=Et.useState(!1),{infraEnvWithProxy:g,infraEnvsError:C,infraEnvsLoading:h,sameProxies:S}=Aw({fetchInfraEnv:s,agents:o}),{isValid:v,isValidating:y,isSubmitting:I,validateForm:b,setTouched:k,errors:T,touched:w,values:F}=i9(),{setCurrentStepId:O}=Et.useContext(vo),V=qh(t,o),Y=()=>Na(e)?O("hosts-selection"):O("hosts-discovery"),he=async()=>{if(!l){let B=await b();if(k(Object.keys(B).reduce((Oe,It)=>(Oe[It]=!0,Oe),{})),p(!0),Object.keys(B).length)return}d(!0)};Et.useEffect(()=>{d(!1),u(!1)},[F.apiVip,F.ingressVip]),Et.useEffect(()=>{m&&(u(!0),V&&O("review"))},[m,V,O]);let Z=Et.useCallback(()=>d(!1),[]),x=uo(T,w),{t:P}=f(),A=Et.createElement(nn,{agentClusterInstall:t,agents:o,isSubmitting:I,isNextDisabled:m||I||(l?!v||y:!1),showClusterErrors:!x.length&&c,onBack:Y,onNext:he,onCancel:r,nextButtonText:"Next",onSyncError:Z},l&&!!x.length&&Et.createElement(a9,{variant:l9.danger,title:P("ai:Provided cluster configuration is not valid"),isInline:!0},P("ai:The following fields are invalid or missing"),":"," ",x.map(B=>ac(P)[B]||B).join(", "),"."));return Et.createElement(an,{footer:A},Et.createElement(p9,{hasGutter:!0},Et.createElement(ww,null,Et.createElement(De,null,P("ai:Networking"))),Et.createElement(ww,null,Et.createElement(kw,{clusterDeployment:e,agentClusterInstall:t,agents:o,sameProxies:S,infraEnvsError:C,infraEnvWithProxy:g,infraEnvsLoading:h,onEditHost:n,onEditRole:i,isPreviewOpen:a}))),Et.createElement(pa,null))},u9=({clusterDeployment:e,agentClusterInstall:t,agents:o,onSaveNetworking:r,...s})=>{let{addAlert:n}=M(),i=e?.metadata?.name,a=e?.metadata?.namespace,l=Et.useMemo(()=>o.filter(d=>lu(d,i,a)),[o,i,a]),{initialValues:p,validationSchema:c}=Pw({clusterDeployment:e,agentClusterInstall:t,agents:l}),{t:u}=f();return Et.createElement(n9,{initialValues:p,validationSchema:c,onSubmit:async d=>{try{await r(d)}catch(g){n({title:u("ai:Failed to save ClusterDeployment"),message:g instanceof Error?g.message:void 0})}}},Et.createElement(c9,{...s,agents:l,clusterDeployment:e,agentClusterInstall:t}))},Dw=u9;import mt from"react";import{array as Nu,boolean as G9,lazy as B9,number as W9,object as z9}from"yup";import{Formik as w9,useFormikContext as D9}from"formik";import{Alert as E9,AlertVariant as F9,Grid as N9,GridItem as Mw}from"@patternfly/react-core";import Ur from"react";import{useFormikContext as b9}from"formik";import{Grid as k9,GridItem as pv,TextContent as x9,Form as T9}from"@patternfly/react-core";import Gr from"react";import{Grid as m9,GridItem as lv}from"@patternfly/react-core";import{useFormikContext as d9}from"formik";var f9=({isSNOCluster:e,availableAgents:t})=>{let{setFieldValue:o}=d9(),{matchingAgents:r,selectedAgents:s,hostCount:n}=vf(t),{t:i}=f();return Gr.useEffect(()=>{n===3&&o("useMastersAsWorkers",!0)},[n,o]),Gr.createElement(Gr.Fragment,null,Gr.createElement(m9,{hasGutter:!0},Gr.createElement(lv,null,Gr.createElement(ns,{label:i("ai:Number of hosts"),labelIcon:Gr.createElement(Sf,null),idPostfix:"hostcount",name:"hostCount",isRequired:!0,minValue:e?1:Tu,maxValue:e?1:xu,isDisabled:e,formatValue:a=>a===4?n>=4?3:5:a})),Gr.createElement(lv,null,Gr.createElement(eo,{idPostfix:"mastersasworkers",name:"useMastersAsWorkers",label:i("ai:Run workloads on control plane hosts"),isDisabled:n<5})),Gr.createElement(lv,null,Gr.createElement(fp,{agents:t}))),Gr.createElement(yf,{matchingAgentsCount:r.length,selectedAgents:s,targetHostCount:n}))},Ew=f9;import Oa from"react";import{Alert as g9,AlertVariant as h9,List as C9,ListComponent as y9,ListItem as Fw}from"@patternfly/react-core";import{Link as S9}from"react-router-dom";import{Trans as v9}from"react-i18next";var I9=({cpuArchitecture:e})=>{let{t}=f();return Oa.createElement(g9,{variant:h9.warning,title:t("ai:No available hosts with {{cpuArchitecture}} architecture were found",{cpuArchitecture:e}),isInline:!0},t("ai:The cluster can not be installed yet because there are no available hosts with {{cpuArchitecture}} architecture found. To continue:",{cpuArchitecture:e}),Oa.createElement("br",null),Oa.createElement(C9,{component:y9.ol},Oa.createElement(Fw,null,Oa.createElement(v9,{t,cpuArchitecture:e},"ai:Add hosts with ",{cpuArchitecture:e}," architecture to an"," ",Oa.createElement(S9,{to:"/multicloud/infrastructure/environments"},"infrastructure environment"))),Oa.createElement(Fw,null,t("ai:Continue configuration by editing this cluster and utilize the newly added hosts"))))},Nw=I9;var P9=({agentClusterInstall:e,clusterDeployment:t,agents:o,aiConfigMap:r,onEditRole:s,onAutoSelectChange:n,onHostSelect:i,onSetInstallationDiskId:a})=>{let{values:l}=b9(),{autoSelectHosts:p}=l,c=_r(e),u=t?.metadata?.name,m=t?.metadata?.namespace,d=Rn(t),g=Ur.useMemo(()=>ps(o).filter(h=>h.spec.clusterDeploymentName?.name===u&&h.spec.clusterDeploymentName?.namespace===m||!h.spec.clusterDeploymentName?.name&&!h.spec.clusterDeploymentName?.namespace&&h.status?.inventory.cpu?.architecture===d),[o,m,u,d]),{t:C}=f();return Ur.createElement(k9,{hasGutter:!0},Ur.createElement(pv,null,Ur.createElement(x9,null,C(c?"ai:Exactly 1 host is required, capable of functioning both as control plane and worker node.":"ai:At least 3 hosts are required, capable of functioning as control plane nodes."))),r&&Ur.createElement(pv,null,Ur.createElement(Yd,{aiConfigMap:r,isSNOCluster:c})),Ur.createElement(pv,null,g.length?Ur.createElement(T9,null,Ur.createElement(Fr,{name:"autoSelectHosts",label:C("ai:Auto-select hosts"),onChange:n}),p&&Ur.createElement(Ew,{availableAgents:g,isSNOCluster:c}),!p&&Ur.createElement(Cf,{availableAgents:g,onEditRole:s,onHostSelect:i,onSetInstallationDiskId:a,cpuArchitecture:d})):Ur.createElement(Nw,{cpuArchitecture:d})))},Vw=P9;import{number as A9}from"yup";var Hw=e=>A9().min(Tu,e("ai:A cluster can have {{HOSTS_MIN_COUNT}} hosts at minimum.",{HOSTS_MIN_COUNT:Tu})).max(xu,e("ai:Maximum hosts count {{HOSTS_MAX_COUNT}} reached.",{HOSTS_MAX_COUNT:xu})).test("not-four",e("ai:A cluster needs 2 or more worker nodes."),t=>t!==4).required(e("ai:Required field"));var V9=({agents:e,clusterDeployment:t,agentClusterInstall:o})=>{let r=_r(o),s=t?.metadata?.name,n=t?.metadata?.namespace,i=(o?.spec?.provisionRequirements?.controlPlaneAgents||0)+(o?.spec?.provisionRequirements?.workerAgents||0);r?i=1:i===2||i===0?i=3:i===4&&(i=5);let a=eu(t?.metadata?.annotations),l=e.filter(c=>c.spec?.clusterDeploymentName?.name===s&&c.spec?.clusterDeploymentName?.namespace===n).map(c=>c.metadata?.uid);return{autoSelectHosts:a.autoSelect,hostCount:i,useMastersAsWorkers:i===1||i===3,agentLabels:a?.labels||[],locations:a?.locations||[],selectedHostIds:l,autoSelectedHostIds:l}},H9=e=>e===4?5:3,M9=(e,t)=>{let o=_r(e),r=({min:s})=>{let n=t("ai:Please select at least {{min}} hosts for the cluster",{min:s});return s===5?`${n} ${t("ai:or select just 3 hosts instead.")}`:`${n}.`};return B9(s=>z9().shape({hostCount:o?W9():Hw(t),useMastersAsWorkers:G9().required(t("ai:Required field")),autoSelectedHostIds:s.autoSelectHosts?Nu().min(s.hostCount).max(s.hostCount):Nu(),selectedHostIds:s.autoSelectHosts?Nu():o?Nu().min(1,t("ai:Please select one host for the cluster.")).max(1,t("ai:Please select one host for the cluster.")):Nu().min(H9(s.selectedHostIds.length),r)}))},L9=({agents:e,clusterDeployment:t,agentClusterInstall:o,t:r})=>{let s=mt.useMemo(()=>V9({agents:e,clusterDeployment:t,agentClusterInstall:o}),[o,e,t]),n=mt.useMemo(()=>M9(o,r),[o,r]);return[s,n]},O9=(e,t)=>{let o=t.autoSelectHosts?t.autoSelectedHostIds:t.selectedHostIds;return e.filter(r=>o.includes(r.metadata?.uid||""))},_9=({agents:e,agentClusterInstall:t,onClose:o,clusterDeployment:r,aiConfigMap:s,onEditRole:n,onSetInstallationDiskId:i})=>{let{setCurrentStepId:a}=mt.useContext(vo),[l,p]=mt.useState(!1),{values:c,isValid:u,isValidating:m,isSubmitting:d,touched:g,errors:C,validateForm:h,setTouched:S,submitForm:v,setSubmitting:y}=D9(),[I,b]=mt.useState(!1),[k,T]=mt.useState(!1),w=O9(e,c),{t:F}=f(),O=mt.useCallback(async(A,B)=>{b(!1),p(!1),y(!0);let Oe=await n?.(A,B);return y(!1),Oe},[n,y]),V=mt.useCallback(()=>{b(!1),p(!1),T(!1)},[]),Y=mt.useCallback(()=>{b(!1),p(!1)},[]),he=async()=>{if(!k){T(!0);let A=await h();if(S(Object.keys(A).reduce((B,Oe)=>(B[Oe]=!0,B),{})),Object.keys(A).length)return}v(),b(!0)};mt.useEffect(()=>{I&&!d&&(w.map(B=>qs(B,"hosts-selection",F).status.key).some(B=>["disconnected","disabled","error","insufficient","cancelled"].includes(B))?b(!1):!!w.length&&w.every(B=>qs(B,"hosts-selection",F).status.key==="known")&&(p(!0),Kh(t,w)&&a("networking")))},[I,w,t,a,d,F]);let Z;d?Z=F("ai:Saving changes..."):I&&!l&&(Z=F("ai:Binding hosts..."));let x=mt.useCallback(()=>b(!1),[]),P=mt.createElement(nn,{agentClusterInstall:t,agents:w,isSubmitting:!!Z,submittingText:Z,isNextDisabled:I||d||(k?!u||m:!1),onNext:he,onBack:()=>a("cluster-details"),onCancel:o,showClusterErrors:l,onSyncError:x},k&&C.selectedHostIds&&g.selectedHostIds&&mt.createElement(E9,{variant:F9.danger,title:F("ai:Provided cluster configuration is not valid"),isInline:!0},C.selectedHostIds));return mt.createElement(an,{footer:P},mt.createElement(N9,{hasGutter:!0},mt.createElement(Mw,null,mt.createElement(De,null,F("ai:Cluster hosts"))),mt.createElement(Mw,null,mt.createElement(Vw,{agentClusterInstall:t,agents:e,clusterDeployment:r,aiConfigMap:s,onEditRole:O,onSetInstallationDiskId:i,onAutoSelectChange:V,onHostSelect:Y}))))},R9=({onSaveHostsSelection:e,...t})=>{let{t:o}=f(),{addAlert:r}=M(),{agents:s,clusterDeployment:n,agentClusterInstall:i}=t,[a,l]=L9({agents:s,clusterDeployment:n,agentClusterInstall:i,t:o});return mt.createElement(w9,{initialValues:a,validationSchema:l,onSubmit:async(c,{setSubmitting:u})=>{try{await e(c)}catch(m){r({title:o("ai:Failed to save host selection."),message:m.message})}finally{u(!1)}}},mt.createElement(_9,{...t}))},Lw=R9;import Ft from"react";import Z9 from"lodash/uniq";import{Grid as Q9,GridItem as zw,Alert as eX,AlertVariant as tX,List as oX,ListItem as rX}from"@patternfly/react-core";import qe from"react";import{Grid as j9,GridItem as $f,TextContent as Rw,Text as cv}from"@patternfly/react-core";import X9 from"react-measure";import{Fragment as Y9,createElement as Sr,useMemo as q9,useState as Kf}from"react";import U9 from"lodash/noop";import{Stack as K9,StackItem as Ow}from"@patternfly/react-core";var $9=({agents:e,bareMetalHosts:t,infraEnv:o,onApprove:r,onChangeHostname:s,onChangeBMHHostname:n,onEditRole:i,onSetInstallationDiskId:a,onEditHost:l,onEditBMH:p,onDeleteHost:c,width:u})=>{let[m,d]=Kf(!1),[g,C]=Kf(!1),[h,S]=Kf(!1),[v,y]=Kf([]),{t:I}=f(),b=(P,A)=>{y(A?[...v,P.id]:v.filter(B=>B!==P.id))},[k,T,w]=$o({agents:e,bmhs:t,infraEnv:o},{onEditHost:l,onEditRole:i,onEditBMH:p,onDeleteHost:c,onSetInstallationDiskId:a}),F=u&&u>700,O=q9(()=>[wt(I,T.onEditHost),...F?[rf(e,t,I)]:[],gr({agents:e,bareMetalHosts:t,onEditHostname:l,onApprove:r,wizardStepId:"hosts-discovery",t:I}),Ut(I,T.canEditRole,T.onEditRole),...F?[Di,Go,Uo,yo]:[]],[e,T,t,r,l,F,I]),V=e.filter(P=>v.includes(P.metadata?.uid||"")),Y=[Sr(Kl,{key:"hostname",onChangeHostname:()=>C(!g)}),Sr(Df,{key:"approve",onApprove:()=>S(!h),selectedAgents:V})],he=async(P,A)=>{let B=e.find(Oe=>Oe.metadata?.uid===P.id);if(B)return s(B,A);{let Oe=t.find(It=>It.metadata?.uid===P.id);return Oe?n(Oe,A):U9}},Z=Be(k.length),x=k.map(P=>P.id);return Sr(Y9,null,Sr(K9,{hasGutter:!0},Sr(Ow,null,Sr(bi,{selectedIDs:v,itemIDs:x,setSelectedIDs:y,actions:Y,...Z})),Sr(Ow,null,Sr(Hi,{canEditDisks:T.canEditDisks,onDiskRole:T.onDiskRole},Sr(Xe,{hosts:k,content:O,actionResolver:w,selectedIDs:v,setSelectedIDs:y,onSelect:b,ExpandComponent:T.onDiskRole?vS:tn,...Z},Sr(lp,{setDiscoveryHintModalOpen:d}))))),m&&Sr(Ln,{isOpen:m,setDiscoveryHintModalOpen:d}),g&&Sr(ki,{isOpen:g,hosts:k,selectedHostIDs:v,onChangeHostname:he,onClose:()=>C(!1),canChangeHostname:af(e,t,I)}),h&&Sr(hp,{isOpen:h,agents:V,onApprove:r,onClose:()=>S(!1)}))},_w=$9;var J9=({agentClusterInstall:e,agents:t,bareMetalHosts:o,aiConfigMap:r,infraEnv:s,infraNMStates:n,usedHostnames:i,onSaveAgent:a,onEditRole:l,onSetInstallationDiskId:p,onSaveBMH:c,fetchSecret:u,onChangeBMHHostname:m,onApproveAgent:d,onDeleteHost:g,onFormSaveError:C,...h})=>{let[S,v]=qe.useState(!1),[y,I]=qe.useState(),[b,k]=qe.useState(),T=!0,w=_r(e),{t:F}=f();return qe.createElement(j9,{hasGutter:!0},qe.createElement($f,null,qe.createElement(Rw,null,qe.createElement(ep,{showAllInstructions:!0}))),qe.createElement(Ef,{infraEnv:s,agentClusterInstall:e,usedHostnames:i,...h}),qe.createElement($f,null,qe.createElement(Rw,null,qe.createElement(cv,{component:"h3"},F("ai:Information and warnings")),r&&qe.createElement(cv,{component:"p"},qe.createElement(Yd,{aiConfigMap:r,isSNOCluster:w})),qe.createElement(cv,{component:"p"},qe.createElement(Zc,{setDiscoveryHintModalOpen:v})),T&&qe.createElement(Ul,null))),qe.createElement($f,null,qe.createElement(tp,null)),qe.createElement($f,null,qe.createElement(X9,{bounds:!0},({measureRef:O,contentRect:V})=>qe.createElement("div",{ref:O},qe.createElement(_w,{agents:t,bareMetalHosts:o,infraEnv:s,onEditHost:k,onEditRole:l,onSetInstallationDiskId:p,onEditBMH:I,onChangeHostname:a,onChangeBMHHostname:m,onApprove:d,width:V.bounds?.width,onDeleteHost:g}))),qe.createElement(ff,{infraEnv:s,bmh:y,nmStates:n,isOpen:!!y,onClose:()=>I(void 0),onEdit:c,fetchSecret:u,usedHostnames:i||[]}),qe.createElement(pp,{isOpen:!!b,onClose:()=>k(void 0),usedHostnames:i,onFormSaveError:C,agent:b,onSave:a})),qe.createElement(Ln,{isOpen:S,setDiscoveryHintModalOpen:v}))},Bw=J9;var sX=({agentClusterInstall:e,agents:t,infraEnv:o,onSaveHostsDiscovery:r,onClose:s,...n})=>{let{t:i}=f(),{setCurrentStepId:a}=Ft.useContext(vo),[l,p]=Ft.useState(!1),[c,u]=Ft.useState(!1),[m,d]=Ft.useState(!1),g=Ft.useMemo(()=>t.filter(k=>au(o,k)),[t,o]),C=Ft.useMemo(()=>pu(g),[g]),h=[];_r(e)?g.length>1&&h.push(i("ai:Single node cluster cannot contain more than 1 host.")):(g.length===4||g.length<3)&&h.push(i("ai:Cluster must have 3 or 5 and more hosts.")),g.some(k=>!k.spec.approved)&&h.push(i("ai:All hosts must be approved.")),C.some(k=>k==="localhost")&&h.push(i("ai:Hostname localhost is forbidden.")),Z9(C).length!==C.length&&h.push(i("ai:Hostnames must be unique."));let S=g.map(k=>qs(k,"hosts-discovery",i).status.key).some(k=>["disconnected","disabled","error","insufficient","cancelled"].includes(k));S&&h.push(i("ai:Some hosts are not ready."));let v=async()=>{!m&&(d(!0),h.length)||(await r(),u(!0))};Ft.useEffect(()=>{u(!1),p(!1)},[g.length]),Ft.useEffect(()=>{c&&(S?u(!1):(p(!0),$h(e,g)&&a("networking")))},[c,g,e,a,S]);let y=c&&!l?i("ai:Saving changes..."):void 0,I=Ft.useCallback(()=>u(!1),[]),b=Ft.createElement(nn,{agentClusterInstall:e,agents:g,isSubmitting:!!y,submittingText:y,isNextDisabled:c||(m?!!h.length:!1),onNext:v,onBack:()=>a("cluster-details"),showClusterErrors:l,onSyncError:I,onCancel:s},m&&!!h.length&&Ft.createElement(eX,{variant:tX.danger,title:i("ai:Provided cluster configuration is not valid"),isInline:!0},Ft.createElement(oX,null,h.map(k=>Ft.createElement(rX,{key:k},k)))));return Ft.createElement(an,{footer:b},Ft.createElement(Q9,{hasGutter:!0},Ft.createElement(zw,null,Ft.createElement(De,null,i("ai:Cluster hosts"))),Ft.createElement(zw,null,Ft.createElement(Bw,{agentClusterInstall:e,agents:g,infraEnv:o,usedHostnames:C,...n}))))},Ww=sX;import qn from"react";var Gw={supportLevels:[{features:[{featureId:"VIP_AUTO_ALLOC",supportLevel:"dev-preview"},{featureId:"SNO",supportLevel:"unsupported"},{featureId:"ARM64_ARCHITECTURE",supportLevel:"unsupported"},{featureId:"ARM64_ARCHITECTURE_WITH_CLUSTER_MANAGED_NETWORKING",supportLevel:"unsupported"},{featureId:"SINGLE_NODE_EXPANSION",supportLevel:"unsupported"},{featureId:"LVM",supportLevel:"unsupported"},{featureId:"DUAL_STACK_NETWORKING",supportLevel:"unsupported"},{featureId:"MULTIARCH_RELEASE_IMAGE",supportLevel:"unsupported"},{featureId:"NUTANIX_INTEGRATION",supportLevel:"unsupported"}],openshiftVersion:"4.6"},{features:[{featureId:"DUAL_STACK_NETWORKING",supportLevel:"unsupported"},{featureId:"MULTIARCH_RELEASE_IMAGE",supportLevel:"unsupported"},{featureId:"NUTANIX_INTEGRATION",supportLevel:"unsupported"}],openshiftVersion:"4.7"},{features:[{featureId:"DUAL_STACK_NETWORKING",supportLevel:"supported"},{featureId:"VIP_AUTO_ALLOC",supportLevel:"dev-preview"},{featureId:"SNO",supportLevel:"dev-preview"},{featureId:"ARM64_ARCHITECTURE",supportLevel:"unsupported"},{featureId:"ARM64_ARCHITECTURE_WITH_CLUSTER_MANAGED_NETWORKING",supportLevel:"unsupported"},{featureId:"SINGLE_NODE_EXPANSION",supportLevel:"unsupported"},{featureId:"LVM",supportLevel:"unsupported"},{featureId:"MULTIARCH_RELEASE_IMAGE",supportLevel:"unsupported"},{featureId:"NUTANIX_INTEGRATION",supportLevel:"unsupported"}],openshiftVersion:"4.8"},{features:[{featureId:"SNO",supportLevel:"supported"},{featureId:"DUAL_STACK_NETWORKING",supportLevel:"supported"},{featureId:"VIP_AUTO_ALLOC",supportLevel:"dev-preview"},{featureId:"ARM64_ARCHITECTURE",supportLevel:"unsupported"},{featureId:"ARM64_ARCHITECTURE_WITH_CLUSTER_MANAGED_NETWORKING",supportLevel:"unsupported"},{featureId:"SINGLE_NODE_EXPANSION",supportLevel:"unsupported"},{featureId:"LVM",supportLevel:"unsupported"},{featureId:"MULTIARCH_RELEASE_IMAGE",supportLevel:"unsupported"},{featureId:"NUTANIX_INTEGRATION",supportLevel:"unsupported"}],openshiftVersion:"4.9"},{features:[{featureId:"SNO",supportLevel:"supported"},{featureId:"ARM64_ARCHITECTURE",supportLevel:"supported"},{featureId:"DUAL_STACK_NETWORKING",supportLevel:"supported"},{featureId:"VIP_AUTO_ALLOC",supportLevel:"dev-preview"},{featureId:"ARM64_ARCHITECTURE_WITH_CLUSTER_MANAGED_NETWORKING",supportLevel:"unsupported"},{featureId:"SINGLE_NODE_EXPANSION",supportLevel:"unsupported"},{featureId:"LVM",supportLevel:"unsupported"},{featureId:"MULTIARCH_RELEASE_IMAGE",supportLevel:"unsupported"},{featureId:"NUTANIX_INTEGRATION",supportLevel:"unsupported"}],openshiftVersion:"4.10"},{features:[{featureId:"SNO",supportLevel:"supported"},{featureId:"ARM64_ARCHITECTURE",supportLevel:"supported"},{featureId:"ARM64_ARCHITECTURE_WITH_CLUSTER_MANAGED_NETWORKING",supportLevel:"supported"},{featureId:"SINGLE_NODE_EXPANSION",supportLevel:"supported"},{featureId:"DUAL_STACK_NETWORKING",supportLevel:"supported"},{featureId:"MULTIARCH_RELEASE_IMAGE",supportLevel:"tech-preview"},{featureId:"VIP_AUTO_ALLOC",supportLevel:"dev-preview"},{featureId:"LVM",supportLevel:"dev-preview"},{featureId:"NUTANIX_INTEGRATION",supportLevel:"dev-preview"}],openshiftVersion:"4.11"},{features:[{featureId:"SNO",supportLevel:"supported"},{featureId:"ARM64_ARCHITECTURE",supportLevel:"supported"},{featureId:"ARM64_ARCHITECTURE_WITH_CLUSTER_MANAGED_NETWORKING",supportLevel:"supported"},{featureId:"SINGLE_NODE_EXPANSION",supportLevel:"supported"},{featureId:"LVM",supportLevel:"supported"},{featureId:"DUAL_STACK_NETWORKING",supportLevel:"supported"},{featureId:"NUTANIX_INTEGRATION",supportLevel:"supported"},{featureId:"MULTIARCH_RELEASE_IMAGE",supportLevel:"tech-preview"},{featureId:"VIP_AUTO_ALLOC",supportLevel:"dev-preview"}],openshiftVersion:"4.12"}]};var Uw=e=>e("ai:This option is not editable after the draft cluster is created"),nX=(e,t,o)=>{if(e)return Uw(o);if(!t)return o("ai:Single-Node OpenShift is not supported in this OpenShift version")},iX=(e,t,o,r,s)=>{if(e)return Uw(s);if(!r)return s("ai:arm64 is not supported in this OpenShift version")},Kw=(e,t,o,r,s,n)=>{switch(e){case"SNO":return nX(t,s,n);case"ARM64_ARCHITECTURE":return iX(t,o,r,s,n);default:return}},$w=e=>e!=="unsupported";var aX=()=>{try{let e={};return Gw.supportLevels.forEach(t=>{let o={};t.features.forEach(s=>{o[s.featureId]=s.supportLevel}),e[t.openshiftVersion]=o}),e}catch(e){return console.error(e),{}}},lX=({children:e,clusterImages:t,isEditClusterFlow:o=!1})=>{let{t:r}=f(),s=qn.useMemo(()=>aX(),[]),n=Js(t),i=qn.useCallback(d=>{let g=t.find(h=>h.metadata?.name===d),C=sp(g?.spec?.releaseImage)||g?.metadata?.name||"";return tS(C)},[t]),a=qn.useCallback(d=>{let g=i(d);return g?s[g]:{}},[s,i]),l=qn.useCallback((d,g)=>{let C=a(d);return C?C[g]:void 0},[a]),p=qn.useCallback((d,g)=>{let C=l(d,g);return $w(C)},[l]),c=qn.useCallback((d,g)=>{let C=p(d,g);return Kw(g,o,d,n,C,r)},[p,r,n,o]),u=qn.useCallback((d,g)=>!!c(d,g),[c]),m=qn.useMemo(()=>({getVersionSupportLevelsMap:a,getFeatureSupportLevel:l,isFeatureDisabled:u,getFeatureDisabledReason:c,isFeatureSupported:p}),[a,l,u,c,p]);return qn.createElement(Wm,{value:m},e)},qf=lX;import{Grid as pX,GridItem as qw}from"@patternfly/react-core";import{createElement as $t,useContext as uX,useMemo as jw,useState as mX}from"react";var cX=({agentClusterInstall:e,agents:t,onClose:o,onFinish:r,clusterDeployment:s,clusterImages:n,infraEnv:i})=>{let{addAlert:a,clearAlerts:l}=M(),{setCurrentStepId:p}=uX(vo),[c,u]=mX(!1),m=()=>p("networking"),d=s.metadata?.name,g=s.metadata?.namespace,C=Rn(s,i),h=jw(()=>t.filter(T=>lu(T,d,g)),[t,d,g]),S=Yh(e,h),{t:v}=f(),I=$t(nn,{agentClusterInstall:e,agents:h,isSubmitting:c,isNextDisabled:c||!S,onBack:m,onNext:async()=>{l(),u(!0);try{await r()}catch(T){a({title:T.message||v("ai:An error occured while starting installation.")})}finally{u(!1)}},onCancel:o,nextButtonText:v("ai:Install cluster")}),b=tu(n,e),k=jw(()=>Gt({clusterDeployment:s,agentClusterInstall:e,agents:h}),[s,e,h]);return $t(an,{footer:I},$t(pX,{hasGutter:!0},$t(qw,null,$t(De,null,"Review and create")),$t(qw,null,$t(bt,null,$t(N,{title:v("ai:Cluster address"),value:`${s.metadata?.name}.${s.spec?.baseDomain}`,testId:"cluster-address"}),$t(N,{title:v("ai:OpenShift version"),value:b,testId:"openshift-version"}),$t(N,{title:v("ai:CPU architecture"),value:C,testId:"cpu-architecture"}),$t(N,{title:v("ai:API IP"),value:e.spec?.apiVIP,testId:"api-vip"}),$t(N,{title:v("ai:Ingress IP"),value:e.spec?.ingressVIP,testId:"ingress-vip"}),$t(N,{title:v("ai:Cluster summary"),testId:"cluster-summary",value:$t($c,{hosts:k.hosts})}),$t(N,{title:v("ai:Cluster validations"),value:$t(qc,{validationsInfo:k.validationsInfo,setCurrentStepId:p,wizardStepNames:Ip(v),wizardStepsValidationsMap:Dr}),testId:"cluster-validations"}),$t(N,{title:v("ai:Host validations"),value:$t(Yc,{hosts:k.hosts,setCurrentStepId:p,wizardStepNames:Ip(v),allClusterWizardSoftValidationIds:Uh,wizardStepsValidationsMap:Dr}),testId:"host-validations"})))))},Yw=cX;import{createElement as Jo,useCallback as Jw}from"react";import dX from"react-monaco-editor";import fX from"react-measure";import{Alert as gX,AlertActionCloseButton as hX,ClipboardCopyButton as CX,Stack as yX,StackItem as Xw}from"@patternfly/react-core";var SX={readOnly:!0,scrollBeyondLastLine:!1},vX={base:"vs",inherit:!0,rules:[{background:"e0e0e0"},{token:"number",foreground:"000000"},{token:"type",foreground:"000000"},{token:"string",foreground:"000000"},{token:"keyword",foreground:"0451a5"}],colors:{"editor.background":"#e0e0e0","editorGutter.background":"#e0e0e0","editorLineNumber.activeForeground":"#000000","editorLineNumber.foreground":"#000000"}},IX=({children:e,code:t,setPreviewOpen:o,loading:r})=>{let s=Jw(a=>{a.layout(),a.focus()},[]),n=Jw(a=>{a.editor.defineTheme("acm-console",vX)},[]),{t:i}=f();return r?Jo(z,{content:"Loading resources"}):Jo(yX,null,Jo(Xw,null,Jo("div",null,Jo(gX,{isInline:!0,title:i("ai:The resource has been saved and the YAML is now read only."),variant:"info",actionClose:Jo(hX,{onClose:()=>o(!1)})}),Jo("div",{className:"readonly-editor-bar"},Jo("div",null,e),Jo(CX,{variant:"plain",id:"copy",textId:"copy",onClick:()=>navigator.clipboard.writeText(t)},Jo("div",null))))),Jo(Xw,{isFilled:!0},Jo(fX,{bounds:!0},({measureRef:a,contentRect:l})=>Jo("div",{ref:a,style:{height:"100%"}},!!l.bounds?.height&&Jo(dX,{language:"yaml",theme:"acm-console",height:l.bounds?.height,value:t,options:SX,editorDidMount:s,editorWillMount:n})))))},uv=IX;import bX from"lodash/cloneDeep";import{useEffect as TX,useMemo as PX,useState as Yf}from"react";import{dump as xX}from"js-yaml";var kX=e=>{if(!e)return;let t=bX(e);return delete t.status,t.metadata={name:t.metadata?.name,namespace:t.metadata?.namespace,labels:t.metadata?.labels},xX(t)},mv=({clusterDeployment:e,agentClusterInstall:t,fetchSecret:o,fetchManagedClusters:r,fetchKlusterletAddonConfig:s})=>{let[n,i]=Yf(!0),[a,l]=Yf(),[p,c]=Yf(),[u,m]=Yf(),d=e.metadata?.name,g=e.metadata?.namespace,C=e.spec?.pullSecretRef?.name;return TX(()=>{(async()=>{let v=await Promise.allSettled([o(g||"",C||""),r(),s()]),[y,I,b]=v;y.status==="fulfilled"&&l(y.value),I.status==="fulfilled"&&c(I.value.find(k=>k.metadata?.labels?.name===d)),b.status==="fulfilled"&&m(b.value.find(k=>k.spec.clusterName===d&&k.spec.clusterNamespace===g)),i(!1)})()},[o,g,d,C,r,s]),{code:PX(()=>[e,t,a,p,u].map(kX).filter(S=>!!S).join(`
23
+ ---
24
+ `),[e,t,a,p,u]),loadingResources:n}};var DX=({className:e,onSaveDetails:t,onSaveNetworking:o,onSaveHostsSelection:r,onClose:s,onFinish:n,hostActions:i,usedClusterNames:a,fetchSecret:l,clusterDeployment:p,agentClusterInstall:c,agents:u,clusterImages:m,aiConfigMap:d,infraEnv:g,fetchInfraEnv:C,initialStep:h,isPreviewOpen:S,setPreviewOpen:v,fetchManagedClusters:y,fetchKlusterletAddonConfig:I,onSaveISOParams:b,onCreateBMH:k,...T})=>{let[w,F]=EX(h||"cluster-details"),O=g,{code:V,loadingResources:Y}=mv({agentClusterInstall:c,clusterDeployment:p,fetchSecret:l,fetchManagedClusters:y,fetchKlusterletAddonConfig:I}),he=()=>{switch(p?w:"cluster-details"){case"hosts-selection":return c?.metadata?.name?Io(Lw,{clusterDeployment:p,agentClusterInstall:c,onClose:s,onSaveHostsSelection:r,agents:u,aiConfigMap:d,onEditRole:i.onEditRole,onSetInstallationDiskId:i.onSetInstallationDiskId}):Io(z,null);case"hosts-discovery":return O?b&&k?Io(Ww,{clusterDeployment:p,agentClusterInstall:c,agents:u,bareMetalHosts:[],aiConfigMap:d,infraEnv:g,fetchSecret:l,onClose:s,onChangeBMHHostname:(x,P)=>(console.log("onChangeBMHHostname is not implemented: ",P),Promise.resolve(x)),onEditRole:i.onEditRole,onSetInstallationDiskId:i.onSetInstallationDiskId,onDeleteHost:i.onDeleteHost,onSaveISOParams:b,onCreateBMH:k,...T}):Io(z,null):Io(z,null);case"networking":return Io(Dw,{clusterDeployment:p,agentClusterInstall:c,agents:u,onSaveNetworking:o,onClose:s,onEditHost:i.onEditHost,onEditRole:i.onEditRole,fetchInfraEnv:C,isPreviewOpen:S});case"review":return Io(Yw,{onFinish:n,clusterDeployment:p,agentClusterInstall:c,agents:u,onClose:s,clusterImages:m,infraEnv:g});case"cluster-details":default:return Io(hw,{clusterImages:m,usedClusterNames:a,clusterDeployment:p,agentClusterInstall:c,agents:u,onSaveDetails:t,onClose:s,isPreviewOpen:S,infraEnv:g})}};return Io(wX,{style:{height:"100%"}},Io(Zw,{span:S?7:12},Io(ur,null,Io(qf,{clusterImages:m,isEditClusterFlow:!0},Io(vo.Provider,{value:{currentStepId:w,setCurrentStepId:F,clusterDeployment:p}},Io("div",{className:AX("pf-c-wizard",e)},he()))))),S&&Io(Zw,{span:5},Io(uv,{code:V,setPreviewOpen:v,loading:Y},`${p.metadata?.name||""} cluster`)))},Qw=DX;import kp from"react";import{GridItem as FX,Alert as NX,AlertVariant as VX,AlertActionLink as eD}from"@patternfly/react-core";var tD=e=>`cluster-install-error-${e}`,HX=({agentClusterInstall:e})=>{let[t,o]=Wt(e),{t:r}=f(),s=r(t==="cancelled"?"ai:Cluster installation was cancelled":"ai:Cluster installation failed");return kp.createElement(FX,null,kp.createElement(NX,{variant:VX.danger,title:s,actionLinks:kp.createElement(kp.Fragment,null,kp.createElement(GS,{id:tD("button-download-installation-logs"),Component:eD,agentClusterInstall:e}),kp.createElement(eD,{onClick:()=>window.open(nc(),"_blank"),id:tD("button-report-bug")},r("ai:Report a bug"))),isInline:!0},To(o)))},oD=HX;import{Formik as MX,useFormikContext as LX}from"formik";import OX from"lodash/noop";import{createElement as dv,useEffect as sD,useRef as BX}from"react";var _X=({onValuesChanged:e,clusterDeployment:t,agentClusterInstall:o,clusterImages:r,pullSecret:s,extensionAfter:n})=>{let{values:i}=LX(),a=BX(!0);return sD(()=>e(i,a.current),[e,i]),sD(()=>{a.current=!1},[]),dv(Rf,{clusterDeployment:t,agentClusterInstall:o,clusterImages:r,pullSecret:s,extensionAfter:n})},RX=({clusterDeployment:e,agentClusterInstall:t,clusterImages:o,formRef:r,onValuesChanged:s,usedClusterNames:n,agents:i,defaultBaseDomain:a,pullSecret:l,extensionAfter:p})=>{let[c,u]=ZS({clusterDeployment:e,agentClusterInstall:t,clusterImages:o,usedClusterNames:n,agents:i,defaultBaseDomain:a,pullSecret:l});return dv(MX,{initialValues:c,validate:mo(u),innerRef:r,onSubmit:OX},dv(_X,{clusterDeployment:e,agentClusterInstall:t,onValuesChanged:s,clusterImages:o,pullSecret:l,extensionAfter:p}))},rD=RX;import{Fragment as cD,createElement as qt}from"react";import{CheckCircleIcon as zX}from"@patternfly/react-icons";import{global_palette_green_500 as WX}from"@patternfly/react-tokens/dist/js/global_palette_green_500";import{Bullseye as GX,Button as nD,EmptyState as UX,EmptyStateBody as iD,EmptyStateIcon as aD,EmptyStateSecondaryActions as KX,Spinner as $X,Title as lD}from"@patternfly/react-core";var qX=e=>qt(zX,{...e,color:WX.value}),YX=({agentClusterInstall:e,toDetails:t,toListView:o})=>{let{t:r}=f();return qt(GX,null,qt(UX,null,uS(e)?qt(cD,null,qt(aD,{icon:qX}),qt(lD,{headingLevel:"h4",size:"lg"},r("ai:Cluster is ready for installation")),qt(iD,null,qt("div",null,r("ai:This cluster has been created and is ready to begin installation.")),qt("div",null,r("ai:To see the status of the installation see the details page.")))):qt(cD,null,qt(aD,{icon:$X}),qt(lD,{headingLevel:"h4",size:"lg"},r("ai:Preparing cluster installation")),qt(iD,null,qt("div",null,r("ai:This cluster is in the process of getting ready to start installation.")),qt("div",null,r("ai:If you exit this flow you can see its status in the list view or details page.")))),qt(KX,null,qt(nD,{variant:"primary",onClick:t},r("ai:See cluster details")),qt(nD,{variant:"link",onClick:o},r("ai:Go to cluster list")))))},pD=YX;import{createElement as fv,useMemo as mD}from"react";import{ConnectedIcon as jX}from"@patternfly/react-icons";var XX=()=>{let{t:e}=f();return fv(ot,{icon:jX,title:e("ai:Waiting for hosts..."),content:e("ai:Hosts may take a few minutes to appear here after booting.")})},JX=({agents:e,agentClusterInstall:t,className:o,onUnbindHost:r})=>{let{t:s}=f(),n=mD(()=>[t],[t]),[i,a,l]=$o({agents:e,agentClusterInstalls:n},{onUnbindHost:r}),p=mD(()=>[wt(s,a.onEditHost),Ut(s),gr({agents:e,t:s}),ap(e,s),JT(s),Go,Uo,yo],[e,a,s]),c=Be(e.length);return fv(Xe,{hosts:i,content:p,actionResolver:l,className:o,ExpandComponent:tn,...c},fv(XX,null))},uD=JX;import{Formik as s7}from"formik";import n7 from"lodash/noop";import{createElement as SD,useMemo as yD}from"react";import{object as l7}from"yup";import{useMemo as ZX}from"react";var dD=e=>e.find(t=>t.metadata?.labels?.["hypershift.openshift.io/supported-versions"]==="true"),fD=(e,t)=>ZX(()=>{let o=Js(e),r=t?.data?.["supported-versions"];if(r)try{let s=JSON.parse(r).versions;return o.filter(n=>s.find(i=>n.version.startsWith(i)))}catch(s){console.error("Could not parse supported versions config map value.",U(s))}return o},[e,t]);import{Form as QX}from"@patternfly/react-core";import{useFormikContext as e7}from"formik";import{createElement as Tp,useEffect as r7,useRef as o7}from"react";import{useEffect as gv,useRef as gD}from"react";var xp=({values:e,onValuesChanged:t})=>{let o=gD(!0);gv(()=>t(e,o.current),[t,e]),gv(()=>{o.current=!1},[]);let r=gD();gv(()=>{r.current?.focus()},[])};var t7=({onValuesChanged:e,extensionAfter:t,ocpVersions:o})=>{let{values:r}=e7();xp({values:r,onValuesChanged:e});let s=o7();r7(()=>{s.current?.focus()},[]);let{t:n}=f();return Tp(QX,null,Tp(J,{ref:s,label:n("ai:Cluster name"),name:"name",placeholder:n("ai:Enter cluster name"),isRequired:!0}),t?.name&&t.name,Tp(J,{label:n("ai:Base domain"),name:"baseDnsDomain",helperText:Tp(_f,{name:r.name,baseDnsDomain:r.baseDnsDomain}),placeholder:"example.com",isRequired:!0}),Tp(Jl,{versions:o}),Tp(wa,null))},hD=t7;var i7=({ocpVersions:e,usedClusterNames:t,initPullSecret:o="",initBaseDomain:r=""})=>{let{t:s}=f(),n=yD(()=>({name:"",openshiftVersion:ml(e),pullSecret:o,baseDnsDomain:r}),[]),i=yD(()=>l7({name:Al(s,t),baseDnsDomain:ba.required("Required"),pullSecret:ws.required("Required.")}),[t,s]);return[n,i]},a7=({usedClusterNames:e,clusterImages:t,onValuesChanged:o,extensionAfter:r,formRef:s,initBaseDomain:n,initPullSecret:i,supportedVersionsCM:a})=>{let l=fD(t,a),[p,c]=i7({ocpVersions:l,usedClusterNames:e,initPullSecret:i,initBaseDomain:n});return SD(s7,{initialValues:p,validationSchema:c,innerRef:s,onSubmit:n7},SD(hD,{onValuesChanged:o,ocpVersions:l,extensionAfter:r}))},CD=a7;import{createElement as Vu}from"react";import{array as G7,lazy as W7,number as U7,object as wD,string as Jf}from"yup";import{Formik as O7}from"formik";import _7 from"lodash/noop";import{Stack as R7,StackItem as PD}from"@patternfly/react-core";import{Fragment as L7,createElement as Zo}from"react";import{FieldArray as w7,useFormikContext as D7}from"formik";import{PlusCircleIcon as E7}from"@patternfly/react-icons";import{Alert as F7,Button as N7,Form as V7,Grid as H7,GridItem as Xf}from"@patternfly/react-core";import{Button as m7,Divider as d7,ExpandableSectionToggle as f7,Flex as g7,FlexItem as hv,Label as h7,Level as C7,LevelItem as ID,Split as y7,SplitItem as bD,Stack as S7,StackItem as kD}from"@patternfly/react-core";import{Fragment as A7,createElement as dt,useEffect as P7,useMemo as T7,useState as x7}from"react";import{TrashIcon as v7}from"@patternfly/react-icons";import I7 from"lodash/isMatch";import{useFormikContext as b7}from"formik";import{Grid as p7,GridItem as vD}from"@patternfly/react-core";import{Fragment as u7,createElement as _a}from"react";var c7=({agents:e,labelName:t,countName:o,maxAgents:r,isEdit:s})=>{let{t:n}=f();return _a(p7,{hasGutter:!0},!s&&_a(vD,null,_a(LP,{agents:e,name:t})),_a(vD,null,_a(ns,{label:n("ai:Number of hosts"),idPostfix:"count",name:o,isRequired:!0,minValue:0,maxValue:r,helperText:_a(u7,null,n("ai:Maximum availability {{maxAgents}}",{maxAgents:r})," ",_a(H,{bodyContent:n("ai:Maximum availability is based on the number of hosts available in a given namespace. The number changes dynamically depending on the filtering labels added above.")}))})))},jf=c7;var k7=({infraEnvs:e,agents:t,index:o,onRemove:r})=>{let{t:s}=f(),{values:n}=b7(),{setValue:i}=gf(`nodePools[${o}].count`),[a,l]=x7(!0),p=T7(()=>{let h=e.find(S=>S.metadata?.namespace===n.agentNamespace);return t.filter(S=>au(h,S))},[e,t,n.agentNamespace]),{agentLabels:c}=n.nodePools[o],u=ps(p),m=u.filter(h=>{let S=c.reduce((v,{key:y,value:I})=>(v[y]=I,v),{});return I7(h.metadata?.labels||{},S)&&!h.spec.clusterDeploymentName?.name&&!h.spec.clusterDeploymentName?.namespace}),d=0;for(let h=0;h<o;h++)d+=n.nodePools[h].count;let g=Math.max(0,Math.min(m.length,u.length-d)),C=n.nodePools[o].count;return P7(()=>{C>g&&i(g)},[g,i,C]),dt(S7,{hasGutter:!0},dt(kD,null,dt(C7,{hasGutter:!0},dt(ID,null,dt(g7,{alignItems:{default:"alignItemsCenter"},spaceItems:{default:"spaceItemsMd"},flexWrap:{default:"wrap"}},dt(hv,null,dt(y7,{className:"ai-node-pool__header"},dt(bD,null,dt(f7,{className:"ai-node-pool__expandable-button",isExpanded:a,onToggle:l})),dt(bD,null,dt(Cc,{name:`nodePools.${o}.name`,isRequired:!0,showErrorMessage:!1})))),!a&&dt(A7,null,dt(hv,null,dt(d7,{isVertical:!0})),dt(hv,null,dt(h7,{variant:"outline"},s("ai:{{count}} filtering label",{count:n.nodePools[o].agentLabels.length})))))),o!==0&&dt(ID,null,dt(m7,{variant:"link",icon:dt(v7,null),onClick:r})))),a&&dt(kD,{className:"ai-node-pool__section"},dt(jf,{agents:p,countName:`nodePools.${o}.count`,labelName:`nodePools.${o}.agentLabels`,maxAgents:g})))},xD=k7;var M7=({onValuesChanged:e,infraEnvs:t,agents:o,clusterName:r,initReleaseImage:s})=>{let{values:n}=D7();xp({values:n,onValuesChanged:e});let{t:i}=f(),a=t.length?t.map(p=>({label:p.metadata?.namespace||"",value:p.metadata?.namespace||""})):[{label:i("ai:No namespace with hosts is available"),value:"NOT_AVAILABLE"}],l=n.nodePools.reduce((p,c)=>(p+=c.count,p),0);return Zo(V7,null,Zo(H7,{hasGutter:!0},Zo(Xf,null,Zo(es,{label:i("ai:Namespace"),name:"agentNamespace",options:a,isRequired:!0,isDisabled:!t.length,labelIcon:Zo(H,{position:"right",bodyContent:i("ai:Choose a namespace from your existing host inventory in order to select hosts for your node pools. The namespace will be composed of 1 or more infrastructure environments. After the cluster is created, a host will become a worker node.")})})),l===0&&Zo(Xf,null,Zo(F7,{isInline:!0,variant:"warning",title:i("ai:The cluster has 0 hosts. No workloads will be able to run.")})),Zo(w7,{name:"nodePools"},({remove:p,push:c})=>Zo(L7,null,n.nodePools.map((u,m)=>Zo(Xf,{key:m},Zo(xD,{index:m,agents:o,infraEnvs:t,onRemove:()=>p(m)}))),Zo(Xf,null,Zo(N7,{variant:"link",icon:Zo(E7,null),iconPosition:"right",onClick:()=>{let u=`nodepool-${r}-${pb(5)}`;c({name:u,count:1,agentLabels:[],releaseImage:s,clusterName:r})}},i("ai:Add Nodepool")))))))},TD=M7;var B7=(e,t,o)=>W7(r=>wD().shape({agentNamespace:Jf().required(o("ai:Required field")),nodePools:G7().of(wD().shape({name:Jf().required(o("ai:Required field")).test(o("ai:Must be unique"),o("ai:Must be unique"),s=>s?r.nodePools.filter(({name:n})=>n===s).length===1&&!t.some(({metadata:n})=>n?.name===s&&n?.namespace===e):!0),clusterName:Jf().required(o("ai:Required field")),count:U7(),releaseImage:Jf().required(o("ai:Required field"))}).required(o("ai:Required field")))})),z7=({formRef:e,onValuesChanged:t,infraEnvs:o,agents:r,clusterName:s,initInfraEnv:n,initNodePools:i,initReleaseImage:a,nodePools:l})=>{let{t:p}=f(),c=ps(r),u=o.filter(m=>c.some(d=>d.metadata?.labels?.[Co]===m.metadata?.name&&d.metadata?.namespace===m.metadata?.namespace&&!d.spec.clusterDeploymentName));return Vu(R7,{hasGutter:!0},Vu(PD,null,p("ai:Define the quantity of worker nodes and nodepools to create for your cluster. Additional worker nodes and nodepools can be added after the cluster is created.")),Vu(PD,null,Vu(O7,{initialValues:{agentNamespace:n||u[0]?.metadata?.namespace||"",nodePools:i||[{name:`nodepool-${s}-1`,count:1,agentLabels:[],releaseImage:a,clusterName:s}]},validationSchema:B7(s,l,p),innerRef:e,onSubmit:_7},Vu(TD,{onValuesChanged:t,infraEnvs:u,agents:r,clusterName:s,initReleaseImage:a}))))},AD=z7;import{createElement as ND}from"react";import{Formik as X7}from"formik";import J7 from"lodash/noop";import{lazy as eJ,number as oJ,object as tJ,string as Cv}from"yup";import{createElement as Yt}from"react";import{Form as K7,FormGroup as $7,Grid as DD,GridItem as Zf}from"@patternfly/react-core";import{useFormikContext as q7}from"formik";import{Address6 as Y7}from"ip-address";var j7=({onValuesChanged:e})=>{let{values:t}=q7();xp({values:t,onValuesChanged:e});let o=Y7.isValid(t.clusterNetworkCidr||""),{t:r}=f();return Yt(K7,null,Yt($7,{label:r("ai:API server publishing strategy")},Yt(DD,{hasGutter:!0},Yt(Zf,null,Yt(ie,{name:"apiPublishingStrategy",label:"LoadBalancer",value:"LoadBalancer",description:r("ai:Exposes the service externally using a cloud provider's load balancer")})),Yt(Zf,null,Yt(ie,{name:"apiPublishingStrategy",label:"NodePort",value:"NodePort",className:"ai-nodeport-fields",description:r("ai:Exposes the service on each node's IP at a static port"),body:t.apiPublishingStrategy==="NodePort"&&Yt(DD,{hasGutter:!0},Yt(Zf,null,Yt(J,{isRequired:!0,name:"nodePortAddress",label:r("ai:Host address"),labelIcon:Yt(H,{position:"right",bodyContent:r("ai:Address is the host/ip that the NodePort service is exposed over.")})})),Yt(Zf,null,Yt(ns,{label:r("ai:Host port"),idPostfix:"nodePortPort",name:"nodePortPort",minValue:0,maxValue:65535,labelIcon:Yt(H,{position:"right",bodyContent:r("ai:Port of the NodePort service. If set to 0, the port is dynamically assigned when the service is created.")})})))})))),Yt(eo,{name:"isAdvanced",label:r("ai:Use advanced networking"),className:"ai-advanced-fields",body:t.isAdvanced&&Yt(zf,{isSDNSelectable:!1,isClusterCIDRIPv6:o}),helperText:r("ai:Configure advanced networking properties (e.g. CIDR ranges).")}),Yt(Gs,null),Yt(Ws,{isRequired:!0}))},ED=j7;var Z7=e=>eJ(t=>tJ().shape({sshPublicKey:go.required(e("ai:Required field")),clusterNetworkCidr:t.isAdvanced?pr(t.serviceNetworkCidr):Cv(),serviceNetworkCidr:t.isAdvanced?pr(t.clusterNetworkCidr):Cv(),clusterNetworkHostPrefix:t.isAdvanced?Dn(t.clusterNetworkCidr):oJ(),httpProxy:Mo(t,"httpsProxy"),httpsProxy:Mo(t,"httpProxy"),noProxy:Fs,nodePortAddress:t.apiPublishingStrategy==="NodePort"?Dl.required(e("ai:Required field")):Cv()})),Q7=({formRef:e,onValuesChanged:t,initialValues:o})=>{let{t:r}=f();return ND(X7,{initialValues:o,validationSchema:Z7(r),innerRef:e,onSubmit:J7},ND(ED,{onValuesChanged:t}))},FD=Q7;import{Fragment as gZ,createElement as $,useState as ng}from"react";import{Link as sZ}from"react-router-dom";import{Button as nZ,Label as iZ,Popover as aZ,Stack as lZ,StackItem as rE}from"@patternfly/react-core";import{PlusCircleIcon as pZ}from"@patternfly/react-icons";import{breakWord as Vje,expandable as Hje,sortable as Mje,TableComposable as cZ,Tbody as uZ,Td as ao,Th as Yn,Thead as mZ,Tr as bv}from"@patternfly/react-table";import dZ from"classnames";import{Alert as dJ,Button as LD,Modal as fJ,ModalBoxBody as gJ,ModalBoxFooter as hJ,ModalVariant as CJ,Spinner as yJ,Stack as SJ,StackItem as OD}from"@patternfly/react-core";import{Formik as vJ}from"formik";import{Fragment as kJ,createElement as vr,useState as bJ}from"react";import{createElement as yt}from"react";import{DescriptionList as yv,DescriptionListDescription as Sv,DescriptionListGroup as vv,DescriptionListTerm as Iv,Form as pJ,Grid as cJ,GridItem as tg}from"@patternfly/react-core";import{useFormikContext as uJ}from"formik";var VD=e=>Object.keys(e).map(t=>({key:t,value:e[t]})),Qf=e=>e.reduce((t,o)=>(t[o.key]=o.value,t),{});var rJ="cluster.x-k8s.io/cluster-name",sJ="cluster.x-k8s.io/cloned-from-name",Pp=(e,t,o,r)=>{let s=o.filter(n=>n.metadata?.namespace===`${r.metadata?.namespace||""}-${r.metadata?.name||""}`&&n.metadata?.labels?.[rJ]===r.metadata?.name&&n.metadata?.annotations?.[sJ]===e.metadata?.name&&n.status?.agentRef?.name&&n.status?.agentRef?.namespace).reduce((n,i)=>(n[i.status?.agentRef?.name||""]=i.status?.agentRef?.namespace,n),{});return t.filter(n=>s[n.metadata?.name||""]===n.metadata?.namespace)};import{CheckCircleIcon as nJ,ExclamationCircleIcon as HD,InProgressIcon as MD}from"@patternfly/react-icons";import Hu from"react";import{global_palette_green_500 as iJ,global_danger_color_100 as aJ,global_warning_color_100 as lJ}from"@patternfly/react-tokens";var eg=(e,t,o)=>{if(!t.length&&e.spec.replicas)return{type:"pending",icon:Hu.createElement(MD,null),text:o("ai:Pending host assignment")};let r=t.map(i=>ut(i));return r.some(({status:i})=>i.key==="error")?{type:"error",icon:Hu.createElement(HD,{color:aJ.value}),text:o("ai:Error")}:r.some(({status:i})=>["pending-for-input","insufficient","insufficient-unbound","disconnected-unbound","disconnected"].includes(i.key))?{type:"warning",icon:Hu.createElement(HD,{color:lJ.value}),text:o("ai:Warning")}:e.status?.conditions?.find(({type:i})=>i==="Ready")?.status==="True"?{type:"ok",icon:Hu.createElement(nJ,{color:iJ.value}),text:o("ai:Ready")}:{type:"pending",icon:Hu.createElement(MD,null),text:o("ai:Not ready")}};var mJ=({agents:e,nodePool:t,hostedCluster:o,agentMachines:r})=>{let{t:s}=f(),{values:n}=uJ(),i=!!t&&!!r,a=0,l=ps(e).filter(c=>n.agentLabels.every(({key:u,value:m})=>c.metadata?.labels?.[u]===m)&&!c.spec.clusterDeploymentName),p=sp(o.spec.release.image);if(i){let c=Pp(t,e,r,o);a=c.length+l.filter(u=>!c.find(m=>m.metadata?.uid===u.metadata?.uid)).length}else a+=l.length;return yt(pJ,null,yt(cJ,{hasGutter:!0},yt(tg,null,yt(yv,{isHorizontal:!0},yt(vv,null,yt(Iv,null,s("ai:Host namespace")),yt(Sv,null,o.spec.platform.agent?.agentNamespace)))),yt(tg,null,t?yt(yv,{isHorizontal:!0},yt(vv,null,yt(Iv,null,s("ai:Nodepool")),yt(Sv,null,t.metadata?.name))):yt(J,{name:"nodePoolName",isRequired:!0,label:s("ai:Nodepool name")})),yt(tg,null,yt(jf,{agents:e,countName:"count",labelName:"agentLabels",maxAgents:a,isEdit:i})),yt(tg,null,yt(yv,{isHorizontal:!0},yt(vv,null,yt(Iv,null,s("ai:OpenShift version")),yt(Sv,null,p))))))},og=mJ;var IJ=({onClose:e,nodePool:t,hostedCluster:o,agents:r,onSubmit:s,agentMachines:n})=>{let{t:i}=f(),[a,l]=bJ(),p=r.filter(u=>u.metadata?.namespace===o.spec.platform.agent?.agentNamespace),c=async u=>{l(void 0);let m=[];u.count!==t.spec.replicas&&m.push({op:"replace",value:u.count,path:"/spec/replicas"}),m.push({op:"replace",value:Qf(u.agentLabels),path:"/spec/platform/agent/agentLabelSelector/matchLabels"});try{await s(t,m),e()}catch(d){l(U(d))}};return vr(fJ,{"aria-label":"Manage hosts dialog",title:i("ai:Manage hosts"),isOpen:!0,onClose:e,variant:CJ.medium,hasNoBodyWrapper:!0},vr(vJ,{initialValues:{nodePoolName:t.metadata?.name||"",agentLabels:VD(t.spec.platform?.agent?.agentLabelSelector?.matchLabels||{}),count:t.spec.replicas},isInitialValid:!1,onSubmit:c},({isSubmitting:u,isValid:m,submitForm:d})=>vr(kJ,null,vr(gJ,null,vr(SJ,{hasGutter:!0},vr(OD,null,vr(og,{agents:p,agentMachines:n,nodePool:t,hostedCluster:o})),a&&vr(OD,null,vr(dJ,{variant:"danger",title:a,isInline:!0})))),vr(hJ,null,vr(LD,{onClick:d,isDisabled:!m||u,icon:u?vr(yJ,{size:"md"}):void 0},i("ai:Update")),vr(LD,{variant:"link",onClick:e},i("ai:Cancel"))))))},_D=IJ;import{Fragment as HJ,createElement as Ir,useState as VJ}from"react";import{Alert as xJ,Button as RD,Modal as TJ,ModalBoxBody as PJ,ModalBoxFooter as AJ,ModalVariant as wJ,Spinner as DJ,Stack as EJ,StackItem as BD}from"@patternfly/react-core";import{Formik as FJ}from"formik";var NJ=({onSubmit:e,onClose:t,agents:o,hostedCluster:r,agentsNamespace:s})=>{let{t:n}=f(),[i,a]=VJ(),l=o.filter(c=>c.metadata?.namespace===s),p=async c=>{a(void 0);let u={apiVersion:"hypershift.openshift.io/v1alpha1",kind:"NodePool",metadata:{name:c.nodePoolName,namespace:r.metadata?.namespace},spec:{clusterName:r.metadata?.name||"",replicas:c.count,management:{autoRepair:!1,upgradeType:"InPlace"},platform:{type:"Agent",agent:{agentLabelSelector:{matchLabels:Qf(c.agentLabels)}}},release:{image:r.spec.release.image}}};try{await e(u),t()}catch(m){a(U(m))}};return Ir(TJ,{"aria-label":"add node pool dialog",title:n("ai:Add Nodepool"),isOpen:!0,onClose:t,variant:wJ.medium,hasNoBodyWrapper:!0},Ir(FJ,{initialValues:{nodePoolName:`nodepool-${r.metadata?.name||""}-${Math.floor(Math.random()*100)}`,agentLabels:[],count:1},onSubmit:p},({isSubmitting:c,isValid:u,submitForm:m})=>Ir(HJ,null,Ir(PJ,null,Ir(EJ,{hasGutter:!0},Ir(BD,null,Ir(og,{agents:l,hostedCluster:r})),i&&Ir(BD,null,Ir(xJ,{variant:"danger",isInline:!0,title:i})))),Ir(AJ,null,Ir(RD,{onClick:m,isDisabled:!u||c,icon:c?Ir(DJ,{size:"md"}):void 0},n("ai:Create")),Ir(RD,{variant:"link",onClick:t},n("ai:Cancel"))))))},zD=NJ;import{createElement as pn,useState as KD}from"react";import{Alert as MJ,Button as WD,Modal as LJ,ModalBoxBody as OJ,ModalBoxFooter as _J,ModalVariant as RJ,Spinner as BJ,Stack as zJ,StackItem as GD}from"@patternfly/react-core";var WJ=({onClose:e,onRemove:t,nodePool:o})=>{let{t:r}=f(),[s,n]=KD(!1),[i,a]=KD();return pn(LJ,{"aria-label":"remove node pool dialog",title:r("ai:Remove nodepool"),isOpen:!0,onClose:e,variant:RJ.small,hasNoBodyWrapper:!0,titleIconVariant:"warning"},pn(OJ,null,pn(zJ,{hasGutter:!0},pn(GD,null,r("ai:Removing {{name}} will remove the association with {{count}} host. These hosts will become available for other nodepools.",{name:o.metadata?.name||"",count:o.spec.replicas})),i&&pn(GD,null,pn(MJ,{variant:"danger",isInline:!0,title:i})))),pn(_J,null,pn(WD,{onClick:()=>{(async()=>{try{a(void 0),n(!0),await t(o),e()}catch(p){a(U(p))}finally{n(!1)}})()},isDisabled:s,variant:"danger",icon:s?pn(BJ,{size:"md"}):void 0},r("ai:Remove")),pn(WD,{variant:"link",onClick:e},r("ai:Cancel"))))},UD=WJ;import{Alert as QD,Button as QJ,Flex as eZ,FlexItem as eE,Popover as tZ,Stack as oZ,StackItem as Mu}from"@patternfly/react-core";import{Fragment as oE,createElement as Nt}from"react";import{Flex as GJ,FlexItem as $D}from"@patternfly/react-core";import{CheckCircleIcon as qD,ExclamationCircleIcon as UJ,InProgressIcon as YD,UnknownIcon as KJ}from"@patternfly/react-icons";import{TableComposable as $J,Tbody as qJ,Td as jD,Th as XD,Thead as YJ,Tr as JD}from"@patternfly/react-table";import{global_palette_green_500 as ZD,global_danger_color_100 as jJ}from"@patternfly/react-tokens";import{createElement as jt}from"react";var XJ=["Progressing"],JJ=["Degraded"],ZJ=({conditions:e,isDone:t})=>{let{t:o}=f();return jt($J,{variant:"compact"},jt(YJ,null,jt(JD,null,jt(XD,{width:25},o("ai:Condition")),jt(XD,null,o("ai:Message")))),jt(qJ,null,e?.filter(({type:r})=>!XJ.includes(r)).map(r=>{let s=jt(KJ,null),{okStatus:n,nokStatus:i}=JJ.includes(r.type)?{okStatus:"False",nokStatus:"True"}:{okStatus:"True",nokStatus:"False"};return r.type.endsWith("Progressing")?s=r.status===n?jt(YD,null):jt(qD,{color:ZD.value}):r.status===n?s=jt(qD,{color:ZD.value}):r.status===i&&(s=t?jt(UJ,{color:jJ.value,size:"sm"}):jt(YD,null)),jt(JD,{key:r.type,className:"ai-conditions-table__no-border"},jt(jD,null,jt(GJ,{alignItems:{default:"alignItemsCenter"},spaceItems:{default:"spaceItemsXs"}},jt($D,null,s),jt($D,null,r.type))),jt(jD,{span:8},r.message))})))},rg=ZJ;var rZ=({nodePool:e,agents:t})=>{let{t:o}=f(),r=eg(e,t,o);return Nt(eZ,{alignItems:{default:"alignItemsCenter"},spaceItems:{default:"spaceItemsXs"}},Nt(eE,null,r.icon),Nt(eE,null,Nt(tZ,{"aria-label":"node pool status",headerContent:Nt("div",null,o("ai:Nodepool conditions")),hasAutoWidth:!0,showClose:!1,bodyContent:Nt(oZ,{hasGutter:!0},r.type==="error"&&Nt(oE,null,Nt(Mu,null,Nt(Ea,null)),Nt(Mu,null,Nt(QD,{variant:"danger",isInline:!0,title:o("ai:Some hosts are in an error state.")}))),r.type==="warning"&&Nt(oE,null,Nt(Mu,null,Nt(Ea,null)),Nt(Mu,null,Nt(QD,{variant:"warning",isInline:!0,title:o("ai:Some hosts are in a warning state.")}))),Nt(Mu,null,Nt(rg,{conditions:e.status?.conditions,isDone:!0})))},Nt(QJ,{variant:"link",isInline:!0},r.text))))},tE=rZ;var fZ=({nodePools:e,agents:t,onRemoveNodePool:o,onUpdateNodePool:r,hostedCluster:s,onAddNodePool:n,agentMachines:i,supportedVersionsCM:a})=>{let{t:l}=f(),[p,c]=ng(),[u,m]=ng(!1),[d,g]=ng(),[C,h]=ng([]),S=e.find(y=>y.metadata?.uid===p),v=e.find(y=>y.metadata?.uid===d);return $(gZ,null,$(lZ,{hasGutter:!0},$(rE,null,$(cZ,{variant:"compact"},$(mZ,null,$(bv,null,$(Yn,null),$(Yn,null,l("ai:Nodepool")),$(Yn,null,l("ai:Hostname")),$(Yn,null,l("ai:Status")),$(Yn,null,l("ai:Infrastructure env")),$(Yn,null,l("ai:CPU cores")),$(Yn,null,l("ai:Memory")),$(Yn,null,l("ai:Total storage")),$(Yn,null))),$(uZ,null,e.reduce((y,I)=>{let b=Pp(I,t,i,s),k=C.some(w=>w===I.metadata?.uid),T=b.reduce((w,F)=>{let{memory:O,cores:V,disk:Y}=Hn(F.status?.inventory||{});return w.memory+=+O.sortableValue,w.cores+=+V.sortableValue,w.disk+=+Y.sortableValue,w},{memory:0,cores:0,disk:0});return y.push($(bv,{key:I.metadata?.uid,className:k?"ai-nodepools-table__no-border":void 0},$(ao,{expand:b.length?{isExpanded:k,rowIndex:0,onToggle:()=>h(k?C.filter(w=>w!==I.metadata?.uid):[...C,I.metadata?.uid||""])}:void 0}),$(ao,null,I.metadata?.name),$(ao,null,$(aZ,{"aria-label":"node pool hosts",hasAutoWidth:!0,bodyContent:l("ai:{{agents}} of {{count}} host requested is available",{agents:b.length,count:I.spec.replicas})},$(iZ,{variant:"outline"},l("ai:{{count}} host requested",{count:I.spec.replicas})))),$(ao,null,$(tE,{nodePool:I,agents:b})),$(ao,null,"-"),$(ao,null,b.length?T.cores:"-"),$(ao,null,b.length?_t(T.memory,2,"iec"):"-"),$(ao,null,b.length?_t(T.disk,2,"si"):"-"),$(ao,{actions:{items:[{title:l("ai:Manage hosts"),onClick:()=>c(I.metadata?.uid)},{title:l("ai:Remove Nodepool"),onClick:()=>g(I.metadata?.uid)}]}}))),C.find(w=>w===I.metadata?.uid)&&b.forEach((w,F)=>{let{memory:O,cores:V,disk:Y}=Hn(w.status?.inventory||{});y.push($(bv,{key:w.metadata?.uid,className:dZ({"ai-nodepools-table__no-border":F<b.length-1})},$(ao,null),$(ao,null),$(ao,null,w.spec.hostname||w.status?.inventory.hostname),$(ao,null,$(Fa,{agent:w,isDay2:!0})),$(ao,null,$(sZ,{to:`/multicloud/infrastructure/environments/details/${w.metadata?.namespace||""}/${w.metadata?.labels?.[Co]||""}`},w.metadata?.labels?.[Co])),$(ao,null,V.title),$(ao,null,O.title),$(ao,null,Y.title)))}),y},[])))),$(rE,null,$(nZ,{variant:"link",icon:$(pZ,null),iconPosition:"right",onClick:()=>m(!0)},l("ai:Add Nodepool")))),S&&$(_D,{hostedCluster:s,agents:t,nodePool:S,onClose:()=>c(void 0),onSubmit:r,agentMachines:i}),u&&$(zD,{onClose:()=>m(!1),onSubmit:n,agentsNamespace:s.spec.platform.agent?.agentNamespace||"",agents:t,hostedCluster:s,supportedVersionsCM:a}),v&&$(UD,{onClose:()=>g(void 0),onRemove:o,nodePool:v}))},sg=fZ;import{createElement as Ra}from"react";import{ProgressStepper as zZ,Stack as WZ,StackItem as lE}from"@patternfly/react-core";import hZ from"react";import{saveAs as CZ}from"file-saver";import{Button as yZ,ButtonVariant as SZ}from"@patternfly/react-core";var vZ=({hostedCluster:e,fetchSecret:t})=>{let{t:o}=f(),r=async()=>{let s=e.status?.kubeconfig?.name,n=e.metadata?.namespace;if(s&&n)try{let a=(await t(s,n)).data?.kubeconfig;if(!a)throw new Error("Kubeconfig is empty.");let l=new Blob([atob(a)],{type:"text/plain;charset=utf-8"});CZ(l,"kubeconfig.yaml")}catch(i){console.error("Failed to fetch kubeconfig secret.",i)}};return hZ.createElement(yZ,{variant:SZ.secondary,onClick:r,isDisabled:!e.status?.kubeconfig?.name},o("ai:Download kubeconfig"))},sE=vZ;import{Fragment as FZ,createElement as Kr,useState as EZ}from"react";import{ExpandableSectionToggle as IZ,ProgressStep as bZ,Spinner as kZ,Stack as xZ,StackItem as kv}from"@patternfly/react-core";import{global_palette_green_500 as TZ,global_danger_color_100 as PZ}from"@patternfly/react-tokens";import{CheckCircleIcon as AZ,ExclamationCircleIcon as wZ}from"@patternfly/react-icons";var DZ=({hostedCluster:e,launchToOCP:t})=>{let{t:o}=f(),[r,s]=EZ(!0),n=e.status?.conditions?.find(l=>l.type==="Available"),i=e.status?.conditions?.find(l=>l.type==="Progressing"),a=Kr(kZ,{size:"md"});return i?.status==="False"&&(a=n?.status==="True"?Kr(AZ,{color:TZ.value}):Kr(wZ,{color:PZ.value,size:"sm"})),Kr(bZ,{icon:a},Kr(xZ,{hasGutter:!0},Kr(kv,null,Kr(IZ,{isExpanded:r,onToggle:s,className:"ai-progress-item__header"},o("ai:Control plane"))),r&&Kr(FZ,null,Kr(kv,{className:"ai-progress-item__body"},Kr(rg,{conditions:e.status?.conditions,isDone:i?.status==="False"})),Kr(kv,{className:"ai-progress-item__body"},Kr(tt,{onClick:()=>t(`k8s/ns/${e.metadata?.namespace||""}-${e.metadata?.name||""}/pods`,!0)},o("ai:Control plane pods"))))))},nE=DZ;import{createElement as Oi,useState as BZ}from"react";import{ExpandableSectionToggle as NZ,ProgressStep as VZ,Spinner as HZ,Stack as MZ,StackItem as iE}from"@patternfly/react-core";import{global_palette_green_500 as LZ}from"@patternfly/react-tokens";import{CheckCircleIcon as OZ}from"@patternfly/react-icons";var _Z=(e,t,o,r,s)=>{let n=o.reduce((a,l)=>{let p=Pp(l,r,e,t),c=eg(l,p,s);return a[l.metadata?.uid||""]={agents:p,status:c},a},{}),i={type:"ok",icon:Oi(OZ,{color:LZ.value})};for(let a in n){let{status:l}=n[a];if(l.type==="error"){i.type="error",i.icon=l.icon;break}l.type==="warning"&&(i.type="warning",i.icon=l.icon),l.type==="pending"&&i.type!=="warning"&&(i.type="pending",i.icon=Oi(HZ,{size:"md"}))}return i.icon},RZ=({nodePools:e,agentMachines:t,hostedCluster:o,agents:r,...s})=>{let{t:n}=f(),[i,a]=BZ(!0);return Oi(VZ,{icon:_Z(t,o,e,r,n)},Oi(MZ,{hasGutter:!0},Oi(iE,null,Oi(NZ,{isExpanded:i,onToggle:a,className:"ai-progress-item__header"},n("ai:Cluster nodepools"))),i&&Oi(iE,{className:"ai-progress-item__body"},Oi(sg,{nodePools:e,agents:r,hostedCluster:o,agentMachines:t,...s}))))},aE=RZ;var GZ=({hostedCluster:e,fetchSecret:t,launchToOCP:o,...r})=>Ra(WZ,{hasGutter:!0},Ra(lE,null,Ra(zZ,{isVertical:!0},Ra(nE,{hostedCluster:e,launchToOCP:o}),Ra(aE,{hostedCluster:e,...r}))),Ra(lE,null,Ra(sE,{hostedCluster:e,fetchSecret:t}))),pE=GZ;var zM={};Zr(zM,{AddButton:()=>hc,AddHosts:()=>hm,AdditionalNTPSourcesField:()=>xn,Alerts:()=>mr,Api:()=>Ty,AssistedInstallerDetailCard:()=>BH,AssistedInstallerExtraDetailCard:()=>zH,AssistedUILibVersion:()=>ym,AssistedUiRouter:()=>ome,CheckboxField:()=>eo,ClusterDetail:()=>Wg,ClusterDetailsForm:()=>Zg,ClusterEventsList:()=>Hc,ClusterEventsToolbar:()=>Vc,ClusterInstallationProgressCard:()=>Ug,ClusterPage:()=>Cm,ClusterStatus:()=>vg,ClusterStatusIcon:()=>Uu,ClusterToolbar:()=>Eg,Clusters:()=>Ph,CodeField:()=>Ca,Config:()=>Kv,ConfirmationModal:()=>Fn,Constants:()=>CC,DetailItem:()=>N,DetailList:()=>bt,DeveloperPreview:()=>dc,EmptyState:()=>ot,ErrorState:()=>j,EventsList:()=>ka,EventsModal:()=>xa,EventsModalButton:()=>Ol,ExternalLink:()=>tt,FORBIDDEN_HOSTNAMES:()=>Pl,Features:()=>vC,FormikAutoSave:()=>pa,FormikStaticField:()=>hi,GridGap:()=>Pa,HelperText:()=>Q,HostsClusterDetailTab:()=>BM,IPv4ValidationSchema:()=>Fl,InputField:()=>J,LabelField:()=>ud,LabelValue:()=>Pc,LoadingState:()=>z,ModalProgress:()=>En,MultiSelectField:()=>la,NewClusterPage:()=>jp,NumberInputField:()=>ns,PencilEditField:()=>Cc,PopoverIcon:()=>H,PreviewBadgePosition:()=>ha,PrismCode:()=>kt,PullSecretField:()=>As,PullSecretInfo:()=>uc,RadioField:()=>ie,Reducers:()=>Oc,RemovableField:()=>ya,RenderIf:()=>ae,RichInputField:()=>fo,Router:()=>_M,SelectField:()=>es,Selectors:()=>Wv,Services:()=>Vv,SimpleDropdown:()=>Cd,SingleNodeCheckbox:()=>gc,StaticField:()=>md,StaticTextField:()=>Vs,Store:()=>Lv,SwitchField:()=>Fr,TechnologyPreview:()=>fc,TextAreaField:()=>Qr,TextAreaSecretField:()=>Xh,ToolbarButton:()=>Rt,ToolbarSecondaryGroup:()=>wc,ToolbarText:()=>ty,ToolbarrProgress:()=>ry,UploadField:()=>oc,WizardFooter:()=>Lr,WizardNavItem:()=>Oo,acmClusterNameValidationMessages:()=>td,allSubnetsIPv4:()=>Vm,bmcAddressValidationMessages:()=>od,bmcAddressValidationSchema:()=>nd,breakWord:()=>Jb,canAddHost:()=>sme,clusterNameValidationMessages:()=>xo,clusterNetworksValidationSchema:()=>ld,day2ApiVipValidationSchema:()=>Dl,dnsNameValidationSchema:()=>ba,downloadClusterInstallationLogs:()=>Wi,dualStackValidationSchema:()=>El,fitContent:()=>fd,getClusterDetailId:()=>fs,getClusterMemoryAmount:()=>LQ,getClustervCPUCount:()=>MQ,getColSpanRow:()=>dd,getDateTimeCell:()=>Ll,getDefaultOpenShiftVersion:()=>ml,getDuplicates:()=>tc,getFieldId:()=>E,getFormikArrayItemFieldName:()=>aa,getFormikErrorFields:()=>uo,getFormikObjectItemFieldName:()=>cb,getHumanizedDateTime:()=>to,getHumanizedTime:()=>Xb,getMasterCount:()=>$E,getRichTextValidation:()=>mo,getWorkerCount:()=>qE,hostPrefixValidationSchema:()=>Dn,hostSubnetValidationSchema:()=>Ia,hostnameValidationMessages:()=>Mr,httpProxyValidationSchema:()=>Mo,ipBlockValidationSchema:()=>pr,ipValidationSchema:()=>sd,labelsToArray:()=>ub,locationValidationMessages:()=>Tl,locationValidationSchema:()=>id,macAddressValidationSchema:()=>Ds,machineNetworksValidationSchema:()=>ad,nameValidationMessages:()=>gi,nameValidationSchema:()=>Al,noPadding:()=>gd,noProxyValidationSchema:()=>Fs,nowrap:()=>Zb,ntpSourceValidationSchema:()=>wl,ocmClusterNameValidationMessages:()=>Qm,parseStringLabels:()=>Nm,pullSecretValidationSchema:()=>ws,removeProtocolFromURL:()=>Dm,richNameValidationSchema:()=>Es,rowSorter:()=>Ml,serviceNetworkValidationSchema:()=>pd,sshPublicKeyValidationSchema:()=>go,stringToJSON:()=>G,toSentence:()=>To,trimCommaSeparatedList:()=>Er,trimSshPublicKey:()=>Sn,truncate:()=>Qb,uniqueOcmClusterNameValidationMessages:()=>ed,useFormikAutoSave:()=>lr,vipRangeValidationSchema:()=>ZC,vipValidationSchema:()=>ls,wrappable:()=>ek});var Lv={};Zr(Lv,{store:()=>Xn,storeDay2:()=>gQ});import{configureStore as WE}from"@reduxjs/toolkit";import{createSlice as UZ,createAsyncThunk as KZ}from"@reduxjs/toolkit";var xv={};Zr(xv,{ClustersAPI:()=>X,ComponentVersionsAPI:()=>fE,EventsAPI:()=>cg,FeatureSupportLevelsAPI:()=>Lu,HostsAPI:()=>jn,InfraEnvsAPI:()=>Je,ManagedDomainsAPI:()=>ig,SupportedOpenshiftVersionsAPI:()=>ag});var uE={makeBaseURI(){return"/v2/domains"},list(){return K.get(uE.makeBaseURI())}},ig=uE;var mE={makeBaseURI(){return"/v2/openshift-versions"},list(){return K.get(`${mE.makeBaseURI()}`)}},ag=mE;var dE={makeBaseURI(){return"/v2/component-versions"},list(){return K.get(`${dE.makeBaseURI()}`)}},fE=dE;var lg=new AbortController,Ba={abortLastGetRequest(){lg.abort(),lg=new AbortController},makeBaseURI(e){return`/v2/infra-envs/${e||""}`},list(e=""){let t=e&&`?${new URLSearchParams({cluster_id:e}).toString()}`;return K.get(`${Ba.makeBaseURI()}${t}`,{signal:lg.signal})},get(e){return K.get(`${Ba.makeBaseURI(e)}`,{signal:lg.signal})},update(e,t){return K.patch(`${Ba.makeBaseURI(e)}`,t)},register(e){return K.post(`${Ba.makeBaseURI()}`,e)},deregister(e){return K.delete(`${Ba.makeBaseURI(e)}`)},getImageUrl(e){return K.get(`${Ba.makeBaseURI(e)}/downloads/image-url`)}},Je=Ba;var pg=new AbortController,_i={abortLastGetRequest(){pg.abort(),pg=new AbortController},makeBaseURI(e,t){return`${Je.makeBaseURI(e)}/hosts/${t||""}`},makeActionsBaseURI(e,t){return`${_i.makeBaseURI(e,t)}/actions`},list(e){return K.get(`${_i.makeBaseURI(e)}`,{signal:pg.signal})},get(e,t){return K.get(`${_i.makeBaseURI(e,t)}`,{signal:pg.signal})},update(e,t,o){return K.patch(`${_i.makeBaseURI(e,t)}`,o)},deregister(e,t){return K.delete(`${_i.makeBaseURI(e,t)}`)},reset(e,t){return K.post(`${_i.makeActionsBaseURI(e,t)}/reset`)},installHost(e,t){return K.post(`${_i.makeActionsBaseURI(e,t)}/install`)}},jn=_i;var gE={makeBaseURI(){return"/v2/events"},list(e){let t="?";return t+=e.clusterId?`cluster_id=${e.clusterId}&`:"",t+=e.hostId?`host_id=${e.hostId}&`:"",t+=e.infraEnvId?`infra_env_id=${e.infraEnvId}&`:"",e.categories&&(t+="categories=",e.categories.forEach(o=>{t+=`${o},`})),t=t.slice(0,-1),K.get(`${gE.makeBaseURI()}${t}`)}},cg=gE;var hE={makeBaseURI(){return"/v2/feature-support-levels"},list(){return K.get(hE.makeBaseURI())}},Lu=hE;var za=KZ("clusters/fetchClustersAsync",async()=>{try{let{data:e}=await X.list(),t=!!Ce;return e.filter(o=>t?o.kind==="Cluster":!0)}catch(e){D(e,()=>{Promise.reject("Failed to fetch clusters.")})}}),$Z={data:[],uiState:ue.LOADING},CE=UZ({initialState:$Z,name:"clusters",reducers:{deleteCluster:(e,t)=>({...e,data:e.data.filter(o=>o.id!==t.payload)})},extraReducers:e=>{let{LOADED:t,LOADING:o,RELOADING:r,ERROR:s}=ue;e.addCase(za.pending,n=>{let i=n.uiState===t?r:o;return{...n,uiState:i}}).addCase(za.fulfilled,(n,i)=>({...n,data:[...i.payload],uiState:t})).addCase(za.rejected,n=>({...n,uiState:s}))}}),{deleteCluster:yE}=CE.actions,SE=CE.reducer;import cQ from"lodash/findIndex";import uQ from"lodash/set";import{createAsyncThunk as mQ,createSlice as dQ}from"@reduxjs/toolkit";var Vv={};Zr(Vv,{APIs:()=>xv,ClusterDetailsService:()=>Ru,ClustersService:()=>Se,DiscoveryImageFormService:()=>Cg,DiskEncryptionService:()=>hg,HostDiscoveryService:()=>Bu,HostsNetworkConfigurationType:()=>Ye,HostsService:()=>lo,InfraEnvsService:()=>Xt,OperatorsService:()=>zu});var Wa={removeAll(e){let t=[];for(let{id:o,infraEnvId:r}of e)t.push(jn.deregister(r,o));return Promise.all(t)},update(e,t){if(jn.abortLastGetRequest(),!e.infraEnvId)throw new Error(`Cannot update host ${e.id}, missing infraEnvId`);return jn.update(e.infraEnvId,e.id,t)},updateHostName(e,t){return Wa.update(e,{hostName:t})},updateRole(e,t){return Wa.update(e,{hostRole:t})},updateHostODF(e,t){return Wa.update(e,{nodeLabels:t})},updateDiskRole(e,t,o){let r={disksSelectedConfig:[{id:t,role:o}]};return o==="install"&&(r.disksSkipFormatting=[{diskId:t,skipFormatting:!1}]),Wa.update(e,r)},updateFormattingDisks(e,t,o){return Wa.update(e,{disksSkipFormatting:[{diskId:t,skipFormatting:o}]})},delete(e){if(!e.infraEnvId)throw new Error(`Cannot delete host ${e.id}, missing infraEnvId`);return jn.deregister(e.infraEnvId,e.id)},reset(e){if(!e.infraEnvId)throw new Error(`Cannot reset host ${e.id}, missing infraEnvId`);return jn.reset(e.infraEnvId,e.id)},install(e){if(!e.infraEnvId)throw new Error(`Cannot install host ${e.id}, missing infraEnvId`);return jn.installHost(e.infraEnvId,e.id)},installAll(e){let t=[];for(let o of e)t.push(Wa.install(o));return Promise.all(t)}},lo=Wa;var Tv="infra-env-ids-cache-v2",Pv=e=>{localStorage.setItem(Tv,JSON.stringify(e))},Ap=()=>{let e="{}",t=localStorage.getItem(Tv)||e;try{return JSON.parse(t)}catch{return{}}},qZ={key(e){let t=Ap();return Object.keys(t)[e]},get length(){let e=Ap();return Object.keys(e).length},clear(){localStorage.removeItem(Tv)},getInfraEnvId(e,t){if(!e||!t)return null;let r=Ap()[e];if(!r)return null;if(t!==_.USE_DAY1_ARCHITECTURE)return r[t]||null;let s=ga.filter(n=>r[n]);if(s.length===1)return r[s[0]];throw new Error(`More than one infraEnv found for cluster ${e} without specified architecture`)},removeInfraEnvId(e,t){if(!e)return;let o=Ap();t===_.USE_DAY1_ARCHITECTURE?delete o[e]:o[e]&&delete o[e][t],Pv(o)},removeInfraEnvs(e){if(!e)return;let t=Ap();delete t[e],Pv(t)},updateInfraEnvs(e,t){if(!e)return;let o=Ap();o[e]||(o[e]={}),t.forEach(r=>{r.cpuArchitecture&&(o[e][r.cpuArchitecture]=r.id)}),Pv(o)}},Ga=qZ;var ze;(function(o){o.YAML="yaml",o.FORM="form"})(ze||(ze={}));var ee;(function(o){o.ipv4="ipv4",o.ipv6="ipv6"})(ee||(ee={}));var Ri;(function(o){o.ETHERNET="ethernet",o.VLAN="vlan"})(Ri||(Ri={}));var vE=e=>e.type===Ri.VLAN;import{dump as YZ,load as jZ}from"js-yaml";import XZ from"lodash/findLastIndex";var JZ={ipv4:"0.0.0.0/0",ipv6:"::/0"},ZZ=254,wp="#",Dp="generated by ui form view",Av=e=>`${e}MachineNetwork`,wv=(e,t)=>`${e}.${t}`,IE=e=>e===ee.ipv4?0:1,bE=e=>jZ(e),kE=e=>{let t=e.split(`
25
+ `),o=XZ(t,r=>r.startsWith(wp));return t.slice(0,o+1).map(r=>r.slice(1))},xE=(e,t)=>`${t.map(r=>`${wp}${r}`).join(`
26
+ `)}
27
+ ${YZ(e)}`,TE=(e,t)=>{let o=e.find(r=>r.startsWith(Av(t)));return o?o.split(" ")[1]:""},Dv=e=>({ipv4:TE(e,ee.ipv4),ipv6:TE(e,ee.ipv6)}),ug=e=>{let t=Dv(e);return t[ee.ipv4]&&t[ee.ipv6]?"dualStack":t[ee.ipv4]?"ipv4":null},Ou=(e,t)=>({address:[{ip:e,"prefix-length":t}],enabled:!0,dhcp:!1}),PE=e=>({config:{server:e.split(",")}}),Ev=(e,t,o)=>o.useVlan&&o.vlanId?{name:wv(e,o.vlanId),type:Ri.VLAN,state:"up",vlan:{"base-iface":e,id:o.vlanId},...t}:{name:e,type:Ri.ETHERNET,state:"up",...t},AE=(e,t,o)=>({destination:JZ[e],"next-hop-address":t,"next-hop-interface":o,"table-id":ZZ});var QZ="01:23:45:67:89:AB",Fv="DUMMY",mg=e=>{let t=e===ee.ipv4?4:6;return`${Fv}${t}`},_u={ipv4:{prefixLength:24,ip:"0.0.0.0"},ipv6:{prefixLength:64,ip:"0::0"}},eQ=()=>[{name:mg(ee.ipv4),type:Ri.ETHERNET,state:"up",ipv4:Ou(_u.ipv4.ip,_u.ipv4.prefixLength)}],Nv=()=>[{macAddress:QZ,logicalNicName:mg(ee.ipv4)}],wE=e=>e.startsWith(Fv),DE=e=>e.includes(Fv),dg=()=>{let e={interfaces:eQ()};return[{networkYaml:xE(e,[Dp]),macInterfaceMap:Nv()}]},EE=()=>({isDataComplete:!1,view:ze.FORM,formViewProtocolType:null});var fg={async getInfraEnvId(e,t){let o=Ga.getInfraEnvId(e,t);if(o===null){let{data:r}=await Je.list(e);if(r.length>0&&(Ga.updateInfraEnvs(e,r),o=Ga.getInfraEnvId(e,t)),!o)throw Ga.removeInfraEnvId(e,t),new Error(`No InfraEnv could be found for clusterId: ${e} and architecture ${t||""}`)}return o},async getInfraEnv(e,t){let o=await fg.getInfraEnvId(e,t);if(o){let{data:r}=await Je.get(o);return r}else throw new Error(`No InfraEnv could be found for clusterId: ${e} and architecture ${t||""}`)},async getAllInfraEnvIds(e){let{data:t}=await Je.list(e);return t.map(o=>o.id)},async create(e){if(!e.clusterId)throw new Error("Cannot create InfraEnv, clusterId is missing");let{data:t}=await Je.register(e);if(!t.id)throw new Error("API returned no ID for the underlying InfraEnv");Ga.updateInfraEnvs(e.clusterId,[t])},async removeAll(e){let{data:t}=await Je.list(e),o=t.map(r=>Je.deregister(r.id));return Ga.removeInfraEnvs(e),Promise.all(o)},async updateAllInfraEnvsToDhcp(e){let o=(await fg.getAllInfraEnvIds(e)).map(r=>Je.update(r,{staticNetworkConfig:[]}));return Promise.all(o)},async setDummyStaticConfigToInfraEnv(e){let{data:t}=await Je.update(e,{staticNetworkConfig:dg()});return t},async syncStaticIpConfigs(e,t,o){let{data:r}=await Je.update(t,{staticNetworkConfig:o}),s=[];return(await fg.getAllInfraEnvIds(e)).forEach(i=>{i!==t&&s.push(Je.update(i,{staticNetworkConfig:o}))}),Promise.all(s).then(()=>r)}},Xt=fg;import tQ from"lodash/omit";var gg={findHost(e=[],t){return e.find(o=>o.id===t)},async create(e){let{data:t}=await X.register(tQ(e,"staticNetworkConfig"));return await Xt.create({name:`${e.name}_infra-env`,pullSecret:e.pullSecret,clusterId:t.id,openshiftVersion:e.openshiftVersion,cpuArchitecture:e.cpuArchitecture,staticNetworkConfig:e.staticNetworkConfig}),t},async remove(e){let{data:t}=await X.get(e),o=t.hosts??[];o.length>0&&await lo.removeAll(o),await Xt.removeAll(e),await X.deregister(e)},async downloadLogs(e,t){let{data:o,headers:r}=await X.downloadLogs(e,t),n=r["content-disposition"]?.match(/filename="(.+)"/)?.[1];return{data:o,fileName:n}},update(e,t,o){return X.abortLastGetRequest(),Ce&&(o=gg.updateClusterTags(t,o)),X.update(e,o)},async install(e,t){return Ce&&gg.updateClusterTags(t,{}).tags&&await gg.update(e,t,{}),X.install(e)},updateClusterTags(e,t){let o=e?.split(",")||[];return o.includes(hl)?delete t.tags:(o?.push(hl),t.tags=o?.join(",")),t},async get(e){let{data:t}=await X.get(e);return t}},Se=gg;import oQ from"lodash/omit";var FE={diskEncryptionEnableOn(e,t){let o;return e&&t?o="all":t?o="workers":e?o="masters":o="none",o},getDiskEncryptionParams(e){return{mode:e.diskEncryptionMode,enableOn:e.highAvailabilityMode==="None"?e.enableDiskEncryptionOnMasters?"all":"none":FE.diskEncryptionEnableOn(e.enableDiskEncryptionOnMasters,e.enableDiskEncryptionOnWorkers),tangServers:e.diskEncryptionMode==="tang"?JSON.stringify(e.diskEncryptionTangServers):void 0}}},hg=FE;var Ye;(function(o){o.STATIC="static",o.DHCP="dhcp"})(Ye||(Ye={}));var rQ={getClusterCreateParams(e){let t=oQ(e,["useRedHatDnsService","SNODisclaimer","enableDiskEncryptionOnMasters","enableDiskEncryptionOnWorkers","diskEncryptionMode","diskEncryption","diskEncryptionTangServers","hostsNetworkConfigurationType"]);return t.diskEncryption=hg.getDiskEncryptionParams(e),Vr({cpuArchitecture:t.cpuArchitecture})&&(t.userManagedNetworking=!0),e.hostsNetworkConfigurationType===Ye.STATIC&&(t.staticNetworkConfig=dg()),Ce&&(t.tags=hl),t},getClusterDetailsInitialValues({cluster:e,infraEnv:t,urlSearchParams:o,...r}){let s=_d({cluster:e,...r}),i=new URLSearchParams(o).get("useArm")==="true",a=e?.cpuArchitecture||(i?_.ARM:_.x86),l=t?.staticNetworkConfig?Ye.STATIC:Ye.DHCP;return{...s,cpuArchitecture:a,hostsNetworkConfigurationType:l}}},Ru=rQ;var sQ={setPlatform(e,t,o){let s=t===void 0?o?"none":"baremetal":t;e.platform={type:s}},setSchedulableMasters(e,t,o){yc(o)||(e.schedulableMasters=t.schedulableMasters)}},Bu=sQ;var nQ={async update(e,t,o,r,s){let n={httpProxy:r.httpProxy,httpsProxy:r.httpsProxy,noProxy:r.noProxy,pullSecret:s||void 0,sshPublicKey:r.sshPublicKey},i={proxy:{httpProxy:r.httpProxy,httpsProxy:r.httpsProxy,noProxy:r.noProxy},sshAuthorizedKey:r.sshPublicKey,pullSecret:s||void 0,staticNetworkConfig:r.staticNetworkConfig,imageType:r.imageType},{data:a}=await Se.update(e,t,n);Je.abortLastGetRequest();let{data:l}=await Je.update(o,i);return{updatedCluster:a,updatedInfraEnv:l}}},Cg=nQ;var yg=e=>e.kind==="AddHostsCluster",iQ=(e,t)=>e.hosts?.filter(({logsInfo:o})=>o&&t.includes(o))||[],NE=e=>{let t=["completed","timeout"],o=e.logsInfo&&t.includes(e.logsInfo),r=iQ(e,t).length;return(o?1:0)+r};var aQ=e=>mi(e).map(t=>({name:t.name,properties:t.properties})),VE=e=>aQ(e).reduce((t,o)=>(o.name&&(t[o.name]=o),t),{}),Sg=e=>["preparing-for-installation","installing","installing-pending-user-action","finalizing"].includes(e.status),HE=e=>e.hosts?.some(t=>t.skipFormattingDisks&&t.skipFormattingDisks.length>0);var lQ=e=>Object.keys(e).some(t=>!!e[t]),pQ={getOLMOperators(e,t){let o=VE(t),r=(s,n)=>{n?o[s]={name:s}:delete o[s]};return r(Ps,e.useOdfLogicalVolumeManager),r(pi,e.useContainerNativeVirtualization),r(Ts,e.useOpenShiftDataFoundation),lQ(e)||r(Bm,!1),Object.values(o)},syncOperators(e,t){let o=e?.find(n=>n.name===Ps)===void 0,r=t?.find(n=>n.name===Ps)!==void 0,s={};return o&&r&&(s.useOdfLogicalVolumeManager=!0),s}},zu=pQ;var Wu=mQ("currentCluster/fetchClusterAsync",async(e,{rejectWithValue:t})=>{try{return await Se.get(e)}catch(o){return D(o,()=>t({code:xy(o),message:R(o)}))}}),ME={data:void 0,uiState:ue.LOADING,permissions:{isViewerMode:!1},errorDetail:void 0,isReloadScheduled:0},LE=dQ({initialState:ME,name:"currentCluster",reducers:{updateClusterBase:(e,t)=>{let o=e.data?.hosts||[];return{...e,data:{...t.payload,hosts:o}}},updateCluster:(e,t)=>({...e,data:t.payload}),updateHost:(e,t)=>{let o=cQ(e.data?.hosts,r=>r.id===t.payload.id);return o>=0&&uQ(e,`data.hosts[${o}]`,t.payload),e},cleanCluster:()=>ME,forceReload:e=>({...e,isReloadScheduled:e.isReloadScheduled+1}),cancelForceReload:e=>({...e,isReloadScheduled:0}),updateClusterPermissions:(e,t)=>({...e,permissions:t.payload})},extraReducers:e=>{e.addCase(Wu.pending,t=>{let o=t.uiState===ue.LOADED||t.uiState===ue.ERROR&&t.data;return{...t,uiState:o?ue.RELOADING:ue.LOADING}}).addCase(Wu.fulfilled,(t,o)=>({...t,data:o.payload,uiState:ue.LOADED})).addCase(Wu.rejected,(t,o)=>{let r=o.payload;return r.code===Kc&&!!t.data?{...t,uiState:ue.LOADED}:{...t,uiState:ue.ERROR,errorDetail:r}})}}),{updateCluster:St,updateClusterBase:OE,updateHost:Bi,cleanCluster:_E,forceReload:zi,cancelForceReload:Hv,updateClusterPermissions:RE}=LE.actions,BE=LE.reducer;import{createSlice as fQ}from"@reduxjs/toolkit";var zE=fQ({name:"infraEnvs",initialState:[],reducers:{},extraReducers:{}}),k9e=zE.actions,Mv=zE.reducer;var Xn=WE({reducer:{clusters:SE,currentCluster:BE,infraEnvs:Mv},preloadedState:{}}),gQ=WE({reducer:{infraEnvs:Mv}});var Wv={};Zr(Wv,{getClusterTableStatusCell:()=>Bv,selectClusterNames:()=>GE,selectClusterNamesButCurrent:()=>VQ,selectClusterTableRows:()=>zv,selectClustersUIState:()=>Ku,selectCurrentCluster:()=>hQ,selectCurrentClusterPermissionsState:()=>ce,selectCurrentClusterState:()=>Gu,selectCurrentClusterUIState:()=>CQ,selectIsCurrentClusterSNO:()=>Ua});var Gu=e=>e.currentCluster,hQ=e=>e.currentCluster.data,CQ=e=>e.currentCluster.uiState,Ua=e=>e.currentCluster.data?.highAvailabilityMode==="None",ce=e=>e.currentCluster?e.currentCluster.permissions:{isViewerMode:!1};import _v from"react";import{createSelector as Ig}from"reselect";import{Link as DQ}from"react-router-dom";import ms from"react";import{global_danger_color_100 as yQ,global_success_color_100 as SQ,global_warning_color_100 as vQ}from"@patternfly/react-tokens";import{ExclamationCircleIcon as IQ,ExclamationTriangleIcon as bQ,FileAltIcon as kQ,CheckCircleIcon as xQ,InProgressIcon as TQ,BanIcon as PQ}from"@patternfly/react-icons";var Uu=({status:e,...t})=>{switch(e){case"cancelled":return ms.createElement(PQ,{size:"sm",...t});case"insufficient":case"pending-for-input":case"ready":return ms.createElement(kQ,{size:"sm",...t});case"error":return ms.createElement(IQ,{color:yQ.value,size:"sm",...t});case"installed":return ms.createElement(xQ,{color:SQ.value,size:"sm",...t});case"installing-pending-user-action":return ms.createElement(bQ,{color:vQ.value,size:"sm",...t});case"preparing-for-installation":case"installing":case"finalizing":case"adding-hosts":return ms.createElement(TQ,{size:"sm",...t});default:return ms.createElement(ms.Fragment,null)}},Ov=(e,t)=>bn(e)[t]||t,AQ=({status:e,testId:t,className:o})=>{let{t:r}=f(),s=Ov(r,e);return ms.createElement(ms.Fragment,null,ms.createElement(Uu,{status:e,"data-testid":t,className:o})," ",s)},vg=AQ;var Te="",wQ=e=>{Te=e};var Rv=e=>e.clusters.data,EQ=e=>e.clusters.uiState,FQ=e=>e.currentCluster.data?.name,Ku=Ig([Rv,EQ],(e,t)=>{let{LOADED:o,EMPTY:r}=ue;return!e.length&&t===o?r:t}),NQ=(e,t)=>{let{id:o,name:r="",openshiftVersion:s,baseDnsDomain:n,createdAt:i}=e,a=Ll(i);return{cells:[{title:_v.createElement(DQ,{key:r,to:`${Te}/clusters/${o}`,id:`cluster-link-${o}`},r),props:{"data-testid":`cluster-name-${r}`},sortableValue:r},{title:n||be,props:{"data-testid":`cluster-base-domain-${r}`},sortableValue:n},{title:s,props:{"data-testid":`cluster-version-${r}`},sortableValue:s},{title:_v.createElement(vg,{status:e.status}),props:{"data-testid":`cluster-status-${r}`},sortableValue:Ov(t,e.status)},{title:_v.createElement(Bl,{cluster:e}),props:{"data-testid":`cluster-hosts-count-${r}`},sortableValue:"enabledHostCount"in e?kl(e):xl(e)},{title:a.title,props:{"data-testid":`cluster-created-time-${r}`},sortableValue:a.sortableValue}],props:{name:r,id:o,baseDnsDomain:n}}},Bv=e=>e?.cells?.[3],zv=e=>Ig(Rv,t=>t.map(o=>NQ(o,e))),GE=Ig(Rv,e=>e.map(t=>t.name)),VQ=Ig(GE,FQ,(e,t)=>e.filter(o=>o!==t));var Kv={};Zr(Kv,{OCM_CLUSTER_LIST_LINK:()=>Uv,getBasePermissions:()=>Gv,isSingleClusterMode:()=>ds,ocmPermissionsToAIPermissions:()=>bg,routeBasePath:()=>Te,setRouteBasePath:()=>wQ});var ds=()=>process.env.REACT_APP_BUILD_MODE==="single-cluster",Gv=e=>{if(e.permissions)return{isViewerMode:!e.permissions.canEdit};let t={isViewerMode:!1};if(!process.env.REACT_APP_CLUSTER_PERMISSIONS)return t;let o=JSON.parse(process.env.REACT_APP_CLUSTER_PERMISSIONS);return{...t,...bg(o)}},bg=e=>{let t={};return e.canEdit!==void 0&&(t.isViewerMode=!e.canEdit),t},Uv="/openshift";import{saveAs as UE}from"file-saver";import HQ from"lodash/get";var Wi=async(e,t)=>{try{if(Ce){let{data:o}=await X.getPresignedForClusterFiles({clusterId:t,fileName:"logs",hostId:void 0,logsType:"all"});UE(o.url)}else{let{data:o,fileName:r}=await Se.downloadLogs(t);UE(o,r)}}catch(o){D(o,r=>{e({title:"Could not download cluster installation logs.",message:R(r)})})}},KE=(e,t)=>e.filter(o=>o.status!=="disabled"&&o.role===t).length,$E=e=>KE(e,"master"),qE=e=>KE(e,"worker"),YE=(e,t)=>{if(!e.hosts)return 0;let o=$E(e.hosts),r=qE(e.hosts),s=o>=3&&r===0,n=o>=3&&r>=2,i=o===1;return e.hosts.filter(l=>"inventory"in l).filter(l=>l.role==="worker"&&n||l.role==="master"&&s||l.role==="master"&&i).map(l=>G(l.inventory)||{}).map(l=>HQ(l,t,0)).reduce((l,p)=>l+p,0)},MQ=e=>YE(e,"cpu.count"),LQ=e=>YE(e,"memory.physicalBytes"),fs=e=>`cluster-detail-${e}`;import ge from"react";import{Link as UF}from"react-router-dom";import{Stack as soe,StackItem as cI,TextContent as KF,Text as $F,ButtonVariant as zg,GridItem as Ya,Grid as noe}from"@patternfly/react-core";import{Fragment as $ee,createElement as Vp,useMemo as Kee}from"react";import zQ from"react";import{AlertActionLink as WQ}from"@patternfly/react-core";import kg from"react";var{openDialog:OQ,closeDialog:_Q}=Id.actions,RQ=Id.reducer,BQ=["eventsDialog","editHostDialog","deleteHostDialog","resetHostDialog","additionalNTPSourcesDialog","resetClusterDialog","cancelInstallationDialog","discoveryImageDialog","day2DiscoveryImageDialog","UpdateDay2ApiVipDialog","massUpdateHostnameDialog","massDeleteHostDialog"],jE=kg.createContext(void 0),Ep=({children:e})=>{let[t,o]=kg.useReducer(RQ,{});function r(i){return a=>o(OQ({dialogId:i,data:a}))}let s=i=>()=>o(_Q({dialogId:i})),n=BQ.reduce((i,a)=>{let l=t[a];return i[a]={isOpen:!!l,open:p=>r(a)(p),close:()=>s(a)(),data:l},i},{});return kg.createElement(jE.Provider,{value:n},e)},ve=()=>{let e=kg.useContext(jE);if(e===void 0)throw new Error("useModalDialogsContext must be used within a ModalDialogsContextProvider");return e};var gs=()=>{let{additionalNTPSourcesDialog:{open:e}}=ve();return zQ.createElement(WQ,{onClick:()=>e()},"Add NTP sources")};import{Fragment as Vee,createElement as Cs,useCallback as Qo,useContext as yF,useMemo as $u,useState as Nee}from"react";import{useDispatch as CF,useSelector as Fee}from"react-redux";import br from"react";import{Formik as GQ}from"formik";import{object as QQ}from"yup";import{Alert as UQ,Form as KQ,Modal as $Q,ModalVariant as qQ,ModalBoxBody as YQ,ModalBoxFooter as jQ,Button as XE,AlertActionCloseButton as XQ,AlertVariant as JQ}from"@patternfly/react-core";var ZQ=({additionalNtpSource:e,onClose:t,onAdditionalNtpSource:o})=>{let r={additionalNtpSource:e||""},s=a=>QQ().shape({additionalNtpSource:wl.required(a("ai:Required field"))}),{t:n}=f(),i=(a,l)=>{if(l.setStatus({error:null}),o&&a.additionalNtpSource){let p=c=>l.setStatus({error:{title:"Failed to add NTP sources",message:c}});o(a.additionalNtpSource,p)}t()};return br.createElement(GQ,{initialValues:r,initialTouched:{additionalNtpSource:!0},initialStatus:{error:null},validationSchema:s(n),onSubmit:i},({submitForm:a,status:l,setStatus:p,isSubmitting:c,isValid:u,dirty:m})=>br.createElement(br.Fragment,null,br.createElement(YQ,null,br.createElement(KQ,null,l.error&&br.createElement(UQ,{variant:JQ.danger,title:l.error.title,actionClose:br.createElement(XQ,{onClose:()=>p({error:null})}),isInline:!0},l.error.message),br.createElement(xn,{name:"additionalNtpSource",label:n("ai:Additional NTP Sources"),helperText:n("ai:A comma separated list of IP or domain names of the NTP pools or servers. Additional NTP sources are added to all hosts to ensure all hosts clocks are synchronized with a valid NTP server. It may take a few minutes for the new NTP sources to sync."),isRequired:!0}))),br.createElement(jQ,null,br.createElement(XE,{key:"submit",onClick:a,isDisabled:c||!u||!m,isLoading:c},n(c?"ai:Adding...":"ai:Add")),br.createElement(XE,{key:"cancel",variant:"link",onClick:t},n("ai:Cancel")))))},JE=({additionalNtpSource:e,isOpen:t,onClose:o,onAdditionalNtpSource:r})=>br.createElement($Q,{"aria-label":"Add NTP sources",title:"Add NTP sources",isOpen:t,onClose:o,variant:qQ.small,hasNoBodyWrapper:!0},br.createElement(ZQ,{additionalNtpSource:e,onClose:o,onAdditionalNtpSource:r}));import{saveAs as ZE}from"file-saver";var QE=async(e,t)=>{try{if(!t.clusterId)throw new Error(`Cannot download logs for host ${t.id}. Missing clusterId field value in host.`);if(Ce){let{data:o}=await X.getPresignedForClusterFiles({clusterId:t.clusterId,fileName:"logs",hostId:t.id,logsType:"host"});ZE(o.url)}else{let{data:o,fileName:r}=await Se.downloadLogs(t.clusterId,t.id);ZE(o,r)}}catch(o){D(o,r=>{e({title:"Could not download host logs.",message:R(r)})})}},eF=async(e,t,o,r)=>{try{let s={additionalNtpSource:o},{data:n}=await Se.update(t.id,t.tags,s);e(St(n))}catch(s){D(s,()=>r(R(s)))}},tF=e=>!!e.find(t=>(G(t.inventory||"")||{}).systemVendor?.virtual);import $v from"react";import{Modal as eee,ModalVariant as tee,Button as oF,ButtonVariant as rF}from"@patternfly/react-core";var oee=({isOpen:e,hostname:t,onClose:o,onReset:r})=>$v.createElement(eee,{title:"Reset Host",isOpen:e,onClose:o,variant:tee.small,actions:[$v.createElement(oF,{"data-testid":"reset-host-submit",key:"confirm",variant:rF.danger,onClick:r},"Reset"),$v.createElement(oF,{key:"cancel",variant:rF.link,onClick:o},"Cancel")]},"Are you sure you want to reset host",` ${t||""}`," ?"),sF=oee;import qv from"react";import{Modal as ree,ModalVariant as see,Button as nF,ButtonVariant as iF}from"@patternfly/react-core";var nee=({isOpen:e,hostname:t,onClose:o,onDelete:r})=>qv.createElement(ree,{title:"Delete Host",isOpen:e,onClose:o,variant:see.small,actions:[qv.createElement(nF,{"data-testid":"delete-host-submit",key:"confirm",variant:iF.danger,onClick:r},"Delete"),qv.createElement(nF,{key:"cancel",variant:iF.link,onClick:o},"Cancel")]},"Are you sure you want to delete host",` ${t||""}`," ?"),aF=nee;var hs=async(e,t,o)=>{try{let{data:r}=await cg.list(e);t(r)}catch(r){D(r,()=>{o("Failed to load events")})}};import cF from"react";import{Modal as Cee,ModalVariant as yee}from"@patternfly/react-core";import kr from"react";import{object as hee}from"yup";import{Button as lF,ButtonVariant as iee,ButtonType as aee,Form as lee,ModalBoxBody as pee,ModalBoxFooter as cee,AlertVariant as uee,Alert as mee,AlertActionCloseButton as dee}from"@patternfly/react-core";import{Formik as fee}from"formik";var gee=({onUpdateDay2ApiVip:e,onClose:t,currentApiVip:o})=>{let{t:r}=f(),s=kr.useRef();kr.useEffect(()=>{s.current?.focus(),s.current?.select()},[]);let n={apiVip:o},i=kr.useMemo(()=>hee().shape({apiVip:Dl.required(r("ai:Required field"))}),[r]);return kr.createElement(fee,{initialValues:n,validationSchema:i,initialStatus:{error:null},onSubmit:async(a,l)=>{if(a.apiVip){let p=c=>{let u={error:{title:"Failed to update API IP",message:c}};l.setStatus(u)};await e(a.apiVip,p),t()}}},({handleSubmit:a,status:l,setStatus:p,isSubmitting:c,isValid:u,dirty:m})=>{let{error:d}=l;return kr.createElement(lee,{onSubmit:a},kr.createElement(pee,null,kr.createElement(Pa,null,d&&kr.createElement(mee,{variant:uee.danger,title:d.title,actionClose:kr.createElement(dee,{onClose:()=>p({error:null})}),isInline:!0},d.message),kr.createElement(J,{label:"Set the IP or domain used to reach the cluster",name:"apiVip",ref:s,isRequired:!0}))),kr.createElement(cee,null,kr.createElement(lF,{key:"submit",type:aee.submit,isDisabled:c||!u||!m},"Update"),kr.createElement(lF,{key:"cancel",variant:iee.link,onClick:t},"Cancel")))})},pF=gee;var See=({isOpen:e,...t})=>cF.createElement(Cee,{"aria-label":"Update cluster hostname",title:"Update cluster hostname",isOpen:e,variant:yee.small,hasNoBodyWrapper:!0},cF.createElement(pF,{...t})),uF=See;import{sortable as wee}from"@patternfly/react-table";import hF from"react";var Yv="new",mF=(e,t,o,r)=>{if(e===Yv&&!t)return"operators";if(t&&!t.isDataComplete)return t.view===ze.YAML?"static-ip-yaml-view":"static-ip-network-wide-configurations";switch(o){case"ready":return"review";case"pending-for-input":case"adding-hosts":case"insufficient":return vee(r);default:return"cluster-details"}},vee=e=>{let t=Iee(e),o="host-discovery",r;for(let s of t)if(r=ab(s,vt,o),r!==void 0)break;return r||o},Iee=e=>{let t=[];return e?.forEach(o=>{let r=G(o.validationsInfo)||{};Object.keys(r).forEach(s=>{let n=i=>{i.status==="failure"&&t.push(i.id)};r[s].forEach(n)})}),t},dF=()=>({cluster:{groups:[],validationIds:[]},host:{allowedStatuses:[],groups:[],validationIds:[]},softValidationIds:[]}),jv=dF(),bee=dF(),kee={cluster:{groups:[],validationIds:["pull-secret-set","dns-domain-defined"]},host:{allowedStatuses:[],groups:[],validationIds:[]},softValidationIds:[]},xee={cluster:{groups:[],validationIds:["sufficient-masters-count","lso-requirements-satisfied","odf-requirements-satisfied","lvm-requirements-satisfied","cnv-requirements-satisfied"]},host:{allowedStatuses:["known","disabled"],groups:["hardware"],validationIds:["connected","media-connected","lso-requirements-satisfied","odf-requirements-satisfied","lvm-requirements-satisfied","cnv-requirements-satisfied"]},softValidationIds:["no-skip-installation-disk","no-skip-missing-disk"]},Tee={cluster:{groups:[],validationIds:["sufficient-masters-count"]},host:{allowedStatuses:["known","disabled"],groups:["hardware"],validationIds:["connected","media-connected","no-skip-installation-disk","no-skip-missing-disk"]},softValidationIds:[]},Pee={cluster:{groups:["network"],validationIds:[]},host:{allowedStatuses:["known","disabled"],groups:["network"],validationIds:[]},softValidationIds:["ntp-synced","container-images-available"]},Aee={cluster:{groups:[],validationIds:["all-hosts-are-ready-to-install"]},host:{allowedStatuses:["known","disabled"],groups:[],validationIds:[]},softValidationIds:[]},vt={"cluster-details":kee,"static-ip-yaml-view":jv,"static-ip-network-wide-configurations":jv,"static-ip-host-configurations":jv,operators:bee,"host-discovery":xee,storage:Tee,networking:Pee,review:Aee},fF=Em(vt),Gi=({cluster:e})=>xs("cluster-details",vt,e,e.hosts)==="ready",xg=({cluster:e})=>xs("host-discovery",vt,e,e.hosts)==="ready",Tg=({cluster:e})=>xs("storage",vt,e,e.hosts)==="ready",gF=({cluster:e})=>xs("operators",vt,e,e.hosts)==="ready",Pg=({cluster:e})=>xs("networking",vt,e,e.hosts)==="ready",Ka=e=>e.startsWith("static-ip");var Dee=500,Eee=e=>{let t=ia("host-discovery",vt,e.host),o=Vn[t],r=na(e.validationsInfo,"host-discovery",vt),s=ul(r,"host-discovery",vt)?"Some validations failed":void 0;return hF.createElement(Ls,{...e,zIndex:e.isWithinModal?Dee:void 0,status:{...o,sublabel:s},validationsInfo:r,AdditionalNTPSourcesDialogToggleComponent:gs})},Fp=({onEditHostname:e,isWithinModal:t})=>({header:{title:"Status",props:{id:"col-header-hwstatus"},transforms:[wee]},cell:o=>{let r=G(o.validationsInfo)||{};return{title:hF.createElement(Eee,{host:o,onEditHostname:e?()=>e(o):void 0,validationsInfo:r,isWithinModal:t}),props:{"data-testid":"host-hw-status"},sortableValue:status}}});var Ui=e=>{let{addAlert:t}=M(),{eventsDialog:o,editHostDialog:r,deleteHostDialog:s,resetHostDialog:n,massUpdateHostnameDialog:i,massDeleteHostDialog:a}=ve(),{resetCluster:l}=yF(Ii),{isViewerMode:p}=Fee(ce),c=CF(),u=$u(()=>({onDeleteHost:x=>{let P=we(x);s.open({hostId:x.id,hostname:x?.requestedHostname||P?.hostname})},onInstallHost:async x=>{let P=x.id;try{let{data:A}=await lo.install(x);l?l():c(Bi(A))}catch(A){D(A,()=>t({title:`Failed to enable host ${P}`,message:R(A)}))}}}),[c,l,t,s]),m=Qo(x=>{let{id:P,requestedHostname:A}=x,B=we(x),Oe=A||B?.hostname||P;o.open({hostId:P,hostname:Oe})},[o]),d=Qo(x=>{let P=we(x);r.open({host:x,inventory:P})},[r]),g=Qo(x=>{let P=we(x),A=x?.requestedHostname||P?.hostname||"";n.open({hostId:x.id,hostname:A})},[n]),C=Qo(x=>{QE(t,x)},[t]),h=Qo(async(x,P,A)=>{try{if(!P)throw new Error(`Cannot update disk role in host ${x}
28
+ Missing diskId`);let B=Se.findHost(e.hosts,x);if(!B)throw new Error(`No host found with id:${x}`);let{data:Oe}=await lo.updateDiskRole(B,P,A);l?l():c(Bi(Oe))}catch(B){D(B,()=>t({title:"Failed to set disk role",message:R(B)}))}},[c,l,t,e.hosts]),S=Qo(async(x,P)=>{try{let A=Se.findHost(e.hosts,x);if(!A)throw new Error(`No host found with id:${x}`);let{data:B}=await lo.updateHostODF(A,P);l?await l():c(Bi(B))}catch(A){D(A,()=>t({title:"Failed to update ODF status",message:U(A)}))}},[e.hosts,l,c,t]),v=Qo(async(x,P)=>{try{let{data:A}=await Se.update(e.id,e.tags,{apiVipDnsName:x});c(St(A))}catch(A){D(A,()=>P(R(A)))}},[e.id,e.tags,c]),y=$u(()=>async(...x)=>await eF(c,e,...x),[e,c]),I=Qo(async(x,P,A)=>{try{if(!e.id)throw new Error(`Failed to update disks skip formatting state in host ${P}
29
+ Missing cluster id`);if(!A)throw new Error(`Failed to update disks skip formatting state in host ${P}
30
+ Missing disk id`);let B=Se.findHost(e.hosts,P);if(!B)throw new Error(`No host found with id:${P}`);let{data:Oe}=await lo.updateFormattingDisks(B,A,!x);l?l():c(Bi(Oe))}catch(B){D(B,()=>t({title:"Failed to set disks skip formatting",message:R(B)}))}},[c,t,e,l]),b=$u(()=>({canEditRole:x=>!p&&HC(e.status,x.status,ne(e)),canInstallHost:x=>!p&&vc(e,x.status),canEditDisks:x=>!p&&LC(e.status,x.status),canEnable:x=>!p&&EC(e.status,x.status),canDisable:x=>!p&&FC(e.status,x.status),canDelete:x=>!p&&NC(e.status,x.status),canEditHost:x=>!p&&Sc(e.status,x.status),canReset:x=>!p&&VC(e.status,x.status),canEditHostname:()=>!p&&MC(e.status)}),[e,p]),k=Qo(()=>{(async P=>{if(P)try{let A=Se.findHost(e.hosts,P);if(!A)throw new Error(`No host found with id:${P}`);let{data:B}=await lo.reset(A);l?l():c(Bi(B))}catch(A){D(A,()=>t({title:`Failed to reset host ${P}`,message:R(A)}))}})(n.data?.hostId),n.close()},[t,e.hosts,c,l,n]),T=Qo(()=>{(async P=>{if(P)try{let A=Se.findHost(e.hosts,P);if(!A)throw new Error(`No host found with id:${P}`);await lo.delete(A),l?l():c(zi())}catch(A){D(A,()=>t({title:`Failed to delete host ${P}`,message:R(A)}))}})(s.data?.hostId),s.close()},[s,e.hosts,l,c,t]),w=Qo(async(x,P)=>{try{if(!x.clusterId)throw new Error(`Failed to edit role in host: ${x.id}.
31
+ Missing cluster_id`);let{data:A}=await lo.updateRole(x,P);l?l():c(Bi(A))}catch(A){D(A,()=>t({title:"Failed to set role",message:R(A)}))}},[t,c,l]),F=$u(()=>Qd({...b,onEditRole:w,onDiskRole:h,onExcludedODF:S,onEditHost:d,onHostReset:g,onDownloadHostLogs:C,onViewHostEvents:m,canDownloadHostLogs:Xm,...u}),[b,u,w,h,d,g,C,S,m]),[O,V]=Nee([]),Y=Qo((x,P)=>{V(P?[...O,x.id]:O.filter(A=>A!==x.id))},[O]),he=Qo(()=>{if(O.length===1){let x=e.hosts?.find(P=>P.id===O[0]);return x&&d(x)}return i.open({hostIDs:O,cluster:e})},[O,i,e,d]),Z=Qo(()=>a.open({hosts:(e.hosts||[]).filter(x=>O.includes(x.id)),onDelete:x=>lo.delete(x)}),[e.hosts,O,a]);return{onDiskRole:h,onEditHost:d,actionChecks:b,onEditRole:w,actionResolver:F,onReset:k,onDelete:T,onAdditionalNtpSource:y,onUpdateDay2ApiVip:v,onSelect:p?void 0:Y,selectedHostIDs:O,setSelectedHostIDs:V,onMassChangeHostname:he,onMassDeleteHost:Z,updateDiskSkipFormatting:I}},Ki=({cluster:e,onDelete:t,onReset:o,onAdditionalNtpSource:r,onUpdateDay2ApiVip:s})=>{let n=CF(),{resetCluster:i}=yF(Ii),{t:a}=f(),{eventsDialog:l,editHostDialog:p,deleteHostDialog:c,resetHostDialog:u,additionalNTPSourcesDialog:m,UpdateDay2ApiVipDialog:d,massUpdateHostnameDialog:g,massDeleteHostDialog:C}=ve(),h=$u(()=>[wt(a),Fp({isWithinModal:!0})],[a]),S=Be(C.data?.hosts?.length||0);return Cs(Vee,null,l.isOpen&&Cs(xa,{isOpen:!0,title:`Host Events${l.isOpen?`: ${l.data?.hostname}`:""}`,entityKind:"host",cluster:e,hostId:l.data?.hostId,onClose:l.close,onFetchEvents:hs}),u.isOpen&&Cs(sF,{isOpen:!0,hostname:u.data?.hostname,onClose:u.close,onReset:o}),c.isOpen&&Cs(aF,{isOpen:!0,hostname:c.data?.hostname,onClose:c.close,onDelete:t}),p.isOpen&&Cs(Wl,{isOpen:!0,host:p.data?.host,inventory:p.data?.inventory,usedHostnames:e?.hosts?.map(v=>v.requestedHostname).filter(v=>v),onClose:p.close,onSave:async v=>{let y=Se.findHost(e.hosts,v.hostId);if(!y)throw new Error(`No host found with id:${v.hostId}`);let{data:I}=await lo.updateHostName(y,v.hostname);i?i():n(Bi(I)),p.close()},onFormSaveError:v=>{let y;return D(v,()=>y=R(v)),y}}),m.isOpen&&Cs(JE,{isOpen:!0,additionalNtpSource:e.additionalNtpSource,onClose:m.close,onAdditionalNtpSource:r}),d.isOpen&&Cs(uF,{isOpen:!0,onClose:d.close,onUpdateDay2ApiVip:s,currentApiVip:e.apiVipDnsName}),g.isOpen&&Cs(ki,{isOpen:!0,onClose:g.close,hosts:g.data?.cluster?.hosts||[],selectedHostIDs:g.data?.hostIDs||[],onChangeHostname:(v,y)=>lo.updateHostName(v,y),canChangeHostname:()=>[!0,void 0]}),C.isOpen&&Cs(Yl,{isOpen:!0,onClose:C.close,hosts:C.data?.hosts||[],onDelete:C.data?.onDelete},Cs(Xe,{hosts:C.data?.hosts||[],content:h,...S},Cs("div",null,"No hosts selected"))))};import bF from"react";import{ConnectedIcon as Ree}from"@patternfly/react-icons";import{pluralize as Bee}from"humanize-plus";import IF from"react";import Jn from"react";import{Button as SF,ButtonVariant as vF,Modal as Hee}from"@patternfly/react-core";import{InfoCircleIcon as Mee}from"@patternfly/react-icons";var Lee=({linkText:e,infoCircleSize:t="sm",modalTitle:o,modalVariant:r="medium",children:s})=>{let[n,i]=Jn.useState(!1),a=Jn.useCallback(()=>i(!1),[]),l=Jn.useCallback(()=>i(!0),[]);return Jn.createElement(Jn.Fragment,null,Jn.createElement(SF,{variant:vF.link,onClick:l,isInline:!0},Jn.createElement(Mee,{size:t})," ",e),Jn.createElement(Hee,{title:o,isOpen:n,actions:[Jn.createElement(SF,{key:"close",variant:vF.primary,onClick:a},"Close")],onClose:a,variant:r},s))},Ag=Lee;import{pluralize as Oee}from"humanize-plus";var _ee=({isSingleNode:e=!1})=>IF.createElement(Ag,{linkText:`${Oee(+e,"Host")} not showing up?`,modalTitle:"Troubleshooting Host Discovery Issues",modalVariant:"large"},IF.createElement(qd,null)),wg=_ee;var zee=({isSingleNode:e=!1})=>bF.createElement(ot,{icon:Ree,title:`Waiting for ${Bee(+e,"host")}...`,content:"Hosts may take a few minutes to appear here after booting.",secondaryActions:[bF.createElement(wg,{key:"hosts-not-showing"})]}),Dg=zee;import Xv from"react";import{AlertActionLink as Wee}from"@patternfly/react-core";var kF=()=>{let{UpdateDay2ApiVipDialog:{open:e}}=ve();return Xv.createElement(Xv.Fragment,null,"Check your DNS and network configuration, or"," ",Xv.createElement(Wee,{onClick:()=>e(),isInline:!0},"set the IP or domain used to reach the cluster."))};function Gee({obj:e}){let{onDiskRole:t,canEditDisks:o,updateDiskSkipFormatting:r}=gp();return Vp(zr,{host:e,AdditionalNTPSourcesDialogToggleComponent:gs,hideNTPStatus:!0,onDiskRole:t,canEditDisks:o,updateDiskSkipFormatting:r})}var Uee=({cluster:e,skipDisabled:t})=>{let{onEditHost:o,onEditRole:r,actionChecks:s,onDiskRole:n,actionResolver:i,updateDiskSkipFormatting:a,...l}=Ui(e),{t:p}=f(),c=Kee(()=>[wt(p,o,void 0,s.canEditHostname),Ut(p,s.canEditRole,r,Hr(e)),XT(p,gs,o,kF),Di,Go,Uo,yo,Ei(e)],[p,o,s,r,e]),u=e.hosts||[],m=Be(u.length);return Vp($ee,null,Vp(Hi,{canEditDisks:s.canEditDisks,onDiskRole:n,updateDiskSkipFormatting:a},Vp(Xe,{hosts:u,skipDisabled:t,ExpandComponent:Gee,content:c,actionResolver:i,...m},Vp(Dg,{isSingleNode:ne(e)}))),Vp(Ki,{cluster:e,...l}))},Np=Uee;import qu from"react";import{ToolbarContent as qee,Toolbar as Yee,ActionGroup as jee}from"@patternfly/react-core";var Xee=({children:e,validationSection:t})=>qu.createElement(qu.Fragment,null,t,qu.createElement(jee,null,qu.createElement(Yee,{id:"cluster-toolbar",className:"cluster-toolbar"},qu.createElement(qee,{className:"cluster-toolbar__content"},e)))),Eg=Xee;import oe from"react";import{GridItem as iI,TextContent as Lte,Text as Ote}from"@patternfly/react-core";import cte from"swr";import Zn from"react";import{Severity as mte}from"@sentry/browser";import $i from"react";var Jee=e=>e.sort((t,o)=>t.label.localeCompare(o.label,void 0,{numeric:!0})).reverse(),Zee=["production","maintenance"];function $r(){let[e,t]=$i.useState([]),[o,r]=$i.useState(),s=$i.useCallback(p=>e.find(({value:c})=>new RegExp(`^${c}(\\..+)?$`).test(p||"")),[e]),n=$i.useCallback(async()=>{try{let{data:p}=await ag.list(),c=Object.keys(p).map(u=>{let m=p[u],d=m.displayName;return{label:`OpenShift ${d}`,value:u,version:d,default:Boolean(m.default),supportLevel:m.supportLevel,cpuArchitectures:m.cpuArchitectures}});t(Jee(c))}catch(p){D(p,c=>{r({title:"Failed to retrieve list of supported OpenShift versions.",message:R(c)})})}},[]),i=$i.useCallback(p=>s(p)?.value||p,[s]),a=$i.useCallback(p=>{let c=s(p);return Zee.includes(c?.supportLevel||"")},[s]),l=$i.useCallback(p=>s(p)?.cpuArchitectures??[],[s]);return $i.useEffect(()=>{n()},[n]),{error:o,loading:!o&&e.length===0,versions:e,normalizeClusterVersion:i,isSupportedOpenShiftVersion:a,getCpuArchitectures:l}}import Qee from"react";import ete from"swr";function tte(e){let t=e.filter(r=>!bC.includes(r)),o=Array.from(new Set(t));if(t.length===1){let[r]=o;return is({platform:{type:r}})?r:void 0}}function qi(e){let{addAlert:t,alerts:o}=M(),r=X.makeSupportedPlatformsBaseURI(e),s=()=>X.getSupportedPlatforms(e).then(p=>p.data),{data:n,error:i}=ete(r,s,{refreshInterval:ua,errorRetryCount:0,revalidateOnFocus:!1}),a=!i&&!n,l=a||!n?void 0:tte(n);return Qee.useEffect(()=>{if(i){let p=`Failed to retrieve supported platforms (clusterId: ${e})`;if(o.find(c=>c.title===p))return;D(i,()=>t({title:p,message:R(i)}))}},[i,t,e,o]),{isPlatformIntegrationSupported:l!==void 0,supportedPlatformIntegration:l||"no-active-integrations",isLoading:a,error:i}}import Jv from"react";function Fg(){let[e,t]=Jv.useState(),{addAlert:o}=M(),r=Jv.useCallback(async()=>{try{let{data:s}=await ig.list();t(s)}catch(s){t([]),D(s,()=>o({title:"Failed to retrieve managed domains",message:R(s)}))}},[o]);return Jv.useEffect(()=>{e||r()},[]),e}import Zv from"react";function Ng(e){let[t,o]=Zv.useState(),{addAlert:r}=M(),s=Zv.useCallback(async()=>{try{let{data:n}=await X.list(),i=n.filter(a=>a.id!==e).map(a=>`${a.name||""}.${a.baseDnsDomain||""}`);o(i)}catch(n){o([]),D(n,()=>r({title:"Failed to retrieve names of existing clusters.",message:R(n)}))}},[r,e]);return Zv.useEffect(()=>{s()},[]),{usedClusterNames:t}}import Vg from"react";function Hg(e,t){let[o,r]=Vg.useState(),[s,n]=Vg.useState(""),i=Vg.useCallback(async()=>{try{let a=await Xt.getInfraEnvId(e,t);r(a)}catch(a){n(U(a))}},[e,t]);return Vg.useEffect(()=>{e&&!o&&i()},[e,i,o]),{infraEnvId:o,error:s}}import Qv from"react";function Hp(){let[e,t]=Qv.useState(),{addAlert:o}=M(),r=Qv.useCallback(async()=>{try{if(Ce){let n=(await Ce.post("/api/accounts_mgmt/v1/access_token"))?.request?.response;t(n||"")}else t("")}catch(s){D(s,n=>{t(""),o({title:"Failed to retrieve pull secret",message:R(n)})})}},[o]);return Qv.useEffect(()=>{e||r()},[]),e}import eI from"react";var{addAlert:ote}=Si.actions,rte=e=>{let[t,o]=eI.useState(),[r,s]=eI.useState("");return eI.useEffect(()=>{(async()=>{try{let{data:i}=await X.getPreflightRequirements(e);o(i)}catch(i){s(U(i)),D(i,()=>ote({title:"Failed to retrieve preflight cluster requirements",message:R(i)}))}})()},[o,s,e]),{preflightRequirements:t,error:r,isLoading:!r&&!t}},$a=rte;var tI="Virtualization",oI="OpenShift Data Foundation Logical Volume Manager",xF=(e,t)=>!!t.find(r=>r.value===e)?.cpuArchitectures?.includes(_.ARM),Mg="This option is not editable after the draft cluster is created",TF=(e,t,o)=>!e.useContainerNativeVirtualization&&e.useOdfLogicalVolumeManager&&o!=="supported"?`Currently, you can not install ${tI} operator at the same time as ${oI} operator.`:void 0,PF=(e,t,o)=>{let r=e.useContainerNativeVirtualization;if(r&&e.useOdfLogicalVolumeManager)return`${oI} must be installed when ${tI} operator is also installed`;if(r&&o!=="supported")return`Currently, you can not install ${oI} operator at the same time as ${tI} operator.`},ste=(e,t)=>e?Mg:t?"":"Single-Node OpenShift is not supported in this OpenShift version",nte=(e,t,o)=>{if(e)return Mg;if(!xF(t,o))return"arm64 is not supported in this OpenShift version"},ite=(e,t)=>{if(!!e){if(Vr(e)&&ne(e))return"OpenShift Data Foundation is not available when using Single Node OpenShift or ARM CPU architecture.";if(Vr(e))return"OpenShift Data Foundation is not available when ARM CPU architecture is selected.";if(ne(e))return"OpenShift Data Foundation is not available when deploying a Single Node OpenShift.";if(!t)return"The installer cannot currently enable OpenShift Data Foundation with the selected OpenShift version, but it can be enabled later through the OpenShift Console once the installation is complete."}},ate=(e,t)=>{if(!!e&&!t)return"OpenShift Data Foundation Logical Volume Manager is enabled only for OpenShift 4.11 and above."},lte=e=>{if(!!e&&Vr(e))return"OpenShift Virtualization is not available when ARM CPU architecture is selected."},pte=e=>{if(!!e&&ne(e))return"Network management selection is not supported for Single-Node OpenShift"},AF=(e,t,o,r,s)=>{switch(e){case"SNO":return ste(t,s);case"ARM64_ARCHITECTURE":return nte(t,o,r);case"CNV":return lte(t);case"ODF":return ite(t,s);case"LVM":return ate(t,s);case"NETWORK_TYPE_SELECTION":return pte(t);case"ARM64_ARCHITECTURE_WITH_CLUSTER_MANAGED_NETWORKING":return"Network management selection is not supported for ARM architecture with this version of OpenShift.";default:return}},wF=(e,t,o,r)=>t==="ARM64_ARCHITECTURE"?xF(e,r):o!=="unsupported";var DF=e=>{try{let t={};for(let{openshiftVersion:o,features:r}of e)if(!(!o||!r)){t[o]={};for(let{featureId:s,supportLevel:n}of r)!s||!n||(t[o][s]=n)}return t}catch(t){return _s(t,"Failed to parse feature support levels",mte.Warning),{}}},EF=(e,t)=>{let o=Object.keys(t).find(r=>new RegExp(`^${r}(\\..*)?$`).test(e));if(!!o)return t[o]},FF=(e,t,o)=>{let r=DF(t),s=EF(e,r);return s&&s[o]!=="unsupported"},ute=({cluster:e,children:t,loadingUi:o})=>{let{loading:r,versions:s}=$r(),n=()=>Lu.list().then(h=>h.data),{data:i,error:a}=cte(Lu.makeBaseURI(),n,{errorRetryCount:0,revalidateOnFocus:!1}),l=!i&&!a||r,p=Zn.useMemo(()=>!i||a?{}:DF(i),[a,i]),c=Zn.useCallback(h=>EF(h,p),[p]),u=Zn.useCallback((h,S)=>{let v=c(h);return v?v[S]:void 0},[c]),m=Zn.useCallback((h,S)=>{let v=u(h,S);return wF(h,S,v,s)},[u,s]),d=Zn.useCallback((h,S)=>{let v=m(h,S);return AF(S,e,h,s,v)},[m,s,e]),g=Zn.useCallback((h,S)=>!!d(h,S),[d]),C=Zn.useMemo(()=>({getVersionSupportLevelsMap:c,getFeatureSupportLevel:u,isFeatureDisabled:g,getFeatureDisabledReason:d,isFeatureSupported:m}),[c,u,g,d,m]);return Zn.useEffect(()=>{a&&D(a)},[a]),Zn.createElement(Wm,{value:C},l?o:t)},ys=ute;import{CheckCircleIcon as Cte,InfoCircleIcon as HF}from"@patternfly/react-icons";import nt from"react";import{global_success_color_100 as yte}from"@patternfly/react-tokens";import{Text as Ste,TextList as MF,TextListItem as nI,TextContent as vte}from"@patternfly/react-core";var Lg=(e,t,o)=>{if(!e.openshiftVersion)throw o?o("ai:cluster doesn't contain the openshift_version field"):"cluster doesn't contain the openshift_version field";if(!e.featureUsage)throw o?o("ai:cluster doesn't contain the feature_usage field"):"ai:cluster doesn't contain the feature_usage field";let r={},s=G(e.featureUsage);if(s===void 0)throw o?o("ai:Error parsing cluster feature_usage field"):"Error parsing cluster feature_usage field";let n=Object.values(s).map(a=>a.id),i=t.getVersionSupportLevelsMap(e.openshiftVersion);if(!i)throw o?o("ai:No support level data for version {{openshiftVersion}}",{openshiftVersion:e.openshiftVersion}):`No support level data for version ${e.openshiftVersion}`;for(let a of n)if(a in i){let l=i[a];if(l==="supported"||l==="unsupported"&&a!=="CLUSTER_MANAGED_NETWORKING_WITH_VMS")continue;r[a]=i[a]}return r};import{Button as dte,ButtonVariant as fte}from"@patternfly/react-core";import sI from"react";import{ErrorBoundary as gte}from"react-error-boundary";import rI from"react";var NF=rI.createContext({captureException:()=>{}}),VF=({exceptionReporter:e,children:t})=>rI.createElement(NF.Provider,{value:{captureException:e}},t),Og=()=>rI.useContext(NF);var hte=({title:e})=>({resetErrorBoundary:o})=>{let r="There was an internal error",s=[sI.createElement(dte,{onClick:o,variant:fte.link,isInline:!0,key:"reset-error-boundary"},"try again")];return sI.createElement(j,{...{content:r,primaryAction:s,title:e}})},Mp=({children:e,...t})=>{let{captureException:o}=Og(),r=s=>{o(s,t.title)};return sI.createElement(gte,{FallbackComponent:hte(t),onError:r},e)};var Ite=e=>{switch(e){case"SNO":return"Install single node OpenShift (SNO)";case"VIP_AUTO_ALLOC":return"Allocate IPs via DHCP server";case"ARM64_ARCHITECTURE":return"Use ARM architecture for the cluster";default:return e}},bte=e=>e==="dev-preview"?"Developer Preview Features":nt.createElement(tt,{href:ic},"Technology Preview Features"),kte=e=>{let t={"tech-preview":[],"dev-preview":[]};for(let[s,n]of Object.entries(e))!mc(n)||t[n].push(s);let o;if(t["dev-preview"].length)o="dev-preview";else if(t["tech-preview"].length)o="tech-preview";else return null;let r=t[o].map(s=>nt.createElement(nI,{key:s},Ite(s)));return nt.createElement(nt.Fragment,null,nt.createElement(nI,null,bte(o),nt.createElement(MF,null,r)))},xte=({clusterFeatureSupportLevels:e,showVersionWarning:t})=>nt.createElement(vte,null,t&&nt.createElement(Ste,null,nt.createElement(HF,{size:"sm",color:"var(--pf-global--info-color--100)"}),"\xA0The installed OpenShift version is not production-ready"),Object.keys(e).length>0&&nt.createElement(nt.Fragment,null,nt.createElement(HF,{size:"sm",color:"var(--pf-global--info-color--100)"}),"\xA0Your cluster will be subject to support limitations because it includes:",nt.createElement(MF,null,kte(e),e.CLUSTER_MANAGED_NETWORKING_WITH_VMS==="unsupported"&&nt.createElement(nI,null,"Cluster-managed networking with some or all discovered hosts as virtual machines")))),Tte=()=>nt.createElement(nt.Fragment,null,nt.createElement(Cte,{color:yte.value}),"\xA0Your installed cluster will be fully supported"),Pte=e=>`Cluster support level: ${e?"Full":"Limited"}`,Ate=({cluster:e})=>{let{t}=f(),o=Pe(),{isSupportedOpenShiftVersion:r}=$r(),{limitedClusterFeatures:s,hasSupportedVersion:n,isFullySupported:i}=nt.useMemo(()=>{let a=Lg(e,o,t),l=r(e.openshiftVersion);return{limitedClusterFeatures:a,hasSupportedVersion:l,isFullySupported:l&&Object.keys(a||{}).length===0}},[e,o,t,r]);return s?nt.createElement(N,{title:Pte(i),value:i?nt.createElement(Tte,null):nt.createElement(xte,{clusterFeatureSupportLevels:s,showVersionWarning:!n}),testId:"feature-support-levels"}):null},wte=({...e})=>nt.createElement(Mp,{title:"Failed to load feature support levels review"},nt.createElement(Ate,{...e})),Yu=wte;import qa from"react";import{ExclamationTriangleIcon as Dte}from"@patternfly/react-icons";import{global_warning_color_100 as Ete}from"@patternfly/react-tokens/dist/js/global_warning_color_100";import{Popover as Fte,Text as LF,TextContent as Nte,TextVariants as Vte}from"@patternfly/react-core";var Hte=({version:e})=>{let{t}=f(),o=qa.createElement(Nte,null,qa.createElement(LF,{component:Vte.p},t("ai:Please note that this version is not production-ready.")));return qa.createElement(LF,{component:"p"},e," \xA0",qa.createElement(Fte,{bodyContent:o},qa.createElement(Dte,{color:Ete.value,size:"sm"})))},Mte=({cluster:e})=>{let{isSupportedOpenShiftVersion:t}=$r(),{t:o}=f(),{openshiftVersion:r}=e,s=t(r);return qa.createElement(N,{title:o("ai:OpenShift version"),value:s?r:qa.createElement(Hte,{version:r||""}),testId:"openshift-version"})},_g=Mte;var _te=({isMultiArchSupported:e})=>{let t;return e?t="The original cluster hosts CPU architecture. You can add hosts that are using either x86 or arm64 CPU architecture to this cluster.":t="The original cluster hosts CPU architecture.",oe.createElement(oe.Fragment,null,"CPU architecture ",oe.createElement(H,{bodyContent:oe.createElement("p",null,t)}))},Rte=e=>{let t;return e===ts?t="Software-Defined Networking (SDN)":t="Open Virtual Network (OVN)",t},Bte=e=>{let t;return e?t="User-Managed Networking":t="Cluster-managed networking",t},zte=e=>{let t=null;switch(e){case"all":t=oe.createElement(oe.Fragment,null,"Enabled on control plane nodes",oe.createElement("br",null),"Enabled on workers");break;case"masters":t=oe.createElement(oe.Fragment,null,"Enabled on control plane nodes");break;case"workers":t=oe.createElement(oe.Fragment,null,"Enabled on workers");break}return t},Wte=({cluster:e,externalMode:t=!1})=>{let{t:o}=f(),r=va(e),s=Pe(),n=Boolean(e.cpuArchitecture==="multi"||e.openshiftVersion&&s.getFeatureSupportLevel(e.openshiftVersion,"MULTIARCH_RELEASE_IMAGE")==="supported");return oe.createElement(oe.Fragment,null,!t&&oe.createElement(iI,null,oe.createElement(Lte,null,oe.createElement(Ote,{component:"h2"},o("ai:Cluster Details")))),oe.createElement(iI,{md:6,"data-testid":"cluster-details"},oe.createElement(bt,null,t?void 0:oe.createElement(_g,{cluster:e}),oe.createElement(N,{title:"Base domain",value:e.baseDnsDomain,testId:"base-dns-domain"}),oe.createElement(N,{title:oe.createElement(_te,{isMultiArchSupported:n}),value:e.cpuArchitecture,testId:"cpu-architecture"}),oe.createElement(N,{title:"API IP",value:e.apiVip,isHidden:!e.apiVip,testId:"api-vip"}),oe.createElement(N,{title:"Ingress IP",value:e.ingressVip,isHidden:!e.ingressVip,testId:"ingress-vip"}),oe.createElement(N,{title:"Network management type",value:Bte(e.userManagedNetworking),testId:"network-management-type"}),oe.createElement(N,{title:"Networking Type",value:Rte(e.networkType),testId:"networking-type"}))),oe.createElement(iI,{md:6},oe.createElement(bt,null,oe.createElement(N,{title:"Cluster network CIDR (IPv4)",value:wC(e,"clusterNetworks"),testId:"cluster-network-cidr-ipv4"}),oe.createElement(N,{title:"Cluster network host prefix (IPv4)",value:Bb(e),testId:"host-prefix-ipv4"}),r?oe.createElement(oe.Fragment,null,oe.createElement(N,{title:"Cluster network CIDR (IPv6)",value:DC(e,"clusterNetworks"),testId:"cluster-network-cidr-ipv6"}),oe.createElement(N,{title:"Cluster network host prefix (IPv6)",value:zb(e),testId:"host-prefix-ipv6"})):void 0,oe.createElement(N,{title:"Service network CIDR (IPv4)",value:wC(e,"serviceNetworks"),testId:"service-network-cidr-ipv4"}),r?oe.createElement(N,{title:"Service network CIDR (IPv6)",value:DC(e,"serviceNetworks"),testId:"service-network-cidr-ipv6"}):void 0,oe.createElement(N,{title:"Disk encryption",value:zte(e.diskEncryption?.enableOn),isHidden:e.diskEncryption?.enableOn==="none",testId:"disk-encryption"}),oe.createElement(Yu,{cluster:e}))))},Rg=Wte;import Yi from"react";import po from"react";import{Alert as lI,GridItem as qte}from"@patternfly/react-core";import Gte from"lodash/pick";import aI,{useContext as Ute,useEffect as Kte}from"react";var $te=(e,t)=>{let o;switch(t.type){case"request":o={status:"loading",data:{}};break;case"success":o={status:"succeeded",data:t.data};break;case"failure":o={status:"failed",data:t.data};break;default:o=e;break}return o},OF=aI.createContext({}),Lp=({children:e,errorUI:t,loadingUI:o})=>{let[r,s]=aI.useReducer($te,{status:"idle",data:{}});Kte(()=>{let l=!0;return(async()=>{try{l&&s({type:"request"});let{data:c}=await X.getDefaultConfig();l&&s({type:"success",data:c})}catch{l&&s({type:"failure",data:{}})}})(),()=>{l=!1}},[]);let n=l=>{let p={ui:o,value:l.data};switch(l.status){case"idle":case"loading":break;case"failed":p={...p,ui:t};break;case"succeeded":p={...p,ui:e};break}return p},{ui:i,value:a}=n(r);return aI.createElement(OF.Provider,{value:a},i)},Op=e=>Gte(Ute(OF),e);import{ExternalLinkAltIcon as Yte}from"@patternfly/react-icons";var jte=({cluster:e,showAddHostsInfo:t,showKubeConfig:o})=>{let r=Pe(),{inactiveDeletionHours:s}=Op(["inactiveDeletionHours"]),n=Math.round((s||0)/24),i=lT(n,e.installCompletedAt),a=Boolean(t&&Ce&&e.status==="installed"&&(!ne(e)||e.openshiftVersion&&r.isFeatureSupported(e.openshiftVersion,"SINGLE_NODE_EXPANSION"))),l=o&&i>0&&Il(e.status);return po.createElement(po.Fragment,null,po.createElement(ae,{condition:l},po.createElement(qte,null,po.createElement(Ti,{status:e.status,clusterId:e.id,id:fs("button-download-kubeconfig")}))),po.createElement(ae,{condition:typeof s=="number"&&Il(e.status)},po.createElement(lI,{variant:"info",isInline:!0,title:i>0?`Download and save your kubeconfig file in a safe place. This file will be automatically deleted from Assisted Installer's service in ${i} days.`:`Kubeconfig file was automatically deleted ${n} days after installation.`})),po.createElement(ae,{condition:a},po.createElement(lI,{variant:"info",isInline:!0,"data-testid":"alert-add-hosts",title:po.createElement("p",null,is(e)?'Add new hosts by using the platform auto-scale feature or manually generating a new Discovery ISO under the "Add hosts" tab on ':`Add new hosts by generating a new Discovery ISO under your cluster's "Add hosts" tab on `,po.createElement("a",{href:tC,target:"_blank",rel:"noopener noreferrer"},"console.redhat.com/openshift ",po.createElement(Yte,null)),".")})),po.createElement(ae,{condition:is(e)},po.createElement(lI,{variant:"warning",isInline:!0,"data-testid":"alert-modify-platform-config",title:po.createElement("p",null,"Modify your platform configuration to access your platform's features directly in OpenShift."," ",po.createElement("a",{href:ca,target:"_blank",rel:"noopener noreferrer"},"Learn more about configuration ",po.createElement("i",{className:"fas fa-external-link-alt"})))})))},_F=jte;import{Grid as Xte}from"@patternfly/react-core";var _p=e=>{let[t,o]=Yi.useState(),[r,s]=Yi.useState(""),n=e?.id,i=e?.status,a=vl(e?.monitoredOperators),l=mi(e),p=l.filter(d=>d.status==="failed"),c=Yi.useMemo(()=>a.find(d=>d.name==="console"),[a]),u=Yi.useCallback(()=>{(async()=>{if(s(""),!!n)try{let g=await X.getCredentials(n);o(g.data)}catch(g){s(U(g))}})()},[n]),m=c?.status;return Yi.useEffect(()=>{(!m&&i==="installed"||m==="available")&&u()},[i,m,u]),{credentials:t,credentialsError:r,olmOperators:l,failedOlmOperators:p,consoleOperator:c,fetchCredentials:u}},Jte=({cluster:e,clusterVarieties:t,showAddHostsInfo:o=!0,showKubeConfig:r=!0})=>{let{credentials:s,credentialsError:n,consoleOperator:i,fetchCredentials:a}=t,l=i?.status==="available"||!i&&e.status==="installed";return Yi.createElement(Xte,{hasGutter:!0},l&&Yi.createElement(jl,{cluster:e,credentials:s,error:!!n,retry:a,idPrefix:fs("cluster-creds"),credentialsError:n}),Yi.createElement(_F,{cluster:e,showAddHostsInfo:o,showKubeConfig:r}))},Rp=Jte;import Vt from"react";import{Stack as zF,StackItem as Bp}from"@patternfly/react-core";import Ie from"react";import{Alert as pI,AlertActionLink as Bg,Text as Zte,TextContent as Qte}from"@patternfly/react-core";import{pluralize as eoe}from"humanize-plus";var toe=(e,t)=>{let o="";for(let r=0;r<e.length;r++){let s=e[r].name||"";r>0&&(r===e.length-1?o+=" and ":o+=", "),o+=`${s&&pc(t)[s]} (${s&&s.toUpperCase()})`}return o},ooe=(e,t,o,r)=>r==="worker"?Ce?Ie.createElement(Ie.Fragment,null,"Error information for each host can be found in the host inventory table. To retry adding failed hosts, navigate to the clusters list inside OpenShift Cluster Manager, click your cluster name, and select the ",Ie.createElement("b",null,"Add hosts")," tab."):Ie.createElement(Ie.Fragment,null,"Error information for each host can be found in the host inventory table. To retry adding failed hosts, press the ",Ie.createElement("b",null,"Add hosts")," button."):Ie.createElement(Ie.Fragment,null,e,"/",t," ",eoe(t,r)," ",o," Due to this, the cluster will be degraded. Please check the installation log for more information."),ju=({cluster:e,failedHosts:t,totalHosts:o,title:r,hostsType:s,failedOperators:n=[],message:i})=>{let{addAlert:a}=M(),{t:l}=f();return Ie.createElement(Ie.Fragment,null,Ie.createElement(pI,{isInline:!0,variant:"warning",title:r,actionLinks:Ie.createElement(Ie.Fragment,null,Ie.createElement(Bg,{id:"cluster-installation-logs-button",onClick:()=>Wi(a,e.id),isDisabled:!di(e)},"Download installation logs"))},Ie.createElement(ae,{condition:t!==0},Ie.createElement("p",null,ooe(t,o,i,s))),Ie.createElement(ae,{condition:n?.length>0},Ie.createElement("p",null,toe(n,l)," failed to install. Due to this, the cluster will be degraded, but you can try to install the operator from the Operator Hub. Please check the installation log for more information."))))},RF=({cluster:e,failedHosts:t,totalHosts:o,isCriticalNumberOfWorkersFailed:r})=>{let{addAlert:s}=M(),{resetClusterDialog:n}=ve(),i=p=>`cluster-install-error-${p}`,a,l;return e.highAvailabilityMode==="None"||t>0?(a="Control plane was not installed",l=`${t}/${o} control plane nodes failed to install. Please check the installation logs for more information.`):r?(a="Critical number of workers were not installed",l="Only one worker was able to be installed. Please check the installation logs for more information."):(a="Initialization failed",l=Ie.createElement(Qte,null,Ie.createElement(Zte,{component:"p"},To(e.statusInfo),Ie.createElement("br",null),"Reset the installation process to return to the configuration and try again. Some hosts may need to be re-registered by rebooting into the Discovery ISO."))),Ie.createElement(Ie.Fragment,null,Ie.createElement(pI,{isInline:!0,variant:"danger",title:a,actionLinks:Ie.createElement(Ie.Fragment,null,Ie.createElement(Bg,{id:"button-reset-cluster",onClick:()=>n.open({cluster:e})},"Reset Cluster"),Ie.createElement(Bg,{id:"cluster-installation-logs-button",onClick:()=>Wi(s,e.id),isDisabled:!di(e)},"Download installation logs"),Ie.createElement(Bg,{onClick:()=>window.open(nc(),"_blank"),id:i("button-report-bug")},"Report a bug"))},l))},BF=()=>Ie.createElement(Ie.Fragment,null,Ie.createElement(pI,{isInline:!0,variant:"success",title:"Installation completed successfully"}," "));var WF=(e,t)=>{let o=e.filter(n=>n.role&&n.role===t),r=o.filter(n=>["cancelled","error"].includes(n.status)),s=o.filter(n=>["installing-pending-user-action"].includes(n.status));return[o.length,r.length,s.length]},roe=e=>e.filter(t=>t.status&&t.status==="failed"),GF=(e,t,o)=>{let[r,s,n]=WF(e,"master"),[i,a,l]=WF(e,"worker"),p=roe(o);return["error","cancelled"].includes(t.status)?Vt.createElement(zF,null,Vt.createElement(Bp,null,Vt.createElement(RF,{cluster:t,totalHosts:r,failedHosts:s,isCriticalNumberOfWorkersFailed:a===1}))):Vt.createElement(zF,{hasGutter:!0},Vt.createElement(ae,{condition:t.status==="installed"},Vt.createElement(Bp,null,Vt.createElement(BF,null))),Vt.createElement(ae,{condition:a>0},Vt.createElement(Bp,null,Vt.createElement(ju,{cluster:t,totalHosts:i,failedHosts:a,title:`Could not install ${a} worker hosts`,hostsType:"worker",message:"failed to install."}))),Vt.createElement(ae,{condition:p.length>0},Vt.createElement(Bp,null,Vt.createElement(ju,{cluster:t,totalHosts:r,failedHosts:s,title:"Some operators failed to install",failedOperators:p,message:"failed to install."}))),Vt.createElement(ae,{condition:n>0},Vt.createElement(Bp,null,Vt.createElement(ju,{cluster:t,totalHosts:r,failedHosts:s,title:"Some hosts are pending user action",failedOperators:p,message:"are pending user action."}))),Vt.createElement(ae,{condition:l>0},Vt.createElement(Bp,null,Vt.createElement(ju,{cluster:t,totalHosts:i,failedHosts:a,title:"Some hosts are pending user action",message:"are pending user action."}))))};var ioe=({cluster:e})=>{let{addAlert:t}=M(),{resetClusterDialog:o,cancelInstallationDialog:r}=ve(),s=_p(e),{credentials:n,credentialsError:i}=s,a=Pe(),l=e.openshiftVersion&&a.isFeatureSupported(e.openshiftVersion,"SINGLE_NODE_EXPANSION"),p=(!ne(e)||l)&&e.status==="installed"&&!Ce;return ge.createElement(soe,{hasGutter:!0},ge.createElement(cI,null,ge.createElement(noe,{hasGutter:!0},ge.createElement(Ya,null,ge.createElement(KF,null,ge.createElement($F,{component:"h2"},"Installation progress"))),ge.createElement(Ya,{span:6},ge.createElement(xi,{cluster:e,totalPercentage:e.progress?.totalPercentage||0})),ge.createElement(Ya,{span:6,rowSpan:4}),ge.createElement(Ya,{span:6},ge.createElement(Lf,{cluster:e,onFetchEvents:hs})),ge.createElement(Ya,{span:6},GF(An(e.hosts),e,mi(e))),ge.createElement(Ya,{span:6},ge.createElement(Rp,{cluster:e,clusterVarieties:s})),ge.createElement(Ya,null,ge.createElement(KF,null,ge.createElement($F,{component:"h2"},"Host Inventory")),ge.createElement(Np,{cluster:e,skipDisabled:!0})),ge.createElement(Rg,{cluster:e}))),ge.createElement(cI,null,ge.createElement(mr,null)),ge.createElement(cI,null,ge.createElement(Eg,null,Sg(e)&&ge.createElement(Rt,{id:fs("button-cancel-installation"),variant:zg.danger,onClick:()=>r.open({clusterId:e.id})},"Abort Installation"),e.status==="error"&&ge.createElement(Rt,{id:fs("button-reset-cluster"),onClick:()=>o.open({cluster:e})},"Reset Cluster"),["finalizing","installed"].includes(e.status)&&ge.createElement(tT,{isDisabled:!n||!!i,cluster:e,consoleUrl:n?.consoleUrl,id:fs("button-launch-console")}),p&&ge.createElement(Rt,{variant:zg.primary,component:c=>ge.createElement(UF,{to:`${Te}/clusters/${e.id}`,...c}),id:fs("button-add-hosts"),onClick:async()=>{try{let{data:c}=await X.allowAddHosts(e.id);St(c)}catch(c){D(c)}}},"Add hosts"),!ds()&&ge.createElement(Rt,{variant:zg.link,component:c=>ge.createElement(UF,{to:`${Te}/clusters`,...c}),id:fs("button-back-to-all-clusters")},"Back to all clusters"),ge.createElement(wc,null,ge.createElement(Rt,{id:"cluster-installation-logs-button",variant:zg.link,onClick:()=>Wi(t,e.id),isDisabled:!di(e)},"Download Installation Logs"),ge.createElement(yi,{cluster:e,onFetchEvents:hs})))))},Wg=ioe;import wo from"react";import{Card as coe,Title as uoe,CardBody as XF,CardHeader as moe,CardExpandableContent as doe,Grid as foe,GridItem as goe}from"@patternfly/react-core";import{Flex as aoe,FlexItem as Gg,Button as qF,ButtonVariant as YF}from"@patternfly/react-core";import Qn from"react";var loe=e=>`cluster-detail-${e}`,poe=({cluster:e})=>{let{addAlert:t}=M(),{cancelInstallationDialog:o}=ve();return Qn.createElement(aoe,{className:"assisted-ui-vertical-margin",spaceItems:{default:"spaceItemsSm"},direction:{default:"row"},justifyContent:{default:"justifyContentFlexStart"}},Qn.createElement(Gg,null,Qn.createElement(qF,{"data-testid":"cluster-installation-abort-button",variant:YF.danger,onClick:()=>o.open({clusterId:e.id}),isDisabled:!Sg(e)},"Abort Installation")),Qn.createElement(Gg,null,Qn.createElement(Ti,{status:e.status,clusterId:e.id,"data-testid":loe("button-download-kubeconfig")})),Qn.createElement(Gg,null,Qn.createElement(yi,{cluster:e,onFetchEvents:hs})),Qn.createElement(Gg,null,Qn.createElement(qF,{"data-testid":"cluster-installation-logs-button",variant:YF.link,onClick:()=>Wi(t,e.id),isDisabled:!di(e)},"Download Installation Logs")))},jF=poe;var hoe=({cluster:e})=>{let[t,o]=wo.useState(e.status!=="installed"),r=_p(e);return wo.createElement(coe,{"data-testid":"ai-cluster-details-card",isExpanded:t},wo.createElement(moe,{onExpand:()=>o(!t),toggleButtonProps:{"data-testid":"toggle-ai-cluster-details","aria-label":"AI Cluster Details","aria-labelledby":"titleId toggle-button","aria-expanded":t}},wo.createElement(uoe,{headingLevel:"h1",size:"lg",className:"card-title"},"Installation progress"),!t&&wo.createElement("div",{className:"pf-u-ml-md"},wo.createElement(Uu,{status:e.status}))),wo.createElement(XF,null,wo.createElement(xi,{cluster:e,minimizedView:!t,totalPercentage:e.progress?.totalPercentage||0}),wo.createElement(jF,{cluster:e})),wo.createElement(doe,null,wo.createElement(XF,null,wo.createElement(foe,{hasGutter:!0},wo.createElement(Rp,{cluster:e,clusterVarieties:r,showAddHostsInfo:!1,showKubeConfig:!1}),wo.createElement(goe,null,wo.createElement(Np,{cluster:e,skipDisabled:!0}))))))},Ug=hoe;import se from"react";import{Provider as Epe}from"react-redux";import{Link as Fpe}from"react-router-dom";import{Button as Npe,ButtonVariant as Vpe,Card as BI,CardBody as zI,CardHeader as WI,Title as GI}from"@patternfly/react-core";import uI from"react";import{useSelector as Coe,useDispatch as JF}from"react-redux";var yoe=(e,t)=>e===ue.ERROR?t:![ue.LOADING,ue.RELOADING].includes(e),Xu=e=>{let t=JF();return uI.useCallback(()=>t(Wu(e)),[e,t])},Kg=e=>{let{isReloadScheduled:t,uiState:o,data:r,errorDetail:s}=Coe(Gu),n=JF(),i=Xu(e),a=!!r;return uI.useEffect(()=>{t&&yoe(o,a)&&i(),n(Hv())},[i,n,t,a,o]),uI.useEffect(()=>{i();let l=window.setInterval(()=>n(zi()),ua);return()=>{clearInterval(l),n(Hv()),n(_E())}},[n,i]),{cluster:r,uiState:o,errorDetail:s}};import ks from"react";import npe from"classnames";import Ze from"react";import{useDispatch as zre,useSelector as wN}from"react-redux";import{Formik as Wre,useFormikContext as Gre}from"formik";import{Form as Ure,Grid as DN,GridItem as hI,Text as Kre,TextContent as $re}from"@patternfly/react-core";import ZF from"react";var QF=ZF.createContext(null),We=()=>{let e=ZF.useContext(QF);if(!e)throw new Error("useClusterWizardContext must be used within ClusterWizardContextProvider");return e},eN=QF;import ji from"react";import{useHistory as koe}from"react-router-dom";import{Alert as xoe,AlertGroup as Toe,AlertVariant as Poe}from"@patternfly/react-core";import Soe from"react";import{Alert as voe,AlertVariant as Ioe}from"@patternfly/react-core";var boe={vsphere:"vSphere",nutanix:"Nutanix"},tN={vsphere:ca,nutanix:hC},oN=({clusterId:e,platformType:t})=>{let{isPlatformIntegrationSupported:o,supportedPlatformIntegration:r}=qi(e);if(!(o&&!is({platform:{type:t}})))return null;let n=boe[r];return Soe.createElement(voe,{title:`Discover the full potential of ${n} integration`,variant:Ioe.info,isInline:!0,"data-testid":"discover-platform-integration-hosts"},`Since all of your hosts originated from the ${n} platform, you now have the option to integrate with it.`)};var Aoe="Provided cluster configuration is not valid",woe=({cluster:e,errorFields:t=[],alertTitle:o,alertContent:r})=>{let{currentStepId:s}=We(),n=e&&Rb(e),{t:i}=f(),a=r;return a===void 0&&(a=`The following fields are invalid or missing:
32
+ ${t.map(l=>ac(i)[l]||l).join(", ")}.`),ji.createElement(Toe,null,!!t.length&&ji.createElement(xoe,{variant:Poe.danger,title:o||Aoe,isInline:!0},a),s==="host-discovery"&&e&&ji.createElement(oN,{clusterId:e.id,platformType:e.platform?.type||"none"}),e&&ji.createElement(Bc,{currentStepId:s,clusterStatus:e.status,hosts:e?.hosts||[],validationsInfo:n,wizardStepsValidationsMap:vt}))},Doe=({cluster:e,additionalActions:t,errorFields:o,alertTitle:r,alertContent:s,onCancel:n,...i})=>{let{alerts:a}=M(),l=koe(),p=ji.useCallback(()=>l.push(`${Te}/clusters/`),[l]),c=a.length?ji.createElement(mr,null):void 0;return ji.createElement(Lr,{alerts:c,errors:ji.createElement(woe,{cluster:e,errorFields:o,alertTitle:r,alertContent:s}),onCancel:n||p,leftExtraActions:t,cluster:e,onFetchEvents:hs,...i})},er=Doe;import qg from"react";import{WizardNav as sN}from"@patternfly/react-core";var Ju={"cluster-details":"Cluster details",operators:"Operators","host-discovery":"Host discovery","static-ip-yaml-view":"Static network configurations","static-ip-network-wide-configurations":"Network-wide configurations","static-ip-host-configurations":"Host specific configurations",storage:"Storage",networking:"Networking",review:"Review and create"},rN=["cluster-details","operators","host-discovery","storage","networking","review"],$g=["static-ip-network-wide-configurations","static-ip-host-configurations"];var Eoe=(e,t)=>{if(!t)return!0;switch(e){case"cluster-details":return!t.validationsInfo||Gi({cluster:t});case"static-ip-yaml-view":case"static-ip-host-configurations":case"static-ip-network-wide-configurations":return Gi({cluster:t});case"host-discovery":return xg({cluster:t});case"storage":return Tg({cluster:t});case"networking":return Pg({cluster:t});default:return!0}},Foe=({cluster:e})=>{let t=We(),o=a=>!t.wizardStepIds.slice(a).includes(t.currentStepId),r=(a,l)=>l==="cluster-details"?!1:o(a),s=(a,l)=>qg.createElement(Oo,{step:a,key:l,content:Ju[l],onNavItemClick:()=>t.setCurrentStepId(l),isCurrent:t.currentStepId===l,isDisabled:r(a,l),isValid:()=>Eoe(l,e)}),n=a=>qg.createElement(Oo,{step:a,isExpandable:!0,content:"Static network configurations",key:"static-network-configuration-form-view",isCurrent:Ka(t.currentStepId),isDisabled:o(a)},qg.createElement(sN,{returnList:!0},$g.map((l,p)=>s(a+p,l))));return qg.createElement(sN,null,(()=>{let a=[],l=0;for(;l<t.wizardStepIds.length;){let p=t.wizardStepIds[l];p!=="static-ip-network-wide-configurations"?(a.push(s(l,p)),l+=1):(a.push(n(l)),l+=2)}return a})())},Do=Foe;import{Fragment as Boe,createElement as Yg}from"react";import{createElement as mI,useCallback as _oe,useMemo as Ooe}from"react";import{sortable as Hoe}from"@patternfly/react-table";import Noe from"react";var Voe=e=>{let t=ia("networking",vt,e.host),o=Vn[t],r=na(e.validationsInfo,"networking",vt),s=ul(r,"networking",vt)?"Some validations failed":void 0;return Noe.createElement(Ls,{...e,status:{...o,sublabel:s},validationsInfo:r,AdditionalNTPSourcesDialogToggleComponent:gs})},nN=Voe;var Moe=e=>({header:{title:"Status",transforms:[Hoe]},cell:t=>{let o=e?()=>e(t):void 0,r=G(t.validationsInfo)||{};return{title:mI(nN,{host:t,onEditHostname:o,validationsInfo:r}),props:{"data-testid":"nic-status"},sortableValue:status}}}),Loe=({cluster:e,AdditionalNTPSourcesDialogToggleComponent:t,onEditHost:o,onEditRole:r,canEditRole:s,canEditHostname:n,actionResolver:i,children:a,onSelect:l,selectedIDs:p})=>{let{t:c}=f(),u=Ooe(()=>[wt(c,o,void 0,n),Ut(c,s,r,Hr(e)),Moe(o),iu(e),ZT(e),QT(e),eP(e),Ei(e)],[c,o,r,n,s,e]),m=e.hosts||[],d=Be(m.length),g=_oe(({obj:C})=>mI(zr,{host:C,AdditionalNTPSourcesDialogToggleComponent:t}),[t]);return mI(Xe,{testId:"networking-host-table",hosts:m,ExpandComponent:g,content:u,actionResolver:i,onSelect:l,selectedIDs:p,...d},a)},iN=Loe;var Roe=({cluster:e})=>{let{actionChecks:t,onEditHost:o,actionResolver:r,...s}=Ui(e);return Yg(Boe,null,Yg(iN,{cluster:e,AdditionalNTPSourcesDialogToggleComponent:gs,onEditHost:o,canEditHostname:t.canEditHostname,actionResolver:r},Yg(lp,{isSNO:ne(e)})),Yg(Ki,{cluster:e,...s}))},aN=Roe;import Zu from"react";function ei(e,t){let[o,r]=Zu.useState(),[s,n]=Zu.useState(""),{infraEnvId:i,error:a}=Hg(e,t),l=Zu.useCallback(async()=>{try{if(i){let{data:c}=await Je.get(i);r(c)}}catch(c){n(U(c))}},[i]),p=Zu.useCallback(async c=>{if(!i)throw"updateInfraEnv should not be called before infra env was loaded";Je.abortLastGetRequest();let{data:u}=await Je.update(i,c);return r(u),u},[i]);return Zu.useEffect(()=>{a?n(a):o||l()},[l,o,i,a]),{infraEnv:o,error:s,isLoading:!o&&!s,updateInfraEnv:p}}import{array as Goe,lazy as zoe,object as Woe}from"yup";var lN=(e,t)=>{let o=ne(e),r=va(e);return{apiVip:e.apiVip||"",ingressVip:e.ingressVip||"",sshPublicKey:e.sshPublicKey||"",vipDhcpAllocation:e.vipDhcpAllocation,managedNetworkingType:e.userManagedNetworking?"userManaged":"clusterManaged",networkType:e.networkType||fi(o,r),machineNetworks:e.machineNetworks||[],stackType:r?Vo:os,clusterNetworks:e.clusterNetworks||(r?t.clusterNetworksDualstack:t.clusterNetworksIpv4),serviceNetworks:e.serviceNetworks||(r?t.serviceNetworksDualstack:t.serviceNetworksIpv4)}},pN=(e,t)=>zoe(o=>Woe().shape({apiVip:ls(t,o,e.apiVip),ingressVip:ls(t,o,e.ingressVip),sshPublicKey:go,machineNetworks:o.managedNetworkingType==="userManaged"?Goe():ad.when("stackType",{is:os,then:Fl,otherwise:o.machineNetworks&&o.machineNetworks?.length>=2&&El("machine networks")}),clusterNetworks:ld.when("stackType",{is:os,then:Fl,otherwise:o.clusterNetworks&&o.clusterNetworks?.length>=2&&El("cluster network")}),serviceNetworks:pd.when("stackType",{is:os,then:Fl,otherwise:o.serviceNetworks&&o.serviceNetworks?.length>=2&&El("service network")})}));import Mt from"react";import{useFormikContext as Fre}from"formik";import{useSelector as Nre}from"react-redux";import{Alert as Vre,AlertVariant as Hre,Grid as Mre,Tooltip as Lre}from"@patternfly/react-core";import Ne from"react";import{useSelector as Yoe}from"react-redux";import{useFormikContext as joe}from"formik";import{Spinner as Xoe,Alert as Joe,AlertVariant as Zoe,Tooltip as Qoe}from"@patternfly/react-core";import{createElement as dN,forwardRef as qoe}from"react";import{useSelector as cN}from"react-redux";import{Checkbox as Uoe,Radio as Koe}from"@patternfly/react-core";function Xi(e){return function(o){let{isViewerMode:r}=cN(ce),s=o.isDisabled||r;return dN(e,{...o,isDisabled:s})}}function $oe(e){return qoe(function(o,r){let{isViewerMode:s}=cN(ce),n=o.isDisabled||s;return dN(e,{ref:r,...o,isDisabled:n})})}var ft=Xi(J),ja=Xi(es),qr=Xi(eo),jg=Xi(Fr),dI=Xi(ie),uN=Xi(Ca),Xg=Xi(Uoe),fI=Xi(Koe),mN=$oe(fo);var fN=({vipName:e,cluster:t,validationErrorMessage:o})=>{let{vipDhcpAllocation:r}=t,s=Pn(t);return r&&t[e]?Ne.createElement(Ne.Fragment,null,t[e]):r&&o?Ne.createElement(Joe,{variant:Zoe.danger,title:"The DHCP server failed to allocate the IP",isInline:!0},o):r&&s?Ne.createElement(Ne.Fragment,null,Ne.createElement(Xoe,{size:"md"}),Ne.createElement("i",null," This IP is being allocated by the DHCP server")):Ne.createElement("i",null,"This IP will be allocated by the DHCP server")},gN=(e,t,o)=>o?t&&e?"This IP was allocated by the DHCP server.":"":"Make sure that the VIP is unique and not used by any other device on your network.",ere=e=>{let t=G(e)||{},o=["VIP IP allocation from DHCP server has been timed out","IP allocation from the DHCP server timed out."];return(t.network||[]).reduce((r,s)=>(["api-vip-defined","ingress-vip-defined"].includes(s.id)&&(r[s.id]=s.status==="failure"&&o.find(n=>s.message.match(n))?s.message:void 0),r),{})},hN=({cluster:e,isVipDhcpAllocationDisabled:t})=>{let{values:o,setFieldValue:r}=joe(),{isViewerMode:s}=Yoe(ce),n=`Provide an endpoint for users, both human and machine, to interact with and configure the platform. If needed, contact your IT manager for more information. ${gN(e.apiVip,e.vipDhcpAllocation,o.vipDhcpAllocation)}`,i=`Provide an endpoint for application traffic flowing in from outside the cluster. If needed, contact your IT manager for more information. ${gN(e.ingressVip,e.vipDhcpAllocation,o.vipDhcpAllocation)}`,{"api-vip-defined":a,"ingress-vip-defined":l}=Ne.useMemo(()=>ere(e.validationsInfo),[e.validationsInfo]),p=o.networkType===ts;Ne.useEffect(()=>{!s&&!p&&r("vipDhcpAllocation",!1)},[p,s,r]);let c=Ne.useCallback(u=>{r("apiVip",u?"":e.apiVip),r("ingressVip",u?"":e.ingressVip)},[e.apiVip,e.ingressVip,r]);return Ne.createElement(Ne.Fragment,null,!t&&Ne.createElement(qr,{onChange:c,label:Ne.createElement(Ne.Fragment,null,Ne.createElement(Qoe,{hidden:p,content:"A cluster with OVN networking type cannot use 'allocate IPs via DHCP server'"},Ne.createElement("span",null,"Allocate IPs via DHCP server")),Ne.createElement(ko,{featureId:"VIP_AUTO_ALLOC",openshiftVersion:e.openshiftVersion})),name:"vipDhcpAllocation",isDisabled:!p}),o.vipDhcpAllocation?Ne.createElement(Ne.Fragment,null,Ne.createElement(hi,{label:"API IP",name:"apiVip",helperText:n,value:o.apiVip||"",isValid:!a,isRequired:!0},Ne.createElement(fN,{vipName:"apiVip",cluster:e,validationErrorMessage:a})),Ne.createElement(hi,{label:"Ingress IP",name:"ingressVip",helperText:i,value:o.ingressVip||"",isValid:!l,isRequired:!0},Ne.createElement(fN,{vipName:"ingressVip",cluster:e,validationErrorMessage:l}))):Ne.createElement(Ne.Fragment,null,Ne.createElement(ft,{label:"API IP",name:"apiVip",helperText:n,isRequired:!0}),Ne.createElement(ft,{name:"ingressVip",label:"Ingress IP",helperText:i,isRequired:!0})))};import Ht from"react";import{useSelector as tre}from"react-redux";import{ButtonVariant as ore,FormGroup as rre,Tooltip as sre}from"@patternfly/react-core";import{useFormikContext as nre}from"formik";import{Address6 as ire}from"ip-address";var are=(e,t,o,r)=>e&&t&&(r.machineNetworks&&r.machineNetworks[1].cidr!==o||r.clusterNetworks&&r.clusterNetworks[1].cidr!==e[1].cidr||r.clusterNetworks&&r.clusterNetworks[1].hostPrefix!==e[1].hostPrefix||r.serviceNetworks&&r.serviceNetworks[1].cidr!==t[1].cidr),CN=({clusterId:e,isDualStackSelectable:t,hostSubnets:o})=>{let{setFieldValue:r,values:s,validateForm:n}=nre(),[i,a]=Ht.useState(!1),l=Op(["clusterNetworksDualstack","clusterNetworksIpv4","serviceNetworksDualstack","serviceNetworksIpv4"]),p=o.filter(h=>ire.isValid(h.subnet)),c=p.length>=1?p[0].subnet:Ue,{isViewerMode:u}=tre(ce),m=!u&&!t&&s.stackType===Vo,d=Ht.useCallback(()=>{r("stackType",os),s.machineNetworks&&s.machineNetworks?.length>=2&&r("machineNetworks",s.machineNetworks.slice(0,1)),s.clusterNetworks&&s.clusterNetworks?.length>=2&&r("clusterNetworks",s.clusterNetworks.slice(0,1)),s.serviceNetworks&&s.serviceNetworks?.length>=2&&r("serviceNetworks",s.serviceNetworks.slice(0,1)),n()},[r,n,s.clusterNetworks,s.machineNetworks,s.serviceNetworks]),g=()=>{r("stackType",Vo),r("vipDhcpAllocation",!1),s.networkType===ts&&r("networkType",kn),s.machineNetworks&&s.machineNetworks?.length<2&&r("machineNetworks",[...s.machineNetworks,{cidr:c,clusterId:e}],!1),s.clusterNetworks&&s.clusterNetworks?.length<2&&r("clusterNetworks",[...s.clusterNetworks,l.clusterNetworksDualstack?.length?l.clusterNetworksDualstack[1]:{cidr:"",hostPrefix:"",clusterId:e}],!1),s.serviceNetworks&&s.serviceNetworks?.length<2&&r("serviceNetworks",[...s.serviceNetworks,l.serviceNetworksDualstack?.length?l.serviceNetworksDualstack[1]:{cidr:"",clusterId:e}],!1)},C=h=>{h.target.value===Vo?g():are(l.clusterNetworksDualstack||[],l.serviceNetworksDualstack||[],c,s)?a(!0):d()};return Ht.useEffect(()=>{m&&d()},[m,d]),Ht.createElement(sre,{content:"Dual-stack is only available when your hosts are using IPV4 together with IPV6.",hidden:t,position:"top-start"},Ht.createElement(Ht.Fragment,null,Ht.createElement(rre,{label:"Networking stack type",fieldId:E("stackType","radio"),isInline:!0,onChange:C},Ht.createElement(dI,{name:"stackType",value:os,isDisabled:!t,label:Ht.createElement(Ht.Fragment,null,"IPv4"," ",Ht.createElement(H,{noVerticalAlign:!0,bodyContent:"Select this when your hosts are using only IPv4."}))}),Ht.createElement(dI,{name:"stackType",value:Vo,isDisabled:!t,label:Ht.createElement(Ht.Fragment,null,"Dual-stack"," ",Ht.createElement(H,{noVerticalAlign:!0,bodyContent:"Select dual-stack when your hosts are using IPV4 together with IPV6."}))})),i&&Ht.createElement(Fn,{title:"Change stack type?",titleIconVariant:"warning",confirmationButtonText:"Change",confirmationButtonVariant:ore.primary,content:Ht.createElement(Ht.Fragment,null,Ht.createElement("p",null,"All data and configuration done for 'Dual-stack' will be lost.")),onClose:()=>{a(!1),g()},onConfirm:()=>{a(!1),d()}})))};import ti,{useEffect as lre}from"react";import{useSelector as pre}from"react-redux";import{Alert as cre,AlertVariant as ure,FormGroup as mre,Stack as dre,StackItem as yN}from"@patternfly/react-core";import{FieldArray as fre,useFormikContext as gre}from"formik";import{Address4 as hre,Address6 as Cre}from"ip-address";var SN=(e,t)=>e.humanized.localeCompare(t.humanized),yre=e=>e.map((t,o)=>({label:t.humanized,value:t.subnet,isDisabled:!1,id:`form-input-hostSubnet-field-option-${o}`})),Sre=e=>({label:`Please select a subnet. (${e} available)`,value:Ue,isDisabled:!0,id:"form-input-hostSubnet-field-option-no-subnet-selected"}),vre={label:"No subnets are currently available",value:Ue,id:"form-input-hostSubnet-field-option-no-subnet-available"},Ire=(e,t,o,r)=>{lre(()=>{e&&t("machineNetworks",[{cidr:o,clusterId:r}],!0)},[e,o,r,t])},vN=({clusterId:e,hostSubnets:t,isRequired:o=!1,isDisabled:r})=>{let{values:s,errors:n,setFieldValue:i}=gre(),a=s.stackType===Vo,{isViewerMode:l}=pre(ce),p=t.filter(C=>hre.isValid(C.subnet)).sort(SN),c=t.filter(C=>Cre.isValid(C.subnet)).sort(SN),u=p.length>=1?p[0].subnet:Ue,m=(s.machineNetworks??[]).length===0;Ire(!l&&m,i,u,e);let g=ti.useMemo(()=>C=>C.length===0?[vre]:[Sre(C.length)].concat(yre(C)),[]);return ti.createElement(mre,{label:"Machine network",labelInfo:a&&"Primary",fieldId:"machine-networks",isRequired:!0},ti.createElement(fre,{name:"machineNetworks"},()=>ti.createElement(dre,null,a?s.machineNetworks?.map((C,h)=>{let S=h===1?c:p;return ti.createElement(yN,{key:h},ti.createElement(ja,{name:`machineNetworks.${h}.cidr`,options:g(S),isRequired:o,isDisabled:r}))}):ti.createElement(yN,null,ti.createElement(ja,{name:"machineNetworks.0.cidr",options:g(p),isRequired:o,isDisabled:r})))),typeof n.machineNetworks=="string"&&ti.createElement(cre,{variant:ure.warning,title:n.machineNetworks,isInline:!0}))};import tr from"react";import{Alert as IN,AlertVariant as bN,FormGroup as kN,StackItem as gI,TextInputTypes as bre,Grid as kre,Stack as xre}from"@patternfly/react-core";import{FieldArray as xN,useFormikContext as Tre}from"formik";var TN=(e,t)=>t?` (${e===0?"IPv4":"IPv6"})`:"",Pre="The subnet prefix length to assign to each individual node. For example, if Cluster Network Host Prefix is set to 23, then each node is assigned a /23 subnet out of the given cidr (clusterNetworkCIDR), which allows for 510 (2^(32 - 23) - 2) pod IPs addresses. If you are required to provide access to nodes from an external network, configure load balancers and routers to manage the traffic.",Are="The subnet prefix length to assign to each individual node. For example, if Cluster Network Host Prefix is set to 116, then each node is assigned a /116 subnet out of the given cidr (clusterNetworkCIDR), which allows for 4,094 (2^(128 - 116) - 2) pod IPs addresses. If you are required to provide access to nodes from an external network, configure load balancers and routers to manage the traffic.",wre="IP address block from which Pod IPs are allocated. This block must not overlap with existing physical networks. These IP addresses are used for the Pod network, and if you need to access the Pods from an external network, configure load balancers and routers to manage the traffic.",Dre="The IP address pool to use for service IP addresses. You can enter only one IP address pool. If you need to access the services from an external network, configure load balancers and routers to manage the traffic.",Ere=()=>{let{setFieldValue:e,values:t,errors:o}=Tre(),r=t.stackType===Vo,s=l=>parseInt((t.clusterNetworks&&t.clusterNetworks[l].cidr||"").split("/")[1])||1,n=(l,p)=>{isNaN(parseInt(l.target.value))&&e(`clusterNetworks.${p}.hostPrefix`,s(p))},i=l=>r?!!l:!1,a=l=>i(l)?Are:Pre;return tr.createElement(kre,{hasGutter:!0,className:"pf-u-ml-lg"},tr.createElement(xN,{name:"clusterNetworks"},()=>tr.createElement(kN,{fieldId:"clusterNetworks",labelInfo:r&&"Primary"},t.clusterNetworks?.map((l,p)=>{let c=TN(p,r);return tr.createElement(xre,{key:p},tr.createElement(gI,{className:"network-field-group pf-u-pb-md"},tr.createElement(ft,{name:`clusterNetworks.${p}.cidr`,label:`Cluster network CIDR${c}`,helperText:wre,isRequired:!0,labelInfo:p===0&&r?"Primary":""})),tr.createElement(gI,{className:"network-field-group pf-u-pb-md"},tr.createElement(ft,{name:`clusterNetworks.${p}.hostPrefix`,label:`Cluster network host prefix${c}`,type:bre.number,min:s(p),max:i(p)?fa.IPv6:fa.IPv4,onBlur:u=>n(u,p),helperText:a(p),isRequired:!0})))}))),typeof o.clusterNetworks=="string"&&tr.createElement(IN,{variant:bN.warning,title:o.clusterNetworks,isInline:!0}),tr.createElement(xN,{name:"serviceNetworks"},()=>tr.createElement(kN,{fieldId:"serviceNetworks",labelInfo:r&&"Primary"},t.serviceNetworks?.map((l,p)=>tr.createElement(gI,{key:p,className:"network-field-group pf-u-pb-md"},tr.createElement(ft,{name:`serviceNetworks.${p}.cidr`,label:`Service network CIDR${TN(p,r)}`,helperText:Dre,isRequired:!0,labelInfo:p===0&&r?"Primary":""}))))),typeof o.serviceNetworks=="string"&&tr.createElement(IN,{variant:bN.warning,title:o.serviceNetworks,isInline:!0}))},PN=Ere;var Ore=Mt.createElement(Vre,{title:"Your cluster will be subject to support limitations",variant:Hre.info,isInline:!0,"data-testid":"networking-vms-alert"},"Some or all of your discovered hosts are virtual machines, so selecting the cluster-managed networking option will limit your installed cluster's support."),_re=(e,t)=>!(WC(e.serviceNetworks||[],t.serviceNetworksIpv4||[])&&GC(e.clusterNetworks||[],t.clusterNetworksIpv4||[])),Rre=(e,t,o,r)=>e?{isNetworkManagementDisabled:!0,networkManagementDisabledReason:"Network management selection is not supported with dual-stack"}:t&&o===_.ARM&&!r.isFeatureSupported(t,"ARM64_ARCHITECTURE_WITH_CLUSTER_MANAGED_NETWORKING")?{isNetworkManagementDisabled:!0,networkManagementDisabledReason:r.getFeatureDisabledReason(t,"ARM64_ARCHITECTURE_WITH_CLUSTER_MANAGED_NETWORKING")}:!!t&&r.isFeatureDisabled(t,"NETWORK_TYPE_SELECTION")?{isNetworkManagementDisabled:!0,networkManagementDisabledReason:r.getFeatureDisabledReason(t,"NETWORK_TYPE_SELECTION")}:{isNetworkManagementDisabled:!1,networkManagementDisabledReason:void 0},Bre=({cluster:e,hostSubnets:t,isVipDhcpAllocationDisabled:o,defaultNetworkSettings:r,hideManagedNetworking:s})=>{let{t:n}=f(),i=Pe(),{setFieldValue:a,values:l,validateField:p}=Fre(),c=Mt.useMemo(()=>Lg(e,i,n),[e,i,n]),u=ne(e),m=!u,d=l.managedNetworkingType==="userManaged",g=l.stackType===Vo,{isViewerMode:C}=Nre(ce),h=!C&&g&&!d,S=Mt.useMemo(()=>KC(t),[t]),v=Mt.useMemo(()=>kc(u,g),[u,g]),[y,I]=Mt.useState(g||_re(e,r));Mt.useEffect(()=>{d?(a("vipDhcpAllocation",!1),a("ingressVip","",!1),a("apiVip","",!1),m&&a("machineNetworks",[],!1)):l.vipDhcpAllocation||(p("ingressVip"),p("apiVip"))},[m,d,l.vipDhcpAllocation,a,p]);let b=Mt.useCallback(w=>{I(w),w||(a("clusterNetworks",g?r.clusterNetworksDualstack:r.clusterNetworksIpv4,!0),a("serviceNetworks",g?r.serviceNetworksDualstack:r.serviceNetworksIpv4,!0))},[a,g,r.clusterNetworksDualstack,r.clusterNetworksIpv4,r.serviceNetworksDualstack,r.serviceNetworksIpv4]);Mt.useEffect(()=>{h&&b(!0)},[h,b]);let{isNetworkManagementDisabled:k,networkManagementDisabledReason:T}=Mt.useMemo(()=>Rre(g,e.openshiftVersion,e.cpuArchitecture,i),[e.cpuArchitecture,e.openshiftVersion,i,g]);return Mt.createElement(Mre,{hasGutter:!0},!s&&Mt.createElement(Eu,{disabled:C||k,tooltip:T}),d&&Mt.createElement(Du,{shouldDisplayLoadBalancersBullet:m}),!d&&!!c&&c.CLUSTER_MANAGED_NETWORKING_WITH_VMS==="unsupported"&&Ore,(u||!d)&&Mt.createElement(CN,{clusterId:e.id,isDualStackSelectable:S,hostSubnets:t}),Mt.createElement(Bf,{isDisabled:C,isSDNSelectable:v}),!(d&&m)&&Mt.createElement(vN,{clusterId:e.id,hostSubnets:t,isRequired:!d,isDisabled:e.vipDhcpAllocation&&e.apiVip===void 0&&e.ingressVip===void 0||!1}),!d&&Mt.createElement(hN,{cluster:e,isVipDhcpAllocationDisabled:o}),Mt.createElement(Lre,{content:"Advanced networking properties must be configured in dual-stack",hidden:!g,position:"top-start"},Mt.createElement(Xg,{id:"useAdvancedNetworking",label:"Use advanced networking",description:"Configure advanced networking properties (e.g. CIDR ranges).",isChecked:y,onChange:b,isDisabled:g})),y&&Mt.createElement(PN,null))},AN=Bre;var qre=({cluster:e,hostSubnets:t,defaultNetworkSettings:o,infraEnv:r})=>{let{alerts:s}=M(),n=We(),{isViewerMode:i}=wN(ce),{errors:a,touched:l,isSubmitting:p,isValid:c,setFieldValue:u,values:m}=Gre(),d=lr(),g=uo(a,l),C=Ze.useMemo(()=>e.platform?.type==="nutanix",[]);Ze.useEffect(()=>{C&&m.vipDhcpAllocation&&u("vipDhcpAllocation",!1)},[C,u,m.vipDhcpAllocation]);let h=Ze.createElement(er,{cluster:e,errorFields:g,isSubmitting:p,isNextDisabled:p||d||!!s.length||!c||!Pg({cluster:e}),onNext:()=>n.moveNext(),onBack:()=>n.moveBack()});return Ze.createElement(Ee,{navigation:Ze.createElement(Do,{cluster:e}),footer:h},Ze.createElement(Ure,null,Ze.createElement(DN,{hasGutter:!0},Ze.createElement(hI,null,Ze.createElement(De,null,"Networking")),Ze.createElement(hI,{span:12,lg:10,xl:9,xl2:7},Ze.createElement(DN,{hasGutter:!0},Ze.createElement(AN,{cluster:e,hostSubnets:t,defaultNetworkSettings:o,isVipDhcpAllocationDisabled:C}),Ze.createElement(Zl,{clusterSshKey:e.sshPublicKey,imageSshKey:r?.sshAuthorizedKey,isDisabled:i}))),Ze.createElement(hI,null,Ze.createElement($re,null,Ze.createElement(Kre,{component:"h2"},"Host inventory")),Ze.createElement(aN,{cluster:e})))))},Yre=({cluster:e})=>{let{infraEnv:t,error:o,isLoading:r}=ei(e.id,_.USE_DAY1_ARCHITECTURE),s=Op(["clusterNetworksDualstack","clusterNetworksIpv4","serviceNetworksDualstack","serviceNetworksIpv4"]),{addAlert:n,clearAlerts:i,alerts:a}=M(),l=zre(),{isViewerMode:p}=wN(ce),c=Ze.useMemo(()=>wn(e),[e]),u=Ze.useMemo(()=>lN(e,s),[]),m=Ze.useMemo(()=>pN(u,c),[c,u]);Ze.useEffect(()=>{if(o){let C=`Failed to retrieve infra env (clusterId: ${e.id})`;if(a.find(h=>h.title===C))return;_s(o,C),n({title:C,message:o})}},[o]);let d=async C=>{i();try{let h=!ne(e),S=C.managedNetworkingType==="userManaged",v={apiVip:C.apiVip,ingressVip:C.ingressVip,sshPublicKey:C.sshPublicKey,vipDhcpAllocation:C.vipDhcpAllocation,networkType:C.networkType,machineNetworks:C.machineNetworks,clusterNetworks:C.clusterNetworks,serviceNetworks:C.serviceNetworks,userManagedNetworking:S};v.userManagedNetworking?(delete v.apiVip,delete v.ingressVip,h&&delete v.machineNetworks):C.vipDhcpAllocation?(delete v.apiVip,delete v.ingressVip):C.stackType===os&&(v.machineNetworks=[]);let{data:y}=await Se.update(e.id,e.tags,v);l(OE(y))}catch(h){D(h,()=>n({title:"Failed to update the cluster",message:R(h)}))}};return r?Ze.createElement(z,null):Ze.createElement(Wre,{initialValues:u,validationSchema:m,onSubmit:p?()=>Promise.resolve():d,validateOnMount:!0},Ze.createElement(qre,{cluster:e,hostSubnets:c,defaultNetworkSettings:s,infraEnv:t}))},EN=Yre;import cn from"react";import{useDispatch as Qre,useSelector as ese}from"react-redux";import{ActionListItem as tse,Button as ose,ButtonVariant as rse,Grid as sse,GridItem as NN}from"@patternfly/react-core";import Qe from"react";import{ExclamationTriangleIcon as jre}from"@patternfly/react-icons";import{global_warning_color_100 as Xre}from"@patternfly/react-tokens";var Jre=({platformType:e})=>{let t=e?tN[e]:"";return Qe.createElement("p",null,Qe.createElement(jre,{color:Xre.value,size:"sm"})," You will need to modify your platform configuration after cluster installation is completed."," ",Qe.createElement("a",{href:t,target:"_blank",rel:"noopener noreferrer","data-ouia-component-id":"vm-integration-kb-page"},"Learn more ",Qe.createElement("i",{className:"fas fa-external-link-alt"})))},Zre=({cluster:e})=>{let t=We(),{t:o}=f();return Qe.createElement(bt,null,Qe.createElement(N,{title:"Cluster address",value:`${e.name||""}.${e.baseDnsDomain||""}`,testId:"cluster-address"}),Qe.createElement(_g,{cluster:e}),Qe.createElement(N,{title:o("ai:Stack type"),value:va(e)?"Dual-stack":"IPv4",testId:"stack-type"}),Qe.createElement(N,{title:"CPU architecture",value:e.cpuArchitecture,testId:"cpu-architecture"}),e.machineNetworks?.length&&Qe.createElement(N,{title:"Cluster network CIDR",value:Qe.createElement(Qe.Fragment,null,e.clusterNetworks?.map(r=>Qe.createElement("span",{key:r.cidr},r.cidr,Qe.createElement("br",null)))),testId:"network-cidr"}),Qe.createElement(N,{title:"Cluster summary",testId:"cluster-summary",value:Qe.createElement($c,{hosts:e.hosts})}),Qe.createElement(N,{title:"Cluster validations",value:Qe.createElement(qc,{validationsInfo:e.validationsInfo,setCurrentStepId:r=>t.setCurrentStepId(r),wizardStepNames:Ju,wizardStepsValidationsMap:vt}),testId:"cluster-validations"}),Qe.createElement(N,{title:"Host validations",value:Qe.createElement(Yc,{hosts:e.hosts,setCurrentStepId:r=>t.setCurrentStepId(r),wizardStepNames:Ju,allClusterWizardSoftValidationIds:fF,wizardStepsValidationsMap:vt}),testId:"host-validations"}),Qe.createElement(ae,{condition:is(e)},Qe.createElement(N,{title:"Platform integration",value:Qe.createElement(Jre,{platformType:e.platform?.type}),testId:"platform-integration"})),Qe.createElement(Yu,{cluster:e}))},FN=Zre;var nse=({cluster:e})=>{let{addAlert:t}=M(),o=We(),{isViewerMode:r}=ese(ce),[s,n]=Ms(!1),i=Qre(),a=async()=>{n(!0);try{let{data:p}=await Se.install(e.id,e.tags);i(St(p)),n(!1)}catch(p){D(p,()=>t({title:"Failed to start cluster installation",message:R(p)})),n(!1)}},l=cn.createElement(er,{cluster:e,onBack:()=>o.moveBack(),isSubmitting:s,submittingText:"Starting installation...",additionalActions:cn.createElement(tse,null,cn.createElement(ose,{variant:rse.primary,name:"install",onClick:a,isDisabled:r||s||e.status!=="ready"},"Install cluster"))});return cn.createElement(Ee,{navigation:cn.createElement(Do,{cluster:e}),footer:l},cn.createElement(sse,{hasGutter:!0},cn.createElement(NN,null,cn.createElement(De,null,"Review and create")),cn.createElement(NN,null,cn.createElement(FN,{cluster:e}))))},VN=nse;import Zi from"react";import nne from"lodash/omit";import{useHistory as ine}from"react-router-dom";import{useDispatch as ane}from"react-redux";import Yr from"react";import{useSelector as Qse}from"react-redux";import{useLocation as ene}from"react-router-dom";import{Grid as tne,GridItem as QN}from"@patternfly/react-core";import one from"lodash/isUndefined";import{Formik as rne}from"formik";import{Fragment as Xse,createElement as co,useEffect as Zse,useRef as Jse}from"react";import{Form as qse}from"@patternfly/react-core";import{useFormikContext as Yse}from"formik";import{Fragment as mse,createElement as Ji,useCallback as fse,useEffect as gse,useRef as dse}from"react";import{FormGroup as ise,Tooltip as ase}from"@patternfly/react-core";import{useField as lse,useFormikContext as pse}from"formik";var cse=e=>Ji(mse,null,"Use arm64 CPU architecture"," ",Ji(H,{noVerticalAlign:!0,bodyContent:Ji("p",null,"Check this option if you want to use the arm64 CPU architecture instead of the default x86_64 CPU architecture. Please note that some features will not be available.")}),Ji(ko,{featureId:"ARM64_ARCHITECTURE",openshiftVersion:e})),use=({versions:e})=>{let{values:{openshiftVersion:t}}=pse(),[{name:o,value:r},,{setValue:s}]=lse("cpuArchitecture"),n=Pe(),i=!!e.find(u=>n.isFeatureSupported(u.value,"ARM64_ARCHITECTURE")),a=dse(t),l=E(o,"input"),p=fse(u=>s(u?_.ARM:_.x86),[s]);if(gse(()=>{a.current!==t&&!n.isFeatureSupported(t,"ARM64_ARCHITECTURE")&&p(!1),a.current=t},[t,p,n]),!i)return null;let c=n.getFeatureDisabledReason(t,"ARM64_ARCHITECTURE");return Ji(ise,{isInline:!0,fieldId:l},Ji(ase,{hidden:!c,content:c},Ji(Xg,{id:l,name:o,isDisabled:n.isFeatureDisabled(t,"ARM64_ARCHITECTURE"),label:cse(t),"aria-describedby":`${l}-helper`,description:Ji(Q,{fieldId:l},"Make sure all the hosts are using arm64 CPU architecture."),isChecked:Vr({cpuArchitecture:r}),onChange:p,className:"with-tooltip"})))},HN=use;import Jg from"react";import{FormGroup as hse}from"@patternfly/react-core";import{useField as Cse}from"formik";var MN=({clusterExists:e})=>{let t="hostsNetworkConfigurationType",o=We(),[{value:r},,]=Cse(t),s={hidden:!e,content:Mg,position:"top"};return Jg.useEffect(()=>{e||o.onUpdateHostNetworkConfigType(r)},[r,e]),Jg.createElement(hse,{label:"Hosts' network configuration",fieldId:E(t,"radio"),isInline:!0},Jg.createElement(bp,{name:t,isDisabled:e,value:Ye.DHCP,label:"DHCP only",tooltipProps:s}),Jg.createElement(bp,{name:t,isDisabled:e,value:Ye.STATIC,label:"Static IP, bridges, and bonds",tooltipProps:s}))};import Jt from"react";import UN from"lodash/isEqual";import{Alert as Ase,AlertVariant as wse,FlexItem as Dse,FormGroup as Ese,Stack as Fse,StackItem as CI}from"@patternfly/react-core";import Ge from"react";import{ExternalLinkAltIcon as RN}from"@patternfly/react-icons";import{Flex as Ise,FlexItem as BN,Stack as zN,StackItem as WN,Text as bse,TextVariants as kse,TextContent as xse}from"@patternfly/react-core";import oi from"react";import{FieldArray as yse,useFormikContext as Sse}from"formik";import{Stack as vse,StackItem as LN,TextInputTypes as ON}from"@patternfly/react-core";var _N=({isDisabled:e=!1})=>{let{values:t}=Sse(),{t:o}=f();return oi.createElement(yse,{name:"diskEncryptionTangServers"},({remove:r,push:s})=>oi.createElement(vse,{hasGutter:!0},t.diskEncryptionTangServers.map((n,i)=>oi.createElement(LN,{key:i},oi.createElement(ya,{hideRemoveButton:i===0||e,onRemove:()=>r(i)},oi.createElement("div",null,oi.createElement(J,{type:ON.url,name:`diskEncryptionTangServers.${i}.url`,helperText:'Must start with "http://" or "https://". Optionally, end with ":<port>"',label:"Server URL",isRequired:!0,isDisabled:e}),"\u2009",oi.createElement(J,{type:ON.text,name:`diskEncryptionTangServers.${i}.thumbprint`,label:"Server Thumbprint",isRequired:!0,isDisabled:e})))," ")),!e&&oi.createElement(LN,null,oi.createElement(hc,{onAdd:()=>s({url:"",thumbprint:""}),isInline:!0},o("ai:Add another Tang server")))))};var Tse=()=>{let{t:e}=f();return Ge.createElement(Ge.Fragment,null,"TPM v2"," ",Ge.createElement(H,{component:"a",minWidth:"22rem",bodyContent:Ge.createElement("p",null,e("ai:TPM v2 stores passphrases in a secure cryptoprocessor contained within as server."),"\xA0",Ge.createElement("a",{href:Rm,target:"_blank",rel:"noopener noreferrer"},e("ai:Learn more")," ",Ge.createElement(RN,null)))}))},Pse=()=>{let{t:e}=f();return Ge.createElement(Ge.Fragment,null,"Tang"," ",Ge.createElement(H,{component:"a",minWidth:"25rem",bodyContent:Ge.createElement("p",null,e("ai:Tang server component that enable network-bound disk encryption (NBDE).")," \xA0",Ge.createElement("a",{href:Rm,target:"_blank",rel:"noopener noreferrer"},e("ai:Learn more")," ",Ge.createElement(RN,null)))}))},GN=({diskEncryptionMode:e,isDisabled:t})=>{let{t:o}=f();return Ge.createElement(zN,null,Ge.createElement(WN,null,Ge.createElement(Ise,null,Ge.createElement(BN,{spacer:{default:"spacer3xl"}},Ge.createElement(ie,{isDisabled:t,name:"diskEncryptionMode",label:Ge.createElement(Tse,null),id:"TPMV2-button",value:"tpmv2"})),Ge.createElement(BN,{spacer:{default:"spacer3xl"}},Ge.createElement(ie,{isDisabled:t,name:"diskEncryptionMode",label:Ge.createElement(Pse,null),id:"tang-button",value:"tang"})))),e==="tang"&&Ge.createElement(zN,null,"\xA0",Ge.createElement(WN,null,Ge.createElement(xse,null,Ge.createElement(bse,{component:kse.h6},o("ai:Tang servers")))),"\xA0",Ge.createElement(_N,{isDisabled:t})))};import{useFormikContext as Nse}from"formik";var Vse=e=>{if(!e||e.length===0)return!1;let t={url:"",thumbprint:""};return e.find(o=>!UN(o,t)&&!UN(o,{}))!==void 0},Hse=({values:e,isSNO:t=!1,isDisabled:o=!1})=>{let{enableDiskEncryptionOnMasters:r,enableDiskEncryptionOnWorkers:s,diskEncryptionMode:n,diskEncryptionTangServers:i}=e,a=r||s,{setFieldValue:l,setFieldTouched:p}=Nse();Jt.useEffect(()=>{!s&&!r&&(n!=="tpmv2"&&l("diskEncryptionMode","tpmv2"),Vse(i)&&(p("diskEncryptionTangServers",!1,!1),l("diskEncryptionTangServers",[{}],!1)))},[r,s,n,i,p,l]),Jt.useEffect(()=>{t&&l("enableDiskEncryptionOnWorkers",!1)},[t,l]);let{t:c}=f(),u=c("ai:This option is not editable after the draft cluster is created"),m={hidden:!o,content:u};return Jt.createElement(Ese,{label:"Encryption of installation disks"},Jt.createElement(Fse,{hasGutter:!0},Jt.createElement(CI,null,Jt.createElement(Fr,{tooltipProps:m,name:"enableDiskEncryptionOnMasters",label:c(t?"ai:Control plane node, worker":"ai:Control plane nodes"),isDisabled:o})),Jt.createElement(ae,{condition:!t},Jt.createElement(CI,null,Jt.createElement(Fr,{tooltipProps:m,name:"enableDiskEncryptionOnWorkers",isDisabled:o,label:c("ai:Workers")}))),Jt.createElement(ae,{condition:r||s&&!t},Jt.createElement(CI,null,Jt.createElement(GN,{diskEncryptionMode:n,isDisabled:o})))),a&&Jt.createElement(Ase,{variant:wse.warning,isInline:!0,title:Jt.createElement(Dse,null,n==="tpmv2"&&Jt.createElement(Jt.Fragment,null,"To use this encryption method, enable TPMv2 encryption in the BIOS of each selected host."),n==="tang"&&Jt.createElement(Jt.Fragment,null,"The use of Tang encryption mode to encrypt your disks is only supported for bare metal or vSphere installations on user-provisioned infrastructure."))}))},KN=Hse;import Eo from"react";import Ss from"react";import{DropdownItem as Mse,DropdownToggle as Lse,Dropdown as Ose,HelperText as _se,FormGroup as Rse}from"@patternfly/react-core";import{CaretDownIcon as Bse}from"@patternfly/react-icons";import{useField as zse}from"formik";var $N=({name:e,defaultValue:t,items:o,isDisabled:r,versions:s,getHelperText:n,showReleasesLink:i})=>{let[a,,{setValue:l}]=zse(e),[p,c]=Ss.useState(!1),[u,m]=Ss.useState(t),{t:d}=f(),[g,C]=Ss.useState(n(s,t,d)),h=E(e,"input"),S=o.map(({value:I,label:b})=>Ss.createElement(Mse,{key:I,id:I},b)),v=Ss.useCallback(I=>{let b=I?.currentTarget.innerText?I?.currentTarget.innerText:t;m(b||""),l(I?.currentTarget.id),C(n(s,b,d)),c(!1)},[m,C,c,t,n,d,s,l]),y=Ss.useMemo(()=>Ss.createElement(Lse,{onToggle:I=>c(!r&&I),toggleIndicator:Bse,isDisabled:r,isText:!0,className:"pf-u-w-100"},u),[c,u,r]);return Ss.createElement(Rse,{fieldId:h,label:d("ai:OpenShift version"),isRequired:!0},Ss.createElement(Ose,{...a,name:e,id:h,onSelect:v,dropdownItems:S,toggle:y,isOpen:p,className:"pf-u-w-100"}),Ss.createElement(_se,{style:{display:"inherit"}},g),i&&Ss.createElement(tt,{href:`${window.location.origin}/${gC}`},d("ai:Learn more about OpenShift releases")))};import{ExclamationCircleIcon as Wse,ExclamationTriangleIcon as qN,ExternalLinkAltIcon as Gse}from"@patternfly/react-icons";import{global_warning_color_100 as YN,global_danger_color_100 as Use}from"@patternfly/react-tokens";var jN=()=>{let{t:e}=f();return Eo.createElement("a",{href:sc,target:"_blank",rel:"noopener noreferrer"},e("ai:Learn more")," ",Eo.createElement(Gse,null))},Kse=(e,t,o)=>{if(!e.length)return Eo.createElement(Eo.Fragment,null,Eo.createElement(Wse,{color:Use.value,size:"sm"}),"\xA0 ",o("ai:No release image is available."));let r=null;return e.find(n=>n.label===t)?.supportLevel!=="production"?r=Eo.createElement(Eo.Fragment,null,Eo.createElement(qN,{color:YN.value,size:"sm"}),"\xA0",o("ai:Please note that this version is not production-ready."),"\xA0",Eo.createElement(jN,null)):t&&t in Pi.versions&&jc(Pi.versions[t])<=30&&(r=Eo.createElement(Eo.Fragment,null,Eo.createElement(qN,{color:YN.value,size:"sm"}),"\xA0",o("ai:Full support for this version ends on {{openshiftversion}} and won't be available as an installation option afterwards.",{openshiftversion:Pi.versions[t]}),"\xA0",Eo.createElement(jN,null))),r},$se=({versions:e})=>{let{t}=f(),o=Eo.useMemo(()=>e.filter(s=>s.supportLevel!=="maintenance").map(s=>({label:s.supportLevel==="beta"?s.label+" - "+t("ai:Developer preview release"):s.label,value:s.value})),[e,t]),r=e.find(s=>s.default)?.label||e[0]?.label||"";return Eo.createElement($N,{name:"openshiftVersion",defaultValue:r,items:o,isDisabled:e.length===0,versions:e,getHelperText:Kse,showReleasesLink:Ce!==void 0})},XN=$se;var JN=({name:e,baseDnsDomain:t})=>co(Xse,null,"All DNS records must be subdomains of this base and include the cluster name. This cannot be changed after cluster installation. The full cluster address will be: ",co("br",null),co("strong",null,e||"[Cluster Name]",".",t||"[example.com]")),ZN=({managedDomains:e=[],toggleRedHatDnsService:t,isBaseDnsDomainDisabled:o,versions:r,isPullSecretSet:s,defaultPullSecret:n,forceOpenshiftVersion:i,isOcm:a,clusterExists:l})=>{let{values:p}=Yse(),{name:c,baseDnsDomain:u,highAvailabilityMode:m,useRedHatDnsService:d}=p,g=Jse();Zse(()=>{g.current?.focus()},[]);let{t:C}=f();return co(qse,{id:"wizard-cluster-details__form"},co(mN,{ref:g,label:"Cluster name",name:"name",placeholder:a?"":"Enter cluster name",isRequired:!0,richValidationMessages:d?ed(C):Qm(C)}),!!e.length&&t&&co(qr,{name:"useRedHatDnsService",label:"Use a temporary 60-day domain",helperText:"A base domain will be provided for temporary, non-production clusters.",onChange:t}),d?co(ja,{label:"Base domain",name:"baseDnsDomain",helperText:co(JN,{name:c,baseDnsDomain:u}),options:e.map(h=>({label:`${h.domain||""} (${h.provider||""})`,value:h.domain})),isRequired:!0}):co(ft,{label:"Base domain",name:"baseDnsDomain",helperText:co(JN,{name:c,baseDnsDomain:u}),placeholder:"example.com",isDisabled:o||d,isRequired:!0}),i?co(Vs,{name:"openshiftVersion",label:"OpenShift version",isRequired:!0},"OpenShift ",i," ",jse(i,r)):co(XN,{versions:r}),co(Xl,{versions:r,highAvailabilityMode:m}),!s&&co(wa,{isOcm:a,defaultPullSecret:n}),co(HN,{versions:r}),co(MN,{clusterExists:l}),co(KN,{values:p,isDisabled:s,isSNO:ne({highAvailabilityMode:m})}))};function jse(e,t){return t.find(r=>r.version===e)?.supportLevel==="beta"?"- Developer preview release":""}var sne=e=>{let{cluster:t,infraEnv:o,pullSecret:r,managedDomains:s,ocpVersions:n,usedClusterNames:i=[],moveNext:a,handleClusterUpdate:l,handleClusterCreate:p,navigation:c}=e,{search:u}=ene(),{isViewerMode:m}=Qse(ce),d=Pe(),g=Yr.useCallback(async y=>{let I=Ru.getClusterCreateParams(y);t?await l(t.id,I):await p(I)},[t,p,l]),C=(y,I,b)=>m||!y&&!one(b)&&Gi({cluster:b})?a:I,h=Yr.useMemo(()=>Ru.getClusterDetailsInitialValues({infraEnv:o,cluster:t,pullSecret:r,managedDomains:s,ocpVersions:n,urlSearchParams:u}),[o,t,r,s,n,u]),{t:S}=f(),v=Rd({usedClusterNames:i,featureSupportLevels:d,pullSecretSet:t?.pullSecretSet,ocpVersions:n,isOcm:!0,t:S});return Yr.createElement(rne,{initialValues:h,validate:mo(v),onSubmit:g},({submitForm:y,isSubmitting:I,isValid:b,dirty:k,setFieldValue:T,errors:w,touched:F})=>{let O=uo(w,F),Y=Yr.createElement(Yr.Fragment,null,Yr.createElement(tne,{hasGutter:!0},Yr.createElement(QN,null,Yr.createElement(De,null,"Cluster details")),Yr.createElement(QN,{span:12,lg:10,xl:9,xl2:7},Yr.createElement(ZN,{toggleRedHatDnsService:Z=>T("baseDnsDomain",Z?s.map(x=>x.domain)[0]:""),versions:n,forceOpenshiftVersion:t?.openshiftVersion,isPullSecretSet:!!t?.pullSecretSet,defaultPullSecret:r,isOcm:!!Ce,managedDomains:s,clusterExists:!!t})))),he=Yr.createElement(er,{cluster:t,errorFields:O,isSubmitting:I,isNextDisabled:!(!I&&b&&(k||t&&Gi({cluster:t}))),onNext:C(k,y,t)});return Yr.createElement(Ee,{navigation:c,footer:he},Y)})},Zg=sne;var lne=({cluster:e,infraEnv:t})=>{let o=We(),r=Fg(),{addAlert:s,clearAlerts:n}=M(),i=ine(),a=ane(),{usedClusterNames:l}=Ng(e?.id||""),p=Hp(),{error:c,loading:u,versions:m}=$r();Zi.useEffect(()=>{c&&s(c)},[c,s]);let d=Zi.useCallback(async(h,S)=>{n();let v=nne(S,["highAvailabilityMode","pullSecret","openshiftVersion"]);try{let{data:y}=await Se.update(h,e?.tags,v);a(St(y)),Gi({cluster:y})&&o.moveNext()}catch(y){D(y,()=>s({title:"Failed to update the cluster",message:R(y)}))}},[n,e?.tags,a,o,s]),g=Zi.useCallback(async h=>{n();try{let S=await Se.create(h);i.push(`${Te}/clusters/${S.id}`,Yv)}catch(S){D(S,()=>s({title:"Failed to create new cluster",message:R(S)}))}},[s,n,i]);return p===void 0||!r||u||!l?Zi.createElement(Ee,{navigation:Zi.createElement(Do,{cluster:e})},Zi.createElement(z,null)):Zi.createElement(Zg,{cluster:e,pullSecret:p,managedDomains:r,ocpVersions:m,usedClusterNames:l,moveNext:()=>o.moveNext(),handleClusterUpdate:d,handleClusterCreate:g,navigation:Zi.createElement(Do,{cluster:e}),infraEnv:t})},Qg=lne;import Za from"react";import{useDispatch as $ne,useSelector as qne}from"react-redux";import{Formik as Yne,useFormikContext as jne}from"formik";import Me from"react";import{useSelector as One}from"react-redux";import{Text as mV,TextContent as yI,Button as _ne,Stack as Rne,StackItem as Ja,Split as Bne,SplitItem as zne}from"@patternfly/react-core";import{useFormikContext as Wne}from"formik";import xr from"react";import{Stack as pne,StackItem as eV}from"@patternfly/react-core";import{useSelector as cne}from"react-redux";var une=({obj:e})=>xr.createElement(zr,{key:e.id,host:e,AdditionalNTPSourcesDialogToggleComponent:gs}),mne=({cluster:e})=>{let{onEditHost:t,actionChecks:o,onEditRole:r,actionResolver:s,onSelect:n,selectedHostIDs:i,setSelectedHostIDs:a,onMassChangeHostname:l,onMassDeleteHost:p,...c}=Ui(e),{isViewerMode:u}=cne(ce),m=ne(e),{t:d}=f(),g=xr.useMemo(()=>[wt(d,t,void 0,o.canEditHostname),Ut(d,o.canEditRole,r,Hr(e)),Fp({onEditHostname:t}),Di,Go,Uo,yo,Ei(e)],[d,t,o.canEditHostname,o.canEditRole,r,e]),C=e.hosts||[],h=Be(C.length),S=C.map(y=>y.id),v=!(u||m);return xr.createElement(xr.Fragment,null,xr.createElement(pne,{hasGutter:!0},v&&xr.createElement(eV,null,xr.createElement(bi,{selectedIDs:i||[],itemIDs:S,setSelectedIDs:a,actions:[xr.createElement(Kl,{key:"hostname",onChangeHostname:l}),xr.createElement($l,{key:"delete",onDeleteHost:p})],...h})),xr.createElement(eV,null,xr.createElement(Xe,{testId:"hosts-discovery-table",hosts:C,content:g,actionResolver:s,ExpandComponent:une,onSelect:v?n:void 0,selectedIDs:i,setSelectedIDs:a,...h},xr.createElement(Dg,{isSingleNode:m})))),xr.createElement(Ki,{cluster:e,...c}))},tV=mne;import ri from"react";import{Button as Sne,ButtonVariant as vne,Modal as Ine,ModalVariant as bne}from"@patternfly/react-core";import{pluralize as oV}from"humanize-plus";import Qu from"react";import{useDispatch as dne}from"react-redux";import fne from"axios";var gne=({cluster:e,onCancel:t,onSuccess:o,cpuArchitecture:r})=>{let{infraEnv:s,error:n}=ei(e.id,r),i=Qu.useRef(),a=dne();Qu.useEffect(()=>(i.current=fne.CancelToken.source(),()=>i.current?.cancel("Image generation cancelled by user.")),[]);let l=()=>{a(zi()),t()},p=async(c,u)=>{if(e.id&&s?.id)try{let{updatedCluster:m}=await Cg.update(e.id,e.tags,s.id,c);await o(),a(St(m))}catch(m){D(m,()=>{u.setStatus({error:{title:"Failed to download the discovery Image",message:R(m)}})})}};return n?Qu.createElement(j,null):s?Qu.createElement(Jc,{onCancel:l,handleSubmit:p,sshPublicKey:s.sshAuthorizedKey,httpProxy:s.proxy?.httpProxy,httpsProxy:s.proxy?.httpsProxy,noProxy:s.proxy?.noProxy,imageType:s.type}):Qu.createElement(z,null)},eh=gne;import hne from"react";var Cne=({clusterName:e,isSNO:t,isoDownloadUrl:o,cpuArchitecture:r,...s})=>{let n=r===_.USE_DAY1_ARCHITECTURE?e:`${e}_${r}`;return hne.createElement(Ai,{fileName:`discovery_image_${n}.iso`,downloadUrl:o,isSNO:t,...s})},th=Cne;import yne from"react";function em(){return{getIsoImageUrl:yne.useCallback(async(t,o)=>{try{let r=await Xt.getInfraEnvId(t,o);if(!r)return{url:"",error:`Failed to retrieve the infraEnv for ${t}`};let{data:{url:s}}=await Je.getImageUrl(r);return{url:s,error:s?"":"Failed to retrieve the image URL, the API returned an invalid URL"}}catch(r){return{url:"",error:U(r)}}},[])}}var rV=({ButtonComponent:e=Sne,cluster:t,idPrefix:o})=>{let{discoveryImageDialog:r}=ve(),{open:s}=r,n=ne(t);return ri.createElement(e,{variant:vne.secondary,onClick:()=>s({cluster:t}),id:`${o}-button-download-discovery-iso`},"Add ",oV(+n,"host"))},zp=()=>{let[e,t]=ri.useState(""),[o,r]=ri.useState(""),{discoveryImageDialog:s}=ve(),{data:n,isOpen:i,close:a}=s,l=n?.cluster,{getIsoImageUrl:p}=em(),c=ri.useCallback(async()=>{let{url:d,error:g}=await p(l.id,_.USE_DAY1_ARCHITECTURE);t(d),r(g)},[p,l?.id]),u=ri.useCallback(()=>{t("")},[]);if(!l)return null;let m=ne(l);return ri.createElement(Ine,{"aria-label":"Add hosts dialog",title:`Add ${oV(+m,"host")}`,isOpen:i,onClose:a,variant:bne.small,hasNoBodyWrapper:!0,id:"generate-discovery-iso-modal"},o&&ri.createElement(j,null),e?ri.createElement(th,{clusterName:l.name||"",isSNO:m,onClose:a,onReset:u,isoDownloadUrl:e,cpuArchitecture:_.USE_DAY1_ARCHITECTURE}):ri.createElement(eh,{cluster:l,onCancel:a,onSuccess:c,cpuArchitecture:_.USE_DAY1_ARCHITECTURE}))};import un from"react";import{Text as lV}from"@patternfly/react-core";import Tr from"react";import{List as kne,ListItem as oh,Text as sV,TextContent as nV}from"@patternfly/react-core";var xne="https://access.redhat.com/solutions/4885641",iV=e=>_t(e*1024*1024,2,"iec"),Tne=({clusterId:e,isSingleNode:t,isAddingHosts:o})=>{let{preflightRequirements:r,error:s,isLoading:n}=$a(e);if(n)return Tr.createElement(z,{content:"Loading hardware requirements ..."});if(s)return Tr.createElement(j,null);let i=r?.ocp?.master?.quantitative,a=i?.cpuCores||4,l=iV(i?.ramMib||16*1024),p=i?.diskSizeGb||100,c=`${a} CPU cores, ${l} RAM, and ${p} GB disk size.`,u=r?.ocp?.worker?.quantitative,m=u?.cpuCores||2,d=iV(u?.ramMib||16*1024),g=u?.diskSizeGb||100,C=`${m} CPU cores, ${d} RAM, and ${g} GB disk size.`;if(o)return Tr.createElement(nV,null,Tr.createElement(sV,{component:"p"},`Worker hosts must have at least ${C}`));let h;return t?h=Tr.createElement(nV,null,Tr.createElement(sV,{component:"p"},`One host is required with at least ${c}`)):h=Tr.createElement(kne,null,Tr.createElement(oh,null,`Control plane nodes: At least ${c}`),Tr.createElement(oh,null,`Workers: At least ${C}`),Tr.createElement(oh,null,"Also note that each host's disk write speed should meet the minimum requirements to run OpenShift.",Tr.createElement("br",null),Tr.createElement(tt,{href:xne},"Learn more")),Tr.createElement(oh,null,"Operators might require additional resources.")),h},aV=Tne;var Pne=({cluster:e})=>{let t=un.useMemo(()=>tF(e.hosts||[]),[e.hosts]),o=ne(e);return un.createElement(un.Fragment,null,un.createElement(lV,{component:"h3"},"Information and warnings"),un.createElement(lV,{component:"p"},un.createElement(Ag,{linkText:"Minimum hardware requirements",modalTitle:"Minimum hardware requirements"},un.createElement(aV,{clusterId:e.id,isSingleNode:o,isAddingHosts:yg(e)})),un.createElement("span",{className:"pf-u-mr-md"},"\xA0"),un.createElement(wg,{isSingleNode:o})),t&&un.createElement(Ul,null))},rh=Pne;import Xa from"react";import si from"react";import{List as Ane,ListItem as pV,Title as wne}from"@patternfly/react-core";var Dne=()=>si.createElement(si.Fragment,null,si.createElement(wne,{headingLevel:"h6"},"Requirements"),si.createElement(Ane,null,si.createElement(pV,null,"A network connection between vSphere and the installed OCP."),si.createElement(pV,null,"Ensure clusterSet ",si.createElement("code",null,"disk.enableUUID")," is set to ",si.createElement("code",null,"true")," inside of vSphere")),si.createElement("a",{href:ca,target:"_blank",rel:"noopener noreferrer"},"Learn more about vSphere platform integration")),cV=Dne;var Ene="Enable platform integration to access features directly in OpenShift, like vSphere node auto-scaling and persistent storage or Nutanix node auto-scaling.",Fne="Enable vSphere platform integration to access features directly inside OpenShift, like node auto-scaling and persistent storage. You'll need to set vSphere configuration after cluster installation is complete.",Nne="Enable Nutanix platform integration to access features like node auto-scaling directly inside OpenShift.",Vne="Platform integration is only applicable on non-SNO deployments and when all discovered hosts originated from the same platform.",Hne={"no-active-integrations":Ene,vsphere:Fne,nutanix:Nne},Mne=({supportedPlatformIntegration:e})=>Xa.createElement(Xa.Fragment,null,Xa.createElement("span",null,"Integrate with platform (vSphere/Nutanix)")," ",Xa.createElement(H,{bodyContent:Hne[e],footerContent:e==="vsphere"&&Xa.createElement(cV,null),buttonOuiaId:"platform-integration-vSphere-popover"})),Lne=({clusterId:e})=>{let{isPlatformIntegrationSupported:t,supportedPlatformIntegration:o}=qi(e);return Xa.createElement(jg,{tooltipProps:{hidden:t,content:Vne},isDisabled:!t,name:"usePlatformIntegration",label:Xa.createElement(Mne,{supportedPlatformIntegration:o}),switchOuiaId:"platform-integration-vSphere-switch"})},uV=Lne;var Gne=()=>Me.createElement(Me.Fragment,null,Me.createElement("span",null,"Run workloads on control plane nodes")," ",Me.createElement(H,{bodyContent:Me.createElement("p",null,"Enables your control plane nodes to be used for running applications.")})),Une='This toggle will be "On" and not editable when less than 5 hosts were discovered',Kne=({cluster:e})=>{let t=rs("ASSISTED_INSTALLER_PLATFORM_INTEGRATION_FEATURE"),o=yc(e),{setFieldValue:r}=Wne(),{isViewerMode:s}=One(ce);return Me.useEffect(()=>{r("schedulableMasters",Hr(e))},[e,o,r]),Me.createElement(Rne,{hasGutter:!0},Me.createElement(Ja,null,Me.createElement(De,null,"Host discovery")),Me.createElement(Ja,null,!s&&Me.createElement(yI,null,Me.createElement(mV,{component:"p"},Me.createElement(rV,{ButtonComponent:_ne,cluster:e,idPrefix:"host-inventory"})))),t&&Me.createElement(Ja,null,Me.createElement(Bne,{hasGutter:!0},Me.createElement(zne,null,Me.createElement(uV,{clusterId:e.id})))),Me.createElement(Ja,null,Me.createElement(jg,{tooltipProps:{hidden:!o,content:Une},isDisabled:o,name:"schedulableMasters",label:Me.createElement(Gne,null)})),Me.createElement(Ja,null,Me.createElement(yI,null,Me.createElement(rh,{cluster:e}))),Me.createElement(Ja,null,Me.createElement(yI,null,Me.createElement(mV,{component:"h3"},"Host Inventory"))),Me.createElement(Ja,null,Me.createElement(tV,{cluster:e})))},dV=Kne;var Xne=({cluster:e})=>{let{alerts:t}=M(),{errors:o,touched:r,isSubmitting:s,isValid:n}=jne(),i=We(),a=lr(),l=uo(o,r),p=!n||!!t.length||a||s||!xg({cluster:e});return Za.createElement(Ee,{navigation:Za.createElement(Do,{cluster:e}),footer:Za.createElement(er,{cluster:e,errorFields:l,isSubmitting:s,isNextDisabled:p,onNext:()=>i.moveNext(),onBack:()=>i.moveBack()})},Za.createElement(dV,{cluster:e}))},Jne=({cluster:e})=>{let t=$ne(),{addAlert:o,clearAlerts:r}=M(),{isViewerMode:s}=qne(ce),n=Za.useMemo(()=>qC(e),[]),{supportedPlatformIntegration:i}=qi(e.id);return Za.createElement(Yne,{initialValues:n,onSubmit:s?()=>Promise.resolve():async p=>{r();let c=p.usePlatformIntegration?i==="no-active-integrations"?void 0:i:void 0,u={};Bu.setPlatform(u,c,e.userManagedNetworking),Bu.setSchedulableMasters(u,p,e);try{let{data:m}=await Se.update(e.id,e.tags,u);t(St(m))}catch(m){D(m,()=>o({title:"Failed to update the cluster",message:R(m)}))}}},Za.createElement(Xne,{cluster:e}))},fV=Jne;import Is from"react";import{StackItem as TV}from"@patternfly/react-core";import{Formik as kie,useFormikContext as xie}from"formik";import vs from"react";import{Stack as vie,StackItem as kV}from"@patternfly/react-core";import{Fragment as nie,createElement as Qa}from"react";import{sortable as gV}from"@patternfly/react-table";import{Popover as Zne,Text as Qne,TextContent as eie,TextVariants as tie}from"@patternfly/react-core";import{ExclamationTriangleIcon as oie}from"@patternfly/react-icons";import{global_warning_color_100 as rie}from"@patternfly/react-tokens/dist/js/global_warning_color_100";var sie=()=>Qa(eie,null,Qa(Qne,{component:tie.p},"Some bootable disks will skip formatting"));var hV={header:{title:"Number of disks",props:{id:"col-header-num-disks"},transforms:[gV]},cell:e=>{let o=we(e).disks||[];return{title:Qa(nie,null," ",o.length," ",e.skipFormattingDisks&&Qa(Zne,{bodyContent:Qa(sie,null),minWidth:"20rem",maxWidth:"30rem"},Qa(oie,{color:rie.value,size:"sm"}))),props:{"data-testid":"disk-number"},sortableValue:o.length}}},CV=e=>({header:{title:"ODF Usage",props:{id:"col-header-odf"},transforms:[gV]},cell:t=>{let o=t.role==="master"||t.suggestedRole==="master",r=e&&o;return{title:r?Qa("div",{style:{color:"var(--pf-global--disabled-color--100)"}},"Excluded for ODF"):"Use ODF",props:{"data-testid":"use-odf"},sortableValue:Number(r)}}});import{createElement as lie}from"react";var iie=e=>e.id,aie=({hosts:e,...t})=>lie(lf,{getDataId:iie,data:e,...t},""),yV=aie;import{createElement as tm}from"react";import{Stack as yie,StackItem as IV}from"@patternfly/react-core";import el from"react";import{Button as pie,ButtonVariant as cie,Popover as uie,Text as SV,TextContent as mie,TextVariants as die}from"@patternfly/react-core";import{ExclamationTriangleIcon as fie}from"@patternfly/react-icons";import{global_warning_color_100 as gie}from"@patternfly/react-tokens/dist/js/global_warning_color_100";var hie=()=>el.createElement(mie,null,el.createElement(SV,{component:die.p},"All non-installation disks will be used for local storage. To view available disks, expand each host row in the table")),Cie=()=>el.createElement(SV,{component:"p"},el.createElement(uie,{bodyContent:el.createElement(hie,null),minWidth:"30rem"},el.createElement(pie,{variant:cie.link,isInline:!0},el.createElement(fie,{className:"status-icon",color:gie.value,size:"sm"}),"\xA0Format all non-installation disks"))),vV=Cie;var Sie=({cluster:e})=>{let t=$m(e.monitoredOperators,Ts)&&!yg(e),o=HE(e);return tm(yie,{hasGutter:!0},t&&tm(IV,null,tm(vV,null)),tm(IV,null,tm(tp,{someDisksAreSkipFormatting:o})))},bV=Sie;function Iie({obj:e}){let{onDiskRole:t,canEditDisks:o,updateDiskSkipFormatting:r}=gp();return vs.createElement(uf,{key:e.id,host:e,onDiskRole:t,canEditDisks:o,updateDiskSkipFormatting:r})}var bie=({cluster:e})=>{let{t}=f(),{onEditHost:o,actionChecks:r,onDiskRole:s,actionResolver:n,updateDiskSkipFormatting:i,...a}=Ui(e),l=vs.useMemo(()=>{let u=[wt(t,o,void 0,r.canEditHostname),Ut(t,void 0,void 0,Hr(e)),Fp({}),yo,hV];if($m(e.monitoredOperators,Ts)){let m=!_b(e);u.push(CV(m))}return u.push(Ei(e)),u},[r.canEditHostname,e,o,t]),p=e.hosts||[],c=Be(p.length);return vs.createElement(vs.Fragment,null,vs.createElement(vie,{hasGutter:!0},vs.createElement(kV,null,vs.createElement(Hi,{canEditDisks:r.canEditDisks,onDiskRole:s,updateDiskSkipFormatting:i},vs.createElement(yV,{testId:"storage-table",hosts:p,content:l,actionResolver:n,ExpandComponent:Iie,...c}))),vs.createElement(kV,null,vs.createElement(bV,{cluster:e}))),vs.createElement(Ki,{cluster:e,...a}))},xV=bie;var Tie=({cluster:e})=>{let{alerts:t}=M(),o=We(),{isSubmitting:r,touched:s,errors:n}=xie(),i=lr(),a=uo(n,s),l=!Tg({cluster:e})||i||!!t.length||r;return Is.createElement(Ee,{navigation:Is.createElement(Do,{cluster:e}),footer:Is.createElement(er,{cluster:e,errorFields:a,isSubmitting:r,isNextDisabled:l,onNext:()=>o.moveNext(),onBack:()=>o.moveBack()})},Is.createElement(TV,null,Is.createElement(De,null,"Storage")),Is.createElement(TV,null,Is.createElement(xV,{cluster:e})),Is.createElement(pa,null))},Pie=({cluster:e})=>{let{clearAlerts:t}=M(),o=Is.useMemo(()=>YC(),[]);return Is.createElement(kie,{onSubmit:()=>{t()},initialValues:o},Is.createElement(Tie,{cluster:e}))},PV=Pie;import $p from"react";import{useSelector as xle}from"react-redux";import Ar from"react";import{Text as yH,TextContent as Sle,TextVariants as SH,Alert as vle,AlertVariant as Ile,Grid as ble}from"@patternfly/react-core";import Pr from"react";import{Alert as Aie,AlertVariant as wie,ButtonVariant as Die,Form as Eie,FormGroup as Fie}from"@patternfly/react-core";var Nie=({initialView:e,confirmOnChangeView:t,onChangeView:o})=>{let r="select-static-ip-view",[s,n]=Pr.useState(),[i,a]=Pr.useState(e),l=(d,g)=>{let C=g.currentTarget.value;t?n(C):(a(C),o(C))},p=d=>{a(d),n(void 0),o(d)},c=()=>{n(void 0)},u=()=>i===ze.YAML?"YAML":"form",m=i===ze.FORM;return Pr.createElement(Pr.Fragment,null,Pr.createElement(Eie,{isHorizontal:!0},Pr.createElement(Fie,{fieldId:E(r,"radio"),isInline:!0,label:"Configure via :",className:"static-config-type-label"},Pr.createElement(fI,{label:"Form view",name:r,"data-testid":"select-form-view",id:"select-form-view",value:ze.FORM,isChecked:m,onChange:l}),Pr.createElement(fI,{label:"YAML view",name:r,"data-testid":"select-yaml-view",id:"select-yaml-view",value:ze.YAML,isChecked:!m,onChange:l}))),m&&Pr.createElement(Aie,{variant:wie.info,isInline:!0,title:"Form view supports basic configurations. Select YAML view for advanced configurations."}),s&&Pr.createElement(Fn,{title:"Change configuration option?",titleIconVariant:"warning",confirmationButtonText:"Change",confirmationButtonVariant:Die.primary,content:Pr.createElement(Pr.Fragment,null,Pr.createElement("p",null,`All data and configuration done in ${u()} view will be lost.`)),onClose:c,onConfirm:()=>p(s)}))},sh=Nie;import Vie from"lodash/findLastIndex";import{Address4 as AV,Address6 as wV}from"ip-address";var SI=e=>!0,vI=e=>e==="dualStack",DV=(e,t)=>t===ee.ipv4?SI(e):vI(e),jr=e=>e==="dualStack"?[ee.ipv4,ee.ipv6]:[ee.ipv4],om=e=>e===ee.ipv4?"IPv4":"IPv6",nh=(e,t)=>t===ee.ipv4&&AV.isValid(e)?new AV(e):t===ee.ipv6&&wV.isValid(e)?new wV(e):null;var ih=()=>({ipv4:"",ipv6:""}),rm=()=>({macAddress:"",ips:ih()}),ah=()=>({machineNetwork:{ip:"",prefixLength:""},gateway:""}),II=()=>({networkYaml:"",macInterfaceMap:[{macAddress:"",logicalNicName:""}]}),sm=()=>({ipConfigs:{ipv4:ah(),ipv6:ah()},protocolType:"ipv4",useVlan:!1,vlanId:"",dns:""}),EV=()=>({hosts:[rm()]}),FV=()=>({hosts:[II()]});var Hie=e=>e.find(t=>!wE(t.name)),NV=e=>{let t=e.split(`
33
+ `),o=Vie(t,s=>s.startsWith(wp));return{comments:t.slice(0,o+1).map(s=>s.slice(1)),nmstate:bE(e)}},Mie=e=>{for(let t of e)if(vE(t))return t.vlan.id;return null},Lie=(e,t)=>{let o=e[t];if(o===void 0)return"";if(!o.address||!o.address.length)throw`Nmstate yaml doesn't contain an address for protocol version ${t}`;return o.address[0].ip},Oie=e=>{let t=e["dns-resolver"]?.config.server;if(!t||!t.length)throw"Nmstate YAML doesn't contain dns-resolver section";return t.join(",")},_ie=(e,t)=>{let o=e.routes?.config;if(!o)throw"Nmstate yaml doesn't contain routes section";return o[IE(t)]["next-hop-address"]},Rie=(e,t,o)=>{let r=Mie(e.interfaces),s=sm();s.dns=Oie(e),s.protocolType=t,r&&(s.useVlan=!0,s.vlanId=r);for(let n of jr(t)){s.ipConfigs[n].gateway=_ie(e,n);let[i,a]=o[n].split("/");s.ipConfigs[n].machineNetwork={ip:i,prefixLength:parseInt(a)}}return s},Bie=(e,t)=>{if(!e.macInterfaceMap||!e.networkYaml)throw"Static network config is missing information";let o=e.macInterfaceMap[0].macAddress;if(!o)throw"Static network config is missing mac address";let{nmstate:r}=NV(e.networkYaml),s=Hie(r.interfaces);if(!s)return null;let n={macAddress:o,ips:{ipv4:"",ipv6:""}};for(let i of jr(t))n.ips[i]=Lie(s,i);return n},nm=e=>{if(!e.length)throw"Static network config is empty";let t=e[0];if(!t.macInterfaceMap||!t.networkYaml)throw"Static network config first host is missing fields";let{comments:o,nmstate:r}=NV(t.networkYaml),s=ug(o);if(!s)return{networkWide:sm(),hosts:[]};let n=Dv(o),i=Rie(r,s,n),a=[];for(let l of e){let p=Bie(l,s);p&&a.push(p)}return{networkWide:i,hosts:a}};var Wp=e=>{if(!e.staticNetworkConfig||!e.staticNetworkConfig.length)return;let t=G(e.staticNetworkConfig);if(!t)throw"Failed to parse static network config";if(!!t.length)return t},zie=e=>e.includes(Dp)?ze.FORM:ze.YAML,Wie=e=>{let t=e[0].networkYaml;if(!t)throw"Static Network Config doesn't contain a network yaml";let o=kE(t);return{view:zie(o),isDataComplete:!DE(t),formViewProtocolType:ug(o)}},tl=e=>{let t=Wp(e);if(!(!t||!t[0]))return Wie(t)},lh=e=>{let t=Wp(e);if(!t)throw"Infra env doesn't contain static ip data";let o=nm(t);if(!o)throw`Failed to get static ip form data from infra env ${e.id}`;return o},VV=e=>{let t=lh(e);return t.hosts.length?{hosts:t.hosts}:{hosts:[rm()]}},ph=e=>lh(e).networkWide,HV=e=>{let t=Wp(e);if(!t)throw"Infra env doesn't contain static ip data";return{hosts:t}};import QV from"react";import Qi from"react";import{useSelector as Gie}from"react-redux";import{Form as Uie}from"@patternfly/react-core";import{Formik as Kie,useFormikContext as $ie,yupToFormErrors as qie}from"formik";import Yie from"lodash/isEqual";var jie=({onFormStateChange:e,getEmptyValues:t})=>{let o=Qi.useMemo(()=>t(),[]),{isSubmitting:r,isValid:s,touched:n,errors:i,values:a}=$ie(),l=Qi.useMemo(()=>Yie(a,o),[a,o]),p=lr();return Qi.useEffect(()=>{e({isSubmitting:r,isAutoSaveRunning:p,isValid:s,touched:n,errors:i,isEmpty:l})},[r,s,p,n,i]),null},Gp=({infraEnv:e,updateInfraEnv:t,getInitialValues:o,getUpdateParams:r,validationSchema:s,onFormStateChange:n,getEmptyValues:i,children:a,showEmptyValues:l})=>{let{clearAlerts:p,addAlert:c}=M(),{captureException:u}=Og(),{isViewerMode:m}=Gie(ce),[d,g]=Qi.useState();return Qi.useEffect(()=>{g(l?i():o(e))},[]),d?Qi.createElement(Kie,{initialValues:d,onSubmit:m?()=>Promise.resolve():async v=>{p();try{let y=r(e,v);await t({staticNetworkConfig:y})}catch(y){u(y),c({title:R(y)})}},validate:v=>{try{return s.validateSync(v,{abortEarly:!1,context:{values:v}}),{}}catch(y){return qie(y)}},validateOnMount:!0,enableReinitialize:!0},Qi.createElement(Uie,null,a,Qi.createElement(jie,{onFormStateChange:n,getEmptyValues:i}))):null};import{array as UV,object as TI,string as GV}from"yup";import{Address4 as Xie,Address6 as ch}from"ip-address";import{isInSubnet as Jie}from"is-in-subnet";import{string as Up}from"yup";var MV={ipv4:"127.0.0.0",ipv6:"::1"},LV={ipv4:"0.0.0.0",ipv6:"0000::"},ol=e=>Up().test("unique","Value must be unique",function(t){if(!this.options.context||!("values"in this.options.context))return this.createError({message:"Unexpected error: Yup test context should contain form values"});let o=e(this.options.context.values,this,t);return o?o.filter(r=>r===t).length===1:this.createError({message:"Unexpected error: Failed to get values to test uniqueness"})}),bI=(e,t)=>{try{return!(e===ee.ipv4?new Xie(t):new ch(t)).parsedSubnet}catch{return!1}},OV=(e,t)=>{try{if(t===ee.ipv4)return e===MV.ipv4||e===LV.ipv4;{let o=new ch(e);return RV(new ch(MV.ipv6),o)||RV(new ch(LV.ipv6),o)}}catch{return!1}},kI=e=>{let t=e===ee.ipv4?"IPv4":"IPv6";return Up().test(e,`Value \${value} is not a valid ${t} address`,function(o){return o?bI(e,o):!0})},_V=e=>{let t=e===ee.ipv4?"IPv4":"IPv6";return Up().test(e,({value:o})=>{let r=o.split(","),s=r.filter(a=>!bI(e,a)),n=s.join(", ");return s.length===1?`Value ${n} is not a valid ${t} address`:s.length>1?`The values ${n} are not valid ${t} addresses`:`The following IP addresses are duplicated: ${tc(r).join(",")}`},function(o){if(!o)return!0;let r=o.split(",");return tc(r).length!==0?!1:r.every(n=>bI(e,n))})},RV=(e,t)=>JSON.stringify(e.toByteArray())===JSON.stringify(t.toByteArray()),BV=e=>Up().test("is-not-reserved-address",({value:t})=>{let o=t.split(",");return o.length===1?"Provided IP address is not a correct address for an interface.":`Provided IP addresses ${o.filter(s=>OV(s,e)).join(", ")} are not correct addresses for an interface.`},function(t){return t?t.split(",").every(r=>!OV(r,e)):!0}),zV=(e,t)=>Up().test("is-in-subnet",`IP Address is outside of the machine network ${t}`,function(o){if(!o)return!0;let r=kI(e);try{r.validateSync(o)}catch(s){let n=s;return this.createError({message:n.message})}try{return Jie(o,t)}catch{return!0}}),im=(e,t)=>Up().test("is-not-network-or-broadcast","The IP address must not match the network or broadcast address",o=>{let r=nh(t,e);if(r){let s=r?.startAddress().correctForm(),n=r?.endAddress().correctForm();return!(o===s||o===n)}else return!1});var xI="A value is required",Zie=GV().required(xI),Qie=e=>{let t=[];for(let o of e.hosts)if(!!o.macInterfaceMap)for(let r of o.macInterfaceMap)r.macAddress&&t.push(r.macAddress);return t},eae=(e,t)=>{let o=t.parent,r=e.hosts.find(s=>s.macInterfaceMap&&s.macInterfaceMap.indexOf(o)>-1);if(!(!r||!r.macInterfaceMap))return r.macInterfaceMap.map(s=>s.logicalNicName?s.logicalNicName:"")},tae=UV().of(TI().shape({macAddress:Ds.required(xI).concat(ol(Qie)),logicalNicName:GV().required(xI).concat(ol(eae)).max(15,"Interface name must be 15 characters at most.").matches(/^\S+$/,"Interface name can not contain spaces.")})),WV=TI().shape({hosts:UV().of(TI().shape({networkYaml:Zie,macInterfaceMap:tae}))});import bo from"react";import{TextVariants as Dae,TextContent as Eae,Text as Fae,FormGroup as XV,Grid as Nae}from"@patternfly/react-core";import{ExternalLinkAltIcon as Vae}from"@patternfly/react-icons";import{Language as Hae}from"@patternfly/react-code-editor";import{useField as JV}from"formik";import fe from"react";import{useSelector as KV}from"react-redux";import{Button as $V,ButtonVariant as oae,Checkbox as rae,Divider as sae,ExpandableSection as nae,ExpandableSectionToggle as iae,Flex as qV,FlexItem as uh,Grid as aae}from"@patternfly/react-core";import{MinusCircleIcon as lae}from"@patternfly/react-icons";import{FieldArray as pae,useField as cae}from"formik";import PI from"lodash/cloneDeep";var AI="hosts",uae=({onRemove:e,showRemoveButton:t,dataTestId:o})=>fe.createElement($V,{"aria-label":"remove host",style:{visibility:t?"visible":"hidden"},variant:"plain"},fe.createElement(lae,{onClick:e,"data-testid":o})),wI=e=>`Host ${e+1}`,mae=({fieldName:e,hostIdx:t,onRemove:o,onToggleExpand:r,isExpanded:s,isDisabled:n,CollapsedHostComponent:i,ExpandedHostComponent:a,enableRemoveHost:l})=>{let[p,c]=fe.useState(!1),u=d=>{n||c(l?d:!1)},m=aa(e,t);return fe.createElement(aae,{onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),hasGutter:!0},fe.createElement(qV,null,fe.createElement(uh,null,fe.createElement(iae,{isExpanded:s,onToggle:r,direction:"down","data-testid":`toggle-host-${t}`},wI(t))),!n&&t>0&&fe.createElement(uh,{align:{default:"alignRight"}},fe.createElement(uae,{onRemove:o,showRemoveButton:p,dataTestId:`remove-host-${t}`}))),s?fe.createElement(nae,{isDetached:!0,key:t,isExpanded:!0},fe.createElement(a,{fieldName:m,hostIdx:t,isDisabled:n})):fe.createElement(i,{fieldName:m,hostIdx:t,isDisabled:n}))},YV=e=>{let t={};for(let o=0;o<e;++o)t[o]=!1;return t},dae=e=>{let t=YV(e);return e===1&&(t[0]=!0),t},fae=({push:e,remove:t,enableCopyAboveConfiguration:o,emptyHostData:r,...s})=>{let[n,{error:i}]=cae({name:AI}),{isViewerMode:a}=KV(ce),l=!KV(Ua)&&!a,[p,c]=fe.useState(dae(n.value.length)),[u,m]=fe.useState(!1),[d,g]=fe.useState(null);if(n.value===void 0)return fe.createElement(z,null);let C=()=>{let h;u?h=PI(n.value[n.value.length-1]):h=PI(r);let S=YV(n.value.length+1);S[n.value.length]=!0,c(S),e(h)};return fe.createElement(fe.Fragment,null,n.value.map((h,S)=>{let v=y=>{let I=PI(p);I[S]=y,c(I)};return fe.createElement(fe.Fragment,{key:S},fe.createElement(mae,{hostIdx:S,onToggleExpand:v,isExpanded:p[S],isDisabled:a,onRemove:()=>g(S),fieldName:AI,emptyHostData:r,enableRemoveHost:n.value.length>1,...s}),fe.createElement(sae,null))}),l&&fe.createElement(qV,null,fe.createElement(uh,null,fe.createElement($V,{variant:"secondary",onClick:C,"data-testid":"add-host",isDisabled:!!i},"Add another host configuration")),o&&fe.createElement(uh,{alignSelf:{default:"alignSelfCenter"}},fe.createElement(rae,{label:"Copy the above configuration",isChecked:u,onChange:m,"aria-label":"copy host configuration",name:"copy-host-configuration",id:"copy-host-configuration","data-testid":"copy-host-configuration"}))),d&&fe.createElement(Fn,{title:`Delete ${wI(d)}?`,titleIconVariant:"warning",confirmationButtonText:"Delete",confirmationButtonVariant:oae.danger,content:fe.createElement(fe.Fragment,null,fe.createElement("p",null,`All the network configurations of ${wI(d)} will be lost`)),onClose:()=>g(null),onConfirm:()=>{t(d),g(null)}}))},gae=({...e})=>{let t=fe.useCallback(o=>fe.createElement(fae,{...Object.assign(e,o)}),[]);return fe.createElement(pae,{name:AI,render:t})},mh=gae;import{Flex as hae,FlexItem as DI,Label as EI,StackItem as Cae,TextContent as yae,TextVariants as Sae,Text as vae}from"@patternfly/react-core";import{InfoCircleIcon as Iae}from"@patternfly/react-icons";import Fo from"react";var bae=({title:e,macAddress:t,mappingValue:o,numInterfaces:r,hasError:s,hostIdx:n})=>Fo.createElement(Fo.Fragment,null,Fo.createElement(Cae,{"data-testid":`collapsed-host-${n}`},Fo.createElement(hae,null,Fo.createElement(DI,null,Fo.createElement(yae,null,Fo.createElement(vae,{component:Sae.small},e))),s&&Fo.createElement(EI,{variant:"outline",color:"red",icon:Fo.createElement(Iae,null),"data-testid":"host-errors-label"},"Missing Information"),!s&&Fo.createElement(Fo.Fragment,null,Fo.createElement(DI,null,Fo.createElement(EI,{variant:"outline","data-testid":"first-mapping-label"},`${t} -> ${o}`)," "),r>1&&Fo.createElement(DI,null,Fo.createElement(EI,{variant:"outline","data-testid":"remaining-mapping-label"},`${r-1} left`)))))),dh=bae;import or from"react";import{GridItem as FI,Grid as NI,Button as kae}from"@patternfly/react-core";import{FieldArray as xae}from"formik";import{PlusCircleIcon as Tae}from"@patternfly/react-icons";import{useSelector as Pae}from"react-redux";var Aae=({onPush:e})=>or.createElement(kae,{icon:or.createElement(Tae,null),isInline:!0,onClick:()=>e({macAddress:"",logicalNicName:""}),"data-testid":"add-mapping",variant:"link"},"Add another MAC to interface name mapping"),wae=({fieldName:e,onRemove:t,mapIdx:o,enableRemove:r,hostIdx:s})=>or.createElement(ya,{hideRemoveButton:!r,onRemove:t},or.createElement(NI,{hasGutter:!0},or.createElement(FI,{span:6},or.createElement(ft,{label:"MAC address",isRequired:!0,name:`${e}.macAddress`,"data-testid":`mac-address-${s}-${o}`})),or.createElement(FI,{span:6},or.createElement(ft,{label:"Interface name",isRequired:!0,name:`${e}.logicalNicName`,"data-testid":`interface-name-${s}-${o}`})))),jV=({fieldName:e,macInterfaceMap:t,hostIdx:o})=>{let{isViewerMode:r}=Pae(ce);return or.createElement(NI,{className:"mac-ip-mapping"},or.createElement(FI,{span:6},or.createElement(xae,{name:e,validateOnChange:!1,render:({push:s,remove:n})=>or.createElement(NI,{hasGutter:!0},t.map((i,a)=>or.createElement(wae,{key:aa(e,a),fieldName:aa(e,a),onRemove:()=>n(a),mapIdx:a,enableRemove:!r&&a>0,hostIdx:o})),!r&&or.createElement(Aae,{onPush:s}))})))};var Mae=({fieldName:e,hostIdx:t})=>{let o=`${e}.macInterfaceMap`,[r,{error:s}]=JV({name:o}),n=r.value?r.value:[],i=!!s,a="",l="";return n.length?(a=n[0].macAddress||"",l=n[0].logicalNicName||""):i=!0,bo.createElement(dh,{title:"MAC to Interface name mapping",numInterfaces:n.length,macAddress:a,mappingValue:l,hostIdx:t,hasError:i})},Lae=({fieldName:e,hostIdx:t})=>{let o=`${e}.macInterfaceMap`,[r]=JV({name:o}),s=r.value?r.value:[];return bo.createElement(bo.Fragment,null,bo.createElement(XV,{label:"",fieldId:E("nmstateYaml","inputs")},bo.createElement(uN,{language:Hae.yaml,name:`${e}.networkYaml`,"data-testid":`yaml-${t}`})),bo.createElement(XV,{label:bo.createElement(bo.Fragment,null,"MAC to interface name mapping"," ",bo.createElement(H,{bodyContent:"MAC address and interface name are needed in order to execute the above nmstate YAML on the right machine."})),fieldId:E("macNicMaping","inputs")},bo.createElement(jV,{fieldName:o,macInterfaceMap:s,hostIdx:t})))},ZV=()=>{let e=II();return bo.createElement(Nae,{hasGutter:!0},bo.createElement(Eae,null,bo.createElement(Fae,{component:Dae.small},"Upload, drag and drop, or copy and paste a YAML file that contains NMState into the editor for network configurations. Each host also needs the MAC to interface name mapping."," ",bo.createElement("a",{href:nC,target:"_blank",rel:"noopener noreferrer"},"Learn more about NMState ",bo.createElement(Vae,null)))),bo.createElement(mh,{ExpandedHostComponent:Lae,CollapsedHostComponent:Mae,emptyHostData:e,enableCopyAboveConfiguration:!0}))};var am=({...e})=>{let t={...e,validationSchema:WV,getInitialValues:o=>HV(o),getUpdateParams:(o,r)=>r.hosts,getEmptyValues:()=>FV()};return QV.createElement(Gp,{...t},QV.createElement(ZV,null))};import cm from"react";import Kp from"react";import{FormGroup as Oae,Grid as _ae}from"@patternfly/react-core";import{useField as Rae}from"formik";var Bae=e=>({fieldName:o,hostIdx:r})=>Kp.createElement(_ae,{hasGutter:!0},Kp.createElement(ft,{name:`${o}.macAddress`,label:"MAC Address",isRequired:!0,"data-testid":`mac-address-${r}`}),jr(e).map(s=>Kp.createElement(Oae,{label:`IP address (${om(s)})`,fieldId:E(`${o}.ips.${s}`,"input"),key:s},Kp.createElement(ft,{name:`${o}.ips.${s}`,isRequired:!0,"data-testid":`${s}-address-${r}`})," "))),zae=e=>({fieldName:o,hostIdx:r})=>{let[{value:s},{error:n}]=Rae({name:o}),a=jr(e).map(l=>s.ips[l]).join(", ");return Kp.createElement(dh,{title:"MAC to IP mapping",numInterfaces:1,macAddress:s.macAddress,mappingValue:a,hostIdx:r,hasError:!!n})},eH=({protocolType:e})=>{let t=rm(),o=zae(e),r=Bae(e);return Kp.createElement(mh,{CollapsedHostComponent:o,ExpandedHostComponent:r,emptyHostData:t})};import{array as tle,object as MI,string as pH}from"yup";import{boolean as Yae,lazy as qae,mixed as jae,number as aH,object as pm,string as Xae}from"yup";var mn=e=>`${e.ip}/${e.prefixLength}`;var Wae="A value is required",tH="Must be a number",Gae=/^\d+$/,oH=1,lm={ipv4:32,ipv6:128},rH=1,fh=4094,sH=e=>isNaN(e)?null:e,gh=(e,t)=>zV(e,mn(t)),Uae=(e,t)=>im(e,mn(t)),Kae=e=>pm().shape({ip:VI(e),prefixLength:aH().required("Prefix length is required").min(1,"Prefix length must be more than or equal to 1").max(lm[e],`Prefix length must be less than or equal to ${lm[e]}`).nullable().transform(sH)}),VI=(e,t=!1)=>(t?_V:kI)(e).required(Wae).concat(BV(e)),nH=(e,t)=>pm().shape({machineNetwork:Kae(e),gateway:VI(e).concat(gh(e,t.machineNetwork)).concat(Uae(e,t.machineNetwork))}),iH=qae(e=>{let t=pm().shape({ipv4:nH(ee.ipv4,e.ipConfigs.ipv4),ipv6:DV(e.protocolType,ee.ipv6)?nH(ee.ipv6,e.ipConfigs.ipv6):pm()});return pm().shape({useVlan:Yae(),vlanId:jae().when("useVlan",{is:!0,then:aH().required(tH).min(1,"Must be more than or equal to 1").max(fh,`Must be less than or equal to ${fh}`).test("not-number",tH,()=>$ae(e.vlanId)).nullable().transform(sH)}),protocolType:Xae(),dns:VI(ee.ipv4,!0),ipConfigs:t})}),$ae=e=>new RegExp(Gae).test((e||"").toString());var HI="A value is required",Jae=e=>e.hosts.map(t=>t.ips.ipv4),Zae=e=>e.hosts.map(t=>t.ips.ipv6),Qae=e=>e.hosts.map(t=>t.macAddress),ele=e=>MI().shape({macAddress:Ds.required(HI).concat(ol(Qae)),ips:MI().shape({ipv4:SI(e.protocolType)?gh(ee.ipv4,e.ipConfigs.ipv4.machineNetwork).required(HI).concat(ol(Jae)).concat(im(ee.ipv4,mn(e.ipConfigs.ipv4.machineNetwork))):pH(),ipv6:vI(e.protocolType)?gh(ee.ipv6,e.ipConfigs.ipv6.machineNetwork).required(HI).concat(ol(Zae)).concat(im(ee.ipv6,mn(e.ipConfigs.ipv6.machineNetwork))):pH()})}),lH=e=>MI().shape({hosts:tle().of(ele(e))});import{dump as ole}from"js-yaml";var LI="eth0",rle=(e,t)=>{let o=e.ipConfigs[t].machineNetwork;if(o.prefixLength==="")throw"Machine network prefix length not configured";return o.prefixLength},sle=(e,t)=>`${t.map(r=>`${wp}${r}`).join(`
34
+ `)}
35
+ ${ole(e,{noRefs:!0})}`,nle=(e,t)=>{let o=[],r=[],s=PE(e.dns),n={};for(let a of jr(e.protocolType)){let l=t[a],p="";if(l)p=LI,n[a]=Ou(l,rle(e,a));else{let c={[a]:Ou(_u[a].ip,_u[a].prefixLength)};p=mg(a),o.push(Ev(p,c,e))}r.push(AE(a,e.ipConfigs[a].gateway,e.useVlan&&e.vlanId?wv(p,e.vlanId):p))}return Object.keys(n).length>0&&o.unshift(Ev(LI,n,e)),{interfaces:o,"dns-resolver":s,routes:{config:r}}},cH=(e,t)=>{let o=[Dp];for(let n of jr(e.protocolType))o.push(`${Av(n)} ${mn(e.ipConfigs[n].machineNetwork)}`);let r=t?t.ips:ih(),s=nle(e,r);return sle(s,o)},uH=e=>{let t=[];if(e.hosts.length===0)t=[{networkYaml:cH(e.networkWide),macInterfaceMap:Nv()}];else for(let o of e.hosts)t.push({networkYaml:cH(e.networkWide,o),macInterfaceMap:[{macAddress:o.macAddress,logicalNicName:LI}]});return t},mH=(e,t)=>{let o=Wp(e);if(!o)throw"Infra env doesn't contain static ip values";let s=nm(o).networkWide;return uH({networkWide:s,hosts:t})},ile=(e,t)=>{for(let o of t){let r=ih();for(let s of jr(e.protocolType))r[s]=o.ips[s];o.ips=r}},dH=(e,t)=>{let o=Wp(e);if(!o)throw"Infra env doesn't contain static ip values";let r=nm(o);return ile(t,r.hosts),t.vlanId!==""&&(t.vlanId=Number(t.vlanId)),uH({networkWide:t,hosts:r.hosts})};var hh=({infraEnv:e,...t})=>{let[o,r]=cm.useState(),[s,n]=cm.useState();return cm.useEffect(()=>{let i=ph(e);r(i.protocolType),i&&n({infraEnv:e,validationSchema:lH(i),getInitialValues:a=>VV(a),getUpdateParams:(a,l)=>mH(a,l.hosts),getEmptyValues:()=>EV(),...t})},[]),!s||!o?null:cm.createElement(Gp,{...s},cm.createElement(eH,{protocolType:o}))};import um from"react";import Ae from"react";import{Text as fH,TextVariants as gH,Grid as ale,FormGroup as hH,TextInputTypes as lle,Alert as ple,AlertVariant as cle,TextContent as ule,Flex as mle,FlexItem as OI}from"@patternfly/react-core";import{useField as _I,useFormikContext as dle}from"formik";var fle=Ae.createElement(ple,{variant:cle.warning,isInline:!0,"data-testid":"hosts-configured-alert",title:"If you edit the values and click Next, the earlier configurations will be replaced with the new values for all of the hosts."}),gle=({fieldName:e,protocolVersion:t})=>{let[{value:o}]=_I(e),r=`${e}.ip`,s=`${e}.prefixLength`,n=vn({name:r}),i=vn({name:s}),a=n||i,l=Ae.useMemo(()=>{if(a)return"";let p=mn(o);return Zm(nh(p,t))},[o,t,a]);return Ae.createElement(hH,{labelIcon:Ae.createElement(H,{noVerticalAlign:!0,bodyContent:"The range of IP addresses of the hosts."}),label:"Machine Network",fieldId:E(`${e}`,"input"),isRequired:!0,helperTextInvalid:a,validated:a?"error":"default",helperText:l,className:"machine-network"},Ae.createElement(mle,null,Ae.createElement(OI,{spacer:{default:"spacerSm"}},Ae.createElement(ft,{name:`${e}.ip`,isRequired:!0,"data-testid":`${t}-machine-network-ip`,showErrorMessage:!1})),Ae.createElement(OI,{spacer:{default:"spacerSm"}},"/"),Ae.createElement(OI,null,Ae.createElement(ft,{name:`${e}.prefixLength`,isRequired:!0,"data-testid":`${t}-machine-network-prefix-length`,type:lle.number,showErrorMessage:!1,min:oH,max:t===ee.ipv4?lm.ipv4:lm.ipv6}))))},hle=({protocolVersion:e,fieldName:t})=>Ae.createElement(ale,{hasGutter:!0},Ae.createElement(gle,{fieldName:`${t}.machineNetwork`,protocolVersion:e}),Ae.createElement(ft,{isRequired:!0,label:"Default gateway",labelIcon:Ae.createElement(H,{noVerticalAlign:!0,bodyContent:"An IP address to where any IP packet should be forwarded in case there is no other routing rule configured for a destination IP."}),name:`${t}.gateway`,"data-testid":`${e}-gateway`})),Cle=[{label:om(ee.ipv4),value:"ipv4"},{label:"Dual Stack",value:"dualStack"}],yle=()=>{let e="protocolType",[{value:t},,{setValue:o}]=_I(e),[,,{setValue:r}]=_I("ipConfigs.ipv6");return Ae.createElement(ja,{label:"Internet protocol version",options:Cle,name:e,callFormikOnChange:!1,onChange:n=>{let i=n.currentTarget.value;i!==t&&(r(ah()),o(i))},"data-testid":"select-protocol-version"})},CH=({hosts:e})=>{let{values:t,setFieldValue:o}=dle();return Ae.createElement(Ae.Fragment,null,Ae.createElement(ule,null,Ae.createElement(fH,{component:gH.h3},"Network-wide configurations"),Ae.createElement(fH,{component:gH.small},"The following configurations are applicable to all the hosts.")),e.length>0&&fle,Ae.createElement(yle,null),Ae.createElement(qr,{label:Ae.createElement(Ae.Fragment,null,"Use VLAN ",Ae.createElement(H,{noVerticalAlign:!0,bodyContent:"If the hosts are in a sub network, enter the VLAN ID."})),name:"useVlan","data-testid":"use-vlan",onChange:()=>o("vlanId","")}),t.useVlan&&Ae.createElement("div",{className:"vlan-id"},Ae.createElement(ft,{label:"VLAN ID",name:"vlanId",isRequired:!0,"data-testid":"vlan-id",min:rH,max:fh})),Ae.createElement(ft,{isRequired:!0,label:"DNS",name:"dns","data-testid":"dns"}),jr(t.protocolType).map(r=>Ae.createElement(hH,{key:r,label:om(r),fieldId:E(`ip-configs-${r}`,"input")},Ae.createElement(hle,{fieldName:`ipConfigs.${r}`,protocolVersion:r}))))};var Ch=({infraEnv:e,...t})=>{let[o,r]=um.useState(),[s,n]=um.useState();return um.useEffect(()=>{let i=lh(e).hosts;n(i),!!i&&r({infraEnv:e,...t,validationSchema:iH,getInitialValues:a=>ph(a),getUpdateParams:(a,l)=>dH(a,l),getEmptyValues:()=>sm()})},[]),!s||!o?null:um.createElement(Gp,{...o},um.createElement(CH,{hosts:s}))};var kle=Ar.createElement(vle,{variant:Ile.warning,isInline:!0,"data-testid":"regenerate-iso-alert",title:`To add new hosts that will use the new or edited configurations, you'll need to regenerate the
36
+ Discovery ISO in the 'Host discovery' step and boot your new hosts from it.`}),vH=({infraEnv:e,updateInfraEnv:t,onFormStateChange:o})=>{let r=We(),[s,n]=Ar.useState(!1),[i,a]=Ar.useState(!1),l=Ar.useCallback(g=>{r.onUpdateStaticIpView(g),a(!0)},[]),p=Ar.useMemo(()=>tl(e),[]);if(!p)return null;let u={onFormStateChange:g=>{let C=r.currentStepId==="static-ip-host-configurations"||!g.isEmpty;n(C),o(g)},infraEnv:e,updateInfraEnv:t,showEmptyValues:i},d=(()=>{switch(r.currentStepId){case"static-ip-yaml-view":return Ar.createElement(am,{...u});case"static-ip-host-configurations":return Ar.createElement(hh,{...u});case"static-ip-network-wide-configurations":return Ar.createElement(Ch,{...u});default:throw`Unexpected wizard step id ${r.currentStepId} when entering static ip page`}})();return d?Ar.createElement(ble,{hasGutter:!0},Ar.createElement(Sle,null,Ar.createElement(yH,{component:SH.h2},"Static network configurations"),Ar.createElement(yH,{component:SH.small},"Network configuration can be done using either the form view or YAML view. Configurations done in this step are for discovering hosts.")),Ar.createElement(sh,{initialView:p.view,confirmOnChangeView:s,onChangeView:l}),p.isDataComplete&&kle,d):null};var Tle=()=>({isValid:!0,isSubmitting:!1,isAutoSaveRunning:!1,errors:{},touched:{},isEmpty:!0}),Ple=({cluster:e,infraEnv:t,updateInfraEnv:o})=>{let r=We(),{isViewerMode:s}=xle(ce),{alerts:n}=M(),[i,a]=$p.useState(Tle()),l=m=>{s||a(m)},p=i.isAutoSaveRunning||!i.isValid||!!n.length||i.isSubmitting,c=uo(i.errors,i.touched),u=$p.createElement(er,{cluster:e,alertTitle:"Static IP configuration contains missing or invalid fields",alertContent:null,errorFields:c,isSubmitting:i.isSubmitting,onNext:()=>r.moveNext(),onBack:()=>r.moveBack(),isNextDisabled:p});return $p.createElement(Ee,{navigation:$p.createElement(Do,{cluster:e}),footer:u},$p.createElement(Mp,{title:"Failed to load Static IP step"},$p.createElement(vH,{...{infraEnv:t,updateInfraEnv:o,onFormStateChange:l}})))},IH=Ple;import rl from"react";import{useDispatch as Qle}from"react-redux";import{Formik as epe,useFormikContext as tpe}from"formik";import ni from"react";import{useSelector as Jle}from"react-redux";import{Stack as Zle,StackItem as Sh}from"@patternfly/react-core";import rr,{useState as Ele}from"react";import{FormGroup as Fle,Tooltip as Nle}from"@patternfly/react-core";import{ExternalLinkAltIcon as Vle}from"@patternfly/react-icons";import{useFormikContext as Hle}from"formik";import bs from"react";import{useSelector as Ale}from"react-redux";import{List as wle,ListItem as yh}from"@patternfly/react-core";var Dle=({clusterId:e})=>{let{preflightRequirements:t,error:o,isLoading:r}=$a(e),s=Ale(Ua);if(r)return bs.createElement(z,{content:"Loading hardware requirements ..."});if(o)return bs.createElement(j,null);let n=t?.operators?.find(l=>l.operatorName===pi),i=n?.requirements?.worker?.quantitative,a=n?.requirements?.master?.quantitative;return bs.createElement(bs.Fragment,null,bs.createElement(wle,null,bs.createElement(yh,null,"Enabled CPU virtualization support in BIOS (Intel-VT / AMD-V) on all nodes"),bs.createElement(ae,{condition:!s},bs.createElement(yh,null,"Each worker node requires an additional ",i?.ramMib||360," MiB of memory ",i?.diskSizeGb?",":" and"," ",i?.cpuCores||2," CPUs",i?.diskSizeGb?` and ${i?.diskSizeGb} storage space`:"")),bs.createElement(yh,null,"Each control plane node requires an additional ",a?.ramMib||150," MiB of memory ",a?.diskSizeGb?",":" and"," ",a?.cpuCores||4," ","CPUs",a?.diskSizeGb?` and ${a?.diskSizeGb} storage space`:""),bs.createElement(ae,{condition:!s},bs.createElement(yh,null,"OpenShift Data Foundation (recommended for full functionality) or another persistent storage service"))))},bH=Dle;var kH="useContainerNativeVirtualization",Mle=({clusterId:e})=>rr.createElement(rr.Fragment,null,"Install OpenShift Virtualization"," ",rr.createElement(H,{component:"a",headerContent:"Additional Requirements",bodyContent:rr.createElement(bH,{clusterId:e})})),Lle=()=>rr.createElement(rr.Fragment,null,"Run virtual machines alongside containers on one platform."," ",rr.createElement("a",{href:rC,target:"_blank",rel:"noopener noreferrer"},"Learn more"," ",rr.createElement(Vle,null))),Ole=({clusterId:e,openshiftVersion:t})=>{let o=E(kH,"input"),r=Pe(),{values:s}=Hle(),[n,i]=Ele();return rr.useEffect(()=>{let a;if(t&&(a=r.getFeatureDisabledReason(t,"CNV"),!a)){let l=r.getFeatureSupportLevel(t,"LVM");a=TF(s,t,l)}i(a)},[s,t,r]),rr.createElement(Fle,{isInline:!0,fieldId:o},rr.createElement(Nle,{hidden:!n,content:n},rr.createElement(qr,{name:kH,label:rr.createElement(Mle,{clusterId:e}),helperText:rr.createElement(Lle,null),isDisabled:!!n})))},xH=Ole;import sr from"react";import{FormGroup as _le,Tooltip as Rle}from"@patternfly/react-core";import{ExternalLinkAltIcon as TH}from"@patternfly/react-icons";var PH="useOpenShiftDataFoundation",Ble=()=>sr.createElement(sr.Fragment,null,"Install OpenShift Data Foundation"," ",sr.createElement(H,{component:"a",headerContent:"Additional Requirements",bodyContent:sr.createElement("a",{href:Qh,target:"_blank",rel:"noopener noreferrer"},"Learn more about the requirements for OpenShift Data Foundation ",sr.createElement(TH,null),".")})),zle=()=>sr.createElement(sr.Fragment,null,"Persistent software-defined storage for hybrid applications."," ",sr.createElement("a",{href:sC,target:"_blank",rel:"noopener noreferrer"},"Learn more"," ",sr.createElement(TH,null))),Wle=({openshiftVersion:e})=>{let t=Pe(),o=E(PH,"input"),r=e?t.getFeatureDisabledReason(e,"ODF"):void 0;return sr.createElement(_le,{isInline:!0,fieldId:o},sr.createElement(Rle,{hidden:!r,content:r},sr.createElement(qr,{name:PH,label:sr.createElement(Ble,null),isDisabled:!!r,helperText:sr.createElement(zle,null)})))},AH=Wle;import dn,{useState as Kle}from"react";import{FormGroup as $le,Tooltip as qle}from"@patternfly/react-core";import{useFormikContext as Yle}from"formik";import mm from"react";import{List as Gle,ListItem as wH}from"@patternfly/react-core";var Ule=({clusterId:e})=>{let{preflightRequirements:t,error:o,isLoading:r}=$a(e);if(r)return mm.createElement(z,{content:"Loading hardware requirements ..."});if(o)return mm.createElement(j,null);let s=t?.operators?.find(a=>a.operatorName===Ps),{qualitative:n=[],quantitative:i}=s?.requirements?.master;return mm.createElement(Gle,null,i&&mm.createElement(wH,null,"The host node requires an additional ",i.ramMib," MiB of memory"," ",i.diskSizeGb?",":" and"," ",i.cpuCores," CPUs",i?.diskSizeGb?` and ${i?.diskSizeGb} storage space`:""),n.map((a,l)=>mm.createElement(wH,{key:l},a)))},DH=Ule;var EH="useOdfLogicalVolumeManager",jle=e=>dn.createElement(dn.Fragment,null,"Install OpenShift Data Foundation Logical Volume Manager"," ",dn.createElement(H,{component:"a",headerContent:"Additional Requirements",bodyContent:dn.createElement(DH,{clusterId:e.clusterId})}),dn.createElement(ko,{featureId:"LVM",openshiftVersion:e.openshiftVersion})),Xle=({clusterId:e,openshiftVersion:t})=>{let o=E(EH,"input"),r=Pe(),{values:s}=Yle(),[n,i]=Kle();return dn.useEffect(()=>{let a;if(t&&(a=r.getFeatureDisabledReason(t,"LVM"),!a)){let l=r.getFeatureSupportLevel(t,"LVM");a=PF(s,t,l)}i(a)},[s,t,r]),dn.createElement($le,{isInline:!0,fieldId:o},dn.createElement(qle,{hidden:!n,content:n},dn.createElement(qr,{name:EH,label:dn.createElement(jle,{clusterId:e,openshiftVersion:t}),helperText:"Storage virtualization that offers a more flexible approach for disk space management.",isDisabled:!!n})))},FH=Xle;var NH=e=>{let t=Jle(Ua),o=rs("ASSISTED_INSTALLER_OCS_FEATURE")&&!t,r=rs("ASSISTED_INSTALLER_CNV_FEATURE");return ni.createElement(Zle,{hasGutter:!0},ni.createElement(Sh,null,ni.createElement(De,null,"Operators")),r&&ni.createElement(Sh,null,ni.createElement(xH,{...e})),o&&ni.createElement(Sh,null,ni.createElement(AH,{openshiftVersion:e.openshiftVersion})),t&&ni.createElement(Sh,null,ni.createElement(FH,{...e})))};var ope=e=>{let t=o=>!!e.find(r=>o.includes(r.name||""));return{useOpenShiftDataFoundation:t([Ts]),useOdfLogicalVolumeManager:t([Ps]),useContainerNativeVirtualization:t([pi])}},rpe=({cluster:e})=>{let{alerts:t}=M(),o=We(),r=lr(),{errors:s,touched:n,isSubmitting:i,isValid:a}=tpe(),l=r||!a||!!t.length||i||!gF({cluster:e});return rl.createElement(Ee,{navigation:rl.createElement(Do,{cluster:e}),footer:rl.createElement(er,{cluster:e,errorFields:uo(s,n),isSubmitting:i,isNextDisabled:l,onNext:()=>o.moveNext(),onBack:()=>o.moveBack()})},rl.createElement(NH,{clusterId:e.id,openshiftVersion:e.openshiftVersion}))},spe=({cluster:e})=>{let t=Qle(),{addAlert:o,clearAlerts:r}=M(),s=vl(e.monitoredOperators),n=rl.useMemo(()=>ope(s),[]);return rl.createElement(epe,{initialValues:n,onSubmit:async(a,{setFieldValue:l})=>{r();let p=zu.getOLMOperators(a,e);try{let{data:c}=await Se.update(e.id,e.tags,{olmOperators:p}),u=zu.syncOperators(p,c.monitoredOperators);Object.keys(u).forEach(m=>{l(m,!0)}),t(St(c))}catch(c){D(c,()=>o({title:"Failed to update the cluster",message:U(c)}))}}},rl.createElement(rpe,{cluster:e}))},VH=spe;var ipe=({cluster:e,infraEnv:t,updateInfraEnv:o})=>{let{currentStepId:r}=We(),s=ks.useCallback(()=>{switch(r){case"host-discovery":return ks.createElement(fV,{cluster:e});case"networking":return ks.createElement(EN,{cluster:e});case"review":return ks.createElement(VN,{cluster:e});case"operators":return ks.createElement(VH,{cluster:e});case"storage":return ks.createElement(PV,{cluster:e});case"static-ip-host-configurations":case"static-ip-network-wide-configurations":case"static-ip-yaml-view":return ks.createElement(IH,{cluster:e,infraEnv:t,updateInfraEnv:o});case"cluster-details":default:return ks.createElement(Qg,{cluster:e,infraEnv:t})}},[r,e,t,o]);return r?ks.createElement(Mp,null,ks.createElement("div",{className:npe("pf-c-wizard","cluster-wizard")},s())):ks.createElement(z,null)},vh=ipe;import ii from"react";import{useDispatch as ape}from"react-redux";import{Button as HH,Modal as lpe,ModalVariant as ppe,ButtonVariant as MH,Text as cpe,TextContent as upe}from"@patternfly/react-core";var mpe=()=>{let e=ape(),[t,o]=ii.useState(!1),[r,s]=ii.useState(null),{cancelInstallationDialog:n}=ve(),{data:i,isOpen:a,close:l}=n,p=i?.clusterId;if(!p)return null;let c=async()=>{o(!0);try{s(null);let{data:m}=await X.cancel(p);e(St(m)),l()}catch(m){D(m,()=>{s({title:"Failed to abort cluster installation",message:R(m)})})}o(!1)},u=()=>t?ii.createElement(z,{content:"Aborting cluster installation..."}):r?ii.createElement(j,{title:r.title,content:r.message}):ii.createElement(upe,null,ii.createElement(cpe,{component:"p"},"This will abort cluster installation. Are you sure you want to proceed?"));return ii.createElement(lpe,{title:"Abort Cluster Installation",isOpen:a,variant:ppe.small,actions:[ii.createElement(HH,{key:"submit",variant:MH.danger,onClick:c,isDisabled:t},"Abort Installation"),ii.createElement(HH,{key:"cancel",variant:MH.link,onClick:l,isDisabled:t},"Cancel")],onClose:l},u())},Ih=mpe;import No from"react";import{useDispatch as dpe}from"react-redux";import{Button as LH,Modal as fpe,ModalVariant as gpe,ButtonVariant as OH,Text as bh,TextContent as hpe}from"@patternfly/react-core";import{ExclamationTriangleIcon as Cpe}from"@patternfly/react-icons";import{global_warning_color_100 as ype}from"@patternfly/react-tokens";var Spe=()=>{let e=dpe(),[t,o]=No.useState(!1),[r,s]=No.useState(null),{resetClusterDialog:n}=ve(),{data:i,isOpen:a,close:l}=n,p=i?.cluster;if(!p)return null;let c=()=>{o(!1),s(null),l()},u=async()=>{o(!0);try{s(null);let{data:C}=await X.reset(p.id);e(St(C)),l()}catch(C){D(C,()=>{s({title:"Failed to reset cluster installation",message:R(C)})})}o(!1)},m=`${Math.round(NE(p)/((p.hosts?.length||0)+1)*100)} `,d=()=>t?No.createElement(z,{content:"Resetting cluster installation..."}):r?No.createElement(j,{title:r.title,content:r.message}):No.createElement(hpe,null,No.createElement(bh,{component:"p"},"This will reset the installation and return to the cluster configuration. Some hosts may need to be re-registered by rebooting into the Discovery ISO."),No.createElement(bh,{component:"p"},No.createElement("strong",null,"Download the installation logs")," to troubleshoot or report a bug.",No.createElement("br",null),"Currently, ",m,"% of the installation logs were collected and are ready for download."),No.createElement(bh,{component:"p"},No.createElement(Cpe,{className:"status-icon",color:ype.value,size:"sm"})," ","Logs won't be available after the installation is reset."),No.createElement(bh,{component:"p"},"Are you sure you want to reset the cluster?")),g=[No.createElement(LH,{key:"reset",variant:OH.danger,onClick:u,isDisabled:t},"Reset Cluster")];return g.push(No.createElement(LH,{key:"cancel",variant:OH.link,onClick:c,isDisabled:t},"Cancel")),No.createElement(fpe,{title:"Reset Cluster Installation",isOpen:a,variant:gpe.small,actions:g,onClose:c},d())},kh=Spe;import _H from"react";import{Button as vpe,ButtonVariant as Ipe,Modal as bpe,ModalVariant as kpe}from"@patternfly/react-core";var xpe=()=>_H.createElement(bpe,{title:"Unable to fetch the latest data",isOpen:!0,variant:kpe.small,showClose:!1,titleIconVariant:"danger",actions:[_H.createElement(vpe,{key:"refresh",variant:Ipe.primary,onClick:()=>window.location.reload()},"Refresh page")]},"There was an error fetching the latest data from the API. We'll try again, but if the data does not update in a few minutes, try refreshing the page."),xh=xpe;import Tpe from"react";var qp=({children:e})=>Tpe.createElement(VF,{...{exceptionReporter:(o,r,s)=>{Aa(o)?D(o):_s(o,r,s)}}},e);import sl from"react";import{useLocation as Ape}from"react-router-dom";import wpe from"lodash/isEqual";import{useDispatch as Ppe}from"react-redux";function RI(){let e=Ppe();return(t,o)=>{if(!t)return;let r=Gv(t);o&&(r={...r,...bg(o||{})}),e(RE(r))}}var dm=e=>{let t=[...rN];return e===ze.YAML?t.splice(1,0,"static-ip-yaml-view"):e===ze.FORM&&t.splice(1,0,...$g),t},Dpe=({children:e,cluster:t,infraEnv:o,permissions:r})=>{let[s,n]=sl.useState(),[i,a]=sl.useState(),{state:l}=Ape(),p=RI();sl.useEffect(()=>{let u=o?tl(o):void 0,m=mF(l,u,t?.status,t?.hosts),d=dm(u?.view);n(m),a(d),p(t,r)},[]);let c=sl.useMemo(()=>{if(!i||!s)return null;let u=()=>{let d=o?tl(o):void 0;if(!d)throw`Wizard step is currently ${s}, but no static ip info is defined`;let g=dm(d.view);wpe(g,i)||a(g)},m=d=>{Ka(s)&&!Ka(d)&&u(),n(d)};return{moveBack(){let d=i.indexOf(s),g=i[d-1];g==="static-ip-host-configurations"&&(g="static-ip-network-wide-configurations"),m(g)},moveNext(){let d=i.indexOf(s);m(i[d+1])},onUpdateStaticIpView(d){a(dm(d)),d===ze.YAML?n("static-ip-yaml-view"):n("static-ip-network-wide-configurations")},onUpdateHostNetworkConfigType(d){d===Ye.STATIC?a(dm(ze.FORM)):a(dm())},wizardStepIds:i,currentStepId:s,setCurrentStepId:m}},[i,s,o]);return c?sl.createElement(sl.Fragment,null,sl.createElement(eN.Provider,{value:c},e)):null},Yp=Dpe;var RH=()=>{let e=[];return ds()||e.push(se.createElement(Npe,{key:"cancel",variant:Vpe.secondary,component:t=>se.createElement(Fpe,{to:Uv,...t})},"Back")),e},UI=()=>se.createElement(BI,{"data-testid":"ai-cluster-details-card"},se.createElement(WI,null,se.createElement(GI,{headingLevel:"h1",size:"lg",className:"card-title"},"Loading additional details")),se.createElement(zI,null,se.createElement(z,null))),Hpe=({clusterId:e})=>{let t=Xu(e);return se.createElement(BI,{"data-testid":"ai-cluster-details-card"},se.createElement(WI,null,se.createElement(GI,{headingLevel:"h1",size:"lg",className:"card-title"},"Loading additional details")),se.createElement(zI,null,se.createElement(j,{title:"Failed to fetch the cluster",fetchData:t,actions:RH()})))},Mpe=()=>se.createElement(BI,{"data-testid":"ai-cluster-details-card"},se.createElement(WI,null,se.createElement(GI,{headingLevel:"h1",size:"lg",className:"card-title"},"Loading additional details")),se.createElement(zI,null,se.createElement(j,{title:"Failed to retrieve the default configuration",actions:RH()}))),Lpe=({aiClusterId:e,allEnabledFeatures:t,permissions:o})=>{let{cluster:r,uiState:s}=Kg(e),{infraEnv:n,isLoading:i,error:a,updateInfraEnv:l}=ei(e,_.USE_DAY1_ARCHITECTURE);if(s===ue.LOADING||i)return se.createElement(UI,null);if(s===ue.ERROR&&!r||a)return se.createElement(Hpe,{clusterId:e});if(!r||!n||r.status==="adding-hosts")return null;let p=["insufficient","ready","pending-for-input"].includes(r.status),c=se.createElement(Yp,{cluster:r,infraEnv:n,permissions:o},p?se.createElement(vh,{cluster:r,infraEnv:n,updateInfraEnv:l}):se.createElement(Ug,{cluster:r})),u=s===ue.ERROR;return se.createElement(ci,{features:t},se.createElement(ur,null,se.createElement(qp,null,se.createElement(Ep,null,se.createElement(Lp,{loadingUI:se.createElement(UI,null),errorUI:se.createElement(Mpe,null)},se.createElement(ys,{loadingUi:se.createElement(UI,null),cluster:r},c),u&&se.createElement(xh,null),se.createElement(Ih,null),se.createElement(kh,null),se.createElement(zp,null))))))},Ope=e=>se.createElement(Epe,{store:Xn},se.createElement(Lpe,{...e})),BH=Ope;import nl from"react";import{Provider as _pe}from"react-redux";import{useSelector as Rpe}from"react-redux";import{Grid as Bpe}from"@patternfly/react-core";var zpe=({allEnabledFeatures:e})=>{let{data:t}=Rpe(Gu);return!t||t.status==="adding-hosts"?null:nl.createElement(ci,{features:e},nl.createElement(ys,{loadingUi:nl.createElement("div",null),cluster:t},nl.createElement(Bpe,{className:"pf-u-mt-md"},nl.createElement(Rg,{cluster:t,externalMode:!0}))))},Wpe=e=>nl.createElement(_pe,{store:Xn},nl.createElement(zpe,{...e})),zH=Wpe;import lt from"react";import{useDispatch as Pce,useSelector as JH}from"react-redux";import{Button as Ace,ButtonVariant as wce,PageSectionVariants as fm,TextContent as Dce,Text as Ece,PageSection as gm}from"@patternfly/react-core";import{AddCircleOIcon as Fce}from"@patternfly/react-icons";import Zt from"react";import{Table as uce,TableHeader as mce,TableBody as dce,RowWrapper as fce,SortByDirection as gce,cellWidth as $H,breakWord as qH,sortable as hce}from"@patternfly/react-table";import{createElement as KI}from"react";import{Modal as Gpe,Button as WH,ModalVariant as Upe}from"@patternfly/react-core";var Kpe=({name:e,onClose:t,onDelete:o})=>KI(Gpe,{title:"Delete cluster",isOpen:!0,onClose:t,variant:Upe.small,actions:[KI(WH,{"data-testid":"delete-cluster-submit",key:"confirm",variant:"danger",onClick:o},"Delete"),KI(WH,{key:"cancel",variant:"link",onClick:t},"Cancel")]},"Are you sure you want to delete cluster ",e," ?"),GH=Kpe;import Lt from"react";import{useDispatch as $pe,useSelector as qpe}from"react-redux";import{useHistory as Ype}from"react-router-dom";import{Toolbar as jpe,ToolbarItem as Xpe,ToolbarContent as Jpe,ToolbarFilter as Zpe,InputGroup as Qpe,Select as ece,SelectOption as tce,TextInput as oce,ButtonVariant as UH,Spinner as rce,ToolbarGroup as sce,Tooltip as nce}from"@patternfly/react-core";import{FilterIcon as ice,SyncIcon as ace}from"@patternfly/react-icons";import lce from"lodash/omit";var pce=e=>Array.from(new Set(Object.values(lce(bn(e),"adding-hosts")))),cce=({searchString:e,setSearchString:t,filters:o,setFilters:r})=>{let[s,n]=Lt.useState(!1),i=Ype(),a=qpe(Ku),l=$pe(),p=Lt.useCallback(()=>l(za()),[l]),c=()=>{r({status:[]})},u=t,m=(y,I,b)=>{r({...o,[y]:I?[...o[y],b]:o[y].filter(k=>k!==b)})},d=()=>n(!s),g=(y,I)=>{m("status",y.target.checked,I)},C=(y,I)=>{y?r({...o,[y]:o[y].filter(b=>b!==I)}):c()},h=y=>{r({...o,[y]:[]})},S=Lt.createElement(Lt.Fragment,null,Lt.createElement(ice,null)," Status"),{t:v}=f();return Lt.createElement(jpe,{id:"clusters-list-toolbar",className:"pf-m-toggle-group-container",collapseListedFiltersBreakpoint:"xl",clearAllFilters:c},Lt.createElement(Jpe,null,Lt.createElement(Xpe,null,Lt.createElement(Qpe,null,Lt.createElement(oce,{name:"search-string",id:"search-string",type:"search","aria-label":"string to be searched in cluster names or ids",onChange:u,value:e,placeholder:"Filter by Name, ID or Base domain",title:"Filter by Name, ID or Base domain"}))),Lt.createElement(Zpe,{chips:o.status,deleteChip:C,deleteChipGroup:h,categoryName:"status"},Lt.createElement(ece,{variant:"checkbox","aria-label":"status",onToggle:d,onSelect:g,selections:o.status,isOpen:s,placeholderText:S,toggleId:"cluster-list-filter-status"},pce(v).map(y=>Lt.createElement(tce,{key:y,value:y,inputId:`cluster-list-filter-status-${y}`})))),Lt.createElement(Rt,{variant:UH.primary,onClick:()=>i.push(`${Te}/clusters/~new`),id:"button-create-new-cluster","data-ouia-id":"button-create-new-cluster"},"Create Cluster"),a===ue.RELOADING&&Lt.createElement(rce,{size:"lg"}),Lt.createElement(sce,{alignment:{lg:"alignRight"}},Lt.createElement(Rt,{variant:UH.plain,onClick:()=>p(),isDisabled:a===ue.RELOADING},Lt.createElement(nce,{content:"Refresh"},Lt.createElement(ace,null))))))},KH=cce;var Cce=({rowData:e})=>e?.props.id,YH="assisted-installer-cluster-list-filters",fn={transforms:[hce],cellTransforms:[],formatters:[],cellFormatters:[],props:{}},yce=[{title:"Name",dataLabel:"Name",...fn,transforms:fn?.transforms?.concat($H(20)),cellTransforms:fn?.cellTransforms?.concat(qH)},{title:"Base domain",dataLabel:"Base domain",...fn,transforms:fn?.transforms?.concat($H(40)),cellTransforms:fn?.cellTransforms?.concat(qH)},{title:"Version",dataLabel:"Version",...fn},{title:"Status",dataLabel:"Status",...fn},{title:"Hosts",dataLabel:"Hosts",...fn},{title:"Created at",dataLabel:"Created at",...fn}],Sce=e=>e.cells?.[3],vce=e=>Zt.createElement(fce,{...e,"data-testid":`cluster-row-${e.row?.props?.name}`,id:`cluster-row-${e.row?.props?.name}`}),Ice=({rows:e,deleteCluster:t})=>{let[o,r]=Zt.useState(),[s,n]=Zt.useState({index:0,direction:gce.asc}),[i,a]=Zt.useState(""),[l,p]=Zt.useState({status:[]}),{t:c}=f();Zt.useEffect(()=>{let C=window.sessionStorage.getItem(YH);if(C)try{let h=JSON.parse(C);h.filters&&p(h.filters),h.sortBy&&n(h.sortBy),h.searchString&&a(h.searchString)}catch(h){console.info("Failed to restore clusters filter: ",h)}},[]),Zt.useEffect(()=>{window.sessionStorage.setItem(YH,JSON.stringify({filters:l,sortBy:s,searchString:i}))},[l,s,i]);let u=Zt.useCallback(C=>[{title:"Delete",id:`button-delete-${C.props.name}`,isDisabled:Bv(C).sortableValue===bn(c).installing,onClick:(h,S,v)=>{r({id:v.props.id,name:v.props.name})}}],[r]),m=Zt.useCallback((C,h,S)=>{n({index:h,direction:S})},[n]),d=Zt.useCallback(C=>{let h=[C.props.name,C.props.id,C.props.baseDnsDomain].map(v=>(v||"").toLowerCase());if(i&&!h.find(v=>v.includes(i.toLowerCase())))return!1;let S=Sce(C)?.sortableValue;return!(l.status.length>0&&S&&!l.status.includes(S))},[i,l]),g=Zt.useMemo(()=>e.filter(d).sort(Ml(s,(C,h=0)=>C.cells?.[h])),[e,s,d]);return Zt.createElement(Zt.Fragment,null,Zt.createElement(KH,{searchString:i,setSearchString:a,filters:l,setFilters:p}),Zt.createElement(uce,{rows:g,cells:yce,actionResolver:u,"aria-label":"Clusters table",sortBy:s,onSort:m,rowWrapper:vce,"data-testid":"clusters-table"},Zt.createElement(mce,null),Zt.createElement(dce,{rowKey:Cce})),o&&Zt.createElement(GH,{name:o.name,onClose:()=>r(void 0),onDelete:()=>{t(o.id),r(void 0)}}))},jH=Ice;import ea from"react";import{PageSectionVariants as bce,Breadcrumb as kce,BreadcrumbItem as Th,PageSection as xce}from"@patternfly/react-core";import{Link as XH}from"react-router-dom";var Tce=({clusterName:e,isHidden:t=ds()})=>t?null:ea.createElement(xce,{variant:bce.light},(e||Ce)&&ea.createElement(kce,null,ea.createElement(Th,null,ea.createElement(XH,{to:"/"},"Clusters")),e?ea.createElement(Th,null,ea.createElement(XH,{to:`${Te}/clusters`},"Assisted Clusters")):ea.createElement(Th,{isActive:!0},"Assisted Clusters"),e&&ea.createElement(Th,{isActive:!0},e))),il=Tce;var Nce=({history:e})=>{let{LOADING:t,EMPTY:o,ERROR:r,RELOADING:s}=ue,{addAlert:n}=M(),{t:i}=f(),a=JH(zv(i)),l=JH(Ku),p=lt.useRef(l);l!==s&&(p.current=l);let c=Pce(),u=lt.useCallback(async d=>{try{await Se.remove(d),c(yE(d))}catch(g){D(g,()=>n({title:"Cluster could not be deleted",message:R(g)}))}},[c,n]),m=lt.useCallback(()=>c(za()),[c]);switch(lt.useEffect(()=>{m()},[m]),p.current){case t:return lt.createElement(gm,{variant:fm.light,isFilled:!0},lt.createElement(z,null));case r:return lt.createElement(gm,{variant:fm.light,isFilled:!0},lt.createElement(j,{title:"Failed to fetch clusters.",fetchData:m}));case o:return lt.createElement(gm,{variant:fm.light,isFilled:!0},lt.createElement(ot,{icon:Fce,title:"Create new assisted cluster",content:"There are no clusters yet. This wizard is going to guide you through the OpenShift cluster deployment.",primaryAction:lt.createElement(Ace,{variant:wce.primary,onClick:()=>e.push(`${Te}/clusters/~new`),id:"empty-state-new-cluster-button","data-ouia-id":"button-create-new-cluster"},"Create New Cluster")}));default:return lt.createElement(lt.Fragment,null,lt.createElement(il,null),lt.createElement(gm,{variant:fm.light},lt.createElement(Dce,null,lt.createElement(Ece,{component:"h1"},"Assisted Clusters"))),lt.createElement(gm,{variant:fm.light,isFilled:!0},lt.createElement(mr,null),lt.createElement(jH,{rows:a,deleteCluster:d=>void u(d)})))}},Vce=e=>lt.createElement(ur,null,lt.createElement(Nce,{...e})),Ph=Vce;import nr from"react";import{PageSectionVariants as tM,TextContent as Uce,Text as Kce,PageSection as oM}from"@patternfly/react-core";import Hce from"classnames";import ZH from"react";var Mce=()=>ZH.createElement("div",{className:Hce("pf-c-wizard","cluster-wizard")},ZH.createElement(Qg,null)),QH=Mce;import{PageSection as Lce,PageSectionVariants as Oce}from"@patternfly/react-core";import eM from"react";var _ce=()=>eM.createElement(Lce,{variant:Oce.light,isFilled:!0},eM.createElement(z,null)),al=_ce;import Ah from"react";import{Button as Rce,ButtonVariant as Bce,PageSection as zce,PageSectionVariants as Wce}from"@patternfly/react-core";import{Link as Gce}from"react-router-dom";var wh=()=>ds()?[]:[Ah.createElement(Rce,{key:"cancel",variant:Bce.secondary,component:e=>Ah.createElement(Gce,{to:`${Te}/clusters`,...e})},"Back")],Dh=()=>Ah.createElement(zce,{variant:Wce.light,isFilled:!0},Ah.createElement(j,{title:"Failed to retrieve the default configuration",actions:wh()}));var $ce=()=>nr.createElement(ur,null,nr.createElement(qp,null,nr.createElement(Lp,{loadingUI:nr.createElement(al,null),errorUI:nr.createElement(Dh,null)},nr.createElement(ys,{loadingUi:nr.createElement(al,null)},nr.createElement(il,{clusterName:"New cluster"}),nr.createElement(oM,{variant:tM.light},nr.createElement(Uce,null,nr.createElement(Kce,{component:"h1",className:"pf-u-display-inline"},"Install OpenShift with the Assisted Installer"))),nr.createElement(oM,{variant:tM.light,isFilled:!0},nr.createElement(Yp,null,nr.createElement(QH,null))))))),jp=$ce;import re from"react";import{Redirect as EM}from"react-router-dom";import{PageSection as Xp,PageSectionVariants as Jp,Text as FM,TextContent as NM}from"@patternfly/react-core";import gt from"react";import{ButtonVariant as zue,Card as Wue,CardBody as Gue,CardFooter as Uue,CardTitle as Kue,Grid as $ue,Stack as que,StackItem as DM,Title as Yue,Toolbar as jue,ToolbarContent as Xue}from"@patternfly/react-core";import Jr from"react";import{Text as Mue,TextContent as Lue,Alert as Oue,AlertVariant as _ue,Stack as Rue,StackItem as YI}from"@patternfly/react-core";import ta from"react";import rM from"react";var sM=rM.createContext(null),Xr=()=>{let e=rM.useContext(sM);if(!e)throw new Error("useDay2WizardContext must be used within Day2WizardContextProvider");return e},nM=sM;var iM={"cluster-details":"Cluster details","static-ip-yaml-view":"Static network configurations","static-ip-network-wide-configurations":"Network-wide configurations","static-ip-host-configurations":"Host specific configurations","generate-iso":"Generate discovery ISO","download-iso":"Download discovery ISO"},aM=["cluster-details","generate-iso","download-iso"],Eh=["static-ip-network-wide-configurations","static-ip-host-configurations"];var Fh=e=>{let t=[...aM];return e===ze.YAML?t.splice(1,0,"static-ip-yaml-view"):e===ze.FORM&&t.splice(1,0,...Eh),t},lM=(e,t)=>{let o=e.indexOf(t);return e[o+1]},qce=({children:e})=>{let[t,o]=ta.useState("cluster-details"),[r,s]=ta.useState(_.x86),[n,i]=ta.useState(""),[a,l]=ta.useState(Fh()),p=ta.useMemo(()=>!a||!t?null:{moveBack(){let c=a.indexOf(t),u=a[c-1];u==="static-ip-host-configurations"&&(u="static-ip-network-wide-configurations"),o(u)},moveNext(){o(lM(a,t))},onUpdateStaticIpView(c){l(Fh(c)),c===ze.YAML?o("static-ip-yaml-view"):o("static-ip-network-wide-configurations")},onUpdateHostNetworkConfigType(c){let u;c===Ye.STATIC?u=Fh(ze.FORM):u=Fh(),l(u),o(lM(u,t))},wizardStepIds:a,currentStepId:t,setCurrentStepId:o,selectedIsoUrl:n,setSelectedIsoUrl:i,selectedCpuArchitecture:r,setSelectedCpuArchitecture:s},[a,t,n,r]);return p?ta.createElement(ta.Fragment,null,ta.createElement(nM.Provider,{value:p},e)):null},pM=qce;import Yce from"react";import{Button as jce,ButtonVariant as Xce}from"@patternfly/react-core";var Jce=({cluster:e})=>{let{day2DiscoveryImageDialog:t}=ve(),{open:o}=t;return Yce.createElement(jce,{variant:Xce.secondary,onClick:()=>o({cluster:e}),id:"bare-metal-inventory-add-host-button-download-discovery-iso"},"Add hosts")},cM=Jce;import hn from"react";import{Modal as Due,ModalVariant as Eue,WizardHeader as Fue}from"@patternfly/react-core";import Nue from"classnames";import{Grid as due,GridItem as qI}from"@patternfly/react-core";import{Form as fue,Formik as gue}from"formik";import Qt from"react";import ai from"react";import{FormGroup as Zce,Flex as Qce,FlexItem as eue,TextContent as tue,Text as oue,TextVariants as rue}from"@patternfly/react-core";var uM="cpuArchitecture",sue=({canSelectCpuArchitecture:e,day1CpuArchitecture:t,openshiftVersion:o})=>{let{t:r}=f();return e?ai.createElement(Zce,{isInline:!0,fieldId:E(uM,"radio"),label:ai.createElement(tue,null,ai.createElement(oue,{component:rue.h4},r("ai:CPU architecture"),ai.createElement(ko,{featureId:"MULTIARCH_RELEASE_IMAGE",openshiftVersion:o})))},ai.createElement(Qce,null,ga.map(s=>ai.createElement(eue,{key:s},ai.createElement(ie,{key:s,id:`cpu-arch_${s}`,name:uM,label:s,value:s,"data-testid":`cpu-arch_${s}`}))))):ai.createElement(bt,null,ai.createElement(N,{title:r("ai:CPU architecture"),value:t,testId:"cpu-architecture"}))},mM=sue;import Nh from"react";import{WizardNav as dM,WizardNavItem as fM}from"@patternfly/react-core";var nue=()=>{let e=Xr(),t=i=>!e.wizardStepIds.slice(i).includes(e.currentStepId),o=(i,a)=>a==="cluster-details"?!1:t(i),r=(i,a)=>Nh.createElement(fM,{step:i,key:a,content:iM[a],onNavItemClick:()=>e.setCurrentStepId(a),isCurrent:e.currentStepId===a,isDisabled:o(i,a)}),s=i=>Nh.createElement(fM,{step:i,isExpandable:!0,content:"Static network configurations",key:"static-network-configuration-form-view",isCurrent:Ka(e.currentStepId),isDisabled:t(i)},Nh.createElement(dM,{returnList:!0},Eh.map((a,l)=>r(i+l,a))));return Nh.createElement(dM,null,(()=>{let i=[],a=0;for(;a<e.wizardStepIds.length;){let l=e.wizardStepIds[a];l==="static-ip-network-wide-configurations"?(i.push(s(a)),a+=2):(i.push(r(a,l)),a+=1)}return i})())},gn=nue;import oa from"react";import{Flex as iue,FlexItem as gM,FormGroup as aue,TextContent as lue,TextVariants as pue,Text as cue}from"@patternfly/react-core";import{useFormikContext as uue}from"formik";var $I="hostsNetworkConfigurationType",mue=()=>{let{setFieldValue:e}=uue(),t=o=>{e("hostsNetworkConfigurationType",o.target.value)};return oa.createElement(aue,{label:oa.createElement(lue,null,oa.createElement(cue,{component:pue.h4},"Hosts' network configuration")),fieldId:E($I,"radio"),isInline:!0,onChange:t},oa.createElement(iue,null,oa.createElement(gM,{key:Ye.DHCP},oa.createElement(ie,{name:$I,value:Ye.DHCP,label:"DHCP only"})),oa.createElement(gM,{key:Ye.STATIC},oa.createElement(ie,{name:$I,value:Ye.STATIC,label:"Static IP, bridges, and bonds"}))))},hM=mue;var CM=e=>{switch(e){case Nr.x86:case Nr.MULTI:return _.x86;case Nr.ARM:return _.ARM;default:throw new Error(`Unknown OCM CPU architecture: ${e}`)}},yM=e=>{switch(e){case _.ARM:case Nr.ARM:return _.ARM;case _.DAY1_CLUSTER_USES_MULTI:case Nr.MULTI:case _.x86:case Nr.x86:default:return _.x86}};var hue=async(e,t)=>{try{let o=await Xt.getInfraEnv(e,t);return{cpuArchitecture:t,hostsNetworkConfigurationType:o.staticNetworkConfig?Ye.STATIC:Ye.DHCP}}catch(o){return D(o),null}},Cue=()=>{let{day2DiscoveryImageDialog:e}=ve(),{close:t,data:{cluster:o}}=e,r=Xr(),[s,n]=Qt.useState(),[i,a]=Qt.useState(!1),l=qm(o),p=yM(o.cpuArchitecture);Qt.useEffect(()=>{(async()=>{let m=await hue(o.id,p);n(m)})()},[o.id,p]);let c=Qt.useCallback(async u=>{try{a(!0),u.hostsNetworkConfigurationType===Ye.DHCP&&await Xt.updateAllInfraEnvsToDhcp(o.id),r.setSelectedCpuArchitecture(u.cpuArchitecture),r.onUpdateHostNetworkConfigType(u.hostsNetworkConfigurationType)}catch(m){D(m)}finally{a(!1)}},[o.id,r]);return s===void 0?Qt.createElement(z,null):s===null?Qt.createElement(j,{content:"Failed to load associated data for the Day2 cluster"}):Qt.createElement(gue,{initialValues:s,onSubmit:c},({submitForm:u})=>Qt.createElement(Ee,{navigation:Qt.createElement(gn,null),footer:Qt.createElement(Lr,{onNext:()=>{u()},onBack:()=>r.moveBack(),isBackDisabled:r.currentStepId==="cluster-details",isNextDisabled:r.currentStepId==="download-iso",onCancel:t,isSubmitting:i})},Qt.createElement(fue,{id:"day2-wizard-cluster-details__form"},Qt.createElement(due,{hasGutter:!0},Qt.createElement(qI,null,Qt.createElement(De,null,"Cluster details")),Qt.createElement(qI,{span:12,lg:10,xl:9,xl2:7},Qt.createElement(mM,{canSelectCpuArchitecture:l,day1CpuArchitecture:p,openshiftVersion:o.openshiftVersion})),Qt.createElement(qI,null,Qt.createElement(hM,null))))))},SM=Cue;import ll from"react";import{Stack as yue,StackItem as vM}from"@patternfly/react-core";var Sue=()=>{let{day2DiscoveryImageDialog:e}=ve(),{close:t,data:o}=e,r=o.cluster,s=Xr();return ll.createElement(Ee,{navigation:ll.createElement(gn,null)},ll.createElement(yue,{hasGutter:!0},ll.createElement(vM,null,ll.createElement(De,null,"Download Discovery ISO")),ll.createElement(vM,null,ll.createElement(th,{onClose:t,onReset:()=>s.moveBack(),clusterName:r?.name||"cluster",isSNO:ne(r),isoDownloadUrl:s.selectedIsoUrl,cpuArchitecture:s.selectedCpuArchitecture}))))},IM=Sue;import ra from"react";import{Stack as vue,StackItem as bM}from"@patternfly/react-core";var Iue=()=>{let{day2DiscoveryImageDialog:e}=ve(),{close:t,data:o}=e,r=o.cluster,s=Xr(),{getIsoImageUrl:n}=em(),i=ra.useCallback(async()=>{let a=await n(r.id,s.selectedCpuArchitecture);a.error||(s.setSelectedIsoUrl(a.url),s.moveNext())},[r?.id,s,n]);return ra.createElement(Ee,{navigation:ra.createElement(gn,null)},ra.createElement(vue,{hasGutter:!0},ra.createElement(bM,null,ra.createElement(De,null,"Generate Discovery ISO")),ra.createElement(bM,null,ra.createElement(eh,{cluster:r,cpuArchitecture:s.selectedCpuArchitecture,onCancel:t,onSuccess:i}))))},kM=Iue;import je from"react";import{Grid as bue,TextContent as kue,Text as xM,TextVariants as TM,PageSection as xue,PageSectionVariants as Tue,Button as Pue,ButtonVariant as Aue}from"@patternfly/react-core";var wue=()=>{let{day2DiscoveryImageDialog:e}=ve(),t=Xr(),[o,r]=je.useState(void 0),[s,n]=je.useState(!1),[i,a]=je.useState(!1),[l,p]=je.useState(!1),[c,u]=je.useState(EE()),[m,d]=je.useState(),{data:{cluster:g}}=e,C=t.selectedCpuArchitecture,h=je.useCallback(()=>{t.setCurrentStepId("cluster-details"),t.onUpdateHostNetworkConfigType(Ye.DHCP)},[t]);je.useEffect(()=>{(async()=>{let T;try{T=await Xt.getInfraEnv(g.id,C)}catch{n(!0),r(void 0);return}T.staticNetworkConfig||(T=await Xt.setDummyStaticConfigToInfraEnv(T.id));let w=tl(T);w?(r(T),u(w)):n(!0)})()},[g.id,C]);let S=je.useCallback(k=>{t.onUpdateStaticIpView(k),p(!0)},[]);if(s)return je.createElement(xue,{variant:Tue.light,isFilled:!0},je.createElement(j,{title:"Cannot load the Static IP configuration for this cluster",content:"For non-multi-architecture clusters, make sure you select the Day1 cpu architecture",actions:[je.createElement(Pue,{key:"restart-wizard",variant:Aue.primary,onClick:h},"Back to Wizard")]}));if(!o)return je.createElement(z,null);let y={infraEnv:o,onFormStateChange:k=>{let T=t.currentStepId==="static-ip-host-configurations"||!k.isEmpty;a(T),d(k)},updateInfraEnv:async k=>{let T=await Xt.syncStaticIpConfigs(g.id,o.id,k.staticNetworkConfig);return r(T),T},showEmptyValues:l},b=(()=>{if(c.view===ze.YAML&&!l)return je.createElement(am,{...y});switch(t.currentStepId){case"static-ip-yaml-view":return je.createElement(am,{...y});case"static-ip-host-configurations":return je.createElement(hh,{...y});case"static-ip-network-wide-configurations":return je.createElement(Ch,{...y});default:throw`Unexpected wizard step id ${t.currentStepId} when entering static ip page`}})();return b?je.createElement(Ee,{navigation:je.createElement(gn,null),footer:je.createElement(Lr,{onNext:()=>t.moveNext(),onBack:()=>t.moveBack(),isNextDisabled:!m?.isValid||m.isAutoSaveRunning,onCancel:e.close,isSubmitting:m?.isSubmitting})},je.createElement(bue,{hasGutter:!0},je.createElement(kue,null,je.createElement(xM,{component:TM.h2},"Static network configurations"),je.createElement(xM,{component:TM.small},"Network configuration can be done using either the form view or YAML view. Configurations done in this step are for discovering hosts.")),je.createElement(sh,{initialView:c.view,confirmOnChangeView:i,onChangeView:S}),b)):null},PM=wue;var Vue=(e,t)=>{switch(e){case"cluster-details":return hn.createElement(SM,null);case"generate-iso":return hn.createElement(kM,null);case"download-iso":return hn.createElement(IM,null);case"static-ip-network-wide-configurations":case"static-ip-host-configurations":case"static-ip-yaml-view":return hn.createElement(PM,null);default:return hn.createElement(Ee,{navigation:hn.createElement(gn,null),footer:hn.createElement(Lr,{onNext:()=>t.moveNext(),onBack:()=>t.moveBack(),isBackDisabled:t.currentStepId==="cluster-details",isNextDisabled:t.currentStepId==="download-iso",onCancel:close})},"Step ",e)}},Hue=()=>{let{day2DiscoveryImageDialog:e}=ve(),{isOpen:t,close:o}=e,r=Xr();return hn.createElement(Due,{isOpen:t,variant:Eue.large,showClose:!1,hasNoBodyWrapper:!0},hn.createElement("div",{className:Nue("pf-c-wizard","cluster-wizard")},hn.createElement(Fue,{title:"Add hosts",description:"Choose the settings for adding a new host",onClose:o}),Vue(r.currentStepId,r)))},AM=Hue;var Bue=({cluster:e})=>{if(!e)return null;let t=!qm(e)&&Vr(e);return Jr.createElement(Rue,{hasGutter:!0},Jr.createElement(YI,null,Jr.createElement(Lue,null,Jr.createElement(Mue,{component:"p"},Jr.createElement(pM,null,Jr.createElement(cM,{cluster:e}),Jr.createElement(AM,null))),Jr.createElement(rh,{cluster:e}))),t&&Jr.createElement(YI,null,Jr.createElement(Oue,{title:"Only hosts that have arm64 cpu architecture can be added to this cluster.",variant:_ue.info,"data-testid":"arm-architecture-alert",isInline:!0})),Jr.createElement(YI,null,Jr.createElement(Np,{cluster:e})))},wM=Bue;var{addAlert:Jue}=Si.actions,hm=()=>{let{cluster:e,resetCluster:t}=gt.useContext(Ii),[o,r]=gt.useState(!1),s=_p(e),n=gt.useCallback(async()=>{r(!0);try{if(!e||!t||!e.hosts)return;let i=e.hosts.filter(a=>vc(e,a.status));await lo.installAll(i),await t()}catch(i){D(i,()=>Jue({title:"Failed to start hosts installation.",message:R(i)}))}finally{setTimeout(()=>{r(!1)},1e4)}},[e,t]);return!e||!t?null:gt.createElement(Ep,null,gt.createElement(Wue,null,gt.createElement(Kue,null,gt.createElement(Yue,{headingLevel:"h2",size:"lg",className:"card-title"},"Host Discovery")),gt.createElement(Gue,null,gt.createElement(que,{hasGutter:!0},gt.createElement(DM,null,gt.createElement($ue,{hasGutter:!0},gt.createElement(Rp,{cluster:e,clusterVarieties:s}))),gt.createElement(DM,null,gt.createElement(wM,{cluster:e})))),gt.createElement(Uue,null,gt.createElement(mr,null),gt.createElement(jue,{id:"cluster-toolbar"},gt.createElement(Xue,null,gt.createElement(Rt,{variant:zue.primary,name:"install",onClick:()=>void n(),isDisabled:o||bc(e)===0},"Install ready hosts"),gt.createElement(yi,{cluster:e,onFetchEvents:hs}))))),gt.createElement(zp,null))};var Zue=({match:e})=>{let{clusterId:t}=e.params,o=Xu(t),{cluster:r,uiState:s,errorDetail:n}=Kg(t),{infraEnv:i,isLoading:a,error:l,updateInfraEnv:p}=ei(t,_.USE_DAY1_ARCHITECTURE),c=(u,m)=>u.status==="adding-hosts"?re.createElement(Pd,{cluster:u,resetCluster:zi},re.createElement(hm,null)):["preparing-for-installation","installing","installing-pending-user-action","finalizing","installed","error","cancelled"].includes(u.status)?re.createElement(re.Fragment,null,re.createElement(il,{clusterName:u.name}),re.createElement(Xp,{variant:Jp.light},re.createElement(NM,null,re.createElement(FM,{component:"h1"},u.name))),re.createElement(Xp,{variant:Jp.light,isFilled:!0},re.createElement(Wg,{cluster:u}))):re.createElement(re.Fragment,null,re.createElement(il,{clusterName:u.name}),re.createElement(Xp,{variant:Jp.light},re.createElement(NM,null,re.createElement(FM,{component:"h1",className:"pf-u-display-inline"},"Install OpenShift with the Assisted Installer"))),re.createElement(Xp,{variant:Jp.light},re.createElement(Yp,{cluster:u,infraEnv:m},re.createElement(vh,{cluster:u,infraEnv:m,updateInfraEnv:p}))));if(s===ue.LOADING||a)return re.createElement(al,null);if(s===ue.ERROR&&!r)return Number(n?.code)===404?re.createElement(EM,{to:`${Te}/clusters`}):re.createElement(Xp,{variant:Jp.light,isFilled:!0},re.createElement(j,{title:"Failed to fetch the cluster",fetchData:Number(n?.code)===401?()=>window.location.reload():o,actions:wh()}));if(l)return re.createElement(Xp,{variant:Jp.light,isFilled:!0},re.createElement(j,{title:"Cluster not found",actions:wh(),content:"Check to make sure the cluster-ID is valid. Otherwise, the cluster may have been deleted."}));if(r&&i){let u=s===ue.ERROR;return re.createElement(ur,null,re.createElement(qp,null,re.createElement(Ep,null,re.createElement(Lp,{loadingUI:re.createElement(al,null),errorUI:re.createElement(Dh,null)},re.createElement(ys,{loadingUi:re.createElement(al,null),cluster:r},c(r,i),u&&re.createElement(xh,null),re.createElement(Ih,null),re.createElement(kh,null),re.createElement(zp,null))))))}return re.createElement(EM,{to:"/clusters"})},Cm=Zue;import jI from"react";var ym=({children:e})=>jI.createElement(jI.Fragment,null,e,jI.createElement("div",{"data-testid":"assisted-ui-lib-version",hidden:!0},mC()));import wr from"react";import{Provider as tme}from"react-redux";import{Switch as LM,Route as Sm,Redirect as OM}from"react-router-dom";import Cn from"react";import{Redirect as Que}from"react-router-dom";import{PageSectionVariants as VM,PageSection as HM}from"@patternfly/react-core";var eme=()=>{let[e,t]=Cn.useState(""),[o,r]=Cn.useState(),s=Cn.useCallback(async()=>{try{let{data:n}=await X.list();r(n),t("")}catch(n){D(n,()=>t("Failed to fetch cluster."))}},[r]);return Cn.useEffect(()=>{s()},[s]),e?Cn.createElement(HM,{variant:VM.light,isFilled:!0},Cn.createElement(j,{title:"Failed to fetch cluster.",fetchData:s})):o?o.length===0?Cn.createElement(jp,null):(o.length>1&&console.warn("More than one cluster found!",o),Cn.createElement(Que,{to:`${Te}/clusters/${o[0].id}`})):Cn.createElement(HM,{variant:VM.light,isFilled:!0},Cn.createElement(z,null))},MM=eme;var ome=({allEnabledFeatures:e})=>wr.createElement(tme,{store:Xn},wr.createElement(_M,{features:e})),_M=({features:e,children:t})=>wr.createElement(ci,{features:e},wr.createElement(ym,null),ds()?wr.createElement(LM,null,wr.createElement(Sm,{path:`${Te}/clusters/:clusterId`,component:Cm}),wr.createElement(Sm,{path:`${Te}/clusters`,component:MM}),t,wr.createElement(OM,{to:`${Te}/clusters`})):wr.createElement(LM,null,wr.createElement(Sm,{path:`${Te}/clusters/~new`,component:jp}),wr.createElement(Sm,{path:`${Te}/clusters/:clusterId`,component:Cm}),wr.createElement(Sm,{path:`${Te}/clusters`,component:Ph}),t,wr.createElement(OM,{to:`${Te}/clusters`})));var XI=e=>{let t="",o="";try{if(e.api?.url)o="api",t=new URL(e.api.url).hostname;else if(e.console?.url){o="console";let r=new URL(e.console.url).hostname,s=".apps.";t="api."+r.substring(r.indexOf(s)+s.length)}}catch{}return{apiVipDnsname:t,errorType:t?"":o}},vm={getOpenshiftClusterId(e){return e&&e.external_id},async fetchCluster(e,t,o,r){let s=vm.getOpenshiftClusterId(e);if(!s)return;let n=await vm.getDay2ClusterId(s);if(n)return vm.fetchClusterById(n);let a=e.cpu_architecture===Nr.MULTI||r.canSelectCpuArchitecture?ga:[CM(e.cpu_architecture)];return vm.createCluster(s,e.display_name||e.name||s,XI(e).apiVipDnsname,t,o,a)},async fetchClusterById(e){let{data:t}=await X.get(e);return t},async getDay2ClusterId(e){let{data:t}=await X.listByOpenshiftId(e),o=t.filter(r=>r.kind==="AddHostsCluster");if(o.length>0)return o[0].id},async createCluster(e,t,o,r,s,n){let{data:i}=await X.registerAddHosts({openshiftClusterId:e,name:`scale-up-${t}`,apiVipDnsname:o,openshiftVersion:s}),a=n.map(l=>Xt.create({name:`${i.name||""}_infra-env-${l}`,pullSecret:r,clusterId:i.id,openshiftVersion:s,cpuArchitecture:l}));return await Promise.all(a),i},completeAiClusterWithOcmCluster:(e,t,o)=>!t||!e?e:{...e,openshiftVersion:t.openshift_version,cpuArchitecture:t.cpu_architecture,canSelectCpuArch:o.canSelectCpuArchitecture}},sa=vm;var rme=e=>FF(e.openshift_version,e.aiSupportLevels||[],"SINGLE_NODE_EXPANSION"),sme=({cluster:e})=>{if(!e.canEdit||!sa.getOpenshiftClusterId(e))return!1;let t=(e.metrics?.nodes?.total||0)>1;return e.state==="ready"&&e.product?.id==="OCP-AssistedInstall"&&(t||rme(e))};import Hh from"react";import{Provider as ime}from"react-redux";import Le from"react";import{Button as Vh,EmptyStateVariant as nme}from"@patternfly/react-core";var RM=({cluster:e,extraInfo:t,isVisible:o})=>{let[r,s]=Le.useState(),[n,i]=Ms(void 0),a=Hp(),{normalizeClusterVersion:l}=$r(),p=Le.useCallback(()=>{s(void 0),i(void 0)},[i]);Le.useEffect(()=>{!o&&n&&i(void 0);let u=sa.getOpenshiftClusterId(e);if(o&&n===void 0&&e&&u&&a){i(null);let m=l(e.openshift_version);if(!m){s(Le.createElement(Le.Fragment,null,"Unsupported OpenShift cluster version: ",e.openshift_version||"N/A",".",Le.createElement("br",null),"Check your connection and"," ",Le.createElement(Vh,{variant:"link",isInline:!0,onClick:p},"try again"),"."));return}let{apiVipDnsname:d,errorType:g}=XI(e);if(g){let h=g==="console"?`Cluster Console URL is not valid (${e.console?.url||""})`:`Cluster API URL is not valid (${e.api?.url||""})`;s(Le.createElement(Le.Fragment,null,h,", you can"," ",Le.createElement(Vh,{variant:"link",isInline:!0,onClick:p},"try again"),"."));return}if(!d){s(Le.createElement(Le.Fragment,null,"Neither API nor Console URL has been reported by the cluster yet."));return}(async()=>{try{let h=await sa.fetchCluster(e,a,m,t);i(sa.completeAiClusterWithOcmCluster(h,e,t))}catch(h){if(D(h),Aa(h)){let S=h.config.url?.includes("/import");s(Le.createElement(Le.Fragment,null,S?"Failed to create wrapping cluster for adding new hosts.":"Failed to fetch cluster for adding new hosts.",Le.createElement("br",null),"Check your connection and"," ",Le.createElement(Vh,{variant:"link",isInline:!0,onClick:p},"try again"),"."))}return}})()}},[e,t,a,n,i,o,l,p]);let c=Le.useCallback(async()=>{if(!!n?.id)try{let u=await sa.fetchClusterById(n.id);i(sa.completeAiClusterWithOcmCluster(u,e,t))}catch(u){D(u),s(Le.createElement(Le.Fragment,null,"Failed to reload cluster data.",Le.createElement("br",null),"Check your connection and"," ",Le.createElement(Vh,{variant:"link",isInline:!0,onClick:p},"try again"),"."))}},[n?.id,p,e,t,i]);return Le.useEffect(()=>{let u=setTimeout(()=>{(async()=>{await c()})()},ua);return()=>clearTimeout(u)},[c]),r?Le.createElement(j,{variant:nme.large,content:r,title:"Failed to prepare the cluster for adding hosts."}):n?Le.createElement(Pd,{cluster:n,resetCluster:c,ocpConsoleUrl:e?.console?.url},Le.createElement(ys,{loadingUi:Le.createElement(z,null),cluster:n},Le.createElement(hm,null))):Le.createElement(z,{content:"Preparing cluster for adding hosts..."})};var ame=e=>Hh.createElement(ime,{store:Xn},Hh.createElement(ym,null),Hh.createElement(ur,null,Hh.createElement(RM,{...e}))),BM=ame;export{cE as CIM,zM as OCM};
37
+ //# sourceMappingURL=index.js.map