@templatical/editor 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/dist/{AiChatSidebar-busJk9hm.js → AiChatSidebar-DwME3f-a.js} +84 -70
  2. package/dist/{AiFeatureMenu-DLGv_-pj.js → AiFeatureMenu-DJvWL1GZ.js} +23 -23
  3. package/dist/CloudEditor-Fe0ssRgi.js +1082 -0
  4. package/dist/{CollaboratorBar-Dv3l52vC.js → CollaboratorBar-DTT0EkZn.js} +25 -21
  5. package/dist/{CommentsSidebar-4tjp0VU5.js → CommentsSidebar-DrJhQRXK.js} +131 -131
  6. package/dist/{DesignReferenceSidebar-CmwXvltV.js → DesignReferenceSidebar-DdOht5zn.js} +49 -49
  7. package/dist/ModuleBrowserModal-CiV_jOEM.js +205 -0
  8. package/dist/{ModulePreviewCanvas-BcBJLnwL.js → ModulePreviewCanvas-Bmy6Y1WE.js} +2 -2
  9. package/dist/ParagraphEditor-CoQ3NlS7.js +688 -0
  10. package/dist/{RichTextEditorContent-CQqodi7p.js → RichTextEditorContent-CHJlh7HJ.js} +8 -4
  11. package/dist/{SaveModuleDialog-Bmzi72td.js → SaveModuleDialog-CD2ZYq1o.js} +25 -25
  12. package/dist/{SnapshotHistory-AEgi9Xsn.js → SnapshotHistory-DltsKvhP.js} +2 -2
  13. package/dist/TemplateScoringPanel-DmnmUE3y.js +254 -0
  14. package/dist/{TestEmailModal-Dpq1is9S.js → TestEmailModal-Dl633j9o.js} +3 -3
  15. package/dist/{TitleEditor-CLcDdcWI.js → TitleEditor-C7fds2Nc.js} +7 -7
  16. package/dist/{TplModal-CGzRjR96.js → TplModal-C5_CF-qn.js} +2 -2
  17. package/dist/{blockTypeIcons-BpPTqcok.js → blockTypeIcons-BrKZB10B.js} +1 -1
  18. package/dist/cdn/chunks/AiChatSidebar-X_Bv3Qys.js +2 -0
  19. package/dist/cdn/chunks/AiFeatureMenu-C5UQmEgV.js +59 -0
  20. package/dist/cdn/chunks/AiFeatureMenu-C5UQmEgV.js.map +1 -0
  21. package/dist/cdn/chunks/CloudEditor-DeTolKnf.js +1056 -0
  22. package/dist/cdn/chunks/CloudEditor-DeTolKnf.js.map +1 -0
  23. package/dist/cdn/chunks/CollaboratorBar-DO1nxSrr.js +51 -0
  24. package/dist/cdn/chunks/CollaboratorBar-DO1nxSrr.js.map +1 -0
  25. package/dist/cdn/chunks/CommentsSidebar-4MTw_hue.js +2 -0
  26. package/dist/cdn/chunks/DesignReferenceSidebar-Bswh4Yx4.js +2 -0
  27. package/dist/{ModuleBrowserModal-lrk3Fr0H.js → cdn/chunks/ModuleBrowserModal-ChBr3aXj.js} +52 -62
  28. package/dist/cdn/chunks/ModuleBrowserModal-ChBr3aXj.js.map +1 -0
  29. package/dist/cdn/chunks/ModulePreviewCanvas-DkSvri9H.js +107 -0
  30. package/dist/cdn/chunks/ModulePreviewCanvas-DkSvri9H.js.map +1 -0
  31. package/dist/cdn/chunks/ParagraphEditor-DU3oUKA7.js +539 -0
  32. package/dist/cdn/chunks/ParagraphEditor-DU3oUKA7.js.map +1 -0
  33. package/dist/cdn/chunks/RichTextEditorContent-BrsW1p9s.js +106 -0
  34. package/dist/cdn/chunks/RichTextEditorContent-BrsW1p9s.js.map +1 -0
  35. package/dist/cdn/chunks/SaveModuleDialog-CjqKkTEc.js +119 -0
  36. package/dist/cdn/chunks/SaveModuleDialog-CjqKkTEc.js.map +1 -0
  37. package/dist/cdn/chunks/SnapshotHistory-KME4xmn_.js +2 -0
  38. package/dist/cdn/chunks/TemplateScoringPanel-DgB3xDN6.js +2 -0
  39. package/dist/cdn/chunks/TestEmailModal-DdpvRbYf.js +2 -0
  40. package/dist/cdn/chunks/TitleEditor-C8FYbadT.js +166 -0
  41. package/dist/cdn/chunks/TitleEditor-C8FYbadT.js.map +1 -0
  42. package/dist/cdn/chunks/_rolldown_dynamic_import_helper-DMEI4TQ3.js +9 -0
  43. package/dist/cdn/chunks/blockTypeIcons-5QwYklNq.js +22 -0
  44. package/dist/cdn/chunks/blockTypeIcons-5QwYklNq.js.map +1 -0
  45. package/dist/cdn/chunks/de-BB3dgVOc.js +700 -0
  46. package/dist/cdn/chunks/de-BB3dgVOc.js.map +1 -0
  47. package/dist/cdn/chunks/de-BvYD17KT.js +89 -0
  48. package/dist/cdn/chunks/de-BvYD17KT.js.map +1 -0
  49. package/dist/cdn/chunks/dist-BF5c3Dr-.js +2 -0
  50. package/dist/cdn/chunks/dist-BGzvIxcJ.js +2 -0
  51. package/dist/cdn/chunks/dist-CFemF8rI.js +2 -0
  52. package/dist/cdn/chunks/dist-Co6uFhFK.js +2 -0
  53. package/dist/cdn/chunks/dist-DCikBY9K.js +2 -0
  54. package/dist/cdn/chunks/dist-DUILafAC.js +2 -0
  55. package/dist/cdn/chunks/dist-DghiKH0A.js +2 -0
  56. package/dist/cdn/chunks/dist-Dw8ckvfK.js +2 -0
  57. package/dist/cdn/chunks/dist-H07p0KAw.js +2 -0
  58. package/dist/cdn/chunks/dist-KYv9v_1z2.js +457 -0
  59. package/dist/cdn/chunks/dist-KYv9v_1z2.js.map +1 -0
  60. package/dist/cdn/chunks/dist-MjnKIc0W.js +2 -0
  61. package/dist/cdn/chunks/dist-odp0vGRv.js +2 -0
  62. package/dist/cdn/chunks/draggable-BQNU47zu.js +11544 -0
  63. package/dist/cdn/chunks/{draggable-ClUwYCFL.js.map → draggable-BQNU47zu.js.map} +1 -1
  64. package/dist/cdn/chunks/emojiData-BVEJHcNH.js +19 -0
  65. package/dist/cdn/chunks/{emojiData-6fVLNqeH.js.map → emojiData-BVEJHcNH.js.map} +1 -1
  66. package/dist/cdn/chunks/en-CpotcOPr.js +89 -0
  67. package/dist/cdn/chunks/en-CpotcOPr.js.map +1 -0
  68. package/dist/cdn/chunks/en-DeDcpnoS.js +700 -0
  69. package/dist/cdn/chunks/en-DeDcpnoS.js.map +1 -0
  70. package/dist/cdn/chunks/extensions-Bj7USRLr.js +419 -0
  71. package/dist/cdn/chunks/{extensions-ea_ewKUl.js.map → extensions-Bj7USRLr.js.map} +1 -1
  72. package/dist/cdn/chunks/features-Ds0XUfte.js +6737 -0
  73. package/dist/cdn/chunks/features-Ds0XUfte.js.map +1 -0
  74. package/dist/cdn/chunks/icons-fWsuSvgd.js +653 -0
  75. package/dist/cdn/chunks/icons-fWsuSvgd.js.map +1 -0
  76. package/dist/cdn/chunks/liquid.browser-C1VIYISn.js +3272 -0
  77. package/dist/cdn/chunks/liquid.browser-C1VIYISn.js.map +1 -0
  78. package/dist/cdn/chunks/media-library-BGQm_OyC.js +6005 -0
  79. package/dist/cdn/chunks/media-library-BGQm_OyC.js.map +1 -0
  80. package/dist/cdn/chunks/pusher-DJPhQnE8.js +2505 -0
  81. package/dist/cdn/chunks/pusher-DJPhQnE8.js.map +1 -0
  82. package/dist/cdn/chunks/readableTextColor-Cd_cgWO_.js +32 -0
  83. package/dist/cdn/chunks/readableTextColor-Cd_cgWO_.js.map +1 -0
  84. package/dist/cdn/chunks/rolldown-runtime-DPITmOBR.js +20 -0
  85. package/dist/cdn/chunks/src-3i8rPuqd.js +494 -0
  86. package/dist/cdn/chunks/src-3i8rPuqd.js.map +1 -0
  87. package/dist/cdn/chunks/styleConstants-DFe3I4Op.js +57 -0
  88. package/dist/cdn/chunks/{styleConstants-CNejCb-L.js.map → styleConstants-DFe3I4Op.js.map} +1 -1
  89. package/dist/cdn/chunks/styles-Dgijy53u.js +3350 -0
  90. package/dist/cdn/chunks/styles-Dgijy53u.js.map +1 -0
  91. package/dist/cdn/chunks/tiptap-BhxaWR8R.js +14208 -0
  92. package/dist/cdn/chunks/{tiptap-Cya4P9CN.js.map → tiptap-BhxaWR8R.js.map} +1 -1
  93. package/dist/cdn/editor.css +2 -1
  94. package/dist/cdn/editor.js +231 -1
  95. package/dist/cdn/editor.js.map +1 -1
  96. package/dist/{de-B4Ob4vCo.js → de-D7TLGIPA.js} +20 -4
  97. package/dist/{dist-DmpMJbmZ.js → dist-Ci5lFuUy.js} +1 -1
  98. package/dist/{en-YXsspZJG.js → en-DvtiEMwP.js} +20 -4
  99. package/dist/{extensions-CKM99njP.js → extensions-DWx_jj8v.js} +3 -3
  100. package/dist/{keys-Dwa2PmdD.js → keys-C0MQRs8d.js} +3 -3
  101. package/dist/readableTextColor-LDlmVEUv.js +30 -0
  102. package/dist/{styleConstants-D4SOZGBV.js → styleConstants-Cxw88naD.js} +5 -5
  103. package/dist/styles-fdXNRqI3.js +3556 -0
  104. package/dist/templatical-editor.css +1 -1
  105. package/dist/templatical-editor.js +122 -128
  106. package/dist/templatical-editor.umd.cjs +62 -71
  107. package/dist/{useEditorCore-Cc4RCwWq.js → useEditorCore-DUGD6pq_.js} +1247 -1088
  108. package/dist/{useI18n-DUirdXEX.js → useI18n-D6m7ZUgY.js} +1 -1
  109. package/dist/{useMergeTag-DVnlvPYJ.js → useMergeTag-BZ3X0bNr.js} +1 -1
  110. package/package.json +4 -2
  111. package/dist/CloudEditor-BDnHd6Um.js +0 -919
  112. package/dist/ParagraphEditor-DH8cSC6m.js +0 -625
  113. package/dist/TemplateScoringPanel-CTgMtc0-.js +0 -249
  114. package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js +0 -3
  115. package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js.map +0 -1
  116. package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js +0 -2
  117. package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js.map +0 -1
  118. package/dist/cdn/chunks/TitleEditor-e_UTyxjd.js +0 -3
  119. package/dist/cdn/chunks/TitleEditor-e_UTyxjd.js.map +0 -1
  120. package/dist/cdn/chunks/dist-0UheN8rK.js +0 -1
  121. package/dist/cdn/chunks/dist-55mmbGQ9.js +0 -1
  122. package/dist/cdn/chunks/dist-B31mxKyP.js +0 -1
  123. package/dist/cdn/chunks/dist-B5JI9nIg.js +0 -1
  124. package/dist/cdn/chunks/dist-B93vLKhU.js +0 -1
  125. package/dist/cdn/chunks/dist-BDt3FJvj.js +0 -1
  126. package/dist/cdn/chunks/dist-BJRuFHmi.js +0 -1
  127. package/dist/cdn/chunks/dist-BKSzrf0L.js +0 -1
  128. package/dist/cdn/chunks/dist-BL8c5gYQ.js +0 -1
  129. package/dist/cdn/chunks/dist-CYThWMP5.js +0 -1
  130. package/dist/cdn/chunks/dist-DxZbPJYt.js +0 -1
  131. package/dist/cdn/chunks/draggable-ClUwYCFL.js +0 -17
  132. package/dist/cdn/chunks/emojiData-6fVLNqeH.js +0 -2
  133. package/dist/cdn/chunks/extensions-ea_ewKUl.js +0 -2
  134. package/dist/cdn/chunks/icons-vmLJTaJk.js +0 -2
  135. package/dist/cdn/chunks/icons-vmLJTaJk.js.map +0 -1
  136. package/dist/cdn/chunks/rolldown-runtime-BakkzWXw.js +0 -1
  137. package/dist/cdn/chunks/styleConstants-CNejCb-L.js +0 -2
  138. package/dist/cdn/chunks/tiptap-Cya4P9CN.js +0 -145
  139. package/dist/cdn/chunks/useEditorCore-CwuxQuvh.js +0 -2
  140. package/dist/cdn/chunks/useEditorCore-CwuxQuvh.js.map +0 -1
  141. package/dist/cdn/chunks/useMergeTag-DVOz1v9p.js +0 -2
  142. package/dist/cdn/chunks/useMergeTag-DVOz1v9p.js.map +0 -1
  143. package/dist/i18n-CJsFtdbZ.js +0 -23
  144. package/dist/styles-DSw1VNU3.js +0 -3406
