@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 me, defineComponent as F, ref as R, watch as E, openBlock as p, createElementBlock as y, createElementVNode as i, createTextVNode as D, toDisplayString as b, Fragment as U, renderList as K, unref as v, normalizeClass as B, computed as k, normalizeStyle as ie, createCommentVNode as O, createVNode as P, withDirectives as he, vShow as ye, inject as Ue, withModifiers as te, renderSlot as q, createBlock as re, withCtx as ue, mergeProps as Ve, shallowRef as Ee, triggerRef as ae, reactive as Ce, provide as ne, toRef as Me, onMounted as Be, normalizeProps as Oe, guardReactiveProps as Ke } from "vue";
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 me(s), { wrapped: n, cancel: s };
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 = R(a.search);
76
- E(
75
+ const a = e, n = t, s = P(a.search);
76
+ V(
77
77
  () => a.search,
78
- (u) => {
79
- u !== s.value && (s.value = u);
78
+ (r) => {
79
+ r !== s.value && (s.value = r);
80
80
  }
81
81
  );
82
- const { wrapped: c } = Ye((u) => n("update:search", u), Ge);
83
- function l(u) {
84
- const m = u.target.value;
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(u) {
88
- n("update:sortKey", u.target.value);
87
+ function o(r) {
88
+ n("update:sortKey", r.target.value);
89
89
  }
90
- return (u, m) => (p(), y("div", Je, [
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] = (g) => n("toggle-filters"))
94
+ onClick: m[0] || (m[0] = (h) => n("toggle-filters"))
95
95
  }, " Filters "),
96
96
  i("div", Qe, [
97
- m[2] || (m[2] = D(" Showing ", -1)),
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] = D(" of ", -1)),
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] = D(" · page ", -1)),
101
+ m[4] || (m[4] = L(" · page ", -1)),
102
102
  i("b", null, b(e.page), 1),
103
- D(" / " + b(e.totalPages), 1)
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
- (p(!0), y(U, null, K(v(qe), (g) => (p(), y("option", {
120
- key: g,
121
- value: g
122
- }, b(v(Xe)[g]), 9, nt))), 128))
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] = (g) => n("refresh"))
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) => (p(), y("div", ot, [
151
- (p(), y(U, null, K(s, (u) => i("button", {
152
- key: u,
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-" + u.toLowerCase(), { on: e.modelValue.has(u) }]]),
155
- onClick: (m) => c(u)
156
- }, b(u), 11, it)), 64))
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 = k(() => a.anyAt ?? a.min), c = k(() => !!a.inverted), l = k(() => a.modelValue == null ? c.value ? a.max : s.value : a.modelValue), o = k(() => a.modelValue == null ? "any" : a.format ? a.format(a.modelValue) : String(a.modelValue));
174
- function u(m) {
175
- const g = parseInt(m.target.value, 10);
176
- isNaN(g) || (c.value && g >= a.max || !c.value && g <= s.value ? n("update:modelValue", null) : n("update:modelValue", g));
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, g) => (p(), y("div", ct, [
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: u,
191
- onChange: u
190
+ onInput: r,
191
+ onChange: r
192
192
  }, null, 40, vt)
193
193
  ]));
194
194
  }
