import { r as registerInstance, h, g as getElement } from './index-148a7577.js';
import { k as FormReceiptVariation, j as FormReceiptType, i as FormReceiptHeadingLevel } from './typography-variation.enum-531cdf64.js';
import './badge-notification-shape.enum-e15a6245.js';
import './badge-status-variation.enum-8d6370ff.js';
import './code-example-variation.enum-e656d235.js';
import './form-input-search-variation.enum-6d8dc10a.js';
import './button-variation.enum-94fffdd6.js';
import './calendar-week-view-heading-level.enum-6774297c.js';
import './code-variation.enum-1eee7c7a.js';
import './expandable-accordion-header-level.enum-85681e2f.js';
import './expandable-faq-item-variation.enum-a8cb225b.js';
import './expandable-faq-variation.enum-6934c367.js';
import './footer-card-variation.enum-cc732148.js';
import './form-checkbox-variation.enum-83e906fc.js';
import './form-file-upload-variation.enum-9c49ec5e.js';
import './form-input-type.enum-3da3db27.js';
import './form-input-variation.enum-64d9450f.js';
import './form-select-variation.enum-f2f6098d.js';
import './form-textarea-variation.enum-05017e8e.js';
import './form-validation-message-variation.enum-bcef8a9d.js';
import './info-card-multi-type.enum-07ee124f.js';
import './info-card-variation.enum-2ccc52c1.js';
import { L as LayoutBlockVariation } from './layout-block-variation.enum-b7a20db4.js';
import './layout-columns-variation.enum-34f7754e.js';
import './link-button-variation.enum-84d4976f.js';
import './list-type.enum-fbb331ad.js';
import './loader-skeleton-variation.enum-f9f867b4.js';
import './loader-spinner-size.enum-0b246fa0.js';
import './logo-variation.enum-5b68b79f.js';
import './media-figure-alignment.enum-a1d36567.js';
import './navigation-sidebar-variation.enum-8fead764.js';
import './progress-indicator-variation.enum-b12ba50a.js';
import './progress-list-item-variation.enum-384b9a3a.js';
import './progress-list-variation.enum-300bd89d.js';
import './progressbar-variation.enum-40adaab4.js';
import './quote-image-inner-position.enum-8e9b1e65.js';
import './table-variation.enum-dd9366b6.js';
import './tag-media-icon.enum-fefa191c.js';
import './tag-size.enum-403e0cd8.js';
import './tools-feedback-banner-type.enum-74b4e580.js';
import './tools-feedback-rating-variation.enum-29058ff2.js';
import './tools-theme-provider.brand.enum-8c5a98c9.js';
import './typography-heading-jumbo-variation.enum-eb737f1b.js';
import './typography-meta-variation.enum-1f7c2878.js';
import './typography-time-variation.enum-34c830ef.js';
import './util-breakpoint-observer-breakpoints.enum-6d004731.js';

const formReceiptCss = ".sc-digi-form-receipt-h{--digi--receipt--background-color:var(--digi--color--background--pop-out);--digi--receipt--margin:var(--digi--padding--small);--digi--receipt--padding-top:var(--digi--padding--large);--digi--receipt--padding-bottom:var(--digi--padding--largest);--digi--receipt--padding-top--desktop:var(--digi--padding--largest-2);--digi--receipt--padding-bottom--desktop:var(--digi--padding--largest-3);--digi--receipt--padding-horizontal:var(--digi--padding--medium);--digi--receipt--heading--color:var(--digi--color--text--primary);--digi--receipt--heading--font-size:var(--digi--typography--heading-2--font-size--mobile);--digi--receipt--heading--font-size--desktop:var(--digi--typography--heading-1--font-size--desktop-large);--digi--receipt--heading--font-weight:var(--digi--typography--heading-2--font-weight--mobile);--digi--receipt--heading--font-weight--desktop:var(--digi--typography--heading-1--font-weight--desktop);--digi--receipt--heading--font-family:var(--digi--global--typography--font-family--default)}.sc-digi-form-receipt-h .digi-form-receipt.sc-digi-form-receipt{background-color:var(--digi--receipt--background-color);display:grid;padding-top:var(--digi--receipt--padding-top);padding-bottom:var(--digi--receipt--padding-bottom)}@media (min-width: 61.9375rem){.sc-digi-form-receipt-h .digi-form-receipt.sc-digi-form-receipt{padding-top:var(--digi--receipt--padding-top--desktop);padding-bottom:var(--digi--receipt--padding-bottom--desktop)}}.sc-digi-form-receipt-h .digi-form-receipt--grid.sc-digi-form-receipt{padding-left:var(--digi--receipt--padding-horizontal);padding-right:var(--digi--receipt--padding-horizontal)}.sc-digi-form-receipt-h .digi-form-receipt--center.sc-digi-form-receipt .digi-form-receipt__content.sc-digi-form-receipt{display:flex;flex-direction:column;align-items:center}.sc-digi-form-receipt-h .digi-form-receipt__content.sc-digi-form-receipt{grid-column:1;grid-row:1}.sc-digi-form-receipt-h .digi-form-receipt__body.sc-digi-form-receipt{display:flex;flex-direction:column}.sc-digi-form-receipt-h .digi-form-receipt__heading.sc-digi-form-receipt{font-family:var(--digi--receipt--heading--font-family);font-size:var(--digi--receipt--heading--font-size);font-weight:var(--digi--receipt--heading--font-weight);margin-top:0;margin-bottom:0;display:block;color:var(--digi--receipt--heading--color)}@media (min-width: 61.9375rem){.sc-digi-form-receipt-h .digi-form-receipt__heading.sc-digi-form-receipt{font-size:var(--digi--receipt--heading--font-size--desktop);font-weight:var(--digi--receipt--heading--font-weight--desktop)}}.sc-digi-form-receipt-h .digi-form-receipt__icon.sc-digi-form-receipt{width:2.125rem;height:1.75rem;margin-bottom:var(--digi--receipt--margin)}@media (min-width: 61.9375rem){.sc-digi-form-receipt-h .digi-form-receipt__icon.sc-digi-form-receipt{width:2.75rem;height:2.25rem}}.sc-digi-form-receipt-h .digi-form-receipt__infographic-primary.sc-digi-form-receipt{fill:var(--digi--color--infographic--brand--primary)}.sc-digi-form-receipt-h .digi-form-receipt__slot-wrapper.sc-digi-form-receipt{display:flex;flex-direction:column;gap:1rem}.sc-digi-form-receipt-h .digi-form-receipt__slot-wrapper-has-content.sc-digi-form-receipt{padding-top:1.5rem}.sc-digi-form-receipt-s .digi-form-receipt__slot-wrapper-center-text{text-align:center}";
const DigiFormReceiptStyle0 = formReceiptCss;

