/*!
 * Built by ShiftSoftware
 * Copyright (c)
 */
import { h } from "@stencil/core";
import StatusCard from "./StatusCard";
import RejectIcon from "~assets/x-mark.svg";
import cn from "../../../global/lib/cn";
export default function CardsContainer({ isLoading, vehicleInformation, isAuthorized, unInvoicedByBrokerName, warrantyLocale }) {
    var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
    return (h("div", { class: "tags-container mx-auto" }, h("flexible-container", { isOpened: !vehicleInformation || !!((_a = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.saleInformation) === null || _a === void 0 ? void 0 : _a.companyName) }, h("div", { class: !(!vehicleInformation || !!((_b = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.saleInformation) === null || _b === void 0 ? void 0 : _b.companyName)) && 'loading', style: { paddingBottom: '12px' } }, h("div", { class: "shift-skeleton !rounded-[4px]" }, h("div", { class: "card warning-card" }, h("p", { class: "no-padding flex gap-2" }, h("span", { class: "font-semibold" }, warrantyLocale.dealer, ":"), " ", ((_c = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.saleInformation) === null || _c === void 0 ? void 0 : _c.companyName) || '', ' ', ((_d = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.saleInformation) === null || _d === void 0 ? void 0 : _d.countryName) && `(${(_e = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.saleInformation) === null || _e === void 0 ? void 0 : _e.countryName})`))))), h("flexible-container", { classes: cn({ loading: isLoading || !unInvoicedByBrokerName }), isOpened: !!unInvoicedByBrokerName }, h("div", { style: { paddingBottom: '12px' } }, h("div", { class: "shift-skeleton" }, h("div", { class: "card warning-card" }, h("img", { src: RejectIcon }), h("p", null, unInvoicedByBrokerName ? warrantyLocale.notInvoiced + unInvoicedByBrokerName : ''))))), h("div", { class: "warranty-tags" }, h(StatusCard, { state: vehicleInformation ? (isAuthorized ? 'success' : 'reject') : 'idle', desc: vehicleInformation ? (isAuthorized ? warrantyLocale.authorized : warrantyLocale.unauthorized) : '' }), h(StatusCard, { state: vehicleInformation ? (((_f = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.warranty) === null || _f === void 0 ? void 0 : _f.hasActiveWarranty) ? 'success' : 'reject') : 'idle', desc: vehicleInformation ? (((_g = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.warranty) === null || _g === void 0 ? void 0 : _g.hasActiveWarranty) ? warrantyLocale.activeWarranty : warrantyLocale.notActiveWarranty) : '' }), h(StatusCard, { from: true, icon: false, fromDesc: warrantyLocale.from, desc: ((_h = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.warranty) === null || _h === void 0 ? void 0 : _h.warrantyStartDate) || '', opened: !!((_j = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.warranty) === null || _j === void 0 ? void 0 : _j.warrantyStartDate) || !vehicleInformation, state: !!vehicleInformation ? (((_k = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.warranty) === null || _k === void 0 ? void 0 : _k.hasActiveWarranty) ? 'success' : 'reject') : 'idle' }), h(StatusCard, { to: true, icon: false, toDesc: warrantyLocale.to, desc: ((_l = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.warranty) === null || _l === void 0 ? void 0 : _l.warrantyEndDate) || '', opened: !!((_m = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.warranty) === null || _m === void 0 ? void 0 : _m.warrantyEndDate) || !vehicleInformation, state: !!vehicleInformation ? (((_o = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.warranty) === null || _o === void 0 ? void 0 : _o.hasActiveWarranty) ? 'success' : 'reject') : 'idle' }), h(StatusCard, { from: true, icon: false, fromDesc: warrantyLocale.extendedWarrantyFrom, desc: ((_p = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.warranty) === null || _p === void 0 ? void 0 : _p.extendedWarrantyStartDate) || '', opened: (!!vehicleInformation && !!((_q = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.warranty) === null || _q === void 0 ? void 0 : _q.extendedWarrantyStartDate)), state: (((_r = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.warranty) === null || _r === void 0 ? void 0 : _r.hasExtendedWarranty) ? 'info' : 'reject') }), h(StatusCard, { to: true, icon: false, toDesc: warrantyLocale.extendedWarrantyTo, desc: ((_s = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.warranty) === null || _s === void 0 ? void 0 : _s.extendedWarrantyEndDate) || '', opened: (!!vehicleInformation && !!((_t = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.warranty) === null || _t === void 0 ? void 0 : _t.extendedWarrantyEndDate)), state: (((_u = vehicleInformation === null || vehicleInformation === void 0 ? void 0 : vehicleInformation.warranty) === null || _u === void 0 ? void 0 : _u.hasExtendedWarranty) ? 'info' : 'reject') }))));
}
