import { defineComponent as t, openBlock as u, createElementBlock as v, normalizeClass as p, onMounted as d } from "vue";
const h = t({ name: "zv-scene-ue-shj" }), m = /* @__PURE__ */ t({
  ...h,
  props: {
    basicOption: {},
    sources: {},
    useEvents: {},
    uuid: {},
    isPreview: { type: Boolean }
  },
  emits: [
    "on-message"
  ],
  setup(i, { emit: c }) {
    const n = i, a = c;
    return (() => {
      d(() => {
        n.useEvents.length > 0 && n.useEvents.forEach((e) => {
          e && e.receivingMethod && (window.ue.interface[e.receivingMethod] = (s) => {
            try {
              if (!JSON.parse(s).data)
                throw new Error("");
              const o = n.useEvents.filter((r) => r.receivingMethod === e.receivingMethod && r.eventType === "on-message");
              a("on-message", JSON.parse(s).data), window.SHJParseEvent(o, "on-message", JSON.parse(s).data);
            } catch {
            }
          });
        });
      });
    })(), (e, s) => (u(), v("div", {
      class: p([{ isPreview: e.isPreview }, "shj-for-ue"])
    }, null, 2));
  }
});
export {
  m as default
};
