function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function _object_without_properties(source, excluded) {
    if (source == null) return {};
    var target = {}, sourceKeys, key, i;
    if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
        sourceKeys = Reflect.ownKeys(source);
        for(i = 0; i < sourceKeys.length; i++){
            key = sourceKeys[i];
            if (excluded.indexOf(key) >= 0) continue;
            if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
            target[key] = source[key];
        }
        return target;
    }
    target = _object_without_properties_loose(source, excluded);
    if (Object.getOwnPropertySymbols) {
        sourceKeys = Object.getOwnPropertySymbols(source);
        for(i = 0; i < sourceKeys.length; i++){
            key = sourceKeys[i];
            if (excluded.indexOf(key) >= 0) continue;
            if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
            target[key] = source[key];
        }
    }
    return target;
}
function _object_without_properties_loose(source, excluded) {
    if (source == null) return {};
    var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
    for(i = 0; i < sourceKeys.length; i++){
        key = sourceKeys[i];
        if (excluded.indexOf(key) >= 0) continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
        target[key] = source[key];
    }
    return target;
}
import React from 'react';
import styled, { css } from 'styled-components';
import { formatCurrency } from '../../utils';
var StyledPrice = styled.span.withConfig({
    displayName: "Price__StyledPrice",
    componentId: "sc-cf7d3366-0"
})([
    "",
    ";"
], function(param) {
    var $stroke = param.$stroke;
    return $stroke && css([
        "text-decoration:line-through;"
    ]);
});
var StyledPeriodicity = styled.span.withConfig({
    displayName: "Price__StyledPeriodicity",
    componentId: "sc-cf7d3366-1"
})([
    "padding-left:0.25rem;"
]);
/**
 * Компонент для отображения цены / стоимости / суммы.
 */ export var Price = function Price(_0) {
    var children = _0.children, _0_currency = _0.currency, currency = _0_currency === void 0 ? 'rub' : _0_currency, _0_minimumFractionDigits = _0.minimumFractionDigits, minimumFractionDigits = _0_minimumFractionDigits === void 0 ? 0 : _0_minimumFractionDigits, _0_stroke = _0.stroke, stroke = _0_stroke === void 0 ? false : _0_stroke, periodicity = _0.periodicity, rest = _object_without_properties(_0, [
        "children",
        "currency",
        "minimumFractionDigits",
        "stroke",
        "periodicity"
    ]);
    return /*#__PURE__*/ React.createElement(StyledPrice, _object_spread({
        $stroke: stroke
    }, rest), formatCurrency(children, currency, minimumFractionDigits), periodicity && /*#__PURE__*/ React.createElement(StyledPeriodicity, null, periodicity));
};
