Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@blumjs/router

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blumjs/router - npm Package Compare versions

Comparing version 2.0.2 to 3.0.0

6

dist/index.d.ts

@@ -1,4 +0,4 @@

import { back, historyPush, setRoutes, _setActiveModal, _setActivePanel, _setActivePopout, _setActiveView } from "./router";
import { back, historyPush, _setActiveModal, _setActivePanel, _setActivePopout, _setActiveView, _setRoutes } from "./router";
import { createDisableBackBrowserRouteMiddleware, createRouteMiddleware, useInitRouter, useRouter } from "./useRoutes";
import { setActiveModal, setActivePanel, setActivePopout, setActiveView } from "./virtual-router";
export { useRouter, useInitRouter, createDisableBackBrowserRouteMiddleware, createRouteMiddleware, setActiveModal, setActiveView, setActivePanel, setActivePopout, back, _setActiveView, _setActivePanel, _setActiveModal, _setActivePopout, setRoutes, historyPush, };
import { setActiveModal, setActivePanel, setActivePopout, setActiveView, setActiveViewPanel } from "./virtual-router";
export { useRouter, useInitRouter, createDisableBackBrowserRouteMiddleware, createRouteMiddleware, setActiveModal, setActiveView, setActiveViewPanel, setActivePanel, setActivePopout, back, _setActiveView, _setActivePanel, _setActiveModal, _setActivePopout, _setRoutes, historyPush, };

@@ -1,3 +0,3 @@

