import { operate } from "../util/lift.mjs";
import { createOperatorSubscriber } from "./OperatorSubscriber.mjs";
import { EMPTY } from "../observable/empty.mjs";

//#region ../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/take.js
function take(count) {
	return count <= 0 ? function() {
		return EMPTY;
	} : operate(function(source, subscriber) {
		var seen = 0;
		source.subscribe(createOperatorSubscriber(subscriber, function(value) {
			if (++seen <= count) {
				subscriber.next(value);
				if (count <= seen) subscriber.complete();
			}
		}));
	});
}

//#endregion
export { take };
//# sourceMappingURL=take.mjs.map