"use strict";Object.defineProperty(exports, "__esModule", {value: true});







var _chunkGGTRZT4Pjs = require('./chunk-GGTRZT4P.js');





var _chunkWVUZCVAQjs = require('./chunk-WVUZCVAQ.js');







var _chunk5BEB3DGNjs = require('./chunk-5BEB3DGN.js');













var _chunkDTMO2WBHjs = require('./chunk-DTMO2WBH.js');























var _chunk4UJTL2NYjs = require('./chunk-4UJTL2NY.js');





var _chunkAL2I6MSRjs = require('./chunk-AL2I6MSR.js');



var _chunkKT2LSWBGjs = require('./chunk-KT2LSWBG.js');



var _chunkVCW7SZ6Jjs = require('./chunk-VCW7SZ6J.js');


var _chunkY5WQY5GSjs = require('./chunk-Y5WQY5GS.js');



var _chunkDLEEPDK7js = require('./chunk-DLEEPDK7.js');









var _chunkS2Z5L3RBjs = require('./chunk-S2Z5L3RB.js');


var _chunkS3T27X3Ujs = require('./chunk-S3T27X3U.js');








var _chunkR2MJP25Ojs = require('./chunk-R2MJP25O.js');






var _chunk7K74W2G3js = require('./chunk-7K74W2G3.js');






var _chunkQ2LZCTWPjs = require('./chunk-Q2LZCTWP.js');



var _chunkEBISTSVAjs = require('./chunk-EBISTSVA.js');












var _chunkOTKMOSH2js = require('./chunk-OTKMOSH2.js');






var _chunkSQA7G4TEjs = require('./chunk-SQA7G4TE.js');


var _chunk6C3VEZWHjs = require('./chunk-6C3VEZWH.js');