const FormReceipt = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.afText = '';
        this.afVariation = FormReceiptVariation.FULLWIDTH;
        this.afType = FormReceiptType.CENTER;
        this.afHeadingLevel = FormReceiptHeadingLevel.H2;
        this.hasDefaultSlot = false;
    }
    componentDidLoad() {
        this.checkSlotContent();
    }
    checkSlotContent() {
        var _a;
        const slotWrapper = (_a = this.hostElement) === null || _a === void 0 ? void 0 : _a.querySelector('.digi-form-receipt__slot-wrapper');
        if (!slotWrapper)
            return;
        this.hasDefaultSlot = slotWrapper.innerHTML.trim() !== '';
        if (this.afType === FormReceiptType.CENTER) {
            const typographyElements = slotWrapper.querySelectorAll(':scope > .hydrated');
            const buttonElements = slotWrapper.querySelectorAll(':scope > .sc-digi-button-h');
            buttonElements.forEach((element) => {
                element.classList.add('digi-form-receipt__slot-wrapper-center-text');
            });
            typographyElements.forEach((element) => {
                const typography = element.querySelector(':scope > .digi-typography');
                if (typography) {
                    typography.classList.add('digi-form-receipt__slot-wrapper-center-text');
                }
            });
        }
    }
    get cssModifiers() {
        return {
            'digi-form-receipt--fullwidth': this.afVariation === FormReceiptVariation.FULLWIDTH,
            'digi-form-receipt--grid': this.afVariation === FormReceiptVariation.GRID,
            'digi-form-receipt--center': this.afType === FormReceiptType.CENTER,
            'digi-form-receipt--start': this.afType === FormReceiptType.START
        };
    }
    get slotContent() {
        return (h("div", { class: {
                'digi-form-receipt__slot-wrapper': true,
                'digi-form-receipt__slot-wrapper-has-content': this.hasDefaultSlot
            } }, h("slot", null)));
    }
    get content() {
        return (h("div", { class: "digi-form-receipt__content" }, h("svg", { class: "digi-form-receipt__icon", "aria-hidden": "true", version: "1.1", viewBox: "0 0 35 29" }, h("title", null, "Check mark"), h("g", { fill: "none", "fill-rule": "evenodd" }, h("g", { transform: "translate(-170 -32)" }, h("g", { transform: "translate(170 32.325)" }, h("g", { transform: "translate(0 .77495)" }, h("mask", { id: "b", fill: "white" }, h("polygon", { points: "0 0 26.685 0 26.685 27.689 0 27.689" })), h("path", { d: "m13.711 27.689c-7.5602 0-13.711-6.2103-13.711-13.844 0-7.6345 6.151-13.845 13.711-13.845 3.1693 0 6.2611 1.1179 8.7048 3.1478l-1.5894 1.9509c-1.9972-1.6592-4.5241-2.5724-7.1155-2.5724-6.181 0-11.209 5.0773-11.209 11.319 0 6.2406 5.0283 11.318 11.209 11.318 4.7924 0 9.0551-3.0733 10.607-7.6478l2.3668 0.81853c-1.8983 5.5958-7.1124 9.3556-12.974 9.3556", fill: "#333", mask: "url(#b)" })), h("g", { transform: "translate(4.2177)" }, h("mask", { id: "a", fill: "white" }, h("polygon", { points: "0 0 30.425 0 30.425 23.496 0 23.496" })), h("path", { class: "digi-form-receipt__infographic-primary", d: "m30.191 3.2545-19.95 20.007c-0.31227 0.31253-0.81758 0.31253-1.1292 0l-8.878-8.9033c-0.31164-0.31316-0.31164-0.81992 0-1.1324l1.8818-1.8878c0.31164-0.31253 0.81758-0.31253 1.1292 0l6.4315 6.4499 17.504-17.553c0.31164-0.31316 0.81695-0.31316 1.1292 0l1.8818 1.8872c0.31164 0.31253 0.31164 0.81929 0 1.1324", fill: "#95C13E", mask: "url(#a)" })))))), h(this.afHeadingLevel, { class: "digi-form-receipt__heading", tabIndex: -1 }, this.afText), this.slotContent));
    }
    render() {
        return (h("div", { key: 'd202410625db1ed892a364374b1516df522df2f6', class: Object.assign({ 'digi-form-receipt': true }, this.cssModifiers) }, this.afVariation === FormReceiptVariation.FULLWIDTH ? (h("digi-layout-block", { afVariation: LayoutBlockVariation.TRANSPARENT }, this.content)) : (this.content)));
    }
    get hostElement() { return getElement(this); }
};
FormReceipt.style = DigiFormReceiptStyle0;

export { FormReceipt as digi_form_receipt };
