'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-1ee80297.js');
const cookie = require('./cookie-c4d9848a.js');
const services = require('./services-895a8d1d.js');
const damgaApi = require('./damga-api-9dc79d1b.js');
require('./kimlikApi-1cd43caf.js');
require('./data-transfer-field-0ce05c1a.js');
require('./BaseField-d019ade6.js');
require('./filter-d5040f65.js');
require('./_commonjsHelpers-206db00d.js');

const devingenProductDamgaDomainTableListDnsRecordCss = ".sc-devingen-product-damga-domain-table-list-dns-record-h{display:block;padding:6px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}";

const damgaProxyIPs = {
  '18.192.241.137': 'eu-central-2.damga.devingen.io',
  '52.29.141.76': 'eu-central-1a.damga.devingen.io',
};
let DevingenProductDamgaDomainTableListDnsRecord = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
  }
  async componentWillLoad() {
    const jwt = new cookie.CookieStorage().getAll().jwt;
    const headers = {
      Authorization: jwt ? `Bearer ${new cookie.CookieStorage().getAll().jwt}` : undefined,
    };
    const dnsRecord = await new damgaApi.DamgaApi(`${services.prod.damga}/${services.prod.base}`, headers)
      .getDnsRecord(this.item.domain).catch(e => {
      console.log('Getting dns record failed', e);
    });
    if (!dnsRecord)
      return;
    this.dnsRecord = dnsRecord;
  }
  render() {
    var _a, _b;
    return (index.h(index.Host, null, damgaProxyIPs[(_a = this.dnsRecord) === null || _a === void 0 ? void 0 : _a.record] || ((_b = this.dnsRecord) === null || _b === void 0 ? void 0 : _b.record) || '-'));
  }
};
DevingenProductDamgaDomainTableListDnsRecord.style = devingenProductDamgaDomainTableListDnsRecordCss;

exports.devingen_product_damga_domain_table_list_dns_record = DevingenProductDamgaDomainTableListDnsRecord;
