import { defineComponent as n, ref as u, computed as r, openBlock as a, createElementBlock as c, createTextVNode as i, toDisplayString as f, createBlock as m, withCtx as h, createVNode as p, normalizeClass as d, createCommentVNode as g } from "vue";
import x from "./Button.js";
import C from "./Icon.js";
import b from "./utils/obfuscateText.js";
const k = {
  class: "stash-obfuscate-text",
  "data-test": "stash-obfuscate-text"
}, V = /* @__PURE__ */ n({
  name: "ll-obfuscate-text",
  __name: "ObfuscateText",
  props: {
    text: {},
    obfuscateAll: { type: Boolean, default: !1 },
    showToggle: { type: Boolean, default: !1 },
    lengthToKeep: { default: 0 },
    maskChar: { default: "•" },
    maskCharCount: { default: 10 },
    position: { default: "start" }
  },
  setup(s) {
    const e = u(!1), t = s, l = r(() => t.showToggle && e.value ? t.text : t.obfuscateAll ? t.maskChar.repeat(t.maskCharCount) : b(t.text, {
      maskChar: t.maskChar,
      maskCharCount: t.maskCharCount,
      lengthToKeep: t.lengthToKeep,
      position: t.position
    }));
    return (T, o) => (a(), c("span", k, [
      i(f(l.value) + " ", 1),
      t.showToggle ? (a(), m(x, {
        key: 0,
        class: "ml-1 size-auto p-0",
        icon: "",
        type: "button",
        onClick: o[0] || (o[0] = (_) => e.value = !e.value)
      }, {
        default: h(() => [
          p(C, {
            name: e.value ? "hide" : "show",
            class: d(["cursor-pointer", e.value ? "stash-obfuscate-text__hide-toggle-icon" : "stash-obfuscate-text__show-toggle-icon"]),
            "data-test": e.value ? "stash-obfuscate-text|hide-toggle-icon" : "stash-obfuscate-text|show-toggle-icon"
          }, null, 8, ["name", "class", "data-test"])
        ]),
        _: 1
      })) : g("", !0)
    ]));
  }
});
export {
  V as default
};
//# sourceMappingURL=ObfuscateText.js.map
