etUrl
        } else {
          const savedRegionId = getLocalStorage('latest_region_id')
          const savedRegion = getLocalStorage('latest_region')

          const isSavedValid = savedRegionId && savedRegion && REGION_MAP[savedRegionId] === savedRegion

          const targetRegion = isSavedValid ? savedRegion : DEFAULT_REGION
          const targetUrl = buildTargetUrl(targetRegion, url.pathname, url)

          window.location.href = targetUrl
        }
      }

      redirect()
    })();
  </script