melonykit 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as getClientSetting, i as routeTo, t as setClientSetting, r as useQuery } from "./browser-
|
|
1
|
+
export { n as getClientSetting, i as routeTo, t as setClientSetting, r as useQuery } from "./browser-jtptg5Z4.js";
|
|
@@ -1,5 +1,27 @@
|
|
|
1
|
-
//#region src/functions/
|
|
1
|
+
//#region src/functions/_average.js
|
|
2
2
|
function e(e) {
|
|
3
|
+
if (!Array.isArray(e) || e.length === 0) return null;
|
|
4
|
+
let t = 0, n = 0;
|
|
5
|
+
for (let r of e) {
|
|
6
|
+
if (!Number.isFinite(r)) return null;
|
|
7
|
+
let i = r / e.length - n, a = t + i;
|
|
8
|
+
n = a - t - i, t = a;
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/functions/checks/_is-string.js
|
|
14
|
+
function t(e) {
|
|
15
|
+
return typeof e == "string";
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region src/functions/_camel-case-to-title-case.js
|
|
19
|
+
function n(e) {
|
|
20
|
+
return t(e) ? e.replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").split(" ").filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()).join(" ") : "";
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/functions/_parse-hex-color.js
|
|
24
|
+
function r(e) {
|
|
3
25
|
if (typeof e != "string" || !/^#([\da-f]{3}|[\da-f]{6})$/i.test(e)) throw TypeError("hex must be a three- or six-digit hexadecimal color");
|
|
4
26
|
let t = e.slice(1), n = t.length === 3 ? [...t].map((e) => e.repeat(2)).join("") : t;
|
|
5
27
|
return [
|
|
@@ -10,37 +32,103 @@ function e(e) {
|
|
|
10
32
|
}
|
|
11
33
|
//#endregion
|
|
12
34
|
//#region src/functions/_convert-hex-to-rgba.js
|
|
13
|
-
function
|
|
14
|
-
let [
|
|
15
|
-
if (!Number.isFinite(
|
|
16
|
-
if (
|
|
17
|
-
return `rgba(${
|
|
35
|
+
function i(e, t) {
|
|
36
|
+
let [n, i, a] = r(e);
|
|
37
|
+
if (!Number.isFinite(t)) throw TypeError("alpha must be a finite number");
|
|
38
|
+
if (t < 0 || t > 1) throw RangeError("alpha must be between 0 and 1");
|
|
39
|
+
return `rgba(${n}, ${i}, ${a}, ${t})`;
|
|
18
40
|
}
|
|
19
41
|
//#endregion
|
|
20
|
-
//#region src/functions/checks/_is-
|
|
21
|
-
function
|
|
22
|
-
return
|
|
42
|
+
//#region src/functions/checks/_is-array.js
|
|
43
|
+
function a(e) {
|
|
44
|
+
return Array.isArray(e);
|
|
23
45
|
}
|
|
24
46
|
//#endregion
|
|
25
|
-
//#region src/functions/
|
|
26
|
-
function
|
|
27
|
-
return
|
|
47
|
+
//#region src/functions/checks/_is-empty-array.js
|
|
48
|
+
function o(e) {
|
|
49
|
+
return a(e) && e.length === 0;
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/functions/checks/_is-function.js
|
|
53
|
+
function s(e) {
|
|
54
|
+
return typeof e == "function";
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/functions/checks/_is-number.js
|
|
58
|
+
function c(e) {
|
|
59
|
+
return typeof e == "number" && Number.isFinite(e);
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/functions/checks/_is-positive-number.js
|
|
63
|
+
function l(e) {
|
|
64
|
+
return c(e) && e > 0;
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/functions/_create-cache.js
|
|
68
|
+
function u({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
|
|
69
|
+
let i = /* @__PURE__ */ new Map();
|
|
70
|
+
async function c(t, n) {
|
|
71
|
+
if (i.has(t)) return !1;
|
|
72
|
+
let r = Date.now();
|
|
73
|
+
return i.set(t, {
|
|
74
|
+
...n,
|
|
75
|
+
createdAt: r,
|
|
76
|
+
lastUpdate: r
|
|
77
|
+
}), s(e) && await e(t), !0;
|
|
78
|
+
}
|
|
79
|
+
async function u(e, n) {
|
|
80
|
+
if (!i.has(e) || typeof n != "function") return !1;
|
|
81
|
+
let r = i.get(e);
|
|
82
|
+
return await n(r), r.lastUpdate = Date.now(), s(t) && await t(e), !0;
|
|
83
|
+
}
|
|
84
|
+
function d(e) {
|
|
85
|
+
return i.get(e) ?? null;
|
|
86
|
+
}
|
|
87
|
+
function f() {
|
|
88
|
+
return i.size;
|
|
89
|
+
}
|
|
90
|
+
function p() {
|
|
91
|
+
return i.entries();
|
|
92
|
+
}
|
|
93
|
+
function m(e) {
|
|
94
|
+
return i.has(e);
|
|
95
|
+
}
|
|
96
|
+
async function h(e) {
|
|
97
|
+
if (!i.has(e)) return !1;
|
|
98
|
+
let t = i.get(e);
|
|
99
|
+
return i.delete(e), s(n) && await n(e, t), !0;
|
|
100
|
+
}
|
|
101
|
+
function g({ interval: e, checks: t, now: n = Date.now, setIntervalFn: r = setInterval } = {}) {
|
|
102
|
+
l(e) && a(t) && !o(t) && t.every((e) => s(e)) && s(n) && s(r) && r(async () => {
|
|
103
|
+
let e = n();
|
|
104
|
+
for (let [n, r] of i) t.some((t) => t(r, e)) && await h(n);
|
|
105
|
+
}, e)?.unref?.();
|
|
106
|
+
}
|
|
107
|
+
return g(r), {
|
|
108
|
+
add: c,
|
|
109
|
+
get: d,
|
|
110
|
+
size: f,
|
|
111
|
+
entries: p,
|
|
112
|
+
update: u,
|
|
113
|
+
has: m,
|
|
114
|
+
remove: h
|
|
115
|
+
};
|
|
28
116
|
}
|
|
29
117
|
//#endregion
|
|
30
118
|
//#region src/functions/_darken-hex-color.js
|
|
31
|
-
function
|
|
32
|
-
let
|
|
33
|
-
if (!Number.isFinite(
|
|
34
|
-
if (
|
|
35
|
-
let i = 1 -
|
|
36
|
-
return `#${
|
|
119
|
+
function d(e, t) {
|
|
120
|
+
let n = r(e);
|
|
121
|
+
if (!Number.isFinite(t)) throw TypeError("amount must be a finite number");
|
|
122
|
+
if (t < 0 || t > 1) throw RangeError("amount must be between 0 and 1");
|
|
123
|
+
let i = 1 - t;
|
|
124
|
+
return `#${n.map((e) => Math.round(e * i)).map((e) => e.toString(16).padStart(2, "0")).join("")}`;
|
|
37
125
|
}
|
|
38
126
|
//#endregion
|
|
39
127
|
//#region src/functions/_format-date.js
|
|
40
|
-
function
|
|
128
|
+
function f(e) {
|
|
41
129
|
return Object.prototype.toString.call(e) === "[object Date]" && !isNaN(e);
|
|
42
130
|
}
|
|
43
|
-
var
|
|
131
|
+
var p = /d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g, m = /\b(?:[A-Z]{1,3}[A-Z][TC])(?:[-+]\d{4})?|((?:Australian )?(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time)\b/g, h = /[^-+\dA-Z]/g, g = (e, t = 2) => String(e).padStart(t, "0"), _ = {
|
|
44
132
|
dayNames: [
|
|
45
133
|
"So",
|
|
46
134
|
"Mo",
|
|
@@ -94,64 +182,64 @@ var o = /d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'
|
|
|
94
182
|
"PM"
|
|
95
183
|
]
|
|
96
184
|
};
|
|
97
|
-
function
|
|
98
|
-
if (!
|
|
99
|
-
let
|
|
100
|
-
d: () =>
|
|
101
|
-
dd: () =>
|
|
102
|
-
ddd: () =>
|
|
103
|
-
DDD: () =>
|
|
104
|
-
y:
|
|
105
|
-
m:
|
|
106
|
-
d:
|
|
107
|
-
_:
|
|
108
|
-
dayName:
|
|
185
|
+
function v(e, n = "dd.mm.yyyy", r, i) {
|
|
186
|
+
if (!f(e) || !t(n)) return "";
|
|
187
|
+
let a = () => r ? "getUTC" : "get", o = () => e[a() + "Date"](), s = () => e[a() + "Day"](), c = () => e[a() + "Month"](), l = () => e[a() + "FullYear"](), u = () => e[a() + "Hours"](), d = () => e[a() + "Minutes"](), m = () => e[a() + "Seconds"](), h = () => e[a() + "Milliseconds"](), v = () => r ? 0 : e.getTimezoneOffset(), C = () => y(e), w = () => b(e), T = {
|
|
188
|
+
d: () => o(),
|
|
189
|
+
dd: () => g(o()),
|
|
190
|
+
ddd: () => _.dayNames[s()],
|
|
191
|
+
DDD: () => S({
|
|
192
|
+
y: l(),
|
|
193
|
+
m: c(),
|
|
194
|
+
d: o(),
|
|
195
|
+
_: a(),
|
|
196
|
+
dayName: _.dayNames[s()],
|
|
109
197
|
short: !0
|
|
110
198
|
}),
|
|
111
|
-
dddd: () =>
|
|
112
|
-
DDDD: () =>
|
|
113
|
-
y:
|
|
114
|
-
m:
|
|
115
|
-
d:
|
|
116
|
-
_:
|
|
117
|
-
dayName:
|
|
199
|
+
dddd: () => _.dayNames[s() + 7],
|
|
200
|
+
DDDD: () => S({
|
|
201
|
+
y: l(),
|
|
202
|
+
m: c(),
|
|
203
|
+
d: o(),
|
|
204
|
+
_: a(),
|
|
205
|
+
dayName: _.dayNames[s() + 7]
|
|
118
206
|
}),
|
|
119
|
-
m: () =>
|
|
120
|
-
mm: () =>
|
|
121
|
-
mmm: () =>
|
|
122
|
-
mmmm: () =>
|
|
123
|
-
yy: () => String(
|
|
124
|
-
yyyy: () => l(
|
|
125
|
-
h: () =>
|
|
126
|
-
hh: () =>
|
|
127
|
-
H: () =>
|
|
128
|
-
HH: () =>
|
|
129
|
-
M: () =>
|
|
130
|
-
MM: () =>
|
|
131
|
-
s: () =>
|
|
132
|
-
ss: () =>
|
|
133
|
-
l: () =>
|
|
134
|
-
L: () =>
|
|
135
|
-
t: () =>
|
|
136
|
-
tt: () =>
|
|
137
|
-
T: () =>
|
|
138
|
-
TT: () =>
|
|
139
|
-
Z: () => i ? "GMT" : r ? "UTC" :
|
|
140
|
-
o: () => (
|
|
141
|
-
p: () => (
|
|
207
|
+
m: () => c() + 1,
|
|
208
|
+
mm: () => g(c() + 1),
|
|
209
|
+
mmm: () => _.monthNames[c()],
|
|
210
|
+
mmmm: () => _.monthNames[c() + 12],
|
|
211
|
+
yy: () => String(l()).slice(2),
|
|
212
|
+
yyyy: () => g(l(), 4),
|
|
213
|
+
h: () => u() % 12 || 12,
|
|
214
|
+
hh: () => g(u() % 12 || 12),
|
|
215
|
+
H: () => u(),
|
|
216
|
+
HH: () => g(u()),
|
|
217
|
+
M: () => d(),
|
|
218
|
+
MM: () => g(d()),
|
|
219
|
+
s: () => m(),
|
|
220
|
+
ss: () => g(m()),
|
|
221
|
+
l: () => g(h(), 3),
|
|
222
|
+
L: () => g(Math.floor(h() / 10)),
|
|
223
|
+
t: () => u() < 12 ? _.timeNames[0] : _.timeNames[1],
|
|
224
|
+
tt: () => u() < 12 ? _.timeNames[2] : _.timeNames[3],
|
|
225
|
+
T: () => u() < 12 ? _.timeNames[4] : _.timeNames[5],
|
|
226
|
+
TT: () => u() < 12 ? _.timeNames[6] : _.timeNames[7],
|
|
227
|
+
Z: () => i ? "GMT" : r ? "UTC" : x(e),
|
|
228
|
+
o: () => (v() > 0 ? "-" : "+") + g(Math.floor(Math.abs(v()) / 60) * 100 + Math.abs(v()) % 60, 4),
|
|
229
|
+
p: () => (v() > 0 ? "-" : "+") + g(Math.floor(Math.abs(v()) / 60), 2) + ":" + g(Math.floor(Math.abs(v()) % 60), 2),
|
|
142
230
|
S: () => [
|
|
143
231
|
"th",
|
|
144
232
|
"st",
|
|
145
233
|
"nd",
|
|
146
234
|
"rd"
|
|
147
|
-
][
|
|
235
|
+
][o() % 10 > 3 ? 0 : (o() % 100 - o() % 10 != 10) * o() % 10],
|
|
148
236
|
W: () => C(),
|
|
149
|
-
WW: () =>
|
|
237
|
+
WW: () => g(C()),
|
|
150
238
|
N: () => w()
|
|
151
239
|
};
|
|
152
|
-
return
|
|
240
|
+
return n.replace(p, (e) => e in T ? T[e]() : e.slice(1, e.length - 1));
|
|
153
241
|
}
|
|
154
|
-
var
|
|
242
|
+
var y = (e) => {
|
|
155
243
|
let t = new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
156
244
|
t.setDate(t.getDate() - (t.getDay() + 6) % 7 + 3);
|
|
157
245
|
let n = new Date(t.getFullYear(), 0, 4);
|
|
@@ -160,23 +248,48 @@ var f = (e) => {
|
|
|
160
248
|
t.setHours(t.getHours() - r);
|
|
161
249
|
let i = (t - n) / 6048e5;
|
|
162
250
|
return 1 + Math.floor(i);
|
|
163
|
-
},
|
|
251
|
+
}, b = (e) => {
|
|
164
252
|
let t = e.getDay();
|
|
165
253
|
return t === 0 && (t = 7), t;
|
|
166
|
-
},
|
|
254
|
+
}, x = (e) => (String(e).match(m) || [""]).pop().replace(h, "").replace(/GMT\+0000/g, "UTC"), S = ({ y: e, m: t, d: n, _: r, dayName: i, short: a = !1 }) => {
|
|
167
255
|
let o = /* @__PURE__ */ new Date(), s = /* @__PURE__ */ new Date();
|
|
168
256
|
s.setDate(s[r + "Date"]() - 1);
|
|
169
257
|
let c = /* @__PURE__ */ new Date();
|
|
170
258
|
return c.setDate(c[r + "Date"]() + 1), o[r + "FullYear"]() === e && o[r + "Month"]() === t && o[r + "Date"]() === n ? a ? "Tdy" : "Today" : s[r + "FullYear"]() === e && s[r + "Month"]() === t && s[r + "Date"]() === n ? a ? "Ysd" : "Yesterday" : c[r + "FullYear"]() === e && c[r + "Month"]() === t && c[r + "Date"]() === n ? a ? "Tmw" : "Tomorrow" : i;
|
|
171
259
|
};
|
|
172
260
|
//#endregion
|
|
261
|
+
//#region src/functions/checks/_is-nil.js
|
|
262
|
+
function C(e) {
|
|
263
|
+
return e == null;
|
|
264
|
+
}
|
|
265
|
+
//#endregion
|
|
266
|
+
//#region src/functions/checks/_is-object.js
|
|
267
|
+
function w(e) {
|
|
268
|
+
return !C(e) && typeof e == "object" && !a(e);
|
|
269
|
+
}
|
|
270
|
+
//#endregion
|
|
271
|
+
//#region src/functions/checks/_is-empty-object.js
|
|
272
|
+
function T(e) {
|
|
273
|
+
return w(e) && Reflect.ownKeys(e).every((t) => !Object.prototype.propertyIsEnumerable.call(e, t));
|
|
274
|
+
}
|
|
275
|
+
//#endregion
|
|
276
|
+
//#region src/functions/checks/_is-empty-string.js
|
|
277
|
+
function E(e) {
|
|
278
|
+
return t(e) && e.trim().length === 0;
|
|
279
|
+
}
|
|
280
|
+
//#endregion
|
|
281
|
+
//#region src/functions/checks/_is-negative-number.js
|
|
282
|
+
function D(e) {
|
|
283
|
+
return c(e) && e < 0;
|
|
284
|
+
}
|
|
285
|
+
//#endregion
|
|
173
286
|
//#region src/functions/_kebab-case-to-title-case.js
|
|
174
|
-
function
|
|
175
|
-
return
|
|
287
|
+
function O(e) {
|
|
288
|
+
return t(e) ? e.split("-").filter(Boolean).map((e) => e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()).join(" ") : "";
|
|
176
289
|
}
|
|
177
290
|
//#endregion
|
|
178
291
|
//#region src/functions/_median.js
|
|
179
|
-
function
|
|
292
|
+
function k(e) {
|
|
180
293
|
if (!Array.isArray(e) || e.length === 0) return null;
|
|
181
294
|
for (let t of e) if (!Number.isFinite(t)) return null;
|
|
182
295
|
let t = [...e].sort((e, t) => e - t), n = Math.floor(t.length / 2);
|
|
@@ -184,7 +297,7 @@ function _(e) {
|
|
|
184
297
|
}
|
|
185
298
|
//#endregion
|
|
186
299
|
//#region src/functions/_request.js
|
|
187
|
-
async function
|
|
300
|
+
async function A({ url: e, body: t, method: n = "POST", headers: r = {} } = {}) {
|
|
188
301
|
let i = n !== "GET" && t !== void 0 ? JSON.stringify(t) : void 0, a = await fetch(e, {
|
|
189
302
|
method: n,
|
|
190
303
|
headers: {
|
|
@@ -204,31 +317,26 @@ async function v({ url: e, body: t, method: n = "POST", headers: r = {} } = {})
|
|
|
204
317
|
return a.ok || (s.error = s.data ?? /* @__PURE__ */ Error(`Request failed with status ${a.status}.`)), s;
|
|
205
318
|
}
|
|
206
319
|
//#endregion
|
|
207
|
-
//#region src/functions/checks/_is-number.js
|
|
208
|
-
function y(e) {
|
|
209
|
-
return typeof e == "number" && Number.isFinite(e);
|
|
210
|
-
}
|
|
211
|
-
//#endregion
|
|
212
320
|
//#region src/functions/_risk-reward.js
|
|
213
|
-
function
|
|
321
|
+
function j(e = {}) {
|
|
214
322
|
let { entry: t, exit: n, riskRatio: r = 20 } = e ?? {};
|
|
215
|
-
if (!
|
|
323
|
+
if (!c(t) || t <= 0 || !c(n) || n <= 0 || !c(r) || r <= 0) return null;
|
|
216
324
|
let i = (n - t) / t / (r / 100);
|
|
217
325
|
return Math.round(i * 10) / 10;
|
|
218
326
|
}
|
|
219
327
|
//#endregion
|
|
220
328
|
//#region src/functions/_size.js
|
|
221
|
-
function
|
|
329
|
+
function M(e) {
|
|
222
330
|
return e == null ? 0 : Array.isArray(e) || typeof e == "string" ? e.length : typeof e == "object" || typeof e == "function" ? Object.keys(e).length : 0;
|
|
223
331
|
}
|
|
224
332
|
//#endregion
|
|
225
333
|
//#region src/functions/_slugify.js
|
|
226
|
-
function
|
|
334
|
+
function N(e) {
|
|
227
335
|
return typeof e == "string" ? e.trim().toLowerCase().replace(/ä/g, "ae").replace(/ö/g, "oe").replace(/ü/g, "ue").replace(/ß/g, "ss").replace(/æ/g, "ae").replace(/œ/g, "oe").replace(/ø/g, "o").normalize("NFD").replace(/\p{Diacritic}/gu, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") : "";
|
|
228
336
|
}
|
|
229
337
|
//#endregion
|
|
230
338
|
//#region src/functions/_to-number.js
|
|
231
|
-
function
|
|
339
|
+
function P(e, t = null) {
|
|
232
340
|
let n = typeof e == "number" ? e : typeof e == "string" && e.trim() !== "" ? Number(e) : NaN;
|
|
233
341
|
if (!Number.isFinite(n)) return null;
|
|
234
342
|
if (t == null) return n;
|
|
@@ -236,100 +344,4 @@ function C(e, t = null) {
|
|
|
236
344
|
return Math.round(n * r) / r;
|
|
237
345
|
}
|
|
238
346
|
//#endregion
|
|
239
|
-
|
|
240
|
-
function w(e) {
|
|
241
|
-
return Array.isArray(e);
|
|
242
|
-
}
|
|
243
|
-
//#endregion
|
|
244
|
-
//#region src/functions/checks/_is-empty-array.js
|
|
245
|
-
function T(e) {
|
|
246
|
-
return w(e) && e.length === 0;
|
|
247
|
-
}
|
|
248
|
-
//#endregion
|
|
249
|
-
//#region src/functions/checks/_is-function.js
|
|
250
|
-
function E(e) {
|
|
251
|
-
return typeof e == "function";
|
|
252
|
-
}
|
|
253
|
-
//#endregion
|
|
254
|
-
//#region src/functions/checks/_is-positive-number.js
|
|
255
|
-
function D(e) {
|
|
256
|
-
return y(e) && e > 0;
|
|
257
|
-
}
|
|
258
|
-
//#endregion
|
|
259
|
-
//#region src/functions/_create-cache.js
|
|
260
|
-
function O({ onCreate: e, onUpdate: t, onDelete: n, autoCleanup: r } = {}) {
|
|
261
|
-
let i = /* @__PURE__ */ new Map();
|
|
262
|
-
async function a(t, n) {
|
|
263
|
-
if (i.has(t)) return !1;
|
|
264
|
-
let r = Date.now();
|
|
265
|
-
return i.set(t, {
|
|
266
|
-
...n,
|
|
267
|
-
createdAt: r,
|
|
268
|
-
lastUpdate: r
|
|
269
|
-
}), E(e) && await e(t), !0;
|
|
270
|
-
}
|
|
271
|
-
async function o(e, n) {
|
|
272
|
-
if (!i.has(e) || typeof n != "function") return !1;
|
|
273
|
-
let r = i.get(e);
|
|
274
|
-
return await n(r), r.lastUpdate = Date.now(), E(t) && await t(e), !0;
|
|
275
|
-
}
|
|
276
|
-
function s(e) {
|
|
277
|
-
return i.get(e) ?? null;
|
|
278
|
-
}
|
|
279
|
-
function c() {
|
|
280
|
-
return i.size;
|
|
281
|
-
}
|
|
282
|
-
function l() {
|
|
283
|
-
return i.entries();
|
|
284
|
-
}
|
|
285
|
-
function u(e) {
|
|
286
|
-
return i.has(e);
|
|
287
|
-
}
|
|
288
|
-
async function d(e) {
|
|
289
|
-
if (!i.has(e)) return !1;
|
|
290
|
-
let t = i.get(e);
|
|
291
|
-
return i.delete(e), E(n) && await n(e, t), !0;
|
|
292
|
-
}
|
|
293
|
-
function f({ interval: e, checks: t, now: n = Date.now, setIntervalFn: r = setInterval } = {}) {
|
|
294
|
-
D(e) && w(t) && !T(t) && t.every((e) => E(e)) && E(n) && E(r) && r(async () => {
|
|
295
|
-
let e = n();
|
|
296
|
-
for (let [n, r] of i) t.some((t) => t(r, e)) && await d(n);
|
|
297
|
-
}, e)?.unref?.();
|
|
298
|
-
}
|
|
299
|
-
return f(r), {
|
|
300
|
-
add: a,
|
|
301
|
-
get: s,
|
|
302
|
-
size: c,
|
|
303
|
-
entries: l,
|
|
304
|
-
update: o,
|
|
305
|
-
has: u,
|
|
306
|
-
remove: d
|
|
307
|
-
};
|
|
308
|
-
}
|
|
309
|
-
//#endregion
|
|
310
|
-
//#region src/functions/checks/_is-nil.js
|
|
311
|
-
function k(e) {
|
|
312
|
-
return e == null;
|
|
313
|
-
}
|
|
314
|
-
//#endregion
|
|
315
|
-
//#region src/functions/checks/_is-object.js
|
|
316
|
-
function A(e) {
|
|
317
|
-
return !k(e) && typeof e == "object" && !w(e);
|
|
318
|
-
}
|
|
319
|
-
//#endregion
|
|
320
|
-
//#region src/functions/checks/_is-empty-object.js
|
|
321
|
-
function j(e) {
|
|
322
|
-
return A(e) && Reflect.ownKeys(e).every((t) => !Object.prototype.propertyIsEnumerable.call(e, t));
|
|
323
|
-
}
|
|
324
|
-
//#endregion
|
|
325
|
-
//#region src/functions/checks/_is-empty-string.js
|
|
326
|
-
function M(e) {
|
|
327
|
-
return n(e) && e.trim().length === 0;
|
|
328
|
-
}
|
|
329
|
-
//#endregion
|
|
330
|
-
//#region src/functions/checks/_is-negative-number.js
|
|
331
|
-
function N(e) {
|
|
332
|
-
return y(e) && e < 0;
|
|
333
|
-
}
|
|
334
|
-
//#endregion
|
|
335
|
-
export { t as C, n as S, _, k as a, i as b, E as c, C as d, S as f, v as g, y as h, A as i, T as l, b as m, M as n, O as o, x as p, j as r, D as s, N as t, w as u, g as v, r as x, d as y };
|
|
347
|
+
export { t as C, n as S, c as _, A as a, a as b, D as c, w as d, C as f, l as g, u as h, j as i, E as l, d as m, N as n, k as o, v as p, M as r, O as s, P as t, T as u, s as v, e as w, i as x, o as y };
|
package/dist/functions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { w as average, S as camelCaseToTitleCase, x as convertHexToRgba, h as createCache, m as darkenHexColor, p as formatDate, b as isArray, y as isEmptyArray, u as isEmptyObject, l as isEmptyString, v as isFunction, c as isNegativeNumber, f as isNil, _ as isNumber, d as isObject, g as isPositiveNumber, C as isString, s as kebabCaseToTitleCase, o as median, a as request, i as riskReward, r as size, n as slugify, t as toNumber } from "./functions-huvj-bhb.js";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e, t } from "./browser-
|
|
2
|
-
import {
|
|
1
|
+
import { n as e, t } from "./browser-jtptg5Z4.js";
|
|
2
|
+
import { l as n, m as r } from "./functions-huvj-bhb.js";
|
|
3
3
|
import { useSignal as i } from "@preact/signals";
|
|
4
4
|
import { useEffect as a, useId as o, useRef as s } from "preact/hooks";
|
|
5
5
|
import { Fragment as c, jsx as l, jsxs as u } from "preact/jsx-runtime";
|
|
@@ -1146,7 +1146,7 @@ var Mt = bt`
|
|
|
1146
1146
|
`,
|
|
1147
1147
|
secondary: O`
|
|
1148
1148
|
color: ${k.colors.fore.primary};
|
|
1149
|
-
border-color: ${
|
|
1149
|
+
border-color: ${r(k.colors.secondary, .2)};
|
|
1150
1150
|
background-color: ${k.colors.secondary};
|
|
1151
1151
|
`,
|
|
1152
1152
|
neutral: O`
|
|
@@ -1532,15 +1532,15 @@ var Ut = {
|
|
|
1532
1532
|
transition: width .3s ease;
|
|
1533
1533
|
`,
|
|
1534
1534
|
normal: O`
|
|
1535
|
-
border: solid 1px ${
|
|
1535
|
+
border: solid 1px ${r(k.colors.primary, .3)};
|
|
1536
1536
|
background-color: ${k.colors.primary};
|
|
1537
1537
|
`,
|
|
1538
1538
|
warn: O`
|
|
1539
|
-
border: solid 1px ${
|
|
1539
|
+
border: solid 1px ${r(k.colors.secondary, .2)};
|
|
1540
1540
|
background-color: ${k.colors.secondary};
|
|
1541
1541
|
`,
|
|
1542
1542
|
danger: O`
|
|
1543
|
-
border: solid 1px ${
|
|
1543
|
+
border: solid 1px ${r(k.colors.danger, .3)};
|
|
1544
1544
|
background-color: ${k.colors.danger};
|
|
1545
1545
|
`
|
|
1546
1546
|
};
|
|
@@ -1947,7 +1947,7 @@ var an = {
|
|
|
1947
1947
|
height: 1rem;
|
|
1948
1948
|
margin-top: -.375rem;
|
|
1949
1949
|
border-radius: 50%;
|
|
1950
|
-
border: solid 1px ${
|
|
1950
|
+
border: solid 1px ${r(k.colors.primary, .3)};
|
|
1951
1951
|
background-color: ${k.colors.primary};
|
|
1952
1952
|
transition: transform .15s ease;
|
|
1953
1953
|
}
|
|
@@ -2159,7 +2159,7 @@ var ln = bt`
|
|
|
2159
2159
|
--checked-background-color: ${k.colors.primary};
|
|
2160
2160
|
`,
|
|
2161
2161
|
secondary: O`
|
|
2162
|
-
--checked-border-color: ${
|
|
2162
|
+
--checked-border-color: ${r(k.colors.secondary, .2)};
|
|
2163
2163
|
--checked-background-color: ${k.colors.secondary};
|
|
2164
2164
|
`,
|
|
2165
2165
|
input: O`
|
|
@@ -2267,7 +2267,7 @@ var gn = {
|
|
|
2267
2267
|
background-color: ${k.colors.back.secondary};
|
|
2268
2268
|
|
|
2269
2269
|
&:before {
|
|
2270
|
-
border-color: ${
|
|
2270
|
+
border-color: ${r(k.colors.primary, .3)};
|
|
2271
2271
|
background-color: ${k.colors.primary};
|
|
2272
2272
|
transform: translate(${mn}px, -50%);
|
|
2273
2273
|
}
|
|
@@ -2306,16 +2306,16 @@ var gn = {
|
|
|
2306
2306
|
};
|
|
2307
2307
|
//#endregion
|
|
2308
2308
|
//#region src/components/_tag.jsx
|
|
2309
|
-
function _n({ className: e, variant: t = "normal", iconName:
|
|
2309
|
+
function _n({ className: e, variant: t = "normal", iconName: r = "", label: i }) {
|
|
2310
2310
|
return /* @__PURE__ */ l(c, { children: /* @__PURE__ */ u("div", {
|
|
2311
2311
|
className: D(vn.base, vn[t] ?? vn.normal, e),
|
|
2312
|
-
"has-icon": !r
|
|
2313
|
-
children: [
|
|
2312
|
+
"has-icon": !n(r),
|
|
2313
|
+
children: [r && /* @__PURE__ */ l(c, { children: /* @__PURE__ */ l(wt, {
|
|
2314
2314
|
className: O`
|
|
2315
2315
|
${k.extends.verticalCenter}
|
|
2316
2316
|
left: .4rem;
|
|
2317
2317
|
`,
|
|
2318
|
-
iconName:
|
|
2318
|
+
iconName: r,
|
|
2319
2319
|
size: ".9rem"
|
|
2320
2320
|
}) }), i]
|
|
2321
2321
|
}) });
|