(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".expand-collapse-fix{overflow:hidden}.expand-collapse-enter-active,.expand-collapse-leave-active{transition:height .2s ease-in-out,opacity .2s ease-in-out;height:var(--component-height)}.expand-collapse-enter-from,.expand-collapse-leave-to{opacity:.5;height:0}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
import { defineComponent as V, mergeModels as k, inject as m, toRef as d, useModel as C, computed as p, createElementBlock as f, openBlock as v, createVNode as r, unref as $, normalizeClass as s, withCtx as y, createTextVNode as M, toDisplayString as S, createCommentVNode as g, renderSlot as h } from "vue";
import { uniqueId as B } from "@milaboratories/helpers";
import N from "../PlIcon16/PlIcon16.vue.js";
import P from "../PlSectionSeparator/PlSectionSeparator.vue.js";
import b from "./ExpandTransition.vue2.js";

const w = { class: "pl-accordion-section" }, R = /* @__PURE__ */ V({
  __name: "PlAccordionSection",
  props: /* @__PURE__ */ k({
    label: {},
    compact: { type: Boolean }
  }, {
    modelValue: { type: Boolean },
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(t) {
    const o = m("pl-accordion-model", () => d(""), !0), c = m("pl-accordion-props", () => d({ multiple: !1 }), !0), a = C(t, "modelValue"), n = B(), u = p(() => !c || c.value.multiple), l = p({
      get() {
        return u.value ? a.value : o ? o.value === n : a.value;
      },
      set(e) {
        u.value ? a.value = e : o && (o.value = o.value === n ? "" : n);
      }
    });
    return (e, i) => (v(), f("div", w, [
      r($(P), {
        class: s(e.$style.separator),
        compact: t.compact,
        onClick: i[0] || (i[0] = (I) => l.value = !l.value)
      }, {
        default: y(() => [
          r($(N), {
            name: "chevron-right",
            class: s([{ [e.$style.down]: l.value }, e.$style.chevron])
          }, null, 8, ["class"]),
          M(" " + S(t.label), 1)
        ]),
        _: 1
      }, 8, ["class", "compact"]),
      r(b, null, {
        default: y(() => [
          l.value ? (v(), f("div", {
            key: 0,
            class: s(e.$style.content)
          }, [
            h(e.$slots, "default")
          ], 2)) : g("", !0)
        ]),
        _: 3
      })
    ]));
  }
});
export {
  R as default
};
//# sourceMappingURL=PlAccordionSection.vue2.js.map
