"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const Vue = require("vue");
const SvgIcon = require("../../../common/base/SvgIcon.vue.js");
const ScreenSharingIcon = require("../../../common/icons/ScreenSharingIcon.vue.js");
const Button = require("../../../common/base/Button.vue.js");
const index$1 = require("../../../common/base/Dialog/index.js");
const useMitt = require("../../../../hooks/useMitt.js");
const index = require("../../../../locales/index.js");
const _hoisted_1 = { class: "local-screen-container" };
const _hoisted_2 = { class: "local-screen-info" };
const _hoisted_3 = { class: "text" };
const _sfc_main = /* @__PURE__ */ Vue.defineComponent({
  __name: "index",
  props: {
    isMiniRegion: { type: Boolean }
  },
  setup(__props) {
    const { t } = index.useI18n();
    const showStopShareRegion = Vue.ref(false);
    function openStopConfirmDialog() {
      showStopShareRegion.value = true;
    }
    function stopScreenSharing() {
      showStopShareRegion.value = false;
      useMitt.default.emit("ScreenShare:stopScreenShare");
    }
    return (_ctx, _cache) => {
      return Vue.openBlock(), Vue.createElementBlock("div", _hoisted_1, [
        Vue.createElementVNode("div", {
          class: Vue.normalizeClass(["local-screen-control-container", { mini: _ctx.isMiniRegion }])
        }, [
          Vue.createElementVNode("div", _hoisted_2, [
            Vue.createVNode(SvgIcon.default, { icon: ScreenSharingIcon.default }),
            Vue.createElementVNode("span", _hoisted_3, Vue.toDisplayString(Vue.unref(t)("You are sharing the screen...")), 1)
          ]),
          Vue.createVNode(Button.default, {
            size: "default",
            class: "stop-button",
            onClick: openStopConfirmDialog
          }, {
            default: Vue.withCtx(() => [
              Vue.createTextVNode(Vue.toDisplayString(Vue.unref(t)("End sharing")), 1)
            ]),
            _: 1
          }),
          Vue.createVNode(Vue.unref(index$1.default), {
            modelValue: showStopShareRegion.value,
            "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => showStopShareRegion.value = $event),
            width: "420px",
            title: Vue.unref(t)("End sharing"),
            modal: true,
            "close-on-click-modal": true,
            "append-to-room-container": true
          }, {
            footer: Vue.withCtx(() => [
              Vue.createElementVNode("span", null, [
                Vue.createVNode(Button.default, {
                  class: "dialog-button",
                  size: "default",
                  onClick: stopScreenSharing
                }, {
                  default: Vue.withCtx(() => [
                    Vue.createTextVNode(Vue.toDisplayString(Vue.unref(t)("End sharing")), 1)
                  ]),
                  _: 1
                }),
                Vue.createVNode(Button.default, {
                  type: "primary",
                  size: "default",
                  onClick: _cache[0] || (_cache[0] = ($event) => showStopShareRegion.value = false)
                }, {
                  default: Vue.withCtx(() => [
                    Vue.createTextVNode(Vue.toDisplayString(Vue.unref(t)("Cancel")), 1)
                  ]),
                  _: 1
                })
              ])
            ]),
            default: Vue.withCtx(() => [
              Vue.createElementVNode("span", null, Vue.toDisplayString(Vue.unref(t)(
                "Others will no longer see your screen after you stop sharing. Are you sure you want to stop?"
              )), 1)
            ]),
            _: 1
          }, 8, ["modelValue", "title"])
        ], 2)
      ]);
    };
  }
});
exports.default = _sfc_main;
