"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _react = require("react");
var _native = _interopRequireWildcard(require("react-content-loader/native"));
var _styles = require("./styles");
var _reactNative = require("react-native");
var _color = require("../../../../../../core/utils/color");
var _reactNativeSvg = require("react-native-svg");
var _CommunityListSkeleton = _interopRequireDefault(require("../../../../../components/CommunityListSkeleton/CommunityListSkeleton"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
const ExploreLoadingSkeleton = ({
  themeStyles
}) => {
  const styles = (0, _styles.useStyles)();
  const {
    backgroundColor,
    foregroundColor
  } = (0, _color.getSkeletonBackgrounColor)(themeStyles);
  const renderCategoriesSkeleton = () => {
    return /*#__PURE__*/React.createElement(_reactNative.View, {
      style: styles.categoriesContainers
    }, /*#__PURE__*/React.createElement(_native.default, {
      height: 36,
      width: 400,
      speed: 1,
      viewBox: "0 0 400 36",
      backgroundColor: backgroundColor,
      foregroundColor: foregroundColor
    }, Array.from({
      length: 4
    }, (_, index) => {
      return /*#__PURE__*/React.createElement(_native.Rect, {
        key: index,
        x: index !== 0 ? index * (90 + 8) : 0,
        y: "0",
        rx: "20",
        ry: "20",
        width: "90",
        height: "36"
      });
    })));
  };
  const renderRecommendedCommunitiesSkeleton = () => {
    // Title
    const titleHeight = 44;
    // Card
    const height = 134;
    const width = 268;
    const detailHeight = 88;
    const radius = 8;
    const borderWidth = 1;
    const gap = 12;
    // Card content
    const marginLeft = 12;
    return /*#__PURE__*/React.createElement(_reactNative.View, {
      style: styles.categoriesContainers
    }, /*#__PURE__*/React.createElement(_native.default, {
      height: height + detailHeight + titleHeight,
      width: 400,
      speed: 1,
      viewBox: `0 0 400 ${height + detailHeight + titleHeight}`,
      backgroundColor: backgroundColor,
      foregroundColor: foregroundColor
    }, /*#__PURE__*/React.createElement(_native.Rect, {
      x: "0",
      y: "0",
      width: "156",
      height: "12",
      rx: "6",
      ry: "6"
    }), Array.from({
      length: 2
    }, (_, index) => {
      return /*#__PURE__*/React.createElement(_react.Fragment, {
        key: index
      }, /*#__PURE__*/React.createElement(_native.Rect, {
        x: index * (width + gap),
        y: titleHeight,
        width: width,
        height: height + detailHeight,
        rx: "8",
        ry: "8"
      }), /*#__PURE__*/React.createElement(_reactNativeSvg.Path, {
        d: `
                  M ${index * (width + gap) + borderWidth},${height + titleHeight}
                  L ${(index + 1) * width - borderWidth},${height + titleHeight}
                  L ${(index + 1) * width - borderWidth},${height + detailHeight - radius + titleHeight - borderWidth}
                  Q ${(index + 1) * width - borderWidth},${height + detailHeight + titleHeight - borderWidth} ${(index + 1) * width - radius},${height + detailHeight + titleHeight - borderWidth}
                  L ${index * (width + gap) + radius + borderWidth},${height + detailHeight + titleHeight - borderWidth}
                  Q ${index * (width + gap) + borderWidth},${height + detailHeight + titleHeight - borderWidth} ${index * (width + gap) + borderWidth},${height + detailHeight - radius + titleHeight - borderWidth}
                  L ${index * (width + gap) + borderWidth},${height + titleHeight}
                `
      }), /*#__PURE__*/React.createElement(_native.Rect, {
        x: index * (width + marginLeft + borderWidth) + gap,
        y: 151 + titleHeight,
        width: "90",
        height: "10",
        rx: "6",
        ry: "6"
      }), /*#__PURE__*/React.createElement(_native.Rect, {
        x: index * (width + marginLeft + borderWidth) + gap,
        y: 177 + titleHeight,
        width: "164",
        height: "8",
        rx: "6",
        ry: "6"
      }), /*#__PURE__*/React.createElement(_native.Rect, {
        x: index * (width + marginLeft + borderWidth) + gap,
        y: 195 + titleHeight,
        width: "196",
        height: "8",
        rx: "6",
        ry: "6"
      }));
    })));
  };
  const renderTrendingCommunitiesSkeleton = () => {
    return /*#__PURE__*/React.createElement(_reactNative.View, {
      style: styles.trendingCommunitiesContainer
    }, /*#__PURE__*/React.createElement(_CommunityListSkeleton.default, {
      themeStyle: themeStyles
    }));
  };
  return /*#__PURE__*/React.createElement(React.Fragment, null, renderCategoriesSkeleton(), renderRecommendedCommunitiesSkeleton(), renderTrendingCommunitiesSkeleton());
};
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(ExploreLoadingSkeleton);
//# sourceMappingURL=ExploreLoadingSkeleton.js.map