import { l as e, p as t } from "./enums-De8CDKZ1.js";
import { t as n } from "./vue-i18n-Db_oYfO8.js";
import { t as r } from "./convertDuration-1K7fuEpO.js";
import { computed as i, createBlock as a, createVNode as o, defineComponent as s, openBlock as c, resolveComponent as l, unref as u, withCtx as d } from "vue";
//#region src/components/wt-status-select/_internals/StatusOptions.lookup.js
var f = [
	{
		locale: "webitelUI.statusSelect.online",
		color: "success",
		value: t.ONLINE
	},
	{
		locale: "webitelUI.statusSelect.pause",
		color: "primary",
		value: t.PAUSE
	},
	{
		locale: "webitelUI.statusSelect.offline",
		color: "secondary",
		value: t.OFFLINE
	},
	{
		locale: "webitelUI.statusSelect.breakOut",
		color: "break-out",
		value: t.BREAK_OUT
	}
], p = /* @__PURE__ */ s({
	__name: "wt-status-select",
	props: {
		status: { default: t.OFFLINE },
		statusDuration: { default: 0 },
		options: {}
	},
	emits: ["change", "closed"],
	setup(s, { emit: p }) {
		let m = s, h = p, { t: g } = n(), _ = i(() => m.options ? m.options : f.map((e) => ({
			...e,
			text: g(e.locale)
		}))), v = i(() => _.value.find((e) => e.value === m.status)), y = i(() => _.value.reduce((e, n) => (m.status === n.value && n.value !== t.PAUSE || n.value === t.BREAK_OUT || e.push(n), e), [])), b = i(() => typeof m.statusDuration == "string" ? m.statusDuration : m.statusDuration === void 0 ? v.value?.text ?? "" : r(m.statusDuration));
		function x(e) {
			h("change", e.value);
		}
		function S(e) {
			h("closed", e);
		}
		return (t, n) => {
			let r = l("wt-indicator"), i = l("wt-single-select");
			return c(), a(i, {
				"show-clear": !1,
				options: y.value,
				filterable: !1,
				"model-value": v.value,
				class: "wt-status-select",
				"data-key": "value",
				size: u(e).SM,
				onClosed: S,
				"onUpdate:modelValue": x
			}, {
				value: d(({ value: e }) => [o(r, {
					color: v.value.color,
					text: b.value
				}, null, 8, ["color", "text"])]),
				option: d(({ option: e }) => [o(r, {
					color: e.color,
					text: e.text
				}, null, 8, ["color", "text"])]),
				_: 1
			}, 8, [
				"options",
				"model-value",
				"size"
			]);
		};
	}
});
//#endregion
export { p as default };
