diff --git a/CLAUDE.md b/CLAUDE.md index 1a6bdcc5..3e2a02ac 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -92,7 +92,7 @@ The JS output (`pkg-js/dist/shinyreact.js`) is a self-contained IIFE that bundle **Default: module-level state, not globals.** A module singleton is testable, typed, and cannot be clobbered by another script on the page. Reach for it first. -Writing to `window` (including `window.Shiny.*`) is justified in exactly one situation: **state that must be shared per *page*, not per *bundle copy*.** Two copies of this library can be on one page today — the server injects the IIFE bundle even for an npm-tier app, until the opt-out in #217 lands — and each copy has its own module singletons. Anything that must be single per page has to travel through something both copies can see. +Writing to `window` (including `window.Shiny.*`) is justified in exactly one situation: **state that must be shared per *page*, not per *bundle copy*.** Two copies of this library can be on one page today — the page entry points serve `shinyreact.js` unless an npm-tier app passes `shinyreact_js="client"` (#217) — and each copy has its own module singletons. Anything that must be single per page has to travel through something both copies can see. The two sanctioned cases, both mediated by a single accessor: diff --git a/FEATURES.md b/FEATURES.md index 060d8570..70e83c6f 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -532,9 +532,10 @@ registries are exposed on `window.Shiny.reactRegistry`; the message registry on - it attaches the module singleton to `window.Shiny.messageRegistry` on first use (`??=`), so the first copy of the library to run owns the page and later copies adopt it - - two copies can coexist today (the server injects the IIFE even for npm-tier - apps until #217), and Shiny has one dispatcher slot per message type — two - registries would leave one copy's handlers dead + - two copies can still coexist (an npm-tier page that leaves + `shinyreact_js` at its default of `"server"` gets it as well), and Shiny has + one dispatcher slot per message type — two registries would leave one + copy's handlers dead - without `window.Shiny` it returns the module singleton and attaches nothing, since the client legitimately runs before Shiny loads - hooks call the accessor rather than reading `window.Shiny.messageRegistry`, @@ -590,15 +591,23 @@ registries are exposed on `window.Shiny.reactRegistry`; the message registry on `{once: true}`, which would consume the event before Shiny existed and leave discovery uninstalled - it no-ops when there is no `document` +- `getShiny()` returns `undefined` rather than throwing when there is no + `window` at all, not just when Shiny has not loaded + - it is reached from debounce timers and event callbacks that can outlive the + document — a page unloading, or a jsdom test tearing down between the last + input write and its 100 ms debounce — where a bare `window` is a + `ReferenceError`, not `undefined` + - every caller already treats a missing Shiny as "do nothing", so this + degrades the way they expect - **both entry points install it** — `src/index.ts` (IIFE) and `src/npm.ts` (npm ESM), so both tiers get discovery and both send the bootstrap ping - the npm entry omitted it until #233, which left bundler-tier apps with no `shinyreact-deps` handler and no ping, so the server never installed discovery for the session at all - pinned by `entry-parity.test.ts`, which imports each entry and asserts its - side effects — including the two *deliberate* tier differences (only the + side effects — including the three *deliberate* tier differences (only the IIFE installs `window.shinyreact`; only the npm build treats a missing - config tag as fatal) + config tag as fatal; only the npm build warns about a double load) - installing twice is a no-op, so calling it from both entries is safe - the latch is **module-scoped**, so this holds per copy of the library, not per page: two copies each install a `shinyreact-deps` handler and each send @@ -671,6 +680,28 @@ Shared across all of them: the server emits no UI components. Each attaches the shinyreact bundle dependency and the `#shinyreact-config` tag — except `page_bare()`, which attaches neither. +`shinyreact_js=` is shared by `page_react()`, `page_react_html()`, `[py]` +`set_react_page()`, and `[py]` `ReactApp()` — who supplies `shinyreact.js` and +`shinyreact.css` to the page: + +- it defaults to `"server"` — the package serves both as an `HTMLDependency` +- `"client"` omits **both files**; the `#shinyreact-config` tag is still + emitted, because the npm-tier client hard-errors without it +- it is for the npm tier: a client importing `@posit/shinyreact` bundles its own + copy, so serving them too puts two copies of React and the hooks on the page +- any other value raises, naming the bad value and both valid ones + - `[py]` `ValueError`; `[r]` `cli_abort` + - `[py]` `set_react_page()` and `ReactApp()` validate eagerly at call time, + not at first page render, so a typo fails at app startup +- the server never validates the *choice* — it cannot: whether the client + bundles a copy is a property of the built `ui.js`, known only once it + executes, after the page's script tags are already committed + - wrong in one direction (`"server"`, client bundles too) → two copies; the + app works, and `[js]` the npm entry `console.warn`s naming `shinyreact_js` + - wrong in the other (`"client"`, client bundles nothing) → + `window.shinyreact` is `undefined` and the app's first hook call throws; no + shinyreact code is on the page to say anything about it + ### `page_bare(*args, title=None, lang="en", **kwargs)` - the escape hatch: Shiny's own dependencies, nothing of shinyreact's @@ -689,7 +720,7 @@ the shinyreact bundle dependency and the `#shinyreact-config` tag — except - `[r]` needs nothing extra — `...` already forwards named arguments to `bootstrapPage()` -### `page_react(*args, src_dir=None, js_file="ui.js", css_file="ui.css", title=None, lang="en", **kwargs)` +### `page_react(*args, src_dir=None, js_file="ui.js", css_file="ui.css", title=None, lang="en", shinyreact_js="server", **kwargs)` - the zero-config page: no HTML file exists or is needed - it emits **no body HTML at all** — the client appends its own mount @@ -730,7 +761,7 @@ the shinyreact bundle dependency and the `#shinyreact-config` tag — except - `[py]` needs no fallback: the path resolves against the calling module, so it is absolute whether or not it exists -### `page_react_html(path="www/index.html", extra_deps=None)` +### `page_react_html(path="www/index.html", extra_deps=None, shinyreact_js="server")` - for apps that own a complete HTML document (what a Vite build emits) - the document must contain `"` from npm. In the meantime, build the +package first: + +```bash +cd ../../pkg-js && npm install && npm run build +``` + ## How it works Shiny serves a `set_react_page()`-generated page (which loads `www/ui.js` as a module) and the @@ -16,10 +36,6 @@ Component code lives in `src/App.tsx` (the Fast Refresh boundary). The entry `src/ui.tsx` only mounts it — keep `createRoot()` there, never in a file that also defines components, or Fast Refresh falls back to a full reload. -In dev the example bundles its own dev React + the `shiny-react` hooks (Fast -Refresh needs a development React build). In the production build those are -externalized to the shared `window.shinyreact`. - ## Develop (two terminals) ```bash diff --git a/examples/09-hmr/app.py b/examples/09-hmr/app.py index d8ac78bf..ef28a707 100644 --- a/examples/09-hmr/app.py +++ b/examples/09-hmr/app.py @@ -1,7 +1,10 @@ from shiny.express import input from shinyreact import reactive_output, set_react_page -set_react_page() +# npm tier: the client imports `@posit/shinyreact` and bundles shinyreact.js +# itself, so the server must not serve it too -- two copies on one page. The +# `#shinyreact-config` tag is still emitted, and the npm client requires it. +set_react_page(shinyreact_js="client") # `input.count()` is pushed from App.tsx via useShinyInput("count", ...); the diff --git a/examples/09-hmr/package.json b/examples/09-hmr/package.json index c86d67b2..98f115ad 100644 --- a/examples/09-hmr/package.json +++ b/examples/09-hmr/package.json @@ -7,6 +7,9 @@ "dev": "vite", "test": "node --test" }, + "dependencies": { + "@posit/shinyreact": "file:../../pkg-js" + }, "devDependencies": { "@vitejs/plugin-react": "^4.3.0", "react": "^19.2.3", diff --git a/examples/09-hmr/src/App.tsx b/examples/09-hmr/src/App.tsx index 1fdf97b7..7083d91b 100644 --- a/examples/09-hmr/src/App.tsx +++ b/examples/09-hmr/src/App.tsx @@ -1,6 +1,6 @@ import { useEffect, useState } from "react"; -import { useShinyInitialized, useShinyInput, useShinyOutputValue } from "shiny-bridge"; +import { useShinyInitialized, useShinyInput, useShinyOutputValue } from "@posit/shinyreact"; // Exported component = a Fast Refresh boundary. Editing this file (e.g. the // heading text below) hot-swaps the component WITHOUT losing `count`. diff --git a/examples/09-hmr/src/shiny-bridge.dev.ts b/examples/09-hmr/src/shiny-bridge.dev.ts deleted file mode 100644 index 8b412dac..00000000 --- a/examples/09-hmr/src/shiny-bridge.dev.ts +++ /dev/null @@ -1,12 +0,0 @@ -// DEV path. The hooks come from the vendored shiny-react source and are bundled -// with this example's OWN dev React (Fast Refresh needs a dev React build; -// window.shinyreact.React is production). `resolve.dedupe` in vite.config keeps -// these and App.tsx on a single React copy. The relative path reaches the -// vendored source at the repo's pkg-js/src/shiny-react/ (served thanks to -// server.fs.allow in vite.config). Downstream apps would import a published -// @posit/shiny-react instead. -export { - useShinyInitialized, - useShinyInput, - useShinyOutputValue, -} from "../../../../pkg-js/src/shiny-react/index"; diff --git a/examples/09-hmr/src/shiny-bridge.prod.ts b/examples/09-hmr/src/shiny-bridge.prod.ts deleted file mode 100644 index 628db859..00000000 --- a/examples/09-hmr/src/shiny-bridge.prod.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -// PROD path. The hooks come from the shinyreact bridge global, sharing the one -// React instance that owns them. This file is aliased in by vite.config only for -// `vite build`. -const sr = (window as any).shinyreact; - -export const useShinyInitialized = sr.useShinyInitialized; -export const useShinyInput = sr.useShinyInput; -export const useShinyOutputValue = sr.useShinyOutputValue; diff --git a/examples/09-hmr/vite.config.js b/examples/09-hmr/vite.config.js index c0a1dae0..28abe8cf 100644 --- a/examples/09-hmr/vite.config.js +++ b/examples/09-hmr/vite.config.js @@ -21,19 +21,15 @@ export default defineConfig(({ command }) => ({ shinyreactDevStub({ entry: ENTRY, outFile: "www/ui.js" }), ], resolve: { - // One React instance across App.tsx and the bundled shiny-react source. + // `@posit/shinyreact` is a `file:` dep, so it is symlinked and brings its + // own node_modules. Without dedupe, App.tsx and the hooks would each get a + // React copy and every hook call would throw. dedupe: ["react", "react-dom"], - alias: { - "shiny-bridge": path.resolve( - __dirname, - command === "serve" ? "src/shiny-bridge.dev.ts" : "src/shiny-bridge.prod.ts", - ), - }, }, server: { port: 5173, strictPort: true, // keep the stub's hard-coded :5173 honest - // Allow serving the vendored shiny-react source that lives outside this dir. + // `@posit/shinyreact` resolves through a symlink to the repo's pkg-js/. fs: { allow: [repoRoot] }, }, build: { @@ -45,15 +41,7 @@ export default defineConfig(({ command }) => ({ name: "HmrExample", fileName: () => "ui.js", }, - rollupOptions: { - external: ["react", "react-dom", "react-dom/client"], - output: { - globals: { - react: "window.shinyreact.React", - "react-dom": "window.shinyreact.ReactDOM", - "react-dom/client": "window.shinyreact.ReactDOM", - }, - }, - }, + // No externals: this app bundles its own React, in both modes. That is the + // point of the npm tier -- a development React with Fast Refresh in dev. }, })); diff --git a/examples/README.md b/examples/README.md index a75e63aa..c17b443b 100644 --- a/examples/README.md +++ b/examples/README.md @@ -29,7 +29,7 @@ see [Example behavior trees](#example-behavior-trees) below. | [06-data-frame](06-data-frame/) | Embeds `@render.data_frame` via `ShinyOutput` and `set_react_page()` | | [07-plotly](07-plotly/) | Embeds `@render_plotly` via `ShinyOutput` and `set_react_page()`. Also ships an `app.R` using `plotly::renderPlotly()` over the same `www/` client — its binding JS is discovered from the render function and pushed automatically | | [08-input-handler](08-input-handler/) | `useShinyInput` with `type="shiny.datetime"` — client sends unix seconds; server `input.when()` is a `datetime.datetime` via Shiny's built-in handler | -| [09-hmr](09-hmr/) | React Fast Refresh in dev (Vite dev server alongside Shiny); the `app.py` and no-build `www/ui.js` paths reload too | +| [09-hmr](09-hmr/) | React Fast Refresh in dev (Vite dev server alongside Shiny). The npm tier: imports `@posit/shinyreact` and bundles its own React, with `set_react_page(shinyreact_js="client")` so the server doesn't also serve shinyreact.js | | [10-bookmarking](10-bookmarking/) | Bookmark restoration: URL query string (or server-stored state) hydrates `useShinyInput` initial values via the `#shinyreact-config` tag emitted by `page_react()` | ## Example behavior trees diff --git a/pkg-js/dist/shinyreact.js b/pkg-js/dist/shinyreact.js index 223504f4..260730d1 100644 --- a/pkg-js/dist/shinyreact.js +++ b/pkg-js/dist/shinyreact.js @@ -1,4 +1,4 @@ -var nm=Object.defineProperty;var im=(ue,nt,ae)=>nt in ue?nm(ue,nt,{enumerable:!0,configurable:!0,writable:!0,value:ae}):ue[nt]=ae;var K=(ue,nt,ae)=>im(ue,typeof nt!="symbol"?nt+"":nt,ae);(function(){"use strict";function ue(t,l){for(var e=0;eu[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}function nt(){return window.Shiny}let ae=!1;function jh(){if(typeof document>"u"||ae)return;ae=!0;const t=()=>{const e=nt();e&&(e.addCustomMessageHandler("shinyreact-deps",async u=>{var a,n;try{const i=e;await((a=i.renderDependenciesAsync)==null?void 0:a.call(i,u)),await((n=i.bindAll)==null?void 0:n.call(i,document.documentElement))}catch(i){console.error("[shinyreact] failed to load pushed dependencies:",i)}}),e.initializedPromise.then(()=>{var u;(u=e.setInputValue)==null||u.call(e,".shinyreact_init:shinyreact.init",1)}))};if(nt()){t();return}const l=()=>{nt()&&(document.removeEventListener("shiny:connected",l),t())};document.addEventListener("shiny:connected",l)}function Vf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var jf={exports:{}},D={};/** +var nm=Object.defineProperty;var im=(ue,nt,ae)=>nt in ue?nm(ue,nt,{enumerable:!0,configurable:!0,writable:!0,value:ae}):ue[nt]=ae;var K=(ue,nt,ae)=>im(ue,typeof nt!="symbol"?nt+"":nt,ae);(function(){"use strict";function ue(t,l){for(var e=0;eu[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}function nt(){if(!(typeof window>"u"))return window.Shiny}let ae=!1;function jh(){if(typeof document>"u"||ae)return;ae=!0;const t=()=>{const e=nt();e&&(e.addCustomMessageHandler("shinyreact-deps",async u=>{var a,n;try{const i=e;await((a=i.renderDependenciesAsync)==null?void 0:a.call(i,u)),await((n=i.bindAll)==null?void 0:n.call(i,document.documentElement))}catch(i){console.error("[shinyreact] failed to load pushed dependencies:",i)}}),e.initializedPromise.then(()=>{var u;(u=e.setInputValue)==null||u.call(e,".shinyreact_init:shinyreact.init",1)}))};if(nt()){t();return}const l=()=>{nt()&&(document.removeEventListener("shiny:connected",l),t())};document.addEventListener("shiny:connected",l)}function Vf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var jf={exports:{}},D={};/** * @license React * react.production.js * @@ -14,7 +14,7 @@ var nm=Object.defineProperty;var im=(ue,nt,ae)=>nt in ue?nm(ue,nt,{enumerable:!0 * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(t){function l(T,Y){var N=T.length;T.push(Y);t:for(;0>>1,vt=T[at];if(0>>1;ata(qf,N))Mea($n,qf)?(T[at]=$n,T[Me]=N,at=Me):(T[at]=qf,T[wn]=N,at=wn);else if(Mea($n,N))T[at]=$n,T[Me]=N,at=Me;else break t}}return Y}function a(T,Y){var N=T.sortIndex-Y.sortIndex;return N!==0?N:T.id-Y.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var n=performance;t.unstable_now=function(){return n.now()}}else{var i=Date,c=i.now();t.unstable_now=function(){return i.now()-c}}var f=[],d=[],r=1,m=null,y=3,v=!1,b=!1,p=!1,H=!1,o=typeof setTimeout=="function"?setTimeout:null,s=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;function S(T){for(var Y=e(d);Y!==null;){if(Y.callback===null)u(d);else if(Y.startTime<=T)u(d),Y.sortIndex=Y.expirationTime,l(f,Y);else break;Y=e(d)}}function E(T){if(p=!1,S(T),!b)if(e(f)!==null)b=!0,_||(_=!0,ee());else{var Y=e(d);Y!==null&&Yf(E,Y.startTime-T)}}var _=!1,z=-1,A=5,M=-1;function R(){return H?!0:!(t.unstable_now()-MT&&R());){var at=m.callback;if(typeof at=="function"){m.callback=null,y=m.priorityLevel;var vt=at(m.expirationTime<=T);if(T=t.unstable_now(),typeof vt=="function"){m.callback=vt,S(T),Y=!0;break l}m===e(f)&&u(f),S(T)}else u(f);m=e(f)}if(m!==null)Y=!0;else{var Jn=e(d);Jn!==null&&Yf(E,Jn.startTime-T),Y=!1}}break t}finally{m=null,y=N,v=!1}Y=void 0}}finally{Y?ee():_=!1}}}var ee;if(typeof h=="function")ee=function(){h(It)};else if(typeof MessageChannel<"u"){var Vh=new MessageChannel,am=Vh.port2;Vh.port1.onmessage=It,ee=function(){am.postMessage(null)}}else ee=function(){o(It,0)};function Yf(T,Y){z=o(function(){T(t.unstable_now())},Y)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(T){T.callback=null},t.unstable_forceFrameRate=function(T){0>T||125at?(T.sortIndex=N,l(d,T),e(f)===null&&T===e(d)&&(p?(s(z),z=-1):p=!0,Yf(E,N-at))):(T.sortIndex=vt,l(f,T),b||v||(b=!0,_||(_=!0,ee()))),T},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(T){var Y=y;return function(){var N=y;y=Y;try{return T.apply(this,arguments)}finally{y=N}}}})(If),kf.exports=If;var l0=kf.exports,Pf={exports:{}},zt={};/** + */(function(t){function l(p,Y){var N=p.length;p.push(Y);t:for(;0>>1,vt=p[at];if(0>>1;ata(qf,N))Mea($n,qf)?(p[at]=$n,p[Me]=N,at=Me):(p[at]=qf,p[wn]=N,at=wn);else if(Mea($n,N))p[at]=$n,p[Me]=N,at=Me;else break t}}return Y}function a(p,Y){var N=p.sortIndex-Y.sortIndex;return N!==0?N:p.id-Y.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var n=performance;t.unstable_now=function(){return n.now()}}else{var i=Date,c=i.now();t.unstable_now=function(){return i.now()-c}}var f=[],d=[],r=1,m=null,y=3,v=!1,b=!1,T=!1,H=!1,o=typeof setTimeout=="function"?setTimeout:null,s=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;function S(p){for(var Y=e(d);Y!==null;){if(Y.callback===null)u(d);else if(Y.startTime<=p)u(d),Y.sortIndex=Y.expirationTime,l(f,Y);else break;Y=e(d)}}function E(p){if(T=!1,S(p),!b)if(e(f)!==null)b=!0,_||(_=!0,ee());else{var Y=e(d);Y!==null&&Yf(E,Y.startTime-p)}}var _=!1,z=-1,A=5,M=-1;function R(){return H?!0:!(t.unstable_now()-Mp&&R());){var at=m.callback;if(typeof at=="function"){m.callback=null,y=m.priorityLevel;var vt=at(m.expirationTime<=p);if(p=t.unstable_now(),typeof vt=="function"){m.callback=vt,S(p),Y=!0;break l}m===e(f)&&u(f),S(p)}else u(f);m=e(f)}if(m!==null)Y=!0;else{var Jn=e(d);Jn!==null&&Yf(E,Jn.startTime-p),Y=!1}}break t}finally{m=null,y=N,v=!1}Y=void 0}}finally{Y?ee():_=!1}}}var ee;if(typeof h=="function")ee=function(){h(It)};else if(typeof MessageChannel<"u"){var Vh=new MessageChannel,am=Vh.port2;Vh.port1.onmessage=It,ee=function(){am.postMessage(null)}}else ee=function(){o(It,0)};function Yf(p,Y){z=o(function(){p(t.unstable_now())},Y)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(p){p.callback=null},t.unstable_forceFrameRate=function(p){0>p||125at?(p.sortIndex=N,l(d,p),e(f)===null&&p===e(d)&&(T?(s(z),z=-1):T=!0,Yf(E,N-at))):(p.sortIndex=vt,l(f,p),b||v||(b=!0,_||(_=!0,ee()))),p},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(p){var Y=y;return function(){var N=y;y=Y;try{return p.apply(this,arguments)}finally{y=N}}}})(If),kf.exports=If;var l0=kf.exports,Pf={exports:{}},zt={};/** * @license React * react-dom.production.js * @@ -22,7 +22,7 @@ var nm=Object.defineProperty;var im=(ue,nt,ae)=>nt in ue?nm(ue,nt,{enumerable:!0 * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var e0=V;function ts(t){var l="https://react.dev/errors/"+t;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ls)}catch(t){console.error(t)}}ls(),Pf.exports=zt;var n0=Pf.exports;/** + */var e0=V;function ts(t){var l="https://react.dev/errors/"+t;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ls)}catch(t){console.error(t)}}ls(),Pf.exports=zt;var n0=Pf.exports;/** * @license React * react-dom-client.production.js * @@ -30,15 +30,15 @@ var nm=Object.defineProperty;var im=(ue,nt,ae)=>nt in ue?nm(ue,nt,{enumerable:!0 * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ot=l0,es=V,i0=n0;function g(t){var l="https://react.dev/errors/"+t;if(1Re||(t.current=si[Re],si[Re]=null,Re--)}function w(t,l){Re++,si[Re]=t.current,t.current=l}var ul=el(null),Au=el(null),Hl=el(null),Ta=el(null);function pa(t,l){switch(w(Hl,l),w(Au,t),w(ul,null),l.nodeType){case 9:case 11:t=(t=l.documentElement)&&(t=t.namespaceURI)?qy(t):0;break;default:if(t=l.tagName,l=l.namespaceURI)l=qy(l),t=Vy(l,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}yt(ul),w(ul,t)}function Ne(){yt(ul),yt(Au),yt(Hl)}function oi(t){t.memoizedState!==null&&w(Ta,t);var l=ul.current,e=Vy(l,t.type);l!==e&&(w(Au,t),w(ul,e))}function Aa(t){Au.current===t&&(yt(ul),yt(Au)),Ta.current===t&&(yt(Ta),ha._currentValue=ne)}var di,ds;function ie(t){if(di===void 0)try{throw Error()}catch(e){var l=e.stack.trim().match(/\n( *(at )?)/);di=l&&l[1]||"",ds=-1Re||(t.current=si[Re],si[Re]=null,Re--)}function w(t,l){Re++,si[Re]=t.current,t.current=l}var ul=el(null),Au=el(null),Hl=el(null),pa=el(null);function Ta(t,l){switch(w(Hl,l),w(Au,t),w(ul,null),l.nodeType){case 9:case 11:t=(t=l.documentElement)&&(t=t.namespaceURI)?qy(t):0;break;default:if(t=l.tagName,l=l.namespaceURI)l=qy(l),t=Vy(l,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}yt(ul),w(ul,t)}function Ne(){yt(ul),yt(Au),yt(Hl)}function oi(t){t.memoizedState!==null&&w(pa,t);var l=ul.current,e=Vy(l,t.type);l!==e&&(w(Au,t),w(ul,e))}function Aa(t){Au.current===t&&(yt(ul),yt(Au)),pa.current===t&&(yt(pa),ha._currentValue=ne)}var di,ds;function ie(t){if(di===void 0)try{throw Error()}catch(e){var l=e.stack.trim().match(/\n( *(at )?)/);di=l&&l[1]||"",ds=-1)":-1a||f[u]!==d[a]){var r=` `+f[u].replace(" at new "," at ");return t.displayName&&r.includes("")&&(r=r.replace("",t.displayName)),r}while(1<=u&&0<=a);break}}}finally{yi=!1,Error.prepareStackTrace=e}return(e=t?t.displayName||t.name:"")?ie(e):""}function d0(t,l){switch(t.tag){case 26:case 27:case 5:return ie(t.type);case 16:return ie("Lazy");case 13:return t.child!==l&&l!==null?ie("Suspense Fallback"):ie("Suspense");case 19:return ie("SuspenseList");case 0:case 15:return hi(t.type,!1);case 11:return hi(t.type.render,!1);case 1:return hi(t.type,!0);case 31:return ie("Activity");default:return""}}function ys(t){try{var l="",e=null;do l+=d0(t,e),e=t,t=t.return;while(t);return l}catch(u){return` Error generating stack: `+u.message+` -`+u.stack}}var ri=Object.prototype.hasOwnProperty,vi=ot.unstable_scheduleCallback,mi=ot.unstable_cancelCallback,y0=ot.unstable_shouldYield,h0=ot.unstable_requestPaint,Rt=ot.unstable_now,r0=ot.unstable_getCurrentPriorityLevel,hs=ot.unstable_ImmediatePriority,rs=ot.unstable_UserBlockingPriority,Oa=ot.unstable_NormalPriority,v0=ot.unstable_LowPriority,vs=ot.unstable_IdlePriority,m0=ot.log,S0=ot.unstable_setDisableYieldValue,Ou=null,Nt=null;function Rl(t){if(typeof m0=="function"&&S0(t),Nt&&typeof Nt.setStrictMode=="function")try{Nt.setStrictMode(Ou,t)}catch{}}var Ct=Math.clz32?Math.clz32:E0,g0=Math.log,b0=Math.LN2;function E0(t){return t>>>=0,t===0?32:31-(g0(t)/b0|0)|0}var _a=256,Ma=262144,Da=4194304;function ce(t){var l=t&42;if(l!==0)return l;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ua(t,l,e){var u=t.pendingLanes;if(u===0)return 0;var a=0,n=t.suspendedLanes,i=t.pingedLanes;t=t.warmLanes;var c=u&134217727;return c!==0?(u=c&~n,u!==0?a=ce(u):(i&=c,i!==0?a=ce(i):e||(e=c&~t,e!==0&&(a=ce(e))))):(c=u&~n,c!==0?a=ce(c):i!==0?a=ce(i):e||(e=u&~t,e!==0&&(a=ce(e)))),a===0?0:l!==0&&l!==a&&!(l&n)&&(n=a&-a,e=l&-l,n>=e||n===32&&(e&4194048)!==0)?l:a}function _u(t,l){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&l)===0}function z0(t,l){switch(t){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ms(){var t=Da;return Da<<=1,!(Da&62914560)&&(Da=4194304),t}function Si(t){for(var l=[],e=0;31>e;e++)l.push(t);return l}function Mu(t,l){t.pendingLanes|=l,l!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function T0(t,l,e,u,a,n){var i=t.pendingLanes;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=e,t.entangledLanes&=e,t.errorRecoveryDisabledLanes&=e,t.shellSuspendCounter=0;var c=t.entanglements,f=t.expirationTimes,d=t.hiddenUpdates;for(e=i&~e;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var D0=/[\n"\\]/g;function xt(t){return t.replace(D0,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function pi(t,l,e,u,a,n,i,c){t.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?t.type=i:t.removeAttribute("type"),l!=null?i==="number"?(l===0&&t.value===""||t.value!=l)&&(t.value=""+Zt(l)):t.value!==""+Zt(l)&&(t.value=""+Zt(l)):i!=="submit"&&i!=="reset"||t.removeAttribute("value"),l!=null?Ai(t,i,Zt(l)):e!=null?Ai(t,i,Zt(e)):u!=null&&t.removeAttribute("value"),a==null&&n!=null&&(t.defaultChecked=!!n),a!=null&&(t.checked=a&&typeof a!="function"&&typeof a!="symbol"),c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?t.name=""+Zt(c):t.removeAttribute("name")}function Us(t,l,e,u,a,n,i,c){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(t.type=n),l!=null||e!=null){if(!(n!=="submit"&&n!=="reset"||l!=null)){Ti(t);return}e=e!=null?""+Zt(e):"",l=l!=null?""+Zt(l):e,c||l===t.value||(t.value=l),t.defaultValue=l}u=u??a,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=c?t.checked:!!u,t.defaultChecked=!!u,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.name=i),Ti(t)}function Ai(t,l,e){l==="number"&&Na(t.ownerDocument)===t||t.defaultValue===""+e||(t.defaultValue=""+e)}function je(t,l,e,u){if(t=t.options,l){l={};for(var a=0;a"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ui=!1;if(dl)try{var Ru={};Object.defineProperty(Ru,"passive",{get:function(){Ui=!0}}),window.addEventListener("test",Ru,Ru),window.removeEventListener("test",Ru,Ru)}catch{Ui=!1}var Cl=null,Hi=null,Ba=null;function qs(){if(Ba)return Ba;var t,l=Hi,e=l.length,u,a="value"in Cl?Cl.value:Cl.textContent,n=a.length;for(t=0;t=Bu),Zs=" ",xs=!1;function Ls(t,l){switch(t){case"keyup":return er.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ks(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ze=!1;function ar(t,l){switch(t){case"compositionend":return Ks(l);case"keypress":return l.which!==32?null:(xs=!0,Zs);case"textInput":return t=l.data,t===Zs&&xs?null:t;default:return null}}function nr(t,l){if(Ze)return t==="compositionend"||!Yi&&Ls(t,l)?(t=qs(),Ba=Hi=Cl=null,Ze=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:e,offset:l-t};t=u}t:{for(;e;){if(e.nextSibling){e=e.nextSibling;break t}e=e.parentNode}e=void 0}e=Ps(e)}}function lo(t,l){return t&&l?t===l?!0:t&&t.nodeType===3?!1:l&&l.nodeType===3?lo(t,l.parentNode):"contains"in t?t.contains(l):t.compareDocumentPosition?!!(t.compareDocumentPosition(l)&16):!1:!1}function eo(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var l=Na(t.document);l instanceof t.HTMLIFrameElement;){try{var e=typeof l.contentWindow.location.href=="string"}catch{e=!1}if(e)t=l.contentWindow;else break;l=Na(t.document)}return l}function ji(t){var l=t&&t.nodeName&&t.nodeName.toLowerCase();return l&&(l==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||l==="textarea"||t.contentEditable==="true")}var hr=dl&&"documentMode"in document&&11>=document.documentMode,xe=null,Gi=null,ju=null,Xi=!1;function uo(t,l,e){var u=e.window===e?e.document:e.nodeType===9?e:e.ownerDocument;Xi||xe==null||xe!==Na(u)||(u=xe,"selectionStart"in u&&ji(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),ju&&Vu(ju,u)||(ju=u,u=Dn(Gi,"onSelect"),0>=i,a-=i,al=1<<32-Ct(l)+a|e<A?(M=z,z=null):M=z.sibling;var R=y(o,z,h[A],S);if(R===null){z===null&&(z=M);break}t&&z&&R.alternate===null&&l(o,z),s=n(R,s,A),_===null?E=R:_.sibling=R,_=R,z=M}if(A===h.length)return e(o,z),j&&hl(o,A),E;if(z===null){for(;AA?(M=z,z=null):M=z.sibling;var It=y(o,z,R.value,S);if(It===null){z===null&&(z=M);break}t&&z&&It.alternate===null&&l(o,z),s=n(It,s,A),_===null?E=It:_.sibling=It,_=It,z=M}if(R.done)return e(o,z),j&&hl(o,A),E;if(z===null){for(;!R.done;A++,R=h.next())R=m(o,R.value,S),R!==null&&(s=n(R,s,A),_===null?E=R:_.sibling=R,_=R);return j&&hl(o,A),E}for(z=u(z);!R.done;A++,R=h.next())R=v(z,o,A,R.value,S),R!==null&&(t&&R.alternate!==null&&z.delete(R.key===null?A:R.key),s=n(R,s,A),_===null?E=R:_.sibling=R,_=R);return t&&z.forEach(function(ee){return l(o,ee)}),j&&hl(o,A),E}function H(o,s,h,S){if(typeof h=="object"&&h!==null&&h.type===He&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case za:t:{for(var E=h.key;s!==null;){if(s.key===E){if(E=h.type,E===He){if(s.tag===7){e(o,s.sibling),S=a(s,h.props.children),S.return=o,o=S;break t}}else if(s.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ul&&ge(E)===s.type){e(o,s.sibling),S=a(s,h.props),Lu(S,h),S.return=o,o=S;break t}e(o,s);break}else l(o,s);s=s.sibling}h.type===He?(S=he(h.props.children,o.mode,S,h.key),S.return=o,o=S):(S=La(h.type,h.key,h.props,null,o.mode,S),Lu(S,h),S.return=o,o=S)}return i(o);case zu:t:{for(E=h.key;s!==null;){if(s.key===E)if(s.tag===4&&s.stateNode.containerInfo===h.containerInfo&&s.stateNode.implementation===h.implementation){e(o,s.sibling),S=a(s,h.children||[]),S.return=o,o=S;break t}else{e(o,s);break}else l(o,s);s=s.sibling}S=wi(h,o.mode,S),S.return=o,o=S}return i(o);case Ul:return h=ge(h),H(o,s,h,S)}if(pu(h))return b(o,s,h,S);if(Tu(h)){if(E=Tu(h),typeof E!="function")throw Error(g(150));return h=E.call(h),p(o,s,h,S)}if(typeof h.then=="function")return H(o,s,ka(h),S);if(h.$$typeof===fl)return H(o,s,wa(o,h),S);Ia(o,h)}return typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint"?(h=""+h,s!==null&&s.tag===6?(e(o,s.sibling),S=a(s,h),S.return=o,o=S):(e(o,s),S=Ji(h,o.mode,S),S.return=o,o=S),i(o)):e(o,s)}return function(o,s,h,S){try{xu=0;var E=H(o,s,h,S);return tu=null,E}catch(z){if(z===Pe||z===Wa)throw z;var _=Yt(29,z,null,o.mode);return _.lanes=S,_.return=o,_}finally{}}}var Ee=Mo(!0),Do=Mo(!1),jl=!1;function nc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ic(t,l){t=t.updateQueue,l.updateQueue===t&&(l.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Gl(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Xl(t,l,e){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,X&2){var a=u.pending;return a===null?l.next=l:(l.next=a.next,a.next=l),u.pending=l,l=xa(t),oo(t,null,e),l}return Za(t,u,l,e),xa(t)}function Ku(t,l,e){if(l=l.updateQueue,l!==null&&(l=l.shared,(e&4194048)!==0)){var u=l.lanes;u&=t.pendingLanes,e|=u,l.lanes=e,gs(t,e)}}function cc(t,l){var e=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,e===u)){var a=null,n=null;if(e=e.firstBaseUpdate,e!==null){do{var i={lane:e.lane,tag:e.tag,payload:e.payload,callback:null,next:null};n===null?a=n=i:n=n.next=i,e=e.next}while(e!==null);n===null?a=n=l:n=n.next=l}else a=n=l;e={baseState:u.baseState,firstBaseUpdate:a,lastBaseUpdate:n,shared:u.shared,callbacks:u.callbacks},t.updateQueue=e;return}t=e.lastBaseUpdate,t===null?e.firstBaseUpdate=l:t.next=l,e.lastBaseUpdate=l}var fc=!1;function Ju(){if(fc){var t=Ie;if(t!==null)throw t}}function wu(t,l,e,u){fc=!1;var a=t.updateQueue;jl=!1;var n=a.firstBaseUpdate,i=a.lastBaseUpdate,c=a.shared.pending;if(c!==null){a.shared.pending=null;var f=c,d=f.next;f.next=null,i===null?n=d:i.next=d,i=f;var r=t.alternate;r!==null&&(r=r.updateQueue,c=r.lastBaseUpdate,c!==i&&(c===null?r.firstBaseUpdate=d:c.next=d,r.lastBaseUpdate=f))}if(n!==null){var m=a.baseState;i=0,r=d=f=null,c=n;do{var y=c.lane&-536870913,v=y!==c.lane;if(v?(q&y)===y:(u&y)===y){y!==0&&y===ke&&(fc=!0),r!==null&&(r=r.next={lane:0,tag:c.tag,payload:c.payload,callback:null,next:null});t:{var b=t,p=c;y=l;var H=e;switch(p.tag){case 1:if(b=p.payload,typeof b=="function"){m=b.call(H,m,y);break t}m=b;break t;case 3:b.flags=b.flags&-65537|128;case 0:if(b=p.payload,y=typeof b=="function"?b.call(H,m,y):b,y==null)break t;m=F({},m,y);break t;case 2:jl=!0}}y=c.callback,y!==null&&(t.flags|=64,v&&(t.flags|=8192),v=a.callbacks,v===null?a.callbacks=[y]:v.push(y))}else v={lane:y,tag:c.tag,payload:c.payload,callback:c.callback,next:null},r===null?(d=r=v,f=m):r=r.next=v,i|=y;if(c=c.next,c===null){if(c=a.shared.pending,c===null)break;v=c,c=v.next,v.next=null,a.lastBaseUpdate=v,a.shared.pending=null}}while(!0);r===null&&(f=m),a.baseState=f,a.firstBaseUpdate=d,a.lastBaseUpdate=r,n===null&&(a.shared.lanes=0),Kl|=i,t.lanes=i,t.memoizedState=m}}function Uo(t,l){if(typeof t!="function")throw Error(g(191,t));t.call(l)}function Ho(t,l){var e=t.callbacks;if(e!==null)for(t.callbacks=null,t=0;tn?n:8;var i=O.T,c={};O.T=c,Mc(t,!1,l,e);try{var f=a(),d=O.S;if(d!==null&&d(c,f),f!==null&&typeof f=="object"&&typeof f.then=="function"){var r=Tr(f,u);Fu(t,l,r,Xt(t))}else Fu(t,l,u,Xt(t))}catch(m){Fu(t,l,{then:function(){},status:"rejected",reason:m},Xt())}finally{G.p=n,i!==null&&c.types!==null&&(i.types=c.types),O.T=i}}function Dr(){}function Oc(t,l,e,u){if(t.tag!==5)throw Error(g(476));var a=fd(t).queue;cd(t,a,l,ne,e===null?Dr:function(){return sd(t),e(u)})}function fd(t){var l=t.memoizedState;if(l!==null)return l;l={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sl,lastRenderedState:ne},next:null};var e={};return l.next={memoizedState:e,baseState:e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sl,lastRenderedState:e},next:null},t.memoizedState=l,t=t.alternate,t!==null&&(t.memoizedState=l),l}function sd(t){var l=fd(t);l.next===null&&(l=t.alternate.memoizedState),Fu(t,l.next.queue,{},Xt())}function _c(){return gt(ha)}function od(){return ut().memoizedState}function dd(){return ut().memoizedState}function Ur(t){for(var l=t.return;l!==null;){switch(l.tag){case 24:case 3:var e=Xt();t=Gl(e);var u=Xl(l,t,e);u!==null&&(Ht(u,l,e),Ku(u,l,e)),l={cache:lc()},t.payload=l;return}l=l.return}}function Hr(t,l,e){var u=Xt();e={lane:u,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null},sn(t)?hd(l,e):(e=Li(t,l,e,u),e!==null&&(Ht(e,t,u),rd(e,l,u)))}function yd(t,l,e){var u=Xt();Fu(t,l,e,u)}function Fu(t,l,e,u){var a={lane:u,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null};if(sn(t))hd(l,a);else{var n=t.alternate;if(t.lanes===0&&(n===null||n.lanes===0)&&(n=l.lastRenderedReducer,n!==null))try{var i=l.lastRenderedState,c=n(i,e);if(a.hasEagerState=!0,a.eagerState=c,Bt(c,i))return Za(t,l,a,0),J===null&&Qa(),!1}catch{}finally{}if(e=Li(t,l,a,u),e!==null)return Ht(e,t,u),rd(e,l,u),!0}return!1}function Mc(t,l,e,u){if(u={lane:2,revertLane:nf(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},sn(t)){if(l)throw Error(g(479))}else l=Li(t,e,u,2),l!==null&&Ht(l,t,2)}function sn(t){var l=t.alternate;return t===U||l!==null&&l===U}function hd(t,l){eu=ln=!0;var e=t.pending;e===null?l.next=l:(l.next=e.next,e.next=l),t.pending=l}function rd(t,l,e){if(e&4194048){var u=l.lanes;u&=t.pendingLanes,e|=u,l.lanes=e,gs(t,e)}}var ku={readContext:gt,use:an,useCallback:tt,useContext:tt,useEffect:tt,useImperativeHandle:tt,useLayoutEffect:tt,useInsertionEffect:tt,useMemo:tt,useReducer:tt,useRef:tt,useState:tt,useDebugValue:tt,useDeferredValue:tt,useTransition:tt,useSyncExternalStore:tt,useId:tt,useHostTransitionStatus:tt,useFormState:tt,useActionState:tt,useOptimistic:tt,useMemoCache:tt,useCacheRefresh:tt};ku.useEffectEvent=tt;var vd={readContext:gt,use:an,useCallback:function(t,l){return pt().memoizedState=[t,l===void 0?null:l],t},useContext:gt,useEffect:Io,useImperativeHandle:function(t,l,e){e=e!=null?e.concat([t]):null,cn(4194308,4,ed.bind(null,l,t),e)},useLayoutEffect:function(t,l){return cn(4194308,4,t,l)},useInsertionEffect:function(t,l){cn(4,2,t,l)},useMemo:function(t,l){var e=pt();l=l===void 0?null:l;var u=t();if(ze){Rl(!0);try{t()}finally{Rl(!1)}}return e.memoizedState=[u,l],u},useReducer:function(t,l,e){var u=pt();if(e!==void 0){var a=e(l);if(ze){Rl(!0);try{e(l)}finally{Rl(!1)}}}else a=l;return u.memoizedState=u.baseState=a,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:a},u.queue=t,t=t.dispatch=Hr.bind(null,U,t),[u.memoizedState,t]},useRef:function(t){var l=pt();return t={current:t},l.memoizedState=t},useState:function(t){t=Ec(t);var l=t.queue,e=yd.bind(null,U,l);return l.dispatch=e,[t.memoizedState,e]},useDebugValue:pc,useDeferredValue:function(t,l){var e=pt();return Ac(e,t,l)},useTransition:function(){var t=Ec(!1);return t=cd.bind(null,U,t.queue,!0,!1),pt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,l,e){var u=U,a=pt();if(j){if(e===void 0)throw Error(g(407));e=e()}else{if(e=l(),J===null)throw Error(g(349));q&127||qo(u,l,e)}a.memoizedState=e;var n={value:e,getSnapshot:l};return a.queue=n,Io(jo.bind(null,u,n,t),[t]),u.flags|=2048,au(9,{destroy:void 0},Vo.bind(null,u,n,e,l),null),e},useId:function(){var t=pt(),l=J.identifierPrefix;if(j){var e=nl,u=al;e=(u&~(1<<32-Ct(u)-1)).toString(32)+e,l="_"+l+"R_"+e,e=en++,0<\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof u.is=="string"?i.createElement("select",{is:u.is}):i.createElement("select"),u.multiple?n.multiple=!0:u.size&&(n.size=u.size);break;default:n=typeof u.is=="string"?i.createElement(a,{is:u.is}):i.createElement(a)}}n[mt]=l,n[At]=u;t:for(i=l.child;i!==null;){if(i.tag===5||i.tag===6)n.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break t;for(;i.sibling===null;){if(i.return===null||i.return===l)break t;i=i.return}i.sibling.return=i.return,i=i.sibling}l.stateNode=n;t:switch(Et(n,a,u),a){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break t;case"img":u=!0;break t;default:u=!1}u&&bl(l)}}return I(l),Qc(l,l.type,t===null?null:t.memoizedProps,l.pendingProps,e),null;case 6:if(t&&l.stateNode!=null)t.memoizedProps!==u&&bl(l);else{if(typeof u!="string"&&l.stateNode===null)throw Error(g(166));if(t=Hl.current,We(l)){if(t=l.stateNode,e=l.memoizedProps,u=null,a=St,a!==null)switch(a.tag){case 27:case 5:u=a.memoizedProps}t[mt]=l,t=!!(t.nodeValue===e||u!==null&&u.suppressHydrationWarning===!0||By(t.nodeValue,e)),t||ql(l,!0)}else t=Un(t).createTextNode(u),t[mt]=l,l.stateNode=t}return I(l),null;case 31:if(e=l.memoizedState,t===null||t.memoizedState!==null){if(u=We(l),e!==null){if(t===null){if(!u)throw Error(g(318));if(t=l.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(g(557));t[mt]=l}else re(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;I(l),t=!1}else e=ki(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=e),t=!0;if(!t)return l.flags&256?(Vt(l),l):(Vt(l),null);if(l.flags&128)throw Error(g(558))}return I(l),null;case 13:if(u=l.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(a=We(l),u!==null&&u.dehydrated!==null){if(t===null){if(!a)throw Error(g(318));if(a=l.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(g(317));a[mt]=l}else re(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;I(l),a=!1}else a=ki(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),a=!0;if(!a)return l.flags&256?(Vt(l),l):(Vt(l),null)}return Vt(l),l.flags&128?(l.lanes=e,l):(e=u!==null,t=t!==null&&t.memoizedState!==null,e&&(u=l.child,a=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(a=u.alternate.memoizedState.cachePool.pool),n=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(n=u.memoizedState.cachePool.pool),n!==a&&(u.flags|=2048)),e!==t&&e&&(l.child.flags|=8192),rn(l,l.updateQueue),I(l),null);case 4:return Ne(),t===null&&of(l.stateNode.containerInfo),I(l),null;case 10:return vl(l.type),I(l),null;case 19:if(yt(et),u=l.memoizedState,u===null)return I(l),null;if(a=(l.flags&128)!==0,n=u.rendering,n===null)if(a)Pu(u,!1);else{if(lt!==0||t!==null&&t.flags&128)for(t=l.child;t!==null;){if(n=tn(t),n!==null){for(l.flags|=128,Pu(u,!1),t=n.updateQueue,l.updateQueue=t,rn(l,t),l.subtreeFlags=0,t=e,e=l.child;e!==null;)yo(e,t),e=e.sibling;return w(et,et.current&1|2),j&&hl(l,u.treeForkCount),l.child}t=t.sibling}u.tail!==null&&Rt()>bn&&(l.flags|=128,a=!0,Pu(u,!1),l.lanes=4194304)}else{if(!a)if(t=tn(n),t!==null){if(l.flags|=128,a=!0,t=t.updateQueue,l.updateQueue=t,rn(l,t),Pu(u,!0),u.tail===null&&u.tailMode==="hidden"&&!n.alternate&&!j)return I(l),null}else 2*Rt()-u.renderingStartTime>bn&&e!==536870912&&(l.flags|=128,a=!0,Pu(u,!1),l.lanes=4194304);u.isBackwards?(n.sibling=l.child,l.child=n):(t=u.last,t!==null?t.sibling=n:l.child=n,u.last=n)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=Rt(),t.sibling=null,e=et.current,w(et,a?e&1|2:e&1),j&&hl(l,u.treeForkCount),t):(I(l),null);case 22:case 23:return Vt(l),oc(),u=l.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(l.flags|=8192):u&&(l.flags|=8192),u?e&536870912&&!(l.flags&128)&&(I(l),l.subtreeFlags&6&&(l.flags|=8192)):I(l),e=l.updateQueue,e!==null&&rn(l,e.retryQueue),e=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==e&&(l.flags|=2048),t!==null&&yt(Se),null;case 24:return e=null,t!==null&&(e=t.memoizedState.cache),l.memoizedState.cache!==e&&(l.flags|=2048),vl(it),I(l),null;case 25:return null;case 30:return null}throw Error(g(156,l.tag))}function Yr(t,l){switch(Wi(l),l.tag){case 1:return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 3:return vl(it),Ne(),t=l.flags,t&65536&&!(t&128)?(l.flags=t&-65537|128,l):null;case 26:case 27:case 5:return Aa(l),null;case 31:if(l.memoizedState!==null){if(Vt(l),l.alternate===null)throw Error(g(340));re()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 13:if(Vt(l),t=l.memoizedState,t!==null&&t.dehydrated!==null){if(l.alternate===null)throw Error(g(340));re()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 19:return yt(et),null;case 4:return Ne(),null;case 10:return vl(l.type),null;case 22:case 23:return Vt(l),oc(),t!==null&&yt(Se),t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 24:return vl(it),null;case 25:return null;default:return null}}function Gd(t,l){switch(Wi(l),l.tag){case 3:vl(it),Ne();break;case 26:case 27:case 5:Aa(l);break;case 4:Ne();break;case 31:l.memoizedState!==null&&Vt(l);break;case 13:Vt(l);break;case 19:yt(et);break;case 10:vl(l.type);break;case 22:case 23:Vt(l),oc(),t!==null&&yt(Se);break;case 24:vl(it)}}function ta(t,l){try{var e=l.updateQueue,u=e!==null?e.lastEffect:null;if(u!==null){var a=u.next;e=a;do{if((e.tag&t)===t){u=void 0;var n=e.create,i=e.inst;u=n(),i.destroy=u}e=e.next}while(e!==a)}}catch(c){Z(l,l.return,c)}}function xl(t,l,e){try{var u=l.updateQueue,a=u!==null?u.lastEffect:null;if(a!==null){var n=a.next;u=n;do{if((u.tag&t)===t){var i=u.inst,c=i.destroy;if(c!==void 0){i.destroy=void 0,a=l;var f=e,d=c;try{d()}catch(r){Z(a,f,r)}}}u=u.next}while(u!==n)}}catch(r){Z(l,l.return,r)}}function Xd(t){var l=t.updateQueue;if(l!==null){var e=t.stateNode;try{Ho(l,e)}catch(u){Z(t,t.return,u)}}}function Qd(t,l,e){e.props=Te(t.type,t.memoizedProps),e.state=t.memoizedState;try{e.componentWillUnmount()}catch(u){Z(t,l,u)}}function la(t,l){try{var e=t.ref;if(e!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:u=t.stateNode;break;default:u=t.stateNode}typeof e=="function"?t.refCleanup=e(u):e.current=u}}catch(a){Z(t,l,a)}}function il(t,l){var e=t.ref,u=t.refCleanup;if(e!==null)if(typeof u=="function")try{u()}catch(a){Z(t,l,a)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof e=="function")try{e(null)}catch(a){Z(t,l,a)}else e.current=null}function Zd(t){var l=t.type,e=t.memoizedProps,u=t.stateNode;try{t:switch(l){case"button":case"input":case"select":case"textarea":e.autoFocus&&u.focus();break t;case"img":e.src?u.src=e.src:e.srcSet&&(u.srcset=e.srcSet)}}catch(a){Z(t,t.return,a)}}function Zc(t,l,e){try{var u=t.stateNode;uv(u,t.type,e,l),u[At]=l}catch(a){Z(t,t.return,a)}}function xd(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Fl(t.type)||t.tag===4}function xc(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||xd(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Fl(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Lc(t,l,e){var u=t.tag;if(u===5||u===6)t=t.stateNode,l?(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e).insertBefore(t,l):(l=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.appendChild(t),e=e._reactRootContainer,e!=null||l.onclick!==null||(l.onclick=ol));else if(u!==4&&(u===27&&Fl(t.type)&&(e=t.stateNode,l=null),t=t.child,t!==null))for(Lc(t,l,e),t=t.sibling;t!==null;)Lc(t,l,e),t=t.sibling}function vn(t,l,e){var u=t.tag;if(u===5||u===6)t=t.stateNode,l?e.insertBefore(t,l):e.appendChild(t);else if(u!==4&&(u===27&&Fl(t.type)&&(e=t.stateNode),t=t.child,t!==null))for(vn(t,l,e),t=t.sibling;t!==null;)vn(t,l,e),t=t.sibling}function Ld(t){var l=t.stateNode,e=t.memoizedProps;try{for(var u=t.type,a=l.attributes;a.length;)l.removeAttributeNode(a[0]);Et(l,u,e),l[mt]=t,l[At]=e}catch(n){Z(t,t.return,n)}}var El=!1,st=!1,Kc=!1,Kd=typeof WeakSet=="function"?WeakSet:Set,rt=null;function qr(t,l){if(t=t.containerInfo,hf=qn,t=eo(t),ji(t)){if("selectionStart"in t)var e={start:t.selectionStart,end:t.selectionEnd};else t:{e=(e=t.ownerDocument)&&e.defaultView||window;var u=e.getSelection&&e.getSelection();if(u&&u.rangeCount!==0){e=u.anchorNode;var a=u.anchorOffset,n=u.focusNode;u=u.focusOffset;try{e.nodeType,n.nodeType}catch{e=null;break t}var i=0,c=-1,f=-1,d=0,r=0,m=t,y=null;l:for(;;){for(var v;m!==e||a!==0&&m.nodeType!==3||(c=i+a),m!==n||u!==0&&m.nodeType!==3||(f=i+u),m.nodeType===3&&(i+=m.nodeValue.length),(v=m.firstChild)!==null;)y=m,m=v;for(;;){if(m===t)break l;if(y===e&&++d===a&&(c=i),y===n&&++r===u&&(f=i),(v=m.nextSibling)!==null)break;m=y,y=m.parentNode}m=v}e=c===-1||f===-1?null:{start:c,end:f}}else e=null}e=e||{start:0,end:0}}else e=null;for(rf={focusedElem:t,selectionRange:e},qn=!1,rt=l;rt!==null;)if(l=rt,t=l.child,(l.subtreeFlags&1028)!==0&&t!==null)t.return=l,rt=t;else for(;rt!==null;){switch(l=rt,n=l.alternate,t=l.flags,l.tag){case 0:if(t&4&&(t=l.updateQueue,t=t!==null?t.events:null,t!==null))for(e=0;e title"))),Et(n,u,e),n[mt]=t,ht(n),u=n;break t;case"link":var i=ky("link","href",a).get(u+(e.href||""));if(i){for(var c=0;cH&&(i=H,H=p,p=i);var o=to(c,p),s=to(c,H);if(o&&s&&(v.rangeCount!==1||v.anchorNode!==o.node||v.anchorOffset!==o.offset||v.focusNode!==s.node||v.focusOffset!==s.offset)){var h=m.createRange();h.setStart(o.node,o.offset),v.removeAllRanges(),p>H?(v.addRange(h),v.extend(s.node,s.offset)):(h.setEnd(s.node,s.offset),v.addRange(h))}}}}for(m=[],v=c;v=v.parentNode;)v.nodeType===1&&m.push({element:v,left:v.scrollLeft,top:v.scrollTop});for(typeof c.focus=="function"&&c.focus(),c=0;ce?32:e,O.T=null,e=Ic,Ic=null;var n=wl,i=Ol;if(dt=0,su=wl=null,Ol=0,X&6)throw Error(g(331));var c=X;if(X|=4,ey(n.current),Pd(n,n.current,i,e),X=c,ca(0,!1),Nt&&typeof Nt.onPostCommitFiberRoot=="function")try{Nt.onPostCommitFiberRoot(Ou,n)}catch{}return!0}finally{G.p=a,O.T=u,Ey(t,l)}}function Ty(t,l,e){l=Kt(e,l),l=Rc(t.stateNode,l,2),t=Xl(t,l,2),t!==null&&(Mu(t,2),cl(t))}function Z(t,l,e){if(t.tag===3)Ty(t,t,e);else for(;l!==null;){if(l.tag===3){Ty(l,t,e);break}else if(l.tag===1){var u=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Jl===null||!Jl.has(u))){t=Kt(e,t),e=pd(2),u=Xl(l,e,2),u!==null&&(Ad(e,u,l,t),Mu(u,2),cl(u));break}}l=l.return}}function ef(t,l,e){var u=t.pingCache;if(u===null){u=t.pingCache=new Gr;var a=new Set;u.set(l,a)}else a=u.get(l),a===void 0&&(a=new Set,u.set(l,a));a.has(e)||($c=!0,a.add(e),t=Lr.bind(null,t,l,e),l.then(t,t))}function Lr(t,l,e){var u=t.pingCache;u!==null&&u.delete(l),t.pingedLanes|=t.suspendedLanes&e,t.warmLanes&=~e,J===t&&(q&e)===e&&(lt===4||lt===3&&(q&62914560)===q&&300>Rt()-gn?!(X&2)&&ou(t,0):Wc|=e,fu===q&&(fu=0)),cl(t)}function py(t,l){l===0&&(l=ms()),t=ye(t,l),t!==null&&(Mu(t,l),cl(t))}function Kr(t){var l=t.memoizedState,e=0;l!==null&&(e=l.retryLane),py(t,e)}function Jr(t,l){var e=0;switch(t.tag){case 31:case 13:var u=t.stateNode,a=t.memoizedState;a!==null&&(e=a.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(g(314))}u!==null&&u.delete(l),py(t,e)}function wr(t,l){return vi(t,l)}var On=null,yu=null,uf=!1,_n=!1,af=!1,Wl=0;function cl(t){t!==yu&&t.next===null&&(yu===null?On=yu=t:yu=yu.next=t),_n=!0,uf||(uf=!0,Wr())}function ca(t,l){if(!af&&_n){af=!0;do for(var e=!1,u=On;u!==null;){if(t!==0){var a=u.pendingLanes;if(a===0)var n=0;else{var i=u.suspendedLanes,c=u.pingedLanes;n=(1<<31-Ct(42|t)+1)-1,n&=a&~(i&~c),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(e=!0,My(u,n))}else n=q,n=Ua(u,u===J?n:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),!(n&3)||_u(u,n)||(e=!0,My(u,n));u=u.next}while(e);af=!1}}function $r(){Ay()}function Ay(){_n=uf=!1;var t=0;Wl!==0&&nv()&&(t=Wl);for(var l=Rt(),e=null,u=On;u!==null;){var a=u.next,n=Oy(u,l);n===0?(u.next=null,e===null?On=a:e.next=a,a===null&&(yu=e)):(e=u,(t!==0||n&3)&&(_n=!0)),u=a}dt!==0&&dt!==5||ca(t),Wl!==0&&(Wl=0)}function Oy(t,l){for(var e=t.suspendedLanes,u=t.pingedLanes,a=t.expirationTimes,n=t.pendingLanes&-62914561;0c)break;var r=f.transferSize,m=f.initiatorType;r&&Yy(m)&&(f=f.responseEnd,i+=r*(f"u"?null:document;function wy(t,l,e){var u=hu;if(u&&typeof l=="string"&&l){var a=xt(l);a='link[rel="'+t+'"][href="'+a+'"]',typeof e=="string"&&(a+='[crossorigin="'+e+'"]'),Jy.has(a)||(Jy.add(a),t={rel:t,crossOrigin:e,href:l},u.querySelector(a)===null&&(l=u.createElement("link"),Et(l,"link",t),ht(l),u.head.appendChild(l)))}}function rv(t){_l.D(t),wy("dns-prefetch",t,null)}function vv(t,l){_l.C(t,l),wy("preconnect",t,l)}function mv(t,l,e){_l.L(t,l,e);var u=hu;if(u&&t&&l){var a='link[rel="preload"][as="'+xt(l)+'"]';l==="image"&&e&&e.imageSrcSet?(a+='[imagesrcset="'+xt(e.imageSrcSet)+'"]',typeof e.imageSizes=="string"&&(a+='[imagesizes="'+xt(e.imageSizes)+'"]')):a+='[href="'+xt(t)+'"]';var n=a;switch(l){case"style":n=ru(t);break;case"script":n=vu(t)}kt.has(n)||(t=F({rel:"preload",href:l==="image"&&e&&e.imageSrcSet?void 0:t,as:l},e),kt.set(n,t),u.querySelector(a)!==null||l==="style"&&u.querySelector(da(n))||l==="script"&&u.querySelector(ya(n))||(l=u.createElement("link"),Et(l,"link",t),ht(l),u.head.appendChild(l)))}}function Sv(t,l){_l.m(t,l);var e=hu;if(e&&t){var u=l&&typeof l.as=="string"?l.as:"script",a='link[rel="modulepreload"][as="'+xt(u)+'"][href="'+xt(t)+'"]',n=a;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=vu(t)}if(!kt.has(n)&&(t=F({rel:"modulepreload",href:t},l),kt.set(n,t),e.querySelector(a)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(e.querySelector(ya(n)))return}u=e.createElement("link"),Et(u,"link",t),ht(u),e.head.appendChild(u)}}}function gv(t,l,e){_l.S(t,l,e);var u=hu;if(u&&t){var a=qe(u).hoistableStyles,n=ru(t);l=l||"default";var i=a.get(n);if(!i){var c={loading:0,preload:null};if(i=u.querySelector(da(n)))c.loading=5;else{t=F({rel:"stylesheet",href:t,"data-precedence":l},e),(e=kt.get(n))&&zf(t,e);var f=i=u.createElement("link");ht(f),Et(f,"link",t),f._p=new Promise(function(d,r){f.onload=d,f.onerror=r}),f.addEventListener("load",function(){c.loading|=1}),f.addEventListener("error",function(){c.loading|=2}),c.loading|=4,Rn(i,l,u)}i={type:"stylesheet",instance:i,count:1,state:c},a.set(n,i)}}}function bv(t,l){_l.X(t,l);var e=hu;if(e&&t){var u=qe(e).hoistableScripts,a=vu(t),n=u.get(a);n||(n=e.querySelector(ya(a)),n||(t=F({src:t,async:!0},l),(l=kt.get(a))&&Tf(t,l),n=e.createElement("script"),ht(n),Et(n,"link",t),e.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},u.set(a,n))}}function Ev(t,l){_l.M(t,l);var e=hu;if(e&&t){var u=qe(e).hoistableScripts,a=vu(t),n=u.get(a);n||(n=e.querySelector(ya(a)),n||(t=F({src:t,async:!0,type:"module"},l),(l=kt.get(a))&&Tf(t,l),n=e.createElement("script"),ht(n),Et(n,"link",t),e.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},u.set(a,n))}}function $y(t,l,e,u){var a=(a=Hl.current)?Hn(a):null;if(!a)throw Error(g(446));switch(t){case"meta":case"title":return null;case"style":return typeof e.precedence=="string"&&typeof e.href=="string"?(l=ru(e.href),e=qe(a).hoistableStyles,u=e.get(l),u||(u={type:"style",instance:null,count:0,state:null},e.set(l,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(e.rel==="stylesheet"&&typeof e.href=="string"&&typeof e.precedence=="string"){t=ru(e.href);var n=qe(a).hoistableStyles,i=n.get(t);if(i||(a=a.ownerDocument||a,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(t,i),(n=a.querySelector(da(t)))&&!n._p&&(i.instance=n,i.state.loading=5),kt.has(t)||(e={rel:"preload",as:"style",href:e.href,crossOrigin:e.crossOrigin,integrity:e.integrity,media:e.media,hrefLang:e.hrefLang,referrerPolicy:e.referrerPolicy},kt.set(t,e),n||zv(a,t,e,i.state))),l&&u===null)throw Error(g(528,""));return i}if(l&&u!==null)throw Error(g(529,""));return null;case"script":return l=e.async,e=e.src,typeof e=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=vu(e),e=qe(a).hoistableScripts,u=e.get(l),u||(u={type:"script",instance:null,count:0,state:null},e.set(l,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(g(444,t))}}function ru(t){return'href="'+xt(t)+'"'}function da(t){return'link[rel="stylesheet"]['+t+"]"}function Wy(t){return F({},t,{"data-precedence":t.precedence,precedence:null})}function zv(t,l,e,u){t.querySelector('link[rel="preload"][as="style"]['+l+"]")?u.loading=1:(l=t.createElement("link"),u.preload=l,l.addEventListener("load",function(){return u.loading|=1}),l.addEventListener("error",function(){return u.loading|=2}),Et(l,"link",e),ht(l),t.head.appendChild(l))}function vu(t){return'[src="'+xt(t)+'"]'}function ya(t){return"script[async]"+t}function Fy(t,l,e){if(l.count++,l.instance===null)switch(l.type){case"style":var u=t.querySelector('style[data-href~="'+xt(e.href)+'"]');if(u)return l.instance=u,ht(u),u;var a=F({},e,{"data-href":e.href,"data-precedence":e.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),ht(u),Et(u,"style",a),Rn(u,e.precedence,t),l.instance=u;case"stylesheet":a=ru(e.href);var n=t.querySelector(da(a));if(n)return l.state.loading|=4,l.instance=n,ht(n),n;u=Wy(e),(a=kt.get(a))&&zf(u,a),n=(t.ownerDocument||t).createElement("link"),ht(n);var i=n;return i._p=new Promise(function(c,f){i.onload=c,i.onerror=f}),Et(n,"link",u),l.state.loading|=4,Rn(n,e.precedence,t),l.instance=n;case"script":return n=vu(e.src),(a=t.querySelector(ya(n)))?(l.instance=a,ht(a),a):(u=e,(a=kt.get(n))&&(u=F({},e),Tf(u,a)),t=t.ownerDocument||t,a=t.createElement("script"),ht(a),Et(a,"link",u),t.head.appendChild(a),l.instance=a);case"void":return null;default:throw Error(g(443,l.type))}else l.type==="stylesheet"&&!(l.state.loading&4)&&(u=l.instance,l.state.loading|=4,Rn(u,e.precedence,t));return l.instance}function Rn(t,l,e){for(var u=e.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=u.length?u[u.length-1]:null,n=a,i=0;i title"):null)}function Tv(t,l,e){if(e===1||l.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return t=l.disabled,typeof l.precedence=="string"&&t==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function Py(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}function pv(t,l,e,u){if(e.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&!(e.state.loading&4)){if(e.instance===null){var a=ru(u.href),n=l.querySelector(da(a));if(n){l=n._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(t.count++,t=Cn.bind(t),l.then(t,t)),e.state.loading|=4,e.instance=n,ht(n);return}n=l.ownerDocument||l,u=Wy(u),(a=kt.get(a))&&zf(u,a),n=n.createElement("link"),ht(n);var i=n;i._p=new Promise(function(c,f){i.onload=c,i.onerror=f}),Et(n,"link",u),e.instance=n}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(e,l),(l=e.state.preload)&&!(e.state.loading&3)&&(t.count++,e=Cn.bind(t),l.addEventListener("load",e),l.addEventListener("error",e))}}var pf=0;function Av(t,l){return t.stylesheets&&t.count===0&&Yn(t,t.stylesheets),0pf?50:800)+l);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(a)}}:null}function Cn(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yn(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Bn=null;function Yn(t,l){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Bn=new Map,l.forEach(Ov,t),Bn=null,Cn.call(t))}function Ov(t,l){if(!(l.state.loading&4)){var e=Bn.get(t);if(e)var u=e.get(null);else{e=new Map,Bn.set(t,e);for(var a=t.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hh)}catch(t){console.error(t)}}hh(),Ff.exports=ba;var Hf=Ff.exports;const Cv=ue({__proto__:null,default:Vf(Hf)},[Hf]);var rh={exports:{}},xn={};/** +`+u.stack}}var ri=Object.prototype.hasOwnProperty,vi=ot.unstable_scheduleCallback,mi=ot.unstable_cancelCallback,y0=ot.unstable_shouldYield,h0=ot.unstable_requestPaint,Rt=ot.unstable_now,r0=ot.unstable_getCurrentPriorityLevel,hs=ot.unstable_ImmediatePriority,rs=ot.unstable_UserBlockingPriority,Oa=ot.unstable_NormalPriority,v0=ot.unstable_LowPriority,vs=ot.unstable_IdlePriority,m0=ot.log,S0=ot.unstable_setDisableYieldValue,Ou=null,Nt=null;function Rl(t){if(typeof m0=="function"&&S0(t),Nt&&typeof Nt.setStrictMode=="function")try{Nt.setStrictMode(Ou,t)}catch{}}var Ct=Math.clz32?Math.clz32:E0,g0=Math.log,b0=Math.LN2;function E0(t){return t>>>=0,t===0?32:31-(g0(t)/b0|0)|0}var _a=256,Ma=262144,Da=4194304;function ce(t){var l=t&42;if(l!==0)return l;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ua(t,l,e){var u=t.pendingLanes;if(u===0)return 0;var a=0,n=t.suspendedLanes,i=t.pingedLanes;t=t.warmLanes;var c=u&134217727;return c!==0?(u=c&~n,u!==0?a=ce(u):(i&=c,i!==0?a=ce(i):e||(e=c&~t,e!==0&&(a=ce(e))))):(c=u&~n,c!==0?a=ce(c):i!==0?a=ce(i):e||(e=u&~t,e!==0&&(a=ce(e)))),a===0?0:l!==0&&l!==a&&!(l&n)&&(n=a&-a,e=l&-l,n>=e||n===32&&(e&4194048)!==0)?l:a}function _u(t,l){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&l)===0}function z0(t,l){switch(t){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ms(){var t=Da;return Da<<=1,!(Da&62914560)&&(Da=4194304),t}function Si(t){for(var l=[],e=0;31>e;e++)l.push(t);return l}function Mu(t,l){t.pendingLanes|=l,l!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function p0(t,l,e,u,a,n){var i=t.pendingLanes;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=e,t.entangledLanes&=e,t.errorRecoveryDisabledLanes&=e,t.shellSuspendCounter=0;var c=t.entanglements,f=t.expirationTimes,d=t.hiddenUpdates;for(e=i&~e;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var D0=/[\n"\\]/g;function xt(t){return t.replace(D0,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Ti(t,l,e,u,a,n,i,c){t.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?t.type=i:t.removeAttribute("type"),l!=null?i==="number"?(l===0&&t.value===""||t.value!=l)&&(t.value=""+Zt(l)):t.value!==""+Zt(l)&&(t.value=""+Zt(l)):i!=="submit"&&i!=="reset"||t.removeAttribute("value"),l!=null?Ai(t,i,Zt(l)):e!=null?Ai(t,i,Zt(e)):u!=null&&t.removeAttribute("value"),a==null&&n!=null&&(t.defaultChecked=!!n),a!=null&&(t.checked=a&&typeof a!="function"&&typeof a!="symbol"),c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?t.name=""+Zt(c):t.removeAttribute("name")}function Us(t,l,e,u,a,n,i,c){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(t.type=n),l!=null||e!=null){if(!(n!=="submit"&&n!=="reset"||l!=null)){pi(t);return}e=e!=null?""+Zt(e):"",l=l!=null?""+Zt(l):e,c||l===t.value||(t.value=l),t.defaultValue=l}u=u??a,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=c?t.checked:!!u,t.defaultChecked=!!u,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.name=i),pi(t)}function Ai(t,l,e){l==="number"&&Na(t.ownerDocument)===t||t.defaultValue===""+e||(t.defaultValue=""+e)}function je(t,l,e,u){if(t=t.options,l){l={};for(var a=0;a"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ui=!1;if(dl)try{var Ru={};Object.defineProperty(Ru,"passive",{get:function(){Ui=!0}}),window.addEventListener("test",Ru,Ru),window.removeEventListener("test",Ru,Ru)}catch{Ui=!1}var Cl=null,Hi=null,Ba=null;function qs(){if(Ba)return Ba;var t,l=Hi,e=l.length,u,a="value"in Cl?Cl.value:Cl.textContent,n=a.length;for(t=0;t=Bu),Zs=" ",xs=!1;function Ls(t,l){switch(t){case"keyup":return er.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ks(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ze=!1;function ar(t,l){switch(t){case"compositionend":return Ks(l);case"keypress":return l.which!==32?null:(xs=!0,Zs);case"textInput":return t=l.data,t===Zs&&xs?null:t;default:return null}}function nr(t,l){if(Ze)return t==="compositionend"||!Yi&&Ls(t,l)?(t=qs(),Ba=Hi=Cl=null,Ze=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:e,offset:l-t};t=u}t:{for(;e;){if(e.nextSibling){e=e.nextSibling;break t}e=e.parentNode}e=void 0}e=Ps(e)}}function lo(t,l){return t&&l?t===l?!0:t&&t.nodeType===3?!1:l&&l.nodeType===3?lo(t,l.parentNode):"contains"in t?t.contains(l):t.compareDocumentPosition?!!(t.compareDocumentPosition(l)&16):!1:!1}function eo(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var l=Na(t.document);l instanceof t.HTMLIFrameElement;){try{var e=typeof l.contentWindow.location.href=="string"}catch{e=!1}if(e)t=l.contentWindow;else break;l=Na(t.document)}return l}function ji(t){var l=t&&t.nodeName&&t.nodeName.toLowerCase();return l&&(l==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||l==="textarea"||t.contentEditable==="true")}var hr=dl&&"documentMode"in document&&11>=document.documentMode,xe=null,Gi=null,ju=null,Xi=!1;function uo(t,l,e){var u=e.window===e?e.document:e.nodeType===9?e:e.ownerDocument;Xi||xe==null||xe!==Na(u)||(u=xe,"selectionStart"in u&&ji(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),ju&&Vu(ju,u)||(ju=u,u=Dn(Gi,"onSelect"),0>=i,a-=i,al=1<<32-Ct(l)+a|e<A?(M=z,z=null):M=z.sibling;var R=y(o,z,h[A],S);if(R===null){z===null&&(z=M);break}t&&z&&R.alternate===null&&l(o,z),s=n(R,s,A),_===null?E=R:_.sibling=R,_=R,z=M}if(A===h.length)return e(o,z),j&&hl(o,A),E;if(z===null){for(;AA?(M=z,z=null):M=z.sibling;var It=y(o,z,R.value,S);if(It===null){z===null&&(z=M);break}t&&z&&It.alternate===null&&l(o,z),s=n(It,s,A),_===null?E=It:_.sibling=It,_=It,z=M}if(R.done)return e(o,z),j&&hl(o,A),E;if(z===null){for(;!R.done;A++,R=h.next())R=m(o,R.value,S),R!==null&&(s=n(R,s,A),_===null?E=R:_.sibling=R,_=R);return j&&hl(o,A),E}for(z=u(z);!R.done;A++,R=h.next())R=v(z,o,A,R.value,S),R!==null&&(t&&R.alternate!==null&&z.delete(R.key===null?A:R.key),s=n(R,s,A),_===null?E=R:_.sibling=R,_=R);return t&&z.forEach(function(ee){return l(o,ee)}),j&&hl(o,A),E}function H(o,s,h,S){if(typeof h=="object"&&h!==null&&h.type===He&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case za:t:{for(var E=h.key;s!==null;){if(s.key===E){if(E=h.type,E===He){if(s.tag===7){e(o,s.sibling),S=a(s,h.props.children),S.return=o,o=S;break t}}else if(s.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ul&&ge(E)===s.type){e(o,s.sibling),S=a(s,h.props),Lu(S,h),S.return=o,o=S;break t}e(o,s);break}else l(o,s);s=s.sibling}h.type===He?(S=he(h.props.children,o.mode,S,h.key),S.return=o,o=S):(S=La(h.type,h.key,h.props,null,o.mode,S),Lu(S,h),S.return=o,o=S)}return i(o);case zu:t:{for(E=h.key;s!==null;){if(s.key===E)if(s.tag===4&&s.stateNode.containerInfo===h.containerInfo&&s.stateNode.implementation===h.implementation){e(o,s.sibling),S=a(s,h.children||[]),S.return=o,o=S;break t}else{e(o,s);break}else l(o,s);s=s.sibling}S=wi(h,o.mode,S),S.return=o,o=S}return i(o);case Ul:return h=ge(h),H(o,s,h,S)}if(Tu(h))return b(o,s,h,S);if(pu(h)){if(E=pu(h),typeof E!="function")throw Error(g(150));return h=E.call(h),T(o,s,h,S)}if(typeof h.then=="function")return H(o,s,ka(h),S);if(h.$$typeof===fl)return H(o,s,wa(o,h),S);Ia(o,h)}return typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint"?(h=""+h,s!==null&&s.tag===6?(e(o,s.sibling),S=a(s,h),S.return=o,o=S):(e(o,s),S=Ji(h,o.mode,S),S.return=o,o=S),i(o)):e(o,s)}return function(o,s,h,S){try{xu=0;var E=H(o,s,h,S);return tu=null,E}catch(z){if(z===Pe||z===Wa)throw z;var _=Yt(29,z,null,o.mode);return _.lanes=S,_.return=o,_}finally{}}}var Ee=Mo(!0),Do=Mo(!1),jl=!1;function nc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ic(t,l){t=t.updateQueue,l.updateQueue===t&&(l.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Gl(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Xl(t,l,e){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,X&2){var a=u.pending;return a===null?l.next=l:(l.next=a.next,a.next=l),u.pending=l,l=xa(t),oo(t,null,e),l}return Za(t,u,l,e),xa(t)}function Ku(t,l,e){if(l=l.updateQueue,l!==null&&(l=l.shared,(e&4194048)!==0)){var u=l.lanes;u&=t.pendingLanes,e|=u,l.lanes=e,gs(t,e)}}function cc(t,l){var e=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,e===u)){var a=null,n=null;if(e=e.firstBaseUpdate,e!==null){do{var i={lane:e.lane,tag:e.tag,payload:e.payload,callback:null,next:null};n===null?a=n=i:n=n.next=i,e=e.next}while(e!==null);n===null?a=n=l:n=n.next=l}else a=n=l;e={baseState:u.baseState,firstBaseUpdate:a,lastBaseUpdate:n,shared:u.shared,callbacks:u.callbacks},t.updateQueue=e;return}t=e.lastBaseUpdate,t===null?e.firstBaseUpdate=l:t.next=l,e.lastBaseUpdate=l}var fc=!1;function Ju(){if(fc){var t=Ie;if(t!==null)throw t}}function wu(t,l,e,u){fc=!1;var a=t.updateQueue;jl=!1;var n=a.firstBaseUpdate,i=a.lastBaseUpdate,c=a.shared.pending;if(c!==null){a.shared.pending=null;var f=c,d=f.next;f.next=null,i===null?n=d:i.next=d,i=f;var r=t.alternate;r!==null&&(r=r.updateQueue,c=r.lastBaseUpdate,c!==i&&(c===null?r.firstBaseUpdate=d:c.next=d,r.lastBaseUpdate=f))}if(n!==null){var m=a.baseState;i=0,r=d=f=null,c=n;do{var y=c.lane&-536870913,v=y!==c.lane;if(v?(q&y)===y:(u&y)===y){y!==0&&y===ke&&(fc=!0),r!==null&&(r=r.next={lane:0,tag:c.tag,payload:c.payload,callback:null,next:null});t:{var b=t,T=c;y=l;var H=e;switch(T.tag){case 1:if(b=T.payload,typeof b=="function"){m=b.call(H,m,y);break t}m=b;break t;case 3:b.flags=b.flags&-65537|128;case 0:if(b=T.payload,y=typeof b=="function"?b.call(H,m,y):b,y==null)break t;m=F({},m,y);break t;case 2:jl=!0}}y=c.callback,y!==null&&(t.flags|=64,v&&(t.flags|=8192),v=a.callbacks,v===null?a.callbacks=[y]:v.push(y))}else v={lane:y,tag:c.tag,payload:c.payload,callback:c.callback,next:null},r===null?(d=r=v,f=m):r=r.next=v,i|=y;if(c=c.next,c===null){if(c=a.shared.pending,c===null)break;v=c,c=v.next,v.next=null,a.lastBaseUpdate=v,a.shared.pending=null}}while(!0);r===null&&(f=m),a.baseState=f,a.firstBaseUpdate=d,a.lastBaseUpdate=r,n===null&&(a.shared.lanes=0),Kl|=i,t.lanes=i,t.memoizedState=m}}function Uo(t,l){if(typeof t!="function")throw Error(g(191,t));t.call(l)}function Ho(t,l){var e=t.callbacks;if(e!==null)for(t.callbacks=null,t=0;tn?n:8;var i=O.T,c={};O.T=c,Mc(t,!1,l,e);try{var f=a(),d=O.S;if(d!==null&&d(c,f),f!==null&&typeof f=="object"&&typeof f.then=="function"){var r=pr(f,u);Fu(t,l,r,Xt(t))}else Fu(t,l,u,Xt(t))}catch(m){Fu(t,l,{then:function(){},status:"rejected",reason:m},Xt())}finally{G.p=n,i!==null&&c.types!==null&&(i.types=c.types),O.T=i}}function Dr(){}function Oc(t,l,e,u){if(t.tag!==5)throw Error(g(476));var a=fd(t).queue;cd(t,a,l,ne,e===null?Dr:function(){return sd(t),e(u)})}function fd(t){var l=t.memoizedState;if(l!==null)return l;l={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sl,lastRenderedState:ne},next:null};var e={};return l.next={memoizedState:e,baseState:e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sl,lastRenderedState:e},next:null},t.memoizedState=l,t=t.alternate,t!==null&&(t.memoizedState=l),l}function sd(t){var l=fd(t);l.next===null&&(l=t.alternate.memoizedState),Fu(t,l.next.queue,{},Xt())}function _c(){return gt(ha)}function od(){return ut().memoizedState}function dd(){return ut().memoizedState}function Ur(t){for(var l=t.return;l!==null;){switch(l.tag){case 24:case 3:var e=Xt();t=Gl(e);var u=Xl(l,t,e);u!==null&&(Ht(u,l,e),Ku(u,l,e)),l={cache:lc()},t.payload=l;return}l=l.return}}function Hr(t,l,e){var u=Xt();e={lane:u,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null},sn(t)?hd(l,e):(e=Li(t,l,e,u),e!==null&&(Ht(e,t,u),rd(e,l,u)))}function yd(t,l,e){var u=Xt();Fu(t,l,e,u)}function Fu(t,l,e,u){var a={lane:u,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null};if(sn(t))hd(l,a);else{var n=t.alternate;if(t.lanes===0&&(n===null||n.lanes===0)&&(n=l.lastRenderedReducer,n!==null))try{var i=l.lastRenderedState,c=n(i,e);if(a.hasEagerState=!0,a.eagerState=c,Bt(c,i))return Za(t,l,a,0),J===null&&Qa(),!1}catch{}finally{}if(e=Li(t,l,a,u),e!==null)return Ht(e,t,u),rd(e,l,u),!0}return!1}function Mc(t,l,e,u){if(u={lane:2,revertLane:nf(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},sn(t)){if(l)throw Error(g(479))}else l=Li(t,e,u,2),l!==null&&Ht(l,t,2)}function sn(t){var l=t.alternate;return t===U||l!==null&&l===U}function hd(t,l){eu=ln=!0;var e=t.pending;e===null?l.next=l:(l.next=e.next,e.next=l),t.pending=l}function rd(t,l,e){if(e&4194048){var u=l.lanes;u&=t.pendingLanes,e|=u,l.lanes=e,gs(t,e)}}var ku={readContext:gt,use:an,useCallback:tt,useContext:tt,useEffect:tt,useImperativeHandle:tt,useLayoutEffect:tt,useInsertionEffect:tt,useMemo:tt,useReducer:tt,useRef:tt,useState:tt,useDebugValue:tt,useDeferredValue:tt,useTransition:tt,useSyncExternalStore:tt,useId:tt,useHostTransitionStatus:tt,useFormState:tt,useActionState:tt,useOptimistic:tt,useMemoCache:tt,useCacheRefresh:tt};ku.useEffectEvent=tt;var vd={readContext:gt,use:an,useCallback:function(t,l){return Tt().memoizedState=[t,l===void 0?null:l],t},useContext:gt,useEffect:Io,useImperativeHandle:function(t,l,e){e=e!=null?e.concat([t]):null,cn(4194308,4,ed.bind(null,l,t),e)},useLayoutEffect:function(t,l){return cn(4194308,4,t,l)},useInsertionEffect:function(t,l){cn(4,2,t,l)},useMemo:function(t,l){var e=Tt();l=l===void 0?null:l;var u=t();if(ze){Rl(!0);try{t()}finally{Rl(!1)}}return e.memoizedState=[u,l],u},useReducer:function(t,l,e){var u=Tt();if(e!==void 0){var a=e(l);if(ze){Rl(!0);try{e(l)}finally{Rl(!1)}}}else a=l;return u.memoizedState=u.baseState=a,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:a},u.queue=t,t=t.dispatch=Hr.bind(null,U,t),[u.memoizedState,t]},useRef:function(t){var l=Tt();return t={current:t},l.memoizedState=t},useState:function(t){t=Ec(t);var l=t.queue,e=yd.bind(null,U,l);return l.dispatch=e,[t.memoizedState,e]},useDebugValue:Tc,useDeferredValue:function(t,l){var e=Tt();return Ac(e,t,l)},useTransition:function(){var t=Ec(!1);return t=cd.bind(null,U,t.queue,!0,!1),Tt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,l,e){var u=U,a=Tt();if(j){if(e===void 0)throw Error(g(407));e=e()}else{if(e=l(),J===null)throw Error(g(349));q&127||qo(u,l,e)}a.memoizedState=e;var n={value:e,getSnapshot:l};return a.queue=n,Io(jo.bind(null,u,n,t),[t]),u.flags|=2048,au(9,{destroy:void 0},Vo.bind(null,u,n,e,l),null),e},useId:function(){var t=Tt(),l=J.identifierPrefix;if(j){var e=nl,u=al;e=(u&~(1<<32-Ct(u)-1)).toString(32)+e,l="_"+l+"R_"+e,e=en++,0<\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof u.is=="string"?i.createElement("select",{is:u.is}):i.createElement("select"),u.multiple?n.multiple=!0:u.size&&(n.size=u.size);break;default:n=typeof u.is=="string"?i.createElement(a,{is:u.is}):i.createElement(a)}}n[mt]=l,n[At]=u;t:for(i=l.child;i!==null;){if(i.tag===5||i.tag===6)n.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break t;for(;i.sibling===null;){if(i.return===null||i.return===l)break t;i=i.return}i.sibling.return=i.return,i=i.sibling}l.stateNode=n;t:switch(Et(n,a,u),a){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break t;case"img":u=!0;break t;default:u=!1}u&&bl(l)}}return I(l),Qc(l,l.type,t===null?null:t.memoizedProps,l.pendingProps,e),null;case 6:if(t&&l.stateNode!=null)t.memoizedProps!==u&&bl(l);else{if(typeof u!="string"&&l.stateNode===null)throw Error(g(166));if(t=Hl.current,We(l)){if(t=l.stateNode,e=l.memoizedProps,u=null,a=St,a!==null)switch(a.tag){case 27:case 5:u=a.memoizedProps}t[mt]=l,t=!!(t.nodeValue===e||u!==null&&u.suppressHydrationWarning===!0||By(t.nodeValue,e)),t||ql(l,!0)}else t=Un(t).createTextNode(u),t[mt]=l,l.stateNode=t}return I(l),null;case 31:if(e=l.memoizedState,t===null||t.memoizedState!==null){if(u=We(l),e!==null){if(t===null){if(!u)throw Error(g(318));if(t=l.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(g(557));t[mt]=l}else re(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;I(l),t=!1}else e=ki(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=e),t=!0;if(!t)return l.flags&256?(Vt(l),l):(Vt(l),null);if(l.flags&128)throw Error(g(558))}return I(l),null;case 13:if(u=l.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(a=We(l),u!==null&&u.dehydrated!==null){if(t===null){if(!a)throw Error(g(318));if(a=l.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(g(317));a[mt]=l}else re(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;I(l),a=!1}else a=ki(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),a=!0;if(!a)return l.flags&256?(Vt(l),l):(Vt(l),null)}return Vt(l),l.flags&128?(l.lanes=e,l):(e=u!==null,t=t!==null&&t.memoizedState!==null,e&&(u=l.child,a=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(a=u.alternate.memoizedState.cachePool.pool),n=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(n=u.memoizedState.cachePool.pool),n!==a&&(u.flags|=2048)),e!==t&&e&&(l.child.flags|=8192),rn(l,l.updateQueue),I(l),null);case 4:return Ne(),t===null&&of(l.stateNode.containerInfo),I(l),null;case 10:return vl(l.type),I(l),null;case 19:if(yt(et),u=l.memoizedState,u===null)return I(l),null;if(a=(l.flags&128)!==0,n=u.rendering,n===null)if(a)Pu(u,!1);else{if(lt!==0||t!==null&&t.flags&128)for(t=l.child;t!==null;){if(n=tn(t),n!==null){for(l.flags|=128,Pu(u,!1),t=n.updateQueue,l.updateQueue=t,rn(l,t),l.subtreeFlags=0,t=e,e=l.child;e!==null;)yo(e,t),e=e.sibling;return w(et,et.current&1|2),j&&hl(l,u.treeForkCount),l.child}t=t.sibling}u.tail!==null&&Rt()>bn&&(l.flags|=128,a=!0,Pu(u,!1),l.lanes=4194304)}else{if(!a)if(t=tn(n),t!==null){if(l.flags|=128,a=!0,t=t.updateQueue,l.updateQueue=t,rn(l,t),Pu(u,!0),u.tail===null&&u.tailMode==="hidden"&&!n.alternate&&!j)return I(l),null}else 2*Rt()-u.renderingStartTime>bn&&e!==536870912&&(l.flags|=128,a=!0,Pu(u,!1),l.lanes=4194304);u.isBackwards?(n.sibling=l.child,l.child=n):(t=u.last,t!==null?t.sibling=n:l.child=n,u.last=n)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=Rt(),t.sibling=null,e=et.current,w(et,a?e&1|2:e&1),j&&hl(l,u.treeForkCount),t):(I(l),null);case 22:case 23:return Vt(l),oc(),u=l.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(l.flags|=8192):u&&(l.flags|=8192),u?e&536870912&&!(l.flags&128)&&(I(l),l.subtreeFlags&6&&(l.flags|=8192)):I(l),e=l.updateQueue,e!==null&&rn(l,e.retryQueue),e=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==e&&(l.flags|=2048),t!==null&&yt(Se),null;case 24:return e=null,t!==null&&(e=t.memoizedState.cache),l.memoizedState.cache!==e&&(l.flags|=2048),vl(it),I(l),null;case 25:return null;case 30:return null}throw Error(g(156,l.tag))}function Yr(t,l){switch(Wi(l),l.tag){case 1:return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 3:return vl(it),Ne(),t=l.flags,t&65536&&!(t&128)?(l.flags=t&-65537|128,l):null;case 26:case 27:case 5:return Aa(l),null;case 31:if(l.memoizedState!==null){if(Vt(l),l.alternate===null)throw Error(g(340));re()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 13:if(Vt(l),t=l.memoizedState,t!==null&&t.dehydrated!==null){if(l.alternate===null)throw Error(g(340));re()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 19:return yt(et),null;case 4:return Ne(),null;case 10:return vl(l.type),null;case 22:case 23:return Vt(l),oc(),t!==null&&yt(Se),t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 24:return vl(it),null;case 25:return null;default:return null}}function Gd(t,l){switch(Wi(l),l.tag){case 3:vl(it),Ne();break;case 26:case 27:case 5:Aa(l);break;case 4:Ne();break;case 31:l.memoizedState!==null&&Vt(l);break;case 13:Vt(l);break;case 19:yt(et);break;case 10:vl(l.type);break;case 22:case 23:Vt(l),oc(),t!==null&&yt(Se);break;case 24:vl(it)}}function ta(t,l){try{var e=l.updateQueue,u=e!==null?e.lastEffect:null;if(u!==null){var a=u.next;e=a;do{if((e.tag&t)===t){u=void 0;var n=e.create,i=e.inst;u=n(),i.destroy=u}e=e.next}while(e!==a)}}catch(c){Z(l,l.return,c)}}function xl(t,l,e){try{var u=l.updateQueue,a=u!==null?u.lastEffect:null;if(a!==null){var n=a.next;u=n;do{if((u.tag&t)===t){var i=u.inst,c=i.destroy;if(c!==void 0){i.destroy=void 0,a=l;var f=e,d=c;try{d()}catch(r){Z(a,f,r)}}}u=u.next}while(u!==n)}}catch(r){Z(l,l.return,r)}}function Xd(t){var l=t.updateQueue;if(l!==null){var e=t.stateNode;try{Ho(l,e)}catch(u){Z(t,t.return,u)}}}function Qd(t,l,e){e.props=pe(t.type,t.memoizedProps),e.state=t.memoizedState;try{e.componentWillUnmount()}catch(u){Z(t,l,u)}}function la(t,l){try{var e=t.ref;if(e!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:u=t.stateNode;break;default:u=t.stateNode}typeof e=="function"?t.refCleanup=e(u):e.current=u}}catch(a){Z(t,l,a)}}function il(t,l){var e=t.ref,u=t.refCleanup;if(e!==null)if(typeof u=="function")try{u()}catch(a){Z(t,l,a)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof e=="function")try{e(null)}catch(a){Z(t,l,a)}else e.current=null}function Zd(t){var l=t.type,e=t.memoizedProps,u=t.stateNode;try{t:switch(l){case"button":case"input":case"select":case"textarea":e.autoFocus&&u.focus();break t;case"img":e.src?u.src=e.src:e.srcSet&&(u.srcset=e.srcSet)}}catch(a){Z(t,t.return,a)}}function Zc(t,l,e){try{var u=t.stateNode;uv(u,t.type,e,l),u[At]=l}catch(a){Z(t,t.return,a)}}function xd(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Fl(t.type)||t.tag===4}function xc(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||xd(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Fl(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Lc(t,l,e){var u=t.tag;if(u===5||u===6)t=t.stateNode,l?(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e).insertBefore(t,l):(l=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.appendChild(t),e=e._reactRootContainer,e!=null||l.onclick!==null||(l.onclick=ol));else if(u!==4&&(u===27&&Fl(t.type)&&(e=t.stateNode,l=null),t=t.child,t!==null))for(Lc(t,l,e),t=t.sibling;t!==null;)Lc(t,l,e),t=t.sibling}function vn(t,l,e){var u=t.tag;if(u===5||u===6)t=t.stateNode,l?e.insertBefore(t,l):e.appendChild(t);else if(u!==4&&(u===27&&Fl(t.type)&&(e=t.stateNode),t=t.child,t!==null))for(vn(t,l,e),t=t.sibling;t!==null;)vn(t,l,e),t=t.sibling}function Ld(t){var l=t.stateNode,e=t.memoizedProps;try{for(var u=t.type,a=l.attributes;a.length;)l.removeAttributeNode(a[0]);Et(l,u,e),l[mt]=t,l[At]=e}catch(n){Z(t,t.return,n)}}var El=!1,st=!1,Kc=!1,Kd=typeof WeakSet=="function"?WeakSet:Set,rt=null;function qr(t,l){if(t=t.containerInfo,hf=qn,t=eo(t),ji(t)){if("selectionStart"in t)var e={start:t.selectionStart,end:t.selectionEnd};else t:{e=(e=t.ownerDocument)&&e.defaultView||window;var u=e.getSelection&&e.getSelection();if(u&&u.rangeCount!==0){e=u.anchorNode;var a=u.anchorOffset,n=u.focusNode;u=u.focusOffset;try{e.nodeType,n.nodeType}catch{e=null;break t}var i=0,c=-1,f=-1,d=0,r=0,m=t,y=null;l:for(;;){for(var v;m!==e||a!==0&&m.nodeType!==3||(c=i+a),m!==n||u!==0&&m.nodeType!==3||(f=i+u),m.nodeType===3&&(i+=m.nodeValue.length),(v=m.firstChild)!==null;)y=m,m=v;for(;;){if(m===t)break l;if(y===e&&++d===a&&(c=i),y===n&&++r===u&&(f=i),(v=m.nextSibling)!==null)break;m=y,y=m.parentNode}m=v}e=c===-1||f===-1?null:{start:c,end:f}}else e=null}e=e||{start:0,end:0}}else e=null;for(rf={focusedElem:t,selectionRange:e},qn=!1,rt=l;rt!==null;)if(l=rt,t=l.child,(l.subtreeFlags&1028)!==0&&t!==null)t.return=l,rt=t;else for(;rt!==null;){switch(l=rt,n=l.alternate,t=l.flags,l.tag){case 0:if(t&4&&(t=l.updateQueue,t=t!==null?t.events:null,t!==null))for(e=0;e title"))),Et(n,u,e),n[mt]=t,ht(n),u=n;break t;case"link":var i=ky("link","href",a).get(u+(e.href||""));if(i){for(var c=0;cH&&(i=H,H=T,T=i);var o=to(c,T),s=to(c,H);if(o&&s&&(v.rangeCount!==1||v.anchorNode!==o.node||v.anchorOffset!==o.offset||v.focusNode!==s.node||v.focusOffset!==s.offset)){var h=m.createRange();h.setStart(o.node,o.offset),v.removeAllRanges(),T>H?(v.addRange(h),v.extend(s.node,s.offset)):(h.setEnd(s.node,s.offset),v.addRange(h))}}}}for(m=[],v=c;v=v.parentNode;)v.nodeType===1&&m.push({element:v,left:v.scrollLeft,top:v.scrollTop});for(typeof c.focus=="function"&&c.focus(),c=0;ce?32:e,O.T=null,e=Ic,Ic=null;var n=wl,i=Ol;if(dt=0,su=wl=null,Ol=0,X&6)throw Error(g(331));var c=X;if(X|=4,ey(n.current),Pd(n,n.current,i,e),X=c,ca(0,!1),Nt&&typeof Nt.onPostCommitFiberRoot=="function")try{Nt.onPostCommitFiberRoot(Ou,n)}catch{}return!0}finally{G.p=a,O.T=u,Ey(t,l)}}function py(t,l,e){l=Kt(e,l),l=Rc(t.stateNode,l,2),t=Xl(t,l,2),t!==null&&(Mu(t,2),cl(t))}function Z(t,l,e){if(t.tag===3)py(t,t,e);else for(;l!==null;){if(l.tag===3){py(l,t,e);break}else if(l.tag===1){var u=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Jl===null||!Jl.has(u))){t=Kt(e,t),e=Td(2),u=Xl(l,e,2),u!==null&&(Ad(e,u,l,t),Mu(u,2),cl(u));break}}l=l.return}}function ef(t,l,e){var u=t.pingCache;if(u===null){u=t.pingCache=new Gr;var a=new Set;u.set(l,a)}else a=u.get(l),a===void 0&&(a=new Set,u.set(l,a));a.has(e)||($c=!0,a.add(e),t=Lr.bind(null,t,l,e),l.then(t,t))}function Lr(t,l,e){var u=t.pingCache;u!==null&&u.delete(l),t.pingedLanes|=t.suspendedLanes&e,t.warmLanes&=~e,J===t&&(q&e)===e&&(lt===4||lt===3&&(q&62914560)===q&&300>Rt()-gn?!(X&2)&&ou(t,0):Wc|=e,fu===q&&(fu=0)),cl(t)}function Ty(t,l){l===0&&(l=ms()),t=ye(t,l),t!==null&&(Mu(t,l),cl(t))}function Kr(t){var l=t.memoizedState,e=0;l!==null&&(e=l.retryLane),Ty(t,e)}function Jr(t,l){var e=0;switch(t.tag){case 31:case 13:var u=t.stateNode,a=t.memoizedState;a!==null&&(e=a.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(g(314))}u!==null&&u.delete(l),Ty(t,e)}function wr(t,l){return vi(t,l)}var On=null,yu=null,uf=!1,_n=!1,af=!1,Wl=0;function cl(t){t!==yu&&t.next===null&&(yu===null?On=yu=t:yu=yu.next=t),_n=!0,uf||(uf=!0,Wr())}function ca(t,l){if(!af&&_n){af=!0;do for(var e=!1,u=On;u!==null;){if(t!==0){var a=u.pendingLanes;if(a===0)var n=0;else{var i=u.suspendedLanes,c=u.pingedLanes;n=(1<<31-Ct(42|t)+1)-1,n&=a&~(i&~c),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(e=!0,My(u,n))}else n=q,n=Ua(u,u===J?n:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),!(n&3)||_u(u,n)||(e=!0,My(u,n));u=u.next}while(e);af=!1}}function $r(){Ay()}function Ay(){_n=uf=!1;var t=0;Wl!==0&&nv()&&(t=Wl);for(var l=Rt(),e=null,u=On;u!==null;){var a=u.next,n=Oy(u,l);n===0?(u.next=null,e===null?On=a:e.next=a,a===null&&(yu=e)):(e=u,(t!==0||n&3)&&(_n=!0)),u=a}dt!==0&&dt!==5||ca(t),Wl!==0&&(Wl=0)}function Oy(t,l){for(var e=t.suspendedLanes,u=t.pingedLanes,a=t.expirationTimes,n=t.pendingLanes&-62914561;0c)break;var r=f.transferSize,m=f.initiatorType;r&&Yy(m)&&(f=f.responseEnd,i+=r*(f"u"?null:document;function wy(t,l,e){var u=hu;if(u&&typeof l=="string"&&l){var a=xt(l);a='link[rel="'+t+'"][href="'+a+'"]',typeof e=="string"&&(a+='[crossorigin="'+e+'"]'),Jy.has(a)||(Jy.add(a),t={rel:t,crossOrigin:e,href:l},u.querySelector(a)===null&&(l=u.createElement("link"),Et(l,"link",t),ht(l),u.head.appendChild(l)))}}function rv(t){_l.D(t),wy("dns-prefetch",t,null)}function vv(t,l){_l.C(t,l),wy("preconnect",t,l)}function mv(t,l,e){_l.L(t,l,e);var u=hu;if(u&&t&&l){var a='link[rel="preload"][as="'+xt(l)+'"]';l==="image"&&e&&e.imageSrcSet?(a+='[imagesrcset="'+xt(e.imageSrcSet)+'"]',typeof e.imageSizes=="string"&&(a+='[imagesizes="'+xt(e.imageSizes)+'"]')):a+='[href="'+xt(t)+'"]';var n=a;switch(l){case"style":n=ru(t);break;case"script":n=vu(t)}kt.has(n)||(t=F({rel:"preload",href:l==="image"&&e&&e.imageSrcSet?void 0:t,as:l},e),kt.set(n,t),u.querySelector(a)!==null||l==="style"&&u.querySelector(da(n))||l==="script"&&u.querySelector(ya(n))||(l=u.createElement("link"),Et(l,"link",t),ht(l),u.head.appendChild(l)))}}function Sv(t,l){_l.m(t,l);var e=hu;if(e&&t){var u=l&&typeof l.as=="string"?l.as:"script",a='link[rel="modulepreload"][as="'+xt(u)+'"][href="'+xt(t)+'"]',n=a;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=vu(t)}if(!kt.has(n)&&(t=F({rel:"modulepreload",href:t},l),kt.set(n,t),e.querySelector(a)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(e.querySelector(ya(n)))return}u=e.createElement("link"),Et(u,"link",t),ht(u),e.head.appendChild(u)}}}function gv(t,l,e){_l.S(t,l,e);var u=hu;if(u&&t){var a=qe(u).hoistableStyles,n=ru(t);l=l||"default";var i=a.get(n);if(!i){var c={loading:0,preload:null};if(i=u.querySelector(da(n)))c.loading=5;else{t=F({rel:"stylesheet",href:t,"data-precedence":l},e),(e=kt.get(n))&&zf(t,e);var f=i=u.createElement("link");ht(f),Et(f,"link",t),f._p=new Promise(function(d,r){f.onload=d,f.onerror=r}),f.addEventListener("load",function(){c.loading|=1}),f.addEventListener("error",function(){c.loading|=2}),c.loading|=4,Rn(i,l,u)}i={type:"stylesheet",instance:i,count:1,state:c},a.set(n,i)}}}function bv(t,l){_l.X(t,l);var e=hu;if(e&&t){var u=qe(e).hoistableScripts,a=vu(t),n=u.get(a);n||(n=e.querySelector(ya(a)),n||(t=F({src:t,async:!0},l),(l=kt.get(a))&&pf(t,l),n=e.createElement("script"),ht(n),Et(n,"link",t),e.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},u.set(a,n))}}function Ev(t,l){_l.M(t,l);var e=hu;if(e&&t){var u=qe(e).hoistableScripts,a=vu(t),n=u.get(a);n||(n=e.querySelector(ya(a)),n||(t=F({src:t,async:!0,type:"module"},l),(l=kt.get(a))&&pf(t,l),n=e.createElement("script"),ht(n),Et(n,"link",t),e.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},u.set(a,n))}}function $y(t,l,e,u){var a=(a=Hl.current)?Hn(a):null;if(!a)throw Error(g(446));switch(t){case"meta":case"title":return null;case"style":return typeof e.precedence=="string"&&typeof e.href=="string"?(l=ru(e.href),e=qe(a).hoistableStyles,u=e.get(l),u||(u={type:"style",instance:null,count:0,state:null},e.set(l,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(e.rel==="stylesheet"&&typeof e.href=="string"&&typeof e.precedence=="string"){t=ru(e.href);var n=qe(a).hoistableStyles,i=n.get(t);if(i||(a=a.ownerDocument||a,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(t,i),(n=a.querySelector(da(t)))&&!n._p&&(i.instance=n,i.state.loading=5),kt.has(t)||(e={rel:"preload",as:"style",href:e.href,crossOrigin:e.crossOrigin,integrity:e.integrity,media:e.media,hrefLang:e.hrefLang,referrerPolicy:e.referrerPolicy},kt.set(t,e),n||zv(a,t,e,i.state))),l&&u===null)throw Error(g(528,""));return i}if(l&&u!==null)throw Error(g(529,""));return null;case"script":return l=e.async,e=e.src,typeof e=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=vu(e),e=qe(a).hoistableScripts,u=e.get(l),u||(u={type:"script",instance:null,count:0,state:null},e.set(l,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(g(444,t))}}function ru(t){return'href="'+xt(t)+'"'}function da(t){return'link[rel="stylesheet"]['+t+"]"}function Wy(t){return F({},t,{"data-precedence":t.precedence,precedence:null})}function zv(t,l,e,u){t.querySelector('link[rel="preload"][as="style"]['+l+"]")?u.loading=1:(l=t.createElement("link"),u.preload=l,l.addEventListener("load",function(){return u.loading|=1}),l.addEventListener("error",function(){return u.loading|=2}),Et(l,"link",e),ht(l),t.head.appendChild(l))}function vu(t){return'[src="'+xt(t)+'"]'}function ya(t){return"script[async]"+t}function Fy(t,l,e){if(l.count++,l.instance===null)switch(l.type){case"style":var u=t.querySelector('style[data-href~="'+xt(e.href)+'"]');if(u)return l.instance=u,ht(u),u;var a=F({},e,{"data-href":e.href,"data-precedence":e.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),ht(u),Et(u,"style",a),Rn(u,e.precedence,t),l.instance=u;case"stylesheet":a=ru(e.href);var n=t.querySelector(da(a));if(n)return l.state.loading|=4,l.instance=n,ht(n),n;u=Wy(e),(a=kt.get(a))&&zf(u,a),n=(t.ownerDocument||t).createElement("link"),ht(n);var i=n;return i._p=new Promise(function(c,f){i.onload=c,i.onerror=f}),Et(n,"link",u),l.state.loading|=4,Rn(n,e.precedence,t),l.instance=n;case"script":return n=vu(e.src),(a=t.querySelector(ya(n)))?(l.instance=a,ht(a),a):(u=e,(a=kt.get(n))&&(u=F({},e),pf(u,a)),t=t.ownerDocument||t,a=t.createElement("script"),ht(a),Et(a,"link",u),t.head.appendChild(a),l.instance=a);case"void":return null;default:throw Error(g(443,l.type))}else l.type==="stylesheet"&&!(l.state.loading&4)&&(u=l.instance,l.state.loading|=4,Rn(u,e.precedence,t));return l.instance}function Rn(t,l,e){for(var u=e.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=u.length?u[u.length-1]:null,n=a,i=0;i title"):null)}function pv(t,l,e){if(e===1||l.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return t=l.disabled,typeof l.precedence=="string"&&t==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function Py(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}function Tv(t,l,e,u){if(e.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&!(e.state.loading&4)){if(e.instance===null){var a=ru(u.href),n=l.querySelector(da(a));if(n){l=n._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(t.count++,t=Cn.bind(t),l.then(t,t)),e.state.loading|=4,e.instance=n,ht(n);return}n=l.ownerDocument||l,u=Wy(u),(a=kt.get(a))&&zf(u,a),n=n.createElement("link"),ht(n);var i=n;i._p=new Promise(function(c,f){i.onload=c,i.onerror=f}),Et(n,"link",u),e.instance=n}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(e,l),(l=e.state.preload)&&!(e.state.loading&3)&&(t.count++,e=Cn.bind(t),l.addEventListener("load",e),l.addEventListener("error",e))}}var Tf=0;function Av(t,l){return t.stylesheets&&t.count===0&&Yn(t,t.stylesheets),0Tf?50:800)+l);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(a)}}:null}function Cn(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yn(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Bn=null;function Yn(t,l){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Bn=new Map,l.forEach(Ov,t),Bn=null,Cn.call(t))}function Ov(t,l){if(!(l.state.loading&4)){var e=Bn.get(t);if(e)var u=e.get(null);else{e=new Map,Bn.set(t,e);for(var a=t.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hh)}catch(t){console.error(t)}}hh(),Ff.exports=ba;var Hf=Ff.exports;const Cv=ue({__proto__:null,default:Vf(Hf)},[Hf]);var rh={exports:{}},xn={};/** * @license React * react-jsx-runtime.production.js * @@ -46,4 +46,4 @@ Error generating stack: `+u.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Bv=Symbol.for("react.transitional.element"),Yv=Symbol.for("react.fragment");function vh(t,l,e){var u=null;if(e!==void 0&&(u=""+e),l.key!==void 0&&(u=""+l.key),"key"in l){e={};for(var a in l)a!=="key"&&(e[a]=l[a])}else e=l;return l=e.ref,{$$typeof:Bv,type:t,key:u,ref:l!==void 0?l:null,props:e}}xn.Fragment=Yv,xn.jsx=vh,xn.jsxs=vh,rh.exports=xn;var Oe=rh.exports;const mh=V.createContext(null);function Sh({namespace:t,children:l}){return Oe.jsx(mh.Provider,{value:t,children:l})}function qv(){return V.useContext(mh)}function Vv(t,l){return l?`${l}-${t}`:t}function Ml(t,l){const e=qv();return Vv(t,l!==void 0?l:e)}function jv({id:t,tagName:l="div",namespace:e,...u}){const a=Ml(t,e),n=V.useRef(null);return V.useEffect(()=>{var d;const i=n.current,c=i==null?void 0:i.parentElement;if(!i||!c||!((d=window.Shiny)!=null&&d.bindAll))return;const f=(r,m)=>{console.error(`[shinyreact] ShinyOutput "${a}" ${m} failed:`,{id:a,phase:m,error:r})};try{const r=window.Shiny.bindAll(c);r&&typeof r.catch=="function"&&r.catch(m=>f(m,"bindAll"))}catch(r){f(r,"bindAll")}return()=>{var r,m;try{(m=(r=window.Shiny)==null?void 0:r.unbindAll)==null||m.call(r,i,!0)}catch(y){f(y,"unbindAll")}}},[a,l]),Wf.createElement(l,{id:a,ref:n,...u})}const Su=Symbol("MISSING"),gh="1.0";function Gv(){if(typeof document>"u")return null;const t=document.getElementById("shinyreact-config"),l=t==null?void 0:t.textContent;if(!l)return null;try{return JSON.parse(l)}catch(e){return console.error("shinyreact: could not parse #shinyreact-config JSON",e),null}}function Xv(t){if(typeof document<"u"&&document.body){const l="shinyreact-fatal-error";let e=document.getElementById(l);e||(e=document.createElement("div"),e.id=l,e.setAttribute("role","alert"),e.style.cssText="position:fixed;top:0;left:0;right:0;z-index:99999;padding:1rem 1.25rem;background:#fee2e2;color:#7f1d1d;border-bottom:4px solid #991b1b;font-family:system-ui,sans-serif;font-size:15px;line-height:1.5;white-space:pre-wrap",document.body.appendChild(e));const u=e;u.textContent="",t.split("`").forEach((a,n)=>{if(n%2===0){u.appendChild(document.createTextNode(a));return}const i=document.createElement("code");i.textContent=a,i.style.cssText="background:#fff;color:#7f1d1d;border:1px solid #f0a3a3;border-radius:4px;padding:0.1em 0.35em;font-family:ui-monospace,SFMono-Regular,monospace;font-size:0.95em",u.appendChild(i)})}throw new Error(t.replace(/`/g,""))}function Qv(t){const l=e=>e.split(".")[0];l(t)!==l(gh)&&Xv(`shinyreact protocol mismatch: the server speaks protocol \`${t}\` but this JS client supports \`${gh}\`. Upgrade the older side (the shinyreact R/Python package, or the client bundle) so the major protocol versions match.`)}function Zv(t){const l=typeof window<"u"?window:globalThis,e=l.shinyreact=l.shinyreact||{},u=e._restore,a=Gv();if(a!=null&&a.protocolVersion?Qv(a.protocolVersion):a!=null&&console.error("shinyreact: the `#shinyreact-config` tag carries no `protocolVersion`, so the client cannot verify it speaks the same protocol as the server. Upgrade the shinyreact Python/R package.".replace(/`/g,"")),u&&typeof u=="object"&&u["-applied"])return;const n=a==null?void 0:a.restore,i=Object.create(null);if(n&&typeof n=="object")for(const[c,f]of Object.entries(n))t.add(c,f),i[c]=f;e._restore={"-applied":!0,"-values":i}}let Rf=!1,Ln=!1;const Nf=new Set;let bh=!1,Eh,zh,Th;function ph(){for(const t of Nf)t()}function Ah(){Rf||(Rf=!0,ph())}function Oh(t){Ln!==t&&(Ln=t,ph())}function xv(){if(bh||typeof document>"u")return;bh=!0,document.documentElement.classList.contains("shiny-busy")&&(Ln=!0),Eh=()=>Oh(!0),zh=()=>Oh(!1),document.addEventListener("shiny:busy",Eh),document.addEventListener("shiny:idle",zh);const t=nt();if(t){t.initializedPromise.then(Ah);return}Th=()=>{const l=nt();l&&l.initializedPromise.then(Ah)},document.addEventListener("shiny:connected",Th,{once:!0})}function _h(t){return xv(),Nf.add(t),()=>{Nf.delete(t)}}function Mh(){return Rf}function Dh(){return Ln}class Lv{constructor(){K(this,"messageHandlers",new Map);K(this,"initialized",!1)}init(){if(this.initialized)return;const l=nt();l&&(l.addCustomMessageHandler("shinyReactMessage",e=>{this.dispatchMessage(e.id,e.data)}),this.initialized=!0)}addHandler(l,e){this.init(),this.messageHandlers.has(l)||this.messageHandlers.set(l,new Set),this.messageHandlers.get(l).add(e)}removeHandler(l,e){const u=this.messageHandlers.get(l);u&&(u.delete(e),u.size===0&&this.messageHandlers.delete(l))}dispatchMessage(l,e){const u=this.messageHandlers.get(l);u&&u.forEach(a=>a(e))}getHandlerCount(l){const e=this.messageHandlers.get(l);return e?e.size:0}getActiveMessageIds(){return Array.from(this.messageHandlers.keys())}}const Uh=new Lv;function Hh(){const t=nt();return t?t.messageRegistry??(t.messageRegistry=Uh):Uh}function Kv(){nt()&&Hh()}class Jv{constructor(l){K(this,"id");K(this,"el");K(this,"status","pending");K(this,"hasValue",!1);K(this,"lastValue");K(this,"lastError",null);K(this,"useStateSetValueFns");K(this,"useStateSetStatusFns");K(this,"useStateSetErrorFns");this.id=l,this.useStateSetValueFns=new Set,this.useStateSetStatusFns=new Set,this.useStateSetErrorFns=new Set}hasReceivedValue(){return this.hasValue}getLastValue(){return this.lastValue}getLastError(){return this.lastError}addUseStateSetValueFn(l){this.useStateSetValueFns.add(l)}removeUseStateSetValueFn(l){this.useStateSetValueFns.delete(l)}addUseStateSetStatusFn(l){this.useStateSetStatusFns.add(l)}removeUseStateSetStatusFn(l){this.useStateSetStatusFns.delete(l)}addUseStateSetErrorFn(l){this.useStateSetErrorFns.add(l)}removeUseStateSetErrorFn(l){this.useStateSetErrorFns.delete(l)}getStatus(){return this.status}setStatus(l){this.status!==l&&(this.status=l,this.useStateSetStatusFns.forEach(e=>e(l)))}setValue(l){this.hasValue=!0,this.lastValue=l,this.useStateSetValueFns.forEach(e=>e(l)),this.status==="error"&&(this.lastError=null,this.useStateSetErrorFns.forEach(e=>e(null))),this.setStatus("ready")}setRecalculating(l){l?this.hasValue&&(this.status==="error"&&(this.lastError=null,this.useStateSetErrorFns.forEach(e=>e(null))),this.setStatus("recalculating")):this.hasValue&&this.status==="recalculating"&&this.setStatus("ready")}setError(l){if(l.message===""){this.setValue(null);return}this.lastError=l,this.useStateSetErrorFns.forEach(e=>e(l)),this.setStatus("error")}isEmpty(){return this.useStateSetValueFns.size===0&&this.useStateSetStatusFns.size===0&&this.useStateSetErrorFns.size===0}}class wv{constructor(){K(this,"outputs",new Map);K(this,"bindAllScheduled",!1);K(this,"containerEl")}get container(){return this.containerEl??(this.containerEl=(()=>{const l=document.createElement("div");return l.className="shiny-react-output-container",l.style.visibility="hidden",document.body.appendChild(l),l})()),this.containerEl}add(l,e,u,a){let n=this.get(l);if(!n){const i=document.createElement("div");i.className="shiny-react-output",i.id=l,this.container.appendChild(i),n=new Jv(l),n.el=i,this.outputs.set(l,n),this.scheduleBindAll()}return n.addUseStateSetValueFn(e),n.addUseStateSetStatusFn(u),n.addUseStateSetErrorFn(a),n.hasReceivedValue()&&e(n.getLastValue()),u(n.getStatus()),n.getStatus()==="error"&&a(n.getLastError()),()=>{n.removeUseStateSetValueFn(e),n.removeUseStateSetStatusFn(u),n.removeUseStateSetErrorFn(a),this.scheduleCleanup(l)}}has(l){return this.outputs.has(l)}get(l){return this.outputs.get(l)}scheduleCleanup(l){requestAnimationFrame(()=>{var u;const e=this.outputs.get(l);!e||!e.isEmpty()||(this.outputs.delete(l),(u=e.el)==null||u.remove(),this.scheduleBindAll())})}scheduleBindAll(){const l=nt();!l||!this.containerEl||this.bindAllScheduled||(this.bindAllScheduled=!0,requestAnimationFrame(()=>{var e,u;(e=l.unbindAll)==null||e.call(l,this.container),(u=l.bindAll)==null||u.call(l,this.container),this.bindAllScheduled=!1}))}}function $v(t){const l=nt();if(!l)return;class e extends l.OutputBinding{find(a){return $(a).find(".shiny-react-output")}renderValue(a,n){const i=t().get(a.id);if(!i){console.error(`Output ${a.id} not found`);return}i.setValue(n)}renderError(a,n){console.error(`Error for ${a.id}:`,n);const i=t().get(a.id);i&&i.setError(n)}showProgress(a,n){const i=t().get(a.id);if(!i){console.error(`Output ${a.id} not found`);return}i.setRecalculating(n)}}l.outputBindings.register(new e,"shiny.reactOutput")}function Cf(t,l){let e=null;const u=function(...a){const n=()=>{e=null,t(...a)};e!==null&&clearTimeout(e),e=setTimeout(n,l)};return u.setDelay=a=>{l=a},u.getDelay=()=>l,u.cancel=()=>{e!==null&&(clearTimeout(e),e=null)},u}const Sa=class Sa{constructor(l,e){K(this,"id");K(this,"value");K(this,"useStateSetValueFns");K(this,"shinySetInputValueDebounced");K(this,"opts",{debounceMs:100});K(this,"type");K(this,"typeFinalized",!1);this.id=l,this.value=e,this.useStateSetValueFns=new Set,this.shinySetInputValueDebounced=Cf(this.setShinyInputValue.bind(this),this.opts.debounceMs)}isEmpty(){return this.useStateSetValueFns.size===0}setShinyInputValue(l){var u,a;const e=`${this.id}:${this.type??Sa.DEFAULT_TYPE}`;(a=(u=nt())==null?void 0:u.setInputValue)==null||a.call(u,e,l,this.opts)}updateDebounceDelay(l){this.shinySetInputValueDebounced.setDelay(l)}updatePriority(l){const e=this.opts.priority;e!==void 0&&e!==l&&console.warn(`[shinyreact] Input "${this.id}" priority changed from ${JSON.stringify(e)} to ${JSON.stringify(l)}. Priority is per-id here, so the most recent mount wins — if two call sites for this id disagree, the winner depends on mount order.`),this.opts.priority=l}updateType(l){if(!this.typeFinalized){this.type=l,this.typeFinalized=!0;return}if(l!==void 0&&this.type!==l)throw new Error(`Input "${this.id}" is already registered with type=${this.type===void 0?`undefined (wire id "${this.id}:${Sa.DEFAULT_TYPE}")`:JSON.stringify(this.type)}. A second mount requested type=${JSON.stringify(l)}. An input's handler type changes server-side semantics and must be consistent across every useShinyInput / useSetShinyInput call for the same id.`)}addUseStateSetValueFn(l){this.useStateSetValueFns.add(l)}removeUseStateSetValueFn(l){this.useStateSetValueFns.delete(l)}setValue(l){const e=typeof l=="function"?l(this.value):l;if(this.value=e,this.useStateSetValueFns.forEach(u=>u(e)),e===Su){this.shinySetInputValueDebounced.cancel();return}this.shinySetInputValueDebounced(e)}getValue(){return this.value}};K(Sa,"DEFAULT_TYPE","shinyreact.default");let Bf=Sa;class Wv{constructor(){K(this,"inputs",new Map);K(this,"pendingSubscribers",new Map)}get(l){return this.inputs.get(l)}has(l){return this.inputs.has(l)}add(l,e){if(this.inputs.has(l))throw new Error(`Input ${l} already exists`);const u=new Bf(l,e);this.inputs.set(l,u);const a=this.pendingSubscribers.get(l);return a&&(a.forEach(n=>{u.addUseStateSetValueFn(n),n(u.getValue())}),this.pendingSubscribers.delete(l)),u}getOrCreate(l,e){let u=this.get(l);return u||(u=this.add(l,e)),u}subscribe(l,e){const u=this.get(l);if(u)return u.addUseStateSetValueFn(e),e(u.getValue()),()=>{const n=this.get(l);n&&n.removeUseStateSetValueFn(e)};let a=this.pendingSubscribers.get(l);return a||(a=new Set,this.pendingSubscribers.set(l,a)),a.add(e),()=>{const n=this.get(l);if(n){n.removeUseStateSetValueFn(e);return}const i=this.pendingSubscribers.get(l);i&&(i.delete(e),i.size===0&&this.pendingSubscribers.delete(l))}}remove(l){const e=this.inputs.get(l);return e&&e.shinySetInputValueDebounced.cancel(),this.inputs.delete(l)}keys(){return this.inputs.keys()}size(){return this.inputs.size}}let Rh;function Nh(){return Rh??(Rh={inputs:new Wv,outputs:new wv}),Rh}function Fv(){Qt()}function Qt(){const t=nt();return t?t.reactRegistry??(t.reactRegistry=Nh()):Nh()}function Kn(t,l,{debounceMs:e=100,priority:u,namespace:a,type:n}={}){if(_e(),n!==void 0&&!/^[^\s:]+$/.test(n))throw new Error(`useShinyInput("${t}"): invalid type=${JSON.stringify(n)}. Must be non-empty and contain no whitespace or ':' characters.`);const i=Ml(t,a),f=V.useRef(l).current;let d=f;const m=Qt().inputs.get(i);m&&(d=m.getValue());const[y,v]=V.useState(d),b=le();V.useEffect(()=>{if(!b)return;const o=Qt().inputs.getOrCreate(i,f);return e!==void 0&&o.updateDebounceDelay(e),u&&o.updatePriority(u),o.updateType(n),o.addUseStateSetValueFn(v),o.setValue(o.getValue()),()=>{o.removeUseStateSetValueFn(v)}},[i,b,e,u,f,n]);const p=V.useCallback(H=>{if(!b)return;const s=Qt().inputs.get(i);if(!s){console.error(`Input ${i} not found`);return}s.setValue(H)},[i,b]);return[y,p]}const gu=()=>{};function Ch(t,l=void 0,{namespace:e}={}){const[u,a]=V.useState(l),n=le();_e();const i=Ml(t,e),c=V.useRef(l);return V.useEffect(()=>{if(!n)return;const f=Qt();return a(c.current),f.outputs.add(i,a,gu,gu)},[i,n]),u}function Bh(t,{namespace:l}={}){const[e,u]=V.useState("pending"),a=le();_e();const n=Ml(t,l);return V.useEffect(()=>a?Qt().outputs.add(n,gu,u,gu):void 0,[n,a]),e}function kv(t,{namespace:l}={}){const[e,u]=V.useState(null),a=le();_e();const n=Ml(t,l);return V.useEffect(()=>a?(u(null),Qt().outputs.add(n,gu,gu,u)):void 0,[n,a]),e}function Iv(t,{namespace:l}={}){_e();const e=Ml(t,l),[u,a]=V.useState(()=>{const i=Qt().inputs.get(e);if(!i)return;const c=i.getValue();return c===Su?void 0:c}),n=le();return V.useEffect(()=>n?Qt().inputs.subscribe(e,f=>{a(f===Su?void 0:f)}):void 0,[e,n]),u}function Pv(t,l,{debounceMs:e=100,priority:u,namespace:a,type:n}={}){if(_e(),n!==void 0&&!/^[^\s:]+$/.test(n))throw new Error(`useSetShinyInput("${t}"): invalid type=${JSON.stringify(n)}. Must be non-empty and contain no whitespace or ':' characters.`);const i=Ml(t,a),f=V.useRef(l).current,d=le();return V.useEffect(()=>{if(!d)return;const m=Qt().inputs.getOrCreate(i,f);e!==void 0&&m.updateDebounceDelay(e),u&&m.updatePriority(u),m.updateType(n),m.setValue(m.getValue())},[i,d,e,u,f,n]),V.useCallback(r=>{if(!d)return;const y=Qt().inputs.get(i);if(!y){console.error(`Input ${i} not found`);return}y.setValue(r)},[i,d])}function tm(t,l,{namespace:e}={}){const u=le();_e();const a=Ml(t,e),n=V.useRef(l);n.current=l,V.useEffect(()=>{if(!u||!a)return;const i=f=>n.current(f),c=Hh();return c.addHandler(a,i),()=>{c.removeHandler(a,i)}},[u,a])}function le(){return V.useSyncExternalStore(_h,Mh,Mh)}function lm(){return V.useSyncExternalStore(_h,Dh,Dh)}let Yh=!1;function _e(){Yh||(Fv(),Zv(Qt().inputs),$v(()=>Qt().outputs),Kv(),Yh=!0)}function em({id:t,className:l,width:e,height:u,debounceMs:a=400,onRecalculating:n,namespace:i}){const c=Ml(t,i),f={namespace:null},[d,r]=Kn(`.clientdata_output_${c}_width`,Su,f),[m,y]=Kn(`.clientdata_output_${c}_height`,Su,f),[v]=Kn(`.clientdata_output_${c}_hidden`,!1,f),b=Ch(c,void 0,f),p=Bh(c,f),H=V.useRef(null),o=V.useRef(null),[s,h]=V.useState(0);V.useEffect(()=>{b&&h(E=>E+1)},[b]),V.useEffect(()=>{n&&n(p==="recalculating")},[p,n]);const S=V.useCallback(()=>{if(H.current){const E=H.current.clientWidth,_=H.current.clientHeight;E>0&&_>0&&(r(E),y(_))}},[r,y]);return V.useEffect(()=>{const E=H.current;if(!E)return;E.addEventListener("load",S);const _=Cf(()=>{E&&E.complete&&S()},a),z=new ResizeObserver(A=>{for(const M of A)M.target===E&&_()});return z.observe(E),()=>{E.removeEventListener("load",S),z.disconnect(),_.cancel()}},[H,s,r,y,a,S]),V.useEffect(()=>{if(b)return;const E=o.current;if(!E)return;const _=()=>{const M=E.clientWidth,R=E.clientHeight;M>0&&R>0&&(r(M),y(R))};_();const z=Cf(_,a),A=new ResizeObserver(()=>z());return A.observe(E),()=>{A.disconnect(),z.cancel()}},[b,r,y,a]),v?null:b?Oe.jsx("img",{ref:H,src:b.src,alt:"",className:l,style:{width:e,height:u},onLoad:S}):Oe.jsx("div",{ref:o,className:l,style:{width:e,height:u,display:"flex",alignItems:"center",justifyContent:"center",color:"#9ca3af"},children:Oe.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",style:{animation:"spin 1s linear infinite"},children:Oe.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2.5",strokeDasharray:"31.4 31.4",strokeLinecap:"round"})})})}class qh extends HTMLElement{constructor(){super(...arguments);K(this,"root",null);K(this,"slotContents",new Map)}captureSlots(e="[data-slot]"){const u=this.querySelectorAll(`:scope > ${e}`),a=new Set(u);u.forEach(i=>{const c=i.getAttribute("data-slot");c&&this.slotContents.set(c,Array.from(i.childNodes))});const n=Array.from(this.childNodes).filter(i=>!a.has(i));return n.length>0&&this.slotContents.set("__children__",n),this.slotContents}async mountSlot(e,u){var n,i;const a=this.slotContents.get(e);a&&u&&(a.forEach(c=>u.appendChild(c)),await((i=(n=window.Shiny)==null?void 0:n.bindAll)==null?void 0:i.call(n,u)))}get onSlotMount(){return this.mountSlot.bind(this)}getConfig(){const e={};for(const[u,a]of Object.entries(this.dataset))if(a!==void 0)try{e[u]=JSON.parse(a)}catch{e[u]=a}return e}get namespace(){return this.id||void 0}render(){const e=this.constructor.component;return e?Oe.jsx(e,{...this.getConfig()}):(console.error(`${this.constructor.name}: No static component defined`),null)}wrapWithProvider(e){return this.namespace?Oe.jsx(Sh,{namespace:this.namespace,children:e}):e}clearContent(){this.innerHTML=""}connectedCallback(){this.captureSlots(),this.clearContent(),this.root=Hf.createRoot(this),this.root.render(this.wrapWithProvider(this.render()))}disconnectedCallback(){var e,u,a;(u=(e=window.Shiny)==null?void 0:e.unbindAll)==null||u.call(e,this),(a=this.root)==null||a.unmount(),this.root=null}}K(qh,"component",null);function um(){window.shinyreact={useSetShinyInput:Pv,useShinyBusy:lm,useShinyInput:Kn,useShinyInputValue:Iv,useShinyOutputError:kv,useShinyOutputStatus:Bh,useShinyOutputValue:Ch,useShinyMessageHandler:tm,useShinyInitialized:le,ImageOutput:em,MISSING:Su,ShinyModuleProvider:Sh,ShinyReactComponentElement:qh,ShinyOutput:jv,React:Wf,ReactDOM:Cv}}um(),jh()})(); + */var Bv=Symbol.for("react.transitional.element"),Yv=Symbol.for("react.fragment");function vh(t,l,e){var u=null;if(e!==void 0&&(u=""+e),l.key!==void 0&&(u=""+l.key),"key"in l){e={};for(var a in l)a!=="key"&&(e[a]=l[a])}else e=l;return l=e.ref,{$$typeof:Bv,type:t,key:u,ref:l!==void 0?l:null,props:e}}xn.Fragment=Yv,xn.jsx=vh,xn.jsxs=vh,rh.exports=xn;var Oe=rh.exports;const mh=V.createContext(null);function Sh({namespace:t,children:l}){return Oe.jsx(mh.Provider,{value:t,children:l})}function qv(){return V.useContext(mh)}function Vv(t,l){return l?`${l}-${t}`:t}function Ml(t,l){const e=qv();return Vv(t,l!==void 0?l:e)}function jv({id:t,tagName:l="div",namespace:e,...u}){const a=Ml(t,e),n=V.useRef(null);return V.useEffect(()=>{var d;const i=n.current,c=i==null?void 0:i.parentElement;if(!i||!c||!((d=window.Shiny)!=null&&d.bindAll))return;const f=(r,m)=>{console.error(`[shinyreact] ShinyOutput "${a}" ${m} failed:`,{id:a,phase:m,error:r})};try{const r=window.Shiny.bindAll(c);r&&typeof r.catch=="function"&&r.catch(m=>f(m,"bindAll"))}catch(r){f(r,"bindAll")}return()=>{var r,m;try{(m=(r=window.Shiny)==null?void 0:r.unbindAll)==null||m.call(r,i,!0)}catch(y){f(y,"unbindAll")}}},[a,l]),Wf.createElement(l,{id:a,ref:n,...u})}const Su=Symbol("MISSING"),gh="1.0";function Gv(){if(typeof document>"u")return null;const t=document.getElementById("shinyreact-config"),l=t==null?void 0:t.textContent;if(!l)return null;try{return JSON.parse(l)}catch(e){return console.error("shinyreact: could not parse #shinyreact-config JSON",e),null}}function Xv(t){if(typeof document<"u"&&document.body){const l="shinyreact-fatal-error";let e=document.getElementById(l);e||(e=document.createElement("div"),e.id=l,e.setAttribute("role","alert"),e.style.cssText="position:fixed;top:0;left:0;right:0;z-index:99999;padding:1rem 1.25rem;background:#fee2e2;color:#7f1d1d;border-bottom:4px solid #991b1b;font-family:system-ui,sans-serif;font-size:15px;line-height:1.5;white-space:pre-wrap",document.body.appendChild(e));const u=e;u.textContent="",t.split("`").forEach((a,n)=>{if(n%2===0){u.appendChild(document.createTextNode(a));return}const i=document.createElement("code");i.textContent=a,i.style.cssText="background:#fff;color:#7f1d1d;border:1px solid #f0a3a3;border-radius:4px;padding:0.1em 0.35em;font-family:ui-monospace,SFMono-Regular,monospace;font-size:0.95em",u.appendChild(i)})}throw new Error(t.replace(/`/g,""))}function Qv(t){const l=e=>e.split(".")[0];l(t)!==l(gh)&&Xv(`shinyreact protocol mismatch: the server speaks protocol \`${t}\` but this JS client supports \`${gh}\`. Upgrade the older side (the shinyreact R/Python package, or the client bundle) so the major protocol versions match.`)}function Zv(t){const l=typeof window<"u"?window:globalThis,e=l.shinyreact=l.shinyreact||{},u=e._restore,a=Gv();if(a!=null&&a.protocolVersion?Qv(a.protocolVersion):a!=null&&console.error("shinyreact: the `#shinyreact-config` tag carries no `protocolVersion`, so the client cannot verify it speaks the same protocol as the server. Upgrade the shinyreact Python/R package.".replace(/`/g,"")),u&&typeof u=="object"&&u["-applied"])return;const n=a==null?void 0:a.restore,i=Object.create(null);if(n&&typeof n=="object")for(const[c,f]of Object.entries(n))t.add(c,f),i[c]=f;e._restore={"-applied":!0,"-values":i}}let Rf=!1,Ln=!1;const Nf=new Set;let bh=!1,Eh,zh,ph;function Th(){for(const t of Nf)t()}function Ah(){Rf||(Rf=!0,Th())}function Oh(t){Ln!==t&&(Ln=t,Th())}function xv(){if(bh||typeof document>"u")return;bh=!0,document.documentElement.classList.contains("shiny-busy")&&(Ln=!0),Eh=()=>Oh(!0),zh=()=>Oh(!1),document.addEventListener("shiny:busy",Eh),document.addEventListener("shiny:idle",zh);const t=nt();if(t){t.initializedPromise.then(Ah);return}ph=()=>{const l=nt();l&&l.initializedPromise.then(Ah)},document.addEventListener("shiny:connected",ph,{once:!0})}function _h(t){return xv(),Nf.add(t),()=>{Nf.delete(t)}}function Mh(){return Rf}function Dh(){return Ln}class Lv{constructor(){K(this,"messageHandlers",new Map);K(this,"initialized",!1)}init(){if(this.initialized)return;const l=nt();l&&(l.addCustomMessageHandler("shinyReactMessage",e=>{this.dispatchMessage(e.id,e.data)}),this.initialized=!0)}addHandler(l,e){this.init(),this.messageHandlers.has(l)||this.messageHandlers.set(l,new Set),this.messageHandlers.get(l).add(e)}removeHandler(l,e){const u=this.messageHandlers.get(l);u&&(u.delete(e),u.size===0&&this.messageHandlers.delete(l))}dispatchMessage(l,e){const u=this.messageHandlers.get(l);u&&u.forEach(a=>a(e))}getHandlerCount(l){const e=this.messageHandlers.get(l);return e?e.size:0}getActiveMessageIds(){return Array.from(this.messageHandlers.keys())}}const Uh=new Lv;function Hh(){const t=nt();return t?t.messageRegistry??(t.messageRegistry=Uh):Uh}function Kv(){nt()&&Hh()}class Jv{constructor(l){K(this,"id");K(this,"el");K(this,"status","pending");K(this,"hasValue",!1);K(this,"lastValue");K(this,"lastError",null);K(this,"useStateSetValueFns");K(this,"useStateSetStatusFns");K(this,"useStateSetErrorFns");this.id=l,this.useStateSetValueFns=new Set,this.useStateSetStatusFns=new Set,this.useStateSetErrorFns=new Set}hasReceivedValue(){return this.hasValue}getLastValue(){return this.lastValue}getLastError(){return this.lastError}addUseStateSetValueFn(l){this.useStateSetValueFns.add(l)}removeUseStateSetValueFn(l){this.useStateSetValueFns.delete(l)}addUseStateSetStatusFn(l){this.useStateSetStatusFns.add(l)}removeUseStateSetStatusFn(l){this.useStateSetStatusFns.delete(l)}addUseStateSetErrorFn(l){this.useStateSetErrorFns.add(l)}removeUseStateSetErrorFn(l){this.useStateSetErrorFns.delete(l)}getStatus(){return this.status}setStatus(l){this.status!==l&&(this.status=l,this.useStateSetStatusFns.forEach(e=>e(l)))}setValue(l){this.hasValue=!0,this.lastValue=l,this.useStateSetValueFns.forEach(e=>e(l)),this.status==="error"&&(this.lastError=null,this.useStateSetErrorFns.forEach(e=>e(null))),this.setStatus("ready")}setRecalculating(l){l?this.hasValue&&(this.status==="error"&&(this.lastError=null,this.useStateSetErrorFns.forEach(e=>e(null))),this.setStatus("recalculating")):this.hasValue&&this.status==="recalculating"&&this.setStatus("ready")}setError(l){if(l.message===""){this.setValue(null);return}this.lastError=l,this.useStateSetErrorFns.forEach(e=>e(l)),this.setStatus("error")}isEmpty(){return this.useStateSetValueFns.size===0&&this.useStateSetStatusFns.size===0&&this.useStateSetErrorFns.size===0}}class wv{constructor(){K(this,"outputs",new Map);K(this,"bindAllScheduled",!1);K(this,"containerEl")}get container(){return this.containerEl??(this.containerEl=(()=>{const l=document.createElement("div");return l.className="shiny-react-output-container",l.style.visibility="hidden",document.body.appendChild(l),l})()),this.containerEl}add(l,e,u,a){let n=this.get(l);if(!n){const i=document.createElement("div");i.className="shiny-react-output",i.id=l,this.container.appendChild(i),n=new Jv(l),n.el=i,this.outputs.set(l,n),this.scheduleBindAll()}return n.addUseStateSetValueFn(e),n.addUseStateSetStatusFn(u),n.addUseStateSetErrorFn(a),n.hasReceivedValue()&&e(n.getLastValue()),u(n.getStatus()),n.getStatus()==="error"&&a(n.getLastError()),()=>{n.removeUseStateSetValueFn(e),n.removeUseStateSetStatusFn(u),n.removeUseStateSetErrorFn(a),this.scheduleCleanup(l)}}has(l){return this.outputs.has(l)}get(l){return this.outputs.get(l)}scheduleCleanup(l){requestAnimationFrame(()=>{var u;const e=this.outputs.get(l);!e||!e.isEmpty()||(this.outputs.delete(l),(u=e.el)==null||u.remove(),this.scheduleBindAll())})}scheduleBindAll(){const l=nt();!l||!this.containerEl||this.bindAllScheduled||(this.bindAllScheduled=!0,requestAnimationFrame(()=>{var e,u;(e=l.unbindAll)==null||e.call(l,this.container),(u=l.bindAll)==null||u.call(l,this.container),this.bindAllScheduled=!1}))}}function $v(t){const l=nt();if(!l)return;class e extends l.OutputBinding{find(a){return $(a).find(".shiny-react-output")}renderValue(a,n){const i=t().get(a.id);if(!i){console.error(`Output ${a.id} not found`);return}i.setValue(n)}renderError(a,n){console.error(`Error for ${a.id}:`,n);const i=t().get(a.id);i&&i.setError(n)}showProgress(a,n){const i=t().get(a.id);if(!i){console.error(`Output ${a.id} not found`);return}i.setRecalculating(n)}}l.outputBindings.register(new e,"shiny.reactOutput")}function Cf(t,l){let e=null;const u=function(...a){const n=()=>{e=null,t(...a)};e!==null&&clearTimeout(e),e=setTimeout(n,l)};return u.setDelay=a=>{l=a},u.getDelay=()=>l,u.cancel=()=>{e!==null&&(clearTimeout(e),e=null)},u}const Sa=class Sa{constructor(l,e){K(this,"id");K(this,"value");K(this,"useStateSetValueFns");K(this,"shinySetInputValueDebounced");K(this,"opts",{debounceMs:100});K(this,"type");K(this,"typeFinalized",!1);this.id=l,this.value=e,this.useStateSetValueFns=new Set,this.shinySetInputValueDebounced=Cf(this.setShinyInputValue.bind(this),this.opts.debounceMs)}isEmpty(){return this.useStateSetValueFns.size===0}setShinyInputValue(l){var u,a;const e=`${this.id}:${this.type??Sa.DEFAULT_TYPE}`;(a=(u=nt())==null?void 0:u.setInputValue)==null||a.call(u,e,l,this.opts)}updateDebounceDelay(l){this.shinySetInputValueDebounced.setDelay(l)}updatePriority(l){const e=this.opts.priority;e!==void 0&&e!==l&&console.warn(`[shinyreact] Input "${this.id}" priority changed from ${JSON.stringify(e)} to ${JSON.stringify(l)}. Priority is per-id here, so the most recent mount wins — if two call sites for this id disagree, the winner depends on mount order.`),this.opts.priority=l}updateType(l){if(!this.typeFinalized){this.type=l,this.typeFinalized=!0;return}if(l!==void 0&&this.type!==l)throw new Error(`Input "${this.id}" is already registered with type=${this.type===void 0?`undefined (wire id "${this.id}:${Sa.DEFAULT_TYPE}")`:JSON.stringify(this.type)}. A second mount requested type=${JSON.stringify(l)}. An input's handler type changes server-side semantics and must be consistent across every useShinyInput / useSetShinyInput call for the same id.`)}addUseStateSetValueFn(l){this.useStateSetValueFns.add(l)}removeUseStateSetValueFn(l){this.useStateSetValueFns.delete(l)}setValue(l){const e=typeof l=="function"?l(this.value):l;if(this.value=e,this.useStateSetValueFns.forEach(u=>u(e)),e===Su){this.shinySetInputValueDebounced.cancel();return}this.shinySetInputValueDebounced(e)}getValue(){return this.value}};K(Sa,"DEFAULT_TYPE","shinyreact.default");let Bf=Sa;class Wv{constructor(){K(this,"inputs",new Map);K(this,"pendingSubscribers",new Map)}get(l){return this.inputs.get(l)}has(l){return this.inputs.has(l)}add(l,e){if(this.inputs.has(l))throw new Error(`Input ${l} already exists`);const u=new Bf(l,e);this.inputs.set(l,u);const a=this.pendingSubscribers.get(l);return a&&(a.forEach(n=>{u.addUseStateSetValueFn(n),n(u.getValue())}),this.pendingSubscribers.delete(l)),u}getOrCreate(l,e){let u=this.get(l);return u||(u=this.add(l,e)),u}subscribe(l,e){const u=this.get(l);if(u)return u.addUseStateSetValueFn(e),e(u.getValue()),()=>{const n=this.get(l);n&&n.removeUseStateSetValueFn(e)};let a=this.pendingSubscribers.get(l);return a||(a=new Set,this.pendingSubscribers.set(l,a)),a.add(e),()=>{const n=this.get(l);if(n){n.removeUseStateSetValueFn(e);return}const i=this.pendingSubscribers.get(l);i&&(i.delete(e),i.size===0&&this.pendingSubscribers.delete(l))}}remove(l){const e=this.inputs.get(l);return e&&e.shinySetInputValueDebounced.cancel(),this.inputs.delete(l)}keys(){return this.inputs.keys()}size(){return this.inputs.size}}let Rh;function Nh(){return Rh??(Rh={inputs:new Wv,outputs:new wv}),Rh}function Fv(){Qt()}function Qt(){const t=nt();return t?t.reactRegistry??(t.reactRegistry=Nh()):Nh()}function Kn(t,l,{debounceMs:e=100,priority:u,namespace:a,type:n}={}){if(_e(),n!==void 0&&!/^[^\s:]+$/.test(n))throw new Error(`useShinyInput("${t}"): invalid type=${JSON.stringify(n)}. Must be non-empty and contain no whitespace or ':' characters.`);const i=Ml(t,a),f=V.useRef(l).current;let d=f;const m=Qt().inputs.get(i);m&&(d=m.getValue());const[y,v]=V.useState(d),b=le();V.useEffect(()=>{if(!b)return;const o=Qt().inputs.getOrCreate(i,f);return e!==void 0&&o.updateDebounceDelay(e),u&&o.updatePriority(u),o.updateType(n),o.addUseStateSetValueFn(v),o.setValue(o.getValue()),()=>{o.removeUseStateSetValueFn(v)}},[i,b,e,u,f,n]);const T=V.useCallback(H=>{if(!b)return;const s=Qt().inputs.get(i);if(!s){console.error(`Input ${i} not found`);return}s.setValue(H)},[i,b]);return[y,T]}const gu=()=>{};function Ch(t,l=void 0,{namespace:e}={}){const[u,a]=V.useState(l),n=le();_e();const i=Ml(t,e),c=V.useRef(l);return V.useEffect(()=>{if(!n)return;const f=Qt();return a(c.current),f.outputs.add(i,a,gu,gu)},[i,n]),u}function Bh(t,{namespace:l}={}){const[e,u]=V.useState("pending"),a=le();_e();const n=Ml(t,l);return V.useEffect(()=>a?Qt().outputs.add(n,gu,u,gu):void 0,[n,a]),e}function kv(t,{namespace:l}={}){const[e,u]=V.useState(null),a=le();_e();const n=Ml(t,l);return V.useEffect(()=>a?(u(null),Qt().outputs.add(n,gu,gu,u)):void 0,[n,a]),e}function Iv(t,{namespace:l}={}){_e();const e=Ml(t,l),[u,a]=V.useState(()=>{const i=Qt().inputs.get(e);if(!i)return;const c=i.getValue();return c===Su?void 0:c}),n=le();return V.useEffect(()=>n?Qt().inputs.subscribe(e,f=>{a(f===Su?void 0:f)}):void 0,[e,n]),u}function Pv(t,l,{debounceMs:e=100,priority:u,namespace:a,type:n}={}){if(_e(),n!==void 0&&!/^[^\s:]+$/.test(n))throw new Error(`useSetShinyInput("${t}"): invalid type=${JSON.stringify(n)}. Must be non-empty and contain no whitespace or ':' characters.`);const i=Ml(t,a),f=V.useRef(l).current,d=le();return V.useEffect(()=>{if(!d)return;const m=Qt().inputs.getOrCreate(i,f);e!==void 0&&m.updateDebounceDelay(e),u&&m.updatePriority(u),m.updateType(n),m.setValue(m.getValue())},[i,d,e,u,f,n]),V.useCallback(r=>{if(!d)return;const y=Qt().inputs.get(i);if(!y){console.error(`Input ${i} not found`);return}y.setValue(r)},[i,d])}function tm(t,l,{namespace:e}={}){const u=le();_e();const a=Ml(t,e),n=V.useRef(l);n.current=l,V.useEffect(()=>{if(!u||!a)return;const i=f=>n.current(f),c=Hh();return c.addHandler(a,i),()=>{c.removeHandler(a,i)}},[u,a])}function le(){return V.useSyncExternalStore(_h,Mh,Mh)}function lm(){return V.useSyncExternalStore(_h,Dh,Dh)}let Yh=!1;function _e(){Yh||(Fv(),Zv(Qt().inputs),$v(()=>Qt().outputs),Kv(),Yh=!0)}function em({id:t,className:l,width:e,height:u,debounceMs:a=400,onRecalculating:n,namespace:i}){const c=Ml(t,i),f={namespace:null},[d,r]=Kn(`.clientdata_output_${c}_width`,Su,f),[m,y]=Kn(`.clientdata_output_${c}_height`,Su,f),[v]=Kn(`.clientdata_output_${c}_hidden`,!1,f),b=Ch(c,void 0,f),T=Bh(c,f),H=V.useRef(null),o=V.useRef(null),[s,h]=V.useState(0);V.useEffect(()=>{b&&h(E=>E+1)},[b]),V.useEffect(()=>{n&&n(T==="recalculating")},[T,n]);const S=V.useCallback(()=>{if(H.current){const E=H.current.clientWidth,_=H.current.clientHeight;E>0&&_>0&&(r(E),y(_))}},[r,y]);return V.useEffect(()=>{const E=H.current;if(!E)return;E.addEventListener("load",S);const _=Cf(()=>{E&&E.complete&&S()},a),z=new ResizeObserver(A=>{for(const M of A)M.target===E&&_()});return z.observe(E),()=>{E.removeEventListener("load",S),z.disconnect(),_.cancel()}},[H,s,r,y,a,S]),V.useEffect(()=>{if(b)return;const E=o.current;if(!E)return;const _=()=>{const M=E.clientWidth,R=E.clientHeight;M>0&&R>0&&(r(M),y(R))};_();const z=Cf(_,a),A=new ResizeObserver(()=>z());return A.observe(E),()=>{A.disconnect(),z.cancel()}},[b,r,y,a]),v?null:b?Oe.jsx("img",{ref:H,src:b.src,alt:"",className:l,style:{width:e,height:u},onLoad:S}):Oe.jsx("div",{ref:o,className:l,style:{width:e,height:u,display:"flex",alignItems:"center",justifyContent:"center",color:"#9ca3af"},children:Oe.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",style:{animation:"spin 1s linear infinite"},children:Oe.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2.5",strokeDasharray:"31.4 31.4",strokeLinecap:"round"})})})}class qh extends HTMLElement{constructor(){super(...arguments);K(this,"root",null);K(this,"slotContents",new Map)}captureSlots(e="[data-slot]"){const u=this.querySelectorAll(`:scope > ${e}`),a=new Set(u);u.forEach(i=>{const c=i.getAttribute("data-slot");c&&this.slotContents.set(c,Array.from(i.childNodes))});const n=Array.from(this.childNodes).filter(i=>!a.has(i));return n.length>0&&this.slotContents.set("__children__",n),this.slotContents}async mountSlot(e,u){var n,i;const a=this.slotContents.get(e);a&&u&&(a.forEach(c=>u.appendChild(c)),await((i=(n=window.Shiny)==null?void 0:n.bindAll)==null?void 0:i.call(n,u)))}get onSlotMount(){return this.mountSlot.bind(this)}getConfig(){const e={};for(const[u,a]of Object.entries(this.dataset))if(a!==void 0)try{e[u]=JSON.parse(a)}catch{e[u]=a}return e}get namespace(){return this.id||void 0}render(){const e=this.constructor.component;return e?Oe.jsx(e,{...this.getConfig()}):(console.error(`${this.constructor.name}: No static component defined`),null)}wrapWithProvider(e){return this.namespace?Oe.jsx(Sh,{namespace:this.namespace,children:e}):e}clearContent(){this.innerHTML=""}connectedCallback(){this.captureSlots(),this.clearContent(),this.root=Hf.createRoot(this),this.root.render(this.wrapWithProvider(this.render()))}disconnectedCallback(){var e,u,a;(u=(e=window.Shiny)==null?void 0:e.unbindAll)==null||u.call(e,this),(a=this.root)==null||a.unmount(),this.root=null}}K(qh,"component",null);function um(){window.shinyreact={useSetShinyInput:Pv,useShinyBusy:lm,useShinyInput:Kn,useShinyInputValue:Iv,useShinyOutputError:kv,useShinyOutputStatus:Bh,useShinyOutputValue:Ch,useShinyMessageHandler:tm,useShinyInitialized:le,ImageOutput:em,MISSING:Su,ShinyModuleProvider:Sh,ShinyReactComponentElement:qh,ShinyOutput:jv,React:Wf,ReactDOM:Cv}}um(),jh()})(); diff --git a/pkg-js/src/__tests__/entry-parity.test.ts b/pkg-js/src/__tests__/entry-parity.test.ts index 39a39b2f..1e50d289 100644 --- a/pkg-js/src/__tests__/entry-parity.test.ts +++ b/pkg-js/src/__tests__/entry-parity.test.ts @@ -30,27 +30,34 @@ function fakeShiny() { beforeEach(() => { vi.resetModules(); (window as any).Shiny = fakeShiny(); + // `installGlobal()` leaves `window.shinyreact` behind, and resetModules() + // does not undo DOM writes. Without this, whether a test sees the global + // depends on which tests ran before it. + delete (window as any).shinyreact; }); afterEach(() => { delete (window as any).Shiny; + delete (window as any).shinyreact; }); describe("entry point parity", () => { it("the IIFE entry installs dependency discovery", async () => { await import("../index"); - expect( - (window as any).Shiny.addCustomMessageHandler, - ).toHaveBeenCalledWith("shinyreact-deps", expect.any(Function)); + expect((window as any).Shiny.addCustomMessageHandler).toHaveBeenCalledWith( + "shinyreact-deps", + expect.any(Function), + ); }); it("the npm entry installs dependency discovery too (#233)", async () => { await import("../npm"); - expect( - (window as any).Shiny.addCustomMessageHandler, - ).toHaveBeenCalledWith("shinyreact-deps", expect.any(Function)); + expect((window as any).Shiny.addCustomMessageHandler).toHaveBeenCalledWith( + "shinyreact-deps", + expect.any(Function), + ); }); it("both entries send the .shinyreact_init bootstrap ping", async () => { @@ -95,7 +102,6 @@ describe("entry point parity", () => { // Deliberate divergence, not drift: npm consumers import the hooks // directly, and the global exists so no-build pages can read them off // `window`. Pinned so flipping it is a decision. - delete (window as any).shinyreact; await import("../npm"); expect((window as any).shinyreact).toBeUndefined(); @@ -103,4 +109,28 @@ describe("entry point parity", () => { await import("../index"); expect((window as any).shinyreact).toBeDefined(); }); + + it("the npm entry warns when the IIFE bundle is on the page too", async () => { + // The double-load case: an npm-tier app whose page left shinyreact_js at + // its default of "server". Harmless but wasteful, and silent until now — + // the warning is the only thing that says to pass shinyreact_js="client". + const warn = vi.spyOn(console, "warn").mockImplementation(() => {}); + + await import("../index"); // the IIFE, as the server would inject it + vi.resetModules(); // a *separate* copy of the library, as on a real page + await import("../npm"); + + expect(warn).toHaveBeenCalledOnce(); + expect(warn.mock.calls[0]?.[0]).toMatch(/shinyreact_js="client"/); + warn.mockRestore(); + }); + + it("the npm entry is silent when it is the only runtime", async () => { + const warn = vi.spyOn(console, "warn").mockImplementation(() => {}); + + await import("../npm"); + + expect(warn).not.toHaveBeenCalled(); + warn.mockRestore(); + }); }); diff --git a/pkg-js/src/npm.ts b/pkg-js/src/npm.ts index e6bf8596..0ad34bce 100644 --- a/pkg-js/src/npm.ts +++ b/pkg-js/src/npm.ts @@ -18,6 +18,31 @@ import "./shinyreact.css"; import { installDepDiscovery } from "./dep-discovery"; import { requireShinyReactConfigTag } from "./shiny-react/config"; +// Two copies on one page: this app bundles `@posit/shinyreact` AND the server +// served shinyreact.js, because the page entry point left `shinyreact_js` at its +// default of "server". It still works — the registries are page-scoped, so the +// two copies share one set of inputs, outputs, and message handlers — but the +// page downloads and parses a whole second React + hooks for nothing. +// +// A warning rather than a throw: nothing is broken, and taking down a working +// app over wasted bytes would be the wrong trade. It lives here, in the entry, +// because only the npm build can detect this — deferred classic scripts and +// module scripts execute in document order, and the page emits the bundle +// dependency before the app's, so by the time this runs the global is already +// installed if it is going to be. `installGlobal()` runs first and sees nothing. +if ( + typeof window !== "undefined" && + (window as { shinyreact?: unknown }).shinyreact +) { + console.warn( + "[shinyreact] shinyreact.js is loaded twice on this page: the server " + + "served it, and this app also imports @posit/shinyreact. The app works, " + + "but it is downloading a second copy of React and the hooks for " + + 'nothing. Pass shinyreact_js="client" to your page entry point — ' + + "page_react(), page_react_html(), set_react_page(), or ReactApp().", + ); +} + // An independently-installed client meeting a page without the // `#shinyreact-config` tag means the server predates the wire protocol — // fail loudly instead of degrading silently (see protocol/README.md §4). diff --git a/pkg-js/src/shiny-react/__tests__/get-shiny.test.ts b/pkg-js/src/shiny-react/__tests__/get-shiny.test.ts new file mode 100644 index 00000000..54cda922 --- /dev/null +++ b/pkg-js/src/shiny-react/__tests__/get-shiny.test.ts @@ -0,0 +1,33 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import { afterEach, describe, expect, it, vi } from "vitest"; + +import { getShiny } from "../get-shiny"; + +afterEach(() => { + vi.unstubAllGlobals(); + delete (window as any).Shiny; +}); + +describe("getShiny", () => { + it("returns window.Shiny when Shiny is present", () => { + const shiny = { setInputValue: vi.fn() }; + (window as any).Shiny = shiny; + + expect(getShiny()).toBe(shiny); + }); + + it("returns undefined when Shiny has not loaded yet", () => { + expect(getShiny()).toBeUndefined(); + }); + + it("returns undefined instead of throwing when there is no window", () => { + // A debounced input write can fire after the document is gone — a jsdom + // test tearing down, or a page unloading. Reading the bare `window` + // identifier there is a ReferenceError, which surfaces as an unhandled + // error and fails the whole run even though every test passed. + vi.stubGlobal("window", undefined); + + expect(() => getShiny()).not.toThrow(); + expect(getShiny()).toBeUndefined(); + }); +}); diff --git a/pkg-js/src/shiny-react/__tests__/message-registry.test.ts b/pkg-js/src/shiny-react/__tests__/message-registry.test.ts index 9287e024..379559ff 100644 --- a/pkg-js/src/shiny-react/__tests__/message-registry.test.ts +++ b/pkg-js/src/shiny-react/__tests__/message-registry.test.ts @@ -127,8 +127,9 @@ describe("getMessageRegistry", () => { it("adopts a registry another copy of the library already attached", async () => { // The page-scoped-not-module-scoped property this design exists for. Two - // copies of the bundle can coexist today (the server injects the IIFE even - // for npm-tier apps until #217), and each has its own module singleton. + // copies of the bundle can coexist today (the page entry points serve + // shinyreact.js unless an npm-tier app passes `shinyreact_js="client"`, + // #217), and each has its own module singleton. // Whoever attaches first owns the page; everyone else must adopt it, or // there would be two dispatchers competing for Shiny's single slot per // message type and one copy's handlers would go dead. diff --git a/pkg-js/src/shiny-react/get-shiny.ts b/pkg-js/src/shiny-react/get-shiny.ts index de75160a..f7a42f95 100644 --- a/pkg-js/src/shiny-react/get-shiny.ts +++ b/pkg-js/src/shiny-react/get-shiny.ts @@ -1,8 +1,18 @@ import { type ShinyClassExtended } from "./index"; /** - * Get the Shiny object if it is available + * Get the Shiny object if it is available. + * + * `typeof window` rather than a bare `window`: this is reached from debounce + * timers and event callbacks that can outlive the document — a jsdom test + * tearing down between the last `setShinyInputValue` and its 100ms debounce, or + * a page/iframe unloading — and there the bare identifier is a `ReferenceError`, + * not `undefined`. Every caller already treats a missing Shiny as "do nothing", + * so returning `undefined` degrades exactly the way they expect. */ export function getShiny(): ShinyClassExtended | undefined { + if (typeof window === "undefined") { + return undefined; + } return window.Shiny; } diff --git a/pkg-js/src/shiny-react/message-registry.ts b/pkg-js/src/shiny-react/message-registry.ts index dc265b2c..7d64a69e 100644 --- a/pkg-js/src/shiny-react/message-registry.ts +++ b/pkg-js/src/shiny-react/message-registry.ts @@ -118,8 +118,9 @@ const messageRegistry = new ShinyMessageRegistry(); * * Deliberately page-scoped rather than module-scoped, and the one place that * attaches it to `window.Shiny`. Two copies of this library can be on a page - * today — the server injects the IIFE bundle even for an npm-tier app, until - * the opt-out in #217 lands — and each copy has its own module singleton. Two + * today — the page entry points serve shinyreact.js unless an npm-tier app + * passes `shinyreact_js="client"` (#217) — and each copy has its own module + * singleton. Two * registries would mean two `addCustomMessageHandler("shinyReactMessage")` * calls, and Shiny gives us one dispatcher slot per message type: whichever * behaviour it has (silently replacing the first, or throwing), one copy's diff --git a/pkg-js/src/shiny-react/react-registry.ts b/pkg-js/src/shiny-react/react-registry.ts index bc161ee0..67991c38 100644 --- a/pkg-js/src/shiny-react/react-registry.ts +++ b/pkg-js/src/shiny-react/react-registry.ts @@ -32,8 +32,9 @@ export function initializeReactRegistry(): void { * The registry pair for this *page*. * * Page-scoped for the reason spelled out in CLAUDE.md: two copies of this - * library can be on one page (the server injects the IIFE even for npm-tier - * apps until #217), and two registries would split one input id's producers + * library can be on one page (the page entry points serve shinyreact.js unless + * an npm-tier app passes `shinyreact_js="client"`, #217), and two registries + * would split one input id's producers * from its consumers. `??=` so the first copy to run owns the page and later * copies adopt it. * diff --git a/pkg-py/src/shinyreact/_app.py b/pkg-py/src/shinyreact/_app.py index ab1b0dc5..0556c95b 100644 --- a/pkg-py/src/shinyreact/_app.py +++ b/pkg-py/src/shinyreact/_app.py @@ -17,6 +17,8 @@ from shiny import ui as _shiny_ui from shiny.types import MISSING, MISSING_TYPE +from ._dep import ShinyreactJs, _serves_bundle + if TYPE_CHECKING: from htmltools import HTMLDependency @@ -107,6 +109,11 @@ class ReactApp(_ShinyApp): bookmark_store: ``"url"`` / ``"server"`` to enable bookmarking, as for :class:`shiny.App`. Requires a callable UI, which discovery provides; a static ``ui=page_react_html(...)`` raises. + shinyreact_js: Who supplies ``shinyreact.js`` / ``shinyreact.css`` to + the discovered UI: ``"server"`` (default) or ``"client"`` for an + npm-tier app whose bundle imports ``@posit/shinyreact``. Ignored + when ``ui=`` is passed — build that UI with + ``shinyreact_js="client"`` yourself. **kwargs: Forwarded to :class:`shiny.App` (``debug=``, ``test_mode=``). Static assets @@ -152,8 +159,13 @@ def __init__( ui: Any = None, static_assets: StaticAssets | None | MISSING_TYPE = MISSING, bookmark_store: Literal["url", "server", "disable"] = "disable", + shinyreact_js: ShinyreactJs = "server", **kwargs: Any, ) -> None: + # Validate now rather than at first page render: a typo should fail at + # startup, next to the call that made it. + _serves_bundle(shinyreact_js) + # The directory holding the React bundle, to be mounted at "/". react_dir: Path | None = None @@ -175,8 +187,8 @@ def discovered_ui(request: Any) -> Any: # www/index.html during a dev session now switches modes without # a restart. `exists()` is one stat call per page render. if index_path.exists(): - return page_react_html(index_path) - return page_react(src_dir=src_dir) + return page_react_html(index_path, shinyreact_js=shinyreact_js) + return page_react(src_dir=src_dir, shinyreact_js=shinyreact_js) ui = discovered_ui diff --git a/pkg-py/src/shinyreact/_dep.py b/pkg-py/src/shinyreact/_dep.py index b0acf266..849606bf 100644 --- a/pkg-py/src/shinyreact/_dep.py +++ b/pkg-py/src/shinyreact/_dep.py @@ -1,4 +1,5 @@ from pathlib import Path +from typing import Literal from htmltools import HTMLDependency, TagChild, TagList @@ -7,6 +8,10 @@ _WWW_DIR = Path(__file__).parent / "www" _SHINYREACT_JS_PATH = _WWW_DIR / "shinyreact.js" +# Who supplies shinyreact.js (and shinyreact.css) to the page. +ShinyreactJs = Literal["server", "client"] +_SHINYREACT_JS_VALUES = ("server", "client") + def _file_mtime_int(path: Path) -> int | None: """Return the file's mtime in whole seconds, or None if it doesn't exist.""" @@ -31,11 +36,35 @@ def _dep() -> HTMLDependency: ) -def _dep_page() -> TagChild: +def _serves_bundle(shinyreact_js: ShinyreactJs) -> bool: + """Validate ``shinyreact_js=`` and say whether the page attaches the bundle. + + The one place the value is checked, so every entry point rejects a typo the + same way. A bad value is a startup error rather than a page that silently + loads no hooks. + """ + if shinyreact_js not in _SHINYREACT_JS_VALUES: + expected = ", ".join(repr(v) for v in _SHINYREACT_JS_VALUES) + raise ValueError( + f"shinyreact_js={shinyreact_js!r} is not valid. Expected one of " + f'{expected}. Use "server" when the shinyreact package should serve ' + "shinyreact.js (the default, and what a no-build app needs), and " + '"client" when your own bundle imports @posit/shinyreact and ' + "therefore ships its own copy." + ) + return shinyreact_js == "server" + + +def _dep_page(shinyreact_js: ShinyreactJs = "server") -> TagChild: """Page-level shinyreact dependency: bundle + ``#shinyreact-config`` tag. Use from page entry points (``page_react_html``, ``set_react_page``'s page function) — the config tag carries the protocol version on every page and the bookmark restore payload when one is active. + + ``shinyreact_js="client"`` omits ``shinyreact.js`` / ``shinyreact.css`` for + npm-tier pages, whose client bundle ships its own copy. The config tag is + always emitted: the npm client hard-errors without it. """ - return TagList(_dep(), _config_script_tag()) + bundle = _dep() if _serves_bundle(shinyreact_js) else None + return TagList(bundle, _config_script_tag()) diff --git a/pkg-py/src/shinyreact/_page.py b/pkg-py/src/shinyreact/_page.py index 6a677d50..4749f6ee 100644 --- a/pkg-py/src/shinyreact/_page.py +++ b/pkg-py/src/shinyreact/_page.py @@ -12,7 +12,7 @@ from ._app import ReactHtmlDocument from ._bookmark import _config_script_tag -from ._dep import _dep, _dep_page, _file_mtime_int +from ._dep import ShinyreactJs, _dep, _dep_page, _file_mtime_int, _serves_bundle if TYPE_CHECKING: # Private, but it is the only name for HTMLDependency's stylesheet entry. @@ -79,6 +79,7 @@ def page_react( css_file: str | None = "ui.css", title: str | None = None, lang: str = "en", + shinyreact_js: ShinyreactJs = "server", **kwargs: Any, ) -> Tag: """Create a React page from conventional assets — no HTML file required. @@ -108,6 +109,18 @@ def page_react( title: Page title. Defaults to the app folder's name (``src_dir``'s parent when ``src_dir`` is a ``www/`` dir). lang: HTML ``lang`` attribute. + shinyreact_js: Who supplies ``shinyreact.js`` (and + ``shinyreact.css``) to the page. + + - ``"server"`` (default) — the shinyreact package serves them as an + :class:`~htmltools.HTMLDependency`. What a no-build app needs, + and what makes ``window.shinyreact`` exist. + - ``"client"`` — your own bundle imports ``@posit/shinyreact`` and + ships its own copy, so the server sends nothing. Serving them too + would put two copies of React and the hooks on one page. + + The ``#shinyreact-config`` tag is emitted either way; the npm-tier + client hard-errors without it. **kwargs: Forwarded to :func:`page_bare`, and on to :func:`shiny.ui.page_bootstrap`. """ @@ -115,7 +128,7 @@ def page_react( caller_dir = Path(caller_file).parent if caller_file else Path.cwd() base_dir, app_name = _resolve_react_dirs(src_dir, caller_dir) return page_bare( - _dep_page(), + _dep_page(shinyreact_js), page_react_dep( src_dir=base_dir, js_file=js_file, @@ -271,7 +284,9 @@ def _read_document_cached(path: Path) -> str: return text -def set_react_page(path: str | Path | None = None) -> None: +def set_react_page( + path: str | Path | None = None, *, shinyreact_js: ShinyreactJs = "server" +) -> None: """Set the page for this Express app to a React app (the ui.tsx pattern). With no arguments, serves ``www/index.html`` when it exists; otherwise @@ -341,7 +356,13 @@ def set_react_page(path: str | Path | None = None) -> None: or against ``Path.cwd()`` when there is no caller ``__file__``. When ``None`` (the default), uses ``www/index.html`` if it exists, else discovers ``www/ui.js`` / ``www/ui.css``. + shinyreact_js: Who supplies ``shinyreact.js`` / ``shinyreact.css``: + ``"server"`` (default) or ``"client"`` for an npm-tier app whose + bundle imports ``@posit/shinyreact`` — see :func:`page_react`. """ + # Validate now rather than at first page render: a typo should fail at + # startup, next to the call that made it. + _serves_bundle(shinyreact_js) caller_file = sys._getframe(1).f_globals.get("__file__") # If the caller has no __file__ (REPL or dynamically exec'd code), # fall back to the current working directory. @@ -350,18 +371,21 @@ def set_react_page(path: str | Path | None = None) -> None: if path is None: index_path = caller_dir / "www" / "index.html" if not index_path.exists(): - page_opts(page_fn=_build_react_page_fn_discovered(caller_dir)) + page_opts( + page_fn=_build_react_page_fn_discovered(caller_dir, shinyreact_js) + ) return else: path = Path(path) index_path = path if path.is_absolute() else caller_dir / path - page_opts(page_fn=_build_react_page_fn(index_path)) + page_opts(page_fn=_build_react_page_fn(index_path, shinyreact_js)) def page_react_html( path: str | Path = "www/index.html", *, extra_deps: list[HTMLDependency] | None = None, + shinyreact_js: ShinyreactJs = "server", ) -> ReactHtmlDocument: """Serve a React ``index.html`` document (the ui.tsx pattern, Core API). @@ -405,6 +429,9 @@ def page_react_html( counterpart of :func:`page_react`'s positional ``*args``. They render *after* Shiny's and shinyreact's, so they can rely on ``window.shinyreact`` existing. + shinyreact_js: Who supplies ``shinyreact.js`` / ``shinyreact.css``: + ``"server"`` (default) or ``"client"`` for an npm-tier app whose + bundle imports ``@posit/shinyreact`` — see :func:`page_react`. """ path = Path(path) if path.is_absolute(): @@ -424,7 +451,11 @@ def page_react_html( return ReactHtmlDocument( _read_document_cached(index_path), src_dir=index_path.parent, - extra_deps=[_dep(), _config_script_tag(), *(extra_deps or [])], + extra_deps=[ + *([_dep()] if _serves_bundle(shinyreact_js) else []), + _config_script_tag(), + *(extra_deps or []), + ], ) @@ -491,7 +522,9 @@ def _react_page_opts(kwargs: dict[str, Any], *, mode: str) -> dict[str, Any]: return {k: v for k, v in kwargs.items() if v is not None} -def _build_react_page_fn_discovered(app_dir: Path) -> Callable[..., Tag]: +def _build_react_page_fn_discovered( + app_dir: Path, shinyreact_js: ShinyreactJs = "server" +) -> Callable[..., Tag]: """Express page function for the no-HTML-file mode. Serves a :func:`page_react` page from ``app_dir/www`` with the same @@ -504,13 +537,16 @@ def _react_page_fn(*args: Any, **kwargs: Any) -> Tag: return page_react( *_harvest_renderer_deps(args), src_dir=app_dir / "www", + shinyreact_js=shinyreact_js, **opts, ) return _react_page_fn -def _build_react_page_fn(index_path: Path) -> Callable[..., Tag]: +def _build_react_page_fn( + index_path: Path, shinyreact_js: ShinyreactJs = "server" +) -> Callable[..., Tag]: if not index_path.exists(): raise FileNotFoundError(f"HTML file not found: {index_path}") @@ -553,6 +589,6 @@ def _react_page_fn(*args: Any, **kwargs: Any) -> Tag: # Shiny de-duplicates dependencies by name+version when hoisting to # , so any overlap between the harvest passes is harmless. # page_opts types page_fn as -> Tag, but TagList works at runtime - return cast(Tag, TagList(_dep_page(), *deps, HTML(index_html))) + return cast(Tag, TagList(_dep_page(shinyreact_js), *deps, HTML(index_html))) return _react_page_fn diff --git a/pkg-py/src/shinyreact/www/shinyreact.js b/pkg-py/src/shinyreact/www/shinyreact.js index 223504f4..260730d1 100644 --- a/pkg-py/src/shinyreact/www/shinyreact.js +++ b/pkg-py/src/shinyreact/www/shinyreact.js @@ -1,4 +1,4 @@ -var nm=Object.defineProperty;var im=(ue,nt,ae)=>nt in ue?nm(ue,nt,{enumerable:!0,configurable:!0,writable:!0,value:ae}):ue[nt]=ae;var K=(ue,nt,ae)=>im(ue,typeof nt!="symbol"?nt+"":nt,ae);(function(){"use strict";function ue(t,l){for(var e=0;eu[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}function nt(){return window.Shiny}let ae=!1;function jh(){if(typeof document>"u"||ae)return;ae=!0;const t=()=>{const e=nt();e&&(e.addCustomMessageHandler("shinyreact-deps",async u=>{var a,n;try{const i=e;await((a=i.renderDependenciesAsync)==null?void 0:a.call(i,u)),await((n=i.bindAll)==null?void 0:n.call(i,document.documentElement))}catch(i){console.error("[shinyreact] failed to load pushed dependencies:",i)}}),e.initializedPromise.then(()=>{var u;(u=e.setInputValue)==null||u.call(e,".shinyreact_init:shinyreact.init",1)}))};if(nt()){t();return}const l=()=>{nt()&&(document.removeEventListener("shiny:connected",l),t())};document.addEventListener("shiny:connected",l)}function Vf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var jf={exports:{}},D={};/** +var nm=Object.defineProperty;var im=(ue,nt,ae)=>nt in ue?nm(ue,nt,{enumerable:!0,configurable:!0,writable:!0,value:ae}):ue[nt]=ae;var K=(ue,nt,ae)=>im(ue,typeof nt!="symbol"?nt+"":nt,ae);(function(){"use strict";function ue(t,l){for(var e=0;eu[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}function nt(){if(!(typeof window>"u"))return window.Shiny}let ae=!1;function jh(){if(typeof document>"u"||ae)return;ae=!0;const t=()=>{const e=nt();e&&(e.addCustomMessageHandler("shinyreact-deps",async u=>{var a,n;try{const i=e;await((a=i.renderDependenciesAsync)==null?void 0:a.call(i,u)),await((n=i.bindAll)==null?void 0:n.call(i,document.documentElement))}catch(i){console.error("[shinyreact] failed to load pushed dependencies:",i)}}),e.initializedPromise.then(()=>{var u;(u=e.setInputValue)==null||u.call(e,".shinyreact_init:shinyreact.init",1)}))};if(nt()){t();return}const l=()=>{nt()&&(document.removeEventListener("shiny:connected",l),t())};document.addEventListener("shiny:connected",l)}function Vf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var jf={exports:{}},D={};/** * @license React * react.production.js * @@ -14,7 +14,7 @@ var nm=Object.defineProperty;var im=(ue,nt,ae)=>nt in ue?nm(ue,nt,{enumerable:!0 * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(t){function l(T,Y){var N=T.length;T.push(Y);t:for(;0>>1,vt=T[at];if(0>>1;ata(qf,N))Mea($n,qf)?(T[at]=$n,T[Me]=N,at=Me):(T[at]=qf,T[wn]=N,at=wn);else if(Mea($n,N))T[at]=$n,T[Me]=N,at=Me;else break t}}return Y}function a(T,Y){var N=T.sortIndex-Y.sortIndex;return N!==0?N:T.id-Y.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var n=performance;t.unstable_now=function(){return n.now()}}else{var i=Date,c=i.now();t.unstable_now=function(){return i.now()-c}}var f=[],d=[],r=1,m=null,y=3,v=!1,b=!1,p=!1,H=!1,o=typeof setTimeout=="function"?setTimeout:null,s=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;function S(T){for(var Y=e(d);Y!==null;){if(Y.callback===null)u(d);else if(Y.startTime<=T)u(d),Y.sortIndex=Y.expirationTime,l(f,Y);else break;Y=e(d)}}function E(T){if(p=!1,S(T),!b)if(e(f)!==null)b=!0,_||(_=!0,ee());else{var Y=e(d);Y!==null&&Yf(E,Y.startTime-T)}}var _=!1,z=-1,A=5,M=-1;function R(){return H?!0:!(t.unstable_now()-MT&&R());){var at=m.callback;if(typeof at=="function"){m.callback=null,y=m.priorityLevel;var vt=at(m.expirationTime<=T);if(T=t.unstable_now(),typeof vt=="function"){m.callback=vt,S(T),Y=!0;break l}m===e(f)&&u(f),S(T)}else u(f);m=e(f)}if(m!==null)Y=!0;else{var Jn=e(d);Jn!==null&&Yf(E,Jn.startTime-T),Y=!1}}break t}finally{m=null,y=N,v=!1}Y=void 0}}finally{Y?ee():_=!1}}}var ee;if(typeof h=="function")ee=function(){h(It)};else if(typeof MessageChannel<"u"){var Vh=new MessageChannel,am=Vh.port2;Vh.port1.onmessage=It,ee=function(){am.postMessage(null)}}else ee=function(){o(It,0)};function Yf(T,Y){z=o(function(){T(t.unstable_now())},Y)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(T){T.callback=null},t.unstable_forceFrameRate=function(T){0>T||125at?(T.sortIndex=N,l(d,T),e(f)===null&&T===e(d)&&(p?(s(z),z=-1):p=!0,Yf(E,N-at))):(T.sortIndex=vt,l(f,T),b||v||(b=!0,_||(_=!0,ee()))),T},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(T){var Y=y;return function(){var N=y;y=Y;try{return T.apply(this,arguments)}finally{y=N}}}})(If),kf.exports=If;var l0=kf.exports,Pf={exports:{}},zt={};/** + */(function(t){function l(p,Y){var N=p.length;p.push(Y);t:for(;0>>1,vt=p[at];if(0>>1;ata(qf,N))Mea($n,qf)?(p[at]=$n,p[Me]=N,at=Me):(p[at]=qf,p[wn]=N,at=wn);else if(Mea($n,N))p[at]=$n,p[Me]=N,at=Me;else break t}}return Y}function a(p,Y){var N=p.sortIndex-Y.sortIndex;return N!==0?N:p.id-Y.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var n=performance;t.unstable_now=function(){return n.now()}}else{var i=Date,c=i.now();t.unstable_now=function(){return i.now()-c}}var f=[],d=[],r=1,m=null,y=3,v=!1,b=!1,T=!1,H=!1,o=typeof setTimeout=="function"?setTimeout:null,s=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;function S(p){for(var Y=e(d);Y!==null;){if(Y.callback===null)u(d);else if(Y.startTime<=p)u(d),Y.sortIndex=Y.expirationTime,l(f,Y);else break;Y=e(d)}}function E(p){if(T=!1,S(p),!b)if(e(f)!==null)b=!0,_||(_=!0,ee());else{var Y=e(d);Y!==null&&Yf(E,Y.startTime-p)}}var _=!1,z=-1,A=5,M=-1;function R(){return H?!0:!(t.unstable_now()-Mp&&R());){var at=m.callback;if(typeof at=="function"){m.callback=null,y=m.priorityLevel;var vt=at(m.expirationTime<=p);if(p=t.unstable_now(),typeof vt=="function"){m.callback=vt,S(p),Y=!0;break l}m===e(f)&&u(f),S(p)}else u(f);m=e(f)}if(m!==null)Y=!0;else{var Jn=e(d);Jn!==null&&Yf(E,Jn.startTime-p),Y=!1}}break t}finally{m=null,y=N,v=!1}Y=void 0}}finally{Y?ee():_=!1}}}var ee;if(typeof h=="function")ee=function(){h(It)};else if(typeof MessageChannel<"u"){var Vh=new MessageChannel,am=Vh.port2;Vh.port1.onmessage=It,ee=function(){am.postMessage(null)}}else ee=function(){o(It,0)};function Yf(p,Y){z=o(function(){p(t.unstable_now())},Y)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(p){p.callback=null},t.unstable_forceFrameRate=function(p){0>p||125at?(p.sortIndex=N,l(d,p),e(f)===null&&p===e(d)&&(T?(s(z),z=-1):T=!0,Yf(E,N-at))):(p.sortIndex=vt,l(f,p),b||v||(b=!0,_||(_=!0,ee()))),p},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(p){var Y=y;return function(){var N=y;y=Y;try{return p.apply(this,arguments)}finally{y=N}}}})(If),kf.exports=If;var l0=kf.exports,Pf={exports:{}},zt={};/** * @license React * react-dom.production.js * @@ -22,7 +22,7 @@ var nm=Object.defineProperty;var im=(ue,nt,ae)=>nt in ue?nm(ue,nt,{enumerable:!0 * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var e0=V;function ts(t){var l="https://react.dev/errors/"+t;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ls)}catch(t){console.error(t)}}ls(),Pf.exports=zt;var n0=Pf.exports;/** + */var e0=V;function ts(t){var l="https://react.dev/errors/"+t;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ls)}catch(t){console.error(t)}}ls(),Pf.exports=zt;var n0=Pf.exports;/** * @license React * react-dom-client.production.js * @@ -30,15 +30,15 @@ var nm=Object.defineProperty;var im=(ue,nt,ae)=>nt in ue?nm(ue,nt,{enumerable:!0 * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ot=l0,es=V,i0=n0;function g(t){var l="https://react.dev/errors/"+t;if(1Re||(t.current=si[Re],si[Re]=null,Re--)}function w(t,l){Re++,si[Re]=t.current,t.current=l}var ul=el(null),Au=el(null),Hl=el(null),Ta=el(null);function pa(t,l){switch(w(Hl,l),w(Au,t),w(ul,null),l.nodeType){case 9:case 11:t=(t=l.documentElement)&&(t=t.namespaceURI)?qy(t):0;break;default:if(t=l.tagName,l=l.namespaceURI)l=qy(l),t=Vy(l,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}yt(ul),w(ul,t)}function Ne(){yt(ul),yt(Au),yt(Hl)}function oi(t){t.memoizedState!==null&&w(Ta,t);var l=ul.current,e=Vy(l,t.type);l!==e&&(w(Au,t),w(ul,e))}function Aa(t){Au.current===t&&(yt(ul),yt(Au)),Ta.current===t&&(yt(Ta),ha._currentValue=ne)}var di,ds;function ie(t){if(di===void 0)try{throw Error()}catch(e){var l=e.stack.trim().match(/\n( *(at )?)/);di=l&&l[1]||"",ds=-1Re||(t.current=si[Re],si[Re]=null,Re--)}function w(t,l){Re++,si[Re]=t.current,t.current=l}var ul=el(null),Au=el(null),Hl=el(null),pa=el(null);function Ta(t,l){switch(w(Hl,l),w(Au,t),w(ul,null),l.nodeType){case 9:case 11:t=(t=l.documentElement)&&(t=t.namespaceURI)?qy(t):0;break;default:if(t=l.tagName,l=l.namespaceURI)l=qy(l),t=Vy(l,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}yt(ul),w(ul,t)}function Ne(){yt(ul),yt(Au),yt(Hl)}function oi(t){t.memoizedState!==null&&w(pa,t);var l=ul.current,e=Vy(l,t.type);l!==e&&(w(Au,t),w(ul,e))}function Aa(t){Au.current===t&&(yt(ul),yt(Au)),pa.current===t&&(yt(pa),ha._currentValue=ne)}var di,ds;function ie(t){if(di===void 0)try{throw Error()}catch(e){var l=e.stack.trim().match(/\n( *(at )?)/);di=l&&l[1]||"",ds=-1)":-1a||f[u]!==d[a]){var r=` `+f[u].replace(" at new "," at ");return t.displayName&&r.includes("")&&(r=r.replace("",t.displayName)),r}while(1<=u&&0<=a);break}}}finally{yi=!1,Error.prepareStackTrace=e}return(e=t?t.displayName||t.name:"")?ie(e):""}function d0(t,l){switch(t.tag){case 26:case 27:case 5:return ie(t.type);case 16:return ie("Lazy");case 13:return t.child!==l&&l!==null?ie("Suspense Fallback"):ie("Suspense");case 19:return ie("SuspenseList");case 0:case 15:return hi(t.type,!1);case 11:return hi(t.type.render,!1);case 1:return hi(t.type,!0);case 31:return ie("Activity");default:return""}}function ys(t){try{var l="",e=null;do l+=d0(t,e),e=t,t=t.return;while(t);return l}catch(u){return` Error generating stack: `+u.message+` -`+u.stack}}var ri=Object.prototype.hasOwnProperty,vi=ot.unstable_scheduleCallback,mi=ot.unstable_cancelCallback,y0=ot.unstable_shouldYield,h0=ot.unstable_requestPaint,Rt=ot.unstable_now,r0=ot.unstable_getCurrentPriorityLevel,hs=ot.unstable_ImmediatePriority,rs=ot.unstable_UserBlockingPriority,Oa=ot.unstable_NormalPriority,v0=ot.unstable_LowPriority,vs=ot.unstable_IdlePriority,m0=ot.log,S0=ot.unstable_setDisableYieldValue,Ou=null,Nt=null;function Rl(t){if(typeof m0=="function"&&S0(t),Nt&&typeof Nt.setStrictMode=="function")try{Nt.setStrictMode(Ou,t)}catch{}}var Ct=Math.clz32?Math.clz32:E0,g0=Math.log,b0=Math.LN2;function E0(t){return t>>>=0,t===0?32:31-(g0(t)/b0|0)|0}var _a=256,Ma=262144,Da=4194304;function ce(t){var l=t&42;if(l!==0)return l;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ua(t,l,e){var u=t.pendingLanes;if(u===0)return 0;var a=0,n=t.suspendedLanes,i=t.pingedLanes;t=t.warmLanes;var c=u&134217727;return c!==0?(u=c&~n,u!==0?a=ce(u):(i&=c,i!==0?a=ce(i):e||(e=c&~t,e!==0&&(a=ce(e))))):(c=u&~n,c!==0?a=ce(c):i!==0?a=ce(i):e||(e=u&~t,e!==0&&(a=ce(e)))),a===0?0:l!==0&&l!==a&&!(l&n)&&(n=a&-a,e=l&-l,n>=e||n===32&&(e&4194048)!==0)?l:a}function _u(t,l){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&l)===0}function z0(t,l){switch(t){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ms(){var t=Da;return Da<<=1,!(Da&62914560)&&(Da=4194304),t}function Si(t){for(var l=[],e=0;31>e;e++)l.push(t);return l}function Mu(t,l){t.pendingLanes|=l,l!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function T0(t,l,e,u,a,n){var i=t.pendingLanes;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=e,t.entangledLanes&=e,t.errorRecoveryDisabledLanes&=e,t.shellSuspendCounter=0;var c=t.entanglements,f=t.expirationTimes,d=t.hiddenUpdates;for(e=i&~e;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var D0=/[\n"\\]/g;function xt(t){return t.replace(D0,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function pi(t,l,e,u,a,n,i,c){t.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?t.type=i:t.removeAttribute("type"),l!=null?i==="number"?(l===0&&t.value===""||t.value!=l)&&(t.value=""+Zt(l)):t.value!==""+Zt(l)&&(t.value=""+Zt(l)):i!=="submit"&&i!=="reset"||t.removeAttribute("value"),l!=null?Ai(t,i,Zt(l)):e!=null?Ai(t,i,Zt(e)):u!=null&&t.removeAttribute("value"),a==null&&n!=null&&(t.defaultChecked=!!n),a!=null&&(t.checked=a&&typeof a!="function"&&typeof a!="symbol"),c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?t.name=""+Zt(c):t.removeAttribute("name")}function Us(t,l,e,u,a,n,i,c){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(t.type=n),l!=null||e!=null){if(!(n!=="submit"&&n!=="reset"||l!=null)){Ti(t);return}e=e!=null?""+Zt(e):"",l=l!=null?""+Zt(l):e,c||l===t.value||(t.value=l),t.defaultValue=l}u=u??a,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=c?t.checked:!!u,t.defaultChecked=!!u,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.name=i),Ti(t)}function Ai(t,l,e){l==="number"&&Na(t.ownerDocument)===t||t.defaultValue===""+e||(t.defaultValue=""+e)}function je(t,l,e,u){if(t=t.options,l){l={};for(var a=0;a"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ui=!1;if(dl)try{var Ru={};Object.defineProperty(Ru,"passive",{get:function(){Ui=!0}}),window.addEventListener("test",Ru,Ru),window.removeEventListener("test",Ru,Ru)}catch{Ui=!1}var Cl=null,Hi=null,Ba=null;function qs(){if(Ba)return Ba;var t,l=Hi,e=l.length,u,a="value"in Cl?Cl.value:Cl.textContent,n=a.length;for(t=0;t=Bu),Zs=" ",xs=!1;function Ls(t,l){switch(t){case"keyup":return er.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ks(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ze=!1;function ar(t,l){switch(t){case"compositionend":return Ks(l);case"keypress":return l.which!==32?null:(xs=!0,Zs);case"textInput":return t=l.data,t===Zs&&xs?null:t;default:return null}}function nr(t,l){if(Ze)return t==="compositionend"||!Yi&&Ls(t,l)?(t=qs(),Ba=Hi=Cl=null,Ze=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:e,offset:l-t};t=u}t:{for(;e;){if(e.nextSibling){e=e.nextSibling;break t}e=e.parentNode}e=void 0}e=Ps(e)}}function lo(t,l){return t&&l?t===l?!0:t&&t.nodeType===3?!1:l&&l.nodeType===3?lo(t,l.parentNode):"contains"in t?t.contains(l):t.compareDocumentPosition?!!(t.compareDocumentPosition(l)&16):!1:!1}function eo(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var l=Na(t.document);l instanceof t.HTMLIFrameElement;){try{var e=typeof l.contentWindow.location.href=="string"}catch{e=!1}if(e)t=l.contentWindow;else break;l=Na(t.document)}return l}function ji(t){var l=t&&t.nodeName&&t.nodeName.toLowerCase();return l&&(l==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||l==="textarea"||t.contentEditable==="true")}var hr=dl&&"documentMode"in document&&11>=document.documentMode,xe=null,Gi=null,ju=null,Xi=!1;function uo(t,l,e){var u=e.window===e?e.document:e.nodeType===9?e:e.ownerDocument;Xi||xe==null||xe!==Na(u)||(u=xe,"selectionStart"in u&&ji(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),ju&&Vu(ju,u)||(ju=u,u=Dn(Gi,"onSelect"),0>=i,a-=i,al=1<<32-Ct(l)+a|e<A?(M=z,z=null):M=z.sibling;var R=y(o,z,h[A],S);if(R===null){z===null&&(z=M);break}t&&z&&R.alternate===null&&l(o,z),s=n(R,s,A),_===null?E=R:_.sibling=R,_=R,z=M}if(A===h.length)return e(o,z),j&&hl(o,A),E;if(z===null){for(;AA?(M=z,z=null):M=z.sibling;var It=y(o,z,R.value,S);if(It===null){z===null&&(z=M);break}t&&z&&It.alternate===null&&l(o,z),s=n(It,s,A),_===null?E=It:_.sibling=It,_=It,z=M}if(R.done)return e(o,z),j&&hl(o,A),E;if(z===null){for(;!R.done;A++,R=h.next())R=m(o,R.value,S),R!==null&&(s=n(R,s,A),_===null?E=R:_.sibling=R,_=R);return j&&hl(o,A),E}for(z=u(z);!R.done;A++,R=h.next())R=v(z,o,A,R.value,S),R!==null&&(t&&R.alternate!==null&&z.delete(R.key===null?A:R.key),s=n(R,s,A),_===null?E=R:_.sibling=R,_=R);return t&&z.forEach(function(ee){return l(o,ee)}),j&&hl(o,A),E}function H(o,s,h,S){if(typeof h=="object"&&h!==null&&h.type===He&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case za:t:{for(var E=h.key;s!==null;){if(s.key===E){if(E=h.type,E===He){if(s.tag===7){e(o,s.sibling),S=a(s,h.props.children),S.return=o,o=S;break t}}else if(s.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ul&&ge(E)===s.type){e(o,s.sibling),S=a(s,h.props),Lu(S,h),S.return=o,o=S;break t}e(o,s);break}else l(o,s);s=s.sibling}h.type===He?(S=he(h.props.children,o.mode,S,h.key),S.return=o,o=S):(S=La(h.type,h.key,h.props,null,o.mode,S),Lu(S,h),S.return=o,o=S)}return i(o);case zu:t:{for(E=h.key;s!==null;){if(s.key===E)if(s.tag===4&&s.stateNode.containerInfo===h.containerInfo&&s.stateNode.implementation===h.implementation){e(o,s.sibling),S=a(s,h.children||[]),S.return=o,o=S;break t}else{e(o,s);break}else l(o,s);s=s.sibling}S=wi(h,o.mode,S),S.return=o,o=S}return i(o);case Ul:return h=ge(h),H(o,s,h,S)}if(pu(h))return b(o,s,h,S);if(Tu(h)){if(E=Tu(h),typeof E!="function")throw Error(g(150));return h=E.call(h),p(o,s,h,S)}if(typeof h.then=="function")return H(o,s,ka(h),S);if(h.$$typeof===fl)return H(o,s,wa(o,h),S);Ia(o,h)}return typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint"?(h=""+h,s!==null&&s.tag===6?(e(o,s.sibling),S=a(s,h),S.return=o,o=S):(e(o,s),S=Ji(h,o.mode,S),S.return=o,o=S),i(o)):e(o,s)}return function(o,s,h,S){try{xu=0;var E=H(o,s,h,S);return tu=null,E}catch(z){if(z===Pe||z===Wa)throw z;var _=Yt(29,z,null,o.mode);return _.lanes=S,_.return=o,_}finally{}}}var Ee=Mo(!0),Do=Mo(!1),jl=!1;function nc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ic(t,l){t=t.updateQueue,l.updateQueue===t&&(l.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Gl(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Xl(t,l,e){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,X&2){var a=u.pending;return a===null?l.next=l:(l.next=a.next,a.next=l),u.pending=l,l=xa(t),oo(t,null,e),l}return Za(t,u,l,e),xa(t)}function Ku(t,l,e){if(l=l.updateQueue,l!==null&&(l=l.shared,(e&4194048)!==0)){var u=l.lanes;u&=t.pendingLanes,e|=u,l.lanes=e,gs(t,e)}}function cc(t,l){var e=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,e===u)){var a=null,n=null;if(e=e.firstBaseUpdate,e!==null){do{var i={lane:e.lane,tag:e.tag,payload:e.payload,callback:null,next:null};n===null?a=n=i:n=n.next=i,e=e.next}while(e!==null);n===null?a=n=l:n=n.next=l}else a=n=l;e={baseState:u.baseState,firstBaseUpdate:a,lastBaseUpdate:n,shared:u.shared,callbacks:u.callbacks},t.updateQueue=e;return}t=e.lastBaseUpdate,t===null?e.firstBaseUpdate=l:t.next=l,e.lastBaseUpdate=l}var fc=!1;function Ju(){if(fc){var t=Ie;if(t!==null)throw t}}function wu(t,l,e,u){fc=!1;var a=t.updateQueue;jl=!1;var n=a.firstBaseUpdate,i=a.lastBaseUpdate,c=a.shared.pending;if(c!==null){a.shared.pending=null;var f=c,d=f.next;f.next=null,i===null?n=d:i.next=d,i=f;var r=t.alternate;r!==null&&(r=r.updateQueue,c=r.lastBaseUpdate,c!==i&&(c===null?r.firstBaseUpdate=d:c.next=d,r.lastBaseUpdate=f))}if(n!==null){var m=a.baseState;i=0,r=d=f=null,c=n;do{var y=c.lane&-536870913,v=y!==c.lane;if(v?(q&y)===y:(u&y)===y){y!==0&&y===ke&&(fc=!0),r!==null&&(r=r.next={lane:0,tag:c.tag,payload:c.payload,callback:null,next:null});t:{var b=t,p=c;y=l;var H=e;switch(p.tag){case 1:if(b=p.payload,typeof b=="function"){m=b.call(H,m,y);break t}m=b;break t;case 3:b.flags=b.flags&-65537|128;case 0:if(b=p.payload,y=typeof b=="function"?b.call(H,m,y):b,y==null)break t;m=F({},m,y);break t;case 2:jl=!0}}y=c.callback,y!==null&&(t.flags|=64,v&&(t.flags|=8192),v=a.callbacks,v===null?a.callbacks=[y]:v.push(y))}else v={lane:y,tag:c.tag,payload:c.payload,callback:c.callback,next:null},r===null?(d=r=v,f=m):r=r.next=v,i|=y;if(c=c.next,c===null){if(c=a.shared.pending,c===null)break;v=c,c=v.next,v.next=null,a.lastBaseUpdate=v,a.shared.pending=null}}while(!0);r===null&&(f=m),a.baseState=f,a.firstBaseUpdate=d,a.lastBaseUpdate=r,n===null&&(a.shared.lanes=0),Kl|=i,t.lanes=i,t.memoizedState=m}}function Uo(t,l){if(typeof t!="function")throw Error(g(191,t));t.call(l)}function Ho(t,l){var e=t.callbacks;if(e!==null)for(t.callbacks=null,t=0;tn?n:8;var i=O.T,c={};O.T=c,Mc(t,!1,l,e);try{var f=a(),d=O.S;if(d!==null&&d(c,f),f!==null&&typeof f=="object"&&typeof f.then=="function"){var r=Tr(f,u);Fu(t,l,r,Xt(t))}else Fu(t,l,u,Xt(t))}catch(m){Fu(t,l,{then:function(){},status:"rejected",reason:m},Xt())}finally{G.p=n,i!==null&&c.types!==null&&(i.types=c.types),O.T=i}}function Dr(){}function Oc(t,l,e,u){if(t.tag!==5)throw Error(g(476));var a=fd(t).queue;cd(t,a,l,ne,e===null?Dr:function(){return sd(t),e(u)})}function fd(t){var l=t.memoizedState;if(l!==null)return l;l={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sl,lastRenderedState:ne},next:null};var e={};return l.next={memoizedState:e,baseState:e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sl,lastRenderedState:e},next:null},t.memoizedState=l,t=t.alternate,t!==null&&(t.memoizedState=l),l}function sd(t){var l=fd(t);l.next===null&&(l=t.alternate.memoizedState),Fu(t,l.next.queue,{},Xt())}function _c(){return gt(ha)}function od(){return ut().memoizedState}function dd(){return ut().memoizedState}function Ur(t){for(var l=t.return;l!==null;){switch(l.tag){case 24:case 3:var e=Xt();t=Gl(e);var u=Xl(l,t,e);u!==null&&(Ht(u,l,e),Ku(u,l,e)),l={cache:lc()},t.payload=l;return}l=l.return}}function Hr(t,l,e){var u=Xt();e={lane:u,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null},sn(t)?hd(l,e):(e=Li(t,l,e,u),e!==null&&(Ht(e,t,u),rd(e,l,u)))}function yd(t,l,e){var u=Xt();Fu(t,l,e,u)}function Fu(t,l,e,u){var a={lane:u,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null};if(sn(t))hd(l,a);else{var n=t.alternate;if(t.lanes===0&&(n===null||n.lanes===0)&&(n=l.lastRenderedReducer,n!==null))try{var i=l.lastRenderedState,c=n(i,e);if(a.hasEagerState=!0,a.eagerState=c,Bt(c,i))return Za(t,l,a,0),J===null&&Qa(),!1}catch{}finally{}if(e=Li(t,l,a,u),e!==null)return Ht(e,t,u),rd(e,l,u),!0}return!1}function Mc(t,l,e,u){if(u={lane:2,revertLane:nf(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},sn(t)){if(l)throw Error(g(479))}else l=Li(t,e,u,2),l!==null&&Ht(l,t,2)}function sn(t){var l=t.alternate;return t===U||l!==null&&l===U}function hd(t,l){eu=ln=!0;var e=t.pending;e===null?l.next=l:(l.next=e.next,e.next=l),t.pending=l}function rd(t,l,e){if(e&4194048){var u=l.lanes;u&=t.pendingLanes,e|=u,l.lanes=e,gs(t,e)}}var ku={readContext:gt,use:an,useCallback:tt,useContext:tt,useEffect:tt,useImperativeHandle:tt,useLayoutEffect:tt,useInsertionEffect:tt,useMemo:tt,useReducer:tt,useRef:tt,useState:tt,useDebugValue:tt,useDeferredValue:tt,useTransition:tt,useSyncExternalStore:tt,useId:tt,useHostTransitionStatus:tt,useFormState:tt,useActionState:tt,useOptimistic:tt,useMemoCache:tt,useCacheRefresh:tt};ku.useEffectEvent=tt;var vd={readContext:gt,use:an,useCallback:function(t,l){return pt().memoizedState=[t,l===void 0?null:l],t},useContext:gt,useEffect:Io,useImperativeHandle:function(t,l,e){e=e!=null?e.concat([t]):null,cn(4194308,4,ed.bind(null,l,t),e)},useLayoutEffect:function(t,l){return cn(4194308,4,t,l)},useInsertionEffect:function(t,l){cn(4,2,t,l)},useMemo:function(t,l){var e=pt();l=l===void 0?null:l;var u=t();if(ze){Rl(!0);try{t()}finally{Rl(!1)}}return e.memoizedState=[u,l],u},useReducer:function(t,l,e){var u=pt();if(e!==void 0){var a=e(l);if(ze){Rl(!0);try{e(l)}finally{Rl(!1)}}}else a=l;return u.memoizedState=u.baseState=a,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:a},u.queue=t,t=t.dispatch=Hr.bind(null,U,t),[u.memoizedState,t]},useRef:function(t){var l=pt();return t={current:t},l.memoizedState=t},useState:function(t){t=Ec(t);var l=t.queue,e=yd.bind(null,U,l);return l.dispatch=e,[t.memoizedState,e]},useDebugValue:pc,useDeferredValue:function(t,l){var e=pt();return Ac(e,t,l)},useTransition:function(){var t=Ec(!1);return t=cd.bind(null,U,t.queue,!0,!1),pt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,l,e){var u=U,a=pt();if(j){if(e===void 0)throw Error(g(407));e=e()}else{if(e=l(),J===null)throw Error(g(349));q&127||qo(u,l,e)}a.memoizedState=e;var n={value:e,getSnapshot:l};return a.queue=n,Io(jo.bind(null,u,n,t),[t]),u.flags|=2048,au(9,{destroy:void 0},Vo.bind(null,u,n,e,l),null),e},useId:function(){var t=pt(),l=J.identifierPrefix;if(j){var e=nl,u=al;e=(u&~(1<<32-Ct(u)-1)).toString(32)+e,l="_"+l+"R_"+e,e=en++,0<\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof u.is=="string"?i.createElement("select",{is:u.is}):i.createElement("select"),u.multiple?n.multiple=!0:u.size&&(n.size=u.size);break;default:n=typeof u.is=="string"?i.createElement(a,{is:u.is}):i.createElement(a)}}n[mt]=l,n[At]=u;t:for(i=l.child;i!==null;){if(i.tag===5||i.tag===6)n.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break t;for(;i.sibling===null;){if(i.return===null||i.return===l)break t;i=i.return}i.sibling.return=i.return,i=i.sibling}l.stateNode=n;t:switch(Et(n,a,u),a){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break t;case"img":u=!0;break t;default:u=!1}u&&bl(l)}}return I(l),Qc(l,l.type,t===null?null:t.memoizedProps,l.pendingProps,e),null;case 6:if(t&&l.stateNode!=null)t.memoizedProps!==u&&bl(l);else{if(typeof u!="string"&&l.stateNode===null)throw Error(g(166));if(t=Hl.current,We(l)){if(t=l.stateNode,e=l.memoizedProps,u=null,a=St,a!==null)switch(a.tag){case 27:case 5:u=a.memoizedProps}t[mt]=l,t=!!(t.nodeValue===e||u!==null&&u.suppressHydrationWarning===!0||By(t.nodeValue,e)),t||ql(l,!0)}else t=Un(t).createTextNode(u),t[mt]=l,l.stateNode=t}return I(l),null;case 31:if(e=l.memoizedState,t===null||t.memoizedState!==null){if(u=We(l),e!==null){if(t===null){if(!u)throw Error(g(318));if(t=l.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(g(557));t[mt]=l}else re(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;I(l),t=!1}else e=ki(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=e),t=!0;if(!t)return l.flags&256?(Vt(l),l):(Vt(l),null);if(l.flags&128)throw Error(g(558))}return I(l),null;case 13:if(u=l.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(a=We(l),u!==null&&u.dehydrated!==null){if(t===null){if(!a)throw Error(g(318));if(a=l.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(g(317));a[mt]=l}else re(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;I(l),a=!1}else a=ki(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),a=!0;if(!a)return l.flags&256?(Vt(l),l):(Vt(l),null)}return Vt(l),l.flags&128?(l.lanes=e,l):(e=u!==null,t=t!==null&&t.memoizedState!==null,e&&(u=l.child,a=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(a=u.alternate.memoizedState.cachePool.pool),n=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(n=u.memoizedState.cachePool.pool),n!==a&&(u.flags|=2048)),e!==t&&e&&(l.child.flags|=8192),rn(l,l.updateQueue),I(l),null);case 4:return Ne(),t===null&&of(l.stateNode.containerInfo),I(l),null;case 10:return vl(l.type),I(l),null;case 19:if(yt(et),u=l.memoizedState,u===null)return I(l),null;if(a=(l.flags&128)!==0,n=u.rendering,n===null)if(a)Pu(u,!1);else{if(lt!==0||t!==null&&t.flags&128)for(t=l.child;t!==null;){if(n=tn(t),n!==null){for(l.flags|=128,Pu(u,!1),t=n.updateQueue,l.updateQueue=t,rn(l,t),l.subtreeFlags=0,t=e,e=l.child;e!==null;)yo(e,t),e=e.sibling;return w(et,et.current&1|2),j&&hl(l,u.treeForkCount),l.child}t=t.sibling}u.tail!==null&&Rt()>bn&&(l.flags|=128,a=!0,Pu(u,!1),l.lanes=4194304)}else{if(!a)if(t=tn(n),t!==null){if(l.flags|=128,a=!0,t=t.updateQueue,l.updateQueue=t,rn(l,t),Pu(u,!0),u.tail===null&&u.tailMode==="hidden"&&!n.alternate&&!j)return I(l),null}else 2*Rt()-u.renderingStartTime>bn&&e!==536870912&&(l.flags|=128,a=!0,Pu(u,!1),l.lanes=4194304);u.isBackwards?(n.sibling=l.child,l.child=n):(t=u.last,t!==null?t.sibling=n:l.child=n,u.last=n)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=Rt(),t.sibling=null,e=et.current,w(et,a?e&1|2:e&1),j&&hl(l,u.treeForkCount),t):(I(l),null);case 22:case 23:return Vt(l),oc(),u=l.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(l.flags|=8192):u&&(l.flags|=8192),u?e&536870912&&!(l.flags&128)&&(I(l),l.subtreeFlags&6&&(l.flags|=8192)):I(l),e=l.updateQueue,e!==null&&rn(l,e.retryQueue),e=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==e&&(l.flags|=2048),t!==null&&yt(Se),null;case 24:return e=null,t!==null&&(e=t.memoizedState.cache),l.memoizedState.cache!==e&&(l.flags|=2048),vl(it),I(l),null;case 25:return null;case 30:return null}throw Error(g(156,l.tag))}function Yr(t,l){switch(Wi(l),l.tag){case 1:return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 3:return vl(it),Ne(),t=l.flags,t&65536&&!(t&128)?(l.flags=t&-65537|128,l):null;case 26:case 27:case 5:return Aa(l),null;case 31:if(l.memoizedState!==null){if(Vt(l),l.alternate===null)throw Error(g(340));re()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 13:if(Vt(l),t=l.memoizedState,t!==null&&t.dehydrated!==null){if(l.alternate===null)throw Error(g(340));re()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 19:return yt(et),null;case 4:return Ne(),null;case 10:return vl(l.type),null;case 22:case 23:return Vt(l),oc(),t!==null&&yt(Se),t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 24:return vl(it),null;case 25:return null;default:return null}}function Gd(t,l){switch(Wi(l),l.tag){case 3:vl(it),Ne();break;case 26:case 27:case 5:Aa(l);break;case 4:Ne();break;case 31:l.memoizedState!==null&&Vt(l);break;case 13:Vt(l);break;case 19:yt(et);break;case 10:vl(l.type);break;case 22:case 23:Vt(l),oc(),t!==null&&yt(Se);break;case 24:vl(it)}}function ta(t,l){try{var e=l.updateQueue,u=e!==null?e.lastEffect:null;if(u!==null){var a=u.next;e=a;do{if((e.tag&t)===t){u=void 0;var n=e.create,i=e.inst;u=n(),i.destroy=u}e=e.next}while(e!==a)}}catch(c){Z(l,l.return,c)}}function xl(t,l,e){try{var u=l.updateQueue,a=u!==null?u.lastEffect:null;if(a!==null){var n=a.next;u=n;do{if((u.tag&t)===t){var i=u.inst,c=i.destroy;if(c!==void 0){i.destroy=void 0,a=l;var f=e,d=c;try{d()}catch(r){Z(a,f,r)}}}u=u.next}while(u!==n)}}catch(r){Z(l,l.return,r)}}function Xd(t){var l=t.updateQueue;if(l!==null){var e=t.stateNode;try{Ho(l,e)}catch(u){Z(t,t.return,u)}}}function Qd(t,l,e){e.props=Te(t.type,t.memoizedProps),e.state=t.memoizedState;try{e.componentWillUnmount()}catch(u){Z(t,l,u)}}function la(t,l){try{var e=t.ref;if(e!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:u=t.stateNode;break;default:u=t.stateNode}typeof e=="function"?t.refCleanup=e(u):e.current=u}}catch(a){Z(t,l,a)}}function il(t,l){var e=t.ref,u=t.refCleanup;if(e!==null)if(typeof u=="function")try{u()}catch(a){Z(t,l,a)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof e=="function")try{e(null)}catch(a){Z(t,l,a)}else e.current=null}function Zd(t){var l=t.type,e=t.memoizedProps,u=t.stateNode;try{t:switch(l){case"button":case"input":case"select":case"textarea":e.autoFocus&&u.focus();break t;case"img":e.src?u.src=e.src:e.srcSet&&(u.srcset=e.srcSet)}}catch(a){Z(t,t.return,a)}}function Zc(t,l,e){try{var u=t.stateNode;uv(u,t.type,e,l),u[At]=l}catch(a){Z(t,t.return,a)}}function xd(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Fl(t.type)||t.tag===4}function xc(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||xd(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Fl(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Lc(t,l,e){var u=t.tag;if(u===5||u===6)t=t.stateNode,l?(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e).insertBefore(t,l):(l=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.appendChild(t),e=e._reactRootContainer,e!=null||l.onclick!==null||(l.onclick=ol));else if(u!==4&&(u===27&&Fl(t.type)&&(e=t.stateNode,l=null),t=t.child,t!==null))for(Lc(t,l,e),t=t.sibling;t!==null;)Lc(t,l,e),t=t.sibling}function vn(t,l,e){var u=t.tag;if(u===5||u===6)t=t.stateNode,l?e.insertBefore(t,l):e.appendChild(t);else if(u!==4&&(u===27&&Fl(t.type)&&(e=t.stateNode),t=t.child,t!==null))for(vn(t,l,e),t=t.sibling;t!==null;)vn(t,l,e),t=t.sibling}function Ld(t){var l=t.stateNode,e=t.memoizedProps;try{for(var u=t.type,a=l.attributes;a.length;)l.removeAttributeNode(a[0]);Et(l,u,e),l[mt]=t,l[At]=e}catch(n){Z(t,t.return,n)}}var El=!1,st=!1,Kc=!1,Kd=typeof WeakSet=="function"?WeakSet:Set,rt=null;function qr(t,l){if(t=t.containerInfo,hf=qn,t=eo(t),ji(t)){if("selectionStart"in t)var e={start:t.selectionStart,end:t.selectionEnd};else t:{e=(e=t.ownerDocument)&&e.defaultView||window;var u=e.getSelection&&e.getSelection();if(u&&u.rangeCount!==0){e=u.anchorNode;var a=u.anchorOffset,n=u.focusNode;u=u.focusOffset;try{e.nodeType,n.nodeType}catch{e=null;break t}var i=0,c=-1,f=-1,d=0,r=0,m=t,y=null;l:for(;;){for(var v;m!==e||a!==0&&m.nodeType!==3||(c=i+a),m!==n||u!==0&&m.nodeType!==3||(f=i+u),m.nodeType===3&&(i+=m.nodeValue.length),(v=m.firstChild)!==null;)y=m,m=v;for(;;){if(m===t)break l;if(y===e&&++d===a&&(c=i),y===n&&++r===u&&(f=i),(v=m.nextSibling)!==null)break;m=y,y=m.parentNode}m=v}e=c===-1||f===-1?null:{start:c,end:f}}else e=null}e=e||{start:0,end:0}}else e=null;for(rf={focusedElem:t,selectionRange:e},qn=!1,rt=l;rt!==null;)if(l=rt,t=l.child,(l.subtreeFlags&1028)!==0&&t!==null)t.return=l,rt=t;else for(;rt!==null;){switch(l=rt,n=l.alternate,t=l.flags,l.tag){case 0:if(t&4&&(t=l.updateQueue,t=t!==null?t.events:null,t!==null))for(e=0;e title"))),Et(n,u,e),n[mt]=t,ht(n),u=n;break t;case"link":var i=ky("link","href",a).get(u+(e.href||""));if(i){for(var c=0;cH&&(i=H,H=p,p=i);var o=to(c,p),s=to(c,H);if(o&&s&&(v.rangeCount!==1||v.anchorNode!==o.node||v.anchorOffset!==o.offset||v.focusNode!==s.node||v.focusOffset!==s.offset)){var h=m.createRange();h.setStart(o.node,o.offset),v.removeAllRanges(),p>H?(v.addRange(h),v.extend(s.node,s.offset)):(h.setEnd(s.node,s.offset),v.addRange(h))}}}}for(m=[],v=c;v=v.parentNode;)v.nodeType===1&&m.push({element:v,left:v.scrollLeft,top:v.scrollTop});for(typeof c.focus=="function"&&c.focus(),c=0;ce?32:e,O.T=null,e=Ic,Ic=null;var n=wl,i=Ol;if(dt=0,su=wl=null,Ol=0,X&6)throw Error(g(331));var c=X;if(X|=4,ey(n.current),Pd(n,n.current,i,e),X=c,ca(0,!1),Nt&&typeof Nt.onPostCommitFiberRoot=="function")try{Nt.onPostCommitFiberRoot(Ou,n)}catch{}return!0}finally{G.p=a,O.T=u,Ey(t,l)}}function Ty(t,l,e){l=Kt(e,l),l=Rc(t.stateNode,l,2),t=Xl(t,l,2),t!==null&&(Mu(t,2),cl(t))}function Z(t,l,e){if(t.tag===3)Ty(t,t,e);else for(;l!==null;){if(l.tag===3){Ty(l,t,e);break}else if(l.tag===1){var u=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Jl===null||!Jl.has(u))){t=Kt(e,t),e=pd(2),u=Xl(l,e,2),u!==null&&(Ad(e,u,l,t),Mu(u,2),cl(u));break}}l=l.return}}function ef(t,l,e){var u=t.pingCache;if(u===null){u=t.pingCache=new Gr;var a=new Set;u.set(l,a)}else a=u.get(l),a===void 0&&(a=new Set,u.set(l,a));a.has(e)||($c=!0,a.add(e),t=Lr.bind(null,t,l,e),l.then(t,t))}function Lr(t,l,e){var u=t.pingCache;u!==null&&u.delete(l),t.pingedLanes|=t.suspendedLanes&e,t.warmLanes&=~e,J===t&&(q&e)===e&&(lt===4||lt===3&&(q&62914560)===q&&300>Rt()-gn?!(X&2)&&ou(t,0):Wc|=e,fu===q&&(fu=0)),cl(t)}function py(t,l){l===0&&(l=ms()),t=ye(t,l),t!==null&&(Mu(t,l),cl(t))}function Kr(t){var l=t.memoizedState,e=0;l!==null&&(e=l.retryLane),py(t,e)}function Jr(t,l){var e=0;switch(t.tag){case 31:case 13:var u=t.stateNode,a=t.memoizedState;a!==null&&(e=a.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(g(314))}u!==null&&u.delete(l),py(t,e)}function wr(t,l){return vi(t,l)}var On=null,yu=null,uf=!1,_n=!1,af=!1,Wl=0;function cl(t){t!==yu&&t.next===null&&(yu===null?On=yu=t:yu=yu.next=t),_n=!0,uf||(uf=!0,Wr())}function ca(t,l){if(!af&&_n){af=!0;do for(var e=!1,u=On;u!==null;){if(t!==0){var a=u.pendingLanes;if(a===0)var n=0;else{var i=u.suspendedLanes,c=u.pingedLanes;n=(1<<31-Ct(42|t)+1)-1,n&=a&~(i&~c),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(e=!0,My(u,n))}else n=q,n=Ua(u,u===J?n:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),!(n&3)||_u(u,n)||(e=!0,My(u,n));u=u.next}while(e);af=!1}}function $r(){Ay()}function Ay(){_n=uf=!1;var t=0;Wl!==0&&nv()&&(t=Wl);for(var l=Rt(),e=null,u=On;u!==null;){var a=u.next,n=Oy(u,l);n===0?(u.next=null,e===null?On=a:e.next=a,a===null&&(yu=e)):(e=u,(t!==0||n&3)&&(_n=!0)),u=a}dt!==0&&dt!==5||ca(t),Wl!==0&&(Wl=0)}function Oy(t,l){for(var e=t.suspendedLanes,u=t.pingedLanes,a=t.expirationTimes,n=t.pendingLanes&-62914561;0c)break;var r=f.transferSize,m=f.initiatorType;r&&Yy(m)&&(f=f.responseEnd,i+=r*(f"u"?null:document;function wy(t,l,e){var u=hu;if(u&&typeof l=="string"&&l){var a=xt(l);a='link[rel="'+t+'"][href="'+a+'"]',typeof e=="string"&&(a+='[crossorigin="'+e+'"]'),Jy.has(a)||(Jy.add(a),t={rel:t,crossOrigin:e,href:l},u.querySelector(a)===null&&(l=u.createElement("link"),Et(l,"link",t),ht(l),u.head.appendChild(l)))}}function rv(t){_l.D(t),wy("dns-prefetch",t,null)}function vv(t,l){_l.C(t,l),wy("preconnect",t,l)}function mv(t,l,e){_l.L(t,l,e);var u=hu;if(u&&t&&l){var a='link[rel="preload"][as="'+xt(l)+'"]';l==="image"&&e&&e.imageSrcSet?(a+='[imagesrcset="'+xt(e.imageSrcSet)+'"]',typeof e.imageSizes=="string"&&(a+='[imagesizes="'+xt(e.imageSizes)+'"]')):a+='[href="'+xt(t)+'"]';var n=a;switch(l){case"style":n=ru(t);break;case"script":n=vu(t)}kt.has(n)||(t=F({rel:"preload",href:l==="image"&&e&&e.imageSrcSet?void 0:t,as:l},e),kt.set(n,t),u.querySelector(a)!==null||l==="style"&&u.querySelector(da(n))||l==="script"&&u.querySelector(ya(n))||(l=u.createElement("link"),Et(l,"link",t),ht(l),u.head.appendChild(l)))}}function Sv(t,l){_l.m(t,l);var e=hu;if(e&&t){var u=l&&typeof l.as=="string"?l.as:"script",a='link[rel="modulepreload"][as="'+xt(u)+'"][href="'+xt(t)+'"]',n=a;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=vu(t)}if(!kt.has(n)&&(t=F({rel:"modulepreload",href:t},l),kt.set(n,t),e.querySelector(a)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(e.querySelector(ya(n)))return}u=e.createElement("link"),Et(u,"link",t),ht(u),e.head.appendChild(u)}}}function gv(t,l,e){_l.S(t,l,e);var u=hu;if(u&&t){var a=qe(u).hoistableStyles,n=ru(t);l=l||"default";var i=a.get(n);if(!i){var c={loading:0,preload:null};if(i=u.querySelector(da(n)))c.loading=5;else{t=F({rel:"stylesheet",href:t,"data-precedence":l},e),(e=kt.get(n))&&zf(t,e);var f=i=u.createElement("link");ht(f),Et(f,"link",t),f._p=new Promise(function(d,r){f.onload=d,f.onerror=r}),f.addEventListener("load",function(){c.loading|=1}),f.addEventListener("error",function(){c.loading|=2}),c.loading|=4,Rn(i,l,u)}i={type:"stylesheet",instance:i,count:1,state:c},a.set(n,i)}}}function bv(t,l){_l.X(t,l);var e=hu;if(e&&t){var u=qe(e).hoistableScripts,a=vu(t),n=u.get(a);n||(n=e.querySelector(ya(a)),n||(t=F({src:t,async:!0},l),(l=kt.get(a))&&Tf(t,l),n=e.createElement("script"),ht(n),Et(n,"link",t),e.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},u.set(a,n))}}function Ev(t,l){_l.M(t,l);var e=hu;if(e&&t){var u=qe(e).hoistableScripts,a=vu(t),n=u.get(a);n||(n=e.querySelector(ya(a)),n||(t=F({src:t,async:!0,type:"module"},l),(l=kt.get(a))&&Tf(t,l),n=e.createElement("script"),ht(n),Et(n,"link",t),e.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},u.set(a,n))}}function $y(t,l,e,u){var a=(a=Hl.current)?Hn(a):null;if(!a)throw Error(g(446));switch(t){case"meta":case"title":return null;case"style":return typeof e.precedence=="string"&&typeof e.href=="string"?(l=ru(e.href),e=qe(a).hoistableStyles,u=e.get(l),u||(u={type:"style",instance:null,count:0,state:null},e.set(l,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(e.rel==="stylesheet"&&typeof e.href=="string"&&typeof e.precedence=="string"){t=ru(e.href);var n=qe(a).hoistableStyles,i=n.get(t);if(i||(a=a.ownerDocument||a,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(t,i),(n=a.querySelector(da(t)))&&!n._p&&(i.instance=n,i.state.loading=5),kt.has(t)||(e={rel:"preload",as:"style",href:e.href,crossOrigin:e.crossOrigin,integrity:e.integrity,media:e.media,hrefLang:e.hrefLang,referrerPolicy:e.referrerPolicy},kt.set(t,e),n||zv(a,t,e,i.state))),l&&u===null)throw Error(g(528,""));return i}if(l&&u!==null)throw Error(g(529,""));return null;case"script":return l=e.async,e=e.src,typeof e=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=vu(e),e=qe(a).hoistableScripts,u=e.get(l),u||(u={type:"script",instance:null,count:0,state:null},e.set(l,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(g(444,t))}}function ru(t){return'href="'+xt(t)+'"'}function da(t){return'link[rel="stylesheet"]['+t+"]"}function Wy(t){return F({},t,{"data-precedence":t.precedence,precedence:null})}function zv(t,l,e,u){t.querySelector('link[rel="preload"][as="style"]['+l+"]")?u.loading=1:(l=t.createElement("link"),u.preload=l,l.addEventListener("load",function(){return u.loading|=1}),l.addEventListener("error",function(){return u.loading|=2}),Et(l,"link",e),ht(l),t.head.appendChild(l))}function vu(t){return'[src="'+xt(t)+'"]'}function ya(t){return"script[async]"+t}function Fy(t,l,e){if(l.count++,l.instance===null)switch(l.type){case"style":var u=t.querySelector('style[data-href~="'+xt(e.href)+'"]');if(u)return l.instance=u,ht(u),u;var a=F({},e,{"data-href":e.href,"data-precedence":e.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),ht(u),Et(u,"style",a),Rn(u,e.precedence,t),l.instance=u;case"stylesheet":a=ru(e.href);var n=t.querySelector(da(a));if(n)return l.state.loading|=4,l.instance=n,ht(n),n;u=Wy(e),(a=kt.get(a))&&zf(u,a),n=(t.ownerDocument||t).createElement("link"),ht(n);var i=n;return i._p=new Promise(function(c,f){i.onload=c,i.onerror=f}),Et(n,"link",u),l.state.loading|=4,Rn(n,e.precedence,t),l.instance=n;case"script":return n=vu(e.src),(a=t.querySelector(ya(n)))?(l.instance=a,ht(a),a):(u=e,(a=kt.get(n))&&(u=F({},e),Tf(u,a)),t=t.ownerDocument||t,a=t.createElement("script"),ht(a),Et(a,"link",u),t.head.appendChild(a),l.instance=a);case"void":return null;default:throw Error(g(443,l.type))}else l.type==="stylesheet"&&!(l.state.loading&4)&&(u=l.instance,l.state.loading|=4,Rn(u,e.precedence,t));return l.instance}function Rn(t,l,e){for(var u=e.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=u.length?u[u.length-1]:null,n=a,i=0;i title"):null)}function Tv(t,l,e){if(e===1||l.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return t=l.disabled,typeof l.precedence=="string"&&t==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function Py(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}function pv(t,l,e,u){if(e.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&!(e.state.loading&4)){if(e.instance===null){var a=ru(u.href),n=l.querySelector(da(a));if(n){l=n._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(t.count++,t=Cn.bind(t),l.then(t,t)),e.state.loading|=4,e.instance=n,ht(n);return}n=l.ownerDocument||l,u=Wy(u),(a=kt.get(a))&&zf(u,a),n=n.createElement("link"),ht(n);var i=n;i._p=new Promise(function(c,f){i.onload=c,i.onerror=f}),Et(n,"link",u),e.instance=n}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(e,l),(l=e.state.preload)&&!(e.state.loading&3)&&(t.count++,e=Cn.bind(t),l.addEventListener("load",e),l.addEventListener("error",e))}}var pf=0;function Av(t,l){return t.stylesheets&&t.count===0&&Yn(t,t.stylesheets),0pf?50:800)+l);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(a)}}:null}function Cn(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yn(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Bn=null;function Yn(t,l){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Bn=new Map,l.forEach(Ov,t),Bn=null,Cn.call(t))}function Ov(t,l){if(!(l.state.loading&4)){var e=Bn.get(t);if(e)var u=e.get(null);else{e=new Map,Bn.set(t,e);for(var a=t.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hh)}catch(t){console.error(t)}}hh(),Ff.exports=ba;var Hf=Ff.exports;const Cv=ue({__proto__:null,default:Vf(Hf)},[Hf]);var rh={exports:{}},xn={};/** +`+u.stack}}var ri=Object.prototype.hasOwnProperty,vi=ot.unstable_scheduleCallback,mi=ot.unstable_cancelCallback,y0=ot.unstable_shouldYield,h0=ot.unstable_requestPaint,Rt=ot.unstable_now,r0=ot.unstable_getCurrentPriorityLevel,hs=ot.unstable_ImmediatePriority,rs=ot.unstable_UserBlockingPriority,Oa=ot.unstable_NormalPriority,v0=ot.unstable_LowPriority,vs=ot.unstable_IdlePriority,m0=ot.log,S0=ot.unstable_setDisableYieldValue,Ou=null,Nt=null;function Rl(t){if(typeof m0=="function"&&S0(t),Nt&&typeof Nt.setStrictMode=="function")try{Nt.setStrictMode(Ou,t)}catch{}}var Ct=Math.clz32?Math.clz32:E0,g0=Math.log,b0=Math.LN2;function E0(t){return t>>>=0,t===0?32:31-(g0(t)/b0|0)|0}var _a=256,Ma=262144,Da=4194304;function ce(t){var l=t&42;if(l!==0)return l;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ua(t,l,e){var u=t.pendingLanes;if(u===0)return 0;var a=0,n=t.suspendedLanes,i=t.pingedLanes;t=t.warmLanes;var c=u&134217727;return c!==0?(u=c&~n,u!==0?a=ce(u):(i&=c,i!==0?a=ce(i):e||(e=c&~t,e!==0&&(a=ce(e))))):(c=u&~n,c!==0?a=ce(c):i!==0?a=ce(i):e||(e=u&~t,e!==0&&(a=ce(e)))),a===0?0:l!==0&&l!==a&&!(l&n)&&(n=a&-a,e=l&-l,n>=e||n===32&&(e&4194048)!==0)?l:a}function _u(t,l){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&l)===0}function z0(t,l){switch(t){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ms(){var t=Da;return Da<<=1,!(Da&62914560)&&(Da=4194304),t}function Si(t){for(var l=[],e=0;31>e;e++)l.push(t);return l}function Mu(t,l){t.pendingLanes|=l,l!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function p0(t,l,e,u,a,n){var i=t.pendingLanes;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=e,t.entangledLanes&=e,t.errorRecoveryDisabledLanes&=e,t.shellSuspendCounter=0;var c=t.entanglements,f=t.expirationTimes,d=t.hiddenUpdates;for(e=i&~e;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var D0=/[\n"\\]/g;function xt(t){return t.replace(D0,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Ti(t,l,e,u,a,n,i,c){t.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?t.type=i:t.removeAttribute("type"),l!=null?i==="number"?(l===0&&t.value===""||t.value!=l)&&(t.value=""+Zt(l)):t.value!==""+Zt(l)&&(t.value=""+Zt(l)):i!=="submit"&&i!=="reset"||t.removeAttribute("value"),l!=null?Ai(t,i,Zt(l)):e!=null?Ai(t,i,Zt(e)):u!=null&&t.removeAttribute("value"),a==null&&n!=null&&(t.defaultChecked=!!n),a!=null&&(t.checked=a&&typeof a!="function"&&typeof a!="symbol"),c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?t.name=""+Zt(c):t.removeAttribute("name")}function Us(t,l,e,u,a,n,i,c){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(t.type=n),l!=null||e!=null){if(!(n!=="submit"&&n!=="reset"||l!=null)){pi(t);return}e=e!=null?""+Zt(e):"",l=l!=null?""+Zt(l):e,c||l===t.value||(t.value=l),t.defaultValue=l}u=u??a,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=c?t.checked:!!u,t.defaultChecked=!!u,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.name=i),pi(t)}function Ai(t,l,e){l==="number"&&Na(t.ownerDocument)===t||t.defaultValue===""+e||(t.defaultValue=""+e)}function je(t,l,e,u){if(t=t.options,l){l={};for(var a=0;a"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ui=!1;if(dl)try{var Ru={};Object.defineProperty(Ru,"passive",{get:function(){Ui=!0}}),window.addEventListener("test",Ru,Ru),window.removeEventListener("test",Ru,Ru)}catch{Ui=!1}var Cl=null,Hi=null,Ba=null;function qs(){if(Ba)return Ba;var t,l=Hi,e=l.length,u,a="value"in Cl?Cl.value:Cl.textContent,n=a.length;for(t=0;t=Bu),Zs=" ",xs=!1;function Ls(t,l){switch(t){case"keyup":return er.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ks(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ze=!1;function ar(t,l){switch(t){case"compositionend":return Ks(l);case"keypress":return l.which!==32?null:(xs=!0,Zs);case"textInput":return t=l.data,t===Zs&&xs?null:t;default:return null}}function nr(t,l){if(Ze)return t==="compositionend"||!Yi&&Ls(t,l)?(t=qs(),Ba=Hi=Cl=null,Ze=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:e,offset:l-t};t=u}t:{for(;e;){if(e.nextSibling){e=e.nextSibling;break t}e=e.parentNode}e=void 0}e=Ps(e)}}function lo(t,l){return t&&l?t===l?!0:t&&t.nodeType===3?!1:l&&l.nodeType===3?lo(t,l.parentNode):"contains"in t?t.contains(l):t.compareDocumentPosition?!!(t.compareDocumentPosition(l)&16):!1:!1}function eo(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var l=Na(t.document);l instanceof t.HTMLIFrameElement;){try{var e=typeof l.contentWindow.location.href=="string"}catch{e=!1}if(e)t=l.contentWindow;else break;l=Na(t.document)}return l}function ji(t){var l=t&&t.nodeName&&t.nodeName.toLowerCase();return l&&(l==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||l==="textarea"||t.contentEditable==="true")}var hr=dl&&"documentMode"in document&&11>=document.documentMode,xe=null,Gi=null,ju=null,Xi=!1;function uo(t,l,e){var u=e.window===e?e.document:e.nodeType===9?e:e.ownerDocument;Xi||xe==null||xe!==Na(u)||(u=xe,"selectionStart"in u&&ji(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),ju&&Vu(ju,u)||(ju=u,u=Dn(Gi,"onSelect"),0>=i,a-=i,al=1<<32-Ct(l)+a|e<A?(M=z,z=null):M=z.sibling;var R=y(o,z,h[A],S);if(R===null){z===null&&(z=M);break}t&&z&&R.alternate===null&&l(o,z),s=n(R,s,A),_===null?E=R:_.sibling=R,_=R,z=M}if(A===h.length)return e(o,z),j&&hl(o,A),E;if(z===null){for(;AA?(M=z,z=null):M=z.sibling;var It=y(o,z,R.value,S);if(It===null){z===null&&(z=M);break}t&&z&&It.alternate===null&&l(o,z),s=n(It,s,A),_===null?E=It:_.sibling=It,_=It,z=M}if(R.done)return e(o,z),j&&hl(o,A),E;if(z===null){for(;!R.done;A++,R=h.next())R=m(o,R.value,S),R!==null&&(s=n(R,s,A),_===null?E=R:_.sibling=R,_=R);return j&&hl(o,A),E}for(z=u(z);!R.done;A++,R=h.next())R=v(z,o,A,R.value,S),R!==null&&(t&&R.alternate!==null&&z.delete(R.key===null?A:R.key),s=n(R,s,A),_===null?E=R:_.sibling=R,_=R);return t&&z.forEach(function(ee){return l(o,ee)}),j&&hl(o,A),E}function H(o,s,h,S){if(typeof h=="object"&&h!==null&&h.type===He&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case za:t:{for(var E=h.key;s!==null;){if(s.key===E){if(E=h.type,E===He){if(s.tag===7){e(o,s.sibling),S=a(s,h.props.children),S.return=o,o=S;break t}}else if(s.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ul&&ge(E)===s.type){e(o,s.sibling),S=a(s,h.props),Lu(S,h),S.return=o,o=S;break t}e(o,s);break}else l(o,s);s=s.sibling}h.type===He?(S=he(h.props.children,o.mode,S,h.key),S.return=o,o=S):(S=La(h.type,h.key,h.props,null,o.mode,S),Lu(S,h),S.return=o,o=S)}return i(o);case zu:t:{for(E=h.key;s!==null;){if(s.key===E)if(s.tag===4&&s.stateNode.containerInfo===h.containerInfo&&s.stateNode.implementation===h.implementation){e(o,s.sibling),S=a(s,h.children||[]),S.return=o,o=S;break t}else{e(o,s);break}else l(o,s);s=s.sibling}S=wi(h,o.mode,S),S.return=o,o=S}return i(o);case Ul:return h=ge(h),H(o,s,h,S)}if(Tu(h))return b(o,s,h,S);if(pu(h)){if(E=pu(h),typeof E!="function")throw Error(g(150));return h=E.call(h),T(o,s,h,S)}if(typeof h.then=="function")return H(o,s,ka(h),S);if(h.$$typeof===fl)return H(o,s,wa(o,h),S);Ia(o,h)}return typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint"?(h=""+h,s!==null&&s.tag===6?(e(o,s.sibling),S=a(s,h),S.return=o,o=S):(e(o,s),S=Ji(h,o.mode,S),S.return=o,o=S),i(o)):e(o,s)}return function(o,s,h,S){try{xu=0;var E=H(o,s,h,S);return tu=null,E}catch(z){if(z===Pe||z===Wa)throw z;var _=Yt(29,z,null,o.mode);return _.lanes=S,_.return=o,_}finally{}}}var Ee=Mo(!0),Do=Mo(!1),jl=!1;function nc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ic(t,l){t=t.updateQueue,l.updateQueue===t&&(l.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Gl(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Xl(t,l,e){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,X&2){var a=u.pending;return a===null?l.next=l:(l.next=a.next,a.next=l),u.pending=l,l=xa(t),oo(t,null,e),l}return Za(t,u,l,e),xa(t)}function Ku(t,l,e){if(l=l.updateQueue,l!==null&&(l=l.shared,(e&4194048)!==0)){var u=l.lanes;u&=t.pendingLanes,e|=u,l.lanes=e,gs(t,e)}}function cc(t,l){var e=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,e===u)){var a=null,n=null;if(e=e.firstBaseUpdate,e!==null){do{var i={lane:e.lane,tag:e.tag,payload:e.payload,callback:null,next:null};n===null?a=n=i:n=n.next=i,e=e.next}while(e!==null);n===null?a=n=l:n=n.next=l}else a=n=l;e={baseState:u.baseState,firstBaseUpdate:a,lastBaseUpdate:n,shared:u.shared,callbacks:u.callbacks},t.updateQueue=e;return}t=e.lastBaseUpdate,t===null?e.firstBaseUpdate=l:t.next=l,e.lastBaseUpdate=l}var fc=!1;function Ju(){if(fc){var t=Ie;if(t!==null)throw t}}function wu(t,l,e,u){fc=!1;var a=t.updateQueue;jl=!1;var n=a.firstBaseUpdate,i=a.lastBaseUpdate,c=a.shared.pending;if(c!==null){a.shared.pending=null;var f=c,d=f.next;f.next=null,i===null?n=d:i.next=d,i=f;var r=t.alternate;r!==null&&(r=r.updateQueue,c=r.lastBaseUpdate,c!==i&&(c===null?r.firstBaseUpdate=d:c.next=d,r.lastBaseUpdate=f))}if(n!==null){var m=a.baseState;i=0,r=d=f=null,c=n;do{var y=c.lane&-536870913,v=y!==c.lane;if(v?(q&y)===y:(u&y)===y){y!==0&&y===ke&&(fc=!0),r!==null&&(r=r.next={lane:0,tag:c.tag,payload:c.payload,callback:null,next:null});t:{var b=t,T=c;y=l;var H=e;switch(T.tag){case 1:if(b=T.payload,typeof b=="function"){m=b.call(H,m,y);break t}m=b;break t;case 3:b.flags=b.flags&-65537|128;case 0:if(b=T.payload,y=typeof b=="function"?b.call(H,m,y):b,y==null)break t;m=F({},m,y);break t;case 2:jl=!0}}y=c.callback,y!==null&&(t.flags|=64,v&&(t.flags|=8192),v=a.callbacks,v===null?a.callbacks=[y]:v.push(y))}else v={lane:y,tag:c.tag,payload:c.payload,callback:c.callback,next:null},r===null?(d=r=v,f=m):r=r.next=v,i|=y;if(c=c.next,c===null){if(c=a.shared.pending,c===null)break;v=c,c=v.next,v.next=null,a.lastBaseUpdate=v,a.shared.pending=null}}while(!0);r===null&&(f=m),a.baseState=f,a.firstBaseUpdate=d,a.lastBaseUpdate=r,n===null&&(a.shared.lanes=0),Kl|=i,t.lanes=i,t.memoizedState=m}}function Uo(t,l){if(typeof t!="function")throw Error(g(191,t));t.call(l)}function Ho(t,l){var e=t.callbacks;if(e!==null)for(t.callbacks=null,t=0;tn?n:8;var i=O.T,c={};O.T=c,Mc(t,!1,l,e);try{var f=a(),d=O.S;if(d!==null&&d(c,f),f!==null&&typeof f=="object"&&typeof f.then=="function"){var r=pr(f,u);Fu(t,l,r,Xt(t))}else Fu(t,l,u,Xt(t))}catch(m){Fu(t,l,{then:function(){},status:"rejected",reason:m},Xt())}finally{G.p=n,i!==null&&c.types!==null&&(i.types=c.types),O.T=i}}function Dr(){}function Oc(t,l,e,u){if(t.tag!==5)throw Error(g(476));var a=fd(t).queue;cd(t,a,l,ne,e===null?Dr:function(){return sd(t),e(u)})}function fd(t){var l=t.memoizedState;if(l!==null)return l;l={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sl,lastRenderedState:ne},next:null};var e={};return l.next={memoizedState:e,baseState:e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sl,lastRenderedState:e},next:null},t.memoizedState=l,t=t.alternate,t!==null&&(t.memoizedState=l),l}function sd(t){var l=fd(t);l.next===null&&(l=t.alternate.memoizedState),Fu(t,l.next.queue,{},Xt())}function _c(){return gt(ha)}function od(){return ut().memoizedState}function dd(){return ut().memoizedState}function Ur(t){for(var l=t.return;l!==null;){switch(l.tag){case 24:case 3:var e=Xt();t=Gl(e);var u=Xl(l,t,e);u!==null&&(Ht(u,l,e),Ku(u,l,e)),l={cache:lc()},t.payload=l;return}l=l.return}}function Hr(t,l,e){var u=Xt();e={lane:u,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null},sn(t)?hd(l,e):(e=Li(t,l,e,u),e!==null&&(Ht(e,t,u),rd(e,l,u)))}function yd(t,l,e){var u=Xt();Fu(t,l,e,u)}function Fu(t,l,e,u){var a={lane:u,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null};if(sn(t))hd(l,a);else{var n=t.alternate;if(t.lanes===0&&(n===null||n.lanes===0)&&(n=l.lastRenderedReducer,n!==null))try{var i=l.lastRenderedState,c=n(i,e);if(a.hasEagerState=!0,a.eagerState=c,Bt(c,i))return Za(t,l,a,0),J===null&&Qa(),!1}catch{}finally{}if(e=Li(t,l,a,u),e!==null)return Ht(e,t,u),rd(e,l,u),!0}return!1}function Mc(t,l,e,u){if(u={lane:2,revertLane:nf(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},sn(t)){if(l)throw Error(g(479))}else l=Li(t,e,u,2),l!==null&&Ht(l,t,2)}function sn(t){var l=t.alternate;return t===U||l!==null&&l===U}function hd(t,l){eu=ln=!0;var e=t.pending;e===null?l.next=l:(l.next=e.next,e.next=l),t.pending=l}function rd(t,l,e){if(e&4194048){var u=l.lanes;u&=t.pendingLanes,e|=u,l.lanes=e,gs(t,e)}}var ku={readContext:gt,use:an,useCallback:tt,useContext:tt,useEffect:tt,useImperativeHandle:tt,useLayoutEffect:tt,useInsertionEffect:tt,useMemo:tt,useReducer:tt,useRef:tt,useState:tt,useDebugValue:tt,useDeferredValue:tt,useTransition:tt,useSyncExternalStore:tt,useId:tt,useHostTransitionStatus:tt,useFormState:tt,useActionState:tt,useOptimistic:tt,useMemoCache:tt,useCacheRefresh:tt};ku.useEffectEvent=tt;var vd={readContext:gt,use:an,useCallback:function(t,l){return Tt().memoizedState=[t,l===void 0?null:l],t},useContext:gt,useEffect:Io,useImperativeHandle:function(t,l,e){e=e!=null?e.concat([t]):null,cn(4194308,4,ed.bind(null,l,t),e)},useLayoutEffect:function(t,l){return cn(4194308,4,t,l)},useInsertionEffect:function(t,l){cn(4,2,t,l)},useMemo:function(t,l){var e=Tt();l=l===void 0?null:l;var u=t();if(ze){Rl(!0);try{t()}finally{Rl(!1)}}return e.memoizedState=[u,l],u},useReducer:function(t,l,e){var u=Tt();if(e!==void 0){var a=e(l);if(ze){Rl(!0);try{e(l)}finally{Rl(!1)}}}else a=l;return u.memoizedState=u.baseState=a,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:a},u.queue=t,t=t.dispatch=Hr.bind(null,U,t),[u.memoizedState,t]},useRef:function(t){var l=Tt();return t={current:t},l.memoizedState=t},useState:function(t){t=Ec(t);var l=t.queue,e=yd.bind(null,U,l);return l.dispatch=e,[t.memoizedState,e]},useDebugValue:Tc,useDeferredValue:function(t,l){var e=Tt();return Ac(e,t,l)},useTransition:function(){var t=Ec(!1);return t=cd.bind(null,U,t.queue,!0,!1),Tt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,l,e){var u=U,a=Tt();if(j){if(e===void 0)throw Error(g(407));e=e()}else{if(e=l(),J===null)throw Error(g(349));q&127||qo(u,l,e)}a.memoizedState=e;var n={value:e,getSnapshot:l};return a.queue=n,Io(jo.bind(null,u,n,t),[t]),u.flags|=2048,au(9,{destroy:void 0},Vo.bind(null,u,n,e,l),null),e},useId:function(){var t=Tt(),l=J.identifierPrefix;if(j){var e=nl,u=al;e=(u&~(1<<32-Ct(u)-1)).toString(32)+e,l="_"+l+"R_"+e,e=en++,0<\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof u.is=="string"?i.createElement("select",{is:u.is}):i.createElement("select"),u.multiple?n.multiple=!0:u.size&&(n.size=u.size);break;default:n=typeof u.is=="string"?i.createElement(a,{is:u.is}):i.createElement(a)}}n[mt]=l,n[At]=u;t:for(i=l.child;i!==null;){if(i.tag===5||i.tag===6)n.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break t;for(;i.sibling===null;){if(i.return===null||i.return===l)break t;i=i.return}i.sibling.return=i.return,i=i.sibling}l.stateNode=n;t:switch(Et(n,a,u),a){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break t;case"img":u=!0;break t;default:u=!1}u&&bl(l)}}return I(l),Qc(l,l.type,t===null?null:t.memoizedProps,l.pendingProps,e),null;case 6:if(t&&l.stateNode!=null)t.memoizedProps!==u&&bl(l);else{if(typeof u!="string"&&l.stateNode===null)throw Error(g(166));if(t=Hl.current,We(l)){if(t=l.stateNode,e=l.memoizedProps,u=null,a=St,a!==null)switch(a.tag){case 27:case 5:u=a.memoizedProps}t[mt]=l,t=!!(t.nodeValue===e||u!==null&&u.suppressHydrationWarning===!0||By(t.nodeValue,e)),t||ql(l,!0)}else t=Un(t).createTextNode(u),t[mt]=l,l.stateNode=t}return I(l),null;case 31:if(e=l.memoizedState,t===null||t.memoizedState!==null){if(u=We(l),e!==null){if(t===null){if(!u)throw Error(g(318));if(t=l.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(g(557));t[mt]=l}else re(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;I(l),t=!1}else e=ki(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=e),t=!0;if(!t)return l.flags&256?(Vt(l),l):(Vt(l),null);if(l.flags&128)throw Error(g(558))}return I(l),null;case 13:if(u=l.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(a=We(l),u!==null&&u.dehydrated!==null){if(t===null){if(!a)throw Error(g(318));if(a=l.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(g(317));a[mt]=l}else re(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;I(l),a=!1}else a=ki(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),a=!0;if(!a)return l.flags&256?(Vt(l),l):(Vt(l),null)}return Vt(l),l.flags&128?(l.lanes=e,l):(e=u!==null,t=t!==null&&t.memoizedState!==null,e&&(u=l.child,a=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(a=u.alternate.memoizedState.cachePool.pool),n=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(n=u.memoizedState.cachePool.pool),n!==a&&(u.flags|=2048)),e!==t&&e&&(l.child.flags|=8192),rn(l,l.updateQueue),I(l),null);case 4:return Ne(),t===null&&of(l.stateNode.containerInfo),I(l),null;case 10:return vl(l.type),I(l),null;case 19:if(yt(et),u=l.memoizedState,u===null)return I(l),null;if(a=(l.flags&128)!==0,n=u.rendering,n===null)if(a)Pu(u,!1);else{if(lt!==0||t!==null&&t.flags&128)for(t=l.child;t!==null;){if(n=tn(t),n!==null){for(l.flags|=128,Pu(u,!1),t=n.updateQueue,l.updateQueue=t,rn(l,t),l.subtreeFlags=0,t=e,e=l.child;e!==null;)yo(e,t),e=e.sibling;return w(et,et.current&1|2),j&&hl(l,u.treeForkCount),l.child}t=t.sibling}u.tail!==null&&Rt()>bn&&(l.flags|=128,a=!0,Pu(u,!1),l.lanes=4194304)}else{if(!a)if(t=tn(n),t!==null){if(l.flags|=128,a=!0,t=t.updateQueue,l.updateQueue=t,rn(l,t),Pu(u,!0),u.tail===null&&u.tailMode==="hidden"&&!n.alternate&&!j)return I(l),null}else 2*Rt()-u.renderingStartTime>bn&&e!==536870912&&(l.flags|=128,a=!0,Pu(u,!1),l.lanes=4194304);u.isBackwards?(n.sibling=l.child,l.child=n):(t=u.last,t!==null?t.sibling=n:l.child=n,u.last=n)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=Rt(),t.sibling=null,e=et.current,w(et,a?e&1|2:e&1),j&&hl(l,u.treeForkCount),t):(I(l),null);case 22:case 23:return Vt(l),oc(),u=l.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(l.flags|=8192):u&&(l.flags|=8192),u?e&536870912&&!(l.flags&128)&&(I(l),l.subtreeFlags&6&&(l.flags|=8192)):I(l),e=l.updateQueue,e!==null&&rn(l,e.retryQueue),e=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==e&&(l.flags|=2048),t!==null&&yt(Se),null;case 24:return e=null,t!==null&&(e=t.memoizedState.cache),l.memoizedState.cache!==e&&(l.flags|=2048),vl(it),I(l),null;case 25:return null;case 30:return null}throw Error(g(156,l.tag))}function Yr(t,l){switch(Wi(l),l.tag){case 1:return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 3:return vl(it),Ne(),t=l.flags,t&65536&&!(t&128)?(l.flags=t&-65537|128,l):null;case 26:case 27:case 5:return Aa(l),null;case 31:if(l.memoizedState!==null){if(Vt(l),l.alternate===null)throw Error(g(340));re()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 13:if(Vt(l),t=l.memoizedState,t!==null&&t.dehydrated!==null){if(l.alternate===null)throw Error(g(340));re()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 19:return yt(et),null;case 4:return Ne(),null;case 10:return vl(l.type),null;case 22:case 23:return Vt(l),oc(),t!==null&&yt(Se),t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 24:return vl(it),null;case 25:return null;default:return null}}function Gd(t,l){switch(Wi(l),l.tag){case 3:vl(it),Ne();break;case 26:case 27:case 5:Aa(l);break;case 4:Ne();break;case 31:l.memoizedState!==null&&Vt(l);break;case 13:Vt(l);break;case 19:yt(et);break;case 10:vl(l.type);break;case 22:case 23:Vt(l),oc(),t!==null&&yt(Se);break;case 24:vl(it)}}function ta(t,l){try{var e=l.updateQueue,u=e!==null?e.lastEffect:null;if(u!==null){var a=u.next;e=a;do{if((e.tag&t)===t){u=void 0;var n=e.create,i=e.inst;u=n(),i.destroy=u}e=e.next}while(e!==a)}}catch(c){Z(l,l.return,c)}}function xl(t,l,e){try{var u=l.updateQueue,a=u!==null?u.lastEffect:null;if(a!==null){var n=a.next;u=n;do{if((u.tag&t)===t){var i=u.inst,c=i.destroy;if(c!==void 0){i.destroy=void 0,a=l;var f=e,d=c;try{d()}catch(r){Z(a,f,r)}}}u=u.next}while(u!==n)}}catch(r){Z(l,l.return,r)}}function Xd(t){var l=t.updateQueue;if(l!==null){var e=t.stateNode;try{Ho(l,e)}catch(u){Z(t,t.return,u)}}}function Qd(t,l,e){e.props=pe(t.type,t.memoizedProps),e.state=t.memoizedState;try{e.componentWillUnmount()}catch(u){Z(t,l,u)}}function la(t,l){try{var e=t.ref;if(e!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:u=t.stateNode;break;default:u=t.stateNode}typeof e=="function"?t.refCleanup=e(u):e.current=u}}catch(a){Z(t,l,a)}}function il(t,l){var e=t.ref,u=t.refCleanup;if(e!==null)if(typeof u=="function")try{u()}catch(a){Z(t,l,a)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof e=="function")try{e(null)}catch(a){Z(t,l,a)}else e.current=null}function Zd(t){var l=t.type,e=t.memoizedProps,u=t.stateNode;try{t:switch(l){case"button":case"input":case"select":case"textarea":e.autoFocus&&u.focus();break t;case"img":e.src?u.src=e.src:e.srcSet&&(u.srcset=e.srcSet)}}catch(a){Z(t,t.return,a)}}function Zc(t,l,e){try{var u=t.stateNode;uv(u,t.type,e,l),u[At]=l}catch(a){Z(t,t.return,a)}}function xd(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Fl(t.type)||t.tag===4}function xc(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||xd(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Fl(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Lc(t,l,e){var u=t.tag;if(u===5||u===6)t=t.stateNode,l?(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e).insertBefore(t,l):(l=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.appendChild(t),e=e._reactRootContainer,e!=null||l.onclick!==null||(l.onclick=ol));else if(u!==4&&(u===27&&Fl(t.type)&&(e=t.stateNode,l=null),t=t.child,t!==null))for(Lc(t,l,e),t=t.sibling;t!==null;)Lc(t,l,e),t=t.sibling}function vn(t,l,e){var u=t.tag;if(u===5||u===6)t=t.stateNode,l?e.insertBefore(t,l):e.appendChild(t);else if(u!==4&&(u===27&&Fl(t.type)&&(e=t.stateNode),t=t.child,t!==null))for(vn(t,l,e),t=t.sibling;t!==null;)vn(t,l,e),t=t.sibling}function Ld(t){var l=t.stateNode,e=t.memoizedProps;try{for(var u=t.type,a=l.attributes;a.length;)l.removeAttributeNode(a[0]);Et(l,u,e),l[mt]=t,l[At]=e}catch(n){Z(t,t.return,n)}}var El=!1,st=!1,Kc=!1,Kd=typeof WeakSet=="function"?WeakSet:Set,rt=null;function qr(t,l){if(t=t.containerInfo,hf=qn,t=eo(t),ji(t)){if("selectionStart"in t)var e={start:t.selectionStart,end:t.selectionEnd};else t:{e=(e=t.ownerDocument)&&e.defaultView||window;var u=e.getSelection&&e.getSelection();if(u&&u.rangeCount!==0){e=u.anchorNode;var a=u.anchorOffset,n=u.focusNode;u=u.focusOffset;try{e.nodeType,n.nodeType}catch{e=null;break t}var i=0,c=-1,f=-1,d=0,r=0,m=t,y=null;l:for(;;){for(var v;m!==e||a!==0&&m.nodeType!==3||(c=i+a),m!==n||u!==0&&m.nodeType!==3||(f=i+u),m.nodeType===3&&(i+=m.nodeValue.length),(v=m.firstChild)!==null;)y=m,m=v;for(;;){if(m===t)break l;if(y===e&&++d===a&&(c=i),y===n&&++r===u&&(f=i),(v=m.nextSibling)!==null)break;m=y,y=m.parentNode}m=v}e=c===-1||f===-1?null:{start:c,end:f}}else e=null}e=e||{start:0,end:0}}else e=null;for(rf={focusedElem:t,selectionRange:e},qn=!1,rt=l;rt!==null;)if(l=rt,t=l.child,(l.subtreeFlags&1028)!==0&&t!==null)t.return=l,rt=t;else for(;rt!==null;){switch(l=rt,n=l.alternate,t=l.flags,l.tag){case 0:if(t&4&&(t=l.updateQueue,t=t!==null?t.events:null,t!==null))for(e=0;e title"))),Et(n,u,e),n[mt]=t,ht(n),u=n;break t;case"link":var i=ky("link","href",a).get(u+(e.href||""));if(i){for(var c=0;cH&&(i=H,H=T,T=i);var o=to(c,T),s=to(c,H);if(o&&s&&(v.rangeCount!==1||v.anchorNode!==o.node||v.anchorOffset!==o.offset||v.focusNode!==s.node||v.focusOffset!==s.offset)){var h=m.createRange();h.setStart(o.node,o.offset),v.removeAllRanges(),T>H?(v.addRange(h),v.extend(s.node,s.offset)):(h.setEnd(s.node,s.offset),v.addRange(h))}}}}for(m=[],v=c;v=v.parentNode;)v.nodeType===1&&m.push({element:v,left:v.scrollLeft,top:v.scrollTop});for(typeof c.focus=="function"&&c.focus(),c=0;ce?32:e,O.T=null,e=Ic,Ic=null;var n=wl,i=Ol;if(dt=0,su=wl=null,Ol=0,X&6)throw Error(g(331));var c=X;if(X|=4,ey(n.current),Pd(n,n.current,i,e),X=c,ca(0,!1),Nt&&typeof Nt.onPostCommitFiberRoot=="function")try{Nt.onPostCommitFiberRoot(Ou,n)}catch{}return!0}finally{G.p=a,O.T=u,Ey(t,l)}}function py(t,l,e){l=Kt(e,l),l=Rc(t.stateNode,l,2),t=Xl(t,l,2),t!==null&&(Mu(t,2),cl(t))}function Z(t,l,e){if(t.tag===3)py(t,t,e);else for(;l!==null;){if(l.tag===3){py(l,t,e);break}else if(l.tag===1){var u=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Jl===null||!Jl.has(u))){t=Kt(e,t),e=Td(2),u=Xl(l,e,2),u!==null&&(Ad(e,u,l,t),Mu(u,2),cl(u));break}}l=l.return}}function ef(t,l,e){var u=t.pingCache;if(u===null){u=t.pingCache=new Gr;var a=new Set;u.set(l,a)}else a=u.get(l),a===void 0&&(a=new Set,u.set(l,a));a.has(e)||($c=!0,a.add(e),t=Lr.bind(null,t,l,e),l.then(t,t))}function Lr(t,l,e){var u=t.pingCache;u!==null&&u.delete(l),t.pingedLanes|=t.suspendedLanes&e,t.warmLanes&=~e,J===t&&(q&e)===e&&(lt===4||lt===3&&(q&62914560)===q&&300>Rt()-gn?!(X&2)&&ou(t,0):Wc|=e,fu===q&&(fu=0)),cl(t)}function Ty(t,l){l===0&&(l=ms()),t=ye(t,l),t!==null&&(Mu(t,l),cl(t))}function Kr(t){var l=t.memoizedState,e=0;l!==null&&(e=l.retryLane),Ty(t,e)}function Jr(t,l){var e=0;switch(t.tag){case 31:case 13:var u=t.stateNode,a=t.memoizedState;a!==null&&(e=a.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(g(314))}u!==null&&u.delete(l),Ty(t,e)}function wr(t,l){return vi(t,l)}var On=null,yu=null,uf=!1,_n=!1,af=!1,Wl=0;function cl(t){t!==yu&&t.next===null&&(yu===null?On=yu=t:yu=yu.next=t),_n=!0,uf||(uf=!0,Wr())}function ca(t,l){if(!af&&_n){af=!0;do for(var e=!1,u=On;u!==null;){if(t!==0){var a=u.pendingLanes;if(a===0)var n=0;else{var i=u.suspendedLanes,c=u.pingedLanes;n=(1<<31-Ct(42|t)+1)-1,n&=a&~(i&~c),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(e=!0,My(u,n))}else n=q,n=Ua(u,u===J?n:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),!(n&3)||_u(u,n)||(e=!0,My(u,n));u=u.next}while(e);af=!1}}function $r(){Ay()}function Ay(){_n=uf=!1;var t=0;Wl!==0&&nv()&&(t=Wl);for(var l=Rt(),e=null,u=On;u!==null;){var a=u.next,n=Oy(u,l);n===0?(u.next=null,e===null?On=a:e.next=a,a===null&&(yu=e)):(e=u,(t!==0||n&3)&&(_n=!0)),u=a}dt!==0&&dt!==5||ca(t),Wl!==0&&(Wl=0)}function Oy(t,l){for(var e=t.suspendedLanes,u=t.pingedLanes,a=t.expirationTimes,n=t.pendingLanes&-62914561;0c)break;var r=f.transferSize,m=f.initiatorType;r&&Yy(m)&&(f=f.responseEnd,i+=r*(f"u"?null:document;function wy(t,l,e){var u=hu;if(u&&typeof l=="string"&&l){var a=xt(l);a='link[rel="'+t+'"][href="'+a+'"]',typeof e=="string"&&(a+='[crossorigin="'+e+'"]'),Jy.has(a)||(Jy.add(a),t={rel:t,crossOrigin:e,href:l},u.querySelector(a)===null&&(l=u.createElement("link"),Et(l,"link",t),ht(l),u.head.appendChild(l)))}}function rv(t){_l.D(t),wy("dns-prefetch",t,null)}function vv(t,l){_l.C(t,l),wy("preconnect",t,l)}function mv(t,l,e){_l.L(t,l,e);var u=hu;if(u&&t&&l){var a='link[rel="preload"][as="'+xt(l)+'"]';l==="image"&&e&&e.imageSrcSet?(a+='[imagesrcset="'+xt(e.imageSrcSet)+'"]',typeof e.imageSizes=="string"&&(a+='[imagesizes="'+xt(e.imageSizes)+'"]')):a+='[href="'+xt(t)+'"]';var n=a;switch(l){case"style":n=ru(t);break;case"script":n=vu(t)}kt.has(n)||(t=F({rel:"preload",href:l==="image"&&e&&e.imageSrcSet?void 0:t,as:l},e),kt.set(n,t),u.querySelector(a)!==null||l==="style"&&u.querySelector(da(n))||l==="script"&&u.querySelector(ya(n))||(l=u.createElement("link"),Et(l,"link",t),ht(l),u.head.appendChild(l)))}}function Sv(t,l){_l.m(t,l);var e=hu;if(e&&t){var u=l&&typeof l.as=="string"?l.as:"script",a='link[rel="modulepreload"][as="'+xt(u)+'"][href="'+xt(t)+'"]',n=a;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=vu(t)}if(!kt.has(n)&&(t=F({rel:"modulepreload",href:t},l),kt.set(n,t),e.querySelector(a)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(e.querySelector(ya(n)))return}u=e.createElement("link"),Et(u,"link",t),ht(u),e.head.appendChild(u)}}}function gv(t,l,e){_l.S(t,l,e);var u=hu;if(u&&t){var a=qe(u).hoistableStyles,n=ru(t);l=l||"default";var i=a.get(n);if(!i){var c={loading:0,preload:null};if(i=u.querySelector(da(n)))c.loading=5;else{t=F({rel:"stylesheet",href:t,"data-precedence":l},e),(e=kt.get(n))&&zf(t,e);var f=i=u.createElement("link");ht(f),Et(f,"link",t),f._p=new Promise(function(d,r){f.onload=d,f.onerror=r}),f.addEventListener("load",function(){c.loading|=1}),f.addEventListener("error",function(){c.loading|=2}),c.loading|=4,Rn(i,l,u)}i={type:"stylesheet",instance:i,count:1,state:c},a.set(n,i)}}}function bv(t,l){_l.X(t,l);var e=hu;if(e&&t){var u=qe(e).hoistableScripts,a=vu(t),n=u.get(a);n||(n=e.querySelector(ya(a)),n||(t=F({src:t,async:!0},l),(l=kt.get(a))&&pf(t,l),n=e.createElement("script"),ht(n),Et(n,"link",t),e.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},u.set(a,n))}}function Ev(t,l){_l.M(t,l);var e=hu;if(e&&t){var u=qe(e).hoistableScripts,a=vu(t),n=u.get(a);n||(n=e.querySelector(ya(a)),n||(t=F({src:t,async:!0,type:"module"},l),(l=kt.get(a))&&pf(t,l),n=e.createElement("script"),ht(n),Et(n,"link",t),e.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},u.set(a,n))}}function $y(t,l,e,u){var a=(a=Hl.current)?Hn(a):null;if(!a)throw Error(g(446));switch(t){case"meta":case"title":return null;case"style":return typeof e.precedence=="string"&&typeof e.href=="string"?(l=ru(e.href),e=qe(a).hoistableStyles,u=e.get(l),u||(u={type:"style",instance:null,count:0,state:null},e.set(l,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(e.rel==="stylesheet"&&typeof e.href=="string"&&typeof e.precedence=="string"){t=ru(e.href);var n=qe(a).hoistableStyles,i=n.get(t);if(i||(a=a.ownerDocument||a,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(t,i),(n=a.querySelector(da(t)))&&!n._p&&(i.instance=n,i.state.loading=5),kt.has(t)||(e={rel:"preload",as:"style",href:e.href,crossOrigin:e.crossOrigin,integrity:e.integrity,media:e.media,hrefLang:e.hrefLang,referrerPolicy:e.referrerPolicy},kt.set(t,e),n||zv(a,t,e,i.state))),l&&u===null)throw Error(g(528,""));return i}if(l&&u!==null)throw Error(g(529,""));return null;case"script":return l=e.async,e=e.src,typeof e=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=vu(e),e=qe(a).hoistableScripts,u=e.get(l),u||(u={type:"script",instance:null,count:0,state:null},e.set(l,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(g(444,t))}}function ru(t){return'href="'+xt(t)+'"'}function da(t){return'link[rel="stylesheet"]['+t+"]"}function Wy(t){return F({},t,{"data-precedence":t.precedence,precedence:null})}function zv(t,l,e,u){t.querySelector('link[rel="preload"][as="style"]['+l+"]")?u.loading=1:(l=t.createElement("link"),u.preload=l,l.addEventListener("load",function(){return u.loading|=1}),l.addEventListener("error",function(){return u.loading|=2}),Et(l,"link",e),ht(l),t.head.appendChild(l))}function vu(t){return'[src="'+xt(t)+'"]'}function ya(t){return"script[async]"+t}function Fy(t,l,e){if(l.count++,l.instance===null)switch(l.type){case"style":var u=t.querySelector('style[data-href~="'+xt(e.href)+'"]');if(u)return l.instance=u,ht(u),u;var a=F({},e,{"data-href":e.href,"data-precedence":e.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),ht(u),Et(u,"style",a),Rn(u,e.precedence,t),l.instance=u;case"stylesheet":a=ru(e.href);var n=t.querySelector(da(a));if(n)return l.state.loading|=4,l.instance=n,ht(n),n;u=Wy(e),(a=kt.get(a))&&zf(u,a),n=(t.ownerDocument||t).createElement("link"),ht(n);var i=n;return i._p=new Promise(function(c,f){i.onload=c,i.onerror=f}),Et(n,"link",u),l.state.loading|=4,Rn(n,e.precedence,t),l.instance=n;case"script":return n=vu(e.src),(a=t.querySelector(ya(n)))?(l.instance=a,ht(a),a):(u=e,(a=kt.get(n))&&(u=F({},e),pf(u,a)),t=t.ownerDocument||t,a=t.createElement("script"),ht(a),Et(a,"link",u),t.head.appendChild(a),l.instance=a);case"void":return null;default:throw Error(g(443,l.type))}else l.type==="stylesheet"&&!(l.state.loading&4)&&(u=l.instance,l.state.loading|=4,Rn(u,e.precedence,t));return l.instance}function Rn(t,l,e){for(var u=e.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=u.length?u[u.length-1]:null,n=a,i=0;i title"):null)}function pv(t,l,e){if(e===1||l.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return t=l.disabled,typeof l.precedence=="string"&&t==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function Py(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}function Tv(t,l,e,u){if(e.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&!(e.state.loading&4)){if(e.instance===null){var a=ru(u.href),n=l.querySelector(da(a));if(n){l=n._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(t.count++,t=Cn.bind(t),l.then(t,t)),e.state.loading|=4,e.instance=n,ht(n);return}n=l.ownerDocument||l,u=Wy(u),(a=kt.get(a))&&zf(u,a),n=n.createElement("link"),ht(n);var i=n;i._p=new Promise(function(c,f){i.onload=c,i.onerror=f}),Et(n,"link",u),e.instance=n}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(e,l),(l=e.state.preload)&&!(e.state.loading&3)&&(t.count++,e=Cn.bind(t),l.addEventListener("load",e),l.addEventListener("error",e))}}var Tf=0;function Av(t,l){return t.stylesheets&&t.count===0&&Yn(t,t.stylesheets),0Tf?50:800)+l);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(a)}}:null}function Cn(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yn(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Bn=null;function Yn(t,l){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Bn=new Map,l.forEach(Ov,t),Bn=null,Cn.call(t))}function Ov(t,l){if(!(l.state.loading&4)){var e=Bn.get(t);if(e)var u=e.get(null);else{e=new Map,Bn.set(t,e);for(var a=t.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hh)}catch(t){console.error(t)}}hh(),Ff.exports=ba;var Hf=Ff.exports;const Cv=ue({__proto__:null,default:Vf(Hf)},[Hf]);var rh={exports:{}},xn={};/** * @license React * react-jsx-runtime.production.js * @@ -46,4 +46,4 @@ Error generating stack: `+u.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Bv=Symbol.for("react.transitional.element"),Yv=Symbol.for("react.fragment");function vh(t,l,e){var u=null;if(e!==void 0&&(u=""+e),l.key!==void 0&&(u=""+l.key),"key"in l){e={};for(var a in l)a!=="key"&&(e[a]=l[a])}else e=l;return l=e.ref,{$$typeof:Bv,type:t,key:u,ref:l!==void 0?l:null,props:e}}xn.Fragment=Yv,xn.jsx=vh,xn.jsxs=vh,rh.exports=xn;var Oe=rh.exports;const mh=V.createContext(null);function Sh({namespace:t,children:l}){return Oe.jsx(mh.Provider,{value:t,children:l})}function qv(){return V.useContext(mh)}function Vv(t,l){return l?`${l}-${t}`:t}function Ml(t,l){const e=qv();return Vv(t,l!==void 0?l:e)}function jv({id:t,tagName:l="div",namespace:e,...u}){const a=Ml(t,e),n=V.useRef(null);return V.useEffect(()=>{var d;const i=n.current,c=i==null?void 0:i.parentElement;if(!i||!c||!((d=window.Shiny)!=null&&d.bindAll))return;const f=(r,m)=>{console.error(`[shinyreact] ShinyOutput "${a}" ${m} failed:`,{id:a,phase:m,error:r})};try{const r=window.Shiny.bindAll(c);r&&typeof r.catch=="function"&&r.catch(m=>f(m,"bindAll"))}catch(r){f(r,"bindAll")}return()=>{var r,m;try{(m=(r=window.Shiny)==null?void 0:r.unbindAll)==null||m.call(r,i,!0)}catch(y){f(y,"unbindAll")}}},[a,l]),Wf.createElement(l,{id:a,ref:n,...u})}const Su=Symbol("MISSING"),gh="1.0";function Gv(){if(typeof document>"u")return null;const t=document.getElementById("shinyreact-config"),l=t==null?void 0:t.textContent;if(!l)return null;try{return JSON.parse(l)}catch(e){return console.error("shinyreact: could not parse #shinyreact-config JSON",e),null}}function Xv(t){if(typeof document<"u"&&document.body){const l="shinyreact-fatal-error";let e=document.getElementById(l);e||(e=document.createElement("div"),e.id=l,e.setAttribute("role","alert"),e.style.cssText="position:fixed;top:0;left:0;right:0;z-index:99999;padding:1rem 1.25rem;background:#fee2e2;color:#7f1d1d;border-bottom:4px solid #991b1b;font-family:system-ui,sans-serif;font-size:15px;line-height:1.5;white-space:pre-wrap",document.body.appendChild(e));const u=e;u.textContent="",t.split("`").forEach((a,n)=>{if(n%2===0){u.appendChild(document.createTextNode(a));return}const i=document.createElement("code");i.textContent=a,i.style.cssText="background:#fff;color:#7f1d1d;border:1px solid #f0a3a3;border-radius:4px;padding:0.1em 0.35em;font-family:ui-monospace,SFMono-Regular,monospace;font-size:0.95em",u.appendChild(i)})}throw new Error(t.replace(/`/g,""))}function Qv(t){const l=e=>e.split(".")[0];l(t)!==l(gh)&&Xv(`shinyreact protocol mismatch: the server speaks protocol \`${t}\` but this JS client supports \`${gh}\`. Upgrade the older side (the shinyreact R/Python package, or the client bundle) so the major protocol versions match.`)}function Zv(t){const l=typeof window<"u"?window:globalThis,e=l.shinyreact=l.shinyreact||{},u=e._restore,a=Gv();if(a!=null&&a.protocolVersion?Qv(a.protocolVersion):a!=null&&console.error("shinyreact: the `#shinyreact-config` tag carries no `protocolVersion`, so the client cannot verify it speaks the same protocol as the server. Upgrade the shinyreact Python/R package.".replace(/`/g,"")),u&&typeof u=="object"&&u["-applied"])return;const n=a==null?void 0:a.restore,i=Object.create(null);if(n&&typeof n=="object")for(const[c,f]of Object.entries(n))t.add(c,f),i[c]=f;e._restore={"-applied":!0,"-values":i}}let Rf=!1,Ln=!1;const Nf=new Set;let bh=!1,Eh,zh,Th;function ph(){for(const t of Nf)t()}function Ah(){Rf||(Rf=!0,ph())}function Oh(t){Ln!==t&&(Ln=t,ph())}function xv(){if(bh||typeof document>"u")return;bh=!0,document.documentElement.classList.contains("shiny-busy")&&(Ln=!0),Eh=()=>Oh(!0),zh=()=>Oh(!1),document.addEventListener("shiny:busy",Eh),document.addEventListener("shiny:idle",zh);const t=nt();if(t){t.initializedPromise.then(Ah);return}Th=()=>{const l=nt();l&&l.initializedPromise.then(Ah)},document.addEventListener("shiny:connected",Th,{once:!0})}function _h(t){return xv(),Nf.add(t),()=>{Nf.delete(t)}}function Mh(){return Rf}function Dh(){return Ln}class Lv{constructor(){K(this,"messageHandlers",new Map);K(this,"initialized",!1)}init(){if(this.initialized)return;const l=nt();l&&(l.addCustomMessageHandler("shinyReactMessage",e=>{this.dispatchMessage(e.id,e.data)}),this.initialized=!0)}addHandler(l,e){this.init(),this.messageHandlers.has(l)||this.messageHandlers.set(l,new Set),this.messageHandlers.get(l).add(e)}removeHandler(l,e){const u=this.messageHandlers.get(l);u&&(u.delete(e),u.size===0&&this.messageHandlers.delete(l))}dispatchMessage(l,e){const u=this.messageHandlers.get(l);u&&u.forEach(a=>a(e))}getHandlerCount(l){const e=this.messageHandlers.get(l);return e?e.size:0}getActiveMessageIds(){return Array.from(this.messageHandlers.keys())}}const Uh=new Lv;function Hh(){const t=nt();return t?t.messageRegistry??(t.messageRegistry=Uh):Uh}function Kv(){nt()&&Hh()}class Jv{constructor(l){K(this,"id");K(this,"el");K(this,"status","pending");K(this,"hasValue",!1);K(this,"lastValue");K(this,"lastError",null);K(this,"useStateSetValueFns");K(this,"useStateSetStatusFns");K(this,"useStateSetErrorFns");this.id=l,this.useStateSetValueFns=new Set,this.useStateSetStatusFns=new Set,this.useStateSetErrorFns=new Set}hasReceivedValue(){return this.hasValue}getLastValue(){return this.lastValue}getLastError(){return this.lastError}addUseStateSetValueFn(l){this.useStateSetValueFns.add(l)}removeUseStateSetValueFn(l){this.useStateSetValueFns.delete(l)}addUseStateSetStatusFn(l){this.useStateSetStatusFns.add(l)}removeUseStateSetStatusFn(l){this.useStateSetStatusFns.delete(l)}addUseStateSetErrorFn(l){this.useStateSetErrorFns.add(l)}removeUseStateSetErrorFn(l){this.useStateSetErrorFns.delete(l)}getStatus(){return this.status}setStatus(l){this.status!==l&&(this.status=l,this.useStateSetStatusFns.forEach(e=>e(l)))}setValue(l){this.hasValue=!0,this.lastValue=l,this.useStateSetValueFns.forEach(e=>e(l)),this.status==="error"&&(this.lastError=null,this.useStateSetErrorFns.forEach(e=>e(null))),this.setStatus("ready")}setRecalculating(l){l?this.hasValue&&(this.status==="error"&&(this.lastError=null,this.useStateSetErrorFns.forEach(e=>e(null))),this.setStatus("recalculating")):this.hasValue&&this.status==="recalculating"&&this.setStatus("ready")}setError(l){if(l.message===""){this.setValue(null);return}this.lastError=l,this.useStateSetErrorFns.forEach(e=>e(l)),this.setStatus("error")}isEmpty(){return this.useStateSetValueFns.size===0&&this.useStateSetStatusFns.size===0&&this.useStateSetErrorFns.size===0}}class wv{constructor(){K(this,"outputs",new Map);K(this,"bindAllScheduled",!1);K(this,"containerEl")}get container(){return this.containerEl??(this.containerEl=(()=>{const l=document.createElement("div");return l.className="shiny-react-output-container",l.style.visibility="hidden",document.body.appendChild(l),l})()),this.containerEl}add(l,e,u,a){let n=this.get(l);if(!n){const i=document.createElement("div");i.className="shiny-react-output",i.id=l,this.container.appendChild(i),n=new Jv(l),n.el=i,this.outputs.set(l,n),this.scheduleBindAll()}return n.addUseStateSetValueFn(e),n.addUseStateSetStatusFn(u),n.addUseStateSetErrorFn(a),n.hasReceivedValue()&&e(n.getLastValue()),u(n.getStatus()),n.getStatus()==="error"&&a(n.getLastError()),()=>{n.removeUseStateSetValueFn(e),n.removeUseStateSetStatusFn(u),n.removeUseStateSetErrorFn(a),this.scheduleCleanup(l)}}has(l){return this.outputs.has(l)}get(l){return this.outputs.get(l)}scheduleCleanup(l){requestAnimationFrame(()=>{var u;const e=this.outputs.get(l);!e||!e.isEmpty()||(this.outputs.delete(l),(u=e.el)==null||u.remove(),this.scheduleBindAll())})}scheduleBindAll(){const l=nt();!l||!this.containerEl||this.bindAllScheduled||(this.bindAllScheduled=!0,requestAnimationFrame(()=>{var e,u;(e=l.unbindAll)==null||e.call(l,this.container),(u=l.bindAll)==null||u.call(l,this.container),this.bindAllScheduled=!1}))}}function $v(t){const l=nt();if(!l)return;class e extends l.OutputBinding{find(a){return $(a).find(".shiny-react-output")}renderValue(a,n){const i=t().get(a.id);if(!i){console.error(`Output ${a.id} not found`);return}i.setValue(n)}renderError(a,n){console.error(`Error for ${a.id}:`,n);const i=t().get(a.id);i&&i.setError(n)}showProgress(a,n){const i=t().get(a.id);if(!i){console.error(`Output ${a.id} not found`);return}i.setRecalculating(n)}}l.outputBindings.register(new e,"shiny.reactOutput")}function Cf(t,l){let e=null;const u=function(...a){const n=()=>{e=null,t(...a)};e!==null&&clearTimeout(e),e=setTimeout(n,l)};return u.setDelay=a=>{l=a},u.getDelay=()=>l,u.cancel=()=>{e!==null&&(clearTimeout(e),e=null)},u}const Sa=class Sa{constructor(l,e){K(this,"id");K(this,"value");K(this,"useStateSetValueFns");K(this,"shinySetInputValueDebounced");K(this,"opts",{debounceMs:100});K(this,"type");K(this,"typeFinalized",!1);this.id=l,this.value=e,this.useStateSetValueFns=new Set,this.shinySetInputValueDebounced=Cf(this.setShinyInputValue.bind(this),this.opts.debounceMs)}isEmpty(){return this.useStateSetValueFns.size===0}setShinyInputValue(l){var u,a;const e=`${this.id}:${this.type??Sa.DEFAULT_TYPE}`;(a=(u=nt())==null?void 0:u.setInputValue)==null||a.call(u,e,l,this.opts)}updateDebounceDelay(l){this.shinySetInputValueDebounced.setDelay(l)}updatePriority(l){const e=this.opts.priority;e!==void 0&&e!==l&&console.warn(`[shinyreact] Input "${this.id}" priority changed from ${JSON.stringify(e)} to ${JSON.stringify(l)}. Priority is per-id here, so the most recent mount wins — if two call sites for this id disagree, the winner depends on mount order.`),this.opts.priority=l}updateType(l){if(!this.typeFinalized){this.type=l,this.typeFinalized=!0;return}if(l!==void 0&&this.type!==l)throw new Error(`Input "${this.id}" is already registered with type=${this.type===void 0?`undefined (wire id "${this.id}:${Sa.DEFAULT_TYPE}")`:JSON.stringify(this.type)}. A second mount requested type=${JSON.stringify(l)}. An input's handler type changes server-side semantics and must be consistent across every useShinyInput / useSetShinyInput call for the same id.`)}addUseStateSetValueFn(l){this.useStateSetValueFns.add(l)}removeUseStateSetValueFn(l){this.useStateSetValueFns.delete(l)}setValue(l){const e=typeof l=="function"?l(this.value):l;if(this.value=e,this.useStateSetValueFns.forEach(u=>u(e)),e===Su){this.shinySetInputValueDebounced.cancel();return}this.shinySetInputValueDebounced(e)}getValue(){return this.value}};K(Sa,"DEFAULT_TYPE","shinyreact.default");let Bf=Sa;class Wv{constructor(){K(this,"inputs",new Map);K(this,"pendingSubscribers",new Map)}get(l){return this.inputs.get(l)}has(l){return this.inputs.has(l)}add(l,e){if(this.inputs.has(l))throw new Error(`Input ${l} already exists`);const u=new Bf(l,e);this.inputs.set(l,u);const a=this.pendingSubscribers.get(l);return a&&(a.forEach(n=>{u.addUseStateSetValueFn(n),n(u.getValue())}),this.pendingSubscribers.delete(l)),u}getOrCreate(l,e){let u=this.get(l);return u||(u=this.add(l,e)),u}subscribe(l,e){const u=this.get(l);if(u)return u.addUseStateSetValueFn(e),e(u.getValue()),()=>{const n=this.get(l);n&&n.removeUseStateSetValueFn(e)};let a=this.pendingSubscribers.get(l);return a||(a=new Set,this.pendingSubscribers.set(l,a)),a.add(e),()=>{const n=this.get(l);if(n){n.removeUseStateSetValueFn(e);return}const i=this.pendingSubscribers.get(l);i&&(i.delete(e),i.size===0&&this.pendingSubscribers.delete(l))}}remove(l){const e=this.inputs.get(l);return e&&e.shinySetInputValueDebounced.cancel(),this.inputs.delete(l)}keys(){return this.inputs.keys()}size(){return this.inputs.size}}let Rh;function Nh(){return Rh??(Rh={inputs:new Wv,outputs:new wv}),Rh}function Fv(){Qt()}function Qt(){const t=nt();return t?t.reactRegistry??(t.reactRegistry=Nh()):Nh()}function Kn(t,l,{debounceMs:e=100,priority:u,namespace:a,type:n}={}){if(_e(),n!==void 0&&!/^[^\s:]+$/.test(n))throw new Error(`useShinyInput("${t}"): invalid type=${JSON.stringify(n)}. Must be non-empty and contain no whitespace or ':' characters.`);const i=Ml(t,a),f=V.useRef(l).current;let d=f;const m=Qt().inputs.get(i);m&&(d=m.getValue());const[y,v]=V.useState(d),b=le();V.useEffect(()=>{if(!b)return;const o=Qt().inputs.getOrCreate(i,f);return e!==void 0&&o.updateDebounceDelay(e),u&&o.updatePriority(u),o.updateType(n),o.addUseStateSetValueFn(v),o.setValue(o.getValue()),()=>{o.removeUseStateSetValueFn(v)}},[i,b,e,u,f,n]);const p=V.useCallback(H=>{if(!b)return;const s=Qt().inputs.get(i);if(!s){console.error(`Input ${i} not found`);return}s.setValue(H)},[i,b]);return[y,p]}const gu=()=>{};function Ch(t,l=void 0,{namespace:e}={}){const[u,a]=V.useState(l),n=le();_e();const i=Ml(t,e),c=V.useRef(l);return V.useEffect(()=>{if(!n)return;const f=Qt();return a(c.current),f.outputs.add(i,a,gu,gu)},[i,n]),u}function Bh(t,{namespace:l}={}){const[e,u]=V.useState("pending"),a=le();_e();const n=Ml(t,l);return V.useEffect(()=>a?Qt().outputs.add(n,gu,u,gu):void 0,[n,a]),e}function kv(t,{namespace:l}={}){const[e,u]=V.useState(null),a=le();_e();const n=Ml(t,l);return V.useEffect(()=>a?(u(null),Qt().outputs.add(n,gu,gu,u)):void 0,[n,a]),e}function Iv(t,{namespace:l}={}){_e();const e=Ml(t,l),[u,a]=V.useState(()=>{const i=Qt().inputs.get(e);if(!i)return;const c=i.getValue();return c===Su?void 0:c}),n=le();return V.useEffect(()=>n?Qt().inputs.subscribe(e,f=>{a(f===Su?void 0:f)}):void 0,[e,n]),u}function Pv(t,l,{debounceMs:e=100,priority:u,namespace:a,type:n}={}){if(_e(),n!==void 0&&!/^[^\s:]+$/.test(n))throw new Error(`useSetShinyInput("${t}"): invalid type=${JSON.stringify(n)}. Must be non-empty and contain no whitespace or ':' characters.`);const i=Ml(t,a),f=V.useRef(l).current,d=le();return V.useEffect(()=>{if(!d)return;const m=Qt().inputs.getOrCreate(i,f);e!==void 0&&m.updateDebounceDelay(e),u&&m.updatePriority(u),m.updateType(n),m.setValue(m.getValue())},[i,d,e,u,f,n]),V.useCallback(r=>{if(!d)return;const y=Qt().inputs.get(i);if(!y){console.error(`Input ${i} not found`);return}y.setValue(r)},[i,d])}function tm(t,l,{namespace:e}={}){const u=le();_e();const a=Ml(t,e),n=V.useRef(l);n.current=l,V.useEffect(()=>{if(!u||!a)return;const i=f=>n.current(f),c=Hh();return c.addHandler(a,i),()=>{c.removeHandler(a,i)}},[u,a])}function le(){return V.useSyncExternalStore(_h,Mh,Mh)}function lm(){return V.useSyncExternalStore(_h,Dh,Dh)}let Yh=!1;function _e(){Yh||(Fv(),Zv(Qt().inputs),$v(()=>Qt().outputs),Kv(),Yh=!0)}function em({id:t,className:l,width:e,height:u,debounceMs:a=400,onRecalculating:n,namespace:i}){const c=Ml(t,i),f={namespace:null},[d,r]=Kn(`.clientdata_output_${c}_width`,Su,f),[m,y]=Kn(`.clientdata_output_${c}_height`,Su,f),[v]=Kn(`.clientdata_output_${c}_hidden`,!1,f),b=Ch(c,void 0,f),p=Bh(c,f),H=V.useRef(null),o=V.useRef(null),[s,h]=V.useState(0);V.useEffect(()=>{b&&h(E=>E+1)},[b]),V.useEffect(()=>{n&&n(p==="recalculating")},[p,n]);const S=V.useCallback(()=>{if(H.current){const E=H.current.clientWidth,_=H.current.clientHeight;E>0&&_>0&&(r(E),y(_))}},[r,y]);return V.useEffect(()=>{const E=H.current;if(!E)return;E.addEventListener("load",S);const _=Cf(()=>{E&&E.complete&&S()},a),z=new ResizeObserver(A=>{for(const M of A)M.target===E&&_()});return z.observe(E),()=>{E.removeEventListener("load",S),z.disconnect(),_.cancel()}},[H,s,r,y,a,S]),V.useEffect(()=>{if(b)return;const E=o.current;if(!E)return;const _=()=>{const M=E.clientWidth,R=E.clientHeight;M>0&&R>0&&(r(M),y(R))};_();const z=Cf(_,a),A=new ResizeObserver(()=>z());return A.observe(E),()=>{A.disconnect(),z.cancel()}},[b,r,y,a]),v?null:b?Oe.jsx("img",{ref:H,src:b.src,alt:"",className:l,style:{width:e,height:u},onLoad:S}):Oe.jsx("div",{ref:o,className:l,style:{width:e,height:u,display:"flex",alignItems:"center",justifyContent:"center",color:"#9ca3af"},children:Oe.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",style:{animation:"spin 1s linear infinite"},children:Oe.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2.5",strokeDasharray:"31.4 31.4",strokeLinecap:"round"})})})}class qh extends HTMLElement{constructor(){super(...arguments);K(this,"root",null);K(this,"slotContents",new Map)}captureSlots(e="[data-slot]"){const u=this.querySelectorAll(`:scope > ${e}`),a=new Set(u);u.forEach(i=>{const c=i.getAttribute("data-slot");c&&this.slotContents.set(c,Array.from(i.childNodes))});const n=Array.from(this.childNodes).filter(i=>!a.has(i));return n.length>0&&this.slotContents.set("__children__",n),this.slotContents}async mountSlot(e,u){var n,i;const a=this.slotContents.get(e);a&&u&&(a.forEach(c=>u.appendChild(c)),await((i=(n=window.Shiny)==null?void 0:n.bindAll)==null?void 0:i.call(n,u)))}get onSlotMount(){return this.mountSlot.bind(this)}getConfig(){const e={};for(const[u,a]of Object.entries(this.dataset))if(a!==void 0)try{e[u]=JSON.parse(a)}catch{e[u]=a}return e}get namespace(){return this.id||void 0}render(){const e=this.constructor.component;return e?Oe.jsx(e,{...this.getConfig()}):(console.error(`${this.constructor.name}: No static component defined`),null)}wrapWithProvider(e){return this.namespace?Oe.jsx(Sh,{namespace:this.namespace,children:e}):e}clearContent(){this.innerHTML=""}connectedCallback(){this.captureSlots(),this.clearContent(),this.root=Hf.createRoot(this),this.root.render(this.wrapWithProvider(this.render()))}disconnectedCallback(){var e,u,a;(u=(e=window.Shiny)==null?void 0:e.unbindAll)==null||u.call(e,this),(a=this.root)==null||a.unmount(),this.root=null}}K(qh,"component",null);function um(){window.shinyreact={useSetShinyInput:Pv,useShinyBusy:lm,useShinyInput:Kn,useShinyInputValue:Iv,useShinyOutputError:kv,useShinyOutputStatus:Bh,useShinyOutputValue:Ch,useShinyMessageHandler:tm,useShinyInitialized:le,ImageOutput:em,MISSING:Su,ShinyModuleProvider:Sh,ShinyReactComponentElement:qh,ShinyOutput:jv,React:Wf,ReactDOM:Cv}}um(),jh()})(); + */var Bv=Symbol.for("react.transitional.element"),Yv=Symbol.for("react.fragment");function vh(t,l,e){var u=null;if(e!==void 0&&(u=""+e),l.key!==void 0&&(u=""+l.key),"key"in l){e={};for(var a in l)a!=="key"&&(e[a]=l[a])}else e=l;return l=e.ref,{$$typeof:Bv,type:t,key:u,ref:l!==void 0?l:null,props:e}}xn.Fragment=Yv,xn.jsx=vh,xn.jsxs=vh,rh.exports=xn;var Oe=rh.exports;const mh=V.createContext(null);function Sh({namespace:t,children:l}){return Oe.jsx(mh.Provider,{value:t,children:l})}function qv(){return V.useContext(mh)}function Vv(t,l){return l?`${l}-${t}`:t}function Ml(t,l){const e=qv();return Vv(t,l!==void 0?l:e)}function jv({id:t,tagName:l="div",namespace:e,...u}){const a=Ml(t,e),n=V.useRef(null);return V.useEffect(()=>{var d;const i=n.current,c=i==null?void 0:i.parentElement;if(!i||!c||!((d=window.Shiny)!=null&&d.bindAll))return;const f=(r,m)=>{console.error(`[shinyreact] ShinyOutput "${a}" ${m} failed:`,{id:a,phase:m,error:r})};try{const r=window.Shiny.bindAll(c);r&&typeof r.catch=="function"&&r.catch(m=>f(m,"bindAll"))}catch(r){f(r,"bindAll")}return()=>{var r,m;try{(m=(r=window.Shiny)==null?void 0:r.unbindAll)==null||m.call(r,i,!0)}catch(y){f(y,"unbindAll")}}},[a,l]),Wf.createElement(l,{id:a,ref:n,...u})}const Su=Symbol("MISSING"),gh="1.0";function Gv(){if(typeof document>"u")return null;const t=document.getElementById("shinyreact-config"),l=t==null?void 0:t.textContent;if(!l)return null;try{return JSON.parse(l)}catch(e){return console.error("shinyreact: could not parse #shinyreact-config JSON",e),null}}function Xv(t){if(typeof document<"u"&&document.body){const l="shinyreact-fatal-error";let e=document.getElementById(l);e||(e=document.createElement("div"),e.id=l,e.setAttribute("role","alert"),e.style.cssText="position:fixed;top:0;left:0;right:0;z-index:99999;padding:1rem 1.25rem;background:#fee2e2;color:#7f1d1d;border-bottom:4px solid #991b1b;font-family:system-ui,sans-serif;font-size:15px;line-height:1.5;white-space:pre-wrap",document.body.appendChild(e));const u=e;u.textContent="",t.split("`").forEach((a,n)=>{if(n%2===0){u.appendChild(document.createTextNode(a));return}const i=document.createElement("code");i.textContent=a,i.style.cssText="background:#fff;color:#7f1d1d;border:1px solid #f0a3a3;border-radius:4px;padding:0.1em 0.35em;font-family:ui-monospace,SFMono-Regular,monospace;font-size:0.95em",u.appendChild(i)})}throw new Error(t.replace(/`/g,""))}function Qv(t){const l=e=>e.split(".")[0];l(t)!==l(gh)&&Xv(`shinyreact protocol mismatch: the server speaks protocol \`${t}\` but this JS client supports \`${gh}\`. Upgrade the older side (the shinyreact R/Python package, or the client bundle) so the major protocol versions match.`)}function Zv(t){const l=typeof window<"u"?window:globalThis,e=l.shinyreact=l.shinyreact||{},u=e._restore,a=Gv();if(a!=null&&a.protocolVersion?Qv(a.protocolVersion):a!=null&&console.error("shinyreact: the `#shinyreact-config` tag carries no `protocolVersion`, so the client cannot verify it speaks the same protocol as the server. Upgrade the shinyreact Python/R package.".replace(/`/g,"")),u&&typeof u=="object"&&u["-applied"])return;const n=a==null?void 0:a.restore,i=Object.create(null);if(n&&typeof n=="object")for(const[c,f]of Object.entries(n))t.add(c,f),i[c]=f;e._restore={"-applied":!0,"-values":i}}let Rf=!1,Ln=!1;const Nf=new Set;let bh=!1,Eh,zh,ph;function Th(){for(const t of Nf)t()}function Ah(){Rf||(Rf=!0,Th())}function Oh(t){Ln!==t&&(Ln=t,Th())}function xv(){if(bh||typeof document>"u")return;bh=!0,document.documentElement.classList.contains("shiny-busy")&&(Ln=!0),Eh=()=>Oh(!0),zh=()=>Oh(!1),document.addEventListener("shiny:busy",Eh),document.addEventListener("shiny:idle",zh);const t=nt();if(t){t.initializedPromise.then(Ah);return}ph=()=>{const l=nt();l&&l.initializedPromise.then(Ah)},document.addEventListener("shiny:connected",ph,{once:!0})}function _h(t){return xv(),Nf.add(t),()=>{Nf.delete(t)}}function Mh(){return Rf}function Dh(){return Ln}class Lv{constructor(){K(this,"messageHandlers",new Map);K(this,"initialized",!1)}init(){if(this.initialized)return;const l=nt();l&&(l.addCustomMessageHandler("shinyReactMessage",e=>{this.dispatchMessage(e.id,e.data)}),this.initialized=!0)}addHandler(l,e){this.init(),this.messageHandlers.has(l)||this.messageHandlers.set(l,new Set),this.messageHandlers.get(l).add(e)}removeHandler(l,e){const u=this.messageHandlers.get(l);u&&(u.delete(e),u.size===0&&this.messageHandlers.delete(l))}dispatchMessage(l,e){const u=this.messageHandlers.get(l);u&&u.forEach(a=>a(e))}getHandlerCount(l){const e=this.messageHandlers.get(l);return e?e.size:0}getActiveMessageIds(){return Array.from(this.messageHandlers.keys())}}const Uh=new Lv;function Hh(){const t=nt();return t?t.messageRegistry??(t.messageRegistry=Uh):Uh}function Kv(){nt()&&Hh()}class Jv{constructor(l){K(this,"id");K(this,"el");K(this,"status","pending");K(this,"hasValue",!1);K(this,"lastValue");K(this,"lastError",null);K(this,"useStateSetValueFns");K(this,"useStateSetStatusFns");K(this,"useStateSetErrorFns");this.id=l,this.useStateSetValueFns=new Set,this.useStateSetStatusFns=new Set,this.useStateSetErrorFns=new Set}hasReceivedValue(){return this.hasValue}getLastValue(){return this.lastValue}getLastError(){return this.lastError}addUseStateSetValueFn(l){this.useStateSetValueFns.add(l)}removeUseStateSetValueFn(l){this.useStateSetValueFns.delete(l)}addUseStateSetStatusFn(l){this.useStateSetStatusFns.add(l)}removeUseStateSetStatusFn(l){this.useStateSetStatusFns.delete(l)}addUseStateSetErrorFn(l){this.useStateSetErrorFns.add(l)}removeUseStateSetErrorFn(l){this.useStateSetErrorFns.delete(l)}getStatus(){return this.status}setStatus(l){this.status!==l&&(this.status=l,this.useStateSetStatusFns.forEach(e=>e(l)))}setValue(l){this.hasValue=!0,this.lastValue=l,this.useStateSetValueFns.forEach(e=>e(l)),this.status==="error"&&(this.lastError=null,this.useStateSetErrorFns.forEach(e=>e(null))),this.setStatus("ready")}setRecalculating(l){l?this.hasValue&&(this.status==="error"&&(this.lastError=null,this.useStateSetErrorFns.forEach(e=>e(null))),this.setStatus("recalculating")):this.hasValue&&this.status==="recalculating"&&this.setStatus("ready")}setError(l){if(l.message===""){this.setValue(null);return}this.lastError=l,this.useStateSetErrorFns.forEach(e=>e(l)),this.setStatus("error")}isEmpty(){return this.useStateSetValueFns.size===0&&this.useStateSetStatusFns.size===0&&this.useStateSetErrorFns.size===0}}class wv{constructor(){K(this,"outputs",new Map);K(this,"bindAllScheduled",!1);K(this,"containerEl")}get container(){return this.containerEl??(this.containerEl=(()=>{const l=document.createElement("div");return l.className="shiny-react-output-container",l.style.visibility="hidden",document.body.appendChild(l),l})()),this.containerEl}add(l,e,u,a){let n=this.get(l);if(!n){const i=document.createElement("div");i.className="shiny-react-output",i.id=l,this.container.appendChild(i),n=new Jv(l),n.el=i,this.outputs.set(l,n),this.scheduleBindAll()}return n.addUseStateSetValueFn(e),n.addUseStateSetStatusFn(u),n.addUseStateSetErrorFn(a),n.hasReceivedValue()&&e(n.getLastValue()),u(n.getStatus()),n.getStatus()==="error"&&a(n.getLastError()),()=>{n.removeUseStateSetValueFn(e),n.removeUseStateSetStatusFn(u),n.removeUseStateSetErrorFn(a),this.scheduleCleanup(l)}}has(l){return this.outputs.has(l)}get(l){return this.outputs.get(l)}scheduleCleanup(l){requestAnimationFrame(()=>{var u;const e=this.outputs.get(l);!e||!e.isEmpty()||(this.outputs.delete(l),(u=e.el)==null||u.remove(),this.scheduleBindAll())})}scheduleBindAll(){const l=nt();!l||!this.containerEl||this.bindAllScheduled||(this.bindAllScheduled=!0,requestAnimationFrame(()=>{var e,u;(e=l.unbindAll)==null||e.call(l,this.container),(u=l.bindAll)==null||u.call(l,this.container),this.bindAllScheduled=!1}))}}function $v(t){const l=nt();if(!l)return;class e extends l.OutputBinding{find(a){return $(a).find(".shiny-react-output")}renderValue(a,n){const i=t().get(a.id);if(!i){console.error(`Output ${a.id} not found`);return}i.setValue(n)}renderError(a,n){console.error(`Error for ${a.id}:`,n);const i=t().get(a.id);i&&i.setError(n)}showProgress(a,n){const i=t().get(a.id);if(!i){console.error(`Output ${a.id} not found`);return}i.setRecalculating(n)}}l.outputBindings.register(new e,"shiny.reactOutput")}function Cf(t,l){let e=null;const u=function(...a){const n=()=>{e=null,t(...a)};e!==null&&clearTimeout(e),e=setTimeout(n,l)};return u.setDelay=a=>{l=a},u.getDelay=()=>l,u.cancel=()=>{e!==null&&(clearTimeout(e),e=null)},u}const Sa=class Sa{constructor(l,e){K(this,"id");K(this,"value");K(this,"useStateSetValueFns");K(this,"shinySetInputValueDebounced");K(this,"opts",{debounceMs:100});K(this,"type");K(this,"typeFinalized",!1);this.id=l,this.value=e,this.useStateSetValueFns=new Set,this.shinySetInputValueDebounced=Cf(this.setShinyInputValue.bind(this),this.opts.debounceMs)}isEmpty(){return this.useStateSetValueFns.size===0}setShinyInputValue(l){var u,a;const e=`${this.id}:${this.type??Sa.DEFAULT_TYPE}`;(a=(u=nt())==null?void 0:u.setInputValue)==null||a.call(u,e,l,this.opts)}updateDebounceDelay(l){this.shinySetInputValueDebounced.setDelay(l)}updatePriority(l){const e=this.opts.priority;e!==void 0&&e!==l&&console.warn(`[shinyreact] Input "${this.id}" priority changed from ${JSON.stringify(e)} to ${JSON.stringify(l)}. Priority is per-id here, so the most recent mount wins — if two call sites for this id disagree, the winner depends on mount order.`),this.opts.priority=l}updateType(l){if(!this.typeFinalized){this.type=l,this.typeFinalized=!0;return}if(l!==void 0&&this.type!==l)throw new Error(`Input "${this.id}" is already registered with type=${this.type===void 0?`undefined (wire id "${this.id}:${Sa.DEFAULT_TYPE}")`:JSON.stringify(this.type)}. A second mount requested type=${JSON.stringify(l)}. An input's handler type changes server-side semantics and must be consistent across every useShinyInput / useSetShinyInput call for the same id.`)}addUseStateSetValueFn(l){this.useStateSetValueFns.add(l)}removeUseStateSetValueFn(l){this.useStateSetValueFns.delete(l)}setValue(l){const e=typeof l=="function"?l(this.value):l;if(this.value=e,this.useStateSetValueFns.forEach(u=>u(e)),e===Su){this.shinySetInputValueDebounced.cancel();return}this.shinySetInputValueDebounced(e)}getValue(){return this.value}};K(Sa,"DEFAULT_TYPE","shinyreact.default");let Bf=Sa;class Wv{constructor(){K(this,"inputs",new Map);K(this,"pendingSubscribers",new Map)}get(l){return this.inputs.get(l)}has(l){return this.inputs.has(l)}add(l,e){if(this.inputs.has(l))throw new Error(`Input ${l} already exists`);const u=new Bf(l,e);this.inputs.set(l,u);const a=this.pendingSubscribers.get(l);return a&&(a.forEach(n=>{u.addUseStateSetValueFn(n),n(u.getValue())}),this.pendingSubscribers.delete(l)),u}getOrCreate(l,e){let u=this.get(l);return u||(u=this.add(l,e)),u}subscribe(l,e){const u=this.get(l);if(u)return u.addUseStateSetValueFn(e),e(u.getValue()),()=>{const n=this.get(l);n&&n.removeUseStateSetValueFn(e)};let a=this.pendingSubscribers.get(l);return a||(a=new Set,this.pendingSubscribers.set(l,a)),a.add(e),()=>{const n=this.get(l);if(n){n.removeUseStateSetValueFn(e);return}const i=this.pendingSubscribers.get(l);i&&(i.delete(e),i.size===0&&this.pendingSubscribers.delete(l))}}remove(l){const e=this.inputs.get(l);return e&&e.shinySetInputValueDebounced.cancel(),this.inputs.delete(l)}keys(){return this.inputs.keys()}size(){return this.inputs.size}}let Rh;function Nh(){return Rh??(Rh={inputs:new Wv,outputs:new wv}),Rh}function Fv(){Qt()}function Qt(){const t=nt();return t?t.reactRegistry??(t.reactRegistry=Nh()):Nh()}function Kn(t,l,{debounceMs:e=100,priority:u,namespace:a,type:n}={}){if(_e(),n!==void 0&&!/^[^\s:]+$/.test(n))throw new Error(`useShinyInput("${t}"): invalid type=${JSON.stringify(n)}. Must be non-empty and contain no whitespace or ':' characters.`);const i=Ml(t,a),f=V.useRef(l).current;let d=f;const m=Qt().inputs.get(i);m&&(d=m.getValue());const[y,v]=V.useState(d),b=le();V.useEffect(()=>{if(!b)return;const o=Qt().inputs.getOrCreate(i,f);return e!==void 0&&o.updateDebounceDelay(e),u&&o.updatePriority(u),o.updateType(n),o.addUseStateSetValueFn(v),o.setValue(o.getValue()),()=>{o.removeUseStateSetValueFn(v)}},[i,b,e,u,f,n]);const T=V.useCallback(H=>{if(!b)return;const s=Qt().inputs.get(i);if(!s){console.error(`Input ${i} not found`);return}s.setValue(H)},[i,b]);return[y,T]}const gu=()=>{};function Ch(t,l=void 0,{namespace:e}={}){const[u,a]=V.useState(l),n=le();_e();const i=Ml(t,e),c=V.useRef(l);return V.useEffect(()=>{if(!n)return;const f=Qt();return a(c.current),f.outputs.add(i,a,gu,gu)},[i,n]),u}function Bh(t,{namespace:l}={}){const[e,u]=V.useState("pending"),a=le();_e();const n=Ml(t,l);return V.useEffect(()=>a?Qt().outputs.add(n,gu,u,gu):void 0,[n,a]),e}function kv(t,{namespace:l}={}){const[e,u]=V.useState(null),a=le();_e();const n=Ml(t,l);return V.useEffect(()=>a?(u(null),Qt().outputs.add(n,gu,gu,u)):void 0,[n,a]),e}function Iv(t,{namespace:l}={}){_e();const e=Ml(t,l),[u,a]=V.useState(()=>{const i=Qt().inputs.get(e);if(!i)return;const c=i.getValue();return c===Su?void 0:c}),n=le();return V.useEffect(()=>n?Qt().inputs.subscribe(e,f=>{a(f===Su?void 0:f)}):void 0,[e,n]),u}function Pv(t,l,{debounceMs:e=100,priority:u,namespace:a,type:n}={}){if(_e(),n!==void 0&&!/^[^\s:]+$/.test(n))throw new Error(`useSetShinyInput("${t}"): invalid type=${JSON.stringify(n)}. Must be non-empty and contain no whitespace or ':' characters.`);const i=Ml(t,a),f=V.useRef(l).current,d=le();return V.useEffect(()=>{if(!d)return;const m=Qt().inputs.getOrCreate(i,f);e!==void 0&&m.updateDebounceDelay(e),u&&m.updatePriority(u),m.updateType(n),m.setValue(m.getValue())},[i,d,e,u,f,n]),V.useCallback(r=>{if(!d)return;const y=Qt().inputs.get(i);if(!y){console.error(`Input ${i} not found`);return}y.setValue(r)},[i,d])}function tm(t,l,{namespace:e}={}){const u=le();_e();const a=Ml(t,e),n=V.useRef(l);n.current=l,V.useEffect(()=>{if(!u||!a)return;const i=f=>n.current(f),c=Hh();return c.addHandler(a,i),()=>{c.removeHandler(a,i)}},[u,a])}function le(){return V.useSyncExternalStore(_h,Mh,Mh)}function lm(){return V.useSyncExternalStore(_h,Dh,Dh)}let Yh=!1;function _e(){Yh||(Fv(),Zv(Qt().inputs),$v(()=>Qt().outputs),Kv(),Yh=!0)}function em({id:t,className:l,width:e,height:u,debounceMs:a=400,onRecalculating:n,namespace:i}){const c=Ml(t,i),f={namespace:null},[d,r]=Kn(`.clientdata_output_${c}_width`,Su,f),[m,y]=Kn(`.clientdata_output_${c}_height`,Su,f),[v]=Kn(`.clientdata_output_${c}_hidden`,!1,f),b=Ch(c,void 0,f),T=Bh(c,f),H=V.useRef(null),o=V.useRef(null),[s,h]=V.useState(0);V.useEffect(()=>{b&&h(E=>E+1)},[b]),V.useEffect(()=>{n&&n(T==="recalculating")},[T,n]);const S=V.useCallback(()=>{if(H.current){const E=H.current.clientWidth,_=H.current.clientHeight;E>0&&_>0&&(r(E),y(_))}},[r,y]);return V.useEffect(()=>{const E=H.current;if(!E)return;E.addEventListener("load",S);const _=Cf(()=>{E&&E.complete&&S()},a),z=new ResizeObserver(A=>{for(const M of A)M.target===E&&_()});return z.observe(E),()=>{E.removeEventListener("load",S),z.disconnect(),_.cancel()}},[H,s,r,y,a,S]),V.useEffect(()=>{if(b)return;const E=o.current;if(!E)return;const _=()=>{const M=E.clientWidth,R=E.clientHeight;M>0&&R>0&&(r(M),y(R))};_();const z=Cf(_,a),A=new ResizeObserver(()=>z());return A.observe(E),()=>{A.disconnect(),z.cancel()}},[b,r,y,a]),v?null:b?Oe.jsx("img",{ref:H,src:b.src,alt:"",className:l,style:{width:e,height:u},onLoad:S}):Oe.jsx("div",{ref:o,className:l,style:{width:e,height:u,display:"flex",alignItems:"center",justifyContent:"center",color:"#9ca3af"},children:Oe.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",style:{animation:"spin 1s linear infinite"},children:Oe.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2.5",strokeDasharray:"31.4 31.4",strokeLinecap:"round"})})})}class qh extends HTMLElement{constructor(){super(...arguments);K(this,"root",null);K(this,"slotContents",new Map)}captureSlots(e="[data-slot]"){const u=this.querySelectorAll(`:scope > ${e}`),a=new Set(u);u.forEach(i=>{const c=i.getAttribute("data-slot");c&&this.slotContents.set(c,Array.from(i.childNodes))});const n=Array.from(this.childNodes).filter(i=>!a.has(i));return n.length>0&&this.slotContents.set("__children__",n),this.slotContents}async mountSlot(e,u){var n,i;const a=this.slotContents.get(e);a&&u&&(a.forEach(c=>u.appendChild(c)),await((i=(n=window.Shiny)==null?void 0:n.bindAll)==null?void 0:i.call(n,u)))}get onSlotMount(){return this.mountSlot.bind(this)}getConfig(){const e={};for(const[u,a]of Object.entries(this.dataset))if(a!==void 0)try{e[u]=JSON.parse(a)}catch{e[u]=a}return e}get namespace(){return this.id||void 0}render(){const e=this.constructor.component;return e?Oe.jsx(e,{...this.getConfig()}):(console.error(`${this.constructor.name}: No static component defined`),null)}wrapWithProvider(e){return this.namespace?Oe.jsx(Sh,{namespace:this.namespace,children:e}):e}clearContent(){this.innerHTML=""}connectedCallback(){this.captureSlots(),this.clearContent(),this.root=Hf.createRoot(this),this.root.render(this.wrapWithProvider(this.render()))}disconnectedCallback(){var e,u,a;(u=(e=window.Shiny)==null?void 0:e.unbindAll)==null||u.call(e,this),(a=this.root)==null||a.unmount(),this.root=null}}K(qh,"component",null);function um(){window.shinyreact={useSetShinyInput:Pv,useShinyBusy:lm,useShinyInput:Kn,useShinyInputValue:Iv,useShinyOutputError:kv,useShinyOutputStatus:Bh,useShinyOutputValue:Ch,useShinyMessageHandler:tm,useShinyInitialized:le,ImageOutput:em,MISSING:Su,ShinyModuleProvider:Sh,ShinyReactComponentElement:qh,ShinyOutput:jv,React:Wf,ReactDOM:Cv}}um(),jh()})(); diff --git a/pkg-py/tests/playwright/test_module_dependency.py b/pkg-py/tests/playwright/test_module_dependency.py index 09677fe7..c832332d 100644 --- a/pkg-py/tests/playwright/test_module_dependency.py +++ b/pkg-py/tests/playwright/test_module_dependency.py @@ -62,9 +62,10 @@ def test_late_dep_with_a_server_side_holder( """ # `lib/` prefix, not the bare name: the fixture's own explainer paragraph # mentions the dependency by name. - assert "lib/ipywidget-output-binding" not in page.request.get( - dynamic_plotly_app.url - ).text() + assert ( + "lib/ipywidget-output-binding" + not in page.request.get(dynamic_plotly_app.url).text() + ) page.goto(dynamic_plotly_app.url) diff --git a/pkg-py/tests/test_app.py b/pkg-py/tests/test_app.py index 707cdc37..57b013ab 100644 --- a/pkg-py/tests/test_app.py +++ b/pkg-py/tests/test_app.py @@ -121,6 +121,23 @@ def test_app_discovers_ui_js(tmp_path: Path, monkeypatch) -> None: assert f"{tmp_path.name}" in html +def test_app_shinyreact_js_client_omits_bundle(tmp_path: Path, monkeypatch) -> None: + """ReactApp(shinyreact_js="client") reaches both discovered modes (#217).""" + _write_react_assets(tmp_path) + app = _make_app_from_cwd(tmp_path, monkeypatch, shinyreact_js="client") + html = TestClient(app).get("/").text + assert "shinyreact.js" not in html + assert 'id="shinyreact-config"' in html + + # ...and again once www/index.html appears (mode is re-checked per request). + (tmp_path / "www" / "index.html").write_text( + f"T{DEPS}" + ) + html = TestClient(app).get("/").text + assert "shinyreact.js" not in html + assert 'id="shinyreact-config"' in html + + def test_app_discovered_ui_supports_bookmarking(tmp_path: Path, monkeypatch) -> None: # The discovered UI is a function of the request, so a bookmark query # string renders the restore payload with zero extra wiring. diff --git a/pkg-py/tests/test_page.py b/pkg-py/tests/test_page.py index bc2380ee..1eb96031 100644 --- a/pkg-py/tests/test_page.py +++ b/pkg-py/tests/test_page.py @@ -162,6 +162,57 @@ def test_page_react_attaches_bundle_app_dep_and_config(tmp_path): assert 'id="shinyreact-config"' in html +def test_page_react_shinyreact_js_client_omits_bundle(tmp_path): + """npm tier: no IIFE bundle, but the config tag is still required (#217). + + Mirrors R's "page_react(shinyreact_js = 'client') omits the bundle". + """ + from shinyreact import page_react + + app_dir = _make_react_app(tmp_path) + ui = page_react(src_dir=app_dir / "www", shinyreact_js="client") + names = [d.name for d in ui.get_dependencies()] + assert "shinyreact" not in names + assert "myapp" in names + html = _dep_tags_html(ui) + assert "shinyreact.js" not in html + assert 'id="shinyreact-config"' in html + + +def test_page_react_html_shinyreact_js_client_omits_bundle(tmp_path): + """Mirrors R's "page_react_html(shinyreact_js = 'client') omits the bundle".""" + index = tmp_path / "index.html" + index.write_text(_full_doc()) + html = _render_doc(page_react_html(index, shinyreact_js="client")) + assert "shinyreact.js" not in html + assert 'id="shinyreact-config"' in html + + +def test_shinyreact_js_rejects_an_unknown_value(tmp_path): + """A typo fails loudly, naming the value and the valid ones (#217). + + Mirrors R's "shinyreact_js rejects an unknown value". + """ + from shinyreact import page_react + + app_dir = _make_react_app(tmp_path) + with pytest.raises(ValueError, match=r"shinyreact_js='sever'.*'server', 'client'"): + page_react(src_dir=app_dir / "www", shinyreact_js="sever") # type: ignore[arg-type] + + +def test_page_react_html_arguments_after_path_are_keyword_only(tmp_path): + """Everything after ``path`` is keyword-only. + + Mirrors R's "page_react_html() rejects anything passed to ...", where a bare + ``...`` enforces the same thing. Asserted so the two signatures cannot drift. + """ + index = tmp_path / "index.html" + index.write_text(_full_doc()) + + with pytest.raises(TypeError, match="positional"): + page_react_html(index, []) # type: ignore[misc] + + def test_page_react_title_defaults_to_app_folder_name(tmp_path): from shinyreact import page_react @@ -320,9 +371,7 @@ def test_page_react_dep_version_is_the_js_mtime(tmp_path: Path) -> None: def _dep_html(ui) -> str: rendered = ui.tagify().render() - return "".join( - d.as_html_tags().get_html_string() for d in rendered["dependencies"] - ) + return "".join(d.as_html_tags().get_html_string() for d in rendered["dependencies"]) def test_page_bare_kwargs_reach_page_bootstrap() -> None: @@ -337,9 +386,7 @@ def test_page_bare_kwargs_reach_page_bootstrap() -> None: def test_page_react_kwargs_reach_page_bootstrap(tmp_path: Path) -> None: (tmp_path / "ui.js").write_text("// ui") - ui = shinyreact.page_react( - src_dir=tmp_path, theme="https://cdn.example/custom.css" - ) + ui = shinyreact.page_react(src_dir=tmp_path, theme="https://cdn.example/custom.css") assert 'href="https://cdn.example/custom.css"' in _dep_html(ui) diff --git a/pkg-py/tests/test_set_react_page.py b/pkg-py/tests/test_set_react_page.py index 2fa15f98..ce8f46fc 100644 --- a/pkg-py/tests/test_set_react_page.py +++ b/pkg-py/tests/test_set_react_page.py @@ -28,6 +28,27 @@ def test_build_page_fn_injects_shinyreact_dep(tmp_path: Path) -> None: assert "shinyreact" in dep_names +def test_build_page_fn_shinyreact_js_client_omits_bundle(tmp_path: Path) -> None: + """npm tier: no IIFE bundle, config tag still emitted (#217). + + Both `set_react_page()` modes: the HTML-file page_fn and the discovered one. + """ + index = tmp_path / "index.html" + index.write_text("
") + (tmp_path / "www").mkdir() + (tmp_path / "www" / "ui.js").write_text("// ui entry") + + for page_fn in ( + _build_react_page_fn(index, "client"), + _build_react_page_fn_discovered(tmp_path, "client"), + ): + rendered = _render(page_fn) + deps = rendered["dependencies"] + assert "shinyreact" not in [d.name for d in deps] + head = "".join(d.as_html_tags().get_html_string() for d in deps) + assert 'id="shinyreact-config"' in head + + def test_build_page_fn_discovers_renderer_deps(tmp_path: Path) -> None: """Deps from traditional Shiny renderers are auto-discovered.""" index = tmp_path / "index.html" diff --git a/pkg-r/DESCRIPTION b/pkg-r/DESCRIPTION index 3e35e94e..0a628c52 100644 --- a/pkg-r/DESCRIPTION +++ b/pkg-r/DESCRIPTION @@ -18,6 +18,7 @@ Imports: cli, htmltools, jsonlite, + rlang, shiny (>= 1.13.0), utils Suggests: diff --git a/pkg-r/R/dep.R b/pkg-r/R/dep.R index 50340349..299fbc39 100644 --- a/pkg-r/R/dep.R +++ b/pkg-r/R/dep.R @@ -31,13 +31,36 @@ shinyreact_dep <- function() { # client finds it by id either way, but the two servers disagreed about where a # documented `` tag goes, and `page_react_html()` (via `config_head_dep()`) # already put it in the head. -shinyreact_dep_page <- function() { +# +# `shinyreact_js = "client"` omits shinyreact.js / shinyreact.css for npm-tier +# pages, whose client bundle ships its own copy. The config tag is always +# emitted: the npm client hard-errors without it. +shinyreact_dep_page <- function(shinyreact_js = "server") { htmltools::tagList( - shinyreact_dep(), + if (serves_bundle(shinyreact_js)) shinyreact_dep(), htmltools::tags$head(config_script_tag()) ) } +# Internal: validate `shinyreact_js=` and say whether the page attaches the +# bundle. The one place the value is checked, so every entry point rejects a +# typo the same way. Mirrors Python's `_serves_bundle()`. +serves_bundle <- function(shinyreact_js) { + if ( + !identical(shinyreact_js, "server") && !identical(shinyreact_js, "client") + ) { + cli::cli_abort(c( + "{.arg shinyreact_js} must be {.val server} or {.val client}, + not {.val {shinyreact_js}}.", + "i" = "{.val server} (the default) serves {.file shinyreact.js} from the + shinyreact package -- what a no-build app needs.", + "i" = "{.val client} is for an app whose own bundle imports + {.pkg @posit/shinyreact} and therefore ships its own copy." + )) + } + identical(shinyreact_js, "server") +} + # Internal: the `#shinyreact-config` tag as an htmlDependency `head` entry, for # UIs where a plain tag has no place to land — htmlTemplate() documents render # attached dependencies at the dependency placeholder, and a dependency's `head` diff --git a/pkg-r/R/page.R b/pkg-r/R/page.R index c8d8ccf8..0312c217 100644 --- a/pkg-r/R/page.R +++ b/pkg-r/R/page.R @@ -45,6 +45,14 @@ page_bare <- function(..., title = NULL, lang = "en") { #' that resolves to nothing usable (a missing `src_dir` is not an error — #' the bundle may not be built yet). #' @param lang HTML `lang` attribute. +#' @param shinyreact_js Who supplies `shinyreact.js` (and `shinyreact.css`) to +#' the page. `"server"` (the default) serves them from the shinyreact package +#' as an [htmltools::htmlDependency] — what a no-build app needs, and what +#' makes `window.shinyreact` exist. `"client"` is for an app whose own bundle +#' imports `@posit/shinyreact` and therefore ships its own copy; serving them +#' too would put two copies of React and the hooks on one page. The +#' `#shinyreact-config` tag is emitted either way; the npm-tier client +#' hard-errors without it. Mirrors Python's `page_react(shinyreact_js=)`. #' @return UI suitable for `shinyApp(ui = ...)`. #' @export page_react <- function( @@ -53,7 +61,8 @@ page_react <- function( js_file = "ui.js", css_file = "ui.css", title = NULL, - lang = "en" + lang = "en", + shinyreact_js = "server" ) { base_dir <- if (basename(src_dir) == "www") { @@ -70,7 +79,7 @@ page_react <- function( app_name <- "shinyreact-app" } page_bare( - shinyreact_dep_page(), + shinyreact_dep_page(shinyreact_js = shinyreact_js), page_react_dep( src_dir, js_file = js_file, @@ -134,15 +143,25 @@ page_react <- function( #' #' @param path Path to the HTML document. Defaults to `"www/index.html"`, #' relative to the working directory. +#' @param ... Ignored. #' @param extra_deps A list of additional [htmltools::htmlDependency] objects to #' render at the placeholder. A complete document has no tag tree to attach #' dependencies to, so this is the only way in — the counterpart of #' [page_react()]'s `...`. They render *after* Shiny's and shinyreact's, so #' they can rely on `window.shinyreact` existing. Mirrors Python's #' `page_react_html(extra_deps=)`. +#' @param shinyreact_js Who supplies `shinyreact.js` / `shinyreact.css`: +#' `"server"` (the default) or `"client"` for an npm-tier app whose bundle +#' imports `@posit/shinyreact` — see [page_react()]. #' @return UI suitable for `shinyApp(ui = ...)`. #' @export -page_react_html <- function(path = "www/index.html", extra_deps = NULL) { +page_react_html <- function( + path = "www/index.html", + ..., + extra_deps = NULL, + shinyreact_js = "server" +) { + rlang::check_dots_empty() if (!file.exists(path)) { cli::cli_abort(c( "HTML file not found: {.path {path}}", @@ -167,7 +186,11 @@ page_react_html <- function(path = "www/index.html", extra_deps = NULL) { ui <- htmltools::htmlTemplate(text_ = html, document_ = TRUE) htmltools::attachDependencies( ui, - c(list(shinyreact_dep(), config_head_dep()), extra_deps), + c( + if (serves_bundle(shinyreact_js)) list(shinyreact_dep()), + list(config_head_dep()), + extra_deps + ), append = TRUE ) } diff --git a/pkg-r/inst/lib/shiny/shinyreact.js b/pkg-r/inst/lib/shiny/shinyreact.js index 223504f4..260730d1 100644 --- a/pkg-r/inst/lib/shiny/shinyreact.js +++ b/pkg-r/inst/lib/shiny/shinyreact.js @@ -1,4 +1,4 @@ -var nm=Object.defineProperty;var im=(ue,nt,ae)=>nt in ue?nm(ue,nt,{enumerable:!0,configurable:!0,writable:!0,value:ae}):ue[nt]=ae;var K=(ue,nt,ae)=>im(ue,typeof nt!="symbol"?nt+"":nt,ae);(function(){"use strict";function ue(t,l){for(var e=0;eu[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}function nt(){return window.Shiny}let ae=!1;function jh(){if(typeof document>"u"||ae)return;ae=!0;const t=()=>{const e=nt();e&&(e.addCustomMessageHandler("shinyreact-deps",async u=>{var a,n;try{const i=e;await((a=i.renderDependenciesAsync)==null?void 0:a.call(i,u)),await((n=i.bindAll)==null?void 0:n.call(i,document.documentElement))}catch(i){console.error("[shinyreact] failed to load pushed dependencies:",i)}}),e.initializedPromise.then(()=>{var u;(u=e.setInputValue)==null||u.call(e,".shinyreact_init:shinyreact.init",1)}))};if(nt()){t();return}const l=()=>{nt()&&(document.removeEventListener("shiny:connected",l),t())};document.addEventListener("shiny:connected",l)}function Vf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var jf={exports:{}},D={};/** +var nm=Object.defineProperty;var im=(ue,nt,ae)=>nt in ue?nm(ue,nt,{enumerable:!0,configurable:!0,writable:!0,value:ae}):ue[nt]=ae;var K=(ue,nt,ae)=>im(ue,typeof nt!="symbol"?nt+"":nt,ae);(function(){"use strict";function ue(t,l){for(var e=0;eu[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}function nt(){if(!(typeof window>"u"))return window.Shiny}let ae=!1;function jh(){if(typeof document>"u"||ae)return;ae=!0;const t=()=>{const e=nt();e&&(e.addCustomMessageHandler("shinyreact-deps",async u=>{var a,n;try{const i=e;await((a=i.renderDependenciesAsync)==null?void 0:a.call(i,u)),await((n=i.bindAll)==null?void 0:n.call(i,document.documentElement))}catch(i){console.error("[shinyreact] failed to load pushed dependencies:",i)}}),e.initializedPromise.then(()=>{var u;(u=e.setInputValue)==null||u.call(e,".shinyreact_init:shinyreact.init",1)}))};if(nt()){t();return}const l=()=>{nt()&&(document.removeEventListener("shiny:connected",l),t())};document.addEventListener("shiny:connected",l)}function Vf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var jf={exports:{}},D={};/** * @license React * react.production.js * @@ -14,7 +14,7 @@ var nm=Object.defineProperty;var im=(ue,nt,ae)=>nt in ue?nm(ue,nt,{enumerable:!0 * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(t){function l(T,Y){var N=T.length;T.push(Y);t:for(;0>>1,vt=T[at];if(0>>1;ata(qf,N))Mea($n,qf)?(T[at]=$n,T[Me]=N,at=Me):(T[at]=qf,T[wn]=N,at=wn);else if(Mea($n,N))T[at]=$n,T[Me]=N,at=Me;else break t}}return Y}function a(T,Y){var N=T.sortIndex-Y.sortIndex;return N!==0?N:T.id-Y.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var n=performance;t.unstable_now=function(){return n.now()}}else{var i=Date,c=i.now();t.unstable_now=function(){return i.now()-c}}var f=[],d=[],r=1,m=null,y=3,v=!1,b=!1,p=!1,H=!1,o=typeof setTimeout=="function"?setTimeout:null,s=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;function S(T){for(var Y=e(d);Y!==null;){if(Y.callback===null)u(d);else if(Y.startTime<=T)u(d),Y.sortIndex=Y.expirationTime,l(f,Y);else break;Y=e(d)}}function E(T){if(p=!1,S(T),!b)if(e(f)!==null)b=!0,_||(_=!0,ee());else{var Y=e(d);Y!==null&&Yf(E,Y.startTime-T)}}var _=!1,z=-1,A=5,M=-1;function R(){return H?!0:!(t.unstable_now()-MT&&R());){var at=m.callback;if(typeof at=="function"){m.callback=null,y=m.priorityLevel;var vt=at(m.expirationTime<=T);if(T=t.unstable_now(),typeof vt=="function"){m.callback=vt,S(T),Y=!0;break l}m===e(f)&&u(f),S(T)}else u(f);m=e(f)}if(m!==null)Y=!0;else{var Jn=e(d);Jn!==null&&Yf(E,Jn.startTime-T),Y=!1}}break t}finally{m=null,y=N,v=!1}Y=void 0}}finally{Y?ee():_=!1}}}var ee;if(typeof h=="function")ee=function(){h(It)};else if(typeof MessageChannel<"u"){var Vh=new MessageChannel,am=Vh.port2;Vh.port1.onmessage=It,ee=function(){am.postMessage(null)}}else ee=function(){o(It,0)};function Yf(T,Y){z=o(function(){T(t.unstable_now())},Y)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(T){T.callback=null},t.unstable_forceFrameRate=function(T){0>T||125at?(T.sortIndex=N,l(d,T),e(f)===null&&T===e(d)&&(p?(s(z),z=-1):p=!0,Yf(E,N-at))):(T.sortIndex=vt,l(f,T),b||v||(b=!0,_||(_=!0,ee()))),T},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(T){var Y=y;return function(){var N=y;y=Y;try{return T.apply(this,arguments)}finally{y=N}}}})(If),kf.exports=If;var l0=kf.exports,Pf={exports:{}},zt={};/** + */(function(t){function l(p,Y){var N=p.length;p.push(Y);t:for(;0>>1,vt=p[at];if(0>>1;ata(qf,N))Mea($n,qf)?(p[at]=$n,p[Me]=N,at=Me):(p[at]=qf,p[wn]=N,at=wn);else if(Mea($n,N))p[at]=$n,p[Me]=N,at=Me;else break t}}return Y}function a(p,Y){var N=p.sortIndex-Y.sortIndex;return N!==0?N:p.id-Y.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var n=performance;t.unstable_now=function(){return n.now()}}else{var i=Date,c=i.now();t.unstable_now=function(){return i.now()-c}}var f=[],d=[],r=1,m=null,y=3,v=!1,b=!1,T=!1,H=!1,o=typeof setTimeout=="function"?setTimeout:null,s=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;function S(p){for(var Y=e(d);Y!==null;){if(Y.callback===null)u(d);else if(Y.startTime<=p)u(d),Y.sortIndex=Y.expirationTime,l(f,Y);else break;Y=e(d)}}function E(p){if(T=!1,S(p),!b)if(e(f)!==null)b=!0,_||(_=!0,ee());else{var Y=e(d);Y!==null&&Yf(E,Y.startTime-p)}}var _=!1,z=-1,A=5,M=-1;function R(){return H?!0:!(t.unstable_now()-Mp&&R());){var at=m.callback;if(typeof at=="function"){m.callback=null,y=m.priorityLevel;var vt=at(m.expirationTime<=p);if(p=t.unstable_now(),typeof vt=="function"){m.callback=vt,S(p),Y=!0;break l}m===e(f)&&u(f),S(p)}else u(f);m=e(f)}if(m!==null)Y=!0;else{var Jn=e(d);Jn!==null&&Yf(E,Jn.startTime-p),Y=!1}}break t}finally{m=null,y=N,v=!1}Y=void 0}}finally{Y?ee():_=!1}}}var ee;if(typeof h=="function")ee=function(){h(It)};else if(typeof MessageChannel<"u"){var Vh=new MessageChannel,am=Vh.port2;Vh.port1.onmessage=It,ee=function(){am.postMessage(null)}}else ee=function(){o(It,0)};function Yf(p,Y){z=o(function(){p(t.unstable_now())},Y)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(p){p.callback=null},t.unstable_forceFrameRate=function(p){0>p||125at?(p.sortIndex=N,l(d,p),e(f)===null&&p===e(d)&&(T?(s(z),z=-1):T=!0,Yf(E,N-at))):(p.sortIndex=vt,l(f,p),b||v||(b=!0,_||(_=!0,ee()))),p},t.unstable_shouldYield=R,t.unstable_wrapCallback=function(p){var Y=y;return function(){var N=y;y=Y;try{return p.apply(this,arguments)}finally{y=N}}}})(If),kf.exports=If;var l0=kf.exports,Pf={exports:{}},zt={};/** * @license React * react-dom.production.js * @@ -22,7 +22,7 @@ var nm=Object.defineProperty;var im=(ue,nt,ae)=>nt in ue?nm(ue,nt,{enumerable:!0 * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var e0=V;function ts(t){var l="https://react.dev/errors/"+t;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ls)}catch(t){console.error(t)}}ls(),Pf.exports=zt;var n0=Pf.exports;/** + */var e0=V;function ts(t){var l="https://react.dev/errors/"+t;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ls)}catch(t){console.error(t)}}ls(),Pf.exports=zt;var n0=Pf.exports;/** * @license React * react-dom-client.production.js * @@ -30,15 +30,15 @@ var nm=Object.defineProperty;var im=(ue,nt,ae)=>nt in ue?nm(ue,nt,{enumerable:!0 * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ot=l0,es=V,i0=n0;function g(t){var l="https://react.dev/errors/"+t;if(1Re||(t.current=si[Re],si[Re]=null,Re--)}function w(t,l){Re++,si[Re]=t.current,t.current=l}var ul=el(null),Au=el(null),Hl=el(null),Ta=el(null);function pa(t,l){switch(w(Hl,l),w(Au,t),w(ul,null),l.nodeType){case 9:case 11:t=(t=l.documentElement)&&(t=t.namespaceURI)?qy(t):0;break;default:if(t=l.tagName,l=l.namespaceURI)l=qy(l),t=Vy(l,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}yt(ul),w(ul,t)}function Ne(){yt(ul),yt(Au),yt(Hl)}function oi(t){t.memoizedState!==null&&w(Ta,t);var l=ul.current,e=Vy(l,t.type);l!==e&&(w(Au,t),w(ul,e))}function Aa(t){Au.current===t&&(yt(ul),yt(Au)),Ta.current===t&&(yt(Ta),ha._currentValue=ne)}var di,ds;function ie(t){if(di===void 0)try{throw Error()}catch(e){var l=e.stack.trim().match(/\n( *(at )?)/);di=l&&l[1]||"",ds=-1Re||(t.current=si[Re],si[Re]=null,Re--)}function w(t,l){Re++,si[Re]=t.current,t.current=l}var ul=el(null),Au=el(null),Hl=el(null),pa=el(null);function Ta(t,l){switch(w(Hl,l),w(Au,t),w(ul,null),l.nodeType){case 9:case 11:t=(t=l.documentElement)&&(t=t.namespaceURI)?qy(t):0;break;default:if(t=l.tagName,l=l.namespaceURI)l=qy(l),t=Vy(l,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}yt(ul),w(ul,t)}function Ne(){yt(ul),yt(Au),yt(Hl)}function oi(t){t.memoizedState!==null&&w(pa,t);var l=ul.current,e=Vy(l,t.type);l!==e&&(w(Au,t),w(ul,e))}function Aa(t){Au.current===t&&(yt(ul),yt(Au)),pa.current===t&&(yt(pa),ha._currentValue=ne)}var di,ds;function ie(t){if(di===void 0)try{throw Error()}catch(e){var l=e.stack.trim().match(/\n( *(at )?)/);di=l&&l[1]||"",ds=-1)":-1a||f[u]!==d[a]){var r=` `+f[u].replace(" at new "," at ");return t.displayName&&r.includes("")&&(r=r.replace("",t.displayName)),r}while(1<=u&&0<=a);break}}}finally{yi=!1,Error.prepareStackTrace=e}return(e=t?t.displayName||t.name:"")?ie(e):""}function d0(t,l){switch(t.tag){case 26:case 27:case 5:return ie(t.type);case 16:return ie("Lazy");case 13:return t.child!==l&&l!==null?ie("Suspense Fallback"):ie("Suspense");case 19:return ie("SuspenseList");case 0:case 15:return hi(t.type,!1);case 11:return hi(t.type.render,!1);case 1:return hi(t.type,!0);case 31:return ie("Activity");default:return""}}function ys(t){try{var l="",e=null;do l+=d0(t,e),e=t,t=t.return;while(t);return l}catch(u){return` Error generating stack: `+u.message+` -`+u.stack}}var ri=Object.prototype.hasOwnProperty,vi=ot.unstable_scheduleCallback,mi=ot.unstable_cancelCallback,y0=ot.unstable_shouldYield,h0=ot.unstable_requestPaint,Rt=ot.unstable_now,r0=ot.unstable_getCurrentPriorityLevel,hs=ot.unstable_ImmediatePriority,rs=ot.unstable_UserBlockingPriority,Oa=ot.unstable_NormalPriority,v0=ot.unstable_LowPriority,vs=ot.unstable_IdlePriority,m0=ot.log,S0=ot.unstable_setDisableYieldValue,Ou=null,Nt=null;function Rl(t){if(typeof m0=="function"&&S0(t),Nt&&typeof Nt.setStrictMode=="function")try{Nt.setStrictMode(Ou,t)}catch{}}var Ct=Math.clz32?Math.clz32:E0,g0=Math.log,b0=Math.LN2;function E0(t){return t>>>=0,t===0?32:31-(g0(t)/b0|0)|0}var _a=256,Ma=262144,Da=4194304;function ce(t){var l=t&42;if(l!==0)return l;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ua(t,l,e){var u=t.pendingLanes;if(u===0)return 0;var a=0,n=t.suspendedLanes,i=t.pingedLanes;t=t.warmLanes;var c=u&134217727;return c!==0?(u=c&~n,u!==0?a=ce(u):(i&=c,i!==0?a=ce(i):e||(e=c&~t,e!==0&&(a=ce(e))))):(c=u&~n,c!==0?a=ce(c):i!==0?a=ce(i):e||(e=u&~t,e!==0&&(a=ce(e)))),a===0?0:l!==0&&l!==a&&!(l&n)&&(n=a&-a,e=l&-l,n>=e||n===32&&(e&4194048)!==0)?l:a}function _u(t,l){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&l)===0}function z0(t,l){switch(t){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ms(){var t=Da;return Da<<=1,!(Da&62914560)&&(Da=4194304),t}function Si(t){for(var l=[],e=0;31>e;e++)l.push(t);return l}function Mu(t,l){t.pendingLanes|=l,l!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function T0(t,l,e,u,a,n){var i=t.pendingLanes;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=e,t.entangledLanes&=e,t.errorRecoveryDisabledLanes&=e,t.shellSuspendCounter=0;var c=t.entanglements,f=t.expirationTimes,d=t.hiddenUpdates;for(e=i&~e;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var D0=/[\n"\\]/g;function xt(t){return t.replace(D0,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function pi(t,l,e,u,a,n,i,c){t.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?t.type=i:t.removeAttribute("type"),l!=null?i==="number"?(l===0&&t.value===""||t.value!=l)&&(t.value=""+Zt(l)):t.value!==""+Zt(l)&&(t.value=""+Zt(l)):i!=="submit"&&i!=="reset"||t.removeAttribute("value"),l!=null?Ai(t,i,Zt(l)):e!=null?Ai(t,i,Zt(e)):u!=null&&t.removeAttribute("value"),a==null&&n!=null&&(t.defaultChecked=!!n),a!=null&&(t.checked=a&&typeof a!="function"&&typeof a!="symbol"),c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?t.name=""+Zt(c):t.removeAttribute("name")}function Us(t,l,e,u,a,n,i,c){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(t.type=n),l!=null||e!=null){if(!(n!=="submit"&&n!=="reset"||l!=null)){Ti(t);return}e=e!=null?""+Zt(e):"",l=l!=null?""+Zt(l):e,c||l===t.value||(t.value=l),t.defaultValue=l}u=u??a,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=c?t.checked:!!u,t.defaultChecked=!!u,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.name=i),Ti(t)}function Ai(t,l,e){l==="number"&&Na(t.ownerDocument)===t||t.defaultValue===""+e||(t.defaultValue=""+e)}function je(t,l,e,u){if(t=t.options,l){l={};for(var a=0;a"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ui=!1;if(dl)try{var Ru={};Object.defineProperty(Ru,"passive",{get:function(){Ui=!0}}),window.addEventListener("test",Ru,Ru),window.removeEventListener("test",Ru,Ru)}catch{Ui=!1}var Cl=null,Hi=null,Ba=null;function qs(){if(Ba)return Ba;var t,l=Hi,e=l.length,u,a="value"in Cl?Cl.value:Cl.textContent,n=a.length;for(t=0;t=Bu),Zs=" ",xs=!1;function Ls(t,l){switch(t){case"keyup":return er.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ks(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ze=!1;function ar(t,l){switch(t){case"compositionend":return Ks(l);case"keypress":return l.which!==32?null:(xs=!0,Zs);case"textInput":return t=l.data,t===Zs&&xs?null:t;default:return null}}function nr(t,l){if(Ze)return t==="compositionend"||!Yi&&Ls(t,l)?(t=qs(),Ba=Hi=Cl=null,Ze=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:e,offset:l-t};t=u}t:{for(;e;){if(e.nextSibling){e=e.nextSibling;break t}e=e.parentNode}e=void 0}e=Ps(e)}}function lo(t,l){return t&&l?t===l?!0:t&&t.nodeType===3?!1:l&&l.nodeType===3?lo(t,l.parentNode):"contains"in t?t.contains(l):t.compareDocumentPosition?!!(t.compareDocumentPosition(l)&16):!1:!1}function eo(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var l=Na(t.document);l instanceof t.HTMLIFrameElement;){try{var e=typeof l.contentWindow.location.href=="string"}catch{e=!1}if(e)t=l.contentWindow;else break;l=Na(t.document)}return l}function ji(t){var l=t&&t.nodeName&&t.nodeName.toLowerCase();return l&&(l==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||l==="textarea"||t.contentEditable==="true")}var hr=dl&&"documentMode"in document&&11>=document.documentMode,xe=null,Gi=null,ju=null,Xi=!1;function uo(t,l,e){var u=e.window===e?e.document:e.nodeType===9?e:e.ownerDocument;Xi||xe==null||xe!==Na(u)||(u=xe,"selectionStart"in u&&ji(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),ju&&Vu(ju,u)||(ju=u,u=Dn(Gi,"onSelect"),0>=i,a-=i,al=1<<32-Ct(l)+a|e<A?(M=z,z=null):M=z.sibling;var R=y(o,z,h[A],S);if(R===null){z===null&&(z=M);break}t&&z&&R.alternate===null&&l(o,z),s=n(R,s,A),_===null?E=R:_.sibling=R,_=R,z=M}if(A===h.length)return e(o,z),j&&hl(o,A),E;if(z===null){for(;AA?(M=z,z=null):M=z.sibling;var It=y(o,z,R.value,S);if(It===null){z===null&&(z=M);break}t&&z&&It.alternate===null&&l(o,z),s=n(It,s,A),_===null?E=It:_.sibling=It,_=It,z=M}if(R.done)return e(o,z),j&&hl(o,A),E;if(z===null){for(;!R.done;A++,R=h.next())R=m(o,R.value,S),R!==null&&(s=n(R,s,A),_===null?E=R:_.sibling=R,_=R);return j&&hl(o,A),E}for(z=u(z);!R.done;A++,R=h.next())R=v(z,o,A,R.value,S),R!==null&&(t&&R.alternate!==null&&z.delete(R.key===null?A:R.key),s=n(R,s,A),_===null?E=R:_.sibling=R,_=R);return t&&z.forEach(function(ee){return l(o,ee)}),j&&hl(o,A),E}function H(o,s,h,S){if(typeof h=="object"&&h!==null&&h.type===He&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case za:t:{for(var E=h.key;s!==null;){if(s.key===E){if(E=h.type,E===He){if(s.tag===7){e(o,s.sibling),S=a(s,h.props.children),S.return=o,o=S;break t}}else if(s.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ul&&ge(E)===s.type){e(o,s.sibling),S=a(s,h.props),Lu(S,h),S.return=o,o=S;break t}e(o,s);break}else l(o,s);s=s.sibling}h.type===He?(S=he(h.props.children,o.mode,S,h.key),S.return=o,o=S):(S=La(h.type,h.key,h.props,null,o.mode,S),Lu(S,h),S.return=o,o=S)}return i(o);case zu:t:{for(E=h.key;s!==null;){if(s.key===E)if(s.tag===4&&s.stateNode.containerInfo===h.containerInfo&&s.stateNode.implementation===h.implementation){e(o,s.sibling),S=a(s,h.children||[]),S.return=o,o=S;break t}else{e(o,s);break}else l(o,s);s=s.sibling}S=wi(h,o.mode,S),S.return=o,o=S}return i(o);case Ul:return h=ge(h),H(o,s,h,S)}if(pu(h))return b(o,s,h,S);if(Tu(h)){if(E=Tu(h),typeof E!="function")throw Error(g(150));return h=E.call(h),p(o,s,h,S)}if(typeof h.then=="function")return H(o,s,ka(h),S);if(h.$$typeof===fl)return H(o,s,wa(o,h),S);Ia(o,h)}return typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint"?(h=""+h,s!==null&&s.tag===6?(e(o,s.sibling),S=a(s,h),S.return=o,o=S):(e(o,s),S=Ji(h,o.mode,S),S.return=o,o=S),i(o)):e(o,s)}return function(o,s,h,S){try{xu=0;var E=H(o,s,h,S);return tu=null,E}catch(z){if(z===Pe||z===Wa)throw z;var _=Yt(29,z,null,o.mode);return _.lanes=S,_.return=o,_}finally{}}}var Ee=Mo(!0),Do=Mo(!1),jl=!1;function nc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ic(t,l){t=t.updateQueue,l.updateQueue===t&&(l.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Gl(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Xl(t,l,e){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,X&2){var a=u.pending;return a===null?l.next=l:(l.next=a.next,a.next=l),u.pending=l,l=xa(t),oo(t,null,e),l}return Za(t,u,l,e),xa(t)}function Ku(t,l,e){if(l=l.updateQueue,l!==null&&(l=l.shared,(e&4194048)!==0)){var u=l.lanes;u&=t.pendingLanes,e|=u,l.lanes=e,gs(t,e)}}function cc(t,l){var e=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,e===u)){var a=null,n=null;if(e=e.firstBaseUpdate,e!==null){do{var i={lane:e.lane,tag:e.tag,payload:e.payload,callback:null,next:null};n===null?a=n=i:n=n.next=i,e=e.next}while(e!==null);n===null?a=n=l:n=n.next=l}else a=n=l;e={baseState:u.baseState,firstBaseUpdate:a,lastBaseUpdate:n,shared:u.shared,callbacks:u.callbacks},t.updateQueue=e;return}t=e.lastBaseUpdate,t===null?e.firstBaseUpdate=l:t.next=l,e.lastBaseUpdate=l}var fc=!1;function Ju(){if(fc){var t=Ie;if(t!==null)throw t}}function wu(t,l,e,u){fc=!1;var a=t.updateQueue;jl=!1;var n=a.firstBaseUpdate,i=a.lastBaseUpdate,c=a.shared.pending;if(c!==null){a.shared.pending=null;var f=c,d=f.next;f.next=null,i===null?n=d:i.next=d,i=f;var r=t.alternate;r!==null&&(r=r.updateQueue,c=r.lastBaseUpdate,c!==i&&(c===null?r.firstBaseUpdate=d:c.next=d,r.lastBaseUpdate=f))}if(n!==null){var m=a.baseState;i=0,r=d=f=null,c=n;do{var y=c.lane&-536870913,v=y!==c.lane;if(v?(q&y)===y:(u&y)===y){y!==0&&y===ke&&(fc=!0),r!==null&&(r=r.next={lane:0,tag:c.tag,payload:c.payload,callback:null,next:null});t:{var b=t,p=c;y=l;var H=e;switch(p.tag){case 1:if(b=p.payload,typeof b=="function"){m=b.call(H,m,y);break t}m=b;break t;case 3:b.flags=b.flags&-65537|128;case 0:if(b=p.payload,y=typeof b=="function"?b.call(H,m,y):b,y==null)break t;m=F({},m,y);break t;case 2:jl=!0}}y=c.callback,y!==null&&(t.flags|=64,v&&(t.flags|=8192),v=a.callbacks,v===null?a.callbacks=[y]:v.push(y))}else v={lane:y,tag:c.tag,payload:c.payload,callback:c.callback,next:null},r===null?(d=r=v,f=m):r=r.next=v,i|=y;if(c=c.next,c===null){if(c=a.shared.pending,c===null)break;v=c,c=v.next,v.next=null,a.lastBaseUpdate=v,a.shared.pending=null}}while(!0);r===null&&(f=m),a.baseState=f,a.firstBaseUpdate=d,a.lastBaseUpdate=r,n===null&&(a.shared.lanes=0),Kl|=i,t.lanes=i,t.memoizedState=m}}function Uo(t,l){if(typeof t!="function")throw Error(g(191,t));t.call(l)}function Ho(t,l){var e=t.callbacks;if(e!==null)for(t.callbacks=null,t=0;tn?n:8;var i=O.T,c={};O.T=c,Mc(t,!1,l,e);try{var f=a(),d=O.S;if(d!==null&&d(c,f),f!==null&&typeof f=="object"&&typeof f.then=="function"){var r=Tr(f,u);Fu(t,l,r,Xt(t))}else Fu(t,l,u,Xt(t))}catch(m){Fu(t,l,{then:function(){},status:"rejected",reason:m},Xt())}finally{G.p=n,i!==null&&c.types!==null&&(i.types=c.types),O.T=i}}function Dr(){}function Oc(t,l,e,u){if(t.tag!==5)throw Error(g(476));var a=fd(t).queue;cd(t,a,l,ne,e===null?Dr:function(){return sd(t),e(u)})}function fd(t){var l=t.memoizedState;if(l!==null)return l;l={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sl,lastRenderedState:ne},next:null};var e={};return l.next={memoizedState:e,baseState:e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sl,lastRenderedState:e},next:null},t.memoizedState=l,t=t.alternate,t!==null&&(t.memoizedState=l),l}function sd(t){var l=fd(t);l.next===null&&(l=t.alternate.memoizedState),Fu(t,l.next.queue,{},Xt())}function _c(){return gt(ha)}function od(){return ut().memoizedState}function dd(){return ut().memoizedState}function Ur(t){for(var l=t.return;l!==null;){switch(l.tag){case 24:case 3:var e=Xt();t=Gl(e);var u=Xl(l,t,e);u!==null&&(Ht(u,l,e),Ku(u,l,e)),l={cache:lc()},t.payload=l;return}l=l.return}}function Hr(t,l,e){var u=Xt();e={lane:u,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null},sn(t)?hd(l,e):(e=Li(t,l,e,u),e!==null&&(Ht(e,t,u),rd(e,l,u)))}function yd(t,l,e){var u=Xt();Fu(t,l,e,u)}function Fu(t,l,e,u){var a={lane:u,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null};if(sn(t))hd(l,a);else{var n=t.alternate;if(t.lanes===0&&(n===null||n.lanes===0)&&(n=l.lastRenderedReducer,n!==null))try{var i=l.lastRenderedState,c=n(i,e);if(a.hasEagerState=!0,a.eagerState=c,Bt(c,i))return Za(t,l,a,0),J===null&&Qa(),!1}catch{}finally{}if(e=Li(t,l,a,u),e!==null)return Ht(e,t,u),rd(e,l,u),!0}return!1}function Mc(t,l,e,u){if(u={lane:2,revertLane:nf(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},sn(t)){if(l)throw Error(g(479))}else l=Li(t,e,u,2),l!==null&&Ht(l,t,2)}function sn(t){var l=t.alternate;return t===U||l!==null&&l===U}function hd(t,l){eu=ln=!0;var e=t.pending;e===null?l.next=l:(l.next=e.next,e.next=l),t.pending=l}function rd(t,l,e){if(e&4194048){var u=l.lanes;u&=t.pendingLanes,e|=u,l.lanes=e,gs(t,e)}}var ku={readContext:gt,use:an,useCallback:tt,useContext:tt,useEffect:tt,useImperativeHandle:tt,useLayoutEffect:tt,useInsertionEffect:tt,useMemo:tt,useReducer:tt,useRef:tt,useState:tt,useDebugValue:tt,useDeferredValue:tt,useTransition:tt,useSyncExternalStore:tt,useId:tt,useHostTransitionStatus:tt,useFormState:tt,useActionState:tt,useOptimistic:tt,useMemoCache:tt,useCacheRefresh:tt};ku.useEffectEvent=tt;var vd={readContext:gt,use:an,useCallback:function(t,l){return pt().memoizedState=[t,l===void 0?null:l],t},useContext:gt,useEffect:Io,useImperativeHandle:function(t,l,e){e=e!=null?e.concat([t]):null,cn(4194308,4,ed.bind(null,l,t),e)},useLayoutEffect:function(t,l){return cn(4194308,4,t,l)},useInsertionEffect:function(t,l){cn(4,2,t,l)},useMemo:function(t,l){var e=pt();l=l===void 0?null:l;var u=t();if(ze){Rl(!0);try{t()}finally{Rl(!1)}}return e.memoizedState=[u,l],u},useReducer:function(t,l,e){var u=pt();if(e!==void 0){var a=e(l);if(ze){Rl(!0);try{e(l)}finally{Rl(!1)}}}else a=l;return u.memoizedState=u.baseState=a,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:a},u.queue=t,t=t.dispatch=Hr.bind(null,U,t),[u.memoizedState,t]},useRef:function(t){var l=pt();return t={current:t},l.memoizedState=t},useState:function(t){t=Ec(t);var l=t.queue,e=yd.bind(null,U,l);return l.dispatch=e,[t.memoizedState,e]},useDebugValue:pc,useDeferredValue:function(t,l){var e=pt();return Ac(e,t,l)},useTransition:function(){var t=Ec(!1);return t=cd.bind(null,U,t.queue,!0,!1),pt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,l,e){var u=U,a=pt();if(j){if(e===void 0)throw Error(g(407));e=e()}else{if(e=l(),J===null)throw Error(g(349));q&127||qo(u,l,e)}a.memoizedState=e;var n={value:e,getSnapshot:l};return a.queue=n,Io(jo.bind(null,u,n,t),[t]),u.flags|=2048,au(9,{destroy:void 0},Vo.bind(null,u,n,e,l),null),e},useId:function(){var t=pt(),l=J.identifierPrefix;if(j){var e=nl,u=al;e=(u&~(1<<32-Ct(u)-1)).toString(32)+e,l="_"+l+"R_"+e,e=en++,0<\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof u.is=="string"?i.createElement("select",{is:u.is}):i.createElement("select"),u.multiple?n.multiple=!0:u.size&&(n.size=u.size);break;default:n=typeof u.is=="string"?i.createElement(a,{is:u.is}):i.createElement(a)}}n[mt]=l,n[At]=u;t:for(i=l.child;i!==null;){if(i.tag===5||i.tag===6)n.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break t;for(;i.sibling===null;){if(i.return===null||i.return===l)break t;i=i.return}i.sibling.return=i.return,i=i.sibling}l.stateNode=n;t:switch(Et(n,a,u),a){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break t;case"img":u=!0;break t;default:u=!1}u&&bl(l)}}return I(l),Qc(l,l.type,t===null?null:t.memoizedProps,l.pendingProps,e),null;case 6:if(t&&l.stateNode!=null)t.memoizedProps!==u&&bl(l);else{if(typeof u!="string"&&l.stateNode===null)throw Error(g(166));if(t=Hl.current,We(l)){if(t=l.stateNode,e=l.memoizedProps,u=null,a=St,a!==null)switch(a.tag){case 27:case 5:u=a.memoizedProps}t[mt]=l,t=!!(t.nodeValue===e||u!==null&&u.suppressHydrationWarning===!0||By(t.nodeValue,e)),t||ql(l,!0)}else t=Un(t).createTextNode(u),t[mt]=l,l.stateNode=t}return I(l),null;case 31:if(e=l.memoizedState,t===null||t.memoizedState!==null){if(u=We(l),e!==null){if(t===null){if(!u)throw Error(g(318));if(t=l.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(g(557));t[mt]=l}else re(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;I(l),t=!1}else e=ki(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=e),t=!0;if(!t)return l.flags&256?(Vt(l),l):(Vt(l),null);if(l.flags&128)throw Error(g(558))}return I(l),null;case 13:if(u=l.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(a=We(l),u!==null&&u.dehydrated!==null){if(t===null){if(!a)throw Error(g(318));if(a=l.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(g(317));a[mt]=l}else re(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;I(l),a=!1}else a=ki(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),a=!0;if(!a)return l.flags&256?(Vt(l),l):(Vt(l),null)}return Vt(l),l.flags&128?(l.lanes=e,l):(e=u!==null,t=t!==null&&t.memoizedState!==null,e&&(u=l.child,a=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(a=u.alternate.memoizedState.cachePool.pool),n=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(n=u.memoizedState.cachePool.pool),n!==a&&(u.flags|=2048)),e!==t&&e&&(l.child.flags|=8192),rn(l,l.updateQueue),I(l),null);case 4:return Ne(),t===null&&of(l.stateNode.containerInfo),I(l),null;case 10:return vl(l.type),I(l),null;case 19:if(yt(et),u=l.memoizedState,u===null)return I(l),null;if(a=(l.flags&128)!==0,n=u.rendering,n===null)if(a)Pu(u,!1);else{if(lt!==0||t!==null&&t.flags&128)for(t=l.child;t!==null;){if(n=tn(t),n!==null){for(l.flags|=128,Pu(u,!1),t=n.updateQueue,l.updateQueue=t,rn(l,t),l.subtreeFlags=0,t=e,e=l.child;e!==null;)yo(e,t),e=e.sibling;return w(et,et.current&1|2),j&&hl(l,u.treeForkCount),l.child}t=t.sibling}u.tail!==null&&Rt()>bn&&(l.flags|=128,a=!0,Pu(u,!1),l.lanes=4194304)}else{if(!a)if(t=tn(n),t!==null){if(l.flags|=128,a=!0,t=t.updateQueue,l.updateQueue=t,rn(l,t),Pu(u,!0),u.tail===null&&u.tailMode==="hidden"&&!n.alternate&&!j)return I(l),null}else 2*Rt()-u.renderingStartTime>bn&&e!==536870912&&(l.flags|=128,a=!0,Pu(u,!1),l.lanes=4194304);u.isBackwards?(n.sibling=l.child,l.child=n):(t=u.last,t!==null?t.sibling=n:l.child=n,u.last=n)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=Rt(),t.sibling=null,e=et.current,w(et,a?e&1|2:e&1),j&&hl(l,u.treeForkCount),t):(I(l),null);case 22:case 23:return Vt(l),oc(),u=l.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(l.flags|=8192):u&&(l.flags|=8192),u?e&536870912&&!(l.flags&128)&&(I(l),l.subtreeFlags&6&&(l.flags|=8192)):I(l),e=l.updateQueue,e!==null&&rn(l,e.retryQueue),e=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==e&&(l.flags|=2048),t!==null&&yt(Se),null;case 24:return e=null,t!==null&&(e=t.memoizedState.cache),l.memoizedState.cache!==e&&(l.flags|=2048),vl(it),I(l),null;case 25:return null;case 30:return null}throw Error(g(156,l.tag))}function Yr(t,l){switch(Wi(l),l.tag){case 1:return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 3:return vl(it),Ne(),t=l.flags,t&65536&&!(t&128)?(l.flags=t&-65537|128,l):null;case 26:case 27:case 5:return Aa(l),null;case 31:if(l.memoizedState!==null){if(Vt(l),l.alternate===null)throw Error(g(340));re()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 13:if(Vt(l),t=l.memoizedState,t!==null&&t.dehydrated!==null){if(l.alternate===null)throw Error(g(340));re()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 19:return yt(et),null;case 4:return Ne(),null;case 10:return vl(l.type),null;case 22:case 23:return Vt(l),oc(),t!==null&&yt(Se),t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 24:return vl(it),null;case 25:return null;default:return null}}function Gd(t,l){switch(Wi(l),l.tag){case 3:vl(it),Ne();break;case 26:case 27:case 5:Aa(l);break;case 4:Ne();break;case 31:l.memoizedState!==null&&Vt(l);break;case 13:Vt(l);break;case 19:yt(et);break;case 10:vl(l.type);break;case 22:case 23:Vt(l),oc(),t!==null&&yt(Se);break;case 24:vl(it)}}function ta(t,l){try{var e=l.updateQueue,u=e!==null?e.lastEffect:null;if(u!==null){var a=u.next;e=a;do{if((e.tag&t)===t){u=void 0;var n=e.create,i=e.inst;u=n(),i.destroy=u}e=e.next}while(e!==a)}}catch(c){Z(l,l.return,c)}}function xl(t,l,e){try{var u=l.updateQueue,a=u!==null?u.lastEffect:null;if(a!==null){var n=a.next;u=n;do{if((u.tag&t)===t){var i=u.inst,c=i.destroy;if(c!==void 0){i.destroy=void 0,a=l;var f=e,d=c;try{d()}catch(r){Z(a,f,r)}}}u=u.next}while(u!==n)}}catch(r){Z(l,l.return,r)}}function Xd(t){var l=t.updateQueue;if(l!==null){var e=t.stateNode;try{Ho(l,e)}catch(u){Z(t,t.return,u)}}}function Qd(t,l,e){e.props=Te(t.type,t.memoizedProps),e.state=t.memoizedState;try{e.componentWillUnmount()}catch(u){Z(t,l,u)}}function la(t,l){try{var e=t.ref;if(e!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:u=t.stateNode;break;default:u=t.stateNode}typeof e=="function"?t.refCleanup=e(u):e.current=u}}catch(a){Z(t,l,a)}}function il(t,l){var e=t.ref,u=t.refCleanup;if(e!==null)if(typeof u=="function")try{u()}catch(a){Z(t,l,a)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof e=="function")try{e(null)}catch(a){Z(t,l,a)}else e.current=null}function Zd(t){var l=t.type,e=t.memoizedProps,u=t.stateNode;try{t:switch(l){case"button":case"input":case"select":case"textarea":e.autoFocus&&u.focus();break t;case"img":e.src?u.src=e.src:e.srcSet&&(u.srcset=e.srcSet)}}catch(a){Z(t,t.return,a)}}function Zc(t,l,e){try{var u=t.stateNode;uv(u,t.type,e,l),u[At]=l}catch(a){Z(t,t.return,a)}}function xd(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Fl(t.type)||t.tag===4}function xc(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||xd(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Fl(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Lc(t,l,e){var u=t.tag;if(u===5||u===6)t=t.stateNode,l?(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e).insertBefore(t,l):(l=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.appendChild(t),e=e._reactRootContainer,e!=null||l.onclick!==null||(l.onclick=ol));else if(u!==4&&(u===27&&Fl(t.type)&&(e=t.stateNode,l=null),t=t.child,t!==null))for(Lc(t,l,e),t=t.sibling;t!==null;)Lc(t,l,e),t=t.sibling}function vn(t,l,e){var u=t.tag;if(u===5||u===6)t=t.stateNode,l?e.insertBefore(t,l):e.appendChild(t);else if(u!==4&&(u===27&&Fl(t.type)&&(e=t.stateNode),t=t.child,t!==null))for(vn(t,l,e),t=t.sibling;t!==null;)vn(t,l,e),t=t.sibling}function Ld(t){var l=t.stateNode,e=t.memoizedProps;try{for(var u=t.type,a=l.attributes;a.length;)l.removeAttributeNode(a[0]);Et(l,u,e),l[mt]=t,l[At]=e}catch(n){Z(t,t.return,n)}}var El=!1,st=!1,Kc=!1,Kd=typeof WeakSet=="function"?WeakSet:Set,rt=null;function qr(t,l){if(t=t.containerInfo,hf=qn,t=eo(t),ji(t)){if("selectionStart"in t)var e={start:t.selectionStart,end:t.selectionEnd};else t:{e=(e=t.ownerDocument)&&e.defaultView||window;var u=e.getSelection&&e.getSelection();if(u&&u.rangeCount!==0){e=u.anchorNode;var a=u.anchorOffset,n=u.focusNode;u=u.focusOffset;try{e.nodeType,n.nodeType}catch{e=null;break t}var i=0,c=-1,f=-1,d=0,r=0,m=t,y=null;l:for(;;){for(var v;m!==e||a!==0&&m.nodeType!==3||(c=i+a),m!==n||u!==0&&m.nodeType!==3||(f=i+u),m.nodeType===3&&(i+=m.nodeValue.length),(v=m.firstChild)!==null;)y=m,m=v;for(;;){if(m===t)break l;if(y===e&&++d===a&&(c=i),y===n&&++r===u&&(f=i),(v=m.nextSibling)!==null)break;m=y,y=m.parentNode}m=v}e=c===-1||f===-1?null:{start:c,end:f}}else e=null}e=e||{start:0,end:0}}else e=null;for(rf={focusedElem:t,selectionRange:e},qn=!1,rt=l;rt!==null;)if(l=rt,t=l.child,(l.subtreeFlags&1028)!==0&&t!==null)t.return=l,rt=t;else for(;rt!==null;){switch(l=rt,n=l.alternate,t=l.flags,l.tag){case 0:if(t&4&&(t=l.updateQueue,t=t!==null?t.events:null,t!==null))for(e=0;e title"))),Et(n,u,e),n[mt]=t,ht(n),u=n;break t;case"link":var i=ky("link","href",a).get(u+(e.href||""));if(i){for(var c=0;cH&&(i=H,H=p,p=i);var o=to(c,p),s=to(c,H);if(o&&s&&(v.rangeCount!==1||v.anchorNode!==o.node||v.anchorOffset!==o.offset||v.focusNode!==s.node||v.focusOffset!==s.offset)){var h=m.createRange();h.setStart(o.node,o.offset),v.removeAllRanges(),p>H?(v.addRange(h),v.extend(s.node,s.offset)):(h.setEnd(s.node,s.offset),v.addRange(h))}}}}for(m=[],v=c;v=v.parentNode;)v.nodeType===1&&m.push({element:v,left:v.scrollLeft,top:v.scrollTop});for(typeof c.focus=="function"&&c.focus(),c=0;ce?32:e,O.T=null,e=Ic,Ic=null;var n=wl,i=Ol;if(dt=0,su=wl=null,Ol=0,X&6)throw Error(g(331));var c=X;if(X|=4,ey(n.current),Pd(n,n.current,i,e),X=c,ca(0,!1),Nt&&typeof Nt.onPostCommitFiberRoot=="function")try{Nt.onPostCommitFiberRoot(Ou,n)}catch{}return!0}finally{G.p=a,O.T=u,Ey(t,l)}}function Ty(t,l,e){l=Kt(e,l),l=Rc(t.stateNode,l,2),t=Xl(t,l,2),t!==null&&(Mu(t,2),cl(t))}function Z(t,l,e){if(t.tag===3)Ty(t,t,e);else for(;l!==null;){if(l.tag===3){Ty(l,t,e);break}else if(l.tag===1){var u=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Jl===null||!Jl.has(u))){t=Kt(e,t),e=pd(2),u=Xl(l,e,2),u!==null&&(Ad(e,u,l,t),Mu(u,2),cl(u));break}}l=l.return}}function ef(t,l,e){var u=t.pingCache;if(u===null){u=t.pingCache=new Gr;var a=new Set;u.set(l,a)}else a=u.get(l),a===void 0&&(a=new Set,u.set(l,a));a.has(e)||($c=!0,a.add(e),t=Lr.bind(null,t,l,e),l.then(t,t))}function Lr(t,l,e){var u=t.pingCache;u!==null&&u.delete(l),t.pingedLanes|=t.suspendedLanes&e,t.warmLanes&=~e,J===t&&(q&e)===e&&(lt===4||lt===3&&(q&62914560)===q&&300>Rt()-gn?!(X&2)&&ou(t,0):Wc|=e,fu===q&&(fu=0)),cl(t)}function py(t,l){l===0&&(l=ms()),t=ye(t,l),t!==null&&(Mu(t,l),cl(t))}function Kr(t){var l=t.memoizedState,e=0;l!==null&&(e=l.retryLane),py(t,e)}function Jr(t,l){var e=0;switch(t.tag){case 31:case 13:var u=t.stateNode,a=t.memoizedState;a!==null&&(e=a.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(g(314))}u!==null&&u.delete(l),py(t,e)}function wr(t,l){return vi(t,l)}var On=null,yu=null,uf=!1,_n=!1,af=!1,Wl=0;function cl(t){t!==yu&&t.next===null&&(yu===null?On=yu=t:yu=yu.next=t),_n=!0,uf||(uf=!0,Wr())}function ca(t,l){if(!af&&_n){af=!0;do for(var e=!1,u=On;u!==null;){if(t!==0){var a=u.pendingLanes;if(a===0)var n=0;else{var i=u.suspendedLanes,c=u.pingedLanes;n=(1<<31-Ct(42|t)+1)-1,n&=a&~(i&~c),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(e=!0,My(u,n))}else n=q,n=Ua(u,u===J?n:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),!(n&3)||_u(u,n)||(e=!0,My(u,n));u=u.next}while(e);af=!1}}function $r(){Ay()}function Ay(){_n=uf=!1;var t=0;Wl!==0&&nv()&&(t=Wl);for(var l=Rt(),e=null,u=On;u!==null;){var a=u.next,n=Oy(u,l);n===0?(u.next=null,e===null?On=a:e.next=a,a===null&&(yu=e)):(e=u,(t!==0||n&3)&&(_n=!0)),u=a}dt!==0&&dt!==5||ca(t),Wl!==0&&(Wl=0)}function Oy(t,l){for(var e=t.suspendedLanes,u=t.pingedLanes,a=t.expirationTimes,n=t.pendingLanes&-62914561;0c)break;var r=f.transferSize,m=f.initiatorType;r&&Yy(m)&&(f=f.responseEnd,i+=r*(f"u"?null:document;function wy(t,l,e){var u=hu;if(u&&typeof l=="string"&&l){var a=xt(l);a='link[rel="'+t+'"][href="'+a+'"]',typeof e=="string"&&(a+='[crossorigin="'+e+'"]'),Jy.has(a)||(Jy.add(a),t={rel:t,crossOrigin:e,href:l},u.querySelector(a)===null&&(l=u.createElement("link"),Et(l,"link",t),ht(l),u.head.appendChild(l)))}}function rv(t){_l.D(t),wy("dns-prefetch",t,null)}function vv(t,l){_l.C(t,l),wy("preconnect",t,l)}function mv(t,l,e){_l.L(t,l,e);var u=hu;if(u&&t&&l){var a='link[rel="preload"][as="'+xt(l)+'"]';l==="image"&&e&&e.imageSrcSet?(a+='[imagesrcset="'+xt(e.imageSrcSet)+'"]',typeof e.imageSizes=="string"&&(a+='[imagesizes="'+xt(e.imageSizes)+'"]')):a+='[href="'+xt(t)+'"]';var n=a;switch(l){case"style":n=ru(t);break;case"script":n=vu(t)}kt.has(n)||(t=F({rel:"preload",href:l==="image"&&e&&e.imageSrcSet?void 0:t,as:l},e),kt.set(n,t),u.querySelector(a)!==null||l==="style"&&u.querySelector(da(n))||l==="script"&&u.querySelector(ya(n))||(l=u.createElement("link"),Et(l,"link",t),ht(l),u.head.appendChild(l)))}}function Sv(t,l){_l.m(t,l);var e=hu;if(e&&t){var u=l&&typeof l.as=="string"?l.as:"script",a='link[rel="modulepreload"][as="'+xt(u)+'"][href="'+xt(t)+'"]',n=a;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=vu(t)}if(!kt.has(n)&&(t=F({rel:"modulepreload",href:t},l),kt.set(n,t),e.querySelector(a)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(e.querySelector(ya(n)))return}u=e.createElement("link"),Et(u,"link",t),ht(u),e.head.appendChild(u)}}}function gv(t,l,e){_l.S(t,l,e);var u=hu;if(u&&t){var a=qe(u).hoistableStyles,n=ru(t);l=l||"default";var i=a.get(n);if(!i){var c={loading:0,preload:null};if(i=u.querySelector(da(n)))c.loading=5;else{t=F({rel:"stylesheet",href:t,"data-precedence":l},e),(e=kt.get(n))&&zf(t,e);var f=i=u.createElement("link");ht(f),Et(f,"link",t),f._p=new Promise(function(d,r){f.onload=d,f.onerror=r}),f.addEventListener("load",function(){c.loading|=1}),f.addEventListener("error",function(){c.loading|=2}),c.loading|=4,Rn(i,l,u)}i={type:"stylesheet",instance:i,count:1,state:c},a.set(n,i)}}}function bv(t,l){_l.X(t,l);var e=hu;if(e&&t){var u=qe(e).hoistableScripts,a=vu(t),n=u.get(a);n||(n=e.querySelector(ya(a)),n||(t=F({src:t,async:!0},l),(l=kt.get(a))&&Tf(t,l),n=e.createElement("script"),ht(n),Et(n,"link",t),e.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},u.set(a,n))}}function Ev(t,l){_l.M(t,l);var e=hu;if(e&&t){var u=qe(e).hoistableScripts,a=vu(t),n=u.get(a);n||(n=e.querySelector(ya(a)),n||(t=F({src:t,async:!0,type:"module"},l),(l=kt.get(a))&&Tf(t,l),n=e.createElement("script"),ht(n),Et(n,"link",t),e.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},u.set(a,n))}}function $y(t,l,e,u){var a=(a=Hl.current)?Hn(a):null;if(!a)throw Error(g(446));switch(t){case"meta":case"title":return null;case"style":return typeof e.precedence=="string"&&typeof e.href=="string"?(l=ru(e.href),e=qe(a).hoistableStyles,u=e.get(l),u||(u={type:"style",instance:null,count:0,state:null},e.set(l,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(e.rel==="stylesheet"&&typeof e.href=="string"&&typeof e.precedence=="string"){t=ru(e.href);var n=qe(a).hoistableStyles,i=n.get(t);if(i||(a=a.ownerDocument||a,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(t,i),(n=a.querySelector(da(t)))&&!n._p&&(i.instance=n,i.state.loading=5),kt.has(t)||(e={rel:"preload",as:"style",href:e.href,crossOrigin:e.crossOrigin,integrity:e.integrity,media:e.media,hrefLang:e.hrefLang,referrerPolicy:e.referrerPolicy},kt.set(t,e),n||zv(a,t,e,i.state))),l&&u===null)throw Error(g(528,""));return i}if(l&&u!==null)throw Error(g(529,""));return null;case"script":return l=e.async,e=e.src,typeof e=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=vu(e),e=qe(a).hoistableScripts,u=e.get(l),u||(u={type:"script",instance:null,count:0,state:null},e.set(l,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(g(444,t))}}function ru(t){return'href="'+xt(t)+'"'}function da(t){return'link[rel="stylesheet"]['+t+"]"}function Wy(t){return F({},t,{"data-precedence":t.precedence,precedence:null})}function zv(t,l,e,u){t.querySelector('link[rel="preload"][as="style"]['+l+"]")?u.loading=1:(l=t.createElement("link"),u.preload=l,l.addEventListener("load",function(){return u.loading|=1}),l.addEventListener("error",function(){return u.loading|=2}),Et(l,"link",e),ht(l),t.head.appendChild(l))}function vu(t){return'[src="'+xt(t)+'"]'}function ya(t){return"script[async]"+t}function Fy(t,l,e){if(l.count++,l.instance===null)switch(l.type){case"style":var u=t.querySelector('style[data-href~="'+xt(e.href)+'"]');if(u)return l.instance=u,ht(u),u;var a=F({},e,{"data-href":e.href,"data-precedence":e.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),ht(u),Et(u,"style",a),Rn(u,e.precedence,t),l.instance=u;case"stylesheet":a=ru(e.href);var n=t.querySelector(da(a));if(n)return l.state.loading|=4,l.instance=n,ht(n),n;u=Wy(e),(a=kt.get(a))&&zf(u,a),n=(t.ownerDocument||t).createElement("link"),ht(n);var i=n;return i._p=new Promise(function(c,f){i.onload=c,i.onerror=f}),Et(n,"link",u),l.state.loading|=4,Rn(n,e.precedence,t),l.instance=n;case"script":return n=vu(e.src),(a=t.querySelector(ya(n)))?(l.instance=a,ht(a),a):(u=e,(a=kt.get(n))&&(u=F({},e),Tf(u,a)),t=t.ownerDocument||t,a=t.createElement("script"),ht(a),Et(a,"link",u),t.head.appendChild(a),l.instance=a);case"void":return null;default:throw Error(g(443,l.type))}else l.type==="stylesheet"&&!(l.state.loading&4)&&(u=l.instance,l.state.loading|=4,Rn(u,e.precedence,t));return l.instance}function Rn(t,l,e){for(var u=e.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=u.length?u[u.length-1]:null,n=a,i=0;i title"):null)}function Tv(t,l,e){if(e===1||l.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return t=l.disabled,typeof l.precedence=="string"&&t==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function Py(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}function pv(t,l,e,u){if(e.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&!(e.state.loading&4)){if(e.instance===null){var a=ru(u.href),n=l.querySelector(da(a));if(n){l=n._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(t.count++,t=Cn.bind(t),l.then(t,t)),e.state.loading|=4,e.instance=n,ht(n);return}n=l.ownerDocument||l,u=Wy(u),(a=kt.get(a))&&zf(u,a),n=n.createElement("link"),ht(n);var i=n;i._p=new Promise(function(c,f){i.onload=c,i.onerror=f}),Et(n,"link",u),e.instance=n}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(e,l),(l=e.state.preload)&&!(e.state.loading&3)&&(t.count++,e=Cn.bind(t),l.addEventListener("load",e),l.addEventListener("error",e))}}var pf=0;function Av(t,l){return t.stylesheets&&t.count===0&&Yn(t,t.stylesheets),0pf?50:800)+l);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(a)}}:null}function Cn(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yn(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Bn=null;function Yn(t,l){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Bn=new Map,l.forEach(Ov,t),Bn=null,Cn.call(t))}function Ov(t,l){if(!(l.state.loading&4)){var e=Bn.get(t);if(e)var u=e.get(null);else{e=new Map,Bn.set(t,e);for(var a=t.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hh)}catch(t){console.error(t)}}hh(),Ff.exports=ba;var Hf=Ff.exports;const Cv=ue({__proto__:null,default:Vf(Hf)},[Hf]);var rh={exports:{}},xn={};/** +`+u.stack}}var ri=Object.prototype.hasOwnProperty,vi=ot.unstable_scheduleCallback,mi=ot.unstable_cancelCallback,y0=ot.unstable_shouldYield,h0=ot.unstable_requestPaint,Rt=ot.unstable_now,r0=ot.unstable_getCurrentPriorityLevel,hs=ot.unstable_ImmediatePriority,rs=ot.unstable_UserBlockingPriority,Oa=ot.unstable_NormalPriority,v0=ot.unstable_LowPriority,vs=ot.unstable_IdlePriority,m0=ot.log,S0=ot.unstable_setDisableYieldValue,Ou=null,Nt=null;function Rl(t){if(typeof m0=="function"&&S0(t),Nt&&typeof Nt.setStrictMode=="function")try{Nt.setStrictMode(Ou,t)}catch{}}var Ct=Math.clz32?Math.clz32:E0,g0=Math.log,b0=Math.LN2;function E0(t){return t>>>=0,t===0?32:31-(g0(t)/b0|0)|0}var _a=256,Ma=262144,Da=4194304;function ce(t){var l=t&42;if(l!==0)return l;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ua(t,l,e){var u=t.pendingLanes;if(u===0)return 0;var a=0,n=t.suspendedLanes,i=t.pingedLanes;t=t.warmLanes;var c=u&134217727;return c!==0?(u=c&~n,u!==0?a=ce(u):(i&=c,i!==0?a=ce(i):e||(e=c&~t,e!==0&&(a=ce(e))))):(c=u&~n,c!==0?a=ce(c):i!==0?a=ce(i):e||(e=u&~t,e!==0&&(a=ce(e)))),a===0?0:l!==0&&l!==a&&!(l&n)&&(n=a&-a,e=l&-l,n>=e||n===32&&(e&4194048)!==0)?l:a}function _u(t,l){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&l)===0}function z0(t,l){switch(t){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ms(){var t=Da;return Da<<=1,!(Da&62914560)&&(Da=4194304),t}function Si(t){for(var l=[],e=0;31>e;e++)l.push(t);return l}function Mu(t,l){t.pendingLanes|=l,l!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function p0(t,l,e,u,a,n){var i=t.pendingLanes;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=e,t.entangledLanes&=e,t.errorRecoveryDisabledLanes&=e,t.shellSuspendCounter=0;var c=t.entanglements,f=t.expirationTimes,d=t.hiddenUpdates;for(e=i&~e;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var D0=/[\n"\\]/g;function xt(t){return t.replace(D0,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Ti(t,l,e,u,a,n,i,c){t.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?t.type=i:t.removeAttribute("type"),l!=null?i==="number"?(l===0&&t.value===""||t.value!=l)&&(t.value=""+Zt(l)):t.value!==""+Zt(l)&&(t.value=""+Zt(l)):i!=="submit"&&i!=="reset"||t.removeAttribute("value"),l!=null?Ai(t,i,Zt(l)):e!=null?Ai(t,i,Zt(e)):u!=null&&t.removeAttribute("value"),a==null&&n!=null&&(t.defaultChecked=!!n),a!=null&&(t.checked=a&&typeof a!="function"&&typeof a!="symbol"),c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?t.name=""+Zt(c):t.removeAttribute("name")}function Us(t,l,e,u,a,n,i,c){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(t.type=n),l!=null||e!=null){if(!(n!=="submit"&&n!=="reset"||l!=null)){pi(t);return}e=e!=null?""+Zt(e):"",l=l!=null?""+Zt(l):e,c||l===t.value||(t.value=l),t.defaultValue=l}u=u??a,u=typeof u!="function"&&typeof u!="symbol"&&!!u,t.checked=c?t.checked:!!u,t.defaultChecked=!!u,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(t.name=i),pi(t)}function Ai(t,l,e){l==="number"&&Na(t.ownerDocument)===t||t.defaultValue===""+e||(t.defaultValue=""+e)}function je(t,l,e,u){if(t=t.options,l){l={};for(var a=0;a"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ui=!1;if(dl)try{var Ru={};Object.defineProperty(Ru,"passive",{get:function(){Ui=!0}}),window.addEventListener("test",Ru,Ru),window.removeEventListener("test",Ru,Ru)}catch{Ui=!1}var Cl=null,Hi=null,Ba=null;function qs(){if(Ba)return Ba;var t,l=Hi,e=l.length,u,a="value"in Cl?Cl.value:Cl.textContent,n=a.length;for(t=0;t=Bu),Zs=" ",xs=!1;function Ls(t,l){switch(t){case"keyup":return er.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ks(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ze=!1;function ar(t,l){switch(t){case"compositionend":return Ks(l);case"keypress":return l.which!==32?null:(xs=!0,Zs);case"textInput":return t=l.data,t===Zs&&xs?null:t;default:return null}}function nr(t,l){if(Ze)return t==="compositionend"||!Yi&&Ls(t,l)?(t=qs(),Ba=Hi=Cl=null,Ze=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1=l)return{node:e,offset:l-t};t=u}t:{for(;e;){if(e.nextSibling){e=e.nextSibling;break t}e=e.parentNode}e=void 0}e=Ps(e)}}function lo(t,l){return t&&l?t===l?!0:t&&t.nodeType===3?!1:l&&l.nodeType===3?lo(t,l.parentNode):"contains"in t?t.contains(l):t.compareDocumentPosition?!!(t.compareDocumentPosition(l)&16):!1:!1}function eo(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var l=Na(t.document);l instanceof t.HTMLIFrameElement;){try{var e=typeof l.contentWindow.location.href=="string"}catch{e=!1}if(e)t=l.contentWindow;else break;l=Na(t.document)}return l}function ji(t){var l=t&&t.nodeName&&t.nodeName.toLowerCase();return l&&(l==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||l==="textarea"||t.contentEditable==="true")}var hr=dl&&"documentMode"in document&&11>=document.documentMode,xe=null,Gi=null,ju=null,Xi=!1;function uo(t,l,e){var u=e.window===e?e.document:e.nodeType===9?e:e.ownerDocument;Xi||xe==null||xe!==Na(u)||(u=xe,"selectionStart"in u&&ji(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),ju&&Vu(ju,u)||(ju=u,u=Dn(Gi,"onSelect"),0>=i,a-=i,al=1<<32-Ct(l)+a|e<A?(M=z,z=null):M=z.sibling;var R=y(o,z,h[A],S);if(R===null){z===null&&(z=M);break}t&&z&&R.alternate===null&&l(o,z),s=n(R,s,A),_===null?E=R:_.sibling=R,_=R,z=M}if(A===h.length)return e(o,z),j&&hl(o,A),E;if(z===null){for(;AA?(M=z,z=null):M=z.sibling;var It=y(o,z,R.value,S);if(It===null){z===null&&(z=M);break}t&&z&&It.alternate===null&&l(o,z),s=n(It,s,A),_===null?E=It:_.sibling=It,_=It,z=M}if(R.done)return e(o,z),j&&hl(o,A),E;if(z===null){for(;!R.done;A++,R=h.next())R=m(o,R.value,S),R!==null&&(s=n(R,s,A),_===null?E=R:_.sibling=R,_=R);return j&&hl(o,A),E}for(z=u(z);!R.done;A++,R=h.next())R=v(z,o,A,R.value,S),R!==null&&(t&&R.alternate!==null&&z.delete(R.key===null?A:R.key),s=n(R,s,A),_===null?E=R:_.sibling=R,_=R);return t&&z.forEach(function(ee){return l(o,ee)}),j&&hl(o,A),E}function H(o,s,h,S){if(typeof h=="object"&&h!==null&&h.type===He&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case za:t:{for(var E=h.key;s!==null;){if(s.key===E){if(E=h.type,E===He){if(s.tag===7){e(o,s.sibling),S=a(s,h.props.children),S.return=o,o=S;break t}}else if(s.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ul&&ge(E)===s.type){e(o,s.sibling),S=a(s,h.props),Lu(S,h),S.return=o,o=S;break t}e(o,s);break}else l(o,s);s=s.sibling}h.type===He?(S=he(h.props.children,o.mode,S,h.key),S.return=o,o=S):(S=La(h.type,h.key,h.props,null,o.mode,S),Lu(S,h),S.return=o,o=S)}return i(o);case zu:t:{for(E=h.key;s!==null;){if(s.key===E)if(s.tag===4&&s.stateNode.containerInfo===h.containerInfo&&s.stateNode.implementation===h.implementation){e(o,s.sibling),S=a(s,h.children||[]),S.return=o,o=S;break t}else{e(o,s);break}else l(o,s);s=s.sibling}S=wi(h,o.mode,S),S.return=o,o=S}return i(o);case Ul:return h=ge(h),H(o,s,h,S)}if(Tu(h))return b(o,s,h,S);if(pu(h)){if(E=pu(h),typeof E!="function")throw Error(g(150));return h=E.call(h),T(o,s,h,S)}if(typeof h.then=="function")return H(o,s,ka(h),S);if(h.$$typeof===fl)return H(o,s,wa(o,h),S);Ia(o,h)}return typeof h=="string"&&h!==""||typeof h=="number"||typeof h=="bigint"?(h=""+h,s!==null&&s.tag===6?(e(o,s.sibling),S=a(s,h),S.return=o,o=S):(e(o,s),S=Ji(h,o.mode,S),S.return=o,o=S),i(o)):e(o,s)}return function(o,s,h,S){try{xu=0;var E=H(o,s,h,S);return tu=null,E}catch(z){if(z===Pe||z===Wa)throw z;var _=Yt(29,z,null,o.mode);return _.lanes=S,_.return=o,_}finally{}}}var Ee=Mo(!0),Do=Mo(!1),jl=!1;function nc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ic(t,l){t=t.updateQueue,l.updateQueue===t&&(l.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Gl(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Xl(t,l,e){var u=t.updateQueue;if(u===null)return null;if(u=u.shared,X&2){var a=u.pending;return a===null?l.next=l:(l.next=a.next,a.next=l),u.pending=l,l=xa(t),oo(t,null,e),l}return Za(t,u,l,e),xa(t)}function Ku(t,l,e){if(l=l.updateQueue,l!==null&&(l=l.shared,(e&4194048)!==0)){var u=l.lanes;u&=t.pendingLanes,e|=u,l.lanes=e,gs(t,e)}}function cc(t,l){var e=t.updateQueue,u=t.alternate;if(u!==null&&(u=u.updateQueue,e===u)){var a=null,n=null;if(e=e.firstBaseUpdate,e!==null){do{var i={lane:e.lane,tag:e.tag,payload:e.payload,callback:null,next:null};n===null?a=n=i:n=n.next=i,e=e.next}while(e!==null);n===null?a=n=l:n=n.next=l}else a=n=l;e={baseState:u.baseState,firstBaseUpdate:a,lastBaseUpdate:n,shared:u.shared,callbacks:u.callbacks},t.updateQueue=e;return}t=e.lastBaseUpdate,t===null?e.firstBaseUpdate=l:t.next=l,e.lastBaseUpdate=l}var fc=!1;function Ju(){if(fc){var t=Ie;if(t!==null)throw t}}function wu(t,l,e,u){fc=!1;var a=t.updateQueue;jl=!1;var n=a.firstBaseUpdate,i=a.lastBaseUpdate,c=a.shared.pending;if(c!==null){a.shared.pending=null;var f=c,d=f.next;f.next=null,i===null?n=d:i.next=d,i=f;var r=t.alternate;r!==null&&(r=r.updateQueue,c=r.lastBaseUpdate,c!==i&&(c===null?r.firstBaseUpdate=d:c.next=d,r.lastBaseUpdate=f))}if(n!==null){var m=a.baseState;i=0,r=d=f=null,c=n;do{var y=c.lane&-536870913,v=y!==c.lane;if(v?(q&y)===y:(u&y)===y){y!==0&&y===ke&&(fc=!0),r!==null&&(r=r.next={lane:0,tag:c.tag,payload:c.payload,callback:null,next:null});t:{var b=t,T=c;y=l;var H=e;switch(T.tag){case 1:if(b=T.payload,typeof b=="function"){m=b.call(H,m,y);break t}m=b;break t;case 3:b.flags=b.flags&-65537|128;case 0:if(b=T.payload,y=typeof b=="function"?b.call(H,m,y):b,y==null)break t;m=F({},m,y);break t;case 2:jl=!0}}y=c.callback,y!==null&&(t.flags|=64,v&&(t.flags|=8192),v=a.callbacks,v===null?a.callbacks=[y]:v.push(y))}else v={lane:y,tag:c.tag,payload:c.payload,callback:c.callback,next:null},r===null?(d=r=v,f=m):r=r.next=v,i|=y;if(c=c.next,c===null){if(c=a.shared.pending,c===null)break;v=c,c=v.next,v.next=null,a.lastBaseUpdate=v,a.shared.pending=null}}while(!0);r===null&&(f=m),a.baseState=f,a.firstBaseUpdate=d,a.lastBaseUpdate=r,n===null&&(a.shared.lanes=0),Kl|=i,t.lanes=i,t.memoizedState=m}}function Uo(t,l){if(typeof t!="function")throw Error(g(191,t));t.call(l)}function Ho(t,l){var e=t.callbacks;if(e!==null)for(t.callbacks=null,t=0;tn?n:8;var i=O.T,c={};O.T=c,Mc(t,!1,l,e);try{var f=a(),d=O.S;if(d!==null&&d(c,f),f!==null&&typeof f=="object"&&typeof f.then=="function"){var r=pr(f,u);Fu(t,l,r,Xt(t))}else Fu(t,l,u,Xt(t))}catch(m){Fu(t,l,{then:function(){},status:"rejected",reason:m},Xt())}finally{G.p=n,i!==null&&c.types!==null&&(i.types=c.types),O.T=i}}function Dr(){}function Oc(t,l,e,u){if(t.tag!==5)throw Error(g(476));var a=fd(t).queue;cd(t,a,l,ne,e===null?Dr:function(){return sd(t),e(u)})}function fd(t){var l=t.memoizedState;if(l!==null)return l;l={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sl,lastRenderedState:ne},next:null};var e={};return l.next={memoizedState:e,baseState:e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sl,lastRenderedState:e},next:null},t.memoizedState=l,t=t.alternate,t!==null&&(t.memoizedState=l),l}function sd(t){var l=fd(t);l.next===null&&(l=t.alternate.memoizedState),Fu(t,l.next.queue,{},Xt())}function _c(){return gt(ha)}function od(){return ut().memoizedState}function dd(){return ut().memoizedState}function Ur(t){for(var l=t.return;l!==null;){switch(l.tag){case 24:case 3:var e=Xt();t=Gl(e);var u=Xl(l,t,e);u!==null&&(Ht(u,l,e),Ku(u,l,e)),l={cache:lc()},t.payload=l;return}l=l.return}}function Hr(t,l,e){var u=Xt();e={lane:u,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null},sn(t)?hd(l,e):(e=Li(t,l,e,u),e!==null&&(Ht(e,t,u),rd(e,l,u)))}function yd(t,l,e){var u=Xt();Fu(t,l,e,u)}function Fu(t,l,e,u){var a={lane:u,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null};if(sn(t))hd(l,a);else{var n=t.alternate;if(t.lanes===0&&(n===null||n.lanes===0)&&(n=l.lastRenderedReducer,n!==null))try{var i=l.lastRenderedState,c=n(i,e);if(a.hasEagerState=!0,a.eagerState=c,Bt(c,i))return Za(t,l,a,0),J===null&&Qa(),!1}catch{}finally{}if(e=Li(t,l,a,u),e!==null)return Ht(e,t,u),rd(e,l,u),!0}return!1}function Mc(t,l,e,u){if(u={lane:2,revertLane:nf(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},sn(t)){if(l)throw Error(g(479))}else l=Li(t,e,u,2),l!==null&&Ht(l,t,2)}function sn(t){var l=t.alternate;return t===U||l!==null&&l===U}function hd(t,l){eu=ln=!0;var e=t.pending;e===null?l.next=l:(l.next=e.next,e.next=l),t.pending=l}function rd(t,l,e){if(e&4194048){var u=l.lanes;u&=t.pendingLanes,e|=u,l.lanes=e,gs(t,e)}}var ku={readContext:gt,use:an,useCallback:tt,useContext:tt,useEffect:tt,useImperativeHandle:tt,useLayoutEffect:tt,useInsertionEffect:tt,useMemo:tt,useReducer:tt,useRef:tt,useState:tt,useDebugValue:tt,useDeferredValue:tt,useTransition:tt,useSyncExternalStore:tt,useId:tt,useHostTransitionStatus:tt,useFormState:tt,useActionState:tt,useOptimistic:tt,useMemoCache:tt,useCacheRefresh:tt};ku.useEffectEvent=tt;var vd={readContext:gt,use:an,useCallback:function(t,l){return Tt().memoizedState=[t,l===void 0?null:l],t},useContext:gt,useEffect:Io,useImperativeHandle:function(t,l,e){e=e!=null?e.concat([t]):null,cn(4194308,4,ed.bind(null,l,t),e)},useLayoutEffect:function(t,l){return cn(4194308,4,t,l)},useInsertionEffect:function(t,l){cn(4,2,t,l)},useMemo:function(t,l){var e=Tt();l=l===void 0?null:l;var u=t();if(ze){Rl(!0);try{t()}finally{Rl(!1)}}return e.memoizedState=[u,l],u},useReducer:function(t,l,e){var u=Tt();if(e!==void 0){var a=e(l);if(ze){Rl(!0);try{e(l)}finally{Rl(!1)}}}else a=l;return u.memoizedState=u.baseState=a,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:a},u.queue=t,t=t.dispatch=Hr.bind(null,U,t),[u.memoizedState,t]},useRef:function(t){var l=Tt();return t={current:t},l.memoizedState=t},useState:function(t){t=Ec(t);var l=t.queue,e=yd.bind(null,U,l);return l.dispatch=e,[t.memoizedState,e]},useDebugValue:Tc,useDeferredValue:function(t,l){var e=Tt();return Ac(e,t,l)},useTransition:function(){var t=Ec(!1);return t=cd.bind(null,U,t.queue,!0,!1),Tt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,l,e){var u=U,a=Tt();if(j){if(e===void 0)throw Error(g(407));e=e()}else{if(e=l(),J===null)throw Error(g(349));q&127||qo(u,l,e)}a.memoizedState=e;var n={value:e,getSnapshot:l};return a.queue=n,Io(jo.bind(null,u,n,t),[t]),u.flags|=2048,au(9,{destroy:void 0},Vo.bind(null,u,n,e,l),null),e},useId:function(){var t=Tt(),l=J.identifierPrefix;if(j){var e=nl,u=al;e=(u&~(1<<32-Ct(u)-1)).toString(32)+e,l="_"+l+"R_"+e,e=en++,0<\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof u.is=="string"?i.createElement("select",{is:u.is}):i.createElement("select"),u.multiple?n.multiple=!0:u.size&&(n.size=u.size);break;default:n=typeof u.is=="string"?i.createElement(a,{is:u.is}):i.createElement(a)}}n[mt]=l,n[At]=u;t:for(i=l.child;i!==null;){if(i.tag===5||i.tag===6)n.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break t;for(;i.sibling===null;){if(i.return===null||i.return===l)break t;i=i.return}i.sibling.return=i.return,i=i.sibling}l.stateNode=n;t:switch(Et(n,a,u),a){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break t;case"img":u=!0;break t;default:u=!1}u&&bl(l)}}return I(l),Qc(l,l.type,t===null?null:t.memoizedProps,l.pendingProps,e),null;case 6:if(t&&l.stateNode!=null)t.memoizedProps!==u&&bl(l);else{if(typeof u!="string"&&l.stateNode===null)throw Error(g(166));if(t=Hl.current,We(l)){if(t=l.stateNode,e=l.memoizedProps,u=null,a=St,a!==null)switch(a.tag){case 27:case 5:u=a.memoizedProps}t[mt]=l,t=!!(t.nodeValue===e||u!==null&&u.suppressHydrationWarning===!0||By(t.nodeValue,e)),t||ql(l,!0)}else t=Un(t).createTextNode(u),t[mt]=l,l.stateNode=t}return I(l),null;case 31:if(e=l.memoizedState,t===null||t.memoizedState!==null){if(u=We(l),e!==null){if(t===null){if(!u)throw Error(g(318));if(t=l.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(g(557));t[mt]=l}else re(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;I(l),t=!1}else e=ki(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=e),t=!0;if(!t)return l.flags&256?(Vt(l),l):(Vt(l),null);if(l.flags&128)throw Error(g(558))}return I(l),null;case 13:if(u=l.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(a=We(l),u!==null&&u.dehydrated!==null){if(t===null){if(!a)throw Error(g(318));if(a=l.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(g(317));a[mt]=l}else re(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;I(l),a=!1}else a=ki(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),a=!0;if(!a)return l.flags&256?(Vt(l),l):(Vt(l),null)}return Vt(l),l.flags&128?(l.lanes=e,l):(e=u!==null,t=t!==null&&t.memoizedState!==null,e&&(u=l.child,a=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(a=u.alternate.memoizedState.cachePool.pool),n=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(n=u.memoizedState.cachePool.pool),n!==a&&(u.flags|=2048)),e!==t&&e&&(l.child.flags|=8192),rn(l,l.updateQueue),I(l),null);case 4:return Ne(),t===null&&of(l.stateNode.containerInfo),I(l),null;case 10:return vl(l.type),I(l),null;case 19:if(yt(et),u=l.memoizedState,u===null)return I(l),null;if(a=(l.flags&128)!==0,n=u.rendering,n===null)if(a)Pu(u,!1);else{if(lt!==0||t!==null&&t.flags&128)for(t=l.child;t!==null;){if(n=tn(t),n!==null){for(l.flags|=128,Pu(u,!1),t=n.updateQueue,l.updateQueue=t,rn(l,t),l.subtreeFlags=0,t=e,e=l.child;e!==null;)yo(e,t),e=e.sibling;return w(et,et.current&1|2),j&&hl(l,u.treeForkCount),l.child}t=t.sibling}u.tail!==null&&Rt()>bn&&(l.flags|=128,a=!0,Pu(u,!1),l.lanes=4194304)}else{if(!a)if(t=tn(n),t!==null){if(l.flags|=128,a=!0,t=t.updateQueue,l.updateQueue=t,rn(l,t),Pu(u,!0),u.tail===null&&u.tailMode==="hidden"&&!n.alternate&&!j)return I(l),null}else 2*Rt()-u.renderingStartTime>bn&&e!==536870912&&(l.flags|=128,a=!0,Pu(u,!1),l.lanes=4194304);u.isBackwards?(n.sibling=l.child,l.child=n):(t=u.last,t!==null?t.sibling=n:l.child=n,u.last=n)}return u.tail!==null?(t=u.tail,u.rendering=t,u.tail=t.sibling,u.renderingStartTime=Rt(),t.sibling=null,e=et.current,w(et,a?e&1|2:e&1),j&&hl(l,u.treeForkCount),t):(I(l),null);case 22:case 23:return Vt(l),oc(),u=l.memoizedState!==null,t!==null?t.memoizedState!==null!==u&&(l.flags|=8192):u&&(l.flags|=8192),u?e&536870912&&!(l.flags&128)&&(I(l),l.subtreeFlags&6&&(l.flags|=8192)):I(l),e=l.updateQueue,e!==null&&rn(l,e.retryQueue),e=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==e&&(l.flags|=2048),t!==null&&yt(Se),null;case 24:return e=null,t!==null&&(e=t.memoizedState.cache),l.memoizedState.cache!==e&&(l.flags|=2048),vl(it),I(l),null;case 25:return null;case 30:return null}throw Error(g(156,l.tag))}function Yr(t,l){switch(Wi(l),l.tag){case 1:return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 3:return vl(it),Ne(),t=l.flags,t&65536&&!(t&128)?(l.flags=t&-65537|128,l):null;case 26:case 27:case 5:return Aa(l),null;case 31:if(l.memoizedState!==null){if(Vt(l),l.alternate===null)throw Error(g(340));re()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 13:if(Vt(l),t=l.memoizedState,t!==null&&t.dehydrated!==null){if(l.alternate===null)throw Error(g(340));re()}return t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 19:return yt(et),null;case 4:return Ne(),null;case 10:return vl(l.type),null;case 22:case 23:return Vt(l),oc(),t!==null&&yt(Se),t=l.flags,t&65536?(l.flags=t&-65537|128,l):null;case 24:return vl(it),null;case 25:return null;default:return null}}function Gd(t,l){switch(Wi(l),l.tag){case 3:vl(it),Ne();break;case 26:case 27:case 5:Aa(l);break;case 4:Ne();break;case 31:l.memoizedState!==null&&Vt(l);break;case 13:Vt(l);break;case 19:yt(et);break;case 10:vl(l.type);break;case 22:case 23:Vt(l),oc(),t!==null&&yt(Se);break;case 24:vl(it)}}function ta(t,l){try{var e=l.updateQueue,u=e!==null?e.lastEffect:null;if(u!==null){var a=u.next;e=a;do{if((e.tag&t)===t){u=void 0;var n=e.create,i=e.inst;u=n(),i.destroy=u}e=e.next}while(e!==a)}}catch(c){Z(l,l.return,c)}}function xl(t,l,e){try{var u=l.updateQueue,a=u!==null?u.lastEffect:null;if(a!==null){var n=a.next;u=n;do{if((u.tag&t)===t){var i=u.inst,c=i.destroy;if(c!==void 0){i.destroy=void 0,a=l;var f=e,d=c;try{d()}catch(r){Z(a,f,r)}}}u=u.next}while(u!==n)}}catch(r){Z(l,l.return,r)}}function Xd(t){var l=t.updateQueue;if(l!==null){var e=t.stateNode;try{Ho(l,e)}catch(u){Z(t,t.return,u)}}}function Qd(t,l,e){e.props=pe(t.type,t.memoizedProps),e.state=t.memoizedState;try{e.componentWillUnmount()}catch(u){Z(t,l,u)}}function la(t,l){try{var e=t.ref;if(e!==null){switch(t.tag){case 26:case 27:case 5:var u=t.stateNode;break;case 30:u=t.stateNode;break;default:u=t.stateNode}typeof e=="function"?t.refCleanup=e(u):e.current=u}}catch(a){Z(t,l,a)}}function il(t,l){var e=t.ref,u=t.refCleanup;if(e!==null)if(typeof u=="function")try{u()}catch(a){Z(t,l,a)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof e=="function")try{e(null)}catch(a){Z(t,l,a)}else e.current=null}function Zd(t){var l=t.type,e=t.memoizedProps,u=t.stateNode;try{t:switch(l){case"button":case"input":case"select":case"textarea":e.autoFocus&&u.focus();break t;case"img":e.src?u.src=e.src:e.srcSet&&(u.srcset=e.srcSet)}}catch(a){Z(t,t.return,a)}}function Zc(t,l,e){try{var u=t.stateNode;uv(u,t.type,e,l),u[At]=l}catch(a){Z(t,t.return,a)}}function xd(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Fl(t.type)||t.tag===4}function xc(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||xd(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Fl(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Lc(t,l,e){var u=t.tag;if(u===5||u===6)t=t.stateNode,l?(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e).insertBefore(t,l):(l=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.appendChild(t),e=e._reactRootContainer,e!=null||l.onclick!==null||(l.onclick=ol));else if(u!==4&&(u===27&&Fl(t.type)&&(e=t.stateNode,l=null),t=t.child,t!==null))for(Lc(t,l,e),t=t.sibling;t!==null;)Lc(t,l,e),t=t.sibling}function vn(t,l,e){var u=t.tag;if(u===5||u===6)t=t.stateNode,l?e.insertBefore(t,l):e.appendChild(t);else if(u!==4&&(u===27&&Fl(t.type)&&(e=t.stateNode),t=t.child,t!==null))for(vn(t,l,e),t=t.sibling;t!==null;)vn(t,l,e),t=t.sibling}function Ld(t){var l=t.stateNode,e=t.memoizedProps;try{for(var u=t.type,a=l.attributes;a.length;)l.removeAttributeNode(a[0]);Et(l,u,e),l[mt]=t,l[At]=e}catch(n){Z(t,t.return,n)}}var El=!1,st=!1,Kc=!1,Kd=typeof WeakSet=="function"?WeakSet:Set,rt=null;function qr(t,l){if(t=t.containerInfo,hf=qn,t=eo(t),ji(t)){if("selectionStart"in t)var e={start:t.selectionStart,end:t.selectionEnd};else t:{e=(e=t.ownerDocument)&&e.defaultView||window;var u=e.getSelection&&e.getSelection();if(u&&u.rangeCount!==0){e=u.anchorNode;var a=u.anchorOffset,n=u.focusNode;u=u.focusOffset;try{e.nodeType,n.nodeType}catch{e=null;break t}var i=0,c=-1,f=-1,d=0,r=0,m=t,y=null;l:for(;;){for(var v;m!==e||a!==0&&m.nodeType!==3||(c=i+a),m!==n||u!==0&&m.nodeType!==3||(f=i+u),m.nodeType===3&&(i+=m.nodeValue.length),(v=m.firstChild)!==null;)y=m,m=v;for(;;){if(m===t)break l;if(y===e&&++d===a&&(c=i),y===n&&++r===u&&(f=i),(v=m.nextSibling)!==null)break;m=y,y=m.parentNode}m=v}e=c===-1||f===-1?null:{start:c,end:f}}else e=null}e=e||{start:0,end:0}}else e=null;for(rf={focusedElem:t,selectionRange:e},qn=!1,rt=l;rt!==null;)if(l=rt,t=l.child,(l.subtreeFlags&1028)!==0&&t!==null)t.return=l,rt=t;else for(;rt!==null;){switch(l=rt,n=l.alternate,t=l.flags,l.tag){case 0:if(t&4&&(t=l.updateQueue,t=t!==null?t.events:null,t!==null))for(e=0;e title"))),Et(n,u,e),n[mt]=t,ht(n),u=n;break t;case"link":var i=ky("link","href",a).get(u+(e.href||""));if(i){for(var c=0;cH&&(i=H,H=T,T=i);var o=to(c,T),s=to(c,H);if(o&&s&&(v.rangeCount!==1||v.anchorNode!==o.node||v.anchorOffset!==o.offset||v.focusNode!==s.node||v.focusOffset!==s.offset)){var h=m.createRange();h.setStart(o.node,o.offset),v.removeAllRanges(),T>H?(v.addRange(h),v.extend(s.node,s.offset)):(h.setEnd(s.node,s.offset),v.addRange(h))}}}}for(m=[],v=c;v=v.parentNode;)v.nodeType===1&&m.push({element:v,left:v.scrollLeft,top:v.scrollTop});for(typeof c.focus=="function"&&c.focus(),c=0;ce?32:e,O.T=null,e=Ic,Ic=null;var n=wl,i=Ol;if(dt=0,su=wl=null,Ol=0,X&6)throw Error(g(331));var c=X;if(X|=4,ey(n.current),Pd(n,n.current,i,e),X=c,ca(0,!1),Nt&&typeof Nt.onPostCommitFiberRoot=="function")try{Nt.onPostCommitFiberRoot(Ou,n)}catch{}return!0}finally{G.p=a,O.T=u,Ey(t,l)}}function py(t,l,e){l=Kt(e,l),l=Rc(t.stateNode,l,2),t=Xl(t,l,2),t!==null&&(Mu(t,2),cl(t))}function Z(t,l,e){if(t.tag===3)py(t,t,e);else for(;l!==null;){if(l.tag===3){py(l,t,e);break}else if(l.tag===1){var u=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Jl===null||!Jl.has(u))){t=Kt(e,t),e=Td(2),u=Xl(l,e,2),u!==null&&(Ad(e,u,l,t),Mu(u,2),cl(u));break}}l=l.return}}function ef(t,l,e){var u=t.pingCache;if(u===null){u=t.pingCache=new Gr;var a=new Set;u.set(l,a)}else a=u.get(l),a===void 0&&(a=new Set,u.set(l,a));a.has(e)||($c=!0,a.add(e),t=Lr.bind(null,t,l,e),l.then(t,t))}function Lr(t,l,e){var u=t.pingCache;u!==null&&u.delete(l),t.pingedLanes|=t.suspendedLanes&e,t.warmLanes&=~e,J===t&&(q&e)===e&&(lt===4||lt===3&&(q&62914560)===q&&300>Rt()-gn?!(X&2)&&ou(t,0):Wc|=e,fu===q&&(fu=0)),cl(t)}function Ty(t,l){l===0&&(l=ms()),t=ye(t,l),t!==null&&(Mu(t,l),cl(t))}function Kr(t){var l=t.memoizedState,e=0;l!==null&&(e=l.retryLane),Ty(t,e)}function Jr(t,l){var e=0;switch(t.tag){case 31:case 13:var u=t.stateNode,a=t.memoizedState;a!==null&&(e=a.retryLane);break;case 19:u=t.stateNode;break;case 22:u=t.stateNode._retryCache;break;default:throw Error(g(314))}u!==null&&u.delete(l),Ty(t,e)}function wr(t,l){return vi(t,l)}var On=null,yu=null,uf=!1,_n=!1,af=!1,Wl=0;function cl(t){t!==yu&&t.next===null&&(yu===null?On=yu=t:yu=yu.next=t),_n=!0,uf||(uf=!0,Wr())}function ca(t,l){if(!af&&_n){af=!0;do for(var e=!1,u=On;u!==null;){if(t!==0){var a=u.pendingLanes;if(a===0)var n=0;else{var i=u.suspendedLanes,c=u.pingedLanes;n=(1<<31-Ct(42|t)+1)-1,n&=a&~(i&~c),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(e=!0,My(u,n))}else n=q,n=Ua(u,u===J?n:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),!(n&3)||_u(u,n)||(e=!0,My(u,n));u=u.next}while(e);af=!1}}function $r(){Ay()}function Ay(){_n=uf=!1;var t=0;Wl!==0&&nv()&&(t=Wl);for(var l=Rt(),e=null,u=On;u!==null;){var a=u.next,n=Oy(u,l);n===0?(u.next=null,e===null?On=a:e.next=a,a===null&&(yu=e)):(e=u,(t!==0||n&3)&&(_n=!0)),u=a}dt!==0&&dt!==5||ca(t),Wl!==0&&(Wl=0)}function Oy(t,l){for(var e=t.suspendedLanes,u=t.pingedLanes,a=t.expirationTimes,n=t.pendingLanes&-62914561;0c)break;var r=f.transferSize,m=f.initiatorType;r&&Yy(m)&&(f=f.responseEnd,i+=r*(f"u"?null:document;function wy(t,l,e){var u=hu;if(u&&typeof l=="string"&&l){var a=xt(l);a='link[rel="'+t+'"][href="'+a+'"]',typeof e=="string"&&(a+='[crossorigin="'+e+'"]'),Jy.has(a)||(Jy.add(a),t={rel:t,crossOrigin:e,href:l},u.querySelector(a)===null&&(l=u.createElement("link"),Et(l,"link",t),ht(l),u.head.appendChild(l)))}}function rv(t){_l.D(t),wy("dns-prefetch",t,null)}function vv(t,l){_l.C(t,l),wy("preconnect",t,l)}function mv(t,l,e){_l.L(t,l,e);var u=hu;if(u&&t&&l){var a='link[rel="preload"][as="'+xt(l)+'"]';l==="image"&&e&&e.imageSrcSet?(a+='[imagesrcset="'+xt(e.imageSrcSet)+'"]',typeof e.imageSizes=="string"&&(a+='[imagesizes="'+xt(e.imageSizes)+'"]')):a+='[href="'+xt(t)+'"]';var n=a;switch(l){case"style":n=ru(t);break;case"script":n=vu(t)}kt.has(n)||(t=F({rel:"preload",href:l==="image"&&e&&e.imageSrcSet?void 0:t,as:l},e),kt.set(n,t),u.querySelector(a)!==null||l==="style"&&u.querySelector(da(n))||l==="script"&&u.querySelector(ya(n))||(l=u.createElement("link"),Et(l,"link",t),ht(l),u.head.appendChild(l)))}}function Sv(t,l){_l.m(t,l);var e=hu;if(e&&t){var u=l&&typeof l.as=="string"?l.as:"script",a='link[rel="modulepreload"][as="'+xt(u)+'"][href="'+xt(t)+'"]',n=a;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=vu(t)}if(!kt.has(n)&&(t=F({rel:"modulepreload",href:t},l),kt.set(n,t),e.querySelector(a)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(e.querySelector(ya(n)))return}u=e.createElement("link"),Et(u,"link",t),ht(u),e.head.appendChild(u)}}}function gv(t,l,e){_l.S(t,l,e);var u=hu;if(u&&t){var a=qe(u).hoistableStyles,n=ru(t);l=l||"default";var i=a.get(n);if(!i){var c={loading:0,preload:null};if(i=u.querySelector(da(n)))c.loading=5;else{t=F({rel:"stylesheet",href:t,"data-precedence":l},e),(e=kt.get(n))&&zf(t,e);var f=i=u.createElement("link");ht(f),Et(f,"link",t),f._p=new Promise(function(d,r){f.onload=d,f.onerror=r}),f.addEventListener("load",function(){c.loading|=1}),f.addEventListener("error",function(){c.loading|=2}),c.loading|=4,Rn(i,l,u)}i={type:"stylesheet",instance:i,count:1,state:c},a.set(n,i)}}}function bv(t,l){_l.X(t,l);var e=hu;if(e&&t){var u=qe(e).hoistableScripts,a=vu(t),n=u.get(a);n||(n=e.querySelector(ya(a)),n||(t=F({src:t,async:!0},l),(l=kt.get(a))&&pf(t,l),n=e.createElement("script"),ht(n),Et(n,"link",t),e.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},u.set(a,n))}}function Ev(t,l){_l.M(t,l);var e=hu;if(e&&t){var u=qe(e).hoistableScripts,a=vu(t),n=u.get(a);n||(n=e.querySelector(ya(a)),n||(t=F({src:t,async:!0,type:"module"},l),(l=kt.get(a))&&pf(t,l),n=e.createElement("script"),ht(n),Et(n,"link",t),e.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},u.set(a,n))}}function $y(t,l,e,u){var a=(a=Hl.current)?Hn(a):null;if(!a)throw Error(g(446));switch(t){case"meta":case"title":return null;case"style":return typeof e.precedence=="string"&&typeof e.href=="string"?(l=ru(e.href),e=qe(a).hoistableStyles,u=e.get(l),u||(u={type:"style",instance:null,count:0,state:null},e.set(l,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(e.rel==="stylesheet"&&typeof e.href=="string"&&typeof e.precedence=="string"){t=ru(e.href);var n=qe(a).hoistableStyles,i=n.get(t);if(i||(a=a.ownerDocument||a,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(t,i),(n=a.querySelector(da(t)))&&!n._p&&(i.instance=n,i.state.loading=5),kt.has(t)||(e={rel:"preload",as:"style",href:e.href,crossOrigin:e.crossOrigin,integrity:e.integrity,media:e.media,hrefLang:e.hrefLang,referrerPolicy:e.referrerPolicy},kt.set(t,e),n||zv(a,t,e,i.state))),l&&u===null)throw Error(g(528,""));return i}if(l&&u!==null)throw Error(g(529,""));return null;case"script":return l=e.async,e=e.src,typeof e=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=vu(e),e=qe(a).hoistableScripts,u=e.get(l),u||(u={type:"script",instance:null,count:0,state:null},e.set(l,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(g(444,t))}}function ru(t){return'href="'+xt(t)+'"'}function da(t){return'link[rel="stylesheet"]['+t+"]"}function Wy(t){return F({},t,{"data-precedence":t.precedence,precedence:null})}function zv(t,l,e,u){t.querySelector('link[rel="preload"][as="style"]['+l+"]")?u.loading=1:(l=t.createElement("link"),u.preload=l,l.addEventListener("load",function(){return u.loading|=1}),l.addEventListener("error",function(){return u.loading|=2}),Et(l,"link",e),ht(l),t.head.appendChild(l))}function vu(t){return'[src="'+xt(t)+'"]'}function ya(t){return"script[async]"+t}function Fy(t,l,e){if(l.count++,l.instance===null)switch(l.type){case"style":var u=t.querySelector('style[data-href~="'+xt(e.href)+'"]');if(u)return l.instance=u,ht(u),u;var a=F({},e,{"data-href":e.href,"data-precedence":e.precedence,href:null,precedence:null});return u=(t.ownerDocument||t).createElement("style"),ht(u),Et(u,"style",a),Rn(u,e.precedence,t),l.instance=u;case"stylesheet":a=ru(e.href);var n=t.querySelector(da(a));if(n)return l.state.loading|=4,l.instance=n,ht(n),n;u=Wy(e),(a=kt.get(a))&&zf(u,a),n=(t.ownerDocument||t).createElement("link"),ht(n);var i=n;return i._p=new Promise(function(c,f){i.onload=c,i.onerror=f}),Et(n,"link",u),l.state.loading|=4,Rn(n,e.precedence,t),l.instance=n;case"script":return n=vu(e.src),(a=t.querySelector(ya(n)))?(l.instance=a,ht(a),a):(u=e,(a=kt.get(n))&&(u=F({},e),pf(u,a)),t=t.ownerDocument||t,a=t.createElement("script"),ht(a),Et(a,"link",u),t.head.appendChild(a),l.instance=a);case"void":return null;default:throw Error(g(443,l.type))}else l.type==="stylesheet"&&!(l.state.loading&4)&&(u=l.instance,l.state.loading|=4,Rn(u,e.precedence,t));return l.instance}function Rn(t,l,e){for(var u=e.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=u.length?u[u.length-1]:null,n=a,i=0;i title"):null)}function pv(t,l,e){if(e===1||l.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return t=l.disabled,typeof l.precedence=="string"&&t==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function Py(t){return!(t.type==="stylesheet"&&!(t.state.loading&3))}function Tv(t,l,e,u){if(e.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&!(e.state.loading&4)){if(e.instance===null){var a=ru(u.href),n=l.querySelector(da(a));if(n){l=n._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(t.count++,t=Cn.bind(t),l.then(t,t)),e.state.loading|=4,e.instance=n,ht(n);return}n=l.ownerDocument||l,u=Wy(u),(a=kt.get(a))&&zf(u,a),n=n.createElement("link"),ht(n);var i=n;i._p=new Promise(function(c,f){i.onload=c,i.onerror=f}),Et(n,"link",u),e.instance=n}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(e,l),(l=e.state.preload)&&!(e.state.loading&3)&&(t.count++,e=Cn.bind(t),l.addEventListener("load",e),l.addEventListener("error",e))}}var Tf=0;function Av(t,l){return t.stylesheets&&t.count===0&&Yn(t,t.stylesheets),0Tf?50:800)+l);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(u),clearTimeout(a)}}:null}function Cn(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yn(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Bn=null;function Yn(t,l){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Bn=new Map,l.forEach(Ov,t),Bn=null,Cn.call(t))}function Ov(t,l){if(!(l.state.loading&4)){var e=Bn.get(t);if(e)var u=e.get(null);else{e=new Map,Bn.set(t,e);for(var a=t.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hh)}catch(t){console.error(t)}}hh(),Ff.exports=ba;var Hf=Ff.exports;const Cv=ue({__proto__:null,default:Vf(Hf)},[Hf]);var rh={exports:{}},xn={};/** * @license React * react-jsx-runtime.production.js * @@ -46,4 +46,4 @@ Error generating stack: `+u.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Bv=Symbol.for("react.transitional.element"),Yv=Symbol.for("react.fragment");function vh(t,l,e){var u=null;if(e!==void 0&&(u=""+e),l.key!==void 0&&(u=""+l.key),"key"in l){e={};for(var a in l)a!=="key"&&(e[a]=l[a])}else e=l;return l=e.ref,{$$typeof:Bv,type:t,key:u,ref:l!==void 0?l:null,props:e}}xn.Fragment=Yv,xn.jsx=vh,xn.jsxs=vh,rh.exports=xn;var Oe=rh.exports;const mh=V.createContext(null);function Sh({namespace:t,children:l}){return Oe.jsx(mh.Provider,{value:t,children:l})}function qv(){return V.useContext(mh)}function Vv(t,l){return l?`${l}-${t}`:t}function Ml(t,l){const e=qv();return Vv(t,l!==void 0?l:e)}function jv({id:t,tagName:l="div",namespace:e,...u}){const a=Ml(t,e),n=V.useRef(null);return V.useEffect(()=>{var d;const i=n.current,c=i==null?void 0:i.parentElement;if(!i||!c||!((d=window.Shiny)!=null&&d.bindAll))return;const f=(r,m)=>{console.error(`[shinyreact] ShinyOutput "${a}" ${m} failed:`,{id:a,phase:m,error:r})};try{const r=window.Shiny.bindAll(c);r&&typeof r.catch=="function"&&r.catch(m=>f(m,"bindAll"))}catch(r){f(r,"bindAll")}return()=>{var r,m;try{(m=(r=window.Shiny)==null?void 0:r.unbindAll)==null||m.call(r,i,!0)}catch(y){f(y,"unbindAll")}}},[a,l]),Wf.createElement(l,{id:a,ref:n,...u})}const Su=Symbol("MISSING"),gh="1.0";function Gv(){if(typeof document>"u")return null;const t=document.getElementById("shinyreact-config"),l=t==null?void 0:t.textContent;if(!l)return null;try{return JSON.parse(l)}catch(e){return console.error("shinyreact: could not parse #shinyreact-config JSON",e),null}}function Xv(t){if(typeof document<"u"&&document.body){const l="shinyreact-fatal-error";let e=document.getElementById(l);e||(e=document.createElement("div"),e.id=l,e.setAttribute("role","alert"),e.style.cssText="position:fixed;top:0;left:0;right:0;z-index:99999;padding:1rem 1.25rem;background:#fee2e2;color:#7f1d1d;border-bottom:4px solid #991b1b;font-family:system-ui,sans-serif;font-size:15px;line-height:1.5;white-space:pre-wrap",document.body.appendChild(e));const u=e;u.textContent="",t.split("`").forEach((a,n)=>{if(n%2===0){u.appendChild(document.createTextNode(a));return}const i=document.createElement("code");i.textContent=a,i.style.cssText="background:#fff;color:#7f1d1d;border:1px solid #f0a3a3;border-radius:4px;padding:0.1em 0.35em;font-family:ui-monospace,SFMono-Regular,monospace;font-size:0.95em",u.appendChild(i)})}throw new Error(t.replace(/`/g,""))}function Qv(t){const l=e=>e.split(".")[0];l(t)!==l(gh)&&Xv(`shinyreact protocol mismatch: the server speaks protocol \`${t}\` but this JS client supports \`${gh}\`. Upgrade the older side (the shinyreact R/Python package, or the client bundle) so the major protocol versions match.`)}function Zv(t){const l=typeof window<"u"?window:globalThis,e=l.shinyreact=l.shinyreact||{},u=e._restore,a=Gv();if(a!=null&&a.protocolVersion?Qv(a.protocolVersion):a!=null&&console.error("shinyreact: the `#shinyreact-config` tag carries no `protocolVersion`, so the client cannot verify it speaks the same protocol as the server. Upgrade the shinyreact Python/R package.".replace(/`/g,"")),u&&typeof u=="object"&&u["-applied"])return;const n=a==null?void 0:a.restore,i=Object.create(null);if(n&&typeof n=="object")for(const[c,f]of Object.entries(n))t.add(c,f),i[c]=f;e._restore={"-applied":!0,"-values":i}}let Rf=!1,Ln=!1;const Nf=new Set;let bh=!1,Eh,zh,Th;function ph(){for(const t of Nf)t()}function Ah(){Rf||(Rf=!0,ph())}function Oh(t){Ln!==t&&(Ln=t,ph())}function xv(){if(bh||typeof document>"u")return;bh=!0,document.documentElement.classList.contains("shiny-busy")&&(Ln=!0),Eh=()=>Oh(!0),zh=()=>Oh(!1),document.addEventListener("shiny:busy",Eh),document.addEventListener("shiny:idle",zh);const t=nt();if(t){t.initializedPromise.then(Ah);return}Th=()=>{const l=nt();l&&l.initializedPromise.then(Ah)},document.addEventListener("shiny:connected",Th,{once:!0})}function _h(t){return xv(),Nf.add(t),()=>{Nf.delete(t)}}function Mh(){return Rf}function Dh(){return Ln}class Lv{constructor(){K(this,"messageHandlers",new Map);K(this,"initialized",!1)}init(){if(this.initialized)return;const l=nt();l&&(l.addCustomMessageHandler("shinyReactMessage",e=>{this.dispatchMessage(e.id,e.data)}),this.initialized=!0)}addHandler(l,e){this.init(),this.messageHandlers.has(l)||this.messageHandlers.set(l,new Set),this.messageHandlers.get(l).add(e)}removeHandler(l,e){const u=this.messageHandlers.get(l);u&&(u.delete(e),u.size===0&&this.messageHandlers.delete(l))}dispatchMessage(l,e){const u=this.messageHandlers.get(l);u&&u.forEach(a=>a(e))}getHandlerCount(l){const e=this.messageHandlers.get(l);return e?e.size:0}getActiveMessageIds(){return Array.from(this.messageHandlers.keys())}}const Uh=new Lv;function Hh(){const t=nt();return t?t.messageRegistry??(t.messageRegistry=Uh):Uh}function Kv(){nt()&&Hh()}class Jv{constructor(l){K(this,"id");K(this,"el");K(this,"status","pending");K(this,"hasValue",!1);K(this,"lastValue");K(this,"lastError",null);K(this,"useStateSetValueFns");K(this,"useStateSetStatusFns");K(this,"useStateSetErrorFns");this.id=l,this.useStateSetValueFns=new Set,this.useStateSetStatusFns=new Set,this.useStateSetErrorFns=new Set}hasReceivedValue(){return this.hasValue}getLastValue(){return this.lastValue}getLastError(){return this.lastError}addUseStateSetValueFn(l){this.useStateSetValueFns.add(l)}removeUseStateSetValueFn(l){this.useStateSetValueFns.delete(l)}addUseStateSetStatusFn(l){this.useStateSetStatusFns.add(l)}removeUseStateSetStatusFn(l){this.useStateSetStatusFns.delete(l)}addUseStateSetErrorFn(l){this.useStateSetErrorFns.add(l)}removeUseStateSetErrorFn(l){this.useStateSetErrorFns.delete(l)}getStatus(){return this.status}setStatus(l){this.status!==l&&(this.status=l,this.useStateSetStatusFns.forEach(e=>e(l)))}setValue(l){this.hasValue=!0,this.lastValue=l,this.useStateSetValueFns.forEach(e=>e(l)),this.status==="error"&&(this.lastError=null,this.useStateSetErrorFns.forEach(e=>e(null))),this.setStatus("ready")}setRecalculating(l){l?this.hasValue&&(this.status==="error"&&(this.lastError=null,this.useStateSetErrorFns.forEach(e=>e(null))),this.setStatus("recalculating")):this.hasValue&&this.status==="recalculating"&&this.setStatus("ready")}setError(l){if(l.message===""){this.setValue(null);return}this.lastError=l,this.useStateSetErrorFns.forEach(e=>e(l)),this.setStatus("error")}isEmpty(){return this.useStateSetValueFns.size===0&&this.useStateSetStatusFns.size===0&&this.useStateSetErrorFns.size===0}}class wv{constructor(){K(this,"outputs",new Map);K(this,"bindAllScheduled",!1);K(this,"containerEl")}get container(){return this.containerEl??(this.containerEl=(()=>{const l=document.createElement("div");return l.className="shiny-react-output-container",l.style.visibility="hidden",document.body.appendChild(l),l})()),this.containerEl}add(l,e,u,a){let n=this.get(l);if(!n){const i=document.createElement("div");i.className="shiny-react-output",i.id=l,this.container.appendChild(i),n=new Jv(l),n.el=i,this.outputs.set(l,n),this.scheduleBindAll()}return n.addUseStateSetValueFn(e),n.addUseStateSetStatusFn(u),n.addUseStateSetErrorFn(a),n.hasReceivedValue()&&e(n.getLastValue()),u(n.getStatus()),n.getStatus()==="error"&&a(n.getLastError()),()=>{n.removeUseStateSetValueFn(e),n.removeUseStateSetStatusFn(u),n.removeUseStateSetErrorFn(a),this.scheduleCleanup(l)}}has(l){return this.outputs.has(l)}get(l){return this.outputs.get(l)}scheduleCleanup(l){requestAnimationFrame(()=>{var u;const e=this.outputs.get(l);!e||!e.isEmpty()||(this.outputs.delete(l),(u=e.el)==null||u.remove(),this.scheduleBindAll())})}scheduleBindAll(){const l=nt();!l||!this.containerEl||this.bindAllScheduled||(this.bindAllScheduled=!0,requestAnimationFrame(()=>{var e,u;(e=l.unbindAll)==null||e.call(l,this.container),(u=l.bindAll)==null||u.call(l,this.container),this.bindAllScheduled=!1}))}}function $v(t){const l=nt();if(!l)return;class e extends l.OutputBinding{find(a){return $(a).find(".shiny-react-output")}renderValue(a,n){const i=t().get(a.id);if(!i){console.error(`Output ${a.id} not found`);return}i.setValue(n)}renderError(a,n){console.error(`Error for ${a.id}:`,n);const i=t().get(a.id);i&&i.setError(n)}showProgress(a,n){const i=t().get(a.id);if(!i){console.error(`Output ${a.id} not found`);return}i.setRecalculating(n)}}l.outputBindings.register(new e,"shiny.reactOutput")}function Cf(t,l){let e=null;const u=function(...a){const n=()=>{e=null,t(...a)};e!==null&&clearTimeout(e),e=setTimeout(n,l)};return u.setDelay=a=>{l=a},u.getDelay=()=>l,u.cancel=()=>{e!==null&&(clearTimeout(e),e=null)},u}const Sa=class Sa{constructor(l,e){K(this,"id");K(this,"value");K(this,"useStateSetValueFns");K(this,"shinySetInputValueDebounced");K(this,"opts",{debounceMs:100});K(this,"type");K(this,"typeFinalized",!1);this.id=l,this.value=e,this.useStateSetValueFns=new Set,this.shinySetInputValueDebounced=Cf(this.setShinyInputValue.bind(this),this.opts.debounceMs)}isEmpty(){return this.useStateSetValueFns.size===0}setShinyInputValue(l){var u,a;const e=`${this.id}:${this.type??Sa.DEFAULT_TYPE}`;(a=(u=nt())==null?void 0:u.setInputValue)==null||a.call(u,e,l,this.opts)}updateDebounceDelay(l){this.shinySetInputValueDebounced.setDelay(l)}updatePriority(l){const e=this.opts.priority;e!==void 0&&e!==l&&console.warn(`[shinyreact] Input "${this.id}" priority changed from ${JSON.stringify(e)} to ${JSON.stringify(l)}. Priority is per-id here, so the most recent mount wins — if two call sites for this id disagree, the winner depends on mount order.`),this.opts.priority=l}updateType(l){if(!this.typeFinalized){this.type=l,this.typeFinalized=!0;return}if(l!==void 0&&this.type!==l)throw new Error(`Input "${this.id}" is already registered with type=${this.type===void 0?`undefined (wire id "${this.id}:${Sa.DEFAULT_TYPE}")`:JSON.stringify(this.type)}. A second mount requested type=${JSON.stringify(l)}. An input's handler type changes server-side semantics and must be consistent across every useShinyInput / useSetShinyInput call for the same id.`)}addUseStateSetValueFn(l){this.useStateSetValueFns.add(l)}removeUseStateSetValueFn(l){this.useStateSetValueFns.delete(l)}setValue(l){const e=typeof l=="function"?l(this.value):l;if(this.value=e,this.useStateSetValueFns.forEach(u=>u(e)),e===Su){this.shinySetInputValueDebounced.cancel();return}this.shinySetInputValueDebounced(e)}getValue(){return this.value}};K(Sa,"DEFAULT_TYPE","shinyreact.default");let Bf=Sa;class Wv{constructor(){K(this,"inputs",new Map);K(this,"pendingSubscribers",new Map)}get(l){return this.inputs.get(l)}has(l){return this.inputs.has(l)}add(l,e){if(this.inputs.has(l))throw new Error(`Input ${l} already exists`);const u=new Bf(l,e);this.inputs.set(l,u);const a=this.pendingSubscribers.get(l);return a&&(a.forEach(n=>{u.addUseStateSetValueFn(n),n(u.getValue())}),this.pendingSubscribers.delete(l)),u}getOrCreate(l,e){let u=this.get(l);return u||(u=this.add(l,e)),u}subscribe(l,e){const u=this.get(l);if(u)return u.addUseStateSetValueFn(e),e(u.getValue()),()=>{const n=this.get(l);n&&n.removeUseStateSetValueFn(e)};let a=this.pendingSubscribers.get(l);return a||(a=new Set,this.pendingSubscribers.set(l,a)),a.add(e),()=>{const n=this.get(l);if(n){n.removeUseStateSetValueFn(e);return}const i=this.pendingSubscribers.get(l);i&&(i.delete(e),i.size===0&&this.pendingSubscribers.delete(l))}}remove(l){const e=this.inputs.get(l);return e&&e.shinySetInputValueDebounced.cancel(),this.inputs.delete(l)}keys(){return this.inputs.keys()}size(){return this.inputs.size}}let Rh;function Nh(){return Rh??(Rh={inputs:new Wv,outputs:new wv}),Rh}function Fv(){Qt()}function Qt(){const t=nt();return t?t.reactRegistry??(t.reactRegistry=Nh()):Nh()}function Kn(t,l,{debounceMs:e=100,priority:u,namespace:a,type:n}={}){if(_e(),n!==void 0&&!/^[^\s:]+$/.test(n))throw new Error(`useShinyInput("${t}"): invalid type=${JSON.stringify(n)}. Must be non-empty and contain no whitespace or ':' characters.`);const i=Ml(t,a),f=V.useRef(l).current;let d=f;const m=Qt().inputs.get(i);m&&(d=m.getValue());const[y,v]=V.useState(d),b=le();V.useEffect(()=>{if(!b)return;const o=Qt().inputs.getOrCreate(i,f);return e!==void 0&&o.updateDebounceDelay(e),u&&o.updatePriority(u),o.updateType(n),o.addUseStateSetValueFn(v),o.setValue(o.getValue()),()=>{o.removeUseStateSetValueFn(v)}},[i,b,e,u,f,n]);const p=V.useCallback(H=>{if(!b)return;const s=Qt().inputs.get(i);if(!s){console.error(`Input ${i} not found`);return}s.setValue(H)},[i,b]);return[y,p]}const gu=()=>{};function Ch(t,l=void 0,{namespace:e}={}){const[u,a]=V.useState(l),n=le();_e();const i=Ml(t,e),c=V.useRef(l);return V.useEffect(()=>{if(!n)return;const f=Qt();return a(c.current),f.outputs.add(i,a,gu,gu)},[i,n]),u}function Bh(t,{namespace:l}={}){const[e,u]=V.useState("pending"),a=le();_e();const n=Ml(t,l);return V.useEffect(()=>a?Qt().outputs.add(n,gu,u,gu):void 0,[n,a]),e}function kv(t,{namespace:l}={}){const[e,u]=V.useState(null),a=le();_e();const n=Ml(t,l);return V.useEffect(()=>a?(u(null),Qt().outputs.add(n,gu,gu,u)):void 0,[n,a]),e}function Iv(t,{namespace:l}={}){_e();const e=Ml(t,l),[u,a]=V.useState(()=>{const i=Qt().inputs.get(e);if(!i)return;const c=i.getValue();return c===Su?void 0:c}),n=le();return V.useEffect(()=>n?Qt().inputs.subscribe(e,f=>{a(f===Su?void 0:f)}):void 0,[e,n]),u}function Pv(t,l,{debounceMs:e=100,priority:u,namespace:a,type:n}={}){if(_e(),n!==void 0&&!/^[^\s:]+$/.test(n))throw new Error(`useSetShinyInput("${t}"): invalid type=${JSON.stringify(n)}. Must be non-empty and contain no whitespace or ':' characters.`);const i=Ml(t,a),f=V.useRef(l).current,d=le();return V.useEffect(()=>{if(!d)return;const m=Qt().inputs.getOrCreate(i,f);e!==void 0&&m.updateDebounceDelay(e),u&&m.updatePriority(u),m.updateType(n),m.setValue(m.getValue())},[i,d,e,u,f,n]),V.useCallback(r=>{if(!d)return;const y=Qt().inputs.get(i);if(!y){console.error(`Input ${i} not found`);return}y.setValue(r)},[i,d])}function tm(t,l,{namespace:e}={}){const u=le();_e();const a=Ml(t,e),n=V.useRef(l);n.current=l,V.useEffect(()=>{if(!u||!a)return;const i=f=>n.current(f),c=Hh();return c.addHandler(a,i),()=>{c.removeHandler(a,i)}},[u,a])}function le(){return V.useSyncExternalStore(_h,Mh,Mh)}function lm(){return V.useSyncExternalStore(_h,Dh,Dh)}let Yh=!1;function _e(){Yh||(Fv(),Zv(Qt().inputs),$v(()=>Qt().outputs),Kv(),Yh=!0)}function em({id:t,className:l,width:e,height:u,debounceMs:a=400,onRecalculating:n,namespace:i}){const c=Ml(t,i),f={namespace:null},[d,r]=Kn(`.clientdata_output_${c}_width`,Su,f),[m,y]=Kn(`.clientdata_output_${c}_height`,Su,f),[v]=Kn(`.clientdata_output_${c}_hidden`,!1,f),b=Ch(c,void 0,f),p=Bh(c,f),H=V.useRef(null),o=V.useRef(null),[s,h]=V.useState(0);V.useEffect(()=>{b&&h(E=>E+1)},[b]),V.useEffect(()=>{n&&n(p==="recalculating")},[p,n]);const S=V.useCallback(()=>{if(H.current){const E=H.current.clientWidth,_=H.current.clientHeight;E>0&&_>0&&(r(E),y(_))}},[r,y]);return V.useEffect(()=>{const E=H.current;if(!E)return;E.addEventListener("load",S);const _=Cf(()=>{E&&E.complete&&S()},a),z=new ResizeObserver(A=>{for(const M of A)M.target===E&&_()});return z.observe(E),()=>{E.removeEventListener("load",S),z.disconnect(),_.cancel()}},[H,s,r,y,a,S]),V.useEffect(()=>{if(b)return;const E=o.current;if(!E)return;const _=()=>{const M=E.clientWidth,R=E.clientHeight;M>0&&R>0&&(r(M),y(R))};_();const z=Cf(_,a),A=new ResizeObserver(()=>z());return A.observe(E),()=>{A.disconnect(),z.cancel()}},[b,r,y,a]),v?null:b?Oe.jsx("img",{ref:H,src:b.src,alt:"",className:l,style:{width:e,height:u},onLoad:S}):Oe.jsx("div",{ref:o,className:l,style:{width:e,height:u,display:"flex",alignItems:"center",justifyContent:"center",color:"#9ca3af"},children:Oe.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",style:{animation:"spin 1s linear infinite"},children:Oe.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2.5",strokeDasharray:"31.4 31.4",strokeLinecap:"round"})})})}class qh extends HTMLElement{constructor(){super(...arguments);K(this,"root",null);K(this,"slotContents",new Map)}captureSlots(e="[data-slot]"){const u=this.querySelectorAll(`:scope > ${e}`),a=new Set(u);u.forEach(i=>{const c=i.getAttribute("data-slot");c&&this.slotContents.set(c,Array.from(i.childNodes))});const n=Array.from(this.childNodes).filter(i=>!a.has(i));return n.length>0&&this.slotContents.set("__children__",n),this.slotContents}async mountSlot(e,u){var n,i;const a=this.slotContents.get(e);a&&u&&(a.forEach(c=>u.appendChild(c)),await((i=(n=window.Shiny)==null?void 0:n.bindAll)==null?void 0:i.call(n,u)))}get onSlotMount(){return this.mountSlot.bind(this)}getConfig(){const e={};for(const[u,a]of Object.entries(this.dataset))if(a!==void 0)try{e[u]=JSON.parse(a)}catch{e[u]=a}return e}get namespace(){return this.id||void 0}render(){const e=this.constructor.component;return e?Oe.jsx(e,{...this.getConfig()}):(console.error(`${this.constructor.name}: No static component defined`),null)}wrapWithProvider(e){return this.namespace?Oe.jsx(Sh,{namespace:this.namespace,children:e}):e}clearContent(){this.innerHTML=""}connectedCallback(){this.captureSlots(),this.clearContent(),this.root=Hf.createRoot(this),this.root.render(this.wrapWithProvider(this.render()))}disconnectedCallback(){var e,u,a;(u=(e=window.Shiny)==null?void 0:e.unbindAll)==null||u.call(e,this),(a=this.root)==null||a.unmount(),this.root=null}}K(qh,"component",null);function um(){window.shinyreact={useSetShinyInput:Pv,useShinyBusy:lm,useShinyInput:Kn,useShinyInputValue:Iv,useShinyOutputError:kv,useShinyOutputStatus:Bh,useShinyOutputValue:Ch,useShinyMessageHandler:tm,useShinyInitialized:le,ImageOutput:em,MISSING:Su,ShinyModuleProvider:Sh,ShinyReactComponentElement:qh,ShinyOutput:jv,React:Wf,ReactDOM:Cv}}um(),jh()})(); + */var Bv=Symbol.for("react.transitional.element"),Yv=Symbol.for("react.fragment");function vh(t,l,e){var u=null;if(e!==void 0&&(u=""+e),l.key!==void 0&&(u=""+l.key),"key"in l){e={};for(var a in l)a!=="key"&&(e[a]=l[a])}else e=l;return l=e.ref,{$$typeof:Bv,type:t,key:u,ref:l!==void 0?l:null,props:e}}xn.Fragment=Yv,xn.jsx=vh,xn.jsxs=vh,rh.exports=xn;var Oe=rh.exports;const mh=V.createContext(null);function Sh({namespace:t,children:l}){return Oe.jsx(mh.Provider,{value:t,children:l})}function qv(){return V.useContext(mh)}function Vv(t,l){return l?`${l}-${t}`:t}function Ml(t,l){const e=qv();return Vv(t,l!==void 0?l:e)}function jv({id:t,tagName:l="div",namespace:e,...u}){const a=Ml(t,e),n=V.useRef(null);return V.useEffect(()=>{var d;const i=n.current,c=i==null?void 0:i.parentElement;if(!i||!c||!((d=window.Shiny)!=null&&d.bindAll))return;const f=(r,m)=>{console.error(`[shinyreact] ShinyOutput "${a}" ${m} failed:`,{id:a,phase:m,error:r})};try{const r=window.Shiny.bindAll(c);r&&typeof r.catch=="function"&&r.catch(m=>f(m,"bindAll"))}catch(r){f(r,"bindAll")}return()=>{var r,m;try{(m=(r=window.Shiny)==null?void 0:r.unbindAll)==null||m.call(r,i,!0)}catch(y){f(y,"unbindAll")}}},[a,l]),Wf.createElement(l,{id:a,ref:n,...u})}const Su=Symbol("MISSING"),gh="1.0";function Gv(){if(typeof document>"u")return null;const t=document.getElementById("shinyreact-config"),l=t==null?void 0:t.textContent;if(!l)return null;try{return JSON.parse(l)}catch(e){return console.error("shinyreact: could not parse #shinyreact-config JSON",e),null}}function Xv(t){if(typeof document<"u"&&document.body){const l="shinyreact-fatal-error";let e=document.getElementById(l);e||(e=document.createElement("div"),e.id=l,e.setAttribute("role","alert"),e.style.cssText="position:fixed;top:0;left:0;right:0;z-index:99999;padding:1rem 1.25rem;background:#fee2e2;color:#7f1d1d;border-bottom:4px solid #991b1b;font-family:system-ui,sans-serif;font-size:15px;line-height:1.5;white-space:pre-wrap",document.body.appendChild(e));const u=e;u.textContent="",t.split("`").forEach((a,n)=>{if(n%2===0){u.appendChild(document.createTextNode(a));return}const i=document.createElement("code");i.textContent=a,i.style.cssText="background:#fff;color:#7f1d1d;border:1px solid #f0a3a3;border-radius:4px;padding:0.1em 0.35em;font-family:ui-monospace,SFMono-Regular,monospace;font-size:0.95em",u.appendChild(i)})}throw new Error(t.replace(/`/g,""))}function Qv(t){const l=e=>e.split(".")[0];l(t)!==l(gh)&&Xv(`shinyreact protocol mismatch: the server speaks protocol \`${t}\` but this JS client supports \`${gh}\`. Upgrade the older side (the shinyreact R/Python package, or the client bundle) so the major protocol versions match.`)}function Zv(t){const l=typeof window<"u"?window:globalThis,e=l.shinyreact=l.shinyreact||{},u=e._restore,a=Gv();if(a!=null&&a.protocolVersion?Qv(a.protocolVersion):a!=null&&console.error("shinyreact: the `#shinyreact-config` tag carries no `protocolVersion`, so the client cannot verify it speaks the same protocol as the server. Upgrade the shinyreact Python/R package.".replace(/`/g,"")),u&&typeof u=="object"&&u["-applied"])return;const n=a==null?void 0:a.restore,i=Object.create(null);if(n&&typeof n=="object")for(const[c,f]of Object.entries(n))t.add(c,f),i[c]=f;e._restore={"-applied":!0,"-values":i}}let Rf=!1,Ln=!1;const Nf=new Set;let bh=!1,Eh,zh,ph;function Th(){for(const t of Nf)t()}function Ah(){Rf||(Rf=!0,Th())}function Oh(t){Ln!==t&&(Ln=t,Th())}function xv(){if(bh||typeof document>"u")return;bh=!0,document.documentElement.classList.contains("shiny-busy")&&(Ln=!0),Eh=()=>Oh(!0),zh=()=>Oh(!1),document.addEventListener("shiny:busy",Eh),document.addEventListener("shiny:idle",zh);const t=nt();if(t){t.initializedPromise.then(Ah);return}ph=()=>{const l=nt();l&&l.initializedPromise.then(Ah)},document.addEventListener("shiny:connected",ph,{once:!0})}function _h(t){return xv(),Nf.add(t),()=>{Nf.delete(t)}}function Mh(){return Rf}function Dh(){return Ln}class Lv{constructor(){K(this,"messageHandlers",new Map);K(this,"initialized",!1)}init(){if(this.initialized)return;const l=nt();l&&(l.addCustomMessageHandler("shinyReactMessage",e=>{this.dispatchMessage(e.id,e.data)}),this.initialized=!0)}addHandler(l,e){this.init(),this.messageHandlers.has(l)||this.messageHandlers.set(l,new Set),this.messageHandlers.get(l).add(e)}removeHandler(l,e){const u=this.messageHandlers.get(l);u&&(u.delete(e),u.size===0&&this.messageHandlers.delete(l))}dispatchMessage(l,e){const u=this.messageHandlers.get(l);u&&u.forEach(a=>a(e))}getHandlerCount(l){const e=this.messageHandlers.get(l);return e?e.size:0}getActiveMessageIds(){return Array.from(this.messageHandlers.keys())}}const Uh=new Lv;function Hh(){const t=nt();return t?t.messageRegistry??(t.messageRegistry=Uh):Uh}function Kv(){nt()&&Hh()}class Jv{constructor(l){K(this,"id");K(this,"el");K(this,"status","pending");K(this,"hasValue",!1);K(this,"lastValue");K(this,"lastError",null);K(this,"useStateSetValueFns");K(this,"useStateSetStatusFns");K(this,"useStateSetErrorFns");this.id=l,this.useStateSetValueFns=new Set,this.useStateSetStatusFns=new Set,this.useStateSetErrorFns=new Set}hasReceivedValue(){return this.hasValue}getLastValue(){return this.lastValue}getLastError(){return this.lastError}addUseStateSetValueFn(l){this.useStateSetValueFns.add(l)}removeUseStateSetValueFn(l){this.useStateSetValueFns.delete(l)}addUseStateSetStatusFn(l){this.useStateSetStatusFns.add(l)}removeUseStateSetStatusFn(l){this.useStateSetStatusFns.delete(l)}addUseStateSetErrorFn(l){this.useStateSetErrorFns.add(l)}removeUseStateSetErrorFn(l){this.useStateSetErrorFns.delete(l)}getStatus(){return this.status}setStatus(l){this.status!==l&&(this.status=l,this.useStateSetStatusFns.forEach(e=>e(l)))}setValue(l){this.hasValue=!0,this.lastValue=l,this.useStateSetValueFns.forEach(e=>e(l)),this.status==="error"&&(this.lastError=null,this.useStateSetErrorFns.forEach(e=>e(null))),this.setStatus("ready")}setRecalculating(l){l?this.hasValue&&(this.status==="error"&&(this.lastError=null,this.useStateSetErrorFns.forEach(e=>e(null))),this.setStatus("recalculating")):this.hasValue&&this.status==="recalculating"&&this.setStatus("ready")}setError(l){if(l.message===""){this.setValue(null);return}this.lastError=l,this.useStateSetErrorFns.forEach(e=>e(l)),this.setStatus("error")}isEmpty(){return this.useStateSetValueFns.size===0&&this.useStateSetStatusFns.size===0&&this.useStateSetErrorFns.size===0}}class wv{constructor(){K(this,"outputs",new Map);K(this,"bindAllScheduled",!1);K(this,"containerEl")}get container(){return this.containerEl??(this.containerEl=(()=>{const l=document.createElement("div");return l.className="shiny-react-output-container",l.style.visibility="hidden",document.body.appendChild(l),l})()),this.containerEl}add(l,e,u,a){let n=this.get(l);if(!n){const i=document.createElement("div");i.className="shiny-react-output",i.id=l,this.container.appendChild(i),n=new Jv(l),n.el=i,this.outputs.set(l,n),this.scheduleBindAll()}return n.addUseStateSetValueFn(e),n.addUseStateSetStatusFn(u),n.addUseStateSetErrorFn(a),n.hasReceivedValue()&&e(n.getLastValue()),u(n.getStatus()),n.getStatus()==="error"&&a(n.getLastError()),()=>{n.removeUseStateSetValueFn(e),n.removeUseStateSetStatusFn(u),n.removeUseStateSetErrorFn(a),this.scheduleCleanup(l)}}has(l){return this.outputs.has(l)}get(l){return this.outputs.get(l)}scheduleCleanup(l){requestAnimationFrame(()=>{var u;const e=this.outputs.get(l);!e||!e.isEmpty()||(this.outputs.delete(l),(u=e.el)==null||u.remove(),this.scheduleBindAll())})}scheduleBindAll(){const l=nt();!l||!this.containerEl||this.bindAllScheduled||(this.bindAllScheduled=!0,requestAnimationFrame(()=>{var e,u;(e=l.unbindAll)==null||e.call(l,this.container),(u=l.bindAll)==null||u.call(l,this.container),this.bindAllScheduled=!1}))}}function $v(t){const l=nt();if(!l)return;class e extends l.OutputBinding{find(a){return $(a).find(".shiny-react-output")}renderValue(a,n){const i=t().get(a.id);if(!i){console.error(`Output ${a.id} not found`);return}i.setValue(n)}renderError(a,n){console.error(`Error for ${a.id}:`,n);const i=t().get(a.id);i&&i.setError(n)}showProgress(a,n){const i=t().get(a.id);if(!i){console.error(`Output ${a.id} not found`);return}i.setRecalculating(n)}}l.outputBindings.register(new e,"shiny.reactOutput")}function Cf(t,l){let e=null;const u=function(...a){const n=()=>{e=null,t(...a)};e!==null&&clearTimeout(e),e=setTimeout(n,l)};return u.setDelay=a=>{l=a},u.getDelay=()=>l,u.cancel=()=>{e!==null&&(clearTimeout(e),e=null)},u}const Sa=class Sa{constructor(l,e){K(this,"id");K(this,"value");K(this,"useStateSetValueFns");K(this,"shinySetInputValueDebounced");K(this,"opts",{debounceMs:100});K(this,"type");K(this,"typeFinalized",!1);this.id=l,this.value=e,this.useStateSetValueFns=new Set,this.shinySetInputValueDebounced=Cf(this.setShinyInputValue.bind(this),this.opts.debounceMs)}isEmpty(){return this.useStateSetValueFns.size===0}setShinyInputValue(l){var u,a;const e=`${this.id}:${this.type??Sa.DEFAULT_TYPE}`;(a=(u=nt())==null?void 0:u.setInputValue)==null||a.call(u,e,l,this.opts)}updateDebounceDelay(l){this.shinySetInputValueDebounced.setDelay(l)}updatePriority(l){const e=this.opts.priority;e!==void 0&&e!==l&&console.warn(`[shinyreact] Input "${this.id}" priority changed from ${JSON.stringify(e)} to ${JSON.stringify(l)}. Priority is per-id here, so the most recent mount wins — if two call sites for this id disagree, the winner depends on mount order.`),this.opts.priority=l}updateType(l){if(!this.typeFinalized){this.type=l,this.typeFinalized=!0;return}if(l!==void 0&&this.type!==l)throw new Error(`Input "${this.id}" is already registered with type=${this.type===void 0?`undefined (wire id "${this.id}:${Sa.DEFAULT_TYPE}")`:JSON.stringify(this.type)}. A second mount requested type=${JSON.stringify(l)}. An input's handler type changes server-side semantics and must be consistent across every useShinyInput / useSetShinyInput call for the same id.`)}addUseStateSetValueFn(l){this.useStateSetValueFns.add(l)}removeUseStateSetValueFn(l){this.useStateSetValueFns.delete(l)}setValue(l){const e=typeof l=="function"?l(this.value):l;if(this.value=e,this.useStateSetValueFns.forEach(u=>u(e)),e===Su){this.shinySetInputValueDebounced.cancel();return}this.shinySetInputValueDebounced(e)}getValue(){return this.value}};K(Sa,"DEFAULT_TYPE","shinyreact.default");let Bf=Sa;class Wv{constructor(){K(this,"inputs",new Map);K(this,"pendingSubscribers",new Map)}get(l){return this.inputs.get(l)}has(l){return this.inputs.has(l)}add(l,e){if(this.inputs.has(l))throw new Error(`Input ${l} already exists`);const u=new Bf(l,e);this.inputs.set(l,u);const a=this.pendingSubscribers.get(l);return a&&(a.forEach(n=>{u.addUseStateSetValueFn(n),n(u.getValue())}),this.pendingSubscribers.delete(l)),u}getOrCreate(l,e){let u=this.get(l);return u||(u=this.add(l,e)),u}subscribe(l,e){const u=this.get(l);if(u)return u.addUseStateSetValueFn(e),e(u.getValue()),()=>{const n=this.get(l);n&&n.removeUseStateSetValueFn(e)};let a=this.pendingSubscribers.get(l);return a||(a=new Set,this.pendingSubscribers.set(l,a)),a.add(e),()=>{const n=this.get(l);if(n){n.removeUseStateSetValueFn(e);return}const i=this.pendingSubscribers.get(l);i&&(i.delete(e),i.size===0&&this.pendingSubscribers.delete(l))}}remove(l){const e=this.inputs.get(l);return e&&e.shinySetInputValueDebounced.cancel(),this.inputs.delete(l)}keys(){return this.inputs.keys()}size(){return this.inputs.size}}let Rh;function Nh(){return Rh??(Rh={inputs:new Wv,outputs:new wv}),Rh}function Fv(){Qt()}function Qt(){const t=nt();return t?t.reactRegistry??(t.reactRegistry=Nh()):Nh()}function Kn(t,l,{debounceMs:e=100,priority:u,namespace:a,type:n}={}){if(_e(),n!==void 0&&!/^[^\s:]+$/.test(n))throw new Error(`useShinyInput("${t}"): invalid type=${JSON.stringify(n)}. Must be non-empty and contain no whitespace or ':' characters.`);const i=Ml(t,a),f=V.useRef(l).current;let d=f;const m=Qt().inputs.get(i);m&&(d=m.getValue());const[y,v]=V.useState(d),b=le();V.useEffect(()=>{if(!b)return;const o=Qt().inputs.getOrCreate(i,f);return e!==void 0&&o.updateDebounceDelay(e),u&&o.updatePriority(u),o.updateType(n),o.addUseStateSetValueFn(v),o.setValue(o.getValue()),()=>{o.removeUseStateSetValueFn(v)}},[i,b,e,u,f,n]);const T=V.useCallback(H=>{if(!b)return;const s=Qt().inputs.get(i);if(!s){console.error(`Input ${i} not found`);return}s.setValue(H)},[i,b]);return[y,T]}const gu=()=>{};function Ch(t,l=void 0,{namespace:e}={}){const[u,a]=V.useState(l),n=le();_e();const i=Ml(t,e),c=V.useRef(l);return V.useEffect(()=>{if(!n)return;const f=Qt();return a(c.current),f.outputs.add(i,a,gu,gu)},[i,n]),u}function Bh(t,{namespace:l}={}){const[e,u]=V.useState("pending"),a=le();_e();const n=Ml(t,l);return V.useEffect(()=>a?Qt().outputs.add(n,gu,u,gu):void 0,[n,a]),e}function kv(t,{namespace:l}={}){const[e,u]=V.useState(null),a=le();_e();const n=Ml(t,l);return V.useEffect(()=>a?(u(null),Qt().outputs.add(n,gu,gu,u)):void 0,[n,a]),e}function Iv(t,{namespace:l}={}){_e();const e=Ml(t,l),[u,a]=V.useState(()=>{const i=Qt().inputs.get(e);if(!i)return;const c=i.getValue();return c===Su?void 0:c}),n=le();return V.useEffect(()=>n?Qt().inputs.subscribe(e,f=>{a(f===Su?void 0:f)}):void 0,[e,n]),u}function Pv(t,l,{debounceMs:e=100,priority:u,namespace:a,type:n}={}){if(_e(),n!==void 0&&!/^[^\s:]+$/.test(n))throw new Error(`useSetShinyInput("${t}"): invalid type=${JSON.stringify(n)}. Must be non-empty and contain no whitespace or ':' characters.`);const i=Ml(t,a),f=V.useRef(l).current,d=le();return V.useEffect(()=>{if(!d)return;const m=Qt().inputs.getOrCreate(i,f);e!==void 0&&m.updateDebounceDelay(e),u&&m.updatePriority(u),m.updateType(n),m.setValue(m.getValue())},[i,d,e,u,f,n]),V.useCallback(r=>{if(!d)return;const y=Qt().inputs.get(i);if(!y){console.error(`Input ${i} not found`);return}y.setValue(r)},[i,d])}function tm(t,l,{namespace:e}={}){const u=le();_e();const a=Ml(t,e),n=V.useRef(l);n.current=l,V.useEffect(()=>{if(!u||!a)return;const i=f=>n.current(f),c=Hh();return c.addHandler(a,i),()=>{c.removeHandler(a,i)}},[u,a])}function le(){return V.useSyncExternalStore(_h,Mh,Mh)}function lm(){return V.useSyncExternalStore(_h,Dh,Dh)}let Yh=!1;function _e(){Yh||(Fv(),Zv(Qt().inputs),$v(()=>Qt().outputs),Kv(),Yh=!0)}function em({id:t,className:l,width:e,height:u,debounceMs:a=400,onRecalculating:n,namespace:i}){const c=Ml(t,i),f={namespace:null},[d,r]=Kn(`.clientdata_output_${c}_width`,Su,f),[m,y]=Kn(`.clientdata_output_${c}_height`,Su,f),[v]=Kn(`.clientdata_output_${c}_hidden`,!1,f),b=Ch(c,void 0,f),T=Bh(c,f),H=V.useRef(null),o=V.useRef(null),[s,h]=V.useState(0);V.useEffect(()=>{b&&h(E=>E+1)},[b]),V.useEffect(()=>{n&&n(T==="recalculating")},[T,n]);const S=V.useCallback(()=>{if(H.current){const E=H.current.clientWidth,_=H.current.clientHeight;E>0&&_>0&&(r(E),y(_))}},[r,y]);return V.useEffect(()=>{const E=H.current;if(!E)return;E.addEventListener("load",S);const _=Cf(()=>{E&&E.complete&&S()},a),z=new ResizeObserver(A=>{for(const M of A)M.target===E&&_()});return z.observe(E),()=>{E.removeEventListener("load",S),z.disconnect(),_.cancel()}},[H,s,r,y,a,S]),V.useEffect(()=>{if(b)return;const E=o.current;if(!E)return;const _=()=>{const M=E.clientWidth,R=E.clientHeight;M>0&&R>0&&(r(M),y(R))};_();const z=Cf(_,a),A=new ResizeObserver(()=>z());return A.observe(E),()=>{A.disconnect(),z.cancel()}},[b,r,y,a]),v?null:b?Oe.jsx("img",{ref:H,src:b.src,alt:"",className:l,style:{width:e,height:u},onLoad:S}):Oe.jsx("div",{ref:o,className:l,style:{width:e,height:u,display:"flex",alignItems:"center",justifyContent:"center",color:"#9ca3af"},children:Oe.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",style:{animation:"spin 1s linear infinite"},children:Oe.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2.5",strokeDasharray:"31.4 31.4",strokeLinecap:"round"})})})}class qh extends HTMLElement{constructor(){super(...arguments);K(this,"root",null);K(this,"slotContents",new Map)}captureSlots(e="[data-slot]"){const u=this.querySelectorAll(`:scope > ${e}`),a=new Set(u);u.forEach(i=>{const c=i.getAttribute("data-slot");c&&this.slotContents.set(c,Array.from(i.childNodes))});const n=Array.from(this.childNodes).filter(i=>!a.has(i));return n.length>0&&this.slotContents.set("__children__",n),this.slotContents}async mountSlot(e,u){var n,i;const a=this.slotContents.get(e);a&&u&&(a.forEach(c=>u.appendChild(c)),await((i=(n=window.Shiny)==null?void 0:n.bindAll)==null?void 0:i.call(n,u)))}get onSlotMount(){return this.mountSlot.bind(this)}getConfig(){const e={};for(const[u,a]of Object.entries(this.dataset))if(a!==void 0)try{e[u]=JSON.parse(a)}catch{e[u]=a}return e}get namespace(){return this.id||void 0}render(){const e=this.constructor.component;return e?Oe.jsx(e,{...this.getConfig()}):(console.error(`${this.constructor.name}: No static component defined`),null)}wrapWithProvider(e){return this.namespace?Oe.jsx(Sh,{namespace:this.namespace,children:e}):e}clearContent(){this.innerHTML=""}connectedCallback(){this.captureSlots(),this.clearContent(),this.root=Hf.createRoot(this),this.root.render(this.wrapWithProvider(this.render()))}disconnectedCallback(){var e,u,a;(u=(e=window.Shiny)==null?void 0:e.unbindAll)==null||u.call(e,this),(a=this.root)==null||a.unmount(),this.root=null}}K(qh,"component",null);function um(){window.shinyreact={useSetShinyInput:Pv,useShinyBusy:lm,useShinyInput:Kn,useShinyInputValue:Iv,useShinyOutputError:kv,useShinyOutputStatus:Bh,useShinyOutputValue:Ch,useShinyMessageHandler:tm,useShinyInitialized:le,ImageOutput:em,MISSING:Su,ShinyModuleProvider:Sh,ShinyReactComponentElement:qh,ShinyOutput:jv,React:Wf,ReactDOM:Cv}}um(),jh()})(); diff --git a/pkg-r/man/page_react.Rd b/pkg-r/man/page_react.Rd index 10ef0d89..3f45e95d 100644 --- a/pkg-r/man/page_react.Rd +++ b/pkg-r/man/page_react.Rd @@ -10,7 +10,8 @@ page_react( js_file = "ui.js", css_file = "ui.css", title = NULL, - lang = "en" + lang = "en", + shinyreact_js = "server" ) } \arguments{ @@ -29,6 +30,15 @@ that resolves to nothing usable (a missing \code{src_dir} is not an error — the bundle may not be built yet).} \item{lang}{HTML \code{lang} attribute.} + +\item{shinyreact_js}{Who supplies \code{shinyreact.js} (and \code{shinyreact.css}) to +the page. \code{"server"} (the default) serves them from the shinyreact package +as an \link[htmltools:htmlDependency]{htmltools::htmlDependency} — what a no-build app needs, and what +makes \code{window.shinyreact} exist. \code{"client"} is for an app whose own bundle +imports \verb{@posit/shinyreact} and therefore ships its own copy; serving them +too would put two copies of React and the hooks on one page. The +\verb{#shinyreact-config} tag is emitted either way; the npm-tier client +hard-errors without it. Mirrors Python's \code{page_react(shinyreact_js=)}.} } \value{ UI suitable for \code{shinyApp(ui = ...)}. diff --git a/pkg-r/man/page_react_html.Rd b/pkg-r/man/page_react_html.Rd index eb269864..c5896466 100644 --- a/pkg-r/man/page_react_html.Rd +++ b/pkg-r/man/page_react_html.Rd @@ -4,18 +4,29 @@ \alias{page_react_html} \title{Serve a React \code{index.html} document (the \code{ui.tsx} pattern)} \usage{ -page_react_html(path = "www/index.html", extra_deps = NULL) +page_react_html( + path = "www/index.html", + ..., + extra_deps = NULL, + shinyreact_js = "server" +) } \arguments{ \item{path}{Path to the HTML document. Defaults to \code{"www/index.html"}, relative to the working directory.} +\item{...}{Ignored.} + \item{extra_deps}{A list of additional \link[htmltools:htmlDependency]{htmltools::htmlDependency} objects to render at the placeholder. A complete document has no tag tree to attach dependencies to, so this is the only way in — the counterpart of \code{\link[=page_react]{page_react()}}'s \code{...}. They render \emph{after} Shiny's and shinyreact's, so they can rely on \code{window.shinyreact} existing. Mirrors Python's \code{page_react_html(extra_deps=)}.} + +\item{shinyreact_js}{Who supplies \code{shinyreact.js} / \code{shinyreact.css}: +\code{"server"} (the default) or \code{"client"} for an npm-tier app whose bundle +imports \verb{@posit/shinyreact} — see \code{\link[=page_react]{page_react()}}.} } \value{ UI suitable for \code{shinyApp(ui = ...)}. diff --git a/pkg-r/tests/testthat/test-page.R b/pkg-r/tests/testthat/test-page.R index 82dca3e0..34f77a47 100644 --- a/pkg-r/tests/testthat/test-page.R +++ b/pkg-r/tests/testthat/test-page.R @@ -156,6 +156,62 @@ test_that("page_react attaches bundle, app dep, and config", { expect_match(html, 'id="shinyreact-config"', fixed = TRUE) }) +test_that("page_react(shinyreact_js = 'client') omits the bundle", { + # npm tier: the client bundle ships its own copy, so shinyreact.js must not be + # served too -- but the config tag is still required (#217). Mirrors Python's + # test_page_react_shinyreact_js_client_omits_bundle. + dir <- local_react_app() + ui <- page_react(shinyreact_js = "client") + names <- vapply(htmltools::findDependencies(ui), function(d) d$name, "") + expect_false("shinyreact" %in% names) + expect_true(basename(dir) %in% names) + html <- dep_tags_html(ui) + expect_no_match(html, "shinyreact.js", fixed = TRUE) + expect_match(html, 'id="shinyreact-config"', fixed = TRUE) +}) + +test_that("page_react_html(shinyreact_js = 'client') omits the bundle", { + # Mirrors Python's test_page_react_html_shinyreact_js_client_omits_bundle. + tmp <- withr::local_tempfile(fileext = ".html") + write_full_doc(tmp) + html <- render_document(page_react_html(tmp, shinyreact_js = "client")) + expect_no_match(html, "shinyreact.js", fixed = TRUE) + expect_match(html, 'id="shinyreact-config"', fixed = TRUE) +}) + +test_that("shinyreact_js rejects an unknown value", { + # A typo fails loudly, naming the value and the valid ones (#217). Mirrors + # Python's test_shinyreact_js_rejects_an_unknown_value. + local_react_app() + expect_error(page_react(shinyreact_js = "sever"), "sever") + expect_error(page_react(shinyreact_js = "sever"), "client") + + tmp <- withr::local_tempfile(fileext = ".html") + write_full_doc(tmp) + expect_error(page_react_html(tmp, shinyreact_js = "sever"), "sever") +}) + +test_that("page_react_html() rejects anything passed to ...", { + # The dots exist only to force the later arguments to be named -- R's + # counterpart of Python's keyword-only `*`. Mirrors Python's + # test_page_react_html_arguments_after_path_are_keyword_only. + tmp <- withr::local_tempfile(fileext = ".html") + write_full_doc(tmp) + + # Asserted by rlang's condition class rather than its wording, which is + # rlang's to change; what is ours is that the check runs at all. + expect_error( + page_react_html(tmp, list()), + class = "rlib_error_dots_nonempty" + ) + # A misspelled name is named back, which is the whole diagnosis. + expect_error(page_react_html(tmp, extra_dep = list()), "extra_dep") + + # The named arguments still work. + expect_no_error(page_react_html(tmp, extra_deps = NULL)) + expect_no_error(page_react_html(tmp, shinyreact_js = "client")) +}) + test_that("page_react title defaults to the app folder name", { # Mirrors Python's test_page_react_title_defaults_to_app_folder_name. dir <- local_react_app()