import { defineComponent as k, openBlock as r, createElementBlock as p, createVNode as t, unref as m, createElementVNode as V, toDisplayString as S, ref as v, watch as U, computed as $, resolveComponent as f, resolveDirective as B, Fragment as b, withCtx as u, createTextVNode as y, withDirectives as z, renderList as D, createBlock as N, normalizeClass as O } from "vue";
import { l as I, _ as g, m as q, t as E } from "./index-16cc6938.mjs";
const F = { class: "name" }, M = /* @__PURE__ */ k({
  __name: "pickerSingle",
  props: {
    icon: {
      type: String,
      required: !0,
      default: ""
    }
  },
  emits: ["iconChoosed"],
  setup(_, { emit: l }) {
    const o = _;
    function e() {
      l("iconChoosed", o.icon);
    }
    return (s, i) => (r(), p("div", {
      class: "icon-holder",
      onClick: e
    }, [
      t(I, {
        size: "3em",
        icon: m(o).icon,
        onClick: e
      }, null, 8, ["icon"]),
      V("span", F, S(_.icon), 1)
    ]));
  }
});
const T = /* @__PURE__ */ g(M, [["__scopeId", "data-v-d957571f"]]), j = { class: "icon-list" }, A = /* @__PURE__ */ k({
  __name: "pickerList",
  emits: ["iconChoosed", "closePopover"],
  setup(_, { emit: l }) {
    const o = v([]), e = v(""), s = v(0), i = v([]), h = () => {
      s.value = Math.min(s.value + 60, i.value.length);
    };
    let d = [];
    for (const [n] of Object.entries(q))
      d.push(n);
    o.value = d, U(e, () => {
      e.value ? i.value = o.value.filter((n) => n.toUpperCase().indexOf(e.value.toUpperCase()) >= 0) : i.value = o.value, s.value = Math.min(60, i.value.length);
    }, {
      immediate: !0
    });
    const C = $(() => e.value ? o.value.filter((n) => n.toUpperCase().indexOf(e.value.toUpperCase()) >= 0) : o.value);
    return (n, a) => {
      const x = f("el-button"), P = f("el-button-group"), w = f("el-input"), L = B("infinite-scroll");
      return r(), p(b, null, [
        t(w, {
          modelValue: e.value,
          "onUpdate:modelValue": a[2] || (a[2] = (c) => e.value = c),
          clearable: "",
          placeholder: "You should input something to filter icons so the infinite scroll works. This is a BUG."
        }, {
          append: u(() => [
            t(P, null, {
              default: u(() => [
                t(x, {
                  onClick: a[0] || (a[0] = (c) => l("iconChoosed", void 0))
                }, {
                  default: u(() => [
                    y("Clear")
                  ]),
                  _: 1
                }),
                t(x, {
                  onClick: a[1] || (a[1] = (c) => l("closePopover"))
                }, {
                  default: u(() => [
                    y("Cose")
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["modelValue"]),
        z((r(), p("ul", j, [
          (r(!0), p(b, null, D(s.value, (c) => (r(), p("li", {
            key: c,
            class: "icon-item"
          }, [
            t(T, {
              icon: C.value[c - 1],
              onIconChoosed: (H) => l("iconChoosed", m(E)(C.value[c - 1]))
            }, null, 8, ["icon", "onIconChoosed"])
          ]))), 128))
        ])), [
          [L, h]
        ])
      ], 64);
    };
  }
});
const G = /* @__PURE__ */ g(A, [["__scopeId", "data-v-fc0a127a"]]), Y = /* @__PURE__ */ k({
  __name: "index",
  props: {
    modelValue: {
      type: String,
      required: !0,
      default: ""
    }
  },
  emits: ["update:modelValue"],
  setup(_, { emit: l }) {
    const o = _, e = v(!1);
    function s() {
      e.value = !0;
    }
    function i(d) {
      l("update:modelValue", d), e.value = !1;
    }
    const h = () => {
      e.value = !1;
    };
    return (d, C) => {
      const n = f("el-popover");
      return r(), N(n, {
        visible: e.value,
        placement: "bottom",
        width: "40%",
        teleported: !0
      }, {
        reference: u(() => [
          V("div", {
            class: O(["icon", { icon_empty: !m(o).modelValue }]),
            onClick: s
          }, [
            t(I, {
              size: "large",
              icon: m(o).modelValue
            }, null, 8, ["icon"])
          ], 2)
        ]),
        default: u(() => [
          t(G, {
            onIconChoosed: i,
            onClosePopover: h
          })
        ]),
        _: 1
      }, 8, ["visible"]);
    };
  }
});
const Q = /* @__PURE__ */ g(Y, [["__scopeId", "data-v-9bf8f73b"]]);
export {
  Q as default
};
