"use strict"
var __createBinding =
  (this && this.__createBinding) ||
  (Object.create
    ? function (o, m, k, k2) {
        if (k2 === undefined) k2 = k
        Object.defineProperty(o, k2, {
          enumerable: true,
          get: function () {
            return m[k]
          }
        })
      }
    : function (o, m, k, k2) {
        if (k2 === undefined) k2 = k
        o[k2] = m[k]
      })
var __setModuleDefault =
  (this && this.__setModuleDefault) ||
  (Object.create
    ? function (o, v) {
        Object.defineProperty(o, "default", { enumerable: true, value: v })
      }
    : function (o, v) {
        o["default"] = v
      })
var __importStar =
  (this && this.__importStar) ||
  function (mod) {
    if (mod && mod.__esModule) return mod
    var result = {}
    if (mod != null)
      for (var k in mod)
        if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
          __createBinding(result, mod, k)
    __setModuleDefault(result, mod)
    return result
  }
Object.defineProperty(exports, "__esModule", { value: true })
exports.location =
  exports.LocationAnnotation =
  exports.fibers =
  exports.FibersAnnotation =
  exports.TestAnnotation =
    void 0
const tracing_1 = __importStar(require("../../Tracing"))
const tracing_2 = __importStar(require("../../Tracing"))
const fileName_1 = "(@effect-ts/system): _src/Testing/TestAnnotation/index.ts"
const Chunk = __importStar(require("../../Collections/Immutable/Chunk"))
const List = __importStar(require("../../Collections/Immutable/List"))
const E = __importStar(require("../../Either"))
const Has_1 = require("../../Has")
const St = __importStar(require("../../Structural"))
const Int_1 = require("../Int")
/**
 * A type of annotation.
 */
class TestAnnotation {
  constructor(identifier, initial, combine, tag) {
    this.identifier = identifier
    this.initial = initial
    this.combine = combine
    this.tag = tag
  }
  get [St.hashSym]() {
    return St.combineHash(St.hash(this.identifier), St.hash(this.tag))
  }
  [St.equalsSym](that) {
    return (
      that instanceof TestAnnotation &&
      St.equals(this.identifier, that.identifier) &&
      St.equals(this.tag, that.tag)
    )
  }
}
exports.TestAnnotation = TestAnnotation
exports.FibersAnnotation = (0, Has_1.tag)()
exports.fibers = new TestAnnotation(
  "fibers",
  E.left(0),
  compose,
  exports.FibersAnnotation
)
function compose(left, right) {
  if (left._tag === "Left" && right._tag === "Left") {
    return E.left((0, Int_1.Int)(left.left + right.left))
  } else if (left._tag === "Right" && right._tag === "Right") {
    return E.right(Chunk.concat_(left.right, right.right))
  } else if (left._tag === "Right" && right._tag === "Left") {
    return E.left(right.left)
  } else {
    return E.right(right.right)
  }
}
exports.LocationAnnotation = (0, Has_1.tag)()
exports.location = new TestAnnotation(
  "location",
  List.empty(),
  List.concat_,
  exports.LocationAnnotation
)
//# sourceMappingURL=index.js.map
