"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _chunkUQQJYZ2Bjs = require('./chunk-UQQJYZ2B.js');


var _chunkUOQEKEVTjs = require('./chunk-UOQEKEVT.js');

// tmp-babel/content-feed/web/PostItemImages/index.js
var _icons = require('@baseapp-frontend/design-system/components/web/icons');
var _iconsmaterial = require('@mui/icons-material');
var _material = require('@mui/material');
var _reactmulticarousel = require('react-multi-carousel'); var _reactmulticarousel2 = _interopRequireDefault(_reactmulticarousel);
require('react-multi-carousel/lib/styles.css');
var _jsxruntime = require('react/jsx-runtime');
var Carousel = _reactmulticarousel2.default["default"] ? _reactmulticarousel2.default["default"] : _reactmulticarousel2.default;
var CustomDot = function CustomDot2(_ref) {
  var _onClick = _ref.onClick, active = _ref.active;
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.IconButton, {
    sx: {
      p: 0.5
    },
    onClick: function onClick(e) {
      _onClick === null || _onClick === void 0 || _onClick();
      e.preventDefault();
    },
    children: active ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _icons.PillIcon, {
      sx: {
        color: "#fff"
      }
    }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _iconsmaterial.Circle, {
      sx: {
        color: "#fff",
        fontSize: 8,
        opacity: active ? 1 : 0.5
      }
    })
  });
};
var CustomArrow = function CustomArrow2(_ref2) {
  var onClick = _ref2.onClick, orientation = _ref2.orientation;
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Fab, {
    onClick,
    sx: {
      position: "absolute",
      left: orientation === "left" ? 0 : void 0,
      right: orientation === "right" ? 0 : void 0,
      opacity: 0.72,
      m: 1
    },
    color: "default",
    variant: "soft",
    size: "small",
    children: orientation === "left" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _iconsmaterial.ChevronLeft, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _iconsmaterial.ChevronRight, {})
  });
};
var PostItemImages = function PostItemImages2(_ref3) {
  var _post$images, _post$images2;
  var post = _ref3.post;
  if (!(post !== null && post !== void 0 && (_post$images = post.images) !== null && _post$images !== void 0 && (_post$images = _post$images.edges) !== null && _post$images !== void 0 && _post$images.length)) return null;
  var images = (post === null || post === void 0 || (_post$images2 = post.images) === null || _post$images2 === void 0 ? void 0 : _post$images2.edges.filter(function(img) {
    return !!(img !== null && img !== void 0 && img.node);
  })) || [];
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Carousel, {
    ssr: true,
    additionalTransfrom: 0,
    arrows: images.length > 1,
    className: "",
    containerClass: "content-feed-swiper",
    customLeftArrow: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CustomArrow, {
      orientation: "left"
    }),
    customRightArrow: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CustomArrow, {
      orientation: "right"
    }),
    customDot: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, CustomDot, {}),
    dotListClass: "content-feed-swiper-custom-dot",
    draggable: images.length > 1,
    focusOnSelect: false,
    itemClass: "content-feed-swiper-item",
    keyBoardControl: true,
    minimumTouchDrag: 80,
    renderArrowsWhenDisabled: false,
    infinite: true,
    renderDotsOutside: false,
    responsive: {
      desktop: {
        breakpoint: {
          max: 3e3,
          min: 1024
        },
        items: 1,
        partialVisibilityGutter: 0
      },
      mobile: {
        breakpoint: {
          max: 464,
          min: 0
        },
        items: 1,
        partialVisibilityGutter: 0
      },
      tablet: {
        breakpoint: {
          max: 1024,
          min: 464
        },
        items: 1,
        partialVisibilityGutter: 0
      }
    },
    rewind: false,
    rewindWithAnimation: false,
    rtl: false,
    shouldResetAutoplay: true,
    showDots: post.images.edges.length > 1,
    sliderClass: "",
    slidesToSlide: 1,
    swipeable: post.images.edges.length > 1,
    children: images.map(function(image) {
      return (image === null || image === void 0 ? void 0 : image.node) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUQQJYZ2Bjs.ImageCarouselContainer, {
        children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkUOQEKEVTjs.PostImageSlide_default, {
          imagesRef: image.node
        })
      }, image.node.id);
    })
  });
};
var PostItemImages_default = PostItemImages;



exports.PostItemImages_default = PostItemImages_default;
//# sourceMappingURL=chunk-IAC7XTSV.js.map