'use strict';

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

const index$1 = require('./index-df541290.js');
const index = require('./index-b7493032.js');
require('./_commonjsHelpers-10109b76.js');

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

function create(language) {
  return index.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) {
    index$1.registerInstance(this, hostRef);
    this.checked = index$1.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 [
      index$1.h("smoothly-icon", { toolTip: this.t(this.selectAll ? "Deselect all" : "Deselect"), onClick: () => this.toggle(), style: { display: this.selected ? "" : "none" }, name: "checkbox-outline" }),
      index$1.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 index$1.getElement(this); }
};
SmoothlyCheckbox.style = styleCss;

exports.smoothly_checkbox = SmoothlyCheckbox;
