@mashkovd/pelican-vue 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { onScopeDispose as
|
|
1
|
+
import { onScopeDispose as fe, defineComponent as F, ref as P, watch as V, openBlock as g, createElementBlock as M, createElementVNode as i, createTextVNode as L, toDisplayString as b, Fragment as D, renderList as Y, unref as p, normalizeClass as B, computed as $, normalizeStyle as Q, createCommentVNode as K, createVNode as T, withDirectives as ye, vShow as Me, inject as Ue, withModifiers as ne, renderSlot as X, createBlock as ue, withCtx as ce, mergeProps as Ve, shallowRef as Ee, triggerRef as le, reactive as Te, provide as se, toRef as be, onMounted as Be, normalizeProps as Oe, guardReactiveProps as Ke } from "vue";
|
|
2
2
|
function Ye(e, t) {
|
|
3
3
|
let a = null;
|
|
4
4
|
const n = (...c) => {
|
|
@@ -8,7 +8,7 @@ function Ye(e, t) {
|
|
|
8
8
|
}, s = () => {
|
|
9
9
|
a && (clearTimeout(a), a = null);
|
|
10
10
|
};
|
|
11
|
-
return
|
|
11
|
+
return fe(s), { wrapped: n, cancel: s };
|
|
12
12
|
}
|
|
13
13
|
const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
14
14
|
"return-desc",
|
|
@@ -72,35 +72,35 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
72
72
|
},
|
|
73
73
|
emits: ["update:search", "update:sortKey", "refresh", "toggle-filters"],
|
|
74
74
|
setup(e, { emit: t }) {
|
|
75
|
-
const a = e, n = t, s =
|
|
76
|
-
|
|
75
|
+
const a = e, n = t, s = P(a.search);
|
|
76
|
+
V(
|
|
77
77
|
() => a.search,
|
|
78
|
-
(
|
|
79
|
-
|
|
78
|
+
(r) => {
|
|
79
|
+
r !== s.value && (s.value = r);
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
|
-
const { wrapped: c } = Ye((
|
|
83
|
-
function l(
|
|
84
|
-
const m =
|
|
82
|
+
const { wrapped: c } = Ye((r) => n("update:search", r), Ge);
|
|
83
|
+
function l(r) {
|
|
84
|
+
const m = r.target.value;
|
|
85
85
|
s.value = m, c(m);
|
|
86
86
|
}
|
|
87
|
-
function o(
|
|
88
|
-
n("update:sortKey",
|
|
87
|
+
function o(r) {
|
|
88
|
+
n("update:sortKey", r.target.value);
|
|
89
89
|
}
|
|
90
|
-
return (
|
|
90
|
+
return (r, m) => (g(), M("div", Je, [
|
|
91
91
|
i("button", {
|
|
92
92
|
class: "btn-flat filters-toggle",
|
|
93
93
|
type: "button",
|
|
94
|
-
onClick: m[0] || (m[0] = (
|
|
94
|
+
onClick: m[0] || (m[0] = (h) => n("toggle-filters"))
|
|
95
95
|
}, " Filters "),
|
|
96
96
|
i("div", Qe, [
|
|
97
|
-
m[2] || (m[2] =
|
|
97
|
+
m[2] || (m[2] = L(" Showing ", -1)),
|
|
98
98
|
i("b", null, b(e.filteredTotal.toLocaleString("en-US")), 1),
|
|
99
|
-
m[3] || (m[3] =
|
|
99
|
+
m[3] || (m[3] = L(" of ", -1)),
|
|
100
100
|
i("b", null, b(e.total.toLocaleString("en-US")), 1),
|
|
101
|
-
m[4] || (m[4] =
|
|
101
|
+
m[4] || (m[4] = L(" · page ", -1)),
|
|
102
102
|
i("b", null, b(e.page), 1),
|
|
103
|
-
|
|
103
|
+
L(" / " + b(e.totalPages), 1)
|
|
104
104
|
]),
|
|
105
105
|
i("input", {
|
|
106
106
|
class: "search",
|
|
@@ -116,17 +116,17 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
116
116
|
value: e.sortKey,
|
|
117
117
|
onChange: o
|
|
118
118
|
}, [
|
|
119
|
-
(
|
|
120
|
-
key:
|
|
121
|
-
value:
|
|
122
|
-
}, b(
|
|
119
|
+
(g(!0), M(D, null, Y(p(qe), (h) => (g(), M("option", {
|
|
120
|
+
key: h,
|
|
121
|
+
value: h
|
|
122
|
+
}, b(p(Xe)[h]), 9, nt))), 128))
|
|
123
123
|
], 40, at)
|
|
124
124
|
]),
|
|
125
125
|
i("button", {
|
|
126
126
|
class: "btn-flat",
|
|
127
127
|
type: "button",
|
|
128
128
|
title: "reload",
|
|
129
|
-
onClick: m[1] || (m[1] = (
|
|
129
|
+
onClick: m[1] || (m[1] = (h) => n("refresh"))
|
|
130
130
|
}, " ↻ reload ")
|
|
131
131
|
]));
|
|
132
132
|
}
|
|
@@ -147,13 +147,13 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
147
147
|
const o = new Set(a.modelValue);
|
|
148
148
|
o.has(l) ? o.delete(l) : o.add(l), n("update:modelValue", o);
|
|
149
149
|
}
|
|
150
|
-
return (l, o) => (
|
|
151
|
-
(
|
|
152
|
-
key:
|
|
150
|
+
return (l, o) => (g(), M("div", ot, [
|
|
151
|
+
(g(), M(D, null, Y(s, (r) => i("button", {
|
|
152
|
+
key: r,
|
|
153
153
|
type: "button",
|
|
154
|
-
class: B(["chip", ["risk-" +
|
|
155
|
-
onClick: (m) => c(
|
|
156
|
-
}, b(
|
|
154
|
+
class: B(["chip", ["risk-" + r.toLowerCase(), { on: e.modelValue.has(r) }]]),
|
|
155
|
+
onClick: (m) => c(r)
|
|
156
|
+
}, b(r), 11, it)), 64))
|
|
157
157
|
]));
|
|
158
158
|
}
|
|
159
159
|
}), ut = /* @__PURE__ */ N(rt, [["__scopeId", "data-v-742a6c3b"]]), ct = { class: "pelican-fgroup" }, dt = { class: "title-row" }, mt = { class: "title" }, ft = { class: "val" }, vt = ["min", "max", "step", "value"], pt = /* @__PURE__ */ F({
|
|
@@ -170,12 +170,12 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
170
170
|
},
|
|
171
171
|
emits: ["update:modelValue"],
|
|
172
172
|
setup(e, { emit: t }) {
|
|
173
|
-
const a = e, n = t, s =
|
|
174
|
-
function
|
|
175
|
-
const
|
|
176
|
-
isNaN(
|
|
173
|
+
const a = e, n = t, s = $(() => a.anyAt ?? a.min), c = $(() => !!a.inverted), l = $(() => a.modelValue == null ? c.value ? a.max : s.value : a.modelValue), o = $(() => a.modelValue == null ? "any" : a.format ? a.format(a.modelValue) : String(a.modelValue));
|
|
174
|
+
function r(m) {
|
|
175
|
+
const h = parseInt(m.target.value, 10);
|
|
176
|
+
isNaN(h) || (c.value && h >= a.max || !c.value && h <= s.value ? n("update:modelValue", null) : n("update:modelValue", h));
|
|
177
177
|
}
|
|
178
|
-
return (m,
|
|
178
|
+
return (m, h) => (g(), M("div", ct, [
|
|
179
179
|
i("div", dt, [
|
|
180
180
|
i("label", mt, b(e.label), 1),
|
|
181
181
|
i("span", ft, b(o.value), 1)
|
|
@@ -187,15 +187,15 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
187
187
|
max: e.max,
|
|
188
188
|
step: e.step,
|
|
189
189
|
value: l.value,
|
|
190
|
-
onInput:
|
|
191
|
-
onChange:
|
|
190
|
+
onInput: r,
|
|
191
|
+
onChange: r
|
|
192
192
|
}, null, 40, vt)
|
|
193
193
|
]));
|
|
194
194
|
}
|
|
195
|
-
}),
|
|
195
|
+
}), H = /* @__PURE__ */ N(pt, [["__scopeId", "data-v-10c5fe1c"]]), gt = { class: "pelican-fgroup" }, ht = { class: "title-row" }, yt = { class: "title" }, Mt = { class: "val" }, bt = ["min", "max", "value"], xt = ["min", "max", "value"], wt = {
|
|
196
196
|
key: 0,
|
|
197
197
|
class: "scale"
|
|
198
|
-
},
|
|
198
|
+
}, $t = /* @__PURE__ */ F({
|
|
199
199
|
__name: "RangeDual",
|
|
200
200
|
props: {
|
|
201
201
|
label: {},
|
|
@@ -211,67 +211,78 @@ const ze = 20, Ge = 350, He = 2e3, je = 2e4, We = 30, qe = [
|
|
|
211
211
|
},
|
|
212
212
|
emits: ["update:modelValueMin", "update:modelValueMax"],
|
|
213
213
|
setup(e, { emit: t }) {
|
|
214
|
-
const a = e, n = t, s =
|
|
214
|
+
const a = e, n = t, s = $(() => a.rawMin ?? 0), c = $(() => a.rawMax ?? 100), l = $(() => a.modelValueMin ?? s.value), o = $(() => a.modelValueMax ?? c.value), r = $(
|
|
215
215
|
() => l.value <= s.value ? a.minLabel ?? "any" : a.formatRaw(a.rawToDomain(l.value))
|
|
216
|
-
), m =
|
|
216
|
+
), m = $(
|
|
217
217
|
() => o.value >= c.value ? a.maxLabel ?? "any" : a.formatRaw(a.rawToDomain(o.value))
|
|
218
|
-
),
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
218
|
+
), h = $(() => l.value <= s.value && o.value >= c.value ? "any" : `${r.value} – ${m.value}`), v = $(() => (l.value - s.value) / (c.value - s.value) * 100), d = $(() => (o.value - s.value) / (c.value - s.value) * 100), u = $(() => ({
|
|
219
|
+
background: `linear-gradient(to right,
|
|
220
|
+
var(--track-bg, #e2e8f0) 0%,
|
|
221
|
+
var(--track-bg, #e2e8f0) ${v.value}%,
|
|
222
|
+
var(--accent, #3b82f6) ${v.value}%,
|
|
223
|
+
var(--accent, #3b82f6) ${d.value}%,
|
|
224
|
+
var(--track-bg, #e2e8f0) ${d.value}%,
|
|
225
|
+
var(--track-bg, #e2e8f0) 100%)`
|
|
226
|
+
}));
|
|
227
|
+
function I(_) {
|
|
228
|
+
let f = parseInt(_.target.value, 10);
|
|
229
|
+
isNaN(f) || (f > o.value && (f = o.value), n("update:modelValueMin", f <= s.value ? null : f));
|
|
222
230
|
}
|
|
223
|
-
function
|
|
224
|
-
let
|
|
225
|
-
isNaN(
|
|
231
|
+
function k(_) {
|
|
232
|
+
let f = parseInt(_.target.value, 10);
|
|
233
|
+
isNaN(f) || (f < l.value && (f = l.value), n("update:modelValueMax", f >= c.value ? null : f));
|
|
226
234
|
}
|
|
227
|
-
return (
|
|
228
|
-
var
|
|
229
|
-
return
|
|
235
|
+
return (_, f) => {
|
|
236
|
+
var R;
|
|
237
|
+
return g(), M("div", gt, [
|
|
230
238
|
i("div", ht, [
|
|
231
239
|
i("label", yt, b(e.label), 1),
|
|
232
|
-
i("span", Mt, b(
|
|
240
|
+
i("span", Mt, b(h.value), 1)
|
|
233
241
|
]),
|
|
234
|
-
i("div",
|
|
242
|
+
i("div", {
|
|
243
|
+
class: "dual-track",
|
|
244
|
+
style: Q(u.value)
|
|
245
|
+
}, [
|
|
235
246
|
i("input", {
|
|
236
247
|
type: "range",
|
|
237
248
|
class: "range-dual",
|
|
238
249
|
min: s.value,
|
|
239
250
|
max: c.value,
|
|
240
251
|
value: l.value,
|
|
241
|
-
style:
|
|
242
|
-
onInput:
|
|
243
|
-
onChange:
|
|
244
|
-
}, null, 44,
|
|
252
|
+
style: Q({ zIndex: l.value <= s.value || l.value >= o.value ? 5 : 4 }),
|
|
253
|
+
onInput: I,
|
|
254
|
+
onChange: I
|
|
255
|
+
}, null, 44, bt),
|
|
245
256
|
i("input", {
|
|
246
257
|
type: "range",
|
|
247
258
|
class: "range-dual",
|
|
248
259
|
min: s.value,
|
|
249
260
|
max: c.value,
|
|
250
261
|
value: o.value,
|
|
251
|
-
style:
|
|
252
|
-
onInput:
|
|
253
|
-
onChange:
|
|
254
|
-
}, null, 44,
|
|
255
|
-
]),
|
|
256
|
-
(
|
|
257
|
-
(
|
|
258
|
-
])) :
|
|
262
|
+
style: Q({ zIndex: l.value <= s.value || l.value >= o.value ? 4 : 5 }),
|
|
263
|
+
onInput: k,
|
|
264
|
+
onChange: k
|
|
265
|
+
}, null, 44, xt)
|
|
266
|
+
], 4),
|
|
267
|
+
(R = e.scaleHints) != null && R.length ? (g(), M("div", wt, [
|
|
268
|
+
(g(!0), M(D, null, Y(e.scaleHints, (A) => (g(), M("span", { key: A }, b(A), 1))), 128))
|
|
269
|
+
])) : K("", !0)
|
|
259
270
|
]);
|
|
260
271
|
};
|
|
261
272
|
}
|
|
262
|
-
}),
|
|
263
|
-
function
|
|
273
|
+
}), xe = /* @__PURE__ */ N($t, [["__scopeId", "data-v-dde22e60"]]);
|
|
274
|
+
function we(e, t = 2) {
|
|
264
275
|
if (e == null || isNaN(Number(e))) return null;
|
|
265
276
|
const a = Number(e);
|
|
266
277
|
return { text: `${a.toFixed(t)}%`, positive: a >= 0 };
|
|
267
278
|
}
|
|
268
|
-
function
|
|
279
|
+
function $e(e, t = "en-US") {
|
|
269
280
|
if (e == null || isNaN(Number(e))) return "—";
|
|
270
281
|
const a = Number(e), n = a < 0 ? "-" : "", s = Math.abs(a);
|
|
271
282
|
let c;
|
|
272
283
|
return s >= 1e6 ? c = (s / 1e6).toFixed(2) + "M" : s >= 1e3 ? c = Math.round(s).toLocaleString(t) : c = s.toFixed(2), `${n}$${c}`;
|
|
273
284
|
}
|
|
274
|
-
function
|
|
285
|
+
function j(e, t = "en-US") {
|
|
275
286
|
if (e == null || isNaN(Number(e))) return "—";
|
|
276
287
|
const a = Number(e);
|
|
277
288
|
return `${a < 0 ? "-" : ""}$${Math.abs(a).toLocaleString(t, {
|
|
@@ -279,13 +290,13 @@ function H(e, t = "en-US") {
|
|
|
279
290
|
maximumFractionDigits: 2
|
|
280
291
|
})}`;
|
|
281
292
|
}
|
|
282
|
-
function
|
|
293
|
+
function ke(e, t = "en-US") {
|
|
283
294
|
return e == null ? "—" : Number(e).toLocaleString(t);
|
|
284
295
|
}
|
|
285
|
-
function
|
|
296
|
+
function kt(e) {
|
|
286
297
|
return e.Fee == null ? e._meta ? "free" : "—" : `${(e.Fee * 100).toFixed(0)}%`;
|
|
287
298
|
}
|
|
288
|
-
function
|
|
299
|
+
function Ie(e, t = "en-US") {
|
|
289
300
|
if (!e) return "—";
|
|
290
301
|
const a = new Date(e);
|
|
291
302
|
return isNaN(a.getTime()) ? "—" : a.toLocaleString(t, {
|
|
@@ -297,7 +308,7 @@ function ke(e, t = "en-US") {
|
|
|
297
308
|
hour12: !1
|
|
298
309
|
});
|
|
299
310
|
}
|
|
300
|
-
function
|
|
311
|
+
function It(e) {
|
|
301
312
|
if (e == null) return "—";
|
|
302
313
|
if (e < 30) return `${e}d`;
|
|
303
314
|
const t = Math.floor(e / 30);
|
|
@@ -305,29 +316,29 @@ function _t(e) {
|
|
|
305
316
|
const a = Math.floor(e / 365), n = Math.floor((e - a * 365) / 30);
|
|
306
317
|
return n ? `${a}y ${n}mo` : `${a}y`;
|
|
307
318
|
}
|
|
308
|
-
function
|
|
319
|
+
function de(e) {
|
|
309
320
|
return e >= 1e6 ? "$" + (e / 1e6).toFixed(2) + "M" : e >= 1e3 ? "$" + Math.round(e / 1e3) + "K" : "$" + Math.round(e);
|
|
310
321
|
}
|
|
311
|
-
function
|
|
322
|
+
function _t(e) {
|
|
312
323
|
return e >= 1e3 ? (e / 1e3).toFixed(1).replace(/\.0$/, "") + "K%" : Math.round(e) + "%";
|
|
313
324
|
}
|
|
314
|
-
function
|
|
325
|
+
function St(e) {
|
|
315
326
|
return e && e.trim().split(/\s+/).slice(0, 2).map((a) => a.charAt(0).toUpperCase()).join("") || "?";
|
|
316
327
|
}
|
|
317
|
-
function
|
|
328
|
+
function W(e) {
|
|
318
329
|
if (!e) return null;
|
|
319
330
|
const t = new Date(e);
|
|
320
331
|
return isNaN(t.getTime()) ? null : Math.floor((Date.now() - t.getTime()) / 864e5);
|
|
321
332
|
}
|
|
322
|
-
const
|
|
333
|
+
const oe = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), _e = (e) => e <= 0 ? 0 : Math.max(1, Math.min(100, Math.round(1 + (Math.log10(e) - 1) * 99 / 6))), ie = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, (e - 1) / 99 * 4.7)), Rt = { class: "pelican-fgroup" }, Pt = { class: "title-row" }, Ct = { class: "val" }, Tt = ["value"], At = /* @__PURE__ */ F({
|
|
323
334
|
__name: "InvestAmount",
|
|
324
335
|
props: {
|
|
325
336
|
modelValue: {}
|
|
326
337
|
},
|
|
327
338
|
emits: ["update:modelValue", "apply"],
|
|
328
339
|
setup(e, { emit: t }) {
|
|
329
|
-
const a = e, n = t, s =
|
|
330
|
-
() => a.modelValue == null ? "any" :
|
|
340
|
+
const a = e, n = t, s = $(
|
|
341
|
+
() => a.modelValue == null ? "any" : de(a.modelValue)
|
|
331
342
|
);
|
|
332
343
|
function c(l) {
|
|
333
344
|
const o = l.target.value.trim();
|
|
@@ -335,17 +346,17 @@ const le = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), I
|
|
|
335
346
|
n("update:modelValue", null), n("apply", null);
|
|
336
347
|
return;
|
|
337
348
|
}
|
|
338
|
-
const
|
|
339
|
-
if (isNaN(
|
|
349
|
+
const r = parseInt(o, 10);
|
|
350
|
+
if (isNaN(r) || r <= 0) {
|
|
340
351
|
n("update:modelValue", null), n("apply", null);
|
|
341
352
|
return;
|
|
342
353
|
}
|
|
343
|
-
n("update:modelValue",
|
|
354
|
+
n("update:modelValue", r), n("apply", { min: _e(50), max: _e(r) });
|
|
344
355
|
}
|
|
345
|
-
return (l, o) => (
|
|
346
|
-
i("div",
|
|
356
|
+
return (l, o) => (g(), M("div", Rt, [
|
|
357
|
+
i("div", Pt, [
|
|
347
358
|
o[0] || (o[0] = i("label", { class: "title" }, "Your Investment Amount, $", -1)),
|
|
348
|
-
i("span",
|
|
359
|
+
i("span", Ct, b(s.value), 1)
|
|
349
360
|
]),
|
|
350
361
|
i("input", {
|
|
351
362
|
type: "number",
|
|
@@ -355,10 +366,10 @@ const le = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), I
|
|
|
355
366
|
autocomplete: "off",
|
|
356
367
|
value: e.modelValue ?? "",
|
|
357
368
|
onChange: c
|
|
358
|
-
}, null, 40,
|
|
369
|
+
}, null, 40, Tt)
|
|
359
370
|
]));
|
|
360
371
|
}
|
|
361
|
-
}),
|
|
372
|
+
}), Ft = /* @__PURE__ */ N(At, [["__scopeId", "data-v-a76acc6c"]]), Nt = { class: "ftitle-row" }, Lt = /* @__PURE__ */ F({
|
|
362
373
|
__name: "FiltersPanel",
|
|
363
374
|
props: {
|
|
364
375
|
filters: {},
|
|
@@ -367,67 +378,67 @@ const le = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), I
|
|
|
367
378
|
},
|
|
368
379
|
emits: ["update:filters", "update:investAmount", "reset"],
|
|
369
380
|
setup(e, { emit: t }) {
|
|
370
|
-
const a = e, n = t, s =
|
|
371
|
-
|
|
372
|
-
n("update:filters", { retMin:
|
|
373
|
-
}),
|
|
374
|
-
n("update:filters", { retMax:
|
|
375
|
-
}),
|
|
376
|
-
n("update:filters", { balanceMin:
|
|
377
|
-
}),
|
|
378
|
-
n("update:filters", { balanceMax:
|
|
379
|
-
}),
|
|
381
|
+
const a = e, n = t, s = P(0), c = P(100), l = P(0), o = P(100);
|
|
382
|
+
V(s, (v) => {
|
|
383
|
+
n("update:filters", { retMin: v <= 0 ? null : ie(v) });
|
|
384
|
+
}), V(c, (v) => {
|
|
385
|
+
n("update:filters", { retMax: v >= 100 ? null : ie(v) });
|
|
386
|
+
}), V(l, (v) => {
|
|
387
|
+
n("update:filters", { balanceMin: v <= 0 ? null : oe(v) });
|
|
388
|
+
}), V(o, (v) => {
|
|
389
|
+
n("update:filters", { balanceMax: v >= 100 ? null : oe(v) });
|
|
390
|
+
}), V(
|
|
380
391
|
() => [a.filters.retMin, a.filters.retMax],
|
|
381
|
-
([
|
|
382
|
-
|
|
392
|
+
([v, d]) => {
|
|
393
|
+
v == null && (s.value = 0), d == null && (c.value = 100);
|
|
383
394
|
}
|
|
384
|
-
),
|
|
395
|
+
), V(
|
|
385
396
|
() => [a.filters.balanceMin, a.filters.balanceMax],
|
|
386
|
-
([
|
|
387
|
-
|
|
397
|
+
([v, d]) => {
|
|
398
|
+
v == null && (l.value = 0), d == null && (o.value = 100);
|
|
388
399
|
}
|
|
389
400
|
);
|
|
390
|
-
function
|
|
391
|
-
n("update:filters",
|
|
401
|
+
function r(v) {
|
|
402
|
+
n("update:filters", v);
|
|
392
403
|
}
|
|
393
|
-
function m(
|
|
394
|
-
|
|
404
|
+
function m(v) {
|
|
405
|
+
r({ risk: v });
|
|
395
406
|
}
|
|
396
|
-
function
|
|
397
|
-
|
|
407
|
+
function h(v) {
|
|
408
|
+
v == null ? (r({ balanceMin: null, balanceMax: null }), l.value = 0, o.value = 100) : (l.value = v.min, o.value = v.max);
|
|
398
409
|
}
|
|
399
|
-
return (
|
|
410
|
+
return (v, d) => (g(), M("aside", {
|
|
400
411
|
class: B(["pelican-filters", { open: e.open }])
|
|
401
412
|
}, [
|
|
402
|
-
i("div",
|
|
413
|
+
i("div", Nt, [
|
|
403
414
|
d[13] || (d[13] = i("label", { class: "ftitle" }, "Risk", -1)),
|
|
404
415
|
i("button", {
|
|
405
416
|
class: "btn-reset",
|
|
406
417
|
type: "button",
|
|
407
|
-
onClick: d[0] || (d[0] = (
|
|
418
|
+
onClick: d[0] || (d[0] = (u) => n("reset"))
|
|
408
419
|
}, "reset filters")
|
|
409
420
|
]),
|
|
410
|
-
|
|
421
|
+
T(ut, {
|
|
411
422
|
"model-value": e.filters.risk,
|
|
412
423
|
"onUpdate:modelValue": m
|
|
413
424
|
}, null, 8, ["model-value"]),
|
|
414
|
-
|
|
425
|
+
T(Ft, {
|
|
415
426
|
"model-value": e.investAmount,
|
|
416
|
-
"onUpdate:modelValue": d[1] || (d[1] = (
|
|
417
|
-
onApply:
|
|
427
|
+
"onUpdate:modelValue": d[1] || (d[1] = (u) => n("update:investAmount", u)),
|
|
428
|
+
onApply: h
|
|
418
429
|
}, null, 8, ["model-value"]),
|
|
419
|
-
|
|
430
|
+
T(xe, {
|
|
420
431
|
label: "Return %",
|
|
421
432
|
"model-value-min": s.value,
|
|
422
433
|
"model-value-max": c.value,
|
|
423
|
-
"format-raw": (
|
|
424
|
-
"raw-to-domain": (
|
|
434
|
+
"format-raw": (u) => p(_t)(u),
|
|
435
|
+
"raw-to-domain": (u) => p(ie)(u),
|
|
425
436
|
"scale-hints": ["0%", "200%", "50K%+"],
|
|
426
437
|
"max-label": "50K%+",
|
|
427
|
-
"onUpdate:modelValueMin": d[2] || (d[2] = (
|
|
428
|
-
"onUpdate:modelValueMax": d[3] || (d[3] = (
|
|
438
|
+
"onUpdate:modelValueMin": d[2] || (d[2] = (u) => s.value = u ?? 0),
|
|
439
|
+
"onUpdate:modelValueMax": d[3] || (d[3] = (u) => c.value = u ?? 100)
|
|
429
440
|
}, null, 8, ["model-value-min", "model-value-max", "format-raw", "raw-to-domain"]),
|
|
430
|
-
|
|
441
|
+
T(H, {
|
|
431
442
|
label: "Max Drawdown ≤",
|
|
432
443
|
"model-value": e.filters.ddMax,
|
|
433
444
|
min: 0,
|
|
@@ -435,21 +446,21 @@ const le = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), I
|
|
|
435
446
|
step: 5,
|
|
436
447
|
"any-at": 100,
|
|
437
448
|
inverted: !0,
|
|
438
|
-
format: (
|
|
439
|
-
"onUpdate:modelValue": d[4] || (d[4] = (
|
|
449
|
+
format: (u) => u + "%",
|
|
450
|
+
"onUpdate:modelValue": d[4] || (d[4] = (u) => r({ ddMax: u == null || u >= 100 ? null : u }))
|
|
440
451
|
}, null, 8, ["model-value", "format"]),
|
|
441
|
-
|
|
452
|
+
T(xe, {
|
|
442
453
|
label: "Balance",
|
|
443
454
|
"model-value-min": l.value,
|
|
444
455
|
"model-value-max": o.value,
|
|
445
|
-
"format-raw": (
|
|
446
|
-
"raw-to-domain": (
|
|
456
|
+
"format-raw": (u) => p(de)(u),
|
|
457
|
+
"raw-to-domain": (u) => p(oe)(u),
|
|
447
458
|
"scale-hints": ["$0", "$10K", "$10M"],
|
|
448
459
|
"max-label": "$10M+",
|
|
449
|
-
"onUpdate:modelValueMin": d[5] || (d[5] = (
|
|
450
|
-
"onUpdate:modelValueMax": d[6] || (d[6] = (
|
|
460
|
+
"onUpdate:modelValueMin": d[5] || (d[5] = (u) => l.value = u ?? 0),
|
|
461
|
+
"onUpdate:modelValueMax": d[6] || (d[6] = (u) => o.value = u ?? 100)
|
|
451
462
|
}, null, 8, ["model-value-min", "model-value-max", "format-raw", "raw-to-domain"]),
|
|
452
|
-
|
|
463
|
+
T(H, {
|
|
453
464
|
label: "Mgmt Fee ≤",
|
|
454
465
|
"model-value": e.filters.feeMax,
|
|
455
466
|
min: 0,
|
|
@@ -457,57 +468,57 @@ const le = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), I
|
|
|
457
468
|
step: 5,
|
|
458
469
|
"any-at": 100,
|
|
459
470
|
inverted: !0,
|
|
460
|
-
format: (
|
|
461
|
-
"onUpdate:modelValue": d[7] || (d[7] = (
|
|
471
|
+
format: (u) => u + "%",
|
|
472
|
+
"onUpdate:modelValue": d[7] || (d[7] = (u) => r({ feeMax: u == null || u >= 100 ? null : u }))
|
|
462
473
|
}, null, 8, ["model-value", "format"]),
|
|
463
|
-
|
|
474
|
+
T(H, {
|
|
464
475
|
label: "Copiers AUM ≥",
|
|
465
476
|
"model-value": e.filters.aumMin,
|
|
466
477
|
min: 0,
|
|
467
478
|
max: 5e6,
|
|
468
479
|
step: 5e4,
|
|
469
|
-
format: (
|
|
470
|
-
"onUpdate:modelValue": d[8] || (d[8] = (
|
|
480
|
+
format: (u) => "≥ " + p(de)(u),
|
|
481
|
+
"onUpdate:modelValue": d[8] || (d[8] = (u) => r({ aumMin: u && u > 0 ? u : null }))
|
|
471
482
|
}, null, 8, ["model-value", "format"]),
|
|
472
|
-
|
|
483
|
+
T(H, {
|
|
473
484
|
label: "Copiers ≥",
|
|
474
485
|
"model-value": e.filters.copiersMin,
|
|
475
486
|
min: 0,
|
|
476
487
|
max: 3e3,
|
|
477
488
|
step: 10,
|
|
478
|
-
format: (
|
|
479
|
-
"onUpdate:modelValue": d[9] || (d[9] = (
|
|
489
|
+
format: (u) => "≥ " + u,
|
|
490
|
+
"onUpdate:modelValue": d[9] || (d[9] = (u) => r({ copiersMin: u && u > 0 ? u : null }))
|
|
480
491
|
}, null, 8, ["model-value", "format"]),
|
|
481
|
-
|
|
492
|
+
T(H, {
|
|
482
493
|
label: "Age ≥ (days)",
|
|
483
494
|
"model-value": e.filters.ageMin,
|
|
484
495
|
min: 0,
|
|
485
496
|
max: 3e3,
|
|
486
497
|
step: 10,
|
|
487
|
-
format: (
|
|
488
|
-
"onUpdate:modelValue": d[10] || (d[10] = (
|
|
498
|
+
format: (u) => "≥ " + u + "d",
|
|
499
|
+
"onUpdate:modelValue": d[10] || (d[10] = (u) => r({ ageMin: u && u > 0 ? u : null }))
|
|
489
500
|
}, null, 8, ["model-value", "format"]),
|
|
490
|
-
|
|
501
|
+
T(H, {
|
|
491
502
|
label: "Trades ≥",
|
|
492
503
|
"model-value": e.filters.tradesMin,
|
|
493
504
|
min: 0,
|
|
494
505
|
max: 1e4,
|
|
495
506
|
step: 50,
|
|
496
|
-
format: (
|
|
497
|
-
"onUpdate:modelValue": d[11] || (d[11] = (
|
|
507
|
+
format: (u) => "≥ " + u,
|
|
508
|
+
"onUpdate:modelValue": d[11] || (d[11] = (u) => r({ tradesMin: u && u > 0 ? u : null }))
|
|
498
509
|
}, null, 8, ["model-value", "format"]),
|
|
499
|
-
|
|
510
|
+
T(H, {
|
|
500
511
|
label: "Win Rate ≥",
|
|
501
512
|
"model-value": e.filters.winrateMin,
|
|
502
513
|
min: 0,
|
|
503
514
|
max: 100,
|
|
504
515
|
step: 5,
|
|
505
|
-
format: (
|
|
506
|
-
"onUpdate:modelValue": d[12] || (d[12] = (
|
|
516
|
+
format: (u) => "≥ " + u + "%",
|
|
517
|
+
"onUpdate:modelValue": d[12] || (d[12] = (u) => r({ winrateMin: u && u > 0 ? u : null }))
|
|
507
518
|
}, null, 8, ["model-value", "format"])
|
|
508
519
|
], 2));
|
|
509
520
|
}
|
|
510
|
-
}),
|
|
521
|
+
}), Dt = /* @__PURE__ */ N(Lt, [["__scopeId", "data-v-67cc5448"]]), Se = [
|
|
511
522
|
"#f97316",
|
|
512
523
|
"#3b82f6",
|
|
513
524
|
"#10b981",
|
|
@@ -521,7 +532,7 @@ const le = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), I
|
|
|
521
532
|
"#f59e0b",
|
|
522
533
|
"#22c55e"
|
|
523
534
|
];
|
|
524
|
-
function
|
|
535
|
+
function Ut(e, t = 140, a = 34) {
|
|
525
536
|
if (!e || e.length < 2)
|
|
526
537
|
return {
|
|
527
538
|
hasData: !1,
|
|
@@ -534,46 +545,46 @@ function Vt(e, t = 140, a = 34) {
|
|
|
534
545
|
startX: 1,
|
|
535
546
|
endX: t - 1
|
|
536
547
|
};
|
|
537
|
-
const n = e.map((S) => Date.parse(S.Timestamp)), s = n[0], c = n[n.length - 1], l = c - s || 1, o = e.map((S) => S.AccountReturn),
|
|
548
|
+
const n = e.map((S) => Date.parse(S.Timestamp)), s = n[0], c = n[n.length - 1], l = c - s || 1, o = e.map((S) => S.AccountReturn), r = Math.min(0, ...o), h = Math.max(0, ...o) - r || 1, v = (S) => (S - s) / l * (t - 2) + 1, d = (S) => a - 2 - (S - r) / h * (a - 4), u = e.map((S, x) => `${v(n[x]).toFixed(1)},${d(S.AccountReturn).toFixed(1)}`), I = o[o.length - 1], k = d(0), _ = v(s), f = v(c), R = `M ${u.join(" L ")}`, A = `M ${u[0]} ` + u.slice(1).map((S) => `L ${S}`).join(" ") + ` L ${f.toFixed(1)},${k.toFixed(1)} L ${_.toFixed(1)},${k.toFixed(1)} Z`;
|
|
538
549
|
return {
|
|
539
550
|
hasData: !0,
|
|
540
551
|
width: t,
|
|
541
552
|
height: a,
|
|
542
|
-
zeroY:
|
|
543
|
-
areaPath:
|
|
544
|
-
linePath:
|
|
545
|
-
positive:
|
|
553
|
+
zeroY: k,
|
|
554
|
+
areaPath: A,
|
|
555
|
+
linePath: R,
|
|
556
|
+
positive: I >= 0,
|
|
546
557
|
startX: _,
|
|
547
|
-
endX:
|
|
558
|
+
endX: f
|
|
548
559
|
};
|
|
549
560
|
}
|
|
550
|
-
function
|
|
551
|
-
const n = e.slice().sort((d,
|
|
552
|
-
let
|
|
553
|
-
const
|
|
554
|
-
return n.forEach((d,
|
|
555
|
-
const
|
|
556
|
-
|
|
557
|
-
const
|
|
558
|
-
let
|
|
559
|
-
if (
|
|
560
|
-
const
|
|
561
|
-
|
|
561
|
+
function Vt(e, t = 520, a = 280) {
|
|
562
|
+
const n = e.slice().sort((d, u) => (u.c || 0) - (d.c || 0)), s = n.reduce((d, u) => d + (u.c || 0), 0) || 1, c = t / 2, l = a / 2, o = 90, r = 52, m = o + 10;
|
|
563
|
+
let h = -Math.PI / 2;
|
|
564
|
+
const v = [];
|
|
565
|
+
return n.forEach((d, u) => {
|
|
566
|
+
const I = (d.c || 0) / s, k = I * Math.PI * 2, _ = h, f = h + k;
|
|
567
|
+
h = f;
|
|
568
|
+
const R = (_ + f) / 2, A = k > Math.PI ? 1 : 0, S = c + o * Math.cos(_), x = l + o * Math.sin(_), w = c + o * Math.cos(f), y = l + o * Math.sin(f), C = c + r * Math.cos(_), O = l + r * Math.sin(_), z = c + r * Math.cos(f), E = l + r * Math.sin(f), U = `M ${S.toFixed(2)} ${x.toFixed(2)} A ${o} ${o} 0 ${A} 1 ${w.toFixed(2)} ${y.toFixed(2)} L ${z.toFixed(2)} ${E.toFixed(2)} A ${r} ${r} 0 ${A} 0 ${C.toFixed(2)} ${O.toFixed(2)} Z`, G = Se[u % Se.length];
|
|
569
|
+
let ve = null, pe = 0, ge = 0, he = "start";
|
|
570
|
+
if (I >= 0.015) {
|
|
571
|
+
const te = Math.cos(R) < 0, Ne = c + o * Math.cos(R), Le = l + o * Math.sin(R), Z = c + m * Math.cos(R), ae = l + m * Math.sin(R), De = te ? Z - 4 : Z + 4;
|
|
572
|
+
ve = `${Ne.toFixed(1)},${Le.toFixed(1)} ${Z.toFixed(1)},${ae.toFixed(1)} ${De.toFixed(1)},${ae.toFixed(1)}`, pe = te ? Z - 6 : Z + 6, ge = ae + 4, he = te ? "end" : "start";
|
|
562
573
|
}
|
|
563
|
-
|
|
574
|
+
v.push({
|
|
564
575
|
marketName: d.n,
|
|
565
576
|
count: d.c,
|
|
566
|
-
fraction:
|
|
567
|
-
color:
|
|
568
|
-
arcPath:
|
|
569
|
-
labelLine:
|
|
570
|
-
labelX:
|
|
571
|
-
labelY:
|
|
572
|
-
labelAnchor:
|
|
577
|
+
fraction: I,
|
|
578
|
+
color: G,
|
|
579
|
+
arcPath: U,
|
|
580
|
+
labelLine: ve,
|
|
581
|
+
labelX: pe,
|
|
582
|
+
labelY: ge,
|
|
583
|
+
labelAnchor: he
|
|
573
584
|
});
|
|
574
|
-
}), { width: t, height: a, cx: c, cy: l, outerR: o, innerR:
|
|
585
|
+
}), { width: t, height: a, cx: c, cy: l, outerR: o, innerR: r, slices: v };
|
|
575
586
|
}
|
|
576
|
-
const
|
|
587
|
+
const Et = ["width", "height"], Bt = ["width", "height", "viewBox"], Ot = ["x2", "y1", "y2"], Kt = ["d", "fill"], Yt = ["d", "stroke"], zt = /* @__PURE__ */ F({
|
|
577
588
|
__name: "Sparkline",
|
|
578
589
|
props: {
|
|
579
590
|
history: {},
|
|
@@ -581,8 +592,8 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
581
592
|
height: { default: 34 }
|
|
582
593
|
},
|
|
583
594
|
setup(e) {
|
|
584
|
-
const t = e, a =
|
|
585
|
-
return (n, s) => a.value.hasData ? (
|
|
595
|
+
const t = e, a = $(() => Ut(t.history, t.width, t.height));
|
|
596
|
+
return (n, s) => a.value.hasData ? (g(), M("svg", {
|
|
586
597
|
key: 1,
|
|
587
598
|
class: "pelican-spark",
|
|
588
599
|
width: a.value.width,
|
|
@@ -601,12 +612,12 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
601
612
|
"stroke-dasharray": "2 3",
|
|
602
613
|
"stroke-width": "1",
|
|
603
614
|
"vector-effect": "non-scaling-stroke"
|
|
604
|
-
}, null, 8,
|
|
615
|
+
}, null, 8, Ot),
|
|
605
616
|
i("path", {
|
|
606
617
|
d: a.value.areaPath,
|
|
607
618
|
fill: a.value.positive ? "var(--area-green)" : "var(--area-red)",
|
|
608
619
|
stroke: "none"
|
|
609
|
-
}, null, 8,
|
|
620
|
+
}, null, 8, Kt),
|
|
610
621
|
i("path", {
|
|
611
622
|
d: a.value.linePath,
|
|
612
623
|
fill: "none",
|
|
@@ -615,8 +626,8 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
615
626
|
"stroke-linejoin": "round",
|
|
616
627
|
"stroke-linecap": "round",
|
|
617
628
|
"vector-effect": "non-scaling-stroke"
|
|
618
|
-
}, null, 8,
|
|
619
|
-
], 8,
|
|
629
|
+
}, null, 8, Yt)
|
|
630
|
+
], 8, Bt)) : (g(), M("svg", {
|
|
620
631
|
key: 0,
|
|
621
632
|
class: "pelican-spark",
|
|
622
633
|
width: a.value.width,
|
|
@@ -630,15 +641,15 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
630
641
|
"font-size": "11",
|
|
631
642
|
fill: "var(--spark-no-data)"
|
|
632
643
|
}, "no data", -1)
|
|
633
|
-
])], 8,
|
|
644
|
+
])], 8, Et));
|
|
634
645
|
}
|
|
635
|
-
}),
|
|
646
|
+
}), Gt = /* @__PURE__ */ N(zt, [["__scopeId", "data-v-a9b85847"]]), Ht = {
|
|
636
647
|
key: 0,
|
|
637
648
|
class: "dim"
|
|
638
|
-
},
|
|
649
|
+
}, jt = ["viewBox"], Wt = ["d", "fill"], qt = ["points", "stroke"], Xt = ["x", "y", "text-anchor"], Zt = {
|
|
639
650
|
fill: "var(--muted)",
|
|
640
651
|
"font-weight": "400"
|
|
641
|
-
},
|
|
652
|
+
}, Jt = /* @__PURE__ */ F({
|
|
642
653
|
__name: "MarketsDonut",
|
|
643
654
|
props: {
|
|
644
655
|
markets: {},
|
|
@@ -646,8 +657,8 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
646
657
|
height: { default: 280 }
|
|
647
658
|
},
|
|
648
659
|
setup(e) {
|
|
649
|
-
const t = e, a =
|
|
650
|
-
return (s, c) => a.value ? (
|
|
660
|
+
const t = e, a = $(() => !t.markets || t.markets.length === 0), n = $(() => Vt(t.markets, t.width, t.height));
|
|
661
|
+
return (s, c) => a.value ? (g(), M("span", Ht, "no market data")) : (g(), M("svg", {
|
|
651
662
|
key: 1,
|
|
652
663
|
class: "pelican-donut",
|
|
653
664
|
viewBox: `0 0 ${n.value.width} ${n.value.height}`,
|
|
@@ -657,27 +668,27 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
657
668
|
"aria-label": "Markets donut chart"
|
|
658
669
|
}, [
|
|
659
670
|
i("g", null, [
|
|
660
|
-
(
|
|
671
|
+
(g(!0), M(D, null, Y(n.value.slices, (l) => (g(), M("path", {
|
|
661
672
|
key: l.marketName + l.fraction,
|
|
662
673
|
d: l.arcPath,
|
|
663
674
|
fill: l.color,
|
|
664
675
|
stroke: "var(--card)",
|
|
665
676
|
"stroke-width": "1.5"
|
|
666
|
-
}, null, 8,
|
|
677
|
+
}, null, 8, Wt))), 128))
|
|
667
678
|
]),
|
|
668
679
|
i("g", null, [
|
|
669
|
-
(
|
|
680
|
+
(g(!0), M(D, null, Y(n.value.slices, (l) => ye((g(), M("polyline", {
|
|
670
681
|
key: `l-${l.marketName}`,
|
|
671
682
|
points: l.labelLine ?? "",
|
|
672
683
|
stroke: l.color,
|
|
673
684
|
"stroke-width": "1",
|
|
674
685
|
fill: "none"
|
|
675
|
-
}, null, 8,
|
|
676
|
-
[
|
|
686
|
+
}, null, 8, qt)), [
|
|
687
|
+
[Me, l.labelLine]
|
|
677
688
|
])), 128))
|
|
678
689
|
]),
|
|
679
690
|
i("g", null, [
|
|
680
|
-
(
|
|
691
|
+
(g(!0), M(D, null, Y(n.value.slices, (l) => ye((g(), M("text", {
|
|
681
692
|
key: `t-${l.marketName}`,
|
|
682
693
|
x: l.labelX,
|
|
683
694
|
y: l.labelY,
|
|
@@ -686,24 +697,24 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
686
697
|
fill: "var(--text)",
|
|
687
698
|
"font-weight": "500"
|
|
688
699
|
}, [
|
|
689
|
-
|
|
690
|
-
i("tspan",
|
|
691
|
-
], 8,
|
|
692
|
-
[
|
|
700
|
+
L(b(l.marketName) + " ", 1),
|
|
701
|
+
i("tspan", Zt, b(l.count), 1)
|
|
702
|
+
], 8, Xt)), [
|
|
703
|
+
[Me, l.labelLine]
|
|
693
704
|
])), 128))
|
|
694
705
|
])
|
|
695
|
-
], 8,
|
|
706
|
+
], 8, jt));
|
|
696
707
|
}
|
|
697
|
-
}),
|
|
708
|
+
}), Qt = /* @__PURE__ */ N(Jt, [["__scopeId", "data-v-c514d53f"]]), ea = { class: "pelican-trades" }, ta = { class: "hd" }, aa = {
|
|
698
709
|
key: 0,
|
|
699
710
|
class: "dim"
|
|
700
|
-
},
|
|
711
|
+
}, na = {
|
|
701
712
|
key: 1,
|
|
702
713
|
class: "dim"
|
|
703
|
-
},
|
|
714
|
+
}, la = {
|
|
704
715
|
key: 2,
|
|
705
716
|
class: "list"
|
|
706
|
-
},
|
|
717
|
+
}, sa = { class: "market" }, oa = { class: "trade-time" }, ia = /* @__PURE__ */ F({
|
|
707
718
|
__name: "TradesPanel",
|
|
708
719
|
props: {
|
|
709
720
|
kind: {},
|
|
@@ -712,67 +723,67 @@ const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2",
|
|
|
712
723
|
locale: {}
|
|
713
724
|
},
|
|
714
725
|
setup(e) {
|
|
715
|
-
const t = e, a =
|
|
726
|
+
const t = e, a = $(() => t.kind === "open" ? "Open Trades" : "Trade History (30d)"), n = $(
|
|
716
727
|
() => !t.loading && (t.trades == null || t.trades.length === 0)
|
|
717
728
|
);
|
|
718
|
-
return (s, c) => (
|
|
719
|
-
i("div",
|
|
720
|
-
e.loading ? (
|
|
721
|
-
(
|
|
722
|
-
i("span",
|
|
729
|
+
return (s, c) => (g(), M("div", ea, [
|
|
730
|
+
i("div", ta, b(a.value), 1),
|
|
731
|
+
e.loading ? (g(), M("div", aa, "Loading…")) : n.value ? (g(), M("div", na, "No trades.")) : (g(), M("ul", la, [
|
|
732
|
+
(g(!0), M(D, null, Y(e.trades ?? [], (l, o) => (g(), M("li", { key: o }, [
|
|
733
|
+
i("span", sa, b(l.MarketName ?? "—"), 1),
|
|
723
734
|
i("span", {
|
|
724
735
|
class: B(["dir", l.Direction === "Sell" ? "red" : "green"])
|
|
725
736
|
}, b(l.Direction ?? ""), 3),
|
|
726
|
-
i("span",
|
|
727
|
-
|
|
728
|
-
l.CloseTimestamp ? (
|
|
729
|
-
|
|
730
|
-
], 64)) :
|
|
737
|
+
i("span", oa, [
|
|
738
|
+
L(b(p(Ie)(l.OpenTimestamp, e.locale)) + " ", 1),
|
|
739
|
+
l.CloseTimestamp ? (g(), M(D, { key: 0 }, [
|
|
740
|
+
L(" → " + b(p(Ie)(l.CloseTimestamp, e.locale)), 1)
|
|
741
|
+
], 64)) : K("", !0)
|
|
731
742
|
]),
|
|
732
|
-
l.Pnl != null ? (
|
|
743
|
+
l.Pnl != null ? (g(), M("span", {
|
|
733
744
|
key: 0,
|
|
734
745
|
class: B(["pnl", l.Pnl >= 0 ? "green" : "red"])
|
|
735
|
-
}, b(
|
|
746
|
+
}, b(p(j)(l.Pnl, e.locale)), 3)) : K("", !0)
|
|
736
747
|
]))), 128))
|
|
737
748
|
]))
|
|
738
749
|
]));
|
|
739
750
|
}
|
|
740
|
-
}),
|
|
741
|
-
function
|
|
751
|
+
}), Re = /* @__PURE__ */ N(ia, [["__scopeId", "data-v-aa7cbcd7"]]);
|
|
752
|
+
function q(e) {
|
|
742
753
|
const t = e.Wins ?? 0, a = e.Losses ?? 0, n = t + a;
|
|
743
754
|
return n ? t / n * 100 : -1;
|
|
744
755
|
}
|
|
745
|
-
const
|
|
756
|
+
const ra = Symbol("pelican.apiBase"), ua = Symbol("pelican.catalogBase"), Ae = Symbol("pelican.locale"), ca = ["data-id"], da = { class: "name" }, ma = { class: "avatar" }, fa = { class: "avatar-fallback" }, va = ["src"], pa = { class: "nm" }, ga = { class: "title" }, ha = {
|
|
746
757
|
key: 0,
|
|
747
758
|
class: "free-badge"
|
|
748
|
-
},
|
|
759
|
+
}, ya = { class: "by" }, Ma = {
|
|
749
760
|
class: "c-spark",
|
|
750
761
|
"data-label": "Equity curve"
|
|
751
|
-
},
|
|
762
|
+
}, ba = {
|
|
752
763
|
class: "c-num",
|
|
753
764
|
"data-label": "Return"
|
|
754
|
-
},
|
|
765
|
+
}, xa = { key: 1 }, wa = {
|
|
755
766
|
class: "c-num",
|
|
756
767
|
"data-label": "Copiers"
|
|
757
|
-
},
|
|
768
|
+
}, $a = {
|
|
758
769
|
class: "c-num",
|
|
759
770
|
"data-label": "Copiers AUM"
|
|
760
|
-
},
|
|
771
|
+
}, ka = {
|
|
761
772
|
class: "c-num",
|
|
762
773
|
"data-label": "Max DD"
|
|
763
|
-
},
|
|
774
|
+
}, Ia = { key: 1 }, _a = {
|
|
764
775
|
class: "c-num",
|
|
765
776
|
"data-label": "Age"
|
|
766
|
-
},
|
|
777
|
+
}, Sa = {
|
|
767
778
|
class: "c-num",
|
|
768
779
|
"data-label": "Balance"
|
|
769
|
-
},
|
|
780
|
+
}, Ra = {
|
|
770
781
|
class: "c-num",
|
|
771
782
|
"data-label": "Fee"
|
|
772
|
-
},
|
|
783
|
+
}, Pa = ["href"], Ca = { class: "grid" }, Ta = { class: "col-stats" }, Aa = { class: "field" }, Fa = { class: "value" }, Na = { class: "field" }, La = { class: "value" }, Da = { class: "field" }, Ua = { class: "value" }, Va = { class: "field" }, Ea = { class: "value" }, Ba = { class: "field" }, Oa = { class: "value" }, Ka = { class: "field" }, Ya = { class: "value" }, za = { class: "field" }, Ga = { class: "value" }, Ha = { class: "field" }, ja = { class: "value" }, Wa = { key: 0 }, qa = {
|
|
773
784
|
key: 1,
|
|
774
785
|
class: "dim"
|
|
775
|
-
},
|
|
786
|
+
}, Xa = { class: "col-donut" }, Za = { class: "trade-toggles" }, Ja = /* @__PURE__ */ F({
|
|
776
787
|
__name: "StrategyRow",
|
|
777
788
|
props: {
|
|
778
789
|
s: {},
|
|
@@ -782,172 +793,172 @@ const ua = Symbol("pelican.apiBase"), ca = Symbol("pelican.catalogBase"), Te = S
|
|
|
782
793
|
},
|
|
783
794
|
emits: ["toggle", "load-trades", "select"],
|
|
784
795
|
setup(e, { emit: t }) {
|
|
785
|
-
const a = e, n = t, s = Ue(
|
|
796
|
+
const a = e, n = t, s = Ue(Ae, "en-US"), c = $(() => we(a.s.Return, 1)), l = $(() => a.s.MaxDD != null ? we(a.s.MaxDD, 2) : null), o = $(() => W(a.s.Inception)), r = $(() => q(a.s)), m = $(() => r.value >= 0 ? 100 - r.value : -1), h = $(
|
|
786
797
|
() => {
|
|
787
|
-
var _,
|
|
788
|
-
return ((_ = a.s.Profile) == null ? void 0 : _.Name) ?? ((
|
|
798
|
+
var _, f;
|
|
799
|
+
return ((_ = a.s.Profile) == null ? void 0 : _.Name) ?? ((f = a.s.Profile) != null && f.Id ? "#" + a.s.Profile.Id : "");
|
|
789
800
|
}
|
|
790
|
-
),
|
|
791
|
-
function
|
|
801
|
+
), v = $(() => `https://libertex.copy-trade.io/strategy/${a.s.Id}`), d = P(!1), u = P(!1);
|
|
802
|
+
function I() {
|
|
792
803
|
d.value = !d.value, d.value && !a.openTrades && n("load-trades", "open");
|
|
793
804
|
}
|
|
794
|
-
function
|
|
795
|
-
|
|
805
|
+
function k() {
|
|
806
|
+
u.value = !u.value, u.value && !a.closedTrades && n("load-trades", "closed");
|
|
796
807
|
}
|
|
797
|
-
return (_,
|
|
798
|
-
var
|
|
799
|
-
return
|
|
808
|
+
return (_, f) => {
|
|
809
|
+
var R, A, S, x;
|
|
810
|
+
return g(), M(D, null, [
|
|
800
811
|
i("div", {
|
|
801
812
|
class: B(["pelican-row", { open: e.expanded }]),
|
|
802
813
|
"data-id": e.s.Id,
|
|
803
|
-
onClick:
|
|
814
|
+
onClick: f[3] || (f[3] = (w) => n("toggle"))
|
|
804
815
|
}, [
|
|
805
|
-
i("div",
|
|
806
|
-
i("div",
|
|
807
|
-
i("span",
|
|
808
|
-
e.s.ImageUploaded ? (
|
|
816
|
+
i("div", da, [
|
|
817
|
+
i("div", ma, [
|
|
818
|
+
i("span", fa, b(p(St)(e.s.Name)), 1),
|
|
819
|
+
e.s.ImageUploaded ? (g(), M("img", {
|
|
809
820
|
key: 0,
|
|
810
821
|
class: "avatar-img",
|
|
811
822
|
src: `https://assets.copy-trade.io/images/strategies/thumbnails/${e.s.Id}`,
|
|
812
823
|
alt: "",
|
|
813
824
|
loading: "lazy",
|
|
814
825
|
decoding: "async",
|
|
815
|
-
onError:
|
|
816
|
-
}, null, 40,
|
|
826
|
+
onError: f[0] || (f[0] = (w) => w.target.remove())
|
|
827
|
+
}, null, 40, va)) : K("", !0)
|
|
817
828
|
]),
|
|
818
|
-
i("div",
|
|
819
|
-
i("div",
|
|
820
|
-
|
|
821
|
-
e.s._meta && e.s.Fee == null ? (
|
|
829
|
+
i("div", pa, [
|
|
830
|
+
i("div", ga, [
|
|
831
|
+
L(b(e.s.Name || "#" + e.s.Id) + " ", 1),
|
|
832
|
+
e.s._meta && e.s.Fee == null ? (g(), M("span", ha, "free")) : K("", !0)
|
|
822
833
|
]),
|
|
823
|
-
i("div",
|
|
834
|
+
i("div", ya, b(h.value), 1)
|
|
824
835
|
])
|
|
825
836
|
]),
|
|
826
|
-
i("div",
|
|
827
|
-
|
|
837
|
+
i("div", Ma, [
|
|
838
|
+
T(Gt, {
|
|
828
839
|
history: e.s.History
|
|
829
840
|
}, null, 8, ["history"])
|
|
830
841
|
]),
|
|
831
|
-
i("div",
|
|
832
|
-
c.value ? (
|
|
842
|
+
i("div", ba, [
|
|
843
|
+
c.value ? (g(), M("span", {
|
|
833
844
|
key: 0,
|
|
834
845
|
class: B(c.value.positive ? "green" : "red")
|
|
835
|
-
}, b(c.value.text), 3)) : (
|
|
846
|
+
}, b(c.value.text), 3)) : (g(), M("span", xa, "—"))
|
|
836
847
|
]),
|
|
837
|
-
i("div",
|
|
838
|
-
i("div",
|
|
839
|
-
i("div",
|
|
840
|
-
l.value ? (
|
|
848
|
+
i("div", wa, b(p(ke)(e.s.NumCopiers, p(s))), 1),
|
|
849
|
+
i("div", $a, b(p($e)(e.s.CopiersAUM, p(s))), 1),
|
|
850
|
+
i("div", ka, [
|
|
851
|
+
l.value ? (g(), M("span", {
|
|
841
852
|
key: 0,
|
|
842
853
|
class: B(l.value.positive ? "green" : "red")
|
|
843
|
-
}, b(l.value.text), 3)) : (
|
|
854
|
+
}, b(l.value.text), 3)) : (g(), M("span", Ia, "—"))
|
|
844
855
|
]),
|
|
845
|
-
i("div",
|
|
846
|
-
i("div",
|
|
847
|
-
i("div",
|
|
856
|
+
i("div", _a, b(p(It)(o.value)), 1),
|
|
857
|
+
i("div", Sa, b(p($e)(e.s.AccountBalance, p(s))), 1),
|
|
858
|
+
i("div", Ra, b(p(kt)(e.s)), 1),
|
|
848
859
|
i("div", {
|
|
849
860
|
class: "c-link",
|
|
850
|
-
onClick:
|
|
861
|
+
onClick: f[2] || (f[2] = ne(() => {
|
|
851
862
|
}, ["stop"]))
|
|
852
863
|
}, [
|
|
853
864
|
i("a", {
|
|
854
865
|
class: "signal-link",
|
|
855
|
-
href:
|
|
866
|
+
href: v.value,
|
|
856
867
|
target: "_blank",
|
|
857
868
|
rel: "noopener",
|
|
858
|
-
onClick:
|
|
869
|
+
onClick: f[1] || (f[1] = ne(() => {
|
|
859
870
|
}, ["stop"]))
|
|
860
|
-
}, " Get connected ", 8,
|
|
861
|
-
|
|
871
|
+
}, " Get connected ", 8, Pa),
|
|
872
|
+
X(_.$slots, "row-actions", { strategy: e.s }, void 0, !0)
|
|
862
873
|
])
|
|
863
|
-
], 10,
|
|
864
|
-
e.expanded ? (
|
|
874
|
+
], 10, ca),
|
|
875
|
+
e.expanded ? (g(), M("div", {
|
|
865
876
|
key: 0,
|
|
866
877
|
class: "pelican-row-expanded",
|
|
867
|
-
onClick:
|
|
878
|
+
onClick: f[4] || (f[4] = ne(() => {
|
|
868
879
|
}, ["stop"]))
|
|
869
880
|
}, [
|
|
870
|
-
i("div",
|
|
871
|
-
i("div",
|
|
872
|
-
i("div",
|
|
873
|
-
|
|
874
|
-
i("div",
|
|
881
|
+
i("div", Ca, [
|
|
882
|
+
i("div", Ta, [
|
|
883
|
+
i("div", Aa, [
|
|
884
|
+
f[5] || (f[5] = i("div", { class: "label" }, "Currency", -1)),
|
|
885
|
+
i("div", Fa, b(e.s.Currency ?? "USD"), 1)
|
|
875
886
|
]),
|
|
876
|
-
i("div",
|
|
877
|
-
|
|
878
|
-
i("div",
|
|
887
|
+
i("div", Na, [
|
|
888
|
+
f[6] || (f[6] = i("div", { class: "label" }, "Monthly profit", -1)),
|
|
889
|
+
i("div", La, b(p(j)(e.s.MonthlyProfit, p(s))), 1)
|
|
879
890
|
]),
|
|
880
|
-
i("div",
|
|
881
|
-
|
|
882
|
-
i("div",
|
|
891
|
+
i("div", Da, [
|
|
892
|
+
f[7] || (f[7] = i("div", { class: "label" }, "Yearly profit", -1)),
|
|
893
|
+
i("div", Ua, b(p(j)(e.s.YearlyProfit, p(s))), 1)
|
|
883
894
|
]),
|
|
884
|
-
i("div",
|
|
885
|
-
|
|
886
|
-
i("div",
|
|
895
|
+
i("div", Va, [
|
|
896
|
+
f[8] || (f[8] = i("div", { class: "label" }, "Balance", -1)),
|
|
897
|
+
i("div", Ea, b(p(j)(e.s.AccountBalance, p(s))), 1)
|
|
887
898
|
]),
|
|
888
|
-
i("div",
|
|
889
|
-
|
|
890
|
-
i("div",
|
|
899
|
+
i("div", Ba, [
|
|
900
|
+
f[9] || (f[9] = i("div", { class: "label" }, "Realized P/L", -1)),
|
|
901
|
+
i("div", Oa, b(p(j)(e.s.RealisedPnl, p(s))), 1)
|
|
891
902
|
]),
|
|
892
|
-
i("div",
|
|
893
|
-
|
|
894
|
-
i("div",
|
|
903
|
+
i("div", Ka, [
|
|
904
|
+
f[10] || (f[10] = i("div", { class: "label" }, "Unrealized P/L", -1)),
|
|
905
|
+
i("div", Ya, b(p(j)(e.s.UnrealisedPnl, p(s))), 1)
|
|
895
906
|
]),
|
|
896
|
-
i("div",
|
|
897
|
-
|
|
898
|
-
i("div",
|
|
907
|
+
i("div", za, [
|
|
908
|
+
f[11] || (f[11] = i("div", { class: "label" }, "Trades total", -1)),
|
|
909
|
+
i("div", Ga, b(p(ke)(e.s.TradesTotal, p(s))), 1)
|
|
899
910
|
]),
|
|
900
|
-
i("div",
|
|
901
|
-
|
|
902
|
-
i("div",
|
|
903
|
-
|
|
911
|
+
i("div", Ha, [
|
|
912
|
+
f[12] || (f[12] = i("div", { class: "label" }, "Win rate", -1)),
|
|
913
|
+
i("div", ja, [
|
|
914
|
+
r.value >= 0 ? (g(), M("span", Wa, b(r.value.toFixed(1)) + "% / " + b(m.value.toFixed(1)) + "%", 1)) : (g(), M("span", qa, "—"))
|
|
904
915
|
])
|
|
905
916
|
])
|
|
906
917
|
]),
|
|
907
|
-
i("div",
|
|
908
|
-
|
|
909
|
-
|
|
918
|
+
i("div", Xa, [
|
|
919
|
+
f[13] || (f[13] = i("div", { class: "hd" }, "Markets", -1)),
|
|
920
|
+
T(Qt, {
|
|
910
921
|
markets: e.s.Markets
|
|
911
922
|
}, null, 8, ["markets"])
|
|
912
923
|
])
|
|
913
924
|
]),
|
|
914
|
-
i("div",
|
|
925
|
+
i("div", Za, [
|
|
915
926
|
i("button", {
|
|
916
927
|
class: B(["pill", { on: d.value }]),
|
|
917
928
|
type: "button",
|
|
918
|
-
onClick:
|
|
929
|
+
onClick: I
|
|
919
930
|
}, b(d.value ? "Hide" : "Open Trades"), 3),
|
|
920
931
|
i("button", {
|
|
921
|
-
class: B(["pill", { on:
|
|
932
|
+
class: B(["pill", { on: u.value }]),
|
|
922
933
|
type: "button",
|
|
923
|
-
onClick:
|
|
924
|
-
}, b(
|
|
934
|
+
onClick: k
|
|
935
|
+
}, b(u.value ? "Hide" : "Trade History"), 3)
|
|
925
936
|
]),
|
|
926
|
-
d.value ? (
|
|
937
|
+
d.value ? (g(), ue(Re, {
|
|
927
938
|
key: 0,
|
|
928
939
|
kind: "open",
|
|
929
|
-
trades: ((
|
|
930
|
-
loading: !!((
|
|
931
|
-
locale:
|
|
932
|
-
}, null, 8, ["trades", "loading", "locale"])) :
|
|
933
|
-
|
|
940
|
+
trades: ((R = e.openTrades) == null ? void 0 : R.trades) ?? null,
|
|
941
|
+
loading: !!((A = e.openTrades) != null && A.loading),
|
|
942
|
+
locale: p(s)
|
|
943
|
+
}, null, 8, ["trades", "loading", "locale"])) : K("", !0),
|
|
944
|
+
u.value ? (g(), ue(Re, {
|
|
934
945
|
key: 1,
|
|
935
946
|
kind: "closed",
|
|
936
947
|
trades: ((S = e.closedTrades) == null ? void 0 : S.trades) ?? null,
|
|
937
948
|
loading: !!((x = e.closedTrades) != null && x.loading),
|
|
938
|
-
locale:
|
|
939
|
-
}, null, 8, ["trades", "loading", "locale"])) :
|
|
940
|
-
])) :
|
|
949
|
+
locale: p(s)
|
|
950
|
+
}, null, 8, ["trades", "loading", "locale"])) : K("", !0)
|
|
951
|
+
])) : K("", !0)
|
|
941
952
|
], 64);
|
|
942
953
|
};
|
|
943
954
|
}
|
|
944
|
-
}),
|
|
955
|
+
}), Qa = /* @__PURE__ */ N(Ja, [["__scopeId", "data-v-61c1236b"]]), en = {
|
|
945
956
|
key: 0,
|
|
946
957
|
class: "pelican-pager"
|
|
947
|
-
},
|
|
958
|
+
}, tn = ["disabled"], an = {
|
|
948
959
|
key: 0,
|
|
949
960
|
class: "gap"
|
|
950
|
-
},
|
|
961
|
+
}, nn = ["onClick"], ln = ["disabled"], sn = { class: "info" }, on = ["max", "value"], rn = /* @__PURE__ */ F({
|
|
951
962
|
__name: "Pager",
|
|
952
963
|
props: {
|
|
953
964
|
page: {},
|
|
@@ -964,38 +975,38 @@ const ua = Symbol("pelican.apiBase"), ca = Symbol("pelican.catalogBase"), Te = S
|
|
|
964
975
|
const o = parseInt(l.target.value, 10);
|
|
965
976
|
isNaN(o) || n("go", o);
|
|
966
977
|
}
|
|
967
|
-
return (l, o) => a.totalPages > 1 ? (
|
|
978
|
+
return (l, o) => a.totalPages > 1 ? (g(), M("nav", en, [
|
|
968
979
|
i("button", {
|
|
969
980
|
disabled: e.page <= 1,
|
|
970
|
-
onClick: o[0] || (o[0] = (
|
|
971
|
-
}, "‹ prev", 8,
|
|
972
|
-
(
|
|
973
|
-
|
|
981
|
+
onClick: o[0] || (o[0] = (r) => s("prev"))
|
|
982
|
+
}, "‹ prev", 8, tn),
|
|
983
|
+
(g(!0), M(D, null, Y(e.range, (r, m) => (g(), M(D, { key: m }, [
|
|
984
|
+
r === "…" ? (g(), M("span", an, "…")) : (g(), M("button", {
|
|
974
985
|
key: 1,
|
|
975
|
-
class: B(["page", { cur:
|
|
976
|
-
onClick: (
|
|
977
|
-
}, b(
|
|
986
|
+
class: B(["page", { cur: r === e.page }]),
|
|
987
|
+
onClick: (h) => s(r)
|
|
988
|
+
}, b(r), 11, nn))
|
|
978
989
|
], 64))), 128)),
|
|
979
990
|
i("button", {
|
|
980
991
|
disabled: e.page >= e.totalPages,
|
|
981
|
-
onClick: o[1] || (o[1] = (
|
|
982
|
-
}, "next ›", 8,
|
|
983
|
-
i("span",
|
|
984
|
-
o[2] || (o[2] =
|
|
992
|
+
onClick: o[1] || (o[1] = (r) => s("next"))
|
|
993
|
+
}, "next ›", 8, ln),
|
|
994
|
+
i("span", sn, [
|
|
995
|
+
o[2] || (o[2] = L(" go to ", -1)),
|
|
985
996
|
i("input", {
|
|
986
997
|
type: "number",
|
|
987
998
|
min: 1,
|
|
988
999
|
max: e.totalPages,
|
|
989
1000
|
value: e.page,
|
|
990
1001
|
onChange: c
|
|
991
|
-
}, null, 40,
|
|
1002
|
+
}, null, 40, on)
|
|
992
1003
|
])
|
|
993
|
-
])) :
|
|
1004
|
+
])) : K("", !0);
|
|
994
1005
|
}
|
|
995
|
-
}),
|
|
1006
|
+
}), un = /* @__PURE__ */ N(rn, [["__scopeId", "data-v-42928155"]]), cn = { class: "pelican-table" }, dn = { class: "row head" }, mn = ["onClick"], fn = {
|
|
996
1007
|
key: 0,
|
|
997
1008
|
class: "empty"
|
|
998
|
-
},
|
|
1009
|
+
}, vn = /* @__PURE__ */ F({
|
|
999
1010
|
__name: "StrategyTable",
|
|
1000
1011
|
props: {
|
|
1001
1012
|
pageItems: {},
|
|
@@ -1021,48 +1032,48 @@ const ua = Symbol("pelican.apiBase"), ca = Symbol("pelican.catalogBase"), Te = S
|
|
|
1021
1032
|
function c(l) {
|
|
1022
1033
|
return a.sortKey === `${l}-asc` ? "active-asc" : a.sortKey === `${l}-desc` ? "active-desc" : "";
|
|
1023
1034
|
}
|
|
1024
|
-
return (l, o) => (
|
|
1025
|
-
i("div",
|
|
1035
|
+
return (l, o) => (g(), M("section", cn, [
|
|
1036
|
+
i("div", dn, [
|
|
1026
1037
|
o[1] || (o[1] = i("div", null, "Name", -1)),
|
|
1027
1038
|
o[2] || (o[2] = i("div", null, "Equity curve", -1)),
|
|
1028
|
-
(
|
|
1029
|
-
key:
|
|
1030
|
-
class: B(["c-num sortable", c(
|
|
1031
|
-
onClick: (m) => n("toggle-sort",
|
|
1032
|
-
}, b(
|
|
1039
|
+
(g(), M(D, null, Y(s, (r) => i("div", {
|
|
1040
|
+
key: r.key,
|
|
1041
|
+
class: B(["c-num sortable", c(r.key)]),
|
|
1042
|
+
onClick: (m) => n("toggle-sort", r.key)
|
|
1043
|
+
}, b(r.label), 11, mn)), 64)),
|
|
1033
1044
|
o[3] || (o[3] = i("div", null, null, -1))
|
|
1034
1045
|
]),
|
|
1035
|
-
e.pageItems.length === 0 ? (
|
|
1036
|
-
|
|
1037
|
-
o[4] || (o[4] =
|
|
1046
|
+
e.pageItems.length === 0 ? (g(), M("div", fn, [
|
|
1047
|
+
X(l.$slots, "empty", {}, () => [
|
|
1048
|
+
o[4] || (o[4] = L("No matches.", -1))
|
|
1038
1049
|
], !0)
|
|
1039
|
-
])) : (
|
|
1040
|
-
key:
|
|
1041
|
-
s:
|
|
1042
|
-
expanded: e.expanded.has(
|
|
1043
|
-
"open-trades": e.openSignals.get(
|
|
1044
|
-
"closed-trades": e.closedSignals.get(
|
|
1045
|
-
onToggle: (m) => n("toggle-row",
|
|
1046
|
-
onLoadTrades: (m) => n("load-trades", { id:
|
|
1047
|
-
onSelect: (m) => n("select",
|
|
1050
|
+
])) : (g(!0), M(D, { key: 1 }, Y(e.pageItems, (r) => (g(), ue(Qa, {
|
|
1051
|
+
key: r.Id,
|
|
1052
|
+
s: r,
|
|
1053
|
+
expanded: e.expanded.has(r.Id),
|
|
1054
|
+
"open-trades": e.openSignals.get(r.Id) ?? null,
|
|
1055
|
+
"closed-trades": e.closedSignals.get(r.Id) ?? null,
|
|
1056
|
+
onToggle: (m) => n("toggle-row", r.Id),
|
|
1057
|
+
onLoadTrades: (m) => n("load-trades", { id: r.Id, kind: m }),
|
|
1058
|
+
onSelect: (m) => n("select", r)
|
|
1048
1059
|
}, {
|
|
1049
|
-
"row-actions":
|
|
1050
|
-
|
|
1060
|
+
"row-actions": ce((m) => [
|
|
1061
|
+
X(l.$slots, "row-actions", Ve({ ref_for: !0 }, m), void 0, !0)
|
|
1051
1062
|
]),
|
|
1052
1063
|
_: 3
|
|
1053
1064
|
}, 8, ["s", "expanded", "open-trades", "closed-trades", "onToggle", "onLoadTrades", "onSelect"]))), 128)),
|
|
1054
|
-
|
|
1065
|
+
T(un, {
|
|
1055
1066
|
page: e.page,
|
|
1056
1067
|
"total-pages": e.totalPages,
|
|
1057
1068
|
range: e.pageRange,
|
|
1058
|
-
onGo: o[0] || (o[0] = (
|
|
1069
|
+
onGo: o[0] || (o[0] = (r) => n("go", r))
|
|
1059
1070
|
}, null, 8, ["page", "total-pages", "range"])
|
|
1060
1071
|
]));
|
|
1061
1072
|
}
|
|
1062
|
-
}),
|
|
1073
|
+
}), pn = /* @__PURE__ */ N(vn, [["__scopeId", "data-v-c61b9ce8"]]), gn = {
|
|
1063
1074
|
key: 0,
|
|
1064
1075
|
class: "pelican-progress"
|
|
1065
|
-
},
|
|
1076
|
+
}, hn = { class: "bar" }, yn = { class: "caption" }, Mn = { class: "hint" }, bn = /* @__PURE__ */ F({
|
|
1066
1077
|
__name: "ProgressBar",
|
|
1067
1078
|
props: {
|
|
1068
1079
|
loaded: {},
|
|
@@ -1070,185 +1081,186 @@ const ua = Symbol("pelican.apiBase"), ca = Symbol("pelican.catalogBase"), Te = S
|
|
|
1070
1081
|
active: { type: Boolean }
|
|
1071
1082
|
},
|
|
1072
1083
|
setup(e) {
|
|
1073
|
-
const t = e, a =
|
|
1084
|
+
const t = e, a = $(
|
|
1074
1085
|
() => t.total > 0 ? Math.min(100, t.loaded / t.total * 100) : 0
|
|
1075
1086
|
);
|
|
1076
|
-
return (n, s) => e.active ? (
|
|
1077
|
-
i("div",
|
|
1087
|
+
return (n, s) => e.active ? (g(), M("div", gn, [
|
|
1088
|
+
i("div", hn, [
|
|
1078
1089
|
i("span", {
|
|
1079
|
-
style:
|
|
1090
|
+
style: Q({ width: a.value.toFixed(1) + "%" })
|
|
1080
1091
|
}, null, 4)
|
|
1081
1092
|
]),
|
|
1082
|
-
i("div",
|
|
1083
|
-
s[0] || (s[0] =
|
|
1093
|
+
i("div", yn, [
|
|
1094
|
+
s[0] || (s[0] = L(" Building full catalog: ", -1)),
|
|
1084
1095
|
i("b", null, b(e.loaded.toLocaleString("en-US")), 1),
|
|
1085
|
-
|
|
1096
|
+
L(" / " + b(e.total.toLocaleString("en-US")) + " strategies (" + b(a.value.toFixed(0)) + "%) · ", 1),
|
|
1086
1097
|
s[1] || (s[1] = i("i", null, "upstream rate-limited", -1))
|
|
1087
1098
|
]),
|
|
1088
|
-
i("div",
|
|
1089
|
-
])) :
|
|
1099
|
+
i("div", Mn, " All " + b(e.total.toLocaleString("en-US")) + " strategies are visible. Stats fill in as the build progresses; refresh of data every 20 sec. ", 1)
|
|
1100
|
+
])) : K("", !0);
|
|
1090
1101
|
}
|
|
1091
|
-
}),
|
|
1092
|
-
function
|
|
1093
|
-
const t =
|
|
1102
|
+
}), xn = /* @__PURE__ */ N(bn, [["__scopeId", "data-v-8767a909"]]), Fe = "pelican-theme";
|
|
1103
|
+
function wn(e = "auto") {
|
|
1104
|
+
const t = $n(), a = P(t ?? e), n = P("dark"), s = typeof window < "u" && window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null, c = () => {
|
|
1094
1105
|
const m = a.value;
|
|
1095
1106
|
n.value = m === "dark" ? "dark" : m === "light" ? "light" : s != null && s.matches ? "dark" : "light";
|
|
1096
1107
|
}, l = () => {
|
|
1097
1108
|
a.value === "auto" && c();
|
|
1098
1109
|
};
|
|
1099
|
-
s && (s.addEventListener ? s.addEventListener("change", l) : s.addListener(l)),
|
|
1110
|
+
s && (s.addEventListener ? s.addEventListener("change", l) : s.addListener(l)), V(a, (m) => {
|
|
1100
1111
|
try {
|
|
1101
|
-
localStorage.setItem(
|
|
1112
|
+
localStorage.setItem(Fe, m);
|
|
1102
1113
|
} catch {
|
|
1103
1114
|
}
|
|
1104
1115
|
c();
|
|
1105
|
-
}), c(),
|
|
1116
|
+
}), c(), fe(() => {
|
|
1106
1117
|
s && (s.removeEventListener ? s.removeEventListener("change", l) : s.removeListener(l));
|
|
1107
1118
|
});
|
|
1108
1119
|
function o(m) {
|
|
1109
1120
|
a.value = m;
|
|
1110
1121
|
}
|
|
1111
|
-
function
|
|
1122
|
+
function r() {
|
|
1112
1123
|
a.value = a.value === "dark" ? "light" : a.value === "light" ? "auto" : "dark";
|
|
1113
1124
|
}
|
|
1114
|
-
return { mode: a, resolved: n, setMode: o, cycle:
|
|
1125
|
+
return { mode: a, resolved: n, setMode: o, cycle: r };
|
|
1115
1126
|
}
|
|
1116
|
-
function
|
|
1127
|
+
function $n() {
|
|
1117
1128
|
try {
|
|
1118
|
-
const e = localStorage.getItem(
|
|
1129
|
+
const e = localStorage.getItem(Fe);
|
|
1119
1130
|
return e === "dark" || e === "light" || e === "auto" ? e : null;
|
|
1120
1131
|
} catch {
|
|
1121
1132
|
return null;
|
|
1122
1133
|
}
|
|
1123
1134
|
}
|
|
1124
|
-
function
|
|
1135
|
+
function J(e, t, a) {
|
|
1125
1136
|
const n = new Error(t);
|
|
1126
1137
|
return n.code = e, a !== void 0 && (n.status = a), n;
|
|
1127
1138
|
}
|
|
1128
|
-
async function
|
|
1129
|
-
const a =
|
|
1139
|
+
async function re(e, t) {
|
|
1140
|
+
const a = ee(t, e);
|
|
1130
1141
|
let n;
|
|
1131
1142
|
try {
|
|
1132
1143
|
n = await fetch(a);
|
|
1133
1144
|
} catch (s) {
|
|
1134
|
-
throw
|
|
1145
|
+
throw J("fetch_failed", s.message ?? "fetch failed");
|
|
1135
1146
|
}
|
|
1136
1147
|
if (n.status === 401 || n.status === 503)
|
|
1137
|
-
throw
|
|
1148
|
+
throw J("no_token", "Proxy has no token yet", n.status);
|
|
1138
1149
|
if (!n.ok) {
|
|
1139
1150
|
const s = await n.text().catch(() => "");
|
|
1140
|
-
throw
|
|
1151
|
+
throw J("http_error", `${n.status}: ${s.slice(0, 120)}`, n.status);
|
|
1141
1152
|
}
|
|
1142
1153
|
return await n.json();
|
|
1143
1154
|
}
|
|
1144
|
-
function
|
|
1155
|
+
function ee(e, t) {
|
|
1145
1156
|
if (!e) return t;
|
|
1146
1157
|
const a = e.endsWith("/") ? e.slice(0, -1) : e, n = t.startsWith("/") ? t : "/" + t;
|
|
1147
1158
|
return a + n;
|
|
1148
1159
|
}
|
|
1149
|
-
function
|
|
1150
|
-
const n = Ee(/* @__PURE__ */ new Map()), s =
|
|
1151
|
-
let
|
|
1152
|
-
const
|
|
1153
|
-
a ? a(
|
|
1160
|
+
function kn({ apiBase: e, catalogBase: t, onError: a }) {
|
|
1161
|
+
const n = Ee(/* @__PURE__ */ new Map()), s = P(!1), c = P(!1), l = P(0), o = P(0), r = P(null), m = $(() => Array.from(n.value.values()));
|
|
1162
|
+
let h = !1;
|
|
1163
|
+
const v = (y) => {
|
|
1164
|
+
a ? a(y) : console.warn("[pelican-vue]", y);
|
|
1154
1165
|
}, d = () => {
|
|
1155
|
-
const
|
|
1156
|
-
return !!
|
|
1157
|
-
},
|
|
1158
|
-
async function
|
|
1166
|
+
const y = t == null ? void 0 : t.value;
|
|
1167
|
+
return !!y && y !== e.value;
|
|
1168
|
+
}, u = () => (t == null ? void 0 : t.value) || e.value;
|
|
1169
|
+
async function I(y) {
|
|
1159
1170
|
try {
|
|
1160
|
-
const
|
|
1161
|
-
o.value =
|
|
1171
|
+
const O = await re(y ? "/api/strategies-full?partial=1" : "/api/strategies-full", u());
|
|
1172
|
+
o.value = O.length;
|
|
1162
1173
|
const z = n.value;
|
|
1163
|
-
for (const
|
|
1164
|
-
|
|
1165
|
-
} catch (
|
|
1166
|
-
|
|
1174
|
+
for (const E of O) z.set(E.Id, { ...z.get(E.Id), ...E });
|
|
1175
|
+
le(n);
|
|
1176
|
+
} catch (C) {
|
|
1177
|
+
v(C);
|
|
1167
1178
|
}
|
|
1168
1179
|
}
|
|
1169
|
-
async function
|
|
1180
|
+
async function k() {
|
|
1170
1181
|
try {
|
|
1171
|
-
const
|
|
1172
|
-
return l.value =
|
|
1173
|
-
} catch (
|
|
1174
|
-
return
|
|
1182
|
+
const y = await re("/api/strategies-full/progress", u());
|
|
1183
|
+
return l.value = y.loaded, o.value = y.total || o.value, c.value = y.building, r.value = y.built_at, y;
|
|
1184
|
+
} catch (y) {
|
|
1185
|
+
return v(y), null;
|
|
1175
1186
|
}
|
|
1176
1187
|
}
|
|
1177
1188
|
async function _() {
|
|
1178
1189
|
if (d()) {
|
|
1179
|
-
await
|
|
1190
|
+
await I(!1), k(), s.value = !0;
|
|
1180
1191
|
return;
|
|
1181
1192
|
}
|
|
1182
|
-
await
|
|
1183
|
-
let
|
|
1184
|
-
for (; !
|
|
1185
|
-
const
|
|
1186
|
-
if (!
|
|
1187
|
-
await
|
|
1193
|
+
await I(!0);
|
|
1194
|
+
let y = Date.now();
|
|
1195
|
+
for (; !h; ) {
|
|
1196
|
+
const C = await k();
|
|
1197
|
+
if (!C) {
|
|
1198
|
+
await Ce(1500);
|
|
1188
1199
|
continue;
|
|
1189
1200
|
}
|
|
1190
|
-
if (
|
|
1191
|
-
Date.now() -
|
|
1201
|
+
if (C.ready) break;
|
|
1202
|
+
Date.now() - y > je && (await I(!0), y = Date.now()), await Ce(He);
|
|
1192
1203
|
}
|
|
1193
|
-
|
|
1204
|
+
h || (await I(!1), s.value = !0);
|
|
1194
1205
|
}
|
|
1195
|
-
const
|
|
1196
|
-
async function
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1206
|
+
const f = /* @__PURE__ */ new Set();
|
|
1207
|
+
async function R(y) {
|
|
1208
|
+
var O;
|
|
1209
|
+
if (f.has(y)) return;
|
|
1210
|
+
const C = n.value.get(y);
|
|
1211
|
+
if (!(C != null && C._enrichAttempted && C._meta && C._stats && ((O = C.History) != null && O.length))) {
|
|
1212
|
+
f.add(y);
|
|
1201
1213
|
try {
|
|
1202
|
-
const [
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
]),
|
|
1206
|
-
|
|
1214
|
+
const [z, E] = await Promise.all([
|
|
1215
|
+
Pe(ee(e.value, `/api/strategies/${y}`)),
|
|
1216
|
+
Pe(ee(e.value, `/api/strategies/${y}/stats`))
|
|
1217
|
+
]), U = n.value, G = U.get(y) ?? { Id: y };
|
|
1218
|
+
In(G, z), _n(G, E), G._enrichAttempted = !0, G.IsEnabled === !1 ? U.delete(y) : U.set(y, G), le(n);
|
|
1207
1219
|
} finally {
|
|
1208
|
-
|
|
1220
|
+
f.delete(y);
|
|
1209
1221
|
}
|
|
1210
1222
|
}
|
|
1211
1223
|
}
|
|
1212
|
-
async function
|
|
1213
|
-
if (!(!
|
|
1224
|
+
async function A(y) {
|
|
1225
|
+
if (!(!y || !s.value))
|
|
1214
1226
|
try {
|
|
1215
|
-
const
|
|
1216
|
-
`/api/strategies?filter=${encodeURIComponent(
|
|
1227
|
+
const C = await re(
|
|
1228
|
+
`/api/strategies?filter=${encodeURIComponent(y)}`,
|
|
1217
1229
|
e.value
|
|
1218
|
-
),
|
|
1219
|
-
let
|
|
1220
|
-
for (const
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
for (const
|
|
1224
|
-
} catch (
|
|
1225
|
-
|
|
1230
|
+
), O = n.value, z = [];
|
|
1231
|
+
let E = 0;
|
|
1232
|
+
for (const U of C)
|
|
1233
|
+
O.has(U.Id) || (O.set(U.Id, { ...U, _stats: !1, _meta: !1 }), z.push(U.Id), E++);
|
|
1234
|
+
E && (o.value += E, le(n));
|
|
1235
|
+
for (const U of z) R(U);
|
|
1236
|
+
} catch (C) {
|
|
1237
|
+
v(C);
|
|
1226
1238
|
}
|
|
1227
1239
|
}
|
|
1228
1240
|
function S() {
|
|
1229
|
-
|
|
1241
|
+
h = !1, _();
|
|
1230
1242
|
}
|
|
1231
1243
|
function x() {
|
|
1232
|
-
|
|
1244
|
+
h = !0;
|
|
1233
1245
|
}
|
|
1234
|
-
async function
|
|
1235
|
-
x(), n.value = /* @__PURE__ */ new Map(), s.value = !1, l.value = 0, o.value = 0,
|
|
1246
|
+
async function w() {
|
|
1247
|
+
x(), n.value = /* @__PURE__ */ new Map(), s.value = !1, l.value = 0, o.value = 0, r.value = null, S();
|
|
1236
1248
|
}
|
|
1237
|
-
return
|
|
1249
|
+
return fe(x), {
|
|
1238
1250
|
catalog: m,
|
|
1239
1251
|
ready: s,
|
|
1240
1252
|
building: c,
|
|
1241
1253
|
loaded: l,
|
|
1242
1254
|
total: o,
|
|
1243
|
-
builtAt:
|
|
1244
|
-
enrichOne:
|
|
1245
|
-
searchExtra:
|
|
1246
|
-
refresh:
|
|
1255
|
+
builtAt: r,
|
|
1256
|
+
enrichOne: R,
|
|
1257
|
+
searchExtra: A,
|
|
1258
|
+
refresh: w,
|
|
1247
1259
|
start: S,
|
|
1248
1260
|
stop: x
|
|
1249
1261
|
};
|
|
1250
1262
|
}
|
|
1251
|
-
async function
|
|
1263
|
+
async function Pe(e) {
|
|
1252
1264
|
try {
|
|
1253
1265
|
const t = await fetch(e);
|
|
1254
1266
|
return t.ok ? await t.json() : null;
|
|
@@ -1256,19 +1268,19 @@ async function Re(e) {
|
|
|
1256
1268
|
return null;
|
|
1257
1269
|
}
|
|
1258
1270
|
}
|
|
1259
|
-
function
|
|
1271
|
+
function In(e, t) {
|
|
1260
1272
|
t && (e.Name = t.Name ?? e.Name, e.NumCopiers = t.NumCopiers ?? null, e.Fee = t.Fee ?? null, e.RiskProfile = t.RiskProfile ?? null, e.IsSimulated = t.IsSimulated ?? !1, t.IsEnabled !== void 0 && (e.IsEnabled = t.IsEnabled), t.ImageUploaded !== void 0 && (e.ImageUploaded = t.ImageUploaded), e.Profile = t.Profile ?? e.Profile, e._meta = !0);
|
|
1261
1273
|
}
|
|
1262
|
-
function
|
|
1263
|
-
var o,
|
|
1274
|
+
function _n(e, t) {
|
|
1275
|
+
var o, r, m, h, v, d;
|
|
1264
1276
|
if (!t) return;
|
|
1265
|
-
const a = ((o = t.Profitability) == null ? void 0 : o.Inception) ?? {}, n = ((
|
|
1266
|
-
e.Inception = t.Inception ?? e.Inception, e.Currency = t.CurrencyCode || "USD", e.Return = a.UnrealisedReturn != null ? a.UnrealisedReturn * 100 : a.RealisedReturn != null ? a.RealisedReturn * 100 : null, e.MaxDD = a.MaxDrawdown != null ? a.MaxDrawdown * 100 : null, e.RealisedPnl = a.RealisedPnl ?? null, e.UnrealisedPnl = a.UnrealisedPnl ?? null, e.History = l, e.TradesTotal = n.Total ?? 0, e.Wins = n.Wins ?? 0, e.Losses = n.Losses ?? 0, e.Markets = Array.isArray(n.Markets) ? n.Markets.slice(0, 12).map((
|
|
1277
|
+
const a = ((o = t.Profitability) == null ? void 0 : o.Inception) ?? {}, n = ((r = t.Trades) == null ? void 0 : r.Inception) ?? {}, s = a.History ?? [], c = s.length > 60 ? Math.ceil(s.length / 60) : 1, l = s.filter((u, I) => I % c === 0 || I === s.length - 1).map((u) => ({ Timestamp: u.Timestamp, AccountReturn: u.AccountReturn }));
|
|
1278
|
+
e.Inception = t.Inception ?? e.Inception, e.Currency = t.CurrencyCode || "USD", e.Return = a.UnrealisedReturn != null ? a.UnrealisedReturn * 100 : a.RealisedReturn != null ? a.RealisedReturn * 100 : null, e.MaxDD = a.MaxDrawdown != null ? a.MaxDrawdown * 100 : null, e.RealisedPnl = a.RealisedPnl ?? null, e.UnrealisedPnl = a.UnrealisedPnl ?? null, e.History = l, e.TradesTotal = n.Total ?? 0, e.Wins = n.Wins ?? 0, e.Losses = n.Losses ?? 0, e.Markets = Array.isArray(n.Markets) ? n.Markets.slice(0, 12).map((u) => ({ n: u.MarketName, c: u.Count })) : [], e.AccountBalance = ((m = t.Status) == null ? void 0 : m.Balance) ?? null, e.CopiersAUM = ((h = t.CopiersBalance) == null ? void 0 : h.Balance) ?? null, e.MonthlyProfit = ((v = t.CopiersProfit) == null ? void 0 : v.Month) ?? null, e.YearlyProfit = ((d = t.CopiersProfit) == null ? void 0 : d.Year) ?? null, e._stats = !0;
|
|
1267
1279
|
}
|
|
1268
|
-
function
|
|
1280
|
+
function Ce(e) {
|
|
1269
1281
|
return new Promise((t) => setTimeout(t, e));
|
|
1270
1282
|
}
|
|
1271
|
-
function
|
|
1283
|
+
function me() {
|
|
1272
1284
|
return {
|
|
1273
1285
|
risk: /* @__PURE__ */ new Set(),
|
|
1274
1286
|
retMin: null,
|
|
@@ -1285,19 +1297,19 @@ function de() {
|
|
|
1285
1297
|
search: ""
|
|
1286
1298
|
};
|
|
1287
1299
|
}
|
|
1288
|
-
function
|
|
1289
|
-
const a =
|
|
1300
|
+
function Sn(e, t = {}) {
|
|
1301
|
+
const a = me(), n = Te({
|
|
1290
1302
|
...a,
|
|
1291
1303
|
...t,
|
|
1292
1304
|
risk: new Set(t.risk ?? a.risk)
|
|
1293
|
-
}), s =
|
|
1305
|
+
}), s = $(() => e.value.filter((l) => Rn(l, n)));
|
|
1294
1306
|
function c() {
|
|
1295
|
-
const l =
|
|
1307
|
+
const l = me();
|
|
1296
1308
|
n.risk = l.risk, n.retMin = null, n.retMax = null, n.ddMax = null, n.aumMin = null, n.copiersMin = null, n.ageMin = null, n.tradesMin = null, n.winrateMin = null, n.feeMax = null, n.balanceMin = null, n.balanceMax = null, n.search = "";
|
|
1297
1309
|
}
|
|
1298
1310
|
return { filters: n, filtered: s, reset: c };
|
|
1299
1311
|
}
|
|
1300
|
-
function
|
|
1312
|
+
function Rn(e, t) {
|
|
1301
1313
|
var s;
|
|
1302
1314
|
if (t.search) {
|
|
1303
1315
|
const c = t.search.toLowerCase();
|
|
@@ -1305,12 +1317,12 @@ function Pn(e, t) {
|
|
|
1305
1317
|
return !1;
|
|
1306
1318
|
}
|
|
1307
1319
|
if (t.risk.size && e.RiskProfile && !t.risk.has(e.RiskProfile) || e.IsSimulated || e._stats && !e.TradesTotal || t.copiersMin != null && (e.NumCopiers ?? 0) < t.copiersMin || t.aumMin != null && (e.CopiersAUM ?? 0) < t.aumMin || t.balanceMin != null && (e.AccountBalance ?? 0) < t.balanceMin || t.balanceMax != null && (e.AccountBalance ?? 1 / 0) > t.balanceMax || t.feeMax != null && e.Fee != null && e.Fee * 100 > t.feeMax || t.tradesMin != null && (e.TradesTotal ?? 0) < t.tradesMin) return !1;
|
|
1308
|
-
const a =
|
|
1320
|
+
const a = q(e);
|
|
1309
1321
|
if (t.winrateMin != null && (a < 0 || a < t.winrateMin)) return !1;
|
|
1310
|
-
const n =
|
|
1322
|
+
const n = W(e.Inception);
|
|
1311
1323
|
return !(t.ageMin != null && (n == null || n < t.ageMin) || t.retMin != null && (e.Return == null || e.Return < t.retMin) || t.retMax != null && (e.Return == null || e.Return > t.retMax) || t.ddMax != null && e.MaxDD != null && Math.abs(e.MaxDD) > t.ddMax);
|
|
1312
1324
|
}
|
|
1313
|
-
const
|
|
1325
|
+
const Pn = {
|
|
1314
1326
|
"return-desc": (e, t) => (t.Return ?? -1e18) - (e.Return ?? -1e18),
|
|
1315
1327
|
"return-asc": (e, t) => (e.Return ?? 1e18) - (t.Return ?? 1e18),
|
|
1316
1328
|
"dd-asc": (e, t) => Math.abs(e.MaxDD ?? 1e9) - Math.abs(t.MaxDD ?? 1e9),
|
|
@@ -1321,20 +1333,20 @@ const Cn = {
|
|
|
1321
1333
|
"copiers-asc": (e, t) => (e.NumCopiers ?? 1 / 0) - (t.NumCopiers ?? 1 / 0),
|
|
1322
1334
|
"fee-asc": (e, t) => (e.Fee ?? 1 / 0) - (t.Fee ?? 1 / 0),
|
|
1323
1335
|
"fee-desc": (e, t) => (t.Fee ?? -1) - (e.Fee ?? -1),
|
|
1324
|
-
"age-desc": (e, t) => (
|
|
1325
|
-
"age-asc": (e, t) => (
|
|
1336
|
+
"age-desc": (e, t) => (W(t.Inception) ?? -1) - (W(e.Inception) ?? -1),
|
|
1337
|
+
"age-asc": (e, t) => (W(e.Inception) ?? 1 / 0) - (W(t.Inception) ?? 1 / 0),
|
|
1326
1338
|
"balance-desc": (e, t) => (t.AccountBalance ?? -1) - (e.AccountBalance ?? -1),
|
|
1327
1339
|
"balance-asc": (e, t) => (e.AccountBalance ?? 1 / 0) - (t.AccountBalance ?? 1 / 0),
|
|
1328
|
-
"winrate-desc": (e, t) =>
|
|
1329
|
-
"winrate-asc": (e, t) =>
|
|
1340
|
+
"winrate-desc": (e, t) => q(t) - q(e),
|
|
1341
|
+
"winrate-asc": (e, t) => q(e) - q(t),
|
|
1330
1342
|
"trades-desc": (e, t) => (t.TradesTotal ?? -1) - (e.TradesTotal ?? -1),
|
|
1331
1343
|
"trades-asc": (e, t) => (e.TradesTotal ?? 1 / 0) - (t.TradesTotal ?? 1 / 0),
|
|
1332
1344
|
"monthly-desc": (e, t) => (t.MonthlyProfit ?? -1e18) - (e.MonthlyProfit ?? -1e18),
|
|
1333
1345
|
"monthly-asc": (e, t) => (e.MonthlyProfit ?? 1e18) - (t.MonthlyProfit ?? 1e18)
|
|
1334
1346
|
};
|
|
1335
|
-
function
|
|
1336
|
-
const a =
|
|
1337
|
-
const c =
|
|
1347
|
+
function Cn(e, t = "return-desc") {
|
|
1348
|
+
const a = P(t), n = $(() => {
|
|
1349
|
+
const c = Pn[a.value] ?? (() => 0);
|
|
1338
1350
|
return e.value.slice().sort(c);
|
|
1339
1351
|
});
|
|
1340
1352
|
function s(c) {
|
|
@@ -1350,21 +1362,21 @@ function Tn(e, t = "return-desc") {
|
|
|
1350
1362
|
}
|
|
1351
1363
|
};
|
|
1352
1364
|
}
|
|
1353
|
-
function
|
|
1354
|
-
const a =
|
|
1355
|
-
|
|
1365
|
+
function Tn(e, t) {
|
|
1366
|
+
const a = P(1), n = $(() => Math.max(1, Math.ceil(e.value.length / t)));
|
|
1367
|
+
V(n, (l) => {
|
|
1356
1368
|
a.value > l && (a.value = l), a.value < 1 && (a.value = 1);
|
|
1357
1369
|
});
|
|
1358
|
-
const s =
|
|
1370
|
+
const s = $(() => {
|
|
1359
1371
|
const l = (a.value - 1) * t;
|
|
1360
1372
|
return e.value.slice(l, l + t);
|
|
1361
|
-
}), c =
|
|
1373
|
+
}), c = $(() => {
|
|
1362
1374
|
const l = a.value, o = n.value;
|
|
1363
1375
|
if (o <= 1) return [];
|
|
1364
|
-
const m = [.../* @__PURE__ */ new Set([1, o, l, l - 1, l + 1, l - 2, l + 2, 2, o - 1])].filter((
|
|
1365
|
-
for (let
|
|
1366
|
-
|
|
1367
|
-
return
|
|
1376
|
+
const m = [.../* @__PURE__ */ new Set([1, o, l, l - 1, l + 1, l - 2, l + 2, 2, o - 1])].filter((v) => v >= 1 && v <= o).sort((v, d) => v - d), h = [];
|
|
1377
|
+
for (let v = 0; v < m.length; v++)
|
|
1378
|
+
v && m[v] - m[v - 1] > 1 && h.push("…"), h.push(m[v]);
|
|
1379
|
+
return h;
|
|
1368
1380
|
});
|
|
1369
1381
|
return {
|
|
1370
1382
|
page: a,
|
|
@@ -1382,36 +1394,36 @@ function An(e, t) {
|
|
|
1382
1394
|
}
|
|
1383
1395
|
};
|
|
1384
1396
|
}
|
|
1385
|
-
function
|
|
1386
|
-
const t =
|
|
1397
|
+
function An(e) {
|
|
1398
|
+
const t = P(/* @__PURE__ */ new Map()), a = P(/* @__PURE__ */ new Map());
|
|
1387
1399
|
function n(c, l) {
|
|
1388
1400
|
return (l === "open" ? t.value : a.value).get(c) ?? null;
|
|
1389
1401
|
}
|
|
1390
1402
|
async function s(c, l) {
|
|
1391
|
-
const o = l === "open" ? t : a,
|
|
1392
|
-
if (
|
|
1403
|
+
const o = l === "open" ? t : a, r = o.value.get(c);
|
|
1404
|
+
if (r && (r.loading || r.trades !== null)) return;
|
|
1393
1405
|
const m = new Map(o.value);
|
|
1394
1406
|
m.set(c, { loading: !0, trades: null, error: null }), o.value = m;
|
|
1395
|
-
let
|
|
1407
|
+
let h = "";
|
|
1396
1408
|
if (l === "closed") {
|
|
1397
|
-
const
|
|
1398
|
-
|
|
1409
|
+
const k = /* @__PURE__ */ new Date(), _ = new Date(Date.now() - We * 864e5), f = (R) => R.toISOString().replace(/\.\d+Z$/, "Z");
|
|
1410
|
+
h = `?startDate=${encodeURIComponent(f(_))}&endDate=${encodeURIComponent(f(k))}`;
|
|
1399
1411
|
}
|
|
1400
|
-
const
|
|
1401
|
-
let d = [],
|
|
1412
|
+
const v = ee(e.value, `/api/strategies/${c}/signals/${l}${h}`);
|
|
1413
|
+
let d = [], u = null;
|
|
1402
1414
|
try {
|
|
1403
|
-
const
|
|
1404
|
-
if (!
|
|
1405
|
-
d = await
|
|
1406
|
-
} catch (
|
|
1407
|
-
|
|
1415
|
+
const k = await fetch(v);
|
|
1416
|
+
if (!k.ok) throw J("http_error", `${k.status}`);
|
|
1417
|
+
d = await k.json();
|
|
1418
|
+
} catch (k) {
|
|
1419
|
+
u = k.code ? k : J("fetch_failed", k.message), d = [];
|
|
1408
1420
|
}
|
|
1409
|
-
const
|
|
1410
|
-
|
|
1421
|
+
const I = new Map(o.value);
|
|
1422
|
+
I.set(c, { loading: !1, trades: d, error: u }), o.value = I;
|
|
1411
1423
|
}
|
|
1412
1424
|
return { open: t, closed: a, load: s, get: n };
|
|
1413
1425
|
}
|
|
1414
|
-
const
|
|
1426
|
+
const Fn = ["data-theme"], Nn = { class: "brand-row" }, Ln = ["title"], Dn = { "aria-hidden": "true" }, Un = { class: "pelican-main" }, Vn = /* @__PURE__ */ F({
|
|
1415
1427
|
__name: "PelicanLibertexSocial",
|
|
1416
1428
|
props: {
|
|
1417
1429
|
apiBase: {},
|
|
@@ -1426,116 +1438,123 @@ const Nn = ["data-theme"], Ln = { class: "brand-row" }, Dn = ["title"], Un = { "
|
|
|
1426
1438
|
emits: ["update:theme", "select-strategy", "error"],
|
|
1427
1439
|
setup(e, { emit: t }) {
|
|
1428
1440
|
const a = e, n = t;
|
|
1429
|
-
|
|
1430
|
-
const s =
|
|
1431
|
-
|
|
1441
|
+
se(ra, a.apiBase), se(ua, a.catalogBase ?? a.apiBase), se(Ae, a.locale);
|
|
1442
|
+
const s = be(a, "apiBase"), c = be(a, "catalogBase"), l = wn(a.theme);
|
|
1443
|
+
V(l.mode, (x) => n("update:theme", x)), V(
|
|
1432
1444
|
() => a.theme,
|
|
1433
1445
|
(x) => l.setMode(x)
|
|
1434
1446
|
);
|
|
1435
|
-
const o =
|
|
1447
|
+
const o = kn({
|
|
1436
1448
|
apiBase: s,
|
|
1437
1449
|
catalogBase: c,
|
|
1438
1450
|
onError: (x) => n("error", x)
|
|
1439
|
-
}),
|
|
1440
|
-
|
|
1451
|
+
}), r = Sn(o.catalog, a.defaultFilters ?? {}), m = Cn(r.filtered, a.defaultSort), h = Tn(m.sorted, a.pageSize), v = An(s);
|
|
1452
|
+
V(h.pageItems, (x) => {
|
|
1453
|
+
x.forEach((w) => {
|
|
1454
|
+
var y;
|
|
1455
|
+
(y = w.History) != null && y.length || o.enrichOne(w.Id);
|
|
1456
|
+
});
|
|
1457
|
+
}, { immediate: !0 });
|
|
1458
|
+
const d = Te(/* @__PURE__ */ new Set()), u = P(!1), I = P(null);
|
|
1459
|
+
function k(x) {
|
|
1441
1460
|
d.has(x) ? d.delete(x) : d.add(x);
|
|
1442
|
-
const
|
|
1443
|
-
|
|
1461
|
+
const w = o.catalog.value.find((y) => y.Id === x);
|
|
1462
|
+
w && ((!w._meta || !w._stats) && !w._enrichAttempted && o.enrichOne(x), n("select-strategy", w));
|
|
1444
1463
|
}
|
|
1445
1464
|
function _(x) {
|
|
1446
|
-
m.toggleColumn(x),
|
|
1465
|
+
m.toggleColumn(x), h.setPage(1);
|
|
1447
1466
|
}
|
|
1448
|
-
function
|
|
1449
|
-
Object.assign(
|
|
1467
|
+
function f(x) {
|
|
1468
|
+
Object.assign(r.filters, x), h.setPage(1);
|
|
1450
1469
|
}
|
|
1451
|
-
function
|
|
1452
|
-
const x =
|
|
1453
|
-
Object.assign(
|
|
1470
|
+
function R() {
|
|
1471
|
+
const x = me();
|
|
1472
|
+
Object.assign(r.filters, x), r.filters.risk = x.risk, I.value = null, h.setPage(1);
|
|
1454
1473
|
}
|
|
1455
|
-
function
|
|
1456
|
-
|
|
1474
|
+
function A({ id: x, kind: w }) {
|
|
1475
|
+
v.load(x, w);
|
|
1457
1476
|
}
|
|
1458
1477
|
function S(x) {
|
|
1459
|
-
x === "prev" ?
|
|
1478
|
+
x === "prev" ? h.prev() : x === "next" ? h.next() : h.setPage(x);
|
|
1460
1479
|
}
|
|
1461
|
-
return Be(() => o.start()), (x,
|
|
1480
|
+
return Be(() => o.start()), (x, w) => (g(), M("div", {
|
|
1462
1481
|
class: "pelican-libsoc",
|
|
1463
|
-
"data-theme":
|
|
1482
|
+
"data-theme": p(l).resolved.value
|
|
1464
1483
|
}, [
|
|
1465
|
-
i("header",
|
|
1466
|
-
|
|
1467
|
-
|
|
1484
|
+
i("header", Nn, [
|
|
1485
|
+
X(x.$slots, "brand", {}, () => [
|
|
1486
|
+
w[6] || (w[6] = i("div", { class: "default-brand" }, "Libertex Social — Copy Trading", -1))
|
|
1468
1487
|
], !0),
|
|
1469
1488
|
i("button", {
|
|
1470
1489
|
class: "theme-toggle",
|
|
1471
1490
|
type: "button",
|
|
1472
|
-
title:
|
|
1473
|
-
onClick:
|
|
1474
|
-
(...
|
|
1491
|
+
title: p(l).mode.value,
|
|
1492
|
+
onClick: w[0] || (w[0] = //@ts-ignore
|
|
1493
|
+
(...y) => p(l).cycle && p(l).cycle(...y))
|
|
1475
1494
|
}, [
|
|
1476
|
-
i("span",
|
|
1477
|
-
], 8,
|
|
1495
|
+
i("span", Dn, b(p(l).resolved.value === "dark" ? "🌙" : "☀️"), 1)
|
|
1496
|
+
], 8, Ln)
|
|
1478
1497
|
]),
|
|
1479
|
-
|
|
1480
|
-
search:
|
|
1481
|
-
"sort-key":
|
|
1482
|
-
total:
|
|
1483
|
-
"filtered-total":
|
|
1484
|
-
page:
|
|
1485
|
-
"total-pages":
|
|
1486
|
-
"onUpdate:search":
|
|
1487
|
-
"onUpdate:sortKey":
|
|
1488
|
-
onRefresh:
|
|
1489
|
-
onToggleFilters:
|
|
1498
|
+
T(st, {
|
|
1499
|
+
search: p(r).filters.search,
|
|
1500
|
+
"sort-key": p(m).sortKey.value,
|
|
1501
|
+
total: p(o).total.value,
|
|
1502
|
+
"filtered-total": p(r).filtered.value.length,
|
|
1503
|
+
page: p(h).page.value,
|
|
1504
|
+
"total-pages": p(h).totalPages.value,
|
|
1505
|
+
"onUpdate:search": w[1] || (w[1] = (y) => f({ search: y })),
|
|
1506
|
+
"onUpdate:sortKey": w[2] || (w[2] = (y) => p(m).setKey(y)),
|
|
1507
|
+
onRefresh: p(o).refresh,
|
|
1508
|
+
onToggleFilters: w[3] || (w[3] = (y) => u.value = !u.value)
|
|
1490
1509
|
}, null, 8, ["search", "sort-key", "total", "filtered-total", "page", "total-pages", "onRefresh"]),
|
|
1491
|
-
|
|
1492
|
-
loaded:
|
|
1493
|
-
total:
|
|
1494
|
-
active:
|
|
1510
|
+
T(xn, {
|
|
1511
|
+
loaded: p(o).loaded.value,
|
|
1512
|
+
total: p(o).total.value,
|
|
1513
|
+
active: p(o).building.value && !p(o).ready.value
|
|
1495
1514
|
}, null, 8, ["loaded", "total", "active"]),
|
|
1496
|
-
i("main",
|
|
1497
|
-
|
|
1498
|
-
filters:
|
|
1499
|
-
"invest-amount":
|
|
1500
|
-
open:
|
|
1501
|
-
"onUpdate:filters":
|
|
1502
|
-
"onUpdate:investAmount":
|
|
1503
|
-
onReset:
|
|
1515
|
+
i("main", Un, [
|
|
1516
|
+
T(Dt, {
|
|
1517
|
+
filters: p(r).filters,
|
|
1518
|
+
"invest-amount": I.value,
|
|
1519
|
+
open: u.value,
|
|
1520
|
+
"onUpdate:filters": f,
|
|
1521
|
+
"onUpdate:investAmount": w[4] || (w[4] = (y) => I.value = y),
|
|
1522
|
+
onReset: R
|
|
1504
1523
|
}, null, 8, ["filters", "invest-amount", "open"]),
|
|
1505
|
-
|
|
1506
|
-
"page-items":
|
|
1524
|
+
T(pn, {
|
|
1525
|
+
"page-items": p(h).pageItems.value,
|
|
1507
1526
|
expanded: d,
|
|
1508
|
-
"sort-key":
|
|
1509
|
-
page:
|
|
1510
|
-
"total-pages":
|
|
1511
|
-
"page-range":
|
|
1512
|
-
"open-signals": v
|
|
1513
|
-
"closed-signals": v
|
|
1514
|
-
onToggleRow:
|
|
1527
|
+
"sort-key": p(m).sortKey.value,
|
|
1528
|
+
page: p(h).page.value,
|
|
1529
|
+
"total-pages": p(h).totalPages.value,
|
|
1530
|
+
"page-range": p(h).pageRange.value,
|
|
1531
|
+
"open-signals": p(v).open.value,
|
|
1532
|
+
"closed-signals": p(v).closed.value,
|
|
1533
|
+
onToggleRow: k,
|
|
1515
1534
|
onToggleSort: _,
|
|
1516
|
-
onLoadTrades:
|
|
1517
|
-
onSelect:
|
|
1535
|
+
onLoadTrades: A,
|
|
1536
|
+
onSelect: w[5] || (w[5] = (y) => n("select-strategy", y)),
|
|
1518
1537
|
onGo: S
|
|
1519
1538
|
}, {
|
|
1520
|
-
empty:
|
|
1521
|
-
|
|
1522
|
-
|
|
1539
|
+
empty: ce(() => [
|
|
1540
|
+
X(x.$slots, "empty", {}, () => [
|
|
1541
|
+
w[7] || (w[7] = L("No matches.", -1))
|
|
1523
1542
|
], !0)
|
|
1524
1543
|
]),
|
|
1525
|
-
"row-actions":
|
|
1526
|
-
|
|
1544
|
+
"row-actions": ce((y) => [
|
|
1545
|
+
X(x.$slots, "row-actions", Oe(Ke(y)), void 0, !0)
|
|
1527
1546
|
]),
|
|
1528
1547
|
_: 3
|
|
1529
1548
|
}, 8, ["page-items", "expanded", "sort-key", "page", "total-pages", "page-range", "open-signals", "closed-signals"])
|
|
1530
1549
|
])
|
|
1531
|
-
], 8,
|
|
1550
|
+
], 8, Fn));
|
|
1532
1551
|
}
|
|
1533
|
-
}),
|
|
1552
|
+
}), Bn = /* @__PURE__ */ N(Vn, [["__scopeId", "data-v-e2cce41d"]]);
|
|
1534
1553
|
export {
|
|
1535
|
-
|
|
1554
|
+
Bn as PelicanLibertexSocial,
|
|
1536
1555
|
qe as SORT_KEYS,
|
|
1537
1556
|
Xe as SORT_LABELS,
|
|
1538
1557
|
Ze as SORT_TOGGLE,
|
|
1539
|
-
|
|
1558
|
+
me as defaultFilters
|
|
1540
1559
|
};
|
|
1541
1560
|
//# sourceMappingURL=pelican-libertex-social.mjs.map
|