@mashkovd/pelican-vue 0.2.0

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