@abdullah-waseem/klinecharts-pro
Version:
Financial chart built out of the box based on KLineChart. Edited by Abdullah-Waseem
1,663 lines • 229 kB
JavaScript
var T5 = Object.defineProperty;
var I5 = (e, t, n) => t in e ? T5(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var I1 = (e, t, n) => (I5(e, typeof t != "symbol" ? t + "" : t, n), n);
import { utils as O, registerFigure as w0, registerOverlay as I0, TooltipFeaturePosition as te, init as D5, FormatDateType as V1, DomPosition as ne, dispose as P5 } from "klinecharts";
function H1(e, t, n) {
const r = (e.x - t.x) * Math.cos(n) - (e.y - t.y) * Math.sin(n) + t.x, a = (e.x - t.x) * Math.sin(n) + (e.y - t.y) * Math.cos(n) + t.y;
return { x: r, y: a };
}
function D0(e, t) {
if (e.length > 1) {
let n;
return e[0].x === e[1].x && e[0].y !== e[1].y ? e[0].y < e[1].y ? n = {
x: e[0].x,
y: t.height
} : n = {
x: e[0].x,
y: 0
} : e[0].x > e[1].x ? n = {
x: 0,
y: O.getLinearYFromCoordinates(e[0], e[1], { x: 0, y: e[0].y })
} : n = {
x: t.width,
y: O.getLinearYFromCoordinates(e[0], e[1], { x: t.width, y: e[0].y })
}, { coordinates: [e[0], n] };
}
return [];
}
function ze(e, t) {
const n = Math.abs(e.x - t.x), r = Math.abs(e.y - t.y);
return Math.sqrt(n * n + r * r);
}
const N5 = {
name: "arrow",
totalStep: 3,
needDefaultPointFigure: !0,
needDefaultXAxisFigure: !0,
needDefaultYAxisFigure: !0,
createPointFigures: ({ coordinates: e }) => {
if (e.length > 1) {
const t = e[1].x > e[0].x ? 0 : 1, n = O.getLinearSlopeIntercept(e[0], e[1]);
let r;
n ? r = Math.atan(n[0]) + Math.PI * t : e[1].y > e[0].y ? r = Math.PI / 2 : r = Math.PI / 2 * 3;
const a = H1({ x: e[1].x - 8, y: e[1].y + 4 }, e[1], r), i = H1({ x: e[1].x - 8, y: e[1].y - 4 }, e[1], r);
return [
{
type: "line",
attrs: { coordinates: e }
},
{
type: "line",
ignoreEvent: !0,
attrs: { coordinates: [a, e[1], i] }
}
];
}
return [];
}
}, O5 = {
name: "circle",
totalStep: 3,
needDefaultPointFigure: !0,
needDefaultXAxisFigure: !0,
needDefaultYAxisFigure: !0,
styles: {
circle: {
color: "rgba(22, 119, 255, 0.15)"
}
},
createPointFigures: ({ coordinates: e }) => {
if (e.length > 1) {
const t = ze(e[0], e[1]);
return {
type: "circle",
attrs: {
...e[0],
r: t
},
styles: { style: "stroke_fill" }
};
}
return [];
}
}, B5 = {
name: "rect",
totalStep: 3,
needDefaultPointFigure: !0,
needDefaultXAxisFigure: !0,
needDefaultYAxisFigure: !0,
styles: {
polygon: {
color: "rgba(22, 119, 255, 0.15)"
}
},
createPointFigures: ({ coordinates: e }) => e.length > 1 ? [
{
type: "polygon",
attrs: {
coordinates: [
e[0],
{ x: e[1].x, y: e[0].y },
e[1],
{ x: e[0].x, y: e[1].y }
]
},
styles: { style: "stroke_fill" }
}
] : []
}, F5 = {
name: "parallelogram",
totalStep: 4,
needDefaultPointFigure: !0,
needDefaultXAxisFigure: !0,
needDefaultYAxisFigure: !0,
styles: {
polygon: {
color: "rgba(22, 119, 255, 0.15)"
}
},
createPointFigures: ({ coordinates: e }) => {
if (e.length === 2)
return [
{
type: "line",
ignoreEvent: !0,
attrs: { coordinates: e }
}
];
if (e.length === 3) {
const t = { x: e[0].x + (e[2].x - e[1].x), y: e[2].y };
return [
{
type: "polygon",
attrs: { coordinates: [e[0], e[1], e[2], t] },
styles: { style: "stroke_fill" }
}
];
}
return [];
},
performEventPressedMove: ({ points: e, performPointIndex: t, performPoint: n }) => {
t < 2 && (e[0].price = n.price, e[1].price = n.price);
},
performEventMoveForDrawing: ({ currentStep: e, points: t, performPoint: n }) => {
e === 2 && (t[0].price = n.price);
}
}, E5 = {
name: "triangle",
totalStep: 4,
needDefaultPointFigure: !0,
needDefaultXAxisFigure: !0,
needDefaultYAxisFigure: !0,
styles: {
polygon: {
color: "rgba(22, 119, 255, 0.15)"
}
},
createPointFigures: ({ coordinates: e }) => [
{
type: "polygon",
attrs: { coordinates: e },
styles: { style: "stroke_fill" }
}
]
}, K5 = {
name: "fibonacciCircle",
totalStep: 3,
needDefaultPointFigure: !0,
needDefaultXAxisFigure: !0,
needDefaultYAxisFigure: !0,
createPointFigures: ({ coordinates: e }) => {
if (e.length > 1) {
const t = Math.abs(e[0].x - e[1].x), n = Math.abs(e[0].y - e[1].y), r = Math.sqrt(t * t + n * n), a = [0.236, 0.382, 0.5, 0.618, 0.786, 1], i = [], o = [];
return a.forEach((s) => {
const c = r * s;
i.push(
{ ...e[0], r: c }
), o.push({
x: e[0].x,
y: e[0].y + c + 6,
text: `${(s * 100).toFixed(1)}%`
});
}), [
{
type: "circle",
attrs: i,
styles: { style: "stroke" }
},
{
type: "text",
ignoreEvent: !0,
attrs: o
}
];
}
return [];
}
}, j5 = {
name: "fibonacciSegment",
totalStep: 3,
needDefaultPointFigure: !0,
needDefaultXAxisFigure: !0,
needDefaultYAxisFigure: !0,
createPointFigures: ({ coordinates: e, overlay: t }) => {
const n = [], r = [];
if (e.length > 1) {
const a = e[1].x > e[0].x ? e[0].x : e[1].x, i = [1, 0.786, 0.618, 0.5, 0.382, 0.236, 0], o = e[0].y - e[1].y, s = t.points, c = s[0].value - s[1].value;
i.forEach((u) => {
const l = e[1].y + o * u, f = (s[1].value + c * u).toFixed(4);
n.push({
coordinates: [
{ x: e[0].x, y: l },
{ x: e[1].x, y: l }
]
}), r.push({
x: a,
y: l,
text: `${f} (${(u * 100).toFixed(1)}%)`,
baseline: "bottom"
});
});
}
return [
{
type: "line",
attrs: n
},
{
type: "text",
ignoreEvent: !0,
attrs: r
}
];
}
}, Q5 = {
name: "fibonacciSpiral",
totalStep: 3,
needDefaultPointFigure: !0,
needDefaultXAxisFigure: !0,
needDefaultYAxisFigure: !0,
createPointFigures: ({ coordinates: e, bounding: t }) => {
if (e.length > 1) {
const n = ze(e[0], e[1]) / Math.sqrt(24), r = e[1].x > e[0].x ? 0 : 1, a = O.getLinearSlopeIntercept(e[0], e[1]);
let i;
a ? i = Math.atan(a[0]) + Math.PI * r : e[1].y > e[0].y ? i = Math.PI / 2 : i = Math.PI / 2 * 3;
const o = H1(
{ x: e[0].x - n, y: e[0].y },
e[0],
i
), s = H1(
{ x: e[0].x - n, y: e[0].y - n },
e[0],
i
), c = [{
...o,
r: n,
startAngle: i,
endAngle: i + Math.PI / 2
}, {
...s,
r: n * 2,
startAngle: i + Math.PI / 2,
endAngle: i + Math.PI
}];
let u = e[0].x - n, l = e[0].y - n;
for (let f = 2; f < 9; f++) {
const p = c[f - 2].r + c[f - 1].r;
let L = 0;
switch (f % 4) {
case 0: {
L = i, u -= c[f - 2].r;
break;
}
case 1: {
L = i + Math.PI / 2, l -= c[f - 2].r;
break;
}
case 2: {
L = i + Math.PI, u += c[f - 2].r;
break;
}
case 3: {
L = i + Math.PI / 2 * 3, l += c[f - 2].r;
break;
}
}
const T = L + Math.PI / 2, N = H1({ x: u, y: l }, e[0], i);
c.push({
...N,
r: p,
startAngle: L,
endAngle: T
});
}
return [
{
type: "arc",
attrs: c
},
{
type: "line",
attrs: D0(e, t)
}
];
}
return [];
}
}, R5 = {
name: "fibonacciSpeedResistanceFan",
totalStep: 3,
needDefaultPointFigure: !0,
needDefaultXAxisFigure: !0,
needDefaultYAxisFigure: !0,
createPointFigures: ({ coordinates: e, bounding: t }) => {
const n = [];
let r = [];
const a = [];
if (e.length > 1) {
const i = e[1].x > e[0].x ? -38 : 4, o = e[1].y > e[0].y ? -2 : 20, s = e[1].x - e[0].x, c = e[1].y - e[0].y;
[1, 0.75, 0.618, 0.5, 0.382, 0.25, 0].forEach((l) => {
const f = e[1].x - s * l, p = e[1].y - c * l;
n.push({ coordinates: [{ x: f, y: e[0].y }, { x: f, y: e[1].y }] }), n.push({ coordinates: [{ x: e[0].x, y: p }, { x: e[1].x, y: p }] }), r = r.concat(D0([e[0], { x: f, y: e[1].y }], t)), r = r.concat(D0([e[0], { x: e[1].x, y: p }], t)), a.unshift({
x: e[0].x + i,
y: p + 10,
text: `${l.toFixed(3)}`
}), a.unshift({
x: f - 18,
y: e[0].y + o,
text: `${l.toFixed(3)}`
});
});
}
return [
{
type: "line",
attrs: n
},
{
type: "line",
attrs: r
},
{
type: "text",
ignoreEvent: !0,
attrs: a
}
];
}
}, z5 = {
name: "fibonacciExtension",
totalStep: 4,
needDefaultPointFigure: !0,
needDefaultXAxisFigure: !0,
needDefaultYAxisFigure: !0,
createPointFigures: ({ coordinates: e, overlay: t }) => {
const n = [], r = [];
if (e.length > 2) {
const a = t.points, i = a[1].value - a[0].value, o = e[1].y - e[0].y, s = [0, 0.236, 0.382, 0.5, 0.618, 0.786, 1], c = e[2].x > e[1].x ? e[1].x : e[2].x;
s.forEach((u) => {
const l = e[2].y + o * u, f = (a[2].value + i * u).toFixed(4);
n.push({
coordinates: [
{ x: e[1].x, y: l },
{ x: e[2].x, y: l }
]
}), r.push({
x: c,
y: l,
text: `${f} (${(u * 100).toFixed(1)}%)`,
baseline: "bottom"
});
});
}
return [
{
type: "line",
attrs: { coordinates: e },
styles: { style: "dashed" }
},
{
type: "line",
attrs: n
},
{
type: "text",
ignoreEvent: !0,
attrs: r
}
];
}
}, Z5 = {
name: "gannBox",
totalStep: 3,
needDefaultPointFigure: !0,
needDefaultXAxisFigure: !0,
needDefaultYAxisFigure: !0,
styles: {
polygon: {
color: "rgba(22, 119, 255, 0.15)"
}
},
createPointFigures: ({ coordinates: e }) => {
if (e.length > 1) {
const t = (e[1].y - e[0].y) / 4, n = e[1].x - e[0].x, r = [
{ coordinates: [e[0], { x: e[1].x, y: e[1].y - t }] },
{ coordinates: [e[0], { x: e[1].x, y: e[1].y - t * 2 }] },
{ coordinates: [{ x: e[0].x, y: e[1].y }, { x: e[1].x, y: e[0].y + t }] },
{ coordinates: [{ x: e[0].x, y: e[1].y }, { x: e[1].x, y: e[0].y + t * 2 }] },
{ coordinates: [{ ...e[0] }, { x: e[0].x + n * 0.236, y: e[1].y }] },
{ coordinates: [{ ...e[0] }, { x: e[0].x + n * 0.5, y: e[1].y }] },
{ coordinates: [{ x: e[0].x, y: e[1].y }, { x: e[0].x + n * 0.236, y: e[0].y }] },
{ coordinates: [{ x: e[0].x, y: e[1].y }, { x: e[0].x + n * 0.5, y: e[0].y }] }
], a = [
{ coordinates: [e[0], e[1]] },
{ coordinates: [{ x: e[0].x, y: e[1].y }, { x: e[1].x, y: e[0].y }] }
];
return [
{
type: "line",
attrs: [
{ coordinates: [e[0], { x: e[1].x, y: e[0].y }] },
{ coordinates: [{ x: e[1].x, y: e[0].y }, e[1]] },
{ coordinates: [e[1], { x: e[0].x, y: e[1].y }] },
{ coordinates: [{ x: e[0].x, y: e[1].y }, e[0]] }
]
},
{
type: "polygon",
ignoreEvent: !0,
attrs: {
coordinates: [
e[0],
{ x: e[1].x, y: e[0].y },
e[1],
{ x: e[0].x, y: e[1].y }
]
},
styles: { style: "fill" }
},
{
type: "line",
attrs: r,
styles: { style: "dashed" }
},
{
type: "line",
attrs: a
}
];
}
return [];
}
}, U5 = {
name: "threeWaves",
totalStep: 5,
needDefaultPointFigure: !0,
needDefaultXAxisFigure: !0,
needDefaultYAxisFigure: !0,
createPointFigures: ({ coordinates: e }) => {
const t = e.map((n, r) => ({
...n,
text: `(${r})`,
baseline: "bottom"
}));
return [
{
type: "line",
attrs: { coordinates: e }
},
{
type: "text",
ignoreEvent: !0,
attrs: t
}
];
}
}, V5 = {
name: "fiveWaves",
totalStep: 7,
needDefaultPointFigure: !0,
needDefaultXAxisFigure: !0,
needDefaultYAxisFigure: !0,
createPointFigures: ({ coordinates: e }) => {
const t = e.map((n, r) => ({
...n,
text: `(${r})`,
baseline: "bottom"
}));
return [
{
type: "line",
attrs: { coordinates: e }
},
{
type: "text",
ignoreEvent: !0,
attrs: t
}
];
}
}, Y5 = {
name: "eightWaves",
totalStep: 10,
needDefaultPointFigure: !0,
needDefaultXAxisFigure: !0,
needDefaultYAxisFigure: !0,
createPointFigures: ({ coordinates: e }) => {
const t = e.map((n, r) => ({
...n,
text: `(${r})`,
baseline: "bottom"
}));
return [
{
type: "line",
attrs: { coordinates: e }
},
{
type: "text",
ignoreEvent: !0,
attrs: t
}
];
}
}, H5 = {
name: "anyWaves",
totalStep: Number.MAX_SAFE_INTEGER,
needDefaultPointFigure: !0,
needDefaultXAxisFigure: !0,
needDefaultYAxisFigure: !0,
createPointFigures: ({ coordinates: e }) => {
const t = e.map((n, r) => ({
...n,
text: `(${r})`,
baseline: "bottom"
}));
return [
{
type: "line",
attrs: { coordinates: e }
},
{
type: "text",
ignoreEvent: !0,
attrs: t
}
];
}
}, X5 = {
name: "abcd",
totalStep: 5,
needDefaultPointFigure: !0,
needDefaultXAxisFigure: !0,
needDefaultYAxisFigure: !0,
createPointFigures: ({ coordinates: e }) => {
let t = [], n = [];
const r = ["A", "B", "C", "D"], a = e.map((i, o) => ({
...i,
baseline: "bottom",
text: `(${r[o]})`
}));
return e.length > 2 && (t = [e[0], e[2]], e.length > 3 && (n = [e[1], e[3]])), [
{
type: "line",
attrs: { coordinates: e }
},
{
type: "line",
attrs: [{ coordinates: t }, { coordinates: n }],
styles: { style: "dashed" }
},
{
type: "text",
ignoreEvent: !0,
attrs: a
}
];
}
}, G5 = {
name: "xabcd",
totalStep: 6,
needDefaultPointFigure: !0,
needDefaultXAxisFigure: !0,
needDefaultYAxisFigure: !0,
styles: {
polygon: {
color: "rgba(22, 119, 255, 0.15)"
}
},
createPointFigures: ({ coordinates: e, overlay: t }) => {
const n = [], r = [], a = ["X", "A", "B", "C", "D"], i = e.map((o, s) => ({
...o,
baseline: "bottom",
text: `(${a[s]})`
}));
return e.length > 2 && (n.push({ coordinates: [e[0], e[2]] }), r.push({ coordinates: [e[0], e[1], e[2]] }), e.length > 3 && (n.push({ coordinates: [e[1], e[3]] }), e.length > 4 && (n.push({ coordinates: [e[2], e[4]] }), r.push({ coordinates: [e[2], e[3], e[4]] })))), [
{
type: "line",
attrs: { coordinates: e }
},
{
type: "line",
attrs: n,
styles: { style: "dashed" }
},
{
type: "polygon",
ignoreEvent: !0,
attrs: r
},
{
type: "text",
ignoreEvent: !0,
attrs: i
}
];
}
}, J5 = [
N5,
O5,
B5,
E5,
F5,
K5,
j5,
Q5,
R5,
z5,
Z5,
U5,
V5,
Y5,
H5,
X5,
G5
];
class Eu {
constructor(t) {
I1(this, "_apiKey");
I1(this, "_prevSymbolMarket");
I1(this, "_ws");
I1(this, "_currentPeriod");
this._apiKey = t;
}
async searchSymbols(t) {
return await ((await (await fetch(
`https://api.polygon.io/v3/reference/tickers?market=fx&apiKey=${this._apiKey}&active=true&search=${t ?? ""}`
)).json()).results || []).map((a) => ({
ticker: a.ticker,
name: a.name,
shortName: a.ticker,
market: a.market,
exchange: a.primary_exchange,
priceCurrency: a.currency_name,
type: a.type,
logo: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAA66SURBVHic7Z17cFTVGcB/527AiKGgRA0ShGhKoQjFMb4qUMCMPIrWqdbHSEdlHDGgI9V2aq2d1hmKtVbRsSTGEcQRp4pStaZQlNYUwYLiSKU0SCMBDRCmoQSJGGF3T/84d2VZk+w9d899hf3NMBnl3ns+5vtyHt/5HoIehpQIaijDYjiSciRlwCCgBCgG+gNFQCGCAvUScaADaAfagFagBdiFoAlBI0m2UkWTEMgA/lmeIYIWIFdkLQNJMBbBJUjOA8agFOwF7cAmBO8hWUeMtWIWezwayxciZwByGb1pZTyCaUguA0YGLNIWBK8jWUExa8Q1HA5YHi0iYQByGTH2UYnkBmA6cHLQMnXBfqAOwXMMYLW4hkTQAmUj1AYgqzkLuAXBTUgGBi2PFoI9SJYAT4nZbA9anK4IpQHIhUzE4i4k04OWxQiCOpI8IubwZtCiZBIqA5A1TEdyH3Bh0LJ4xAYE80QVdUELkiIUBiCf4FIk85FcELQsviB4B8G94jb+GrwoASKfZBgJHkUyNUg5AkOwkhhz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SQSBpCOXEZvWhmPYBqSy4CRAYu0BcHrSFZQzJr0IoxRIHIGkImsZSAJxiK4BMl5wBjAqz7y7cAmu8HGOmKs9eKGzk8ibwCZ2LeQZVgMR1KOpAwYBJQAxUB/lIEUIr5smBEHOlAKbgNagRZgF4ImBI0k2UoVTV7dygXF/wF+fTz59Jc5ygAAAABJRU5ErkJggg=="
}));
}
async getHistoryKLineData(t, n, r, a) {
return await ((await (await fetch(
`https://api.polygon.io/v2/aggs/ticker/${t.ticker}/range/${n.multiplier}/${n.timespan}/${r}/${a}?apiKey=${this._apiKey}`
)).json()).results || []).map((s) => ({
timestamp: s.t,
open: s.o,
high: s.h,
low: s.l,
close: s.c,
volume: s.v,
turnover: s.vw
}));
}
subscribe(t, n, r) {
var a, i;
this._currentPeriod = n, this._prevSymbolMarket !== t.market ? ((a = this._ws) == null || a.close(), this._ws = new WebSocket(`wss://socket.polygon.io/${t.market}`), this._ws.onopen = () => {
var o;
(o = this._ws) == null || o.send(
JSON.stringify({ action: "auth", params: this._apiKey })
);
}, this._ws.onmessage = (o) => {
var c;
const s = JSON.parse(o.data);
if (s[0].ev === "status")
s[0].status === "auth_success" && ((c = this._ws) == null || c.send(
JSON.stringify({
action: "subscribe",
params: `CAS.${t.ticker}`
})
));
else if (s[0].ev == "CAS") {
const u = s[0].s;
let l = this.alignTimestampToPeriodBoundary(
u,
this._currentPeriod
);
r({
timestamp: l,
// Use the aligned timestamp
open: s[0].o,
high: s[0].h,
low: s[0].l,
close: s[0].c,
volume: s[0].v
});
}
}) : (i = this._ws) == null || i.send(
JSON.stringify({ action: "subscribe", params: `CAS.${t.ticker}` })
), this._prevSymbolMarket = t.market;
}
// Add this helper method to align timestamps to period boundaries
alignTimestampToPeriodBoundary(t, n) {
if (n.timespan === "second") {
const r = Math.floor(t / 1e3) % n.multiplier;
return Math.floor(t / 1e3) * 1e3 - r * 1e3;
}
if (n.timespan === "minute") {
const r = Math.floor(t / 6e4) % n.multiplier;
return Math.floor(t / (60 * 1e3)) * (60 * 1e3) - r * (60 * 1e3);
}
return t;
}
unsubscribe(t, n) {
}
}
const r1 = {};
function W5(e) {
r1.context = e;
}
const q5 = (e, t) => e === t, P0 = Symbol("solid-proxy"), e9 = Symbol("solid-track"), c0 = {
equals: q5
};
let Ze = He;
const C1 = 1, u0 = 2, Ue = {
owned: null,
cleanups: null,
context: null,
owner: null
}, A0 = {};
var Y = null;
let A1 = null, j = null, e1 = null, g1 = null, Q0 = 0;
function i0(e, t) {
const n = j, r = Y, a = e.length === 0, i = a ? Ue : {
owned: null,
cleanups: null,
context: null,
owner: t === void 0 ? r : t
}, o = a ? e : () => e(() => y1(() => v0(i)));
Y = i, j = null;
try {
return b1(o, !0);
} finally {
j = n, Y = r;
}
}
function k(e, t) {
t = t ? Object.assign({}, c0, t) : c0;
const n = {
value: e,
observers: null,
observerSlots: null,
comparator: t.equals || void 0
}, r = (a) => (typeof a == "function" && (a = a(n.value)), Ye(n, a));
return [Ve.bind(n), r];
}
function re(e, t, n) {
const r = C0(e, t, !0, C1);
P1(r);
}
function H(e, t, n) {
const r = C0(e, t, !1, C1);
P1(r);
}
function u1(e, t, n) {
Ze = o9;
const r = C0(e, t, !1, C1);
r.user = !0, g1 ? g1.push(r) : P1(r);
}
function z(e, t, n) {
n = n ? Object.assign({}, c0, n) : c0;
const r = C0(e, t, !0, 0);
return r.observers = null, r.observerSlots = null, r.comparator = n.equals || void 0, P1(r), Ve.bind(r);
}
function t9(e, t, n) {
let r, a, i;
arguments.length === 2 && typeof t == "object" || arguments.length === 1 ? (r = !0, a = e, i = t || {}) : (r = e, a = t, i = n || {});
let o = null, s = A0, c = null, u = !1, l = "initialValue" in i, f = typeof r == "function" && z(r);
const p = /* @__PURE__ */ new Set(), [L, T] = (i.storage || k)(i.initialValue), [N, Z] = k(void 0), [B, V] = k(void 0, {
equals: !1
}), [F, S] = k(l ? "ready" : "unresolved");
if (r1.context) {
c = `${r1.context.id}${r1.context.count++}`;
let I;
i.ssrLoadFrom === "initial" ? s = i.initialValue : r1.load && (I = r1.load(c)) && (s = I[0]);
}
function X(I, Q, U, h1) {
return o === I && (o = null, l = !0, (I === s || Q === s) && i.onHydrated && queueMicrotask(() => i.onHydrated(h1, {
value: Q
})), s = A0, W(Q, U)), Q;
}
function W(I, Q) {
b1(() => {
Q === void 0 && T(() => I), S(Q !== void 0 ? "errored" : "ready"), Z(Q);
for (const U of p.keys())
U.decrement();
p.clear();
}, !1);
}
function s1() {
const I = a9, Q = L(), U = N();
if (U !== void 0 && !o)
throw U;
return j && !j.user && I && re(() => {
B(), o && (I.resolved || p.has(I) || (I.increment(), p.add(I)));
}), Q;
}
function v1(I = !0) {
if (I !== !1 && u)
return;
u = !1;
const Q = f ? f() : r;
if (Q == null || Q === !1) {
X(o, y1(L));
return;
}
const U = s !== A0 ? s : y1(() => a(Q, {
value: L(),
refetching: I
}));
return typeof U != "object" || !(U && "then" in U) ? (X(o, U, void 0, Q), U) : (o = U, u = !0, queueMicrotask(() => u = !1), b1(() => {
S(l ? "refreshing" : "pending"), V();
}, !1), U.then((h1) => X(U, h1, void 0, Q), (h1) => X(U, void 0, Ge(h1), Q)));
}
return Object.defineProperties(s1, {
state: {
get: () => F()
},
error: {
get: () => N()
},
loading: {
get() {
const I = F();
return I === "pending" || I === "refreshing";
}
},
latest: {
get() {
if (!l)
return s1();
const I = N();
if (I && !o)
throw I;
return L();
}
}
}), f ? re(() => v1(!1)) : v1(!1), [s1, {
refetch: v1,
mutate: T
}];
}
function y1(e) {
if (j === null)
return e();
const t = j;
j = null;
try {
return e();
} finally {
j = t;
}
}
function n9(e) {
u1(() => y1(e));
}
function o0(e) {
return Y === null || (Y.cleanups === null ? Y.cleanups = [e] : Y.cleanups.push(e)), e;
}
function r9(e) {
const t = j, n = Y;
return Promise.resolve().then(() => {
j = t, Y = n;
let r;
return b1(e, !1), j = Y = null, r ? r.done : void 0;
});
}
let a9;
function Ve() {
const e = A1;
if (this.sources && (this.state || e))
if (this.state === C1 || e)
P1(this);
else {
const t = e1;
e1 = null, b1(() => h0(this), !1), e1 = t;
}
if (j) {
const t = this.observers ? this.observers.length : 0;
j.sources ? (j.sources.push(this), j.sourceSlots.push(t)) : (j.sources = [this], j.sourceSlots = [t]), this.observers ? (this.observers.push(j), this.observerSlots.push(j.sources.length - 1)) : (this.observers = [j], this.observerSlots = [j.sources.length - 1]);
}
return this.value;
}
function Ye(e, t, n) {
let r = e.value;
return (!e.comparator || !e.comparator(r, t)) && (e.value = t, e.observers && e.observers.length && b1(() => {
for (let a = 0; a < e.observers.length; a += 1) {
const i = e.observers[a], o = A1 && A1.running;
o && A1.disposed.has(i), (o && !i.tState || !o && !i.state) && (i.pure ? e1.push(i) : g1.push(i), i.observers && Xe(i)), o || (i.state = C1);
}
if (e1.length > 1e6)
throw e1 = [], new Error();
}, !1)), t;
}
function P1(e) {
if (!e.fn)
return;
v0(e);
const t = Y, n = j, r = Q0;
j = Y = e, s9(e, e.value, r), j = n, Y = t;
}
function s9(e, t, n) {
let r;
try {
r = e.fn(t);
} catch (a) {
e.pure && (e.state = C1, e.owned && e.owned.forEach(v0), e.owned = null), Je(a);
}
(!e.updatedAt || e.updatedAt <= n) && (e.updatedAt != null && "observers" in e ? Ye(e, r) : e.value = r, e.updatedAt = n);
}
function C0(e, t, n, r = C1, a) {
const i = {
fn: e,
state: r,
updatedAt: null,
owned: null,
sources: null,
sourceSlots: null,
cleanups: null,
value: t,
owner: Y,
context: null,
pure: n
};
return Y === null || Y !== Ue && (Y.owned ? Y.owned.push(i) : Y.owned = [i]), i;
}
function f0(e) {
const t = A1;
if (e.state === 0 || t)
return;
if (e.state === u0 || t)
return h0(e);
if (e.suspense && y1(e.suspense.inFallback))
return e.suspense.effects.push(e);
const n = [e];
for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < Q0); )
(e.state || t) && n.push(e);
for (let r = n.length - 1; r >= 0; r--)
if (e = n[r], e.state === C1 || t)
P1(e);
else if (e.state === u0 || t) {
const a = e1;
e1 = null, b1(() => h0(e, n[0]), !1), e1 = a;
}
}
function b1(e, t) {
if (e1)
return e();
let n = !1;
t || (e1 = []), g1 ? n = !0 : g1 = [], Q0++;
try {
const r = e();
return i9(n), r;
} catch (r) {
n || (g1 = null), e1 = null, Je(r);
}
}
function i9(e) {
if (e1 && (He(e1), e1 = null), e)
return;
const t = g1;
g1 = null, t.length && b1(() => Ze(t), !1);
}
function He(e) {
for (let t = 0; t < e.length; t++)
f0(e[t]);
}
function o9(e) {
let t, n = 0;
for (t = 0; t < e.length; t++) {
const r = e[t];
r.user ? e[n++] = r : f0(r);
}
for (r1.context && W5(), t = 0; t < n; t++)
f0(e[t]);
}
function h0(e, t) {
const n = A1;
e.state = 0;
for (let r = 0; r < e.sources.length; r += 1) {
const a = e.sources[r];
a.sources && (a.state === C1 || n ? a !== t && f0(a) : (a.state === u0 || n) && h0(a, t));
}
}
function Xe(e) {
const t = A1;
for (let n = 0; n < e.observers.length; n += 1) {
const r = e.observers[n];
(!r.state || t) && (r.state = u0, r.pure ? e1.push(r) : g1.push(r), r.observers && Xe(r));
}
}
function v0(e) {
let t;
if (e.sources)
for (; e.sources.length; ) {
const n = e.sources.pop(), r = e.sourceSlots.pop(), a = n.observers;
if (a && a.length) {
const i = a.pop(), o = n.observerSlots.pop();
r < a.length && (i.sourceSlots[o] = r, a[r] = i, n.observerSlots[r] = o);
}
}
if (e.owned) {
for (t = 0; t < e.owned.length; t++)
v0(e.owned[t]);
e.owned = null;
}
if (e.cleanups) {
for (t = 0; t < e.cleanups.length; t++)
e.cleanups[t]();
e.cleanups = null;
}
e.state = 0, e.context = null;
}
function Ge(e) {
return e instanceof Error || typeof e == "string" ? e : new Error("Unknown error");
}
function Je(e) {
throw e = Ge(e), e;
}
const l9 = Symbol("fallback");
function ae(e) {
for (let t = 0; t < e.length; t++)
e[t]();
}
function c9(e, t, n = {}) {
let r = [], a = [], i = [], o = 0, s = t.length > 1 ? [] : null;
return o0(() => ae(i)), () => {
let c = e() || [], u, l;
return c[e9], y1(() => {
let p = c.length, L, T, N, Z, B, V, F, S, X;
if (p === 0)
o !== 0 && (ae(i), i = [], r = [], a = [], o = 0, s && (s = [])), n.fallback && (r = [l9], a[0] = i0((W) => (i[0] = W, n.fallback())), o = 1);
else if (o === 0) {
for (a = new Array(p), l = 0; l < p; l++)
r[l] = c[l], a[l] = i0(f);
o = p;
} else {
for (N = new Array(p), Z = new Array(p), s && (B = new Array(p)), V = 0, F = Math.min(o, p); V < F && r[V] === c[V]; V++)
;
for (F = o - 1, S = p - 1; F >= V && S >= V && r[F] === c[S]; F--, S--)
N[S] = a[F], Z[S] = i[F], s && (B[S] = s[F]);
for (L = /* @__PURE__ */ new Map(), T = new Array(S + 1), l = S; l >= V; l--)
X = c[l], u = L.get(X), T[l] = u === void 0 ? -1 : u, L.set(X, l);
for (u = V; u <= F; u++)
X = r[u], l = L.get(X), l !== void 0 && l !== -1 ? (N[l] = a[u], Z[l] = i[u], s && (B[l] = s[u]), l = T[l], L.set(X, l)) : i[u]();
for (l = V; l < p; l++)
l in N ? (a[l] = N[l], i[l] = Z[l], s && (s[l] = B[l], s[l](l))) : a[l] = i0(f);
a = a.slice(0, o = p), r = c.slice(0);
}
return a;
});
function f(p) {
if (i[l] = p, s) {
const [L, T] = k(l);
return s[l] = T, t(c[l], L);
}
return t(c[l]);
}
};
}
function _(e, t) {
return y1(() => e(t || {}));
}
function a0() {
return !0;
}
const u9 = {
get(e, t, n) {
return t === P0 ? n : e.get(t);
},
has(e, t) {
return t === P0 ? !0 : e.has(t);
},
set: a0,
deleteProperty: a0,
getOwnPropertyDescriptor(e, t) {
return {
configurable: !0,
enumerable: !0,
get() {
return e.get(t);
},
set: a0,
deleteProperty: a0
};
},
ownKeys(e) {
return e.keys();
}
};
function M0(e) {
return (e = typeof e == "function" ? e() : e) ? e : {};
}
function We(...e) {
let t = !1;
for (let r = 0; r < e.length; r++) {
const a = e[r];
t = t || !!a && P0 in a, e[r] = typeof a == "function" ? (t = !0, z(a)) : a;
}
if (t)
return new Proxy({
get(r) {
for (let a = e.length - 1; a >= 0; a--) {
const i = M0(e[a])[r];
if (i !== void 0)
return i;
}
},
has(r) {
for (let a = e.length - 1; a >= 0; a--)
if (r in M0(e[a]))
return !0;
return !1;
},
keys() {
const r = [];
for (let a = 0; a < e.length; a++)
r.push(...Object.keys(M0(e[a])));
return [...new Set(r)];
}
}, u9);
const n = {};
for (let r = e.length - 1; r >= 0; r--)
if (e[r]) {
const a = Object.getOwnPropertyDescriptors(e[r]);
for (const i in a)
i in n || Object.defineProperty(n, i, {
enumerable: !0,
get() {
for (let o = e.length - 1; o >= 0; o--) {
const s = (e[o] || {})[i];
if (s !== void 0)
return s;
}
}
});
}
return n;
}
function qe(e) {
const t = "fallback" in e && {
fallback: () => e.fallback
};
return z(c9(() => e.each, e.children, t || void 0));
}
function n1(e) {
let t = !1;
const n = e.keyed, r = z(() => e.when, void 0, {
equals: (a, i) => t ? a === i : !a == !i
});
return z(() => {
const a = r();
if (a) {
const i = e.children, o = typeof i == "function" && i.length > 0;
return t = n || o, o ? y1(() => i(a)) : i;
}
return e.fallback;
}, void 0, void 0);
}
function f9(e, t, n) {
let r = n.length, a = t.length, i = r, o = 0, s = 0, c = t[a - 1].nextSibling, u = null;
for (; o < a || s < i; ) {
if (t[o] === n[s]) {
o++, s++;
continue;
}
for (; t[a - 1] === n[i - 1]; )
a--, i--;
if (a === o) {
const l = i < r ? s ? n[s - 1].nextSibling : n[i - s] : c;
for (; s < i; )
e.insertBefore(n[s++], l);
} else if (i === s)
for (; o < a; )
(!u || !u.has(t[o])) && t[o].remove(), o++;
else if (t[o] === n[i - 1] && n[s] === t[a - 1]) {
const l = t[--a].nextSibling;
e.insertBefore(n[s++], t[o++].nextSibling), e.insertBefore(n[--i], l), t[a] = n[i];
} else {
if (!u) {
u = /* @__PURE__ */ new Map();
let f = s;
for (; f < i; )
u.set(n[f], f++);
}
const l = u.get(t[o]);
if (l != null)
if (s < l && l < i) {
let f = o, p = 1, L;
for (; ++f < a && f < i && !((L = u.get(t[f])) == null || L !== l + p); )
p++;
if (p > l - s) {
const T = t[o];
for (; s < l; )
e.insertBefore(n[s++], T);
} else
e.replaceChild(n[s++], t[o++]);
} else
o++;
else
t[o++].remove();
}
}
}
const se = "_$DX_DELEGATE";
function h9(e, t, n, r = {}) {
let a;
return i0((i) => {
a = i, t === document ? e() : b(t, e(), t.firstChild ? null : void 0, n);
}, r.owner), () => {
a(), t.textContent = "";
};
}
function g(e, t, n) {
const r = document.createElement("template");
r.innerHTML = e;
let a = r.content.firstChild;
return n && (a = a.firstChild), a;
}
function l1(e, t = window.document) {
const n = t[se] || (t[se] = /* @__PURE__ */ new Set());
for (let r = 0, a = e.length; r < a; r++) {
const i = e[r];
n.has(i) || (n.add(i), t.addEventListener(i, d9));
}
}
function o1(e, t, n) {
n == null ? e.removeAttribute(t) : e.setAttribute(t, n);
}
function p1(e, t) {
t == null ? e.removeAttribute("class") : e.className = t;
}
function X1(e, t, n, r) {
if (r)
Array.isArray(n) ? (e[`$$${t}`] = n[0], e[`$$${t}Data`] = n[1]) : e[`$$${t}`] = n;
else if (Array.isArray(n)) {
const a = n[0];
e.addEventListener(t, n[0] = (i) => a.call(e, n[1], i));
} else
e.addEventListener(t, n);
}
function J1(e, t, n) {
if (!t)
return n ? o1(e, "style") : t;
const r = e.style;
if (typeof t == "string")
return r.cssText = t;
typeof n == "string" && (r.cssText = n = void 0), n || (n = {}), t || (t = {});
let a, i;
for (i in n)
t[i] == null && r.removeProperty(i), delete n[i];
for (i in t)
a = t[i], a !== n[i] && (r.setProperty(i, a), n[i] = a);
return n;
}
function R0(e, t, n) {
return y1(() => e(t, n));
}
function b(e, t, n, r) {
if (n !== void 0 && !r && (r = []), typeof t != "function")
return d0(e, t, r, n);
H((a) => d0(e, t(), a, n), r);
}
function d9(e) {
const t = `$$${e.type}`;
let n = e.composedPath && e.composedPath()[0] || e.target;
for (e.target !== n && Object.defineProperty(e, "target", {
configurable: !0,
value: n
}), Object.defineProperty(e, "currentTarget", {
configurable: !0,
get() {
return n || document;
}
}), r1.registry && !r1.done && (r1.done = !0, document.querySelectorAll("[id^=pl-]").forEach((r) => {
for (; r && r.nodeType !== 8 && r.nodeValue !== "pl-" + e; ) {
let a = r.nextSibling;
r.remove(), r = a;
}
r && r.remove();
})); n; ) {
const r = n[t];
if (r && !n.disabled) {
const a = n[`${t}Data`];
if (a !== void 0 ? r.call(n, a, e) : r.call(n, e), e.cancelBubble)
return;
}
n = n._$host || n.parentNode || n.host;
}
}
function d0(e, t, n, r, a) {
for (r1.context && !n && (n = [...e.childNodes]); typeof n == "function"; )
n = n();
if (t === n)
return n;
const i = typeof t, o = r !== void 0;
if (e = o && n[0] && n[0].parentNode || e, i === "string" || i === "number") {
if (r1.context)
return n;
if (i === "number" && (t = t.toString()), o) {
let s = n[0];
s && s.nodeType === 3 ? s.data = t : s = document.createTextNode(t), n = D1(e, n, r, s);
} else
n !== "" && typeof n == "string" ? n = e.firstChild.data = t : n = e.textContent = t;
} else if (t == null || i === "boolean") {
if (r1.context)
return n;
n = D1(e, n, r);
} else {
if (i === "function")
return H(() => {
let s = t();
for (; typeof s == "function"; )
s = s();
n = d0(e, s, n, r);
}), () => n;
if (Array.isArray(t)) {
const s = [], c = n && Array.isArray(n);
if (N0(s, t, n, a))
return H(() => n = d0(e, s, n, r, !0)), () => n;
if (r1.context) {
if (!s.length)
return n;
for (let u = 0; u < s.length; u++)
if (s[u].parentNode)
return n = s;
}
if (s.length === 0) {
if (n = D1(e, n, r), o)
return n;
} else
c ? n.length === 0 ? ie(e, s, r) : f9(e, n, s) : (n && D1(e), ie(e, s));
n = s;
} else if (t instanceof Node) {
if (r1.context && t.parentNode)
return n = o ? [t] : t;
if (Array.isArray(n)) {
if (o)
return n = D1(e, n, r, t);
D1(e, n, null, t);
} else
n == null || n === "" || !e.firstChild ? e.appendChild(t) : e.replaceChild(t, e.firstChild);
n = t;
}
}
return n;
}
function N0(e, t, n, r) {
let a = !1;
for (let i = 0, o = t.length; i < o; i++) {
let s = t[i], c = n && n[i];
if (s instanceof Node)
e.push(s);
else if (!(s == null || s === !0 || s === !1))
if (Array.isArray(s))
a = N0(e, s, c) || a;
else if (typeof s == "function")
if (r) {
for (; typeof s == "function"; )
s = s();
a = N0(e, Array.isArray(s) ? s : [s], Array.isArray(c) ? c : [c]) || a;
} else
e.push(s), a = !0;
else {
const u = String(s);
c && c.nodeType === 3 && c.data === u ? e.push(c) : e.push(document.createTextNode(u));
}
}
return a;
}
function ie(e, t, n = null) {
for (let r = 0, a = t.length; r < a; r++)
e.insertBefore(t[r], n);
}
function D1(e, t, n, r) {
if (n === void 0)
return e.textContent = "";
const a = r || document.createTextNode("");
if (t.length) {
let i = !1;
for (let o = t.length - 1; o >= 0; o--) {
const s = t[o];
if (a !== s) {
const c = s.parentNode === e;
!i && !o ? c ? e.replaceChild(a, s) : e.insertBefore(a, n) : c && s.remove();
} else
i = !0;
}
} else
e.insertBefore(a, n);
return [a];
}
var s0 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function e5(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var m9 = typeof s0 == "object" && s0 && s0.Object === Object && s0, t5 = m9, g9 = t5, y9 = typeof self == "object" && self && self.Object === Object && self, p9 = g9 || y9 || Function("return this")(), f1 = p9, C9 = f1, v9 = C9.Symbol, _0 = v9, oe = _0, n5 = Object.prototype, _9 = n5.hasOwnProperty, $9 = n5.toString, Y1 = oe ? oe.toStringTag : void 0;
function b9(e) {
var t = _9.call(e, Y1), n = e[Y1];
try {
e[Y1] = void 0;
var r = !0;
} catch {
}
var a = $9.call(e);
return r && (t ? e[Y1] = n : delete e[Y1]), a;
}
var L9 = b9, x9 = Object.prototype, k9 = x9.toString;
function w9(e) {
return k9.call(e);
}
var A9 = w9, le = _0, M9 = L9, S9 = A9, T9 = "[object Null]", I9 = "[object Undefined]", ce = le ? le.toStringTag : void 0;
function D9(e) {
return e == null ? e === void 0 ? I9 : T9 : ce && ce in Object(e) ? M9(e) : S9(e);
}
var W1 = D9;
function P9(e) {
var t = typeof e;
return e != null && (t == "object" || t == "function");
}
var N1 = P9, N9 = W1, O9 = N1, B9 = "[object AsyncFunction]", F9 = "[object Function]", E9 = "[object GeneratorFunction]", K9 = "[object Proxy]";
function j9(e) {
if (!O9(e))
return !1;
var t = N9(e);
return t == F9 || t == E9 || t == B9 || t == K9;
}
var r5 = j9, Q9 = f1, R9 = Q9["__core-js_shared__"], z9 = R9, S0 = z9, ue = function() {
var e = /[^.]+$/.exec(S0 && S0.keys && S0.keys.IE_PROTO || "");
return e ? "Symbol(src)_1." + e : "";
}();
function Z9(e) {
return !!ue && ue in e;
}
var U9 = Z9, V9 = Function.prototype, Y9 = V9.toString;
function H9(e) {
if (e != null) {
try {
return Y9.call(e);
} catch {
}
try {
return e + "";
} catch {
}
}
return "";
}
var a5 = H9, X9 = r5, G9 = U9, J9 = N1, W9 = a5, q9 = /[\\^$.*+?()[\]{}|]/g, e6 = /^\[object .+?Constructor\]$/, t6 = Function.prototype, n6 = Object.prototype, r6 = t6.toString, a6 = n6.hasOwnProperty, s6 = RegExp(
"^" + r6.call(a6).replace(q9, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function i6(e) {
if (!J9(e) || G9(e))
return !1;
var t = X9(e) ? s6 : e6;
return t.test(W9(e));
}
var o6 = i6;
function l6(e, t) {
return e == null ? void 0 : e[t];
}
var c6 = l6, u6 = o6, f6 = c6;
function h6(e, t) {
var n = f6(e, t);
return u6(n) ? n : void 0;
}
var M1 = h6, d6 = M1, m6 = function() {
try {
var e = d6(Object, "defineProperty");
return e({}, "", {}), e;
} catch {
}
}(), g6 = m6, fe = g6;
function y6(e, t, n) {
t == "__proto__" && fe ? fe(e, t, {
configurable: !0,
enumerable: !0,
value: n,
writable: !0
}) : e[t] = n;
}
var s5 = y6;
function p6(e, t) {
return e === t || e !== e && t !== t;
}
var i5 = p6, C6 = s5, v6 = i5, _6 = Object.prototype, $6 = _6.hasOwnProperty;
function b6(e, t, n) {
var r = e[t];
(!($6.call(e, t) && v6(r, n)) || n === void 0 && !(t in e)) && C6(e, t, n);
}
var z0 = b6, L6 = Array.isArray, O1 = L6;
function x6(e) {
return e != null && typeof e == "object";
}
var B1 = x6, k6 = W1, w6 = B1, A6 = "[object Symbol]";
function M6(e) {
return typeof e == "symbol" || w6(e) && k6(e) == A6;
}
var Z0 = M6, S6 = O1, T6 = Z0, I6 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, D6 = /^\w*$/;
function P6(e, t) {
if (S6(e))
return !1;
var n = typeof e;
return n == "number" || n == "symbol" || n == "boolean" || e == null || T6(e) ? !0 : D6.test(e) || !I6.test(e) || t != null && e in Object(t);
}
var N6 = P6, O6 = M1, B6 = O6(Object, "create"), $0 = B6, he = $0;
function F6() {
this.__data__ = he ? he(null) : {}, this.size = 0;
}
var E6 = F6;
function K6(e) {
var t = this.has(e) && delete this.__data__[e];
return this.size -= t ? 1 : 0, t;
}
var j6 = K6, Q6 = $0, R6 = "__lodash_hash_undefined__", z6 = Object.prototype, Z6 = z6.hasOwnProperty;
function U6(e) {
var t = this.__data__;
if (Q6) {
var n = t[e];
return n === R6 ? void 0 : n;
}
return Z6.call(t, e) ? t[e] : void 0;
}
var V6 = U6, Y6 = $0, H6 = Object.prototype, X6 = H6.hasOwnProperty;
function G6(e) {
var t = this.__data__;
return Y6 ? t[e] !== void 0 : X6.call(t, e);
}
var J6 = G6, W6 = $0, q6 = "__lodash_hash_undefined__";
function e2(e, t) {
var n = this.__data__;
return this.size += this.has(e) ? 0 : 1, n[e] = W6 && t === void 0 ? q6 : t, this;
}
var t2 = e2, n2 = E6, r2 = j6, a2 = V6, s2 = J6, i2 = t2;
function F1(e) {
var t = -1, n = e == null ? 0 : e.length;
for (this.clear(); ++t < n; ) {
var r = e[t];
this.set(r[0], r[1]);
}
}
F1.prototype.clear = n2;
F1.prototype.delete = r2;
F1.prototype.get = a2;
F1.prototype.has = s2;
F1.prototype.set = i2;
var o2 = F1;
function l2() {
this.__data__ = [], this.size = 0;
}
var c2 = l2, u2 = i5;
function f2(e, t) {
for (var n = e.length; n--; )
if (u2(e[n][0], t))
return n;
return -1;
}
var b0 = f2, h2 = b0, d2 = Array.prototype, m2 = d2.splice;
function g2(e) {
var t = this.__data__, n = h2(t, e);
if (n < 0)
return !1;
var r = t.length - 1;
return n == r ? t.pop() : m2.call(t, n, 1), --this.size, !0;
}
var y2 = g2, p2 = b0;
function C2(e) {
var t = this.__data__, n = p2(t, e);
return n < 0 ? void 0 : t[n][1];
}
var v2 = C2, _2 = b0;
function $2(e) {
return _2(this.__data__, e) > -1;
}
var b2 = $2, L2 = b0;
function x2(e, t) {
var n = this.__data__, r = L2(n, e);
return r < 0 ? (++this.size, n.push([e, t])) : n[r][1] = t, this;
}
var k2 = x2, w2 = c2, A2 = y2, M2 = v2, S2 = b2, T2 = k2;
function E1(e) {
var t = -1, n = e == null ? 0 : e.length;
for (this.clear(); ++t < n; ) {
var r = e[t];
this.set(r[0], r[1]);
}
}
E1.prototype.clear = w2;
E1.prototype.delete = A2;
E1.prototype.get = M2;
E1.prototype.has = S2;
E1.prototype.set = T2;
var L0 = E1, I2 = M1, D2 = f1, P2 = I2(D2, "Map"), U0 = P2, de = o2, N2 = L0, O2 = U0;
function B2() {
this.size = 0, this.__data__ = {
hash: new de(),
map: new (O2 || N2)(),
string: new de()
};
}
var F2 = B2;
function E2(e) {
var t = typeof e;
return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
}
var K2 = E2, j2 = K2;
function Q2(e, t) {
var n = e.__data__;
return j2(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map;
}
var x0 = Q2, R2 = x0;
function z2(e) {
var t = R2(this, e).delete(e);
return this.size -= t ? 1 : 0, t;
}
var Z2 = z2, U2 = x0;
function V2(e) {
return U2(this, e).get(e);
}
var Y2 = V2, H2 = x0;
function X2(e) {
return H2(this, e).has(e);
}
var G2 = X2, J2 = x0;
function W2(e, t) {
var n = J2(this, e), r = n.size;
return n.set(e, t), this.size += n.size == r ? 0 : 1, this;
}
var q2 = W2, et = F2, tt = Z2, nt = Y2, rt = G2, at = q2;
function K1(e) {
var t = -1, n = e == null ? 0 : e.length;
for (this.clear(); ++t < n; ) {
var r = e[t];
this.set(r[0], r[1]);
}
}
K1.prototype.clear = et;
K1.prototype.delete = tt;
K1.prototype.get = nt;
K1.prototype.has = rt;
K1.prototype.set = at;
var o5 = K1, l5 = o5, st = "Expected a function";
function V0(e, t) {
if (typeof e != "function" || t != null && typeof t != "function")
throw new TypeError(st);
var n = function() {
var r = arguments, a = t ? t.apply(this, r) : r[0], i = n