"use strict";
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);
var Marker_exports = {};
__export(Marker_exports, {
  default: () => Marker_default
});
module.exports = __toCommonJS(Marker_exports);
var import_jsx_runtime = require("react/jsx-runtime");
var import_react = __toESM(require("react"));
var import_react_native = require("react-native");
var import_prop_types = require("prop-types");
var import_styled_components = __toESM(require("styled-components"));
var import_yoga_common = require("@gympass/yoga-common");
var import_Tooltip = __toESM(require("./Tooltip"));
var import_Box = __toESM(require("../../Box"));
const Circle = (0, import_styled_components.default)(import_Box.default).attrs(
  ({
    theme: {
      yoga: {
        components: { slider }
      }
    }
  }) => ({
    bgColor: slider.marker.backgroundColor,
    border: 6,
    borderColor: slider.marker.border.color,
    borderRadius: slider.marker.border.radius,
    elevation: slider.marker.shadow,
    height: 24,
    width: 24,
    top: "2px",
    position: "relative",
    as: import_react_native.TouchableOpacity
  })
)``;
const CirclePressed = (0, import_styled_components.default)(Circle)(
  ({
    pressed = false,
    theme: {
      yoga: {
        components: { slider }
      }
    }
  }) => `
    ${pressed ? `
          background-color: ${(0, import_yoga_common.hexToRgb)(slider.marker.backgroundColor, 0.2)};
          border: none;
          width: 40px;
          height: 40px;
          position: absolute;
          elevation: 0;
          top: -6px;
    ` : "display: none; border: none;"}
  `
);
CirclePressed.propTypes = {
  pressed: import_prop_types.bool
};
function Marker({ pressed = false, tooltip }) {
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
    pressed && tooltip && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
      import_Tooltip.default,
      {
        description: tooltip.description,
        title: tooltip.title,
        ribbon: tooltip.ribbon
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CirclePressed, { as: import_react_native.View, pressed }),
    /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Circle, { accessible: true, accessibilityRole: "adjustable" })
  ] });
}
Marker.propTypes = {
  pressed: import_prop_types.bool,
  tooltip: (0, import_prop_types.shape)({
    description: import_prop_types.string,
    title: import_prop_types.string,
    ribbon: import_prop_types.string,
    visible: import_prop_types.bool,
    step: import_prop_types.number
  })
};
var Marker_default = Marker;
