import { r as registerInstance, j as createEvent, h, g as getElement } from './index-07845439.js';
import { d as dist } from './index-63517df5.js';
import './_commonjsHelpers-8fe71198.js';

const sv = {
  "Select all": "Markera alla",
  "Deselect all": "Avmarkera alla",
  Select: "Markera",
  Deselect: "Avmarkera",
};

function create(language) {
  return dist.create({
    sv,
  }, language);
}

const styleCss = ".sc-smoothly-checkbox-h{display:block}[hidden].sc-smoothly-checkbox-h{display:none}smoothly-icon.sc-smoothly-checkbox{cursor:pointer}[disabled].sc-smoothly-checkbox-h smoothly-icon.sc-smoothly-checkbox{stroke:rgba(var(--smoothly-color-contrast), 0.3)}";

const SmoothlyCheckbox = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.checked = createEvent(this, "checked", 7);
    this.selectAll = false;
  }
  componentWillLoad() {
    this.t = create(this.element);
  }
  toggle() {
    if (!this.disabled) {
      this.selected = !this.selected;
      this.checked.emit({ selected: this.selected });
    }
  }
  render() {
    return [
      h("smoothly-icon", { toolTip: this.t(this.selectAll ? "Deselect all" : "Deselect"), onClick: () => this.toggle(), style: { display: this.selected ? "" : "none" }, name: "checkbox-outline" }),
      h("smoothly-icon", { toolTip: this.t(this.selectAll ? "Select all" : "Select"), onClick: () => this.toggle(), style: { display: !this.selected ? "" : "none" }, name: "square-outline" }),
    ];
  }
  get element() { return getElement(this); }
};
SmoothlyCheckbox.style = styleCss;

export { SmoothlyCheckbox as smoothly_checkbox };
