text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  /**
   * Copyright(c) Microsoft Corporation.All rights reserved.
   * Licensed under the MIT License.
   */
  const schema_1 = require("../schema");
  const azureService_1 = require("./azureService");
  class AppInsightsService extends azureService_1.AzureService {
      constructor(source = {}) {
          super(source, schema_1.ServiceTypes.AppInsights);
          this.apiKeys = this.apiKeys || {};
      }
      // encrypt keys in service
      encrypt(secret, encryptString) {
          const that = this;
          if (this.instrumentationKey && this.instrumentationKey.length > 0) {
              this.instrumentationKey = encryptString(this.instrumentationKey, secret);
          }
          if (this.apiKeys) {
              Object.keys(this.apiKeys).forEach((prop) => {
                  that.apiKeys[prop] = encryptString(that.apiKeys[prop], secret);
              });
          }
      }
      // decrypt keys in service
      decrypt(secret, decryptString) {
          const that = this;
          if (this.instrumentationKey && this.instrumentationKey.length > 0) {
              this.instrumentationKey = decryptString(this.instrumentationKey, secret);
          }
          if (this.apiKeys) {
              Object.keys(this.apiKeys).forEach((prop) => {
                  that.apiKeys[prop] = decryptString(that.apiKeys[prop], secret);
              });
          }
      }
  }
  exports.AppInsightsService = AppInsightsService;
  //# sourceMappingURL=appInsightsService.js.map