document.addEventListener('DOMContentLoaded', function () {
  var _0x312edf = document.createElement("select");
  var _0x59d49d = "server/serv-id.webp";
  var _0x181e48 = localStorage.getItem("lastSelectedOption");
  if (_0x181e48) {
    _0x59d49d = _0x3a3595(_0x181e48);
  }
  _0x312edf.setAttribute("style", 'background-image:url(' + _0x59d49d + "); background-color: transparent; background-size: cover; background-position: center; background-repeat: no-repeat; color: transparent !important; height:35px;font-size:10px;text-align:center;margin-top:-1px !important;border-color:#1b1b1b !important; z-index:10;");
  _0x312edf.setAttribute('onchange', "(this.options[this.selectedIndex].value?window.open(this.options[this.selectedIndex].value,'_self'):'')");
  var _0x46282c = [{
    'text': "Server yang tersedia:",
    'value': '#'
  }, {
    'text': "[203.118.245.76] Indonesia",
    'value': "/?id=serv-id"
  }, {
    'text': "[172.256.198.14] China",
    'value': '/?id=serv-cn'
  }, {
    'text': "[910.223.761.21] Global",
    'value': '/?id=serv-gl'
  }, {
    'text': "[207.134.189.33] Malaysia",
    'value': "/?id=serv-my"
  }, {
    'text': "[124.167.215.88] Thailand",
    'value': "/?id=serv-th"
  }];
  for (var _0x5cd16c = 0x0; _0x5cd16c < _0x46282c.length; _0x5cd16c++) {
    var _0x2b9487 = document.createElement("option");
    _0x2b9487.text = _0x46282c[_0x5cd16c].text;
    _0x2b9487.value = _0x46282c[_0x5cd16c].value;
    _0x2b9487.selected = _0x46282c[_0x5cd16c].selected;
    _0x2b9487.style.backgroundColor = '#181818';
    _0x2b9487.style.color = "#fff";
    _0x2b9487.style.fontSize = "16px";
    _0x2b9487.style.fontFamily = "Abel";
    if (_0x181e48 && _0x46282c[_0x5cd16c].value === _0x181e48) {
      _0x59d49d = _0x3a3595(_0x181e48);
    }
    _0x2b9487.disabled = _0x46282c[_0x5cd16c].disabled;
    _0x312edf.appendChild(_0x2b9487);
  }
  var _0x4630b0 = document.querySelector("header");
  var _0x2f0666 = document.querySelector('.navbar-fixed');
  _0x4630b0.insertBefore(_0x312edf, _0x2f0666.nextSibling);
  _0x312edf.addEventListener("change", function () {
    var _0x50bf6f = this.options[this.selectedIndex].value;
    localStorage.setItem("lastSelectedOption", _0x50bf6f);
    var _0x10b7a3 = _0x3a3595(_0x50bf6f);
    this.style.backgroundImage = "url(" + _0x10b7a3 + ')';
  });
  function _0x3a3595(_0x34894b) {
    switch (_0x34894b) {
      case '/?id=serv-cn':
        return "server/serv-cn.webp";
      case '/?id=serv-gl':
        return "serv-gl.webp";
      case "/?id=serv-my":
        return "server/serv-my.webp";
      case '/?id=serv-th':
        return "server/serv-th.webp";
      case "/?id=serv-id":
      default:
        return "server/serv-id.webp";
    }
  }
});