import { $ as e, B as t, F as n, H as r, M as i, N as a, P as o, S as s, U as c, X as l, _ as u, at as d, b as f, c as p, ct as m, d as h, g, h as _, j as v, lt as y, m as b, n as x, p as S, st as C, tt as w, u as T, v as E, x as D, y as O } from "./draggable-Bcb86AsV.js";
import { $ as k, $t as A, At as j, Bt as M, C as N, Ct as P, D as F, Dt as I, Ft as ee, Jt as L, Mt as R, Nn as z, Nt as B, Rt as V, S as H, Y as U, Yt as W, _ as G, b as te, bn as K, c as ne, d as re, f as q, g as ie, h as ae, hn as J, ht as Y, k as oe, l as se, m as ce, mt as X, p as Z, qt as le, sn as Q, st as ue, tt as de, u as fe, ut as pe, v as me, wt as he, x as ge, y as _e, zt as ve } from "./features-BnG-dhzy.js";
import { S as ye, x as be } from "./icons-B_185qj_.js";
import { a as xe, i as Se, n as Ce, o as we, r as Te, s as Ee, t as De } from "./styles-DYDpAUsJ.js";
import { d as $ } from "./styleConstants-DP1VOca8.js";
//#region src/cloud/composables/useSnapshotPreview.ts
function Oe(t) {
	let { authManager: n, editor: r, history: i, conditionPreview: a, autoSave: o, onError: s } = t, c = w(null), l = e(null), u = e(null), d = S(() => l.value !== null), f = S(() => c.value?.snapshots.value ?? []), p = S(() => c.value?.isLoading.value ?? !1), m = S(() => c.value?.isRestoring.value ?? !1);
	function h() {
		r.state.template?.id && !c.value && (c.value = Z({
			authManager: n,
			templateId: r.state.template.id,
			onRestore: g,
			onError: s
		}), c.value.loadSnapshots());
	}
	function g(e) {
		r.setContent(e.content, !1), i.clear(), a.reset();
	}
	async function _(e) {
		if (l.value) {
			l.value = e, r.setContent(e.content, !1);
			return;
		}
		r.state.isDirty && r.hasTemplate() && await r.createSnapshot(), u.value = structuredClone(r.content.value), o?.pause(), l.value = e, r.setContent(e.content, !1);
	}
	async function v() {
		if (!(!l.value || !c.value)) try {
			await c.value.restoreSnapshot(l.value.id), await c.value.loadSnapshots();
		} finally {
			l.value = null, u.value = null, o?.resume();
		}
	}
	function y() {
		!l.value || !u.value || (r.setContent(u.value, !1), l.value = null, u.value = null, o?.resume());
	}
	async function b() {
		c.value && await c.value.loadSnapshots();
	}
	return {
		snapshotHistoryInstance: c,
		previewingSnapshot: l,
		contentBeforePreview: u,
		isPreviewingSnapshot: d,
		snapshotHistorySnapshots: f,
		snapshotHistoryIsLoading: p,
		snapshotHistoryIsRestoring: m,
		initSnapshotHistory: h,
		handleRestore: g,
		handleSnapshotNavigate: _,
		confirmRestoreSnapshot: v,
		cancelPreview: y,
		loadSnapshotHistory: b
	};
}
//#endregion
//#region src/cloud/composables/useCloudPanelState.ts
function ke() {
	let t = e(null), n = S({
		get: () => t.value === "ai-chat",
		set: (e) => t.value = e ? "ai-chat" : null
	}), r = S({
		get: () => t.value === "scoring",
		set: (e) => t.value = e ? "scoring" : null
	}), i = S({
		get: () => t.value === "design-reference",
		set: (e) => t.value = e ? "design-reference" : null
	}), a = S({
		get: () => t.value === "comments",
		set: (e) => t.value = e ? "comments" : null
	}), o = e(!1), s = e(!1), c = e(void 0), l = e(!1), u = e(null), d = S(() => t.value !== null), f = S(() => {
		let e = t.value;
		return e === "ai-chat" || e === "design-reference" || e === "scoring" ? e : null;
	}), p = S(() => l.value || t.value === "ai-chat" || t.value === "design-reference" || t.value === "scoring");
	function m() {
		l.value = !l.value;
	}
	function h(e) {
		l.value = !1, t.value = t.value === e ? null : e;
	}
	return A(u, () => {
		l.value = !1;
	}), {
		activePanel: t,
		aiChatOpen: n,
		scoringPanelOpen: r,
		designReferenceOpen: i,
		commentsOpen: a,
		testEmailModalOpen: o,
		mediaLibraryOpen: s,
		mediaLibraryAccept: c,
		aiMenuOpen: l,
		aiMenuRef: u,
		rightPanelOpen: d,
		activeAiFeature: f,
		aiButtonActive: p,
		toggleAiMenu: m,
		handleAiFeatureSelect: h
	};
}
//#endregion
//#region src/cloud/composables/useCollabUndoWarning.ts
function Ae(t) {
	let { isCollaborationEnabled: n, getCollaboratorCount: r, canUndo: i } = t, a = e(!1), o = e(!1), { start: s } = Q(() => {
		o.value = !1;
	}, z, { immediate: !1 });
	function c() {
		a.value || !n.value || r() === 0 || !i.value || (a.value = !0, o.value = !0, s());
	}
	return {
		collabUndoWarningVisible: o,
		showCollabUndoWarning: c
	};
}
//#endregion
//#region src/cloud/composables/useCloudFeatureFlags.ts
function je(t) {
	let { planConfigInstance: n, aiConfig: r, editor: i } = t, a = S(() => n.hasFeature("ai_generation") && r.hasAnyMenuFeature.value), o = S(() => n.hasFeature("test_email")), s = S(() => !!i.state.template?.id), c = S(() => n.hasFeature("white_label")), l = S(() => n.config.value?.limits.max_templates ?? null), u = S(() => n.config.value?.template_count ?? 0), d = e(!1), f = e("idle"), p = e(""), { start: m } = Q(() => {
		f.value = "idle";
	}, 3e3, { immediate: !1 });
	return {
		canUseAiGeneration: a,
		canSendTestEmail: o,
		hasTemplateSaved: s,
		isWhiteLabeled: c,
		templateLimit: l,
		templateCount: u,
		isSaveExporting: d,
		saveStatus: f,
		saveErrorMessage: p,
		startSaveStatusClear: m
	};
}
//#endregion
//#region src/cloud/composables/useCloudMediaLibrary.ts
function Me(e) {
	let { onRequestMedia: t, mediaLibraryOpen: n, mediaLibraryAccept: r } = e, i = null;
	async function a() {
		if (t) {
			let e = await t({ accept: ["images"] });
			return e ? {
				url: e.url,
				alt: e.alt_text || void 0
			} : null;
		}
		return i &&= (i(null), null), r.value = ["images"], n.value = !0, new Promise((e) => {
			i = (t) => {
				e(t);
			};
		});
	}
	function o(e) {
		n.value = !1, i?.({
			url: e.url,
			alt: e.alt_text || void 0
		}), i = null;
	}
	function s() {
		n.value = !1, i?.(null), i = null;
	}
	return l(() => {
		i &&= (i(null), null);
	}), {
		handleRequestMedia: a,
		handleMediaSelect: o,
		handleMediaLibraryClose: s
	};
}
//#endregion
//#region src/cloud/composables/useCloudInitialization.ts
function Ne(n) {
	let { config: r, translations: i, fontsManager: a, emit: s, getCommentsSidebar: c } = n, l = e(!0), u = e(!1), d = e(null), f = !1, p = { value: null }, m = null, h = null, g = new F({
		...r.auth,
		onError: r.onError
	}), _ = fe({
		authManager: g,
		onError: r.onError
	}), v = e(/* @__PURE__ */ new Map()), y = H({
		authManager: g,
		defaultFontFamily: r.fonts?.defaultFont,
		templateDefaults: r.templateDefaults,
		onError: r.onError,
		lockedBlocks: v
	}), b = ae({
		authManager: g,
		onError: r.onError
	});
	r.mcp?.enabled && ne({
		editor: y,
		channel: b.channel,
		onOperation: r.mcp.onOperation
	});
	let x = null;
	r.collaboration?.enabled && (x = G({
		authManager: g,
		editor: y,
		channel: b.channel,
		onError: r.onError,
		onCollaboratorJoined: r.collaboration.onCollaboratorJoined,
		onCollaboratorLeft: r.collaboration.onCollaboratorLeft,
		onBlockLocked: r.collaboration.onBlockLocked,
		onBlockUnlocked: r.collaboration.onBlockUnlocked
	}), t(() => x.lockedBlocks.value, (e) => {
		v.value = e;
	}, { immediate: !0 }), ie(y, x));
	let C = S(() => !!r.collaboration?.enabled && _.hasFeature("collaboration")), w = oe({
		editor: y,
		config: {
			uiTheme: r.uiTheme,
			theme: void 0,
			blockDefaults: r.blockDefaults,
			customBlocks: [],
			mergeTags: r.mergeTags,
			displayConditions: r.displayConditions,
			onRequestMedia: null,
			onSave: () => {
				p.value?.().catch((e) => {
					r.onError?.(e);
				});
			}
		},
		translations: i,
		fontsManager: a,
		historyOptions: x ? { isRemoteOperation: () => x._isProcessingRemoteOperation() } : void 0,
		autoSaveOptions: {
			onChange: async () => {
				y.hasTemplate() && (await y.createSnapshot(), m?.snapshotHistoryInstance.value?.loadSnapshots());
			},
			debounce: r.autoSaveDebounce ?? 5e3,
			enabled: () => r.autoSave !== !1 && _.hasFeature("auto_save")
		},
		themeExtraStyles: () => ({ "--tpl-drop-text": `"${i.canvas.dropHere}"` }),
		keyboardOptions: { onBeforeUndo: () => h?.showCollabUndoWarning() }
	}), T = Ae({
		isCollaborationEnabled: C,
		getCollaboratorCount: () => x?.collaborators.value.length ?? 0,
		canUndo: w.history.canUndo
	});
	h = T;
	let E = Oe({
		authManager: g,
		editor: y,
		history: w.history,
		conditionPreview: w.conditionPreview,
		autoSave: w.autoSave,
		onError: r.onError
	});
	m = E;
	let D = ke(), O = ge(r.ai), k = je({
		planConfigInstance: _,
		aiConfig: O,
		editor: y
	}), A = Me({
		onRequestMedia: r.onRequestMedia,
		mediaLibraryOpen: D.mediaLibraryOpen,
		mediaLibraryAccept: D.mediaLibraryAccept
	});
	U({
		onBlockMove: y.moveBlock,
		onBlockAdd: y.addBlock
	});
	let N = re({
		authManager: g,
		getFontsConfig: () => r.fonts,
		canUseCustomFonts: () => _.hasFeature("custom_fonts")
	}), P = q({
		authManager: g,
		getTemplateId: () => y.state.template?.id ?? null,
		save: () => y.save(),
		exportHtml: (e) => N.exportHtml(e),
		onError: r.onError,
		isAuthReady: u,
		onBeforeTestEmail: r.onBeforeTestEmail
	}), I = _e({
		authManager: g,
		getTemplateId: () => y.state.template?.id ?? null,
		getSocketId: () => b.getSocketId(),
		onComment: r.onComment,
		onError: r.onError,
		isAuthReady: u,
		hasCommentingFeature: () => r.commenting !== !1 && _.hasFeature("commenting")
	});
	me({
		comments: I,
		channel: b.channel
	});
	let R = ce({
		authManager: g,
		onError: r.onError
	}), z = e(!1), K = e(null), J = e(!1), Y = te({
		authManager: g,
		getTemplateId: () => y.state.template?.id ?? null
	});
	function X(e) {
		D.commentsOpen.value = !0, queueMicrotask(() => {
			c()?.filterByBlock(e);
		});
	}
	o(le, A.handleRequestMedia), o(ee, g), o(B, O), o(M, I), o(L, R), o(W, Y), o(V, {
		plan: _,
		ai: O,
		comments: {
			getBlockCount: (e) => I.commentCountByBlock.value.get(e) ?? 0,
			openForBlock: X
		},
		savedModules: {
			openSaveDialog: (e) => {
				K.value = e ?? null, z.value = !0;
			},
			openBrowser: () => {
				J.value = !0;
			},
			moduleCount: S(() => R.modules.value.length)
		}
	});
	function Z(e) {
		_.hasFeature("theme_customization") && (w.themeOverrides.value = e);
	}
	function Q(e) {
		y.setUiTheme(e);
	}
	async function ue() {
		l.value = !0, d.value = null;
		try {
			if (await g.initialize(), f) return;
			u.value = !0;
			let e = await se({ authManager: g });
			if (f) return;
			if (!e.api.ok) throw Error("Health check failed: API is not reachable");
			if (!e.auth.ok) throw Error(`Health check failed: authentication error${e.auth.error ? ` - ${e.auth.error}` : ""}`);
			if (e.websocket.ok || j.warn("WebSocket health check failed:", e.websocket.error ?? "unknown error", "-- real-time features will be disabled."), await _.fetchConfig(), f) return;
			a.setCustomFontsEnabled(_.hasFeature("custom_fonts")), r.customBlocks?.length && _.hasFeature("custom_blocks") && w.registerCustomBlocks(r.customBlocks), r.theme && _.hasFeature("theme_customization") && (w.themeOverrides.value = r.theme), r.modules !== !1 && _.hasFeature("saved_modules") && R.loadModules(), s("ready");
		} catch (e) {
			if (f) return;
			let t = e instanceof Error ? e : Error("Initialization failed", { cause: e });
			d.value = t, r.onError?.(t);
		} finally {
			f || (l.value = !1);
		}
	}
	function de() {
		f = !0, a.cleanupFontLinks(), b.disconnect(), w.destroy(), r.onUnmount?.();
	}
	return {
		isInitializing: l,
		isAuthReady: u,
		initError: d,
		isDestroyed: () => f,
		authManager: g,
		planConfigInstance: _,
		websocket: b,
		collaboration: x,
		isCollaborationEnabled: C,
		editor: y,
		core: w,
		aiConfig: O,
		featureFlags: k,
		mediaLib: A,
		exporter: N,
		testEmail: P,
		commentsInstance: I,
		savedModulesHeadless: R,
		scoringInstance: Y,
		panelState: D,
		snapshotPreview: E,
		collabWarning: T,
		showSaveModuleDialog: z,
		showModuleBrowserModal: J,
		saveModulePreSelectedBlockId: K,
		onSaveHook: p,
		initialize: ue,
		destroy: de,
		setThemeOverrides: Z,
		setUiTheme: Q,
		openCommentsForBlock: X
	};
}
//#endregion
//#region src/utils/preRenderCustomBlocks.ts
async function Pe(e, t) {
	let n = async (e) => {
		if (K(e)) {
			let n = e;
			try {
				n.renderedHtml = await t.renderCustomBlock(n);
			} catch {
				n.renderedHtml = `<!-- Custom block render error: ${n.customType} -->`;
			}
		}
		if (e.type === "section" && "children" in e) {
			let t = e;
			for (let e of t.children) for (let t of e) await n(t);
		}
	};
	for (let t of e.blocks) await n(t);
}
//#endregion
//#region src/cloud/composables/useCloudLifecycle.ts
function Fe(e) {
	let { config: t, editor: n, websocket: r, planConfigInstance: i, snapshotPreview: a, core: o, exporter: s, featureFlags: c, isDestroyed: l } = e;
	function u() {
		return N(i.config.value.websocket);
	}
	async function d(e) {
		let i = await n.create(e);
		return l() ? i : (t.onCreate?.(i), a.initSnapshotHistory(), r.connect(i.id, u()), i);
	}
	async function f(e) {
		let i = await n.load(e);
		return l() ? i : (t.onLoad?.(i), a.initSnapshotHistory(), r.connect(i.id, u()), i);
	}
	async function p() {
		c.isSaveExporting.value = !0, c.saveStatus.value = "idle";
		try {
			if (await Pe(n.content.value, o.registry), l()) throw Error("Component unmounted during save");
			let e = await n.save();
			if (l()) throw Error("Component unmounted during save");
			a.initSnapshotHistory(), a.snapshotHistoryInstance.value?.loadSnapshots();
			let r = await s.exportHtml(e.id);
			if (l()) throw Error("Component unmounted during save");
			let i = {
				templateId: e.id,
				html: r.html,
				mjml: r.mjml,
				content: e.content
			};
			return t.onSave?.(i), c.saveStatus.value = "saved", c.startSaveStatusClear(), i;
		} catch (e) {
			throw l() || (c.saveStatus.value = "error", c.saveErrorMessage.value = e instanceof Error ? e.message : "Save failed"), e;
		} finally {
			l() || (c.isSaveExporting.value = !1);
		}
	}
	return {
		createTemplate: d,
		loadTemplate: f,
		saveTemplate: p
	};
}
//#endregion
//#region src/cloud/components/CloudHeader.vue?vue&type=script&setup=true&lang.ts
var Ie = {
	class: "tpl-header tpl:absolute tpl:top-0 tpl:right-0 tpl:left-0 tpl:z-50 tpl:grid tpl:h-14 tpl:grid-cols-[1fr_auto_1fr] tpl:items-center tpl:px-4",
	style: {
		"background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)",
		"backdrop-filter": "blur(12px)",
		"-webkit-backdrop-filter": "blur(12px)",
		"box-shadow": "var(--tpl-shadow-md)",
		"border-bottom": "1px solid var(--tpl-border)"
	}
}, Le = { class: "tpl-header-left tpl:flex tpl:min-w-[200px] tpl:items-center tpl:gap-3" }, Re = {
	key: 0,
	class: "tpl:text-xs tpl:opacity-60 tpl:text-[var(--tpl-text-muted)]"
}, ze = { class: "tpl-header-center tpl:flex tpl:items-center tpl:justify-center tpl:gap-10" }, Be = { class: "tpl-header-right tpl:flex tpl:min-w-[200px] tpl:items-center tpl:justify-end tpl:gap-3" }, Ve = ["data-tooltip"], He = {
	key: 1,
	"aria-live": "polite",
	class: "tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-success)]"
}, Ue = {
	key: 2,
	"aria-live": "polite",
	class: "tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
}, We = ["aria-label", "aria-expanded"], Ge = {
	key: 0,
	class: "tpl:inline-flex tpl:size-4.5 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[10px] tpl:font-semibold tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]"
}, Ke = ["aria-expanded"], qe = {
	key: 0,
	class: "tpl:absolute tpl:right-0 tpl:top-full tpl:z-50 tpl:mt-1 tpl:origin-top-right"
}, Je = ["disabled"], Ye = ["disabled"], Xe = /* @__PURE__ */ s({
	__name: "CloudHeader",
	props: {
		editor: {},
		core: {},
		featureFlags: {},
		panelState: {},
		snapshotPreview: {},
		commentsInstance: {},
		testEmail: {},
		websocket: {},
		collaboration: {},
		isCollaborationEnabled: { type: Boolean },
		isSaveDisabled: { type: Boolean },
		isSaving: { type: Boolean }
	},
	emits: ["save"],
	setup(e) {
		let t = D(() => import("./CollaboratorBar-CTFgLtUt.js")), n = D(() => import("./features-BnG-dhzy.js").then((e) => e.r)), i = D(() => import("./AiFeatureMenu-DSXAYiMk.js")), { t: o, format: s } = k();
		return (c, l) => (a(), u("header", Ie, [
			b("div", Le, [e.featureFlags.templateLimit.value === null ? g("", !0) : (a(), u("span", Re, y(d(s)(d(o).header.templatesUsed, {
				used: e.featureFlags.templateCount.value,
				max: e.featureFlags.templateLimit.value
			})), 1))]),
			b("div", ze, [
				f(Se, {
					viewport: e.editor.state.viewport,
					onChange: e.editor.setViewport
				}, null, 8, ["viewport", "onChange"]),
				f(Ce, {
					"dark-mode": e.editor.state.darkMode,
					onChange: e.editor.setDarkMode
				}, null, 8, ["dark-mode", "onChange"]),
				f(Te, {
					"preview-mode": e.editor.state.previewMode,
					onChange: e.editor.setPreviewMode
				}, null, 8, ["preview-mode", "onChange"]),
				e.collaboration && e.isCollaborationEnabled ? (a(), _(d(t), {
					key: 0,
					collaborators: e.collaboration.collaborators.value,
					"is-connected": e.websocket.isConnected.value
				}, null, 8, ["collaborators", "is-connected"])) : g("", !0),
				e.snapshotPreview.snapshotHistoryInstance.value ? (a(), _(d(n), {
					key: 1,
					snapshots: e.snapshotPreview.snapshotHistorySnapshots.value,
					"is-loading": e.snapshotPreview.snapshotHistoryIsLoading.value,
					"is-restoring": e.snapshotPreview.snapshotHistoryIsRestoring.value,
					onLoad: e.snapshotPreview.loadSnapshotHistory,
					onNavigate: e.snapshotPreview.handleSnapshotNavigate
				}, null, 8, [
					"snapshots",
					"is-loading",
					"is-restoring",
					"onLoad",
					"onNavigate"
				])) : g("", !0)
			]),
			b("div", Be, [
				e.featureFlags.saveStatus.value === "error" ? (a(), u("div", {
					key: 0,
					"aria-live": "assertive",
					class: "tpl-tooltip tpl-status tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-danger)]",
					"data-tooltip": e.featureFlags.saveErrorMessage.value
				}, [f(d(he), {
					size: 12,
					"stroke-width": 2.5
				}), O(" " + y(d(o).header.saveFailed), 1)], 8, Ve)) : e.featureFlags.saveStatus.value === "saved" ? (a(), u("div", He, [f(d(I), {
					size: 12,
					"stroke-width": 2.5
				}), O(" " + y(d(o).header.saved), 1)])) : e.editor.state.isDirty ? (a(), u("div", Ue, [l[4] ||= b("span", { class: "tpl-pulse tpl:size-1.5 tpl:rounded-full tpl:bg-[var(--tpl-primary)]" }, null, -1), O(" " + y(d(o).header.unsaved), 1)])) : g("", !0),
				e.commentsInstance.isEnabled.value && e.featureFlags.hasTemplateSaved.value ? (a(), u("button", {
					key: 3,
					"aria-label": e.commentsInstance.unresolvedCount.value > 0 ? `${d(o).comments.button} (${e.commentsInstance.unresolvedCount.value})` : d(o).comments.button,
					"aria-expanded": e.panelState.commentsOpen.value,
					class: C(d($)),
					style: m({
						backgroundColor: e.panelState.commentsOpen.value ? "var(--tpl-primary)" : "transparent",
						color: e.panelState.commentsOpen.value ? "var(--tpl-bg)" : "var(--tpl-primary)",
						borderColor: "var(--tpl-primary)"
					}),
					onClick: l[0] ||= (t) => e.panelState.commentsOpen.value = !e.panelState.commentsOpen.value
				}, [
					f(d(X), {
						size: 16,
						"stroke-width": 2
					}),
					O(" " + y(d(o).comments.button) + " ", 1),
					e.commentsInstance.unresolvedCount.value > 0 && !e.panelState.commentsOpen.value ? (a(), u("span", Ge, y(e.commentsInstance.unresolvedCount.value), 1)) : g("", !0)
				], 14, We)) : g("", !0),
				e.featureFlags.canUseAiGeneration.value && e.featureFlags.hasTemplateSaved.value ? (a(), u("div", {
					key: 4,
					ref: (t) => e.panelState.aiMenuRef.value = t,
					class: "tpl:relative"
				}, [b("button", {
					"aria-expanded": e.panelState.aiMenuOpen.value,
					class: C(["tpl-ai-btn tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-4 tpl:py-2 tpl:text-sm tpl:font-semibold tpl:whitespace-nowrap tpl:transition-all tpl:duration-200", e.panelState.aiButtonActive.value ? "tpl-ai-btn--active" : "tpl-ai-btn--idle"]),
					onClick: l[1] ||= T((...t) => e.panelState.toggleAiMenu && e.panelState.toggleAiMenu(...t), ["stop"])
				}, [f(d(ue), {
					size: 16,
					"stroke-width": 2,
					class: "tpl-ai-btn-icon"
				}), O(" " + y(d(o).aiChat.button), 1)], 10, Ke), f(x, {
					"enter-active-class": "tpl:transition-all tpl:duration-150 tpl:ease-out",
					"enter-from-class": "tpl:scale-95 tpl:opacity-0",
					"enter-to-class": "tpl:scale-100 tpl:opacity-100",
					"leave-active-class": "tpl:transition-all tpl:duration-100 tpl:ease-in",
					"leave-from-class": "tpl:scale-100 tpl:opacity-100",
					"leave-to-class": "tpl:scale-95 tpl:opacity-0"
				}, {
					default: r(() => [e.panelState.aiMenuOpen.value ? (a(), u("div", qe, [f(d(i), {
						"active-feature": e.panelState.activeAiFeature.value,
						onSelect: e.panelState.handleAiFeatureSelect
					}, null, 8, ["active-feature", "onSelect"])])) : g("", !0)]),
					_: 1
				})], 512)) : g("", !0),
				e.testEmail.isEnabled.value && e.featureFlags.canSendTestEmail.value ? (a(), u("button", {
					key: 5,
					class: C(d($)),
					style: {
						"background-color": "transparent",
						color: "var(--tpl-primary)",
						"border-color": "var(--tpl-primary)"
					},
					disabled: e.testEmail.isSending.value || !e.featureFlags.hasTemplateSaved.value,
					onClick: l[2] ||= (t) => e.panelState.testEmailModalOpen.value = !0
				}, [e.testEmail.isSending.value ? (a(), _(d(Y), {
					key: 1,
					class: "tpl-spinner",
					size: 16,
					"stroke-width": 2
				})) : (a(), _(d(pe), {
					key: 0,
					size: 16,
					"stroke-width": 2
				})), O(" " + y(d(o).testEmail.button), 1)], 10, Je)) : g("", !0),
				b("button", {
					class: C(d($)),
					style: {
						"background-color": "transparent",
						color: "var(--tpl-primary)",
						"border-color": "var(--tpl-primary)"
					},
					disabled: e.isSaveDisabled,
					onClick: l[3] ||= (e) => c.$emit("save")
				}, [e.isSaving ? (a(), _(d(Y), {
					key: 1,
					class: "tpl-spinner",
					size: 16,
					"stroke-width": 2
				})) : (a(), _(d(be), {
					key: 0,
					size: 16,
					"stroke-width": 2
				})), O(" " + y(e.isSaving ? d(o).header.saving : d(o).header.save), 1)], 10, Ye)
			])
		]));
	}
}), Ze = /* @__PURE__ */ s({
	__name: "CloudPanels",
	props: {
		config: {},
		editor: {},
		core: {},
		panelState: {},
		planConfigInstance: {},
		testEmail: {},
		mediaLib: {},
		savedModulesHeadless: {},
		showSaveModuleDialog: { type: Boolean },
		saveModulePreSelectedBlockId: {},
		showModuleBrowserModal: { type: Boolean }
	},
	emits: [
		"update:showSaveModuleDialog",
		"update:saveModulePreSelectedBlockId",
		"update:showModuleBrowserModal",
		"send-test-email",
		"module-insert"
	],
	setup(t, { expose: n, emit: r }) {
		let i = D(() => import("./features-BnG-dhzy.js").then((e) => e.s)), o = D(() => import("./features-BnG-dhzy.js").then((e) => e.o)), s = D(() => import("./features-BnG-dhzy.js").then((e) => e.a)), c = D(() => import("./features-BnG-dhzy.js").then((e) => e.n)), l = D(() => import("./features-BnG-dhzy.js").then((e) => e.t)), p = D(() => import("./SaveModuleDialog-B6kNizps.js")), m = D(() => import("./ModuleBrowserModal-B70ZM4KG.js")), v = D(async () => (await import("./src-Cw7KAyui.js")).MediaLibraryModal), y = r;
		function b(e, t, n) {
			t.history.record(), n.setContent(e), t.conditionPreview.reset();
		}
		function x(e, t) {
			y("module-insert", e, t);
		}
		let S = e(null);
		function C(e) {
			S.value?.filterByBlock(e);
		}
		return n({ filterCommentsByBlock: C }), (e, n) => (a(), u(h, null, [
			f(d(i), {
				visible: t.panelState.aiChatOpen.value,
				"on-apply": (e) => b(e, t.core, t.editor),
				onClose: n[0] ||= (e) => t.panelState.aiChatOpen.value = !1
			}, null, 8, ["visible", "on-apply"]),
			f(d(c), {
				visible: t.panelState.scoringPanelOpen.value,
				onClose: n[1] ||= (e) => t.panelState.scoringPanelOpen.value = !1
			}, null, 8, ["visible"]),
			f(d(s), {
				visible: t.panelState.designReferenceOpen.value,
				"has-existing-blocks": t.editor.content.value.blocks.length > 0,
				onClose: n[2] ||= (e) => t.panelState.designReferenceOpen.value = !1,
				onApply: n[3] ||= (e) => b(e, t.core, t.editor)
			}, null, 8, ["visible", "has-existing-blocks"]),
			f(d(o), {
				ref_key: "commentsSidebar",
				ref: S,
				visible: t.panelState.commentsOpen.value,
				onClose: n[4] ||= (e) => t.panelState.commentsOpen.value = !1
			}, null, 8, ["visible"]),
			f(d(l), {
				visible: t.panelState.testEmailModalOpen.value,
				"allowed-emails": t.testEmail.allowedEmails.value,
				"is-sending": t.testEmail.isSending.value,
				error: t.testEmail.error.value,
				onSend: n[5] ||= (e) => y("send-test-email", e),
				onClose: n[6] ||= (e) => t.panelState.testEmailModalOpen.value = !1
			}, null, 8, [
				"visible",
				"allowed-emails",
				"is-sending",
				"error"
			]),
			t.planConfigInstance.hasFeature("saved_modules") && t.config.modules !== !1 ? (a(), _(d(p), {
				key: 0,
				visible: t.showSaveModuleDialog,
				"pre-selected-block-id": t.saveModulePreSelectedBlockId,
				onClose: n[7] ||= (e) => {
					y("update:showSaveModuleDialog", !1), y("update:saveModulePreSelectedBlockId", null);
				},
				onSaved: n[8] ||= (e) => t.savedModulesHeadless.loadModules()
			}, null, 8, ["visible", "pre-selected-block-id"])) : g("", !0),
			t.planConfigInstance.hasFeature("saved_modules") && t.config.modules !== !1 ? (a(), _(d(m), {
				key: 1,
				visible: t.showModuleBrowserModal,
				onClose: n[9] ||= (e) => y("update:showModuleBrowserModal", !1),
				onInsert: x
			}, null, 8, ["visible"])) : g("", !0),
			f(d(v), {
				visible: t.panelState.mediaLibraryOpen.value,
				accept: t.panelState.mediaLibraryAccept.value,
				onSelect: t.mediaLib.handleMediaSelect,
				onClose: t.mediaLib.handleMediaLibraryClose
			}, null, 8, [
				"visible",
				"accept",
				"onSelect",
				"onClose"
			])
		], 64));
	}
}), Qe = {
	key: 0,
	class: "tpl-loading tpl:absolute tpl:inset-0 tpl:z-overlay tpl:flex tpl:flex-col tpl:bg-[var(--tpl-bg)]"
}, $e = { class: "tpl:flex tpl:flex-1 tpl:overflow-hidden" }, et = { class: "tpl:flex tpl:w-12 tpl:shrink-0 tpl:flex-col tpl:items-center tpl:gap-4 tpl:py-5 tpl:border-r tpl:border-[var(--tpl-border)]" }, tt = /* @__PURE__ */ s({
	__name: "CloudLoadingOverlay",
	props: { visible: { type: Boolean } },
	setup(e) {
		return (t, r) => e.visible ? (a(), u("div", Qe, [r[1] ||= E("<div class=\"tpl:flex tpl:h-14 tpl:shrink-0 tpl:items-center tpl:justify-between tpl:px-4 tpl:border-b tpl:border-[var(--tpl-border)]\"><div class=\"tpl-shimmer tpl:h-5 tpl:w-28 tpl:rounded-[var(--tpl-radius-sm)]\"></div><div class=\"tpl:flex tpl:gap-3\"><div class=\"tpl-shimmer tpl:h-8 tpl:w-20 tpl:rounded-[var(--tpl-radius-sm)]\"></div><div class=\"tpl-shimmer tpl:h-8 tpl:w-20 tpl:rounded-[var(--tpl-radius-sm)]\"></div></div></div>", 1), b("div", $e, [b("div", et, [(a(), u(h, null, n(5, (e) => b("div", {
			key: e,
			class: "tpl-shimmer tpl:size-7 tpl:rounded-[var(--tpl-radius-sm)]"
		})), 64))]), r[0] ||= E("<div class=\"tpl:flex tpl:flex-1 tpl:items-start tpl:justify-center tpl:overflow-auto tpl:p-8 tpl:bg-[var(--tpl-canvas-bg)]\"><div class=\"tpl:w-full tpl:max-w-[600px] tpl:rounded-[var(--tpl-radius)] tpl:p-6 tpl:bg-[var(--tpl-bg)] tpl:shadow-[var(--tpl-shadow-sm)]\"><div class=\"tpl:space-y-2 tpl:py-4\"><div class=\"tpl-shimmer tpl:h-3 tpl:w-3/4 tpl:rounded\"></div><div class=\"tpl-shimmer tpl:h-3 tpl:w-full tpl:rounded\"></div><div class=\"tpl-shimmer tpl:h-3 tpl:w-5/6 tpl:rounded\"></div></div><div class=\"tpl:py-4\"><div class=\"tpl-shimmer tpl:h-44 tpl:w-full tpl:rounded-[var(--tpl-radius-sm)]\"></div></div><div class=\"tpl:space-y-2 tpl:py-4\"><div class=\"tpl-shimmer tpl:h-3 tpl:w-full tpl:rounded\"></div><div class=\"tpl-shimmer tpl:h-3 tpl:w-2/3 tpl:rounded\"></div></div><div class=\"tpl:flex tpl:justify-center tpl:py-4\"><div class=\"tpl-shimmer tpl:h-10 tpl:w-36 tpl:rounded-[var(--tpl-radius-sm)]\"></div></div><div class=\"tpl:space-y-2 tpl:py-4\"><div class=\"tpl-shimmer tpl:mx-auto tpl:h-2.5 tpl:w-1/2 tpl:rounded\"></div><div class=\"tpl-shimmer tpl:mx-auto tpl:h-2.5 tpl:w-1/3 tpl:rounded\"></div></div></div></div><div class=\"tpl:flex tpl:w-[320px] tpl:shrink-0 tpl:flex-col tpl:gap-4 tpl:p-4 tpl:border-l tpl:border-[var(--tpl-border)]\"><div class=\"tpl-shimmer tpl:h-8 tpl:rounded-[var(--tpl-radius-sm)]\"></div><div class=\"tpl-shimmer tpl:h-32 tpl:rounded-[var(--tpl-radius)]\"></div><div class=\"tpl-shimmer tpl:h-32 tpl:rounded-[var(--tpl-radius)]\"></div></div>", 2)])])) : g("", !0);
	}
}), nt = {
	key: 0,
	role: "alert",
	class: "tpl-error tpl:absolute tpl:inset-0 tpl:z-overlay tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-6 tpl:px-8 tpl:bg-[var(--tpl-bg)]"
}, rt = { class: "tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-[var(--tpl-danger-light)]" }, it = { class: "tpl:flex tpl:flex-col tpl:items-center tpl:gap-2 tpl:text-center" }, at = { class: "tpl:text-lg tpl:font-semibold tpl:text-[var(--tpl-text)]" }, ot = { class: "tpl:max-w-md tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, st = /* @__PURE__ */ s({
	__name: "CloudErrorOverlay",
	props: {
		error: {},
		visible: { type: Boolean }
	},
	emits: ["retry"],
	setup(e, { emit: t }) {
		let n = t, { t: r } = k();
		function i(e) {
			return "isUnauthorized" in e && e.isUnauthorized ? r.error.authFailed : "isNotFound" in e && e.isNotFound ? r.error.templateNotFound : r.error.defaultMessage;
		}
		function o(e) {
			return "isNotFound" in e && !!e.isNotFound;
		}
		return (t, s) => e.visible && e.error ? (a(), u("div", nt, [
			b("div", rt, [f(d(he), {
				size: 32,
				"stroke-width": 1.5,
				class: "tpl:text-[var(--tpl-danger)]"
			})]),
			b("div", it, [b("h2", at, y(d(r).error.title), 1), b("p", ot, y(i(e.error)), 1)]),
			o(e.error) ? g("", !0) : (a(), u("button", {
				key: 0,
				class: "tpl-btn tpl-btn-primary tpl:inline-flex tpl:items-center tpl:gap-2 tpl:rounded-md tpl:px-4 tpl:py-2.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
				onClick: s[0] ||= (e) => n("retry")
			}, y(d(r).error.retry), 1))
		])) : g("", !0);
	}
}), ct = {
	key: 0,
	class: "tpl-preview-banner tpl:absolute tpl:top-14 tpl:right-0 tpl:left-0 tpl:z-40 tpl:flex tpl:items-center tpl:justify-center tpl:gap-4 tpl:px-4 tpl:py-3 tpl:bg-[var(--tpl-primary-light)] tpl:border-b tpl:border-[var(--tpl-primary)]"
}, lt = { class: "tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:text-[var(--tpl-text)]" }, ut = { class: "tpl:flex tpl:items-center tpl:gap-2" }, dt = /* @__PURE__ */ s({
	__name: "SnapshotPreviewBanner",
	props: { visible: { type: Boolean } },
	emits: ["cancel", "confirm"],
	setup(e, { emit: t }) {
		let n = t, { t: r } = k();
		return (t, i) => e.visible ? (a(), u("div", ct, [b("div", lt, [f(d(P), {
			size: 18,
			"stroke-width": 2,
			class: "tpl:text-[var(--tpl-primary)]"
		}), b("span", null, y(d(r).snapshotPreview.message), 1)]), b("div", ut, [b("button", {
			class: "tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-150 tpl:text-[var(--tpl-text-muted)] tpl:border tpl:border-[var(--tpl-border)]",
			style: { "background-color": "transparent" },
			onClick: i[0] ||= (e) => n("cancel")
		}, y(d(r).snapshotPreview.cancel), 1), b("button", {
			class: "tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
			onClick: i[1] ||= (e) => n("confirm")
		}, y(d(r).snapshotPreview.restore), 1)])])) : g("", !0);
	}
}), ft = {
	key: 0,
	role: "status",
	"aria-live": "polite",
	class: "tpl:absolute tpl:top-16 tpl:left-1/2 tpl:z-toast tpl:-translate-x-1/2 tpl:rounded-[var(--tpl-radius)] tpl:px-4 tpl:py-2.5 tpl:text-sm tpl:shadow-lg",
	style: {
		"background-color": "var(--tpl-warning-light)",
		color: "var(--tpl-text)",
		border: "1px solid var(--tpl-warning)"
	}
}, pt = /* @__PURE__ */ s({
	__name: "CollabUndoToast",
	props: { visible: { type: Boolean } },
	setup(e) {
		let { t } = R();
		return (n, r) => e.visible ? (a(), u("div", ft, y(d(t).history.collabWarning), 1)) : g("", !0);
	}
}), mt = ["data-tpl-theme"], ht = { class: "tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0" }, gt = { class: "tpl-main tpl:flex tpl:justify-center tpl:p-8" }, _t = ["aria-label"], vt = /* @__PURE__ */ de(/* @__PURE__ */ s({
	__name: "CloudEditor",
	props: {
		config: {},
		translations: {},
		cloudTranslations: {},
		fontsManager: {}
	},
	emits: ["ready"],
	setup(t, { expose: n, emit: s }) {
		let l = t;
		o(ve, l.cloudTranslations);
		let h = s, S = e(null), w = Ne({
			config: l.config,
			translations: l.translations,
			fontsManager: l.fontsManager,
			emit: h,
			getCommentsSidebar: () => S.value ? { filterByBlock: S.value.filterCommentsByBlock } : null
		}), { isInitializing: T, isAuthReady: E, initError: D, planConfigInstance: k, websocket: A, collaboration: j, isCollaborationEnabled: M, editor: N, core: P, featureFlags: F, mediaLib: I, exporter: ee, testEmail: L, commentsInstance: R, savedModulesHeadless: z, panelState: B, snapshotPreview: V, collabWarning: H, showSaveModuleDialog: U, showModuleBrowserModal: W, saveModulePreSelectedBlockId: G, setThemeOverrides: te, setUiTheme: K } = w;
		async function ne(e) {
			try {
				await L.sendTestEmail(e), B.testEmailModalOpen.value = !1;
			} catch {}
		}
		function re(e, t) {
			for (let n = 0; n < e.content.length; n++) {
				let r = J(e.content[n]), i = t === void 0 ? void 0 : t + n;
				N.addBlock(r, void 0, void 0, i);
			}
			W.value = !1;
		}
		let q = Fe({
			config: l.config,
			editor: N,
			websocket: A,
			planConfigInstance: k,
			snapshotPreview: V,
			core: P,
			exporter: ee,
			featureFlags: F,
			isDestroyed: w.isDestroyed
		});
		return w.onSaveHook.value = q.saveTemplate, v(() => {
			w.initialize();
		}), i(() => {
			w.destroy();
		}), n({
			getContent: () => N.content.value,
			setContent: (e) => N.setContent(e),
			setTheme: K,
			setThemeOverrides: te,
			create: q.createTemplate,
			load: q.loadTemplate,
			save: q.saveTemplate,
			sendTestEmail: L.sendTestEmail
		}), (e, n) => (a(), u("div", {
			class: C(["tpl tpl:relative tpl:h-full tpl:overflow-hidden", { "tpl:dark": d(N).state.darkMode }]),
			"data-tpl-theme": d(P).resolvedTheme.value,
			style: m(d(P).themeStyles.value)
		}, [
			f(x, {
				"enter-active-class": "tpl:transition-opacity tpl:duration-200",
				"enter-from-class": "tpl:opacity-100",
				"enter-to-class": "tpl:opacity-100",
				"leave-active-class": "tpl:transition-opacity tpl:duration-300",
				"leave-from-class": "tpl:opacity-100",
				"leave-to-class": "tpl:opacity-0"
			}, {
				default: r(() => [f(tt, { visible: d(T) || d(N).state.isLoading }, null, 8, ["visible"])]),
				_: 1
			}),
			f(x, {
				"enter-active-class": "tpl:transition-opacity tpl:duration-200",
				"enter-from-class": "tpl:opacity-0",
				"enter-to-class": "tpl:opacity-100",
				"leave-active-class": "tpl:transition-opacity tpl:duration-300",
				"leave-from-class": "tpl:opacity-100",
				"leave-to-class": "tpl:opacity-0"
			}, {
				default: r(() => [f(st, {
					error: d(D),
					visible: !!d(D) && !d(T),
					onRetry: d(w).initialize
				}, null, 8, [
					"error",
					"visible",
					"onRetry"
				])]),
				_: 1
			}),
			f(Xe, {
				editor: d(N),
				core: d(P),
				"feature-flags": d(F),
				"panel-state": d(B),
				"snapshot-preview": d(V),
				"comments-instance": d(R),
				"test-email": d(L),
				websocket: d(A),
				collaboration: d(j),
				"is-collaboration-enabled": d(M),
				"is-saving": d(N).state.isSaving || d(F).isSaveExporting.value,
				"is-save-disabled": d(N).state.isSaving || d(F).isSaveExporting.value || !d(N).state.isDirty,
				onSave: n[0] ||= (e) => d(q).saveTemplate().catch((e) => l.config.onError?.(e))
			}, null, 8, [
				"editor",
				"core",
				"feature-flags",
				"panel-state",
				"snapshot-preview",
				"comments-instance",
				"test-email",
				"websocket",
				"collaboration",
				"is-collaboration-enabled",
				"is-saving",
				"is-save-disabled"
			]),
			f(dt, {
				visible: d(V).isPreviewingSnapshot.value,
				onCancel: d(V).cancelPreview,
				onConfirm: d(V).confirmRestoreSnapshot
			}, null, 8, [
				"visible",
				"onCancel",
				"onConfirm"
			]),
			f(x, {
				"enter-active-class": "tpl:transition-all tpl:duration-200 tpl:ease-out",
				"enter-from-class": "tpl:translate-y-[-8px] tpl:opacity-0",
				"enter-to-class": "tpl:translate-y-0 tpl:opacity-100",
				"leave-active-class": "tpl:transition-all tpl:duration-300 tpl:ease-in",
				"leave-from-class": "tpl:translate-y-0 tpl:opacity-100",
				"leave-to-class": "tpl:translate-y-[-8px] tpl:opacity-0"
			}, {
				default: r(() => [f(pt, { visible: d(H).collabUndoWarningVisible.value }, null, 8, ["visible"])]),
				_: 1
			}),
			c(f(we, null, null, 512), [[p, !d(N).state.previewMode]]),
			b("div", {
				class: C(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto", [d(N).state.previewMode ? "tpl:left-0 tpl:right-0" : d(B).rightPanelOpen.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]", d(V).isPreviewingSnapshot.value ? "tpl:top-[104px]" : "tpl:top-14"]]),
				style: {
					transition: "all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",
					"background-color": "var(--tpl-canvas-bg)"
				}
			}, [b("div", ht, [f(x, { name: "tpl-restore-btn" }, {
				default: r(() => [d(P).conditionPreview.hasHiddenBlocks.value ? (a(), u("button", {
					key: 0,
					class: "tpl:absolute tpl:left-1/2 tpl:top-2 tpl:-translate-x-1/2 tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-full tpl:border tpl:px-3.5 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:whitespace-nowrap tpl:shadow-md tpl:hover:opacity-80",
					style: {
						"background-color": "var(--tpl-warning-light)",
						color: "var(--tpl-warning)",
						"border-color": "var(--tpl-warning)",
						"backdrop-filter": "blur(8px)"
					},
					onClick: n[1] ||= (e) => d(P).conditionPreview.reset()
				}, [f(d(ye), {
					size: 13,
					"stroke-width": 2
				}), O(" " + y(d(P).t.blockSettings.restoreHiddenBlocks), 1)])) : g("", !0)]),
				_: 1
			})]), b("main", gt, [f(Ee, {
				viewport: d(N).state.viewport,
				content: d(N).content.value,
				"selected-block-id": d(N).state.selectedBlockId,
				"dark-mode": d(N).state.darkMode,
				"preview-mode": d(N).state.previewMode,
				"locked-blocks": d(j)?.lockedBlocks.value ?? void 0,
				onSelectBlock: d(N).selectBlock,
				onOpenAiChat: n[2] ||= (e) => d(B).aiChatOpen.value = !0,
				onOpenDesignReference: n[3] ||= (e) => d(B).designReferenceOpen.value = !0
			}, null, 8, [
				"viewport",
				"content",
				"selected-block-id",
				"dark-mode",
				"preview-mode",
				"locked-blocks",
				"onSelectBlock"
			])])], 2),
			t.config.branding !== !1 && !d(F).isWhiteLabeled.value ? (a(), _(De, {
				key: 0,
				"position-class": [d(N).state.previewMode ? "tpl:left-0 tpl:right-0" : d(B).rightPanelOpen.value ? "tpl:left-12 tpl:right-[680px]" : "tpl:left-12 tpl:right-[320px]"]
			}, null, 8, ["position-class"])) : g("", !0),
			b("div", {
				class: "tpl-sr-only",
				role: "status",
				"aria-live": "polite",
				"aria-atomic": "true",
				"aria-label": d(P).t.landmarks.reorderAnnouncements
			}, y(d(P).keyboardReorder.announcement.value), 9, _t),
			c(f(xe, {
				"selected-block": d(N).selectedBlock.value,
				settings: d(N).content.value.settings,
				"shifted-left": d(B).rightPanelOpen.value,
				onUpdateBlock: n[4] ||= (e) => d(N).updateBlock(d(N).selectedBlock.value.id, e),
				onDeleteBlock: n[5] ||= (e) => d(P).blockActions.deleteBlock(d(N).selectedBlock.value.id),
				onDuplicateBlock: n[6] ||= (e) => d(P).blockActions.duplicateBlock(d(N).selectedBlock.value),
				onUpdateSettings: d(N).updateSettings
			}, null, 8, [
				"selected-block",
				"settings",
				"shifted-left",
				"onUpdateSettings"
			]), [[p, !d(N).state.previewMode]]),
			!d(T) && d(E) ? (a(), _(Ze, {
				key: 1,
				ref_key: "cloudPanelsRef",
				ref: S,
				config: l.config,
				editor: d(N),
				core: d(P),
				"panel-state": d(B),
				"plan-config-instance": d(k),
				"test-email": d(L),
				"media-lib": d(I),
				"saved-modules-headless": d(z),
				"show-save-module-dialog": d(U),
				"save-module-pre-selected-block-id": d(G),
				"show-module-browser-modal": d(W),
				"onUpdate:showSaveModuleDialog": n[7] ||= (e) => U.value = e,
				"onUpdate:saveModulePreSelectedBlockId": n[8] ||= (e) => G.value = e,
				"onUpdate:showModuleBrowserModal": n[9] ||= (e) => W.value = e,
				onSendTestEmail: ne,
				onModuleInsert: re
			}, null, 8, [
				"config",
				"editor",
				"core",
				"panel-state",
				"plan-config-instance",
				"test-email",
				"media-lib",
				"saved-modules-headless",
				"show-save-module-dialog",
				"save-module-pre-selected-block-id",
				"show-module-browser-modal"
			])) : g("", !0)
		], 14, mt));
	}
}), [["__scopeId", "data-v-4a2ee70b"]]);
//#endregion
export { vt as default };

//# sourceMappingURL=CloudEditor-CRYF-bR3.js.map