import { defineComponent, useAttrs, resolveComponent, createBlock, openBlock, mergeProps, unref, createSlots, renderList, withCtx, renderSlot, normalizeProps, guardReactiveProps, createElementBlock, Fragment, toDisplayString } from 'vue';
import '../../../utils/index.mjs';
import { switchProps } from './switch.mjs';
import { createNamespace } from '../../../utils/create-namespace.mjs';

"use strict";
const _hoisted_1 = { key: 1 };
const _hoisted_2 = { key: 1 };
var _sfc_main = /* @__PURE__ */ defineComponent({
  ...{ name: "LlSwitch" },
  __name: "switch",
  props: switchProps,
  setup(__props) {
    const bem = createNamespace("switch");
    const attrs = useAttrs();
    return (_ctx, _cache) => {
      const _component_ll_icon = resolveComponent("ll-icon");
      const _component_a_switch = resolveComponent("a-switch");
      return openBlock(), createBlock(_component_a_switch, mergeProps(unref(attrs), {
        class: unref(bem).b()
      }), createSlots({
        _: 2
        /* DYNAMIC */
      }, [
        renderList(Object.keys(_ctx.$slots).filter(
          (k) => k !== "checkedChildren" && k !== "unCheckedChildren"
        ), (item) => {
          return {
            name: item,
            fn: withCtx((data) => [
              renderSlot(_ctx.$slots, item, normalizeProps(guardReactiveProps(data || {})))
            ])
          };
        }),
        _ctx.$slots.checkedChildren || _ctx.checkedIcon || _ctx.checkedLabel ? {
          name: "checkedChildren",
          fn: withCtx(() => [
            _ctx.$slots.checkedChildren ? renderSlot(_ctx.$slots, "checkedChildren", { key: 0 }) : (openBlock(), createElementBlock(
              Fragment,
              { key: 1 },
              [
                _ctx.checkedIcon ? (openBlock(), createBlock(_component_ll_icon, {
                  key: 0,
                  "icon-name": _ctx.checkedIcon
                }, null, 8, ["icon-name"])) : (openBlock(), createElementBlock(
                  "span",
                  _hoisted_1,
                  toDisplayString(_ctx.checkedLabel),
                  1
                  /* TEXT */
                ))
              ],
              64
              /* STABLE_FRAGMENT */
            ))
          ]),
          key: "0"
        } : void 0,
        _ctx.$slots.unCheckedChildren || _ctx.unCheckedIcon || _ctx.unCheckedLabel ? {
          name: "unCheckedChildren",
          fn: withCtx(() => [
            _ctx.$slots.unCheckedChildren ? renderSlot(_ctx.$slots, "unCheckedChildren", { key: 0 }) : (openBlock(), createElementBlock(
              Fragment,
              { key: 1 },
              [
                _ctx.unCheckedIcon ? (openBlock(), createBlock(_component_ll_icon, {
                  key: 0,
                  "icon-name": _ctx.unCheckedIcon
                }, null, 8, ["icon-name"])) : (openBlock(), createElementBlock(
                  "span",
                  _hoisted_2,
                  toDisplayString(_ctx.unCheckedLabel),
                  1
                  /* TEXT */
                ))
              ],
              64
              /* STABLE_FRAGMENT */
            ))
          ]),
          key: "1"
        } : void 0
      ]), 1040, ["class"]);
    };
  }
});

export { _sfc_main as default };
//# sourceMappingURL=switch.vue2.mjs.map
