import { defineComponent, ref, computed, watch, openBlock, createElementBlock, normalizeStyle, unref, toDisplayString } from "vue";
const _hoisted_1 = ["type", "openid"];
const __default__ = {
  name: "WlStaffName"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: {
    is_trial: { type: Boolean, default: false },
    type: { default: "userName" },
    name: { default: "" },
    openid: { default: "" },
    fontSize: { default: "" },
    color: { default: "" },
    cursor: { default: "" }
  },
  setup(__props) {
    const props = __props;
    const openDataEl = ref();
    const name_style = computed(() => {
      return {
        fontSize: typeof props.fontSize === "string" ? props.fontSize : props.fontSize + "px",
        color: props.color,
        cursor: props.cursor
      };
    });
    watch(
      [() => props.openid, () => props.is_trial, openDataEl],
      ([id, shouldBind, el]) => {
        var _a;
        if (id && shouldBind && el) {
          (_a = window.parent.WWOpenData) == null ? void 0 : _a.bind(el);
        }
      }
    );
    return (_ctx, _cache) => {
      return __props.is_trial ? (openBlock(), createElementBlock("ww-open-data", {
        key: 0,
        ref_key: "openDataEl",
        ref: openDataEl,
        type: __props.type,
        openid: __props.openid,
        style: normalizeStyle(unref(name_style))
      }, null, 12, _hoisted_1)) : (openBlock(), createElementBlock("span", {
        key: 1,
        style: normalizeStyle(unref(name_style))
      }, toDisplayString(__props.name), 5));
    };
  }
});
var __uno = "";
_sfc_main.install = (app) => {
  app.component(_sfc_main.name, _sfc_main);
};
export { _sfc_main as default };
