import { Observable as s } from "./observable.mjs";
function m(n) {
  return (o) => new s((c) => {
    const { complete: u, error: r, next: t } = c;
    o.subscribe(async (e) => t(await n.call({}, e)), r, u);
  });
}
function p(n) {
  return (o) => new s((c) => {
    const { complete: u, error: r, next: t } = c;
    o.subscribe(async (e) => await n.call({}, e) && t(e), r, u);
  });
}
function w(n, o = 0) {
  return (c) => {
    const u = (r, t) => {
      let e;
      return (...a) => {
        clearTimeout(e), e = setTimeout(async () => {
          t(await r.call({}, ...a));
        }, o);
      };
    };
    return new s((r) => {
      const { complete: t, error: e, next: a } = r, i = u(n, a);
      c.subscribe((l) => i(l), e, t);
    });
  };
}
export {
  w as debounceOperator,
  p as filterOperator,
  m as mapOperator
};
//# sourceMappingURL=operators.mjs.map