// src/ReaderTaskEither.ts
var ReaderTaskEither_exports = {};
_chunk6C3VEZWHjs.__export.call(void 0, ReaderTaskEither_exports, {
  Alt: () => Alt,
  ApT: () => ApT,
  ApplicativePar: () => ApplicativePar2,
  ApplicativeSeq: () => ApplicativeSeq,
  ApplyPar: () => ApplyPar2,
  ApplySeq: () => ApplySeq2,
  Bifunctor: () => Bifunctor,
  Chain: () => Chain2,
  ChainRec: () => ChainRec,
  Do: () => Do,
  FromEither: () => FromEither,
  FromIO: () => FromIO,
  FromReader: () => FromReader,
  FromTask: () => FromTask,
  Functor: () => Functor3,
  Monad: () => Monad2,
  MonadIO: () => MonadIO,
  MonadTask: () => MonadTask,
  MonadThrow: () => MonadThrow,
  Pointed: () => Pointed2,
  URI: () => URI,
  alt: () => alt2,
  altW: () => altW,
  ap: () => ap3,
  apFirst: () => apFirst2,
  apFirstW: () => apFirstW,
  apS: () => apS2,
  apSW: () => apSW,
  apSecond: () => apSecond2,
  apSecondW: () => apSecondW,
  apW: () => apW,
  as: () => as2,
  asUnit: () => asUnit2,
  ask: () => ask2,
  asks: () => asks2,
  asksReaderTaskEither: () => asksReaderTaskEither,
  asksReaderTaskEitherW: () => asksReaderTaskEitherW,
  bimap: () => bimap,
  bind: () => bind2,
  bindTo: () => bindTo2,
  bindW: () => bindW,
  bracket: () => bracket,
  bracketW: () => bracketW2,
  chain: () => chain,
  chainEitherK: () => chainEitherK,
  chainEitherKW: () => chainEitherKW,
  chainFirst: () => chainFirst,
  chainFirstEitherK: () => chainFirstEitherK,
  chainFirstEitherKW: () => chainFirstEitherKW,
  chainFirstIOK: () => chainFirstIOK,
  chainFirstReaderEitherK: () => chainFirstReaderEitherK,
  chainFirstReaderEitherKW: () => chainFirstReaderEitherKW,
  chainFirstReaderIOK: () => chainFirstReaderIOK,
  chainFirstReaderIOKW: () => chainFirstReaderIOKW,
  chainFirstReaderK: () => chainFirstReaderK,
  chainFirstReaderKW: () => chainFirstReaderKW,
  chainFirstReaderTaskK: () => chainFirstReaderTaskK,
  chainFirstReaderTaskKW: () => chainFirstReaderTaskKW,
  chainFirstTaskEitherK: () => chainFirstTaskEitherK,
  chainFirstTaskEitherKW: () => chainFirstTaskEitherKW,
  chainFirstTaskK: () => chainFirstTaskK,
  chainFirstW: () => chainFirstW,
  chainIOEitherK: () => chainIOEitherK,
  chainIOEitherKW: () => chainIOEitherKW,
  chainIOK: () => chainIOK,
  chainNullableK: () => chainNullableK2,
  chainOptionK: () => chainOptionK2,
  chainOptionKW: () => chainOptionKW,
  chainReaderEitherK: () => chainReaderEitherK,
  chainReaderEitherKW: () => chainReaderEitherKW,
  chainReaderIOK: () => chainReaderIOK,
  chainReaderIOKW: () => chainReaderIOKW,
  chainReaderK: () => chainReaderK,
  chainReaderKW: () => chainReaderKW,
  chainReaderTaskK: () => chainReaderTaskK,
  chainReaderTaskKW: () => chainReaderTaskKW,
  chainRec: () => chainRec,
  chainTaskEitherK: () => chainTaskEitherK,
  chainTaskEitherKW: () => chainTaskEitherKW,
  chainTaskK: () => chainTaskK,
  chainW: () => chainW,
  do: () => do_2,
  filterOrElse: () => filterOrElse2,
  filterOrElseW: () => filterOrElseW,
  flap: () => flap2,
  flatMap: () => flatMap2,
  flatMapEither: () => flatMapEither2,
  flatMapIO: () => flatMapIO2,
  flatMapIOEither: () => flatMapIOEither,
  flatMapNullable: () => flatMapNullable2,
  flatMapOption: () => flatMapOption2,
  flatMapReader: () => flatMapReader2,
  flatMapReaderEither: () => flatMapReaderEither,
  flatMapReaderIO: () => flatMapReaderIO,
  flatMapReaderTask: () => flatMapReaderTask,
  flatMapTask: () => flatMapTask2,
  flatMapTaskEither: () => flatMapTaskEither,
  flatten: () => flatten,
  flattenW: () => flattenW,
  fold: () => fold,
  foldW: () => foldW,
  fromEither: () => fromEither2,
  fromEitherK: () => fromEitherK2,
  fromIO: () => fromIO,
  fromIOEither: () => fromIOEither2,
  fromIOEitherK: () => fromIOEitherK,
  fromIOK: () => fromIOK2,
  fromNullable: () => fromNullable2,
  fromNullableK: () => fromNullableK2,
  fromOption: () => fromOption2,
  fromOptionK: () => fromOptionK2,
  fromPredicate: () => fromPredicate2,
  fromReader: () => fromReader,
  fromReaderEither: () => fromReaderEither,
  fromReaderEitherK: () => fromReaderEitherK,
  fromReaderIOK: () => fromReaderIOK,
  fromReaderK: () => fromReaderK2,
  fromReaderTaskK: () => fromReaderTaskK,
  fromTask: () => fromTask,
  fromTaskEither: () => fromTaskEither,
  fromTaskEitherK: () => fromTaskEitherK,
  fromTaskK: () => fromTaskK2,
  getAltReaderTaskValidation: () => getAltReaderTaskValidation,
  getApplicativeReaderTaskValidation: () => getApplicativeReaderTaskValidation,
  getApplyMonoid: () => getApplyMonoid,
  getApplySemigroup: () => getApplySemigroup2,
  getCompactable: () => getCompactable2,
  getFilterable: () => getFilterable2,
  getOrElse: () => getOrElse2,
  getOrElseW: () => getOrElseW,
  getReaderTaskValidation: () => getReaderTaskValidation,
  getSemigroup: () => getSemigroup2,
  left: () => left3,
  leftIO: () => leftIO2,
  leftReader: () => leftReader,
  leftReaderIO: () => leftReaderIO,
  leftReaderTask: () => leftReaderTask,
  leftTask: () => leftTask2,
  let: () => let_2,
  liftNullable: () => liftNullable2,
  liftOption: () => liftOption2,
  local: () => local2,
  map: () => map3,
  mapBoth: () => mapBoth2,
  mapError: () => mapError2,
  mapLeft: () => mapLeft,
  match: () => match2,
  matchE: () => matchE2,
  matchEW: () => matchEW,
  matchW: () => matchW,
  of: () => of3,
  orElse: () => orElse2,
  orElseFirst: () => orElseFirst,
  orElseFirstW: () => orElseFirstW,
  orElseW: () => orElseW,
  orLeft: () => orLeft2,
  readerTaskEither: () => readerTaskEither,
  readerTaskEitherSeq: () => readerTaskEitherSeq,
  right: () => right4,
  rightIO: () => rightIO2,
  rightReader: () => rightReader,
  rightReaderIO: () => rightReaderIO,
  rightReaderTask: () => rightReaderTask,
  rightTask: () => rightTask2,
  run: () => run,
  sequenceArray: () => sequenceArray,
  sequenceSeqArray: () => sequenceSeqArray,
  swap: () => swap2,
  tap: () => tap2,
  tapEither: () => tapEither2,
  tapError: () => tapError2,
  tapIO: () => tapIO2,
  tapReader: () => tapReader2,
  tapReaderEither: () => tapReaderEither,
  tapReaderIO: () => tapReaderIO,
  tapReaderTask: () => tapReaderTask,
  tapTask: () => tapTask2,
  tapTaskEither: () => tapTaskEither,
  throwError: () => throwError,
  toUnion: () => toUnion2,
  traverseArray: () => traverseArray,
  traverseArrayWithIndex: () => traverseArrayWithIndex,
  traverseReadonlyArrayWithIndex: () => traverseReadonlyArrayWithIndex,
  traverseReadonlyArrayWithIndexSeq: () => traverseReadonlyArrayWithIndexSeq,
  traverseReadonlyNonEmptyArrayWithIndex: () => traverseReadonlyNonEmptyArrayWithIndex3,
  traverseReadonlyNonEmptyArrayWithIndexSeq: () => traverseReadonlyNonEmptyArrayWithIndexSeq2,
  traverseSeqArray: () => traverseSeqArray,
  traverseSeqArrayWithIndex: () => traverseSeqArrayWithIndex
});
var fromTaskEither = _chunk5BEB3DGNjs.of;
var left3 = /* @__PURE__ */ _chunk4UJTL2NYjs.left.call(void 0, _chunkGGTRZT4Pjs.Pointed);
var right4 = /* @__PURE__ */ _chunk4UJTL2NYjs.right.call(void 0, _chunkGGTRZT4Pjs.Pointed);
var rightTask2 = /* @__PURE__ */ _chunkSQA7G4TEjs.flow.call(void 0, 
  _chunkDTMO2WBHjs.rightTask,
  fromTaskEither
);
var leftTask2 = /* @__PURE__ */ _chunkSQA7G4TEjs.flow.call(void 0, 
  _chunkDTMO2WBHjs.leftTask,
  fromTaskEither
);
var rightReader = (ma) => _chunkSQA7G4TEjs.flow.call(void 0, ma, _chunkDTMO2WBHjs.right);
var leftReader = (me) => _chunkSQA7G4TEjs.flow.call(void 0, me, _chunkDTMO2WBHjs.left);
var rightReaderTask = /* @__PURE__ */ _chunk4UJTL2NYjs.rightF.call(void 0, _chunkGGTRZT4Pjs.Functor);
var leftReaderTask = /* @__PURE__ */ _chunk4UJTL2NYjs.leftF.call(void 0, _chunkGGTRZT4Pjs.Functor);
var rightIO2 = /* @__PURE__ */ _chunkSQA7G4TEjs.flow.call(void 0, 
  _chunkDTMO2WBHjs.rightIO,
  fromTaskEither
);
var leftIO2 = /* @__PURE__ */ _chunkSQA7G4TEjs.flow.call(void 0, 
  _chunkDTMO2WBHjs.leftIO,
  fromTaskEither
);
var rightReaderIO = (ma) => _chunkSQA7G4TEjs.flow.call(void 0, ma, _chunkDTMO2WBHjs.rightIO);
var leftReaderIO = (me) => _chunkSQA7G4TEjs.flow.call(void 0, me, _chunkDTMO2WBHjs.leftIO);
var fromEither2 = _chunkGGTRZT4Pjs.of;
var fromReader = rightReader;
var fromIO = rightIO2;
var fromTask = rightTask2;
var fromIOEither2 = /* @__PURE__ */ _chunkSQA7G4TEjs.flow.call(void 0, 
  _chunkDTMO2WBHjs.fromIOEither,
  fromTaskEither
);
var fromReaderEither = (ma) => _chunkSQA7G4TEjs.flow.call(void 0, ma, _chunkDTMO2WBHjs.fromEither);
var match2 = /* @__PURE__ */ _chunk4UJTL2NYjs.match.call(void 0, _chunkGGTRZT4Pjs.Functor);
var matchW = match2;
var matchE2 = /* @__PURE__ */ _chunk4UJTL2NYjs.matchE.call(void 0, _chunkGGTRZT4Pjs.Chain);
var fold = matchE2;
var matchEW = matchE2;
var foldW = matchEW;
var getOrElse2 = /* @__PURE__ */ _chunk4UJTL2NYjs.getOrElse.call(void 0, _chunkGGTRZT4Pjs.Monad);
var getOrElseW = getOrElse2;
var toUnion2 = /* @__PURE__ */ _chunk4UJTL2NYjs.toUnion.call(void 0, 
  _chunkGGTRZT4Pjs.Functor
);
var fromNullable2 = /* @__PURE__ */ _chunk4UJTL2NYjs.fromNullable.call(void 0, _chunkGGTRZT4Pjs.Pointed);
var fromNullableK2 = /* @__PURE__ */ _chunk4UJTL2NYjs.fromNullableK.call(void 0, _chunkGGTRZT4Pjs.Pointed);
var chainNullableK2 = /* @__PURE__ */ _chunk4UJTL2NYjs.chainNullableK.call(void 0, 
  _chunkGGTRZT4Pjs.Monad
);
var local2 = _chunk5BEB3DGNjs.local;
var asksReaderTaskEitherW = _chunk5BEB3DGNjs.asksReaderW;
var asksReaderTaskEither = asksReaderTaskEitherW;
var orElse2 = /* @__PURE__ */ _chunk4UJTL2NYjs.orElse.call(void 0, _chunkGGTRZT4Pjs.Monad);
var orElseW = orElse2;
var tapError2 = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 2, _chunk4UJTL2NYjs.tapError.call(void 0, _chunkGGTRZT4Pjs.Monad));
var orLeft2 = /* @__PURE__ */ _chunk4UJTL2NYjs.orLeft.call(void 0, _chunkGGTRZT4Pjs.Monad);
var swap2 = /* @__PURE__ */ _chunk4UJTL2NYjs.swap.call(void 0, 
  _chunkGGTRZT4Pjs.Functor
);
var fromIOEitherK = (f) => _chunkSQA7G4TEjs.flow.call(void 0, f, fromIOEither2);
var fromTaskEitherK = (f) => _chunkSQA7G4TEjs.flow.call(void 0, f, fromTaskEither);
var fromReaderEitherK = (f) => _chunkSQA7G4TEjs.flow.call(void 0, f, fromReaderEither);
var _map = (fa, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, map3(f));
var _apPar = (fab, fa) => _chunkSQA7G4TEjs.pipe.call(void 0, fab, ap3(fa));
var _apSeq = (fab, fa) => flatMap2(fab, (f) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, map3(f)));
var _alt = (fa, that) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, alt2(that));
var map3 = /* @__PURE__ */ _chunk4UJTL2NYjs.map.call(void 0, _chunkGGTRZT4Pjs.Functor);
var mapBoth2 = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 3, _chunk4UJTL2NYjs.mapBoth.call(void 0, _chunkGGTRZT4Pjs.Functor));
var bimap = mapBoth2;
var mapError2 = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 2, _chunk4UJTL2NYjs.mapError.call(void 0, _chunkGGTRZT4Pjs.Functor));
var mapLeft = mapError2;
var ap3 = /* @__PURE__ */ _chunk4UJTL2NYjs.ap.call(void 0, _chunkGGTRZT4Pjs.ApplyPar);
var apW = ap3;
var of3 = right4;
var flatMap2 = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 2, _chunk4UJTL2NYjs.flatMap.call(void 0, _chunkGGTRZT4Pjs.Monad));
var flattenW = /* @__PURE__ */ flatMap2(_chunkSQA7G4TEjs.identity);
var flatten = flattenW;
var alt2 = /* @__PURE__ */ _chunk4UJTL2NYjs.alt.call(void 0, _chunkGGTRZT4Pjs.Monad);
var altW = alt2;
var throwError = left3;
var URI = "ReaderTaskEither";
var getCompactable2 = (M) => {
  const C = _chunkS2Z5L3RBjs.getCompactable.call(void 0, M);
  return {
    URI,
    _E: void 0,
    compact: _chunkKT2LSWBGjs.compact.call(void 0, _chunkGGTRZT4Pjs.Functor, C),
    separate: _chunkKT2LSWBGjs.separate.call(void 0, _chunkGGTRZT4Pjs.Functor, C, _chunkS2Z5L3RBjs.Functor)
  };
};
function getFilterable2(M) {
  const F = _chunkS2Z5L3RBjs.getFilterable.call(void 0, M);
  const C = getCompactable2(M);
  const filter2 = _chunkAL2I6MSRjs.filter.call(void 0, _chunkGGTRZT4Pjs.Functor, F);
  const filterMap2 = _chunkAL2I6MSRjs.filterMap.call(void 0, _chunkGGTRZT4Pjs.Functor, F);
  const partition2 = _chunkAL2I6MSRjs.partition.call(void 0, _chunkGGTRZT4Pjs.Functor, F);
  const partitionMap2 = _chunkAL2I6MSRjs.partitionMap.call(void 0, _chunkGGTRZT4Pjs.Functor, F);
  return {
    URI,
    _E: void 0,
    map: _map,
    compact: C.compact,
    separate: C.separate,
    filter: (fa, predicate) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, filter2(predicate)),
    filterMap: (fa, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, filterMap2(f)),
    partition: (fa, predicate) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, partition2(predicate)),
    partitionMap: (fa, f) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, partitionMap2(f))
  };
}
function getApplicativeReaderTaskValidation(A, S) {
  const ap4 = _chunkQ2LZCTWPjs.ap.call(void 0, _chunk5BEB3DGNjs.Apply, _chunkDTMO2WBHjs.getApplicativeTaskValidation.call(void 0, A, S));
  return {
    URI,
    _E: void 0,
    map: _map,
    ap: (fab, fa) => _chunkSQA7G4TEjs.pipe.call(void 0, fab, ap4(fa)),
    of: of3
  };
}
function getAltReaderTaskValidation(S) {
  const alt3 = _chunk4UJTL2NYjs.altValidation.call(void 0, _chunkGGTRZT4Pjs.Monad, S);
  return {
    URI,
    _E: void 0,
    map: _map,
    alt: (fa, that) => _chunkSQA7G4TEjs.pipe.call(void 0, fa, alt3(that))
  };
}
var Functor3 = {
  URI,
  map: _map
};
var as2 = _chunkSQA7G4TEjs.dual.call(void 0, 2, _chunk7K74W2G3js.as.call(void 0, Functor3));
var asUnit2 = _chunk7K74W2G3js.asUnit.call(void 0, Functor3);
var flap2 = /* @__PURE__ */ _chunk7K74W2G3js.flap.call(void 0, Functor3);
var Pointed2 = {
  URI,
  of: of3
};
var ApplyPar2 = {
  URI,
  map: _map,
  ap: _apPar
};
var apFirst2 = /* @__PURE__ */ _chunkQ2LZCTWPjs.apFirst.call(void 0, ApplyPar2);
var apFirstW = apFirst2;
var apSecond2 = /* @__PURE__ */ _chunkQ2LZCTWPjs.apSecond.call(void 0, ApplyPar2);
var apSecondW = apSecond2;
var ApplicativePar2 = {
  URI,
  map: _map,
  ap: _apPar,
  of: of3
};
var ApplySeq2 = {
  URI,
  map: _map,
  ap: _apSeq
};
var ApplicativeSeq = {
  URI,
  map: _map,
  ap: _apSeq,
  of: of3
};
var Chain2 = {
  URI,
  map: _map,
  ap: _apPar,
  chain: flatMap2
};
var chainRec = (a, f) => (r) => async () => {
  let current = await f(a)(r)();
  while (true) {
    if (_chunkS2Z5L3RBjs.isRight.call(void 0, current) && _chunkS2Z5L3RBjs.isLeft.call(void 0, current.right)) {
      current = await f(current.right.left)(r)();
      continue;
    }
    if (_chunkS2Z5L3RBjs.isLeft.call(void 0, current)) {
      return current;
    }
    if (_chunkS2Z5L3RBjs.isRight.call(void 0, current.right)) {
      return _chunkS2Z5L3RBjs.right.call(void 0, current.right.right);
    }
  }
};
var ChainRec = {
  ...Chain2,
  chainRec
};
var Monad2 = {
  URI,
  map: _map,
  ap: _apPar,
  chain: flatMap2,
  of: of3
};
var MonadIO = {
  URI,
  map: _map,
  ap: _apPar,
  chain: flatMap2,
  of: of3,
  fromIO
};
var MonadTask = {
  URI,
  map: _map,
  ap: _apPar,
  chain: flatMap2,
  of: of3,
  fromIO,
  fromTask
};
var MonadThrow = {
  URI,
  map: _map,
  ap: _apPar,
  chain: flatMap2,
  of: of3,
  throwError
};
var FromEither = {
  URI,
  fromEither: fromEither2
};
var FromIO = {
  URI,
  fromIO
};
var FromTask = {
  URI,
  fromIO,
  fromTask
};
var FromReader = {
  URI,
  fromReader
};
var tap2 = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 2, _chunkEBISTSVAjs.tap.call(void 0, Chain2));
var tapEither2 = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 2, _chunkR2MJP25Ojs.tapEither.call(void 0, FromEither, Chain2));
var tapIO2 = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 2, _chunkDLEEPDK7js.tapIO.call(void 0, FromIO, Chain2));
var tapTask2 = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 2, _chunkVCW7SZ6Jjs.tapTask.call(void 0, FromTask, Chain2));
var tapReader2 = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 2, _chunkWVUZCVAQjs.tapReader.call(void 0, FromReader, Chain2));
var tapReaderEither = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 
  2,
  (self, f) => tap2(self, fromReaderEitherK(f))
);
var tapTaskEither = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 
  2,
  (self, f) => tap2(self, fromTaskEitherK(f))
);
var tapReaderTask = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 
  2,
  (self, f) => tap2(self, fromReaderTaskK(f))
);
var tapReaderIO = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 
  2,
  (self, f) => tap2(self, fromReaderIOK(f))
);
var Bifunctor = {
  URI,
  bimap: mapBoth2,
  mapLeft: mapError2
};
var Alt = {
  URI,
  map: _map,
  alt: _alt
};
var ask2 = /* @__PURE__ */ _chunkWVUZCVAQjs.ask.call(void 0, FromReader);
var asks2 = /* @__PURE__ */ _chunkWVUZCVAQjs.asks.call(void 0, FromReader);
var fromReaderK2 = /* @__PURE__ */ _chunkWVUZCVAQjs.fromReaderK.call(void 0, FromReader);
var chainFirstReaderK = tapReader2;
var chainFirstReaderKW = tapReader2;
var chainFirstReaderEitherKW = tapReaderEither;
var chainFirstReaderEitherK = tapReaderEither;
var chainFirstTaskEitherKW = tapTaskEither;
var chainFirstTaskEitherK = tapTaskEither;
var fromReaderTaskK = (f) => (...a) => rightReaderTask(f(...a));
var chainFirstReaderTaskKW = tapReaderTask;
var chainFirstReaderTaskK = tapReaderTask;
var fromReaderIOK = (f) => (...a) => rightReaderIO(f(...a));
var chainFirstReaderIOKW = tapReaderIO;
var chainFirstReaderIOK = tapReaderIO;
var fromOption2 = /* @__PURE__ */ _chunkR2MJP25Ojs.fromOption.call(void 0, FromEither);
var fromOptionK2 = /* @__PURE__ */ _chunkR2MJP25Ojs.fromOptionK.call(void 0, FromEither);
var chainOptionK2 = /* @__PURE__ */ _chunkR2MJP25Ojs.chainOptionK.call(void 0, FromEither, Chain2);
var chainOptionKW = chainOptionK2;
var _FromEither = {
  fromEither: FromEither.fromEither
};
var liftNullable2 = /* @__PURE__ */ _chunkOTKMOSH2js.liftNullable.call(void 0, _FromEither);
var liftOption2 = /* @__PURE__ */ _chunkOTKMOSH2js.liftOption.call(void 0, _FromEither);
var _FlatMap = {
  flatMap: flatMap2
};
var _FromIO = {
  fromIO
};
var _FromTask = {
  fromTask
};
var _FromReader = {
  fromReader
};
var flatMapNullable2 = /* @__PURE__ */ _chunkOTKMOSH2js.flatMapNullable.call(void 0, _FromEither, _FlatMap);
var flatMapOption2 = /* @__PURE__ */ _chunkOTKMOSH2js.flatMapOption.call(void 0, _FromEither, _FlatMap);
var flatMapEither2 = /* @__PURE__ */ _chunkOTKMOSH2js.flatMapEither.call(void 0, _FromEither, _FlatMap);
var flatMapTaskEither = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 
  2,
  (self, f) => flatMap2(self, fromTaskEitherK(f))
);
var flatMapReaderTask = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 
  2,
  (self, f) => flatMap2(self, fromReaderTaskK(f))
);
var flatMapIO2 = /* @__PURE__ */ _chunkOTKMOSH2js.flatMapIO.call(void 0, _FromIO, _FlatMap);
var flatMapTask2 = /* @__PURE__ */ _chunkOTKMOSH2js.flatMapTask.call(void 0, _FromTask, _FlatMap);
var flatMapReader2 = /* @__PURE__ */ _chunkOTKMOSH2js.flatMapReader.call(void 0, _FromReader, _FlatMap);
var flatMapReaderIO = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 
  2,
  (self, f) => flatMap2(self, fromReaderIOK(f))
);
var flatMapIOEither = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 
  2,
  (self, f) => flatMap2(self, fromIOEitherK(f))
);
var flatMapReaderEither = /* @__PURE__ */ _chunkSQA7G4TEjs.dual.call(void 0, 
  2,
  (self, f) => flatMap2(self, fromReaderEitherK(f))
);
var chainEitherK = flatMapEither2;
var chainEitherKW = flatMapEither2;
var chainFirstEitherK = tapEither2;
var chainFirstEitherKW = tapEither2;
var chainTaskEitherKW = flatMapTaskEither;
var chainTaskEitherK = flatMapTaskEither;
var chainReaderTaskKW = flatMapReaderTask;
var chainReaderTaskK = flatMapReaderTask;
var fromPredicate2 = /* @__PURE__ */ _chunkR2MJP25Ojs.fromPredicate.call(void 0, FromEither);
var filterOrElse2 = /* @__PURE__ */ _chunkR2MJP25Ojs.filterOrElse.call(void 0, FromEither, Chain2);
var filterOrElseW = filterOrElse2;
var fromEitherK2 = /* @__PURE__ */ _chunkR2MJP25Ojs.fromEitherK.call(void 0, FromEither);
var fromIOK2 = /* @__PURE__ */ _chunkDLEEPDK7js.fromIOK.call(void 0, FromIO);
var chainIOK = flatMapIO2;
var chainFirstIOK = tapIO2;
var fromTaskK2 = /* @__PURE__ */ _chunkVCW7SZ6Jjs.fromTaskK.call(void 0, FromTask);
var chainTaskK = flatMapTask2;
var chainFirstTaskK = tapTask2;
var chainReaderK = flatMapReader2;
var chainReaderKW = flatMapReader2;
var chainReaderIOKW = flatMapReaderIO;
var chainReaderIOK = flatMapReaderIO;
var chainIOEitherKW = flatMapIOEither;
var chainIOEitherK = flatMapIOEither;
var chainReaderEitherKW = flatMapReaderEither;
var chainReaderEitherK = flatMapReaderEither;
function bracket(acquire, use, release) {
  return bracketW2(acquire, use, release);
}
function bracketW2(acquire, use, release) {
  return (r) => _chunkDTMO2WBHjs.bracketW.call(void 0, 
    acquire(r),
    (a) => use(a)(r),
    (a, e) => release(a, e)(r)
  );
}
var Do = /* @__PURE__ */ of3(_chunkOTKMOSH2js.emptyRecord);
var bindTo2 = /* @__PURE__ */ _chunk7K74W2G3js.bindTo.call(void 0, Functor3);
var let_2 = /* @__PURE__ */ _chunk7K74W2G3js.let_.call(void 0, Functor3);
var bind2 = /* @__PURE__ */ _chunkEBISTSVAjs.bind.call(void 0, Chain2);
var bindW = bind2;
var apS2 = /* @__PURE__ */ _chunkQ2LZCTWPjs.apS.call(void 0, ApplyPar2);
var apSW = apS2;
var ApT = /* @__PURE__ */ of3(_chunkOTKMOSH2js.emptyReadonlyArray);
var do_2 = _chunkS2Z5L3RBjs.do_3.call(void 0, Pointed2, ChainRec);
var traverseReadonlyNonEmptyArrayWithIndex3 = (f) => _chunkSQA7G4TEjs.flow.call(void 0, _chunk5BEB3DGNjs.traverseReadonlyNonEmptyArrayWithIndex.call(void 0, f), _chunk5BEB3DGNjs.map.call(void 0, _chunkDTMO2WBHjs.traverseReadonlyNonEmptyArrayWithIndex.call(void 0, _chunkSQA7G4TEjs.SK)));
var traverseReadonlyArrayWithIndex = (f) => {
  const g = traverseReadonlyNonEmptyArrayWithIndex3(f);
  return (as3) => _chunkOTKMOSH2js.isNonEmpty.call(void 0, as3) ? g(as3) : ApT;
};
var traverseReadonlyNonEmptyArrayWithIndexSeq2 = (f) => _chunkSQA7G4TEjs.flow.call(void 0, _chunk5BEB3DGNjs.traverseReadonlyNonEmptyArrayWithIndex.call(void 0, f), _chunk5BEB3DGNjs.map.call(void 0, _chunkDTMO2WBHjs.traverseReadonlyNonEmptyArrayWithIndexSeq.call(void 0, _chunkSQA7G4TEjs.SK)));
var traverseReadonlyArrayWithIndexSeq = (f) => {
  const g = traverseReadonlyNonEmptyArrayWithIndexSeq2(f);
  return (as3) => _chunkOTKMOSH2js.isNonEmpty.call(void 0, as3) ? g(as3) : ApT;
};
var traverseArrayWithIndex = traverseReadonlyArrayWithIndex;
var traverseArray = (f) => traverseReadonlyArrayWithIndex((_, a) => f(a));
var sequenceArray = /* @__PURE__ */ traverseArray(_chunkSQA7G4TEjs.identity);
var traverseSeqArrayWithIndex = traverseReadonlyArrayWithIndexSeq;
var traverseSeqArray = (f) => traverseReadonlyArrayWithIndexSeq((_, a) => f(a));
var sequenceSeqArray = /* @__PURE__ */ traverseSeqArray(_chunkSQA7G4TEjs.identity);
var chain = flatMap2;
var chainW = flatMap2;
var chainFirst = tap2;
var chainFirstW = tap2;
var orElseFirst = tapError2;
var orElseFirstW = tapError2;
var readerTaskEither = {
  URI,
  map: _map,
  of: of3,
  ap: _apPar,
  chain: flatMap2,
  alt: _alt,
  bimap: mapBoth2,
  mapLeft: mapError2,
  fromIO,
  fromTask,
  throwError
};
var readerTaskEitherSeq = {
  URI,
  map: _map,
  of: of3,
  ap: _apSeq,
  chain: flatMap2,
  alt: _alt,
  bimap: mapBoth2,
  mapLeft: mapError2,
  fromIO,
  fromTask,
  throwError
};
var getApplySemigroup2 = /* @__PURE__ */ _chunkQ2LZCTWPjs.getApplySemigroup.call(void 0, ApplySeq2);
var getApplyMonoid = /* @__PURE__ */ _chunkS3T27X3Ujs.getApplicativeMonoid.call(void 0, ApplicativeSeq);
var getSemigroup2 = (S) => _chunkQ2LZCTWPjs.getApplySemigroup.call(void 0, (0, _chunkGGTRZT4Pjs.ApplySeq))(_chunkS2Z5L3RBjs.getSemigroup.call(void 0, S));
function getReaderTaskValidation(SE) {
  const applicativeReaderTaskValidation = getApplicativeReaderTaskValidation(_chunkY5WQY5GSjs.ApplicativePar, SE);
  const altReaderTaskValidation = getAltReaderTaskValidation(SE);
  return {
    URI,
    _E: void 0,
    map: _map,
    of: of3,
    chain: flatMap2,
    bimap: mapBoth2,
    mapLeft: mapError2,
    ap: applicativeReaderTaskValidation.ap,
    alt: altReaderTaskValidation.alt,
    fromIO,
    fromTask,
    throwError
  };
}
function run(ma, r) {
  return ma(r)();
}































































































































































