@@ -0,0 +1,3350 @@
1
+ import { a as e } from "./rolldown-runtime-DPITmOBR.js";
2
+ import { $ as t, B as n, E as r, F as i, H as a, I as o, N as s, R as c, S as l, U as u, Z as d, _ as f, at as p, b as m, c as h, ct as g, d as _, g as v, h as y, k as b, l as x, lt as S, m as C, n as w, p as T, s as E, st as D, t as O, u as k, y as A } from "./draggable-BQNU47zu.js";
3
+ import { $ as j, A as ee, At as M, B as te, Bt as N, Dt as ne, F as P, Ft as re, G as ie, Gt as F, H as ae, Ht as oe, I as se, It as ce, K as le, L as ue, Lt as de, M as fe, N as pe, Nt as me, Ot as he, P as ge, R as _e, St as ve, U as ye, Ut as be, V as xe, Vt as Se, W as Ce, Wt as we, Xt as Te, Z as Ee, Zt as De, _n as Oe, _t as ke, an as Ae, at as je, bt as Me, cn as Ne, dn as Pe, et as Fe, gt as Ie, hn as I, ht as Le, in as Re, j as ze, jt as L, ln as Be, lt as Ve, mn as He, mt as Ue, pn as We, rt as Ge, sn as Ke, tt as qe, vt as Je, wt as Ye, yt as Xe, zt as Ze } from "./features-Ds0XUfte.js";
4
+ import { A as Qe, B as $e, F as et, I as tt, M as nt, N as rt, O as it, P as R, T as z, _ as at, a as ot, b as st, c as ct, h as lt, m as ut, o as dt, q as ft, s as pt, u as mt, v as ht } from "./icons-fWsuSvgd.js";
5
+ import { t as gt } from "./readableTextColor-Cd_cgWO_.js";
6
+ import { t as _t } from "./blockTypeIcons-5QwYklNq.js";
7
+ import { _ as vt, c as yt, f as B, g as bt, h as V, i as xt, l as St, m as H, p as U, t as Ct, u as wt } from "./styleConstants-DFe3I4Op.js";
8
+ //#region src/components/Canvas.vue?vue&type=script&setup=true&lang.ts
9
+ var Tt = /* @__PURE__ */ e(O(), 1), Et = ["aria-label"], Dt = { class: "tpl:relative" }, Ot = {
10
+ class: "tpl:inline-flex tpl:size-3 tpl:items-center tpl:justify-center tpl:rounded-full tpl:text-[8px] tpl:font-bold",
11
+ style: { "background-color": "color-mix(\n in srgb,\n var(--tpl-bg) 30%,\n transparent\n )" }
12
+ }, kt = {
13
+ key: 0,
14
+ class: "tpl-canvas-empty tpl:m-6 tpl:flex tpl:min-h-[400px] tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded-xl tpl:border-2 tpl:border-dashed tpl:px-10 tpl:py-12 tpl:text-center tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-bg-elevated)] tpl:font-[var(--tpl-font-family)]"
15
+ }, At = { class: "tpl-canvas-empty-icon tpl:mb-4 tpl:text-[var(--tpl-primary)]" }, jt = { class: "tpl-canvas-empty-title tpl:m-0 tpl:mb-2 tpl:text-base tpl:font-semibold tpl:text-[var(--tpl-primary)]" }, Mt = { class: "tpl-canvas-empty-text tpl:m-0 tpl:text-sm tpl:text-[var(--tpl-text-dim)]" }, Nt = {
16
+ key: 0,
17
+ class: "tpl:m-0 tpl:mt-2 tpl:flex tpl:flex-wrap tpl:items-center tpl:justify-center tpl:gap-x-1 tpl:gap-y-0.5 tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
18
+ }, Pt = {
19
+ key: 1,
20
+ class: "tpl:m-0 tpl:mt-4 tpl:flex tpl:flex-wrap tpl:items-center tpl:justify-center tpl:gap-x-1 tpl:gap-y-0.5 tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
21
+ }, Ft = /* @__PURE__ */ j(/* @__PURE__ */ l({
22
+ __name: "Canvas",
23
+ props: {
24
+ viewport: {},
25
+ content: {},
26
+ selectedBlockId: {},
27
+ darkMode: { type: Boolean },
28
+ previewMode: { type: Boolean },
29
+ lockedBlocks: {}
30
+ },
31
+ emits: [
32
+ "select-block",
33
+ "open-ai-chat",
34
+ "open-design-reference"
35
+ ],
36
+ setup(e, { emit: t }) {
37
+ let n = {
38
+ section: se,
39
+ title: ue,
40
+ paragraph: xe,
41
+ image: ye,
42
+ button: he,
43
+ divider: ie,
44
+ spacer: fe,
45
+ html: Ce,
46
+ social: pe,
47
+ menu: ae,
48
+ table: ze,
49
+ video: ee,
50
+ countdown: ne,
51
+ custom: le
52
+ }, i = e, o = t, { t: l } = L(), d = Te(oe, "Canvas"), _ = r(Ze, null), b = r(ce, null), x = r(de, {}), w = T(() => (x.plan?.hasFeature("ai_generation") ?? !1) && (x.ai?.isFeatureEnabled("chat") ?? !1)), E = T(() => (x.plan?.hasFeature("ai_generation") ?? !1) && (x.ai?.isFeatureEnabled("designToTemplate") ?? !1)), O = T({
53
+ get: () => i.content.blocks,
54
+ set: (e) => {
55
+ d.setContent({
56
+ ...i.content,
57
+ blocks: e
58
+ });
59
+ }
60
+ }), k = T(() => {
61
+ switch (i.viewport) {
62
+ case "mobile": return 375;
63
+ case "tablet": return 768;
64
+ default: return i.content.settings.width;
65
+ }
66
+ }), j = T(() => ({
67
+ backgroundColor: i.content.settings.backgroundColor,
68
+ fontFamily: i.content.settings.fontFamily
69
+ }));
70
+ function M(e) {
71
+ i.previewMode || e.target === e.currentTarget && o("select-block", null);
72
+ }
73
+ function N(e) {
74
+ return te(e, b, n);
75
+ }
76
+ function P(e) {
77
+ return i.lockedBlocks?.get(e) ?? null;
78
+ }
79
+ function re(e, t) {
80
+ e.type === "custom" && d.updateBlock(e.id, {
81
+ fieldValues: t.fieldValues,
82
+ dataSourceFetched: t.dataSourceFetched
83
+ });
84
+ }
85
+ return (t, n) => (s(), f("div", {
86
+ "data-testid": "canvas-wrapper",
87
+ role: "region",
88
+ "aria-label": p(l).landmarks.canvas,
89
+ class: "tpl-canvas-wrapper tpl:rounded-lg",
90
+ style: g({
91
+ width: `${k.value}px`,
92
+ backgroundColor: e.content.settings.backgroundColor,
93
+ boxShadow: e.darkMode ? "none" : "var(--tpl-shadow-xl)",
94
+ filter: e.darkMode ? "invert(1) hue-rotate(180deg)" : "none",
95
+ transition: "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1), filter 300ms ease"
96
+ })
97
+ }, [C("div", {
98
+ class: D(["tpl-canvas tpl:rounded-lg", {
99
+ "tpl-canvas--dark-mode": e.darkMode,
100
+ "tpl-preview-mode": e.previewMode
101
+ }]),
102
+ style: g(j.value),
103
+ onClick: M
104
+ }, [m(p(Tt.default), {
105
+ modelValue: O.value,
106
+ "onUpdate:modelValue": n[2] ||= (e) => O.value = e,
107
+ group: "blocks",
108
+ "item-key": "id",
109
+ animation: 150,
110
+ "ghost-class": "tpl-ghost",
111
+ "drag-class": "tpl-dragging",
112
+ handle: ".tpl-block-btn",
113
+ "invert-swap": !0,
114
+ "inverted-swap-threshold": .65,
115
+ disabled: e.previewMode,
116
+ class: "tpl-canvas-blocks"
117
+ }, {
118
+ item: a(({ element: t }) => [u(C("div", null, [C("div", Dt, [P(t.id) ? (s(), f("div", {
119
+ key: 0,
120
+ class: "tpl-collab-lock tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[4] tpl:rounded-sm",
121
+ style: g({
122
+ outline: `2px solid ${P(t.id).color}`,
123
+ outlineOffset: "-1px"
124
+ })
125
+ }, [C("span", {
126
+ class: "tpl:absolute tpl:-top-0.5 tpl:left-1/2 tpl:z-[5] tpl:flex tpl:-translate-x-1/2 tpl:-translate-y-full tpl:items-center tpl:gap-1 tpl:rounded-full tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:whitespace-nowrap",
127
+ style: g({
128
+ backgroundColor: P(t.id).color,
129
+ color: p(gt)(P(t.id).color)
130
+ })
131
+ }, [C("span", Ot, S(P(t.id).name.charAt(0)), 1), A(" " + S(P(t.id).name), 1)], 4)], 4)) : v("", !0), m(_e, {
132
+ block: t,
133
+ "is-selected": !e.previewMode && e.selectedBlockId === t.id && !P(t.id),
134
+ viewport: e.viewport,
135
+ "preview-mode": e.previewMode,
136
+ onSelect: (n) => e.previewMode || P(t.id) ? void 0 : o("select-block", t.id)
137
+ }, {
138
+ default: a(() => [(s(), y(c(N(t)), {
139
+ block: t,
140
+ viewport: e.viewport,
141
+ onFetchData: (e) => re(t, e),
142
+ onUpdate: (e) => p(d).updateBlock(t.id, e)
143
+ }, null, 40, [
144
+ "block",
145
+ "viewport",
146
+ "onFetchData",
147
+ "onUpdate"
148
+ ]))]),
149
+ _: 2
150
+ }, 1032, [
151
+ "block",
152
+ "is-selected",
153
+ "viewport",
154
+ "preview-mode",
155
+ "onSelect"
156
+ ])])], 512), [[h, !p(_)?.isHidden(t.id)]])]),
157
+ footer: a(() => [O.value.length === 0 && !e.previewMode ? (s(), f("div", kt, [
158
+ C("div", At, [m(p(lt), {
159
+ size: 48,
160
+ "stroke-width": 1
161
+ })]),
162
+ C("p", jt, S(p(l).canvas.noBlocks), 1),
163
+ C("p", Mt, S(p(l).canvas.dragHint), 1),
164
+ w.value ? (s(), f("p", Nt, [
165
+ A(S(p(l).canvas.aiHintChat) + " ", 1),
166
+ C("button", {
167
+ class: "tpl:inline-flex tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:whitespace-nowrap tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-sm tpl:font-semibold tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary-hover)]",
168
+ onClick: n[0] ||= (e) => o("open-ai-chat")
169
+ }, [m(p(je), {
170
+ size: 14,
171
+ "stroke-width": 2
172
+ }), A(" " + S(p(l).aiMenu.aiAssistant), 1)]),
173
+ A(" " + S(p(l).canvas.aiHintChatSuffix), 1)
174
+ ])) : v("", !0),
175
+ E.value ? (s(), f("p", Pt, [
176
+ A(S(p(l).canvas.aiHintDesign) + " ", 1),
177
+ C("button", {
178
+ class: "tpl:inline-flex tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:gap-1 tpl:whitespace-nowrap tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-sm tpl:font-semibold tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary-hover)]",
179
+ onClick: n[1] ||= (e) => o("open-design-reference")
180
+ }, [m(p(Ie), {
181
+ size: 14,
182
+ "stroke-width": 2
183
+ }), A(" " + S(p(l).aiMenu.designToTemplate), 1)]),
184
+ A(" " + S(p(l).canvas.aiHintDesignSuffix), 1)
185
+ ])) : v("", !0)
186
+ ])) : v("", !0)]),
187
+ _: 1
188
+ }, 8, ["modelValue", "disabled"])], 6)], 12, Et));
189
+ }
190
+ }), [["__scopeId", "data-v-43f4b3a0"]]), It = ["aria-label"], Lt = {
191
+ key: 0,
192
+ class: "tpl:border-b tpl:px-1 tpl:pb-1 tpl:border-[var(--tpl-border)]"
193
+ }, Rt = ["aria-label"], zt = {
194
+ key: 0,
195
+ class: "tpl:flex-1 tpl:truncate tpl:text-sm tpl:font-medium"
196
+ }, Bt = {
197
+ key: 1,
198
+ class: "tpl:shrink-0 tpl:rounded-full tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]"
199
+ }, Vt = [
200
+ "data-palette-type",
201
+ "aria-label",
202
+ "onClick",
203
+ "onKeydown"
204
+ ], Ht = { class: "tpl:flex tpl:shrink-0 tpl:items-center tpl:justify-center tpl:transition-transform tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:scale-105" }, Ut = {
205
+ key: 0,
206
+ class: "tpl:truncate tpl:text-sm tpl:font-medium"
207
+ }, Wt = /* @__PURE__ */ l({
208
+ __name: "Sidebar",
209
+ setup(e) {
210
+ let { t: n, format: i } = L(), o = r(N, []), l = r(re, void 0), u = r(oe, null), d = r(de, {}), h = T(() => (d.savedModules?.moduleCount.value ?? 0) > 0), _ = t(!1), b = [
211
+ "section",
212
+ "image",
213
+ "title",
214
+ "paragraph",
215
+ "button",
216
+ "divider",
217
+ "video",
218
+ "social",
219
+ "menu",
220
+ "table",
221
+ "spacer",
222
+ "html"
223
+ ], x = T(() => {
224
+ let e = b.map((e) => ({
225
+ type: e,
226
+ label: M(e, n)
227
+ }));
228
+ return d.plan && e.splice(-1, 0, {
229
+ type: "countdown",
230
+ label: M("countdown", n)
231
+ }), e;
232
+ }), w = T(() => o.map((e) => ({
233
+ type: `custom:${e.type}`,
234
+ label: e.name,
235
+ isCustom: !0,
236
+ icon: e.icon
237
+ }))), E = T(() => [...x.value, ...w.value]);
238
+ function D(e) {
239
+ if (e.isCustom) {
240
+ let t = e.type.replace("custom:", ""), n = o.find((e) => e.type === t);
241
+ if (n) return He(n);
242
+ }
243
+ return We(e.type, l);
244
+ }
245
+ function O(e) {
246
+ if (!u) return;
247
+ let t = D(e);
248
+ u.addBlock(t), u.selectBlock(t.id);
249
+ }
250
+ function k(e, t) {
251
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), O(t));
252
+ }
253
+ return (e, t) => (s(), f("aside", {
254
+ "aria-label": p(n).sidebarNav.palette,
255
+ class: "tpl-sidebar-rail tpl:absolute tpl:top-14 tpl:bottom-0 tpl:left-0 tpl:z-40 tpl:overflow-hidden",
256
+ style: g({
257
+ width: _.value ? "200px" : "48px",
258
+ backgroundColor: "var(--tpl-bg-elevated)",
259
+ borderRight: "1px solid var(--tpl-border)",
260
+ boxShadow: _.value ? "var(--tpl-shadow-lg)" : "none",
261
+ transition: "width 200ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1)"
262
+ }),
263
+ onMouseenter: t[1] ||= (e) => _.value = !0,
264
+ onMouseleave: t[2] ||= (e) => _.value = !1,
265
+ onFocusin: t[3] ||= (e) => _.value = !0,
266
+ onFocusout: t[4] ||= (e) => _.value = !1
267
+ }, [h.value ? (s(), f("div", Lt, [C("button", {
268
+ type: "button",
269
+ "aria-label": p(n).sidebarNav.browseModules,
270
+ class: "tpl:flex tpl:h-10 tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-3 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-3 tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)]",
271
+ style: g({ justifyContent: _.value ? "flex-start" : "center" }),
272
+ onClick: t[0] ||= (e) => p(d).savedModules?.openBrowser()
273
+ }, [
274
+ m(p(Qe), {
275
+ size: 20,
276
+ "stroke-width": 1.5,
277
+ class: "tpl:shrink-0"
278
+ }),
279
+ _.value ? (s(), f("span", zt, S(p(n).modules.title), 1)) : v("", !0),
280
+ _.value ? (s(), f("span", Bt, S(p(d).savedModules?.moduleCount.value ?? 0), 1)) : v("", !0)
281
+ ], 12, Rt)])) : v("", !0), m(p(Tt.default), {
282
+ list: E.value,
283
+ group: {
284
+ name: "blocks",
285
+ pull: "clone",
286
+ put: !1
287
+ },
288
+ clone: D,
289
+ sort: !1,
290
+ "item-key": "type",
291
+ animation: 150,
292
+ "ghost-class": "tpl-ghost",
293
+ class: "tpl:flex tpl:flex-col tpl:gap-0.5 tpl:p-1"
294
+ }, {
295
+ item: a(({ element: e }) => [C("button", {
296
+ type: "button",
297
+ "data-palette-type": e.type,
298
+ "aria-label": p(i)(p(n).sidebarNav.insertBlock, { block: e.label }),
299
+ class: "tpl:flex tpl:h-10 tpl:w-full tpl:cursor-grab tpl:items-center tpl:gap-3 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-3 tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)] active:tpl:cursor-grabbing",
300
+ style: g({ justifyContent: _.value ? "flex-start" : "center" }),
301
+ onClick: (t) => O(e),
302
+ onKeydown: (t) => k(t, e)
303
+ }, [C("div", Ht, [p(_t)[e.type] ? (s(), y(c(p(_t)[e.type]), {
304
+ key: 0,
305
+ size: 20,
306
+ "stroke-width": 1.5
307
+ })) : e.isCustom ? (s(), y(Fe, {
308
+ key: 1,
309
+ icon: e.icon,
310
+ size: 20
311
+ }, null, 8, ["icon"])) : v("", !0)]), _.value ? (s(), f("span", Ut, S(e.label), 1)) : v("", !0)], 44, Vt)]),
312
+ _: 1
313
+ }, 8, ["list"])], 44, It));
314
+ }
315
+ }), W = (e, t = 0, n = 1) => e > n ? n : e < t ? t : e, G = (e, t = 0, n = 10 ** t) => Math.round(n * e) / n;
316
+ 360 / (Math.PI * 2);
317
+ var Gt = (e) => $t(Kt(e)), Kt = (e) => (e[0] === "#" && (e = e.substring(1)), e.length < 6 ? {
318
+ r: parseInt(e[0] + e[0], 16),
319
+ g: parseInt(e[1] + e[1], 16),
320
+ b: parseInt(e[2] + e[2], 16),
321
+ a: e.length === 4 ? G(parseInt(e[3] + e[3], 16) / 255, 2) : 1
322
+ } : {
323
+ r: parseInt(e.substring(0, 2), 16),
324
+ g: parseInt(e.substring(2, 4), 16),
325
+ b: parseInt(e.substring(4, 6), 16),
326
+ a: e.length === 8 ? G(parseInt(e.substring(6, 8), 16) / 255, 2) : 1
327
+ }), qt = (e) => Qt(Xt(e)), Jt = ({ h: e, s: t, v: n, a: r }) => {
328
+ let i = (200 - t) * n / 100;
329
+ return {
330
+ h: G(e),
331
+ s: G(i > 0 && i < 200 ? t * n / 100 / (i <= 100 ? i : 200 - i) * 100 : 0),
332
+ l: G(i / 2),
333
+ a: G(r, 2)
334
+ };
335
+ }, Yt = (e) => {
336
+ let { h: t, s: n, l: r } = Jt(e);
337
+ return `hsl(${t}, ${n}%, ${r}%)`;
338
+ }, Xt = ({ h: e, s: t, v: n, a: r }) => {
339
+ e = e / 360 * 6, t /= 100, n /= 100;
340
+ let i = Math.floor(e), a = n * (1 - t), o = n * (1 - (e - i) * t), s = n * (1 - (1 - e + i) * t), c = i % 6;
341
+ return {
342
+ r: G([
343
+ n,
344
+ o,
345
+ a,
346
+ a,
347
+ s,
348
+ n
349
+ ][c] * 255),
350
+ g: G([
351
+ s,
352
+ n,
353
+ n,
354
+ o,
355
+ a,
356
+ a
357
+ ][c] * 255),
358
+ b: G([
359
+ a,
360
+ a,
361
+ s,
362
+ n,
363
+ n,
364
+ o
365
+ ][c] * 255),
366
+ a: G(r, 2)
367
+ };
368
+ }, Zt = (e) => {
369
+ let t = e.toString(16);
370
+ return t.length < 2 ? "0" + t : t;
371
+ }, Qt = ({ r: e, g: t, b: n, a: r }) => {
372
+ let i = r < 1 ? Zt(G(r * 255)) : "";
373
+ return "#" + Zt(e) + Zt(t) + Zt(n) + i;
374
+ }, $t = ({ r: e, g: t, b: n, a: r }) => {
375
+ let i = Math.max(e, t, n), a = i - Math.min(e, t, n), o = a ? i === e ? (t - n) / a : i === t ? 2 + (n - e) / a : 4 + (e - t) / a : 0;
376
+ return {
377
+ h: G(60 * (o < 0 ? o + 6 : o)),
378
+ s: G(i ? a / i * 100 : 0),
379
+ v: G(i / 255 * 100),
380
+ a: r
381
+ };
382
+ }, en = (e, t) => {
383
+ if (e === t) return !0;
384
+ for (let n in e) if (e[n] !== t[n]) return !1;
385
+ return !0;
386
+ }, tn = (e, t) => e.toLowerCase() === t.toLowerCase() ? !0 : en(Kt(e), Kt(t)), nn = {}, rn = (e) => {
387
+ let t = nn[e];
388
+ return t || (t = document.createElement("template"), t.innerHTML = e, nn[e] = t), t;
389
+ }, an = (e, t, n) => {
390
+ e.dispatchEvent(new CustomEvent(t, {
391
+ bubbles: !0,
392
+ detail: n
393
+ }));
394
+ }, K = !1, on = (e) => "touches" in e, sn = (e) => K && !on(e) ? !1 : (K ||= on(e), !0), cn = (e, t) => {
395
+ let n = on(t) ? t.touches[0] : t, r = e.el.getBoundingClientRect();
396
+ an(e.el, "move", e.getMove({
397
+ x: W((n.pageX - (r.left + window.pageXOffset)) / r.width),
398
+ y: W((n.pageY - (r.top + window.pageYOffset)) / r.height)
399
+ }));
400
+ }, ln = (e, t) => {
401
+ let n = t.keyCode;
402
+ n > 40 || e.xy && n < 37 || n < 33 || (t.preventDefault(), an(e.el, "move", e.getMove({
403
+ x: n === 39 ? .01 : n === 37 ? -.01 : n === 34 ? .05 : n === 33 ? -.05 : n === 35 ? 1 : n === 36 ? -1 : 0,
404
+ y: n === 40 ? .01 : n === 38 ? -.01 : 0
405
+ }, !0)));
406
+ }, un = class {
407
+ constructor(e, t, n, r) {
408
+ let i = rn(`<div role="slider" tabindex="0" part="${t}" ${n}><div part="${t}-pointer"></div></div>`);
409
+ e.appendChild(i.content.cloneNode(!0));
410
+ let a = e.querySelector(`[part=${t}]`);
411
+ a.addEventListener("mousedown", this), a.addEventListener("touchstart", this), a.addEventListener("keydown", this), this.el = a, this.xy = r, this.nodes = [a.firstChild, a];
412
+ }
413
+ set dragging(e) {
414
+ let t = e ? document.addEventListener : document.removeEventListener;
415
+ t(K ? "touchmove" : "mousemove", this), t(K ? "touchend" : "mouseup", this);
416
+ }
417
+ handleEvent(e) {
418
+ switch (e.type) {
419
+ case "mousedown":
420
+ case "touchstart":
421
+ if (e.preventDefault(), !sn(e) || !K && e.button != 0) return;
422
+ this.el.focus(), cn(this, e), this.dragging = !0;
423
+ break;
424
+ case "mousemove":
425
+ case "touchmove":
426
+ e.preventDefault(), cn(this, e);
427
+ break;
428
+ case "mouseup":
429
+ case "touchend":
430
+ this.dragging = !1;
431
+ break;
432
+ case "keydown":
433
+ ln(this, e);
434
+ break;
435
+ }
436
+ }
437
+ style(e) {
438
+ e.forEach((e, t) => {
439
+ for (let n in e) this.nodes[t].style.setProperty(n, e[n]);
440
+ });
441
+ }
442
+ }, dn = class extends un {
443
+ constructor(e) {
444
+ super(e, "hue", "aria-label=\"Hue\" aria-valuemin=\"0\" aria-valuemax=\"360\"", !1);
445
+ }
446
+ update({ h: e }) {
447
+ this.h = e, this.style([{
448
+ left: `${e / 360 * 100}%`,
449
+ color: Yt({
450
+ h: e,
451
+ s: 100,
452
+ v: 100,
453
+ a: 1
454
+ })
455
+ }]), this.el.setAttribute("aria-valuenow", `${G(e)}`);
456
+ }
457
+ getMove(e, t) {
458
+ return { h: t ? W(this.h + e.x * 360, 0, 360) : 360 * e.x };
459
+ }
460
+ }, fn = class extends un {
461
+ constructor(e) {
462
+ super(e, "saturation", "aria-label=\"Color\"", !0);
463
+ }
464
+ update(e) {
465
+ this.hsva = e, this.style([{
466
+ top: `${100 - e.v}%`,
467
+ left: `${e.s}%`,
468
+ color: Yt(e)
469
+ }, { "background-color": Yt({
470
+ h: e.h,
471
+ s: 100,
472
+ v: 100,
473
+ a: 1
474
+ }) }]), this.el.setAttribute("aria-valuetext", `Saturation ${G(e.s)}%, Brightness ${G(e.v)}%`);
475
+ }
476
+ getMove(e, t) {
477
+ return {
478
+ s: t ? W(this.hsva.s + e.x * 100, 0, 100) : e.x * 100,
479
+ v: t ? W(this.hsva.v - e.y * 100, 0, 100) : Math.round(100 - e.y * 100)
480
+ };
481
+ }
482
+ }, pn = ":host{display:flex;flex-direction:column;position:relative;width:200px;height:200px;user-select:none;-webkit-user-select:none;cursor:default}:host([hidden]){display:none!important}[role=slider]{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;outline:0}[role=slider]:last-child{border-radius:0 0 8px 8px}[part$=pointer]{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;display:flex;place-content:center center;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}[part$=pointer]::after{content:\"\";width:100%;height:100%;border-radius:inherit;background-color:currentColor}[role=slider]:focus [part$=pointer]{transform:translate(-50%,-50%) scale(1.1)}", mn = "[part=hue]{flex:0 0 24px;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}[part=hue-pointer]{top:50%;z-index:2}", hn = "[part=saturation]{flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,rgba(255,255,255,0));box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}[part=saturation-pointer]{z-index:3}", gn = Symbol("same"), _n = Symbol("color"), vn = Symbol("hsva"), yn = Symbol("update"), bn = Symbol("parts"), xn = Symbol("css"), Sn = Symbol("sliders"), Cn = class extends HTMLElement {
483
+ static get observedAttributes() {
484
+ return ["color"];
485
+ }
486
+ get [xn]() {
487
+ return [
488
+ pn,
489
+ mn,
490
+ hn
491
+ ];
492
+ }
493
+ get [Sn]() {
494
+ return [fn, dn];
495
+ }
496
+ get color() {
497
+ return this[_n];
498
+ }
499
+ set color(e) {
500
+ if (!this[gn](e)) {
501
+ let t = this.colorModel.toHsva(e);
502
+ this[yn](t), this[_n] = e;
503
+ }
504
+ }
505
+ constructor() {
506
+ super();
507
+ let e = rn(`<style>${this[xn].join("")}</style>`), t = this.attachShadow({ mode: "open" });
508
+ t.appendChild(e.content.cloneNode(!0)), t.addEventListener("move", this), this[bn] = this[Sn].map((e) => new e(t));
509
+ }
510
+ connectedCallback() {
511
+ if (this.hasOwnProperty("color")) {
512
+ let e = this.color;
513
+ delete this.color, this.color = e;
514
+ } else this.color ||= this.colorModel.defaultColor;
515
+ }
516
+ attributeChangedCallback(e, t, n) {
517
+ let r = this.colorModel.fromAttr(n);
518
+ this[gn](r) || (this.color = r);
519
+ }
520
+ handleEvent(e) {
521
+ let t = this[vn], n = {
522
+ ...t,
523
+ ...e.detail
524
+ };
525
+ this[yn](n);
526
+ let r;
527
+ !en(n, t) && !this[gn](r = this.colorModel.fromHsva(n)) && (this[_n] = r, an(this, "color-changed", { value: r }));
528
+ }
529
+ [gn](e) {
530
+ return this.color && this.colorModel.equal(e, this.color);
531
+ }
532
+ [yn](e) {
533
+ this[vn] = e, this[bn].forEach((t) => t.update(e));
534
+ }
535
+ }, wn = {
536
+ defaultColor: "#000",
537
+ toHsva: Gt,
538
+ fromHsva: ({ h: e, s: t, v: n }) => qt({
539
+ h: e,
540
+ s: t,
541
+ v: n,
542
+ a: 1
543
+ }),
544
+ equal: tn,
545
+ fromAttr: (e) => e
546
+ }, Tn = class extends Cn {
547
+ get colorModel() {
548
+ return wn;
549
+ }
550
+ };
551
+ customElements.define("hex-color-picker", class extends Tn {});
552
+ //#endregion
553
+ //#region src/components/ColorPicker.vue?vue&type=script&setup=true&lang.ts
554
+ var En = [
555
+ "disabled",
556
+ "aria-label",
557
+ "aria-expanded"
558
+ ], Dn = [
559
+ "value",
560
+ "placeholder",
561
+ "disabled",
562
+ "aria-label"
563
+ ], On = ["color", "aria-label"], q = /* @__PURE__ */ l({
564
+ __name: "ColorPicker",
565
+ props: {
566
+ modelValue: {},
567
+ placeholder: { default: xt },
568
+ size: { default: "default" },
569
+ swatchOnly: {
570
+ type: Boolean,
571
+ default: !1
572
+ },
573
+ disabled: {
574
+ type: Boolean,
575
+ default: !1
576
+ }
577
+ },
578
+ emits: ["update:modelValue"],
579
+ setup(e, { emit: n }) {
580
+ let r = e, i = n, { t: o } = L(), c = t(!1), l = t(), u = t();
581
+ De(l, () => {
582
+ c.value = !1;
583
+ }, { ignore: [u] });
584
+ let d = T({
585
+ get: () => r.modelValue || "#000000",
586
+ set: (e) => i("update:modelValue", e)
587
+ });
588
+ function h(e) {
589
+ d.value = e.detail.value;
590
+ }
591
+ function _(e) {
592
+ d.value = e.target.value;
593
+ }
594
+ return (t, n) => (s(), f("div", { class: D(["tpl:flex tpl:gap-2 tpl:relative", e.disabled && "tpl:opacity-60 tpl:cursor-not-allowed"]) }, [
595
+ C("button", {
596
+ ref_key: "swatchRef",
597
+ ref: u,
598
+ type: "button",
599
+ disabled: e.disabled,
600
+ "aria-label": p(o).colorPicker.pickColor,
601
+ "aria-expanded": c.value,
602
+ class: D([
603
+ "tpl:shrink-0 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-0.5 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
604
+ e.disabled ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer",
605
+ c.value ? "tpl:border-[var(--tpl-primary)] tpl:shadow-[var(--tpl-ring)]" : !e.disabled && "hover:tpl:border-[var(--tpl-text-dim)]",
606
+ e.size === "large" ? "tpl:size-12" : "tpl:size-10"
607
+ ]),
608
+ onClick: n[0] ||= (t) => !e.disabled && (c.value = !c.value)
609
+ }, [C("span", {
610
+ class: "tpl:block tpl:size-full tpl:rounded-[calc(var(--tpl-radius-sm)-2px)]",
611
+ style: g({ backgroundColor: d.value })
612
+ }, null, 4)], 10, En),
613
+ e.swatchOnly ? v("", !0) : (s(), f("input", {
614
+ key: 0,
615
+ type: "text",
616
+ class: D(p(wt)),
617
+ value: e.modelValue,
618
+ placeholder: e.placeholder,
619
+ disabled: e.disabled,
620
+ "aria-label": p(o).colorPicker.hexValue,
621
+ onInput: _
622
+ }, null, 42, Dn)),
623
+ m(w, {
624
+ "enter-active-class": "tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
625
+ "enter-from-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1",
626
+ "enter-to-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
627
+ "leave-active-class": "tpl:transition-all tpl:duration-[80ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
628
+ "leave-from-class": "tpl:opacity-100 tpl:scale-100 tpl:translate-y-0",
629
+ "leave-to-class": "tpl:opacity-0 tpl:scale-95 tpl:translate-y-1"
630
+ }, {
631
+ default: a(() => [c.value ? (s(), f("div", {
632
+ key: 0,
633
+ ref_key: "popoverRef",
634
+ ref: l,
635
+ class: "tpl:absolute tpl:left-0 tpl:top-full tpl:z-50 tpl:mt-2 tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:p-3 tpl:shadow-lg"
636
+ }, [C("hex-color-picker", {
637
+ color: d.value,
638
+ "aria-label": p(o).colorPicker.pickColor,
639
+ onColorChanged: h,
640
+ onKeydown: n[1] ||= x((e) => c.value = !1, ["escape"])
641
+ }, null, 40, On)], 512)) : v("", !0)]),
642
+ _: 1
643
+ })
644
+ ], 2));
645
+ }
646
+ });
647
+ //#endregion
648
+ //#region src/composables/useMergeTagField.ts
649
+ function kn(e) {
650
+ let { modelValue: n, emit: r, elementRef: i } = e, { isEnabled: a, isRequesting: o, isMergeTagValue: s, getMergeTagLabel: c, requestMergeTag: l, syntax: u } = Ee(), d = t(!1), f = !1, p = T(() => {
651
+ let e = n();
652
+ if (!e) return [];
653
+ let t = [], r = `(${u.value.source}|${u.logic.source})`, i = new RegExp(r, "g"), a = 0, o;
654
+ for (; (o = i.exec(e)) !== null;) {
655
+ o.index > a && t.push({
656
+ type: "text",
657
+ value: e.slice(a, o.index)
658
+ });
659
+ let n = o[0];
660
+ s(n) ? t.push({
661
+ type: "mergeTag",
662
+ value: n,
663
+ label: c(n)
664
+ }) : Pe(n, u) ? t.push({
665
+ type: "logicMergeTag",
666
+ value: n,
667
+ keyword: Be(n, u)
668
+ }) : t.push({
669
+ type: "text",
670
+ value: n
671
+ }), a = o.index + n.length;
672
+ }
673
+ return a < e.length && t.push({
674
+ type: "text",
675
+ value: e.slice(a)
676
+ }), t;
677
+ }), m = T(() => p.value.some((e) => e.type === "mergeTag" || e.type === "logicMergeTag"));
678
+ function h() {
679
+ d.value = !0, b(() => {
680
+ i.value?.focus();
681
+ let e = n()?.length || 0;
682
+ i.value?.setSelectionRange(e, e);
683
+ });
684
+ }
685
+ function g() {
686
+ f || (d.value = !1);
687
+ }
688
+ function _(e) {
689
+ r(e.target.value);
690
+ }
691
+ function v() {
692
+ r("");
693
+ }
694
+ async function y() {
695
+ let e = d.value && i.value ? i.value.selectionStart ?? n().length : n().length;
696
+ f = !0;
697
+ let t = await l();
698
+ if (f = !1, t) {
699
+ let a = n().slice(0, e), o = n().slice(e);
700
+ r(a + t.value + o), d.value = !0, b(() => {
701
+ let n = e + t.value.length;
702
+ i.value?.focus(), i.value?.setSelectionRange(n, n);
703
+ });
704
+ }
705
+ }
706
+ return {
707
+ segments: p,
708
+ hasMergeTags: m,
709
+ mergeTagEnabled: a,
710
+ isRequestingMergeTag: o,
711
+ isEditing: d,
712
+ startEditing: h,
713
+ stopEditing: g,
714
+ handleInput: _,
715
+ clearValue: v,
716
+ insertMergeTag: y
717
+ };
718
+ }
719
+ //#endregion
720
+ //#region src/components/MergeTagSegments.vue?vue&type=script&setup=true&lang.ts
721
+ var An = ["aria-label", "onKeydown"], jn = ["data-tooltip"], Mn = ["data-tooltip"], Nn = {
722
+ key: 2,
723
+ class: "tpl:text-sm tpl:text-[var(--tpl-text)]"
724
+ }, Pn = ["aria-label", "title"], Fn = /* @__PURE__ */ l({
725
+ __name: "MergeTagSegments",
726
+ props: {
727
+ segments: {},
728
+ displayClass: {},
729
+ pulse: { type: Boolean }
730
+ },
731
+ emits: ["edit", "clear"],
732
+ setup(e, { emit: t }) {
733
+ let n = t, { t: r } = L();
734
+ function a() {
735
+ n("edit");
736
+ }
737
+ return (t, o) => (s(), f("div", {
738
+ role: "button",
739
+ tabindex: "0",
740
+ "aria-label": p(r).mergeTag.clickToEdit,
741
+ class: D([e.displayClass, { "tpl-pulse-fill": e.pulse }]),
742
+ onClick: a,
743
+ onKeydown: [x(a, ["enter"]), x(k(a, ["prevent"]), ["space"])]
744
+ }, [(s(!0), f(_, null, i(e.segments, (e, t) => (s(), f(_, { key: `${e.type}-${t}-${e.value}` }, [e.type === "mergeTag" ? (s(), f("span", {
745
+ key: 0,
746
+ class: "tpl-tooltip tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.9em] tpl:font-medium",
747
+ "data-tooltip": e.value,
748
+ style: {
749
+ "background-color": "color-mix(\n in srgb,\n var(--tpl-primary) 20%,\n transparent\n )",
750
+ color: "var(--tpl-primary)"
751
+ }
752
+ }, S(e.label), 9, jn)) : e.type === "logicMergeTag" ? (s(), f("span", {
753
+ key: 1,
754
+ class: "tpl-tooltip tpl:inline-flex tpl:items-center tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.8em] tpl:font-bold tpl:tracking-wide tpl:uppercase",
755
+ "data-tooltip": e.value,
756
+ style: {
757
+ "background-color": "transparent",
758
+ border: "1.5px solid\n color-mix(in srgb, var(--tpl-primary) 50%, transparent)",
759
+ color: "var(--tpl-primary)"
760
+ }
761
+ }, S(e.keyword), 9, Mn)) : (s(), f("span", Nn, S(e.value), 1))], 64))), 128)), C("button", {
762
+ type: "button",
763
+ class: "tpl:ml-auto tpl:flex tpl:size-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text-dim)] tpl:opacity-60 tpl:transition-all hover:tpl:text-[var(--tpl-danger)] hover:tpl:opacity-100",
764
+ "aria-label": p(r).mergeTag.remove,
765
+ title: p(r).mergeTag.remove,
766
+ onClick: o[0] ||= k((e) => n("clear"), ["stop"])
767
+ }, [m(p(qe), {
768
+ size: 12,
769
+ "stroke-width": 2.5
770
+ })], 8, Pn)], 42, An));
771
+ }
772
+ }), In = [
773
+ "aria-label",
774
+ "title",
775
+ "disabled"
776
+ ], Ln = "tpl:flex tpl:items-center tpl:justify-center tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:px-2 tpl:py-1 tpl:text-xs tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-[120ms] hover:tpl:bg-[var(--tpl-primary-light)] hover:tpl:text-[var(--tpl-primary)] hover:tpl:border-[var(--tpl-primary)]", Rn = /* @__PURE__ */ l({
777
+ __name: "MergeTagInsertButton",
778
+ props: { disabled: { type: Boolean } },
779
+ emits: ["insert"],
780
+ setup(e) {
781
+ let { t } = L();
782
+ return (n, r) => (s(), f("button", {
783
+ type: "button",
784
+ class: D([Ln, "tpl:mt-1.5"]),
785
+ "aria-label": p(t).mergeTag.insert,
786
+ title: p(t).mergeTag.insert,
787
+ disabled: e.disabled,
788
+ onClick: r[0] ||= (e) => n.$emit("insert")
789
+ }, [m(p(st), {
790
+ size: 12,
791
+ "stroke-width": 2
792
+ }), A(" " + S(p(t).mergeTag.insert), 1)], 10, In));
793
+ }
794
+ }), zn = { key: 0 }, Bn = { key: 1 }, Vn = [
795
+ "value",
796
+ "placeholder",
797
+ "rows"
798
+ ], Hn = "tpl:w-full tpl:resize-y tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:shadow-xs tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] tpl:placeholder:text-[var(--tpl-text-dim)] tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)]", Un = "tpl:flex tpl:w-full tpl:min-h-[5rem] tpl:cursor-pointer tpl:items-start tpl:flex-wrap tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:shadow-xs tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:px-3 tpl:py-2 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", Wn = /* @__PURE__ */ l({
799
+ __name: "MergeTagTextarea",
800
+ props: {
801
+ modelValue: {},
802
+ placeholder: { default: "" },
803
+ rows: { default: 3 }
804
+ },
805
+ emits: ["update:modelValue"],
806
+ setup(e, { emit: n }) {
807
+ let r = e, i = n, a = t(null), { segments: o, hasMergeTags: c, mergeTagEnabled: l, isRequestingMergeTag: u, isEditing: d, startEditing: h, stopEditing: g, handleInput: _, clearValue: b, insertMergeTag: S } = kn({
808
+ modelValue: () => r.modelValue,
809
+ emit: (e) => i("update:modelValue", e),
810
+ elementRef: a
811
+ });
812
+ return (t, n) => p(c) && !p(d) ? (s(), f("div", zn, [m(Fn, {
813
+ segments: p(o),
814
+ "display-class": Un,
815
+ onEdit: p(h),
816
+ onClear: p(b)
817
+ }, null, 8, [
818
+ "segments",
819
+ "onEdit",
820
+ "onClear"
821
+ ]), p(l) ? (s(), y(Rn, {
822
+ key: 0,
823
+ disabled: p(u),
824
+ onInsert: p(S)
825
+ }, null, 8, ["disabled", "onInsert"])) : v("", !0)])) : (s(), f("div", Bn, [C("textarea", {
826
+ ref_key: "textareaRef",
827
+ ref: a,
828
+ class: D(Hn),
829
+ value: e.modelValue,
830
+ placeholder: e.placeholder,
831
+ rows: e.rows,
832
+ onInput: n[0] ||= (...e) => p(_) && p(_)(...e),
833
+ onBlur: n[1] ||= (...e) => p(g) && p(g)(...e),
834
+ onKeydown: n[2] ||= x((...e) => p(g) && p(g)(...e), ["escape"])
835
+ }, null, 40, Vn), p(l) ? (s(), y(Rn, {
836
+ key: 0,
837
+ disabled: p(u),
838
+ onInsert: p(S)
839
+ }, null, 8, ["disabled", "onInsert"])) : v("", !0)]));
840
+ }
841
+ }), Gn = { class: "tpl:flex tpl:w-full tpl:flex-1 tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)]" }, Kn = { class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:gap-3 tpl:overflow-y-auto tpl:p-4" }, qn = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Jn = { class: "tpl:mb-3.5" }, Yn = { class: "tpl:grid tpl:grid-cols-4 tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1 tpl:bg-[var(--tpl-bg-hover)]" }, Xn = ["onClick"], Zn = { class: "tpl:flex tpl:items-stretch" }, Qn = ["value"], $n = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, er = { class: "tpl:mb-3.5" }, tr = ["value"], nr = ["value"], rr = { class: "tpl:mb-3.5 tpl:flex tpl:items-center tpl:gap-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, ir = { class: "tpl:mt-1 tpl:flex tpl:items-start tpl:justify-between tpl:gap-2" }, ar = { class: "tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]" }, or = { class: "tpl:shrink-0 tpl:text-xs tpl:tabular-nums tpl:text-[var(--tpl-text-dim)]" }, sr = { class: "tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:p-3" }, cr = { class: "tpl:mb-2.5 tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text-muted)]" }, lr = { class: "tpl:m-0 tpl:pl-[18px] tpl:text-xs tpl:leading-relaxed tpl:text-[var(--tpl-text-dim)]" }, ur = { class: "tpl:mb-1 tpl:last:mb-0" }, dr = { class: "tpl:mb-1 tpl:last:mb-0" }, fr = { class: "tpl:mb-1 tpl:last:mb-0" }, pr = 150, mr = /* @__PURE__ */ l({
842
+ __name: "TemplateSettings",
843
+ props: { settings: {} },
844
+ emits: ["update"],
845
+ setup(e, { emit: t }) {
846
+ let n = e, r = t, { t: a } = L(), o = Te(be, "TemplateSettings"), c = T(() => o.fonts.value), l = T(() => c.value.some((e) => e.value === n.settings.fontFamily) ? n.settings.fontFamily : o.defaultFont.value), u = [
847
+ {
848
+ value: 480,
849
+ label: "480px"
850
+ },
851
+ {
852
+ value: 600,
853
+ label: "600px"
854
+ },
855
+ {
856
+ value: 700,
857
+ label: "700px"
858
+ },
859
+ {
860
+ value: 800,
861
+ label: "800px"
862
+ }
863
+ ];
864
+ return (t, n) => (s(), f("aside", Gn, [C("div", Kn, [
865
+ C("div", { class: D(p(St)) }, [
866
+ C("div", qn, [m(p(ut), {
867
+ class: "tpl:text-[var(--tpl-text-muted)]",
868
+ size: 14,
869
+ "stroke-width": 2
870
+ }), C("span", null, S(p(a).templateSettings.layout), 1)]),
871
+ C("div", Jn, [C("label", { class: D(p(V)) }, S(p(a).templateSettings.widthPreset), 3), C("div", Yn, [(s(), f(_, null, i(u, (t) => C("button", {
872
+ key: t.value,
873
+ class: "tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:px-2 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]",
874
+ style: g({
875
+ backgroundColor: e.settings.width === t.value ? "var(--tpl-bg)" : "transparent",
876
+ color: e.settings.width === t.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
877
+ boxShadow: e.settings.width === t.value ? "var(--tpl-shadow)" : "none"
878
+ }),
879
+ onClick: (e) => r("update", { width: t.value })
880
+ }, S(t.label), 13, Xn)), 64))])]),
881
+ C("div", null, [C("label", { class: D(p(V)) }, S(p(a).templateSettings.customWidth), 3), C("div", Zn, [C("input", {
882
+ type: "number",
883
+ class: D(p(U)),
884
+ value: e.settings.width,
885
+ min: "300",
886
+ max: "900",
887
+ onInput: n[0] ||= (e) => r("update", { width: Number(e.target.value) })
888
+ }, null, 42, Qn), C("span", { class: D(p(H)) }, "px", 2)])])
889
+ ], 2),
890
+ C("div", { class: D(p(St)) }, [
891
+ C("div", $n, [m(p(ft), {
892
+ class: "tpl:text-[var(--tpl-text-muted)]",
893
+ size: 14,
894
+ "stroke-width": 2
895
+ }), C("span", null, S(p(a).templateSettings.appearance), 1)]),
896
+ C("div", er, [C("label", { class: D(p(V)) }, S(p(a).templateSettings.backgroundColor), 3), m(q, {
897
+ "model-value": e.settings.backgroundColor,
898
+ placeholder: p(Ct),
899
+ "onUpdate:modelValue": n[1] ||= (e) => r("update", { backgroundColor: e })
900
+ }, null, 8, ["model-value", "placeholder"])]),
901
+ C("div", null, [C("label", { class: D(p(V)) }, S(p(a).templateSettings.fontFamily), 3), C("select", {
902
+ class: D(p(B)),
903
+ value: l.value,
904
+ onChange: n[2] ||= (e) => r("update", { fontFamily: e.target.value })
905
+ }, [(s(!0), f(_, null, i(c.value, (e) => (s(), f("option", {
906
+ key: e.value,
907
+ value: e.value
908
+ }, S(e.label), 9, nr))), 128))], 42, tr)])
909
+ ], 2),
910
+ C("div", { class: D(p(St)) }, [C("div", rr, [m(p(ke), {
911
+ class: "tpl:text-[var(--tpl-text-muted)]",
912
+ size: 14,
913
+ "stroke-width": 2
914
+ }), C("span", null, S(p(a).templateSettings.preheaderText), 1)]), C("div", null, [m(Wn, {
915
+ "model-value": e.settings.preheaderText ?? "",
916
+ placeholder: p(a).templateSettings.preheaderTextPlaceholder,
917
+ rows: 2,
918
+ "onUpdate:modelValue": n[3] ||= (e) => r("update", { preheaderText: e.replace(/[\r\n]/g, " ") || void 0 })
919
+ }, null, 8, ["model-value", "placeholder"]), C("div", ir, [C("span", ar, S(p(a).templateSettings.preheaderTextHint), 1), C("span", or, S((e.settings.preheaderText ?? "").length) + "/" + S(pr), 1)])])], 2),
920
+ C("div", sr, [C("div", cr, [m(p(Ue), {
921
+ size: 14,
922
+ "stroke-width": 2
923
+ }), C("span", null, S(p(a).templateSettings.tips), 1)]), C("ul", lr, [
924
+ C("li", ur, S(p(a).templateSettings.tip1), 1),
925
+ C("li", dr, S(p(a).templateSettings.tip2), 1),
926
+ C("li", fr, S(p(a).templateSettings.tip3), 1)
927
+ ])])
928
+ ])]));
929
+ }
930
+ }), hr = { key: 0 }, gr = { key: 1 }, _r = [
931
+ "type",
932
+ "value",
933
+ "placeholder"
934
+ ], vr = "tpl:flex tpl:w-full tpl:min-h-10 tpl:cursor-pointer tpl:items-center tpl:flex-wrap tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:shadow-xs tpl:bg-[var(--tpl-bg)] tpl:border-[var(--tpl-border)] tpl:px-3.5 tpl:py-1.5 tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", J = /* @__PURE__ */ j(/* @__PURE__ */ l({
935
+ __name: "MergeTagInput",
936
+ props: {
937
+ modelValue: {},
938
+ type: { default: "text" },
939
+ placeholder: { default: "" },
940
+ pulse: {
941
+ type: Boolean,
942
+ default: !1
943
+ }
944
+ },
945
+ emits: ["update:modelValue"],
946
+ setup(e, { emit: n }) {
947
+ let r = e, i = n, a = t(null), { segments: o, hasMergeTags: c, mergeTagEnabled: l, isRequestingMergeTag: u, isEditing: d, startEditing: h, stopEditing: g, handleInput: _, clearValue: b, insertMergeTag: S } = kn({
948
+ modelValue: () => r.modelValue,
949
+ emit: (e) => i("update:modelValue", e),
950
+ elementRef: a
951
+ });
952
+ return (t, n) => p(c) && !p(d) ? (s(), f("div", hr, [m(Fn, {
953
+ segments: p(o),
954
+ "display-class": vr,
955
+ pulse: e.pulse,
956
+ onEdit: p(h),
957
+ onClear: p(b)
958
+ }, null, 8, [
959
+ "segments",
960
+ "pulse",
961
+ "onEdit",
962
+ "onClear"
963
+ ]), p(l) ? (s(), y(Rn, {
964
+ key: 0,
965
+ disabled: p(u),
966
+ onInsert: p(S)
967
+ }, null, 8, ["disabled", "onInsert"])) : v("", !0)])) : (s(), f("div", gr, [C("input", {
968
+ ref_key: "inputRef",
969
+ ref: a,
970
+ type: e.type,
971
+ class: D([p(B), { "tpl-pulse-fill": e.pulse }]),
972
+ value: e.modelValue,
973
+ placeholder: e.placeholder,
974
+ onInput: n[0] ||= (...e) => p(_) && p(_)(...e),
975
+ onBlur: n[1] ||= (...e) => p(g) && p(g)(...e),
976
+ onKeydown: n[2] ||= x((...e) => p(g) && p(g)(...e), ["escape"])
977
+ }, null, 42, _r), p(l) ? (s(), y(Rn, {
978
+ key: 0,
979
+ disabled: p(u),
980
+ onInsert: p(S)
981
+ }, null, 8, ["disabled", "onInsert"])) : v("", !0)]));
982
+ }
983
+ }), [["__scopeId", "data-v-b982cc87"]]), yr = { class: "tpl:mb-3.5" }, br = ["value"], xr = { value: "" }, Sr = ["value"], Cr = { class: "tpl:mb-3.5" }, wr = { class: "tpl:mb-3.5" }, Tr = {
984
+ key: 0,
985
+ class: "tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]"
986
+ }, Er = ["checked"], Dr = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-3" }, Or = { class: "tpl:mb-3.5" }, kr = { class: "tpl:mb-3.5" }, Ar = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-3" }, jr = { class: "tpl:mb-3.5" }, Mr = { class: "tpl:flex tpl:items-stretch" }, Nr = ["value"], Pr = { class: "tpl:mb-3.5" }, Fr = { class: "tpl:flex tpl:items-stretch" }, Ir = ["value"], Lr = /* @__PURE__ */ l({
987
+ __name: "ButtonToolbar",
988
+ props: {
989
+ block: {},
990
+ fontFamilies: {}
991
+ },
992
+ emits: ["update"],
993
+ setup(e, { emit: t }) {
994
+ let n = t, { t: r } = L();
995
+ function a(e, t) {
996
+ n("update", { [e]: t });
997
+ }
998
+ return (t, n) => (s(), f(_, null, [
999
+ C("div", yr, [C("label", { class: D(p(V)) }, S(p(r).button.fontFamily), 3), C("select", {
1000
+ class: D(p(B)),
1001
+ value: e.block.fontFamily || "",
1002
+ onChange: n[0] ||= (e) => a("fontFamily", e.target.value || void 0)
1003
+ }, [C("option", xr, S(p(r).button.inheritFont), 1), (s(!0), f(_, null, i(e.fontFamilies, (e) => (s(), f("option", {
1004
+ key: e.value,
1005
+ value: e.value
1006
+ }, S(e.label), 9, Sr))), 128))], 42, br)]),
1007
+ C("div", Cr, [C("label", { class: D(p(V)) }, S(p(r).button.text), 3), m(J, {
1008
+ "model-value": e.block.text,
1009
+ type: "text",
1010
+ "onUpdate:modelValue": n[1] ||= (e) => a("text", e)
1011
+ }, null, 8, ["model-value"])]),
1012
+ C("div", wr, [
1013
+ C("label", { class: D(p(V)) }, S(p(r).button.url), 3),
1014
+ m(J, {
1015
+ "model-value": e.block.url,
1016
+ type: "url",
1017
+ placeholder: p(r).button.urlPlaceholder,
1018
+ "onUpdate:modelValue": n[2] ||= (e) => a("url", e)
1019
+ }, null, 8, ["model-value", "placeholder"]),
1020
+ e.block.url ? (s(), f("label", Tr, [C("input", {
1021
+ type: "checkbox",
1022
+ class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
1023
+ checked: e.block.openInNewTab ?? !1,
1024
+ onChange: n[3] ||= (e) => a("openInNewTab", e.target.checked)
1025
+ }, null, 40, Er), A(" " + S(p(r).button.openInNewTab), 1)])) : v("", !0)
1026
+ ]),
1027
+ C("div", Dr, [C("div", Or, [C("label", { class: D(p(V)) }, S(p(r).button.background), 3), m(q, {
1028
+ "model-value": e.block.backgroundColor,
1029
+ "onUpdate:modelValue": n[4] ||= (e) => a("backgroundColor", e)
1030
+ }, null, 8, ["model-value"])]), C("div", kr, [C("label", { class: D(p(V)) }, S(p(r).button.textColor), 3), m(q, {
1031
+ "model-value": e.block.textColor,
1032
+ "onUpdate:modelValue": n[5] ||= (e) => a("textColor", e)
1033
+ }, null, 8, ["model-value"])])]),
1034
+ C("div", Ar, [C("div", jr, [C("label", { class: D(p(V)) }, S(p(r).button.borderRadius), 3), C("div", Mr, [C("input", {
1035
+ type: "number",
1036
+ class: D(p(U)),
1037
+ value: e.block.borderRadius,
1038
+ min: "0",
1039
+ max: "50",
1040
+ onInput: n[6] ||= (e) => a("borderRadius", Number(e.target.value))
1041
+ }, null, 42, Nr), C("span", { class: D(p(H)) }, "px", 2)])]), C("div", Pr, [C("label", { class: D(p(V)) }, S(p(r).button.fontSize), 3), C("div", Fr, [C("input", {
1042
+ type: "number",
1043
+ class: D(p(U)),
1044
+ value: e.block.fontSize,
1045
+ min: "10",
1046
+ max: "36",
1047
+ onInput: n[7] ||= (e) => a("fontSize", Number(e.target.value))
1048
+ }, null, 42, Ir), C("span", { class: D(p(H)) }, "px", 2)])])])
1049
+ ], 64));
1050
+ }
1051
+ }), Rr = { class: "spacing-control" }, zr = { class: "tpl:mb-2 tpl:block tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Br = { class: "tpl:flex tpl:flex-col tpl:items-center tpl:gap-1.5" }, Vr = { class: "tpl:flex tpl:items-center" }, Hr = ["aria-label"], Ur = ["value", "aria-label"], Wr = ["aria-label"], Gr = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Kr = { class: "tpl:flex tpl:items-center" }, qr = ["aria-label"], Jr = ["value", "aria-label"], Yr = ["aria-label"], Xr = ["aria-label", "title"], Zr = { class: "tpl:flex tpl:items-center" }, Qr = ["aria-label"], $r = ["value", "aria-label"], ei = ["aria-label"], ti = { class: "tpl:flex tpl:items-center" }, ni = ["aria-label"], ri = ["value", "aria-label"], ii = ["aria-label"], Y = "tpl:flex tpl:items-center tpl:justify-center tpl:w-8 tpl:h-8 tpl:text-[var(--tpl-text-muted)] tpl:bg-[var(--tpl-bg)] tpl:border tpl:border-[var(--tpl-border)] tpl:cursor-pointer tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)] hover:tpl:bg-[var(--tpl-bg-hover)] hover:tpl:text-[var(--tpl-text)] active:tpl:bg-[var(--tpl-bg-active)]", ai = "tpl:w-10 tpl:h-8 tpl:text-center tpl:text-xs tpl:font-medium tpl:border-y tpl:border-x-0 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)] tpl:outline-none tpl:transition-all tpl:duration-[120ms] focus:tpl:border-[var(--tpl-primary)] focus:tpl:shadow-[var(--tpl-ring)]", oi = /* @__PURE__ */ j(/* @__PURE__ */ l({
1052
+ __name: "SpacingControl",
1053
+ props: {
1054
+ modelValue: {},
1055
+ label: {}
1056
+ },
1057
+ emits: ["update:modelValue"],
1058
+ setup(e, { emit: r }) {
1059
+ let i = e, a = r, { t: o } = L(), c = T(() => i.modelValue.top === i.modelValue.right && i.modelValue.right === i.modelValue.bottom && i.modelValue.bottom === i.modelValue.left), l = t(c.value);
1060
+ n(c, (e) => {
1061
+ !e && l.value && (l.value = !1);
1062
+ });
1063
+ function u(e, t) {
1064
+ let n = Math.max(0, i.modelValue[e] + t);
1065
+ l.value ? a("update:modelValue", {
1066
+ top: n,
1067
+ right: n,
1068
+ bottom: n,
1069
+ left: n
1070
+ }) : a("update:modelValue", {
1071
+ ...i.modelValue,
1072
+ [e]: n
1073
+ });
1074
+ }
1075
+ function d(e, t) {
1076
+ let n = Math.max(0, t);
1077
+ l.value ? a("update:modelValue", {
1078
+ top: n,
1079
+ right: n,
1080
+ bottom: n,
1081
+ left: n
1082
+ }) : a("update:modelValue", {
1083
+ ...i.modelValue,
1084
+ [e]: n
1085
+ });
1086
+ }
1087
+ function h() {
1088
+ if (l.value = !l.value, l.value) {
1089
+ let e = i.modelValue.top;
1090
+ a("update:modelValue", {
1091
+ top: e,
1092
+ right: e,
1093
+ bottom: e,
1094
+ left: e
1095
+ });
1096
+ }
1097
+ }
1098
+ return (t, n) => (s(), f("div", Rr, [C("label", zr, S(e.label), 1), C("div", Br, [
1099
+ C("div", Vr, [
1100
+ C("button", {
1101
+ "aria-label": p(o).spacingControl.decreaseTop,
1102
+ class: D([Y, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
1103
+ onClick: n[0] ||= (e) => u("top", -1)
1104
+ }, [m(p(R), {
1105
+ size: 12,
1106
+ "stroke-width": 2
1107
+ })], 10, Hr),
1108
+ C("input", {
1109
+ type: "number",
1110
+ class: D(ai),
1111
+ value: e.modelValue.top,
1112
+ "aria-label": p(o).spacingControl.top,
1113
+ min: "0",
1114
+ onInput: n[1] ||= (e) => d("top", Number(e.target.value))
1115
+ }, null, 40, Ur),
1116
+ C("button", {
1117
+ "aria-label": p(o).spacingControl.increaseTop,
1118
+ class: D([Y, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
1119
+ onClick: n[2] ||= (e) => u("top", 1)
1120
+ }, [m(p(z), {
1121
+ size: 12,
1122
+ "stroke-width": 2
1123
+ })], 10, Wr)
1124
+ ]),
1125
+ C("div", Gr, [
1126
+ C("div", Kr, [
1127
+ C("button", {
1128
+ "aria-label": p(o).spacingControl.decreaseLeft,
1129
+ class: D([Y, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
1130
+ onClick: n[3] ||= (e) => u("left", -1)
1131
+ }, [m(p(R), {
1132
+ size: 12,
1133
+ "stroke-width": 2
1134
+ })], 10, qr),
1135
+ C("input", {
1136
+ type: "number",
1137
+ class: D(ai),
1138
+ value: e.modelValue.left,
1139
+ "aria-label": p(o).spacingControl.left,
1140
+ min: "0",
1141
+ onInput: n[4] ||= (e) => d("left", Number(e.target.value))
1142
+ }, null, 40, Jr),
1143
+ C("button", {
1144
+ "aria-label": p(o).spacingControl.increaseLeft,
1145
+ class: D([Y, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
1146
+ onClick: n[5] ||= (e) => u("left", 1)
1147
+ }, [m(p(z), {
1148
+ size: 12,
1149
+ "stroke-width": 2
1150
+ })], 10, Yr)
1151
+ ]),
1152
+ C("button", {
1153
+ class: D(["tpl:flex tpl:h-8 tpl:w-8 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:transition-all tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", l.value ? "tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]" : "tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] hover:tpl:bg-[var(--tpl-bg-hover)]"]),
1154
+ "aria-label": l.value ? p(o).spacingControl.unlock : p(o).spacingControl.lockAll,
1155
+ title: l.value ? p(o).spacingControl.unlock : p(o).spacingControl.lockAll,
1156
+ onClick: h
1157
+ }, [l.value ? (s(), y(p(et), {
1158
+ key: 0,
1159
+ size: 14,
1160
+ "stroke-width": 2
1161
+ })) : (s(), y(p(tt), {
1162
+ key: 1,
1163
+ size: 14,
1164
+ "stroke-width": 2
1165
+ }))], 10, Xr),
1166
+ C("div", Zr, [
1167
+ C("button", {
1168
+ "aria-label": p(o).spacingControl.decreaseRight,
1169
+ class: D([Y, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
1170
+ onClick: n[6] ||= (e) => u("right", -1)
1171
+ }, [m(p(R), {
1172
+ size: 12,
1173
+ "stroke-width": 2
1174
+ })], 10, Qr),
1175
+ C("input", {
1176
+ type: "number",
1177
+ class: D(ai),
1178
+ value: e.modelValue.right,
1179
+ "aria-label": p(o).spacingControl.right,
1180
+ min: "0",
1181
+ onInput: n[7] ||= (e) => d("right", Number(e.target.value))
1182
+ }, null, 40, $r),
1183
+ C("button", {
1184
+ "aria-label": p(o).spacingControl.increaseRight,
1185
+ class: D([Y, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
1186
+ onClick: n[8] ||= (e) => u("right", 1)
1187
+ }, [m(p(z), {
1188
+ size: 12,
1189
+ "stroke-width": 2
1190
+ })], 10, ei)
1191
+ ])
1192
+ ]),
1193
+ C("div", ti, [
1194
+ C("button", {
1195
+ "aria-label": p(o).spacingControl.decreaseBottom,
1196
+ class: D([Y, "tpl:rounded-l-[var(--tpl-radius-sm)]"]),
1197
+ onClick: n[9] ||= (e) => u("bottom", -1)
1198
+ }, [m(p(R), {
1199
+ size: 12,
1200
+ "stroke-width": 2
1201
+ })], 10, ni),
1202
+ C("input", {
1203
+ type: "number",
1204
+ class: D(ai),
1205
+ value: e.modelValue.bottom,
1206
+ "aria-label": p(o).spacingControl.bottom,
1207
+ min: "0",
1208
+ onInput: n[10] ||= (e) => d("bottom", Number(e.target.value))
1209
+ }, null, 40, ri),
1210
+ C("button", {
1211
+ "aria-label": p(o).spacingControl.increaseBottom,
1212
+ class: D([Y, "tpl:rounded-r-[var(--tpl-radius-sm)]"]),
1213
+ onClick: n[11] ||= (e) => u("bottom", 1)
1214
+ }, [m(p(z), {
1215
+ size: 12,
1216
+ "stroke-width": 2
1217
+ })], 10, ii)
1218
+ ])
1219
+ ])]));
1220
+ }
1221
+ }), [["__scopeId", "data-v-9a9c8a07"]]), si = { class: "tpl:mt-3" }, X = /* @__PURE__ */ l({
1222
+ __name: "CollapsibleSection",
1223
+ props: {
1224
+ title: {},
1225
+ open: { type: Boolean },
1226
+ noBorder: { type: Boolean }
1227
+ },
1228
+ emits: ["toggle"],
1229
+ setup(e) {
1230
+ return (t, n) => (s(), f("div", { class: D(["tpl:py-3", e.noBorder ? "" : "tpl:border-t tpl:border-[var(--tpl-border)]"]) }, [C("button", {
1231
+ type: "button",
1232
+ class: "tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]",
1233
+ onClick: n[0] ||= (e) => t.$emit("toggle")
1234
+ }, [m(p(Ye), {
1235
+ class: D(["tpl:transition-transform tpl:duration-200", e.open ? "tpl:rotate-0" : "tpl:-rotate-90"]),
1236
+ size: 12,
1237
+ "stroke-width": 2
1238
+ }, null, 8, ["class"]), C("span", null, S(e.title), 1)]), u(C("div", si, [o(t.$slots, "default")], 512), [[h, e.open]])], 2));
1239
+ }
1240
+ }), ci = { class: "tpl:mt-4" }, li = { class: "tpl:space-y-2" }, ui = ["checked", "onChange"], di = ["value", "placeholder"], fi = { class: "tpl:space-y-2" }, pi = ["value"], mi = { value: "" }, hi = ["label"], gi = ["value"], _i = ["value"], vi = {
1241
+ key: 0,
1242
+ value: "__custom__"
1243
+ }, yi = {
1244
+ key: 0,
1245
+ class: "tpl:space-y-2"
1246
+ }, bi = { class: "tpl:mb-1 tpl:block tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, xi = { class: "tpl:mb-1 tpl:block tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Si = { class: "tpl:flex tpl:justify-end" }, Ci = ["disabled"], wi = {
1247
+ key: 0,
1248
+ class: "tpl:text-[11px] tpl:text-[var(--tpl-text-muted)]"
1249
+ }, Ti = { class: "tpl:space-y-1" }, Ei = { class: "tpl:m-0 tpl:overflow-x-auto tpl:rounded tpl:bg-[var(--tpl-bg)] tpl:p-2 tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-muted)]" }, Di = {
1250
+ key: 0,
1251
+ class: "tpl:m-0 tpl:overflow-x-auto tpl:rounded tpl:bg-[var(--tpl-bg)] tpl:p-2 tpl:font-mono tpl:text-[10px] tpl:text-[var(--tpl-text-muted)]"
1252
+ }, Oi = /* @__PURE__ */ l({
1253
+ __name: "CommonBlockSettings",
1254
+ props: {
1255
+ block: {},
1256
+ isFirstSection: { type: Boolean }
1257
+ },
1258
+ emits: ["update"],
1259
+ setup(e, { emit: o }) {
1260
+ let l = e, h = o, { t: g } = L(), b = r(Se, []), x = r(me, !1), w = d(/* @__PURE__ */ new Set()), O = t(!1), k = t(""), j = t(""), ee = [
1261
+ {
1262
+ key: "desktop",
1263
+ icon: rt,
1264
+ labelKey: "showOnDesktop"
1265
+ },
1266
+ {
1267
+ key: "tablet",
1268
+ icon: ct,
1269
+ labelKey: "showOnTablet"
1270
+ },
1271
+ {
1272
+ key: "mobile",
1273
+ icon: at,
1274
+ labelKey: "showOnMobile"
1275
+ }
1276
+ ];
1277
+ function M(e) {
1278
+ w.has(e) ? w.delete(e) : w.add(e);
1279
+ }
1280
+ let te = T(() => b.length > 0 || x), N = T(() => l.block.displayCondition ? !b.some((e) => e.label === l.block.displayCondition?.label) : !1);
1281
+ function ne() {
1282
+ O.value = !0, N.value && l.block.displayCondition ? (k.value = l.block.displayCondition.before, j.value = l.block.displayCondition.after ?? "") : (k.value = "", j.value = "");
1283
+ }
1284
+ function P() {
1285
+ k.value.trim() && (h("update", { displayCondition: {
1286
+ label: g.blockSettings.customCondition,
1287
+ before: k.value.trim(),
1288
+ after: j.value.trim()
1289
+ } }), O.value = !1, k.value = "", j.value = "");
1290
+ }
1291
+ n(() => l.block.displayCondition, (e) => {
1292
+ if (!e) {
1293
+ O.value = !1, k.value = "", j.value = "";
1294
+ return;
1295
+ }
1296
+ N.value && (k.value = e.before, j.value = e.after ?? "");
1297
+ }, { immediate: !0 });
1298
+ let re = T(() => {
1299
+ let e = {};
1300
+ for (let t of b) {
1301
+ let n = t.group ?? "";
1302
+ e[n] || (e[n] = []), e[n].push(t);
1303
+ }
1304
+ return e;
1305
+ });
1306
+ function ie(e, t) {
1307
+ h("update", { styles: {
1308
+ ...l.block.styles,
1309
+ [e]: t
1310
+ } });
1311
+ }
1312
+ function F(e) {
1313
+ return l.block.visibility?.[e] !== !1;
1314
+ }
1315
+ function ae(e) {
1316
+ let t = {
1317
+ desktop: F("desktop"),
1318
+ tablet: F("tablet"),
1319
+ mobile: F("mobile")
1320
+ };
1321
+ t[e] = !t[e], h("update", { visibility: t });
1322
+ }
1323
+ return (t, n) => (s(), f("div", { class: D(["tpl:flex tpl:flex-col", e.isFirstSection ? "" : "tpl:mt-4"]) }, [
1324
+ m(X, {
1325
+ title: p(g).blockSettings.spacing,
1326
+ open: w.has("spacing"),
1327
+ "no-border": e.isFirstSection,
1328
+ onToggle: n[2] ||= (e) => M("spacing")
1329
+ }, {
1330
+ default: a(() => [m(oi, {
1331
+ label: p(g).blockSettings.padding,
1332
+ "model-value": e.block.styles.padding,
1333
+ "onUpdate:modelValue": n[0] ||= (e) => ie("padding", e)
1334
+ }, null, 8, ["label", "model-value"]), C("div", ci, [m(oi, {
1335
+ label: p(g).blockSettings.margin,
1336
+ "model-value": e.block.styles.margin,
1337
+ "onUpdate:modelValue": n[1] ||= (e) => ie("margin", e)
1338
+ }, null, 8, ["label", "model-value"])])]),
1339
+ _: 1
1340
+ }, 8, [
1341
+ "title",
1342
+ "open",
1343
+ "no-border"
1344
+ ]),
1345
+ m(X, {
1346
+ title: p(g).blockSettings.background,
1347
+ open: w.has("bg"),
1348
+ onToggle: n[4] ||= (e) => M("bg")
1349
+ }, {
1350
+ default: a(() => [C("label", { class: D(p(V)) }, S(p(g).blockSettings.color), 3), m(q, {
1351
+ size: "large",
1352
+ "model-value": e.block.styles.backgroundColor || p("#ffffff"),
1353
+ "onUpdate:modelValue": n[3] ||= (e) => ie("backgroundColor", e)
1354
+ }, null, 8, ["model-value"])]),
1355
+ _: 1
1356
+ }, 8, ["title", "open"]),
1357
+ m(X, {
1358
+ title: p(g).blockSettings.display,
1359
+ open: w.has("display"),
1360
+ onToggle: n[5] ||= (e) => M("display")
1361
+ }, {
1362
+ default: a(() => [C("div", li, [(s(), f(_, null, i(ee, (e) => C("label", {
1363
+ key: e.key,
1364
+ class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:text-[var(--tpl-text)]"
1365
+ }, [
1366
+ C("input", {
1367
+ type: "checkbox",
1368
+ class: "tpl:accent-[var(--tpl-primary)]",
1369
+ checked: F(e.key),
1370
+ onChange: (t) => ae(e.key)
1371
+ }, null, 40, ui),
1372
+ (s(), y(c(e.icon), {
1373
+ size: 14,
1374
+ "stroke-width": 1.5
1375
+ })),
1376
+ A(" " + S(p(g).blockSettings[e.labelKey]), 1)
1377
+ ])), 64))])]),
1378
+ _: 1
1379
+ }, 8, ["title", "open"]),
1380
+ m(X, {
1381
+ title: p(g).blockSettings.customCss,
1382
+ open: w.has("css"),
1383
+ onToggle: n[7] ||= (e) => M("css")
1384
+ }, {
1385
+ default: a(() => [C("label", { class: D(p(V)) }, S(p(g).blockSettings.css), 3), C("textarea", {
1386
+ value: e.block.customCss || "",
1387
+ placeholder: p(g).blockSettings.cssPlaceholder,
1388
+ rows: "3",
1389
+ class: D(p(bt)),
1390
+ onInput: n[6] ||= (e) => h("update", { customCss: e.target.value })
1391
+ }, null, 42, di)]),
1392
+ _: 1
1393
+ }, 8, ["title", "open"]),
1394
+ te.value ? (s(), y(X, {
1395
+ key: 0,
1396
+ title: p(g).blockSettings.displayCondition,
1397
+ open: w.has("condition"),
1398
+ onToggle: n[11] ||= (e) => M("condition")
1399
+ }, {
1400
+ default: a(() => [C("div", fi, [C("select", {
1401
+ class: D(["tpl:w-full tpl:rounded-md tpl:border tpl:px-2.5 tpl:py-2 tpl:text-xs tpl:outline-none tpl:transition-all tpl:duration-150 tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[0_0_0_3px_var(--tpl-primary-light)]", e.block.displayCondition ? "tpl:border-[var(--tpl-primary)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-text)]" : "tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"]),
1402
+ value: O.value || N.value ? "__custom__" : e.block.displayCondition?.label ?? "",
1403
+ onChange: n[8] ||= (e) => {
1404
+ let t = e.target.value;
1405
+ if (t === "__custom__") {
1406
+ ne();
1407
+ return;
1408
+ }
1409
+ if (O.value = !1, !t) {
1410
+ h("update", { displayCondition: void 0 });
1411
+ return;
1412
+ }
1413
+ let n = p(b).find((e) => e.label === t);
1414
+ n && h("update", { displayCondition: n });
1415
+ }
1416
+ }, [
1417
+ C("option", mi, S(p(g).blockSettings.noCondition), 1),
1418
+ (s(!0), f(_, null, i(re.value, (e, t) => (s(), f(_, { key: t }, [t ? (s(), f("optgroup", {
1419
+ key: 0,
1420
+ label: String(t)
1421
+ }, [(s(!0), f(_, null, i(e, (e) => (s(), f("option", {
1422
+ key: e.label,
1423
+ value: e.label
1424
+ }, S(e.label), 9, gi))), 128))], 8, hi)) : (s(!0), f(_, { key: 1 }, i(e, (e) => (s(), f("option", {
1425
+ key: e.label,
1426
+ value: e.label
1427
+ }, S(e.label), 9, _i))), 128))], 64))), 128)),
1428
+ p(x) ? (s(), f("option", vi, S(p(g).blockSettings.customCondition), 1)) : v("", !0)
1429
+ ], 42, pi), O.value || N.value ? (s(), f("div", yi, [
1430
+ C("div", null, [C("label", bi, S(p(g).blockSettings.customConditionBefore), 1), u(C("textarea", {
1431
+ "onUpdate:modelValue": n[9] ||= (e) => k.value = e,
1432
+ rows: "2",
1433
+ class: D(p(bt))
1434
+ }, null, 2), [[E, k.value]])]),
1435
+ C("div", null, [C("label", xi, S(p(g).blockSettings.customConditionAfter), 1), u(C("textarea", {
1436
+ "onUpdate:modelValue": n[10] ||= (e) => j.value = e,
1437
+ rows: "2",
1438
+ class: D(p(bt))
1439
+ }, null, 2), [[E, j.value]])]),
1440
+ C("div", Si, [C("button", {
1441
+ type: "button",
1442
+ class: "tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-[var(--tpl-primary)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-bg)] tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:opacity-50",
1443
+ disabled: !k.value.trim(),
1444
+ onClick: P
1445
+ }, S(p(g).blockSettings.applyCondition), 9, Ci)])
1446
+ ])) : e.block.displayCondition && !N.value ? (s(), f(_, { key: 1 }, [e.block.displayCondition.description ? (s(), f("p", wi, S(e.block.displayCondition.description), 1)) : v("", !0), C("div", Ti, [C("pre", Ei, S(e.block.displayCondition.before), 1), e.block.displayCondition.after ? (s(), f("pre", Di, S(e.block.displayCondition.after), 1)) : v("", !0)])], 64)) : v("", !0)])]),
1447
+ _: 1
1448
+ }, 8, ["title", "open"])) : v("", !0)
1449
+ ], 2));
1450
+ }
1451
+ }), ki = [
1452
+ "aria-checked",
1453
+ "aria-label",
1454
+ "title",
1455
+ "onClick"
1456
+ ], Ai = { key: 1 }, Z = /* @__PURE__ */ l({
1457
+ __name: "SlidingPillSelect",
1458
+ props: {
1459
+ options: {},
1460
+ modelValue: {}
1461
+ },
1462
+ emits: ["update:modelValue"],
1463
+ setup(e, { emit: t }) {
1464
+ let n = e, r = t, a = T(() => {
1465
+ let e = n.options.findIndex((e) => e.value === n.modelValue);
1466
+ return `translateX(${Math.max(e, 0) * 100}%)`;
1467
+ });
1468
+ return (t, n) => (s(), f("div", {
1469
+ role: "radiogroup",
1470
+ class: "tpl:relative tpl:grid tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",
1471
+ style: g({
1472
+ gridTemplateColumns: `repeat(${e.options.length}, 1fr)`,
1473
+ backgroundColor: "var(--tpl-bg-hover)"
1474
+ })
1475
+ }, [C("div", {
1476
+ class: "tpl:absolute tpl:inset-y-1 tpl:rounded-[var(--tpl-radius-sm)]",
1477
+ style: g({
1478
+ left: "4px",
1479
+ width: `calc((100% - 8px) / ${e.options.length})`,
1480
+ transform: a.value,
1481
+ backgroundColor: "var(--tpl-bg)",
1482
+ boxShadow: "var(--tpl-shadow)",
1483
+ transition: "transform 120ms cubic-bezier(0.16, 1, 0.3, 1)"
1484
+ })
1485
+ }, null, 4), (s(!0), f(_, null, i(e.options, (t) => (s(), f("button", {
1486
+ key: t.value,
1487
+ role: "radio",
1488
+ "aria-checked": e.modelValue === t.value,
1489
+ "aria-label": t.label,
1490
+ class: "tpl:relative tpl:z-10 tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-2.5 tpl:py-[5px] tpl:text-xs tpl:font-medium",
1491
+ style: g({
1492
+ color: e.modelValue === t.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
1493
+ transition: "color 120ms cubic-bezier(0.16, 1, 0.3, 1)"
1494
+ }),
1495
+ title: t.label,
1496
+ onClick: (e) => r("update:modelValue", t.value)
1497
+ }, [t.icon ? (s(), y(c(t.icon), {
1498
+ key: 0,
1499
+ size: 14,
1500
+ "stroke-width": 2
1501
+ })) : (s(), f("span", Ai, S(t.label), 1))], 12, ki))), 128))], 4));
1502
+ }
1503
+ }), ji = { class: "tpl:mb-3.5" }, Q = /* @__PURE__ */ l({
1504
+ __name: "FieldRow",
1505
+ props: { label: {} },
1506
+ setup(e) {
1507
+ return (t, n) => (s(), f("div", ji, [e.label ? (s(), f("label", {
1508
+ key: 0,
1509
+ class: D(p(V))
1510
+ }, S(e.label), 3)) : v("", !0), o(t.$slots, "default")]));
1511
+ }
1512
+ }), Mi = { class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text)]" }, Ni = ["checked"], Pi = /* @__PURE__ */ l({
1513
+ __name: "CheckboxItem",
1514
+ props: {
1515
+ modelValue: { type: Boolean },
1516
+ label: {}
1517
+ },
1518
+ emits: ["update:modelValue"],
1519
+ setup(e, { emit: t }) {
1520
+ let n = t;
1521
+ return (t, r) => (s(), f("label", Mi, [C("input", {
1522
+ type: "checkbox",
1523
+ class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
1524
+ checked: e.modelValue,
1525
+ onChange: r[0] ||= (e) => n("update:modelValue", e.target.checked)
1526
+ }, null, 40, Ni), A(" " + S(e.label), 1)]));
1527
+ }
1528
+ }), Fi = { class: "tpl:flex tpl:items-stretch" }, Ii = [
1529
+ "value",
1530
+ "min",
1531
+ "max"
1532
+ ], Li = /* @__PURE__ */ l({
1533
+ __name: "NumberWithSuffix",
1534
+ props: {
1535
+ modelValue: {},
1536
+ min: {},
1537
+ max: {},
1538
+ suffix: {}
1539
+ },
1540
+ emits: ["update:modelValue"],
1541
+ setup(e, { emit: t }) {
1542
+ let n = t;
1543
+ return (t, r) => (s(), f("div", Fi, [C("input", {
1544
+ type: "number",
1545
+ class: D(p(U)),
1546
+ value: e.modelValue,
1547
+ min: e.min,
1548
+ max: e.max,
1549
+ onInput: r[0] ||= (e) => n("update:modelValue", Number(e.target.value))
1550
+ }, null, 42, Ii), C("span", { class: D(p(H)) }, S(e.suffix), 3)]));
1551
+ }
1552
+ }), Ri = ["value"], zi = ["value"], Bi = ["value"], Vi = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-2" }, Hi = ["value"], Ui = { value: "" }, Wi = ["value"], Gi = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-3" }, Ki = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-3" }, qi = { class: "tpl:grid tpl:grid-cols-2 tpl:gap-2" }, Ji = [
1553
+ "value",
1554
+ "placeholder",
1555
+ "onInput"
1556
+ ], Yi = ["value", "placeholder"], Xi = ["value"], Zi = /* @__PURE__ */ l({
1557
+ __name: "CountdownToolbar",
1558
+ props: {
1559
+ block: {},
1560
+ fontFamilies: {}
1561
+ },
1562
+ emits: ["update"],
1563
+ setup(e, { emit: t }) {
1564
+ let n = t, { t: r } = L(), o = [
1565
+ "UTC",
1566
+ "America/New_York",
1567
+ "America/Chicago",
1568
+ "America/Denver",
1569
+ "America/Los_Angeles",
1570
+ "Europe/London",
1571
+ "Europe/Berlin",
1572
+ "Europe/Paris",
1573
+ "Europe/Moscow",
1574
+ "Asia/Dubai",
1575
+ "Asia/Kolkata",
1576
+ "Asia/Shanghai",
1577
+ "Asia/Tokyo",
1578
+ "Australia/Sydney",
1579
+ "Pacific/Auckland"
1580
+ ], c = [
1581
+ {
1582
+ value: ":",
1583
+ label: ":"
1584
+ },
1585
+ {
1586
+ value: "-",
1587
+ label: "-"
1588
+ },
1589
+ {
1590
+ value: " ",
1591
+ label: "␣"
1592
+ }
1593
+ ], l = [
1594
+ "Days",
1595
+ "Hours",
1596
+ "Minutes",
1597
+ "Seconds"
1598
+ ], u = T(() => l.map((e) => ({
1599
+ unit: e,
1600
+ showKey: `show${e}`,
1601
+ labelKey: `label${e}`,
1602
+ translationKey: e.toLowerCase()
1603
+ })));
1604
+ function d(e, t) {
1605
+ n("update", { [e]: t });
1606
+ }
1607
+ return (t, n) => (s(), f(_, null, [
1608
+ m(Q, { label: p(r).countdown.targetDate }, {
1609
+ default: a(() => [C("input", {
1610
+ type: "datetime-local",
1611
+ class: D(p(B)),
1612
+ value: e.block.targetDate,
1613
+ onInput: n[0] ||= (e) => d("targetDate", e.target.value)
1614
+ }, null, 42, Ri)]),
1615
+ _: 1
1616
+ }, 8, ["label"]),
1617
+ m(Q, { label: p(r).countdown.timezone }, {
1618
+ default: a(() => [C("select", {
1619
+ class: D(p(B)),
1620
+ value: e.block.timezone,
1621
+ onChange: n[1] ||= (e) => d("timezone", e.target.value)
1622
+ }, [(s(), f(_, null, i(o, (e) => C("option", {
1623
+ key: e,
1624
+ value: e
1625
+ }, S(e), 9, Bi)), 64))], 42, zi)]),
1626
+ _: 1
1627
+ }, 8, ["label"]),
1628
+ m(Q, { label: p(r).countdown.display }, {
1629
+ default: a(() => [C("div", Vi, [(s(!0), f(_, null, i(u.value, (t) => (s(), y(Pi, {
1630
+ key: t.unit,
1631
+ "model-value": e.block[t.showKey],
1632
+ label: p(r).countdown[t.translationKey],
1633
+ "onUpdate:modelValue": (e) => d(t.showKey, e)
1634
+ }, null, 8, [
1635
+ "model-value",
1636
+ "label",
1637
+ "onUpdate:modelValue"
1638
+ ]))), 128))])]),
1639
+ _: 1
1640
+ }, 8, ["label"]),
1641
+ m(Q, { label: p(r).countdown.separator }, {
1642
+ default: a(() => [m(Z, {
1643
+ options: c,
1644
+ "model-value": e.block.separator,
1645
+ "onUpdate:modelValue": n[2] ||= (e) => d("separator", e)
1646
+ }, null, 8, ["model-value"])]),
1647
+ _: 1
1648
+ }, 8, ["label"]),
1649
+ m(Q, { label: p(r).countdown.fontFamily }, {
1650
+ default: a(() => [C("select", {
1651
+ class: D(p(B)),
1652
+ value: e.block.fontFamily || "",
1653
+ onChange: n[3] ||= (e) => d("fontFamily", e.target.value || void 0)
1654
+ }, [C("option", Ui, S(p(r).countdown.inheritFont), 1), (s(!0), f(_, null, i(e.fontFamilies, (e) => (s(), f("option", {
1655
+ key: e.value,
1656
+ value: e.value
1657
+ }, S(e.label), 9, Wi))), 128))], 42, Hi)]),
1658
+ _: 1
1659
+ }, 8, ["label"]),
1660
+ C("div", Gi, [m(Q, { label: p(r).countdown.digitFontSize }, {
1661
+ default: a(() => [m(Li, {
1662
+ "model-value": e.block.digitFontSize,
1663
+ min: 12,
1664
+ max: 72,
1665
+ suffix: "px",
1666
+ "onUpdate:modelValue": n[4] ||= (e) => d("digitFontSize", e)
1667
+ }, null, 8, ["model-value"])]),
1668
+ _: 1
1669
+ }, 8, ["label"]), m(Q, { label: p(r).countdown.labelFontSize }, {
1670
+ default: a(() => [m(Li, {
1671
+ "model-value": e.block.labelFontSize,
1672
+ min: 8,
1673
+ max: 24,
1674
+ suffix: "px",
1675
+ "onUpdate:modelValue": n[5] ||= (e) => d("labelFontSize", e)
1676
+ }, null, 8, ["model-value"])]),
1677
+ _: 1
1678
+ }, 8, ["label"])]),
1679
+ C("div", Ki, [m(Q, { label: p(r).countdown.digitColor }, {
1680
+ default: a(() => [m(q, {
1681
+ "model-value": e.block.digitColor,
1682
+ "onUpdate:modelValue": n[6] ||= (e) => d("digitColor", e)
1683
+ }, null, 8, ["model-value"])]),
1684
+ _: 1
1685
+ }, 8, ["label"]), m(Q, { label: p(r).countdown.labelColor }, {
1686
+ default: a(() => [m(q, {
1687
+ "model-value": e.block.labelColor,
1688
+ "onUpdate:modelValue": n[7] ||= (e) => d("labelColor", e)
1689
+ }, null, 8, ["model-value"])]),
1690
+ _: 1
1691
+ }, 8, ["label"])]),
1692
+ m(Q, { label: p(r).countdown.background }, {
1693
+ default: a(() => [m(q, {
1694
+ "model-value": e.block.backgroundColor,
1695
+ "onUpdate:modelValue": n[8] ||= (e) => d("backgroundColor", e)
1696
+ }, null, 8, ["model-value"])]),
1697
+ _: 1
1698
+ }, 8, ["label"]),
1699
+ m(Q, { label: p(r).countdown.labels }, {
1700
+ default: a(() => [C("div", qi, [(s(!0), f(_, null, i(u.value, (t) => (s(), f("input", {
1701
+ key: t.unit,
1702
+ type: "text",
1703
+ class: D(p(B)),
1704
+ value: e.block[t.labelKey],
1705
+ placeholder: p(r).countdown[t.translationKey],
1706
+ onInput: (e) => d(t.labelKey, e.target.value)
1707
+ }, null, 42, Ji))), 128))])]),
1708
+ _: 1
1709
+ }, 8, ["label"]),
1710
+ m(Q, { label: p(r).countdown.expiry }, {
1711
+ default: a(() => [C("input", {
1712
+ type: "text",
1713
+ class: D(p(B)),
1714
+ value: e.block.expiredMessage,
1715
+ placeholder: p(r).countdown.expiredMessagePlaceholder,
1716
+ onInput: n[9] ||= (e) => d("expiredMessage", e.target.value)
1717
+ }, null, 42, Yi)]),
1718
+ _: 1
1719
+ }, 8, ["label"]),
1720
+ m(Q, { label: p(r).countdown.expiredImageUrl }, {
1721
+ default: a(() => [C("input", {
1722
+ type: "url",
1723
+ class: D(p(B)),
1724
+ value: e.block.expiredImageUrl,
1725
+ placeholder: "https://...",
1726
+ onInput: n[10] ||= (e) => d("expiredImageUrl", e.target.value)
1727
+ }, null, 42, Xi)]),
1728
+ _: 1
1729
+ }, 8, ["label"]),
1730
+ m(Pi, {
1731
+ "model-value": e.block.hideOnExpiry,
1732
+ label: p(r).countdown.hideOnExpiry,
1733
+ class: "tpl:mb-3.5",
1734
+ "onUpdate:modelValue": n[11] ||= (e) => d("hideOnExpiry", e)
1735
+ }, null, 8, ["model-value", "label"])
1736
+ ], 64));
1737
+ }
1738
+ }), Qi = ["title"], $i = { class: "tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, ea = {
1739
+ key: 1,
1740
+ class: "tpl:text-[var(--tpl-danger)]"
1741
+ }, ta = [
1742
+ "aria-checked",
1743
+ "aria-label",
1744
+ "disabled"
1745
+ ], na = /* @__PURE__ */ l({
1746
+ __name: "BooleanField",
1747
+ props: {
1748
+ field: {},
1749
+ modelValue: { type: Boolean },
1750
+ readOnly: { type: Boolean }
1751
+ },
1752
+ emits: ["update:modelValue"],
1753
+ setup(e, { emit: t }) {
1754
+ let n = t, { t: r } = L();
1755
+ return (t, i) => (s(), f("div", {
1756
+ class: "tpl:mb-3.5",
1757
+ title: e.readOnly ? p(r).customBlocks.dataSource.readOnlyTooltip : void 0
1758
+ }, [C("label", { class: D(["tpl:flex tpl:items-center tpl:justify-between tpl:gap-2", e.readOnly ? "tpl:cursor-not-allowed" : "tpl:cursor-pointer"]) }, [C("span", $i, [
1759
+ A(S(e.field.label) + " ", 1),
1760
+ e.readOnly ? (s(), y(p(et), {
1761
+ key: 0,
1762
+ size: 12,
1763
+ class: "tpl:inline tpl:text-[var(--tpl-text-dim)]"
1764
+ })) : v("", !0),
1765
+ e.field.required ? (s(), f("span", ea, " * ")) : v("", !0)
1766
+ ]), C("button", {
1767
+ type: "button",
1768
+ role: "switch",
1769
+ "aria-checked": e.modelValue,
1770
+ "aria-label": e.field.label,
1771
+ class: D([
1772
+ "tpl:relative tpl:inline-flex tpl:h-5 tpl:w-9 tpl:shrink-0 tpl:rounded-full tpl:border-2 tpl:border-transparent tpl:transition-colors tpl:duration-200",
1773
+ e.modelValue ? "tpl:bg-[var(--tpl-primary)]" : "tpl:bg-[var(--tpl-border)]",
1774
+ e.readOnly ? "tpl:opacity-60 tpl:cursor-not-allowed" : "tpl:cursor-pointer"
1775
+ ]),
1776
+ disabled: e.readOnly,
1777
+ onClick: i[0] ||= (t) => !e.readOnly && n("update:modelValue", !e.modelValue)
1778
+ }, [C("span", { class: D(["tpl:pointer-events-none tpl:inline-block tpl:size-4 tpl:rounded-full tpl:bg-[var(--tpl-bg)] tpl:shadow tpl:transition-transform tpl:duration-200", e.modelValue ? "tpl:translate-x-4" : "tpl:translate-x-0"]) }, null, 2)], 10, ta)], 2)], 8, Qi));
1779
+ }
1780
+ }), ra = { class: "tpl:mb-3.5" }, ia = {
1781
+ key: 1,
1782
+ class: "tpl:text-[var(--tpl-danger)]"
1783
+ }, $ = /* @__PURE__ */ l({
1784
+ __name: "FieldWrapper",
1785
+ props: {
1786
+ label: {},
1787
+ required: { type: Boolean },
1788
+ readOnly: { type: Boolean }
1789
+ },
1790
+ setup(e) {
1791
+ return (t, n) => (s(), f("div", ra, [C("label", { class: D(p(V)) }, [
1792
+ A(S(e.label) + " ", 1),
1793
+ e.readOnly ? (s(), y(p(et), {
1794
+ key: 0,
1795
+ size: 12,
1796
+ class: "tpl:inline tpl:text-[var(--tpl-text-dim)]"
1797
+ })) : v("", !0),
1798
+ e.required ? (s(), f("span", ia, "*")) : v("", !0)
1799
+ ], 2), o(t.$slots, "default")]));
1800
+ }
1801
+ }), aa = /* @__PURE__ */ l({
1802
+ __name: "ColorField",
1803
+ props: {
1804
+ field: {},
1805
+ modelValue: {},
1806
+ readOnly: { type: Boolean }
1807
+ },
1808
+ emits: ["update:modelValue"],
1809
+ setup(e, { emit: t }) {
1810
+ let n = t, { t: r } = L();
1811
+ return (t, i) => (s(), y($, {
1812
+ label: e.field.label,
1813
+ required: e.field.required,
1814
+ "read-only": e.readOnly
1815
+ }, {
1816
+ default: a(() => [m(q, {
1817
+ "model-value": e.modelValue || p("#000000"),
1818
+ placeholder: e.field.placeholder || p("#000000"),
1819
+ disabled: e.readOnly,
1820
+ title: e.readOnly ? p(r).customBlocks.dataSource.readOnlyTooltip : void 0,
1821
+ "onUpdate:modelValue": i[0] ||= (e) => n("update:modelValue", e)
1822
+ }, null, 8, [
1823
+ "model-value",
1824
+ "placeholder",
1825
+ "disabled",
1826
+ "title"
1827
+ ])]),
1828
+ _: 1
1829
+ }, 8, [
1830
+ "label",
1831
+ "required",
1832
+ "read-only"
1833
+ ]));
1834
+ }
1835
+ }), oa = [
1836
+ "value",
1837
+ "placeholder",
1838
+ "title"
1839
+ ], sa = ["value", "placeholder"], ca = /* @__PURE__ */ l({
1840
+ __name: "ImageField",
1841
+ props: {
1842
+ field: {},
1843
+ modelValue: {},
1844
+ readOnly: { type: Boolean }
1845
+ },
1846
+ emits: ["update:modelValue"],
1847
+ setup(e, { emit: t }) {
1848
+ let n = t, { t: i } = L(), o = r(F, null), c = T(() => !!o);
1849
+ async function l() {
1850
+ let e = await o?.({ accept: ["images"] });
1851
+ e && n("update:modelValue", e.url);
1852
+ }
1853
+ return (t, r) => (s(), y($, {
1854
+ label: e.field.label,
1855
+ required: e.field.required,
1856
+ "read-only": e.readOnly
1857
+ }, {
1858
+ default: a(() => [e.readOnly ? (s(), f("input", {
1859
+ key: 0,
1860
+ type: "url",
1861
+ class: D([p(B), "tpl:opacity-60 tpl:cursor-not-allowed"]),
1862
+ value: e.modelValue,
1863
+ placeholder: e.field.placeholder || "https://...",
1864
+ disabled: "",
1865
+ title: p(i).customBlocks.dataSource.readOnlyTooltip
1866
+ }, null, 10, oa)) : (s(), f("input", {
1867
+ key: 1,
1868
+ type: "url",
1869
+ class: D(p(B)),
1870
+ value: e.modelValue,
1871
+ placeholder: e.field.placeholder || "https://...",
1872
+ onInput: r[0] ||= (e) => n("update:modelValue", e.target.value)
1873
+ }, null, 42, sa)), c.value && !e.readOnly ? (s(), f("button", {
1874
+ key: 2,
1875
+ class: "tpl:mt-2 tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-primary)] tpl:bg-[var(--tpl-bg)]",
1876
+ onClick: r[1] ||= (e) => l()
1877
+ }, [m(p(Le), {
1878
+ size: 14,
1879
+ "stroke-width": 1.5
1880
+ }), A(" " + S(p(i).image.browseMedia), 1)])) : v("", !0)]),
1881
+ _: 1
1882
+ }, 8, [
1883
+ "label",
1884
+ "required",
1885
+ "read-only"
1886
+ ]));
1887
+ }
1888
+ }), la = [
1889
+ "value",
1890
+ "placeholder",
1891
+ "min",
1892
+ "max",
1893
+ "step",
1894
+ "disabled",
1895
+ "title"
1896
+ ], ua = /* @__PURE__ */ l({
1897
+ __name: "NumberField",
1898
+ props: {
1899
+ field: {},
1900
+ modelValue: {},
1901
+ readOnly: { type: Boolean }
1902
+ },
1903
+ emits: ["update:modelValue"],
1904
+ setup(e, { emit: t }) {
1905
+ let n = t, { t: r } = L();
1906
+ return (t, i) => (s(), y($, {
1907
+ label: e.field.label,
1908
+ required: e.field.required,
1909
+ "read-only": e.readOnly
1910
+ }, {
1911
+ default: a(() => [C("input", {
1912
+ type: "number",
1913
+ class: D([p(B), e.readOnly && "tpl:opacity-60 tpl:cursor-not-allowed"]),
1914
+ value: e.modelValue,
1915
+ placeholder: e.field.placeholder,
1916
+ min: e.field.min,
1917
+ max: e.field.max,
1918
+ step: e.field.step,
1919
+ disabled: e.readOnly,
1920
+ title: e.readOnly ? p(r).customBlocks.dataSource.readOnlyTooltip : void 0,
1921
+ onInput: i[0] ||= (t) => !e.readOnly && n("update:modelValue", Number(t.target.value))
1922
+ }, null, 42, la)]),
1923
+ _: 1
1924
+ }, 8, [
1925
+ "label",
1926
+ "required",
1927
+ "read-only"
1928
+ ]));
1929
+ }
1930
+ }), da = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, fa = { class: "tpl:mb-2 tpl:flex tpl:items-center tpl:justify-between" }, pa = { class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-dim)]" }, ma = ["title", "onClick"], ha = {
1931
+ key: 1,
1932
+ class: "tpl:m-0 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
1933
+ }, ga = /* @__PURE__ */ l({
1934
+ __name: "RepeatableField",
1935
+ props: {
1936
+ field: {},
1937
+ modelValue: {},
1938
+ readOnly: { type: Boolean }
1939
+ },
1940
+ emits: ["update:modelValue"],
1941
+ setup(e, { emit: t }) {
1942
+ let n = e, r = t, { t: o } = L(), l = T(() => n.modelValue || []), u = T(() => !n.field.maxItems || l.value.length < n.field.maxItems), d = T(() => !n.field.minItems || l.value.length > n.field.minItems);
1943
+ function h() {
1944
+ if (!u.value || n.readOnly) return;
1945
+ let e = {};
1946
+ for (let t of n.field.fields) e[t.key] = t.default ?? "";
1947
+ r("update:modelValue", [...l.value, e]);
1948
+ }
1949
+ function g(e) {
1950
+ if (!d.value || n.readOnly) return;
1951
+ let t = [...l.value];
1952
+ t.splice(e, 1), r("update:modelValue", t);
1953
+ }
1954
+ function b(e, t, n) {
1955
+ r("update:modelValue", l.value.map((r, i) => i === e ? {
1956
+ ...r,
1957
+ [t]: n
1958
+ } : r));
1959
+ }
1960
+ return (t, n) => (s(), y($, {
1961
+ label: e.field.label,
1962
+ required: e.field.required,
1963
+ "read-only": e.readOnly
1964
+ }, {
1965
+ default: a(() => [C("div", da, [
1966
+ (s(!0), f(_, null, i(l.value, (t, n) => (s(), f("div", {
1967
+ key: `${e.field.key}-${n}`,
1968
+ class: "tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-3"
1969
+ }, [C("div", fa, [C("span", pa, " #" + S(n + 1), 1), d.value && !e.readOnly ? (s(), f("button", {
1970
+ key: 0,
1971
+ type: "button",
1972
+ class: "tpl:flex tpl:size-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]",
1973
+ title: p(o).customBlocks.fields.removeItem,
1974
+ onClick: (e) => g(n)
1975
+ }, [m(p(Ge), {
1976
+ size: 12,
1977
+ "stroke-width": 2
1978
+ })], 8, ma)) : v("", !0)]), (s(!0), f(_, null, i(e.field.fields, (r) => (s(), y(c(p(Ta)(r.type)), {
1979
+ key: r.key,
1980
+ field: r,
1981
+ "model-value": t[r.key],
1982
+ "read-only": e.readOnly,
1983
+ "onUpdate:modelValue": (e) => b(n, r.key, e)
1984
+ }, null, 8, [
1985
+ "field",
1986
+ "model-value",
1987
+ "read-only",
1988
+ "onUpdate:modelValue"
1989
+ ]))), 128))]))), 128)),
1990
+ u.value && !e.readOnly ? (s(), f("button", {
1991
+ key: 0,
1992
+ type: "button",
1993
+ class: D(p(yt)),
1994
+ onClick: h
1995
+ }, [m(p(z), {
1996
+ size: 14,
1997
+ "stroke-width": 2
1998
+ }), A(" " + S(p(o).customBlocks.fields.addItem), 1)], 2)) : v("", !0),
1999
+ !u.value && !e.readOnly ? (s(), f("p", ha, S(p(o).customBlocks.fields.maxItemsReached), 1)) : v("", !0)
2000
+ ])]),
2001
+ _: 1
2002
+ }, 8, [
2003
+ "label",
2004
+ "required",
2005
+ "read-only"
2006
+ ]));
2007
+ }
2008
+ }), _a = [
2009
+ "value",
2010
+ "disabled",
2011
+ "title"
2012
+ ], va = ["value"], ya = /* @__PURE__ */ l({
2013
+ __name: "SelectField",
2014
+ props: {
2015
+ field: {},
2016
+ modelValue: {},
2017
+ readOnly: { type: Boolean }
2018
+ },
2019
+ emits: ["update:modelValue"],
2020
+ setup(e, { emit: t }) {
2021
+ let n = t, { t: r } = L();
2022
+ return (t, o) => (s(), y($, {
2023
+ label: e.field.label,
2024
+ required: e.field.required,
2025
+ "read-only": e.readOnly
2026
+ }, {
2027
+ default: a(() => [C("select", {
2028
+ class: D([p(B), e.readOnly && "tpl:opacity-60 tpl:cursor-not-allowed"]),
2029
+ value: e.modelValue,
2030
+ disabled: e.readOnly,
2031
+ title: e.readOnly ? p(r).customBlocks.dataSource.readOnlyTooltip : void 0,
2032
+ onChange: o[0] ||= (t) => !e.readOnly && n("update:modelValue", t.target.value)
2033
+ }, [(s(!0), f(_, null, i(e.field.options, (e) => (s(), f("option", {
2034
+ key: e.value,
2035
+ value: e.value
2036
+ }, S(e.label), 9, va))), 128))], 42, _a)]),
2037
+ _: 1
2038
+ }, 8, [
2039
+ "label",
2040
+ "required",
2041
+ "read-only"
2042
+ ]));
2043
+ }
2044
+ }), ba = [
2045
+ "value",
2046
+ "placeholder",
2047
+ "title"
2048
+ ], xa = /* @__PURE__ */ l({
2049
+ __name: "TextField",
2050
+ props: {
2051
+ field: {},
2052
+ modelValue: {},
2053
+ readOnly: { type: Boolean }
2054
+ },
2055
+ emits: ["update:modelValue"],
2056
+ setup(e, { emit: t }) {
2057
+ let n = t, { t: r } = L();
2058
+ return (t, i) => (s(), y($, {
2059
+ label: e.field.label,
2060
+ required: e.field.required,
2061
+ "read-only": e.readOnly
2062
+ }, {
2063
+ default: a(() => [e.readOnly ? (s(), f("input", {
2064
+ key: 0,
2065
+ type: "text",
2066
+ class: D([p(B), "tpl:opacity-60 tpl:cursor-not-allowed"]),
2067
+ value: e.modelValue,
2068
+ placeholder: e.field.placeholder,
2069
+ disabled: "",
2070
+ title: p(r).customBlocks.dataSource.readOnlyTooltip
2071
+ }, null, 10, ba)) : (s(), y(J, {
2072
+ key: 1,
2073
+ "model-value": e.modelValue,
2074
+ placeholder: e.field.placeholder,
2075
+ "onUpdate:modelValue": i[0] ||= (e) => n("update:modelValue", e)
2076
+ }, null, 8, ["model-value", "placeholder"]))]),
2077
+ _: 1
2078
+ }, 8, [
2079
+ "label",
2080
+ "required",
2081
+ "read-only"
2082
+ ]));
2083
+ }
2084
+ }), Sa = [
2085
+ "value",
2086
+ "placeholder",
2087
+ "title"
2088
+ ], Ca = "tpl:w-full tpl:resize-y tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-2 tpl:text-sm tpl:text-[var(--tpl-text)] tpl:outline-none tpl:opacity-60 tpl:cursor-not-allowed", wa = {
2089
+ text: xa,
2090
+ textarea: /* @__PURE__ */ l({
2091
+ __name: "TextareaField",
2092
+ props: {
2093
+ field: {},
2094
+ modelValue: {},
2095
+ readOnly: { type: Boolean }
2096
+ },
2097
+ emits: ["update:modelValue"],
2098
+ setup(e, { emit: t }) {
2099
+ let n = t, { t: r } = L();
2100
+ return (t, i) => (s(), y($, {
2101
+ label: e.field.label,
2102
+ required: e.field.required,
2103
+ "read-only": e.readOnly
2104
+ }, {
2105
+ default: a(() => [e.readOnly ? (s(), f("textarea", {
2106
+ key: 0,
2107
+ value: e.modelValue,
2108
+ placeholder: e.field.placeholder,
2109
+ rows: "3",
2110
+ disabled: "",
2111
+ title: p(r).customBlocks.dataSource.readOnlyTooltip,
2112
+ class: D(Ca)
2113
+ }, null, 8, Sa)) : (s(), y(Wn, {
2114
+ key: 1,
2115
+ "model-value": e.modelValue,
2116
+ placeholder: e.field.placeholder,
2117
+ "onUpdate:modelValue": i[0] ||= (e) => n("update:modelValue", e)
2118
+ }, null, 8, ["model-value", "placeholder"]))]),
2119
+ _: 1
2120
+ }, 8, [
2121
+ "label",
2122
+ "required",
2123
+ "read-only"
2124
+ ]));
2125
+ }
2126
+ }),
2127
+ image: ca,
2128
+ color: aa,
2129
+ number: ua,
2130
+ select: ya,
2131
+ boolean: na,
2132
+ repeatable: ga
2133
+ };
2134
+ function Ta(e) {
2135
+ return wa[e] ?? xa;
2136
+ }
2137
+ //#endregion
2138
+ //#region src/components/toolbar/CustomBlockToolbar.vue?vue&type=script&setup=true&lang.ts
2139
+ var Ea = {
2140
+ key: 0,
2141
+ class: "tpl:p-4"
2142
+ }, Da = { class: "tpl:m-0 tpl:text-center tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, Oa = { key: 1 }, ka = {
2143
+ key: 0,
2144
+ class: "tpl:m-0 tpl:mb-3 tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
2145
+ }, Aa = {
2146
+ key: 1,
2147
+ class: "tpl:mb-4"
2148
+ }, ja = {
2149
+ key: 1,
2150
+ class: "tpl:flex tpl:h-[32px] tpl:items-center"
2151
+ }, Ma = {
2152
+ key: 0,
2153
+ class: "tpl:w-full tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-muted)]"
2154
+ }, Na = {
2155
+ key: 2,
2156
+ class: "tpl:m-0 tpl:mt-2 tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:text-[var(--tpl-danger)]"
2157
+ }, Pa = /* @__PURE__ */ l({
2158
+ __name: "CustomBlockToolbar",
2159
+ props: { block: {} },
2160
+ emits: ["updateFieldValues", "updateDataSourceFetched"],
2161
+ setup(e, { emit: t }) {
2162
+ let n = e, a = t, { t: o } = L(), l = r(N, []), u = T(() => l.find((e) => e.type === n.block.customType)), { isFetching: d, fetchError: h, fetch: g, hasDataSource: b, needsFetch: x } = Ae({
2163
+ definition: u,
2164
+ block: T(() => n.block),
2165
+ onUpdate: (e, t) => {
2166
+ a("updateFieldValues", e), a("updateDataSourceFetched", t);
2167
+ }
2168
+ });
2169
+ function w(e) {
2170
+ return e.readOnly === !0 && b.value && !!n.block.dataSourceFetched;
2171
+ }
2172
+ function E(e, t) {
2173
+ a("updateFieldValues", {
2174
+ ...n.block.fieldValues,
2175
+ [e]: t
2176
+ });
2177
+ }
2178
+ return (t, n) => u.value ? (s(), f("div", Oa, [
2179
+ u.value.description ? (s(), f("p", ka, S(u.value.description), 1)) : v("", !0),
2180
+ p(b) ? (s(), f("div", Aa, [p(x) && !p(d) ? (s(), f("button", {
2181
+ key: 0,
2182
+ type: "button",
2183
+ class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded-md tpl:px-3 tpl:py-2.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-bg)] tpl:transition-all tpl:duration-150 tpl:bg-[var(--tpl-primary)]",
2184
+ onClick: n[0] ||= (...e) => p(g) && p(g)(...e)
2185
+ }, S(u.value?.dataSource?.label || p(o).customBlocks.dataSource.fetchButton), 1)) : (s(), f("div", ja, [p(d) ? (s(), f("div", Ma, S(p(o).customBlocks.dataSource.fetching), 1)) : (s(), f("button", {
2186
+ key: 1,
2187
+ type: "button",
2188
+ class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-primary)] tpl:hover:text-[var(--tpl-primary)]",
2189
+ onClick: n[1] ||= (...e) => p(g) && p(g)(...e)
2190
+ }, [m(p(Ve), { size: 12 }), A(" " + S(p(o).customBlocks.dataSource.changeButton), 1)]))])), p(h) ? (s(), f("p", Na, [m(p(ve), {
2191
+ size: 14,
2192
+ class: "tpl:shrink-0"
2193
+ }), A(" " + S(p(o).customBlocks.dataSource.fetchError), 1)])) : v("", !0)])) : v("", !0),
2194
+ (s(!0), f(_, null, i(u.value.fields, (t) => (s(), y(c(p(Ta)(t.type)), {
2195
+ key: t.key,
2196
+ field: t,
2197
+ "model-value": e.block.fieldValues[t.key],
2198
+ "read-only": w(t),
2199
+ "onUpdate:modelValue": (e) => E(t.key, e)
2200
+ }, null, 8, [
2201
+ "field",
2202
+ "model-value",
2203
+ "read-only",
2204
+ "onUpdate:modelValue"
2205
+ ]))), 128))
2206
+ ])) : (s(), f("div", Ea, [C("p", Da, S(p(o).customBlocks.toolbar.noDefinition), 1)]));
2207
+ }
2208
+ }), Fa = { class: "tpl:mb-3.5" }, Ia = { class: "tpl:mb-3.5" }, La = { class: "tpl:mb-3.5" }, Ra = { class: "tpl:flex tpl:items-stretch" }, za = ["value"], Ba = /* @__PURE__ */ l({
2209
+ __name: "DividerToolbar",
2210
+ props: { block: {} },
2211
+ emits: ["update"],
2212
+ setup(e, { emit: t }) {
2213
+ let n = t, { t: r } = L();
2214
+ function i(e, t) {
2215
+ n("update", { [e]: t });
2216
+ }
2217
+ return (t, n) => (s(), f(_, null, [
2218
+ C("div", Fa, [C("label", { class: D(p(V)) }, S(p(r).divider.style), 3), m(Z, {
2219
+ options: [
2220
+ {
2221
+ value: "solid",
2222
+ label: p(r).divider.solid
2223
+ },
2224
+ {
2225
+ value: "dashed",
2226
+ label: p(r).divider.dashed
2227
+ },
2228
+ {
2229
+ value: "dotted",
2230
+ label: p(r).divider.dotted
2231
+ }
2232
+ ],
2233
+ "model-value": e.block.lineStyle,
2234
+ "onUpdate:modelValue": n[0] ||= (e) => i("lineStyle", e)
2235
+ }, null, 8, ["options", "model-value"])]),
2236
+ C("div", Ia, [C("label", { class: D(p(V)) }, S(p(r).divider.color), 3), m(q, {
2237
+ "model-value": e.block.color,
2238
+ "onUpdate:modelValue": n[1] ||= (e) => i("color", e)
2239
+ }, null, 8, ["model-value"])]),
2240
+ C("div", La, [C("label", { class: D(p(V)) }, S(p(r).divider.thickness), 3), C("div", Ra, [C("input", {
2241
+ type: "number",
2242
+ class: D(p(U)),
2243
+ value: e.block.thickness,
2244
+ min: "1",
2245
+ max: "10",
2246
+ onInput: n[2] ||= (e) => i("thickness", Number(e.target.value))
2247
+ }, null, 42, za), C("span", { class: D(p(H)) }, "px", 2)])])
2248
+ ], 64));
2249
+ }
2250
+ }), Va = { class: "tpl:mb-3.5" }, Ha = ["value"], Ua = { class: "tpl:mt-1.5 tpl:flex tpl:items-start tpl:gap-1.5 tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]" }, Wa = /* @__PURE__ */ l({
2251
+ __name: "HtmlToolbar",
2252
+ props: { block: {} },
2253
+ emits: ["update"],
2254
+ setup(e, { emit: t }) {
2255
+ let n = t, { t: r } = L();
2256
+ return (t, i) => (s(), f("div", Va, [
2257
+ C("label", { class: D(p(V)) }, S(p(r).html.content), 3),
2258
+ C("textarea", {
2259
+ value: e.block.content,
2260
+ placeholder: "<div>...</div>",
2261
+ rows: "10",
2262
+ class: D(p(bt)),
2263
+ onInput: i[0] ||= (e) => n("update", { content: e.target.value })
2264
+ }, null, 42, Ha),
2265
+ C("p", Ua, [m(p(Ue), {
2266
+ size: 12,
2267
+ class: "tpl:mt-0.5 tpl:shrink-0"
2268
+ }), A(" " + S(p(r).html.sanitizationHint), 1)])
2269
+ ]));
2270
+ }
2271
+ }), Ga = { class: "tpl:mb-3.5" }, Ka = {
2272
+ key: 0,
2273
+ class: "tpl:mb-3.5"
2274
+ }, qa = ["value", "placeholder"], Ja = { class: "tpl:mb-3.5" }, Ya = { class: "tpl:mb-3.5" }, Xa = ["value"], Za = { value: "full" }, Qa = { class: "tpl:mb-3.5" }, $a = { class: "tpl:mb-3.5" }, eo = {
2275
+ key: 0,
2276
+ class: "tpl:mt-2 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-[12px] tpl:text-[var(--tpl-text-muted)]"
2277
+ }, to = ["checked"], no = /* @__PURE__ */ l({
2278
+ __name: "ImageToolbar",
2279
+ props: { block: {} },
2280
+ emits: ["update"],
2281
+ setup(e, { emit: n }) {
2282
+ let i = n, { t: a } = L(), o = r(F, null), c = r(we, Ke.liquid), l = T(() => !!o), u = t(!1), d = t(!1), { start: h } = Re(() => {
2283
+ u.value = !1;
2284
+ }, 1e3, { immediate: !1 });
2285
+ function g(e, t) {
2286
+ i("update", { [e]: t });
2287
+ }
2288
+ async function y() {
2289
+ let e = await o?.({ accept: ["images"] });
2290
+ e && (g("src", e.url), e.alt && (g("alt", e.alt), d.value = !0), u.value = !0, h());
2291
+ }
2292
+ return (t, n) => (s(), f(_, null, [
2293
+ C("div", Ga, [
2294
+ C("label", { class: D(p(V)) }, S(p(a).image.imageUrl), 3),
2295
+ m(J, {
2296
+ "model-value": e.block.src,
2297
+ type: "url",
2298
+ placeholder: p(a).image.imageUrlPlaceholder,
2299
+ pulse: u.value,
2300
+ "onUpdate:modelValue": n[0] ||= (e) => g("src", e)
2301
+ }, null, 8, [
2302
+ "model-value",
2303
+ "placeholder",
2304
+ "pulse"
2305
+ ]),
2306
+ l.value ? (s(), f("button", {
2307
+ key: 0,
2308
+ class: "tpl:mt-2 tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
2309
+ style: {
2310
+ "border-color": "var(--tpl-border)",
2311
+ color: "var(--tpl-primary)",
2312
+ "background-color": "var(--tpl-bg)"
2313
+ },
2314
+ onClick: y
2315
+ }, [m(p(Le), {
2316
+ size: 14,
2317
+ "stroke-width": 1.5
2318
+ }), A(" " + S(p(a).image.browseMedia), 1)])) : v("", !0)
2319
+ ]),
2320
+ p(Ne)(e.block.src, p(c)) ? (s(), f("div", Ka, [C("label", { class: D(p(V)) }, [A(S(p(a).image.placeholderUrl) + " ", 1), n[7] ||= C("span", { class: "tpl:font-normal tpl:text-[var(--tpl-text-dim)]" }, S("(optional)"), -1)], 2), C("input", {
2321
+ type: "url",
2322
+ class: D(p(B)),
2323
+ value: e.block.placeholderUrl || "",
2324
+ placeholder: p(a).image.placeholderUrlPlaceholder,
2325
+ onInput: n[1] ||= (e) => g("placeholderUrl", e.target.value)
2326
+ }, null, 42, qa)])) : v("", !0),
2327
+ C("div", Ja, [C("label", { class: D(p(V)) }, S(p(a).image.altText), 3), m(J, {
2328
+ "model-value": e.block.alt,
2329
+ type: "text",
2330
+ placeholder: p(a).image.altTextPlaceholder,
2331
+ pulse: d.value,
2332
+ "onUpdate:modelValue": n[2] ||= (e) => g("alt", e)
2333
+ }, null, 8, [
2334
+ "model-value",
2335
+ "placeholder",
2336
+ "pulse"
2337
+ ])]),
2338
+ C("div", Ya, [C("label", { class: D(p(V)) }, S(p(a).image.width), 3), C("select", {
2339
+ class: D(p(B)),
2340
+ value: e.block.width,
2341
+ onChange: n[3] ||= (e) => g("width", e.target.value === "full" ? "full" : Number(e.target.value))
2342
+ }, [
2343
+ C("option", Za, S(p(a).image.fullWidth), 1),
2344
+ n[8] ||= C("option", { value: "300" }, "300px", -1),
2345
+ n[9] ||= C("option", { value: "400" }, "400px", -1),
2346
+ n[10] ||= C("option", { value: "500" }, "500px", -1)
2347
+ ], 42, Xa)]),
2348
+ C("div", Qa, [C("label", { class: D(p(V)) }, S(p(a).title.align), 3), m(Z, {
2349
+ options: [
2350
+ {
2351
+ value: "left",
2352
+ label: p(a).title.alignLeft
2353
+ },
2354
+ {
2355
+ value: "center",
2356
+ label: p(a).title.alignCenter
2357
+ },
2358
+ {
2359
+ value: "right",
2360
+ label: p(a).title.alignRight
2361
+ }
2362
+ ],
2363
+ "model-value": e.block.align,
2364
+ "onUpdate:modelValue": n[4] ||= (e) => g("align", e)
2365
+ }, null, 8, ["options", "model-value"])]),
2366
+ C("div", $a, [
2367
+ C("label", { class: D(p(V)) }, S(p(a).image.linkUrl), 3),
2368
+ m(J, {
2369
+ "model-value": e.block.linkUrl || "",
2370
+ type: "url",
2371
+ placeholder: p(a).image.imageUrlPlaceholder,
2372
+ "onUpdate:modelValue": n[5] ||= (e) => g("linkUrl", e)
2373
+ }, null, 8, ["model-value", "placeholder"]),
2374
+ e.block.linkUrl ? (s(), f("label", eo, [C("input", {
2375
+ type: "checkbox",
2376
+ class: "tpl:size-3.5 tpl:cursor-pointer tpl:accent-[var(--tpl-primary)]",
2377
+ checked: e.block.linkOpenInNewTab ?? !1,
2378
+ onChange: n[6] ||= (e) => g("linkOpenInNewTab", e.target.checked)
2379
+ }, null, 40, to), A(" " + S(p(a).image.openInNewTab), 1)])) : v("", !0)
2380
+ ])
2381
+ ], 64));
2382
+ }
2383
+ }), ro = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, io = { class: "tpl:flex tpl:items-center tpl:gap-2" }, ao = [
2384
+ "value",
2385
+ "placeholder",
2386
+ "onInput"
2387
+ ], oo = ["title", "onClick"], so = { class: "tpl:flex tpl:items-center tpl:gap-3 tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, co = ["checked", "onChange"], lo = { class: "tpl:flex tpl:items-center tpl:gap-2" }, uo = ["value"], fo = { value: "" }, po = ["value"], mo = ["value"], ho = /* @__PURE__ */ l({
2388
+ __name: "MenuToolbar",
2389
+ props: {
2390
+ block: {},
2391
+ fontFamilies: {}
2392
+ },
2393
+ emits: ["update"],
2394
+ setup(e, { emit: t }) {
2395
+ let n = e, r = t, { t: o } = L(), c = T(() => [
2396
+ {
2397
+ key: "openInNewTab",
2398
+ label: o.menu.openInNewTab
2399
+ },
2400
+ {
2401
+ key: "bold",
2402
+ label: o.menu.bold
2403
+ },
2404
+ {
2405
+ key: "underline",
2406
+ label: o.menu.underline
2407
+ }
2408
+ ]), l = T(() => [
2409
+ {
2410
+ value: "left",
2411
+ label: o.title.alignLeft,
2412
+ icon: ot
2413
+ },
2414
+ {
2415
+ value: "center",
2416
+ label: o.title.alignCenter,
2417
+ icon: pt
2418
+ },
2419
+ {
2420
+ value: "right",
2421
+ label: o.title.alignRight,
2422
+ icon: dt
2423
+ }
2424
+ ]);
2425
+ function u(e, t) {
2426
+ r("update", { [e]: t });
2427
+ }
2428
+ function d() {
2429
+ let e = {
2430
+ id: I(),
2431
+ text: "",
2432
+ url: "",
2433
+ openInNewTab: !1,
2434
+ bold: !1,
2435
+ underline: !1
2436
+ };
2437
+ r("update", { items: [...n.block.items, e] });
2438
+ }
2439
+ function h(e, t, i) {
2440
+ r("update", { items: n.block.items.map((n) => n.id === e ? {
2441
+ ...n,
2442
+ [t]: i
2443
+ } : n) });
2444
+ }
2445
+ function g(e) {
2446
+ r("update", { items: n.block.items.filter((t) => t.id !== e) });
2447
+ }
2448
+ return (t, n) => (s(), f(_, null, [
2449
+ m(Q, { label: p(o).menu.items }, {
2450
+ default: a(() => [C("div", ro, [(s(!0), f(_, null, i(e.block.items, (t) => (s(), f("div", {
2451
+ key: t.id,
2452
+ class: "tpl:flex tpl:flex-col tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-2"
2453
+ }, [
2454
+ C("div", io, [C("input", {
2455
+ type: "text",
2456
+ class: D([p(B), "tpl:flex-1"]),
2457
+ value: t.text,
2458
+ placeholder: p(o).menu.text,
2459
+ onInput: (e) => h(t.id, "text", e.target.value)
2460
+ }, null, 42, ao), C("button", {
2461
+ class: D(p(vt)),
2462
+ title: p(o).menu.removeItem,
2463
+ onClick: (e) => g(t.id)
2464
+ }, [m(p(qe), {
2465
+ size: 14,
2466
+ "stroke-width": 2
2467
+ })], 10, oo)]),
2468
+ m(J, {
2469
+ "model-value": t.url,
2470
+ type: "url",
2471
+ placeholder: p(o).menu.urlPlaceholder,
2472
+ "onUpdate:modelValue": (e) => h(t.id, "url", e)
2473
+ }, null, 8, [
2474
+ "model-value",
2475
+ "placeholder",
2476
+ "onUpdate:modelValue"
2477
+ ]),
2478
+ C("div", so, [(s(!0), f(_, null, i(c.value, (e) => (s(), f("label", {
2479
+ key: e.key,
2480
+ class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-1"
2481
+ }, [C("input", {
2482
+ type: "checkbox",
2483
+ checked: t[e.key],
2484
+ class: "tpl:accent-[var(--tpl-primary)]",
2485
+ onChange: (n) => h(t.id, e.key, n.target.checked)
2486
+ }, null, 40, co), A(" " + S(e.label), 1)]))), 128))]),
2487
+ C("div", lo, [C("label", { class: D([p(V), "tpl:!mb-0"]) }, S(p(o).menu.color), 3), m(q, {
2488
+ "swatch-only": "",
2489
+ "model-value": t.color || e.block.linkColor || e.block.color,
2490
+ "onUpdate:modelValue": (e) => h(t.id, "color", e)
2491
+ }, null, 8, ["model-value", "onUpdate:modelValue"])])
2492
+ ]))), 128)), C("button", {
2493
+ class: D(p(yt)),
2494
+ onClick: d
2495
+ }, [m(p(z), {
2496
+ size: 14,
2497
+ "stroke-width": 2
2498
+ }), A(" " + S(p(o).menu.addItem), 1)], 2)])]),
2499
+ _: 1
2500
+ }, 8, ["label"]),
2501
+ m(Q, { label: p(o).menu.fontFamily }, {
2502
+ default: a(() => [C("select", {
2503
+ class: D(p(B)),
2504
+ value: e.block.fontFamily || "",
2505
+ onChange: n[0] ||= (e) => u("fontFamily", e.target.value || void 0)
2506
+ }, [C("option", fo, S(p(o).title.inheritFont), 1), (s(!0), f(_, null, i(e.fontFamilies, (e) => (s(), f("option", {
2507
+ key: e.value,
2508
+ value: e.value
2509
+ }, S(e.label), 9, po))), 128))], 42, uo)]),
2510
+ _: 1
2511
+ }, 8, ["label"]),
2512
+ m(Q, { label: p(o).menu.fontSize }, {
2513
+ default: a(() => [m(Li, {
2514
+ "model-value": e.block.fontSize,
2515
+ min: 8,
2516
+ max: 48,
2517
+ suffix: "px",
2518
+ "onUpdate:modelValue": n[1] ||= (e) => u("fontSize", e)
2519
+ }, null, 8, ["model-value"])]),
2520
+ _: 1
2521
+ }, 8, ["label"]),
2522
+ m(Q, { label: p(o).menu.color }, {
2523
+ default: a(() => [m(q, {
2524
+ "model-value": e.block.color,
2525
+ "onUpdate:modelValue": n[2] ||= (e) => u("color", e)
2526
+ }, null, 8, ["model-value"])]),
2527
+ _: 1
2528
+ }, 8, ["label"]),
2529
+ m(Q, { label: p(o).menu.linkColor }, {
2530
+ default: a(() => [m(q, {
2531
+ "model-value": e.block.linkColor || e.block.color,
2532
+ "onUpdate:modelValue": n[3] ||= (e) => u("linkColor", e || void 0)
2533
+ }, null, 8, ["model-value"])]),
2534
+ _: 1
2535
+ }, 8, ["label"]),
2536
+ m(Q, { label: p(o).menu.textAlign }, {
2537
+ default: a(() => [m(Z, {
2538
+ options: l.value,
2539
+ "model-value": e.block.textAlign,
2540
+ "onUpdate:modelValue": n[4] ||= (e) => u("textAlign", e)
2541
+ }, null, 8, ["options", "model-value"])]),
2542
+ _: 1
2543
+ }, 8, ["label"]),
2544
+ m(Q, { label: p(o).menu.separator }, {
2545
+ default: a(() => [C("input", {
2546
+ type: "text",
2547
+ class: D(p(B)),
2548
+ value: e.block.separator,
2549
+ onInput: n[5] ||= (e) => u("separator", e.target.value)
2550
+ }, null, 42, mo)]),
2551
+ _: 1
2552
+ }, 8, ["label"]),
2553
+ m(Q, { label: p(o).menu.separatorColor }, {
2554
+ default: a(() => [m(q, {
2555
+ "model-value": e.block.separatorColor,
2556
+ "onUpdate:modelValue": n[6] ||= (e) => u("separatorColor", e)
2557
+ }, null, 8, ["model-value"])]),
2558
+ _: 1
2559
+ }, 8, ["label"]),
2560
+ m(Q, { label: p(o).menu.spacing }, {
2561
+ default: a(() => [m(Li, {
2562
+ "model-value": e.block.spacing,
2563
+ min: 0,
2564
+ max: 50,
2565
+ suffix: "px",
2566
+ "onUpdate:modelValue": n[7] ||= (e) => u("spacing", e)
2567
+ }, null, 8, ["model-value"])]),
2568
+ _: 1
2569
+ }, 8, ["label"])
2570
+ ], 64));
2571
+ }
2572
+ }), go = { class: "tpl:mb-3.5" }, _o = ["value"], vo = ["value"], yo = /* @__PURE__ */ l({
2573
+ __name: "SectionToolbar",
2574
+ props: { block: {} },
2575
+ emits: ["update"],
2576
+ setup(e, { emit: t }) {
2577
+ let n = t, { t: r } = L(), a = T(() => [
2578
+ {
2579
+ value: "1",
2580
+ label: r.section.column1
2581
+ },
2582
+ {
2583
+ value: "2",
2584
+ label: r.section.column2
2585
+ },
2586
+ {
2587
+ value: "3",
2588
+ label: r.section.column3
2589
+ },
2590
+ {
2591
+ value: "1-2",
2592
+ label: r.section.ratio12
2593
+ },
2594
+ {
2595
+ value: "2-1",
2596
+ label: r.section.ratio21
2597
+ }
2598
+ ]);
2599
+ return (t, o) => (s(), f("div", go, [C("label", { class: D(p(V)) }, S(p(r).section.columns), 3), C("select", {
2600
+ class: D(p(B)),
2601
+ value: e.block.columns,
2602
+ onChange: o[0] ||= (e) => n("update", { columns: e.target.value })
2603
+ }, [(s(!0), f(_, null, i(a.value, (e) => (s(), f("option", {
2604
+ key: e.value,
2605
+ value: e.value
2606
+ }, S(e.label), 9, vo))), 128))], 42, _o)]));
2607
+ }
2608
+ }), bo = { class: "tpl:mb-3.5" }, xo = { class: "tpl:flex tpl:flex-col tpl:gap-2" }, So = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Co = ["value", "onChange"], wo = ["value"], To = ["title", "onClick"], Eo = { class: "tpl:mb-3.5" }, Do = { class: "tpl:mb-3.5" }, Oo = { class: "tpl:mb-3.5" }, ko = { class: "tpl:flex tpl:items-stretch" }, Ao = ["value"], jo = { class: "tpl:mb-3.5" }, Mo = /* @__PURE__ */ l({
2609
+ __name: "SocialToolbar",
2610
+ props: { block: {} },
2611
+ emits: ["update"],
2612
+ setup(e, { emit: t }) {
2613
+ let n = e, r = t, { t: a } = L();
2614
+ function o(e, t) {
2615
+ r("update", { [e]: t });
2616
+ }
2617
+ function c() {
2618
+ let e = {
2619
+ id: I(),
2620
+ platform: "facebook",
2621
+ url: ""
2622
+ };
2623
+ r("update", { icons: [...n.block.icons, e] });
2624
+ }
2625
+ function l(e, t, i) {
2626
+ r("update", { icons: n.block.icons.map((n) => n.id === e ? {
2627
+ ...n,
2628
+ [t]: i
2629
+ } : n) });
2630
+ }
2631
+ function u(e) {
2632
+ r("update", { icons: n.block.icons.filter((t) => t.id !== e) });
2633
+ }
2634
+ return (t, n) => (s(), f(_, null, [
2635
+ C("div", bo, [C("label", { class: D(p(V)) }, S(p(a).social.icons), 3), C("div", xo, [(s(!0), f(_, null, i(e.block.icons, (e) => (s(), f("div", {
2636
+ key: e.id,
2637
+ class: "tpl:flex tpl:flex-col tpl:gap-1.5 tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:p-2"
2638
+ }, [C("div", So, [C("select", {
2639
+ class: D([p(B), "tpl:flex-1"]),
2640
+ value: e.platform,
2641
+ onChange: (t) => l(e.id, "platform", t.target.value)
2642
+ }, [(s(!0), f(_, null, i(p(P), (e) => (s(), f("option", {
2643
+ key: e,
2644
+ value: e
2645
+ }, S(p(ge)[e].name), 9, wo))), 128))], 42, Co), C("button", {
2646
+ class: D(p(vt)),
2647
+ title: p(a).social.removeIcon,
2648
+ onClick: (t) => u(e.id)
2649
+ }, [m(p(qe), {
2650
+ size: 14,
2651
+ "stroke-width": 2
2652
+ })], 10, To)]), m(J, {
2653
+ "model-value": e.url,
2654
+ type: "url",
2655
+ placeholder: p(a).social.urlPlaceholder,
2656
+ "onUpdate:modelValue": (t) => l(e.id, "url", t)
2657
+ }, null, 8, [
2658
+ "model-value",
2659
+ "placeholder",
2660
+ "onUpdate:modelValue"
2661
+ ])]))), 128)), C("button", {
2662
+ class: D(p(yt)),
2663
+ onClick: c
2664
+ }, [m(p(z), {
2665
+ size: 14,
2666
+ "stroke-width": 2
2667
+ }), A(" " + S(p(a).social.addIcon), 1)], 2)])]),
2668
+ C("div", Eo, [C("label", { class: D(p(V)) }, S(p(a).social.style), 3), m(Z, {
2669
+ options: [
2670
+ {
2671
+ value: "solid",
2672
+ label: p(a).social.styleSolid
2673
+ },
2674
+ {
2675
+ value: "outlined",
2676
+ label: p(a).social.styleOutlined
2677
+ },
2678
+ {
2679
+ value: "rounded",
2680
+ label: p(a).social.styleRounded
2681
+ },
2682
+ {
2683
+ value: "square",
2684
+ label: p(a).social.styleSquare
2685
+ },
2686
+ {
2687
+ value: "circle",
2688
+ label: p(a).social.styleCircle
2689
+ }
2690
+ ],
2691
+ "model-value": e.block.iconStyle,
2692
+ "onUpdate:modelValue": n[0] ||= (e) => o("iconStyle", e)
2693
+ }, null, 8, ["options", "model-value"])]),
2694
+ C("div", Do, [C("label", { class: D(p(V)) }, S(p(a).social.size), 3), m(Z, {
2695
+ options: [
2696
+ {
2697
+ value: "small",
2698
+ label: p(a).social.sizeSmall
2699
+ },
2700
+ {
2701
+ value: "medium",
2702
+ label: p(a).social.sizeMedium
2703
+ },
2704
+ {
2705
+ value: "large",
2706
+ label: p(a).social.sizeLarge
2707
+ }
2708
+ ],
2709
+ "model-value": e.block.iconSize,
2710
+ "onUpdate:modelValue": n[1] ||= (e) => o("iconSize", e)
2711
+ }, null, 8, ["options", "model-value"])]),
2712
+ C("div", Oo, [C("label", { class: D(p(V)) }, S(p(a).social.spacing), 3), C("div", ko, [C("input", {
2713
+ type: "number",
2714
+ class: D(p(U)),
2715
+ value: e.block.spacing,
2716
+ min: "0",
2717
+ max: "50",
2718
+ onInput: n[2] ||= (e) => o("spacing", Number(e.target.value))
2719
+ }, null, 42, Ao), C("span", { class: D(p(H)) }, "px", 2)])]),
2720
+ C("div", jo, [C("label", { class: D(p(V)) }, S(p(a).social.align), 3), m(Z, {
2721
+ options: [
2722
+ {
2723
+ value: "left",
2724
+ label: p(a).title.alignLeft,
2725
+ icon: p(ot)
2726
+ },
2727
+ {
2728
+ value: "center",
2729
+ label: p(a).title.alignCenter,
2730
+ icon: p(pt)
2731
+ },
2732
+ {
2733
+ value: "right",
2734
+ label: p(a).title.alignRight,
2735
+ icon: p(dt)
2736
+ }
2737
+ ],
2738
+ "model-value": e.block.align,
2739
+ "onUpdate:modelValue": n[3] ||= (e) => o("align", e)
2740
+ }, null, 8, ["options", "model-value"])])
2741
+ ], 64));
2742
+ }
2743
+ }), No = { class: "tpl:mb-3.5" }, Po = { class: "tpl:flex tpl:items-stretch" }, Fo = ["value"], Io = ["value"], Lo = /* @__PURE__ */ l({
2744
+ __name: "SpacerToolbar",
2745
+ props: { block: {} },
2746
+ emits: ["update"],
2747
+ setup(e, { emit: t }) {
2748
+ let n = t, { t: r } = L();
2749
+ return (t, i) => (s(), f("div", No, [
2750
+ C("label", { class: D(p(V)) }, S(p(r).spacer.height), 3),
2751
+ C("div", Po, [C("input", {
2752
+ type: "number",
2753
+ class: D(p(U)),
2754
+ value: e.block.height,
2755
+ min: "10",
2756
+ max: "100",
2757
+ onInput: i[0] ||= (e) => n("update", { height: Number(e.target.value) })
2758
+ }, null, 42, Fo), C("span", { class: D(p(H)) }, "px", 2)]),
2759
+ C("input", {
2760
+ type: "range",
2761
+ class: "tpl:mt-2 tpl:w-full tpl:accent-[var(--tpl-primary)]",
2762
+ value: e.block.height,
2763
+ min: "10",
2764
+ max: "100",
2765
+ onInput: i[1] ||= (e) => n("update", { height: Number(e.target.value) })
2766
+ }, null, 40, Io)
2767
+ ]));
2768
+ }
2769
+ }), Ro = { class: "tpl:mb-3.5" }, zo = { class: "tpl:flex tpl:items-center tpl:gap-3" }, Bo = { class: "tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5" }, Vo = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, Ho = { class: "tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, Uo = ["disabled"], Wo = { class: "tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]" }, Go = { class: "tpl:flex tpl:flex-1 tpl:items-center tpl:gap-1.5" }, Ko = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, qo = { class: "tpl:flex tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, Jo = ["disabled"], Yo = { class: "tpl:min-w-[20px] tpl:text-center tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text)]" }, Xo = { class: "tpl:mb-3.5" }, Zo = { class: "tpl:mb-1.5 tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, Qo = ["checked"], $o = {
2770
+ key: 0,
2771
+ class: "tpl:mb-3.5"
2772
+ }, es = { class: "tpl:mb-3.5" }, ts = { class: "tpl:mb-3.5" }, ns = { class: "tpl:flex tpl:items-stretch" }, rs = ["value"], is = { class: "tpl:mb-3.5" }, as = { class: "tpl:flex tpl:items-stretch" }, os = ["value"], ss = { class: "tpl:mb-3.5" }, cs = ["value"], ls = { value: "" }, us = ["value"], ds = { class: "tpl:mb-3.5" }, fs = { class: "tpl:flex tpl:items-stretch" }, ps = ["value"], ms = { class: "tpl:mb-3.5" }, hs = { class: "tpl:mb-3.5" }, gs = /* @__PURE__ */ l({
2773
+ __name: "TableToolbar",
2774
+ props: {
2775
+ block: {},
2776
+ fontFamilies: {}
2777
+ },
2778
+ emits: ["update"],
2779
+ setup(e, { emit: t }) {
2780
+ let n = e, r = t, { t: a } = L(), o = T(() => n.block.rows.length > 0 ? n.block.rows[0].cells.length : 0);
2781
+ function c(e, t) {
2782
+ r("update", { [e]: t });
2783
+ }
2784
+ function l() {
2785
+ let e = n.block.rows.length > 0 ? n.block.rows[0].cells.length : 3, t = {
2786
+ id: I(),
2787
+ cells: Array.from({ length: e }, () => ({
2788
+ id: I(),
2789
+ content: ""
2790
+ }))
2791
+ };
2792
+ r("update", { rows: [...n.block.rows, t] });
2793
+ }
2794
+ function u(e) {
2795
+ r("update", { rows: n.block.rows.filter((t) => t.id !== e) });
2796
+ }
2797
+ function d() {
2798
+ r("update", { rows: n.block.rows.map((e) => ({
2799
+ ...e,
2800
+ cells: [...e.cells, {
2801
+ id: I(),
2802
+ content: ""
2803
+ }]
2804
+ })) });
2805
+ }
2806
+ function h(e) {
2807
+ r("update", { rows: n.block.rows.map((t) => ({
2808
+ ...t,
2809
+ cells: t.cells.filter((t, n) => n !== e)
2810
+ })) });
2811
+ }
2812
+ return (t, n) => (s(), f(_, null, [
2813
+ C("div", Ro, [C("label", { class: D(p(V)) }, S(p(a).table.dimensions), 3), C("div", zo, [C("div", Bo, [C("span", Vo, S(p(a).table.rows), 1), C("div", Ho, [
2814
+ C("button", {
2815
+ class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)] tpl:disabled:opacity-30",
2816
+ disabled: e.block.rows.length <= 1,
2817
+ onClick: n[0] ||= (t) => u(e.block.rows[e.block.rows.length - 1].id)
2818
+ }, [m(p(R), {
2819
+ size: 12,
2820
+ "stroke-width": 2
2821
+ })], 8, Uo),
2822
+ C("span", Wo, S(e.block.rows.length), 1),
2823
+ C("button", {
2824
+ class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)]",
2825
+ onClick: l
2826
+ }, [m(p(z), {
2827
+ size: 12,
2828
+ "stroke-width": 2
2829
+ })])
2830
+ ])]), C("div", Go, [C("span", Ko, S(p(a).table.columns), 1), C("div", qo, [
2831
+ C("button", {
2832
+ class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)] tpl:disabled:opacity-30",
2833
+ disabled: o.value <= 1,
2834
+ onClick: n[1] ||= (e) => h(o.value - 1)
2835
+ }, [m(p(R), {
2836
+ size: 12,
2837
+ "stroke-width": 2
2838
+ })], 8, Jo),
2839
+ C("span", Yo, S(o.value), 1),
2840
+ C("button", {
2841
+ class: "tpl:flex tpl:items-center tpl:justify-center tpl:px-1.5 tpl:py-1 tpl:text-[var(--tpl-text-muted)] tpl:transition-colors tpl:duration-150 tpl:hover:text-[var(--tpl-primary)]",
2842
+ onClick: d
2843
+ }, [m(p(z), {
2844
+ size: 12,
2845
+ "stroke-width": 2
2846
+ })])
2847
+ ])])])]),
2848
+ C("div", Xo, [C("label", Zo, [C("input", {
2849
+ type: "checkbox",
2850
+ checked: e.block.hasHeaderRow,
2851
+ class: "tpl:accent-[var(--tpl-primary)]",
2852
+ onChange: n[2] ||= (e) => c("hasHeaderRow", e.target.checked)
2853
+ }, null, 40, Qo), A(" " + S(p(a).table.hasHeaderRow), 1)])]),
2854
+ e.block.hasHeaderRow ? (s(), f("div", $o, [C("label", { class: D(p(V)) }, S(p(a).table.headerBackgroundColor), 3), m(q, {
2855
+ "model-value": e.block.headerBackgroundColor || p("#f2f2f2"),
2856
+ placeholder: p(a).table.noHeaderBg,
2857
+ "onUpdate:modelValue": n[3] ||= (e) => c("headerBackgroundColor", e || null)
2858
+ }, null, 8, ["model-value", "placeholder"])])) : v("", !0),
2859
+ C("div", es, [C("label", { class: D(p(V)) }, S(p(a).table.borderColor), 3), m(q, {
2860
+ "model-value": e.block.borderColor,
2861
+ "onUpdate:modelValue": n[4] ||= (e) => c("borderColor", e)
2862
+ }, null, 8, ["model-value"])]),
2863
+ C("div", ts, [C("label", { class: D(p(V)) }, S(p(a).table.borderWidth), 3), C("div", ns, [C("input", {
2864
+ type: "number",
2865
+ class: D(p(U)),
2866
+ value: e.block.borderWidth,
2867
+ min: "0",
2868
+ max: "10",
2869
+ onInput: n[5] ||= (e) => c("borderWidth", Number(e.target.value))
2870
+ }, null, 42, rs), C("span", { class: D(p(H)) }, "px", 2)])]),
2871
+ C("div", is, [C("label", { class: D(p(V)) }, S(p(a).table.cellPadding), 3), C("div", as, [C("input", {
2872
+ type: "number",
2873
+ class: D(p(U)),
2874
+ value: e.block.cellPadding,
2875
+ min: "0",
2876
+ max: "30",
2877
+ onInput: n[6] ||= (e) => c("cellPadding", Number(e.target.value))
2878
+ }, null, 42, os), C("span", { class: D(p(H)) }, "px", 2)])]),
2879
+ C("div", ss, [C("label", { class: D(p(V)) }, S(p(a).table.fontFamily), 3), C("select", {
2880
+ class: D(p(B)),
2881
+ value: e.block.fontFamily || "",
2882
+ onChange: n[7] ||= (e) => c("fontFamily", e.target.value || void 0)
2883
+ }, [C("option", ls, S(p(a).title.inheritFont), 1), (s(!0), f(_, null, i(e.fontFamilies, (e) => (s(), f("option", {
2884
+ key: e.value,
2885
+ value: e.value
2886
+ }, S(e.label), 9, us))), 128))], 42, cs)]),
2887
+ C("div", ds, [C("label", { class: D(p(V)) }, S(p(a).table.fontSize), 3), C("div", fs, [C("input", {
2888
+ type: "number",
2889
+ class: D(p(U)),
2890
+ value: e.block.fontSize,
2891
+ min: "10",
2892
+ max: "32",
2893
+ onInput: n[8] ||= (e) => c("fontSize", Number(e.target.value))
2894
+ }, null, 42, ps), C("span", { class: D(p(H)) }, "px", 2)])]),
2895
+ C("div", ms, [C("label", { class: D(p(V)) }, S(p(a).table.color), 3), m(q, {
2896
+ "model-value": e.block.color,
2897
+ "onUpdate:modelValue": n[9] ||= (e) => c("color", e)
2898
+ }, null, 8, ["model-value"])]),
2899
+ C("div", hs, [C("label", { class: D(p(V)) }, S(p(a).table.textAlign), 3), m(Z, {
2900
+ options: [
2901
+ {
2902
+ value: "left",
2903
+ label: p(a).title.alignLeft,
2904
+ icon: p(ot)
2905
+ },
2906
+ {
2907
+ value: "center",
2908
+ label: p(a).title.alignCenter,
2909
+ icon: p(pt)
2910
+ },
2911
+ {
2912
+ value: "right",
2913
+ label: p(a).title.alignRight,
2914
+ icon: p(dt)
2915
+ }
2916
+ ],
2917
+ "model-value": e.block.textAlign,
2918
+ "onUpdate:modelValue": n[10] ||= (e) => c("textAlign", e)
2919
+ }, null, 8, ["options", "model-value"])])
2920
+ ], 64));
2921
+ }
2922
+ }), _s = { class: "tpl:mb-3.5" }, vs = ["value"], ys = { value: 1 }, bs = { value: 2 }, xs = { value: 3 }, Ss = { value: 4 }, Cs = { class: "tpl:mb-3.5" }, ws = ["value"], Ts = { value: "" }, Es = ["value"], Ds = { class: "tpl:mb-3.5" }, Os = { class: "tpl:mb-3.5" }, ks = /* @__PURE__ */ l({
2923
+ __name: "TitleToolbar",
2924
+ props: {
2925
+ block: {},
2926
+ fontFamilies: {}
2927
+ },
2928
+ emits: ["update"],
2929
+ setup(e, { emit: t }) {
2930
+ let n = t, { t: r } = L();
2931
+ function a(e, t) {
2932
+ n("update", { [e]: t });
2933
+ }
2934
+ return (t, n) => (s(), f(_, null, [
2935
+ C("div", _s, [C("label", { class: D(p(V)) }, S(p(r).title.level), 3), C("select", {
2936
+ class: D(p(B)),
2937
+ value: e.block.level,
2938
+ onChange: n[0] ||= (e) => a("level", Number(e.target.value))
2939
+ }, [
2940
+ C("option", ys, S(p(r).title.heading1), 1),
2941
+ C("option", bs, S(p(r).title.heading2), 1),
2942
+ C("option", xs, S(p(r).title.heading3), 1),
2943
+ C("option", Ss, S(p(r).title.heading4), 1)
2944
+ ], 42, vs)]),
2945
+ C("div", Cs, [C("label", { class: D(p(V)) }, S(p(r).title.fontFamily), 3), C("select", {
2946
+ class: D(p(B)),
2947
+ value: e.block.fontFamily || "",
2948
+ onChange: n[1] ||= (e) => a("fontFamily", e.target.value || void 0)
2949
+ }, [C("option", Ts, S(p(r).title.inheritFont), 1), (s(!0), f(_, null, i(e.fontFamilies, (e) => (s(), f("option", {
2950
+ key: e.value,
2951
+ value: e.value
2952
+ }, S(e.label), 9, Es))), 128))], 42, ws)]),
2953
+ C("div", Ds, [C("label", { class: D(p(V)) }, S(p(r).title.color), 3), m(q, {
2954
+ "model-value": e.block.color,
2955
+ "onUpdate:modelValue": n[2] ||= (e) => a("color", e)
2956
+ }, null, 8, ["model-value"])]),
2957
+ C("div", Os, [C("label", { class: D(p(V)) }, S(p(r).title.align), 3), m(Z, {
2958
+ options: [
2959
+ {
2960
+ value: "left",
2961
+ label: p(r).title.alignLeft,
2962
+ icon: p(ot)
2963
+ },
2964
+ {
2965
+ value: "center",
2966
+ label: p(r).title.alignCenter,
2967
+ icon: p(pt)
2968
+ },
2969
+ {
2970
+ value: "right",
2971
+ label: p(r).title.alignRight,
2972
+ icon: p(dt)
2973
+ }
2974
+ ],
2975
+ "model-value": e.block.textAlign,
2976
+ "onUpdate:modelValue": n[3] ||= (e) => a("textAlign", e)
2977
+ }, null, 8, ["options", "model-value"])])
2978
+ ], 64));
2979
+ }
2980
+ }), As = ["aria-label"], js = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3.5" }, Ms = { class: "tpl:flex tpl:items-center tpl:gap-2 tpl:text-[var(--tpl-primary)]" }, Ns = { class: "tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Ps = { class: "tpl:flex tpl:gap-1" }, Fs = ["title"], Is = ["title"], Ls = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, Rs = /* @__PURE__ */ j(/* @__PURE__ */ l({
2981
+ __name: "Toolbar",
2982
+ props: { block: {} },
2983
+ emits: [
2984
+ "update",
2985
+ "delete",
2986
+ "duplicate"
2987
+ ],
2988
+ setup(e, { emit: t }) {
2989
+ let n = e, i = t, { t: a } = L(), o = Te(be, "Toolbar"), l = r(N, []), u = T(() => n.block.type), d = T(() => Oe(n.block)), h = T(() => {
2990
+ if (d.value) return l.find((e) => e.type === n.block.customType);
2991
+ }), g = T(() => d.value ? h.value?.name ?? n.block.customType : M(u.value, a)), b = o.fonts;
2992
+ function x(e) {
2993
+ i("update", e);
2994
+ }
2995
+ return (t, n) => (s(), f("aside", {
2996
+ "aria-label": p(a).landmarks.blockToolbar,
2997
+ class: "tpl:flex tpl:w-full tpl:flex-1 tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)]"
2998
+ }, [C("div", js, [C("div", Ms, [p(_t)[u.value] ? (s(), y(c(p(_t)[u.value]), {
2999
+ key: 0,
3000
+ size: 16,
3001
+ "stroke-width": 1.5
3002
+ })) : d.value ? (s(), y(p(Me), {
3003
+ key: 1,
3004
+ size: 16,
3005
+ "stroke-width": 1.5
3006
+ })) : v("", !0), C("h3", Ns, S(g.value), 1)]), C("div", Ps, [C("button", {
3007
+ class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:bg-[var(--tpl-bg-active)] tpl:hover:text-[var(--tpl-text)]",
3008
+ title: p(a).toolbar.duplicate,
3009
+ onClick: n[0] ||= (e) => i("duplicate")
3010
+ }, [m(p(Xe), {
3011
+ size: 14,
3012
+ "stroke-width": 2
3013
+ })], 8, Fs), C("button", {
3014
+ class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:duration-150 tpl:hover:border-[var(--tpl-danger)] tpl:hover:bg-[var(--tpl-danger-light)] tpl:hover:text-[var(--tpl-danger)]",
3015
+ title: p(a).toolbar.delete,
3016
+ onClick: n[1] ||= (e) => i("delete")
3017
+ }, [m(p(Ge), {
3018
+ size: 14,
3019
+ "stroke-width": 2
3020
+ })], 8, Is)])]), C("div", Ls, [d.value ? (s(), y(Pa, {
3021
+ key: 0,
3022
+ block: e.block,
3023
+ onUpdateFieldValues: n[2] ||= (e) => i("update", { fieldValues: e }),
3024
+ onUpdateDataSourceFetched: n[3] ||= (e) => i("update", { dataSourceFetched: e })
3025
+ }, null, 8, ["block"])) : u.value === "section" ? (s(), y(yo, {
3026
+ key: 1,
3027
+ block: e.block,
3028
+ onUpdate: x
3029
+ }, null, 8, ["block"])) : u.value === "title" ? (s(), y(ks, {
3030
+ key: 2,
3031
+ block: e.block,
3032
+ "font-families": p(b),
3033
+ onUpdate: x
3034
+ }, null, 8, ["block", "font-families"])) : u.value === "paragraph" ? (s(), f(_, { key: 3 }, [], 64)) : u.value === "image" ? (s(), y(no, {
3035
+ key: 4,
3036
+ block: e.block,
3037
+ onUpdate: x
3038
+ }, null, 8, ["block"])) : u.value === "button" ? (s(), y(Lr, {
3039
+ key: 5,
3040
+ block: e.block,
3041
+ "font-families": p(b),
3042
+ onUpdate: x
3043
+ }, null, 8, ["block", "font-families"])) : u.value === "divider" ? (s(), y(Ba, {
3044
+ key: 6,
3045
+ block: e.block,
3046
+ onUpdate: x
3047
+ }, null, 8, ["block"])) : u.value === "social" ? (s(), y(Mo, {
3048
+ key: 7,
3049
+ block: e.block,
3050
+ onUpdate: x
3051
+ }, null, 8, ["block"])) : u.value === "menu" ? (s(), y(ho, {
3052
+ key: 8,
3053
+ block: e.block,
3054
+ "font-families": p(b),
3055
+ onUpdate: x
3056
+ }, null, 8, ["block", "font-families"])) : u.value === "table" ? (s(), y(gs, {
3057
+ key: 9,
3058
+ block: e.block,
3059
+ "font-families": p(b),
3060
+ onUpdate: x
3061
+ }, null, 8, ["block", "font-families"])) : u.value === "spacer" ? (s(), y(Lo, {
3062
+ key: 10,
3063
+ block: e.block,
3064
+ onUpdate: x
3065
+ }, null, 8, ["block"])) : u.value === "html" ? (s(), y(Wa, {
3066
+ key: 11,
3067
+ block: e.block,
3068
+ onUpdate: x
3069
+ }, null, 8, ["block"])) : u.value === "countdown" ? (s(), y(Zi, {
3070
+ key: 12,
3071
+ block: e.block,
3072
+ "font-families": p(b),
3073
+ onUpdate: x
3074
+ }, null, 8, ["block", "font-families"])) : v("", !0), m(Oi, {
3075
+ block: e.block,
3076
+ "is-first-section": u.value === "paragraph",
3077
+ onUpdate: x
3078
+ }, null, 8, ["block", "is-first-section"])])], 8, As));
3079
+ }
3080
+ }), [["__scopeId", "data-v-fb6efed6"]]), zs = ["aria-label"], Bs = {
3081
+ role: "tablist",
3082
+ class: "tpl:relative tpl:flex tpl:border-b tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)]"
3083
+ }, Vs = ["aria-selected"], Hs = ["aria-selected"], Us = {
3084
+ key: 0,
3085
+ id: "tpl-tabpanel-content",
3086
+ role: "tabpanel",
3087
+ "aria-labelledby": "tpl-tab-content",
3088
+ class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
3089
+ }, Ws = {
3090
+ key: 1,
3091
+ class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:px-6 tpl:py-10 tpl:text-center tpl:text-[var(--tpl-text-muted)]"
3092
+ }, Gs = { class: "tpl:mb-4 tpl:text-[var(--tpl-text-dim)]" }, Ks = { class: "tpl:m-0 tpl:mb-2 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]" }, qs = { class: "tpl:m-0 tpl:text-sm tpl:leading-normal" }, Js = {
3093
+ key: 1,
3094
+ id: "tpl-tabpanel-settings",
3095
+ role: "tabpanel",
3096
+ "aria-labelledby": "tpl-tab-settings",
3097
+ class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-y-auto"
3098
+ }, Ys = /* @__PURE__ */ l({
3099
+ __name: "RightSidebar",
3100
+ props: {
3101
+ selectedBlock: {},
3102
+ settings: {},
3103
+ shiftedLeft: { type: Boolean }
3104
+ },
3105
+ emits: [
3106
+ "update-block",
3107
+ "delete-block",
3108
+ "duplicate-block",
3109
+ "update-settings"
3110
+ ],
3111
+ setup(e, { emit: r }) {
3112
+ let i = e, a = r, { t: o } = L(), c = t("content"), l = T(() => c.value === "content" ? "tpl:translate-x-0" : "tpl:translate-x-full");
3113
+ return n(() => i.selectedBlock, (e) => {
3114
+ e && (c.value = "content");
3115
+ }), (t, n) => (s(), f("aside", {
3116
+ "aria-label": p(o).landmarks.rightSidebar,
3117
+ class: D(["tpl-right-sidebar tpl:absolute tpl:top-14 tpl:bottom-0 tpl:z-40 tpl:flex tpl:w-[320px] tpl:flex-col tpl:bg-[var(--tpl-bg-elevated)] tpl:transition-all tpl:duration-200 tpl:border-l tpl:border-[var(--tpl-border)]", e.shiftedLeft ? "tpl:right-[360px]" : "tpl:right-0"])
3118
+ }, [
3119
+ C("div", Bs, [
3120
+ C("div", { class: D(["tpl:absolute tpl:bottom-0 tpl:left-0 tpl:h-full tpl:w-1/2 tpl:p-1.5 tpl:transition-transform tpl:duration-[120ms] tpl:ease-[cubic-bezier(0.16,1,0.3,1)]", l.value]) }, [...n[6] ||= [C("div", { class: "tpl:h-full tpl:w-full tpl:rounded-[var(--tpl-radius-sm)] tpl:bg-[var(--tpl-bg)] tpl:shadow-[var(--tpl-shadow)]" }, null, -1)]], 2),
3121
+ C("button", {
3122
+ id: "tpl-tab-content",
3123
+ role: "tab",
3124
+ "aria-selected": c.value === "content",
3125
+ "aria-controls": "tpl-tabpanel-content",
3126
+ class: D(["tpl:relative tpl:z-10 tpl:flex tpl:flex-1 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:px-4 tpl:py-3 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-[120ms]", c.value === "content" ? "tpl:text-[var(--tpl-primary)]" : "tpl:text-[var(--tpl-text-muted)] hover:tpl:text-[var(--tpl-text)]"]),
3127
+ onClick: n[0] ||= (e) => c.value = "content"
3128
+ }, [m(p(it), {
3129
+ size: 14,
3130
+ "stroke-width": 2
3131
+ }), A(" " + S(p(o).sidebar.content), 1)], 10, Vs),
3132
+ C("button", {
3133
+ id: "tpl-tab-settings",
3134
+ role: "tab",
3135
+ "aria-selected": c.value === "settings",
3136
+ "aria-controls": "tpl-tabpanel-settings",
3137
+ class: D(["tpl:relative tpl:z-10 tpl:flex tpl:flex-1 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:border-none tpl:bg-transparent tpl:px-4 tpl:py-3 tpl:text-xs tpl:font-medium tpl:transition-colors tpl:duration-[120ms]", c.value === "settings" ? "tpl:text-[var(--tpl-primary)]" : "tpl:text-[var(--tpl-text-muted)] hover:tpl:text-[var(--tpl-text)]"]),
3138
+ onClick: n[1] ||= (e) => c.value = "settings"
3139
+ }, [m(p(ht), {
3140
+ size: 14,
3141
+ "stroke-width": 1.5
3142
+ }), A(" " + S(p(o).sidebar.settings), 1)], 10, Hs)
3143
+ ]),
3144
+ c.value === "content" ? (s(), f("div", Us, [e.selectedBlock ? (s(), y(Rs, {
3145
+ key: 0,
3146
+ block: e.selectedBlock,
3147
+ onUpdate: n[2] ||= (e) => a("update-block", e),
3148
+ onDelete: n[3] ||= (e) => a("delete-block"),
3149
+ onDuplicate: n[4] ||= (e) => a("duplicate-block")
3150
+ }, null, 8, ["block"])) : (s(), f("div", Ws, [
3151
+ C("div", Gs, [m(p($e), {
3152
+ size: 40,
3153
+ "stroke-width": 1.5
3154
+ })]),
3155
+ C("h3", Ks, S(p(o).sidebar.noSelection), 1),
3156
+ C("p", qs, S(p(o).sidebar.noSelectionHint), 1)
3157
+ ]))])) : v("", !0),
3158
+ c.value === "settings" ? (s(), f("div", Js, [m(mr, {
3159
+ settings: e.settings,
3160
+ onUpdate: n[5] ||= (e) => a("update-settings", e)
3161
+ }, null, 8, ["settings"])])) : v("", !0)
3162
+ ], 10, zs));
3163
+ }
3164
+ }), Xs = ["aria-label"], Zs = [
3165
+ "aria-checked",
3166
+ "aria-label",
3167
+ "title",
3168
+ "onClick"
3169
+ ], Qs = /* @__PURE__ */ l({
3170
+ __name: "ViewportToggle",
3171
+ props: { viewport: {} },
3172
+ emits: ["change"],
3173
+ setup(e, { emit: t }) {
3174
+ let n = e, r = t, { t: a } = L(), o = T(() => [
3175
+ {
3176
+ value: "desktop",
3177
+ label: a.viewport.desktop
3178
+ },
3179
+ {
3180
+ value: "tablet",
3181
+ label: a.viewport.tablet
3182
+ },
3183
+ {
3184
+ value: "mobile",
3185
+ label: a.viewport.mobile
3186
+ }
3187
+ ]), c = T(() => `translateX(${o.value.findIndex((e) => e.value === n.viewport) * 100}%)`);
3188
+ return (t, n) => (s(), f("div", {
3189
+ role: "radiogroup",
3190
+ "aria-label": p(a).viewport.label,
3191
+ class: "tpl:relative tpl:grid tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",
3192
+ style: g({
3193
+ gridTemplateColumns: `repeat(${o.value.length}, 1fr)`,
3194
+ backgroundColor: "var(--tpl-bg-hover)"
3195
+ })
3196
+ }, [C("div", {
3197
+ class: "tpl:absolute tpl:inset-y-1 tpl:rounded-[var(--tpl-radius-sm)]",
3198
+ style: g({
3199
+ left: "4px",
3200
+ width: `calc((100% - 8px) / ${o.value.length})`,
3201
+ transform: c.value,
3202
+ backgroundColor: "var(--tpl-bg)",
3203
+ boxShadow: "var(--tpl-shadow)",
3204
+ transition: "transform 120ms cubic-bezier(0.16, 1, 0.3, 1)"
3205
+ })
3206
+ }, null, 4), (s(!0), f(_, null, i(o.value, (t) => (s(), f("button", {
3207
+ key: t.value,
3208
+ role: "radio",
3209
+ "aria-checked": e.viewport === t.value,
3210
+ "aria-label": t.label,
3211
+ class: "tpl:relative tpl:z-10 tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium",
3212
+ style: g({
3213
+ color: e.viewport === t.value ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
3214
+ transition: "color 120ms cubic-bezier(0.16, 1, 0.3, 1)"
3215
+ }),
3216
+ title: t.label,
3217
+ onClick: (e) => r("change", t.value)
3218
+ }, [t.value === "desktop" ? (s(), y(p(rt), {
3219
+ key: 0,
3220
+ size: 18,
3221
+ "stroke-width": 1.5
3222
+ })) : t.value === "tablet" ? (s(), y(p(ct), {
3223
+ key: 1,
3224
+ size: 18,
3225
+ "stroke-width": 1.5
3226
+ })) : (s(), y(p(at), {
3227
+ key: 2,
3228
+ size: 18,
3229
+ "stroke-width": 1.5
3230
+ })), C("span", null, S(t.label), 1)], 12, Zs))), 128))], 12, Xs));
3231
+ }
3232
+ }), $s = [
3233
+ "aria-label",
3234
+ "title",
3235
+ "aria-pressed"
3236
+ ], ec = /* @__PURE__ */ j(/* @__PURE__ */ l({
3237
+ __name: "PreviewToggle",
3238
+ props: { previewMode: { type: Boolean } },
3239
+ emits: ["change"],
3240
+ setup(e, { emit: t }) {
3241
+ let n = t, { t: r } = L();
3242
+ return (t, i) => (s(), f("button", {
3243
+ class: "tpl-preview-toggle tpl:relative tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:p-2 tpl:transition-all tpl:duration-150",
3244
+ style: g({
3245
+ color: e.previewMode ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
3246
+ backgroundColor: e.previewMode ? "var(--tpl-primary-light)" : "transparent"
3247
+ }),
3248
+ "aria-label": e.previewMode ? p(r).previewMode.disable : p(r).previewMode.enable,
3249
+ title: e.previewMode ? p(r).previewMode.disable : p(r).previewMode.enable,
3250
+ "aria-pressed": e.previewMode,
3251
+ onClick: i[0] ||= (t) => n("change", !e.previewMode)
3252
+ }, [m(w, {
3253
+ "enter-active-class": "tpl-icon-enter-active",
3254
+ "leave-active-class": "tpl-icon-leave-active",
3255
+ "enter-from-class": "tpl-icon-enter-from",
3256
+ "leave-to-class": "tpl-icon-leave-to",
3257
+ mode: "out-in"
3258
+ }, {
3259
+ default: a(() => [e.previewMode ? (s(), y(p(ke), {
3260
+ key: "eye",
3261
+ size: 18,
3262
+ "stroke-width": 1.5
3263
+ })) : (s(), y(p(Je), {
3264
+ key: "eye-off",
3265
+ size: 18,
3266
+ "stroke-width": 1.5
3267
+ }))]),
3268
+ _: 1
3269
+ })], 12, $s));
3270
+ }
3271
+ }), [["__scopeId", "data-v-af87d02a"]]), tc = [
3272
+ "aria-label",
3273
+ "title",
3274
+ "aria-pressed"
3275
+ ], nc = /* @__PURE__ */ j(/* @__PURE__ */ l({
3276
+ __name: "DarkModeToggle",
3277
+ props: { darkMode: { type: Boolean } },
3278
+ emits: ["change"],
3279
+ setup(e, { emit: t }) {
3280
+ let n = t, { t: r } = L();
3281
+ return (t, i) => (s(), f("button", {
3282
+ class: "tpl-dark-mode-toggle tpl:relative tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:p-2 tpl:transition-all tpl:duration-150",
3283
+ style: g({
3284
+ color: e.darkMode ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
3285
+ backgroundColor: e.darkMode ? "var(--tpl-primary-light)" : "transparent"
3286
+ }),
3287
+ "aria-label": e.darkMode ? p(r).darkMode.disable : p(r).darkMode.enable,
3288
+ title: e.darkMode ? p(r).darkMode.disable : p(r).darkMode.enable,
3289
+ "aria-pressed": e.darkMode,
3290
+ onClick: i[0] ||= (t) => n("change", !e.darkMode)
3291
+ }, [m(w, {
3292
+ "enter-active-class": "tpl-icon-enter-active",
3293
+ "leave-active-class": "tpl-icon-leave-active",
3294
+ "enter-from-class": "tpl-icon-enter-from",
3295
+ "leave-to-class": "tpl-icon-leave-to",
3296
+ mode: "out-in"
3297
+ }, {
3298
+ default: a(() => [e.darkMode ? (s(), y(p(nt), {
3299
+ key: "moon",
3300
+ size: 18,
3301
+ "stroke-width": 1.5
3302
+ })) : (s(), y(p(mt), {
3303
+ key: "sun",
3304
+ size: 18,
3305
+ "stroke-width": 1.5
3306
+ }))]),
3307
+ _: 1
3308
+ })], 12, tc));
3309
+ }
3310
+ }), [["__scopeId", "data-v-f8694f76"]]), rc = {
3311
+ class: "tpl:pointer-events-auto tpl:flex tpl:items-center tpl:gap-1.5 tpl:rounded-tl-lg tpl:p-1",
3312
+ style: {
3313
+ "background-color": "color-mix(\n in srgb,\n var(--tpl-canvas-bg) 85%,\n transparent\n )",
3314
+ "backdrop-filter": "blur(8px)",
3315
+ "-webkit-backdrop-filter": "blur(8px)"
3316
+ }
3317
+ }, ic = {
3318
+ href: "https://github.com/templatical/sdk",
3319
+ target: "_blank",
3320
+ rel: "noopener noreferrer",
3321
+ class: "tpl:transition-colors tpl:duration-150 hover:tpl:opacity-80 tpl:text-[var(--tpl-text-dim)]",
3322
+ style: { "text-decoration": "none" }
3323
+ }, ac = /* @__PURE__ */ l({
3324
+ __name: "EditorFooter",
3325
+ props: { positionClass: {} },
3326
+ setup(e) {
3327
+ let { t } = L();
3328
+ return (n, r) => (s(), f("footer", { class: D(["tpl:pointer-events-none tpl:absolute tpl:bottom-0 tpl:z-50 tpl:flex tpl:h-8 tpl:items-center tpl:justify-end tpl:pr-4 tpl:text-[9px] tpl:opacity-90 tpl:transition-all tpl:duration-300 tpl:text-[var(--tpl-text-dim)]", e.positionClass]) }, [C("div", rc, [
3329
+ C("span", null, S(p(t).footer.poweredBy), 1),
3330
+ r[0] ||= C("a", {
3331
+ href: "https://templatical.com",
3332
+ target: "_blank",
3333
+ rel: "noopener noreferrer",
3334
+ class: "tpl:inline-flex tpl:items-center tpl:gap-1 tpl:font-medium tpl:transition-colors tpl:duration-150 hover:tpl:opacity-80 tpl:text-[var(--tpl-text-muted)]",
3335
+ style: { "text-decoration": "none" }
3336
+ }, [C("img", {
3337
+ width: "14",
3338
+ height: "14",
3339
+ src: "https://templatical.com/logo.svg",
3340
+ alt: ""
3341
+ }), A(" Templatical ")], -1),
3342
+ r[1] ||= C("span", { class: "tpl:text-[var(--tpl-border)]" }, "·", -1),
3343
+ C("a", ic, S(p(t).footer.openSource), 1)
3344
+ ])], 2));
3345
+ }
3346
+ });
3347
+ //#endregion
3348
+ export { Ys as a, Qs as i, nc as n, Wt as o, ec as r, Ft as s, ac as t };
3349
+
3350
+ //# sourceMappingURL=styles-Dgijy53u.js.map