@polymarbot/shared 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,693 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJS = (cb, mod) => function __require() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
11
+ var __export = (target, all) => {
12
+ for (var name in all)
13
+ __defProp(target, name, { get: all[name], enumerable: true });
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from))
18
+ if (!__hasOwnProp.call(to, key) && key !== except)
19
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
+ // If the importer is in node compatibility mode or this is not an ESM
25
+ // file that has been converted to a CommonJS file using a Babel-
26
+ // compatible transform (i.e. "__esModule" has not been set), then set
27
+ // "default" to the CommonJS "module.exports" for node compatibility.
28
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
29
+ mod
30
+ ));
31
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
+
33
+ // node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/dayjs.min.js
34
+ var require_dayjs_min = __commonJS({
35
+ "node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/dayjs.min.js"(exports2, module2) {
36
+ "use strict";
37
+ !(function(t, e) {
38
+ "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e();
39
+ })(exports2, (function() {
40
+ "use strict";
41
+ var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
42
+ var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
43
+ return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
44
+ } }, m = function(t2, e2, n2) {
45
+ var r2 = String(t2);
46
+ return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
47
+ }, v = { s: m, z: function(t2) {
48
+ var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
49
+ return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
50
+ }, m: function t2(e2, n2) {
51
+ if (e2.date() < n2.date()) return -t2(n2, e2);
52
+ var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
53
+ return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
54
+ }, a: function(t2) {
55
+ return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
56
+ }, p: function(t2) {
57
+ return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
58
+ }, u: function(t2) {
59
+ return void 0 === t2;
60
+ } }, g = "en", D = {};
61
+ D[g] = M;
62
+ var p = "$isDayjsObject", S = function(t2) {
63
+ return t2 instanceof _ || !(!t2 || !t2[p]);
64
+ }, w = function t2(e2, n2, r2) {
65
+ var i2;
66
+ if (!e2) return g;
67
+ if ("string" == typeof e2) {
68
+ var s2 = e2.toLowerCase();
69
+ D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
70
+ var u2 = e2.split("-");
71
+ if (!i2 && u2.length > 1) return t2(u2[0]);
72
+ } else {
73
+ var a2 = e2.name;
74
+ D[a2] = e2, i2 = a2;
75
+ }
76
+ return !r2 && i2 && (g = i2), i2 || !r2 && g;
77
+ }, O = function(t2, e2) {
78
+ if (S(t2)) return t2.clone();
79
+ var n2 = "object" == typeof e2 ? e2 : {};
80
+ return n2.date = t2, n2.args = arguments, new _(n2);
81
+ }, b = v;
82
+ b.l = w, b.i = S, b.w = function(t2, e2) {
83
+ return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
84
+ };
85
+ var _ = (function() {
86
+ function M2(t2) {
87
+ this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
88
+ }
89
+ var m2 = M2.prototype;
90
+ return m2.parse = function(t2) {
91
+ this.$d = (function(t3) {
92
+ var e2 = t3.date, n2 = t3.utc;
93
+ if (null === e2) return /* @__PURE__ */ new Date(NaN);
94
+ if (b.u(e2)) return /* @__PURE__ */ new Date();
95
+ if (e2 instanceof Date) return new Date(e2);
96
+ if ("string" == typeof e2 && !/Z$/i.test(e2)) {
97
+ var r2 = e2.match($);
98
+ if (r2) {
99
+ var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
100
+ return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
101
+ }
102
+ }
103
+ return new Date(e2);
104
+ })(t2), this.init();
105
+ }, m2.init = function() {
106
+ var t2 = this.$d;
107
+ this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
108
+ }, m2.$utils = function() {
109
+ return b;
110
+ }, m2.isValid = function() {
111
+ return !(this.$d.toString() === l);
112
+ }, m2.isSame = function(t2, e2) {
113
+ var n2 = O(t2);
114
+ return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
115
+ }, m2.isAfter = function(t2, e2) {
116
+ return O(t2) < this.startOf(e2);
117
+ }, m2.isBefore = function(t2, e2) {
118
+ return this.endOf(e2) < O(t2);
119
+ }, m2.$g = function(t2, e2, n2) {
120
+ return b.u(t2) ? this[e2] : this.set(n2, t2);
121
+ }, m2.unix = function() {
122
+ return Math.floor(this.valueOf() / 1e3);
123
+ }, m2.valueOf = function() {
124
+ return this.$d.getTime();
125
+ }, m2.startOf = function(t2, e2) {
126
+ var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
127
+ var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
128
+ return r2 ? i2 : i2.endOf(a);
129
+ }, $2 = function(t3, e3) {
130
+ return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
131
+ }, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
132
+ switch (f2) {
133
+ case h:
134
+ return r2 ? l2(1, 0) : l2(31, 11);
135
+ case c:
136
+ return r2 ? l2(1, M3) : l2(0, M3 + 1);
137
+ case o:
138
+ var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
139
+ return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
140
+ case a:
141
+ case d:
142
+ return $2(v2 + "Hours", 0);
143
+ case u:
144
+ return $2(v2 + "Minutes", 1);
145
+ case s:
146
+ return $2(v2 + "Seconds", 2);
147
+ case i:
148
+ return $2(v2 + "Milliseconds", 3);
149
+ default:
150
+ return this.clone();
151
+ }
152
+ }, m2.endOf = function(t2) {
153
+ return this.startOf(t2, false);
154
+ }, m2.$set = function(t2, e2) {
155
+ var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
156
+ if (o2 === c || o2 === h) {
157
+ var y2 = this.clone().set(d, 1);
158
+ y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
159
+ } else l2 && this.$d[l2]($2);
160
+ return this.init(), this;
161
+ }, m2.set = function(t2, e2) {
162
+ return this.clone().$set(t2, e2);
163
+ }, m2.get = function(t2) {
164
+ return this[b.p(t2)]();
165
+ }, m2.add = function(r2, f2) {
166
+ var d2, l2 = this;
167
+ r2 = Number(r2);
168
+ var $2 = b.p(f2), y2 = function(t2) {
169
+ var e2 = O(l2);
170
+ return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
171
+ };
172
+ if ($2 === c) return this.set(c, this.$M + r2);
173
+ if ($2 === h) return this.set(h, this.$y + r2);
174
+ if ($2 === a) return y2(1);
175
+ if ($2 === o) return y2(7);
176
+ var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
177
+ return b.w(m3, this);
178
+ }, m2.subtract = function(t2, e2) {
179
+ return this.add(-1 * t2, e2);
180
+ }, m2.format = function(t2) {
181
+ var e2 = this, n2 = this.$locale();
182
+ if (!this.isValid()) return n2.invalidDate || l;
183
+ var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
184
+ return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
185
+ }, d2 = function(t3) {
186
+ return b.s(s2 % 12 || 12, t3, "0");
187
+ }, $2 = f2 || function(t3, e3, n3) {
188
+ var r3 = t3 < 12 ? "AM" : "PM";
189
+ return n3 ? r3.toLowerCase() : r3;
190
+ };
191
+ return r2.replace(y, (function(t3, r3) {
192
+ return r3 || (function(t4) {
193
+ switch (t4) {
194
+ case "YY":
195
+ return String(e2.$y).slice(-2);
196
+ case "YYYY":
197
+ return b.s(e2.$y, 4, "0");
198
+ case "M":
199
+ return a2 + 1;
200
+ case "MM":
201
+ return b.s(a2 + 1, 2, "0");
202
+ case "MMM":
203
+ return h2(n2.monthsShort, a2, c2, 3);
204
+ case "MMMM":
205
+ return h2(c2, a2);
206
+ case "D":
207
+ return e2.$D;
208
+ case "DD":
209
+ return b.s(e2.$D, 2, "0");
210
+ case "d":
211
+ return String(e2.$W);
212
+ case "dd":
213
+ return h2(n2.weekdaysMin, e2.$W, o2, 2);
214
+ case "ddd":
215
+ return h2(n2.weekdaysShort, e2.$W, o2, 3);
216
+ case "dddd":
217
+ return o2[e2.$W];
218
+ case "H":
219
+ return String(s2);
220
+ case "HH":
221
+ return b.s(s2, 2, "0");
222
+ case "h":
223
+ return d2(1);
224
+ case "hh":
225
+ return d2(2);
226
+ case "a":
227
+ return $2(s2, u2, true);
228
+ case "A":
229
+ return $2(s2, u2, false);
230
+ case "m":
231
+ return String(u2);
232
+ case "mm":
233
+ return b.s(u2, 2, "0");
234
+ case "s":
235
+ return String(e2.$s);
236
+ case "ss":
237
+ return b.s(e2.$s, 2, "0");
238
+ case "SSS":
239
+ return b.s(e2.$ms, 3, "0");
240
+ case "Z":
241
+ return i2;
242
+ }
243
+ return null;
244
+ })(t3) || i2.replace(":", "");
245
+ }));
246
+ }, m2.utcOffset = function() {
247
+ return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
248
+ }, m2.diff = function(r2, d2, l2) {
249
+ var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
250
+ return b.m(y2, m3);
251
+ };
252
+ switch (M3) {
253
+ case h:
254
+ $2 = D2() / 12;
255
+ break;
256
+ case c:
257
+ $2 = D2();
258
+ break;
259
+ case f:
260
+ $2 = D2() / 3;
261
+ break;
262
+ case o:
263
+ $2 = (g2 - v2) / 6048e5;
264
+ break;
265
+ case a:
266
+ $2 = (g2 - v2) / 864e5;
267
+ break;
268
+ case u:
269
+ $2 = g2 / n;
270
+ break;
271
+ case s:
272
+ $2 = g2 / e;
273
+ break;
274
+ case i:
275
+ $2 = g2 / t;
276
+ break;
277
+ default:
278
+ $2 = g2;
279
+ }
280
+ return l2 ? $2 : b.a($2);
281
+ }, m2.daysInMonth = function() {
282
+ return this.endOf(c).$D;
283
+ }, m2.$locale = function() {
284
+ return D[this.$L];
285
+ }, m2.locale = function(t2, e2) {
286
+ if (!t2) return this.$L;
287
+ var n2 = this.clone(), r2 = w(t2, e2, true);
288
+ return r2 && (n2.$L = r2), n2;
289
+ }, m2.clone = function() {
290
+ return b.w(this.$d, this);
291
+ }, m2.toDate = function() {
292
+ return new Date(this.valueOf());
293
+ }, m2.toJSON = function() {
294
+ return this.isValid() ? this.toISOString() : null;
295
+ }, m2.toISOString = function() {
296
+ return this.$d.toISOString();
297
+ }, m2.toString = function() {
298
+ return this.$d.toUTCString();
299
+ }, M2;
300
+ })(), k = _.prototype;
301
+ return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach((function(t2) {
302
+ k[t2[1]] = function(e2) {
303
+ return this.$g(e2, t2[0], t2[1]);
304
+ };
305
+ })), O.extend = function(t2, e2) {
306
+ return t2.$i || (t2(e2, _, O), t2.$i = true), O;
307
+ }, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
308
+ return O(1e3 * t2);
309
+ }, O.en = D[g], O.Ls = D, O.p = {}, O;
310
+ }));
311
+ }
312
+ });
313
+
314
+ // node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/utc.js
315
+ var require_utc = __commonJS({
316
+ "node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/utc.js"(exports2, module2) {
317
+ "use strict";
318
+ !(function(t, i) {
319
+ "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = i() : "function" == typeof define && define.amd ? define(i) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs_plugin_utc = i();
320
+ })(exports2, (function() {
321
+ "use strict";
322
+ var t = "minute", i = /[+-]\d\d(?::?\d\d)?/g, e = /([+-]|\d\d)/g;
323
+ return function(s, f, n) {
324
+ var u = f.prototype;
325
+ n.utc = function(t2) {
326
+ var i2 = { date: t2, utc: true, args: arguments };
327
+ return new f(i2);
328
+ }, u.utc = function(i2) {
329
+ var e2 = n(this.toDate(), { locale: this.$L, utc: true });
330
+ return i2 ? e2.add(this.utcOffset(), t) : e2;
331
+ }, u.local = function() {
332
+ return n(this.toDate(), { locale: this.$L, utc: false });
333
+ };
334
+ var r = u.parse;
335
+ u.parse = function(t2) {
336
+ t2.utc && (this.$u = true), this.$utils().u(t2.$offset) || (this.$offset = t2.$offset), r.call(this, t2);
337
+ };
338
+ var o = u.init;
339
+ u.init = function() {
340
+ if (this.$u) {
341
+ var t2 = this.$d;
342
+ this.$y = t2.getUTCFullYear(), this.$M = t2.getUTCMonth(), this.$D = t2.getUTCDate(), this.$W = t2.getUTCDay(), this.$H = t2.getUTCHours(), this.$m = t2.getUTCMinutes(), this.$s = t2.getUTCSeconds(), this.$ms = t2.getUTCMilliseconds();
343
+ } else o.call(this);
344
+ };
345
+ var a = u.utcOffset;
346
+ u.utcOffset = function(s2, f2) {
347
+ var n2 = this.$utils().u;
348
+ if (n2(s2)) return this.$u ? 0 : n2(this.$offset) ? a.call(this) : this.$offset;
349
+ if ("string" == typeof s2 && (s2 = (function(t2) {
350
+ void 0 === t2 && (t2 = "");
351
+ var s3 = t2.match(i);
352
+ if (!s3) return null;
353
+ var f3 = ("" + s3[0]).match(e) || ["-", 0, 0], n3 = f3[0], u3 = 60 * +f3[1] + +f3[2];
354
+ return 0 === u3 ? 0 : "+" === n3 ? u3 : -u3;
355
+ })(s2), null === s2)) return this;
356
+ var u2 = Math.abs(s2) <= 16 ? 60 * s2 : s2;
357
+ if (0 === u2) return this.utc(f2);
358
+ var r2 = this.clone();
359
+ if (f2) return r2.$offset = u2, r2.$u = false, r2;
360
+ var o2 = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
361
+ return (r2 = this.local().add(u2 + o2, t)).$offset = u2, r2.$x.$localOffset = o2, r2;
362
+ };
363
+ var h = u.format;
364
+ u.format = function(t2) {
365
+ var i2 = t2 || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
366
+ return h.call(this, i2);
367
+ }, u.valueOf = function() {
368
+ var t2 = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
369
+ return this.$d.valueOf() - 6e4 * t2;
370
+ }, u.isUTC = function() {
371
+ return !!this.$u;
372
+ }, u.toISOString = function() {
373
+ return this.toDate().toISOString();
374
+ }, u.toString = function() {
375
+ return this.toDate().toUTCString();
376
+ };
377
+ var l = u.toDate;
378
+ u.toDate = function(t2) {
379
+ return "s" === t2 && this.$offset ? n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : l.call(this);
380
+ };
381
+ var c = u.diff;
382
+ u.diff = function(t2, i2, e2) {
383
+ if (t2 && this.$u === t2.$u) return c.call(this, t2, i2, e2);
384
+ var s2 = this.local(), f2 = n(t2).local();
385
+ return c.call(s2, f2, i2, e2);
386
+ };
387
+ };
388
+ }));
389
+ }
390
+ });
391
+
392
+ // node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/timezone.js
393
+ var require_timezone = __commonJS({
394
+ "node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/timezone.js"(exports2, module2) {
395
+ "use strict";
396
+ !(function(t, e) {
397
+ "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs_plugin_timezone = e();
398
+ })(exports2, (function() {
399
+ "use strict";
400
+ var t = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, e = {};
401
+ return function(n, i, o) {
402
+ var r, a = function(t2, n2, i2) {
403
+ void 0 === i2 && (i2 = {});
404
+ var o2 = new Date(t2), r2 = (function(t3, n3) {
405
+ void 0 === n3 && (n3 = {});
406
+ var i3 = n3.timeZoneName || "short", o3 = t3 + "|" + i3, r3 = e[o3];
407
+ return r3 || (r3 = new Intl.DateTimeFormat("en-US", { hour12: false, timeZone: t3, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: i3 }), e[o3] = r3), r3;
408
+ })(n2, i2);
409
+ return r2.formatToParts(o2);
410
+ }, u = function(e2, n2) {
411
+ for (var i2 = a(e2, n2), r2 = [], u2 = 0; u2 < i2.length; u2 += 1) {
412
+ var f2 = i2[u2], s2 = f2.type, m = f2.value, c = t[s2];
413
+ c >= 0 && (r2[c] = parseInt(m, 10));
414
+ }
415
+ var d = r2[3], l = 24 === d ? 0 : d, h = r2[0] + "-" + r2[1] + "-" + r2[2] + " " + l + ":" + r2[4] + ":" + r2[5] + ":000", v = +e2;
416
+ return (o.utc(h).valueOf() - (v -= v % 1e3)) / 6e4;
417
+ }, f = i.prototype;
418
+ f.tz = function(t2, e2) {
419
+ void 0 === t2 && (t2 = r);
420
+ var n2, i2 = this.utcOffset(), a2 = this.toDate(), u2 = a2.toLocaleString("en-US", { timeZone: t2 }), f2 = Math.round((a2 - new Date(u2)) / 1e3 / 60), s2 = 15 * -Math.round(a2.getTimezoneOffset() / 15) - f2;
421
+ if (!Number(s2)) n2 = this.utcOffset(0, e2);
422
+ else if (n2 = o(u2, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(s2, true), e2) {
423
+ var m = n2.utcOffset();
424
+ n2 = n2.add(i2 - m, "minute");
425
+ }
426
+ return n2.$x.$timezone = t2, n2;
427
+ }, f.offsetName = function(t2) {
428
+ var e2 = this.$x.$timezone || o.tz.guess(), n2 = a(this.valueOf(), e2, { timeZoneName: t2 }).find((function(t3) {
429
+ return "timezonename" === t3.type.toLowerCase();
430
+ }));
431
+ return n2 && n2.value;
432
+ };
433
+ var s = f.startOf;
434
+ f.startOf = function(t2, e2) {
435
+ if (!this.$x || !this.$x.$timezone) return s.call(this, t2, e2);
436
+ var n2 = o(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
437
+ return s.call(n2, t2, e2).tz(this.$x.$timezone, true);
438
+ }, o.tz = function(t2, e2, n2) {
439
+ var i2 = n2 && e2, a2 = n2 || e2 || r, f2 = u(+o(), a2);
440
+ if ("string" != typeof t2) return o(t2).tz(a2);
441
+ var s2 = (function(t3, e3, n3) {
442
+ var i3 = t3 - 60 * e3 * 1e3, o2 = u(i3, n3);
443
+ if (e3 === o2) return [i3, e3];
444
+ var r2 = u(i3 -= 60 * (o2 - e3) * 1e3, n3);
445
+ return o2 === r2 ? [i3, o2] : [t3 - 60 * Math.min(o2, r2) * 1e3, Math.max(o2, r2)];
446
+ })(o.utc(t2, i2).valueOf(), f2, a2), m = s2[0], c = s2[1], d = o(m).utcOffset(c);
447
+ return d.$x.$timezone = a2, d;
448
+ }, o.tz.guess = function() {
449
+ return Intl.DateTimeFormat().resolvedOptions().timeZone;
450
+ }, o.tz.setDefault = function(t2) {
451
+ r = t2;
452
+ };
453
+ };
454
+ }));
455
+ }
456
+ });
457
+
458
+ // node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/duration.js
459
+ var require_duration = __commonJS({
460
+ "node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/duration.js"(exports2, module2) {
461
+ "use strict";
462
+ !(function(t, s) {
463
+ "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = s() : "function" == typeof define && define.amd ? define(s) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs_plugin_duration = s();
464
+ })(exports2, (function() {
465
+ "use strict";
466
+ var t, s, n = 1e3, i = 6e4, e = 36e5, r = 864e5, o = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, u = 31536e6, d = 2628e6, a = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/, h = { years: u, months: d, days: r, hours: e, minutes: i, seconds: n, milliseconds: 1, weeks: 6048e5 }, c = function(t2) {
467
+ return t2 instanceof g;
468
+ }, f = function(t2, s2, n2) {
469
+ return new g(t2, n2, s2.$l);
470
+ }, m = function(t2) {
471
+ return s.p(t2) + "s";
472
+ }, l = function(t2) {
473
+ return t2 < 0;
474
+ }, $ = function(t2) {
475
+ return l(t2) ? Math.ceil(t2) : Math.floor(t2);
476
+ }, y = function(t2) {
477
+ return Math.abs(t2);
478
+ }, v = function(t2, s2) {
479
+ return t2 ? l(t2) ? { negative: true, format: "" + y(t2) + s2 } : { negative: false, format: "" + t2 + s2 } : { negative: false, format: "" };
480
+ }, g = (function() {
481
+ function l2(t2, s2, n2) {
482
+ var i2 = this;
483
+ if (this.$d = {}, this.$l = n2, void 0 === t2 && (this.$ms = 0, this.parseFromMilliseconds()), s2) return f(t2 * h[m(s2)], this);
484
+ if ("number" == typeof t2) return this.$ms = t2, this.parseFromMilliseconds(), this;
485
+ if ("object" == typeof t2) return Object.keys(t2).forEach((function(s3) {
486
+ i2.$d[m(s3)] = t2[s3];
487
+ })), this.calMilliseconds(), this;
488
+ if ("string" == typeof t2) {
489
+ var e2 = t2.match(a);
490
+ if (e2) {
491
+ var r2 = e2.slice(2).map((function(t3) {
492
+ return null != t3 ? Number(t3) : 0;
493
+ }));
494
+ return this.$d.years = r2[0], this.$d.months = r2[1], this.$d.weeks = r2[2], this.$d.days = r2[3], this.$d.hours = r2[4], this.$d.minutes = r2[5], this.$d.seconds = r2[6], this.calMilliseconds(), this;
495
+ }
496
+ }
497
+ return this;
498
+ }
499
+ var y2 = l2.prototype;
500
+ return y2.calMilliseconds = function() {
501
+ var t2 = this;
502
+ this.$ms = Object.keys(this.$d).reduce((function(s2, n2) {
503
+ return s2 + (t2.$d[n2] || 0) * h[n2];
504
+ }), 0);
505
+ }, y2.parseFromMilliseconds = function() {
506
+ var t2 = this.$ms;
507
+ this.$d.years = $(t2 / u), t2 %= u, this.$d.months = $(t2 / d), t2 %= d, this.$d.days = $(t2 / r), t2 %= r, this.$d.hours = $(t2 / e), t2 %= e, this.$d.minutes = $(t2 / i), t2 %= i, this.$d.seconds = $(t2 / n), t2 %= n, this.$d.milliseconds = t2;
508
+ }, y2.toISOString = function() {
509
+ var t2 = v(this.$d.years, "Y"), s2 = v(this.$d.months, "M"), n2 = +this.$d.days || 0;
510
+ this.$d.weeks && (n2 += 7 * this.$d.weeks);
511
+ var i2 = v(n2, "D"), e2 = v(this.$d.hours, "H"), r2 = v(this.$d.minutes, "M"), o2 = this.$d.seconds || 0;
512
+ this.$d.milliseconds && (o2 += this.$d.milliseconds / 1e3, o2 = Math.round(1e3 * o2) / 1e3);
513
+ var u2 = v(o2, "S"), d2 = t2.negative || s2.negative || i2.negative || e2.negative || r2.negative || u2.negative, a2 = e2.format || r2.format || u2.format ? "T" : "", h2 = (d2 ? "-" : "") + "P" + t2.format + s2.format + i2.format + a2 + e2.format + r2.format + u2.format;
514
+ return "P" === h2 || "-P" === h2 ? "P0D" : h2;
515
+ }, y2.toJSON = function() {
516
+ return this.toISOString();
517
+ }, y2.format = function(t2) {
518
+ var n2 = t2 || "YYYY-MM-DDTHH:mm:ss", i2 = { Y: this.$d.years, YY: s.s(this.$d.years, 2, "0"), YYYY: s.s(this.$d.years, 4, "0"), M: this.$d.months, MM: s.s(this.$d.months, 2, "0"), D: this.$d.days, DD: s.s(this.$d.days, 2, "0"), H: this.$d.hours, HH: s.s(this.$d.hours, 2, "0"), m: this.$d.minutes, mm: s.s(this.$d.minutes, 2, "0"), s: this.$d.seconds, ss: s.s(this.$d.seconds, 2, "0"), SSS: s.s(this.$d.milliseconds, 3, "0") };
519
+ return n2.replace(o, (function(t3, s2) {
520
+ return s2 || String(i2[t3]);
521
+ }));
522
+ }, y2.as = function(t2) {
523
+ return this.$ms / h[m(t2)];
524
+ }, y2.get = function(t2) {
525
+ var s2 = this.$ms, n2 = m(t2);
526
+ return "milliseconds" === n2 ? s2 %= 1e3 : s2 = "weeks" === n2 ? $(s2 / h[n2]) : this.$d[n2], s2 || 0;
527
+ }, y2.add = function(t2, s2, n2) {
528
+ var i2;
529
+ return i2 = s2 ? t2 * h[m(s2)] : c(t2) ? t2.$ms : f(t2, this).$ms, f(this.$ms + i2 * (n2 ? -1 : 1), this);
530
+ }, y2.subtract = function(t2, s2) {
531
+ return this.add(t2, s2, true);
532
+ }, y2.locale = function(t2) {
533
+ var s2 = this.clone();
534
+ return s2.$l = t2, s2;
535
+ }, y2.clone = function() {
536
+ return f(this.$ms, this);
537
+ }, y2.humanize = function(s2) {
538
+ return t().add(this.$ms, "ms").locale(this.$l).fromNow(!s2);
539
+ }, y2.valueOf = function() {
540
+ return this.asMilliseconds();
541
+ }, y2.milliseconds = function() {
542
+ return this.get("milliseconds");
543
+ }, y2.asMilliseconds = function() {
544
+ return this.as("milliseconds");
545
+ }, y2.seconds = function() {
546
+ return this.get("seconds");
547
+ }, y2.asSeconds = function() {
548
+ return this.as("seconds");
549
+ }, y2.minutes = function() {
550
+ return this.get("minutes");
551
+ }, y2.asMinutes = function() {
552
+ return this.as("minutes");
553
+ }, y2.hours = function() {
554
+ return this.get("hours");
555
+ }, y2.asHours = function() {
556
+ return this.as("hours");
557
+ }, y2.days = function() {
558
+ return this.get("days");
559
+ }, y2.asDays = function() {
560
+ return this.as("days");
561
+ }, y2.weeks = function() {
562
+ return this.get("weeks");
563
+ }, y2.asWeeks = function() {
564
+ return this.as("weeks");
565
+ }, y2.months = function() {
566
+ return this.get("months");
567
+ }, y2.asMonths = function() {
568
+ return this.as("months");
569
+ }, y2.years = function() {
570
+ return this.get("years");
571
+ }, y2.asYears = function() {
572
+ return this.as("years");
573
+ }, l2;
574
+ })(), p = function(t2, s2, n2) {
575
+ return t2.add(s2.years() * n2, "y").add(s2.months() * n2, "M").add(s2.days() * n2, "d").add(s2.hours() * n2, "h").add(s2.minutes() * n2, "m").add(s2.seconds() * n2, "s").add(s2.milliseconds() * n2, "ms");
576
+ };
577
+ return function(n2, i2, e2) {
578
+ t = e2, s = e2().$utils(), e2.duration = function(t2, s2) {
579
+ var n3 = e2.locale();
580
+ return f(t2, { $l: n3 }, s2);
581
+ }, e2.isDuration = c;
582
+ var r2 = i2.prototype.add, o2 = i2.prototype.subtract;
583
+ i2.prototype.add = function(t2, s2) {
584
+ return c(t2) ? p(this, t2, 1) : r2.bind(this)(t2, s2);
585
+ }, i2.prototype.subtract = function(t2, s2) {
586
+ return c(t2) ? p(this, t2, -1) : o2.bind(this)(t2, s2);
587
+ };
588
+ };
589
+ }));
590
+ }
591
+ });
592
+
593
+ // src/utils/markets/utils.ts
594
+ var utils_exports = {};
595
+ __export(utils_exports, {
596
+ SUPPORTED_SYMBOLS: () => SUPPORTED_SYMBOLS,
597
+ SYMBOL_FULL_NAME_MAP: () => SYMBOL_FULL_NAME_MAP,
598
+ calculatePeriodStartInET: () => calculatePeriodStartInET,
599
+ generate15mSlug: () => generate15mSlug,
600
+ generate1dSlug: () => generate1dSlug,
601
+ generate1hSlug: () => generate1hSlug,
602
+ generate4hSlug: () => generate4hSlug,
603
+ generateMarketUrl: () => generateMarketUrl
604
+ });
605
+ module.exports = __toCommonJS(utils_exports);
606
+
607
+ // src/utils/dayjs.ts
608
+ var import_dayjs = __toESM(require_dayjs_min());
609
+ var import_utc = __toESM(require_utc());
610
+ var import_timezone = __toESM(require_timezone());
611
+ var import_duration = __toESM(require_duration());
612
+ import_dayjs.default.extend(import_utc.default);
613
+ import_dayjs.default.extend(import_timezone.default);
614
+ import_dayjs.default.extend(import_duration.default);
615
+ var dayjs_default = import_dayjs.default;
616
+
617
+ // src/utils/markets/types.ts
618
+ var SupportedSymbol = /* @__PURE__ */ ((SupportedSymbol2) => {
619
+ SupportedSymbol2["ETH"] = "eth";
620
+ SupportedSymbol2["BTC"] = "btc";
621
+ SupportedSymbol2["SOL"] = "sol";
622
+ SupportedSymbol2["XRP"] = "xrp";
623
+ return SupportedSymbol2;
624
+ })(SupportedSymbol || {});
625
+
626
+ // src/utils/markets/utils.ts
627
+ var SUPPORTED_SYMBOLS = Object.values(SupportedSymbol);
628
+ var SYMBOL_FULL_NAME_MAP = {
629
+ ["eth" /* ETH */]: "ethereum",
630
+ ["btc" /* BTC */]: "bitcoin",
631
+ ["sol" /* SOL */]: "solana"
632
+ };
633
+ var MONTH_NAMES = [
634
+ "january",
635
+ "february",
636
+ "march",
637
+ "april",
638
+ "may",
639
+ "june",
640
+ "july",
641
+ "august",
642
+ "september",
643
+ "october",
644
+ "november",
645
+ "december"
646
+ ];
647
+ function generateMarketUrl(slug) {
648
+ return `https://polymarket.com/event/${slug}`;
649
+ }
650
+ function generate15mSlug(timestamp, symbol) {
651
+ const prefix = symbol.toLowerCase();
652
+ return `${prefix}-updown-15m-${timestamp}`;
653
+ }
654
+ function generate1hSlug(timestamp, symbol) {
655
+ const prefix = SYMBOL_FULL_NAME_MAP[symbol] || symbol.toLowerCase();
656
+ const etTime = dayjs_default.unix(timestamp).tz("America/New_York");
657
+ const month = etTime.format("MMMM").toLowerCase();
658
+ const day = etTime.date();
659
+ const hour = etTime.format("h");
660
+ const ampm = etTime.format("a");
661
+ return `${prefix}-up-or-down-${month}-${day}-${hour}${ampm}-et`;
662
+ }
663
+ function generate4hSlug(timestamp, symbol) {
664
+ const prefix = symbol.toLowerCase();
665
+ return `${prefix}-updown-4h-${timestamp}`;
666
+ }
667
+ function generate1dSlug(timestamp, symbol) {
668
+ const prefix = SYMBOL_FULL_NAME_MAP[symbol] || symbol.toLowerCase();
669
+ const date = new Date(timestamp * 1e3);
670
+ const month = MONTH_NAMES[date.getUTCMonth()];
671
+ const day = date.getUTCDate();
672
+ return `${prefix}-up-or-down-on-${month}-${day}`;
673
+ }
674
+ function calculatePeriodStartInET(intervalSeconds) {
675
+ const now = Math.floor(Date.now() / 1e3);
676
+ const utcTime = dayjs_default.unix(now).utc();
677
+ const etTime = dayjs_default.unix(now).tz("America/New_York");
678
+ const offset = utcTime.utcOffset() * 60 - etTime.utcOffset() * 60;
679
+ const nowInET = now - offset;
680
+ const periodStartInET = Math.floor(nowInET / intervalSeconds) * intervalSeconds;
681
+ return periodStartInET + offset;
682
+ }
683
+ // Annotate the CommonJS export names for ESM import in node:
684
+ 0 && (module.exports = {
685
+ SUPPORTED_SYMBOLS,
686
+ SYMBOL_FULL_NAME_MAP,
687
+ calculatePeriodStartInET,
688
+ generate15mSlug,
689
+ generate1dSlug,
690
+ generate1hSlug,
691
+ generate4hSlug,
692
+ generateMarketUrl
693
+ });