"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getAnchorTransform = exports.earnerLocationShadow = exports.consumerLocationShadow = exports.StyledStrokedLabelContainer = exports.StyledStrokedLabel = exports.StyledPinHead = exports.StyledOuterXXSmallAnchor = exports.StyledOuterXSmallAnchor = exports.StyledNeedle = exports.StyledLocationPuckApproximation = exports.StyledLabelSlot = exports.StyledLabel = exports.StyledInnerXXSmallAnchor = exports.StyledInnerXSmallAnchor = exports.StyledFloatingRouteMarkerRoot = exports.StyledFloatingRouteMarkerPointerContainer = exports.StyledFloatingRouteMarkerPointer = exports.StyledFloatingMarkerRoot = exports.StyledFloatingMarkerPinHeadContainer = exports.StyledFloatingMarkerAnchorContainer = exports.StyledFixedMarkerRoot = exports.StyledFixedMarkerDragContainer = exports.StyledEnhancerSlot = exports.StyledEarnerLocationPuckCore = exports.StyledDragShadowContainer = exports.StyledDragShadow = exports.StyledConsumerLocationPuckCore = exports.StyledBadgeEnhancerRoot = exports.RelativeContainer = exports.LocationPuckContainer = void 0;

var _styles = require("../styles");

var _constants = require("./constants");

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var getAnchorTransform = function getAnchorTransform(anchor, anchorSize) {
  var _FLOATING_MARKER_ANCH;

  return (_FLOATING_MARKER_ANCH = {}, _defineProperty(_FLOATING_MARKER_ANCH, _constants.FLOATING_MARKER_ANCHOR_POSITIONS.none, ""), _defineProperty(_FLOATING_MARKER_ANCH, _constants.FLOATING_MARKER_ANCHOR_POSITIONS.topLeft, "translate(".concat(anchorSize, "px, ").concat(anchorSize, "px)")), _defineProperty(_FLOATING_MARKER_ANCH, _constants.FLOATING_MARKER_ANCHOR_POSITIONS.topRight, "translate(-100%, ".concat(anchorSize, "px)")), _defineProperty(_FLOATING_MARKER_ANCH, _constants.FLOATING_MARKER_ANCHOR_POSITIONS.bottomLeft, "translate(".concat(anchorSize, "px, -100%)")), _defineProperty(_FLOATING_MARKER_ANCH, _constants.FLOATING_MARKER_ANCHOR_POSITIONS.bottomRight, "translate(-100%, -100%)"), _FLOATING_MARKER_ANCH)[anchor];
};

