var _a, _b, _c, _d, _e, _f;

import * as tsplus_module_1 from "@tsplus/stdlib/structure/Hash";
import * as tsplus_module_2 from "@tsplus/stdlib/structure/Equals";
import * as tsplus_module_3 from "@effect/core/io/Metrics/definition";
import * as tsplus_module_4 from "@tsplus/stdlib/data/Duration";
import * as tsplus_module_5 from "@tsplus/stdlib/collections/Chunk/equals";
export const isCounterKey = isCounterKey_1;
export const isGaugeKey = isGaugeKey_1;
export const isFrequencyKey = isFrequencyKey_1;
export const isHistogramKey = isHistogramKey_1;
export const isSummaryKey = isSummaryKey_1;
export const MetricKeyTypeSym = /*#__PURE__*/Symbol.for("@effect/core/io/Metric/MetricKeyType");
export const _In = /*#__PURE__*/Symbol.for("@effect/core/io/Metric/MetricKeyType/In");
export const _Out = /*#__PURE__*/Symbol.for("@effect/core/io/Metric/MetricKeyType/Out");
export const CounterKeySym = /*#__PURE__*/Symbol.for("@effect/core/io/Metric/MetricKeyType/Counter");
export const FrequencyKeySym = /*#__PURE__*/Symbol.for("@effect/core/io/Metric/MetricKeyType/Frequency");
export const GaugeKeySym = /*#__PURE__*/Symbol.for("@effect/core/io/Metric/MetricKeyType/Gauge");
export const HistogramKeySym = /*#__PURE__*/Symbol.for("@effect/core/io/Metric/MetricKeyType/Histogram");
export const SummaryKeySym = /*#__PURE__*/Symbol.for("@effect/core/io/Metric/MetricKeyType/Summary");
export class BaseMetricKeyType {
  constructor() {
    this[_a] = MetricKeyTypeSym;
  }

}
_a = MetricKeyTypeSym;
export class CounterKey extends BaseMetricKeyType {
  constructor() {
    super(...arguments);
    this[_b] = CounterKeySym;
  }

  [(_b = CounterKeySym, tsplus_module_1.Hash.sym)]() {
    return tsplus_module_1.hashString("ets/Metrics/MetricKeyType/Counter");
  }

  [tsplus_module_2.Equals.sym](u) {
    return isCounterKey_1(u);
  }

}
export class GaugeKey extends BaseMetricKeyType {
  constructor() {
    super(...arguments);
    this[_c] = GaugeKeySym;
  }

  [(_c = GaugeKeySym, tsplus_module_1.Hash.sym)]() {
    return tsplus_module_1.hashString("ets/Metrics/MetricKeyType/Gauge");
  }

  [tsplus_module_2.Equals.sym](u) {
    return isGaugeKey_1(u);
  }

}
export class FrequencyKey extends BaseMetricKeyType {
  constructor() {
    super(...arguments);
    this[_d] = FrequencyKeySym;
  }

  [(_d = FrequencyKeySym, tsplus_module_1.Hash.sym)]() {
    return tsplus_module_1.hashString("ets/Metrics/MetricKeyType/Frequency");
  }

  [tsplus_module_2.Equals.sym](u) {
    return isFrequencyKey_1(u);
  }

}
export class HistogramKey extends BaseMetricKeyType {
  constructor(boundaries) {
    super();
    this.boundaries = boundaries;
    this[_e] = HistogramKeySym;
  }

  [(_e = HistogramKeySym, tsplus_module_1.Hash.sym)]() {
    return tsplus_module_1.combine(tsplus_module_1.hashString("ets/Metrics/MetricKeyType/Histogram"), tsplus_module_1.hashUnknown(this.boundaries));
  }

  [tsplus_module_2.Equals.sym](u) {
    return isHistogramKey_1(u) && tsplus_module_2.equals(this.boundaries, u.boundaries);
  }

}
export class SummaryKey extends BaseMetricKeyType {
  constructor(maxAge, maxSize, error, quantiles) {
    super();
    this.maxAge = maxAge;
    this.maxSize = maxSize;
    this.error = error;
    this.quantiles = quantiles;
    this[_f] = SummaryKeySym;
  }

  [(_f = SummaryKeySym, tsplus_module_1.Hash.sym)]() {
    return tsplus_module_1.combine(tsplus_module_1.hashString("ets/Metrics/MetricKeyType/Summary"), tsplus_module_1.combine(tsplus_module_1.hashUnknown(this.maxAge), tsplus_module_1.combine(tsplus_module_1.hashNumber(this.maxSize), tsplus_module_1.combine(tsplus_module_1.hashNumber(this.error), tsplus_module_1.hashUnknown(this.quantiles)))));
  }

  [tsplus_module_2.Equals.sym](u) {
    return isSummaryKey_1(u) && tsplus_module_4.equals_(this.maxAge, u.maxAge) && this.maxSize === u.maxSize && this.error === u.error && tsplus_module_5.equals_(this.quantiles, u.quantiles);
  }

}
export const MetricKeyType = {};
/**
 * @tsplus static ets/Metrics/MetricKeyType/Ops Counter
 */

export const counter = /*#__PURE__*/new CounterKey();
/**
 * @tsplus static ets/Metrics/MetricKeyType/Ops Frequency
 */

export const frequency = /*#__PURE__*/new FrequencyKey();
/**
 * @tsplus static ets/Metrics/MetricKeyType/Ops Gauge
 */

export const gauge = /*#__PURE__*/new GaugeKey();
/**
 * @tsplus static ets/Metrics/MetricKeyType/Ops Histogram
 */

export function histogram(boundaries) {
  return new HistogramKey(boundaries);
}
/**
 * @tsplus static ets/Metrics/MetricKeyType/Ops Summary
 */

export function summary(maxAge, maxSize, error, quantiles) {
  return new SummaryKey(maxAge, maxSize, error, quantiles);
}
/**
 * @tsplus static ets/Metrics/MetricKeyType/Ops isMetricKeyType
 */

export function isMetricKeyType(u) {
  return typeof u === "object" && u != null && MetricKeyTypeSym in u;
}
/**
 * @tsplus static ets/Metrics/MetricKeyType/Ops isCounterKey
 */

function isCounterKey_1(u) {
  return typeof u === "object" && u != null && CounterKeySym in u;
}
/**
 * @tsplus static ets/Metrics/MetricKeyType/Ops isGaugeKey
 */


function isGaugeKey_1(u) {
  return typeof u === "object" && u != null && GaugeKeySym in u;
}
/**
 * @tsplus static ets/Metrics/MetricKeyType/Ops isFrequencyKey
 */


function isFrequencyKey_1(u) {
  return typeof u === "object" && u != null && FrequencyKeySym in u;
}
/**
 * @tsplus static ets/Metrics/MetricKeyType/Ops isHistogramKey
 */


function isHistogramKey_1(u) {
  return typeof u === "object" && u != null && HistogramKeySym in u;
}
/**
 * @tsplus static ets/Metrics/MetricKeyType/Ops isSummaryKey
 */


function isSummaryKey_1(u) {
  return typeof u === "object" && u != null && SummaryKeySym in u;
}
//# sourceMappingURL=MetricKeyType.mjs.map