var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/plus/pisellSalesProductCard/utils.ts
var utils_exports = {};
__export(utils_exports, {
  cubicBezier: () => cubicBezier
});
module.exports = __toCommonJS(utils_exports);
var cubicBezier = ({ position, cartElementId }) => {
  const left = position.x;
  const top = position.y;
  const collect = cartElementId.startsWith("#") ? document.querySelector(cartElementId) : document.getElementById(cartElementId) || document.querySelector(cartElementId);
  const duration = top > 400 ? ".4s" : ".6s";
  const ball = document.createElement("div");
  ball.style.position = "fixed";
  ball.style.left = left - 10 + "px";
  ball.style.top = top - 10 + "px";
  ball.style.width = "20px";
  ball.style.height = "20px";
  ball.style.borderRadius = "50%";
  ball.style.backgroundColor = "var(--theme-color)";
  ball.style.zIndex = "9999";
  ball.style.transition = `left ${duration} linear, top ${duration} cubic-bezier(0.5, -0.5, 1, 1)`;
  ball.innerHTML = "+";
  ball.style.color = "#ffffff";
  ball.style.textAlign = "center";
  ball.style.lineHeight = "20px";
  if (collect) {
    document.body.appendChild(ball);
    setTimeout(() => {
      ball.style.left = collect.offsetLeft + collect.offsetWidth / 2 + "px";
      ball.style.top = getOffsetTop(collect) + "px";
    }, 0);
    const endTimeout = setTimeout(
      () => {
        ball.remove();
      },
      top > 400 ? 400 : 600
    );
    ball.ontransitionend = function() {
      ball.remove();
      clearTimeout(endTimeout);
    };
  }
};
var getOffsetTop = (element) => {
  let offsetTop = element.offsetTop;
  if (element.offsetParent) {
    offsetTop += getOffsetTop(element.offsetParent);
  }
  return offsetTop;
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  cubicBezier
});