exports.fromTaskEither = fromTaskEither; exports.left = left3; exports.right = right4; exports.rightTask = rightTask2; exports.leftTask = leftTask2; exports.rightReader = rightReader; exports.leftReader = leftReader; exports.rightReaderTask = rightReaderTask; exports.leftReaderTask = leftReaderTask; exports.rightIO = rightIO2; exports.leftIO = leftIO2; exports.rightReaderIO = rightReaderIO; exports.leftReaderIO = leftReaderIO; exports.fromEither = fromEither2; exports.fromReader = fromReader; exports.fromIO = fromIO; exports.fromTask = fromTask; exports.fromIOEither = fromIOEither2; exports.fromReaderEither = fromReaderEither; exports.match = match2; exports.matchW = matchW; exports.matchE = matchE2; exports.fold = fold; exports.matchEW = matchEW; exports.foldW = foldW; exports.getOrElse = getOrElse2; exports.getOrElseW = getOrElseW; exports.toUnion = toUnion2; exports.fromNullable = fromNullable2; exports.fromNullableK = fromNullableK2; exports.chainNullableK = chainNullableK2; exports.local = local2; exports.asksReaderTaskEitherW = asksReaderTaskEitherW; exports.asksReaderTaskEither = asksReaderTaskEither; exports.orElse = orElse2; exports.orElseW = orElseW; exports.tapError = tapError2; exports.orLeft = orLeft2; exports.swap = swap2; exports.fromIOEitherK = fromIOEitherK; exports.fromTaskEitherK = fromTaskEitherK; exports.fromReaderEitherK = fromReaderEitherK; exports.map = map3; exports.mapBoth = mapBoth2; exports.bimap = bimap; exports.mapError = mapError2; exports.mapLeft = mapLeft; exports.ap = ap3; exports.apW = apW; exports.of = of3; exports.flatMap = flatMap2; exports.flattenW = flattenW; exports.flatten = flatten; exports.alt = alt2; exports.altW = altW; exports.throwError = throwError; exports.URI = URI; exports.getCompactable = getCompactable2; exports.getFilterable = getFilterable2; exports.getApplicativeReaderTaskValidation = getApplicativeReaderTaskValidation; exports.getAltReaderTaskValidation = getAltReaderTaskValidation; exports.Functor = Functor3; exports.as = as2; exports.asUnit = asUnit2; exports.flap = flap2; exports.Pointed = Pointed2; exports.ApplyPar = ApplyPar2; exports.apFirst = apFirst2; exports.apFirstW = apFirstW; exports.apSecond = apSecond2; exports.apSecondW = apSecondW; exports.ApplicativePar = ApplicativePar2; exports.ApplySeq = ApplySeq2; exports.ApplicativeSeq = ApplicativeSeq; exports.Chain = Chain2; exports.chainRec = chainRec; exports.ChainRec = ChainRec; exports.Monad = Monad2; exports.MonadIO = MonadIO; exports.MonadTask = MonadTask; exports.MonadThrow = MonadThrow; exports.FromEither = FromEither; exports.FromIO = FromIO; exports.FromTask = FromTask; exports.FromReader = FromReader; exports.tap = tap2; exports.tapEither = tapEither2; exports.tapIO = tapIO2; exports.tapTask = tapTask2; exports.tapReader = tapReader2; exports.tapReaderEither = tapReaderEither; exports.tapTaskEither = tapTaskEither; exports.tapReaderTask = tapReaderTask; exports.tapReaderIO = tapReaderIO; exports.Bifunctor = Bifunctor; exports.Alt = Alt; exports.ask = ask2; exports.asks = asks2; exports.fromReaderK = fromReaderK2; exports.chainFirstReaderK = chainFirstReaderK; exports.chainFirstReaderKW = chainFirstReaderKW; exports.chainFirstReaderEitherKW = chainFirstReaderEitherKW; exports.chainFirstReaderEitherK = chainFirstReaderEitherK; exports.chainFirstTaskEitherKW = chainFirstTaskEitherKW; exports.chainFirstTaskEitherK = chainFirstTaskEitherK; exports.fromReaderTaskK = fromReaderTaskK; exports.chainFirstReaderTaskKW = chainFirstReaderTaskKW; exports.chainFirstReaderTaskK = chainFirstReaderTaskK; exports.fromReaderIOK = fromReaderIOK; exports.chainFirstReaderIOKW = chainFirstReaderIOKW; exports.chainFirstReaderIOK = chainFirstReaderIOK; exports.fromOption = fromOption2; exports.fromOptionK = fromOptionK2; exports.chainOptionK = chainOptionK2; exports.chainOptionKW = chainOptionKW; exports.liftNullable = liftNullable2; exports.liftOption = liftOption2; exports.flatMapNullable = flatMapNullable2; exports.flatMapOption = flatMapOption2; exports.flatMapEither = flatMapEither2; exports.flatMapTaskEither = flatMapTaskEither; exports.flatMapReaderTask = flatMapReaderTask; exports.flatMapIO = flatMapIO2; exports.flatMapTask = flatMapTask2; exports.flatMapReader = flatMapReader2; exports.flatMapReaderIO = flatMapReaderIO; exports.flatMapIOEither = flatMapIOEither; exports.flatMapReaderEither = flatMapReaderEither; exports.chainEitherK = chainEitherK; exports.chainEitherKW = chainEitherKW; exports.chainFirstEitherK = chainFirstEitherK; exports.chainFirstEitherKW = chainFirstEitherKW; exports.chainTaskEitherKW = chainTaskEitherKW; exports.chainTaskEitherK = chainTaskEitherK; exports.chainReaderTaskKW = chainReaderTaskKW; exports.chainReaderTaskK = chainReaderTaskK; exports.fromPredicate = fromPredicate2; exports.filterOrElse = filterOrElse2; exports.filterOrElseW = filterOrElseW; exports.fromEitherK = fromEitherK2; exports.fromIOK = fromIOK2; exports.chainIOK = chainIOK; exports.chainFirstIOK = chainFirstIOK; exports.fromTaskK = fromTaskK2; exports.chainTaskK = chainTaskK; exports.chainFirstTaskK = chainFirstTaskK; exports.chainReaderK = chainReaderK; exports.chainReaderKW = chainReaderKW; exports.chainReaderIOKW = chainReaderIOKW; exports.chainReaderIOK = chainReaderIOK; exports.chainIOEitherKW = chainIOEitherKW; exports.chainIOEitherK = chainIOEitherK; exports.chainReaderEitherKW = chainReaderEitherKW; exports.chainReaderEitherK = chainReaderEitherK; exports.bracket = bracket; exports.bracketW = bracketW2; exports.Do = Do; exports.bindTo = bindTo2; exports.let_ = let_2; exports.bind = bind2; exports.bindW = bindW; exports.apS = apS2; exports.apSW = apSW; exports.ApT = ApT; exports.do_ = do_2; exports.traverseReadonlyNonEmptyArrayWithIndex = traverseReadonlyNonEmptyArrayWithIndex3; exports.traverseReadonlyArrayWithIndex = traverseReadonlyArrayWithIndex; exports.traverseReadonlyNonEmptyArrayWithIndexSeq = traverseReadonlyNonEmptyArrayWithIndexSeq2; exports.traverseReadonlyArrayWithIndexSeq = traverseReadonlyArrayWithIndexSeq; exports.traverseArrayWithIndex = traverseArrayWithIndex; exports.traverseArray = traverseArray; exports.sequenceArray = sequenceArray; exports.traverseSeqArrayWithIndex = traverseSeqArrayWithIndex; exports.traverseSeqArray = traverseSeqArray; exports.sequenceSeqArray = sequenceSeqArray; exports.chain = chain; exports.chainW = chainW; exports.chainFirst = chainFirst; exports.chainFirstW = chainFirstW; exports.orElseFirst = orElseFirst; exports.orElseFirstW = orElseFirstW; exports.readerTaskEither = readerTaskEither; exports.readerTaskEitherSeq = readerTaskEitherSeq; exports.getApplySemigroup = getApplySemigroup2; exports.getApplyMonoid = getApplyMonoid; exports.getSemigroup = getSemigroup2; exports.getReaderTaskValidation = getReaderTaskValidation; exports.run = run; exports.ReaderTaskEither_exports = ReaderTaskEither_exports;
