const t = Symbol("v-observe");
function o(e) {
  e.dataset.vObserved = "yes";
}
function r(e) {
  e.dataset.vObserved = "no";
}
function c(e, n) {
  e[t] = n;
}
function v(e) {
  e[t] = void 0;
}
const u = {
  mounted(e, { value: n }) {
    n instanceof IntersectionObserver ? (n.observe(e), o(e), c(e, n)) : (r(e), v(e));
  },
  updated(e, { value: n }) {
    const s = e[t], i = n === s, d = e.dataset.vObserved === "yes", a = n instanceof IntersectionObserver;
    if (!d) {
      a && (n.observe(e), o(e), c(e, n));
      return;
    }
    if (!a) {
      r(e), s && (s.unobserve(e), v(e));
      return;
    }
    i || (s && s.unobserve(e), n.observe(e), o(e), c(e, n));
  },
  unmounted(e) {
    const n = e[t];
    n instanceof IntersectionObserver && n.unobserve(e), r(e), v(e);
  }
};
export {
  u as default
};
//# sourceMappingURL=observe.js.map
