import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
import { o as openWormhole } from './consumer.js';

const scCardCss = ":host{display:block;--overflow:visible}.card{font-family:var(--sc-font-sans);overflow:var(--overflow)}.card:not(.card--borderless){padding:var(--sc-spacing-large);background:var(--sc-color-white);border:1px solid var(--sc-color-gray-300);border-radius:var(--sc-input-border-radius-medium);box-shadow:var(--sc-shadow-small)}.card:not(.card--borderless).card--no-padding{padding:0}.title--divider{display:none}.card--has-title-slot .card--title{font-weight:var(--sc-font-weight-bold);line-height:var(--sc-line-height-dense)}.card--has-title-slot .title--divider{display:block}::slotted(*){margin-bottom:var(--sc-form-row-spacing)}::slotted(*:first-child){margin-top:0}::slotted(*:last-child){margin-bottom:0 !important}";

const ScCard = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
  constructor() {
    super();
    this.__registerHost();
    this.__attachShadow();
  }
  componentWillLoad() {
    this.handleSlotChange();
  }
  handleSlotChange() {
    this.hasTitleSlot = !!this.el.querySelector('[slot="title"]');
  }
  render() {
    return (h("div", { part: "base", class: {
        'card': true,
        'card--borderless': this.borderless,
        'card--no-padding': this.noPadding,
        // 'card--has-title-slot': this.hasTitleSlot,
      } }, h("slot", null)));
  }
  get el() { return this; }
  static get style() { return scCardCss; }
}, [1, "sc-card", {
    "noDivider": [4, "no-divider"],
    "borderless": [4],
    "noPadding": [4, "no-padding"],
    "loading": [4],
    "hasTitleSlot": [32]
  }]);
openWormhole(ScCard, ['loading'], false);
function defineCustomElement() {
  if (typeof customElements === "undefined") {
    return;
  }
  const components = ["sc-card"];
  components.forEach(tagName => { switch (tagName) {
    case "sc-card":
      if (!customElements.get(tagName)) {
        customElements.define(tagName, ScCard);
      }
      break;
  } });
}
defineCustomElement();

export { ScCard as S, defineCustomElement as d };
