var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/bigSale/components/FloatingActions/index.tsx
var FloatingActions_exports = {};
__export(FloatingActions_exports, {
  default: () => FloatingActions_default
});
module.exports = __toCommonJS(FloatingActions_exports);
var import_react = __toESM(require("react"));
var import_materials = require("@pisell/materials");
var import_floatingDock = __toESM(require("../../../floatingDock"));
var import_index = require("./index.less");
var BigSaleFloatingActions = ({
  context,
  variant,
  floatingPanelRef,
  timeBarRef
}) => {
  const isPhone = variant === "phone";
  const openBookingPanel = (0, import_react.useCallback)(() => {
    var _a;
    context.sales.clearCartItemsOnly().catch((error) => {
      console.error(error);
    });
    (_a = floatingPanelRef.current) == null ? void 0 : _a.open();
  }, [context.sales, floatingPanelRef]);
  const openTimeBar = (0, import_react.useCallback)(() => {
    var _a;
    (_a = timeBarRef.current) == null ? void 0 : _a.openMobileDrawer();
  }, [timeBarRef]);
  const floatButtonItems = (0, import_react.useMemo)(() => {
    const items = [
      {
        icon: /* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-person" }),
        key: "dashboard",
        onClick: openBookingPanel
      }
    ];
    if (isPhone) {
      items.push({
        icon: /* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-clock" }),
        key: "time-bar",
        onClick: openTimeBar
      });
    }
    return items;
  }, [isPhone, openBookingPanel, openTimeBar]);
  return /* @__PURE__ */ import_react.default.createElement(
    import_floatingDock.default,
    {
      className: `pisell-big-sale-float-buttons${isPhone ? "" : " pisell-big-sale-float-buttons--static"}`,
      initialBottom: isPhone ? 176 : 80,
      hiddenRatio: isPhone ? void 0 : 0,
      boundaryPadding: isPhone ? void 0 : 33
    },
    floatButtonItems.map((item) => /* @__PURE__ */ import_react.default.createElement(
      import_materials.Button,
      {
        key: item.key,
        type: "primary",
        icon: item.icon,
        shape: "circle",
        size: "large",
        onClick: item.onClick
      }
    ))
  );
};
var FloatingActions_default = BigSaleFloatingActions;
