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; }

/*
Copyright (c) 2018-2019 Uber Technologies, Inc.

This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
*/
import { withStyle } from 'styletron-react';
import Flag from './flag.js';
import { DEFAULT_MAX_DROPDOWN_HEIGHT, SIZE } from './constants.js';
import { styled } from '../styles/index.js';
import { StyledList } from '../menu/index.js';
import { StyledDropdownListItem, StyledRoot as SelectStyledRoot } from '../select/index.js';
export var StyledFlag = styled(Flag, function (_ref) {
  var _sizeToWidth;

  var _ref$$size = _ref.$size,
      $size = _ref$$size === void 0 ? SIZE.default : _ref$$size,
      sizing = _ref.$theme.sizing;
  var sizeToWidth = (_sizeToWidth = {}, _defineProperty(_sizeToWidth, SIZE.compact, sizing.scale800), _defineProperty(_sizeToWidth, SIZE.default, sizing.scale900), _defineProperty(_sizeToWidth, SIZE.large, sizing.scale1000), _sizeToWidth);
  return {
    width: sizeToWidth[$size]
  };
});
StyledFlag.displayName = "StyledFlag";
export var StyledRoot = withStyle(SelectStyledRoot, function (_ref2) {
  var _sizeToWidth2;

  var _ref2$size = _ref2.size,
      size = _ref2$size === void 0 ? SIZE.default : _ref2$size,
      sizing = _ref2.$theme.sizing;
  // hard coded widths for the flag dropdown anchor
  var sizeToWidth = (_sizeToWidth2 = {}, _defineProperty(_sizeToWidth2, SIZE.compact, '60px'), _defineProperty(_sizeToWidth2, SIZE.default, '70px'), _defineProperty(_sizeToWidth2, SIZE.large, '80px'), _sizeToWidth2);
  return {
    width: sizeToWidth[size]
  };
});
StyledRoot.displayName = "StyledRoot";
export var StyledDialCode = styled('div', function (_ref3) {
  var sizing = _ref3.$theme.sizing;
  return {
    marginLeft: sizing.scale100
  };
});
StyledDialCode.displayName = "StyledDialCode";
export var StyledCountrySelectDropdownContainer = withStyle(StyledList, function (_ref4) {
  var _ref4$$height = _ref4.$height,
      $height = _ref4$$height === void 0 ? DEFAULT_MAX_DROPDOWN_HEIGHT : _ref4$$height;
  return {
    height: $height,
    paddingTop: 0,
    paddingBottom: 0
  };
});
StyledCountrySelectDropdownContainer.displayName = "StyledCountrySelectDropdownContainer";
export var StyledCountrySelectDropdownListItem = withStyle(StyledDropdownListItem, {
  paddingTop: 0,
  paddingBottom: 0,
  paddingLeft: 0,
  paddingRight: 0,
  display: 'flex',
  alignItems: 'center'
});
StyledCountrySelectDropdownListItem.displayName = "StyledCountrySelectDropdownListItem";
export var StyledCountrySelectDropdownFlagColumn = styled('div', function (_ref5) {
  var sizing = _ref5.$theme.sizing;
  return {
    paddingLeft: sizing.scale600,
    display: 'flex',
    alignItems: 'center'
  };
});
StyledCountrySelectDropdownFlagColumn.displayName = "StyledCountrySelectDropdownFlagColumn";
export var StyledCountrySelectDropdownNameColumn = styled('div', function (_ref6) {
  var sizing = _ref6.$theme.sizing;
  return {
    paddingLeft: sizing.scale600
  };
});
StyledCountrySelectDropdownNameColumn.displayName = "StyledCountrySelectDropdownNameColumn";
export var StyledCountrySelectDropdownDialcodeColumn = styled('div', function (_ref7) {
  var sizing = _ref7.$theme.sizing;
  return {
    paddingRight: sizing.scale600,
    marginLeft: 'auto'
  };
});
StyledCountrySelectDropdownDialcodeColumn.displayName = "StyledCountrySelectDropdownDialcodeColumn";