import T, { useEffect as Ve } from "react";
function At(e, t) {
import T, { useEffect as $ } from "react";
function xt(e, t) {
for (let n in e)

@@ -9,49 +9,49 @@ t(e[n], n);

}
function P(e, t) {
function I(e, t) {
if (!e)
throw Error(t);
}
function $({ node: e = [], from: t, source: n, parent: r = t || n, to: u, target: s, child: a = u || s, scope: m = {}, meta: g = {}, family: p = { type: "regular" }, regional: h } = {}) {
let c = le(r), d = le(p.links), o = le(p.owners), i = [];
k(e, (f) => f && M(i, f));
let l = { id: Pt(), seq: i, next: le(a), meta: g, scope: m, family: { type: p.type || "crosslink", links: d, owners: o } };
return k(d, (f) => M(me(f), l)), k(o, (f) => M(he(f), l)), k(c, (f) => M(f.next, l)), h && W && je(X(W), [l]), l;
function H({ node: e = [], from: t, source: n, parent: r = t || n, to: a, target: s, child: o = a || s, scope: m = {}, meta: y = {}, family: p = { type: "regular" }, regional: S } = {}) {
let c = le(r), d = le(p.links), i = le(p.owners), l = [];
k(e, (f) => f && M(l, f));
let u = { id: Ht(), seq: l, next: le(o), meta: y, scope: m, family: { type: p.type || "crosslink", links: d, owners: i } };
return k(d, (f) => M(Se(f), u)), k(i, (f) => M(_e(f), u)), k(c, (f) => M(f.next, u)), S && G && Be(Z(G), [u]), u;
}
function ee(e, t, n) {
let r, u = D, s = null, a = O;
if (e.target && (t = e.params, n = e.defer, r = e.meta, u = "page" in e ? e.page : u, e.stack && (s = e.stack), a = I(e) || a, e = e.target), a && O && a !== O && (O = null), Array.isArray(e))
for (let i = 0; i < e.length; i++)
B("pure", u, C(e[i]), s, t[i], a, r);
function te(e, t, n) {
let r, a = D, s = null, o = b;
if (e.target && (t = e.params, n = e.defer, r = e.meta, a = "page" in e ? e.page : a, e.stack && (s = e.stack), o = P(e) || o, e = e.target), o && b && o !== b && (b = null), Array.isArray(e))
for (let l = 0; l < e.length; l++)
N("pure", a, C(e[l]), s, t[l], o, r);
else
B("pure", u, C(e), s, t, a, r);
if (n && !ue)
N("pure", a, C(e), s, t, o, r);
if (n && !se)
return;
let m, g, p, h, c, d, o = { isRoot: ue, currentPage: D, scope: O, isWatch: ce, isPure: fe };
ue = 0;
let m, y, p, S, c, d, i = { isRoot: se, currentPage: D, scope: b, isWatch: fe, isPure: de };
se = 0;
e:
for (; h = Kt(); ) {
let { idx: i, stack: l, type: f } = h;
p = l.node, D = c = l.page, O = I(l), c ? d = c.reg : O && (d = O.reg);
let b = !!c, R = !!O, w = { fail: 0, scope: p.scope };
m = g = 0;
for (let v = i; v < p.seq.length && !m; v++) {
let y = p.seq[v];
if (y.order) {
let { priority: S, barrierID: _ } = y.order, E = _ ? c ? `${c.fullID}_${_}` : _ : 0;
if (v !== i || f !== S) {
_ ? be.has(E) || (be.add(E), Me(v, l, S, _)) : Me(v, l, S);
for (; S = Ut(); ) {
let { idx: l, stack: u, type: f } = S;
p = u.node, D = c = u.page, b = P(u), c ? d = c.reg : b && (d = b.reg);
let O = !!c, R = !!b, g = { fail: 0, scope: p.scope };
m = y = 0;
for (let v = l; v < p.seq.length && !m; v++) {
let w = p.seq[v];
if (w.order) {
let { priority: h, barrierID: _ } = w.order, E = _ ? c ? `${c.fullID}_${_}` : _ : 0;
if (v !== l || f !== h) {
_ ? Ae.has(E) || (Ae.add(E), De(v, u, h, _)) : De(v, u, h);
continue e;
}
_ && be.delete(E);
_ && Ae.delete(E);
}
switch (y.type) {
switch (w.type) {
case "mov": {
let _, E = y.data;
let _, E = w.data;
switch (E.from) {
case re:
_ = X(l);
case ne:
_ = Z(u);
break;
case "a":
case "b":
_ = l[E.from];
_ = u[E.from];
break;

@@ -63,19 +63,19 @@ case "value":

if (d && !d[E.store.id])
if (b) {
let L = pt(c, E.store.id);
l.page = c = L, L ? d = L.reg : R ? (F(O, E.store, 0, 1, E.softRead), d = O.reg) : d = void 0;
if (O) {
let L = ft(c, E.store.id);
u.page = c = L, L ? d = L.reg : R ? (K(b, E.store, 0, 1, E.softRead), d = b.reg) : d = void 0;
} else
R && F(O, E.store, 0, 1, E.softRead);
_ = dt(d && d[E.store.id] || E.store);
R && K(b, E.store, 0, 1, E.softRead);
_ = ct(d && d[E.store.id] || E.store);
}
switch (E.to) {
case re:
l.value = _;
case ne:
u.value = _;
break;
case "a":
case "b":
l[E.to] = _;
u[E.to] = _;
break;
case "store":
Yt(c, O, p, E.target).current = _;
Jt(c, b, p, E.target).current = _;
}

@@ -85,20 +85,20 @@ break;

case "compute":
let S = y.data;
if (S.fn) {
ce = x(p, "op") === "watch", fe = S.pure;
let _ = S.safe ? (0, S.fn)(X(l), w.scope, l) : Qt(w, S.fn, l);
S.filter ? g = !_ : l.value = _, ce = o.isWatch, fe = o.isPure;
let h = w.data;
if (h.fn) {
fe = x(p, "op") === "watch", de = h.pure;
let _ = h.safe ? (0, h.fn)(Z(u), g.scope, u) : Xt(g, h.fn, u);
h.filter ? y = !_ : u.value = _, fe = i.isWatch, de = i.isPure;
}
}
m = w.fail || g;
m = g.fail || y;
}
if (!m) {
let v = X(l), y = I(l);
if (k(p.next, (S) => {
B("child", c, S, l, v, y);
}), y) {
x(p, "needFxCounter") && B("child", c, y.fxCount, l, v, y), x(p, "storeChange") && B("child", c, y.storeChange, l, v, y), x(p, "warnSerialize") && B("child", c, y.warnSerializeNode, l, v, y);
let S = y.additionalLinks[p.id];
S && k(S, (_) => {
B("child", c, _, l, v, y);
let v = Z(u), w = P(u);
if (k(p.next, (h) => {
N("child", c, h, u, v, w);
}), w) {
x(p, "needFxCounter") && N("child", c, w.fxCount, u, v, w), x(p, "storeChange") && N("child", c, w.storeChange, u, v, w), x(p, "warnSerialize") && N("child", c, w.warnSerializeNode, u, v, w);
let h = w.additionalLinks[p.id];
h && k(h, (_) => {
N("child", c, _, u, v, w);
});

@@ -108,15 +108,15 @@ }

}
ue = o.isRoot, D = o.currentPage, O = I(o);
se = i.isRoot, D = i.currentPage, b = P(i);
}
function xt(e, t) {
let n, r, u = e;
function kt(e, t) {
let n, r, a = e;
if (t) {
let s = Mt(t);
let s = Dt(t);
e.length === 0 ? (n = s.path, r = s.fullName) : (n = s.path.concat([e]), r = s.fullName.length === 0 ? e : s.fullName + "/" + e);
} else
n = e.length === 0 ? [] : [e], r = e;
return { shortName: u, fullName: r, path: n };
return { shortName: a, fullName: r, path: n };
}
function Q(e, ...t) {
let n = ct();
function X(e, ...t) {
let n = lt();
if (n) {

@@ -129,55 +129,55 @@ let r = n.handlers[e];

function A(e, t) {
let n = K({ or: t, and: typeof e == "string" ? { name: e } : e }), r = (a, ...m) => (ne(!x(r, "derived"), "call of derived event", "createEvent"), ne(!fe, "unit call from pure function", "operators like sample"), D ? ((g, p, h, c) => {
let d = D, o = null;
let n = U({ or: t, and: typeof e == "string" ? { name: e } : e }), r = (o, ...m) => (oe(!x(r, "derived"), "call of derived event", "createEvent"), oe(!de, "unit call from pure function", "operators like sample"), D ? ((y, p, S, c) => {
let d = D, i = null;
if (p)
for (o = D; o && o.template !== p; )
o = N(o);
Xe(o);
let i = g.create(h, c);
return Xe(d), i;
})(r, u, a, m) : r.create(a, m)), u = ct(), s = Object.assign(r, { graphite: $({ meta: ht("event", r, n), regional: 1 }), create: (a) => (ee({ target: r, params: a, scope: O }), a), watch: (a) => mt(r, a), map: (a) => Re(r, te, a, [q()]), filter: (a) => Re(r, "filter", a.fn ? a : a.fn, [q(qe, 1)]), filterMap: (a) => Re(r, "filterMap", a, [q(), G((m) => !j(m), 1)]), prepend(a) {
let m = A("* → " + r.shortName, { parent: N(r) });
return Q("eventPrepend", C(m)), Fe(m, r, [q()], "prepend", a), Xt(r, m), m;
for (i = D; i && i.template !== p; )
i = B(i);
Qe(i);
let l = y.create(S, c);
return Qe(d), l;
})(r, a, o, m) : r.create(o, m)), a = lt(), s = Object.assign(r, { graphite: H({ meta: vt("event", r, n), regional: 1 }), create: (o) => (te({ target: r, params: o, scope: b }), o), watch: (o) => pt(r, o), map: (o) => Le(r, re, o, [q()]), filter: (o) => Le(r, "filter", o.fn ? o : o.fn, [q(ze, 1)]), filterMap: (o) => Le(r, "filterMap", o, [q(), F((m) => !j(m), 1)]), prepend(o) {
let m = A("* → " + r.shortName, { parent: B(r) });
return X("eventPrepend", C(m)), Ge(m, r, [q()], "prepend", o), Zt(r, m), m;
} });
return n != null && n.domain && n.domain.hooks.event(s), s;
}
function Ke(e, t, n, r) {
return zt(n, t, "first argument"), P(V(r), "second argument should be a function"), ne(!x(e, "derived"), `${t} in derived store`, `${t} in store created via createStore`), k(Array.isArray(n) ? n : [n], (u) => {
e.off(u), pe(e).set(u, vt(St(u, e, "on", jt, r)));
function Fe(e, t, n, r) {
return zt(n, t, "first argument"), I(V(r), "second argument should be a function"), oe(!x(e, "derived"), `${t} in derived store`, `${t} in store created via createStore`), k(Array.isArray(n) ? n : [n], (a) => {
e.off(a), me(e).set(a, dt(mt(a, e, "on", jt, r)));
}), e;
}
function ve(e, t) {
let n = K(t), r = Gt(e), u = A({ named: "updates", derived: 1 });
Q("storeBase", r);
let s = r.id, a = { subscribers: /* @__PURE__ */ new Map(), updates: u, defaultState: e, stateRef: r, getState() {
let i, l = r;
function he(e, t) {
let n = U(t), r = Ft(e), a = A({ named: "updates", derived: 1 });
X("storeBase", r);
let s = r.id, o = { subscribers: /* @__PURE__ */ new Map(), updates: a, defaultState: e, stateRef: r, getState() {
let l, u = r;
if (D) {
let f = D;
for (; f && !f.reg[s]; )
f = N(f);
f && (i = f);
f = B(f);
f && (l = f);
}
return !i && O && (F(O, r, 1), i = O), i && (l = i.reg[s]), dt(l);
}, setState: (i) => ee({ target: a, params: i, defer: 1, scope: O }), reset: (...i) => (k(i, (l) => Ke(a, ".reset", l, () => a.defaultState)), a), on: (i, l) => Ke(a, ".on", i, l), off(i) {
let l = pe(a).get(i);
return l && (l(), pe(a).delete(i)), a;
}, map(i, l) {
let f, b;
z(i) && (f = i, i = i.fn), ne(j(l), "second argument of store.map", "updateFilter");
let R = a.getState();
j(R) || (b = i(R, l));
let w = ve(b, { name: `${a.shortName} → *`, derived: 1, and: f }), v = St(a, w, te, Je, i);
return Ft(de(w), { type: te, fn: i, from: r }), de(w).noInit = 1, Q("storeMap", r, v), w;
}, watch(i, l) {
if (!l || !Ne(i)) {
let f = mt(a, i);
return Q("storeWatch", r, i) || i(a.getState()), f;
return !l && b && (K(b, r, 1), l = b), l && (u = l.reg[s]), ct(u);
}, setState: (l) => te({ target: o, params: l, defer: 1, scope: b }), reset: (...l) => (k(l, (u) => Fe(o, ".reset", u, () => o.defaultState)), o), on: (l, u) => Fe(o, ".on", l, u), off(l) {
let u = me(o).get(l);
return u && (u(), me(o).delete(l)), o;
}, map(l, u) {
let f, O;
z(l) && (f = l, l = l.fn), oe(j(u), "second argument of store.map", "updateFilter");
let R = o.getState();
j(R) || (O = l(R, u));
let g = he(O, { name: `${o.shortName} → *`, derived: 1, and: f }), v = mt(o, g, re, Ye, l);
return Kt(ve(g), { type: re, fn: l, from: r }), ve(g).noInit = 1, X("storeMap", r, v), g;
}, watch(l, u) {
if (!u || !Ne(l)) {
let f = pt(o, l);
return X("storeWatch", r, l) || l(o.getState()), f;
}
return P(V(l), "second argument should be a function"), i.watch((f) => l(a.getState(), f));
} }, m = ht("store", a, n), g = a.defaultConfig.updateFilter;
a.graphite = $({ scope: { state: r, fn: g }, node: [G((i, l, f) => (f.scope && !f.scope.reg[r.id] && (f.b = 1), i)), Ht(r), G((i, l, { a: f, b }) => !j(i) && (i !== f || b), 1), g && q(Je, 1), _e({ from: re, target: r })], child: u, meta: m, regional: 1 });
let p = x(a, "serialize"), h = x(a, "derived"), c = p === "ignore", d = !p || c ? 0 : p, o = x(a, "sid");
return o && (c || Z(a, "storeChange", 1), r.sid = o, d && (r.meta = { ...r == null ? void 0 : r.meta, serialize: d })), o || c || h || Z(a, "warnSerialize", 1), P(h || !j(e), "current state can't be undefined, use null instead"), je(a, [u]), n != null && n.domain && n.domain.hooks.store(a), h || (a.reinit = A(), a.reset(a.reinit)), a;
return I(V(u), "second argument should be a function"), l.watch((f) => u(o.getState(), f));
} }, m = vt("store", o, n), y = o.defaultConfig.updateFilter;
o.graphite = H({ scope: { state: r, fn: y }, node: [F((l, u, f) => (f.scope && !f.scope.reg[r.id] && (f.b = 1), l)), Wt(r), F((l, u, { a: f, b: O }) => !j(l) && (l !== f || O), 1), y && q(Ye, 1), ye({ from: ne, target: r })], child: a, meta: m, regional: 1 });
let p = x(o, "serialize"), S = x(o, "derived"), c = p === "ignore", d = !p || c ? 0 : p, i = x(o, "sid");
return i && (c || ee(o, "storeChange", 1), r.sid = i, d && (r.meta = { ...r == null ? void 0 : r.meta, serialize: d })), i || c || S || ee(o, "warnSerialize", 1), I(S || !j(e), "current state can't be undefined, use null instead"), Be(o, [a]), n != null && n.domain && n.domain.hooks.store(o), S || (o.reinit = A(), o.reset(o.reinit)), o;
}
function kt() {
function Vt() {
let e = {};

@@ -189,74 +189,74 @@ return e.req = new Promise((t, n) => {

}
function lt(e, t) {
let n = K(V(e) ? { handler: e } : e, t), r = A(V(e) ? { handler: e } : e, t), u = C(r);
Z(u, "op", r.kind = "effect"), r.use = (o) => (P(V(o), ".use argument should be a function"), h.scope.handler = o, r), r.use.getCurrent = () => h.scope.handler;
let s = r.finally = A({ named: "finally", derived: 1 }), a = r.done = s.filterMap({ named: "done", fn({ status: o, params: i, result: l }) {
if (o === "done")
return { params: i, result: l };
} }), m = r.fail = s.filterMap({ named: "fail", fn({ status: o, params: i, error: l }) {
if (o === "fail")
return { params: i, error: l };
} }), g = r.doneData = a.map({ named: "doneData", fn: ({ result: o }) => o }), p = r.failData = m.map({ named: "failData", fn: ({ error: o }) => o }), h = $({ scope: { handlerId: x(u, "sid"), handler: r.defaultConfig.handler || (() => P(0, `no handler used in ${r.getType()}`)) }, node: [G((o, i, l) => {
let f = i, b = f.handler;
if (I(l)) {
let R = I(l).handlers[f.handlerId];
R && (b = R);
function at(e, t) {
let n = U(V(e) ? { handler: e } : e, t), r = A(V(e) ? { handler: e } : e, t), a = C(r);
ee(a, "op", r.kind = "effect"), r.use = (i) => (I(V(i), ".use argument should be a function"), S.scope.handler = i, r), r.use.getCurrent = () => S.scope.handler;
let s = r.finally = A({ named: "finally", derived: 1 }), o = r.done = s.filterMap({ named: "done", fn({ status: i, params: l, result: u }) {
if (i === "done")
return { params: l, result: u };
} }), m = r.fail = s.filterMap({ named: "fail", fn({ status: i, params: l, error: u }) {
if (i === "fail")
return { params: l, error: u };
} }), y = r.doneData = o.map({ named: "doneData", fn: ({ result: i }) => i }), p = r.failData = m.map({ named: "failData", fn: ({ error: i }) => i }), S = H({ scope: { handlerId: x(a, "sid"), handler: r.defaultConfig.handler || (() => I(0, `no handler used in ${r.getType()}`)) }, node: [F((i, l, u) => {
let f = l, O = f.handler;
if (P(u)) {
let R = P(u).handlers[f.handlerId];
R && (O = R);
}
return o.handler = b, o;
}, 0, 1), G(({ params: o, req: i, handler: l, args: f = [o] }, b, R) => {
let w = er(R), v = et(o, i, 1, s, R, w), y = et(o, i, 0, s, R, w), [S, _] = Zt(l, y, f);
S && (z(_) && V(_.then) ? _.then(v, y) : v(_));
return i.handler = O, i;
}, 0, 1), F(({ params: i, req: l, handler: u, args: f = [i] }, O, R) => {
let g = tr(R), v = Ze(i, l, 1, s, R, g), w = Ze(i, l, 0, s, R, g), [h, _] = er(u, w, f);
h && (z(_) && V(_.then) ? _.then(v, w) : v(_));
}, 0, 1)], meta: { op: "fx", fx: "runner" } });
u.scope.runner = h, M(u.seq, G((o, { runner: i }, l) => {
let f = N(l) ? { params: o, req: { rs(b) {
}, rj(b) {
} } } : o;
return l.meta || (l.meta = { fxID: $t() }), ee({ target: i, params: f, defer: 1, scope: I(l), meta: l.meta }), f.params;
}, 0, 1)), r.create = (o) => {
let i = kt(), l = { params: o, req: i };
if (O && !ce) {
let f = O;
i.req.finally(() => {
Ut(f);
a.scope.runner = S, M(a.seq, F((i, { runner: l }, u) => {
let f = B(u) ? { params: i, req: { rs(O) {
}, rj(O) {
} } } : i;
return u.meta || (u.meta = { fxID: Nt() }), te({ target: l, params: f, defer: 1, scope: P(u), meta: u.meta }), f.params;
}, 0, 1)), r.create = (i) => {
let l = Vt(), u = { params: i, req: l };
if (b && !fe) {
let f = b;
l.req.finally(() => {
Yt(f);
}).catch(() => {
});
}
return ee({ target: r, params: l, scope: O }), i.req;
return te({ target: r, params: u, scope: b }), l.req;
};
let c = r.inFlight = ve(0, { serialize: "ignore" }).on(r, (o) => o + 1).on(s, (o) => o - 1).map({ fn: (o) => o, named: "inFlight" });
Z(s, "needFxCounter", "dec"), Z(r, "needFxCounter", 1);
let d = r.pending = c.map({ fn: (o) => o > 0, named: "pending" });
return je(r, [s, a, m, g, p, d, c]), n != null && n.domain && n.domain.hooks.effect(r), r;
let c = r.inFlight = he(0, { serialize: "ignore" }).on(r, (i) => i + 1).on(s, (i) => i - 1).map({ fn: (i) => i, named: "inFlight" });
ee(s, "needFxCounter", "dec"), ee(r, "needFxCounter", 1);
let d = r.pending = c.map({ fn: (i) => i > 0, named: "pending" });
return Be(r, [s, o, m, y, p, d, c]), n != null && n.domain && n.domain.hooks.effect(r), r;
}
let Vt = typeof Symbol < "u" && Symbol.observable || "@@observable", te = "map", re = "stack", C = (e) => e.graphite || e, me = (e) => e.family.owners, he = (e) => e.family.links, de = (e) => e.stateRef, X = (e) => e.value, pe = (e) => e.subscribers, N = (e) => e.parent, I = (e) => e.scope, x = (e, t) => C(e).meta[t], Z = (e, t, n) => C(e).meta[t] = n, Mt = (e) => e.compositeName, Ne = (e) => (V(e) || z(e)) && "kind" in e;
const ie = (e) => (t) => Ne(t) && t.kind === e;
let ze = ie("store"), Dt = ie("event"), Ue = ie("effect"), ut = ie("domain"), Tt = ie("scope");
var Ct = { __proto__: null, unit: Ne, store: ze, event: Dt, effect: Ue, domain: ut, scope: Tt, attached: (e) => Ue(e) && x(e, "attached") == 1 };
let se = (e, t) => {
let Mt = typeof Symbol < "u" && Symbol.observable || "@@observable", re = "map", ne = "stack", C = (e) => e.graphite || e, Se = (e) => e.family.owners, _e = (e) => e.family.links, ve = (e) => e.stateRef, Z = (e) => e.value, me = (e) => e.subscribers, B = (e) => e.parent, P = (e) => e.scope, x = (e, t) => C(e).meta[t], ee = (e, t, n) => C(e).meta[t] = n, Dt = (e) => e.compositeName, Ne = (e) => (V(e) || z(e)) && "kind" in e;
const ue = (e) => (t) => Ne(t) && t.kind === e;
let $e = ue("store"), Tt = ue("event"), Ke = ue("effect"), it = ue("domain"), Ct = ue("scope");
var Pt = { __proto__: null, unit: Ne, store: $e, event: Tt, effect: Ke, domain: it, scope: Ct, attached: (e) => Ke(e) && x(e, "attached") == 1 };
let ce = (e, t) => {
let n = e.indexOf(t);
n !== -1 && e.splice(n, 1);
}, M = (e, t) => e.push(t), ne = (e, t, n) => !e && console.error(`${t} is deprecated${n ? `, use ${n} instead` : ""}`);
const Se = () => {
}, M = (e, t) => e.push(t), oe = (e, t, n) => !e && console.error(`${t} is deprecated${n ? `, use ${n} instead` : ""}`);
const ge = () => {
let e = 0;
return () => "" + ++e;
};
let It = Se(), st = Se(), Pt = Se(), $t = Se(), W = null, ct = () => W, Bt = (e) => (e && W && W.sidRoot && (e = `${W.sidRoot}|${e}`), e), je = (e, t) => {
let It = ge(), ut = ge(), Ht = ge(), Nt = ge(), G = null, lt = () => G, $t = (e) => (e && G && G.sidRoot && (e = `${G.sidRoot}|${e}`), e), Be = (e, t) => {
let n = C(e);
k(t, (r) => {
let u = C(r);
n.family.type !== "domain" && (u.family.type = "crosslink"), M(me(u), n), M(he(n), u);
let a = C(r);
n.family.type !== "domain" && (a.family.type = "crosslink"), M(Se(a), n), M(_e(n), a);
});
}, le = (e = []) => (Array.isArray(e) ? e : [e]).flat().map(C), z = (e) => typeof e == "object" && e !== null, V = (e) => typeof e == "function", j = (e) => e === void 0, Nt = (e) => P(z(e) || V(e), "expect first argument be an object");
const Ye = (e, t, n, r) => P(!(!z(e) && !V(e) || !("family" in e) && !("graphite" in e)), `${t}: expect ${n} to be a unit (store, event or effect)${r}`);
}, le = (e = []) => (Array.isArray(e) ? e : [e]).flat().map(C), z = (e) => typeof e == "object" && e !== null, V = (e) => typeof e == "function", j = (e) => e === void 0, Bt = (e) => I(z(e) || V(e), "expect first argument be an object");
const Ue = (e, t, n, r) => I(!(!z(e) && !V(e) || !("family" in e) && !("graphite" in e)), `${t}: expect ${n} to be a unit (store, event or effect)${r}`);
let zt = (e, t, n) => {
Array.isArray(e) ? k(e, (r, u) => Ye(r, t, `${u} item of ${n}`, "")) : Ye(e, t, n, " or array of units");
}, Je = (e, { fn: t }, { a: n }) => t(e, n), jt = (e, { fn: t }, { a: n }) => t(n, e), qe = (e, { fn: t }) => t(e);
const ft = (e, t, n, r) => {
let u = { id: st(), type: e, data: t };
return n && (u.order = { priority: n }, r && (u.order.barrierID = ++qt)), u;
Array.isArray(e) ? k(e, (r, a) => Ue(r, t, `${a} item of ${n}`, "")) : Ue(e, t, n, " or array of units");
}, Ye = (e, { fn: t }, { a: n }) => t(e, n), jt = (e, { fn: t }, { a: n }) => t(n, e), ze = (e, { fn: t }) => t(e);
const st = (e, t, n, r) => {
let a = { id: ut(), type: e, data: t };
return n && (a.order = { priority: n }, r && (a.order.barrierID = ++qt)), a;
};
let qt = 0, _e = ({ from: e = "store", store: t, target: n, to: r = n ? "store" : re, batch: u, priority: s }) => ft("mov", { from: e, store: t, to: r, target: n }, s, u), ae = ({ fn: e, batch: t, priority: n, safe: r = 0, filter: u = 0, pure: s = 0 }) => ft("compute", { fn: e, safe: r, filter: u, pure: s }, n, t), He = ({ fn: e }) => ae({ fn: e, priority: "effect" }), G = (e, t, n) => ae({ fn: e, safe: 1, filter: t, priority: n && "effect" }), Ht = (e, t, n) => _e({ store: e, to: t ? re : "a", priority: n && "sampler", batch: 1 }), q = (e = qe, t) => ae({ fn: e, pure: 1, filter: t }), Wt = { mov: _e, compute: ae, filter: ({ fn: e, pure: t }) => ae({ fn: e, filter: 1, pure: t }), run: He }, Gt = (e) => ({ id: st(), current: e }), dt = ({ current: e }) => e, Ft = (e, t) => {
let qt = 0, ye = ({ from: e = "store", store: t, target: n, to: r = n ? "store" : ne, batch: a, priority: s }) => st("mov", { from: e, store: t, to: r, target: n }, s, a), ae = ({ fn: e, batch: t, priority: n, safe: r = 0, filter: a = 0, pure: s = 0 }) => st("compute", { fn: e, safe: r, filter: a, pure: s }, n, t), je = ({ fn: e }) => ae({ fn: e, priority: "effect" }), F = (e, t, n) => ae({ fn: e, safe: 1, filter: t, priority: n && "effect" }), Wt = (e, t, n) => ye({ store: e, to: t ? ne : "a", priority: n && "sampler", batch: 1 }), q = (e = ze, t) => ae({ fn: e, pure: 1, filter: t }), Gt = { mov: ye, compute: ae, filter: ({ fn: e, pure: t }) => ae({ fn: e, filter: 1, pure: t }), run: je }, Ft = (e) => ({ id: ut(), current: e }), ct = ({ current: e }) => e, Kt = (e, t) => {
e.before || (e.before = []), M(e.before, t);
}, H = null;
const We = (e, t) => {
}, W = null;
const qe = (e, t) => {
if (!e)

@@ -267,15 +267,15 @@ return t;

let n;
return (e.v.type === t.v.type && e.v.id > t.v.id || De(e.v.type) > De(t.v.type)) && (n = e, e = t, t = n), n = We(e.r, t), e.r = e.l, e.l = n, e;
}, Ge = [];
let Qe = 0;
for (; Qe < 6; )
M(Ge, { first: null, last: null, size: 0 }), Qe += 1;
const Kt = () => {
return (e.v.type === t.v.type && e.v.id > t.v.id || Te(e.v.type) > Te(t.v.type)) && (n = e, e = t, t = n), n = qe(e.r, t), e.r = e.l, e.l = n, e;
}, We = [];
let Je = 0;
for (; Je < 6; )
M(We, { first: null, last: null, size: 0 }), Je += 1;
const Ut = () => {
for (let e = 0; e < 6; e++) {
let t = Ge[e];
let t = We[e];
if (t.size > 0) {
if (e === 3 || e === 4) {
t.size -= 1;
let r = H.v;
return H = We(H.l, H.r), r;
let r = W.v;
return W = qe(W.l, W.r), r;
}

@@ -287,6 +287,6 @@ t.size === 1 && (t.last = null);

}
}, B = (e, t, n, r, u, s, a) => Me(0, { a: null, b: null, node: n, parent: r, value: u, page: t, scope: s, meta: a }, e), Me = (e, t, n, r = 0) => {
let u = De(n), s = Ge[u], a = { v: { idx: e, stack: t, type: n, id: r }, l: null, r: null };
u === 3 || u === 4 ? H = We(H, a) : (s.size === 0 ? s.first = a : s.last.r = a, s.last = a), s.size += 1;
}, De = (e) => {
}, N = (e, t, n, r, a, s, o) => De(0, { a: null, b: null, node: n, parent: r, value: a, page: t, scope: s, meta: o }, e), De = (e, t, n, r = 0) => {
let a = Te(n), s = We[a], o = { v: { idx: e, stack: t, type: n, id: r }, l: null, r: null };
a === 3 || a === 4 ? W = qe(W, o) : (s.size === 0 ? s.first = o : s.last.r = o, s.last = o), s.size += 1;
}, Te = (e) => {
switch (e) {

@@ -308,12 +308,12 @@ case "child":

}
}, be = /* @__PURE__ */ new Set();
let O, ue = 1, ce = 0, fe = 0, D = null, Ut = (e) => {
O = e;
}, Xe = (e) => {
}, Ae = /* @__PURE__ */ new Set();
let b, se = 1, fe = 0, de = 0, D = null, Yt = (e) => {
b = e;
}, Qe = (e) => {
D = e;
};
const pt = (e, t) => {
const ft = (e, t) => {
if (e) {
for (; e && !e.reg[t]; )
e = N(e);
e = B(e);
if (e)

@@ -324,25 +324,25 @@ return e;

};
let Yt = (e, t, n, r, u) => {
let s = pt(e, r.id);
return s ? s.reg[r.id] : t ? (F(t, r, u), t.reg[r.id]) : r;
let Jt = (e, t, n, r, a) => {
let s = ft(e, r.id);
return s ? s.reg[r.id] : t ? (K(t, r, a), t.reg[r.id]) : r;
};
const Jt = (e) => e;
let F = (e, t, n, r, u) => {
const Qt = (e) => e;
let K = (e, t, n, r, a) => {
var s;
let a = e.reg, m = t.sid, g = t == null || (s = t.meta) === null || s === void 0 ? void 0 : s.serialize;
if (a[t.id])
let o = e.reg, m = t.sid, y = t == null || (s = t.meta) === null || s === void 0 ? void 0 : s.serialize;
if (o[t.id])
return;
let p = { id: t.id, current: t.current, meta: t.meta };
if (m && m in e.sidValuesMap && !(m in e.sidIdMap))
p.current = (e.fromSerialize && g !== "ignore" && (g == null ? void 0 : g.read) || Jt)(e.sidValuesMap[m]);
else if (t.before && !u) {
let h = 0, c = n || !t.noInit || r;
p.current = (e.fromSerialize && y !== "ignore" && (y == null ? void 0 : y.read) || Qt)(e.sidValuesMap[m]);
else if (t.before && !a) {
let S = 0, c = n || !t.noInit || r;
k(t.before, (d) => {
switch (d.type) {
case te: {
let o = d.from;
if (o || d.fn) {
o && F(e, o, n, r);
let i = o && a[o.id].current;
c && (p.current = d.fn ? d.fn(i) : i);
case re: {
let i = d.from;
if (i || d.fn) {
i && K(e, i, n, r);
let l = i && o[i.id].current;
c && (p.current = d.fn ? d.fn(l) : l);
}

@@ -352,11 +352,11 @@ break;

case "field":
h || (h = 1, p.current = Array.isArray(p.current) ? [...p.current] : { ...p.current }), F(e, d.from, n, r), c && (p.current[d.field] = a[a[d.from.id].id].current);
S || (S = 1, p.current = Array.isArray(p.current) ? [...p.current] : { ...p.current }), K(e, d.from, n, r), c && (p.current[d.field] = o[o[d.from.id].id].current);
}
});
}
m && (e.sidIdMap[m] = t.id), a[t.id] = p;
m && (e.sidIdMap[m] = t.id), o[t.id] = p;
};
const Qt = (e, t, n) => {
const Xt = (e, t, n) => {
try {
return t(X(n), e.scope, n);
return t(Z(n), e.scope, n);
} catch (r) {

@@ -366,47 +366,47 @@ console.error(r), e.fail = 1;

};
let K = (e, t = {}) => (z(e) && (K(e.or, t), At(e, (n, r) => {
let U = (e, t = {}) => (z(e) && (U(e.or, t), xt(e, (n, r) => {
j(n) || r === "or" || r === "and" || (t[r] = n);
}), K(e.and, t)), t);
const Ze = (e, t) => {
se(e.next, t), se(me(e), t), se(he(e), t);
}, Te = (e, t, n) => {
}), U(e.and, t)), t);
const Xe = (e, t) => {
ce(e.next, t), ce(Se(e), t), ce(_e(e), t);
}, Ce = (e, t, n) => {
let r;
e.next.length = 0, e.seq.length = 0, e.scope = null;
let u = he(e);
for (; r = u.pop(); )
Ze(r, e), (t || n && x(e, "op") !== "sample" || r.family.type === "crosslink") && Te(r, t, x(r, "op") !== "on" && n);
for (u = me(e); r = u.pop(); )
Ze(r, e), n && r.family.type === "crosslink" && Te(r, t, x(r, "op") !== "on" && n);
}, J = (e) => e.clear();
let Ce = (e, { deep: t } = {}) => {
let a = _e(e);
for (; r = a.pop(); )
Xe(r, e), (t || n && x(e, "op") !== "sample" || r.family.type === "crosslink") && Ce(r, t, x(r, "op") !== "on" && n);
for (a = Se(e); r = a.pop(); )
Xe(r, e), n && r.family.type === "crosslink" && Ce(r, t, x(r, "op") !== "on" && n);
}, Q = (e) => e.clear();
let Pe = (e, { deep: t } = {}) => {
let n = 0;
if (e.ownerSet && e.ownerSet.delete(e), ze(e))
J(pe(e));
else if (ut(e)) {
if (e.ownerSet && e.ownerSet.delete(e), $e(e))
Q(me(e));
else if (it(e)) {
n = 1;
let r = e.history;
J(r.events), J(r.effects), J(r.stores), J(r.domains);
Q(r.events), Q(r.effects), Q(r.stores), Q(r.domains);
}
Te(C(e), !!t, n);
}, vt = (e) => {
let t = () => Ce(e);
Ce(C(e), !!t, n);
}, dt = (e) => {
let t = () => Pe(e);
return t.unsubscribe = t, t;
}, Fe = (e, t, n, r, u) => $({ node: n, parent: e, child: t, scope: { fn: u }, meta: { op: r }, family: { owners: [e, t], links: t }, regional: 1 }), mt = (e, t) => (P(V(t), ".watch argument should be a function"), vt($({ scope: { fn: t }, node: [He({ fn: qe })], parent: e, meta: { op: "watch" }, family: { owners: e }, regional: 1 }))), Xt = (e, t, n = "event") => {
N(e) && N(e).hooks[n](t);
}, ht = (e, t, n) => {
let r = K(n), u = e === "domain", s = It(), { sid: a = null, named: m = null, domain: g = null, parent: p = g } = r, h = m || r.name || (u ? "" : s), c = xt(h, p), d = { op: t.kind = e, name: t.shortName = h, sid: t.sid = Bt(a), named: m, unitId: t.id = s, serialize: r.serialize, derived: r.derived, config: r };
return t.parent = p, t.compositeName = c, t.defaultConfig = r, t.thru = (o) => (ne(0, "thru", "js pipe"), o(t)), t.getType = () => c.fullName, !u && (t.subscribe = (o) => (Nt(o), t.watch(V(o) ? o : (i) => o.next && o.next(i))), t[Vt] = () => t), d;
}, Ge = (e, t, n, r, a) => H({ node: n, parent: e, child: t, scope: { fn: a }, meta: { op: r }, family: { owners: [e, t], links: t }, regional: 1 }), pt = (e, t) => (I(V(t), ".watch argument should be a function"), dt(H({ scope: { fn: t }, node: [je({ fn: ze })], parent: e, meta: { op: "watch" }, family: { owners: e }, regional: 1 }))), Zt = (e, t, n = "event") => {
B(e) && B(e).hooks[n](t);
}, vt = (e, t, n) => {
let r = U(n), a = e === "domain", s = It(), { sid: o = null, named: m = null, domain: y = null, parent: p = y } = r, S = m || r.name || (a ? "" : s), c = kt(S, p), d = { op: t.kind = e, name: t.shortName = S, sid: t.sid = $t(o), named: m, unitId: t.id = s, serialize: r.serialize, derived: r.derived, config: r };
return t.parent = p, t.compositeName = c, t.defaultConfig = r, t.thru = (i) => (oe(0, "thru", "js pipe"), i(t)), t.getType = () => c.fullName, !a && (t.subscribe = (i) => (Bt(i), t.watch(V(i) ? i : (l) => i.next && i.next(l))), t[Mt] = () => t), d;
};
const Re = (e, t, n, r) => {
let u;
z(n) && (u = n, n = n.fn);
let s = A({ name: `${e.shortName} → *`, derived: 1, and: u });
return Fe(e, s, r, t, n), s;
}, St = (e, t, n, r, u) => {
let s = de(t), a = _e({ store: s, to: "a", priority: "read" });
n === te && (a.data.softRead = 1);
let m = [a, q(r)];
return Q("storeOnMap", s, m, ze(e) && de(e)), Fe(e, t, m, n, u);
const Le = (e, t, n, r) => {
let a;
z(n) && (a = n, n = n.fn);
let s = A({ name: `${e.shortName} → *`, derived: 1, and: a });
return Ge(e, s, r, t, n), s;
}, mt = (e, t, n, r, a) => {
let s = ve(t), o = ye({ store: s, to: "a", priority: "read" });
n === re && (o.data.softRead = 1);
let m = [o, q(r)];
return X("storeOnMap", s, m, $e(e) && ve(e)), Ge(e, t, m, n, a);
};
let Zt = (e, t, n) => {
let er = (e, t, n) => {
try {

@@ -417,13 +417,13 @@ return [1, e(...n)];

}
}, er = (e) => {
let t = I(e), n = { ref: t };
}, tr = (e) => {
let t = P(e), n = { ref: t };
return t && M(t.activeEffects, n), n;
}, et = (e, t, n, r, u, s) => (a) => {
s.ref && se(s.ref.activeEffects, s), ee({ target: [r, tr], params: [n ? { status: "done", params: e, result: a } : { status: "fail", params: e, error: a }, { value: a, fn: n ? t.rs : t.rj }], defer: 1, page: u.page, scope: s.ref, meta: u.meta });
}, Ze = (e, t, n, r, a, s) => (o) => {
s.ref && ce(s.ref.activeEffects, s), te({ target: [r, rr], params: [n ? { status: "done", params: e, result: o } : { status: "fail", params: e, error: o }, { value: o, fn: n ? t.rs : t.rj }], defer: 1, page: a.page, scope: s.ref, meta: a.meta });
};
const tr = $({ node: [He({ fn: ({ fn: e, value: t }) => e(t) })], meta: { op: "fx", fx: "sidechain" } }), Er = lt(() => {
const rr = H({ node: [je({ fn: ({ fn: e, value: t }) => e(t) })], meta: { op: "fx", fx: "sidechain" } }), Lr = at(() => {
window.isBackFromBrowser = !1, window.history.back();
}), _t = lt((e) => {
}), ht = at((e) => {
window.history.pushState(e, "");
}), Ie = A(), Pe = A(), $e = A(), Be = A(), rr = A(), gt = A(), tt = A(), nr = ve({
}), nr = A(), or = A(), ar = A(), ir = A(), St = A(), _t = A(), Ie = A(), ur = he({
activeView: null,

@@ -435,18 +435,18 @@ activePanel: null,

isBackHandled: !0
}).on(Ie, (e, t) => ({
}).on(nr, (e, t) => ({
...e,
activeView: t
})).on(Pe, (e, t) => ({
})).on(or, (e, t) => ({
...e,
activePanel: t
})).on($e, (e, t) => ({
})).on(ar, (e, t) => ({
...e,
activeModal: t
})).on(Be, (e, t) => ({
})).on(ir, (e, t) => ({
...e,
activePopout: t
})).on(gt, (e) => ({
})).on(_t, (e) => ({
...e,
isRouteInit: !0
})).on(rr, (e, t) => ({
})).on(St, (e, t) => ({
...e,

@@ -457,21 +457,24 @@ activeView: t.hasOwnProperty("view") ? t.view : e.activeView,

activePopout: t.hasOwnProperty("popout") ? t.popout : e.activePopout
})).on(Ie, (e, t) => ({
...e,
isBackHandled: t
}));
function ar(e) {
function lr(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var rt = {}, or = {
var et = {}, sr = {
get exports() {
return rt;
return et;
},
set exports(e) {
rt = e;
et = e;
}
}, Le = {}, oe = {}, ir = {
}, xe = {}, ie = {}, cr = {
get exports() {
return oe;
return ie;
},
set exports(e) {
oe = e;
ie = e;
}
}, Ae = {};
}, ke = {};
/**

@@ -486,7 +489,7 @@ * @license React

*/
var nt;
function lr() {
if (nt)
return Ae;
nt = 1;
var tt;
function fr() {
if (tt)
return ke;
tt = 1;
var e = T;

@@ -496,19 +499,19 @@ function t(c, d) {

}
var n = typeof Object.is == "function" ? Object.is : t, r = e.useState, u = e.useEffect, s = e.useLayoutEffect, a = e.useDebugValue;
var n = typeof Object.is == "function" ? Object.is : t, r = e.useState, a = e.useEffect, s = e.useLayoutEffect, o = e.useDebugValue;
function m(c, d) {
var o = d(), i = r({ inst: { value: o, getSnapshot: d } }), l = i[0].inst, f = i[1];
var i = d(), l = r({ inst: { value: i, getSnapshot: d } }), u = l[0].inst, f = l[1];
return s(function() {
l.value = o, l.getSnapshot = d, g(l) && f({ inst: l });
}, [c, o, d]), u(function() {
return g(l) && f({ inst: l }), c(function() {
g(l) && f({ inst: l });
u.value = i, u.getSnapshot = d, y(u) && f({ inst: u });
}, [c, i, d]), a(function() {
return y(u) && f({ inst: u }), c(function() {
y(u) && f({ inst: u });
});
}, [c]), a(o), o;
}, [c]), o(i), i;
}
function g(c) {
function y(c) {
var d = c.getSnapshot;
c = c.value;
try {
var o = d();
return !n(c, o);
var i = d();
return !n(c, i);
} catch {

@@ -521,6 +524,6 @@ return !0;

}
var h = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? p : m;
return Ae.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : h, Ae;
var S = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? p : m;
return ke.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : S, ke;
}
var xe = {};
var Ve = {};
/**

@@ -535,62 +538,62 @@ * @license React

*/
var at;
function ur() {
return at || (at = 1, process.env.NODE_ENV !== "production" && function() {
var rt;
function dr() {
return rt || (rt = 1, process.env.NODE_ENV !== "production" && function() {
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
var e = T, t = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function n(w) {
function n(g) {
{
for (var v = arguments.length, y = new Array(v > 1 ? v - 1 : 0), S = 1; S < v; S++)
y[S - 1] = arguments[S];
r("error", w, y);
for (var v = arguments.length, w = new Array(v > 1 ? v - 1 : 0), h = 1; h < v; h++)
w[h - 1] = arguments[h];
r("error", g, w);
}
}
function r(w, v, y) {
function r(g, v, w) {
{
var S = t.ReactDebugCurrentFrame, _ = S.getStackAddendum();
_ !== "" && (v += "%s", y = y.concat([_]));
var E = y.map(function(L) {
var h = t.ReactDebugCurrentFrame, _ = h.getStackAddendum();
_ !== "" && (v += "%s", w = w.concat([_]));
var E = w.map(function(L) {
return String(L);
});
E.unshift("Warning: " + v), Function.prototype.apply.call(console[w], console, E);
E.unshift("Warning: " + v), Function.prototype.apply.call(console[g], console, E);
}
}
function u(w, v) {
return w === v && (w !== 0 || 1 / w === 1 / v) || w !== w && v !== v;
function a(g, v) {
return g === v && (g !== 0 || 1 / g === 1 / v) || g !== g && v !== v;
}
var s = typeof Object.is == "function" ? Object.is : u, a = e.useState, m = e.useEffect, g = e.useLayoutEffect, p = e.useDebugValue, h = !1, c = !1;
function d(w, v, y) {
h || e.startTransition !== void 0 && (h = !0, n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
var S = v();
var s = typeof Object.is == "function" ? Object.is : a, o = e.useState, m = e.useEffect, y = e.useLayoutEffect, p = e.useDebugValue, S = !1, c = !1;
function d(g, v, w) {
S || e.startTransition !== void 0 && (S = !0, n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));
var h = v();
if (!c) {
var _ = v();
s(S, _) || (n("The result of getSnapshot should be cached to avoid an infinite loop"), c = !0);
s(h, _) || (n("The result of getSnapshot should be cached to avoid an infinite loop"), c = !0);
}
var E = a({
var E = o({
inst: {
value: S,
value: h,
getSnapshot: v
}
}), L = E[0].inst, U = E[1];
return g(function() {
L.value = S, L.getSnapshot = v, o(L) && U({
}), L = E[0].inst, Y = E[1];
return y(function() {
L.value = h, L.getSnapshot = v, i(L) && Y({
inst: L
});
}, [w, S, v]), m(function() {
o(L) && U({
}, [g, h, v]), m(function() {
i(L) && Y({
inst: L
});
var ge = function() {
o(L) && U({
var we = function() {
i(L) && Y({
inst: L
});
};
return w(ge);
}, [w]), p(S), S;
return g(we);
}, [g]), p(h), h;
}
function o(w) {
var v = w.getSnapshot, y = w.value;
function i(g) {
var v = g.getSnapshot, w = g.value;
try {
var S = v();
return !s(y, S);
var h = v();
return !s(w, h);
} catch {

@@ -600,13 +603,13 @@ return !0;

}
function i(w, v, y) {
function l(g, v, w) {
return v();
}
var l = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", f = !l, b = f ? i : d, R = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : b;
xe.useSyncExternalStore = R, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
}()), xe;
var u = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", f = !u, O = f ? l : d, R = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : O;
Ve.useSyncExternalStore = R, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
}()), Ve;
}
(function(e) {
process.env.NODE_ENV === "production" ? e.exports = lr() : e.exports = ur();
})(ir);
const sr = /* @__PURE__ */ ar(oe);
process.env.NODE_ENV === "production" ? e.exports = fr() : e.exports = dr();
})(cr);
const pr = /* @__PURE__ */ lr(ie);
/**

@@ -621,48 +624,48 @@ * @license React

*/
var ot;
function cr() {
if (ot)
return Le;
ot = 1;
var e = T, t = oe;
function n(p, h) {
return p === h && (p !== 0 || 1 / p === 1 / h) || p !== p && h !== h;
var nt;
function vr() {
if (nt)
return xe;
nt = 1;
var e = T, t = ie;
function n(p, S) {
return p === S && (p !== 0 || 1 / p === 1 / S) || p !== p && S !== S;
}
var r = typeof Object.is == "function" ? Object.is : n, u = t.useSyncExternalStore, s = e.useRef, a = e.useEffect, m = e.useMemo, g = e.useDebugValue;
return Le.useSyncExternalStoreWithSelector = function(p, h, c, d, o) {
var i = s(null);
if (i.current === null) {
var l = { hasValue: !1, value: null };
i.current = l;
var r = typeof Object.is == "function" ? Object.is : n, a = t.useSyncExternalStore, s = e.useRef, o = e.useEffect, m = e.useMemo, y = e.useDebugValue;
return xe.useSyncExternalStoreWithSelector = function(p, S, c, d, i) {
var l = s(null);
if (l.current === null) {
var u = { hasValue: !1, value: null };
l.current = u;
} else
l = i.current;
i = m(function() {
function b(S) {
u = l.current;
l = m(function() {
function O(h) {
if (!R) {
if (R = !0, w = S, S = d(S), o !== void 0 && l.hasValue) {
var _ = l.value;
if (o(_, S))
if (R = !0, g = h, h = d(h), i !== void 0 && u.hasValue) {
var _ = u.value;
if (i(_, h))
return v = _;
}
return v = S;
return v = h;
}
if (_ = v, r(w, S))
if (_ = v, r(g, h))
return _;
var E = d(S);
return o !== void 0 && o(_, E) ? _ : (w = S, v = E);
var E = d(h);
return i !== void 0 && i(_, E) ? _ : (g = h, v = E);
}
var R = !1, w, v, y = c === void 0 ? null : c;
var R = !1, g, v, w = c === void 0 ? null : c;
return [function() {
return b(h());
}, y === null ? void 0 : function() {
return b(y());
return O(S());
}, w === null ? void 0 : function() {
return O(w());
}];
}, [h, c, d, o]);
var f = u(p, i[0], i[1]);
return a(function() {
l.hasValue = !0, l.value = f;
}, [f]), g(f), f;
}, Le;
}, [S, c, d, i]);
var f = a(p, l[0], l[1]);
return o(function() {
u.hasValue = !0, u.value = f;
}, [f]), y(f), f;
}, xe;
}
var ke = {};
var Me = {};
/**

@@ -677,91 +680,95 @@ * @license React

*/
var it;
function fr() {
return it || (it = 1, process.env.NODE_ENV !== "production" && function() {
var ot;
function mr() {
return ot || (ot = 1, process.env.NODE_ENV !== "production" && function() {
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
var e = T, t = oe;
function n(h, c) {
return h === c && (h !== 0 || 1 / h === 1 / c) || h !== h && c !== c;
var e = T, t = ie;
function n(S, c) {
return S === c && (S !== 0 || 1 / S === 1 / c) || S !== S && c !== c;
}
var r = typeof Object.is == "function" ? Object.is : n, u = t.useSyncExternalStore, s = e.useRef, a = e.useEffect, m = e.useMemo, g = e.useDebugValue;
function p(h, c, d, o, i) {
var l = s(null), f;
l.current === null ? (f = {
var r = typeof Object.is == "function" ? Object.is : n, a = t.useSyncExternalStore, s = e.useRef, o = e.useEffect, m = e.useMemo, y = e.useDebugValue;
function p(S, c, d, i, l) {
var u = s(null), f;
u.current === null ? (f = {
hasValue: !1,
value: null
}, l.current = f) : f = l.current;
var b = m(function() {
var y = !1, S, _, E = function(Y) {
if (!y) {
y = !0, S = Y;
var ye = o(Y);
if (i !== void 0 && f.hasValue) {
var we = f.value;
if (i(we, ye))
return _ = we, we;
}, u.current = f) : f = u.current;
var O = m(function() {
var w = !1, h, _, E = function(J) {
if (!w) {
w = !0, h = J;
var Ee = i(J);
if (l !== void 0 && f.hasValue) {
var Oe = f.value;
if (l(Oe, Ee))
return _ = Oe, Oe;
}
return _ = ye, ye;
return _ = Ee, Ee;
}
var Lt = S, Ee = _;
if (r(Lt, Y))
return Ee;
var Oe = o(Y);
return i !== void 0 && i(Ee, Oe) ? Ee : (S = Y, _ = Oe, Oe);
}, L = d === void 0 ? null : d, U = function() {
var Lt = h, Re = _;
if (r(Lt, J))
return Re;
var be = i(J);
return l !== void 0 && l(Re, be) ? Re : (h = J, _ = be, be);
}, L = d === void 0 ? null : d, Y = function() {
return E(c());
}, ge = L === null ? void 0 : function() {
}, we = L === null ? void 0 : function() {
return E(L());
};
return [U, ge];
}, [c, d, o, i]), R = b[0], w = b[1], v = u(h, R, w);
return a(function() {
return [Y, we];
}, [c, d, i, l]), R = O[0], g = O[1], v = a(S, R, g);
return o(function() {
f.hasValue = !0, f.value = v;
}, [v]), g(v), v;
}, [v]), y(v), v;
}
ke.useSyncExternalStoreWithSelector = p, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
}()), ke;
Me.useSyncExternalStoreWithSelector = p, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
}()), Me;
}
(function(e) {
process.env.NODE_ENV === "production" ? e.exports = cr() : e.exports = fr();
})(or);
function dr(e, t, n, r) {
let u = [Wt.run({ fn: (s) => t(s) })];
if (r && u.unshift(r), n) {
let s = $({ node: u }), a = e.graphite.id, m = n.additionalLinks, g = m[a] || [];
return m[a] = g, g.push(s), () => {
let p = g.indexOf(s);
p !== -1 && g.splice(p, 1), Ce(s);
process.env.NODE_ENV === "production" ? e.exports = vr() : e.exports = mr();
})(sr);
function hr(e, t, n, r) {
let a = [Gt.run({ fn: (s) => t(s) })];
if (r && a.unshift(r), n) {
let s = H({ node: a }), o = e.graphite.id, m = n.additionalLinks, y = m[o] || [];
return m[o] = y, y.push(s), () => {
let p = y.indexOf(s);
p !== -1 && y.splice(p, 1), Pe(s);
};
}
{
let s = $({ node: u, parent: [e], family: { owners: e } });
let s = H({ node: a, parent: [e], family: { owners: e } });
return () => {
Ce(s);
Pe(s);
};
}
}
function pr(e, t) {
Ct.store(e) || wt("expect useStore argument to be a store");
let n = T.useCallback((u) => dr(e, u, t), [e, t]), r = T.useCallback(() => hr(e, t), [e, t]);
return mr(n, r, r);
function Sr(e, t) {
Pt.store(e) || yt("expect useStore argument to be a store");
let n = T.useCallback((a) => hr(e, a, t), [e, t]), r = T.useCallback(() => yr(e, t), [e, t]);
return gr(n, r, r);
}
function vr(e) {
let t = T.useContext(Sr);
return e && !t && wt("No scope found, consider adding <Provider> to app root"), t;
function _r(e) {
let t = T.useContext(wr);
return e && !t && yt("No scope found, consider adding <Provider> to app root"), t;
}
function yt(e, t) {
return pr(e, vr(t == null ? void 0 : t.forceScope));
function gt(e, t) {
return Sr(e, _r(t == null ? void 0 : t.forceScope));
}
let wt = (e) => {
let yt = (e) => {
throw Error(e);
};
typeof window < "u" ? T.useLayoutEffect : T.useEffect;
const { useSyncExternalStore: mr } = sr, hr = (e, t) => t ? t.getState(e) : e.getState(), Sr = T.createContext(null), _r = (e, t, n) => {
Ve(() => {
const r = (u) => {
u instanceof KeyboardEvent && u.key === n ? t(u) : n || t(u);
const { useSyncExternalStore: gr } = pr, yr = (e, t) => t ? t.getState(e) : e.getState(), wr = T.createContext(null), Er = (e, t, n) => {
$(() => {
const r = (a) => {
a instanceof KeyboardEvent && a.key === n ? t(a) : n || t(a);
};
return window.addEventListener(e, r), () => window.removeEventListener(e, r);
}, [e, n, t]);
}, Et = A(), Ot = A(), bt = A(), Rt = A(), gr = ve({
}, wt = A(), Et = A(), Or = A(), Ot = A(), Rt = A();
A();
const pe = A(), bt = A(), At = A(), He = A(), Rr = he({
isRoutesHandled: !0,
notHandledRoutes: [],
virtualView: null,

@@ -771,9 +778,9 @@ virtualPanel: null,

virtualPopout: null
}).on(Et, (e, t) => ({
}).on(wt, (e, t) => ({
...e,
virtualView: t
})).on(Ot, (e, t) => ({
})).on(Et, (e, t) => ({
...e,
virtualPanel: t
})).on(bt, (e, t) => ({
})).on(Ot, (e, t) => ({
...e,

@@ -784,32 +791,45 @@ virtualModal: t

virtualPopout: t
})), Or = (e, ...t) => {
const { activeView: n, activePanel: r, activeModal: u, activePopout: s, isRouteInit: a, isBackHandled: m } = yr();
Ve(() => {
a || (Et(e.view), Ot(e.panel), e.modal && bt(e.modal), e.popout && Rt(e.popout));
}, [a, e.view, e.panel, e.modal, e.popout]);
const { virtualView: g, virtualPanel: p, virtualModal: h, virtualPopout: c } = yt(gr);
Ve(() => {
const d = window.history.state ?? {
view: void 0,
panel: void 0,
modal: void 0,
popout: void 0
};
(a && m && (d.view !== g || d.panel !== p || d.modal !== h || d.popout !== c) || !a && g && p) && (Ie(g), Pe(p), $e(h), Be(c), _t({
view: g,
panel: p,
modal: h,
popout: c
}), a || gt());
}, [
g,
p,
h,
c,
a,
m
]), _r("popstate", async () => {
a && (await (async () => {
tt(!1);
const { view: o, panel: i, modal: l, popout: f } = window.history.state ?? {
})).on(pe, (e, t) => ({
...e,
notHandledRoutes: [...e.notHandledRoutes, t]
})).on(bt, (e, t) => ({
...e,
notHandledRoutes: [t, ...e.notHandledRoutes]
})).on(At, (e) => ({
...e,
notHandledRoutes: []
})).on(He, (e, t) => ({
...e,
isRoutesHandled: t
})).on(Or, (e, { view: t, panel: n }) => ({
...e,
virtualView: t,
virtualPanel: n
})), xr = (e, ...t) => {
const { activeView: n, activePanel: r, activeModal: a, activePopout: s, isRouteInit: o, isBackHandled: m } = br();
$(() => {
o || (wt(e.view), Et(e.panel), e.modal && Ot(e.modal), e.popout && Rt(e.popout));
}, [o, e.view, e.panel, e.modal, e.popout]);
const { virtualView: y, virtualPanel: p, virtualModal: S, virtualPopout: c, notHandledRoutes: d, isRoutesHandled: i } = gt(Rr);
$(() => {
pe({ view: y, panel: p });
}, [y, p]), $(() => {
pe({ modal: S });
}, [S]), $(() => {
pe({ popout: c });
}, [c]), $(() => {
m && o && i && (He(!1), d.forEach((l) => {
St(l);
}), At(), He(!0));
}, [m, o, d, i]), $(() => {
(o || !o && n && r) && (ht({
view: n,
panel: r,
modal: a,
popout: s
}), o || _t());
}, [n, r, a, s, o]), Er("popstate", async () => {
o && (await (async () => {
Ie(!1);
const { view: u, panel: f, modal: O, popout: R } = window.history.state ?? {
view: void 0,

@@ -820,31 +840,32 @@ panel: void 0,

};
console.log("prevRoutes", o, i, l, f), console.log("storeRoutes", n, r, u, s);
for (const b in t)
if (!await t[b]({
console.log("prevRoutes", u, f, O, R), console.log("storeRoutes", n, r, a, s);
for (const g in t)
if (!await t[g]({
view: n,
panel: r,
modal: u,
modal: a,
popout: s
}, { view: o, panel: i, modal: l, popout: f }))
}, { view: u, panel: f, modal: O, popout: R }))
return;
Ie(o), Pe(i), $e(l), Be(f), tt(!0);
bt({ view: u, panel: f, modal: O, popout: R }), Ie(!0);
})(), window.isBackFromBrowser = !0);
});
}, yr = () => yt(nr), br = (e) => e, Rr = (e, t) => (n, r) => ["view", "panel", "modal", "popout"].some((s) => n[s] === e && n[s] !== r[s]) && window.isBackFromBrowser ? (t && t(n, r), _t(n), !1) : !0;
}, br = () => gt(ur), kr = (e) => e, Vr = (e, t) => (n, r) => ["view", "panel", "modal", "popout"].some((s) => n[s] === e && n[s] !== r[s]) && window.isBackFromBrowser ? (t && t(n, r), ht(n), !1) : !0;
export {
$e as _setActiveModal,
Pe as _setActivePanel,
Be as _setActivePopout,
Ie as _setActiveView,
Er as back,
Rr as createDisableBackBrowserRouteMiddleware,
br as createRouteMiddleware,
_t as historyPush,
bt as setActiveModal,
Ot as setActivePanel,
ar as _setActiveModal,
or as _setActivePanel,
ir as _setActivePopout,
nr as _setActiveView,
St as _setRoutes,
Lr as back,
Vr as createDisableBackBrowserRouteMiddleware,
kr as createRouteMiddleware,
ht as historyPush,
Ot as setActiveModal,
Et as setActivePanel,
Rt as setActivePopout,
Et as setActiveView,
rr as setRoutes,
Or as useInitRouter,
yr as useRouter
wt as setActiveView,
Or as setActiveViewPanel,
xr as useInitRouter,
br as useRouter
};

@@ -6,4 +6,4 @@ import { SetRoutes } from "src/types";

export declare const _setActivePopout: import("effector").Event<string | null>;
export declare const setRoutes: import("effector").Event<SetRoutes>;
export declare const _setRoutes: import("effector").Event<SetRoutes>;
export declare const initRoute: import("effector").Event<void>;
export declare const setBackHandled: import("effector").Event<boolean>;

@@ -0,4 +1,14 @@

import { Routes } from "src/types";
export declare const setActiveView: import("effector").Event<string>;
export declare const setActivePanel: import("effector").Event<string>;
export declare const setActiveViewPanel: import("effector").Event<{
view: string;
panel: string;
}>;
export declare const setActiveModal: import("effector").Event<string>;
export declare const setActivePopout: import("effector").Event<string>;
export declare const setNotHandledRoutes: import("effector").Event<Partial<Routes>[]>;
export declare const pushNotHandledRoutes: import("effector").Event<Partial<Routes>>;
export declare const pushInStartNotHandledRoutes: import("effector").Event<Partial<Routes>>;
export declare const dropNotHandledRoutes: import("effector").Event<void>;
export declare const setRoutesHandled: import("effector").Event<boolean>;

@@ -0,2 +1,5 @@

import { Routes } from "src/types";
type Store = {
isRoutesHandled: boolean;
notHandledRoutes: Partial<Routes>[];
virtualView: string | null;

@@ -3,0 +6,0 @@ virtualPanel: string | null;

{
"name": "@blumjs/router",
"version": "2.0.2",
"version": "3.0.0",
"description": "",

@@ -5,0 +5,0 @@ "exports": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc