(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 i, toRef as m, useModel as C, computed as p, createElementBlock as d, openBlock as f, createVNode as n, unref as v, normalizeClass as r, withCtx as $, 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 _ from "./ExpandTransition.vue2.js";

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