'use client';
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var tslib = require('tslib');
var lit = require('lit');
var decorators_js = require('lit/decorators.js');
var classMap_js = require('lit/directives/class-map.js');
var sgdsLink = require('../Link/sgds-link.cjs.js');
var sgdsElement = require('../../base/sgds-element.cjs.js');
var slot = require('../../utils/slot.cjs.js');
var footer = require('./footer.cjs.js');

/**
 * @summary The footer contains supporting information for your service at the bottom of your website. All .gov.sg digital services shall contain a Global Footer Bar across all pages. The Global Footer Bar should include the name of the digital service, contact information, a privacy statement and the terms of use.
 *
 * @slot default - The slot for footer content. Use this slot if you want full control over the layout or styling. When provided, it replaces the `items` slot layout.
 * @slot title - The slot for title
 * @slot description - The slot for description
 * @slot items - the slot for the list of footer items, styled automatically with `.footer-items`. For custom layouts or styles, use the `default` slot instead.
 */
class SgdsFooter extends sgdsElement["default"] {
    constructor() {
        super(...arguments);
        /** Sets copyrightLiner of SgdsFooter */
        this.copyrightLiner = "Government of Singapore";
        /**	href link for contacts */
        this.contactHref = "#";
        /**	href link for feedback */
        this.feedbackHref = "#";
        /**	href link for faq (optional) */
        this.faqHref = "";
        /**	href link for sitemap (optional) */
        this.sitemapHref = "";
        /**	href link for privacy statement */
        this.privacyHref = "#";
        /**	href link for terms of use */
        this.termsOfUseHref = "#";
        /** Used only for SSR to indicate the presence of the `default` slot. */
        this.hasDefaultSlot = false;
        /** Used only for SSR to indicate the presence of the `title` slot. */
        this.hasTitleSlot = false;
        /** Used only for SSR to indicate the presence of the `description` slot. */
        this.hasDescriptionSlot = false;
        /** Used only for SSR to indicate the presence of the `items` slot. */
        this.hasItemsSlot = false;
        this.hasSlotController = new slot.HasSlotController(this, "[default]", "title", "description", "items");
    }
    updated() {
        if (!this.hasDefaultSlot)
            this.hasDefaultSlot = this.hasSlotController.test("[default]");
        if (!this.hasTitleSlot)
            this.hasTitleSlot = this.hasSlotController.test("title");
        if (!this.hasDescriptionSlot)
            this.hasDescriptionSlot = this.hasSlotController.test("description");
        if (!this.hasItemsSlot)
            this.hasItemsSlot = this.hasSlotController.test("items");
    }
    render() {
        return lit.html `
      <footer class="footer">
        <section
          class="${classMap_js.classMap({
            "footer-top": this.hasDefaultSlot || this.hasTitleSlot || this.hasDescriptionSlot || this.hasItemsSlot,
            "has-content": this.hasDefaultSlot || this.hasItemsSlot
        })}"
        >
          <div class="footer-header">
            <slot name="title"></slot>
            <slot name="description"></slot>
          </div>
          <div>
            ${this.hasDefaultSlot
            ? lit.html `<slot></slot>`
            : lit.html `
                  <div class="footer-items">
                    <slot name="items"></slot>
                  </div>
                `}
          </div>
        </section>
        <section class="footer-bottom">
          <div class="footer-mandatory-links">
            <ul>
              <li>
                <sgds-link size="sm" tone="fixed-light"><a href=${this.contactHref}>Contact</a></sgds-link>
              </li>
              <li>
                <sgds-link size="sm" tone="fixed-light"><a href=${this.feedbackHref}>Feedback</a></sgds-link>
              </li>
              ${this.faqHref
            ? lit.html `<li>
                    <sgds-link size="sm" tone="fixed-light"><a href=${this.faqHref}>FAQ</a></sgds-link>
                  </li>`
            : lit.nothing}
              ${this.sitemapHref
            ? lit.html `<li>
                    <sgds-link size="sm" tone="fixed-light"><a href=${this.sitemapHref}>Sitemap</a></sgds-link>
                  </li>`
            : lit.nothing}
              <li>
                <sgds-link size="sm" tone="fixed-light">
                  <a href="https://tech.gov.sg/report_vulnerability" target="_blank" rel="noopener noreferrer">
                    Report Vulnerability
                  </a>
                </sgds-link>
              </li>
              <li>
                <sgds-link size="sm" tone="fixed-light"><a href=${this.privacyHref}>Privacy Statement</a></sgds-link>
              </li>
              <li>
                <sgds-link size="sm" tone="fixed-light"><a href=${this.termsOfUseHref}>Terms of use</a></sgds-link>
              </li>
            </ul>
            <div class="footer-copyrights">© ${new Date().getFullYear()}, ${this.copyrightLiner}</div>
          </div>
        </section>
      </footer>
    `;
    }
}
SgdsFooter.styles = [...sgdsElement["default"].styles, footer["default"]];
/** @internal */
SgdsFooter.dependencies = {
    "sgds-link": sgdsLink.SgdsLink
};
tslib.__decorate([
    decorators_js.property({ type: String })
], SgdsFooter.prototype, "copyrightLiner", void 0);
tslib.__decorate([
    decorators_js.property({ type: String })
], SgdsFooter.prototype, "contactHref", void 0);
tslib.__decorate([
    decorators_js.property({ type: String })
], SgdsFooter.prototype, "feedbackHref", void 0);
tslib.__decorate([
    decorators_js.property({ type: String })
], SgdsFooter.prototype, "faqHref", void 0);
tslib.__decorate([
    decorators_js.property({ type: String })
], SgdsFooter.prototype, "sitemapHref", void 0);
tslib.__decorate([
    decorators_js.property({ type: String })
], SgdsFooter.prototype, "privacyHref", void 0);
tslib.__decorate([
    decorators_js.property({ type: String })
], SgdsFooter.prototype, "termsOfUseHref", void 0);
tslib.__decorate([
    decorators_js.property({ type: Boolean })
], SgdsFooter.prototype, "hasDefaultSlot", void 0);
tslib.__decorate([
    decorators_js.property({ type: Boolean })
], SgdsFooter.prototype, "hasTitleSlot", void 0);
tslib.__decorate([
    decorators_js.property({ type: Boolean })
], SgdsFooter.prototype, "hasDescriptionSlot", void 0);
tslib.__decorate([
    decorators_js.property({ type: Boolean })
], SgdsFooter.prototype, "hasItemsSlot", void 0);

exports.SgdsFooter = SgdsFooter;
exports["default"] = SgdsFooter;
//# sourceMappingURL=sgds-footer.cjs.js.map
