"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.SubscriptionRefInternal = void 0;

var tsplus_module_1 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/core/stream/Stream/operations/make"));

var tsplus_module_2 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/core/stream/Stream/operations/concat"));

var tsplus_module_3 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@tsplus/stdlib/data/Tuple/make"));

var tsplus_module_4 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/core/stream/Stream/operations/fromHubScoped"));

var tsplus_module_5 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/core/io/Effect/operations/map"));

var tsplus_module_6 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/core/stream/Stream/operations/unwrapScoped"));

var tsplus_module_7 = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/core/io/Effect/operations/tap"));

var _definition = /*#__PURE__*/require("@effect/core/io/Ref/definition");

var _SynchronizedInternal = /*#__PURE__*/require("@effect/core/io/Ref/operations/_internal/SynchronizedInternal");

var _definition2 = /*#__PURE__*/require("@effect/core/stream/SubscriptionRef/definition");

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

const fileName_1 = "(@effect/core) _src/stream/SubscriptionRef/operations/_internal/SubscriptionRefInternal.ts";
const SubscriptionRefInternal = { ..._SynchronizedInternal.SynchronizedInternal,

  get [_definition.RefSym]() {
    return _definition.RefSym;
  },

  get [_definition.SynchronizedSym]() {
    return _definition.SynchronizedSym;
  },

  get [_definition2.SubscriptionRefSym]() {
    return _definition2.SubscriptionRefSym;
  },

  get changes() {
    return tsplus_module_6.unwrapScoped(() => this.ref.modifyEffect(a => tsplus_module_5.map_(tsplus_module_4.fromHubScoped(() => this.hub), stream => tsplus_module_3.make(tsplus_module_2.concat_(tsplus_module_1.make(a), () => stream, fileName_1 + ":26:33"), a), fileName_1 + ":25:92"), fileName_1 + ":24:77"), fileName_1 + ":23:31");
  },

  get(__tsplusTrace) {
    return this.ref.get(fileName_1 + ":32:24");
  },

  modifyEffect(f, __tsplusTrace) {
    return this.ref.modifyEffect(a => tsplus_module_7.tap_(f(a), tp => this.hub.publish(tp.get(1), fileName_1 + ":39:72"), fileName_1 + ":39:47"), fileName_1 + ":39:33");
  },

  set(a, __tsplusTrace) {
    return this.ref.set(a, fileName_1 + ":42:24");
  },

  setAsync(a, __tsplusTrace) {
    return this.ref.setAsync(a, fileName_1 + ":45:29");
  }

};
exports.SubscriptionRefInternal = SubscriptionRefInternal;
//# sourceMappingURL=SubscriptionRefInternal.js.map