"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.StickBottomWrapperComp = exports.SingleButtonWithInformationIconComp = exports.SingleButtonWithTooltipComp = exports.DoubleButtonComp = exports.SingleATagComp = exports.SingleButtonComp = void 0;
const react_1 = __importDefault(require("react"));
const __1 = require("../..");
const Spacing_1 = require("../../library/Spacing");
const Styled = __importStar(require("./index.styled"));
const FloatDoubleButton_1 = require("../../components/Button/FloatDoubleButton");
const hooks_1 = require("../../hooks");
const components_1 = require("../../components");
const Icon_1 = require("../../Icon");
const core_1 = require("../../core");
const SingleButtonComp = (_a) => {
    var { marginBottomHasFooterBackgroundColor } = _a, props = __rest(_a, ["marginBottomHasFooterBackgroundColor"]);
    const isMobile = (0, hooks_1.useLayoutIsMobile)();
    return (react_1.default.createElement(react_1.default.Fragment, null, isMobile ? (react_1.default.createElement(react_1.default.Fragment, null,
        react_1.default.createElement(__1.FloatSingleButton, Object.assign({}, props)),
        react_1.default.createElement(Styled.MarginBottomHasFooter, { backgroundColor: marginBottomHasFooterBackgroundColor }))) : (react_1.default.createElement(Styled.ButtonWrapperInPc, null,
        props.underlineText && (react_1.default.createElement(react_1.default.Fragment, null,
            react_1.default.createElement(__1.UnderLineMiniButton, { size: "m", colorType: "gray", disabled: props.underlineDisabled, onClick: props.underlineOnClick }, props.underlineText),
            react_1.default.createElement(Spacing_1.Spacing, { spaceNumber: 25 }))),
        react_1.default.createElement(__1.SingleButton, Object.assign({}, props), props.children)))));
};
exports.SingleButtonComp = SingleButtonComp;
const SingleATagComp = (_a) => {
    var { target = '_blank' } = _a, props = __rest(_a, ["target"]);
    return (react_1.default.createElement(exports.StickBottomWrapperComp, null,
        react_1.default.createElement(Styled.ATagButton, { href: props.openUrl, target: target, rel: "noreferrer", onClick: props.onClick },
            react_1.default.createElement(__1.SingleButton, { disabled: props.disabled, colorType: props.colorType, purpose: props.purpose }, props.children))));
};
exports.SingleATagComp = SingleATagComp;
const DoubleButtonComp = (props) => {
    const isMobile = (0, hooks_1.useLayoutIsMobile)();
    return (react_1.default.createElement(react_1.default.Fragment, null, isMobile ? (react_1.default.createElement(react_1.default.Fragment, null,
        react_1.default.createElement(FloatDoubleButton_1.FloatDoubleButton, Object.assign({}, props)),
        react_1.default.createElement(Styled.MarginBottomHasFooter, null))) : (react_1.default.createElement(Styled.ButtonWrapperInPc, null,
        props.underlineText && (react_1.default.createElement(react_1.default.Fragment, null,
            react_1.default.createElement(__1.UnderLineMiniButton, { size: "m", colorType: "gray", disabled: props.underlineDisabled, onClick: props.underlineOnClick }, props.underlineText),
            react_1.default.createElement(Spacing_1.Spacing, { spaceNumber: 25 }))),
        react_1.default.createElement(__1.DoubleButton, Object.assign({}, props))))));
};
exports.DoubleButtonComp = DoubleButtonComp;
const SingleButtonWithTooltipComp = (props) => {
    return (react_1.default.createElement(exports.StickBottomWrapperComp, null, props.tooltip ? (react_1.default.createElement(components_1.ImpactTooltip, Object.assign({}, props.tooltip, { isChildrenFullWidth: true }),
        react_1.default.createElement(__1.SingleButton, Object.assign({}, props)))) : (react_1.default.createElement(__1.SingleButton, Object.assign({}, props)))));
};
exports.SingleButtonWithTooltipComp = SingleButtonWithTooltipComp;
const SingleButtonWithInformationIconComp = (props) => {
    return (react_1.default.createElement(exports.StickBottomWrapperComp, null,
        react_1.default.createElement(Styled.InformationIconWrapper, null,
            react_1.default.createElement(Icon_1.InformationFillIcon, null),
            react_1.default.createElement(core_1.BaseTypography, { md: "Title3", color: core_1.basicColors.gray400 }, props.infoText)),
        react_1.default.createElement(Spacing_1.Spacing, { spaceNumber: 30 }),
        react_1.default.createElement(__1.SingleButton, Object.assign({}, props))));
};
exports.SingleButtonWithInformationIconComp = SingleButtonWithInformationIconComp;
const StickBottomWrapperComp = ({ children }) => {
    const isMobile = (0, hooks_1.useLayoutIsMobile)();
    return (react_1.default.createElement(react_1.default.Fragment, null,
        isMobile && react_1.default.createElement(Styled.MarginBottomHasFooter, null),
        react_1.default.createElement(Styled.StickBottomWrapper, null, children)));
};
exports.StickBottomWrapperComp = StickBottomWrapperComp;
