@pixelmatters/markup 1.3.4 → 1.3.6
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/README.md +8 -8
- package/dist/widget.js +1095 -1014
- package/package.json +1 -1
package/dist/widget.js
CHANGED
|
@@ -45,7 +45,7 @@ function w(e, t) {
|
|
|
45
45
|
function T(e) {
|
|
46
46
|
if (e.__P && e.__d) {
|
|
47
47
|
var n = e.__v, r = n.__e, i = [], a = [], o = v({}, n);
|
|
48
|
-
o.__v = n.__v + 1, t.vnode && t.vnode(o),
|
|
48
|
+
o.__v = n.__v + 1, t.vnode && t.vnode(o), re(e.__P, o, n, e.__n, e.__P.namespaceURI, 32 & n.__u ? [r] : null, i, r ?? w(n), !!(32 & n.__u), a), o.__v = n.__v, o.__.__k[o.__i] = o, ie(i, o, a), n.__e = n.__ = null, o.__e != r && E(o);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
function E(e) {
|
|
@@ -63,21 +63,21 @@ function O() {
|
|
|
63
63
|
r.length = O.__r = 0;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function k(e, t, n, r, i, a, o, s, c, l, u) {
|
|
67
67
|
var d, f, p, g, _, v, y, b = r && r.__k || h, x = t.length;
|
|
68
|
-
for (c =
|
|
68
|
+
for (c = A(n, t, b, c, x), d = 0; d < x; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && b[p.__i] || m, p.__i = d, v = re(e, p, f, i, a, o, s, c, l, u), g = p.__e, p.ref && f.ref != p.ref && (f.ref && se(f.ref, null, p), u.push(p.ref, p.__c || g, p)), _ == null && g != null && (_ = g), (y = !!(4 & p.__u)) || f.__k === p.__k ? (c = j(p, c, e, y), y && f.__e && (f.__e = null)) : typeof p.type == "function" && v !== void 0 ? c = v : g && (c = g.nextSibling), p.__u &= -7);
|
|
69
69
|
return n.__e = _, c;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function A(e, t, n, r, i) {
|
|
72
72
|
var a, o, s, c, l, u = n.length, d = u, f = 0;
|
|
73
|
-
for (e.__k = Array(i), a = 0; a < i; a++) (o = t[a]) != null && typeof o != "boolean" && typeof o != "function" ? (typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? o = e.__k[a] = x(null, o, null, null, null) : _(o) ? o = e.__k[a] = x(S, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? o = e.__k[a] = x(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : e.__k[a] = o, c = a + f, o.__ = e, o.__b = e.__b + 1, s = null, (l = o.__i =
|
|
74
|
-
if (d) for (a = 0; a < u; a++) (s = n[a]) != null && !(2 & s.__u) && (s.__e == r && (r = w(s)),
|
|
73
|
+
for (e.__k = Array(i), a = 0; a < i; a++) (o = t[a]) != null && typeof o != "boolean" && typeof o != "function" ? (typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? o = e.__k[a] = x(null, o, null, null, null) : _(o) ? o = e.__k[a] = x(S, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? o = e.__k[a] = x(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : e.__k[a] = o, c = a + f, o.__ = e, o.__b = e.__b + 1, s = null, (l = o.__i = ee(o, n, c, d)) != -1 && (d--, (s = n[l]) && (s.__u |= 2)), s == null || s.__v == null ? (l == -1 && (i > u ? f-- : i < u && f++), typeof o.type != "function" && (o.__u |= 4)) : l != c && (l == c - 1 ? f-- : l == c + 1 ? f++ : (l > c ? f-- : f++, o.__u |= 4))) : e.__k[a] = null;
|
|
74
|
+
if (d) for (a = 0; a < u; a++) (s = n[a]) != null && !(2 & s.__u) && (s.__e == r && (r = w(s)), ce(s, s));
|
|
75
75
|
return r;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function j(e, t, n, r) {
|
|
78
78
|
var i, a;
|
|
79
79
|
if (typeof e.type == "function") {
|
|
80
|
-
for (i = e.__k, a = 0; i && a < i.length; a++) i[a] && (i[a].__ = e, t =
|
|
80
|
+
for (i = e.__k, a = 0; i && a < i.length; a++) i[a] && (i[a].__ = e, t = j(i[a], t, n, r));
|
|
81
81
|
return t;
|
|
82
82
|
}
|
|
83
83
|
e.__e != t && (r && (t && e.type && !t.parentNode && (t = w(e)), n.insertBefore(e.__e, t || null)), t = e.__e);
|
|
@@ -86,7 +86,7 @@ function A(e, t, n, r) {
|
|
|
86
86
|
while (t != null && t.nodeType == 8);
|
|
87
87
|
return t;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function ee(e, t, n, r) {
|
|
90
90
|
var i, a, o, s = e.key, c = e.type, l = t[n], u = l != null && (2 & l.__u) == 0;
|
|
91
91
|
if (l === null && s == null || u && s == l.key && c == l.type) return n;
|
|
92
92
|
if (r > +!!u) {
|
|
@@ -124,12 +124,12 @@ function ne(e) {
|
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
function
|
|
128
|
-
var d, f, p, m, g, b, x, w, T, E, D, O,
|
|
127
|
+
function re(e, n, r, i, a, o, s, c, l, u) {
|
|
128
|
+
var d, f, p, m, g, b, x, w, T, E, D, O, A, j, ee, M = n.type;
|
|
129
129
|
if (n.constructor !== void 0) return null;
|
|
130
130
|
128 & r.__u && (l = !!(32 & r.__u), o = [c = n.__e = r.__e]), (d = t.__b) && d(n);
|
|
131
131
|
n: if (typeof M == "function") try {
|
|
132
|
-
if (w = n.props, T = M.prototype && M.prototype.render, E = (d = M.contextType) && i[d.__c], D = d ? E ? E.props.value : d.__ : i, r.__c ? x = (f = n.__c = r.__c).__ = f.__E : (T ? n.__c = f = new M(w, D) : (n.__c = f = new C(w, D), f.constructor = M, f.render =
|
|
132
|
+
if (w = n.props, T = M.prototype && M.prototype.render, E = (d = M.contextType) && i[d.__c], D = d ? E ? E.props.value : d.__ : i, r.__c ? x = (f = n.__c = r.__c).__ = f.__E : (T ? n.__c = f = new M(w, D) : (n.__c = f = new C(w, D), f.constructor = M, f.render = le), E && E.sub(f), f.state ||= {}, f.__n = i, p = f.__d = !0, f.__h = [], f._sb = []), T && f.__s == null && (f.__s = f.state), T && M.getDerivedStateFromProps != null && (f.__s == f.state && (f.__s = v({}, f.__s)), v(f.__s, M.getDerivedStateFromProps(w, f.__s))), m = f.props, g = f.state, f.__v = n, p) T && M.getDerivedStateFromProps == null && f.componentWillMount != null && f.componentWillMount(), T && f.componentDidMount != null && f.__h.push(f.componentDidMount);
|
|
133
133
|
else {
|
|
134
134
|
if (T && M.getDerivedStateFromProps == null && w !== m && f.componentWillReceiveProps != null && f.componentWillReceiveProps(w, D), n.__v == r.__v || !f.__e && f.shouldComponentUpdate != null && !1 === f.shouldComponentUpdate(w, f.__s, D)) {
|
|
135
135
|
n.__v != r.__v && (f.props = w, f.state = f.__s, f.__d = !1), n.__e = r.__e, n.__k = r.__k, n.__k.some(function(e) {
|
|
@@ -141,30 +141,30 @@ function N(e, n, r, i, a, o, s, c, l, u) {
|
|
|
141
141
|
f.componentDidUpdate(m, g, b);
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
|
-
if (f.context = D, f.props = w, f.__P = e, f.__e = !1, O = t.__r,
|
|
144
|
+
if (f.context = D, f.props = w, f.__P = e, f.__e = !1, O = t.__r, A = 0, T) f.state = f.__s, f.__d = !1, O && O(n), d = f.render(f.props, f.state, f.context), h.push.apply(f.__h, f._sb), f._sb = [];
|
|
145
145
|
else do
|
|
146
146
|
f.__d = !1, O && O(n), d = f.render(f.props, f.state, f.context), f.state = f.__s;
|
|
147
|
-
while (f.__d && ++
|
|
148
|
-
f.state = f.__s, f.getChildContext != null && (i = v(v({}, i), f.getChildContext())), T && !p && f.getSnapshotBeforeUpdate != null && (b = f.getSnapshotBeforeUpdate(m, g)),
|
|
147
|
+
while (f.__d && ++A < 25);
|
|
148
|
+
f.state = f.__s, f.getChildContext != null && (i = v(v({}, i), f.getChildContext())), T && !p && f.getSnapshotBeforeUpdate != null && (b = f.getSnapshotBeforeUpdate(m, g)), j = d != null && d.type === S && d.key == null ? ae(d.props.children) : d, c = k(e, _(j) ? j : [j], n, r, i, a, o, s, c, l, u), f.base = n.__e, n.__u &= -161, f.__h.length && s.push(f), x && (f.__E = f.__ = null);
|
|
149
149
|
} catch (e) {
|
|
150
150
|
if (n.__v = null, l || o != null) if (e.then) {
|
|
151
151
|
for (n.__u |= l ? 160 : 128; c && c.nodeType == 8 && c.nextSibling;) c = c.nextSibling;
|
|
152
152
|
o[o.indexOf(c)] = null, n.__e = c;
|
|
153
153
|
} else {
|
|
154
|
-
for (
|
|
155
|
-
|
|
154
|
+
for (ee = o.length; ee--;) y(o[ee]);
|
|
155
|
+
N(n);
|
|
156
156
|
}
|
|
157
|
-
else n.__e = r.__e, n.__k = r.__k, e.then ||
|
|
157
|
+
else n.__e = r.__e, n.__k = r.__k, e.then || N(n);
|
|
158
158
|
t.__e(e, n, r);
|
|
159
159
|
}
|
|
160
|
-
else o == null && n.__v == r.__v ? (n.__k = r.__k, n.__e = r.__e) : c = n.__e =
|
|
160
|
+
else o == null && n.__v == r.__v ? (n.__k = r.__k, n.__e = r.__e) : c = n.__e = oe(r.__e, n, r, i, a, o, s, l, u);
|
|
161
161
|
return (d = t.diffed) && d(n), 128 & n.__u ? void 0 : c;
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(
|
|
163
|
+
function N(e) {
|
|
164
|
+
e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(N));
|
|
165
165
|
}
|
|
166
166
|
function ie(e, n, r) {
|
|
167
|
-
for (var i = 0; i < r.length; i++)
|
|
167
|
+
for (var i = 0; i < r.length; i++) se(r[i], r[++i], r[++i]);
|
|
168
168
|
t.__c && t.__c(n, e), e.some(function(n) {
|
|
169
169
|
try {
|
|
170
170
|
e = n.__h, n.__h = [], e.some(function(e) {
|
|
@@ -175,10 +175,10 @@ function ie(e, n, r) {
|
|
|
175
175
|
}
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
|
-
function
|
|
179
|
-
return typeof e != "object" || !e || e.__b > 0 ? e : _(e) ? e.map(
|
|
178
|
+
function ae(e) {
|
|
179
|
+
return typeof e != "object" || !e || e.__b > 0 ? e : _(e) ? e.map(ae) : v({}, e);
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function oe(n, r, i, a, o, s, c, l, u) {
|
|
182
182
|
var d, f, p, h, g, v, b, x = i.props || m, S = r.props, C = r.type;
|
|
183
183
|
if (C == "svg" ? o = "http://www.w3.org/2000/svg" : C == "math" ? o = "http://www.w3.org/1998/Math/MathML" : o ||= "http://www.w3.org/1999/xhtml", s != null) {
|
|
184
184
|
for (d = 0; d < s.length; d++) if ((g = s[d]) && "setAttribute" in g == !!C && (C ? g.localName == C : g.nodeType == 3)) {
|
|
@@ -196,12 +196,12 @@ function ae(n, r, i, a, o, s, c, l, u) {
|
|
|
196
196
|
for (d in x) g = x[d], d == "dangerouslySetInnerHTML" ? p = g : d == "children" || d in S || d == "value" && "defaultValue" in S || d == "checked" && "defaultChecked" in S || te(n, d, null, g, o);
|
|
197
197
|
for (d in S) g = S[d], d == "children" ? h = g : d == "dangerouslySetInnerHTML" ? f = g : d == "value" ? v = g : d == "checked" ? b = g : l && typeof g != "function" || x[d] === g || te(n, d, g, x[d], o);
|
|
198
198
|
if (f) l || p && (f.__html == p.__html || f.__html == n.innerHTML) || (n.innerHTML = f.__html), r.__k = [];
|
|
199
|
-
else if (p && (n.innerHTML = ""),
|
|
199
|
+
else if (p && (n.innerHTML = ""), k(r.type == "template" ? n.content : n, _(h) ? h : [h], r, i, a, C == "foreignObject" ? "http://www.w3.org/1999/xhtml" : o, s, c, s ? s[0] : i.__k && w(i, 0), l, u), s != null) for (d = s.length; d--;) y(s[d]);
|
|
200
200
|
l || (d = "value", C == "progress" && v == null ? n.removeAttribute("value") : v != null && (v !== n[d] || C == "progress" && !v || C == "option" && v != x[d]) && te(n, d, v, x[d], o), d = "checked", b != null && b != n[d] && te(n, d, b, x[d], o));
|
|
201
201
|
}
|
|
202
202
|
return n;
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function se(e, n, r) {
|
|
205
205
|
try {
|
|
206
206
|
if (typeof e == "function") {
|
|
207
207
|
var i = typeof e.__u == "function";
|
|
@@ -211,9 +211,9 @@ function oe(e, n, r) {
|
|
|
211
211
|
t.__e(e, r);
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function ce(e, n, r) {
|
|
215
215
|
var i, a;
|
|
216
|
-
if (t.unmount && t.unmount(e), (i = e.ref) && (i.current && i.current != e.__e ||
|
|
216
|
+
if (t.unmount && t.unmount(e), (i = e.ref) && (i.current && i.current != e.__e || se(i, null, n)), (i = e.__c) != null) {
|
|
217
217
|
if (i.componentWillUnmount) try {
|
|
218
218
|
i.componentWillUnmount();
|
|
219
219
|
} catch (e) {
|
|
@@ -221,15 +221,15 @@ function se(e, n, r) {
|
|
|
221
221
|
}
|
|
222
222
|
i.base = i.__P = null;
|
|
223
223
|
}
|
|
224
|
-
if (i = e.__k) for (a = 0; a < i.length; a++) i[a] &&
|
|
224
|
+
if (i = e.__k) for (a = 0; a < i.length; a++) i[a] && ce(i[a], n, r || typeof e.type != "function");
|
|
225
225
|
r || y(e.__e), e.__c = e.__ = e.__e = void 0;
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function le(e, t, n) {
|
|
228
228
|
return this.constructor(e, n);
|
|
229
229
|
}
|
|
230
|
-
function
|
|
230
|
+
function ue(n, r, i) {
|
|
231
231
|
var a, o, s, c;
|
|
232
|
-
r == document && (r = document.documentElement), t.__ && t.__(n, r), o = (a = typeof i == "function") ? null : i && i.__k || r.__k, s = [], c = [],
|
|
232
|
+
r == document && (r = document.documentElement), t.__ && t.__(n, r), o = (a = typeof i == "function") ? null : i && i.__k || r.__k, s = [], c = [], re(r, n = (!a && i || r).__k = b(S, null, [n]), o || m, m, r.namespaceURI, !a && i ? [i] : o ? null : r.firstChild ? e.call(r.childNodes) : null, s, !a && i ? i : o ? o.__e : r.firstChild, a, c), ie(s, n, c);
|
|
233
233
|
}
|
|
234
234
|
e = h.slice, t = { __e: function(e, t, n, r) {
|
|
235
235
|
for (var i, a, o; t = t.__;) if ((i = t.__c) && !i.__) try {
|
|
@@ -248,24 +248,24 @@ e = h.slice, t = { __e: function(e, t, n, r) {
|
|
|
248
248
|
}, O.__r = 0, s = Math.random().toString(8), c = "__d" + s, l = "__a" + s, u = /(PointerCapture)$|Capture$/i, d = 0, f = ne(!1), p = ne(!0);
|
|
249
249
|
//#endregion
|
|
250
250
|
//#region src/styles.css?inline
|
|
251
|
-
var ue = ":host{--markup-paper:#fdfcfa;--markup-ink:#1a1614;--markup-muted:#6b6661;--markup-border:#1a16141a;--markup-border-strong:#1a16142e;--markup-brand:#e35d2a;--markup-brand-hover:#c84d20;--markup-team:#2a4ac8;--markup-shadow:0 1px 2px #1a16140f, 0 8px 28px #1a16141f;--markup-overlay-tint:#1a16140a;--markup-danger:#dc2626;--markup-radius:6px;--markup-radius-sm:4px;--markup-font:\"Geist Variable\", \"Geist\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", system-ui, sans-serif;--markup-font-mono:\"Geist Mono Variable\", \"Geist Mono\", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;all:initial;font-family:var(--markup-font);color:var(--markup-ink);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:14px;line-height:1.5}:host([data-theme=dark]){--markup-paper:#1a1614;--markup-ink:#fdfcfa;--markup-muted:#a8a39e;--markup-border:#fdfcfa1f;--markup-border-strong:#fdfcfa38;--markup-team:#7b99f0;--markup-shadow:0 1px 2px #00000059, 0 12px 40px #00000073;--markup-overlay-tint:#fdfcfa0d;--markup-danger:#f87171}@media (prefers-color-scheme:dark){:host(:not([data-theme=light])){--markup-paper:#1a1614;--markup-ink:#fdfcfa;--markup-muted:#a8a39e;--markup-border:#fdfcfa1f;--markup-border-strong:#fdfcfa38;--markup-team:#7b99f0;--markup-shadow:0 1px 2px #00000059, 0 12px 40px #00000073;--markup-overlay-tint:#fdfcfa0d;--markup-danger:#f87171}}.markup-shadow-root{font-family:var(--markup-font)}.markup-shadow-root *,.markup-shadow-root :before,.markup-shadow-root :after{box-sizing:border-box}:where(.markup-shadow-root button,.markup-shadow-root input,.markup-shadow-root textarea){font:inherit;color:inherit}.markup-eyebrow{font-family:var(--markup-font-mono);letter-spacing:.12em;text-transform:uppercase;color:var(--markup-muted);font-size:10px;font-weight:500}.markup-fab{z-index:10;background:var(--markup-ink);color:var(--markup-paper);cursor:pointer;touch-action:none;letter-spacing:-.01em;pointer-events:auto;box-shadow:0 0 0 1px color-mix(in srgb, var(--markup-brand) 35%, transparent), var(--markup-shadow);border:none;border-radius:999px;align-items:center;gap:8px;padding:9px 14px;font-size:13px;font-weight:500;transition:background .15s,box-shadow .15s,transform .15s;display:inline-flex;position:fixed;bottom:24px}.markup-fab:hover{background:var(--markup-brand);box-shadow:0 0 0 1px color-mix(in srgb, var(--markup-brand) 0%, transparent), var(--markup-shadow)}.markup-fab:active{transform:translateY(1px)}.markup-fab.is-active{background:var(--markup-brand);box-shadow:var(--markup-shadow)}.markup-fab.is-active:hover{background:var(--markup-brand-hover)}.markup-fab .markup-fab-icon{color:var(--markup-brand);transition:color .15s}.markup-fab:hover .markup-fab-icon,.markup-fab.is-active .markup-fab-icon{color:var(--markup-paper)}.markup-fab-right{right:24px}.markup-fab-left{left:24px}.markup-fab.is-floating{inset:0 auto auto 0}.markup-fab.is-dragging{cursor:grabbing;transition:none}.markup-fab-icon{align-items:center;display:inline-flex}.markup-fab-label{font-family:var(--markup-font)}.markup-hud-hidden-toast{z-index:10;background:var(--markup-ink);color:var(--markup-paper);letter-spacing:-.01em;box-shadow:var(--markup-shadow);pointer-events:none;border-radius:999px;align-items:center;gap:6px;padding:8px 14px;font-size:12px;font-weight:500;animation:.22s ease-out markup-hud-hidden-in,.32s ease-in 4.6s forwards markup-hud-hidden-out;display:inline-flex;position:fixed;bottom:24px}.markup-hud-hidden-toast-right{right:24px}.markup-hud-hidden-toast-left{left:24px}.markup-kbd{background:color-mix(in srgb, var(--markup-paper) 14%, transparent);min-width:18px;height:18px;color:var(--markup-paper);font-family:var(--markup-font);border-radius:4px;justify-content:center;align-items:center;padding:0 5px;font-size:10px;font-weight:600;line-height:1;display:inline-flex}@keyframes markup-hud-hidden-in{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes markup-hud-hidden-out{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(4px)}}.markup-pins-layer{pointer-events:none;position:fixed;inset:0}.markup-pin{background:var(--markup-ink);width:28px;height:28px;color:var(--markup-brand);cursor:pointer;pointer-events:auto;box-shadow:0 0 0 2px var(--markup-paper), 0 0 0 3px color-mix(in srgb, var(--markup-brand) 35%, transparent), var(--markup-shadow);border:none;border-radius:50% 50% 50% 4px;justify-content:center;align-items:center;margin-top:-28px;padding:0;transition:transform .15s,background .15s,color .15s;display:inline-flex;position:absolute}.markup-pin:hover,.markup-pin.is-active{background:var(--markup-brand);color:var(--markup-paper)}.markup-pin.is-anchor{anchor-name:--markup-active-anchor}.markup-pin-ghost{background:var(--markup-brand);color:var(--markup-paper);cursor:default;pointer-events:none;animation:1.2s ease-in-out infinite markup-ghost-pulse}.markup-pin-dot{background:currentColor;border-radius:50%;width:6px;height:6px;display:inline-block}.markup-pin-count{background:var(--markup-brand);min-width:16px;height:16px;color:var(--markup-paper);font-family:var(--markup-font-mono);text-align:center;box-shadow:0 0 0 2px var(--markup-paper);border-radius:999px;padding:0 4px;font-size:9px;font-weight:600;line-height:16px;position:absolute;top:-4px;left:50%;transform:translate(-50%,-50%)}@keyframes markup-ghost-pulse{0%,to{box-shadow:0 0 0 2px var(--markup-paper), 0 0 0 0 #e35d2a66}50%{box-shadow:0 0 0 2px var(--markup-paper), 0 0 0 10px #e35d2a00}}.markup-placement-overlay{background:var(--markup-overlay-tint);cursor:crosshair;pointer-events:auto;z-index:1;animation:.18s ease-out markup-overlay-in;position:fixed;inset:0}.markup-placement-cursor-help{background:var(--markup-ink);color:var(--markup-paper);letter-spacing:-.01em;box-shadow:var(--markup-shadow);pointer-events:none;border-radius:999px;padding:10px 16px;font-size:12px;font-weight:500;animation:.22s ease-out 60ms backwards markup-help-in;position:fixed;top:24px;left:50%;transform:translate(-50%)}@keyframes markup-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes markup-help-in{0%{opacity:0;transform:translate(-50%,-8px)}to{opacity:1;transform:translate(-50%)}}.markup-popover{width:320px;max-width:calc(100vw - 24px);height:auto;max-height:calc(100dvh - 24px);inset:auto;left:var(--markup-pop-x,0);top:var(--markup-pop-y,0);background:var(--markup-paper);color:var(--markup-ink);border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius);box-shadow:var(--markup-shadow);pointer-events:auto;flex-direction:column;gap:0;margin:0;padding:0;animation:.16s ease-out markup-popover-in;display:flex;position:fixed;overflow:hidden}@supports (anchor-name:--x){.markup-popover{position-anchor:--markup-active-anchor;left:calc(anchor(right) + 8px);top:calc(anchor(top) - 9px);position-try-fallbacks:flip-block, flip-inline, flip-block flip-inline;position-try-order:most-block-size}.markup-popover.is-floating{left:var(--markup-pop-x,0);top:var(--markup-pop-y,0);position-try-fallbacks:none}}.markup-popover.is-hud-hidden{display:none}@keyframes markup-popover-in{0%{opacity:0;transform:translateY(-4px)scale(.98)}to{opacity:1;transform:translateY(0)scale(1)}}.markup-popover-header{border-bottom:1px solid var(--markup-border);cursor:grab;-webkit-user-select:none;user-select:none;touch-action:none;justify-content:space-between;align-items:center;padding:10px 12px;display:flex}.markup-popover.is-dragging .markup-popover-header{cursor:grabbing}.markup-popover-header-actions{align-items:center;gap:4px;display:flex}.markup-thread-menu{display:flex;position:relative}.markup-thread-menu-list{z-index:10;background:var(--markup-paper);border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius);min-width:160px;box-shadow:var(--markup-shadow);padding:4px;animation:.12s ease-out markup-menu-in;position:absolute;top:calc(100% + 6px);right:0}.markup-thread-menu-item{border-radius:var(--markup-radius-sm);width:100%;color:var(--markup-ink);text-align:left;cursor:pointer;background:0 0;border:none;padding:7px 10px;font-size:13px;transition:background .1s,color .1s;display:block}.markup-thread-menu-item:hover{background:var(--markup-border)}.markup-thread-menu-item.is-danger{color:var(--markup-danger,#dc2626)}.markup-thread-menu-item.is-danger:hover{background:color-mix(in srgb, var(--markup-danger,#dc2626) 10%, transparent)}.markup-thread-menu-item:disabled{opacity:.5;cursor:default}@keyframes markup-menu-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.markup-popover-body{padding:12px}.markup-popover-byline{color:var(--markup-muted);align-items:center;gap:4px;margin:0 0 8px;font-size:12px;display:flex}.markup-popover-name{color:var(--markup-ink);font-weight:500}.markup-icon-btn{border-radius:var(--markup-radius-sm);width:24px;height:24px;color:var(--markup-muted);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:0;transition:background .12s,color .12s;display:inline-flex}.markup-icon-btn:hover,.markup-icon-btn.is-open{background:var(--markup-border);color:var(--markup-ink)}.markup-comments{border-bottom:1px solid var(--markup-border);background:linear-gradient(var(--markup-paper), transparent) top / 100% 20px no-repeat local, linear-gradient(transparent, var(--markup-paper)) bottom / 100% 20px no-repeat local, radial-gradient(farthest-side at 50% 0%, #1a16141a, transparent) top / 100% 10px no-repeat scroll, radial-gradient(farthest-side at 50% 100%, #1a16141a, transparent) bottom / 100% 10px no-repeat scroll;flex-direction:column;gap:12px;max-height:280px;margin:0;padding:8px 12px 4px;list-style:none;display:flex;overflow-y:auto}.markup-comment{flex-direction:column;gap:4px;display:flex}.markup-comment-meta{align-items:center;gap:6px;font-size:11px;display:flex}.markup-comment-author{color:var(--markup-ink);font-weight:600}.markup-comment.is-team .markup-comment-author{color:var(--markup-team)}.markup-comment-badge{background:color-mix(in srgb, var(--markup-team) 12%, transparent);height:14px;color:var(--markup-team);font-family:var(--markup-font-mono);letter-spacing:.12em;text-transform:uppercase;border-radius:999px;align-items:center;padding:0 5px;font-size:9px;font-weight:500;line-height:1;display:inline-flex}.markup-comment-time{color:var(--markup-muted);font-family:var(--markup-font-mono);letter-spacing:.04em;font-size:10px}.markup-comment-body{white-space:pre-wrap;word-break:break-word;margin:0;font-size:13px;line-height:1.5}.markup-comment-edited{color:var(--markup-muted);font-size:11px}.markup-thread-actions{align-items:center;gap:4px;display:flex}.markup-comment-meta .markup-reaction-picker-wrap,.markup-thread-actions{margin-left:auto}.markup-comment-meta .markup-reaction-add{width:22px;height:22px;margin-top:-4px;margin-bottom:-4px}.markup-reaction-picker-wrap>.markup-icon-btn,.markup-comment-menu>.markup-icon-btn{margin-top:-4px;margin-bottom:-4px}.markup-comment-menu.is-up .markup-thread-menu-list{animation-name:markup-menu-in-up;top:auto;bottom:calc(100% + 6px)}@keyframes markup-menu-in-up{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.markup-comment{position:relative}.markup-reactions{flex-wrap:wrap;align-items:center;gap:4px;margin-top:2px;display:flex}.markup-reaction-chip{border:1px solid var(--markup-border);height:22px;color:var(--markup-ink);font:inherit;cursor:pointer;background:0 0;border-radius:999px;align-items:center;gap:4px;padding:0 7px 0 6px;font-size:11px;line-height:1;transition:background .12s,border-color .12s;display:inline-flex}.markup-reaction-chip:hover:not(:disabled){background:color-mix(in srgb, var(--markup-ink) 5%, transparent)}.markup-reaction-chip.is-mine{border-color:color-mix(in srgb, var(--markup-brand) 45%, transparent);background:color-mix(in srgb, var(--markup-brand) 10%, transparent)}.markup-reaction-chip.is-mine:hover:not(:disabled){background:color-mix(in srgb, var(--markup-brand) 16%, transparent)}.markup-reaction-chip:disabled{cursor:default;opacity:.6}.markup-reaction-emoji{font-size:13px;line-height:1}.markup-reaction-count{font-family:var(--markup-font-mono);letter-spacing:.04em;color:var(--markup-muted);font-size:10px}.markup-reaction-chip.is-mine .markup-reaction-count{color:var(--markup-brand)}.markup-reaction-picker-wrap{opacity:0;flex:none;transition:opacity .12s;display:inline-flex;position:relative}.markup-comment:hover .markup-reaction-picker-wrap,.markup-comment:focus-within .markup-reaction-picker-wrap,.markup-reaction-picker-wrap.is-open{opacity:1}.markup-reaction-add{border:1px dashed var(--markup-border-strong);width:22px;height:22px;color:var(--markup-muted);font:inherit;cursor:pointer;background:0 0;border-radius:999px;justify-content:center;align-items:center;font-size:13px;line-height:1;transition:background .12s,color .12s,border-color .12s;display:inline-flex}.markup-reaction-add:hover,.markup-reaction-add.is-open{background:color-mix(in srgb, var(--markup-ink) 5%, transparent);color:var(--markup-ink);border-style:solid}.markup-reaction-picker{z-index:1;border:1px solid var(--markup-border-strong);background:var(--markup-paper);border-radius:8px;gap:2px;padding:4px;animation:.12s markup-menu-in;display:flex;position:absolute;top:calc(100% + 6px);right:0;box-shadow:0 1px 2px #1a16140f,0 8px 28px #1a16141a}.markup-reaction-picker-wrap.is-up .markup-reaction-picker{animation-name:markup-menu-in-up;top:auto;bottom:calc(100% + 6px)}.markup-reaction-picker-item{cursor:pointer;background:0 0;border:0;border-radius:6px;justify-content:center;align-items:center;width:28px;height:28px;font-size:16px;line-height:1;transition:background .12s;display:inline-flex}.markup-reaction-picker-item:hover{background:color-mix(in srgb, var(--markup-ink) 8%, transparent)}.markup-reaction-picker-item.is-mine{background:color-mix(in srgb, var(--markup-brand) 14%, transparent)}.markup-comment-edit-form{flex-direction:column;gap:6px;display:flex}.markup-comment-edit-form .markup-textarea{border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius-sm);background:var(--markup-paper);width:100%;color:var(--markup-ink);resize:vertical;font:inherit;outline:none;padding:8px 10px;font-size:13px;line-height:1.5}.markup-comment-edit-form .markup-textarea:focus-visible{border-color:var(--markup-brand);box-shadow:0 0 0 3px #e35d2a2e}.markup-comment-edit-actions{justify-content:flex-end;gap:6px;display:flex}.markup-composer{flex-direction:column;display:flex;position:relative}.markup-composer-input{border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius-sm);background:var(--markup-paper);width:100%;min-height:36px;max-height:96px;color:var(--markup-ink);resize:none;font-family:var(--markup-font);outline:none;padding:8px 10px;font-size:13px;line-height:1.5;transition:border-color .12s,box-shadow .12s,border-bottom-left-radius .15s,border-bottom-right-radius .15s}.markup-composer-input:focus-visible{border-color:var(--markup-brand);box-shadow:0 0 0 3px #e35d2a2e}.markup-composer-input:disabled{opacity:.6}.markup-composer-input::placeholder{color:var(--markup-muted)}.markup-composer.is-filled .markup-composer-input{border-bottom-right-radius:0;border-bottom-left-radius:0}.markup-composer-footer-wrap{grid-template-rows:0fr;transition:grid-template-rows .15s;display:grid}.markup-composer.is-filled .markup-composer-footer-wrap{grid-template-rows:1fr}.markup-composer-footer{border:1px solid var(--markup-border-strong);border-radius:0 0 var(--markup-radius-sm) var(--markup-radius-sm);opacity:0;border-top:none;justify-content:space-between;align-items:center;gap:8px;padding:2px 2px 2px 10px;transition:opacity .1s;display:flex;overflow:hidden}.markup-composer.is-filled .markup-composer-footer{opacity:1;transition-delay:60ms}.markup-composer-hint{font-family:var(--markup-font-mono);letter-spacing:.06em;color:var(--markup-muted);font-size:10px}.markup-composer-error{color:var(--markup-brand)}.markup-composer-actions{align-items:center;gap:6px;display:flex}.markup-composer-actions-empty{transition:opacity .12s;position:absolute;top:3px;right:3px}.markup-composer.is-filled .markup-composer-actions-empty{opacity:0;pointer-events:none}.markup-author-prompt{flex-direction:column;gap:10px;padding:12px;display:flex}.markup-author-status{color:var(--markup-muted);margin:0;font-size:12px}.markup-input{border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius-sm);background:var(--markup-paper);width:100%;height:36px;color:var(--markup-ink);outline:none;padding:0 10px;font-size:14px;transition:border-color .12s,box-shadow .12s}.markup-input:focus-visible{border-color:var(--markup-brand);box-shadow:0 0 0 3px #e35d2a2e}.markup-btn{border-radius:var(--markup-radius-sm);height:30px;color:var(--markup-ink);cursor:pointer;letter-spacing:-.01em;white-space:nowrap;background:0 0;border:1px solid #0000;justify-content:center;align-items:center;gap:6px;padding:0 8px;font-size:12px;font-weight:500;transition:background .12s,border-color .12s,color .12s,opacity .12s;display:inline-flex}.markup-btn:disabled{opacity:.5;cursor:not-allowed}.markup-btn-primary{background:var(--markup-ink);color:var(--markup-paper)}.markup-btn-primary:hover:not(:disabled){background:var(--markup-brand)}.markup-btn-ghost{color:var(--markup-muted)}.markup-btn-ghost:hover:not(:disabled){background:var(--markup-border);color:var(--markup-ink)}.markup-screenshot-row{border-top:1px solid var(--markup-border);margin-top:8px;padding-top:8px}.markup-screenshot-status{color:var(--markup-muted);font-family:var(--markup-font-mono);letter-spacing:.06em;align-items:center;gap:5px;font-size:10px;display:flex}.markup-screenshot-toggle{cursor:pointer;color:var(--markup-muted);font-family:var(--markup-font-mono);letter-spacing:.06em;align-items:center;gap:5px;font-size:10px;transition:color .12s;display:flex}.markup-screenshot-toggle:hover{color:var(--markup-ink)}.markup-screenshot-checkbox{width:12px;height:12px;accent-color:var(--markup-brand);cursor:pointer;margin:0}.markup-screenshot-thumb{border:1px solid var(--markup-border-strong);object-fit:cover;border-radius:3px;flex-shrink:0;width:auto;height:25px;margin:-5px 0 -5px auto;display:block}.markup-comment-screenshot{border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius-sm);cursor:pointer;background:0 0;margin-top:8px;padding:0;transition:border-color .12s,opacity .12s;display:block;overflow:hidden}.markup-comment-screenshot:hover{border-color:var(--markup-brand);opacity:.9}.markup-comment-screenshot img{object-fit:cover;object-position:top;width:100%;height:auto;max-height:120px;display:block}.markup-lightbox{background:#1a1614e0;border:none;width:100%;max-width:100%;height:100%;max-height:100%;margin:0;padding:24px;position:fixed;inset:0}.markup-lightbox[open]{justify-content:center;align-items:center;display:flex}.markup-lightbox::backdrop{display:none}.markup-lightbox-img{border-radius:var(--markup-radius);object-fit:contain;max-width:100%;max-height:100%;box-shadow:var(--markup-shadow);animation:.16s ease-out markup-lightbox-in}.markup-lightbox-close{color:#fdfcfa;background:#1a161499;position:absolute;top:16px;right:16px}.markup-lightbox-close:hover{color:#fdfcfa;background:#1a1614d9}@keyframes markup-lightbox-in{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}@media (prefers-reduced-motion:reduce){.markup-fab,.markup-pin,.markup-icon-btn,.markup-btn,.markup-popover,.markup-pin-ghost,.markup-placement-overlay,.markup-placement-cursor-help,.markup-lightbox-img{transition:none;animation:none}}", F, I, de, fe, L = 0, pe = [], R = t, me = R.__b, he = R.__r, ge = R.diffed, _e = R.__c, ve = R.unmount, ye = R.__;
|
|
252
|
-
function
|
|
253
|
-
|
|
254
|
-
var n =
|
|
251
|
+
var de = ":host{--markup-paper:#fdfcfa;--markup-ink:#1a1614;--markup-muted:#6b6661;--markup-border:#1a16141a;--markup-border-strong:#1a16142e;--markup-brand:#e35d2a;--markup-brand-hover:#c84d20;--markup-team:#2a4ac8;--markup-shadow:0 1px 2px #1a16140f, 0 8px 28px #1a16141f;--markup-overlay-tint:#1a16140a;--markup-danger:#dc2626;--markup-radius:6px;--markup-radius-sm:4px;--markup-font:\"Geist Variable\", \"Geist\", ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", system-ui, sans-serif;--markup-font-mono:\"Geist Mono Variable\", \"Geist Mono\", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;all:initial;font-family:var(--markup-font);color:var(--markup-ink);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:14px;line-height:1.5}:host([data-theme=dark]){--markup-paper:#1a1614;--markup-ink:#fdfcfa;--markup-muted:#a8a39e;--markup-border:#fdfcfa1f;--markup-border-strong:#fdfcfa38;--markup-team:#7b99f0;--markup-shadow:0 1px 2px #00000059, 0 12px 40px #00000073;--markup-overlay-tint:#fdfcfa0d;--markup-danger:#f87171}@media (prefers-color-scheme:dark){:host(:not([data-theme=light])){--markup-paper:#1a1614;--markup-ink:#fdfcfa;--markup-muted:#a8a39e;--markup-border:#fdfcfa1f;--markup-border-strong:#fdfcfa38;--markup-team:#7b99f0;--markup-shadow:0 1px 2px #00000059, 0 12px 40px #00000073;--markup-overlay-tint:#fdfcfa0d;--markup-danger:#f87171}}.markup-shadow-root{font-family:var(--markup-font)}.markup-shadow-root *,.markup-shadow-root :before,.markup-shadow-root :after{box-sizing:border-box}:where(.markup-shadow-root button,.markup-shadow-root input,.markup-shadow-root textarea){font:inherit;color:inherit}.markup-eyebrow{font-family:var(--markup-font-mono);letter-spacing:.12em;text-transform:uppercase;color:var(--markup-muted);font-size:10px;font-weight:500}.markup-fab{z-index:10;background:var(--markup-ink);color:var(--markup-paper);cursor:pointer;touch-action:none;letter-spacing:-.01em;pointer-events:auto;box-shadow:0 0 0 1px color-mix(in srgb, var(--markup-brand) 35%, transparent), var(--markup-shadow);border:none;border-radius:999px;align-items:center;gap:8px;padding:9px 14px;font-size:13px;font-weight:500;transition:background .15s,box-shadow .15s,transform .15s;display:inline-flex;position:fixed;bottom:24px}.markup-fab:hover{background:var(--markup-brand);box-shadow:0 0 0 1px color-mix(in srgb, var(--markup-brand) 0%, transparent), var(--markup-shadow)}.markup-fab:active{transform:translateY(1px)}.markup-fab.is-active{background:var(--markup-brand);box-shadow:var(--markup-shadow)}.markup-fab.is-active:hover{background:var(--markup-brand-hover)}.markup-fab .markup-fab-icon{color:var(--markup-brand);transition:color .15s}.markup-fab:hover .markup-fab-icon,.markup-fab.is-active .markup-fab-icon{color:var(--markup-paper)}.markup-fab-right{right:24px}.markup-fab-left{left:24px}.markup-fab.is-floating{inset:0 auto auto 0}.markup-fab.is-dragging{cursor:grabbing;transition:none}.markup-fab-icon{align-items:center;display:inline-flex}.markup-fab-label{font-family:var(--markup-font)}.markup-hud-hidden-toast{z-index:10;background:var(--markup-ink);color:var(--markup-paper);letter-spacing:-.01em;box-shadow:var(--markup-shadow);pointer-events:none;border-radius:999px;align-items:center;gap:6px;padding:8px 14px;font-size:12px;font-weight:500;animation:.22s ease-out markup-hud-hidden-in,.32s ease-in 4.6s forwards markup-hud-hidden-out;display:inline-flex;position:fixed;bottom:24px}.markup-hud-hidden-toast-right{right:24px}.markup-hud-hidden-toast-left{left:24px}.markup-kbd{background:color-mix(in srgb, var(--markup-paper) 14%, transparent);min-width:18px;height:18px;color:var(--markup-paper);font-family:var(--markup-font);border-radius:4px;justify-content:center;align-items:center;padding:0 5px;font-size:10px;font-weight:600;line-height:1;display:inline-flex}@keyframes markup-hud-hidden-in{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes markup-hud-hidden-out{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(4px)}}.markup-pins-layer{pointer-events:none;position:fixed;inset:0}.markup-pin{background:var(--markup-ink);width:28px;height:28px;color:var(--markup-brand);cursor:pointer;pointer-events:auto;box-shadow:0 0 0 2px var(--markup-paper), 0 0 0 3px color-mix(in srgb, var(--markup-brand) 35%, transparent), var(--markup-shadow);border:none;border-radius:50% 50% 50% 4px;justify-content:center;align-items:center;margin-top:-28px;padding:0;transition:transform .15s,background .15s,color .15s;display:inline-flex;position:absolute}.markup-pin:hover,.markup-pin.is-active{background:var(--markup-brand);color:var(--markup-paper)}.markup-pin.is-anchor{anchor-name:--markup-active-anchor}.markup-pin-ghost{background:var(--markup-brand);color:var(--markup-paper);cursor:default;pointer-events:none;animation:1.2s ease-in-out infinite markup-ghost-pulse}.markup-pin-dot{background:currentColor;border-radius:50%;width:6px;height:6px;display:inline-block}.markup-pin-count{background:var(--markup-brand);min-width:16px;height:16px;color:var(--markup-paper);font-family:var(--markup-font-mono);text-align:center;box-shadow:0 0 0 2px var(--markup-paper);border-radius:999px;padding:0 4px;font-size:9px;font-weight:600;line-height:16px;position:absolute;top:-4px;left:50%;transform:translate(-50%,-50%)}@keyframes markup-ghost-pulse{0%,to{box-shadow:0 0 0 2px var(--markup-paper), 0 0 0 0 #e35d2a66}50%{box-shadow:0 0 0 2px var(--markup-paper), 0 0 0 10px #e35d2a00}}.markup-placement-overlay{background:var(--markup-overlay-tint);cursor:crosshair;pointer-events:auto;z-index:1;animation:.18s ease-out markup-overlay-in;position:fixed;inset:0}.markup-placement-cursor-help{background:var(--markup-ink);color:var(--markup-paper);letter-spacing:-.01em;box-shadow:var(--markup-shadow);pointer-events:none;border-radius:999px;padding:10px 16px;font-size:12px;font-weight:500;animation:.22s ease-out 60ms backwards markup-help-in;position:fixed;top:24px;left:50%;transform:translate(-50%)}@keyframes markup-overlay-in{0%{opacity:0}to{opacity:1}}@keyframes markup-help-in{0%{opacity:0;transform:translate(-50%,-8px)}to{opacity:1;transform:translate(-50%)}}.markup-popover{width:320px;max-width:calc(100vw - 24px);height:auto;max-height:calc(100dvh - 24px);inset:auto;left:var(--markup-pop-x,0);top:var(--markup-pop-y,0);background:var(--markup-paper);color:var(--markup-ink);border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius);box-shadow:var(--markup-shadow);pointer-events:auto;flex-direction:column;gap:0;margin:0;padding:0;animation:.16s ease-out markup-popover-in;display:flex;position:fixed;overflow:hidden}@supports (anchor-name:--x){.markup-popover{position-anchor:--markup-active-anchor;left:calc(anchor(right) + 8px);top:calc(anchor(top) - 9px);position-try-fallbacks:flip-block, flip-inline, flip-block flip-inline;position-try-order:most-block-size}.markup-popover.is-floating{left:var(--markup-pop-x,0);top:var(--markup-pop-y,0);position-try-fallbacks:none}}.markup-popover.is-hud-hidden{display:none}@keyframes markup-popover-in{0%{opacity:0;transform:translateY(-4px)scale(.98)}to{opacity:1;transform:translateY(0)scale(1)}}.markup-popover-header{border-bottom:1px solid var(--markup-border);cursor:grab;-webkit-user-select:none;user-select:none;touch-action:none;justify-content:space-between;align-items:center;padding:10px 12px;display:flex}.markup-popover.is-dragging .markup-popover-header{cursor:grabbing}.markup-popover-header-actions{align-items:center;gap:4px;display:flex}.markup-thread-menu{display:flex;position:relative}.markup-thread-menu-list{z-index:10;background:var(--markup-paper);border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius);min-width:160px;box-shadow:var(--markup-shadow);padding:4px;animation:.12s ease-out markup-menu-in;position:absolute;top:calc(100% + 6px);right:0}.markup-thread-menu-item{border-radius:var(--markup-radius-sm);width:100%;color:var(--markup-ink);text-align:left;cursor:pointer;background:0 0;border:none;padding:7px 10px;font-size:13px;transition:background .1s,color .1s;display:block}.markup-thread-menu-item:hover{background:var(--markup-border)}.markup-thread-menu-item.is-danger{color:var(--markup-danger,#dc2626)}.markup-thread-menu-item.is-danger:hover{background:color-mix(in srgb, var(--markup-danger,#dc2626) 10%, transparent)}.markup-thread-menu-item:disabled{opacity:.5;cursor:default}@keyframes markup-menu-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}.markup-popover-body{padding:12px}.markup-popover-byline{color:var(--markup-muted);align-items:center;gap:4px;margin:0 0 8px;font-size:12px;display:flex}.markup-popover-name{color:var(--markup-ink);font-weight:500}.markup-icon-btn{border-radius:var(--markup-radius-sm);width:24px;height:24px;color:var(--markup-muted);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:0;transition:background .12s,color .12s;display:inline-flex}.markup-icon-btn:hover,.markup-icon-btn.is-open{background:var(--markup-border);color:var(--markup-ink)}.markup-comments{border-bottom:1px solid var(--markup-border);background:linear-gradient(var(--markup-paper), transparent) top / 100% 20px no-repeat local, linear-gradient(transparent, var(--markup-paper)) bottom / 100% 20px no-repeat local, radial-gradient(farthest-side at 50% 0%, #1a16141a, transparent) top / 100% 10px no-repeat scroll, radial-gradient(farthest-side at 50% 100%, #1a16141a, transparent) bottom / 100% 10px no-repeat scroll;flex-direction:column;gap:12px;max-height:280px;margin:0;padding:8px 12px 4px;list-style:none;display:flex;overflow-y:auto}.markup-comment{flex-direction:column;gap:4px;display:flex}.markup-comment-meta{align-items:center;gap:6px;font-size:11px;display:flex}.markup-comment-author{color:var(--markup-ink);font-weight:600}.markup-comment.is-team .markup-comment-author{color:var(--markup-team)}.markup-comment-badge{background:color-mix(in srgb, var(--markup-team) 12%, transparent);height:14px;color:var(--markup-team);font-family:var(--markup-font-mono);letter-spacing:.12em;text-transform:uppercase;border-radius:999px;align-items:center;padding:0 5px;font-size:9px;font-weight:500;line-height:1;display:inline-flex}.markup-comment-time{color:var(--markup-muted);font-family:var(--markup-font-mono);letter-spacing:.04em;font-size:10px}.markup-comment-body{white-space:pre-wrap;word-break:break-word;margin:0;font-size:13px;line-height:1.5}.markup-comment-edited{color:var(--markup-muted);font-size:11px}.markup-thread-actions{align-items:center;gap:4px;display:flex}.markup-comment-meta .markup-reaction-picker-wrap,.markup-thread-actions{margin-left:auto}.markup-comment-meta .markup-reaction-add{width:22px;height:22px;margin-top:-4px;margin-bottom:-4px}.markup-reaction-picker-wrap>.markup-icon-btn,.markup-comment-menu>.markup-icon-btn{margin-top:-4px;margin-bottom:-4px}.markup-comment-menu.is-up .markup-thread-menu-list{animation-name:markup-menu-in-up;top:auto;bottom:calc(100% + 6px)}@keyframes markup-menu-in-up{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.markup-comment{position:relative}.markup-reactions{flex-wrap:wrap;align-items:center;gap:4px;margin-top:2px;display:flex}.markup-reaction-chip{border:1px solid var(--markup-border);height:22px;color:var(--markup-ink);font:inherit;cursor:pointer;background:0 0;border-radius:999px;align-items:center;gap:4px;padding:0 7px 0 6px;font-size:11px;line-height:1;transition:background .12s,border-color .12s;display:inline-flex}.markup-reaction-chip:hover:not(:disabled){background:color-mix(in srgb, var(--markup-ink) 5%, transparent)}.markup-reaction-chip.is-mine{border-color:color-mix(in srgb, var(--markup-brand) 45%, transparent);background:color-mix(in srgb, var(--markup-brand) 10%, transparent)}.markup-reaction-chip.is-mine:hover:not(:disabled){background:color-mix(in srgb, var(--markup-brand) 16%, transparent)}.markup-reaction-chip:disabled{cursor:default;opacity:.6}.markup-reaction-emoji{font-size:13px;line-height:1}.markup-reaction-count{font-family:var(--markup-font-mono);letter-spacing:.04em;color:var(--markup-muted);font-size:10px}.markup-reaction-chip.is-mine .markup-reaction-count{color:var(--markup-brand)}.markup-reaction-picker-wrap{opacity:0;flex:none;transition:opacity .12s;display:inline-flex;position:relative}.markup-comment:hover .markup-reaction-picker-wrap,.markup-comment:focus-within .markup-reaction-picker-wrap,.markup-reaction-picker-wrap.is-open{opacity:1}.markup-reaction-add{border:1px dashed var(--markup-border-strong);width:22px;height:22px;color:var(--markup-muted);font:inherit;cursor:pointer;background:0 0;border-radius:999px;justify-content:center;align-items:center;font-size:13px;line-height:1;transition:background .12s,color .12s,border-color .12s;display:inline-flex}.markup-reaction-add:hover,.markup-reaction-add.is-open{background:color-mix(in srgb, var(--markup-ink) 5%, transparent);color:var(--markup-ink);border-style:solid}.markup-reaction-picker{z-index:1;border:1px solid var(--markup-border-strong);background:var(--markup-paper);border-radius:8px;gap:2px;padding:4px;animation:.12s markup-menu-in;display:flex;position:absolute;top:calc(100% + 6px);right:0;box-shadow:0 1px 2px #1a16140f,0 8px 28px #1a16141a}.markup-reaction-picker-wrap.is-up .markup-reaction-picker{animation-name:markup-menu-in-up;top:auto;bottom:calc(100% + 6px)}.markup-reaction-picker-item{cursor:pointer;background:0 0;border:0;border-radius:6px;justify-content:center;align-items:center;width:28px;height:28px;font-size:16px;line-height:1;transition:background .12s;display:inline-flex}.markup-reaction-picker-item:hover{background:color-mix(in srgb, var(--markup-ink) 8%, transparent)}.markup-reaction-picker-item.is-mine{background:color-mix(in srgb, var(--markup-brand) 14%, transparent)}.markup-comment-edit-form{flex-direction:column;gap:6px;display:flex}.markup-comment-edit-form .markup-textarea{border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius-sm);background:var(--markup-paper);width:100%;color:var(--markup-ink);resize:vertical;font:inherit;outline:none;padding:8px 10px;font-size:13px;line-height:1.5}.markup-comment-edit-form .markup-textarea:focus-visible{border-color:var(--markup-brand);box-shadow:0 0 0 3px #e35d2a2e}.markup-comment-edit-actions{justify-content:flex-end;gap:6px;display:flex}.markup-composer{flex-direction:column;display:flex;position:relative}.markup-composer-input{border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius-sm);background:var(--markup-paper);width:100%;min-height:36px;max-height:96px;color:var(--markup-ink);resize:none;font-family:var(--markup-font);outline:none;padding:8px 10px;font-size:13px;line-height:1.5;transition:border-color .12s,box-shadow .12s,border-bottom-left-radius .15s,border-bottom-right-radius .15s}.markup-composer-input:focus-visible{border-color:var(--markup-brand);box-shadow:0 0 0 3px #e35d2a2e}.markup-composer-input:disabled{opacity:.6}.markup-composer-input::placeholder{color:var(--markup-muted)}.markup-composer.is-filled .markup-composer-input{border-bottom-right-radius:0;border-bottom-left-radius:0}.markup-composer-footer-wrap{grid-template-rows:0fr;transition:grid-template-rows .15s;display:grid}.markup-composer.is-filled .markup-composer-footer-wrap{grid-template-rows:1fr}.markup-composer-footer{border:1px solid var(--markup-border-strong);border-radius:0 0 var(--markup-radius-sm) var(--markup-radius-sm);opacity:0;border-top:none;justify-content:space-between;align-items:center;gap:8px;padding:2px 2px 2px 10px;transition:opacity .1s;display:flex;overflow:hidden}.markup-composer.is-filled .markup-composer-footer{opacity:1;transition-delay:60ms}.markup-composer-hint{font-family:var(--markup-font-mono);letter-spacing:.06em;color:var(--markup-muted);font-size:10px}.markup-composer-error{color:var(--markup-brand)}.markup-composer-actions{align-items:center;gap:6px;display:flex}.markup-composer-actions-empty{transition:opacity .12s;position:absolute;top:3px;right:3px}.markup-composer.is-filled .markup-composer-actions-empty{opacity:0;pointer-events:none}.markup-author-prompt{flex-direction:column;gap:10px;padding:12px;display:flex}.markup-author-status{color:var(--markup-muted);margin:0;font-size:12px}.markup-input{border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius-sm);background:var(--markup-paper);width:100%;height:36px;color:var(--markup-ink);outline:none;padding:0 10px;font-size:14px;transition:border-color .12s,box-shadow .12s}.markup-input:focus-visible{border-color:var(--markup-brand);box-shadow:0 0 0 3px #e35d2a2e}.markup-btn{border-radius:var(--markup-radius-sm);height:30px;color:var(--markup-ink);cursor:pointer;letter-spacing:-.01em;white-space:nowrap;background:0 0;border:1px solid #0000;justify-content:center;align-items:center;gap:6px;padding:0 8px;font-size:12px;font-weight:500;transition:background .12s,border-color .12s,color .12s,opacity .12s;display:inline-flex}.markup-btn:disabled{opacity:.5;cursor:not-allowed}.markup-btn-primary{background:var(--markup-ink);color:var(--markup-paper)}.markup-btn-primary:hover:not(:disabled){background:var(--markup-brand)}.markup-btn-ghost{color:var(--markup-muted)}.markup-btn-ghost:hover:not(:disabled){background:var(--markup-border);color:var(--markup-ink)}.markup-screenshot-row{border-top:1px solid var(--markup-border);margin-top:8px;padding-top:8px}.markup-screenshot-status{color:var(--markup-muted);font-family:var(--markup-font-mono);letter-spacing:.06em;align-items:center;gap:5px;font-size:10px;display:flex}.markup-screenshot-toggle{cursor:pointer;color:var(--markup-muted);font-family:var(--markup-font-mono);letter-spacing:.06em;align-items:center;gap:5px;font-size:10px;transition:color .12s;display:flex}.markup-screenshot-toggle:hover{color:var(--markup-ink)}.markup-screenshot-checkbox{width:12px;height:12px;accent-color:var(--markup-brand);cursor:pointer;margin:0}.markup-screenshot-thumb{border:1px solid var(--markup-border-strong);object-fit:cover;border-radius:3px;flex-shrink:0;width:auto;height:25px;margin:-5px 0 -5px auto;display:block}.markup-comment-screenshot{border:1px solid var(--markup-border-strong);border-radius:var(--markup-radius-sm);cursor:pointer;background:0 0;margin-top:8px;padding:0;transition:border-color .12s,opacity .12s;display:block;overflow:hidden}.markup-comment-screenshot:hover{border-color:var(--markup-brand);opacity:.9}.markup-comment-screenshot img{object-fit:cover;object-position:top;width:100%;height:auto;max-height:120px;display:block}.markup-lightbox{background:#1a1614e0;border:none;width:100%;max-width:100%;height:100%;max-height:100%;margin:0;padding:24px;position:fixed;inset:0}.markup-lightbox[open]{justify-content:center;align-items:center;display:flex}.markup-lightbox::backdrop{display:none}.markup-lightbox-img{border-radius:var(--markup-radius);object-fit:contain;max-width:100%;max-height:100%;box-shadow:var(--markup-shadow);animation:.16s ease-out markup-lightbox-in}.markup-lightbox-close{color:#fdfcfa;background:#1a161499;position:absolute;top:16px;right:16px}.markup-lightbox-close:hover{color:#fdfcfa;background:#1a1614d9}@keyframes markup-lightbox-in{0%{opacity:0;transform:scale(.96)}to{opacity:1;transform:scale(1)}}@media (prefers-reduced-motion:reduce){.markup-fab,.markup-pin,.markup-icon-btn,.markup-btn,.markup-popover,.markup-pin-ghost,.markup-placement-overlay,.markup-placement-cursor-help,.markup-lightbox-img{transition:none;animation:none}}", fe, P, pe, me, he = 0, F = [], I = t, ge = I.__b, _e = I.__r, ve = I.diffed, ye = I.__c, be = I.unmount, xe = I.__;
|
|
252
|
+
function Se(e, t) {
|
|
253
|
+
I.__h && I.__h(P, e, he || t), he = 0;
|
|
254
|
+
var n = P.__H ||= {
|
|
255
255
|
__: [],
|
|
256
256
|
__h: []
|
|
257
257
|
};
|
|
258
258
|
return e >= n.__.length && n.__.push({}), n.__[e];
|
|
259
259
|
}
|
|
260
|
-
function
|
|
261
|
-
return
|
|
260
|
+
function L(e) {
|
|
261
|
+
return he = 1, Ce(je, e);
|
|
262
262
|
}
|
|
263
|
-
function
|
|
264
|
-
var r =
|
|
265
|
-
if (r.t = e, !r.__c && (r.__ = [n ? n(t) :
|
|
263
|
+
function Ce(e, t, n) {
|
|
264
|
+
var r = Se(fe++, 2);
|
|
265
|
+
if (r.t = e, !r.__c && (r.__ = [n ? n(t) : je(void 0, t), function(e) {
|
|
266
266
|
var t = r.__N ? r.__N[0] : r.__[0], n = r.t(t, e);
|
|
267
267
|
t !== n && (r.__N = [n, r.__[1]], r.__c.setState({}));
|
|
268
|
-
}], r.__c =
|
|
268
|
+
}], r.__c = P, !P.__f)) {
|
|
269
269
|
var i = function(e, t, n) {
|
|
270
270
|
if (!r.__c.__H) return !0;
|
|
271
271
|
var i = r.__c.__H.__.filter(function(e) {
|
|
@@ -282,111 +282,111 @@ function xe(e, t, n) {
|
|
|
282
282
|
}
|
|
283
283
|
}), a && a.call(this, e, t, n) || o;
|
|
284
284
|
};
|
|
285
|
-
|
|
286
|
-
var a =
|
|
287
|
-
|
|
285
|
+
P.__f = !0;
|
|
286
|
+
var a = P.shouldComponentUpdate, o = P.componentWillUpdate;
|
|
287
|
+
P.componentWillUpdate = function(e, t, n) {
|
|
288
288
|
if (this.__e) {
|
|
289
289
|
var r = a;
|
|
290
290
|
a = void 0, i(e, t, n), a = r;
|
|
291
291
|
}
|
|
292
292
|
o && o.call(this, e, t, n);
|
|
293
|
-
},
|
|
293
|
+
}, P.shouldComponentUpdate = i;
|
|
294
294
|
}
|
|
295
295
|
return r.__N || r.__;
|
|
296
296
|
}
|
|
297
|
-
function
|
|
298
|
-
var n =
|
|
299
|
-
!
|
|
297
|
+
function R(e, t) {
|
|
298
|
+
var n = Se(fe++, 3);
|
|
299
|
+
!I.__s && Ae(n.__H, t) && (n.__ = e, n.u = t, P.__H.__h.push(n));
|
|
300
300
|
}
|
|
301
|
-
function
|
|
302
|
-
return
|
|
301
|
+
function z(e) {
|
|
302
|
+
return he = 5, we(function() {
|
|
303
303
|
return { current: e };
|
|
304
304
|
}, []);
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
var n =
|
|
308
|
-
return
|
|
306
|
+
function we(e, t) {
|
|
307
|
+
var n = Se(fe++, 7);
|
|
308
|
+
return Ae(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
|
|
309
309
|
}
|
|
310
|
-
function
|
|
311
|
-
return
|
|
310
|
+
function B(e, t) {
|
|
311
|
+
return he = 8, we(function() {
|
|
312
312
|
return e;
|
|
313
313
|
}, t);
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
for (var e; e =
|
|
315
|
+
function Te() {
|
|
316
|
+
for (var e; e = F.shift();) {
|
|
317
317
|
var t = e.__H;
|
|
318
318
|
if (e.__P && t) try {
|
|
319
|
-
t.__h.some(
|
|
319
|
+
t.__h.some(Oe), t.__h.some(ke), t.__h = [];
|
|
320
320
|
} catch (n) {
|
|
321
|
-
t.__h = [],
|
|
321
|
+
t.__h = [], I.__e(n, e.__v);
|
|
322
322
|
}
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
},
|
|
328
|
-
e && t.__k && t.__k.__m && (e.__m = t.__k.__m),
|
|
329
|
-
},
|
|
330
|
-
|
|
331
|
-
var t = (
|
|
332
|
-
t && (
|
|
325
|
+
I.__b = function(e) {
|
|
326
|
+
P = null, ge && ge(e);
|
|
327
|
+
}, I.__ = function(e, t) {
|
|
328
|
+
e && t.__k && t.__k.__m && (e.__m = t.__k.__m), xe && xe(e, t);
|
|
329
|
+
}, I.__r = function(e) {
|
|
330
|
+
_e && _e(e), fe = 0;
|
|
331
|
+
var t = (P = e.__c).__H;
|
|
332
|
+
t && (pe === P ? (t.__h = [], P.__h = [], t.__.some(function(e) {
|
|
333
333
|
e.__N && (e.__ = e.__N), e.u = e.__N = void 0;
|
|
334
|
-
})) : (t.__h.some(
|
|
335
|
-
},
|
|
336
|
-
|
|
334
|
+
})) : (t.__h.some(Oe), t.__h.some(ke), t.__h = [], fe = 0)), pe = P;
|
|
335
|
+
}, I.diffed = function(e) {
|
|
336
|
+
ve && ve(e);
|
|
337
337
|
var t = e.__c;
|
|
338
|
-
t && t.__H && (t.__H.__h.length && (
|
|
338
|
+
t && t.__H && (t.__H.__h.length && (F.push(t) !== 1 && me === I.requestAnimationFrame || ((me = I.requestAnimationFrame) || De)(Te)), t.__H.__.some(function(e) {
|
|
339
339
|
e.u && (e.__H = e.u), e.u = void 0;
|
|
340
|
-
})),
|
|
341
|
-
},
|
|
340
|
+
})), pe = P = null;
|
|
341
|
+
}, I.__c = function(e, t) {
|
|
342
342
|
t.some(function(e) {
|
|
343
343
|
try {
|
|
344
|
-
e.__h.some(
|
|
345
|
-
return !e.__ ||
|
|
344
|
+
e.__h.some(Oe), e.__h = e.__h.filter(function(e) {
|
|
345
|
+
return !e.__ || ke(e);
|
|
346
346
|
});
|
|
347
347
|
} catch (n) {
|
|
348
348
|
t.some(function(e) {
|
|
349
349
|
e.__h &&= [];
|
|
350
|
-
}), t = [],
|
|
350
|
+
}), t = [], I.__e(n, e.__v);
|
|
351
351
|
}
|
|
352
|
-
}),
|
|
353
|
-
},
|
|
354
|
-
|
|
352
|
+
}), ye && ye(e, t);
|
|
353
|
+
}, I.unmount = function(e) {
|
|
354
|
+
be && be(e);
|
|
355
355
|
var t, n = e.__c;
|
|
356
356
|
n && n.__H && (n.__H.__.some(function(e) {
|
|
357
357
|
try {
|
|
358
|
-
|
|
358
|
+
Oe(e);
|
|
359
359
|
} catch (e) {
|
|
360
360
|
t = e;
|
|
361
361
|
}
|
|
362
|
-
}), n.__H = void 0, t &&
|
|
362
|
+
}), n.__H = void 0, t && I.__e(t, n.__v));
|
|
363
363
|
};
|
|
364
|
-
var
|
|
365
|
-
function
|
|
364
|
+
var Ee = typeof requestAnimationFrame == "function";
|
|
365
|
+
function De(e) {
|
|
366
366
|
var t, n = function() {
|
|
367
|
-
clearTimeout(r),
|
|
367
|
+
clearTimeout(r), Ee && cancelAnimationFrame(t), setTimeout(e);
|
|
368
368
|
}, r = setTimeout(n, 35);
|
|
369
|
-
|
|
369
|
+
Ee && (t = requestAnimationFrame(n));
|
|
370
370
|
}
|
|
371
|
-
function
|
|
372
|
-
var t =
|
|
373
|
-
typeof n == "function" && (e.__c = void 0, n()),
|
|
371
|
+
function Oe(e) {
|
|
372
|
+
var t = P, n = e.__c;
|
|
373
|
+
typeof n == "function" && (e.__c = void 0, n()), P = t;
|
|
374
374
|
}
|
|
375
|
-
function
|
|
376
|
-
var t =
|
|
377
|
-
e.__c = e.__(),
|
|
375
|
+
function ke(e) {
|
|
376
|
+
var t = P;
|
|
377
|
+
e.__c = e.__(), P = t;
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function Ae(e, t) {
|
|
380
380
|
return !e || e.length !== t.length || t.some(function(t, n) {
|
|
381
381
|
return t !== e[n];
|
|
382
382
|
});
|
|
383
383
|
}
|
|
384
|
-
function
|
|
384
|
+
function je(e, t) {
|
|
385
385
|
return typeof t == "function" ? t(e) : t;
|
|
386
386
|
}
|
|
387
|
-
for (var
|
|
388
|
-
|
|
389
|
-
function
|
|
387
|
+
for (var Me = "1.37.0", V = [], H = [], Ne = Uint8Array, Pe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Fe = 0, Ie = Pe.length; Fe < Ie; ++Fe) V[Fe] = Pe[Fe], H[Pe.charCodeAt(Fe)] = Fe;
|
|
388
|
+
H[45] = 62, H[95] = 63;
|
|
389
|
+
function Le(e) {
|
|
390
390
|
var t = e.length;
|
|
391
391
|
if (t % 4 > 0) throw Error("Invalid string. Length must be a multiple of 4");
|
|
392
392
|
var n = e.indexOf("=");
|
|
@@ -394,33 +394,33 @@ function Fe(e) {
|
|
|
394
394
|
var r = n === t ? 0 : 4 - n % 4;
|
|
395
395
|
return [n, r];
|
|
396
396
|
}
|
|
397
|
-
function
|
|
397
|
+
function Re(e, t, n) {
|
|
398
398
|
return (t + n) * 3 / 4 - n;
|
|
399
399
|
}
|
|
400
|
-
function
|
|
401
|
-
var t, n =
|
|
402
|
-
for (c = 0; c < s; c += 4) t =
|
|
403
|
-
return i === 2 && (t =
|
|
400
|
+
function ze(e) {
|
|
401
|
+
var t, n = Le(e), r = n[0], i = n[1], a = new Ne(Re(e, r, i)), o = 0, s = i > 0 ? r - 4 : r, c;
|
|
402
|
+
for (c = 0; c < s; c += 4) t = H[e.charCodeAt(c)] << 18 | H[e.charCodeAt(c + 1)] << 12 | H[e.charCodeAt(c + 2)] << 6 | H[e.charCodeAt(c + 3)], a[o++] = t >> 16 & 255, a[o++] = t >> 8 & 255, a[o++] = t & 255;
|
|
403
|
+
return i === 2 && (t = H[e.charCodeAt(c)] << 2 | H[e.charCodeAt(c + 1)] >> 4, a[o++] = t & 255), i === 1 && (t = H[e.charCodeAt(c)] << 10 | H[e.charCodeAt(c + 1)] << 4 | H[e.charCodeAt(c + 2)] >> 2, a[o++] = t >> 8 & 255, a[o++] = t & 255), a;
|
|
404
404
|
}
|
|
405
|
-
function
|
|
406
|
-
return
|
|
405
|
+
function Be(e) {
|
|
406
|
+
return V[e >> 18 & 63] + V[e >> 12 & 63] + V[e >> 6 & 63] + V[e & 63];
|
|
407
407
|
}
|
|
408
|
-
function
|
|
409
|
-
for (var r, i = [], a = t; a < n; a += 3) r = (e[a] << 16 & 16711680) + (e[a + 1] << 8 & 65280) + (e[a + 2] & 255), i.push(
|
|
408
|
+
function Ve(e, t, n) {
|
|
409
|
+
for (var r, i = [], a = t; a < n; a += 3) r = (e[a] << 16 & 16711680) + (e[a + 1] << 8 & 65280) + (e[a + 2] & 255), i.push(Be(r));
|
|
410
410
|
return i.join("");
|
|
411
411
|
}
|
|
412
|
-
function
|
|
413
|
-
for (var t, n = e.length, r = n % 3, i = [], a = 16383, o = 0, s = n - r; o < s; o += a) i.push(
|
|
414
|
-
return r === 1 ? (t = e[n - 1], i.push(
|
|
412
|
+
function He(e) {
|
|
413
|
+
for (var t, n = e.length, r = n % 3, i = [], a = 16383, o = 0, s = n - r; o < s; o += a) i.push(Ve(e, o, o + a > s ? s : o + a));
|
|
414
|
+
return r === 1 ? (t = e[n - 1], i.push(V[t >> 2] + V[t << 4 & 63] + "==")) : r === 2 && (t = (e[n - 2] << 8) + e[n - 1], i.push(V[t >> 10] + V[t >> 4 & 63] + V[t << 2 & 63] + "=")), i.join("");
|
|
415
415
|
}
|
|
416
416
|
//#endregion
|
|
417
417
|
//#region ../../node_modules/.pnpm/convex@1.37.0_react@19.2.6/node_modules/convex/dist/esm/common/index.js
|
|
418
|
-
function
|
|
418
|
+
function U(e) {
|
|
419
419
|
if (e === void 0) return {};
|
|
420
|
-
if (!
|
|
420
|
+
if (!We(e)) throw Error(`The arguments to a Convex function must be an object. Received: ${e}`);
|
|
421
421
|
return e;
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function Ue(e) {
|
|
424
424
|
if (e === void 0) throw Error("Client created with undefined deployment address. If you used an environment variable, check that it's set.");
|
|
425
425
|
if (typeof e != "string") throw Error(`Invalid deployment address: found ${e}".`);
|
|
426
426
|
if (!(e.startsWith("http:") || e.startsWith("https:"))) throw Error(`Invalid deployment address: Must start with "https://" or "http://". Found "${e}".`);
|
|
@@ -431,146 +431,146 @@ function He(e) {
|
|
|
431
431
|
}
|
|
432
432
|
if (e.endsWith(".convex.site")) throw Error(`Invalid deployment address: "${e}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`);
|
|
433
433
|
}
|
|
434
|
-
function
|
|
434
|
+
function We(e) {
|
|
435
435
|
let t = typeof e == "object", n = Object.getPrototypeOf(e), r = n === null || n === Object.prototype || n?.constructor?.name === "Object";
|
|
436
436
|
return t && r;
|
|
437
437
|
}
|
|
438
438
|
//#endregion
|
|
439
439
|
//#region ../../node_modules/.pnpm/convex@1.37.0_react@19.2.6/node_modules/convex/dist/esm/values/value.js
|
|
440
|
-
var
|
|
441
|
-
function
|
|
440
|
+
var Ge = !0, Ke = BigInt("-9223372036854775808"), qe = BigInt("9223372036854775807"), Je = BigInt("0"), Ye = BigInt("8"), Xe = BigInt("256");
|
|
441
|
+
function Ze(e) {
|
|
442
442
|
return Number.isNaN(e) || !Number.isFinite(e) || Object.is(e, -0);
|
|
443
443
|
}
|
|
444
|
-
function
|
|
445
|
-
e <
|
|
444
|
+
function Qe(e) {
|
|
445
|
+
e < Je && (e -= Ke + Ke);
|
|
446
446
|
let t = e.toString(16);
|
|
447
447
|
t.length % 2 == 1 && (t = "0" + t);
|
|
448
448
|
let n = new Uint8Array(/* @__PURE__ */ new ArrayBuffer(8)), r = 0;
|
|
449
|
-
for (let i of t.match(/.{2}/g).reverse()) n.set([parseInt(i, 16)], r++), e >>=
|
|
450
|
-
return
|
|
449
|
+
for (let i of t.match(/.{2}/g).reverse()) n.set([parseInt(i, 16)], r++), e >>= Ye;
|
|
450
|
+
return He(n);
|
|
451
451
|
}
|
|
452
|
-
function
|
|
453
|
-
let t =
|
|
452
|
+
function $e(e) {
|
|
453
|
+
let t = ze(e);
|
|
454
454
|
if (t.byteLength !== 8) throw Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);
|
|
455
|
-
let n =
|
|
456
|
-
for (let e of t) n += BigInt(e) *
|
|
457
|
-
return n >
|
|
455
|
+
let n = Je, r = Je;
|
|
456
|
+
for (let e of t) n += BigInt(e) * Xe ** r, r++;
|
|
457
|
+
return n > qe && (n += Ke + Ke), n;
|
|
458
458
|
}
|
|
459
|
-
function
|
|
460
|
-
if (e <
|
|
459
|
+
function et(e) {
|
|
460
|
+
if (e < Ke || qe < e) throw Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);
|
|
461
461
|
let t = /* @__PURE__ */ new ArrayBuffer(8);
|
|
462
|
-
return new DataView(t).setBigInt64(0, e, !0),
|
|
462
|
+
return new DataView(t).setBigInt64(0, e, !0), He(new Uint8Array(t));
|
|
463
463
|
}
|
|
464
|
-
function
|
|
465
|
-
let t =
|
|
464
|
+
function tt(e) {
|
|
465
|
+
let t = ze(e);
|
|
466
466
|
if (t.byteLength !== 8) throw Error(`Received ${t.byteLength} bytes, expected 8 for $integer`);
|
|
467
467
|
return new DataView(t.buffer).getBigInt64(0, !0);
|
|
468
468
|
}
|
|
469
|
-
var
|
|
470
|
-
function
|
|
471
|
-
if (e.length >
|
|
469
|
+
var nt = DataView.prototype.setBigInt64 ? et : Qe, rt = DataView.prototype.getBigInt64 ? tt : $e, it = 1024;
|
|
470
|
+
function at(e) {
|
|
471
|
+
if (e.length > it) throw Error(`Field name ${e} exceeds maximum field name length ${it}.`);
|
|
472
472
|
if (e.startsWith("$")) throw Error(`Field name ${e} starts with a '$', which is reserved.`);
|
|
473
473
|
for (let t = 0; t < e.length; t += 1) {
|
|
474
474
|
let n = e.charCodeAt(t);
|
|
475
475
|
if (n < 32 || n >= 127) throw Error(`Field name ${e} has invalid character '${e[t]}': Field names can only contain non-control ASCII characters`);
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function ot(e) {
|
|
479
479
|
if (e === null || typeof e == "boolean" || typeof e == "number" || typeof e == "string") return e;
|
|
480
|
-
if (Array.isArray(e)) return e.map((e) =>
|
|
480
|
+
if (Array.isArray(e)) return e.map((e) => ot(e));
|
|
481
481
|
if (typeof e != "object") throw Error(`Unexpected type of ${e}`);
|
|
482
482
|
let t = Object.entries(e);
|
|
483
483
|
if (t.length === 1) {
|
|
484
484
|
let n = t[0][0];
|
|
485
485
|
if (n === "$bytes") {
|
|
486
486
|
if (typeof e.$bytes != "string") throw Error(`Malformed $bytes field on ${e}`);
|
|
487
|
-
return
|
|
487
|
+
return ze(e.$bytes).buffer;
|
|
488
488
|
}
|
|
489
489
|
if (n === "$integer") {
|
|
490
490
|
if (typeof e.$integer != "string") throw Error(`Malformed $integer field on ${e}`);
|
|
491
|
-
return
|
|
491
|
+
return rt(e.$integer);
|
|
492
492
|
}
|
|
493
493
|
if (n === "$float") {
|
|
494
494
|
if (typeof e.$float != "string") throw Error(`Malformed $float field on ${e}`);
|
|
495
|
-
let t =
|
|
495
|
+
let t = ze(e.$float);
|
|
496
496
|
if (t.byteLength !== 8) throw Error(`Received ${t.byteLength} bytes, expected 8 for $float`);
|
|
497
|
-
let n = new DataView(t.buffer).getFloat64(0,
|
|
498
|
-
if (!
|
|
497
|
+
let n = new DataView(t.buffer).getFloat64(0, Ge);
|
|
498
|
+
if (!Ze(n)) throw Error(`Float ${n} should be encoded as a number`);
|
|
499
499
|
return n;
|
|
500
500
|
}
|
|
501
501
|
if (n === "$set") throw Error("Received a Set which is no longer supported as a Convex type.");
|
|
502
502
|
if (n === "$map") throw Error("Received a Map which is no longer supported as a Convex type.");
|
|
503
503
|
}
|
|
504
504
|
let n = {};
|
|
505
|
-
for (let [t, r] of Object.entries(e))
|
|
505
|
+
for (let [t, r] of Object.entries(e)) at(t), n[t] = ot(r);
|
|
506
506
|
return n;
|
|
507
507
|
}
|
|
508
|
-
var
|
|
509
|
-
function
|
|
508
|
+
var st = 16384;
|
|
509
|
+
function ct(e) {
|
|
510
510
|
let t = JSON.stringify(e, (e, t) => t === void 0 ? "undefined" : typeof t == "bigint" ? `${t.toString()}n` : t);
|
|
511
|
-
if (t.length >
|
|
512
|
-
let e =
|
|
511
|
+
if (t.length > st) {
|
|
512
|
+
let e = st - 14, n = t.codePointAt(e - 1);
|
|
513
513
|
return n !== void 0 && n > 65535 && --e, t.substring(0, e) + "[...truncated]";
|
|
514
514
|
}
|
|
515
515
|
return t;
|
|
516
516
|
}
|
|
517
|
-
function
|
|
517
|
+
function lt(e, t, n, r) {
|
|
518
518
|
if (e === void 0) {
|
|
519
|
-
let e = n && ` (present at path ${n} in original object ${
|
|
519
|
+
let e = n && ` (present at path ${n} in original object ${ct(t)})`;
|
|
520
520
|
throw Error(`undefined is not a valid Convex value${e}. To learn about Convex's supported types, see https://docs.convex.dev/using/types.`);
|
|
521
521
|
}
|
|
522
522
|
if (e === null) return e;
|
|
523
523
|
if (typeof e == "bigint") {
|
|
524
|
-
if (e <
|
|
525
|
-
return { $integer:
|
|
524
|
+
if (e < Ke || qe < e) throw Error(`BigInt ${e} does not fit into a 64-bit signed integer.`);
|
|
525
|
+
return { $integer: nt(e) };
|
|
526
526
|
}
|
|
527
|
-
if (typeof e == "number") if (
|
|
527
|
+
if (typeof e == "number") if (Ze(e)) {
|
|
528
528
|
let t = /* @__PURE__ */ new ArrayBuffer(8);
|
|
529
|
-
return new DataView(t).setFloat64(0, e,
|
|
529
|
+
return new DataView(t).setFloat64(0, e, Ge), { $float: He(new Uint8Array(t)) };
|
|
530
530
|
} else return e;
|
|
531
531
|
if (typeof e == "boolean" || typeof e == "string") return e;
|
|
532
|
-
if (e instanceof ArrayBuffer) return { $bytes:
|
|
533
|
-
if (Array.isArray(e)) return e.map((e, r) =>
|
|
534
|
-
if (e instanceof Set) throw Error(
|
|
535
|
-
if (e instanceof Map) throw Error(
|
|
536
|
-
if (!
|
|
532
|
+
if (e instanceof ArrayBuffer) return { $bytes: He(new Uint8Array(e)) };
|
|
533
|
+
if (Array.isArray(e)) return e.map((e, r) => lt(e, t, n + `[${r}]`, !1));
|
|
534
|
+
if (e instanceof Set) throw Error(ut(n, "Set", [...e], t));
|
|
535
|
+
if (e instanceof Map) throw Error(ut(n, "Map", [...e], t));
|
|
536
|
+
if (!We(e)) {
|
|
537
537
|
let r = e?.constructor?.name, i = r ? `${r} ` : "";
|
|
538
|
-
throw Error(
|
|
538
|
+
throw Error(ut(n, i, e, t));
|
|
539
539
|
}
|
|
540
540
|
let i = {}, a = Object.entries(e);
|
|
541
541
|
a.sort(([e, t], [n, r]) => e === n ? 0 : e < n ? -1 : 1);
|
|
542
|
-
for (let [e, o] of a) o === void 0 ? r && (
|
|
542
|
+
for (let [e, o] of a) o === void 0 ? r && (at(e), i[e] = dt(o, t, n + `.${e}`)) : (at(e), i[e] = lt(o, t, n + `.${e}`, !1));
|
|
543
543
|
return i;
|
|
544
544
|
}
|
|
545
|
-
function
|
|
546
|
-
return e ? `${t}${
|
|
545
|
+
function ut(e, t, n, r) {
|
|
546
|
+
return e ? `${t}${ct(n)} is not a supported Convex type (present at path ${e} in original object ${ct(r)}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.` : `${t}${ct(n)} is not a supported Convex type.`;
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function dt(e, t, n) {
|
|
549
549
|
if (e === void 0) return { $undefined: null };
|
|
550
|
-
if (t === void 0) throw Error(`Programming error. Current value is ${
|
|
551
|
-
return
|
|
550
|
+
if (t === void 0) throw Error(`Programming error. Current value is ${ct(e)} but original value is undefined`);
|
|
551
|
+
return lt(e, t, n, !1);
|
|
552
552
|
}
|
|
553
|
-
function
|
|
554
|
-
return
|
|
553
|
+
function ft(e) {
|
|
554
|
+
return lt(e, e, "", !1);
|
|
555
555
|
}
|
|
556
556
|
//#endregion
|
|
557
557
|
//#region ../../node_modules/.pnpm/convex@1.37.0_react@19.2.6/node_modules/convex/dist/esm/values/errors.js
|
|
558
|
-
var
|
|
558
|
+
var pt = Object.defineProperty, mt = (e, t, n) => t in e ? pt(e, t, {
|
|
559
559
|
enumerable: !0,
|
|
560
560
|
configurable: !0,
|
|
561
561
|
writable: !0,
|
|
562
562
|
value: n
|
|
563
|
-
}) : e[t] = n,
|
|
563
|
+
}) : e[t] = n, ht = (e, t, n) => mt(e, typeof t == "symbol" ? t : t + "", n), gt, _t, vt = Symbol.for("ConvexError"), yt = class extends (_t = Error, gt = vt, _t) {
|
|
564
564
|
constructor(e) {
|
|
565
|
-
super(typeof e == "string" ? e :
|
|
565
|
+
super(typeof e == "string" ? e : ct(e)), ht(this, "name", "ConvexError"), ht(this, "data"), ht(this, gt, !0), this.data = e;
|
|
566
566
|
}
|
|
567
|
-
},
|
|
567
|
+
}, bt = Object.defineProperty, xt = (e, t, n) => t in e ? bt(e, t, {
|
|
568
568
|
enumerable: !0,
|
|
569
569
|
configurable: !0,
|
|
570
570
|
writable: !0,
|
|
571
571
|
value: n
|
|
572
|
-
}) : e[t] = n,
|
|
573
|
-
function
|
|
572
|
+
}) : e[t] = n, St = (e, t, n) => xt(e, typeof t == "symbol" ? t : t + "", n), Ct = "color:rgb(0, 145, 255)";
|
|
573
|
+
function wt(e) {
|
|
574
574
|
switch (e) {
|
|
575
575
|
case "query": return "Q";
|
|
576
576
|
case "mutation": return "M";
|
|
@@ -578,9 +578,9 @@ function Ct(e) {
|
|
|
578
578
|
case "any": return "?";
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
|
-
var
|
|
581
|
+
var Tt = class {
|
|
582
582
|
constructor(e) {
|
|
583
|
-
|
|
583
|
+
St(this, "_onLogLineFuncs"), St(this, "_verbose"), this._onLogLineFuncs = {}, this._verbose = e.verbose;
|
|
584
584
|
}
|
|
585
585
|
addLogLineListener(e) {
|
|
586
586
|
let t = Math.random().toString(36).substring(2, 15);
|
|
@@ -602,8 +602,8 @@ var wt = class {
|
|
|
602
602
|
for (let t of Object.values(this._onLogLineFuncs)) t("error", ...e);
|
|
603
603
|
}
|
|
604
604
|
};
|
|
605
|
-
function
|
|
606
|
-
let t = new
|
|
605
|
+
function Et(e) {
|
|
606
|
+
let t = new Tt(e);
|
|
607
607
|
return t.addLogLineListener((e, ...t) => {
|
|
608
608
|
switch (e) {
|
|
609
609
|
case "debug":
|
|
@@ -622,11 +622,11 @@ function Tt(e) {
|
|
|
622
622
|
}
|
|
623
623
|
}), t;
|
|
624
624
|
}
|
|
625
|
-
function
|
|
626
|
-
return new
|
|
625
|
+
function Dt(e) {
|
|
626
|
+
return new Tt(e);
|
|
627
627
|
}
|
|
628
|
-
function
|
|
629
|
-
let a =
|
|
628
|
+
function Ot(e, t, n, r, i) {
|
|
629
|
+
let a = wt(n);
|
|
630
630
|
if (typeof i == "object" && (i = `ConvexError ${JSON.stringify(i.errorData, null, 2)}`), t === "info") {
|
|
631
631
|
let t = i.match(/^\[.*?\] /);
|
|
632
632
|
if (t === null) {
|
|
@@ -634,57 +634,57 @@ function Dt(e, t, n, r, i) {
|
|
|
634
634
|
return;
|
|
635
635
|
}
|
|
636
636
|
let n = i.slice(1, t[0].length - 2), o = i.slice(t[0].length);
|
|
637
|
-
e.log(`%c[CONVEX ${a}(${r})] [${n}]`,
|
|
637
|
+
e.log(`%c[CONVEX ${a}(${r})] [${n}]`, Ct, o);
|
|
638
638
|
} else e.error(`[CONVEX ${a}(${r})] ${i}`);
|
|
639
639
|
}
|
|
640
|
-
function
|
|
640
|
+
function kt(e, t) {
|
|
641
641
|
let n = `[CONVEX FATAL ERROR] ${t}`;
|
|
642
642
|
return e.error(n), Error(n);
|
|
643
643
|
}
|
|
644
|
-
function
|
|
645
|
-
return `[CONVEX ${
|
|
644
|
+
function At(e, t, n) {
|
|
645
|
+
return `[CONVEX ${wt(e)}(${t})] ${n.errorMessage}
|
|
646
646
|
Called by client`;
|
|
647
647
|
}
|
|
648
|
-
function
|
|
648
|
+
function jt(e, t) {
|
|
649
649
|
return t.data = e.errorData, t;
|
|
650
650
|
}
|
|
651
651
|
//#endregion
|
|
652
652
|
//#region ../../node_modules/.pnpm/convex@1.37.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/udf_path_utils.js
|
|
653
|
-
function
|
|
653
|
+
function Mt(e) {
|
|
654
654
|
let t = e.split(":"), n, r;
|
|
655
655
|
return t.length === 1 ? (n = t[0], r = "default") : (n = t.slice(0, t.length - 1).join(":"), r = t[t.length - 1]), n.endsWith(".js") && (n = n.slice(0, -3)), `${n}:${r}`;
|
|
656
656
|
}
|
|
657
|
-
function
|
|
657
|
+
function Nt(e, t) {
|
|
658
658
|
return JSON.stringify({
|
|
659
|
-
udfPath:
|
|
660
|
-
args:
|
|
659
|
+
udfPath: Mt(e),
|
|
660
|
+
args: ft(t)
|
|
661
661
|
});
|
|
662
662
|
}
|
|
663
|
-
function
|
|
663
|
+
function Pt(e, t, n) {
|
|
664
664
|
let { initialNumItems: r, id: i } = n;
|
|
665
665
|
return JSON.stringify({
|
|
666
666
|
type: "paginated",
|
|
667
|
-
udfPath:
|
|
668
|
-
args:
|
|
669
|
-
options:
|
|
667
|
+
udfPath: Mt(e),
|
|
668
|
+
args: ft(t),
|
|
669
|
+
options: ft({
|
|
670
670
|
initialNumItems: r,
|
|
671
671
|
id: i
|
|
672
672
|
})
|
|
673
673
|
});
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function Ft(e) {
|
|
676
676
|
return JSON.parse(e).type === "paginated";
|
|
677
677
|
}
|
|
678
678
|
//#endregion
|
|
679
679
|
//#region ../../node_modules/.pnpm/convex@1.37.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/local_state.js
|
|
680
|
-
var
|
|
680
|
+
var It = Object.defineProperty, Lt = (e, t, n) => t in e ? It(e, t, {
|
|
681
681
|
enumerable: !0,
|
|
682
682
|
configurable: !0,
|
|
683
683
|
writable: !0,
|
|
684
684
|
value: n
|
|
685
|
-
}) : e[t] = n,
|
|
685
|
+
}) : e[t] = n, W = (e, t, n) => Lt(e, typeof t == "symbol" ? t : t + "", n), Rt = class {
|
|
686
686
|
constructor() {
|
|
687
|
-
|
|
687
|
+
W(this, "nextQueryId"), W(this, "querySetVersion"), W(this, "querySet"), W(this, "queryIdToToken"), W(this, "identityVersion"), W(this, "auth"), W(this, "outstandingQueriesOlderThanRestart"), W(this, "outstandingAuthOlderThanRestart"), W(this, "paused"), W(this, "pendingQuerySetModifications"), this.nextQueryId = 0, this.querySetVersion = 0, this.identityVersion = 0, this.querySet = /* @__PURE__ */ new Map(), this.queryIdToToken = /* @__PURE__ */ new Map(), this.outstandingQueriesOlderThanRestart = /* @__PURE__ */ new Set(), this.outstandingAuthOlderThanRestart = !1, this.paused = !1, this.pendingQuerySetModifications = /* @__PURE__ */ new Map();
|
|
688
688
|
}
|
|
689
689
|
hasSyncedPastLastReconnect() {
|
|
690
690
|
return this.outstandingQueriesOlderThanRestart.size === 0 && !this.outstandingAuthOlderThanRestart;
|
|
@@ -693,7 +693,7 @@ var Ft = Object.defineProperty, It = (e, t, n) => t in e ? Ft(e, t, {
|
|
|
693
693
|
this.outstandingAuthOlderThanRestart = !1;
|
|
694
694
|
}
|
|
695
695
|
subscribe(e, t, n, r) {
|
|
696
|
-
let i =
|
|
696
|
+
let i = Mt(e), a = Nt(i, t), o = this.querySet.get(a);
|
|
697
697
|
if (o !== void 0) return o.numSubscribers += 1, {
|
|
698
698
|
queryToken: a,
|
|
699
699
|
modification: null,
|
|
@@ -713,7 +713,7 @@ var Ft = Object.defineProperty, It = (e, t, n) => t in e ? Ft(e, t, {
|
|
|
713
713
|
type: "Add",
|
|
714
714
|
queryId: e,
|
|
715
715
|
udfPath: i,
|
|
716
|
-
args: [
|
|
716
|
+
args: [ft(t)],
|
|
717
717
|
journal: n,
|
|
718
718
|
componentPath: r
|
|
719
719
|
};
|
|
@@ -748,7 +748,7 @@ var Ft = Object.defineProperty, It = (e, t, n) => t in e ? Ft(e, t, {
|
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
750
|
queryId(e, t) {
|
|
751
|
-
let n = Mt(
|
|
751
|
+
let n = Nt(Mt(e), t), r = this.querySet.get(n);
|
|
752
752
|
return r === void 0 ? null : r.id;
|
|
753
753
|
}
|
|
754
754
|
isCurrentOrNewerAuthVersion(e) {
|
|
@@ -820,7 +820,7 @@ var Ft = Object.defineProperty, It = (e, t, n) => t in e ? Ft(e, t, {
|
|
|
820
820
|
type: "Add",
|
|
821
821
|
queryId: t.id,
|
|
822
822
|
udfPath: t.canonicalizedUdfPath,
|
|
823
|
-
args: [
|
|
823
|
+
args: [ft(t.args)],
|
|
824
824
|
journal: t.journal,
|
|
825
825
|
componentPath: t.componentPath
|
|
826
826
|
};
|
|
@@ -878,14 +878,14 @@ var Ft = Object.defineProperty, It = (e, t, n) => t in e ? Ft(e, t, {
|
|
|
878
878
|
};
|
|
879
879
|
}
|
|
880
880
|
}
|
|
881
|
-
},
|
|
881
|
+
}, zt = Object.defineProperty, Bt = (e, t, n) => t in e ? zt(e, t, {
|
|
882
882
|
enumerable: !0,
|
|
883
883
|
configurable: !0,
|
|
884
884
|
writable: !0,
|
|
885
885
|
value: n
|
|
886
|
-
}) : e[t] = n,
|
|
886
|
+
}) : e[t] = n, Vt = (e, t, n) => Bt(e, typeof t == "symbol" ? t : t + "", n), Ht = class {
|
|
887
887
|
constructor(e, t) {
|
|
888
|
-
this.logger = e, this.markConnectionStateDirty = t,
|
|
888
|
+
this.logger = e, this.markConnectionStateDirty = t, Vt(this, "inflightRequests"), Vt(this, "requestsOlderThanRestart"), Vt(this, "inflightMutationsCount", 0), Vt(this, "inflightActionsCount", 0), this.inflightRequests = /* @__PURE__ */ new Map(), this.requestsOlderThanRestart = /* @__PURE__ */ new Set();
|
|
889
889
|
}
|
|
890
890
|
request(e, t) {
|
|
891
891
|
let n = new Promise((n) => {
|
|
@@ -905,19 +905,19 @@ var Ft = Object.defineProperty, It = (e, t, n) => t in e ? Ft(e, t, {
|
|
|
905
905
|
let t = this.inflightRequests.get(e.requestId);
|
|
906
906
|
if (t === void 0 || t.status.status === "Completed") return null;
|
|
907
907
|
let n = t.message.type === "Mutation" ? "mutation" : "action", r = t.message.udfPath;
|
|
908
|
-
for (let t of e.logLines)
|
|
908
|
+
for (let t of e.logLines) Ot(this.logger, "info", n, r, t);
|
|
909
909
|
let i = t.status, a, o;
|
|
910
910
|
if (e.success) a = {
|
|
911
911
|
success: !0,
|
|
912
912
|
logLines: e.logLines,
|
|
913
|
-
value:
|
|
913
|
+
value: ot(e.result)
|
|
914
914
|
}, o = () => i.onResult(a);
|
|
915
915
|
else {
|
|
916
916
|
let t = e.result, { errorData: s } = e;
|
|
917
|
-
|
|
917
|
+
Ot(this.logger, "error", n, r, t), a = {
|
|
918
918
|
success: !1,
|
|
919
919
|
errorMessage: t,
|
|
920
|
-
errorData: s === void 0 ? void 0 :
|
|
920
|
+
errorData: s === void 0 ? void 0 : ot(s),
|
|
921
921
|
logLines: e.logLines
|
|
922
922
|
}, o = () => i.onResult(a);
|
|
923
923
|
}
|
|
@@ -989,19 +989,19 @@ var Ft = Object.defineProperty, It = (e, t, n) => t in e ? Ft(e, t, {
|
|
|
989
989
|
inflightActions() {
|
|
990
990
|
return this.inflightActionsCount;
|
|
991
991
|
}
|
|
992
|
-
},
|
|
993
|
-
function Wt(e) {
|
|
994
|
-
return e[Ut] ?? null;
|
|
995
|
-
}
|
|
992
|
+
}, Ut = Symbol.for("functionName"), Wt = Symbol.for("toReferencePath");
|
|
996
993
|
function Gt(e) {
|
|
997
|
-
return e
|
|
994
|
+
return e[Wt] ?? null;
|
|
998
995
|
}
|
|
999
996
|
function Kt(e) {
|
|
997
|
+
return e.startsWith("function://");
|
|
998
|
+
}
|
|
999
|
+
function qt(e) {
|
|
1000
1000
|
let t;
|
|
1001
|
-
if (typeof e == "string") t =
|
|
1002
|
-
else if (e[
|
|
1001
|
+
if (typeof e == "string") t = Kt(e) ? { functionHandle: e } : { name: e };
|
|
1002
|
+
else if (e[Ut]) t = { name: e[Ut] };
|
|
1003
1003
|
else {
|
|
1004
|
-
let n =
|
|
1004
|
+
let n = Gt(e);
|
|
1005
1005
|
if (!n) throw Error(`${e} is not a functionReference`);
|
|
1006
1006
|
t = { reference: n };
|
|
1007
1007
|
}
|
|
@@ -1009,21 +1009,21 @@ function Kt(e) {
|
|
|
1009
1009
|
}
|
|
1010
1010
|
//#endregion
|
|
1011
1011
|
//#region ../../node_modules/.pnpm/convex@1.37.0_react@19.2.6/node_modules/convex/dist/esm/server/api.js
|
|
1012
|
-
function
|
|
1013
|
-
let t =
|
|
1012
|
+
function G(e) {
|
|
1013
|
+
let t = qt(e);
|
|
1014
1014
|
if (t.name === void 0) throw t.functionHandle === void 0 ? t.reference === void 0 ? Error(`Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(t)}`) : Error(`Expected function reference in the current component like "api.file.func" or "internal.file.func", but received reference ${t.reference}`) : Error(`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${t.functionHandle}`);
|
|
1015
1015
|
if (typeof e == "string") return e;
|
|
1016
|
-
let n = e[
|
|
1016
|
+
let n = e[Ut];
|
|
1017
1017
|
if (!n) throw Error(`${e} is not a functionReference`);
|
|
1018
1018
|
return n;
|
|
1019
1019
|
}
|
|
1020
|
-
function
|
|
1021
|
-
return { [
|
|
1020
|
+
function Jt(e) {
|
|
1021
|
+
return { [Ut]: e };
|
|
1022
1022
|
}
|
|
1023
|
-
function
|
|
1023
|
+
function Yt(e = []) {
|
|
1024
1024
|
return new Proxy({}, { get(t, n) {
|
|
1025
|
-
if (typeof n == "string") return
|
|
1026
|
-
if (n ===
|
|
1025
|
+
if (typeof n == "string") return Yt([...e, n]);
|
|
1026
|
+
if (n === Ut) {
|
|
1027
1027
|
if (e.length < 2) {
|
|
1028
1028
|
let t = ["api", ...e].join(".");
|
|
1029
1029
|
throw Error(`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${t}\``);
|
|
@@ -1034,32 +1034,32 @@ function Jt(e = []) {
|
|
|
1034
1034
|
else return;
|
|
1035
1035
|
} });
|
|
1036
1036
|
}
|
|
1037
|
-
|
|
1037
|
+
Yt();
|
|
1038
1038
|
//#endregion
|
|
1039
1039
|
//#region ../../node_modules/.pnpm/convex@1.37.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/optimistic_updates_impl.js
|
|
1040
|
-
var
|
|
1040
|
+
var Xt = Object.defineProperty, Zt = (e, t, n) => t in e ? Xt(e, t, {
|
|
1041
1041
|
enumerable: !0,
|
|
1042
1042
|
configurable: !0,
|
|
1043
1043
|
writable: !0,
|
|
1044
1044
|
value: n
|
|
1045
|
-
}) : e[t] = n,
|
|
1045
|
+
}) : e[t] = n, Qt = (e, t, n) => Zt(e, typeof t == "symbol" ? t : t + "", n), $t = class e {
|
|
1046
1046
|
constructor(e) {
|
|
1047
|
-
|
|
1047
|
+
Qt(this, "queryResults"), Qt(this, "modifiedQueries"), this.queryResults = e, this.modifiedQueries = [];
|
|
1048
1048
|
}
|
|
1049
1049
|
getQuery(t, ...n) {
|
|
1050
|
-
let r =
|
|
1050
|
+
let r = U(n[0]), i = G(t), a = this.queryResults.get(Nt(i, r));
|
|
1051
1051
|
if (a !== void 0) return e.queryValue(a.result);
|
|
1052
1052
|
}
|
|
1053
1053
|
getAllQueries(t) {
|
|
1054
|
-
let n = [], r =
|
|
1055
|
-
for (let t of this.queryResults.values()) t.udfPath ===
|
|
1054
|
+
let n = [], r = G(t);
|
|
1055
|
+
for (let t of this.queryResults.values()) t.udfPath === Mt(r) && n.push({
|
|
1056
1056
|
args: t.args,
|
|
1057
1057
|
value: e.queryValue(t.result)
|
|
1058
1058
|
});
|
|
1059
1059
|
return n;
|
|
1060
1060
|
}
|
|
1061
1061
|
setQuery(e, t, n) {
|
|
1062
|
-
let r =
|
|
1062
|
+
let r = U(t), i = G(e), a = Nt(i, r), o;
|
|
1063
1063
|
o = n === void 0 ? void 0 : {
|
|
1064
1064
|
success: !0,
|
|
1065
1065
|
value: n,
|
|
@@ -1075,15 +1075,15 @@ var Yt = Object.defineProperty, Xt = (e, t, n) => t in e ? Yt(e, t, {
|
|
|
1075
1075
|
static queryValue(e) {
|
|
1076
1076
|
if (e !== void 0 && e.success) return e.value;
|
|
1077
1077
|
}
|
|
1078
|
-
},
|
|
1078
|
+
}, en = class {
|
|
1079
1079
|
constructor() {
|
|
1080
|
-
|
|
1080
|
+
Qt(this, "queryResults"), Qt(this, "optimisticUpdates"), this.queryResults = /* @__PURE__ */ new Map(), this.optimisticUpdates = [];
|
|
1081
1081
|
}
|
|
1082
1082
|
ingestQueryResultsFromServer(e, t) {
|
|
1083
1083
|
this.optimisticUpdates = this.optimisticUpdates.filter((e) => !t.has(e.mutationId));
|
|
1084
1084
|
let n = this.queryResults;
|
|
1085
1085
|
this.queryResults = new Map(e);
|
|
1086
|
-
let r = new
|
|
1086
|
+
let r = new $t(this.queryResults);
|
|
1087
1087
|
for (let e of this.optimisticUpdates) e.update(r);
|
|
1088
1088
|
let i = [];
|
|
1089
1089
|
for (let [e, t] of this.queryResults) {
|
|
@@ -1097,7 +1097,7 @@ var Yt = Object.defineProperty, Xt = (e, t, n) => t in e ? Yt(e, t, {
|
|
|
1097
1097
|
update: e,
|
|
1098
1098
|
mutationId: t
|
|
1099
1099
|
});
|
|
1100
|
-
let n = new
|
|
1100
|
+
let n = new $t(this.queryResults);
|
|
1101
1101
|
return e(n), n.modifiedQueries;
|
|
1102
1102
|
}
|
|
1103
1103
|
rawQueryResult(e) {
|
|
@@ -1110,7 +1110,7 @@ var Yt = Object.defineProperty, Xt = (e, t, n) => t in e ? Yt(e, t, {
|
|
|
1110
1110
|
let n = t.result;
|
|
1111
1111
|
if (n !== void 0) {
|
|
1112
1112
|
if (n.success) return n.value;
|
|
1113
|
-
throw n.errorData === void 0 ? Error(
|
|
1113
|
+
throw n.errorData === void 0 ? Error(At("query", t.udfPath, n)) : jt(n, new yt(At("query", t.udfPath, n)));
|
|
1114
1114
|
}
|
|
1115
1115
|
}
|
|
1116
1116
|
hasQueryResult(e) {
|
|
@@ -1119,14 +1119,14 @@ var Yt = Object.defineProperty, Xt = (e, t, n) => t in e ? Yt(e, t, {
|
|
|
1119
1119
|
queryLogs(e) {
|
|
1120
1120
|
return this.queryResults.get(e)?.result?.logLines;
|
|
1121
1121
|
}
|
|
1122
|
-
},
|
|
1122
|
+
}, tn = Object.defineProperty, nn = (e, t, n) => t in e ? tn(e, t, {
|
|
1123
1123
|
enumerable: !0,
|
|
1124
1124
|
configurable: !0,
|
|
1125
1125
|
writable: !0,
|
|
1126
1126
|
value: n
|
|
1127
|
-
}) : e[t] = n,
|
|
1127
|
+
}) : e[t] = n, rn = (e, t, n) => nn(e, typeof t == "symbol" ? t : t + "", n), an = class e {
|
|
1128
1128
|
constructor(e, t) {
|
|
1129
|
-
|
|
1129
|
+
rn(this, "low"), rn(this, "high"), rn(this, "__isUnsignedLong__"), this.low = e | 0, this.high = t | 0, this.__isUnsignedLong__ = !0;
|
|
1130
1130
|
}
|
|
1131
1131
|
static isLong(e) {
|
|
1132
1132
|
return (e && e.__isUnsignedLong__) === !0;
|
|
@@ -1148,10 +1148,10 @@ var Yt = Object.defineProperty, Xt = (e, t, n) => t in e ? Yt(e, t, {
|
|
|
1148
1148
|
];
|
|
1149
1149
|
}
|
|
1150
1150
|
static fromNumber(t) {
|
|
1151
|
-
return isNaN(t) || t < 0 ?
|
|
1151
|
+
return isNaN(t) || t < 0 ? on : t >= ln ? un : new e(t % cn | 0, t / cn | 0);
|
|
1152
1152
|
}
|
|
1153
1153
|
toString() {
|
|
1154
|
-
return (BigInt(this.high) * BigInt(
|
|
1154
|
+
return (BigInt(this.high) * BigInt(cn) + BigInt(this.low)).toString();
|
|
1155
1155
|
}
|
|
1156
1156
|
equals(t) {
|
|
1157
1157
|
return e.isLong(t) || (t = e.fromValue(t)), this.high >>> 31 == 1 && t.high >>> 31 == 1 ? !1 : this.high === t.high && this.low === t.low;
|
|
@@ -1168,16 +1168,16 @@ var Yt = Object.defineProperty, Xt = (e, t, n) => t in e ? Yt(e, t, {
|
|
|
1168
1168
|
static fromValue(t) {
|
|
1169
1169
|
return typeof t == "number" ? e.fromNumber(t) : new e(t.low, t.high);
|
|
1170
1170
|
}
|
|
1171
|
-
},
|
|
1171
|
+
}, on = new an(0, 0), sn = 65536, cn = sn * sn, ln = cn * cn, un = new an(-1, -1), dn = Object.defineProperty, fn = (e, t, n) => t in e ? dn(e, t, {
|
|
1172
1172
|
enumerable: !0,
|
|
1173
1173
|
configurable: !0,
|
|
1174
1174
|
writable: !0,
|
|
1175
1175
|
value: n
|
|
1176
|
-
}) : e[t] = n,
|
|
1176
|
+
}) : e[t] = n, pn = (e, t, n) => fn(e, typeof t == "symbol" ? t : t + "", n), mn = class {
|
|
1177
1177
|
constructor(e, t) {
|
|
1178
|
-
|
|
1178
|
+
pn(this, "version"), pn(this, "remoteQuerySet"), pn(this, "queryPath"), pn(this, "logger"), this.version = {
|
|
1179
1179
|
querySet: 0,
|
|
1180
|
-
ts:
|
|
1180
|
+
ts: an.fromNumber(0),
|
|
1181
1181
|
identity: 0
|
|
1182
1182
|
}, this.remoteQuerySet = /* @__PURE__ */ new Map(), this.queryPath = e, this.logger = t;
|
|
1183
1183
|
}
|
|
@@ -1187,8 +1187,8 @@ var Yt = Object.defineProperty, Xt = (e, t, n) => t in e ? Yt(e, t, {
|
|
|
1187
1187
|
for (let t of e.modifications) switch (t.type) {
|
|
1188
1188
|
case "QueryUpdated": {
|
|
1189
1189
|
let e = this.queryPath(t.queryId);
|
|
1190
|
-
if (e) for (let n of t.logLines)
|
|
1191
|
-
let n =
|
|
1190
|
+
if (e) for (let n of t.logLines) Ot(this.logger, "info", "query", e, n);
|
|
1191
|
+
let n = ot(t.value ?? null);
|
|
1192
1192
|
this.remoteQuerySet.set(t.queryId, {
|
|
1193
1193
|
success: !0,
|
|
1194
1194
|
value: n,
|
|
@@ -1198,12 +1198,12 @@ var Yt = Object.defineProperty, Xt = (e, t, n) => t in e ? Yt(e, t, {
|
|
|
1198
1198
|
}
|
|
1199
1199
|
case "QueryFailed": {
|
|
1200
1200
|
let e = this.queryPath(t.queryId);
|
|
1201
|
-
if (e) for (let n of t.logLines)
|
|
1201
|
+
if (e) for (let n of t.logLines) Ot(this.logger, "info", "query", e, n);
|
|
1202
1202
|
let { errorData: n } = t;
|
|
1203
1203
|
this.remoteQuerySet.set(t.queryId, {
|
|
1204
1204
|
success: !1,
|
|
1205
1205
|
errorMessage: t.errorMessage,
|
|
1206
|
-
errorData: n === void 0 ? void 0 :
|
|
1206
|
+
errorData: n === void 0 ? void 0 : ot(n),
|
|
1207
1207
|
logLines: t.logLines
|
|
1208
1208
|
});
|
|
1209
1209
|
break;
|
|
@@ -1224,14 +1224,14 @@ var Yt = Object.defineProperty, Xt = (e, t, n) => t in e ? Yt(e, t, {
|
|
|
1224
1224
|
};
|
|
1225
1225
|
//#endregion
|
|
1226
1226
|
//#region ../../node_modules/.pnpm/convex@1.37.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/protocol.js
|
|
1227
|
-
function mn(e) {
|
|
1228
|
-
let t = Le(e);
|
|
1229
|
-
return rn.fromBytesLE(Array.from(t));
|
|
1230
|
-
}
|
|
1231
1227
|
function hn(e) {
|
|
1232
|
-
|
|
1228
|
+
let t = ze(e);
|
|
1229
|
+
return an.fromBytesLE(Array.from(t));
|
|
1233
1230
|
}
|
|
1234
1231
|
function gn(e) {
|
|
1232
|
+
return He(new Uint8Array(e.toBytesLE()));
|
|
1233
|
+
}
|
|
1234
|
+
function _n(e) {
|
|
1235
1235
|
switch (e.type) {
|
|
1236
1236
|
case "FatalError":
|
|
1237
1237
|
case "AuthError":
|
|
@@ -1240,23 +1240,23 @@ function gn(e) {
|
|
|
1240
1240
|
case "Ping": return { ...e };
|
|
1241
1241
|
case "MutationResponse": return e.success ? {
|
|
1242
1242
|
...e,
|
|
1243
|
-
ts:
|
|
1243
|
+
ts: hn(e.ts)
|
|
1244
1244
|
} : { ...e };
|
|
1245
1245
|
case "Transition": return {
|
|
1246
1246
|
...e,
|
|
1247
1247
|
startVersion: {
|
|
1248
1248
|
...e.startVersion,
|
|
1249
|
-
ts:
|
|
1249
|
+
ts: hn(e.startVersion.ts)
|
|
1250
1250
|
},
|
|
1251
1251
|
endVersion: {
|
|
1252
1252
|
...e.endVersion,
|
|
1253
|
-
ts:
|
|
1253
|
+
ts: hn(e.endVersion.ts)
|
|
1254
1254
|
}
|
|
1255
1255
|
};
|
|
1256
1256
|
default:
|
|
1257
1257
|
}
|
|
1258
1258
|
}
|
|
1259
|
-
function
|
|
1259
|
+
function vn(e) {
|
|
1260
1260
|
switch (e.type) {
|
|
1261
1261
|
case "Authenticate":
|
|
1262
1262
|
case "ModifyQuerySet":
|
|
@@ -1268,26 +1268,26 @@ function _n(e) {
|
|
|
1268
1268
|
maxObservedTimestamp: void 0
|
|
1269
1269
|
} : {
|
|
1270
1270
|
...e,
|
|
1271
|
-
maxObservedTimestamp:
|
|
1271
|
+
maxObservedTimestamp: gn(e.maxObservedTimestamp)
|
|
1272
1272
|
};
|
|
1273
1273
|
default:
|
|
1274
1274
|
}
|
|
1275
1275
|
}
|
|
1276
1276
|
//#endregion
|
|
1277
1277
|
//#region ../../node_modules/.pnpm/convex@1.37.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/web_socket_manager.js
|
|
1278
|
-
var
|
|
1278
|
+
var yn = Object.defineProperty, bn = (e, t, n) => t in e ? yn(e, t, {
|
|
1279
1279
|
enumerable: !0,
|
|
1280
1280
|
configurable: !0,
|
|
1281
1281
|
writable: !0,
|
|
1282
1282
|
value: n
|
|
1283
|
-
}) : e[t] = n,
|
|
1284
|
-
function Tn() {
|
|
1285
|
-
return wn === void 0 && (wn = Date.now()), typeof performance > "u" || !performance.now ? Date.now() : Math.round(wn + performance.now());
|
|
1286
|
-
}
|
|
1283
|
+
}) : e[t] = n, K = (e, t, n) => bn(e, typeof t == "symbol" ? t : t + "", n), xn = 1e3, Sn = 1001, Cn = 1005, wn = 4040, Tn;
|
|
1287
1284
|
function En() {
|
|
1288
|
-
return
|
|
1285
|
+
return Tn === void 0 && (Tn = Date.now()), typeof performance > "u" || !performance.now ? Date.now() : Math.round(Tn + performance.now());
|
|
1286
|
+
}
|
|
1287
|
+
function Dn() {
|
|
1288
|
+
return `t=${Math.round((En() - Tn) / 100) / 10}s`;
|
|
1289
1289
|
}
|
|
1290
|
-
var
|
|
1290
|
+
var On = {
|
|
1291
1291
|
InternalServerError: { timeout: 1e3 },
|
|
1292
1292
|
SubscriptionsWorkerFullError: { timeout: 3e3 },
|
|
1293
1293
|
TooManyConcurrentRequests: { timeout: 3e3 },
|
|
@@ -1303,14 +1303,14 @@ var Dn = {
|
|
|
1303
1303
|
SearchIndexTooLarge: { timeout: 3e3 },
|
|
1304
1304
|
TooManyWritesInTimePeriod: { timeout: 3e3 }
|
|
1305
1305
|
};
|
|
1306
|
-
function
|
|
1306
|
+
function kn(e) {
|
|
1307
1307
|
if (e === void 0) return "Unknown";
|
|
1308
|
-
for (let t of Object.keys(
|
|
1308
|
+
for (let t of Object.keys(On)) if (e.startsWith(t)) return t;
|
|
1309
1309
|
return "Unknown";
|
|
1310
1310
|
}
|
|
1311
|
-
var
|
|
1311
|
+
var An = class {
|
|
1312
1312
|
constructor(e, t, n, r, i, a) {
|
|
1313
|
-
this.markConnectionStateDirty = i, this.debug = a,
|
|
1313
|
+
this.markConnectionStateDirty = i, this.debug = a, K(this, "socket"), K(this, "connectionCount"), K(this, "_hasEverConnected", !1), K(this, "lastCloseReason"), K(this, "transitionChunkBuffer", null), K(this, "defaultInitialBackoff"), K(this, "maxBackoff"), K(this, "retries"), K(this, "serverInactivityThreshold"), K(this, "reconnectDueToServerInactivityTimeout"), K(this, "scheduledReconnect", null), K(this, "networkOnlineHandler", null), K(this, "pendingNetworkRecoveryInfo", null), K(this, "uri"), K(this, "onOpen"), K(this, "onResume"), K(this, "onMessage"), K(this, "webSocketConstructor"), K(this, "logger"), K(this, "onServerDisconnectError"), this.webSocketConstructor = n, this.socket = { state: "disconnected" }, this.connectionCount = 0, this.lastCloseReason = "InitialConnect", this.defaultInitialBackoff = 1e3, this.maxBackoff = 16e3, this.retries = 0, this.serverInactivityThreshold = 6e4, this.reconnectDueToServerInactivityTimeout = null, this.uri = e, this.onOpen = t.onOpen, this.onResume = t.onResume, this.onMessage = t.onMessage, this.onServerDisconnectError = t.onServerDisconnectError, this.logger = r, this.setupNetworkListener(), this.connect();
|
|
1314
1314
|
}
|
|
1315
1315
|
setSocketState(e) {
|
|
1316
1316
|
this.socket = e, this._logVerbose(`socket state changed: ${this.socket.state}, paused: ${"paused" in this.socket ? this.socket.paused : void 0}`), this.markConnectionStateDirty();
|
|
@@ -1336,7 +1336,7 @@ var kn = class {
|
|
|
1336
1336
|
if (this.transitionChunkBuffer.chunks.push(e.chunk), this.transitionChunkBuffer.chunks.length === e.totalParts) {
|
|
1337
1337
|
let e = this.transitionChunkBuffer.chunks.join("");
|
|
1338
1338
|
this.transitionChunkBuffer = null;
|
|
1339
|
-
let t =
|
|
1339
|
+
let t = _n(JSON.parse(e));
|
|
1340
1340
|
if (t.type !== "Transition") throw Error(`Expected Transition, got ${t.type} after assembling chunks`);
|
|
1341
1341
|
return t;
|
|
1342
1342
|
}
|
|
@@ -1359,8 +1359,8 @@ var kn = class {
|
|
|
1359
1359
|
}), this.resetServerInactivityTimeout(), this.socket.paused === "no" && (this._hasEverConnected = !0, this.onOpen({
|
|
1360
1360
|
connectionCount: this.connectionCount,
|
|
1361
1361
|
lastCloseReason: this.lastCloseReason,
|
|
1362
|
-
clientTs:
|
|
1363
|
-
})), this.lastCloseReason !== "InitialConnect" && (this.lastCloseReason ? this.logger.log("WebSocket reconnected at",
|
|
1362
|
+
clientTs: En()
|
|
1363
|
+
})), this.lastCloseReason !== "InitialConnect" && (this.lastCloseReason ? this.logger.log("WebSocket reconnected at", Dn(), "after disconnect due to", this.lastCloseReason) : this.logger.log("WebSocket reconnected at", Dn())), this.connectionCount += 1, this.lastCloseReason = null, this.pendingNetworkRecoveryInfo !== null) {
|
|
1364
1364
|
let { timeSavedMs: e } = this.pendingNetworkRecoveryInfo;
|
|
1365
1365
|
this.pendingNetworkRecoveryInfo = null, this.sendMessage({
|
|
1366
1366
|
type: "Event",
|
|
@@ -1374,7 +1374,7 @@ var kn = class {
|
|
|
1374
1374
|
t && this.logger.log(`WebSocket error message: ${t}`);
|
|
1375
1375
|
}, e.onmessage = (e) => {
|
|
1376
1376
|
this.resetServerInactivityTimeout();
|
|
1377
|
-
let t = e.data.length, n =
|
|
1377
|
+
let t = e.data.length, n = _n(JSON.parse(e.data));
|
|
1378
1378
|
if (this._logVerbose(`received ws message with type ${n.type}`), n.type !== "Ping") {
|
|
1379
1379
|
if (n.type === "TransitionChunk") {
|
|
1380
1380
|
let e = this.assembleTransition(n);
|
|
@@ -1387,11 +1387,11 @@ var kn = class {
|
|
|
1387
1387
|
}), this.onMessage(n).hasSyncedPastLastReconnect && (this.retries = 0, this.markConnectionStateDirty());
|
|
1388
1388
|
}
|
|
1389
1389
|
}, e.onclose = (e) => {
|
|
1390
|
-
if (this._logVerbose("begin ws.onclose"), this.transitionChunkBuffer = null, this.lastCloseReason === null && (this.lastCloseReason = e.reason || `closed with code ${e.code}`), e.code !==
|
|
1390
|
+
if (this._logVerbose("begin ws.onclose"), this.transitionChunkBuffer = null, this.lastCloseReason === null && (this.lastCloseReason = e.reason || `closed with code ${e.code}`), e.code !== xn && e.code !== Sn && e.code !== Cn && e.code !== wn) {
|
|
1391
1391
|
let t = `WebSocket closed with code ${e.code}`;
|
|
1392
1392
|
e.reason && (t += `: ${e.reason}`), this.logger.log(t), this.onServerDisconnectError && e.reason && this.onServerDisconnectError(t);
|
|
1393
1393
|
}
|
|
1394
|
-
let t =
|
|
1394
|
+
let t = kn(e.reason);
|
|
1395
1395
|
this.scheduleReconnect(t);
|
|
1396
1396
|
};
|
|
1397
1397
|
}
|
|
@@ -1404,7 +1404,7 @@ var kn = class {
|
|
|
1404
1404
|
...e.type === "Authenticate" && e.tokenType === "User" ? { value: `...${e.value.slice(-7)}` } : {}
|
|
1405
1405
|
};
|
|
1406
1406
|
if (this.socket.state === "ready" && this.socket.paused === "no") {
|
|
1407
|
-
let n =
|
|
1407
|
+
let n = vn(e), r = JSON.stringify(n), i = !1;
|
|
1408
1408
|
try {
|
|
1409
1409
|
this.socket.ws.send(r), i = !0;
|
|
1410
1410
|
} catch (e) {
|
|
@@ -1423,7 +1423,7 @@ var kn = class {
|
|
|
1423
1423
|
this.scheduledReconnect &&= (clearTimeout(this.scheduledReconnect.timeout), null), this.socket = { state: "disconnected" };
|
|
1424
1424
|
let t = this.nextBackoff(e);
|
|
1425
1425
|
this.markConnectionStateDirty(), this.logger.log(`Attempting reconnect in ${Math.round(t)}ms`);
|
|
1426
|
-
let n =
|
|
1426
|
+
let n = En(), r = setTimeout(() => {
|
|
1427
1427
|
this.scheduledReconnect?.timeout === r && (this.scheduledReconnect = null, this.connect());
|
|
1428
1428
|
}, t);
|
|
1429
1429
|
this.scheduledReconnect = {
|
|
@@ -1541,7 +1541,7 @@ var kn = class {
|
|
|
1541
1541
|
}
|
|
1542
1542
|
let e = null;
|
|
1543
1543
|
if (this.scheduledReconnect) {
|
|
1544
|
-
let t =
|
|
1544
|
+
let t = En() - this.scheduledReconnect.scheduledAt;
|
|
1545
1545
|
e = Math.max(0, this.scheduledReconnect.backoffMs - t), this._logVerbose(`would have waited ${Math.round(e)}ms more (backoff was ${Math.round(this.scheduledReconnect.backoffMs)}ms, elapsed ${Math.round(t)}ms)`), clearTimeout(this.scheduledReconnect.timeout), this.scheduledReconnect = null, this._logVerbose("canceled scheduled reconnect");
|
|
1546
1546
|
}
|
|
1547
1547
|
this.logger.log("Network recovery detected, reconnecting immediately"), this.pendingNetworkRecoveryInfo = e === null ? null : { timeSavedMs: e }, this.connect();
|
|
@@ -1561,7 +1561,7 @@ var kn = class {
|
|
|
1561
1561
|
}, this._hasEverConnected = !0, this.onOpen({
|
|
1562
1562
|
connectionCount: this.connectionCount,
|
|
1563
1563
|
lastCloseReason: this.lastCloseReason,
|
|
1564
|
-
clientTs:
|
|
1564
|
+
clientTs: En()
|
|
1565
1565
|
})) : this.socket.paused === "yes" && (this.socket = {
|
|
1566
1566
|
...this.socket,
|
|
1567
1567
|
paused: "no"
|
|
@@ -1586,14 +1586,14 @@ var kn = class {
|
|
|
1586
1586
|
this.logger.logVerbose(e);
|
|
1587
1587
|
}
|
|
1588
1588
|
nextBackoff(e) {
|
|
1589
|
-
let t = (e === "client" ? 100 : e === "Unknown" ? this.defaultInitialBackoff :
|
|
1589
|
+
let t = (e === "client" ? 100 : e === "Unknown" ? this.defaultInitialBackoff : On[e].timeout) * 2 ** this.retries;
|
|
1590
1590
|
this.retries += 1;
|
|
1591
1591
|
let n = Math.min(t, this.maxBackoff);
|
|
1592
1592
|
return n + n * (Math.random() - .5);
|
|
1593
1593
|
}
|
|
1594
1594
|
reportLargeTransition({ transition: e, messageLength: t }) {
|
|
1595
1595
|
if (e.clientClockSkew === void 0 || e.serverTs === void 0) return;
|
|
1596
|
-
let n =
|
|
1596
|
+
let n = En() - e.clientClockSkew - e.serverTs / 1e6, r = `${Math.round(n)}ms`, i = `${Math.round(t / 1e4) / 100}MB`, a = t / (n / 1e3), o = `${Math.round(a / 1e4) / 100}MB per second`;
|
|
1597
1597
|
this._logVerbose(`received ${i} transition in ${r} at ${o}`), t > 2e7 ? this.logger.log(`received query results totaling more that 20MB (${i}) which will take a long time to download on slower connections`) : n > 2e4 && this.logger.log(`received query results totaling ${i} which took more than 20s to arrive (${r})`), this.debug && this.sendMessage({
|
|
1598
1598
|
type: "Event",
|
|
1599
1599
|
eventType: "ClientReceivedTransition",
|
|
@@ -1606,10 +1606,10 @@ var kn = class {
|
|
|
1606
1606
|
};
|
|
1607
1607
|
//#endregion
|
|
1608
1608
|
//#region ../../node_modules/.pnpm/convex@1.37.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/session.js
|
|
1609
|
-
function An() {
|
|
1610
|
-
return jn();
|
|
1611
|
-
}
|
|
1612
1609
|
function jn() {
|
|
1610
|
+
return Mn();
|
|
1611
|
+
}
|
|
1612
|
+
function Mn() {
|
|
1613
1613
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e) => {
|
|
1614
1614
|
let t = Math.random() * 16 | 0;
|
|
1615
1615
|
return (e === "x" ? t : t & 3 | 8).toString(16);
|
|
@@ -1617,15 +1617,15 @@ function jn() {
|
|
|
1617
1617
|
}
|
|
1618
1618
|
//#endregion
|
|
1619
1619
|
//#region ../../node_modules/.pnpm/convex@1.37.0_react@19.2.6/node_modules/convex/dist/esm/vendor/jwt-decode/index.js
|
|
1620
|
-
var
|
|
1621
|
-
|
|
1622
|
-
function
|
|
1620
|
+
var Nn = class extends Error {};
|
|
1621
|
+
Nn.prototype.name = "InvalidTokenError";
|
|
1622
|
+
function Pn(e) {
|
|
1623
1623
|
return decodeURIComponent(atob(e).replace(/(.)/g, (e, t) => {
|
|
1624
1624
|
let n = t.charCodeAt(0).toString(16).toUpperCase();
|
|
1625
1625
|
return n.length < 2 && (n = "0" + n), "%" + n;
|
|
1626
1626
|
}));
|
|
1627
1627
|
}
|
|
1628
|
-
function
|
|
1628
|
+
function Fn(e) {
|
|
1629
1629
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
1630
1630
|
switch (t.length % 4) {
|
|
1631
1631
|
case 0: break;
|
|
@@ -1638,38 +1638,38 @@ function Pn(e) {
|
|
|
1638
1638
|
default: throw Error("base64 string is not of the correct length");
|
|
1639
1639
|
}
|
|
1640
1640
|
try {
|
|
1641
|
-
return
|
|
1641
|
+
return Pn(t);
|
|
1642
1642
|
} catch {
|
|
1643
1643
|
return atob(t);
|
|
1644
1644
|
}
|
|
1645
1645
|
}
|
|
1646
|
-
function
|
|
1647
|
-
if (typeof e != "string") throw new
|
|
1646
|
+
function In(e, t) {
|
|
1647
|
+
if (typeof e != "string") throw new Nn("Invalid token specified: must be a string");
|
|
1648
1648
|
t ||= {};
|
|
1649
1649
|
let n = t.header === !0 ? 0 : 1, r = e.split(".")[n];
|
|
1650
|
-
if (typeof r != "string") throw new
|
|
1650
|
+
if (typeof r != "string") throw new Nn(`Invalid token specified: missing part #${n + 1}`);
|
|
1651
1651
|
let i;
|
|
1652
1652
|
try {
|
|
1653
|
-
i =
|
|
1653
|
+
i = Fn(r);
|
|
1654
1654
|
} catch (e) {
|
|
1655
|
-
throw new
|
|
1655
|
+
throw new Nn(`Invalid token specified: invalid base64 for part #${n + 1} (${e.message})`);
|
|
1656
1656
|
}
|
|
1657
1657
|
try {
|
|
1658
1658
|
return JSON.parse(i);
|
|
1659
1659
|
} catch (e) {
|
|
1660
|
-
throw new
|
|
1660
|
+
throw new Nn(`Invalid token specified: invalid json for part #${n + 1} (${e.message})`);
|
|
1661
1661
|
}
|
|
1662
1662
|
}
|
|
1663
1663
|
//#endregion
|
|
1664
1664
|
//#region ../../node_modules/.pnpm/convex@1.37.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/authentication_manager.js
|
|
1665
|
-
var
|
|
1665
|
+
var Ln = Object.defineProperty, Rn = (e, t, n) => t in e ? Ln(e, t, {
|
|
1666
1666
|
enumerable: !0,
|
|
1667
1667
|
configurable: !0,
|
|
1668
1668
|
writable: !0,
|
|
1669
1669
|
value: n
|
|
1670
|
-
}) : e[t] = n,
|
|
1670
|
+
}) : e[t] = n, q = (e, t, n) => Rn(e, typeof t == "symbol" ? t : t + "", n), zn = 480 * 60 * 60 * 1e3, Bn = 2, Vn = class {
|
|
1671
1671
|
constructor(e, t, n) {
|
|
1672
|
-
|
|
1672
|
+
q(this, "authState", { state: "noAuth" }), q(this, "configVersion", 0), q(this, "syncState"), q(this, "authenticate"), q(this, "stopSocket"), q(this, "tryRestartSocket"), q(this, "pauseSocket"), q(this, "resumeSocket"), q(this, "clearAuth"), q(this, "logger"), q(this, "refreshTokenLeewaySeconds"), q(this, "tokenConfirmationAttempts", 0), this.syncState = e, this.authenticate = t.authenticate, this.stopSocket = t.stopSocket, this.tryRestartSocket = t.tryRestartSocket, this.pauseSocket = t.pauseSocket, this.resumeSocket = t.resumeSocket, this.clearAuth = t.clearAuth, this.logger = n.logger, this.refreshTokenLeewaySeconds = n.refreshTokenLeewaySeconds;
|
|
1673
1673
|
}
|
|
1674
1674
|
async setConfig(e, t) {
|
|
1675
1675
|
this.resetAuthState(), this._logVerbose("pausing WS for auth token fetch"), this.pauseSocket();
|
|
@@ -1711,11 +1711,11 @@ var In = Object.defineProperty, Ln = (e, t, n) => t in e ? In(e, t, {
|
|
|
1711
1711
|
this.tryToReauthenticate(e);
|
|
1712
1712
|
}
|
|
1713
1713
|
async tryToReauthenticate(e) {
|
|
1714
|
-
if (this._logVerbose(`attempting to reauthenticate: ${e.error}`), this.authState.state === "noAuth" || this.authState.state === "waitingForServerConfirmationOfFreshToken" && this.tokenConfirmationAttempts >=
|
|
1714
|
+
if (this._logVerbose(`attempting to reauthenticate: ${e.error}`), this.authState.state === "noAuth" || this.authState.state === "waitingForServerConfirmationOfFreshToken" && this.tokenConfirmationAttempts >= Bn) {
|
|
1715
1715
|
this.logger.error(`Failed to authenticate: "${e.error}", check your server auth config`), this.syncState.hasAuth() && this.syncState.clearAuth(), this.authState.state !== "noAuth" && this.setAndReportAuthFailed(this.authState.config.onAuthChange);
|
|
1716
1716
|
return;
|
|
1717
1717
|
}
|
|
1718
|
-
this.authState.state === "waitingForServerConfirmationOfFreshToken" && (this.tokenConfirmationAttempts++, this._logVerbose(`retrying reauthentication, ${
|
|
1718
|
+
this.authState.state === "waitingForServerConfirmationOfFreshToken" && (this.tokenConfirmationAttempts++, this._logVerbose(`retrying reauthentication, ${Bn - this.tokenConfirmationAttempts} attempts remaining`)), await this.stopSocket();
|
|
1719
1719
|
let t = await this.fetchTokenAndGuardAgainstRace(this.authState.config.fetchToken, { forceRefreshToken: !0 });
|
|
1720
1720
|
t.isFromOutdatedConfig || (t.value && this.syncState.isNewAuth(t.value) ? (this.authenticate(t.value), this.setAuthState({
|
|
1721
1721
|
state: "waitingForServerConfirmationOfFreshToken",
|
|
@@ -1755,7 +1755,7 @@ var In = Object.defineProperty, Ln = (e, t, n) => t in e ? In(e, t, {
|
|
|
1755
1755
|
this.logger.error("Auth token does not live long enough, cannot refetch the token");
|
|
1756
1756
|
return;
|
|
1757
1757
|
}
|
|
1758
|
-
let a = Math.min(
|
|
1758
|
+
let a = Math.min(zn, (i - this.refreshTokenLeewaySeconds) * 1e3);
|
|
1759
1759
|
a <= 0 && (this.logger.warn(`Refetching auth token immediately, configured leeway ${this.refreshTokenLeewaySeconds}s is larger than the token's lifetime ${i}s`), a = 0);
|
|
1760
1760
|
let o = setTimeout(() => {
|
|
1761
1761
|
this._logVerbose("running scheduled token refetch"), this.refetchToken();
|
|
@@ -1805,7 +1805,7 @@ var In = Object.defineProperty, Ln = (e, t, n) => t in e ? In(e, t, {
|
|
|
1805
1805
|
}
|
|
1806
1806
|
decodeToken(e) {
|
|
1807
1807
|
try {
|
|
1808
|
-
return
|
|
1808
|
+
return In(e);
|
|
1809
1809
|
} catch (e) {
|
|
1810
1810
|
return this._logVerbose(`Error decoding token: ${e instanceof Error ? e.message : "Unknown error"}`), null;
|
|
1811
1811
|
}
|
|
@@ -1813,41 +1813,41 @@ var In = Object.defineProperty, Ln = (e, t, n) => t in e ? In(e, t, {
|
|
|
1813
1813
|
_logVerbose(e) {
|
|
1814
1814
|
this.logger.logVerbose(`${e} [v${this.configVersion}]`);
|
|
1815
1815
|
}
|
|
1816
|
-
},
|
|
1816
|
+
}, Hn = [
|
|
1817
1817
|
"convexClientConstructed",
|
|
1818
1818
|
"convexWebSocketOpen",
|
|
1819
1819
|
"convexFirstMessageReceived"
|
|
1820
1820
|
];
|
|
1821
|
-
function
|
|
1821
|
+
function Un(e, t) {
|
|
1822
1822
|
let n = { sessionId: t };
|
|
1823
1823
|
typeof performance > "u" || !performance.mark || performance.mark(e, { detail: n });
|
|
1824
1824
|
}
|
|
1825
|
-
function
|
|
1825
|
+
function Wn(e) {
|
|
1826
1826
|
let t = e.name.slice(6);
|
|
1827
1827
|
return t = t.charAt(0).toLowerCase() + t.slice(1), {
|
|
1828
1828
|
name: t,
|
|
1829
1829
|
startTime: e.startTime
|
|
1830
1830
|
};
|
|
1831
1831
|
}
|
|
1832
|
-
function
|
|
1832
|
+
function Gn(e) {
|
|
1833
1833
|
if (typeof performance > "u" || !performance.getEntriesByName) return [];
|
|
1834
1834
|
let t = [];
|
|
1835
|
-
for (let n of
|
|
1835
|
+
for (let n of Hn) {
|
|
1836
1836
|
let r = performance.getEntriesByName(n).filter((e) => e.entryType === "mark").filter((t) => t.detail.sessionId === e);
|
|
1837
1837
|
t.push(...r);
|
|
1838
1838
|
}
|
|
1839
|
-
return t.map(
|
|
1839
|
+
return t.map(Wn);
|
|
1840
1840
|
}
|
|
1841
1841
|
//#endregion
|
|
1842
1842
|
//#region ../../node_modules/.pnpm/convex@1.37.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/client.js
|
|
1843
|
-
var
|
|
1843
|
+
var Kn = Object.defineProperty, qn = (e, t, n) => t in e ? Kn(e, t, {
|
|
1844
1844
|
enumerable: !0,
|
|
1845
1845
|
configurable: !0,
|
|
1846
1846
|
writable: !0,
|
|
1847
1847
|
value: n
|
|
1848
|
-
}) : e[t] = n,
|
|
1848
|
+
}) : e[t] = n, J = (e, t, n) => qn(e, typeof t == "symbol" ? t : t + "", n), Jn = class {
|
|
1849
1849
|
constructor(e, t, n) {
|
|
1850
|
-
if (
|
|
1850
|
+
if (J(this, "address"), J(this, "state"), J(this, "requestManager"), J(this, "webSocketManager"), J(this, "authenticationManager"), J(this, "remoteQuerySet"), J(this, "optimisticQueryResults"), J(this, "_transitionHandlerCounter", 0), J(this, "_nextRequestId"), J(this, "_onTransitionFns", /* @__PURE__ */ new Map()), J(this, "_sessionId"), J(this, "firstMessageReceived", !1), J(this, "debug"), J(this, "logger"), J(this, "maxObservedTimestamp"), J(this, "connectionStateSubscribers", /* @__PURE__ */ new Map()), J(this, "nextConnectionStateSubscriberId", 0), J(this, "_lastPublishedConnectionState"), J(this, "markConnectionStateDirty", () => {
|
|
1851
1851
|
Promise.resolve().then(() => {
|
|
1852
1852
|
let e = this.connectionState();
|
|
1853
1853
|
if (JSON.stringify(e) !== JSON.stringify(this._lastPublishedConnectionState)) {
|
|
@@ -1855,25 +1855,25 @@ var Gn = Object.defineProperty, Kn = (e, t, n) => t in e ? Gn(e, t, {
|
|
|
1855
1855
|
for (let t of this.connectionStateSubscribers.values()) t(e);
|
|
1856
1856
|
}
|
|
1857
1857
|
});
|
|
1858
|
-
}),
|
|
1859
|
-
this.debug &&
|
|
1858
|
+
}), J(this, "mark", (e) => {
|
|
1859
|
+
this.debug && Un(e, this.sessionId);
|
|
1860
1860
|
}), typeof e == "object") throw Error("Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly.");
|
|
1861
|
-
n?.skipConvexDeploymentUrlCheck !== !0 &&
|
|
1861
|
+
n?.skipConvexDeploymentUrlCheck !== !0 && Ue(e), n = { ...n };
|
|
1862
1862
|
let r = n.authRefreshTokenLeewaySeconds ?? 10, i = n.webSocketConstructor;
|
|
1863
1863
|
if (!i && typeof WebSocket > "u") throw Error("No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient");
|
|
1864
|
-
i ||= WebSocket, this.debug = n.reportDebugInfoToConvex ?? !1, this.address = e, this.logger = n.logger === !1 ?
|
|
1864
|
+
i ||= WebSocket, this.debug = n.reportDebugInfoToConvex ?? !1, this.address = e, this.logger = n.logger === !1 ? Dt({ verbose: n.verbose ?? !1 }) : n.logger !== !0 && n.logger ? n.logger : Et({ verbose: n.verbose ?? !1 });
|
|
1865
1865
|
let a = e.search("://");
|
|
1866
1866
|
if (a === -1) throw Error("Provided address was not an absolute URL.");
|
|
1867
1867
|
let o = e.substring(a + 3), s = e.substring(0, a), c;
|
|
1868
1868
|
if (s === "http") c = "ws";
|
|
1869
1869
|
else if (s === "https") c = "wss";
|
|
1870
1870
|
else throw Error(`Unknown parent protocol ${s}`);
|
|
1871
|
-
let l = `${c}://${o}/api/${
|
|
1872
|
-
this.state = new
|
|
1871
|
+
let l = `${c}://${o}/api/${Me}/sync`;
|
|
1872
|
+
this.state = new Rt(), this.remoteQuerySet = new mn((e) => this.state.queryPath(e), this.logger), this.requestManager = new Ht(this.logger, this.markConnectionStateDirty);
|
|
1873
1873
|
let u = () => {
|
|
1874
1874
|
this.webSocketManager.pause(), this.state.pause();
|
|
1875
1875
|
};
|
|
1876
|
-
this.authenticationManager = new
|
|
1876
|
+
this.authenticationManager = new Vn(this.state, {
|
|
1877
1877
|
authenticate: (e) => {
|
|
1878
1878
|
let t = this.state.setAuth(e);
|
|
1879
1879
|
return this.webSocketManager.sendMessage(t), t.baseVersion;
|
|
@@ -1888,9 +1888,9 @@ var Gn = Object.defineProperty, Kn = (e, t, n) => t in e ? Gn(e, t, {
|
|
|
1888
1888
|
}, {
|
|
1889
1889
|
logger: this.logger,
|
|
1890
1890
|
refreshTokenLeewaySeconds: r
|
|
1891
|
-
}), this.optimisticQueryResults = new
|
|
1891
|
+
}), this.optimisticQueryResults = new en(), this.addOnTransitionHandler((e) => {
|
|
1892
1892
|
t(e.queries.map((e) => e.token));
|
|
1893
|
-
}), this._nextRequestId = 0, this._sessionId =
|
|
1893
|
+
}), this._nextRequestId = 0, this._sessionId = jn();
|
|
1894
1894
|
let { unsavedChangesWarning: d } = n;
|
|
1895
1895
|
if (typeof window > "u" || window.addEventListener === void 0) {
|
|
1896
1896
|
if (d === !0) throw Error("unsavedChangesWarning requested, but window.addEventListener not found! Remove {unsavedChangesWarning: true} from Convex client options.");
|
|
@@ -1901,14 +1901,14 @@ var Gn = Object.defineProperty, Kn = (e, t, n) => t in e ? Gn(e, t, {
|
|
|
1901
1901
|
return (e || window.event).returnValue = t, t;
|
|
1902
1902
|
}
|
|
1903
1903
|
});
|
|
1904
|
-
this.webSocketManager = new
|
|
1904
|
+
this.webSocketManager = new An(l, {
|
|
1905
1905
|
onOpen: (e) => {
|
|
1906
1906
|
this.mark("convexWebSocketOpen"), this.webSocketManager.sendMessage({
|
|
1907
1907
|
...e,
|
|
1908
1908
|
type: "Connect",
|
|
1909
1909
|
sessionId: this._sessionId,
|
|
1910
1910
|
maxObservedTimestamp: this.maxObservedTimestamp
|
|
1911
|
-
}), this.remoteQuerySet = new
|
|
1911
|
+
}), this.remoteQuerySet = new mn((e) => this.state.queryPath(e), this.logger);
|
|
1912
1912
|
let [t, n] = this.state.restart();
|
|
1913
1913
|
n && this.webSocketManager.sendMessage(n), this.webSocketManager.sendMessage(t);
|
|
1914
1914
|
for (let e of this.requestManager.restart()) this.webSocketManager.sendMessage(e);
|
|
@@ -1939,7 +1939,7 @@ var Gn = Object.defineProperty, Kn = (e, t, n) => t in e ? Gn(e, t, {
|
|
|
1939
1939
|
this.authenticationManager.onAuthError(e);
|
|
1940
1940
|
break;
|
|
1941
1941
|
case "FatalError": {
|
|
1942
|
-
let t =
|
|
1942
|
+
let t = kt(this.logger, e.error);
|
|
1943
1943
|
throw this.webSocketManager.terminate(), t;
|
|
1944
1944
|
}
|
|
1945
1945
|
default:
|
|
@@ -1997,7 +1997,7 @@ var Gn = Object.defineProperty, Kn = (e, t, n) => t in e ? Gn(e, t, {
|
|
|
1997
1997
|
getCurrentAuthClaims() {
|
|
1998
1998
|
let e = this.state.getAuth(), t = {};
|
|
1999
1999
|
if (e && e.tokenType === "User") try {
|
|
2000
|
-
t = e ?
|
|
2000
|
+
t = e ? In(e.value) : {};
|
|
2001
2001
|
} catch {
|
|
2002
2002
|
t = {};
|
|
2003
2003
|
}
|
|
@@ -2022,7 +2022,7 @@ var Gn = Object.defineProperty, Kn = (e, t, n) => t in e ? Gn(e, t, {
|
|
|
2022
2022
|
this.webSocketManager.sendMessage(e);
|
|
2023
2023
|
}
|
|
2024
2024
|
subscribe(e, t, n) {
|
|
2025
|
-
let r =
|
|
2025
|
+
let r = U(t), { modification: i, queryToken: a, unsubscribe: o } = this.state.subscribe(e, r, n?.journal, n?.componentPath);
|
|
2026
2026
|
return i !== null && this.webSocketManager.sendMessage(i), {
|
|
2027
2027
|
queryToken: a,
|
|
2028
2028
|
unsubscribe: () => {
|
|
@@ -2032,7 +2032,7 @@ var Gn = Object.defineProperty, Kn = (e, t, n) => t in e ? Gn(e, t, {
|
|
|
2032
2032
|
};
|
|
2033
2033
|
}
|
|
2034
2034
|
localQueryResult(e, t) {
|
|
2035
|
-
let n =
|
|
2035
|
+
let n = Nt(e, U(t));
|
|
2036
2036
|
return this.optimisticQueryResults.queryResult(n);
|
|
2037
2037
|
}
|
|
2038
2038
|
localQueryResultByToken(e) {
|
|
@@ -2042,11 +2042,11 @@ var Gn = Object.defineProperty, Kn = (e, t, n) => t in e ? Gn(e, t, {
|
|
|
2042
2042
|
return this.optimisticQueryResults.hasQueryResult(e);
|
|
2043
2043
|
}
|
|
2044
2044
|
localQueryLogs(e, t) {
|
|
2045
|
-
let n =
|
|
2045
|
+
let n = Nt(e, U(t));
|
|
2046
2046
|
return this.optimisticQueryResults.queryLogs(n);
|
|
2047
2047
|
}
|
|
2048
2048
|
queryJournal(e, t) {
|
|
2049
|
-
let n =
|
|
2049
|
+
let n = Nt(e, U(t));
|
|
2050
2050
|
return this.state.queryJournal(n);
|
|
2051
2051
|
}
|
|
2052
2052
|
connectionState() {
|
|
@@ -2070,7 +2070,7 @@ var Gn = Object.defineProperty, Kn = (e, t, n) => t in e ? Gn(e, t, {
|
|
|
2070
2070
|
}
|
|
2071
2071
|
async mutation(e, t, n) {
|
|
2072
2072
|
let r = await this.mutationInternal(e, t, n);
|
|
2073
|
-
if (!r.success) throw r.errorData === void 0 ? Error(
|
|
2073
|
+
if (!r.success) throw r.errorData === void 0 ? Error(At("mutation", e, r)) : jt(r, new yt(At("mutation", e, r)));
|
|
2074
2074
|
return r.value;
|
|
2075
2075
|
}
|
|
2076
2076
|
async mutationInternal(e, t, n, r) {
|
|
@@ -2078,7 +2078,7 @@ var Gn = Object.defineProperty, Kn = (e, t, n) => t in e ? Gn(e, t, {
|
|
|
2078
2078
|
return i;
|
|
2079
2079
|
}
|
|
2080
2080
|
enqueueMutation(e, t, n, r) {
|
|
2081
|
-
let i =
|
|
2081
|
+
let i = U(t);
|
|
2082
2082
|
this.tryReportLongDisconnect();
|
|
2083
2083
|
let a = this.nextRequestId;
|
|
2084
2084
|
if (this._nextRequestId++, n !== void 0) {
|
|
@@ -2112,7 +2112,7 @@ var Gn = Object.defineProperty, Kn = (e, t, n) => t in e ? Gn(e, t, {
|
|
|
2112
2112
|
requestId: a,
|
|
2113
2113
|
udfPath: e,
|
|
2114
2114
|
componentPath: r,
|
|
2115
|
-
args: [
|
|
2115
|
+
args: [ft(i)]
|
|
2116
2116
|
}, s = this.webSocketManager.sendMessage(o);
|
|
2117
2117
|
return {
|
|
2118
2118
|
requestId: a,
|
|
@@ -2121,18 +2121,18 @@ var Gn = Object.defineProperty, Kn = (e, t, n) => t in e ? Gn(e, t, {
|
|
|
2121
2121
|
}
|
|
2122
2122
|
async action(e, t) {
|
|
2123
2123
|
let n = await this.actionInternal(e, t);
|
|
2124
|
-
if (!n.success) throw n.errorData === void 0 ? Error(
|
|
2124
|
+
if (!n.success) throw n.errorData === void 0 ? Error(At("action", e, n)) : jt(n, new yt(At("action", e, n)));
|
|
2125
2125
|
return n.value;
|
|
2126
2126
|
}
|
|
2127
2127
|
async actionInternal(e, t, n) {
|
|
2128
|
-
let r =
|
|
2128
|
+
let r = U(t), i = this.nextRequestId;
|
|
2129
2129
|
this._nextRequestId++, this.tryReportLongDisconnect();
|
|
2130
2130
|
let a = {
|
|
2131
2131
|
type: "Action",
|
|
2132
2132
|
requestId: i,
|
|
2133
2133
|
udfPath: e,
|
|
2134
2134
|
componentPath: n,
|
|
2135
|
-
args: [
|
|
2135
|
+
args: [ft(r)]
|
|
2136
2136
|
}, o = this.webSocketManager.sendMessage(a);
|
|
2137
2137
|
return this.requestManager.request(a, o);
|
|
2138
2138
|
}
|
|
@@ -2150,7 +2150,7 @@ var Gn = Object.defineProperty, Kn = (e, t, n) => t in e ? Gn(e, t, {
|
|
|
2150
2150
|
}
|
|
2151
2151
|
reportMarks() {
|
|
2152
2152
|
if (this.debug) {
|
|
2153
|
-
let e =
|
|
2153
|
+
let e = Gn(this.sessionId);
|
|
2154
2154
|
this.webSocketManager.sendMessage({
|
|
2155
2155
|
type: "Event",
|
|
2156
2156
|
eventType: "ClientConnect",
|
|
@@ -2167,7 +2167,7 @@ var Gn = Object.defineProperty, Kn = (e, t, n) => t in e ? Gn(e, t, {
|
|
|
2167
2167
|
method: "POST",
|
|
2168
2168
|
headers: {
|
|
2169
2169
|
"Content-Type": "application/json",
|
|
2170
|
-
"Convex-Client": `npm-${
|
|
2170
|
+
"Convex-Client": `npm-${Me}`
|
|
2171
2171
|
},
|
|
2172
2172
|
body: JSON.stringify({ event: "LongWebsocketDisconnect" })
|
|
2173
2173
|
}).then((e) => {
|
|
@@ -2179,23 +2179,23 @@ var Gn = Object.defineProperty, Kn = (e, t, n) => t in e ? Gn(e, t, {
|
|
|
2179
2179
|
};
|
|
2180
2180
|
//#endregion
|
|
2181
2181
|
//#region ../../node_modules/.pnpm/convex@1.37.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/pagination.js
|
|
2182
|
-
function
|
|
2182
|
+
function Yn(e) {
|
|
2183
2183
|
if (typeof e != "object" || !e || !Array.isArray(e.page) || typeof e.isDone != "boolean" || typeof e.continueCursor != "string") throw Error(`Not a valid paginated query result: ${e?.toString()}`);
|
|
2184
2184
|
return e;
|
|
2185
2185
|
}
|
|
2186
2186
|
//#endregion
|
|
2187
2187
|
//#region ../../node_modules/.pnpm/convex@1.37.0_react@19.2.6/node_modules/convex/dist/esm/browser/sync/paginated_query_client.js
|
|
2188
|
-
var
|
|
2188
|
+
var Xn = Object.defineProperty, Zn = (e, t, n) => t in e ? Xn(e, t, {
|
|
2189
2189
|
enumerable: !0,
|
|
2190
2190
|
configurable: !0,
|
|
2191
2191
|
writable: !0,
|
|
2192
2192
|
value: n
|
|
2193
|
-
}) : e[t] = n,
|
|
2193
|
+
}) : e[t] = n, Qn = (e, t, n) => Zn(e, typeof t == "symbol" ? t : t + "", n), $n = class {
|
|
2194
2194
|
constructor(e, t) {
|
|
2195
|
-
this.client = e, this.onTransition = t,
|
|
2195
|
+
this.client = e, this.onTransition = t, Qn(this, "paginatedQuerySet", /* @__PURE__ */ new Map()), Qn(this, "lastTransitionTs"), this.lastTransitionTs = an.fromNumber(0), this.client.addOnTransitionHandler((e) => this.onBaseTransition(e));
|
|
2196
2196
|
}
|
|
2197
2197
|
subscribe(e, t, n) {
|
|
2198
|
-
let r =
|
|
2198
|
+
let r = Mt(e), i = Pt(r, t, n), a = () => this.removePaginatedQuerySubscriber(i), o = this.paginatedQuerySet.get(i);
|
|
2199
2199
|
return o ? (o.numSubscribers += 1, {
|
|
2200
2200
|
paginatedQueryToken: i,
|
|
2201
2201
|
unsubscribe: a
|
|
@@ -2217,7 +2217,7 @@ var Yn = Object.defineProperty, Xn = (e, t, n) => t in e ? Yn(e, t, {
|
|
|
2217
2217
|
});
|
|
2218
2218
|
}
|
|
2219
2219
|
localQueryResult(e, t, n) {
|
|
2220
|
-
let r =
|
|
2220
|
+
let r = Pt(Mt(e), t, n);
|
|
2221
2221
|
return this.localQueryResultByToken(r);
|
|
2222
2222
|
}
|
|
2223
2223
|
localQueryResultByToken(e) {
|
|
@@ -2236,7 +2236,7 @@ var Yn = Object.defineProperty, Xn = (e, t, n) => t in e ? Yn(e, t, {
|
|
|
2236
2236
|
i = !0, a = !1;
|
|
2237
2237
|
continue;
|
|
2238
2238
|
}
|
|
2239
|
-
let n =
|
|
2239
|
+
let n = Yn(t);
|
|
2240
2240
|
r = r.concat(n.page), a = !!n.isDone;
|
|
2241
2241
|
}
|
|
2242
2242
|
let o;
|
|
@@ -2265,7 +2265,7 @@ var Yn = Object.defineProperty, Xn = (e, t, n) => t in e ? Yn(e, t, {
|
|
|
2265
2265
|
this.mustGetPaginatedQuery(e);
|
|
2266
2266
|
let n = this.queryTokenForLastPageOfPaginatedQuery(e), r = this.client.localQueryResultByToken(n);
|
|
2267
2267
|
if (!r) return !1;
|
|
2268
|
-
let i =
|
|
2268
|
+
let i = Yn(r);
|
|
2269
2269
|
if (i.isDone) return !1;
|
|
2270
2270
|
this.addPageToPaginatedQuery(e, i.continueCursor, t);
|
|
2271
2271
|
let a = {
|
|
@@ -2299,7 +2299,7 @@ var Yn = Object.defineProperty, Xn = (e, t, n) => t in e ? Yn(e, t, {
|
|
|
2299
2299
|
if (r.has(n)) continue;
|
|
2300
2300
|
let a = i.get(n).queryToken, o = t(a);
|
|
2301
2301
|
if (!o) continue;
|
|
2302
|
-
let s =
|
|
2302
|
+
let s = Yn(o);
|
|
2303
2303
|
s.splitCursor && (s.pageStatus === "SplitRecommended" || s.pageStatus === "SplitRequired" || s.page.length > e.options.initialNumItems * 2) && this.splitPaginatedQueryPage(e, n, s.splitCursor, s.continueCursor);
|
|
2304
2304
|
}
|
|
2305
2305
|
}
|
|
@@ -2368,16 +2368,16 @@ var Yn = Object.defineProperty, Xn = (e, t, n) => t in e ? Yn(e, t, {
|
|
|
2368
2368
|
if (!t) throw Error("paginated query no longer exists for token " + e);
|
|
2369
2369
|
return t;
|
|
2370
2370
|
}
|
|
2371
|
-
},
|
|
2371
|
+
}, er = Object.defineProperty, tr = (e, t, n) => t in e ? er(e, t, {
|
|
2372
2372
|
enumerable: !0,
|
|
2373
2373
|
configurable: !0,
|
|
2374
2374
|
writable: !0,
|
|
2375
2375
|
value: n
|
|
2376
|
-
}) : e[t] = n,
|
|
2376
|
+
}) : e[t] = n, nr = (e, t, n) => tr(e, typeof t == "symbol" ? t : t + "", n), rr, ir = class {
|
|
2377
2377
|
constructor(e, t = {}) {
|
|
2378
|
-
|
|
2378
|
+
nr(this, "listeners"), nr(this, "_client"), nr(this, "_paginatedClient"), nr(this, "callNewListenersWithCurrentValuesTimer"), nr(this, "_closed"), nr(this, "_disabled"), t.skipConvexDeploymentUrlCheck !== !0 && Ue(e);
|
|
2379
2379
|
let { disabled: n, ...r } = t;
|
|
2380
|
-
this._closed = !1, this._disabled = !!n,
|
|
2380
|
+
this._closed = !1, this._disabled = !!n, rr && !("webSocketConstructor" in r) && typeof WebSocket > "u" && (r.webSocketConstructor = rr), typeof window > "u" && !("unsavedChangesWarning" in r) && (r.unsavedChangesWarning = !1), this.disabled || (this._client = new Jn(e, () => {}, r), this._paginatedClient = new $n(this._client, (e) => this._transition(e))), this.listeners = /* @__PURE__ */ new Set();
|
|
2381
2381
|
}
|
|
2382
2382
|
get closed() {
|
|
2383
2383
|
return this._closed;
|
|
@@ -2395,7 +2395,7 @@ var Yn = Object.defineProperty, Xn = (e, t, n) => t in e ? Yn(e, t, {
|
|
|
2395
2395
|
}
|
|
2396
2396
|
onUpdate(e, t, n, r) {
|
|
2397
2397
|
if (this.disabled) return this.createDisabledUnsubscribe();
|
|
2398
|
-
let { queryToken: i, unsubscribe: a } = this.client.subscribe(
|
|
2398
|
+
let { queryToken: i, unsubscribe: a } = this.client.subscribe(G(e), t), o = {
|
|
2399
2399
|
queryToken: i,
|
|
2400
2400
|
callback: n,
|
|
2401
2401
|
onError: r,
|
|
@@ -2420,7 +2420,7 @@ var Yn = Object.defineProperty, Xn = (e, t, n) => t in e ? Yn(e, t, {
|
|
|
2420
2420
|
let a = {
|
|
2421
2421
|
initialNumItems: n.initialNumItems,
|
|
2422
2422
|
id: -1
|
|
2423
|
-
}, { paginatedQueryToken: o, unsubscribe: s } = this.paginatedClient.subscribe(
|
|
2423
|
+
}, { paginatedQueryToken: o, unsubscribe: s } = this.paginatedClient.subscribe(G(e), t, a), c = {
|
|
2424
2424
|
queryToken: o,
|
|
2425
2425
|
callback: r,
|
|
2426
2426
|
onError: i,
|
|
@@ -2435,7 +2435,7 @@ var Yn = Object.defineProperty, Xn = (e, t, n) => t in e ? Yn(e, t, {
|
|
|
2435
2435
|
unsubscribe: () => {
|
|
2436
2436
|
this.closed || (this.listeners.delete(c), s());
|
|
2437
2437
|
},
|
|
2438
|
-
getCurrentValue: () => this.paginatedClient.localQueryResult(
|
|
2438
|
+
getCurrentValue: () => this.paginatedClient.localQueryResult(G(e), t, a),
|
|
2439
2439
|
getQueryLogs: () => []
|
|
2440
2440
|
}, u = l.unsubscribe;
|
|
2441
2441
|
return Object.assign(u, l), u;
|
|
@@ -2473,7 +2473,7 @@ var Yn = Object.defineProperty, Xn = (e, t, n) => t in e ? Yn(e, t, {
|
|
|
2473
2473
|
_transition({ queries: e, paginatedQueries: t }, n = !1) {
|
|
2474
2474
|
let r = [...e.map((e) => e.token), ...t.map((e) => e.token)];
|
|
2475
2475
|
for (let e of this.listeners) {
|
|
2476
|
-
let { callback: t, queryToken: i, onError: a, hasEverRun: o } = e, s =
|
|
2476
|
+
let { callback: t, queryToken: i, onError: a, hasEverRun: o } = e, s = Ft(i), c = s ? !!this.paginatedClient.localQueryResultByToken(i) : this.client.hasLocalQueryResultByToken(i);
|
|
2477
2477
|
if (r.includes(i) || n && !o && c) {
|
|
2478
2478
|
e.hasEverRun = !0;
|
|
2479
2479
|
let n;
|
|
@@ -2490,15 +2490,15 @@ var Yn = Object.defineProperty, Xn = (e, t, n) => t in e ? Yn(e, t, {
|
|
|
2490
2490
|
}
|
|
2491
2491
|
async mutation(e, t, n) {
|
|
2492
2492
|
if (this.disabled) throw Error("ConvexClient is disabled");
|
|
2493
|
-
return await this.client.mutation(
|
|
2493
|
+
return await this.client.mutation(G(e), t, n);
|
|
2494
2494
|
}
|
|
2495
2495
|
async action(e, t) {
|
|
2496
2496
|
if (this.disabled) throw Error("ConvexClient is disabled");
|
|
2497
|
-
return await this.client.action(
|
|
2497
|
+
return await this.client.action(G(e), t);
|
|
2498
2498
|
}
|
|
2499
2499
|
async query(e, t) {
|
|
2500
2500
|
if (this.disabled) throw Error("ConvexClient is disabled");
|
|
2501
|
-
let n = this.client.localQueryResult(
|
|
2501
|
+
let n = this.client.localQueryResult(G(e), t);
|
|
2502
2502
|
return n === void 0 ? new Promise((n, r) => {
|
|
2503
2503
|
let { unsubscribe: i } = this.onUpdate(e, t, (e) => {
|
|
2504
2504
|
i(), n(e);
|
|
@@ -2514,37 +2514,37 @@ var Yn = Object.defineProperty, Xn = (e, t, n) => t in e ? Yn(e, t, {
|
|
|
2514
2514
|
subscribeToConnectionState(e) {
|
|
2515
2515
|
return this.disabled ? () => {} : this.client.subscribeToConnectionState(e);
|
|
2516
2516
|
}
|
|
2517
|
-
},
|
|
2517
|
+
}, ar = new Set([
|
|
2518
2518
|
"role",
|
|
2519
2519
|
"name",
|
|
2520
2520
|
"aria-label",
|
|
2521
2521
|
"rel",
|
|
2522
2522
|
"href"
|
|
2523
2523
|
]);
|
|
2524
|
-
function
|
|
2525
|
-
let n =
|
|
2526
|
-
n ||= e.startsWith("data-") &&
|
|
2527
|
-
let r =
|
|
2528
|
-
return r ||= t.startsWith("#") &&
|
|
2529
|
-
}
|
|
2530
|
-
function or(e) {
|
|
2531
|
-
return dr(e);
|
|
2524
|
+
function or(e, t) {
|
|
2525
|
+
let n = ar.has(e);
|
|
2526
|
+
n ||= e.startsWith("data-") && fr(e);
|
|
2527
|
+
let r = fr(t) && t.length < 100;
|
|
2528
|
+
return r ||= t.startsWith("#") && fr(t.slice(1)), n && r;
|
|
2532
2529
|
}
|
|
2533
2530
|
function sr(e) {
|
|
2534
|
-
return
|
|
2531
|
+
return fr(e);
|
|
2535
2532
|
}
|
|
2536
2533
|
function cr(e) {
|
|
2534
|
+
return fr(e);
|
|
2535
|
+
}
|
|
2536
|
+
function lr(e) {
|
|
2537
2537
|
return !0;
|
|
2538
2538
|
}
|
|
2539
|
-
function
|
|
2539
|
+
function ur(e, t) {
|
|
2540
2540
|
if (e.nodeType !== Node.ELEMENT_NODE) throw Error("Can't generate CSS selector for non-element node type.");
|
|
2541
2541
|
if (e.tagName.toLowerCase() === "html") return "html";
|
|
2542
2542
|
let n = {
|
|
2543
2543
|
root: document.body,
|
|
2544
|
-
idName:
|
|
2545
|
-
className:
|
|
2546
|
-
tagName:
|
|
2547
|
-
attr:
|
|
2544
|
+
idName: sr,
|
|
2545
|
+
className: cr,
|
|
2546
|
+
tagName: lr,
|
|
2547
|
+
attr: or,
|
|
2548
2548
|
timeoutMs: 1e3,
|
|
2549
2549
|
seedMinLength: 3,
|
|
2550
2550
|
optimizedMinLength: 2,
|
|
@@ -2552,37 +2552,37 @@ function lr(e, t) {
|
|
|
2552
2552
|
}, r = /* @__PURE__ */ new Date(), i = {
|
|
2553
2553
|
...n,
|
|
2554
2554
|
...t
|
|
2555
|
-
}, a =
|
|
2556
|
-
for (let t of
|
|
2555
|
+
}, a = Sr(i.root, n), o, s = 0;
|
|
2556
|
+
for (let t of dr(e, i, a)) {
|
|
2557
2557
|
if ((/* @__PURE__ */ new Date()).getTime() - r.getTime() > i.timeoutMs || s >= i.maxNumberOfPathChecks) {
|
|
2558
|
-
let t =
|
|
2558
|
+
let t = vr(e, a);
|
|
2559
2559
|
if (!t) throw Error(`Timeout: Can't find a unique selector after ${i.timeoutMs}ms`);
|
|
2560
|
-
return
|
|
2560
|
+
return mr(t);
|
|
2561
2561
|
}
|
|
2562
|
-
if (s++,
|
|
2562
|
+
if (s++, Cr(t, a)) {
|
|
2563
2563
|
o = t;
|
|
2564
2564
|
break;
|
|
2565
2565
|
}
|
|
2566
2566
|
}
|
|
2567
2567
|
if (!o) throw Error("Selector was not found.");
|
|
2568
|
-
let c = [...
|
|
2569
|
-
return c.sort(
|
|
2568
|
+
let c = [...wr(o, e, i, a, r)];
|
|
2569
|
+
return c.sort(gr), c.length > 0 ? mr(c[0]) : mr(o);
|
|
2570
2570
|
}
|
|
2571
|
-
function*
|
|
2571
|
+
function* dr(e, t, n) {
|
|
2572
2572
|
let r = [], i = [], a = e, o = 0;
|
|
2573
2573
|
for (; a && a !== n;) {
|
|
2574
|
-
let e =
|
|
2574
|
+
let e = pr(a, t);
|
|
2575
2575
|
for (let t of e) t.level = o;
|
|
2576
|
-
if (r.push(e), a = a.parentElement, o++, i.push(...
|
|
2577
|
-
i.sort(
|
|
2576
|
+
if (r.push(e), a = a.parentElement, o++, i.push(...xr(r)), o >= t.seedMinLength) {
|
|
2577
|
+
i.sort(gr);
|
|
2578
2578
|
for (let e of i) yield e;
|
|
2579
2579
|
i = [];
|
|
2580
2580
|
}
|
|
2581
2581
|
}
|
|
2582
|
-
i.sort(
|
|
2582
|
+
i.sort(gr);
|
|
2583
2583
|
for (let e of i) yield e;
|
|
2584
2584
|
}
|
|
2585
|
-
function
|
|
2585
|
+
function fr(e) {
|
|
2586
2586
|
if (/^[a-z\-]{3,}$/i.test(e)) {
|
|
2587
2587
|
let t = e.split(/-|[A-Z]/);
|
|
2588
2588
|
for (let e of t) if (e.length <= 2 || /[^aeiou]{4,}/i.test(e)) return !1;
|
|
@@ -2590,7 +2590,7 @@ function dr(e) {
|
|
|
2590
2590
|
}
|
|
2591
2591
|
return !1;
|
|
2592
2592
|
}
|
|
2593
|
-
function
|
|
2593
|
+
function pr(e, t) {
|
|
2594
2594
|
let n = [], r = e.getAttribute("id");
|
|
2595
2595
|
r && t.idName(r) && n.push({
|
|
2596
2596
|
name: "#" + CSS.escape(r),
|
|
@@ -2616,19 +2616,19 @@ function fr(e, t) {
|
|
|
2616
2616
|
name: i,
|
|
2617
2617
|
penalty: 5
|
|
2618
2618
|
});
|
|
2619
|
-
let t =
|
|
2619
|
+
let t = _r(e, i);
|
|
2620
2620
|
t !== void 0 && n.push({
|
|
2621
|
-
name:
|
|
2621
|
+
name: br(i, t),
|
|
2622
2622
|
penalty: 10
|
|
2623
2623
|
});
|
|
2624
2624
|
}
|
|
2625
|
-
let a =
|
|
2625
|
+
let a = _r(e);
|
|
2626
2626
|
return a !== void 0 && n.push({
|
|
2627
|
-
name:
|
|
2627
|
+
name: yr(i, a),
|
|
2628
2628
|
penalty: 50
|
|
2629
2629
|
}), n;
|
|
2630
2630
|
}
|
|
2631
|
-
function
|
|
2631
|
+
function mr(e) {
|
|
2632
2632
|
let t = e[0], n = t.name;
|
|
2633
2633
|
for (let r = 1; r < e.length; r++) {
|
|
2634
2634
|
let i = e[r].level || 0;
|
|
@@ -2636,13 +2636,13 @@ function pr(e) {
|
|
|
2636
2636
|
}
|
|
2637
2637
|
return n;
|
|
2638
2638
|
}
|
|
2639
|
-
function
|
|
2639
|
+
function hr(e) {
|
|
2640
2640
|
return e.map((e) => e.penalty).reduce((e, t) => e + t, 0);
|
|
2641
2641
|
}
|
|
2642
|
-
function hr(e, t) {
|
|
2643
|
-
return mr(e) - mr(t);
|
|
2644
|
-
}
|
|
2645
2642
|
function gr(e, t) {
|
|
2643
|
+
return hr(e) - hr(t);
|
|
2644
|
+
}
|
|
2645
|
+
function _r(e, t) {
|
|
2646
2646
|
let n = e.parentNode;
|
|
2647
2647
|
if (!n) return;
|
|
2648
2648
|
let r = n.firstChild;
|
|
@@ -2651,51 +2651,51 @@ function gr(e, t) {
|
|
|
2651
2651
|
for (; r && (r.nodeType === Node.ELEMENT_NODE && (t === void 0 || r.tagName.toLowerCase() === t) && i++, r !== e);) r = r.nextSibling;
|
|
2652
2652
|
return i;
|
|
2653
2653
|
}
|
|
2654
|
-
function
|
|
2654
|
+
function vr(e, t) {
|
|
2655
2655
|
let n = 0, r = e, i = [];
|
|
2656
2656
|
for (; r && r !== t;) {
|
|
2657
|
-
let e = r.tagName.toLowerCase(), t =
|
|
2657
|
+
let e = r.tagName.toLowerCase(), t = _r(r, e);
|
|
2658
2658
|
if (t === void 0) return;
|
|
2659
2659
|
i.push({
|
|
2660
|
-
name:
|
|
2660
|
+
name: br(e, t),
|
|
2661
2661
|
penalty: NaN,
|
|
2662
2662
|
level: n
|
|
2663
2663
|
}), r = r.parentElement, n++;
|
|
2664
2664
|
}
|
|
2665
|
-
if (
|
|
2665
|
+
if (Cr(i, t)) return i;
|
|
2666
2666
|
}
|
|
2667
|
-
function
|
|
2667
|
+
function yr(e, t) {
|
|
2668
2668
|
return e === "html" ? "html" : `${e}:nth-child(${t})`;
|
|
2669
2669
|
}
|
|
2670
|
-
function
|
|
2670
|
+
function br(e, t) {
|
|
2671
2671
|
return e === "html" ? "html" : `${e}:nth-of-type(${t})`;
|
|
2672
2672
|
}
|
|
2673
|
-
function*
|
|
2674
|
-
if (e.length > 0) for (let n of e[0]) yield*
|
|
2673
|
+
function* xr(e, t = []) {
|
|
2674
|
+
if (e.length > 0) for (let n of e[0]) yield* xr(e.slice(1, e.length), t.concat(n));
|
|
2675
2675
|
else yield t;
|
|
2676
2676
|
}
|
|
2677
|
-
function
|
|
2677
|
+
function Sr(e, t) {
|
|
2678
2678
|
return e.nodeType === Node.DOCUMENT_NODE ? e : e === t.root ? e.ownerDocument : e;
|
|
2679
2679
|
}
|
|
2680
|
-
function
|
|
2681
|
-
let n =
|
|
2680
|
+
function Cr(e, t) {
|
|
2681
|
+
let n = mr(e);
|
|
2682
2682
|
switch (t.querySelectorAll(n).length) {
|
|
2683
2683
|
case 0: throw Error(`Can't select any node with this selector: ${n}`);
|
|
2684
2684
|
case 1: return !0;
|
|
2685
2685
|
default: return !1;
|
|
2686
2686
|
}
|
|
2687
2687
|
}
|
|
2688
|
-
function*
|
|
2688
|
+
function* wr(e, t, n, r, i) {
|
|
2689
2689
|
if (e.length > 2 && e.length > n.optimizedMinLength) for (let a = 1; a < e.length - 1; a++) {
|
|
2690
2690
|
if ((/* @__PURE__ */ new Date()).getTime() - i.getTime() > n.timeoutMs) return;
|
|
2691
2691
|
let o = [...e];
|
|
2692
|
-
o.splice(a, 1),
|
|
2692
|
+
o.splice(a, 1), Cr(o, r) && r.querySelector(mr(o)) === t && (yield o, yield* wr(o, t, n, r, i));
|
|
2693
2693
|
}
|
|
2694
2694
|
}
|
|
2695
2695
|
//#endregion
|
|
2696
2696
|
//#region src/runtime/anchor.ts
|
|
2697
|
-
function
|
|
2698
|
-
let n = document.documentElement, r = Math.max(n.scrollWidth, n.clientWidth), i = Math.max(n.scrollHeight, n.clientHeight), a = e.clientX + window.scrollX, o = e.clientY + window.scrollY, s = t === void 0 ? e.target instanceof Element ? e.target : null : t, c = s ?
|
|
2697
|
+
function Tr(e, t) {
|
|
2698
|
+
let n = document.documentElement, r = Math.max(n.scrollWidth, n.clientWidth), i = Math.max(n.scrollHeight, n.clientHeight), a = e.clientX + window.scrollX, o = e.clientY + window.scrollY, s = t === void 0 ? e.target instanceof Element ? e.target : null : t, c = s ? Dr(s) : void 0, l, u;
|
|
2699
2699
|
if (s) {
|
|
2700
2700
|
let t = s.getBoundingClientRect();
|
|
2701
2701
|
t.width > 0 && t.height > 0 && (l = Math.max(0, Math.min(1, (e.clientX - t.left) / t.width)), u = Math.max(0, Math.min(1, (e.clientY - t.top) / t.height)));
|
|
@@ -2710,7 +2710,7 @@ function wr(e, t) {
|
|
|
2710
2710
|
anchorOffsetY: u
|
|
2711
2711
|
};
|
|
2712
2712
|
}
|
|
2713
|
-
function
|
|
2713
|
+
function Er(e) {
|
|
2714
2714
|
if (e.anchorSelector) try {
|
|
2715
2715
|
let t = document.querySelector(e.anchorSelector);
|
|
2716
2716
|
if (t) {
|
|
@@ -2727,22 +2727,22 @@ function Tr(e) {
|
|
|
2727
2727
|
pageY: e.anchorY * r
|
|
2728
2728
|
};
|
|
2729
2729
|
}
|
|
2730
|
-
function
|
|
2730
|
+
function Dr(e) {
|
|
2731
2731
|
try {
|
|
2732
|
-
return
|
|
2732
|
+
return ur(e, { timeoutMs: 1e3 });
|
|
2733
2733
|
} catch {
|
|
2734
2734
|
return;
|
|
2735
2735
|
}
|
|
2736
2736
|
}
|
|
2737
2737
|
//#endregion
|
|
2738
2738
|
//#region src/runtime/api.ts
|
|
2739
|
-
var
|
|
2739
|
+
var Or = class extends Error {
|
|
2740
2740
|
status;
|
|
2741
2741
|
constructor(e, t) {
|
|
2742
2742
|
super(e), this.name = "WidgetApiError", this.status = t;
|
|
2743
2743
|
}
|
|
2744
2744
|
};
|
|
2745
|
-
function
|
|
2745
|
+
function kr(e) {
|
|
2746
2746
|
let t = e.apiUrl.replace(/\/+$/, "");
|
|
2747
2747
|
async function n(n, r = {}) {
|
|
2748
2748
|
let i = {
|
|
@@ -2756,8 +2756,8 @@ function Or(e) {
|
|
|
2756
2756
|
let c = await fetch(`${t}${n}`, {
|
|
2757
2757
|
...r,
|
|
2758
2758
|
headers: i
|
|
2759
|
-
}), l = await c.text(), u = l ?
|
|
2760
|
-
if (!c.ok) throw c.status === 401 && o && e.onUnauthorized?.(), new
|
|
2759
|
+
}), l = await c.text(), u = l ? Ar(l) : null;
|
|
2760
|
+
if (!c.ok) throw c.status === 401 && o && e.onUnauthorized?.(), new Or((u && typeof u == "object" && "error" in u && typeof u.error == "string" ? u.error : null) ?? `Request failed with ${c.status}`, c.status);
|
|
2761
2761
|
return u;
|
|
2762
2762
|
}
|
|
2763
2763
|
return {
|
|
@@ -2811,7 +2811,7 @@ function Or(e) {
|
|
|
2811
2811
|
}
|
|
2812
2812
|
};
|
|
2813
2813
|
}
|
|
2814
|
-
function
|
|
2814
|
+
function Ar(e) {
|
|
2815
2815
|
try {
|
|
2816
2816
|
return JSON.parse(e);
|
|
2817
2817
|
} catch {
|
|
@@ -2820,25 +2820,113 @@ function kr(e) {
|
|
|
2820
2820
|
}
|
|
2821
2821
|
//#endregion
|
|
2822
2822
|
//#region src/runtime/identity-store.ts
|
|
2823
|
-
var
|
|
2824
|
-
function
|
|
2823
|
+
var jr = "markup.identity";
|
|
2824
|
+
function Mr() {
|
|
2825
2825
|
try {
|
|
2826
|
-
let e = localStorage.getItem(
|
|
2827
|
-
|
|
2828
|
-
let t = JSON.parse(e);
|
|
2829
|
-
return typeof t?.clientId == "string" ? t : null;
|
|
2826
|
+
let e = localStorage.getItem(jr);
|
|
2827
|
+
return e ? JSON.parse(e) : null;
|
|
2830
2828
|
} catch {
|
|
2831
2829
|
return null;
|
|
2832
2830
|
}
|
|
2833
2831
|
}
|
|
2834
|
-
function
|
|
2832
|
+
function Nr(e) {
|
|
2835
2833
|
try {
|
|
2836
|
-
|
|
2834
|
+
if (e == null) {
|
|
2835
|
+
localStorage.removeItem(jr);
|
|
2836
|
+
return;
|
|
2837
|
+
}
|
|
2838
|
+
localStorage.setItem(jr, JSON.stringify(e));
|
|
2837
2839
|
} catch {}
|
|
2838
2840
|
}
|
|
2841
|
+
function Pr() {
|
|
2842
|
+
let e = Mr(), t = {
|
|
2843
|
+
name: e?.name,
|
|
2844
|
+
email: e?.email
|
|
2845
|
+
};
|
|
2846
|
+
return e ? e.isVerified && typeof e.clientId == "string" && typeof e.token == "string" && typeof e.tokenExpiresAt == "number" && typeof e.name == "string" ? {
|
|
2847
|
+
state: {
|
|
2848
|
+
kind: "verified",
|
|
2849
|
+
identity: {
|
|
2850
|
+
clientId: e.clientId,
|
|
2851
|
+
token: e.token,
|
|
2852
|
+
tokenExpiresAt: e.tokenExpiresAt,
|
|
2853
|
+
name: e.name,
|
|
2854
|
+
email: e.email
|
|
2855
|
+
}
|
|
2856
|
+
},
|
|
2857
|
+
preserved: t
|
|
2858
|
+
} : typeof e.clientId == "string" && typeof e.anonToken == "string" ? {
|
|
2859
|
+
state: {
|
|
2860
|
+
kind: "anon",
|
|
2861
|
+
identity: {
|
|
2862
|
+
clientId: e.clientId,
|
|
2863
|
+
anonToken: e.anonToken,
|
|
2864
|
+
name: e.name,
|
|
2865
|
+
email: e.email
|
|
2866
|
+
}
|
|
2867
|
+
},
|
|
2868
|
+
preserved: t
|
|
2869
|
+
} : {
|
|
2870
|
+
state: { kind: "unresolved" },
|
|
2871
|
+
preserved: t
|
|
2872
|
+
} : {
|
|
2873
|
+
state: { kind: "unresolved" },
|
|
2874
|
+
preserved: t
|
|
2875
|
+
};
|
|
2876
|
+
}
|
|
2877
|
+
function Fr(e) {
|
|
2878
|
+
switch (e.kind) {
|
|
2879
|
+
case "verified":
|
|
2880
|
+
Nr({
|
|
2881
|
+
clientId: e.identity.clientId,
|
|
2882
|
+
token: e.identity.token,
|
|
2883
|
+
tokenExpiresAt: e.identity.tokenExpiresAt,
|
|
2884
|
+
isVerified: !0,
|
|
2885
|
+
name: e.identity.name,
|
|
2886
|
+
email: e.identity.email
|
|
2887
|
+
});
|
|
2888
|
+
return;
|
|
2889
|
+
case "anon":
|
|
2890
|
+
Nr({
|
|
2891
|
+
clientId: e.identity.clientId,
|
|
2892
|
+
anonToken: e.identity.anonToken,
|
|
2893
|
+
name: e.identity.name,
|
|
2894
|
+
email: e.identity.email
|
|
2895
|
+
});
|
|
2896
|
+
return;
|
|
2897
|
+
case "recovering":
|
|
2898
|
+
Nr({
|
|
2899
|
+
name: e.preserved.name,
|
|
2900
|
+
email: e.preserved.email
|
|
2901
|
+
});
|
|
2902
|
+
return;
|
|
2903
|
+
case "unresolved":
|
|
2904
|
+
Nr(null);
|
|
2905
|
+
return;
|
|
2906
|
+
}
|
|
2907
|
+
}
|
|
2908
|
+
function Ir(e) {
|
|
2909
|
+
if (e.kind === "anon" || e.kind === "verified") return e.identity.clientId;
|
|
2910
|
+
}
|
|
2911
|
+
function Lr(e) {
|
|
2912
|
+
return e.kind === "anon" ? e.identity.name ?? null : e.kind === "verified" ? e.identity.name : null;
|
|
2913
|
+
}
|
|
2914
|
+
function Rr(e) {
|
|
2915
|
+
if (e.kind === "anon") {
|
|
2916
|
+
let t = e.identity.name;
|
|
2917
|
+
return t ? {
|
|
2918
|
+
name: t,
|
|
2919
|
+
email: e.identity.email
|
|
2920
|
+
} : null;
|
|
2921
|
+
}
|
|
2922
|
+
return e.kind === "verified" ? {
|
|
2923
|
+
name: e.identity.name,
|
|
2924
|
+
email: e.identity.email
|
|
2925
|
+
} : null;
|
|
2926
|
+
}
|
|
2839
2927
|
//#endregion
|
|
2840
2928
|
//#region src/runtime/popup-auth.ts
|
|
2841
|
-
async function
|
|
2929
|
+
async function zr(e, t) {
|
|
2842
2930
|
let n = new URL(e).origin, r;
|
|
2843
2931
|
try {
|
|
2844
2932
|
let n = await fetch(`${e.replace(/\/+$/, "")}/widget/popup-exchange`, {
|
|
@@ -2879,45 +2967,45 @@ async function Nr(e, t) {
|
|
|
2879
2967
|
}
|
|
2880
2968
|
//#endregion
|
|
2881
2969
|
//#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/util.js
|
|
2882
|
-
function
|
|
2970
|
+
function Br(e, t) {
|
|
2883
2971
|
if (e.match(/^[a-z]+:\/\//i)) return e;
|
|
2884
2972
|
if (e.match(/^\/\//)) return window.location.protocol + e;
|
|
2885
2973
|
if (e.match(/^[a-z]+:/i)) return e;
|
|
2886
2974
|
let n = document.implementation.createHTMLDocument(), r = n.createElement("base"), i = n.createElement("a");
|
|
2887
2975
|
return n.head.appendChild(r), n.body.appendChild(i), t && (r.href = t), i.href = e, i.href;
|
|
2888
2976
|
}
|
|
2889
|
-
var
|
|
2977
|
+
var Vr = (() => {
|
|
2890
2978
|
let e = 0, t = () => `0000${(Math.random() * 36 ** 4 << 0).toString(36)}`.slice(-4);
|
|
2891
2979
|
return () => (e += 1, `u${t()}${e}`);
|
|
2892
2980
|
})();
|
|
2893
|
-
function
|
|
2981
|
+
function Y(e) {
|
|
2894
2982
|
let t = [];
|
|
2895
2983
|
for (let n = 0, r = e.length; n < r; n++) t.push(e[n]);
|
|
2896
2984
|
return t;
|
|
2897
2985
|
}
|
|
2898
|
-
var
|
|
2899
|
-
function
|
|
2900
|
-
return
|
|
2986
|
+
var Hr = null;
|
|
2987
|
+
function Ur(e = {}) {
|
|
2988
|
+
return Hr || (e.includeStyleProperties ? (Hr = e.includeStyleProperties, Hr) : (Hr = Y(window.getComputedStyle(document.documentElement)), Hr));
|
|
2901
2989
|
}
|
|
2902
|
-
function
|
|
2990
|
+
function Wr(e, t) {
|
|
2903
2991
|
let n = (e.ownerDocument.defaultView || window).getComputedStyle(e).getPropertyValue(t);
|
|
2904
2992
|
return n ? parseFloat(n.replace("px", "")) : 0;
|
|
2905
2993
|
}
|
|
2906
|
-
function
|
|
2907
|
-
let t =
|
|
2994
|
+
function Gr(e) {
|
|
2995
|
+
let t = Wr(e, "border-left-width"), n = Wr(e, "border-right-width");
|
|
2908
2996
|
return e.clientWidth + t + n;
|
|
2909
2997
|
}
|
|
2910
|
-
function
|
|
2911
|
-
let t =
|
|
2998
|
+
function Kr(e) {
|
|
2999
|
+
let t = Wr(e, "border-top-width"), n = Wr(e, "border-bottom-width");
|
|
2912
3000
|
return e.clientHeight + t + n;
|
|
2913
3001
|
}
|
|
2914
|
-
function
|
|
3002
|
+
function qr(e, t = {}) {
|
|
2915
3003
|
return {
|
|
2916
|
-
width: t.width ||
|
|
2917
|
-
height: t.height ||
|
|
3004
|
+
width: t.width || Gr(e),
|
|
3005
|
+
height: t.height || Kr(e)
|
|
2918
3006
|
};
|
|
2919
3007
|
}
|
|
2920
|
-
function
|
|
3008
|
+
function Jr() {
|
|
2921
3009
|
let e, t;
|
|
2922
3010
|
try {
|
|
2923
3011
|
t = process;
|
|
@@ -2926,10 +3014,10 @@ function Ur() {
|
|
|
2926
3014
|
return n && (e = parseInt(n, 10), Number.isNaN(e) && (e = 1)), e || window.devicePixelRatio || 1;
|
|
2927
3015
|
}
|
|
2928
3016
|
var X = 16384;
|
|
2929
|
-
function
|
|
3017
|
+
function Yr(e) {
|
|
2930
3018
|
(e.width > X || e.height > X) && (e.width > X && e.height > X ? e.width > e.height ? (e.height *= X / e.width, e.width = X) : (e.width *= X / e.height, e.height = X) : e.width > X ? (e.height *= X / e.width, e.width = X) : (e.width *= X / e.height, e.height = X));
|
|
2931
3019
|
}
|
|
2932
|
-
function
|
|
3020
|
+
function Xr(e) {
|
|
2933
3021
|
return new Promise((t, n) => {
|
|
2934
3022
|
let r = new Image();
|
|
2935
3023
|
r.onload = () => {
|
|
@@ -2939,12 +3027,12 @@ function Gr(e) {
|
|
|
2939
3027
|
}, r.onerror = n, r.crossOrigin = "anonymous", r.decoding = "async", r.src = e;
|
|
2940
3028
|
});
|
|
2941
3029
|
}
|
|
2942
|
-
async function
|
|
3030
|
+
async function Zr(e) {
|
|
2943
3031
|
return Promise.resolve().then(() => new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then((e) => `data:image/svg+xml;charset=utf-8,${e}`);
|
|
2944
3032
|
}
|
|
2945
|
-
async function
|
|
3033
|
+
async function Qr(e, t, n) {
|
|
2946
3034
|
let r = "http://www.w3.org/2000/svg", i = document.createElementNS(r, "svg"), a = document.createElementNS(r, "foreignObject");
|
|
2947
|
-
return i.setAttribute("width", `${t}`), i.setAttribute("height", `${n}`), i.setAttribute("viewBox", `0 0 ${t} ${n}`), a.setAttribute("width", "100%"), a.setAttribute("height", "100%"), a.setAttribute("x", "0"), a.setAttribute("y", "0"), a.setAttribute("externalResourcesRequired", "true"), i.appendChild(a), a.appendChild(e),
|
|
3035
|
+
return i.setAttribute("width", `${t}`), i.setAttribute("height", `${n}`), i.setAttribute("viewBox", `0 0 ${t} ${n}`), a.setAttribute("width", "100%"), a.setAttribute("height", "100%"), a.setAttribute("x", "0"), a.setAttribute("y", "0"), a.setAttribute("externalResourcesRequired", "true"), i.appendChild(a), a.appendChild(e), Zr(i);
|
|
2948
3036
|
}
|
|
2949
3037
|
var Z = (e, t) => {
|
|
2950
3038
|
if (e instanceof t) return !0;
|
|
@@ -2953,66 +3041,66 @@ var Z = (e, t) => {
|
|
|
2953
3041
|
};
|
|
2954
3042
|
//#endregion
|
|
2955
3043
|
//#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/clone-pseudos.js
|
|
2956
|
-
function
|
|
3044
|
+
function $r(e) {
|
|
2957
3045
|
let t = e.getPropertyValue("content");
|
|
2958
3046
|
return `${e.cssText} content: '${t.replace(/'|"/g, "")}';`;
|
|
2959
3047
|
}
|
|
2960
|
-
function
|
|
2961
|
-
return
|
|
3048
|
+
function ei(e, t) {
|
|
3049
|
+
return Ur(t).map((t) => `${t}: ${e.getPropertyValue(t)}${e.getPropertyPriority(t) ? " !important" : ""};`).join(" ");
|
|
2962
3050
|
}
|
|
2963
|
-
function
|
|
2964
|
-
let i = `.${e}:${t}`, a = n.cssText ?
|
|
3051
|
+
function ti(e, t, n, r) {
|
|
3052
|
+
let i = `.${e}:${t}`, a = n.cssText ? $r(n) : ei(n, r);
|
|
2965
3053
|
return document.createTextNode(`${i}{${a}}`);
|
|
2966
3054
|
}
|
|
2967
|
-
function
|
|
3055
|
+
function ni(e, t, n, r) {
|
|
2968
3056
|
let i = window.getComputedStyle(e, n), a = i.getPropertyValue("content");
|
|
2969
3057
|
if (a === "" || a === "none") return;
|
|
2970
|
-
let o =
|
|
3058
|
+
let o = Vr();
|
|
2971
3059
|
try {
|
|
2972
3060
|
t.className = `${t.className} ${o}`;
|
|
2973
3061
|
} catch {
|
|
2974
3062
|
return;
|
|
2975
3063
|
}
|
|
2976
3064
|
let s = document.createElement("style");
|
|
2977
|
-
s.appendChild(
|
|
3065
|
+
s.appendChild(ti(o, n, i, r)), t.appendChild(s);
|
|
2978
3066
|
}
|
|
2979
|
-
function
|
|
2980
|
-
|
|
3067
|
+
function ri(e, t, n) {
|
|
3068
|
+
ni(e, t, ":before", n), ni(e, t, ":after", n);
|
|
2981
3069
|
}
|
|
2982
3070
|
//#endregion
|
|
2983
3071
|
//#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/mimes.js
|
|
2984
|
-
var
|
|
2985
|
-
woff:
|
|
2986
|
-
woff2:
|
|
3072
|
+
var ii = "application/font-woff", ai = "image/jpeg", oi = {
|
|
3073
|
+
woff: ii,
|
|
3074
|
+
woff2: ii,
|
|
2987
3075
|
ttf: "application/font-truetype",
|
|
2988
3076
|
eot: "application/vnd.ms-fontobject",
|
|
2989
3077
|
png: "image/png",
|
|
2990
|
-
jpg:
|
|
2991
|
-
jpeg:
|
|
3078
|
+
jpg: ai,
|
|
3079
|
+
jpeg: ai,
|
|
2992
3080
|
gif: "image/gif",
|
|
2993
3081
|
tiff: "image/tiff",
|
|
2994
3082
|
svg: "image/svg+xml",
|
|
2995
3083
|
webp: "image/webp"
|
|
2996
3084
|
};
|
|
2997
|
-
function
|
|
3085
|
+
function si(e) {
|
|
2998
3086
|
let t = /\.([^./]*?)$/g.exec(e);
|
|
2999
3087
|
return t ? t[1] : "";
|
|
3000
3088
|
}
|
|
3001
|
-
function
|
|
3002
|
-
return
|
|
3089
|
+
function ci(e) {
|
|
3090
|
+
return oi[si(e).toLowerCase()] || "";
|
|
3003
3091
|
}
|
|
3004
3092
|
//#endregion
|
|
3005
3093
|
//#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/dataurl.js
|
|
3006
|
-
function
|
|
3094
|
+
function li(e) {
|
|
3007
3095
|
return e.split(/,/)[1];
|
|
3008
3096
|
}
|
|
3009
|
-
function
|
|
3097
|
+
function ui(e) {
|
|
3010
3098
|
return e.search(/^(data:)/) !== -1;
|
|
3011
3099
|
}
|
|
3012
|
-
function
|
|
3100
|
+
function di(e, t) {
|
|
3013
3101
|
return `data:${t};base64,${e}`;
|
|
3014
3102
|
}
|
|
3015
|
-
async function
|
|
3103
|
+
async function fi(e, t, n) {
|
|
3016
3104
|
let r = await fetch(e, t);
|
|
3017
3105
|
if (r.status === 404) throw Error(`Resource "${r.url}" not found`);
|
|
3018
3106
|
let i = await r.blob();
|
|
@@ -3030,78 +3118,78 @@ async function si(e, t, n) {
|
|
|
3030
3118
|
}, a.readAsDataURL(i);
|
|
3031
3119
|
});
|
|
3032
3120
|
}
|
|
3033
|
-
var
|
|
3034
|
-
function
|
|
3121
|
+
var pi = {};
|
|
3122
|
+
function mi(e, t, n) {
|
|
3035
3123
|
let r = e.replace(/\?.*/, "");
|
|
3036
3124
|
return n && (r = e), /ttf|otf|eot|woff2?/i.test(r) && (r = r.replace(/.*\//, "")), t ? `[${t}]${r}` : r;
|
|
3037
3125
|
}
|
|
3038
|
-
async function
|
|
3039
|
-
let r =
|
|
3040
|
-
if (
|
|
3126
|
+
async function hi(e, t, n) {
|
|
3127
|
+
let r = mi(e, t, n.includeQueryParams);
|
|
3128
|
+
if (pi[r] != null) return pi[r];
|
|
3041
3129
|
n.cacheBust && (e += (/\?/.test(e) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime());
|
|
3042
3130
|
let i;
|
|
3043
3131
|
try {
|
|
3044
|
-
i =
|
|
3132
|
+
i = di(await fi(e, n.fetchRequestInit, ({ res: e, result: n }) => (t ||= e.headers.get("Content-Type") || "", li(n))), t);
|
|
3045
3133
|
} catch (t) {
|
|
3046
3134
|
i = n.imagePlaceholder || "";
|
|
3047
3135
|
let r = `Failed to fetch resource: ${e}`;
|
|
3048
3136
|
t && (r = typeof t == "string" ? t : t.message), r && console.warn(r);
|
|
3049
3137
|
}
|
|
3050
|
-
return
|
|
3138
|
+
return pi[r] = i, i;
|
|
3051
3139
|
}
|
|
3052
3140
|
//#endregion
|
|
3053
3141
|
//#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/clone-node.js
|
|
3054
|
-
async function
|
|
3142
|
+
async function gi(e) {
|
|
3055
3143
|
let t = e.toDataURL();
|
|
3056
|
-
return t === "data:," ? e.cloneNode(!1) :
|
|
3144
|
+
return t === "data:," ? e.cloneNode(!1) : Xr(t);
|
|
3057
3145
|
}
|
|
3058
|
-
async function
|
|
3146
|
+
async function _i(e, t) {
|
|
3059
3147
|
if (e.currentSrc) {
|
|
3060
3148
|
let t = document.createElement("canvas"), n = t.getContext("2d");
|
|
3061
|
-
return t.width = e.clientWidth, t.height = e.clientHeight, n?.drawImage(e, 0, 0, t.width, t.height),
|
|
3149
|
+
return t.width = e.clientWidth, t.height = e.clientHeight, n?.drawImage(e, 0, 0, t.width, t.height), Xr(t.toDataURL());
|
|
3062
3150
|
}
|
|
3063
3151
|
let n = e.poster;
|
|
3064
|
-
return
|
|
3152
|
+
return Xr(await hi(n, ci(n), t));
|
|
3065
3153
|
}
|
|
3066
|
-
async function
|
|
3154
|
+
async function vi(e, t) {
|
|
3067
3155
|
try {
|
|
3068
|
-
if (e?.contentDocument?.body) return await
|
|
3156
|
+
if (e?.contentDocument?.body) return await Oi(e.contentDocument.body, t, !0);
|
|
3069
3157
|
} catch {}
|
|
3070
3158
|
return e.cloneNode(!1);
|
|
3071
3159
|
}
|
|
3072
|
-
async function
|
|
3073
|
-
return Z(e, HTMLCanvasElement) ?
|
|
3160
|
+
async function yi(e, t) {
|
|
3161
|
+
return Z(e, HTMLCanvasElement) ? gi(e) : Z(e, HTMLVideoElement) ? _i(e, t) : Z(e, HTMLIFrameElement) ? vi(e, t) : e.cloneNode(xi(e));
|
|
3074
3162
|
}
|
|
3075
|
-
var
|
|
3076
|
-
async function
|
|
3077
|
-
if (
|
|
3163
|
+
var bi = (e) => e.tagName != null && e.tagName.toUpperCase() === "SLOT", xi = (e) => e.tagName != null && e.tagName.toUpperCase() === "SVG";
|
|
3164
|
+
async function Si(e, t, n) {
|
|
3165
|
+
if (xi(t)) return t;
|
|
3078
3166
|
let r = [];
|
|
3079
|
-
return r =
|
|
3167
|
+
return r = bi(e) && e.assignedNodes ? Y(e.assignedNodes()) : Z(e, HTMLIFrameElement) && e.contentDocument?.body ? Y(e.contentDocument.body.childNodes) : Y((e.shadowRoot ?? e).childNodes), r.length === 0 || Z(e, HTMLVideoElement) || await r.reduce((e, r) => e.then(() => Oi(r, n)).then((e) => {
|
|
3080
3168
|
e && t.appendChild(e);
|
|
3081
3169
|
}), Promise.resolve()), t;
|
|
3082
3170
|
}
|
|
3083
|
-
function
|
|
3171
|
+
function Ci(e, t, n) {
|
|
3084
3172
|
let r = t.style;
|
|
3085
3173
|
if (!r) return;
|
|
3086
3174
|
let i = window.getComputedStyle(e);
|
|
3087
|
-
i.cssText ? (r.cssText = i.cssText, r.transformOrigin = i.transformOrigin) :
|
|
3175
|
+
i.cssText ? (r.cssText = i.cssText, r.transformOrigin = i.transformOrigin) : Ur(n).forEach((n) => {
|
|
3088
3176
|
let a = i.getPropertyValue(n);
|
|
3089
3177
|
n === "font-size" && a.endsWith("px") && (a = `${Math.floor(parseFloat(a.substring(0, a.length - 2))) - .1}px`), Z(e, HTMLIFrameElement) && n === "display" && a === "inline" && (a = "block"), n === "d" && t.getAttribute("d") && (a = `path(${t.getAttribute("d")})`), r.setProperty(n, a, i.getPropertyPriority(n));
|
|
3090
3178
|
});
|
|
3091
3179
|
}
|
|
3092
|
-
function
|
|
3180
|
+
function wi(e, t) {
|
|
3093
3181
|
Z(e, HTMLTextAreaElement) && (t.innerHTML = e.value), Z(e, HTMLInputElement) && t.setAttribute("value", e.value);
|
|
3094
3182
|
}
|
|
3095
|
-
function
|
|
3183
|
+
function Ti(e, t) {
|
|
3096
3184
|
if (Z(e, HTMLSelectElement)) {
|
|
3097
3185
|
let n = t, r = Array.from(n.children).find((t) => e.value === t.getAttribute("value"));
|
|
3098
3186
|
r && r.setAttribute("selected", "");
|
|
3099
3187
|
}
|
|
3100
3188
|
}
|
|
3101
|
-
function
|
|
3102
|
-
return Z(t, Element) && (
|
|
3189
|
+
function Ei(e, t, n) {
|
|
3190
|
+
return Z(t, Element) && (Ci(e, t, n), ri(e, t, n), wi(e, t), Ti(e, t)), t;
|
|
3103
3191
|
}
|
|
3104
|
-
async function
|
|
3192
|
+
async function Di(e, t) {
|
|
3105
3193
|
let n = e.querySelectorAll ? e.querySelectorAll("use") : [];
|
|
3106
3194
|
if (n.length === 0) return e;
|
|
3107
3195
|
let r = {};
|
|
@@ -3109,7 +3197,7 @@ async function Si(e, t) {
|
|
|
3109
3197
|
let a = n[i].getAttribute("xlink:href");
|
|
3110
3198
|
if (a) {
|
|
3111
3199
|
let n = e.querySelector(a), i = document.querySelector(a);
|
|
3112
|
-
!n && i && !r[a] && (r[a] = await
|
|
3200
|
+
!n && i && !r[a] && (r[a] = await Oi(i, t, !0));
|
|
3113
3201
|
}
|
|
3114
3202
|
}
|
|
3115
3203
|
let i = Object.values(r);
|
|
@@ -3123,61 +3211,61 @@ async function Si(e, t) {
|
|
|
3123
3211
|
}
|
|
3124
3212
|
return e;
|
|
3125
3213
|
}
|
|
3126
|
-
async function
|
|
3127
|
-
return !n && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((e) =>
|
|
3214
|
+
async function Oi(e, t, n) {
|
|
3215
|
+
return !n && t.filter && !t.filter(e) ? null : Promise.resolve(e).then((e) => yi(e, t)).then((n) => Si(e, n, t)).then((n) => Ei(e, n, t)).then((e) => Di(e, t));
|
|
3128
3216
|
}
|
|
3129
3217
|
//#endregion
|
|
3130
3218
|
//#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/embed-resources.js
|
|
3131
|
-
var
|
|
3132
|
-
function
|
|
3219
|
+
var ki = /url\((['"]?)([^'"]+?)\1\)/g, Ai = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g, ji = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;
|
|
3220
|
+
function Mi(e) {
|
|
3133
3221
|
let t = e.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1");
|
|
3134
3222
|
return RegExp(`(url\\(['"]?)(${t})(['"]?\\))`, "g");
|
|
3135
3223
|
}
|
|
3136
|
-
function
|
|
3224
|
+
function Ni(e) {
|
|
3137
3225
|
let t = [];
|
|
3138
|
-
return e.replace(
|
|
3226
|
+
return e.replace(ki, (e, n, r) => (t.push(r), e)), t.filter((e) => !ui(e));
|
|
3139
3227
|
}
|
|
3140
|
-
async function
|
|
3228
|
+
async function Pi(e, t, n, r, i) {
|
|
3141
3229
|
try {
|
|
3142
|
-
let a = n ?
|
|
3143
|
-
return s = i ?
|
|
3230
|
+
let a = n ? Br(t, n) : t, o = ci(t), s;
|
|
3231
|
+
return s = i ? di(await i(a), o) : await hi(a, o, r), e.replace(Mi(t), `$1${s}$3`);
|
|
3144
3232
|
} catch {}
|
|
3145
3233
|
return e;
|
|
3146
3234
|
}
|
|
3147
|
-
function
|
|
3148
|
-
return t ? e.replace(
|
|
3235
|
+
function Fi(e, { preferredFontFormat: t }) {
|
|
3236
|
+
return t ? e.replace(ji, (e) => {
|
|
3149
3237
|
for (;;) {
|
|
3150
|
-
let [n, , r] =
|
|
3238
|
+
let [n, , r] = Ai.exec(e) || [];
|
|
3151
3239
|
if (!r) return "";
|
|
3152
3240
|
if (r === t) return `src: ${n};`;
|
|
3153
3241
|
}
|
|
3154
3242
|
}) : e;
|
|
3155
3243
|
}
|
|
3156
|
-
function
|
|
3157
|
-
return e.search(
|
|
3244
|
+
function Ii(e) {
|
|
3245
|
+
return e.search(ki) !== -1;
|
|
3158
3246
|
}
|
|
3159
|
-
async function
|
|
3160
|
-
if (!
|
|
3161
|
-
let r =
|
|
3162
|
-
return
|
|
3247
|
+
async function Li(e, t, n) {
|
|
3248
|
+
if (!Ii(e)) return e;
|
|
3249
|
+
let r = Fi(e, n);
|
|
3250
|
+
return Ni(r).reduce((e, r) => e.then((e) => Pi(e, r, t, n)), Promise.resolve(r));
|
|
3163
3251
|
}
|
|
3164
3252
|
//#endregion
|
|
3165
3253
|
//#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/embed-images.js
|
|
3166
|
-
async function
|
|
3254
|
+
async function Ri(e, t, n) {
|
|
3167
3255
|
let r = t.style?.getPropertyValue(e);
|
|
3168
3256
|
if (r) {
|
|
3169
|
-
let i = await
|
|
3257
|
+
let i = await Li(r, null, n);
|
|
3170
3258
|
return t.style.setProperty(e, i, t.style.getPropertyPriority(e)), !0;
|
|
3171
3259
|
}
|
|
3172
3260
|
return !1;
|
|
3173
3261
|
}
|
|
3174
|
-
async function
|
|
3175
|
-
await
|
|
3262
|
+
async function zi(e, t) {
|
|
3263
|
+
await Ri("background", e, t) || await Ri("background-image", e, t), await Ri("mask", e, t) || await Ri("-webkit-mask", e, t) || await Ri("mask-image", e, t) || await Ri("-webkit-mask-image", e, t);
|
|
3176
3264
|
}
|
|
3177
|
-
async function
|
|
3265
|
+
async function Bi(e, t) {
|
|
3178
3266
|
let n = Z(e, HTMLImageElement);
|
|
3179
|
-
if (!(n && !
|
|
3180
|
-
let r = n ? e.src : e.href.baseVal, i = await
|
|
3267
|
+
if (!(n && !ui(e.src)) && !(Z(e, SVGImageElement) && !ui(e.href.baseVal))) return;
|
|
3268
|
+
let r = n ? e.src : e.href.baseVal, i = await hi(r, ci(r), t);
|
|
3181
3269
|
await new Promise((r, a) => {
|
|
3182
3270
|
e.onload = r, e.onerror = t.onImageErrorHandler ? (...e) => {
|
|
3183
3271
|
try {
|
|
@@ -3190,16 +3278,16 @@ async function Fi(e, t) {
|
|
|
3190
3278
|
o.decode &&= r, o.loading === "lazy" && (o.loading = "eager"), n ? (e.srcset = "", e.src = i) : e.href.baseVal = i;
|
|
3191
3279
|
});
|
|
3192
3280
|
}
|
|
3193
|
-
async function
|
|
3194
|
-
let n =
|
|
3281
|
+
async function Vi(e, t) {
|
|
3282
|
+
let n = Y(e.childNodes).map((e) => Hi(e, t));
|
|
3195
3283
|
await Promise.all(n).then(() => e);
|
|
3196
3284
|
}
|
|
3197
|
-
async function
|
|
3198
|
-
Z(e, Element) && (await
|
|
3285
|
+
async function Hi(e, t) {
|
|
3286
|
+
Z(e, Element) && (await zi(e, t), await Bi(e, t), await Vi(e, t));
|
|
3199
3287
|
}
|
|
3200
3288
|
//#endregion
|
|
3201
3289
|
//#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/apply-style.js
|
|
3202
|
-
function
|
|
3290
|
+
function Ui(e, t) {
|
|
3203
3291
|
let { style: n } = e;
|
|
3204
3292
|
t.backgroundColor && (n.backgroundColor = t.backgroundColor), t.width && (n.width = `${t.width}px`), t.height && (n.height = `${t.height}px`);
|
|
3205
3293
|
let r = t.style;
|
|
@@ -3209,22 +3297,22 @@ function Ri(e, t) {
|
|
|
3209
3297
|
}
|
|
3210
3298
|
//#endregion
|
|
3211
3299
|
//#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/embed-webfonts.js
|
|
3212
|
-
var
|
|
3213
|
-
async function
|
|
3214
|
-
let t =
|
|
3300
|
+
var Wi = {};
|
|
3301
|
+
async function Gi(e) {
|
|
3302
|
+
let t = Wi[e];
|
|
3215
3303
|
return t ?? (t = {
|
|
3216
3304
|
url: e,
|
|
3217
3305
|
cssText: await (await fetch(e)).text()
|
|
3218
|
-
},
|
|
3306
|
+
}, Wi[e] = t, t);
|
|
3219
3307
|
}
|
|
3220
|
-
async function
|
|
3308
|
+
async function Ki(e, t) {
|
|
3221
3309
|
let n = e.cssText, r = /url\(["']?([^"')]+)["']?\)/g, i = (n.match(/url\([^)]+\)/g) || []).map(async (i) => {
|
|
3222
3310
|
let a = i.replace(r, "$1");
|
|
3223
|
-
return a.startsWith("https://") || (a = new URL(a, e.url).href),
|
|
3311
|
+
return a.startsWith("https://") || (a = new URL(a, e.url).href), fi(a, t.fetchRequestInit, ({ result: e }) => (n = n.replace(i, `url(${e})`), [i, e]));
|
|
3224
3312
|
});
|
|
3225
3313
|
return Promise.all(i).then(() => n);
|
|
3226
3314
|
}
|
|
3227
|
-
function
|
|
3315
|
+
function qi(e) {
|
|
3228
3316
|
if (e == null) return [];
|
|
3229
3317
|
let t = [], n = e.replace(/(\/\*[\s\S]*?\*\/)/gi, ""), r = /* @__PURE__ */ RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})", "gi");
|
|
3230
3318
|
for (;;) {
|
|
@@ -3244,13 +3332,13 @@ function Hi(e) {
|
|
|
3244
3332
|
}
|
|
3245
3333
|
return t;
|
|
3246
3334
|
}
|
|
3247
|
-
async function
|
|
3335
|
+
async function Ji(e, t) {
|
|
3248
3336
|
let n = [], r = [];
|
|
3249
3337
|
return e.forEach((n) => {
|
|
3250
3338
|
if ("cssRules" in n) try {
|
|
3251
|
-
|
|
3339
|
+
Y(n.cssRules || []).forEach((e, i) => {
|
|
3252
3340
|
if (e.type === CSSRule.IMPORT_RULE) {
|
|
3253
|
-
let a = i + 1, o = e.href, s =
|
|
3341
|
+
let a = i + 1, o = e.href, s = Gi(o).then((e) => Ki(e, t)).then((e) => qi(e).forEach((e) => {
|
|
3254
3342
|
try {
|
|
3255
3343
|
n.insertRule(e, e.startsWith("@import") ? a += 1 : n.cssRules.length);
|
|
3256
3344
|
} catch (t) {
|
|
@@ -3267,7 +3355,7 @@ async function Ui(e, t) {
|
|
|
3267
3355
|
});
|
|
3268
3356
|
} catch (i) {
|
|
3269
3357
|
let a = e.find((e) => e.href == null) || document.styleSheets[0];
|
|
3270
|
-
n.href != null && r.push(
|
|
3358
|
+
n.href != null && r.push(Gi(n.href).then((e) => Ki(e, t)).then((e) => qi(e).forEach((e) => {
|
|
3271
3359
|
a.insertRule(e, a.cssRules.length);
|
|
3272
3360
|
})).catch((e) => {
|
|
3273
3361
|
console.error("Error loading remote stylesheet", e);
|
|
@@ -3275,7 +3363,7 @@ async function Ui(e, t) {
|
|
|
3275
3363
|
}
|
|
3276
3364
|
}), Promise.all(r).then(() => (e.forEach((e) => {
|
|
3277
3365
|
if ("cssRules" in e) try {
|
|
3278
|
-
|
|
3366
|
+
Y(e.cssRules || []).forEach((e) => {
|
|
3279
3367
|
n.push(e);
|
|
3280
3368
|
});
|
|
3281
3369
|
} catch (t) {
|
|
@@ -3283,36 +3371,36 @@ async function Ui(e, t) {
|
|
|
3283
3371
|
}
|
|
3284
3372
|
}), n));
|
|
3285
3373
|
}
|
|
3286
|
-
function
|
|
3287
|
-
return e.filter((e) => e.type === CSSRule.FONT_FACE_RULE).filter((e) =>
|
|
3374
|
+
function Yi(e) {
|
|
3375
|
+
return e.filter((e) => e.type === CSSRule.FONT_FACE_RULE).filter((e) => Ii(e.style.getPropertyValue("src")));
|
|
3288
3376
|
}
|
|
3289
|
-
async function
|
|
3377
|
+
async function Xi(e, t) {
|
|
3290
3378
|
if (e.ownerDocument == null) throw Error("Provided element is not within a Document");
|
|
3291
|
-
return
|
|
3379
|
+
return Yi(await Ji(Y(e.ownerDocument.styleSheets), t));
|
|
3292
3380
|
}
|
|
3293
|
-
function
|
|
3381
|
+
function Zi(e) {
|
|
3294
3382
|
return e.trim().replace(/["']/g, "");
|
|
3295
3383
|
}
|
|
3296
|
-
function
|
|
3384
|
+
function Qi(e) {
|
|
3297
3385
|
let t = /* @__PURE__ */ new Set();
|
|
3298
3386
|
function n(e) {
|
|
3299
3387
|
(e.style.fontFamily || getComputedStyle(e).fontFamily).split(",").forEach((e) => {
|
|
3300
|
-
t.add(
|
|
3388
|
+
t.add(Zi(e));
|
|
3301
3389
|
}), Array.from(e.children).forEach((e) => {
|
|
3302
3390
|
e instanceof HTMLElement && n(e);
|
|
3303
3391
|
});
|
|
3304
3392
|
}
|
|
3305
3393
|
return n(e), t;
|
|
3306
3394
|
}
|
|
3307
|
-
async function
|
|
3308
|
-
let n = await
|
|
3309
|
-
return (await Promise.all(n.filter((e) => r.has(
|
|
3395
|
+
async function $i(e, t) {
|
|
3396
|
+
let n = await Xi(e, t), r = Qi(e);
|
|
3397
|
+
return (await Promise.all(n.filter((e) => r.has(Zi(e.style.fontFamily))).map((e) => {
|
|
3310
3398
|
let n = e.parentStyleSheet ? e.parentStyleSheet.href : null;
|
|
3311
|
-
return
|
|
3399
|
+
return Li(e.cssText, n, t);
|
|
3312
3400
|
}))).join("\n");
|
|
3313
3401
|
}
|
|
3314
|
-
async function
|
|
3315
|
-
let n = t.fontEmbedCSS == null ? t.skipFonts ? null : await
|
|
3402
|
+
async function ea(e, t) {
|
|
3403
|
+
let n = t.fontEmbedCSS == null ? t.skipFonts ? null : await $i(e, t) : t.fontEmbedCSS;
|
|
3316
3404
|
if (n) {
|
|
3317
3405
|
let t = document.createElement("style"), r = document.createTextNode(n);
|
|
3318
3406
|
t.appendChild(r), e.firstChild ? e.insertBefore(t, e.firstChild) : e.appendChild(t);
|
|
@@ -3320,23 +3408,23 @@ async function Yi(e, t) {
|
|
|
3320
3408
|
}
|
|
3321
3409
|
//#endregion
|
|
3322
3410
|
//#region ../../node_modules/.pnpm/html-to-image@1.11.13/node_modules/html-to-image/es/index.js
|
|
3323
|
-
async function
|
|
3324
|
-
let { width: n, height: r } =
|
|
3325
|
-
return await
|
|
3411
|
+
async function ta(e, t = {}) {
|
|
3412
|
+
let { width: n, height: r } = qr(e, t), i = await Oi(e, t, !0);
|
|
3413
|
+
return await ea(i, t), await Hi(i, t), Ui(i, t), await Qr(i, n, r);
|
|
3326
3414
|
}
|
|
3327
|
-
async function
|
|
3328
|
-
let { width: n, height: r } =
|
|
3329
|
-
return a.width = c * s, a.height = l * s, t.skipAutoScale ||
|
|
3415
|
+
async function na(e, t = {}) {
|
|
3416
|
+
let { width: n, height: r } = qr(e, t), i = await Xr(await ta(e, t)), a = document.createElement("canvas"), o = a.getContext("2d"), s = t.pixelRatio || Jr(), c = t.canvasWidth || n, l = t.canvasHeight || r;
|
|
3417
|
+
return a.width = c * s, a.height = l * s, t.skipAutoScale || Yr(a), a.style.width = `${c}`, a.style.height = `${l}`, t.backgroundColor && (o.fillStyle = t.backgroundColor, o.fillRect(0, 0, a.width, a.height)), o.drawImage(i, 0, 0, a.width, a.height), a;
|
|
3330
3418
|
}
|
|
3331
3419
|
//#endregion
|
|
3332
3420
|
//#region src/runtime/screenshot.ts
|
|
3333
|
-
var
|
|
3334
|
-
async function
|
|
3421
|
+
var ra = 2 * 1024 * 1024;
|
|
3422
|
+
async function ia(e, t) {
|
|
3335
3423
|
try {
|
|
3336
3424
|
function n(t) {
|
|
3337
3425
|
return !(e && (t === e || e.contains(t)));
|
|
3338
3426
|
}
|
|
3339
|
-
let r = window.innerWidth, i = window.innerHeight, a = Math.min(window.devicePixelRatio, 2), o = await
|
|
3427
|
+
let r = window.innerWidth, i = window.innerHeight, a = Math.min(window.devicePixelRatio, 2), o = await na(document.documentElement, {
|
|
3340
3428
|
width: r,
|
|
3341
3429
|
height: i,
|
|
3342
3430
|
cacheBust: !0,
|
|
@@ -3350,21 +3438,21 @@ async function $i(e, t) {
|
|
|
3350
3438
|
});
|
|
3351
3439
|
if (t) {
|
|
3352
3440
|
let e = o.getContext("2d");
|
|
3353
|
-
e &&
|
|
3441
|
+
e && oa(e, t.x, t.y, a);
|
|
3354
3442
|
}
|
|
3355
|
-
let s = await
|
|
3443
|
+
let s = await aa(o, .85);
|
|
3356
3444
|
if (!s) return null;
|
|
3357
|
-
if (s.size <=
|
|
3358
|
-
let c = await
|
|
3359
|
-
return !c || c.size >
|
|
3445
|
+
if (s.size <= ra) return s;
|
|
3446
|
+
let c = await aa(o, .5);
|
|
3447
|
+
return !c || c.size > ra ? null : c;
|
|
3360
3448
|
} catch {
|
|
3361
3449
|
return null;
|
|
3362
3450
|
}
|
|
3363
3451
|
}
|
|
3364
|
-
function
|
|
3452
|
+
function aa(e, t) {
|
|
3365
3453
|
return new Promise((n) => e.toBlob(n, "image/jpeg", t));
|
|
3366
3454
|
}
|
|
3367
|
-
function
|
|
3455
|
+
function oa(e, t, n, r) {
|
|
3368
3456
|
let i = r, a = 28 * i, o = a / 2, s = t * i, c = n * i;
|
|
3369
3457
|
e.save(), e.translate(s, c), e.rotate(-Math.PI / 4);
|
|
3370
3458
|
let l = 2 * i;
|
|
@@ -3386,8 +3474,59 @@ function Q(...e) {
|
|
|
3386
3474
|
return e.filter(Boolean).join(" ");
|
|
3387
3475
|
}
|
|
3388
3476
|
//#endregion
|
|
3477
|
+
//#region src/runtime/use-drag.ts
|
|
3478
|
+
function sa(e) {
|
|
3479
|
+
let t = z(e);
|
|
3480
|
+
t.current = e;
|
|
3481
|
+
let [n, r] = L(!1), i = z(!1);
|
|
3482
|
+
return {
|
|
3483
|
+
onPointerDown: B((e) => {
|
|
3484
|
+
let n = t.current;
|
|
3485
|
+
if (n.stopPropagation && e.stopPropagation(), e.button !== 0 || n.shouldStart && !n.shouldStart(e)) return;
|
|
3486
|
+
let a = e.currentTarget;
|
|
3487
|
+
if (!a) return;
|
|
3488
|
+
let o = (n.targetRef?.current ?? a).getBoundingClientRect(), s = e.clientX, c = e.clientY, l = o.left, u = o.top, d = o.width, f = o.height, p = n.threshold ?? 4, m = n.margin ?? 8, h = e.pointerId, g = !1, _ = null;
|
|
3489
|
+
i.current = !1;
|
|
3490
|
+
try {
|
|
3491
|
+
a.setPointerCapture(h);
|
|
3492
|
+
} catch {}
|
|
3493
|
+
function v() {
|
|
3494
|
+
try {
|
|
3495
|
+
a?.releasePointerCapture(h);
|
|
3496
|
+
} catch {}
|
|
3497
|
+
a?.removeEventListener("pointermove", y), a?.removeEventListener("pointerup", b), a?.removeEventListener("pointercancel", x), r(!1);
|
|
3498
|
+
}
|
|
3499
|
+
function y(e) {
|
|
3500
|
+
if (e.pointerId !== h) return;
|
|
3501
|
+
let n = e.clientX - s, a = e.clientY - c;
|
|
3502
|
+
if (!g) {
|
|
3503
|
+
if (Math.abs(n) + Math.abs(a) < p) return;
|
|
3504
|
+
g = !0, i.current = !0, r(!0), t.current.onStart?.();
|
|
3505
|
+
}
|
|
3506
|
+
let o = Math.max(m, window.innerWidth - d - m), v = Math.max(m, window.innerHeight - f - m), y = {
|
|
3507
|
+
left: ca(l + n, m, o),
|
|
3508
|
+
top: ca(u + a, m, v)
|
|
3509
|
+
};
|
|
3510
|
+
_ = y, t.current.onMove(y);
|
|
3511
|
+
}
|
|
3512
|
+
function b(e) {
|
|
3513
|
+
e.pointerId === h && (v(), g && _ && t.current.onEnd?.(_, e));
|
|
3514
|
+
}
|
|
3515
|
+
function x(e) {
|
|
3516
|
+
e.pointerId === h && (v(), i.current = !1, t.current.onCancel?.());
|
|
3517
|
+
}
|
|
3518
|
+
a.addEventListener("pointermove", y), a.addEventListener("pointerup", b), a.addEventListener("pointercancel", x);
|
|
3519
|
+
}, []),
|
|
3520
|
+
isDragging: n,
|
|
3521
|
+
consumeClickIfDragged: B(() => i.current ? (i.current = !1, !0) : !1, [])
|
|
3522
|
+
};
|
|
3523
|
+
}
|
|
3524
|
+
function ca(e, t, n) {
|
|
3525
|
+
return Math.max(t, Math.min(n, e));
|
|
3526
|
+
}
|
|
3527
|
+
//#endregion
|
|
3389
3528
|
//#region ../../node_modules/.pnpm/preact@10.29.1/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js
|
|
3390
|
-
var
|
|
3529
|
+
var la = 0;
|
|
3391
3530
|
Array.isArray;
|
|
3392
3531
|
function $(e, n, r, i, a, o) {
|
|
3393
3532
|
n ||= {};
|
|
@@ -3404,7 +3543,7 @@ function $(e, n, r, i, a, o) {
|
|
|
3404
3543
|
__e: null,
|
|
3405
3544
|
__c: null,
|
|
3406
3545
|
constructor: void 0,
|
|
3407
|
-
__v: --
|
|
3546
|
+
__v: --la,
|
|
3408
3547
|
__i: -1,
|
|
3409
3548
|
__u: 0,
|
|
3410
3549
|
__source: a,
|
|
@@ -3415,7 +3554,7 @@ function $(e, n, r, i, a, o) {
|
|
|
3415
3554
|
}
|
|
3416
3555
|
//#endregion
|
|
3417
3556
|
//#region src/runtime/ui/icons.tsx
|
|
3418
|
-
function
|
|
3557
|
+
function ua({ size: e = 16 }) {
|
|
3419
3558
|
return /* @__PURE__ */ $("svg", {
|
|
3420
3559
|
width: e,
|
|
3421
3560
|
height: e,
|
|
@@ -3425,7 +3564,7 @@ function ra({ size: e = 16 }) {
|
|
|
3425
3564
|
children: /* @__PURE__ */ $("path", { d: "M63.4561 0.00557731C70.6277 -0.0175584 76.9025 1.04088 83.5898 3.71066C97.7952 9.43043 109.186 20.5001 115.311 34.5359C119.708 44.8002 120.746 54.7869 119.156 65.8171C116.857 82.7956 105.129 98.8382 90.0566 106.846C83.4394 110.362 74.7336 113.029 67.2051 113.271C62.4204 113.425 61.1274 113.32 56.6807 115.204C50.2035 117.858 43.6874 120.417 37.1348 122.879C34.8442 123.763 32.3203 124.902 29.9404 125.51C29.4023 125.648 28.1978 125.009 27.7598 124.646C26.9046 123.951 27.0582 122.505 27.0264 121.484C26.8123 114.646 27.3302 107.458 26.8604 100.656C25.1578 98.6714 22.4026 96.603 20.3086 94.1989C12.1853 84.8731 7.05334 73.9949 6.18164 61.6101C4.95583 46.292 9.97176 31.1285 20.0908 19.5632C29.989 8.13202 44.0369 1.11921 59.1221 0.0788195C60.2694 -0.0356049 62.2637 0.00944821 63.4561 0.00557731ZM92.2676 55.7497C91.5754 39.5314 77.8207 26.9725 61.6064 27.7536C45.5175 28.5287 33.0758 42.1537 33.7627 58.2468C34.4496 74.3398 48.007 86.8553 64.1035 86.2566C80.3254 85.6533 92.9599 71.968 92.2676 55.7497Z" })
|
|
3426
3565
|
});
|
|
3427
3566
|
}
|
|
3428
|
-
function
|
|
3567
|
+
function da({ size: e = 16 }) {
|
|
3429
3568
|
return /* @__PURE__ */ $("svg", {
|
|
3430
3569
|
width: e,
|
|
3431
3570
|
height: e,
|
|
@@ -3434,7 +3573,7 @@ function ia({ size: e = 16 }) {
|
|
|
3434
3573
|
children: /* @__PURE__ */ $("path", { d: "M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" })
|
|
3435
3574
|
});
|
|
3436
3575
|
}
|
|
3437
|
-
function
|
|
3576
|
+
function fa({ size: e = 16 }) {
|
|
3438
3577
|
return /* @__PURE__ */ $("svg", {
|
|
3439
3578
|
width: e,
|
|
3440
3579
|
height: e,
|
|
@@ -3443,7 +3582,7 @@ function aa({ size: e = 16 }) {
|
|
|
3443
3582
|
children: /* @__PURE__ */ $("path", { d: "M3 10a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM8.5 10a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM15.5 8.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z" })
|
|
3444
3583
|
});
|
|
3445
3584
|
}
|
|
3446
|
-
function
|
|
3585
|
+
function pa({ size: e = 16 }) {
|
|
3447
3586
|
return /* @__PURE__ */ $("svg", {
|
|
3448
3587
|
width: e,
|
|
3449
3588
|
height: e,
|
|
@@ -3456,7 +3595,7 @@ function oa({ size: e = 16 }) {
|
|
|
3456
3595
|
})
|
|
3457
3596
|
});
|
|
3458
3597
|
}
|
|
3459
|
-
function
|
|
3598
|
+
function ma({ size: e = 16 }) {
|
|
3460
3599
|
return /* @__PURE__ */ $("svg", {
|
|
3461
3600
|
width: e,
|
|
3462
3601
|
height: e,
|
|
@@ -3470,7 +3609,7 @@ function sa({ size: e = 16 }) {
|
|
|
3470
3609
|
})
|
|
3471
3610
|
});
|
|
3472
3611
|
}
|
|
3473
|
-
function
|
|
3612
|
+
function ha({ size: e = 16 }) {
|
|
3474
3613
|
return /* @__PURE__ */ $("svg", {
|
|
3475
3614
|
width: e,
|
|
3476
3615
|
height: e,
|
|
@@ -3479,7 +3618,7 @@ function ca({ size: e = 16 }) {
|
|
|
3479
3618
|
children: /* @__PURE__ */ $("path", { d: "M2.87 2.298a.75.75 0 0 0-.812 1.021L3.39 6.624a1 1 0 0 0 .928.626H8.25a.75.75 0 0 1 0 1.5H4.318a1 1 0 0 0-.927.626l-1.333 3.305a.75.75 0 0 0 .811 1.022 24.89 24.89 0 0 0 11.668-5.115.75.75 0 0 0 0-1.175A24.89 24.89 0 0 0 2.869 2.298Z" })
|
|
3480
3619
|
});
|
|
3481
3620
|
}
|
|
3482
|
-
function
|
|
3621
|
+
function ga({ size: e = 16 }) {
|
|
3483
3622
|
return /* @__PURE__ */ $("svg", {
|
|
3484
3623
|
width: e,
|
|
3485
3624
|
height: e,
|
|
@@ -3491,85 +3630,48 @@ function la({ size: e = 16 }) {
|
|
|
3491
3630
|
}
|
|
3492
3631
|
//#endregion
|
|
3493
3632
|
//#region src/runtime/ui/fab.tsx
|
|
3494
|
-
function
|
|
3495
|
-
let a = r === "bottom-left" ? "markup-fab-left" : "markup-fab-right", o =
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
if (
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
if (Math.abs(n) + Math.abs(r) < 4) return;
|
|
3510
|
-
g = !0, d.current = !0, u(!0);
|
|
3511
|
-
}
|
|
3512
|
-
let i = Math.max(8, window.innerWidth - m - 8), a = Math.max(8, window.innerHeight - h - 8);
|
|
3513
|
-
c({
|
|
3514
|
-
left: da(f + n, 8, i),
|
|
3515
|
-
top: da(p + r, 8, a)
|
|
3516
|
-
});
|
|
3517
|
-
}
|
|
3518
|
-
function v(e) {
|
|
3519
|
-
try {
|
|
3520
|
-
n.releasePointerCapture(e.pointerId);
|
|
3521
|
-
} catch {}
|
|
3522
|
-
n.removeEventListener("pointermove", _), n.removeEventListener("pointerup", y), n.removeEventListener("pointercancel", b), c(null), u(!1);
|
|
3523
|
-
}
|
|
3524
|
-
function y(t) {
|
|
3525
|
-
if (t.pointerId === e.pointerId && (v(t), g)) {
|
|
3526
|
-
let e = t.clientX < window.innerWidth / 2 ? "bottom-left" : "bottom-right";
|
|
3527
|
-
e !== r && i?.(e);
|
|
3633
|
+
function _a({ active: e, onToggle: t, onHide: n, position: r = "bottom-right", onPositionChange: i }) {
|
|
3634
|
+
let a = r === "bottom-left" ? "markup-fab-left" : "markup-fab-right", [o, s] = L(null), { onPointerDown: c, isDragging: l, consumeClickIfDragged: u } = sa({
|
|
3635
|
+
stopPropagation: !0,
|
|
3636
|
+
onMove: s,
|
|
3637
|
+
onEnd: (e, t) => {
|
|
3638
|
+
let n = t.clientX < window.innerWidth / 2 ? "bottom-left" : "bottom-right";
|
|
3639
|
+
n !== r && i?.(n), s(null);
|
|
3640
|
+
},
|
|
3641
|
+
onCancel: () => s(null)
|
|
3642
|
+
});
|
|
3643
|
+
function d(e) {
|
|
3644
|
+
if (e.preventDefault(), e.stopPropagation(), !u()) {
|
|
3645
|
+
if ((e.metaKey || e.ctrlKey) && n) {
|
|
3646
|
+
n();
|
|
3647
|
+
return;
|
|
3528
3648
|
}
|
|
3649
|
+
t();
|
|
3529
3650
|
}
|
|
3530
|
-
function b(t) {
|
|
3531
|
-
t.pointerId === e.pointerId && (v(t), d.current = !1);
|
|
3532
|
-
}
|
|
3533
|
-
n.addEventListener("pointermove", _), n.addEventListener("pointerup", y), n.addEventListener("pointercancel", b);
|
|
3534
|
-
}
|
|
3535
|
-
function p(e) {
|
|
3536
|
-
if (e.preventDefault(), e.stopPropagation(), d.current) {
|
|
3537
|
-
d.current = !1;
|
|
3538
|
-
return;
|
|
3539
|
-
}
|
|
3540
|
-
if ((e.metaKey || e.ctrlKey) && n) {
|
|
3541
|
-
n();
|
|
3542
|
-
return;
|
|
3543
|
-
}
|
|
3544
|
-
t();
|
|
3545
3651
|
}
|
|
3546
3652
|
return /* @__PURE__ */ $("button", {
|
|
3547
|
-
ref: o,
|
|
3548
3653
|
type: "button",
|
|
3549
|
-
class: Q("markup-fab", !
|
|
3550
|
-
style:
|
|
3551
|
-
left: `${
|
|
3552
|
-
top: `${
|
|
3654
|
+
class: Q("markup-fab", !o && a, o && "is-floating", l && "is-dragging", e && "is-active"),
|
|
3655
|
+
style: o ? {
|
|
3656
|
+
left: `${o.left}px`,
|
|
3657
|
+
top: `${o.top}px`
|
|
3553
3658
|
} : void 0,
|
|
3554
|
-
onClick:
|
|
3555
|
-
onPointerDown:
|
|
3659
|
+
onClick: d,
|
|
3660
|
+
onPointerDown: c,
|
|
3556
3661
|
"aria-label": e ? "Cancel placing markup" : "Leave a markup",
|
|
3557
3662
|
"aria-pressed": e,
|
|
3558
3663
|
children: [/* @__PURE__ */ $("span", {
|
|
3559
3664
|
class: "markup-fab-icon",
|
|
3560
|
-
children: $(e ?
|
|
3665
|
+
children: $(e ? da : ua, { size: 16 })
|
|
3561
3666
|
}), /* @__PURE__ */ $("span", {
|
|
3562
3667
|
class: "markup-fab-label",
|
|
3563
3668
|
children: e ? "Cancel" : "Markup"
|
|
3564
3669
|
})]
|
|
3565
3670
|
});
|
|
3566
3671
|
}
|
|
3567
|
-
function da(e, t, n) {
|
|
3568
|
-
return Math.max(t, Math.min(n, e));
|
|
3569
|
-
}
|
|
3570
3672
|
//#endregion
|
|
3571
3673
|
//#region src/runtime/use-focus-trap.ts
|
|
3572
|
-
var
|
|
3674
|
+
var va = [
|
|
3573
3675
|
"a[href]",
|
|
3574
3676
|
"button:not([disabled])",
|
|
3575
3677
|
"input:not([disabled])",
|
|
@@ -3577,14 +3679,14 @@ var fa = [
|
|
|
3577
3679
|
"textarea:not([disabled])",
|
|
3578
3680
|
"[tabindex]:not([tabindex=\"-1\"])"
|
|
3579
3681
|
].join(",");
|
|
3580
|
-
function
|
|
3581
|
-
|
|
3682
|
+
function ya(e, t) {
|
|
3683
|
+
R(() => {
|
|
3582
3684
|
if (!t) return;
|
|
3583
3685
|
let n = e.current;
|
|
3584
3686
|
if (!n) return;
|
|
3585
3687
|
function r(e) {
|
|
3586
3688
|
if (e.key !== "Tab") return;
|
|
3587
|
-
let t = Array.from(n.querySelectorAll(
|
|
3689
|
+
let t = Array.from(n.querySelectorAll(va)), r = t[0], i = t[t.length - 1];
|
|
3588
3690
|
if (!r || !i) return;
|
|
3589
3691
|
let a = n.getRootNode(), o = a instanceof ShadowRoot ? a.activeElement : document.activeElement;
|
|
3590
3692
|
(e.shiftKey ? o === r : o === i) && (e.preventDefault(), (e.shiftKey ? i : r).focus());
|
|
@@ -3593,10 +3695,23 @@ function pa(e, t) {
|
|
|
3593
3695
|
}, [e, t]);
|
|
3594
3696
|
}
|
|
3595
3697
|
//#endregion
|
|
3698
|
+
//#region src/runtime/use-object-url.ts
|
|
3699
|
+
function ba(e) {
|
|
3700
|
+
let [t, n] = L(null);
|
|
3701
|
+
return R(() => {
|
|
3702
|
+
if (!e) {
|
|
3703
|
+
n(null);
|
|
3704
|
+
return;
|
|
3705
|
+
}
|
|
3706
|
+
let t = URL.createObjectURL(e);
|
|
3707
|
+
return n(t), () => URL.revokeObjectURL(t);
|
|
3708
|
+
}, [e]), t;
|
|
3709
|
+
}
|
|
3710
|
+
//#endregion
|
|
3596
3711
|
//#region src/runtime/ui/author-prompt.tsx
|
|
3597
|
-
function
|
|
3598
|
-
let [o, s] =
|
|
3599
|
-
|
|
3712
|
+
function xa({ pending: e, connecting: t = !1, signingIn: n = !1, onSubmit: r, onCancel: i, onSignIn: a }) {
|
|
3713
|
+
let [o, s] = L(""), [c, l] = L(""), u = z(null);
|
|
3714
|
+
R(() => {
|
|
3600
3715
|
u.current?.focus();
|
|
3601
3716
|
}, []);
|
|
3602
3717
|
function d(n) {
|
|
@@ -3673,18 +3788,18 @@ function ma({ pending: e, connecting: t = !1, signingIn: n = !1, onSubmit: r, on
|
|
|
3673
3788
|
}
|
|
3674
3789
|
//#endregion
|
|
3675
3790
|
//#region src/runtime/ui/composer.tsx
|
|
3676
|
-
var
|
|
3677
|
-
function
|
|
3678
|
-
let [s, c] =
|
|
3679
|
-
|
|
3791
|
+
var Sa = 4e3;
|
|
3792
|
+
function Ca({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "Post", initialFocus: r = !0, pending: i, error: a, onSubmit: o }) {
|
|
3793
|
+
let [s, c] = L(""), l = z(null), u = z(!1);
|
|
3794
|
+
R(() => {
|
|
3680
3795
|
r && l.current?.focus();
|
|
3681
|
-
}, [r]),
|
|
3796
|
+
}, [r]), R(() => {
|
|
3682
3797
|
let e = l.current;
|
|
3683
3798
|
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 160)}px`);
|
|
3684
|
-
}, [s]),
|
|
3799
|
+
}, [s]), R(() => {
|
|
3685
3800
|
u.current && !i && !a && (c(""), l.current?.focus()), u.current = i;
|
|
3686
3801
|
}, [i, a]);
|
|
3687
|
-
let d =
|
|
3802
|
+
let d = Sa - s.length, f = d < 0;
|
|
3688
3803
|
function p(e) {
|
|
3689
3804
|
e?.preventDefault();
|
|
3690
3805
|
let t = s.trim();
|
|
@@ -3702,7 +3817,7 @@ function ga({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "
|
|
|
3702
3817
|
"aria-label": i ? "Sending…" : n,
|
|
3703
3818
|
title: i ? "Sending…" : n,
|
|
3704
3819
|
tabIndex: e,
|
|
3705
|
-
children: /* @__PURE__ */ $(
|
|
3820
|
+
children: /* @__PURE__ */ $(ha, { size: 14 })
|
|
3706
3821
|
});
|
|
3707
3822
|
}
|
|
3708
3823
|
return /* @__PURE__ */ $("form", {
|
|
@@ -3715,7 +3830,7 @@ function ga({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "
|
|
|
3715
3830
|
class: "markup-composer-input",
|
|
3716
3831
|
placeholder: t,
|
|
3717
3832
|
rows: h ? 2 : 1,
|
|
3718
|
-
maxLength:
|
|
3833
|
+
maxLength: Sa + 100,
|
|
3719
3834
|
value: s,
|
|
3720
3835
|
onInput: (e) => c(e.currentTarget.value),
|
|
3721
3836
|
onKeyDown: m,
|
|
@@ -3751,18 +3866,15 @@ function ga({ label: e, placeholder: t = "Leave feedback…", submitLabel: n = "
|
|
|
3751
3866
|
}
|
|
3752
3867
|
//#endregion
|
|
3753
3868
|
//#region src/runtime/ui/new-thread-popover.tsx
|
|
3754
|
-
function
|
|
3755
|
-
let m =
|
|
3756
|
-
|
|
3757
|
-
let [h, g] =
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
let e = URL.createObjectURL(c);
|
|
3764
|
-
return v(e), () => URL.revokeObjectURL(e);
|
|
3765
|
-
}, [c]), B(() => {
|
|
3869
|
+
function wa({ pageX: e, pageY: t, authorName: n, isVerified: r, identityResolving: i, signingIn: a, pending: o, error: s, screenshot: c, screenshotCapturing: l, onAuthor: u, onSignIn: d, onSubmit: f, onClose: p }) {
|
|
3870
|
+
let m = z(null);
|
|
3871
|
+
ya(m, !0);
|
|
3872
|
+
let [h, g] = L(!1), _ = ba(c), [v, y] = L(null), { onPointerDown: b, isDragging: x } = sa({
|
|
3873
|
+
targetRef: m,
|
|
3874
|
+
shouldStart: (e) => !e.target?.closest("button, a, input, textarea, select"),
|
|
3875
|
+
onMove: y
|
|
3876
|
+
});
|
|
3877
|
+
R(() => {
|
|
3766
3878
|
let e = m.current;
|
|
3767
3879
|
if (!e) return;
|
|
3768
3880
|
if (typeof e.showPopover == "function" && !e.matches(":popover-open")) try {
|
|
@@ -3773,51 +3885,20 @@ function _a({ pageX: e, pageY: t, authorName: n, isVerified: r, identityResolvin
|
|
|
3773
3885
|
}
|
|
3774
3886
|
return e.addEventListener("toggle", t), () => e.removeEventListener("toggle", t);
|
|
3775
3887
|
}, [p]);
|
|
3776
|
-
let
|
|
3777
|
-
function D(e) {
|
|
3778
|
-
if (e.button !== 0 || e.target?.closest("button, a, input, textarea, select")) return;
|
|
3779
|
-
let t = m.current;
|
|
3780
|
-
if (!t) return;
|
|
3781
|
-
let n = t.getBoundingClientRect(), r = e.clientX, i = e.clientY, a = n.left, o = n.top, s = n.width, c = n.height, l = e.currentTarget, u = !1;
|
|
3782
|
-
try {
|
|
3783
|
-
l.setPointerCapture(e.pointerId);
|
|
3784
|
-
} catch {}
|
|
3785
|
-
function d(t) {
|
|
3786
|
-
if (t.pointerId !== e.pointerId) return;
|
|
3787
|
-
let n = t.clientX - r, l = t.clientY - i;
|
|
3788
|
-
if (!u) {
|
|
3789
|
-
if (Math.abs(n) + Math.abs(l) < 4) return;
|
|
3790
|
-
u = !0, S(!0);
|
|
3791
|
-
}
|
|
3792
|
-
let d = Math.max(8, window.innerWidth - s - 8), f = Math.max(8, window.innerHeight - c - 8);
|
|
3793
|
-
b({
|
|
3794
|
-
left: va(a + n, 8, d),
|
|
3795
|
-
top: va(o + l, 8, f)
|
|
3796
|
-
});
|
|
3797
|
-
}
|
|
3798
|
-
function f(t) {
|
|
3799
|
-
if (t.pointerId === e.pointerId) {
|
|
3800
|
-
try {
|
|
3801
|
-
l.releasePointerCapture(t.pointerId);
|
|
3802
|
-
} catch {}
|
|
3803
|
-
l.removeEventListener("pointermove", d), l.removeEventListener("pointerup", f), l.removeEventListener("pointercancel", f), S(!1);
|
|
3804
|
-
}
|
|
3805
|
-
}
|
|
3806
|
-
l.addEventListener("pointermove", d), l.addEventListener("pointerup", f), l.addEventListener("pointercancel", f);
|
|
3807
|
-
}
|
|
3888
|
+
let S = Ta(e - window.scrollX + 16, 12, window.innerWidth - 320 - 12), C = Ta(t - window.scrollY - 16, 12, window.innerHeight - 220), w = c != null, T = l || w;
|
|
3808
3889
|
return /* @__PURE__ */ $("div", {
|
|
3809
3890
|
ref: m,
|
|
3810
|
-
class: Q("markup-popover",
|
|
3891
|
+
class: Q("markup-popover", v && "is-floating", x && "is-dragging"),
|
|
3811
3892
|
popover: "auto",
|
|
3812
3893
|
style: {
|
|
3813
|
-
"--markup-pop-x": `${
|
|
3814
|
-
"--markup-pop-y": `${
|
|
3894
|
+
"--markup-pop-x": `${v?.left ?? S}px`,
|
|
3895
|
+
"--markup-pop-y": `${v?.top ?? C}px`
|
|
3815
3896
|
},
|
|
3816
3897
|
role: "dialog",
|
|
3817
3898
|
"aria-label": "New markup",
|
|
3818
3899
|
children: [/* @__PURE__ */ $("header", {
|
|
3819
3900
|
class: "markup-popover-header",
|
|
3820
|
-
onPointerDown:
|
|
3901
|
+
onPointerDown: b,
|
|
3821
3902
|
children: [/* @__PURE__ */ $("span", {
|
|
3822
3903
|
class: "markup-eyebrow",
|
|
3823
3904
|
children: "new · markup"
|
|
@@ -3826,9 +3907,9 @@ function _a({ pageX: e, pageY: t, authorName: n, isVerified: r, identityResolvin
|
|
|
3826
3907
|
class: "markup-icon-btn",
|
|
3827
3908
|
"aria-label": "Discard pin",
|
|
3828
3909
|
onClick: p,
|
|
3829
|
-
children: /* @__PURE__ */ $(
|
|
3910
|
+
children: /* @__PURE__ */ $(da, { size: 16 })
|
|
3830
3911
|
})]
|
|
3831
|
-
}), n == null ? /* @__PURE__ */ $(
|
|
3912
|
+
}), n == null ? /* @__PURE__ */ $(xa, {
|
|
3832
3913
|
pending: o,
|
|
3833
3914
|
connecting: i,
|
|
3834
3915
|
signingIn: a,
|
|
@@ -3852,15 +3933,15 @@ function _a({ pageX: e, pageY: t, authorName: n, isVerified: r, identityResolvin
|
|
|
3852
3933
|
}) : null
|
|
3853
3934
|
]
|
|
3854
3935
|
}),
|
|
3855
|
-
/* @__PURE__ */ $(
|
|
3936
|
+
/* @__PURE__ */ $(Ca, {
|
|
3856
3937
|
label: "Feedback",
|
|
3857
3938
|
placeholder: "What's wrong, missing, or worth noting?",
|
|
3858
3939
|
submitLabel: "Post markup",
|
|
3859
3940
|
pending: o,
|
|
3860
3941
|
error: s,
|
|
3861
|
-
onSubmit: (e) => f(e, h &&
|
|
3942
|
+
onSubmit: (e) => f(e, h && w)
|
|
3862
3943
|
}),
|
|
3863
|
-
|
|
3944
|
+
T ? /* @__PURE__ */ $("div", {
|
|
3864
3945
|
class: "markup-screenshot-row",
|
|
3865
3946
|
children: l ? /* @__PURE__ */ $("span", {
|
|
3866
3947
|
class: "markup-screenshot-status",
|
|
@@ -3870,7 +3951,7 @@ function _a({ pageX: e, pageY: t, authorName: n, isVerified: r, identityResolvin
|
|
|
3870
3951
|
class: "markup-screenshot-checkbox",
|
|
3871
3952
|
disabled: !0
|
|
3872
3953
|
}),
|
|
3873
|
-
/* @__PURE__ */ $(
|
|
3954
|
+
/* @__PURE__ */ $(ma, { size: 12 }),
|
|
3874
3955
|
/* @__PURE__ */ $("span", { children: "Capturing…" })
|
|
3875
3956
|
]
|
|
3876
3957
|
}) : /* @__PURE__ */ $("label", {
|
|
@@ -3882,7 +3963,7 @@ function _a({ pageX: e, pageY: t, authorName: n, isVerified: r, identityResolvin
|
|
|
3882
3963
|
checked: h,
|
|
3883
3964
|
onChange: (e) => g(e.currentTarget.checked)
|
|
3884
3965
|
}),
|
|
3885
|
-
/* @__PURE__ */ $(
|
|
3966
|
+
/* @__PURE__ */ $(ma, { size: 12 }),
|
|
3886
3967
|
/* @__PURE__ */ $("span", { children: "Attach screenshot" }),
|
|
3887
3968
|
_ && h ? /* @__PURE__ */ $("img", {
|
|
3888
3969
|
class: "markup-screenshot-thumb",
|
|
@@ -3896,12 +3977,12 @@ function _a({ pageX: e, pageY: t, authorName: n, isVerified: r, identityResolvin
|
|
|
3896
3977
|
})]
|
|
3897
3978
|
});
|
|
3898
3979
|
}
|
|
3899
|
-
function
|
|
3980
|
+
function Ta(e, t, n) {
|
|
3900
3981
|
return Math.max(t, Math.min(n, e));
|
|
3901
3982
|
}
|
|
3902
3983
|
//#endregion
|
|
3903
3984
|
//#region src/runtime/ui/pin.tsx
|
|
3904
|
-
function
|
|
3985
|
+
function Ea({ pageX: e, pageY: t, count: n, active: r, onClick: i }) {
|
|
3905
3986
|
let a = t - window.scrollY, o = e - window.scrollX;
|
|
3906
3987
|
return /* @__PURE__ */ $("button", {
|
|
3907
3988
|
type: "button",
|
|
@@ -3924,7 +4005,7 @@ function ya({ pageX: e, pageY: t, count: n, active: r, onClick: i }) {
|
|
|
3924
4005
|
}) : null]
|
|
3925
4006
|
});
|
|
3926
4007
|
}
|
|
3927
|
-
function
|
|
4008
|
+
function Da({ pageX: e, pageY: t }) {
|
|
3928
4009
|
let n = t - window.scrollY, r = e - window.scrollX;
|
|
3929
4010
|
return /* @__PURE__ */ $("div", {
|
|
3930
4011
|
class: "markup-pin markup-pin-ghost is-anchor",
|
|
@@ -3940,15 +4021,15 @@ function ba({ pageX: e, pageY: t }) {
|
|
|
3940
4021
|
}
|
|
3941
4022
|
//#endregion
|
|
3942
4023
|
//#region src/runtime/ui/placement-overlay.tsx
|
|
3943
|
-
function
|
|
3944
|
-
|
|
4024
|
+
function Oa({ onPlace: e, onCancel: t }) {
|
|
4025
|
+
R(() => {
|
|
3945
4026
|
function e(e) {
|
|
3946
4027
|
e.key === "Escape" && t();
|
|
3947
4028
|
}
|
|
3948
4029
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
3949
4030
|
}, [t]);
|
|
3950
4031
|
function n(t) {
|
|
3951
|
-
t.stopPropagation(), t.preventDefault(), e(
|
|
4032
|
+
t.stopPropagation(), t.preventDefault(), e(Tr(t, document.elementsFromPoint(t.clientX, t.clientY).find((e) => !e.shadowRoot) ?? null), t.clientX, t.clientY);
|
|
3952
4033
|
}
|
|
3953
4034
|
function r(e) {
|
|
3954
4035
|
e.preventDefault(), e.stopPropagation();
|
|
@@ -3966,7 +4047,7 @@ function xa({ onPlace: e, onCancel: t }) {
|
|
|
3966
4047
|
}
|
|
3967
4048
|
//#endregion
|
|
3968
4049
|
//#region src/runtime/ui/thread-popover.tsx
|
|
3969
|
-
var
|
|
4050
|
+
var ka = [
|
|
3970
4051
|
"👍",
|
|
3971
4052
|
"❤️",
|
|
3972
4053
|
"🎉",
|
|
@@ -3974,56 +4055,37 @@ var Sa = [
|
|
|
3974
4055
|
"😄",
|
|
3975
4056
|
"❓"
|
|
3976
4057
|
];
|
|
3977
|
-
function
|
|
3978
|
-
let y =
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
let
|
|
4058
|
+
function Aa({ thread: e, authorName: t, currentClientId: n, isVerified: r, identityResolving: i, signingIn: a, canDelete: o, pending: s, error: c, hidden: l = !1, onAuthor: u, onSignIn: d, onClose: f, onReply: p, onEditComment: m, onDeleteComment: h, onToggleReaction: g, onResolve: _, onDelete: v }) {
|
|
4059
|
+
let y = z(null), b = z(null), x = z(null), S = z(null), [C, w] = L({ kind: "none" }), [T, E] = L(null), { onPointerDown: D, isDragging: O } = sa({
|
|
4060
|
+
targetRef: y,
|
|
4061
|
+
shouldStart: (e) => !e.target?.closest("button, a, input, textarea, select"),
|
|
4062
|
+
onMove: E
|
|
4063
|
+
});
|
|
4064
|
+
ya(y, !0);
|
|
4065
|
+
let k = e.resolvedAt != null, A = we(() => e.comments.filter((e) => !e.deleted), [e.comments]);
|
|
4066
|
+
R(() => {
|
|
4067
|
+
if (C.kind === "none" || C.kind === "editing") return;
|
|
4068
|
+
function e(e) {
|
|
4069
|
+
let t = S.current;
|
|
4070
|
+
t && !e.composedPath().includes(t) && w({ kind: "none" });
|
|
4071
|
+
}
|
|
4072
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
4073
|
+
}, [C.kind]), R(() => {
|
|
4074
|
+
if (C.kind !== "editing") return;
|
|
4075
|
+
let t = e.comments.find((e) => e._id === C.commentId);
|
|
4076
|
+
(!t || t.deleted) && w({ kind: "none" });
|
|
4077
|
+
}, [e.comments, C]);
|
|
4078
|
+
let j = z(!0);
|
|
4079
|
+
R(() => {
|
|
4080
|
+
let e = b.current;
|
|
3995
4081
|
if (e) {
|
|
3996
|
-
if (
|
|
3997
|
-
|
|
4082
|
+
if (j.current) {
|
|
4083
|
+
j.current = !1, e.scrollTop = e.scrollHeight;
|
|
3998
4084
|
return;
|
|
3999
4085
|
}
|
|
4000
4086
|
e.scrollHeight - e.scrollTop - e.clientHeight < 80 && (e.scrollTop = e.scrollHeight);
|
|
4001
4087
|
}
|
|
4002
|
-
}, [
|
|
4003
|
-
if (!w) {
|
|
4004
|
-
D(!1);
|
|
4005
|
-
return;
|
|
4006
|
-
}
|
|
4007
|
-
function e(e) {
|
|
4008
|
-
b.current && !e.composedPath().includes(b.current) && T(!1);
|
|
4009
|
-
}
|
|
4010
|
-
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
4011
|
-
}, [w]), B(() => {
|
|
4012
|
-
if (!j) {
|
|
4013
|
-
re(null);
|
|
4014
|
-
return;
|
|
4015
|
-
}
|
|
4016
|
-
function e(e) {
|
|
4017
|
-
x.current && !e.composedPath().includes(x.current) && M(null);
|
|
4018
|
-
}
|
|
4019
|
-
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
4020
|
-
}, [j]), B(() => {
|
|
4021
|
-
if (!ie) return;
|
|
4022
|
-
function e(e) {
|
|
4023
|
-
se.current && !e.composedPath().includes(se.current) && P(null);
|
|
4024
|
-
}
|
|
4025
|
-
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
4026
|
-
}, [ie]), B(() => {
|
|
4088
|
+
}, [A.length]), R(() => {
|
|
4027
4089
|
let e = y.current;
|
|
4028
4090
|
if (!e) return;
|
|
4029
4091
|
if (typeof e.showPopover == "function" && !e.matches(":popover-open")) try {
|
|
@@ -4034,46 +4096,15 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, ident
|
|
|
4034
4096
|
}
|
|
4035
4097
|
return e.addEventListener("toggle", t), () => e.removeEventListener("toggle", t);
|
|
4036
4098
|
}, [f]);
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
let t = y.current;
|
|
4040
|
-
if (!t) return;
|
|
4041
|
-
let n = t.getBoundingClientRect(), r = e.clientX, i = e.clientY, a = n.left, o = n.top, s = n.width, c = n.height, l = e.currentTarget, u = !1;
|
|
4042
|
-
try {
|
|
4043
|
-
l.setPointerCapture(e.pointerId);
|
|
4044
|
-
} catch {}
|
|
4045
|
-
function d(t) {
|
|
4046
|
-
if (t.pointerId !== e.pointerId) return;
|
|
4047
|
-
let n = t.clientX - r, l = t.clientY - i;
|
|
4048
|
-
if (!u) {
|
|
4049
|
-
if (Math.abs(n) + Math.abs(l) < 4) return;
|
|
4050
|
-
u = !0, F(!0);
|
|
4051
|
-
}
|
|
4052
|
-
let d = Math.max(8, window.innerWidth - s - 8), f = Math.max(8, window.innerHeight - c - 8);
|
|
4053
|
-
le({
|
|
4054
|
-
left: Da(a + n, 8, d),
|
|
4055
|
-
top: Da(o + l, 8, f)
|
|
4056
|
-
});
|
|
4057
|
-
}
|
|
4058
|
-
function f(t) {
|
|
4059
|
-
if (t.pointerId === e.pointerId) {
|
|
4060
|
-
try {
|
|
4061
|
-
l.releasePointerCapture(t.pointerId);
|
|
4062
|
-
} catch {}
|
|
4063
|
-
l.removeEventListener("pointermove", d), l.removeEventListener("pointerup", f), l.removeEventListener("pointercancel", f), F(!1);
|
|
4064
|
-
}
|
|
4065
|
-
}
|
|
4066
|
-
l.addEventListener("pointermove", d), l.addEventListener("pointerup", f), l.addEventListener("pointercancel", f);
|
|
4067
|
-
}
|
|
4068
|
-
let me = Se(() => {
|
|
4069
|
-
let t = Tr({
|
|
4099
|
+
let ee = we(() => {
|
|
4100
|
+
let t = Er({
|
|
4070
4101
|
anchorX: e.anchorX,
|
|
4071
4102
|
anchorY: e.anchorY,
|
|
4072
4103
|
anchorSelector: e.anchorSelector
|
|
4073
4104
|
});
|
|
4074
4105
|
return {
|
|
4075
|
-
left:
|
|
4076
|
-
top:
|
|
4106
|
+
left: Pa(t.pageX - window.scrollX + 16, 12, window.innerWidth - 320 - 12),
|
|
4107
|
+
top: Pa(t.pageY - window.scrollY - 16, 12, window.innerHeight - 200)
|
|
4077
4108
|
};
|
|
4078
4109
|
}, [
|
|
4079
4110
|
e.anchorX,
|
|
@@ -4083,11 +4114,11 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, ident
|
|
|
4083
4114
|
return /* @__PURE__ */ $("div", {
|
|
4084
4115
|
ref: y,
|
|
4085
4116
|
id: "markup-thread-popover",
|
|
4086
|
-
class: Q("markup-popover",
|
|
4117
|
+
class: Q("markup-popover", T && "is-floating", O && "is-dragging", l && "is-hud-hidden"),
|
|
4087
4118
|
popover: "auto",
|
|
4088
4119
|
style: {
|
|
4089
|
-
"--markup-pop-x": `${
|
|
4090
|
-
"--markup-pop-y": `${
|
|
4120
|
+
"--markup-pop-x": `${T?.left ?? ee.left}px`,
|
|
4121
|
+
"--markup-pop-y": `${T?.top ?? ee.top}px`
|
|
4091
4122
|
},
|
|
4092
4123
|
role: "dialog",
|
|
4093
4124
|
"aria-label": "Markup thread",
|
|
@@ -4095,45 +4126,55 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, ident
|
|
|
4095
4126
|
children: [
|
|
4096
4127
|
/* @__PURE__ */ $("header", {
|
|
4097
4128
|
class: "markup-popover-header",
|
|
4098
|
-
onPointerDown:
|
|
4129
|
+
onPointerDown: D,
|
|
4099
4130
|
children: [/* @__PURE__ */ $("span", {
|
|
4100
4131
|
class: "markup-eyebrow",
|
|
4101
4132
|
children: [
|
|
4102
4133
|
"thread · ",
|
|
4103
|
-
|
|
4134
|
+
A.length,
|
|
4104
4135
|
" ",
|
|
4105
|
-
|
|
4136
|
+
A.length === 1 ? "comment" : "comments"
|
|
4106
4137
|
]
|
|
4107
4138
|
}), /* @__PURE__ */ $("div", {
|
|
4108
4139
|
class: "markup-popover-header-actions",
|
|
4109
4140
|
children: [
|
|
4110
4141
|
/* @__PURE__ */ $("div", {
|
|
4111
4142
|
class: "markup-thread-menu",
|
|
4112
|
-
ref:
|
|
4143
|
+
ref: (e) => {
|
|
4144
|
+
C.kind === "thread-menu" && (S.current = e);
|
|
4145
|
+
},
|
|
4113
4146
|
children: [/* @__PURE__ */ $("button", {
|
|
4114
4147
|
type: "button",
|
|
4115
|
-
class: Q("markup-icon-btn",
|
|
4148
|
+
class: Q("markup-icon-btn", C.kind === "thread-menu" && "is-open"),
|
|
4116
4149
|
title: "More options",
|
|
4117
|
-
onClick: () =>
|
|
4118
|
-
|
|
4119
|
-
|
|
4150
|
+
onClick: () => {
|
|
4151
|
+
w(C.kind === "thread-menu" ? { kind: "none" } : {
|
|
4152
|
+
kind: "thread-menu",
|
|
4153
|
+
confirmDelete: !1
|
|
4154
|
+
});
|
|
4155
|
+
},
|
|
4156
|
+
children: /* @__PURE__ */ $(fa, { size: 16 })
|
|
4157
|
+
}), C.kind === "thread-menu" ? /* @__PURE__ */ $("div", {
|
|
4120
4158
|
class: "markup-thread-menu-list",
|
|
4121
4159
|
children: [/* @__PURE__ */ $("button", {
|
|
4122
4160
|
type: "button",
|
|
4123
4161
|
class: "markup-thread-menu-item",
|
|
4124
4162
|
onClick: () => {
|
|
4125
4163
|
let t = new URL(e.url);
|
|
4126
|
-
t.hash = `markup-thread=${e._id}`, navigator.clipboard.writeText(t.toString()).catch(() => {}),
|
|
4164
|
+
t.hash = `markup-thread=${e._id}`, navigator.clipboard.writeText(t.toString()).catch(() => {}), w({ kind: "none" });
|
|
4127
4165
|
},
|
|
4128
4166
|
children: "Copy link"
|
|
4129
4167
|
}), o ? /* @__PURE__ */ $("button", {
|
|
4130
4168
|
type: "button",
|
|
4131
|
-
class: Q("markup-thread-menu-item",
|
|
4169
|
+
class: Q("markup-thread-menu-item", C.confirmDelete && "is-danger"),
|
|
4132
4170
|
disabled: s,
|
|
4133
4171
|
onClick: () => {
|
|
4134
|
-
|
|
4172
|
+
C.kind === "thread-menu" && (C.confirmDelete ? (w({ kind: "none" }), v()) : w({
|
|
4173
|
+
...C,
|
|
4174
|
+
confirmDelete: !0
|
|
4175
|
+
}));
|
|
4135
4176
|
},
|
|
4136
|
-
children:
|
|
4177
|
+
children: C.confirmDelete ? "Confirm delete" : "Delete thread…"
|
|
4137
4178
|
}) : null]
|
|
4138
4179
|
}) : null]
|
|
4139
4180
|
}),
|
|
@@ -4143,23 +4184,23 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, ident
|
|
|
4143
4184
|
title: "Mark as resolved",
|
|
4144
4185
|
disabled: s,
|
|
4145
4186
|
onClick: _,
|
|
4146
|
-
children: /* @__PURE__ */ $(
|
|
4187
|
+
children: /* @__PURE__ */ $(pa, { size: 16 })
|
|
4147
4188
|
}) : null,
|
|
4148
4189
|
/* @__PURE__ */ $("button", {
|
|
4149
4190
|
type: "button",
|
|
4150
4191
|
class: "markup-icon-btn",
|
|
4151
4192
|
title: "Close thread",
|
|
4152
4193
|
onClick: f,
|
|
4153
|
-
children: /* @__PURE__ */ $(
|
|
4194
|
+
children: /* @__PURE__ */ $(da, { size: 16 })
|
|
4154
4195
|
})
|
|
4155
4196
|
]
|
|
4156
4197
|
})]
|
|
4157
4198
|
}),
|
|
4158
4199
|
/* @__PURE__ */ $("ol", {
|
|
4159
|
-
ref:
|
|
4200
|
+
ref: b,
|
|
4160
4201
|
class: "markup-comments",
|
|
4161
|
-
children:
|
|
4162
|
-
let i = !t.fromDashboard && n != null && t.authorClientId === n, a = r === 0, o = i && !
|
|
4202
|
+
children: A.map((t, r) => {
|
|
4203
|
+
let i = !t.fromDashboard && n != null && t.authorClientId === n, a = r === 0, o = i && !k && !t.deleted, c = i && !k && !t.deleted && !a, l = C.kind === "editing" && C.commentId === t._id, u = (o || c) && !l && !t.deleted, d = C.kind === "comment-menu" && C.commentId === t._id, f = d && C.confirmDelete, p = C.kind === "reaction-picker" && C.commentId === t._id, _ = p ? C.direction : "down", v = d ? C.direction : "down";
|
|
4163
4204
|
return /* @__PURE__ */ $("li", {
|
|
4164
4205
|
class: Q("markup-comment", t.fromDashboard && "is-team"),
|
|
4165
4206
|
children: [
|
|
@@ -4177,61 +4218,77 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, ident
|
|
|
4177
4218
|
/* @__PURE__ */ $("time", {
|
|
4178
4219
|
class: "markup-comment-time",
|
|
4179
4220
|
datetime: new Date(t.createdAt).toISOString(),
|
|
4180
|
-
title:
|
|
4181
|
-
children:
|
|
4221
|
+
title: Ia(t.createdAt),
|
|
4222
|
+
children: Fa(t.createdAt)
|
|
4182
4223
|
}),
|
|
4183
4224
|
/* @__PURE__ */ $("div", {
|
|
4184
4225
|
class: "markup-thread-actions",
|
|
4185
|
-
children: [!
|
|
4226
|
+
children: [!k && !l ? /* @__PURE__ */ $(ja, {
|
|
4186
4227
|
comment: t,
|
|
4187
|
-
pickerOpen:
|
|
4188
|
-
pickerDirection:
|
|
4228
|
+
pickerOpen: p,
|
|
4229
|
+
pickerDirection: _,
|
|
4189
4230
|
pickerRef: (e) => {
|
|
4190
|
-
|
|
4231
|
+
p && (S.current = e);
|
|
4191
4232
|
},
|
|
4192
4233
|
onPickerClick: (e) => {
|
|
4193
|
-
if (
|
|
4194
|
-
|
|
4234
|
+
if (p) {
|
|
4235
|
+
w({ kind: "none" });
|
|
4195
4236
|
return;
|
|
4196
4237
|
}
|
|
4197
|
-
let n = e.currentTarget.getBoundingClientRect(), r =
|
|
4198
|
-
|
|
4238
|
+
let n = e.currentTarget.getBoundingClientRect(), r = b.current?.getBoundingClientRect(), i = r ? r.bottom - n.bottom : Infinity;
|
|
4239
|
+
w({
|
|
4240
|
+
kind: "reaction-picker",
|
|
4241
|
+
commentId: t._id,
|
|
4242
|
+
direction: i < 44 ? "up" : "down"
|
|
4243
|
+
});
|
|
4199
4244
|
},
|
|
4200
4245
|
onPickerSelect: (e) => {
|
|
4201
|
-
|
|
4246
|
+
w({ kind: "none" }), g(t._id, e);
|
|
4202
4247
|
}
|
|
4203
4248
|
}) : null, u ? /* @__PURE__ */ $("div", {
|
|
4204
|
-
class: Q("markup-thread-menu markup-comment-menu", d && "is-open", d &&
|
|
4249
|
+
class: Q("markup-thread-menu markup-comment-menu", d && "is-open", d && v === "up" && "is-up"),
|
|
4205
4250
|
ref: (e) => {
|
|
4206
|
-
d && (
|
|
4251
|
+
d && (S.current = e);
|
|
4207
4252
|
},
|
|
4208
4253
|
children: [/* @__PURE__ */ $("button", {
|
|
4209
4254
|
type: "button",
|
|
4210
4255
|
class: Q("markup-icon-btn", d && "is-open"),
|
|
4211
4256
|
title: "More options",
|
|
4212
4257
|
onClick: (e) => {
|
|
4213
|
-
if (
|
|
4214
|
-
|
|
4258
|
+
if (d) {
|
|
4259
|
+
w({ kind: "none" });
|
|
4215
4260
|
return;
|
|
4216
4261
|
}
|
|
4217
|
-
let n = e.currentTarget.getBoundingClientRect(), r =
|
|
4218
|
-
|
|
4262
|
+
let n = e.currentTarget.getBoundingClientRect(), r = b.current?.getBoundingClientRect(), i = (+!!o + +!!c) * 32 + 8 + 6, a = r ? r.bottom - n.bottom : Infinity;
|
|
4263
|
+
w({
|
|
4264
|
+
kind: "comment-menu",
|
|
4265
|
+
commentId: t._id,
|
|
4266
|
+
direction: a < i ? "up" : "down",
|
|
4267
|
+
confirmDelete: !1
|
|
4268
|
+
});
|
|
4219
4269
|
},
|
|
4220
|
-
children: /* @__PURE__ */ $(
|
|
4270
|
+
children: /* @__PURE__ */ $(fa, { size: 16 })
|
|
4221
4271
|
}), d ? /* @__PURE__ */ $("div", {
|
|
4222
4272
|
class: "markup-thread-menu-list",
|
|
4223
4273
|
children: [o ? /* @__PURE__ */ $("button", {
|
|
4224
4274
|
type: "button",
|
|
4225
4275
|
class: "markup-thread-menu-item",
|
|
4226
4276
|
onClick: () => {
|
|
4227
|
-
|
|
4277
|
+
w({
|
|
4278
|
+
kind: "editing",
|
|
4279
|
+
commentId: t._id,
|
|
4280
|
+
draft: t.body
|
|
4281
|
+
});
|
|
4228
4282
|
},
|
|
4229
4283
|
children: "Edit"
|
|
4230
4284
|
}) : null, c ? /* @__PURE__ */ $("button", {
|
|
4231
4285
|
type: "button",
|
|
4232
4286
|
class: Q("markup-thread-menu-item", f && "is-danger"),
|
|
4233
4287
|
onClick: () => {
|
|
4234
|
-
|
|
4288
|
+
C.kind === "comment-menu" && (C.confirmDelete ? (w({ kind: "none" }), h(t._id)) : w({
|
|
4289
|
+
...C,
|
|
4290
|
+
confirmDelete: !0
|
|
4291
|
+
}));
|
|
4235
4292
|
},
|
|
4236
4293
|
children: f ? "Confirm delete" : "Delete…"
|
|
4237
4294
|
}) : null]
|
|
@@ -4240,23 +4297,29 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, ident
|
|
|
4240
4297
|
})
|
|
4241
4298
|
]
|
|
4242
4299
|
}),
|
|
4243
|
-
l ? /* @__PURE__ */ $("form", {
|
|
4300
|
+
l && C.kind === "editing" ? /* @__PURE__ */ $("form", {
|
|
4244
4301
|
class: "markup-comment-edit-form",
|
|
4245
4302
|
onSubmit: async (e) => {
|
|
4246
|
-
e.preventDefault();
|
|
4247
|
-
let n =
|
|
4303
|
+
if (e.preventDefault(), C.kind !== "editing") return;
|
|
4304
|
+
let n = C.draft.trim();
|
|
4248
4305
|
if (!n || n === t.body) {
|
|
4249
|
-
|
|
4306
|
+
w({ kind: "none" });
|
|
4250
4307
|
return;
|
|
4251
4308
|
}
|
|
4252
4309
|
try {
|
|
4253
|
-
await m(t._id, n),
|
|
4310
|
+
await m(t._id, n), w({ kind: "none" });
|
|
4254
4311
|
} catch {}
|
|
4255
4312
|
},
|
|
4256
4313
|
children: [/* @__PURE__ */ $("textarea", {
|
|
4257
4314
|
class: "markup-textarea",
|
|
4258
|
-
value:
|
|
4259
|
-
onInput: (e) =>
|
|
4315
|
+
value: C.draft,
|
|
4316
|
+
onInput: (e) => {
|
|
4317
|
+
let t = e.currentTarget.value;
|
|
4318
|
+
w((e) => e.kind === "editing" ? {
|
|
4319
|
+
...e,
|
|
4320
|
+
draft: t
|
|
4321
|
+
} : e);
|
|
4322
|
+
},
|
|
4260
4323
|
rows: 3,
|
|
4261
4324
|
autoFocus: !0,
|
|
4262
4325
|
disabled: s
|
|
@@ -4265,13 +4328,13 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, ident
|
|
|
4265
4328
|
children: [/* @__PURE__ */ $("button", {
|
|
4266
4329
|
type: "button",
|
|
4267
4330
|
class: "markup-btn markup-btn-ghost",
|
|
4268
|
-
onClick:
|
|
4331
|
+
onClick: () => w({ kind: "none" }),
|
|
4269
4332
|
disabled: s,
|
|
4270
4333
|
children: "Cancel"
|
|
4271
4334
|
}), /* @__PURE__ */ $("button", {
|
|
4272
4335
|
type: "submit",
|
|
4273
4336
|
class: "markup-btn markup-btn-primary",
|
|
4274
|
-
disabled: s ||
|
|
4337
|
+
disabled: s || C.draft.trim().length === 0,
|
|
4275
4338
|
children: "Save"
|
|
4276
4339
|
})]
|
|
4277
4340
|
})]
|
|
@@ -4280,19 +4343,19 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, ident
|
|
|
4280
4343
|
children: [t.body, t.editedAt == null ? null : /* @__PURE__ */ $("time", {
|
|
4281
4344
|
class: "markup-comment-edited",
|
|
4282
4345
|
datetime: new Date(t.editedAt).toISOString(),
|
|
4283
|
-
title:
|
|
4346
|
+
title: Ia(t.editedAt),
|
|
4284
4347
|
children: [" ", "(edited)"]
|
|
4285
4348
|
})]
|
|
4286
4349
|
}),
|
|
4287
|
-
!l && t.reactions.length > 0 ? /* @__PURE__ */ $(
|
|
4350
|
+
!l && t.reactions.length > 0 ? /* @__PURE__ */ $(Ma, {
|
|
4288
4351
|
comment: t,
|
|
4289
|
-
isResolved:
|
|
4352
|
+
isResolved: k,
|
|
4290
4353
|
onToggle: (e) => g(t._id, e)
|
|
4291
4354
|
}) : null,
|
|
4292
4355
|
r === 0 && e.screenshotUrl ? /* @__PURE__ */ $("button", {
|
|
4293
4356
|
type: "button",
|
|
4294
4357
|
class: "markup-comment-screenshot",
|
|
4295
|
-
onClick: () =>
|
|
4358
|
+
onClick: () => x.current?.showModal(),
|
|
4296
4359
|
children: /* @__PURE__ */ $("img", {
|
|
4297
4360
|
src: e.screenshotUrl,
|
|
4298
4361
|
alt: "Screenshot"
|
|
@@ -4303,17 +4366,17 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, ident
|
|
|
4303
4366
|
})
|
|
4304
4367
|
}),
|
|
4305
4368
|
e.screenshotUrl ? /* @__PURE__ */ $("dialog", {
|
|
4306
|
-
ref:
|
|
4369
|
+
ref: x,
|
|
4307
4370
|
class: "markup-lightbox",
|
|
4308
|
-
onClick: () =>
|
|
4371
|
+
onClick: () => x.current?.close(),
|
|
4309
4372
|
children: [/* @__PURE__ */ $("button", {
|
|
4310
4373
|
type: "button",
|
|
4311
4374
|
class: "markup-lightbox-close markup-icon-btn",
|
|
4312
4375
|
"aria-label": "Close screenshot",
|
|
4313
4376
|
onClick: (e) => {
|
|
4314
|
-
e.stopPropagation(),
|
|
4377
|
+
e.stopPropagation(), x.current?.close();
|
|
4315
4378
|
},
|
|
4316
|
-
children: /* @__PURE__ */ $(
|
|
4379
|
+
children: /* @__PURE__ */ $(da, { size: 16 })
|
|
4317
4380
|
}), /* @__PURE__ */ $("img", {
|
|
4318
4381
|
class: "markup-lightbox-img",
|
|
4319
4382
|
src: e.screenshotUrl,
|
|
@@ -4321,7 +4384,7 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, ident
|
|
|
4321
4384
|
onClick: (e) => e.stopPropagation()
|
|
4322
4385
|
})]
|
|
4323
4386
|
}) : null,
|
|
4324
|
-
t == null ? /* @__PURE__ */ $(
|
|
4387
|
+
t == null ? /* @__PURE__ */ $(xa, {
|
|
4325
4388
|
pending: s,
|
|
4326
4389
|
connecting: i,
|
|
4327
4390
|
signingIn: a,
|
|
@@ -4343,7 +4406,7 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, ident
|
|
|
4343
4406
|
children: "team"
|
|
4344
4407
|
}) : null
|
|
4345
4408
|
]
|
|
4346
|
-
}), /* @__PURE__ */ $(
|
|
4409
|
+
}), /* @__PURE__ */ $(Ca, {
|
|
4347
4410
|
label: "Reply",
|
|
4348
4411
|
placeholder: "Write a reply…",
|
|
4349
4412
|
submitLabel: "Reply",
|
|
@@ -4356,7 +4419,7 @@ function Ca({ thread: e, authorName: t, currentClientId: n, isVerified: r, ident
|
|
|
4356
4419
|
]
|
|
4357
4420
|
});
|
|
4358
4421
|
}
|
|
4359
|
-
function
|
|
4422
|
+
function ja({ comment: e, pickerOpen: t, pickerDirection: n, pickerRef: r, onPickerClick: i, onPickerSelect: a }) {
|
|
4360
4423
|
return /* @__PURE__ */ $("div", {
|
|
4361
4424
|
class: Q("markup-reaction-picker-wrap", t && "is-open", t && n === "up" && "is-up"),
|
|
4362
4425
|
ref: r,
|
|
@@ -4366,11 +4429,11 @@ function wa({ comment: e, pickerOpen: t, pickerDirection: n, pickerRef: r, onPic
|
|
|
4366
4429
|
title: "Add reaction",
|
|
4367
4430
|
"aria-label": "Add reaction",
|
|
4368
4431
|
onClick: i,
|
|
4369
|
-
children: /* @__PURE__ */ $(
|
|
4432
|
+
children: /* @__PURE__ */ $(ga, { size: 16 })
|
|
4370
4433
|
}), t ? /* @__PURE__ */ $("div", {
|
|
4371
4434
|
class: "markup-reaction-picker",
|
|
4372
4435
|
role: "menu",
|
|
4373
|
-
children:
|
|
4436
|
+
children: ka.map((t) => /* @__PURE__ */ $("button", {
|
|
4374
4437
|
type: "button",
|
|
4375
4438
|
role: "menuitem",
|
|
4376
4439
|
class: Q("markup-reaction-picker-item", (e.reactions.find((e) => e.emoji === t)?.mine ?? !1) && "is-mine"),
|
|
@@ -4380,11 +4443,11 @@ function wa({ comment: e, pickerOpen: t, pickerDirection: n, pickerRef: r, onPic
|
|
|
4380
4443
|
}) : null]
|
|
4381
4444
|
});
|
|
4382
4445
|
}
|
|
4383
|
-
function
|
|
4446
|
+
function Ma({ comment: e, isResolved: t, onToggle: n }) {
|
|
4384
4447
|
return /* @__PURE__ */ $("div", {
|
|
4385
4448
|
class: "markup-reactions",
|
|
4386
4449
|
children: e.reactions.map((e) => {
|
|
4387
|
-
let r =
|
|
4450
|
+
let r = Na(e.reactors, e.mine, e.count, e.emoji);
|
|
4388
4451
|
return /* @__PURE__ */ $("button", {
|
|
4389
4452
|
type: "button",
|
|
4390
4453
|
class: Q("markup-reaction-chip", e.mine && "is-mine"),
|
|
@@ -4405,14 +4468,14 @@ function Ta({ comment: e, isResolved: t, onToggle: n }) {
|
|
|
4405
4468
|
})
|
|
4406
4469
|
});
|
|
4407
4470
|
}
|
|
4408
|
-
function
|
|
4471
|
+
function Na(e, t, n, r) {
|
|
4409
4472
|
let i = e.slice(), a = i.length + +!!t, o = Math.max(0, n - a);
|
|
4410
4473
|
return o > 0 && i.push(`${o} other${o === 1 ? "" : "s"}`), t && i.push("you"), i.length === 0 ? `${n} reacted with ${r}` : `${i.length === 1 ? i[0] : `${i.slice(0, -1).join(", ")} and ${i[i.length - 1]}`} reacted with ${r}`;
|
|
4411
4474
|
}
|
|
4412
|
-
function
|
|
4475
|
+
function Pa(e, t, n) {
|
|
4413
4476
|
return Math.max(t, Math.min(n, e));
|
|
4414
4477
|
}
|
|
4415
|
-
function
|
|
4478
|
+
function Fa(e) {
|
|
4416
4479
|
let t = Date.now() - e, n = Math.floor(t / 1e3);
|
|
4417
4480
|
if (n < 60) return "just now";
|
|
4418
4481
|
let r = Math.floor(n / 60);
|
|
@@ -4429,7 +4492,7 @@ function Oa(e) {
|
|
|
4429
4492
|
year: "numeric"
|
|
4430
4493
|
});
|
|
4431
4494
|
}
|
|
4432
|
-
function
|
|
4495
|
+
function Ia(e) {
|
|
4433
4496
|
return new Date(e).toLocaleDateString([], {
|
|
4434
4497
|
month: "long",
|
|
4435
4498
|
day: "numeric",
|
|
@@ -4440,77 +4503,81 @@ function ka(e) {
|
|
|
4440
4503
|
}
|
|
4441
4504
|
//#endregion
|
|
4442
4505
|
//#region src/runtime/ui/app.tsx
|
|
4443
|
-
function
|
|
4444
|
-
return {
|
|
4506
|
+
function La(e) {
|
|
4507
|
+
return !e.token || e.tokenExpiresAt == null ? null : {
|
|
4445
4508
|
clientId: `markup_user_${e.identity.id}`,
|
|
4509
|
+
token: e.token,
|
|
4510
|
+
tokenExpiresAt: e.tokenExpiresAt,
|
|
4446
4511
|
name: e.identity.name,
|
|
4447
|
-
email: e.identity.email
|
|
4448
|
-
isVerified: !0,
|
|
4449
|
-
token: e.token ?? void 0,
|
|
4450
|
-
tokenExpiresAt: e.tokenExpiresAt ?? void 0
|
|
4512
|
+
email: e.identity.email
|
|
4451
4513
|
};
|
|
4452
4514
|
}
|
|
4453
|
-
function
|
|
4454
|
-
let [r, i] =
|
|
4515
|
+
function Ra({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
|
|
4516
|
+
let [r, i] = L(() => window.location.pathname), [a, o] = L([]), [s, c] = L({ kind: "unresolved" }), [l, u] = L(n), d = z(s);
|
|
4455
4517
|
d.current = s;
|
|
4456
|
-
let [f, p] =
|
|
4518
|
+
let [f, p] = L(0), m = we(() => kr({
|
|
4457
4519
|
apiUrl: e,
|
|
4458
4520
|
apiKey: t,
|
|
4459
4521
|
getToken: () => {
|
|
4460
4522
|
let e = d.current;
|
|
4461
|
-
return e
|
|
4462
|
-
token: e.token,
|
|
4463
|
-
expiresAt: e.tokenExpiresAt
|
|
4523
|
+
return e.kind === "verified" ? {
|
|
4524
|
+
token: e.identity.token,
|
|
4525
|
+
expiresAt: e.identity.tokenExpiresAt
|
|
4464
4526
|
} : null;
|
|
4465
4527
|
},
|
|
4466
4528
|
getAnonToken: () => {
|
|
4467
4529
|
let e = d.current;
|
|
4468
|
-
return e
|
|
4530
|
+
return e.kind === "anon" ? e.identity.anonToken : null;
|
|
4469
4531
|
},
|
|
4470
4532
|
onUnauthorized: () => {
|
|
4471
4533
|
let e = d.current;
|
|
4472
|
-
if (
|
|
4534
|
+
if (e.kind !== "verified") return;
|
|
4473
4535
|
let t = {
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4536
|
+
kind: "recovering",
|
|
4537
|
+
preserved: {
|
|
4538
|
+
name: e.identity.name,
|
|
4539
|
+
email: e.identity.email
|
|
4540
|
+
}
|
|
4477
4541
|
};
|
|
4478
|
-
d.current = t, c(t),
|
|
4542
|
+
d.current = t, c(t), Fr(t), p((e) => e + 1);
|
|
4479
4543
|
}
|
|
4480
|
-
}), [e, t]), [h, g] =
|
|
4481
|
-
|
|
4482
|
-
let e =
|
|
4483
|
-
if (e
|
|
4544
|
+
}), [e, t]), [h, g] = L({ kind: "idle" }), [_, v] = L(!1), [y, b] = L(null), [x, S] = L(!1), [C, w] = L(!1), [, T] = L(0), E = z(null), D = Lr(s), O = s.kind === "verified", k = s.kind === "unresolved" || s.kind === "recovering", A = Ir(s);
|
|
4545
|
+
R(() => {
|
|
4546
|
+
let { state: e, preserved: t } = Pr();
|
|
4547
|
+
if (e.kind === "anon" || e.kind === "verified") {
|
|
4484
4548
|
c(e);
|
|
4485
4549
|
return;
|
|
4486
4550
|
}
|
|
4487
|
-
let
|
|
4488
|
-
function
|
|
4489
|
-
m.mintAnonIdentity().then(({ clientId:
|
|
4490
|
-
if (
|
|
4551
|
+
let n = !1, r = null, i = 1e3;
|
|
4552
|
+
function a() {
|
|
4553
|
+
m.mintAnonIdentity().then(({ clientId: e, token: r }) => {
|
|
4554
|
+
if (n) return;
|
|
4491
4555
|
let i = {
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4556
|
+
kind: "anon",
|
|
4557
|
+
identity: {
|
|
4558
|
+
clientId: e,
|
|
4559
|
+
anonToken: r,
|
|
4560
|
+
name: t.name,
|
|
4561
|
+
email: t.email
|
|
4562
|
+
}
|
|
4496
4563
|
};
|
|
4497
|
-
|
|
4564
|
+
Fr(i), c(i);
|
|
4498
4565
|
}).catch(() => {
|
|
4499
|
-
|
|
4566
|
+
n || (r = setTimeout(a, Math.min(i, 3e4)), i = Math.min(i * 2, 3e4));
|
|
4500
4567
|
});
|
|
4501
4568
|
}
|
|
4502
|
-
return
|
|
4503
|
-
|
|
4569
|
+
return a(), () => {
|
|
4570
|
+
n = !0, r && clearTimeout(r);
|
|
4504
4571
|
};
|
|
4505
4572
|
}, [m, f]);
|
|
4506
|
-
let [
|
|
4507
|
-
|
|
4573
|
+
let [j, ee] = L(null);
|
|
4574
|
+
R(() => {
|
|
4508
4575
|
let e = !1, t = null;
|
|
4509
4576
|
async function n() {
|
|
4510
4577
|
try {
|
|
4511
4578
|
let r = await m.getSubscriptionToken();
|
|
4512
4579
|
if (e) return;
|
|
4513
|
-
|
|
4580
|
+
ee(r.token);
|
|
4514
4581
|
let i = Math.max(6e4, r.expiresAt - Date.now() - 30 * 6e4);
|
|
4515
4582
|
t = setTimeout(n, i);
|
|
4516
4583
|
} catch {
|
|
@@ -4522,29 +4589,29 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
|
|
|
4522
4589
|
e = !0, t && clearTimeout(t);
|
|
4523
4590
|
};
|
|
4524
4591
|
}, [m]);
|
|
4525
|
-
let [
|
|
4526
|
-
|
|
4527
|
-
let t = new
|
|
4528
|
-
return
|
|
4529
|
-
t.close(),
|
|
4592
|
+
let [M, te] = L(null);
|
|
4593
|
+
R(() => {
|
|
4594
|
+
let t = new ir(e.replace(/\.convex\.site(\/.*)?$/, ".convex.cloud"));
|
|
4595
|
+
return te(t), () => {
|
|
4596
|
+
t.close(), te((e) => e === t ? null : e);
|
|
4530
4597
|
};
|
|
4531
4598
|
}, [e]);
|
|
4532
|
-
let
|
|
4533
|
-
|
|
4534
|
-
if (!(!
|
|
4535
|
-
subscriptionToken:
|
|
4599
|
+
let ne = z(!1);
|
|
4600
|
+
R(() => {
|
|
4601
|
+
if (!(!M || !j)) return b(null), M.onUpdate(Jt("widget/queries:subscribeThreadsForRoute"), {
|
|
4602
|
+
subscriptionToken: j,
|
|
4536
4603
|
route: r,
|
|
4537
|
-
viewerClientId:
|
|
4604
|
+
viewerClientId: A
|
|
4538
4605
|
}, (e) => {
|
|
4539
4606
|
e !== void 0 && o(e);
|
|
4540
4607
|
});
|
|
4541
4608
|
}, [
|
|
4609
|
+
M,
|
|
4542
4610
|
j,
|
|
4543
|
-
k,
|
|
4544
4611
|
r,
|
|
4545
|
-
|
|
4546
|
-
]),
|
|
4547
|
-
if (
|
|
4612
|
+
A
|
|
4613
|
+
]), R(() => {
|
|
4614
|
+
if (ne.current) return;
|
|
4548
4615
|
let e = window.location.hash.match(/^#markup-thread=(.+)$/);
|
|
4549
4616
|
if (e) {
|
|
4550
4617
|
let t = decodeURIComponent(e[1] ?? "");
|
|
@@ -4553,8 +4620,8 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
|
|
|
4553
4620
|
threadId: t
|
|
4554
4621
|
}), history.replaceState(null, "", window.location.pathname + window.location.search);
|
|
4555
4622
|
}
|
|
4556
|
-
|
|
4557
|
-
}, [a]),
|
|
4623
|
+
ne.current = !0;
|
|
4624
|
+
}, [a]), R(() => {
|
|
4558
4625
|
let e = !0;
|
|
4559
4626
|
function t() {
|
|
4560
4627
|
e && i(window.location.pathname);
|
|
@@ -4568,12 +4635,12 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
|
|
|
4568
4635
|
}, () => {
|
|
4569
4636
|
e = !1, window.removeEventListener("popstate", t);
|
|
4570
4637
|
};
|
|
4571
|
-
}, []),
|
|
4638
|
+
}, []), R(() => {
|
|
4572
4639
|
function e(e) {
|
|
4573
4640
|
e.key === "." && (e.metaKey || e.ctrlKey) && (e.altKey || e.shiftKey || (e.preventDefault(), S((e) => !e)));
|
|
4574
4641
|
}
|
|
4575
4642
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
4576
|
-
}, []),
|
|
4643
|
+
}, []), R(() => {
|
|
4577
4644
|
if (!C) return;
|
|
4578
4645
|
if (!x) {
|
|
4579
4646
|
w(!1);
|
|
@@ -4581,7 +4648,7 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
|
|
|
4581
4648
|
}
|
|
4582
4649
|
let e = window.setTimeout(() => w(!1), 5e3);
|
|
4583
4650
|
return () => window.clearTimeout(e);
|
|
4584
|
-
}, [C, x]),
|
|
4651
|
+
}, [C, x]), R(() => {
|
|
4585
4652
|
let e = null;
|
|
4586
4653
|
function t() {
|
|
4587
4654
|
e ??= requestAnimationFrame(() => {
|
|
@@ -4594,12 +4661,12 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
|
|
|
4594
4661
|
window.removeEventListener("scroll", t), window.removeEventListener("resize", t), n.disconnect(), e != null && cancelAnimationFrame(e);
|
|
4595
4662
|
};
|
|
4596
4663
|
}, []);
|
|
4597
|
-
let
|
|
4664
|
+
let re = B(() => {
|
|
4598
4665
|
b(null), g({ kind: "placing" });
|
|
4599
|
-
}, []), N =
|
|
4666
|
+
}, []), N = B(() => {
|
|
4600
4667
|
g({ kind: "idle" }), b(null);
|
|
4601
|
-
}, []),
|
|
4602
|
-
let r = t + window.scrollX, i = n + window.scrollY, a = ++
|
|
4668
|
+
}, []), ie = z(0), ae = B((e, t, n) => {
|
|
4669
|
+
let r = t + window.scrollX, i = n + window.scrollY, a = ++ie.current;
|
|
4603
4670
|
g({
|
|
4604
4671
|
kind: "composing-new",
|
|
4605
4672
|
coords: e,
|
|
@@ -4608,7 +4675,7 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
|
|
|
4608
4675
|
screenshot: null,
|
|
4609
4676
|
screenshotCapturing: !0,
|
|
4610
4677
|
captureToken: a
|
|
4611
|
-
}),
|
|
4678
|
+
}), ia(E.current != null && E.current.getRootNode() instanceof ShadowRoot ? E.current.getRootNode().host : null, {
|
|
4612
4679
|
x: t,
|
|
4613
4680
|
y: n
|
|
4614
4681
|
}).then((e) => {
|
|
@@ -4618,35 +4685,45 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
|
|
|
4618
4685
|
screenshotCapturing: !1
|
|
4619
4686
|
});
|
|
4620
4687
|
});
|
|
4621
|
-
}, []),
|
|
4622
|
-
if (
|
|
4688
|
+
}, []), oe = B((e, t) => {
|
|
4689
|
+
if (s.kind !== "anon") return;
|
|
4623
4690
|
let n = {
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4691
|
+
kind: "anon",
|
|
4692
|
+
identity: {
|
|
4693
|
+
...s.identity,
|
|
4694
|
+
name: e,
|
|
4695
|
+
email: t
|
|
4696
|
+
}
|
|
4627
4697
|
};
|
|
4628
|
-
|
|
4629
|
-
}, [s]), [
|
|
4630
|
-
if (!
|
|
4631
|
-
b(null),
|
|
4698
|
+
Fr(n), c(n);
|
|
4699
|
+
}, [s]), [se, ce] = L(!1), le = B(async () => {
|
|
4700
|
+
if (!se) {
|
|
4701
|
+
b(null), ce(!0);
|
|
4632
4702
|
try {
|
|
4633
|
-
let n =
|
|
4634
|
-
|
|
4703
|
+
let n = La(await zr(e, t));
|
|
4704
|
+
if (!n) throw Error("Sign-in did not return a verified token");
|
|
4705
|
+
let r = {
|
|
4706
|
+
kind: "verified",
|
|
4707
|
+
identity: n
|
|
4708
|
+
};
|
|
4709
|
+
Fr(r), c(r);
|
|
4635
4710
|
} catch (e) {
|
|
4636
4711
|
b(e instanceof Error ? e.message : "Sign-in failed");
|
|
4637
4712
|
} finally {
|
|
4638
|
-
|
|
4713
|
+
ce(!1);
|
|
4639
4714
|
}
|
|
4640
4715
|
}
|
|
4641
4716
|
}, [
|
|
4642
4717
|
e,
|
|
4643
4718
|
t,
|
|
4644
|
-
|
|
4645
|
-
]),
|
|
4646
|
-
if (
|
|
4719
|
+
se
|
|
4720
|
+
]), ue = B(async (e, t) => {
|
|
4721
|
+
if (h.kind !== "composing-new") return;
|
|
4722
|
+
let n = Rr(s);
|
|
4723
|
+
if (n) {
|
|
4647
4724
|
v(!0), b(null);
|
|
4648
4725
|
try {
|
|
4649
|
-
let
|
|
4726
|
+
let i;
|
|
4650
4727
|
if (t && h.screenshot) {
|
|
4651
4728
|
let { uploadUrl: e } = await m.getScreenshotUploadUrl(), t = await fetch(e, {
|
|
4652
4729
|
method: "POST",
|
|
@@ -4654,10 +4731,10 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
|
|
|
4654
4731
|
body: h.screenshot
|
|
4655
4732
|
});
|
|
4656
4733
|
if (!t.ok) throw Error(`Screenshot upload failed (${t.status})`);
|
|
4657
|
-
let { storageId:
|
|
4658
|
-
|
|
4734
|
+
let { storageId: n } = await t.json();
|
|
4735
|
+
i = n;
|
|
4659
4736
|
}
|
|
4660
|
-
let
|
|
4737
|
+
let a = await m.createThread({
|
|
4661
4738
|
url: window.location.href,
|
|
4662
4739
|
route: r,
|
|
4663
4740
|
anchorSelector: h.coords.anchorSelector,
|
|
@@ -4668,14 +4745,14 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
|
|
|
4668
4745
|
viewportW: h.coords.viewportW,
|
|
4669
4746
|
viewportY: h.coords.viewportY,
|
|
4670
4747
|
userAgent: navigator.userAgent,
|
|
4671
|
-
authorName:
|
|
4672
|
-
authorEmail:
|
|
4748
|
+
authorName: n.name,
|
|
4749
|
+
authorEmail: n.email,
|
|
4673
4750
|
body: e,
|
|
4674
|
-
screenshotStorageId:
|
|
4751
|
+
screenshotStorageId: i
|
|
4675
4752
|
});
|
|
4676
|
-
o((e) => [...e,
|
|
4753
|
+
o((e) => [...e, a.thread]), g({
|
|
4677
4754
|
kind: "thread",
|
|
4678
|
-
threadId:
|
|
4755
|
+
threadId: a.thread._id
|
|
4679
4756
|
});
|
|
4680
4757
|
} catch (e) {
|
|
4681
4758
|
b(e instanceof Error ? e.message : "Failed to post");
|
|
@@ -4688,7 +4765,7 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
|
|
|
4688
4765
|
s,
|
|
4689
4766
|
h,
|
|
4690
4767
|
r
|
|
4691
|
-
]),
|
|
4768
|
+
]), de = B(async () => {
|
|
4692
4769
|
if (h.kind !== "thread") return;
|
|
4693
4770
|
let e = h.threadId;
|
|
4694
4771
|
v(!0), b(null);
|
|
@@ -4699,12 +4776,12 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
|
|
|
4699
4776
|
} finally {
|
|
4700
4777
|
v(!1);
|
|
4701
4778
|
}
|
|
4702
|
-
}, [m, h]),
|
|
4779
|
+
}, [m, h]), fe = B(async () => {
|
|
4703
4780
|
if (h.kind !== "thread") return;
|
|
4704
4781
|
let e = h.threadId;
|
|
4705
4782
|
v(!0), b(null);
|
|
4706
4783
|
try {
|
|
4707
|
-
await m.resolveThread(e,
|
|
4784
|
+
await m.resolveThread(e, A), o((t) => t.filter((t) => t._id !== e)), g({ kind: "idle" });
|
|
4708
4785
|
} catch (e) {
|
|
4709
4786
|
b(e instanceof Error ? e.message : "Failed to resolve");
|
|
4710
4787
|
} finally {
|
|
@@ -4713,18 +4790,20 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
|
|
|
4713
4790
|
}, [
|
|
4714
4791
|
m,
|
|
4715
4792
|
h,
|
|
4716
|
-
|
|
4717
|
-
]),
|
|
4718
|
-
if (h.kind !== "thread"
|
|
4719
|
-
let t =
|
|
4793
|
+
A
|
|
4794
|
+
]), P = B(async (e) => {
|
|
4795
|
+
if (h.kind !== "thread") return;
|
|
4796
|
+
let t = Rr(s);
|
|
4797
|
+
if (!t) return;
|
|
4798
|
+
let n = h.threadId;
|
|
4720
4799
|
v(!0), b(null);
|
|
4721
4800
|
try {
|
|
4722
|
-
let
|
|
4801
|
+
let r = await m.addComment(n, {
|
|
4723
4802
|
body: e,
|
|
4724
|
-
authorName:
|
|
4725
|
-
authorEmail:
|
|
4803
|
+
authorName: t.name,
|
|
4804
|
+
authorEmail: t.email
|
|
4726
4805
|
});
|
|
4727
|
-
o((e) => e.map((e) => e._id ===
|
|
4806
|
+
o((e) => e.map((e) => e._id === n ? r.thread : e));
|
|
4728
4807
|
} catch (e) {
|
|
4729
4808
|
b(e instanceof Error ? e.message : "Failed to reply");
|
|
4730
4809
|
} finally {
|
|
@@ -4734,8 +4813,8 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
|
|
|
4734
4813
|
m,
|
|
4735
4814
|
s,
|
|
4736
4815
|
h
|
|
4737
|
-
]),
|
|
4738
|
-
if (h.kind !== "thread" ||
|
|
4816
|
+
]), pe = B(async (e, t) => {
|
|
4817
|
+
if (h.kind !== "thread" || s.kind !== "anon" && s.kind !== "verified") return;
|
|
4739
4818
|
let n = h.threadId;
|
|
4740
4819
|
v(!0), b(null);
|
|
4741
4820
|
try {
|
|
@@ -4750,8 +4829,8 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
|
|
|
4750
4829
|
m,
|
|
4751
4830
|
s,
|
|
4752
4831
|
h
|
|
4753
|
-
]),
|
|
4754
|
-
if (h.kind !== "thread" ||
|
|
4832
|
+
]), me = B(async (e) => {
|
|
4833
|
+
if (h.kind !== "thread" || s.kind !== "anon" && s.kind !== "verified") return;
|
|
4755
4834
|
let t = h.threadId;
|
|
4756
4835
|
v(!0), b(null);
|
|
4757
4836
|
try {
|
|
@@ -4766,16 +4845,18 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
|
|
|
4766
4845
|
m,
|
|
4767
4846
|
s,
|
|
4768
4847
|
h
|
|
4769
|
-
]),
|
|
4770
|
-
if (h.kind !== "thread"
|
|
4771
|
-
let n =
|
|
4848
|
+
]), he = B(async (e, t) => {
|
|
4849
|
+
if (h.kind !== "thread") return;
|
|
4850
|
+
let n = Rr(s);
|
|
4851
|
+
if (!n) return;
|
|
4852
|
+
let r = h.threadId;
|
|
4772
4853
|
b(null);
|
|
4773
4854
|
try {
|
|
4774
|
-
let
|
|
4855
|
+
let i = await m.toggleReaction(e, {
|
|
4775
4856
|
emoji: t,
|
|
4776
|
-
authorName:
|
|
4857
|
+
authorName: n.name
|
|
4777
4858
|
});
|
|
4778
|
-
o((e) => e.map((e) => e._id ===
|
|
4859
|
+
o((e) => e.map((e) => e._id === r ? i.thread : e));
|
|
4779
4860
|
} catch (e) {
|
|
4780
4861
|
b(e instanceof Error ? e.message : "Failed to react");
|
|
4781
4862
|
}
|
|
@@ -4783,12 +4864,12 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
|
|
|
4783
4864
|
m,
|
|
4784
4865
|
s,
|
|
4785
4866
|
h
|
|
4786
|
-
]),
|
|
4787
|
-
return
|
|
4788
|
-
h.kind === "thread" &&
|
|
4867
|
+
]), F = h.kind === "thread" ? a.find((e) => e._id === h.threadId) ?? null : null, I = O || A != null && A === F?.authorClientId;
|
|
4868
|
+
return R(() => {
|
|
4869
|
+
h.kind === "thread" && F == null && N();
|
|
4789
4870
|
}, [
|
|
4790
4871
|
h,
|
|
4791
|
-
|
|
4872
|
+
F,
|
|
4792
4873
|
N
|
|
4793
4874
|
]), /* @__PURE__ */ $("div", {
|
|
4794
4875
|
class: "markup-root",
|
|
@@ -4797,14 +4878,14 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
|
|
|
4797
4878
|
h.kind === "placing" ? null : /* @__PURE__ */ $("div", {
|
|
4798
4879
|
class: "markup-pins-layer",
|
|
4799
4880
|
children: [x ? null : a.map((e) => {
|
|
4800
|
-
let t = h.kind === "thread" && h.threadId === e._id, n =
|
|
4881
|
+
let t = h.kind === "thread" && h.threadId === e._id, n = Er({
|
|
4801
4882
|
anchorX: e.anchorX,
|
|
4802
4883
|
anchorY: e.anchorY,
|
|
4803
4884
|
anchorSelector: e.anchorSelector,
|
|
4804
4885
|
anchorOffsetX: e.anchorOffsetX,
|
|
4805
4886
|
anchorOffsetY: e.anchorOffsetY
|
|
4806
4887
|
}), r = e.comments.reduce((e, t) => e + +!t.deleted, 0);
|
|
4807
|
-
return /* @__PURE__ */ $(
|
|
4888
|
+
return /* @__PURE__ */ $(Ea, {
|
|
4808
4889
|
pageX: n.pageX,
|
|
4809
4890
|
pageY: n.pageY,
|
|
4810
4891
|
count: r,
|
|
@@ -4814,66 +4895,66 @@ function ja({ apiUrl: e, apiKey: t, position: n = "bottom-right" }) {
|
|
|
4814
4895
|
threadId: e._id
|
|
4815
4896
|
})
|
|
4816
4897
|
}, e._id);
|
|
4817
|
-
}), h.kind === "composing-new" ? /* @__PURE__ */ $(
|
|
4898
|
+
}), h.kind === "composing-new" ? /* @__PURE__ */ $(Da, {
|
|
4818
4899
|
pageX: h.pageX,
|
|
4819
4900
|
pageY: h.pageY
|
|
4820
4901
|
}) : null]
|
|
4821
4902
|
}),
|
|
4822
|
-
h.kind === "placing" ? /* @__PURE__ */ $(
|
|
4823
|
-
onPlace:
|
|
4903
|
+
h.kind === "placing" ? /* @__PURE__ */ $(Oa, {
|
|
4904
|
+
onPlace: ae,
|
|
4824
4905
|
onCancel: N
|
|
4825
4906
|
}) : null,
|
|
4826
|
-
h.kind === "thread" &&
|
|
4827
|
-
thread:
|
|
4907
|
+
h.kind === "thread" && F ? /* @__PURE__ */ $(Aa, {
|
|
4908
|
+
thread: F,
|
|
4828
4909
|
authorName: D,
|
|
4829
|
-
currentClientId:
|
|
4910
|
+
currentClientId: A ?? null,
|
|
4830
4911
|
isVerified: O,
|
|
4831
|
-
identityResolving:
|
|
4832
|
-
signingIn:
|
|
4833
|
-
canDelete:
|
|
4912
|
+
identityResolving: k,
|
|
4913
|
+
signingIn: se,
|
|
4914
|
+
canDelete: I,
|
|
4834
4915
|
pending: _,
|
|
4835
4916
|
error: y,
|
|
4836
4917
|
hidden: x,
|
|
4837
|
-
onAuthor:
|
|
4838
|
-
onSignIn:
|
|
4918
|
+
onAuthor: oe,
|
|
4919
|
+
onSignIn: le,
|
|
4839
4920
|
onClose: N,
|
|
4840
|
-
onReply:
|
|
4841
|
-
onEditComment:
|
|
4842
|
-
onDeleteComment:
|
|
4843
|
-
onToggleReaction:
|
|
4844
|
-
onDelete:
|
|
4845
|
-
onResolve:
|
|
4846
|
-
},
|
|
4847
|
-
h.kind === "composing-new" ? /* @__PURE__ */ $(
|
|
4921
|
+
onReply: P,
|
|
4922
|
+
onEditComment: pe,
|
|
4923
|
+
onDeleteComment: me,
|
|
4924
|
+
onToggleReaction: he,
|
|
4925
|
+
onDelete: de,
|
|
4926
|
+
onResolve: fe
|
|
4927
|
+
}, F._id) : null,
|
|
4928
|
+
h.kind === "composing-new" ? /* @__PURE__ */ $(wa, {
|
|
4848
4929
|
pageX: h.pageX,
|
|
4849
4930
|
pageY: h.pageY,
|
|
4850
4931
|
authorName: D,
|
|
4851
4932
|
isVerified: O,
|
|
4852
|
-
identityResolving:
|
|
4853
|
-
signingIn:
|
|
4933
|
+
identityResolving: k,
|
|
4934
|
+
signingIn: se,
|
|
4854
4935
|
pending: _,
|
|
4855
4936
|
error: y,
|
|
4856
4937
|
screenshot: h.screenshot,
|
|
4857
4938
|
screenshotCapturing: h.screenshotCapturing,
|
|
4858
|
-
onAuthor:
|
|
4859
|
-
onSignIn:
|
|
4860
|
-
onSubmit:
|
|
4939
|
+
onAuthor: oe,
|
|
4940
|
+
onSignIn: le,
|
|
4941
|
+
onSubmit: ue,
|
|
4861
4942
|
onClose: N
|
|
4862
4943
|
}) : null,
|
|
4863
|
-
!x || h.kind === "placing" || h.kind === "composing-new" ? /* @__PURE__ */ $(
|
|
4944
|
+
!x || h.kind === "placing" || h.kind === "composing-new" ? /* @__PURE__ */ $(_a, {
|
|
4864
4945
|
active: h.kind === "placing",
|
|
4865
|
-
onToggle: () => h.kind === "placing" ? N() :
|
|
4946
|
+
onToggle: () => h.kind === "placing" ? N() : re(),
|
|
4866
4947
|
onHide: () => {
|
|
4867
4948
|
S(!0), w(!0);
|
|
4868
4949
|
},
|
|
4869
4950
|
position: l,
|
|
4870
4951
|
onPositionChange: u
|
|
4871
4952
|
}) : null,
|
|
4872
|
-
x && C ? /* @__PURE__ */ $(
|
|
4953
|
+
x && C ? /* @__PURE__ */ $(za, { position: l }) : null
|
|
4873
4954
|
]
|
|
4874
4955
|
});
|
|
4875
4956
|
}
|
|
4876
|
-
function
|
|
4957
|
+
function za({ position: e }) {
|
|
4877
4958
|
let t = /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent) ? "⌘" : "Ctrl";
|
|
4878
4959
|
return /* @__PURE__ */ $("div", {
|
|
4879
4960
|
class: Q("markup-hud-hidden-toast", e === "bottom-left" ? "markup-hud-hidden-toast-left" : "markup-hud-hidden-toast-right"),
|
|
@@ -4895,32 +4976,32 @@ function Ma({ position: e }) {
|
|
|
4895
4976
|
}
|
|
4896
4977
|
//#endregion
|
|
4897
4978
|
//#region src/runtime/mount.tsx
|
|
4898
|
-
function
|
|
4979
|
+
function Ba(e, t) {
|
|
4899
4980
|
e.style.position = "fixed", e.style.inset = "0", e.style.zIndex = "2147483647", e.style.pointerEvents = "none";
|
|
4900
4981
|
let n = t.theme ?? "auto";
|
|
4901
4982
|
n !== "auto" && (e.dataset.theme = n);
|
|
4902
4983
|
let r = e.attachShadow({ mode: "open" }), i = document.createElement("style");
|
|
4903
|
-
i.textContent =
|
|
4984
|
+
i.textContent = de, r.appendChild(i);
|
|
4904
4985
|
let a = document.createElement("div");
|
|
4905
4986
|
a.className = "markup-shadow-root", r.appendChild(a);
|
|
4906
4987
|
let { theme: o, ...s } = t;
|
|
4907
|
-
return
|
|
4988
|
+
return ue(/* @__PURE__ */ $(Ra, { ...s }), a), () => ue(null, a);
|
|
4908
4989
|
}
|
|
4909
4990
|
//#endregion
|
|
4910
4991
|
//#region src/widget.ts
|
|
4911
|
-
var
|
|
4912
|
-
function
|
|
4913
|
-
|
|
4992
|
+
var Va = null, Ha = null;
|
|
4993
|
+
function Ua(e) {
|
|
4994
|
+
Wa();
|
|
4914
4995
|
let t = document.createElement("div");
|
|
4915
|
-
return t.id = "markup-widget", document.body.appendChild(t),
|
|
4996
|
+
return t.id = "markup-widget", document.body.appendChild(t), Ha = t, Va = Ba(t, e), Wa;
|
|
4916
4997
|
}
|
|
4917
|
-
function
|
|
4918
|
-
|
|
4998
|
+
function Wa() {
|
|
4999
|
+
Va &&= (Va(), null), Ha?.parentNode && Ha.parentNode.removeChild(Ha), Ha = null;
|
|
4919
5000
|
}
|
|
4920
5001
|
if (typeof document < "u") {
|
|
4921
5002
|
let e = document.currentScript ?? document.querySelector("script[data-markup-widget=\"true\"]"), t = e?.dataset.apiUrl, n = e?.dataset.apiKey;
|
|
4922
5003
|
if (t && n) {
|
|
4923
|
-
let r = e?.dataset.position, i = e?.dataset.theme, a = () =>
|
|
5004
|
+
let r = e?.dataset.position, i = e?.dataset.theme, a = () => Ua({
|
|
4924
5005
|
apiUrl: t,
|
|
4925
5006
|
apiKey: n,
|
|
4926
5007
|
position: r,
|
|
@@ -4930,4 +5011,4 @@ if (typeof document < "u") {
|
|
|
4930
5011
|
}
|
|
4931
5012
|
}
|
|
4932
5013
|
//#endregion
|
|
4933
|
-
export {
|
|
5014
|
+
export { Wa as destroy, Ua as init };
|