// @ts-nocheck
import './Picture.css';
import React from 'react';
import { IconPlay } from '../../icons/IconPlay/IconPlay';
import { cn } from '../../utils/bem';
import { Button } from '../Button/Button';
export var cnPicture = cn('Picture');
export var Picture = function (props) {
    var _a, _b;
    var url = props.url, urlWebp = props.urlWebp, desktop = props.desktop, desktopWebp = props.desktopWebp, desktop2x = props.desktop2x, desktop2xWebp = props.desktop2xWebp, tablet = props.tablet, tabletWebp = props.tabletWebp, tablet2x = props.tablet2x, tablet2xWebp = props.tablet2xWebp, mobile = props.mobile, mobileWebp = props.mobileWebp, mobile2x = props.mobile2x, mobile2xWebp = props.mobile2xWebp, className = props.className, video = props.video, onClickPlay = props.onClickPlay, buttonSize = props.buttonSize, buttonIconSize = props.buttonIconSize, alt = props.alt, name = props.name, cover = props.cover, borderRadius = props.borderRadius;
    return (React.createElement("div", { className: cnPicture({ borderRadius: borderRadius, cover: cover }, [className]) },
        video && (React.createElement(Button, { view: "primary", form: "circle", iconRight: IconPlay, onlyIcon: true, className: cnPicture('ButtonPlay'), onClick: onClickPlay, size: buttonSize, iconSize: buttonIconSize })),
        React.createElement("picture", null,
            desktopWebp && (React.createElement("source", { type: "image/webp", srcSet: "".concat(desktopWebp !== null && desktopWebp !== void 0 ? desktopWebp : urlWebp, " ").concat(desktop2xWebp ? "1x, ".concat(desktop2xWebp, " 2x") : ''), media: !mobile && !tablet ? '(min-width: 0px)' : '(min-width: 1200px)' })),
            React.createElement("source", { srcSet: "".concat(desktop !== null && desktop !== void 0 ? desktop : url, " ").concat(desktop2x ? "1x, ".concat(desktop2x, " 2x") : ''), media: !mobile && !tablet ? '(min-width: 0px)' : '(min-width: 1200px)' }),
            tabletWebp && (React.createElement("source", { type: "image/webp", srcSet: "".concat(tabletWebp, " 1x, ").concat(tablet2xWebp, " 2x"), media: "(min-width: 767px)" })),
            tablet && React.createElement("source", { srcSet: "".concat(tablet, " 1x, ").concat(tablet2x, " 2x"), media: "(min-width: 767px)" }),
            mobileWebp && (React.createElement("source", { type: "image/webp", srcSet: "".concat(mobileWebp, " 1x, ").concat(mobile2xWebp, " 2x"), media: "(min-width: 0)" })),
            mobile && React.createElement("source", { srcSet: "".concat(mobile, " 1x, ").concat(mobile2x, " 2x"), media: "(min-width: 0)" }),
            React.createElement("img", { src: (_b = (_a = desktop !== null && desktop !== void 0 ? desktop : tablet) !== null && _a !== void 0 ? _a : mobile) !== null && _b !== void 0 ? _b : url, alt: alt || name || 'Изображение' }))));
};
