@clevertask/scribe 0.0.0
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/LICENSE +21 -0
- package/README.md +167 -0
- package/dist/SlashCommandList-DYKFukY8.js +3734 -0
- package/dist/components/Menu/BarMenu.d.ts +7 -0
- package/dist/components/Menu/BarMenu.js +119 -0
- package/dist/components/Menu/BubbleMenu.d.ts +7 -0
- package/dist/components/Menu/BubbleMenu.js +176 -0
- package/dist/components/Scribe/extension/extension-link.d.ts +2 -0
- package/dist/components/Scribe/extension/extension-link.js +934 -0
- package/dist/components/Scribe/extension/extension-selectedText.d.ts +12 -0
- package/dist/components/Scribe/extension/extension-selectedText.js +13 -0
- package/dist/components/Scribe/extension/index.d.ts +2 -0
- package/dist/components/Scribe/extension/index.js +1647 -0
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.d.ts +5 -0
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +10 -0
- package/dist/components/Scribe/extension/slashCommand/index.d.ts +4 -0
- package/dist/components/Scribe/extension/slashCommand/index.js +154 -0
- package/dist/components/Scribe/extension/slashCommand/items.d.ts +23 -0
- package/dist/components/Scribe/extension/slashCommand/items.js +159 -0
- package/dist/components/Scribe/extension/slashCommand/renderItems.d.ts +8 -0
- package/dist/components/Scribe/extension/slashCommand/renderItems.js +38 -0
- package/dist/components/Scribe/index.d.ts +28 -0
- package/dist/components/Scribe/index.js +92 -0
- package/dist/index-Cu10LNOZ.js +2505 -0
- package/dist/index-CzwFCNeI.js +12114 -0
- package/dist/main.css +1134 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +10 -0
- package/dist/marked.esm-DIt7dqAB.js +1574 -0
- package/dist/purify.es-Bzg5nW_L.js +524 -0
- package/dist/turndown.browser.es-DwgPoVx0.js +646 -0
- package/dist/utils/html-to-markdown.d.ts +1 -0
- package/dist/utils/html-to-markdown.js +11 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +8 -0
- package/dist/utils/is-in-viewport.d.ts +1 -0
- package/dist/utils/is-in-viewport.js +7 -0
- package/dist/utils/markdown-to-html.d.ts +1 -0
- package/dist/utils/markdown-to-html.js +6 -0
- package/dist/vite-env.d.js +1 -0
- package/package.json +95 -0
|
@@ -0,0 +1,2505 @@
|
|
|
1
|
+
import { a as $r, P as kr, E as Ur, x as Fr, u as qr, y as zr, z as Kr } from "./index-CzwFCNeI.js";
|
|
2
|
+
import P, { forwardRef as Gr, useRef as Yr, useState as At, useDebugValue as cr, useEffect as _t, createContext as lr, useContext as dr, useLayoutEffect as Xr } from "react";
|
|
3
|
+
import Jr, { flushSync as Qr } from "react-dom";
|
|
4
|
+
var k = "top", G = "bottom", Y = "right", U = "left", Rt = "auto", Ue = [k, G, Y, U], Te = "start", He = "end", Zr = "clippingParents", fr = "viewport", je = "popper", en = "reference", Ht = /* @__PURE__ */ Ue.reduce(function(t, e) {
|
|
5
|
+
return t.concat([e + "-" + Te, e + "-" + He]);
|
|
6
|
+
}, []), pr = /* @__PURE__ */ [].concat(Ue, [Rt]).reduce(function(t, e) {
|
|
7
|
+
return t.concat([e, e + "-" + Te, e + "-" + He]);
|
|
8
|
+
}, []), tn = "beforeRead", rn = "read", nn = "afterRead", on = "beforeMain", an = "main", sn = "afterMain", un = "beforeWrite", cn = "write", ln = "afterWrite", dn = [tn, rn, nn, on, an, sn, un, cn, ln];
|
|
9
|
+
function re(t) {
|
|
10
|
+
return t ? (t.nodeName || "").toLowerCase() : null;
|
|
11
|
+
}
|
|
12
|
+
function q(t) {
|
|
13
|
+
if (t == null)
|
|
14
|
+
return window;
|
|
15
|
+
if (t.toString() !== "[object Window]") {
|
|
16
|
+
var e = t.ownerDocument;
|
|
17
|
+
return e && e.defaultView || window;
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
}
|
|
21
|
+
function ge(t) {
|
|
22
|
+
var e = q(t).Element;
|
|
23
|
+
return t instanceof e || t instanceof Element;
|
|
24
|
+
}
|
|
25
|
+
function K(t) {
|
|
26
|
+
var e = q(t).HTMLElement;
|
|
27
|
+
return t instanceof e || t instanceof HTMLElement;
|
|
28
|
+
}
|
|
29
|
+
function Lt(t) {
|
|
30
|
+
if (typeof ShadowRoot > "u")
|
|
31
|
+
return !1;
|
|
32
|
+
var e = q(t).ShadowRoot;
|
|
33
|
+
return t instanceof e || t instanceof ShadowRoot;
|
|
34
|
+
}
|
|
35
|
+
function fn(t) {
|
|
36
|
+
var e = t.state;
|
|
37
|
+
Object.keys(e.elements).forEach(function(r) {
|
|
38
|
+
var n = e.styles[r] || {}, i = e.attributes[r] || {}, a = e.elements[r];
|
|
39
|
+
!K(a) || !re(a) || (Object.assign(a.style, n), Object.keys(i).forEach(function(d) {
|
|
40
|
+
var u = i[d];
|
|
41
|
+
u === !1 ? a.removeAttribute(d) : a.setAttribute(d, u === !0 ? "" : u);
|
|
42
|
+
}));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function pn(t) {
|
|
46
|
+
var e = t.state, r = {
|
|
47
|
+
popper: {
|
|
48
|
+
position: e.options.strategy,
|
|
49
|
+
left: "0",
|
|
50
|
+
top: "0",
|
|
51
|
+
margin: "0"
|
|
52
|
+
},
|
|
53
|
+
arrow: {
|
|
54
|
+
position: "absolute"
|
|
55
|
+
},
|
|
56
|
+
reference: {}
|
|
57
|
+
};
|
|
58
|
+
return Object.assign(e.elements.popper.style, r.popper), e.styles = r, e.elements.arrow && Object.assign(e.elements.arrow.style, r.arrow), function() {
|
|
59
|
+
Object.keys(e.elements).forEach(function(n) {
|
|
60
|
+
var i = e.elements[n], a = e.attributes[n] || {}, d = Object.keys(e.styles.hasOwnProperty(n) ? e.styles[n] : r[n]), u = d.reduce(function(s, p) {
|
|
61
|
+
return s[p] = "", s;
|
|
62
|
+
}, {});
|
|
63
|
+
!K(i) || !re(i) || (Object.assign(i.style, u), Object.keys(a).forEach(function(s) {
|
|
64
|
+
i.removeAttribute(s);
|
|
65
|
+
}));
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
const vr = {
|
|
70
|
+
name: "applyStyles",
|
|
71
|
+
enabled: !0,
|
|
72
|
+
phase: "write",
|
|
73
|
+
fn,
|
|
74
|
+
effect: pn,
|
|
75
|
+
requires: ["computeStyles"]
|
|
76
|
+
};
|
|
77
|
+
function te(t) {
|
|
78
|
+
return t.split("-")[0];
|
|
79
|
+
}
|
|
80
|
+
var ye = Math.max, at = Math.min, Ce = Math.round;
|
|
81
|
+
function Et() {
|
|
82
|
+
var t = navigator.userAgentData;
|
|
83
|
+
return t != null && t.brands && Array.isArray(t.brands) ? t.brands.map(function(e) {
|
|
84
|
+
return e.brand + "/" + e.version;
|
|
85
|
+
}).join(" ") : navigator.userAgent;
|
|
86
|
+
}
|
|
87
|
+
function hr() {
|
|
88
|
+
return !/^((?!chrome|android).)*safari/i.test(Et());
|
|
89
|
+
}
|
|
90
|
+
function Ae(t, e, r) {
|
|
91
|
+
e === void 0 && (e = !1), r === void 0 && (r = !1);
|
|
92
|
+
var n = t.getBoundingClientRect(), i = 1, a = 1;
|
|
93
|
+
e && K(t) && (i = t.offsetWidth > 0 && Ce(n.width) / t.offsetWidth || 1, a = t.offsetHeight > 0 && Ce(n.height) / t.offsetHeight || 1);
|
|
94
|
+
var d = ge(t) ? q(t) : window, u = d.visualViewport, s = !hr() && r, p = (n.left + (s && u ? u.offsetLeft : 0)) / i, l = (n.top + (s && u ? u.offsetTop : 0)) / a, v = n.width / i, y = n.height / a;
|
|
95
|
+
return {
|
|
96
|
+
width: v,
|
|
97
|
+
height: y,
|
|
98
|
+
top: l,
|
|
99
|
+
right: p + v,
|
|
100
|
+
bottom: l + y,
|
|
101
|
+
left: p,
|
|
102
|
+
x: p,
|
|
103
|
+
y: l
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function Mt(t) {
|
|
107
|
+
var e = Ae(t), r = t.offsetWidth, n = t.offsetHeight;
|
|
108
|
+
return Math.abs(e.width - r) <= 1 && (r = e.width), Math.abs(e.height - n) <= 1 && (n = e.height), {
|
|
109
|
+
x: t.offsetLeft,
|
|
110
|
+
y: t.offsetTop,
|
|
111
|
+
width: r,
|
|
112
|
+
height: n
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function mr(t, e) {
|
|
116
|
+
var r = e.getRootNode && e.getRootNode();
|
|
117
|
+
if (t.contains(e))
|
|
118
|
+
return !0;
|
|
119
|
+
if (r && Lt(r)) {
|
|
120
|
+
var n = e;
|
|
121
|
+
do {
|
|
122
|
+
if (n && t.isSameNode(n))
|
|
123
|
+
return !0;
|
|
124
|
+
n = n.parentNode || n.host;
|
|
125
|
+
} while (n);
|
|
126
|
+
}
|
|
127
|
+
return !1;
|
|
128
|
+
}
|
|
129
|
+
function ue(t) {
|
|
130
|
+
return q(t).getComputedStyle(t);
|
|
131
|
+
}
|
|
132
|
+
function vn(t) {
|
|
133
|
+
return ["table", "td", "th"].indexOf(re(t)) >= 0;
|
|
134
|
+
}
|
|
135
|
+
function de(t) {
|
|
136
|
+
return ((ge(t) ? t.ownerDocument : (
|
|
137
|
+
// $FlowFixMe[prop-missing]
|
|
138
|
+
t.document
|
|
139
|
+
)) || window.document).documentElement;
|
|
140
|
+
}
|
|
141
|
+
function ut(t) {
|
|
142
|
+
return re(t) === "html" ? t : (
|
|
143
|
+
// this is a quicker (but less type safe) way to save quite some bytes from the bundle
|
|
144
|
+
// $FlowFixMe[incompatible-return]
|
|
145
|
+
// $FlowFixMe[prop-missing]
|
|
146
|
+
t.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
|
147
|
+
t.parentNode || // DOM Element detected
|
|
148
|
+
(Lt(t) ? t.host : null) || // ShadowRoot detected
|
|
149
|
+
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
|
|
150
|
+
de(t)
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
function Wt(t) {
|
|
154
|
+
return !K(t) || // https://github.com/popperjs/popper-core/issues/837
|
|
155
|
+
ue(t).position === "fixed" ? null : t.offsetParent;
|
|
156
|
+
}
|
|
157
|
+
function hn(t) {
|
|
158
|
+
var e = /firefox/i.test(Et()), r = /Trident/i.test(Et());
|
|
159
|
+
if (r && K(t)) {
|
|
160
|
+
var n = ue(t);
|
|
161
|
+
if (n.position === "fixed")
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
var i = ut(t);
|
|
165
|
+
for (Lt(i) && (i = i.host); K(i) && ["html", "body"].indexOf(re(i)) < 0; ) {
|
|
166
|
+
var a = ue(i);
|
|
167
|
+
if (a.transform !== "none" || a.perspective !== "none" || a.contain === "paint" || ["transform", "perspective"].indexOf(a.willChange) !== -1 || e && a.willChange === "filter" || e && a.filter && a.filter !== "none")
|
|
168
|
+
return i;
|
|
169
|
+
i = i.parentNode;
|
|
170
|
+
}
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
function Fe(t) {
|
|
174
|
+
for (var e = q(t), r = Wt(t); r && vn(r) && ue(r).position === "static"; )
|
|
175
|
+
r = Wt(r);
|
|
176
|
+
return r && (re(r) === "html" || re(r) === "body" && ue(r).position === "static") ? e : r || hn(t) || e;
|
|
177
|
+
}
|
|
178
|
+
function Nt(t) {
|
|
179
|
+
return ["top", "bottom"].indexOf(t) >= 0 ? "x" : "y";
|
|
180
|
+
}
|
|
181
|
+
function Be(t, e, r) {
|
|
182
|
+
return ye(t, at(e, r));
|
|
183
|
+
}
|
|
184
|
+
function mn(t, e, r) {
|
|
185
|
+
var n = Be(t, e, r);
|
|
186
|
+
return n > r ? r : n;
|
|
187
|
+
}
|
|
188
|
+
function yr() {
|
|
189
|
+
return {
|
|
190
|
+
top: 0,
|
|
191
|
+
right: 0,
|
|
192
|
+
bottom: 0,
|
|
193
|
+
left: 0
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
function gr(t) {
|
|
197
|
+
return Object.assign({}, yr(), t);
|
|
198
|
+
}
|
|
199
|
+
function br(t, e) {
|
|
200
|
+
return e.reduce(function(r, n) {
|
|
201
|
+
return r[n] = t, r;
|
|
202
|
+
}, {});
|
|
203
|
+
}
|
|
204
|
+
var yn = function(e, r) {
|
|
205
|
+
return e = typeof e == "function" ? e(Object.assign({}, r.rects, {
|
|
206
|
+
placement: r.placement
|
|
207
|
+
})) : e, gr(typeof e != "number" ? e : br(e, Ue));
|
|
208
|
+
};
|
|
209
|
+
function gn(t) {
|
|
210
|
+
var e, r = t.state, n = t.name, i = t.options, a = r.elements.arrow, d = r.modifiersData.popperOffsets, u = te(r.placement), s = Nt(u), p = [U, Y].indexOf(u) >= 0, l = p ? "height" : "width";
|
|
211
|
+
if (!(!a || !d)) {
|
|
212
|
+
var v = yn(i.padding, r), y = Mt(a), h = s === "y" ? k : U, b = s === "y" ? G : Y, m = r.rects.reference[l] + r.rects.reference[s] - d[s] - r.rects.popper[l], E = d[s] - r.rects.reference[s], D = Fe(a), T = D ? s === "y" ? D.clientHeight || 0 : D.clientWidth || 0 : 0, w = m / 2 - E / 2, o = v[h], O = T - y[l] - v[b], f = T / 2 - y[l] / 2 + w, x = Be(o, f, O), _ = s;
|
|
213
|
+
r.modifiersData[n] = (e = {}, e[_] = x, e.centerOffset = x - f, e);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
function bn(t) {
|
|
217
|
+
var e = t.state, r = t.options, n = r.element, i = n === void 0 ? "[data-popper-arrow]" : n;
|
|
218
|
+
i != null && (typeof i == "string" && (i = e.elements.popper.querySelector(i), !i) || mr(e.elements.popper, i) && (e.elements.arrow = i));
|
|
219
|
+
}
|
|
220
|
+
const En = {
|
|
221
|
+
name: "arrow",
|
|
222
|
+
enabled: !0,
|
|
223
|
+
phase: "main",
|
|
224
|
+
fn: gn,
|
|
225
|
+
effect: bn,
|
|
226
|
+
requires: ["popperOffsets"],
|
|
227
|
+
requiresIfExists: ["preventOverflow"]
|
|
228
|
+
};
|
|
229
|
+
function _e(t) {
|
|
230
|
+
return t.split("-")[1];
|
|
231
|
+
}
|
|
232
|
+
var wn = {
|
|
233
|
+
top: "auto",
|
|
234
|
+
right: "auto",
|
|
235
|
+
bottom: "auto",
|
|
236
|
+
left: "auto"
|
|
237
|
+
};
|
|
238
|
+
function On(t, e) {
|
|
239
|
+
var r = t.x, n = t.y, i = e.devicePixelRatio || 1;
|
|
240
|
+
return {
|
|
241
|
+
x: Ce(r * i) / i || 0,
|
|
242
|
+
y: Ce(n * i) / i || 0
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
function $t(t) {
|
|
246
|
+
var e, r = t.popper, n = t.popperRect, i = t.placement, a = t.variation, d = t.offsets, u = t.position, s = t.gpuAcceleration, p = t.adaptive, l = t.roundOffsets, v = t.isFixed, y = d.x, h = y === void 0 ? 0 : y, b = d.y, m = b === void 0 ? 0 : b, E = typeof l == "function" ? l({
|
|
247
|
+
x: h,
|
|
248
|
+
y: m
|
|
249
|
+
}) : {
|
|
250
|
+
x: h,
|
|
251
|
+
y: m
|
|
252
|
+
};
|
|
253
|
+
h = E.x, m = E.y;
|
|
254
|
+
var D = d.hasOwnProperty("x"), T = d.hasOwnProperty("y"), w = U, o = k, O = window;
|
|
255
|
+
if (p) {
|
|
256
|
+
var f = Fe(r), x = "clientHeight", _ = "clientWidth";
|
|
257
|
+
if (f === q(r) && (f = de(r), ue(f).position !== "static" && u === "absolute" && (x = "scrollHeight", _ = "scrollWidth")), f = f, i === k || (i === U || i === Y) && a === He) {
|
|
258
|
+
o = G;
|
|
259
|
+
var C = v && f === O && O.visualViewport ? O.visualViewport.height : (
|
|
260
|
+
// $FlowFixMe[prop-missing]
|
|
261
|
+
f[x]
|
|
262
|
+
);
|
|
263
|
+
m -= C - n.height, m *= s ? 1 : -1;
|
|
264
|
+
}
|
|
265
|
+
if (i === U || (i === k || i === G) && a === He) {
|
|
266
|
+
w = Y;
|
|
267
|
+
var L = v && f === O && O.visualViewport ? O.visualViewport.width : (
|
|
268
|
+
// $FlowFixMe[prop-missing]
|
|
269
|
+
f[_]
|
|
270
|
+
);
|
|
271
|
+
h -= L - n.width, h *= s ? 1 : -1;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
var V = Object.assign({
|
|
275
|
+
position: u
|
|
276
|
+
}, p && wn), M = l === !0 ? On({
|
|
277
|
+
x: h,
|
|
278
|
+
y: m
|
|
279
|
+
}, q(r)) : {
|
|
280
|
+
x: h,
|
|
281
|
+
y: m
|
|
282
|
+
};
|
|
283
|
+
if (h = M.x, m = M.y, s) {
|
|
284
|
+
var N;
|
|
285
|
+
return Object.assign({}, V, (N = {}, N[o] = T ? "0" : "", N[w] = D ? "0" : "", N.transform = (O.devicePixelRatio || 1) <= 1 ? "translate(" + h + "px, " + m + "px)" : "translate3d(" + h + "px, " + m + "px, 0)", N));
|
|
286
|
+
}
|
|
287
|
+
return Object.assign({}, V, (e = {}, e[o] = T ? m + "px" : "", e[w] = D ? h + "px" : "", e.transform = "", e));
|
|
288
|
+
}
|
|
289
|
+
function Sn(t) {
|
|
290
|
+
var e = t.state, r = t.options, n = r.gpuAcceleration, i = n === void 0 ? !0 : n, a = r.adaptive, d = a === void 0 ? !0 : a, u = r.roundOffsets, s = u === void 0 ? !0 : u, p = {
|
|
291
|
+
placement: te(e.placement),
|
|
292
|
+
variation: _e(e.placement),
|
|
293
|
+
popper: e.elements.popper,
|
|
294
|
+
popperRect: e.rects.popper,
|
|
295
|
+
gpuAcceleration: i,
|
|
296
|
+
isFixed: e.options.strategy === "fixed"
|
|
297
|
+
};
|
|
298
|
+
e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, $t(Object.assign({}, p, {
|
|
299
|
+
offsets: e.modifiersData.popperOffsets,
|
|
300
|
+
position: e.options.strategy,
|
|
301
|
+
adaptive: d,
|
|
302
|
+
roundOffsets: s
|
|
303
|
+
})))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, $t(Object.assign({}, p, {
|
|
304
|
+
offsets: e.modifiersData.arrow,
|
|
305
|
+
position: "absolute",
|
|
306
|
+
adaptive: !1,
|
|
307
|
+
roundOffsets: s
|
|
308
|
+
})))), e.attributes.popper = Object.assign({}, e.attributes.popper, {
|
|
309
|
+
"data-popper-placement": e.placement
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
const xn = {
|
|
313
|
+
name: "computeStyles",
|
|
314
|
+
enabled: !0,
|
|
315
|
+
phase: "beforeWrite",
|
|
316
|
+
fn: Sn,
|
|
317
|
+
data: {}
|
|
318
|
+
};
|
|
319
|
+
var nt = {
|
|
320
|
+
passive: !0
|
|
321
|
+
};
|
|
322
|
+
function Dn(t) {
|
|
323
|
+
var e = t.state, r = t.instance, n = t.options, i = n.scroll, a = i === void 0 ? !0 : i, d = n.resize, u = d === void 0 ? !0 : d, s = q(e.elements.popper), p = [].concat(e.scrollParents.reference, e.scrollParents.popper);
|
|
324
|
+
return a && p.forEach(function(l) {
|
|
325
|
+
l.addEventListener("scroll", r.update, nt);
|
|
326
|
+
}), u && s.addEventListener("resize", r.update, nt), function() {
|
|
327
|
+
a && p.forEach(function(l) {
|
|
328
|
+
l.removeEventListener("scroll", r.update, nt);
|
|
329
|
+
}), u && s.removeEventListener("resize", r.update, nt);
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
const Tn = {
|
|
333
|
+
name: "eventListeners",
|
|
334
|
+
enabled: !0,
|
|
335
|
+
phase: "write",
|
|
336
|
+
fn: function() {
|
|
337
|
+
},
|
|
338
|
+
effect: Dn,
|
|
339
|
+
data: {}
|
|
340
|
+
};
|
|
341
|
+
var Cn = {
|
|
342
|
+
left: "right",
|
|
343
|
+
right: "left",
|
|
344
|
+
bottom: "top",
|
|
345
|
+
top: "bottom"
|
|
346
|
+
};
|
|
347
|
+
function ot(t) {
|
|
348
|
+
return t.replace(/left|right|bottom|top/g, function(e) {
|
|
349
|
+
return Cn[e];
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
var An = {
|
|
353
|
+
start: "end",
|
|
354
|
+
end: "start"
|
|
355
|
+
};
|
|
356
|
+
function kt(t) {
|
|
357
|
+
return t.replace(/start|end/g, function(e) {
|
|
358
|
+
return An[e];
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
function Vt(t) {
|
|
362
|
+
var e = q(t), r = e.pageXOffset, n = e.pageYOffset;
|
|
363
|
+
return {
|
|
364
|
+
scrollLeft: r,
|
|
365
|
+
scrollTop: n
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
function jt(t) {
|
|
369
|
+
return Ae(de(t)).left + Vt(t).scrollLeft;
|
|
370
|
+
}
|
|
371
|
+
function _n(t, e) {
|
|
372
|
+
var r = q(t), n = de(t), i = r.visualViewport, a = n.clientWidth, d = n.clientHeight, u = 0, s = 0;
|
|
373
|
+
if (i) {
|
|
374
|
+
a = i.width, d = i.height;
|
|
375
|
+
var p = hr();
|
|
376
|
+
(p || !p && e === "fixed") && (u = i.offsetLeft, s = i.offsetTop);
|
|
377
|
+
}
|
|
378
|
+
return {
|
|
379
|
+
width: a,
|
|
380
|
+
height: d,
|
|
381
|
+
x: u + jt(t),
|
|
382
|
+
y: s
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
function Rn(t) {
|
|
386
|
+
var e, r = de(t), n = Vt(t), i = (e = t.ownerDocument) == null ? void 0 : e.body, a = ye(r.scrollWidth, r.clientWidth, i ? i.scrollWidth : 0, i ? i.clientWidth : 0), d = ye(r.scrollHeight, r.clientHeight, i ? i.scrollHeight : 0, i ? i.clientHeight : 0), u = -n.scrollLeft + jt(t), s = -n.scrollTop;
|
|
387
|
+
return ue(i || r).direction === "rtl" && (u += ye(r.clientWidth, i ? i.clientWidth : 0) - a), {
|
|
388
|
+
width: a,
|
|
389
|
+
height: d,
|
|
390
|
+
x: u,
|
|
391
|
+
y: s
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
function Bt(t) {
|
|
395
|
+
var e = ue(t), r = e.overflow, n = e.overflowX, i = e.overflowY;
|
|
396
|
+
return /auto|scroll|overlay|hidden/.test(r + i + n);
|
|
397
|
+
}
|
|
398
|
+
function Er(t) {
|
|
399
|
+
return ["html", "body", "#document"].indexOf(re(t)) >= 0 ? t.ownerDocument.body : K(t) && Bt(t) ? t : Er(ut(t));
|
|
400
|
+
}
|
|
401
|
+
function Pe(t, e) {
|
|
402
|
+
var r;
|
|
403
|
+
e === void 0 && (e = []);
|
|
404
|
+
var n = Er(t), i = n === ((r = t.ownerDocument) == null ? void 0 : r.body), a = q(n), d = i ? [a].concat(a.visualViewport || [], Bt(n) ? n : []) : n, u = e.concat(d);
|
|
405
|
+
return i ? u : (
|
|
406
|
+
// $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
|
|
407
|
+
u.concat(Pe(ut(d)))
|
|
408
|
+
);
|
|
409
|
+
}
|
|
410
|
+
function wt(t) {
|
|
411
|
+
return Object.assign({}, t, {
|
|
412
|
+
left: t.x,
|
|
413
|
+
top: t.y,
|
|
414
|
+
right: t.x + t.width,
|
|
415
|
+
bottom: t.y + t.height
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
function Ln(t, e) {
|
|
419
|
+
var r = Ae(t, !1, e === "fixed");
|
|
420
|
+
return r.top = r.top + t.clientTop, r.left = r.left + t.clientLeft, r.bottom = r.top + t.clientHeight, r.right = r.left + t.clientWidth, r.width = t.clientWidth, r.height = t.clientHeight, r.x = r.left, r.y = r.top, r;
|
|
421
|
+
}
|
|
422
|
+
function Ut(t, e, r) {
|
|
423
|
+
return e === fr ? wt(_n(t, r)) : ge(e) ? Ln(e, r) : wt(Rn(de(t)));
|
|
424
|
+
}
|
|
425
|
+
function Mn(t) {
|
|
426
|
+
var e = Pe(ut(t)), r = ["absolute", "fixed"].indexOf(ue(t).position) >= 0, n = r && K(t) ? Fe(t) : t;
|
|
427
|
+
return ge(n) ? e.filter(function(i) {
|
|
428
|
+
return ge(i) && mr(i, n) && re(i) !== "body";
|
|
429
|
+
}) : [];
|
|
430
|
+
}
|
|
431
|
+
function Nn(t, e, r, n) {
|
|
432
|
+
var i = e === "clippingParents" ? Mn(t) : [].concat(e), a = [].concat(i, [r]), d = a[0], u = a.reduce(function(s, p) {
|
|
433
|
+
var l = Ut(t, p, n);
|
|
434
|
+
return s.top = ye(l.top, s.top), s.right = at(l.right, s.right), s.bottom = at(l.bottom, s.bottom), s.left = ye(l.left, s.left), s;
|
|
435
|
+
}, Ut(t, d, n));
|
|
436
|
+
return u.width = u.right - u.left, u.height = u.bottom - u.top, u.x = u.left, u.y = u.top, u;
|
|
437
|
+
}
|
|
438
|
+
function wr(t) {
|
|
439
|
+
var e = t.reference, r = t.element, n = t.placement, i = n ? te(n) : null, a = n ? _e(n) : null, d = e.x + e.width / 2 - r.width / 2, u = e.y + e.height / 2 - r.height / 2, s;
|
|
440
|
+
switch (i) {
|
|
441
|
+
case k:
|
|
442
|
+
s = {
|
|
443
|
+
x: d,
|
|
444
|
+
y: e.y - r.height
|
|
445
|
+
};
|
|
446
|
+
break;
|
|
447
|
+
case G:
|
|
448
|
+
s = {
|
|
449
|
+
x: d,
|
|
450
|
+
y: e.y + e.height
|
|
451
|
+
};
|
|
452
|
+
break;
|
|
453
|
+
case Y:
|
|
454
|
+
s = {
|
|
455
|
+
x: e.x + e.width,
|
|
456
|
+
y: u
|
|
457
|
+
};
|
|
458
|
+
break;
|
|
459
|
+
case U:
|
|
460
|
+
s = {
|
|
461
|
+
x: e.x - r.width,
|
|
462
|
+
y: u
|
|
463
|
+
};
|
|
464
|
+
break;
|
|
465
|
+
default:
|
|
466
|
+
s = {
|
|
467
|
+
x: e.x,
|
|
468
|
+
y: e.y
|
|
469
|
+
};
|
|
470
|
+
}
|
|
471
|
+
var p = i ? Nt(i) : null;
|
|
472
|
+
if (p != null) {
|
|
473
|
+
var l = p === "y" ? "height" : "width";
|
|
474
|
+
switch (a) {
|
|
475
|
+
case Te:
|
|
476
|
+
s[p] = s[p] - (e[l] / 2 - r[l] / 2);
|
|
477
|
+
break;
|
|
478
|
+
case He:
|
|
479
|
+
s[p] = s[p] + (e[l] / 2 - r[l] / 2);
|
|
480
|
+
break;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
return s;
|
|
484
|
+
}
|
|
485
|
+
function We(t, e) {
|
|
486
|
+
e === void 0 && (e = {});
|
|
487
|
+
var r = e, n = r.placement, i = n === void 0 ? t.placement : n, a = r.strategy, d = a === void 0 ? t.strategy : a, u = r.boundary, s = u === void 0 ? Zr : u, p = r.rootBoundary, l = p === void 0 ? fr : p, v = r.elementContext, y = v === void 0 ? je : v, h = r.altBoundary, b = h === void 0 ? !1 : h, m = r.padding, E = m === void 0 ? 0 : m, D = gr(typeof E != "number" ? E : br(E, Ue)), T = y === je ? en : je, w = t.rects.popper, o = t.elements[b ? T : y], O = Nn(ge(o) ? o : o.contextElement || de(t.elements.popper), s, l, d), f = Ae(t.elements.reference), x = wr({
|
|
488
|
+
reference: f,
|
|
489
|
+
element: w,
|
|
490
|
+
strategy: "absolute",
|
|
491
|
+
placement: i
|
|
492
|
+
}), _ = wt(Object.assign({}, w, x)), C = y === je ? _ : f, L = {
|
|
493
|
+
top: O.top - C.top + D.top,
|
|
494
|
+
bottom: C.bottom - O.bottom + D.bottom,
|
|
495
|
+
left: O.left - C.left + D.left,
|
|
496
|
+
right: C.right - O.right + D.right
|
|
497
|
+
}, V = t.modifiersData.offset;
|
|
498
|
+
if (y === je && V) {
|
|
499
|
+
var M = V[i];
|
|
500
|
+
Object.keys(L).forEach(function(N) {
|
|
501
|
+
var I = [Y, G].indexOf(N) >= 0 ? 1 : -1, W = [k, G].indexOf(N) >= 0 ? "y" : "x";
|
|
502
|
+
L[N] += M[W] * I;
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
return L;
|
|
506
|
+
}
|
|
507
|
+
function Vn(t, e) {
|
|
508
|
+
e === void 0 && (e = {});
|
|
509
|
+
var r = e, n = r.placement, i = r.boundary, a = r.rootBoundary, d = r.padding, u = r.flipVariations, s = r.allowedAutoPlacements, p = s === void 0 ? pr : s, l = _e(n), v = l ? u ? Ht : Ht.filter(function(b) {
|
|
510
|
+
return _e(b) === l;
|
|
511
|
+
}) : Ue, y = v.filter(function(b) {
|
|
512
|
+
return p.indexOf(b) >= 0;
|
|
513
|
+
});
|
|
514
|
+
y.length === 0 && (y = v);
|
|
515
|
+
var h = y.reduce(function(b, m) {
|
|
516
|
+
return b[m] = We(t, {
|
|
517
|
+
placement: m,
|
|
518
|
+
boundary: i,
|
|
519
|
+
rootBoundary: a,
|
|
520
|
+
padding: d
|
|
521
|
+
})[te(m)], b;
|
|
522
|
+
}, {});
|
|
523
|
+
return Object.keys(h).sort(function(b, m) {
|
|
524
|
+
return h[b] - h[m];
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
function jn(t) {
|
|
528
|
+
if (te(t) === Rt)
|
|
529
|
+
return [];
|
|
530
|
+
var e = ot(t);
|
|
531
|
+
return [kt(t), e, kt(e)];
|
|
532
|
+
}
|
|
533
|
+
function Bn(t) {
|
|
534
|
+
var e = t.state, r = t.options, n = t.name;
|
|
535
|
+
if (!e.modifiersData[n]._skip) {
|
|
536
|
+
for (var i = r.mainAxis, a = i === void 0 ? !0 : i, d = r.altAxis, u = d === void 0 ? !0 : d, s = r.fallbackPlacements, p = r.padding, l = r.boundary, v = r.rootBoundary, y = r.altBoundary, h = r.flipVariations, b = h === void 0 ? !0 : h, m = r.allowedAutoPlacements, E = e.options.placement, D = te(E), T = D === E, w = s || (T || !b ? [ot(E)] : jn(E)), o = [E].concat(w).reduce(function(ne, X) {
|
|
537
|
+
return ne.concat(te(X) === Rt ? Vn(e, {
|
|
538
|
+
placement: X,
|
|
539
|
+
boundary: l,
|
|
540
|
+
rootBoundary: v,
|
|
541
|
+
padding: p,
|
|
542
|
+
flipVariations: b,
|
|
543
|
+
allowedAutoPlacements: m
|
|
544
|
+
}) : X);
|
|
545
|
+
}, []), O = e.rects.reference, f = e.rects.popper, x = /* @__PURE__ */ new Map(), _ = !0, C = o[0], L = 0; L < o.length; L++) {
|
|
546
|
+
var V = o[L], M = te(V), N = _e(V) === Te, I = [k, G].indexOf(M) >= 0, W = I ? "width" : "height", j = We(e, {
|
|
547
|
+
placement: V,
|
|
548
|
+
boundary: l,
|
|
549
|
+
rootBoundary: v,
|
|
550
|
+
altBoundary: y,
|
|
551
|
+
padding: p
|
|
552
|
+
}), B = I ? N ? Y : U : N ? G : k;
|
|
553
|
+
O[W] > f[W] && (B = ot(B));
|
|
554
|
+
var H = ot(B), J = [];
|
|
555
|
+
if (a && J.push(j[M] <= 0), u && J.push(j[B] <= 0, j[H] <= 0), J.every(function(ne) {
|
|
556
|
+
return ne;
|
|
557
|
+
})) {
|
|
558
|
+
C = V, _ = !1;
|
|
559
|
+
break;
|
|
560
|
+
}
|
|
561
|
+
x.set(V, J);
|
|
562
|
+
}
|
|
563
|
+
if (_)
|
|
564
|
+
for (var Q = b ? 3 : 1, fe = function(X) {
|
|
565
|
+
var ie = o.find(function(be) {
|
|
566
|
+
var oe = x.get(be);
|
|
567
|
+
if (oe)
|
|
568
|
+
return oe.slice(0, X).every(function(Ee) {
|
|
569
|
+
return Ee;
|
|
570
|
+
});
|
|
571
|
+
});
|
|
572
|
+
if (ie)
|
|
573
|
+
return C = ie, "break";
|
|
574
|
+
}, Z = Q; Z > 0; Z--) {
|
|
575
|
+
var pe = fe(Z);
|
|
576
|
+
if (pe === "break") break;
|
|
577
|
+
}
|
|
578
|
+
e.placement !== C && (e.modifiersData[n]._skip = !0, e.placement = C, e.reset = !0);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
const Pn = {
|
|
582
|
+
name: "flip",
|
|
583
|
+
enabled: !0,
|
|
584
|
+
phase: "main",
|
|
585
|
+
fn: Bn,
|
|
586
|
+
requiresIfExists: ["offset"],
|
|
587
|
+
data: {
|
|
588
|
+
_skip: !1
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
function Ft(t, e, r) {
|
|
592
|
+
return r === void 0 && (r = {
|
|
593
|
+
x: 0,
|
|
594
|
+
y: 0
|
|
595
|
+
}), {
|
|
596
|
+
top: t.top - e.height - r.y,
|
|
597
|
+
right: t.right - e.width + r.x,
|
|
598
|
+
bottom: t.bottom - e.height + r.y,
|
|
599
|
+
left: t.left - e.width - r.x
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
function qt(t) {
|
|
603
|
+
return [k, Y, G, U].some(function(e) {
|
|
604
|
+
return t[e] >= 0;
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
function In(t) {
|
|
608
|
+
var e = t.state, r = t.name, n = e.rects.reference, i = e.rects.popper, a = e.modifiersData.preventOverflow, d = We(e, {
|
|
609
|
+
elementContext: "reference"
|
|
610
|
+
}), u = We(e, {
|
|
611
|
+
altBoundary: !0
|
|
612
|
+
}), s = Ft(d, n), p = Ft(u, i, a), l = qt(s), v = qt(p);
|
|
613
|
+
e.modifiersData[r] = {
|
|
614
|
+
referenceClippingOffsets: s,
|
|
615
|
+
popperEscapeOffsets: p,
|
|
616
|
+
isReferenceHidden: l,
|
|
617
|
+
hasPopperEscaped: v
|
|
618
|
+
}, e.attributes.popper = Object.assign({}, e.attributes.popper, {
|
|
619
|
+
"data-popper-reference-hidden": l,
|
|
620
|
+
"data-popper-escaped": v
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
const Hn = {
|
|
624
|
+
name: "hide",
|
|
625
|
+
enabled: !0,
|
|
626
|
+
phase: "main",
|
|
627
|
+
requiresIfExists: ["preventOverflow"],
|
|
628
|
+
fn: In
|
|
629
|
+
};
|
|
630
|
+
function Wn(t, e, r) {
|
|
631
|
+
var n = te(t), i = [U, k].indexOf(n) >= 0 ? -1 : 1, a = typeof r == "function" ? r(Object.assign({}, e, {
|
|
632
|
+
placement: t
|
|
633
|
+
})) : r, d = a[0], u = a[1];
|
|
634
|
+
return d = d || 0, u = (u || 0) * i, [U, Y].indexOf(n) >= 0 ? {
|
|
635
|
+
x: u,
|
|
636
|
+
y: d
|
|
637
|
+
} : {
|
|
638
|
+
x: d,
|
|
639
|
+
y: u
|
|
640
|
+
};
|
|
641
|
+
}
|
|
642
|
+
function $n(t) {
|
|
643
|
+
var e = t.state, r = t.options, n = t.name, i = r.offset, a = i === void 0 ? [0, 0] : i, d = pr.reduce(function(l, v) {
|
|
644
|
+
return l[v] = Wn(v, e.rects, a), l;
|
|
645
|
+
}, {}), u = d[e.placement], s = u.x, p = u.y;
|
|
646
|
+
e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += s, e.modifiersData.popperOffsets.y += p), e.modifiersData[n] = d;
|
|
647
|
+
}
|
|
648
|
+
const kn = {
|
|
649
|
+
name: "offset",
|
|
650
|
+
enabled: !0,
|
|
651
|
+
phase: "main",
|
|
652
|
+
requires: ["popperOffsets"],
|
|
653
|
+
fn: $n
|
|
654
|
+
};
|
|
655
|
+
function Un(t) {
|
|
656
|
+
var e = t.state, r = t.name;
|
|
657
|
+
e.modifiersData[r] = wr({
|
|
658
|
+
reference: e.rects.reference,
|
|
659
|
+
element: e.rects.popper,
|
|
660
|
+
strategy: "absolute",
|
|
661
|
+
placement: e.placement
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
const Fn = {
|
|
665
|
+
name: "popperOffsets",
|
|
666
|
+
enabled: !0,
|
|
667
|
+
phase: "read",
|
|
668
|
+
fn: Un,
|
|
669
|
+
data: {}
|
|
670
|
+
};
|
|
671
|
+
function qn(t) {
|
|
672
|
+
return t === "x" ? "y" : "x";
|
|
673
|
+
}
|
|
674
|
+
function zn(t) {
|
|
675
|
+
var e = t.state, r = t.options, n = t.name, i = r.mainAxis, a = i === void 0 ? !0 : i, d = r.altAxis, u = d === void 0 ? !1 : d, s = r.boundary, p = r.rootBoundary, l = r.altBoundary, v = r.padding, y = r.tether, h = y === void 0 ? !0 : y, b = r.tetherOffset, m = b === void 0 ? 0 : b, E = We(e, {
|
|
676
|
+
boundary: s,
|
|
677
|
+
rootBoundary: p,
|
|
678
|
+
padding: v,
|
|
679
|
+
altBoundary: l
|
|
680
|
+
}), D = te(e.placement), T = _e(e.placement), w = !T, o = Nt(D), O = qn(o), f = e.modifiersData.popperOffsets, x = e.rects.reference, _ = e.rects.popper, C = typeof m == "function" ? m(Object.assign({}, e.rects, {
|
|
681
|
+
placement: e.placement
|
|
682
|
+
})) : m, L = typeof C == "number" ? {
|
|
683
|
+
mainAxis: C,
|
|
684
|
+
altAxis: C
|
|
685
|
+
} : Object.assign({
|
|
686
|
+
mainAxis: 0,
|
|
687
|
+
altAxis: 0
|
|
688
|
+
}, C), V = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, M = {
|
|
689
|
+
x: 0,
|
|
690
|
+
y: 0
|
|
691
|
+
};
|
|
692
|
+
if (f) {
|
|
693
|
+
if (a) {
|
|
694
|
+
var N, I = o === "y" ? k : U, W = o === "y" ? G : Y, j = o === "y" ? "height" : "width", B = f[o], H = B + E[I], J = B - E[W], Q = h ? -_[j] / 2 : 0, fe = T === Te ? x[j] : _[j], Z = T === Te ? -_[j] : -x[j], pe = e.elements.arrow, ne = h && pe ? Mt(pe) : {
|
|
695
|
+
width: 0,
|
|
696
|
+
height: 0
|
|
697
|
+
}, X = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : yr(), ie = X[I], be = X[W], oe = Be(0, x[j], ne[j]), Ee = w ? x[j] / 2 - Q - oe - ie - L.mainAxis : fe - oe - ie - L.mainAxis, ce = w ? -x[j] / 2 + Q + oe + be + L.mainAxis : Z + oe + be + L.mainAxis, we = e.elements.arrow && Fe(e.elements.arrow), ze = we ? o === "y" ? we.clientTop || 0 : we.clientLeft || 0 : 0, Re = (N = V == null ? void 0 : V[o]) != null ? N : 0, Ke = B + Ee - Re - ze, Ge = B + ce - Re, Le = Be(h ? at(H, Ke) : H, B, h ? ye(J, Ge) : J);
|
|
698
|
+
f[o] = Le, M[o] = Le - B;
|
|
699
|
+
}
|
|
700
|
+
if (u) {
|
|
701
|
+
var Me, Ye = o === "x" ? k : U, Xe = o === "x" ? G : Y, ae = f[O], le = O === "y" ? "height" : "width", Ne = ae + E[Ye], ve = ae - E[Xe], Ve = [k, U].indexOf(D) !== -1, Je = (Me = V == null ? void 0 : V[O]) != null ? Me : 0, Qe = Ve ? Ne : ae - x[le] - _[le] - Je + L.altAxis, Ze = Ve ? ae + x[le] + _[le] - Je - L.altAxis : ve, et = h && Ve ? mn(Qe, ae, Ze) : Be(h ? Qe : Ne, ae, h ? Ze : ve);
|
|
702
|
+
f[O] = et, M[O] = et - ae;
|
|
703
|
+
}
|
|
704
|
+
e.modifiersData[n] = M;
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
const Kn = {
|
|
708
|
+
name: "preventOverflow",
|
|
709
|
+
enabled: !0,
|
|
710
|
+
phase: "main",
|
|
711
|
+
fn: zn,
|
|
712
|
+
requiresIfExists: ["offset"]
|
|
713
|
+
};
|
|
714
|
+
function Gn(t) {
|
|
715
|
+
return {
|
|
716
|
+
scrollLeft: t.scrollLeft,
|
|
717
|
+
scrollTop: t.scrollTop
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
function Yn(t) {
|
|
721
|
+
return t === q(t) || !K(t) ? Vt(t) : Gn(t);
|
|
722
|
+
}
|
|
723
|
+
function Xn(t) {
|
|
724
|
+
var e = t.getBoundingClientRect(), r = Ce(e.width) / t.offsetWidth || 1, n = Ce(e.height) / t.offsetHeight || 1;
|
|
725
|
+
return r !== 1 || n !== 1;
|
|
726
|
+
}
|
|
727
|
+
function Jn(t, e, r) {
|
|
728
|
+
r === void 0 && (r = !1);
|
|
729
|
+
var n = K(e), i = K(e) && Xn(e), a = de(e), d = Ae(t, i, r), u = {
|
|
730
|
+
scrollLeft: 0,
|
|
731
|
+
scrollTop: 0
|
|
732
|
+
}, s = {
|
|
733
|
+
x: 0,
|
|
734
|
+
y: 0
|
|
735
|
+
};
|
|
736
|
+
return (n || !n && !r) && ((re(e) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
|
|
737
|
+
Bt(a)) && (u = Yn(e)), K(e) ? (s = Ae(e, !0), s.x += e.clientLeft, s.y += e.clientTop) : a && (s.x = jt(a))), {
|
|
738
|
+
x: d.left + u.scrollLeft - s.x,
|
|
739
|
+
y: d.top + u.scrollTop - s.y,
|
|
740
|
+
width: d.width,
|
|
741
|
+
height: d.height
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
function Qn(t) {
|
|
745
|
+
var e = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), n = [];
|
|
746
|
+
t.forEach(function(a) {
|
|
747
|
+
e.set(a.name, a);
|
|
748
|
+
});
|
|
749
|
+
function i(a) {
|
|
750
|
+
r.add(a.name);
|
|
751
|
+
var d = [].concat(a.requires || [], a.requiresIfExists || []);
|
|
752
|
+
d.forEach(function(u) {
|
|
753
|
+
if (!r.has(u)) {
|
|
754
|
+
var s = e.get(u);
|
|
755
|
+
s && i(s);
|
|
756
|
+
}
|
|
757
|
+
}), n.push(a);
|
|
758
|
+
}
|
|
759
|
+
return t.forEach(function(a) {
|
|
760
|
+
r.has(a.name) || i(a);
|
|
761
|
+
}), n;
|
|
762
|
+
}
|
|
763
|
+
function Zn(t) {
|
|
764
|
+
var e = Qn(t);
|
|
765
|
+
return dn.reduce(function(r, n) {
|
|
766
|
+
return r.concat(e.filter(function(i) {
|
|
767
|
+
return i.phase === n;
|
|
768
|
+
}));
|
|
769
|
+
}, []);
|
|
770
|
+
}
|
|
771
|
+
function ei(t) {
|
|
772
|
+
var e;
|
|
773
|
+
return function() {
|
|
774
|
+
return e || (e = new Promise(function(r) {
|
|
775
|
+
Promise.resolve().then(function() {
|
|
776
|
+
e = void 0, r(t());
|
|
777
|
+
});
|
|
778
|
+
})), e;
|
|
779
|
+
};
|
|
780
|
+
}
|
|
781
|
+
function ti(t) {
|
|
782
|
+
var e = t.reduce(function(r, n) {
|
|
783
|
+
var i = r[n.name];
|
|
784
|
+
return r[n.name] = i ? Object.assign({}, i, n, {
|
|
785
|
+
options: Object.assign({}, i.options, n.options),
|
|
786
|
+
data: Object.assign({}, i.data, n.data)
|
|
787
|
+
}) : n, r;
|
|
788
|
+
}, {});
|
|
789
|
+
return Object.keys(e).map(function(r) {
|
|
790
|
+
return e[r];
|
|
791
|
+
});
|
|
792
|
+
}
|
|
793
|
+
var zt = {
|
|
794
|
+
placement: "bottom",
|
|
795
|
+
modifiers: [],
|
|
796
|
+
strategy: "absolute"
|
|
797
|
+
};
|
|
798
|
+
function Kt() {
|
|
799
|
+
for (var t = arguments.length, e = new Array(t), r = 0; r < t; r++)
|
|
800
|
+
e[r] = arguments[r];
|
|
801
|
+
return !e.some(function(n) {
|
|
802
|
+
return !(n && typeof n.getBoundingClientRect == "function");
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
function ri(t) {
|
|
806
|
+
t === void 0 && (t = {});
|
|
807
|
+
var e = t, r = e.defaultModifiers, n = r === void 0 ? [] : r, i = e.defaultOptions, a = i === void 0 ? zt : i;
|
|
808
|
+
return function(u, s, p) {
|
|
809
|
+
p === void 0 && (p = a);
|
|
810
|
+
var l = {
|
|
811
|
+
placement: "bottom",
|
|
812
|
+
orderedModifiers: [],
|
|
813
|
+
options: Object.assign({}, zt, a),
|
|
814
|
+
modifiersData: {},
|
|
815
|
+
elements: {
|
|
816
|
+
reference: u,
|
|
817
|
+
popper: s
|
|
818
|
+
},
|
|
819
|
+
attributes: {},
|
|
820
|
+
styles: {}
|
|
821
|
+
}, v = [], y = !1, h = {
|
|
822
|
+
state: l,
|
|
823
|
+
setOptions: function(D) {
|
|
824
|
+
var T = typeof D == "function" ? D(l.options) : D;
|
|
825
|
+
m(), l.options = Object.assign({}, a, l.options, T), l.scrollParents = {
|
|
826
|
+
reference: ge(u) ? Pe(u) : u.contextElement ? Pe(u.contextElement) : [],
|
|
827
|
+
popper: Pe(s)
|
|
828
|
+
};
|
|
829
|
+
var w = Zn(ti([].concat(n, l.options.modifiers)));
|
|
830
|
+
return l.orderedModifiers = w.filter(function(o) {
|
|
831
|
+
return o.enabled;
|
|
832
|
+
}), b(), h.update();
|
|
833
|
+
},
|
|
834
|
+
// Sync update – it will always be executed, even if not necessary. This
|
|
835
|
+
// is useful for low frequency updates where sync behavior simplifies the
|
|
836
|
+
// logic.
|
|
837
|
+
// For high frequency updates (e.g. `resize` and `scroll` events), always
|
|
838
|
+
// prefer the async Popper#update method
|
|
839
|
+
forceUpdate: function() {
|
|
840
|
+
if (!y) {
|
|
841
|
+
var D = l.elements, T = D.reference, w = D.popper;
|
|
842
|
+
if (Kt(T, w)) {
|
|
843
|
+
l.rects = {
|
|
844
|
+
reference: Jn(T, Fe(w), l.options.strategy === "fixed"),
|
|
845
|
+
popper: Mt(w)
|
|
846
|
+
}, l.reset = !1, l.placement = l.options.placement, l.orderedModifiers.forEach(function(L) {
|
|
847
|
+
return l.modifiersData[L.name] = Object.assign({}, L.data);
|
|
848
|
+
});
|
|
849
|
+
for (var o = 0; o < l.orderedModifiers.length; o++) {
|
|
850
|
+
if (l.reset === !0) {
|
|
851
|
+
l.reset = !1, o = -1;
|
|
852
|
+
continue;
|
|
853
|
+
}
|
|
854
|
+
var O = l.orderedModifiers[o], f = O.fn, x = O.options, _ = x === void 0 ? {} : x, C = O.name;
|
|
855
|
+
typeof f == "function" && (l = f({
|
|
856
|
+
state: l,
|
|
857
|
+
options: _,
|
|
858
|
+
name: C,
|
|
859
|
+
instance: h
|
|
860
|
+
}) || l);
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
},
|
|
865
|
+
// Async and optimistically optimized update – it will not be executed if
|
|
866
|
+
// not necessary (debounced to run at most once-per-tick)
|
|
867
|
+
update: ei(function() {
|
|
868
|
+
return new Promise(function(E) {
|
|
869
|
+
h.forceUpdate(), E(l);
|
|
870
|
+
});
|
|
871
|
+
}),
|
|
872
|
+
destroy: function() {
|
|
873
|
+
m(), y = !0;
|
|
874
|
+
}
|
|
875
|
+
};
|
|
876
|
+
if (!Kt(u, s))
|
|
877
|
+
return h;
|
|
878
|
+
h.setOptions(p).then(function(E) {
|
|
879
|
+
!y && p.onFirstUpdate && p.onFirstUpdate(E);
|
|
880
|
+
});
|
|
881
|
+
function b() {
|
|
882
|
+
l.orderedModifiers.forEach(function(E) {
|
|
883
|
+
var D = E.name, T = E.options, w = T === void 0 ? {} : T, o = E.effect;
|
|
884
|
+
if (typeof o == "function") {
|
|
885
|
+
var O = o({
|
|
886
|
+
state: l,
|
|
887
|
+
name: D,
|
|
888
|
+
instance: h,
|
|
889
|
+
options: w
|
|
890
|
+
}), f = function() {
|
|
891
|
+
};
|
|
892
|
+
v.push(O || f);
|
|
893
|
+
}
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
function m() {
|
|
897
|
+
v.forEach(function(E) {
|
|
898
|
+
return E();
|
|
899
|
+
}), v = [];
|
|
900
|
+
}
|
|
901
|
+
return h;
|
|
902
|
+
};
|
|
903
|
+
}
|
|
904
|
+
var ni = [Tn, Fn, xn, vr, kn, Pn, Kn, En, Hn], ii = /* @__PURE__ */ ri({
|
|
905
|
+
defaultModifiers: ni
|
|
906
|
+
}), oi = "tippy-box", Or = "tippy-content", ai = "tippy-backdrop", Sr = "tippy-arrow", xr = "tippy-svg-arrow", me = {
|
|
907
|
+
passive: !0,
|
|
908
|
+
capture: !0
|
|
909
|
+
}, Dr = function() {
|
|
910
|
+
return document.body;
|
|
911
|
+
};
|
|
912
|
+
function si(t, e) {
|
|
913
|
+
return {}.hasOwnProperty.call(t, e);
|
|
914
|
+
}
|
|
915
|
+
function ft(t, e, r) {
|
|
916
|
+
if (Array.isArray(t)) {
|
|
917
|
+
var n = t[e];
|
|
918
|
+
return n ?? (Array.isArray(r) ? r[e] : r);
|
|
919
|
+
}
|
|
920
|
+
return t;
|
|
921
|
+
}
|
|
922
|
+
function Pt(t, e) {
|
|
923
|
+
var r = {}.toString.call(t);
|
|
924
|
+
return r.indexOf("[object") === 0 && r.indexOf(e + "]") > -1;
|
|
925
|
+
}
|
|
926
|
+
function Tr(t, e) {
|
|
927
|
+
return typeof t == "function" ? t.apply(void 0, e) : t;
|
|
928
|
+
}
|
|
929
|
+
function Gt(t, e) {
|
|
930
|
+
if (e === 0)
|
|
931
|
+
return t;
|
|
932
|
+
var r;
|
|
933
|
+
return function(n) {
|
|
934
|
+
clearTimeout(r), r = setTimeout(function() {
|
|
935
|
+
t(n);
|
|
936
|
+
}, e);
|
|
937
|
+
};
|
|
938
|
+
}
|
|
939
|
+
function ui(t, e) {
|
|
940
|
+
var r = Object.assign({}, t);
|
|
941
|
+
return e.forEach(function(n) {
|
|
942
|
+
delete r[n];
|
|
943
|
+
}), r;
|
|
944
|
+
}
|
|
945
|
+
function ci(t) {
|
|
946
|
+
return t.split(/\s+/).filter(Boolean);
|
|
947
|
+
}
|
|
948
|
+
function De(t) {
|
|
949
|
+
return [].concat(t);
|
|
950
|
+
}
|
|
951
|
+
function Yt(t, e) {
|
|
952
|
+
t.indexOf(e) === -1 && t.push(e);
|
|
953
|
+
}
|
|
954
|
+
function li(t) {
|
|
955
|
+
return t.filter(function(e, r) {
|
|
956
|
+
return t.indexOf(e) === r;
|
|
957
|
+
});
|
|
958
|
+
}
|
|
959
|
+
function di(t) {
|
|
960
|
+
return t.split("-")[0];
|
|
961
|
+
}
|
|
962
|
+
function st(t) {
|
|
963
|
+
return [].slice.call(t);
|
|
964
|
+
}
|
|
965
|
+
function Xt(t) {
|
|
966
|
+
return Object.keys(t).reduce(function(e, r) {
|
|
967
|
+
return t[r] !== void 0 && (e[r] = t[r]), e;
|
|
968
|
+
}, {});
|
|
969
|
+
}
|
|
970
|
+
function Ie() {
|
|
971
|
+
return document.createElement("div");
|
|
972
|
+
}
|
|
973
|
+
function $e(t) {
|
|
974
|
+
return ["Element", "Fragment"].some(function(e) {
|
|
975
|
+
return Pt(t, e);
|
|
976
|
+
});
|
|
977
|
+
}
|
|
978
|
+
function fi(t) {
|
|
979
|
+
return Pt(t, "NodeList");
|
|
980
|
+
}
|
|
981
|
+
function pi(t) {
|
|
982
|
+
return Pt(t, "MouseEvent");
|
|
983
|
+
}
|
|
984
|
+
function vi(t) {
|
|
985
|
+
return !!(t && t._tippy && t._tippy.reference === t);
|
|
986
|
+
}
|
|
987
|
+
function hi(t) {
|
|
988
|
+
return $e(t) ? [t] : fi(t) ? st(t) : Array.isArray(t) ? t : st(document.querySelectorAll(t));
|
|
989
|
+
}
|
|
990
|
+
function pt(t, e) {
|
|
991
|
+
t.forEach(function(r) {
|
|
992
|
+
r && (r.style.transitionDuration = e + "ms");
|
|
993
|
+
});
|
|
994
|
+
}
|
|
995
|
+
function Jt(t, e) {
|
|
996
|
+
t.forEach(function(r) {
|
|
997
|
+
r && r.setAttribute("data-state", e);
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
function mi(t) {
|
|
1001
|
+
var e, r = De(t), n = r[0];
|
|
1002
|
+
return n != null && (e = n.ownerDocument) != null && e.body ? n.ownerDocument : document;
|
|
1003
|
+
}
|
|
1004
|
+
function yi(t, e) {
|
|
1005
|
+
var r = e.clientX, n = e.clientY;
|
|
1006
|
+
return t.every(function(i) {
|
|
1007
|
+
var a = i.popperRect, d = i.popperState, u = i.props, s = u.interactiveBorder, p = di(d.placement), l = d.modifiersData.offset;
|
|
1008
|
+
if (!l)
|
|
1009
|
+
return !0;
|
|
1010
|
+
var v = p === "bottom" ? l.top.y : 0, y = p === "top" ? l.bottom.y : 0, h = p === "right" ? l.left.x : 0, b = p === "left" ? l.right.x : 0, m = a.top - n + v > s, E = n - a.bottom - y > s, D = a.left - r + h > s, T = r - a.right - b > s;
|
|
1011
|
+
return m || E || D || T;
|
|
1012
|
+
});
|
|
1013
|
+
}
|
|
1014
|
+
function vt(t, e, r) {
|
|
1015
|
+
var n = e + "EventListener";
|
|
1016
|
+
["transitionend", "webkitTransitionEnd"].forEach(function(i) {
|
|
1017
|
+
t[n](i, r);
|
|
1018
|
+
});
|
|
1019
|
+
}
|
|
1020
|
+
function Qt(t, e) {
|
|
1021
|
+
for (var r = e; r; ) {
|
|
1022
|
+
var n;
|
|
1023
|
+
if (t.contains(r))
|
|
1024
|
+
return !0;
|
|
1025
|
+
r = r.getRootNode == null || (n = r.getRootNode()) == null ? void 0 : n.host;
|
|
1026
|
+
}
|
|
1027
|
+
return !1;
|
|
1028
|
+
}
|
|
1029
|
+
var ee = {
|
|
1030
|
+
isTouch: !1
|
|
1031
|
+
}, Zt = 0;
|
|
1032
|
+
function gi() {
|
|
1033
|
+
ee.isTouch || (ee.isTouch = !0, window.performance && document.addEventListener("mousemove", Cr));
|
|
1034
|
+
}
|
|
1035
|
+
function Cr() {
|
|
1036
|
+
var t = performance.now();
|
|
1037
|
+
t - Zt < 20 && (ee.isTouch = !1, document.removeEventListener("mousemove", Cr)), Zt = t;
|
|
1038
|
+
}
|
|
1039
|
+
function bi() {
|
|
1040
|
+
var t = document.activeElement;
|
|
1041
|
+
if (vi(t)) {
|
|
1042
|
+
var e = t._tippy;
|
|
1043
|
+
t.blur && !e.state.isVisible && t.blur();
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
function Ei() {
|
|
1047
|
+
document.addEventListener("touchstart", gi, me), window.addEventListener("blur", bi);
|
|
1048
|
+
}
|
|
1049
|
+
var wi = typeof window < "u" && typeof document < "u", Oi = wi ? (
|
|
1050
|
+
// @ts-ignore
|
|
1051
|
+
!!window.msCrypto
|
|
1052
|
+
) : !1;
|
|
1053
|
+
function xe(t) {
|
|
1054
|
+
var e = t === "destroy" ? "n already-" : " ";
|
|
1055
|
+
return [t + "() was called on a" + e + "destroyed instance. This is a no-op but", "indicates a potential memory leak."].join(" ");
|
|
1056
|
+
}
|
|
1057
|
+
function er(t) {
|
|
1058
|
+
var e = /[ \t]{2,}/g, r = /^[ \t]*/gm;
|
|
1059
|
+
return t.replace(e, " ").replace(r, "").trim();
|
|
1060
|
+
}
|
|
1061
|
+
function Si(t) {
|
|
1062
|
+
return er(`
|
|
1063
|
+
%ctippy.js
|
|
1064
|
+
|
|
1065
|
+
%c` + er(t) + `
|
|
1066
|
+
|
|
1067
|
+
%c👷 This is a development-only message. It will be removed in production.
|
|
1068
|
+
`);
|
|
1069
|
+
}
|
|
1070
|
+
function Ar(t) {
|
|
1071
|
+
return [
|
|
1072
|
+
Si(t),
|
|
1073
|
+
// title
|
|
1074
|
+
"color: #00C584; font-size: 1.3em; font-weight: bold;",
|
|
1075
|
+
// message
|
|
1076
|
+
"line-height: 1.5",
|
|
1077
|
+
// footer
|
|
1078
|
+
"color: #a6a095;"
|
|
1079
|
+
];
|
|
1080
|
+
}
|
|
1081
|
+
var ke;
|
|
1082
|
+
process.env.NODE_ENV !== "production" && xi();
|
|
1083
|
+
function xi() {
|
|
1084
|
+
ke = /* @__PURE__ */ new Set();
|
|
1085
|
+
}
|
|
1086
|
+
function se(t, e) {
|
|
1087
|
+
if (t && !ke.has(e)) {
|
|
1088
|
+
var r;
|
|
1089
|
+
ke.add(e), (r = console).warn.apply(r, Ar(e));
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
function Ot(t, e) {
|
|
1093
|
+
if (t && !ke.has(e)) {
|
|
1094
|
+
var r;
|
|
1095
|
+
ke.add(e), (r = console).error.apply(r, Ar(e));
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
function Di(t) {
|
|
1099
|
+
var e = !t, r = Object.prototype.toString.call(t) === "[object Object]" && !t.addEventListener;
|
|
1100
|
+
Ot(e, ["tippy() was passed", "`" + String(t) + "`", "as its targets (first) argument. Valid types are: String, Element,", "Element[], or NodeList."].join(" ")), Ot(r, ["tippy() was passed a plain object which is not supported as an argument", "for virtual positioning. Use props.getReferenceClientRect instead."].join(" "));
|
|
1101
|
+
}
|
|
1102
|
+
var _r = {
|
|
1103
|
+
animateFill: !1,
|
|
1104
|
+
followCursor: !1,
|
|
1105
|
+
inlinePositioning: !1,
|
|
1106
|
+
sticky: !1
|
|
1107
|
+
}, Ti = {
|
|
1108
|
+
allowHTML: !1,
|
|
1109
|
+
animation: "fade",
|
|
1110
|
+
arrow: !0,
|
|
1111
|
+
content: "",
|
|
1112
|
+
inertia: !1,
|
|
1113
|
+
maxWidth: 350,
|
|
1114
|
+
role: "tooltip",
|
|
1115
|
+
theme: "",
|
|
1116
|
+
zIndex: 9999
|
|
1117
|
+
}, F = Object.assign({
|
|
1118
|
+
appendTo: Dr,
|
|
1119
|
+
aria: {
|
|
1120
|
+
content: "auto",
|
|
1121
|
+
expanded: "auto"
|
|
1122
|
+
},
|
|
1123
|
+
delay: 0,
|
|
1124
|
+
duration: [300, 250],
|
|
1125
|
+
getReferenceClientRect: null,
|
|
1126
|
+
hideOnClick: !0,
|
|
1127
|
+
ignoreAttributes: !1,
|
|
1128
|
+
interactive: !1,
|
|
1129
|
+
interactiveBorder: 2,
|
|
1130
|
+
interactiveDebounce: 0,
|
|
1131
|
+
moveTransition: "",
|
|
1132
|
+
offset: [0, 10],
|
|
1133
|
+
onAfterUpdate: function() {
|
|
1134
|
+
},
|
|
1135
|
+
onBeforeUpdate: function() {
|
|
1136
|
+
},
|
|
1137
|
+
onCreate: function() {
|
|
1138
|
+
},
|
|
1139
|
+
onDestroy: function() {
|
|
1140
|
+
},
|
|
1141
|
+
onHidden: function() {
|
|
1142
|
+
},
|
|
1143
|
+
onHide: function() {
|
|
1144
|
+
},
|
|
1145
|
+
onMount: function() {
|
|
1146
|
+
},
|
|
1147
|
+
onShow: function() {
|
|
1148
|
+
},
|
|
1149
|
+
onShown: function() {
|
|
1150
|
+
},
|
|
1151
|
+
onTrigger: function() {
|
|
1152
|
+
},
|
|
1153
|
+
onUntrigger: function() {
|
|
1154
|
+
},
|
|
1155
|
+
onClickOutside: function() {
|
|
1156
|
+
},
|
|
1157
|
+
placement: "top",
|
|
1158
|
+
plugins: [],
|
|
1159
|
+
popperOptions: {},
|
|
1160
|
+
render: null,
|
|
1161
|
+
showOnCreate: !1,
|
|
1162
|
+
touch: !0,
|
|
1163
|
+
trigger: "mouseenter focus",
|
|
1164
|
+
triggerTarget: null
|
|
1165
|
+
}, _r, Ti), Ci = Object.keys(F), Ai = function(e) {
|
|
1166
|
+
process.env.NODE_ENV !== "production" && Lr(e, []);
|
|
1167
|
+
var r = Object.keys(e);
|
|
1168
|
+
r.forEach(function(n) {
|
|
1169
|
+
F[n] = e[n];
|
|
1170
|
+
});
|
|
1171
|
+
};
|
|
1172
|
+
function Rr(t) {
|
|
1173
|
+
var e = t.plugins || [], r = e.reduce(function(n, i) {
|
|
1174
|
+
var a = i.name, d = i.defaultValue;
|
|
1175
|
+
if (a) {
|
|
1176
|
+
var u;
|
|
1177
|
+
n[a] = t[a] !== void 0 ? t[a] : (u = F[a]) != null ? u : d;
|
|
1178
|
+
}
|
|
1179
|
+
return n;
|
|
1180
|
+
}, {});
|
|
1181
|
+
return Object.assign({}, t, r);
|
|
1182
|
+
}
|
|
1183
|
+
function _i(t, e) {
|
|
1184
|
+
var r = e ? Object.keys(Rr(Object.assign({}, F, {
|
|
1185
|
+
plugins: e
|
|
1186
|
+
}))) : Ci, n = r.reduce(function(i, a) {
|
|
1187
|
+
var d = (t.getAttribute("data-tippy-" + a) || "").trim();
|
|
1188
|
+
if (!d)
|
|
1189
|
+
return i;
|
|
1190
|
+
if (a === "content")
|
|
1191
|
+
i[a] = d;
|
|
1192
|
+
else
|
|
1193
|
+
try {
|
|
1194
|
+
i[a] = JSON.parse(d);
|
|
1195
|
+
} catch {
|
|
1196
|
+
i[a] = d;
|
|
1197
|
+
}
|
|
1198
|
+
return i;
|
|
1199
|
+
}, {});
|
|
1200
|
+
return n;
|
|
1201
|
+
}
|
|
1202
|
+
function tr(t, e) {
|
|
1203
|
+
var r = Object.assign({}, e, {
|
|
1204
|
+
content: Tr(e.content, [t])
|
|
1205
|
+
}, e.ignoreAttributes ? {} : _i(t, e.plugins));
|
|
1206
|
+
return r.aria = Object.assign({}, F.aria, r.aria), r.aria = {
|
|
1207
|
+
expanded: r.aria.expanded === "auto" ? e.interactive : r.aria.expanded,
|
|
1208
|
+
content: r.aria.content === "auto" ? e.interactive ? null : "describedby" : r.aria.content
|
|
1209
|
+
}, r;
|
|
1210
|
+
}
|
|
1211
|
+
function Lr(t, e) {
|
|
1212
|
+
t === void 0 && (t = {}), e === void 0 && (e = []);
|
|
1213
|
+
var r = Object.keys(t);
|
|
1214
|
+
r.forEach(function(n) {
|
|
1215
|
+
var i = ui(F, Object.keys(_r)), a = !si(i, n);
|
|
1216
|
+
a && (a = e.filter(function(d) {
|
|
1217
|
+
return d.name === n;
|
|
1218
|
+
}).length === 0), se(a, ["`" + n + "`", "is not a valid prop. You may have spelled it incorrectly, or if it's", "a plugin, forgot to pass it in an array as props.plugins.", `
|
|
1219
|
+
|
|
1220
|
+
`, `All props: https://atomiks.github.io/tippyjs/v6/all-props/
|
|
1221
|
+
`, "Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "));
|
|
1222
|
+
});
|
|
1223
|
+
}
|
|
1224
|
+
var Ri = function() {
|
|
1225
|
+
return "innerHTML";
|
|
1226
|
+
};
|
|
1227
|
+
function St(t, e) {
|
|
1228
|
+
t[Ri()] = e;
|
|
1229
|
+
}
|
|
1230
|
+
function rr(t) {
|
|
1231
|
+
var e = Ie();
|
|
1232
|
+
return t === !0 ? e.className = Sr : (e.className = xr, $e(t) ? e.appendChild(t) : St(e, t)), e;
|
|
1233
|
+
}
|
|
1234
|
+
function nr(t, e) {
|
|
1235
|
+
$e(e.content) ? (St(t, ""), t.appendChild(e.content)) : typeof e.content != "function" && (e.allowHTML ? St(t, e.content) : t.textContent = e.content);
|
|
1236
|
+
}
|
|
1237
|
+
function xt(t) {
|
|
1238
|
+
var e = t.firstElementChild, r = st(e.children);
|
|
1239
|
+
return {
|
|
1240
|
+
box: e,
|
|
1241
|
+
content: r.find(function(n) {
|
|
1242
|
+
return n.classList.contains(Or);
|
|
1243
|
+
}),
|
|
1244
|
+
arrow: r.find(function(n) {
|
|
1245
|
+
return n.classList.contains(Sr) || n.classList.contains(xr);
|
|
1246
|
+
}),
|
|
1247
|
+
backdrop: r.find(function(n) {
|
|
1248
|
+
return n.classList.contains(ai);
|
|
1249
|
+
})
|
|
1250
|
+
};
|
|
1251
|
+
}
|
|
1252
|
+
function Mr(t) {
|
|
1253
|
+
var e = Ie(), r = Ie();
|
|
1254
|
+
r.className = oi, r.setAttribute("data-state", "hidden"), r.setAttribute("tabindex", "-1");
|
|
1255
|
+
var n = Ie();
|
|
1256
|
+
n.className = Or, n.setAttribute("data-state", "hidden"), nr(n, t.props), e.appendChild(r), r.appendChild(n), i(t.props, t.props);
|
|
1257
|
+
function i(a, d) {
|
|
1258
|
+
var u = xt(e), s = u.box, p = u.content, l = u.arrow;
|
|
1259
|
+
d.theme ? s.setAttribute("data-theme", d.theme) : s.removeAttribute("data-theme"), typeof d.animation == "string" ? s.setAttribute("data-animation", d.animation) : s.removeAttribute("data-animation"), d.inertia ? s.setAttribute("data-inertia", "") : s.removeAttribute("data-inertia"), s.style.maxWidth = typeof d.maxWidth == "number" ? d.maxWidth + "px" : d.maxWidth, d.role ? s.setAttribute("role", d.role) : s.removeAttribute("role"), (a.content !== d.content || a.allowHTML !== d.allowHTML) && nr(p, t.props), d.arrow ? l ? a.arrow !== d.arrow && (s.removeChild(l), s.appendChild(rr(d.arrow))) : s.appendChild(rr(d.arrow)) : l && s.removeChild(l);
|
|
1260
|
+
}
|
|
1261
|
+
return {
|
|
1262
|
+
popper: e,
|
|
1263
|
+
onUpdate: i
|
|
1264
|
+
};
|
|
1265
|
+
}
|
|
1266
|
+
Mr.$$tippy = !0;
|
|
1267
|
+
var Li = 1, it = [], ht = [];
|
|
1268
|
+
function Mi(t, e) {
|
|
1269
|
+
var r = tr(t, Object.assign({}, F, Rr(Xt(e)))), n, i, a, d = !1, u = !1, s = !1, p = !1, l, v, y, h = [], b = Gt(Ke, r.interactiveDebounce), m, E = Li++, D = null, T = li(r.plugins), w = {
|
|
1270
|
+
// Is the instance currently enabled?
|
|
1271
|
+
isEnabled: !0,
|
|
1272
|
+
// Is the tippy currently showing and not transitioning out?
|
|
1273
|
+
isVisible: !1,
|
|
1274
|
+
// Has the instance been destroyed?
|
|
1275
|
+
isDestroyed: !1,
|
|
1276
|
+
// Is the tippy currently mounted to the DOM?
|
|
1277
|
+
isMounted: !1,
|
|
1278
|
+
// Has the tippy finished transitioning in?
|
|
1279
|
+
isShown: !1
|
|
1280
|
+
}, o = {
|
|
1281
|
+
// properties
|
|
1282
|
+
id: E,
|
|
1283
|
+
reference: t,
|
|
1284
|
+
popper: Ie(),
|
|
1285
|
+
popperInstance: D,
|
|
1286
|
+
props: r,
|
|
1287
|
+
state: w,
|
|
1288
|
+
plugins: T,
|
|
1289
|
+
// methods
|
|
1290
|
+
clearDelayTimeouts: Qe,
|
|
1291
|
+
setProps: Ze,
|
|
1292
|
+
setContent: et,
|
|
1293
|
+
show: jr,
|
|
1294
|
+
hide: Br,
|
|
1295
|
+
hideWithInteractivity: Pr,
|
|
1296
|
+
enable: Ve,
|
|
1297
|
+
disable: Je,
|
|
1298
|
+
unmount: Ir,
|
|
1299
|
+
destroy: Hr
|
|
1300
|
+
};
|
|
1301
|
+
if (!r.render)
|
|
1302
|
+
return process.env.NODE_ENV !== "production" && Ot(!0, "render() function has not been supplied."), o;
|
|
1303
|
+
var O = r.render(o), f = O.popper, x = O.onUpdate;
|
|
1304
|
+
f.setAttribute("data-tippy-root", ""), f.id = "tippy-" + o.id, o.popper = f, t._tippy = o, f._tippy = o;
|
|
1305
|
+
var _ = T.map(function(c) {
|
|
1306
|
+
return c.fn(o);
|
|
1307
|
+
}), C = t.hasAttribute("aria-expanded");
|
|
1308
|
+
return we(), Q(), B(), H("onCreate", [o]), r.showOnCreate && Ne(), f.addEventListener("mouseenter", function() {
|
|
1309
|
+
o.props.interactive && o.state.isVisible && o.clearDelayTimeouts();
|
|
1310
|
+
}), f.addEventListener("mouseleave", function() {
|
|
1311
|
+
o.props.interactive && o.props.trigger.indexOf("mouseenter") >= 0 && I().addEventListener("mousemove", b);
|
|
1312
|
+
}), o;
|
|
1313
|
+
function L() {
|
|
1314
|
+
var c = o.props.touch;
|
|
1315
|
+
return Array.isArray(c) ? c : [c, 0];
|
|
1316
|
+
}
|
|
1317
|
+
function V() {
|
|
1318
|
+
return L()[0] === "hold";
|
|
1319
|
+
}
|
|
1320
|
+
function M() {
|
|
1321
|
+
var c;
|
|
1322
|
+
return !!((c = o.props.render) != null && c.$$tippy);
|
|
1323
|
+
}
|
|
1324
|
+
function N() {
|
|
1325
|
+
return m || t;
|
|
1326
|
+
}
|
|
1327
|
+
function I() {
|
|
1328
|
+
var c = N().parentNode;
|
|
1329
|
+
return c ? mi(c) : document;
|
|
1330
|
+
}
|
|
1331
|
+
function W() {
|
|
1332
|
+
return xt(f);
|
|
1333
|
+
}
|
|
1334
|
+
function j(c) {
|
|
1335
|
+
return o.state.isMounted && !o.state.isVisible || ee.isTouch || l && l.type === "focus" ? 0 : ft(o.props.delay, c ? 0 : 1, F.delay);
|
|
1336
|
+
}
|
|
1337
|
+
function B(c) {
|
|
1338
|
+
c === void 0 && (c = !1), f.style.pointerEvents = o.props.interactive && !c ? "" : "none", f.style.zIndex = "" + o.props.zIndex;
|
|
1339
|
+
}
|
|
1340
|
+
function H(c, g, S) {
|
|
1341
|
+
if (S === void 0 && (S = !0), _.forEach(function(A) {
|
|
1342
|
+
A[c] && A[c].apply(A, g);
|
|
1343
|
+
}), S) {
|
|
1344
|
+
var R;
|
|
1345
|
+
(R = o.props)[c].apply(R, g);
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
function J() {
|
|
1349
|
+
var c = o.props.aria;
|
|
1350
|
+
if (c.content) {
|
|
1351
|
+
var g = "aria-" + c.content, S = f.id, R = De(o.props.triggerTarget || t);
|
|
1352
|
+
R.forEach(function(A) {
|
|
1353
|
+
var $ = A.getAttribute(g);
|
|
1354
|
+
if (o.state.isVisible)
|
|
1355
|
+
A.setAttribute(g, $ ? $ + " " + S : S);
|
|
1356
|
+
else {
|
|
1357
|
+
var z = $ && $.replace(S, "").trim();
|
|
1358
|
+
z ? A.setAttribute(g, z) : A.removeAttribute(g);
|
|
1359
|
+
}
|
|
1360
|
+
});
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
function Q() {
|
|
1364
|
+
if (!(C || !o.props.aria.expanded)) {
|
|
1365
|
+
var c = De(o.props.triggerTarget || t);
|
|
1366
|
+
c.forEach(function(g) {
|
|
1367
|
+
o.props.interactive ? g.setAttribute("aria-expanded", o.state.isVisible && g === N() ? "true" : "false") : g.removeAttribute("aria-expanded");
|
|
1368
|
+
});
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
function fe() {
|
|
1372
|
+
I().removeEventListener("mousemove", b), it = it.filter(function(c) {
|
|
1373
|
+
return c !== b;
|
|
1374
|
+
});
|
|
1375
|
+
}
|
|
1376
|
+
function Z(c) {
|
|
1377
|
+
if (!(ee.isTouch && (s || c.type === "mousedown"))) {
|
|
1378
|
+
var g = c.composedPath && c.composedPath()[0] || c.target;
|
|
1379
|
+
if (!(o.props.interactive && Qt(f, g))) {
|
|
1380
|
+
if (De(o.props.triggerTarget || t).some(function(S) {
|
|
1381
|
+
return Qt(S, g);
|
|
1382
|
+
})) {
|
|
1383
|
+
if (ee.isTouch || o.state.isVisible && o.props.trigger.indexOf("click") >= 0)
|
|
1384
|
+
return;
|
|
1385
|
+
} else
|
|
1386
|
+
H("onClickOutside", [o, c]);
|
|
1387
|
+
o.props.hideOnClick === !0 && (o.clearDelayTimeouts(), o.hide(), u = !0, setTimeout(function() {
|
|
1388
|
+
u = !1;
|
|
1389
|
+
}), o.state.isMounted || ie());
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
function pe() {
|
|
1394
|
+
s = !0;
|
|
1395
|
+
}
|
|
1396
|
+
function ne() {
|
|
1397
|
+
s = !1;
|
|
1398
|
+
}
|
|
1399
|
+
function X() {
|
|
1400
|
+
var c = I();
|
|
1401
|
+
c.addEventListener("mousedown", Z, !0), c.addEventListener("touchend", Z, me), c.addEventListener("touchstart", ne, me), c.addEventListener("touchmove", pe, me);
|
|
1402
|
+
}
|
|
1403
|
+
function ie() {
|
|
1404
|
+
var c = I();
|
|
1405
|
+
c.removeEventListener("mousedown", Z, !0), c.removeEventListener("touchend", Z, me), c.removeEventListener("touchstart", ne, me), c.removeEventListener("touchmove", pe, me);
|
|
1406
|
+
}
|
|
1407
|
+
function be(c, g) {
|
|
1408
|
+
Ee(c, function() {
|
|
1409
|
+
!o.state.isVisible && f.parentNode && f.parentNode.contains(f) && g();
|
|
1410
|
+
});
|
|
1411
|
+
}
|
|
1412
|
+
function oe(c, g) {
|
|
1413
|
+
Ee(c, g);
|
|
1414
|
+
}
|
|
1415
|
+
function Ee(c, g) {
|
|
1416
|
+
var S = W().box;
|
|
1417
|
+
function R(A) {
|
|
1418
|
+
A.target === S && (vt(S, "remove", R), g());
|
|
1419
|
+
}
|
|
1420
|
+
if (c === 0)
|
|
1421
|
+
return g();
|
|
1422
|
+
vt(S, "remove", v), vt(S, "add", R), v = R;
|
|
1423
|
+
}
|
|
1424
|
+
function ce(c, g, S) {
|
|
1425
|
+
S === void 0 && (S = !1);
|
|
1426
|
+
var R = De(o.props.triggerTarget || t);
|
|
1427
|
+
R.forEach(function(A) {
|
|
1428
|
+
A.addEventListener(c, g, S), h.push({
|
|
1429
|
+
node: A,
|
|
1430
|
+
eventType: c,
|
|
1431
|
+
handler: g,
|
|
1432
|
+
options: S
|
|
1433
|
+
});
|
|
1434
|
+
});
|
|
1435
|
+
}
|
|
1436
|
+
function we() {
|
|
1437
|
+
V() && (ce("touchstart", Re, {
|
|
1438
|
+
passive: !0
|
|
1439
|
+
}), ce("touchend", Ge, {
|
|
1440
|
+
passive: !0
|
|
1441
|
+
})), ci(o.props.trigger).forEach(function(c) {
|
|
1442
|
+
if (c !== "manual")
|
|
1443
|
+
switch (ce(c, Re), c) {
|
|
1444
|
+
case "mouseenter":
|
|
1445
|
+
ce("mouseleave", Ge);
|
|
1446
|
+
break;
|
|
1447
|
+
case "focus":
|
|
1448
|
+
ce(Oi ? "focusout" : "blur", Le);
|
|
1449
|
+
break;
|
|
1450
|
+
case "focusin":
|
|
1451
|
+
ce("focusout", Le);
|
|
1452
|
+
break;
|
|
1453
|
+
}
|
|
1454
|
+
});
|
|
1455
|
+
}
|
|
1456
|
+
function ze() {
|
|
1457
|
+
h.forEach(function(c) {
|
|
1458
|
+
var g = c.node, S = c.eventType, R = c.handler, A = c.options;
|
|
1459
|
+
g.removeEventListener(S, R, A);
|
|
1460
|
+
}), h = [];
|
|
1461
|
+
}
|
|
1462
|
+
function Re(c) {
|
|
1463
|
+
var g, S = !1;
|
|
1464
|
+
if (!(!o.state.isEnabled || Me(c) || u)) {
|
|
1465
|
+
var R = ((g = l) == null ? void 0 : g.type) === "focus";
|
|
1466
|
+
l = c, m = c.currentTarget, Q(), !o.state.isVisible && pi(c) && it.forEach(function(A) {
|
|
1467
|
+
return A(c);
|
|
1468
|
+
}), c.type === "click" && (o.props.trigger.indexOf("mouseenter") < 0 || d) && o.props.hideOnClick !== !1 && o.state.isVisible ? S = !0 : Ne(c), c.type === "click" && (d = !S), S && !R && ve(c);
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
function Ke(c) {
|
|
1472
|
+
var g = c.target, S = N().contains(g) || f.contains(g);
|
|
1473
|
+
if (!(c.type === "mousemove" && S)) {
|
|
1474
|
+
var R = le().concat(f).map(function(A) {
|
|
1475
|
+
var $, z = A._tippy, Oe = ($ = z.popperInstance) == null ? void 0 : $.state;
|
|
1476
|
+
return Oe ? {
|
|
1477
|
+
popperRect: A.getBoundingClientRect(),
|
|
1478
|
+
popperState: Oe,
|
|
1479
|
+
props: r
|
|
1480
|
+
} : null;
|
|
1481
|
+
}).filter(Boolean);
|
|
1482
|
+
yi(R, c) && (fe(), ve(c));
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
function Ge(c) {
|
|
1486
|
+
var g = Me(c) || o.props.trigger.indexOf("click") >= 0 && d;
|
|
1487
|
+
if (!g) {
|
|
1488
|
+
if (o.props.interactive) {
|
|
1489
|
+
o.hideWithInteractivity(c);
|
|
1490
|
+
return;
|
|
1491
|
+
}
|
|
1492
|
+
ve(c);
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
function Le(c) {
|
|
1496
|
+
o.props.trigger.indexOf("focusin") < 0 && c.target !== N() || o.props.interactive && c.relatedTarget && f.contains(c.relatedTarget) || ve(c);
|
|
1497
|
+
}
|
|
1498
|
+
function Me(c) {
|
|
1499
|
+
return ee.isTouch ? V() !== c.type.indexOf("touch") >= 0 : !1;
|
|
1500
|
+
}
|
|
1501
|
+
function Ye() {
|
|
1502
|
+
Xe();
|
|
1503
|
+
var c = o.props, g = c.popperOptions, S = c.placement, R = c.offset, A = c.getReferenceClientRect, $ = c.moveTransition, z = M() ? xt(f).arrow : null, Oe = A ? {
|
|
1504
|
+
getBoundingClientRect: A,
|
|
1505
|
+
contextElement: A.contextElement || N()
|
|
1506
|
+
} : t, It = {
|
|
1507
|
+
name: "$$tippy",
|
|
1508
|
+
enabled: !0,
|
|
1509
|
+
phase: "beforeWrite",
|
|
1510
|
+
requires: ["computeStyles"],
|
|
1511
|
+
fn: function(tt) {
|
|
1512
|
+
var Se = tt.state;
|
|
1513
|
+
if (M()) {
|
|
1514
|
+
var Wr = W(), dt = Wr.box;
|
|
1515
|
+
["placement", "reference-hidden", "escaped"].forEach(function(rt) {
|
|
1516
|
+
rt === "placement" ? dt.setAttribute("data-placement", Se.placement) : Se.attributes.popper["data-popper-" + rt] ? dt.setAttribute("data-" + rt, "") : dt.removeAttribute("data-" + rt);
|
|
1517
|
+
}), Se.attributes.popper = {};
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
}, he = [{
|
|
1521
|
+
name: "offset",
|
|
1522
|
+
options: {
|
|
1523
|
+
offset: R
|
|
1524
|
+
}
|
|
1525
|
+
}, {
|
|
1526
|
+
name: "preventOverflow",
|
|
1527
|
+
options: {
|
|
1528
|
+
padding: {
|
|
1529
|
+
top: 2,
|
|
1530
|
+
bottom: 2,
|
|
1531
|
+
left: 5,
|
|
1532
|
+
right: 5
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
}, {
|
|
1536
|
+
name: "flip",
|
|
1537
|
+
options: {
|
|
1538
|
+
padding: 5
|
|
1539
|
+
}
|
|
1540
|
+
}, {
|
|
1541
|
+
name: "computeStyles",
|
|
1542
|
+
options: {
|
|
1543
|
+
adaptive: !$
|
|
1544
|
+
}
|
|
1545
|
+
}, It];
|
|
1546
|
+
M() && z && he.push({
|
|
1547
|
+
name: "arrow",
|
|
1548
|
+
options: {
|
|
1549
|
+
element: z,
|
|
1550
|
+
padding: 3
|
|
1551
|
+
}
|
|
1552
|
+
}), he.push.apply(he, (g == null ? void 0 : g.modifiers) || []), o.popperInstance = ii(Oe, f, Object.assign({}, g, {
|
|
1553
|
+
placement: S,
|
|
1554
|
+
onFirstUpdate: y,
|
|
1555
|
+
modifiers: he
|
|
1556
|
+
}));
|
|
1557
|
+
}
|
|
1558
|
+
function Xe() {
|
|
1559
|
+
o.popperInstance && (o.popperInstance.destroy(), o.popperInstance = null);
|
|
1560
|
+
}
|
|
1561
|
+
function ae() {
|
|
1562
|
+
var c = o.props.appendTo, g, S = N();
|
|
1563
|
+
o.props.interactive && c === Dr || c === "parent" ? g = S.parentNode : g = Tr(c, [S]), g.contains(f) || g.appendChild(f), o.state.isMounted = !0, Ye(), process.env.NODE_ENV !== "production" && se(o.props.interactive && c === F.appendTo && S.nextElementSibling !== f, ["Interactive tippy element may not be accessible via keyboard", "navigation because it is not directly after the reference element", "in the DOM source order.", `
|
|
1564
|
+
|
|
1565
|
+
`, "Using a wrapper <div> or <span> tag around the reference element", "solves this by creating a new parentNode context.", `
|
|
1566
|
+
|
|
1567
|
+
`, "Specifying `appendTo: document.body` silences this warning, but it", "assumes you are using a focus management solution to handle", "keyboard navigation.", `
|
|
1568
|
+
|
|
1569
|
+
`, "See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "));
|
|
1570
|
+
}
|
|
1571
|
+
function le() {
|
|
1572
|
+
return st(f.querySelectorAll("[data-tippy-root]"));
|
|
1573
|
+
}
|
|
1574
|
+
function Ne(c) {
|
|
1575
|
+
o.clearDelayTimeouts(), c && H("onTrigger", [o, c]), X();
|
|
1576
|
+
var g = j(!0), S = L(), R = S[0], A = S[1];
|
|
1577
|
+
ee.isTouch && R === "hold" && A && (g = A), g ? n = setTimeout(function() {
|
|
1578
|
+
o.show();
|
|
1579
|
+
}, g) : o.show();
|
|
1580
|
+
}
|
|
1581
|
+
function ve(c) {
|
|
1582
|
+
if (o.clearDelayTimeouts(), H("onUntrigger", [o, c]), !o.state.isVisible) {
|
|
1583
|
+
ie();
|
|
1584
|
+
return;
|
|
1585
|
+
}
|
|
1586
|
+
if (!(o.props.trigger.indexOf("mouseenter") >= 0 && o.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(c.type) >= 0 && d)) {
|
|
1587
|
+
var g = j(!1);
|
|
1588
|
+
g ? i = setTimeout(function() {
|
|
1589
|
+
o.state.isVisible && o.hide();
|
|
1590
|
+
}, g) : a = requestAnimationFrame(function() {
|
|
1591
|
+
o.hide();
|
|
1592
|
+
});
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
function Ve() {
|
|
1596
|
+
o.state.isEnabled = !0;
|
|
1597
|
+
}
|
|
1598
|
+
function Je() {
|
|
1599
|
+
o.hide(), o.state.isEnabled = !1;
|
|
1600
|
+
}
|
|
1601
|
+
function Qe() {
|
|
1602
|
+
clearTimeout(n), clearTimeout(i), cancelAnimationFrame(a);
|
|
1603
|
+
}
|
|
1604
|
+
function Ze(c) {
|
|
1605
|
+
if (process.env.NODE_ENV !== "production" && se(o.state.isDestroyed, xe("setProps")), !o.state.isDestroyed) {
|
|
1606
|
+
H("onBeforeUpdate", [o, c]), ze();
|
|
1607
|
+
var g = o.props, S = tr(t, Object.assign({}, g, Xt(c), {
|
|
1608
|
+
ignoreAttributes: !0
|
|
1609
|
+
}));
|
|
1610
|
+
o.props = S, we(), g.interactiveDebounce !== S.interactiveDebounce && (fe(), b = Gt(Ke, S.interactiveDebounce)), g.triggerTarget && !S.triggerTarget ? De(g.triggerTarget).forEach(function(R) {
|
|
1611
|
+
R.removeAttribute("aria-expanded");
|
|
1612
|
+
}) : S.triggerTarget && t.removeAttribute("aria-expanded"), Q(), B(), x && x(g, S), o.popperInstance && (Ye(), le().forEach(function(R) {
|
|
1613
|
+
requestAnimationFrame(R._tippy.popperInstance.forceUpdate);
|
|
1614
|
+
})), H("onAfterUpdate", [o, c]);
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
function et(c) {
|
|
1618
|
+
o.setProps({
|
|
1619
|
+
content: c
|
|
1620
|
+
});
|
|
1621
|
+
}
|
|
1622
|
+
function jr() {
|
|
1623
|
+
process.env.NODE_ENV !== "production" && se(o.state.isDestroyed, xe("show"));
|
|
1624
|
+
var c = o.state.isVisible, g = o.state.isDestroyed, S = !o.state.isEnabled, R = ee.isTouch && !o.props.touch, A = ft(o.props.duration, 0, F.duration);
|
|
1625
|
+
if (!(c || g || S || R) && !N().hasAttribute("disabled") && (H("onShow", [o], !1), o.props.onShow(o) !== !1)) {
|
|
1626
|
+
if (o.state.isVisible = !0, M() && (f.style.visibility = "visible"), B(), X(), o.state.isMounted || (f.style.transition = "none"), M()) {
|
|
1627
|
+
var $ = W(), z = $.box, Oe = $.content;
|
|
1628
|
+
pt([z, Oe], 0);
|
|
1629
|
+
}
|
|
1630
|
+
y = function() {
|
|
1631
|
+
var he;
|
|
1632
|
+
if (!(!o.state.isVisible || p)) {
|
|
1633
|
+
if (p = !0, f.offsetHeight, f.style.transition = o.props.moveTransition, M() && o.props.animation) {
|
|
1634
|
+
var lt = W(), tt = lt.box, Se = lt.content;
|
|
1635
|
+
pt([tt, Se], A), Jt([tt, Se], "visible");
|
|
1636
|
+
}
|
|
1637
|
+
J(), Q(), Yt(ht, o), (he = o.popperInstance) == null || he.forceUpdate(), H("onMount", [o]), o.props.animation && M() && oe(A, function() {
|
|
1638
|
+
o.state.isShown = !0, H("onShown", [o]);
|
|
1639
|
+
});
|
|
1640
|
+
}
|
|
1641
|
+
}, ae();
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
function Br() {
|
|
1645
|
+
process.env.NODE_ENV !== "production" && se(o.state.isDestroyed, xe("hide"));
|
|
1646
|
+
var c = !o.state.isVisible, g = o.state.isDestroyed, S = !o.state.isEnabled, R = ft(o.props.duration, 1, F.duration);
|
|
1647
|
+
if (!(c || g || S) && (H("onHide", [o], !1), o.props.onHide(o) !== !1)) {
|
|
1648
|
+
if (o.state.isVisible = !1, o.state.isShown = !1, p = !1, d = !1, M() && (f.style.visibility = "hidden"), fe(), ie(), B(!0), M()) {
|
|
1649
|
+
var A = W(), $ = A.box, z = A.content;
|
|
1650
|
+
o.props.animation && (pt([$, z], R), Jt([$, z], "hidden"));
|
|
1651
|
+
}
|
|
1652
|
+
J(), Q(), o.props.animation ? M() && be(R, o.unmount) : o.unmount();
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
function Pr(c) {
|
|
1656
|
+
process.env.NODE_ENV !== "production" && se(o.state.isDestroyed, xe("hideWithInteractivity")), I().addEventListener("mousemove", b), Yt(it, b), b(c);
|
|
1657
|
+
}
|
|
1658
|
+
function Ir() {
|
|
1659
|
+
process.env.NODE_ENV !== "production" && se(o.state.isDestroyed, xe("unmount")), o.state.isVisible && o.hide(), o.state.isMounted && (Xe(), le().forEach(function(c) {
|
|
1660
|
+
c._tippy.unmount();
|
|
1661
|
+
}), f.parentNode && f.parentNode.removeChild(f), ht = ht.filter(function(c) {
|
|
1662
|
+
return c !== o;
|
|
1663
|
+
}), o.state.isMounted = !1, H("onHidden", [o]));
|
|
1664
|
+
}
|
|
1665
|
+
function Hr() {
|
|
1666
|
+
process.env.NODE_ENV !== "production" && se(o.state.isDestroyed, xe("destroy")), !o.state.isDestroyed && (o.clearDelayTimeouts(), o.unmount(), ze(), delete t._tippy, o.state.isDestroyed = !0, H("onDestroy", [o]));
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
function qe(t, e) {
|
|
1670
|
+
e === void 0 && (e = {});
|
|
1671
|
+
var r = F.plugins.concat(e.plugins || []);
|
|
1672
|
+
process.env.NODE_ENV !== "production" && (Di(t), Lr(e, r)), Ei();
|
|
1673
|
+
var n = Object.assign({}, e, {
|
|
1674
|
+
plugins: r
|
|
1675
|
+
}), i = hi(t);
|
|
1676
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1677
|
+
var a = $e(n.content), d = i.length > 1;
|
|
1678
|
+
se(a && d, ["tippy() was passed an Element as the `content` prop, but more than", "one tippy instance was created by this invocation. This means the", "content element will only be appended to the last tippy instance.", `
|
|
1679
|
+
|
|
1680
|
+
`, "Instead, pass the .innerHTML of the element, or use a function that", "returns a cloned version of the element instead.", `
|
|
1681
|
+
|
|
1682
|
+
`, `1) content: element.innerHTML
|
|
1683
|
+
`, "2) content: () => element.cloneNode(true)"].join(" "));
|
|
1684
|
+
}
|
|
1685
|
+
var u = i.reduce(function(s, p) {
|
|
1686
|
+
var l = p && Mi(p, n);
|
|
1687
|
+
return l && s.push(l), s;
|
|
1688
|
+
}, []);
|
|
1689
|
+
return $e(t) ? u[0] : u;
|
|
1690
|
+
}
|
|
1691
|
+
qe.defaultProps = F;
|
|
1692
|
+
qe.setDefaultProps = Ai;
|
|
1693
|
+
qe.currentInput = ee;
|
|
1694
|
+
Object.assign({}, vr, {
|
|
1695
|
+
effect: function(e) {
|
|
1696
|
+
var r = e.state, n = {
|
|
1697
|
+
popper: {
|
|
1698
|
+
position: r.options.strategy,
|
|
1699
|
+
left: "0",
|
|
1700
|
+
top: "0",
|
|
1701
|
+
margin: "0"
|
|
1702
|
+
},
|
|
1703
|
+
arrow: {
|
|
1704
|
+
position: "absolute"
|
|
1705
|
+
},
|
|
1706
|
+
reference: {}
|
|
1707
|
+
};
|
|
1708
|
+
Object.assign(r.elements.popper.style, n.popper), r.styles = n, r.elements.arrow && Object.assign(r.elements.arrow.style, n.arrow);
|
|
1709
|
+
}
|
|
1710
|
+
});
|
|
1711
|
+
qe.setDefaultProps({
|
|
1712
|
+
render: Mr
|
|
1713
|
+
});
|
|
1714
|
+
class Ni {
|
|
1715
|
+
constructor({ editor: e, element: r, view: n, tippyOptions: i = {}, updateDelay: a = 250, shouldShow: d }) {
|
|
1716
|
+
this.preventHide = !1, this.shouldShow = ({ view: u, state: s, from: p, to: l }) => {
|
|
1717
|
+
const { doc: v, selection: y } = s, { empty: h } = y, b = !v.textBetween(p, l).length && Fr(s.selection), m = this.element.contains(document.activeElement);
|
|
1718
|
+
return !(!(u.hasFocus() || m) || h || b || !this.editor.isEditable);
|
|
1719
|
+
}, this.mousedownHandler = () => {
|
|
1720
|
+
this.preventHide = !0;
|
|
1721
|
+
}, this.dragstartHandler = () => {
|
|
1722
|
+
this.hide();
|
|
1723
|
+
}, this.focusHandler = () => {
|
|
1724
|
+
setTimeout(() => this.update(this.editor.view));
|
|
1725
|
+
}, this.blurHandler = ({ event: u }) => {
|
|
1726
|
+
var s;
|
|
1727
|
+
if (this.preventHide) {
|
|
1728
|
+
this.preventHide = !1;
|
|
1729
|
+
return;
|
|
1730
|
+
}
|
|
1731
|
+
u != null && u.relatedTarget && (!((s = this.element.parentNode) === null || s === void 0) && s.contains(u.relatedTarget)) || (u == null ? void 0 : u.relatedTarget) !== this.editor.view.dom && this.hide();
|
|
1732
|
+
}, this.tippyBlurHandler = (u) => {
|
|
1733
|
+
this.blurHandler({ event: u });
|
|
1734
|
+
}, this.handleDebouncedUpdate = (u, s) => {
|
|
1735
|
+
const p = !(s != null && s.selection.eq(u.state.selection)), l = !(s != null && s.doc.eq(u.state.doc));
|
|
1736
|
+
!p && !l || (this.updateDebounceTimer && clearTimeout(this.updateDebounceTimer), this.updateDebounceTimer = window.setTimeout(() => {
|
|
1737
|
+
this.updateHandler(u, p, l, s);
|
|
1738
|
+
}, this.updateDelay));
|
|
1739
|
+
}, this.updateHandler = (u, s, p, l) => {
|
|
1740
|
+
var v, y, h;
|
|
1741
|
+
const { state: b, composing: m } = u, { selection: E } = b;
|
|
1742
|
+
if (m || !s && !p)
|
|
1743
|
+
return;
|
|
1744
|
+
this.createTooltip();
|
|
1745
|
+
const { ranges: T } = E, w = Math.min(...T.map((f) => f.$from.pos)), o = Math.max(...T.map((f) => f.$to.pos));
|
|
1746
|
+
if (!((v = this.shouldShow) === null || v === void 0 ? void 0 : v.call(this, {
|
|
1747
|
+
editor: this.editor,
|
|
1748
|
+
element: this.element,
|
|
1749
|
+
view: u,
|
|
1750
|
+
state: b,
|
|
1751
|
+
oldState: l,
|
|
1752
|
+
from: w,
|
|
1753
|
+
to: o
|
|
1754
|
+
}))) {
|
|
1755
|
+
this.hide();
|
|
1756
|
+
return;
|
|
1757
|
+
}
|
|
1758
|
+
(y = this.tippy) === null || y === void 0 || y.setProps({
|
|
1759
|
+
getReferenceClientRect: ((h = this.tippyOptions) === null || h === void 0 ? void 0 : h.getReferenceClientRect) || (() => {
|
|
1760
|
+
if (qr(b.selection)) {
|
|
1761
|
+
let f = u.nodeDOM(w);
|
|
1762
|
+
if (f) {
|
|
1763
|
+
const x = f.dataset.nodeViewWrapper ? f : f.querySelector("[data-node-view-wrapper]");
|
|
1764
|
+
if (x && (f = x.firstChild), f)
|
|
1765
|
+
return f.getBoundingClientRect();
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
return zr(u, w, o);
|
|
1769
|
+
})
|
|
1770
|
+
}), this.show();
|
|
1771
|
+
}, this.editor = e, this.element = r, this.view = n, this.updateDelay = a, d && (this.shouldShow = d), this.element.addEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.addEventListener("dragstart", this.dragstartHandler), this.editor.on("focus", this.focusHandler), this.editor.on("blur", this.blurHandler), this.tippyOptions = i, this.element.remove(), this.element.style.visibility = "visible";
|
|
1772
|
+
}
|
|
1773
|
+
createTooltip() {
|
|
1774
|
+
const { element: e } = this.editor.options, r = !!e.parentElement;
|
|
1775
|
+
this.tippy || !r || (this.tippy = qe(e, {
|
|
1776
|
+
duration: 0,
|
|
1777
|
+
getReferenceClientRect: null,
|
|
1778
|
+
content: this.element,
|
|
1779
|
+
interactive: !0,
|
|
1780
|
+
trigger: "manual",
|
|
1781
|
+
placement: "top",
|
|
1782
|
+
hideOnClick: "toggle",
|
|
1783
|
+
...this.tippyOptions
|
|
1784
|
+
}), this.tippy.popper.firstChild && this.tippy.popper.firstChild.addEventListener("blur", this.tippyBlurHandler));
|
|
1785
|
+
}
|
|
1786
|
+
update(e, r) {
|
|
1787
|
+
const { state: n } = e, i = n.selection.from !== n.selection.to;
|
|
1788
|
+
if (this.updateDelay > 0 && i) {
|
|
1789
|
+
this.handleDebouncedUpdate(e, r);
|
|
1790
|
+
return;
|
|
1791
|
+
}
|
|
1792
|
+
const a = !(r != null && r.selection.eq(e.state.selection)), d = !(r != null && r.doc.eq(e.state.doc));
|
|
1793
|
+
this.updateHandler(e, a, d, r);
|
|
1794
|
+
}
|
|
1795
|
+
show() {
|
|
1796
|
+
var e;
|
|
1797
|
+
(e = this.tippy) === null || e === void 0 || e.show();
|
|
1798
|
+
}
|
|
1799
|
+
hide() {
|
|
1800
|
+
var e;
|
|
1801
|
+
(e = this.tippy) === null || e === void 0 || e.hide();
|
|
1802
|
+
}
|
|
1803
|
+
destroy() {
|
|
1804
|
+
var e, r;
|
|
1805
|
+
!((e = this.tippy) === null || e === void 0) && e.popper.firstChild && this.tippy.popper.firstChild.removeEventListener("blur", this.tippyBlurHandler), (r = this.tippy) === null || r === void 0 || r.destroy(), this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.removeEventListener("dragstart", this.dragstartHandler), this.editor.off("focus", this.focusHandler), this.editor.off("blur", this.blurHandler);
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
const Nr = (t) => new $r({
|
|
1809
|
+
key: typeof t.pluginKey == "string" ? new kr(t.pluginKey) : t.pluginKey,
|
|
1810
|
+
view: (e) => new Ni({ view: e, ...t })
|
|
1811
|
+
});
|
|
1812
|
+
Ur.create({
|
|
1813
|
+
name: "bubbleMenu",
|
|
1814
|
+
addOptions() {
|
|
1815
|
+
return {
|
|
1816
|
+
element: null,
|
|
1817
|
+
tippyOptions: {},
|
|
1818
|
+
pluginKey: "bubbleMenu",
|
|
1819
|
+
updateDelay: void 0,
|
|
1820
|
+
shouldShow: null
|
|
1821
|
+
};
|
|
1822
|
+
},
|
|
1823
|
+
addProseMirrorPlugins() {
|
|
1824
|
+
return this.options.element ? [
|
|
1825
|
+
Nr({
|
|
1826
|
+
pluginKey: this.options.pluginKey,
|
|
1827
|
+
editor: this.editor,
|
|
1828
|
+
element: this.options.element,
|
|
1829
|
+
tippyOptions: this.options.tippyOptions,
|
|
1830
|
+
updateDelay: this.options.updateDelay,
|
|
1831
|
+
shouldShow: this.options.shouldShow
|
|
1832
|
+
})
|
|
1833
|
+
] : [];
|
|
1834
|
+
}
|
|
1835
|
+
});
|
|
1836
|
+
function Vi(t) {
|
|
1837
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
1838
|
+
}
|
|
1839
|
+
var Dt = { exports: {} }, mt = {};
|
|
1840
|
+
/**
|
|
1841
|
+
* @license React
|
|
1842
|
+
* use-sync-external-store-shim.production.min.js
|
|
1843
|
+
*
|
|
1844
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1845
|
+
*
|
|
1846
|
+
* This source code is licensed under the MIT license found in the
|
|
1847
|
+
* LICENSE file in the root directory of this source tree.
|
|
1848
|
+
*/
|
|
1849
|
+
var ir;
|
|
1850
|
+
function ji() {
|
|
1851
|
+
if (ir) return mt;
|
|
1852
|
+
ir = 1;
|
|
1853
|
+
var t = P;
|
|
1854
|
+
function e(v, y) {
|
|
1855
|
+
return v === y && (v !== 0 || 1 / v === 1 / y) || v !== v && y !== y;
|
|
1856
|
+
}
|
|
1857
|
+
var r = typeof Object.is == "function" ? Object.is : e, n = t.useState, i = t.useEffect, a = t.useLayoutEffect, d = t.useDebugValue;
|
|
1858
|
+
function u(v, y) {
|
|
1859
|
+
var h = y(), b = n({ inst: { value: h, getSnapshot: y } }), m = b[0].inst, E = b[1];
|
|
1860
|
+
return a(function() {
|
|
1861
|
+
m.value = h, m.getSnapshot = y, s(m) && E({ inst: m });
|
|
1862
|
+
}, [v, h, y]), i(function() {
|
|
1863
|
+
return s(m) && E({ inst: m }), v(function() {
|
|
1864
|
+
s(m) && E({ inst: m });
|
|
1865
|
+
});
|
|
1866
|
+
}, [v]), d(h), h;
|
|
1867
|
+
}
|
|
1868
|
+
function s(v) {
|
|
1869
|
+
var y = v.getSnapshot;
|
|
1870
|
+
v = v.value;
|
|
1871
|
+
try {
|
|
1872
|
+
var h = y();
|
|
1873
|
+
return !r(v, h);
|
|
1874
|
+
} catch {
|
|
1875
|
+
return !0;
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1878
|
+
function p(v, y) {
|
|
1879
|
+
return y();
|
|
1880
|
+
}
|
|
1881
|
+
var l = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? p : u;
|
|
1882
|
+
return mt.useSyncExternalStore = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore : l, mt;
|
|
1883
|
+
}
|
|
1884
|
+
var yt = {};
|
|
1885
|
+
/**
|
|
1886
|
+
* @license React
|
|
1887
|
+
* use-sync-external-store-shim.development.js
|
|
1888
|
+
*
|
|
1889
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1890
|
+
*
|
|
1891
|
+
* This source code is licensed under the MIT license found in the
|
|
1892
|
+
* LICENSE file in the root directory of this source tree.
|
|
1893
|
+
*/
|
|
1894
|
+
var or;
|
|
1895
|
+
function Bi() {
|
|
1896
|
+
return or || (or = 1, process.env.NODE_ENV !== "production" && function() {
|
|
1897
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
1898
|
+
var t = P, e = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
1899
|
+
function r(w) {
|
|
1900
|
+
{
|
|
1901
|
+
for (var o = arguments.length, O = new Array(o > 1 ? o - 1 : 0), f = 1; f < o; f++)
|
|
1902
|
+
O[f - 1] = arguments[f];
|
|
1903
|
+
n("error", w, O);
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
function n(w, o, O) {
|
|
1907
|
+
{
|
|
1908
|
+
var f = e.ReactDebugCurrentFrame, x = f.getStackAddendum();
|
|
1909
|
+
x !== "" && (o += "%s", O = O.concat([x]));
|
|
1910
|
+
var _ = O.map(function(C) {
|
|
1911
|
+
return String(C);
|
|
1912
|
+
});
|
|
1913
|
+
_.unshift("Warning: " + o), Function.prototype.apply.call(console[w], console, _);
|
|
1914
|
+
}
|
|
1915
|
+
}
|
|
1916
|
+
function i(w, o) {
|
|
1917
|
+
return w === o && (w !== 0 || 1 / w === 1 / o) || w !== w && o !== o;
|
|
1918
|
+
}
|
|
1919
|
+
var a = typeof Object.is == "function" ? Object.is : i, d = t.useState, u = t.useEffect, s = t.useLayoutEffect, p = t.useDebugValue, l = !1, v = !1;
|
|
1920
|
+
function y(w, o, O) {
|
|
1921
|
+
l || t.startTransition !== void 0 && (l = !0, r("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
|
|
1922
|
+
var f = o();
|
|
1923
|
+
if (!v) {
|
|
1924
|
+
var x = o();
|
|
1925
|
+
a(f, x) || (r("The result of getSnapshot should be cached to avoid an infinite loop"), v = !0);
|
|
1926
|
+
}
|
|
1927
|
+
var _ = d({
|
|
1928
|
+
inst: {
|
|
1929
|
+
value: f,
|
|
1930
|
+
getSnapshot: o
|
|
1931
|
+
}
|
|
1932
|
+
}), C = _[0].inst, L = _[1];
|
|
1933
|
+
return s(function() {
|
|
1934
|
+
C.value = f, C.getSnapshot = o, h(C) && L({
|
|
1935
|
+
inst: C
|
|
1936
|
+
});
|
|
1937
|
+
}, [w, f, o]), u(function() {
|
|
1938
|
+
h(C) && L({
|
|
1939
|
+
inst: C
|
|
1940
|
+
});
|
|
1941
|
+
var V = function() {
|
|
1942
|
+
h(C) && L({
|
|
1943
|
+
inst: C
|
|
1944
|
+
});
|
|
1945
|
+
};
|
|
1946
|
+
return w(V);
|
|
1947
|
+
}, [w]), p(f), f;
|
|
1948
|
+
}
|
|
1949
|
+
function h(w) {
|
|
1950
|
+
var o = w.getSnapshot, O = w.value;
|
|
1951
|
+
try {
|
|
1952
|
+
var f = o();
|
|
1953
|
+
return !a(O, f);
|
|
1954
|
+
} catch {
|
|
1955
|
+
return !0;
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
function b(w, o, O) {
|
|
1959
|
+
return o();
|
|
1960
|
+
}
|
|
1961
|
+
var m = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", E = !m, D = E ? b : y, T = t.useSyncExternalStore !== void 0 ? t.useSyncExternalStore : D;
|
|
1962
|
+
yt.useSyncExternalStore = T, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
1963
|
+
}()), yt;
|
|
1964
|
+
}
|
|
1965
|
+
process.env.NODE_ENV === "production" ? Dt.exports = ji() : Dt.exports = Bi();
|
|
1966
|
+
var ct = Dt.exports;
|
|
1967
|
+
const Pi = (...t) => (e) => {
|
|
1968
|
+
t.forEach((r) => {
|
|
1969
|
+
typeof r == "function" ? r(e) : r && (r.current = e);
|
|
1970
|
+
});
|
|
1971
|
+
}, Ii = ({ contentComponent: t }) => {
|
|
1972
|
+
const e = ct.useSyncExternalStore(t.subscribe, t.getSnapshot, t.getServerSnapshot);
|
|
1973
|
+
return P.createElement(P.Fragment, null, Object.values(e));
|
|
1974
|
+
};
|
|
1975
|
+
function Hi() {
|
|
1976
|
+
const t = /* @__PURE__ */ new Set();
|
|
1977
|
+
let e = {};
|
|
1978
|
+
return {
|
|
1979
|
+
/**
|
|
1980
|
+
* Subscribe to the editor instance's changes.
|
|
1981
|
+
*/
|
|
1982
|
+
subscribe(r) {
|
|
1983
|
+
return t.add(r), () => {
|
|
1984
|
+
t.delete(r);
|
|
1985
|
+
};
|
|
1986
|
+
},
|
|
1987
|
+
getSnapshot() {
|
|
1988
|
+
return e;
|
|
1989
|
+
},
|
|
1990
|
+
getServerSnapshot() {
|
|
1991
|
+
return e;
|
|
1992
|
+
},
|
|
1993
|
+
/**
|
|
1994
|
+
* Adds a new NodeView Renderer to the editor.
|
|
1995
|
+
*/
|
|
1996
|
+
setRenderer(r, n) {
|
|
1997
|
+
e = {
|
|
1998
|
+
...e,
|
|
1999
|
+
[r]: Jr.createPortal(n.reactElement, n.element, r)
|
|
2000
|
+
}, t.forEach((i) => i());
|
|
2001
|
+
},
|
|
2002
|
+
/**
|
|
2003
|
+
* Removes a NodeView Renderer from the editor.
|
|
2004
|
+
*/
|
|
2005
|
+
removeRenderer(r) {
|
|
2006
|
+
const n = { ...e };
|
|
2007
|
+
delete n[r], e = n, t.forEach((i) => i());
|
|
2008
|
+
}
|
|
2009
|
+
};
|
|
2010
|
+
}
|
|
2011
|
+
class Wi extends P.Component {
|
|
2012
|
+
constructor(e) {
|
|
2013
|
+
var r;
|
|
2014
|
+
super(e), this.editorContentRef = P.createRef(), this.initialized = !1, this.state = {
|
|
2015
|
+
hasContentComponentInitialized: !!(!((r = e.editor) === null || r === void 0) && r.contentComponent)
|
|
2016
|
+
};
|
|
2017
|
+
}
|
|
2018
|
+
componentDidMount() {
|
|
2019
|
+
this.init();
|
|
2020
|
+
}
|
|
2021
|
+
componentDidUpdate() {
|
|
2022
|
+
this.init();
|
|
2023
|
+
}
|
|
2024
|
+
init() {
|
|
2025
|
+
const e = this.props.editor;
|
|
2026
|
+
if (e && !e.isDestroyed && e.options.element) {
|
|
2027
|
+
if (e.contentComponent)
|
|
2028
|
+
return;
|
|
2029
|
+
const r = this.editorContentRef.current;
|
|
2030
|
+
r.append(...e.options.element.childNodes), e.setOptions({
|
|
2031
|
+
element: r
|
|
2032
|
+
}), e.contentComponent = Hi(), this.state.hasContentComponentInitialized || (this.unsubscribeToContentComponent = e.contentComponent.subscribe(() => {
|
|
2033
|
+
this.setState((n) => n.hasContentComponentInitialized ? n : {
|
|
2034
|
+
hasContentComponentInitialized: !0
|
|
2035
|
+
}), this.unsubscribeToContentComponent && this.unsubscribeToContentComponent();
|
|
2036
|
+
})), e.createNodeViews(), this.initialized = !0;
|
|
2037
|
+
}
|
|
2038
|
+
}
|
|
2039
|
+
componentWillUnmount() {
|
|
2040
|
+
const e = this.props.editor;
|
|
2041
|
+
if (!e || (this.initialized = !1, e.isDestroyed || e.view.setProps({
|
|
2042
|
+
nodeViews: {}
|
|
2043
|
+
}), this.unsubscribeToContentComponent && this.unsubscribeToContentComponent(), e.contentComponent = null, !e.options.element.firstChild))
|
|
2044
|
+
return;
|
|
2045
|
+
const r = document.createElement("div");
|
|
2046
|
+
r.append(...e.options.element.childNodes), e.setOptions({
|
|
2047
|
+
element: r
|
|
2048
|
+
});
|
|
2049
|
+
}
|
|
2050
|
+
render() {
|
|
2051
|
+
const { editor: e, innerRef: r, ...n } = this.props;
|
|
2052
|
+
return P.createElement(
|
|
2053
|
+
P.Fragment,
|
|
2054
|
+
null,
|
|
2055
|
+
P.createElement("div", { ref: Pi(r, this.editorContentRef), ...n }),
|
|
2056
|
+
(e == null ? void 0 : e.contentComponent) && P.createElement(Ii, { contentComponent: e.contentComponent })
|
|
2057
|
+
);
|
|
2058
|
+
}
|
|
2059
|
+
}
|
|
2060
|
+
const $i = Gr((t, e) => {
|
|
2061
|
+
const r = P.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [t.editor]);
|
|
2062
|
+
return P.createElement(Wi, {
|
|
2063
|
+
key: r,
|
|
2064
|
+
innerRef: e,
|
|
2065
|
+
...t
|
|
2066
|
+
});
|
|
2067
|
+
}), ao = P.memo($i);
|
|
2068
|
+
var ki = function t(e, r) {
|
|
2069
|
+
if (e === r) return !0;
|
|
2070
|
+
if (e && r && typeof e == "object" && typeof r == "object") {
|
|
2071
|
+
if (e.constructor !== r.constructor) return !1;
|
|
2072
|
+
var n, i, a;
|
|
2073
|
+
if (Array.isArray(e)) {
|
|
2074
|
+
if (n = e.length, n != r.length) return !1;
|
|
2075
|
+
for (i = n; i-- !== 0; )
|
|
2076
|
+
if (!t(e[i], r[i])) return !1;
|
|
2077
|
+
return !0;
|
|
2078
|
+
}
|
|
2079
|
+
if (e instanceof Map && r instanceof Map) {
|
|
2080
|
+
if (e.size !== r.size) return !1;
|
|
2081
|
+
for (i of e.entries())
|
|
2082
|
+
if (!r.has(i[0])) return !1;
|
|
2083
|
+
for (i of e.entries())
|
|
2084
|
+
if (!t(i[1], r.get(i[0]))) return !1;
|
|
2085
|
+
return !0;
|
|
2086
|
+
}
|
|
2087
|
+
if (e instanceof Set && r instanceof Set) {
|
|
2088
|
+
if (e.size !== r.size) return !1;
|
|
2089
|
+
for (i of e.entries())
|
|
2090
|
+
if (!r.has(i[0])) return !1;
|
|
2091
|
+
return !0;
|
|
2092
|
+
}
|
|
2093
|
+
if (ArrayBuffer.isView(e) && ArrayBuffer.isView(r)) {
|
|
2094
|
+
if (n = e.length, n != r.length) return !1;
|
|
2095
|
+
for (i = n; i-- !== 0; )
|
|
2096
|
+
if (e[i] !== r[i]) return !1;
|
|
2097
|
+
return !0;
|
|
2098
|
+
}
|
|
2099
|
+
if (e.constructor === RegExp) return e.source === r.source && e.flags === r.flags;
|
|
2100
|
+
if (e.valueOf !== Object.prototype.valueOf) return e.valueOf() === r.valueOf();
|
|
2101
|
+
if (e.toString !== Object.prototype.toString) return e.toString() === r.toString();
|
|
2102
|
+
if (a = Object.keys(e), n = a.length, n !== Object.keys(r).length) return !1;
|
|
2103
|
+
for (i = n; i-- !== 0; )
|
|
2104
|
+
if (!Object.prototype.hasOwnProperty.call(r, a[i])) return !1;
|
|
2105
|
+
for (i = n; i-- !== 0; ) {
|
|
2106
|
+
var d = a[i];
|
|
2107
|
+
if (!(d === "_owner" && e.$$typeof) && !t(e[d], r[d]))
|
|
2108
|
+
return !1;
|
|
2109
|
+
}
|
|
2110
|
+
return !0;
|
|
2111
|
+
}
|
|
2112
|
+
return e !== e && r !== r;
|
|
2113
|
+
}, Ui = /* @__PURE__ */ Vi(ki), Tt = { exports: {} }, gt = {};
|
|
2114
|
+
/**
|
|
2115
|
+
* @license React
|
|
2116
|
+
* use-sync-external-store-shim/with-selector.production.min.js
|
|
2117
|
+
*
|
|
2118
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
2119
|
+
*
|
|
2120
|
+
* This source code is licensed under the MIT license found in the
|
|
2121
|
+
* LICENSE file in the root directory of this source tree.
|
|
2122
|
+
*/
|
|
2123
|
+
var ar;
|
|
2124
|
+
function Fi() {
|
|
2125
|
+
if (ar) return gt;
|
|
2126
|
+
ar = 1;
|
|
2127
|
+
var t = P, e = ct;
|
|
2128
|
+
function r(p, l) {
|
|
2129
|
+
return p === l && (p !== 0 || 1 / p === 1 / l) || p !== p && l !== l;
|
|
2130
|
+
}
|
|
2131
|
+
var n = typeof Object.is == "function" ? Object.is : r, i = e.useSyncExternalStore, a = t.useRef, d = t.useEffect, u = t.useMemo, s = t.useDebugValue;
|
|
2132
|
+
return gt.useSyncExternalStoreWithSelector = function(p, l, v, y, h) {
|
|
2133
|
+
var b = a(null);
|
|
2134
|
+
if (b.current === null) {
|
|
2135
|
+
var m = { hasValue: !1, value: null };
|
|
2136
|
+
b.current = m;
|
|
2137
|
+
} else m = b.current;
|
|
2138
|
+
b = u(function() {
|
|
2139
|
+
function D(f) {
|
|
2140
|
+
if (!T) {
|
|
2141
|
+
if (T = !0, w = f, f = y(f), h !== void 0 && m.hasValue) {
|
|
2142
|
+
var x = m.value;
|
|
2143
|
+
if (h(x, f)) return o = x;
|
|
2144
|
+
}
|
|
2145
|
+
return o = f;
|
|
2146
|
+
}
|
|
2147
|
+
if (x = o, n(w, f)) return x;
|
|
2148
|
+
var _ = y(f);
|
|
2149
|
+
return h !== void 0 && h(x, _) ? x : (w = f, o = _);
|
|
2150
|
+
}
|
|
2151
|
+
var T = !1, w, o, O = v === void 0 ? null : v;
|
|
2152
|
+
return [function() {
|
|
2153
|
+
return D(l());
|
|
2154
|
+
}, O === null ? void 0 : function() {
|
|
2155
|
+
return D(O());
|
|
2156
|
+
}];
|
|
2157
|
+
}, [l, v, y, h]);
|
|
2158
|
+
var E = i(p, b[0], b[1]);
|
|
2159
|
+
return d(function() {
|
|
2160
|
+
m.hasValue = !0, m.value = E;
|
|
2161
|
+
}, [E]), s(E), E;
|
|
2162
|
+
}, gt;
|
|
2163
|
+
}
|
|
2164
|
+
var bt = {};
|
|
2165
|
+
/**
|
|
2166
|
+
* @license React
|
|
2167
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
2168
|
+
*
|
|
2169
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
2170
|
+
*
|
|
2171
|
+
* This source code is licensed under the MIT license found in the
|
|
2172
|
+
* LICENSE file in the root directory of this source tree.
|
|
2173
|
+
*/
|
|
2174
|
+
var sr;
|
|
2175
|
+
function qi() {
|
|
2176
|
+
return sr || (sr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
2177
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
2178
|
+
var t = P, e = ct;
|
|
2179
|
+
function r(l, v) {
|
|
2180
|
+
return l === v && (l !== 0 || 1 / l === 1 / v) || l !== l && v !== v;
|
|
2181
|
+
}
|
|
2182
|
+
var n = typeof Object.is == "function" ? Object.is : r, i = e.useSyncExternalStore, a = t.useRef, d = t.useEffect, u = t.useMemo, s = t.useDebugValue;
|
|
2183
|
+
function p(l, v, y, h, b) {
|
|
2184
|
+
var m = a(null), E;
|
|
2185
|
+
m.current === null ? (E = {
|
|
2186
|
+
hasValue: !1,
|
|
2187
|
+
value: null
|
|
2188
|
+
}, m.current = E) : E = m.current;
|
|
2189
|
+
var D = u(function() {
|
|
2190
|
+
var O = !1, f, x, _ = function(M) {
|
|
2191
|
+
if (!O) {
|
|
2192
|
+
O = !0, f = M;
|
|
2193
|
+
var N = h(M);
|
|
2194
|
+
if (b !== void 0 && E.hasValue) {
|
|
2195
|
+
var I = E.value;
|
|
2196
|
+
if (b(I, N))
|
|
2197
|
+
return x = I, I;
|
|
2198
|
+
}
|
|
2199
|
+
return x = N, N;
|
|
2200
|
+
}
|
|
2201
|
+
var W = f, j = x;
|
|
2202
|
+
if (n(W, M))
|
|
2203
|
+
return j;
|
|
2204
|
+
var B = h(M);
|
|
2205
|
+
return b !== void 0 && b(j, B) ? j : (f = M, x = B, B);
|
|
2206
|
+
}, C = y === void 0 ? null : y, L = function() {
|
|
2207
|
+
return _(v());
|
|
2208
|
+
}, V = C === null ? void 0 : function() {
|
|
2209
|
+
return _(C());
|
|
2210
|
+
};
|
|
2211
|
+
return [L, V];
|
|
2212
|
+
}, [v, y, h, b]), T = D[0], w = D[1], o = i(l, T, w);
|
|
2213
|
+
return d(function() {
|
|
2214
|
+
E.hasValue = !0, E.value = o;
|
|
2215
|
+
}, [o]), s(o), o;
|
|
2216
|
+
}
|
|
2217
|
+
bt.useSyncExternalStoreWithSelector = p, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
2218
|
+
}()), bt;
|
|
2219
|
+
}
|
|
2220
|
+
process.env.NODE_ENV === "production" ? Tt.exports = Fi() : Tt.exports = qi();
|
|
2221
|
+
var zi = Tt.exports;
|
|
2222
|
+
const Ki = typeof window < "u" ? Xr : _t;
|
|
2223
|
+
class Gi {
|
|
2224
|
+
constructor(e) {
|
|
2225
|
+
this.transactionNumber = 0, this.lastTransactionNumber = 0, this.subscribers = /* @__PURE__ */ new Set(), this.editor = e, this.lastSnapshot = { editor: e, transactionNumber: 0 }, this.getSnapshot = this.getSnapshot.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.watch = this.watch.bind(this), this.subscribe = this.subscribe.bind(this);
|
|
2226
|
+
}
|
|
2227
|
+
/**
|
|
2228
|
+
* Get the current editor instance.
|
|
2229
|
+
*/
|
|
2230
|
+
getSnapshot() {
|
|
2231
|
+
return this.transactionNumber === this.lastTransactionNumber ? this.lastSnapshot : (this.lastTransactionNumber = this.transactionNumber, this.lastSnapshot = { editor: this.editor, transactionNumber: this.transactionNumber }, this.lastSnapshot);
|
|
2232
|
+
}
|
|
2233
|
+
/**
|
|
2234
|
+
* Always disable the editor on the server-side.
|
|
2235
|
+
*/
|
|
2236
|
+
getServerSnapshot() {
|
|
2237
|
+
return { editor: null, transactionNumber: 0 };
|
|
2238
|
+
}
|
|
2239
|
+
/**
|
|
2240
|
+
* Subscribe to the editor instance's changes.
|
|
2241
|
+
*/
|
|
2242
|
+
subscribe(e) {
|
|
2243
|
+
return this.subscribers.add(e), () => {
|
|
2244
|
+
this.subscribers.delete(e);
|
|
2245
|
+
};
|
|
2246
|
+
}
|
|
2247
|
+
/**
|
|
2248
|
+
* Watch the editor instance for changes.
|
|
2249
|
+
*/
|
|
2250
|
+
watch(e) {
|
|
2251
|
+
if (this.editor = e, this.editor) {
|
|
2252
|
+
const r = () => {
|
|
2253
|
+
this.transactionNumber += 1, this.subscribers.forEach((i) => i());
|
|
2254
|
+
}, n = this.editor;
|
|
2255
|
+
return n.on("transaction", r), () => {
|
|
2256
|
+
n.off("transaction", r);
|
|
2257
|
+
};
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2260
|
+
}
|
|
2261
|
+
function Yi(t) {
|
|
2262
|
+
var e;
|
|
2263
|
+
const [r] = At(() => new Gi(t.editor)), n = zi.useSyncExternalStoreWithSelector(r.subscribe, r.getSnapshot, r.getServerSnapshot, t.selector, (e = t.equalityFn) !== null && e !== void 0 ? e : Ui);
|
|
2264
|
+
return Ki(() => r.watch(t.editor), [t.editor, r]), cr(n), n;
|
|
2265
|
+
}
|
|
2266
|
+
const ur = process.env.NODE_ENV !== "production", Ct = typeof window > "u", Xi = Ct || !!(typeof window < "u" && window.next);
|
|
2267
|
+
class Ji {
|
|
2268
|
+
constructor(e) {
|
|
2269
|
+
this.editor = null, this.subscriptions = /* @__PURE__ */ new Set(), this.isComponentMounted = !1, this.previousDeps = null, this.instanceId = "", this.options = e, this.subscriptions = /* @__PURE__ */ new Set(), this.setEditor(this.getInitialEditor()), this.scheduleDestroy(), this.getEditor = this.getEditor.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.subscribe = this.subscribe.bind(this), this.refreshEditorInstance = this.refreshEditorInstance.bind(this), this.scheduleDestroy = this.scheduleDestroy.bind(this), this.onRender = this.onRender.bind(this), this.createEditor = this.createEditor.bind(this);
|
|
2270
|
+
}
|
|
2271
|
+
setEditor(e) {
|
|
2272
|
+
this.editor = e, this.instanceId = Math.random().toString(36).slice(2, 9), this.subscriptions.forEach((r) => r());
|
|
2273
|
+
}
|
|
2274
|
+
getInitialEditor() {
|
|
2275
|
+
if (this.options.current.immediatelyRender === void 0)
|
|
2276
|
+
return Ct || Xi ? (ur && console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."), null) : this.createEditor();
|
|
2277
|
+
if (this.options.current.immediatelyRender && Ct && ur)
|
|
2278
|
+
throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");
|
|
2279
|
+
return this.options.current.immediatelyRender ? this.createEditor() : null;
|
|
2280
|
+
}
|
|
2281
|
+
/**
|
|
2282
|
+
* Create a new editor instance. And attach event listeners.
|
|
2283
|
+
*/
|
|
2284
|
+
createEditor() {
|
|
2285
|
+
const e = {
|
|
2286
|
+
...this.options.current,
|
|
2287
|
+
// Always call the most recent version of the callback function by default
|
|
2288
|
+
onBeforeCreate: (...n) => {
|
|
2289
|
+
var i, a;
|
|
2290
|
+
return (a = (i = this.options.current).onBeforeCreate) === null || a === void 0 ? void 0 : a.call(i, ...n);
|
|
2291
|
+
},
|
|
2292
|
+
onBlur: (...n) => {
|
|
2293
|
+
var i, a;
|
|
2294
|
+
return (a = (i = this.options.current).onBlur) === null || a === void 0 ? void 0 : a.call(i, ...n);
|
|
2295
|
+
},
|
|
2296
|
+
onCreate: (...n) => {
|
|
2297
|
+
var i, a;
|
|
2298
|
+
return (a = (i = this.options.current).onCreate) === null || a === void 0 ? void 0 : a.call(i, ...n);
|
|
2299
|
+
},
|
|
2300
|
+
onDestroy: (...n) => {
|
|
2301
|
+
var i, a;
|
|
2302
|
+
return (a = (i = this.options.current).onDestroy) === null || a === void 0 ? void 0 : a.call(i, ...n);
|
|
2303
|
+
},
|
|
2304
|
+
onFocus: (...n) => {
|
|
2305
|
+
var i, a;
|
|
2306
|
+
return (a = (i = this.options.current).onFocus) === null || a === void 0 ? void 0 : a.call(i, ...n);
|
|
2307
|
+
},
|
|
2308
|
+
onSelectionUpdate: (...n) => {
|
|
2309
|
+
var i, a;
|
|
2310
|
+
return (a = (i = this.options.current).onSelectionUpdate) === null || a === void 0 ? void 0 : a.call(i, ...n);
|
|
2311
|
+
},
|
|
2312
|
+
onTransaction: (...n) => {
|
|
2313
|
+
var i, a;
|
|
2314
|
+
return (a = (i = this.options.current).onTransaction) === null || a === void 0 ? void 0 : a.call(i, ...n);
|
|
2315
|
+
},
|
|
2316
|
+
onUpdate: (...n) => {
|
|
2317
|
+
var i, a;
|
|
2318
|
+
return (a = (i = this.options.current).onUpdate) === null || a === void 0 ? void 0 : a.call(i, ...n);
|
|
2319
|
+
},
|
|
2320
|
+
onContentError: (...n) => {
|
|
2321
|
+
var i, a;
|
|
2322
|
+
return (a = (i = this.options.current).onContentError) === null || a === void 0 ? void 0 : a.call(i, ...n);
|
|
2323
|
+
},
|
|
2324
|
+
onDrop: (...n) => {
|
|
2325
|
+
var i, a;
|
|
2326
|
+
return (a = (i = this.options.current).onDrop) === null || a === void 0 ? void 0 : a.call(i, ...n);
|
|
2327
|
+
},
|
|
2328
|
+
onPaste: (...n) => {
|
|
2329
|
+
var i, a;
|
|
2330
|
+
return (a = (i = this.options.current).onPaste) === null || a === void 0 ? void 0 : a.call(i, ...n);
|
|
2331
|
+
}
|
|
2332
|
+
};
|
|
2333
|
+
return new Kr(e);
|
|
2334
|
+
}
|
|
2335
|
+
/**
|
|
2336
|
+
* Get the current editor instance.
|
|
2337
|
+
*/
|
|
2338
|
+
getEditor() {
|
|
2339
|
+
return this.editor;
|
|
2340
|
+
}
|
|
2341
|
+
/**
|
|
2342
|
+
* Always disable the editor on the server-side.
|
|
2343
|
+
*/
|
|
2344
|
+
getServerSnapshot() {
|
|
2345
|
+
return null;
|
|
2346
|
+
}
|
|
2347
|
+
/**
|
|
2348
|
+
* Subscribe to the editor instance's changes.
|
|
2349
|
+
*/
|
|
2350
|
+
subscribe(e) {
|
|
2351
|
+
return this.subscriptions.add(e), () => {
|
|
2352
|
+
this.subscriptions.delete(e);
|
|
2353
|
+
};
|
|
2354
|
+
}
|
|
2355
|
+
/**
|
|
2356
|
+
* On each render, we will create, update, or destroy the editor instance.
|
|
2357
|
+
* @param deps The dependencies to watch for changes
|
|
2358
|
+
* @returns A cleanup function
|
|
2359
|
+
*/
|
|
2360
|
+
onRender(e) {
|
|
2361
|
+
return () => (this.isComponentMounted = !0, clearTimeout(this.scheduledDestructionTimeout), this.editor && !this.editor.isDestroyed && e.length === 0 ? this.editor.setOptions({
|
|
2362
|
+
...this.options.current,
|
|
2363
|
+
editable: this.editor.isEditable
|
|
2364
|
+
}) : this.refreshEditorInstance(e), () => {
|
|
2365
|
+
this.isComponentMounted = !1, this.scheduleDestroy();
|
|
2366
|
+
});
|
|
2367
|
+
}
|
|
2368
|
+
/**
|
|
2369
|
+
* Recreate the editor instance if the dependencies have changed.
|
|
2370
|
+
*/
|
|
2371
|
+
refreshEditorInstance(e) {
|
|
2372
|
+
if (this.editor && !this.editor.isDestroyed) {
|
|
2373
|
+
if (this.previousDeps === null) {
|
|
2374
|
+
this.previousDeps = e;
|
|
2375
|
+
return;
|
|
2376
|
+
}
|
|
2377
|
+
if (this.previousDeps.length === e.length && this.previousDeps.every((n, i) => n === e[i]))
|
|
2378
|
+
return;
|
|
2379
|
+
}
|
|
2380
|
+
this.editor && !this.editor.isDestroyed && this.editor.destroy(), this.setEditor(this.createEditor()), this.previousDeps = e;
|
|
2381
|
+
}
|
|
2382
|
+
/**
|
|
2383
|
+
* Schedule the destruction of the editor instance.
|
|
2384
|
+
* This will only destroy the editor if it was not mounted on the next tick.
|
|
2385
|
+
* This is to avoid destroying the editor instance when it's actually still mounted.
|
|
2386
|
+
*/
|
|
2387
|
+
scheduleDestroy() {
|
|
2388
|
+
const e = this.instanceId, r = this.editor;
|
|
2389
|
+
this.scheduledDestructionTimeout = setTimeout(() => {
|
|
2390
|
+
if (this.isComponentMounted && this.instanceId === e) {
|
|
2391
|
+
r && r.setOptions(this.options.current);
|
|
2392
|
+
return;
|
|
2393
|
+
}
|
|
2394
|
+
r && !r.isDestroyed && (r.destroy(), this.instanceId === e && this.setEditor(null));
|
|
2395
|
+
}, 1);
|
|
2396
|
+
}
|
|
2397
|
+
}
|
|
2398
|
+
function so(t = {}, e = []) {
|
|
2399
|
+
const r = Yr(t);
|
|
2400
|
+
r.current = t;
|
|
2401
|
+
const [n] = At(() => new Ji(r)), i = ct.useSyncExternalStore(n.subscribe, n.getEditor, n.getServerSnapshot);
|
|
2402
|
+
return cr(i), _t(n.onRender(e)), Yi({
|
|
2403
|
+
editor: i,
|
|
2404
|
+
selector: ({ transactionNumber: a }) => t.shouldRerenderOnTransaction === !1 ? null : t.immediatelyRender && a === 0 ? 0 : a + 1
|
|
2405
|
+
}), i;
|
|
2406
|
+
}
|
|
2407
|
+
const Vr = lr({
|
|
2408
|
+
editor: null
|
|
2409
|
+
});
|
|
2410
|
+
Vr.Consumer;
|
|
2411
|
+
const Qi = () => dr(Vr), uo = (t) => {
|
|
2412
|
+
const [e, r] = At(null), { editor: n } = Qi();
|
|
2413
|
+
return _t(() => {
|
|
2414
|
+
var i;
|
|
2415
|
+
if (!e || !((i = t.editor) === null || i === void 0) && i.isDestroyed || n != null && n.isDestroyed)
|
|
2416
|
+
return;
|
|
2417
|
+
const { pluginKey: a = "bubbleMenu", editor: d, tippyOptions: u = {}, updateDelay: s, shouldShow: p = null } = t, l = d || n;
|
|
2418
|
+
if (!l) {
|
|
2419
|
+
console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");
|
|
2420
|
+
return;
|
|
2421
|
+
}
|
|
2422
|
+
const v = Nr({
|
|
2423
|
+
updateDelay: s,
|
|
2424
|
+
editor: l,
|
|
2425
|
+
element: e,
|
|
2426
|
+
pluginKey: a,
|
|
2427
|
+
shouldShow: p,
|
|
2428
|
+
tippyOptions: u
|
|
2429
|
+
});
|
|
2430
|
+
return l.registerPlugin(v), () => {
|
|
2431
|
+
l.unregisterPlugin(a);
|
|
2432
|
+
};
|
|
2433
|
+
}, [t.editor, n, e]), P.createElement("div", { ref: r, className: t.className, style: { visibility: "hidden" } }, t.children);
|
|
2434
|
+
}, Zi = lr({
|
|
2435
|
+
onDragStart: void 0
|
|
2436
|
+
}), eo = () => dr(Zi);
|
|
2437
|
+
P.forwardRef((t, e) => {
|
|
2438
|
+
const { onDragStart: r } = eo(), n = t.as || "div";
|
|
2439
|
+
return (
|
|
2440
|
+
// @ts-ignore
|
|
2441
|
+
P.createElement(n, { ...t, ref: e, "data-node-view-wrapper": "", onDragStart: r, style: {
|
|
2442
|
+
whiteSpace: "normal",
|
|
2443
|
+
...t.style
|
|
2444
|
+
} })
|
|
2445
|
+
);
|
|
2446
|
+
});
|
|
2447
|
+
function to(t) {
|
|
2448
|
+
return !!(typeof t == "function" && t.prototype && t.prototype.isReactComponent);
|
|
2449
|
+
}
|
|
2450
|
+
function ro(t) {
|
|
2451
|
+
var e;
|
|
2452
|
+
return typeof t == "object" && ((e = t.$$typeof) === null || e === void 0 ? void 0 : e.toString()) === "Symbol(react.forward_ref)";
|
|
2453
|
+
}
|
|
2454
|
+
class co {
|
|
2455
|
+
/**
|
|
2456
|
+
* Immediately creates element and renders the provided React component.
|
|
2457
|
+
*/
|
|
2458
|
+
constructor(e, { editor: r, props: n = {}, as: i = "div", className: a = "" }) {
|
|
2459
|
+
this.ref = null, this.id = Math.floor(Math.random() * 4294967295).toString(), this.component = e, this.editor = r, this.props = n, this.element = document.createElement(i), this.element.classList.add("react-renderer"), a && this.element.classList.add(...a.split(" ")), this.editor.isInitialized ? Qr(() => {
|
|
2460
|
+
this.render();
|
|
2461
|
+
}) : this.render();
|
|
2462
|
+
}
|
|
2463
|
+
/**
|
|
2464
|
+
* Render the React component.
|
|
2465
|
+
*/
|
|
2466
|
+
render() {
|
|
2467
|
+
var e;
|
|
2468
|
+
const r = this.component, n = this.props, i = this.editor;
|
|
2469
|
+
(to(r) || ro(r)) && (n.ref = (a) => {
|
|
2470
|
+
this.ref = a;
|
|
2471
|
+
}), this.reactElement = P.createElement(r, { ...n }), (e = i == null ? void 0 : i.contentComponent) === null || e === void 0 || e.setRenderer(this.id, this);
|
|
2472
|
+
}
|
|
2473
|
+
/**
|
|
2474
|
+
* Re-renders the React component with new props.
|
|
2475
|
+
*/
|
|
2476
|
+
updateProps(e = {}) {
|
|
2477
|
+
this.props = {
|
|
2478
|
+
...this.props,
|
|
2479
|
+
...e
|
|
2480
|
+
}, this.render();
|
|
2481
|
+
}
|
|
2482
|
+
/**
|
|
2483
|
+
* Destroy the React component.
|
|
2484
|
+
*/
|
|
2485
|
+
destroy() {
|
|
2486
|
+
var e;
|
|
2487
|
+
const r = this.editor;
|
|
2488
|
+
(e = r == null ? void 0 : r.contentComponent) === null || e === void 0 || e.removeRenderer(this.id);
|
|
2489
|
+
}
|
|
2490
|
+
/**
|
|
2491
|
+
* Update the attributes of the element that holds the React component.
|
|
2492
|
+
*/
|
|
2493
|
+
updateAttributes(e) {
|
|
2494
|
+
Object.keys(e).forEach((r) => {
|
|
2495
|
+
this.element.setAttribute(r, e[r]);
|
|
2496
|
+
});
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
export {
|
|
2500
|
+
uo as B,
|
|
2501
|
+
ao as E,
|
|
2502
|
+
co as R,
|
|
2503
|
+
qe as t,
|
|
2504
|
+
so as u
|
|
2505
|
+
};
|