(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".pl-checkbox-group{--color-label: var(--color-text);--cursor-label: pointer;display:flex;flex-direction:column;font-family:var(--font-family-base)}.pl-checkbox-group.disabled{--color-label: var(--color-dis-01);--cursor-label: default;pointer-events:none}.pl-checkbox-group>label{color:var(--color-label);cursor:var(--cursor-label);display:flex;align-items:center;gap:4px;margin-bottom:6px;font-size:14px;font-weight:600;line-height:20px}.pl-checkbox-group>div{height:32px;display:flex;flex-direction:row;align-items:center;gap:8px}.pl-checkbox-group>div>label{font-size:14px;font-weight:500}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
import { defineComponent as _, useSlots as k, createElementBlock as a, openBlock as o, normalizeClass as h, createCommentVNode as i, createElementVNode as r, createBlock as v, toDisplayString as u, unref as m, withCtx as C, renderSlot as y, Fragment as B, renderList as g, createVNode as N, withModifiers as S } from "vue";

import $ from "../PlCheckbox/PlCheckboxBase.vue.js";
import w from "../PlTooltip/PlTooltip.vue.js";
const E = { key: 0 }, M = ["onClick"], U = {
  name: "PlCheckboxGroup"
}, L = /* @__PURE__ */ _({
  ...U,
  props: {
    modelValue: {},
    label: {},
    options: {},
    disabled: { type: Boolean }
  },
  emits: ["update:modelValue"],
  setup(p, { emit: c }) {
    const b = k(), f = c, s = p, n = (e) => s.modelValue.includes(e), d = (e) => {
      const t = s.modelValue ?? [];
      f("update:modelValue", n(e) ? t.filter((l) => l !== e) : [...t, e]);
    };
    return (e, t) => (o(), a("div", {
      class: h(["pl-checkbox-group", { disabled: e.disabled }])
    }, [
      e.label ? (o(), a("label", E, [
        r("span", null, u(e.label), 1),
        m(b).tooltip ? (o(), v(m(w), {
          key: 0,
          class: "info",
          position: "top"
        }, {
          tooltip: C(() => [
            y(e.$slots, "tooltip")
          ]),
          _: 3
        })) : i("", !0)
      ])) : i("", !0),
      (o(!0), a(B, null, g(e.options.map((l) => ({ label: "label" in l ? l.label : l.text, value: l.value })), (l, V) => (o(), a("div", { key: V }, [
        N($, {
          disabled: e.disabled,
          label: l.label,
          "model-value": n(l.value),
          "onUpdate:modelValue": () => d(l.value)
        }, null, 8, ["disabled", "label", "model-value", "onUpdate:modelValue"]),
        r("label", {
          onClick: S(() => d(l.value), ["stop"])
        }, u(l.label), 9, M)
      ]))), 128))
    ], 2));
  }
});
export {
  L as default
};
//# sourceMappingURL=PlCheckboxGroup.vue.js.map
