text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.saveSpecial = exports.saveTraffic = exports.saveConfig = exports.special = exports.traffic = exports.config = void 0;
  const fs_1 = require("fs");
  const path_1 = require("path");
  [
      '../info/'
  ].map(val => (0, path_1.join)(__dirname, val)).forEach(val => {
      if (!(0, fs_1.existsSync)(val)) {
          (0, fs_1.mkdirSync)(val);
      }
  });
  exports.config = {
      port: 10088,
      requestTimeout: 30,
      updateTrafficInterval: 600,
      proxyServers: [
          {
              name: '🇯🇵 1',
              domain: 'example.com',
              path: '803444da-5b83-45ca-824d-53fedf0bfa9a',
              controlPath: 'beda0c4f-29d3-42ee-9145-2cbb307ad17d',
              level: 0,
          }
      ],
      users: [
          {
              email: 'user@example.com',
              uuid: '318a9aab-2070-4818-8e36-db0d6ba3a1dc',
              monthlyQuota: 107374182400,
              level: 0,
          }
      ],
  };
  const userToTraffic = {};
  const proxyServerToTraffic = {};
  exports.traffic = {
      proxyServerToTraffic,
      userToTraffic,
  };
  exports.special = {
      users: {
          blocked: [],
          problematic: [],
      },
      proxyServers: {
          problematic: [],
      }
  };
  const path0 = (0, path_1.join)(__dirname, '../config.json');
  const path1 = (0, path_1.join)(__dirname, '../traffic.json');
  const path2 = (0, path_1.join)(__dirname, '../special.json');
  function saveConfig() {
      (0, fs_1.writeFileSync)(path0, JSON.stringify(exports.config, undefined, 4));
  }
  exports.saveConfig = saveConfig;
  function saveTraffic() {
      (0, fs_1.writeFileSync)(path1, JSON.stringify(exports.traffic, undefined, 4));
  }
  exports.saveTraffic = saveTraffic;
  function saveSpecial() {
      (0, fs_1.writeFileSync)(path2, JSON.stringify(exports.special, undefined, 4));
  }
  exports.saveSpecial = saveSpecial;
  if (!(0, fs_1.existsSync)(path0)) {
      saveConfig();
  }
  else {
      Object.assign(exports.config, JSON.parse((0, fs_1.readFileSync)(path0, { encoding: 'utf8' })));
  }
  if (!(0, fs_1.existsSync)(path1)) {
      saveTraffic();
  }
  else {
      Object.assign(exports.traffic, JSON.parse((0, fs_1.readFileSync)(path1, { encoding: 'utf8' })));
  }
  if (!(0, fs_1.existsSync)(path2)) {
      saveSpecial();
  }
  else {
      Object.assign(exports.special, JSON.parse((0, fs_1.readFileSync)(path2, { encoding: 'utf8' })));
  }
  