exports.getAnchorTransform = getAnchorTransform;
var StyledDragShadowContainer = (0, _styles.styled)('div', function (_ref) {
  var $theme = _ref.$theme,
      $height = _ref.$height,
      $width = _ref.$width,
      $dragging = _ref.$dragging;
  return {
    width: "".concat($width, "px"),
    height: "".concat($height, "px"),
    opacity: $dragging ? 1 : 0,
    visibility: $dragging ? 'visible' : 'hidden',
    transition: "".concat($theme.animation.timing300, " ").concat($theme.animation.easeOutCurve, " all"),
    position: 'relative',
    boxShadow: $theme.lighting.shadow600
  };
});
exports.StyledDragShadowContainer = StyledDragShadowContainer;
StyledDragShadowContainer.displayName = "StyledDragShadowContainer";
StyledDragShadowContainer.displayName = 'StyledDragShadowContainer';
var StyledDragShadow = (0, _styles.styled)('div', function (_ref2) {
  var $theme = _ref2.$theme,
      $background = _ref2.$background,
      $width = _ref2.$width;
  return {
    backgroundColor: $background,
    borderRadius: '50%',
    width: "".concat($width, "px"),
    height: '4px',
    position: 'absolute',
    bottom: 0
  };
});
exports.StyledDragShadow = StyledDragShadow;
StyledDragShadow.displayName = "StyledDragShadow";
StyledDragShadow.displayName = 'StyledDragShadow';
var StyledNeedle = (0, _styles.styled)('div', function (_ref3) {
  var $theme = _ref3.$theme,
      $background = _ref3.$background,
      $height = _ref3.$height;
  return {
    backgroundColor: $background,
    width: '4px',
    height: "".concat($height, "px"),
    boxShadow: $theme.lighting.shadow600
  };
});
exports.StyledNeedle = StyledNeedle;
StyledNeedle.displayName = "StyledNeedle";
StyledNeedle.displayName = 'StyledNeedle';
var StyledFloatingMarkerRoot = (0, _styles.styled)('div', function (_ref4) {
  var $size = _ref4.$size;
  return {
    position: 'relative',
    height: "".concat($size, "px"),
    width: "".concat($size, "px")
  };
});
exports.StyledFloatingMarkerRoot = StyledFloatingMarkerRoot;
StyledFloatingMarkerRoot.displayName = "StyledFloatingMarkerRoot";
StyledFloatingMarkerRoot.displayName = 'StyledFloatingMarkerRoot';
var StyledFloatingMarkerPinHeadContainer = (0, _styles.styled)('div', function (_ref5) {
  var $theme = _ref5.$theme,
      $anchor = _ref5.$anchor,
      $anchorSize = _ref5.$anchorSize;
  return {
    position: 'absolute',
    transition: "".concat($theme.animation.timing300, " ").concat($theme.animation.easeOutCurve, " all"),
    transform: getAnchorTransform($anchor, $anchorSize)
  };
});
exports.StyledFloatingMarkerPinHeadContainer = StyledFloatingMarkerPinHeadContainer;
StyledFloatingMarkerPinHeadContainer.displayName = "StyledFloatingMarkerPinHeadContainer";
StyledFloatingMarkerPinHeadContainer.displayName = 'StyledFloatingMarkerPinHeadContainer';
var StyledFloatingMarkerAnchorContainer = (0, _styles.styled)('div', function () {
  return {
    position: 'absolute'
  };
});
exports.StyledFloatingMarkerAnchorContainer = StyledFloatingMarkerAnchorContainer;
StyledFloatingMarkerAnchorContainer.displayName = "StyledFloatingMarkerAnchorContainer";
StyledFloatingMarkerAnchorContainer.displayName = 'StyledFloatingMarkerAnchorContainer';
var StyledFixedMarkerRoot = (0, _styles.styled)('div', function () {
  return {
    display: 'flex',
    alignItems: 'center',
    flexDirection: 'column'
  };
});
exports.StyledFixedMarkerRoot = StyledFixedMarkerRoot;
StyledFixedMarkerRoot.displayName = "StyledFixedMarkerRoot";
StyledFixedMarkerRoot.displayName = 'StyledFixedMarkerRoot';
var StyledFixedMarkerDragContainer = (0, _styles.styled)('div', function (_ref6) {
  var $theme = _ref6.$theme,
      $translateAmount = _ref6.$translateAmount,
      $performTranslate = _ref6.$performTranslate;
  return {
    transform: "translateY(".concat($performTranslate ? "".concat($translateAmount, "px") : '0px', ")"),
    transition: "".concat($theme.animation.timing300, " ").concat($theme.animation.easeOutCurve, " all"),
    display: 'flex',
    alignItems: 'center',
    flexDirection: 'column'
  };
});
exports.StyledFixedMarkerDragContainer = StyledFixedMarkerDragContainer;
StyledFixedMarkerDragContainer.displayName = "StyledFixedMarkerDragContainer";
StyledFixedMarkerDragContainer.displayName = 'StyledFixedMarkerDragContainer';
var StyledOuterXXSmallAnchor = (0, _styles.styled)('div', function (_ref7) {
  var $theme = _ref7.$theme,
      $round = _ref7.$round,
      $background = _ref7.$background,
      $size = _ref7.$size;
  return {
    backgroundColor: $background,
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'center',
    height: "".concat($size, "px"),
    width: "".concat($size, "px"),
    borderRadius: $round ? '50%' : 0,
    boxShadow: $theme.lighting.shadow600
  };
});
exports.StyledOuterXXSmallAnchor = StyledOuterXXSmallAnchor;
StyledOuterXXSmallAnchor.displayName = "StyledOuterXXSmallAnchor";
StyledOuterXXSmallAnchor.displayName = 'StyledOuterXXSmallAnchor';
var StyledInnerXXSmallAnchor = (0, _styles.styled)('div', function (_ref8) {
  var $round = _ref8.$round,
      $color = _ref8.$color,
      $size = _ref8.$size;
  return {
    backgroundColor: $color,
    height: "".concat($size, "px"),
    width: "".concat($size, "px"),
    borderRadius: $round ? '50%' : 0
  };
});
exports.StyledInnerXXSmallAnchor = StyledInnerXXSmallAnchor;
StyledInnerXXSmallAnchor.displayName = "StyledInnerXXSmallAnchor";
StyledInnerXXSmallAnchor.displayName = 'StyledInnerXXSmallAnchor';
var StyledOuterXSmallAnchor = (0, _styles.styled)('div', function (_ref9) {
  var $theme = _ref9.$theme,
      $round = _ref9.$round,
      $background = _ref9.$background,
      $size = _ref9.$size;
  return {
    backgroundColor: $background,
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'center',
    height: "".concat($size, "px"),
    width: "".concat($size, "px"),
    borderRadius: $round ? '50%' : 0,
    boxShadow: $theme.lighting.shadow600
  };
});
exports.StyledOuterXSmallAnchor = StyledOuterXSmallAnchor;
StyledOuterXSmallAnchor.displayName = "StyledOuterXSmallAnchor";
StyledOuterXSmallAnchor.displayName = 'StyledOuterXSmallAnchor';
var StyledInnerXSmallAnchor = (0, _styles.styled)('div', function (_ref10) {
  var $round = _ref10.$round,
      $color = _ref10.$color,
      $size = _ref10.$size;
  return {
    backgroundColor: $color,
    height: "".concat($size, "px"),
    width: "".concat($size, "px"),
    borderRadius: $round ? '50%' : 0
  };
});
exports.StyledInnerXSmallAnchor = StyledInnerXSmallAnchor;
StyledInnerXSmallAnchor.displayName = "StyledInnerXSmallAnchor";
StyledInnerXSmallAnchor.displayName = 'StyledInnerXSmallAnchor';
var StyledPinHead = (0, _styles.styled)('div', function (_ref11) {
  var $theme = _ref11.$theme,
      $height = _ref11.$height,
      $background = _ref11.$background,
      $gridTemplateColumns = _ref11.$gridTemplateColumns,
      $type = _ref11.$type,
      $forceCircle = _ref11.$forceCircle;
  var sharedStyles = {
    fixed: {
      padding: '0px 12px',
      borderRadius: "".concat($height, "px")
    },
    floating: {
      padding: '0px 8px'
    }
  };
  return _objectSpread(_objectSpread({
    backgroundColor: $background,
    height: "".concat($height, "px"),
    display: 'grid',
    gridTemplateColumns: $gridTemplateColumns,
    gap: '8px',
    boxShadow: $theme.lighting.shadow600,
    whiteSpace: 'nowrap'
  }, sharedStyles[$type]), $forceCircle && {
    width: "".concat($height, "px"),
    display: 'flex',
    justifyContent: 'center',
    boxSizing: 'border-box'
  });
});
exports.StyledPinHead = StyledPinHead;
StyledPinHead.displayName = "StyledPinHead";
StyledPinHead.displayName = 'StyledPinHead';
var StyledStrokedLabelContainer = (0, _styles.styled)('div', function (_ref12) {
  var $position = _ref12.$position,
      $theme = _ref12.$theme,
      $labelOffset = _ref12.$labelOffset;
  var staticLabelOffset = 4;
  var positions = {
    top: {
      left: "calc(50% + ".concat(staticLabelOffset, "px)"),
      bottom: '100%',
      alignItems: 'flex-end',
      justifyContent: 'center',
      textAlign: 'center'
    },
    bottom: {
      left: '50%',
      top: "calc(100% + ".concat(staticLabelOffset, "px + ").concat($labelOffset, "px)"),
      alignItems: 'flex-start',
      justifyContent: 'center',
      textAlign: 'center'
    },
    right: {
      left: "calc(100% + ".concat(staticLabelOffset, "px)"),
      top: '50%',
      alignItems: 'center',
      justifyContent: 'flex-start'
    },
    left: {
      right: "calc(100% + ".concat(staticLabelOffset, "px)"),
      top: '50%',
      alignItems: 'center',
      justifyContent: 'flex-end',
      textAlign: 'right'
    },
    none: {}
  };
  return _objectSpread({
    position: 'absolute',
    width: '0px',
    height: '0px',
    pointerEvents: 'none',
    display: 'flex'
  }, positions[$position]);
});
exports.StyledStrokedLabelContainer = StyledStrokedLabelContainer;
StyledStrokedLabelContainer.displayName = "StyledStrokedLabelContainer";
StyledStrokedLabelContainer.displayName = 'StyledStrokedLabelContainer';
var StyledStrokedLabel = (0, _styles.styled)('div', function (_ref13) {
  var $theme = _ref13.$theme,
      $size = _ref13.$size;
  var strokeWidth = 1.5;
  var strokeColor = $theme.colors.borderInverseSelected;
  var textShadow = "-".concat(strokeWidth, "px -").concat(strokeWidth, "px 0 ").concat(strokeColor, ",\n    0 -").concat(strokeWidth, "px 0 ").concat(strokeColor, ",\n    ").concat(strokeWidth, "px -").concat(strokeWidth, "px 0 ").concat(strokeColor, ",\n    ").concat(strokeWidth, "px 0 0 ").concat(strokeColor, ",\n    ").concat(strokeWidth, "px ").concat(strokeWidth, "px 0 ").concat(strokeColor, ",\n    0 ").concat(strokeWidth, "px 0 ").concat(strokeColor, ",\n   -").concat(strokeWidth, "px ").concat(strokeWidth, "px 0 ").concat(strokeColor, ",\n   -").concat(strokeWidth, "px 0 0 ").concat(strokeColor);
  return _objectSpread(_objectSpread({
    display: 'flex'
  }, $theme.typography[_constants.LABEL_SIZES[$size]]), {}, {
    color: $theme.colors.contentPrimary,
    transition: "".concat($theme.animation.timing300, " ").concat($theme.animation.easeOutCurve, " all"),
    textShadow: textShadow,
    pointerEvents: 'auto',
    width: 'max-content',
    maxWidth: '200px'
  });
});
exports.StyledStrokedLabel = StyledStrokedLabel;
StyledStrokedLabel.displayName = "StyledStrokedLabel";
StyledStrokedLabel.displayName = 'StyledStrokedLabel';
var StyledBadgeEnhancerRoot = (0, _styles.styled)('div', function (_ref14) {
  var $theme = _ref14.$theme,
      $size = _ref14.$size,
      $position = _ref14.$position;
  var x = $position.x,
      y = $position.y;
  return _objectSpread(_objectSpread({
    position: 'absolute'
  }, $theme.typography.LabelSmall), {}, {
    backgroundColor: $theme.colors.backgroundAccent,
    color: $theme.colors.contentOnColor,
    boxSizing: 'border-box',
    right: 0,
    transform: "translate(calc(100% + ".concat(x, "px), ").concat(y, "px)"),
    transition: "".concat($theme.animation.timing300, " ").concat($theme.animation.easeOutCurve, " all")
  }, _constants.BADGE_ENHANCER_STYLES[$size]);
});
exports.StyledBadgeEnhancerRoot = StyledBadgeEnhancerRoot;
StyledBadgeEnhancerRoot.displayName = "StyledBadgeEnhancerRoot";
StyledBadgeEnhancerRoot.displayName = 'StyledBadgeEnhancerRoot';
var RelativeContainer = (0, _styles.styled)('div', function () {
  return {
    position: 'relative'
  };
});
exports.RelativeContainer = RelativeContainer;
RelativeContainer.displayName = "RelativeContainer";
RelativeContainer.displayName = 'RelativeContainer';
var StyledEnhancerSlot = (0, _styles.styled)('div', function (_ref15) {
  var $theme = _ref15.$theme,
      $color = _ref15.$color,
      $height = _ref15.$height,
      $size = _ref15.$size;
  return _objectSpread(_objectSpread({}, $theme.typography[_constants.LABEL_SIZES[$size]]), {}, {
    display: 'flex',
    alignItems: 'center',
    textAlign: 'center',
    lineHeight: "".concat($height, "px"),
    height: "".concat($height, "px"),
    color: $color
  });
});
exports.StyledEnhancerSlot = StyledEnhancerSlot;
StyledEnhancerSlot.displayName = "StyledEnhancerSlot";
var StyledFloatingRouteMarkerRoot = (0, _styles.styled)('div', function (_ref16) {
  var $theme = _ref16.$theme,
      $height = _ref16.$height,
      $background = _ref16.$background,
      $gridTemplateColumns = _ref16.$gridTemplateColumns;
  return {
    position: 'absolute',
    backgroundColor: $background,
    height: "".concat($height, "px"),
    display: 'grid',
    gridTemplateColumns: $gridTemplateColumns,
    gap: '8px',
    filter: "drop-shadow(".concat($theme.lighting.shadow600, ")"),
    whiteSpace: 'nowrap',
    borderRadius: "".concat(8, "px"),
    padding: "".concat(4, "px ", 8, "px"),
    transition: "".concat($theme.animation.timing300, " ").concat($theme.animation.easeOutCurve, " all")
  };
});
exports.StyledFloatingRouteMarkerRoot = StyledFloatingRouteMarkerRoot;
StyledFloatingRouteMarkerRoot.displayName = "StyledFloatingRouteMarkerRoot";
StyledFloatingRouteMarkerRoot.displayName = 'StyledFloatingRouteMarkerRoot';
StyledEnhancerSlot.displayName = 'StyledEnhancerSlot';
var StyledLabelSlot = (0, _styles.styled)('div', function () {
  return {
    display: 'flex',
    justifyContent: 'center',
    flexDirection: 'column'
  };
});
exports.StyledLabelSlot = StyledLabelSlot;
StyledLabelSlot.displayName = "StyledLabelSlot";
StyledLabelSlot.displayName = 'StyledLabelSlot';
var StyledLabel = (0, _styles.styled)('div', function (_ref17) {
  var $theme = _ref17.$theme,
      $size = _ref17.$size,
      $renderSecondaryLabel = _ref17.$renderSecondaryLabel,
      $color = _ref17.$color;
  var pinheadSizeOrder = Object.values(_constants.PINHEAD_SIZES_SHAPES);
  var labelSizeIndex = pinheadSizeOrder.findIndex(function (x) {
    return $size === x;
  });

  if ($renderSecondaryLabel) {
    labelSizeIndex--;
  }

  var typographyStyle = _constants.LABEL_SIZES[pinheadSizeOrder[labelSizeIndex]];
  return _objectSpread(_objectSpread({}, $theme.typography[typographyStyle]), {}, {
    color: $color
  });
});
exports.StyledLabel = StyledLabel;
StyledLabel.displayName = "StyledLabel";
StyledLabel.displayName = 'StyledLabel';
var LocationPuckContainer = (0, _styles.styled)('div', function () {
  return {
    position: 'relative',
    display: 'flex',
    alignItems: 'center',
    justifyContent: 'center'
  };
});
exports.LocationPuckContainer = LocationPuckContainer;
LocationPuckContainer.displayName = "LocationPuckContainer";
LocationPuckContainer.displayName = 'LocationPuckContainer';
var consumerLocationShadow = {
  boxShadow: "0px 2px 4px 0px rgba(67, 76, 123, 0.2)"
};
exports.consumerLocationShadow = consumerLocationShadow;
var earnerLocationShadow = {
  boxShadow: "0px 3px 5px 0px rgba(67, 76, 123, 0.4)"
};
exports.earnerLocationShadow = earnerLocationShadow;
var StyledConsumerLocationPuckCore = (0, _styles.styled)('div', function (_ref18) {
  var $theme = _ref18.$theme;
  return _objectSpread({
    height: "".concat(12, "px"),
    width: "".concat(12, "px"),
    background: $theme.colors.contentAccent,
    borderRadius: "".concat(100, "px "),
    position: 'absolute'
  }, consumerLocationShadow);
});
exports.StyledConsumerLocationPuckCore = StyledConsumerLocationPuckCore;
StyledConsumerLocationPuckCore.displayName = "StyledConsumerLocationPuckCore";
var StyledLocationPuckApproximation = (0, _styles.styled)('div', function (_ref19) {
  var $theme = _ref19.$theme,
      $color = _ref19.$color,
      $radius = _ref19.$radius;
  return {
    background: $color,
    opacity: 0.12,
    height: "".concat($radius / 2, "px"),
    width: "".concat($radius / 2, "px"),
    borderRadius: "".concat(10000, "px "),
    position: 'absolute',
    transition: "".concat($theme.animation.timing300, " ").concat($theme.animation.easeOutCurve, " all")
  };
});
exports.StyledLocationPuckApproximation = StyledLocationPuckApproximation;
StyledLocationPuckApproximation.displayName = "StyledLocationPuckApproximation";
StyledLocationPuckApproximation.displayName = 'StyledLocationPuckApproximation';
var StyledEarnerLocationPuckCore = (0, _styles.styled)('div', function (_ref20) {
  var $theme = _ref20.$theme,
      $color = _ref20.$color,
      $size = _ref20.$size;
  return _objectSpread(_objectSpread({
    position: 'absolute',
    transform: "scale(".concat(_constants.EARNER_LOCATION_PUCK_CORE_SCALES[$size], ")"),
    transition: "".concat($theme.animation.timing300, " ").concat($theme.animation.easeOutCurve, " all")
  }, earnerLocationShadow), {}, {
    borderRadius: '50%',
    height: "".concat(72, "px"),
    width: "".concat(72, "px"),
    background: $theme.colors.backgroundPrimary,
    border: "".concat(6, "px solid ", $color),
    boxSizing: 'border-box'
  });
});
exports.StyledEarnerLocationPuckCore = StyledEarnerLocationPuckCore;
StyledEarnerLocationPuckCore.displayName = "StyledEarnerLocationPuckCore";
StyledEarnerLocationPuckCore.displayName = 'StyledEarnerLocationPuckCore';
var StyledFloatingRouteMarkerPointerContainer = (0, _styles.styled)('svg', function (_ref21) {
  var $position = _ref21.$position;
  return _objectSpread({
    position: 'absolute'
  }, _constants.FLOATING_ROUTE_MARKER_POINTER_TRANSFORMS[$position]);
});
exports.StyledFloatingRouteMarkerPointerContainer = StyledFloatingRouteMarkerPointerContainer;
StyledFloatingRouteMarkerPointerContainer.displayName = "StyledFloatingRouteMarkerPointerContainer";
StyledFloatingRouteMarkerPointerContainer.displayName = 'StyledFloatingRouteMarkerPointerContainer';
var StyledFloatingRouteMarkerPointer = (0, _styles.styled)('path', function (_ref22) {
  var $theme = _ref22.$theme,
      $background = _ref22.$background;
  return {
    transition: "".concat($theme.animation.timing300, " ").concat($theme.animation.easeOutCurve, " all"),
    fill: $background
  };
});
exports.StyledFloatingRouteMarkerPointer = StyledFloatingRouteMarkerPointer;
StyledFloatingRouteMarkerPointer.displayName = "StyledFloatingRouteMarkerPointer";
StyledFloatingRouteMarkerPointer.displayName = 'StyledFloatingRouteMarkerPointer';