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

react-ssr-prepass

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-ssr-prepass - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

1173

dist/react-ssr-prepass.es.js

@@ -1,97 +0,182 @@

import React, { Children, createElement } from "react";
import e, { Children as r, createElement as t } from "react";
function f() {
return (f = Object.assign || function(a) {
for (var b = 1; b < arguments.length; b++) {
var c, d = arguments[b];
for (c in d) {
Object.prototype.hasOwnProperty.call(d, c) && (a[c] = d[c]);
function _extends() {
_extends = Object.assign || function(e) {
for (var r = 1; r < arguments.length; r++) {
var t = arguments[r];
for (var n in t) {
if (Object.prototype.hasOwnProperty.call(t, n)) {
e[n] = t[n];
}
}
}
return a;
}).apply(this, arguments);
return e;
};
return _extends.apply(this, arguments);
}
var Element = 60103, h = 60106, k = 60107, aa = 60108, ba = 60114, ca = 60109, da = 60110, ea = 60111, fa = 60112, ha = 60113, ia = 60115, ja = 60116;
var n = 60103;
var u = 60106;
var o = 60107;
var a = 60108;
var i = 60114;
var c = 60109;
var l = 60110;
var f = 60111;
var s = 60112;
var v = 60113;
var p = 60115;
var d = 60116;
if ("function" == typeof Symbol && Symbol.for) {
var l = Symbol.for;
Element = l("react.element");
h = l("react.portal");
k = l("react.fragment");
aa = l("react.strict_mode");
ba = l("react.profiler");
ca = l("react.provider");
da = l("react.context");
ea = Symbol.for("react.concurrent_mode");
fa = l("react.forward_ref");
ha = l("react.suspense");
ia = l("react.memo");
ja = l("react.lazy");
var m = Symbol.for;
n = m("react.element");
u = m("react.portal");
o = m("react.fragment");
a = m("react.strict_mode");
i = m("react.profiler");
c = m("react.provider");
l = m("react.context");
f = Symbol.for("react.concurrent_mode");
s = m("react.forward_ref");
v = m("react.suspense");
p = m("react.memo");
d = m("react.lazy");
}
var n = Element, ka = h, q = k, r = aa, t = ba, u = ca, v = da, x = ea, z = fa, A = ha, B = ia, C = ja;
var h = n;
var ma = Children.toArray;
var y = u;
function na(a) {
return null !== a && "object" == typeof a;
}
var _ = o;
function D(a) {
return ma(a).filter(na);
}
var S = a;
function E(a, b) {
return "object" == typeof b ? f({}, b, a) : a;
}
var x = i;
var F = new Map, G = {}, H = void 0, I = void 0;
var b = c;
function oa() {
var a = H;
H = void 0;
return a;
}
var M = l;
function pa() {
var a = I;
I = void 0;
return a;
}
var g = f;
function J(a) {
H = void 0;
G = a;
}
var k = s;
function K(a) {
I = void 0;
F = a;
}
var w = v;
function L(a) {
var b = F.get(a);
return void 0 !== b ? b : a._currentValue;
}
var F = p;
var qa = {};
var I = d;
function ra(a) {
var b = a.contextType;
a = a.contextTypes;
if (b) {
return L(b);
var q = r.toArray;
var isAbstractElement = function(e) {
return null !== e && "object" == typeof e;
};
var getChildrenArray = function(e) {
return q(e).filter(isAbstractElement);
};
var computeProps = function(e, r) {
return "object" == typeof r ? _extends({}, r, e) : e;
};
var E = new Map;
var C = {};
var D = void 0;
var P = void 0;
var getCurrentContextMap = function() {
return _extends({}, C);
};
var getCurrentContextStore = function() {
return new Map(E);
};
var flushPrevContextMap = function() {
var e = D;
D = void 0;
return e;
};
var flushPrevContextStore = function() {
var e = P;
P = void 0;
return e;
};
var restoreContextMap = function(e) {
if (void 0 !== e) {
_extends(C, e);
}
if (!a) {
return qa;
};
var restoreContextStore = function(e) {
if (void 0 !== e) {
E.set(e[0], e[1]);
}
b = {};
for (var d in a) {
b[d] = G[d];
};
var setCurrentContextMap = function(e) {
D = void 0;
C = e;
};
var setCurrentContextStore = function(e) {
P = void 0;
E = e;
};
var readContextValue = function(e) {
var r = E.get(e);
if (void 0 !== r) {
return r;
}
return b;
}
return e._currentValue;
};
var M = null, N = {
var R = {};
var maskContext = function(e) {
var r = e.contextType;
var t = e.contextTypes;
if (r) {
return readContextValue(r);
} else if (!t) {
return R;
}
var n = {};
for (var u in t) {
n[u] = C[u];
}
return n;
};
var z = null;
var getCurrentErrorFrame = function() {
return z;
};
var setCurrentErrorFrame = function(e) {
z = e || null;
};
var O = {
current: {

@@ -102,90 +187,142 @@ uniqueID: 0

var ta = "function" == typeof Object.is ? Object.is : function sa(a, b) {
return a === b && (0 !== a || 1 / a == 1 / b) || a != a && b != b;
}, O = null;
var W = "function" == typeof Object.is ? Object.is : function is(e, r) {
return e === r && (0 !== e || 1 / e == 1 / r) || e != e && r != r;
};
function P() {
if (null === O) {
throw Error("[react-ssr-prepass] Hooks can only be called inside the body of a function component. (https://fb.me/react-invalid-hook-call)");
var j = null;
var setCurrentIdentity = function(e) {
j = e;
};
var getCurrentIdentity = function() {
if (null === j) {
throw new Error("[react-ssr-prepass] Hooks can only be called inside the body of a function component. (https://fb.me/react-invalid-hook-call)");
}
return O;
}
return j;
};
var Q = null, R = null, S = !1, T = null, U = 0;
var H = null;
function V() {
return null === R ? null === Q ? Q = R = {
memoizedState: null,
queue: null,
next: null
} : R = Q : null === R.next ? R = R.next = {
memoizedState: null,
queue: null,
next: null
} : R = R.next;
var T = null;
var U = !1;
var $ = null;
var A = 0;
var setFirstHook = function(e) {
H = e;
};
function createWorkInProgressHook() {
if (null === T) {
if (null === H) {
return H = T = {
memoizedState: null,
queue: null,
next: null
};
} else {
return T = H;
}
} else if (null === T.next) {
return T = T.next = {
memoizedState: null,
queue: null,
next: null
};
} else {
return T = T.next;
}
}
function va(a, b) {
return "function" == typeof b ? b(a) : b;
function basicStateReducer(e, r) {
return "function" == typeof r ? r(e) : r;
}
function wa(a, b, d) {
var c = P();
null === (R = V()).queue && (b = a === va ? "function" == typeof b ? b() : b : void 0 !== d ? d(b) : b,
R.memoizedState = b);
c = (b = R.queue || (R.queue = {
function useReducer(e, r, t) {
var n = getCurrentIdentity();
if (null === (T = createWorkInProgressHook()).queue) {
var u;
if (e === basicStateReducer) {
u = "function" == typeof r ? r() : r;
} else {
u = void 0 !== t ? t(r) : r;
}
T.memoizedState = u;
}
var o = T.queue || (T.queue = {
last: null,
dispatch: null
})).dispatch || (b.dispatch = xa.bind(null, c, b));
if (null !== T && void 0 !== (d = T.get(b))) {
T.delete(b);
b = R.memoizedState;
do {
b = a(b, d.action), d = d.next;
} while (null !== d);
R.memoizedState = b;
});
var a = o.dispatch || (o.dispatch = dispatchAction.bind(null, n, o));
if (null !== $) {
var i = $.get(o);
if (void 0 !== i) {
$.delete(o);
var c = T.memoizedState;
var l = i;
do {
c = e(c, l.action);
l = l.next;
} while (null !== l);
T.memoizedState = c;
}
}
return [ R.memoizedState, c ];
return [ T.memoizedState, a ];
}
function ya(a, b) {
P();
b = void 0 === b ? null : b;
var d = (R = V()).memoizedState;
if (null !== d && null !== b) {
a: {
var c = d[1];
if (null === c) {
c = !1;
} else {
for (var e = 0; e < c.length && e < b.length; e++) {
if (!ta(b[e], c[e])) {
c = !1;
break a;
}
function useMemo(e, r) {
getCurrentIdentity();
var t = void 0 === r ? null : r;
var n = (T = createWorkInProgressHook()).memoizedState;
if (null !== n && null !== t) {
if (function areHookInputsEqual(e, r) {
if (null === r) {
return !1;
}
for (var t = 0; t < r.length && t < e.length; t++) {
if (!W(e[t], r[t])) {
return !1;
}
c = !0;
}
return !0;
}(t, n[1])) {
return n[0];
}
if (c) {
return d[0];
}
}
a = a();
R.memoizedState = [ a, b ];
return a;
var u = e();
T.memoizedState = [ u, t ];
return u;
}
function xa(a, b, d) {
if (a === O) {
if (S = !0, a = {
action: d,
function useOpaqueIdentifier() {
getCurrentIdentity();
if (!(T = createWorkInProgressHook()).memoizedState) {
T.memoizedState = "R:" + (O.current.uniqueID++).toString(36);
}
return T.memoizedState;
}
function dispatchAction(e, r, t) {
if (e === j) {
U = !0;
var n = {
action: t,
next: null
}, null === T && (T = new Map), void 0 === (d = T.get(b))) {
T.set(b, a);
};
if (null === $) {
$ = new Map;
}
var u = $.get(r);
if (void 0 === u) {
$.set(r, n);
} else {
for (b = d; null !== b.next; ) {
b = b.next;
var o = u;
while (null !== o.next) {
o = o.next;
}
b.next = a;
o.next = n;
}

@@ -195,289 +332,389 @@ }

function W() {}
function noop() {}
function Ba(a) {
a();
function _ref$2(e) {
e();
}
var Ca = {
readContext: function(a) {
return L(a);
var N = {
readContext: function readContext(e, r) {
return readContextValue(e);
},
useContext: function(a) {
P();
return L(a);
useSyncExternalStore: function useSyncExternalStore(e, r, t) {
return r();
},
useMemo: ya,
useReducer: wa,
useRef: function(a) {
P();
var b = (R = V()).memoizedState;
return null === b ? R.memoizedState = a = {
current: a
} : b;
useContext: function useContext(e, r) {
getCurrentIdentity();
return readContextValue(e);
},
useState: function(a) {
return wa(va, a);
useMemo: useMemo,
useReducer: useReducer,
useRef: function useRef(e) {
getCurrentIdentity();
var r = (T = createWorkInProgressHook()).memoizedState;
if (null === r) {
var t = {
current: e
};
T.memoizedState = t;
return t;
} else {
return r;
}
},
useCallback: function(a, b) {
return ya((function() {
return a;
}), b);
useState: function useState(e) {
return useReducer(basicStateReducer, e);
},
useMutableSource: function(a, b) {
P();
return b(a._source);
useCallback: function useCallback(e, r) {
return useMemo((function() {
return e;
}), r);
},
useTransition: function() {
return [ Ba, !1 ];
useMutableSource: function useMutableSource(e, r, t) {
getCurrentIdentity();
return r(e._source);
},
useDeferredValue: function(a) {
return a;
useTransition: function useTransition() {
return [ _ref$2, !1 ];
},
useOpaqueIdentifier: function() {
P();
(R = V()).memoizedState || (R.memoizedState = "R:" + (N.current.uniqueID++).toString(36));
return R.memoizedState;
useDeferredValue: function useDeferredValue(e) {
return e;
},
useLayoutEffect: W,
useImperativeHandle: W,
useEffect: W,
useDebugValue: W
useOpaqueIdentifier: useOpaqueIdentifier,
useId: useOpaqueIdentifier,
unstable_useId: useOpaqueIdentifier,
unstable_useOpaqueIdentifier: useOpaqueIdentifier,
useLayoutEffect: noop,
useImperativeHandle: noop,
useEffect: noop,
useDebugValue: noop
};
function Da(a) {
var b = a._payload || a;
if (0 === b._status) {
return b._result;
var resolve = function(e) {
var r = e._payload || e;
if (0 === r._status) {
return r._result;
} else if (1 === r._status) {
return Promise.resolve(r._result);
} else if (2 === r._status) {
return Promise.reject(r._result);
}
if (1 === b._status) {
return Promise.resolve(b._result);
}
if (2 === b._status) {
return Promise.reject(b._result);
}
b._status = 0;
return b._result = (b._ctor || b._result)().then((function(a) {
b._result = a;
"function" == typeof a ? b._status = 1 : null !== a && "object" == typeof a && "function" == typeof a.default ? (b._result = a.default,
b._status = 1) : b._status = 2;
})).catch((function(a) {
b._status = 2;
b._result = a;
return Promise.reject(a);
r._status = 0;
return r._result = (r._ctor || r._result)().then((function(e) {
r._result = e;
if ("function" == typeof e) {
r._status = 1;
} else if (null !== e && "object" == typeof e && "function" == typeof e.default) {
r._result = e.default;
r._status = 1;
} else {
r._status = 2;
}
})).catch((function(e) {
r._status = 2;
r._result = e;
return Promise.reject(e);
}));
}
};
function Ea(a, b) {
return 1 === (a = a._payload || a)._status ? createElement(a._result, b) : null;
}
var render$3 = function(e, r, n) {
var u = e._payload || e;
if (1 === u._status) {
return t(u._result, r);
}
return null;
};
function Fa(a, b, d) {
var makeFrame$1 = function(e, r, t) {
return {
contextMap: f({}, G),
contextStore: new Map(F),
id: P(),
hook: Q,
contextMap: getCurrentContextMap(),
contextStore: getCurrentContextStore(),
id: getCurrentIdentity(),
hook: H,
kind: "frame.hooks",
errorFrame: M,
thenable: d,
props: b,
type: a
errorFrame: getCurrentErrorFrame(),
thenable: t,
props: r,
type: e
};
}
};
function Ga(a, b, d) {
var render$2 = function(e, r, t) {
try {
var c = E(b, a.defaultProps), e = ra(a);
R = null;
for (var g = a(c, e); 25 > U && S; ) {
S = !1, U += 1, R = null, g = a(c, e);
return function renderWithHooks(e, r, t) {
T = null;
var n = e(r, t);
while (A < 25 && U) {
U = !1;
A += 1;
T = null;
n = e(r, t);
}
A = 0;
$ = null;
T = null;
return n;
}(e, computeProps(r, e.defaultProps), maskContext(e));
} catch (n) {
if ("function" != typeof n.then) {
throw n;
}
U = 0;
R = T = null;
return g;
} catch (p) {
if ("function" != typeof p.then) {
throw p;
}
d.push(Fa(a, b, p));
t.push(makeFrame$1(e, r, n));
return null;
}
}
};
function Ha() {
function _ref$1() {
return !1;
}
function Ia() {
function _ref2() {
return null;
}
function Y(a, b, d) {
var createInstance = function(e, r) {
var t = {
_thrown: 0,
queue: n = [],
isMounted: _ref$1,
enqueueForceUpdate: _ref2,
enqueueReplaceState: function(e, r) {
if (e._isMounted) {
n.length = 0;
n.push(r);
}
},
enqueueSetState: function(e, r) {
if (e._isMounted) {
n.push(r);
}
}
};
var n;
var u = computeProps(r, e.defaultProps);
var o = maskContext(e);
var a = new e(u, o, t);
a.props = u;
a.context = o;
a.updater = t;
a._isMounted = !0;
if (void 0 === a.state) {
a.state = null;
}
if ("function" == typeof a.componentDidCatch || "function" == typeof e.getDerivedStateFromError) {
var i = makeFrame(e, a, null);
i.errorFrame = i;
setCurrentErrorFrame(i);
}
if ("function" == typeof e.getDerivedStateFromProps) {
var c = (0, e.getDerivedStateFromProps)(a.props, a.state);
if (null != c) {
a.state = _extends({}, a.state, c);
}
} else if ("function" == typeof a.componentWillMount) {
a.componentWillMount();
} else if ("function" == typeof a.UNSAFE_componentWillMount) {
a.UNSAFE_componentWillMount();
}
return a;
};
var makeFrame = function(e, r, t) {
return {
contextMap: f({}, G),
contextStore: new Map(F),
errorFrame: M,
thenable: d,
contextMap: getCurrentContextMap(),
contextStore: getCurrentContextStore(),
errorFrame: getCurrentErrorFrame(),
thenable: t,
kind: "frame.class",
error: null,
instance: b,
type: a
instance: r,
type: e
};
}
};
function Ka(a, b, d) {
var c = b.updater.queue;
if (0 < c.length) {
for (var e = f({}, b.state), g = 0, p = c.length; g < p; g++) {
var m = c[g];
null !== (m = "function" == typeof m ? m.call(b, e, b.props, b.context) : m) && f(e, m);
var render$1 = function(e, r, t) {
!function(e) {
var r = e.updater.queue;
if (r.length > 0) {
var t = _extends({}, e.state);
for (var n = 0, u = r.length; n < u; n++) {
var o = r[n];
var a = "function" == typeof o ? o.call(e, t, e.props, e.context) : o;
if (null !== a) {
_extends(t, a);
}
}
e.state = t;
r.length = 0;
}
b.state = e;
c.length = 0;
}
c = null;
}(r);
var n = null;
try {
c = b.render();
} catch (y) {
if ("function" != typeof y.then) {
throw y;
n = r.render();
} catch (n) {
if ("function" != typeof n.then) {
throw n;
}
d.push(Y(a, b, y));
t.push(makeFrame(e, r, n));
return null;
}
if (void 0 !== a.childContextTypes && "function" == typeof b.getChildContext && (null !== (a = b.getChildContext()) && "object" == typeof a)) {
H = {};
for (var w in a) {
H[w] = G[w], G[w] = a[w];
if (void 0 !== e.childContextTypes && "function" == typeof r.getChildContext) {
var u = r.getChildContext();
if (null !== u && "object" == typeof u) {
!function(e) {
D = {};
for (var r in e) {
D[r] = C[r];
C[r] = e[r];
}
}(u);
}
}
if ("function" != typeof b.getDerivedStateFromProps && ("function" == typeof b.componentWillMount || "function" == typeof b.UNSAFE_componentWillMount) && "function" == typeof b.componentWillUnmount) {
if ("function" != typeof r.getDerivedStateFromProps && ("function" == typeof r.componentWillMount || "function" == typeof r.UNSAFE_componentWillMount) && "function" == typeof r.componentWillUnmount) {
try {
b.componentWillUnmount();
} catch (y) {}
r.componentWillUnmount();
} catch (e) {}
}
b._isMounted = !1;
return c;
}
r._isMounted = !1;
return n;
};
var Z = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher, La = "function" == typeof setImmediate;
var L = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;
function Ma(a, b, d) {
switch (function la(a) {
switch (a.$$typeof) {
case ka:
return ka;
var V = "function" == typeof setImmediate;
case n:
switch (a.type) {
var render = function(e, r, t, n, u) {
return (o = e).prototype && o.prototype.isReactComponent ? function(e, r, t, n, u) {
setCurrentIdentity(null);
var o = createInstance(e, r);
var a = n(u, o);
if (a) {
t.push(makeFrame(e, o, a));
return null;
}
return render$1(e, o, t);
}(e, r, t, n, u) : function(e, r, t, n, u) {
setFirstHook(null);
setCurrentIdentity({});
var o = n(u);
if (o) {
t.push(makeFrame$1(e, r, o));
return null;
}
return render$2(e, r, t);
}(e, r, t, n, u);
var o;
};
var visitElement = function(e, r, n) {
switch (function(e) {
switch (e.$$typeof) {
case y:
return y;
case h:
switch (e.type) {
case g:
return g;
case _:
return _;
case x:
return x;
case q:
return q;
case S:
return S;
case t:
return t;
case w:
return w;
case r:
return r;
case A:
return A;
default:
switch (a.type && a.type.$$typeof) {
case C:
return C;
switch (e.type && e.type.$$typeof) {
case I:
return I;
case B:
return B;
case F:
return F;
case v:
return v;
case M:
return M;
case u:
return u;
case b:
return b;
case z:
return z;
case k:
return k;
default:
return n;
return h;
}
}
default:
return;
}
}(a)) {
case A:
case r:
}(e)) {
case w:
case S:
case g:
case x:
case t:
case q:
return D(a.props.children);
case _:
return getChildrenArray(e.props.children);
case u:
var c = a.props;
b = c.children;
c = c.value;
I = [ a = a.type._context, F.get(a) ];
F.set(a, c);
return D(b);
case b:
var u = e.props;
var o = u.children;
!function(e, r) {
P = [ e, E.get(e) ];
E.set(e, r);
}(e.type._context, u.value);
return getChildrenArray(o);
case v:
return "function" == typeof (b = a.props.children) ? D(b(a = L("object" == typeof (a = a.type)._context ? a._context : a))) : [];
case M:
var a = e.props.children;
if ("function" == typeof a) {
var i = e.type;
var c = readContextValue("object" == typeof i._context ? i._context : i);
return getChildrenArray(a(c));
} else {
return [];
}
case C:
return c = a.type, a = a.props, 0 >= (c._payload || c)._status ? (b.push({
kind: "frame.lazy",
contextMap: f({}, G),
contextStore: new Map(F),
errorFrame: M,
thenable: Da(c),
props: a,
type: c
}), a = null) : a = Ea(c, a), D(a);
case I:
var l = function(e, r, t) {
if ((e._payload || e)._status <= 0) {
t.push({
kind: "frame.lazy",
contextMap: getCurrentContextMap(),
contextStore: getCurrentContextStore(),
errorFrame: getCurrentErrorFrame(),
thenable: resolve(e),
props: r,
type: e
});
return null;
}
return render$3(e, r);
}(e.type, e.props, r);
return getChildrenArray(l);
case B:
return D(a = createElement(a.type.type, a.props));
case F:
var f = t(e.type.type, e.props);
return getChildrenArray(f);
case z:
return b = (c = a.type).render, a = E(a.props, c.defaultProps), D(a = createElement(b, a));
case k:
var s = e.type;
var v = s.render;
var p = computeProps(e.props, s.defaultProps);
var d = t(v, p);
return getChildrenArray(d);
case n:
if ("string" == typeof a.type) {
return D(a.props.children);
}
var e = a.props;
if ((c = a.type).prototype && c.prototype.isReactComponent) {
O = null;
var g = function Ja() {
var a = [];
return {
_thrown: 0,
queue: a,
isMounted: Ha,
enqueueForceUpdate: Ia,
enqueueReplaceState: function(b, d) {
b._isMounted && (a.length = 0, a.push(d));
},
enqueueSetState: function(b, d) {
b._isMounted && a.push(d);
}
};
}(), p = E(e, c.defaultProps), m = ra(c);
(e = new c(p, m, g)).props = p;
e.context = m;
e.updater = g;
e._isMounted = !0;
void 0 === e.state && (e.state = null);
if ("function" == typeof e.componentDidCatch || "function" == typeof c.getDerivedStateFromError) {
g = Y(c, e, null), M = (g.errorFrame = g) || null;
}
"function" == typeof c.getDerivedStateFromProps ? null != (g = (g = c.getDerivedStateFromProps)(e.props, e.state)) && (e.state = f({}, e.state, g)) : "function" == typeof e.componentWillMount ? e.componentWillMount() : "function" == typeof e.UNSAFE_componentWillMount && e.UNSAFE_componentWillMount();
(a = d(a, e)) ? (b.push(Y(c, e, a)), a = null) : a = Ka(c, e, b);
case h:
if ("string" == typeof e.type) {
return getChildrenArray(e.props.children);
} else {
Q = null, O = {}, (a = d(a)) ? (b.push(Fa(c, e, a)), a = null) : a = Ga(c, e, b);
var m = render(e.type, e.props, r, n, e);
return getChildrenArray(m);
}
return D(a);

@@ -487,24 +724,24 @@ default:

}
}
};
function Na(a, b, d, c, e, g) {
var p = Z.current, m = Date.now();
var visitLoop = function(e, r, t, n, u, o) {
var a = L.current;
var i = Date.now();
try {
for (Z.current = Ca; 0 < a.length; ) {
var w = a[a.length - 1].shift();
if (void 0 !== w) {
var y = Ma(w, e, g);
a.push(y);
b.push(oa());
d.push(pa());
c.push(M);
L.current = N;
while (e.length > 0) {
var c = e[e.length - 1].shift();
if (void 0 !== c) {
var l = visitElement(c, u, o);
e.push(l);
r.push(flushPrevContextMap());
t.push(flushPrevContextStore());
n.push(getCurrentErrorFrame());
} else {
a.pop();
var za = b.pop();
void 0 !== za && f(G, za);
var X = d.pop();
void 0 !== X && F.set(X[0], X[1]);
M = c.pop() || null;
e.pop();
restoreContextMap(r.pop());
restoreContextStore(t.pop());
setCurrentErrorFrame(n.pop());
}
if (La && 5 < Date.now() - m) {
if (V && Date.now() - i > 5) {
return !0;

@@ -514,117 +751,157 @@ }

return !1;
} catch (Aa) {
if (!(a = M)) {
throw Aa;
} catch (e) {
var f = getCurrentErrorFrame();
if (!f) {
throw e;
}
a.error = Aa;
e.unshift(a);
f.error = e;
u.unshift(f);
return !1;
} finally {
Z.current = p;
L.current = a;
}
}
};
function Oa(a, b, d, c) {
var makeYieldFrame = function(e, r, t, n) {
return {
contextMap: f({}, G),
contextStore: new Map(F),
errorFrame: M,
contextMap: getCurrentContextMap(),
contextStore: getCurrentContextStore(),
errorFrame: getCurrentErrorFrame(),
thenable: null,
kind: "frame.yield",
traversalChildren: a,
traversalMap: b,
traversalStore: d,
traversalErrorFrame: c
traversalChildren: e,
traversalMap: r,
traversalStore: t,
traversalErrorFrame: n
};
}
};
function Pa(a, b, d) {
a = [ a ];
var c = [ oa() ], e = [ pa() ], g = [ M ];
Na(a, c, e, g, b, d) && b.unshift(Oa(a, c, e, g));
}
var visit = function(e, r, t) {
var n = [ e ];
var u = [ flushPrevContextMap() ];
var o = [ flushPrevContextStore() ];
var a = [ getCurrentErrorFrame() ];
if (visitLoop(n, u, o, a, r, t)) {
r.unshift(makeYieldFrame(n, u, o, a));
}
};
function Qa(a, b, d) {
if ("frame.yield" === a.kind) {
O = null, J(a.contextMap), K(a.contextStore), M = a.errorFrame || null, Na(a.traversalChildren, a.traversalMap, a.traversalStore, a.traversalErrorFrame, b, d) && b.unshift(Oa(a.traversalChildren, a.traversalMap, a.traversalStore, a.traversalErrorFrame));
var update = function(e, r, t) {
if ("frame.yield" === e.kind) {
setCurrentIdentity(null);
setCurrentContextMap(e.contextMap);
setCurrentContextStore(e.contextStore);
setCurrentErrorFrame(e.errorFrame);
if (visitLoop(e.traversalChildren, e.traversalMap, e.traversalStore, e.traversalErrorFrame, r, t)) {
r.unshift(makeYieldFrame(e.traversalChildren, e.traversalMap, e.traversalStore, e.traversalErrorFrame));
}
} else {
var c = Z.current, e = null;
Z.current = Ca;
var n = L.current;
var u = null;
L.current = N;
try {
if ("frame.class" === a.kind) {
a: {
O = null;
J(a.contextMap);
K(a.contextStore);
M = a.errorFrame || null;
if (a.error) {
if (25 <= ++a.instance.updater._thrown) {
e = null;
break a;
if ("frame.class" === e.kind) {
u = function(e, r) {
setCurrentIdentity(null);
setCurrentContextMap(r.contextMap);
setCurrentContextStore(r.contextStore);
setCurrentErrorFrame(r.errorFrame);
if (r.error) {
if (++r.instance.updater._thrown >= 25) {
return null;
}
a.instance._isMounted = !0;
"function" == typeof a.instance.componentDidCatch && a.instance.componentDidCatch(a.error);
"function" == typeof a.type.getDerivedStateFromError && a.instance.updater.enqueueSetState(a.instance, a.type.getDerivedStateFromError(a.error));
r.instance._isMounted = !0;
if ("function" == typeof r.instance.componentDidCatch) {
r.instance.componentDidCatch(r.error);
}
if ("function" == typeof r.type.getDerivedStateFromError) {
r.instance.updater.enqueueSetState(r.instance, r.type.getDerivedStateFromError(r.error));
}
}
e = Ka(a.type, a.instance, b);
}
} else {
"frame.hooks" === a.kind ? (Q = a.hook, O = a.id, J(a.contextMap), K(a.contextStore),
M = a.errorFrame || null, e = Ga(a.type, a.props, b)) : "frame.lazy" === a.kind && (O = null,
J(a.contextMap), K(a.contextStore), M = a.errorFrame || null, e = Ea(a.type, a.props));
return render$1(r.type, r.instance, e);
}(r, e);
} else if ("frame.hooks" === e.kind) {
u = function(e, r) {
setFirstHook(r.hook);
setCurrentIdentity(r.id);
setCurrentContextMap(r.contextMap);
setCurrentContextStore(r.contextStore);
setCurrentErrorFrame(r.errorFrame);
return render$2(r.type, r.props, e);
}(r, e);
} else if ("frame.lazy" === e.kind) {
u = function(e, r) {
setCurrentIdentity(null);
setCurrentContextMap(r.contextMap);
setCurrentContextStore(r.contextStore);
setCurrentErrorFrame(r.errorFrame);
return render$3(r.type, r.props);
}(0, e);
}
} catch (g) {
if (!(a = M)) {
throw g;
} catch (e) {
var o = getCurrentErrorFrame();
if (!o) {
throw e;
}
a.error = g;
b.unshift(a);
e = null;
o.error = e;
r.unshift(o);
u = null;
} finally {
Z.current = c;
L.current = n;
}
Pa(D(e), b, d);
visit(getChildrenArray(u), r, t);
}
}
};
function Ra(a) {
setImmediate(a);
function _ref(e, r) {
setImmediate(e);
}
function Sa(a, b, d) {
var c = a.shift();
if (!c) {
var flushFrames = function(e, r, t) {
var n = e.shift();
if (!n) {
return Promise.resolve();
}
La && "frame.yield" === c.kind && (c.thenable = new Promise(Ra));
return Promise.resolve(c.thenable).then((function() {
N.current = d;
Qa(c, a, b);
return Sa(a, b, d);
}), (function(d) {
if (!c.errorFrame) {
throw d;
if (V && "frame.yield" === n.kind) {
n.thenable = new Promise(_ref);
}
return Promise.resolve(n.thenable).then((function() {
!function(e) {
O.current = e;
}(t);
update(n, e, r);
return flushFrames(e, r, t);
}), (function(t) {
if (!n.errorFrame) {
throw t;
}
c.errorFrame.error = d;
Qa(c.errorFrame, a, b);
n.errorFrame.error = t;
update(n.errorFrame, e, r);
}));
}
};
function Ta() {}
var defaultVisitor = function() {
return;
};
export default function(a, b) {
b || (b = Ta);
var d = [], c = N.current = {
var renderPrepass = function(e, r) {
if (!r) {
r = defaultVisitor;
}
var t = [];
var n = O.current = {
uniqueID: 0
};
J({});
K(new Map);
M = null;
setCurrentContextMap({});
setCurrentContextStore(new Map);
setCurrentErrorFrame(null);
try {
Pa(D(a), d, b);
visit(getChildrenArray(e), t, r);
} catch (e) {
return Promise.reject(e);
}
return Sa(d, b, c);
}
return flushFrames(t, r, n);
};
export { renderPrepass as default };
//# sourceMappingURL=react-ssr-prepass.es.js.map
"use strict";
var React = require("react");
var e = require("react");
var React__default = function _interopDefaultLegacy(a) {
return a && "object" == typeof a && "default" in a ? a : {
default: a
function _interopDefaultLegacy(e) {
return e && "object" == typeof e && "default" in e ? e : {
default: e
};
}(React);
}
var r = _interopDefaultLegacy(e);
function _extends() {
return (_extends = Object.assign || function(a) {
for (var b = 1; b < arguments.length; b++) {
var d, c = arguments[b];
for (d in c) {
Object.prototype.hasOwnProperty.call(c, d) && (a[d] = c[d]);
_extends = Object.assign || function(e) {
for (var r = 1; r < arguments.length; r++) {
var t = arguments[r];
for (var n in t) {
if (Object.prototype.hasOwnProperty.call(t, n)) {
e[n] = t[n];
}
}
}
return a;
}).apply(this, arguments);
return e;
};
return _extends.apply(this, arguments);
}
var Element = 60103, Portal = 60106, Fragment = 60107, StrictMode = 60108, Profiler = 60114, ContextProvider = 60109, ContextConsumer = 60110, ConcurrentMode = 60111, ForwardRef = 60112, Suspense = 60113, Memo = 60115, Lazy = 60116;
var t = 60103;
var n = 60106;
var u = 60107;
var o = 60108;
var a = 60114;
var i = 60109;
var c = 60110;
var l = 60111;
var f = 60112;
var s = 60113;
var v = 60115;
var p = 60116;
if ("function" == typeof Symbol && Symbol.for) {
var symbolFor = Symbol.for;
Element = symbolFor("react.element");
Portal = symbolFor("react.portal");
Fragment = symbolFor("react.fragment");
StrictMode = symbolFor("react.strict_mode");
Profiler = symbolFor("react.profiler");
ContextProvider = symbolFor("react.provider");
ContextConsumer = symbolFor("react.context");
ConcurrentMode = Symbol.for("react.concurrent_mode");
ForwardRef = symbolFor("react.forward_ref");
Suspense = symbolFor("react.suspense");
Memo = symbolFor("react.memo");
Lazy = symbolFor("react.lazy");
var d = Symbol.for;
t = d("react.element");
n = d("react.portal");
u = d("react.fragment");
o = d("react.strict_mode");
a = d("react.profiler");
i = d("react.provider");
c = d("react.context");
l = Symbol.for("react.concurrent_mode");
f = d("react.forward_ref");
s = d("react.suspense");
v = d("react.memo");
p = d("react.lazy");
}
var REACT_ELEMENT_TYPE = Element, REACT_PORTAL_TYPE = Portal, REACT_FRAGMENT_TYPE = Fragment, REACT_STRICT_MODE_TYPE = StrictMode, REACT_PROFILER_TYPE = Profiler, REACT_PROVIDER_TYPE = ContextProvider, REACT_CONTEXT_TYPE = ContextConsumer, REACT_CONCURRENT_MODE_TYPE = ConcurrentMode, REACT_FORWARD_REF_TYPE = ForwardRef, REACT_SUSPENSE_TYPE = Suspense, REACT_MEMO_TYPE = Memo, REACT_LAZY_TYPE = Lazy, toArray = React.Children.toArray, isAbstractElement = function(a) {
return null !== a && "object" == typeof a;
}, getChildrenArray = function(a) {
return toArray(a).filter(isAbstractElement);
}, computeProps = function(a, b) {
return "object" == typeof b ? _extends({}, b, a) : a;
}, currentContextStore = new Map, currentContextMap = {}, prevContextMap = void 0, prevContextEntry = void 0, getCurrentContextMap = function() {
return _extends({}, currentContextMap);
}, getCurrentContextStore = function() {
return new Map(currentContextStore);
}, flushPrevContextMap = function() {
var a = prevContextMap;
prevContextMap = void 0;
return a;
}, flushPrevContextStore = function() {
var a = prevContextEntry;
prevContextEntry = void 0;
return a;
}, restoreContextMap = function(a) {
void 0 !== a && _extends(currentContextMap, a);
}, restoreContextStore = function(a) {
void 0 !== a && currentContextStore.set(a[0], a[1]);
}, setCurrentContextMap = function(a) {
prevContextMap = void 0;
currentContextMap = a;
}, setCurrentContextStore = function(a) {
prevContextEntry = void 0;
currentContextStore = a;
}, readContextValue = function(a) {
var b = currentContextStore.get(a);
return void 0 !== b ? b : a._currentValue;
}, emptyContext = {}, maskContext = function(a) {
var b = a.contextType;
a = a.contextTypes;
if (b) {
return readContextValue(b);
var m = t;
var h = n;
var y = u;
var _ = o;
var S = a;
var x = i;
var b = c;
var g = l;
var M = f;
var k = s;
var w = v;
var F = p;
var E = e.Children.toArray;
var isAbstractElement = function(e) {
return null !== e && "object" == typeof e;
};
var getChildrenArray = function(e) {
return E(e).filter(isAbstractElement);
};
var computeProps = function(e, r) {
return "object" == typeof r ? _extends({}, r, e) : e;
};
var I = new Map;
var q = {};
var D = void 0;
var C = void 0;
var getCurrentContextMap = function() {
return _extends({}, q);
};
var getCurrentContextStore = function() {
return new Map(I);
};
var flushPrevContextMap = function() {
var e = D;
D = void 0;
return e;
};
var flushPrevContextStore = function() {
var e = C;
C = void 0;
return e;
};
var restoreContextMap = function(e) {
if (void 0 !== e) {
_extends(q, e);
}
if (!a) {
return emptyContext;
};
var restoreContextStore = function(e) {
if (void 0 !== e) {
I.set(e[0], e[1]);
}
b = {};
for (var c in a) {
b[c] = currentContextMap[c];
};
var setCurrentContextMap = function(e) {
D = void 0;
q = e;
};
var setCurrentContextStore = function(e) {
C = void 0;
I = e;
};
var readContextValue = function(e) {
var r = I.get(e);
if (void 0 !== r) {
return r;
}
return b;
}, currentErrorFrame = null, getCurrentErrorFrame = function() {
return currentErrorFrame;
}, setCurrentErrorFrame = function(a) {
currentErrorFrame = a || null;
}, rendererStateRef = {
return e._currentValue;
};
var P = {};
var maskContext = function(e) {
var r = e.contextType;
var t = e.contextTypes;
if (r) {
return readContextValue(r);
} else if (!t) {
return P;
}
var n = {};
for (var u in t) {
n[u] = q[u];
}
return n;
};
var R = null;
var getCurrentErrorFrame = function() {
return R;
};
var setCurrentErrorFrame = function(e) {
R = e || null;
};
var z = {
current: {

@@ -96,84 +197,142 @@ uniqueID: 0

var objectIs = "function" == typeof Object.is ? Object.is : function is(a, b) {
return a === b && (0 !== a || 1 / a == 1 / b) || a != a && b != b;
}, currentIdentity = null, setCurrentIdentity = function(a) {
currentIdentity = a;
}, getCurrentIdentity = function() {
if (null === currentIdentity) {
throw Error("[react-ssr-prepass] Hooks can only be called inside the body of a function component. (https://fb.me/react-invalid-hook-call)");
var O = "function" == typeof Object.is ? Object.is : function is(e, r) {
return e === r && (0 !== e || 1 / e == 1 / r) || e != e && r != r;
};
var W = null;
var setCurrentIdentity = function(e) {
W = e;
};
var getCurrentIdentity = function() {
if (null === W) {
throw new Error("[react-ssr-prepass] Hooks can only be called inside the body of a function component. (https://fb.me/react-invalid-hook-call)");
}
return currentIdentity;
}, firstWorkInProgressHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, renderPhaseUpdates = null, numberOfReRenders = 0, setFirstHook = function(a) {
firstWorkInProgressHook = a;
return W;
};
var j = null;
var H = null;
var T = !1;
var U = null;
var $ = 0;
var setFirstHook = function(e) {
j = e;
};
function createWorkInProgressHook() {
return null === workInProgressHook ? null === firstWorkInProgressHook ? firstWorkInProgressHook = workInProgressHook = {
memoizedState: null,
queue: null,
next: null
} : workInProgressHook = firstWorkInProgressHook : null === workInProgressHook.next ? workInProgressHook = workInProgressHook.next = {
memoizedState: null,
queue: null,
next: null
} : workInProgressHook = workInProgressHook.next;
if (null === H) {
if (null === j) {
return j = H = {
memoizedState: null,
queue: null,
next: null
};
} else {
return H = j;
}
} else if (null === H.next) {
return H = H.next = {
memoizedState: null,
queue: null,
next: null
};
} else {
return H = H.next;
}
}
function basicStateReducer(a, b) {
return "function" == typeof b ? b(a) : b;
function basicStateReducer(e, r) {
return "function" == typeof r ? r(e) : r;
}
function useReducer(a, b, c) {
var d = getCurrentIdentity();
null === (workInProgressHook = createWorkInProgressHook()).queue && (b = a === basicStateReducer ? "function" == typeof b ? b() : b : void 0 !== c ? c(b) : b,
workInProgressHook.memoizedState = b);
d = (b = workInProgressHook.queue || (workInProgressHook.queue = {
function useReducer(e, r, t) {
var n = getCurrentIdentity();
if (null === (H = createWorkInProgressHook()).queue) {
var u;
if (e === basicStateReducer) {
u = "function" == typeof r ? r() : r;
} else {
u = void 0 !== t ? t(r) : r;
}
H.memoizedState = u;
}
var o = H.queue || (H.queue = {
last: null,
dispatch: null
})).dispatch || (b.dispatch = dispatchAction.bind(null, d, b));
if (null !== renderPhaseUpdates && void 0 !== (c = renderPhaseUpdates.get(b))) {
renderPhaseUpdates.delete(b);
b = workInProgressHook.memoizedState;
do {
b = a(b, c.action), c = c.next;
} while (null !== c);
workInProgressHook.memoizedState = b;
});
var a = o.dispatch || (o.dispatch = dispatchAction.bind(null, n, o));
if (null !== U) {
var i = U.get(o);
if (void 0 !== i) {
U.delete(o);
var c = H.memoizedState;
var l = i;
do {
c = e(c, l.action);
l = l.next;
} while (null !== l);
H.memoizedState = c;
}
}
return [ workInProgressHook.memoizedState, d ];
return [ H.memoizedState, a ];
}
function useMemo(a, b) {
function useMemo(e, r) {
getCurrentIdentity();
b = void 0 === b ? null : b;
var c = (workInProgressHook = createWorkInProgressHook()).memoizedState;
if (null !== c && null !== b && function areHookInputsEqual(a, b) {
if (null === b) {
return !1;
}
for (var c = 0; c < b.length && c < a.length; c++) {
if (!objectIs(a[c], b[c])) {
var t = void 0 === r ? null : r;
var n = (H = createWorkInProgressHook()).memoizedState;
if (null !== n && null !== t) {
if (function areHookInputsEqual(e, r) {
if (null === r) {
return !1;
}
for (var t = 0; t < r.length && t < e.length; t++) {
if (!O(e[t], r[t])) {
return !1;
}
}
return !0;
}(t, n[1])) {
return n[0];
}
return !0;
}(b, c[1])) {
return c[0];
}
a = a();
workInProgressHook.memoizedState = [ a, b ];
return a;
var u = e();
H.memoizedState = [ u, t ];
return u;
}
function dispatchAction(a, b, c) {
if (a === currentIdentity) {
if (didScheduleRenderPhaseUpdate = !0, a = {
action: c,
function useOpaqueIdentifier() {
getCurrentIdentity();
if (!(H = createWorkInProgressHook()).memoizedState) {
H.memoizedState = "R:" + (z.current.uniqueID++).toString(36);
}
return H.memoizedState;
}
function dispatchAction(e, r, t) {
if (e === W) {
T = !0;
var n = {
action: t,
next: null
}, null === renderPhaseUpdates && (renderPhaseUpdates = new Map), void 0 === (c = renderPhaseUpdates.get(b))) {
renderPhaseUpdates.set(b, a);
};
if (null === U) {
U = new Map;
}
var u = U.get(r);
if (void 0 === u) {
U.set(r, n);
} else {
for (b = c; null !== b.next; ) {
b = b.next;
var o = u;
while (null !== o.next) {
o = o.next;
}
b.next = a;
o.next = n;
}

@@ -185,34 +344,43 @@ }

function _ref$2(a) {
a();
function _ref$2(e) {
e();
}
var Dispatcher = {
readContext: function readContext(a, b) {
return readContextValue(a);
var A = {
readContext: function readContext(e, r) {
return readContextValue(e);
},
useContext: function useContext(a, b) {
useSyncExternalStore: function useSyncExternalStore(e, r, t) {
return r();
},
useContext: function useContext(e, r) {
getCurrentIdentity();
return readContextValue(a);
return readContextValue(e);
},
useMemo: useMemo,
useReducer: useReducer,
useRef: function useRef(a) {
useRef: function useRef(e) {
getCurrentIdentity();
var b = (workInProgressHook = createWorkInProgressHook()).memoizedState;
return null === b ? workInProgressHook.memoizedState = a = {
current: a
} : b;
var r = (H = createWorkInProgressHook()).memoizedState;
if (null === r) {
var t = {
current: e
};
H.memoizedState = t;
return t;
} else {
return r;
}
},
useState: function useState(a) {
return useReducer(basicStateReducer, a);
useState: function useState(e) {
return useReducer(basicStateReducer, e);
},
useCallback: function useCallback(a, b) {
useCallback: function useCallback(e, r) {
return useMemo((function() {
return a;
}), b);
return e;
}), r);
},
useMutableSource: function useMutableSource(a, b, c) {
useMutableSource: function useMutableSource(e, r, t) {
getCurrentIdentity();
return b(a._source);
return r(e._source);
},

@@ -222,10 +390,9 @@ useTransition: function useTransition() {

},
useDeferredValue: function useDeferredValue(a) {
return a;
useDeferredValue: function useDeferredValue(e) {
return e;
},
useOpaqueIdentifier: function useOpaqueIdentifier() {
getCurrentIdentity();
(workInProgressHook = createWorkInProgressHook()).memoizedState || (workInProgressHook.memoizedState = "R:" + (rendererStateRef.current.uniqueID++).toString(36));
return workInProgressHook.memoizedState;
},
useOpaqueIdentifier: useOpaqueIdentifier,
useId: useOpaqueIdentifier,
unstable_useId: useOpaqueIdentifier,
unstable_useOpaqueIdentifier: useOpaqueIdentifier,
useLayoutEffect: noop,

@@ -235,26 +402,40 @@ useImperativeHandle: noop,

useDebugValue: noop
}, resolve = function(a) {
var b = a._payload || a;
if (0 === b._status) {
return b._result;
};
var resolve = function(e) {
var r = e._payload || e;
if (0 === r._status) {
return r._result;
} else if (1 === r._status) {
return Promise.resolve(r._result);
} else if (2 === r._status) {
return Promise.reject(r._result);
}
if (1 === b._status) {
return Promise.resolve(b._result);
r._status = 0;
return r._result = (r._ctor || r._result)().then((function(e) {
r._result = e;
if ("function" == typeof e) {
r._status = 1;
} else if (null !== e && "object" == typeof e && "function" == typeof e.default) {
r._result = e.default;
r._status = 1;
} else {
r._status = 2;
}
})).catch((function(e) {
r._status = 2;
r._result = e;
return Promise.reject(e);
}));
};
var render$3 = function(r, t, n) {
var u = r._payload || r;
if (1 === u._status) {
return e.createElement(u._result, t);
}
if (2 === b._status) {
return Promise.reject(b._result);
}
b._status = 0;
return b._result = (b._ctor || b._result)().then((function(a) {
b._result = a;
"function" == typeof a ? b._status = 1 : null !== a && "object" == typeof a && "function" == typeof a.default ? (b._result = a.default,
b._status = 1) : b._status = 2;
})).catch((function(a) {
b._status = 2;
b._result = a;
return Promise.reject(a);
}));
}, render$3 = function(a, b, c) {
return 1 === (a = a._payload || a)._status ? React.createElement(a._result, b) : null;
}, makeFrame$1 = function(a, b, c) {
return null;
};
var makeFrame$1 = function(e, r, t) {
return {

@@ -264,26 +445,32 @@ contextMap: getCurrentContextMap(),

id: getCurrentIdentity(),
hook: firstWorkInProgressHook,
hook: j,
kind: "frame.hooks",
errorFrame: getCurrentErrorFrame(),
thenable: c,
props: b,
type: a
thenable: t,
props: r,
type: e
};
}, render$2 = function(a, b, c) {
};
var render$2 = function(e, r, t) {
try {
return function renderWithHooks(a, b, c) {
workInProgressHook = null;
for (var d = a(b, c); numberOfReRenders < 25 && didScheduleRenderPhaseUpdate; ) {
didScheduleRenderPhaseUpdate = !1, numberOfReRenders += 1, workInProgressHook = null,
d = a(b, c);
return function renderWithHooks(e, r, t) {
H = null;
var n = e(r, t);
while ($ < 25 && T) {
T = !1;
$ += 1;
H = null;
n = e(r, t);
}
numberOfReRenders = 0;
workInProgressHook = renderPhaseUpdates = null;
return d;
}(a, computeProps(b, a.defaultProps), maskContext(a));
} catch (d) {
if ("function" != typeof d.then) {
throw d;
$ = 0;
U = null;
H = null;
return n;
}(e, computeProps(r, e.defaultProps), maskContext(e));
} catch (n) {
if ("function" != typeof n.then) {
throw n;
}
c.push(makeFrame$1(a, b, d));
t.push(makeFrame$1(e, r, n));
return null;

@@ -301,29 +488,50 @@ }

var createInstance = function(a, b) {
var c = function() {
var a = [];
return {
_thrown: 0,
queue: a,
isMounted: _ref$1,
enqueueForceUpdate: _ref2,
enqueueReplaceState: function(b, c) {
b._isMounted && (a.length = 0, a.push(c));
},
enqueueSetState: function(b, c) {
b._isMounted && a.push(c);
var createInstance = function(e, r) {
var t = {
_thrown: 0,
queue: n = [],
isMounted: _ref$1,
enqueueForceUpdate: _ref2,
enqueueReplaceState: function(e, r) {
if (e._isMounted) {
n.length = 0;
n.push(r);
}
};
}(), d = computeProps(b, a.defaultProps), e = maskContext(a);
(b = new a(d, e, c)).props = d;
b.context = e;
b.updater = c;
b._isMounted = !0;
void 0 === b.state && (b.state = null);
if ("function" == typeof b.componentDidCatch || "function" == typeof a.getDerivedStateFromError) {
(c = makeFrame(a, b, null)).errorFrame = c, setCurrentErrorFrame(c);
},
enqueueSetState: function(e, r) {
if (e._isMounted) {
n.push(r);
}
}
};
var n;
var u = computeProps(r, e.defaultProps);
var o = maskContext(e);
var a = new e(u, o, t);
a.props = u;
a.context = o;
a.updater = t;
a._isMounted = !0;
if (void 0 === a.state) {
a.state = null;
}
"function" == typeof a.getDerivedStateFromProps ? null != (a = (a = a.getDerivedStateFromProps)(b.props, b.state)) && (b.state = _extends({}, b.state, a)) : "function" == typeof b.componentWillMount ? b.componentWillMount() : "function" == typeof b.UNSAFE_componentWillMount && b.UNSAFE_componentWillMount();
return b;
}, makeFrame = function(a, b, c) {
if ("function" == typeof a.componentDidCatch || "function" == typeof e.getDerivedStateFromError) {
var i = makeFrame(e, a, null);
i.errorFrame = i;
setCurrentErrorFrame(i);
}
if ("function" == typeof e.getDerivedStateFromProps) {
var c = (0, e.getDerivedStateFromProps)(a.props, a.state);
if (null != c) {
a.state = _extends({}, a.state, c);
}
} else if ("function" == typeof a.componentWillMount) {
a.componentWillMount();
} else if ("function" == typeof a.UNSAFE_componentWillMount) {
a.UNSAFE_componentWillMount();
}
return a;
};
var makeFrame = function(e, r, t) {
return {

@@ -333,143 +541,195 @@ contextMap: getCurrentContextMap(),

errorFrame: getCurrentErrorFrame(),
thenable: c,
thenable: t,
kind: "frame.class",
error: null,
instance: b,
type: a
instance: r,
type: e
};
}, render$1 = function(a, b, c) {
!function(a) {
var b = a.updater.queue;
if (0 < b.length) {
for (var c = _extends({}, a.state), d = 0, e = b.length; d < e; d++) {
var f = b[d];
null !== (f = "function" == typeof f ? f.call(a, c, a.props, a.context) : f) && _extends(c, f);
};
var render$1 = function(e, r, t) {
!function(e) {
var r = e.updater.queue;
if (r.length > 0) {
var t = _extends({}, e.state);
for (var n = 0, u = r.length; n < u; n++) {
var o = r[n];
var a = "function" == typeof o ? o.call(e, t, e.props, e.context) : o;
if (null !== a) {
_extends(t, a);
}
}
a.state = c;
b.length = 0;
e.state = t;
r.length = 0;
}
}(b);
var d = null;
}(r);
var n = null;
try {
d = b.render();
} catch (e) {
if ("function" != typeof e.then) {
throw e;
n = r.render();
} catch (n) {
if ("function" != typeof n.then) {
throw n;
}
c.push(makeFrame(a, b, e));
t.push(makeFrame(e, r, n));
return null;
}
void 0 !== a.childContextTypes && "function" == typeof b.getChildContext && (null !== (a = b.getChildContext()) && "object" == typeof a && function(a) {
prevContextMap = {};
for (var b in a) {
prevContextMap[b] = currentContextMap[b], currentContextMap[b] = a[b];
if (void 0 !== e.childContextTypes && "function" == typeof r.getChildContext) {
var u = r.getChildContext();
if (null !== u && "object" == typeof u) {
!function(e) {
D = {};
for (var r in e) {
D[r] = q[r];
q[r] = e[r];
}
}(u);
}
}(a));
if ("function" != typeof b.getDerivedStateFromProps && ("function" == typeof b.componentWillMount || "function" == typeof b.UNSAFE_componentWillMount) && "function" == typeof b.componentWillUnmount) {
}
if ("function" != typeof r.getDerivedStateFromProps && ("function" == typeof r.componentWillMount || "function" == typeof r.UNSAFE_componentWillMount) && "function" == typeof r.componentWillUnmount) {
try {
b.componentWillUnmount();
r.componentWillUnmount();
} catch (e) {}
}
b._isMounted = !1;
return d;
}, ReactCurrentDispatcher = React__default.default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher, SHOULD_YIELD = "function" == typeof setImmediate, render = function(a, b, c, d, e) {
return function(a) {
return a.prototype && a.prototype.isReactComponent;
}(a) ? function(a, b, c, d, e) {
r._isMounted = !1;
return n;
};
var L = r.default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;
var N = "function" == typeof setImmediate;
var render = function(e, r, t, n, u) {
return (o = e).prototype && o.prototype.isReactComponent ? function(e, r, t, n, u) {
setCurrentIdentity(null);
return (d = d(e, b = createInstance(a, b))) ? (c.push(makeFrame(a, b, d)), null) : render$1(a, b, c);
}(a, b, c, d, e) : function(a, b, c, d, e) {
var o = createInstance(e, r);
var a = n(u, o);
if (a) {
t.push(makeFrame(e, o, a));
return null;
}
return render$1(e, o, t);
}(e, r, t, n, u) : function(e, r, t, n, u) {
setFirstHook(null);
setCurrentIdentity({});
return (d = d(e)) ? (c.push(makeFrame$1(a, b, d)), null) : render$2(a, b, c);
}(a, b, c, d, e);
}, visitElement = function(a, b, c) {
switch (function(a) {
switch (a.$$typeof) {
case REACT_PORTAL_TYPE:
return REACT_PORTAL_TYPE;
var o = n(u);
if (o) {
t.push(makeFrame$1(e, r, o));
return null;
}
return render$2(e, r, t);
}(e, r, t, n, u);
var o;
};
case REACT_ELEMENT_TYPE:
switch (a.type) {
case REACT_CONCURRENT_MODE_TYPE:
return REACT_CONCURRENT_MODE_TYPE;
var visitElement = function(r, t, n) {
switch (function(e) {
switch (e.$$typeof) {
case h:
return h;
case REACT_FRAGMENT_TYPE:
return REACT_FRAGMENT_TYPE;
case m:
switch (e.type) {
case g:
return g;
case REACT_PROFILER_TYPE:
return REACT_PROFILER_TYPE;
case y:
return y;
case REACT_STRICT_MODE_TYPE:
return REACT_STRICT_MODE_TYPE;
case S:
return S;
case REACT_SUSPENSE_TYPE:
return REACT_SUSPENSE_TYPE;
case _:
return _;
case k:
return k;
default:
switch (a.type && a.type.$$typeof) {
case REACT_LAZY_TYPE:
return REACT_LAZY_TYPE;
switch (e.type && e.type.$$typeof) {
case F:
return F;
case REACT_MEMO_TYPE:
return REACT_MEMO_TYPE;
case w:
return w;
case REACT_CONTEXT_TYPE:
return REACT_CONTEXT_TYPE;
case b:
return b;
case REACT_PROVIDER_TYPE:
return REACT_PROVIDER_TYPE;
case x:
return x;
case REACT_FORWARD_REF_TYPE:
return REACT_FORWARD_REF_TYPE;
case M:
return M;
default:
return REACT_ELEMENT_TYPE;
return m;
}
}
default:
return;
}
}(a)) {
case REACT_SUSPENSE_TYPE:
case REACT_STRICT_MODE_TYPE:
case REACT_CONCURRENT_MODE_TYPE:
case REACT_PROFILER_TYPE:
case REACT_FRAGMENT_TYPE:
return getChildrenArray(a.props.children);
}(r)) {
case k:
case _:
case g:
case S:
case y:
return getChildrenArray(r.props.children);
case REACT_PROVIDER_TYPE:
return c = (b = a.props).children, function(a, b) {
prevContextEntry = [ a, currentContextStore.get(a) ];
currentContextStore.set(a, b);
}(a.type._context, b.value), getChildrenArray(c);
case x:
var u = r.props;
var o = u.children;
!function(e, r) {
C = [ e, I.get(e) ];
I.set(e, r);
}(r.type._context, u.value);
return getChildrenArray(o);
case REACT_CONTEXT_TYPE:
return "function" == typeof (b = a.props.children) ? (a = readContextValue("object" == typeof (a = a.type)._context ? a._context : a),
getChildrenArray(b(a))) : [];
case b:
var a = r.props.children;
if ("function" == typeof a) {
var i = r.type;
var c = readContextValue("object" == typeof i._context ? i._context : i);
return getChildrenArray(a(c));
} else {
return [];
}
case REACT_LAZY_TYPE:
return a = function(a, b, c) {
return 0 >= (a._payload || a)._status ? (c.push({
kind: "frame.lazy",
contextMap: getCurrentContextMap(),
contextStore: getCurrentContextStore(),
errorFrame: getCurrentErrorFrame(),
thenable: resolve(a),
props: b,
type: a
}), null) : render$3(a, b);
}(a.type, a.props, b), getChildrenArray(a);
case F:
var l = function(e, r, t) {
if ((e._payload || e)._status <= 0) {
t.push({
kind: "frame.lazy",
contextMap: getCurrentContextMap(),
contextStore: getCurrentContextStore(),
errorFrame: getCurrentErrorFrame(),
thenable: resolve(e),
props: r,
type: e
});
return null;
}
return render$3(e, r);
}(r.type, r.props, t);
return getChildrenArray(l);
case REACT_MEMO_TYPE:
return a = React.createElement(a.type.type, a.props), getChildrenArray(a);
case w:
var f = e.createElement(r.type.type, r.props);
return getChildrenArray(f);
case REACT_FORWARD_REF_TYPE:
return b = (c = a.type).render, a = computeProps(a.props, c.defaultProps), a = React.createElement(b, a),
getChildrenArray(a);
case M:
var s = r.type;
var v = s.render;
var p = computeProps(r.props, s.defaultProps);
var d = e.createElement(v, p);
return getChildrenArray(d);
case REACT_ELEMENT_TYPE:
if ("string" == typeof a.type) {
return getChildrenArray(a.props.children);
case m:
if ("string" == typeof r.type) {
return getChildrenArray(r.props.children);
} else {
var E = render(r.type, r.props, t, n, r);
return getChildrenArray(E);
}
a = render(a.type, a.props, b, c, a);
return getChildrenArray(a);

@@ -479,17 +739,24 @@ default:

}
}, visitLoop = function(a, b, c, d, e, f) {
var g = ReactCurrentDispatcher.current, m = Date.now();
};
var visitLoop = function(e, r, t, n, u, o) {
var a = L.current;
var i = Date.now();
try {
for (ReactCurrentDispatcher.current = Dispatcher; 0 < a.length; ) {
var k = a[a.length - 1].shift();
if (void 0 !== k) {
var n = visitElement(k, e, f);
a.push(n);
b.push(flushPrevContextMap());
c.push(flushPrevContextStore());
d.push(getCurrentErrorFrame());
L.current = A;
while (e.length > 0) {
var c = e[e.length - 1].shift();
if (void 0 !== c) {
var l = visitElement(c, u, o);
e.push(l);
r.push(flushPrevContextMap());
t.push(flushPrevContextStore());
n.push(getCurrentErrorFrame());
} else {
a.pop(), restoreContextMap(b.pop()), restoreContextStore(c.pop()), setCurrentErrorFrame(d.pop());
e.pop();
restoreContextMap(r.pop());
restoreContextStore(t.pop());
setCurrentErrorFrame(n.pop());
}
if (SHOULD_YIELD && Date.now() - m > 5) {
if (N && Date.now() - i > 5) {
return !0;

@@ -499,14 +766,16 @@ }

return !1;
} catch (l) {
var h = getCurrentErrorFrame();
if (!h) {
throw l;
} catch (e) {
var f = getCurrentErrorFrame();
if (!f) {
throw e;
}
h.error = l;
e.unshift(h);
f.error = e;
u.unshift(f);
return !1;
} finally {
ReactCurrentDispatcher.current = g;
L.current = a;
}
}, makeYieldFrame = function(a, b, c, d) {
};
var makeYieldFrame = function(e, r, t, n) {
return {

@@ -518,90 +787,123 @@ contextMap: getCurrentContextMap(),

kind: "frame.yield",
traversalChildren: a,
traversalMap: b,
traversalStore: c,
traversalErrorFrame: d
traversalChildren: e,
traversalMap: r,
traversalStore: t,
traversalErrorFrame: n
};
}, visit = function(a, b, c) {
a = [ a ];
var d = [ flushPrevContextMap() ], e = [ flushPrevContextStore() ], f = [ getCurrentErrorFrame() ];
visitLoop(a, d, e, f, b, c) && b.unshift(makeYieldFrame(a, d, e, f));
}, update = function(a, b, c) {
if ("frame.yield" === a.kind) {
setCurrentIdentity(null), setCurrentContextMap(a.contextMap), setCurrentContextStore(a.contextStore),
setCurrentErrorFrame(a.errorFrame), visitLoop(a.traversalChildren, a.traversalMap, a.traversalStore, a.traversalErrorFrame, b, c) && b.unshift(makeYieldFrame(a.traversalChildren, a.traversalMap, a.traversalStore, a.traversalErrorFrame));
};
var visit = function(e, r, t) {
var n = [ e ];
var u = [ flushPrevContextMap() ];
var o = [ flushPrevContextStore() ];
var a = [ getCurrentErrorFrame() ];
if (visitLoop(n, u, o, a, r, t)) {
r.unshift(makeYieldFrame(n, u, o, a));
}
};
var update = function(e, r, t) {
if ("frame.yield" === e.kind) {
setCurrentIdentity(null);
setCurrentContextMap(e.contextMap);
setCurrentContextStore(e.contextStore);
setCurrentErrorFrame(e.errorFrame);
if (visitLoop(e.traversalChildren, e.traversalMap, e.traversalStore, e.traversalErrorFrame, r, t)) {
r.unshift(makeYieldFrame(e.traversalChildren, e.traversalMap, e.traversalStore, e.traversalErrorFrame));
}
} else {
var d = ReactCurrentDispatcher.current, e = null;
ReactCurrentDispatcher.current = Dispatcher;
var n = L.current;
var u = null;
L.current = A;
try {
"frame.class" === a.kind ? e = function(a, b) {
setCurrentIdentity(null);
setCurrentContextMap(b.contextMap);
setCurrentContextStore(b.contextStore);
setCurrentErrorFrame(b.errorFrame);
if (b.error) {
if (++b.instance.updater._thrown >= 25) {
return null;
if ("frame.class" === e.kind) {
u = function(e, r) {
setCurrentIdentity(null);
setCurrentContextMap(r.contextMap);
setCurrentContextStore(r.contextStore);
setCurrentErrorFrame(r.errorFrame);
if (r.error) {
if (++r.instance.updater._thrown >= 25) {
return null;
}
r.instance._isMounted = !0;
if ("function" == typeof r.instance.componentDidCatch) {
r.instance.componentDidCatch(r.error);
}
if ("function" == typeof r.type.getDerivedStateFromError) {
r.instance.updater.enqueueSetState(r.instance, r.type.getDerivedStateFromError(r.error));
}
}
b.instance._isMounted = !0;
"function" == typeof b.instance.componentDidCatch && b.instance.componentDidCatch(b.error);
"function" == typeof b.type.getDerivedStateFromError && b.instance.updater.enqueueSetState(b.instance, b.type.getDerivedStateFromError(b.error));
}
return render$1(b.type, b.instance, a);
}(b, a) : "frame.hooks" === a.kind ? e = function(a, b) {
setFirstHook(b.hook);
setCurrentIdentity(b.id);
setCurrentContextMap(b.contextMap);
setCurrentContextStore(b.contextStore);
setCurrentErrorFrame(b.errorFrame);
return render$2(b.type, b.props, a);
}(b, a) : "frame.lazy" === a.kind && (e = function(a, b) {
setCurrentIdentity(null);
setCurrentContextMap(b.contextMap);
setCurrentContextStore(b.contextStore);
setCurrentErrorFrame(b.errorFrame);
return render$3(b.type, b.props);
}(0, a));
} catch (g) {
var f = getCurrentErrorFrame();
if (!f) {
throw g;
return render$1(r.type, r.instance, e);
}(r, e);
} else if ("frame.hooks" === e.kind) {
u = function(e, r) {
setFirstHook(r.hook);
setCurrentIdentity(r.id);
setCurrentContextMap(r.contextMap);
setCurrentContextStore(r.contextStore);
setCurrentErrorFrame(r.errorFrame);
return render$2(r.type, r.props, e);
}(r, e);
} else if ("frame.lazy" === e.kind) {
u = function(e, r) {
setCurrentIdentity(null);
setCurrentContextMap(r.contextMap);
setCurrentContextStore(r.contextStore);
setCurrentErrorFrame(r.errorFrame);
return render$3(r.type, r.props);
}(0, e);
}
f.error = g;
b.unshift(f);
e = null;
} catch (e) {
var o = getCurrentErrorFrame();
if (!o) {
throw e;
}
o.error = e;
r.unshift(o);
u = null;
} finally {
ReactCurrentDispatcher.current = d;
L.current = n;
}
visit(getChildrenArray(e), b, c);
visit(getChildrenArray(u), r, t);
}
};
function _ref(a, b) {
setImmediate(a);
function _ref(e, r) {
setImmediate(e);
}
var flushFrames = function(a, b, c) {
var d = a.shift();
if (!d) {
var flushFrames = function(e, r, t) {
var n = e.shift();
if (!n) {
return Promise.resolve();
}
SHOULD_YIELD && "frame.yield" === d.kind && (d.thenable = new Promise(_ref));
return Promise.resolve(d.thenable).then((function() {
!function(a) {
rendererStateRef.current = a;
}(c);
update(d, a, b);
return flushFrames(a, b, c);
}), (function(c) {
if (!d.errorFrame) {
throw c;
if (N && "frame.yield" === n.kind) {
n.thenable = new Promise(_ref);
}
return Promise.resolve(n.thenable).then((function() {
!function(e) {
z.current = e;
}(t);
update(n, e, r);
return flushFrames(e, r, t);
}), (function(t) {
if (!n.errorFrame) {
throw t;
}
d.errorFrame.error = c;
update(d.errorFrame, a, b);
n.errorFrame.error = t;
update(n.errorFrame, e, r);
}));
}, defaultVisitor = function() {};
};
module.exports = function(a, b) {
b || (b = defaultVisitor);
var c = [], d = rendererStateRef.current = {
var defaultVisitor = function() {
return;
};
module.exports = function(e, r) {
if (!r) {
r = defaultVisitor;
}
var t = [];
var n = z.current = {
uniqueID: 0

@@ -613,8 +915,8 @@ };

try {
visit(getChildrenArray(a), c, b);
visit(getChildrenArray(e), t, r);
} catch (e) {
return Promise.reject(e);
}
return flushFrames(c, b, d);
return flushFrames(t, r, n);
};
//# sourceMappingURL=react-ssr-prepass.js.map
{
"name": "react-ssr-prepass",
"version": "1.4.0",
"version": "1.5.0",
"description": "A custom partial React SSR renderer for prefetching and suspense",

@@ -52,28 +52,27 @@ "main": "dist/react-ssr-prepass.js",

"peerDependencies": {
"react": "^16.8.0 || ^17.0.0"
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
},
"devDependencies": {
"@ampproject/rollup-plugin-closure-compiler": "^0.26.0",
"@babel/core": "^7.13.10",
"@babel/plugin-transform-flow-strip-types": "^7.13.0",
"@babel/plugin-transform-object-assign": "^7.12.13",
"@babel/preset-env": "^7.13.10",
"@babel/preset-flow": "^7.12.13",
"@babel/preset-react": "^7.12.13",
"@babel/core": "^7.16.7",
"@babel/plugin-transform-flow-strip-types": "^7.16.7",
"@babel/plugin-transform-object-assign": "^7.16.7",
"@babel/preset-env": "^7.16.7",
"@babel/preset-flow": "^7.16.7",
"@babel/preset-react": "^7.16.7",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-buble": "^0.21.3",
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-node-resolve": "^11.2.0",
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-node-resolve": "^13.1.3",
"babel-plugin-closure-elimination": "^1.3.2",
"babel-plugin-transform-async-to-promises": "^0.8.15",
"codecov": "^3.8.1",
"babel-plugin-transform-async-to-promises": "^0.8.18",
"codecov": "^3.8.3",
"flow-bin": "0.122.0",
"husky": "^4.3.0",
"jest": "^26.6.3",
"lint-staged": "^10.5.4",
"husky-v4": "^4.3.0",
"jest": "^27.4.7",
"lint-staged": "^12.1.5",
"npm-run-all": "^4.1.5",
"prettier": "^2.2.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"rollup": "^2.41.2",
"prettier": "^2.5.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"rollup": "^2.63.0",
"rollup-plugin-babel": "^4.4.0",

@@ -80,0 +79,0 @@ "rollup-plugin-terser": "^7.0.2"

Sorry, the diff of this file is not supported yet

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