nam-rich-text-editor 9.1.3 → 9.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rich-text-editor.es.js +861 -802
- 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, f]) => {
|
|
49
49
|
const d = document.createElementNS("http://www.w3.org/2000/svg", h);
|
|
50
|
-
return Object.keys(v).forEach((
|
|
51
|
-
d.setAttribute(
|
|
52
|
-
}), f?.length && f.forEach((
|
|
53
|
-
const
|
|
54
|
-
d.appendChild(
|
|
50
|
+
return Object.keys(v).forEach((b) => {
|
|
51
|
+
d.setAttribute(b, String(v[b]));
|
|
52
|
+
}), f?.length && f.forEach((b) => {
|
|
53
|
+
const y = zn(b);
|
|
54
|
+
d.appendChild(y);
|
|
55
55
|
}), d;
|
|
56
56
|
}, ye = (h, v = {}) => {
|
|
57
57
|
const d = {
|
|
@@ -185,15 +185,15 @@ function So() {
|
|
|
185
185
|
{ command: "strikeThrough", icon: go, title: "Strikethrough" }
|
|
186
186
|
].forEach((f) => {
|
|
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", (y) => {
|
|
189
|
+
(y.key === "Enter" || y.key === " ") && (y.preventDefault(), d.click());
|
|
190
190
|
});
|
|
191
|
-
const
|
|
192
|
-
d.appendChild(
|
|
191
|
+
const b = ye(f.icon, { width: 16, height: 16 });
|
|
192
|
+
d.appendChild(b), d.title = f.title, d.style.fontWeight = f.command === "bold" ? "bold" : "normal", d.style.fontStyle = f.command === "italic" ? "italic" : "normal", d.style.textDecoration = f.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(f.command), h.appendChild(d);
|
|
193
193
|
}), h;
|
|
194
194
|
}
|
|
195
195
|
let Je = null;
|
|
196
|
-
function
|
|
196
|
+
function he(h) {
|
|
197
197
|
if (h) {
|
|
198
198
|
Je = h.cloneRange();
|
|
199
199
|
return;
|
|
@@ -214,18 +214,18 @@ function Ln(h, v) {
|
|
|
214
214
|
if (!f || f.rangeCount === 0) return;
|
|
215
215
|
const d = f.getRangeAt(0);
|
|
216
216
|
if (!d.collapsed) {
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
const
|
|
220
|
-
|
|
221
|
-
const
|
|
222
|
-
|
|
217
|
+
const S = document.createElement("span");
|
|
218
|
+
S.style[h] = v;
|
|
219
|
+
const E = d.extractContents();
|
|
220
|
+
S.appendChild(E), d.insertNode(S), f.removeAllRanges();
|
|
221
|
+
const M = document.createRange();
|
|
222
|
+
M.selectNodeContents(S), f.addRange(M), he(M);
|
|
223
223
|
return;
|
|
224
224
|
}
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
const
|
|
228
|
-
|
|
225
|
+
const b = document.createElement("span");
|
|
226
|
+
b.style[h] = v, b.appendChild(document.createTextNode("")), d.insertNode(b), f.removeAllRanges();
|
|
227
|
+
const y = document.createRange();
|
|
228
|
+
y.setStart(b.firstChild, 0), y.setEnd(b.firstChild, 0), f.addRange(y), he(y);
|
|
229
229
|
}
|
|
230
230
|
function To(h) {
|
|
231
231
|
Ln("color", h);
|
|
@@ -237,34 +237,78 @@ 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 f = document.createElement("div");
|
|
240
|
-
f.setAttribute("role", "button"), f.tabIndex = 0, f.style.userSelect = "none", f.addEventListener("keydown", (
|
|
241
|
-
(
|
|
240
|
+
f.setAttribute("role", "button"), f.tabIndex = 0, f.style.userSelect = "none", f.addEventListener("keydown", (y) => {
|
|
241
|
+
(y.key === "Enter" || y.key === " ") && (y.preventDefault(), f.click());
|
|
242
242
|
}), f.textContent = "A", f.style.color = "#000", f.style.fontSize = "16px", f.style.fontWeight = "bold", f.style.border = "1px solid #ccc", f.style.borderRadius = "4px", f.style.padding = "4px 8px", f.style.cursor = "pointer", f.style.backgroundColor = "#fff", f.title = "Text Color", f.onclick = () => v.click(), v.onchange = () => {
|
|
243
243
|
Ne(), To(v.value), f.style.color = v.value;
|
|
244
244
|
}, h.appendChild(f), 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 b = document.createElement("div");
|
|
248
|
+
return b.setAttribute("role", "button"), b.tabIndex = 0, b.style.userSelect = "none", b.addEventListener("keydown", (y) => {
|
|
249
|
+
(y.key === "Enter" || y.key === " ") && (y.preventDefault(), b.click());
|
|
250
|
+
}), b.textContent = "BA", b.style.color = "#000", b.style.fontSize = "14px", b.style.fontWeight = "bold", b.style.border = "1px solid #ccc", b.style.borderRadius = "4px", b.style.padding = "4px 6px", b.style.cursor = "pointer", b.style.backgroundColor = "#fff", b.title = "Background Color", b.onclick = () => d.click(), d.onchange = () => {
|
|
251
|
+
Ne(), _o(d.value), b.style.backgroundColor = d.value, b.style.color = "#000";
|
|
252
|
+
}, h.appendChild(b), h.appendChild(d), h;
|
|
253
253
|
}
|
|
254
254
|
function Ro() {
|
|
255
255
|
const h = document.createDocumentFragment();
|
|
256
256
|
return [
|
|
257
|
-
{
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
257
|
+
{
|
|
258
|
+
command: "justifyLeft",
|
|
259
|
+
align: "left",
|
|
260
|
+
icon: wo,
|
|
261
|
+
title: "Align Left"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
command: "justifyCenter",
|
|
265
|
+
align: "center",
|
|
266
|
+
icon: yo,
|
|
267
|
+
title: "Align Center"
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
command: "justifyRight",
|
|
271
|
+
align: "right",
|
|
272
|
+
icon: bo,
|
|
273
|
+
title: "Align Right"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
command: "justifyFull",
|
|
277
|
+
align: "justify",
|
|
278
|
+
icon: xo,
|
|
279
|
+
title: "Justify"
|
|
280
|
+
}
|
|
261
281
|
].forEach((f) => {
|
|
262
282
|
const d = document.createElement("div");
|
|
263
|
-
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (
|
|
264
|
-
(
|
|
283
|
+
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (y) => {
|
|
284
|
+
(y.key === "Enter" || y.key === " ") && (y.preventDefault(), d.click());
|
|
265
285
|
});
|
|
266
|
-
const
|
|
267
|
-
d.appendChild(
|
|
286
|
+
const b = ye(f.icon, { width: 16, height: 16 });
|
|
287
|
+
d.appendChild(b), d.title = f.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 y = window.getSelection();
|
|
289
|
+
if (y && y.rangeCount > 0) {
|
|
290
|
+
let S = y.anchorNode;
|
|
291
|
+
for (; S && S.nodeType !== Node.ELEMENT_NODE; )
|
|
292
|
+
S = S.parentNode;
|
|
293
|
+
let E = S, M = null;
|
|
294
|
+
for (; E && E !== document.body; ) {
|
|
295
|
+
if (E.tagName === "P" && E.querySelector(".editor-image-wrapper")) {
|
|
296
|
+
M = E;
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
299
|
+
if (E.tagName === "P") {
|
|
300
|
+
M = E;
|
|
301
|
+
break;
|
|
302
|
+
}
|
|
303
|
+
E = E.parentElement;
|
|
304
|
+
}
|
|
305
|
+
if (M) {
|
|
306
|
+
M.style.textAlign = f.align;
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
document.execCommand(f.command);
|
|
311
|
+
}, h.appendChild(d);
|
|
268
312
|
}), h;
|
|
269
313
|
}
|
|
270
314
|
function Io() {
|
|
@@ -274,11 +318,11 @@ function Io() {
|
|
|
274
318
|
{ command: "insertOrderedList", icon: co, title: "Numbered List" }
|
|
275
319
|
].forEach((f) => {
|
|
276
320
|
const d = document.createElement("div");
|
|
277
|
-
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (
|
|
278
|
-
(
|
|
321
|
+
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (y) => {
|
|
322
|
+
(y.key === "Enter" || y.key === " ") && (y.preventDefault(), d.click());
|
|
279
323
|
});
|
|
280
|
-
const
|
|
281
|
-
d.appendChild(
|
|
324
|
+
const b = ye(f.icon, { width: 16, height: 16 });
|
|
325
|
+
d.appendChild(b), d.title = f.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(f.command), h.appendChild(d);
|
|
282
326
|
}), h;
|
|
283
327
|
}
|
|
284
328
|
function Oo() {
|
|
@@ -288,11 +332,11 @@ function Oo() {
|
|
|
288
332
|
{ command: "outdent", icon: so, title: "Decrease Indent" }
|
|
289
333
|
].forEach((f) => {
|
|
290
334
|
const d = document.createElement("div");
|
|
291
|
-
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (
|
|
292
|
-
(
|
|
335
|
+
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (y) => {
|
|
336
|
+
(y.key === "Enter" || y.key === " ") && (y.preventDefault(), d.click());
|
|
293
337
|
});
|
|
294
|
-
const
|
|
295
|
-
d.appendChild(
|
|
338
|
+
const b = ye(f.icon, { width: 16, height: 16 });
|
|
339
|
+
d.appendChild(b), d.title = f.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(f.command), h.appendChild(d);
|
|
296
340
|
}), h;
|
|
297
341
|
}
|
|
298
342
|
function Ao() {
|
|
@@ -302,11 +346,11 @@ function Ao() {
|
|
|
302
346
|
{ command: "redo", icon: vo, title: "Redo" }
|
|
303
347
|
].forEach((f) => {
|
|
304
348
|
const d = document.createElement("div");
|
|
305
|
-
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (
|
|
306
|
-
(
|
|
349
|
+
d.setAttribute("role", "button"), d.tabIndex = 0, d.style.userSelect = "none", d.addEventListener("keydown", (y) => {
|
|
350
|
+
(y.key === "Enter" || y.key === " ") && (y.preventDefault(), d.click());
|
|
307
351
|
});
|
|
308
|
-
const
|
|
309
|
-
d.appendChild(
|
|
352
|
+
const b = ye(f.icon, { width: 16, height: 16 });
|
|
353
|
+
d.appendChild(b), d.title = f.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(f.command), h.appendChild(d);
|
|
310
354
|
}), h;
|
|
311
355
|
}
|
|
312
356
|
function Po() {
|
|
@@ -315,12 +359,12 @@ function Po() {
|
|
|
315
359
|
(f.key === "Enter" || f.key === " ") && (f.preventDefault(), h.click());
|
|
316
360
|
});
|
|
317
361
|
const v = ye(oo, { width: 16, height: 16 });
|
|
318
|
-
return h.appendChild(v), h.title = "Insert Image", 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", h.onmousedown = () =>
|
|
362
|
+
return h.appendChild(v), h.title = "Insert Image", 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", h.onmousedown = () => he(), h;
|
|
319
363
|
}
|
|
320
364
|
function Do() {
|
|
321
365
|
const h = document.createElement("div");
|
|
322
|
-
h.setAttribute("role", "button"), h.tabIndex = 0, h.style.userSelect = "none", h.addEventListener("keydown", (
|
|
323
|
-
(
|
|
366
|
+
h.setAttribute("role", "button"), h.tabIndex = 0, h.style.userSelect = "none", h.addEventListener("keydown", (S) => {
|
|
367
|
+
(S.key === "Enter" || S.key === " ") && (S.preventDefault(), h.click());
|
|
324
368
|
});
|
|
325
369
|
const v = ye(po, {
|
|
326
370
|
width: 16,
|
|
@@ -330,27 +374,27 @@ function Do() {
|
|
|
330
374
|
height: 16
|
|
331
375
|
});
|
|
332
376
|
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";
|
|
333
|
-
let d = !1,
|
|
377
|
+
let d = !1, b = "", y = "";
|
|
334
378
|
return h.onclick = () => {
|
|
335
|
-
const
|
|
379
|
+
const S = document.querySelector(
|
|
336
380
|
".editor-container"
|
|
337
381
|
);
|
|
338
|
-
if (!
|
|
339
|
-
const
|
|
382
|
+
if (!S) return;
|
|
383
|
+
const E = S.querySelector(".editor");
|
|
340
384
|
if (d)
|
|
341
|
-
|
|
385
|
+
b ? S.setAttribute("style", b) : S.removeAttribute("style"), E && (y ? E.setAttribute("style", y) : E.removeAttribute("style")), h.replaceChild(v, f), d = !1;
|
|
342
386
|
else {
|
|
343
|
-
|
|
387
|
+
b = S.getAttribute("style") || "", y = E && E.getAttribute("style") || "", S.style.position = "fixed", S.style.top = "0", S.style.left = "0", S.style.width = "100vw", S.style.height = "100vh", S.style.margin = "0", S.style.padding = "0";
|
|
344
388
|
try {
|
|
345
|
-
let
|
|
346
|
-
document.querySelectorAll("body *").forEach((
|
|
347
|
-
const
|
|
348
|
-
!isNaN(
|
|
349
|
-
}),
|
|
389
|
+
let M = 9998;
|
|
390
|
+
document.querySelectorAll("body *").forEach((A) => {
|
|
391
|
+
const R = window.getComputedStyle(A).getPropertyValue("z-index"), F = parseInt(R, 10);
|
|
392
|
+
!isNaN(F) && F > 0 && (M = Math.max(M, F));
|
|
393
|
+
}), S.style.zIndex = String(Math.max(M + 1, 9999));
|
|
350
394
|
} catch {
|
|
351
|
-
|
|
395
|
+
S.style.zIndex = "9999";
|
|
352
396
|
}
|
|
353
|
-
|
|
397
|
+
S.style.backgroundColor = "#ffffff", S.style.display = "flex", S.style.flexDirection = "column", S.style.boxSizing = "border-box", E && (E.style.flexGrow = "1", E.style.overflowY = "auto", E.style.border = "none", E.style.borderRadius = "0", E.style.boxShadow = "none", E.style.height = "auto", E.style.padding = "20px", E.style.boxSizing = "border-box"), h.replaceChild(f, v), d = !0;
|
|
354
398
|
}
|
|
355
399
|
}, h;
|
|
356
400
|
}
|
|
@@ -359,160 +403,160 @@ function No(h) {
|
|
|
359
403
|
f.style.position = "fixed", f.style.top = "0", f.style.left = "0", f.style.width = "100%", f.style.height = "100%", f.style.backgroundColor = "rgba(0, 0, 0, 0.5)", f.style.display = "none", f.style.zIndex = "1000", f.style.alignItems = "center", f.style.justifyContent = "center", f.style.flexDirection = "column";
|
|
360
404
|
const d = document.createElement("div");
|
|
361
405
|
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";
|
|
362
|
-
const
|
|
363
|
-
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
const
|
|
369
|
-
|
|
370
|
-
(
|
|
371
|
-
}),
|
|
372
|
-
f.style.display = "none",
|
|
406
|
+
const b = document.createElement("h3");
|
|
407
|
+
b.textContent = "Insert Hyperlink", b.style.margin = "0 0 15px 0", b.style.fontSize = "18px", b.style.fontWeight = "bold";
|
|
408
|
+
const y = document.createElement("input");
|
|
409
|
+
y.type = "url", y.placeholder = "Enter URL (e.g., https://example.com)", y.style.width = "100%", y.style.padding = "8px", y.style.border = "1px solid #ccc", y.style.borderRadius = "4px", y.style.marginBottom = "15px", y.style.boxSizing = "border-box";
|
|
410
|
+
const S = document.createElement("div");
|
|
411
|
+
S.style.display = "flex", S.style.gap = "10px", S.style.justifyContent = "flex-end";
|
|
412
|
+
const E = document.createElement("div");
|
|
413
|
+
E.setAttribute("role", "button"), E.tabIndex = 0, E.style.userSelect = "none", E.textContent = "Cancel", E.style.padding = "8px 16px", E.style.border = "1px solid #ccc", E.style.borderRadius = "4px", E.style.backgroundColor = "#f5f5f5", E.style.cursor = "pointer", E.addEventListener("keydown", (P) => {
|
|
414
|
+
(P.key === "Enter" || P.key === " " || P.key === "Escape") && (P.preventDefault(), E.click());
|
|
415
|
+
}), E.onclick = () => {
|
|
416
|
+
f.style.display = "none", y.value = "", M = null;
|
|
373
417
|
};
|
|
374
|
-
let
|
|
375
|
-
const
|
|
376
|
-
|
|
377
|
-
(
|
|
378
|
-
}),
|
|
379
|
-
const
|
|
380
|
-
if (
|
|
381
|
-
if (
|
|
382
|
-
|
|
418
|
+
let M = null;
|
|
419
|
+
const A = document.createElement("div");
|
|
420
|
+
A.setAttribute("role", "button"), A.tabIndex = 0, A.style.userSelect = "none", A.textContent = "Insert", A.style.padding = "8px 16px", A.style.border = "none", A.style.borderRadius = "4px", A.style.backgroundColor = "#007bff", A.style.color = "#fff", A.style.cursor = "pointer", A.addEventListener("keydown", (P) => {
|
|
421
|
+
(P.key === "Enter" || P.key === " ") && (P.preventDefault(), A.click());
|
|
422
|
+
}), A.onclick = () => {
|
|
423
|
+
const P = y.value.trim();
|
|
424
|
+
if (P)
|
|
425
|
+
if (M)
|
|
426
|
+
M.setAttribute("href", P), M.setAttribute("target", "_blank"), M.setAttribute("rel", "noopener noreferrer"), M.setAttribute("tabindex", "0");
|
|
383
427
|
else {
|
|
384
|
-
Ne(), document.execCommand("createLink", !1,
|
|
385
|
-
const
|
|
386
|
-
if (
|
|
387
|
-
let
|
|
388
|
-
for (;
|
|
389
|
-
|
|
390
|
-
let
|
|
391
|
-
for (;
|
|
392
|
-
if (
|
|
393
|
-
const oe =
|
|
428
|
+
Ne(), document.execCommand("createLink", !1, P);
|
|
429
|
+
const te = window.getSelection();
|
|
430
|
+
if (te && te.rangeCount > 0) {
|
|
431
|
+
let K = te.getRangeAt(0).startContainer;
|
|
432
|
+
for (; K && K.nodeType !== Node.ELEMENT_NODE; )
|
|
433
|
+
K = K.parentNode;
|
|
434
|
+
let G = K;
|
|
435
|
+
for (; G && G !== document.body; ) {
|
|
436
|
+
if (G.tagName === "A") {
|
|
437
|
+
const oe = G;
|
|
394
438
|
oe.setAttribute("target", "_blank"), oe.setAttribute("rel", "noopener noreferrer"), oe.setAttribute("tabindex", "0");
|
|
395
439
|
break;
|
|
396
440
|
}
|
|
397
|
-
|
|
441
|
+
G = G.parentElement;
|
|
398
442
|
}
|
|
399
443
|
}
|
|
400
444
|
}
|
|
401
|
-
f.style.display = "none",
|
|
402
|
-
},
|
|
403
|
-
|
|
445
|
+
f.style.display = "none", y.value = "", M = null;
|
|
446
|
+
}, S.appendChild(E), S.appendChild(A), d.appendChild(b), d.appendChild(y), d.appendChild(S), f.appendChild(d), document.body.appendChild(f), y.onkeydown = (P) => {
|
|
447
|
+
P.key === "Enter" ? A.click() : P.key === "Escape" && E.click();
|
|
404
448
|
};
|
|
405
|
-
const
|
|
406
|
-
|
|
407
|
-
const
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
const
|
|
411
|
-
if (
|
|
412
|
-
let
|
|
413
|
-
for (;
|
|
414
|
-
|
|
415
|
-
let
|
|
416
|
-
for (;
|
|
417
|
-
if (
|
|
418
|
-
|
|
449
|
+
const R = document.createElement("div");
|
|
450
|
+
R.setAttribute("role", "button"), R.tabIndex = 0, R.style.userSelect = "none";
|
|
451
|
+
const F = ye(ao, { width: 16, height: 16 });
|
|
452
|
+
R.appendChild(F), R.title = "Insert Hyperlink", R.style.border = "1px solid #e1e1e1", R.style.backgroundColor = "#ffffff", R.style.padding = "6px 10px", R.style.borderRadius = "3px", R.style.cursor = "pointer", R.style.color = "#000000", R.onmouseover = () => R.style.backgroundColor = "#f0f0f0", R.onmouseout = () => R.style.backgroundColor = "#ffffff", R.onmousedown = () => {
|
|
453
|
+
M = null;
|
|
454
|
+
const P = window.getSelection();
|
|
455
|
+
if (P && P.rangeCount > 0) {
|
|
456
|
+
let K = P.getRangeAt(0).startContainer;
|
|
457
|
+
for (; K && K.nodeType !== Node.ELEMENT_NODE; )
|
|
458
|
+
K = K.parentNode;
|
|
459
|
+
let G = K;
|
|
460
|
+
for (; G && G !== document.body; ) {
|
|
461
|
+
if (G.tagName === "A") {
|
|
462
|
+
M = G, y.value = M.getAttribute("href") || "";
|
|
419
463
|
break;
|
|
420
464
|
}
|
|
421
|
-
|
|
465
|
+
G = G.parentElement;
|
|
422
466
|
}
|
|
423
467
|
}
|
|
424
|
-
|
|
425
|
-
},
|
|
426
|
-
(
|
|
427
|
-
}),
|
|
428
|
-
f.style.display = "flex",
|
|
429
|
-
}, v.appendChild(
|
|
430
|
-
const
|
|
431
|
-
return
|
|
432
|
-
const
|
|
433
|
-
if (
|
|
434
|
-
|
|
435
|
-
const
|
|
436
|
-
|
|
468
|
+
he();
|
|
469
|
+
}, R.addEventListener("keydown", (P) => {
|
|
470
|
+
(P.key === "Enter" || P.key === " ") && (P.preventDefault(), R.click());
|
|
471
|
+
}), R.onclick = () => {
|
|
472
|
+
f.style.display = "flex", y.focus();
|
|
473
|
+
}, v.appendChild(R);
|
|
474
|
+
const X = h.querySelector(".editor");
|
|
475
|
+
return X && X.addEventListener("click", (P) => {
|
|
476
|
+
const te = P.target;
|
|
477
|
+
if (te.tagName === "A") {
|
|
478
|
+
P.preventDefault();
|
|
479
|
+
const K = te.getAttribute("href");
|
|
480
|
+
K && window.open(K, "_blank");
|
|
437
481
|
}
|
|
438
482
|
}), v;
|
|
439
483
|
}
|
|
440
484
|
function zo() {
|
|
441
485
|
const h = document.createDocumentFragment(), v = document.createElement("div");
|
|
442
|
-
v.setAttribute("role", "button"), v.tabIndex = 0, v.style.userSelect = "none", v.addEventListener("keydown", (
|
|
443
|
-
(
|
|
486
|
+
v.setAttribute("role", "button"), v.tabIndex = 0, v.style.userSelect = "none", v.addEventListener("keydown", (J) => {
|
|
487
|
+
(J.key === "Enter" || J.key === " ") && (J.preventDefault(), v.click());
|
|
444
488
|
});
|
|
445
489
|
const f = ye(ho, { width: 16, height: 16 });
|
|
446
490
|
v.appendChild(f), 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";
|
|
447
491
|
const d = document.createElement("div");
|
|
448
492
|
d.className = "rte-modal-overlay", d.style.display = "none";
|
|
493
|
+
const b = document.createElement("div");
|
|
494
|
+
b.className = "rte-modal";
|
|
449
495
|
const y = document.createElement("div");
|
|
450
|
-
y.className = "rte-modal";
|
|
451
|
-
const
|
|
452
|
-
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
496
|
+
y.className = "rte-modal-header";
|
|
497
|
+
const S = document.createElement("h3");
|
|
498
|
+
S.textContent = "Insert Quote", S.className = "rte-modal-title";
|
|
499
|
+
const E = document.createElement("div");
|
|
500
|
+
E.setAttribute("role", "button"), E.tabIndex = 0, E.style.userSelect = "none", E.className = "rte-modal-close", E.innerHTML = "×", E.onclick = () => {
|
|
501
|
+
d.style.display = "none", ee = null;
|
|
502
|
+
}, y.appendChild(S), y.appendChild(E);
|
|
503
|
+
const M = document.createElement("div");
|
|
504
|
+
M.className = "rte-modal-form";
|
|
505
|
+
const A = document.createElement("label");
|
|
506
|
+
A.textContent = "Title", A.className = "rte-label";
|
|
507
|
+
const R = document.createElement("input");
|
|
508
|
+
R.type = "text", R.placeholder = "e.g., Article title or source", R.className = "rte-input";
|
|
509
|
+
const F = document.createElement("label");
|
|
510
|
+
F.textContent = "Source URL", F.className = "rte-label";
|
|
511
|
+
const X = document.createElement("input");
|
|
512
|
+
X.type = "url", X.placeholder = "https://example.com", X.className = "rte-input";
|
|
459
513
|
const P = document.createElement("div");
|
|
460
|
-
P.className = "rte-
|
|
461
|
-
const
|
|
462
|
-
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
const $ = document.createElement("label");
|
|
466
|
-
$.textContent = "Source URL", $.className = "rte-label";
|
|
467
|
-
const re = document.createElement("input");
|
|
468
|
-
re.type = "url", re.placeholder = "https://example.com", re.className = "rte-input";
|
|
469
|
-
const A = document.createElement("div");
|
|
470
|
-
A.className = "rte-preview-label", A.textContent = "Preview";
|
|
471
|
-
const ee = document.createElement("div");
|
|
472
|
-
ee.className = "rte-modal-preview";
|
|
514
|
+
P.className = "rte-preview-label", P.textContent = "Preview";
|
|
515
|
+
const te = document.createElement("div");
|
|
516
|
+
te.className = "rte-modal-preview";
|
|
517
|
+
const K = document.createElement("div");
|
|
518
|
+
K.className = "rte-blockquote-title";
|
|
473
519
|
const G = document.createElement("div");
|
|
474
|
-
G.className = "rte-blockquote-
|
|
475
|
-
const X = document.createElement("div");
|
|
476
|
-
X.className = "rte-blockquote-content";
|
|
520
|
+
G.className = "rte-blockquote-content";
|
|
477
521
|
const oe = document.createElement("div");
|
|
478
|
-
oe.className = "rte-blockquote-footer",
|
|
522
|
+
oe.className = "rte-blockquote-footer", te.appendChild(K), te.appendChild(G), te.appendChild(oe), M.appendChild(A), M.appendChild(R), M.appendChild(F), M.appendChild(X), M.appendChild(P), M.appendChild(te);
|
|
479
523
|
const U = document.createElement("div");
|
|
480
524
|
U.className = "rte-modal-actions";
|
|
481
|
-
const
|
|
482
|
-
|
|
483
|
-
|
|
525
|
+
const ne = document.createElement("div");
|
|
526
|
+
ne.setAttribute("role", "button"), ne.tabIndex = 0, ne.style.userSelect = "none", ne.className = "rte-btn-danger", ne.textContent = "Remove", ne.style.display = "none", ne.onclick = () => {
|
|
527
|
+
ee && (ee.remove(), ee = null), d.style.display = "none";
|
|
484
528
|
};
|
|
485
|
-
const
|
|
486
|
-
|
|
487
|
-
d.style.display = "none",
|
|
529
|
+
const Z = document.createElement("div");
|
|
530
|
+
Z.setAttribute("role", "button"), Z.tabIndex = 0, Z.style.userSelect = "none", Z.className = "rte-btn-muted", Z.textContent = "Cancel", Z.onclick = () => {
|
|
531
|
+
d.style.display = "none", ee = null;
|
|
488
532
|
};
|
|
489
533
|
const ie = document.createElement("div");
|
|
490
534
|
ie.setAttribute("role", "button"), ie.tabIndex = 0, ie.style.userSelect = "none", ie.className = "rte-btn-primary", ie.textContent = "Apply", ie.onclick = () => {
|
|
491
|
-
const
|
|
492
|
-
let z =
|
|
493
|
-
if (z && !/^https?:\/\//i.test(z) && (z = `https://${z}`),
|
|
494
|
-
const le =
|
|
535
|
+
const J = R.value.trim();
|
|
536
|
+
let z = X.value.trim();
|
|
537
|
+
if (z && !/^https?:\/\//i.test(z) && (z = `https://${z}`), ee) {
|
|
538
|
+
const le = ee.querySelector(
|
|
495
539
|
".rte-blockquote-title"
|
|
496
540
|
);
|
|
497
|
-
if (
|
|
498
|
-
if (le) le.textContent =
|
|
541
|
+
if (J)
|
|
542
|
+
if (le) le.textContent = J;
|
|
499
543
|
else {
|
|
500
|
-
const
|
|
501
|
-
|
|
544
|
+
const Y = document.createElement("div");
|
|
545
|
+
Y.className = "rte-blockquote-title", Y.textContent = J, ee.insertBefore(Y, ee.firstChild);
|
|
502
546
|
}
|
|
503
547
|
else le && le.remove();
|
|
504
|
-
const ce =
|
|
548
|
+
const ce = ee.querySelector(
|
|
505
549
|
".rte-blockquote-footer"
|
|
506
550
|
);
|
|
507
551
|
if (z)
|
|
508
552
|
if (ce) {
|
|
509
|
-
const
|
|
510
|
-
|
|
553
|
+
const Y = ce.querySelector("a");
|
|
554
|
+
Y.href = z, Y.textContent = z;
|
|
511
555
|
} else {
|
|
512
|
-
const
|
|
513
|
-
|
|
514
|
-
const
|
|
515
|
-
|
|
556
|
+
const Y = document.createElement("footer");
|
|
557
|
+
Y.className = "rte-blockquote-footer";
|
|
558
|
+
const $ = document.createElement("cite"), B = document.createElement("a");
|
|
559
|
+
B.href = z, B.textContent = z, B.target = "_blank", B.rel = "noopener noreferrer", $.appendChild(B), Y.appendChild($), ee.appendChild(Y);
|
|
516
560
|
}
|
|
517
561
|
else ce && ce.remove();
|
|
518
562
|
} else {
|
|
@@ -522,61 +566,61 @@ function zo() {
|
|
|
522
566
|
d.style.display = "none";
|
|
523
567
|
return;
|
|
524
568
|
}
|
|
525
|
-
const ce = le.getRangeAt(0),
|
|
526
|
-
if (
|
|
527
|
-
const
|
|
528
|
-
|
|
569
|
+
const ce = le.getRangeAt(0), Y = ce.extractContents(), $ = document.createElement("blockquote");
|
|
570
|
+
if ($.className = "rte-blockquote", J) {
|
|
571
|
+
const Q = document.createElement("div");
|
|
572
|
+
Q.className = "rte-blockquote-title", Q.textContent = J, $.appendChild(Q);
|
|
529
573
|
}
|
|
530
|
-
const
|
|
531
|
-
if (
|
|
532
|
-
const
|
|
533
|
-
|
|
574
|
+
const B = document.createElement("p");
|
|
575
|
+
if (B.appendChild(Y), $.appendChild(B), z) {
|
|
576
|
+
const Q = document.createElement("footer");
|
|
577
|
+
Q.className = "rte-blockquote-footer";
|
|
534
578
|
const se = document.createElement("cite"), de = document.createElement("a");
|
|
535
|
-
de.href = z, de.textContent = z, de.target = "_blank", de.rel = "noopener noreferrer", se.appendChild(de),
|
|
579
|
+
de.href = z, de.textContent = z, de.target = "_blank", de.rel = "noopener noreferrer", se.appendChild(de), Q.appendChild(se), $.appendChild(Q);
|
|
536
580
|
}
|
|
537
|
-
ce.insertNode(
|
|
538
|
-
const
|
|
539
|
-
|
|
581
|
+
ce.insertNode($), le.removeAllRanges();
|
|
582
|
+
const re = document.createRange();
|
|
583
|
+
re.setStartAfter($), re.collapse(!0), le.addRange(re), he(re);
|
|
540
584
|
}
|
|
541
|
-
d.style.display = "none",
|
|
542
|
-
}, U.appendChild(
|
|
543
|
-
let
|
|
585
|
+
d.style.display = "none", R.value = "", X.value = "", ee = null;
|
|
586
|
+
}, U.appendChild(ne), U.appendChild(Z), U.appendChild(ie), b.appendChild(y), b.appendChild(M), b.appendChild(U), d.appendChild(b), document.body.appendChild(d);
|
|
587
|
+
let ee = null, g = "";
|
|
544
588
|
return v.onmousedown = () => {
|
|
545
|
-
|
|
546
|
-
const
|
|
547
|
-
if (
|
|
548
|
-
const z =
|
|
589
|
+
ee = null, g = "";
|
|
590
|
+
const J = window.getSelection();
|
|
591
|
+
if (J && J.rangeCount > 0) {
|
|
592
|
+
const z = J.getRangeAt(0), le = document.createElement("div");
|
|
549
593
|
le.appendChild(z.cloneContents()), g = le.innerHTML || z.toString();
|
|
550
594
|
let ce = z.startContainer;
|
|
551
595
|
for (; ce && ce.nodeType !== Node.ELEMENT_NODE; )
|
|
552
596
|
ce = ce.parentNode;
|
|
553
|
-
let
|
|
554
|
-
for (;
|
|
555
|
-
if (
|
|
556
|
-
|
|
557
|
-
const
|
|
597
|
+
let Y = ce;
|
|
598
|
+
for (; Y && Y !== document.body; ) {
|
|
599
|
+
if (Y.tagName === "BLOCKQUOTE") {
|
|
600
|
+
ee = Y;
|
|
601
|
+
const $ = ee.querySelector(
|
|
558
602
|
".rte-blockquote-title"
|
|
559
|
-
),
|
|
603
|
+
), B = ee.querySelector(
|
|
560
604
|
".rte-blockquote-footer a"
|
|
561
605
|
);
|
|
562
|
-
|
|
563
|
-
const
|
|
564
|
-
|
|
606
|
+
R.value = $ && $.textContent || "", X.value = B && B.href || "", ne.style.display = "inline-block";
|
|
607
|
+
const re = ee.querySelector("p");
|
|
608
|
+
G.innerHTML = re ? re.innerHTML : ee.innerHTML, K.textContent = $ && $.textContent || "", oe.innerHTML = B ? `<a href="${B.href}">${B.href}</a>` : "";
|
|
565
609
|
break;
|
|
566
610
|
}
|
|
567
|
-
|
|
611
|
+
Y = Y.parentElement;
|
|
568
612
|
}
|
|
569
613
|
}
|
|
570
|
-
|
|
571
|
-
},
|
|
572
|
-
const
|
|
573
|
-
if (!
|
|
614
|
+
ee || (G.innerHTML = g || "<em>Selected text will appear here</em>", K.textContent = "", oe.innerHTML = "", ne.style.display = "none"), he();
|
|
615
|
+
}, R.oninput = () => K.textContent = R.value, X.oninput = () => {
|
|
616
|
+
const J = X.value.trim();
|
|
617
|
+
if (!J) oe.innerHTML = "";
|
|
574
618
|
else {
|
|
575
|
-
const z = /^https?:\/\//i.test(
|
|
619
|
+
const z = /^https?:\/\//i.test(J) ? J : `https://${J}`;
|
|
576
620
|
oe.innerHTML = `<a href="${z}" target="_blank" rel="noopener noreferrer">${z}</a>`;
|
|
577
621
|
}
|
|
578
622
|
}, v.onclick = () => {
|
|
579
|
-
d.style.display = "flex",
|
|
623
|
+
d.style.display = "flex", R.focus();
|
|
580
624
|
}, h.appendChild(v), h;
|
|
581
625
|
}
|
|
582
626
|
function Lo() {
|
|
@@ -592,74 +636,74 @@ function jo(h) {
|
|
|
592
636
|
f.className = "rte-modal-overlay", f.style.display = "none";
|
|
593
637
|
const d = document.createElement("div");
|
|
594
638
|
d.className = "rte-modal";
|
|
595
|
-
const
|
|
596
|
-
|
|
597
|
-
const
|
|
598
|
-
|
|
599
|
-
const
|
|
600
|
-
|
|
601
|
-
const
|
|
602
|
-
|
|
603
|
-
const
|
|
604
|
-
|
|
605
|
-
const
|
|
606
|
-
|
|
607
|
-
const
|
|
608
|
-
|
|
609
|
-
const
|
|
610
|
-
|
|
611
|
-
const re = document.createElement("div");
|
|
612
|
-
re.className = "rte-form-left";
|
|
613
|
-
const A = document.createElement("div");
|
|
614
|
-
A.className = "rte-form-right";
|
|
615
|
-
const ee = document.createElement("div");
|
|
616
|
-
ee.className = "rte-field", ee.appendChild(P), ee.appendChild(I);
|
|
617
|
-
const G = document.createElement("div");
|
|
618
|
-
G.className = "rte-dim-row";
|
|
639
|
+
const b = document.createElement("div");
|
|
640
|
+
b.className = "rte-modal-header";
|
|
641
|
+
const y = document.createElement("h3");
|
|
642
|
+
y.className = "rte-modal-title", y.textContent = "Insert Video";
|
|
643
|
+
const S = document.createElement("div");
|
|
644
|
+
S.setAttribute("role", "button"), S.tabIndex = 0, S.style.userSelect = "none", S.className = "rte-modal-close", S.innerHTML = "×", S.onclick = () => f.style.display = "none", b.appendChild(y), b.appendChild(S);
|
|
645
|
+
const E = document.createElement("div");
|
|
646
|
+
E.className = "rte-modal-form";
|
|
647
|
+
const M = document.createElement("label");
|
|
648
|
+
M.className = "rte-label", M.textContent = "Video URL";
|
|
649
|
+
const A = document.createElement("input");
|
|
650
|
+
A.type = "url", A.className = "rte-input", A.placeholder = "https://... or YouTube URL";
|
|
651
|
+
const R = document.createElement("div");
|
|
652
|
+
R.className = "rte-preview-label", R.textContent = "Preview";
|
|
653
|
+
const F = document.createElement("div");
|
|
654
|
+
F.className = "rte-modal-preview";
|
|
619
655
|
const X = document.createElement("div");
|
|
620
|
-
X.
|
|
656
|
+
X.className = "rte-form-left";
|
|
657
|
+
const P = document.createElement("div");
|
|
658
|
+
P.className = "rte-form-right";
|
|
659
|
+
const te = document.createElement("div");
|
|
660
|
+
te.className = "rte-field", te.appendChild(M), te.appendChild(A);
|
|
661
|
+
const K = document.createElement("div");
|
|
662
|
+
K.className = "rte-dim-row";
|
|
663
|
+
const G = document.createElement("div");
|
|
664
|
+
G.style.display = "flex", G.style.flexDirection = "column";
|
|
621
665
|
const oe = document.createElement("label");
|
|
622
666
|
oe.className = "rte-label", oe.textContent = "Width (px)";
|
|
623
667
|
const U = document.createElement("input");
|
|
624
|
-
U.type = "text", U.className = "rte-dim-input", U.placeholder = "e.g., 560",
|
|
625
|
-
const
|
|
626
|
-
|
|
627
|
-
const
|
|
628
|
-
|
|
668
|
+
U.type = "text", U.className = "rte-dim-input", U.placeholder = "e.g., 560", G.appendChild(oe), G.appendChild(U);
|
|
669
|
+
const ne = document.createElement("div");
|
|
670
|
+
ne.style.display = "flex", ne.style.flexDirection = "column";
|
|
671
|
+
const Z = document.createElement("label");
|
|
672
|
+
Z.className = "rte-label", Z.textContent = "Height (px)";
|
|
629
673
|
const ie = document.createElement("input");
|
|
630
|
-
ie.type = "text", ie.className = "rte-dim-input", ie.placeholder = "e.g., 315",
|
|
631
|
-
const
|
|
632
|
-
|
|
674
|
+
ie.type = "text", ie.className = "rte-dim-input", ie.placeholder = "e.g., 315", ne.appendChild(Z), ne.appendChild(ie), K.appendChild(G), K.appendChild(ne), X.appendChild(te), X.appendChild(K), P.appendChild(R), P.appendChild(F), E.appendChild(X), E.appendChild(P);
|
|
675
|
+
const ee = document.createElement("div");
|
|
676
|
+
ee.className = "rte-modal-actions";
|
|
633
677
|
const g = document.createElement("div");
|
|
634
678
|
g.setAttribute("role", "button"), g.tabIndex = 0, g.style.userSelect = "none", g.className = "rte-btn-muted", g.textContent = "Cancel", g.onclick = () => f.style.display = "none";
|
|
635
|
-
const
|
|
636
|
-
|
|
679
|
+
const J = document.createElement("div");
|
|
680
|
+
J.setAttribute("role", "button"), J.tabIndex = 0, J.style.userSelect = "none", J.className = "rte-btn-primary", J.textContent = "Insert", ee.appendChild(g), ee.appendChild(J), d.appendChild(b), d.appendChild(E), d.appendChild(ee), f.appendChild(d), document.body.appendChild(f);
|
|
637
681
|
const z = document.createElement("div");
|
|
638
682
|
z.setAttribute("role", "button"), z.tabIndex = 0, z.style.userSelect = "none";
|
|
639
683
|
const le = ye(Co, { width: 16, height: 16 });
|
|
640
|
-
z.appendChild(le), z.title = "Insert Video", z.style.border = "1px solid #e1e1e1", z.style.backgroundColor = "#ffffff", z.style.padding = "6px 10px", z.style.borderRadius = "3px", z.style.cursor = "pointer", z.style.color = "#000000", z.onmouseover = () => z.style.backgroundColor = "#f0f0f0", z.onmouseout = () => z.style.backgroundColor = "#ffffff", z.onmousedown = () =>
|
|
641
|
-
(
|
|
684
|
+
z.appendChild(le), z.title = "Insert Video", z.style.border = "1px solid #e1e1e1", z.style.backgroundColor = "#ffffff", z.style.padding = "6px 10px", z.style.borderRadius = "3px", z.style.cursor = "pointer", z.style.color = "#000000", z.onmouseover = () => z.style.backgroundColor = "#f0f0f0", z.onmouseout = () => z.style.backgroundColor = "#ffffff", z.onmousedown = () => he(), z.addEventListener("keydown", ($) => {
|
|
685
|
+
($.key === "Enter" || $.key === " ") && ($.preventDefault(), z.click());
|
|
642
686
|
}), z.onclick = () => {
|
|
643
|
-
|
|
687
|
+
F.innerHTML = "<em>No URL entered</em>", A.value = "", f.style.display = "flex", A.focus();
|
|
644
688
|
};
|
|
645
689
|
const ce = () => {
|
|
646
|
-
const
|
|
647
|
-
if (
|
|
648
|
-
|
|
690
|
+
const $ = A.value.trim(), B = U && U.value.trim() || "", re = ie && ie.value.trim() || "", Q = parseInt(B, 10), se = parseInt(re, 10);
|
|
691
|
+
if (!$) {
|
|
692
|
+
F.innerHTML = "<em>No preview</em>";
|
|
649
693
|
return;
|
|
650
694
|
}
|
|
651
|
-
const de =
|
|
695
|
+
const de = $.match(/(?:youtube.com\/watch\?v=|youtu.be\/)([\w-]+)/i);
|
|
652
696
|
if (de) {
|
|
653
|
-
const
|
|
654
|
-
|
|
697
|
+
const x = de[1], D = Number.isFinite(Q) ? Q : 320, L = Number.isFinite(se) ? se : 180;
|
|
698
|
+
F.innerHTML = `<iframe width="${D}" height="${L}" src="https://www.youtube.com/embed/${x}" frameborder="0" allowfullscreen></iframe>`;
|
|
655
699
|
return;
|
|
656
700
|
}
|
|
657
|
-
const pe = Number.isFinite(
|
|
658
|
-
|
|
701
|
+
const pe = Number.isFinite(Q) ? `${Q}px` : "320px", fe = Number.isFinite(se) ? `${se}px` : "auto";
|
|
702
|
+
F.innerHTML = `<video controls style="max-width:100%; width:${pe}; height:${fe};" src="${$}"></video>`;
|
|
659
703
|
};
|
|
660
|
-
|
|
661
|
-
const
|
|
662
|
-
if (
|
|
704
|
+
A.oninput = ce, typeof U < "u" && (U.oninput = ce), typeof ie < "u" && (ie.oninput = ce), J.onclick = () => {
|
|
705
|
+
const $ = A.value.trim(), B = U && U.value.trim() || "", re = ie && ie.value.trim() || "", Q = parseInt(B, 10), se = parseInt(re, 10);
|
|
706
|
+
if (!$) {
|
|
663
707
|
f.style.display = "none";
|
|
664
708
|
return;
|
|
665
709
|
}
|
|
@@ -669,29 +713,29 @@ function jo(h) {
|
|
|
669
713
|
f.style.display = "none";
|
|
670
714
|
return;
|
|
671
715
|
}
|
|
672
|
-
const pe = de.getRangeAt(0), fe =
|
|
673
|
-
let
|
|
716
|
+
const pe = de.getRangeAt(0), fe = $.match(/(?:youtube.com\/watch\?v=|youtu.be\/)([\w-]+)/i);
|
|
717
|
+
let x;
|
|
674
718
|
if (fe) {
|
|
675
|
-
const L = fe[1],
|
|
676
|
-
|
|
719
|
+
const L = fe[1], q = document.createElement("div"), xe = Number.isFinite(Q) ? Q : 560, we = Number.isFinite(se) ? se : 315;
|
|
720
|
+
q.innerHTML = `<iframe width="${xe}" height="${we}" src="https://www.youtube.com/embed/${L}" frameborder="0" allowfullscreen></iframe>`, q.contentEditable = "false", q.className = "editor-video-wrapper", q.style.display = "block", q.style.maxWidth = "100%", q.style.width = "auto", q.style.height = "auto", q.style.boxSizing = "border-box", q.style.userSelect = "none", x = q;
|
|
677
721
|
} else {
|
|
678
|
-
const L = document.createElement("div"),
|
|
679
|
-
|
|
722
|
+
const L = document.createElement("div"), q = document.createElement("video");
|
|
723
|
+
q.controls = !0, q.src = $, Number.isFinite(Q) && (q.width = Q), Number.isFinite(se) && (q.height = se), q.style.maxWidth = "100%", q.style.display = "block", L.appendChild(q), L.contentEditable = "false", L.className = "editor-video-wrapper", L.style.display = "block", L.style.maxWidth = "100%", L.style.width = "auto", L.style.height = "auto", L.style.boxSizing = "border-box", L.style.userSelect = "none", x = L;
|
|
680
724
|
}
|
|
681
|
-
pe.insertNode(
|
|
725
|
+
pe.insertNode(x), de.removeAllRanges();
|
|
682
726
|
const D = document.createRange();
|
|
683
|
-
D.setStartAfter(
|
|
727
|
+
D.setStartAfter(x), D.collapse(!0), de.addRange(D), he(D);
|
|
684
728
|
try {
|
|
685
|
-
const L =
|
|
729
|
+
const L = Y;
|
|
686
730
|
L && typeof L.focus == "function" && (L.focus(), L.dispatchEvent(new Event("input", { bubbles: !0 })));
|
|
687
731
|
} catch {
|
|
688
732
|
}
|
|
689
|
-
f.style.display = "none",
|
|
733
|
+
f.style.display = "none", A.value = "", F.innerHTML = "";
|
|
690
734
|
};
|
|
691
|
-
const
|
|
692
|
-
return
|
|
693
|
-
const
|
|
694
|
-
|
|
735
|
+
const Y = h.querySelector(".editor");
|
|
736
|
+
return Y && Y.addEventListener("click", ($) => {
|
|
737
|
+
const B = $.target;
|
|
738
|
+
B && B.tagName === "VIDEO" && B.focus();
|
|
695
739
|
}), v.appendChild(z), v;
|
|
696
740
|
}
|
|
697
741
|
function Fo(h) {
|
|
@@ -723,21 +767,21 @@ function Fo(h) {
|
|
|
723
767
|
for (; U && U.nodeType !== Node.ELEMENT_NODE; )
|
|
724
768
|
U = U.parentNode;
|
|
725
769
|
if (!U) return;
|
|
726
|
-
let
|
|
727
|
-
for (;
|
|
728
|
-
const
|
|
729
|
-
if (
|
|
730
|
-
d.value =
|
|
770
|
+
let ne = U;
|
|
771
|
+
for (; ne && ne !== document.body && ne !== v.parentElement; ) {
|
|
772
|
+
const Z = ne.tagName?.toUpperCase?.();
|
|
773
|
+
if (Z === "H1" || Z === "H2" || Z === "H3" || Z === "H4" || Z === "P") {
|
|
774
|
+
d.value = Z === "P" ? "p" : Z.toLowerCase();
|
|
731
775
|
return;
|
|
732
776
|
}
|
|
733
|
-
|
|
777
|
+
ne = ne.parentElement;
|
|
734
778
|
}
|
|
735
779
|
d.value = "p";
|
|
736
780
|
} catch {
|
|
737
781
|
}
|
|
738
782
|
});
|
|
739
|
-
const
|
|
740
|
-
|
|
783
|
+
const b = eo();
|
|
784
|
+
b.innerHTML = `
|
|
741
785
|
<option value="1">8pt</option>
|
|
742
786
|
<option value="2">10pt</option>
|
|
743
787
|
<option value="3" selected>12pt</option>
|
|
@@ -745,67 +789,81 @@ function Fo(h) {
|
|
|
745
789
|
<option value="5">18pt</option>
|
|
746
790
|
<option value="6">24pt</option>
|
|
747
791
|
<option value="7">36pt</option>
|
|
748
|
-
`,
|
|
749
|
-
const
|
|
750
|
-
v.appendChild(
|
|
751
|
-
const
|
|
752
|
-
v.appendChild(
|
|
753
|
-
const
|
|
754
|
-
v.appendChild(
|
|
755
|
-
const
|
|
756
|
-
v.appendChild(P);
|
|
757
|
-
const I = Oo();
|
|
758
|
-
v.appendChild(I);
|
|
759
|
-
const M = Ao();
|
|
792
|
+
`, b.style.border = "1px solid #e1e1e1", b.style.backgroundColor = "#ffffff", b.style.padding = "4px", b.style.borderRadius = "3px", b.style.color = "#000000", b.onchange = () => document.execCommand("fontSize", !1, b.value), v.appendChild(b);
|
|
793
|
+
const y = So();
|
|
794
|
+
v.appendChild(y);
|
|
795
|
+
const S = Mo();
|
|
796
|
+
v.appendChild(S);
|
|
797
|
+
const E = Ro();
|
|
798
|
+
v.appendChild(E);
|
|
799
|
+
const M = Io();
|
|
760
800
|
v.appendChild(M);
|
|
761
|
-
const
|
|
762
|
-
v.appendChild($);
|
|
763
|
-
const re = No(h);
|
|
764
|
-
v.appendChild(re);
|
|
765
|
-
const A = zo();
|
|
801
|
+
const A = Oo();
|
|
766
802
|
v.appendChild(A);
|
|
767
|
-
const
|
|
768
|
-
v.appendChild(
|
|
769
|
-
const
|
|
770
|
-
v.appendChild(
|
|
771
|
-
const X =
|
|
772
|
-
|
|
803
|
+
const R = Ao();
|
|
804
|
+
v.appendChild(R);
|
|
805
|
+
const F = Po();
|
|
806
|
+
v.appendChild(F);
|
|
807
|
+
const X = No(h);
|
|
808
|
+
v.appendChild(X);
|
|
809
|
+
const P = zo();
|
|
810
|
+
v.appendChild(P);
|
|
811
|
+
const te = Lo();
|
|
812
|
+
v.appendChild(te);
|
|
813
|
+
const K = jo(h);
|
|
814
|
+
v.appendChild(K);
|
|
815
|
+
const G = Do();
|
|
816
|
+
return v.appendChild(G), v;
|
|
773
817
|
}
|
|
774
818
|
function Ho(h, v) {
|
|
775
819
|
const f = document.createElement("div");
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
}), f.addEventListener("
|
|
779
|
-
|
|
780
|
-
|
|
820
|
+
f.classList.add("editor"), f.contentEditable = "true", f.style.color = "#000000", f.style.border = "1px solid #e1e1e1", f.style.height = "400px", f.style.overflowY = "auto", f.style.padding = "15px", f.style.fontFamily = "Arial, sans-serif", f.style.fontSize = "14px", f.style.lineHeight = "1.5", f.style.outline = "none", f.style.backgroundColor = "#ffffff", f.style.borderRadius = "4px", f.style.boxShadow = "inset 0 1px 3px rgba(0,0,0,0.1)", f.style.direction = "ltr", f.style.textAlign = "left", f.style.scrollbarWidth = "none", f.style.msOverflowStyle = "none";
|
|
821
|
+
const d = document.createElement("style");
|
|
822
|
+
return d.textContent = ".editor::-webkit-scrollbar { display: none; }", document.querySelector("style[data-editor-scrollbar]") || (d.setAttribute("data-editor-scrollbar", "true"), document.head.appendChild(d)), f.innerHTML = "", f.addEventListener("dragover", (b) => {
|
|
823
|
+
b.preventDefault(), b.stopPropagation();
|
|
824
|
+
}), f.addEventListener("drop", (b) => {
|
|
825
|
+
b.preventDefault(), b.stopPropagation();
|
|
826
|
+
const y = b.dataTransfer?.files;
|
|
781
827
|
if (y && y.length > 0)
|
|
782
|
-
for (let
|
|
783
|
-
const
|
|
784
|
-
if (
|
|
785
|
-
const
|
|
786
|
-
|
|
787
|
-
const
|
|
788
|
-
|
|
789
|
-
const
|
|
790
|
-
|
|
791
|
-
const
|
|
792
|
-
|
|
793
|
-
},
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
}), f.addEventListener("click", (
|
|
797
|
-
const y =
|
|
798
|
-
let
|
|
799
|
-
y.tagName === "IMG" && (
|
|
800
|
-
|
|
828
|
+
for (let S = 0; S < y.length; S++) {
|
|
829
|
+
const E = y[S];
|
|
830
|
+
if (E.type.startsWith("image/")) {
|
|
831
|
+
const M = new FileReader();
|
|
832
|
+
M.onload = (A) => {
|
|
833
|
+
const R = document.createElement("img");
|
|
834
|
+
R.src = A.target?.result, R.style.maxWidth = "100%", R.style.width = "100%", R.style.height = "auto", R.style.cursor = "pointer", R.draggable = !1;
|
|
835
|
+
const F = document.createElement("div");
|
|
836
|
+
F.className = "editor-image-wrapper", F.style.display = "inline-block", F.style.position = "relative", F.style.maxWidth = "100%", F.style.width = "auto", F.style.height = "auto", F.contentEditable = "false", F.style.userSelect = "none", F.style.boxSizing = "border-box", F.style.touchAction = "none", F.appendChild(R);
|
|
837
|
+
const X = document.createElement("div");
|
|
838
|
+
X.contentEditable = "true", X.style.margin = "10px 0", X.style.textAlign = "left", X.style.display = "block", X.appendChild(F), f.appendChild(X), f.dispatchEvent(new Event("input", { bubbles: !0 })), f.focus();
|
|
839
|
+
}, M.readAsDataURL(E);
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
}), f.addEventListener("click", (b) => {
|
|
843
|
+
const y = b.target;
|
|
844
|
+
let S = y;
|
|
845
|
+
if (y.tagName === "IMG" && (S = y.parentElement), S && S.classList.contains("editor-image-wrapper")) {
|
|
846
|
+
v(S);
|
|
847
|
+
const E = S.parentElement;
|
|
848
|
+
if (E && E.tagName === "DIV" && E.querySelector(".editor-image-wrapper"))
|
|
849
|
+
try {
|
|
850
|
+
const M = window.getSelection();
|
|
851
|
+
if (M) {
|
|
852
|
+
const A = document.createRange();
|
|
853
|
+
A.selectNode(E), M.removeAllRanges(), M.addRange(A), he();
|
|
854
|
+
}
|
|
855
|
+
} catch {
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
}), f.addEventListener("keyup", () => he()), f.addEventListener("mouseup", () => he()), f.addEventListener("focus", () => he()), window.addEventListener("selectionchange", () => {
|
|
801
859
|
try {
|
|
802
|
-
const
|
|
803
|
-
if (!
|
|
804
|
-
let y =
|
|
860
|
+
const b = window.getSelection();
|
|
861
|
+
if (!b || !b.anchorNode) return;
|
|
862
|
+
let y = b.anchorNode;
|
|
805
863
|
for (; y && y.nodeType !== Node.ELEMENT_NODE; )
|
|
806
864
|
y = y.parentNode;
|
|
807
865
|
if (!y) return;
|
|
808
|
-
f.contains(y) &&
|
|
866
|
+
f.contains(y) && he();
|
|
809
867
|
} catch {
|
|
810
868
|
}
|
|
811
869
|
}), f;
|
|
@@ -833,54 +891,54 @@ function Vo() {
|
|
|
833
891
|
for (var e = 1; e < arguments.length; e++) {
|
|
834
892
|
var n = arguments[e] != null ? arguments[e] : {};
|
|
835
893
|
e % 2 ? f(Object(n), !0).forEach((function(r) {
|
|
836
|
-
|
|
894
|
+
M(t, r, n[r]);
|
|
837
895
|
})) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : f(Object(n)).forEach((function(r) {
|
|
838
896
|
Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
|
|
839
897
|
}));
|
|
840
898
|
}
|
|
841
899
|
return t;
|
|
842
900
|
}
|
|
843
|
-
function
|
|
844
|
-
return
|
|
901
|
+
function b(t) {
|
|
902
|
+
return b = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
845
903
|
return typeof e;
|
|
846
904
|
} : function(e) {
|
|
847
905
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
848
|
-
},
|
|
906
|
+
}, b(t);
|
|
849
907
|
}
|
|
850
|
-
function
|
|
908
|
+
function y(t, e) {
|
|
851
909
|
if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
|
|
852
910
|
}
|
|
853
|
-
function
|
|
911
|
+
function S(t, e) {
|
|
854
912
|
for (var n = 0; n < e.length; n++) {
|
|
855
913
|
var r = e[n];
|
|
856
|
-
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t,
|
|
914
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, K(r.key), r);
|
|
857
915
|
}
|
|
858
916
|
}
|
|
859
|
-
function
|
|
860
|
-
return e &&
|
|
917
|
+
function E(t, e, n) {
|
|
918
|
+
return e && S(t.prototype, e), Object.defineProperty(t, "prototype", { writable: !1 }), t;
|
|
861
919
|
}
|
|
862
|
-
function
|
|
863
|
-
return (e =
|
|
920
|
+
function M(t, e, n) {
|
|
921
|
+
return (e = K(e)) in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t;
|
|
864
922
|
}
|
|
865
|
-
function
|
|
923
|
+
function A(t, e) {
|
|
866
924
|
if (typeof e != "function" && e !== null) throw new TypeError("Super expression must either be null or a function");
|
|
867
|
-
t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e &&
|
|
925
|
+
t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && F(t, e);
|
|
868
926
|
}
|
|
869
|
-
function
|
|
870
|
-
return
|
|
927
|
+
function R(t) {
|
|
928
|
+
return R = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
|
|
871
929
|
return e.__proto__ || Object.getPrototypeOf(e);
|
|
872
|
-
},
|
|
930
|
+
}, R(t);
|
|
873
931
|
}
|
|
874
|
-
function
|
|
875
|
-
return
|
|
932
|
+
function F(t, e) {
|
|
933
|
+
return F = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
|
|
876
934
|
return n.__proto__ = r, n;
|
|
877
|
-
},
|
|
935
|
+
}, F(t, e);
|
|
878
936
|
}
|
|
879
|
-
function
|
|
937
|
+
function X(t) {
|
|
880
938
|
if (t === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
881
939
|
return t;
|
|
882
940
|
}
|
|
883
|
-
function
|
|
941
|
+
function P(t) {
|
|
884
942
|
var e = (function() {
|
|
885
943
|
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
886
944
|
if (typeof Proxy == "function") return !0;
|
|
@@ -892,31 +950,31 @@ function Vo() {
|
|
|
892
950
|
}
|
|
893
951
|
})();
|
|
894
952
|
return function() {
|
|
895
|
-
var n, r =
|
|
953
|
+
var n, r = R(t);
|
|
896
954
|
if (e) {
|
|
897
|
-
var o =
|
|
955
|
+
var o = R(this).constructor;
|
|
898
956
|
n = Reflect.construct(r, arguments, o);
|
|
899
957
|
} else n = r.apply(this, arguments);
|
|
900
958
|
return (function(i, a) {
|
|
901
959
|
if (a && (typeof a == "object" || typeof a == "function")) return a;
|
|
902
960
|
if (a !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
|
|
903
|
-
return
|
|
961
|
+
return X(i);
|
|
904
962
|
})(this, n);
|
|
905
963
|
};
|
|
906
964
|
}
|
|
907
|
-
function
|
|
908
|
-
return
|
|
965
|
+
function te() {
|
|
966
|
+
return te = typeof Reflect < "u" && Reflect.get ? Reflect.get.bind() : function(t, e, n) {
|
|
909
967
|
var r = (function(i, a) {
|
|
910
|
-
for (; !Object.prototype.hasOwnProperty.call(i, a) && (i =
|
|
968
|
+
for (; !Object.prototype.hasOwnProperty.call(i, a) && (i = R(i)) !== null; ) ;
|
|
911
969
|
return i;
|
|
912
970
|
})(t, e);
|
|
913
971
|
if (r) {
|
|
914
972
|
var o = Object.getOwnPropertyDescriptor(r, e);
|
|
915
973
|
return o.get ? o.get.call(arguments.length < 3 ? t : n) : o.value;
|
|
916
974
|
}
|
|
917
|
-
},
|
|
975
|
+
}, te.apply(this, arguments);
|
|
918
976
|
}
|
|
919
|
-
function
|
|
977
|
+
function K(t) {
|
|
920
978
|
var e = (function(n, r) {
|
|
921
979
|
if (typeof n != "object" || n === null) return n;
|
|
922
980
|
var o = n[Symbol.toPrimitive];
|
|
@@ -929,42 +987,42 @@ function Vo() {
|
|
|
929
987
|
})(t, "string");
|
|
930
988
|
return typeof e == "symbol" ? e : e + "";
|
|
931
989
|
}
|
|
932
|
-
var
|
|
990
|
+
var G = function(t) {
|
|
933
991
|
return !(!t || !t.Window) && t instanceof t.Window;
|
|
934
992
|
}, oe = void 0, U = void 0;
|
|
935
|
-
function
|
|
993
|
+
function ne(t) {
|
|
936
994
|
oe = t;
|
|
937
995
|
var e = t.document.createTextNode("");
|
|
938
996
|
e.ownerDocument !== t.document && typeof t.wrap == "function" && t.wrap(e) === e && (t = t.wrap(t)), U = t;
|
|
939
997
|
}
|
|
940
|
-
function
|
|
941
|
-
return
|
|
998
|
+
function Z(t) {
|
|
999
|
+
return G(t) ? t : (t.ownerDocument || t).defaultView || U.window;
|
|
942
1000
|
}
|
|
943
|
-
typeof window < "u" && window &&
|
|
1001
|
+
typeof window < "u" && window && ne(window);
|
|
944
1002
|
var ie = function(t) {
|
|
945
|
-
return !!t &&
|
|
946
|
-
},
|
|
1003
|
+
return !!t && b(t) === "object";
|
|
1004
|
+
}, ee = function(t) {
|
|
947
1005
|
return typeof t == "function";
|
|
948
1006
|
}, g = { window: function(t) {
|
|
949
|
-
return t === U ||
|
|
1007
|
+
return t === U || G(t);
|
|
950
1008
|
}, docFrag: function(t) {
|
|
951
1009
|
return ie(t) && t.nodeType === 11;
|
|
952
|
-
}, object: ie, func:
|
|
1010
|
+
}, object: ie, func: ee, number: function(t) {
|
|
953
1011
|
return typeof t == "number";
|
|
954
1012
|
}, bool: function(t) {
|
|
955
1013
|
return typeof t == "boolean";
|
|
956
1014
|
}, string: function(t) {
|
|
957
1015
|
return typeof t == "string";
|
|
958
1016
|
}, element: function(t) {
|
|
959
|
-
if (!t ||
|
|
960
|
-
var e =
|
|
961
|
-
return /object|function/.test(typeof Element > "u" ? "undefined" :
|
|
1017
|
+
if (!t || b(t) !== "object") return !1;
|
|
1018
|
+
var e = Z(t) || U;
|
|
1019
|
+
return /object|function/.test(typeof Element > "u" ? "undefined" : b(Element)) ? t instanceof Element || t instanceof e.Element : t.nodeType === 1 && typeof t.nodeName == "string";
|
|
962
1020
|
}, plainObject: function(t) {
|
|
963
1021
|
return ie(t) && !!t.constructor && /function Object\b/.test(t.constructor.toString());
|
|
964
1022
|
}, array: function(t) {
|
|
965
|
-
return ie(t) && t.length !== void 0 &&
|
|
1023
|
+
return ie(t) && t.length !== void 0 && ee(t.splice);
|
|
966
1024
|
} };
|
|
967
|
-
function
|
|
1025
|
+
function J(t) {
|
|
968
1026
|
var e = t.interaction;
|
|
969
1027
|
if (e.prepared.name === "drag") {
|
|
970
1028
|
var n = e.prepared.axis;
|
|
@@ -984,25 +1042,25 @@ function Vo() {
|
|
|
984
1042
|
var le = { id: "actions/drag", install: function(t) {
|
|
985
1043
|
var e = t.actions, n = t.Interactable, r = t.defaults;
|
|
986
1044
|
n.prototype.draggable = le.draggable, e.map.drag = le, e.methodDict.drag = "draggable", r.actions.drag = le.defaults;
|
|
987
|
-
}, listeners: { "interactions:before-action-move":
|
|
1045
|
+
}, listeners: { "interactions:before-action-move": J, "interactions:action-resume": J, "interactions:action-move": z, "auto-start:check": function(t) {
|
|
988
1046
|
var e = t.interaction, n = t.interactable, r = t.buttons, o = n.options.drag;
|
|
989
1047
|
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;
|
|
990
1048
|
} }, draggable: function(t) {
|
|
991
1049
|
return g.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) : g.bool(t) ? (this.options.drag.enabled = t, this) : this.options.drag;
|
|
992
|
-
}, beforeMove:
|
|
1050
|
+
}, beforeMove: J, move: z, defaults: { startAxis: "xy", lockAxis: "xy" }, getCursor: function() {
|
|
993
1051
|
return "move";
|
|
994
1052
|
}, filterEventType: function(t) {
|
|
995
1053
|
return t.search("drag") === 0;
|
|
996
|
-
} }, ce = le,
|
|
1054
|
+
} }, ce = le, Y = { init: function(t) {
|
|
997
1055
|
var e = t;
|
|
998
|
-
|
|
1056
|
+
Y.document = e.document, Y.DocumentFragment = e.DocumentFragment || $, Y.SVGElement = e.SVGElement || $, Y.SVGSVGElement = e.SVGSVGElement || $, Y.SVGElementInstance = e.SVGElementInstance || $, Y.Element = e.Element || $, Y.HTMLElement = e.HTMLElement || Y.Element, Y.Event = e.Event, Y.Touch = e.Touch || $, Y.PointerEvent = e.PointerEvent || e.MSPointerEvent;
|
|
999
1057
|
}, document: null, DocumentFragment: null, SVGElement: null, SVGSVGElement: null, SVGElementInstance: null, Element: null, HTMLElement: null, Event: null, Touch: null, PointerEvent: null };
|
|
1000
|
-
function
|
|
1058
|
+
function $() {
|
|
1001
1059
|
}
|
|
1002
|
-
var
|
|
1003
|
-
var e =
|
|
1004
|
-
|
|
1005
|
-
}, supportsTouch: null, supportsPointerEvent: null, isIOS7: null, isIOS: null, isIe9: null, isOperaMobile: null, prefixedMatchesSelector: null, pEventTypes: null, wheelEvent: null },
|
|
1060
|
+
var B = Y, re = { init: function(t) {
|
|
1061
|
+
var e = B.Element, n = t.navigator || {};
|
|
1062
|
+
re.supportsTouch = "ontouchstart" in t || g.func(t.DocumentTouch) && B.document instanceof t.DocumentTouch, re.supportsPointerEvent = n.pointerEnabled !== !1 && !!B.PointerEvent, re.isIOS = /iP(hone|od|ad)/.test(n.platform), re.isIOS7 = /iP(hone|od|ad)/.test(n.platform) && /OS 7[^\d]/.test(n.appVersion), re.isIe9 = /MSIE 9/.test(n.userAgent), re.isOperaMobile = n.appName === "Opera" && re.supportsTouch && /Presto/.test(n.userAgent), re.prefixedMatchesSelector = "matches" in e.prototype ? "matches" : "webkitMatchesSelector" in e.prototype ? "webkitMatchesSelector" : "mozMatchesSelector" in e.prototype ? "mozMatchesSelector" : "oMatchesSelector" in e.prototype ? "oMatchesSelector" : "msMatchesSelector", re.pEventTypes = re.supportsPointerEvent ? B.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, re.wheelEvent = B.document && "onmousewheel" in B.document ? "mousewheel" : "wheel";
|
|
1063
|
+
}, supportsTouch: null, supportsPointerEvent: null, isIOS7: null, isIOS: null, isIe9: null, isOperaMobile: null, prefixedMatchesSelector: null, pEventTypes: null, wheelEvent: null }, Q = re;
|
|
1006
1064
|
function se(t, e) {
|
|
1007
1065
|
if (t.contains) return t.contains(e);
|
|
1008
1066
|
for (; e; ) {
|
|
@@ -1027,13 +1085,13 @@ function Vo() {
|
|
|
1027
1085
|
return e;
|
|
1028
1086
|
}
|
|
1029
1087
|
function fe(t, e) {
|
|
1030
|
-
return U !== oe && (e = e.replace(/\/deep\//g, " ")), t[
|
|
1088
|
+
return U !== oe && (e = e.replace(/\/deep\//g, " ")), t[Q.prefixedMatchesSelector](e);
|
|
1031
1089
|
}
|
|
1032
|
-
var
|
|
1090
|
+
var x = function(t) {
|
|
1033
1091
|
return t.parentNode || t.host;
|
|
1034
1092
|
};
|
|
1035
1093
|
function D(t, e) {
|
|
1036
|
-
for (var n, r = [], o = t; (n =
|
|
1094
|
+
for (var n, r = [], o = t; (n = x(o)) && o !== e && n !== o.ownerDocument; ) r.unshift(o), o = n;
|
|
1037
1095
|
return r;
|
|
1038
1096
|
}
|
|
1039
1097
|
function L(t, e, n) {
|
|
@@ -1043,17 +1101,17 @@ function Vo() {
|
|
|
1043
1101
|
}
|
|
1044
1102
|
return !1;
|
|
1045
1103
|
}
|
|
1046
|
-
function
|
|
1104
|
+
function q(t) {
|
|
1047
1105
|
return t.correspondingUseElement || t;
|
|
1048
1106
|
}
|
|
1049
1107
|
function xe(t) {
|
|
1050
|
-
var e = t instanceof
|
|
1108
|
+
var e = t instanceof B.SVGElement ? t.getBoundingClientRect() : t.getClientRects()[0];
|
|
1051
1109
|
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 };
|
|
1052
1110
|
}
|
|
1053
1111
|
function we(t) {
|
|
1054
1112
|
var e, n = xe(t);
|
|
1055
|
-
if (!
|
|
1056
|
-
var r = { x: (e = (e =
|
|
1113
|
+
if (!Q.isIOS7 && n) {
|
|
1114
|
+
var r = { x: (e = (e = Z(t)) || U).scrollX || e.document.documentElement.scrollLeft, y: e.scrollY || e.document.documentElement.scrollTop };
|
|
1057
1115
|
n.left += r.x, n.right += r.x, n.top += r.y, n.bottom += r.y;
|
|
1058
1116
|
}
|
|
1059
1117
|
return n;
|
|
@@ -1063,9 +1121,9 @@ function Vo() {
|
|
|
1063
1121
|
return e;
|
|
1064
1122
|
}
|
|
1065
1123
|
function Ee(t) {
|
|
1066
|
-
return !!g.string(t) && (
|
|
1124
|
+
return !!g.string(t) && (B.document.querySelector(t), !0);
|
|
1067
1125
|
}
|
|
1068
|
-
function
|
|
1126
|
+
function I(t, e) {
|
|
1069
1127
|
for (var n in e) t[n] = e[n];
|
|
1070
1128
|
return t;
|
|
1071
1129
|
}
|
|
@@ -1080,7 +1138,7 @@ function Vo() {
|
|
|
1080
1138
|
return t && { x: "x" in t ? t.x : t.left, y: "y" in t ? t.y : t.top };
|
|
1081
1139
|
}
|
|
1082
1140
|
function vt(t) {
|
|
1083
|
-
return !t || "x" in t && "y" in t || ((t =
|
|
1141
|
+
return !t || "x" in t && "y" in t || ((t = I({}, t)).x = t.left || 0, t.y = t.top || 0, t.width = t.width || (t.right || 0) - t.x, t.height = t.height || (t.bottom || 0) - t.y), t;
|
|
1084
1142
|
}
|
|
1085
1143
|
function et(t, e, n) {
|
|
1086
1144
|
t.left && (e.left += n.x), t.right && (e.right += n.x), t.top && (e.top += n.y), t.bottom && (e.bottom += n.y), e.width = e.right - e.left, e.height = e.bottom - e.top;
|
|
@@ -1135,13 +1193,13 @@ function Vo() {
|
|
|
1135
1193
|
t.page.x = 0, t.page.y = 0, t.client.x = 0, t.client.y = 0;
|
|
1136
1194
|
}
|
|
1137
1195
|
function Bt(t) {
|
|
1138
|
-
return t instanceof
|
|
1196
|
+
return t instanceof B.Event || t instanceof B.Touch;
|
|
1139
1197
|
}
|
|
1140
1198
|
function rt(t, e, n) {
|
|
1141
1199
|
return t = t || "page", (n = n || {}).x = e[t + "X"], n.y = e[t + "Y"], n;
|
|
1142
1200
|
}
|
|
1143
1201
|
function qt(t, e) {
|
|
1144
|
-
return e = e || { x: 0, y: 0 },
|
|
1202
|
+
return e = e || { x: 0, y: 0 }, Q.isOperaMobile && Bt(t) ? (rt("screen", t, e), e.x += window.scrollX, e.y += window.scrollY) : rt("page", t, e), e;
|
|
1145
1203
|
}
|
|
1146
1204
|
function Fe(t) {
|
|
1147
1205
|
return g.number(t.pointerId) ? t.pointerId : t.identifier;
|
|
@@ -1149,7 +1207,7 @@ function Vo() {
|
|
|
1149
1207
|
function Fn(t, e, n) {
|
|
1150
1208
|
var r = e.length > 1 ? Vt(e) : e[0];
|
|
1151
1209
|
qt(r, t.page), (function(o, i) {
|
|
1152
|
-
i = i || {},
|
|
1210
|
+
i = i || {}, Q.isOperaMobile && Bt(o) ? rt("screen", o, i) : rt("client", o, i);
|
|
1153
1211
|
})(r, t.client), t.timeStamp = n;
|
|
1154
1212
|
}
|
|
1155
1213
|
function mt(t) {
|
|
@@ -1178,17 +1236,17 @@ function Vo() {
|
|
|
1178
1236
|
return 180 * Math.atan2(a, i) / Math.PI;
|
|
1179
1237
|
}
|
|
1180
1238
|
function Yt(t) {
|
|
1181
|
-
return g.string(t.pointerType) ? t.pointerType : g.number(t.pointerType) ? [void 0, void 0, "touch", "pen", "mouse"][t.pointerType] : /touch/.test(t.type || "") || t instanceof
|
|
1239
|
+
return g.string(t.pointerType) ? t.pointerType : g.number(t.pointerType) ? [void 0, void 0, "touch", "pen", "mouse"][t.pointerType] : /touch/.test(t.type || "") || t instanceof B.Touch ? "touch" : "mouse";
|
|
1182
1240
|
}
|
|
1183
1241
|
function $t(t) {
|
|
1184
1242
|
var e = g.func(t.composedPath) ? t.composedPath() : t.path;
|
|
1185
|
-
return [
|
|
1243
|
+
return [q(e ? e[0] : t.target), q(t.currentTarget)];
|
|
1186
1244
|
}
|
|
1187
1245
|
var ot = (function() {
|
|
1188
1246
|
function t(e) {
|
|
1189
|
-
|
|
1247
|
+
y(this, t), this.immediatePropagationStopped = !1, this.propagationStopped = !1, this._interaction = e;
|
|
1190
1248
|
}
|
|
1191
|
-
return
|
|
1249
|
+
return E(t, [{ key: "preventDefault", value: function() {
|
|
1192
1250
|
} }, { key: "stopPropagation", value: function() {
|
|
1193
1251
|
this.propagationStopped = !0;
|
|
1194
1252
|
} }, { key: "stopImmediatePropagation", value: function() {
|
|
@@ -1213,15 +1271,15 @@ function Vo() {
|
|
|
1213
1271
|
}, Be = function(t, e) {
|
|
1214
1272
|
return t[He(t, e)];
|
|
1215
1273
|
}, Pe = (function(t) {
|
|
1216
|
-
|
|
1217
|
-
var e =
|
|
1274
|
+
A(n, t);
|
|
1275
|
+
var e = P(n);
|
|
1218
1276
|
function n(r, o, i) {
|
|
1219
1277
|
var a;
|
|
1220
|
-
|
|
1278
|
+
y(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;
|
|
1221
1279
|
var s = i === "dragleave" ? r.prev : r.cur, l = s.element, u = s.dropzone;
|
|
1222
1280
|
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;
|
|
1223
1281
|
}
|
|
1224
|
-
return
|
|
1282
|
+
return E(n, [{ key: "reject", value: function() {
|
|
1225
1283
|
var r = this, o = this._interaction.dropState;
|
|
1226
1284
|
if (this.type === "dropactivate" || this.dropzone && o.cur.dropzone === this.dropzone && o.cur.element === this.target) if (o.prev.dropzone = this.dropzone, o.prev.element = this.target, o.rejected = !0, o.events.enter = null, this.stopImmediatePropagation(), this.type === "dropactivate") {
|
|
1227
1285
|
var i = o.activeDrops, a = He(i, (function(l) {
|
|
@@ -1251,8 +1309,8 @@ function Vo() {
|
|
|
1251
1309
|
var c = u[l];
|
|
1252
1310
|
if (c.options.drop.enabled) {
|
|
1253
1311
|
var p = c.options.drop.accept;
|
|
1254
|
-
if (!(g.element(p) && p !== a || g.string(p) && !fe(a, p) || g.func(p) && !p({ dropzone: c, draggableElement: a }))) for (var m = 0,
|
|
1255
|
-
var w =
|
|
1312
|
+
if (!(g.element(p) && p !== a || g.string(p) && !fe(a, p) || g.func(p) && !p({ dropzone: c, draggableElement: a }))) for (var m = 0, k = c.getAllElements(); m < k.length; m++) {
|
|
1313
|
+
var w = k[m];
|
|
1256
1314
|
w !== a && s.push({ dropzone: c, element: w, rect: c.getRect(w) });
|
|
1257
1315
|
}
|
|
1258
1316
|
}
|
|
@@ -1266,36 +1324,36 @@ function Vo() {
|
|
|
1266
1324
|
}
|
|
1267
1325
|
function Gt(t, e, n) {
|
|
1268
1326
|
for (var r = t.dropState, o = t.interactable, i = t.element, a = [], s = 0, l = r.activeDrops; s < l.length; s++) {
|
|
1269
|
-
var u = l[s], c = u.dropzone, p = u.element, m = u.rect,
|
|
1270
|
-
a.push(
|
|
1271
|
-
}
|
|
1272
|
-
var w = (function(
|
|
1273
|
-
for (var
|
|
1274
|
-
var N =
|
|
1275
|
-
if (N && W !==
|
|
1276
|
-
var
|
|
1277
|
-
if (
|
|
1278
|
-
|
|
1327
|
+
var u = l[s], c = u.dropzone, p = u.element, m = u.rect, k = c.dropCheck(e, n, o, i, p, m);
|
|
1328
|
+
a.push(k ? p : null);
|
|
1329
|
+
}
|
|
1330
|
+
var w = (function(C) {
|
|
1331
|
+
for (var _, T, O, H = [], W = 0; W < C.length; W++) {
|
|
1332
|
+
var N = C[W], V = C[_];
|
|
1333
|
+
if (N && W !== _) if (V) {
|
|
1334
|
+
var me = x(N), ae = x(V);
|
|
1335
|
+
if (me !== N.ownerDocument) if (ae !== N.ownerDocument) if (me !== ae) {
|
|
1336
|
+
H = H.length ? H : D(V);
|
|
1279
1337
|
var ge = void 0;
|
|
1280
|
-
if (
|
|
1338
|
+
if (V instanceof B.HTMLElement && N instanceof B.SVGElement && !(N instanceof B.SVGSVGElement)) {
|
|
1281
1339
|
if (N === ae) continue;
|
|
1282
1340
|
ge = N.ownerSVGElement;
|
|
1283
1341
|
} else ge = N;
|
|
1284
|
-
for (var be = D(ge,
|
|
1285
|
-
var ft = [be[Se - 1], be[Se],
|
|
1342
|
+
for (var be = D(ge, V.ownerDocument), Se = 0; be[Se] && be[Se] === H[Se]; ) Se++;
|
|
1343
|
+
var ft = [be[Se - 1], be[Se], H[Se]];
|
|
1286
1344
|
if (ft[0]) for (var Ue = ft[0].lastChild; Ue; ) {
|
|
1287
1345
|
if (Ue === ft[1]) {
|
|
1288
|
-
|
|
1346
|
+
_ = W, H = be;
|
|
1289
1347
|
break;
|
|
1290
1348
|
}
|
|
1291
1349
|
if (Ue === ft[2]) break;
|
|
1292
1350
|
Ue = Ue.previousSibling;
|
|
1293
1351
|
}
|
|
1294
|
-
} else O =
|
|
1295
|
-
else
|
|
1296
|
-
} else
|
|
1352
|
+
} else O = V, (parseInt(Z(T = N).getComputedStyle(T).zIndex, 10) || 0) >= (parseInt(Z(O).getComputedStyle(O).zIndex, 10) || 0) && (_ = W);
|
|
1353
|
+
else _ = W;
|
|
1354
|
+
} else _ = W;
|
|
1297
1355
|
}
|
|
1298
|
-
return
|
|
1356
|
+
return _;
|
|
1299
1357
|
})(a);
|
|
1300
1358
|
return r.activeDrops[w] || null;
|
|
1301
1359
|
}
|
|
@@ -1332,26 +1390,26 @@ function Vo() {
|
|
|
1332
1390
|
return g.bool(s) ? (a.options.drop.enabled = s, a) : a.options.drop;
|
|
1333
1391
|
})(this, i);
|
|
1334
1392
|
}, r.prototype.dropCheck = function(i, a, s, l, u, c) {
|
|
1335
|
-
return (function(p, m,
|
|
1393
|
+
return (function(p, m, k, w, C, _, T) {
|
|
1336
1394
|
var O = !1;
|
|
1337
|
-
if (!(
|
|
1338
|
-
var
|
|
1339
|
-
if (
|
|
1340
|
-
var W = Le(w,
|
|
1395
|
+
if (!(T = T || p.getRect(_))) return !!p.options.drop.checker && p.options.drop.checker(m, k, O, p, _, w, C);
|
|
1396
|
+
var H = p.options.drop.overlap;
|
|
1397
|
+
if (H === "pointer") {
|
|
1398
|
+
var W = Le(w, C, "drag"), N = qt(m);
|
|
1341
1399
|
N.x += W.x, N.y += W.y;
|
|
1342
|
-
var
|
|
1343
|
-
O =
|
|
1400
|
+
var V = N.x > T.left && N.x < T.right, me = N.y > T.top && N.y < T.bottom;
|
|
1401
|
+
O = V && me;
|
|
1344
1402
|
}
|
|
1345
|
-
var ae = w.getRect(
|
|
1346
|
-
if (ae &&
|
|
1403
|
+
var ae = w.getRect(C);
|
|
1404
|
+
if (ae && H === "center") {
|
|
1347
1405
|
var ge = ae.left + ae.width / 2, be = ae.top + ae.height / 2;
|
|
1348
|
-
O = ge >=
|
|
1406
|
+
O = ge >= T.left && ge <= T.right && be >= T.top && be <= T.bottom;
|
|
1349
1407
|
}
|
|
1350
|
-
return ae && g.number(
|
|
1408
|
+
return ae && g.number(H) && (O = Math.max(0, Math.min(T.right, ae.right) - Math.max(T.left, ae.left)) * Math.max(0, Math.min(T.bottom, ae.bottom) - Math.max(T.top, ae.top)) / (ae.width * ae.height) >= H), p.options.drop.checker && (O = p.options.drop.checker(m, k, O, p, _, w, C)), O;
|
|
1351
1409
|
})(this, i, a, s, l, u, c);
|
|
1352
1410
|
}, n.dynamicDrop = function(i) {
|
|
1353
1411
|
return g.bool(i) ? (t.dynamicDrop = i, n) : t.dynamicDrop;
|
|
1354
|
-
},
|
|
1412
|
+
}, I(e.phaselessTypes, { dragenter: !0, dragleave: !0, dropactivate: !0, dropdeactivate: !0, dropmove: !0, drop: !0 }), e.methodDict.drop = "dropzone", t.dynamicDrop = !1, o.actions.drop = Jt.defaults;
|
|
1355
1413
|
}, listeners: { "interactions:before-action-start": function(t) {
|
|
1356
1414
|
var e = t.interaction;
|
|
1357
1415
|
e.prepared.name === "drag" && (e.dropState = { cur: { dropzone: null, element: null }, prev: { dropzone: null, element: null }, rejected: null, events: null, activeDrops: [] });
|
|
@@ -1452,7 +1510,7 @@ function Vo() {
|
|
|
1452
1510
|
var n = e.iEvent, r = e.interaction;
|
|
1453
1511
|
if (r.prepared.name === "resize" && r.prepared.edges) {
|
|
1454
1512
|
var o = n, i = r.rect;
|
|
1455
|
-
r._rects = { start:
|
|
1513
|
+
r._rects = { start: I({}, i), corrected: I({}, i), previous: I({}, i), delta: { left: 0, right: 0, width: 0, top: 0, bottom: 0, height: 0 } }, o.edges = r.prepared.edges, o.rect = r._rects.corrected, o.deltaRect = r._rects.delta;
|
|
1456
1514
|
}
|
|
1457
1515
|
})(t), Qt(t);
|
|
1458
1516
|
}, "interactions:action-move": function(t) {
|
|
@@ -1460,11 +1518,11 @@ function Vo() {
|
|
|
1460
1518
|
var n = e.iEvent, r = e.interaction;
|
|
1461
1519
|
if (r.prepared.name === "resize" && r.prepared.edges) {
|
|
1462
1520
|
var o = n, i = r.interactable.options.resize.invert, a = i === "reposition" || i === "negate", s = r.rect, l = r._rects, u = l.start, c = l.corrected, p = l.delta, m = l.previous;
|
|
1463
|
-
if (
|
|
1464
|
-
if (
|
|
1521
|
+
if (I(m, c), a) {
|
|
1522
|
+
if (I(c, s), i === "reposition") {
|
|
1465
1523
|
if (c.top > c.bottom) {
|
|
1466
|
-
var
|
|
1467
|
-
c.top = c.bottom, c.bottom =
|
|
1524
|
+
var k = c.top;
|
|
1525
|
+
c.top = c.bottom, c.bottom = k;
|
|
1468
1526
|
}
|
|
1469
1527
|
if (c.left > c.right) {
|
|
1470
1528
|
var w = c.left;
|
|
@@ -1472,7 +1530,7 @@ function Vo() {
|
|
|
1472
1530
|
}
|
|
1473
1531
|
}
|
|
1474
1532
|
} 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);
|
|
1475
|
-
for (var
|
|
1533
|
+
for (var C in c.width = c.right - c.left, c.height = c.bottom - c.top, c) p[C] = c[C] - m[C];
|
|
1476
1534
|
o.edges = r.prepared.edges, o.rect = c, o.deltaRect = p;
|
|
1477
1535
|
}
|
|
1478
1536
|
})(t), Qt(t);
|
|
@@ -1485,7 +1543,7 @@ function Vo() {
|
|
|
1485
1543
|
}, "auto-start:check": function(t) {
|
|
1486
1544
|
var e = t.interaction, n = t.interactable, r = t.element, o = t.rect, i = t.buttons;
|
|
1487
1545
|
if (o) {
|
|
1488
|
-
var a =
|
|
1546
|
+
var a = I({}, e.coords.cur.page), s = n.options.resize;
|
|
1489
1547
|
if (s && s.enabled && (!e.pointerIsDown || !/mouse|pointer/.test(e.pointerType) || (i & s.mouseButtons) != 0)) {
|
|
1490
1548
|
if (g.object(s.edges)) {
|
|
1491
1549
|
var l = { left: !1, right: !1, top: !1, bottom: !1 };
|
|
@@ -1564,7 +1622,7 @@ function Vo() {
|
|
|
1564
1622
|
}
|
|
1565
1623
|
} };
|
|
1566
1624
|
function en(t, e, n) {
|
|
1567
|
-
return (g.string(t) ? Qe(t, e, n) : t) ||
|
|
1625
|
+
return (g.string(t) ? Qe(t, e, n) : t) || Z(n);
|
|
1568
1626
|
}
|
|
1569
1627
|
function tn(t) {
|
|
1570
1628
|
return g.window(t) && (t = window.document.body), { x: t.scrollLeft, y: t.scrollTop };
|
|
@@ -1600,7 +1658,7 @@ function Vo() {
|
|
|
1600
1658
|
var e = t.Interactable;
|
|
1601
1659
|
e.prototype.getAction = function(n, r, o, i) {
|
|
1602
1660
|
var a = (function(s, l, u, c, p) {
|
|
1603
|
-
var m = s.getRect(c),
|
|
1661
|
+
var m = s.getRect(c), k = l.buttons || { 0: 1, 1: 4, 3: 8, 4: 16 }[l.button], w = { action: null, interactable: s, interaction: u, element: c, rect: m, buttons: k };
|
|
1604
1662
|
return p.fire("auto-start:check", w), w.action;
|
|
1605
1663
|
})(this, r, o, i, t);
|
|
1606
1664
|
return this.options.actionChecker ? this.options.actionChecker(n, r, a, this, i, o) : a;
|
|
@@ -1644,8 +1702,8 @@ function Vo() {
|
|
|
1644
1702
|
var o = t.options, i = o[n.name].max, a = o[n.name].maxPerElement, s = r.autoStart.maxInteractions, l = 0, u = 0, c = 0;
|
|
1645
1703
|
if (!(i && a && s)) return !1;
|
|
1646
1704
|
for (var p = 0, m = r.interactions.list; p < m.length; p++) {
|
|
1647
|
-
var
|
|
1648
|
-
if (
|
|
1705
|
+
var k = m[p], w = k.prepared.name;
|
|
1706
|
+
if (k.interacting() && (++l >= s || k.interactable === t && ((u += w === n.name ? 1 : 0) >= i || k.element === e && (c++, w === n.name && c >= a))))
|
|
1649
1707
|
return !1;
|
|
1650
1708
|
}
|
|
1651
1709
|
return s > 0;
|
|
@@ -1670,7 +1728,7 @@ function Vo() {
|
|
|
1670
1728
|
}
|
|
1671
1729
|
var Jn = { id: "auto-start/base", before: ["actions"], install: function(t) {
|
|
1672
1730
|
var e = t.interactStatic, n = t.defaults;
|
|
1673
|
-
t.usePlugin(Gn), n.base.actionChecker = null, n.base.styleCursor = !0,
|
|
1731
|
+
t.usePlugin(Gn), n.base.actionChecker = null, n.base.styleCursor = !0, I(n.perAction, { manualStart: !1, max: 1 / 0, maxPerElement: 1, allowFrom: null, ignoreFrom: null, mouseButtons: 1 }), e.maxInteractions = function(r) {
|
|
1674
1732
|
return an(r, t);
|
|
1675
1733
|
}, t.autoStart = { maxInteractions: 1 / 0, withinInteractionLimit: it, cursorElement: null };
|
|
1676
1734
|
}, listeners: { "interactions:down": function(t, e) {
|
|
@@ -1699,20 +1757,20 @@ function Vo() {
|
|
|
1699
1757
|
n.prepared.name = null;
|
|
1700
1758
|
for (var p = r, m = function(w) {
|
|
1701
1759
|
if (w !== n.interactable) {
|
|
1702
|
-
var
|
|
1703
|
-
if (!
|
|
1704
|
-
var
|
|
1705
|
-
if (
|
|
1760
|
+
var C = n.interactable.options.drag;
|
|
1761
|
+
if (!C.manualStart && w.testIgnoreAllow(C, p, r)) {
|
|
1762
|
+
var _ = w.getAction(n.downPointer, n.downEvent, n, p);
|
|
1763
|
+
if (_ && _.name === "drag" && (function(T, O) {
|
|
1706
1764
|
if (!O) return !1;
|
|
1707
|
-
var
|
|
1708
|
-
return
|
|
1709
|
-
})(c, w) && _t.validateAction(
|
|
1765
|
+
var H = O.options.drag.startAxis;
|
|
1766
|
+
return T === "xy" || H === "xy" || H === T;
|
|
1767
|
+
})(c, w) && _t.validateAction(_, w, p, r, e)) return w;
|
|
1710
1768
|
}
|
|
1711
1769
|
}
|
|
1712
1770
|
}; g.element(p); ) {
|
|
1713
|
-
var
|
|
1714
|
-
if (
|
|
1715
|
-
n.prepared.name = "drag", n.interactable =
|
|
1771
|
+
var k = e.interactables.forEachMatch(p, m);
|
|
1772
|
+
if (k) {
|
|
1773
|
+
n.prepared.name = "drag", n.interactable = k, n.element = p;
|
|
1716
1774
|
break;
|
|
1717
1775
|
}
|
|
1718
1776
|
p = pe(p);
|
|
@@ -1758,7 +1816,7 @@ function Vo() {
|
|
|
1758
1816
|
var a = r.options.preventDefault;
|
|
1759
1817
|
if (a !== "never") if (a !== "always") {
|
|
1760
1818
|
if (o.events.supportsPassive && /^touch(start|move)$/.test(i.type)) {
|
|
1761
|
-
var s =
|
|
1819
|
+
var s = Z(i.target).document, l = o.getDocOptions(s);
|
|
1762
1820
|
if (!l || !l.events || l.events.passive !== !1) return;
|
|
1763
1821
|
}
|
|
1764
1822
|
/^(mouse|pointer|touch)*(down|start)/i.test(i.type) || g.element(i.target) && fe(i.target, "input,select,textarea,[contenteditable=true],[contenteditable=true] *") || i.preventDefault();
|
|
@@ -1788,19 +1846,19 @@ function Vo() {
|
|
|
1788
1846
|
}
|
|
1789
1847
|
var Rt = (function() {
|
|
1790
1848
|
function t(e) {
|
|
1791
|
-
|
|
1849
|
+
y(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 };
|
|
1792
1850
|
}
|
|
1793
|
-
return
|
|
1851
|
+
return E(t, [{ key: "start", value: function(e, n) {
|
|
1794
1852
|
var r, o, i = e.phase, a = this.interaction, s = (function(u) {
|
|
1795
1853
|
var c = u.interactable.options[u.prepared.name], p = c.modifiers;
|
|
1796
1854
|
return p && p.length ? p : ["snap", "snapSize", "snapEdges", "restrict", "restrictEdges", "restrictSize"].map((function(m) {
|
|
1797
|
-
var
|
|
1798
|
-
return
|
|
1855
|
+
var k = c[m];
|
|
1856
|
+
return k && k.enabled && { options: k, methods: k._methods };
|
|
1799
1857
|
})).filter((function(m) {
|
|
1800
1858
|
return !!m;
|
|
1801
1859
|
}));
|
|
1802
1860
|
})(a);
|
|
1803
|
-
this.prepareStates(s), this.startEdges =
|
|
1861
|
+
this.prepareStates(s), this.startEdges = I({}, a.edges), this.edges = I({}, this.startEdges), this.startOffset = (r = a.rect, o = n, r ? { left: o.x - r.left, top: o.y - r.top, right: r.right - o.x, bottom: r.bottom - o.y } : { left: 0, top: 0, right: 0, bottom: 0 }), this.startDelta = { x: 0, y: 0 };
|
|
1804
1862
|
var l = this.fillArg({ phase: i, pageCoords: n, preEnd: !1 });
|
|
1805
1863
|
return this.result = st(), this.startAll(l), this.result = this.setAll(l);
|
|
1806
1864
|
} }, { key: "fillArg", value: function(e) {
|
|
@@ -1813,27 +1871,27 @@ function Vo() {
|
|
|
1813
1871
|
}
|
|
1814
1872
|
} }, { key: "setAll", value: function(e) {
|
|
1815
1873
|
var n = e.phase, r = e.preEnd, o = e.skipModifiers, i = e.rect, a = e.edges;
|
|
1816
|
-
e.coords =
|
|
1874
|
+
e.coords = I({}, e.pageCoords), e.rect = I({}, i), e.edges = I({}, a);
|
|
1817
1875
|
for (var s = o ? this.states.slice(o) : this.states, l = st(e.coords, e.rect), u = 0; u < s.length; u++) {
|
|
1818
|
-
var c, p = s[u], m = p.options,
|
|
1819
|
-
(c = p.methods) != null && c.set && this.shouldDo(m, r, n) && (e.state = p, w = p.methods.set(e), et(e.edges, e.rect, { x: e.coords.x -
|
|
1876
|
+
var c, p = s[u], m = p.options, k = I({}, e.coords), w = null;
|
|
1877
|
+
(c = p.methods) != null && c.set && this.shouldDo(m, r, n) && (e.state = p, w = p.methods.set(e), et(e.edges, e.rect, { x: e.coords.x - k.x, y: e.coords.y - k.y })), l.eventProps.push(w);
|
|
1820
1878
|
}
|
|
1821
|
-
|
|
1822
|
-
var
|
|
1823
|
-
if (
|
|
1824
|
-
var
|
|
1825
|
-
l.changed =
|
|
1879
|
+
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;
|
|
1880
|
+
var C = this.result.coords, _ = this.result.rect;
|
|
1881
|
+
if (C && _) {
|
|
1882
|
+
var T = l.rect.left !== _.left || l.rect.right !== _.right || l.rect.top !== _.top || l.rect.bottom !== _.bottom;
|
|
1883
|
+
l.changed = T || C.x !== l.coords.x || C.y !== l.coords.y;
|
|
1826
1884
|
}
|
|
1827
1885
|
return l;
|
|
1828
1886
|
} }, { key: "applyToInteraction", value: function(e) {
|
|
1829
1887
|
var n = this.interaction, r = e.phase, o = n.coords.cur, i = n.coords.start, a = this.result, s = this.startDelta, l = a.delta;
|
|
1830
|
-
r === "start" &&
|
|
1888
|
+
r === "start" && I(this.startDelta, a.delta);
|
|
1831
1889
|
for (var u = 0, c = [[i, s], [o, l]]; u < c.length; u++) {
|
|
1832
|
-
var p = c[u], m = p[0],
|
|
1833
|
-
m.page.x +=
|
|
1890
|
+
var p = c[u], m = p[0], k = p[1];
|
|
1891
|
+
m.page.x += k.x, m.page.y += k.y, m.client.x += k.x, m.client.y += k.y;
|
|
1834
1892
|
}
|
|
1835
|
-
var w = this.result.rectDelta,
|
|
1836
|
-
|
|
1893
|
+
var w = this.result.rectDelta, C = e.rect || n.rect;
|
|
1894
|
+
C.left += w.left, C.right += w.right, C.top += w.top, C.bottom += w.bottom, C.width = C.right - C.left, C.height = C.bottom - C.top;
|
|
1837
1895
|
} }, { key: "setAndApply", value: function(e) {
|
|
1838
1896
|
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 }));
|
|
1839
1897
|
if (this.result = a, !a.changed && (!i || i < this.states.length) && n.interacting()) return !1;
|
|
@@ -1857,7 +1915,7 @@ function Vo() {
|
|
|
1857
1915
|
} }, { key: "stop", value: function(e) {
|
|
1858
1916
|
var n = e.interaction;
|
|
1859
1917
|
if (this.states && this.states.length) {
|
|
1860
|
-
var r =
|
|
1918
|
+
var r = I({ states: this.states, interactable: n.interactable, element: n.element, rect: null }, e);
|
|
1861
1919
|
this.fillArg(r);
|
|
1862
1920
|
for (var o = 0, i = this.states; o < i.length; o++) {
|
|
1863
1921
|
var a = i[o];
|
|
@@ -1876,8 +1934,8 @@ function Vo() {
|
|
|
1876
1934
|
var n = e.interaction, r = n.coords, o = n.rect, i = n.modification;
|
|
1877
1935
|
if (i.result) {
|
|
1878
1936
|
for (var a = i.startDelta, s = i.result, l = s.delta, u = s.rectDelta, c = 0, p = [[r.start, a], [r.cur, l]]; c < p.length; c++) {
|
|
1879
|
-
var m = p[c],
|
|
1880
|
-
|
|
1937
|
+
var m = p[c], k = m[0], w = m[1];
|
|
1938
|
+
k.page.x -= w.x, k.page.y -= w.y, k.client.x -= w.x, k.client.y -= w.y;
|
|
1881
1939
|
}
|
|
1882
1940
|
o.left -= u.left, o.right -= u.right, o.top -= u.top, o.bottom -= u.bottom;
|
|
1883
1941
|
}
|
|
@@ -1886,7 +1944,7 @@ function Vo() {
|
|
|
1886
1944
|
} }, { key: "copyFrom", value: function(e) {
|
|
1887
1945
|
this.startOffset = e.startOffset, this.startDelta = e.startDelta, this.startEdges = e.startEdges, this.edges = e.edges, this.states = e.states.map((function(n) {
|
|
1888
1946
|
return De(n);
|
|
1889
|
-
})), this.result = st(
|
|
1947
|
+
})), this.result = st(I({}, e.result.coords), I({}, e.result.rect));
|
|
1890
1948
|
} }, { key: "destroy", value: function() {
|
|
1891
1949
|
for (var e in this) this[e] = null;
|
|
1892
1950
|
} }]), t;
|
|
@@ -1932,15 +1990,15 @@ function Vo() {
|
|
|
1932
1990
|
}, "interactions:stop": function(t) {
|
|
1933
1991
|
return t.interaction.modification.stop(t);
|
|
1934
1992
|
} } }, cn = or, un = { base: { preventDefault: "auto", deltaSource: "page" }, perAction: { enabled: !1, origin: { x: 0, y: 0 } }, actions: {} }, It = (function(t) {
|
|
1935
|
-
|
|
1936
|
-
var e =
|
|
1993
|
+
A(n, t);
|
|
1994
|
+
var e = P(n);
|
|
1937
1995
|
function n(r, o, i, a, s, l, u) {
|
|
1938
1996
|
var c;
|
|
1939
|
-
|
|
1940
|
-
var p = r.interactable, m = (p && p.options || un).deltaSource,
|
|
1941
|
-
return c.page =
|
|
1997
|
+
y(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;
|
|
1998
|
+
var p = r.interactable, m = (p && p.options || un).deltaSource, k = Le(p, s, i), w = a === "start", C = a === "end", _ = w ? X(c) : r.prevEvent, T = w ? r.coords.start : C ? { page: _.page, client: _.client, timeStamp: r.coords.cur.timeStamp } : r.coords.cur;
|
|
1999
|
+
return c.page = I({}, T.page), c.client = I({}, T.client), c.rect = I({}, r.rect), c.timeStamp = T.timeStamp, C || (c.page.x -= k.x, c.page.y -= k.y, c.client.x -= k.x, c.client.y -= k.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 = p, c.t0 = w ? r.pointers[r.pointers.length - 1].downTime : _.t0, c.x0 = r.coords.start.page.x - k.x, c.y0 = r.coords.start.page.y - k.y, c.clientX0 = r.coords.start.client.x - k.x, c.clientY0 = r.coords.start.client.y - k.y, c.delta = w || C ? { x: 0, y: 0 } : { x: c[m].x - _[m].x, y: c[m].y - _[m].y }, c.dt = r.coords.delta.timeStamp, c.duration = c.timeStamp - c.t0, c.velocity = I({}, r.coords.velocity[m]), c.speed = je(c.velocity.x, c.velocity.y), c.swipe = C || a === "inertiastart" ? c.getSwipe() : null, c;
|
|
1942
2000
|
}
|
|
1943
|
-
return
|
|
2001
|
+
return E(n, [{ key: "getSwipe", value: function() {
|
|
1944
2002
|
var r = this._interaction;
|
|
1945
2003
|
if (r.prevEvent.speed < 600 || this.timeStamp - r.prevEvent.timeStamp > 150) return null;
|
|
1946
2004
|
var o = 180 * Math.atan2(r.prevEvent.velocityY, r.prevEvent.velocityX) / Math.PI;
|
|
@@ -1987,8 +2045,8 @@ function Vo() {
|
|
|
1987
2045
|
}, set: function(t) {
|
|
1988
2046
|
this.velocity.y = t;
|
|
1989
2047
|
} } });
|
|
1990
|
-
var ir =
|
|
1991
|
-
|
|
2048
|
+
var ir = E((function t(e, n, r, o, i) {
|
|
2049
|
+
y(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;
|
|
1992
2050
|
})), ar = (function(t) {
|
|
1993
2051
|
return t.interactable = "", t.element = "", t.prepared = "", t.pointerIsDown = "", t.pointerWasMoved = "", t._proxy = "", t;
|
|
1994
2052
|
})({}), dn = (function(t) {
|
|
@@ -1996,7 +2054,7 @@ function Vo() {
|
|
|
1996
2054
|
})({}), sr = 0, lr = (function() {
|
|
1997
2055
|
function t(e) {
|
|
1998
2056
|
var n = this, r = e.pointerType, o = e.scopeFire;
|
|
1999
|
-
|
|
2057
|
+
y(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) {
|
|
2000
2058
|
this.move(c);
|
|
2001
2059
|
}), "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;
|
|
2002
2060
|
var i = this;
|
|
@@ -2015,13 +2073,13 @@ function Vo() {
|
|
|
2015
2073
|
for (var u in dn) l(u);
|
|
2016
2074
|
this._scopeFire("interactions:new", { interaction: this });
|
|
2017
2075
|
}
|
|
2018
|
-
return
|
|
2076
|
+
return E(t, [{ key: "pointerMoveTolerance", get: function() {
|
|
2019
2077
|
return 1;
|
|
2020
2078
|
} }, { key: "pointerDown", value: function(e, n, r) {
|
|
2021
2079
|
var o = this.updatePointer(e, n, r, !0), i = this.pointers[o];
|
|
2022
2080
|
this._scopeFire("interactions:down", { pointer: e, event: n, eventTarget: r, pointerIndex: o, pointerInfo: i, type: "down", interaction: this });
|
|
2023
2081
|
} }, { key: "start", value: function(e, n, r) {
|
|
2024
|
-
return !(this.interacting() || !this.pointerIsDown || this.pointers.length < (e.name === "gesture" ? 2 : 1) || !n.options[e.name].enabled) && (St(this.prepared, e), this.interactable = n, this.element = r, this.rect = n.getRect(r), this.edges = this.prepared.edges ?
|
|
2082
|
+
return !(this.interacting() || !this.pointerIsDown || this.pointers.length < (e.name === "gesture" ? 2 : 1) || !n.options[e.name].enabled) && (St(this.prepared, e), this.interactable = n, this.element = r, this.rect = n.getRect(r), this.edges = this.prepared.edges ? I({}, this.prepared.edges) : { left: !0, right: !0, top: !0, bottom: !0 }, this._stopped = !1, this._interacting = this._doPhase({ interaction: this, event: this.downEvent, phase: "start" }) && !this._stopped, this._interacting);
|
|
2025
2083
|
} }, { key: "pointerMove", value: function(e, n, r) {
|
|
2026
2084
|
this.simulation || this.modification && this.modification.endResult || this.updatePointer(e, n, r, !1);
|
|
2027
2085
|
var o, i, a = this.coords.cur.page.x === this.coords.prev.page.x && this.coords.cur.page.y === this.coords.prev.page.y && this.coords.cur.client.x === this.coords.prev.client.x && this.coords.cur.client.y === this.coords.prev.client.y;
|
|
@@ -2029,7 +2087,7 @@ function Vo() {
|
|
|
2029
2087
|
var s, l, u, c = this.getPointerIndex(e), p = { pointer: e, pointerIndex: c, pointerInfo: this.pointers[c], event: n, type: "move", eventTarget: r, dx: o, dy: i, duplicate: a, interaction: this };
|
|
2030
2088
|
a || (s = this.coords.velocity, l = this.coords.delta, u = Math.max(l.timeStamp / 1e3, 1e-3), s.page.x = l.page.x / u, s.page.y = l.page.y / u, s.client.x = l.client.x / u, s.client.y = l.client.y / u, s.timeStamp = u), this._scopeFire("interactions:move", p), a || this.simulation || (this.interacting() && (p.type = null, this.move(p)), this.pointerWasMoved && nt(this.coords.prev, this.coords.cur));
|
|
2031
2089
|
} }, { key: "move", value: function(e) {
|
|
2032
|
-
e && e.event || Ht(this.coords.delta), (e =
|
|
2090
|
+
e && e.event || Ht(this.coords.delta), (e = I({ pointer: this._latestPointer.pointer, event: this._latestPointer.event, eventTarget: this._latestPointer.eventTarget, interaction: this }, e || {})).phase = "move", this._doPhase(e);
|
|
2033
2091
|
} }, { key: "pointerUp", value: function(e, n, r, o) {
|
|
2034
2092
|
var i = this.getPointerIndex(e);
|
|
2035
2093
|
i === -1 && (i = this.updatePointer(e, n, r, !1));
|
|
@@ -2117,9 +2175,9 @@ function Vo() {
|
|
|
2117
2175
|
e.offset.total.x = 0, e.offset.total.y = 0, e.offset.pending.x = 0, e.offset.pending.y = 0;
|
|
2118
2176
|
} } }, hn = ur, dr = (function() {
|
|
2119
2177
|
function t(e) {
|
|
2120
|
-
|
|
2178
|
+
y(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;
|
|
2121
2179
|
}
|
|
2122
|
-
return
|
|
2180
|
+
return E(t, [{ key: "start", value: function(e) {
|
|
2123
2181
|
var n = this.interaction, r = lt(n);
|
|
2124
2182
|
if (!r || !r.enabled) return !1;
|
|
2125
2183
|
var o = n.coords.velocity.client, i = je(o.x, o.y), a = this.modification || (this.modification = new Rt(n));
|
|
@@ -2149,8 +2207,8 @@ function Vo() {
|
|
|
2149
2207
|
} }, { key: "inertiaTick", value: function() {
|
|
2150
2208
|
var e, n, r, o, i, a, s, l = this, u = this.interaction, c = lt(u).resistance, p = (u._now() - this.t0) / 1e3;
|
|
2151
2209
|
if (p < this.te) {
|
|
2152
|
-
var m,
|
|
2153
|
-
this.isModified ? (e = 0, n = 0, r = this.targetOffset.x, o = this.targetOffset.y, i = this.modifiedOffset.x, a = this.modifiedOffset.y, m = { x: vn(s =
|
|
2210
|
+
var m, k = 1 - (Math.exp(-c * p) - this.lambda_v0) / this.one_ve_v0;
|
|
2211
|
+
this.isModified ? (e = 0, n = 0, r = this.targetOffset.x, o = this.targetOffset.y, i = this.modifiedOffset.x, a = this.modifiedOffset.y, m = { x: vn(s = k, e, r, i), y: vn(s, n, o, a) }) : m = { x: this.targetOffset.x * k, y: this.targetOffset.y * k };
|
|
2154
2212
|
var w = { x: m.x - this.currentOffset.x, y: m.y - this.currentOffset.y };
|
|
2155
2213
|
this.currentOffset.x += w.x, this.currentOffset.y += w.y, u.offsetBy(w), u.move(), this.onNextFrame((function() {
|
|
2156
2214
|
return l.inertiaTick();
|
|
@@ -2225,9 +2283,9 @@ function Vo() {
|
|
|
2225
2283
|
}
|
|
2226
2284
|
var yn = (function() {
|
|
2227
2285
|
function t(e) {
|
|
2228
|
-
|
|
2286
|
+
y(this, t), this.options = void 0, this.types = {}, this.propagationStopped = !1, this.immediatePropagationStopped = !1, this.global = void 0, this.options = I({}, e || {});
|
|
2229
2287
|
}
|
|
2230
|
-
return
|
|
2288
|
+
return E(t, [{ key: "fire", value: function(e) {
|
|
2231
2289
|
var n, r = this.global;
|
|
2232
2290
|
(n = this.types[e.type]) && gn(e, n), !e.propagationStopped && r && (n = r[e.type]) && gn(e, n);
|
|
2233
2291
|
} }, { key: "on", value: function(e, n) {
|
|
@@ -2247,9 +2305,9 @@ function Vo() {
|
|
|
2247
2305
|
} }]), t;
|
|
2248
2306
|
})(), hr = (function() {
|
|
2249
2307
|
function t(e) {
|
|
2250
|
-
|
|
2308
|
+
y(this, t), this.currentTarget = void 0, this.originalEvent = void 0, this.type = void 0, this.originalEvent = e, tt(this, e);
|
|
2251
2309
|
}
|
|
2252
|
-
return
|
|
2310
|
+
return E(t, [{ key: "preventOriginalDefault", value: function() {
|
|
2253
2311
|
this.originalEvent.preventDefault();
|
|
2254
2312
|
} }, { key: "stopPropagation", value: function() {
|
|
2255
2313
|
this.originalEvent.stopPropagation();
|
|
@@ -2264,29 +2322,29 @@ function Vo() {
|
|
|
2264
2322
|
return t === e || (typeof t == "boolean" ? !!e.capture === t && !e.passive : !!t.capture == !!e.capture && !!t.passive == !!e.passive);
|
|
2265
2323
|
}
|
|
2266
2324
|
var vr = { id: "events", install: function(t) {
|
|
2267
|
-
var e, n = [], r = {}, o = [], i = { add: a, remove: s, addDelegate: function(c, p, m,
|
|
2268
|
-
var
|
|
2325
|
+
var e, n = [], r = {}, o = [], i = { add: a, remove: s, addDelegate: function(c, p, m, k, w) {
|
|
2326
|
+
var C = Ye(w);
|
|
2269
2327
|
if (!r[m]) {
|
|
2270
2328
|
r[m] = [];
|
|
2271
|
-
for (var
|
|
2272
|
-
var
|
|
2273
|
-
a(
|
|
2329
|
+
for (var _ = 0; _ < o.length; _++) {
|
|
2330
|
+
var T = o[_];
|
|
2331
|
+
a(T, m, l), a(T, m, u, !0);
|
|
2274
2332
|
}
|
|
2275
2333
|
}
|
|
2276
|
-
var O = r[m],
|
|
2334
|
+
var O = r[m], H = Be(O, (function(W) {
|
|
2277
2335
|
return W.selector === c && W.context === p;
|
|
2278
2336
|
}));
|
|
2279
|
-
|
|
2280
|
-
}, removeDelegate: function(c, p, m,
|
|
2281
|
-
var
|
|
2282
|
-
if (
|
|
2283
|
-
for (
|
|
2284
|
-
var
|
|
2285
|
-
if (
|
|
2286
|
-
for (var W =
|
|
2287
|
-
var
|
|
2288
|
-
if (
|
|
2289
|
-
W.splice(N, 1), W.length || (
|
|
2337
|
+
H || (H = { selector: c, context: p, listeners: [] }, O.push(H)), H.listeners.push({ func: k, options: C });
|
|
2338
|
+
}, removeDelegate: function(c, p, m, k, w) {
|
|
2339
|
+
var C, _ = Ye(w), T = r[m], O = !1;
|
|
2340
|
+
if (T)
|
|
2341
|
+
for (C = T.length - 1; C >= 0; C--) {
|
|
2342
|
+
var H = T[C];
|
|
2343
|
+
if (H.selector === c && H.context === p) {
|
|
2344
|
+
for (var W = H.listeners, N = W.length - 1; N >= 0; N--) {
|
|
2345
|
+
var V = W[N];
|
|
2346
|
+
if (V.func === k && ct(V.options, _)) {
|
|
2347
|
+
W.splice(N, 1), W.length || (T.splice(C, 1), s(p, m, l), s(p, m, u, !0)), O = !0;
|
|
2290
2348
|
break;
|
|
2291
2349
|
}
|
|
2292
2350
|
}
|
|
@@ -2294,57 +2352,57 @@ function Vo() {
|
|
|
2294
2352
|
}
|
|
2295
2353
|
}
|
|
2296
2354
|
}, delegateListener: l, delegateUseCapture: u, delegatedEvents: r, documents: o, targets: n, supportsOptions: !1, supportsPassive: !1 };
|
|
2297
|
-
function a(c, p, m,
|
|
2355
|
+
function a(c, p, m, k) {
|
|
2298
2356
|
if (c.addEventListener) {
|
|
2299
|
-
var w = Ye(
|
|
2300
|
-
return
|
|
2357
|
+
var w = Ye(k), C = Be(n, (function(_) {
|
|
2358
|
+
return _.eventTarget === c;
|
|
2301
2359
|
}));
|
|
2302
|
-
|
|
2303
|
-
return
|
|
2304
|
-
})) || (c.addEventListener(p, m, i.supportsOptions ? w : w.capture),
|
|
2360
|
+
C || (C = { eventTarget: c, events: {} }, n.push(C)), C.events[p] || (C.events[p] = []), Be(C.events[p], (function(_) {
|
|
2361
|
+
return _.func === m && ct(_.options, w);
|
|
2362
|
+
})) || (c.addEventListener(p, m, i.supportsOptions ? w : w.capture), C.events[p].push({ func: m, options: w }));
|
|
2305
2363
|
}
|
|
2306
2364
|
}
|
|
2307
|
-
function s(c, p, m,
|
|
2365
|
+
function s(c, p, m, k) {
|
|
2308
2366
|
if (c.addEventListener && c.removeEventListener) {
|
|
2309
|
-
var w = He(n, (function(
|
|
2310
|
-
return
|
|
2311
|
-
})),
|
|
2312
|
-
if (
|
|
2313
|
-
var
|
|
2314
|
-
if (
|
|
2367
|
+
var w = He(n, (function(me) {
|
|
2368
|
+
return me.eventTarget === c;
|
|
2369
|
+
})), C = n[w];
|
|
2370
|
+
if (C && C.events) if (p !== "all") {
|
|
2371
|
+
var _ = !1, T = C.events[p];
|
|
2372
|
+
if (T) {
|
|
2315
2373
|
if (m === "all") {
|
|
2316
|
-
for (var O =
|
|
2317
|
-
var
|
|
2318
|
-
s(c, p,
|
|
2374
|
+
for (var O = T.length - 1; O >= 0; O--) {
|
|
2375
|
+
var H = T[O];
|
|
2376
|
+
s(c, p, H.func, H.options);
|
|
2319
2377
|
}
|
|
2320
2378
|
return;
|
|
2321
2379
|
}
|
|
2322
|
-
for (var W = Ye(
|
|
2323
|
-
var
|
|
2324
|
-
if (
|
|
2325
|
-
c.removeEventListener(p, m, i.supportsOptions ? W : W.capture),
|
|
2380
|
+
for (var W = Ye(k), N = 0; N < T.length; N++) {
|
|
2381
|
+
var V = T[N];
|
|
2382
|
+
if (V.func === m && ct(V.options, W)) {
|
|
2383
|
+
c.removeEventListener(p, m, i.supportsOptions ? W : W.capture), T.splice(N, 1), T.length === 0 && (delete C.events[p], _ = !0);
|
|
2326
2384
|
break;
|
|
2327
2385
|
}
|
|
2328
2386
|
}
|
|
2329
2387
|
}
|
|
2330
|
-
|
|
2331
|
-
} else for (p in
|
|
2388
|
+
_ && !Object.keys(C.events).length && n.splice(w, 1);
|
|
2389
|
+
} else for (p in C.events) C.events.hasOwnProperty(p) && s(c, p, "all");
|
|
2332
2390
|
}
|
|
2333
2391
|
}
|
|
2334
2392
|
function l(c, p) {
|
|
2335
|
-
for (var m = Ye(p),
|
|
2336
|
-
for (var
|
|
2337
|
-
var O = w[
|
|
2338
|
-
if (fe(
|
|
2393
|
+
for (var m = Ye(p), k = new hr(c), w = r[c.type], C = $t(c)[0], _ = C; g.element(_); ) {
|
|
2394
|
+
for (var T = 0; T < w.length; T++) {
|
|
2395
|
+
var O = w[T], H = O.selector, W = O.context;
|
|
2396
|
+
if (fe(_, H) && se(W, C) && se(W, _)) {
|
|
2339
2397
|
var N = O.listeners;
|
|
2340
|
-
|
|
2341
|
-
for (var
|
|
2342
|
-
var
|
|
2343
|
-
ct(
|
|
2398
|
+
k.currentTarget = _;
|
|
2399
|
+
for (var V = 0; V < N.length; V++) {
|
|
2400
|
+
var me = N[V];
|
|
2401
|
+
ct(me.options, m) && me.func(k);
|
|
2344
2402
|
}
|
|
2345
2403
|
}
|
|
2346
2404
|
}
|
|
2347
|
-
|
|
2405
|
+
_ = pe(_);
|
|
2348
2406
|
}
|
|
2349
2407
|
}
|
|
2350
2408
|
function u(c) {
|
|
@@ -2418,23 +2476,23 @@ function Vo() {
|
|
|
2418
2476
|
if (/^touch/.test(n.type)) {
|
|
2419
2477
|
e.prevTouchTime = e.now();
|
|
2420
2478
|
for (var u = 0, c = n.changedTouches; u < c.length; u++) {
|
|
2421
|
-
var p = c[u], m = { pointer: p, pointerId: Fe(p), pointerType: o, eventType: n.type, eventTarget: a, curEventTarget: s, scope: e },
|
|
2422
|
-
l.push([m.pointer, m.eventTarget, m.curEventTarget,
|
|
2479
|
+
var p = c[u], m = { pointer: p, pointerId: Fe(p), pointerType: o, eventType: n.type, eventTarget: a, curEventTarget: s, scope: e }, k = wn(m);
|
|
2480
|
+
l.push([m.pointer, m.eventTarget, m.curEventTarget, k]);
|
|
2423
2481
|
}
|
|
2424
2482
|
} else {
|
|
2425
2483
|
var w = !1;
|
|
2426
|
-
if (!
|
|
2427
|
-
for (var
|
|
2484
|
+
if (!Q.supportsPointerEvent && /mouse/.test(n.type)) {
|
|
2485
|
+
for (var C = 0; C < r.length && !w; C++) w = r[C].pointerType !== "mouse" && r[C].pointerIsDown;
|
|
2428
2486
|
w = w || e.now() - e.prevTouchTime < 500 || n.timeStamp === 0;
|
|
2429
2487
|
}
|
|
2430
2488
|
if (!w) {
|
|
2431
|
-
var
|
|
2432
|
-
l.push([
|
|
2489
|
+
var _ = { pointer: n, pointerId: Fe(n), pointerType: o, eventType: n.type, curEventTarget: s, eventTarget: a, scope: e }, T = wn(_);
|
|
2490
|
+
l.push([_.pointer, _.eventTarget, _.curEventTarget, T]);
|
|
2433
2491
|
}
|
|
2434
2492
|
}
|
|
2435
2493
|
for (var O = 0; O < l.length; O++) {
|
|
2436
|
-
var
|
|
2437
|
-
|
|
2494
|
+
var H = l[O], W = H[0], N = H[1], V = H[2];
|
|
2495
|
+
H[3][t](W, n, N, V);
|
|
2438
2496
|
}
|
|
2439
2497
|
};
|
|
2440
2498
|
}
|
|
@@ -2455,28 +2513,28 @@ function Vo() {
|
|
|
2455
2513
|
var r = Pt[n];
|
|
2456
2514
|
e[r] = xn(r, t);
|
|
2457
2515
|
}
|
|
2458
|
-
var o, i =
|
|
2516
|
+
var o, i = Q.pEventTypes;
|
|
2459
2517
|
function a() {
|
|
2460
2518
|
for (var s = 0, l = t.interactions.list; s < l.length; s++) {
|
|
2461
2519
|
var u = l[s];
|
|
2462
2520
|
if (u.pointerIsDown && u.pointerType === "touch" && !u._interacting) for (var c = function() {
|
|
2463
|
-
var
|
|
2521
|
+
var k = m[p];
|
|
2464
2522
|
t.documents.some((function(w) {
|
|
2465
|
-
return se(w.doc,
|
|
2466
|
-
})) || u.removePointer(
|
|
2523
|
+
return se(w.doc, k.downTarget);
|
|
2524
|
+
})) || u.removePointer(k.pointer, k.event);
|
|
2467
2525
|
}, p = 0, m = u.pointers; p < m.length; p++) c();
|
|
2468
2526
|
}
|
|
2469
2527
|
}
|
|
2470
|
-
(o =
|
|
2528
|
+
(o = B.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) {
|
|
2471
2529
|
for (var l = 0, u = t.interactions.list; l < u.length; l++)
|
|
2472
2530
|
u[l].documentBlur(s);
|
|
2473
2531
|
} }), t.prevTouchTime = 0, t.Interaction = (function(s) {
|
|
2474
|
-
|
|
2475
|
-
var l =
|
|
2532
|
+
A(u, s);
|
|
2533
|
+
var l = P(u);
|
|
2476
2534
|
function u() {
|
|
2477
|
-
return
|
|
2535
|
+
return y(this, u), l.apply(this, arguments);
|
|
2478
2536
|
}
|
|
2479
|
-
return
|
|
2537
|
+
return E(u, [{ key: "pointerMoveTolerance", get: function() {
|
|
2480
2538
|
return t.interactions.pointerMoveTolerance;
|
|
2481
2539
|
}, set: function(c) {
|
|
2482
2540
|
t.interactions.pointerMoveTolerance = c;
|
|
@@ -2503,9 +2561,9 @@ function Vo() {
|
|
|
2503
2561
|
return t[t.On = 0] = "On", t[t.Off = 1] = "Off", t;
|
|
2504
2562
|
})(Me || {}), br = (function() {
|
|
2505
2563
|
function t(e, n, r, o) {
|
|
2506
|
-
|
|
2564
|
+
y(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 = Z(Ee(e) ? this._context : e), this._doc = this._win.document, this._scopeEvents = o, this.set(n);
|
|
2507
2565
|
}
|
|
2508
|
-
return
|
|
2566
|
+
return E(t, [{ key: "_defaults", get: function() {
|
|
2509
2567
|
return { base: {}, perAction: {}, actions: {} };
|
|
2510
2568
|
} }, { key: "setOnEvents", value: function(e, n) {
|
|
2511
2569
|
return g.func(n.onstart) && this.on("".concat(e, "start"), n.onstart), g.func(n.onmove) && this.on("".concat(e, "move"), n.onmove), g.func(n.onend) && this.on("".concat(e, "end"), n.onend), g.func(n.oninertiastart) && this.on("".concat(e, "inertiastart"), n.oninertiastart), this;
|
|
@@ -2518,14 +2576,14 @@ function Vo() {
|
|
|
2518
2576
|
var r = this._defaults;
|
|
2519
2577
|
for (var o in n) {
|
|
2520
2578
|
var i = o, a = this.options[e], s = n[i];
|
|
2521
|
-
i === "listeners" && this.updatePerActionListeners(e, a.listeners, s), g.array(s) ? a[i] = Ut(s) : g.plainObject(s) ? (a[i] =
|
|
2579
|
+
i === "listeners" && this.updatePerActionListeners(e, a.listeners, s), g.array(s) ? a[i] = Ut(s) : g.plainObject(s) ? (a[i] = I(a[i] || {}, De(s)), g.object(r.perAction[i]) && "enabled" in r.perAction[i] && (a[i].enabled = s.enabled !== !1)) : g.bool(s) && g.object(r.perAction[i]) ? a[i].enabled = s : a[i] = s;
|
|
2522
2580
|
}
|
|
2523
2581
|
} }, { key: "getRect", value: function(e) {
|
|
2524
2582
|
return e = e || (g.element(this.target) ? this.target : null), g.string(this.target) && (e = e || this._context.querySelector(this.target)), we(e);
|
|
2525
2583
|
} }, { key: "rectChecker", value: function(e) {
|
|
2526
2584
|
var n = this;
|
|
2527
2585
|
return g.func(e) ? (this.getRect = function(r) {
|
|
2528
|
-
var o =
|
|
2586
|
+
var o = I({}, e.apply(n, r));
|
|
2529
2587
|
return "width" in o || (o.width = o.right - o.left, o.height = o.bottom - o.top), o;
|
|
2530
2588
|
}, this) : e === null ? (delete this.getRect, this) : this.getRect;
|
|
2531
2589
|
} }, { key: "_backCompatOption", value: function(e, n) {
|
|
@@ -2557,7 +2615,7 @@ function Vo() {
|
|
|
2557
2615
|
g.object(n) && !g.array(n) && (o = r, r = null);
|
|
2558
2616
|
var a = Ie(n, r, i);
|
|
2559
2617
|
for (var s in a) {
|
|
2560
|
-
s === "wheel" && (s =
|
|
2618
|
+
s === "wheel" && (s = Q.wheelEvent);
|
|
2561
2619
|
for (var l = 0, u = a[s]; l < u.length; l++) {
|
|
2562
2620
|
var c = u[l];
|
|
2563
2621
|
at(s, this._actions) ? this.events[e === Me.On ? "on" : "off"](s, c) : g.string(this.target) ? this._scopeEvents[e === Me.On ? "addDelegate" : "removeDelegate"](this.target, this._context, s, c, o) : this._scopeEvents[e === Me.On ? "add" : "remove"](this.target, s, c, o);
|
|
@@ -2572,7 +2630,7 @@ function Vo() {
|
|
|
2572
2630
|
var n = this._defaults;
|
|
2573
2631
|
for (var r in g.object(e) || (e = {}), this.options = De(n.base), this._actions.methodDict) {
|
|
2574
2632
|
var o = r, i = this._actions.methodDict[o];
|
|
2575
|
-
this.options[o] = {}, this.setPerAction(o,
|
|
2633
|
+
this.options[o] = {}, this.setPerAction(o, I(I({}, n.perAction), n.actions[o])), this[i](e[o]);
|
|
2576
2634
|
}
|
|
2577
2635
|
for (var a in e) a !== "getRect" ? g.func(this[a]) && this[a](e[a]) : this.rectChecker(e.getRect);
|
|
2578
2636
|
return this;
|
|
@@ -2587,15 +2645,15 @@ function Vo() {
|
|
|
2587
2645
|
})(), xr = (function() {
|
|
2588
2646
|
function t(e) {
|
|
2589
2647
|
var n = this;
|
|
2590
|
-
|
|
2648
|
+
y(this, t), this.list = [], this.selectorMap = {}, this.scope = void 0, this.scope = e, e.addListeners({ "interactable:unset": function(r) {
|
|
2591
2649
|
var o = r.interactable, i = o.target, a = g.string(i) ? n.selectorMap[i] : i[n.scope.id], s = He(a, (function(l) {
|
|
2592
2650
|
return l === o;
|
|
2593
2651
|
}));
|
|
2594
2652
|
a.splice(s, 1);
|
|
2595
2653
|
} });
|
|
2596
2654
|
}
|
|
2597
|
-
return
|
|
2598
|
-
n =
|
|
2655
|
+
return E(t, [{ key: "new", value: function(e, n) {
|
|
2656
|
+
n = I(n || {}, { actions: this.scope.actions });
|
|
2599
2657
|
var r = new this.scope.Interactable(e, n, this.scope.document, this.scope.events);
|
|
2600
2658
|
return this.scope.addDocument(r._doc), this.list.push(r), g.string(e) ? (this.selectorMap[e] || (this.selectorMap[e] = []), this.selectorMap[e].push(r)) : (r.target[this.scope.id] || Object.defineProperty(e, this.scope.id, { value: [], configurable: !0 }), e[this.scope.id].push(r)), this.scope.fire("interactable:new", { target: e, options: n, interactable: r, win: this.scope._win }), r;
|
|
2601
2659
|
} }, { key: "getExisting", value: function(e, n) {
|
|
@@ -2612,7 +2670,7 @@ function Vo() {
|
|
|
2612
2670
|
})(), wr = (function() {
|
|
2613
2671
|
function t() {
|
|
2614
2672
|
var e = this;
|
|
2615
|
-
|
|
2673
|
+
y(this, t), this.id = "__interact_scope_".concat(Math.floor(100 * Math.random())), this.isInitialized = !1, this.listenerMaps = [], this.browser = Q, this.defaults = De(un), this.Eventable = yn, this.actions = { map: {}, phases: { start: !0, move: !0, end: !0 }, methodDict: {}, phaselessTypes: {} }, this.interactStatic = (function(r) {
|
|
2616
2674
|
var o = function i(a, s) {
|
|
2617
2675
|
var l = r.interactables.getExisting(a, s);
|
|
2618
2676
|
return l || ((l = r.interactables.new(a, s)).events.global = i.globalEvents), l;
|
|
@@ -2651,9 +2709,9 @@ function Vo() {
|
|
|
2651
2709
|
}), "The interact.off() method is being deprecated"), o.debug = function() {
|
|
2652
2710
|
return this.scope;
|
|
2653
2711
|
}, o.supportsTouch = function() {
|
|
2654
|
-
return
|
|
2712
|
+
return Q.supportsTouch;
|
|
2655
2713
|
}, o.supportsPointerEvent = function() {
|
|
2656
|
-
return
|
|
2714
|
+
return Q.supportsPointerEvent;
|
|
2657
2715
|
}, o.stop = function() {
|
|
2658
2716
|
for (var i = 0, a = this.scope.interactions.list; i < a.length; i++) a[i].stop();
|
|
2659
2717
|
return this;
|
|
@@ -2669,23 +2727,23 @@ function Vo() {
|
|
|
2669
2727
|
};
|
|
2670
2728
|
var n = this;
|
|
2671
2729
|
this.Interactable = (function(r) {
|
|
2672
|
-
|
|
2673
|
-
var o =
|
|
2730
|
+
A(i, r);
|
|
2731
|
+
var o = P(i);
|
|
2674
2732
|
function i() {
|
|
2675
|
-
return
|
|
2733
|
+
return y(this, i), o.apply(this, arguments);
|
|
2676
2734
|
}
|
|
2677
|
-
return
|
|
2735
|
+
return E(i, [{ key: "_defaults", get: function() {
|
|
2678
2736
|
return n.defaults;
|
|
2679
2737
|
} }, { key: "set", value: function(a) {
|
|
2680
|
-
return
|
|
2738
|
+
return te(R(i.prototype), "set", this).call(this, a), n.fire("interactable:set", { options: a, interactable: this }), this;
|
|
2681
2739
|
} }, { key: "unset", value: function() {
|
|
2682
|
-
|
|
2740
|
+
te(R(i.prototype), "unset", this).call(this);
|
|
2683
2741
|
var a = n.interactables.list.indexOf(this);
|
|
2684
2742
|
a < 0 || (n.interactables.list.splice(a, 1), n.fire("interactable:unset", { interactable: this }));
|
|
2685
2743
|
} }]), i;
|
|
2686
2744
|
})(br);
|
|
2687
2745
|
}
|
|
2688
|
-
return
|
|
2746
|
+
return E(t, [{ key: "addListeners", value: function(e, n) {
|
|
2689
2747
|
this.listenerMaps.push({ id: n, map: e });
|
|
2690
2748
|
} }, { key: "fire", value: function(e, n) {
|
|
2691
2749
|
for (var r = 0, o = this.listenerMaps; r < o.length; r++) {
|
|
@@ -2694,7 +2752,7 @@ function Vo() {
|
|
|
2694
2752
|
}
|
|
2695
2753
|
} }, { key: "init", value: function(e) {
|
|
2696
2754
|
return this.isInitialized ? this : (function(n, r) {
|
|
2697
|
-
return n.isInitialized = !0, g.window(r) &&
|
|
2755
|
+
return n.isInitialized = !0, g.window(r) && ne(r), B.init(r), Q.init(r), Te.init(r), n.window = r, n.document = r.document, n.usePlugin(yr), n.usePlugin(vr), n;
|
|
2698
2756
|
})(this, e);
|
|
2699
2757
|
} }, { key: "pluginIsInstalled", value: function(e) {
|
|
2700
2758
|
var n = e.id;
|
|
@@ -2714,10 +2772,10 @@ function Vo() {
|
|
|
2714
2772
|
return this;
|
|
2715
2773
|
} }, { key: "addDocument", value: function(e, n) {
|
|
2716
2774
|
if (this.getDocIndex(e) !== -1) return !1;
|
|
2717
|
-
var r =
|
|
2718
|
-
n = n ?
|
|
2775
|
+
var r = Z(e);
|
|
2776
|
+
n = n ? I({}, n) : {}, this.documents.push({ doc: e, options: n }), this.events.documents.push(e), e !== this.document && this.events.add(r, "unload", this.onWindowUnload), this.fire("scope:add-document", { doc: e, window: r, scope: this, options: n });
|
|
2719
2777
|
} }, { key: "removeDocument", value: function(e) {
|
|
2720
|
-
var n = this.getDocIndex(e), r =
|
|
2778
|
+
var n = this.getDocIndex(e), r = Z(e), o = this.documents[n].options;
|
|
2721
2779
|
this.events.remove(r, "unload", this.onWindowUnload), this.documents.splice(n, 1), this.events.documents.splice(n, 1), this.fire("scope:remove-document", { doc: e, window: r, scope: this, options: o });
|
|
2722
2780
|
} }, { key: "getDocIndex", value: function(e) {
|
|
2723
2781
|
for (var n = 0; n < this.documents.length; n++) if (this.documents[n].doc === e) return n;
|
|
@@ -2732,7 +2790,7 @@ function Vo() {
|
|
|
2732
2790
|
function En(t) {
|
|
2733
2791
|
return t && t.replace(/\/.*$/, "");
|
|
2734
2792
|
}
|
|
2735
|
-
var kn = new wr(),
|
|
2793
|
+
var kn = new wr(), ve = kn.interactStatic, Er = typeof globalThis < "u" ? globalThis : window;
|
|
2736
2794
|
kn.init(Er);
|
|
2737
2795
|
var kr = Object.freeze({ __proto__: null, edgeTarget: function() {
|
|
2738
2796
|
}, elements: function() {
|
|
@@ -2742,34 +2800,34 @@ function Vo() {
|
|
|
2742
2800
|
return o in t || i in t;
|
|
2743
2801
|
})), n = function(r, o) {
|
|
2744
2802
|
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 }, p = 0; p < e.length; p++) {
|
|
2745
|
-
var m = e[p],
|
|
2746
|
-
c[
|
|
2803
|
+
var m = e[p], k = m[0], w = m[1], C = Math.round((r - u.x) / t[k]), _ = Math.round((o - u.y) / t[w]);
|
|
2804
|
+
c[k] = Math.max(s.left, Math.min(s.right, C * t[k] + u.x)), c[w] = Math.max(s.top, Math.min(s.bottom, _ * t[w] + u.y));
|
|
2747
2805
|
}
|
|
2748
2806
|
return c;
|
|
2749
2807
|
};
|
|
2750
2808
|
return n.grid = t, n.coordFields = e, n;
|
|
2751
2809
|
} }), Cr = { id: "snappers", install: function(t) {
|
|
2752
2810
|
var e = t.interactStatic;
|
|
2753
|
-
e.snappers =
|
|
2811
|
+
e.snappers = I(e.snappers || {}, kr), e.createSnapGrid = e.snappers.grid;
|
|
2754
2812
|
} }, Sr = Cr, Tr = { start: function(t) {
|
|
2755
2813
|
var e = t.state, n = t.rect, r = t.edges, o = t.pageCoords, i = e.options, a = i.ratio, s = i.enabled, l = e.options, u = l.equalDelta, c = l.modifiers;
|
|
2756
|
-
a === "preserve" && (a = n.width / n.height), e.startCoords =
|
|
2814
|
+
a === "preserve" && (a = n.width / n.height), e.startCoords = I({}, o), e.startRect = I({}, n), e.ratio = a, e.equalDelta = u;
|
|
2757
2815
|
var p = e.linkedEdges = { top: r.top || r.left && !r.bottom, left: r.left || r.top && !r.right, bottom: r.bottom || r.right && !r.top, right: r.right || r.bottom && !r.left };
|
|
2758
2816
|
if (e.xIsPrimaryAxis = !(!r.left && !r.right), e.equalDelta) {
|
|
2759
2817
|
var m = (p.left ? 1 : -1) * (p.top ? 1 : -1);
|
|
2760
2818
|
e.edgeSign = { x: m, y: m };
|
|
2761
2819
|
} else e.edgeSign = { x: p.left ? -1 : 1, y: p.top ? -1 : 1 };
|
|
2762
|
-
if (s !== !1 &&
|
|
2763
|
-
var
|
|
2764
|
-
|
|
2820
|
+
if (s !== !1 && I(r, p), c != null && c.length) {
|
|
2821
|
+
var k = new Rt(t.interaction);
|
|
2822
|
+
k.copyFrom(t.interaction.modification), k.prepareStates(c), e.subModification = k, k.startAll(d({}, t));
|
|
2765
2823
|
}
|
|
2766
2824
|
}, set: function(t) {
|
|
2767
|
-
var e = t.state, n = t.rect, r = t.coords, o = e.linkedEdges, i =
|
|
2768
|
-
if (
|
|
2769
|
-
var s =
|
|
2825
|
+
var e = t.state, n = t.rect, r = t.coords, o = e.linkedEdges, i = I({}, r), a = e.equalDelta ? _r : Mr;
|
|
2826
|
+
if (I(t.edges, o), a(e, e.xIsPrimaryAxis, r, n), !e.subModification) return null;
|
|
2827
|
+
var s = I({}, n);
|
|
2770
2828
|
et(o, s, { x: r.x - i.x, y: r.y - i.y });
|
|
2771
2829
|
var l = e.subModification.setAll(d(d({}, t), {}, { rect: s, edges: o, pageCoords: r, prevCoords: r, prevRect: s })), u = l.delta;
|
|
2772
|
-
return l.changed && (a(e, Math.abs(u.x) > Math.abs(u.y), l.coords, l.rect),
|
|
2830
|
+
return l.changed && (a(e, Math.abs(u.x) > Math.abs(u.y), l.coords, l.rect), I(r, l.coords)), l.eventProps;
|
|
2773
2831
|
}, defaults: { ratio: "preserve", equalDelta: !1, modifiers: [], enabled: !1 } };
|
|
2774
2832
|
function _r(t, e, n) {
|
|
2775
2833
|
var r = t.startCoords, o = t.edgeSign;
|
|
@@ -2793,7 +2851,7 @@ function Vo() {
|
|
|
2793
2851
|
return g.func(t) ? ze(t, e.interactable, e.element, [n.x, n.y, e]) : ze(t, e.interactable, e.element);
|
|
2794
2852
|
}
|
|
2795
2853
|
var dt = { start: function(t) {
|
|
2796
|
-
var e = t.rect, n = t.startOffset, r = t.state, o = t.interaction, i = t.pageCoords, a = r.options, s = a.elementRect, l =
|
|
2854
|
+
var e = t.rect, n = t.startOffset, r = t.state, o = t.interaction, i = t.pageCoords, a = r.options, s = a.elementRect, l = I({ left: 0, top: 0, right: 0, bottom: 0 }, a.offset || {});
|
|
2797
2855
|
if (e && s) {
|
|
2798
2856
|
var u = Ae(a.restriction, o, i);
|
|
2799
2857
|
if (u) {
|
|
@@ -2807,7 +2865,7 @@ function Vo() {
|
|
|
2807
2865
|
var e = t.coords, n = t.interaction, r = t.state, o = r.options, i = r.offset, a = Ae(o.restriction, n, e);
|
|
2808
2866
|
if (a) {
|
|
2809
2867
|
var s = (function(l) {
|
|
2810
|
-
return !l || "left" in l && "top" in l || ((l =
|
|
2868
|
+
return !l || "left" in l && "top" in l || ((l = I({}, l)).left = l.x || 0, l.top = l.y || 0, l.right = l.right || l.left + l.width, l.bottom = l.bottom || l.top + l.height), l;
|
|
2811
2869
|
})(a);
|
|
2812
2870
|
e.x = Math.max(Math.min(s.right - i.right, e.x), s.left + i.left), e.y = Math.max(Math.min(s.bottom - i.bottom, e.y), s.top + i.top);
|
|
2813
2871
|
}
|
|
@@ -2825,10 +2883,10 @@ function Vo() {
|
|
|
2825
2883
|
}, set: function(t) {
|
|
2826
2884
|
var e = t.coords, n = t.edges, r = t.interaction, o = t.state, i = o.offset, a = o.options;
|
|
2827
2885
|
if (n) {
|
|
2828
|
-
var s =
|
|
2886
|
+
var s = I({}, e), l = Ae(a.inner, r, s) || {}, u = Ae(a.outer, r, s) || {};
|
|
2829
2887
|
_n(l, Sn), _n(u, Tn), n.top ? e.y = Math.min(Math.max(u.top + i.top, s.y), l.top + i.top) : n.bottom && (e.y = Math.max(Math.min(u.bottom + i.bottom, s.y), l.bottom + i.bottom)), n.left ? e.x = Math.min(Math.max(u.left + i.left, s.x), l.left + i.left) : n.right && (e.x = Math.max(Math.min(u.right + i.right, s.x), l.right + i.right));
|
|
2830
2888
|
}
|
|
2831
|
-
}, defaults: { inner: null, outer: null, offset: null, endOnly: !1, enabled: !1 } }, Or = _e($e, "restrictEdges"), Ar =
|
|
2889
|
+
}, defaults: { inner: null, outer: null, offset: null, endOnly: !1, enabled: !1 } }, Or = _e($e, "restrictEdges"), Ar = I({ get elementRect() {
|
|
2832
2890
|
return { top: 0, left: 0, bottom: 1, right: 1 };
|
|
2833
2891
|
}, set elementRect(t) {
|
|
2834
2892
|
} }, dt.defaults), Pr = _e({ start: dt.start, set: dt.set, defaults: Ar }, "restrictRect"), Dr = { width: -1 / 0, height: -1 / 0 }, Nr = { width: 1 / 0, height: 1 / 0 }, zr = _e({ start: function(t) {
|
|
@@ -2837,12 +2895,12 @@ function Vo() {
|
|
|
2837
2895
|
var e = t.interaction, n = t.state, r = t.rect, o = t.edges, i = n.options;
|
|
2838
2896
|
if (o) {
|
|
2839
2897
|
var a = vt(Ae(i.min, e, t.coords)) || Dr, s = vt(Ae(i.max, e, t.coords)) || Nr;
|
|
2840
|
-
n.options = { endOnly: i.endOnly, inner:
|
|
2898
|
+
n.options = { endOnly: i.endOnly, inner: I({}, $e.noInner), outer: I({}, $e.noOuter) }, o.top ? (n.options.inner.top = r.bottom - a.height, n.options.outer.top = r.bottom - s.height) : o.bottom && (n.options.inner.bottom = r.top + a.height, n.options.outer.bottom = r.top + s.height), o.left ? (n.options.inner.left = r.right - a.width, n.options.outer.left = r.right - s.width) : o.right && (n.options.inner.right = r.left + a.width, n.options.outer.right = r.left + s.width), $e.set(t), n.options = i;
|
|
2841
2899
|
}
|
|
2842
2900
|
}, defaults: { min: null, max: null, endOnly: !1, enabled: !1 } }, "restrictSize"), Nt = { start: function(t) {
|
|
2843
2901
|
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(m) {
|
|
2844
|
-
var
|
|
2845
|
-
return
|
|
2902
|
+
var k = m.interaction.element, w = Ze(ze(m.state.options.origin, null, null, [k])), C = w || Le(m.interactable, k, m.interaction.prepared.name);
|
|
2903
|
+
return C;
|
|
2846
2904
|
})(t) : { x: 0, y: 0 };
|
|
2847
2905
|
if (l.offset === "startCoords") e = { x: n.coords.start.page.x, y: n.coords.start.page.y };
|
|
2848
2906
|
else {
|
|
@@ -2850,19 +2908,19 @@ function Vo() {
|
|
|
2850
2908
|
(e = Ze(c) || { x: 0, y: 0 }).x += u.x, e.y += u.y;
|
|
2851
2909
|
}
|
|
2852
2910
|
var p = l.relativePoints;
|
|
2853
|
-
a.offsets = i && p && p.length ? p.map((function(m,
|
|
2854
|
-
return { index:
|
|
2911
|
+
a.offsets = i && p && p.length ? p.map((function(m, k) {
|
|
2912
|
+
return { index: k, relativePoint: m, x: s.left - i.width * m.x + e.x, y: s.top - i.height * m.y + e.y };
|
|
2855
2913
|
})) : [{ index: 0, relativePoint: null, x: e.x, y: e.y }];
|
|
2856
2914
|
}, set: function(t) {
|
|
2857
|
-
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 =
|
|
2915
|
+
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 = [];
|
|
2858
2916
|
o.offsetWithOrigin || (s.x -= a.x, s.y -= a.y);
|
|
2859
|
-
for (var u = 0, c = i; u < c.length; u++) for (var p = c[u], m = s.x - p.x,
|
|
2860
|
-
var
|
|
2861
|
-
(
|
|
2917
|
+
for (var u = 0, c = i; u < c.length; u++) for (var p = c[u], m = s.x - p.x, k = s.y - p.y, w = 0, C = o.targets.length; w < C; w++) {
|
|
2918
|
+
var _ = o.targets[w], T = void 0;
|
|
2919
|
+
(T = g.func(_) ? _(m, k, e._proxy, p, w) : _) && l.push({ x: (g.number(T.x) ? T.x : m) + p.x, y: (g.number(T.y) ? T.y : k) + p.y, range: g.number(T.range) ? T.range : o.range, source: _, index: w, offset: p });
|
|
2862
2920
|
}
|
|
2863
|
-
for (var O = { target: null, inRange: !1, distance: 0, range: 0, delta: { x: 0, y: 0 } },
|
|
2864
|
-
var W = l[
|
|
2865
|
-
N === 1 / 0 && O.inRange && O.range !== 1 / 0 && (ge = !1), O.target && !(ge ? O.inRange && N !== 1 / 0 ? ae / N < O.distance / O.range : N === 1 / 0 && O.range !== 1 / 0 || ae < O.distance : !O.inRange && ae < O.distance) || (O.target = W, O.distance = ae, O.range = N, O.inRange = ge, O.delta.x =
|
|
2921
|
+
for (var O = { target: null, inRange: !1, distance: 0, range: 0, delta: { x: 0, y: 0 } }, H = 0; H < l.length; H++) {
|
|
2922
|
+
var W = l[H], N = W.range, V = W.x - s.x, me = W.y - s.y, ae = je(V, me), ge = ae <= N;
|
|
2923
|
+
N === 1 / 0 && O.inRange && O.range !== 1 / 0 && (ge = !1), O.target && !(ge ? O.inRange && N !== 1 / 0 ? ae / N < O.distance / O.range : N === 1 / 0 && O.range !== 1 / 0 || ae < O.distance : !O.inRange && ae < O.distance) || (O.target = W, O.distance = ae, O.range = N, O.inRange = ge, O.delta.x = V, O.delta.y = me);
|
|
2866
2924
|
}
|
|
2867
2925
|
return O.inRange && (n.x = O.target.x, n.y = O.target.y), r.closest = O, O;
|
|
2868
2926
|
}, 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) {
|
|
@@ -2871,37 +2929,37 @@ function Vo() {
|
|
|
2871
2929
|
t.state = { options: { targets: null, relativePoints: [{ x: n.left ? 0 : 1, y: n.top ? 0 : 1 }], offset: r.offset || "self", origin: { x: 0, y: 0 }, range: r.range } }, e.targetFields = e.targetFields || [["width", "height"], ["x", "y"]], Nt.start(t), e.offsets = t.state.offsets, t.state = e;
|
|
2872
2930
|
}, set: function(t) {
|
|
2873
2931
|
var e = t.interaction, n = t.state, r = t.coords, o = n.options, i = n.offsets, a = { x: r.x - i[0].x, y: r.y - i[0].y };
|
|
2874
|
-
n.options =
|
|
2932
|
+
n.options = I({}, o), n.options.targets = [];
|
|
2875
2933
|
for (var s = 0, l = o.targets || []; s < l.length; s++) {
|
|
2876
2934
|
var u = l[s], c = void 0;
|
|
2877
2935
|
if (c = g.func(u) ? u(a.x, a.y, e) : u) {
|
|
2878
2936
|
for (var p = 0, m = n.targetFields; p < m.length; p++) {
|
|
2879
|
-
var
|
|
2880
|
-
if (w in c ||
|
|
2881
|
-
c.x = c[w], c.y = c[
|
|
2937
|
+
var k = m[p], w = k[0], C = k[1];
|
|
2938
|
+
if (w in c || C in c) {
|
|
2939
|
+
c.x = c[w], c.y = c[C];
|
|
2882
2940
|
break;
|
|
2883
2941
|
}
|
|
2884
2942
|
}
|
|
2885
2943
|
n.options.targets.push(c);
|
|
2886
2944
|
}
|
|
2887
2945
|
}
|
|
2888
|
-
var
|
|
2889
|
-
return n.options = o,
|
|
2946
|
+
var _ = Nt.set(t);
|
|
2947
|
+
return n.options = o, _;
|
|
2890
2948
|
}, defaults: { range: 1 / 0, targets: null, offset: null, endOnly: !1, enabled: !1 } }, jr = _e(pt, "snapSize"), zt = { aspectRatio: Rr, restrictEdges: Or, restrict: Ir, restrictRect: Pr, restrictSize: zr, snapEdges: _e({ start: function(t) {
|
|
2891
2949
|
var e = t.edges;
|
|
2892
2950
|
return e ? (t.state.targetFields = t.state.targetFields || [[e.left ? "left" : "right", e.top ? "top" : "bottom"]], pt.start(t)) : null;
|
|
2893
|
-
}, set: pt.set, defaults:
|
|
2951
|
+
}, set: pt.set, defaults: I(De(pt.defaults), { targets: void 0, range: void 0, offset: { x: 0, y: 0 } }) }, "snapEdges"), snap: Lr, snapSize: jr, spring: ut, avoid: ut, transform: ut, rubberband: ut }, Fr = { id: "modifiers", install: function(t) {
|
|
2894
2952
|
var e = t.interactStatic;
|
|
2895
2953
|
for (var n in t.usePlugin(cn), t.usePlugin(Sr), e.modifiers = zt, zt) {
|
|
2896
2954
|
var r = zt[n], o = r._defaults, i = r._methods;
|
|
2897
2955
|
o._methods = i, t.defaults.perAction[n] = o;
|
|
2898
2956
|
}
|
|
2899
2957
|
} }, Hr = Fr, Mn = (function(t) {
|
|
2900
|
-
|
|
2901
|
-
var e =
|
|
2958
|
+
A(n, t);
|
|
2959
|
+
var e = P(n);
|
|
2902
2960
|
function n(r, o, i, a, s, l) {
|
|
2903
2961
|
var u;
|
|
2904
|
-
if (
|
|
2962
|
+
if (y(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 = Fe(o), u.pointerType = Yt(o), u.target = a, u.currentTarget = null, r === "tap") {
|
|
2905
2963
|
var c = s.getPointerIndex(o);
|
|
2906
2964
|
u.dt = u.timeStamp - s.pointers[c].downTime;
|
|
2907
2965
|
var p = u.timeStamp - s.tapTime;
|
|
@@ -2909,7 +2967,7 @@ function Vo() {
|
|
|
2909
2967
|
} else r === "doubletap" && (u.dt = o.timeStamp - s.tapTime, u.double = !0);
|
|
2910
2968
|
return u;
|
|
2911
2969
|
}
|
|
2912
|
-
return
|
|
2970
|
+
return E(n, [{ key: "_subtractOrigin", value: function(r) {
|
|
2913
2971
|
var o = r.x, i = r.y;
|
|
2914
2972
|
return this.pageX -= o, this.pageY -= i, this.clientX -= o, this.clientY -= i, this;
|
|
2915
2973
|
} }, { key: "_addOrigin", value: function(r) {
|
|
@@ -2919,7 +2977,7 @@ function Vo() {
|
|
|
2919
2977
|
this.originalEvent.preventDefault();
|
|
2920
2978
|
} }]), n;
|
|
2921
2979
|
})(ot), We = { id: "pointer-events/base", before: ["inertia", "modifiers", "auto-start", "actions"], install: function(t) {
|
|
2922
|
-
t.pointerEvents = We, t.defaults.actions.pointerEvents = We.defaults,
|
|
2980
|
+
t.pointerEvents = We, t.defaults.actions.pointerEvents = We.defaults, I(t.actions.phaselessTypes, We.types);
|
|
2923
2981
|
}, listeners: { "interactions:new": function(t) {
|
|
2924
2982
|
var e = t.interaction;
|
|
2925
2983
|
e.prevTap = null, e.tapTime = 0;
|
|
@@ -2932,13 +2990,13 @@ function Vo() {
|
|
|
2932
2990
|
}, "interactions:down": function(t, e) {
|
|
2933
2991
|
(function(n, r) {
|
|
2934
2992
|
for (var o = n.interaction, i = n.pointer, a = n.event, s = n.eventTarget, l = n.pointerIndex, u = o.pointers[l].hold, c = ue(s), p = { interaction: o, pointer: i, event: a, eventTarget: s, type: "hold", targets: [], path: c, node: null }, m = 0; m < c.length; m++) {
|
|
2935
|
-
var
|
|
2936
|
-
p.node =
|
|
2993
|
+
var k = c[m];
|
|
2994
|
+
p.node = k, r.fire("pointerEvents:collect-targets", p);
|
|
2937
2995
|
}
|
|
2938
2996
|
if (p.targets.length) {
|
|
2939
|
-
for (var w = 1 / 0,
|
|
2940
|
-
var
|
|
2941
|
-
|
|
2997
|
+
for (var w = 1 / 0, C = 0, _ = p.targets; C < _.length; C++) {
|
|
2998
|
+
var T = _[C].eventable.options.holdDuration;
|
|
2999
|
+
T < w && (w = T);
|
|
2942
3000
|
}
|
|
2943
3001
|
u.duration = w, u.timeout = setTimeout((function() {
|
|
2944
3002
|
Re({ interaction: o, eventTarget: s, pointer: i, event: a, type: "hold" }, r);
|
|
@@ -2958,13 +3016,13 @@ function Vo() {
|
|
|
2958
3016
|
e.fire("pointerEvents:new", { pointerEvent: u });
|
|
2959
3017
|
for (var c = { interaction: n, pointer: r, event: o, eventTarget: i, targets: l, type: a, pointerEvent: u }, p = 0; p < l.length; p++) {
|
|
2960
3018
|
var m = l[p];
|
|
2961
|
-
for (var
|
|
3019
|
+
for (var k in m.props || {}) u[k] = m.props[k];
|
|
2962
3020
|
var w = Le(m.eventable, m.node);
|
|
2963
3021
|
if (u._subtractOrigin(w), u.eventable = m.eventable, u.currentTarget = m.node, m.eventable.fire(u), u._addOrigin(w), u.immediatePropagationStopped || u.propagationStopped && p + 1 < l.length && l[p + 1].node !== u.currentTarget) break;
|
|
2964
3022
|
}
|
|
2965
3023
|
if (e.fire("pointerEvents:fired", c), a === "tap") {
|
|
2966
|
-
var
|
|
2967
|
-
n.prevTap =
|
|
3024
|
+
var C = u.double ? Re({ interaction: n, pointer: r, event: o, eventTarget: i, type: "doubletap" }, e) : u;
|
|
3025
|
+
n.prevTap = C, n.tapTime = C.timeStamp;
|
|
2968
3026
|
}
|
|
2969
3027
|
return u;
|
|
2970
3028
|
}
|
|
@@ -2975,9 +3033,9 @@ function Vo() {
|
|
|
2975
3033
|
var m = u[p];
|
|
2976
3034
|
c.node = m, e.fire("pointerEvents:collect-targets", c);
|
|
2977
3035
|
}
|
|
2978
|
-
return a === "hold" && (c.targets = c.targets.filter((function(
|
|
2979
|
-
var w,
|
|
2980
|
-
return
|
|
3036
|
+
return a === "hold" && (c.targets = c.targets.filter((function(k) {
|
|
3037
|
+
var w, C;
|
|
3038
|
+
return k.eventable.options.holdDuration === ((w = n.pointers[s]) == null || (C = w.hold) == null ? void 0 : C.duration);
|
|
2981
3039
|
}))), c.targets;
|
|
2982
3040
|
}
|
|
2983
3041
|
function Lt(t) {
|
|
@@ -3009,7 +3067,7 @@ function Vo() {
|
|
|
3009
3067
|
} }) }, Yr = Vr, $r = { id: "pointer-events/interactableTargets", install: function(t) {
|
|
3010
3068
|
var e = t.Interactable;
|
|
3011
3069
|
e.prototype.pointerEvents = function(r) {
|
|
3012
|
-
return
|
|
3070
|
+
return I(this.events.options, r), this;
|
|
3013
3071
|
};
|
|
3014
3072
|
var n = e.prototype._backCompatOption;
|
|
3015
3073
|
e.prototype._backCompatOption = function(r, o) {
|
|
@@ -3029,7 +3087,7 @@ function Vo() {
|
|
|
3029
3087
|
};
|
|
3030
3088
|
}, "interactable:set": function(t, e) {
|
|
3031
3089
|
var n = t.interactable, r = t.options;
|
|
3032
|
-
|
|
3090
|
+
I(n.events.options, e.pointerEvents.defaults), I(n.events.options, r.pointerEvents || {});
|
|
3033
3091
|
} } }, Wr = $r, Ur = { id: "pointer-events", install: function(t) {
|
|
3034
3092
|
t.usePlugin(Br), t.usePlugin(Yr), t.usePlugin(Wr);
|
|
3035
3093
|
} }, Xr = Ur, Gr = { id: "reflow", install: function(t) {
|
|
@@ -3039,15 +3097,15 @@ function Vo() {
|
|
|
3039
3097
|
for (var a = r.getAllElements(), s = i.window.Promise, l = s ? [] : null, u = function() {
|
|
3040
3098
|
var p = a[c], m = r.getRect(p);
|
|
3041
3099
|
if (!m) return 1;
|
|
3042
|
-
var
|
|
3043
|
-
return
|
|
3100
|
+
var k, w = Be(i.interactions.list, (function(T) {
|
|
3101
|
+
return T.interacting() && T.interactable === r && T.element === p && T.prepared.name === o.name;
|
|
3044
3102
|
}));
|
|
3045
|
-
if (w) w.move(), l && (
|
|
3046
|
-
w._reflowResolve =
|
|
3103
|
+
if (w) w.move(), l && (k = w._reflowPromise || new s((function(T) {
|
|
3104
|
+
w._reflowResolve = T;
|
|
3047
3105
|
})));
|
|
3048
3106
|
else {
|
|
3049
|
-
var
|
|
3050
|
-
return { coords:
|
|
3107
|
+
var C = vt(m), _ = /* @__PURE__ */ (function(T) {
|
|
3108
|
+
return { coords: T, get page() {
|
|
3051
3109
|
return this.coords.page;
|
|
3052
3110
|
}, get client() {
|
|
3053
3111
|
return this.coords.client;
|
|
@@ -3073,17 +3131,17 @@ function Vo() {
|
|
|
3073
3131
|
return this.coords.buttons;
|
|
3074
3132
|
}, preventDefault: function() {
|
|
3075
3133
|
} };
|
|
3076
|
-
})({ page: { x:
|
|
3077
|
-
|
|
3078
|
-
var
|
|
3079
|
-
|
|
3080
|
-
var ae =
|
|
3081
|
-
|
|
3134
|
+
})({ page: { x: C.x, y: C.y }, client: { x: C.x, y: C.y }, timeStamp: i.now() });
|
|
3135
|
+
k = (function(T, O, H, W, N) {
|
|
3136
|
+
var V = T.interactions.new({ pointerType: "reflow" }), me = { interaction: V, event: N, pointer: N, eventTarget: H, phase: "reflow" };
|
|
3137
|
+
V.interactable = O, V.element = H, V.prevEvent = N, V.updatePointer(N, N, H, !0), Ht(V.coords.delta), St(V.prepared, W), V._doPhase(me);
|
|
3138
|
+
var ae = T.window, ge = ae.Promise, be = ge ? new ge((function(Se) {
|
|
3139
|
+
V._reflowResolve = Se;
|
|
3082
3140
|
})) : void 0;
|
|
3083
|
-
return
|
|
3084
|
-
})(i, r, p, o,
|
|
3141
|
+
return V._reflowPromise = be, V.start(W, O, H), V._interacting ? (V.move(me), V.end(N)) : (V.stop(), V._reflowResolve()), V.removePointer(N, N), be;
|
|
3142
|
+
})(i, r, p, o, _);
|
|
3085
3143
|
}
|
|
3086
|
-
l && l.push(
|
|
3144
|
+
l && l.push(k);
|
|
3087
3145
|
}, c = 0; c < a.length && !u(); c++) ;
|
|
3088
3146
|
return l && s.all(l).then((function() {
|
|
3089
3147
|
return r;
|
|
@@ -3096,11 +3154,11 @@ function Vo() {
|
|
|
3096
3154
|
r.splice(r.indexOf(o), 1);
|
|
3097
3155
|
})(e.interactions.list, n));
|
|
3098
3156
|
} } }, Kr = Gr;
|
|
3099
|
-
if (
|
|
3100
|
-
h.exports =
|
|
3157
|
+
if (ve.use(ln), ve.use(hn), ve.use(Xr), ve.use(fr), ve.use(Hr), ve.use(tr), ve.use(Yn), ve.use(Wn), ve.use(Kr), ve.default = ve, b(h) === "object" && h) try {
|
|
3158
|
+
h.exports = ve;
|
|
3101
3159
|
} catch {
|
|
3102
3160
|
}
|
|
3103
|
-
return
|
|
3161
|
+
return ve.default = ve, ve;
|
|
3104
3162
|
}));
|
|
3105
3163
|
})(Ke, Ke.exports)), Ke.exports;
|
|
3106
3164
|
}
|
|
@@ -3111,27 +3169,28 @@ function An(h) {
|
|
|
3111
3169
|
v.type = "file", v.accept = "image/*", v.onchange = (f) => {
|
|
3112
3170
|
const d = f.target.files?.[0];
|
|
3113
3171
|
if (d) {
|
|
3114
|
-
const
|
|
3115
|
-
|
|
3116
|
-
const
|
|
3117
|
-
|
|
3118
|
-
const
|
|
3119
|
-
|
|
3120
|
-
const
|
|
3121
|
-
|
|
3172
|
+
const b = new FileReader();
|
|
3173
|
+
b.onload = (y) => {
|
|
3174
|
+
const S = document.createElement("img");
|
|
3175
|
+
S.src = y.target?.result, S.style.maxWidth = "100%", S.style.width = "100%", S.style.height = "auto", S.style.cursor = "pointer", S.draggable = !1;
|
|
3176
|
+
const E = document.createElement("div");
|
|
3177
|
+
E.className = "editor-image-wrapper", E.style.display = "inline-block", E.style.position = "relative", E.style.maxWidth = "100%", E.style.width = "auto", E.style.height = "auto", E.contentEditable = "false", E.style.boxSizing = "border-box", E.style.touchAction = "none", E.style.userSelect = "none", E.appendChild(S);
|
|
3178
|
+
const M = document.createElement("div");
|
|
3179
|
+
M.contentEditable = "true", M.style.margin = "10px 0", M.style.textAlign = "left", M.style.display = "block", M.appendChild(E);
|
|
3122
3180
|
try {
|
|
3123
3181
|
Ne();
|
|
3124
|
-
const
|
|
3125
|
-
if (
|
|
3126
|
-
|
|
3127
|
-
const
|
|
3128
|
-
|
|
3182
|
+
const A = window.getSelection();
|
|
3183
|
+
if (A && A.rangeCount > 0) {
|
|
3184
|
+
A.getRangeAt(0).insertNode(M), A.removeAllRanges();
|
|
3185
|
+
const F = document.createRange();
|
|
3186
|
+
F.setStartAfter(M), F.collapse(!0), A.addRange(F), he(F);
|
|
3129
3187
|
} else
|
|
3130
|
-
h.appendChild(
|
|
3188
|
+
h.appendChild(M), h.focus(), he();
|
|
3131
3189
|
} catch {
|
|
3132
|
-
h.appendChild(
|
|
3190
|
+
h.appendChild(M), h.focus(), he();
|
|
3133
3191
|
}
|
|
3134
|
-
|
|
3192
|
+
h.dispatchEvent(new Event("input", { bubbles: !0 })), h.focus();
|
|
3193
|
+
}, b.readAsDataURL(d);
|
|
3135
3194
|
}
|
|
3136
3195
|
}, v.click();
|
|
3137
3196
|
}
|
|
@@ -3141,19 +3200,19 @@ function $o(h) {
|
|
|
3141
3200
|
const f = v.querySelector("img");
|
|
3142
3201
|
if (f)
|
|
3143
3202
|
if (v.classList.contains("resizable")) {
|
|
3144
|
-
const d = v.getBoundingClientRect(),
|
|
3145
|
-
jt(v).unset(), v.classList.remove("resizable"), v.style.border = "none", v.style.transform = "", v.dataset.x = "", v.dataset.y = "", v.style.width =
|
|
3203
|
+
const d = v.getBoundingClientRect(), b = Math.round(d.width) + "px", y = Math.round(d.height) + "px";
|
|
3204
|
+
jt(v).unset(), v.classList.remove("resizable"), v.style.border = "none", v.style.transform = "", v.dataset.x = "", v.dataset.y = "", v.style.width = b, v.style.height = y, v.contentEditable = "false", f && (f.style.width = "100%", f.style.height = "100%");
|
|
3146
3205
|
} else {
|
|
3147
3206
|
v.classList.add("resizable"), v.style.border = "2px dashed #007bff", v.style.position = "relative", v.style.userSelect = "none";
|
|
3148
3207
|
const d = v.getBoundingClientRect();
|
|
3149
3208
|
v.style.width = d.width + "px", v.style.height = d.height + "px", f && (f.style.width = "100%", f.style.height = "100%"), jt(v).resizable({
|
|
3150
3209
|
edges: { left: !0, right: !0, bottom: !0, top: !0 },
|
|
3151
3210
|
listeners: {
|
|
3152
|
-
move: (
|
|
3153
|
-
const
|
|
3154
|
-
Object.assign(
|
|
3155
|
-
width: `${
|
|
3156
|
-
height: `${
|
|
3211
|
+
move: (b) => {
|
|
3212
|
+
const y = b.target;
|
|
3213
|
+
Object.assign(y.style, {
|
|
3214
|
+
width: `${b.rect.width}px`,
|
|
3215
|
+
height: `${b.rect.height}px`
|
|
3157
3216
|
});
|
|
3158
3217
|
}
|
|
3159
3218
|
},
|
|
@@ -3194,19 +3253,19 @@ function Uo() {
|
|
|
3194
3253
|
if (Pn) return Xe;
|
|
3195
3254
|
Pn = 1;
|
|
3196
3255
|
var h = Symbol.for("react.transitional.element"), v = Symbol.for("react.fragment");
|
|
3197
|
-
function f(d,
|
|
3198
|
-
var
|
|
3199
|
-
if (
|
|
3200
|
-
|
|
3201
|
-
for (var
|
|
3202
|
-
|
|
3203
|
-
} else
|
|
3204
|
-
return
|
|
3256
|
+
function f(d, b, y) {
|
|
3257
|
+
var S = null;
|
|
3258
|
+
if (y !== void 0 && (S = "" + y), b.key !== void 0 && (S = "" + b.key), "key" in b) {
|
|
3259
|
+
y = {};
|
|
3260
|
+
for (var E in b)
|
|
3261
|
+
E !== "key" && (y[E] = b[E]);
|
|
3262
|
+
} else y = b;
|
|
3263
|
+
return b = y.ref, {
|
|
3205
3264
|
$$typeof: h,
|
|
3206
3265
|
type: d,
|
|
3207
|
-
key:
|
|
3208
|
-
ref:
|
|
3209
|
-
props:
|
|
3266
|
+
key: S,
|
|
3267
|
+
ref: b !== void 0 ? b : null,
|
|
3268
|
+
props: y
|
|
3210
3269
|
};
|
|
3211
3270
|
}
|
|
3212
3271
|
return Xe.Fragment = v, Xe.jsx = f, Xe.jsxs = f, Xe;
|
|
@@ -3215,230 +3274,230 @@ var Ge = {};
|
|
|
3215
3274
|
var Dn;
|
|
3216
3275
|
function Xo() {
|
|
3217
3276
|
return Dn || (Dn = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
3218
|
-
function h(
|
|
3219
|
-
if (
|
|
3220
|
-
if (typeof
|
|
3221
|
-
return
|
|
3222
|
-
if (typeof
|
|
3223
|
-
switch (
|
|
3224
|
-
case
|
|
3277
|
+
function h(x) {
|
|
3278
|
+
if (x == null) return null;
|
|
3279
|
+
if (typeof x == "function")
|
|
3280
|
+
return x.$$typeof === ce ? null : x.displayName || x.name || null;
|
|
3281
|
+
if (typeof x == "string") return x;
|
|
3282
|
+
switch (x) {
|
|
3283
|
+
case G:
|
|
3225
3284
|
return "Fragment";
|
|
3226
3285
|
case U:
|
|
3227
3286
|
return "Profiler";
|
|
3228
3287
|
case oe:
|
|
3229
3288
|
return "StrictMode";
|
|
3230
|
-
case
|
|
3289
|
+
case ee:
|
|
3231
3290
|
return "Suspense";
|
|
3232
3291
|
case g:
|
|
3233
3292
|
return "SuspenseList";
|
|
3234
3293
|
case le:
|
|
3235
3294
|
return "Activity";
|
|
3236
3295
|
}
|
|
3237
|
-
if (typeof
|
|
3238
|
-
switch (typeof
|
|
3296
|
+
if (typeof x == "object")
|
|
3297
|
+
switch (typeof x.tag == "number" && console.error(
|
|
3239
3298
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
3240
|
-
),
|
|
3241
|
-
case
|
|
3299
|
+
), x.$$typeof) {
|
|
3300
|
+
case K:
|
|
3242
3301
|
return "Portal";
|
|
3243
|
-
case
|
|
3244
|
-
return
|
|
3245
|
-
case
|
|
3246
|
-
return (
|
|
3302
|
+
case Z:
|
|
3303
|
+
return x.displayName || "Context";
|
|
3304
|
+
case ne:
|
|
3305
|
+
return (x._context.displayName || "Context") + ".Consumer";
|
|
3247
3306
|
case ie:
|
|
3248
|
-
var D =
|
|
3249
|
-
return
|
|
3250
|
-
case
|
|
3251
|
-
return D =
|
|
3307
|
+
var D = x.render;
|
|
3308
|
+
return x = x.displayName, x || (x = D.displayName || D.name || "", x = x !== "" ? "ForwardRef(" + x + ")" : "ForwardRef"), x;
|
|
3309
|
+
case J:
|
|
3310
|
+
return D = x.displayName || null, D !== null ? D : h(x.type) || "Memo";
|
|
3252
3311
|
case z:
|
|
3253
|
-
D =
|
|
3312
|
+
D = x._payload, x = x._init;
|
|
3254
3313
|
try {
|
|
3255
|
-
return h(
|
|
3314
|
+
return h(x(D));
|
|
3256
3315
|
} catch {
|
|
3257
3316
|
}
|
|
3258
3317
|
}
|
|
3259
3318
|
return null;
|
|
3260
3319
|
}
|
|
3261
|
-
function v(
|
|
3262
|
-
return "" +
|
|
3320
|
+
function v(x) {
|
|
3321
|
+
return "" + x;
|
|
3263
3322
|
}
|
|
3264
|
-
function f(
|
|
3323
|
+
function f(x) {
|
|
3265
3324
|
try {
|
|
3266
|
-
v(
|
|
3325
|
+
v(x);
|
|
3267
3326
|
var D = !1;
|
|
3268
3327
|
} catch {
|
|
3269
3328
|
D = !0;
|
|
3270
3329
|
}
|
|
3271
3330
|
if (D) {
|
|
3272
3331
|
D = console;
|
|
3273
|
-
var L = D.error,
|
|
3332
|
+
var L = D.error, q = typeof Symbol == "function" && Symbol.toStringTag && x[Symbol.toStringTag] || x.constructor.name || "Object";
|
|
3274
3333
|
return L.call(
|
|
3275
3334
|
D,
|
|
3276
3335
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
3277
|
-
|
|
3278
|
-
), v(
|
|
3336
|
+
q
|
|
3337
|
+
), v(x);
|
|
3279
3338
|
}
|
|
3280
3339
|
}
|
|
3281
|
-
function d(
|
|
3282
|
-
if (
|
|
3283
|
-
if (typeof
|
|
3340
|
+
function d(x) {
|
|
3341
|
+
if (x === G) return "<>";
|
|
3342
|
+
if (typeof x == "object" && x !== null && x.$$typeof === z)
|
|
3284
3343
|
return "<...>";
|
|
3285
3344
|
try {
|
|
3286
|
-
var D = h(
|
|
3345
|
+
var D = h(x);
|
|
3287
3346
|
return D ? "<" + D + ">" : "<...>";
|
|
3288
3347
|
} catch {
|
|
3289
3348
|
return "<...>";
|
|
3290
3349
|
}
|
|
3291
3350
|
}
|
|
3292
|
-
function
|
|
3293
|
-
var
|
|
3294
|
-
return
|
|
3351
|
+
function b() {
|
|
3352
|
+
var x = Y.A;
|
|
3353
|
+
return x === null ? null : x.getOwner();
|
|
3295
3354
|
}
|
|
3296
|
-
function
|
|
3355
|
+
function y() {
|
|
3297
3356
|
return Error("react-stack-top-frame");
|
|
3298
3357
|
}
|
|
3299
|
-
function
|
|
3300
|
-
if (
|
|
3301
|
-
var D = Object.getOwnPropertyDescriptor(
|
|
3358
|
+
function S(x) {
|
|
3359
|
+
if ($.call(x, "key")) {
|
|
3360
|
+
var D = Object.getOwnPropertyDescriptor(x, "key").get;
|
|
3302
3361
|
if (D && D.isReactWarning) return !1;
|
|
3303
3362
|
}
|
|
3304
|
-
return
|
|
3363
|
+
return x.key !== void 0;
|
|
3305
3364
|
}
|
|
3306
|
-
function
|
|
3365
|
+
function E(x, D) {
|
|
3307
3366
|
function L() {
|
|
3308
|
-
|
|
3367
|
+
Q || (Q = !0, console.error(
|
|
3309
3368
|
"%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)",
|
|
3310
3369
|
D
|
|
3311
3370
|
));
|
|
3312
3371
|
}
|
|
3313
|
-
L.isReactWarning = !0, Object.defineProperty(
|
|
3372
|
+
L.isReactWarning = !0, Object.defineProperty(x, "key", {
|
|
3314
3373
|
get: L,
|
|
3315
3374
|
configurable: !0
|
|
3316
3375
|
});
|
|
3317
3376
|
}
|
|
3318
|
-
function
|
|
3319
|
-
var
|
|
3320
|
-
return se[
|
|
3377
|
+
function M() {
|
|
3378
|
+
var x = h(this.type);
|
|
3379
|
+
return se[x] || (se[x] = !0, console.error(
|
|
3321
3380
|
"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."
|
|
3322
|
-
)),
|
|
3381
|
+
)), x = this.props.ref, x !== void 0 ? x : null;
|
|
3323
3382
|
}
|
|
3324
|
-
function
|
|
3383
|
+
function A(x, D, L, q, xe, we) {
|
|
3325
3384
|
var ue = L.ref;
|
|
3326
|
-
return
|
|
3327
|
-
$$typeof:
|
|
3328
|
-
type:
|
|
3385
|
+
return x = {
|
|
3386
|
+
$$typeof: te,
|
|
3387
|
+
type: x,
|
|
3329
3388
|
key: D,
|
|
3330
3389
|
props: L,
|
|
3331
|
-
_owner:
|
|
3332
|
-
}, (ue !== void 0 ? ue : null) !== null ? Object.defineProperty(
|
|
3390
|
+
_owner: q
|
|
3391
|
+
}, (ue !== void 0 ? ue : null) !== null ? Object.defineProperty(x, "ref", {
|
|
3333
3392
|
enumerable: !1,
|
|
3334
|
-
get:
|
|
3335
|
-
}) : Object.defineProperty(
|
|
3393
|
+
get: M
|
|
3394
|
+
}) : Object.defineProperty(x, "ref", { enumerable: !1, value: null }), x._store = {}, Object.defineProperty(x._store, "validated", {
|
|
3336
3395
|
configurable: !1,
|
|
3337
3396
|
enumerable: !1,
|
|
3338
3397
|
writable: !0,
|
|
3339
3398
|
value: 0
|
|
3340
|
-
}), Object.defineProperty(
|
|
3399
|
+
}), Object.defineProperty(x, "_debugInfo", {
|
|
3341
3400
|
configurable: !1,
|
|
3342
3401
|
enumerable: !1,
|
|
3343
3402
|
writable: !0,
|
|
3344
3403
|
value: null
|
|
3345
|
-
}), Object.defineProperty(
|
|
3404
|
+
}), Object.defineProperty(x, "_debugStack", {
|
|
3346
3405
|
configurable: !1,
|
|
3347
3406
|
enumerable: !1,
|
|
3348
3407
|
writable: !0,
|
|
3349
3408
|
value: xe
|
|
3350
|
-
}), Object.defineProperty(
|
|
3409
|
+
}), Object.defineProperty(x, "_debugTask", {
|
|
3351
3410
|
configurable: !1,
|
|
3352
3411
|
enumerable: !1,
|
|
3353
3412
|
writable: !0,
|
|
3354
3413
|
value: we
|
|
3355
|
-
}), Object.freeze && (Object.freeze(
|
|
3414
|
+
}), Object.freeze && (Object.freeze(x.props), Object.freeze(x)), x;
|
|
3356
3415
|
}
|
|
3357
|
-
function
|
|
3416
|
+
function R(x, D, L, q, xe, we) {
|
|
3358
3417
|
var ue = D.children;
|
|
3359
3418
|
if (ue !== void 0)
|
|
3360
|
-
if (
|
|
3361
|
-
if (
|
|
3362
|
-
for (
|
|
3363
|
-
|
|
3419
|
+
if (q)
|
|
3420
|
+
if (B(ue)) {
|
|
3421
|
+
for (q = 0; q < ue.length; q++)
|
|
3422
|
+
F(ue[q]);
|
|
3364
3423
|
Object.freeze && Object.freeze(ue);
|
|
3365
3424
|
} else
|
|
3366
3425
|
console.error(
|
|
3367
3426
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
3368
3427
|
);
|
|
3369
|
-
else
|
|
3370
|
-
if (
|
|
3371
|
-
ue = h(
|
|
3428
|
+
else F(ue);
|
|
3429
|
+
if ($.call(D, "key")) {
|
|
3430
|
+
ue = h(x);
|
|
3372
3431
|
var Ee = Object.keys(D).filter(function(Qe) {
|
|
3373
3432
|
return Qe !== "key";
|
|
3374
3433
|
});
|
|
3375
|
-
|
|
3434
|
+
q = 0 < Ee.length ? "{key: someKey, " + Ee.join(": ..., ") + ": ...}" : "{key: someKey}", fe[ue + q] || (Ee = 0 < Ee.length ? "{" + Ee.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
3376
3435
|
`A props object containing a "key" prop is being spread into JSX:
|
|
3377
3436
|
let props = %s;
|
|
3378
3437
|
<%s {...props} />
|
|
3379
3438
|
React keys must be passed directly to JSX without using spread:
|
|
3380
3439
|
let props = %s;
|
|
3381
3440
|
<%s key={someKey} {...props} />`,
|
|
3382
|
-
|
|
3441
|
+
q,
|
|
3383
3442
|
ue,
|
|
3384
3443
|
Ee,
|
|
3385
3444
|
ue
|
|
3386
|
-
), fe[ue +
|
|
3445
|
+
), fe[ue + q] = !0);
|
|
3387
3446
|
}
|
|
3388
|
-
if (ue = null, L !== void 0 && (f(L), ue = "" + L),
|
|
3447
|
+
if (ue = null, L !== void 0 && (f(L), ue = "" + L), S(D) && (f(D.key), ue = "" + D.key), "key" in D) {
|
|
3389
3448
|
L = {};
|
|
3390
|
-
for (var
|
|
3391
|
-
|
|
3449
|
+
for (var I in D)
|
|
3450
|
+
I !== "key" && (L[I] = D[I]);
|
|
3392
3451
|
} else L = D;
|
|
3393
|
-
return ue &&
|
|
3452
|
+
return ue && E(
|
|
3394
3453
|
L,
|
|
3395
|
-
typeof
|
|
3396
|
-
),
|
|
3397
|
-
|
|
3454
|
+
typeof x == "function" ? x.displayName || x.name || "Unknown" : x
|
|
3455
|
+
), A(
|
|
3456
|
+
x,
|
|
3398
3457
|
ue,
|
|
3399
3458
|
L,
|
|
3400
|
-
|
|
3459
|
+
b(),
|
|
3401
3460
|
xe,
|
|
3402
3461
|
we
|
|
3403
3462
|
);
|
|
3404
3463
|
}
|
|
3405
|
-
function
|
|
3406
|
-
|
|
3464
|
+
function F(x) {
|
|
3465
|
+
X(x) ? x._store && (x._store.validated = 1) : typeof x == "object" && x !== null && x.$$typeof === z && (x._payload.status === "fulfilled" ? X(x._payload.value) && x._payload.value._store && (x._payload.value._store.validated = 1) : x._store && (x._store.validated = 1));
|
|
3407
3466
|
}
|
|
3408
|
-
function
|
|
3409
|
-
return typeof
|
|
3467
|
+
function X(x) {
|
|
3468
|
+
return typeof x == "object" && x !== null && x.$$typeof === te;
|
|
3410
3469
|
}
|
|
3411
|
-
var
|
|
3470
|
+
var P = Jr, te = Symbol.for("react.transitional.element"), K = Symbol.for("react.portal"), G = Symbol.for("react.fragment"), oe = Symbol.for("react.strict_mode"), U = Symbol.for("react.profiler"), ne = Symbol.for("react.consumer"), Z = Symbol.for("react.context"), ie = Symbol.for("react.forward_ref"), ee = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), J = Symbol.for("react.memo"), z = Symbol.for("react.lazy"), le = Symbol.for("react.activity"), ce = Symbol.for("react.client.reference"), Y = P.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, $ = Object.prototype.hasOwnProperty, B = Array.isArray, re = console.createTask ? console.createTask : function() {
|
|
3412
3471
|
return null;
|
|
3413
3472
|
};
|
|
3414
|
-
|
|
3415
|
-
react_stack_bottom_frame: function(
|
|
3416
|
-
return
|
|
3473
|
+
P = {
|
|
3474
|
+
react_stack_bottom_frame: function(x) {
|
|
3475
|
+
return x();
|
|
3417
3476
|
}
|
|
3418
3477
|
};
|
|
3419
|
-
var
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
)(), pe =
|
|
3423
|
-
Ge.Fragment =
|
|
3424
|
-
var
|
|
3425
|
-
return
|
|
3426
|
-
|
|
3478
|
+
var Q, se = {}, de = P.react_stack_bottom_frame.bind(
|
|
3479
|
+
P,
|
|
3480
|
+
y
|
|
3481
|
+
)(), pe = re(d(y)), fe = {};
|
|
3482
|
+
Ge.Fragment = G, Ge.jsx = function(x, D, L) {
|
|
3483
|
+
var q = 1e4 > Y.recentlyCreatedOwnerStacks++;
|
|
3484
|
+
return R(
|
|
3485
|
+
x,
|
|
3427
3486
|
D,
|
|
3428
3487
|
L,
|
|
3429
3488
|
!1,
|
|
3430
|
-
|
|
3431
|
-
|
|
3489
|
+
q ? Error("react-stack-top-frame") : de,
|
|
3490
|
+
q ? re(d(x)) : pe
|
|
3432
3491
|
);
|
|
3433
|
-
}, Ge.jsxs = function(
|
|
3434
|
-
var
|
|
3435
|
-
return
|
|
3436
|
-
|
|
3492
|
+
}, Ge.jsxs = function(x, D, L) {
|
|
3493
|
+
var q = 1e4 > Y.recentlyCreatedOwnerStacks++;
|
|
3494
|
+
return R(
|
|
3495
|
+
x,
|
|
3437
3496
|
D,
|
|
3438
3497
|
L,
|
|
3439
3498
|
!0,
|
|
3440
|
-
|
|
3441
|
-
|
|
3499
|
+
q ? Error("react-stack-top-frame") : de,
|
|
3500
|
+
q ? re(d(x)) : pe
|
|
3442
3501
|
);
|
|
3443
3502
|
};
|
|
3444
3503
|
})()), Ge;
|
|
@@ -3456,11 +3515,11 @@ const Qo = ({
|
|
|
3456
3515
|
return Qr(() => {
|
|
3457
3516
|
if (d.current && !f.current) {
|
|
3458
3517
|
f.current = new Wo(), d.current.appendChild(f.current.getElement()), v && f.current.setHTML(v);
|
|
3459
|
-
const
|
|
3460
|
-
const
|
|
3461
|
-
h?.(
|
|
3518
|
+
const b = f.current.getElement(), y = () => {
|
|
3519
|
+
const S = f.current?.getHTML() || "";
|
|
3520
|
+
h?.(S);
|
|
3462
3521
|
};
|
|
3463
|
-
|
|
3522
|
+
b.addEventListener("input", y), b.addEventListener("keyup", y), b.addEventListener("paste", y);
|
|
3464
3523
|
}
|
|
3465
3524
|
}, [h, v]), /* @__PURE__ */ Ko.jsx("div", { ref: d });
|
|
3466
3525
|
};
|