@editora/core 1.0.6 → 1.0.8

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 (60) hide show
  1. package/LICENSE +21 -0
  2. package/dist/{AnchorPlugin.native-C1Rw5m04.mjs → AnchorPlugin.native-BcYGEtd9.mjs} +129 -105
  3. package/dist/ApprovalWorkflowPlugin.native-C3jtAYjG.mjs +1076 -0
  4. package/dist/{BackgroundColorPlugin.native-BE-p9DRd.mjs → BackgroundColorPlugin.native-50iAT9xU.mjs} +119 -122
  5. package/dist/BlocksLibraryPlugin.native-HMWKxWNs.mjs +1327 -0
  6. package/dist/CitationsPlugin.native-BnU0qCwR.mjs +1464 -0
  7. package/dist/CodePlugin.native-DlpTPdkd.mjs +2691 -0
  8. package/dist/{CommentsPlugin.native-tMnWn8a2.mjs → CommentsPlugin.native-DPSqTkiv.mjs} +153 -135
  9. package/dist/ConditionalContentPlugin.native-CfhY46rU.mjs +1367 -0
  10. package/dist/ContentRulesPlugin.native-nBLQ8QFZ.mjs +1099 -0
  11. package/dist/DataBindingPlugin.native-jQ1JPRTp.mjs +917 -0
  12. package/dist/DocSchemaPlugin.native-CHOge18O.mjs +1325 -0
  13. package/dist/{DocumentManagerPlugin.native-BvZL5CSG.mjs → DocumentManagerPlugin.native-C2cs_1w4.mjs} +43 -43
  14. package/dist/{EmbedIframePlugin.native-CSWIB1jm.mjs → EmbedIframePlugin.native-DKJx2OS7.mjs} +61 -58
  15. package/dist/{EmojisPlugin.native-DxTm_DL-.mjs → EmojisPlugin.native-CitxxlWX.mjs} +135 -104
  16. package/dist/{LinkPlugin.native-CS2g-G18.mjs → LinkPlugin.native-DYCIcdTm.mjs} +47 -45
  17. package/dist/{MathPlugin.native-KUxz0o8C.mjs → MathPlugin.native-f_mDp8VL.mjs} +149 -108
  18. package/dist/{MediaManagerPlugin.native-CgP5iInD.mjs → MediaManagerPlugin.native-BiXiK8FC.mjs} +238 -217
  19. package/dist/MentionPlugin.native-BMDlOqur.mjs +734 -0
  20. package/dist/MergeTagPlugin.native-C3eOfEgw.mjs +559 -0
  21. package/dist/PIIRedactionPlugin.native-DcsjmtV1.mjs +1396 -0
  22. package/dist/{PageBreakPlugin.native-CGiQxXqR.mjs → PageBreakPlugin.native-DijGuHJZ.mjs} +86 -77
  23. package/dist/{PreviewPlugin.native-DBvfpmIv.mjs → PreviewPlugin.native-WuIwOAOR.mjs} +30 -30
  24. package/dist/SlashCommandsPlugin.native-CmxvMEaE.mjs +755 -0
  25. package/dist/SmartPastePlugin.native-BOKKtF07.mjs +1398 -0
  26. package/dist/{SpecialCharactersPlugin.native-DANrbExJ.mjs → SpecialCharactersPlugin.native-CZDato89.mjs} +143 -98
  27. package/dist/{SpellCheckPlugin.native-C8bPvRHy.mjs → SpellCheckPlugin.native-BZB9AewP.mjs} +239 -219
  28. package/dist/{TemplatePlugin.native-4lKEm-WY.mjs → TemplatePlugin.native-CrpfKRJ8.mjs} +167 -143
  29. package/dist/{TextColorPlugin.native-Clgtb50j.mjs → TextColorPlugin.native-Bwl_bSmc.mjs} +134 -118
  30. package/dist/TrackChangesPlugin.native-Bghu2q4a.mjs +761 -0
  31. package/dist/TranslationWorkflowPlugin.native-Bz6jDGvj.mjs +1728 -0
  32. package/dist/VersionDiffPlugin.native-Bvxgy--t.mjs +776 -0
  33. package/dist/_commonjsHelpers-DOllISpa.mjs +32 -0
  34. package/dist/anchoredPopover-Bxds0VoB.mjs +110 -0
  35. package/dist/documentManager-vQ1VkbUY.mjs +8418 -0
  36. package/dist/editora.min.js +13 -13
  37. package/dist/editora.umd.js +13 -13
  38. package/dist/html2canvas.esm-AYkPY5LS.mjs +4803 -0
  39. package/dist/index-BslAFzmv.mjs +16544 -0
  40. package/dist/index-D1LOqg5C.js +10 -0
  41. package/dist/{index-OwnkG39N.mjs → index-DqC57IEH.mjs} +438 -328
  42. package/dist/index.cjs.js +1 -1
  43. package/dist/{index.es-CuicffkQ.mjs → index.es-BYD2KEo6.mjs} +5 -4
  44. package/dist/index.esm.js +2 -2
  45. package/dist/jspdf.es.min-BJGtOnRT.mjs +7890 -0
  46. package/dist/plugin-loader.js +77 -40
  47. package/dist/webcomponent-core.js +456 -346
  48. package/dist/webcomponent-core.min.css +1 -1
  49. package/dist/webcomponent-core.min.js +87 -107
  50. package/dist/webcomponent.cjs.js +1 -1
  51. package/dist/webcomponent.esm.js +1 -1
  52. package/dist/webcomponent.js +503 -356
  53. package/dist/webcomponent.min.css +1 -1
  54. package/dist/webcomponent.min.js +6003 -658
  55. package/package.json +2 -2
  56. package/dist/CodePlugin.native-B263UI8O.mjs +0 -2173
  57. package/dist/MergeTagPlugin.native-DIGWhdnF.mjs +0 -419
  58. package/dist/colorSelectionApply-CK1My9N2.mjs +0 -67
  59. package/dist/documentManager-irzj9n3V.mjs +0 -37627
  60. package/dist/index-CqWQFb3D.js +0 -10