195
- }), G = /* @__PURE__ */ N(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 = {
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
- }, kt = /* @__PURE__ */ F({
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 = k(() => a.rawMin ?? 0), c = k(() => a.rawMax ?? 100), l = k(() => a.modelValueMin ?? s.value), o = k(() => a.modelValueMax ?? c.value), u = k(
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 = k(
216
+ ), m = $(
217
217
  () => o.value >= c.value ? a.maxLabel ?? "any" : a.formatRaw(a.rawToDomain(o.value))
218
- ), g = k(() => l.value <= s.value && o.value >= c.value ? "any" : `${u.value} – ${m.value}`);
219
- function f(r) {
220
- let w = parseInt(r.target.value, 10);
221
- isNaN(w) || (w > o.value && (w = o.value), n("update:modelValueMin", w <= s.value ? null : w));
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 d(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));
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 (r, w) => {
228
- var I;
229
- return p(), y("div", gt, [
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(g.value), 1)
240
+ i("span", Mt, b(h.value), 1)
233
241
  ]),
234
- i("div", bt, [
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: ie({ zIndex: l.value <= s.value || l.value >= o.value ? 5 : 4 }),
242
- onInput: f,
243
- onChange: f
244
- }, null, 44, xt),
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: ie({ zIndex: l.value <= s.value || l.value >= o.value ? 4 : 5 }),
252
- onInput: d,
253
- onChange: d
254
- }, null, 44, wt)
255
- ]),
256
- (I = e.scaleHints) != null && I.length ? (p(), y("div", $t, [
257
- (p(!0), y(U, null, K(e.scaleHints, (_) => (p(), y("span", { key: _ }, b(_), 1))), 128))
258
- ])) : O("", !0)
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
- }), be = /* @__PURE__ */ N(kt, [["__scopeId", "data-v-0bf11d26"]]);
263
- function xe(e, t = 2) {
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 we(e, t = "en-US") {
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 H(e, t = "en-US") {
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 $e(e, t = "en-US") {
293
+ function ke(e, t = "en-US") {
283
294
  return e == null ? "—" : Number(e).toLocaleString(t);
284
295
  }
285
- function It(e) {
296
+ function kt(e) {
286
297
  return e.Fee == null ? e._meta ? "free" : "—" : `${(e.Fee * 100).toFixed(0)}%`;
287
298
  }
288
- function ke(e, t = "en-US") {
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 _t(e) {
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 ce(e) {
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 St(e) {
322
+ function _t(e) {
312
323
  return e >= 1e3 ? (e / 1e3).toFixed(1).replace(/\.0$/, "") + "K%" : Math.round(e) + "%";
313
324
  }
314
- function Rt(e) {
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 j(e) {
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 le = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, 1 + (e - 1) / 99 * 6)), Ie = (e) => e <= 0 ? 0 : Math.max(1, Math.min(100, Math.round(1 + (Math.log10(e) - 1) * 99 / 6))), se = (e) => e <= 0 ? 0 : Math.round(Math.pow(10, (e - 1) / 99 * 4.7)), Pt = { class: "pelican-fgroup" }, Ct = { class: "title-row" }, Tt = { class: "val" }, At = ["value"], Ft = /* @__PURE__ */ F({
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 = k(
330
- () => a.modelValue == null ? "any" : ce(a.modelValue)
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 u = parseInt(o, 10);
339
- if (isNaN(u) || u <= 0) {
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", u), n("apply", { min: Ie(50), max: Ie(u) });
354
+ n("update:modelValue", r), n("apply", { min: _e(50), max: _e(r) });
344
355
  }
345
- return (l, o) => (p(), y("div", Pt, [
346
- i("div", Ct, [
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", Tt, b(s.value), 1)
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, At)
369
+ }, null, 40, Tt)
359
370
  ]));
360
371
  }
361
- }), Nt = /* @__PURE__ */ N(Ft, [["__scopeId", "data-v-a76acc6c"]]), Lt = { class: "ftitle-row" }, Dt = /* @__PURE__ */ F({
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 = R(0), c = R(100), l = R(0), o = R(100);
371
- E(s, (f) => {
372
- n("update:filters", { retMin: f <= 0 ? null : se(f) });
373
- }), E(c, (f) => {
374
- n("update:filters", { retMax: f >= 100 ? null : se(f) });
375
- }), E(l, (f) => {
376
- n("update:filters", { balanceMin: f <= 0 ? null : le(f) });
377
- }), E(o, (f) => {
378
- n("update:filters", { balanceMax: f >= 100 ? null : le(f) });
379
- }), E(
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
- ([f, d]) => {
382
- f == null && (s.value = 0), d == null && (c.value = 100);
392
+ ([v, d]) => {
393
+ v == null && (s.value = 0), d == null && (c.value = 100);
383
394
  }
384
- ), E(
395
+ ), V(
385
396
  () => [a.filters.balanceMin, a.filters.balanceMax],
386
- ([f, d]) => {
387
- f == null && (l.value = 0), d == null && (o.value = 100);
397
+ ([v, d]) => {
398
+ v == null && (l.value = 0), d == null && (o.value = 100);
388
399
  }
389
400
  );
390
- function u(f) {
391
- n("update:filters", f);
401
+ function r(v) {
402
+ n("update:filters", v);
392
403
  }
393
- function m(f) {
394
- u({ risk: f });
404
+ function m(v) {
405
+ r({ risk: v });
395
406
  }
396
- function g(f) {
397
- f == null ? (u({ balanceMin: null, balanceMax: null }), l.value = 0, o.value = 100) : (l.value = f.min, o.value = f.max);
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 (f, d) => (p(), y("aside", {
410
+ return (v, d) => (g(), M("aside", {
400
411
  class: B(["pelican-filters", { open: e.open }])
401
412
  }, [
402
- i("div", Lt, [
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] = (r) => n("reset"))
418
+ onClick: d[0] || (d[0] = (u) => n("reset"))
408
419
  }, "reset filters")
409
420
  ]),
410
- P(ut, {
421
+ T(ut, {
411
422
  "model-value": e.filters.risk,
412
423
  "onUpdate:modelValue": m
413
424
  }, null, 8, ["model-value"]),
414
- P(Nt, {
425
+ T(Ft, {
415
426
  "model-value": e.investAmount,
416
- "onUpdate:modelValue": d[1] || (d[1] = (r) => n("update:investAmount", r)),
417
- onApply: g
427
+ "onUpdate:modelValue": d[1] || (d[1] = (u) => n("update:investAmount", u)),
428
+ onApply: h
418
429
  }, null, 8, ["model-value"]),
419
- P(be, {
430
+ T(xe, {
420
431
  label: "Return %",
421
432
  "model-value-min": s.value,
422
433
  "model-value-max": c.value,
423
- "format-raw": (r) => v(St)(r),
424
- "raw-to-domain": (r) => v(se)(r),
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] = (r) => s.value = r ?? 0),
428
- "onUpdate:modelValueMax": d[3] || (d[3] = (r) => c.value = r ?? 100)
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
- P(G, {
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: (r) => r + "%",
439
- "onUpdate:modelValue": d[4] || (d[4] = (r) => u({ ddMax: r == null || r >= 100 ? null : r }))
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
- P(be, {
452
+ T(xe, {
442
453
  label: "Balance",
443
454
  "model-value-min": l.value,
444
455
  "model-value-max": o.value,
445
- "format-raw": (r) => v(ce)(r),
446
- "raw-to-domain": (r) => v(le)(r),
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] = (r) => l.value = r ?? 0),
450
- "onUpdate:modelValueMax": d[6] || (d[6] = (r) => o.value = r ?? 100)
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
- P(G, {
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: (r) => r + "%",
461
- "onUpdate:modelValue": d[7] || (d[7] = (r) => u({ feeMax: r == null || r >= 100 ? null : r }))
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
- P(G, {
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: (r) => "≥ " + v(ce)(r),
470
- "onUpdate:modelValue": d[8] || (d[8] = (r) => u({ aumMin: r && r > 0 ? r : null }))
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
- P(G, {
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: (r) => "≥ " + r,
479
- "onUpdate:modelValue": d[9] || (d[9] = (r) => u({ copiersMin: r && r > 0 ? r : null }))
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
- P(G, {
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: (r) => "≥ " + r + "d",
488
- "onUpdate:modelValue": d[10] || (d[10] = (r) => u({ ageMin: r && r > 0 ? r : null }))
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
- P(G, {
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: (r) => "≥ " + r,
497
- "onUpdate:modelValue": d[11] || (d[11] = (r) => u({ tradesMin: r && r > 0 ? r : null }))
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
- P(G, {
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: (r) => "≥ " + r + "%",
506
- "onUpdate:modelValue": d[12] || (d[12] = (r) => u({ winrateMin: r && r > 0 ? r : null }))
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
- }), Ut = /* @__PURE__ */ N(Dt, [["__scopeId", "data-v-67cc5448"]]), _e = [
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 Vt(e, t = 140, a = 34) {
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), u = Math.min(0, ...o), g = Math.max(0, ...o) - u || 1, f = (S) => (S - s) / l * (t - 2) + 1, d = (S) => a - 2 - (S - u) / g * (a - 4), r = e.map((S, x) => `${f(n[x]).toFixed(1)},${d(S.AccountReturn).toFixed(1)}`), w = o[o.length - 1], I = d(0), _ = f(s), h = f(c), C = `M ${r.join(" L ")}`, V = `M ${r[0]} ` + r.slice(1).map((S) => `L ${S}`).join(" ") + ` L ${h.toFixed(1)},${I.toFixed(1)} L ${_.toFixed(1)},${I.toFixed(1)} Z`;
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: I,
543
- areaPath: V,
544
- linePath: C,
545
- positive: w >= 0,
553
+ zeroY: k,
554
+ areaPath: A,
555
+ linePath: R,
556
+ positive: I >= 0,
546
557
  startX: _,
547
- endX: h
558
+ endX: f
548
559
  };
549
560
  }
550
- function Et(e, t = 520, a = 280) {
551
- const n = e.slice().sort((d, r) => (r.c || 0) - (d.c || 0)), s = n.reduce((d, r) => d + (r.c || 0), 0) || 1, c = t / 2, l = a / 2, o = 90, u = 52, m = o + 10;
552
- let g = -Math.PI / 2;
553
- const f = [];
554
- return n.forEach((d, r) => {
555
- const w = (d.c || 0) / s, I = w * Math.PI * 2, _ = g, h = g + I;
556
- g = h;
557
- const C = (_ + h) / 2, V = I > Math.PI ? 1 : 0, S = c + o * Math.cos(_), x = l + o * Math.sin(_), $ = c + o * Math.cos(h), M = l + o * Math.sin(h), T = c + u * Math.cos(_), Y = l + u * Math.sin(_), z = c + u * Math.cos(h), L = l + u * Math.sin(h), A = `M ${S.toFixed(2)} ${x.toFixed(2)} A ${o} ${o} 0 ${V} 1 ${$.toFixed(2)} ${M.toFixed(2)} L ${z.toFixed(2)} ${L.toFixed(2)} A ${u} ${u} 0 ${V} 0 ${T.toFixed(2)} ${Y.toFixed(2)} Z`, Fe = _e[r % _e.length];
558
- let fe = null, ve = 0, pe = 0, ge = "start";
559
- if (w >= 0.015) {
560
- const Q = Math.cos(C) < 0, Ne = c + o * Math.cos(C), Le = l + o * Math.sin(C), X = c + m * Math.cos(C), ee = l + m * Math.sin(C), De = Q ? X - 4 : X + 4;
561
- fe = `${Ne.toFixed(1)},${Le.toFixed(1)} ${X.toFixed(1)},${ee.toFixed(1)} ${De.toFixed(1)},${ee.toFixed(1)}`, ve = Q ? X - 6 : X + 6, pe = ee + 4, ge = Q ? "end" : "start";
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
- f.push({
574
+ v.push({
564
575
  marketName: d.n,
565
576
  count: d.c,
566
- fraction: w,
567
- color: Fe,
568
- arcPath: A,
569
- labelLine: fe,
570
- labelX: ve,
571
- labelY: pe,
572
- labelAnchor: ge
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: u, slices: f };
585
+ }), { width: t, height: a, cx: c, cy: l, outerR: o, innerR: r, slices: v };
575
586
  }
576
- const Bt = ["width", "height"], Ot = ["width", "height", "viewBox"], Kt = ["x2", "y1", "y2"], Yt = ["d", "fill"], zt = ["d", "stroke"], Gt = /* @__PURE__ */ F({
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 = k(() => Vt(t.history, t.width, t.height));
585
- return (n, s) => a.value.hasData ? (p(), y("svg", {
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, Kt),
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, Yt),
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, zt)
619
- ], 8, Ot)) : (p(), y("svg", {
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, Bt));
644
+ ])], 8, Et));
634
645
  }
635
- }), Ht = /* @__PURE__ */ N(Gt, [["__scopeId", "data-v-a9b85847"]]), jt = {
646
+ }), Gt = /* @__PURE__ */ N(zt, [["__scopeId", "data-v-a9b85847"]]), Ht = {
636
647
  key: 0,
637
648
  class: "dim"
638
- }, Wt = ["viewBox"], qt = ["d", "fill"], Xt = ["points", "stroke"], Zt = ["x", "y", "text-anchor"], Jt = {
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
- }, Qt = /* @__PURE__ */ F({
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 = k(() => !t.markets || t.markets.length === 0), n = k(() => Et(t.markets, t.width, t.height));
650
- return (s, c) => a.value ? (p(), y("span", jt, "no market data")) : (p(), y("svg", {
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
- (p(!0), y(U, null, K(n.value.slices, (l) => (p(), y("path", {
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, qt))), 128))
677
+ }, null, 8, Wt))), 128))
667
678
  ]),
668
679
  i("g", null, [
669
- (p(!0), y(U, null, K(n.value.slices, (l) => he((p(), y("polyline", {
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, Xt)), [
676
- [ye, l.labelLine]
686
+ }, null, 8, qt)), [
687
+ [Me, l.labelLine]
677
688
  ])), 128))
678
689
  ]),
679
690
  i("g", null, [
680
- (p(!0), y(U, null, K(n.value.slices, (l) => he((p(), y("text", {
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
- D(b(l.marketName) + " ", 1),
690
- i("tspan", Jt, b(l.count), 1)
691
- ], 8, Zt)), [
692
- [ye, l.labelLine]
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, Wt));
706
+ ], 8, jt));
696
707
  }
697
- }), ea = /* @__PURE__ */ N(Qt, [["__scopeId", "data-v-c514d53f"]]), ta = { class: "pelican-trades" }, aa = { class: "hd" }, na = {
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
- }, la = {
711
+ }, na = {
701
712
  key: 1,
702
713
  class: "dim"
703
- }, sa = {
714
+ }, la = {
704
715
  key: 2,
705
716
  class: "list"
706
- }, oa = { class: "market" }, ia = { class: "trade-time" }, ra = /* @__PURE__ */ F({
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 = k(() => t.kind === "open" ? "Open Trades" : "Trade History (30d)"), n = k(
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) => (p(), y("div", ta, [
719
- i("div", aa, b(a.value), 1),
720
- e.loading ? (p(), y("div", na, "Loading…")) : n.value ? (p(), y("div", la, "No trades.")) : (p(), y("ul", sa, [
721
- (p(!0), y(U, null, K(e.trades ?? [], (l, o) => (p(), y("li", { key: o }, [
722
- i("span", oa, b(l.MarketName ?? "—"), 1),
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", ia, [
727
- D(b(v(ke)(l.OpenTimestamp, e.locale)) + " ", 1),
728
- l.CloseTimestamp ? (p(), y(U, { key: 0 }, [
729
- D(" → " + b(v(ke)(l.CloseTimestamp, e.locale)), 1)
730
- ], 64)) : O("", !0)
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 ? (p(), y("span", {
743
+ l.Pnl != null ? (g(), M("span", {
733
744
  key: 0,
734
745
  class: B(["pnl", l.Pnl >= 0 ? "green" : "red"])
735
- }, b(v(H)(l.Pnl, e.locale)), 3)) : O("", !0)
746
+ }, b(p(j)(l.Pnl, e.locale)), 3)) : K("", !0)
736
747
  ]))), 128))
737
748
  ]))
738
749
  ]));
739
750
  }
740
- }), Se = /* @__PURE__ */ N(ra, [["__scopeId", "data-v-aa7cbcd7"]]);
741
- function W(e) {
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 ua = Symbol("pelican.apiBase"), ca = Symbol("pelican.catalogBase"), Te = Symbol("pelican.locale"), da = ["data-id"], ma = { class: "name" }, fa = { class: "avatar" }, va = { class: "avatar-fallback" }, pa = ["src"], ga = { class: "nm" }, ha = { class: "title" }, ya = {
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
- }, Ma = { class: "by" }, ba = {
759
+ }, ya = { class: "by" }, Ma = {
749
760
  class: "c-spark",
750
761
  "data-label": "Equity curve"
751
- }, xa = {
762
+ }, ba = {
752
763
  class: "c-num",
753
764
  "data-label": "Return"
754
- }, wa = { key: 1 }, $a = {
765
+ }, xa = { key: 1 }, wa = {
755
766
  class: "c-num",
756
767
  "data-label": "Copiers"
757
- }, ka = {
768
+ }, $a = {
758
769
  class: "c-num",
759
770
  "data-label": "Copiers AUM"
760
- }, Ia = {
771
+ }, ka = {
761
772
  class: "c-num",
762
773
  "data-label": "Max DD"
763
- }, _a = { key: 1 }, Sa = {
774
+ }, Ia = { key: 1 }, _a = {
764
775
  class: "c-num",
765
776
  "data-label": "Age"
766
- }, Ra = {
777
+ }, Sa = {
767
778
  class: "c-num",
768
779
  "data-label": "Balance"
769
- }, Pa = {
780
+ }, Ra = {
770
781
  class: "c-num",
771
782
  "data-label": "Fee"
772
- }, Ca = ["href"], Ta = { class: "grid" }, Aa = { class: "col-stats" }, Fa = { class: "field" }, Na = { class: "value" }, La = { class: "field" }, Da = { class: "value" }, Ua = { class: "field" }, Va = { class: "value" }, Ea = { class: "field" }, Ba = { class: "value" }, Oa = { class: "field" }, Ka = { class: "value" }, Ya = { class: "field" }, za = { class: "value" }, Ga = { class: "field" }, Ha = { class: "value" }, ja = { class: "field" }, Wa = { class: "value" }, qa = { key: 0 }, Xa = {
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
- }, Za = { class: "col-donut" }, Ja = { class: "trade-toggles" }, Qa = /* @__PURE__ */ F({
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(Te, "en-US"), c = k(() => xe(a.s.Return, 1)), l = k(() => a.s.MaxDD != null ? xe(a.s.MaxDD, 2) : null), o = k(() => j(a.s.Inception)), u = k(() => W(a.s)), m = k(() => u.value >= 0 ? 100 - u.value : -1), g = k(
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 _, h;
788
- return ((_ = a.s.Profile) == null ? void 0 : _.Name) ?? ((h = a.s.Profile) != null && h.Id ? "#" + a.s.Profile.Id : "");
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
- ), f = k(() => `https://libertex.copy-trade.io/strategy/${a.s.Id}`), d = R(!1), r = R(!1);
791
- function w() {
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 I() {
795
- r.value = !r.value, r.value && !a.closedTrades && n("load-trades", "closed");
805
+ function k() {
806
+ u.value = !u.value, u.value && !a.closedTrades && n("load-trades", "closed");
796
807
  }
797
- return (_, h) => {
798
- var C, V, S, x;
799
- return p(), y(U, null, [
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: h[3] || (h[3] = ($) => n("toggle"))
814
+ onClick: f[3] || (f[3] = (w) => n("toggle"))
804
815
  }, [
805
- i("div", ma, [
806
- i("div", fa, [
807
- i("span", va, b(v(Rt)(e.s.Name)), 1),
808
- e.s.ImageUploaded ? (p(), y("img", {
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: h[0] || (h[0] = ($) => $.target.remove())
816
- }, null, 40, pa)) : O("", !0)
826
+ onError: f[0] || (f[0] = (w) => w.target.remove())
827
+ }, null, 40, va)) : K("", !0)
817
828
  ]),
818
- i("div", ga, [
819
- i("div", ha, [
820
- D(b(e.s.Name || "#" + e.s.Id) + " ", 1),
821
- e.s._meta && e.s.Fee == null ? (p(), y("span", ya, "free")) : O("", !0)
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", Ma, b(g.value), 1)
834
+ i("div", ya, b(h.value), 1)
824
835
  ])
825
836
  ]),
826
- i("div", ba, [
827
- P(Ht, {
837
+ i("div", Ma, [
838
+ T(Gt, {
828
839
  history: e.s.History
829
840
  }, null, 8, ["history"])
830
841
  ]),
831
- i("div", xa, [
832
- c.value ? (p(), y("span", {
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)) : (p(), y("span", wa, "—"))
846
+ }, b(c.value.text), 3)) : (g(), M("span", xa, "—"))
836
847
  ]),
837
- i("div", $a, b(v($e)(e.s.NumCopiers, v(s))), 1),
838
- i("div", ka, b(v(we)(e.s.CopiersAUM, v(s))), 1),
839
- i("div", Ia, [
840
- l.value ? (p(), y("span", {
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)) : (p(), y("span", _a, "—"))
854
+ }, b(l.value.text), 3)) : (g(), M("span", Ia, "—"))
844
855
  ]),
845
- i("div", Sa, b(v(_t)(o.value)), 1),
846
- i("div", Ra, b(v(we)(e.s.AccountBalance, v(s))), 1),
847
- i("div", Pa, b(v(It)(e.s)), 1),
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: h[2] || (h[2] = te(() => {
861
+ onClick: f[2] || (f[2] = ne(() => {
851
862
  }, ["stop"]))
852
863
  }, [
853
864
  i("a", {
854
865
  class: "signal-link",
855
- href: f.value,
866
+ href: v.value,
856
867
  target: "_blank",
857
868
  rel: "noopener",
858
- onClick: h[1] || (h[1] = te(() => {
869
+ onClick: f[1] || (f[1] = ne(() => {
859
870
  }, ["stop"]))
860
- }, " Get connected ", 8, Ca),
861
- q(_.$slots, "row-actions", { strategy: e.s }, void 0, !0)
871
+ }, " Get connected ", 8, Pa),
872
+ X(_.$slots, "row-actions", { strategy: e.s }, void 0, !0)
862
873
  ])
863
- ], 10, da),
864
- e.expanded ? (p(), y("div", {
874
+ ], 10, ca),
875
+ e.expanded ? (g(), M("div", {
865
876
  key: 0,
866
877
  class: "pelican-row-expanded",
867
- onClick: h[4] || (h[4] = te(() => {
878
+ onClick: f[4] || (f[4] = ne(() => {
868
879
  }, ["stop"]))
869
880
  }, [
870
- i("div", Ta, [
871
- i("div", Aa, [
872
- i("div", Fa, [
873
- h[5] || (h[5] = i("div", { class: "label" }, "Currency", -1)),
874
- i("div", Na, b(e.s.Currency ?? "USD"), 1)
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", La, [
877
- h[6] || (h[6] = i("div", { class: "label" }, "Monthly profit", -1)),
878
- i("div", Da, b(v(H)(e.s.MonthlyProfit, v(s))), 1)
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", Ua, [
881
- h[7] || (h[7] = i("div", { class: "label" }, "Yearly profit", -1)),
882
- i("div", Va, b(v(H)(e.s.YearlyProfit, v(s))), 1)
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", Ea, [
885
- h[8] || (h[8] = i("div", { class: "label" }, "Balance", -1)),
886
- i("div", Ba, b(v(H)(e.s.AccountBalance, v(s))), 1)
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", Oa, [
889
- h[9] || (h[9] = i("div", { class: "label" }, "Realized P/L", -1)),
890
- i("div", Ka, b(v(H)(e.s.RealisedPnl, v(s))), 1)
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", Ya, [
893
- h[10] || (h[10] = i("div", { class: "label" }, "Unrealized P/L", -1)),
894
- i("div", za, b(v(H)(e.s.UnrealisedPnl, v(s))), 1)
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", Ga, [
897
- h[11] || (h[11] = i("div", { class: "label" }, "Trades total", -1)),
898
- i("div", Ha, b(v($e)(e.s.TradesTotal, v(s))), 1)
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", ja, [
901
- h[12] || (h[12] = i("div", { class: "label" }, "Win rate", -1)),
902
- i("div", Wa, [
903
- u.value >= 0 ? (p(), y("span", qa, b(u.value.toFixed(1)) + "% / " + b(m.value.toFixed(1)) + "%", 1)) : (p(), y("span", Xa, "—"))
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", Za, [
908
- h[13] || (h[13] = i("div", { class: "hd" }, "Markets", -1)),
909
- P(ea, {
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", Ja, [
925
+ i("div", Za, [
915
926
  i("button", {
916
927
  class: B(["pill", { on: d.value }]),
917
928
  type: "button",
918
- onClick: w
929
+ onClick: I
919
930
  }, b(d.value ? "Hide" : "Open Trades"), 3),
920
931
  i("button", {
921
- class: B(["pill", { on: r.value }]),
932
+ class: B(["pill", { on: u.value }]),
922
933
  type: "button",
923
- onClick: I
924
- }, b(r.value ? "Hide" : "Trade History"), 3)
934
+ onClick: k
935
+ }, b(u.value ? "Hide" : "Trade History"), 3)
925
936
  ]),
926
- d.value ? (p(), re(Se, {
937
+ d.value ? (g(), ue(Re, {
927
938
  key: 0,
928
939
  kind: "open",
929
- trades: ((C = e.openTrades) == null ? void 0 : C.trades) ?? null,
930
- loading: !!((V = e.openTrades) != null && V.loading),
931
- locale: v(s)
932
- }, null, 8, ["trades", "loading", "locale"])) : O("", !0),
933
- r.value ? (p(), re(Se, {
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: v(s)
939
- }, null, 8, ["trades", "loading", "locale"])) : O("", !0)
940
- ])) : O("", !0)
949
+ locale: p(s)
950
+ }, null, 8, ["trades", "loading", "locale"])) : K("", !0)
951
+ ])) : K("", !0)
941
952
  ], 64);
942
953
  };
943
954
  }
944
- }), en = /* @__PURE__ */ N(Qa, [["__scopeId", "data-v-61c1236b"]]), tn = {
955
+ }), Qa = /* @__PURE__ */ N(Ja, [["__scopeId", "data-v-61c1236b"]]), en = {
945
956
  key: 0,
946
957
  class: "pelican-pager"
947
- }, an = ["disabled"], nn = {
958
+ }, tn = ["disabled"], an = {
948
959
  key: 0,
949
960
  class: "gap"
950
- }, ln = ["onClick"], sn = ["disabled"], on = { class: "info" }, rn = ["max", "value"], un = /* @__PURE__ */ F({
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 ? (p(), y("nav", tn, [
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] = (u) => s("prev"))
971
- }, "‹ prev", 8, an),
972
- (p(!0), y(U, null, K(e.range, (u, m) => (p(), y(U, { key: m }, [
973
- u === "…" ? (p(), y("span", nn, "…")) : (p(), y("button", {
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: u === e.page }]),
976
- onClick: (g) => s(u)
977
- }, b(u), 11, ln))
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] = (u) => s("next"))
982
- }, "next ›", 8, sn),
983
- i("span", on, [
984
- o[2] || (o[2] = D(" go to ", -1)),
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, rn)
1002
+ }, null, 40, on)
992
1003
  ])
993
- ])) : O("", !0);
1004
+ ])) : K("", !0);
994
1005
  }
995
- }), cn = /* @__PURE__ */ N(un, [["__scopeId", "data-v-42928155"]]), dn = { class: "pelican-table" }, mn = { class: "row head" }, fn = ["onClick"], vn = {
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
- }, pn = /* @__PURE__ */ F({
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) => (p(), y("section", dn, [
1025
- i("div", mn, [
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
- (p(), y(U, null, K(s, (u) => i("div", {
1029
- key: u.key,
1030
- class: B(["c-num sortable", c(u.key)]),
1031
- onClick: (m) => n("toggle-sort", u.key)
1032
- }, b(u.label), 11, fn)), 64)),
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 ? (p(), y("div", vn, [
1036
- q(l.$slots, "empty", {}, () => [
1037
- o[4] || (o[4] = D("No matches.", -1))
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
- ])) : (p(!0), y(U, { key: 1 }, K(e.pageItems, (u) => (p(), re(en, {
1040
- key: u.Id,
1041
- s: u,
1042
- expanded: e.expanded.has(u.Id),
1043
- "open-trades": e.openSignals.get(u.Id) ?? null,
1044
- "closed-trades": e.closedSignals.get(u.Id) ?? null,
1045
- onToggle: (m) => n("toggle-row", u.Id),
1046
- onLoadTrades: (m) => n("load-trades", { id: u.Id, kind: m }),
1047
- onSelect: (m) => n("select", u)
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": ue((m) => [
1050
- q(l.$slots, "row-actions", Ve({ ref_for: !0 }, m), void 0, !0)
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
- P(cn, {
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] = (u) => n("go", u))
1069
+ onGo: o[0] || (o[0] = (r) => n("go", r))
1059
1070
  }, null, 8, ["page", "total-pages", "range"])
1060
1071
  ]));
1061
1072
  }
1062
- }), gn = /* @__PURE__ */ N(pn, [["__scopeId", "data-v-c61b9ce8"]]), hn = {
1073
+ }), pn = /* @__PURE__ */ N(vn, [["__scopeId", "data-v-c61b9ce8"]]), gn = {
1063
1074
  key: 0,
1064
1075
  class: "pelican-progress"
1065
- }, yn = { class: "bar" }, Mn = { class: "caption" }, bn = { class: "hint" }, xn = /* @__PURE__ */ F({
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 = k(
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 ? (p(), y("div", hn, [
1077
- i("div", yn, [
1087
+ return (n, s) => e.active ? (g(), M("div", gn, [
1088
+ i("div", hn, [
1078
1089
  i("span", {
1079
- style: ie({ width: a.value.toFixed(1) + "%" })
1090
+ style: Q({ width: a.value.toFixed(1) + "%" })
1080
1091
  }, null, 4)
1081
1092
  ]),
1082
- i("div", Mn, [
1083
- s[0] || (s[0] = D(" Building full catalog: ", -1)),
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
- D(" / " + b(e.total.toLocaleString("en-US")) + " strategies (" + b(a.value.toFixed(0)) + "%) · ", 1),
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", bn, " All " + b(e.total.toLocaleString("en-US")) + " strategies are visible. Stats fill in as the build progresses; refresh of data every 20 sec. ", 1)
1089
- ])) : O("", !0);
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
- }), wn = /* @__PURE__ */ N(xn, [["__scopeId", "data-v-8767a909"]]), Ae = "pelican-theme";
1092
- function $n(e = "auto") {
1093
- const t = kn(), a = R(t ?? e), n = R("dark"), s = typeof window < "u" && window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null, c = () => {
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)), E(a, (m) => {
1110
+ s && (s.addEventListener ? s.addEventListener("change", l) : s.addListener(l)), V(a, (m) => {
1100
1111
  try {
1101
- localStorage.setItem(Ae, m);
1112
+ localStorage.setItem(Fe, m);
1102
1113
  } catch {
1103
1114
  }
1104
1115
  c();
1105
- }), c(), me(() => {
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 u() {
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: u };
1125
+ return { mode: a, resolved: n, setMode: o, cycle: r };
1115
1126
  }
1116
- function kn() {
1127
+ function $n() {
1117
1128
  try {
1118
- const e = localStorage.getItem(Ae);
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 Z(e, t, a) {
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 oe(e, t) {
1129
- const a = J(t, e);
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 Z("fetch_failed", s.message ?? "fetch failed");
1145
+ throw J("fetch_failed", s.message ?? "fetch failed");
1135
1146
  }
1136
1147
  if (n.status === 401 || n.status === 503)
1137
- throw Z("no_token", "Proxy has no token yet", n.status);
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 Z("http_error", `${n.status}: ${s.slice(0, 120)}`, n.status);
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 J(e, t) {
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 In({ apiBase: e, catalogBase: t, onError: a }) {
1150
- const n = Ee(/* @__PURE__ */ new Map()), s = R(!1), c = R(!1), l = R(0), o = R(0), u = R(null), m = k(() => Array.from(n.value.values()));
1151
- let g = !1;
1152
- const f = (M) => {
1153
- a ? a(M) : console.warn("[pelican-vue]", M);
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 M = t == null ? void 0 : t.value;
1156
- return !!M && M !== e.value;
1157
- }, r = () => (t == null ? void 0 : t.value) || e.value;
1158
- async function w(M) {
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 Y = await oe(M ? "/api/strategies-full?partial=1" : "/api/strategies-full", r());
1161
- o.value = Y.length;
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 L of Y) z.set(L.Id, { ...z.get(L.Id), ...L });
1164
- ae(n);
1165
- } catch (T) {
1166
- f(T);
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 I() {
1180
+ async function k() {
1170
1181
  try {
1171
- const M = await oe("/api/strategies-full/progress", r());
1172
- return l.value = M.loaded, o.value = M.total || o.value, c.value = M.building, u.value = M.built_at, M;
1173
- } catch (M) {
1174
- return f(M), null;
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 w(!1), I(), s.value = !0;
1190
+ await I(!1), k(), s.value = !0;
1180
1191
  return;
1181
1192
  }
1182
- await w(!0);
1183
- let M = Date.now();
1184
- for (; !g; ) {
1185
- const T = await I();
1186
- if (!T) {
1187
- await Pe(1500);
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 (T.ready) break;
1191
- Date.now() - M > je && (await w(!0), M = Date.now()), await Pe(He);
1201
+ if (C.ready) break;
1202
+ Date.now() - y > je && (await I(!0), y = Date.now()), await Ce(He);
1192
1203
  }
1193
- g || (await w(!1), s.value = !0);
1204
+ h || (await I(!1), s.value = !0);
1194
1205
  }
1195
- const h = /* @__PURE__ */ new Set();
1196
- async function C(M) {
1197
- if (h.has(M)) return;
1198
- const T = n.value.get(M);
1199
- if (!(T != null && T._enrichAttempted && T._meta && T._stats)) {
1200
- h.add(M);
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 [Y, z] = await Promise.all([
1203
- Re(J(e.value, `/api/strategies/${M}`)),
1204
- Re(J(e.value, `/api/strategies/${M}/stats`))
1205
- ]), L = n.value, A = L.get(M) ?? { Id: M };
1206
- _n(A, Y), Sn(A, z), A._enrichAttempted = !0, A.IsEnabled === !1 ? L.delete(M) : L.set(M, A), ae(n);
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
- h.delete(M);
1220
+ f.delete(y);
1209
1221
  }
1210
1222
  }
1211
1223
  }
1212
- async function V(M) {
1213
- if (!(!M || !s.value))
1224
+ async function A(y) {
1225
+ if (!(!y || !s.value))
1214
1226
  try {
1215
- const T = await oe(
1216
- `/api/strategies?filter=${encodeURIComponent(M)}`,
1227
+ const C = await re(
1228
+ `/api/strategies?filter=${encodeURIComponent(y)}`,
1217
1229
  e.value
1218
- ), Y = n.value, z = [];
1219
- let L = 0;
1220
- for (const A of T)
1221
- Y.has(A.Id) || (Y.set(A.Id, { ...A, _stats: !1, _meta: !1 }), z.push(A.Id), L++);
1222
- L && (o.value += L, ae(n));
1223
- for (const A of z) C(A);
1224
- } catch (T) {
1225
- f(T);
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
- g = !1, _();
1241
+ h = !1, _();
1230
1242
  }
1231
1243
  function x() {
1232
- g = !0;
1244
+ h = !0;
1233
1245
  }
1234
- async function $() {
1235
- x(), n.value = /* @__PURE__ */ new Map(), s.value = !1, l.value = 0, o.value = 0, u.value = null, S();
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 me(x), {
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: u,
1244
- enrichOne: C,
1245
- searchExtra: V,
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 Re(e) {
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 _n(e, t) {
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 Sn(e, t) {
1263
- var o, u, m, g, f, d;
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 = ((u = t.Trades) == null ? void 0 : u.Inception) ?? {}, s = a.History ?? [], c = s.length > 60 ? Math.ceil(s.length / 60) : 1, l = s.filter((r, w) => w % c === 0 || w === s.length - 1).map((r) => ({ Timestamp: r.Timestamp, AccountReturn: r.AccountReturn }));
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((r) => ({ n: r.MarketName, c: r.Count })) : [], e.AccountBalance = ((m = t.Status) == null ? void 0 : m.Balance) ?? null, e.CopiersAUM = ((g = t.CopiersBalance) == null ? void 0 : g.Balance) ?? null, e.MonthlyProfit = ((f = t.CopiersProfit) == null ? void 0 : f.Month) ?? null, e.YearlyProfit = ((d = t.CopiersProfit) == null ? void 0 : d.Year) ?? null, e._stats = !0;
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 Pe(e) {
1280
+ function Ce(e) {
1269
1281
  return new Promise((t) => setTimeout(t, e));
1270
1282
  }
1271
- function de() {
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 Rn(e, t = {}) {
1289
- const a = de(), n = Ce({
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 = k(() => e.value.filter((l) => Pn(l, n)));
1305
+ }), s = $(() => e.value.filter((l) => Rn(l, n)));
1294
1306
  function c() {
1295
- const l = de();
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 Pn(e, t) {
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 = W(e);
1320
+ const a = q(e);
1309
1321
  if (t.winrateMin != null && (a < 0 || a < t.winrateMin)) return !1;
1310
- const n = j(e.Inception);
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 Cn = {
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) => (j(t.Inception) ?? -1) - (j(e.Inception) ?? -1),
1325
- "age-asc": (e, t) => (j(e.Inception) ?? 1 / 0) - (j(t.Inception) ?? 1 / 0),
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) => W(t) - W(e),
1329
- "winrate-asc": (e, t) => W(e) - W(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 Tn(e, t = "return-desc") {
1336
- const a = R(t), n = k(() => {
1337
- const c = Cn[a.value] ?? (() => 0);
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 An(e, t) {
1354
- const a = R(1), n = k(() => Math.max(1, Math.ceil(e.value.length / t)));
1355
- E(n, (l) => {
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 = k(() => {
1370
+ const s = $(() => {
1359
1371
  const l = (a.value - 1) * t;
1360
1372
  return e.value.slice(l, l + t);
1361
- }), c = k(() => {
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((f) => f >= 1 && f <= o).sort((f, d) => f - d), g = [];
1365
- for (let f = 0; f < m.length; f++)
1366
- f && m[f] - m[f - 1] > 1 && g.push("…"), g.push(m[f]);
1367
- return g;
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 Fn(e) {
1386
- const t = R(/* @__PURE__ */ new Map()), a = R(/* @__PURE__ */ new Map());
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, u = o.value.get(c);
1392
- if (u && (u.loading || u.trades !== null)) return;
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 g = "";
1407
+ let h = "";
1396
1408
  if (l === "closed") {
1397
- const I = /* @__PURE__ */ new Date(), _ = new Date(Date.now() - We * 864e5), h = (C) => C.toISOString().replace(/\.\d+Z$/, "Z");
1398
- g = `?startDate=${encodeURIComponent(h(_))}&endDate=${encodeURIComponent(h(I))}`;
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 f = J(e.value, `/api/strategies/${c}/signals/${l}${g}`);
1401
- let d = [], r = null;
1412
+ const v = ee(e.value, `/api/strategies/${c}/signals/${l}${h}`);
1413
+ let d = [], u = null;
1402
1414
  try {
1403
- const I = await fetch(f);
1404
- if (!I.ok) throw Z("http_error", `${I.status}`);
1405
- d = await I.json();
1406
- } catch (I) {
1407
- r = I.code ? I : Z("fetch_failed", I.message), d = [];
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 w = new Map(o.value);
1410
- w.set(c, { loading: !1, trades: d, error: r }), o.value = w;
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 Nn = ["data-theme"], Ln = { class: "brand-row" }, Dn = ["title"], Un = { "aria-hidden": "true" }, Vn = { class: "pelican-main" }, En = /* @__PURE__ */ F({
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
- ne(ua, a.apiBase), ne(ca, a.catalogBase ?? a.apiBase), ne(Te, a.locale);
1430
- const s = Me(a, "apiBase"), c = Me(a, "catalogBase"), l = $n(a.theme);
1431
- E(l.mode, (x) => n("update:theme", x)), E(
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 = In({
1447
+ const o = kn({
1436
1448
  apiBase: s,
1437
1449
  catalogBase: c,
1438
1450
  onError: (x) => n("error", x)
1439
- }), u = Rn(o.catalog, a.defaultFilters ?? {}), m = Tn(u.filtered, a.defaultSort), g = An(m.sorted, a.pageSize), f = Fn(s), d = Ce(/* @__PURE__ */ new Set()), r = R(!1), w = R(null);
1440
- function I(x) {
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 $ = o.catalog.value.find((M) => M.Id === x);
1443
- $ && ((!$._meta || !$._stats) && !$._enrichAttempted && o.enrichOne(x), n("select-strategy", $));
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), g.setPage(1);
1465
+ m.toggleColumn(x), h.setPage(1);
1447
1466
  }
1448
- function h(x) {
1449
- Object.assign(u.filters, x), g.setPage(1);
1467
+ function f(x) {
1468
+ Object.assign(r.filters, x), h.setPage(1);
1450
1469
  }
1451
- function C() {
1452
- const x = de();
1453
- Object.assign(u.filters, x), u.filters.risk = x.risk, w.value = null, g.setPage(1);
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 V({ id: x, kind: $ }) {
1456
- f.load(x, $);
1474
+ function A({ id: x, kind: w }) {
1475
+ v.load(x, w);
1457
1476
  }
1458
1477
  function S(x) {
1459
- x === "prev" ? g.prev() : x === "next" ? g.next() : g.setPage(x);
1478
+ x === "prev" ? h.prev() : x === "next" ? h.next() : h.setPage(x);
1460
1479
  }
1461
- return Be(() => o.start()), (x, $) => (p(), y("div", {
1480
+ return Be(() => o.start()), (x, w) => (g(), M("div", {
1462
1481
  class: "pelican-libsoc",
1463
- "data-theme": v(l).resolved.value
1482
+ "data-theme": p(l).resolved.value
1464
1483
  }, [
1465
- i("header", Ln, [
1466
- q(x.$slots, "brand", {}, () => [
1467
- $[6] || ($[6] = i("div", { class: "default-brand" }, "Libertex Social — Copy Trading", -1))
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: v(l).mode.value,
1473
- onClick: $[0] || ($[0] = //@ts-ignore
1474
- (...M) => v(l).cycle && v(l).cycle(...M))
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", Un, b(v(l).resolved.value === "dark" ? "🌙" : "☀️"), 1)
1477
- ], 8, Dn)
1495
+ i("span", Dn, b(p(l).resolved.value === "dark" ? "🌙" : "☀️"), 1)
1496
+ ], 8, Ln)
1478
1497
  ]),
1479
- P(st, {
1480
- search: v(u).filters.search,
1481
- "sort-key": v(m).sortKey.value,
1482
- total: v(o).total.value,
1483
- "filtered-total": v(u).filtered.value.length,
1484
- page: v(g).page.value,
1485
- "total-pages": v(g).totalPages.value,
1486
- "onUpdate:search": $[1] || ($[1] = (M) => h({ search: M })),
1487
- "onUpdate:sortKey": $[2] || ($[2] = (M) => v(m).setKey(M)),
1488
- onRefresh: v(o).refresh,
1489
- onToggleFilters: $[3] || ($[3] = (M) => r.value = !r.value)
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
- P(wn, {
1492
- loaded: v(o).loaded.value,
1493
- total: v(o).total.value,
1494
- active: v(o).building.value && !v(o).ready.value
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", Vn, [
1497
- P(Ut, {
1498
- filters: v(u).filters,
1499
- "invest-amount": w.value,
1500
- open: r.value,
1501
- "onUpdate:filters": h,
1502
- "onUpdate:investAmount": $[4] || ($[4] = (M) => w.value = M),
1503
- onReset: C
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
- P(gn, {
1506
- "page-items": v(g).pageItems.value,
1524
+ T(pn, {
1525
+ "page-items": p(h).pageItems.value,
1507
1526
  expanded: d,
1508
- "sort-key": v(m).sortKey.value,
1509
- page: v(g).page.value,
1510
- "total-pages": v(g).totalPages.value,
1511
- "page-range": v(g).pageRange.value,
1512
- "open-signals": v(f).open.value,
1513
- "closed-signals": v(f).closed.value,
1514
- onToggleRow: I,
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: V,
1517
- onSelect: $[5] || ($[5] = (M) => n("select-strategy", M)),
1535
+ onLoadTrades: A,
1536
+ onSelect: w[5] || (w[5] = (y) => n("select-strategy", y)),
1518
1537
  onGo: S
1519
1538
  }, {
1520
- empty: ue(() => [
1521
- q(x.$slots, "empty", {}, () => [
1522
- $[7] || ($[7] = D("No matches.", -1))
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": ue((M) => [
1526
- q(x.$slots, "row-actions", Oe(Ke(M)), void 0, !0)
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, Nn));
1550
+ ], 8, Fn));
1532
1551
  }
1533
- }), On = /* @__PURE__ */ N(En, [["__scopeId", "data-v-33b03803"]]);
1552
+ }), Bn = /* @__PURE__ */ N(Vn, [["__scopeId", "data-v-e2cce41d"]]);
1534
1553
  export {
1535
- On as PelicanLibertexSocial,
1554
+ Bn as PelicanLibertexSocial,
1536
1555
  qe as SORT_KEYS,
1537
1556
  Xe as SORT_LABELS,
1538
1557
  Ze as SORT_TOGGLE,
1539
- de as defaultFilters
1558
+ me as defaultFilters
1540
1559
  };
1541
1560
  //# sourceMappingURL=pelican-libertex-social.mjs.map