nam-rich-text-editor 9.1.8 → 9.1.9
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.
- package/dist/rich-text-editor.es.js +784 -770
- package/dist/rich-text-editor.umd.js +4 -4
- package/package.json +1 -1
|
@@ -47,11 +47,11 @@ const no = {
|
|
|
47
47
|
};
|
|
48
48
|
const zn = ([h, v, p]) => {
|
|
49
49
|
const d = document.createElementNS("http://www.w3.org/2000/svg", h);
|
|
50
|
-
return Object.keys(v).forEach((
|
|
51
|
-
d.setAttribute(
|
|
52
|
-
}), p?.length && p.forEach((
|
|
53
|
-
const
|
|
54
|
-
d.appendChild(
|
|
50
|
+
return Object.keys(v).forEach((m) => {
|
|
51
|
+
d.setAttribute(m, String(v[m]));
|
|
52
|
+
}), p?.length && p.forEach((m) => {
|
|
53
|
+
const g = zn(m);
|
|
54
|
+
d.appendChild(g);
|
|
55
55
|
}), d;
|
|
56
56
|
}, ye = (h, v = {}) => {
|
|
57
57
|
const d = {
|
|
@@ -159,12 +159,12 @@ const xo = [
|
|
|
159
159
|
["path", { d: "M3 12h18" }],
|
|
160
160
|
["path", { d: "M3 19h18" }]
|
|
161
161
|
];
|
|
162
|
-
const
|
|
162
|
+
const wo = [
|
|
163
163
|
["path", { d: "M21 5H3" }],
|
|
164
164
|
["path", { d: "M15 12H3" }],
|
|
165
165
|
["path", { d: "M17 19H3" }]
|
|
166
166
|
];
|
|
167
|
-
const
|
|
167
|
+
const Eo = [
|
|
168
168
|
["path", { d: "M6 4v6a6 6 0 0 0 12 0V4" }],
|
|
169
169
|
["line", { x1: "4", x2: "20", y1: "20", y2: "20" }]
|
|
170
170
|
];
|
|
@@ -181,15 +181,15 @@ function So() {
|
|
|
181
181
|
return [
|
|
182
182
|
{ command: "bold", icon: ro, title: "Bold" },
|
|
183
183
|
{ command: "italic", icon: io, title: "Italic" },
|
|
184
|
-
{ command: "underline", icon:
|
|
184
|
+
{ command: "underline", icon: Eo, title: "Underline" },
|
|
185
185
|
{ command: "strikeThrough", icon: go, title: "Strikethrough" }
|
|
186
186
|
].forEach((p) => {
|
|
187
187
|
const d = document.createElement("div");
|
|
188
|
-
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (
|
|
189
|
-
(
|
|
188
|
+
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (g) => {
|
|
189
|
+
(g.key === "Enter" || g.key === " ") && (g.preventDefault(), d.click());
|
|
190
190
|
});
|
|
191
|
-
const
|
|
192
|
-
d.appendChild(
|
|
191
|
+
const m = ye(p.icon, { width: 16, height: 16 });
|
|
192
|
+
d.appendChild(m), d.title = p.title, d.style.fontWeight = p.command === "bold" ? "bold" : "normal", d.style.fontStyle = p.command === "italic" ? "italic" : "normal", d.style.textDecoration = p.command === "underline" ? "underline" : "none", d.style.border = "1px solid #e1e1e1", d.style.backgroundColor = "#ffffff", d.style.padding = "6px 10px", d.style.borderRadius = "3px", d.style.cursor = "pointer", d.style.color = "#000000", d.onmouseover = () => d.style.backgroundColor = "#f0f0f0", d.onmouseout = () => d.style.backgroundColor = "#ffffff", d.onclick = () => document.execCommand(p.command), h.appendChild(d);
|
|
193
193
|
}), h;
|
|
194
194
|
}
|
|
195
195
|
let Je = null;
|
|
@@ -214,18 +214,18 @@ function Ln(h, v) {
|
|
|
214
214
|
if (!p || p.rangeCount === 0) return;
|
|
215
215
|
const d = p.getRangeAt(0);
|
|
216
216
|
if (!d.collapsed) {
|
|
217
|
-
const
|
|
218
|
-
|
|
217
|
+
const w = document.createElement("span");
|
|
218
|
+
w.style[h] = v;
|
|
219
219
|
const x = d.extractContents();
|
|
220
|
-
|
|
221
|
-
const
|
|
222
|
-
|
|
220
|
+
w.appendChild(x), d.insertNode(w), p.removeAllRanges();
|
|
221
|
+
const T = document.createRange();
|
|
222
|
+
T.selectNodeContents(w), p.addRange(T), pe(T);
|
|
223
223
|
return;
|
|
224
224
|
}
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
const
|
|
228
|
-
|
|
225
|
+
const m = document.createElement("span");
|
|
226
|
+
m.style[h] = v, m.appendChild(document.createTextNode("")), d.insertNode(m), p.removeAllRanges();
|
|
227
|
+
const g = document.createRange();
|
|
228
|
+
g.setStart(m.firstChild, 0), g.setEnd(m.firstChild, 0), p.addRange(g), pe(g);
|
|
229
229
|
}
|
|
230
230
|
function To(h) {
|
|
231
231
|
Ln("color", h);
|
|
@@ -237,19 +237,19 @@ function Mo() {
|
|
|
237
237
|
const h = document.createDocumentFragment(), v = document.createElement("input");
|
|
238
238
|
v.type = "color", v.style.display = "none", v.title = "Text Color";
|
|
239
239
|
const p = document.createElement("div");
|
|
240
|
-
p.setAttribute("role", "button"), p.tabIndex = 0, p.style.userSelect = "none", p.addEventListener("keydown", (
|
|
241
|
-
(
|
|
240
|
+
p.setAttribute("role", "button"), p.tabIndex = 0, p.style.userSelect = "none", p.addEventListener("keydown", (g) => {
|
|
241
|
+
(g.key === "Enter" || g.key === " ") && (g.preventDefault(), p.click());
|
|
242
242
|
}), p.textContent = "A", p.style.color = "#000", p.style.fontSize = "16px", p.style.fontWeight = "bold", p.style.border = "1px solid #ccc", p.style.borderRadius = "4px", p.style.padding = "4px 8px", p.style.cursor = "pointer", p.style.backgroundColor = "#fff", p.title = "Text Color", p.onclick = () => v.click(), v.onchange = () => {
|
|
243
243
|
Ne(), To(v.value), p.style.color = v.value;
|
|
244
244
|
}, h.appendChild(p), h.appendChild(v);
|
|
245
245
|
const d = document.createElement("input");
|
|
246
246
|
d.type = "color", d.style.display = "none", d.title = "Background Color";
|
|
247
|
-
const
|
|
248
|
-
return
|
|
249
|
-
(
|
|
250
|
-
}),
|
|
251
|
-
Ne(), _o(d.value),
|
|
252
|
-
}, h.appendChild(
|
|
247
|
+
const m = document.createElement("div");
|
|
248
|
+
return m.setAttribute("role", "button"), m.tabIndex = 0, m.style.userSelect = "none", m.addEventListener("keydown", (g) => {
|
|
249
|
+
(g.key === "Enter" || g.key === " ") && (g.preventDefault(), m.click());
|
|
250
|
+
}), m.textContent = "BA", m.style.color = "#000", m.style.fontSize = "14px", m.style.fontWeight = "bold", m.style.border = "1px solid #ccc", m.style.borderRadius = "4px", m.style.padding = "4px 6px", m.style.cursor = "pointer", m.style.backgroundColor = "#fff", m.title = "Background Color", m.onclick = () => d.click(), d.onchange = () => {
|
|
251
|
+
Ne(), _o(d.value), m.style.backgroundColor = d.value, m.style.color = "#000";
|
|
252
|
+
}, h.appendChild(m), h.appendChild(d), h;
|
|
253
253
|
}
|
|
254
254
|
function Ro() {
|
|
255
255
|
const h = document.createDocumentFragment();
|
|
@@ -257,7 +257,7 @@ function Ro() {
|
|
|
257
257
|
{
|
|
258
258
|
command: "justifyLeft",
|
|
259
259
|
align: "left",
|
|
260
|
-
icon:
|
|
260
|
+
icon: wo,
|
|
261
261
|
title: "Align Left"
|
|
262
262
|
},
|
|
263
263
|
{
|
|
@@ -280,38 +280,38 @@ function Ro() {
|
|
|
280
280
|
}
|
|
281
281
|
].forEach((p) => {
|
|
282
282
|
const d = document.createElement("div");
|
|
283
|
-
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (
|
|
284
|
-
(
|
|
283
|
+
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (g) => {
|
|
284
|
+
(g.key === "Enter" || g.key === " ") && (g.preventDefault(), d.click());
|
|
285
285
|
});
|
|
286
|
-
const
|
|
287
|
-
d.appendChild(
|
|
288
|
-
const
|
|
289
|
-
if (
|
|
290
|
-
let x =
|
|
286
|
+
const m = ye(p.icon, { width: 16, height: 16 });
|
|
287
|
+
d.appendChild(m), d.title = p.title, d.style.border = "1px solid #e1e1e1", d.style.backgroundColor = "#ffffff", d.style.padding = "6px 10px", d.style.borderRadius = "3px", d.style.cursor = "pointer", d.style.color = "#000000", d.onmouseover = () => d.style.backgroundColor = "#f0f0f0", d.onmouseout = () => d.style.backgroundColor = "#ffffff", d.onclick = () => {
|
|
288
|
+
const g = window.getSelection();
|
|
289
|
+
if (g && g.rangeCount > 0) {
|
|
290
|
+
let x = g.anchorNode;
|
|
291
291
|
for (; x && x.nodeType !== Node.ELEMENT_NODE; )
|
|
292
292
|
x = x.parentNode;
|
|
293
|
-
let
|
|
294
|
-
for (;
|
|
295
|
-
if ((
|
|
296
|
-
_ =
|
|
293
|
+
let T = x, _ = null;
|
|
294
|
+
for (; T && T !== document.body && !T.classList.contains("editor"); ) {
|
|
295
|
+
if ((T.tagName === "DIV" || T.tagName === "P") && T.querySelector(".editor-image-wrapper")) {
|
|
296
|
+
_ = T;
|
|
297
297
|
break;
|
|
298
298
|
}
|
|
299
|
-
if (
|
|
300
|
-
_ =
|
|
299
|
+
if (T.tagName === "P") {
|
|
300
|
+
_ = T;
|
|
301
301
|
break;
|
|
302
302
|
}
|
|
303
|
-
|
|
303
|
+
T = T.parentElement;
|
|
304
304
|
}
|
|
305
305
|
if (_) {
|
|
306
306
|
_.style.textAlign = p.align;
|
|
307
|
-
const
|
|
308
|
-
|
|
307
|
+
const M = d.closest(".editor-container")?.querySelector(".editor");
|
|
308
|
+
M && M.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
309
309
|
return;
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
312
|
document.execCommand(p.command);
|
|
313
|
-
const
|
|
314
|
-
|
|
313
|
+
const w = d.closest(".editor-container")?.querySelector(".editor");
|
|
314
|
+
w && w.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
315
315
|
}, h.appendChild(d);
|
|
316
316
|
}), h;
|
|
317
317
|
}
|
|
@@ -322,11 +322,11 @@ function Ao() {
|
|
|
322
322
|
{ command: "insertOrderedList", icon: co, title: "Numbered List" }
|
|
323
323
|
].forEach((p) => {
|
|
324
324
|
const d = document.createElement("div");
|
|
325
|
-
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (
|
|
326
|
-
(
|
|
325
|
+
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (g) => {
|
|
326
|
+
(g.key === "Enter" || g.key === " ") && (g.preventDefault(), d.click());
|
|
327
327
|
});
|
|
328
|
-
const
|
|
329
|
-
d.appendChild(
|
|
328
|
+
const m = ye(p.icon, { width: 16, height: 16 });
|
|
329
|
+
d.appendChild(m), d.title = p.title, d.style.border = "1px solid #e1e1e1", d.style.backgroundColor = "#ffffff", d.style.padding = "6px 10px", d.style.borderRadius = "3px", d.style.cursor = "pointer", d.style.color = "#000000", d.onmouseover = () => d.style.backgroundColor = "#f0f0f0", d.onmouseout = () => d.style.backgroundColor = "#ffffff", d.onclick = () => document.execCommand(p.command), h.appendChild(d);
|
|
330
330
|
}), h;
|
|
331
331
|
}
|
|
332
332
|
function Po() {
|
|
@@ -336,11 +336,11 @@ function Po() {
|
|
|
336
336
|
{ command: "outdent", icon: so, title: "Decrease Indent" }
|
|
337
337
|
].forEach((p) => {
|
|
338
338
|
const d = document.createElement("div");
|
|
339
|
-
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (
|
|
340
|
-
(
|
|
339
|
+
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (g) => {
|
|
340
|
+
(g.key === "Enter" || g.key === " ") && (g.preventDefault(), d.click());
|
|
341
341
|
});
|
|
342
|
-
const
|
|
343
|
-
d.appendChild(
|
|
342
|
+
const m = ye(p.icon, { width: 16, height: 16 });
|
|
343
|
+
d.appendChild(m), d.title = p.title, d.style.border = "1px solid #e1e1e1", d.style.backgroundColor = "#ffffff", d.style.padding = "6px 10px", d.style.borderRadius = "3px", d.style.cursor = "pointer", d.style.color = "#000000", d.onmouseover = () => d.style.backgroundColor = "#f0f0f0", d.onmouseout = () => d.style.backgroundColor = "#ffffff", d.onclick = () => document.execCommand(p.command), h.appendChild(d);
|
|
344
344
|
}), h;
|
|
345
345
|
}
|
|
346
346
|
function Io() {
|
|
@@ -350,11 +350,11 @@ function Io() {
|
|
|
350
350
|
{ command: "redo", icon: vo, title: "Redo" }
|
|
351
351
|
].forEach((p) => {
|
|
352
352
|
const d = document.createElement("div");
|
|
353
|
-
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (
|
|
354
|
-
(
|
|
353
|
+
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (g) => {
|
|
354
|
+
(g.key === "Enter" || g.key === " ") && (g.preventDefault(), d.click());
|
|
355
355
|
});
|
|
356
|
-
const
|
|
357
|
-
d.appendChild(
|
|
356
|
+
const m = ye(p.icon, { width: 16, height: 16 });
|
|
357
|
+
d.appendChild(m), d.title = p.title, d.style.border = "1px solid #e1e1e1", d.style.backgroundColor = "#ffffff", d.style.padding = "6px 10px", d.style.borderRadius = "3px", d.style.cursor = "pointer", d.style.color = "#000000", d.onmouseover = () => d.style.backgroundColor = "#f0f0f0", d.onmouseout = () => d.style.backgroundColor = "#ffffff", d.onclick = () => document.execCommand(p.command), h.appendChild(d);
|
|
358
358
|
}), h;
|
|
359
359
|
}
|
|
360
360
|
function Oo() {
|
|
@@ -367,8 +367,8 @@ function Oo() {
|
|
|
367
367
|
}
|
|
368
368
|
function Do() {
|
|
369
369
|
const h = document.createElement("div");
|
|
370
|
-
h.setAttribute("role", "button"), h.tabIndex = 0, h.style.userSelect = "none", h.addEventListener("keydown", (
|
|
371
|
-
(
|
|
370
|
+
h.setAttribute("role", "button"), h.tabIndex = 0, h.style.userSelect = "none", h.addEventListener("keydown", (w) => {
|
|
371
|
+
(w.key === "Enter" || w.key === " ") && (w.preventDefault(), h.click());
|
|
372
372
|
});
|
|
373
373
|
const v = ye(po, {
|
|
374
374
|
width: 16,
|
|
@@ -378,27 +378,27 @@ function Do() {
|
|
|
378
378
|
height: 16
|
|
379
379
|
});
|
|
380
380
|
h.appendChild(v), h.title = "Toggle Fullscreen", h.style.border = "1px solid #e1e1e1", h.style.backgroundColor = "#ffffff", h.style.padding = "6px 10px", h.style.borderRadius = "3px", h.style.cursor = "pointer", h.style.color = "#000000", h.onmouseover = () => h.style.backgroundColor = "#f0f0f0", h.onmouseout = () => h.style.backgroundColor = "#ffffff";
|
|
381
|
-
let d = !1,
|
|
381
|
+
let d = !1, m = "", g = "";
|
|
382
382
|
return h.onclick = () => {
|
|
383
|
-
const
|
|
383
|
+
const w = h.closest(
|
|
384
384
|
".editor-container"
|
|
385
385
|
);
|
|
386
|
-
if (!
|
|
387
|
-
const x =
|
|
386
|
+
if (!w) return;
|
|
387
|
+
const x = w.querySelector(".editor");
|
|
388
388
|
if (d)
|
|
389
|
-
|
|
389
|
+
m ? w.setAttribute("style", m) : w.removeAttribute("style"), x && (g ? x.setAttribute("style", g) : x.removeAttribute("style")), h.replaceChild(v, p), d = !1;
|
|
390
390
|
else {
|
|
391
|
-
|
|
391
|
+
m = w.getAttribute("style") || "", g = x && x.getAttribute("style") || "", w.style.position = "fixed", w.style.top = "0", w.style.left = "0", w.style.width = "100vw", w.style.height = "100vh", w.style.margin = "0", w.style.padding = "0";
|
|
392
392
|
try {
|
|
393
|
-
let
|
|
393
|
+
let T = 9998;
|
|
394
394
|
document.querySelectorAll("body *").forEach((_) => {
|
|
395
|
-
const
|
|
396
|
-
!isNaN(
|
|
397
|
-
}),
|
|
395
|
+
const M = window.getComputedStyle(_).getPropertyValue("z-index"), L = parseInt(M, 10);
|
|
396
|
+
!isNaN(L) && L > 0 && (T = Math.max(T, L));
|
|
397
|
+
}), w.style.zIndex = String(Math.max(T + 1, 9999));
|
|
398
398
|
} catch {
|
|
399
|
-
|
|
399
|
+
w.style.zIndex = "9999";
|
|
400
400
|
}
|
|
401
|
-
|
|
401
|
+
w.style.backgroundColor = "#ffffff", w.style.display = "flex", w.style.flexDirection = "column", w.style.boxSizing = "border-box", x && (x.style.flex = "1 1 0", x.style.overflowY = "auto", x.style.border = "none", x.style.borderRadius = "0", x.style.boxShadow = "none", x.style.height = "", x.style.minHeight = "0", x.style.maxHeight = "none", x.style.padding = "20px", x.style.boxSizing = "border-box"), h.replaceChild(p, v), d = !0;
|
|
402
402
|
}
|
|
403
403
|
}, h;
|
|
404
404
|
}
|
|
@@ -407,81 +407,81 @@ function No(h) {
|
|
|
407
407
|
p.style.position = "fixed", p.style.top = "0", p.style.left = "0", p.style.width = "100%", p.style.height = "100%", p.style.backgroundColor = "rgba(0, 0, 0, 0.5)", p.style.display = "none", p.style.zIndex = "1000", p.style.alignItems = "center", p.style.justifyContent = "center", p.style.flexDirection = "column";
|
|
408
408
|
const d = document.createElement("div");
|
|
409
409
|
d.style.backgroundColor = "#fff", d.style.padding = "20px", d.style.borderRadius = "8px", d.style.boxShadow = "0 4px 6px rgba(0, 0, 0, 0.1)", d.style.minWidth = "300px";
|
|
410
|
-
const
|
|
411
|
-
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
const
|
|
415
|
-
|
|
410
|
+
const m = document.createElement("h3");
|
|
411
|
+
m.textContent = "Insert Hyperlink", m.style.margin = "0 0 15px 0", m.style.fontSize = "18px", m.style.fontWeight = "bold";
|
|
412
|
+
const g = document.createElement("input");
|
|
413
|
+
g.type = "url", g.placeholder = "Enter URL (e.g., https://example.com)", g.style.width = "100%", g.style.padding = "8px", g.style.border = "1px solid #ccc", g.style.borderRadius = "4px", g.style.marginBottom = "15px", g.style.boxSizing = "border-box";
|
|
414
|
+
const w = document.createElement("div");
|
|
415
|
+
w.style.display = "flex", w.style.gap = "10px", w.style.justifyContent = "flex-end";
|
|
416
416
|
const x = document.createElement("div");
|
|
417
|
-
x.setAttribute("role", "button"), x.tabIndex = 0, x.style.userSelect = "none", x.textContent = "Cancel", x.style.padding = "8px 16px", x.style.border = "1px solid #ccc", x.style.borderRadius = "4px", x.style.backgroundColor = "#f5f5f5", x.style.cursor = "pointer", x.addEventListener("keydown", (
|
|
418
|
-
(
|
|
417
|
+
x.setAttribute("role", "button"), x.tabIndex = 0, x.style.userSelect = "none", x.textContent = "Cancel", x.style.padding = "8px 16px", x.style.border = "1px solid #ccc", x.style.borderRadius = "4px", x.style.backgroundColor = "#f5f5f5", x.style.cursor = "pointer", x.addEventListener("keydown", (A) => {
|
|
418
|
+
(A.key === "Enter" || A.key === " " || A.key === "Escape") && (A.preventDefault(), x.click());
|
|
419
419
|
}), x.onclick = () => {
|
|
420
|
-
p.style.display = "none",
|
|
420
|
+
p.style.display = "none", g.value = "", T = null;
|
|
421
421
|
};
|
|
422
|
-
let
|
|
422
|
+
let T = null;
|
|
423
423
|
const _ = document.createElement("div");
|
|
424
|
-
_.setAttribute("role", "button"), _.tabIndex = 0, _.style.userSelect = "none", _.textContent = "Insert", _.style.padding = "8px 16px", _.style.border = "none", _.style.borderRadius = "4px", _.style.backgroundColor = "#007bff", _.style.color = "#fff", _.style.cursor = "pointer", _.addEventListener("keydown", (
|
|
425
|
-
(
|
|
424
|
+
_.setAttribute("role", "button"), _.tabIndex = 0, _.style.userSelect = "none", _.textContent = "Insert", _.style.padding = "8px 16px", _.style.border = "none", _.style.borderRadius = "4px", _.style.backgroundColor = "#007bff", _.style.color = "#fff", _.style.cursor = "pointer", _.addEventListener("keydown", (A) => {
|
|
425
|
+
(A.key === "Enter" || A.key === " ") && (A.preventDefault(), _.click());
|
|
426
426
|
}), _.onclick = () => {
|
|
427
|
-
const
|
|
428
|
-
if (
|
|
429
|
-
if (
|
|
430
|
-
|
|
427
|
+
const A = g.value.trim();
|
|
428
|
+
if (A)
|
|
429
|
+
if (T)
|
|
430
|
+
T.setAttribute("href", A), T.setAttribute("target", "_blank"), T.setAttribute("rel", "noopener noreferrer"), T.setAttribute("tabindex", "0");
|
|
431
431
|
else {
|
|
432
|
-
Ne(), document.execCommand("createLink", !1,
|
|
433
|
-
const
|
|
434
|
-
if (
|
|
435
|
-
let
|
|
436
|
-
for (;
|
|
437
|
-
|
|
438
|
-
let
|
|
439
|
-
for (;
|
|
440
|
-
if (
|
|
441
|
-
const Q =
|
|
432
|
+
Ne(), document.execCommand("createLink", !1, A);
|
|
433
|
+
const D = window.getSelection();
|
|
434
|
+
if (D && D.rangeCount > 0) {
|
|
435
|
+
let B = D.getRangeAt(0).startContainer;
|
|
436
|
+
for (; B && B.nodeType !== Node.ELEMENT_NODE; )
|
|
437
|
+
B = B.parentNode;
|
|
438
|
+
let q = B;
|
|
439
|
+
for (; q && q !== document.body; ) {
|
|
440
|
+
if (q.tagName === "A") {
|
|
441
|
+
const Q = q;
|
|
442
442
|
Q.setAttribute("target", "_blank"), Q.setAttribute("rel", "noopener noreferrer"), Q.setAttribute("tabindex", "0");
|
|
443
443
|
break;
|
|
444
444
|
}
|
|
445
|
-
|
|
445
|
+
q = q.parentElement;
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
|
-
p.style.display = "none",
|
|
450
|
-
},
|
|
451
|
-
|
|
449
|
+
p.style.display = "none", g.value = "", T = null;
|
|
450
|
+
}, w.appendChild(x), w.appendChild(_), d.appendChild(m), d.appendChild(g), d.appendChild(w), p.appendChild(d), document.body.appendChild(p), g.onkeydown = (A) => {
|
|
451
|
+
A.key === "Enter" ? _.click() : A.key === "Escape" && x.click();
|
|
452
452
|
};
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
-
const
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
const
|
|
459
|
-
if (
|
|
460
|
-
let
|
|
461
|
-
for (;
|
|
462
|
-
|
|
463
|
-
let
|
|
464
|
-
for (;
|
|
465
|
-
if (
|
|
466
|
-
|
|
453
|
+
const M = document.createElement("div");
|
|
454
|
+
M.setAttribute("role", "button"), M.tabIndex = 0, M.style.userSelect = "none";
|
|
455
|
+
const L = ye(ao, { width: 16, height: 16 });
|
|
456
|
+
M.appendChild(L), M.title = "Insert Hyperlink", M.style.border = "1px solid #e1e1e1", M.style.backgroundColor = "#ffffff", M.style.padding = "6px 10px", M.style.borderRadius = "3px", M.style.cursor = "pointer", M.style.color = "#000000", M.onmouseover = () => M.style.backgroundColor = "#f0f0f0", M.onmouseout = () => M.style.backgroundColor = "#ffffff", M.onmousedown = () => {
|
|
457
|
+
T = null;
|
|
458
|
+
const A = window.getSelection();
|
|
459
|
+
if (A && A.rangeCount > 0) {
|
|
460
|
+
let B = A.getRangeAt(0).startContainer;
|
|
461
|
+
for (; B && B.nodeType !== Node.ELEMENT_NODE; )
|
|
462
|
+
B = B.parentNode;
|
|
463
|
+
let q = B;
|
|
464
|
+
for (; q && q !== document.body; ) {
|
|
465
|
+
if (q.tagName === "A") {
|
|
466
|
+
T = q, g.value = T.getAttribute("href") || "";
|
|
467
467
|
break;
|
|
468
468
|
}
|
|
469
|
-
|
|
469
|
+
q = q.parentElement;
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
472
|
pe();
|
|
473
|
-
},
|
|
474
|
-
(
|
|
475
|
-
}),
|
|
476
|
-
p.style.display = "flex",
|
|
477
|
-
}, v.appendChild(
|
|
478
|
-
const
|
|
479
|
-
return
|
|
480
|
-
const
|
|
481
|
-
if (
|
|
482
|
-
|
|
483
|
-
const
|
|
484
|
-
|
|
473
|
+
}, M.addEventListener("keydown", (A) => {
|
|
474
|
+
(A.key === "Enter" || A.key === " ") && (A.preventDefault(), M.click());
|
|
475
|
+
}), M.onclick = () => {
|
|
476
|
+
p.style.display = "flex", g.focus();
|
|
477
|
+
}, v.appendChild(M);
|
|
478
|
+
const X = h.querySelector(".editor");
|
|
479
|
+
return X && X.addEventListener("click", (A) => {
|
|
480
|
+
const D = A.target;
|
|
481
|
+
if (D.tagName === "A") {
|
|
482
|
+
A.preventDefault();
|
|
483
|
+
const B = D.getAttribute("href");
|
|
484
|
+
B && window.open(B, "_blank");
|
|
485
485
|
}
|
|
486
486
|
}), v;
|
|
487
487
|
}
|
|
@@ -494,36 +494,36 @@ function zo() {
|
|
|
494
494
|
v.appendChild(p), v.title = "Insert Quote", v.style.border = "1px solid #e1e1e1", v.style.backgroundColor = "#ffffff", v.style.padding = "6px 10px", v.style.borderRadius = "3px", v.style.cursor = "pointer", v.style.color = "#000000", v.onmouseover = () => v.style.backgroundColor = "#f0f0f0", v.onmouseout = () => v.style.backgroundColor = "#ffffff";
|
|
495
495
|
const d = document.createElement("div");
|
|
496
496
|
d.className = "rte-modal-overlay", d.style.display = "none";
|
|
497
|
-
const g = document.createElement("div");
|
|
498
|
-
g.className = "rte-modal";
|
|
499
497
|
const m = document.createElement("div");
|
|
500
|
-
m.className = "rte-modal
|
|
501
|
-
const
|
|
502
|
-
|
|
498
|
+
m.className = "rte-modal";
|
|
499
|
+
const g = document.createElement("div");
|
|
500
|
+
g.className = "rte-modal-header";
|
|
501
|
+
const w = document.createElement("h3");
|
|
502
|
+
w.textContent = "Insert Quote", w.className = "rte-modal-title";
|
|
503
503
|
const x = document.createElement("div");
|
|
504
504
|
x.setAttribute("role", "button"), x.tabIndex = 0, x.style.userSelect = "none", x.className = "rte-modal-close", x.innerHTML = "×", x.onclick = () => {
|
|
505
505
|
d.style.display = "none", ne = null;
|
|
506
|
-
},
|
|
507
|
-
const
|
|
508
|
-
|
|
506
|
+
}, g.appendChild(w), g.appendChild(x);
|
|
507
|
+
const T = document.createElement("div");
|
|
508
|
+
T.className = "rte-modal-form";
|
|
509
509
|
const _ = document.createElement("label");
|
|
510
510
|
_.textContent = "Title", _.className = "rte-label";
|
|
511
|
-
const
|
|
512
|
-
|
|
513
|
-
const
|
|
514
|
-
|
|
515
|
-
const
|
|
516
|
-
|
|
517
|
-
const
|
|
518
|
-
|
|
511
|
+
const M = document.createElement("input");
|
|
512
|
+
M.type = "text", M.placeholder = "e.g., Article title or source", M.className = "rte-input";
|
|
513
|
+
const L = document.createElement("label");
|
|
514
|
+
L.textContent = "Source URL", L.className = "rte-label";
|
|
515
|
+
const X = document.createElement("input");
|
|
516
|
+
X.type = "url", X.placeholder = "https://example.com", X.className = "rte-input";
|
|
517
|
+
const A = document.createElement("div");
|
|
518
|
+
A.className = "rte-preview-label", A.textContent = "Preview";
|
|
519
|
+
const D = document.createElement("div");
|
|
520
|
+
D.className = "rte-modal-preview";
|
|
521
|
+
const B = document.createElement("div");
|
|
522
|
+
B.className = "rte-blockquote-title";
|
|
519
523
|
const q = document.createElement("div");
|
|
520
|
-
q.className = "rte-
|
|
521
|
-
const H = document.createElement("div");
|
|
522
|
-
H.className = "rte-blockquote-title";
|
|
523
|
-
const U = document.createElement("div");
|
|
524
|
-
U.className = "rte-blockquote-content";
|
|
524
|
+
q.className = "rte-blockquote-content";
|
|
525
525
|
const Q = document.createElement("div");
|
|
526
|
-
Q.className = "rte-blockquote-footer",
|
|
526
|
+
Q.className = "rte-blockquote-footer", D.appendChild(B), D.appendChild(q), D.appendChild(Q), T.appendChild(_), T.appendChild(M), T.appendChild(L), T.appendChild(X), T.appendChild(A), T.appendChild(D);
|
|
527
527
|
const J = document.createElement("div");
|
|
528
528
|
J.className = "rte-modal-actions";
|
|
529
529
|
const re = document.createElement("div");
|
|
@@ -536,31 +536,31 @@ function zo() {
|
|
|
536
536
|
};
|
|
537
537
|
const ie = document.createElement("div");
|
|
538
538
|
ie.setAttribute("role", "button"), ie.tabIndex = 0, ie.style.userSelect = "none", ie.className = "rte-btn-primary", ie.textContent = "Apply", ie.onclick = () => {
|
|
539
|
-
const Z =
|
|
540
|
-
let
|
|
541
|
-
if (
|
|
539
|
+
const Z = M.value.trim();
|
|
540
|
+
let F = X.value.trim();
|
|
541
|
+
if (F && !/^https?:\/\//i.test(F) && (F = `https://${F}`), ne) {
|
|
542
542
|
const le = ne.querySelector(
|
|
543
543
|
".rte-blockquote-title"
|
|
544
544
|
);
|
|
545
545
|
if (Z)
|
|
546
546
|
if (le) le.textContent = Z;
|
|
547
547
|
else {
|
|
548
|
-
const
|
|
549
|
-
|
|
548
|
+
const U = document.createElement("div");
|
|
549
|
+
U.className = "rte-blockquote-title", U.textContent = Z, ne.insertBefore(U, ne.firstChild);
|
|
550
550
|
}
|
|
551
551
|
else le && le.remove();
|
|
552
552
|
const ce = ne.querySelector(
|
|
553
553
|
".rte-blockquote-footer"
|
|
554
554
|
);
|
|
555
|
-
if (
|
|
555
|
+
if (F)
|
|
556
556
|
if (ce) {
|
|
557
|
-
const
|
|
558
|
-
|
|
557
|
+
const U = ce.querySelector("a");
|
|
558
|
+
U.href = F, U.textContent = F;
|
|
559
559
|
} else {
|
|
560
|
-
const
|
|
561
|
-
|
|
562
|
-
const
|
|
563
|
-
|
|
560
|
+
const U = document.createElement("footer");
|
|
561
|
+
U.className = "rte-blockquote-footer";
|
|
562
|
+
const G = document.createElement("cite"), V = document.createElement("a");
|
|
563
|
+
V.href = F, V.textContent = F, V.target = "_blank", V.rel = "noopener noreferrer", G.appendChild(V), U.appendChild(G), ne.appendChild(U);
|
|
564
564
|
}
|
|
565
565
|
else ce && ce.remove();
|
|
566
566
|
} else {
|
|
@@ -570,61 +570,61 @@ function zo() {
|
|
|
570
570
|
d.style.display = "none";
|
|
571
571
|
return;
|
|
572
572
|
}
|
|
573
|
-
const ce = le.getRangeAt(0),
|
|
574
|
-
if (
|
|
573
|
+
const ce = le.getRangeAt(0), U = ce.extractContents(), G = document.createElement("blockquote");
|
|
574
|
+
if (G.className = "rte-blockquote", Z) {
|
|
575
575
|
const ee = document.createElement("div");
|
|
576
|
-
ee.className = "rte-blockquote-title", ee.textContent = Z,
|
|
576
|
+
ee.className = "rte-blockquote-title", ee.textContent = Z, G.appendChild(ee);
|
|
577
577
|
}
|
|
578
|
-
const
|
|
579
|
-
if (
|
|
578
|
+
const V = document.createElement("p");
|
|
579
|
+
if (V.appendChild(U), G.appendChild(V), F) {
|
|
580
580
|
const ee = document.createElement("footer");
|
|
581
581
|
ee.className = "rte-blockquote-footer";
|
|
582
582
|
const se = document.createElement("cite"), de = document.createElement("a");
|
|
583
|
-
de.href =
|
|
583
|
+
de.href = F, de.textContent = F, de.target = "_blank", de.rel = "noopener noreferrer", se.appendChild(de), ee.appendChild(se), G.appendChild(ee);
|
|
584
584
|
}
|
|
585
|
-
ce.insertNode(
|
|
585
|
+
ce.insertNode(G), le.removeAllRanges();
|
|
586
586
|
const oe = document.createRange();
|
|
587
|
-
oe.setStartAfter(
|
|
587
|
+
oe.setStartAfter(G), oe.collapse(!0), le.addRange(oe), pe(oe);
|
|
588
588
|
}
|
|
589
|
-
d.style.display = "none",
|
|
590
|
-
}, J.appendChild(re), J.appendChild(te), J.appendChild(ie),
|
|
589
|
+
d.style.display = "none", M.value = "", X.value = "", ne = null;
|
|
590
|
+
}, J.appendChild(re), J.appendChild(te), J.appendChild(ie), m.appendChild(g), m.appendChild(T), m.appendChild(J), d.appendChild(m), document.body.appendChild(d);
|
|
591
591
|
let ne = null, b = "";
|
|
592
592
|
return v.onmousedown = () => {
|
|
593
593
|
ne = null, b = "";
|
|
594
594
|
const Z = window.getSelection();
|
|
595
595
|
if (Z && Z.rangeCount > 0) {
|
|
596
|
-
const
|
|
597
|
-
le.appendChild(
|
|
598
|
-
let ce =
|
|
596
|
+
const F = Z.getRangeAt(0), le = document.createElement("div");
|
|
597
|
+
le.appendChild(F.cloneContents()), b = le.innerHTML || F.toString();
|
|
598
|
+
let ce = F.startContainer;
|
|
599
599
|
for (; ce && ce.nodeType !== Node.ELEMENT_NODE; )
|
|
600
600
|
ce = ce.parentNode;
|
|
601
|
-
let
|
|
602
|
-
for (;
|
|
603
|
-
if (
|
|
604
|
-
ne =
|
|
605
|
-
const
|
|
601
|
+
let U = ce;
|
|
602
|
+
for (; U && U !== document.body; ) {
|
|
603
|
+
if (U.tagName === "BLOCKQUOTE") {
|
|
604
|
+
ne = U;
|
|
605
|
+
const G = ne.querySelector(
|
|
606
606
|
".rte-blockquote-title"
|
|
607
|
-
),
|
|
607
|
+
), V = ne.querySelector(
|
|
608
608
|
".rte-blockquote-footer a"
|
|
609
609
|
);
|
|
610
|
-
|
|
610
|
+
M.value = G && G.textContent || "", X.value = V && V.href || "", re.style.display = "inline-block";
|
|
611
611
|
const oe = ne.querySelector("p");
|
|
612
|
-
|
|
612
|
+
q.innerHTML = oe ? oe.innerHTML : ne.innerHTML, B.textContent = G && G.textContent || "", Q.innerHTML = V ? `<a href="${V.href}">${V.href}</a>` : "";
|
|
613
613
|
break;
|
|
614
614
|
}
|
|
615
|
-
|
|
615
|
+
U = U.parentElement;
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
|
-
ne || (
|
|
619
|
-
},
|
|
620
|
-
const Z =
|
|
618
|
+
ne || (q.innerHTML = b || "<em>Selected text will appear here</em>", B.textContent = "", Q.innerHTML = "", re.style.display = "none"), pe();
|
|
619
|
+
}, M.oninput = () => B.textContent = M.value, X.oninput = () => {
|
|
620
|
+
const Z = X.value.trim();
|
|
621
621
|
if (!Z) Q.innerHTML = "";
|
|
622
622
|
else {
|
|
623
|
-
const
|
|
624
|
-
Q.innerHTML = `<a href="${
|
|
623
|
+
const F = /^https?:\/\//i.test(Z) ? Z : `https://${Z}`;
|
|
624
|
+
Q.innerHTML = `<a href="${F}" target="_blank" rel="noopener noreferrer">${F}</a>`;
|
|
625
625
|
}
|
|
626
626
|
}, v.onclick = () => {
|
|
627
|
-
d.style.display = "flex",
|
|
627
|
+
d.style.display = "flex", M.focus();
|
|
628
628
|
}, h.appendChild(v), h;
|
|
629
629
|
}
|
|
630
630
|
function Lo() {
|
|
@@ -640,74 +640,74 @@ function Fo(h) {
|
|
|
640
640
|
p.className = "rte-modal-overlay", p.style.display = "none";
|
|
641
641
|
const d = document.createElement("div");
|
|
642
642
|
d.className = "rte-modal";
|
|
643
|
-
const
|
|
644
|
-
|
|
645
|
-
const
|
|
646
|
-
|
|
647
|
-
const
|
|
648
|
-
|
|
643
|
+
const m = document.createElement("div");
|
|
644
|
+
m.className = "rte-modal-header";
|
|
645
|
+
const g = document.createElement("h3");
|
|
646
|
+
g.className = "rte-modal-title", g.textContent = "Insert Video";
|
|
647
|
+
const w = document.createElement("div");
|
|
648
|
+
w.setAttribute("role", "button"), w.tabIndex = 0, w.style.userSelect = "none", w.className = "rte-modal-close", w.innerHTML = "×", w.onclick = () => p.style.display = "none", m.appendChild(g), m.appendChild(w);
|
|
649
649
|
const x = document.createElement("div");
|
|
650
650
|
x.className = "rte-modal-form";
|
|
651
|
-
const
|
|
652
|
-
|
|
651
|
+
const T = document.createElement("label");
|
|
652
|
+
T.className = "rte-label", T.textContent = "Video URL";
|
|
653
653
|
const _ = document.createElement("input");
|
|
654
654
|
_.type = "url", _.className = "rte-input", _.placeholder = "https://... or YouTube URL";
|
|
655
|
+
const M = document.createElement("div");
|
|
656
|
+
M.className = "rte-preview-label", M.textContent = "Preview";
|
|
657
|
+
const L = document.createElement("div");
|
|
658
|
+
L.className = "rte-modal-preview";
|
|
659
|
+
const X = document.createElement("div");
|
|
660
|
+
X.className = "rte-form-left";
|
|
655
661
|
const A = document.createElement("div");
|
|
656
|
-
A.className = "rte-
|
|
657
|
-
const
|
|
658
|
-
|
|
659
|
-
const
|
|
660
|
-
|
|
661
|
-
const P = document.createElement("div");
|
|
662
|
-
P.className = "rte-form-right";
|
|
662
|
+
A.className = "rte-form-right";
|
|
663
|
+
const D = document.createElement("div");
|
|
664
|
+
D.className = "rte-field", D.appendChild(T), D.appendChild(_);
|
|
665
|
+
const B = document.createElement("div");
|
|
666
|
+
B.className = "rte-dim-row";
|
|
663
667
|
const q = document.createElement("div");
|
|
664
|
-
q.
|
|
665
|
-
const H = document.createElement("div");
|
|
666
|
-
H.className = "rte-dim-row";
|
|
667
|
-
const U = document.createElement("div");
|
|
668
|
-
U.style.display = "flex", U.style.flexDirection = "column";
|
|
668
|
+
q.style.display = "flex", q.style.flexDirection = "column";
|
|
669
669
|
const Q = document.createElement("label");
|
|
670
670
|
Q.className = "rte-label", Q.textContent = "Width (px)";
|
|
671
671
|
const J = document.createElement("input");
|
|
672
|
-
J.type = "text", J.className = "rte-dim-input", J.placeholder = "e.g., 560",
|
|
672
|
+
J.type = "text", J.className = "rte-dim-input", J.placeholder = "e.g., 560", q.appendChild(Q), q.appendChild(J);
|
|
673
673
|
const re = document.createElement("div");
|
|
674
674
|
re.style.display = "flex", re.style.flexDirection = "column";
|
|
675
675
|
const te = document.createElement("label");
|
|
676
676
|
te.className = "rte-label", te.textContent = "Height (px)";
|
|
677
677
|
const ie = document.createElement("input");
|
|
678
|
-
ie.type = "text", ie.className = "rte-dim-input", ie.placeholder = "e.g., 315", re.appendChild(te), re.appendChild(ie),
|
|
678
|
+
ie.type = "text", ie.className = "rte-dim-input", ie.placeholder = "e.g., 315", re.appendChild(te), re.appendChild(ie), B.appendChild(q), B.appendChild(re), X.appendChild(D), X.appendChild(B), A.appendChild(M), A.appendChild(L), x.appendChild(X), x.appendChild(A);
|
|
679
679
|
const ne = document.createElement("div");
|
|
680
680
|
ne.className = "rte-modal-actions";
|
|
681
681
|
const b = document.createElement("div");
|
|
682
682
|
b.setAttribute("role", "button"), b.tabIndex = 0, b.style.userSelect = "none", b.className = "rte-btn-muted", b.textContent = "Cancel", b.onclick = () => p.style.display = "none";
|
|
683
683
|
const Z = document.createElement("div");
|
|
684
|
-
Z.setAttribute("role", "button"), Z.tabIndex = 0, Z.style.userSelect = "none", Z.className = "rte-btn-primary", Z.textContent = "Insert", ne.appendChild(b), ne.appendChild(Z), d.appendChild(
|
|
685
|
-
const
|
|
686
|
-
|
|
684
|
+
Z.setAttribute("role", "button"), Z.tabIndex = 0, Z.style.userSelect = "none", Z.className = "rte-btn-primary", Z.textContent = "Insert", ne.appendChild(b), ne.appendChild(Z), d.appendChild(m), d.appendChild(x), d.appendChild(ne), p.appendChild(d), document.body.appendChild(p);
|
|
685
|
+
const F = document.createElement("div");
|
|
686
|
+
F.setAttribute("role", "button"), F.tabIndex = 0, F.style.userSelect = "none";
|
|
687
687
|
const le = ye(Co, { width: 16, height: 16 });
|
|
688
|
-
|
|
689
|
-
(
|
|
690
|
-
}),
|
|
691
|
-
|
|
688
|
+
F.appendChild(le), F.title = "Insert Video", F.style.border = "1px solid #e1e1e1", F.style.backgroundColor = "#ffffff", F.style.padding = "6px 10px", F.style.borderRadius = "3px", F.style.cursor = "pointer", F.style.color = "#000000", F.onmouseover = () => F.style.backgroundColor = "#f0f0f0", F.onmouseout = () => F.style.backgroundColor = "#ffffff", F.onmousedown = () => pe(), F.addEventListener("keydown", (G) => {
|
|
689
|
+
(G.key === "Enter" || G.key === " ") && (G.preventDefault(), F.click());
|
|
690
|
+
}), F.onclick = () => {
|
|
691
|
+
L.innerHTML = "<em>No URL entered</em>", _.value = "", p.style.display = "flex", _.focus();
|
|
692
692
|
};
|
|
693
693
|
const ce = () => {
|
|
694
|
-
const
|
|
695
|
-
if (!
|
|
696
|
-
|
|
694
|
+
const G = _.value.trim(), V = J && J.value.trim() || "", oe = ie && ie.value.trim() || "", ee = parseInt(V, 10), se = parseInt(oe, 10);
|
|
695
|
+
if (!G) {
|
|
696
|
+
L.innerHTML = "<em>No preview</em>";
|
|
697
697
|
return;
|
|
698
698
|
}
|
|
699
|
-
const de =
|
|
699
|
+
const de = G.match(/(?:youtube.com\/watch\?v=|youtu.be\/)([\w-]+)/i);
|
|
700
700
|
if (de) {
|
|
701
|
-
const
|
|
702
|
-
|
|
701
|
+
const E = de[1], N = Number.isFinite(ee) ? ee : 320, j = Number.isFinite(se) ? se : 180;
|
|
702
|
+
L.innerHTML = `<iframe width="${N}" height="${j}" src="https://www.youtube.com/embed/${E}" frameborder="0" allowfullscreen></iframe>`;
|
|
703
703
|
return;
|
|
704
704
|
}
|
|
705
705
|
const fe = Number.isFinite(ee) ? `${ee}px` : "320px", he = Number.isFinite(se) ? `${se}px` : "auto";
|
|
706
|
-
|
|
706
|
+
L.innerHTML = `<video controls style="max-width:100%; width:${fe}; height:${he};" src="${G}"></video>`;
|
|
707
707
|
};
|
|
708
708
|
_.oninput = ce, typeof J < "u" && (J.oninput = ce), typeof ie < "u" && (ie.oninput = ce), Z.onclick = () => {
|
|
709
|
-
const
|
|
710
|
-
if (!
|
|
709
|
+
const G = _.value.trim(), V = J && J.value.trim() || "", oe = ie && ie.value.trim() || "", ee = parseInt(V, 10), se = parseInt(oe, 10);
|
|
710
|
+
if (!G) {
|
|
711
711
|
p.style.display = "none";
|
|
712
712
|
return;
|
|
713
713
|
}
|
|
@@ -717,30 +717,30 @@ function Fo(h) {
|
|
|
717
717
|
p.style.display = "none";
|
|
718
718
|
return;
|
|
719
719
|
}
|
|
720
|
-
const fe = de.getRangeAt(0), he =
|
|
721
|
-
let
|
|
720
|
+
const fe = de.getRangeAt(0), he = G.match(/(?:youtube.com\/watch\?v=|youtu.be\/)([\w-]+)/i);
|
|
721
|
+
let E;
|
|
722
722
|
if (he) {
|
|
723
|
-
const
|
|
724
|
-
|
|
723
|
+
const j = he[1], Y = document.createElement("div"), xe = Number.isFinite(ee) ? ee : 560, we = Number.isFinite(se) ? se : 315;
|
|
724
|
+
Y.innerHTML = `<iframe width="${xe}" height="${we}" src="https://www.youtube.com/embed/${j}" frameborder="0" allowfullscreen></iframe>`, Y.contentEditable = "false", Y.className = "editor-video-wrapper", Y.style.display = "block", Y.style.maxWidth = "100%", Y.style.width = "auto", Y.style.height = "auto", Y.style.boxSizing = "border-box", Y.style.userSelect = "none", E = Y;
|
|
725
725
|
} else {
|
|
726
|
-
const
|
|
727
|
-
|
|
726
|
+
const j = document.createElement("div"), Y = document.createElement("video");
|
|
727
|
+
Y.controls = !0, Y.src = G, Number.isFinite(ee) && (Y.width = ee), Number.isFinite(se) && (Y.height = se), Y.style.maxWidth = "100%", Y.style.display = "block", j.appendChild(Y), j.contentEditable = "false", j.className = "editor-video-wrapper", j.style.display = "block", j.style.maxWidth = "100%", j.style.width = "auto", j.style.height = "auto", j.style.boxSizing = "border-box", j.style.userSelect = "none", E = j;
|
|
728
728
|
}
|
|
729
|
-
fe.insertNode(
|
|
730
|
-
const
|
|
731
|
-
|
|
729
|
+
fe.insertNode(E), de.removeAllRanges();
|
|
730
|
+
const N = document.createRange();
|
|
731
|
+
N.setStartAfter(E), N.collapse(!0), de.addRange(N), pe(N);
|
|
732
732
|
try {
|
|
733
|
-
const
|
|
734
|
-
|
|
733
|
+
const j = U;
|
|
734
|
+
j && typeof j.focus == "function" && (j.focus(), j.dispatchEvent(new Event("input", { bubbles: !0 })));
|
|
735
735
|
} catch {
|
|
736
736
|
}
|
|
737
|
-
p.style.display = "none", _.value = "",
|
|
737
|
+
p.style.display = "none", _.value = "", L.innerHTML = "";
|
|
738
738
|
};
|
|
739
|
-
const
|
|
740
|
-
return
|
|
741
|
-
const
|
|
742
|
-
|
|
743
|
-
}), v.appendChild(
|
|
739
|
+
const U = h.querySelector(".editor");
|
|
740
|
+
return U && U.addEventListener("click", (G) => {
|
|
741
|
+
const V = G.target;
|
|
742
|
+
V && V.tagName === "VIDEO" && V.focus();
|
|
743
|
+
}), v.appendChild(F), v;
|
|
744
744
|
}
|
|
745
745
|
function jo(h) {
|
|
746
746
|
const v = document.createElement("div");
|
|
@@ -784,8 +784,8 @@ function jo(h) {
|
|
|
784
784
|
} catch {
|
|
785
785
|
}
|
|
786
786
|
});
|
|
787
|
-
const
|
|
788
|
-
|
|
787
|
+
const m = eo();
|
|
788
|
+
m.innerHTML = `
|
|
789
789
|
<option value="1">8pt</option>
|
|
790
790
|
<option value="2">10pt</option>
|
|
791
791
|
<option value="3" selected>12pt</option>
|
|
@@ -793,127 +793,138 @@ function jo(h) {
|
|
|
793
793
|
<option value="5">18pt</option>
|
|
794
794
|
<option value="6">24pt</option>
|
|
795
795
|
<option value="7">36pt</option>
|
|
796
|
-
`,
|
|
797
|
-
const
|
|
798
|
-
v.appendChild(
|
|
799
|
-
const
|
|
800
|
-
v.appendChild(
|
|
796
|
+
`, m.style.border = "1px solid #e1e1e1", m.style.backgroundColor = "#ffffff", m.style.padding = "4px", m.style.borderRadius = "3px", m.style.color = "#000000", m.onchange = () => document.execCommand("fontSize", !1, m.value), v.appendChild(m);
|
|
797
|
+
const g = So();
|
|
798
|
+
v.appendChild(g);
|
|
799
|
+
const w = Mo();
|
|
800
|
+
v.appendChild(w);
|
|
801
801
|
const x = Ro();
|
|
802
802
|
v.appendChild(x);
|
|
803
|
-
const
|
|
804
|
-
v.appendChild(
|
|
803
|
+
const T = Ao();
|
|
804
|
+
v.appendChild(T);
|
|
805
805
|
const _ = Po();
|
|
806
806
|
v.appendChild(_);
|
|
807
|
-
const
|
|
807
|
+
const M = Io();
|
|
808
|
+
v.appendChild(M);
|
|
809
|
+
const L = Oo();
|
|
810
|
+
v.appendChild(L);
|
|
811
|
+
const X = No(h);
|
|
812
|
+
v.appendChild(X);
|
|
813
|
+
const A = zo();
|
|
808
814
|
v.appendChild(A);
|
|
809
|
-
const
|
|
810
|
-
v.appendChild(
|
|
811
|
-
const
|
|
812
|
-
v.appendChild(
|
|
813
|
-
const
|
|
814
|
-
v.appendChild(
|
|
815
|
-
const q = Lo();
|
|
816
|
-
v.appendChild(q);
|
|
817
|
-
const H = Fo(h);
|
|
818
|
-
v.appendChild(H);
|
|
819
|
-
const U = Do();
|
|
820
|
-
return v.appendChild(U), v;
|
|
815
|
+
const D = Lo();
|
|
816
|
+
v.appendChild(D);
|
|
817
|
+
const B = Fo(h);
|
|
818
|
+
v.appendChild(B);
|
|
819
|
+
const q = Do();
|
|
820
|
+
return v.appendChild(q), v;
|
|
821
821
|
}
|
|
822
822
|
function Ho(h) {
|
|
823
823
|
const p = new DOMParser().parseFromString(h, "text/html");
|
|
824
|
-
return p.querySelectorAll("img").forEach((
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
824
|
+
return Array.from(p.querySelectorAll("img")).forEach((m) => {
|
|
825
|
+
if (!p.body.contains(m) || m.closest(".editor-image-wrapper")) return;
|
|
826
|
+
const w = m.getAttribute("src") || m.src;
|
|
827
|
+
if (!w) return;
|
|
828
|
+
const x = document.createElement("img");
|
|
829
|
+
x.src = w, m.alt && (x.alt = m.alt), m.title && (x.title = m.title), x.style.maxWidth = "100%", x.style.width = "100%", x.style.height = "auto", x.style.cursor = "pointer", x.draggable = !1;
|
|
830
|
+
const T = m.getAttribute("width") || m.style.width || (m.naturalWidth > 0 ? `${m.naturalWidth}px` : null), _ = document.createElement("div");
|
|
831
|
+
_.className = "editor-image-wrapper", _.style.display = "inline-block", _.style.position = "relative", _.style.maxWidth = "100%", _.style.width = T && T !== "0px" ? T.includes("px") ? T : `${T}px` : "300px", _.style.height = "auto", _.contentEditable = "false", _.style.boxSizing = "border-box", _.style.touchAction = "none", _.style.userSelect = "none", _.appendChild(x);
|
|
832
|
+
const M = document.createElement("p");
|
|
833
|
+
M.style.margin = "10px 0", M.style.textAlign = "left", M.style.display = "block", M.appendChild(_);
|
|
834
|
+
let L = m;
|
|
835
|
+
const X = m.closest("figure"), A = m.closest("picture");
|
|
836
|
+
if (X && p.body.contains(X))
|
|
837
|
+
L = X;
|
|
838
|
+
else if (A && p.body.contains(A))
|
|
839
|
+
L = A;
|
|
840
|
+
else {
|
|
841
|
+
let D = m.parentNode;
|
|
842
|
+
for (; D && D !== p.body && D.parentNode !== p.body && Array.from(D.childNodes).filter(
|
|
843
|
+
(q) => q.nodeType === Node.ELEMENT_NODE || q.nodeType === Node.TEXT_NODE && q.textContent?.trim()
|
|
844
|
+
).length === 1; )
|
|
845
|
+
L = D, D = D.parentNode;
|
|
846
|
+
}
|
|
847
|
+
L && L.parentNode && p.body.contains(L) ? L.parentNode.replaceChild(M, L) : m.parentNode && p.body.contains(m) && m.parentNode.replaceChild(M, m);
|
|
837
848
|
}), p.body.innerHTML;
|
|
838
849
|
}
|
|
839
850
|
function Bo(h, v) {
|
|
840
851
|
const p = document.createElement("div");
|
|
841
852
|
p.classList.add("editor"), p.contentEditable = "true", p.style.color = "#000000", p.style.border = "1px solid #e1e1e1", p.style.height = "400px", p.style.overflowY = "auto", p.style.padding = "15px", p.style.fontFamily = "Arial, sans-serif", p.style.fontSize = "14px", p.style.lineHeight = "1.5", p.style.outline = "none", p.style.backgroundColor = "#ffffff", p.style.borderRadius = "4px", p.style.boxShadow = "inset 0 1px 3px rgba(0,0,0,0.1)", p.style.direction = "ltr", p.style.textAlign = "left", p.style.scrollbarWidth = "none", p.style.msOverflowStyle = "none";
|
|
842
853
|
const d = document.createElement("style");
|
|
843
|
-
return d.textContent = ".editor::-webkit-scrollbar { display: none; }", document.querySelector("style[data-editor-scrollbar]") || (d.setAttribute("data-editor-scrollbar", "true"), document.head.appendChild(d)), p.innerHTML = "", p.addEventListener("dragover", (
|
|
844
|
-
|
|
845
|
-
}), p.addEventListener("drop", (
|
|
846
|
-
|
|
847
|
-
const
|
|
854
|
+
return d.textContent = ".editor::-webkit-scrollbar { display: none; }", document.querySelector("style[data-editor-scrollbar]") || (d.setAttribute("data-editor-scrollbar", "true"), document.head.appendChild(d)), p.innerHTML = "", p.addEventListener("dragover", (m) => {
|
|
855
|
+
m.preventDefault(), m.stopPropagation();
|
|
856
|
+
}), p.addEventListener("drop", (m) => {
|
|
857
|
+
m.preventDefault(), m.stopPropagation();
|
|
858
|
+
const g = m.clientX, w = m.clientY;
|
|
848
859
|
let x = null;
|
|
849
860
|
if (document.caretRangeFromPoint)
|
|
850
|
-
x = document.caretRangeFromPoint(
|
|
861
|
+
x = document.caretRangeFromPoint(g, w);
|
|
851
862
|
else if (document.caretPositionFromPoint) {
|
|
852
|
-
const _ = document.caretPositionFromPoint(
|
|
863
|
+
const _ = document.caretPositionFromPoint(g, w);
|
|
853
864
|
_ && (x = document.createRange(), x.setStart(_.offsetNode, _.offset));
|
|
854
865
|
}
|
|
855
|
-
const
|
|
856
|
-
if (
|
|
857
|
-
for (let _ = 0; _ <
|
|
858
|
-
const
|
|
859
|
-
if (
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
const
|
|
863
|
-
|
|
864
|
-
const
|
|
865
|
-
|
|
866
|
-
const
|
|
867
|
-
if (
|
|
866
|
+
const T = m.dataTransfer?.files;
|
|
867
|
+
if (T && T.length > 0)
|
|
868
|
+
for (let _ = 0; _ < T.length; _++) {
|
|
869
|
+
const M = T[_];
|
|
870
|
+
if (M.type.startsWith("image/")) {
|
|
871
|
+
const L = new FileReader();
|
|
872
|
+
L.onload = (X) => {
|
|
873
|
+
const A = document.createElement("img");
|
|
874
|
+
A.src = X.target?.result, A.style.maxWidth = "100%", A.style.width = "100%", A.style.height = "auto", A.style.cursor = "pointer", A.draggable = !1;
|
|
875
|
+
const D = document.createElement("div");
|
|
876
|
+
D.className = "editor-image-wrapper", D.style.display = "inline-block", D.style.position = "relative", D.style.maxWidth = "100%", D.style.width = "auto", D.style.height = "auto", D.contentEditable = "false", D.style.userSelect = "none", D.style.boxSizing = "border-box", D.style.touchAction = "none", D.appendChild(A);
|
|
877
|
+
const B = document.createElement("div");
|
|
878
|
+
if (B.contentEditable = "true", B.style.margin = "10px 0", B.style.textAlign = "left", B.style.display = "block", B.appendChild(D), x)
|
|
868
879
|
try {
|
|
869
|
-
x.insertNode(
|
|
870
|
-
const
|
|
871
|
-
if (
|
|
872
|
-
|
|
880
|
+
x.insertNode(B);
|
|
881
|
+
const q = window.getSelection();
|
|
882
|
+
if (q) {
|
|
883
|
+
q.removeAllRanges();
|
|
873
884
|
const Q = document.createRange();
|
|
874
|
-
Q.setStartAfter(
|
|
885
|
+
Q.setStartAfter(B), Q.collapse(!0), q.addRange(Q), pe(Q);
|
|
875
886
|
}
|
|
876
887
|
} catch {
|
|
877
|
-
p.appendChild(
|
|
888
|
+
p.appendChild(B);
|
|
878
889
|
}
|
|
879
890
|
else
|
|
880
|
-
p.appendChild(
|
|
891
|
+
p.appendChild(B);
|
|
881
892
|
p.dispatchEvent(new Event("input", { bubbles: !0 })), p.focus();
|
|
882
|
-
},
|
|
893
|
+
}, L.readAsDataURL(M);
|
|
883
894
|
}
|
|
884
895
|
}
|
|
885
|
-
}), p.addEventListener("paste", (
|
|
886
|
-
|
|
887
|
-
const
|
|
888
|
-
if (!
|
|
889
|
-
let
|
|
890
|
-
|
|
896
|
+
}), p.addEventListener("paste", (m) => {
|
|
897
|
+
m.preventDefault();
|
|
898
|
+
const g = m.clipboardData;
|
|
899
|
+
if (!g) return;
|
|
900
|
+
let w = g.getData("text/html");
|
|
901
|
+
w ? w = Ho(w) : w = g.getData("text/plain");
|
|
891
902
|
const x = window.getSelection();
|
|
892
903
|
if (x && x.rangeCount > 0) {
|
|
893
|
-
const
|
|
894
|
-
_.innerHTML =
|
|
895
|
-
const
|
|
904
|
+
const T = x.getRangeAt(0), _ = document.createElement("div");
|
|
905
|
+
_.innerHTML = w;
|
|
906
|
+
const M = document.createDocumentFragment();
|
|
896
907
|
for (; _.firstChild; )
|
|
897
|
-
|
|
898
|
-
|
|
908
|
+
M.appendChild(_.firstChild);
|
|
909
|
+
T.deleteContents(), T.insertNode(M), T.collapse(!1), x.removeAllRanges(), x.addRange(T);
|
|
899
910
|
} else {
|
|
900
|
-
const
|
|
901
|
-
for (
|
|
902
|
-
p.appendChild(
|
|
911
|
+
const T = document.createElement("div");
|
|
912
|
+
for (T.innerHTML = w; T.firstChild; )
|
|
913
|
+
p.appendChild(T.firstChild);
|
|
903
914
|
}
|
|
904
915
|
p.dispatchEvent(new Event("input", { bubbles: !0 })), p.focus(), pe();
|
|
905
|
-
}), p.addEventListener("click", (
|
|
906
|
-
const
|
|
907
|
-
let
|
|
908
|
-
if (
|
|
909
|
-
|
|
910
|
-
const x =
|
|
916
|
+
}), p.addEventListener("click", (m) => {
|
|
917
|
+
const g = m.target;
|
|
918
|
+
let w = g;
|
|
919
|
+
if (g.tagName === "IMG" && (w = g.parentElement), w && w.classList.contains("editor-image-wrapper")) {
|
|
920
|
+
m.preventDefault(), m.stopPropagation(), v(w);
|
|
921
|
+
const x = w.parentElement;
|
|
911
922
|
if (x && (x.tagName === "DIV" || x.tagName === "P") && x.querySelector(".editor-image-wrapper"))
|
|
912
923
|
try {
|
|
913
|
-
const
|
|
914
|
-
if (
|
|
924
|
+
const T = window.getSelection();
|
|
925
|
+
if (T) {
|
|
915
926
|
const _ = document.createRange();
|
|
916
|
-
_.selectNodeContents(x),
|
|
927
|
+
_.selectNodeContents(x), T.removeAllRanges(), T.addRange(_), pe();
|
|
917
928
|
}
|
|
918
929
|
} catch {
|
|
919
930
|
}
|
|
@@ -921,13 +932,13 @@ function Bo(h, v) {
|
|
|
921
932
|
pe();
|
|
922
933
|
}), p.addEventListener("keyup", () => pe()), p.addEventListener("mouseup", () => pe()), p.addEventListener("focus", () => pe()), window.addEventListener("selectionchange", () => {
|
|
923
934
|
try {
|
|
924
|
-
const
|
|
925
|
-
if (!
|
|
926
|
-
let
|
|
927
|
-
for (;
|
|
928
|
-
|
|
929
|
-
if (!
|
|
930
|
-
p.contains(
|
|
935
|
+
const m = window.getSelection();
|
|
936
|
+
if (!m || !m.anchorNode) return;
|
|
937
|
+
let g = m.anchorNode;
|
|
938
|
+
for (; g && g.nodeType !== Node.ELEMENT_NODE; )
|
|
939
|
+
g = g.parentNode;
|
|
940
|
+
if (!g) return;
|
|
941
|
+
p.contains(g) && pe();
|
|
931
942
|
} catch {
|
|
932
943
|
}
|
|
933
944
|
}), p;
|
|
@@ -955,54 +966,54 @@ function Vo() {
|
|
|
955
966
|
for (var e = 1; e < arguments.length; e++) {
|
|
956
967
|
var n = arguments[e] != null ? arguments[e] : {};
|
|
957
968
|
e % 2 ? p(Object(n), !0).forEach((function(r) {
|
|
958
|
-
|
|
969
|
+
T(t, r, n[r]);
|
|
959
970
|
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : p(Object(n)).forEach((function(r) {
|
|
960
971
|
Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
|
|
961
972
|
}));
|
|
962
973
|
}
|
|
963
974
|
return t;
|
|
964
975
|
}
|
|
965
|
-
function
|
|
966
|
-
return
|
|
976
|
+
function m(t) {
|
|
977
|
+
return m = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
967
978
|
return typeof e;
|
|
968
979
|
} : function(e) {
|
|
969
980
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
970
|
-
},
|
|
981
|
+
}, m(t);
|
|
971
982
|
}
|
|
972
|
-
function
|
|
983
|
+
function g(t, e) {
|
|
973
984
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
974
985
|
}
|
|
975
|
-
function
|
|
986
|
+
function w(t, e) {
|
|
976
987
|
for (var n = 0; n < e.length; n++) {
|
|
977
988
|
var r = e[n];
|
|
978
|
-
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t,
|
|
989
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, B(r.key), r);
|
|
979
990
|
}
|
|
980
991
|
}
|
|
981
992
|
function x(t, e, n) {
|
|
982
|
-
return e &&
|
|
993
|
+
return e && w(t.prototype, e), Object.defineProperty(t, "prototype", { writable: !1 }), t;
|
|
983
994
|
}
|
|
984
|
-
function
|
|
985
|
-
return (e =
|
|
995
|
+
function T(t, e, n) {
|
|
996
|
+
return (e = B(e)) in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
|
|
986
997
|
}
|
|
987
998
|
function _(t, e) {
|
|
988
999
|
if (typeof e != "function" && e !== null) throw new TypeError("Super expression must either be null or a function");
|
|
989
|
-
t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e &&
|
|
1000
|
+
t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && L(t, e);
|
|
990
1001
|
}
|
|
991
|
-
function
|
|
992
|
-
return
|
|
1002
|
+
function M(t) {
|
|
1003
|
+
return M = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
993
1004
|
return e.__proto__ || Object.getPrototypeOf(e);
|
|
994
|
-
},
|
|
1005
|
+
}, M(t);
|
|
995
1006
|
}
|
|
996
|
-
function
|
|
997
|
-
return
|
|
1007
|
+
function L(t, e) {
|
|
1008
|
+
return L = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
|
|
998
1009
|
return n.__proto__ = r, n;
|
|
999
|
-
},
|
|
1010
|
+
}, L(t, e);
|
|
1000
1011
|
}
|
|
1001
|
-
function
|
|
1012
|
+
function X(t) {
|
|
1002
1013
|
if (t === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1003
1014
|
return t;
|
|
1004
1015
|
}
|
|
1005
|
-
function
|
|
1016
|
+
function A(t) {
|
|
1006
1017
|
var e = (function() {
|
|
1007
1018
|
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
1008
1019
|
if (typeof Proxy == "function") return !0;
|
|
@@ -1014,31 +1025,31 @@ function Vo() {
|
|
|
1014
1025
|
}
|
|
1015
1026
|
})();
|
|
1016
1027
|
return function() {
|
|
1017
|
-
var n, r =
|
|
1028
|
+
var n, r = M(t);
|
|
1018
1029
|
if (e) {
|
|
1019
|
-
var o =
|
|
1030
|
+
var o = M(this).constructor;
|
|
1020
1031
|
n = Reflect.construct(r, arguments, o);
|
|
1021
1032
|
} else n = r.apply(this, arguments);
|
|
1022
1033
|
return (function(i, a) {
|
|
1023
1034
|
if (a && (typeof a == "object" || typeof a == "function")) return a;
|
|
1024
1035
|
if (a !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
|
|
1025
|
-
return
|
|
1036
|
+
return X(i);
|
|
1026
1037
|
})(this, n);
|
|
1027
1038
|
};
|
|
1028
1039
|
}
|
|
1029
|
-
function
|
|
1030
|
-
return
|
|
1040
|
+
function D() {
|
|
1041
|
+
return D = typeof Reflect < "u" && Reflect.get ? Reflect.get.bind() : function(t, e, n) {
|
|
1031
1042
|
var r = (function(i, a) {
|
|
1032
|
-
for (; !Object.prototype.hasOwnProperty.call(i, a) && (i =
|
|
1043
|
+
for (; !Object.prototype.hasOwnProperty.call(i, a) && (i = M(i)) !== null; ) ;
|
|
1033
1044
|
return i;
|
|
1034
1045
|
})(t, e);
|
|
1035
1046
|
if (r) {
|
|
1036
1047
|
var o = Object.getOwnPropertyDescriptor(r, e);
|
|
1037
1048
|
return o.get ? o.get.call(arguments.length < 3 ? t : n) : o.value;
|
|
1038
1049
|
}
|
|
1039
|
-
},
|
|
1050
|
+
}, D.apply(this, arguments);
|
|
1040
1051
|
}
|
|
1041
|
-
function
|
|
1052
|
+
function B(t) {
|
|
1042
1053
|
var e = (function(n, r) {
|
|
1043
1054
|
if (typeof n != "object" || n === null) return n;
|
|
1044
1055
|
var o = n[Symbol.toPrimitive];
|
|
@@ -1051,7 +1062,7 @@ function Vo() {
|
|
|
1051
1062
|
})(t, "string");
|
|
1052
1063
|
return typeof e == "symbol" ? e : e + "";
|
|
1053
1064
|
}
|
|
1054
|
-
var
|
|
1065
|
+
var q = function(t) {
|
|
1055
1066
|
return !(!t || !t.Window) && t instanceof t.Window;
|
|
1056
1067
|
}, Q = void 0, J = void 0;
|
|
1057
1068
|
function re(t) {
|
|
@@ -1060,15 +1071,15 @@ function Vo() {
|
|
|
1060
1071
|
e.ownerDocument !== t.document && typeof t.wrap == "function" && t.wrap(e) === e && (t = t.wrap(t)), J = t;
|
|
1061
1072
|
}
|
|
1062
1073
|
function te(t) {
|
|
1063
|
-
return
|
|
1074
|
+
return q(t) ? t : (t.ownerDocument || t).defaultView || J.window;
|
|
1064
1075
|
}
|
|
1065
1076
|
typeof window < "u" && window && re(window);
|
|
1066
1077
|
var ie = function(t) {
|
|
1067
|
-
return !!t &&
|
|
1078
|
+
return !!t && m(t) === "object";
|
|
1068
1079
|
}, ne = function(t) {
|
|
1069
1080
|
return typeof t == "function";
|
|
1070
1081
|
}, b = { window: function(t) {
|
|
1071
|
-
return t === J ||
|
|
1082
|
+
return t === J || q(t);
|
|
1072
1083
|
}, docFrag: function(t) {
|
|
1073
1084
|
return ie(t) && t.nodeType === 11;
|
|
1074
1085
|
}, object: ie, func: ne, number: function(t) {
|
|
@@ -1078,9 +1089,9 @@ function Vo() {
|
|
|
1078
1089
|
}, string: function(t) {
|
|
1079
1090
|
return typeof t == "string";
|
|
1080
1091
|
}, element: function(t) {
|
|
1081
|
-
if (!t ||
|
|
1092
|
+
if (!t || m(t) !== "object") return !1;
|
|
1082
1093
|
var e = te(t) || J;
|
|
1083
|
-
return /object|function/.test(typeof Element > "u" ? "undefined" :
|
|
1094
|
+
return /object|function/.test(typeof Element > "u" ? "undefined" : m(Element)) ? t instanceof Element || t instanceof e.Element : t.nodeType === 1 && typeof t.nodeName == "string";
|
|
1084
1095
|
}, plainObject: function(t) {
|
|
1085
1096
|
return ie(t) && !!t.constructor && /function Object\b/.test(t.constructor.toString());
|
|
1086
1097
|
}, array: function(t) {
|
|
@@ -1093,7 +1104,7 @@ function Vo() {
|
|
|
1093
1104
|
n === "x" ? (e.coords.cur.page.y = e.coords.start.page.y, e.coords.cur.client.y = e.coords.start.client.y, e.coords.velocity.client.y = 0, e.coords.velocity.page.y = 0) : n === "y" && (e.coords.cur.page.x = e.coords.start.page.x, e.coords.cur.client.x = e.coords.start.client.x, e.coords.velocity.client.x = 0, e.coords.velocity.page.x = 0);
|
|
1094
1105
|
}
|
|
1095
1106
|
}
|
|
1096
|
-
function
|
|
1107
|
+
function F(t) {
|
|
1097
1108
|
var e = t.iEvent, n = t.interaction;
|
|
1098
1109
|
if (n.prepared.name === "drag") {
|
|
1099
1110
|
var r = n.prepared.axis;
|
|
@@ -1106,24 +1117,24 @@ function Vo() {
|
|
|
1106
1117
|
var le = { id: "actions/drag", install: function(t) {
|
|
1107
1118
|
var e = t.actions, n = t.Interactable, r = t.defaults;
|
|
1108
1119
|
n.prototype.draggable = le.draggable, e.map.drag = le, e.methodDict.drag = "draggable", r.actions.drag = le.defaults;
|
|
1109
|
-
}, listeners: { "interactions:before-action-move": Z, "interactions:action-resume": Z, "interactions:action-move":
|
|
1120
|
+
}, listeners: { "interactions:before-action-move": Z, "interactions:action-resume": Z, "interactions:action-move": F, "auto-start:check": function(t) {
|
|
1110
1121
|
var e = t.interaction, n = t.interactable, r = t.buttons, o = n.options.drag;
|
|
1111
1122
|
if (o && o.enabled && (!e.pointerIsDown || !/mouse|pointer/.test(e.pointerType) || (r & n.options.drag.mouseButtons) != 0)) return t.action = { name: "drag", axis: o.lockAxis === "start" ? o.startAxis : o.lockAxis }, !1;
|
|
1112
1123
|
} }, draggable: function(t) {
|
|
1113
1124
|
return b.object(t) ? (this.options.drag.enabled = t.enabled !== !1, this.setPerAction("drag", t), this.setOnEvents("drag", t), /^(xy|x|y|start)$/.test(t.lockAxis) && (this.options.drag.lockAxis = t.lockAxis), /^(xy|x|y)$/.test(t.startAxis) && (this.options.drag.startAxis = t.startAxis), this) : b.bool(t) ? (this.options.drag.enabled = t, this) : this.options.drag;
|
|
1114
|
-
}, beforeMove: Z, move:
|
|
1125
|
+
}, beforeMove: Z, move: F, defaults: { startAxis: "xy", lockAxis: "xy" }, getCursor: function() {
|
|
1115
1126
|
return "move";
|
|
1116
1127
|
}, filterEventType: function(t) {
|
|
1117
1128
|
return t.search("drag") === 0;
|
|
1118
|
-
} }, ce = le,
|
|
1129
|
+
} }, ce = le, U = { init: function(t) {
|
|
1119
1130
|
var e = t;
|
|
1120
|
-
|
|
1131
|
+
U.document = e.document, U.DocumentFragment = e.DocumentFragment || G, U.SVGElement = e.SVGElement || G, U.SVGSVGElement = e.SVGSVGElement || G, U.SVGElementInstance = e.SVGElementInstance || G, U.Element = e.Element || G, U.HTMLElement = e.HTMLElement || U.Element, U.Event = e.Event, U.Touch = e.Touch || G, U.PointerEvent = e.PointerEvent || e.MSPointerEvent;
|
|
1121
1132
|
}, document: null, DocumentFragment: null, SVGElement: null, SVGSVGElement: null, SVGElementInstance: null, Element: null, HTMLElement: null, Event: null, Touch: null, PointerEvent: null };
|
|
1122
|
-
function
|
|
1133
|
+
function G() {
|
|
1123
1134
|
}
|
|
1124
|
-
var
|
|
1125
|
-
var e =
|
|
1126
|
-
oe.supportsTouch = "ontouchstart" in t || b.func(t.DocumentTouch) &&
|
|
1135
|
+
var V = U, oe = { init: function(t) {
|
|
1136
|
+
var e = V.Element, n = t.navigator || {};
|
|
1137
|
+
oe.supportsTouch = "ontouchstart" in t || b.func(t.DocumentTouch) && V.document instanceof t.DocumentTouch, oe.supportsPointerEvent = n.pointerEnabled !== !1 && !!V.PointerEvent, oe.isIOS = /iP(hone|od|ad)/.test(n.platform), oe.isIOS7 = /iP(hone|od|ad)/.test(n.platform) && /OS 7[^\d]/.test(n.appVersion), oe.isIe9 = /MSIE 9/.test(n.userAgent), oe.isOperaMobile = n.appName === "Opera" && oe.supportsTouch && /Presto/.test(n.userAgent), oe.prefixedMatchesSelector = "matches" in e.prototype ? "matches" : "webkitMatchesSelector" in e.prototype ? "webkitMatchesSelector" : "mozMatchesSelector" in e.prototype ? "mozMatchesSelector" : "oMatchesSelector" in e.prototype ? "oMatchesSelector" : "msMatchesSelector", oe.pEventTypes = oe.supportsPointerEvent ? V.PointerEvent === t.MSPointerEvent ? { up: "MSPointerUp", down: "MSPointerDown", over: "mouseover", out: "mouseout", move: "MSPointerMove", cancel: "MSPointerCancel" } : { up: "pointerup", down: "pointerdown", over: "pointerover", out: "pointerout", move: "pointermove", cancel: "pointercancel" } : null, oe.wheelEvent = V.document && "onmousewheel" in V.document ? "mousewheel" : "wheel";
|
|
1127
1138
|
}, supportsTouch: null, supportsPointerEvent: null, isIOS7: null, isIOS: null, isIe9: null, isOperaMobile: null, prefixedMatchesSelector: null, pEventTypes: null, wheelEvent: null }, ee = oe;
|
|
1128
1139
|
function se(t, e) {
|
|
1129
1140
|
if (t.contains) return t.contains(e);
|
|
@@ -1151,28 +1162,28 @@ function Vo() {
|
|
|
1151
1162
|
function he(t, e) {
|
|
1152
1163
|
return J !== Q && (e = e.replace(/\/deep\//g, " ")), t[ee.prefixedMatchesSelector](e);
|
|
1153
1164
|
}
|
|
1154
|
-
var
|
|
1165
|
+
var E = function(t) {
|
|
1155
1166
|
return t.parentNode || t.host;
|
|
1156
1167
|
};
|
|
1157
|
-
function
|
|
1158
|
-
for (var n, r = [], o = t; (n =
|
|
1168
|
+
function N(t, e) {
|
|
1169
|
+
for (var n, r = [], o = t; (n = E(o)) && o !== e && n !== o.ownerDocument; ) r.unshift(o), o = n;
|
|
1159
1170
|
return r;
|
|
1160
1171
|
}
|
|
1161
|
-
function
|
|
1172
|
+
function j(t, e, n) {
|
|
1162
1173
|
for (; b.element(t); ) {
|
|
1163
1174
|
if (he(t, e)) return !0;
|
|
1164
1175
|
if ((t = fe(t)) === n) return he(t, e);
|
|
1165
1176
|
}
|
|
1166
1177
|
return !1;
|
|
1167
1178
|
}
|
|
1168
|
-
function
|
|
1179
|
+
function Y(t) {
|
|
1169
1180
|
return t.correspondingUseElement || t;
|
|
1170
1181
|
}
|
|
1171
1182
|
function xe(t) {
|
|
1172
|
-
var e = t instanceof
|
|
1183
|
+
var e = t instanceof V.SVGElement ? t.getBoundingClientRect() : t.getClientRects()[0];
|
|
1173
1184
|
return e && { left: e.left, right: e.right, top: e.top, bottom: e.bottom, width: e.width || e.right - e.left, height: e.height || e.bottom - e.top };
|
|
1174
1185
|
}
|
|
1175
|
-
function
|
|
1186
|
+
function we(t) {
|
|
1176
1187
|
var e, n = xe(t);
|
|
1177
1188
|
if (!ee.isIOS7 && n) {
|
|
1178
1189
|
var r = { x: (e = (e = te(t)) || J).scrollX || e.document.documentElement.scrollLeft, y: e.scrollY || e.document.documentElement.scrollTop };
|
|
@@ -1184,8 +1195,8 @@ function Vo() {
|
|
|
1184
1195
|
for (var e = []; t; ) e.push(t), t = fe(t);
|
|
1185
1196
|
return e;
|
|
1186
1197
|
}
|
|
1187
|
-
function
|
|
1188
|
-
return !!b.string(t) && (
|
|
1198
|
+
function Ee(t) {
|
|
1199
|
+
return !!b.string(t) && (V.document.querySelector(t), !0);
|
|
1189
1200
|
}
|
|
1190
1201
|
function I(t, e) {
|
|
1191
1202
|
for (var n in e) t[n] = e[n];
|
|
@@ -1196,7 +1207,7 @@ function Vo() {
|
|
|
1196
1207
|
}
|
|
1197
1208
|
function ze(t, e, n, r) {
|
|
1198
1209
|
var o = t;
|
|
1199
|
-
return b.string(o) ? o = Qe(o, e, n) : b.func(o) && (o = o.apply(void 0, r)), b.element(o) && (o =
|
|
1210
|
+
return b.string(o) ? o = Qe(o, e, n) : b.func(o) && (o = o.apply(void 0, r)), b.element(o) && (o = we(o)), o;
|
|
1200
1211
|
}
|
|
1201
1212
|
function Ze(t) {
|
|
1202
1213
|
return t && { x: "x" in t ? t.x : t.left, y: "y" in t ? t.y : t.top };
|
|
@@ -1257,7 +1268,7 @@ function Vo() {
|
|
|
1257
1268
|
t.page.x = 0, t.page.y = 0, t.client.x = 0, t.client.y = 0;
|
|
1258
1269
|
}
|
|
1259
1270
|
function Bt(t) {
|
|
1260
|
-
return t instanceof
|
|
1271
|
+
return t instanceof V.Event || t instanceof V.Touch;
|
|
1261
1272
|
}
|
|
1262
1273
|
function rt(t, e, n) {
|
|
1263
1274
|
return t = t || "page", (n = n || {}).x = e[t + "X"], n.y = e[t + "Y"], n;
|
|
@@ -1300,15 +1311,15 @@ function Vo() {
|
|
|
1300
1311
|
return 180 * Math.atan2(a, i) / Math.PI;
|
|
1301
1312
|
}
|
|
1302
1313
|
function Vt(t) {
|
|
1303
|
-
return b.string(t.pointerType) ? t.pointerType : b.number(t.pointerType) ? [void 0, void 0, "touch", "pen", "mouse"][t.pointerType] : /touch/.test(t.type || "") || t instanceof
|
|
1314
|
+
return b.string(t.pointerType) ? t.pointerType : b.number(t.pointerType) ? [void 0, void 0, "touch", "pen", "mouse"][t.pointerType] : /touch/.test(t.type || "") || t instanceof V.Touch ? "touch" : "mouse";
|
|
1304
1315
|
}
|
|
1305
1316
|
function Yt(t) {
|
|
1306
1317
|
var e = b.func(t.composedPath) ? t.composedPath() : t.path;
|
|
1307
|
-
return [
|
|
1318
|
+
return [Y(e ? e[0] : t.target), Y(t.currentTarget)];
|
|
1308
1319
|
}
|
|
1309
1320
|
var ot = (function() {
|
|
1310
1321
|
function t(e) {
|
|
1311
|
-
|
|
1322
|
+
g(this, t), this.immediatePropagationStopped = !1, this.propagationStopped = !1, this._interaction = e;
|
|
1312
1323
|
}
|
|
1313
1324
|
return x(t, [{ key: "preventDefault", value: function() {
|
|
1314
1325
|
} }, { key: "stopPropagation", value: function() {
|
|
@@ -1336,10 +1347,10 @@ function Vo() {
|
|
|
1336
1347
|
return t[He(t, e)];
|
|
1337
1348
|
}, Oe = (function(t) {
|
|
1338
1349
|
_(n, t);
|
|
1339
|
-
var e =
|
|
1350
|
+
var e = A(n);
|
|
1340
1351
|
function n(r, o, i) {
|
|
1341
1352
|
var a;
|
|
1342
|
-
|
|
1353
|
+
g(this, n), (a = e.call(this, o._interaction)).dropzone = void 0, a.dragEvent = void 0, a.relatedTarget = void 0, a.draggable = void 0, a.propagationStopped = !1, a.immediatePropagationStopped = !1;
|
|
1343
1354
|
var s = i === "dragleave" ? r.prev : r.cur, l = s.element, u = s.dropzone;
|
|
1344
1355
|
return a.type = i, a.target = l, a.currentTarget = l, a.dropzone = u, a.dragEvent = o, a.relatedTarget = o.target, a.draggable = o.interactable, a.timeStamp = o.timeStamp, a;
|
|
1345
1356
|
}
|
|
@@ -1391,41 +1402,41 @@ function Vo() {
|
|
|
1391
1402
|
var u = l[s], c = u.dropzone, f = u.element, y = u.rect, C = c.dropCheck(e, n, o, i, f, y);
|
|
1392
1403
|
a.push(C ? f : null);
|
|
1393
1404
|
}
|
|
1394
|
-
var k = (function(
|
|
1395
|
-
for (var
|
|
1396
|
-
var
|
|
1397
|
-
if (
|
|
1398
|
-
var me =
|
|
1399
|
-
if (me !==
|
|
1400
|
-
|
|
1405
|
+
var k = (function(S) {
|
|
1406
|
+
for (var P, R, O, W = [], K = 0; K < S.length; K++) {
|
|
1407
|
+
var z = S[K], $ = S[P];
|
|
1408
|
+
if (z && K !== P) if ($) {
|
|
1409
|
+
var me = E(z), ae = E($);
|
|
1410
|
+
if (me !== z.ownerDocument) if (ae !== z.ownerDocument) if (me !== ae) {
|
|
1411
|
+
W = W.length ? W : N($);
|
|
1401
1412
|
var ge = void 0;
|
|
1402
|
-
if (
|
|
1403
|
-
if (
|
|
1404
|
-
ge =
|
|
1405
|
-
} else ge =
|
|
1406
|
-
for (var be =
|
|
1407
|
-
var ft = [be[Se - 1], be[Se],
|
|
1413
|
+
if ($ instanceof V.HTMLElement && z instanceof V.SVGElement && !(z instanceof V.SVGSVGElement)) {
|
|
1414
|
+
if (z === ae) continue;
|
|
1415
|
+
ge = z.ownerSVGElement;
|
|
1416
|
+
} else ge = z;
|
|
1417
|
+
for (var be = N(ge, $.ownerDocument), Se = 0; be[Se] && be[Se] === W[Se]; ) Se++;
|
|
1418
|
+
var ft = [be[Se - 1], be[Se], W[Se]];
|
|
1408
1419
|
if (ft[0]) for (var Ue = ft[0].lastChild; Ue; ) {
|
|
1409
1420
|
if (Ue === ft[1]) {
|
|
1410
|
-
|
|
1421
|
+
P = K, W = be;
|
|
1411
1422
|
break;
|
|
1412
1423
|
}
|
|
1413
1424
|
if (Ue === ft[2]) break;
|
|
1414
1425
|
Ue = Ue.previousSibling;
|
|
1415
1426
|
}
|
|
1416
|
-
} else O =
|
|
1417
|
-
else
|
|
1418
|
-
} else
|
|
1427
|
+
} else O = $, (parseInt(te(R = z).getComputedStyle(R).zIndex, 10) || 0) >= (parseInt(te(O).getComputedStyle(O).zIndex, 10) || 0) && (P = K);
|
|
1428
|
+
else P = K;
|
|
1429
|
+
} else P = K;
|
|
1419
1430
|
}
|
|
1420
|
-
return
|
|
1431
|
+
return P;
|
|
1421
1432
|
})(a);
|
|
1422
1433
|
return r.activeDrops[k] || null;
|
|
1423
1434
|
}
|
|
1424
|
-
function
|
|
1435
|
+
function wt(t, e, n) {
|
|
1425
1436
|
var r = t.dropState, o = { enter: null, leave: null, activate: null, deactivate: null, move: null, drop: null };
|
|
1426
1437
|
return n.type === "dragstart" && (o.activate = new Oe(r, n, "dropactivate"), o.activate.target = null, o.activate.dropzone = null), n.type === "dragend" && (o.deactivate = new Oe(r, n, "dropdeactivate"), o.deactivate.target = null, o.deactivate.dropzone = null), r.rejected || (r.cur.element !== r.prev.element && (r.prev.dropzone && (o.leave = new Oe(r, n, "dragleave"), n.dragLeave = o.leave.target = r.prev.element, n.prevDropzone = o.leave.dropzone = r.prev.dropzone), r.cur.dropzone && (o.enter = new Oe(r, n, "dragenter"), n.dragEnter = r.cur.element, n.dropzone = r.cur.dropzone)), n.type === "dragend" && r.cur.dropzone && (o.drop = new Oe(r, n, "drop"), n.dropzone = r.cur.dropzone, n.relatedTarget = r.cur.element), n.type === "dragmove" && r.cur.dropzone && (o.move = new Oe(r, n, "dropmove"), n.dropzone = r.cur.dropzone)), o;
|
|
1427
1438
|
}
|
|
1428
|
-
function
|
|
1439
|
+
function Et(t, e) {
|
|
1429
1440
|
var n = t.dropState, r = n.activeDrops, o = n.cur, i = n.prev;
|
|
1430
1441
|
e.leave && i.dropzone.fire(e.leave), e.enter && o.dropzone.fire(e.enter), e.move && o.dropzone.fire(e.move), e.drop && o.dropzone.fire(e.drop), e.deactivate && Xt(r, e.deactivate), n.prev.dropzone = o.dropzone, n.prev.element = o.element;
|
|
1431
1442
|
}
|
|
@@ -1435,7 +1446,7 @@ function Vo() {
|
|
|
1435
1446
|
var i = n.dropState;
|
|
1436
1447
|
e.dynamicDrop && (i.activeDrops = xt(e, n.element));
|
|
1437
1448
|
var a = r, s = Gt(n, a, o);
|
|
1438
|
-
i.rejected = i.rejected && !!s && s.dropzone === i.cur.dropzone && s.element === i.cur.element, i.cur.dropzone = s && s.dropzone, i.cur.element = s && s.element, i.events =
|
|
1449
|
+
i.rejected = i.rejected && !!s && s.dropzone === i.cur.dropzone && s.element === i.cur.element, i.cur.dropzone = s && s.dropzone, i.cur.element = s && s.element, i.events = wt(n, 0, a);
|
|
1439
1450
|
}
|
|
1440
1451
|
}
|
|
1441
1452
|
var Jt = { id: "actions/drop", install: function(t) {
|
|
@@ -1454,22 +1465,22 @@ function Vo() {
|
|
|
1454
1465
|
return b.bool(s) ? (a.options.drop.enabled = s, a) : a.options.drop;
|
|
1455
1466
|
})(this, i);
|
|
1456
1467
|
}, r.prototype.dropCheck = function(i, a, s, l, u, c) {
|
|
1457
|
-
return (function(f, y, C, k,
|
|
1468
|
+
return (function(f, y, C, k, S, P, R) {
|
|
1458
1469
|
var O = !1;
|
|
1459
|
-
if (!(
|
|
1460
|
-
var
|
|
1461
|
-
if (
|
|
1462
|
-
var K = Le(k,
|
|
1463
|
-
|
|
1464
|
-
var
|
|
1465
|
-
O =
|
|
1470
|
+
if (!(R = R || f.getRect(P))) return !!f.options.drop.checker && f.options.drop.checker(y, C, O, f, P, k, S);
|
|
1471
|
+
var W = f.options.drop.overlap;
|
|
1472
|
+
if (W === "pointer") {
|
|
1473
|
+
var K = Le(k, S, "drag"), z = qt(y);
|
|
1474
|
+
z.x += K.x, z.y += K.y;
|
|
1475
|
+
var $ = z.x > R.left && z.x < R.right, me = z.y > R.top && z.y < R.bottom;
|
|
1476
|
+
O = $ && me;
|
|
1466
1477
|
}
|
|
1467
|
-
var ae = k.getRect(
|
|
1468
|
-
if (ae &&
|
|
1478
|
+
var ae = k.getRect(S);
|
|
1479
|
+
if (ae && W === "center") {
|
|
1469
1480
|
var ge = ae.left + ae.width / 2, be = ae.top + ae.height / 2;
|
|
1470
|
-
O = ge >=
|
|
1481
|
+
O = ge >= R.left && ge <= R.right && be >= R.top && be <= R.bottom;
|
|
1471
1482
|
}
|
|
1472
|
-
return ae && b.number(
|
|
1483
|
+
return ae && b.number(W) && (O = Math.max(0, Math.min(R.right, ae.right) - Math.max(R.left, ae.left)) * Math.max(0, Math.min(R.bottom, ae.bottom) - Math.max(R.top, ae.top)) / (ae.width * ae.height) >= W), f.options.drop.checker && (O = f.options.drop.checker(y, C, O, f, P, k, S)), O;
|
|
1473
1484
|
})(this, i, a, s, l, u, c);
|
|
1474
1485
|
}, n.dynamicDrop = function(i) {
|
|
1475
1486
|
return b.bool(i) ? (t.dynamicDrop = i, n) : t.dynamicDrop;
|
|
@@ -1481,18 +1492,18 @@ function Vo() {
|
|
|
1481
1492
|
var n = t.interaction, r = (t.event, t.iEvent);
|
|
1482
1493
|
if (n.prepared.name === "drag") {
|
|
1483
1494
|
var o = n.dropState;
|
|
1484
|
-
o.activeDrops = [], o.events = {}, o.activeDrops = xt(e, n.element), o.events =
|
|
1495
|
+
o.activeDrops = [], o.events = {}, o.activeDrops = xt(e, n.element), o.events = wt(n, 0, r), o.events.activate && (Xt(o.activeDrops, o.events.activate), e.fire("actions/drop:start", { interaction: n, dragEvent: r }));
|
|
1485
1496
|
}
|
|
1486
1497
|
}, "interactions:action-move": Kt, "interactions:after-action-move": function(t, e) {
|
|
1487
1498
|
var n = t.interaction, r = t.iEvent;
|
|
1488
1499
|
if (n.prepared.name === "drag") {
|
|
1489
1500
|
var o = n.dropState;
|
|
1490
|
-
|
|
1501
|
+
Et(n, o.events), e.fire("actions/drop:move", { interaction: n, dragEvent: r }), o.events = {};
|
|
1491
1502
|
}
|
|
1492
1503
|
}, "interactions:action-end": function(t, e) {
|
|
1493
1504
|
if (t.interaction.prepared.name === "drag") {
|
|
1494
1505
|
var n = t.interaction, r = t.iEvent;
|
|
1495
|
-
Kt(t, e),
|
|
1506
|
+
Kt(t, e), Et(n, n.dropState.events), e.fire("actions/drop:end", { interaction: n, dragEvent: r });
|
|
1496
1507
|
}
|
|
1497
1508
|
}, "interactions:stop": function(t) {
|
|
1498
1509
|
var e = t.interaction;
|
|
@@ -1500,7 +1511,7 @@ function Vo() {
|
|
|
1500
1511
|
var n = e.dropState;
|
|
1501
1512
|
n && (n.activeDrops = null, n.events = null, n.cur.dropzone = null, n.cur.element = null, n.prev.dropzone = null, n.prev.element = null, n.rejected = !1);
|
|
1502
1513
|
}
|
|
1503
|
-
} }, getActiveDrops: xt, getDrop: Gt, getDropEvents:
|
|
1514
|
+
} }, getActiveDrops: xt, getDrop: Gt, getDropEvents: wt, fireDropEvents: Et, filterEventType: function(t) {
|
|
1504
1515
|
return t.search("drag") === 0 || t.search("drop") === 0;
|
|
1505
1516
|
}, defaults: { enabled: !1, accept: null, overlap: "pointer" } }, Hn = Jt;
|
|
1506
1517
|
function kt(t) {
|
|
@@ -1549,7 +1560,7 @@ function Vo() {
|
|
|
1549
1560
|
if (t === "right") return n.x > (s >= 0 ? i.right : i.left) - a;
|
|
1550
1561
|
if (t === "bottom") return n.y > (l >= 0 ? i.bottom : i.top) - a;
|
|
1551
1562
|
}
|
|
1552
|
-
return !!b.element(r) && (b.element(e) ? e === r :
|
|
1563
|
+
return !!b.element(r) && (b.element(e) ? e === r : j(r, e, o));
|
|
1553
1564
|
}
|
|
1554
1565
|
function Qt(t) {
|
|
1555
1566
|
var e = t.iEvent, n = t.interaction;
|
|
@@ -1594,7 +1605,7 @@ function Vo() {
|
|
|
1594
1605
|
}
|
|
1595
1606
|
}
|
|
1596
1607
|
} else c.top = Math.min(s.top, u.bottom), c.bottom = Math.max(s.bottom, u.top), c.left = Math.min(s.left, u.right), c.right = Math.max(s.right, u.left);
|
|
1597
|
-
for (var
|
|
1608
|
+
for (var S in c.width = c.right - c.left, c.height = c.bottom - c.top, c) f[S] = c[S] - y[S];
|
|
1598
1609
|
o.edges = r.prepared.edges, o.rect = c, o.deltaRect = f;
|
|
1599
1610
|
}
|
|
1600
1611
|
})(t), Qt(t);
|
|
@@ -1652,37 +1663,37 @@ function Vo() {
|
|
|
1652
1663
|
}, Pe = function(o) {
|
|
1653
1664
|
return clearTimeout(o);
|
|
1654
1665
|
});
|
|
1655
|
-
} },
|
|
1656
|
-
|
|
1666
|
+
} }, H = { defaults: { enabled: !1, margin: 60, container: null, speed: 300 }, now: Date.now, interaction: null, i: 0, x: 0, y: 0, isScrolling: !1, prevTime: 0, margin: 0, speed: 0, start: function(t) {
|
|
1667
|
+
H.isScrolling = !0, Te.cancel(H.i), t.autoScroll = H, H.interaction = t, H.prevTime = H.now(), H.i = Te.request(H.scroll);
|
|
1657
1668
|
}, stop: function() {
|
|
1658
|
-
|
|
1669
|
+
H.isScrolling = !1, H.interaction && (H.interaction.autoScroll = null), Te.cancel(H.i);
|
|
1659
1670
|
}, scroll: function() {
|
|
1660
|
-
var t =
|
|
1671
|
+
var t = H.interaction, e = t.interactable, n = t.element, r = t.prepared.name, o = e.options[r].autoScroll, i = en(o.container, e, n), a = H.now(), s = (a - H.prevTime) / 1e3, l = o.speed * s;
|
|
1661
1672
|
if (l >= 1) {
|
|
1662
|
-
var u = { x:
|
|
1673
|
+
var u = { x: H.x * l, y: H.y * l };
|
|
1663
1674
|
if (u.x || u.y) {
|
|
1664
1675
|
var c = tn(i);
|
|
1665
1676
|
b.window(i) ? i.scrollBy(u.x, u.y) : i && (i.scrollLeft += u.x, i.scrollTop += u.y);
|
|
1666
1677
|
var f = tn(i), y = { x: f.x - c.x, y: f.y - c.y };
|
|
1667
1678
|
(y.x || y.y) && e.fire({ type: "autoscroll", target: n, interactable: e, delta: y, interaction: t, container: i });
|
|
1668
1679
|
}
|
|
1669
|
-
|
|
1680
|
+
H.prevTime = a;
|
|
1670
1681
|
}
|
|
1671
|
-
|
|
1682
|
+
H.isScrolling && (Te.cancel(H.i), H.i = Te.request(H.scroll));
|
|
1672
1683
|
}, check: function(t, e) {
|
|
1673
1684
|
var n;
|
|
1674
1685
|
return (n = t.options[e].autoScroll) == null ? void 0 : n.enabled;
|
|
1675
1686
|
}, onInteractionMove: function(t) {
|
|
1676
1687
|
var e = t.interaction, n = t.pointer;
|
|
1677
|
-
if (e.interacting() &&
|
|
1688
|
+
if (e.interacting() && H.check(e.interactable, e.prepared.name)) if (e.simulation) H.x = H.y = 0;
|
|
1678
1689
|
else {
|
|
1679
1690
|
var r, o, i, a, s = e.interactable, l = e.element, u = e.prepared.name, c = s.options[u].autoScroll, f = en(c.container, s, l);
|
|
1680
|
-
if (b.window(f)) a = n.clientX <
|
|
1691
|
+
if (b.window(f)) a = n.clientX < H.margin, r = n.clientY < H.margin, o = n.clientX > f.innerWidth - H.margin, i = n.clientY > f.innerHeight - H.margin;
|
|
1681
1692
|
else {
|
|
1682
1693
|
var y = xe(f);
|
|
1683
|
-
a = n.clientX < y.left +
|
|
1694
|
+
a = n.clientX < y.left + H.margin, r = n.clientY < y.top + H.margin, o = n.clientX > y.right - H.margin, i = n.clientY > y.bottom - H.margin;
|
|
1684
1695
|
}
|
|
1685
|
-
|
|
1696
|
+
H.x = o ? 1 : a ? -1 : 0, H.y = i ? 1 : r ? -1 : 0, H.isScrolling || (H.margin = c.margin, H.speed = c.speed, H.start(e));
|
|
1686
1697
|
}
|
|
1687
1698
|
} };
|
|
1688
1699
|
function en(t, e, n) {
|
|
@@ -1693,15 +1704,15 @@ function Vo() {
|
|
|
1693
1704
|
}
|
|
1694
1705
|
var Yn = { id: "auto-scroll", install: function(t) {
|
|
1695
1706
|
var e = t.defaults, n = t.actions;
|
|
1696
|
-
t.autoScroll =
|
|
1707
|
+
t.autoScroll = H, H.now = function() {
|
|
1697
1708
|
return t.now();
|
|
1698
|
-
}, n.phaselessTypes.autoscroll = !0, e.perAction.autoScroll =
|
|
1709
|
+
}, n.phaselessTypes.autoscroll = !0, e.perAction.autoScroll = H.defaults;
|
|
1699
1710
|
}, listeners: { "interactions:new": function(t) {
|
|
1700
1711
|
t.interaction.autoScroll = null;
|
|
1701
1712
|
}, "interactions:destroy": function(t) {
|
|
1702
|
-
t.interaction.autoScroll = null,
|
|
1703
|
-
}, "interactions:stop":
|
|
1704
|
-
return
|
|
1713
|
+
t.interaction.autoScroll = null, H.stop(), H.interaction && (H.interaction = null);
|
|
1714
|
+
}, "interactions:stop": H.stop, "interactions:action-move": function(t) {
|
|
1715
|
+
return H.onInteractionMove(t);
|
|
1705
1716
|
} } }, $n = Yn;
|
|
1706
1717
|
function qe(t, e) {
|
|
1707
1718
|
var n = !1;
|
|
@@ -1821,14 +1832,14 @@ function Vo() {
|
|
|
1821
1832
|
n.prepared.name = null;
|
|
1822
1833
|
for (var f = r, y = function(k) {
|
|
1823
1834
|
if (k !== n.interactable) {
|
|
1824
|
-
var
|
|
1825
|
-
if (!
|
|
1826
|
-
var
|
|
1827
|
-
if (
|
|
1835
|
+
var S = n.interactable.options.drag;
|
|
1836
|
+
if (!S.manualStart && k.testIgnoreAllow(S, f, r)) {
|
|
1837
|
+
var P = k.getAction(n.downPointer, n.downEvent, n, f);
|
|
1838
|
+
if (P && P.name === "drag" && (function(R, O) {
|
|
1828
1839
|
if (!O) return !1;
|
|
1829
|
-
var
|
|
1830
|
-
return
|
|
1831
|
-
})(c, k) && _t.validateAction(
|
|
1840
|
+
var W = O.options.drag.startAxis;
|
|
1841
|
+
return R === "xy" || W === "xy" || W === R;
|
|
1842
|
+
})(c, k) && _t.validateAction(P, k, f, r, e)) return k;
|
|
1832
1843
|
}
|
|
1833
1844
|
}
|
|
1834
1845
|
}; b.element(f); ) {
|
|
@@ -1910,7 +1921,7 @@ function Vo() {
|
|
|
1910
1921
|
}
|
|
1911
1922
|
var Rt = (function() {
|
|
1912
1923
|
function t(e) {
|
|
1913
|
-
|
|
1924
|
+
g(this, t), this.states = [], this.startOffset = { left: 0, right: 0, top: 0, bottom: 0 }, this.startDelta = void 0, this.result = void 0, this.endResult = void 0, this.startEdges = void 0, this.edges = void 0, this.interaction = void 0, this.interaction = e, this.result = st(), this.edges = { left: !1, right: !1, top: !1, bottom: !1 };
|
|
1914
1925
|
}
|
|
1915
1926
|
return x(t, [{ key: "start", value: function(e, n) {
|
|
1916
1927
|
var r, o, i = e.phase, a = this.interaction, s = (function(u) {
|
|
@@ -1941,10 +1952,10 @@ function Vo() {
|
|
|
1941
1952
|
(c = f.methods) != null && c.set && this.shouldDo(y, r, n) && (e.state = f, k = f.methods.set(e), et(e.edges, e.rect, { x: e.coords.x - C.x, y: e.coords.y - C.y })), l.eventProps.push(k);
|
|
1942
1953
|
}
|
|
1943
1954
|
I(this.edges, e.edges), l.delta.x = e.coords.x - e.pageCoords.x, l.delta.y = e.coords.y - e.pageCoords.y, l.rectDelta.left = e.rect.left - i.left, l.rectDelta.right = e.rect.right - i.right, l.rectDelta.top = e.rect.top - i.top, l.rectDelta.bottom = e.rect.bottom - i.bottom;
|
|
1944
|
-
var
|
|
1945
|
-
if (
|
|
1946
|
-
var
|
|
1947
|
-
l.changed =
|
|
1955
|
+
var S = this.result.coords, P = this.result.rect;
|
|
1956
|
+
if (S && P) {
|
|
1957
|
+
var R = l.rect.left !== P.left || l.rect.right !== P.right || l.rect.top !== P.top || l.rect.bottom !== P.bottom;
|
|
1958
|
+
l.changed = R || S.x !== l.coords.x || S.y !== l.coords.y;
|
|
1948
1959
|
}
|
|
1949
1960
|
return l;
|
|
1950
1961
|
} }, { key: "applyToInteraction", value: function(e) {
|
|
@@ -1954,8 +1965,8 @@ function Vo() {
|
|
|
1954
1965
|
var f = c[u], y = f[0], C = f[1];
|
|
1955
1966
|
y.page.x += C.x, y.page.y += C.y, y.client.x += C.x, y.client.y += C.y;
|
|
1956
1967
|
}
|
|
1957
|
-
var k = this.result.rectDelta,
|
|
1958
|
-
|
|
1968
|
+
var k = this.result.rectDelta, S = e.rect || n.rect;
|
|
1969
|
+
S.left += k.left, S.right += k.right, S.top += k.top, S.bottom += k.bottom, S.width = S.right - S.left, S.height = S.bottom - S.top;
|
|
1959
1970
|
} }, { key: "setAndApply", value: function(e) {
|
|
1960
1971
|
var n = this.interaction, r = e.phase, o = e.preEnd, i = e.skipModifiers, a = this.setAll(this.fillArg({ preEnd: o, phase: r, pageCoords: e.modifiedCoords || n.coords.cur.page }));
|
|
1961
1972
|
if (this.result = a, !a.changed && (!i || i < this.states.length) && n.interacting()) return !1;
|
|
@@ -2055,12 +2066,12 @@ function Vo() {
|
|
|
2055
2066
|
return t.interaction.modification.stop(t);
|
|
2056
2067
|
} } }, cn = or, un = { base: { preventDefault: "auto", deltaSource: "page" }, perAction: { enabled: !1, origin: { x: 0, y: 0 } }, actions: {} }, At = (function(t) {
|
|
2057
2068
|
_(n, t);
|
|
2058
|
-
var e =
|
|
2069
|
+
var e = A(n);
|
|
2059
2070
|
function n(r, o, i, a, s, l, u) {
|
|
2060
2071
|
var c;
|
|
2061
|
-
|
|
2062
|
-
var f = r.interactable, y = (f && f.options || un).deltaSource, C = Le(f, s, i), k = a === "start",
|
|
2063
|
-
return c.page = I({},
|
|
2072
|
+
g(this, n), (c = e.call(this, r)).relatedTarget = null, c.screenX = void 0, c.screenY = void 0, c.button = void 0, c.buttons = void 0, c.ctrlKey = void 0, c.shiftKey = void 0, c.altKey = void 0, c.metaKey = void 0, c.page = void 0, c.client = void 0, c.delta = void 0, c.rect = void 0, c.x0 = void 0, c.y0 = void 0, c.t0 = void 0, c.dt = void 0, c.duration = void 0, c.clientX0 = void 0, c.clientY0 = void 0, c.velocity = void 0, c.speed = void 0, c.swipe = void 0, c.axes = void 0, c.preEnd = void 0, s = s || r.element;
|
|
2073
|
+
var f = r.interactable, y = (f && f.options || un).deltaSource, C = Le(f, s, i), k = a === "start", S = a === "end", P = k ? X(c) : r.prevEvent, R = k ? r.coords.start : S ? { page: P.page, client: P.client, timeStamp: r.coords.cur.timeStamp } : r.coords.cur;
|
|
2074
|
+
return c.page = I({}, R.page), c.client = I({}, R.client), c.rect = I({}, r.rect), c.timeStamp = R.timeStamp, S || (c.page.x -= C.x, c.page.y -= C.y, c.client.x -= C.x, c.client.y -= C.y), c.ctrlKey = o.ctrlKey, c.altKey = o.altKey, c.shiftKey = o.shiftKey, c.metaKey = o.metaKey, c.button = o.button, c.buttons = o.buttons, c.target = s, c.currentTarget = s, c.preEnd = l, c.type = u || i + (a || ""), c.interactable = f, c.t0 = k ? r.pointers[r.pointers.length - 1].downTime : P.t0, c.x0 = r.coords.start.page.x - C.x, c.y0 = r.coords.start.page.y - C.y, c.clientX0 = r.coords.start.client.x - C.x, c.clientY0 = r.coords.start.client.y - C.y, c.delta = k || S ? { x: 0, y: 0 } : { x: c[y].x - P[y].x, y: c[y].y - P[y].y }, c.dt = r.coords.delta.timeStamp, c.duration = c.timeStamp - c.t0, c.velocity = I({}, r.coords.velocity[y]), c.speed = Fe(c.velocity.x, c.velocity.y), c.swipe = S || a === "inertiastart" ? c.getSwipe() : null, c;
|
|
2064
2075
|
}
|
|
2065
2076
|
return x(n, [{ key: "getSwipe", value: function() {
|
|
2066
2077
|
var r = this._interaction;
|
|
@@ -2110,7 +2121,7 @@ function Vo() {
|
|
|
2110
2121
|
this.velocity.y = t;
|
|
2111
2122
|
} } });
|
|
2112
2123
|
var ir = x((function t(e, n, r, o, i) {
|
|
2113
|
-
|
|
2124
|
+
g(this, t), this.id = void 0, this.pointer = void 0, this.event = void 0, this.downTime = void 0, this.downTarget = void 0, this.id = e, this.pointer = n, this.event = r, this.downTime = o, this.downTarget = i;
|
|
2114
2125
|
})), ar = (function(t) {
|
|
2115
2126
|
return t.interactable = "", t.element = "", t.prepared = "", t.pointerIsDown = "", t.pointerWasMoved = "", t._proxy = "", t;
|
|
2116
2127
|
})({}), dn = (function(t) {
|
|
@@ -2118,7 +2129,7 @@ function Vo() {
|
|
|
2118
2129
|
})({}), sr = 0, lr = (function() {
|
|
2119
2130
|
function t(e) {
|
|
2120
2131
|
var n = this, r = e.pointerType, o = e.scopeFire;
|
|
2121
|
-
|
|
2132
|
+
g(this, t), this.interactable = null, this.element = null, this.rect = null, this._rects = void 0, this.edges = null, this._scopeFire = void 0, this.prepared = { name: null, axis: null, edges: null }, this.pointerType = void 0, this.pointers = [], this.downEvent = null, this.downPointer = {}, this._latestPointer = { pointer: null, event: null, eventTarget: null }, this.prevEvent = null, this.pointerIsDown = !1, this.pointerWasMoved = !1, this._interacting = !1, this._ending = !1, this._stopped = !0, this._proxy = void 0, this.simulation = null, this.doMove = qe((function(c) {
|
|
2122
2133
|
this.move(c);
|
|
2123
2134
|
}), "The interaction.doMove() method has been renamed to interaction.move()"), this.coords = { start: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, prev: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, cur: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, delta: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 }, velocity: { page: { x: 0, y: 0 }, client: { x: 0, y: 0 }, timeStamp: 0 } }, this._id = sr++, this._scopeFire = o, this.pointerType = r;
|
|
2124
2135
|
var i = this;
|
|
@@ -2239,7 +2250,7 @@ function Vo() {
|
|
|
2239
2250
|
e.offset.total.x = 0, e.offset.total.y = 0, e.offset.pending.x = 0, e.offset.pending.y = 0;
|
|
2240
2251
|
} } }, hn = ur, dr = (function() {
|
|
2241
2252
|
function t(e) {
|
|
2242
|
-
|
|
2253
|
+
g(this, t), this.active = !1, this.isModified = !1, this.smoothEnd = !1, this.allowResume = !1, this.modification = void 0, this.modifierCount = 0, this.modifierArg = void 0, this.startCoords = void 0, this.t0 = 0, this.v0 = 0, this.te = 0, this.targetOffset = void 0, this.modifiedOffset = void 0, this.currentOffset = void 0, this.lambda_v0 = 0, this.one_ve_v0 = 0, this.timeout = void 0, this.interaction = void 0, this.interaction = e;
|
|
2243
2254
|
}
|
|
2244
2255
|
return x(t, [{ key: "start", value: function(e) {
|
|
2245
2256
|
var n = this.interaction, r = lt(n);
|
|
@@ -2347,7 +2358,7 @@ function Vo() {
|
|
|
2347
2358
|
}
|
|
2348
2359
|
var yn = (function() {
|
|
2349
2360
|
function t(e) {
|
|
2350
|
-
|
|
2361
|
+
g(this, t), this.options = void 0, this.types = {}, this.propagationStopped = !1, this.immediatePropagationStopped = !1, this.global = void 0, this.options = I({}, e || {});
|
|
2351
2362
|
}
|
|
2352
2363
|
return x(t, [{ key: "fire", value: function(e) {
|
|
2353
2364
|
var n, r = this.global;
|
|
@@ -2369,7 +2380,7 @@ function Vo() {
|
|
|
2369
2380
|
} }]), t;
|
|
2370
2381
|
})(), hr = (function() {
|
|
2371
2382
|
function t(e) {
|
|
2372
|
-
|
|
2383
|
+
g(this, t), this.currentTarget = void 0, this.originalEvent = void 0, this.type = void 0, this.originalEvent = e, tt(this, e);
|
|
2373
2384
|
}
|
|
2374
2385
|
return x(t, [{ key: "preventOriginalDefault", value: function() {
|
|
2375
2386
|
this.originalEvent.preventDefault();
|
|
@@ -2387,28 +2398,28 @@ function Vo() {
|
|
|
2387
2398
|
}
|
|
2388
2399
|
var vr = { id: "events", install: function(t) {
|
|
2389
2400
|
var e, n = [], r = {}, o = [], i = { add: a, remove: s, addDelegate: function(c, f, y, C, k) {
|
|
2390
|
-
var
|
|
2401
|
+
var S = Ve(k);
|
|
2391
2402
|
if (!r[y]) {
|
|
2392
2403
|
r[y] = [];
|
|
2393
|
-
for (var
|
|
2394
|
-
var
|
|
2395
|
-
a(
|
|
2404
|
+
for (var P = 0; P < o.length; P++) {
|
|
2405
|
+
var R = o[P];
|
|
2406
|
+
a(R, y, l), a(R, y, u, !0);
|
|
2396
2407
|
}
|
|
2397
2408
|
}
|
|
2398
|
-
var O = r[y],
|
|
2409
|
+
var O = r[y], W = Be(O, (function(K) {
|
|
2399
2410
|
return K.selector === c && K.context === f;
|
|
2400
2411
|
}));
|
|
2401
|
-
|
|
2412
|
+
W || (W = { selector: c, context: f, listeners: [] }, O.push(W)), W.listeners.push({ func: C, options: S });
|
|
2402
2413
|
}, removeDelegate: function(c, f, y, C, k) {
|
|
2403
|
-
var
|
|
2404
|
-
if (
|
|
2405
|
-
for (
|
|
2406
|
-
var
|
|
2407
|
-
if (
|
|
2408
|
-
for (var K =
|
|
2409
|
-
var
|
|
2410
|
-
if (
|
|
2411
|
-
K.splice(
|
|
2414
|
+
var S, P = Ve(k), R = r[y], O = !1;
|
|
2415
|
+
if (R)
|
|
2416
|
+
for (S = R.length - 1; S >= 0; S--) {
|
|
2417
|
+
var W = R[S];
|
|
2418
|
+
if (W.selector === c && W.context === f) {
|
|
2419
|
+
for (var K = W.listeners, z = K.length - 1; z >= 0; z--) {
|
|
2420
|
+
var $ = K[z];
|
|
2421
|
+
if ($.func === C && ct($.options, P)) {
|
|
2422
|
+
K.splice(z, 1), K.length || (R.splice(S, 1), s(f, y, l), s(f, y, u, !0)), O = !0;
|
|
2412
2423
|
break;
|
|
2413
2424
|
}
|
|
2414
2425
|
}
|
|
@@ -2418,55 +2429,55 @@ function Vo() {
|
|
|
2418
2429
|
}, delegateListener: l, delegateUseCapture: u, delegatedEvents: r, documents: o, targets: n, supportsOptions: !1, supportsPassive: !1 };
|
|
2419
2430
|
function a(c, f, y, C) {
|
|
2420
2431
|
if (c.addEventListener) {
|
|
2421
|
-
var k = Ve(C),
|
|
2422
|
-
return
|
|
2432
|
+
var k = Ve(C), S = Be(n, (function(P) {
|
|
2433
|
+
return P.eventTarget === c;
|
|
2423
2434
|
}));
|
|
2424
|
-
|
|
2425
|
-
return
|
|
2426
|
-
})) || (c.addEventListener(f, y, i.supportsOptions ? k : k.capture),
|
|
2435
|
+
S || (S = { eventTarget: c, events: {} }, n.push(S)), S.events[f] || (S.events[f] = []), Be(S.events[f], (function(P) {
|
|
2436
|
+
return P.func === y && ct(P.options, k);
|
|
2437
|
+
})) || (c.addEventListener(f, y, i.supportsOptions ? k : k.capture), S.events[f].push({ func: y, options: k }));
|
|
2427
2438
|
}
|
|
2428
2439
|
}
|
|
2429
2440
|
function s(c, f, y, C) {
|
|
2430
2441
|
if (c.addEventListener && c.removeEventListener) {
|
|
2431
2442
|
var k = He(n, (function(me) {
|
|
2432
2443
|
return me.eventTarget === c;
|
|
2433
|
-
})),
|
|
2434
|
-
if (
|
|
2435
|
-
var
|
|
2436
|
-
if (
|
|
2444
|
+
})), S = n[k];
|
|
2445
|
+
if (S && S.events) if (f !== "all") {
|
|
2446
|
+
var P = !1, R = S.events[f];
|
|
2447
|
+
if (R) {
|
|
2437
2448
|
if (y === "all") {
|
|
2438
|
-
for (var O =
|
|
2439
|
-
var
|
|
2440
|
-
s(c, f,
|
|
2449
|
+
for (var O = R.length - 1; O >= 0; O--) {
|
|
2450
|
+
var W = R[O];
|
|
2451
|
+
s(c, f, W.func, W.options);
|
|
2441
2452
|
}
|
|
2442
2453
|
return;
|
|
2443
2454
|
}
|
|
2444
|
-
for (var K = Ve(C),
|
|
2445
|
-
var
|
|
2446
|
-
if (
|
|
2447
|
-
c.removeEventListener(f, y, i.supportsOptions ? K : K.capture),
|
|
2455
|
+
for (var K = Ve(C), z = 0; z < R.length; z++) {
|
|
2456
|
+
var $ = R[z];
|
|
2457
|
+
if ($.func === y && ct($.options, K)) {
|
|
2458
|
+
c.removeEventListener(f, y, i.supportsOptions ? K : K.capture), R.splice(z, 1), R.length === 0 && (delete S.events[f], P = !0);
|
|
2448
2459
|
break;
|
|
2449
2460
|
}
|
|
2450
2461
|
}
|
|
2451
2462
|
}
|
|
2452
|
-
|
|
2453
|
-
} else for (f in
|
|
2463
|
+
P && !Object.keys(S.events).length && n.splice(k, 1);
|
|
2464
|
+
} else for (f in S.events) S.events.hasOwnProperty(f) && s(c, f, "all");
|
|
2454
2465
|
}
|
|
2455
2466
|
}
|
|
2456
2467
|
function l(c, f) {
|
|
2457
|
-
for (var y = Ve(f), C = new hr(c), k = r[c.type],
|
|
2458
|
-
for (var
|
|
2459
|
-
var O = k[
|
|
2460
|
-
if (he(
|
|
2461
|
-
var
|
|
2462
|
-
C.currentTarget =
|
|
2463
|
-
for (var
|
|
2464
|
-
var me =
|
|
2468
|
+
for (var y = Ve(f), C = new hr(c), k = r[c.type], S = Yt(c)[0], P = S; b.element(P); ) {
|
|
2469
|
+
for (var R = 0; R < k.length; R++) {
|
|
2470
|
+
var O = k[R], W = O.selector, K = O.context;
|
|
2471
|
+
if (he(P, W) && se(K, S) && se(K, P)) {
|
|
2472
|
+
var z = O.listeners;
|
|
2473
|
+
C.currentTarget = P;
|
|
2474
|
+
for (var $ = 0; $ < z.length; $++) {
|
|
2475
|
+
var me = z[$];
|
|
2465
2476
|
ct(me.options, y) && me.func(C);
|
|
2466
2477
|
}
|
|
2467
2478
|
}
|
|
2468
2479
|
}
|
|
2469
|
-
|
|
2480
|
+
P = fe(P);
|
|
2470
2481
|
}
|
|
2471
2482
|
}
|
|
2472
2483
|
function u(c) {
|
|
@@ -2540,27 +2551,27 @@ function Vo() {
|
|
|
2540
2551
|
if (/^touch/.test(n.type)) {
|
|
2541
2552
|
e.prevTouchTime = e.now();
|
|
2542
2553
|
for (var u = 0, c = n.changedTouches; u < c.length; u++) {
|
|
2543
|
-
var f = c[u], y = { pointer: f, pointerId: je(f), pointerType: o, eventType: n.type, eventTarget: a, curEventTarget: s, scope: e }, C =
|
|
2554
|
+
var f = c[u], y = { pointer: f, pointerId: je(f), pointerType: o, eventType: n.type, eventTarget: a, curEventTarget: s, scope: e }, C = wn(y);
|
|
2544
2555
|
l.push([y.pointer, y.eventTarget, y.curEventTarget, C]);
|
|
2545
2556
|
}
|
|
2546
2557
|
} else {
|
|
2547
2558
|
var k = !1;
|
|
2548
2559
|
if (!ee.supportsPointerEvent && /mouse/.test(n.type)) {
|
|
2549
|
-
for (var
|
|
2560
|
+
for (var S = 0; S < r.length && !k; S++) k = r[S].pointerType !== "mouse" && r[S].pointerIsDown;
|
|
2550
2561
|
k = k || e.now() - e.prevTouchTime < 500 || n.timeStamp === 0;
|
|
2551
2562
|
}
|
|
2552
2563
|
if (!k) {
|
|
2553
|
-
var
|
|
2554
|
-
l.push([
|
|
2564
|
+
var P = { pointer: n, pointerId: je(n), pointerType: o, eventType: n.type, curEventTarget: s, eventTarget: a, scope: e }, R = wn(P);
|
|
2565
|
+
l.push([P.pointer, P.eventTarget, P.curEventTarget, R]);
|
|
2555
2566
|
}
|
|
2556
2567
|
}
|
|
2557
2568
|
for (var O = 0; O < l.length; O++) {
|
|
2558
|
-
var
|
|
2559
|
-
|
|
2569
|
+
var W = l[O], K = W[0], z = W[1], $ = W[2];
|
|
2570
|
+
W[3][t](K, n, z, $);
|
|
2560
2571
|
}
|
|
2561
2572
|
};
|
|
2562
2573
|
}
|
|
2563
|
-
function
|
|
2574
|
+
function wn(t) {
|
|
2564
2575
|
var e = t.pointerType, n = t.scope, r = { interaction: mr.search(t), searchDetails: t };
|
|
2565
2576
|
return n.fire("interactions:find", r), r.interaction || n.interactions.new({ pointerType: e });
|
|
2566
2577
|
}
|
|
@@ -2589,14 +2600,14 @@ function Vo() {
|
|
|
2589
2600
|
}, f = 0, y = u.pointers; f < y.length; f++) c();
|
|
2590
2601
|
}
|
|
2591
2602
|
}
|
|
2592
|
-
(o =
|
|
2603
|
+
(o = V.PointerEvent ? [{ type: i.down, listener: a }, { type: i.down, listener: e.pointerDown }, { type: i.move, listener: e.pointerMove }, { type: i.up, listener: e.pointerUp }, { type: i.cancel, listener: e.pointerUp }] : [{ type: "mousedown", listener: e.pointerDown }, { type: "mousemove", listener: e.pointerMove }, { type: "mouseup", listener: e.pointerUp }, { type: "touchstart", listener: a }, { type: "touchstart", listener: e.pointerDown }, { type: "touchmove", listener: e.pointerMove }, { type: "touchend", listener: e.pointerUp }, { type: "touchcancel", listener: e.pointerUp }]).push({ type: "blur", listener: function(s) {
|
|
2593
2604
|
for (var l = 0, u = t.interactions.list; l < u.length; l++)
|
|
2594
2605
|
u[l].documentBlur(s);
|
|
2595
2606
|
} }), t.prevTouchTime = 0, t.Interaction = (function(s) {
|
|
2596
2607
|
_(u, s);
|
|
2597
|
-
var l =
|
|
2608
|
+
var l = A(u);
|
|
2598
2609
|
function u() {
|
|
2599
|
-
return
|
|
2610
|
+
return g(this, u), l.apply(this, arguments);
|
|
2600
2611
|
}
|
|
2601
2612
|
return x(u, [{ key: "pointerMoveTolerance", get: function() {
|
|
2602
2613
|
return t.interactions.pointerMoveTolerance;
|
|
@@ -2625,7 +2636,7 @@ function Vo() {
|
|
|
2625
2636
|
return t[t.On = 0] = "On", t[t.Off = 1] = "Off", t;
|
|
2626
2637
|
})(Me || {}), br = (function() {
|
|
2627
2638
|
function t(e, n, r, o) {
|
|
2628
|
-
|
|
2639
|
+
g(this, t), this.target = void 0, this.options = void 0, this._actions = void 0, this.events = new yn(), this._context = void 0, this._win = void 0, this._doc = void 0, this._scopeEvents = void 0, this._actions = n.actions, this.target = e, this._context = n.context || r, this._win = te(Ee(e) ? this._context : e), this._doc = this._win.document, this._scopeEvents = o, this.set(n);
|
|
2629
2640
|
}
|
|
2630
2641
|
return x(t, [{ key: "_defaults", get: function() {
|
|
2631
2642
|
return { base: {}, perAction: {}, actions: {} };
|
|
@@ -2643,7 +2654,7 @@ function Vo() {
|
|
|
2643
2654
|
i === "listeners" && this.updatePerActionListeners(e, a.listeners, s), b.array(s) ? a[i] = Ut(s) : b.plainObject(s) ? (a[i] = I(a[i] || {}, De(s)), b.object(r.perAction[i]) && "enabled" in r.perAction[i] && (a[i].enabled = s.enabled !== !1)) : b.bool(s) && b.object(r.perAction[i]) ? a[i].enabled = s : a[i] = s;
|
|
2644
2655
|
}
|
|
2645
2656
|
} }, { key: "getRect", value: function(e) {
|
|
2646
|
-
return e = e || (b.element(this.target) ? this.target : null), b.string(this.target) && (e = e || this._context.querySelector(this.target)),
|
|
2657
|
+
return e = e || (b.element(this.target) ? this.target : null), b.string(this.target) && (e = e || this._context.querySelector(this.target)), we(e);
|
|
2647
2658
|
} }, { key: "rectChecker", value: function(e) {
|
|
2648
2659
|
var n = this;
|
|
2649
2660
|
return b.func(e) ? (this.getRect = function(r) {
|
|
@@ -2651,7 +2662,7 @@ function Vo() {
|
|
|
2651
2662
|
return "width" in o || (o.width = o.right - o.left, o.height = o.bottom - o.top), o;
|
|
2652
2663
|
}, this) : e === null ? (delete this.getRect, this) : this.getRect;
|
|
2653
2664
|
} }, { key: "_backCompatOption", value: function(e, n) {
|
|
2654
|
-
if (
|
|
2665
|
+
if (Ee(n) || b.object(n)) {
|
|
2655
2666
|
for (var r in this.options[e] = n, this._actions.map) this.options[r][e] = n;
|
|
2656
2667
|
return this;
|
|
2657
2668
|
}
|
|
@@ -2670,9 +2681,9 @@ function Vo() {
|
|
|
2670
2681
|
} }, { key: "testIgnoreAllow", value: function(e, n, r) {
|
|
2671
2682
|
return !this.testIgnore(e.ignoreFrom, n, r) && this.testAllow(e.allowFrom, n, r);
|
|
2672
2683
|
} }, { key: "testAllow", value: function(e, n, r) {
|
|
2673
|
-
return !e || !!b.element(r) && (b.string(e) ?
|
|
2684
|
+
return !e || !!b.element(r) && (b.string(e) ? j(r, e, n) : !!b.element(e) && se(e, r));
|
|
2674
2685
|
} }, { key: "testIgnore", value: function(e, n, r) {
|
|
2675
|
-
return !(!e || !b.element(r)) && (b.string(e) ?
|
|
2686
|
+
return !(!e || !b.element(r)) && (b.string(e) ? j(r, e, n) : !!b.element(e) && se(e, r));
|
|
2676
2687
|
} }, { key: "fire", value: function(e) {
|
|
2677
2688
|
return this.events.fire(e), this;
|
|
2678
2689
|
} }, { key: "_onOff", value: function(e, n, r, o, i) {
|
|
@@ -2709,7 +2720,7 @@ function Vo() {
|
|
|
2709
2720
|
})(), xr = (function() {
|
|
2710
2721
|
function t(e) {
|
|
2711
2722
|
var n = this;
|
|
2712
|
-
|
|
2723
|
+
g(this, t), this.list = [], this.selectorMap = {}, this.scope = void 0, this.scope = e, e.addListeners({ "interactable:unset": function(r) {
|
|
2713
2724
|
var o = r.interactable, i = o.target, a = b.string(i) ? n.selectorMap[i] : i[n.scope.id], s = He(a, (function(l) {
|
|
2714
2725
|
return l === o;
|
|
2715
2726
|
}));
|
|
@@ -2731,15 +2742,15 @@ function Vo() {
|
|
|
2731
2742
|
if ((b.string(i.target) ? b.element(e) && he(e, i.target) : e === i.target) && i.inContext(e) && (a = n(i)), a !== void 0) return a;
|
|
2732
2743
|
}
|
|
2733
2744
|
} }]), t;
|
|
2734
|
-
})(),
|
|
2745
|
+
})(), wr = (function() {
|
|
2735
2746
|
function t() {
|
|
2736
2747
|
var e = this;
|
|
2737
|
-
|
|
2748
|
+
g(this, t), this.id = "__interact_scope_".concat(Math.floor(100 * Math.random())), this.isInitialized = !1, this.listenerMaps = [], this.browser = ee, this.defaults = De(un), this.Eventable = yn, this.actions = { map: {}, phases: { start: !0, move: !0, end: !0 }, methodDict: {}, phaselessTypes: {} }, this.interactStatic = (function(r) {
|
|
2738
2749
|
var o = function i(a, s) {
|
|
2739
2750
|
var l = r.interactables.getExisting(a, s);
|
|
2740
2751
|
return l || ((l = r.interactables.new(a, s)).events.global = i.globalEvents), l;
|
|
2741
2752
|
};
|
|
2742
|
-
return o.getPointerAverage = Wt, o.getTouchBBox = gt, o.getTouchDistance = yt, o.getTouchAngle = bt, o.getElementRect =
|
|
2753
|
+
return o.getPointerAverage = Wt, o.getTouchBBox = gt, o.getTouchDistance = yt, o.getTouchAngle = bt, o.getElementRect = we, o.getElementClientRect = xe, o.matchesSelector = he, o.closest = de, o.globalEvents = {}, o.version = "1.10.27", o.scope = r, o.use = function(i, a) {
|
|
2743
2754
|
return this.scope.usePlugin(i, a), this;
|
|
2744
2755
|
}, o.isSet = function(i, a) {
|
|
2745
2756
|
return !!this.scope.interactables.get(i, a && a.context);
|
|
@@ -2792,16 +2803,16 @@ function Vo() {
|
|
|
2792
2803
|
var n = this;
|
|
2793
2804
|
this.Interactable = (function(r) {
|
|
2794
2805
|
_(i, r);
|
|
2795
|
-
var o =
|
|
2806
|
+
var o = A(i);
|
|
2796
2807
|
function i() {
|
|
2797
|
-
return
|
|
2808
|
+
return g(this, i), o.apply(this, arguments);
|
|
2798
2809
|
}
|
|
2799
2810
|
return x(i, [{ key: "_defaults", get: function() {
|
|
2800
2811
|
return n.defaults;
|
|
2801
2812
|
} }, { key: "set", value: function(a) {
|
|
2802
|
-
return
|
|
2813
|
+
return D(M(i.prototype), "set", this).call(this, a), n.fire("interactable:set", { options: a, interactable: this }), this;
|
|
2803
2814
|
} }, { key: "unset", value: function() {
|
|
2804
|
-
|
|
2815
|
+
D(M(i.prototype), "unset", this).call(this);
|
|
2805
2816
|
var a = n.interactables.list.indexOf(this);
|
|
2806
2817
|
a < 0 || (n.interactables.list.splice(a, 1), n.fire("interactable:unset", { interactable: this }));
|
|
2807
2818
|
} }]), i;
|
|
@@ -2816,7 +2827,7 @@ function Vo() {
|
|
|
2816
2827
|
}
|
|
2817
2828
|
} }, { key: "init", value: function(e) {
|
|
2818
2829
|
return this.isInitialized ? this : (function(n, r) {
|
|
2819
|
-
return n.isInitialized = !0, b.window(r) && re(r),
|
|
2830
|
+
return n.isInitialized = !0, b.window(r) && re(r), V.init(r), ee.init(r), Te.init(r), n.window = r, n.document = r.document, n.usePlugin(yr), n.usePlugin(vr), n;
|
|
2820
2831
|
})(this, e);
|
|
2821
2832
|
} }, { key: "pluginIsInstalled", value: function(e) {
|
|
2822
2833
|
var n = e.id;
|
|
@@ -2826,10 +2837,10 @@ function Vo() {
|
|
|
2826
2837
|
if (this.pluginIsInstalled(e)) return this;
|
|
2827
2838
|
if (e.id && (this._plugins.map[e.id] = e), this._plugins.list.push(e), e.install && e.install(this, n), e.listeners && e.before) {
|
|
2828
2839
|
for (var r = 0, o = this.listenerMaps.length, i = e.before.reduce((function(s, l) {
|
|
2829
|
-
return s[l] = !0, s[
|
|
2840
|
+
return s[l] = !0, s[En(l)] = !0, s;
|
|
2830
2841
|
}), {}); r < o; r++) {
|
|
2831
2842
|
var a = this.listenerMaps[r].id;
|
|
2832
|
-
if (a && (i[a] || i[
|
|
2843
|
+
if (a && (i[a] || i[En(a)])) break;
|
|
2833
2844
|
}
|
|
2834
2845
|
this.listenerMaps.splice(r, 0, { id: e.id, map: e.listeners });
|
|
2835
2846
|
} else e.listeners && this.listenerMaps.push({ id: e.id, map: e.listeners });
|
|
@@ -2851,11 +2862,11 @@ function Vo() {
|
|
|
2851
2862
|
return (this.window.Date || Date).now();
|
|
2852
2863
|
} }]), t;
|
|
2853
2864
|
})();
|
|
2854
|
-
function
|
|
2865
|
+
function En(t) {
|
|
2855
2866
|
return t && t.replace(/\/.*$/, "");
|
|
2856
2867
|
}
|
|
2857
|
-
var kn = new
|
|
2858
|
-
kn.init(
|
|
2868
|
+
var kn = new wr(), ve = kn.interactStatic, Er = typeof globalThis < "u" ? globalThis : window;
|
|
2869
|
+
kn.init(Er);
|
|
2859
2870
|
var kr = Object.freeze({ __proto__: null, edgeTarget: function() {
|
|
2860
2871
|
}, elements: function() {
|
|
2861
2872
|
}, grid: function(t) {
|
|
@@ -2864,8 +2875,8 @@ function Vo() {
|
|
|
2864
2875
|
return o in t || i in t;
|
|
2865
2876
|
})), n = function(r, o) {
|
|
2866
2877
|
for (var i = t.range, a = t.limits, s = a === void 0 ? { left: -1 / 0, right: 1 / 0, top: -1 / 0, bottom: 1 / 0 } : a, l = t.offset, u = l === void 0 ? { x: 0, y: 0 } : l, c = { range: i, grid: t, x: null, y: null }, f = 0; f < e.length; f++) {
|
|
2867
|
-
var y = e[f], C = y[0], k = y[1],
|
|
2868
|
-
c[C] = Math.max(s.left, Math.min(s.right,
|
|
2878
|
+
var y = e[f], C = y[0], k = y[1], S = Math.round((r - u.x) / t[C]), P = Math.round((o - u.y) / t[k]);
|
|
2879
|
+
c[C] = Math.max(s.left, Math.min(s.right, S * t[C] + u.x)), c[k] = Math.max(s.top, Math.min(s.bottom, P * t[k] + u.y));
|
|
2869
2880
|
}
|
|
2870
2881
|
return c;
|
|
2871
2882
|
};
|
|
@@ -2963,8 +2974,8 @@ function Vo() {
|
|
|
2963
2974
|
}
|
|
2964
2975
|
}, defaults: { min: null, max: null, endOnly: !1, enabled: !1 } }, "restrictSize"), Nt = { start: function(t) {
|
|
2965
2976
|
var e, n = t.interaction, r = t.interactable, o = t.element, i = t.rect, a = t.state, s = t.startOffset, l = a.options, u = l.offsetWithOrigin ? (function(y) {
|
|
2966
|
-
var C = y.interaction.element, k = Ze(ze(y.state.options.origin, null, null, [C])),
|
|
2967
|
-
return
|
|
2977
|
+
var C = y.interaction.element, k = Ze(ze(y.state.options.origin, null, null, [C])), S = k || Le(y.interactable, C, y.interaction.prepared.name);
|
|
2978
|
+
return S;
|
|
2968
2979
|
})(t) : { x: 0, y: 0 };
|
|
2969
2980
|
if (l.offset === "startCoords") e = { x: n.coords.start.page.x, y: n.coords.start.page.y };
|
|
2970
2981
|
else {
|
|
@@ -2978,13 +2989,13 @@ function Vo() {
|
|
|
2978
2989
|
}, set: function(t) {
|
|
2979
2990
|
var e = t.interaction, n = t.coords, r = t.state, o = r.options, i = r.offsets, a = Le(e.interactable, e.element, e.prepared.name), s = I({}, n), l = [];
|
|
2980
2991
|
o.offsetWithOrigin || (s.x -= a.x, s.y -= a.y);
|
|
2981
|
-
for (var u = 0, c = i; u < c.length; u++) for (var f = c[u], y = s.x - f.x, C = s.y - f.y, k = 0,
|
|
2982
|
-
var
|
|
2983
|
-
(
|
|
2992
|
+
for (var u = 0, c = i; u < c.length; u++) for (var f = c[u], y = s.x - f.x, C = s.y - f.y, k = 0, S = o.targets.length; k < S; k++) {
|
|
2993
|
+
var P = o.targets[k], R = void 0;
|
|
2994
|
+
(R = b.func(P) ? P(y, C, e._proxy, f, k) : P) && l.push({ x: (b.number(R.x) ? R.x : y) + f.x, y: (b.number(R.y) ? R.y : C) + f.y, range: b.number(R.range) ? R.range : o.range, source: P, index: k, offset: f });
|
|
2984
2995
|
}
|
|
2985
|
-
for (var O = { target: null, inRange: !1, distance: 0, range: 0, delta: { x: 0, y: 0 } },
|
|
2986
|
-
var K = l[
|
|
2987
|
-
|
|
2996
|
+
for (var O = { target: null, inRange: !1, distance: 0, range: 0, delta: { x: 0, y: 0 } }, W = 0; W < l.length; W++) {
|
|
2997
|
+
var K = l[W], z = K.range, $ = K.x - s.x, me = K.y - s.y, ae = Fe($, me), ge = ae <= z;
|
|
2998
|
+
z === 1 / 0 && O.inRange && O.range !== 1 / 0 && (ge = !1), O.target && !(ge ? O.inRange && z !== 1 / 0 ? ae / z < O.distance / O.range : z === 1 / 0 && O.range !== 1 / 0 || ae < O.distance : !O.inRange && ae < O.distance) || (O.target = K, O.distance = ae, O.range = z, O.inRange = ge, O.delta.x = $, O.delta.y = me);
|
|
2988
2999
|
}
|
|
2989
3000
|
return O.inRange && (n.x = O.target.x, n.y = O.target.y), r.closest = O, O;
|
|
2990
3001
|
}, defaults: { range: 1 / 0, targets: null, offset: null, offsetWithOrigin: !0, origin: null, relativePoints: null, endOnly: !1, enabled: !1 } }, Lr = _e(Nt, "snap"), pt = { start: function(t) {
|
|
@@ -2998,17 +3009,17 @@ function Vo() {
|
|
|
2998
3009
|
var u = l[s], c = void 0;
|
|
2999
3010
|
if (c = b.func(u) ? u(a.x, a.y, e) : u) {
|
|
3000
3011
|
for (var f = 0, y = n.targetFields; f < y.length; f++) {
|
|
3001
|
-
var C = y[f], k = C[0],
|
|
3002
|
-
if (k in c ||
|
|
3003
|
-
c.x = c[k], c.y = c[
|
|
3012
|
+
var C = y[f], k = C[0], S = C[1];
|
|
3013
|
+
if (k in c || S in c) {
|
|
3014
|
+
c.x = c[k], c.y = c[S];
|
|
3004
3015
|
break;
|
|
3005
3016
|
}
|
|
3006
3017
|
}
|
|
3007
3018
|
n.options.targets.push(c);
|
|
3008
3019
|
}
|
|
3009
3020
|
}
|
|
3010
|
-
var
|
|
3011
|
-
return n.options = o,
|
|
3021
|
+
var P = Nt.set(t);
|
|
3022
|
+
return n.options = o, P;
|
|
3012
3023
|
}, defaults: { range: 1 / 0, targets: null, offset: null, endOnly: !1, enabled: !1 } }, Fr = _e(pt, "snapSize"), zt = { aspectRatio: Rr, restrictEdges: Pr, restrict: Ar, restrictRect: Or, restrictSize: zr, snapEdges: _e({ start: function(t) {
|
|
3013
3024
|
var e = t.edges;
|
|
3014
3025
|
return e ? (t.state.targetFields = t.state.targetFields || [[e.left ? "left" : "right", e.top ? "top" : "bottom"]], pt.start(t)) : null;
|
|
@@ -3020,10 +3031,10 @@ function Vo() {
|
|
|
3020
3031
|
}
|
|
3021
3032
|
} }, Hr = jr, Mn = (function(t) {
|
|
3022
3033
|
_(n, t);
|
|
3023
|
-
var e =
|
|
3034
|
+
var e = A(n);
|
|
3024
3035
|
function n(r, o, i, a, s, l) {
|
|
3025
3036
|
var u;
|
|
3026
|
-
if (
|
|
3037
|
+
if (g(this, n), tt(X(u = e.call(this, s)), i), i !== o && tt(X(u), o), u.timeStamp = l, u.originalEvent = i, u.type = r, u.pointerId = je(o), u.pointerType = Vt(o), u.target = a, u.currentTarget = null, r === "tap") {
|
|
3027
3038
|
var c = s.getPointerIndex(o);
|
|
3028
3039
|
u.dt = u.timeStamp - s.pointers[c].downTime;
|
|
3029
3040
|
var f = u.timeStamp - s.tapTime;
|
|
@@ -3058,9 +3069,9 @@ function Vo() {
|
|
|
3058
3069
|
f.node = C, r.fire("pointerEvents:collect-targets", f);
|
|
3059
3070
|
}
|
|
3060
3071
|
if (f.targets.length) {
|
|
3061
|
-
for (var k = 1 / 0,
|
|
3062
|
-
var
|
|
3063
|
-
|
|
3072
|
+
for (var k = 1 / 0, S = 0, P = f.targets; S < P.length; S++) {
|
|
3073
|
+
var R = P[S].eventable.options.holdDuration;
|
|
3074
|
+
R < k && (k = R);
|
|
3064
3075
|
}
|
|
3065
3076
|
u.duration = k, u.timeout = setTimeout((function() {
|
|
3066
3077
|
Re({ interaction: o, eventTarget: s, pointer: i, event: a, type: "hold" }, r);
|
|
@@ -3085,8 +3096,8 @@ function Vo() {
|
|
|
3085
3096
|
if (u._subtractOrigin(k), u.eventable = y.eventable, u.currentTarget = y.node, y.eventable.fire(u), u._addOrigin(k), u.immediatePropagationStopped || u.propagationStopped && f + 1 < l.length && l[f + 1].node !== u.currentTarget) break;
|
|
3086
3097
|
}
|
|
3087
3098
|
if (e.fire("pointerEvents:fired", c), a === "tap") {
|
|
3088
|
-
var
|
|
3089
|
-
n.prevTap =
|
|
3099
|
+
var S = u.double ? Re({ interaction: n, pointer: r, event: o, eventTarget: i, type: "doubletap" }, e) : u;
|
|
3100
|
+
n.prevTap = S, n.tapTime = S.timeStamp;
|
|
3090
3101
|
}
|
|
3091
3102
|
return u;
|
|
3092
3103
|
}
|
|
@@ -3098,8 +3109,8 @@ function Vo() {
|
|
|
3098
3109
|
c.node = y, e.fire("pointerEvents:collect-targets", c);
|
|
3099
3110
|
}
|
|
3100
3111
|
return a === "hold" && (c.targets = c.targets.filter((function(C) {
|
|
3101
|
-
var k,
|
|
3102
|
-
return C.eventable.options.holdDuration === ((k = n.pointers[s]) == null || (
|
|
3112
|
+
var k, S;
|
|
3113
|
+
return C.eventable.options.holdDuration === ((k = n.pointers[s]) == null || (S = k.hold) == null ? void 0 : S.duration);
|
|
3103
3114
|
}))), c.targets;
|
|
3104
3115
|
}
|
|
3105
3116
|
function Lt(t) {
|
|
@@ -3161,15 +3172,15 @@ function Vo() {
|
|
|
3161
3172
|
for (var a = r.getAllElements(), s = i.window.Promise, l = s ? [] : null, u = function() {
|
|
3162
3173
|
var f = a[c], y = r.getRect(f);
|
|
3163
3174
|
if (!y) return 1;
|
|
3164
|
-
var C, k = Be(i.interactions.list, (function(
|
|
3165
|
-
return
|
|
3175
|
+
var C, k = Be(i.interactions.list, (function(R) {
|
|
3176
|
+
return R.interacting() && R.interactable === r && R.element === f && R.prepared.name === o.name;
|
|
3166
3177
|
}));
|
|
3167
|
-
if (k) k.move(), l && (C = k._reflowPromise || new s((function(
|
|
3168
|
-
k._reflowResolve =
|
|
3178
|
+
if (k) k.move(), l && (C = k._reflowPromise || new s((function(R) {
|
|
3179
|
+
k._reflowResolve = R;
|
|
3169
3180
|
})));
|
|
3170
3181
|
else {
|
|
3171
|
-
var
|
|
3172
|
-
return { coords:
|
|
3182
|
+
var S = vt(y), P = /* @__PURE__ */ (function(R) {
|
|
3183
|
+
return { coords: R, get page() {
|
|
3173
3184
|
return this.coords.page;
|
|
3174
3185
|
}, get client() {
|
|
3175
3186
|
return this.coords.client;
|
|
@@ -3195,15 +3206,15 @@ function Vo() {
|
|
|
3195
3206
|
return this.coords.buttons;
|
|
3196
3207
|
}, preventDefault: function() {
|
|
3197
3208
|
} };
|
|
3198
|
-
})({ page: { x:
|
|
3199
|
-
C = (function(
|
|
3200
|
-
var
|
|
3201
|
-
|
|
3202
|
-
var ae =
|
|
3203
|
-
|
|
3209
|
+
})({ page: { x: S.x, y: S.y }, client: { x: S.x, y: S.y }, timeStamp: i.now() });
|
|
3210
|
+
C = (function(R, O, W, K, z) {
|
|
3211
|
+
var $ = R.interactions.new({ pointerType: "reflow" }), me = { interaction: $, event: z, pointer: z, eventTarget: W, phase: "reflow" };
|
|
3212
|
+
$.interactable = O, $.element = W, $.prevEvent = z, $.updatePointer(z, z, W, !0), Ht($.coords.delta), St($.prepared, K), $._doPhase(me);
|
|
3213
|
+
var ae = R.window, ge = ae.Promise, be = ge ? new ge((function(Se) {
|
|
3214
|
+
$._reflowResolve = Se;
|
|
3204
3215
|
})) : void 0;
|
|
3205
|
-
return
|
|
3206
|
-
})(i, r, f, o,
|
|
3216
|
+
return $._reflowPromise = be, $.start(K, O, W), $._interacting ? ($.move(me), $.end(z)) : ($.stop(), $._reflowResolve()), $.removePointer(z, z), be;
|
|
3217
|
+
})(i, r, f, o, P);
|
|
3207
3218
|
}
|
|
3208
3219
|
l && l.push(C);
|
|
3209
3220
|
}, c = 0; c < a.length && !u(); c++) ;
|
|
@@ -3218,7 +3229,7 @@ function Vo() {
|
|
|
3218
3229
|
r.splice(r.indexOf(o), 1);
|
|
3219
3230
|
})(e.interactions.list, n));
|
|
3220
3231
|
} } }, Kr = Gr;
|
|
3221
|
-
if (ve.use(ln), ve.use(hn), ve.use(Xr), ve.use(fr), ve.use(Hr), ve.use(tr), ve.use(Vn), ve.use($n), ve.use(Kr), ve.default = ve,
|
|
3232
|
+
if (ve.use(ln), ve.use(hn), ve.use(Xr), ve.use(fr), ve.use(Hr), ve.use(tr), ve.use(Vn), ve.use($n), ve.use(Kr), ve.default = ve, m(h) === "object" && h) try {
|
|
3222
3233
|
h.exports = ve;
|
|
3223
3234
|
} catch {
|
|
3224
3235
|
}
|
|
@@ -3233,28 +3244,28 @@ function In(h) {
|
|
|
3233
3244
|
v.type = "file", v.accept = "image/*", v.onchange = (p) => {
|
|
3234
3245
|
const d = p.target.files?.[0];
|
|
3235
3246
|
if (d) {
|
|
3236
|
-
const
|
|
3237
|
-
|
|
3238
|
-
const
|
|
3239
|
-
|
|
3247
|
+
const m = new FileReader();
|
|
3248
|
+
m.onload = (g) => {
|
|
3249
|
+
const w = document.createElement("img");
|
|
3250
|
+
w.src = g.target?.result, w.style.maxWidth = "100%", w.style.width = "100%", w.style.height = "auto", w.style.cursor = "pointer", w.draggable = !1;
|
|
3240
3251
|
const x = document.createElement("div");
|
|
3241
|
-
x.className = "editor-image-wrapper", x.style.display = "inline-block", x.style.position = "relative", x.style.maxWidth = "100%", x.style.width = "auto", x.style.height = "auto", x.contentEditable = "false", x.style.boxSizing = "border-box", x.style.touchAction = "none", x.style.userSelect = "none", x.appendChild(
|
|
3242
|
-
const
|
|
3243
|
-
|
|
3252
|
+
x.className = "editor-image-wrapper", x.style.display = "inline-block", x.style.position = "relative", x.style.maxWidth = "100%", x.style.width = "auto", x.style.height = "auto", x.contentEditable = "false", x.style.boxSizing = "border-box", x.style.touchAction = "none", x.style.userSelect = "none", x.appendChild(w);
|
|
3253
|
+
const T = document.createElement("div");
|
|
3254
|
+
T.contentEditable = "true", T.style.margin = "10px 0", T.style.textAlign = "left", T.style.display = "block", T.appendChild(x);
|
|
3244
3255
|
try {
|
|
3245
3256
|
Ne();
|
|
3246
3257
|
const _ = window.getSelection();
|
|
3247
3258
|
if (_ && _.rangeCount > 0) {
|
|
3248
|
-
_.getRangeAt(0).insertNode(
|
|
3249
|
-
const
|
|
3250
|
-
|
|
3259
|
+
_.getRangeAt(0).insertNode(T), _.removeAllRanges();
|
|
3260
|
+
const L = document.createRange();
|
|
3261
|
+
L.setStartAfter(T), L.collapse(!0), _.addRange(L), pe(L);
|
|
3251
3262
|
} else
|
|
3252
|
-
h.appendChild(
|
|
3263
|
+
h.appendChild(T), h.focus(), pe();
|
|
3253
3264
|
} catch {
|
|
3254
|
-
h.appendChild(
|
|
3265
|
+
h.appendChild(T), h.focus(), pe();
|
|
3255
3266
|
}
|
|
3256
3267
|
h.dispatchEvent(new Event("input", { bubbles: !0 })), h.focus();
|
|
3257
|
-
},
|
|
3268
|
+
}, m.readAsDataURL(d);
|
|
3258
3269
|
}
|
|
3259
3270
|
}, v.click();
|
|
3260
3271
|
}
|
|
@@ -3264,28 +3275,28 @@ function $o(h) {
|
|
|
3264
3275
|
const p = v.querySelector("img");
|
|
3265
3276
|
if (p)
|
|
3266
3277
|
if (v.classList.contains("resizable")) {
|
|
3267
|
-
const d = v.getBoundingClientRect(),
|
|
3268
|
-
Ft(v).unset(), v.classList.remove("resizable"), v.style.border = "none", v.style.transform = "", v.dataset.x = "", v.dataset.y = "", v.style.width =
|
|
3269
|
-
const
|
|
3270
|
-
|
|
3278
|
+
const d = v.getBoundingClientRect(), m = Math.round(d.width) + "px", g = Math.round(d.height) + "px";
|
|
3279
|
+
Ft(v).unset(), v.classList.remove("resizable"), v.style.border = "none", v.style.transform = "", v.dataset.x = "", v.dataset.y = "", v.style.width = m, v.style.height = g, v.contentEditable = "false", p && (p.style.width = "100%", p.style.height = "100%");
|
|
3280
|
+
const w = v.closest(".editor");
|
|
3281
|
+
w && w.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
3271
3282
|
} else {
|
|
3272
3283
|
v.classList.add("resizable"), v.style.border = "2px dashed #007bff", v.style.position = "relative", v.style.userSelect = "none";
|
|
3273
3284
|
const d = v.getBoundingClientRect();
|
|
3274
3285
|
v.style.width = d.width + "px", v.style.height = d.height + "px", p && (p.style.width = "100%", p.style.height = "100%"), Ft(v).resizable({
|
|
3275
3286
|
edges: { left: !0, right: !0, bottom: !0, top: !0 },
|
|
3276
3287
|
listeners: {
|
|
3277
|
-
move: (
|
|
3278
|
-
const
|
|
3279
|
-
Object.assign(
|
|
3280
|
-
width: `${
|
|
3281
|
-
height: `${
|
|
3288
|
+
move: (m) => {
|
|
3289
|
+
const g = m.target;
|
|
3290
|
+
Object.assign(g.style, {
|
|
3291
|
+
width: `${m.rect.width}px`,
|
|
3292
|
+
height: `${m.rect.height}px`
|
|
3282
3293
|
});
|
|
3283
|
-
const
|
|
3284
|
-
|
|
3294
|
+
const w = g.closest(".editor");
|
|
3295
|
+
w && w.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
3285
3296
|
},
|
|
3286
|
-
end: (
|
|
3287
|
-
const
|
|
3288
|
-
|
|
3297
|
+
end: (m) => {
|
|
3298
|
+
const w = m.target.closest(".editor");
|
|
3299
|
+
w && w.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
3289
3300
|
}
|
|
3290
3301
|
},
|
|
3291
3302
|
modifiers: [
|
|
@@ -3325,28 +3336,31 @@ class Uo {
|
|
|
3325
3336
|
const d = p.parentElement;
|
|
3326
3337
|
if (d && d.classList.contains("editor-image-wrapper"))
|
|
3327
3338
|
return;
|
|
3339
|
+
const m = p.getAttribute("src") || p.src;
|
|
3340
|
+
if (!m)
|
|
3341
|
+
return;
|
|
3328
3342
|
const g = document.createElement("div");
|
|
3329
3343
|
g.className = "editor-image-wrapper", g.style.display = "inline-block", g.style.position = "relative", g.style.maxWidth = "100%", g.style.width = "300px", g.contentEditable = "false", g.style.userSelect = "none", g.style.boxSizing = "border-box", g.style.touchAction = "none";
|
|
3330
|
-
const
|
|
3331
|
-
m.style.maxWidth = "100%",
|
|
3332
|
-
const
|
|
3333
|
-
if (!
|
|
3334
|
-
const
|
|
3335
|
-
if (!
|
|
3336
|
-
const
|
|
3337
|
-
return Number.isFinite(
|
|
3338
|
-
},
|
|
3339
|
-
|
|
3340
|
-
const
|
|
3341
|
-
if (
|
|
3342
|
-
const
|
|
3343
|
-
g.style.width = `${
|
|
3344
|
+
const w = p;
|
|
3345
|
+
!w.src && m && (w.src = m), w.style.maxWidth = "100%", w.style.width = "100%", w.style.height = "auto", w.style.cursor = "pointer", w.draggable = !1;
|
|
3346
|
+
const x = (X) => {
|
|
3347
|
+
if (!X) return null;
|
|
3348
|
+
const A = String(X).match(/(\d+(?:\.\d+)?)/);
|
|
3349
|
+
if (!A) return null;
|
|
3350
|
+
const D = Math.round(Number(A[1]));
|
|
3351
|
+
return Number.isFinite(D) && D > 0 ? D : null;
|
|
3352
|
+
}, T = x(w.getAttribute("width")) ?? x(w.style.width) ?? x(w.getAttribute("style"));
|
|
3353
|
+
T ? g.style.width = `${T}px` : w.onload = () => {
|
|
3354
|
+
const X = this.editor.clientWidth || 0, A = w.naturalWidth || 0;
|
|
3355
|
+
if (A > 0) {
|
|
3356
|
+
const D = X > 0 ? Math.min(A, X) : A;
|
|
3357
|
+
g.style.width = `${D}px`;
|
|
3344
3358
|
}
|
|
3345
3359
|
};
|
|
3346
|
-
const
|
|
3347
|
-
|
|
3348
|
-
const
|
|
3349
|
-
|
|
3360
|
+
const _ = document.createElement("p");
|
|
3361
|
+
_.style.margin = "10px 0", _.style.textAlign = "left", _.style.display = "block";
|
|
3362
|
+
const M = w.closest("figure") ?? w.closest(".se-image-container") ?? w, L = M.parentNode;
|
|
3363
|
+
L && this.editor.contains(M) && L.contains(M) && (g.appendChild(w), _.appendChild(g), L.replaceChild(_, M));
|
|
3350
3364
|
}), this.editor.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
3351
3365
|
}
|
|
3352
3366
|
}
|
|
@@ -3356,19 +3370,19 @@ function Xo() {
|
|
|
3356
3370
|
if (On) return Xe;
|
|
3357
3371
|
On = 1;
|
|
3358
3372
|
var h = Symbol.for("react.transitional.element"), v = Symbol.for("react.fragment");
|
|
3359
|
-
function p(d,
|
|
3360
|
-
var
|
|
3361
|
-
if (
|
|
3362
|
-
|
|
3363
|
-
for (var x in
|
|
3364
|
-
x !== "key" && (
|
|
3365
|
-
} else
|
|
3366
|
-
return
|
|
3373
|
+
function p(d, m, g) {
|
|
3374
|
+
var w = null;
|
|
3375
|
+
if (g !== void 0 && (w = "" + g), m.key !== void 0 && (w = "" + m.key), "key" in m) {
|
|
3376
|
+
g = {};
|
|
3377
|
+
for (var x in m)
|
|
3378
|
+
x !== "key" && (g[x] = m[x]);
|
|
3379
|
+
} else g = m;
|
|
3380
|
+
return m = g.ref, {
|
|
3367
3381
|
$$typeof: h,
|
|
3368
3382
|
type: d,
|
|
3369
|
-
key:
|
|
3370
|
-
ref:
|
|
3371
|
-
props:
|
|
3383
|
+
key: w,
|
|
3384
|
+
ref: m !== void 0 ? m : null,
|
|
3385
|
+
props: g
|
|
3372
3386
|
};
|
|
3373
3387
|
}
|
|
3374
3388
|
return Xe.Fragment = v, Xe.jsx = p, Xe.jsxs = p, Xe;
|
|
@@ -3377,13 +3391,13 @@ var Ge = {};
|
|
|
3377
3391
|
var Dn;
|
|
3378
3392
|
function Go() {
|
|
3379
3393
|
return Dn || (Dn = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
3380
|
-
function h(
|
|
3381
|
-
if (
|
|
3382
|
-
if (typeof
|
|
3383
|
-
return
|
|
3384
|
-
if (typeof
|
|
3385
|
-
switch (
|
|
3386
|
-
case
|
|
3394
|
+
function h(E) {
|
|
3395
|
+
if (E == null) return null;
|
|
3396
|
+
if (typeof E == "function")
|
|
3397
|
+
return E.$$typeof === ce ? null : E.displayName || E.name || null;
|
|
3398
|
+
if (typeof E == "string") return E;
|
|
3399
|
+
switch (E) {
|
|
3400
|
+
case q:
|
|
3387
3401
|
return "Fragment";
|
|
3388
3402
|
case J:
|
|
3389
3403
|
return "Profiler";
|
|
@@ -3396,211 +3410,211 @@ function Go() {
|
|
|
3396
3410
|
case le:
|
|
3397
3411
|
return "Activity";
|
|
3398
3412
|
}
|
|
3399
|
-
if (typeof
|
|
3400
|
-
switch (typeof
|
|
3413
|
+
if (typeof E == "object")
|
|
3414
|
+
switch (typeof E.tag == "number" && console.error(
|
|
3401
3415
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
3402
|
-
),
|
|
3403
|
-
case
|
|
3416
|
+
), E.$$typeof) {
|
|
3417
|
+
case B:
|
|
3404
3418
|
return "Portal";
|
|
3405
3419
|
case te:
|
|
3406
|
-
return
|
|
3420
|
+
return E.displayName || "Context";
|
|
3407
3421
|
case re:
|
|
3408
|
-
return (
|
|
3422
|
+
return (E._context.displayName || "Context") + ".Consumer";
|
|
3409
3423
|
case ie:
|
|
3410
|
-
var
|
|
3411
|
-
return
|
|
3424
|
+
var N = E.render;
|
|
3425
|
+
return E = E.displayName, E || (E = N.displayName || N.name || "", E = E !== "" ? "ForwardRef(" + E + ")" : "ForwardRef"), E;
|
|
3412
3426
|
case Z:
|
|
3413
|
-
return
|
|
3414
|
-
case
|
|
3415
|
-
|
|
3427
|
+
return N = E.displayName || null, N !== null ? N : h(E.type) || "Memo";
|
|
3428
|
+
case F:
|
|
3429
|
+
N = E._payload, E = E._init;
|
|
3416
3430
|
try {
|
|
3417
|
-
return h(
|
|
3431
|
+
return h(E(N));
|
|
3418
3432
|
} catch {
|
|
3419
3433
|
}
|
|
3420
3434
|
}
|
|
3421
3435
|
return null;
|
|
3422
3436
|
}
|
|
3423
|
-
function v(
|
|
3424
|
-
return "" +
|
|
3437
|
+
function v(E) {
|
|
3438
|
+
return "" + E;
|
|
3425
3439
|
}
|
|
3426
|
-
function p(
|
|
3440
|
+
function p(E) {
|
|
3427
3441
|
try {
|
|
3428
|
-
v(
|
|
3429
|
-
var
|
|
3442
|
+
v(E);
|
|
3443
|
+
var N = !1;
|
|
3430
3444
|
} catch {
|
|
3431
|
-
|
|
3445
|
+
N = !0;
|
|
3432
3446
|
}
|
|
3433
|
-
if (
|
|
3434
|
-
|
|
3435
|
-
var
|
|
3436
|
-
return
|
|
3437
|
-
|
|
3447
|
+
if (N) {
|
|
3448
|
+
N = console;
|
|
3449
|
+
var j = N.error, Y = typeof Symbol == "function" && Symbol.toStringTag && E[Symbol.toStringTag] || E.constructor.name || "Object";
|
|
3450
|
+
return j.call(
|
|
3451
|
+
N,
|
|
3438
3452
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
3439
|
-
|
|
3440
|
-
), v(
|
|
3453
|
+
Y
|
|
3454
|
+
), v(E);
|
|
3441
3455
|
}
|
|
3442
3456
|
}
|
|
3443
|
-
function d(
|
|
3444
|
-
if (
|
|
3445
|
-
if (typeof
|
|
3457
|
+
function d(E) {
|
|
3458
|
+
if (E === q) return "<>";
|
|
3459
|
+
if (typeof E == "object" && E !== null && E.$$typeof === F)
|
|
3446
3460
|
return "<...>";
|
|
3447
3461
|
try {
|
|
3448
|
-
var
|
|
3449
|
-
return
|
|
3462
|
+
var N = h(E);
|
|
3463
|
+
return N ? "<" + N + ">" : "<...>";
|
|
3450
3464
|
} catch {
|
|
3451
3465
|
return "<...>";
|
|
3452
3466
|
}
|
|
3453
3467
|
}
|
|
3454
|
-
function g() {
|
|
3455
|
-
var w = $.A;
|
|
3456
|
-
return w === null ? null : w.getOwner();
|
|
3457
|
-
}
|
|
3458
3468
|
function m() {
|
|
3469
|
+
var E = U.A;
|
|
3470
|
+
return E === null ? null : E.getOwner();
|
|
3471
|
+
}
|
|
3472
|
+
function g() {
|
|
3459
3473
|
return Error("react-stack-top-frame");
|
|
3460
3474
|
}
|
|
3461
|
-
function E
|
|
3462
|
-
if (
|
|
3463
|
-
var
|
|
3464
|
-
if (
|
|
3475
|
+
function w(E) {
|
|
3476
|
+
if (G.call(E, "key")) {
|
|
3477
|
+
var N = Object.getOwnPropertyDescriptor(E, "key").get;
|
|
3478
|
+
if (N && N.isReactWarning) return !1;
|
|
3465
3479
|
}
|
|
3466
|
-
return
|
|
3480
|
+
return E.key !== void 0;
|
|
3467
3481
|
}
|
|
3468
|
-
function x(
|
|
3469
|
-
function
|
|
3482
|
+
function x(E, N) {
|
|
3483
|
+
function j() {
|
|
3470
3484
|
ee || (ee = !0, console.error(
|
|
3471
3485
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
3472
|
-
|
|
3486
|
+
N
|
|
3473
3487
|
));
|
|
3474
3488
|
}
|
|
3475
|
-
|
|
3476
|
-
get:
|
|
3489
|
+
j.isReactWarning = !0, Object.defineProperty(E, "key", {
|
|
3490
|
+
get: j,
|
|
3477
3491
|
configurable: !0
|
|
3478
3492
|
});
|
|
3479
3493
|
}
|
|
3480
|
-
function
|
|
3481
|
-
var
|
|
3482
|
-
return se[
|
|
3494
|
+
function T() {
|
|
3495
|
+
var E = h(this.type);
|
|
3496
|
+
return se[E] || (se[E] = !0, console.error(
|
|
3483
3497
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
3484
|
-
)),
|
|
3498
|
+
)), E = this.props.ref, E !== void 0 ? E : null;
|
|
3485
3499
|
}
|
|
3486
|
-
function _(
|
|
3487
|
-
var ue =
|
|
3488
|
-
return
|
|
3489
|
-
$$typeof:
|
|
3490
|
-
type:
|
|
3491
|
-
key:
|
|
3492
|
-
props:
|
|
3493
|
-
_owner:
|
|
3494
|
-
}, (ue !== void 0 ? ue : null) !== null ? Object.defineProperty(
|
|
3500
|
+
function _(E, N, j, Y, xe, we) {
|
|
3501
|
+
var ue = j.ref;
|
|
3502
|
+
return E = {
|
|
3503
|
+
$$typeof: D,
|
|
3504
|
+
type: E,
|
|
3505
|
+
key: N,
|
|
3506
|
+
props: j,
|
|
3507
|
+
_owner: Y
|
|
3508
|
+
}, (ue !== void 0 ? ue : null) !== null ? Object.defineProperty(E, "ref", {
|
|
3495
3509
|
enumerable: !1,
|
|
3496
|
-
get:
|
|
3497
|
-
}) : Object.defineProperty(
|
|
3510
|
+
get: T
|
|
3511
|
+
}) : Object.defineProperty(E, "ref", { enumerable: !1, value: null }), E._store = {}, Object.defineProperty(E._store, "validated", {
|
|
3498
3512
|
configurable: !1,
|
|
3499
3513
|
enumerable: !1,
|
|
3500
3514
|
writable: !0,
|
|
3501
3515
|
value: 0
|
|
3502
|
-
}), Object.defineProperty(
|
|
3516
|
+
}), Object.defineProperty(E, "_debugInfo", {
|
|
3503
3517
|
configurable: !1,
|
|
3504
3518
|
enumerable: !1,
|
|
3505
3519
|
writable: !0,
|
|
3506
3520
|
value: null
|
|
3507
|
-
}), Object.defineProperty(
|
|
3521
|
+
}), Object.defineProperty(E, "_debugStack", {
|
|
3508
3522
|
configurable: !1,
|
|
3509
3523
|
enumerable: !1,
|
|
3510
3524
|
writable: !0,
|
|
3511
3525
|
value: xe
|
|
3512
|
-
}), Object.defineProperty(
|
|
3526
|
+
}), Object.defineProperty(E, "_debugTask", {
|
|
3513
3527
|
configurable: !1,
|
|
3514
3528
|
enumerable: !1,
|
|
3515
3529
|
writable: !0,
|
|
3516
|
-
value:
|
|
3517
|
-
}), Object.freeze && (Object.freeze(
|
|
3530
|
+
value: we
|
|
3531
|
+
}), Object.freeze && (Object.freeze(E.props), Object.freeze(E)), E;
|
|
3518
3532
|
}
|
|
3519
|
-
function
|
|
3520
|
-
var ue =
|
|
3533
|
+
function M(E, N, j, Y, xe, we) {
|
|
3534
|
+
var ue = N.children;
|
|
3521
3535
|
if (ue !== void 0)
|
|
3522
|
-
if (
|
|
3523
|
-
if (
|
|
3524
|
-
for (
|
|
3525
|
-
|
|
3536
|
+
if (Y)
|
|
3537
|
+
if (V(ue)) {
|
|
3538
|
+
for (Y = 0; Y < ue.length; Y++)
|
|
3539
|
+
L(ue[Y]);
|
|
3526
3540
|
Object.freeze && Object.freeze(ue);
|
|
3527
3541
|
} else
|
|
3528
3542
|
console.error(
|
|
3529
3543
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
3530
3544
|
);
|
|
3531
|
-
else
|
|
3532
|
-
if (
|
|
3533
|
-
ue = h(
|
|
3534
|
-
var
|
|
3545
|
+
else L(ue);
|
|
3546
|
+
if (G.call(N, "key")) {
|
|
3547
|
+
ue = h(E);
|
|
3548
|
+
var Ee = Object.keys(N).filter(function(Qe) {
|
|
3535
3549
|
return Qe !== "key";
|
|
3536
3550
|
});
|
|
3537
|
-
|
|
3551
|
+
Y = 0 < Ee.length ? "{key: someKey, " + Ee.join(": ..., ") + ": ...}" : "{key: someKey}", he[ue + Y] || (Ee = 0 < Ee.length ? "{" + Ee.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
3538
3552
|
`A props object containing a "key" prop is being spread into JSX:
|
|
3539
3553
|
let props = %s;
|
|
3540
3554
|
<%s {...props} />
|
|
3541
3555
|
React keys must be passed directly to JSX without using spread:
|
|
3542
3556
|
let props = %s;
|
|
3543
3557
|
<%s key={someKey} {...props} />`,
|
|
3544
|
-
|
|
3558
|
+
Y,
|
|
3545
3559
|
ue,
|
|
3546
|
-
|
|
3560
|
+
Ee,
|
|
3547
3561
|
ue
|
|
3548
|
-
), he[ue +
|
|
3562
|
+
), he[ue + Y] = !0);
|
|
3549
3563
|
}
|
|
3550
|
-
if (ue = null,
|
|
3551
|
-
|
|
3552
|
-
for (var I in
|
|
3553
|
-
I !== "key" && (
|
|
3554
|
-
} else
|
|
3564
|
+
if (ue = null, j !== void 0 && (p(j), ue = "" + j), w(N) && (p(N.key), ue = "" + N.key), "key" in N) {
|
|
3565
|
+
j = {};
|
|
3566
|
+
for (var I in N)
|
|
3567
|
+
I !== "key" && (j[I] = N[I]);
|
|
3568
|
+
} else j = N;
|
|
3555
3569
|
return ue && x(
|
|
3556
|
-
|
|
3557
|
-
typeof
|
|
3570
|
+
j,
|
|
3571
|
+
typeof E == "function" ? E.displayName || E.name || "Unknown" : E
|
|
3558
3572
|
), _(
|
|
3559
|
-
|
|
3573
|
+
E,
|
|
3560
3574
|
ue,
|
|
3561
|
-
|
|
3562
|
-
|
|
3575
|
+
j,
|
|
3576
|
+
m(),
|
|
3563
3577
|
xe,
|
|
3564
|
-
|
|
3578
|
+
we
|
|
3565
3579
|
);
|
|
3566
3580
|
}
|
|
3567
|
-
function
|
|
3568
|
-
|
|
3581
|
+
function L(E) {
|
|
3582
|
+
X(E) ? E._store && (E._store.validated = 1) : typeof E == "object" && E !== null && E.$$typeof === F && (E._payload.status === "fulfilled" ? X(E._payload.value) && E._payload.value._store && (E._payload.value._store.validated = 1) : E._store && (E._store.validated = 1));
|
|
3569
3583
|
}
|
|
3570
|
-
function
|
|
3571
|
-
return typeof
|
|
3584
|
+
function X(E) {
|
|
3585
|
+
return typeof E == "object" && E !== null && E.$$typeof === D;
|
|
3572
3586
|
}
|
|
3573
|
-
var
|
|
3587
|
+
var A = Jr, D = Symbol.for("react.transitional.element"), B = Symbol.for("react.portal"), q = Symbol.for("react.fragment"), Q = Symbol.for("react.strict_mode"), J = Symbol.for("react.profiler"), re = Symbol.for("react.consumer"), te = Symbol.for("react.context"), ie = Symbol.for("react.forward_ref"), ne = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), Z = Symbol.for("react.memo"), F = Symbol.for("react.lazy"), le = Symbol.for("react.activity"), ce = Symbol.for("react.client.reference"), U = A.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, G = Object.prototype.hasOwnProperty, V = Array.isArray, oe = console.createTask ? console.createTask : function() {
|
|
3574
3588
|
return null;
|
|
3575
3589
|
};
|
|
3576
|
-
|
|
3577
|
-
react_stack_bottom_frame: function(
|
|
3578
|
-
return
|
|
3590
|
+
A = {
|
|
3591
|
+
react_stack_bottom_frame: function(E) {
|
|
3592
|
+
return E();
|
|
3579
3593
|
}
|
|
3580
3594
|
};
|
|
3581
|
-
var ee, se = {}, de =
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
)(), fe = oe(d(
|
|
3585
|
-
Ge.Fragment =
|
|
3586
|
-
var
|
|
3587
|
-
return
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3595
|
+
var ee, se = {}, de = A.react_stack_bottom_frame.bind(
|
|
3596
|
+
A,
|
|
3597
|
+
g
|
|
3598
|
+
)(), fe = oe(d(g)), he = {};
|
|
3599
|
+
Ge.Fragment = q, Ge.jsx = function(E, N, j) {
|
|
3600
|
+
var Y = 1e4 > U.recentlyCreatedOwnerStacks++;
|
|
3601
|
+
return M(
|
|
3602
|
+
E,
|
|
3603
|
+
N,
|
|
3604
|
+
j,
|
|
3591
3605
|
!1,
|
|
3592
|
-
|
|
3593
|
-
|
|
3606
|
+
Y ? Error("react-stack-top-frame") : de,
|
|
3607
|
+
Y ? oe(d(E)) : fe
|
|
3594
3608
|
);
|
|
3595
|
-
}, Ge.jsxs = function(
|
|
3596
|
-
var
|
|
3597
|
-
return
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3609
|
+
}, Ge.jsxs = function(E, N, j) {
|
|
3610
|
+
var Y = 1e4 > U.recentlyCreatedOwnerStacks++;
|
|
3611
|
+
return M(
|
|
3612
|
+
E,
|
|
3613
|
+
N,
|
|
3614
|
+
j,
|
|
3601
3615
|
!0,
|
|
3602
|
-
|
|
3603
|
-
|
|
3616
|
+
Y ? Error("react-stack-top-frame") : de,
|
|
3617
|
+
Y ? oe(d(E)) : fe
|
|
3604
3618
|
);
|
|
3605
3619
|
};
|
|
3606
3620
|
})()), Ge;
|
|
@@ -3618,13 +3632,13 @@ const Zo = ({
|
|
|
3618
3632
|
return Qr(() => {
|
|
3619
3633
|
if (d.current && !p.current) {
|
|
3620
3634
|
p.current = new Uo(), d.current.appendChild(p.current.getElement()), v && p.current.setHTML(v);
|
|
3621
|
-
const
|
|
3635
|
+
const m = p.current.getElement(), g = m.querySelector(
|
|
3622
3636
|
".editor"
|
|
3623
|
-
),
|
|
3637
|
+
), w = () => {
|
|
3624
3638
|
const x = p.current?.getHTML() || "";
|
|
3625
3639
|
h?.(x);
|
|
3626
3640
|
};
|
|
3627
|
-
|
|
3641
|
+
g ? (g.addEventListener("input", w), g.addEventListener("keyup", w), g.addEventListener("paste", w)) : (m.addEventListener("input", w), m.addEventListener("keyup", w), m.addEventListener("paste", w));
|
|
3628
3642
|
}
|
|
3629
3643
|
}, [h, v]), /* @__PURE__ */ Jo.jsx("div", { ref: d });
|
|
3630
3644
|
};
|