import { r as u, e as o, s as c, u as m, y as d, a as g, g as v } from "./base-472fc154.js";
const b = `.sil-select{font-family:inherit;position:relative;display:flex;flex-direction:column-reverse}.sil-select,.sil-select *{box-sizing:border-box}.sil-select__input{background-color:var(--input-field--background-color, var(--background, transparent));border-radius:var(--border-radius-top-left, var(--input-field--border-radius, var(--border-radius, .25em))) var(--border-radius-top-right, var(--input-field--border-radius, var(--border-radius, .25em))) var(--border-radius-bottom-left, var(--input-field--border-radius, var(--border-radius, .25em))) var(--border-radius-bottom-right, var(--input-field--border-radius, var(--border-radius, .25em)));position:relative;border:2px solid var(--input-field--border-color, rgba(var(--foreground-r), var(--foreground-g), var(--foreground-b), .25))}.sil-select__input:has(:focus){outline:none;border-color:rgba(var(--primary-r),var(--primary-g),var(--primary-b),.5)}.sil-select__control{width:100%;padding:var(--input-field--padding, 1em);font-family:var(--input-field--font-family, .75em 1em);font-size:1em;border:none;color:var(--input-field--text-color, var(--foreground, #fff));background-color:transparent}.sil-select__control:focus{outline:none;border-color:rgba(var(--primary-r),var(--primary-g),var(--primary-b),.5)}.sil-select__input:before{content:"";aspect-ratio:1/1;height:100%;position:absolute;right:0;top:0;mask-image:url("data:image/svg+xml,%3Csvg version='1.1'  xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' fill='\${color}' viewBox='0 0 72 72' style='enable-background:new 0 0 72 72;' xml:space='preserve'%3E%3Cg%3E%3Cpolygon points='36,54 6.2,24.2 11.8,18.5 36,42.7 60.2,18.5 65.8,24.2 '/%3E%3C/g%3E%3C/svg%3E%0A");mask-position:center center;mask-size:1em 1em;mask-repeat:no-repeat;-webkit-mask-image:url("data:image/svg+xml,%3Csvg version='1.1'  xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' fill='\${color}' viewBox='0 0 72 72' style='enable-background:new 0 0 72 72;' xml:space='preserve'%3E%3Cg%3E%3Cpolygon points='36,54 6.2,24.2 11.8,18.5 36,42.7 60.2,18.5 65.8,24.2 '/%3E%3C/g%3E%3C/svg%3E%0A");-webkit-mask-position:center center;-webkit-mask-size:1em 1em;-webkit-mask-repeat:no-repeat;background-color:#fff}.sil-select__control{-webkit-appearance:none;-moz-appearance:none;appearance:none}.sil-select__label{padding:var(--input-field--label-padding, var(--input-field--padding, .75em 0em))}.sil-select__preview{padding:var(--input-field--preview-opacity, .5)}
`;
var f = Object.defineProperty, w = Object.getOwnPropertyDescriptor, i = (e, a, s, l) => {
  for (var t = l > 1 ? void 0 : l ? w(a, s) : a, n = e.length - 1, p; n >= 0; n--)
    (p = e[n]) && (t = (l ? p(a, s, t) : p(t)) || t);
  return l && t && f(a, s, t), t;
};
let r = class extends c {
  constructor() {
    super(...arguments), this.label = "", this.value = "", this.required = !1, this.preview = !1, this.items = [{ name: "", value: "" }];
  }
  handleChange(e) {
    this.value = e.target.value;
  }
  render() {
    const e = m(v("select"));
    return d`
      <div class="${e()}">
        ${this.preview ? `<div class="${e("preview")}">${this.value}</div>` : null}
        <div class="${e("input")}">
          <select
            class="${e("control")}"
            value="${this.value}"
            @change="${this.handleChange}"
          >
            ${this.items.map(
      (a) => d`<option value="${a.value}">${a.name}</option>`
    )}
          </select>
        </div>
        <label class="${e("label")}">${this.label}</label>
      </div>
    `;
  }
};
r.styles = u(b);
i([
  o({ type: String })
], r.prototype, "label", 2);
i([
  o({ type: String })
], r.prototype, "value", 2);
i([
  o({ type: Boolean })
], r.prototype, "required", 2);
i([
  o({ type: Boolean })
], r.prototype, "preview", 2);
i([
  o({ type: Array })
], r.prototype, "items", 2);
r = i([
  g(v("select"))
], r);
export {
  r as SelectField
};
