"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _ui = require("@mirai/ui");
var _react = _interopRequireDefault(require("react"));
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); }
const SPACE = 'var(--mirai-ui-space-M)';
var _default = () => {
  const {
    isMobile,
    isDesktop
  } = (0, _ui.useDevice)();
  const inputProps = {
    wide: true,
    style: {
      height: 'var(--mirai-ui-input-min-height)'
    }
  };
  const sectionProps = {
    base: true,
    style: {
      gap: SPACE,
      padding: SPACE
    }
  };
  const fieldsetProps = {
    row: true,
    wide: true,
    style: {
      gap: SPACE
    }
  };
  const renderSummary = () => /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    base: true,
    style: {
      flex: 1,
      maxWidth: 'calc(var(--mirai-ui-breakpoint-S) - var(--mirai-ui-space-M) * 2)'
    }
  }, /*#__PURE__*/_react.default.createElement(_ui.View, {
    style: {
      borderBottom: 'solid var(--mirai-ui-border-width) var(--mirai-ui-content-background)',
      gap: SPACE,
      padding: SPACE
    }
  }, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    headline: isDesktop,
    words: 2
  }), /*#__PURE__*/_react.default.createElement(_ui.View, {
    row: true
  }, /*#__PURE__*/_react.default.createElement(_ui.View, {
    wide: true
  }, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    words: 1
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    action: true,
    words: 3
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 2
  })), /*#__PURE__*/_react.default.createElement(_ui.View, {
    wide: true
  }, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    words: 1
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    action: true,
    words: 3
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 2
  }))), /*#__PURE__*/_react.default.createElement(_ui.View, null, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    words: 2
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    action: true,
    words: 4
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 2
  })), /*#__PURE__*/_react.default.createElement(_ui.View, null, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    words: 1
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    action: true,
    words: 3
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 8
  })), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    words: 3
  })), /*#__PURE__*/_react.default.createElement(_ui.View, {
    style: {
      gap: SPACE,
      padding: SPACE
    }
  }, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    headline: isDesktop,
    words: 2
  }), /*#__PURE__*/_react.default.createElement(_ui.View, {
    style: {
      gap: 'var(--mirai-ui-space-S)'
    }
  }, Array.from({
    length: 4
  }).map((_, index) => /*#__PURE__*/_react.default.createElement(_ui.View, {
    key: index,
    row: true,
    style: {
      justifyContent: 'space-between'
    }
  }, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    action: index < 3,
    words: 2
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    action: index < 3,
    words: 1
  })))), !isMobile && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    button: true,
    wide: true,
    large: true,
    words: 2
  }), /*#__PURE__*/_react.default.createElement(_ui.View, {
    style: {
      alignItems: 'center'
    }
  }, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 7
  })))));
  return /*#__PURE__*/_react.default.createElement(_ui.View, {
    style: {
      alignItems: 'start'
    },
    wide: true
  }, /*#__PURE__*/_react.default.createElement(_ui.View, {
    row: true,
    wide: true,
    style: {
      alignItems: 'start',
      alignSelf: 'center',
      gap: SPACE,
      maxWidth: 'var(--mirai-ui-breakpoint-content)'
    }
  }, /*#__PURE__*/_react.default.createElement(_ui.View, {
    style: {
      flex: 1,
      gap: SPACE
    }
  }, !isDesktop && renderSummary(), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, sectionProps, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    headline: isDesktop,
    words: 2
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 5
  }), Array.from({
    length: 3
  }).map((_, index) => /*#__PURE__*/_react.default.createElement(_ui.View, _extends({
    key: index
  }, fieldsetProps, {
    wide: true
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, inputProps))), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, inputProps), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 13
  }), Array.from({
    length: 2
  }).map((_, index) => /*#__PURE__*/_react.default.createElement(_ui.View, {
    key: index,
    row: true,
    style: {
      gap: SPACE
    }
  }, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    icon: true
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 15
  })))), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, sectionProps, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    headline: isDesktop,
    words: 2
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    words: 2
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, inputProps), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, inputProps), /*#__PURE__*/_react.default.createElement(_ui.View, fieldsetProps, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, inputProps), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, inputProps))), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, sectionProps, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    headline: isDesktop,
    words: 2
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    wide: true,
    style: {
      height: 'calc(var(--mirai-ui-input-min-height) * 2)'
    }
  })), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, sectionProps, /*#__PURE__*/_react.default.createElement(_ui.View, null, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 6
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 24
  })), /*#__PURE__*/_react.default.createElement(_ui.View, null, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 2
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 32
  })), /*#__PURE__*/_react.default.createElement(_ui.View, null, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 2
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 8
  })), /*#__PURE__*/_react.default.createElement(_ui.View, null, /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 2
  }), /*#__PURE__*/_react.default.createElement(_shared__.Skeleton, {
    small: true,
    words: 6
  })))), isDesktop && renderSummary()));
};
exports.default = _default;
//# sourceMappingURL=Checkout.skeleton.js.map