@@ -0,0 +1,1367 @@
1
+ const A = ".rte-content, .editora-content", P = '.rte-conditional-block[data-conditional-content="true"]', b = ':is([data-theme="dark"], .dark, .editora-theme-dark, .rte-theme-dark)', f = ':is([data-theme="acme"], .editora-theme-acme, .rte-theme-acme)', h = ":is(.rte-content.rte-conditional-theme-dark, .editora-content.rte-conditional-theme-dark)", g = ":is(.rte-content.rte-conditional-theme-acme, .editora-content.rte-conditional-theme-acme)", Se = "rte-conditional-content-styles", c = "rte-conditional-dialog-overlay", u = "rte-conditional-floating-toolbar", k = /* @__PURE__ */ new WeakMap(), Ce = /* @__PURE__ */ new WeakMap(), E = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map();
2
+ let de = null, me = 0, J = null, X = null, Q = null, ee = null, te = null, oe = null, H = null, y = null, ne = null;
3
+ const ze = {
4
+ dialogTitleInsert: "Insert Conditional Content",
5
+ dialogTitleEdit: "Edit Conditional Content",
6
+ conditionLabel: "Condition",
7
+ conditionPlaceholder: 'user.role == "admin"',
8
+ audienceLabel: "Audience (comma separated)",
9
+ audiencePlaceholder: "all",
10
+ localeLabel: "Locale (comma separated)",
11
+ localePlaceholder: "all",
12
+ elseLabel: "Enable Else Block",
13
+ saveText: "Save",
14
+ cancelText: "Cancel",
15
+ blockIfLabel: "IF",
16
+ blockElseLabel: "ELSE",
17
+ allAudiencesText: "all audiences",
18
+ allLocalesText: "all locales"
19
+ };
20
+ function $(e) {
21
+ return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
22
+ }
23
+ function R(e) {
24
+ return e ? e.split(",").map((t) => t.trim()).filter(Boolean) : [];
25
+ }
26
+ function Te(e) {
27
+ return !e || e.length === 0 ? "" : e.join(", ");
28
+ }
29
+ function ie(e) {
30
+ return e ? e.map((t) => t.trim()).filter(Boolean) : [];
31
+ }
32
+ function Fe(e) {
33
+ return {
34
+ ...ze,
35
+ ...e || {}
36
+ };
37
+ }
38
+ function D(e) {
39
+ return e.getAttribute("contenteditable") === "false" || e.getAttribute("data-readonly") === "true";
40
+ }
41
+ function se(e) {
42
+ return e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") || e;
43
+ }
44
+ function pe(e) {
45
+ if (!e) return !1;
46
+ const t = e.getAttribute("data-theme") || e.getAttribute("theme");
47
+ return t && t.toLowerCase() === "dark" ? !0 : e.classList.contains("dark") || e.classList.contains("editora-theme-dark") || e.classList.contains("rte-theme-dark");
48
+ }
49
+ function je(e) {
50
+ const t = se(e);
51
+ if (pe(t)) return !0;
52
+ const o = t.closest("[data-theme], [theme], .dark, .editora-theme-dark, .rte-theme-dark");
53
+ return pe(o) ? !0 : pe(document.documentElement) || pe(document.body);
54
+ }
55
+ function he(e) {
56
+ if (!e) return !1;
57
+ const t = e.getAttribute("data-theme") || e.getAttribute("theme");
58
+ return t && t.toLowerCase() === "acme" ? !0 : e.classList.contains("editora-theme-acme") || e.classList.contains("rte-theme-acme");
59
+ }
60
+ function Ie(e) {
61
+ const t = se(e);
62
+ if (he(t)) return !0;
63
+ const o = t.closest("[data-theme], [theme], .editora-theme-acme, .rte-theme-acme");
64
+ return he(o) ? !0 : he(document.documentElement) || he(document.body);
65
+ }
66
+ function Ve(e) {
67
+ return je(e) ? "dark" : Ie(e) ? "acme" : "light";
68
+ }
69
+ function xe(e, t) {
70
+ const o = Ve(t);
71
+ e.classList.remove("rte-conditional-theme-dark", "rte-conditional-theme-acme"), o === "dark" ? e.classList.add("rte-conditional-theme-dark") : o === "acme" && e.classList.add("rte-conditional-theme-acme");
72
+ }
73
+ function w(e, t = !0) {
74
+ if ((e == null ? void 0 : e.contentElement) instanceof HTMLElement) return e.contentElement;
75
+ if ((e == null ? void 0 : e.editorElement) instanceof HTMLElement) {
76
+ const n = e.editorElement;
77
+ if (n.matches(A)) return n;
78
+ const a = n.querySelector(A);
79
+ if (a instanceof HTMLElement) return a;
80
+ }
81
+ const o = window.getSelection();
82
+ if (o && o.rangeCount > 0) {
83
+ const n = o.getRangeAt(0).startContainer, a = n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement, r = a == null ? void 0 : a.closest(A);
84
+ if (r) return r;
85
+ }
86
+ const i = document.activeElement;
87
+ if (i) {
88
+ if (i.matches(A)) return i;
89
+ const n = i.closest(A);
90
+ if (n) return n;
91
+ }
92
+ return y && y.isConnected ? y : t ? document.querySelector(A) : null;
93
+ }
94
+ function Ne(e) {
95
+ const t = window.getSelection();
96
+ if (!t || t.rangeCount === 0) return null;
97
+ const o = t.getRangeAt(0);
98
+ return e.contains(o.commonAncestorContainer) ? o.cloneRange() : null;
99
+ }
100
+ function Le(e, t) {
101
+ const o = window.getSelection();
102
+ o && (o.removeAllRanges(), o.addRange(t), e.focus({ preventScroll: !0 }));
103
+ }
104
+ function De(e) {
105
+ e.dispatchEvent(new Event("input", { bubbles: !0 }));
106
+ }
107
+ function He(e, t) {
108
+ if (t === e.innerHTML) return;
109
+ const o = window.execEditorCommand || window.executeEditorCommand;
110
+ if (typeof o == "function")
111
+ try {
112
+ o("recordDomTransaction", e, t, e.innerHTML);
113
+ } catch (i) {
114
+ }
115
+ }
116
+ function $e(e, t) {
117
+ const o = document.createRange();
118
+ o.selectNodeContents(t), o.collapse(!1), Le(e, o);
119
+ }
120
+ function ve(e, t) {
121
+ if (t)
122
+ return t.split(".").filter(Boolean).reduce((o, i) => {
123
+ if (o != null && typeof o == "object")
124
+ return o[i];
125
+ }, e);
126
+ }
127
+ function We(e) {
128
+ const t = e.trim();
129
+ if (t.startsWith('"') && t.endsWith('"') || t.startsWith("'") && t.endsWith("'"))
130
+ return t.slice(1, -1);
131
+ if (t === "true") return !0;
132
+ if (t === "false") return !1;
133
+ if (t === "null") return null;
134
+ const o = Number(t);
135
+ if (!Number.isNaN(o) && t !== "") return o;
136
+ if (t.startsWith("[") && t.endsWith("]") || t.startsWith("{") && t.endsWith("}"))
137
+ try {
138
+ return JSON.parse(t);
139
+ } catch (i) {
140
+ return t;
141
+ }
142
+ return t;
143
+ }
144
+ function Ze(e, t) {
145
+ const o = e.trim();
146
+ if (!o) return !0;
147
+ if (o.startsWith("!")) {
148
+ const x = o.slice(1).trim();
149
+ return !ve(t, x);
150
+ }
151
+ const i = o.match(/^([a-zA-Z_$][\w.$]*)\s*(==|!=|>=|<=|>|<|in|contains|~=)\s*(.+)$/);
152
+ if (!i)
153
+ return !!ve(t, o);
154
+ const [, n, a, r] = i, l = ve(t, n), d = We(r);
155
+ switch (a) {
156
+ case "==":
157
+ return l == d;
158
+ case "!=":
159
+ return l != d;
160
+ case ">":
161
+ return Number(l) > Number(d);
162
+ case "<":
163
+ return Number(l) < Number(d);
164
+ case ">=":
165
+ return Number(l) >= Number(d);
166
+ case "<=":
167
+ return Number(l) <= Number(d);
168
+ case "in":
169
+ return Array.isArray(d) ? d.some((x) => x == l) : typeof d == "string" ? d.split(",").map((x) => x.trim()).includes(String(l)) : !1;
170
+ case "contains":
171
+ case "~=":
172
+ return Array.isArray(l) ? l.some((x) => String(x).toLowerCase() === String(d).toLowerCase()) : typeof l == "string" ? l.toLowerCase().includes(String(d).toLowerCase()) : !1;
173
+ default:
174
+ return !1;
175
+ }
176
+ }
177
+ function Ge() {
178
+ if (typeof document == "undefined" || document.getElementById(Se)) return;
179
+ const e = document.createElement("style");
180
+ e.id = Se, e.textContent = `
181
+ .rte-conditional-block {
182
+ border: 1px solid #dbe3ec;
183
+ border-radius: 8px;
184
+ margin: 10px 0;
185
+ background: #f8fafc;
186
+ overflow: hidden;
187
+ }
188
+
189
+ .rte-conditional-header,
190
+ .rte-conditional-else-label {
191
+ display: flex;
192
+ align-items: center;
193
+ gap: 8px;
194
+ background: #eef2f7;
195
+ border-bottom: 1px solid #dbe3ec;
196
+ padding: 8px 10px;
197
+ user-select: none;
198
+ }
199
+
200
+ .rte-conditional-else-label {
201
+ border-top: 1px solid #dbe3ec;
202
+ border-bottom: 1px solid #dbe3ec;
203
+ }
204
+
205
+ .rte-conditional-chip {
206
+ display: inline-flex;
207
+ align-items: center;
208
+ justify-content: center;
209
+ min-width: 34px;
210
+ height: 20px;
211
+ border-radius: 999px;
212
+ border: 1px solid #bfdbfe;
213
+ background: #dbeafe;
214
+ color: #1e3a8a;
215
+ font-size: 11px;
216
+ font-weight: 700;
217
+ letter-spacing: 0.03em;
218
+ text-transform: uppercase;
219
+ padding: 0 7px;
220
+ flex: 0 0 auto;
221
+ }
222
+
223
+ .rte-conditional-chip-else {
224
+ border-color: #fecaca;
225
+ background: #fee2e2;
226
+ color: #991b1b;
227
+ }
228
+
229
+ .rte-conditional-summary {
230
+ font-size: 12px;
231
+ color: #0f172a;
232
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
233
+ overflow: hidden;
234
+ text-overflow: ellipsis;
235
+ white-space: nowrap;
236
+ flex: 1;
237
+ }
238
+
239
+ .rte-conditional-meta {
240
+ font-size: 11px;
241
+ color: #64748b;
242
+ white-space: nowrap;
243
+ flex: 0 0 auto;
244
+ }
245
+
246
+ .rte-conditional-body {
247
+ padding: 10px;
248
+ background: #ffffff;
249
+ min-height: 44px;
250
+ }
251
+
252
+ .rte-conditional-hidden {
253
+ display: none !important;
254
+ }
255
+
256
+ .rte-toolbar-group-items.conditional-content,
257
+ .editora-toolbar-group-items.conditional-content {
258
+ display: flex;
259
+ border: 1px solid #cbd5e1;
260
+ border-radius: 6px;
261
+ background: #ffffff;
262
+ }
263
+
264
+ .rte-toolbar-group-items.conditional-content .rte-toolbar-item,
265
+ .editora-toolbar-group-items.conditional-content .editora-toolbar-item {
266
+ display: flex;
267
+ }
268
+
269
+ .rte-toolbar-group-items.conditional-content .rte-toolbar-button,
270
+ .editora-toolbar-group-items.conditional-content .editora-toolbar-button {
271
+ border: none;
272
+ border-right: 1px solid #cbd5e1;
273
+ border-radius: 0;
274
+ }
275
+
276
+ .rte-toolbar-group-items.conditional-content .rte-toolbar-item:last-child .rte-toolbar-button,
277
+ .editora-toolbar-group-items.conditional-content .editora-toolbar-item:last-child .editora-toolbar-button {
278
+ border-right: none;
279
+ }
280
+
281
+ .rte-toolbar-button[data-command="toggleConditionalPreview"].active,
282
+ .editora-toolbar-button[data-command="toggleConditionalPreview"].active {
283
+ background: #ccc;
284
+ }
285
+
286
+ .rte-conditional-block.rte-conditional-preview {
287
+ border-style: dashed;
288
+ }
289
+
290
+ .rte-conditional-block.rte-conditional-preview .rte-conditional-body[contenteditable="false"] {
291
+ cursor: default;
292
+ }
293
+
294
+ .${c} {
295
+ position: fixed;
296
+ inset: 0;
297
+ background: rgba(15, 23, 42, 0.5);
298
+ z-index: 2147483646;
299
+ display: flex;
300
+ align-items: center;
301
+ justify-content: center;
302
+ padding: 20px;
303
+ }
304
+
305
+ .rte-conditional-dialog {
306
+ width: min(560px, 96vw);
307
+ max-height: min(88vh, 760px);
308
+ border: 1px solid #dbe3ec;
309
+ border-radius: 8px;
310
+ background: #ffffff;
311
+ box-shadow: 0 24px 50px rgba(15, 23, 42, 0.25);
312
+ display: flex;
313
+ flex-direction: column;
314
+ overflow: hidden;
315
+ }
316
+
317
+ .rte-conditional-dialog-header,
318
+ .rte-conditional-dialog-footer {
319
+ padding: 12px 14px;
320
+ border-bottom: 1px solid #e2e8f0;
321
+ background: #f8fafc;
322
+ display: flex;
323
+ align-items: center;
324
+ justify-content: space-between;
325
+ gap: 10px;
326
+ }
327
+
328
+ .rte-conditional-dialog-footer {
329
+ border-top: 1px solid #e2e8f0;
330
+ border-bottom: none;
331
+ justify-content: flex-end;
332
+ }
333
+
334
+ .rte-conditional-dialog-title {
335
+ margin: 0;
336
+ font-size: 16px;
337
+ font-weight: 700;
338
+ color: #0f172a;
339
+ }
340
+
341
+ .rte-conditional-dialog-body {
342
+ padding: 14px;
343
+ overflow: auto;
344
+ display: grid;
345
+ grid-template-columns: 1fr;
346
+ gap: 12px;
347
+ }
348
+
349
+ .rte-conditional-field {
350
+ display: grid;
351
+ gap: 6px;
352
+ }
353
+
354
+ .rte-conditional-field label {
355
+ font-size: 12px;
356
+ font-weight: 600;
357
+ color: #334155;
358
+ }
359
+
360
+ .rte-conditional-field input[type="text"] {
361
+ width: 100%;
362
+ min-height: 36px;
363
+ border: 1px solid #cbd5e1;
364
+ border-radius: 6px;
365
+ padding: 8px 10px;
366
+ font-size: 13px;
367
+ line-height: 1.4;
368
+ box-sizing: border-box;
369
+ color: #0f172a;
370
+ background: #ffffff;
371
+ }
372
+
373
+ .rte-conditional-field input[type="text"]:focus-visible,
374
+ .rte-conditional-btn:focus-visible {
375
+ outline: none;
376
+ border-color: #3b82f6;
377
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
378
+ }
379
+
380
+ .rte-conditional-checkbox {
381
+ display: inline-flex;
382
+ align-items: center;
383
+ gap: 8px;
384
+ font-size: 13px;
385
+ color: #334155;
386
+ min-height: 36px;
387
+ }
388
+
389
+ .rte-conditional-help {
390
+ margin: 0;
391
+ font-size: 12px;
392
+ color: #64748b;
393
+ }
394
+
395
+ .rte-conditional-btn {
396
+ border: 1px solid #cbd5e1;
397
+ border-radius: 6px;
398
+ min-height: 34px;
399
+ padding: 6px 12px;
400
+ background: #ffffff;
401
+ color: #0f172a;
402
+ font-size: 13px;
403
+ cursor: pointer;
404
+ }
405
+
406
+ .rte-conditional-btn-primary {
407
+ border-color: #2563eb;
408
+ background: #2563eb;
409
+ color: #ffffff;
410
+ }
411
+
412
+ .rte-conditional-btn-primary:hover {
413
+ background: #1d4ed8;
414
+ }
415
+
416
+ .${u} {
417
+ position: fixed;
418
+ z-index: 2147483645;
419
+ display: none;
420
+ align-items: center;
421
+ gap: 6px;
422
+ padding: 6px;
423
+ border-radius: 8px;
424
+ border: 1px solid #cbd5e1;
425
+ background: rgba(255, 255, 255, 0.98);
426
+ box-shadow: 0 14px 30px rgba(15, 23, 42, 0.2);
427
+ backdrop-filter: blur(6px);
428
+ }
429
+
430
+ .${u}.show {
431
+ display: inline-flex;
432
+ }
433
+
434
+ .${u} .rte-conditional-float-btn {
435
+ border: 1px solid #cbd5e1;
436
+ border-radius: 6px;
437
+ min-height: 30px;
438
+ min-width: 30px;
439
+ padding: 0 8px;
440
+ display: inline-flex;
441
+ align-items: center;
442
+ justify-content: center;
443
+ gap: 6px;
444
+ background: #ffffff;
445
+ color: #0f172a;
446
+ cursor: pointer;
447
+ font-size: 12px;
448
+ line-height: 1;
449
+ }
450
+
451
+ .${u} .rte-conditional-float-btn:hover {
452
+ background: #f8fafc;
453
+ }
454
+
455
+ .${u} .rte-conditional-float-btn[data-action="delete"] {
456
+ border-color: #fecaca;
457
+ color: #991b1b;
458
+ background: #fff5f5;
459
+ }
460
+
461
+ .rte-conditional-preview-on ${P} {
462
+ border-width: 2px;
463
+ }
464
+
465
+ .rte-conditional-preview-on ${P} .rte-conditional-header {
466
+ background: #ecfeff;
467
+ border-color: #bae6fd;
468
+ }
469
+
470
+ ${b} .rte-conditional-block,
471
+ ${h} .rte-conditional-block,
472
+ .${c}.rte-conditional-theme-dark .rte-conditional-block {
473
+ background: #111827;
474
+ border-color: #334155;
475
+ }
476
+
477
+ ${b} .rte-conditional-header,
478
+ ${b} .rte-conditional-else-label,
479
+ ${h} .rte-conditional-header,
480
+ ${h} .rte-conditional-else-label,
481
+ .${c}.rte-conditional-theme-dark .rte-conditional-header,
482
+ .${c}.rte-conditional-theme-dark .rte-conditional-else-label {
483
+ background: #0f172a;
484
+ border-color: #334155;
485
+ }
486
+
487
+ ${b} .rte-conditional-summary,
488
+ ${h} .rte-conditional-summary,
489
+ .${c}.rte-conditional-theme-dark .rte-conditional-summary {
490
+ color: #e2e8f0;
491
+ }
492
+
493
+ ${b} .rte-conditional-meta,
494
+ ${h} .rte-conditional-meta,
495
+ .${c}.rte-conditional-theme-dark .rte-conditional-meta {
496
+ color: #94a3b8;
497
+ }
498
+
499
+ ${b} .rte-conditional-chip,
500
+ ${h} .rte-conditional-chip,
501
+ .${c}.rte-conditional-theme-dark .rte-conditional-chip {
502
+ background: #1e3a8a;
503
+ border-color: #3b82f6;
504
+ color: #dbeafe;
505
+ }
506
+
507
+ ${b} .rte-conditional-chip-else,
508
+ ${h} .rte-conditional-chip-else,
509
+ .${c}.rte-conditional-theme-dark .rte-conditional-chip-else {
510
+ background: #7f1d1d;
511
+ border-color: #ef4444;
512
+ color: #fee2e2;
513
+ }
514
+
515
+ ${b} .rte-conditional-body,
516
+ ${h} .rte-conditional-body,
517
+ .${c}.rte-conditional-theme-dark .rte-conditional-body {
518
+ background: #1f2937;
519
+ color: #e2e8f0;
520
+ }
521
+
522
+ ${b} .rte-conditional-dialog,
523
+ ${h} .rte-conditional-dialog,
524
+ .${c}.rte-conditional-theme-dark .rte-conditional-dialog {
525
+ background: #1f2937;
526
+ border-color: #334155;
527
+ }
528
+
529
+ ${b} .rte-conditional-dialog-header,
530
+ ${b} .rte-conditional-dialog-footer,
531
+ ${h} .rte-conditional-dialog-header,
532
+ ${h} .rte-conditional-dialog-footer,
533
+ .${c}.rte-conditional-theme-dark .rte-conditional-dialog-header,
534
+ .${c}.rte-conditional-theme-dark .rte-conditional-dialog-footer {
535
+ background: #111827;
536
+ border-color: #334155;
537
+ }
538
+
539
+ ${b} .rte-conditional-dialog-title,
540
+ ${b} .rte-conditional-field label,
541
+ ${b} .rte-conditional-checkbox,
542
+ ${h} .rte-conditional-dialog-title,
543
+ ${h} .rte-conditional-field label,
544
+ ${h} .rte-conditional-checkbox,
545
+ .${c}.rte-conditional-theme-dark .rte-conditional-dialog-title,
546
+ .${c}.rte-conditional-theme-dark .rte-conditional-field label,
547
+ .${c}.rte-conditional-theme-dark .rte-conditional-checkbox {
548
+ color: #e2e8f0;
549
+ }
550
+
551
+ ${b} .rte-conditional-help,
552
+ ${h} .rte-conditional-help,
553
+ .${c}.rte-conditional-theme-dark .rte-conditional-help {
554
+ color: #94a3b8;
555
+ }
556
+
557
+ ${b} .rte-conditional-field input[type="text"],
558
+ ${b} .rte-conditional-btn,
559
+ ${h} .rte-conditional-field input[type="text"],
560
+ ${h} .rte-conditional-btn,
561
+ .${c}.rte-conditional-theme-dark .rte-conditional-field input[type="text"],
562
+ .${c}.rte-conditional-theme-dark .rte-conditional-btn {
563
+ background: #0f172a;
564
+ border-color: #475569;
565
+ color: #e2e8f0;
566
+ }
567
+
568
+ ${b} .rte-conditional-btn-primary,
569
+ ${h} .rte-conditional-btn-primary,
570
+ .${c}.rte-conditional-theme-dark .rte-conditional-btn-primary {
571
+ border-color: #3b82f6;
572
+ background: #2563eb;
573
+ color: #ffffff;
574
+ }
575
+
576
+ ${b} .rte-toolbar-group-items.conditional-content,
577
+ .${c}.rte-conditional-theme-dark .rte-toolbar-group-items.conditional-content,
578
+ ${h} .rte-toolbar-group-items.conditional-content,
579
+ ${b} .editora-toolbar-group-items.conditional-content {
580
+ border-color: #566275;
581
+ }
582
+
583
+ ${b} .rte-toolbar-group-items.conditional-content .rte-toolbar-button,
584
+ ${h} .rte-toolbar-group-items.conditional-content .rte-toolbar-button,
585
+ ${b} .editora-toolbar-group-items.conditional-content .editora-toolbar-button {
586
+ border-right-color: #566275;
587
+ }
588
+
589
+ ${b} .${u},
590
+ .${c}.rte-conditional-theme-dark .${u},
591
+ .${u}.rte-conditional-theme-dark {
592
+ background: rgba(17, 24, 39, 0.98);
593
+ border-color: #334155;
594
+ box-shadow: 0 14px 30px rgba(2, 6, 23, 0.5);
595
+ }
596
+
597
+ ${b} .${u} .rte-conditional-float-btn,
598
+ .${c}.rte-conditional-theme-dark .${u} .rte-conditional-float-btn,
599
+ .${u}.rte-conditional-theme-dark .rte-conditional-float-btn {
600
+ background: #0f172a;
601
+ border-color: #475569;
602
+ color: #e2e8f0;
603
+ }
604
+
605
+ ${b} .${u} .rte-conditional-float-btn[data-action="delete"],
606
+ .${c}.rte-conditional-theme-dark .${u} .rte-conditional-float-btn[data-action="delete"],
607
+ .${u}.rte-conditional-theme-dark .rte-conditional-float-btn[data-action="delete"] {
608
+ border-color: #ef4444;
609
+ color: #fecaca;
610
+ background: rgba(127, 29, 29, 0.45);
611
+ }
612
+
613
+ ${f} .rte-conditional-block,
614
+ ${g} .rte-conditional-block,
615
+ .${c}.rte-conditional-theme-acme .rte-conditional-block {
616
+ background: #f8fbff;
617
+ border-color: #cbd8e8;
618
+ }
619
+
620
+ ${f} .rte-conditional-header,
621
+ ${f} .rte-conditional-else-label,
622
+ ${g} .rte-conditional-header,
623
+ ${g} .rte-conditional-else-label,
624
+ .${c}.rte-conditional-theme-acme .rte-conditional-header,
625
+ .${c}.rte-conditional-theme-acme .rte-conditional-else-label {
626
+ background: linear-gradient(180deg, #eef4fb 0%, #e6eef8 100%);
627
+ border-color: #cbd8e8;
628
+ }
629
+
630
+ ${f} .rte-conditional-summary,
631
+ ${g} .rte-conditional-summary,
632
+ .${c}.rte-conditional-theme-acme .rte-conditional-summary {
633
+ color: #0f172a;
634
+ }
635
+
636
+ ${f} .rte-conditional-meta,
637
+ ${g} .rte-conditional-meta,
638
+ .${c}.rte-conditional-theme-acme .rte-conditional-meta {
639
+ color: #587089;
640
+ }
641
+
642
+ ${f} .rte-conditional-chip,
643
+ ${g} .rte-conditional-chip,
644
+ .${c}.rte-conditional-theme-acme .rte-conditional-chip {
645
+ background: #d9f5ee;
646
+ border-color: #66c6b3;
647
+ color: #0f4f4a;
648
+ }
649
+
650
+ ${f} .rte-conditional-chip-else,
651
+ ${g} .rte-conditional-chip-else,
652
+ .${c}.rte-conditional-theme-acme .rte-conditional-chip-else {
653
+ background: #fde8ea;
654
+ border-color: #f1a7b2;
655
+ color: #8b1f2f;
656
+ }
657
+
658
+ ${f} .rte-conditional-body,
659
+ ${g} .rte-conditional-body,
660
+ .${c}.rte-conditional-theme-acme .rte-conditional-body {
661
+ background: #fcfeff;
662
+ color: #0f172a;
663
+ }
664
+
665
+ ${f} .rte-conditional-dialog,
666
+ ${g} .rte-conditional-dialog,
667
+ .${c}.rte-conditional-theme-acme .rte-conditional-dialog {
668
+ background: #ffffff;
669
+ border-color: #cbd8e8;
670
+ box-shadow: 0 20px 44px rgba(15, 23, 42, 0.18);
671
+ }
672
+
673
+ ${f} .rte-conditional-dialog-header,
674
+ ${f} .rte-conditional-dialog-footer,
675
+ ${g} .rte-conditional-dialog-header,
676
+ ${g} .rte-conditional-dialog-footer,
677
+ .${c}.rte-conditional-theme-acme .rte-conditional-dialog-header,
678
+ .${c}.rte-conditional-theme-acme .rte-conditional-dialog-footer {
679
+ background: #f3f8fd;
680
+ border-color: #d8e4f1;
681
+ }
682
+
683
+ ${f} .rte-conditional-dialog-title,
684
+ ${f} .rte-conditional-field label,
685
+ ${f} .rte-conditional-checkbox,
686
+ ${g} .rte-conditional-dialog-title,
687
+ ${g} .rte-conditional-field label,
688
+ ${g} .rte-conditional-checkbox,
689
+ .${c}.rte-conditional-theme-acme .rte-conditional-dialog-title,
690
+ .${c}.rte-conditional-theme-acme .rte-conditional-field label,
691
+ .${c}.rte-conditional-theme-acme .rte-conditional-checkbox {
692
+ color: #1f334a;
693
+ }
694
+
695
+ ${f} .rte-conditional-help,
696
+ ${g} .rte-conditional-help,
697
+ .${c}.rte-conditional-theme-acme .rte-conditional-help {
698
+ color: #5f738d;
699
+ }
700
+
701
+ ${f} .rte-conditional-field input[type="text"],
702
+ ${f} .rte-conditional-btn,
703
+ ${g} .rte-conditional-field input[type="text"],
704
+ ${g} .rte-conditional-btn,
705
+ .${c}.rte-conditional-theme-acme .rte-conditional-field input[type="text"],
706
+ .${c}.rte-conditional-theme-acme .rte-conditional-btn {
707
+ background: #ffffff;
708
+ border-color: #bfd0e2;
709
+ color: #0f172a;
710
+ }
711
+
712
+ ${f} .rte-conditional-btn-primary,
713
+ ${g} .rte-conditional-btn-primary,
714
+ .${c}.rte-conditional-theme-acme .rte-conditional-btn-primary {
715
+ border-color: #0f766e;
716
+ background: #0f766e;
717
+ color: #ffffff;
718
+ }
719
+
720
+ ${f} .rte-toolbar-group-items.conditional-content,
721
+ .${c}.rte-conditional-theme-acme .rte-toolbar-group-items.conditional-content,
722
+ ${g} .rte-toolbar-group-items.conditional-content,
723
+ ${f} .editora-toolbar-group-items.conditional-content {
724
+ border-color: #bfd0e2;
725
+ }
726
+
727
+ ${f} .rte-toolbar-group-items.conditional-content .rte-toolbar-button,
728
+ ${g} .rte-toolbar-group-items.conditional-content .rte-toolbar-button,
729
+ ${f} .editora-toolbar-group-items.conditional-content .editora-toolbar-button {
730
+ border-right-color: #bfd0e2;
731
+ }
732
+
733
+ ${f} .${u},
734
+ .${c}.rte-conditional-theme-acme .${u},
735
+ .${u}.rte-conditional-theme-acme {
736
+ background: rgba(255, 255, 255, 0.98);
737
+ border-color: #bfd0e2;
738
+ box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16);
739
+ }
740
+
741
+ ${f} .${u} .rte-conditional-float-btn,
742
+ .${c}.rte-conditional-theme-acme .${u} .rte-conditional-float-btn,
743
+ .${u}.rte-conditional-theme-acme .rte-conditional-float-btn {
744
+ background: #ffffff;
745
+ border-color: #bfd0e2;
746
+ color: #1f334a;
747
+ }
748
+
749
+ ${f} .${u} .rte-conditional-float-btn:hover,
750
+ .${c}.rte-conditional-theme-acme .${u} .rte-conditional-float-btn:hover,
751
+ .${u}.rte-conditional-theme-acme .rte-conditional-float-btn:hover {
752
+ background: #eef7f5;
753
+ color: #0f4f4a;
754
+ }
755
+
756
+ ${f} .${u} .rte-conditional-float-btn[data-action="delete"],
757
+ .${c}.rte-conditional-theme-acme .${u} .rte-conditional-float-btn[data-action="delete"],
758
+ .${u}.rte-conditional-theme-acme .rte-conditional-float-btn[data-action="delete"] {
759
+ border-color: #f1a7b2;
760
+ color: #8b1f2f;
761
+ background: #fff4f6;
762
+ }
763
+ `, document.head.appendChild(e);
764
+ }
765
+ function Ue(e) {
766
+ return {
767
+ defaultCondition: e.defaultCondition || "",
768
+ defaultAudience: ie(e.defaultAudience || []),
769
+ defaultLocale: ie(e.defaultLocale || []),
770
+ enableElseByDefault: e.enableElseByDefault === !0,
771
+ labels: Fe(e.labels),
772
+ context: e.context,
773
+ getContext: e.getContext,
774
+ currentAudience: e.currentAudience,
775
+ currentLocale: e.currentLocale,
776
+ evaluateCondition: e.evaluateCondition || Ze
777
+ };
778
+ }
779
+ function Oe() {
780
+ de && (de.cleanup(), de = null);
781
+ }
782
+ function Ye(e) {
783
+ return e ? e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement : null;
784
+ }
785
+ function ae(e, t) {
786
+ e.setAttribute("contenteditable", "false"), e.setAttribute("spellcheck", "false");
787
+ const o = e.querySelector(".rte-conditional-header");
788
+ o && (o.setAttribute("contenteditable", "false"), o.setAttribute("tabindex", "0"), o.setAttribute("role", "button"), o.setAttribute("aria-label", "Edit conditional rule"));
789
+ const i = e.querySelector(".rte-conditional-else-label");
790
+ i && i.setAttribute("contenteditable", "false"), Qe(e, !t);
791
+ }
792
+ function Je(e) {
793
+ const t = e.querySelector('.rte-conditional-body[data-slot="if"]');
794
+ if (!t) return;
795
+ const o = /* @__PURE__ */ new Set(), i = e.querySelector(".rte-conditional-header"), n = e.querySelector(".rte-conditional-else-label"), a = e.querySelector('.rte-conditional-body[data-slot="else"]');
796
+ i && o.add(i), o.add(t), n && o.add(n), a && o.add(a), Array.from(e.childNodes).forEach((l) => {
797
+ if (!(l instanceof HTMLElement && o.has(l))) {
798
+ if (l.nodeType === Node.TEXT_NODE && !(l.textContent || "").trim()) {
799
+ l.remove();
800
+ return;
801
+ }
802
+ t.appendChild(l);
803
+ }
804
+ });
805
+ }
806
+ function U(e) {
807
+ const t = window.getSelection();
808
+ if (t && t.rangeCount > 0) {
809
+ const n = t.getRangeAt(0).startContainer, a = n.nodeType === Node.ELEMENT_NODE ? n : n.parentElement, r = a == null ? void 0 : a.closest(P);
810
+ if (r && e.contains(r)) return r;
811
+ }
812
+ const o = document.activeElement, i = o == null ? void 0 : o.closest(P);
813
+ return i && e.contains(i) ? i : null;
814
+ }
815
+ function Ae(e, t) {
816
+ let o = e.querySelector(".rte-conditional-else-label"), i = e.querySelector('.rte-conditional-body[data-slot="else"]');
817
+ o || (o = document.createElement("div"), o.className = "rte-conditional-else-label", o.setAttribute("contenteditable", "false"), o.innerHTML = `
818
+ <span class="rte-conditional-chip rte-conditional-chip-else">${$(t.blockElseLabel)}</span>
819
+ <span class="rte-conditional-summary">Else branch</span>
820
+ `, e.appendChild(o)), i || (i = document.createElement("div"), i.className = "rte-conditional-body rte-conditional-else-body", i.setAttribute("data-slot", "else"), i.innerHTML = "<p><br></p>", e.appendChild(i));
821
+ }
822
+ function Xe(e, t) {
823
+ e.setAttribute("data-has-else", t ? "true" : "false");
824
+ const o = e.querySelector(".rte-conditional-else-label"), i = e.querySelector('.rte-conditional-body[data-slot="else"]');
825
+ o && o.classList.toggle("rte-conditional-hidden", !t), i && i.classList.toggle("rte-conditional-hidden", !t);
826
+ }
827
+ function Qe(e, t) {
828
+ Array.from(e.querySelectorAll(".rte-conditional-body")).forEach((i) => {
829
+ i.setAttribute("contenteditable", t ? "true" : "false");
830
+ }), e.setAttribute("contenteditable", "false");
831
+ }
832
+ function we(e, t) {
833
+ const o = e.getAttribute("data-condition") || "", i = R(e.getAttribute("data-audience")), n = R(e.getAttribute("data-locale"));
834
+ let a = e.querySelector(".rte-conditional-header");
835
+ a || (a = document.createElement("div"), a.className = "rte-conditional-header", e.prepend(a)), a.setAttribute("contenteditable", "false"), a.setAttribute("tabindex", "0"), a.setAttribute("role", "button"), a.setAttribute("aria-label", "Edit conditional rule");
836
+ const r = o || "(always true)", l = i.length > 0 ? i.join(", ") : t.allAudiencesText, d = n.length > 0 ? n.join(", ") : t.allLocalesText;
837
+ if (a.innerHTML = `
838
+ <span class="rte-conditional-chip">${$(t.blockIfLabel)}</span>
839
+ <span class="rte-conditional-summary">${$(r)}</span>
840
+ <span class="rte-conditional-meta">${$(l)} · ${$(d)}</span>
841
+ `, !e.querySelector('.rte-conditional-body[data-slot="if"]')) {
842
+ const m = document.createElement("div");
843
+ m.className = "rte-conditional-body", m.setAttribute("data-slot", "if"), m.innerHTML = "<p><br></p>", e.insertBefore(m, e.children[1] || null);
844
+ }
845
+ const v = e.getAttribute("data-has-else") === "true";
846
+ v && Ae(e, t), Je(e), Xe(e, v);
847
+ }
848
+ function Pe(e, t) {
849
+ const o = document.createElement("section");
850
+ o.className = "rte-conditional-block", o.setAttribute("data-conditional-content", "true"), o.setAttribute("data-condition", (e.condition || "").trim()), o.setAttribute("data-audience", ie(e.audience).join(",")), o.setAttribute("data-locale", ie(e.locale).join(",")), o.setAttribute("data-has-else", e.hasElse ? "true" : "false"), o.setAttribute("role", "group"), o.setAttribute("aria-label", "Conditional content block"), o.setAttribute("contenteditable", "false"), o.setAttribute("spellcheck", "false");
851
+ const i = document.createElement("div");
852
+ i.className = "rte-conditional-header", i.setAttribute("contenteditable", "false");
853
+ const n = document.createElement("div");
854
+ return n.className = "rte-conditional-body", n.setAttribute("data-slot", "if"), n.innerHTML = "<p><br></p>", o.appendChild(i), o.appendChild(n), e.hasElse && Ae(o, t), we(o, t), ae(o, !1), o;
855
+ }
856
+ function et(e, t) {
857
+ if (t)
858
+ try {
859
+ if (!e.isConnected) return;
860
+ const o = e.contains(t.startContainer), i = e.contains(t.endContainer);
861
+ if (!o || !i) return;
862
+ Le(e, t);
863
+ } catch (o) {
864
+ }
865
+ }
866
+ function tt(e) {
867
+ return (e.textContent || "").replace(/\u200B/g, "").trim().length > 0 ? !0 : e.querySelector("img, video, table, iframe, hr, pre, blockquote, ul, ol") !== null;
868
+ }
869
+ function Re(e, t, o) {
870
+ let i = null;
871
+ i || (i = Ne(e)), i || (i = document.createRange(), i.selectNodeContents(e), i.collapse(!1));
872
+ let n = null;
873
+ i.collapsed || (n = i.extractContents()), i.insertNode(t);
874
+ const a = t.querySelector('.rte-conditional-body[data-slot="if"]');
875
+ a && n && tt(n) && (a.innerHTML = "", a.appendChild(n)), a ? $e(e, a) : $e(e, t), e.normalize();
876
+ }
877
+ function ot(e) {
878
+ return {
879
+ condition: e.getAttribute("data-condition") || "",
880
+ audience: R(e.getAttribute("data-audience")),
881
+ locale: R(e.getAttribute("data-locale")),
882
+ hasElse: e.getAttribute("data-has-else") === "true"
883
+ };
884
+ }
885
+ function nt(e, t, o) {
886
+ e.setAttribute("data-condition", (t.condition || "").trim()), e.setAttribute("data-audience", ie(t.audience).join(",")), e.setAttribute("data-locale", ie(t.locale).join(",")), e.setAttribute("data-has-else", t.hasElse ? "true" : "false"), t.hasElse && Ae(e, o), we(e, o), ae(e, e.classList.contains("rte-conditional-preview"));
887
+ }
888
+ function re(e, t) {
889
+ xe(e, e);
890
+ const o = Array.from(e.querySelectorAll(P)), i = k.get(e) === !0;
891
+ return o.forEach((n) => {
892
+ n.classList.add("rte-conditional-block"), n.setAttribute("data-conditional-content", "true"), n.hasAttribute("data-condition") || n.setAttribute("data-condition", ""), n.hasAttribute("data-audience") || n.setAttribute("data-audience", ""), n.hasAttribute("data-locale") || n.setAttribute("data-locale", ""), n.hasAttribute("data-has-else") || n.setAttribute("data-has-else", "false"), n.setAttribute("role", "group"), n.setAttribute("aria-label", "Conditional content block"), n.setAttribute("contenteditable", "false"), n.setAttribute("spellcheck", "false"), we(n, t), ae(n, i);
893
+ }), o;
894
+ }
895
+ async function it(e, t) {
896
+ const o = Ce.get(e);
897
+ if (o)
898
+ return o;
899
+ if (typeof t.getContext == "function")
900
+ try {
901
+ const i = se(e), n = await Promise.resolve(t.getContext({ editor: e, editorRoot: i }));
902
+ if (n && typeof n == "object")
903
+ return n;
904
+ } catch (i) {
905
+ return {};
906
+ }
907
+ if (typeof t.context == "function")
908
+ try {
909
+ const i = t.context();
910
+ if (i && typeof i == "object")
911
+ return i;
912
+ } catch (i) {
913
+ return {};
914
+ }
915
+ return t.context && typeof t.context == "object" ? t.context : {};
916
+ }
917
+ function ge(e) {
918
+ return Array.isArray(e) ? e.map((t) => t.trim().toLowerCase()).filter(Boolean) : typeof e == "string" ? e.split(",").map((t) => t.trim().toLowerCase()).filter(Boolean) : [];
919
+ }
920
+ function Be(e, t) {
921
+ return e.length === 0 || e.includes("all") ? !0 : t.length === 0 ? !1 : e.some((o) => t.includes(o));
922
+ }
923
+ async function Y(e, t, o) {
924
+ var T, ue, B, V;
925
+ const i = t.labels, n = re(e, i);
926
+ if (k.set(e, o), qe(e, o), se(e).classList.toggle("rte-conditional-preview-on", o), !o) {
927
+ n.forEach((p) => {
928
+ p.classList.remove("rte-conditional-preview"), ae(p, !1);
929
+ const M = p.querySelector('.rte-conditional-body[data-slot="if"]'), C = p.querySelector('.rte-conditional-body[data-slot="else"]'), q = p.querySelector(".rte-conditional-else-label"), N = p.getAttribute("data-has-else") === "true";
930
+ M && (M.classList.remove("rte-conditional-hidden"), M.removeAttribute("aria-hidden")), C && (C.classList.toggle("rte-conditional-hidden", !N), C.setAttribute("aria-hidden", N ? "false" : "true")), q && q.classList.toggle("rte-conditional-hidden", !N);
931
+ });
932
+ return;
933
+ }
934
+ const r = await it(e, t), l = ge(t.currentAudience), d = ge(t.currentLocale), x = ge(
935
+ (ue = r.audience) != null ? ue : (T = r.user) == null ? void 0 : T.audience
936
+ ), v = ge(
937
+ (V = r.locale) != null ? V : (B = r.user) == null ? void 0 : B.locale
938
+ ), m = l.length > 0 ? l : x, S = d.length > 0 ? d : v;
939
+ n.forEach((p) => {
940
+ const M = p.getAttribute("data-condition") || "", C = R(p.getAttribute("data-audience")).map((s) => s.toLowerCase()), q = R(p.getAttribute("data-locale")).map((s) => s.toLowerCase()), N = p.getAttribute("data-has-else") === "true", Ee = t.evaluateCondition(M, r), fe = Be(C, m), be = Be(q, S), K = Ee && fe && be, W = p.querySelector('.rte-conditional-body[data-slot="if"]'), Z = p.querySelector('.rte-conditional-body[data-slot="else"]'), le = p.querySelector(".rte-conditional-else-label");
941
+ if (p.classList.add("rte-conditional-preview"), ae(p, !0), W && (W.classList.toggle("rte-conditional-hidden", !K), W.setAttribute("aria-hidden", K ? "false" : "true")), Z) {
942
+ const s = N && !K;
943
+ Z.classList.toggle("rte-conditional-hidden", !s), Z.setAttribute("aria-hidden", s ? "false" : "true");
944
+ }
945
+ if (le) {
946
+ const s = N && !K;
947
+ le.classList.toggle("rte-conditional-hidden", !s);
948
+ }
949
+ });
950
+ }
951
+ function qe(e, t) {
952
+ const o = se(e);
953
+ Array.from(
954
+ o.querySelectorAll('[data-command="toggleConditionalPreview"], [data-command="conditionalPreview"]')
955
+ ).forEach((n) => {
956
+ n.setAttribute("data-active", t ? "true" : "false"), n.classList.toggle("active", t), n.setAttribute("aria-pressed", t ? "true" : "false");
957
+ });
958
+ }
959
+ function at(e) {
960
+ const t = j.get(e);
961
+ if (t && t.isConnected) return t;
962
+ const o = document.createElement("div");
963
+ return o.className = u, o.setAttribute("role", "toolbar"), o.setAttribute("aria-label", "Conditional block actions"), o.innerHTML = `
964
+ <button type="button" class="rte-conditional-float-btn" data-action="edit" title="Edit Condition" aria-label="Edit Condition">
965
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true"><path d="M4 17.3V20h2.7l9.7-9.7-2.7-2.7L4 17.3Zm14.7-9.4a1 1 0 0 0 0-1.4l-1.2-1.2a1 1 0 0 0-1.4 0l-1.1 1.1 2.7 2.7 1-1.2Z" fill="currentColor"></path></svg>
966
+ </button>
967
+ <button type="button" class="rte-conditional-float-btn" data-action="delete" title="Delete Block" aria-label="Delete Block">
968
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true"><path d="M8 4h8l1 2h4v2H3V6h4l1-2Zm1 6h2v8H9v-8Zm4 0h2v8h-2v-8Z" fill="currentColor"></path></svg>
969
+ </button>
970
+ `, o.addEventListener("mousedown", (i) => {
971
+ i.preventDefault();
972
+ }), o.addEventListener("click", (i) => {
973
+ var d;
974
+ const n = i.target, a = (d = n == null ? void 0 : n.closest("[data-action]")) == null ? void 0 : d.getAttribute("data-action");
975
+ if (!a) return;
976
+ const r = E.get(e) || ne;
977
+ if (!r) return;
978
+ const l = I.get(e);
979
+ if (!(!l || !e.contains(l))) {
980
+ if (a === "edit") {
981
+ L(e, r, "edit", void 0, l);
982
+ return;
983
+ }
984
+ a === "delete" && (_e(e, l), I.set(e, null), F(e));
985
+ }
986
+ }), document.body.appendChild(o), j.set(e, o), o;
987
+ }
988
+ function F(e) {
989
+ const t = j.get(e);
990
+ t && t.classList.remove("show");
991
+ }
992
+ function Ke(e, t) {
993
+ const o = t.getBoundingClientRect();
994
+ e.style.left = "0px", e.style.top = "0px", e.classList.add("show");
995
+ const i = e.getBoundingClientRect(), n = 8, a = window.innerWidth, r = window.innerHeight;
996
+ let l = o.top - i.height - n;
997
+ l < n && (l = o.bottom + n), l = Math.min(l, r - i.height - n);
998
+ let d = o.right - i.width;
999
+ d = Math.max(n, Math.min(d, a - i.width - n)), e.style.left = `${d}px`, e.style.top = `${l}px`;
1000
+ }
1001
+ function ye(e, t) {
1002
+ const o = at(e);
1003
+ xe(o, e), I.set(e, t), Ke(o, t);
1004
+ }
1005
+ function O(e) {
1006
+ const t = E.get(e) || ne;
1007
+ if (!t) return;
1008
+ const o = U(e);
1009
+ if (!o || !e.contains(o) || D(e)) {
1010
+ I.set(e, null), F(e);
1011
+ return;
1012
+ }
1013
+ re(e, t.labels), ye(e, o);
1014
+ }
1015
+ function rt() {
1016
+ j.forEach((e, t) => {
1017
+ if (!t.isConnected || !e.isConnected) {
1018
+ e.remove(), j.delete(t), I.delete(t);
1019
+ return;
1020
+ }
1021
+ if (!e.classList.contains("show")) return;
1022
+ xe(e, t);
1023
+ const o = I.get(t);
1024
+ if (!o || !t.contains(o)) {
1025
+ F(t);
1026
+ return;
1027
+ }
1028
+ Ke(e, o);
1029
+ });
1030
+ }
1031
+ function _e(e, t) {
1032
+ if (!e.contains(t)) return !1;
1033
+ const o = e.innerHTML, i = t.parentNode, n = t.nextSibling;
1034
+ t.remove(), i === e && e.innerHTML.trim() === "" && (e.innerHTML = "<p><br></p>");
1035
+ const a = document.createRange();
1036
+ return n && e.contains(n) ? a.setStartBefore(n) : (a.selectNodeContents(e), a.collapse(!1)), a.collapse(!0), Le(e, a), De(e), He(e, o), !0;
1037
+ }
1038
+ function Me(e, t, o) {
1039
+ const i = e.cloneRange(), n = document.createRange();
1040
+ return n.selectNodeContents(t), n.collapse(o === "start"), i.startContainer === n.startContainer && i.startOffset === n.startOffset && i.endContainer === n.endContainer && i.endOffset === n.endOffset;
1041
+ }
1042
+ function L(e, t, o, i, n) {
1043
+ var K, W, Z, le;
1044
+ Oe();
1045
+ const a = t.labels, r = o === "insert" ? Ne(e) : null, l = document.createElement("div");
1046
+ l.className = c, xe(l, e);
1047
+ const d = document.createElement("section");
1048
+ d.className = "rte-conditional-dialog", d.setAttribute("role", "dialog"), d.setAttribute("aria-modal", "true"), d.setAttribute("aria-labelledby", "rte-conditional-dialog-title");
1049
+ const x = n ? ot(n) : void 0, v = i || x || {}, m = (K = v.condition) != null ? K : t.defaultCondition, S = (W = v.audience) != null ? W : t.defaultAudience, T = (Z = v.locale) != null ? Z : t.defaultLocale, ue = (le = v.hasElse) != null ? le : t.enableElseByDefault;
1050
+ d.innerHTML = `
1051
+ <header class="rte-conditional-dialog-header">
1052
+ <h2 id="rte-conditional-dialog-title" class="rte-conditional-dialog-title">${$(
1053
+ o === "edit" ? a.dialogTitleEdit : a.dialogTitleInsert
1054
+ )}</h2>
1055
+ <button type="button" class="rte-conditional-btn" data-action="cancel" aria-label="${$(a.cancelText)}">✕</button>
1056
+ </header>
1057
+ <div class="rte-conditional-dialog-body">
1058
+ <div class="rte-conditional-field">
1059
+ <label for="rte-conditional-condition">${$(a.conditionLabel)}</label>
1060
+ <input id="rte-conditional-condition" class="rte-conditional-input-condition" type="text" value="${$(
1061
+ m || ""
1062
+ )}" placeholder="${$(a.conditionPlaceholder)}" />
1063
+ </div>
1064
+ <div class="rte-conditional-field">
1065
+ <label for="rte-conditional-audience">${$(a.audienceLabel)}</label>
1066
+ <input id="rte-conditional-audience" class="rte-conditional-input-audience" type="text" value="${$(
1067
+ Te(S)
1068
+ )}" placeholder="${$(a.audiencePlaceholder)}" />
1069
+ </div>
1070
+ <div class="rte-conditional-field">
1071
+ <label for="rte-conditional-locale">${$(a.localeLabel)}</label>
1072
+ <input id="rte-conditional-locale" class="rte-conditional-input-locale" type="text" value="${$(
1073
+ Te(T)
1074
+ )}" placeholder="${$(a.localePlaceholder)}" />
1075
+ </div>
1076
+ <label class="rte-conditional-checkbox">
1077
+ <input class="rte-conditional-input-else" type="checkbox" ${ue ? "checked" : ""} />
1078
+ <span>${$(a.elseLabel)}</span>
1079
+ </label>
1080
+ <p class="rte-conditional-help">Example condition: <code>user.role == "admin"</code>, <code>locale == "en-US"</code>, <code>!feature.beta</code></p>
1081
+ </div>
1082
+ <footer class="rte-conditional-dialog-footer">
1083
+ <button type="button" class="rte-conditional-btn" data-action="cancel">${$(a.cancelText)}</button>
1084
+ <button type="button" class="rte-conditional-btn rte-conditional-btn-primary" data-action="save">${$(a.saveText)}</button>
1085
+ </footer>
1086
+ `, l.appendChild(d), document.body.appendChild(l);
1087
+ const B = d.querySelector(".rte-conditional-input-condition"), V = d.querySelector(".rte-conditional-input-audience"), p = d.querySelector(".rte-conditional-input-locale"), M = d.querySelector(".rte-conditional-input-else"), C = () => {
1088
+ l.removeEventListener("click", N), l.removeEventListener("keydown", be, !0), document.removeEventListener("keydown", q, !0), l.parentNode && l.parentNode.removeChild(l), de = null, e.focus({ preventScroll: !0 }), O(e);
1089
+ }, q = (s) => {
1090
+ s.key === "Escape" && (s.preventDefault(), s.stopPropagation(), C());
1091
+ }, N = (s) => {
1092
+ s.target === l && C();
1093
+ }, Ee = (s) => {
1094
+ if (s.key !== "Tab") return;
1095
+ const _ = Array.from(
1096
+ d.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')
1097
+ );
1098
+ if (_.length === 0) return;
1099
+ const G = _[0], ce = _[_.length - 1], z = document.activeElement;
1100
+ if (s.shiftKey && z === G) {
1101
+ s.preventDefault(), ce.focus();
1102
+ return;
1103
+ }
1104
+ !s.shiftKey && z === ce && (s.preventDefault(), G.focus());
1105
+ }, fe = async () => {
1106
+ var ce;
1107
+ const s = {
1108
+ condition: ((ce = B == null ? void 0 : B.value) == null ? void 0 : ce.trim()) || "",
1109
+ audience: R(V == null ? void 0 : V.value),
1110
+ locale: R(p == null ? void 0 : p.value),
1111
+ hasElse: (M == null ? void 0 : M.checked) || !1
1112
+ }, _ = e.innerHTML;
1113
+ if (n)
1114
+ nt(n, s, a), ae(n, k.get(e) === !0);
1115
+ else {
1116
+ et(e, r);
1117
+ const z = Pe(s, a);
1118
+ try {
1119
+ Re(e, z);
1120
+ } catch (ut) {
1121
+ e.appendChild(z);
1122
+ const ke = z.querySelector('.rte-conditional-body[data-slot="if"]');
1123
+ ke ? $e(e, ke) : $e(e, z);
1124
+ }
1125
+ }
1126
+ k.get(e) === !0 && await Y(e, t, !0), De(e), He(e, _), O(e), C();
1127
+ }, be = (s) => {
1128
+ if (s.key === "Escape") {
1129
+ s.preventDefault(), C();
1130
+ return;
1131
+ }
1132
+ Ee(s), s.key === "Enter" && !s.shiftKey && s.target instanceof HTMLInputElement && (s.preventDefault(), fe());
1133
+ };
1134
+ d.addEventListener("click", (s) => {
1135
+ const G = s.target.getAttribute("data-action");
1136
+ if (G === "cancel") {
1137
+ C();
1138
+ return;
1139
+ }
1140
+ G === "save" && fe();
1141
+ }), l.addEventListener("click", N), l.addEventListener("keydown", be, !0), document.addEventListener("keydown", q, !0), de = { cleanup: C }, B == null || B.focus();
1142
+ }
1143
+ function lt(e) {
1144
+ const t = e.metaKey || e.ctrlKey, i = (typeof e.key == "string" ? e.key : "").toLowerCase(), n = typeof e.code == "string" ? e.code.toLowerCase() : "", a = t && e.altKey && e.shiftKey && (i === "c" || n === "keyc"), r = !e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey && (i === "f9" || n === "f9");
1145
+ return a || r;
1146
+ }
1147
+ function ct(e) {
1148
+ const t = e.metaKey || e.ctrlKey, i = (typeof e.key == "string" ? e.key : "").toLowerCase(), n = typeof e.code == "string" ? e.code.toLowerCase() : "", a = t && e.altKey && e.shiftKey && (i === "p" || n === "keyp"), r = !e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey && (i === "f10" || n === "f10");
1149
+ return a || r;
1150
+ }
1151
+ function dt(e) {
1152
+ ne = e, X || (X = (t) => {
1153
+ const o = t.target, i = o == null ? void 0 : o.closest(A);
1154
+ if (!i) return;
1155
+ y = i, E.has(i) || E.set(i, e);
1156
+ const n = E.get(i) || e;
1157
+ re(i, n.labels), qe(i, k.get(i) === !0), O(i);
1158
+ }, document.addEventListener("focusin", X, !0)), J || (J = (t) => {
1159
+ var v;
1160
+ if (document.querySelector(`.${c}`)) return;
1161
+ const i = t.target;
1162
+ if (!!(i != null && i.closest("input, textarea, select"))) return;
1163
+ const r = (i == null ? void 0 : i.closest(A)) || w(void 0, !1) || y;
1164
+ if (!r || D(r)) return;
1165
+ const l = E.get(r) || ne || e, d = document.activeElement, x = (i == null ? void 0 : i.closest(".rte-conditional-header")) || (d == null ? void 0 : d.closest(".rte-conditional-header"));
1166
+ if (x && (t.key === "Enter" || t.key === " ")) {
1167
+ const m = x.closest(P);
1168
+ if (m && r.contains(m)) {
1169
+ t.preventDefault(), t.stopPropagation(), L(r, l, "edit", void 0, m);
1170
+ return;
1171
+ }
1172
+ }
1173
+ if (lt(t)) {
1174
+ t.preventDefault(), t.stopPropagation();
1175
+ const m = U(r);
1176
+ m ? L(r, l, "edit", void 0, m) : L(r, l, "insert");
1177
+ return;
1178
+ }
1179
+ if (ct(t)) {
1180
+ t.preventDefault(), t.stopPropagation();
1181
+ const m = k.get(r) !== !0;
1182
+ Y(r, l, m), O(r);
1183
+ return;
1184
+ }
1185
+ if ((t.key === "Backspace" || t.key === "Delete") && !t.altKey && !t.ctrlKey && !t.metaKey) {
1186
+ const m = window.getSelection();
1187
+ if (!m || m.rangeCount === 0) return;
1188
+ const S = m.getRangeAt(0);
1189
+ if (!S.collapsed || !r.contains(S.commonAncestorContainer)) return;
1190
+ const T = (v = Ye(S.startContainer)) == null ? void 0 : v.closest(".rte-conditional-body");
1191
+ if (!T || !r.contains(T)) return;
1192
+ if (t.key === "Backspace" && Me(S, T, "start")) {
1193
+ t.preventDefault();
1194
+ return;
1195
+ }
1196
+ if (t.key === "Delete" && Me(S, T, "end")) {
1197
+ t.preventDefault();
1198
+ return;
1199
+ }
1200
+ }
1201
+ }, document.addEventListener("keydown", J, !0)), ee || (ee = (t) => {
1202
+ const o = t.target;
1203
+ if (!o || o.closest(`.${u}`)) return;
1204
+ const i = o.closest(A);
1205
+ if (!i) {
1206
+ y && F(y);
1207
+ return;
1208
+ }
1209
+ if (D(i)) return;
1210
+ y = i, E.has(i) || E.set(i, e);
1211
+ const n = o.closest(P);
1212
+ if (!n) {
1213
+ F(i);
1214
+ return;
1215
+ }
1216
+ requestAnimationFrame(() => {
1217
+ !i.isConnected || !i.contains(n) || ye(i, n);
1218
+ });
1219
+ }, document.addEventListener("mousedown", ee, !0)), Q || (Q = (t) => {
1220
+ const o = t.target;
1221
+ if (!o || o.closest(`.${u}`)) return;
1222
+ const i = o.closest(A);
1223
+ if (!i) {
1224
+ y && F(y);
1225
+ return;
1226
+ }
1227
+ if (D(i)) return;
1228
+ y = i, E.has(i) || E.set(i, e);
1229
+ const n = E.get(i) || e, a = o.closest(P), r = !!o.closest(".rte-conditional-header, .rte-conditional-summary, .rte-conditional-meta, .rte-conditional-else-label");
1230
+ if (a && r) {
1231
+ t.preventDefault(), t.stopPropagation(), L(i, n, "edit", void 0, a), ye(i, a);
1232
+ return;
1233
+ }
1234
+ a ? ye(i, a) : F(i);
1235
+ }, document.addEventListener("click", Q, !0)), te || (te = () => {
1236
+ const t = w(void 0, !1) || y;
1237
+ t && t.isConnected && O(t);
1238
+ }, document.addEventListener("selectionchange", te)), oe || (oe = (t) => {
1239
+ const o = t.target, i = o == null ? void 0 : o.closest(A);
1240
+ if (!i) return;
1241
+ const n = E.get(i) || ne || e;
1242
+ re(i, n.labels), O(i);
1243
+ }, document.addEventListener("input", oe, !0)), H || (H = () => {
1244
+ rt();
1245
+ }, window.addEventListener("scroll", H, !0), window.addEventListener("resize", H));
1246
+ }
1247
+ function st() {
1248
+ X && (document.removeEventListener("focusin", X, !0), X = null), J && (document.removeEventListener("keydown", J, !0), J = null), Q && (document.removeEventListener("click", Q, !0), Q = null), ee && (document.removeEventListener("mousedown", ee, !0), ee = null), te && (document.removeEventListener("selectionchange", te), te = null), oe && (document.removeEventListener("input", oe, !0), oe = null), H && (window.removeEventListener("scroll", H, !0), window.removeEventListener("resize", H), H = null), j.forEach((e) => {
1249
+ e.remove();
1250
+ }), j.clear(), I.clear(), ne = null, y = null;
1251
+ }
1252
+ const ft = (e = {}) => {
1253
+ const t = Ue(e);
1254
+ return Ge(), {
1255
+ name: "conditionalContent",
1256
+ toolbar: [
1257
+ {
1258
+ id: "conditionalContentGroup",
1259
+ label: "Conditional Content",
1260
+ type: "group",
1261
+ command: "conditionalContent",
1262
+ items: [
1263
+ {
1264
+ id: "conditionalContent",
1265
+ label: "Conditional Rule",
1266
+ command: "openConditionalDialog",
1267
+ icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true"><path d="M6 5h12a1 1 0 0 1 1 1v3h-2V7H7v3H5V6a1 1 0 0 1 1-1Zm-1 9h2v3h10v-3h2v4a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1v-4Zm3-2a1 1 0 0 1 1-1h2.6l1.8-2.4a1 1 0 1 1 1.6 1.2L13.8 11H15a1 1 0 1 1 0 2h-2.7l-1.9 2.5a1 1 0 1 1-1.6-1.2L10.1 13H9a1 1 0 0 1-1-1Z" fill="currentColor"></path></svg>',
1268
+ shortcut: "Mod-Alt-Shift-c"
1269
+ },
1270
+ {
1271
+ id: "conditionalPreview",
1272
+ label: "Conditional Preview",
1273
+ command: "toggleConditionalPreview",
1274
+ icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" focusable="false" aria-hidden="true"><path d="M4 6h16a1 1 0 0 1 1 1v3h-2V8H5v8h14v-2h2v3a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1Zm5 3h2v2H9V9Zm0 4h2v2H9v-2Zm4-4h6v2h-6V9Zm0 4h6v2h-6v-2Z" fill="currentColor"></path></svg>',
1275
+ shortcut: "Mod-Alt-Shift-p"
1276
+ }
1277
+ ]
1278
+ }
1279
+ ],
1280
+ commands: {
1281
+ conditionalContent: (o, i) => {
1282
+ const n = w(i);
1283
+ if (!n || D(n)) return !1;
1284
+ y = n, E.set(n, t), re(n, t.labels);
1285
+ const a = o == null ? void 0 : o.target;
1286
+ if (a === "insert")
1287
+ return L(n, t, "insert", o), !0;
1288
+ const r = U(n);
1289
+ return a === "edit" || r ? !r && a === "edit" ? !1 : (L(n, t, "edit", o, r || void 0), !0) : (L(n, t, "insert", o), !0);
1290
+ },
1291
+ openConditionalDialog: (o, i) => {
1292
+ const n = w(i);
1293
+ if (!n || D(n)) return !1;
1294
+ y = n, E.set(n, t), re(n, t.labels);
1295
+ const a = o == null ? void 0 : o.target;
1296
+ if (a === "insert")
1297
+ return L(n, t, "insert", o), !0;
1298
+ const r = U(n);
1299
+ return a === "edit" || r ? !r && a === "edit" ? !1 : (L(n, t, "edit", o, r || void 0), !0) : (L(n, t, "insert", o), !0);
1300
+ },
1301
+ conditionalPreview: async (o, i) => {
1302
+ const n = w(i);
1303
+ if (!n) return !1;
1304
+ y = n, E.set(n, t);
1305
+ const a = typeof o == "boolean" ? o : k.get(n) !== !0;
1306
+ return await Y(n, t, a), O(n), !0;
1307
+ },
1308
+ editConditionalBlock: (o, i) => {
1309
+ const n = w(i);
1310
+ if (!n || D(n)) return !1;
1311
+ y = n, E.set(n, t);
1312
+ const a = U(n);
1313
+ return a ? (L(n, t, "edit", o, a), !0) : !1;
1314
+ },
1315
+ deleteConditionalBlock: (o, i) => {
1316
+ const n = w(i);
1317
+ if (!n || D(n)) return !1;
1318
+ const a = U(n);
1319
+ if (!a) return !1;
1320
+ const r = _e(n, a);
1321
+ return r && O(n), r;
1322
+ },
1323
+ insertConditionalBlock: (o, i) => {
1324
+ var d, x, v, m;
1325
+ const n = w(i);
1326
+ if (!n || D(n)) return !1;
1327
+ y = n, E.set(n, t);
1328
+ const a = {
1329
+ condition: (d = o == null ? void 0 : o.condition) != null ? d : t.defaultCondition,
1330
+ audience: (x = o == null ? void 0 : o.audience) != null ? x : t.defaultAudience,
1331
+ locale: (v = o == null ? void 0 : o.locale) != null ? v : t.defaultLocale,
1332
+ hasElse: (m = o == null ? void 0 : o.hasElse) != null ? m : t.enableElseByDefault
1333
+ }, r = Pe(a, t.labels);
1334
+ return Re(n, r), k.get(n) === !0 && Y(n, t, !0), !0;
1335
+ },
1336
+ toggleConditionalPreview: async (o, i) => {
1337
+ const n = w(i);
1338
+ if (!n) return !1;
1339
+ y = n, E.set(n, t);
1340
+ const a = typeof o == "boolean" ? o : k.get(n) !== !0;
1341
+ return await Y(n, t, a), !0;
1342
+ },
1343
+ setConditionalContext: (o, i) => {
1344
+ const n = w(i);
1345
+ return n ? (y = n, !o || typeof o != "object" ? Ce.delete(n) : Ce.set(n, o), k.get(n) === !0 && Y(n, t, !0), !0) : !1;
1346
+ }
1347
+ },
1348
+ keymap: {
1349
+ "Mod-Alt-Shift-c": "openConditionalDialog",
1350
+ "Mod-Alt-Shift-C": "openConditionalDialog",
1351
+ "Mod-Alt-Shift-p": "toggleConditionalPreview",
1352
+ "Mod-Alt-Shift-P": "toggleConditionalPreview",
1353
+ F9: "openConditionalDialog",
1354
+ F10: "toggleConditionalPreview"
1355
+ },
1356
+ init: () => {
1357
+ me += 1, dt(t);
1358
+ },
1359
+ destroy: () => {
1360
+ me = Math.max(0, me - 1), me === 0 && (Oe(), st());
1361
+ }
1362
+ };
1363
+ };
1364
+ export {
1365
+ ft as ConditionalContentPlugin
1366
+ };
1367
+ //# sourceMappingURL=ConditionalContentPlugin.native-CfhY46rU.mjs.map