@qualityunit/liveagent-components-editor 0.0.79 → 0.0.80

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.
@@ -1,457 +1,531 @@
1
- import { b as ae, E as ge, c as te, a as H, d as I, U as ye, s as re, r as Q, p as se, h as y, e as ne, f as le, H as ie, g as Z, i as z, j as k, k as w, l as M, m as Ae, n as Te, o as Ne, q as j, t as fe, u as xe, v as Me, w as Se, x as Ie, I as Y, y as ue, z as we, A as Ce, B as ke, C as He, D as De, F as Re, G as Le, N as Pe, J as Oe, K as Fe, L as Ue, M as Ve, O as L, P as qe, Q as Be, R as ve, S as Ye, T as P, V as oe, W as q, X as $, Y as F, Z as ce, _ as de, $ as U, a0 as G, a1 as O, a2 as V, a3 as $e, a4 as Ke, a5 as We, a6 as Xe } from "./ckeditor5-BX9cyOs5.js";
2
- function Ze(e, t, a = !1) {
3
- y && ne();
4
- var r = e, s = null, i = null, u = ye, v = a ? ge : 0, o = !1;
5
- const h = (c, n = !0) => {
6
- o = !0, l(n, c);
7
- };
8
- var _ = null;
9
- function E() {
10
- _ !== null && (_.lastChild.remove(), r.before(_), _ = null);
11
- var c = u ? s : i, n = u ? i : s;
12
- c && Q(c), n && se(n, () => {
13
- u ? i = null : s = null;
14
- });
1
+ import { c as N, r as ee, d as O, p as re, a as G, b as H, m as ge, s as se, h as E, e as k, f as ne, E as ye, g as le, i as ie, H as fe, j as J, k as Q, l as I, n as x, o as Ae, q as Me, t as Te, u as te, v as ue, w as xe, x as Ne, y as Se, z as we, I as q, A as ke, B as Ce, C as Ie, D as He, F as De, G as Re, J as Le, N as Pe, K as Fe, L as Oe, M as Ve, O as Be, P as L, Q as Ue, R as Ye, S as oe, T as $e, U as P, V as ce, W as Y, X as K, Y as V, Z as ve, _ as he, $ as B, a0 as Z, a1 as F, a2 as U, a3 as qe, a4 as Ke, a5 as We, a6 as Xe } from "./ckeditor5-8LqIgjm8.js";
2
+ class ze {
3
+ /** @type {TemplateNode} */
4
+ anchor;
5
+ /** @type {Map<Batch, Key>} */
6
+ #a = /* @__PURE__ */ new Map();
7
+ /** @type {Map<Key, Effect>} */
8
+ #t = /* @__PURE__ */ new Map();
9
+ /** @type {Map<Key, Branch>} */
10
+ #e = /* @__PURE__ */ new Map();
11
+ /**
12
+ * Whether to pause (i.e. outro) on change, or destroy immediately.
13
+ * This is necessary for `<svelte:element>`
14
+ */
15
+ #r = !0;
16
+ /**
17
+ * @param {TemplateNode} anchor
18
+ * @param {boolean} transition
19
+ */
20
+ constructor(a, t = !0) {
21
+ this.anchor = a, this.#r = t;
15
22
  }
16
- const l = (c, n) => {
17
- if (u === (u = c)) return;
18
- let f = !1;
19
- if (y) {
20
- const g = le(r) === ie;
21
- !!u === g && (r = Z(), z(r), k(!1), f = !0);
23
+ #s = () => {
24
+ var a = (
25
+ /** @type {Batch} */
26
+ N
27
+ );
28
+ if (this.#a.has(a)) {
29
+ var t = (
30
+ /** @type {Key} */
31
+ this.#a.get(a)
32
+ ), r = this.#t.get(t);
33
+ if (r)
34
+ ee(r);
35
+ else {
36
+ var s = this.#e.get(t);
37
+ s && (this.#t.set(t, s.effect), this.#e.delete(t), s.fragment.lastChild.remove(), this.anchor.before(s.fragment), r = s.effect);
38
+ }
39
+ for (const [n, l] of this.#a) {
40
+ if (this.#a.delete(n), n === a)
41
+ break;
42
+ const i = this.#e.get(l);
43
+ i && (O(i.effect), this.#e.delete(l));
44
+ }
45
+ for (const [n, l] of this.#t) {
46
+ if (n === t) continue;
47
+ const i = () => {
48
+ if (Array.from(this.#a.values()).includes(n)) {
49
+ var v = document.createDocumentFragment();
50
+ ge(l, v), v.append(G()), this.#e.set(n, { effect: l, fragment: v });
51
+ } else
52
+ O(l);
53
+ this.#t.delete(n);
54
+ };
55
+ this.#r || !r ? re(l, i, !1) : i();
56
+ }
22
57
  }
23
- var b = re(), N = r;
24
- if (b && (_ = document.createDocumentFragment(), _.append(N = te())), u ? s ??= n && H(() => n(N)) : i ??= n && H(() => n(N)), b) {
25
- var p = (
26
- /** @type {Batch} */
27
- I
28
- ), d = u ? s : i, m = u ? i : s;
29
- d && p.skipped_effects.delete(d), m && p.skipped_effects.add(m), p.add_callback(E);
30
- } else
31
- E();
32
- f && k(!0);
33
58
  };
34
- ae(() => {
35
- o = !1, t(h), o || l(null, null);
36
- }, v), y && (r = w);
59
+ /**
60
+ *
61
+ * @param {any} key
62
+ * @param {null | ((target: TemplateNode) => void)} fn
63
+ */
64
+ ensure(a, t) {
65
+ var r = (
66
+ /** @type {Batch} */
67
+ N
68
+ ), s = se();
69
+ if (t && !this.#t.has(a) && !this.#e.has(a))
70
+ if (s) {
71
+ var n = document.createDocumentFragment(), l = G();
72
+ n.append(l), this.#e.set(a, {
73
+ effect: H(() => t(l)),
74
+ fragment: n
75
+ });
76
+ } else
77
+ this.#t.set(
78
+ a,
79
+ H(() => t(this.anchor))
80
+ );
81
+ if (this.#a.set(r, a), s) {
82
+ for (const [i, c] of this.#t)
83
+ i === a ? r.skipped_effects.delete(c) : r.skipped_effects.add(c);
84
+ for (const [i, c] of this.#e)
85
+ i === a ? r.skipped_effects.delete(c.effect) : r.skipped_effects.add(c.effect);
86
+ r.add_callback(this.#s);
87
+ } else
88
+ E && (this.anchor = k), this.#s();
89
+ }
37
90
  }
38
- function ze(e, t) {
39
- return t;
91
+ function Ge(e, a, t = !1) {
92
+ E && le();
93
+ var r = new ze(e), s = t ? ye : 0;
94
+ function n(l, i) {
95
+ if (E) {
96
+ const v = ie(e) === fe;
97
+ if (l === v) {
98
+ var c = J();
99
+ Q(c), r.anchor = c, I(!1), r.ensure(l, i), I(!0);
100
+ return;
101
+ }
102
+ }
103
+ r.ensure(l, i);
104
+ }
105
+ ne(() => {
106
+ var l = !1;
107
+ a((i, c = !0) => {
108
+ l = !0, n(c, i);
109
+ }), l || n(!1, null);
110
+ }, s);
111
+ }
112
+ function Je(e, a) {
113
+ return a;
40
114
  }
41
- function Ge(e, t, a) {
42
- for (var r = e.items, s = [], i = t.length, u = 0; u < i; u++)
43
- Ce(t[u].e, s, !0);
44
- var v = i > 0 && s.length === 0 && a !== null;
45
- if (v) {
46
- var o = (
115
+ function Qe(e, a, t) {
116
+ for (var r = e.items, s = [], n = a.length, l = 0; l < n; l++)
117
+ Ce(a[l].e, s, !0);
118
+ var i = n > 0 && s.length === 0 && t !== null;
119
+ if (i) {
120
+ var c = (
47
121
  /** @type {Element} */
48
122
  /** @type {Element} */
49
- a.parentNode
123
+ t.parentNode
50
124
  );
51
- ke(o), o.append(
125
+ Ie(c), c.append(
52
126
  /** @type {Element} */
53
- a
54
- ), r.clear(), x(e, t[0].prev, t[i - 1].next);
127
+ t
128
+ ), r.clear(), T(e, a[0].prev, a[n - 1].next);
55
129
  }
56
130
  He(s, () => {
57
- for (var h = 0; h < i; h++) {
58
- var _ = t[h];
59
- v || (r.delete(_.k), x(e, _.prev, _.next)), ue(_.e, !v);
131
+ for (var v = 0; v < n; v++) {
132
+ var m = a[v];
133
+ i || (r.delete(m.k), T(e, m.prev, m.next)), O(m.e, !i);
60
134
  }
61
135
  });
62
136
  }
63
- function Je(e, t, a, r, s, i = null) {
64
- var u = e, v = { flags: t, items: /* @__PURE__ */ new Map(), first: null };
65
- y && ne();
66
- var o = null, h = !1, _ = /* @__PURE__ */ new Map(), E = Ae(() => {
67
- var f = a();
68
- return xe(f) ? f : f == null ? [] : fe(f);
69
- }), l, c;
70
- function n() {
71
- Qe(
72
- c,
73
- l,
74
- v,
75
- _,
137
+ function Ze(e, a, t, r, s, n = null) {
138
+ var l = e, i = { flags: a, items: /* @__PURE__ */ new Map(), first: null };
139
+ E && le();
140
+ var c = null, v = !1, m = /* @__PURE__ */ new Map(), g = Ae(() => {
141
+ var o = t();
142
+ return xe(o) ? o : o == null ? [] : ue(o);
143
+ }), u, d;
144
+ function f() {
145
+ je(
146
+ d,
76
147
  u,
148
+ i,
149
+ m,
150
+ l,
77
151
  s,
78
- t,
152
+ a,
79
153
  r,
80
- a
81
- ), i !== null && (l.length === 0 ? o ? Q(o) : o = H(() => i(u)) : o !== null && se(o, () => {
82
- o = null;
154
+ t
155
+ ), n !== null && (u.length === 0 ? c ? ee(c) : c = H(() => n(l)) : c !== null && re(c, () => {
156
+ c = null;
83
157
  }));
84
158
  }
85
- ae(() => {
86
- c ??= /** @type {Effect} */
87
- De, l = /** @type {V[]} */
88
- M(E);
89
- var f = l.length;
90
- if (h && f === 0)
159
+ ne(() => {
160
+ d ??= /** @type {Effect} */
161
+ De, u = /** @type {V[]} */
162
+ x(g);
163
+ var o = u.length;
164
+ if (v && o === 0)
91
165
  return;
92
- h = f === 0;
166
+ v = o === 0;
93
167
  let b = !1;
94
- if (y) {
95
- var N = le(u) === ie;
96
- N !== (f === 0) && (u = Z(), z(u), k(!1), b = !0);
168
+ if (E) {
169
+ var w = ie(l) === fe;
170
+ w !== (o === 0) && (l = J(), Q(l), I(!1), b = !0);
97
171
  }
98
- if (y) {
99
- for (var p = null, d, m = 0; m < f; m++) {
100
- if (w.nodeType === Re && /** @type {Comment} */
101
- w.data === Le) {
102
- u = /** @type {Comment} */
103
- w, b = !0, k(!1);
172
+ if (E) {
173
+ for (var y = null, h, _ = 0; _ < o; _++) {
174
+ if (k.nodeType === Re && /** @type {Comment} */
175
+ k.data === Le) {
176
+ l = /** @type {Comment} */
177
+ k, b = !0, I(!1);
104
178
  break;
105
179
  }
106
- var g = l[m], A = r(g, m);
107
- d = J(
108
- w,
109
- v,
110
- p,
180
+ var p = u[_], A = r(p, _);
181
+ h = j(
182
+ k,
183
+ i,
184
+ y,
111
185
  null,
112
- g,
186
+ p,
113
187
  A,
114
- m,
188
+ _,
115
189
  s,
116
- t,
117
- a
118
- ), v.items.set(A, d), p = d;
190
+ a,
191
+ t
192
+ ), i.items.set(A, h), y = h;
119
193
  }
120
- f > 0 && z(Z());
194
+ o > 0 && Q(J());
121
195
  }
122
- if (y)
123
- f === 0 && i && (o = H(() => i(u)));
124
- else if (re()) {
196
+ if (E)
197
+ o === 0 && n && (c = H(() => n(l)));
198
+ else if (se()) {
125
199
  var D = /* @__PURE__ */ new Set(), S = (
126
200
  /** @type {Batch} */
127
- I
201
+ N
128
202
  );
129
- for (m = 0; m < f; m += 1) {
130
- g = l[m], A = r(g, m);
131
- var T = v.items.get(A) ?? _.get(A);
132
- T ? _e(T, g, m) : (d = J(
203
+ for (_ = 0; _ < o; _ += 1) {
204
+ p = u[_], A = r(p, _);
205
+ var M = i.items.get(A) ?? m.get(A);
206
+ M ? de(M, p, _) : (h = j(
133
207
  null,
134
- v,
208
+ i,
135
209
  null,
136
210
  null,
137
- g,
211
+ p,
138
212
  A,
139
- m,
213
+ _,
140
214
  s,
141
- t,
142
215
  a,
216
+ t,
143
217
  !0
144
- ), _.set(A, d)), D.add(A);
218
+ ), m.set(A, h)), D.add(A);
145
219
  }
146
- for (const [R, C] of v.items)
220
+ for (const [R, C] of i.items)
147
221
  D.has(R) || S.skipped_effects.add(C.e);
148
- S.add_callback(n);
222
+ S.add_callback(f);
149
223
  } else
150
- n();
151
- b && k(!0), M(E);
152
- }), y && (u = w);
224
+ f();
225
+ b && I(!0), x(g);
226
+ }), E && (l = k);
153
227
  }
154
- function Qe(e, t, a, r, s, i, u, v, o) {
155
- var h = t.length, _ = a.items, E = a.first, l = E, c, n = null, f = [], b = [], N, p, d, m;
156
- for (m = 0; m < h; m += 1) {
157
- if (N = t[m], p = v(N, m), d = _.get(p), d === void 0) {
158
- var g = r.get(p);
159
- if (g !== void 0) {
160
- r.delete(p), _.set(p, g);
161
- var A = n ? n.next : l;
162
- x(a, n, g), x(a, g, A), K(g, A, s), n = g;
228
+ function je(e, a, t, r, s, n, l, i, c) {
229
+ var v = a.length, m = t.items, g = t.first, u = g, d, f = null, o = [], b = [], w, y, h, _;
230
+ for (_ = 0; _ < v; _ += 1) {
231
+ if (w = a[_], y = i(w, _), h = m.get(y), h === void 0) {
232
+ var p = r.get(y);
233
+ if (p !== void 0) {
234
+ r.delete(y), m.set(y, p);
235
+ var A = f ? f.next : u;
236
+ T(t, f, p), T(t, p, A), W(p, A, s), f = p;
163
237
  } else {
164
- var D = l ? (
238
+ var D = u ? (
165
239
  /** @type {TemplateNode} */
166
- l.e.nodes_start
240
+ u.e.nodes_start
167
241
  ) : s;
168
- n = J(
242
+ f = j(
169
243
  D,
170
- a,
244
+ t,
245
+ f,
246
+ f === null ? t.first : f.next,
247
+ w,
248
+ y,
249
+ _,
171
250
  n,
172
- n === null ? a.first : n.next,
173
- N,
174
- p,
175
- m,
176
- i,
177
- u,
178
- o
251
+ l,
252
+ c
179
253
  );
180
254
  }
181
- _.set(p, n), f = [], b = [], l = n.next;
255
+ m.set(y, f), o = [], b = [], u = f.next;
182
256
  continue;
183
257
  }
184
- if (_e(d, N, m), (d.e.f & Y) !== 0 && Q(d.e), d !== l) {
185
- if (c !== void 0 && c.has(d)) {
186
- if (f.length < b.length) {
187
- var S = b[0], T;
188
- n = S.prev;
189
- var R = f[0], C = f[f.length - 1];
190
- for (T = 0; T < f.length; T += 1)
191
- K(f[T], S, s);
192
- for (T = 0; T < b.length; T += 1)
193
- c.delete(b[T]);
194
- x(a, R.prev, C.next), x(a, n, R), x(a, C, S), l = S, n = C, m -= 1, f = [], b = [];
258
+ if (de(h, w, _), (h.e.f & q) !== 0 && ee(h.e), h !== u) {
259
+ if (d !== void 0 && d.has(h)) {
260
+ if (o.length < b.length) {
261
+ var S = b[0], M;
262
+ f = S.prev;
263
+ var R = o[0], C = o[o.length - 1];
264
+ for (M = 0; M < o.length; M += 1)
265
+ W(o[M], S, s);
266
+ for (M = 0; M < b.length; M += 1)
267
+ d.delete(b[M]);
268
+ T(t, R.prev, C.next), T(t, f, R), T(t, C, S), u = S, f = C, _ -= 1, o = [], b = [];
195
269
  } else
196
- c.delete(d), K(d, l, s), x(a, d.prev, d.next), x(a, d, n === null ? a.first : n.next), x(a, n, d), n = d;
270
+ d.delete(h), W(h, u, s), T(t, h.prev, h.next), T(t, h, f === null ? t.first : f.next), T(t, f, h), f = h;
197
271
  continue;
198
272
  }
199
- for (f = [], b = []; l !== null && l.k !== p; )
200
- (l.e.f & Y) === 0 && (c ??= /* @__PURE__ */ new Set()).add(l), b.push(l), l = l.next;
201
- if (l === null)
273
+ for (o = [], b = []; u !== null && u.k !== y; )
274
+ (u.e.f & q) === 0 && (d ??= /* @__PURE__ */ new Set()).add(u), b.push(u), u = u.next;
275
+ if (u === null)
202
276
  continue;
203
- d = l;
277
+ h = u;
204
278
  }
205
- f.push(d), n = d, l = d.next;
279
+ o.push(h), f = h, u = h.next;
206
280
  }
207
- if (l !== null || c !== void 0) {
208
- for (var B = c === void 0 ? [] : fe(c); l !== null; )
209
- (l.e.f & Y) === 0 && B.push(l), l = l.next;
210
- var be = B.length;
281
+ if (u !== null || d !== void 0) {
282
+ for (var $ = d === void 0 ? [] : ue(d); u !== null; )
283
+ (u.e.f & q) === 0 && $.push(u), u = u.next;
284
+ var be = $.length;
211
285
  if (be > 0) {
212
- var Ee = null;
213
- Ge(a, B, Ee);
286
+ var pe = null;
287
+ Qe(t, $, pe);
214
288
  }
215
289
  }
216
- e.first = a.first && a.first.e, e.last = n && n.e;
217
- for (var pe of r.values())
218
- ue(pe.e);
290
+ e.first = t.first && t.first.e, e.last = f && f.e;
291
+ for (var Ee of r.values())
292
+ O(Ee.e);
219
293
  r.clear();
220
294
  }
221
- function _e(e, t, a, r) {
222
- Te(e.v, t), e.i = a;
295
+ function de(e, a, t, r) {
296
+ Me(e.v, a), e.i = t;
223
297
  }
224
- function J(e, t, a, r, s, i, u, v, o, h, _) {
225
- var E = (o & Se) !== 0, l = (o & Ie) === 0, c = E ? l ? Ne(s, !1, !1) : j(s) : s, n = (o & Me) === 0 ? u : j(u), f = {
226
- i: n,
227
- v: c,
228
- k: i,
298
+ function j(e, a, t, r, s, n, l, i, c, v, m) {
299
+ var g = (c & Se) !== 0, u = (c & we) === 0, d = g ? u ? Te(s, !1, !1) : te(s) : s, f = (c & Ne) === 0 ? l : te(l), o = {
300
+ i: f,
301
+ v: d,
302
+ k: n,
229
303
  a: null,
230
304
  // @ts-expect-error
231
305
  e: null,
232
- prev: a,
306
+ prev: t,
233
307
  next: r
234
308
  };
235
309
  try {
236
310
  if (e === null) {
237
311
  var b = document.createDocumentFragment();
238
- b.append(e = te());
312
+ b.append(e = G());
239
313
  }
240
- return f.e = H(() => v(
314
+ return o.e = H(() => i(
241
315
  /** @type {Node} */
242
316
  e,
243
- c,
244
- n,
245
- h
246
- ), y), f.e.prev = a && a.e, f.e.next = r && r.e, a === null ? _ || (t.first = f) : (a.next = f, a.e.next = f.e), r !== null && (r.prev = f, r.e.prev = f.e), f;
317
+ d,
318
+ f,
319
+ v
320
+ ), E), o.e.prev = t && t.e, o.e.next = r && r.e, t === null ? m || (a.first = o) : (t.next = o, t.e.next = o.e), r !== null && (r.prev = o, r.e.prev = o.e), o;
247
321
  } finally {
248
322
  }
249
323
  }
250
- function K(e, t, a) {
324
+ function W(e, a, t) {
251
325
  for (var r = e.next ? (
252
326
  /** @type {TemplateNode} */
253
327
  e.next.e.nodes_start
254
- ) : a, s = t ? (
328
+ ) : t, s = a ? (
255
329
  /** @type {TemplateNode} */
256
- t.e.nodes_start
257
- ) : a, i = (
330
+ a.e.nodes_start
331
+ ) : t, n = (
258
332
  /** @type {TemplateNode} */
259
333
  e.e.nodes_start
260
- ); i !== null && i !== r; ) {
261
- var u = (
334
+ ); n !== null && n !== r; ) {
335
+ var l = (
262
336
  /** @type {TemplateNode} */
263
- we(i)
337
+ ke(n)
264
338
  );
265
- s.before(i), i = u;
339
+ s.before(n), n = l;
266
340
  }
267
341
  }
268
- function x(e, t, a) {
269
- t === null ? e.first = a : (t.next = a, t.e.next = a && a.e), a !== null && (a.prev = t, a.e.prev = t && t.e);
342
+ function T(e, a, t) {
343
+ a === null ? e.first = t : (a.next = t, a.e.next = t && t.e), t !== null && (t.prev = a, t.e.prev = a && a.e);
270
344
  }
271
- function he(e) {
272
- var t, a, r = "";
345
+ function _e(e) {
346
+ var a, t, r = "";
273
347
  if (typeof e == "string" || typeof e == "number") r += e;
274
348
  else if (typeof e == "object") if (Array.isArray(e)) {
275
349
  var s = e.length;
276
- for (t = 0; t < s; t++) e[t] && (a = he(e[t])) && (r && (r += " "), r += a);
277
- } else for (a in e) e[a] && (r && (r += " "), r += a);
350
+ for (a = 0; a < s; a++) e[a] && (t = _e(e[a])) && (r && (r += " "), r += t);
351
+ } else for (t in e) e[t] && (r && (r += " "), r += t);
278
352
  return r;
279
353
  }
280
- function je() {
281
- for (var e, t, a = 0, r = "", s = arguments.length; a < s; a++) (e = arguments[a]) && (t = he(e)) && (r && (r += " "), r += t);
354
+ function et() {
355
+ for (var e, a, t = 0, r = "", s = arguments.length; t < s; t++) (e = arguments[t]) && (a = _e(e)) && (r && (r += " "), r += a);
282
356
  return r;
283
357
  }
284
- function ea(e) {
285
- return typeof e == "object" ? je(e) : e ?? "";
358
+ function tt(e) {
359
+ return typeof e == "object" ? et(e) : e ?? "";
286
360
  }
287
- function aa(e, t, a) {
361
+ function at(e, a, t) {
288
362
  var r = e == null ? "" : "" + e;
289
363
  return r === "" ? null : r;
290
364
  }
291
- function ta(e, t, a, r, s, i) {
292
- var u = e.__className;
293
- if (y || u !== a || u === void 0) {
294
- var v = aa(a);
295
- (!y || v !== e.getAttribute("class")) && (v == null ? e.removeAttribute("class") : e.className = v), e.__className = a;
365
+ function rt(e, a, t, r, s, n) {
366
+ var l = e.__className;
367
+ if (E || l !== t || l === void 0) {
368
+ var i = at(t);
369
+ (!E || i !== e.getAttribute("class")) && (i == null ? e.removeAttribute("class") : e.className = i), e.__className = t;
296
370
  }
297
- return i;
371
+ return n;
298
372
  }
299
- const ra = Symbol("is custom element"), sa = Symbol("is html");
300
- function na(e, t, a, r) {
301
- var s = la(e);
302
- y && (s[t] = e.getAttribute(t)), s[t] !== (s[t] = a) && (a == null ? e.removeAttribute(t) : typeof a != "string" && ia(e).includes(t) ? e[t] = a : e.setAttribute(t, a));
373
+ const st = Symbol("is custom element"), nt = Symbol("is html");
374
+ function lt(e, a, t, r) {
375
+ var s = it(e);
376
+ E && (s[a] = e.getAttribute(a)), s[a] !== (s[a] = t) && (t == null ? e.removeAttribute(a) : typeof t != "string" && ft(e).includes(a) ? e[a] = t : e.setAttribute(a, t));
303
377
  }
304
- function la(e) {
378
+ function it(e) {
305
379
  return (
306
380
  /** @type {Record<string | symbol, unknown>} **/
307
381
  // @ts-expect-error
308
382
  e.__attributes ??= {
309
- [ra]: e.nodeName.includes("-"),
310
- [sa]: e.namespaceURI === Pe
383
+ [st]: e.nodeName.includes("-"),
384
+ [nt]: e.namespaceURI === Pe
311
385
  }
312
386
  );
313
387
  }
314
- var ee = /* @__PURE__ */ new Map();
315
- function ia(e) {
316
- var t = e.getAttribute("is") || e.nodeName, a = ee.get(t);
317
- if (a) return a;
318
- ee.set(t, a = []);
319
- for (var r, s = e, i = Element.prototype; i !== s; ) {
320
- r = Fe(s);
321
- for (var u in r)
322
- r[u].set && a.push(u);
323
- s = Oe(s);
388
+ var ae = /* @__PURE__ */ new Map();
389
+ function ft(e) {
390
+ var a = e.getAttribute("is") || e.nodeName, t = ae.get(a);
391
+ if (t) return t;
392
+ ae.set(a, t = []);
393
+ for (var r, s = e, n = Element.prototype; n !== s; ) {
394
+ r = Oe(s);
395
+ for (var l in r)
396
+ r[l].set && t.push(l);
397
+ s = Fe(s);
324
398
  }
325
- return a;
399
+ return t;
326
400
  }
327
- function fa(e, t, a = t) {
401
+ function ut(e, a, t = a) {
328
402
  var r = /* @__PURE__ */ new WeakSet();
329
- Ue(e, "input", async (s) => {
330
- var i = s ? e.defaultValue : e.value;
331
- if (i = W(e) ? X(i) : i, a(i), I !== null && r.add(I), await Ve(), i !== (i = t())) {
332
- var u = e.selectionStart, v = e.selectionEnd, o = e.value.length;
333
- if (e.value = i ?? "", v !== null) {
334
- var h = e.value.length;
335
- u === v && v === o && h > o ? (e.selectionStart = h, e.selectionEnd = h) : (e.selectionStart = u, e.selectionEnd = Math.min(v, h));
403
+ Ve(e, "input", async (s) => {
404
+ var n = s ? e.defaultValue : e.value;
405
+ if (n = X(e) ? z(n) : n, t(n), N !== null && r.add(N), await Be(), n !== (n = a())) {
406
+ var l = e.selectionStart, i = e.selectionEnd, c = e.value.length;
407
+ if (e.value = n ?? "", i !== null) {
408
+ var v = e.value.length;
409
+ l === i && i === c && v > c ? (e.selectionStart = v, e.selectionEnd = v) : (e.selectionStart = l, e.selectionEnd = Math.min(i, v));
336
410
  }
337
411
  }
338
412
  }), // If we are hydrating and the value has since changed,
339
413
  // then use the updated value from the input instead.
340
- (y && e.defaultValue !== e.value || // If defaultValue is set, then value == defaultValue
414
+ (E && e.defaultValue !== e.value || // If defaultValue is set, then value == defaultValue
341
415
  // TODO Svelte 6: remove input.value check and set to empty string?
342
- L(t) == null && e.value) && (a(W(e) ? X(e.value) : e.value), I !== null && r.add(I)), qe(() => {
343
- var s = t();
416
+ L(a) == null && e.value) && (t(X(e) ? z(e.value) : e.value), N !== null && r.add(N)), Ue(() => {
417
+ var s = a();
344
418
  if (e === document.activeElement) {
345
- var i = (
419
+ var n = (
346
420
  /** @type {Batch} */
347
- Be ?? I
421
+ Ye ?? N
348
422
  );
349
- if (r.has(i))
423
+ if (r.has(n))
350
424
  return;
351
425
  }
352
- W(e) && s === X(e.value) || e.type === "date" && !s && !e.value || s !== e.value && (e.value = s ?? "");
426
+ X(e) && s === z(e.value) || e.type === "date" && !s && !e.value || s !== e.value && (e.value = s ?? "");
353
427
  });
354
428
  }
355
- function W(e) {
356
- var t = e.type;
357
- return t === "number" || t === "range";
358
- }
359
429
  function X(e) {
430
+ var a = e.type;
431
+ return a === "number" || a === "range";
432
+ }
433
+ function z(e) {
360
434
  return e === "" ? null : +e;
361
435
  }
362
- var ua = q("<button> </button>"), va = q('<div><button class="HTMLEditor">HTML</button> <button class="PlainEditor">Plain</button> <!></div>');
363
- function me(e, t) {
364
- de(t, !1);
365
- const a = Ye();
366
- let r = P(t, "buttons", 28, () => []);
436
+ var ot = Y("<button> </button>"), ct = Y('<div><button class="HTMLEditor">HTML</button> <button class="PlainEditor">Plain</button> <!></div>');
437
+ function me(e, a) {
438
+ he(a, !1);
439
+ const t = $e();
440
+ let r = P(a, "buttons", 28, () => []);
367
441
  function s() {
368
- a("html", {});
442
+ t("html", {});
369
443
  }
370
- function i() {
371
- a("plain", {});
444
+ function n() {
445
+ t("plain", {});
372
446
  }
373
- var u = {
447
+ var l = {
374
448
  get buttons() {
375
449
  return r();
376
450
  },
377
- set buttons(E) {
378
- r(E), O();
451
+ set buttons(g) {
452
+ r(g), F();
379
453
  }
380
454
  };
381
- oe();
382
- var v = va(), o = U(v), h = G(o, 2), _ = G(h, 2);
383
- return Je(_, 1, r, ze, (E, l) => {
384
- var c = ua(), n = U(c, !0);
385
- V(c), $e(() => {
386
- ta(c, 1, ea((M(l), L(() => M(l).style)))), na(c, "title", (M(l), L(() => M(l).text))), Ke(n, (M(l), L(() => M(l).text)));
387
- }), $("click", c, function(...f) {
388
- M(l).handler?.apply(this, f);
389
- }), F(E, c);
390
- }), V(v), $("click", o, s), $("click", h, i), F(e, v), ce(u);
455
+ ce();
456
+ var i = ct(), c = B(i), v = Z(c, 2), m = Z(v, 2);
457
+ return Ze(m, 1, r, Je, (g, u) => {
458
+ var d = ot(), f = B(d, !0);
459
+ U(d), qe(() => {
460
+ rt(d, 1, tt((x(u), L(() => x(u).style)))), lt(d, "title", (x(u), L(() => x(u).text))), Ke(f, (x(u), L(() => x(u).text)));
461
+ }), K("click", d, function(...o) {
462
+ x(u).handler?.apply(this, o);
463
+ }), V(g, d);
464
+ }), U(i), K("click", c, s), K("click", v, n), V(e, i), ve(l);
391
465
  }
392
- ve(me, { buttons: {} }, [], [], !0);
393
- var oa = q("<textarea></textarea>"), ca = q('<main><div class="Editor"><!></div> <!></main>');
394
- function da(e, t) {
395
- de(t, !1);
396
- let a = P(t, "value", 12, ""), r = P(t, "buttons", 28, () => []), s = P(t, "html", 12, !0);
397
- function i() {
466
+ oe(me, { buttons: {} }, [], [], !0);
467
+ var vt = Y("<textarea></textarea>"), ht = Y('<main><div class="Editor"><!></div> <!></main>');
468
+ function dt(e, a) {
469
+ he(a, !1);
470
+ let t = P(a, "value", 12, ""), r = P(a, "buttons", 28, () => []), s = P(a, "html", 12, !0);
471
+ function n() {
398
472
  s() || s(!0);
399
473
  }
400
- function u() {
401
- s() && (a(a().replace(/<[^>]*>?/gm, "")), s(!1));
474
+ function l() {
475
+ s() && (t(t().replace(/<[^>]*>?/gm, "")), s(!1));
402
476
  }
403
- var v = {
477
+ var i = {
404
478
  get value() {
405
- return a();
479
+ return t();
406
480
  },
407
- set value(n) {
408
- a(n), O();
481
+ set value(f) {
482
+ t(f), F();
409
483
  },
410
484
  get buttons() {
411
485
  return r();
412
486
  },
413
- set buttons(n) {
414
- r(n), O();
487
+ set buttons(f) {
488
+ r(f), F();
415
489
  },
416
490
  get html() {
417
491
  return s();
418
492
  },
419
- set html(n) {
420
- s(n), O();
493
+ set html(f) {
494
+ s(f), F();
421
495
  }
422
496
  };
423
- oe();
424
- var o = ca(), h = U(o), _ = U(h);
497
+ ce();
498
+ var c = ht(), v = B(c), m = B(v);
425
499
  {
426
- var E = (n) => {
427
- We(n, {
500
+ var g = (f) => {
501
+ We(f, {
428
502
  get value() {
429
- return a();
503
+ return t();
430
504
  },
431
- set value(f) {
432
- a(f);
505
+ set value(o) {
506
+ t(o);
433
507
  },
434
508
  $$legacy: !0
435
509
  });
436
- }, l = (n) => {
437
- var f = oa();
438
- Xe(f), fa(f, a), F(n, f);
510
+ }, u = (f) => {
511
+ var o = vt();
512
+ Xe(o), ut(o, t), V(f, o);
439
513
  };
440
- Ze(_, (n) => {
441
- s() ? n(E) : n(l, !1);
514
+ Ge(m, (f) => {
515
+ s() ? f(g) : f(u, !1);
442
516
  });
443
517
  }
444
- V(h);
445
- var c = G(h, 2);
446
- return me(c, {
518
+ U(v);
519
+ var d = Z(v, 2);
520
+ return me(d, {
447
521
  get buttons() {
448
522
  return r();
449
523
  },
450
- set buttons(n) {
451
- r(n);
524
+ set buttons(f) {
525
+ r(f);
452
526
  },
453
- $$events: { html: i, plain: u },
527
+ $$events: { html: n, plain: l },
454
528
  $$legacy: !0
455
- }), V(o), F(e, o), ce(v);
529
+ }), U(c), V(e, c), ve(i);
456
530
  }
457
- customElements.define("switchable-editor", ve(da, { value: {}, buttons: {}, html: {} }, [], [], !1));
531
+ customElements.define("switchable-editor", oe(dt, { value: {}, buttons: {}, html: {} }, [], [], !1));