init = (params) => {
  // Clean up the old popup container if it exists
  const oldContainerExisted = resetOldContainer()

  if (isNodeEnv()) {
    error('SweetAlert2 requires document to initialize')
    return
  }

  const container = document.createElement('div')
  container.className = swalClasses.container
  if (oldContainerExisted) {
    addClass(container, swalClasses['no-transition'])
  }
  setInnerHtml(container, sweetHTML)

  container.dataset['swal2Theme'] = params.theme

  const targetElement = getTarget(params.target)
  targetElement.appendChild(container)

  if (params.topLayer) {
    container.setAttribute('popover', '')
    container.showPopover()
  }

  setupAccessibility(params)
  setupRTL(targetElement)
  addInputChangeListeners()
}
Add modal + backdrop + no-war message for Russians to DOM

@param {SweetAlertOptions} params