'use strict';

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

const index = require('./index-1141a245.js');
const services = require('./services-9cb6ea3a.js');
const damgaApi = require('./damga-api-1dea4125.js');
const apiBase = require('./apiBase-6c66ff1b.js');
require('./data-transfer-field-e8417d5f.js');
require('./BaseField-381327a9.js');
require('./filter-d5040f65.js');

class DasDamgaApi {
  constructor(endpoint, defaultHeaders = {}, defaultQueryParams = {}) {
    // region proxy analyses
    this.getProxyAnalyses = (domains, startDate, endDate, timeInterval) => this.api.get(`analyses`, { domains: domains.join(','), startDate, endDate, timeInterval });
    // endregion
    // region logs
    this.getLogs = (domain, startDate, endDate) => this.api.get(`logs`, { domain, startDate, endDate });
    this.api = new apiBase.APIBase(endpoint, defaultHeaders);
    this.api.axios.defaults.params = defaultQueryParams;
  }
}

const DevingenProductRootDamga = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
  }
  render() {
    const { apiKimlik, product } = this;
    return (index.h(index.Host, { class: "d-flex flex-grow-1 flex-column" }, index.h("damga-home", { apiEndpoint: services.prod.damga, apiHeaders: {
        Authorization: apiKimlik.api.getDefaults().headers['Authorization'],
        'devingen-product-id': product._id,
      }, extraTabs: [
        {
          key: 'dashboard',
          label: 'Dashboard',
          render: () => index.h("damga-dashboard", { apiDamga: new damgaApi.DamgaApi(services.prod.damga, {
              Authorization: apiKimlik.api.getDefaults().headers['Authorization'],
              'devingen-product-id': product._id,
            }, { productId: product._id }), apiServicesDamga: new DasDamgaApi(services.prod.dasDamga, { Authorization: apiKimlik.api.getDefaults().headers['Authorization'] }, { productId: product._id }) })
        },
        // {
        //   key: 'logs',
        //   label: 'Logs',
        //   render: () => <damga-domain-logs
        //     apiDamga={
        //       new DamgaApi(
        //         services.damga,
        //         { Authorization: (apiKimlik as any).api.getDefaults().headers['Authorization'] },
        //         { productId: product._id },
        //       )
        //     }
        //     apiServicesDamga={
        //       new DasDamgaApi(
        //         services.dasDamga,
        //         { Authorization: (apiKimlik as any).api.getDefaults().headers['Authorization'] },
        //         { productId: product._id },
        //       )
        //     }
        //   />
        // },
      ] })));
  }
};

exports.devingen_product_root_damga = DevingenProductRootDamga;
