diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2022-08-18 17:35:02 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-18 17:35:02 +0530 |
commit | cd21cff29942f24ba7d38287186cce64d0e84e56 (patch) | |
tree | e663eff884526ee762ae9141a3cf5a0f6967a84e | |
parent | 0b0843e4a54d7c1ddf293ac1ccee2479b69a5ba9 (diff) |
feat(ext/flash): An optimized http/1.1 server (#15405)
Co-authored-by: Bartek IwaĆczuk <biwanczuk@gmail.com>
Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
Co-authored-by: crowlkats <crowlkats@toaxl.com>
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
39 files changed, 21284 insertions, 30 deletions
diff --git a/Cargo.lock b/Cargo.lock index 16173cfd1..da61d0724 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1041,6 +1041,24 @@ dependencies = [ ] [[package]] +name = "deno_flash" +version = "0.1.0" +dependencies = [ + "deno_core", + "deno_tls", + "deno_websocket", + "http", + "httparse", + "libc", + "log 0.4.17", + "mio", + "rustls", + "rustls-pemfile 0.2.1", + "serde", + "tokio", +] + +[[package]] name = "deno_graph" version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1147,6 +1165,7 @@ dependencies = [ "deno_crypto", "deno_fetch", "deno_ffi", + "deno_flash", "deno_http", "deno_net", "deno_node", @@ -3608,6 +3627,15 @@ dependencies = [ [[package]] name = "rustls-pemfile" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" +dependencies = [ + "base64 0.13.0", +] + +[[package]] +name = "rustls-pemfile" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ee86d63972a7c661d1536fefe8c3c8407321c3df668891286de28abcd087360" diff --git a/Cargo.toml b/Cargo.toml index 2609221b6..91b9a0d65 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,7 @@ members = [ "ext/console", "ext/crypto", "ext/fetch", + "ext/flash", "ext/ffi", "ext/http", "ext/net", @@ -134,6 +135,8 @@ opt-level = 3 opt-level = 3 [profile.release.package.deno_http] opt-level = 3 +[profile.release.package.deno_flash] +opt-level = 3 [profile.release.package.deno_net] opt-level = 3 [profile.release.package.deno_web] diff --git a/cli/bench/http/bun_http_send_file.js b/cli/bench/http/bun_http_send_file.js new file mode 100644 index 000000000..615c35d31 --- /dev/null +++ b/cli/bench/http/bun_http_send_file.js @@ -0,0 +1,12 @@ +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. +const port = Bun.argv[2] || "4545"; + +const path = new URL("../testdata/128k.bin", import.meta.url).pathname; + +Bun.serve({ + fetch(_req) { + const file = Bun.file(path); + return new Response(file); + }, + port: Number(port), +}); diff --git a/cli/bench/http/deno_flash_send_file.js b/cli/bench/http/deno_flash_send_file.js new file mode 100644 index 000000000..261f5a207 --- /dev/null +++ b/cli/bench/http/deno_flash_send_file.js @@ -0,0 +1,14 @@ +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. + +const addr = Deno.args[0] || "127.0.0.1:4500"; +const [hostname, port] = addr.split(":"); +const { serve } = Deno; + +const path = new URL("../testdata/128k.bin", import.meta.url).pathname; + +function handler() { + const file = Deno.openSync(path, { read: true }); + return new Response(file.readable); +} + +serve(handler, { hostname, port: Number(port) }); diff --git a/cli/bench/http/deno_http_flash.js b/cli/bench/http/deno_http_flash.js new file mode 100644 index 000000000..5d3de68f4 --- /dev/null +++ b/cli/bench/http/deno_http_flash.js @@ -0,0 +1,14 @@ +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. + +const addr = Deno.args[0] || "127.0.0.1:4500"; +const [hostname, port] = addr.split(":"); +const { serve } = Deno; + +function handler() { + return new Response("Hello World"); +} + +serve(handler, { + hostname, + port, +}); diff --git a/cli/bench/http/deno_http_flash_ops.js b/cli/bench/http/deno_http_flash_ops.js new file mode 100644 index 000000000..1b833e7f7 --- /dev/null +++ b/cli/bench/http/deno_http_flash_ops.js @@ -0,0 +1,37 @@ +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. + +// deno-lint-ignore-file + +const { + core: { + opAsync, + ops: { op_flash_make_request, op_flash_serve }, + encode, + }, +} = Deno; +const addr = Deno.args[0] || "127.0.0.1:4500"; +const [hostname, port] = addr.split(":"); +const serverId = op_flash_serve({ hostname, port }); +const serverPromise = opAsync("op_flash_drive_server", serverId); + +const fastOps = op_flash_make_request(); +function nextRequest() { + return fastOps.nextRequest(); +} +function respond(token, response) { + return fastOps.respond(token, response, true); +} + +const response = encode( + "HTTP/1.1 200 OK\r\nContent-Length: 11\r\n\r\nHello World", +); +while (true) { + let token = nextRequest(); + if (token === 0) token = await opAsync("op_flash_next_async", serverId); + for (let i = 0; i < token; i++) { + respond( + i, + response, + ); + } +} diff --git a/cli/bench/http/deno_reactdom_ssr_flash.jsx b/cli/bench/http/deno_reactdom_ssr_flash.jsx new file mode 100644 index 000000000..571545b27 --- /dev/null +++ b/cli/bench/http/deno_reactdom_ssr_flash.jsx @@ -0,0 +1,26 @@ +import { renderToReadableStream } from "https://esm.run/react-dom/server"; +import * as React from "https://esm.run/react"; +const { serve } = Deno; +const addr = Deno.args[0] || "127.0.0.1:4500"; +const [hostname, port] = addr.split(":"); + +const App = () => ( + <html> + <body> + <h1>Hello World</h1> + </body> + </html> +); + +const headers = { + headers: { + "Content-Type": "text/html", + }, +}; + +serve( + async () => { + return new Response(await renderToReadableStream(<App />), headers); + }, + { hostname, port }, +); diff --git a/cli/bench/http/node_reactdom_ssr.js b/cli/bench/http/node_reactdom_ssr.js new file mode 100644 index 000000000..5e784b946 --- /dev/null +++ b/cli/bench/http/node_reactdom_ssr.js @@ -0,0 +1,16199 @@ +var Gd = Object.create; +var Ac = Object.defineProperty; +var Xd = Object.getOwnPropertyDescriptor; +var Zd = Object.getOwnPropertyNames; +var Jd = Object.getPrototypeOf, + Qd = Object.prototype.hasOwnProperty; +var an = (e, n) => () => (n || e((n = { exports: {} }).exports, n), n.exports); +var Kd = (e, n, i, s) => { + if ((n && typeof n == "object") || typeof n == "function") { + for (let v of Zd(n)) { + !Qd.call(e, v) && + v !== i && + Ac(e, v, { + get: () => n[v], + enumerable: !(s = Xd(n, v)) || s.enumerable, + }); + } + } + return e; +}; +var Dc = (e, n, i) => ( + (i = e != null ? Gd(Jd(e)) : {}), + Kd( + n || !e || !e.__esModule + ? Ac(i, "default", { value: e, enumerable: !0 }) + : i, + e, + ) +); +var Nc = an(($) => { + "use strict"; + var Ai = Symbol.for("react.element"), + qd = Symbol.for("react.portal"), + ep = Symbol.for("react.fragment"), + tp = Symbol.for("react.strict_mode"), + rp = Symbol.for("react.profiler"), + np = Symbol.for("react.provider"), + op = Symbol.for("react.context"), + ap = Symbol.for("react.forward_ref"), + ip = Symbol.for("react.suspense"), + lp = Symbol.for("react.memo"), + sp = Symbol.for("react.lazy"), + Oc = Symbol.iterator; + function up(e) { + return e === null || typeof e != "object" + ? null + : ((e = (Oc && e[Oc]) || e["@@iterator"]), + typeof e == "function" ? e : null); + } + var Bc = { + isMounted: function () { + return !1; + }, + enqueueForceUpdate: function () {}, + enqueueReplaceState: function () {}, + enqueueSetState: function () {}, + }, + Uc = Object.assign, + jc = {}; + function sa(e, n, i) { + (this.props = e), + (this.context = n), + (this.refs = jc), + (this.updater = i || Bc); + } + sa.prototype.isReactComponent = {}; + sa.prototype.setState = function (e, n) { + if (typeof e != "object" && typeof e != "function" && e != null) { + throw Error( + "setState(...): takes an object of state variables to update or a function which returns an object of state variables.", + ); + } + this.updater.enqueueSetState(this, e, n, "setState"); + }; + sa.prototype.forceUpdate = function (e) { + this.updater.enqueueForceUpdate(this, e, "forceUpdate"); + }; + function Hc() {} + Hc.prototype = sa.prototype; + function Hu(e, n, i) { + (this.props = e), + (this.context = n), + (this.refs = jc), + (this.updater = i || Bc); + } + var Wu = (Hu.prototype = new Hc()); + Wu.constructor = Hu; + Uc(Wu, sa.prototype); + Wu.isPureReactComponent = !0; + var Mc = Array.isArray, + Wc = Object.prototype.hasOwnProperty, + zu = { current: null }, + zc = { key: !0, ref: !0, __self: !0, __source: !0 }; + function $c(e, n, i) { + var s, + v = {}, + c = null, + m = null; + if (n != null) { + for ( + s + in (n.ref !== void 0 && (m = n.ref), + n.key !== void 0 && (c = "" + n.key), + n) + ) { + Wc.call(n, s) && !zc.hasOwnProperty(s) && (v[s] = n[s]); + } + } + var S = arguments.length - 2; + if (S === 1) v.children = i; + else if (1 < S) { + for (var E = Array(S), x = 0; x < S; x++) E[x] = arguments[x + 2]; + v.children = E; + } + if (e && e.defaultProps) { + for (s in ((S = e.defaultProps), S)) v[s] === void 0 && (v[s] = S[s]); + } + return { + $$typeof: Ai, + type: e, + key: c, + ref: m, + props: v, + _owner: zu.current, + }; + } + function cp(e, n) { + return { + $$typeof: Ai, + type: e.type, + key: n, + ref: e.ref, + props: e.props, + _owner: e._owner, + }; + } + function $u(e) { + return typeof e == "object" && e !== null && e.$$typeof === Ai; + } + function fp(e) { + var n = { "=": "=0", ":": "=2" }; + return ( + "$" + + e.replace(/[=:]/g, function (i) { + return n[i]; + }) + ); + } + var Lc = /\/+/g; + function ju(e, n) { + return typeof e == "object" && e !== null && e.key != null + ? fp("" + e.key) + : n.toString(36); + } + function Ml(e, n, i, s, v) { + var c = typeof e; + (c === "undefined" || c === "boolean") && (e = null); + var m = !1; + if (e === null) m = !0; + else { + switch (c) { + case "string": + case "number": + m = !0; + break; + case "object": + switch (e.$$typeof) { + case Ai: + case qd: + m = !0; + } + } + } + if (m) { + return ( + (m = e), + (v = v(m)), + (e = s === "" ? "." + ju(m, 0) : s), + Mc(v) + ? ((i = ""), + e != null && (i = e.replace(Lc, "$&/") + "/"), + Ml(v, n, i, "", function (x) { + return x; + })) + : v != null && + ($u(v) && + (v = cp( + v, + i + + (!v.key || (m && m.key === v.key) + ? "" + : ("" + v.key).replace(Lc, "$&/") + "/") + + e, + )), + n.push(v)), + 1 + ); + } + if (((m = 0), (s = s === "" ? "." : s + ":"), Mc(e))) { + for (var S = 0; S < e.length; S++) { + c = e[S]; + var E = s + ju(c, S); + m += Ml(c, n, i, E, v); + } + } else if (((E = up(e)), typeof E == "function")) { + for (e = E.call(e), S = 0; !(c = e.next()).done;) { + (c = c.value), (E = s + ju(c, S++)), (m += Ml(c, n, i, E, v)); + } + } else if (c === "object") { + throw ( + ((n = String(e)), + Error( + "Objects are not valid as a React child (found: " + + (n === "[object Object]" + ? "object with keys {" + Object.keys(e).join(", ") + "}" + : n) + + "). If you meant to render a collection of children, use an array instead.", + )) + ); + } + return m; + } + function Ol(e, n, i) { + if (e == null) return e; + var s = [], + v = 0; + return ( + Ml(e, s, "", "", function (c) { + return n.call(i, c, v++); + }), s + ); + } + function dp(e) { + if (e._status === -1) { + var n = e._result; + (n = n()), + n.then( + function (i) { + (e._status === 0 || e._status === -1) && + ((e._status = 1), (e._result = i)); + }, + function (i) { + (e._status === 0 || e._status === -1) && + ((e._status = 2), (e._result = i)); + }, + ), + e._status === -1 && ((e._status = 0), (e._result = n)); + } + if (e._status === 1) return e._result.default; + throw e._result; + } + var Ve = { current: null }, + Ll = { transition: null }, + pp = { + ReactCurrentDispatcher: Ve, + ReactCurrentBatchConfig: Ll, + ReactCurrentOwner: zu, + }; + $.Children = { + map: Ol, + forEach: function (e, n, i) { + Ol( + e, + function () { + n.apply(this, arguments); + }, + i, + ); + }, + count: function (e) { + var n = 0; + return ( + Ol(e, function () { + n++; + }), n + ); + }, + toArray: function (e) { + return ( + Ol(e, function (n) { + return n; + }) || [] + ); + }, + only: function (e) { + if (!$u(e)) { + throw Error( + "React.Children.only expected to receive a single React element child.", + ); + } + return e; + }, + }; + $.Component = sa; + $.Fragment = ep; + $.Profiler = rp; + $.PureComponent = Hu; + $.StrictMode = tp; + $.Suspense = ip; + $.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = pp; + $.cloneElement = function (e, n, i) { + if (e == null) { + throw Error( + "React.cloneElement(...): The argument must be a React element, but you passed " + + e + + ".", + ); + } + var s = Uc({}, e.props), + v = e.key, + c = e.ref, + m = e._owner; + if (n != null) { + if ( + (n.ref !== void 0 && ((c = n.ref), (m = zu.current)), + n.key !== void 0 && (v = "" + n.key), + e.type && e.type.defaultProps) + ) { + var S = e.type.defaultProps; + } + for (E in n) { + Wc.call(n, E) && + !zc.hasOwnProperty(E) && + (s[E] = n[E] === void 0 && S !== void 0 ? S[E] : n[E]); + } + } + var E = arguments.length - 2; + if (E === 1) s.children = i; + else if (1 < E) { + S = Array(E); + for (var x = 0; x < E; x++) S[x] = arguments[x + 2]; + s.children = S; + } + return { $$typeof: Ai, type: e.type, key: v, ref: c, props: s, _owner: m }; + }; + $.createContext = function (e) { + return ( + (e = { + $$typeof: op, + _currentValue: e, + _currentValue2: e, + _threadCount: 0, + Provider: null, + Consumer: null, + _defaultValue: null, + _globalName: null, + }), + (e.Provider = { $$typeof: np, _context: e }), + (e.Consumer = e) + ); + }; + $.createElement = $c; + $.createFactory = function (e) { + var n = $c.bind(null, e); + return (n.type = e), n; + }; + $.createRef = function () { + return { current: null }; + }; + $.forwardRef = function (e) { + return { $$typeof: ap, render: e }; + }; + $.isValidElement = $u; + $.lazy = function (e) { + return { $$typeof: sp, _payload: { _status: -1, _result: e }, _init: dp }; + }; + $.memo = function (e, n) { + return { $$typeof: lp, type: e, compare: n === void 0 ? null : n }; + }; + $.startTransition = function (e) { + var n = Ll.transition; + Ll.transition = {}; + try { + e(); + } finally { + Ll.transition = n; + } + }; + $.unstable_act = function () { + throw Error("act(...) is not supported in production builds of React."); + }; + $.useCallback = function (e, n) { + return Ve.current.useCallback(e, n); + }; + $.useContext = function (e) { + return Ve.current.useContext(e); + }; + $.useDebugValue = function () {}; + $.useDeferredValue = function (e) { + return Ve.current.useDeferredValue(e); + }; + $.useEffect = function (e, n) { + return Ve.current.useEffect(e, n); + }; + $.useId = function () { + return Ve.current.useId(); + }; + $.useImperativeHandle = function (e, n, i) { + return Ve.current.useImperativeHandle(e, n, i); + }; + $.useInsertionEffect = function (e, n) { + return Ve.current.useInsertionEffect(e, n); + }; + $.useLayoutEffect = function (e, n) { + return Ve.current.useLayoutEffect(e, n); + }; + $.useMemo = function (e, n) { + return Ve.current.useMemo(e, n); + }; + $.useReducer = function (e, n, i) { + return Ve.current.useReducer(e, n, i); + }; + $.useRef = function (e) { + return Ve.current.useRef(e); + }; + $.useState = function (e) { + return Ve.current.useState(e); + }; + $.useSyncExternalStore = function (e, n, i) { + return Ve.current.useSyncExternalStore(e, n, i); + }; + $.useTransition = function () { + return Ve.current.useTransition(); + }; + $.version = "18.2.0"; +}); +var Vc = an((N, Bl) => { + "use strict"; + process.env.NODE_ENV !== "production" && + (function () { + "use strict"; + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == + "function" && + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); + var e = "18.2.0", + n = Symbol.for("react.element"), + i = Symbol.for("react.portal"), + s = Symbol.for("react.fragment"), + v = Symbol.for("react.strict_mode"), + c = Symbol.for("react.profiler"), + m = Symbol.for("react.provider"), + S = Symbol.for("react.context"), + E = Symbol.for("react.forward_ref"), + x = Symbol.for("react.suspense"), + R = Symbol.for("react.suspense_list"), + D = Symbol.for("react.memo"), + V = Symbol.for("react.lazy"), + te = Symbol.for("react.offscreen"), + J = Symbol.iterator, + Oe = "@@iterator"; + function P(h) { + if (h === null || typeof h != "object") return null; + var b = (J && h[J]) || h[Oe]; + return typeof b == "function" ? b : null; + } + var ue = { current: null }, + W = { transition: null }, + q = { + current: null, + isBatchingLegacy: !1, + didScheduleLegacyUpdate: !1, + }, + xe = { current: null }, + _e = {}, + he = null; + function F(h) { + he = h; + } + (_e.setExtraStackFrame = function (h) { + he = h; + }), + (_e.getCurrentStack = null), + (_e.getStackAddendum = function () { + var h = ""; + he && (h += he); + var b = _e.getCurrentStack; + return b && (h += b() || ""), h; + }); + var ct = !1, + qt = !1, + yt = !1, + Mt = !1, + Lt = !1, + ft = { + ReactCurrentDispatcher: ue, + ReactCurrentBatchConfig: W, + ReactCurrentOwner: xe, + }; + (ft.ReactDebugCurrentFrame = _e), (ft.ReactCurrentActQueue = q); + function Me(h) { + { + for ( + var b = arguments.length, k = new Array(b > 1 ? b - 1 : 0), T = 1; + T < b; + T++ + ) { + k[T - 1] = arguments[T]; + } + Er("warn", h, k); + } + } + function B(h) { + { + for ( + var b = arguments.length, k = new Array(b > 1 ? b - 1 : 0), T = 1; + T < b; + T++ + ) { + k[T - 1] = arguments[T]; + } + Er("error", h, k); + } + } + function Er(h, b, k) { + { + var T = ft.ReactDebugCurrentFrame, + I = T.getStackAddendum(); + I !== "" && ((b += "%s"), (k = k.concat([I]))); + var U = k.map(function (M) { + return String(M); + }); + U.unshift("Warning: " + b), + Function.prototype.apply.call(console[h], console, U); + } + } + var tt = {}; + function Bt(h, b) { + { + var k = h.constructor, + T = (k && (k.displayName || k.name)) || "ReactClass", + I = T + "." + b; + if (tt[I]) return; + B( + "Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", + b, + T, + ), (tt[I] = !0); + } + } + var bt = { + isMounted: function (h) { + return !1; + }, + enqueueForceUpdate: function (h, b, k) { + Bt(h, "forceUpdate"); + }, + enqueueReplaceState: function (h, b, k, T) { + Bt(h, "replaceState"); + }, + enqueueSetState: function (h, b, k, T) { + Bt(h, "setState"); + }, + }, + Le = Object.assign, + er = {}; + Object.freeze(er); + function re(h, b, k) { + (this.props = h), + (this.context = b), + (this.refs = er), + (this.updater = k || bt); + } + (re.prototype.isReactComponent = {}), + (re.prototype.setState = function (h, b) { + if (typeof h != "object" && typeof h != "function" && h != null) { + throw new Error( + "setState(...): takes an object of state variables to update or a function which returns an object of state variables.", + ); + } + this.updater.enqueueSetState(this, h, b, "setState"); + }), + (re.prototype.forceUpdate = function (h) { + this.updater.enqueueForceUpdate(this, h, "forceUpdate"); + }); + { + var ce = { + isMounted: [ + "isMounted", + "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks.", + ], + replaceState: [ + "replaceState", + "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236).", + ], + }, + tr = function (h, b) { + Object.defineProperty(re.prototype, h, { + get: function () { + Me( + "%s(...) is deprecated in plain JavaScript React classes. %s", + b[0], + b[1], + ); + }, + }); + }; + for (var rr in ce) ce.hasOwnProperty(rr) && tr(rr, ce[rr]); + } + function nr() {} + nr.prototype = re.prototype; + function Rr(h, b, k) { + (this.props = h), + (this.context = b), + (this.refs = er), + (this.updater = k || bt); + } + var St = (Rr.prototype = new nr()); + (St.constructor = Rr), + Le(St, re.prototype), + (St.isPureReactComponent = !0); + function so() { + var h = { current: null }; + return Object.seal(h), h; + } + var uo = Array.isArray; + function ye(h) { + return uo(h); + } + function ve(h) { + { + var b = typeof Symbol == "function" && Symbol.toStringTag, + k = (b && h[Symbol.toStringTag]) || h.constructor.name || "Object"; + return k; + } + } + function co(h) { + try { + return or(h), !1; + } catch { + return !0; + } + } + function or(h) { + return "" + h; + } + function je(h) { + if (co(h)) { + return ( + B( + "The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", + ve(h), + ), or(h) + ); + } + } + function ha(h, b, k) { + var T = h.displayName; + if (T) return T; + var I = b.displayName || b.name || ""; + return I !== "" ? k + "(" + I + ")" : k; + } + function ar(h) { + return h.displayName || "Context"; + } + function dt(h) { + if (h == null) return null; + if ( + (typeof h.tag == "number" && + B( + "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.", + ), + typeof h == "function") + ) { + return h.displayName || h.name || null; + } + if (typeof h == "string") return h; + switch (h) { + case s: + return "Fragment"; + case i: + return "Portal"; + case c: + return "Profiler"; + case v: + return "StrictMode"; + case x: + return "Suspense"; + case R: + return "SuspenseList"; + } + if (typeof h == "object") { + switch (h.$$typeof) { + case S: + var b = h; + return ar(b) + ".Consumer"; + case m: + var k = h; + return ar(k._context) + ".Provider"; + case E: + return ha(h, h.render, "ForwardRef"); + case D: + var T = h.displayName || null; + return T !== null ? T : dt(h.type) || "Memo"; + case V: { + var I = h, + U = I._payload, + M = I._init; + try { + return dt(M(U)); + } catch { + return null; + } + } + } + } + return null; + } + var ir = Object.prototype.hasOwnProperty, + fo = { key: !0, ref: !0, __self: !0, __source: !0 }, + lr, + fn, + sr; + sr = {}; + function pt(h) { + if (ir.call(h, "ref")) { + var b = Object.getOwnPropertyDescriptor(h, "ref").get; + if (b && b.isReactWarning) return !1; + } + return h.ref !== void 0; + } + function ke(h) { + if (ir.call(h, "key")) { + var b = Object.getOwnPropertyDescriptor(h, "key").get; + if (b && b.isReactWarning) return !1; + } + return h.key !== void 0; + } + function po(h, b) { + var k = function () { + lr || + ((lr = !0), + B( + "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", + b, + )); + }; + (k.isReactWarning = !0), + Object.defineProperty(h, "key", { get: k, configurable: !0 }); + } + function va(h, b) { + var k = function () { + fn || + ((fn = !0), + B( + "%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", + b, + )); + }; + (k.isReactWarning = !0), + Object.defineProperty(h, "ref", { get: k, configurable: !0 }); + } + function ga(h) { + if ( + typeof h.ref == "string" && + xe.current && + h.__self && + xe.current.stateNode !== h.__self + ) { + var b = dt(xe.current.type); + sr[b] || + (B( + 'Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', + b, + h.ref, + ), + (sr[b] = !0)); + } + } + var dn = function (h, b, k, T, I, U, M) { + var H = { $$typeof: n, type: h, key: b, ref: k, props: M, _owner: U }; + return ( + (H._store = {}), + Object.defineProperty(H._store, "validated", { + configurable: !1, + enumerable: !1, + writable: !0, + value: !1, + }), + Object.defineProperty(H, "_self", { + configurable: !1, + enumerable: !1, + writable: !1, + value: T, + }), + Object.defineProperty(H, "_source", { + configurable: !1, + enumerable: !1, + writable: !1, + value: I, + }), + Object.freeze && (Object.freeze(H.props), Object.freeze(H)), + H + ); + }; + function ho(h, b, k) { + var T, + I = {}, + U = null, + M = null, + H = null, + z = null; + if (b != null) { + pt(b) && ((M = b.ref), ga(b)), + ke(b) && (je(b.key), (U = "" + b.key)), + (H = b.__self === void 0 ? null : b.__self), + (z = b.__source === void 0 ? null : b.__source); + for (T in b) ir.call(b, T) && !fo.hasOwnProperty(T) && (I[T] = b[T]); + } + var Y = arguments.length - 2; + if (Y === 1) I.children = k; + else if (Y > 1) { + for (var Q = Array(Y), K = 0; K < Y; K++) Q[K] = arguments[K + 2]; + Object.freeze && Object.freeze(Q), (I.children = Q); + } + if (h && h.defaultProps) { + var ee = h.defaultProps; + for (T in ee) I[T] === void 0 && (I[T] = ee[T]); + } + if (U || M) { + var fe = typeof h == "function" + ? h.displayName || h.name || "Unknown" + : h; + U && po(I, fe), M && va(I, fe); + } + return dn(h, U, M, H, z, xe.current, I); + } + function ma(h, b) { + var k = dn(h.type, b, h.ref, h._self, h._source, h._owner, h.props); + return k; + } + function pn(h, b, k) { + if (h == null) { + throw new Error( + "React.cloneElement(...): The argument must be a React element, but you passed " + + h + + ".", + ); + } + var T, + I = Le({}, h.props), + U = h.key, + M = h.ref, + H = h._self, + z = h._source, + Y = h._owner; + if (b != null) { + pt(b) && ((M = b.ref), (Y = xe.current)), + ke(b) && (je(b.key), (U = "" + b.key)); + var Q; + h.type && h.type.defaultProps && (Q = h.type.defaultProps); + for (T in b) { + ir.call(b, T) && + !fo.hasOwnProperty(T) && + (b[T] === void 0 && Q !== void 0 ? (I[T] = Q[T]) : (I[T] = b[T])); + } + } + var K = arguments.length - 2; + if (K === 1) I.children = k; + else if (K > 1) { + for (var ee = Array(K), fe = 0; fe < K; fe++) { + ee[fe] = arguments[fe + 2]; + } + I.children = ee; + } + return dn(h.type, U, M, H, z, Y, I); + } + function wt(h) { + return typeof h == "object" && h !== null && h.$$typeof === n; + } + var Te = ".", + vo = ":"; + function go(h) { + var b = /[=:]/g, + k = { "=": "=0", ":": "=2" }, + T = h.replace(b, function (I) { + return k[I]; + }); + return "$" + T; + } + var xt = !1, + hn = /\/+/g; + function vn(h) { + return h.replace(hn, "$&/"); + } + function Ir(h, b) { + return typeof h == "object" && h !== null && h.key != null + ? (je(h.key), go("" + h.key)) + : b.toString(36); + } + function ur(h, b, k, T, I) { + var U = typeof h; + (U === "undefined" || U === "boolean") && (h = null); + var M = !1; + if (h === null) M = !0; + else { + switch (U) { + case "string": + case "number": + M = !0; + break; + case "object": + switch (h.$$typeof) { + case n: + case i: + M = !0; + } + } + } + if (M) { + var H = h, + z = I(H), + Y = T === "" ? Te + Ir(H, 0) : T; + if (ye(z)) { + var Q = ""; + Y != null && (Q = vn(Y) + "/"), + ur(z, b, Q, "", function (Ma) { + return Ma; + }); + } else { + z != null && + (wt(z) && + (z.key && (!H || H.key !== z.key) && je(z.key), + (z = ma( + z, + k + + (z.key && (!H || H.key !== z.key) + ? vn("" + z.key) + "/" + : "") + + Y, + ))), + b.push(z)); + } + return 1; + } + var K, + ee, + fe = 0, + Se = T === "" ? Te : T + vo; + if (ye(h)) { + for (var yr = 0; yr < h.length; yr++) { + (K = h[yr]), (ee = Se + Ir(K, yr)), (fe += ur(K, b, k, ee, I)); + } + } else { + var Pn = P(h); + if (typeof Pn == "function") { + var Wr = h; + Pn === Wr.entries && + (xt || + Me( + "Using Maps as children is not supported. Use an array of keyed ReactElements instead.", + ), + (xt = !0)); + for (var Co = Pn.call(Wr), zr, Oa = 0; !(zr = Co.next()).done;) { + (K = zr.value), + (ee = Se + Ir(K, Oa++)), + (fe += ur(K, b, k, ee, I)); + } + } else if (U === "object") { + var Eo = String(h); + throw new Error( + "Objects are not valid as a React child (found: " + + (Eo === "[object Object]" + ? "object with keys {" + Object.keys(h).join(", ") + "}" + : Eo) + + "). If you meant to render a collection of children, use an array instead.", + ); + } + } + return fe; + } + function _r(h, b, k) { + if (h == null) return h; + var T = [], + I = 0; + return ( + ur(h, T, "", "", function (U) { + return b.call(k, U, I++); + }), T + ); + } + function ya(h) { + var b = 0; + return ( + _r(h, function () { + b++; + }), b + ); + } + function ba(h, b, k) { + _r( + h, + function () { + b.apply(this, arguments); + }, + k, + ); + } + function mo(h) { + return ( + _r(h, function (b) { + return b; + }) || [] + ); + } + function Ut(h) { + if (!wt(h)) { + throw new Error( + "React.Children.only expected to receive a single React element child.", + ); + } + return h; + } + function gn(h) { + var b = { + $$typeof: S, + _currentValue: h, + _currentValue2: h, + _threadCount: 0, + Provider: null, + Consumer: null, + _defaultValue: null, + _globalName: null, + }; + b.Provider = { $$typeof: m, _context: b }; + var k = !1, + T = !1, + I = !1; + { + var U = { $$typeof: S, _context: b }; + Object.defineProperties(U, { + Provider: { + get: function () { + return ( + T || + ((T = !0), + B( + "Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?", + )), b.Provider + ); + }, + set: function (M) { + b.Provider = M; + }, + }, + _currentValue: { + get: function () { + return b._currentValue; + }, + set: function (M) { + b._currentValue = M; + }, + }, + _currentValue2: { + get: function () { + return b._currentValue2; + }, + set: function (M) { + b._currentValue2 = M; + }, + }, + _threadCount: { + get: function () { + return b._threadCount; + }, + set: function (M) { + b._threadCount = M; + }, + }, + Consumer: { + get: function () { + return ( + k || + ((k = !0), + B( + "Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?", + )), b.Consumer + ); + }, + }, + displayName: { + get: function () { + return b.displayName; + }, + set: function (M) { + I || + (Me( + "Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", + M, + ), + (I = !0)); + }, + }, + }), (b.Consumer = U); + } + return (b._currentRenderer = null), (b._currentRenderer2 = null), b; + } + var jt = -1, + Pr = 0, + ge = 1, + Sa = 2; + function wa(h) { + if (h._status === jt) { + var b = h._result, + k = b(); + if ( + (k.then( + function (U) { + if (h._status === Pr || h._status === jt) { + var M = h; + (M._status = ge), (M._result = U); + } + }, + function (U) { + if (h._status === Pr || h._status === jt) { + var M = h; + (M._status = Sa), (M._result = U); + } + }, + ), + h._status === jt) + ) { + var T = h; + (T._status = Pr), (T._result = k); + } + } + if (h._status === ge) { + var I = h._result; + return ( + I === void 0 && + B( + `lazy: Expected the result of a dynamic import() call. Instead received: %s + +Your code should look like: + const MyComponent = lazy(() => import('./MyComponent')) + +Did you accidentally put curly braces around the import?`, + I, + ), + "default" in I || + B( + `lazy: Expected the result of a dynamic import() call. Instead received: %s + +Your code should look like: + const MyComponent = lazy(() => import('./MyComponent'))`, + I, + ), + I.default + ); + } else throw h._result; + } + function xa(h) { + var b = { _status: jt, _result: h }, + k = { $$typeof: V, _payload: b, _init: wa }; + { + var T, I; + Object.defineProperties(k, { + defaultProps: { + configurable: !0, + get: function () { + return T; + }, + set: function (U) { + B( + "React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.", + ), + (T = U), + Object.defineProperty(k, "defaultProps", { enumerable: !0 }); + }, + }, + propTypes: { + configurable: !0, + get: function () { + return I; + }, + set: function (U) { + B( + "React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.", + ), + (I = U), + Object.defineProperty(k, "propTypes", { enumerable: !0 }); + }, + }, + }); + } + return k; + } + function ka(h) { + h != null && h.$$typeof === D + ? B( + "forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).", + ) + : typeof h != "function" + ? B( + "forwardRef requires a render function but was given %s.", + h === null ? "null" : typeof h, + ) + : h.length !== 0 && + h.length !== 2 && + B( + "forwardRef render functions accept exactly two parameters: props and ref. %s", + h.length === 1 + ? "Did you forget to use the ref parameter?" + : "Any additional parameter will be undefined.", + ), + h != null && + (h.defaultProps != null || h.propTypes != null) && + B( + "forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?", + ); + var b = { $$typeof: E, render: h }; + { + var k; + Object.defineProperty(b, "displayName", { + enumerable: !1, + configurable: !0, + get: function () { + return k; + }, + set: function (T) { + (k = T), !h.name && !h.displayName && (h.displayName = T); + }, + }); + } + return b; + } + var mn; + mn = Symbol.for("react.module.reference"); + function yo(h) { + return !!( + typeof h == "string" || + typeof h == "function" || + h === s || + h === c || + Lt || + h === v || + h === x || + h === R || + Mt || + h === te || + ct || + qt || + yt || + (typeof h == "object" && + h !== null && + (h.$$typeof === V || + h.$$typeof === D || + h.$$typeof === m || + h.$$typeof === S || + h.$$typeof === E || + h.$$typeof === mn || + h.getModuleId !== void 0)) + ); + } + function Ta(h, b) { + yo(h) || + B( + "memo: The first argument must be a component. Instead received: %s", + h === null ? "null" : typeof h, + ); + var k = { $$typeof: D, type: h, compare: b === void 0 ? null : b }; + { + var T; + Object.defineProperty(k, "displayName", { + enumerable: !1, + configurable: !0, + get: function () { + return T; + }, + set: function (I) { + (T = I), !h.name && !h.displayName && (h.displayName = I); + }, + }); + } + return k; + } + function me() { + var h = ue.current; + return ( + h === null && + B(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: +1. You might have mismatching versions of React and the renderer (such as React DOM) +2. You might be breaking the Rules of Hooks +3. You might have more than one copy of React in the same app +See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`), + h + ); + } + function be(h) { + var b = me(); + if (h._context !== void 0) { + var k = h._context; + k.Consumer === h + ? B( + "Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?", + ) + : k.Provider === h && + B( + "Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?", + ); + } + return b.useContext(h); + } + function Ca(h) { + var b = me(); + return b.useState(h); + } + function Ea(h, b, k) { + var T = me(); + return T.useReducer(h, b, k); + } + function Ra(h) { + var b = me(); + return b.useRef(h); + } + function bo(h, b) { + var k = me(); + return k.useEffect(h, b); + } + function So(h, b) { + var k = me(); + return k.useInsertionEffect(h, b); + } + function Ia(h, b) { + var k = me(); + return k.useLayoutEffect(h, b); + } + function _a(h, b) { + var k = me(); + return k.useCallback(h, b); + } + function cr(h, b) { + var k = me(); + return k.useMemo(h, b); + } + function Fr(h, b, k) { + var T = me(); + return T.useImperativeHandle(h, b, k); + } + function kt(h, b) { + { + var k = me(); + return k.useDebugValue(h, b); + } + } + function Ar() { + var h = me(); + return h.useTransition(); + } + function Dr(h) { + var b = me(); + return b.useDeferredValue(h); + } + function fr() { + var h = me(); + return h.useId(); + } + function yn(h, b, k) { + var T = me(); + return T.useSyncExternalStore(h, b, k); + } + var Tt = 0, + Or, + He, + Ht, + Ct, + Wt, + zt, + Et; + function dr() {} + dr.__reactDisabledLog = !0; + function bn() { + { + if (Tt === 0) { + (Or = console.log), + (He = console.info), + (Ht = console.warn), + (Ct = console.error), + (Wt = console.group), + (zt = console.groupCollapsed), + (Et = console.groupEnd); + var h = { + configurable: !0, + enumerable: !0, + value: dr, + writable: !0, + }; + Object.defineProperties(console, { + info: h, + log: h, + warn: h, + error: h, + group: h, + groupCollapsed: h, + groupEnd: h, + }); + } + Tt++; + } + } + function Sn() { + { + if ((Tt--, Tt === 0)) { + var h = { configurable: !0, enumerable: !0, writable: !0 }; + Object.defineProperties(console, { + log: Le({}, h, { value: Or }), + info: Le({}, h, { value: He }), + warn: Le({}, h, { value: Ht }), + error: Le({}, h, { value: Ct }), + group: Le({}, h, { value: Wt }), + groupCollapsed: Le({}, h, { value: zt }), + groupEnd: Le({}, h, { value: Et }), + }); + } + Tt < 0 && + B( + "disabledDepth fell below zero. This is a bug in React. Please file an issue.", + ); + } + } + var Ee = ft.ReactCurrentDispatcher, + wn; + function Mr(h, b, k) { + { + if (wn === void 0) { + try { + throw Error(); + } catch (I) { + var T = I.stack.trim().match(/\n( *(at )?)/); + wn = (T && T[1]) || ""; + } + } + return ( + ` +` + + wn + + h + ); + } + } + var Lr = !1, + Br; + { + var wo = typeof WeakMap == "function" ? WeakMap : Map; + Br = new wo(); + } + function We(h, b) { + if (!h || Lr) return ""; + { + var k = Br.get(h); + if (k !== void 0) return k; + } + var T; + Lr = !0; + var I = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + var U; + (U = Ee.current), (Ee.current = null), bn(); + try { + if (b) { + var M = function () { + throw Error(); + }; + if ( + (Object.defineProperty(M.prototype, "props", { + set: function () { + throw Error(); + }, + }), + typeof Reflect == "object" && Reflect.construct) + ) { + try { + Reflect.construct(M, []); + } catch (Se) { + T = Se; + } + Reflect.construct(h, [], M); + } else { + try { + M.call(); + } catch (Se) { + T = Se; + } + h.call(M.prototype); + } + } else { + try { + throw Error(); + } catch (Se) { + T = Se; + } + h(); + } + } catch (Se) { + if (Se && T && typeof Se.stack == "string") { + for ( + var H = Se.stack.split(` +`), + z = T.stack.split(` +`), + Y = H.length - 1, + Q = z.length - 1; + Y >= 1 && Q >= 0 && H[Y] !== z[Q]; + ) { + Q--; + } + for (; Y >= 1 && Q >= 0; Y--, Q--) { + if (H[Y] !== z[Q]) { + if (Y !== 1 || Q !== 1) { + do if ((Y--, Q--, Q < 0 || H[Y] !== z[Q])) { + var K = ` +` + H[Y].replace(" at new ", " at "); + return ( + h.displayName && + K.includes("<anonymous>") && + (K = K.replace("<anonymous>", h.displayName)), + typeof h == "function" && Br.set(h, K), + K + ); + } while (Y >= 1 && Q >= 0); + } + break; + } + } + } + } finally { + (Lr = !1), (Ee.current = U), Sn(), (Error.prepareStackTrace = I); + } + var ee = h ? h.displayName || h.name : "", + fe = ee ? Mr(ee) : ""; + return typeof h == "function" && Br.set(h, fe), fe; + } + function Rt(h, b, k) { + return We(h, !1); + } + function ht(h) { + var b = h.prototype; + return !!(b && b.isReactComponent); + } + function $t(h, b, k) { + if (h == null) return ""; + if (typeof h == "function") return We(h, ht(h)); + if (typeof h == "string") return Mr(h); + switch (h) { + case x: + return Mr("Suspense"); + case R: + return Mr("SuspenseList"); + } + if (typeof h == "object") { + switch (h.$$typeof) { + case E: + return Rt(h.render); + case D: + return $t(h.type, b, k); + case V: { + var T = h, + I = T._payload, + U = T._init; + try { + return $t(U(I), b, k); + } catch {} + } + } + } + return ""; + } + var Ce = {}, + rt = ft.ReactDebugCurrentFrame; + function pr(h) { + if (h) { + var b = h._owner, + k = $t(h.type, h._source, b ? b.type : null); + rt.setExtraStackFrame(k); + } else rt.setExtraStackFrame(null); + } + function hr(h, b, k, T, I) { + { + var U = Function.call.bind(ir); + for (var M in h) { + if (U(h, M)) { + var H = void 0; + try { + if (typeof h[M] != "function") { + var z = Error( + (T || "React class") + + ": " + + k + + " type `" + + M + + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + + typeof h[M] + + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.", + ); + throw ((z.name = "Invariant Violation"), z); + } + H = h[M]( + b, + M, + T, + k, + null, + "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED", + ); + } catch (Y) { + H = Y; + } + H && + !(H instanceof Error) && + (pr(I), + B( + "%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", + T || "React class", + k, + M, + typeof H, + ), + pr(null)), + H instanceof Error && + !(H.message in Ce) && + ((Ce[H.message] = !0), + pr(I), + B("Failed %s type: %s", k, H.message), + pr(null)); + } + } + } + } + function It(h) { + if (h) { + var b = h._owner, + k = $t(h.type, h._source, b ? b.type : null); + F(k); + } else F(null); + } + var vr; + vr = !1; + function Ze() { + if (xe.current) { + var h = dt(xe.current.type); + if (h) { + return ( + ` + +Check the render method of \`` + + h + + "`." + ); + } + } + return ""; + } + function _t(h) { + if (h !== void 0) { + var b = h.fileName.replace(/^.*[\\\/]/, ""), + k = h.lineNumber; + return ( + ` + +Check your code at ` + + b + + ":" + + k + + "." + ); + } + return ""; + } + function vt(h) { + return h != null ? _t(h.__source) : ""; + } + var Ur = {}; + function Re(h) { + var b = Ze(); + if (!b) { + var k = typeof h == "string" ? h : h.displayName || h.name; + k && + (b = ` + +Check the top-level render call using <` + + k + + ">."); + } + return b; + } + function Je(h, b) { + if (!(!h._store || h._store.validated || h.key != null)) { + h._store.validated = !0; + var k = Re(b); + if (!Ur[k]) { + Ur[k] = !0; + var T = ""; + h && + h._owner && + h._owner !== xe.current && + (T = " It was passed a child from " + dt(h._owner.type) + "."), + It(h), + B( + 'Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', + k, + T, + ), + It(null); + } + } + } + function xn(h, b) { + if (typeof h == "object") { + if (ye(h)) { + for (var k = 0; k < h.length; k++) { + var T = h[k]; + wt(T) && Je(T, b); + } + } else if (wt(h)) h._store && (h._store.validated = !0); + else if (h) { + var I = P(h); + if (typeof I == "function" && I !== h.entries) { + for (var U = I.call(h), M; !(M = U.next()).done;) { + wt(M.value) && Je(M.value, b); + } + } + } + } + } + function gr(h) { + { + var b = h.type; + if (b == null || typeof b == "string") return; + var k; + if (typeof b == "function") k = b.propTypes; + else if ( + typeof b == "object" && + (b.$$typeof === E || b.$$typeof === D) + ) { + k = b.propTypes; + } else return; + if (k) { + var T = dt(b); + hr(k, h.props, "prop", T, h); + } else if (b.PropTypes !== void 0 && !vr) { + vr = !0; + var I = dt(b); + B( + "Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", + I || "Unknown", + ); + } + typeof b.getDefaultProps == "function" && + !b.getDefaultProps.isReactClassApproved && + B( + "getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.", + ); + } + } + function jr(h) { + { + for (var b = Object.keys(h.props), k = 0; k < b.length; k++) { + var T = b[k]; + if (T !== "children" && T !== "key") { + It(h), + B( + "Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", + T, + ), + It(null); + break; + } + } + h.ref !== null && + (It(h), + B("Invalid attribute `ref` supplied to `React.Fragment`."), + It(null)); + } + } + function kn(h, b, k) { + var T = yo(h); + if (!T) { + var I = ""; + (h === void 0 || + (typeof h == "object" && + h !== null && + Object.keys(h).length === 0)) && + (I += + " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."); + var U = vt(b); + U ? (I += U) : (I += Ze()); + var M; + h === null + ? (M = "null") + : ye(h) + ? (M = "array") + : h !== void 0 && h.$$typeof === n + ? ((M = "<" + (dt(h.type) || "Unknown") + " />"), + (I = + " Did you accidentally export a JSX literal instead of a component?")) + : (M = typeof h), + B( + "React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", + M, + I, + ); + } + var H = ho.apply(this, arguments); + if (H == null) return H; + if (T) for (var z = 2; z < arguments.length; z++) xn(arguments[z], h); + return h === s ? jr(H) : gr(H), H; + } + var Tn = !1; + function xo(h) { + var b = kn.bind(null, h); + return ( + (b.type = h), + Tn || + ((Tn = !0), + Me( + "React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.", + )), + Object.defineProperty(b, "type", { + enumerable: !1, + get: function () { + return ( + Me( + "Factory.type is deprecated. Access the class directly before passing it to createFactory.", + ), + Object.defineProperty(this, "type", { value: h }), + h + ); + }, + }), + b + ); + } + function ko(h, b, k) { + for ( + var T = pn.apply(this, arguments), I = 2; + I < arguments.length; + I++ + ) { + xn(arguments[I], T.type); + } + return gr(T), T; + } + function To(h, b) { + var k = W.transition; + W.transition = {}; + var T = W.transition; + W.transition._updatedFibers = new Set(); + try { + h(); + } finally { + if (((W.transition = k), k === null && T._updatedFibers)) { + var I = T._updatedFibers.size; + I > 10 && + Me( + "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.", + ), T._updatedFibers.clear(); + } + } + } + var Cn = !1, + Pt = null; + function Pa(h) { + if (Pt === null) { + try { + var b = ("require" + Math.random()).slice(0, 7), + k = Bl && Bl[b]; + Pt = k.call(Bl, "timers").setImmediate; + } catch { + Pt = function (I) { + Cn === !1 && + ((Cn = !0), + typeof MessageChannel > "u" && + B( + "This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning.", + )); + var U = new MessageChannel(); + (U.port1.onmessage = I), U.port2.postMessage(void 0); + }; + } + } + return Pt(h); + } + var gt = 0, + Hr = !1; + function Fa(h) { + { + var b = gt; + gt++, q.current === null && (q.current = []); + var k = q.isBatchingLegacy, + T; + try { + if ( + ((q.isBatchingLegacy = !0), + (T = h()), + !k && q.didScheduleLegacyUpdate) + ) { + var I = q.current; + I !== null && ((q.didScheduleLegacyUpdate = !1), Rn(I)); + } + } catch (ee) { + throw (mr(b), ee); + } finally { + q.isBatchingLegacy = k; + } + if ( + T !== null && + typeof T == "object" && + typeof T.then == "function" + ) { + var U = T, + M = !1, + H = { + then: function (ee, fe) { + (M = !0), + U.then( + function (Se) { + mr(b), gt === 0 ? Be(Se, ee, fe) : ee(Se); + }, + function (Se) { + mr(b), fe(Se); + }, + ); + }, + }; + return ( + !Hr && + typeof Promise < "u" && + Promise.resolve() + .then(function () {}) + .then(function () { + M || + ((Hr = !0), + B( + "You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);", + )); + }), H + ); + } else { + var z = T; + if ((mr(b), gt === 0)) { + var Y = q.current; + Y !== null && (Rn(Y), (q.current = null)); + var Q = { + then: function (ee, fe) { + q.current === null + ? ((q.current = []), Be(z, ee, fe)) + : ee(z); + }, + }; + return Q; + } else { + var K = { + then: function (ee, fe) { + ee(z); + }, + }; + return K; + } + } + } + } + function mr(h) { + h !== gt - 1 && + B( + "You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ", + ), (gt = h); + } + function Be(h, b, k) { + { + var T = q.current; + if (T !== null) { + try { + Rn(T), + Pa(function () { + T.length === 0 ? ((q.current = null), b(h)) : Be(h, b, k); + }); + } catch (I) { + k(I); + } + } else b(h); + } + } + var En = !1; + function Rn(h) { + if (!En) { + En = !0; + var b = 0; + try { + for (; b < h.length; b++) { + var k = h[b]; + do k = k(!0); while (k !== null); + } + h.length = 0; + } catch (T) { + throw ((h = h.slice(b + 1)), T); + } finally { + En = !1; + } + } + } + var Aa = kn, + In = ko, + Da = xo, + _n = { map: _r, forEach: ba, count: ya, toArray: mo, only: Ut }; + (N.Children = _n), + (N.Component = re), + (N.Fragment = s), + (N.Profiler = c), + (N.PureComponent = Rr), + (N.StrictMode = v), + (N.Suspense = x), + (N.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ft), + (N.cloneElement = In), + (N.createContext = gn), + (N.createElement = Aa), + (N.createFactory = Da), + (N.createRef = so), + (N.forwardRef = ka), + (N.isValidElement = wt), + (N.lazy = xa), + (N.memo = Ta), + (N.startTransition = To), + (N.unstable_act = Fa), + (N.useCallback = _a), + (N.useContext = be), + (N.useDebugValue = kt), + (N.useDeferredValue = Dr), + (N.useEffect = bo), + (N.useId = fr), + (N.useImperativeHandle = Fr), + (N.useInsertionEffect = So), + (N.useLayoutEffect = Ia), + (N.useMemo = cr), + (N.useReducer = Ea), + (N.useRef = Ra), + (N.useState = Ca), + (N.useSyncExternalStore = yn), + (N.useTransition = Ar), + (N.version = e), + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == + "function" && + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop( + new Error(), + ); + })(); +}); +var ua = an((_v, Nu) => { + "use strict"; + process.env.NODE_ENV === "production" + ? (Nu.exports = Nc()) + : (Nu.exports = Vc()); +}); +var Wf = an((ca) => { + "use strict"; + var pf = ua(), + hp = require("stream"), + qe = Object.prototype.hasOwnProperty, + vp = + /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, + Yc = {}, + Gc = {}; + function hf(e) { + return qe.call(Gc, e) + ? !0 + : qe.call(Yc, e) + ? !1 + : vp.test(e) + ? (Gc[e] = !0) + : ((Yc[e] = !0), !1); + } + function Ge(e, n, i, s, v, c, m) { + (this.acceptsBooleans = n === 2 || n === 3 || n === 4), + (this.attributeName = s), + (this.attributeNamespace = v), + (this.mustUseProperty = i), + (this.propertyName = e), + (this.type = n), + (this.sanitizeURL = c), + (this.removeEmptyString = m); + } + var Fe = {}; + "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style" + .split(" ") + .forEach(function (e) { + Fe[e] = new Ge(e, 0, !1, e, null, !1, !1); + }); + [ + ["acceptCharset", "accept-charset"], + ["className", "class"], + ["htmlFor", "for"], + ["httpEquiv", "http-equiv"], + ].forEach(function (e) { + var n = e[0]; + Fe[n] = new Ge(n, 1, !1, e[1], null, !1, !1); + }); + ["contentEditable", "draggable", "spellCheck", "value"].forEach(function (e) { + Fe[e] = new Ge(e, 2, !1, e.toLowerCase(), null, !1, !1); + }); + [ + "autoReverse", + "externalResourcesRequired", + "focusable", + "preserveAlpha", + ].forEach(function (e) { + Fe[e] = new Ge(e, 2, !1, e, null, !1, !1); + }); + "allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope" + .split(" ") + .forEach(function (e) { + Fe[e] = new Ge(e, 3, !1, e.toLowerCase(), null, !1, !1); + }); + ["checked", "multiple", "muted", "selected"].forEach(function (e) { + Fe[e] = new Ge(e, 3, !0, e, null, !1, !1); + }); + ["capture", "download"].forEach(function (e) { + Fe[e] = new Ge(e, 4, !1, e, null, !1, !1); + }); + ["cols", "rows", "size", "span"].forEach(function (e) { + Fe[e] = new Ge(e, 6, !1, e, null, !1, !1); + }); + ["rowSpan", "start"].forEach(function (e) { + Fe[e] = new Ge(e, 5, !1, e.toLowerCase(), null, !1, !1); + }); + var qu = /[\-:]([a-z])/g; + function ec(e) { + return e[1].toUpperCase(); + } + "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height" + .split(" ") + .forEach(function (e) { + var n = e.replace(qu, ec); + Fe[n] = new Ge(n, 1, !1, e, null, !1, !1); + }); + "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type" + .split(" ") + .forEach(function (e) { + var n = e.replace(qu, ec); + Fe[n] = new Ge(n, 1, !1, e, "http://www.w3.org/1999/xlink", !1, !1); + }); + ["xml:base", "xml:lang", "xml:space"].forEach(function (e) { + var n = e.replace(qu, ec); + Fe[n] = new Ge(n, 1, !1, e, "http://www.w3.org/XML/1998/namespace", !1, !1); + }); + ["tabIndex", "crossOrigin"].forEach(function (e) { + Fe[e] = new Ge(e, 1, !1, e.toLowerCase(), null, !1, !1); + }); + Fe.xlinkHref = new Ge( + "xlinkHref", + 1, + !1, + "xlink:href", + "http://www.w3.org/1999/xlink", + !0, + !1, + ); + ["src", "href", "action", "formAction"].forEach(function (e) { + Fe[e] = new Ge(e, 1, !1, e.toLowerCase(), null, !0, !0); + }); + var Hl = { + animationIterationCount: !0, + aspectRatio: !0, + borderImageOutset: !0, + borderImageSlice: !0, + borderImageWidth: !0, + boxFlex: !0, + boxFlexGroup: !0, + boxOrdinalGroup: !0, + columnCount: !0, + columns: !0, + flex: !0, + flexGrow: !0, + flexPositive: !0, + flexShrink: !0, + flexNegative: !0, + flexOrder: !0, + gridArea: !0, + gridRow: !0, + gridRowEnd: !0, + gridRowSpan: !0, + gridRowStart: !0, + gridColumn: !0, + gridColumnEnd: !0, + gridColumnSpan: !0, + gridColumnStart: !0, + fontWeight: !0, + lineClamp: !0, + lineHeight: !0, + opacity: !0, + order: !0, + orphans: !0, + tabSize: !0, + widows: !0, + zIndex: !0, + zoom: !0, + fillOpacity: !0, + floodOpacity: !0, + stopOpacity: !0, + strokeDasharray: !0, + strokeDashoffset: !0, + strokeMiterlimit: !0, + strokeOpacity: !0, + strokeWidth: !0, + }, + gp = ["Webkit", "ms", "Moz", "O"]; + Object.keys(Hl).forEach(function (e) { + gp.forEach(function (n) { + (n = n + e.charAt(0).toUpperCase() + e.substring(1)), (Hl[n] = Hl[e]); + }); + }); + var mp = /["'&<>]/; + function Ye(e) { + if (typeof e == "boolean" || typeof e == "number") return "" + e; + e = "" + e; + var n = mp.exec(e); + if (n) { + var i = "", + s, + v = 0; + for (s = n.index; s < e.length; s++) { + switch (e.charCodeAt(s)) { + case 34: + n = """; + break; + case 38: + n = "&"; + break; + case 39: + n = "'"; + break; + case 60: + n = "<"; + break; + case 62: + n = ">"; + break; + default: + continue; + } + v !== s && (i += e.substring(v, s)), (v = s + 1), (i += n); + } + e = v !== s ? i + e.substring(v, s) : i; + } + return e; + } + var yp = /([A-Z])/g, + bp = /^ms-/, + Xu = Array.isArray; + function xr(e, n) { + return { insertionMode: e, selectedValue: n }; + } + function Sp(e, n, i) { + switch (n) { + case "select": + return xr(1, i.value != null ? i.value : i.defaultValue); + case "svg": + return xr(2, null); + case "math": + return xr(3, null); + case "foreignObject": + return xr(1, null); + case "table": + return xr(4, null); + case "thead": + case "tbody": + case "tfoot": + return xr(5, null); + case "colgroup": + return xr(7, null); + case "tr": + return xr(6, null); + } + return 4 <= e.insertionMode || e.insertionMode === 0 ? xr(1, null) : e; + } + var Xc = new Map(); + function vf(e, n, i) { + if (typeof i != "object") { + throw Error( + "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.", + ); + } + n = !0; + for (var s in i) { + if (qe.call(i, s)) { + var v = i[s]; + if (v != null && typeof v != "boolean" && v !== "") { + if (s.indexOf("--") === 0) { + var c = Ye(s); + v = Ye(("" + v).trim()); + } else { + c = s; + var m = Xc.get(c); + m !== void 0 || + ((m = Ye(c.replace(yp, "-$1").toLowerCase().replace(bp, "-ms-"))), + Xc.set(c, m)), + (c = m), + (v = typeof v == "number" + ? v === 0 || qe.call(Hl, s) ? "" + v : v + "px" + : Ye(("" + v).trim())); + } + n + ? ((n = !1), e.push(' style="', c, ":", v)) + : e.push(";", c, ":", v); + } + } + } + n || e.push('"'); + } + function it(e, n, i, s) { + switch (i) { + case "style": + vf(e, n, s); + return; + case "defaultValue": + case "defaultChecked": + case "innerHTML": + case "suppressContentEditableWarning": + case "suppressHydrationWarning": + return; + } + if ( + !(2 < i.length) || + (i[0] !== "o" && i[0] !== "O") || + (i[1] !== "n" && i[1] !== "N") + ) { + if (((n = Fe.hasOwnProperty(i) ? Fe[i] : null), n !== null)) { + switch (typeof s) { + case "function": + case "symbol": + return; + case "boolean": + if (!n.acceptsBooleans) return; + } + switch (((i = n.attributeName), n.type)) { + case 3: + s && e.push(" ", i, '=""'); + break; + case 4: + s === !0 + ? e.push(" ", i, '=""') + : s !== !1 && e.push(" ", i, '="', Ye(s), '"'); + break; + case 5: + isNaN(s) || e.push(" ", i, '="', Ye(s), '"'); + break; + case 6: + !isNaN(s) && 1 <= s && e.push(" ", i, '="', Ye(s), '"'); + break; + default: + n.sanitizeURL && (s = "" + s), e.push(" ", i, '="', Ye(s), '"'); + } + } else if (hf(i)) { + switch (typeof s) { + case "function": + case "symbol": + return; + case "boolean": + if ( + ((n = i.toLowerCase().slice(0, 5)), + n !== "data-" && n !== "aria-") + ) { + return; + } + } + e.push(" ", i, '="', Ye(s), '"'); + } + } + } + function Wl(e, n, i) { + if (n != null) { + if (i != null) { + throw Error( + "Can only set one of `children` or `props.dangerouslySetInnerHTML`.", + ); + } + if (typeof n != "object" || !("__html" in n)) { + throw Error( + "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.", + ); + } + (n = n.__html), n != null && e.push("" + n); + } + } + function wp(e) { + var n = ""; + return ( + pf.Children.forEach(e, function (i) { + i != null && (n += i); + }), n + ); + } + function Vu(e, n, i, s) { + e.push(Jt(i)); + var v = (i = null), + c; + for (c in n) { + if (qe.call(n, c)) { + var m = n[c]; + if (m != null) { + switch (c) { + case "children": + i = m; + break; + case "dangerouslySetInnerHTML": + v = m; + break; + default: + it(e, s, c, m); + } + } + } + } + return ( + e.push(">"), Wl(e, v, i), typeof i == "string" ? (e.push(Ye(i)), null) : i + ); + } + var xp = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/, + Zc = new Map(); + function Jt(e) { + var n = Zc.get(e); + if (n === void 0) { + if (!xp.test(e)) throw Error("Invalid tag: " + e); + (n = "<" + e), Zc.set(e, n); + } + return n; + } + function kp(e, n, i, s, v) { + switch (n) { + case "select": + e.push(Jt("select")); + var c = null, + m = null; + for (R in i) { + if (qe.call(i, R)) { + var S = i[R]; + if (S != null) { + switch (R) { + case "children": + c = S; + break; + case "dangerouslySetInnerHTML": + m = S; + break; + case "defaultValue": + case "value": + break; + default: + it(e, s, R, S); + } + } + } + } + return e.push(">"), Wl(e, m, c), c; + case "option": + (m = v.selectedValue), e.push(Jt("option")); + var E = (S = null), + x = null, + R = null; + for (c in i) { + if (qe.call(i, c)) { + var D = i[c]; + if (D != null) { + switch (c) { + case "children": + S = D; + break; + case "selected": + x = D; + break; + case "dangerouslySetInnerHTML": + R = D; + break; + case "value": + E = D; + default: + it(e, s, c, D); + } + } + } + } + if (m != null) { + if (((i = E !== null ? "" + E : wp(S)), Xu(m))) { + for (s = 0; s < m.length; s++) { + if ("" + m[s] === i) { + e.push(' selected=""'); + break; + } + } + } else "" + m === i && e.push(' selected=""'); + } else x && e.push(' selected=""'); + return e.push(">"), Wl(e, R, S), S; + case "textarea": + e.push(Jt("textarea")), (R = m = c = null); + for (S in i) { + if (qe.call(i, S) && ((E = i[S]), E != null)) { + switch (S) { + case "children": + R = E; + break; + case "value": + c = E; + break; + case "defaultValue": + m = E; + break; + case "dangerouslySetInnerHTML": + throw Error( + "`dangerouslySetInnerHTML` does not make sense on <textarea>.", + ); + default: + it(e, s, S, E); + } + } + } + if ((c === null && m !== null && (c = m), e.push(">"), R != null)) { + if (c != null) { + throw Error( + "If you supply `defaultValue` on a <textarea>, do not pass children.", + ); + } + if (Xu(R) && 1 < R.length) { + throw Error("<textarea> can only have at most one child."); + } + c = "" + R; + } + return ( + typeof c == "string" && + c[0] === + ` +` && + e.push(` +`), + c !== null && e.push(Ye("" + c)), + null + ); + case "input": + e.push(Jt("input")), + (E = + R = + S = + c = + null); + for (m in i) { + if (qe.call(i, m) && ((x = i[m]), x != null)) { + switch (m) { + case "children": + case "dangerouslySetInnerHTML": + throw Error( + "input is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.", + ); + case "defaultChecked": + E = x; + break; + case "defaultValue": + S = x; + break; + case "checked": + R = x; + break; + case "value": + c = x; + break; + default: + it(e, s, m, x); + } + } + } + return ( + R !== null + ? it(e, s, "checked", R) + : E !== null && it(e, s, "checked", E), + c !== null + ? it(e, s, "value", c) + : S !== null && it(e, s, "value", S), + e.push("/>"), + null + ); + case "menuitem": + e.push(Jt("menuitem")); + for (var V in i) { + if (qe.call(i, V) && ((c = i[V]), c != null)) { + switch (V) { + case "children": + case "dangerouslySetInnerHTML": + throw Error( + "menuitems cannot have `children` nor `dangerouslySetInnerHTML`.", + ); + default: + it(e, s, V, c); + } + } + } + return e.push(">"), null; + case "title": + e.push(Jt("title")), (c = null); + for (D in i) { + if (qe.call(i, D) && ((m = i[D]), m != null)) { + switch (D) { + case "children": + c = m; + break; + case "dangerouslySetInnerHTML": + throw Error( + "`dangerouslySetInnerHTML` does not make sense on <title>.", + ); + default: + it(e, s, D, m); + } + } + } + return e.push(">"), c; + case "listing": + case "pre": + e.push(Jt(n)), (m = c = null); + for (E in i) { + if (qe.call(i, E) && ((S = i[E]), S != null)) { + switch (E) { + case "children": + c = S; + break; + case "dangerouslySetInnerHTML": + m = S; + break; + default: + it(e, s, E, S); + } + } + } + if ((e.push(">"), m != null)) { + if (c != null) { + throw Error( + "Can only set one of `children` or `props.dangerouslySetInnerHTML`.", + ); + } + if (typeof m != "object" || !("__html" in m)) { + throw Error( + "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.", + ); + } + (i = m.__html), + i != null && + (typeof i == "string" && + 0 < i.length && + i[0] === + ` +` + ? e.push( + ` +`, + i, + ) + : e.push("" + i)); + } + return ( + typeof c == "string" && + c[0] === + ` +` && + e.push(` +`), c + ); + case "area": + case "base": + case "br": + case "col": + case "embed": + case "hr": + case "img": + case "keygen": + case "link": + case "meta": + case "param": + case "source": + case "track": + case "wbr": + e.push(Jt(n)); + for (var te in i) { + if (qe.call(i, te) && ((c = i[te]), c != null)) { + switch (te) { + case "children": + case "dangerouslySetInnerHTML": + throw Error( + n + + " is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.", + ); + default: + it(e, s, te, c); + } + } + } + return e.push("/>"), null; + case "annotation-xml": + case "color-profile": + case "font-face": + case "font-face-src": + case "font-face-uri": + case "font-face-format": + case "font-face-name": + case "missing-glyph": + return Vu(e, i, n, s); + case "html": + return ( + v.insertionMode === 0 && e.push("<!DOCTYPE html>"), Vu(e, i, n, s) + ); + default: + if (n.indexOf("-") === -1 && typeof i.is != "string") { + return Vu(e, i, n, s); + } + e.push(Jt(n)), (m = c = null); + for (x in i) { + if (qe.call(i, x) && ((S = i[x]), S != null)) { + switch (x) { + case "children": + c = S; + break; + case "dangerouslySetInnerHTML": + m = S; + break; + case "style": + vf(e, s, S); + break; + case "suppressContentEditableWarning": + case "suppressHydrationWarning": + break; + default: + hf(x) && + typeof S != "function" && + typeof S != "symbol" && + e.push(" ", x, '="', Ye(S), '"'); + } + } + } + return e.push(">"), Wl(e, m, c), c; + } + } + function Jc(e, n, i) { + if ((e.push('<!--$?--><template id="'), i === null)) { + throw Error( + "An ID must have been assigned before we can complete the boundary.", + ); + } + return e.push(i), e.push('"></template>'); + } + function Tp(e, n, i, s) { + switch (i.insertionMode) { + case 0: + case 1: + return ( + e.push('<div hidden id="'), + e.push(n.segmentPrefix), + (n = s.toString(16)), + e.push(n), + e.push('">') + ); + case 2: + return ( + e.push('<svg aria-hidden="true" style="display:none" id="'), + e.push(n.segmentPrefix), + (n = s.toString(16)), + e.push(n), + e.push('">') + ); + case 3: + return ( + e.push('<math aria-hidden="true" style="display:none" id="'), + e.push(n.segmentPrefix), + (n = s.toString(16)), + e.push(n), + e.push('">') + ); + case 4: + return ( + e.push('<table hidden id="'), + e.push(n.segmentPrefix), + (n = s.toString(16)), + e.push(n), + e.push('">') + ); + case 5: + return ( + e.push('<table hidden><tbody id="'), + e.push(n.segmentPrefix), + (n = s.toString(16)), + e.push(n), + e.push('">') + ); + case 6: + return ( + e.push('<table hidden><tr id="'), + e.push(n.segmentPrefix), + (n = s.toString(16)), + e.push(n), + e.push('">') + ); + case 7: + return ( + e.push('<table hidden><colgroup id="'), + e.push(n.segmentPrefix), + (n = s.toString(16)), + e.push(n), + e.push('">') + ); + default: + throw Error("Unknown insertion mode. This is a bug in React."); + } + } + function Cp(e, n) { + switch (n.insertionMode) { + case 0: + case 1: + return e.push("</div>"); + case 2: + return e.push("</svg>"); + case 3: + return e.push("</math>"); + case 4: + return e.push("</table>"); + case 5: + return e.push("</tbody></table>"); + case 6: + return e.push("</tr></table>"); + case 7: + return e.push("</colgroup></table>"); + default: + throw Error("Unknown insertion mode. This is a bug in React."); + } + } + var Ep = /[<\u2028\u2029]/g; + function Yu(e) { + return JSON.stringify(e).replace(Ep, function (n) { + switch (n) { + case "<": + return "\\u003c"; + case "\u2028": + return "\\u2028"; + case "\u2029": + return "\\u2029"; + default: + throw Error( + "escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React", + ); + } + }); + } + function gf(e, n) { + return ( + (n = n === void 0 ? "" : n), { + bootstrapChunks: [], + startInlineScript: "<script>", + placeholderPrefix: n + "P:", + segmentPrefix: n + "S:", + boundaryPrefix: n + "B:", + idPrefix: n, + nextSuspenseID: 0, + sentCompleteSegmentFunction: !1, + sentCompleteBoundaryFunction: !1, + sentClientRenderFunction: !1, + generateStaticMarkup: e, + } + ); + } + function mf() { + return { insertionMode: 1, selectedValue: null }; + } + function Qc(e, n, i, s) { + return i.generateStaticMarkup + ? (e.push(Ye(n)), !1) + : (n === "" + ? (e = s) + : (s && e.push("<!-- -->"), e.push(Ye(n)), (e = !0)), + e); + } + var Mi = Object.assign, + Rp = Symbol.for("react.element"), + yf = Symbol.for("react.portal"), + bf = Symbol.for("react.fragment"), + Sf = Symbol.for("react.strict_mode"), + wf = Symbol.for("react.profiler"), + xf = Symbol.for("react.provider"), + kf = Symbol.for("react.context"), + Tf = Symbol.for("react.forward_ref"), + Cf = Symbol.for("react.suspense"), + Ef = Symbol.for("react.suspense_list"), + Rf = Symbol.for("react.memo"), + tc = Symbol.for("react.lazy"), + Ip = Symbol.for("react.scope"), + _p = Symbol.for("react.debug_trace_mode"), + Pp = Symbol.for("react.legacy_hidden"), + Fp = Symbol.for("react.default_value"), + Kc = Symbol.iterator; + function Zu(e) { + if (e == null) return null; + if (typeof e == "function") return e.displayName || e.name || null; + if (typeof e == "string") return e; + switch (e) { + case bf: + return "Fragment"; + case yf: + return "Portal"; + case wf: + return "Profiler"; + case Sf: + return "StrictMode"; + case Cf: + return "Suspense"; + case Ef: + return "SuspenseList"; + } + if (typeof e == "object") { + switch (e.$$typeof) { + case kf: + return (e.displayName || "Context") + ".Consumer"; + case xf: + return (e._context.displayName || "Context") + ".Provider"; + case Tf: + var n = e.render; + return ( + (e = e.displayName), + e || + ((e = n.displayName || n.name || ""), + (e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef")), + e + ); + case Rf: + return ( + (n = e.displayName || null), n !== null ? n : Zu(e.type) || "Memo" + ); + case tc: + (n = e._payload), (e = e._init); + try { + return Zu(e(n)); + } catch {} + } + } + return null; + } + var If = {}; + function qc(e, n) { + if (((e = e.contextTypes), !e)) return If; + var i = {}, + s; + for (s in e) i[s] = n[s]; + return i; + } + var ro = null; + function Jl(e, n) { + if (e !== n) { + (e.context._currentValue2 = e.parentValue), (e = e.parent); + var i = n.parent; + if (e === null) { + if (i !== null) { + throw Error( + "The stacks must reach the root at the same time. This is a bug in React.", + ); + } + } else { + if (i === null) { + throw Error( + "The stacks must reach the root at the same time. This is a bug in React.", + ); + } + Jl(e, i); + } + n.context._currentValue2 = n.value; + } + } + function _f(e) { + (e.context._currentValue2 = e.parentValue), + (e = e.parent), + e !== null && _f(e); + } + function Pf(e) { + var n = e.parent; + n !== null && Pf(n), (e.context._currentValue2 = e.value); + } + function Ff(e, n) { + if ( + ((e.context._currentValue2 = e.parentValue), (e = e.parent), e === null) + ) { + throw Error( + "The depth must equal at least at zero before reaching the root. This is a bug in React.", + ); + } + e.depth === n.depth ? Jl(e, n) : Ff(e, n); + } + function Af(e, n) { + var i = n.parent; + if (i === null) { + throw Error( + "The depth must equal at least at zero before reaching the root. This is a bug in React.", + ); + } + e.depth === i.depth ? Jl(e, i) : Af(e, i), + (n.context._currentValue2 = n.value); + } + function Vl(e) { + var n = ro; + n !== e && + (n === null + ? Pf(e) + : e === null + ? _f(n) + : n.depth === e.depth + ? Jl(n, e) + : n.depth > e.depth + ? Ff(n, e) + : Af(n, e), + (ro = e)); + } + var ef = { + isMounted: function () { + return !1; + }, + enqueueSetState: function (e, n) { + (e = e._reactInternals), e.queue !== null && e.queue.push(n); + }, + enqueueReplaceState: function (e, n) { + (e = e._reactInternals), (e.replace = !0), (e.queue = [n]); + }, + enqueueForceUpdate: function () {}, + }; + function tf(e, n, i, s) { + var v = e.state !== void 0 ? e.state : null; + (e.updater = ef), (e.props = i), (e.state = v); + var c = { queue: [], replace: !1 }; + e._reactInternals = c; + var m = n.contextType; + if ( + ((e.context = typeof m == "object" && m !== null ? m._currentValue2 : s), + (m = n.getDerivedStateFromProps), + typeof m == "function" && + ((m = m(i, v)), (v = m == null ? v : Mi({}, v, m)), (e.state = v)), + typeof n.getDerivedStateFromProps != "function" && + typeof e.getSnapshotBeforeUpdate != "function" && + (typeof e.UNSAFE_componentWillMount == "function" || + typeof e.componentWillMount == "function")) + ) { + if ( + ((n = e.state), + typeof e.componentWillMount == "function" && e.componentWillMount(), + typeof e.UNSAFE_componentWillMount == "function" && + e.UNSAFE_componentWillMount(), + n !== e.state && ef.enqueueReplaceState(e, e.state, null), + c.queue !== null && 0 < c.queue.length) + ) { + if ( + ((n = c.queue), + (m = c.replace), + (c.queue = null), + (c.replace = !1), + m && n.length === 1) + ) { + e.state = n[0]; + } else { + for ( + c = m ? n[0] : e.state, v = !0, m = m ? 1 : 0; + m < n.length; + m++ + ) { + var S = n[m]; + (S = typeof S == "function" ? S.call(e, c, i, s) : S), + S != null && (v ? ((v = !1), (c = Mi({}, c, S))) : Mi(c, S)); + } + e.state = c; + } + } else c.queue = null; + } + } + var Ap = { id: 1, overflow: "" }; + function Ju(e, n, i) { + var s = e.id; + e = e.overflow; + var v = 32 - zl(s) - 1; + (s &= ~(1 << v)), (i += 1); + var c = 32 - zl(n) + v; + if (30 < c) { + var m = v - (v % 5); + return ( + (c = (s & ((1 << m) - 1)).toString(32)), + (s >>= m), + (v -= m), + { id: (1 << (32 - zl(n) + v)) | (i << v) | s, overflow: c + e } + ); + } + return { id: (1 << c) | (i << v) | s, overflow: e }; + } + var zl = Math.clz32 ? Math.clz32 : Mp, + Dp = Math.log, + Op = Math.LN2; + function Mp(e) { + return (e >>>= 0), e === 0 ? 32 : (31 - ((Dp(e) / Op) | 0)) | 0; + } + function Lp(e, n) { + return (e === n && (e !== 0 || 1 / e === 1 / n)) || (e !== e && n !== n); + } + var Bp = typeof Object.is == "function" ? Object.is : Lp, + kr = null, + rc = null, + $l = null, + oe = null, + Di = !1, + Yl = !1, + Li = 0, + ln = null, + Ql = 0; + function to() { + if (kr === null) { + throw Error( + `Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: +1. You might have mismatching versions of React and the renderer (such as React DOM) +2. You might be breaking the Rules of Hooks +3. You might have more than one copy of React in the same app +See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`, + ); + } + return kr; + } + function rf() { + if (0 < Ql) { + throw Error("Rendered more hooks than during the previous render"); + } + return { memoizedState: null, queue: null, next: null }; + } + function nc() { + return ( + oe === null + ? $l === null ? ((Di = !1), ($l = oe = rf())) : ((Di = !0), (oe = $l)) + : oe.next === null + ? ((Di = !1), (oe = oe.next = rf())) + : ((Di = !0), (oe = oe.next)), oe + ); + } + function oc() { + (rc = kr = null), (Yl = !1), ($l = null), (Ql = 0), (oe = ln = null); + } + function Df(e, n) { + return typeof n == "function" ? n(e) : n; + } + function nf(e, n, i) { + if (((kr = to()), (oe = nc()), Di)) { + var s = oe.queue; + if (((n = s.dispatch), ln !== null && ((i = ln.get(s)), i !== void 0))) { + ln.delete(s), (s = oe.memoizedState); + do (s = e(s, i.action)), (i = i.next); while (i !== null); + return (oe.memoizedState = s), [s, n]; + } + return [oe.memoizedState, n]; + } + return ( + (e = e === Df + ? typeof n == "function" ? n() : n + : i !== void 0 + ? i(n) + : n), + (oe.memoizedState = e), + (e = oe.queue = { last: null, dispatch: null }), + (e = e.dispatch = Up.bind(null, kr, e)), + [oe.memoizedState, e] + ); + } + function of(e, n) { + if ( + ((kr = to()), (oe = nc()), (n = n === void 0 ? null : n), oe !== null) + ) { + var i = oe.memoizedState; + if (i !== null && n !== null) { + var s = i[1]; + e: + if (s === null) s = !1; + else { + for (var v = 0; v < s.length && v < n.length; v++) { + if (!Bp(n[v], s[v])) { + s = !1; + break e; + } + } + s = !0; + } + if (s) return i[0]; + } + } + return (e = e()), (oe.memoizedState = [e, n]), e; + } + function Up(e, n, i) { + if (25 <= Ql) { + throw Error( + "Too many re-renders. React limits the number of renders to prevent an infinite loop.", + ); + } + if (e === kr) { + if ( + ((Yl = !0), + (e = { action: i, next: null }), + ln === null && (ln = new Map()), + (i = ln.get(n)), + i === void 0) + ) { + ln.set(n, e); + } else { + for (n = i; n.next !== null;) n = n.next; + n.next = e; + } + } + } + function jp() { + throw Error("startTransition cannot be called during server rendering."); + } + function Ul() {} + var af = { + readContext: function (e) { + return e._currentValue2; + }, + useContext: function (e) { + return to(), e._currentValue2; + }, + useMemo: of, + useReducer: nf, + useRef: function (e) { + (kr = to()), (oe = nc()); + var n = oe.memoizedState; + return n === null ? ((e = { current: e }), (oe.memoizedState = e)) : n; + }, + useState: function (e) { + return nf(Df, e); + }, + useInsertionEffect: Ul, + useLayoutEffect: function () {}, + useCallback: function (e, n) { + return of(function () { + return e; + }, n); + }, + useImperativeHandle: Ul, + useEffect: Ul, + useDebugValue: Ul, + useDeferredValue: function (e) { + return to(), e; + }, + useTransition: function () { + return to(), [!1, jp]; + }, + useId: function () { + var e = rc.treeContext, + n = e.overflow; + (e = e.id), (e = (e & ~(1 << (32 - zl(e) - 1))).toString(32) + n); + var i = Nl; + if (i === null) { + throw Error( + "Invalid hook call. Hooks can only be called inside of the body of a function component.", + ); + } + return ( + (n = Li++), + (e = ":" + i.idPrefix + "R" + e), + 0 < n && (e += "H" + n.toString(32)), + e + ":" + ); + }, + useMutableSource: function (e, n) { + return to(), n(e._source); + }, + useSyncExternalStore: function (e, n, i) { + if (i === void 0) { + throw Error( + "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.", + ); + } + return i(); + }, + }, + Nl = null, + Gu = pf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED + .ReactCurrentDispatcher; + function Hp(e) { + return console.error(e), null; + } + function Oi() {} + function Of(e, n, i, s, v, c, m, S, E) { + var x = [], + R = new Set(); + return ( + (n = { + destination: null, + responseState: n, + progressiveChunkSize: s === void 0 ? 12800 : s, + status: 0, + fatalError: null, + nextSegmentId: 0, + allPendingTasks: 0, + pendingRootTasks: 0, + completedRootSegment: null, + abortableTasks: R, + pingedTasks: x, + clientRenderedBoundaries: [], + completedBoundaries: [], + partialBoundaries: [], + onError: v === void 0 ? Hp : v, + onAllReady: c === void 0 ? Oi : c, + onShellReady: m === void 0 ? Oi : m, + onShellError: S === void 0 ? Oi : S, + onFatalError: E === void 0 ? Oi : E, + }), + (i = Gl(n, 0, null, i, !1, !1)), + (i.parentFlushed = !0), + (e = ac(n, e, null, i, R, If, null, Ap)), + x.push(e), + n + ); + } + function ac(e, n, i, s, v, c, m, S) { + e.allPendingTasks++, i === null ? e.pendingRootTasks++ : i.pendingTasks++; + var E = { + node: n, + ping: function () { + var x = e.pingedTasks; + x.push(E), x.length === 1 && ic(e); + }, + blockedBoundary: i, + blockedSegment: s, + abortSet: v, + legacyContext: c, + context: m, + treeContext: S, + }; + return v.add(E), E; + } + function Gl(e, n, i, s, v, c) { + return { + status: 0, + id: -1, + index: n, + parentFlushed: !1, + chunks: [], + children: [], + formatContext: s, + boundary: i, + lastPushedText: v, + textEmbedded: c, + }; + } + function Bi(e, n) { + if (((e = e.onError(n)), e != null && typeof e != "string")) { + throw Error( + 'onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "' + + typeof e + + '" instead', + ); + } + return e; + } + function Xl(e, n) { + var i = e.onShellError; + i(n), + (i = e.onFatalError), + i(n), + e.destination !== null + ? ((e.status = 2), e.destination.destroy(n)) + : ((e.status = 1), (e.fatalError = n)); + } + function lf(e, n, i, s, v) { + for (kr = {}, rc = n, Li = 0, e = i(s, v); Yl;) { + (Yl = !1), (Li = 0), (Ql += 1), (oe = null), (e = i(s, v)); + } + return oc(), e; + } + function sf(e, n, i, s) { + var v = i.render(), + c = s.childContextTypes; + if (c != null) { + var m = n.legacyContext; + if (typeof i.getChildContext != "function") s = m; + else { + i = i.getChildContext(); + for (var S in i) { + if (!(S in c)) { + throw Error( + (Zu(s) || "Unknown") + + '.getChildContext(): key "' + + S + + '" is not defined in childContextTypes.', + ); + } + } + s = Mi({}, m, i); + } + (n.legacyContext = s), lt(e, n, v), (n.legacyContext = m); + } else lt(e, n, v); + } + function uf(e, n) { + if (e && e.defaultProps) { + (n = Mi({}, n)), (e = e.defaultProps); + for (var i in e) n[i] === void 0 && (n[i] = e[i]); + return n; + } + return n; + } + function Qu(e, n, i, s, v) { + if (typeof i == "function") { + if (i.prototype && i.prototype.isReactComponent) { + v = qc(i, n.legacyContext); + var c = i.contextType; + (c = new i( + s, + typeof c == "object" && c !== null ? c._currentValue2 : v, + )), + tf(c, i, s, v), + sf(e, n, c, i); + } else { + (c = qc(i, n.legacyContext)), (v = lf(e, n, i, s, c)); + var m = Li !== 0; + if ( + typeof v == "object" && + v !== null && + typeof v.render == "function" && + v.$$typeof === void 0 + ) { + tf(v, i, s, c), sf(e, n, v, i); + } else if (m) { + (s = n.treeContext), (n.treeContext = Ju(s, 1, 0)); + try { + lt(e, n, v); + } finally { + n.treeContext = s; + } + } else lt(e, n, v); + } + } else if (typeof i == "string") { + switch ( + ((v = n.blockedSegment), + (c = kp(v.chunks, i, s, e.responseState, v.formatContext)), + (v.lastPushedText = !1), + (m = v.formatContext), + (v.formatContext = Sp(m, i, s)), + Ku(e, n, c), + (v.formatContext = m), + i) + ) { + case "area": + case "base": + case "br": + case "col": + case "embed": + case "hr": + case "img": + case "input": + case "keygen": + case "link": + case "meta": + case "param": + case "source": + case "track": + case "wbr": + break; + default: + v.chunks.push("</", i, ">"); + } + v.lastPushedText = !1; + } else { + switch (i) { + case Pp: + case _p: + case Sf: + case wf: + case bf: + lt(e, n, s.children); + return; + case Ef: + lt(e, n, s.children); + return; + case Ip: + throw Error("ReactDOMServer does not yet support scope components."); + case Cf: + e: { + (i = n.blockedBoundary), + (v = n.blockedSegment), + (c = s.fallback), + (s = s.children), + (m = new Set()); + var S = { + id: null, + rootSegmentID: -1, + parentFlushed: !1, + pendingTasks: 0, + forceClientRender: !1, + completedSegments: [], + byteSize: 0, + fallbackAbortableTasks: m, + errorDigest: null, + }, + E = Gl(e, v.chunks.length, S, v.formatContext, !1, !1); + v.children.push(E), (v.lastPushedText = !1); + var x = Gl(e, 0, null, v.formatContext, !1, !1); + (x.parentFlushed = !0), + (n.blockedBoundary = S), + (n.blockedSegment = x); + try { + if ( + (Ku(e, n, s), + e.responseState.generateStaticMarkup || + (x.lastPushedText && + x.textEmbedded && + x.chunks.push("<!-- -->")), + (x.status = 1), + Zl(S, x), + S.pendingTasks === 0) + ) { + break e; + } + } catch (R) { + (x.status = 4), + (S.forceClientRender = !0), + (S.errorDigest = Bi(e, R)); + } finally { + (n.blockedBoundary = i), (n.blockedSegment = v); + } + (n = ac(e, c, i, E, m, n.legacyContext, n.context, n.treeContext)), + e.pingedTasks.push(n); + } + return; + } + if (typeof i == "object" && i !== null) { + switch (i.$$typeof) { + case Tf: + if (((s = lf(e, n, i.render, s, v)), Li !== 0)) { + (i = n.treeContext), (n.treeContext = Ju(i, 1, 0)); + try { + lt(e, n, s); + } finally { + n.treeContext = i; + } + } else lt(e, n, s); + return; + case Rf: + (i = i.type), (s = uf(i, s)), Qu(e, n, i, s, v); + return; + case xf: + if ( + ((v = s.children), + (i = i._context), + (s = s.value), + (c = i._currentValue2), + (i._currentValue2 = s), + (m = ro), + (ro = + s = + { + parent: m, + depth: m === null ? 0 : m.depth + 1, + context: i, + parentValue: c, + value: s, + }), + (n.context = s), + lt(e, n, v), + (e = ro), + e === null) + ) { + throw Error( + "Tried to pop a Context at the root of the app. This is a bug in React.", + ); + } + (s = e.parentValue), + (e.context._currentValue2 = s === Fp + ? e.context._defaultValue + : s), + (e = ro = e.parent), + (n.context = e); + return; + case kf: + (s = s.children), (s = s(i._currentValue2)), lt(e, n, s); + return; + case tc: + (v = i._init), + (i = v(i._payload)), + (s = uf(i, s)), + Qu(e, n, i, s, void 0); + return; + } + } + throw Error( + "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + + ((i == null ? i : typeof i) + "."), + ); + } + } + function lt(e, n, i) { + if (((n.node = i), typeof i == "object" && i !== null)) { + switch (i.$$typeof) { + case Rp: + Qu(e, n, i.type, i.props, i.ref); + return; + case yf: + throw Error( + "Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render.", + ); + case tc: + var s = i._init; + (i = s(i._payload)), lt(e, n, i); + return; + } + if (Xu(i)) { + cf(e, n, i); + return; + } + if ( + (i === null || typeof i != "object" + ? (s = null) + : ((s = (Kc && i[Kc]) || i["@@iterator"]), + (s = typeof s == "function" ? s : null)), + s && (s = s.call(i))) + ) { + if (((i = s.next()), !i.done)) { + var v = []; + do v.push(i.value), (i = s.next()); while (!i.done); + cf(e, n, v); + } + return; + } + throw ( + ((e = Object.prototype.toString.call(i)), + Error( + "Objects are not valid as a React child (found: " + + (e === "[object Object]" + ? "object with keys {" + Object.keys(i).join(", ") + "}" + : e) + + "). If you meant to render a collection of children, use an array instead.", + )) + ); + } + typeof i == "string" + ? ((s = n.blockedSegment), + (s.lastPushedText = Qc( + n.blockedSegment.chunks, + i, + e.responseState, + s.lastPushedText, + ))) + : typeof i == "number" && + ((s = n.blockedSegment), + (s.lastPushedText = Qc( + n.blockedSegment.chunks, + "" + i, + e.responseState, + s.lastPushedText, + ))); + } + function cf(e, n, i) { + for (var s = i.length, v = 0; v < s; v++) { + var c = n.treeContext; + n.treeContext = Ju(c, s, v); + try { + Ku(e, n, i[v]); + } finally { + n.treeContext = c; + } + } + } + function Ku(e, n, i) { + var s = n.blockedSegment.formatContext, + v = n.legacyContext, + c = n.context; + try { + return lt(e, n, i); + } catch (E) { + if ( + (oc(), + typeof E == "object" && E !== null && typeof E.then == "function") + ) { + i = E; + var m = n.blockedSegment, + S = Gl( + e, + m.chunks.length, + null, + m.formatContext, + m.lastPushedText, + !0, + ); + m.children.push(S), + (m.lastPushedText = !1), + (e = ac( + e, + n.node, + n.blockedBoundary, + S, + n.abortSet, + n.legacyContext, + n.context, + n.treeContext, + ).ping), + i.then(e, e), + (n.blockedSegment.formatContext = s), + (n.legacyContext = v), + (n.context = c), + Vl(c); + } else { + throw ( + ((n.blockedSegment.formatContext = s), + (n.legacyContext = v), + (n.context = c), + Vl(c), + E) + ); + } + } + } + function Wp(e) { + var n = e.blockedBoundary; + (e = e.blockedSegment), (e.status = 3), Lf(this, n, e); + } + function Mf(e, n, i) { + var s = e.blockedBoundary; + (e.blockedSegment.status = 3), + s === null + ? (n.allPendingTasks--, + n.status !== 2 && + ((n.status = 2), n.destination !== null && n.destination.push(null))) + : (s.pendingTasks--, + s.forceClientRender || + ((s.forceClientRender = !0), + (s.errorDigest = n.onError( + i === void 0 + ? Error( + "The render was aborted by the server without a reason.", + ) + : i, + )), + s.parentFlushed && n.clientRenderedBoundaries.push(s)), + s.fallbackAbortableTasks.forEach(function (v) { + return Mf(v, n, i); + }), + s.fallbackAbortableTasks.clear(), + n.allPendingTasks--, + n.allPendingTasks === 0 && ((e = n.onAllReady), e())); + } + function Zl(e, n) { + if ( + n.chunks.length === 0 && + n.children.length === 1 && + n.children[0].boundary === null + ) { + var i = n.children[0]; + (i.id = n.id), (i.parentFlushed = !0), i.status === 1 && Zl(e, i); + } else e.completedSegments.push(n); + } + function Lf(e, n, i) { + if (n === null) { + if (i.parentFlushed) { + if (e.completedRootSegment !== null) { + throw Error( + "There can only be one root segment. This is a bug in React.", + ); + } + e.completedRootSegment = i; + } + e.pendingRootTasks--, + e.pendingRootTasks === 0 && + ((e.onShellError = Oi), (n = e.onShellReady), n()); + } else { + n.pendingTasks--, + n.forceClientRender || + (n.pendingTasks === 0 + ? (i.parentFlushed && i.status === 1 && Zl(n, i), + n.parentFlushed && e.completedBoundaries.push(n), + n.fallbackAbortableTasks.forEach(Wp, e), + n.fallbackAbortableTasks.clear()) + : i.parentFlushed && + i.status === 1 && + (Zl(n, i), + n.completedSegments.length === 1 && + n.parentFlushed && + e.partialBoundaries.push(n))); + } + e.allPendingTasks--, e.allPendingTasks === 0 && ((e = e.onAllReady), e()); + } + function ic(e) { + if (e.status !== 2) { + var n = ro, + i = Gu.current; + Gu.current = af; + var s = Nl; + Nl = e.responseState; + try { + var v = e.pingedTasks, + c; + for (c = 0; c < v.length; c++) { + var m = v[c], + S = e, + E = m.blockedSegment; + if (E.status === 0) { + Vl(m.context); + try { + lt(S, m, m.node), + S.responseState.generateStaticMarkup || + (E.lastPushedText && + E.textEmbedded && + E.chunks.push("<!-- -->")), + m.abortSet.delete(m), + (E.status = 1), + Lf(S, m.blockedBoundary, E); + } catch (J) { + if ( + (oc(), + typeof J == "object" && + J !== null && + typeof J.then == "function") + ) { + var x = m.ping; + J.then(x, x); + } else { + m.abortSet.delete(m), (E.status = 4); + var R = m.blockedBoundary, + D = J, + V = Bi(S, D); + if ( + (R === null + ? Xl(S, D) + : (R.pendingTasks--, + R.forceClientRender || + ((R.forceClientRender = !0), + (R.errorDigest = V), + R.parentFlushed && S.clientRenderedBoundaries.push(R))), + S.allPendingTasks--, + S.allPendingTasks === 0) + ) { + var te = S.onAllReady; + te(); + } + } + } finally { + } + } + } + v.splice(0, c), e.destination !== null && lc(e, e.destination); + } catch (J) { + Bi(e, J), Xl(e, J); + } finally { + (Nl = s), (Gu.current = i), i === af && Vl(n); + } + } + } + function jl(e, n, i) { + switch (((i.parentFlushed = !0), i.status)) { + case 0: + var s = (i.id = e.nextSegmentId++); + return ( + (i.lastPushedText = !1), + (i.textEmbedded = !1), + (e = e.responseState), + n.push('<template id="'), + n.push(e.placeholderPrefix), + (e = s.toString(16)), + n.push(e), + n.push('"></template>') + ); + case 1: + i.status = 2; + var v = !0; + s = i.chunks; + var c = 0; + i = i.children; + for (var m = 0; m < i.length; m++) { + for (v = i[m]; c < v.index; c++) n.push(s[c]); + v = Kl(e, n, v); + } + for (; c < s.length - 1; c++) n.push(s[c]); + return c < s.length && (v = n.push(s[c])), v; + default: + throw Error( + "Aborted, errored or already flushed boundaries should not be flushed again. This is a bug in React.", + ); + } + } + function Kl(e, n, i) { + var s = i.boundary; + if (s === null) return jl(e, n, i); + if (((s.parentFlushed = !0), s.forceClientRender)) { + return ( + e.responseState.generateStaticMarkup || + ((s = s.errorDigest), + n.push("<!--$!-->"), + n.push("<template"), + s && (n.push(' data-dgst="'), (s = Ye(s)), n.push(s), n.push('"')), + n.push("></template>")), + jl(e, n, i), + (e = e.responseState.generateStaticMarkup ? !0 : n.push("<!--/$-->")), + e + ); + } + if (0 < s.pendingTasks) { + (s.rootSegmentID = e.nextSegmentId++), + 0 < s.completedSegments.length && e.partialBoundaries.push(s); + var v = e.responseState, + c = v.nextSuspenseID++; + return ( + (v = v.boundaryPrefix + c.toString(16)), + (s = s.id = v), + Jc(n, e.responseState, s), + jl(e, n, i), + n.push("<!--/$-->") + ); + } + if (s.byteSize > e.progressiveChunkSize) { + return ( + (s.rootSegmentID = e.nextSegmentId++), + e.completedBoundaries.push(s), + Jc(n, e.responseState, s.id), + jl(e, n, i), + n.push("<!--/$-->") + ); + } + if ( + (e.responseState.generateStaticMarkup || n.push("<!--$-->"), + (i = s.completedSegments), + i.length !== 1) + ) { + throw Error( + "A previously unvisited boundary must have exactly one root segment. This is a bug in React.", + ); + } + return ( + Kl(e, n, i[0]), + (e = e.responseState.generateStaticMarkup ? !0 : n.push("<!--/$-->")), + e + ); + } + function ff(e, n, i) { + return ( + Tp(n, e.responseState, i.formatContext, i.id), + Kl(e, n, i), + Cp(n, i.formatContext) + ); + } + function df(e, n, i) { + for (var s = i.completedSegments, v = 0; v < s.length; v++) { + Bf(e, n, i, s[v]); + } + if ( + ((s.length = 0), + (e = e.responseState), + (s = i.id), + (i = i.rootSegmentID), + n.push(e.startInlineScript), + e.sentCompleteBoundaryFunction + ? n.push('$RC("') + : ((e.sentCompleteBoundaryFunction = !0), + n.push( + 'function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("', + )), + s === null) + ) { + throw Error( + "An ID must have been assigned before we can complete the boundary.", + ); + } + return ( + (i = i.toString(16)), + n.push(s), + n.push('","'), + n.push(e.segmentPrefix), + n.push(i), + n.push('")</script>') + ); + } + function Bf(e, n, i, s) { + if (s.status === 2) return !0; + var v = s.id; + if (v === -1) { + if ((s.id = i.rootSegmentID) === -1) { + throw Error( + "A root segment ID must have been assigned by now. This is a bug in React.", + ); + } + return ff(e, n, s); + } + return ( + ff(e, n, s), + (e = e.responseState), + n.push(e.startInlineScript), + e.sentCompleteSegmentFunction + ? n.push('$RS("') + : ((e.sentCompleteSegmentFunction = !0), + n.push( + 'function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("', + )), + n.push(e.segmentPrefix), + (v = v.toString(16)), + n.push(v), + n.push('","'), + n.push(e.placeholderPrefix), + n.push(v), + n.push('")</script>') + ); + } + function lc(e, n) { + try { + var i = e.completedRootSegment; + if (i !== null && e.pendingRootTasks === 0) { + Kl(e, n, i), (e.completedRootSegment = null); + var s = e.responseState.bootstrapChunks; + for (i = 0; i < s.length - 1; i++) n.push(s[i]); + i < s.length && n.push(s[i]); + } + var v = e.clientRenderedBoundaries, + c; + for (c = 0; c < v.length; c++) { + var m = v[c]; + s = n; + var S = e.responseState, + E = m.id, + x = m.errorDigest, + R = m.errorMessage, + D = m.errorComponentStack; + if ( + (s.push(S.startInlineScript), + S.sentClientRenderFunction + ? s.push('$RX("') + : ((S.sentClientRenderFunction = !0), + s.push( + 'function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("', + )), + E === null) + ) { + throw Error( + "An ID must have been assigned before we can complete the boundary.", + ); + } + if ((s.push(E), s.push('"'), x || R || D)) { + s.push(","); + var V = Yu(x || ""); + s.push(V); + } + if (R || D) { + s.push(","); + var te = Yu(R || ""); + s.push(te); + } + if (D) { + s.push(","); + var J = Yu(D); + s.push(J); + } + if (!s.push(")</script>")) { + (e.destination = null), c++, v.splice(0, c); + return; + } + } + v.splice(0, c); + var Oe = e.completedBoundaries; + for (c = 0; c < Oe.length; c++) { + if (!df(e, n, Oe[c])) { + (e.destination = null), c++, Oe.splice(0, c); + return; + } + } + Oe.splice(0, c); + var P = e.partialBoundaries; + for (c = 0; c < P.length; c++) { + var ue = P[c]; + e: { + (v = e), (m = n); + var W = ue.completedSegments; + for (S = 0; S < W.length; S++) { + if (!Bf(v, m, ue, W[S])) { + S++, W.splice(0, S); + var q = !1; + break e; + } + } + W.splice(0, S), (q = !0); + } + if (!q) { + (e.destination = null), c++, P.splice(0, c); + return; + } + } + P.splice(0, c); + var xe = e.completedBoundaries; + for (c = 0; c < xe.length; c++) { + if (!df(e, n, xe[c])) { + (e.destination = null), c++, xe.splice(0, c); + return; + } + } + xe.splice(0, c); + } finally { + e.allPendingTasks === 0 && + e.pingedTasks.length === 0 && + e.clientRenderedBoundaries.length === 0 && + e.completedBoundaries.length === 0 && + n.push(null); + } + } + function sc(e, n) { + if (e.status === 1) (e.status = 2), n.destroy(e.fatalError); + else if (e.status !== 2 && e.destination === null) { + e.destination = n; + try { + lc(e, n); + } catch (i) { + Bi(e, i), Xl(e, i); + } + } + } + function Uf(e, n) { + try { + var i = e.abortableTasks; + i.forEach(function (s) { + return Mf(s, e, n); + }), + i.clear(), + e.destination !== null && lc(e, e.destination); + } catch (s) { + Bi(e, s), Xl(e, s); + } + } + function zp() {} + function jf(e, n, i, s) { + var v = !1, + c = null, + m = "", + S = !1; + if ( + ((e = Of( + e, + gf(i, n ? n.identifierPrefix : void 0), + mf(), + 1 / 0, + zp, + void 0, + function () { + S = !0; + }, + void 0, + void 0, + )), + ic(e), + Uf(e, s), + sc(e, { + push: function (E) { + return E !== null && (m += E), !0; + }, + destroy: function (E) { + (v = !0), (c = E); + }, + }), + v) + ) { + throw c; + } + if (!S) { + throw Error( + "A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.", + ); + } + return m; + } + function $p(e, n) { + (e.prototype = Object.create(n.prototype)), + (e.prototype.constructor = e), + (e.__proto__ = n); + } + var Np = (function (e) { + function n() { + var s = e.call(this, {}) || this; + return (s.request = null), (s.startedFlowing = !1), s; + } + $p(n, e); + var i = n.prototype; + return ( + (i._destroy = function (s, v) { + Uf(this.request), v(s); + }), + (i._read = function () { + this.startedFlowing && sc(this.request, this); + }), + n + ); + })(hp.Readable); + function Vp() {} + function Hf(e, n) { + var i = new Np(), + s = Of( + e, + gf(!1, n ? n.identifierPrefix : void 0), + mf(), + 1 / 0, + Vp, + function () { + (i.startedFlowing = !0), sc(s, i); + }, + void 0, + void 0, + ); + return (i.request = s), ic(s), i; + } + ca.renderToNodeStream = function (e, n) { + return Hf(e, n); + }; + ca.renderToStaticMarkup = function (e, n) { + return jf( + e, + n, + !0, + 'The server used "renderToStaticMarkup" which does not support Suspense. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server', + ); + }; + ca.renderToStaticNodeStream = function (e, n) { + return Hf(e, n); + }; + ca.renderToString = function (e, n) { + return jf( + e, + n, + !1, + 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server', + ); + }; + ca.version = "18.2.0"; +}); +var jd = an((_c) => { + "use strict"; + var Yp = require("util"), + hd = ua(), + pe = null, + le = 0, + da = !0; + function L(e, n) { + if (typeof n == "string") { + if (n.length !== 0) { + if (2048 < 3 * n.length) { + 0 < le && + (Tr(e, pe.subarray(0, le)), (pe = new Uint8Array(2048)), (le = 0)), + Tr(e, ts.encode(n)); + } else { + var i = pe; + 0 < le && (i = pe.subarray(le)), (i = ts.encodeInto(n, i)); + var s = i.read; + (le += i.written), + s < n.length && + (Tr(e, pe), + (pe = new Uint8Array(2048)), + (le = ts.encodeInto(n.slice(s), pe).written)), + le === 2048 && (Tr(e, pe), (pe = new Uint8Array(2048)), (le = 0)); + } + } + } else { + n.byteLength !== 0 && + (2048 < n.byteLength + ? (0 < le && + (Tr(e, pe.subarray(0, le)), (pe = new Uint8Array(2048)), (le = 0)), + Tr(e, n)) + : ((i = pe.length - le), + i < n.byteLength && + (i === 0 + ? Tr(e, pe) + : (pe.set(n.subarray(0, i), le), + (le += i), + Tr(e, pe), + (n = n.subarray(i))), + (pe = new Uint8Array(2048)), + (le = 0)), + pe.set(n, le), + (le += n.byteLength), + le === 2048 && (Tr(e, pe), (pe = new Uint8Array(2048)), (le = 0)))); + } + } + function Tr(e, n) { + (e = e.write(n)), (da = da && e); + } + function se(e, n) { + return L(e, n), da; + } + function zf(e) { + pe && 0 < le && e.write(pe.subarray(0, le)), + (pe = null), + (le = 0), + (da = !0); + } + var ts = new Yp.TextEncoder(); + function A(e) { + return ts.encode(e); + } + var et = Object.prototype.hasOwnProperty, + Gp = + /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, + $f = {}, + Nf = {}; + function vd(e) { + return et.call(Nf, e) + ? !0 + : et.call($f, e) + ? !1 + : Gp.test(e) + ? (Nf[e] = !0) + : (($f[e] = !0), !1); + } + function Xe(e, n, i, s, v, c, m) { + (this.acceptsBooleans = n === 2 || n === 3 || n === 4), + (this.attributeName = s), + (this.attributeNamespace = v), + (this.mustUseProperty = i), + (this.propertyName = e), + (this.type = n), + (this.sanitizeURL = c), + (this.removeEmptyString = m); + } + var De = {}; + "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style" + .split(" ") + .forEach(function (e) { + De[e] = new Xe(e, 0, !1, e, null, !1, !1); + }); + [ + ["acceptCharset", "accept-charset"], + ["className", "class"], + ["htmlFor", "for"], + ["httpEquiv", "http-equiv"], + ].forEach(function (e) { + var n = e[0]; + De[n] = new Xe(n, 1, !1, e[1], null, !1, !1); + }); + ["contentEditable", "draggable", "spellCheck", "value"].forEach(function (e) { + De[e] = new Xe(e, 2, !1, e.toLowerCase(), null, !1, !1); + }); + [ + "autoReverse", + "externalResourcesRequired", + "focusable", + "preserveAlpha", + ].forEach(function (e) { + De[e] = new Xe(e, 2, !1, e, null, !1, !1); + }); + "allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope" + .split(" ") + .forEach(function (e) { + De[e] = new Xe(e, 3, !1, e.toLowerCase(), null, !1, !1); + }); + ["checked", "multiple", "muted", "selected"].forEach(function (e) { + De[e] = new Xe(e, 3, !0, e, null, !1, !1); + }); + ["capture", "download"].forEach(function (e) { + De[e] = new Xe(e, 4, !1, e, null, !1, !1); + }); + ["cols", "rows", "size", "span"].forEach(function (e) { + De[e] = new Xe(e, 6, !1, e, null, !1, !1); + }); + ["rowSpan", "start"].forEach(function (e) { + De[e] = new Xe(e, 5, !1, e.toLowerCase(), null, !1, !1); + }); + var Sc = /[\-:]([a-z])/g; + function wc(e) { + return e[1].toUpperCase(); + } + "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height" + .split(" ") + .forEach(function (e) { + var n = e.replace(Sc, wc); + De[n] = new Xe(n, 1, !1, e, null, !1, !1); + }); + "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type" + .split(" ") + .forEach(function (e) { + var n = e.replace(Sc, wc); + De[n] = new Xe(n, 1, !1, e, "http://www.w3.org/1999/xlink", !1, !1); + }); + ["xml:base", "xml:lang", "xml:space"].forEach(function (e) { + var n = e.replace(Sc, wc); + De[n] = new Xe(n, 1, !1, e, "http://www.w3.org/XML/1998/namespace", !1, !1); + }); + ["tabIndex", "crossOrigin"].forEach(function (e) { + De[e] = new Xe(e, 1, !1, e.toLowerCase(), null, !1, !1); + }); + De.xlinkHref = new Xe( + "xlinkHref", + 1, + !1, + "xlink:href", + "http://www.w3.org/1999/xlink", + !0, + !1, + ); + ["src", "href", "action", "formAction"].forEach(function (e) { + De[e] = new Xe(e, 1, !1, e.toLowerCase(), null, !0, !0); + }); + var rs = { + animationIterationCount: !0, + aspectRatio: !0, + borderImageOutset: !0, + borderImageSlice: !0, + borderImageWidth: !0, + boxFlex: !0, + boxFlexGroup: !0, + boxOrdinalGroup: !0, + columnCount: !0, + columns: !0, + flex: !0, + flexGrow: !0, + flexPositive: !0, + flexShrink: !0, + flexNegative: !0, + flexOrder: !0, + gridArea: !0, + gridRow: !0, + gridRowEnd: !0, + gridRowSpan: !0, + gridRowStart: !0, + gridColumn: !0, + gridColumnEnd: !0, + gridColumnSpan: !0, + gridColumnStart: !0, + fontWeight: !0, + lineClamp: !0, + lineHeight: !0, + opacity: !0, + order: !0, + orphans: !0, + tabSize: !0, + widows: !0, + zIndex: !0, + zoom: !0, + fillOpacity: !0, + floodOpacity: !0, + stopOpacity: !0, + strokeDasharray: !0, + strokeDashoffset: !0, + strokeMiterlimit: !0, + strokeOpacity: !0, + strokeWidth: !0, + }, + Xp = ["Webkit", "ms", "Moz", "O"]; + Object.keys(rs).forEach(function (e) { + Xp.forEach(function (n) { + (n = n + e.charAt(0).toUpperCase() + e.substring(1)), (rs[n] = rs[e]); + }); + }); + var Zp = /["'&<>]/; + function Ae(e) { + if (typeof e == "boolean" || typeof e == "number") return "" + e; + e = "" + e; + var n = Zp.exec(e); + if (n) { + var i = "", + s, + v = 0; + for (s = n.index; s < e.length; s++) { + switch (e.charCodeAt(s)) { + case 34: + n = """; + break; + case 38: + n = "&"; + break; + case 39: + n = "'"; + break; + case 60: + n = "<"; + break; + case 62: + n = ">"; + break; + default: + continue; + } + v !== s && (i += e.substring(v, s)), (v = s + 1), (i += n); + } + e = v !== s ? i + e.substring(v, s) : i; + } + return e; + } + var Jp = /([A-Z])/g, + Qp = /^ms-/, + vc = Array.isArray, + Kp = A("<script>"), + qp = A("</script>"), + eh = A('<script src="'), + th = A('<script type="module" src="'), + Vf = A('" async=""></script>'), + rh = /(<\/|<)(s)(cript)/gi; + function nh(e, n, i, s) { + return "" + n + (i === "s" ? "\\u0073" : "\\u0053") + s; + } + function Qt(e, n) { + return { insertionMode: e, selectedValue: n }; + } + function oh(e, n, i) { + switch (n) { + case "select": + return Qt(1, i.value != null ? i.value : i.defaultValue); + case "svg": + return Qt(2, null); + case "math": + return Qt(3, null); + case "foreignObject": + return Qt(1, null); + case "table": + return Qt(4, null); + case "thead": + case "tbody": + case "tfoot": + return Qt(5, null); + case "colgroup": + return Qt(7, null); + case "tr": + return Qt(6, null); + } + return 4 <= e.insertionMode || e.insertionMode === 0 ? Qt(1, null) : e; + } + var xc = A("<!-- -->"); + function Yf(e, n, i, s) { + return n === "" ? s : (s && e.push(xc), e.push(Ae(n)), !0); + } + var Gf = new Map(), + ah = A(' style="'), + Xf = A(":"), + ih = A(";"); + function gd(e, n, i) { + if (typeof i != "object") { + throw Error( + "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.", + ); + } + n = !0; + for (var s in i) { + if (et.call(i, s)) { + var v = i[s]; + if (v != null && typeof v != "boolean" && v !== "") { + if (s.indexOf("--") === 0) { + var c = Ae(s); + v = Ae(("" + v).trim()); + } else { + c = s; + var m = Gf.get(c); + m !== void 0 || + ((m = A( + Ae(c.replace(Jp, "-$1").toLowerCase().replace(Qp, "-ms-")), + )), + Gf.set(c, m)), + (c = m), + (v = typeof v == "number" + ? v === 0 || et.call(rs, s) ? "" + v : v + "px" + : Ae(("" + v).trim())); + } + n ? ((n = !1), e.push(ah, c, Xf, v)) : e.push(ih, c, Xf, v); + } + } + } + n || e.push(no); + } + var sn = A(" "), + fa = A('="'), + no = A('"'), + Zf = A('=""'); + function st(e, n, i, s) { + switch (i) { + case "style": + gd(e, n, s); + return; + case "defaultValue": + case "defaultChecked": + case "innerHTML": + case "suppressContentEditableWarning": + case "suppressHydrationWarning": + return; + } + if ( + !(2 < i.length) || + (i[0] !== "o" && i[0] !== "O") || + (i[1] !== "n" && i[1] !== "N") + ) { + if (((n = De.hasOwnProperty(i) ? De[i] : null), n !== null)) { + switch (typeof s) { + case "function": + case "symbol": + return; + case "boolean": + if (!n.acceptsBooleans) return; + } + switch (((i = n.attributeName), n.type)) { + case 3: + s && e.push(sn, i, Zf); + break; + case 4: + s === !0 + ? e.push(sn, i, Zf) + : s !== !1 && e.push(sn, i, fa, Ae(s), no); + break; + case 5: + isNaN(s) || e.push(sn, i, fa, Ae(s), no); + break; + case 6: + !isNaN(s) && 1 <= s && e.push(sn, i, fa, Ae(s), no); + break; + default: + n.sanitizeURL && (s = "" + s), e.push(sn, i, fa, Ae(s), no); + } + } else if (vd(i)) { + switch (typeof s) { + case "function": + case "symbol": + return; + case "boolean": + if ( + ((n = i.toLowerCase().slice(0, 5)), + n !== "data-" && n !== "aria-") + ) { + return; + } + } + e.push(sn, i, fa, Ae(s), no); + } + } + } + var un = A(">"), + Jf = A("/>"); + function ns(e, n, i) { + if (n != null) { + if (i != null) { + throw Error( + "Can only set one of `children` or `props.dangerouslySetInnerHTML`.", + ); + } + if (typeof n != "object" || !("__html" in n)) { + throw Error( + "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.", + ); + } + (n = n.__html), n != null && e.push("" + n); + } + } + function lh(e) { + var n = ""; + return ( + hd.Children.forEach(e, function (i) { + i != null && (n += i); + }), n + ); + } + var uc = A(' selected=""'); + function cc(e, n, i, s) { + e.push(Kt(i)); + var v = (i = null), + c; + for (c in n) { + if (et.call(n, c)) { + var m = n[c]; + if (m != null) { + switch (c) { + case "children": + i = m; + break; + case "dangerouslySetInnerHTML": + v = m; + break; + default: + st(e, s, c, m); + } + } + } + } + return ( + e.push(un), ns(e, v, i), typeof i == "string" ? (e.push(Ae(i)), null) : i + ); + } + var fc = A(` +`), + sh = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/, + Qf = new Map(); + function Kt(e) { + var n = Qf.get(e); + if (n === void 0) { + if (!sh.test(e)) throw Error("Invalid tag: " + e); + (n = A("<" + e)), Qf.set(e, n); + } + return n; + } + var uh = A("<!DOCTYPE html>"); + function ch(e, n, i, s, v) { + switch (n) { + case "select": + e.push(Kt("select")); + var c = null, + m = null; + for (R in i) { + if (et.call(i, R)) { + var S = i[R]; + if (S != null) { + switch (R) { + case "children": + c = S; + break; + case "dangerouslySetInnerHTML": + m = S; + break; + case "defaultValue": + case "value": + break; + default: + st(e, s, R, S); + } + } + } + } + return e.push(un), ns(e, m, c), c; + case "option": + (m = v.selectedValue), e.push(Kt("option")); + var E = (S = null), + x = null, + R = null; + for (c in i) { + if (et.call(i, c)) { + var D = i[c]; + if (D != null) { + switch (c) { + case "children": + S = D; + break; + case "selected": + x = D; + break; + case "dangerouslySetInnerHTML": + R = D; + break; + case "value": + E = D; + default: + st(e, s, c, D); + } + } + } + } + if (m != null) { + if (((i = E !== null ? "" + E : lh(S)), vc(m))) { + for (s = 0; s < m.length; s++) { + if ("" + m[s] === i) { + e.push(uc); + break; + } + } + } else "" + m === i && e.push(uc); + } else x && e.push(uc); + return e.push(un), ns(e, R, S), S; + case "textarea": + e.push(Kt("textarea")), (R = m = c = null); + for (S in i) { + if (et.call(i, S) && ((E = i[S]), E != null)) { + switch (S) { + case "children": + R = E; + break; + case "value": + c = E; + break; + case "defaultValue": + m = E; + break; + case "dangerouslySetInnerHTML": + throw Error( + "`dangerouslySetInnerHTML` does not make sense on <textarea>.", + ); + default: + st(e, s, S, E); + } + } + } + if ((c === null && m !== null && (c = m), e.push(un), R != null)) { + if (c != null) { + throw Error( + "If you supply `defaultValue` on a <textarea>, do not pass children.", + ); + } + if (vc(R) && 1 < R.length) { + throw Error("<textarea> can only have at most one child."); + } + c = "" + R; + } + return ( + typeof c == "string" && + c[0] === + ` +` && + e.push(fc), + c !== null && e.push(Ae("" + c)), + null + ); + case "input": + e.push(Kt("input")), + (E = + R = + S = + c = + null); + for (m in i) { + if (et.call(i, m) && ((x = i[m]), x != null)) { + switch (m) { + case "children": + case "dangerouslySetInnerHTML": + throw Error( + "input is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.", + ); + case "defaultChecked": + E = x; + break; + case "defaultValue": + S = x; + break; + case "checked": + R = x; + break; + case "value": + c = x; + break; + default: + st(e, s, m, x); + } + } + } + return ( + R !== null + ? st(e, s, "checked", R) + : E !== null && st(e, s, "checked", E), + c !== null + ? st(e, s, "value", c) + : S !== null && st(e, s, "value", S), + e.push(Jf), + null + ); + case "menuitem": + e.push(Kt("menuitem")); + for (var V in i) { + if (et.call(i, V) && ((c = i[V]), c != null)) { + switch (V) { + case "children": + case "dangerouslySetInnerHTML": + throw Error( + "menuitems cannot have `children` nor `dangerouslySetInnerHTML`.", + ); + default: + st(e, s, V, c); + } + } + } + return e.push(un), null; + case "title": + e.push(Kt("title")), (c = null); + for (D in i) { + if (et.call(i, D) && ((m = i[D]), m != null)) { + switch (D) { + case "children": + c = m; + break; + case "dangerouslySetInnerHTML": + throw Error( + "`dangerouslySetInnerHTML` does not make sense on <title>.", + ); + default: + st(e, s, D, m); + } + } + } + return e.push(un), c; + case "listing": + case "pre": + e.push(Kt(n)), (m = c = null); + for (E in i) { + if (et.call(i, E) && ((S = i[E]), S != null)) { + switch (E) { + case "children": + c = S; + break; + case "dangerouslySetInnerHTML": + m = S; + break; + default: + st(e, s, E, S); + } + } + } + if ((e.push(un), m != null)) { + if (c != null) { + throw Error( + "Can only set one of `children` or `props.dangerouslySetInnerHTML`.", + ); + } + if (typeof m != "object" || !("__html" in m)) { + throw Error( + "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.", + ); + } + (i = m.__html), + i != null && + (typeof i == "string" && + 0 < i.length && + i[0] === + ` +` + ? e.push(fc, i) + : e.push("" + i)); + } + return ( + typeof c == "string" && + c[0] === + ` +` && + e.push(fc), c + ); + case "area": + case "base": + case "br": + case "col": + case "embed": + case "hr": + case "img": + case "keygen": + case "link": + case "meta": + case "param": + case "source": + case "track": + case "wbr": + e.push(Kt(n)); + for (var te in i) { + if (et.call(i, te) && ((c = i[te]), c != null)) { + switch (te) { + case "children": + case "dangerouslySetInnerHTML": + throw Error( + n + + " is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.", + ); + default: + st(e, s, te, c); + } + } + } + return e.push(Jf), null; + case "annotation-xml": + case "color-profile": + case "font-face": + case "font-face-src": + case "font-face-uri": + case "font-face-format": + case "font-face-name": + case "missing-glyph": + return cc(e, i, n, s); + case "html": + return v.insertionMode === 0 && e.push(uh), cc(e, i, n, s); + default: + if (n.indexOf("-") === -1 && typeof i.is != "string") { + return cc(e, i, n, s); + } + e.push(Kt(n)), (m = c = null); + for (x in i) { + if (et.call(i, x) && ((S = i[x]), S != null)) { + switch (x) { + case "children": + c = S; + break; + case "dangerouslySetInnerHTML": + m = S; + break; + case "style": + gd(e, s, S); + break; + case "suppressContentEditableWarning": + case "suppressHydrationWarning": + break; + default: + vd(x) && + typeof S != "function" && + typeof S != "symbol" && + e.push(sn, x, fa, Ae(S), no); + } + } + } + return e.push(un), ns(e, m, c), c; + } + } + var fh = A("</"), + dh = A(">"), + ph = A('<template id="'), + hh = A('"></template>'), + vh = A("<!--$-->"), + gh = A('<!--$?--><template id="'), + mh = A('"></template>'), + yh = A("<!--$!-->"), + bh = A("<!--/$-->"), + Sh = A("<template"), + wh = A('"'), + xh = A(' data-dgst="'); + A(' data-msg="'); + A(' data-stck="'); + var kh = A("></template>"); + function Kf(e, n, i) { + if ((L(e, gh), i === null)) { + throw Error( + "An ID must have been assigned before we can complete the boundary.", + ); + } + return L(e, i), se(e, mh); + } + var Th = A('<div hidden id="'), + Ch = A('">'), + Eh = A("</div>"), + Rh = A('<svg aria-hidden="true" style="display:none" id="'), + Ih = A('">'), + _h = A("</svg>"), + Ph = A('<math aria-hidden="true" style="display:none" id="'), + Fh = A('">'), + Ah = A("</math>"), + Dh = A('<table hidden id="'), + Oh = A('">'), + Mh = A("</table>"), + Lh = A('<table hidden><tbody id="'), + Bh = A('">'), + Uh = A("</tbody></table>"), + jh = A('<table hidden><tr id="'), + Hh = A('">'), + Wh = A("</tr></table>"), + zh = A('<table hidden><colgroup id="'), + $h = A('">'), + Nh = A("</colgroup></table>"); + function Vh(e, n, i, s) { + switch (i.insertionMode) { + case 0: + case 1: + return L(e, Th), L(e, n.segmentPrefix), L(e, s.toString(16)), se(e, Ch); + case 2: + return L(e, Rh), L(e, n.segmentPrefix), L(e, s.toString(16)), se(e, Ih); + case 3: + return L(e, Ph), L(e, n.segmentPrefix), L(e, s.toString(16)), se(e, Fh); + case 4: + return L(e, Dh), L(e, n.segmentPrefix), L(e, s.toString(16)), se(e, Oh); + case 5: + return L(e, Lh), L(e, n.segmentPrefix), L(e, s.toString(16)), se(e, Bh); + case 6: + return L(e, jh), L(e, n.segmentPrefix), L(e, s.toString(16)), se(e, Hh); + case 7: + return L(e, zh), L(e, n.segmentPrefix), L(e, s.toString(16)), se(e, $h); + default: + throw Error("Unknown insertion mode. This is a bug in React."); + } + } + function Yh(e, n) { + switch (n.insertionMode) { + case 0: + case 1: + return se(e, Eh); + case 2: + return se(e, _h); + case 3: + return se(e, Ah); + case 4: + return se(e, Mh); + case 5: + return se(e, Uh); + case 6: + return se(e, Wh); + case 7: + return se(e, Nh); + default: + throw Error("Unknown insertion mode. This is a bug in React."); + } + } + var Gh = A( + 'function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("', + ), + Xh = A('$RS("'), + Zh = A('","'), + Jh = A('")</script>'), + Qh = A( + 'function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("', + ), + Kh = A('$RC("'), + qh = A('","'), + ev = A('")</script>'), + tv = A( + 'function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("', + ), + rv = A('$RX("'), + nv = A('"'), + ov = A(")</script>"), + dc = A(","), + av = /[<\u2028\u2029]/g; + function pc(e) { + return JSON.stringify(e).replace(av, function (n) { + switch (n) { + case "<": + return "\\u003c"; + case "\u2028": + return "\\u2028"; + case "\u2029": + return "\\u2029"; + default: + throw Error( + "escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React", + ); + } + }); + } + var Hi = Object.assign, + iv = Symbol.for("react.element"), + md = Symbol.for("react.portal"), + yd = Symbol.for("react.fragment"), + bd = Symbol.for("react.strict_mode"), + Sd = Symbol.for("react.profiler"), + wd = Symbol.for("react.provider"), + xd = Symbol.for("react.context"), + kd = Symbol.for("react.forward_ref"), + Td = Symbol.for("react.suspense"), + Cd = Symbol.for("react.suspense_list"), + Ed = Symbol.for("react.memo"), + kc = Symbol.for("react.lazy"), + lv = Symbol.for("react.scope"), + sv = Symbol.for("react.debug_trace_mode"), + uv = Symbol.for("react.legacy_hidden"), + cv = Symbol.for("react.default_value"), + qf = Symbol.iterator; + function gc(e) { + if (e == null) return null; + if (typeof e == "function") return e.displayName || e.name || null; + if (typeof e == "string") return e; + switch (e) { + case yd: + return "Fragment"; + case md: + return "Portal"; + case Sd: + return "Profiler"; + case bd: + return "StrictMode"; + case Td: + return "Suspense"; + case Cd: + return "SuspenseList"; + } + if (typeof e == "object") { + switch (e.$$typeof) { + case xd: + return (e.displayName || "Context") + ".Consumer"; + case wd: + return (e._context.displayName || "Context") + ".Provider"; + case kd: + var n = e.render; + return ( + (e = e.displayName), + e || + ((e = n.displayName || n.name || ""), + (e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef")), + e + ); + case Ed: + return ( + (n = e.displayName || null), n !== null ? n : gc(e.type) || "Memo" + ); + case kc: + (n = e._payload), (e = e._init); + try { + return gc(e(n)); + } catch {} + } + } + return null; + } + var Rd = {}; + function ed(e, n) { + if (((e = e.contextTypes), !e)) return Rd; + var i = {}, + s; + for (s in e) i[s] = n[s]; + return i; + } + var ao = null; + function ds(e, n) { + if (e !== n) { + (e.context._currentValue = e.parentValue), (e = e.parent); + var i = n.parent; + if (e === null) { + if (i !== null) { + throw Error( + "The stacks must reach the root at the same time. This is a bug in React.", + ); + } + } else { + if (i === null) { + throw Error( + "The stacks must reach the root at the same time. This is a bug in React.", + ); + } + ds(e, i); + } + n.context._currentValue = n.value; + } + } + function Id(e) { + (e.context._currentValue = e.parentValue), + (e = e.parent), + e !== null && Id(e); + } + function _d(e) { + var n = e.parent; + n !== null && _d(n), (e.context._currentValue = e.value); + } + function Pd(e, n) { + if ( + ((e.context._currentValue = e.parentValue), (e = e.parent), e === null) + ) { + throw Error( + "The depth must equal at least at zero before reaching the root. This is a bug in React.", + ); + } + e.depth === n.depth ? ds(e, n) : Pd(e, n); + } + function Fd(e, n) { + var i = n.parent; + if (i === null) { + throw Error( + "The depth must equal at least at zero before reaching the root. This is a bug in React.", + ); + } + e.depth === i.depth ? ds(e, i) : Fd(e, i), + (n.context._currentValue = n.value); + } + function ls(e) { + var n = ao; + n !== e && + (n === null + ? _d(e) + : e === null + ? Id(n) + : n.depth === e.depth + ? ds(n, e) + : n.depth > e.depth + ? Pd(n, e) + : Fd(n, e), + (ao = e)); + } + var td = { + isMounted: function () { + return !1; + }, + enqueueSetState: function (e, n) { + (e = e._reactInternals), e.queue !== null && e.queue.push(n); + }, + enqueueReplaceState: function (e, n) { + (e = e._reactInternals), (e.replace = !0), (e.queue = [n]); + }, + enqueueForceUpdate: function () {}, + }; + function rd(e, n, i, s) { + var v = e.state !== void 0 ? e.state : null; + (e.updater = td), (e.props = i), (e.state = v); + var c = { queue: [], replace: !1 }; + e._reactInternals = c; + var m = n.contextType; + if ( + ((e.context = typeof m == "object" && m !== null ? m._currentValue : s), + (m = n.getDerivedStateFromProps), + typeof m == "function" && + ((m = m(i, v)), (v = m == null ? v : Hi({}, v, m)), (e.state = v)), + typeof n.getDerivedStateFromProps != "function" && + typeof e.getSnapshotBeforeUpdate != "function" && + (typeof e.UNSAFE_componentWillMount == "function" || + typeof e.componentWillMount == "function")) + ) { + if ( + ((n = e.state), + typeof e.componentWillMount == "function" && e.componentWillMount(), + typeof e.UNSAFE_componentWillMount == "function" && + e.UNSAFE_componentWillMount(), + n !== e.state && td.enqueueReplaceState(e, e.state, null), + c.queue !== null && 0 < c.queue.length) + ) { + if ( + ((n = c.queue), + (m = c.replace), + (c.queue = null), + (c.replace = !1), + m && n.length === 1) + ) { + e.state = n[0]; + } else { + for ( + c = m ? n[0] : e.state, v = !0, m = m ? 1 : 0; + m < n.length; + m++ + ) { + var S = n[m]; + (S = typeof S == "function" ? S.call(e, c, i, s) : S), + S != null && (v ? ((v = !1), (c = Hi({}, c, S))) : Hi(c, S)); + } + e.state = c; + } + } else c.queue = null; + } + } + var fv = { id: 1, overflow: "" }; + function mc(e, n, i) { + var s = e.id; + e = e.overflow; + var v = 32 - os(s) - 1; + (s &= ~(1 << v)), (i += 1); + var c = 32 - os(n) + v; + if (30 < c) { + var m = v - (v % 5); + return ( + (c = (s & ((1 << m) - 1)).toString(32)), + (s >>= m), + (v -= m), + { id: (1 << (32 - os(n) + v)) | (i << v) | s, overflow: c + e } + ); + } + return { id: (1 << c) | (i << v) | s, overflow: e }; + } + var os = Math.clz32 ? Math.clz32 : hv, + dv = Math.log, + pv = Math.LN2; + function hv(e) { + return (e >>>= 0), e === 0 ? 32 : (31 - ((dv(e) / pv) | 0)) | 0; + } + function vv(e, n) { + return (e === n && (e !== 0 || 1 / e === 1 / n)) || (e !== e && n !== n); + } + var gv = typeof Object.is == "function" ? Object.is : vv, + Cr = null, + Tc = null, + as = null, + ae = null, + Ui = !1, + ss = !1, + Wi = 0, + cn = null, + ps = 0; + function oo() { + if (Cr === null) { + throw Error( + `Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: +1. You might have mismatching versions of React and the renderer (such as React DOM) +2. You might be breaking the Rules of Hooks +3. You might have more than one copy of React in the same app +See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`, + ); + } + return Cr; + } + function nd() { + if (0 < ps) { + throw Error("Rendered more hooks than during the previous render"); + } + return { memoizedState: null, queue: null, next: null }; + } + function Cc() { + return ( + ae === null + ? as === null ? ((Ui = !1), (as = ae = nd())) : ((Ui = !0), (ae = as)) + : ae.next === null + ? ((Ui = !1), (ae = ae.next = nd())) + : ((Ui = !0), (ae = ae.next)), ae + ); + } + function Ec() { + (Tc = Cr = null), (ss = !1), (as = null), (ps = 0), (ae = cn = null); + } + function Ad(e, n) { + return typeof n == "function" ? n(e) : n; + } + function od(e, n, i) { + if (((Cr = oo()), (ae = Cc()), Ui)) { + var s = ae.queue; + if (((n = s.dispatch), cn !== null && ((i = cn.get(s)), i !== void 0))) { + cn.delete(s), (s = ae.memoizedState); + do (s = e(s, i.action)), (i = i.next); while (i !== null); + return (ae.memoizedState = s), [s, n]; + } + return [ae.memoizedState, n]; + } + return ( + (e = e === Ad + ? typeof n == "function" ? n() : n + : i !== void 0 + ? i(n) + : n), + (ae.memoizedState = e), + (e = ae.queue = { last: null, dispatch: null }), + (e = e.dispatch = mv.bind(null, Cr, e)), + [ae.memoizedState, e] + ); + } + function ad(e, n) { + if ( + ((Cr = oo()), (ae = Cc()), (n = n === void 0 ? null : n), ae !== null) + ) { + var i = ae.memoizedState; + if (i !== null && n !== null) { + var s = i[1]; + e: + if (s === null) s = !1; + else { + for (var v = 0; v < s.length && v < n.length; v++) { + if (!gv(n[v], s[v])) { + s = !1; + break e; + } + } + s = !0; + } + if (s) return i[0]; + } + } + return (e = e()), (ae.memoizedState = [e, n]), e; + } + function mv(e, n, i) { + if (25 <= ps) { + throw Error( + "Too many re-renders. React limits the number of renders to prevent an infinite loop.", + ); + } + if (e === Cr) { + if ( + ((ss = !0), + (e = { action: i, next: null }), + cn === null && (cn = new Map()), + (i = cn.get(n)), + i === void 0) + ) { + cn.set(n, e); + } else { + for (n = i; n.next !== null;) n = n.next; + n.next = e; + } + } + } + function yv() { + throw Error("startTransition cannot be called during server rendering."); + } + function ql() {} + var id = { + readContext: function (e) { + return e._currentValue; + }, + useContext: function (e) { + return oo(), e._currentValue; + }, + useMemo: ad, + useReducer: od, + useRef: function (e) { + (Cr = oo()), (ae = Cc()); + var n = ae.memoizedState; + return n === null ? ((e = { current: e }), (ae.memoizedState = e)) : n; + }, + useState: function (e) { + return od(Ad, e); + }, + useInsertionEffect: ql, + useLayoutEffect: function () {}, + useCallback: function (e, n) { + return ad(function () { + return e; + }, n); + }, + useImperativeHandle: ql, + useEffect: ql, + useDebugValue: ql, + useDeferredValue: function (e) { + return oo(), e; + }, + useTransition: function () { + return oo(), [!1, yv]; + }, + useId: function () { + var e = Tc.treeContext, + n = e.overflow; + (e = e.id), (e = (e & ~(1 << (32 - os(e) - 1))).toString(32) + n); + var i = is; + if (i === null) { + throw Error( + "Invalid hook call. Hooks can only be called inside of the body of a function component.", + ); + } + return ( + (n = Wi++), + (e = ":" + i.idPrefix + "R" + e), + 0 < n && (e += "H" + n.toString(32)), + e + ":" + ); + }, + useMutableSource: function (e, n) { + return oo(), n(e._source); + }, + useSyncExternalStore: function (e, n, i) { + if (i === void 0) { + throw Error( + "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.", + ); + } + return i(); + }, + }, + is = null, + hc = hd.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED + .ReactCurrentDispatcher; + function bv(e) { + return console.error(e), null; + } + function ji() {} + function Sv(e, n) { + var i = e.pingedTasks; + i.push(n), + i.length === 1 && + setImmediate(function () { + return Md(e); + }); + } + function Rc(e, n, i, s, v, c, m, S) { + e.allPendingTasks++, i === null ? e.pendingRootTasks++ : i.pendingTasks++; + var E = { + node: n, + ping: function () { + return Sv(e, E); + }, + blockedBoundary: i, + blockedSegment: s, + abortSet: v, + legacyContext: c, + context: m, + treeContext: S, + }; + return v.add(E), E; + } + function us(e, n, i, s, v, c) { + return { + status: 0, + id: -1, + index: n, + parentFlushed: !1, + chunks: [], + children: [], + formatContext: s, + boundary: i, + lastPushedText: v, + textEmbedded: c, + }; + } + function zi(e, n) { + if (((e = e.onError(n)), e != null && typeof e != "string")) { + throw Error( + 'onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "' + + typeof e + + '" instead', + ); + } + return e; + } + function cs(e, n) { + var i = e.onShellError; + i(n), + (i = e.onFatalError), + i(n), + e.destination !== null + ? ((e.status = 2), e.destination.destroy(n)) + : ((e.status = 1), (e.fatalError = n)); + } + function ld(e, n, i, s, v) { + for (Cr = {}, Tc = n, Wi = 0, e = i(s, v); ss;) { + (ss = !1), (Wi = 0), (ps += 1), (ae = null), (e = i(s, v)); + } + return Ec(), e; + } + function sd(e, n, i, s) { + var v = i.render(), + c = s.childContextTypes; + if (c != null) { + var m = n.legacyContext; + if (typeof i.getChildContext != "function") s = m; + else { + i = i.getChildContext(); + for (var S in i) { + if (!(S in c)) { + throw Error( + (gc(s) || "Unknown") + + '.getChildContext(): key "' + + S + + '" is not defined in childContextTypes.', + ); + } + } + s = Hi({}, m, i); + } + (n.legacyContext = s), ut(e, n, v), (n.legacyContext = m); + } else ut(e, n, v); + } + function ud(e, n) { + if (e && e.defaultProps) { + (n = Hi({}, n)), (e = e.defaultProps); + for (var i in e) n[i] === void 0 && (n[i] = e[i]); + return n; + } + return n; + } + function yc(e, n, i, s, v) { + if (typeof i == "function") { + if (i.prototype && i.prototype.isReactComponent) { + v = ed(i, n.legacyContext); + var c = i.contextType; + (c = new i( + s, + typeof c == "object" && c !== null ? c._currentValue : v, + )), + rd(c, i, s, v), + sd(e, n, c, i); + } else { + (c = ed(i, n.legacyContext)), (v = ld(e, n, i, s, c)); + var m = Wi !== 0; + if ( + typeof v == "object" && + v !== null && + typeof v.render == "function" && + v.$$typeof === void 0 + ) { + rd(v, i, s, c), sd(e, n, v, i); + } else if (m) { + (s = n.treeContext), (n.treeContext = mc(s, 1, 0)); + try { + ut(e, n, v); + } finally { + n.treeContext = s; + } + } else ut(e, n, v); + } + } else if (typeof i == "string") { + switch ( + ((v = n.blockedSegment), + (c = ch(v.chunks, i, s, e.responseState, v.formatContext)), + (v.lastPushedText = !1), + (m = v.formatContext), + (v.formatContext = oh(m, i, s)), + bc(e, n, c), + (v.formatContext = m), + i) + ) { + case "area": + case "base": + case "br": + case "col": + case "embed": + case "hr": + case "img": + case "input": + case "keygen": + case "link": + case "meta": + case "param": + case "source": + case "track": + case "wbr": + break; + default: + v.chunks.push(fh, i, dh); + } + v.lastPushedText = !1; + } else { + switch (i) { + case uv: + case sv: + case bd: + case Sd: + case yd: + ut(e, n, s.children); + return; + case Cd: + ut(e, n, s.children); + return; + case lv: + throw Error("ReactDOMServer does not yet support scope components."); + case Td: + e: { + (i = n.blockedBoundary), + (v = n.blockedSegment), + (c = s.fallback), + (s = s.children), + (m = new Set()); + var S = { + id: null, + rootSegmentID: -1, + parentFlushed: !1, + pendingTasks: 0, + forceClientRender: !1, + completedSegments: [], + byteSize: 0, + fallbackAbortableTasks: m, + errorDigest: null, + }, + E = us(e, v.chunks.length, S, v.formatContext, !1, !1); + v.children.push(E), (v.lastPushedText = !1); + var x = us(e, 0, null, v.formatContext, !1, !1); + (x.parentFlushed = !0), + (n.blockedBoundary = S), + (n.blockedSegment = x); + try { + if ( + (bc(e, n, s), + x.lastPushedText && x.textEmbedded && x.chunks.push(xc), + (x.status = 1), + fs(S, x), + S.pendingTasks === 0) + ) { + break e; + } + } catch (R) { + (x.status = 4), + (S.forceClientRender = !0), + (S.errorDigest = zi(e, R)); + } finally { + (n.blockedBoundary = i), (n.blockedSegment = v); + } + (n = Rc(e, c, i, E, m, n.legacyContext, n.context, n.treeContext)), + e.pingedTasks.push(n); + } + return; + } + if (typeof i == "object" && i !== null) { + switch (i.$$typeof) { + case kd: + if (((s = ld(e, n, i.render, s, v)), Wi !== 0)) { + (i = n.treeContext), (n.treeContext = mc(i, 1, 0)); + try { + ut(e, n, s); + } finally { + n.treeContext = i; + } + } else ut(e, n, s); + return; + case Ed: + (i = i.type), (s = ud(i, s)), yc(e, n, i, s, v); + return; + case wd: + if ( + ((v = s.children), + (i = i._context), + (s = s.value), + (c = i._currentValue), + (i._currentValue = s), + (m = ao), + (ao = + s = + { + parent: m, + depth: m === null ? 0 : m.depth + 1, + context: i, + parentValue: c, + value: s, + }), + (n.context = s), + ut(e, n, v), + (e = ao), + e === null) + ) { + throw Error( + "Tried to pop a Context at the root of the app. This is a bug in React.", + ); + } + (s = e.parentValue), + (e.context._currentValue = s === cv + ? e.context._defaultValue + : s), + (e = ao = e.parent), + (n.context = e); + return; + case xd: + (s = s.children), (s = s(i._currentValue)), ut(e, n, s); + return; + case kc: + (v = i._init), + (i = v(i._payload)), + (s = ud(i, s)), + yc(e, n, i, s, void 0); + return; + } + } + throw Error( + "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + + ((i == null ? i : typeof i) + "."), + ); + } + } + function ut(e, n, i) { + if (((n.node = i), typeof i == "object" && i !== null)) { + switch (i.$$typeof) { + case iv: + yc(e, n, i.type, i.props, i.ref); + return; + case md: + throw Error( + "Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render.", + ); + case kc: + var s = i._init; + (i = s(i._payload)), ut(e, n, i); + return; + } + if (vc(i)) { + cd(e, n, i); + return; + } + if ( + (i === null || typeof i != "object" + ? (s = null) + : ((s = (qf && i[qf]) || i["@@iterator"]), + (s = typeof s == "function" ? s : null)), + s && (s = s.call(i))) + ) { + if (((i = s.next()), !i.done)) { + var v = []; + do v.push(i.value), (i = s.next()); while (!i.done); + cd(e, n, v); + } + return; + } + throw ( + ((e = Object.prototype.toString.call(i)), + Error( + "Objects are not valid as a React child (found: " + + (e === "[object Object]" + ? "object with keys {" + Object.keys(i).join(", ") + "}" + : e) + + "). If you meant to render a collection of children, use an array instead.", + )) + ); + } + typeof i == "string" + ? ((s = n.blockedSegment), + (s.lastPushedText = Yf( + n.blockedSegment.chunks, + i, + e.responseState, + s.lastPushedText, + ))) + : typeof i == "number" && + ((s = n.blockedSegment), + (s.lastPushedText = Yf( + n.blockedSegment.chunks, + "" + i, + e.responseState, + s.lastPushedText, + ))); + } + function cd(e, n, i) { + for (var s = i.length, v = 0; v < s; v++) { + var c = n.treeContext; + n.treeContext = mc(c, s, v); + try { + bc(e, n, i[v]); + } finally { + n.treeContext = c; + } + } + } + function bc(e, n, i) { + var s = n.blockedSegment.formatContext, + v = n.legacyContext, + c = n.context; + try { + return ut(e, n, i); + } catch (E) { + if ( + (Ec(), + typeof E == "object" && E !== null && typeof E.then == "function") + ) { + i = E; + var m = n.blockedSegment, + S = us( + e, + m.chunks.length, + null, + m.formatContext, + m.lastPushedText, + !0, + ); + m.children.push(S), + (m.lastPushedText = !1), + (e = Rc( + e, + n.node, + n.blockedBoundary, + S, + n.abortSet, + n.legacyContext, + n.context, + n.treeContext, + ).ping), + i.then(e, e), + (n.blockedSegment.formatContext = s), + (n.legacyContext = v), + (n.context = c), + ls(c); + } else { + throw ( + ((n.blockedSegment.formatContext = s), + (n.legacyContext = v), + (n.context = c), + ls(c), + E) + ); + } + } + } + function wv(e) { + var n = e.blockedBoundary; + (e = e.blockedSegment), (e.status = 3), Od(this, n, e); + } + function Dd(e, n, i) { + var s = e.blockedBoundary; + (e.blockedSegment.status = 3), + s === null + ? (n.allPendingTasks--, + n.status !== 2 && + ((n.status = 2), n.destination !== null && n.destination.end())) + : (s.pendingTasks--, + s.forceClientRender || + ((s.forceClientRender = !0), + (s.errorDigest = n.onError( + i === void 0 + ? Error( + "The render was aborted by the server without a reason.", + ) + : i, + )), + s.parentFlushed && n.clientRenderedBoundaries.push(s)), + s.fallbackAbortableTasks.forEach(function (v) { + return Dd(v, n, i); + }), + s.fallbackAbortableTasks.clear(), + n.allPendingTasks--, + n.allPendingTasks === 0 && ((e = n.onAllReady), e())); + } + function fs(e, n) { + if ( + n.chunks.length === 0 && + n.children.length === 1 && + n.children[0].boundary === null + ) { + var i = n.children[0]; + (i.id = n.id), (i.parentFlushed = !0), i.status === 1 && fs(e, i); + } else e.completedSegments.push(n); + } + function Od(e, n, i) { + if (n === null) { + if (i.parentFlushed) { + if (e.completedRootSegment !== null) { + throw Error( + "There can only be one root segment. This is a bug in React.", + ); + } + e.completedRootSegment = i; + } + e.pendingRootTasks--, + e.pendingRootTasks === 0 && + ((e.onShellError = ji), (n = e.onShellReady), n()); + } else { + n.pendingTasks--, + n.forceClientRender || + (n.pendingTasks === 0 + ? (i.parentFlushed && i.status === 1 && fs(n, i), + n.parentFlushed && e.completedBoundaries.push(n), + n.fallbackAbortableTasks.forEach(wv, e), + n.fallbackAbortableTasks.clear()) + : i.parentFlushed && + i.status === 1 && + (fs(n, i), + n.completedSegments.length === 1 && + n.parentFlushed && + e.partialBoundaries.push(n))); + } + e.allPendingTasks--, e.allPendingTasks === 0 && ((e = e.onAllReady), e()); + } + function Md(e) { + if (e.status !== 2) { + var n = ao, + i = hc.current; + hc.current = id; + var s = is; + is = e.responseState; + try { + var v = e.pingedTasks, + c; + for (c = 0; c < v.length; c++) { + var m = v[c], + S = e, + E = m.blockedSegment; + if (E.status === 0) { + ls(m.context); + try { + ut(S, m, m.node), + E.lastPushedText && E.textEmbedded && E.chunks.push(xc), + m.abortSet.delete(m), + (E.status = 1), + Od(S, m.blockedBoundary, E); + } catch (J) { + if ( + (Ec(), + typeof J == "object" && + J !== null && + typeof J.then == "function") + ) { + var x = m.ping; + J.then(x, x); + } else { + m.abortSet.delete(m), (E.status = 4); + var R = m.blockedBoundary, + D = J, + V = zi(S, D); + if ( + (R === null + ? cs(S, D) + : (R.pendingTasks--, + R.forceClientRender || + ((R.forceClientRender = !0), + (R.errorDigest = V), + R.parentFlushed && S.clientRenderedBoundaries.push(R))), + S.allPendingTasks--, + S.allPendingTasks === 0) + ) { + var te = S.onAllReady; + te(); + } + } + } finally { + } + } + } + v.splice(0, c), e.destination !== null && Ic(e, e.destination); + } catch (J) { + zi(e, J), cs(e, J); + } finally { + (is = s), (hc.current = i), i === id && ls(n); + } + } + } + function es(e, n, i) { + switch (((i.parentFlushed = !0), i.status)) { + case 0: + var s = (i.id = e.nextSegmentId++); + return ( + (i.lastPushedText = !1), + (i.textEmbedded = !1), + (e = e.responseState), + L(n, ph), + L(n, e.placeholderPrefix), + (e = s.toString(16)), + L(n, e), + se(n, hh) + ); + case 1: + i.status = 2; + var v = !0; + s = i.chunks; + var c = 0; + i = i.children; + for (var m = 0; m < i.length; m++) { + for (v = i[m]; c < v.index; c++) L(n, s[c]); + v = hs(e, n, v); + } + for (; c < s.length - 1; c++) L(n, s[c]); + return c < s.length && (v = se(n, s[c])), v; + default: + throw Error( + "Aborted, errored or already flushed boundaries should not be flushed again. This is a bug in React.", + ); + } + } + function hs(e, n, i) { + var s = i.boundary; + if (s === null) return es(e, n, i); + if (((s.parentFlushed = !0), s.forceClientRender)) { + (s = s.errorDigest), + se(n, yh), + L(n, Sh), + s && (L(n, xh), L(n, Ae(s)), L(n, wh)), + se(n, kh), + es(e, n, i); + } else if (0 < s.pendingTasks) { + (s.rootSegmentID = e.nextSegmentId++), + 0 < s.completedSegments.length && e.partialBoundaries.push(s); + var v = e.responseState, + c = v.nextSuspenseID++; + (v = A(v.boundaryPrefix + c.toString(16))), + (s = s.id = v), + Kf(n, e.responseState, s), + es(e, n, i); + } else if (s.byteSize > e.progressiveChunkSize) { + (s.rootSegmentID = e.nextSegmentId++), + e.completedBoundaries.push(s), + Kf(n, e.responseState, s.id), + es(e, n, i); + } else { + if ((se(n, vh), (i = s.completedSegments), i.length !== 1)) { + throw Error( + "A previously unvisited boundary must have exactly one root segment. This is a bug in React.", + ); + } + hs(e, n, i[0]); + } + return se(n, bh); + } + function fd(e, n, i) { + return ( + Vh(n, e.responseState, i.formatContext, i.id), + hs(e, n, i), + Yh(n, i.formatContext) + ); + } + function dd(e, n, i) { + for (var s = i.completedSegments, v = 0; v < s.length; v++) { + Ld(e, n, i, s[v]); + } + if ( + ((s.length = 0), + (e = e.responseState), + (s = i.id), + (i = i.rootSegmentID), + L(n, e.startInlineScript), + e.sentCompleteBoundaryFunction + ? L(n, Kh) + : ((e.sentCompleteBoundaryFunction = !0), L(n, Qh)), + s === null) + ) { + throw Error( + "An ID must have been assigned before we can complete the boundary.", + ); + } + return ( + (i = i.toString(16)), + L(n, s), + L(n, qh), + L(n, e.segmentPrefix), + L(n, i), + se(n, ev) + ); + } + function Ld(e, n, i, s) { + if (s.status === 2) return !0; + var v = s.id; + if (v === -1) { + if ((s.id = i.rootSegmentID) === -1) { + throw Error( + "A root segment ID must have been assigned by now. This is a bug in React.", + ); + } + return fd(e, n, s); + } + return ( + fd(e, n, s), + (e = e.responseState), + L(n, e.startInlineScript), + e.sentCompleteSegmentFunction + ? L(n, Xh) + : ((e.sentCompleteSegmentFunction = !0), L(n, Gh)), + L(n, e.segmentPrefix), + (v = v.toString(16)), + L(n, v), + L(n, Zh), + L(n, e.placeholderPrefix), + L(n, v), + se(n, Jh) + ); + } + function Ic(e, n) { + (pe = new Uint8Array(2048)), (le = 0), (da = !0); + try { + var i = e.completedRootSegment; + if (i !== null && e.pendingRootTasks === 0) { + hs(e, n, i), (e.completedRootSegment = null); + var s = e.responseState.bootstrapChunks; + for (i = 0; i < s.length - 1; i++) L(n, s[i]); + i < s.length && se(n, s[i]); + } + var v = e.clientRenderedBoundaries, + c; + for (c = 0; c < v.length; c++) { + var m = v[c]; + s = n; + var S = e.responseState, + E = m.id, + x = m.errorDigest, + R = m.errorMessage, + D = m.errorComponentStack; + if ( + (L(s, S.startInlineScript), + S.sentClientRenderFunction + ? L(s, rv) + : ((S.sentClientRenderFunction = !0), L(s, tv)), + E === null) + ) { + throw Error( + "An ID must have been assigned before we can complete the boundary.", + ); + } + if ( + (L(s, E), + L(s, nv), + (x || R || D) && (L(s, dc), L(s, pc(x || ""))), + (R || D) && (L(s, dc), L(s, pc(R || ""))), + D && (L(s, dc), L(s, pc(D))), + !se(s, ov)) + ) { + (e.destination = null), c++, v.splice(0, c); + return; + } + } + v.splice(0, c); + var V = e.completedBoundaries; + for (c = 0; c < V.length; c++) { + if (!dd(e, n, V[c])) { + (e.destination = null), c++, V.splice(0, c); + return; + } + } + V.splice(0, c), zf(n), (pe = new Uint8Array(2048)), (le = 0), (da = !0); + var te = e.partialBoundaries; + for (c = 0; c < te.length; c++) { + var J = te[c]; + e: { + (v = e), (m = n); + var Oe = J.completedSegments; + for (S = 0; S < Oe.length; S++) { + if (!Ld(v, m, J, Oe[S])) { + S++, Oe.splice(0, S); + var P = !1; + break e; + } + } + Oe.splice(0, S), (P = !0); + } + if (!P) { + (e.destination = null), c++, te.splice(0, c); + return; + } + } + te.splice(0, c); + var ue = e.completedBoundaries; + for (c = 0; c < ue.length; c++) { + if (!dd(e, n, ue[c])) { + (e.destination = null), c++, ue.splice(0, c); + return; + } + } + ue.splice(0, c); + } finally { + zf(n), + typeof n.flush == "function" && n.flush(), + e.allPendingTasks === 0 && + e.pingedTasks.length === 0 && + e.clientRenderedBoundaries.length === 0 && + e.completedBoundaries.length === 0 && + n.end(); + } + } + function xv(e) { + setImmediate(function () { + return Md(e); + }); + } + function Bd(e, n) { + if (e.status === 1) (e.status = 2), n.destroy(e.fatalError); + else if (e.status !== 2 && e.destination === null) { + e.destination = n; + try { + Ic(e, n); + } catch (i) { + zi(e, i), cs(e, i); + } + } + } + function Ud(e, n) { + try { + var i = e.abortableTasks; + i.forEach(function (s) { + return Dd(s, e, n); + }), + i.clear(), + e.destination !== null && Ic(e, e.destination); + } catch (s) { + zi(e, s), cs(e, s); + } + } + function kv(e, n) { + return function () { + return Bd(n, e); + }; + } + function pd(e, n) { + return function () { + return Ud(e, n); + }; + } + function Tv(e, n) { + var i = n ? n.identifierPrefix : void 0, + s = n ? n.nonce : void 0, + v = n ? n.bootstrapScriptContent : void 0, + c = n ? n.bootstrapScripts : void 0, + m = n ? n.bootstrapModules : void 0; + (i = i === void 0 ? "" : i), + (s = s === void 0 ? Kp : A('<script nonce="' + Ae(s) + '">')); + var S = []; + if ( + (v !== void 0 && S.push(s, ("" + v).replace(rh, nh), qp), c !== void 0) + ) { + for (v = 0; v < c.length; v++) S.push(eh, Ae(c[v]), Vf); + } + if (m !== void 0) for (c = 0; c < m.length; c++) S.push(th, Ae(m[c]), Vf); + (m = { + bootstrapChunks: S, + startInlineScript: s, + placeholderPrefix: A(i + "P:"), + segmentPrefix: A(i + "S:"), + boundaryPrefix: i + "B:", + idPrefix: i, + nextSuspenseID: 0, + sentCompleteSegmentFunction: !1, + sentCompleteBoundaryFunction: !1, + sentClientRenderFunction: !1, + }), + (c = n ? n.namespaceURI : void 0), + (c = Qt( + c === "http://www.w3.org/2000/svg" + ? 2 + : c === "http://www.w3.org/1998/Math/MathML" + ? 3 + : 0, + null, + )), + (v = n ? n.progressiveChunkSize : void 0), + (s = n ? n.onError : void 0), + (S = n ? n.onAllReady : void 0); + var E = n ? n.onShellReady : void 0, + x = n ? n.onShellError : void 0; + return ( + (n = []), + (i = new Set()), + (m = { + destination: null, + responseState: m, + progressiveChunkSize: v === void 0 ? 12800 : v, + status: 0, + fatalError: null, + nextSegmentId: 0, + allPendingTasks: 0, + pendingRootTasks: 0, + completedRootSegment: null, + abortableTasks: i, + pingedTasks: n, + clientRenderedBoundaries: [], + completedBoundaries: [], + partialBoundaries: [], + onError: s === void 0 ? bv : s, + onAllReady: S === void 0 ? ji : S, + onShellReady: E === void 0 ? ji : E, + onShellError: x === void 0 ? ji : x, + onFatalError: ji, + }), + (c = us(m, 0, null, c, !1, !1)), + (c.parentFlushed = !0), + (e = Rc(m, e, null, c, i, Rd, null, fv)), + n.push(e), + m + ); + } + _c.renderToPipeableStream = function (e, n) { + var i = Tv(e, n), + s = !1; + return ( + xv(i), { + pipe: function (v) { + if (s) { + throw Error( + "React currently only supports piping to one writable stream.", + ); + } + return ( + (s = !0), + Bd(i, v), + v.on("drain", kv(v, i)), + v.on( + "error", + pd( + i, + Error("The destination stream errored while writing data."), + ), + ), + v.on( + "close", + pd(i, Error("The destination stream closed early.")), + ), + v + ); + }, + abort: function (v) { + Ud(i, v); + }, + } + ); + }; + _c.version = "18.2.0"; +}); +var Hd = an((pa) => { + "use strict"; + process.env.NODE_ENV !== "production" && + (function () { + "use strict"; + var e = ua(), + n = require("stream"), + i = "18.2.0", + s = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + function v(t) { + { + for ( + var r = arguments.length, l = new Array(r > 1 ? r - 1 : 0), u = 1; + u < r; + u++ + ) { + l[u - 1] = arguments[u]; + } + m("warn", t, l); + } + } + function c(t) { + { + for ( + var r = arguments.length, l = new Array(r > 1 ? r - 1 : 0), u = 1; + u < r; + u++ + ) { + l[u - 1] = arguments[u]; + } + m("error", t, l); + } + } + function m(t, r, l) { + { + var u = s.ReactDebugCurrentFrame, + p = u.getStackAddendum(); + p !== "" && ((r += "%s"), (l = l.concat([p]))); + var g = l.map(function (y) { + return String(y); + }); + g.unshift("Warning: " + r), + Function.prototype.apply.call(console[t], console, g); + } + } + function S(t) { + t(); + } + function E(t) {} + function x(t, r) { + R(t, r); + } + function R(t, r) { + return t.push(r); + } + function D(t) {} + function V(t) { + t.push(null); + } + function te(t) { + return t; + } + function J(t) { + return t; + } + function Oe(t, r) { + t.destroy(r); + } + function P(t) { + { + var r = typeof Symbol == "function" && Symbol.toStringTag, + l = (r && t[Symbol.toStringTag]) || t.constructor.name || "Object"; + return l; + } + } + function ue(t) { + try { + return W(t), !1; + } catch { + return !0; + } + } + function W(t) { + return "" + t; + } + function q(t, r) { + if (ue(t)) { + return ( + c( + "The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.", + r, + P(t), + ), W(t) + ); + } + } + function xe(t, r) { + if (ue(t)) { + return ( + c( + "The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.", + r, + P(t), + ), W(t) + ); + } + } + function _e(t) { + if (ue(t)) { + return ( + c( + "The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.", + P(t), + ), W(t) + ); + } + } + var he = Object.prototype.hasOwnProperty, + F = 0, + ct = 1, + qt = 2, + yt = 3, + Mt = 4, + Lt = 5, + ft = 6, + Me = + ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", + B = Me + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040", + Er = new RegExp("^[" + Me + "][" + B + "]*$"), + tt = {}, + Bt = {}; + function bt(t) { + return he.call(Bt, t) + ? !0 + : he.call(tt, t) + ? !1 + : Er.test(t) + ? ((Bt[t] = !0), !0) + : ((tt[t] = !0), c("Invalid attribute name: `%s`", t), !1); + } + function Le(t, r, l, u) { + if (l !== null && l.type === F) return !1; + switch (typeof r) { + case "function": + case "symbol": + return !0; + case "boolean": { + if (u) return !1; + if (l !== null) return !l.acceptsBooleans; + var p = t.toLowerCase().slice(0, 5); + return p !== "data-" && p !== "aria-"; + } + default: + return !1; + } + } + function er(t) { + return ce.hasOwnProperty(t) ? ce[t] : null; + } + function re(t, r, l, u, p, g, y) { + (this.acceptsBooleans = r === qt || r === yt || r === Mt), + (this.attributeName = u), + (this.attributeNamespace = p), + (this.mustUseProperty = l), + (this.propertyName = t), + (this.type = r), + (this.sanitizeURL = g), + (this.removeEmptyString = y); + } + var ce = {}, + tr = [ + "children", + "dangerouslySetInnerHTML", + "defaultValue", + "defaultChecked", + "innerHTML", + "suppressContentEditableWarning", + "suppressHydrationWarning", + "style", + ]; + tr.forEach(function (t) { + ce[t] = new re(t, F, !1, t, null, !1, !1); + }), + [ + ["acceptCharset", "accept-charset"], + ["className", "class"], + ["htmlFor", "for"], + ["httpEquiv", "http-equiv"], + ].forEach(function (t) { + var r = t[0], + l = t[1]; + ce[r] = new re(r, ct, !1, l, null, !1, !1); + }), + ["contentEditable", "draggable", "spellCheck", "value"].forEach( + function (t) { + ce[t] = new re(t, qt, !1, t.toLowerCase(), null, !1, !1); + }, + ), + [ + "autoReverse", + "externalResourcesRequired", + "focusable", + "preserveAlpha", + ].forEach(function (t) { + ce[t] = new re(t, qt, !1, t, null, !1, !1); + }), + [ + "allowFullScreen", + "async", + "autoFocus", + "autoPlay", + "controls", + "default", + "defer", + "disabled", + "disablePictureInPicture", + "disableRemotePlayback", + "formNoValidate", + "hidden", + "loop", + "noModule", + "noValidate", + "open", + "playsInline", + "readOnly", + "required", + "reversed", + "scoped", + "seamless", + "itemScope", + ].forEach(function (t) { + ce[t] = new re(t, yt, !1, t.toLowerCase(), null, !1, !1); + }), + ["checked", "multiple", "muted", "selected"].forEach(function (t) { + ce[t] = new re(t, yt, !0, t, null, !1, !1); + }), + ["capture", "download"].forEach(function (t) { + ce[t] = new re(t, Mt, !1, t, null, !1, !1); + }), + ["cols", "rows", "size", "span"].forEach(function (t) { + ce[t] = new re(t, ft, !1, t, null, !1, !1); + }), + ["rowSpan", "start"].forEach(function (t) { + ce[t] = new re(t, Lt, !1, t.toLowerCase(), null, !1, !1); + }); + var rr = /[\-\:]([a-z])/g, + nr = function (t) { + return t[1].toUpperCase(); + }; + [ + "accent-height", + "alignment-baseline", + "arabic-form", + "baseline-shift", + "cap-height", + "clip-path", + "clip-rule", + "color-interpolation", + "color-interpolation-filters", + "color-profile", + "color-rendering", + "dominant-baseline", + "enable-background", + "fill-opacity", + "fill-rule", + "flood-color", + "flood-opacity", + "font-family", + "font-size", + "font-size-adjust", + "font-stretch", + "font-style", + "font-variant", + "font-weight", + "glyph-name", + "glyph-orientation-horizontal", + "glyph-orientation-vertical", + "horiz-adv-x", + "horiz-origin-x", + "image-rendering", + "letter-spacing", + "lighting-color", + "marker-end", + "marker-mid", + "marker-start", + "overline-position", + "overline-thickness", + "paint-order", + "panose-1", + "pointer-events", + "rendering-intent", + "shape-rendering", + "stop-color", + "stop-opacity", + "strikethrough-position", + "strikethrough-thickness", + "stroke-dasharray", + "stroke-dashoffset", + "stroke-linecap", + "stroke-linejoin", + "stroke-miterlimit", + "stroke-opacity", + "stroke-width", + "text-anchor", + "text-decoration", + "text-rendering", + "underline-position", + "underline-thickness", + "unicode-bidi", + "unicode-range", + "units-per-em", + "v-alphabetic", + "v-hanging", + "v-ideographic", + "v-mathematical", + "vector-effect", + "vert-adv-y", + "vert-origin-x", + "vert-origin-y", + "word-spacing", + "writing-mode", + "xmlns:xlink", + "x-height", + ].forEach(function (t) { + var r = t.replace(rr, nr); + ce[r] = new re(r, ct, !1, t, null, !1, !1); + }), + [ + "xlink:actuate", + "xlink:arcrole", + "xlink:role", + "xlink:show", + "xlink:title", + "xlink:type", + ].forEach(function (t) { + var r = t.replace(rr, nr); + ce[r] = new re(r, ct, !1, t, "http://www.w3.org/1999/xlink", !1, !1); + }), + ["xml:base", "xml:lang", "xml:space"].forEach(function (t) { + var r = t.replace(rr, nr); + ce[r] = new re( + r, + ct, + !1, + t, + "http://www.w3.org/XML/1998/namespace", + !1, + !1, + ); + }), + ["tabIndex", "crossOrigin"].forEach(function (t) { + ce[t] = new re(t, ct, !1, t.toLowerCase(), null, !1, !1); + }); + var Rr = "xlinkHref"; + (ce[Rr] = new re( + "xlinkHref", + ct, + !1, + "xlink:href", + "http://www.w3.org/1999/xlink", + !0, + !1, + )), + ["src", "href", "action", "formAction"].forEach(function (t) { + ce[t] = new re(t, ct, !1, t.toLowerCase(), null, !0, !0); + }); + var St = { + animationIterationCount: !0, + aspectRatio: !0, + borderImageOutset: !0, + borderImageSlice: !0, + borderImageWidth: !0, + boxFlex: !0, + boxFlexGroup: !0, + boxOrdinalGroup: !0, + columnCount: !0, + columns: !0, + flex: !0, + flexGrow: !0, + flexPositive: !0, + flexShrink: !0, + flexNegative: !0, + flexOrder: !0, + gridArea: !0, + gridRow: !0, + gridRowEnd: !0, + gridRowSpan: !0, + gridRowStart: !0, + gridColumn: !0, + gridColumnEnd: !0, + gridColumnSpan: !0, + gridColumnStart: !0, + fontWeight: !0, + lineClamp: !0, + lineHeight: !0, + opacity: !0, + order: !0, + orphans: !0, + tabSize: !0, + widows: !0, + zIndex: !0, + zoom: !0, + fillOpacity: !0, + floodOpacity: !0, + stopOpacity: !0, + strokeDasharray: !0, + strokeDashoffset: !0, + strokeMiterlimit: !0, + strokeOpacity: !0, + strokeWidth: !0, + }; + function so(t, r) { + return t + r.charAt(0).toUpperCase() + r.substring(1); + } + var uo = ["Webkit", "ms", "Moz", "O"]; + Object.keys(St).forEach(function (t) { + uo.forEach(function (r) { + St[so(r, t)] = St[t]; + }); + }); + var ye = { + button: !0, + checkbox: !0, + image: !0, + hidden: !0, + radio: !0, + reset: !0, + submit: !0, + }; + function ve(t, r) { + ye[r.type] || + r.onChange || + r.onInput || + r.readOnly || + r.disabled || + r.value == null || + c( + "You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.", + ), + r.onChange || + r.readOnly || + r.disabled || + r.checked == null || + c( + "You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.", + ); + } + function co(t, r) { + if (t.indexOf("-") === -1) return typeof r.is == "string"; + switch (t) { + case "annotation-xml": + case "color-profile": + case "font-face": + case "font-face-src": + case "font-face-uri": + case "font-face-format": + case "font-face-name": + case "missing-glyph": + return !1; + default: + return !0; + } + } + var or = { + "aria-current": 0, + "aria-description": 0, + "aria-details": 0, + "aria-disabled": 0, + "aria-hidden": 0, + "aria-invalid": 0, + "aria-keyshortcuts": 0, + "aria-label": 0, + "aria-roledescription": 0, + "aria-autocomplete": 0, + "aria-checked": 0, + "aria-expanded": 0, + "aria-haspopup": 0, + "aria-level": 0, + "aria-modal": 0, + "aria-multiline": 0, + "aria-multiselectable": 0, + "aria-orientation": 0, + "aria-placeholder": 0, + "aria-pressed": 0, + "aria-readonly": 0, + "aria-required": 0, + "aria-selected": 0, + "aria-sort": 0, + "aria-valuemax": 0, + "aria-valuemin": 0, + "aria-valuenow": 0, + "aria-valuetext": 0, + "aria-atomic": 0, + "aria-busy": 0, + "aria-live": 0, + "aria-relevant": 0, + "aria-dropeffect": 0, + "aria-grabbed": 0, + "aria-activedescendant": 0, + "aria-colcount": 0, + "aria-colindex": 0, + "aria-colspan": 0, + "aria-controls": 0, + "aria-describedby": 0, + "aria-errormessage": 0, + "aria-flowto": 0, + "aria-labelledby": 0, + "aria-owns": 0, + "aria-posinset": 0, + "aria-rowcount": 0, + "aria-rowindex": 0, + "aria-rowspan": 0, + "aria-setsize": 0, + }, + je = {}, + ha = new RegExp("^(aria)-[" + B + "]*$"), + ar = new RegExp("^(aria)[A-Z][" + B + "]*$"); + function dt(t, r) { + { + if (he.call(je, r) && je[r]) return !0; + if (ar.test(r)) { + var l = "aria-" + r.slice(4).toLowerCase(), + u = or.hasOwnProperty(l) ? l : null; + if (u == null) { + return ( + c( + "Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.", + r, + ), + (je[r] = !0), + !0 + ); + } + if (r !== u) { + return ( + c("Invalid ARIA attribute `%s`. Did you mean `%s`?", r, u), + (je[r] = !0), + !0 + ); + } + } + if (ha.test(r)) { + var p = r.toLowerCase(), + g = or.hasOwnProperty(p) ? p : null; + if (g == null) return (je[r] = !0), !1; + if (r !== g) { + return ( + c("Unknown ARIA attribute `%s`. Did you mean `%s`?", r, g), + (je[r] = !0), + !0 + ); + } + } + } + return !0; + } + function ir(t, r) { + { + var l = []; + for (var u in r) { + var p = dt(t, u); + p || l.push(u); + } + var g = l + .map(function (y) { + return "`" + y + "`"; + }) + .join(", "); + l.length === 1 + ? c( + "Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", + g, + t, + ) + : l.length > 1 && + c( + "Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", + g, + t, + ); + } + } + function fo(t, r) { + co(t, r) || ir(t, r); + } + var lr = !1; + function fn(t, r) { + { + if (t !== "input" && t !== "textarea" && t !== "select") return; + r != null && + r.value === null && + !lr && + ((lr = !0), + t === "select" && r.multiple + ? c( + "`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.", + t, + ) + : c( + "`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.", + t, + )); + } + } + var sr = { + accept: "accept", + acceptcharset: "acceptCharset", + "accept-charset": "acceptCharset", + accesskey: "accessKey", + action: "action", + allowfullscreen: "allowFullScreen", + alt: "alt", + as: "as", + async: "async", + autocapitalize: "autoCapitalize", + autocomplete: "autoComplete", + autocorrect: "autoCorrect", + autofocus: "autoFocus", + autoplay: "autoPlay", + autosave: "autoSave", + capture: "capture", + cellpadding: "cellPadding", + cellspacing: "cellSpacing", + challenge: "challenge", + charset: "charSet", + checked: "checked", + children: "children", + cite: "cite", + class: "className", + classid: "classID", + classname: "className", + cols: "cols", + colspan: "colSpan", + content: "content", + contenteditable: "contentEditable", + contextmenu: "contextMenu", + controls: "controls", + controlslist: "controlsList", + coords: "coords", + crossorigin: "crossOrigin", + dangerouslysetinnerhtml: "dangerouslySetInnerHTML", + data: "data", + datetime: "dateTime", + default: "default", + defaultchecked: "defaultChecked", + defaultvalue: "defaultValue", + defer: "defer", + dir: "dir", + disabled: "disabled", + disablepictureinpicture: "disablePictureInPicture", + disableremoteplayback: "disableRemotePlayback", + download: "download", + draggable: "draggable", + enctype: "encType", + enterkeyhint: "enterKeyHint", + for: "htmlFor", + form: "form", + formmethod: "formMethod", + formaction: "formAction", + formenctype: "formEncType", + formnovalidate: "formNoValidate", + formtarget: "formTarget", + frameborder: "frameBorder", + headers: "headers", + height: "height", + hidden: "hidden", + high: "high", + href: "href", + hreflang: "hrefLang", + htmlfor: "htmlFor", + httpequiv: "httpEquiv", + "http-equiv": "httpEquiv", + icon: "icon", + id: "id", + imagesizes: "imageSizes", + imagesrcset: "imageSrcSet", + innerhtml: "innerHTML", + inputmode: "inputMode", + integrity: "integrity", + is: "is", + itemid: "itemID", + itemprop: "itemProp", + itemref: "itemRef", + itemscope: "itemScope", + itemtype: "itemType", + keyparams: "keyParams", + keytype: "keyType", + kind: "kind", + label: "label", + lang: "lang", + list: "list", + loop: "loop", + low: "low", + manifest: "manifest", + marginwidth: "marginWidth", + marginheight: "marginHeight", + max: "max", + maxlength: "maxLength", + media: "media", + mediagroup: "mediaGroup", + method: "method", + min: "min", + minlength: "minLength", + multiple: "multiple", + muted: "muted", + name: "name", + nomodule: "noModule", + nonce: "nonce", + novalidate: "noValidate", + open: "open", + optimum: "optimum", + pattern: "pattern", + placeholder: "placeholder", + playsinline: "playsInline", + poster: "poster", + preload: "preload", + profile: "profile", + radiogroup: "radioGroup", + readonly: "readOnly", + referrerpolicy: "referrerPolicy", + rel: "rel", + required: "required", + reversed: "reversed", + role: "role", + rows: "rows", + rowspan: "rowSpan", + sandbox: "sandbox", + scope: "scope", + scoped: "scoped", + scrolling: "scrolling", + seamless: "seamless", + selected: "selected", + shape: "shape", + size: "size", + sizes: "sizes", + span: "span", + spellcheck: "spellCheck", + src: "src", + srcdoc: "srcDoc", + srclang: "srcLang", + srcset: "srcSet", + start: "start", + step: "step", + style: "style", + summary: "summary", + tabindex: "tabIndex", + target: "target", + title: "title", + type: "type", + usemap: "useMap", + value: "value", + width: "width", + wmode: "wmode", + wrap: "wrap", + about: "about", + accentheight: "accentHeight", + "accent-height": "accentHeight", + accumulate: "accumulate", + additive: "additive", + alignmentbaseline: "alignmentBaseline", + "alignment-baseline": "alignmentBaseline", + allowreorder: "allowReorder", + alphabetic: "alphabetic", + amplitude: "amplitude", + arabicform: "arabicForm", + "arabic-form": "arabicForm", + ascent: "ascent", + attributename: "attributeName", + attributetype: "attributeType", + autoreverse: "autoReverse", + azimuth: "azimuth", + basefrequency: "baseFrequency", + baselineshift: "baselineShift", + "baseline-shift": "baselineShift", + baseprofile: "baseProfile", + bbox: "bbox", + begin: "begin", + bias: "bias", + by: "by", + calcmode: "calcMode", + capheight: "capHeight", + "cap-height": "capHeight", + clip: "clip", + clippath: "clipPath", + "clip-path": "clipPath", + clippathunits: "clipPathUnits", + cliprule: "clipRule", + "clip-rule": "clipRule", + color: "color", + colorinterpolation: "colorInterpolation", + "color-interpolation": "colorInterpolation", + colorinterpolationfilters: "colorInterpolationFilters", + "color-interpolation-filters": "colorInterpolationFilters", + colorprofile: "colorProfile", + "color-profile": "colorProfile", + colorrendering: "colorRendering", + "color-rendering": "colorRendering", + contentscripttype: "contentScriptType", + contentstyletype: "contentStyleType", + cursor: "cursor", + cx: "cx", + cy: "cy", + d: "d", + datatype: "datatype", + decelerate: "decelerate", + descent: "descent", + diffuseconstant: "diffuseConstant", + direction: "direction", + display: "display", + divisor: "divisor", + dominantbaseline: "dominantBaseline", + "dominant-baseline": "dominantBaseline", + dur: "dur", + dx: "dx", + dy: "dy", + edgemode: "edgeMode", + elevation: "elevation", + enablebackground: "enableBackground", + "enable-background": "enableBackground", + end: "end", + exponent: "exponent", + externalresourcesrequired: "externalResourcesRequired", + fill: "fill", + fillopacity: "fillOpacity", + "fill-opacity": "fillOpacity", + fillrule: "fillRule", + "fill-rule": "fillRule", + filter: "filter", + filterres: "filterRes", + filterunits: "filterUnits", + floodopacity: "floodOpacity", + "flood-opacity": "floodOpacity", + floodcolor: "floodColor", + "flood-color": "floodColor", + focusable: "focusable", + fontfamily: "fontFamily", + "font-family": "fontFamily", + fontsize: "fontSize", + "font-size": "fontSize", + fontsizeadjust: "fontSizeAdjust", + "font-size-adjust": "fontSizeAdjust", + fontstretch: "fontStretch", + "font-stretch": "fontStretch", + fontstyle: "fontStyle", + "font-style": "fontStyle", + fontvariant: "fontVariant", + "font-variant": "fontVariant", + fontweight: "fontWeight", + "font-weight": "fontWeight", + format: "format", + from: "from", + fx: "fx", + fy: "fy", + g1: "g1", + g2: "g2", + glyphname: "glyphName", + "glyph-name": "glyphName", + glyphorientationhorizontal: "glyphOrientationHorizontal", + "glyph-orientation-horizontal": "glyphOrientationHorizontal", + glyphorientationvertical: "glyphOrientationVertical", + "glyph-orientation-vertical": "glyphOrientationVertical", + glyphref: "glyphRef", + gradienttransform: "gradientTransform", + gradientunits: "gradientUnits", + hanging: "hanging", + horizadvx: "horizAdvX", + "horiz-adv-x": "horizAdvX", + horizoriginx: "horizOriginX", + "horiz-origin-x": "horizOriginX", + ideographic: "ideographic", + imagerendering: "imageRendering", + "image-rendering": "imageRendering", + in2: "in2", + in: "in", + inlist: "inlist", + intercept: "intercept", + k1: "k1", + k2: "k2", + k3: "k3", + k4: "k4", + k: "k", + kernelmatrix: "kernelMatrix", + kernelunitlength: "kernelUnitLength", + kerning: "kerning", + keypoints: "keyPoints", + keysplines: "keySplines", + keytimes: "keyTimes", + lengthadjust: "lengthAdjust", + letterspacing: "letterSpacing", + "letter-spacing": "letterSpacing", + lightingcolor: "lightingColor", + "lighting-color": "lightingColor", + limitingconeangle: "limitingConeAngle", + local: "local", + markerend: "markerEnd", + "marker-end": "markerEnd", + markerheight: "markerHeight", + markermid: "markerMid", + "marker-mid": "markerMid", + markerstart: "markerStart", + "marker-start": "markerStart", + markerunits: "markerUnits", + markerwidth: "markerWidth", + mask: "mask", + maskcontentunits: "maskContentUnits", + maskunits: "maskUnits", + mathematical: "mathematical", + mode: "mode", + numoctaves: "numOctaves", + offset: "offset", + opacity: "opacity", + operator: "operator", + order: "order", + orient: "orient", + orientation: "orientation", + origin: "origin", + overflow: "overflow", + overlineposition: "overlinePosition", + "overline-position": "overlinePosition", + overlinethickness: "overlineThickness", + "overline-thickness": "overlineThickness", + paintorder: "paintOrder", + "paint-order": "paintOrder", + panose1: "panose1", + "panose-1": "panose1", + pathlength: "pathLength", + patterncontentunits: "patternContentUnits", + patterntransform: "patternTransform", + patternunits: "patternUnits", + pointerevents: "pointerEvents", + "pointer-events": "pointerEvents", + points: "points", + pointsatx: "pointsAtX", + pointsaty: "pointsAtY", + pointsatz: "pointsAtZ", + prefix: "prefix", + preservealpha: "preserveAlpha", + preserveaspectratio: "preserveAspectRatio", + primitiveunits: "primitiveUnits", + property: "property", + r: "r", + radius: "radius", + refx: "refX", + refy: "refY", + renderingintent: "renderingIntent", + "rendering-intent": "renderingIntent", + repeatcount: "repeatCount", + repeatdur: "repeatDur", + requiredextensions: "requiredExtensions", + requiredfeatures: "requiredFeatures", + resource: "resource", + restart: "restart", + result: "result", + results: "results", + rotate: "rotate", + rx: "rx", + ry: "ry", + scale: "scale", + security: "security", + seed: "seed", + shaperendering: "shapeRendering", + "shape-rendering": "shapeRendering", + slope: "slope", + spacing: "spacing", + specularconstant: "specularConstant", + specularexponent: "specularExponent", + speed: "speed", + spreadmethod: "spreadMethod", + startoffset: "startOffset", + stddeviation: "stdDeviation", + stemh: "stemh", + stemv: "stemv", + stitchtiles: "stitchTiles", + stopcolor: "stopColor", + "stop-color": "stopColor", + stopopacity: "stopOpacity", + "stop-opacity": "stopOpacity", + strikethroughposition: "strikethroughPosition", + "strikethrough-position": "strikethroughPosition", + strikethroughthickness: "strikethroughThickness", + "strikethrough-thickness": "strikethroughThickness", + string: "string", + stroke: "stroke", + strokedasharray: "strokeDasharray", + "stroke-dasharray": "strokeDasharray", + strokedashoffset: "strokeDashoffset", + "stroke-dashoffset": "strokeDashoffset", + strokelinecap: "strokeLinecap", + "stroke-linecap": "strokeLinecap", + strokelinejoin: "strokeLinejoin", + "stroke-linejoin": "strokeLinejoin", + strokemiterlimit: "strokeMiterlimit", + "stroke-miterlimit": "strokeMiterlimit", + strokewidth: "strokeWidth", + "stroke-width": "strokeWidth", + strokeopacity: "strokeOpacity", + "stroke-opacity": "strokeOpacity", + suppresscontenteditablewarning: "suppressContentEditableWarning", + suppresshydrationwarning: "suppressHydrationWarning", + surfacescale: "surfaceScale", + systemlanguage: "systemLanguage", + tablevalues: "tableValues", + targetx: "targetX", + targety: "targetY", + textanchor: "textAnchor", + "text-anchor": "textAnchor", + textdecoration: "textDecoration", + "text-decoration": "textDecoration", + textlength: "textLength", + textrendering: "textRendering", + "text-rendering": "textRendering", + to: "to", + transform: "transform", + typeof: "typeof", + u1: "u1", + u2: "u2", + underlineposition: "underlinePosition", + "underline-position": "underlinePosition", + underlinethickness: "underlineThickness", + "underline-thickness": "underlineThickness", + unicode: "unicode", + unicodebidi: "unicodeBidi", + "unicode-bidi": "unicodeBidi", + unicoderange: "unicodeRange", + "unicode-range": "unicodeRange", + unitsperem: "unitsPerEm", + "units-per-em": "unitsPerEm", + unselectable: "unselectable", + valphabetic: "vAlphabetic", + "v-alphabetic": "vAlphabetic", + values: "values", + vectoreffect: "vectorEffect", + "vector-effect": "vectorEffect", + version: "version", + vertadvy: "vertAdvY", + "vert-adv-y": "vertAdvY", + vertoriginx: "vertOriginX", + "vert-origin-x": "vertOriginX", + vertoriginy: "vertOriginY", + "vert-origin-y": "vertOriginY", + vhanging: "vHanging", + "v-hanging": "vHanging", + videographic: "vIdeographic", + "v-ideographic": "vIdeographic", + viewbox: "viewBox", + viewtarget: "viewTarget", + visibility: "visibility", + vmathematical: "vMathematical", + "v-mathematical": "vMathematical", + vocab: "vocab", + widths: "widths", + wordspacing: "wordSpacing", + "word-spacing": "wordSpacing", + writingmode: "writingMode", + "writing-mode": "writingMode", + x1: "x1", + x2: "x2", + x: "x", + xchannelselector: "xChannelSelector", + xheight: "xHeight", + "x-height": "xHeight", + xlinkactuate: "xlinkActuate", + "xlink:actuate": "xlinkActuate", + xlinkarcrole: "xlinkArcrole", + "xlink:arcrole": "xlinkArcrole", + xlinkhref: "xlinkHref", + "xlink:href": "xlinkHref", + xlinkrole: "xlinkRole", + "xlink:role": "xlinkRole", + xlinkshow: "xlinkShow", + "xlink:show": "xlinkShow", + xlinktitle: "xlinkTitle", + "xlink:title": "xlinkTitle", + xlinktype: "xlinkType", + "xlink:type": "xlinkType", + xmlbase: "xmlBase", + "xml:base": "xmlBase", + xmllang: "xmlLang", + "xml:lang": "xmlLang", + xmlns: "xmlns", + "xml:space": "xmlSpace", + xmlnsxlink: "xmlnsXlink", + "xmlns:xlink": "xmlnsXlink", + xmlspace: "xmlSpace", + y1: "y1", + y2: "y2", + y: "y", + ychannelselector: "yChannelSelector", + z: "z", + zoomandpan: "zoomAndPan", + }, + pt = function () {}; + { + var ke = {}, + po = /^on./, + va = /^on[^A-Z]/, + ga = new RegExp("^(aria)-[" + B + "]*$"), + dn = new RegExp("^(aria)[A-Z][" + B + "]*$"); + pt = function (t, r, l, u) { + if (he.call(ke, r) && ke[r]) return !0; + var p = r.toLowerCase(); + if (p === "onfocusin" || p === "onfocusout") { + return ( + c( + "React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React.", + ), + (ke[r] = !0), + !0 + ); + } + if (u != null) { + var g = u.registrationNameDependencies, + y = u.possibleRegistrationNames; + if (g.hasOwnProperty(r)) return !0; + var w = y.hasOwnProperty(p) ? y[p] : null; + if (w != null) { + return ( + c( + "Invalid event handler property `%s`. Did you mean `%s`?", + r, + w, + ), + (ke[r] = !0), + !0 + ); + } + if (po.test(r)) { + return ( + c( + "Unknown event handler property `%s`. It will be ignored.", + r, + ), + (ke[r] = !0), + !0 + ); + } + } else if (po.test(r)) { + return ( + va.test(r) && + c( + "Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.", + r, + ), + (ke[r] = !0), + !0 + ); + } + if (ga.test(r) || dn.test(r)) return !0; + if (p === "innerhtml") { + return ( + c( + "Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`.", + ), + (ke[r] = !0), + !0 + ); + } + if (p === "aria") { + return ( + c( + "The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead.", + ), + (ke[r] = !0), + !0 + ); + } + if ( + p === "is" && l !== null && l !== void 0 && typeof l != "string" + ) { + return ( + c( + "Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.", + typeof l, + ), + (ke[r] = !0), + !0 + ); + } + if (typeof l == "number" && isNaN(l)) { + return ( + c( + "Received NaN for the `%s` attribute. If this is expected, cast the value to a string.", + r, + ), + (ke[r] = !0), + !0 + ); + } + var C = er(r), + _ = C !== null && C.type === F; + if (sr.hasOwnProperty(p)) { + var O = sr[p]; + if (O !== r) { + return ( + c("Invalid DOM property `%s`. Did you mean `%s`?", r, O), + (ke[r] = !0), + !0 + ); + } + } else if (!_ && r !== p) { + return ( + c( + "React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.", + r, + p, + ), + (ke[r] = !0), + !0 + ); + } + return typeof l == "boolean" && Le(r, l, C, !1) + ? (l + ? c( + 'Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.', + l, + r, + r, + l, + r, + ) + : c( + 'Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.', + l, + r, + r, + l, + r, + r, + r, + ), + (ke[r] = !0), + !0) + : _ + ? !0 + : Le(r, l, C, !1) + ? ((ke[r] = !0), !1) + : ((l === "false" || l === "true") && + C !== null && + C.type === yt && + (c( + "Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?", + l, + r, + l === "false" + ? "The browser will interpret it as a truthy value." + : 'Although this works, it will not work as expected if you pass the string "false".', + r, + l, + ), + (ke[r] = !0)), + !0); + }; + } + var ho = function (t, r, l) { + { + var u = []; + for (var p in r) { + var g = pt(t, p, r[p], l); + g || u.push(p); + } + var y = u + .map(function (w) { + return "`" + w + "`"; + }) + .join(", "); + u.length === 1 + ? c( + "Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", + y, + t, + ) + : u.length > 1 && + c( + "Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", + y, + t, + ); + } + }; + function ma(t, r, l) { + co(t, r) || ho(t, r, l); + } + var pn = function () {}; + { + var wt = /^(?:webkit|moz|o)[A-Z]/, + Te = /^-ms-/, + vo = /-(.)/g, + go = /;\s*$/, + xt = {}, + hn = {}, + vn = !1, + Ir = !1, + ur = function (t) { + return t.replace(vo, function (r, l) { + return l.toUpperCase(); + }); + }, + _r = function (t) { + (xt.hasOwnProperty(t) && xt[t]) || + ((xt[t] = !0), + c( + "Unsupported style property %s. Did you mean %s?", + t, + ur(t.replace(Te, "ms-")), + )); + }, + ya = function (t) { + (xt.hasOwnProperty(t) && xt[t]) || + ((xt[t] = !0), + c( + "Unsupported vendor-prefixed style property %s. Did you mean %s?", + t, + t.charAt(0).toUpperCase() + t.slice(1), + )); + }, + ba = function (t, r) { + (hn.hasOwnProperty(r) && hn[r]) || + ((hn[r] = !0), + c( + `Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`, + t, + r.replace(go, ""), + )); + }, + mo = function (t, r) { + vn || + ((vn = !0), + c( + "`NaN` is an invalid value for the `%s` css style property.", + t, + )); + }, + Ut = function (t, r) { + Ir || + ((Ir = !0), + c( + "`Infinity` is an invalid value for the `%s` css style property.", + t, + )); + }; + pn = function (t, r) { + t.indexOf("-") > -1 + ? _r(t) + : wt.test(t) + ? ya(t) + : go.test(r) && ba(t, r), + typeof r == "number" && + (isNaN(r) ? mo(t, r) : isFinite(r) || Ut(t, r)); + }; + } + var gn = pn, + jt = /["'&<>]/; + function Pr(t) { + _e(t); + var r = "" + t, + l = jt.exec(r); + if (!l) return r; + var u, + p = "", + g, + y = 0; + for (g = l.index; g < r.length; g++) { + switch (r.charCodeAt(g)) { + case 34: + u = """; + break; + case 38: + u = "&"; + break; + case 39: + u = "'"; + break; + case 60: + u = "<"; + break; + case 62: + u = ">"; + break; + default: + continue; + } + y !== g && (p += r.substring(y, g)), (y = g + 1), (p += u); + } + return y !== g ? p + r.substring(y, g) : p; + } + function ge(t) { + return typeof t == "boolean" || typeof t == "number" ? "" + t : Pr(t); + } + var Sa = /([A-Z])/g, + wa = /^ms-/; + function xa(t) { + return t.replace(Sa, "-$1").toLowerCase().replace(wa, "-ms-"); + } + var ka = + /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i, + mn = !1; + function yo(t) { + !mn && + ka.test(t) && + ((mn = !0), + c( + "A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.", + JSON.stringify(t), + )); + } + var Ta = Array.isArray; + function me(t) { + return Ta(t); + } + var be = "<script>", + Ca = "</script>", + Ea = '<script src="', + Ra = '<script type="module" src="', + bo = '" async=""></script>'; + function So(t) { + return _e(t), ("" + t).replace(Ia, _a); + } + var Ia = /(<\/|<)(s)(cript)/gi, + _a = function (t, r, l, u) { + return "" + r + (l === "s" ? "\\u0073" : "\\u0053") + u; + }; + function cr(t, r, l, u, p) { + var g = t === void 0 ? "" : t, + y = r === void 0 ? be : '<script nonce="' + ge(r) + '">', + w = []; + if ((l !== void 0 && w.push(y, So(l), Ca), u !== void 0)) { + for (var C = 0; C < u.length; C++) w.push(Ea, ge(u[C]), bo); + } + if (p !== void 0) { + for (var _ = 0; _ < p.length; _++) w.push(Ra, ge(p[_]), bo); + } + return { + bootstrapChunks: w, + startInlineScript: y, + placeholderPrefix: g + "P:", + segmentPrefix: g + "S:", + boundaryPrefix: g + "B:", + idPrefix: g, + nextSuspenseID: 0, + sentCompleteSegmentFunction: !1, + sentCompleteBoundaryFunction: !1, + sentClientRenderFunction: !1, + }; + } + var Fr = 0, + kt = 1, + Ar = 2, + Dr = 3, + fr = 4, + yn = 5, + Tt = 6, + Or = 7; + function He(t, r) { + return { insertionMode: t, selectedValue: r }; + } + function Ht(t, r, l) { + switch (r) { + case "select": + return He(kt, l.value != null ? l.value : l.defaultValue); + case "svg": + return He(Ar, null); + case "math": + return He(Dr, null); + case "foreignObject": + return He(kt, null); + case "table": + return He(fr, null); + case "thead": + case "tbody": + case "tfoot": + return He(yn, null); + case "colgroup": + return He(Or, null); + case "tr": + return He(Tt, null); + } + return t.insertionMode >= fr || t.insertionMode === Fr + ? He(kt, null) + : t; + } + var Ct = null; + function Wt(t) { + var r = t.nextSuspenseID++; + return t.boundaryPrefix + r.toString(16); + } + function zt(t, r, l) { + var u = t.idPrefix, + p = ":" + u + "R" + r; + return l > 0 && (p += "H" + l.toString(32)), p + ":"; + } + function Et(t) { + return ge(t); + } + var dr = "<!-- -->"; + function bn(t, r, l, u) { + return r === "" ? u : (u && t.push(dr), t.push(Et(r)), !0); + } + function Sn(t, r, l, u) { + l && u && t.push(dr); + } + var Ee = new Map(); + function wn(t) { + var r = Ee.get(t); + if (r !== void 0) return r; + var l = ge(xa(t)); + return Ee.set(t, l), l; + } + var Mr = ' style="', + Lr = ":", + Br = ";"; + function wo(t, r, l) { + if (typeof l != "object") { + throw new Error( + "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.", + ); + } + var u = !0; + for (var p in l) { + if (!!he.call(l, p)) { + var g = l[p]; + if (!(g == null || typeof g == "boolean" || g === "")) { + var y = void 0, + w = void 0, + C = p.indexOf("--") === 0; + C + ? ((y = ge(p)), xe(g, p), (w = ge(("" + g).trim()))) + : (gn(p, g), + (y = wn(p)), + typeof g == "number" + ? g !== 0 && !he.call(St, p) ? (w = g + "px") : (w = "" + g) + : (xe(g, p), (w = ge(("" + g).trim())))), + u ? ((u = !1), t.push(Mr, y, Lr, w)) : t.push(Br, y, Lr, w); + } + } + } + u || t.push(ht); + } + var We = " ", + Rt = '="', + ht = '"', + $t = '=""'; + function Ce(t, r, l, u) { + switch (l) { + case "style": { + wo(t, r, u); + return; + } + case "defaultValue": + case "defaultChecked": + case "innerHTML": + case "suppressContentEditableWarning": + case "suppressHydrationWarning": + return; + } + if ( + !( + l.length > 2 && + (l[0] === "o" || l[0] === "O") && + (l[1] === "n" || l[1] === "N") + ) + ) { + var p = er(l); + if (p !== null) { + switch (typeof u) { + case "function": + case "symbol": + return; + case "boolean": + if (!p.acceptsBooleans) return; + } + var g = p.attributeName, + y = g; + switch (p.type) { + case yt: + u && t.push(We, y, $t); + return; + case Mt: + u === !0 + ? t.push(We, y, $t) + : u === !1 || t.push(We, y, Rt, ge(u), ht); + return; + case Lt: + isNaN(u) || t.push(We, y, Rt, ge(u), ht); + break; + case ft: + !isNaN(u) && u >= 1 && t.push(We, y, Rt, ge(u), ht); + break; + default: + p.sanitizeURL && (q(u, g), (u = "" + u), yo(u)), + t.push(We, y, Rt, ge(u), ht); + } + } else if (bt(l)) { + switch (typeof u) { + case "function": + case "symbol": + return; + case "boolean": { + var w = l.toLowerCase().slice(0, 5); + if (w !== "data-" && w !== "aria-") return; + } + } + t.push(We, l, Rt, ge(u), ht); + } + } + } + var rt = ">", + pr = "/>"; + function hr(t, r, l) { + if (r != null) { + if (l != null) { + throw new Error( + "Can only set one of `children` or `props.dangerouslySetInnerHTML`.", + ); + } + if (typeof r != "object" || !("__html" in r)) { + throw new Error( + "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.", + ); + } + var u = r.__html; + u != null && (_e(u), t.push("" + u)); + } + } + var It = !1, + vr = !1, + Ze = !1, + _t = !1, + vt = !1, + Ur = !1, + Re = !1; + function Je(t, r) { + { + var l = t[r]; + if (l != null) { + var u = me(l); + t.multiple && !u + ? c( + "The `%s` prop supplied to <select> must be an array if `multiple` is true.", + r, + ) + : !t.multiple && + u && + c( + "The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.", + r, + ); + } + } + } + function xn(t, r, l) { + ve("select", r), + Je(r, "value"), + Je(r, "defaultValue"), + r.value !== void 0 && + r.defaultValue !== void 0 && + !Ze && + (c( + "Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://reactjs.org/link/controlled-components", + ), + (Ze = !0)), + t.push(Be("select")); + var u = null, + p = null; + for (var g in r) { + if (he.call(r, g)) { + var y = r[g]; + if (y == null) continue; + switch (g) { + case "children": + u = y; + break; + case "dangerouslySetInnerHTML": + p = y; + break; + case "defaultValue": + case "value": + break; + default: + Ce(t, l, g, y); + break; + } + } + } + return t.push(rt), hr(t, p, u), u; + } + function gr(t) { + var r = ""; + return ( + e.Children.forEach(t, function (l) { + l != null && + ((r += l), + !vt && + typeof l != "string" && + typeof l != "number" && + ((vt = !0), + c( + "Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>.", + ))); + }), r + ); + } + var jr = ' selected=""'; + function kn(t, r, l, u) { + var p = u.selectedValue; + t.push(Be("option")); + var g = null, + y = null, + w = null, + C = null; + for (var _ in r) { + if (he.call(r, _)) { + var O = r[_]; + if (O == null) continue; + switch (_) { + case "children": + g = O; + break; + case "selected": + (w = O), + Re || + (c( + "Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>.", + ), + (Re = !0)); + break; + case "dangerouslySetInnerHTML": + C = O; + break; + case "value": + y = O; + default: + Ce(t, l, _, O); + break; + } + } + } + if (p != null) { + var j; + if ( + (y !== null ? (q(y, "value"), (j = "" + y)) : (C !== null && + (Ur || + ((Ur = !0), + c( + "Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected.", + ))), + (j = gr(g))), + me(p)) + ) { + for (var Z = 0; Z < p.length; Z++) { + q(p[Z], "value"); + var de = "" + p[Z]; + if (de === j) { + t.push(jr); + break; + } + } + } else q(p, "select.value"), "" + p === j && t.push(jr); + } else w && t.push(jr); + return t.push(rt), hr(t, C, g), g; + } + function Tn(t, r, l) { + ve("input", r), + r.checked !== void 0 && + r.defaultChecked !== void 0 && + !vr && + (c( + "%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", + "A component", + r.type, + ), + (vr = !0)), + r.value !== void 0 && + r.defaultValue !== void 0 && + !It && + (c( + "%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", + "A component", + r.type, + ), + (It = !0)), + t.push(Be("input")); + var u = null, + p = null, + g = null, + y = null; + for (var w in r) { + if (he.call(r, w)) { + var C = r[w]; + if (C == null) continue; + switch (w) { + case "children": + case "dangerouslySetInnerHTML": + throw new Error( + "input is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.", + ); + case "defaultChecked": + y = C; + break; + case "defaultValue": + p = C; + break; + case "checked": + g = C; + break; + case "value": + u = C; + break; + default: + Ce(t, l, w, C); + break; + } + } + } + return ( + g !== null + ? Ce(t, l, "checked", g) + : y !== null && Ce(t, l, "checked", y), + u !== null + ? Ce(t, l, "value", u) + : p !== null && Ce(t, l, "value", p), + t.push(pr), + null + ); + } + function xo(t, r, l) { + ve("textarea", r), + r.value !== void 0 && + r.defaultValue !== void 0 && + !_t && + (c( + "Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components", + ), + (_t = !0)), + t.push(Be("textarea")); + var u = null, + p = null, + g = null; + for (var y in r) { + if (he.call(r, y)) { + var w = r[y]; + if (w == null) continue; + switch (y) { + case "children": + g = w; + break; + case "value": + u = w; + break; + case "defaultValue": + p = w; + break; + case "dangerouslySetInnerHTML": + throw new Error( + "`dangerouslySetInnerHTML` does not make sense on <textarea>.", + ); + default: + Ce(t, l, y, w); + break; + } + } + } + if ((u === null && p !== null && (u = p), t.push(rt), g != null)) { + if ( + (c( + "Use the `defaultValue` or `value` props instead of setting children on <textarea>.", + ), + u != null) + ) { + throw new Error( + "If you supply `defaultValue` on a <textarea>, do not pass children.", + ); + } + if (me(g)) { + if (g.length > 1) { + throw new Error("<textarea> can only have at most one child."); + } + _e(g[0]), (u = "" + g[0]); + } + _e(g), (u = "" + g); + } + return ( + typeof u == "string" && + u[0] === + ` +` && + t.push(gt), + u !== null && (q(u, "value"), t.push(Et("" + u))), + null + ); + } + function ko(t, r, l, u) { + t.push(Be(l)); + for (var p in r) { + if (he.call(r, p)) { + var g = r[p]; + if (g == null) continue; + switch (p) { + case "children": + case "dangerouslySetInnerHTML": + throw new Error( + l + + " is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.", + ); + default: + Ce(t, u, p, g); + break; + } + } + } + return t.push(pr), null; + } + function To(t, r, l) { + t.push(Be("menuitem")); + for (var u in r) { + if (he.call(r, u)) { + var p = r[u]; + if (p == null) continue; + switch (u) { + case "children": + case "dangerouslySetInnerHTML": + throw new Error( + "menuitems cannot have `children` nor `dangerouslySetInnerHTML`.", + ); + default: + Ce(t, l, u, p); + break; + } + } + } + return t.push(rt), null; + } + function Cn(t, r, l) { + t.push(Be("title")); + var u = null; + for (var p in r) { + if (he.call(r, p)) { + var g = r[p]; + if (g == null) continue; + switch (p) { + case "children": + u = g; + break; + case "dangerouslySetInnerHTML": + throw new Error( + "`dangerouslySetInnerHTML` does not make sense on <title>.", + ); + default: + Ce(t, l, p, g); + break; + } + } + } + t.push(rt); + { + var y = Array.isArray(u) && u.length < 2 ? u[0] || null : u; + Array.isArray(u) && u.length > 1 + ? c( + "A title element received an array with more than 1 element as children. In browsers title Elements can only have Text Nodes as children. If the children being rendered output more than a single text node in aggregate the browser will display markup and comments as text in the title and hydration will likely fail and fall back to client rendering", + ) + : y != null && y.$$typeof != null + ? c( + "A title element received a React element for children. In the browser title Elements can only have Text Nodes as children. If the children being rendered output more than a single text node in aggregate the browser will display markup and comments as text in the title and hydration will likely fail and fall back to client rendering", + ) + : y != null && + typeof y != "string" && + typeof y != "number" && + c( + "A title element received a value that was not a string or number for children. In the browser title Elements can only have Text Nodes as children. If the children being rendered output more than a single text node in aggregate the browser will display markup and comments as text in the title and hydration will likely fail and fall back to client rendering", + ); + } + return u; + } + function Pt(t, r, l, u) { + t.push(Be(l)); + var p = null, + g = null; + for (var y in r) { + if (he.call(r, y)) { + var w = r[y]; + if (w == null) continue; + switch (y) { + case "children": + p = w; + break; + case "dangerouslySetInnerHTML": + g = w; + break; + default: + Ce(t, u, y, w); + break; + } + } + } + return ( + t.push(rt), + hr(t, g, p), + typeof p == "string" ? (t.push(Et(p)), null) : p + ); + } + function Pa(t, r, l, u) { + t.push(Be(l)); + var p = null, + g = null; + for (var y in r) { + if (he.call(r, y)) { + var w = r[y]; + if (w == null) continue; + switch (y) { + case "children": + p = w; + break; + case "dangerouslySetInnerHTML": + g = w; + break; + case "style": + wo(t, u, w); + break; + case "suppressContentEditableWarning": + case "suppressHydrationWarning": + break; + default: + bt(y) && + typeof w != "function" && + typeof w != "symbol" && + t.push(We, y, Rt, ge(w), ht); + break; + } + } + } + return t.push(rt), hr(t, g, p), p; + } + var gt = ` +`; + function Hr(t, r, l, u) { + t.push(Be(l)); + var p = null, + g = null; + for (var y in r) { + if (he.call(r, y)) { + var w = r[y]; + if (w == null) continue; + switch (y) { + case "children": + p = w; + break; + case "dangerouslySetInnerHTML": + g = w; + break; + default: + Ce(t, u, y, w); + break; + } + } + } + if ((t.push(rt), g != null)) { + if (p != null) { + throw new Error( + "Can only set one of `children` or `props.dangerouslySetInnerHTML`.", + ); + } + if (typeof g != "object" || !("__html" in g)) { + throw new Error( + "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.", + ); + } + var C = g.__html; + C != null && + (typeof C == "string" && + C.length > 0 && + C[0] === + ` +` + ? t.push(gt, C) + : (_e(C), t.push("" + C))); + } + return ( + typeof p == "string" && + p[0] === + ` +` && + t.push(gt), p + ); + } + var Fa = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/, + mr = new Map(); + function Be(t) { + var r = mr.get(t); + if (r === void 0) { + if (!Fa.test(t)) throw new Error("Invalid tag: " + t); + (r = "<" + t), mr.set(t, r); + } + return r; + } + var En = "<!DOCTYPE html>"; + function Rn(t, r, l, u, p) { + switch ( + (fo(r, l), + fn(r, l), + ma(r, l, null), + !l.suppressContentEditableWarning && + l.contentEditable && + l.children != null && + c( + "A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional.", + ), + p.insertionMode !== Ar && + p.insertionMode !== Dr && + r.indexOf("-") === -1 && + typeof l.is != "string" && + r.toLowerCase() !== r && + c( + "<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.", + r, + ), + r) + ) { + case "select": + return xn(t, l, u); + case "option": + return kn(t, l, u, p); + case "textarea": + return xo(t, l, u); + case "input": + return Tn(t, l, u); + case "menuitem": + return To(t, l, u); + case "title": + return Cn(t, l, u); + case "listing": + case "pre": + return Hr(t, l, r, u); + case "area": + case "base": + case "br": + case "col": + case "embed": + case "hr": + case "img": + case "keygen": + case "link": + case "meta": + case "param": + case "source": + case "track": + case "wbr": + return ko(t, l, r, u); + case "annotation-xml": + case "color-profile": + case "font-face": + case "font-face-src": + case "font-face-uri": + case "font-face-format": + case "font-face-name": + case "missing-glyph": + return Pt(t, l, r, u); + case "html": + return p.insertionMode === Fr && t.push(En), Pt(t, l, r, u); + default: + return r.indexOf("-") === -1 && typeof l.is != "string" + ? Pt(t, l, r, u) + : Pa(t, l, r, u); + } + } + var Aa = "</", + In = ">"; + function Da(t, r, l) { + switch (r) { + case "area": + case "base": + case "br": + case "col": + case "embed": + case "hr": + case "img": + case "input": + case "keygen": + case "link": + case "meta": + case "param": + case "source": + case "track": + case "wbr": + break; + default: + t.push(Aa, r, In); + } + } + function _n(t, r) { + for (var l = r.bootstrapChunks, u = 0; u < l.length - 1; u++) { + x(t, l[u]); + } + return u < l.length ? R(t, l[u]) : !0; + } + var h = '<template id="', + b = '"></template>'; + function k(t, r, l) { + x(t, h), x(t, r.placeholderPrefix); + var u = l.toString(16); + return x(t, u), R(t, b); + } + var T = "<!--$-->", + I = '<!--$?--><template id="', + U = '"></template>', + M = "<!--$!-->", + H = "<!--/$-->", + z = "<template", + Y = '"', + Q = ' data-dgst="', + K = ' data-msg="', + ee = ' data-stck="', + fe = "></template>"; + function Se(t, r) { + return R(t, T); + } + function yr(t, r, l) { + if ((x(t, I), l === null)) { + throw new Error( + "An ID must have been assigned before we can complete the boundary.", + ); + } + return x(t, l), R(t, U); + } + function Pn(t, r, l, u, p) { + var g; + return ( + (g = R(t, M)), + x(t, z), + l && (x(t, Q), x(t, ge(l)), x(t, Y)), + u && (x(t, K), x(t, ge(u)), x(t, Y)), + p && (x(t, ee), x(t, ge(p)), x(t, Y)), + (g = R(t, fe)), + g + ); + } + function Wr(t, r) { + return R(t, H); + } + function Co(t, r) { + return R(t, H); + } + function zr(t, r) { + return R(t, H); + } + var Oa = '<div hidden id="', + Eo = '">', + Ma = "</div>", + vs = '<svg aria-hidden="true" style="display:none" id="', + gs = '">', + Ni = "</svg>", + ms = '<math aria-hidden="true" style="display:none" id="', + ys = '">', + Vi = "</math>", + bs = '<table hidden id="', + Ss = '">', + ws = "</table>", + xs = '<table hidden><tbody id="', + ks = '">', + Ts = "</tbody></table>", + Cs = '<table hidden><tr id="', + Es = '">', + Rs = "</tr></table>", + Is = '<table hidden><colgroup id="', + _s = '">', + Ps = "</colgroup></table>"; + function Fs(t, r, l, u) { + switch (l.insertionMode) { + case Fr: + case kt: + return ( + x(t, Oa), x(t, r.segmentPrefix), x(t, u.toString(16)), R(t, Eo) + ); + case Ar: + return ( + x(t, vs), x(t, r.segmentPrefix), x(t, u.toString(16)), R(t, gs) + ); + case Dr: + return ( + x(t, ms), x(t, r.segmentPrefix), x(t, u.toString(16)), R(t, ys) + ); + case fr: + return ( + x(t, bs), x(t, r.segmentPrefix), x(t, u.toString(16)), R(t, Ss) + ); + case yn: + return ( + x(t, xs), x(t, r.segmentPrefix), x(t, u.toString(16)), R(t, ks) + ); + case Tt: + return ( + x(t, Cs), x(t, r.segmentPrefix), x(t, u.toString(16)), R(t, Es) + ); + case Or: + return ( + x(t, Is), x(t, r.segmentPrefix), x(t, u.toString(16)), R(t, _s) + ); + default: + throw new Error("Unknown insertion mode. This is a bug in React."); + } + } + function As(t, r) { + switch (r.insertionMode) { + case Fr: + case kt: + return R(t, Ma); + case Ar: + return R(t, Ni); + case Dr: + return R(t, Vi); + case fr: + return R(t, ws); + case yn: + return R(t, Ts); + case Tt: + return R(t, Rs); + case Or: + return R(t, Ps); + default: + throw new Error("Unknown insertion mode. This is a bug in React."); + } + } + var Ds = + "function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)}", + Os = + 'function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}}', + Ms = + 'function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())}', + Ls = Ds + ';$RS("', + Bs = '$RS("', + Us = '","', + js = '")</script>'; + function Hs(t, r, l) { + x(t, r.startInlineScript), + r.sentCompleteSegmentFunction + ? x(t, Bs) + : ((r.sentCompleteSegmentFunction = !0), x(t, Ls)), + x(t, r.segmentPrefix); + var u = l.toString(16); + return x(t, u), x(t, Us), x(t, r.placeholderPrefix), x(t, u), R(t, js); + } + var Ws = Os + ';$RC("', + zs = '$RC("', + $s = '","', + Ns = '")</script>'; + function Vs(t, r, l, u) { + if ( + (x(t, r.startInlineScript), + r.sentCompleteBoundaryFunction + ? x(t, zs) + : ((r.sentCompleteBoundaryFunction = !0), x(t, Ws)), + l === null) + ) { + throw new Error( + "An ID must have been assigned before we can complete the boundary.", + ); + } + var p = u.toString(16); + return x(t, l), x(t, $s), x(t, r.segmentPrefix), x(t, p), R(t, Ns); + } + var Ys = Ms + ';$RX("', + Gs = '$RX("', + Xs = '"', + Zs = ")</script>", + La = ","; + function Js(t, r, l, u, p, g) { + if ( + (x(t, r.startInlineScript), + r.sentClientRenderFunction + ? x(t, Gs) + : ((r.sentClientRenderFunction = !0), x(t, Ys)), + l === null) + ) { + throw new Error( + "An ID must have been assigned before we can complete the boundary.", + ); + } + return ( + x(t, l), + x(t, Xs), + (u || p || g) && (x(t, La), x(t, Ba(u || ""))), + (p || g) && (x(t, La), x(t, Ba(p || ""))), + g && (x(t, La), x(t, Ba(g))), + R(t, Zs) + ); + } + var Qs = /[<\u2028\u2029]/g; + function Ba(t) { + var r = JSON.stringify(t); + return r.replace(Qs, function (l) { + switch (l) { + case "<": + return "\\u003c"; + case "\u2028": + return "\\u2028"; + case "\u2029": + return "\\u2029"; + default: + throw new Error( + "escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React", + ); + } + }); + } + function Yi(t, r) { + var l = cr(r, void 0); + return { + bootstrapChunks: l.bootstrapChunks, + startInlineScript: l.startInlineScript, + placeholderPrefix: l.placeholderPrefix, + segmentPrefix: l.segmentPrefix, + boundaryPrefix: l.boundaryPrefix, + idPrefix: l.idPrefix, + nextSuspenseID: l.nextSuspenseID, + sentCompleteSegmentFunction: l.sentCompleteSegmentFunction, + sentCompleteBoundaryFunction: l.sentCompleteBoundaryFunction, + sentClientRenderFunction: l.sentClientRenderFunction, + generateStaticMarkup: t, + }; + } + function Gi() { + return { insertionMode: kt, selectedValue: null }; + } + function Xi(t, r, l, u) { + return l.generateStaticMarkup ? (t.push(ge(r)), !1) : bn(t, r, l, u); + } + function Zi(t, r, l, u) { + if (!r.generateStaticMarkup) return Sn(t, r, l, u); + } + function Ks(t, r) { + return r.generateStaticMarkup ? !0 : Se(t); + } + function qs(t, r, l, u, p) { + return r.generateStaticMarkup ? !0 : Pn(t, r, l, u, p); + } + function Ua(t, r) { + return r.generateStaticMarkup ? !0 : Wr(t); + } + function eu(t, r) { + return r.generateStaticMarkup ? !0 : zr(t); + } + var Qe = Object.assign, + ja = Symbol.for("react.element"), + ze = Symbol.for("react.portal"), + Ji = Symbol.for("react.fragment"), + Ha = Symbol.for("react.strict_mode"), + Wa = Symbol.for("react.profiler"), + Ro = Symbol.for("react.provider"), + Io = Symbol.for("react.context"), + Fn = Symbol.for("react.forward_ref"), + An = Symbol.for("react.suspense"), + Dn = Symbol.for("react.suspense_list"), + On = Symbol.for("react.memo"), + $r = Symbol.for("react.lazy"), + za = Symbol.for("react.scope"), + _o = Symbol.for("react.debug_trace_mode"), + tu = Symbol.for("react.legacy_hidden"), + ru = Symbol.for("react.default_value"), + Qi = Symbol.iterator, + nu = "@@iterator"; + function Ki(t) { + if (t === null || typeof t != "object") return null; + var r = (Qi && t[Qi]) || t[nu]; + return typeof r == "function" ? r : null; + } + function ou(t, r, l) { + var u = t.displayName; + if (u) return u; + var p = r.displayName || r.name || ""; + return p !== "" ? l + "(" + p + ")" : l; + } + function qi(t) { + return t.displayName || "Context"; + } + function ie(t) { + if (t == null) return null; + if ( + (typeof t.tag == "number" && + c( + "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.", + ), + typeof t == "function") + ) { + return t.displayName || t.name || null; + } + if (typeof t == "string") return t; + switch (t) { + case Ji: + return "Fragment"; + case ze: + return "Portal"; + case Wa: + return "Profiler"; + case Ha: + return "StrictMode"; + case An: + return "Suspense"; + case Dn: + return "SuspenseList"; + } + if (typeof t == "object") { + switch (t.$$typeof) { + case Io: + var r = t; + return qi(r) + ".Consumer"; + case Ro: + var l = t; + return qi(l._context) + ".Provider"; + case Fn: + return ou(t, t.render, "ForwardRef"); + case On: + var u = t.displayName || null; + return u !== null ? u : ie(t.type) || "Memo"; + case $r: { + var p = t, + g = p._payload, + y = p._init; + try { + return ie(y(g)); + } catch { + return null; + } + } + } + } + return null; + } + var Nr = 0, + ne, + Vr, + $a, + Na, + Va, + Ya, + Ga; + function Xa() {} + Xa.__reactDisabledLog = !0; + function el() { + { + if (Nr === 0) { + (ne = console.log), + (Vr = console.info), + ($a = console.warn), + (Na = console.error), + (Va = console.group), + (Ya = console.groupCollapsed), + (Ga = console.groupEnd); + var t = { + configurable: !0, + enumerable: !0, + value: Xa, + writable: !0, + }; + Object.defineProperties(console, { + info: t, + log: t, + warn: t, + error: t, + group: t, + groupCollapsed: t, + groupEnd: t, + }); + } + Nr++; + } + } + function tl() { + { + if ((Nr--, Nr === 0)) { + var t = { configurable: !0, enumerable: !0, writable: !0 }; + Object.defineProperties(console, { + log: Qe({}, t, { value: ne }), + info: Qe({}, t, { value: Vr }), + warn: Qe({}, t, { value: $a }), + error: Qe({}, t, { value: Na }), + group: Qe({}, t, { value: Va }), + groupCollapsed: Qe({}, t, { value: Ya }), + groupEnd: Qe({}, t, { value: Ga }), + }); + } + Nr < 0 && + c( + "disabledDepth fell below zero. This is a bug in React. Please file an issue.", + ); + } + } + var Za = s.ReactCurrentDispatcher, + Ja; + function br(t, r, l) { + { + if (Ja === void 0) { + try { + throw Error(); + } catch (p) { + var u = p.stack.trim().match(/\n( *(at )?)/); + Ja = (u && u[1]) || ""; + } + } + return ( + ` +` + + Ja + + t + ); + } + } + var Mn = !1, + Nt; + { + var Qa = typeof WeakMap == "function" ? WeakMap : Map; + Nt = new Qa(); + } + function Yr(t, r) { + if (!t || Mn) return ""; + { + var l = Nt.get(t); + if (l !== void 0) return l; + } + var u; + Mn = !0; + var p = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + var g; + (g = Za.current), (Za.current = null), el(); + try { + if (r) { + var y = function () { + throw Error(); + }; + if ( + (Object.defineProperty(y.prototype, "props", { + set: function () { + throw Error(); + }, + }), + typeof Reflect == "object" && Reflect.construct) + ) { + try { + Reflect.construct(y, []); + } catch (we) { + u = we; + } + Reflect.construct(t, [], y); + } else { + try { + y.call(); + } catch (we) { + u = we; + } + t.call(y.prototype); + } + } else { + try { + throw Error(); + } catch (we) { + u = we; + } + t(); + } + } catch (we) { + if (we && u && typeof we.stack == "string") { + for ( + var w = we.stack.split(` +`), + C = u.stack.split(` +`), + _ = w.length - 1, + O = C.length - 1; + _ >= 1 && O >= 0 && w[_] !== C[O]; + ) { + O--; + } + for (; _ >= 1 && O >= 0; _--, O--) { + if (w[_] !== C[O]) { + if (_ !== 1 || O !== 1) { + do if ((_--, O--, O < 0 || w[_] !== C[O])) { + var j = ` +` + w[_].replace(" at new ", " at "); + return ( + t.displayName && + j.includes("<anonymous>") && + (j = j.replace("<anonymous>", t.displayName)), + typeof t == "function" && Nt.set(t, j), + j + ); + } while (_ >= 1 && O >= 0); + } + break; + } + } + } + } finally { + (Mn = !1), (Za.current = g), tl(), (Error.prepareStackTrace = p); + } + var Z = t ? t.displayName || t.name : "", + de = Z ? br(Z) : ""; + return typeof t == "function" && Nt.set(t, de), de; + } + function au(t, r, l) { + return Yr(t, !0); + } + function Po(t, r, l) { + return Yr(t, !1); + } + function iu(t) { + var r = t.prototype; + return !!(r && r.isReactComponent); + } + function Fo(t, r, l) { + if (t == null) return ""; + if (typeof t == "function") return Yr(t, iu(t)); + if (typeof t == "string") return br(t); + switch (t) { + case An: + return br("Suspense"); + case Dn: + return br("SuspenseList"); + } + if (typeof t == "object") { + switch (t.$$typeof) { + case Fn: + return Po(t.render); + case On: + return Fo(t.type, r, l); + case $r: { + var u = t, + p = u._payload, + g = u._init; + try { + return Fo(g(p), r, l); + } catch {} + } + } + } + return ""; + } + var rl = {}, + Ao = s.ReactDebugCurrentFrame; + function Ln(t) { + if (t) { + var r = t._owner, + l = Fo(t.type, t._source, r ? r.type : null); + Ao.setExtraStackFrame(l); + } else Ao.setExtraStackFrame(null); + } + function Ka(t, r, l, u, p) { + { + var g = Function.call.bind(he); + for (var y in t) { + if (g(t, y)) { + var w = void 0; + try { + if (typeof t[y] != "function") { + var C = Error( + (u || "React class") + + ": " + + l + + " type `" + + y + + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + + typeof t[y] + + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.", + ); + throw ((C.name = "Invariant Violation"), C); + } + w = t[y]( + r, + y, + u, + l, + null, + "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED", + ); + } catch (_) { + w = _; + } + w && + !(w instanceof Error) && + (Ln(p), + c( + "%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", + u || "React class", + l, + y, + typeof w, + ), + Ln(null)), + w instanceof Error && + !(w.message in rl) && + ((rl[w.message] = !0), + Ln(p), + c("Failed %s type: %s", l, w.message), + Ln(null)); + } + } + } + } + var Gr; + Gr = {}; + var Bn = {}; + Object.freeze(Bn); + function Do(t, r) { + { + var l = t.contextTypes; + if (!l) return Bn; + var u = {}; + for (var p in l) u[p] = r[p]; + { + var g = ie(t) || "Unknown"; + Ka(l, u, "context", g); + } + return u; + } + } + function Oo(t, r, l, u) { + { + if (typeof t.getChildContext != "function") { + { + var p = ie(r) || "Unknown"; + Gr[p] || + ((Gr[p] = !0), + c( + "%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.", + p, + p, + )); + } + return l; + } + var g = t.getChildContext(); + for (var y in g) { + if (!(y in u)) { + throw new Error( + (ie(r) || "Unknown") + + '.getChildContext(): key "' + + y + + '" is not defined in childContextTypes.', + ); + } + } + { + var w = ie(r) || "Unknown"; + Ka(u, g, "child context", w); + } + return Qe({}, l, g); + } + } + var Xr; + Xr = {}; + var lu = null, + nt = null; + function qa(t) { + t.context._currentValue2 = t.parentValue; + } + function Ft(t) { + t.context._currentValue2 = t.value; + } + function Zr(t, r) { + if (t !== r) { + qa(t); + var l = t.parent, + u = r.parent; + if (l === null) { + if (u !== null) { + throw new Error( + "The stacks must reach the root at the same time. This is a bug in React.", + ); + } + } else { + if (u === null) { + throw new Error( + "The stacks must reach the root at the same time. This is a bug in React.", + ); + } + Zr(l, u); + } + Ft(r); + } + } + function Mo(t) { + qa(t); + var r = t.parent; + r !== null && Mo(r); + } + function Un(t) { + var r = t.parent; + r !== null && Un(r), Ft(t); + } + function ei(t, r) { + qa(t); + var l = t.parent; + if (l === null) { + throw new Error( + "The depth must equal at least at zero before reaching the root. This is a bug in React.", + ); + } + l.depth === r.depth ? Zr(l, r) : ei(l, r); + } + function ti(t, r) { + var l = r.parent; + if (l === null) { + throw new Error( + "The depth must equal at least at zero before reaching the root. This is a bug in React.", + ); + } + t.depth === l.depth ? Zr(t, l) : ti(t, l), Ft(r); + } + function jn(t) { + var r = nt, + l = t; + r !== l && + (r === null + ? Un(l) + : l === null + ? Mo(r) + : r.depth === l.depth + ? Zr(r, l) + : r.depth > l.depth + ? ei(r, l) + : ti(r, l), + (nt = l)); + } + function nl(t, r) { + var l; + (l = t._currentValue2), + (t._currentValue2 = r), + t._currentRenderer2 !== void 0 && + t._currentRenderer2 !== null && + t._currentRenderer2 !== Xr && + c( + "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.", + ), + (t._currentRenderer2 = Xr); + var u = nt, + p = { + parent: u, + depth: u === null ? 0 : u.depth + 1, + context: t, + parentValue: l, + value: r, + }; + return (nt = p), p; + } + function Lo(t) { + var r = nt; + if (r === null) { + throw new Error( + "Tried to pop a Context at the root of the app. This is a bug in React.", + ); + } + r.context !== t && + c( + "The parent context is not the expected context. This is probably a bug in React.", + ); + { + var l = r.parentValue; + l === ru + ? (r.context._currentValue2 = r.context._defaultValue) + : (r.context._currentValue2 = l), + t._currentRenderer2 !== void 0 && + t._currentRenderer2 !== null && + t._currentRenderer2 !== Xr && + c( + "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.", + ), + (t._currentRenderer2 = Xr); + } + return (nt = r.parent); + } + function su() { + return nt; + } + function Hn(t) { + var r = t._currentValue2; + return r; + } + function ri(t) { + return t._reactInternals; + } + function Wn(t, r) { + t._reactInternals = r; + } + var Bo = {}, + ol = {}, + Uo, + jo, + zn, + $n, + Ho, + Jr, + Wo, + Qr, + Nn; + { + (Uo = new Set()), + (jo = new Set()), + (zn = new Set()), + (Wo = new Set()), + ($n = new Set()), + (Qr = new Set()), + (Nn = new Set()); + var zo = new Set(); + (Jr = function (t, r) { + if (!(t === null || typeof t == "function")) { + var l = r + "_" + t; + zo.has(l) || + (zo.add(l), + c( + "%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", + r, + t, + )); + } + }), + (Ho = function (t, r) { + if (r === void 0) { + var l = ie(t) || "Component"; + $n.has(l) || + ($n.add(l), + c( + "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", + l, + )); + } + }); + } + function $o(t, r) { + { + var l = t.constructor, + u = (l && ie(l)) || "ReactClass", + p = u + "." + r; + if (Bo[p]) return; + c( + `%s(...): Can only update a mounting component. This usually means you called %s() outside componentWillMount() on the server. This is a no-op. + +Please check the code for the %s component.`, + r, + r, + u, + ), (Bo[p] = !0); + } + } + var ni = { + isMounted: function (t) { + return !1; + }, + enqueueSetState: function (t, r, l) { + var u = ri(t); + u.queue === null + ? $o(t, "setState") + : (u.queue.push(r), l != null && Jr(l, "setState")); + }, + enqueueReplaceState: function (t, r, l) { + var u = ri(t); + (u.replace = !0), (u.queue = [r]), l != null && Jr(l, "setState"); + }, + enqueueForceUpdate: function (t, r) { + var l = ri(t); + l.queue === null + ? $o(t, "forceUpdate") + : r != null && Jr(r, "setState"); + }, + }; + function al(t, r, l, u, p) { + var g = l(p, u); + Ho(r, g); + var y = g == null ? u : Qe({}, u, g); + return y; + } + function il(t, r, l) { + var u = Bn, + p = t.contextType; + if ("contextType" in t) { + var g = p === null || + (p !== void 0 && p.$$typeof === Io && p._context === void 0); + if (!g && !Nn.has(t)) { + Nn.add(t); + var y = ""; + p === void 0 + ? (y = + " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.") + : typeof p != "object" + ? (y = " However, it is set to a " + typeof p + ".") + : p.$$typeof === Ro + ? (y = " Did you accidentally pass the Context.Provider instead?") + : p._context !== void 0 + ? (y = " Did you accidentally pass the Context.Consumer instead?") + : (y = " However, it is set to an object with keys {" + + Object.keys(p).join(", ") + + "}."), + c( + "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", + ie(t) || "Component", + y, + ); + } + } + typeof p == "object" && p !== null ? (u = Hn(p)) : (u = l); + var w = new t(r, u); + { + if ( + typeof t.getDerivedStateFromProps == "function" && + (w.state === null || w.state === void 0) + ) { + var C = ie(t) || "Component"; + Uo.has(C) || + (Uo.add(C), + c( + "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", + C, + w.state === null ? "null" : "undefined", + C, + )); + } + if ( + typeof t.getDerivedStateFromProps == "function" || + typeof w.getSnapshotBeforeUpdate == "function" + ) { + var _ = null, + O = null, + j = null; + if ( + (typeof w.componentWillMount == "function" && + w.componentWillMount.__suppressDeprecationWarning !== !0 + ? (_ = "componentWillMount") + : typeof w.UNSAFE_componentWillMount == "function" && + (_ = "UNSAFE_componentWillMount"), + typeof w.componentWillReceiveProps == "function" && + w.componentWillReceiveProps.__suppressDeprecationWarning !== + !0 + ? (O = "componentWillReceiveProps") + : typeof w.UNSAFE_componentWillReceiveProps == "function" && + (O = "UNSAFE_componentWillReceiveProps"), + typeof w.componentWillUpdate == "function" && + w.componentWillUpdate.__suppressDeprecationWarning !== !0 + ? (j = "componentWillUpdate") + : typeof w.UNSAFE_componentWillUpdate == "function" && + (j = "UNSAFE_componentWillUpdate"), + _ !== null || O !== null || j !== null) + ) { + var Z = ie(t) || "Component", + de = typeof t.getDerivedStateFromProps == "function" + ? "getDerivedStateFromProps()" + : "getSnapshotBeforeUpdate()"; + zn.has(Z) || + (zn.add(Z), + c( + `Unsafe legacy lifecycles will not be called for components using new component APIs. + +%s uses %s but also contains the following legacy lifecycles:%s%s%s + +The above lifecycles should be removed. Learn more about this warning here: +https://reactjs.org/link/unsafe-component-lifecycles`, + Z, + de, + _ !== null + ? ` + ` + _ + : "", + O !== null + ? ` + ` + O + : "", + j !== null + ? ` + ` + j + : "", + )); + } + } + } + return w; + } + function uu(t, r, l) { + { + var u = ie(r) || "Component", + p = t.render; + p || + (r.prototype && typeof r.prototype.render == "function" + ? c( + "%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?", + u, + ) + : c( + "%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.", + u, + )), + t.getInitialState && + !t.getInitialState.isReactClassApproved && + !t.state && + c( + "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", + u, + ), + t.getDefaultProps && + !t.getDefaultProps.isReactClassApproved && + c( + "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", + u, + ), + t.propTypes && + c( + "propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", + u, + ), + t.contextType && + c( + "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", + u, + ), + t.contextTypes && + c( + "contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", + u, + ), + r.contextType && + r.contextTypes && + !Qr.has(r) && + (Qr.add(r), + c( + "%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", + u, + )), + typeof t.componentShouldUpdate == "function" && + c( + "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", + u, + ), + r.prototype && + r.prototype.isPureReactComponent && + typeof t.shouldComponentUpdate < "u" && + c( + "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", + ie(r) || "A pure component", + ), + typeof t.componentDidUnmount == "function" && + c( + "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", + u, + ), + typeof t.componentDidReceiveProps == "function" && + c( + "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", + u, + ), + typeof t.componentWillRecieveProps == "function" && + c( + "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", + u, + ), + typeof t.UNSAFE_componentWillRecieveProps == "function" && + c( + "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", + u, + ); + var g = t.props !== l; + t.props !== void 0 && + g && + c( + "%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", + u, + u, + ), + t.defaultProps && + c( + "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", + u, + u, + ), + typeof t.getSnapshotBeforeUpdate == "function" && + typeof t.componentDidUpdate != "function" && + !jo.has(r) && + (jo.add(r), + c( + "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", + ie(r), + )), + typeof t.getDerivedStateFromProps == "function" && + c( + "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + u, + ), + typeof t.getDerivedStateFromError == "function" && + c( + "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + u, + ), + typeof r.getSnapshotBeforeUpdate == "function" && + c( + "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", + u, + ); + var y = t.state; + y && + (typeof y != "object" || me(y)) && + c("%s.state: must be set to an object or null", u), + typeof t.getChildContext == "function" && + typeof r.childContextTypes != "object" && + c( + "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", + u, + ); + } + } + function cu(t, r) { + var l = r.state; + if (typeof r.componentWillMount == "function") { + if (r.componentWillMount.__suppressDeprecationWarning !== !0) { + var u = ie(t) || "Unknown"; + ol[u] || + (v( + `componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details. + +* Move code from componentWillMount to componentDidMount (preferred in most cases) or the constructor. + +Please update the following components: %s`, + u, + ), + (ol[u] = !0)); + } + r.componentWillMount(); + } + typeof r.UNSAFE_componentWillMount == "function" && + r.UNSAFE_componentWillMount(), + l !== r.state && + (c( + "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + ie(t) || "Component", + ), + ni.enqueueReplaceState(r, r.state, null)); + } + function fu(t, r, l, u) { + if (t.queue !== null && t.queue.length > 0) { + var p = t.queue, + g = t.replace; + if (((t.queue = null), (t.replace = !1), g && p.length === 1)) { + r.state = p[0]; + } else { + for ( + var y = g ? p[0] : r.state, w = !0, C = g ? 1 : 0; + C < p.length; + C++ + ) { + var _ = p[C], + O = typeof _ == "function" ? _.call(r, y, l, u) : _; + O != null && (w ? ((w = !1), (y = Qe({}, y, O))) : Qe(y, O)); + } + r.state = y; + } + } else t.queue = null; + } + function ll(t, r, l, u) { + uu(t, r, l); + var p = t.state !== void 0 ? t.state : null; + (t.updater = ni), (t.props = l), (t.state = p); + var g = { queue: [], replace: !1 }; + Wn(t, g); + var y = r.contextType; + if ( + (typeof y == "object" && y !== null + ? (t.context = Hn(y)) + : (t.context = u), + t.state === l) + ) { + var w = ie(r) || "Component"; + Wo.has(w) || + (Wo.add(w), + c( + "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", + w, + )); + } + var C = r.getDerivedStateFromProps; + typeof C == "function" && (t.state = al(t, r, C, p, l)), + typeof r.getDerivedStateFromProps != "function" && + typeof t.getSnapshotBeforeUpdate != "function" && + (typeof t.UNSAFE_componentWillMount == "function" || + typeof t.componentWillMount == "function") && + (cu(r, t), fu(g, t, l, u)); + } + var du = { id: 1, overflow: "" }; + function sl(t) { + var r = t.overflow, + l = t.id, + u = l & ~ai(l); + return u.toString(32) + r; + } + function oi(t, r, l) { + var u = t.id, + p = t.overflow, + g = No(u) - 1, + y = u & ~(1 << g), + w = l + 1, + C = No(r) + g; + if (C > 30) { + var _ = g - (g % 5), + O = (1 << _) - 1, + j = (y & O).toString(32), + Z = y >> _, + de = g - _, + we = No(r) + de, + aa = w << de, + ia = aa | Z, + Dl = j + p; + return { id: (1 << we) | ia, overflow: Dl }; + } else { + var la = w << g, + Vd = la | y, + Yd = p; + return { id: (1 << C) | Vd, overflow: Yd }; + } + } + function No(t) { + return 32 - Vo(t); + } + function ai(t) { + return 1 << (No(t) - 1); + } + var Vo = Math.clz32 ? Math.clz32 : vu, + pu = Math.log, + hu = Math.LN2; + function vu(t) { + var r = t >>> 0; + return r === 0 ? 32 : (31 - ((pu(r) / hu) | 0)) | 0; + } + function gu(t, r) { + return ( + (t === r && (t !== 0 || 1 / t === 1 / r)) || (t !== t && r !== r) + ); + } + var mu = typeof Object.is == "function" ? Object.is : gu, + At = null, + ii = null, + Ke = null, + X = null, + Vt = !1, + G = !1, + Yt = 0, + ot = null, + Sr = 0, + Gt = 25, + $e = !1, + Kr; + function Ie() { + if (At === null) { + throw new Error( + `Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: +1. You might have mismatching versions of React and the renderer (such as React DOM) +2. You might be breaking the Rules of Hooks +3. You might have more than one copy of React in the same app +See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`, + ); + } + return ( + $e && + c( + "Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks", + ), At + ); + } + function qr(t, r) { + if (r === null) { + return ( + c( + "%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", + Kr, + ), !1 + ); + } + t.length !== r.length && + c( + `The final argument passed to %s changed size between renders. The order and size of this array must remain constant. + +Previous: %s +Incoming: %s`, + Kr, + "[" + t.join(", ") + "]", + "[" + r.join(", ") + "]", + ); + for (var l = 0; l < r.length && l < t.length; l++) { + if (!mu(t[l], r[l])) return !1; + } + return !0; + } + function Xt() { + if (Sr > 0) { + throw new Error( + "Rendered more hooks than during the previous render", + ); + } + return { memoizedState: null, queue: null, next: null }; + } + function li() { + return ( + X === null + ? Ke === null ? ((Vt = !1), (Ke = X = Xt())) : ((Vt = !0), (X = Ke)) + : X.next === null + ? ((Vt = !1), (X = X.next = Xt())) + : ((Vt = !0), (X = X.next)), X + ); + } + function ul(t, r) { + (At = r), (ii = t), ($e = !1), (Yt = 0); + } + function si(t, r, l, u) { + for (; G;) (G = !1), (Yt = 0), (Sr += 1), (X = null), (l = t(r, u)); + return ui(), l; + } + function cl() { + var t = Yt !== 0; + return t; + } + function ui() { + ($e = !1), + (At = null), + (ii = null), + (G = !1), + (Ke = null), + (Sr = 0), + (ot = null), + (X = null); + } + function fl(t) { + return ( + $e && + c( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().", + ), Hn(t) + ); + } + function ci(t) { + return (Kr = "useContext"), Ie(), Hn(t); + } + function fi(t, r) { + return typeof r == "function" ? r(t) : r; + } + function yu(t) { + return (Kr = "useState"), Yo(fi, t); + } + function Yo(t, r, l) { + if ((t !== fi && (Kr = "useReducer"), (At = Ie()), (X = li()), Vt)) { + var u = X.queue, + p = u.dispatch; + if (ot !== null) { + var g = ot.get(u); + if (g !== void 0) { + ot.delete(u); + var y = X.memoizedState, + w = g; + do { + var C = w.action; + ($e = !0), (y = t(y, C)), ($e = !1), (w = w.next); + } while (w !== null); + return (X.memoizedState = y), [y, p]; + } + } + return [X.memoizedState, p]; + } else { + $e = !0; + var _; + t === fi + ? (_ = typeof r == "function" ? r() : r) + : (_ = l !== void 0 ? l(r) : r), + ($e = !1), + (X.memoizedState = _); + var O = (X.queue = { last: null, dispatch: null }), + j = (O.dispatch = bu.bind(null, At, O)); + return [X.memoizedState, j]; + } + } + function dl(t, r) { + (At = Ie()), (X = li()); + var l = r === void 0 ? null : r; + if (X !== null) { + var u = X.memoizedState; + if (u !== null && l !== null) { + var p = u[1]; + if (qr(l, p)) return u[0]; + } + } + $e = !0; + var g = t(); + return ($e = !1), (X.memoizedState = [g, l]), g; + } + function pl(t) { + (At = Ie()), (X = li()); + var r = X.memoizedState; + if (r === null) { + var l = { current: t }; + return Object.seal(l), (X.memoizedState = l), l; + } else return r; + } + function hl(t, r) { + (Kr = "useLayoutEffect"), + c( + "useLayoutEffect does nothing on the server, because its effect cannot be encoded into the server renderer's output format. This will lead to a mismatch between the initial, non-hydrated UI and the intended UI. To avoid this, useLayoutEffect should only be used in components that render exclusively on the client. See https://reactjs.org/link/uselayouteffect-ssr for common fixes.", + ); + } + function bu(t, r, l) { + if (Sr >= Gt) { + throw new Error( + "Too many re-renders. React limits the number of renders to prevent an infinite loop.", + ); + } + if (t === At) { + G = !0; + var u = { action: l, next: null }; + ot === null && (ot = new Map()); + var p = ot.get(r); + if (p === void 0) ot.set(r, u); + else { + for (var g = p; g.next !== null;) g = g.next; + g.next = u; + } + } + } + function Su(t, r) { + return dl(function () { + return t; + }, r); + } + function wu(t, r, l) { + return Ie(), r(t._source); + } + function xu(t, r, l) { + if (l === void 0) { + throw new Error( + "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.", + ); + } + return l(); + } + function ku(t) { + return Ie(), t; + } + function Tu() { + throw new Error( + "startTransition cannot be called during server rendering.", + ); + } + function Cu() { + return Ie(), [!1, Tu]; + } + function Eu() { + var t = ii, + r = sl(t.treeContext), + l = en; + if (l === null) { + throw new Error( + "Invalid hook call. Hooks can only be called inside of the body of a function component.", + ); + } + var u = Yt++; + return zt(l, r, u); + } + function Go() {} + var vl = { + readContext: fl, + useContext: ci, + useMemo: dl, + useReducer: Yo, + useRef: pl, + useState: yu, + useInsertionEffect: Go, + useLayoutEffect: hl, + useCallback: Su, + useImperativeHandle: Go, + useEffect: Go, + useDebugValue: Go, + useDeferredValue: ku, + useTransition: Cu, + useId: Eu, + useMutableSource: wu, + useSyncExternalStore: xu, + }, + en = null; + function di(t) { + en = t; + } + function pi(t) { + try { + var r = "", + l = t; + do { + switch (l.tag) { + case 0: + r += br(l.type, null, null); + break; + case 1: + r += Po(l.type, null, null); + break; + case 2: + r += au(l.type, null, null); + break; + } + l = l.parent; + } while (l); + return r; + } catch (u) { + return ( + ` +Error generating stack: ` + + u.message + + ` +` + + u.stack + ); + } + } + var Xo = s.ReactCurrentDispatcher, + hi = s.ReactDebugCurrentFrame, + Vn = 0, + Zt = 1, + Zo = 2, + wr = 3, + vi = 4, + gl = 0, + gi = 1, + tn = 2, + ml = 12800; + function rn(t) { + return console.error(t), null; + } + function Yn() {} + function yl(t, r, l, u, p, g, y, w, C) { + var _ = [], + O = new Set(), + j = { + destination: null, + responseState: r, + progressiveChunkSize: u === void 0 ? ml : u, + status: gl, + fatalError: null, + nextSegmentId: 0, + allPendingTasks: 0, + pendingRootTasks: 0, + completedRootSegment: null, + abortableTasks: O, + pingedTasks: _, + clientRenderedBoundaries: [], + completedBoundaries: [], + partialBoundaries: [], + onError: p === void 0 ? rn : p, + onAllReady: g === void 0 ? Yn : g, + onShellReady: y === void 0 ? Yn : y, + onShellError: w === void 0 ? Yn : w, + onFatalError: C === void 0 ? Yn : C, + }, + Z = Jo(j, 0, null, l, !1, !1); + Z.parentFlushed = !0; + var de = mi(j, t, null, Z, O, Bn, lu, du); + return _.push(de), j; + } + function Gn(t, r) { + var l = t.pingedTasks; + l.push(r), + l.length === 1 && + S(function () { + return Ri(t); + }); + } + function Ru(t, r) { + return { + id: Ct, + rootSegmentID: -1, + parentFlushed: !1, + pendingTasks: 0, + forceClientRender: !1, + completedSegments: [], + byteSize: 0, + fallbackAbortableTasks: r, + errorDigest: null, + }; + } + function mi(t, r, l, u, p, g, y, w) { + t.allPendingTasks++, + l === null ? t.pendingRootTasks++ : l.pendingTasks++; + var C = { + node: r, + ping: function () { + return Gn(t, C); + }, + blockedBoundary: l, + blockedSegment: u, + abortSet: p, + legacyContext: g, + context: y, + treeContext: w, + }; + return (C.componentStack = null), p.add(C), C; + } + function Jo(t, r, l, u, p, g) { + return { + status: Vn, + id: -1, + index: r, + parentFlushed: !1, + chunks: [], + children: [], + formatContext: u, + boundary: l, + lastPushedText: p, + textEmbedded: g, + }; + } + var at = null; + function nn() { + return at === null || at.componentStack === null + ? "" + : pi(at.componentStack); + } + function Ne(t, r) { + t.componentStack = { tag: 0, parent: t.componentStack, type: r }; + } + function Qo(t, r) { + t.componentStack = { tag: 1, parent: t.componentStack, type: r }; + } + function Xn(t, r) { + t.componentStack = { tag: 2, parent: t.componentStack, type: r }; + } + function Dt(t) { + t.componentStack === null + ? c( + "Unexpectedly popped too many stack frames. This is a bug in React.", + ) + : (t.componentStack = t.componentStack.parent); + } + var Zn = null; + function mt(t, r) { + { + var l; + typeof r == "string" + ? (l = r) + : r && typeof r.message == "string" + ? (l = r.message) + : (l = String(r)); + var u = Zn || nn(); + (Zn = null), (t.errorMessage = l), (t.errorComponentStack = u); + } + } + function Ot(t, r) { + var l = t.onError(r); + if (l != null && typeof l != "string") { + throw new Error( + 'onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "' + + typeof l + + '" instead', + ); + } + return l; + } + function on(t, r) { + var l = t.onShellError; + l(r); + var u = t.onFatalError; + u(r), + t.destination !== null + ? ((t.status = tn), Oe(t.destination, r)) + : ((t.status = gi), (t.fatalError = r)); + } + function Jn(t, r, l) { + Ne(r, "Suspense"); + var u = r.blockedBoundary, + p = r.blockedSegment, + g = l.fallback, + y = l.children, + w = new Set(), + C = Ru(t, w), + _ = p.chunks.length, + O = Jo(t, _, C, p.formatContext, !1, !1); + p.children.push(O), (p.lastPushedText = !1); + var j = Jo(t, 0, null, p.formatContext, !1, !1); + (j.parentFlushed = !0), (r.blockedBoundary = C), (r.blockedSegment = j); + try { + if ( + (ea(t, r, y), + Zi(j.chunks, t.responseState, j.lastPushedText, j.textEmbedded), + (j.status = Zt), + ta(C, j), + C.pendingTasks === 0) + ) { + Dt(r); + return; + } + } catch (de) { + (j.status = vi), + (C.forceClientRender = !0), + (C.errorDigest = Ot(t, de)), + mt(C, de); + } finally { + (r.blockedBoundary = u), (r.blockedSegment = p); + } + var Z = mi(t, g, u, O, w, r.legacyContext, r.context, r.treeContext); + (Z.componentStack = r.componentStack), t.pingedTasks.push(Z), Dt(r); + } + function Ko(t, r, l, u) { + Ne(r, l); + var p = r.blockedSegment, + g = Rn(p.chunks, l, u, t.responseState, p.formatContext); + p.lastPushedText = !1; + var y = p.formatContext; + (p.formatContext = Ht(y, l, u)), + ea(t, r, g), + (p.formatContext = y), + Da(p.chunks, l), + (p.lastPushedText = !1), + Dt(r); + } + function Iu(t) { + return t.prototype && t.prototype.isReactComponent; + } + function bl(t, r, l, u, p) { + var g = {}; + ul(r, g); + var y = l(u, p); + return si(l, u, y, p); + } + function Sl(t, r, l, u, p) { + var g = l.render(); + l.props !== p && + (Si || + c( + "It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", + ie(u) || "a component", + ), + (Si = !0)); + { + var y = u.childContextTypes; + if (y != null) { + var w = r.legacyContext, + C = Oo(l, u, w, y); + (r.legacyContext = C), Pe(t, r, g), (r.legacyContext = w); + return; + } + } + Pe(t, r, g); + } + function wl(t, r, l, u) { + Xn(r, l); + var p = Do(l, r.legacyContext), + g = il(l, u, p); + ll(g, l, u, p), Sl(t, r, g, l, u), Dt(r); + } + var yi = {}, + qo = {}, + bi = {}, + Qn = {}, + Si = !1, + wi = !1, + xi = !1, + ki = !1; + function xl(t, r, l, u) { + var p; + if ( + ((p = Do(l, r.legacyContext)), + Qo(r, l), + l.prototype && typeof l.prototype.render == "function") + ) { + var g = ie(l) || "Unknown"; + yi[g] || + (c( + "The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", + g, + g, + ), + (yi[g] = !0)); + } + var y = bl(t, r, l, u, p), + w = cl(); + if ( + typeof y == "object" && + y !== null && + typeof y.render == "function" && + y.$$typeof === void 0 + ) { + var C = ie(l) || "Unknown"; + qo[C] || + (c( + "The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", + C, + C, + C, + ), + (qo[C] = !0)); + } + if ( + typeof y == "object" && + y !== null && + typeof y.render == "function" && + y.$$typeof === void 0 + ) { + { + var _ = ie(l) || "Unknown"; + qo[_] || + (c( + "The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", + _, + _, + _, + ), + (qo[_] = !0)); + } + ll(y, l, u, p), Sl(t, r, y, l, u); + } else if ((kl(l), w)) { + var O = r.treeContext, + j = 1, + Z = 0; + r.treeContext = oi(O, j, Z); + try { + Pe(t, r, y); + } finally { + r.treeContext = O; + } + } else Pe(t, r, y); + Dt(r); + } + function kl(t) { + { + if ( + (t && + t.childContextTypes && + c( + "%s(...): childContextTypes cannot be defined on a function component.", + t.displayName || t.name || "Component", + ), + typeof t.getDerivedStateFromProps == "function") + ) { + var r = ie(t) || "Unknown"; + Qn[r] || + (c( + "%s: Function components do not support getDerivedStateFromProps.", + r, + ), + (Qn[r] = !0)); + } + if (typeof t.contextType == "object" && t.contextType !== null) { + var l = ie(t) || "Unknown"; + bi[l] || + (c("%s: Function components do not support contextType.", l), + (bi[l] = !0)); + } + } + } + function Tl(t, r) { + if (t && t.defaultProps) { + var l = Qe({}, r), + u = t.defaultProps; + for (var p in u) l[p] === void 0 && (l[p] = u[p]); + return l; + } + return r; + } + function _u(t, r, l, u, p) { + Qo(r, l.render); + var g = bl(t, r, l.render, u, p), + y = cl(); + if (y) { + var w = r.treeContext, + C = 1, + _ = 0; + r.treeContext = oi(w, C, _); + try { + Pe(t, r, g); + } finally { + r.treeContext = w; + } + } else Pe(t, r, g); + Dt(r); + } + function Cl(t, r, l, u, p) { + var g = l.type, + y = Tl(g, u); + Ti(t, r, g, y, p); + } + function Pu(t, r, l, u) { + l._context === void 0 + ? l !== l.Consumer && + (ki || + ((ki = !0), + c( + "Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?", + ))) + : (l = l._context); + var p = u.children; + typeof p != "function" && + c( + "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it.", + ); + var g = Hn(l), + y = p(g); + Pe(t, r, y); + } + function Fu(t, r, l, u) { + var p = l._context, + g = u.value, + y = u.children, + w; + (w = r.context), + (r.context = nl(p, g)), + Pe(t, r, y), + (r.context = Lo(p)), + w !== r.context && + c( + "Popping the context provider did not return back to the original snapshot. This is a bug in React.", + ); + } + function Au(t, r, l, u, p) { + Ne(r, "Lazy"); + var g = l._payload, + y = l._init, + w = y(g), + C = Tl(w, u); + Ti(t, r, w, C, p), Dt(r); + } + function Ti(t, r, l, u, p) { + if (typeof l == "function") { + if (Iu(l)) { + wl(t, r, l, u); + return; + } else { + xl(t, r, l, u); + return; + } + } + if (typeof l == "string") { + Ko(t, r, l, u); + return; + } + switch (l) { + case tu: + case _o: + case Ha: + case Wa: + case Ji: { + Pe(t, r, u.children); + return; + } + case Dn: { + Ne(r, "SuspenseList"), Pe(t, r, u.children), Dt(r); + return; + } + case za: + throw new Error( + "ReactDOMServer does not yet support scope components.", + ); + case An: { + Jn(t, r, u); + return; + } + } + if (typeof l == "object" && l !== null) { + switch (l.$$typeof) { + case Fn: { + _u(t, r, l, u, p); + return; + } + case On: { + Cl(t, r, l, u, p); + return; + } + case Ro: { + Fu(t, r, l, u); + return; + } + case Io: { + Pu(t, r, l, u); + return; + } + case $r: { + Au(t, r, l, u); + return; + } + } + } + var g = ""; + throw ( + ((l === void 0 || + (typeof l == "object" && + l !== null && + Object.keys(l).length === 0)) && + (g += + " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), + new Error( + "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) " + + ("but got: " + (l == null ? l : typeof l) + "." + g), + )) + ); + } + function Du(t, r) { + typeof Symbol == "function" && + t[Symbol.toStringTag] === "Generator" && + (wi || + c( + "Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers.", + ), + (wi = !0)), + t.entries === r && + (xi || + c( + "Using Maps as children is not supported. Use an array of keyed ReactElements instead.", + ), + (xi = !0)); + } + function Pe(t, r, l) { + try { + return Ou(t, r, l); + } catch (u) { + throw ( + ((typeof u == "object" && + u !== null && + typeof u.then == "function") || + (Zn = Zn !== null ? Zn : nn()), + u) + ); + } + } + function Ou(t, r, l) { + if (((r.node = l), typeof l == "object" && l !== null)) { + switch (l.$$typeof) { + case ja: { + var u = l, + p = u.type, + g = u.props, + y = u.ref; + Ti(t, r, p, g, y); + return; + } + case ze: + throw new Error( + "Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render.", + ); + case $r: { + var w = l, + C = w._payload, + _ = w._init, + O; + try { + O = _(C); + } catch (la) { + throw ( + (typeof la == "object" && + la !== null && + typeof la.then == "function" && + Ne(r, "Lazy"), + la) + ); + } + Pe(t, r, O); + return; + } + } + if (me(l)) { + Ue(t, r, l); + return; + } + var j = Ki(l); + if (j) { + Du(l, j); + var Z = j.call(l); + if (Z) { + var de = Z.next(); + if (!de.done) { + var we = []; + do we.push(de.value), (de = Z.next()); while (!de.done); + Ue(t, r, we); + return; + } + return; + } + } + var aa = Object.prototype.toString.call(l); + throw new Error( + "Objects are not valid as a React child (found: " + + (aa === "[object Object]" + ? "object with keys {" + Object.keys(l).join(", ") + "}" + : aa) + + "). If you meant to render a collection of children, use an array instead.", + ); + } + if (typeof l == "string") { + var ia = r.blockedSegment; + ia.lastPushedText = Xi( + r.blockedSegment.chunks, + l, + t.responseState, + ia.lastPushedText, + ); + return; + } + if (typeof l == "number") { + var Dl = r.blockedSegment; + Dl.lastPushedText = Xi( + r.blockedSegment.chunks, + "" + l, + t.responseState, + Dl.lastPushedText, + ); + return; + } + typeof l == "function" && + c( + "Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.", + ); + } + function Ue(t, r, l) { + for (var u = l.length, p = 0; p < u; p++) { + var g = r.treeContext; + r.treeContext = oi(g, u, p); + try { + ea(t, r, l[p]); + } finally { + r.treeContext = g; + } + } + } + function Mu(t, r, l) { + var u = r.blockedSegment, + p = u.chunks.length, + g = Jo(t, p, null, u.formatContext, u.lastPushedText, !0); + u.children.push(g), (u.lastPushedText = !1); + var y = mi( + t, + r.node, + r.blockedBoundary, + g, + r.abortSet, + r.legacyContext, + r.context, + r.treeContext, + ); + r.componentStack !== null && + (y.componentStack = r.componentStack.parent); + var w = y.ping; + l.then(w, w); + } + function ea(t, r, l) { + var u = r.blockedSegment.formatContext, + p = r.legacyContext, + g = r.context, + y = null; + y = r.componentStack; + try { + return Pe(t, r, l); + } catch (w) { + if ( + (ui(), + typeof w == "object" && w !== null && typeof w.then == "function") + ) { + Mu(t, r, w), + (r.blockedSegment.formatContext = u), + (r.legacyContext = p), + (r.context = g), + jn(g), + (r.componentStack = y); + return; + } else { + throw ( + ((r.blockedSegment.formatContext = u), + (r.legacyContext = p), + (r.context = g), + jn(g), + (r.componentStack = y), + w) + ); + } + } + } + function Lu(t, r, l, u) { + var p = Ot(t, u); + if ( + (r === null ? on(t, u) : (r.pendingTasks--, + r.forceClientRender || + ((r.forceClientRender = !0), + (r.errorDigest = p), + mt(r, u), + r.parentFlushed && t.clientRenderedBoundaries.push(r))), + t.allPendingTasks--, + t.allPendingTasks === 0) + ) { + var g = t.onAllReady; + g(); + } + } + function Ci(t) { + var r = this, + l = t.blockedBoundary, + u = t.blockedSegment; + (u.status = wr), Ei(r, l, u); + } + function El(t, r, l) { + var u = t.blockedBoundary, + p = t.blockedSegment; + if (((p.status = wr), u === null)) { + r.allPendingTasks--, + r.status !== tn && + ((r.status = tn), r.destination !== null && V(r.destination)); + } else { + if ((u.pendingTasks--, !u.forceClientRender)) { + u.forceClientRender = !0; + var g = l === void 0 + ? new Error( + "The render was aborted by the server without a reason.", + ) + : l; + u.errorDigest = r.onError(g); + { + var y = "The server did not finish this Suspense boundary: "; + g && typeof g.message == "string" + ? (g = y + g.message) + : (g = y + String(g)); + var w = at; + at = t; + try { + mt(u, g); + } finally { + at = w; + } + } + u.parentFlushed && r.clientRenderedBoundaries.push(u); + } + if ( + (u.fallbackAbortableTasks.forEach(function (_) { + return El(_, r, l); + }), + u.fallbackAbortableTasks.clear(), + r.allPendingTasks--, + r.allPendingTasks === 0) + ) { + var C = r.onAllReady; + C(); + } + } + } + function ta(t, r) { + if ( + r.chunks.length === 0 && + r.children.length === 1 && + r.children[0].boundary === null + ) { + var l = r.children[0]; + (l.id = r.id), (l.parentFlushed = !0), l.status === Zt && ta(t, l); + } else { + var u = t.completedSegments; + u.push(r); + } + } + function Ei(t, r, l) { + if (r === null) { + if (l.parentFlushed) { + if (t.completedRootSegment !== null) { + throw new Error( + "There can only be one root segment. This is a bug in React.", + ); + } + t.completedRootSegment = l; + } + if ((t.pendingRootTasks--, t.pendingRootTasks === 0)) { + t.onShellError = Yn; + var u = t.onShellReady; + u(); + } + } else if ((r.pendingTasks--, !r.forceClientRender)) { + if (r.pendingTasks === 0) { + l.parentFlushed && l.status === Zt && ta(r, l), + r.parentFlushed && t.completedBoundaries.push(r), + r.fallbackAbortableTasks.forEach(Ci, t), + r.fallbackAbortableTasks.clear(); + } else if (l.parentFlushed && l.status === Zt) { + ta(r, l); + var p = r.completedSegments; + p.length === 1 && r.parentFlushed && t.partialBoundaries.push(r); + } + } + if ((t.allPendingTasks--, t.allPendingTasks === 0)) { + var g = t.onAllReady; + g(); + } + } + function ra(t, r) { + var l = r.blockedSegment; + if (l.status === Vn) { + jn(r.context); + var u = null; + (u = at), (at = r); + try { + Pe(t, r, r.node), + Zi(l.chunks, t.responseState, l.lastPushedText, l.textEmbedded), + r.abortSet.delete(r), + (l.status = Zt), + Ei(t, r.blockedBoundary, l); + } catch (g) { + if ( + (ui(), + typeof g == "object" && g !== null && + typeof g.then == "function") + ) { + var p = r.ping; + g.then(p, p); + } else { + r.abortSet.delete(r), + (l.status = vi), + Lu(t, r.blockedBoundary, l, g); + } + } finally { + at = u; + } + } + } + function Ri(t) { + if (t.status !== tn) { + var r = su(), + l = Xo.current; + Xo.current = vl; + var u; + (u = hi.getCurrentStack), (hi.getCurrentStack = nn); + var p = en; + di(t.responseState); + try { + var g = t.pingedTasks, + y; + for (y = 0; y < g.length; y++) { + var w = g[y]; + ra(t, w); + } + g.splice(0, y), t.destination !== null && _i(t, t.destination); + } catch (C) { + Ot(t, C), on(t, C); + } finally { + di(p), + (Xo.current = l), + (hi.getCurrentStack = u), + l === vl && jn(r); + } + } + } + function na(t, r, l) { + switch (((l.parentFlushed = !0), l.status)) { + case Vn: { + var u = (l.id = t.nextSegmentId++); + return ( + (l.lastPushedText = !1), + (l.textEmbedded = !1), + k(r, t.responseState, u) + ); + } + case Zt: { + l.status = Zo; + for ( + var p = !0, g = l.chunks, y = 0, w = l.children, C = 0; + C < w.length; + C++ + ) { + for (var _ = w[C]; y < _.index; y++) x(r, g[y]); + p = Kn(t, r, _); + } + for (; y < g.length - 1; y++) x(r, g[y]); + return y < g.length && (p = R(r, g[y])), p; + } + default: + throw new Error( + "Aborted, errored or already flushed boundaries should not be flushed again. This is a bug in React.", + ); + } + } + function Kn(t, r, l) { + var u = l.boundary; + if (u === null) return na(t, r, l); + if (((u.parentFlushed = !0), u.forceClientRender)) { + return ( + qs( + r, + t.responseState, + u.errorDigest, + u.errorMessage, + u.errorComponentStack, + ), + na(t, r, l), + eu(r, t.responseState) + ); + } + if (u.pendingTasks > 0) { + (u.rootSegmentID = t.nextSegmentId++), + u.completedSegments.length > 0 && t.partialBoundaries.push(u); + var p = (u.id = Wt(t.responseState)); + return yr(r, t.responseState, p), na(t, r, l), Co(r, t.responseState); + } else { + if (u.byteSize > t.progressiveChunkSize) { + return ( + (u.rootSegmentID = t.nextSegmentId++), + t.completedBoundaries.push(u), + yr(r, t.responseState, u.id), + na(t, r, l), + Co(r, t.responseState) + ); + } + Ks(r, t.responseState); + var g = u.completedSegments; + if (g.length !== 1) { + throw new Error( + "A previously unvisited boundary must have exactly one root segment. This is a bug in React.", + ); + } + var y = g[0]; + return Kn(t, r, y), Ua(r, t.responseState); + } + } + function oa(t, r, l) { + return Js( + r, + t.responseState, + l.id, + l.errorDigest, + l.errorMessage, + l.errorComponentStack, + ); + } + function qn(t, r, l) { + return ( + Fs(r, t.responseState, l.formatContext, l.id), + Kn(t, r, l), + As(r, l.formatContext) + ); + } + function Rl(t, r, l) { + for (var u = l.completedSegments, p = 0; p < u.length; p++) { + var g = u[p]; + Ii(t, r, l, g); + } + return (u.length = 0), Vs(r, t.responseState, l.id, l.rootSegmentID); + } + function Il(t, r, l) { + for (var u = l.completedSegments, p = 0; p < u.length; p++) { + var g = u[p]; + if (!Ii(t, r, l, g)) return p++, u.splice(0, p), !1; + } + return u.splice(0, p), !0; + } + function Ii(t, r, l, u) { + if (u.status === Zo) return !0; + var p = u.id; + if (p === -1) { + var g = (u.id = l.rootSegmentID); + if (g === -1) { + throw new Error( + "A root segment ID must have been assigned by now. This is a bug in React.", + ); + } + return qn(t, r, u); + } else return qn(t, r, u), Hs(r, t.responseState, p); + } + function _i(t, r) { + try { + var l = t.completedRootSegment; + l !== null && + t.pendingRootTasks === 0 && + (Kn(t, r, l), + (t.completedRootSegment = null), + _n(r, t.responseState)); + var u = t.clientRenderedBoundaries, + p; + for (p = 0; p < u.length; p++) { + var g = u[p]; + if (!oa(t, r, g)) { + (t.destination = null), p++, u.splice(0, p); + return; + } + } + u.splice(0, p); + var y = t.completedBoundaries; + for (p = 0; p < y.length; p++) { + var w = y[p]; + if (!Rl(t, r, w)) { + (t.destination = null), p++, y.splice(0, p); + return; + } + } + y.splice(0, p); + var C = t.partialBoundaries; + for (p = 0; p < C.length; p++) { + var _ = C[p]; + if (!Il(t, r, _)) { + (t.destination = null), p++, C.splice(0, p); + return; + } + } + C.splice(0, p); + var O = t.completedBoundaries; + for (p = 0; p < O.length; p++) { + var j = O[p]; + if (!Rl(t, r, j)) { + (t.destination = null), p++, O.splice(0, p); + return; + } + } + O.splice(0, p); + } finally { + t.allPendingTasks === 0 && + t.pingedTasks.length === 0 && + t.clientRenderedBoundaries.length === 0 && + t.completedBoundaries.length === 0 && + (t.abortableTasks.size !== 0 && + c( + "There was still abortable task at the root when we closed. This is a bug in React.", + ), + V(r)); + } + } + function Pi(t) { + S(function () { + return Ri(t); + }); + } + function eo(t, r) { + if (t.status === gi) { + (t.status = tn), Oe(r, t.fatalError); + return; + } + if (t.status !== tn && t.destination === null) { + t.destination = r; + try { + _i(t, r); + } catch (l) { + Ot(t, l), on(t, l); + } + } + } + function _l(t, r) { + try { + var l = t.abortableTasks; + l.forEach(function (u) { + return El(u, t, r); + }), + l.clear(), + t.destination !== null && _i(t, t.destination); + } catch (u) { + Ot(t, u), on(t, u); + } + } + function Pl() {} + function Fi(t, r, l, u) { + var p = !1, + g = null, + y = "", + w = { + push: function (j) { + return j !== null && (y += j), !0; + }, + destroy: function (j) { + (p = !0), (g = j); + }, + }, + C = !1; + function _() { + C = !0; + } + var O = yl( + t, + Yi(l, r ? r.identifierPrefix : void 0), + Gi(), + 1 / 0, + Pl, + void 0, + _, + void 0, + void 0, + ); + if ((Pi(O), _l(O, u), eo(O, w), p)) throw g; + if (!C) { + throw new Error( + "A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.", + ); + } + return y; + } + function Bu(t, r) { + (t.prototype = Object.create(r.prototype)), + (t.prototype.constructor = t), + (t.__proto__ = r); + } + var Fl = (function (t) { + Bu(r, t); + function r() { + var u; + return ( + (u = t.call(this, {}) || this), + (u.request = null), + (u.startedFlowing = !1), + u + ); + } + var l = r.prototype; + return ( + (l._destroy = function (p, g) { + _l(this.request), g(p); + }), + (l._read = function (p) { + this.startedFlowing && eo(this.request, this); + }), + r + ); + })(n.Readable); + function Uu() {} + function Al(t, r, l) { + function u() { + (p.startedFlowing = !0), eo(g, p); + } + var p = new Fl(), + g = yl( + t, + Yi(!1, r ? r.identifierPrefix : void 0), + Gi(), + 1 / 0, + Uu, + u, + void 0, + void 0, + ); + return (p.request = g), Pi(g), p; + } + function o(t, r) { + return ( + c( + "renderToNodeStream is deprecated. Use renderToPipeableStream instead.", + ), Al(t, r) + ); + } + function a(t, r) { + return Al(t, r); + } + function f(t, r) { + return Fi( + t, + r, + !1, + 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server', + ); + } + function d(t, r) { + return Fi( + t, + r, + !0, + 'The server used "renderToStaticMarkup" which does not support Suspense. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server', + ); + } + (pa.renderToNodeStream = o), + (pa.renderToStaticMarkup = d), + (pa.renderToStaticNodeStream = a), + (pa.renderToString = f), + (pa.version = i); + })(); +}); +var Wd = an((Pc) => { + "use strict"; + process.env.NODE_ENV !== "production" && + (function () { + "use strict"; + var e = ua(), + n = require("util"), + i = "18.2.0", + s = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; + function v(o) { + { + for ( + var a = arguments.length, f = new Array(a > 1 ? a - 1 : 0), d = 1; + d < a; + d++ + ) { + f[d - 1] = arguments[d]; + } + m("warn", o, f); + } + } + function c(o) { + { + for ( + var a = arguments.length, f = new Array(a > 1 ? a - 1 : 0), d = 1; + d < a; + d++ + ) { + f[d - 1] = arguments[d]; + } + m("error", o, f); + } + } + function m(o, a, f) { + { + var d = s.ReactDebugCurrentFrame, + t = d.getStackAddendum(); + t !== "" && ((a += "%s"), (f = f.concat([t]))); + var r = f.map(function (l) { + return String(l); + }); + r.unshift("Warning: " + a), + Function.prototype.apply.call(console[o], console, r); + } + } + function S(o) { + setImmediate(o); + } + function E(o) { + typeof o.flush == "function" && o.flush(); + } + var x = 2048, + R = null, + D = 0, + V = !0; + function te(o) { + (R = new Uint8Array(x)), (D = 0), (V = !0); + } + function J(o, a) { + if (a.length !== 0) { + if (a.length * 3 > x) { + D > 0 && + (ue(o, R.subarray(0, D)), (R = new Uint8Array(x)), (D = 0)), + ue(o, _e.encode(a)); + return; + } + var f = R; + D > 0 && (f = R.subarray(D)); + var d = _e.encodeInto(a, f), + t = d.read, + r = d.written; + (D += r), + t < a.length && + (ue(o, R), + (R = new Uint8Array(x)), + (D = _e.encodeInto(a.slice(t), R).written)), + D === x && (ue(o, R), (R = new Uint8Array(x)), (D = 0)); + } + } + function Oe(o, a) { + if (a.byteLength !== 0) { + if (a.byteLength > x) { + D > 0 && + (ue(o, R.subarray(0, D)), (R = new Uint8Array(x)), (D = 0)), + ue(o, a); + return; + } + var f = a, + d = R.length - D; + d < f.byteLength && + (d === 0 + ? ue(o, R) + : (R.set(f.subarray(0, d), D), + (D += d), + ue(o, R), + (f = f.subarray(d))), + (R = new Uint8Array(x)), + (D = 0)), + R.set(f, D), + (D += f.byteLength), + D === x && (ue(o, R), (R = new Uint8Array(x)), (D = 0)); + } + } + function P(o, a) { + typeof a == "string" ? J(o, a) : Oe(o, a); + } + function ue(o, a) { + var f = o.write(a); + V = V && f; + } + function W(o, a) { + return P(o, a), V; + } + function q(o) { + R && D > 0 && o.write(R.subarray(0, D)), (R = null), (D = 0), (V = !0); + } + function xe(o) { + o.end(); + } + var _e = new n.TextEncoder(); + function he(o) { + return o; + } + function F(o) { + return _e.encode(o); + } + function ct(o, a) { + o.destroy(a); + } + function qt(o) { + { + var a = typeof Symbol == "function" && Symbol.toStringTag, + f = (a && o[Symbol.toStringTag]) || o.constructor.name || "Object"; + return f; + } + } + function yt(o) { + try { + return Mt(o), !1; + } catch { + return !0; + } + } + function Mt(o) { + return "" + o; + } + function Lt(o, a) { + if (yt(o)) { + return ( + c( + "The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.", + a, + qt(o), + ), Mt(o) + ); + } + } + function ft(o, a) { + if (yt(o)) { + return ( + c( + "The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it here.", + a, + qt(o), + ), Mt(o) + ); + } + } + function Me(o) { + if (yt(o)) { + return ( + c( + "The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using it here.", + qt(o), + ), Mt(o) + ); + } + } + var B = Object.prototype.hasOwnProperty, + Er = 0, + tt = 1, + Bt = 2, + bt = 3, + Le = 4, + er = 5, + re = 6, + ce = + ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", + tr = ce + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040", + rr = new RegExp("^[" + ce + "][" + tr + "]*$"), + nr = {}, + Rr = {}; + function St(o) { + return B.call(Rr, o) + ? !0 + : B.call(nr, o) + ? !1 + : rr.test(o) + ? ((Rr[o] = !0), !0) + : ((nr[o] = !0), c("Invalid attribute name: `%s`", o), !1); + } + function so(o, a, f, d) { + if (f !== null && f.type === Er) return !1; + switch (typeof a) { + case "function": + case "symbol": + return !0; + case "boolean": { + if (d) return !1; + if (f !== null) return !f.acceptsBooleans; + var t = o.toLowerCase().slice(0, 5); + return t !== "data-" && t !== "aria-"; + } + default: + return !1; + } + } + function uo(o) { + return ve.hasOwnProperty(o) ? ve[o] : null; + } + function ye(o, a, f, d, t, r, l) { + (this.acceptsBooleans = a === Bt || a === bt || a === Le), + (this.attributeName = d), + (this.attributeNamespace = t), + (this.mustUseProperty = f), + (this.propertyName = o), + (this.type = a), + (this.sanitizeURL = r), + (this.removeEmptyString = l); + } + var ve = {}, + co = [ + "children", + "dangerouslySetInnerHTML", + "defaultValue", + "defaultChecked", + "innerHTML", + "suppressContentEditableWarning", + "suppressHydrationWarning", + "style", + ]; + co.forEach(function (o) { + ve[o] = new ye(o, Er, !1, o, null, !1, !1); + }), + [ + ["acceptCharset", "accept-charset"], + ["className", "class"], + ["htmlFor", "for"], + ["httpEquiv", "http-equiv"], + ].forEach(function (o) { + var a = o[0], + f = o[1]; + ve[a] = new ye(a, tt, !1, f, null, !1, !1); + }), + ["contentEditable", "draggable", "spellCheck", "value"].forEach( + function (o) { + ve[o] = new ye(o, Bt, !1, o.toLowerCase(), null, !1, !1); + }, + ), + [ + "autoReverse", + "externalResourcesRequired", + "focusable", + "preserveAlpha", + ].forEach(function (o) { + ve[o] = new ye(o, Bt, !1, o, null, !1, !1); + }), + [ + "allowFullScreen", + "async", + "autoFocus", + "autoPlay", + "controls", + "default", + "defer", + "disabled", + "disablePictureInPicture", + "disableRemotePlayback", + "formNoValidate", + "hidden", + "loop", + "noModule", + "noValidate", + "open", + "playsInline", + "readOnly", + "required", + "reversed", + "scoped", + "seamless", + "itemScope", + ].forEach(function (o) { + ve[o] = new ye(o, bt, !1, o.toLowerCase(), null, !1, !1); + }), + ["checked", "multiple", "muted", "selected"].forEach(function (o) { + ve[o] = new ye(o, bt, !0, o, null, !1, !1); + }), + ["capture", "download"].forEach(function (o) { + ve[o] = new ye(o, Le, !1, o, null, !1, !1); + }), + ["cols", "rows", "size", "span"].forEach(function (o) { + ve[o] = new ye(o, re, !1, o, null, !1, !1); + }), + ["rowSpan", "start"].forEach(function (o) { + ve[o] = new ye(o, er, !1, o.toLowerCase(), null, !1, !1); + }); + var or = /[\-\:]([a-z])/g, + je = function (o) { + return o[1].toUpperCase(); + }; + [ + "accent-height", + "alignment-baseline", + "arabic-form", + "baseline-shift", + "cap-height", + "clip-path", + "clip-rule", + "color-interpolation", + "color-interpolation-filters", + "color-profile", + "color-rendering", + "dominant-baseline", + "enable-background", + "fill-opacity", + "fill-rule", + "flood-color", + "flood-opacity", + "font-family", + "font-size", + "font-size-adjust", + "font-stretch", + "font-style", + "font-variant", + "font-weight", + "glyph-name", + "glyph-orientation-horizontal", + "glyph-orientation-vertical", + "horiz-adv-x", + "horiz-origin-x", + "image-rendering", + "letter-spacing", + "lighting-color", + "marker-end", + "marker-mid", + "marker-start", + "overline-position", + "overline-thickness", + "paint-order", + "panose-1", + "pointer-events", + "rendering-intent", + "shape-rendering", + "stop-color", + "stop-opacity", + "strikethrough-position", + "strikethrough-thickness", + "stroke-dasharray", + "stroke-dashoffset", + "stroke-linecap", + "stroke-linejoin", + "stroke-miterlimit", + "stroke-opacity", + "stroke-width", + "text-anchor", + "text-decoration", + "text-rendering", + "underline-position", + "underline-thickness", + "unicode-bidi", + "unicode-range", + "units-per-em", + "v-alphabetic", + "v-hanging", + "v-ideographic", + "v-mathematical", + "vector-effect", + "vert-adv-y", + "vert-origin-x", + "vert-origin-y", + "word-spacing", + "writing-mode", + "xmlns:xlink", + "x-height", + ].forEach(function (o) { + var a = o.replace(or, je); + ve[a] = new ye(a, tt, !1, o, null, !1, !1); + }), + [ + "xlink:actuate", + "xlink:arcrole", + "xlink:role", + "xlink:show", + "xlink:title", + "xlink:type", + ].forEach(function (o) { + var a = o.replace(or, je); + ve[a] = new ye(a, tt, !1, o, "http://www.w3.org/1999/xlink", !1, !1); + }), + ["xml:base", "xml:lang", "xml:space"].forEach(function (o) { + var a = o.replace(or, je); + ve[a] = new ye( + a, + tt, + !1, + o, + "http://www.w3.org/XML/1998/namespace", + !1, + !1, + ); + }), + ["tabIndex", "crossOrigin"].forEach(function (o) { + ve[o] = new ye(o, tt, !1, o.toLowerCase(), null, !1, !1); + }); + var ha = "xlinkHref"; + (ve[ha] = new ye( + "xlinkHref", + tt, + !1, + "xlink:href", + "http://www.w3.org/1999/xlink", + !0, + !1, + )), + ["src", "href", "action", "formAction"].forEach(function (o) { + ve[o] = new ye(o, tt, !1, o.toLowerCase(), null, !0, !0); + }); + var ar = { + animationIterationCount: !0, + aspectRatio: !0, + borderImageOutset: !0, + borderImageSlice: !0, + borderImageWidth: !0, + boxFlex: !0, + boxFlexGroup: !0, + boxOrdinalGroup: !0, + columnCount: !0, + columns: !0, + flex: !0, + flexGrow: !0, + flexPositive: !0, + flexShrink: !0, + flexNegative: !0, + flexOrder: !0, + gridArea: !0, + gridRow: !0, + gridRowEnd: !0, + gridRowSpan: !0, + gridRowStart: !0, + gridColumn: !0, + gridColumnEnd: !0, + gridColumnSpan: !0, + gridColumnStart: !0, + fontWeight: !0, + lineClamp: !0, + lineHeight: !0, + opacity: !0, + order: !0, + orphans: !0, + tabSize: !0, + widows: !0, + zIndex: !0, + zoom: !0, + fillOpacity: !0, + floodOpacity: !0, + stopOpacity: !0, + strokeDasharray: !0, + strokeDashoffset: !0, + strokeMiterlimit: !0, + strokeOpacity: !0, + strokeWidth: !0, + }; + function dt(o, a) { + return o + a.charAt(0).toUpperCase() + a.substring(1); + } + var ir = ["Webkit", "ms", "Moz", "O"]; + Object.keys(ar).forEach(function (o) { + ir.forEach(function (a) { + ar[dt(a, o)] = ar[o]; + }); + }); + var fo = { + button: !0, + checkbox: !0, + image: !0, + hidden: !0, + radio: !0, + reset: !0, + submit: !0, + }; + function lr(o, a) { + fo[a.type] || + a.onChange || + a.onInput || + a.readOnly || + a.disabled || + a.value == null || + c( + "You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.", + ), + a.onChange || + a.readOnly || + a.disabled || + a.checked == null || + c( + "You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.", + ); + } + function fn(o, a) { + if (o.indexOf("-") === -1) return typeof a.is == "string"; + switch (o) { + case "annotation-xml": + case "color-profile": + case "font-face": + case "font-face-src": + case "font-face-uri": + case "font-face-format": + case "font-face-name": + case "missing-glyph": + return !1; + default: + return !0; + } + } + var sr = { + "aria-current": 0, + "aria-description": 0, + "aria-details": 0, + "aria-disabled": 0, + "aria-hidden": 0, + "aria-invalid": 0, + "aria-keyshortcuts": 0, + "aria-label": 0, + "aria-roledescription": 0, + "aria-autocomplete": 0, + "aria-checked": 0, + "aria-expanded": 0, + "aria-haspopup": 0, + "aria-level": 0, + "aria-modal": 0, + "aria-multiline": 0, + "aria-multiselectable": 0, + "aria-orientation": 0, + "aria-placeholder": 0, + "aria-pressed": 0, + "aria-readonly": 0, + "aria-required": 0, + "aria-selected": 0, + "aria-sort": 0, + "aria-valuemax": 0, + "aria-valuemin": 0, + "aria-valuenow": 0, + "aria-valuetext": 0, + "aria-atomic": 0, + "aria-busy": 0, + "aria-live": 0, + "aria-relevant": 0, + "aria-dropeffect": 0, + "aria-grabbed": 0, + "aria-activedescendant": 0, + "aria-colcount": 0, + "aria-colindex": 0, + "aria-colspan": 0, + "aria-controls": 0, + "aria-describedby": 0, + "aria-errormessage": 0, + "aria-flowto": 0, + "aria-labelledby": 0, + "aria-owns": 0, + "aria-posinset": 0, + "aria-rowcount": 0, + "aria-rowindex": 0, + "aria-rowspan": 0, + "aria-setsize": 0, + }, + pt = {}, + ke = new RegExp("^(aria)-[" + tr + "]*$"), + po = new RegExp("^(aria)[A-Z][" + tr + "]*$"); + function va(o, a) { + { + if (B.call(pt, a) && pt[a]) return !0; + if (po.test(a)) { + var f = "aria-" + a.slice(4).toLowerCase(), + d = sr.hasOwnProperty(f) ? f : null; + if (d == null) { + return ( + c( + "Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.", + a, + ), + (pt[a] = !0), + !0 + ); + } + if (a !== d) { + return ( + c("Invalid ARIA attribute `%s`. Did you mean `%s`?", a, d), + (pt[a] = !0), + !0 + ); + } + } + if (ke.test(a)) { + var t = a.toLowerCase(), + r = sr.hasOwnProperty(t) ? t : null; + if (r == null) return (pt[a] = !0), !1; + if (a !== r) { + return ( + c("Unknown ARIA attribute `%s`. Did you mean `%s`?", a, r), + (pt[a] = !0), + !0 + ); + } + } + } + return !0; + } + function ga(o, a) { + { + var f = []; + for (var d in a) { + var t = va(o, d); + t || f.push(d); + } + var r = f + .map(function (l) { + return "`" + l + "`"; + }) + .join(", "); + f.length === 1 + ? c( + "Invalid aria prop %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", + r, + o, + ) + : f.length > 1 && + c( + "Invalid aria props %s on <%s> tag. For details, see https://reactjs.org/link/invalid-aria-props", + r, + o, + ); + } + } + function dn(o, a) { + fn(o, a) || ga(o, a); + } + var ho = !1; + function ma(o, a) { + { + if (o !== "input" && o !== "textarea" && o !== "select") return; + a != null && + a.value === null && + !ho && + ((ho = !0), + o === "select" && a.multiple + ? c( + "`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.", + o, + ) + : c( + "`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.", + o, + )); + } + } + var pn = { + accept: "accept", + acceptcharset: "acceptCharset", + "accept-charset": "acceptCharset", + accesskey: "accessKey", + action: "action", + allowfullscreen: "allowFullScreen", + alt: "alt", + as: "as", + async: "async", + autocapitalize: "autoCapitalize", + autocomplete: "autoComplete", + autocorrect: "autoCorrect", + autofocus: "autoFocus", + autoplay: "autoPlay", + autosave: "autoSave", + capture: "capture", + cellpadding: "cellPadding", + cellspacing: "cellSpacing", + challenge: "challenge", + charset: "charSet", + checked: "checked", + children: "children", + cite: "cite", + class: "className", + classid: "classID", + classname: "className", + cols: "cols", + colspan: "colSpan", + content: "content", + contenteditable: "contentEditable", + contextmenu: "contextMenu", + controls: "controls", + controlslist: "controlsList", + coords: "coords", + crossorigin: "crossOrigin", + dangerouslysetinnerhtml: "dangerouslySetInnerHTML", + data: "data", + datetime: "dateTime", + default: "default", + defaultchecked: "defaultChecked", + defaultvalue: "defaultValue", + defer: "defer", + dir: "dir", + disabled: "disabled", + disablepictureinpicture: "disablePictureInPicture", + disableremoteplayback: "disableRemotePlayback", + download: "download", + draggable: "draggable", + enctype: "encType", + enterkeyhint: "enterKeyHint", + for: "htmlFor", + form: "form", + formmethod: "formMethod", + formaction: "formAction", + formenctype: "formEncType", + formnovalidate: "formNoValidate", + formtarget: "formTarget", + frameborder: "frameBorder", + headers: "headers", + height: "height", + hidden: "hidden", + high: "high", + href: "href", + hreflang: "hrefLang", + htmlfor: "htmlFor", + httpequiv: "httpEquiv", + "http-equiv": "httpEquiv", + icon: "icon", + id: "id", + imagesizes: "imageSizes", + imagesrcset: "imageSrcSet", + innerhtml: "innerHTML", + inputmode: "inputMode", + integrity: "integrity", + is: "is", + itemid: "itemID", + itemprop: "itemProp", + itemref: "itemRef", + itemscope: "itemScope", + itemtype: "itemType", + keyparams: "keyParams", + keytype: "keyType", + kind: "kind", + label: "label", + lang: "lang", + list: "list", + loop: "loop", + low: "low", + manifest: "manifest", + marginwidth: "marginWidth", + marginheight: "marginHeight", + max: "max", + maxlength: "maxLength", + media: "media", + mediagroup: "mediaGroup", + method: "method", + min: "min", + minlength: "minLength", + multiple: "multiple", + muted: "muted", + name: "name", + nomodule: "noModule", + nonce: "nonce", + novalidate: "noValidate", + open: "open", + optimum: "optimum", + pattern: "pattern", + placeholder: "placeholder", + playsinline: "playsInline", + poster: "poster", + preload: "preload", + profile: "profile", + radiogroup: "radioGroup", + readonly: "readOnly", + referrerpolicy: "referrerPolicy", + rel: "rel", + required: "required", + reversed: "reversed", + role: "role", + rows: "rows", + rowspan: "rowSpan", + sandbox: "sandbox", + scope: "scope", + scoped: "scoped", + scrolling: "scrolling", + seamless: "seamless", + selected: "selected", + shape: "shape", + size: "size", + sizes: "sizes", + span: "span", + spellcheck: "spellCheck", + src: "src", + srcdoc: "srcDoc", + srclang: "srcLang", + srcset: "srcSet", + start: "start", + step: "step", + style: "style", + summary: "summary", + tabindex: "tabIndex", + target: "target", + title: "title", + type: "type", + usemap: "useMap", + value: "value", + width: "width", + wmode: "wmode", + wrap: "wrap", + about: "about", + accentheight: "accentHeight", + "accent-height": "accentHeight", + accumulate: "accumulate", + additive: "additive", + alignmentbaseline: "alignmentBaseline", + "alignment-baseline": "alignmentBaseline", + allowreorder: "allowReorder", + alphabetic: "alphabetic", + amplitude: "amplitude", + arabicform: "arabicForm", + "arabic-form": "arabicForm", + ascent: "ascent", + attributename: "attributeName", + attributetype: "attributeType", + autoreverse: "autoReverse", + azimuth: "azimuth", + basefrequency: "baseFrequency", + baselineshift: "baselineShift", + "baseline-shift": "baselineShift", + baseprofile: "baseProfile", + bbox: "bbox", + begin: "begin", + bias: "bias", + by: "by", + calcmode: "calcMode", + capheight: "capHeight", + "cap-height": "capHeight", + clip: "clip", + clippath: "clipPath", + "clip-path": "clipPath", + clippathunits: "clipPathUnits", + cliprule: "clipRule", + "clip-rule": "clipRule", + color: "color", + colorinterpolation: "colorInterpolation", + "color-interpolation": "colorInterpolation", + colorinterpolationfilters: "colorInterpolationFilters", + "color-interpolation-filters": "colorInterpolationFilters", + colorprofile: "colorProfile", + "color-profile": "colorProfile", + colorrendering: "colorRendering", + "color-rendering": "colorRendering", + contentscripttype: "contentScriptType", + contentstyletype: "contentStyleType", + cursor: "cursor", + cx: "cx", + cy: "cy", + d: "d", + datatype: "datatype", + decelerate: "decelerate", + descent: "descent", + diffuseconstant: "diffuseConstant", + direction: "direction", + display: "display", + divisor: "divisor", + dominantbaseline: "dominantBaseline", + "dominant-baseline": "dominantBaseline", + dur: "dur", + dx: "dx", + dy: "dy", + edgemode: "edgeMode", + elevation: "elevation", + enablebackground: "enableBackground", + "enable-background": "enableBackground", + end: "end", + exponent: "exponent", + externalresourcesrequired: "externalResourcesRequired", + fill: "fill", + fillopacity: "fillOpacity", + "fill-opacity": "fillOpacity", + fillrule: "fillRule", + "fill-rule": "fillRule", + filter: "filter", + filterres: "filterRes", + filterunits: "filterUnits", + floodopacity: "floodOpacity", + "flood-opacity": "floodOpacity", + floodcolor: "floodColor", + "flood-color": "floodColor", + focusable: "focusable", + fontfamily: "fontFamily", + "font-family": "fontFamily", + fontsize: "fontSize", + "font-size": "fontSize", + fontsizeadjust: "fontSizeAdjust", + "font-size-adjust": "fontSizeAdjust", + fontstretch: "fontStretch", + "font-stretch": "fontStretch", + fontstyle: "fontStyle", + "font-style": "fontStyle", + fontvariant: "fontVariant", + "font-variant": "fontVariant", + fontweight: "fontWeight", + "font-weight": "fontWeight", + format: "format", + from: "from", + fx: "fx", + fy: "fy", + g1: "g1", + g2: "g2", + glyphname: "glyphName", + "glyph-name": "glyphName", + glyphorientationhorizontal: "glyphOrientationHorizontal", + "glyph-orientation-horizontal": "glyphOrientationHorizontal", + glyphorientationvertical: "glyphOrientationVertical", + "glyph-orientation-vertical": "glyphOrientationVertical", + glyphref: "glyphRef", + gradienttransform: "gradientTransform", + gradientunits: "gradientUnits", + hanging: "hanging", + horizadvx: "horizAdvX", + "horiz-adv-x": "horizAdvX", + horizoriginx: "horizOriginX", + "horiz-origin-x": "horizOriginX", + ideographic: "ideographic", + imagerendering: "imageRendering", + "image-rendering": "imageRendering", + in2: "in2", + in: "in", + inlist: "inlist", + intercept: "intercept", + k1: "k1", + k2: "k2", + k3: "k3", + k4: "k4", + k: "k", + kernelmatrix: "kernelMatrix", + kernelunitlength: "kernelUnitLength", + kerning: "kerning", + keypoints: "keyPoints", + keysplines: "keySplines", + keytimes: "keyTimes", + lengthadjust: "lengthAdjust", + letterspacing: "letterSpacing", + "letter-spacing": "letterSpacing", + lightingcolor: "lightingColor", + "lighting-color": "lightingColor", + limitingconeangle: "limitingConeAngle", + local: "local", + markerend: "markerEnd", + "marker-end": "markerEnd", + markerheight: "markerHeight", + markermid: "markerMid", + "marker-mid": "markerMid", + markerstart: "markerStart", + "marker-start": "markerStart", + markerunits: "markerUnits", + markerwidth: "markerWidth", + mask: "mask", + maskcontentunits: "maskContentUnits", + maskunits: "maskUnits", + mathematical: "mathematical", + mode: "mode", + numoctaves: "numOctaves", + offset: "offset", + opacity: "opacity", + operator: "operator", + order: "order", + orient: "orient", + orientation: "orientation", + origin: "origin", + overflow: "overflow", + overlineposition: "overlinePosition", + "overline-position": "overlinePosition", + overlinethickness: "overlineThickness", + "overline-thickness": "overlineThickness", + paintorder: "paintOrder", + "paint-order": "paintOrder", + panose1: "panose1", + "panose-1": "panose1", + pathlength: "pathLength", + patterncontentunits: "patternContentUnits", + patterntransform: "patternTransform", + patternunits: "patternUnits", + pointerevents: "pointerEvents", + "pointer-events": "pointerEvents", + points: "points", + pointsatx: "pointsAtX", + pointsaty: "pointsAtY", + pointsatz: "pointsAtZ", + prefix: "prefix", + preservealpha: "preserveAlpha", + preserveaspectratio: "preserveAspectRatio", + primitiveunits: "primitiveUnits", + property: "property", + r: "r", + radius: "radius", + refx: "refX", + refy: "refY", + renderingintent: "renderingIntent", + "rendering-intent": "renderingIntent", + repeatcount: "repeatCount", + repeatdur: "repeatDur", + requiredextensions: "requiredExtensions", + requiredfeatures: "requiredFeatures", + resource: "resource", + restart: "restart", + result: "result", + results: "results", + rotate: "rotate", + rx: "rx", + ry: "ry", + scale: "scale", + security: "security", + seed: "seed", + shaperendering: "shapeRendering", + "shape-rendering": "shapeRendering", + slope: "slope", + spacing: "spacing", + specularconstant: "specularConstant", + specularexponent: "specularExponent", + speed: "speed", + spreadmethod: "spreadMethod", + startoffset: "startOffset", + stddeviation: "stdDeviation", + stemh: "stemh", + stemv: "stemv", + stitchtiles: "stitchTiles", + stopcolor: "stopColor", + "stop-color": "stopColor", + stopopacity: "stopOpacity", + "stop-opacity": "stopOpacity", + strikethroughposition: "strikethroughPosition", + "strikethrough-position": "strikethroughPosition", + strikethroughthickness: "strikethroughThickness", + "strikethrough-thickness": "strikethroughThickness", + string: "string", + stroke: "stroke", + strokedasharray: "strokeDasharray", + "stroke-dasharray": "strokeDasharray", + strokedashoffset: "strokeDashoffset", + "stroke-dashoffset": "strokeDashoffset", + strokelinecap: "strokeLinecap", + "stroke-linecap": "strokeLinecap", + strokelinejoin: "strokeLinejoin", + "stroke-linejoin": "strokeLinejoin", + strokemiterlimit: "strokeMiterlimit", + "stroke-miterlimit": "strokeMiterlimit", + strokewidth: "strokeWidth", + "stroke-width": "strokeWidth", + strokeopacity: "strokeOpacity", + "stroke-opacity": "strokeOpacity", + suppresscontenteditablewarning: "suppressContentEditableWarning", + suppresshydrationwarning: "suppressHydrationWarning", + surfacescale: "surfaceScale", + systemlanguage: "systemLanguage", + tablevalues: "tableValues", + targetx: "targetX", + targety: "targetY", + textanchor: "textAnchor", + "text-anchor": "textAnchor", + textdecoration: "textDecoration", + "text-decoration": "textDecoration", + textlength: "textLength", + textrendering: "textRendering", + "text-rendering": "textRendering", + to: "to", + transform: "transform", + typeof: "typeof", + u1: "u1", + u2: "u2", + underlineposition: "underlinePosition", + "underline-position": "underlinePosition", + underlinethickness: "underlineThickness", + "underline-thickness": "underlineThickness", + unicode: "unicode", + unicodebidi: "unicodeBidi", + "unicode-bidi": "unicodeBidi", + unicoderange: "unicodeRange", + "unicode-range": "unicodeRange", + unitsperem: "unitsPerEm", + "units-per-em": "unitsPerEm", + unselectable: "unselectable", + valphabetic: "vAlphabetic", + "v-alphabetic": "vAlphabetic", + values: "values", + vectoreffect: "vectorEffect", + "vector-effect": "vectorEffect", + version: "version", + vertadvy: "vertAdvY", + "vert-adv-y": "vertAdvY", + vertoriginx: "vertOriginX", + "vert-origin-x": "vertOriginX", + vertoriginy: "vertOriginY", + "vert-origin-y": "vertOriginY", + vhanging: "vHanging", + "v-hanging": "vHanging", + videographic: "vIdeographic", + "v-ideographic": "vIdeographic", + viewbox: "viewBox", + viewtarget: "viewTarget", + visibility: "visibility", + vmathematical: "vMathematical", + "v-mathematical": "vMathematical", + vocab: "vocab", + widths: "widths", + wordspacing: "wordSpacing", + "word-spacing": "wordSpacing", + writingmode: "writingMode", + "writing-mode": "writingMode", + x1: "x1", + x2: "x2", + x: "x", + xchannelselector: "xChannelSelector", + xheight: "xHeight", + "x-height": "xHeight", + xlinkactuate: "xlinkActuate", + "xlink:actuate": "xlinkActuate", + xlinkarcrole: "xlinkArcrole", + "xlink:arcrole": "xlinkArcrole", + xlinkhref: "xlinkHref", + "xlink:href": "xlinkHref", + xlinkrole: "xlinkRole", + "xlink:role": "xlinkRole", + xlinkshow: "xlinkShow", + "xlink:show": "xlinkShow", + xlinktitle: "xlinkTitle", + "xlink:title": "xlinkTitle", + xlinktype: "xlinkType", + "xlink:type": "xlinkType", + xmlbase: "xmlBase", + "xml:base": "xmlBase", + xmllang: "xmlLang", + "xml:lang": "xmlLang", + xmlns: "xmlns", + "xml:space": "xmlSpace", + xmlnsxlink: "xmlnsXlink", + "xmlns:xlink": "xmlnsXlink", + xmlspace: "xmlSpace", + y1: "y1", + y2: "y2", + y: "y", + ychannelselector: "yChannelSelector", + z: "z", + zoomandpan: "zoomAndPan", + }, + wt = function () {}; + { + var Te = {}, + vo = /^on./, + go = /^on[^A-Z]/, + xt = new RegExp("^(aria)-[" + tr + "]*$"), + hn = new RegExp("^(aria)[A-Z][" + tr + "]*$"); + wt = function (o, a, f, d) { + if (B.call(Te, a) && Te[a]) return !0; + var t = a.toLowerCase(); + if (t === "onfocusin" || t === "onfocusout") { + return ( + c( + "React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React.", + ), + (Te[a] = !0), + !0 + ); + } + if (d != null) { + var r = d.registrationNameDependencies, + l = d.possibleRegistrationNames; + if (r.hasOwnProperty(a)) return !0; + var u = l.hasOwnProperty(t) ? l[t] : null; + if (u != null) { + return ( + c( + "Invalid event handler property `%s`. Did you mean `%s`?", + a, + u, + ), + (Te[a] = !0), + !0 + ); + } + if (vo.test(a)) { + return ( + c( + "Unknown event handler property `%s`. It will be ignored.", + a, + ), + (Te[a] = !0), + !0 + ); + } + } else if (vo.test(a)) { + return ( + go.test(a) && + c( + "Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.", + a, + ), + (Te[a] = !0), + !0 + ); + } + if (xt.test(a) || hn.test(a)) return !0; + if (t === "innerhtml") { + return ( + c( + "Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`.", + ), + (Te[a] = !0), + !0 + ); + } + if (t === "aria") { + return ( + c( + "The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead.", + ), + (Te[a] = !0), + !0 + ); + } + if ( + t === "is" && f !== null && f !== void 0 && typeof f != "string" + ) { + return ( + c( + "Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.", + typeof f, + ), + (Te[a] = !0), + !0 + ); + } + if (typeof f == "number" && isNaN(f)) { + return ( + c( + "Received NaN for the `%s` attribute. If this is expected, cast the value to a string.", + a, + ), + (Te[a] = !0), + !0 + ); + } + var p = uo(a), + g = p !== null && p.type === Er; + if (pn.hasOwnProperty(t)) { + var y = pn[t]; + if (y !== a) { + return ( + c("Invalid DOM property `%s`. Did you mean `%s`?", a, y), + (Te[a] = !0), + !0 + ); + } + } else if (!g && a !== t) { + return ( + c( + "React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.", + a, + t, + ), + (Te[a] = !0), + !0 + ); + } + return typeof f == "boolean" && so(a, f, p, !1) + ? (f + ? c( + 'Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.', + f, + a, + a, + f, + a, + ) + : c( + 'Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.', + f, + a, + a, + f, + a, + a, + a, + ), + (Te[a] = !0), + !0) + : g + ? !0 + : so(a, f, p, !1) + ? ((Te[a] = !0), !1) + : ((f === "false" || f === "true") && + p !== null && + p.type === bt && + (c( + "Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?", + f, + a, + f === "false" + ? "The browser will interpret it as a truthy value." + : 'Although this works, it will not work as expected if you pass the string "false".', + a, + f, + ), + (Te[a] = !0)), + !0); + }; + } + var vn = function (o, a, f) { + { + var d = []; + for (var t in a) { + var r = wt(o, t, a[t], f); + r || d.push(t); + } + var l = d + .map(function (u) { + return "`" + u + "`"; + }) + .join(", "); + d.length === 1 + ? c( + "Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", + l, + o, + ) + : d.length > 1 && + c( + "Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://reactjs.org/link/attribute-behavior ", + l, + o, + ); + } + }; + function Ir(o, a, f) { + fn(o, a) || vn(o, a, f); + } + var ur = function () {}; + { + var _r = /^(?:webkit|moz|o)[A-Z]/, + ya = /^-ms-/, + ba = /-(.)/g, + mo = /;\s*$/, + Ut = {}, + gn = {}, + jt = !1, + Pr = !1, + ge = function (o) { + return o.replace(ba, function (a, f) { + return f.toUpperCase(); + }); + }, + Sa = function (o) { + (Ut.hasOwnProperty(o) && Ut[o]) || + ((Ut[o] = !0), + c( + "Unsupported style property %s. Did you mean %s?", + o, + ge(o.replace(ya, "ms-")), + )); + }, + wa = function (o) { + (Ut.hasOwnProperty(o) && Ut[o]) || + ((Ut[o] = !0), + c( + "Unsupported vendor-prefixed style property %s. Did you mean %s?", + o, + o.charAt(0).toUpperCase() + o.slice(1), + )); + }, + xa = function (o, a) { + (gn.hasOwnProperty(a) && gn[a]) || + ((gn[a] = !0), + c( + `Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`, + o, + a.replace(mo, ""), + )); + }, + ka = function (o, a) { + jt || + ((jt = !0), + c( + "`NaN` is an invalid value for the `%s` css style property.", + o, + )); + }, + mn = function (o, a) { + Pr || + ((Pr = !0), + c( + "`Infinity` is an invalid value for the `%s` css style property.", + o, + )); + }; + ur = function (o, a) { + o.indexOf("-") > -1 + ? Sa(o) + : _r.test(o) + ? wa(o) + : mo.test(a) && xa(o, a), + typeof a == "number" && + (isNaN(a) ? ka(o, a) : isFinite(a) || mn(o, a)); + }; + } + var yo = ur, + Ta = /["'&<>]/; + function me(o) { + Me(o); + var a = "" + o, + f = Ta.exec(a); + if (!f) return a; + var d, + t = "", + r, + l = 0; + for (r = f.index; r < a.length; r++) { + switch (a.charCodeAt(r)) { + case 34: + d = """; + break; + case 38: + d = "&"; + break; + case 39: + d = "'"; + break; + case 60: + d = "<"; + break; + case 62: + d = ">"; + break; + default: + continue; + } + l !== r && (t += a.substring(l, r)), (l = r + 1), (t += d); + } + return l !== r ? t + a.substring(l, r) : t; + } + function be(o) { + return typeof o == "boolean" || typeof o == "number" ? "" + o : me(o); + } + var Ca = /([A-Z])/g, + Ea = /^ms-/; + function Ra(o) { + return o.replace(Ca, "-$1").toLowerCase().replace(Ea, "-ms-"); + } + var bo = + /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i, + So = !1; + function Ia(o) { + !So && + bo.test(o) && + ((So = !0), + c( + "A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.", + JSON.stringify(o), + )); + } + var _a = Array.isArray; + function cr(o) { + return _a(o); + } + var Fr = F("<script>"), + kt = F("</script>"), + Ar = F('<script src="'), + Dr = F('<script type="module" src="'), + fr = F('" async=""></script>'); + function yn(o) { + return Me(o), ("" + o).replace(Tt, Or); + } + var Tt = /(<\/|<)(s)(cript)/gi, + Or = function (o, a, f, d) { + return "" + a + (f === "s" ? "\\u0073" : "\\u0053") + d; + }; + function He(o, a, f, d, t) { + var r = o === void 0 ? "" : o, + l = a === void 0 ? Fr : F('<script nonce="' + be(a) + '">'), + u = []; + if ((f !== void 0 && u.push(l, yn(f), kt), d !== void 0)) { + for (var p = 0; p < d.length; p++) u.push(Ar, be(d[p]), fr); + } + if (t !== void 0) { + for (var g = 0; g < t.length; g++) u.push(Dr, be(t[g]), fr); + } + return { + bootstrapChunks: u, + startInlineScript: l, + placeholderPrefix: F(r + "P:"), + segmentPrefix: F(r + "S:"), + boundaryPrefix: r + "B:", + idPrefix: r, + nextSuspenseID: 0, + sentCompleteSegmentFunction: !1, + sentCompleteBoundaryFunction: !1, + sentClientRenderFunction: !1, + }; + } + var Ht = 0, + Ct = 1, + Wt = 2, + zt = 3, + Et = 4, + dr = 5, + bn = 6, + Sn = 7; + function Ee(o, a) { + return { insertionMode: o, selectedValue: a }; + } + function wn(o) { + var a = o === "http://www.w3.org/2000/svg" + ? Wt + : o === "http://www.w3.org/1998/Math/MathML" + ? zt + : Ht; + return Ee(a, null); + } + function Mr(o, a, f) { + switch (a) { + case "select": + return Ee(Ct, f.value != null ? f.value : f.defaultValue); + case "svg": + return Ee(Wt, null); + case "math": + return Ee(zt, null); + case "foreignObject": + return Ee(Ct, null); + case "table": + return Ee(Et, null); + case "thead": + case "tbody": + case "tfoot": + return Ee(dr, null); + case "colgroup": + return Ee(Sn, null); + case "tr": + return Ee(bn, null); + } + return o.insertionMode >= Et || o.insertionMode === Ht + ? Ee(Ct, null) + : o; + } + var Lr = null; + function Br(o) { + var a = o.nextSuspenseID++; + return F(o.boundaryPrefix + a.toString(16)); + } + function wo(o, a, f) { + var d = o.idPrefix, + t = ":" + d + "R" + a; + return f > 0 && (t += "H" + f.toString(32)), t + ":"; + } + function We(o) { + return be(o); + } + var Rt = F("<!-- -->"); + function ht(o, a, f, d) { + return a === "" ? d : (d && o.push(Rt), o.push(We(a)), !0); + } + function $t(o, a, f, d) { + f && d && o.push(Rt); + } + var Ce = new Map(); + function rt(o) { + var a = Ce.get(o); + if (a !== void 0) return a; + var f = F(be(Ra(o))); + return Ce.set(o, f), f; + } + var pr = F(' style="'), + hr = F(":"), + It = F(";"); + function vr(o, a, f) { + if (typeof f != "object") { + throw new Error( + "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.", + ); + } + var d = !0; + for (var t in f) { + if (!!B.call(f, t)) { + var r = f[t]; + if (!(r == null || typeof r == "boolean" || r === "")) { + var l = void 0, + u = void 0, + p = t.indexOf("--") === 0; + p + ? ((l = be(t)), ft(r, t), (u = be(("" + r).trim()))) + : (yo(t, r), + (l = rt(t)), + typeof r == "number" + ? r !== 0 && !B.call(ar, t) ? (u = r + "px") : (u = "" + r) + : (ft(r, t), (u = be(("" + r).trim())))), + d ? ((d = !1), o.push(pr, l, hr, u)) : o.push(It, l, hr, u); + } + } + } + d || o.push(vt); + } + var Ze = F(" "), + _t = F('="'), + vt = F('"'), + Ur = F('=""'); + function Re(o, a, f, d) { + switch (f) { + case "style": { + vr(o, a, d); + return; + } + case "defaultValue": + case "defaultChecked": + case "innerHTML": + case "suppressContentEditableWarning": + case "suppressHydrationWarning": + return; + } + if ( + !( + f.length > 2 && + (f[0] === "o" || f[0] === "O") && + (f[1] === "n" || f[1] === "N") + ) + ) { + var t = uo(f); + if (t !== null) { + switch (typeof d) { + case "function": + case "symbol": + return; + case "boolean": + if (!t.acceptsBooleans) return; + } + var r = t.attributeName, + l = r; + switch (t.type) { + case bt: + d && o.push(Ze, l, Ur); + return; + case Le: + d === !0 + ? o.push(Ze, l, Ur) + : d === !1 || o.push(Ze, l, _t, be(d), vt); + return; + case er: + isNaN(d) || o.push(Ze, l, _t, be(d), vt); + break; + case re: + !isNaN(d) && d >= 1 && o.push(Ze, l, _t, be(d), vt); + break; + default: + t.sanitizeURL && (Lt(d, r), (d = "" + d), Ia(d)), + o.push(Ze, l, _t, be(d), vt); + } + } else if (St(f)) { + switch (typeof d) { + case "function": + case "symbol": + return; + case "boolean": { + var u = f.toLowerCase().slice(0, 5); + if (u !== "data-" && u !== "aria-") return; + } + } + o.push(Ze, f, _t, be(d), vt); + } + } + } + var Je = F(">"), + xn = F("/>"); + function gr(o, a, f) { + if (a != null) { + if (f != null) { + throw new Error( + "Can only set one of `children` or `props.dangerouslySetInnerHTML`.", + ); + } + if (typeof a != "object" || !("__html" in a)) { + throw new Error( + "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.", + ); + } + var d = a.__html; + d != null && (Me(d), o.push("" + d)); + } + } + var jr = !1, + kn = !1, + Tn = !1, + xo = !1, + ko = !1, + To = !1, + Cn = !1; + function Pt(o, a) { + { + var f = o[a]; + if (f != null) { + var d = cr(f); + o.multiple && !d + ? c( + "The `%s` prop supplied to <select> must be an array if `multiple` is true.", + a, + ) + : !o.multiple && + d && + c( + "The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.", + a, + ); + } + } + } + function Pa(o, a, f) { + lr("select", a), + Pt(a, "value"), + Pt(a, "defaultValue"), + a.value !== void 0 && + a.defaultValue !== void 0 && + !Tn && + (c( + "Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://reactjs.org/link/controlled-components", + ), + (Tn = !0)), + o.push(T("select")); + var d = null, + t = null; + for (var r in a) { + if (B.call(a, r)) { + var l = a[r]; + if (l == null) continue; + switch (r) { + case "children": + d = l; + break; + case "dangerouslySetInnerHTML": + t = l; + break; + case "defaultValue": + case "value": + break; + default: + Re(o, f, r, l); + break; + } + } + } + return o.push(Je), gr(o, t, d), d; + } + function gt(o) { + var a = ""; + return ( + e.Children.forEach(o, function (f) { + f != null && + ((a += f), + !ko && + typeof f != "string" && + typeof f != "number" && + ((ko = !0), + c( + "Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>.", + ))); + }), a + ); + } + var Hr = F(' selected=""'); + function Fa(o, a, f, d) { + var t = d.selectedValue; + o.push(T("option")); + var r = null, + l = null, + u = null, + p = null; + for (var g in a) { + if (B.call(a, g)) { + var y = a[g]; + if (y == null) continue; + switch (g) { + case "children": + r = y; + break; + case "selected": + (u = y), + Cn || + (c( + "Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>.", + ), + (Cn = !0)); + break; + case "dangerouslySetInnerHTML": + p = y; + break; + case "value": + l = y; + default: + Re(o, f, g, y); + break; + } + } + } + if (t != null) { + var w; + if ( + (l !== null ? (Lt(l, "value"), (w = "" + l)) : (p !== null && + (To || + ((To = !0), + c( + "Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected.", + ))), + (w = gt(r))), + cr(t)) + ) { + for (var C = 0; C < t.length; C++) { + Lt(t[C], "value"); + var _ = "" + t[C]; + if (_ === w) { + o.push(Hr); + break; + } + } + } else Lt(t, "select.value"), "" + t === w && o.push(Hr); + } else u && o.push(Hr); + return o.push(Je), gr(o, p, r), r; + } + function mr(o, a, f) { + lr("input", a), + a.checked !== void 0 && + a.defaultChecked !== void 0 && + !kn && + (c( + "%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", + "A component", + a.type, + ), + (kn = !0)), + a.value !== void 0 && + a.defaultValue !== void 0 && + !jr && + (c( + "%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components", + "A component", + a.type, + ), + (jr = !0)), + o.push(T("input")); + var d = null, + t = null, + r = null, + l = null; + for (var u in a) { + if (B.call(a, u)) { + var p = a[u]; + if (p == null) continue; + switch (u) { + case "children": + case "dangerouslySetInnerHTML": + throw new Error( + "input is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.", + ); + case "defaultChecked": + l = p; + break; + case "defaultValue": + t = p; + break; + case "checked": + r = p; + break; + case "value": + d = p; + break; + default: + Re(o, f, u, p); + break; + } + } + } + return ( + r !== null + ? Re(o, f, "checked", r) + : l !== null && Re(o, f, "checked", l), + d !== null + ? Re(o, f, "value", d) + : t !== null && Re(o, f, "value", t), + o.push(xn), + null + ); + } + function Be(o, a, f) { + lr("textarea", a), + a.value !== void 0 && + a.defaultValue !== void 0 && + !xo && + (c( + "Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components", + ), + (xo = !0)), + o.push(T("textarea")); + var d = null, + t = null, + r = null; + for (var l in a) { + if (B.call(a, l)) { + var u = a[l]; + if (u == null) continue; + switch (l) { + case "children": + r = u; + break; + case "value": + d = u; + break; + case "defaultValue": + t = u; + break; + case "dangerouslySetInnerHTML": + throw new Error( + "`dangerouslySetInnerHTML` does not make sense on <textarea>.", + ); + default: + Re(o, f, l, u); + break; + } + } + } + if ((d === null && t !== null && (d = t), o.push(Je), r != null)) { + if ( + (c( + "Use the `defaultValue` or `value` props instead of setting children on <textarea>.", + ), + d != null) + ) { + throw new Error( + "If you supply `defaultValue` on a <textarea>, do not pass children.", + ); + } + if (cr(r)) { + if (r.length > 1) { + throw new Error("<textarea> can only have at most one child."); + } + Me(r[0]), (d = "" + r[0]); + } + Me(r), (d = "" + r); + } + return ( + typeof d == "string" && + d[0] === + ` +` && + o.push(_n), + d !== null && (Lt(d, "value"), o.push(We("" + d))), + null + ); + } + function En(o, a, f, d) { + o.push(T(f)); + for (var t in a) { + if (B.call(a, t)) { + var r = a[t]; + if (r == null) continue; + switch (t) { + case "children": + case "dangerouslySetInnerHTML": + throw new Error( + f + + " is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.", + ); + default: + Re(o, d, t, r); + break; + } + } + } + return o.push(xn), null; + } + function Rn(o, a, f) { + o.push(T("menuitem")); + for (var d in a) { + if (B.call(a, d)) { + var t = a[d]; + if (t == null) continue; + switch (d) { + case "children": + case "dangerouslySetInnerHTML": + throw new Error( + "menuitems cannot have `children` nor `dangerouslySetInnerHTML`.", + ); + default: + Re(o, f, d, t); + break; + } + } + } + return o.push(Je), null; + } + function Aa(o, a, f) { + o.push(T("title")); + var d = null; + for (var t in a) { + if (B.call(a, t)) { + var r = a[t]; + if (r == null) continue; + switch (t) { + case "children": + d = r; + break; + case "dangerouslySetInnerHTML": + throw new Error( + "`dangerouslySetInnerHTML` does not make sense on <title>.", + ); + default: + Re(o, f, t, r); + break; + } + } + } + o.push(Je); + { + var l = Array.isArray(d) && d.length < 2 ? d[0] || null : d; + Array.isArray(d) && d.length > 1 + ? c( + "A title element received an array with more than 1 element as children. In browsers title Elements can only have Text Nodes as children. If the children being rendered output more than a single text node in aggregate the browser will display markup and comments as text in the title and hydration will likely fail and fall back to client rendering", + ) + : l != null && l.$$typeof != null + ? c( + "A title element received a React element for children. In the browser title Elements can only have Text Nodes as children. If the children being rendered output more than a single text node in aggregate the browser will display markup and comments as text in the title and hydration will likely fail and fall back to client rendering", + ) + : l != null && + typeof l != "string" && + typeof l != "number" && + c( + "A title element received a value that was not a string or number for children. In the browser title Elements can only have Text Nodes as children. If the children being rendered output more than a single text node in aggregate the browser will display markup and comments as text in the title and hydration will likely fail and fall back to client rendering", + ); + } + return d; + } + function In(o, a, f, d) { + o.push(T(f)); + var t = null, + r = null; + for (var l in a) { + if (B.call(a, l)) { + var u = a[l]; + if (u == null) continue; + switch (l) { + case "children": + t = u; + break; + case "dangerouslySetInnerHTML": + r = u; + break; + default: + Re(o, d, l, u); + break; + } + } + } + return ( + o.push(Je), + gr(o, r, t), + typeof t == "string" ? (o.push(We(t)), null) : t + ); + } + function Da(o, a, f, d) { + o.push(T(f)); + var t = null, + r = null; + for (var l in a) { + if (B.call(a, l)) { + var u = a[l]; + if (u == null) continue; + switch (l) { + case "children": + t = u; + break; + case "dangerouslySetInnerHTML": + r = u; + break; + case "style": + vr(o, d, u); + break; + case "suppressContentEditableWarning": + case "suppressHydrationWarning": + break; + default: + St(l) && + typeof u != "function" && + typeof u != "symbol" && + o.push(Ze, l, _t, be(u), vt); + break; + } + } + } + return o.push(Je), gr(o, r, t), t; + } + var _n = F(` +`); + function h(o, a, f, d) { + o.push(T(f)); + var t = null, + r = null; + for (var l in a) { + if (B.call(a, l)) { + var u = a[l]; + if (u == null) continue; + switch (l) { + case "children": + t = u; + break; + case "dangerouslySetInnerHTML": + r = u; + break; + default: + Re(o, d, l, u); + break; + } + } + } + if ((o.push(Je), r != null)) { + if (t != null) { + throw new Error( + "Can only set one of `children` or `props.dangerouslySetInnerHTML`.", + ); + } + if (typeof r != "object" || !("__html" in r)) { + throw new Error( + "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.", + ); + } + var p = r.__html; + p != null && + (typeof p == "string" && + p.length > 0 && + p[0] === + ` +` + ? o.push(_n, p) + : (Me(p), o.push("" + p))); + } + return ( + typeof t == "string" && + t[0] === + ` +` && + o.push(_n), t + ); + } + var b = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/, + k = new Map(); + function T(o) { + var a = k.get(o); + if (a === void 0) { + if (!b.test(o)) throw new Error("Invalid tag: " + o); + (a = F("<" + o)), k.set(o, a); + } + return a; + } + var I = F("<!DOCTYPE html>"); + function U(o, a, f, d, t) { + switch ( + (dn(a, f), + ma(a, f), + Ir(a, f, null), + !f.suppressContentEditableWarning && + f.contentEditable && + f.children != null && + c( + "A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional.", + ), + t.insertionMode !== Wt && + t.insertionMode !== zt && + a.indexOf("-") === -1 && + typeof f.is != "string" && + a.toLowerCase() !== a && + c( + "<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.", + a, + ), + a) + ) { + case "select": + return Pa(o, f, d); + case "option": + return Fa(o, f, d, t); + case "textarea": + return Be(o, f, d); + case "input": + return mr(o, f, d); + case "menuitem": + return Rn(o, f, d); + case "title": + return Aa(o, f, d); + case "listing": + case "pre": + return h(o, f, a, d); + case "area": + case "base": + case "br": + case "col": + case "embed": + case "hr": + case "img": + case "keygen": + case "link": + case "meta": + case "param": + case "source": + case "track": + case "wbr": + return En(o, f, a, d); + case "annotation-xml": + case "color-profile": + case "font-face": + case "font-face-src": + case "font-face-uri": + case "font-face-format": + case "font-face-name": + case "missing-glyph": + return In(o, f, a, d); + case "html": + return t.insertionMode === Ht && o.push(I), In(o, f, a, d); + default: + return a.indexOf("-") === -1 && typeof f.is != "string" + ? In(o, f, a, d) + : Da(o, f, a, d); + } + } + var M = F("</"), + H = F(">"); + function z(o, a, f) { + switch (a) { + case "area": + case "base": + case "br": + case "col": + case "embed": + case "hr": + case "img": + case "input": + case "keygen": + case "link": + case "meta": + case "param": + case "source": + case "track": + case "wbr": + break; + default: + o.push(M, a, H); + } + } + function Y(o, a) { + for (var f = a.bootstrapChunks, d = 0; d < f.length - 1; d++) { + P(o, f[d]); + } + return d < f.length ? W(o, f[d]) : !0; + } + var Q = F('<template id="'), + K = F('"></template>'); + function ee(o, a, f) { + P(o, Q), P(o, a.placeholderPrefix); + var d = f.toString(16); + return P(o, d), W(o, K); + } + var fe = F("<!--$-->"), + Se = F('<!--$?--><template id="'), + yr = F('"></template>'), + Pn = F("<!--$!-->"), + Wr = F("<!--/$-->"), + Co = F("<template"), + zr = F('"'), + Oa = F(' data-dgst="'), + Eo = F(' data-msg="'), + Ma = F(' data-stck="'), + vs = F("></template>"); + function gs(o, a) { + return W(o, fe); + } + function Ni(o, a, f) { + if ((P(o, Se), f === null)) { + throw new Error( + "An ID must have been assigned before we can complete the boundary.", + ); + } + return P(o, f), W(o, yr); + } + function ms(o, a, f, d, t) { + var r; + return ( + (r = W(o, Pn)), + P(o, Co), + f && (P(o, Oa), P(o, be(f)), P(o, zr)), + d && (P(o, Eo), P(o, be(d)), P(o, zr)), + t && (P(o, Ma), P(o, be(t)), P(o, zr)), + (r = W(o, vs)), + r + ); + } + function ys(o, a) { + return W(o, Wr); + } + function Vi(o, a) { + return W(o, Wr); + } + function bs(o, a) { + return W(o, Wr); + } + var Ss = F('<div hidden id="'), + ws = F('">'), + xs = F("</div>"), + ks = F('<svg aria-hidden="true" style="display:none" id="'), + Ts = F('">'), + Cs = F("</svg>"), + Es = F('<math aria-hidden="true" style="display:none" id="'), + Rs = F('">'), + Is = F("</math>"), + _s = F('<table hidden id="'), + Ps = F('">'), + Fs = F("</table>"), + As = F('<table hidden><tbody id="'), + Ds = F('">'), + Os = F("</tbody></table>"), + Ms = F('<table hidden><tr id="'), + Ls = F('">'), + Bs = F("</tr></table>"), + Us = F('<table hidden><colgroup id="'), + js = F('">'), + Hs = F("</colgroup></table>"); + function Ws(o, a, f, d) { + switch (f.insertionMode) { + case Ht: + case Ct: + return ( + P(o, Ss), P(o, a.segmentPrefix), P(o, d.toString(16)), W(o, ws) + ); + case Wt: + return ( + P(o, ks), P(o, a.segmentPrefix), P(o, d.toString(16)), W(o, Ts) + ); + case zt: + return ( + P(o, Es), P(o, a.segmentPrefix), P(o, d.toString(16)), W(o, Rs) + ); + case Et: + return ( + P(o, _s), P(o, a.segmentPrefix), P(o, d.toString(16)), W(o, Ps) + ); + case dr: + return ( + P(o, As), P(o, a.segmentPrefix), P(o, d.toString(16)), W(o, Ds) + ); + case bn: + return ( + P(o, Ms), P(o, a.segmentPrefix), P(o, d.toString(16)), W(o, Ls) + ); + case Sn: + return ( + P(o, Us), P(o, a.segmentPrefix), P(o, d.toString(16)), W(o, js) + ); + default: + throw new Error("Unknown insertion mode. This is a bug in React."); + } + } + function zs(o, a) { + switch (a.insertionMode) { + case Ht: + case Ct: + return W(o, xs); + case Wt: + return W(o, Cs); + case zt: + return W(o, Is); + case Et: + return W(o, Fs); + case dr: + return W(o, Os); + case bn: + return W(o, Bs); + case Sn: + return W(o, Hs); + default: + throw new Error("Unknown insertion mode. This is a bug in React."); + } + } + var $s = + "function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)}", + Ns = + 'function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}}', + Vs = + 'function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())}', + Ys = F($s + ';$RS("'), + Gs = F('$RS("'), + Xs = F('","'), + Zs = F('")</script>'); + function La(o, a, f) { + P(o, a.startInlineScript), + a.sentCompleteSegmentFunction + ? P(o, Gs) + : ((a.sentCompleteSegmentFunction = !0), P(o, Ys)), + P(o, a.segmentPrefix); + var d = f.toString(16); + return P(o, d), P(o, Xs), P(o, a.placeholderPrefix), P(o, d), W(o, Zs); + } + var Js = F(Ns + ';$RC("'), + Qs = F('$RC("'), + Ba = F('","'), + Yi = F('")</script>'); + function Gi(o, a, f, d) { + if ( + (P(o, a.startInlineScript), + a.sentCompleteBoundaryFunction + ? P(o, Qs) + : ((a.sentCompleteBoundaryFunction = !0), P(o, Js)), + f === null) + ) { + throw new Error( + "An ID must have been assigned before we can complete the boundary.", + ); + } + var t = d.toString(16); + return P(o, f), P(o, Ba), P(o, a.segmentPrefix), P(o, t), W(o, Yi); + } + var Xi = F(Vs + ';$RX("'), + Zi = F('$RX("'), + Ks = F('"'), + qs = F(")</script>"), + Ua = F(","); + function eu(o, a, f, d, t, r) { + if ( + (P(o, a.startInlineScript), + a.sentClientRenderFunction + ? P(o, Zi) + : ((a.sentClientRenderFunction = !0), P(o, Xi)), + f === null) + ) { + throw new Error( + "An ID must have been assigned before we can complete the boundary.", + ); + } + return ( + P(o, f), + P(o, Ks), + (d || t || r) && (P(o, Ua), P(o, ja(d || ""))), + (t || r) && (P(o, Ua), P(o, ja(t || ""))), + r && (P(o, Ua), P(o, ja(r))), + W(o, qs) + ); + } + var Qe = /[<\u2028\u2029]/g; + function ja(o) { + var a = JSON.stringify(o); + return a.replace(Qe, function (f) { + switch (f) { + case "<": + return "\\u003c"; + case "\u2028": + return "\\u2028"; + case "\u2029": + return "\\u2029"; + default: + throw new Error( + "escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React", + ); + } + }); + } + var ze = Object.assign, + Ji = Symbol.for("react.element"), + Ha = Symbol.for("react.portal"), + Wa = Symbol.for("react.fragment"), + Ro = Symbol.for("react.strict_mode"), + Io = Symbol.for("react.profiler"), + Fn = Symbol.for("react.provider"), + An = Symbol.for("react.context"), + Dn = Symbol.for("react.forward_ref"), + On = Symbol.for("react.suspense"), + $r = Symbol.for("react.suspense_list"), + za = Symbol.for("react.memo"), + _o = Symbol.for("react.lazy"), + tu = Symbol.for("react.scope"), + ru = Symbol.for("react.debug_trace_mode"), + Qi = Symbol.for("react.legacy_hidden"), + nu = Symbol.for("react.default_value"), + Ki = Symbol.iterator, + ou = "@@iterator"; + function qi(o) { + if (o === null || typeof o != "object") return null; + var a = (Ki && o[Ki]) || o[ou]; + return typeof a == "function" ? a : null; + } + function ie(o, a, f) { + var d = o.displayName; + if (d) return d; + var t = a.displayName || a.name || ""; + return t !== "" ? f + "(" + t + ")" : f; + } + function Nr(o) { + return o.displayName || "Context"; + } + function ne(o) { + if (o == null) return null; + if ( + (typeof o.tag == "number" && + c( + "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.", + ), + typeof o == "function") + ) { + return o.displayName || o.name || null; + } + if (typeof o == "string") return o; + switch (o) { + case Wa: + return "Fragment"; + case Ha: + return "Portal"; + case Io: + return "Profiler"; + case Ro: + return "StrictMode"; + case On: + return "Suspense"; + case $r: + return "SuspenseList"; + } + if (typeof o == "object") { + switch (o.$$typeof) { + case An: + var a = o; + return Nr(a) + ".Consumer"; + case Fn: + var f = o; + return Nr(f._context) + ".Provider"; + case Dn: + return ie(o, o.render, "ForwardRef"); + case za: + var d = o.displayName || null; + return d !== null ? d : ne(o.type) || "Memo"; + case _o: { + var t = o, + r = t._payload, + l = t._init; + try { + return ne(l(r)); + } catch { + return null; + } + } + } + } + return null; + } + var Vr = 0, + $a, + Na, + Va, + Ya, + Ga, + Xa, + el; + function tl() {} + tl.__reactDisabledLog = !0; + function Za() { + { + if (Vr === 0) { + ($a = console.log), + (Na = console.info), + (Va = console.warn), + (Ya = console.error), + (Ga = console.group), + (Xa = console.groupCollapsed), + (el = console.groupEnd); + var o = { + configurable: !0, + enumerable: !0, + value: tl, + writable: !0, + }; + Object.defineProperties(console, { + info: o, + log: o, + warn: o, + error: o, + group: o, + groupCollapsed: o, + groupEnd: o, + }); + } + Vr++; + } + } + function Ja() { + { + if ((Vr--, Vr === 0)) { + var o = { configurable: !0, enumerable: !0, writable: !0 }; + Object.defineProperties(console, { + log: ze({}, o, { value: $a }), + info: ze({}, o, { value: Na }), + warn: ze({}, o, { value: Va }), + error: ze({}, o, { value: Ya }), + group: ze({}, o, { value: Ga }), + groupCollapsed: ze({}, o, { value: Xa }), + groupEnd: ze({}, o, { value: el }), + }); + } + Vr < 0 && + c( + "disabledDepth fell below zero. This is a bug in React. Please file an issue.", + ); + } + } + var br = s.ReactCurrentDispatcher, + Mn; + function Nt(o, a, f) { + { + if (Mn === void 0) { + try { + throw Error(); + } catch (t) { + var d = t.stack.trim().match(/\n( *(at )?)/); + Mn = (d && d[1]) || ""; + } + } + return ( + ` +` + + Mn + + o + ); + } + } + var Qa = !1, + Yr; + { + var au = typeof WeakMap == "function" ? WeakMap : Map; + Yr = new au(); + } + function Po(o, a) { + if (!o || Qa) return ""; + { + var f = Yr.get(o); + if (f !== void 0) return f; + } + var d; + Qa = !0; + var t = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + var r; + (r = br.current), (br.current = null), Za(); + try { + if (a) { + var l = function () { + throw Error(); + }; + if ( + (Object.defineProperty(l.prototype, "props", { + set: function () { + throw Error(); + }, + }), + typeof Reflect == "object" && Reflect.construct) + ) { + try { + Reflect.construct(l, []); + } catch (O) { + d = O; + } + Reflect.construct(o, [], l); + } else { + try { + l.call(); + } catch (O) { + d = O; + } + o.call(l.prototype); + } + } else { + try { + throw Error(); + } catch (O) { + d = O; + } + o(); + } + } catch (O) { + if (O && d && typeof O.stack == "string") { + for ( + var u = O.stack.split(` +`), + p = d.stack.split(` +`), + g = u.length - 1, + y = p.length - 1; + g >= 1 && y >= 0 && u[g] !== p[y]; + ) { + y--; + } + for (; g >= 1 && y >= 0; g--, y--) { + if (u[g] !== p[y]) { + if (g !== 1 || y !== 1) { + do if ((g--, y--, y < 0 || u[g] !== p[y])) { + var w = ` +` + u[g].replace(" at new ", " at "); + return ( + o.displayName && + w.includes("<anonymous>") && + (w = w.replace("<anonymous>", o.displayName)), + typeof o == "function" && Yr.set(o, w), + w + ); + } while (g >= 1 && y >= 0); + } + break; + } + } + } + } finally { + (Qa = !1), (br.current = r), Ja(), (Error.prepareStackTrace = t); + } + var C = o ? o.displayName || o.name : "", + _ = C ? Nt(C) : ""; + return typeof o == "function" && Yr.set(o, _), _; + } + function iu(o, a, f) { + return Po(o, !0); + } + function Fo(o, a, f) { + return Po(o, !1); + } + function rl(o) { + var a = o.prototype; + return !!(a && a.isReactComponent); + } + function Ao(o, a, f) { + if (o == null) return ""; + if (typeof o == "function") return Po(o, rl(o)); + if (typeof o == "string") return Nt(o); + switch (o) { + case On: + return Nt("Suspense"); + case $r: + return Nt("SuspenseList"); + } + if (typeof o == "object") { + switch (o.$$typeof) { + case Dn: + return Fo(o.render); + case za: + return Ao(o.type, a, f); + case _o: { + var d = o, + t = d._payload, + r = d._init; + try { + return Ao(r(t), a, f); + } catch {} + } + } + } + return ""; + } + var Ln = {}, + Ka = s.ReactDebugCurrentFrame; + function Gr(o) { + if (o) { + var a = o._owner, + f = Ao(o.type, o._source, a ? a.type : null); + Ka.setExtraStackFrame(f); + } else Ka.setExtraStackFrame(null); + } + function Bn(o, a, f, d, t) { + { + var r = Function.call.bind(B); + for (var l in o) { + if (r(o, l)) { + var u = void 0; + try { + if (typeof o[l] != "function") { + var p = Error( + (d || "React class") + + ": " + + f + + " type `" + + l + + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + + typeof o[l] + + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.", + ); + throw ((p.name = "Invariant Violation"), p); + } + u = o[l]( + a, + l, + d, + f, + null, + "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED", + ); + } catch (g) { + u = g; + } + u && + !(u instanceof Error) && + (Gr(t), + c( + "%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", + d || "React class", + f, + l, + typeof u, + ), + Gr(null)), + u instanceof Error && + !(u.message in Ln) && + ((Ln[u.message] = !0), + Gr(t), + c("Failed %s type: %s", f, u.message), + Gr(null)); + } + } + } + } + var Do; + Do = {}; + var Oo = {}; + Object.freeze(Oo); + function Xr(o, a) { + { + var f = o.contextTypes; + if (!f) return Oo; + var d = {}; + for (var t in f) d[t] = a[t]; + { + var r = ne(o) || "Unknown"; + Bn(f, d, "context", r); + } + return d; + } + } + function lu(o, a, f, d) { + { + if (typeof o.getChildContext != "function") { + { + var t = ne(a) || "Unknown"; + Do[t] || + ((Do[t] = !0), + c( + "%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.", + t, + t, + )); + } + return f; + } + var r = o.getChildContext(); + for (var l in r) { + if (!(l in d)) { + throw new Error( + (ne(a) || "Unknown") + + '.getChildContext(): key "' + + l + + '" is not defined in childContextTypes.', + ); + } + } + { + var u = ne(a) || "Unknown"; + Bn(d, r, "child context", u); + } + return ze({}, f, r); + } + } + var nt; + nt = {}; + var qa = null, + Ft = null; + function Zr(o) { + o.context._currentValue = o.parentValue; + } + function Mo(o) { + o.context._currentValue = o.value; + } + function Un(o, a) { + if (o !== a) { + Zr(o); + var f = o.parent, + d = a.parent; + if (f === null) { + if (d !== null) { + throw new Error( + "The stacks must reach the root at the same time. This is a bug in React.", + ); + } + } else { + if (d === null) { + throw new Error( + "The stacks must reach the root at the same time. This is a bug in React.", + ); + } + Un(f, d); + } + Mo(a); + } + } + function ei(o) { + Zr(o); + var a = o.parent; + a !== null && ei(a); + } + function ti(o) { + var a = o.parent; + a !== null && ti(a), Mo(o); + } + function jn(o, a) { + Zr(o); + var f = o.parent; + if (f === null) { + throw new Error( + "The depth must equal at least at zero before reaching the root. This is a bug in React.", + ); + } + f.depth === a.depth ? Un(f, a) : jn(f, a); + } + function nl(o, a) { + var f = a.parent; + if (f === null) { + throw new Error( + "The depth must equal at least at zero before reaching the root. This is a bug in React.", + ); + } + o.depth === f.depth ? Un(o, f) : nl(o, f), Mo(a); + } + function Lo(o) { + var a = Ft, + f = o; + a !== f && + (a === null + ? ti(f) + : f === null + ? ei(a) + : a.depth === f.depth + ? Un(a, f) + : a.depth > f.depth + ? jn(a, f) + : nl(a, f), + (Ft = f)); + } + function su(o, a) { + var f; + (f = o._currentValue), + (o._currentValue = a), + o._currentRenderer !== void 0 && + o._currentRenderer !== null && + o._currentRenderer !== nt && + c( + "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.", + ), + (o._currentRenderer = nt); + var d = Ft, + t = { + parent: d, + depth: d === null ? 0 : d.depth + 1, + context: o, + parentValue: f, + value: a, + }; + return (Ft = t), t; + } + function Hn(o) { + var a = Ft; + if (a === null) { + throw new Error( + "Tried to pop a Context at the root of the app. This is a bug in React.", + ); + } + a.context !== o && + c( + "The parent context is not the expected context. This is probably a bug in React.", + ); + { + var f = a.parentValue; + f === nu + ? (a.context._currentValue = a.context._defaultValue) + : (a.context._currentValue = f), + o._currentRenderer !== void 0 && + o._currentRenderer !== null && + o._currentRenderer !== nt && + c( + "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported.", + ), + (o._currentRenderer = nt); + } + return (Ft = a.parent); + } + function ri() { + return Ft; + } + function Wn(o) { + var a = o._currentValue; + return a; + } + function Bo(o) { + return o._reactInternals; + } + function ol(o, a) { + o._reactInternals = a; + } + var Uo = {}, + jo = {}, + zn, + $n, + Ho, + Jr, + Wo, + Qr, + Nn, + zo, + $o; + { + (zn = new Set()), + ($n = new Set()), + (Ho = new Set()), + (Nn = new Set()), + (Jr = new Set()), + (zo = new Set()), + ($o = new Set()); + var ni = new Set(); + (Qr = function (o, a) { + if (!(o === null || typeof o == "function")) { + var f = a + "_" + o; + ni.has(f) || + (ni.add(f), + c( + "%s(...): Expected the last optional `callback` argument to be a function. Instead received: %s.", + a, + o, + )); + } + }), + (Wo = function (o, a) { + if (a === void 0) { + var f = ne(o) || "Component"; + Jr.has(f) || + (Jr.add(f), + c( + "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", + f, + )); + } + }); + } + function al(o, a) { + { + var f = o.constructor, + d = (f && ne(f)) || "ReactClass", + t = d + "." + a; + if (Uo[t]) return; + c( + `%s(...): Can only update a mounting component. This usually means you called %s() outside componentWillMount() on the server. This is a no-op. + +Please check the code for the %s component.`, + a, + a, + d, + ), (Uo[t] = !0); + } + } + var il = { + isMounted: function (o) { + return !1; + }, + enqueueSetState: function (o, a, f) { + var d = Bo(o); + d.queue === null + ? al(o, "setState") + : (d.queue.push(a), f != null && Qr(f, "setState")); + }, + enqueueReplaceState: function (o, a, f) { + var d = Bo(o); + (d.replace = !0), (d.queue = [a]), f != null && Qr(f, "setState"); + }, + enqueueForceUpdate: function (o, a) { + var f = Bo(o); + f.queue === null + ? al(o, "forceUpdate") + : a != null && Qr(a, "setState"); + }, + }; + function uu(o, a, f, d, t) { + var r = f(t, d); + Wo(a, r); + var l = r == null ? d : ze({}, d, r); + return l; + } + function cu(o, a, f) { + var d = Oo, + t = o.contextType; + if ("contextType" in o) { + var r = t === null || + (t !== void 0 && t.$$typeof === An && t._context === void 0); + if (!r && !$o.has(o)) { + $o.add(o); + var l = ""; + t === void 0 + ? (l = + " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.") + : typeof t != "object" + ? (l = " However, it is set to a " + typeof t + ".") + : t.$$typeof === Fn + ? (l = " Did you accidentally pass the Context.Provider instead?") + : t._context !== void 0 + ? (l = " Did you accidentally pass the Context.Consumer instead?") + : (l = " However, it is set to an object with keys {" + + Object.keys(t).join(", ") + + "}."), + c( + "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", + ne(o) || "Component", + l, + ); + } + } + typeof t == "object" && t !== null ? (d = Wn(t)) : (d = f); + var u = new o(a, d); + { + if ( + typeof o.getDerivedStateFromProps == "function" && + (u.state === null || u.state === void 0) + ) { + var p = ne(o) || "Component"; + zn.has(p) || + (zn.add(p), + c( + "`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", + p, + u.state === null ? "null" : "undefined", + p, + )); + } + if ( + typeof o.getDerivedStateFromProps == "function" || + typeof u.getSnapshotBeforeUpdate == "function" + ) { + var g = null, + y = null, + w = null; + if ( + (typeof u.componentWillMount == "function" && + u.componentWillMount.__suppressDeprecationWarning !== !0 + ? (g = "componentWillMount") + : typeof u.UNSAFE_componentWillMount == "function" && + (g = "UNSAFE_componentWillMount"), + typeof u.componentWillReceiveProps == "function" && + u.componentWillReceiveProps.__suppressDeprecationWarning !== + !0 + ? (y = "componentWillReceiveProps") + : typeof u.UNSAFE_componentWillReceiveProps == "function" && + (y = "UNSAFE_componentWillReceiveProps"), + typeof u.componentWillUpdate == "function" && + u.componentWillUpdate.__suppressDeprecationWarning !== !0 + ? (w = "componentWillUpdate") + : typeof u.UNSAFE_componentWillUpdate == "function" && + (w = "UNSAFE_componentWillUpdate"), + g !== null || y !== null || w !== null) + ) { + var C = ne(o) || "Component", + _ = typeof o.getDerivedStateFromProps == "function" + ? "getDerivedStateFromProps()" + : "getSnapshotBeforeUpdate()"; + Ho.has(C) || + (Ho.add(C), + c( + `Unsafe legacy lifecycles will not be called for components using new component APIs. + +%s uses %s but also contains the following legacy lifecycles:%s%s%s + +The above lifecycles should be removed. Learn more about this warning here: +https://reactjs.org/link/unsafe-component-lifecycles`, + C, + _, + g !== null + ? ` + ` + g + : "", + y !== null + ? ` + ` + y + : "", + w !== null + ? ` + ` + w + : "", + )); + } + } + } + return u; + } + function fu(o, a, f) { + { + var d = ne(a) || "Component", + t = o.render; + t || + (a.prototype && typeof a.prototype.render == "function" + ? c( + "%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?", + d, + ) + : c( + "%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.", + d, + )), + o.getInitialState && + !o.getInitialState.isReactClassApproved && + !o.state && + c( + "getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", + d, + ), + o.getDefaultProps && + !o.getDefaultProps.isReactClassApproved && + c( + "getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", + d, + ), + o.propTypes && + c( + "propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", + d, + ), + o.contextType && + c( + "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", + d, + ), + o.contextTypes && + c( + "contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", + d, + ), + a.contextType && + a.contextTypes && + !zo.has(a) && + (zo.add(a), + c( + "%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", + d, + )), + typeof o.componentShouldUpdate == "function" && + c( + "%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", + d, + ), + a.prototype && + a.prototype.isPureReactComponent && + typeof o.shouldComponentUpdate < "u" && + c( + "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", + ne(a) || "A pure component", + ), + typeof o.componentDidUnmount == "function" && + c( + "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", + d, + ), + typeof o.componentDidReceiveProps == "function" && + c( + "%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", + d, + ), + typeof o.componentWillRecieveProps == "function" && + c( + "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", + d, + ), + typeof o.UNSAFE_componentWillRecieveProps == "function" && + c( + "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", + d, + ); + var r = o.props !== f; + o.props !== void 0 && + r && + c( + "%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", + d, + d, + ), + o.defaultProps && + c( + "Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", + d, + d, + ), + typeof o.getSnapshotBeforeUpdate == "function" && + typeof o.componentDidUpdate != "function" && + !$n.has(a) && + ($n.add(a), + c( + "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", + ne(a), + )), + typeof o.getDerivedStateFromProps == "function" && + c( + "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + d, + ), + typeof o.getDerivedStateFromError == "function" && + c( + "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + d, + ), + typeof a.getSnapshotBeforeUpdate == "function" && + c( + "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", + d, + ); + var l = o.state; + l && + (typeof l != "object" || cr(l)) && + c("%s.state: must be set to an object or null", d), + typeof o.getChildContext == "function" && + typeof a.childContextTypes != "object" && + c( + "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", + d, + ); + } + } + function ll(o, a) { + var f = a.state; + if (typeof a.componentWillMount == "function") { + if (a.componentWillMount.__suppressDeprecationWarning !== !0) { + var d = ne(o) || "Unknown"; + jo[d] || + (v( + `componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details. + +* Move code from componentWillMount to componentDidMount (preferred in most cases) or the constructor. + +Please update the following components: %s`, + d, + ), + (jo[d] = !0)); + } + a.componentWillMount(); + } + typeof a.UNSAFE_componentWillMount == "function" && + a.UNSAFE_componentWillMount(), + f !== a.state && + (c( + "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + ne(o) || "Component", + ), + il.enqueueReplaceState(a, a.state, null)); + } + function du(o, a, f, d) { + if (o.queue !== null && o.queue.length > 0) { + var t = o.queue, + r = o.replace; + if (((o.queue = null), (o.replace = !1), r && t.length === 1)) { + a.state = t[0]; + } else { + for ( + var l = r ? t[0] : a.state, u = !0, p = r ? 1 : 0; + p < t.length; + p++ + ) { + var g = t[p], + y = typeof g == "function" ? g.call(a, l, f, d) : g; + y != null && (u ? ((u = !1), (l = ze({}, l, y))) : ze(l, y)); + } + a.state = l; + } + } else o.queue = null; + } + function sl(o, a, f, d) { + fu(o, a, f); + var t = o.state !== void 0 ? o.state : null; + (o.updater = il), (o.props = f), (o.state = t); + var r = { queue: [], replace: !1 }; + ol(o, r); + var l = a.contextType; + if ( + (typeof l == "object" && l !== null + ? (o.context = Wn(l)) + : (o.context = d), + o.state === f) + ) { + var u = ne(a) || "Component"; + Nn.has(u) || + (Nn.add(u), + c( + "%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", + u, + )); + } + var p = a.getDerivedStateFromProps; + typeof p == "function" && (o.state = uu(o, a, p, t, f)), + typeof a.getDerivedStateFromProps != "function" && + typeof o.getSnapshotBeforeUpdate != "function" && + (typeof o.UNSAFE_componentWillMount == "function" || + typeof o.componentWillMount == "function") && + (ll(a, o), du(r, o, f, d)); + } + var oi = { id: 1, overflow: "" }; + function No(o) { + var a = o.overflow, + f = o.id, + d = f & ~pu(f); + return d.toString(32) + a; + } + function ai(o, a, f) { + var d = o.id, + t = o.overflow, + r = Vo(d) - 1, + l = d & ~(1 << r), + u = f + 1, + p = Vo(a) + r; + if (p > 30) { + var g = r - (r % 5), + y = (1 << g) - 1, + w = (l & y).toString(32), + C = l >> g, + _ = r - g, + O = Vo(a) + _, + j = u << _, + Z = j | C, + de = w + t; + return { id: (1 << O) | Z, overflow: de }; + } else { + var we = u << r, + aa = we | l, + ia = t; + return { id: (1 << p) | aa, overflow: ia }; + } + } + function Vo(o) { + return 32 - hu(o); + } + function pu(o) { + return 1 << (Vo(o) - 1); + } + var hu = Math.clz32 ? Math.clz32 : mu, + vu = Math.log, + gu = Math.LN2; + function mu(o) { + var a = o >>> 0; + return a === 0 ? 32 : (31 - ((vu(a) / gu) | 0)) | 0; + } + function At(o, a) { + return ( + (o === a && (o !== 0 || 1 / o === 1 / a)) || (o !== o && a !== a) + ); + } + var ii = typeof Object.is == "function" ? Object.is : At, + Ke = null, + X = null, + Vt = null, + G = null, + Yt = !1, + ot = !1, + Sr = 0, + Gt = null, + $e = 0, + Kr = 25, + Ie = !1, + qr; + function Xt() { + if (Ke === null) { + throw new Error( + `Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: +1. You might have mismatching versions of React and the renderer (such as React DOM) +2. You might be breaking the Rules of Hooks +3. You might have more than one copy of React in the same app +See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`, + ); + } + return ( + Ie && + c( + "Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks", + ), Ke + ); + } + function li(o, a) { + if (a === null) { + return ( + c( + "%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", + qr, + ), !1 + ); + } + o.length !== a.length && + c( + `The final argument passed to %s changed size between renders. The order and size of this array must remain constant. + +Previous: %s +Incoming: %s`, + qr, + "[" + o.join(", ") + "]", + "[" + a.join(", ") + "]", + ); + for (var f = 0; f < a.length && f < o.length; f++) { + if (!ii(o[f], a[f])) return !1; + } + return !0; + } + function ul() { + if ($e > 0) { + throw new Error( + "Rendered more hooks than during the previous render", + ); + } + return { memoizedState: null, queue: null, next: null }; + } + function si() { + return ( + G === null + ? Vt === null ? ((Yt = !1), (Vt = G = ul())) : ((Yt = !0), (G = Vt)) + : G.next === null + ? ((Yt = !1), (G = G.next = ul())) + : ((Yt = !0), (G = G.next)), G + ); + } + function cl(o, a) { + (Ke = a), (X = o), (Ie = !1), (Sr = 0); + } + function ui(o, a, f, d) { + for (; ot;) (ot = !1), (Sr = 0), ($e += 1), (G = null), (f = o(a, d)); + return ci(), f; + } + function fl() { + var o = Sr !== 0; + return o; + } + function ci() { + (Ie = !1), + (Ke = null), + (X = null), + (ot = !1), + (Vt = null), + ($e = 0), + (Gt = null), + (G = null); + } + function fi(o) { + return ( + Ie && + c( + "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().", + ), Wn(o) + ); + } + function yu(o) { + return (qr = "useContext"), Xt(), Wn(o); + } + function Yo(o, a) { + return typeof a == "function" ? a(o) : a; + } + function dl(o) { + return (qr = "useState"), pl(Yo, o); + } + function pl(o, a, f) { + if ((o !== Yo && (qr = "useReducer"), (Ke = Xt()), (G = si()), Yt)) { + var d = G.queue, + t = d.dispatch; + if (Gt !== null) { + var r = Gt.get(d); + if (r !== void 0) { + Gt.delete(d); + var l = G.memoizedState, + u = r; + do { + var p = u.action; + (Ie = !0), (l = o(l, p)), (Ie = !1), (u = u.next); + } while (u !== null); + return (G.memoizedState = l), [l, t]; + } + } + return [G.memoizedState, t]; + } else { + Ie = !0; + var g; + o === Yo + ? (g = typeof a == "function" ? a() : a) + : (g = f !== void 0 ? f(a) : a), + (Ie = !1), + (G.memoizedState = g); + var y = (G.queue = { last: null, dispatch: null }), + w = (y.dispatch = wu.bind(null, Ke, y)); + return [G.memoizedState, w]; + } + } + function hl(o, a) { + (Ke = Xt()), (G = si()); + var f = a === void 0 ? null : a; + if (G !== null) { + var d = G.memoizedState; + if (d !== null && f !== null) { + var t = d[1]; + if (li(f, t)) return d[0]; + } + } + Ie = !0; + var r = o(); + return (Ie = !1), (G.memoizedState = [r, f]), r; + } + function bu(o) { + (Ke = Xt()), (G = si()); + var a = G.memoizedState; + if (a === null) { + var f = { current: o }; + return Object.seal(f), (G.memoizedState = f), f; + } else return a; + } + function Su(o, a) { + (qr = "useLayoutEffect"), + c( + "useLayoutEffect does nothing on the server, because its effect cannot be encoded into the server renderer's output format. This will lead to a mismatch between the initial, non-hydrated UI and the intended UI. To avoid this, useLayoutEffect should only be used in components that render exclusively on the client. See https://reactjs.org/link/uselayouteffect-ssr for common fixes.", + ); + } + function wu(o, a, f) { + if ($e >= Kr) { + throw new Error( + "Too many re-renders. React limits the number of renders to prevent an infinite loop.", + ); + } + if (o === Ke) { + ot = !0; + var d = { action: f, next: null }; + Gt === null && (Gt = new Map()); + var t = Gt.get(a); + if (t === void 0) Gt.set(a, d); + else { + for (var r = t; r.next !== null;) r = r.next; + r.next = d; + } + } + } + function xu(o, a) { + return hl(function () { + return o; + }, a); + } + function ku(o, a, f) { + return Xt(), a(o._source); + } + function Tu(o, a, f) { + if (f === void 0) { + throw new Error( + "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.", + ); + } + return f(); + } + function Cu(o) { + return Xt(), o; + } + function Eu() { + throw new Error( + "startTransition cannot be called during server rendering.", + ); + } + function Go() { + return Xt(), [!1, Eu]; + } + function vl() { + var o = X, + a = No(o.treeContext), + f = pi; + if (f === null) { + throw new Error( + "Invalid hook call. Hooks can only be called inside of the body of a function component.", + ); + } + var d = Sr++; + return wo(f, a, d); + } + function en() {} + var di = { + readContext: fi, + useContext: yu, + useMemo: hl, + useReducer: pl, + useRef: bu, + useState: dl, + useInsertionEffect: en, + useLayoutEffect: Su, + useCallback: xu, + useImperativeHandle: en, + useEffect: en, + useDebugValue: en, + useDeferredValue: Cu, + useTransition: Go, + useId: vl, + useMutableSource: ku, + useSyncExternalStore: Tu, + }, + pi = null; + function Xo(o) { + pi = o; + } + function hi(o) { + try { + var a = "", + f = o; + do { + switch (f.tag) { + case 0: + a += Nt(f.type, null, null); + break; + case 1: + a += Fo(f.type, null, null); + break; + case 2: + a += iu(f.type, null, null); + break; + } + f = f.parent; + } while (f); + return a; + } catch (d) { + return ( + ` +Error generating stack: ` + + d.message + + ` +` + + d.stack + ); + } + } + var Vn = s.ReactCurrentDispatcher, + Zt = s.ReactDebugCurrentFrame, + Zo = 0, + wr = 1, + vi = 2, + gl = 3, + gi = 4, + tn = 0, + ml = 1, + rn = 2, + Yn = 12800; + function yl(o) { + return console.error(o), null; + } + function Gn() {} + function Ru(o, a, f, d, t, r, l, u, p) { + var g = [], + y = new Set(), + w = { + destination: null, + responseState: a, + progressiveChunkSize: d === void 0 ? Yn : d, + status: tn, + fatalError: null, + nextSegmentId: 0, + allPendingTasks: 0, + pendingRootTasks: 0, + completedRootSegment: null, + abortableTasks: y, + pingedTasks: g, + clientRenderedBoundaries: [], + completedBoundaries: [], + partialBoundaries: [], + onError: t === void 0 ? yl : t, + onAllReady: r === void 0 ? Gn : r, + onShellReady: l === void 0 ? Gn : l, + onShellError: u === void 0 ? Gn : u, + onFatalError: p === void 0 ? Gn : p, + }, + C = nn(w, 0, null, f, !1, !1); + C.parentFlushed = !0; + var _ = at(w, o, null, C, y, Oo, qa, oi); + return g.push(_), w; + } + function mi(o, a) { + var f = o.pingedTasks; + f.push(a), + f.length === 1 && + S(function () { + return Kn(o); + }); + } + function Jo(o, a) { + return { + id: Lr, + rootSegmentID: -1, + parentFlushed: !1, + pendingTasks: 0, + forceClientRender: !1, + completedSegments: [], + byteSize: 0, + fallbackAbortableTasks: a, + errorDigest: null, + }; + } + function at(o, a, f, d, t, r, l, u) { + o.allPendingTasks++, + f === null ? o.pendingRootTasks++ : f.pendingTasks++; + var p = { + node: a, + ping: function () { + return mi(o, p); + }, + blockedBoundary: f, + blockedSegment: d, + abortSet: t, + legacyContext: r, + context: l, + treeContext: u, + }; + return (p.componentStack = null), t.add(p), p; + } + function nn(o, a, f, d, t, r) { + return { + status: Zo, + id: -1, + index: a, + parentFlushed: !1, + chunks: [], + children: [], + formatContext: d, + boundary: f, + lastPushedText: t, + textEmbedded: r, + }; + } + var Ne = null; + function Qo() { + return Ne === null || Ne.componentStack === null + ? "" + : hi(Ne.componentStack); + } + function Xn(o, a) { + o.componentStack = { tag: 0, parent: o.componentStack, type: a }; + } + function Dt(o, a) { + o.componentStack = { tag: 1, parent: o.componentStack, type: a }; + } + function Zn(o, a) { + o.componentStack = { tag: 2, parent: o.componentStack, type: a }; + } + function mt(o) { + o.componentStack === null + ? c( + "Unexpectedly popped too many stack frames. This is a bug in React.", + ) + : (o.componentStack = o.componentStack.parent); + } + var Ot = null; + function on(o, a) { + { + var f; + typeof a == "string" + ? (f = a) + : a && typeof a.message == "string" + ? (f = a.message) + : (f = String(a)); + var d = Ot || Qo(); + (Ot = null), (o.errorMessage = f), (o.errorComponentStack = d); + } + } + function Jn(o, a) { + var f = o.onError(a); + if (f != null && typeof f != "string") { + throw new Error( + 'onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "' + + typeof f + + '" instead', + ); + } + return f; + } + function Ko(o, a) { + var f = o.onShellError; + f(a); + var d = o.onFatalError; + d(a), + o.destination !== null + ? ((o.status = rn), ct(o.destination, a)) + : ((o.status = ml), (o.fatalError = a)); + } + function Iu(o, a, f) { + Xn(a, "Suspense"); + var d = a.blockedBoundary, + t = a.blockedSegment, + r = f.fallback, + l = f.children, + u = new Set(), + p = Jo(o, u), + g = t.chunks.length, + y = nn(o, g, p, t.formatContext, !1, !1); + t.children.push(y), (t.lastPushedText = !1); + var w = nn(o, 0, null, t.formatContext, !1, !1); + (w.parentFlushed = !0), (a.blockedBoundary = p), (a.blockedSegment = w); + try { + if ( + (Ci(o, a, l), + $t(w.chunks, o.responseState, w.lastPushedText, w.textEmbedded), + (w.status = wr), + ra(p, w), + p.pendingTasks === 0) + ) { + mt(a); + return; + } + } catch (_) { + (w.status = gi), + (p.forceClientRender = !0), + (p.errorDigest = Jn(o, _)), + on(p, _); + } finally { + (a.blockedBoundary = d), (a.blockedSegment = t); + } + var C = at(o, r, d, y, u, a.legacyContext, a.context, a.treeContext); + (C.componentStack = a.componentStack), o.pingedTasks.push(C), mt(a); + } + function bl(o, a, f, d) { + Xn(a, f); + var t = a.blockedSegment, + r = U(t.chunks, f, d, o.responseState, t.formatContext); + t.lastPushedText = !1; + var l = t.formatContext; + (t.formatContext = Mr(l, f, d)), + Ci(o, a, r), + (t.formatContext = l), + z(t.chunks, f), + (t.lastPushedText = !1), + mt(a); + } + function Sl(o) { + return o.prototype && o.prototype.isReactComponent; + } + function wl(o, a, f, d, t) { + var r = {}; + cl(a, r); + var l = f(d, t); + return ui(f, d, l, t); + } + function yi(o, a, f, d, t) { + var r = f.render(); + f.props !== t && + (xi || + c( + "It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", + ne(d) || "a component", + ), + (xi = !0)); + { + var l = d.childContextTypes; + if (l != null) { + var u = a.legacyContext, + p = lu(f, d, u, l); + (a.legacyContext = p), Ue(o, a, r), (a.legacyContext = u); + return; + } + } + Ue(o, a, r); + } + function qo(o, a, f, d) { + Zn(a, f); + var t = Xr(f, a.legacyContext), + r = cu(f, d, t); + sl(r, f, d, t), yi(o, a, r, f, d), mt(a); + } + var bi = {}, + Qn = {}, + Si = {}, + wi = {}, + xi = !1, + ki = !1, + xl = !1, + kl = !1; + function Tl(o, a, f, d) { + var t; + if ( + ((t = Xr(f, a.legacyContext)), + Dt(a, f), + f.prototype && typeof f.prototype.render == "function") + ) { + var r = ne(f) || "Unknown"; + bi[r] || + (c( + "The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", + r, + r, + ), + (bi[r] = !0)); + } + var l = wl(o, a, f, d, t), + u = fl(); + if ( + typeof l == "object" && + l !== null && + typeof l.render == "function" && + l.$$typeof === void 0 + ) { + var p = ne(f) || "Unknown"; + Qn[p] || + (c( + "The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", + p, + p, + p, + ), + (Qn[p] = !0)); + } + if ( + typeof l == "object" && + l !== null && + typeof l.render == "function" && + l.$$typeof === void 0 + ) { + { + var g = ne(f) || "Unknown"; + Qn[g] || + (c( + "The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", + g, + g, + g, + ), + (Qn[g] = !0)); + } + sl(l, f, d, t), yi(o, a, l, f, d); + } else if ((_u(f), u)) { + var y = a.treeContext, + w = 1, + C = 0; + a.treeContext = ai(y, w, C); + try { + Ue(o, a, l); + } finally { + a.treeContext = y; + } + } else Ue(o, a, l); + mt(a); + } + function _u(o) { + { + if ( + (o && + o.childContextTypes && + c( + "%s(...): childContextTypes cannot be defined on a function component.", + o.displayName || o.name || "Component", + ), + typeof o.getDerivedStateFromProps == "function") + ) { + var a = ne(o) || "Unknown"; + wi[a] || + (c( + "%s: Function components do not support getDerivedStateFromProps.", + a, + ), + (wi[a] = !0)); + } + if (typeof o.contextType == "object" && o.contextType !== null) { + var f = ne(o) || "Unknown"; + Si[f] || + (c("%s: Function components do not support contextType.", f), + (Si[f] = !0)); + } + } + } + function Cl(o, a) { + if (o && o.defaultProps) { + var f = ze({}, a), + d = o.defaultProps; + for (var t in d) f[t] === void 0 && (f[t] = d[t]); + return f; + } + return a; + } + function Pu(o, a, f, d, t) { + Dt(a, f.render); + var r = wl(o, a, f.render, d, t), + l = fl(); + if (l) { + var u = a.treeContext, + p = 1, + g = 0; + a.treeContext = ai(u, p, g); + try { + Ue(o, a, r); + } finally { + a.treeContext = u; + } + } else Ue(o, a, r); + mt(a); + } + function Fu(o, a, f, d, t) { + var r = f.type, + l = Cl(r, d); + Pe(o, a, r, l, t); + } + function Au(o, a, f, d) { + f._context === void 0 + ? f !== f.Consumer && + (kl || + ((kl = !0), + c( + "Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?", + ))) + : (f = f._context); + var t = d.children; + typeof t != "function" && + c( + "A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it.", + ); + var r = Wn(f), + l = t(r); + Ue(o, a, l); + } + function Ti(o, a, f, d) { + var t = f._context, + r = d.value, + l = d.children, + u; + (u = a.context), + (a.context = su(t, r)), + Ue(o, a, l), + (a.context = Hn(t)), + u !== a.context && + c( + "Popping the context provider did not return back to the original snapshot. This is a bug in React.", + ); + } + function Du(o, a, f, d, t) { + Xn(a, "Lazy"); + var r = f._payload, + l = f._init, + u = l(r), + p = Cl(u, d); + Pe(o, a, u, p, t), mt(a); + } + function Pe(o, a, f, d, t) { + if (typeof f == "function") { + if (Sl(f)) { + qo(o, a, f, d); + return; + } else { + Tl(o, a, f, d); + return; + } + } + if (typeof f == "string") { + bl(o, a, f, d); + return; + } + switch (f) { + case Qi: + case ru: + case Ro: + case Io: + case Wa: { + Ue(o, a, d.children); + return; + } + case $r: { + Xn(a, "SuspenseList"), Ue(o, a, d.children), mt(a); + return; + } + case tu: + throw new Error( + "ReactDOMServer does not yet support scope components.", + ); + case On: { + Iu(o, a, d); + return; + } + } + if (typeof f == "object" && f !== null) { + switch (f.$$typeof) { + case Dn: { + Pu(o, a, f, d, t); + return; + } + case za: { + Fu(o, a, f, d, t); + return; + } + case Fn: { + Ti(o, a, f, d); + return; + } + case An: { + Au(o, a, f, d); + return; + } + case _o: { + Du(o, a, f, d); + return; + } + } + } + var r = ""; + throw ( + ((f === void 0 || + (typeof f == "object" && + f !== null && + Object.keys(f).length === 0)) && + (r += + " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), + new Error( + "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) " + + ("but got: " + (f == null ? f : typeof f) + "." + r), + )) + ); + } + function Ou(o, a) { + typeof Symbol == "function" && + o[Symbol.toStringTag] === "Generator" && + (ki || + c( + "Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers.", + ), + (ki = !0)), + o.entries === a && + (xl || + c( + "Using Maps as children is not supported. Use an array of keyed ReactElements instead.", + ), + (xl = !0)); + } + function Ue(o, a, f) { + try { + return Mu(o, a, f); + } catch (d) { + throw ( + ((typeof d == "object" && + d !== null && + typeof d.then == "function") || + (Ot = Ot !== null ? Ot : Qo()), + d) + ); + } + } + function Mu(o, a, f) { + if (((a.node = f), typeof f == "object" && f !== null)) { + switch (f.$$typeof) { + case Ji: { + var d = f, + t = d.type, + r = d.props, + l = d.ref; + Pe(o, a, t, r, l); + return; + } + case Ha: + throw new Error( + "Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render.", + ); + case _o: { + var u = f, + p = u._payload, + g = u._init, + y; + try { + y = g(p); + } catch (we) { + throw ( + (typeof we == "object" && + we !== null && + typeof we.then == "function" && + Xn(a, "Lazy"), + we) + ); + } + Ue(o, a, y); + return; + } + } + if (cr(f)) { + ea(o, a, f); + return; + } + var w = qi(f); + if (w) { + Ou(f, w); + var C = w.call(f); + if (C) { + var _ = C.next(); + if (!_.done) { + var O = []; + do O.push(_.value), (_ = C.next()); while (!_.done); + ea(o, a, O); + return; + } + return; + } + } + var j = Object.prototype.toString.call(f); + throw new Error( + "Objects are not valid as a React child (found: " + + (j === "[object Object]" + ? "object with keys {" + Object.keys(f).join(", ") + "}" + : j) + + "). If you meant to render a collection of children, use an array instead.", + ); + } + if (typeof f == "string") { + var Z = a.blockedSegment; + Z.lastPushedText = ht( + a.blockedSegment.chunks, + f, + o.responseState, + Z.lastPushedText, + ); + return; + } + if (typeof f == "number") { + var de = a.blockedSegment; + de.lastPushedText = ht( + a.blockedSegment.chunks, + "" + f, + o.responseState, + de.lastPushedText, + ); + return; + } + typeof f == "function" && + c( + "Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.", + ); + } + function ea(o, a, f) { + for (var d = f.length, t = 0; t < d; t++) { + var r = a.treeContext; + a.treeContext = ai(r, d, t); + try { + Ci(o, a, f[t]); + } finally { + a.treeContext = r; + } + } + } + function Lu(o, a, f) { + var d = a.blockedSegment, + t = d.chunks.length, + r = nn(o, t, null, d.formatContext, d.lastPushedText, !0); + d.children.push(r), (d.lastPushedText = !1); + var l = at( + o, + a.node, + a.blockedBoundary, + r, + a.abortSet, + a.legacyContext, + a.context, + a.treeContext, + ); + a.componentStack !== null && + (l.componentStack = a.componentStack.parent); + var u = l.ping; + f.then(u, u); + } + function Ci(o, a, f) { + var d = a.blockedSegment.formatContext, + t = a.legacyContext, + r = a.context, + l = null; + l = a.componentStack; + try { + return Ue(o, a, f); + } catch (u) { + if ( + (ci(), + typeof u == "object" && u !== null && typeof u.then == "function") + ) { + Lu(o, a, u), + (a.blockedSegment.formatContext = d), + (a.legacyContext = t), + (a.context = r), + Lo(r), + (a.componentStack = l); + return; + } else { + throw ( + ((a.blockedSegment.formatContext = d), + (a.legacyContext = t), + (a.context = r), + Lo(r), + (a.componentStack = l), + u) + ); + } + } + } + function El(o, a, f, d) { + var t = Jn(o, d); + if ( + (a === null ? Ko(o, d) : (a.pendingTasks--, + a.forceClientRender || + ((a.forceClientRender = !0), + (a.errorDigest = t), + on(a, d), + a.parentFlushed && o.clientRenderedBoundaries.push(a))), + o.allPendingTasks--, + o.allPendingTasks === 0) + ) { + var r = o.onAllReady; + r(); + } + } + function ta(o) { + var a = this, + f = o.blockedBoundary, + d = o.blockedSegment; + (d.status = gl), Ri(a, f, d); + } + function Ei(o, a, f) { + var d = o.blockedBoundary, + t = o.blockedSegment; + if (((t.status = gl), d === null)) { + a.allPendingTasks--, + a.status !== rn && + ((a.status = rn), a.destination !== null && xe(a.destination)); + } else { + if ((d.pendingTasks--, !d.forceClientRender)) { + d.forceClientRender = !0; + var r = f === void 0 + ? new Error( + "The render was aborted by the server without a reason.", + ) + : f; + d.errorDigest = a.onError(r); + { + var l = "The server did not finish this Suspense boundary: "; + r && typeof r.message == "string" + ? (r = l + r.message) + : (r = l + String(r)); + var u = Ne; + Ne = o; + try { + on(d, r); + } finally { + Ne = u; + } + } + d.parentFlushed && a.clientRenderedBoundaries.push(d); + } + if ( + (d.fallbackAbortableTasks.forEach(function (g) { + return Ei(g, a, f); + }), + d.fallbackAbortableTasks.clear(), + a.allPendingTasks--, + a.allPendingTasks === 0) + ) { + var p = a.onAllReady; + p(); + } + } + } + function ra(o, a) { + if ( + a.chunks.length === 0 && + a.children.length === 1 && + a.children[0].boundary === null + ) { + var f = a.children[0]; + (f.id = a.id), (f.parentFlushed = !0), f.status === wr && ra(o, f); + } else { + var d = o.completedSegments; + d.push(a); + } + } + function Ri(o, a, f) { + if (a === null) { + if (f.parentFlushed) { + if (o.completedRootSegment !== null) { + throw new Error( + "There can only be one root segment. This is a bug in React.", + ); + } + o.completedRootSegment = f; + } + if ((o.pendingRootTasks--, o.pendingRootTasks === 0)) { + o.onShellError = Gn; + var d = o.onShellReady; + d(); + } + } else if ((a.pendingTasks--, !a.forceClientRender)) { + if (a.pendingTasks === 0) { + f.parentFlushed && f.status === wr && ra(a, f), + a.parentFlushed && o.completedBoundaries.push(a), + a.fallbackAbortableTasks.forEach(ta, o), + a.fallbackAbortableTasks.clear(); + } else if (f.parentFlushed && f.status === wr) { + ra(a, f); + var t = a.completedSegments; + t.length === 1 && a.parentFlushed && o.partialBoundaries.push(a); + } + } + if ((o.allPendingTasks--, o.allPendingTasks === 0)) { + var r = o.onAllReady; + r(); + } + } + function na(o, a) { + var f = a.blockedSegment; + if (f.status === Zo) { + Lo(a.context); + var d = null; + (d = Ne), (Ne = a); + try { + Ue(o, a, a.node), + $t(f.chunks, o.responseState, f.lastPushedText, f.textEmbedded), + a.abortSet.delete(a), + (f.status = wr), + Ri(o, a.blockedBoundary, f); + } catch (r) { + if ( + (ci(), + typeof r == "object" && r !== null && + typeof r.then == "function") + ) { + var t = a.ping; + r.then(t, t); + } else { + a.abortSet.delete(a), + (f.status = gi), + El(o, a.blockedBoundary, f, r); + } + } finally { + Ne = d; + } + } + } + function Kn(o) { + if (o.status !== rn) { + var a = ri(), + f = Vn.current; + Vn.current = di; + var d; + (d = Zt.getCurrentStack), (Zt.getCurrentStack = Qo); + var t = pi; + Xo(o.responseState); + try { + var r = o.pingedTasks, + l; + for (l = 0; l < r.length; l++) { + var u = r[l]; + na(o, u); + } + r.splice(0, l), o.destination !== null && eo(o, o.destination); + } catch (p) { + Jn(o, p), Ko(o, p); + } finally { + Xo(t), + (Vn.current = f), + (Zt.getCurrentStack = d), + f === di && Lo(a); + } + } + } + function oa(o, a, f) { + switch (((f.parentFlushed = !0), f.status)) { + case Zo: { + var d = (f.id = o.nextSegmentId++); + return ( + (f.lastPushedText = !1), + (f.textEmbedded = !1), + ee(a, o.responseState, d) + ); + } + case wr: { + f.status = vi; + for ( + var t = !0, r = f.chunks, l = 0, u = f.children, p = 0; + p < u.length; + p++ + ) { + for (var g = u[p]; l < g.index; l++) P(a, r[l]); + t = qn(o, a, g); + } + for (; l < r.length - 1; l++) P(a, r[l]); + return l < r.length && (t = W(a, r[l])), t; + } + default: + throw new Error( + "Aborted, errored or already flushed boundaries should not be flushed again. This is a bug in React.", + ); + } + } + function qn(o, a, f) { + var d = f.boundary; + if (d === null) return oa(o, a, f); + if (((d.parentFlushed = !0), d.forceClientRender)) { + return ( + ms( + a, + o.responseState, + d.errorDigest, + d.errorMessage, + d.errorComponentStack, + ), + oa(o, a, f), + bs(a, o.responseState) + ); + } + if (d.pendingTasks > 0) { + (d.rootSegmentID = o.nextSegmentId++), + d.completedSegments.length > 0 && o.partialBoundaries.push(d); + var t = (d.id = Br(o.responseState)); + return Ni(a, o.responseState, t), oa(o, a, f), Vi(a, o.responseState); + } else { + if (d.byteSize > o.progressiveChunkSize) { + return ( + (d.rootSegmentID = o.nextSegmentId++), + o.completedBoundaries.push(d), + Ni(a, o.responseState, d.id), + oa(o, a, f), + Vi(a, o.responseState) + ); + } + gs(a, o.responseState); + var r = d.completedSegments; + if (r.length !== 1) { + throw new Error( + "A previously unvisited boundary must have exactly one root segment. This is a bug in React.", + ); + } + var l = r[0]; + return qn(o, a, l), ys(a, o.responseState); + } + } + function Rl(o, a, f) { + return eu( + a, + o.responseState, + f.id, + f.errorDigest, + f.errorMessage, + f.errorComponentStack, + ); + } + function Il(o, a, f) { + return ( + Ws(a, o.responseState, f.formatContext, f.id), + qn(o, a, f), + zs(a, f.formatContext) + ); + } + function Ii(o, a, f) { + for (var d = f.completedSegments, t = 0; t < d.length; t++) { + var r = d[t]; + Pi(o, a, f, r); + } + return (d.length = 0), Gi(a, o.responseState, f.id, f.rootSegmentID); + } + function _i(o, a, f) { + for (var d = f.completedSegments, t = 0; t < d.length; t++) { + var r = d[t]; + if (!Pi(o, a, f, r)) return t++, d.splice(0, t), !1; + } + return d.splice(0, t), !0; + } + function Pi(o, a, f, d) { + if (d.status === vi) return !0; + var t = d.id; + if (t === -1) { + var r = (d.id = f.rootSegmentID); + if (r === -1) { + throw new Error( + "A root segment ID must have been assigned by now. This is a bug in React.", + ); + } + return Il(o, a, d); + } else return Il(o, a, d), La(a, o.responseState, t); + } + function eo(o, a) { + te(); + try { + var f = o.completedRootSegment; + f !== null && + o.pendingRootTasks === 0 && + (qn(o, a, f), + (o.completedRootSegment = null), + Y(a, o.responseState)); + var d = o.clientRenderedBoundaries, + t; + for (t = 0; t < d.length; t++) { + var r = d[t]; + if (!Rl(o, a, r)) { + (o.destination = null), t++, d.splice(0, t); + return; + } + } + d.splice(0, t); + var l = o.completedBoundaries; + for (t = 0; t < l.length; t++) { + var u = l[t]; + if (!Ii(o, a, u)) { + (o.destination = null), t++, l.splice(0, t); + return; + } + } + l.splice(0, t), q(a), te(a); + var p = o.partialBoundaries; + for (t = 0; t < p.length; t++) { + var g = p[t]; + if (!_i(o, a, g)) { + (o.destination = null), t++, p.splice(0, t); + return; + } + } + p.splice(0, t); + var y = o.completedBoundaries; + for (t = 0; t < y.length; t++) { + var w = y[t]; + if (!Ii(o, a, w)) { + (o.destination = null), t++, y.splice(0, t); + return; + } + } + y.splice(0, t); + } finally { + q(a), + E(a), + o.allPendingTasks === 0 && + o.pingedTasks.length === 0 && + o.clientRenderedBoundaries.length === 0 && + o.completedBoundaries.length === 0 && + (o.abortableTasks.size !== 0 && + c( + "There was still abortable task at the root when we closed. This is a bug in React.", + ), + xe(a)); + } + } + function _l(o) { + S(function () { + return Kn(o); + }); + } + function Pl(o, a) { + if (o.status === ml) { + (o.status = rn), ct(a, o.fatalError); + return; + } + if (o.status !== rn && o.destination === null) { + o.destination = a; + try { + eo(o, a); + } catch (f) { + Jn(o, f), Ko(o, f); + } + } + } + function Fi(o, a) { + try { + var f = o.abortableTasks; + f.forEach(function (d) { + return Ei(d, o, a); + }), + f.clear(), + o.destination !== null && eo(o, o.destination); + } catch (d) { + Jn(o, d), Ko(o, d); + } + } + function Bu(o, a) { + return function () { + return Pl(a, o); + }; + } + function Fl(o, a) { + return function () { + return Fi(o, a); + }; + } + function Uu(o, a) { + return Ru( + o, + He( + a ? a.identifierPrefix : void 0, + a ? a.nonce : void 0, + a ? a.bootstrapScriptContent : void 0, + a ? a.bootstrapScripts : void 0, + a ? a.bootstrapModules : void 0, + ), + wn(a ? a.namespaceURI : void 0), + a ? a.progressiveChunkSize : void 0, + a ? a.onError : void 0, + a ? a.onAllReady : void 0, + a ? a.onShellReady : void 0, + a ? a.onShellError : void 0, + void 0, + ); + } + function Al(o, a) { + var f = Uu(o, a), + d = !1; + return ( + _l(f), { + pipe: function (t) { + if (d) { + throw new Error( + "React currently only supports piping to one writable stream.", + ); + } + return ( + (d = !0), + Pl(f, t), + t.on("drain", Bu(t, f)), + t.on( + "error", + Fl( + f, + new Error( + "The destination stream errored while writing data.", + ), + ), + ), + t.on( + "close", + Fl(f, new Error("The destination stream closed early.")), + ), + t + ); + }, + abort: function (t) { + Fi(f, t); + }, + } + ); + } + (Pc.renderToPipeableStream = Al), (Pc.version = i); + })(); +}); +var zd = an((lo) => { + "use strict"; + var io, Fc; + process.env.NODE_ENV === "production" + ? ((io = Wf()), (Fc = jd())) + : ((io = Hd()), (Fc = Wd())); + lo.version = io.version; + lo.renderToString = io.renderToString; + lo.renderToStaticMarkup = io.renderToStaticMarkup; + lo.renderToNodeStream = io.renderToNodeStream; + lo.renderToStaticNodeStream = io.renderToStaticNodeStream; + lo.renderToPipeableStream = Fc.renderToPipeableStream; +}); +var Nd = Dc(zd()), + $i = Dc(ua()), + Cv = require("http"), + Ev = () => + $i.default.createElement( + "html", + null, + $i.default.createElement( + "body", + null, + $i.default.createElement("h1", null, "Hello World"), + ), + ), + $d = !1; + +const port = process.argv[2] || "4544"; +console.log("port", port); +Cv.createServer(function (e, n) { + let i = (0, Nd.renderToPipeableStream)($i.default.createElement(Ev, null), { + onShellReady() { + (n.statusCode = $d ? 500 : 200), + n.setHeader("Content-type", "text/html"), + n.setHeader("Cache-Control", "no-transform"), + i.pipe(n); + }, + onShellError(s) { + (n.statusCode = 500), + n.send( + '<!doctype html><p>Loading...</p><script src="clientrender.js"></script>', + ); + }, + onAllReady() {}, + onError(s) { + ($d = !0), console.error(s); + }, + }); +}).listen(port); +/** + * @license React + * react-dom-server-legacy.node.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/** + * @license React + * react-dom-server-legacy.node.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/** + * @license React + * react-dom-server.node.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/** + * @license React + * react-dom-server.node.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/** + * @license React + * react.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ diff --git a/cli/bench/testdata/bun_reactdom_ssr.jsx b/cli/bench/testdata/bun_reactdom_ssr.jsx new file mode 100644 index 000000000..e721033a2 --- /dev/null +++ b/cli/bench/testdata/bun_reactdom_ssr.jsx @@ -0,0 +1,23 @@ +// Bun uses a custom non-portable react-dom fork. +// TODO(@littledivy): Reenable this when it stops segfaulting. +import { renderToReadableStream } from "./react-dom.js"; +const headers = { + headers: { + "Content-Type": "text/html", + }, +}; + +const App = () => ( + <html> + <body> + <h1>Hello World</h1> + </body> + </html> +); + +Bun.serve({ + async fetch(req) { + return new Response(await renderToReadableStream(<App />), headers); + }, + port: 9000, +}); diff --git a/cli/bench/testdata/deno_upgrade_http.js b/cli/bench/testdata/deno_upgrade_http.js new file mode 100644 index 000000000..638761cf6 --- /dev/null +++ b/cli/bench/testdata/deno_upgrade_http.js @@ -0,0 +1,13 @@ +const { serve, upgradeHttp } = Deno; +const u8 = Deno.core.encode("HTTP/1.1 101 Switching Protocols\r\n\r\n"); + +async function handler(req) { + const [conn, _firstPacket] = upgradeHttp(req); + await conn.write(u8); + await conn.close(); +} + +serve(handler, { + hostname: "127.0.0.1", + port: 9000, +}); diff --git a/cli/bench/testdata/react-dom.js b/cli/bench/testdata/react-dom.js new file mode 100644 index 000000000..5fb0dbc78 --- /dev/null +++ b/cli/bench/testdata/react-dom.js @@ -0,0 +1,28 @@ +// deno-fmt-ignore-file +/** + * Bundled by jsDelivr using Rollup v2.75.7 and Terser v5.14.1. + * Original file: /npm/react-dom@18.2.0/server.browser.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ + import e from"react"; + var t={};var n={}; + /** + * @license React + * react-dom-server-legacy.browser.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var r=e;function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=Object.prototype.hasOwnProperty,l=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,u={},i={};function s(e){if(o.call(i,e))return!0;if(o.call(u,e))return!1;if(l.test(e))return i[e]=!0;u[e]=!0;return!1}function c(e,t,n,r,a,o,l){this.acceptsBooleans=2===t||3===t||4===t;this.attributeName=r;this.attributeNamespace=a;this.mustUseProperty=n;this.propertyName=e;this.type=t;this.sanitizeURL=o;this.removeEmptyString=l}var d={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){d[e]=new c(e,0,!1,e,null,!1,!1)}));[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];d[t]=new c(t,1,!1,e[1],null,!1,!1)}));["contentEditable","draggable","spellCheck","value"].forEach((function(e){d[e]=new c(e,2,!1,e.toLowerCase(),null,!1,!1)}));["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){d[e]=new c(e,2,!1,e,null,!1,!1)}));"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){d[e]=new c(e,3,!1,e.toLowerCase(),null,!1,!1)}));["checked","multiple","muted","selected"].forEach((function(e){d[e]=new c(e,3,!0,e,null,!1,!1)}));["capture","download"].forEach((function(e){d[e]=new c(e,4,!1,e,null,!1,!1)}));["cols","rows","size","span"].forEach((function(e){d[e]=new c(e,6,!1,e,null,!1,!1)}));["rowSpan","start"].forEach((function(e){d[e]=new c(e,5,!1,e.toLowerCase(),null,!1,!1)}));var f=/[\-:]([a-z])/g;function p(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(f,p);d[t]=new c(t,1,!1,e,null,!1,!1)}));"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(f,p);d[t]=new c(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}));["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(f,p);d[t]=new c(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}));["tabIndex","crossOrigin"].forEach((function(e){d[e]=new c(e,1,!1,e.toLowerCase(),null,!1,!1)}));d.xlinkHref=new c("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach((function(e){d[e]=new c(e,1,!1,e.toLowerCase(),null,!0,!0)}));var h={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},g=["Webkit","ms","Moz","O"];Object.keys(h).forEach((function(e){g.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1);h[t]=h[e]}))}));var m=/["'&<>]/;function b(e){if("boolean"===typeof e||"number"===typeof e)return""+e;e=""+e;var t=m.exec(e);if(t){var n="",r,a=0;for(r=t.index;r<e.length;r++){switch(e.charCodeAt(r)){case 34:t=""";break;case 38:t="&";break;case 39:t="'";break;case 60:t="<";break;case 62:t=">";break;default:continue}a!==r&&(n+=e.substring(a,r));a=r+1;n+=t}e=a!==r?n+e.substring(a,r):n}return e}var y=/([A-Z])/g,v=/^ms-/,S=Array.isArray;function x(e,t){return{insertionMode:e,selectedValue:t}}function k(e,t,n){switch(t){case"select":return x(1,null!=n.value?n.value:n.defaultValue);case"svg":return x(2,null);case"math":return x(3,null);case"foreignObject":return x(1,null);case"table":return x(4,null);case"thead":case"tbody":case"tfoot":return x(5,null);case"colgroup":return x(7,null);case"tr":return x(6,null)}return 4<=e.insertionMode||0===e.insertionMode?x(1,null):e}var w=new Map;function C(e,t,n){if("object"!==typeof n)throw Error(a(62));t=!0;for(var r in n)if(o.call(n,r)){var l=n[r];if(null!=l&&"boolean"!==typeof l&&""!==l){if(0===r.indexOf("--")){var u=b(r);l=b((""+l).trim())}else{u=r;var i=w.get(u);void 0!==i?u=i:(i=b(u.replace(y,"-$1").toLowerCase().replace(v,"-ms-")),w.set(u,i),u=i);l="number"===typeof l?0===l||o.call(h,r)?""+l:l+"px":b((""+l).trim())}t?(t=!1,e.push(' style="',u,":",l)):e.push(";",u,":",l)}}t||e.push('"')}function E(e,t,n,r){switch(n){case"style":C(e,t,r);return;case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":return}if(!(2<n.length)||"o"!==n[0]&&"O"!==n[0]||"n"!==n[1]&&"N"!==n[1])if(t=d.hasOwnProperty(n)?d[n]:null,null!==t){switch(typeof r){case"function":case"symbol":return;case"boolean":if(!t.acceptsBooleans)return}n=t.attributeName;switch(t.type){case 3:r&&e.push(" ",n,'=""');break;case 4:!0===r?e.push(" ",n,'=""'):!1!==r&&e.push(" ",n,'="',b(r),'"');break;case 5:isNaN(r)||e.push(" ",n,'="',b(r),'"');break;case 6:!isNaN(r)&&1<=r&&e.push(" ",n,'="',b(r),'"');break;default:t.sanitizeURL&&(r=""+r),e.push(" ",n,'="',b(r),'"')}}else if(s(n)){switch(typeof r){case"function":case"symbol":return;case"boolean":if(t=n.toLowerCase().slice(0,5),"data-"!==t&&"aria-"!==t)return}e.push(" ",n,'="',b(r),'"')}}function F(e,t,n){if(null!=t){if(null!=n)throw Error(a(60));if("object"!==typeof t||!("__html"in t))throw Error(a(61));t=t.__html;null!==t&&void 0!==t&&e.push(""+t)}}function T(e){var t="";r.Children.forEach(e,(function(e){null!=e&&(t+=e)}));return t}function R(e,t,n,r){e.push(I(n));var a=n=null,l;for(l in t)if(o.call(t,l)){var u=t[l];if(null!=u)switch(l){case"children":n=u;break;case"dangerouslySetInnerHTML":a=u;break;default:E(e,r,l,u)}}e.push(">");F(e,a,n);return"string"===typeof n?(e.push(b(n)),null):n}var _=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,P=new Map;function I(e){var t=P.get(e);if(void 0===t){if(!_.test(e))throw Error(a(65,e));t="<"+e;P.set(e,t)}return t}function M(e,t,n,r,l){switch(t){case"select":e.push(I("select"));var u=null,i=null;for(p in n)if(o.call(n,p)){var c=n[p];if(null!=c)switch(p){case"children":u=c;break;case"dangerouslySetInnerHTML":i=c;break;case"defaultValue":case"value":break;default:E(e,r,p,c)}}e.push(">");F(e,i,u);return u;case"option":i=l.selectedValue;e.push(I("option"));var d=c=null,f=null;var p=null;for(u in n)if(o.call(n,u)){var h=n[u];if(null!=h)switch(u){case"children":c=h;break;case"selected":f=h;break;case"dangerouslySetInnerHTML":p=h;break;case"value":d=h;default:E(e,r,u,h)}}if(null!=i)if(n=null!==d?""+d:T(c),S(i))for(r=0;r<i.length;r++){if(""+i[r]===n){e.push(' selected=""');break}}else""+i===n&&e.push(' selected=""');else f&&e.push(' selected=""');e.push(">");F(e,p,c);return c;case"textarea":e.push(I("textarea"));p=i=u=null;for(c in n)if(o.call(n,c)&&(d=n[c],null!=d))switch(c){case"children":p=d;break;case"value":u=d;break;case"defaultValue":i=d;break;case"dangerouslySetInnerHTML":throw Error(a(91));default:E(e,r,c,d)}null===u&&null!==i&&(u=i);e.push(">");if(null!=p){if(null!=u)throw Error(a(92));if(S(p)&&1<p.length)throw Error(a(93));u=""+p}"string"===typeof u&&"\n"===u[0]&&e.push("\n");null!==u&&e.push(b(""+u));return null;case"input":e.push(I("input"));d=p=c=u=null;for(i in n)if(o.call(n,i)&&(f=n[i],null!=f))switch(i){case"children":case"dangerouslySetInnerHTML":throw Error(a(399,"input"));case"defaultChecked":d=f;break;case"defaultValue":c=f;break;case"checked":p=f;break;case"value":u=f;break;default:E(e,r,i,f)}null!==p?E(e,r,"checked",p):null!==d&&E(e,r,"checked",d);null!==u?E(e,r,"value",u):null!==c&&E(e,r,"value",c);e.push("/>");return null;case"menuitem":e.push(I("menuitem"));for(var g in n)if(o.call(n,g)&&(u=n[g],null!=u))switch(g){case"children":case"dangerouslySetInnerHTML":throw Error(a(400));default:E(e,r,g,u)}e.push(">");return null;case"title":e.push(I("title"));u=null;for(h in n)if(o.call(n,h)&&(i=n[h],null!=i))switch(h){case"children":u=i;break;case"dangerouslySetInnerHTML":throw Error(a(434));default:E(e,r,h,i)}e.push(">");return u;case"listing":case"pre":e.push(I(t));i=u=null;for(d in n)if(o.call(n,d)&&(c=n[d],null!=c))switch(d){case"children":u=c;break;case"dangerouslySetInnerHTML":i=c;break;default:E(e,r,d,c)}e.push(">");if(null!=i){if(null!=u)throw Error(a(60));if("object"!==typeof i||!("__html"in i))throw Error(a(61));n=i.__html;null!==n&&void 0!==n&&("string"===typeof n&&0<n.length&&"\n"===n[0]?e.push("\n",n):e.push(""+n))}"string"===typeof u&&"\n"===u[0]&&e.push("\n");return u;case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":e.push(I(t));for(var m in n)if(o.call(n,m)&&(u=n[m],null!=u))switch(m){case"children":case"dangerouslySetInnerHTML":throw Error(a(399,t));default:E(e,r,m,u)}e.push("/>");return null;case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return R(e,n,t,r);case"html":return 0===l.insertionMode&&e.push("<!DOCTYPE html>"),R(e,n,t,r);default:if(-1===t.indexOf("-")&&"string"!==typeof n.is)return R(e,n,t,r);e.push(I(t));i=u=null;for(f in n)if(o.call(n,f)&&(c=n[f],null!=c))switch(f){case"children":u=c;break;case"dangerouslySetInnerHTML":i=c;break;case"style":C(e,r,c);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":break;default:s(f)&&"function"!==typeof c&&"symbol"!==typeof c&&e.push(" ",f,'="',b(c),'"')}e.push(">");F(e,i,u);return u}}function B(e,t,n){e.push('\x3c!--$?--\x3e<template id="');if(null===n)throw Error(a(395));e.push(n);return e.push('"></template>')}function D(e,t,n,r){switch(n.insertionMode){case 0:case 1:return e.push('<div hidden id="'),e.push(t.segmentPrefix),t=r.toString(16),e.push(t),e.push('">');case 2:return e.push('<svg aria-hidden="true" style="display:none" id="'),e.push(t.segmentPrefix),t=r.toString(16),e.push(t),e.push('">');case 3:return e.push('<math aria-hidden="true" style="display:none" id="'),e.push(t.segmentPrefix),t=r.toString(16),e.push(t),e.push('">');case 4:return e.push('<table hidden id="'),e.push(t.segmentPrefix),t=r.toString(16),e.push(t),e.push('">');case 5:return e.push('<table hidden><tbody id="'),e.push(t.segmentPrefix),t=r.toString(16),e.push(t),e.push('">');case 6:return e.push('<table hidden><tr id="'),e.push(t.segmentPrefix),t=r.toString(16),e.push(t),e.push('">');case 7:return e.push('<table hidden><colgroup id="'),e.push(t.segmentPrefix),t=r.toString(16),e.push(t),e.push('">');default:throw Error(a(397))}}function z(e,t){switch(t.insertionMode){case 0:case 1:return e.push("</div>");case 2:return e.push("</svg>");case 3:return e.push("</math>");case 4:return e.push("</table>");case 5:return e.push("</tbody></table>");case 6:return e.push("</tr></table>");case 7:return e.push("</colgroup></table>");default:throw Error(a(397))}}var N=/[<\u2028\u2029]/g;function V(e){return JSON.stringify(e).replace(N,(function(e){switch(e){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}}))}function $(e,t){t=void 0===t?"":t;return{bootstrapChunks:[],startInlineScript:"<script>",placeholderPrefix:t+"P:",segmentPrefix:t+"S:",boundaryPrefix:t+"B:",idPrefix:t,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1,generateStaticMarkup:e}}function L(e,t,n,r){if(n.generateStaticMarkup)return e.push(b(t)),!1;""===t?e=r:(r&&e.push("\x3c!-- --\x3e"),e.push(b(t)),e=!0);return e}var O=Object.assign,A=Symbol.for("react.element"),j=Symbol.for("react.portal"),q=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),W=Symbol.for("react.provider"),Z=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),Q=Symbol.for("react.scope"),ee=Symbol.for("react.debug_trace_mode"),te=Symbol.for("react.legacy_hidden"),ne=Symbol.for("react.default_value"),re=Symbol.iterator;function ae(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case q:return"Fragment";case j:return"Portal";case U:return"Profiler";case H:return"StrictMode";case G:return"Suspense";case J:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case Z:return(e.displayName||"Context")+".Consumer";case W:return(e._context.displayName||"Context")+".Provider";case X:var t=e.render;e=e.displayName;e||(e=t.displayName||t.name||"",e=""!==e?"ForwardRef("+e+")":"ForwardRef");return e;case Y:return t=e.displayName||null,null!==t?t:ae(e.type)||"Memo";case K:t=e._payload;e=e._init;try{return ae(e(t))}catch(e){}}return null}var oe={};function le(e,t){e=e.contextTypes;if(!e)return oe;var n={},r;for(r in e)n[r]=t[r];return n}var ue=null;function ie(e,t){if(e!==t){e.context._currentValue2=e.parentValue;e=e.parent;var n=t.parent;if(null===e){if(null!==n)throw Error(a(401))}else{if(null===n)throw Error(a(401));ie(e,n)}t.context._currentValue2=t.value}}function se(e){e.context._currentValue2=e.parentValue;e=e.parent;null!==e&&se(e)}function ce(e){var t=e.parent;null!==t&&ce(t);e.context._currentValue2=e.value}function de(e,t){e.context._currentValue2=e.parentValue;e=e.parent;if(null===e)throw Error(a(402));e.depth===t.depth?ie(e,t):de(e,t)}function fe(e,t){var n=t.parent;if(null===n)throw Error(a(402));e.depth===n.depth?ie(e,n):fe(e,n);t.context._currentValue2=t.value}function pe(e){var t=ue;t!==e&&(null===t?ce(e):null===e?se(t):t.depth===e.depth?ie(t,e):t.depth>e.depth?de(t,e):fe(t,e),ue=e)}var he={isMounted:function(){return!1},enqueueSetState:function(e,t){e=e._reactInternals;null!==e.queue&&e.queue.push(t)},enqueueReplaceState:function(e,t){e=e._reactInternals;e.replace=!0;e.queue=[t]},enqueueForceUpdate:function(){}};function ge(e,t,n,r){var a=void 0!==e.state?e.state:null;e.updater=he;e.props=n;e.state=a;var o={queue:[],replace:!1};e._reactInternals=o;var l=t.contextType;e.context="object"===typeof l&&null!==l?l._currentValue2:r;l=t.getDerivedStateFromProps;"function"===typeof l&&(l=l(n,a),a=null===l||void 0===l?a:O({},a,l),e.state=a);if("function"!==typeof t.getDerivedStateFromProps&&"function"!==typeof e.getSnapshotBeforeUpdate&&("function"===typeof e.UNSAFE_componentWillMount||"function"===typeof e.componentWillMount))if(t=e.state,"function"===typeof e.componentWillMount&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),t!==e.state&&he.enqueueReplaceState(e,e.state,null),null!==o.queue&&0<o.queue.length)if(t=o.queue,l=o.replace,o.queue=null,o.replace=!1,l&&1===t.length)e.state=t[0];else{o=l?t[0]:e.state;a=!0;for(l=l?1:0;l<t.length;l++){var u=t[l];u="function"===typeof u?u.call(e,o,n,r):u;null!=u&&(a?(a=!1,o=O({},o,u)):O(o,u))}e.state=o}else o.queue=null}var me={id:1,overflow:""};function be(e,t,n){var r=e.id;e=e.overflow;var a=32-ye(r)-1;r&=~(1<<a);n+=1;var o=32-ye(t)+a;if(30<o){var l=a-a%5;o=(r&(1<<l)-1).toString(32);r>>=l;a-=l;return{id:1<<32-ye(t)+a|n<<a|r,overflow:o+e}}return{id:1<<o|n<<a|r,overflow:e}}var ye=Math.clz32?Math.clz32:xe,ve=Math.log,Se=Math.LN2;function xe(e){e>>>=0;return 0===e?32:31-(ve(e)/Se|0)|0}function ke(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t}var we="function"===typeof Object.is?Object.is:ke,Ce=null,Ee=null,Fe=null,Te=null,Re=!1,_e=!1,Pe=0,Ie=null,Me=0;function Be(){if(null===Ce)throw Error(a(321));return Ce}function De(){if(0<Me)throw Error(a(312));return{memoizedState:null,queue:null,next:null}}function ze(){null===Te?null===Fe?(Re=!1,Fe=Te=De()):(Re=!0,Te=Fe):null===Te.next?(Re=!1,Te=Te.next=De()):(Re=!0,Te=Te.next);return Te}function Ne(){Ee=Ce=null;_e=!1;Fe=null;Me=0;Te=Ie=null}function Ve(e,t){return"function"===typeof t?t(e):t}function $e(e,t,n){Ce=Be();Te=ze();if(Re){var r=Te.queue;t=r.dispatch;if(null!==Ie&&(n=Ie.get(r),void 0!==n)){Ie.delete(r);r=Te.memoizedState;do{r=e(r,n.action),n=n.next}while(null!==n);Te.memoizedState=r;return[r,t]}return[Te.memoizedState,t]}e=e===Ve?"function"===typeof t?t():t:void 0!==n?n(t):t;Te.memoizedState=e;e=Te.queue={last:null,dispatch:null};e=e.dispatch=Oe.bind(null,Ce,e);return[Te.memoizedState,e]}function Le(e,t){Ce=Be();Te=ze();t=void 0===t?null:t;if(null!==Te){var n=Te.memoizedState;if(null!==n&&null!==t){var r=n[1];e:if(null===r)r=!1;else{for(var a=0;a<r.length&&a<t.length;a++)if(!we(t[a],r[a])){r=!1;break e}r=!0}if(r)return n[0]}}e=e();Te.memoizedState=[e,t];return e}function Oe(e,t,n){if(25<=Me)throw Error(a(301));if(e===Ce)if(_e=!0,e={action:n,next:null},null===Ie&&(Ie=new Map),n=Ie.get(t),void 0===n)Ie.set(t,e);else{for(t=n;null!==t.next;)t=t.next;t.next=e}}function Ae(){throw Error(a(394))}function je(){}var qe={readContext:function(e){return e._currentValue2},useContext:function(e){Be();return e._currentValue2},useMemo:Le,useReducer:$e,useRef:function(e){Ce=Be();Te=ze();var t=Te.memoizedState;return null===t?(e={current:e},Te.memoizedState=e):t},useState:function(e){return $e(Ve,e)},useInsertionEffect:je,useLayoutEffect:function(){},useCallback:function(e,t){return Le((function(){return e}),t)},useImperativeHandle:je,useEffect:je,useDebugValue:je,useDeferredValue:function(e){Be();return e},useTransition:function(){Be();return[!1,Ae]},useId:function(){var e=Ee.treeContext;var t=e.overflow;e=e.id;e=(e&~(1<<32-ye(e)-1)).toString(32)+t;var n=He;if(null===n)throw Error(a(404));t=Pe++;e=":"+n.idPrefix+"R"+e;0<t&&(e+="H"+t.toString(32));return e+":"},useMutableSource:function(e,t){Be();return t(e._source)},useSyncExternalStore:function(e,t,n){if(void 0===n)throw Error(a(407));return n()}},He=null,Ue=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;function We(e){console.error(e);return null}function Ze(){}function Xe(e,t,n,r,a,o,l,u,i){var s=[],c=new Set;t={destination:null,responseState:t,progressiveChunkSize:void 0===r?12800:r,status:0,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:c,pingedTasks:s,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:void 0===a?We:a,onAllReady:void 0===o?Ze:o,onShellReady:void 0===l?Ze:l,onShellError:void 0===u?Ze:u,onFatalError:void 0===i?Ze:i};n=Je(t,0,null,n,!1,!1);n.parentFlushed=!0;e=Ge(t,e,null,n,c,oe,null,me);s.push(e);return t}function Ge(e,t,n,r,a,o,l,u){e.allPendingTasks++;null===n?e.pendingRootTasks++:n.pendingTasks++;var i={node:t,ping:function(){var t=e.pingedTasks;t.push(i);1===t.length&&ct(e)},blockedBoundary:n,blockedSegment:r,abortSet:a,legacyContext:o,context:l,treeContext:u};a.add(i);return i}function Je(e,t,n,r,a,o){return{status:0,id:-1,index:t,parentFlushed:!1,chunks:[],children:[],formatContext:r,boundary:n,lastPushedText:a,textEmbedded:o}}function Ye(e,t){e=e.onError(t);if(null!=e&&"string"!==typeof e)throw Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof e+'" instead');return e}function Ke(e,t){var n=e.onShellError;n(t);n=e.onFatalError;n(t);null!==e.destination?(e.status=2,e.destination.destroy(t)):(e.status=1,e.fatalError=t)}function Qe(e,t,n,r,a){Ce={};Ee=t;Pe=0;for(e=n(r,a);_e;)_e=!1,Pe=0,Me+=1,Te=null,e=n(r,a);Ne();return e}function et(e,t,n,r){var o=n.render(),l=r.childContextTypes;if(null!==l&&void 0!==l){var u=t.legacyContext;if("function"!==typeof n.getChildContext)r=u;else{n=n.getChildContext();for(var i in n)if(!(i in l))throw Error(a(108,ae(r)||"Unknown",i));r=O({},u,n)}t.legacyContext=r;rt(e,t,o);t.legacyContext=u}else rt(e,t,o)}function tt(e,t){if(e&&e.defaultProps){t=O({},t);e=e.defaultProps;for(var n in e)void 0===t[n]&&(t[n]=e[n]);return t}return t}function nt(e,t,n,r,o){if("function"===typeof n)if(n.prototype&&n.prototype.isReactComponent){o=le(n,t.legacyContext);var l=n.contextType;l=new n(r,"object"===typeof l&&null!==l?l._currentValue2:o);ge(l,n,r,o);et(e,t,l,n)}else{l=le(n,t.legacyContext);o=Qe(e,t,n,r,l);var u=0!==Pe;if("object"===typeof o&&null!==o&&"function"===typeof o.render&&void 0===o.$$typeof)ge(o,n,r,l),et(e,t,o,n);else if(u){r=t.treeContext;t.treeContext=be(r,1,0);try{rt(e,t,o)}finally{t.treeContext=r}}else rt(e,t,o)}else if("string"===typeof n){o=t.blockedSegment;l=M(o.chunks,n,r,e.responseState,o.formatContext);o.lastPushedText=!1;u=o.formatContext;o.formatContext=k(u,n,r);ot(e,t,l);o.formatContext=u;switch(n){case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"input":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":break;default:o.chunks.push("</",n,">")}o.lastPushedText=!1}else{switch(n){case te:case ee:case H:case U:case q:rt(e,t,r.children);return;case J:rt(e,t,r.children);return;case Q:throw Error(a(343));case G:e:{n=t.blockedBoundary;o=t.blockedSegment;l=r.fallback;r=r.children;u=new Set;var i={id:null,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:u,errorDigest:null},s=Je(e,o.chunks.length,i,o.formatContext,!1,!1);o.children.push(s);o.lastPushedText=!1;var c=Je(e,0,null,o.formatContext,!1,!1);c.parentFlushed=!0;t.blockedBoundary=i;t.blockedSegment=c;try{if(ot(e,t,r),e.responseState.generateStaticMarkup||c.lastPushedText&&c.textEmbedded&&c.chunks.push("\x3c!-- --\x3e"),c.status=1,it(i,c),0===i.pendingTasks)break e}catch(t){c.status=4,i.forceClientRender=!0,i.errorDigest=Ye(e,t)}finally{t.blockedBoundary=n,t.blockedSegment=o}t=Ge(e,l,n,s,u,t.legacyContext,t.context,t.treeContext);e.pingedTasks.push(t)}return}if("object"===typeof n&&null!==n)switch(n.$$typeof){case X:r=Qe(e,t,n.render,r,o);if(0!==Pe){n=t.treeContext;t.treeContext=be(n,1,0);try{rt(e,t,r)}finally{t.treeContext=n}}else rt(e,t,r);return;case Y:n=n.type;r=tt(n,r);nt(e,t,n,r,o);return;case W:o=r.children;n=n._context;r=r.value;l=n._currentValue2;n._currentValue2=r;u=ue;ue=r={parent:u,depth:null===u?0:u.depth+1,context:n,parentValue:l,value:r};t.context=r;rt(e,t,o);e=ue;if(null===e)throw Error(a(403));r=e.parentValue;e.context._currentValue2=r===ne?e.context._defaultValue:r;e=ue=e.parent;t.context=e;return;case Z:r=r.children;r=r(n._currentValue2);rt(e,t,r);return;case K:o=n._init;n=o(n._payload);r=tt(n,r);nt(e,t,n,r,void 0);return}throw Error(a(130,null==n?n:typeof n,""))}}function rt(e,t,n){t.node=n;if("object"===typeof n&&null!==n){switch(n.$$typeof){case A:nt(e,t,n.type,n.props,n.ref);return;case j:throw Error(a(257));case K:var r=n._init;n=r(n._payload);rt(e,t,n);return}if(S(n)){at(e,t,n);return}null===n||"object"!==typeof n?r=null:(r=re&&n[re]||n["@@iterator"],r="function"===typeof r?r:null);if(r&&(r=r.call(n))){n=r.next();if(!n.done){var o=[];do{o.push(n.value),n=r.next()}while(!n.done);at(e,t,o)}return}e=Object.prototype.toString.call(n);throw Error(a(31,"[object Object]"===e?"object with keys {"+Object.keys(n).join(", ")+"}":e))}"string"===typeof n?(r=t.blockedSegment,r.lastPushedText=L(t.blockedSegment.chunks,n,e.responseState,r.lastPushedText)):"number"===typeof n&&(r=t.blockedSegment,r.lastPushedText=L(t.blockedSegment.chunks,""+n,e.responseState,r.lastPushedText))}function at(e,t,n){for(var r=n.length,a=0;a<r;a++){var o=t.treeContext;t.treeContext=be(o,r,a);try{ot(e,t,n[a])}finally{t.treeContext=o}}}function ot(e,t,n){var r=t.blockedSegment.formatContext,a=t.legacyContext,o=t.context;try{return rt(e,t,n)}catch(i){if(Ne(),"object"===typeof i&&null!==i&&"function"===typeof i.then){n=i;var l=t.blockedSegment,u=Je(e,l.chunks.length,null,l.formatContext,l.lastPushedText,!0);l.children.push(u);l.lastPushedText=!1;e=Ge(e,t.node,t.blockedBoundary,u,t.abortSet,t.legacyContext,t.context,t.treeContext).ping;n.then(e,e);t.blockedSegment.formatContext=r;t.legacyContext=a;t.context=o;pe(o)}else throw t.blockedSegment.formatContext=r,t.legacyContext=a,t.context=o,pe(o),i}}function lt(e){var t=e.blockedBoundary;e=e.blockedSegment;e.status=3;st(this,t,e)}function ut(e,t,n){var r=e.blockedBoundary;e.blockedSegment.status=3;null===r?(t.allPendingTasks--,2!==t.status&&(t.status=2,null!==t.destination&&t.destination.push(null))):(r.pendingTasks--,r.forceClientRender||(r.forceClientRender=!0,e=void 0===n?Error(a(432)):n,r.errorDigest=t.onError(e),r.parentFlushed&&t.clientRenderedBoundaries.push(r)),r.fallbackAbortableTasks.forEach((function(e){return ut(e,t,n)})),r.fallbackAbortableTasks.clear(),t.allPendingTasks--,0===t.allPendingTasks&&(r=t.onAllReady,r()))}function it(e,t){if(0===t.chunks.length&&1===t.children.length&&null===t.children[0].boundary){var n=t.children[0];n.id=t.id;n.parentFlushed=!0;1===n.status&&it(e,n)}else e.completedSegments.push(t)}function st(e,t,n){if(null===t){if(n.parentFlushed){if(null!==e.completedRootSegment)throw Error(a(389));e.completedRootSegment=n}e.pendingRootTasks--;0===e.pendingRootTasks&&(e.onShellError=Ze,t=e.onShellReady,t())}else t.pendingTasks--,t.forceClientRender||(0===t.pendingTasks?(n.parentFlushed&&1===n.status&&it(t,n),t.parentFlushed&&e.completedBoundaries.push(t),t.fallbackAbortableTasks.forEach(lt,e),t.fallbackAbortableTasks.clear()):n.parentFlushed&&1===n.status&&(it(t,n),1===t.completedSegments.length&&t.parentFlushed&&e.partialBoundaries.push(t)));e.allPendingTasks--;0===e.allPendingTasks&&(e=e.onAllReady,e())}function ct(e){if(2!==e.status){var t=ue,n=Ue.current;Ue.current=qe;var r=He;He=e.responseState;try{var a=e.pingedTasks,o;for(o=0;o<a.length;o++){var l=a[o];var u=e,i=l.blockedSegment;if(0===i.status){pe(l.context);try{rt(u,l,l.node),u.responseState.generateStaticMarkup||i.lastPushedText&&i.textEmbedded&&i.chunks.push("\x3c!-- --\x3e"),l.abortSet.delete(l),i.status=1,st(u,l.blockedBoundary,i)}catch(e){if(Ne(),"object"===typeof e&&null!==e&&"function"===typeof e.then){var s=l.ping;e.then(s,s)}else{l.abortSet.delete(l);i.status=4;var c=l.blockedBoundary,d=e,f=Ye(u,d);null===c?Ke(u,d):(c.pendingTasks--,c.forceClientRender||(c.forceClientRender=!0,c.errorDigest=f,c.parentFlushed&&u.clientRenderedBoundaries.push(c)));u.allPendingTasks--;if(0===u.allPendingTasks){var p=u.onAllReady;p()}}}finally{}}}a.splice(0,o);null!==e.destination&&mt(e,e.destination)}catch(t){Ye(e,t),Ke(e,t)}finally{He=r,Ue.current=n,n===qe&&pe(t)}}}function dt(e,t,n){n.parentFlushed=!0;switch(n.status){case 0:var r=n.id=e.nextSegmentId++;n.lastPushedText=!1;n.textEmbedded=!1;e=e.responseState;t.push('<template id="');t.push(e.placeholderPrefix);e=r.toString(16);t.push(e);return t.push('"></template>');case 1:n.status=2;var o=!0;r=n.chunks;var l=0;n=n.children;for(var u=0;u<n.length;u++){for(o=n[u];l<o.index;l++)t.push(r[l]);o=ft(e,t,o)}for(;l<r.length-1;l++)t.push(r[l]);l<r.length&&(o=t.push(r[l]));return o;default:throw Error(a(390))}}function ft(e,t,n){var r=n.boundary;if(null===r)return dt(e,t,n);r.parentFlushed=!0;if(r.forceClientRender)return e.responseState.generateStaticMarkup||(r=r.errorDigest,t.push("\x3c!--$!--\x3e"),t.push("<template"),r&&(t.push(' data-dgst="'),r=b(r),t.push(r),t.push('"')),t.push("></template>")),dt(e,t,n),e=e.responseState.generateStaticMarkup?!0:t.push("\x3c!--/$--\x3e"),e;if(0<r.pendingTasks){r.rootSegmentID=e.nextSegmentId++;0<r.completedSegments.length&&e.partialBoundaries.push(r);var o=e.responseState;var l=o.nextSuspenseID++;o=o.boundaryPrefix+l.toString(16);r=r.id=o;B(t,e.responseState,r);dt(e,t,n);return t.push("\x3c!--/$--\x3e")}if(r.byteSize>e.progressiveChunkSize)return r.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(r),B(t,e.responseState,r.id),dt(e,t,n),t.push("\x3c!--/$--\x3e");e.responseState.generateStaticMarkup||t.push("\x3c!--$--\x3e");n=r.completedSegments;if(1!==n.length)throw Error(a(391));ft(e,t,n[0]);e=e.responseState.generateStaticMarkup?!0:t.push("\x3c!--/$--\x3e");return e}function pt(e,t,n){D(t,e.responseState,n.formatContext,n.id);ft(e,t,n);return z(t,n.formatContext)}function ht(e,t,n){for(var r=n.completedSegments,o=0;o<r.length;o++)gt(e,t,n,r[o]);r.length=0;e=e.responseState;r=n.id;n=n.rootSegmentID;t.push(e.startInlineScript);e.sentCompleteBoundaryFunction?t.push('$RC("'):(e.sentCompleteBoundaryFunction=!0,t.push('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("'));if(null===r)throw Error(a(395));n=n.toString(16);t.push(r);t.push('","');t.push(e.segmentPrefix);t.push(n);return t.push('")<\/script>')}function gt(e,t,n,r){if(2===r.status)return!0;var o=r.id;if(-1===o){if(-1===(r.id=n.rootSegmentID))throw Error(a(392));return pt(e,t,r)}pt(e,t,r);e=e.responseState;t.push(e.startInlineScript);e.sentCompleteSegmentFunction?t.push('$RS("'):(e.sentCompleteSegmentFunction=!0,t.push('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("'));t.push(e.segmentPrefix);o=o.toString(16);t.push(o);t.push('","');t.push(e.placeholderPrefix);t.push(o);return t.push('")<\/script>')}function mt(e,t){try{var n=e.completedRootSegment;if(null!==n&&0===e.pendingRootTasks){ft(e,t,n);e.completedRootSegment=null;var r=e.responseState.bootstrapChunks;for(n=0;n<r.length-1;n++)t.push(r[n]);n<r.length&&t.push(r[n])}var o=e.clientRenderedBoundaries,l;for(l=0;l<o.length;l++){var u=o[l];r=t;var i=e.responseState,s=u.id,c=u.errorDigest,d=u.errorMessage,f=u.errorComponentStack;r.push(i.startInlineScript);i.sentClientRenderFunction?r.push('$RX("'):(i.sentClientRenderFunction=!0,r.push('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("'));if(null===s)throw Error(a(395));r.push(s);r.push('"');if(c||d||f){r.push(",");var p=V(c||"");r.push(p)}if(d||f){r.push(",");var h=V(d||"");r.push(h)}if(f){r.push(",");var g=V(f);r.push(g)}if(!r.push(")<\/script>")){e.destination=null;l++;o.splice(0,l);return}}o.splice(0,l);var m=e.completedBoundaries;for(l=0;l<m.length;l++)if(!ht(e,t,m[l])){e.destination=null;l++;m.splice(0,l);return}m.splice(0,l);var b=e.partialBoundaries;for(l=0;l<b.length;l++){var y=b[l];e:{o=e;u=t;var v=y.completedSegments;for(i=0;i<v.length;i++)if(!gt(o,u,y,v[i])){i++;v.splice(0,i);var S=!1;break e}v.splice(0,i);S=!0}if(!S){e.destination=null;l++;b.splice(0,l);return}}b.splice(0,l);var x=e.completedBoundaries;for(l=0;l<x.length;l++)if(!ht(e,t,x[l])){e.destination=null;l++;x.splice(0,l);return}x.splice(0,l)}finally{0===e.allPendingTasks&&0===e.pingedTasks.length&&0===e.clientRenderedBoundaries.length&&0===e.completedBoundaries.length&&t.push(null)}}function bt(e,t){try{var n=e.abortableTasks;n.forEach((function(n){return ut(n,e,t)}));n.clear();null!==e.destination&&mt(e,e.destination)}catch(t){Ye(e,t),Ke(e,t)}}function yt(){}function vt(e,t,n,r){var o=!1,l=null,u="",i={push:function(e){null!==e&&(u+=e);return!0},destroy:function(e){o=!0;l=e}},s=!1;e=Xe(e,$(n,t?t.identifierPrefix:void 0),{insertionMode:1,selectedValue:null},Infinity,yt,void 0,(function(){s=!0}),void 0,void 0);ct(e);bt(e,r);if(1===e.status)e.status=2,i.destroy(e.fatalError);else if(2!==e.status&&null===e.destination){e.destination=i;try{mt(e,i)}catch(t){Ye(e,t),Ke(e,t)}}if(o)throw l;if(!s)throw Error(a(426));return u}n.renderToNodeStream=function(){throw Error(a(207))};n.renderToStaticMarkup=function(e,t){return vt(e,t,!0,'The server used "renderToStaticMarkup" which does not support Suspense. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server')};n.renderToStaticNodeStream=function(){throw Error(a(208))};n.renderToString=function(e,t){return vt(e,t,!1,'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server')};n.version="18.2.0";var St={}; + /** + * @license React + * react-dom-server.browser.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var xt=e;function kt(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var wt=null,Ct=0;function Et(e,t){if(0!==t.length)if(512<t.length)0<Ct&&(e.enqueue(new Uint8Array(wt.buffer,0,Ct)),wt=new Uint8Array(512),Ct=0),e.enqueue(t);else{var n=wt.length-Ct;n<t.length&&(0===n?e.enqueue(wt):(wt.set(t.subarray(0,n),Ct),e.enqueue(wt),t=t.subarray(n)),wt=new Uint8Array(512),Ct=0);wt.set(t,Ct);Ct+=t.length}}function Ft(e,t){Et(e,t);return!0}function Tt(e){wt&&0<Ct&&(e.enqueue(new Uint8Array(wt.buffer,0,Ct)),wt=null,Ct=0)}var Rt=new TextEncoder;function _t(e){return Rt.encode(e)}function Pt(e){return Rt.encode(e)}function It(e,t){"function"===typeof e.error?e.error(t):e.close()}var Mt=Object.prototype.hasOwnProperty,Bt=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Dt={},zt={};function Nt(e){if(Mt.call(zt,e))return!0;if(Mt.call(Dt,e))return!1;if(Bt.test(e))return zt[e]=!0;Dt[e]=!0;return!1}function Vt(e,t,n,r,a,o,l){this.acceptsBooleans=2===t||3===t||4===t;this.attributeName=r;this.attributeNamespace=a;this.mustUseProperty=n;this.propertyName=e;this.type=t;this.sanitizeURL=o;this.removeEmptyString=l}var $t={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){$t[e]=new Vt(e,0,!1,e,null,!1,!1)}));[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];$t[t]=new Vt(t,1,!1,e[1],null,!1,!1)}));["contentEditable","draggable","spellCheck","value"].forEach((function(e){$t[e]=new Vt(e,2,!1,e.toLowerCase(),null,!1,!1)}));["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){$t[e]=new Vt(e,2,!1,e,null,!1,!1)}));"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){$t[e]=new Vt(e,3,!1,e.toLowerCase(),null,!1,!1)}));["checked","multiple","muted","selected"].forEach((function(e){$t[e]=new Vt(e,3,!0,e,null,!1,!1)}));["capture","download"].forEach((function(e){$t[e]=new Vt(e,4,!1,e,null,!1,!1)}));["cols","rows","size","span"].forEach((function(e){$t[e]=new Vt(e,6,!1,e,null,!1,!1)}));["rowSpan","start"].forEach((function(e){$t[e]=new Vt(e,5,!1,e.toLowerCase(),null,!1,!1)}));var Lt=/[\-:]([a-z])/g;function Ot(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(Lt,Ot);$t[t]=new Vt(t,1,!1,e,null,!1,!1)}));"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(Lt,Ot);$t[t]=new Vt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}));["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(Lt,Ot);$t[t]=new Vt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}));["tabIndex","crossOrigin"].forEach((function(e){$t[e]=new Vt(e,1,!1,e.toLowerCase(),null,!1,!1)}));$t.xlinkHref=new Vt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach((function(e){$t[e]=new Vt(e,1,!1,e.toLowerCase(),null,!0,!0)}));var At={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},jt=["Webkit","ms","Moz","O"];Object.keys(At).forEach((function(e){jt.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1);At[t]=At[e]}))}));var qt=/["'&<>]/;function Ht(e){if("boolean"===typeof e||"number"===typeof e)return""+e;e=""+e;var t=qt.exec(e);if(t){var n="",r,a=0;for(r=t.index;r<e.length;r++){switch(e.charCodeAt(r)){case 34:t=""";break;case 38:t="&";break;case 39:t="'";break;case 60:t="<";break;case 62:t=">";break;default:continue}a!==r&&(n+=e.substring(a,r));a=r+1;n+=t}e=a!==r?n+e.substring(a,r):n}return e}var Ut=/([A-Z])/g,Wt=/^ms-/,Zt=Array.isArray,Xt=Pt("<script>"),Gt=Pt("<\/script>"),Jt=Pt('<script src="'),Yt=Pt('<script type="module" src="'),Kt=Pt('" async=""><\/script>'),Qt=/(<\/|<)(s)(cript)/gi;function en(e,t,n,r){return""+t+("s"===n?"\\u0073":"\\u0053")+r}function tn(e,t,n,r,a){e=void 0===e?"":e;t=void 0===t?Xt:Pt('<script nonce="'+Ht(t)+'">');var o=[];void 0!==n&&o.push(t,_t((""+n).replace(Qt,en)),Gt);if(void 0!==r)for(n=0;n<r.length;n++)o.push(Jt,_t(Ht(r[n])),Kt);if(void 0!==a)for(r=0;r<a.length;r++)o.push(Yt,_t(Ht(a[r])),Kt);return{bootstrapChunks:o,startInlineScript:t,placeholderPrefix:Pt(e+"P:"),segmentPrefix:Pt(e+"S:"),boundaryPrefix:e+"B:",idPrefix:e,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1}}function nn(e,t){return{insertionMode:e,selectedValue:t}}function rn(e){return nn("http://www.w3.org/2000/svg"===e?2:"http://www.w3.org/1998/Math/MathML"===e?3:0,null)}function an(e,t,n){switch(t){case"select":return nn(1,null!=n.value?n.value:n.defaultValue);case"svg":return nn(2,null);case"math":return nn(3,null);case"foreignObject":return nn(1,null);case"table":return nn(4,null);case"thead":case"tbody":case"tfoot":return nn(5,null);case"colgroup":return nn(7,null);case"tr":return nn(6,null)}return 4<=e.insertionMode||0===e.insertionMode?nn(1,null):e}var on=Pt("\x3c!-- --\x3e");function ln(e,t,n,r){if(""===t)return r;r&&e.push(on);e.push(_t(Ht(t)));return!0}var un=new Map,sn=Pt(' style="'),cn=Pt(":"),dn=Pt(";");function fn(e,t,n){if("object"!==typeof n)throw Error(kt(62));t=!0;for(var r in n)if(Mt.call(n,r)){var a=n[r];if(null!=a&&"boolean"!==typeof a&&""!==a){if(0===r.indexOf("--")){var o=_t(Ht(r));a=_t(Ht((""+a).trim()))}else{o=r;var l=un.get(o);void 0!==l?o=l:(l=Pt(Ht(o.replace(Ut,"-$1").toLowerCase().replace(Wt,"-ms-"))),un.set(o,l),o=l);a="number"===typeof a?0===a||Mt.call(At,r)?_t(""+a):_t(a+"px"):_t(Ht((""+a).trim()))}t?(t=!1,e.push(sn,o,cn,a)):e.push(dn,o,cn,a)}}t||e.push(gn)}var pn=Pt(" "),hn=Pt('="'),gn=Pt('"'),mn=Pt('=""');function bn(e,t,n,r){switch(n){case"style":fn(e,t,r);return;case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":return}if(!(2<n.length)||"o"!==n[0]&&"O"!==n[0]||"n"!==n[1]&&"N"!==n[1])if(t=$t.hasOwnProperty(n)?$t[n]:null,null!==t){switch(typeof r){case"function":case"symbol":return;case"boolean":if(!t.acceptsBooleans)return}n=_t(t.attributeName);switch(t.type){case 3:r&&e.push(pn,n,mn);break;case 4:!0===r?e.push(pn,n,mn):!1!==r&&e.push(pn,n,hn,_t(Ht(r)),gn);break;case 5:isNaN(r)||e.push(pn,n,hn,_t(Ht(r)),gn);break;case 6:!isNaN(r)&&1<=r&&e.push(pn,n,hn,_t(Ht(r)),gn);break;default:t.sanitizeURL&&(r=""+r),e.push(pn,n,hn,_t(Ht(r)),gn)}}else if(Nt(n)){switch(typeof r){case"function":case"symbol":return;case"boolean":if(t=n.toLowerCase().slice(0,5),"data-"!==t&&"aria-"!==t)return}e.push(pn,_t(n),hn,_t(Ht(r)),gn)}}var yn=Pt(">"),vn=Pt("/>");function Sn(e,t,n){if(null!=t){if(null!=n)throw Error(kt(60));if("object"!==typeof t||!("__html"in t))throw Error(kt(61));t=t.__html;null!==t&&void 0!==t&&e.push(_t(""+t))}}function xn(e){var t="";xt.Children.forEach(e,(function(e){null!=e&&(t+=e)}));return t}var kn=Pt(' selected=""');function wn(e,t,n,r){e.push(Tn(n));var a=n=null,o;for(o in t)if(Mt.call(t,o)){var l=t[o];if(null!=l)switch(o){case"children":n=l;break;case"dangerouslySetInnerHTML":a=l;break;default:bn(e,r,o,l)}}e.push(yn);Sn(e,a,n);return"string"===typeof n?(e.push(_t(Ht(n))),null):n}var Cn=Pt("\n"),En=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Fn=new Map;function Tn(e){var t=Fn.get(e);if(void 0===t){if(!En.test(e))throw Error(kt(65,e));t=Pt("<"+e);Fn.set(e,t)}return t}var Rn=Pt("<!DOCTYPE html>");function _n(e,t,n,r,a){switch(t){case"select":e.push(Tn("select"));var o=null,l=null;for(c in n)if(Mt.call(n,c)){var u=n[c];if(null!=u)switch(c){case"children":o=u;break;case"dangerouslySetInnerHTML":l=u;break;case"defaultValue":case"value":break;default:bn(e,r,c,u)}}e.push(yn);Sn(e,l,o);return o;case"option":l=a.selectedValue;e.push(Tn("option"));var i=u=null,s=null;var c=null;for(o in n)if(Mt.call(n,o)){var d=n[o];if(null!=d)switch(o){case"children":u=d;break;case"selected":s=d;break;case"dangerouslySetInnerHTML":c=d;break;case"value":i=d;default:bn(e,r,o,d)}}if(null!=l)if(n=null!==i?""+i:xn(u),Zt(l))for(r=0;r<l.length;r++){if(""+l[r]===n){e.push(kn);break}}else""+l===n&&e.push(kn);else s&&e.push(kn);e.push(yn);Sn(e,c,u);return u;case"textarea":e.push(Tn("textarea"));c=l=o=null;for(u in n)if(Mt.call(n,u)&&(i=n[u],null!=i))switch(u){case"children":c=i;break;case"value":o=i;break;case"defaultValue":l=i;break;case"dangerouslySetInnerHTML":throw Error(kt(91));default:bn(e,r,u,i)}null===o&&null!==l&&(o=l);e.push(yn);if(null!=c){if(null!=o)throw Error(kt(92));if(Zt(c)&&1<c.length)throw Error(kt(93));o=""+c}"string"===typeof o&&"\n"===o[0]&&e.push(Cn);null!==o&&e.push(_t(Ht(""+o)));return null;case"input":e.push(Tn("input"));i=c=u=o=null;for(l in n)if(Mt.call(n,l)&&(s=n[l],null!=s))switch(l){case"children":case"dangerouslySetInnerHTML":throw Error(kt(399,"input"));case"defaultChecked":i=s;break;case"defaultValue":u=s;break;case"checked":c=s;break;case"value":o=s;break;default:bn(e,r,l,s)}null!==c?bn(e,r,"checked",c):null!==i&&bn(e,r,"checked",i);null!==o?bn(e,r,"value",o):null!==u&&bn(e,r,"value",u);e.push(vn);return null;case"menuitem":e.push(Tn("menuitem"));for(var f in n)if(Mt.call(n,f)&&(o=n[f],null!=o))switch(f){case"children":case"dangerouslySetInnerHTML":throw Error(kt(400));default:bn(e,r,f,o)}e.push(yn);return null;case"title":e.push(Tn("title"));o=null;for(d in n)if(Mt.call(n,d)&&(l=n[d],null!=l))switch(d){case"children":o=l;break;case"dangerouslySetInnerHTML":throw Error(kt(434));default:bn(e,r,d,l)}e.push(yn);return o;case"listing":case"pre":e.push(Tn(t));l=o=null;for(i in n)if(Mt.call(n,i)&&(u=n[i],null!=u))switch(i){case"children":o=u;break;case"dangerouslySetInnerHTML":l=u;break;default:bn(e,r,i,u)}e.push(yn);if(null!=l){if(null!=o)throw Error(kt(60));if("object"!==typeof l||!("__html"in l))throw Error(kt(61));n=l.__html;null!==n&&void 0!==n&&("string"===typeof n&&0<n.length&&"\n"===n[0]?e.push(Cn,_t(n)):e.push(_t(""+n)))}"string"===typeof o&&"\n"===o[0]&&e.push(Cn);return o;case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":e.push(Tn(t));for(var p in n)if(Mt.call(n,p)&&(o=n[p],null!=o))switch(p){case"children":case"dangerouslySetInnerHTML":throw Error(kt(399,t));default:bn(e,r,p,o)}e.push(vn);return null;case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return wn(e,n,t,r);case"html":return 0===a.insertionMode&&e.push(Rn),wn(e,n,t,r);default:if(-1===t.indexOf("-")&&"string"!==typeof n.is)return wn(e,n,t,r);e.push(Tn(t));l=o=null;for(s in n)if(Mt.call(n,s)&&(u=n[s],null!=u))switch(s){case"children":o=u;break;case"dangerouslySetInnerHTML":l=u;break;case"style":fn(e,r,u);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":break;default:Nt(s)&&"function"!==typeof u&&"symbol"!==typeof u&&e.push(pn,_t(s),hn,_t(Ht(u)),gn)}e.push(yn);Sn(e,l,o);return o}}var Pn=Pt("</"),In=Pt(">"),Mn=Pt('<template id="'),Bn=Pt('"></template>'),Dn=Pt("\x3c!--$--\x3e"),zn=Pt('\x3c!--$?--\x3e<template id="'),Nn=Pt('"></template>'),Vn=Pt("\x3c!--$!--\x3e"),$n=Pt("\x3c!--/$--\x3e"),Ln=Pt("<template"),On=Pt('"'),An=Pt(' data-dgst="');Pt(' data-msg="');Pt(' data-stck="');var jn=Pt("></template>");function qn(e,t,n){Et(e,zn);if(null===n)throw Error(kt(395));Et(e,n);return Ft(e,Nn)}var Hn=Pt('<div hidden id="'),Un=Pt('">'),Wn=Pt("</div>"),Zn=Pt('<svg aria-hidden="true" style="display:none" id="'),Xn=Pt('">'),Gn=Pt("</svg>"),Jn=Pt('<math aria-hidden="true" style="display:none" id="'),Yn=Pt('">'),Kn=Pt("</math>"),Qn=Pt('<table hidden id="'),er=Pt('">'),tr=Pt("</table>"),nr=Pt('<table hidden><tbody id="'),rr=Pt('">'),ar=Pt("</tbody></table>"),or=Pt('<table hidden><tr id="'),lr=Pt('">'),ur=Pt("</tr></table>"),ir=Pt('<table hidden><colgroup id="'),sr=Pt('">'),cr=Pt("</colgroup></table>");function dr(e,t,n,r){switch(n.insertionMode){case 0:case 1:return Et(e,Hn),Et(e,t.segmentPrefix),Et(e,_t(r.toString(16))),Ft(e,Un);case 2:return Et(e,Zn),Et(e,t.segmentPrefix),Et(e,_t(r.toString(16))),Ft(e,Xn);case 3:return Et(e,Jn),Et(e,t.segmentPrefix),Et(e,_t(r.toString(16))),Ft(e,Yn);case 4:return Et(e,Qn),Et(e,t.segmentPrefix),Et(e,_t(r.toString(16))),Ft(e,er);case 5:return Et(e,nr),Et(e,t.segmentPrefix),Et(e,_t(r.toString(16))),Ft(e,rr);case 6:return Et(e,or),Et(e,t.segmentPrefix),Et(e,_t(r.toString(16))),Ft(e,lr);case 7:return Et(e,ir),Et(e,t.segmentPrefix),Et(e,_t(r.toString(16))),Ft(e,sr);default:throw Error(kt(397))}}function fr(e,t){switch(t.insertionMode){case 0:case 1:return Ft(e,Wn);case 2:return Ft(e,Gn);case 3:return Ft(e,Kn);case 4:return Ft(e,tr);case 5:return Ft(e,ar);case 6:return Ft(e,ur);case 7:return Ft(e,cr);default:throw Error(kt(397))}}var pr=Pt('function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("'),hr=Pt('$RS("'),gr=Pt('","'),mr=Pt('")<\/script>'),br=Pt('function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("'),yr=Pt('$RC("'),vr=Pt('","'),Sr=Pt('")<\/script>'),xr=Pt('function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("'),kr=Pt('$RX("'),wr=Pt('"'),Cr=Pt(")<\/script>"),Er=Pt(","),Fr=/[<\u2028\u2029]/g;function Tr(e){return JSON.stringify(e).replace(Fr,(function(e){switch(e){case"<":return"\\u003c";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React")}}))}var Rr=Object.assign,_r=Symbol.for("react.element"),Pr=Symbol.for("react.portal"),Ir=Symbol.for("react.fragment"),Mr=Symbol.for("react.strict_mode"),Br=Symbol.for("react.profiler"),Dr=Symbol.for("react.provider"),zr=Symbol.for("react.context"),Nr=Symbol.for("react.forward_ref"),Vr=Symbol.for("react.suspense"),$r=Symbol.for("react.suspense_list"),Lr=Symbol.for("react.memo"),Or=Symbol.for("react.lazy"),Ar=Symbol.for("react.scope"),jr=Symbol.for("react.debug_trace_mode"),qr=Symbol.for("react.legacy_hidden"),Hr=Symbol.for("react.default_value"),Ur=Symbol.iterator;function Wr(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case Ir:return"Fragment";case Pr:return"Portal";case Br:return"Profiler";case Mr:return"StrictMode";case Vr:return"Suspense";case $r:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case zr:return(e.displayName||"Context")+".Consumer";case Dr:return(e._context.displayName||"Context")+".Provider";case Nr:var t=e.render;e=e.displayName;e||(e=t.displayName||t.name||"",e=""!==e?"ForwardRef("+e+")":"ForwardRef");return e;case Lr:return t=e.displayName||null,null!==t?t:Wr(e.type)||"Memo";case Or:t=e._payload;e=e._init;try{return Wr(e(t))}catch(e){}}return null}var Zr={};function Xr(e,t){e=e.contextTypes;if(!e)return Zr;var n={},r;for(r in e)n[r]=t[r];return n}var Gr=null;function Jr(e,t){if(e!==t){e.context._currentValue=e.parentValue;e=e.parent;var n=t.parent;if(null===e){if(null!==n)throw Error(kt(401))}else{if(null===n)throw Error(kt(401));Jr(e,n)}t.context._currentValue=t.value}}function Yr(e){e.context._currentValue=e.parentValue;e=e.parent;null!==e&&Yr(e)}function Kr(e){var t=e.parent;null!==t&&Kr(t);e.context._currentValue=e.value}function Qr(e,t){e.context._currentValue=e.parentValue;e=e.parent;if(null===e)throw Error(kt(402));e.depth===t.depth?Jr(e,t):Qr(e,t)}function ea(e,t){var n=t.parent;if(null===n)throw Error(kt(402));e.depth===n.depth?Jr(e,n):ea(e,n);t.context._currentValue=t.value}function ta(e){var t=Gr;t!==e&&(null===t?Kr(e):null===e?Yr(t):t.depth===e.depth?Jr(t,e):t.depth>e.depth?Qr(t,e):ea(t,e),Gr=e)}var na={isMounted:function(){return!1},enqueueSetState:function(e,t){e=e._reactInternals;null!==e.queue&&e.queue.push(t)},enqueueReplaceState:function(e,t){e=e._reactInternals;e.replace=!0;e.queue=[t]},enqueueForceUpdate:function(){}};function ra(e,t,n,r){var a=void 0!==e.state?e.state:null;e.updater=na;e.props=n;e.state=a;var o={queue:[],replace:!1};e._reactInternals=o;var l=t.contextType;e.context="object"===typeof l&&null!==l?l._currentValue:r;l=t.getDerivedStateFromProps;"function"===typeof l&&(l=l(n,a),a=null===l||void 0===l?a:Rr({},a,l),e.state=a);if("function"!==typeof t.getDerivedStateFromProps&&"function"!==typeof e.getSnapshotBeforeUpdate&&("function"===typeof e.UNSAFE_componentWillMount||"function"===typeof e.componentWillMount))if(t=e.state,"function"===typeof e.componentWillMount&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),t!==e.state&&na.enqueueReplaceState(e,e.state,null),null!==o.queue&&0<o.queue.length)if(t=o.queue,l=o.replace,o.queue=null,o.replace=!1,l&&1===t.length)e.state=t[0];else{o=l?t[0]:e.state;a=!0;for(l=l?1:0;l<t.length;l++){var u=t[l];u="function"===typeof u?u.call(e,o,n,r):u;null!=u&&(a?(a=!1,o=Rr({},o,u)):Rr(o,u))}e.state=o}else o.queue=null}var aa={id:1,overflow:""};function oa(e,t,n){var r=e.id;e=e.overflow;var a=32-la(r)-1;r&=~(1<<a);n+=1;var o=32-la(t)+a;if(30<o){var l=a-a%5;o=(r&(1<<l)-1).toString(32);r>>=l;a-=l;return{id:1<<32-la(t)+a|n<<a|r,overflow:o+e}}return{id:1<<o|n<<a|r,overflow:e}}var la=Math.clz32?Math.clz32:sa,ua=Math.log,ia=Math.LN2;function sa(e){e>>>=0;return 0===e?32:31-(ua(e)/ia|0)|0}function ca(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t}var da="function"===typeof Object.is?Object.is:ca,fa=null,pa=null,ha=null,ga=null,ma=!1,ba=!1,ya=0,va=null,Sa=0;function xa(){if(null===fa)throw Error(kt(321));return fa}function ka(){if(0<Sa)throw Error(kt(312));return{memoizedState:null,queue:null,next:null}}function wa(){null===ga?null===ha?(ma=!1,ha=ga=ka()):(ma=!0,ga=ha):null===ga.next?(ma=!1,ga=ga.next=ka()):(ma=!0,ga=ga.next);return ga}function Ca(){pa=fa=null;ba=!1;ha=null;Sa=0;ga=va=null}function Ea(e,t){return"function"===typeof t?t(e):t}function Fa(e,t,n){fa=xa();ga=wa();if(ma){var r=ga.queue;t=r.dispatch;if(null!==va&&(n=va.get(r),void 0!==n)){va.delete(r);r=ga.memoizedState;do{r=e(r,n.action),n=n.next}while(null!==n);ga.memoizedState=r;return[r,t]}return[ga.memoizedState,t]}e=e===Ea?"function"===typeof t?t():t:void 0!==n?n(t):t;ga.memoizedState=e;e=ga.queue={last:null,dispatch:null};e=e.dispatch=Ra.bind(null,fa,e);return[ga.memoizedState,e]}function Ta(e,t){fa=xa();ga=wa();t=void 0===t?null:t;if(null!==ga){var n=ga.memoizedState;if(null!==n&&null!==t){var r=n[1];e:if(null===r)r=!1;else{for(var a=0;a<r.length&&a<t.length;a++)if(!da(t[a],r[a])){r=!1;break e}r=!0}if(r)return n[0]}}e=e();ga.memoizedState=[e,t];return e}function Ra(e,t,n){if(25<=Sa)throw Error(kt(301));if(e===fa)if(ba=!0,e={action:n,next:null},null===va&&(va=new Map),n=va.get(t),void 0===n)va.set(t,e);else{for(t=n;null!==t.next;)t=t.next;t.next=e}}function _a(){throw Error(kt(394))}function Pa(){}var Ia={readContext:function(e){return e._currentValue},useContext:function(e){xa();return e._currentValue},useMemo:Ta,useReducer:Fa,useRef:function(e){fa=xa();ga=wa();var t=ga.memoizedState;return null===t?(e={current:e},ga.memoizedState=e):t},useState:function(e){return Fa(Ea,e)},useInsertionEffect:Pa,useLayoutEffect:function(){},useCallback:function(e,t){return Ta((function(){return e}),t)},useImperativeHandle:Pa,useEffect:Pa,useDebugValue:Pa,useDeferredValue:function(e){xa();return e},useTransition:function(){xa();return[!1,_a]},useId:function(){var e=pa.treeContext;var t=e.overflow;e=e.id;e=(e&~(1<<32-la(e)-1)).toString(32)+t;var n=Ma;if(null===n)throw Error(kt(404));t=ya++;e=":"+n.idPrefix+"R"+e;0<t&&(e+="H"+t.toString(32));return e+":"},useMutableSource:function(e,t){xa();return t(e._source)},useSyncExternalStore:function(e,t,n){if(void 0===n)throw Error(kt(407));return n()}},Ma=null,Ba=xt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;function Da(e){console.error(e);return null}function za(){}function Na(e,t,n,r,a,o,l,u,i){var s=[],c=new Set;t={destination:null,responseState:t,progressiveChunkSize:void 0===r?12800:r,status:0,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:c,pingedTasks:s,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:void 0===a?Da:a,onAllReady:void 0===o?za:o,onShellReady:void 0===l?za:l,onShellError:void 0===u?za:u,onFatalError:void 0===i?za:i};n=$a(t,0,null,n,!1,!1);n.parentFlushed=!0;e=Va(t,e,null,n,c,Zr,null,aa);s.push(e);return t}function Va(e,t,n,r,a,o,l,u){e.allPendingTasks++;null===n?e.pendingRootTasks++:n.pendingTasks++;var i={node:t,ping:function(){var t=e.pingedTasks;t.push(i);1===t.length&&Ka(e)},blockedBoundary:n,blockedSegment:r,abortSet:a,legacyContext:o,context:l,treeContext:u};a.add(i);return i}function $a(e,t,n,r,a,o){return{status:0,id:-1,index:t,parentFlushed:!1,chunks:[],children:[],formatContext:r,boundary:n,lastPushedText:a,textEmbedded:o}}function La(e,t){e=e.onError(t);if(null!=e&&"string"!==typeof e)throw Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof e+'" instead');return e}function Oa(e,t){var n=e.onShellError;n(t);n=e.onFatalError;n(t);null!==e.destination?(e.status=2,It(e.destination,t)):(e.status=1,e.fatalError=t)}function Aa(e,t,n,r,a){fa={};pa=t;ya=0;for(e=n(r,a);ba;)ba=!1,ya=0,Sa+=1,ga=null,e=n(r,a);Ca();return e}function ja(e,t,n,r){var a=n.render(),o=r.childContextTypes;if(null!==o&&void 0!==o){var l=t.legacyContext;if("function"!==typeof n.getChildContext)r=l;else{n=n.getChildContext();for(var u in n)if(!(u in o))throw Error(kt(108,Wr(r)||"Unknown",u));r=Rr({},l,n)}t.legacyContext=r;Ua(e,t,a);t.legacyContext=l}else Ua(e,t,a)}function qa(e,t){if(e&&e.defaultProps){t=Rr({},t);e=e.defaultProps;for(var n in e)void 0===t[n]&&(t[n]=e[n]);return t}return t}function Ha(e,t,n,r,a){if("function"===typeof n)if(n.prototype&&n.prototype.isReactComponent){a=Xr(n,t.legacyContext);var o=n.contextType;o=new n(r,"object"===typeof o&&null!==o?o._currentValue:a);ra(o,n,r,a);ja(e,t,o,n)}else{o=Xr(n,t.legacyContext);a=Aa(e,t,n,r,o);var l=0!==ya;if("object"===typeof a&&null!==a&&"function"===typeof a.render&&void 0===a.$$typeof)ra(a,n,r,o),ja(e,t,a,n);else if(l){r=t.treeContext;t.treeContext=oa(r,1,0);try{Ua(e,t,a)}finally{t.treeContext=r}}else Ua(e,t,a)}else if("string"===typeof n){a=t.blockedSegment;o=_n(a.chunks,n,r,e.responseState,a.formatContext);a.lastPushedText=!1;l=a.formatContext;a.formatContext=an(l,n,r);Za(e,t,o);a.formatContext=l;switch(n){case"area":case"base":case"br":case"col":case"embed":case"hr":case"img":case"input":case"keygen":case"link":case"meta":case"param":case"source":case"track":case"wbr":break;default:a.chunks.push(Pn,_t(n),In)}a.lastPushedText=!1}else{switch(n){case qr:case jr:case Mr:case Br:case Ir:Ua(e,t,r.children);return;case $r:Ua(e,t,r.children);return;case Ar:throw Error(kt(343));case Vr:e:{n=t.blockedBoundary;a=t.blockedSegment;o=r.fallback;r=r.children;l=new Set;var u={id:null,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:l,errorDigest:null},i=$a(e,a.chunks.length,u,a.formatContext,!1,!1);a.children.push(i);a.lastPushedText=!1;var s=$a(e,0,null,a.formatContext,!1,!1);s.parentFlushed=!0;t.blockedBoundary=u;t.blockedSegment=s;try{if(Za(e,t,r),s.lastPushedText&&s.textEmbedded&&s.chunks.push(on),s.status=1,Ja(u,s),0===u.pendingTasks)break e}catch(t){s.status=4,u.forceClientRender=!0,u.errorDigest=La(e,t)}finally{t.blockedBoundary=n,t.blockedSegment=a}t=Va(e,o,n,i,l,t.legacyContext,t.context,t.treeContext);e.pingedTasks.push(t)}return}if("object"===typeof n&&null!==n)switch(n.$$typeof){case Nr:r=Aa(e,t,n.render,r,a);if(0!==ya){n=t.treeContext;t.treeContext=oa(n,1,0);try{Ua(e,t,r)}finally{t.treeContext=n}}else Ua(e,t,r);return;case Lr:n=n.type;r=qa(n,r);Ha(e,t,n,r,a);return;case Dr:a=r.children;n=n._context;r=r.value;o=n._currentValue;n._currentValue=r;l=Gr;Gr=r={parent:l,depth:null===l?0:l.depth+1,context:n,parentValue:o,value:r};t.context=r;Ua(e,t,a);e=Gr;if(null===e)throw Error(kt(403));r=e.parentValue;e.context._currentValue=r===Hr?e.context._defaultValue:r;e=Gr=e.parent;t.context=e;return;case zr:r=r.children;r=r(n._currentValue);Ua(e,t,r);return;case Or:a=n._init;n=a(n._payload);r=qa(n,r);Ha(e,t,n,r,void 0);return}throw Error(kt(130,null==n?n:typeof n,""))}}function Ua(e,t,n){t.node=n;if("object"===typeof n&&null!==n){switch(n.$$typeof){case _r:Ha(e,t,n.type,n.props,n.ref);return;case Pr:throw Error(kt(257));case Or:var r=n._init;n=r(n._payload);Ua(e,t,n);return}if(Zt(n)){Wa(e,t,n);return}null===n||"object"!==typeof n?r=null:(r=Ur&&n[Ur]||n["@@iterator"],r="function"===typeof r?r:null);if(r&&(r=r.call(n))){n=r.next();if(!n.done){var a=[];do{a.push(n.value),n=r.next()}while(!n.done);Wa(e,t,a)}return}e=Object.prototype.toString.call(n);throw Error(kt(31,"[object Object]"===e?"object with keys {"+Object.keys(n).join(", ")+"}":e))}"string"===typeof n?(r=t.blockedSegment,r.lastPushedText=ln(t.blockedSegment.chunks,n,e.responseState,r.lastPushedText)):"number"===typeof n&&(r=t.blockedSegment,r.lastPushedText=ln(t.blockedSegment.chunks,""+n,e.responseState,r.lastPushedText))}function Wa(e,t,n){for(var r=n.length,a=0;a<r;a++){var o=t.treeContext;t.treeContext=oa(o,r,a);try{Za(e,t,n[a])}finally{t.treeContext=o}}}function Za(e,t,n){var r=t.blockedSegment.formatContext,a=t.legacyContext,o=t.context;try{return Ua(e,t,n)}catch(i){if(Ca(),"object"===typeof i&&null!==i&&"function"===typeof i.then){n=i;var l=t.blockedSegment,u=$a(e,l.chunks.length,null,l.formatContext,l.lastPushedText,!0);l.children.push(u);l.lastPushedText=!1;e=Va(e,t.node,t.blockedBoundary,u,t.abortSet,t.legacyContext,t.context,t.treeContext).ping;n.then(e,e);t.blockedSegment.formatContext=r;t.legacyContext=a;t.context=o;ta(o)}else throw t.blockedSegment.formatContext=r,t.legacyContext=a,t.context=o,ta(o),i}}function Xa(e){var t=e.blockedBoundary;e=e.blockedSegment;e.status=3;Ya(this,t,e)}function Ga(e,t,n){var r=e.blockedBoundary;e.blockedSegment.status=3;null===r?(t.allPendingTasks--,2!==t.status&&(t.status=2,null!==t.destination&&t.destination.close())):(r.pendingTasks--,r.forceClientRender||(r.forceClientRender=!0,e=void 0===n?Error(kt(432)):n,r.errorDigest=t.onError(e),r.parentFlushed&&t.clientRenderedBoundaries.push(r)),r.fallbackAbortableTasks.forEach((function(e){return Ga(e,t,n)})),r.fallbackAbortableTasks.clear(),t.allPendingTasks--,0===t.allPendingTasks&&(r=t.onAllReady,r()))}function Ja(e,t){if(0===t.chunks.length&&1===t.children.length&&null===t.children[0].boundary){var n=t.children[0];n.id=t.id;n.parentFlushed=!0;1===n.status&&Ja(e,n)}else e.completedSegments.push(t)}function Ya(e,t,n){if(null===t){if(n.parentFlushed){if(null!==e.completedRootSegment)throw Error(kt(389));e.completedRootSegment=n}e.pendingRootTasks--;0===e.pendingRootTasks&&(e.onShellError=za,t=e.onShellReady,t())}else t.pendingTasks--,t.forceClientRender||(0===t.pendingTasks?(n.parentFlushed&&1===n.status&&Ja(t,n),t.parentFlushed&&e.completedBoundaries.push(t),t.fallbackAbortableTasks.forEach(Xa,e),t.fallbackAbortableTasks.clear()):n.parentFlushed&&1===n.status&&(Ja(t,n),1===t.completedSegments.length&&t.parentFlushed&&e.partialBoundaries.push(t)));e.allPendingTasks--;0===e.allPendingTasks&&(e=e.onAllReady,e())}function Ka(e){if(2!==e.status){var t=Gr,n=Ba.current;Ba.current=Ia;var r=Ma;Ma=e.responseState;try{var a=e.pingedTasks,o;for(o=0;o<a.length;o++){var l=a[o];var u=e,i=l.blockedSegment;if(0===i.status){ta(l.context);try{Ua(u,l,l.node),i.lastPushedText&&i.textEmbedded&&i.chunks.push(on),l.abortSet.delete(l),i.status=1,Ya(u,l.blockedBoundary,i)}catch(e){if(Ca(),"object"===typeof e&&null!==e&&"function"===typeof e.then){var s=l.ping;e.then(s,s)}else{l.abortSet.delete(l);i.status=4;var c=l.blockedBoundary,d=e,f=La(u,d);null===c?Oa(u,d):(c.pendingTasks--,c.forceClientRender||(c.forceClientRender=!0,c.errorDigest=f,c.parentFlushed&&u.clientRenderedBoundaries.push(c)));u.allPendingTasks--;if(0===u.allPendingTasks){var p=u.onAllReady;p()}}}finally{}}}a.splice(0,o);null!==e.destination&&ao(e,e.destination)}catch(t){La(e,t),Oa(e,t)}finally{Ma=r,Ba.current=n,n===Ia&&ta(t)}}}function Qa(e,t,n){n.parentFlushed=!0;switch(n.status){case 0:var r=n.id=e.nextSegmentId++;n.lastPushedText=!1;n.textEmbedded=!1;e=e.responseState;Et(t,Mn);Et(t,e.placeholderPrefix);e=_t(r.toString(16));Et(t,e);return Ft(t,Bn);case 1:n.status=2;var a=!0;r=n.chunks;var o=0;n=n.children;for(var l=0;l<n.length;l++){for(a=n[l];o<a.index;o++)Et(t,r[o]);a=eo(e,t,a)}for(;o<r.length-1;o++)Et(t,r[o]);o<r.length&&(a=Ft(t,r[o]));return a;default:throw Error(kt(390))}}function eo(e,t,n){var r=n.boundary;if(null===r)return Qa(e,t,n);r.parentFlushed=!0;if(r.forceClientRender)r=r.errorDigest,Ft(t,Vn),Et(t,Ln),r&&(Et(t,An),Et(t,_t(Ht(r))),Et(t,On)),Ft(t,jn),Qa(e,t,n);else if(0<r.pendingTasks){r.rootSegmentID=e.nextSegmentId++;0<r.completedSegments.length&&e.partialBoundaries.push(r);var a=e.responseState;var o=a.nextSuspenseID++;a=Pt(a.boundaryPrefix+o.toString(16));r=r.id=a;qn(t,e.responseState,r);Qa(e,t,n)}else if(r.byteSize>e.progressiveChunkSize)r.rootSegmentID=e.nextSegmentId++,e.completedBoundaries.push(r),qn(t,e.responseState,r.id),Qa(e,t,n);else{Ft(t,Dn);n=r.completedSegments;if(1!==n.length)throw Error(kt(391));eo(e,t,n[0])}return Ft(t,$n)}function to(e,t,n){dr(t,e.responseState,n.formatContext,n.id);eo(e,t,n);return fr(t,n.formatContext)}function no(e,t,n){for(var r=n.completedSegments,a=0;a<r.length;a++)ro(e,t,n,r[a]);r.length=0;e=e.responseState;r=n.id;n=n.rootSegmentID;Et(t,e.startInlineScript);e.sentCompleteBoundaryFunction?Et(t,yr):(e.sentCompleteBoundaryFunction=!0,Et(t,br));if(null===r)throw Error(kt(395));n=_t(n.toString(16));Et(t,r);Et(t,vr);Et(t,e.segmentPrefix);Et(t,n);return Ft(t,Sr)}function ro(e,t,n,r){if(2===r.status)return!0;var a=r.id;if(-1===a){if(-1===(r.id=n.rootSegmentID))throw Error(kt(392));return to(e,t,r)}to(e,t,r);e=e.responseState;Et(t,e.startInlineScript);e.sentCompleteSegmentFunction?Et(t,hr):(e.sentCompleteSegmentFunction=!0,Et(t,pr));Et(t,e.segmentPrefix);a=_t(a.toString(16));Et(t,a);Et(t,gr);Et(t,e.placeholderPrefix);Et(t,a);return Ft(t,mr)}function ao(e,t){wt=new Uint8Array(512);Ct=0;try{var n=e.completedRootSegment;if(null!==n&&0===e.pendingRootTasks){eo(e,t,n);e.completedRootSegment=null;var r=e.responseState.bootstrapChunks;for(n=0;n<r.length-1;n++)Et(t,r[n]);n<r.length&&Ft(t,r[n])}var a=e.clientRenderedBoundaries,o;for(o=0;o<a.length;o++){var l=a[o];r=t;var u=e.responseState,i=l.id,s=l.errorDigest,c=l.errorMessage,d=l.errorComponentStack;Et(r,u.startInlineScript);u.sentClientRenderFunction?Et(r,kr):(u.sentClientRenderFunction=!0,Et(r,xr));if(null===i)throw Error(kt(395));Et(r,i);Et(r,wr);if(s||c||d)Et(r,Er),Et(r,_t(Tr(s||"")));if(c||d)Et(r,Er),Et(r,_t(Tr(c||"")));d&&(Et(r,Er),Et(r,_t(Tr(d))));if(!Ft(r,Cr));}a.splice(0,o);var f=e.completedBoundaries;for(o=0;o<f.length;o++)if(!no(e,t,f[o]));f.splice(0,o);Tt(t);wt=new Uint8Array(512);Ct=0;var p=e.partialBoundaries;for(o=0;o<p.length;o++){var h=p[o];e:{a=e;l=t;var g=h.completedSegments;for(u=0;u<g.length;u++)if(!ro(a,l,h,g[u])){u++;g.splice(0,u);var m=!1;break e}g.splice(0,u);m=!0}if(!m){e.destination=null;o++;p.splice(0,o);return}}p.splice(0,o);var b=e.completedBoundaries;for(o=0;o<b.length;o++)if(!no(e,t,b[o]));b.splice(0,o)}finally{Tt(t),0===e.allPendingTasks&&0===e.pingedTasks.length&&0===e.clientRenderedBoundaries.length&&0===e.completedBoundaries.length&&t.close()}}function oo(e,t){try{var n=e.abortableTasks;n.forEach((function(n){return Ga(n,e,t)}));n.clear();null!==e.destination&&ao(e,e.destination)}catch(t){La(e,t),Oa(e,t)}}St.renderToReadableStream=function(e,t){return new Promise((function(n,r){var a,o,l=new Promise((function(e,t){o=e;a=t})),u=Na(e,tn(t?t.identifierPrefix:void 0,t?t.nonce:void 0,t?t.bootstrapScriptContent:void 0,t?t.bootstrapScripts:void 0,t?t.bootstrapModules:void 0),rn(t?t.namespaceURI:void 0),t?t.progressiveChunkSize:void 0,t?t.onError:void 0,o,(function(){var e=new ReadableStream({type:"bytes",pull:function(e){if(1===u.status)u.status=2,It(e,u.fatalError);else if(2!==u.status&&null===u.destination){u.destination=e;try{ao(u,e)}catch(e){La(u,e),Oa(u,e)}}},cancel:function(){oo(u)}},{highWaterMark:0});e.allReady=l;n(e)}),(function(e){l.catch((function(){}));r(e)}),a);if(t&&t.signal){var i=t.signal,s=function(){oo(u,i.reason);i.removeEventListener("abort",s)};i.addEventListener("abort",s)}Ka(u)}))};St.version="18.2.0";var lo,uo;{lo=n;uo=St}var io=t.version=lo.version;var so=t.renderToString=lo.renderToString;var co=t.renderToStaticMarkup=lo.renderToStaticMarkup;var fo=t.renderToNodeStream=lo.renderToNodeStream;var po=t.renderToStaticNodeStream=lo.renderToStaticNodeStream;var ho=t.renderToReadableStream=uo.renderToReadableStream;export{t as default,fo as renderToNodeStream,ho as renderToReadableStream,co as renderToStaticMarkup,po as renderToStaticNodeStream,so as renderToString,io as version}; + //# sourceMappingURL=/sm/f158dae081869dc0b4b56da0499296d11a57911a285a67d83fb8829937dd2258.map
\ No newline at end of file diff --git a/cli/diagnostics.rs b/cli/diagnostics.rs index 615a13225..7af64d843 100644 --- a/cli/diagnostics.rs +++ b/cli/diagnostics.rs @@ -63,6 +63,11 @@ const UNSTABLE_DENO_PROPS: &[&str] = &[ "spawnSync", "ChildStatus", "SpawnOutput", + "serve", + "serveTls", + "ServeInit", + "ServeTlsInit", + "Handler", ]; static MSG_MISSING_PROPERTY_DENO: Lazy<Regex> = Lazy::new(|| { diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts index 7cc6a9e60..8de2ecf70 100644 --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -1211,12 +1211,144 @@ declare namespace Deno { */ export function unrefTimer(id: number): void; - /** **UNSTABLE**: new API, yet to be vetted. + /** + * A handler for HTTP requests. Consumes a request and returns a response. + * + * Handler allows `void` or `Promise<void>` return type to enable + * request upgrades using `Deno.upgradeHttp()` API. It is callers responsibility + * to write response manually to the returned connection. Failing to do so + * (or not returning a response without an upgrade) will cause the connection + * to hang. + * + * If a handler throws, the server calling the handler will assume the impact + * of the error is isolated to the individual request. It will catch the error + * and close the underlying connection. + * + * @category HTTP Server + */ + export type ServeHandler = ( + request: Request, + ) => Response | Promise<Response> | void | Promise<void>; + + /** + * @category HTTP Server + */ + export interface ServeInit extends Partial<Deno.ListenOptions> { + /** An AbortSignal to close the server and all connections. */ + signal?: AbortSignal; + + /** The handler to invoke when route handlers throw an error. */ + onError?: (error: unknown) => Response | Promise<Response>; + + /** The callback which is called when the server started listening */ + onListen?: (params: { hostname: string; port: number }) => void; + } + + /** + * @category HTTP Server + */ + export interface ServeTlsInit extends ServeInit { + /** Server private key in PEM format */ + cert: string; + + /** Cert chain in PEM format */ + key: string; + } + + /** Serves HTTP requests with the given handler. + * + * You can specify an object with a port and hostname option, which is the + * address to listen on. The default is port 9000 on hostname "127.0.0.1". + * + * The below example serves with the port 9000. + * + * ```ts + * Deno.serve((_req) => new Response("Hello, world")); + * ``` + * + * You can change the listening address by the `hostname` and `port` options. + * The below example serves with the port 3000. + * + * ```ts + * Deno.serve((_req) => new Response("Hello, world"), { port: 3000 }); + * ``` + * + * `Deno.serve` function prints the message `Listening on http://<hostname>:<port>/` + * on start-up by default. If you like to change this message, you can specify + * `onListen` option to override it. + * + * ```ts + * Deno.serve((_req) => new Response("Hello, world"), { + * onListen({ port, hostname }) { + * console.log(`Server started at http://${hostname}:${port}`); + * // ... more info specific to your server .. + * }, + * }); + * ``` + * + * @param handler The handler for individual HTTP requests. + * @param options The options. See `ServeInit` documentation for details. + * + * @category HTTP Server + */ + export function serve( + handler: ServeHandler, + options?: ServeInit, + ): Promise<void>; + + /** Serves HTTPS requests with the given handler. + * + * You must specify `key` and `cert` options. + * + * You can specify an object with a port and hostname option, which is the + * address to listen on. The default is port 9000 on hostname "127.0.0.1". + * + * The below example serves with the default port 8443. + * + * ```ts + * const cert = "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n"; + * const key = "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"; + * Deno.serveTls((_req) => new Response("Hello, world"), { cert, key }); + * + * ``` + * + * `Deno.serveTls` function prints the message `Listening on https://<hostname>:<port>/` + * on start-up by default. If you like to change this message, you can specify + * `onListen` option to override it. + * + * ```ts + * const cert = "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n"; + * const key = "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"; + * Deno.serveTls((_req) => new Response("Hello, world"), { + * cert, + * key, + * onListen({ port, hostname }) { + * console.log(`Server started at https://${hostname}:${port}`); + * // ... more info specific to your server .. + * }, + * }); + * ``` + * + * @param handler The handler for individual HTTPS requests. + * @param options The options. See `ServeTlsInit` documentation for details. + * + * @category HTTP Server + */ + export function serveTls( + handler: ServeHandler, + options?: ServeTlsInit, + ): Promise<void>; + + /** **UNSTABLE**: new API, yet to be vetter. * * Allows to "hijack" a connection that the request is associated with. * Can be used to implement protocols that build on top of HTTP (eg. * WebSockets). * + * The return type depends if `request` is coming from `Deno.serve()` API + * or `Deno.serveHttp()`; for former it returns the connection and first + * packet, for latter it returns a promise. + * * The returned promise returns underlying connection and first packet * received. The promise shouldn't be awaited before responding to the * `request`, otherwise event loop might deadlock. @@ -1225,7 +1357,7 @@ declare namespace Deno { */ export function upgradeHttp( request: Request, - ): Promise<[Deno.Conn, Uint8Array]>; + ): [Deno.Conn, Uint8Array] | Promise<[Deno.Conn, Uint8Array]>; /** @category Sub Process */ export interface SpawnOptions { diff --git a/cli/tests/unit/flash_test.ts b/cli/tests/unit/flash_test.ts new file mode 100644 index 000000000..57138b14f --- /dev/null +++ b/cli/tests/unit/flash_test.ts @@ -0,0 +1,1981 @@ +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. + +// deno-lint-ignore-file + +import { + Buffer, + BufReader, + BufWriter, +} from "../../../test_util/std/io/buffer.ts"; +import { TextProtoReader } from "../../../test_util/std/textproto/mod.ts"; +import { + assert, + assertEquals, + assertRejects, + assertStrictEquals, + assertThrows, + Deferred, + deferred, + delay, + fail, +} from "./test_util.ts"; + +function createOnErrorCb(ac: AbortController): (err: unknown) => Response { + return (err) => { + console.error(err); + ac.abort(); + return new Response("Internal server error", { status: 500 }); + }; +} + +function onListen<T>( + p: Deferred<T>, +): ({ hostname, port }: { hostname: string; port: number }) => void { + return () => { + p.resolve(); + }; +} + +Deno.test({ permissions: { net: true } }, async function httpServerBasic() { + const ac = new AbortController(); + const promise = deferred(); + const listeningPromise = deferred(); + + const server = Deno.serve(async (request) => { + // FIXME(bartlomieju): + // make sure that request can be inspected + console.log(request); + assertEquals(new URL(request.url).href, "http://127.0.0.1:4501/"); + assertEquals(await request.text(), ""); + promise.resolve(); + return new Response("Hello World", { headers: { "foo": "bar" } }); + }, { + port: 4501, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const resp = await fetch("http://127.0.0.1:4501/", { + headers: { "connection": "close" }, + }); + await promise; + const clone = resp.clone(); + const text = await resp.text(); + assertEquals(text, "Hello World"); + assertEquals(resp.headers.get("foo"), "bar"); + const cloneText = await clone.text(); + assertEquals(cloneText, "Hello World"); + ac.abort(); + await server; +}); + +// https://github.com/denoland/deno/issues/15107 +Deno.test( + { permissions: { net: true } }, + async function httpLazyHeadersIssue15107() { + const promise = deferred(); + const listeningPromise = deferred(); + const ac = new AbortController(); + + let headers: Headers; + const server = Deno.serve(async (request) => { + await request.text(); + headers = request.headers; + promise.resolve(); + return new Response(""); + }, { + port: 2333, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 2333 }); + // Send GET request with a body + content-length. + const encoder = new TextEncoder(); + const body = + `GET / HTTP/1.1\r\nHost: 127.0.0.1:2333\r\nContent-Length: 5\r\n\r\n12345`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + await promise; + conn.close(); + assertEquals(headers!.get("content-length"), "5"); + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true } }, + async function httpReadHeadersAfterClose() { + const promise = deferred(); + const ac = new AbortController(); + const listeningPromise = deferred(); + + let req: Request; + const server = Deno.serve(async (request) => { + await request.text(); + req = request; + promise.resolve(); + return new Response("Hello World"); + }, { + port: 2334, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 2334 }); + // Send GET request with a body + content-length. + const encoder = new TextEncoder(); + const body = + `GET / HTTP/1.1\r\nHost: 127.0.0.1:2333\r\nContent-Length: 5\r\n\r\n12345`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + await promise; + conn.close(); + + assertThrows( + () => { + req.headers; + }, + TypeError, + "request closed", + ); + + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true } }, + async function httpServerGetRequestBody() { + const promise = deferred(); + const ac = new AbortController(); + const listeningPromise = deferred(); + + const server = Deno.serve((request) => { + assertEquals(request.body, null); + promise.resolve(); + return new Response("", { headers: {} }); + }, { + port: 4501, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 4501 }); + // Send GET request with a body + content-length. + const encoder = new TextEncoder(); + const body = + `GET / HTTP/1.1\r\nHost: 127.0.0.1:4501\r\nContent-Length: 5\r\n\r\n12345`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + + const resp = new Uint8Array(200); + const readResult = await conn.read(resp); + assert(readResult); + assert(readResult > 0); + + conn.close(); + await promise; + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true } }, + async function httpServerStreamResponse() { + const stream = new TransformStream(); + const writer = stream.writable.getWriter(); + writer.write(new TextEncoder().encode("hello ")); + writer.write(new TextEncoder().encode("world")); + writer.close(); + + const listeningPromise = deferred(); + const ac = new AbortController(); + + const server = Deno.serve((request) => { + assert(!request.body); + return new Response(stream.readable); + }, { + port: 4501, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const resp = await fetch("http://127.0.0.1:4501/"); + const respBody = await resp.text(); + assertEquals("hello world", respBody); + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true } }, + async function httpServerStreamRequest() { + const stream = new TransformStream(); + const writer = stream.writable.getWriter(); + writer.write(new TextEncoder().encode("hello ")); + writer.write(new TextEncoder().encode("world")); + writer.close(); + const listeningPromise = deferred(); + const ac = new AbortController(); + const server = Deno.serve(async (request) => { + const reqBody = await request.text(); + assertEquals("hello world", reqBody); + return new Response("yo"); + }, { + port: 4501, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const resp = await fetch("http://127.0.0.1:4501/", { + body: stream.readable, + method: "POST", + headers: { "connection": "close" }, + }); + + assertEquals(await resp.text(), "yo"); + ac.abort(); + await server; + }, +); + +Deno.test({ permissions: { net: true } }, async function httpServerClose() { + const ac = new AbortController(); + const listeningPromise = deferred(); + const server = Deno.serve(() => new Response("ok"), { + port: 4501, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + await listeningPromise; + const client = await Deno.connect({ port: 4501 }); + client.close(); + ac.abort(); + await server; +}); + +// FIXME: +Deno.test( + { permissions: { net: true } }, + async function httpServerEmptyBlobResponse() { + const ac = new AbortController(); + const listeningPromise = deferred(); + const server = Deno.serve(() => new Response(new Blob([])), { + port: 4501, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const resp = await fetch("http://127.0.0.1:4501/"); + const respBody = await resp.text(); + + assertEquals("", respBody); + ac.abort(); + await server; + }, +); + +Deno.test({ permissions: { net: true } }, async function httpServerWebSocket() { + const ac = new AbortController(); + const listeningPromise = deferred(); + const server = Deno.serve(async (request) => { + const { + response, + socket, + } = Deno.upgradeWebSocket(request); + socket.onerror = () => fail(); + socket.onmessage = (m) => { + socket.send(m.data); + socket.close(1001); + }; + return response; + }, { + port: 4501, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const def = deferred(); + const ws = new WebSocket("ws://localhost:4501"); + ws.onmessage = (m) => assertEquals(m.data, "foo"); + ws.onerror = () => fail(); + ws.onclose = () => def.resolve(); + ws.onopen = () => ws.send("foo"); + + await def; + ac.abort(); + await server; +}); + +Deno.test( + { permissions: { net: true } }, + async function httpVeryLargeRequest() { + const promise = deferred(); + const listeningPromise = deferred(); + const ac = new AbortController(); + + let headers: Headers; + const server = Deno.serve(async (request) => { + headers = request.headers; + promise.resolve(); + return new Response(""); + }, { + port: 2333, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 2333 }); + // Send GET request with a body + content-length. + const encoder = new TextEncoder(); + const smthElse = "x".repeat(16 * 1024 + 256); + const body = + `GET / HTTP/1.1\r\nHost: 127.0.0.1:2333\r\nContent-Length: 5\r\nSomething-Else: ${smthElse}\r\n\r\n`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + await promise; + conn.close(); + assertEquals(headers!.get("content-length"), "5"); + assertEquals(headers!.get("something-else"), smthElse); + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true } }, + async function httpVeryLargeRequestAndBody() { + const promise = deferred(); + const listeningPromise = deferred(); + const ac = new AbortController(); + + let headers: Headers; + let text: string; + const server = Deno.serve(async (request) => { + headers = request.headers; + text = await request.text(); + promise.resolve(); + return new Response(""); + }, { + port: 2333, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 2333 }); + // Send GET request with a body + content-length. + const encoder = new TextEncoder(); + const smthElse = "x".repeat(16 * 1024 + 256); + const reqBody = "hello world".repeat(1024); + let body = + `PUT / HTTP/1.1\r\nHost: 127.0.0.1:2333\r\nContent-Length: ${reqBody.length}\r\nSomething-Else: ${smthElse}\r\n\r\n${reqBody}`; + + while (body.length > 0) { + const writeResult = await conn.write(encoder.encode(body)); + body = body.slice(writeResult); + } + + await promise; + conn.close(); + + assertEquals(headers!.get("content-length"), `${reqBody.length}`); + assertEquals(headers!.get("something-else"), smthElse); + assertEquals(text!, reqBody); + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true } }, + async function httpConnectionClose() { + const promise = deferred(); + const ac = new AbortController(); + const listeningPromise = deferred(); + + const server = Deno.serve(() => { + promise.resolve(); + return new Response(""); + }, { + port: 2333, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 2333 }); + // Send GET request with a body + connection: close. + const encoder = new TextEncoder(); + const body = + `GET / HTTP/1.1\r\nHost: 127.0.0.1:2333\r\nConnection: Close\r\n\r\n`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + + await promise; + conn.close(); + + ac.abort(); + await server; + }, +); + +// FIXME: auto request body reading is intefering with passing it as response. +// Deno.test( +// { permissions: { net: true } }, +// async function httpServerStreamDuplex() { +// const promise = deferred(); +// const ac = new AbortController(); + +// const server = Deno.serve(request => { +// assert(request.body); + +// promise.resolve(); +// return new Response(request.body); +// }, { port: 2333, signal: ac.signal }); + +// const ts = new TransformStream(); +// const writable = ts.writable.getWriter(); + +// const resp = await fetch("http://127.0.0.1:2333/", { +// method: "POST", +// body: ts.readable, +// }); + +// await promise; +// assert(resp.body); +// const reader = resp.body.getReader(); +// await writable.write(new Uint8Array([1])); +// const chunk1 = await reader.read(); +// assert(!chunk1.done); +// assertEquals(chunk1.value, new Uint8Array([1])); +// await writable.write(new Uint8Array([2])); +// const chunk2 = await reader.read(); +// assert(!chunk2.done); +// assertEquals(chunk2.value, new Uint8Array([2])); +// await writable.close(); +// const chunk3 = await reader.read(); +// assert(chunk3.done); + +// ac.abort(); +// await server; +// }, +// ); + +Deno.test( + { permissions: { net: true } }, + // Issue: https://github.com/denoland/deno/issues/10930 + async function httpServerStreamingResponse() { + // This test enqueues a single chunk for readable + // stream and waits for client to read that chunk and signal + // it before enqueueing subsequent chunk. Issue linked above + // presented a situation where enqueued chunks were not + // written to the HTTP connection until the next chunk was enqueued. + const listeningPromise = deferred(); + const promise = deferred(); + const ac = new AbortController(); + + let counter = 0; + + const deferreds = [ + deferred(), + deferred(), + deferred(), + ]; + + async function writeRequest(conn: Deno.Conn) { + const encoder = new TextEncoder(); + const decoder = new TextDecoder(); + + const w = new BufWriter(conn); + const r = new BufReader(conn); + const body = `GET / HTTP/1.1\r\nHost: 127.0.0.1:4501\r\n\r\n`; + const writeResult = await w.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + await w.flush(); + const tpr = new TextProtoReader(r); + const statusLine = await tpr.readLine(); + assert(statusLine !== null); + const headers = await tpr.readMIMEHeader(); + assert(headers !== null); + + const chunkedReader = chunkedBodyReader(headers, r); + + const buf = new Uint8Array(5); + const dest = new Buffer(); + + let result: number | null; + + try { + while ((result = await chunkedReader.read(buf)) !== null) { + const len = Math.min(buf.byteLength, result); + + await dest.write(buf.subarray(0, len)); + + // Resolve a deferred - this will make response stream to + // enqueue next chunk. + deferreds[counter - 1].resolve(); + } + return decoder.decode(dest.bytes()); + } catch (e) { + console.error(e); + } + } + + function periodicStream() { + return new ReadableStream({ + start(controller) { + controller.enqueue(`${counter}\n`); + counter++; + }, + + async pull(controller) { + if (counter >= 3) { + return controller.close(); + } + + await deferreds[counter - 1]; + + controller.enqueue(`${counter}\n`); + counter++; + }, + }).pipeThrough(new TextEncoderStream()); + } + + const finished = Deno.serve(() => { + promise.resolve(); + return new Response(periodicStream()); + }, { + port: 4501, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + // start a client + const clientConn = await Deno.connect({ port: 4501 }); + + const r1 = await writeRequest(clientConn); + assertEquals(r1, "0\n1\n2\n"); + + ac.abort(); + await promise; + await finished; + clientConn.close(); + }, +); + +Deno.test( + { permissions: { net: true } }, + async function httpRequestLatin1Headers() { + const listeningPromise = deferred(); + const promise = deferred(); + const ac = new AbortController(); + const server = Deno.serve((request) => { + assertEquals(request.headers.get("X-Header-Test"), "ĂĄ"); + promise.resolve(); + return new Response("hello", { headers: { "X-Header-Test": "Ă" } }); + }, { + port: 4501, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const clientConn = await Deno.connect({ port: 4501 }); + const requestText = + "GET / HTTP/1.1\r\nHost: 127.0.0.1:4501\r\nX-Header-Test: ĂĄ\r\n\r\n"; + const requestBytes = new Uint8Array(requestText.length); + for (let i = 0; i < requestText.length; i++) { + requestBytes[i] = requestText.charCodeAt(i); + } + let written = 0; + while (written < requestBytes.byteLength) { + written += await clientConn.write(requestBytes.slice(written)); + } + + const buf = new Uint8Array(1024); + await clientConn.read(buf); + + await promise; + let responseText = new TextDecoder().decode(buf); + clientConn.close(); + + assert(/\r\n[Xx]-[Hh]eader-[Tt]est: Ă\r\n/.test(responseText)); + + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true } }, + async function httpServerRequestWithoutPath() { + const promise = deferred(); + const listeningPromise = deferred(); + const ac = new AbortController(); + + const server = Deno.serve(async (request) => { + // FIXME: + // assertEquals(new URL(request.url).href, "http://127.0.0.1:4501/"); + assertEquals(await request.text(), ""); + promise.resolve(); + return new Response("11"); + }, { + port: 4501, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const clientConn = await Deno.connect({ port: 4501 }); + + async function writeRequest(conn: Deno.Conn) { + const encoder = new TextEncoder(); + + const w = new BufWriter(conn); + const r = new BufReader(conn); + const body = + `CONNECT 127.0.0.1:4501 HTTP/1.1\r\nHost: 127.0.0.1:4501\r\n\r\n`; + const writeResult = await w.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + await w.flush(); + const tpr = new TextProtoReader(r); + const statusLine = await tpr.readLine(); + assert(statusLine !== null); + const m = statusLine.match(/^(.+?) (.+?) (.+?)$/); + assert(m !== null, "must be matched"); + const [_, _proto, status, _ok] = m; + assertEquals(status, "200"); + const headers = await tpr.readMIMEHeader(); + assert(headers !== null); + } + + await writeRequest(clientConn); + clientConn.close(); + await promise; + + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true } }, + async function httpCookieConcatenation() { + const promise = deferred(); + const listeningPromise = deferred(); + const ac = new AbortController(); + + const server = Deno.serve(async (request) => { + assertEquals(await request.text(), ""); + assertEquals(request.headers.get("cookie"), "foo=bar, bar=foo"); + promise.resolve(); + return new Response("ok"); + }, { + port: 4501, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const resp = await fetch("http://127.0.0.1:4501/", { + headers: [ + ["connection", "close"], + ["cookie", "foo=bar"], + ["cookie", "bar=foo"], + ], + }); + await promise; + + const text = await resp.text(); + assertEquals(text, "ok"); + + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true, write: true, read: true } }, + async function httpServerCorrectSizeResponse() { + const promise = deferred(); + const listeningPromise = deferred(); + const ac = new AbortController(); + + const tmpFile = await Deno.makeTempFile(); + const file = await Deno.open(tmpFile, { write: true, read: true }); + await file.write(new Uint8Array(70 * 1024).fill(1)); // 70kb sent in 64kb + 6kb chunks + file.close(); + + const server = Deno.serve(async (request) => { + const f = await Deno.open(tmpFile, { read: true }); + promise.resolve(); + return new Response(f.readable); + }, { + port: 4503, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const resp = await fetch("http://127.0.0.1:4503/"); + await promise; + const body = await resp.arrayBuffer(); + + assertEquals(body.byteLength, 70 * 1024); + ac.abort(); + await server; + }, +); + +// https://github.com/denoland/deno/issues/12741 +// https://github.com/denoland/deno/pull/12746 +// https://github.com/denoland/deno/pull/12798 +Deno.test( + { permissions: { net: true, run: true } }, + async function httpServerDeleteRequestHasBody() { + const promise = deferred(); + const listeningPromise = deferred(); + const ac = new AbortController(); + + const hostname = "localhost"; + const port = 4501; + + const server = Deno.serve(() => { + promise.resolve(); + return new Response("ok"); + }, { + port: port, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const url = `http://${hostname}:${port}/`; + const args = ["-X", "DELETE", url]; + const { success } = await Deno.spawn("curl", { + args, + stdout: "null", + stderr: "null", + }); + assert(success); + await promise; + ac.abort(); + + await server; + }, +); + +// FIXME: +Deno.test( + { permissions: { net: true } }, + async function httpServerRespondNonAsciiUint8Array() { + const promise = deferred(); + const listeningPromise = deferred(); + const ac = new AbortController(); + + const server = Deno.serve(async (request) => { + assertEquals(request.body, null); + promise.resolve(); + return new Response(new Uint8Array([128])); + }, { + port: 4501, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + await listeningPromise; + const resp = await fetch("http://localhost:4501/"); + + await promise; + + assertEquals(resp.status, 200); + const body = await resp.arrayBuffer(); + assertEquals(new Uint8Array(body), new Uint8Array([128])); + + ac.abort(); + await server; + }, +); + +Deno.test("upgradeHttp tcp", async () => { + const promise = deferred(); + const listeningPromise = deferred(); + const promise2 = deferred(); + const ac = new AbortController(); + const signal = ac.signal; + + const server = Deno.serve(async (req) => { + const [conn, _] = await Deno.upgradeHttp(req); + + await conn.write( + new TextEncoder().encode("HTTP/1.1 101 Switching Protocols\r\n\r\n"), + ); + + promise.resolve(); + + const buf = new Uint8Array(1024); + const n = await conn.read(buf); + + assert(n != null); + const secondPacketText = new TextDecoder().decode(buf.slice(0, n)); + assertEquals(secondPacketText, "bla bla bla\nbla bla\nbla\n"); + + promise2.resolve(); + conn.close(); + }, { + port: 4501, + signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const tcpConn = await Deno.connect({ port: 4501 }); + await tcpConn.write( + new TextEncoder().encode( + "CONNECT server.example.com:80 HTTP/1.1\r\n\r\n", + ), + ); + + await promise; + + await tcpConn.write( + new TextEncoder().encode( + "bla bla bla\nbla bla\nbla\n", + ), + ); + + await promise2; + tcpConn.close(); + + ac.abort(); + await server; +}); + +// Some of these tests are ported from Hyper +// https://github.com/hyperium/hyper/blob/889fa2d87252108eb7668b8bf034ffcc30985117/src/proto/h1/role.rs +// https://github.com/hyperium/hyper/blob/889fa2d87252108eb7668b8bf034ffcc30985117/tests/server.rs + +Deno.test( + { permissions: { net: true } }, + async function httpServerParseRequest() { + const promise = deferred(); + const listeningPromise = deferred(); + const ac = new AbortController(); + + const server = Deno.serve(async (request) => { + assertEquals(request.method, "GET"); + assertEquals(request.headers.get("host"), "deno.land"); + promise.resolve(); + return new Response("ok"); + }, { + port: 4503, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 4503 }); + const encoder = new TextEncoder(); + const body = `GET /echo HTTP/1.1\r\nHost: deno.land\r\n\r\n`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + await promise; + conn.close(); + + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true } }, + async function httpServerParseHeaderHtabs() { + const promise = deferred(); + const listeningPromise = deferred(); + const ac = new AbortController(); + + const server = Deno.serve(async (request) => { + assertEquals(request.method, "GET"); + assertEquals(request.headers.get("server"), "hello\tworld"); + promise.resolve(); + return new Response("ok"); + }, { + port: 4503, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 4503 }); + const encoder = new TextEncoder(); + const body = `GET / HTTP/1.1\r\nserver: hello\tworld\r\n\r\n`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + await promise; + conn.close(); + + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true } }, + async function httpServerGetShouldIgnoreBody() { + const promise = deferred(); + const listeningPromise = deferred(); + const ac = new AbortController(); + + const server = Deno.serve(async (request) => { + assertEquals(request.method, "GET"); + assertEquals(await request.text(), ""); + promise.resolve(); + return new Response("ok"); + }, { + port: 4503, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 4503 }); + const encoder = new TextEncoder(); + // Connection: close = don't try to parse the body as a new request + const body = + `GET / HTTP/1.1\r\nHost: example.domain\r\nConnection: close\r\n\r\nI shouldn't be read.\r\n`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + await promise; + conn.close(); + + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true } }, + async function httpServerPostWithBody() { + const promise = deferred(); + const listeningPromise = deferred(); + const ac = new AbortController(); + + const server = Deno.serve(async (request) => { + assertEquals(request.method, "POST"); + assertEquals(await request.text(), "I'm a good request."); + promise.resolve(); + return new Response("ok"); + }, { + port: 4503, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 4503 }); + const encoder = new TextEncoder(); + const body = + `POST / HTTP/1.1\r\nHost: example.domain\r\nContent-Length: 19\r\n\r\nI'm a good request.`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + await promise; + conn.close(); + + ac.abort(); + await server; + }, +); + +type TestCase = { + headers?: Record<string, string>; + body: any; + expects_chunked?: boolean; + expects_con_len?: boolean; +}; + +function hasHeader(msg: string, name: string): boolean { + let n = msg.indexOf("\r\n\r\n") || msg.length; + return msg.slice(0, n).includes(name); +} + +function createServerLengthTest(name: string, testCase: TestCase) { + Deno.test(name, async function () { + const promise = deferred(); + const ac = new AbortController(); + const listeningPromise = deferred(); + + const server = Deno.serve(async (request) => { + assertEquals(request.method, "GET"); + promise.resolve(); + return new Response(testCase.body, testCase.headers ?? {}); + }, { + port: 4503, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 4503 }); + const encoder = new TextEncoder(); + const body = + `GET / HTTP/1.1\r\nHost: example.domain\r\nConnection: close\r\n\r\n`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + await promise; + + const decoder = new TextDecoder(); + const buf = new Uint8Array(1024); + const readResult = await conn.read(buf); + assert(readResult); + const msg = decoder.decode(buf.subarray(0, readResult)); + + try { + assert(testCase.expects_chunked == hasHeader(msg, "Transfer-Encoding:")); + assert(testCase.expects_chunked == hasHeader(msg, "chunked")); + assert(testCase.expects_con_len == hasHeader(msg, "Content-Length:")); + + const n = msg.indexOf("\r\n\r\n") + 4; + + if (testCase.expects_chunked) { + assertEquals(msg.slice(n + 1, n + 3), "\r\n"); + assertEquals(msg.slice(msg.length - 7), "\r\n0\r\n\r\n"); + } + + if (testCase.expects_con_len && typeof testCase.body === "string") { + assertEquals(msg.slice(n), testCase.body); + } + } catch (e) { + console.error(e); + throw e; + } + + conn.close(); + + ac.abort(); + await server; + }); +} + +// Quick and dirty way to make a readable stream from a string. Alternatively, +// `readableStreamFromReader(file)` could be used. +function stream(s: string): ReadableStream<Uint8Array> { + return new Response(s).body!; +} + +createServerLengthTest("fixedResponseKnown", { + headers: { "content-length": "11" }, + body: "foo bar baz", + expects_chunked: false, + expects_con_len: true, +}); + +createServerLengthTest("fixedResponseUnknown", { + headers: { "content-length": "11" }, + body: stream("foo bar baz"), + expects_chunked: true, + expects_con_len: false, +}); + +createServerLengthTest("fixedResponseKnownEmpty", { + headers: { "content-length": "0" }, + body: "", + expects_chunked: false, + expects_con_len: true, +}); + +createServerLengthTest("chunkedRespondKnown", { + headers: { "transfer-encoding": "chunked" }, + body: "foo bar baz", + expects_chunked: false, + expects_con_len: true, +}); + +createServerLengthTest("chunkedRespondUnknown", { + headers: { "transfer-encoding": "chunked" }, + body: stream("foo bar baz"), + expects_chunked: true, + expects_con_len: false, +}); + +createServerLengthTest("autoResponseWithKnownLength", { + body: "foo bar baz", + expects_chunked: false, + expects_con_len: true, +}); + +createServerLengthTest("autoResponseWithUnknownLength", { + body: stream("foo bar baz"), + expects_chunked: true, + expects_con_len: false, +}); + +createServerLengthTest("autoResponseWithKnownLengthEmpty", { + body: "", + expects_chunked: false, + expects_con_len: true, +}); + +createServerLengthTest("autoResponseWithUnknownLengthEmpty", { + body: stream(""), + expects_chunked: true, + expects_con_len: false, +}); + +Deno.test( + { + // FIXME(bartlomieju): this test is hanging on Windows, needs to be + // investigated and fixed + ignore: Deno.build.os === "windows", + permissions: { net: true }, + }, + async function httpServerGetChunkedResponseWithKa() { + const promises = [deferred(), deferred()]; + let reqCount = 0; + const listeningPromise = deferred(); + const ac = new AbortController(); + + const server = Deno.serve(async (request) => { + assertEquals(request.method, "GET"); + promises[reqCount].resolve(); + reqCount++; + return new Response(reqCount <= 1 ? stream("foo bar baz") : "zar quux"); + }, { + port: 4503, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 4503 }); + const encoder = new TextEncoder(); + { + const body = + `GET / HTTP/1.1\r\nHost: example.domain\r\nConnection: keep-alive\r\n\r\n`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + await promises[0]; + } + + const decoder = new TextDecoder(); + { + const buf = new Uint8Array(1024); + const readResult = await conn.read(buf); + assert(readResult); + const msg = decoder.decode(buf.subarray(0, readResult)); + assert(msg.endsWith("\r\nfoo bar baz\r\n0\r\n\r\n")); + } + + // once more! + { + const body = + `GET /quux HTTP/1.1\r\nHost: example.domain\r\nConnection: close\r\n\r\n`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + await promises[1]; + } + { + const buf = new Uint8Array(1024); + const readResult = await conn.read(buf); + assert(readResult); + const msg = decoder.decode(buf.subarray(0, readResult)); + assert(msg.endsWith("zar quux")); + } + + conn.close(); + + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true } }, + async function httpServerPostWithContentLengthBody() { + const promise = deferred(); + const listeningPromise = deferred(); + const ac = new AbortController(); + + const server = Deno.serve(async (request) => { + assertEquals(request.method, "POST"); + assertEquals(request.headers.get("content-length"), "5"); + assertEquals(await request.text(), "hello"); + promise.resolve(); + return new Response("ok"); + }, { + port: 4503, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 4503 }); + const encoder = new TextEncoder(); + + const body = + `POST / HTTP/1.1\r\nHost: example.domain\r\nContent-Length: 5\r\n\r\nhello`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + await promise; + + conn.close(); + + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true } }, + async function httpServerPostWithInvalidPrefixContentLength() { + const ac = new AbortController(); + const listeningPromise = deferred(); + const server = Deno.serve(() => { + throw new Error("unreachable"); + }, { + port: 4503, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 4503 }); + const encoder = new TextEncoder(); + const decoder = new TextDecoder(); + + const body = + `POST / HTTP/1.1\r\nHost: example.domain\r\nContent-Length: +5\r\n\r\nhello`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + + const buf = new Uint8Array(1024); + const readResult = await conn.read(buf); + assert(readResult); + const msg = decoder.decode(buf.subarray(0, readResult)); + assert(msg.endsWith("HTTP/1.1 400 Bad Request\r\n\r\n")); + + conn.close(); + + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true } }, + async function httpServerPostWithChunkedBody() { + const promise = deferred(); + const ac = new AbortController(); + const listeningPromise = deferred(); + + const server = Deno.serve(async (request) => { + assertEquals(request.method, "POST"); + assertEquals(await request.text(), "qwert"); + promise.resolve(); + return new Response("ok"); + }, { + port: 4503, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 4503 }); + const encoder = new TextEncoder(); + + const body = + `POST / HTTP/1.1\r\nHost: example.domain\r\nTransfer-Encoding: chunked\r\n\r\n1\r\nq\r\n2\r\nwe\r\n2\r\nrt\r\n0\r\n\r\n`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + await promise; + + conn.close(); + + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true } }, + async function httpServerPostWithIncompleteBody() { + const promise = deferred(); + const ac = new AbortController(); + const listeningPromise = deferred(); + + const server = Deno.serve(async (r) => { + promise.resolve(); + assertEquals(await r.text(), "12345"); + return new Response("ok"); + }, { + port: 4503, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 4503 }); + const encoder = new TextEncoder(); + + const body = + `POST / HTTP/1.1\r\nHost: example.domain\r\nContent-Length: 10\r\n\r\n12345`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + + await promise; + conn.close(); + + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true } }, + async function httpServerHeadResponseDoesntSendBody() { + const promise = deferred(); + const ac = new AbortController(); + const listeningPromise = deferred(); + + const server = Deno.serve(() => { + promise.resolve(); + return new Response("foo bar baz"); + }, { + port: 4503, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 4503 }); + const encoder = new TextEncoder(); + const decoder = new TextDecoder(); + + const body = + `HEAD / HTTP/1.1\r\nHost: example.domain\r\nConnection: close\r\n\r\n`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + + await promise; + + const buf = new Uint8Array(1024); + const readResult = await conn.read(buf); + assert(readResult); + const msg = decoder.decode(buf.subarray(0, readResult)); + + assert(msg.endsWith("Content-Length: 11\r\n\r\n")); + + conn.close(); + + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true, write: true, read: true } }, + async function httpServerSendFile() { + const promise = deferred(); + const ac = new AbortController(); + const listeningPromise = deferred(); + const tmpFile = await Deno.makeTempFile(); + const file = await Deno.open(tmpFile, { write: true, read: true }); + const data = new Uint8Array(70 * 1024).fill(1); + await file.write(data); + file.close(); + const server = Deno.serve(async () => { + const f = await Deno.open(tmpFile, { read: true }); + promise.resolve(); + return new Response(f.readable, { status: 200 }); + }, { + port: 4503, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const response = await fetch(`http://localhost:4503/`); + assertEquals(response.status, 200); + await promise; + assertEquals(new Uint8Array(await response.arrayBuffer()), data); + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true, write: true, read: true } }, + async function httpServerPostFile() { + const promise = deferred(); + const ac = new AbortController(); + const listeningPromise = deferred(); + + const tmpFile = await Deno.makeTempFile(); + const file = await Deno.open(tmpFile, { write: true, read: true }); + const data = new Uint8Array(70 * 1024).fill(1); + await file.write(data); + file.close(); + + const server = Deno.serve(async (request) => { + assertEquals(new Uint8Array(await request.arrayBuffer()), data); + promise.resolve(); + return new Response("ok"); + }, { + port: 4503, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const f = await Deno.open(tmpFile, { write: true, read: true }); + const response = await fetch(`http://localhost:4503/`, { + method: "POST", + body: f.readable, + }); + + await promise; + + assertEquals(response.status, 200); + assertEquals(await response.text(), "ok"); + + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { read: true, net: true } }, + async function httpServerWithTls() { + const ac = new AbortController(); + const listeningPromise = deferred(); + const hostname = "127.0.0.1"; + const port = 4501; + function handler() { + return new Response("Hello World"); + } + + const server = Deno.serveTls(handler, { + hostname, + port, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + cert: Deno.readTextFileSync("cli/tests/testdata/tls/localhost.crt"), + key: Deno.readTextFileSync("cli/tests/testdata/tls/localhost.key"), + }); + + await listeningPromise; + const caCert = Deno.readTextFileSync("cli/tests/testdata/tls/RootCA.pem"); + const client = Deno.createHttpClient({ caCerts: [caCert] }); + const resp = await fetch(`https://localhost:${port}/`, { + client, + headers: { "connection": "close" }, + }); + + const respBody = await resp.text(); + assertEquals("Hello World", respBody); + + client.close(); + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true, write: true, read: true } }, + async function httpServerRequestCLTE() { + const ac = new AbortController(); + const listeningPromise = deferred(); + const promise = deferred(); + + const server = Deno.serve(async (req) => { + assertEquals(await req.text(), ""); + promise.resolve(); + return new Response("ok"); + }, { + port: 4503, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 4503 }); + const encoder = new TextEncoder(); + + const body = + `POST / HTTP/1.1\r\nHost: example.domain\r\nContent-Length: 13\r\nTransfer-Encoding: chunked\r\n\r\n0\r\n\r\nEXTRA`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + await promise; + + conn.close(); + + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true, write: true, read: true } }, + async function httpServerRequestTETE() { + const ac = new AbortController(); + const listeningPromise = deferred(); + + const server = Deno.serve(() => { + throw new Error("oops"); + }, { + port: 4503, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + const encoder = new TextEncoder(); + const decoder = new TextDecoder(); + + const variations = [ + "Transfer-Encoding : chunked", + "Transfer-Encoding: xchunked", + "Transfer-Encoding: chunkedx", + "Transfer-Encoding\n: chunked", + ]; + + await listeningPromise; + for (const teHeader of variations) { + const conn = await Deno.connect({ port: 4503 }); + const body = + `POST / HTTP/1.1\r\nHost: example.domain\r\n${teHeader}\r\n\r\n0\r\n\r\n`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + + const buf = new Uint8Array(1024); + const readResult = await conn.read(buf); + assert(readResult); + const msg = decoder.decode(buf.subarray(0, readResult)); + assert(msg.endsWith("HTTP/1.1 400 Bad Request\r\n\r\n")); + + conn.close(); + } + + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true } }, + async function httpServer304ResponseDoesntSendBody() { + const promise = deferred(); + const ac = new AbortController(); + const listeningPromise = deferred(); + + const server = Deno.serve(() => { + promise.resolve(); + return new Response(null, { status: 304 }); + }, { + port: 4503, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 4503 }); + const encoder = new TextEncoder(); + const decoder = new TextDecoder(); + + const body = + `GET / HTTP/1.1\r\nHost: example.domain\r\nConnection: close\r\n\r\n`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + + await promise; + + const buf = new Uint8Array(1024); + const readResult = await conn.read(buf); + assert(readResult); + const msg = decoder.decode(buf.subarray(0, readResult)); + + assert(msg.startsWith("HTTP/1.1 304 Not Modified")); + + conn.close(); + + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true } }, + async function httpServerExpectContinue() { + const promise = deferred(); + const ac = new AbortController(); + const listeningPromise = deferred(); + + const server = Deno.serve(async (req) => { + promise.resolve(); + assertEquals(await req.text(), "hello"); + return new Response(null, { status: 304 }); + }, { + port: 4503, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 4503 }); + const encoder = new TextEncoder(); + const decoder = new TextDecoder(); + + { + const body = + `POST / HTTP/1.1\r\nHost: example.domain\r\nExpect: 100-continue\r\nContent-Length: 5\r\nConnection: close\r\n\r\n`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + } + + await promise; + + { + const msgExpected = "HTTP/1.1 100 Continue\r\n\r\n"; + const buf = new Uint8Array(encoder.encode(msgExpected).byteLength); + const readResult = await conn.read(buf); + assert(readResult); + const msg = decoder.decode(buf.subarray(0, readResult)); + assert(msg.startsWith(msgExpected)); + } + + { + const body = "hello"; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + } + + const buf = new Uint8Array(1024); + const readResult = await conn.read(buf); + assert(readResult); + const msg = decoder.decode(buf.subarray(0, readResult)); + + assert(msg.startsWith("HTTP/1.1 304 Not Modified")); + conn.close(); + + ac.abort(); + await server; + }, +); + +Deno.test( + { permissions: { net: true } }, + async function httpServerExpectContinueButNoBodyLOL() { + const promise = deferred(); + const listeningPromise = deferred(); + const ac = new AbortController(); + + const server = Deno.serve(async (req) => { + promise.resolve(); + assertEquals(await req.text(), ""); + return new Response(null, { status: 304 }); + }, { + port: 4503, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 4503 }); + const encoder = new TextEncoder(); + const decoder = new TextDecoder(); + + { + // // no content-length or transfer-encoding means no body! + const body = + `POST / HTTP/1.1\r\nHost: example.domain\r\nExpect: 100-continue\r\nConnection: close\r\n\r\n`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + } + + await promise; + + const buf = new Uint8Array(1024); + const readResult = await conn.read(buf); + assert(readResult); + const msg = decoder.decode(buf.subarray(0, readResult)); + + assert(msg.startsWith("HTTP/1.1 304 Not Modified")); + conn.close(); + + ac.abort(); + await server; + }, +); + +const badRequests = [ + ["weirdMethodName", "GE T / HTTP/1.1\r\n\r\n"], + ["illegalRequestLength", "POST / HTTP/1.1\r\nContent-Length: foo\r\n\r\n"], + ["illegalRequestLength2", "POST / HTTP/1.1\r\nContent-Length: -1\r\n\r\n"], + ["illegalRequestLength3", "POST / HTTP/1.1\r\nContent-Length: 1.1\r\n\r\n"], + ["illegalRequestLength4", "POST / HTTP/1.1\r\nContent-Length: 1.\r\n\r\n"], +]; + +for (const [name, req] of badRequests) { + const testFn = { + [name]: async () => { + const ac = new AbortController(); + const listeningPromise = deferred(); + + const server = Deno.serve(() => { + throw new Error("oops"); + }, { + port: 4503, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 4503 }); + const encoder = new TextEncoder(); + const decoder = new TextDecoder(); + + { + const writeResult = await conn.write(encoder.encode(req)); + assertEquals(req.length, writeResult); + } + + const buf = new Uint8Array(100); + const readResult = await conn.read(buf); + assert(readResult); + const msg = decoder.decode(buf.subarray(0, readResult)); + + assert(msg.startsWith("HTTP/1.1 400 ")); + conn.close(); + + ac.abort(); + await server; + }, + }[name]; + + Deno.test( + { permissions: { net: true } }, + testFn, + ); +} + +Deno.test( + { permissions: { net: true } }, + async function httpServerImplicitZeroContentLengthForHead() { + const ac = new AbortController(); + const listeningPromise = deferred(); + + const server = Deno.serve(() => new Response(null), { + port: 4503, + signal: ac.signal, + onListen: onListen(listeningPromise), + onError: createOnErrorCb(ac), + }); + + await listeningPromise; + const conn = await Deno.connect({ port: 4503 }); + const encoder = new TextEncoder(); + const decoder = new TextDecoder(); + + const body = + `HEAD / HTTP/1.1\r\nHost: example.domain\r\nConnection: close\r\n\r\n`; + const writeResult = await conn.write(encoder.encode(body)); + assertEquals(body.length, writeResult); + + const buf = new Uint8Array(1024); + const readResult = await conn.read(buf); + assert(readResult); + const msg = decoder.decode(buf.subarray(0, readResult)); + + assert(msg.includes("Content-Length: 0")); + + conn.close(); + + ac.abort(); + await server; + }, +); + +function chunkedBodyReader(h: Headers, r: BufReader): Deno.Reader { + // Based on https://tools.ietf.org/html/rfc2616#section-19.4.6 + const tp = new TextProtoReader(r); + let finished = false; + const chunks: Array<{ + offset: number; + data: Uint8Array; + }> = []; + async function read(buf: Uint8Array): Promise<number | null> { + if (finished) return null; + const [chunk] = chunks; + if (chunk) { + const chunkRemaining = chunk.data.byteLength - chunk.offset; + const readLength = Math.min(chunkRemaining, buf.byteLength); + for (let i = 0; i < readLength; i++) { + buf[i] = chunk.data[chunk.offset + i]; + } + chunk.offset += readLength; + if (chunk.offset === chunk.data.byteLength) { + chunks.shift(); + // Consume \r\n; + if ((await tp.readLine()) === null) { + throw new Deno.errors.UnexpectedEof(); + } + } + return readLength; + } + const line = await tp.readLine(); + if (line === null) throw new Deno.errors.UnexpectedEof(); + // TODO(bartlomieju): handle chunk extension + const [chunkSizeString] = line.split(";"); + const chunkSize = parseInt(chunkSizeString, 16); + if (Number.isNaN(chunkSize) || chunkSize < 0) { + throw new Deno.errors.InvalidData("Invalid chunk size"); + } + if (chunkSize > 0) { + if (chunkSize > buf.byteLength) { + let eof = await r.readFull(buf); + if (eof === null) { + throw new Deno.errors.UnexpectedEof(); + } + const restChunk = new Uint8Array(chunkSize - buf.byteLength); + eof = await r.readFull(restChunk); + if (eof === null) { + throw new Deno.errors.UnexpectedEof(); + } else { + chunks.push({ + offset: 0, + data: restChunk, + }); + } + return buf.byteLength; + } else { + const bufToFill = buf.subarray(0, chunkSize); + const eof = await r.readFull(bufToFill); + if (eof === null) { + throw new Deno.errors.UnexpectedEof(); + } + // Consume \r\n + if ((await tp.readLine()) === null) { + throw new Deno.errors.UnexpectedEof(); + } + return chunkSize; + } + } else { + assert(chunkSize === 0); + // Consume \r\n + if ((await r.readLine()) === null) { + throw new Deno.errors.UnexpectedEof(); + } + await readTrailers(h, r); + finished = true; + return null; + } + } + return { read }; +} + +async function readTrailers( + headers: Headers, + r: BufReader, +) { + const trailers = parseTrailer(headers.get("trailer")); + if (trailers == null) return; + const trailerNames = [...trailers.keys()]; + const tp = new TextProtoReader(r); + const result = await tp.readMIMEHeader(); + if (result == null) { + throw new Deno.errors.InvalidData("Missing trailer header."); + } + const undeclared = [...result.keys()].filter( + (k) => !trailerNames.includes(k), + ); + if (undeclared.length > 0) { + throw new Deno.errors.InvalidData( + `Undeclared trailers: ${Deno.inspect(undeclared)}.`, + ); + } + for (const [k, v] of result) { + headers.append(k, v); + } + const missingTrailers = trailerNames.filter((k) => !result.has(k)); + if (missingTrailers.length > 0) { + throw new Deno.errors.InvalidData( + `Missing trailers: ${Deno.inspect(missingTrailers)}.`, + ); + } + headers.delete("trailer"); +} + +function parseTrailer(field: string | null): Headers | undefined { + if (field == null) { + return undefined; + } + const trailerNames = field.split(",").map((v) => v.trim().toLowerCase()); + if (trailerNames.length === 0) { + throw new Deno.errors.InvalidData("Empty trailer header."); + } + const prohibited = trailerNames.filter((k) => isProhibitedForTrailer(k)); + if (prohibited.length > 0) { + throw new Deno.errors.InvalidData( + `Prohibited trailer names: ${Deno.inspect(prohibited)}.`, + ); + } + return new Headers(trailerNames.map((key) => [key, ""])); +} + +function isProhibitedForTrailer(key: string): boolean { + const s = new Set(["transfer-encoding", "content-length", "trailer"]); + return s.has(key.toLowerCase()); +} diff --git a/core/lib.rs b/core/lib.rs index ab22392c4..57e81ee7a 100644 --- a/core/lib.rs +++ b/core/lib.rs @@ -101,6 +101,8 @@ pub use crate::runtime::JsRuntime; pub use crate::runtime::RuntimeOptions; pub use crate::runtime::SharedArrayBufferStore; pub use crate::runtime::Snapshot; +pub use crate::runtime::V8_WRAPPER_OBJECT_INDEX; +pub use crate::runtime::V8_WRAPPER_TYPE_INDEX; pub use crate::source_map::SourceMapGetter; pub use deno_ops::op; diff --git a/core/resources.rs b/core/resources.rs index a4bb3607d..82b079201 100644 --- a/core/resources.rs +++ b/core/resources.rs @@ -64,6 +64,13 @@ pub trait Resource: Any + 'static { /// resource specific clean-ups, such as cancelling pending futures, after a /// resource has been removed from the resource table. fn close(self: Rc<Self>) {} + + /// Resources backed by a file descriptor can let ops know to allow for + /// low-level optimizations. + #[cfg(unix)] + fn backing_fd(self: Rc<Self>) -> Option<std::os::unix::prelude::RawFd> { + None + } } impl dyn Resource { diff --git a/core/runtime.rs b/core/runtime.rs index 7f113223f..def38e1eb 100644 --- a/core/runtime.rs +++ b/core/runtime.rs @@ -250,6 +250,9 @@ fn v8_init( v8::V8::initialize(); } +pub const V8_WRAPPER_TYPE_INDEX: i32 = 0; +pub const V8_WRAPPER_OBJECT_INDEX: i32 = 1; + #[derive(Default)] pub struct RuntimeOptions { /// Source map reference for errors. @@ -360,7 +363,12 @@ impl JsRuntime { let mut params = options .create_params .take() - .unwrap_or_else(v8::Isolate::create_params) + .unwrap_or_else(|| { + v8::CreateParams::default().embedder_wrapper_type_info_offsets( + V8_WRAPPER_TYPE_INDEX, + V8_WRAPPER_OBJECT_INDEX, + ) + }) .external_references(&**bindings::EXTERNAL_REFERENCES); let snapshot_loaded = if let Some(snapshot) = options.startup_snapshot { params = match snapshot { diff --git a/ext/fetch/22_body.js b/ext/fetch/22_body.js index 10ddb7603..a51cdc184 100644 --- a/ext/fetch/22_body.js +++ b/ext/fetch/22_body.js @@ -388,7 +388,10 @@ let source = null; let length = null; let contentType = null; - if (ObjectPrototypeIsPrototypeOf(BlobPrototype, object)) { + if (typeof object === "string") { + source = object; + contentType = "text/plain;charset=UTF-8"; + } else if (ObjectPrototypeIsPrototypeOf(BlobPrototype, object)) { stream = object.stream(); source = object; length = object.size; @@ -424,24 +427,21 @@ // TODO(@satyarohith): not sure what primordial here. source = object.toString(); contentType = "application/x-www-form-urlencoded;charset=UTF-8"; - } else if (typeof object === "string") { - source = object; - contentType = "text/plain;charset=UTF-8"; } else if (ObjectPrototypeIsPrototypeOf(ReadableStreamPrototype, object)) { stream = object; if (object.locked || isReadableStreamDisturbed(object)) { throw new TypeError("ReadableStream is locked or disturbed"); } } - if (ObjectPrototypeIsPrototypeOf(Uint8ArrayPrototype, source)) { - stream = { body: source, consumed: false }; - length = source.byteLength; - } else if (typeof source === "string") { + if (typeof source === "string") { // WARNING: this deviates from spec (expects length to be set) // https://fetch.spec.whatwg.org/#bodyinit > 7. // no observable side-effect for users so far, but could change stream = { body: source, consumed: false }; length = null; // NOTE: string length != byte length + } else if (ObjectPrototypeIsPrototypeOf(Uint8ArrayPrototype, source)) { + stream = { body: source, consumed: false }; + length = source.byteLength; } const body = new InnerBody(stream); body.source = source; diff --git a/ext/fetch/23_request.js b/ext/fetch/23_request.js index 63fc6a26e..5221d5ca9 100644 --- a/ext/fetch/23_request.js +++ b/ext/fetch/23_request.js @@ -16,7 +16,7 @@ const { HTTP_TOKEN_CODE_POINT_RE, byteUpperCase } = window.__bootstrap.infra; const { URL } = window.__bootstrap.url; const { guardFromHeaders } = window.__bootstrap.headers; - const { mixinBody, extractBody } = window.__bootstrap.fetchBody; + const { mixinBody, extractBody, InnerBody } = window.__bootstrap.fetchBody; const { getLocationHref } = window.__bootstrap.location; const { extractMimeType } = window.__bootstrap.mimesniff; const { blobFromObjectUrl } = window.__bootstrap.file; @@ -48,6 +48,9 @@ const _signal = Symbol("signal"); const _mimeType = Symbol("mime type"); const _body = Symbol("body"); + const _flash = Symbol("flash"); + const _url = Symbol("url"); + const _method = Symbol("method"); /** * @param {(() => string)[]} urlList @@ -266,7 +269,11 @@ return extractMimeType(values); } get [_body]() { - return this[_request].body; + if (this[_flash]) { + return this[_flash].body; + } else { + return this[_request].body; + } } /** @@ -427,12 +434,31 @@ get method() { webidl.assertBranded(this, RequestPrototype); - return this[_request].method; + if (this[_method]) { + return this[_method]; + } + if (this[_flash]) { + this[_method] = this[_flash].methodCb(); + return this[_method]; + } else { + this[_method] = this[_request].method; + return this[_method]; + } } get url() { webidl.assertBranded(this, RequestPrototype); - return this[_request].url(); + if (this[_url]) { + return this[_url]; + } + + if (this[_flash]) { + this[_url] = this[_flash].urlCb(); + return this[_url]; + } else { + this[_url] = this[_request].url(); + return this[_url]; + } } get headers() { @@ -442,6 +468,9 @@ get redirect() { webidl.assertBranded(this, RequestPrototype); + if (this[_flash]) { + return this[_flash].redirectMode; + } return this[_request].redirectMode; } @@ -455,7 +484,12 @@ if (this[_body] && this[_body].unusable()) { throw new TypeError("Body is unusable."); } - const newReq = cloneInnerRequest(this[_request]); + let newReq; + if (this[_flash]) { + newReq = cloneInnerRequest(this[_flash]); + } else { + newReq = cloneInnerRequest(this[_request]); + } const newSignal = abortSignal.newSignal(); abortSignal.follow(newSignal, this[_signal]); return fromInnerRequest( @@ -549,10 +583,43 @@ return request; } + /** + * @param {number} serverId + * @param {number} streamRid + * @param {ReadableStream} body + * @param {() => string} methodCb + * @param {() => string} urlCb + * @param {() => [string, string][]} headersCb + * @returns {Request} + */ + function fromFlashRequest( + serverId, + streamRid, + body, + methodCb, + urlCb, + headersCb, + ) { + const request = webidl.createBranded(Request); + request[_flash] = { + body: body !== null ? new InnerBody(body) : null, + methodCb, + urlCb, + streamRid, + serverId, + redirectMode: "follow", + redirectCount: 0, + }; + request[_getHeaders] = () => headersFromHeaderList(headersCb(), "request"); + return request; + } + window.__bootstrap.fetch ??= {}; window.__bootstrap.fetch.Request = Request; window.__bootstrap.fetch.toInnerRequest = toInnerRequest; + window.__bootstrap.fetch.fromFlashRequest = fromFlashRequest; window.__bootstrap.fetch.fromInnerRequest = fromInnerRequest; window.__bootstrap.fetch.newInnerRequest = newInnerRequest; window.__bootstrap.fetch.processUrlList = processUrlList; + window.__bootstrap.fetch._flash = _flash; })(globalThis); diff --git a/ext/fetch/23_response.js b/ext/fetch/23_response.js index 226a751bd..3c19f963a 100644 --- a/ext/fetch/23_response.js +++ b/ext/fetch/23_response.js @@ -15,6 +15,9 @@ const { isProxy } = Deno.core; const webidl = window.__bootstrap.webidl; const consoleInternal = window.__bootstrap.console; + const { + byteLowerCase, + } = window.__bootstrap.infra; const { HTTP_TAB_OR_SPACE, regexMatcher, serializeJSValueToJSONString } = window.__bootstrap.infra; const { extractBody, mixinBody } = window.__bootstrap.fetchBody; @@ -185,7 +188,6 @@ // 4. response[_response].statusMessage = init.statusText; - // 5. /** @type {__bootstrap.headers.Headers} */ const headers = response[_headers]; @@ -200,10 +202,22 @@ "Response with null body status cannot have body", ); } + const { body, contentType } = bodyWithType; response[_response].body = body; - if (contentType !== null && !headers.has("content-type")) { - headers.append("Content-Type", contentType); + + if (contentType !== null) { + let hasContentType = false; + const list = headerListFromHeaders(headers); + for (let i = 0; i < list.length; i++) { + if (byteLowerCase(list[i][0]) === "content-type") { + hasContentType = true; + break; + } + } + if (!hasContentType) { + ArrayPrototypePush(list, ["Content-Type", contentType]); + } } } } diff --git a/ext/flash/01_http.js b/ext/flash/01_http.js new file mode 100644 index 000000000..fd817219e --- /dev/null +++ b/ext/flash/01_http.js @@ -0,0 +1,569 @@ +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. +"use strict"; + +((window) => { + const { BlobPrototype } = window.__bootstrap.file; + const { fromFlashRequest, toInnerResponse } = window.__bootstrap.fetch; + const core = window.Deno.core; + const { + ReadableStream, + ReadableStreamPrototype, + getReadableStreamRid, + readableStreamClose, + _state, + } = window.__bootstrap.streams; + const { + WebSocket, + _rid, + _readyState, + _eventLoop, + _protocol, + _server, + _idleTimeoutDuration, + _idleTimeoutTimeout, + _serverHandleIdleTimeout, + } = window.__bootstrap.webSocket; + const { _ws } = window.__bootstrap.http; + const { + ObjectPrototypeIsPrototypeOf, + TypedArrayPrototypeSubarray, + TypeError, + Uint8Array, + Uint8ArrayPrototype, + } = window.__bootstrap.primordials; + + const statusCodes = { + 100: "Continue", + 101: "Switching Protocols", + 102: "Processing", + 200: "OK", + 201: "Created", + 202: "Accepted", + 203: "Non Authoritative Information", + 204: "No Content", + 205: "Reset Content", + 206: "Partial Content", + 207: "Multi-Status", + 208: "Already Reported", + 226: "IM Used", + 300: "Multiple Choices", + 301: "Moved Permanently", + 302: "Found", + 303: "See Other", + 304: "Not Modified", + 305: "Use Proxy", + 307: "Temporary Redirect", + 308: "Permanent Redirect", + 400: "Bad Request", + 401: "Unauthorized", + 402: "Payment Required", + 403: "Forbidden", + 404: "Not Found", + 405: "Method Not Allowed", + 406: "Not Acceptable", + 407: "Proxy Authentication Required", + 408: "Request Timeout", + 409: "Conflict", + 410: "Gone", + 411: "Length Required", + 412: "Precondition Failed", + 413: "Payload Too Large", + 414: "URI Too Long", + 415: "Unsupported Media Type", + 416: "Range Not Satisfiable", + 418: "I'm a teapot", + 421: "Misdirected Request", + 422: "Unprocessable Entity", + 423: "Locked", + 424: "Failed Dependency", + 426: "Upgrade Required", + 428: "Precondition Required", + 429: "Too Many Requests", + 431: "Request Header Fields Too Large", + 451: "Unavailable For Legal Reasons", + 500: "Internal Server Error", + 501: "Not Implemented", + 502: "Bad Gateway", + 503: "Service Unavailable", + 504: "Gateway Timeout", + 505: "HTTP Version Not Supported", + 506: "Variant Also Negotiates", + 507: "Insufficient Storage", + 508: "Loop Detected", + 510: "Not Extended", + 511: "Network Authentication Required", + }; + + const methods = { + 0: "GET", + 1: "HEAD", + 2: "CONNECT", + 3: "PUT", + 4: "DELETE", + 5: "OPTIONS", + 6: "TRACE", + 7: "POST", + 8: "PATCH", + }; + + let dateInterval; + let date; + let stringResources = {}; + + // Construct an HTTP response message. + // All HTTP/1.1 messages consist of a start-line followed by a sequence + // of octets. + // + // HTTP-message = start-line + // *( header-field CRLF ) + // CRLF + // [ message-body ] + // + function http1Response(method, status, headerList, body, earlyEnd = false) { + // HTTP uses a "<major>.<minor>" numbering scheme + // HTTP-version = HTTP-name "/" DIGIT "." DIGIT + // HTTP-name = %x48.54.54.50 ; "HTTP", case-sensitive + // + // status-line = HTTP-version SP status-code SP reason-phrase CRLF + // Date header: https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.2 + let str = `HTTP/1.1 ${status} ${statusCodes[status]}\r\nDate: ${date}\r\n`; + for (const [name, value] of headerList) { + // header-field = field-name ":" OWS field-value OWS + str += `${name}: ${value}\r\n`; + } + + // https://datatracker.ietf.org/doc/html/rfc7231#section-6.3.6 + if (status === 205 || status === 304) { + // MUST NOT generate a payload in a 205 response. + // indicate a zero-length body for the response by + // including a Content-Length header field with a value of 0. + str += "Content-Length: 0\r\n"; + return str; + } + + // MUST NOT send Content-Length or Transfer-Encoding if status code is 1xx or 204. + if (status == 204 && status <= 100) { + return str; + } + + if (earlyEnd === true) { + return str; + } + + // null body status is validated by inititalizeAResponse in ext/fetch + if (body !== null && body !== undefined) { + str += `Content-Length: ${body.length}\r\n\r\n`; + } else { + str += "Transfer-Encoding: chunked\r\n\r\n"; + return str; + } + + // A HEAD request. + if (method === 1) return str; + + if (typeof body === "string") { + str += body ?? ""; + } else { + const head = core.encode(str); + const response = new Uint8Array(head.byteLength + body.byteLength); + response.set(head, 0); + response.set(body, head.byteLength); + return response; + } + + return str; + } + + function prepareFastCalls() { + return core.opSync("op_flash_make_request"); + } + + function hostnameForDisplay(hostname) { + // If the hostname is "0.0.0.0", we display "localhost" in console + // because browsers in Windows don't resolve "0.0.0.0". + // See the discussion in https://github.com/denoland/deno_std/issues/1165 + return hostname === "0.0.0.0" ? "localhost" : hostname; + } + + function serve(handler, opts = {}) { + delete opts.key; + delete opts.cert; + return serveInner(handler, opts, false); + } + + function serveTls(handler, opts = {}) { + return serveInner(handler, opts, true); + } + + function serveInner(handler, opts, useTls) { + opts = { hostname: "127.0.0.1", port: 9000, useTls, ...opts }; + const signal = opts.signal; + delete opts.signal; + const onError = opts.onError ?? function (error) { + console.error(error); + return new Response("Internal Server Error", { status: 500 }); + }; + delete opts.onError; + const onListen = opts.onListen ?? function () { + console.log( + `Listening on http://${ + hostnameForDisplay(opts.hostname) + }:${opts.port}/`, + ); + }; + delete opts.onListen; + const serverId = core.ops.op_flash_serve(opts); + const serverPromise = core.opAsync("op_flash_drive_server", serverId); + + core.opAsync("op_flash_wait_for_listening", serverId).then(() => { + onListen({ hostname: opts.hostname, port: opts.port }); + }); + + const server = { + id: serverId, + transport: opts.cert && opts.key ? "https" : "http", + hostname: opts.hostname, + port: opts.port, + closed: false, + finished: (async () => { + return await serverPromise; + })(), + async close() { + if (server.closed) { + return; + } + server.closed = true; + await core.opAsync("op_flash_close_server", serverId); + await server.finished; + }, + async serve() { + while (true) { + if (server.closed) { + break; + } + + let token = nextRequestSync(); + if (token === 0) { + token = await core.opAsync("op_flash_next_async", serverId); + if (server.closed) { + break; + } + } + + for (let i = 0; i < token; i++) { + let body = null; + // There might be a body, but we don't expose it for GET/HEAD requests. + // It will be closed automatically once the request has been handled and + // the response has been sent. + const method = getMethodSync(i); + let hasBody = method > 2; // Not GET/HEAD/CONNECT + if (hasBody) { + body = createRequestBodyStream(serverId, i); + if (body === null) { + hasBody = false; + } + } + + const req = fromFlashRequest( + serverId, + /* streamRid */ + i, + body, + /* methodCb */ + () => methods[method], + /* urlCb */ + () => { + const path = core.ops.op_flash_path(serverId, i); + return `${server.transport}://${server.hostname}:${server.port}${path}`; + }, + /* headersCb */ + () => core.ops.op_flash_headers(serverId, i), + ); + + let resp; + try { + resp = await handler(req); + } catch (e) { + resp = await onError(e); + } + // there might've been an HTTP upgrade. + if (resp === undefined) { + continue; + } + + const ws = resp[_ws]; + if (!ws) { + if (hasBody && body[_state] !== "closed") { + // TODO(@littledivy): Optimize by draining in a single op. + try { + await req.arrayBuffer(); + } catch { /* pass */ } + } + } + + const innerResp = toInnerResponse(resp); + + // If response body length is known, it will be sent synchronously in a + // single op, in other case a "response body" resource will be created and + // we'll be streaming it. + /** @type {ReadableStream<Uint8Array> | Uint8Array | null} */ + let respBody = null; + let isStreamingResponseBody = false; + if (innerResp.body !== null) { + if (typeof innerResp.body.streamOrStatic?.body === "string") { + if (innerResp.body.streamOrStatic.consumed === true) { + throw new TypeError("Body is unusable."); + } + innerResp.body.streamOrStatic.consumed = true; + respBody = innerResp.body.streamOrStatic.body; + isStreamingResponseBody = false; + } else if ( + ObjectPrototypeIsPrototypeOf( + ReadableStreamPrototype, + innerResp.body.streamOrStatic, + ) + ) { + if (innerResp.body.unusable()) { + throw new TypeError("Body is unusable."); + } + if ( + innerResp.body.length === null || + ObjectPrototypeIsPrototypeOf( + BlobPrototype, + innerResp.body.source, + ) + ) { + respBody = innerResp.body.stream; + } else { + const reader = innerResp.body.stream.getReader(); + const r1 = await reader.read(); + if (r1.done) { + respBody = new Uint8Array(0); + } else { + respBody = r1.value; + const r2 = await reader.read(); + if (!r2.done) throw new TypeError("Unreachable"); + } + } + isStreamingResponseBody = !( + typeof respBody === "string" || + ObjectPrototypeIsPrototypeOf(Uint8ArrayPrototype, respBody) + ); + } else { + if (innerResp.body.streamOrStatic.consumed === true) { + throw new TypeError("Body is unusable."); + } + innerResp.body.streamOrStatic.consumed = true; + respBody = innerResp.body.streamOrStatic.body; + } + } else { + respBody = new Uint8Array(0); + } + + if (isStreamingResponseBody === true) { + const resourceRid = getReadableStreamRid(respBody); + if (resourceRid) { + if (respBody.locked) { + throw new TypeError("ReadableStream is locked."); + } + const reader = respBody.getReader(); // Aquire JS lock. + try { + core.opAsync( + "op_flash_write_resource", + http1Response( + method, + innerResp.status ?? 200, + innerResp.headerList, + null, + true, + ), + serverId, + i, + resourceRid, + ).then(() => { + // Release JS lock. + readableStreamClose(respBody); + }); + } catch (error) { + await reader.cancel(error); + throw error; + } + } else { + const reader = respBody.getReader(); + let first = true; + a: + while (true) { + const { value, done } = await reader.read(); + if (first) { + first = false; + core.ops.op_flash_respond( + serverId, + i, + http1Response( + method, + innerResp.status ?? 200, + innerResp.headerList, + null, + ), + value ?? new Uint8Array(), + false, + ); + } else { + if (value === undefined) { + core.ops.op_flash_respond_chuncked( + serverId, + i, + undefined, + done, + ); + } else { + respondChunked( + i, + value, + done, + ); + } + } + if (done) break a; + } + } + } else { + const responseStr = http1Response( + method, + innerResp.status ?? 200, + innerResp.headerList, + respBody, + ); + + // TypedArray + if (typeof responseStr !== "string") { + respondFast(i, responseStr, !ws); + } else { + // string + const maybeResponse = stringResources[responseStr]; + if (maybeResponse === undefined) { + stringResources[responseStr] = core.encode(responseStr); + core.ops.op_flash_respond( + serverId, + i, + stringResources[responseStr], + null, + !ws, // Don't close socket if there is a deferred websocket upgrade. + ); + } else { + respondFast(i, maybeResponse, !ws); + } + } + } + + if (ws) { + const wsRid = await core.opAsync( + "op_flash_upgrade_websocket", + serverId, + i, + ); + ws[_rid] = wsRid; + ws[_protocol] = resp.headers.get("sec-websocket-protocol"); + + ws[_readyState] = WebSocket.OPEN; + const event = new Event("open"); + ws.dispatchEvent(event); + + ws[_eventLoop](); + if (ws[_idleTimeoutDuration]) { + ws.addEventListener( + "close", + () => clearTimeout(ws[_idleTimeoutTimeout]), + ); + } + ws[_serverHandleIdleTimeout](); + } + } + } + await server.finished; + }, + }; + + signal?.addEventListener("abort", () => { + clearInterval(dateInterval); + server.close().then(() => {}, () => {}); + }, { + once: true, + }); + + const fastOp = prepareFastCalls(); + let nextRequestSync = () => fastOp.nextRequest(); + let getMethodSync = (token) => fastOp.getMethod(token); + let respondChunked = (token, chunk, shutdown) => + fastOp.respondChunked(token, chunk, shutdown); + let respondFast = (token, response, shutdown) => + fastOp.respond(token, response, shutdown); + if (serverId > 0) { + nextRequestSync = () => core.ops.op_flash_next_server(serverId); + getMethodSync = (token) => core.ops.op_flash_method(serverId, token); + respondChunked = (token, chunk, shutdown) => + core.ops.op_flash_respond_chuncked(serverId, token, chunk, shutdown); + respondFast = (token, response, shutdown) => + core.ops.op_flash_respond(serverId, token, response, null, shutdown); + } + + if (!dateInterval) { + date = new Date().toUTCString(); + dateInterval = setInterval(() => { + date = new Date().toUTCString(); + stringResources = {}; + }, 1000); + } + + return server.serve().catch(console.error); + } + + function createRequestBodyStream(serverId, token) { + // The first packet is left over bytes after parsing the request + const firstRead = core.ops.op_flash_first_packet( + serverId, + token, + ); + if (!firstRead) return null; + let firstEnqueued = firstRead.byteLength == 0; + + return new ReadableStream({ + type: "bytes", + async pull(controller) { + try { + if (firstEnqueued === false) { + controller.enqueue(firstRead); + firstEnqueued = true; + return; + } + // This is the largest possible size for a single packet on a TLS + // stream. + const chunk = new Uint8Array(16 * 1024 + 256); + const read = await core.opAsync( + "op_flash_read_body", + serverId, + token, + chunk, + ); + if (read > 0) { + // We read some data. Enqueue it onto the stream. + controller.enqueue(TypedArrayPrototypeSubarray(chunk, 0, read)); + } else { + // We have reached the end of the body, so we close the stream. + controller.close(); + } + } catch (err) { + // There was an error while reading a chunk of the body, so we + // error. + controller.error(err); + controller.close(); + } + }, + }); + } + + window.__bootstrap.flash = { + serve, + serveTls, + }; +})(this); diff --git a/ext/flash/Cargo.toml b/ext/flash/Cargo.toml new file mode 100644 index 000000000..f61bc025d --- /dev/null +++ b/ext/flash/Cargo.toml @@ -0,0 +1,29 @@ +# Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. + +[package] +name = "deno_flash" +version = "0.1.0" +authors = ["the Deno authors"] +edition = "2021" +license = "MIT" +readme = "README.md" +repository = "https://github.com/denoland/deno" +description = "Fast HTTP/1 server implementation for Deno" + +[lib] +path = "lib.rs" + +[dependencies] +deno_core = { path = "../../core", version = "0.147.0" } +deno_tls = { version = "0.52.0", path = "../tls" } +# For HTTP/2 and websocket upgrades +deno_websocket = { version = "0.70.0", path = "../websocket" } +http = "0.2.6" +httparse = "1.7" +libc = "0.2" +log = "0.4.17" +mio = { version = "0.8.1", features = ["os-poll", "net"] } +rustls = { version = "0.20" } +rustls-pemfile = { version = "0.2.1" } +serde = { version = "1.0.136", features = ["derive"] } +tokio = { version = "1.19", features = ["full"] } diff --git a/ext/flash/README.md b/ext/flash/README.md new file mode 100644 index 000000000..465c60d47 --- /dev/null +++ b/ext/flash/README.md @@ -0,0 +1,7 @@ +# flash + +Flash is a fast HTTP/1.1 server implementation for Deno. + +```js +serve((req) => new Response("Hello World")); +``` diff --git a/ext/flash/chunked.rs b/ext/flash/chunked.rs new file mode 100644 index 000000000..86417807d --- /dev/null +++ b/ext/flash/chunked.rs @@ -0,0 +1,272 @@ +// Based on https://github.com/frewsxcv/rust-chunked-transfer/blob/5c08614458580f9e7a85124021006d83ce1ed6e9/src/decoder.rs +// Copyright 2015 The tiny-http Contributors +// Copyright 2015 The rust-chunked-transfer Contributors +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. + +use std::error::Error; +use std::fmt; +use std::io::Error as IoError; +use std::io::ErrorKind; +use std::io::Read; +use std::io::Result as IoResult; + +pub struct Decoder<R> { + pub source: R, + + // remaining size of the chunk being read + // none if we are not in a chunk + pub remaining_chunks_size: Option<usize>, + pub end: bool, +} + +impl<R> Decoder<R> +where + R: Read, +{ + pub fn new(source: R, remaining_chunks_size: Option<usize>) -> Decoder<R> { + Decoder { + source, + remaining_chunks_size, + end: false, + } + } + + fn read_chunk_size(&mut self) -> IoResult<usize> { + let mut chunk_size_bytes = Vec::new(); + let mut has_ext = false; + + loop { + let byte = match self.source.by_ref().bytes().next() { + Some(b) => b?, + None => { + return Err(IoError::new(ErrorKind::InvalidInput, DecoderError)) + } + }; + + if byte == b'\r' { + break; + } + + if byte == b';' { + has_ext = true; + break; + } + + chunk_size_bytes.push(byte); + } + + // Ignore extensions for now + if has_ext { + loop { + let byte = match self.source.by_ref().bytes().next() { + Some(b) => b?, + None => { + return Err(IoError::new(ErrorKind::InvalidInput, DecoderError)) + } + }; + if byte == b'\r' { + break; + } + } + } + + self.read_line_feed()?; + + let chunk_size = String::from_utf8(chunk_size_bytes) + .ok() + .and_then(|c| usize::from_str_radix(c.trim(), 16).ok()) + .ok_or_else(|| IoError::new(ErrorKind::InvalidInput, DecoderError))?; + + Ok(chunk_size) + } + + fn read_carriage_return(&mut self) -> IoResult<()> { + match self.source.by_ref().bytes().next() { + Some(Ok(b'\r')) => Ok(()), + _ => Err(IoError::new(ErrorKind::InvalidInput, DecoderError)), + } + } + + fn read_line_feed(&mut self) -> IoResult<()> { + match self.source.by_ref().bytes().next() { + Some(Ok(b'\n')) => Ok(()), + _ => Err(IoError::new(ErrorKind::InvalidInput, DecoderError)), + } + } +} + +impl<R> Read for Decoder<R> +where + R: Read, +{ + fn read(&mut self, buf: &mut [u8]) -> IoResult<usize> { + let remaining_chunks_size = match self.remaining_chunks_size { + Some(c) => c, + None => { + // first possibility: we are not in a chunk, so we'll attempt to determine + // the chunks size + let chunk_size = self.read_chunk_size()?; + + // if the chunk size is 0, we are at EOF + if chunk_size == 0 { + self.read_carriage_return()?; + self.read_line_feed()?; + self.end = true; + return Ok(0); + } + + chunk_size + } + }; + + // second possibility: we continue reading from a chunk + if buf.len() < remaining_chunks_size { + let read = self.source.read(buf)?; + self.remaining_chunks_size = Some(remaining_chunks_size - read); + return Ok(read); + } + + // third possibility: the read request goes further than the current chunk + // we simply read until the end of the chunk and return + let buf = &mut buf[..remaining_chunks_size]; + let read = self.source.read(buf)?; + self.remaining_chunks_size = if read == remaining_chunks_size { + self.read_carriage_return()?; + self.read_line_feed()?; + None + } else { + Some(remaining_chunks_size - read) + }; + + Ok(read) + } +} + +#[derive(Debug, Copy, Clone)] +struct DecoderError; + +impl fmt::Display for DecoderError { + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { + write!(fmt, "Error while decoding chunks") + } +} + +impl Error for DecoderError { + fn description(&self) -> &str { + "Error while decoding chunks" + } +} + +#[cfg(test)] +mod test { + use super::Decoder; + use std::io; + use std::io::Read; + + /// This unit test is taken from from Hyper + /// https://github.com/hyperium/hyper + /// Copyright (c) 2014 Sean McArthur + #[test] + fn test_read_chunk_size() { + fn read(s: &str, expected: usize) { + let mut decoded = Decoder::new(s.as_bytes(), None); + let actual = decoded.read_chunk_size().unwrap(); + assert_eq!(expected, actual); + } + + fn read_err(s: &str) { + let mut decoded = Decoder::new(s.as_bytes(), None); + let err_kind = decoded.read_chunk_size().unwrap_err().kind(); + assert_eq!(err_kind, io::ErrorKind::InvalidInput); + } + + read("1\r\n", 1); + read("01\r\n", 1); + read("0\r\n", 0); + read("00\r\n", 0); + read("A\r\n", 10); + read("a\r\n", 10); + read("Ff\r\n", 255); + read("Ff \r\n", 255); + // Missing LF or CRLF + read_err("F\rF"); + read_err("F"); + // Invalid hex digit + read_err("X\r\n"); + read_err("1X\r\n"); + read_err("-\r\n"); + read_err("-1\r\n"); + // Acceptable (if not fully valid) extensions do not influence the size + read("1;extension\r\n", 1); + read("a;ext name=value\r\n", 10); + read("1;extension;extension2\r\n", 1); + read("1;;; ;\r\n", 1); + read("2; extension...\r\n", 2); + read("3 ; extension=123\r\n", 3); + read("3 ;\r\n", 3); + read("3 ; \r\n", 3); + // Invalid extensions cause an error + read_err("1 invalid extension\r\n"); + read_err("1 A\r\n"); + read_err("1;no CRLF"); + } + + #[test] + fn test_valid_chunk_decode() { + let source = io::Cursor::new( + "3\r\nhel\r\nb\r\nlo world!!!\r\n0\r\n\r\n" + .to_string() + .into_bytes(), + ); + let mut decoded = Decoder::new(source, None); + + let mut string = String::new(); + decoded.read_to_string(&mut string).unwrap(); + + assert_eq!(string, "hello world!!!"); + } + + #[test] + fn test_decode_zero_length() { + let mut decoder = Decoder::new(b"0\r\n\r\n" as &[u8], None); + + let mut decoded = String::new(); + decoder.read_to_string(&mut decoded).unwrap(); + + assert_eq!(decoded, ""); + } + + #[test] + fn test_decode_invalid_chunk_length() { + let mut decoder = Decoder::new(b"m\r\n\r\n" as &[u8], None); + + let mut decoded = String::new(); + assert!(decoder.read_to_string(&mut decoded).is_err()); + } + + #[test] + fn invalid_input1() { + let source = io::Cursor::new( + "2\r\nhel\r\nb\r\nlo world!!!\r\n0\r\n" + .to_string() + .into_bytes(), + ); + let mut decoded = Decoder::new(source, None); + + let mut string = String::new(); + assert!(decoded.read_to_string(&mut string).is_err()); + } + + #[test] + fn invalid_input2() { + let source = io::Cursor::new( + "3\rhel\r\nb\r\nlo world!!!\r\n0\r\n" + .to_string() + .into_bytes(), + ); + let mut decoded = Decoder::new(source, None); + + let mut string = String::new(); + assert!(decoded.read_to_string(&mut string).is_err()); + } +} diff --git a/ext/flash/lib.rs b/ext/flash/lib.rs new file mode 100644 index 000000000..2c0cc548a --- /dev/null +++ b/ext/flash/lib.rs @@ -0,0 +1,1567 @@ +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. + +// False positive lint for explicit drops. +// https://github.com/rust-lang/rust-clippy/issues/6446 +#![allow(clippy::await_holding_lock)] + +use deno_core::error::type_error; +use deno_core::error::AnyError; +use deno_core::op; +use deno_core::serde_v8; +use deno_core::v8; +use deno_core::v8::fast_api; +use deno_core::ByteString; +use deno_core::CancelFuture; +use deno_core::CancelHandle; +use deno_core::Extension; +use deno_core::OpState; +use deno_core::StringOrBuffer; +use deno_core::ZeroCopyBuf; +use deno_core::V8_WRAPPER_OBJECT_INDEX; +use deno_tls::load_certs; +use deno_tls::load_private_keys; +use http::header::HeaderName; +use http::header::CONNECTION; +use http::header::CONTENT_LENGTH; +use http::header::EXPECT; +use http::header::TRANSFER_ENCODING; +use http::header::UPGRADE; +use http::HeaderValue; +use log::trace; +use mio::net::TcpListener; +use mio::net::TcpStream; +use mio::Events; +use mio::Interest; +use mio::Poll; +use mio::Token; +use serde::Deserialize; +use serde::Serialize; +use std::cell::RefCell; +use std::cell::UnsafeCell; +use std::collections::HashMap; +use std::ffi::c_void; +use std::future::Future; +use std::intrinsics::transmute; +use std::io::BufReader; +use std::io::Read; +use std::io::Write; +use std::marker::PhantomPinned; +use std::mem::replace; +use std::net::SocketAddr; +use std::pin::Pin; +use std::rc::Rc; +use std::sync::Arc; +use std::sync::Mutex; +use std::task::Context; +use std::time::Duration; +use tokio::sync::mpsc; +use tokio::task::JoinHandle; + +mod chunked; + +#[cfg(unix)] +mod sendfile; + +pub struct FlashContext { + next_server_id: u32, + join_handles: HashMap<u32, JoinHandle<Result<(), AnyError>>>, + pub servers: HashMap<u32, ServerContext>, +} + +pub struct ServerContext { + _addr: SocketAddr, + tx: mpsc::Sender<NextRequest>, + rx: mpsc::Receiver<NextRequest>, + response: HashMap<u32, NextRequest>, + listening_rx: Option<mpsc::Receiver<()>>, + close_tx: mpsc::Sender<()>, + cancel_handle: Rc<CancelHandle>, +} + +struct InnerRequest { + _headers: Vec<httparse::Header<'static>>, + req: httparse::Request<'static, 'static>, + body_offset: usize, + body_len: usize, + buffer: Pin<Box<[u8]>>, +} + +#[derive(Debug, PartialEq)] +enum ParseStatus { + None, + Ongoing(usize), +} + +type TlsTcpStream = rustls::StreamOwned<rustls::ServerConnection, TcpStream>; + +enum InnerStream { + Tcp(TcpStream), + Tls(Box<TlsTcpStream>), +} + +struct Stream { + inner: InnerStream, + detached: bool, + read_rx: Option<mpsc::Receiver<()>>, + read_tx: Option<mpsc::Sender<()>>, + parse_done: ParseStatus, + buffer: UnsafeCell<Vec<u8>>, + read_lock: Arc<Mutex<()>>, + _pin: PhantomPinned, +} + +impl Stream { + pub fn detach_ownership(&mut self) { + self.detached = true; + } + + fn reattach_ownership(&mut self) { + self.detached = false; + } +} + +impl Write for Stream { + #[inline] + fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> { + match self.inner { + InnerStream::Tcp(ref mut stream) => stream.write(buf), + InnerStream::Tls(ref mut stream) => stream.write(buf), + } + } + #[inline] + fn flush(&mut self) -> std::io::Result<()> { + match self.inner { + InnerStream::Tcp(ref mut stream) => stream.flush(), + InnerStream::Tls(ref mut stream) => stream.flush(), + } + } +} + +impl Read for Stream { + #[inline] + fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> { + match self.inner { + InnerStream::Tcp(ref mut stream) => stream.read(buf), + InnerStream::Tls(ref mut stream) => stream.read(buf), + } + } +} + +struct NextRequest { + // Pointer to stream owned by the server loop thread. + // + // Why not Arc<Mutex<Stream>>? Performance. The stream + // is never written to by the server loop thread. + // + // Dereferencing is safe until server thread finishes and + // op_flash_serve resolves or websocket upgrade is performed. + socket: *mut Stream, + inner: InnerRequest, + keep_alive: bool, + #[allow(dead_code)] + upgrade: bool, + content_read: usize, + content_length: Option<u64>, + remaining_chunk_size: Option<usize>, + te_chunked: bool, + expect_continue: bool, +} + +// SAFETY: Sent from server thread to JS thread. +// See comment above for `socket`. +unsafe impl Send for NextRequest {} + +impl NextRequest { + #[inline(always)] + pub fn socket<'a>(&self) -> &'a mut Stream { + // SAFETY: Dereferencing is safe until server thread detaches socket or finishes. + unsafe { &mut *self.socket } + } +} + +#[op] +fn op_flash_respond( + op_state: &mut OpState, + server_id: u32, + token: u32, + response: StringOrBuffer, + maybe_body: Option<ZeroCopyBuf>, + shutdown: bool, +) { + let flash_ctx = op_state.borrow_mut::<FlashContext>(); + let ctx = flash_ctx.servers.get_mut(&server_id).unwrap(); + + let mut close = false; + let sock = match shutdown { + true => { + let tx = ctx.response.remove(&token).unwrap(); + close = !tx.keep_alive; + tx.socket() + } + // In case of a websocket upgrade or streaming response. + false => { + let tx = ctx.response.get(&token).unwrap(); + tx.socket() + } + }; + + sock.read_tx.take(); + sock.read_rx.take(); + + let _ = sock.write(&response); + if let Some(response) = maybe_body { + let _ = sock.write(format!("{:x}", response.len()).as_bytes()); + let _ = sock.write(b"\r\n"); + let _ = sock.write(&response); + let _ = sock.write(b"\r\n"); + } + + // server is done writing and request doesn't want to kept alive. + if shutdown && close { + match &mut sock.inner { + InnerStream::Tcp(stream) => { + // Typically shutdown shouldn't fail. + let _ = stream.shutdown(std::net::Shutdown::Both); + } + InnerStream::Tls(stream) => { + let _ = stream.sock.shutdown(std::net::Shutdown::Both); + } + } + } +} + +#[op] +fn op_flash_respond_chuncked( + op_state: &mut OpState, + server_id: u32, + token: u32, + response: Option<ZeroCopyBuf>, + shutdown: bool, +) { + let flash_ctx = op_state.borrow_mut::<FlashContext>(); + let ctx = flash_ctx.servers.get_mut(&server_id).unwrap(); + match response { + Some(response) => { + respond_chunked(ctx, token, shutdown, Some(&response)); + } + None => { + respond_chunked(ctx, token, shutdown, None); + } + } +} + +#[op] +async fn op_flash_write_resource( + op_state: Rc<RefCell<OpState>>, + response: StringOrBuffer, + server_id: u32, + token: u32, + resource_id: deno_core::ResourceId, +) -> Result<(), AnyError> { + let resource = op_state.borrow_mut().resource_table.take_any(resource_id)?; + let sock = { + let op_state = &mut op_state.borrow_mut(); + let flash_ctx = op_state.borrow_mut::<FlashContext>(); + let ctx = flash_ctx.servers.get_mut(&server_id).unwrap(); + ctx.response.remove(&token).unwrap().socket() + }; + + drop(op_state); + let _ = sock.write(&response); + + #[cfg(unix)] + { + use std::os::unix::io::AsRawFd; + if let InnerStream::Tcp(stream_handle) = &sock.inner { + let stream_handle = stream_handle.as_raw_fd(); + if let Some(fd) = resource.clone().backing_fd() { + // SAFETY: all-zero byte-pattern is a valid value for libc::stat. + let mut stat: libc::stat = unsafe { std::mem::zeroed() }; + // SAFETY: call to libc::fstat. + if unsafe { libc::fstat(fd, &mut stat) } >= 0 { + let _ = sock.write( + format!("Content-Length: {}\r\n\r\n", stat.st_size).as_bytes(), + ); + let tx = sendfile::SendFile { + io: (fd, stream_handle), + written: 0, + }; + tx.await?; + return Ok(()); + } + } + } + } + + let _ = sock.write(b"Transfer-Encoding: chunked\r\n\r\n"); + loop { + let vec = vec![0u8; 64 * 1024]; // 64KB + let buf = ZeroCopyBuf::new_temp(vec); + let (nread, buf) = resource.clone().read_return(buf).await?; + if nread == 0 { + let _ = sock.write(b"0\r\n\r\n"); + break; + } + let response = &buf[..nread]; + + let _ = sock.write(format!("{:x}", response.len()).as_bytes()); + let _ = sock.write(b"\r\n"); + let _ = sock.write(response); + let _ = sock.write(b"\r\n"); + } + + resource.close(); + Ok(()) +} + +pub struct RespondFast; + +impl fast_api::FastFunction for RespondFast { + fn function(&self) -> *const c_void { + op_flash_respond_fast as *const c_void + } + + fn args(&self) -> &'static [fast_api::Type] { + &[ + fast_api::Type::V8Value, + fast_api::Type::Uint32, + fast_api::Type::TypedArray(fast_api::CType::Uint8), + fast_api::Type::Bool, + ] + } + + fn return_type(&self) -> fast_api::CType { + fast_api::CType::Void + } +} + +fn flash_respond( + ctx: &mut ServerContext, + token: u32, + shutdown: bool, + response: &[u8], +) { + let mut close = false; + let sock = match shutdown { + true => { + let tx = ctx.response.remove(&token).unwrap(); + close = !tx.keep_alive; + tx.socket() + } + // In case of a websocket upgrade or streaming response. + false => { + let tx = ctx.response.get(&token).unwrap(); + tx.socket() + } + }; + + sock.read_tx.take(); + sock.read_rx.take(); + + let _ = sock.write(response); + // server is done writing and request doesn't want to kept alive. + if shutdown && close { + match &mut sock.inner { + InnerStream::Tcp(stream) => { + // Typically shutdown shouldn't fail. + let _ = stream.shutdown(std::net::Shutdown::Both); + } + InnerStream::Tls(stream) => { + let _ = stream.sock.shutdown(std::net::Shutdown::Both); + } + } + } +} + +unsafe fn op_flash_respond_fast( + recv: v8::Local<v8::Object>, + token: u32, + response: *const fast_api::FastApiTypedArray<u8>, + shutdown: bool, +) { + let ptr = + recv.get_aligned_pointer_from_internal_field(V8_WRAPPER_OBJECT_INDEX); + let ctx = &mut *(ptr as *mut ServerContext); + + let response = &*response; + if let Some(response) = response.get_storage_if_aligned() { + flash_respond(ctx, token, shutdown, response); + } else { + todo!(); + } +} + +pub struct RespondChunkedFast; + +impl fast_api::FastFunction for RespondChunkedFast { + fn function(&self) -> *const c_void { + op_flash_respond_chunked_fast as *const c_void + } + + fn args(&self) -> &'static [fast_api::Type] { + &[ + fast_api::Type::V8Value, + fast_api::Type::Uint32, + fast_api::Type::TypedArray(fast_api::CType::Uint8), + fast_api::Type::Bool, + ] + } + + fn return_type(&self) -> fast_api::CType { + fast_api::CType::Void + } +} + +unsafe fn op_flash_respond_chunked_fast( + recv: v8::Local<v8::Object>, + token: u32, + response: *const fast_api::FastApiTypedArray<u8>, + shutdown: bool, +) { + let ptr = + recv.get_aligned_pointer_from_internal_field(V8_WRAPPER_OBJECT_INDEX); + let ctx = &mut *(ptr as *mut ServerContext); + + let response = &*response; + if let Some(response) = response.get_storage_if_aligned() { + respond_chunked(ctx, token, shutdown, Some(response)); + } else { + todo!(); + } +} + +fn respond_chunked( + ctx: &mut ServerContext, + token: u32, + shutdown: bool, + response: Option<&[u8]>, +) { + let sock = match shutdown { + true => { + let tx = ctx.response.remove(&token).unwrap(); + tx.socket() + } + // In case of a websocket upgrade or streaming response. + false => { + let tx = ctx.response.get(&token).unwrap(); + tx.socket() + } + }; + + if let Some(response) = response { + let _ = sock.write(format!("{:x}", response.len()).as_bytes()); + let _ = sock.write(b"\r\n"); + let _ = sock.write(response); + let _ = sock.write(b"\r\n"); + } + + // The last chunk + if shutdown { + let _ = sock.write(b"0\r\n\r\n"); + } + sock.reattach_ownership(); +} + +macro_rules! get_request { + ($op_state: ident, $token: ident) => { + get_request!($op_state, 0, $token) + }; + ($op_state: ident, $server_id: expr, $token: ident) => {{ + let flash_ctx = $op_state.borrow_mut::<FlashContext>(); + let ctx = flash_ctx.servers.get_mut(&$server_id).unwrap(); + ctx.response.get_mut(&$token).unwrap() + }}; +} + +#[repr(u32)] +pub enum Method { + GET = 0, + HEAD, + CONNECT, + PUT, + DELETE, + OPTIONS, + TRACE, + POST, + PATCH, +} + +#[inline] +fn get_method(req: &mut NextRequest) -> u32 { + let method = match req.inner.req.method.unwrap() { + "GET" => Method::GET, + "POST" => Method::POST, + "PUT" => Method::PUT, + "DELETE" => Method::DELETE, + "OPTIONS" => Method::OPTIONS, + "HEAD" => Method::HEAD, + "PATCH" => Method::PATCH, + "TRACE" => Method::TRACE, + "CONNECT" => Method::CONNECT, + _ => Method::GET, + }; + method as u32 +} + +#[op] +fn op_flash_method(state: &mut OpState, server_id: u32, token: u32) -> u32 { + let req = get_request!(state, server_id, token); + get_method(req) +} + +#[op] +async fn op_flash_close_server(state: Rc<RefCell<OpState>>, server_id: u32) { + let close_tx = { + let mut op_state = state.borrow_mut(); + let flash_ctx = op_state.borrow_mut::<FlashContext>(); + let ctx = flash_ctx.servers.get_mut(&server_id).unwrap(); + ctx.cancel_handle.cancel(); + ctx.close_tx.clone() + }; + let _ = close_tx.send(()).await; +} + +#[op] +fn op_flash_path( + state: Rc<RefCell<OpState>>, + server_id: u32, + token: u32, +) -> String { + let mut op_state = state.borrow_mut(); + let flash_ctx = op_state.borrow_mut::<FlashContext>(); + let ctx = flash_ctx.servers.get_mut(&server_id).unwrap(); + ctx + .response + .get(&token) + .unwrap() + .inner + .req + .path + .unwrap() + .to_string() +} + +#[inline] +fn next_request_sync(ctx: &mut ServerContext) -> u32 { + let mut tokens = 0; + while let Ok(token) = ctx.rx.try_recv() { + ctx.response.insert(tokens, token); + tokens += 1; + } + tokens +} + +pub struct NextRequestFast; + +impl fast_api::FastFunction for NextRequestFast { + fn function(&self) -> *const c_void { + op_flash_next_fast as *const c_void + } + + fn args(&self) -> &'static [fast_api::Type] { + &[fast_api::Type::V8Value] + } + + fn return_type(&self) -> fast_api::CType { + fast_api::CType::Uint32 + } +} + +unsafe fn op_flash_next_fast(recv: v8::Local<v8::Object>) -> u32 { + let ptr = + recv.get_aligned_pointer_from_internal_field(V8_WRAPPER_OBJECT_INDEX); + let ctx = &mut *(ptr as *mut ServerContext); + next_request_sync(ctx) +} + +pub struct GetMethodFast; + +impl fast_api::FastFunction for GetMethodFast { + fn function(&self) -> *const c_void { + op_flash_get_method_fast as *const c_void + } + + fn args(&self) -> &'static [fast_api::Type] { + &[fast_api::Type::V8Value, fast_api::Type::Uint32] + } + + fn return_type(&self) -> fast_api::CType { + fast_api::CType::Uint32 + } +} + +unsafe fn op_flash_get_method_fast( + recv: v8::Local<v8::Object>, + token: u32, +) -> u32 { + let ptr = + recv.get_aligned_pointer_from_internal_field(V8_WRAPPER_OBJECT_INDEX); + let ctx = &mut *(ptr as *mut ServerContext); + let req = ctx.response.get_mut(&token).unwrap(); + get_method(req) +} + +// Fast calls +#[op(v8)] +fn op_flash_make_request<'scope>( + scope: &mut v8::HandleScope<'scope>, + state: &mut OpState, +) -> serde_v8::Value<'scope> { + let object_template = v8::ObjectTemplate::new(scope); + assert!(object_template + .set_internal_field_count((V8_WRAPPER_OBJECT_INDEX + 1) as usize)); + let obj = object_template.new_instance(scope).unwrap(); + let ctx = { + let flash_ctx = state.borrow_mut::<FlashContext>(); + let ctx = flash_ctx.servers.get_mut(&0).unwrap(); + ctx as *mut ServerContext + }; + obj.set_aligned_pointer_in_internal_field(V8_WRAPPER_OBJECT_INDEX, ctx as _); + + // nextRequest + { + let builder = v8::FunctionTemplate::builder( + |_: &mut v8::HandleScope, + args: v8::FunctionCallbackArguments, + mut rv: v8::ReturnValue| { + let external: v8::Local<v8::External> = + args.data().unwrap().try_into().unwrap(); + // SAFETY: This external is guaranteed to be a pointer to a ServerContext + let ctx = unsafe { &mut *(external.value() as *mut ServerContext) }; + rv.set_uint32(next_request_sync(ctx)); + }, + ) + .data(v8::External::new(scope, ctx as *mut _).into()); + + let func = builder.build_fast(scope, &NextRequestFast, None); + let func: v8::Local<v8::Value> = func.get_function(scope).unwrap().into(); + + let key = v8::String::new(scope, "nextRequest").unwrap(); + obj.set(scope, key.into(), func).unwrap(); + } + + // getMethod + { + let builder = v8::FunctionTemplate::builder( + |scope: &mut v8::HandleScope, + args: v8::FunctionCallbackArguments, + mut rv: v8::ReturnValue| { + let external: v8::Local<v8::External> = + args.data().unwrap().try_into().unwrap(); + // SAFETY: This external is guaranteed to be a pointer to a ServerContext + let ctx = unsafe { &mut *(external.value() as *mut ServerContext) }; + let token = args.get(0).uint32_value(scope).unwrap(); + let req = ctx.response.get_mut(&token).unwrap(); + rv.set_uint32(get_method(req)); + }, + ) + .data(v8::External::new(scope, ctx as *mut _).into()); + + let func = builder.build_fast(scope, &GetMethodFast, None); + let func: v8::Local<v8::Value> = func.get_function(scope).unwrap().into(); + + let key = v8::String::new(scope, "getMethod").unwrap(); + obj.set(scope, key.into(), func).unwrap(); + } + + // respondChunked + { + let builder = v8::FunctionTemplate::builder( + |scope: &mut v8::HandleScope, + args: v8::FunctionCallbackArguments, + _: v8::ReturnValue| { + let external: v8::Local<v8::External> = + args.data().unwrap().try_into().unwrap(); + // SAFETY: This external is guaranteed to be a pointer to a ServerContext + let ctx = unsafe { &mut *(external.value() as *mut ServerContext) }; + + let token = args.get(0).uint32_value(scope).unwrap(); + + let response: v8::Local<v8::ArrayBufferView> = + args.get(1).try_into().unwrap(); + let ab = response.buffer(scope).unwrap(); + let store = ab.get_backing_store(); + let (offset, len) = (response.byte_offset(), response.byte_length()); + // SAFETY: v8::SharedRef<v8::BackingStore> is similar to Arc<[u8]>, + // it points to a fixed continuous slice of bytes on the heap. + // We assume it's initialized and thus safe to read (though may not contain meaningful data) + let response = unsafe { + &*(&store[offset..offset + len] as *const _ as *const [u8]) + }; + + let shutdown = args.get(2).boolean_value(scope); + + respond_chunked(ctx, token, shutdown, Some(response)); + }, + ) + .data(v8::External::new(scope, ctx as *mut _).into()); + + let func = builder.build_fast(scope, &RespondChunkedFast, None); + let func: v8::Local<v8::Value> = func.get_function(scope).unwrap().into(); + + let key = v8::String::new(scope, "respondChunked").unwrap(); + obj.set(scope, key.into(), func).unwrap(); + } + + // respond + { + let builder = v8::FunctionTemplate::builder( + |scope: &mut v8::HandleScope, + args: v8::FunctionCallbackArguments, + _: v8::ReturnValue| { + let external: v8::Local<v8::External> = + args.data().unwrap().try_into().unwrap(); + // SAFETY: This external is guaranteed to be a pointer to a ServerContext + let ctx = unsafe { &mut *(external.value() as *mut ServerContext) }; + + let token = args.get(0).uint32_value(scope).unwrap(); + + let response: v8::Local<v8::ArrayBufferView> = + args.get(1).try_into().unwrap(); + let ab = response.buffer(scope).unwrap(); + let store = ab.get_backing_store(); + let (offset, len) = (response.byte_offset(), response.byte_length()); + // SAFETY: v8::SharedRef<v8::BackingStore> is similar to Arc<[u8]>, + // it points to a fixed continuous slice of bytes on the heap. + // We assume it's initialized and thus safe to read (though may not contain meaningful data) + let response = unsafe { + &*(&store[offset..offset + len] as *const _ as *const [u8]) + }; + + let shutdown = args.get(2).boolean_value(scope); + + flash_respond(ctx, token, shutdown, response); + }, + ) + .data(v8::External::new(scope, ctx as *mut _).into()); + + let func = builder.build_fast(scope, &RespondFast, None); + let func: v8::Local<v8::Value> = func.get_function(scope).unwrap().into(); + + let key = v8::String::new(scope, "respond").unwrap(); + obj.set(scope, key.into(), func).unwrap(); + } + + let value: v8::Local<v8::Value> = obj.into(); + value.into() +} + +#[inline] +fn has_body_stream(req: &NextRequest) -> bool { + let sock = req.socket(); + sock.read_rx.is_some() +} + +#[op] +fn op_flash_has_body_stream( + op_state: &mut OpState, + server_id: u32, + token: u32, +) -> bool { + let req = get_request!(op_state, server_id, token); + has_body_stream(req) +} + +#[op] +fn op_flash_headers( + state: Rc<RefCell<OpState>>, + server_id: u32, + token: u32, +) -> Result<Vec<(ByteString, ByteString)>, AnyError> { + let mut op_state = state.borrow_mut(); + let flash_ctx = op_state.borrow_mut::<FlashContext>(); + let ctx = flash_ctx + .servers + .get_mut(&server_id) + .ok_or_else(|| type_error("server closed"))?; + let inner_req = &ctx + .response + .get(&token) + .ok_or_else(|| type_error("request closed"))? + .inner + .req; + Ok( + inner_req + .headers + .iter() + .map(|h| (h.name.as_bytes().into(), h.value.into())) + .collect(), + ) +} + +// Remember the first packet we read? It probably also has some body data. This op quickly copies it into +// a buffer and sets up channels for streaming the rest. +#[op] +fn op_flash_first_packet( + op_state: &mut OpState, + server_id: u32, + token: u32, +) -> Result<Option<ZeroCopyBuf>, AnyError> { + let tx = get_request!(op_state, server_id, token); + let sock = tx.socket(); + + if !tx.te_chunked && tx.content_length.is_none() { + return Ok(None); + } + + if tx.expect_continue { + let _ = sock.write(b"HTTP/1.1 100 Continue\r\n\r\n"); + tx.expect_continue = false; + } + + let buffer = &tx.inner.buffer[tx.inner.body_offset..tx.inner.body_len]; + // Oh there is nothing here. + if buffer.is_empty() { + return Ok(Some(ZeroCopyBuf::empty())); + } + + if tx.te_chunked { + let mut buf = vec![0; 1024]; + let mut offset = 0; + let mut decoder = chunked::Decoder::new( + std::io::Cursor::new(buffer), + tx.remaining_chunk_size, + ); + + loop { + match decoder.read(&mut buf[offset..]) { + Ok(n) => { + tx.remaining_chunk_size = decoder.remaining_chunks_size; + offset += n; + + if n == 0 { + tx.te_chunked = false; + buf.truncate(offset); + return Ok(Some(buf.into())); + } + + if offset < buf.len() + && decoder.source.position() < buffer.len() as u64 + { + continue; + } + + buf.truncate(offset); + return Ok(Some(buf.into())); + } + Err(e) => { + return Err(type_error(format!("{}", e))); + } + } + } + } + + tx.content_length + .ok_or_else(|| type_error("no content-length"))?; + tx.content_read += buffer.len(); + + Ok(Some(buffer.to_vec().into())) +} + +#[op] +async fn op_flash_read_body( + state: Rc<RefCell<OpState>>, + server_id: u32, + token: u32, + mut buf: ZeroCopyBuf, +) -> usize { + // SAFETY: we cannot hold op_state borrow across the await point. The JS caller + // is responsible for ensuring this is not called concurrently. + let ctx = unsafe { + { + let op_state = &mut state.borrow_mut(); + let flash_ctx = op_state.borrow_mut::<FlashContext>(); + flash_ctx.servers.get_mut(&server_id).unwrap() as *mut ServerContext + } + .as_mut() + .unwrap() + }; + let tx = ctx.response.get_mut(&token).unwrap(); + + if tx.te_chunked { + let mut decoder = + chunked::Decoder::new(tx.socket(), tx.remaining_chunk_size); + loop { + let sock = tx.socket(); + + let _lock = sock.read_lock.lock().unwrap(); + match decoder.read(&mut buf) { + Ok(n) => { + tx.remaining_chunk_size = decoder.remaining_chunks_size; + return n; + } + Err(e) if e.kind() == std::io::ErrorKind::InvalidInput => { + panic!("chunked read error: {}", e); + } + Err(_) => { + drop(_lock); + sock.read_rx.as_mut().unwrap().recv().await.unwrap(); + } + } + } + } + + if let Some(content_length) = tx.content_length { + let sock = tx.socket(); + let l = sock.read_lock.clone(); + + loop { + let _lock = l.lock().unwrap(); + if tx.content_read >= content_length as usize { + return 0; + } + match sock.read(&mut buf) { + Ok(n) => { + tx.content_read += n; + return n; + } + _ => { + drop(_lock); + sock.read_rx.as_mut().unwrap().recv().await.unwrap(); + } + } + } + } + + 0 +} + +// https://github.com/hyperium/hyper/blob/0c8ee93d7f557afc63ca2a5686d19071813ab2b7/src/headers.rs#L67 +#[inline] +fn from_digits(bytes: &[u8]) -> Option<u64> { + // cannot use FromStr for u64, since it allows a signed prefix + let mut result = 0u64; + const RADIX: u64 = 10; + if bytes.is_empty() { + return None; + } + for &b in bytes { + // can't use char::to_digit, since we haven't verified these bytes + // are utf-8. + match b { + b'0'..=b'9' => { + result = result.checked_mul(RADIX)?; + result = result.checked_add((b - b'0') as u64)?; + } + _ => { + return None; + } + } + } + Some(result) +} + +#[inline] +fn connection_has(value: &HeaderValue, needle: &str) -> bool { + if let Ok(s) = value.to_str() { + for val in s.split(',') { + if val.trim().eq_ignore_ascii_case(needle) { + return true; + } + } + } + false +} + +#[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ListenOpts { + cert: Option<String>, + key: Option<String>, + hostname: String, + port: u16, + use_tls: bool, +} + +fn run_server( + tx: mpsc::Sender<NextRequest>, + listening_tx: mpsc::Sender<()>, + mut close_rx: mpsc::Receiver<()>, + addr: SocketAddr, + maybe_cert: Option<String>, + maybe_key: Option<String>, +) -> Result<(), AnyError> { + let mut listener = TcpListener::bind(addr)?; + let mut poll = Poll::new()?; + let token = Token(0); + poll + .registry() + .register(&mut listener, token, Interest::READABLE) + .unwrap(); + + let tls_context: Option<Arc<rustls::ServerConfig>> = { + if let Some(cert) = maybe_cert { + let key = maybe_key.unwrap(); + let certificate_chain: Vec<rustls::Certificate> = + load_certs(&mut BufReader::new(cert.as_bytes()))?; + let private_key = load_private_keys(key.as_bytes())?.remove(0); + + let config = rustls::ServerConfig::builder() + .with_safe_defaults() + .with_no_client_auth() + .with_single_cert(certificate_chain, private_key) + .expect("invalid key or certificate"); + Some(Arc::new(config)) + } else { + None + } + }; + + listening_tx.blocking_send(()).unwrap(); + let mut sockets = HashMap::with_capacity(1000); + let mut counter: usize = 1; + let mut events = Events::with_capacity(1024); + 'outer: loop { + let result = close_rx.try_recv(); + if result.is_ok() { + break 'outer; + } + // FIXME(bartlomieju): how does Tokio handle it? I just put random 100ms + // timeout here to handle close signal. + match poll.poll(&mut events, Some(Duration::from_millis(100))) { + Err(ref e) if e.kind() == std::io::ErrorKind::Interrupted => continue, + Err(e) => panic!("{}", e), + Ok(()) => (), + } + 'events: for event in &events { + if close_rx.try_recv().is_ok() { + break 'outer; + } + let token = event.token(); + match token { + Token(0) => loop { + match listener.accept() { + Ok((mut socket, _)) => { + counter += 1; + let token = Token(counter); + poll + .registry() + .register(&mut socket, token, Interest::READABLE) + .unwrap(); + let socket = match tls_context { + Some(ref tls_conf) => { + let connection = + rustls::ServerConnection::new(tls_conf.clone()).unwrap(); + InnerStream::Tls(Box::new(rustls::StreamOwned::new( + connection, socket, + ))) + } + None => InnerStream::Tcp(socket), + }; + let stream = Box::pin(Stream { + inner: socket, + detached: false, + read_rx: None, + read_tx: None, + read_lock: Arc::new(Mutex::new(())), + parse_done: ParseStatus::None, + buffer: UnsafeCell::new(vec![0_u8; 1024]), + _pin: PhantomPinned, + }); + + trace!("New connection: {}", token.0); + sockets.insert(token, stream); + } + Err(ref e) if e.kind() == std::io::ErrorKind::WouldBlock => break, + Err(_) => break, + } + }, + token => { + let socket = sockets.get_mut(&token).unwrap(); + // SAFETY: guarantee that we will never move the data out of the mutable reference. + let socket = unsafe { + let mut_ref: Pin<&mut Stream> = Pin::as_mut(socket); + Pin::get_unchecked_mut(mut_ref) + }; + let sock_ptr = socket as *mut _; + + if socket.detached { + match &mut socket.inner { + InnerStream::Tcp(ref mut socket) => { + poll.registry().deregister(socket).unwrap(); + } + InnerStream::Tls(_) => { + todo!("upgrade tls not implemented"); + } + } + + let boxed = sockets.remove(&token).unwrap(); + std::mem::forget(boxed); + trace!("Socket detached: {}", token.0); + continue; + } + + debug_assert!(event.is_readable()); + + trace!("Socket readable: {}", token.0); + if let Some(tx) = &socket.read_tx { + { + let _l = socket.read_lock.lock().unwrap(); + } + trace!("Sending readiness notification: {}", token.0); + let _ = tx.blocking_send(()); + + continue; + } + + let mut headers = vec![httparse::EMPTY_HEADER; 40]; + let mut req = httparse::Request::new(&mut headers); + let body_offset; + let body_len; + loop { + // SAFETY: It is safe for the read buf to be mutable here. + let buffer = unsafe { &mut *socket.buffer.get() }; + let offset = match socket.parse_done { + ParseStatus::None => 0, + ParseStatus::Ongoing(offset) => offset, + }; + if offset >= buffer.len() { + buffer.resize(offset * 2, 0); + } + let nread = socket.read(&mut buffer[offset..]); + + match nread { + Ok(0) => { + trace!("Socket closed: {}", token.0); + // FIXME: don't remove while JS is writing! + // sockets.remove(&token); + continue 'events; + } + Ok(read) => match req.parse(&buffer[..offset + read]) { + Ok(httparse::Status::Complete(n)) => { + body_offset = n; + body_len = offset + read; + socket.parse_done = ParseStatus::None; + break; + } + Ok(httparse::Status::Partial) => { + socket.parse_done = ParseStatus::Ongoing(offset + read); + continue; + } + Err(_) => { + let _ = socket.write(b"HTTP/1.1 400 Bad Request\r\n\r\n"); + continue 'events; + } + }, + Err(ref e) if e.kind() == std::io::ErrorKind::WouldBlock => { + break 'events + } + Err(_) => break 'events, + } + } + + debug_assert_eq!(socket.parse_done, ParseStatus::None); + if let Some(method) = &req.method { + if method == &"POST" || method == &"PUT" { + let (tx, rx) = mpsc::channel(100); + socket.read_tx = Some(tx); + socket.read_rx = Some(rx); + } + } + + // SAFETY: It is safe for the read buf to be mutable here. + let buffer = unsafe { &mut *socket.buffer.get() }; + let inner_req = InnerRequest { + // SAFETY: backing buffer is pinned and lives as long as the request. + req: unsafe { transmute::<httparse::Request<'_, '_>, _>(req) }, + // SAFETY: backing buffer is pinned and lives as long as the request. + _headers: unsafe { + transmute::<Vec<httparse::Header<'_>>, _>(headers) + }, + buffer: Pin::new( + replace(buffer, vec![0_u8; 1024]).into_boxed_slice(), + ), + body_offset, + body_len, + }; + // h1 + // https://github.com/tiny-http/tiny-http/blob/master/src/client.rs#L177 + // https://github.com/hyperium/hyper/blob/4545c3ef191ce9b5f5d250ee27c4c96f9b71d2c6/src/proto/h1/role.rs#L127 + let mut keep_alive = inner_req.req.version.unwrap() == 1; + let mut upgrade = false; + let mut expect_continue = false; + let mut te = false; + let mut te_chunked = false; + let mut content_length = None; + for header in inner_req.req.headers.iter() { + match HeaderName::from_bytes(header.name.as_bytes()) { + Ok(CONNECTION) => { + // SAFETY: illegal bytes are validated by httparse. + let value = unsafe { + HeaderValue::from_maybe_shared_unchecked(header.value) + }; + if keep_alive { + // 1.1 + keep_alive = !connection_has(&value, "close"); + } else { + // 1.0 + keep_alive = connection_has(&value, "keep-alive"); + } + } + Ok(UPGRADE) => { + upgrade = inner_req.req.version.unwrap() == 1; + } + Ok(TRANSFER_ENCODING) => { + // https://tools.ietf.org/html/rfc7230#section-3.3.3 + debug_assert!(inner_req.req.version.unwrap() == 1); + // Two states for Transfer-Encoding because we want to make sure Content-Length handling knows it. + te = true; + content_length = None; + // SAFETY: illegal bytes are validated by httparse. + let value = unsafe { + HeaderValue::from_maybe_shared_unchecked(header.value) + }; + if let Ok(Some(encoding)) = + value.to_str().map(|s| s.rsplit(',').next()) + { + // Chunked must always be the last encoding + if encoding.trim().eq_ignore_ascii_case("chunked") { + te_chunked = true; + } + } + } + // Transfer-Encoding overrides the Content-Length. + Ok(CONTENT_LENGTH) if !te => { + if let Some(len) = from_digits(header.value) { + if let Some(prev) = content_length { + if prev != len { + let _ = socket.write(b"HTTP/1.1 400 Bad Request\r\n\r\n"); + continue 'events; + } + continue; + } + content_length = Some(len); + } else { + let _ = socket.write(b"HTTP/1.1 400 Bad Request\r\n\r\n"); + continue 'events; + } + } + Ok(EXPECT) if inner_req.req.version.unwrap() != 0 => { + expect_continue = + header.value.eq_ignore_ascii_case(b"100-continue"); + } + _ => {} + } + } + + // There is Transfer-Encoding but its not chunked. + if te && !te_chunked { + let _ = socket.write(b"HTTP/1.1 400 Bad Request\r\n\r\n"); + continue 'events; + } + + tx.blocking_send(NextRequest { + socket: sock_ptr, + // SAFETY: headers backing buffer outlives the mio event loop ('static) + inner: inner_req, + keep_alive, + upgrade, + te_chunked, + remaining_chunk_size: None, + content_read: 0, + content_length, + expect_continue, + }) + .ok(); + } + } + } + } + + Ok(()) +} + +#[op] +fn op_flash_serve<P>( + state: &mut OpState, + opts: ListenOpts, +) -> Result<u32, AnyError> +where + P: FlashPermissions + 'static, +{ + if opts.use_tls { + check_unstable(state, "Deno.serveTls"); + } else { + check_unstable(state, "Deno.serve"); + } + state + .borrow_mut::<P>() + .check_net(&(&opts.hostname, Some(opts.port)))?; + let addr = SocketAddr::new(opts.hostname.parse()?, opts.port); + let (tx, rx) = mpsc::channel(100); + let (close_tx, close_rx) = mpsc::channel(1); + let (listening_tx, listening_rx) = mpsc::channel(1); + let ctx = ServerContext { + _addr: addr, + tx, + rx, + response: HashMap::with_capacity(1000), + close_tx, + listening_rx: Some(listening_rx), + cancel_handle: CancelHandle::new_rc(), + }; + let tx = ctx.tx.clone(); + let maybe_cert = opts.cert; + let maybe_key = opts.key; + let join_handle = tokio::task::spawn_blocking(move || { + run_server(tx, listening_tx, close_rx, addr, maybe_cert, maybe_key) + }); + let flash_ctx = state.borrow_mut::<FlashContext>(); + let server_id = flash_ctx.next_server_id; + flash_ctx.next_server_id += 1; + flash_ctx.join_handles.insert(server_id, join_handle); + flash_ctx.servers.insert(server_id, ctx); + Ok(server_id) +} + +#[op] +fn op_flash_wait_for_listening( + state: &mut OpState, + server_id: u32, +) -> Result<impl Future<Output = Result<(), AnyError>> + 'static, AnyError> { + let mut listening_rx = { + let flash_ctx = state.borrow_mut::<FlashContext>(); + let server_ctx = flash_ctx + .servers + .get_mut(&server_id) + .ok_or_else(|| type_error("server not found"))?; + server_ctx.listening_rx.take().unwrap() + }; + Ok(async move { + listening_rx.recv().await; + Ok(()) + }) +} + +#[op] +fn op_flash_drive_server( + state: &mut OpState, + server_id: u32, +) -> Result<impl Future<Output = Result<(), AnyError>> + 'static, AnyError> { + let join_handle = { + let flash_ctx = state.borrow_mut::<FlashContext>(); + flash_ctx + .join_handles + .remove(&server_id) + .ok_or_else(|| type_error("server not found"))? + }; + Ok(async move { + join_handle + .await + .map_err(|_| type_error("server join error"))??; + Ok(()) + }) +} + +// Asychronous version of op_flash_next. This can be a bottleneck under +// heavy load, it should be used as a fallback if there are no buffered +// requests i.e `op_flash_next() == 0`. +#[op] +async fn op_flash_next_async( + op_state: Rc<RefCell<OpState>>, + server_id: u32, +) -> u32 { + let ctx = { + let mut op_state = op_state.borrow_mut(); + let flash_ctx = op_state.borrow_mut::<FlashContext>(); + let ctx = flash_ctx.servers.get_mut(&server_id).unwrap(); + ctx as *mut ServerContext + }; + // SAFETY: we cannot hold op_state borrow across the await point. The JS caller + // is responsible for ensuring this is not called concurrently. + let ctx = unsafe { &mut *ctx }; + let cancel_handle = &ctx.cancel_handle; + let mut tokens = 0; + while let Ok(token) = ctx.rx.try_recv() { + ctx.response.insert(tokens, token); + tokens += 1; + } + if tokens == 0 { + if let Ok(Some(req)) = ctx.rx.recv().or_cancel(cancel_handle).await { + ctx.response.insert(tokens, req); + tokens += 1; + } + } + tokens +} + +// Syncrhonous version of op_flash_next_async. Under heavy load, +// this can collect buffered requests from rx channel and return tokens in a single batch. +// +// perf: please do not add any arguments to this op. With optimizations enabled, +// the ContextScope creation is optimized away and the op is as simple as: +// f(info: *const v8::FunctionCallbackInfo) { let rv = ...; rv.set_uint32(op_flash_next()); } +#[op] +fn op_flash_next(op_state: &mut OpState) -> u32 { + let flash_ctx = op_state.borrow_mut::<FlashContext>(); + let ctx = flash_ctx.servers.get_mut(&0).unwrap(); + next_request_sync(ctx) +} + +// Syncrhonous version of op_flash_next_async. Under heavy load, +// this can collect buffered requests from rx channel and return tokens in a single batch. +#[op] +fn op_flash_next_server(op_state: &mut OpState, server_id: u32) -> u32 { + let flash_ctx = op_state.borrow_mut::<FlashContext>(); + let ctx = flash_ctx.servers.get_mut(&server_id).unwrap(); + next_request_sync(ctx) +} + +// Wrapper type for tokio::net::TcpStream that implements +// deno_websocket::UpgradedStream +struct UpgradedStream(tokio::net::TcpStream); +impl tokio::io::AsyncRead for UpgradedStream { + fn poll_read( + self: Pin<&mut Self>, + cx: &mut Context, + buf: &mut tokio::io::ReadBuf, + ) -> std::task::Poll<std::result::Result<(), std::io::Error>> { + Pin::new(&mut self.get_mut().0).poll_read(cx, buf) + } +} + +impl tokio::io::AsyncWrite for UpgradedStream { + fn poll_write( + self: Pin<&mut Self>, + cx: &mut Context, + buf: &[u8], + ) -> std::task::Poll<Result<usize, std::io::Error>> { + Pin::new(&mut self.get_mut().0).poll_write(cx, buf) + } + fn poll_flush( + self: Pin<&mut Self>, + cx: &mut Context, + ) -> std::task::Poll<Result<(), std::io::Error>> { + Pin::new(&mut self.get_mut().0).poll_flush(cx) + } + fn poll_shutdown( + self: Pin<&mut Self>, + cx: &mut Context, + ) -> std::task::Poll<Result<(), std::io::Error>> { + Pin::new(&mut self.get_mut().0).poll_shutdown(cx) + } +} + +impl deno_websocket::Upgraded for UpgradedStream {} + +#[inline] +pub fn detach_socket( + ctx: &mut ServerContext, + token: u32, +) -> Result<tokio::net::TcpStream, AnyError> { + // Two main 'hacks' to get this working: + // * make server thread forget about the socket. `detach_ownership` prevents the socket from being + // dropped on the server thread. + // * conversion from mio::net::TcpStream -> tokio::net::TcpStream. There is no public API so we + // use raw fds. + let tx = ctx + .response + .remove(&token) + .ok_or_else(|| type_error("request closed"))?; + let stream = tx.socket(); + // prevent socket from being dropped on server thread. + // TODO(@littledivy): Box-ify, since there is no overhead. + stream.detach_ownership(); + + #[cfg(unix)] + let std_stream = { + use std::os::unix::prelude::AsRawFd; + use std::os::unix::prelude::FromRawFd; + let fd = match stream.inner { + InnerStream::Tcp(ref tcp) => tcp.as_raw_fd(), + _ => todo!(), + }; + // SAFETY: `fd` is a valid file descriptor. + unsafe { std::net::TcpStream::from_raw_fd(fd) } + }; + #[cfg(windows)] + let std_stream = { + use std::os::windows::prelude::AsRawSocket; + use std::os::windows::prelude::FromRawSocket; + let fd = match stream.inner { + InnerStream::Tcp(ref tcp) => tcp.as_raw_socket(), + _ => todo!(), + }; + // SAFETY: `fd` is a valid file descriptor. + unsafe { std::net::TcpStream::from_raw_socket(fd) } + }; + let stream = tokio::net::TcpStream::from_std(std_stream)?; + Ok(stream) +} + +#[op] +async fn op_flash_upgrade_websocket( + state: Rc<RefCell<OpState>>, + server_id: u32, + token: u32, +) -> Result<deno_core::ResourceId, AnyError> { + let stream = { + let op_state = &mut state.borrow_mut(); + let flash_ctx = op_state.borrow_mut::<FlashContext>(); + detach_socket(flash_ctx.servers.get_mut(&server_id).unwrap(), token)? + }; + deno_websocket::ws_create_server_stream( + &state, + Box::pin(UpgradedStream(stream)), + ) + .await +} + +pub struct Unstable(pub bool); + +fn check_unstable(state: &OpState, api_name: &str) { + let unstable = state.borrow::<Unstable>(); + + if !unstable.0 { + eprintln!( + "Unstable API '{}'. The --unstable flag must be provided.", + api_name + ); + std::process::exit(70); + } +} + +pub trait FlashPermissions { + fn check_net<T: AsRef<str>>( + &mut self, + _host: &(T, Option<u16>), + ) -> Result<(), AnyError>; +} + +pub fn init<P: FlashPermissions + 'static>(unstable: bool) -> Extension { + Extension::builder() + .js(deno_core::include_js_files!( + prefix "deno:ext/flash", + "01_http.js", + )) + .ops(vec![ + op_flash_serve::decl::<P>(), + op_flash_respond::decl(), + op_flash_respond_chuncked::decl(), + op_flash_method::decl(), + op_flash_path::decl(), + op_flash_headers::decl(), + op_flash_next::decl(), + op_flash_next_server::decl(), + op_flash_next_async::decl(), + op_flash_read_body::decl(), + op_flash_upgrade_websocket::decl(), + op_flash_drive_server::decl(), + op_flash_wait_for_listening::decl(), + op_flash_first_packet::decl(), + op_flash_has_body_stream::decl(), + op_flash_close_server::decl(), + op_flash_make_request::decl(), + op_flash_write_resource::decl(), + ]) + .state(move |op_state| { + op_state.put(Unstable(unstable)); + op_state.put(FlashContext { + next_server_id: 0, + join_handles: HashMap::default(), + servers: HashMap::default(), + }); + Ok(()) + }) + .build() +} diff --git a/ext/flash/sendfile.rs b/ext/flash/sendfile.rs new file mode 100644 index 000000000..4efa7bc35 --- /dev/null +++ b/ext/flash/sendfile.rs @@ -0,0 +1,81 @@ +// Forked from https://github.com/Thomasdezeeuw/sendfile/blob/024f82cd4dede9048392a5bd6d8afcd4d5aa83d5/src/lib.rs +// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. + +use std::future::Future; +use std::io; +use std::os::unix::io::RawFd; +use std::pin::Pin; +use std::task::{self, Poll}; + +pub struct SendFile { + pub io: (RawFd, RawFd), + pub written: usize, +} + +impl SendFile { + #[inline] + pub fn try_send(&mut self) -> Result<usize, std::io::Error> { + #[cfg(target_os = "linux")] + { + // This is the maximum the Linux kernel will write in a single call. + let count = 0x7ffff000; + let mut offset = self.written as libc::off_t; + + // SAFETY: call to libc::sendfile() + let res = + unsafe { libc::sendfile(self.io.1, self.io.0, &mut offset, count) }; + if res == -1 { + Err(io::Error::last_os_error()) + } else { + self.written = offset as usize; + Ok(res as usize) + } + } + #[cfg(target_os = "macos")] + { + // Send all bytes. + let mut length = 0; + // On macOS `length` is value-result parameter. It determines the number + // of bytes to write and returns the number of bytes written also in + // case of `EAGAIN` errors. + // SAFETY: call to libc::sendfile() + let res = unsafe { + libc::sendfile( + self.io.0, + self.io.1, + self.written as libc::off_t, + &mut length, + std::ptr::null_mut(), + 0, + ) + }; + self.written += length as usize; + if res == -1 { + Err(io::Error::last_os_error()) + } else { + Ok(length as usize) + } + } + } +} + +impl Future for SendFile { + type Output = Result<(), std::io::Error>; + + fn poll( + mut self: Pin<&mut Self>, + _: &mut task::Context<'_>, + ) -> Poll<Self::Output> { + loop { + match self.try_send() { + Ok(0) => break Poll::Ready(Ok(())), + Ok(_) => continue, + Err(ref err) if err.kind() == io::ErrorKind::WouldBlock => { + break Poll::Pending + } + Err(ref err) if err.kind() == io::ErrorKind::Interrupted => continue, // Try again. + Err(err) => break Poll::Ready(Err(err)), + } + } + } +} diff --git a/ext/http/01_http.js b/ext/http/01_http.js index 7dfe86a75..6df26d09f 100644 --- a/ext/http/01_http.js +++ b/ext/http/01_http.js @@ -13,6 +13,7 @@ newInnerRequest, newInnerResponse, fromInnerResponse, + _flash, } = window.__bootstrap.fetch; const core = window.Deno.core; const { BadResourcePrototype, InterruptedPrototype, ops } = core; @@ -475,6 +476,20 @@ } function upgradeHttp(req) { + if (req[_flash]) { + // NOTE(bartlomieju): + // Access these fields so they are cached on `req` object, otherwise + // they wouldn't be available after the connection gets upgraded. + req.url; + req.method; + req.headers; + + const { serverId, streamRid } = req[_flash]; + const connRid = core.ops.op_flash_upgrade_http(streamRid, serverId); + // TODO(@littledivy): return already read first packet too. + return [new TcpConn(connRid), new Uint8Array()]; + } + req[_deferred] = new Deferred(); return req[_deferred].promise; } @@ -483,5 +498,6 @@ HttpConn, upgradeWebSocket, upgradeHttp, + _ws, }; })(this); diff --git a/ext/http/lib.rs b/ext/http/lib.rs index 27d277654..d1b38fb42 100644 --- a/ext/http/lib.rs +++ b/ext/http/lib.rs @@ -874,6 +874,41 @@ fn op_http_websocket_accept_header(key: String) -> Result<String, AnyError> { Ok(base64::encode(digest)) } +struct UpgradedStream(hyper::upgrade::Upgraded); +impl tokio::io::AsyncRead for UpgradedStream { + fn poll_read( + self: Pin<&mut Self>, + cx: &mut Context, + buf: &mut tokio::io::ReadBuf, + ) -> std::task::Poll<std::result::Result<(), std::io::Error>> { + Pin::new(&mut self.get_mut().0).poll_read(cx, buf) + } +} + +impl tokio::io::AsyncWrite for UpgradedStream { + fn poll_write( + self: Pin<&mut Self>, + cx: &mut Context, + buf: &[u8], + ) -> std::task::Poll<Result<usize, std::io::Error>> { + Pin::new(&mut self.get_mut().0).poll_write(cx, buf) + } + fn poll_flush( + self: Pin<&mut Self>, + cx: &mut Context, + ) -> std::task::Poll<Result<(), std::io::Error>> { + Pin::new(&mut self.get_mut().0).poll_flush(cx) + } + fn poll_shutdown( + self: Pin<&mut Self>, + cx: &mut Context, + ) -> std::task::Poll<Result<(), std::io::Error>> { + Pin::new(&mut self.get_mut().0).poll_shutdown(cx) + } +} + +impl deno_websocket::Upgraded for UpgradedStream {} + #[op] async fn op_http_upgrade_websocket( state: Rc<RefCell<OpState>>, @@ -893,7 +928,9 @@ async fn op_http_upgrade_websocket( }; let transport = hyper::upgrade::on(request).await?; - let ws_rid = ws_create_server_stream(&state, transport).await?; + let ws_rid = + ws_create_server_stream(&state, Box::pin(UpgradedStream(transport))) + .await?; Ok(ws_rid) } diff --git a/ext/web/06_streams.js b/ext/web/06_streams.js index 7f67e81ed..1b753572b 100644 --- a/ext/web/06_streams.js +++ b/ext/web/06_streams.js @@ -5897,6 +5897,7 @@ window.__bootstrap.streams = { // Non-Public + _state, isReadableStreamDisturbed, errorReadableStream, createProxy, diff --git a/ext/websocket/lib.rs b/ext/websocket/lib.rs index 0e642be3f..515f798ac 100644 --- a/ext/websocket/lib.rs +++ b/ext/websocket/lib.rs @@ -34,8 +34,11 @@ use std::cell::RefCell; use std::convert::TryFrom; use std::fmt; use std::path::PathBuf; +use std::pin::Pin; use std::rc::Rc; use std::sync::Arc; +use tokio::io::AsyncRead; +use tokio::io::AsyncWrite; use tokio::net::TcpStream; use tokio_rustls::rustls::RootCertStore; use tokio_rustls::rustls::ServerName; @@ -67,23 +70,25 @@ pub trait WebSocketPermissions { /// would override previously used alias. pub struct UnsafelyIgnoreCertificateErrors(Option<Vec<String>>); -type WsStream = WebSocketStream<MaybeTlsStream<TcpStream>>; +type ClientWsStream = WebSocketStream<MaybeTlsStream<TcpStream>>; +type ServerWsStream = WebSocketStream<Pin<Box<dyn Upgraded>>>; + pub enum WebSocketStreamType { Client { - tx: AsyncRefCell<SplitSink<WsStream, Message>>, - rx: AsyncRefCell<SplitStream<WsStream>>, + tx: AsyncRefCell<SplitSink<ClientWsStream, Message>>, + rx: AsyncRefCell<SplitStream<ClientWsStream>>, }, Server { - tx: AsyncRefCell< - SplitSink<WebSocketStream<hyper::upgrade::Upgraded>, Message>, - >, - rx: AsyncRefCell<SplitStream<WebSocketStream<hyper::upgrade::Upgraded>>>, + tx: AsyncRefCell<SplitSink<ServerWsStream, Message>>, + rx: AsyncRefCell<SplitStream<ServerWsStream>>, }, } +pub trait Upgraded: AsyncRead + AsyncWrite + Unpin {} + pub async fn ws_create_server_stream( state: &Rc<RefCell<OpState>>, - transport: hyper::upgrade::Upgraded, + transport: Pin<Box<dyn Upgraded>>, ) -> Result<ResourceId, AnyError> { let ws_stream = WebSocketStream::from_raw_socket( transport, @@ -340,7 +345,7 @@ where ..Default::default() }), ); - let (stream, response): (WsStream, Response) = + let (stream, response): (ClientWsStream, Response) = if let Some(cancel_resource) = cancel_resource { client.or_cancel(cancel_resource.0.to_owned()).await? } else { diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 49ec952e3..e009f04b7 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -28,6 +28,7 @@ deno_core = { version = "0.147.0", path = "../core" } deno_crypto = { version = "0.79.0", path = "../ext/crypto" } deno_fetch = { version = "0.88.0", path = "../ext/fetch" } deno_ffi = { version = "0.52.0", path = "../ext/ffi" } +deno_flash = { path = "../ext/flash" } deno_http = { version = "0.59.0", path = "../ext/http" } deno_net = { version = "0.57.0", path = "../ext/net" } deno_node = { version = "0.2.0", path = "../ext/node" } @@ -52,6 +53,7 @@ deno_core = { version = "0.147.0", path = "../core" } deno_crypto = { version = "0.79.0", path = "../ext/crypto" } deno_fetch = { version = "0.88.0", path = "../ext/fetch" } deno_ffi = { version = "0.52.0", path = "../ext/ffi" } +deno_flash = { path = "../ext/flash" } deno_http = { version = "0.59.0", path = "../ext/http" } deno_net = { version = "0.57.0", path = "../ext/net" } deno_node = { version = "0.2.0", path = "../ext/node" } diff --git a/runtime/build.rs b/runtime/build.rs index 0c9c0d0d0..0f3d7fb46 100644 --- a/runtime/build.rs +++ b/runtime/build.rs @@ -116,6 +116,15 @@ mod not_docs { } } + impl deno_flash::FlashPermissions for Permissions { + fn check_net<T: AsRef<str>>( + &mut self, + _host: &(T, Option<u16>), + ) -> Result<(), deno_core::error::AnyError> { + unreachable!("snapshotting!") + } + } + impl deno_net::NetPermissions for Permissions { fn check_net<T: AsRef<str>>( &mut self, @@ -165,6 +174,7 @@ mod not_docs { None, ), deno_http::init(), + deno_flash::init::<Permissions>(false), // No --unstable ]; let js_runtime = JsRuntime::new(RuntimeOptions { diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js index f21b261db..b97c05556 100644 --- a/runtime/js/90_deno_ns.js +++ b/runtime/js/90_deno_ns.js @@ -153,5 +153,7 @@ spawnChild: __bootstrap.spawn.spawnChild, spawn: __bootstrap.spawn.spawn, spawnSync: __bootstrap.spawn.spawnSync, + serve: __bootstrap.flash.serve, + serveTls: __bootstrap.flash.serveTls, }; })(this); diff --git a/runtime/ops/http.rs b/runtime/ops/http.rs index 67d939976..7a58da361 100644 --- a/runtime/ops/http.rs +++ b/runtime/ops/http.rs @@ -27,7 +27,11 @@ use tokio::net::UnixStream; pub fn init() -> Extension { Extension::builder() - .ops(vec![op_http_start::decl(), op_http_upgrade::decl()]) + .ops(vec![ + op_http_start::decl(), + op_http_upgrade::decl(), + op_flash_upgrade_http::decl(), + ]) .build() } @@ -78,6 +82,23 @@ fn op_http_start( Err(bad_resource_id()) } +#[op] +fn op_flash_upgrade_http( + state: &mut OpState, + token: u32, + server_id: u32, +) -> Result<deno_core::ResourceId, AnyError> { + let flash_ctx = state.borrow_mut::<deno_flash::FlashContext>(); + let ctx = flash_ctx.servers.get_mut(&server_id).unwrap(); + + let tcp_stream = deno_flash::detach_socket(ctx, token)?; + Ok( + state + .resource_table + .add(TcpStreamResource::new(tcp_stream.into_split())), + ) +} + #[derive(Serialize)] #[serde(rename_all = "camelCase")] pub struct HttpUpgradeResult { diff --git a/runtime/ops/io.rs b/runtime/ops/io.rs index 2dcb9964a..900be1034 100644 --- a/runtime/ops/io.rs +++ b/runtime/ops/io.rs @@ -582,6 +582,16 @@ impl Resource for StdFileResource { fn write(self: Rc<Self>, buf: ZeroCopyBuf) -> AsyncResult<usize> { Box::pin(self.write(buf)) } + + #[cfg(unix)] + fn backing_fd(self: Rc<Self>) -> Option<std::os::unix::prelude::RawFd> { + use std::os::unix::io::AsRawFd; + self + .with_inner_and_metadata(move |std_file, _| { + Ok(std_file.with_file(|f| f.as_raw_fd())) + }) + .ok() + } } // override op_print to use the stdout and stderr in the resource table diff --git a/runtime/permissions.rs b/runtime/permissions.rs index 9602b94d5..0a5560833 100644 --- a/runtime/permissions.rs +++ b/runtime/permissions.rs @@ -1313,6 +1313,15 @@ impl Permissions { } } +impl deno_flash::FlashPermissions for Permissions { + fn check_net<T: AsRef<str>>( + &mut self, + host: &(T, Option<u16>), + ) -> Result<(), AnyError> { + self.net.check(host) + } +} + impl deno_net::NetPermissions for Permissions { fn check_net<T: AsRef<str>>( &mut self, diff --git a/runtime/web_worker.rs b/runtime/web_worker.rs index a4a2516a9..dd7f49aef 100644 --- a/runtime/web_worker.rs +++ b/runtime/web_worker.rs @@ -429,6 +429,7 @@ impl WebWorker { ops::signal::init(), ops::tty::init(), deno_http::init(), + deno_flash::init::<Permissions>(unstable), ops::http::init(), // Permissions ext (worker specific state) perm_ext, diff --git a/runtime/worker.rs b/runtime/worker.rs index 0336e8340..53d8c6377 100644 --- a/runtime/worker.rs +++ b/runtime/worker.rs @@ -170,6 +170,7 @@ impl MainWorker { ops::signal::init(), ops::tty::init(), deno_http::init(), + deno_flash::init::<Permissions>(unstable), ops::http::init(), // Permissions ext (worker specific state) perm_ext, diff --git a/tools/lint.js b/tools/lint.js index 62f73119f..7bd7658b8 100755 --- a/tools/lint.js +++ b/tools/lint.js @@ -22,6 +22,7 @@ async function dlint() { ":!:cli/tests/testdata/error_008_checkjs.js", ":!:cli/bench/http/node*.js", ":!:cli/bench/testdata/express-router.js", + ":!:cli/bench/testdata/react-dom.js", ":!:cli/compilers/wasm_wrap.js", ":!:cli/dts/**", ":!:cli/tests/testdata/encoding/**", |