    const url = new URL(window.location.href)
        const regionId = getUrlParam('regionId')
        const regionDomain = getUrlParam('regionDomain')

        const isValid = validateRegion(regionId, regionDomain)

        if (isValid) {
          setLocalStorage('latest_region', regionDomain)
          setLocalStorage('latest_region_id', regionId)

          const targetRegion = regionDomain
          const targetUrl = buildTargetUrl(targetRegion, url.pathname, url)

          window.location.href = targ