import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, renderSlot, toDisplayString, unref, withCtx, withModifiers } from "vue";
import { ScalarButton } from "@scalar/components";
//#region src/components/Sidebar/Actions/SidebarListElementForm.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1$1 = { class: "flex justify-between gap-10" };
//#endregion
//#region src/components/Sidebar/Actions/SidebarListElementForm.vue
var SidebarListElementForm_default = /* @__PURE__ */ defineComponent({
	__name: "SidebarListElementForm",
	props: {
		danger: { type: Boolean },
		label: {}
	},
	emits: ["cancel", "submit"],
	setup(__props, { emit: __emit }) {
		const emit = __emit;
		return (_ctx, _cache) => {
			return openBlock(), createElementBlock("form", {
				class: "flex flex-col gap-4 text-base",
				onSubmit: _cache[1] || (_cache[1] = withModifiers(($event) => emit("submit"), ["prevent"]))
			}, [renderSlot(_ctx.$slots, "default"), createElementVNode("div", _hoisted_1$1, [createVNode(unref(ScalarButton), {
				size: "sm",
				type: "button",
				variant: "outlined",
				onClick: _cache[0] || (_cache[0] = ($event) => emit("cancel"))
			}, {
				default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode(" Cancel ", -1)])]),
				_: 1
			}), createVNode(unref(ScalarButton), {
				"data-testid": "sidebar-list-element-form-submit-button",
				size: "sm",
				type: "submit",
				variant: __props.danger ? "danger" : "solid"
			}, {
				default: withCtx(() => [createTextVNode(toDisplayString(__props.label ?? "Save"), 1)]),
				_: 1
			}, 8, ["variant"])])], 32);
		};
	}
});
//#endregion
//#region src/components/Sidebar/Actions/DeleteSidebarListElement.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1 = {
	key: 0,
	class: "text-c-2 text-sm leading-normal text-pretty"
};
//#endregion
//#region src/components/Sidebar/Actions/DeleteSidebarListElement.vue
var DeleteSidebarListElement_default = /* @__PURE__ */ defineComponent({
	__name: "DeleteSidebarListElement",
	props: {
		variableName: {},
		warningMessage: {}
	},
	emits: ["close", "delete"],
	setup(__props, { emit: __emit }) {
		const props = __props;
		const emit = __emit;
		const truncatedName = computed(() => {
			if (props.variableName.length > 18) return props.variableName.slice(0, 18) + "…";
			return props.variableName;
		});
		return (_ctx, _cache) => {
			return openBlock(), createBlock(SidebarListElementForm_default, {
				danger: "",
				label: `Delete ${truncatedName.value}`,
				onCancel: _cache[0] || (_cache[0] = ($event) => emit("close")),
				onSubmit: _cache[1] || (_cache[1] = ($event) => emit("delete"))
			}, {
				default: withCtx(() => [__props.warningMessage ? (openBlock(), createElementBlock("p", _hoisted_1, toDisplayString(__props.warningMessage), 1)) : createCommentVNode("", true)]),
				_: 1
			}, 8, ["label"]);
		};
	}
});
//#endregion
export { SidebarListElementForm_default as n, DeleteSidebarListElement_default as t };

//# sourceMappingURL=DeleteSidebarListElement-C-p87d03.js.map