"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _dataSources = require("@mirai/data-sources");
var _ui = require("@mirai/ui");
var _react = _interopRequireDefault(require("react"));
var _helpers = require("./helpers");
var _shared__ = require("../__shared__");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
const RatesSkeleton = () => {
  const {
    isDesktop,
    isMobile,
    isPortrait,
    isTablet
  } = (0, _ui.useDevice)();
  const {
    value: {
      hotel: {
        features
      } = {},
      urlParams
    }
  } = (0, _dataSources.useStore)();
  const section = {
    borderBottom: 'solid 1px var(--mirai-ui-content-background)',
    gap: '0.5rem',
    padding: '1rem'
  };
  const option = {
    row: true,
    style: {
      gap: '0.5rem'
    }
  };
  const optionContainer = {
    row: true,
    style: {
      gap: '0.5rem',
      justifyContent: 'space-between',
      marginBottom: '0.5rem'
    }
  };
  const tab = {
    row: false,
    style: {
      alignItems: 'center',
      alignContent: 'center',
      justifyContent: 'center',
      border: 'solid 1px var(--mirai-ui-content-background)',
      flex: 1,
      gap: '0.5rem',
      height: '100%',
      padding: '1rem'
    }
  };
  const {
    columnMode,
    hideRadio,
    rowMode
  } = (0, _helpers.getFeatures)(features, urlParams, {
    isDesktop,
    isMobile
  });
  const cardImageHeight = (0, _helpers.getCardImageHeight)();
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ui.View, {
    row: true,
    style: {
      alignItems: 'stretch',
      flexWrap: 'wrap',
      gap: '1rem',
      justifyContent: 'space-between',
      marginTop: isMobile ? 0 : '1rem'
    }
  }, Array.from({
    length: isMobile ? 1 : isTablet ? 2 : 3
  }).map((_, index) => /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    key: index,
    base: true,
    row: rowMode,
    style: {
      boxSizing: 'border-box',
      flex: 1,
      flexBasis: isTablet || columnMode ? 'calc(50% - calc(var(--mirai-ui-space-M) / 2))' : isDesktop && !rowMode ? "calc(33.33% - calc(calc(var(--mirai-ui-space-M) * 2) / 3))" : '100%',
      overflow: 'hidden'
    }
  }, /*#__PURE__*/_react.default.createElement(rowMode ? _ui.View : _react.default.Fragment, rowMode ? {
    style: {
      borderRight: 'solid 1px var(--mirai-ui-content-background)',
      minWidth: '50%'
    }
  } : undefined, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    style: {
      borderRadius: 0,
      minHeight: !columnMode && !rowMode ? cardImageHeight : "calc(100svh / ".concat(isPortrait ? 5 : 3, ")")
    }
  }), /*#__PURE__*/_react.default.createElement(_ui.View, {
    row: true,
    style: _objectSpread(_objectSpread({}, section), {}, {
      gap: '1rem',
      padding: '0.75rem 1rem'
    })
  }, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 2
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 1
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 2
  })), /*#__PURE__*/_react.default.createElement(_ui.View, {
    style: _objectSpread({}, section)
  }, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    headline: true,
    level: 2,
    words: 2
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    action: true,
    words: 3
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    action: true,
    words: 1
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    action: true,
    words: 2
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    action: true,
    words: 1
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    action: true,
    words: 2
  })))), /*#__PURE__*/_react.default.createElement(_ui.View, {
    style: {
      height: '100%'
    },
    wide: true
  }, /*#__PURE__*/_react.default.createElement(_ui.View, {
    style: _objectSpread({}, section)
  }, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    action: true,
    words: 2
  }), /*#__PURE__*/_react.default.createElement(_ui.View, {
    row: hideRadio
  }, Array.from({
    length: 2
  }).map((_, index) => /*#__PURE__*/_react.default.createElement(_ui.View, _extends({
    key: index
  }, hideRadio ? tab : optionContainer), /*#__PURE__*/_react.default.createElement(_ui.View, option, !hideRadio && /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    icon: true
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    action: true,
    words: 3
  })), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    action: true,
    words: 1
  }))))), /*#__PURE__*/_react.default.createElement(_ui.View, {
    style: _objectSpread({}, section)
  }, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    action: true,
    words: 1
  }), /*#__PURE__*/_react.default.createElement(_ui.View, {
    row: hideRadio
  }, Array.from({
    length: 3
  }).map((_, index) => /*#__PURE__*/_react.default.createElement(_ui.View, _extends({
    key: index
  }, hideRadio ? tab : optionContainer), /*#__PURE__*/_react.default.createElement(_ui.View, option, !hideRadio && /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    icon: true
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    action: true,
    words: 3
  })), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    action: true,
    words: 1
  }))))), /*#__PURE__*/_react.default.createElement(_ui.View, {
    row: true,
    style: {
      alignItems: 'flex-end',
      justifyContent: 'space-between',
      padding: '1rem'
    }
  }, /*#__PURE__*/_react.default.createElement(_ui.View, {
    style: {
      gap: '0.5rem'
    }
  }, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 2
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    headline: true,
    level: 2,
    words: 1
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 5
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 4
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 2
  })), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    button: true,
    words: 1
  })))))));
};
RatesSkeleton.displayName = 'Mirai:Core:Rates:Skeleton';
RatesSkeleton.propTypes = {};
var _default = exports.default = RatesSkeleton;
//# sourceMappingURL=Rates.Skeleton.js.map