reactpy 2.0.0b3__py3-none-any.whl → 2.0.0b5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
reactpy/core/vdom.py CHANGED
@@ -3,10 +3,9 @@ from __future__ import annotations
3
3
 
4
4
  import json
5
5
  import re
6
- from collections.abc import Mapping, Sequence
6
+ from collections.abc import Callable, Mapping, Sequence
7
7
  from typing import (
8
8
  Any,
9
- Callable,
10
9
  cast,
11
10
  overload,
12
11
  )
@@ -18,11 +17,11 @@ from reactpy.config import REACTPY_CHECK_JSON_ATTRS, REACTPY_DEBUG
18
17
  from reactpy.core._f_back import f_module_name
19
18
  from reactpy.core.events import EventHandler, to_event_handler_function
20
19
  from reactpy.types import (
21
- ComponentType,
20
+ BaseEventHandler,
21
+ Component,
22
22
  CustomVdomConstructor,
23
23
  EllipsisRepr,
24
24
  EventHandlerDict,
25
- EventHandlerType,
26
25
  ImportSourceDict,
27
26
  InlineJavaScript,
28
27
  InlineJavaScriptDict,
@@ -232,13 +231,13 @@ def separate_attributes_handlers_and_inline_javascript(
232
231
  attributes: Mapping[str, Any],
233
232
  ) -> tuple[VdomAttributes, EventHandlerDict, InlineJavaScriptDict]:
234
233
  _attributes: VdomAttributes = {}
235
- _event_handlers: dict[str, EventHandlerType] = {}
234
+ _event_handlers: dict[str, BaseEventHandler] = {}
236
235
  _inline_javascript: dict[str, InlineJavaScript] = {}
237
236
 
238
237
  for k, v in attributes.items():
239
238
  if callable(v):
240
239
  _event_handlers[k] = EventHandler(to_event_handler_function(v))
241
- elif isinstance(v, EventHandler):
240
+ elif isinstance(v, BaseEventHandler):
242
241
  _event_handlers[k] = v
243
242
  elif EVENT_ATTRIBUTE_PATTERN.match(k) and isinstance(v, str):
244
243
  _inline_javascript[k] = InlineJavaScript(v)
@@ -276,7 +275,7 @@ def _validate_child_key_integrity(value: Any) -> None:
276
275
  )
277
276
  else:
278
277
  for child in value:
279
- if isinstance(child, ComponentType) and child.key is None:
278
+ if isinstance(child, Component) and child.key is None:
280
279
  warn(f"Key not specified for child in list {child}", UserWarning)
281
280
  elif isinstance(child, Mapping) and "key" not in child:
282
281
  # remove 'children' to reduce log spam
@@ -1,5 +1,10 @@
1
- from reactpy.executors.asgi.middleware import ReactPyMiddleware
2
- from reactpy.executors.asgi.pyscript import ReactPyCsr
3
- from reactpy.executors.asgi.standalone import ReactPy
1
+ try:
2
+ from reactpy.executors.asgi.middleware import ReactPyMiddleware
3
+ from reactpy.executors.asgi.pyscript import ReactPyCsr
4
+ from reactpy.executors.asgi.standalone import ReactPy
4
5
 
5
- __all__ = ["ReactPy", "ReactPyCsr", "ReactPyMiddleware"]
6
+ __all__ = ["ReactPy", "ReactPyCsr", "ReactPyMiddleware"]
7
+ except ModuleNotFoundError as e:
8
+ raise ModuleNotFoundError(
9
+ "ASGI executors require the 'reactpy[asgi]' extra to be installed."
10
+ ) from e
@@ -8,13 +8,12 @@ import urllib.parse
8
8
  from collections.abc import Iterable
9
9
  from dataclasses import dataclass
10
10
  from pathlib import Path
11
- from typing import Any
11
+ from typing import Any, Unpack
12
12
 
13
13
  import orjson
14
14
  from asgi_tools import ResponseText, ResponseWebSocket
15
15
  from asgiref.compatibility import guarantee_single_callable
16
16
  from servestatic import ServeStaticASGI
17
- from typing_extensions import Unpack
18
17
 
19
18
  from reactpy import config
20
19
  from reactpy.core.hooks import ConnectionContext
@@ -4,12 +4,10 @@ import hashlib
4
4
  import re
5
5
  from collections.abc import Sequence
6
6
  from dataclasses import dataclass
7
- from datetime import datetime, timezone
7
+ from datetime import UTC, datetime
8
8
  from email.utils import formatdate
9
9
  from pathlib import Path
10
- from typing import Any
11
-
12
- from typing_extensions import Unpack
10
+ from typing import Any, Unpack
13
11
 
14
12
  from reactpy import html
15
13
  from reactpy.executors.asgi.middleware import ReactPyMiddleware
@@ -118,6 +116,4 @@ class ReactPyPyscriptApp(ReactPyApp):
118
116
  "</html>"
119
117
  )
120
118
  self._etag = f'"{hashlib.md5(self._index_html.encode(), usedforsecurity=False).hexdigest()}"'
121
- self._last_modified = formatdate(
122
- datetime.now(tz=timezone.utc).timestamp(), usegmt=True
123
- )
119
+ self._last_modified = formatdate(datetime.now(tz=UTC).timestamp(), usegmt=True)
@@ -2,14 +2,14 @@ from __future__ import annotations
2
2
 
3
3
  import hashlib
4
4
  import re
5
+ from collections.abc import Callable
5
6
  from dataclasses import dataclass
6
- from datetime import datetime, timezone
7
+ from datetime import UTC, datetime
7
8
  from email.utils import formatdate
8
9
  from logging import getLogger
9
- from typing import Callable, Literal, cast, overload
10
+ from typing import Literal, Unpack, cast, overload
10
11
 
11
12
  from asgi_tools import ResponseHTML
12
- from typing_extensions import Unpack
13
13
 
14
14
  from reactpy import html
15
15
  from reactpy.executors.asgi.middleware import ReactPyMiddleware
@@ -239,6 +239,4 @@ class ReactPyApp:
239
239
  "</html>"
240
240
  )
241
241
  self._etag = f'"{hashlib.md5(self._index_html.encode(), usedforsecurity=False).hexdigest()}"'
242
- self._last_modified = formatdate(
243
- datetime.now(tz=timezone.utc).timestamp(), usegmt=True
244
- )
242
+ self._last_modified = formatdate(datetime.now(tz=UTC).timestamp(), usegmt=True)
@@ -2,8 +2,8 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from collections.abc import Awaitable, MutableMapping
6
- from typing import Any, Callable, Protocol
5
+ from collections.abc import Awaitable, Callable, MutableMapping
6
+ from typing import Any, Protocol
7
7
 
8
8
  from asgiref import typing as asgi_types
9
9
 
@@ -5,7 +5,7 @@ from typing import TYPE_CHECKING
5
5
 
6
6
  from reactpy import component, hooks
7
7
  from reactpy.pyscript.utils import pyscript_component_html
8
- from reactpy.types import ComponentType, Key
8
+ from reactpy.types import Component, Key
9
9
  from reactpy.utils import string_to_reactpy
10
10
 
11
11
  if TYPE_CHECKING:
@@ -39,10 +39,10 @@ def _pyscript_component(
39
39
 
40
40
  def pyscript_component(
41
41
  *file_paths: str | Path,
42
- initial: str | VdomDict | ComponentType = "",
42
+ initial: str | VdomDict | Component = "",
43
43
  root: str = "root",
44
44
  key: Key | None = None,
45
- ) -> ComponentType:
45
+ ) -> Component:
46
46
  """
47
47
  Args:
48
48
  file_paths: File path to your client-side ReactPy component. If multiple paths are \
reactpy/pyscript/utils.py CHANGED
@@ -1,4 +1,4 @@
1
- # ruff: noqa: S603, S607
1
+ # ruff: noqa: S607
2
2
  from __future__ import annotations
3
3
 
4
4
  import functools
@@ -11,10 +11,9 @@ from glob import glob
11
11
  from logging import getLogger
12
12
  from pathlib import Path
13
13
  from typing import TYPE_CHECKING, Any
14
+ from urllib import request
14
15
  from uuid import uuid4
15
16
 
16
- import jsonpointer
17
-
18
17
  import reactpy
19
18
  from reactpy.config import REACTPY_DEBUG, REACTPY_PATH_PREFIX, REACTPY_WEB_MODULES_DIR
20
19
  from reactpy.types import VdomDict
@@ -112,24 +111,21 @@ def extend_pyscript_config(
112
111
  extra_js: dict[str, str] | str,
113
112
  config: dict[str, Any] | str,
114
113
  ) -> str:
115
- import orjson
116
-
117
114
  # Extends ReactPy's default PyScript config with user provided values.
118
115
  pyscript_config: dict[str, Any] = {
119
- "packages": [
120
- reactpy_version_string(),
121
- f"jsonpointer=={jsonpointer.__version__}",
122
- "ssl",
123
- ],
116
+ "packages": [reactpy_version_string(), "jsonpointer==3.*", "ssl"],
124
117
  "js_modules": {
125
118
  "main": {
126
119
  f"{REACTPY_PATH_PREFIX.current}static/morphdom/morphdom-esm.js": "morphdom"
127
120
  }
128
121
  },
129
- "packages_cache": "never",
130
122
  }
131
123
  pyscript_config["packages"].extend(extra_py)
132
124
 
125
+ # FIXME: https://github.com/pyscript/pyscript/issues/2282
126
+ if any(pkg.endswith(".whl") for pkg in pyscript_config["packages"]):
127
+ pyscript_config["packages_cache"] = "never"
128
+
133
129
  # Extend the JavaScript dependency list
134
130
  if extra_js and isinstance(extra_js, str):
135
131
  pyscript_config["js_modules"]["main"].update(json.loads(extra_js))
@@ -141,7 +137,7 @@ def extend_pyscript_config(
141
137
  pyscript_config.update(json.loads(config))
142
138
  elif config and isinstance(config, dict):
143
139
  pyscript_config.update(config)
144
- return orjson.dumps(pyscript_config).decode("utf-8")
140
+ return json.dumps(pyscript_config)
145
141
 
146
142
 
147
143
  def reactpy_version_string() -> str: # nocov
@@ -150,10 +146,10 @@ def reactpy_version_string() -> str: # nocov
150
146
  local_version = reactpy.__version__
151
147
 
152
148
  # Get a list of all versions via `pip index versions`
153
- result = cached_pip_index_versions("reactpy")
149
+ result = get_reactpy_versions()
154
150
 
155
151
  # Check if the command failed
156
- if result.returncode != 0:
152
+ if not result:
157
153
  _logger.warning(
158
154
  "Failed to verify what versions of ReactPy exist on PyPi. "
159
155
  "PyScript functionality may not work as expected.",
@@ -161,16 +157,8 @@ def reactpy_version_string() -> str: # nocov
161
157
  return f"reactpy=={local_version}"
162
158
 
163
159
  # Have `pip` tell us what versions are available
164
- available_version_symbol = "Available versions: "
165
- latest_version_symbol = "LATEST: "
166
- known_versions: list[str] = []
167
- latest_version: str = ""
168
- for line in result.stdout.splitlines():
169
- if line.startswith(available_version_symbol):
170
- known_versions.extend(line[len(available_version_symbol) :].split(", "))
171
- elif latest_version_symbol in line:
172
- symbol_postion = line.index(latest_version_symbol)
173
- latest_version = line[symbol_postion + len(latest_version_symbol) :].strip()
160
+ known_versions: list[str] = result.get("versions", [])
161
+ latest_version: str = result.get("latest", "")
174
162
 
175
163
  # Return early if the version is available on PyPi and we're not in a CI environment
176
164
  if local_version in known_versions and not GITHUB_ACTIONS:
@@ -179,8 +167,8 @@ def reactpy_version_string() -> str: # nocov
179
167
  # We are now determining an alternative method of installing ReactPy for PyScript
180
168
  if not GITHUB_ACTIONS:
181
169
  _logger.warning(
182
- "Your current version of ReactPy isn't available on PyPi. Since a packaged version "
183
- "of ReactPy is required for PyScript, we are attempting to find an alternative method..."
170
+ "Your ReactPy version isn't available on PyPi. "
171
+ "Attempting to find an alternative installation method for PyScript...",
184
172
  )
185
173
 
186
174
  # Build a local wheel for ReactPy, if needed
@@ -195,42 +183,51 @@ def reactpy_version_string() -> str: # nocov
195
183
  check=False,
196
184
  cwd=Path(reactpy.__file__).parent.parent.parent,
197
185
  )
198
- wheel_glob = glob(str(dist_dir / f"reactpy-{local_version}-*.whl"))
186
+ wheel_glob = glob(str(dist_dir / f"reactpy-{local_version}-*.whl"))
199
187
 
200
- # Building a local wheel failed, try our best to give the user any possible version.
201
- if not wheel_glob:
202
- if latest_version:
188
+ # Move the local wheel to the web modules directory, if it exists
189
+ if wheel_glob:
190
+ wheel_file = Path(wheel_glob[0])
191
+ new_path = REACTPY_WEB_MODULES_DIR.current / wheel_file.name
192
+ if not new_path.exists():
203
193
  _logger.warning(
204
- "Failed to build a local wheel for ReactPy, likely due to missing build dependencies. "
205
- "PyScript will default to using the latest ReactPy version on PyPi."
194
+ "PyScript will utilize local wheel '%s'.",
195
+ wheel_file.name,
206
196
  )
207
- return f"reactpy=={latest_version}"
208
- _logger.error(
209
- "Failed to build a local wheel for ReactPy, and could not determine the latest version on PyPi. "
210
- "PyScript functionality may not work as expected.",
211
- )
212
- return f"reactpy=={local_version}"
197
+ shutil.copy(wheel_file, new_path)
198
+ return f"{REACTPY_PATH_PREFIX.current}modules/{wheel_file.name}"
213
199
 
214
- # Move the local wheel file to the web modules directory, if needed
215
- wheel_file = Path(wheel_glob[0])
216
- new_path = REACTPY_WEB_MODULES_DIR.current / wheel_file.name
217
- if not new_path.exists():
200
+ # Building a local wheel failed, try our best to give the user any version.
201
+ if latest_version:
218
202
  _logger.warning(
219
- "PyScript will utilize local wheel '%s'.",
220
- wheel_file.name,
203
+ "Failed to build a local wheel for ReactPy, likely due to missing build dependencies. "
204
+ "PyScript will default to using the latest ReactPy version on PyPi."
221
205
  )
222
- shutil.copy(wheel_file, new_path)
223
- return f"{REACTPY_PATH_PREFIX.current}modules/{wheel_file.name}"
206
+ return f"reactpy=={latest_version}"
207
+ _logger.error(
208
+ "Failed to build a local wheel for ReactPy, and could not determine the latest version on PyPi. "
209
+ "PyScript functionality may not work as expected.",
210
+ )
211
+ return f"reactpy=={local_version}"
224
212
 
225
213
 
226
214
  @functools.cache
227
- def cached_pip_index_versions(package_name: str) -> subprocess.CompletedProcess[str]:
228
- return subprocess.run(
229
- ["pip", "index", "versions", package_name],
230
- capture_output=True,
231
- text=True,
232
- check=False,
233
- )
215
+ def get_reactpy_versions() -> dict[Any, Any]:
216
+ """Fetches the available versions of a package from PyPI."""
217
+ try:
218
+ try:
219
+ response = request.urlopen("https://pypi.org/pypi/reactpy/json", timeout=5)
220
+ except Exception:
221
+ response = request.urlopen("http://pypi.org/pypi/reactpy/json", timeout=5)
222
+ if response.status == 200: # noqa: PLR2004
223
+ data = json.load(response)
224
+ versions = list(data.get("releases", {}).keys())
225
+ latest = data.get("info", {}).get("version", "")
226
+ if versions and latest:
227
+ return {"versions": versions, "latest": latest}
228
+ except Exception:
229
+ _logger.exception("Error fetching ReactPy package versions from PyPI!")
230
+ return {}
234
231
 
235
232
 
236
233
  @functools.cache
reactpy/static/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var C1=Object.create;var{getPrototypeOf:N1,defineProperty:I0,getOwnPropertyNames:S1}=Object;var g1=Object.prototype.hasOwnProperty;var j1=(X,Y,Z)=>{Z=X!=null?C1(N1(X)):{};let K=Y||!X||!X.__esModule?I0(Z,"default",{value:X,enumerable:!0}):Z;for(let Q of S1(X))if(!g1.call(K,Q))I0(K,Q,{get:()=>X[Q],enumerable:!0});return K};var C0=(X,Y)=>()=>(Y||X((Y={exports:{}}).exports,Y),Y.exports);var u0=C0((N4,i0)=>{var m1=Object.prototype.hasOwnProperty,c1=Object.prototype.toString;i0.exports=function(Y,Z,K){if(c1.call(Z)!=="[object Function]")throw TypeError("iterator must be a function");var Q=Y.length;if(Q===+Q)for(var G=0;G<Q;G++)Z.call(K,Y[G],G,Y);else for(var W in Y)if(m1.call(Y,W))Z.call(K,Y[W],W,Y)}});var r0=C0((S4,l0)=>{var s1=u0();l0.exports=B;function B(X,Y,Z){if(arguments.length===3)return B.set(X,Y,Z);if(arguments.length===2)return B.get(X,Y);var K=B.bind(B,X);for(var Q in B)if(B.hasOwnProperty(Q))K[Q]=B[Q].bind(K,X);return K}B.get=function(Y,Z){var K=Array.isArray(Z)?Z:B.parse(Z);for(var Q=0;Q<K.length;++Q){var G=K[Q];if(!(typeof Y=="object"&&(G in Y)))throw Error("Invalid reference token: "+G);Y=Y[G]}return Y};B.set=function(Y,Z,K){var Q=Array.isArray(Z)?Z:B.parse(Z),G=Q[0];if(Q.length===0)throw Error("Can not set the root object");for(var W=0;W<Q.length-1;++W){var q=Q[W];if(typeof q!=="string"&&typeof q!=="number")q=String(q);if(q==="__proto__"||q==="constructor"||q==="prototype")continue;if(q==="-"&&Array.isArray(Y))q=Y.length;if(G=Q[W+1],!(q in Y))if(G.match(/^(\d+|-)$/))Y[q]=[];else Y[q]={};Y=Y[q]}if(G==="-"&&Array.isArray(Y))G=Y.length;return Y[G]=K,this};B.remove=function(X,Y){var Z=Array.isArray(Y)?Y:B.parse(Y),K=Z[Z.length-1];if(K===void 0)throw Error('Invalid JSON pointer for remove: "'+Y+'"');var Q=B.get(X,Z.slice(0,-1));if(Array.isArray(Q)){var G=+K;if(K===""&&isNaN(G))throw Error('Invalid array index: "'+K+'"');Array.prototype.splice.call(Q,G,1)}else delete Q[K]};B.dict=function(Y,Z){var K={};return B.walk(Y,function(Q,G){K[G]=Q},Z),K};B.walk=function(Y,Z,K){var Q=[];K=K||function(G){var W=Object.prototype.toString.call(G);return W==="[object Object]"||W==="[object Array]"},function G(W){s1(W,function(q,F){if(Q.push(String(F)),K(q))G(q);else Z(q,B.compile(Q));Q.pop()})}(Y)};B.has=function(Y,Z){try{B.get(Y,Z)}catch(K){return!1}return!0};B.escape=function(Y){return Y.toString().replace(/~/g,"~0").replace(/\//g,"~1")};B.unescape=function(Y){return Y.replace(/~1/g,"/").replace(/~0/g,"~")};B.parse=function(Y){if(Y==="")return[];if(Y.charAt(0)!=="/")throw Error("Invalid JSON pointer: "+Y);return Y.substring(1).split(/\//).map(B.unescape)};B.compile=function(Y){if(Y.length===0)return"";return"/"+Y.map(B.escape).join("/")}});var M={log:(...X)=>console.log("[ReactPy]",...X),info:(...X)=>console.info("[ReactPy]",...X),warn:(...X)=>console.warn("[ReactPy]",...X),error:(...X)=>console.error("[ReactPy]",...X)};function N0(X){let{interval:Y,maxInterval:Z,maxRetries:K,backoffMultiplier:Q}=X,G=0,W=Y,q=!1,F=!1,$={},z=()=>{if(F)return;$.current=new WebSocket(X.url),$.current.onopen=()=>{if(q=!0,M.info("Connected!"),W=Y,G=0,X.onOpen)X.onOpen()},$.current.onmessage=(J)=>{if(X.onMessage)X.onMessage(J)},$.current.onclose=()=>{if(X.onClose)X.onClose();if(!q){M.info("Failed to connect!");return}if(M.info("Disconnected!"),G>=K){M.info("Connection max retries exhausted!");return}M.info(`Reconnecting in ${(W/1000).toPrecision(4)} seconds...`),setTimeout(z,W),W=b1(W,Q,Z),G++}};return X.readyPromise.then(()=>M.info("Starting client...")).then(z),$}function b1(X,Y,Z){return Math.min(X*Y,Z)}class S0{handlers={};ready;resolveReady;constructor(){this.resolveReady=()=>{},this.ready=new Promise((X)=>this.resolveReady=X)}onMessage(X,Y){return(this.handlers[X]||(this.handlers[X]=[])).push(Y),this.resolveReady(void 0),()=>{this.handlers[X]=this.handlers[X].filter((Z)=>Z!==Y)}}handleIncoming(X){if(!X.type){M.warn("Received message without type",X);return}let Y=this.handlers[X.type];if(!Y){M.warn("Received message without handler",X);return}Y.forEach((Z)=>Z(X))}}class F0 extends S0{urls;socket;mountElement;constructor(X){super();this.urls=X.urls,this.mountElement=X.mountElement,this.socket=N0({url:this.urls.componentUrl,readyPromise:this.ready,...X.reconnectOptions,onMessage:(Y)=>this.handleIncoming(JSON.parse(Y.data))})}sendMessage(X){this.socket.current?.send(JSON.stringify(X))}loadModule(X){return import(`${this.urls.jsModulesPath}${X}`)}}var n,H,y0,y1,y,g0,f0,v0,x0,B0,H0,z0,k0,s={},h0=[],f1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,p=Array.isArray;function C(X,Y){for(var Z in Y)X[Z]=Y[Z];return X}function w0(X){X&&X.parentNode&&X.parentNode.removeChild(X)}function S(X,Y,Z){var K,Q,G,W={};for(G in Y)G=="key"?K=Y[G]:G=="ref"?Q=Y[G]:W[G]=Y[G];if(arguments.length>2&&(W.children=arguments.length>3?n.call(arguments,2):Z),typeof X=="function"&&X.defaultProps!=null)for(G in X.defaultProps)W[G]===void 0&&(W[G]=X.defaultProps[G]);return o(X,W,K,Q,null)}function o(X,Y,Z,K,Q){var G={type:X,props:Y,key:Z,ref:K,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:Q==null?++y0:Q,__i:-1,__u:0};return Q==null&&H.vnode!=null&&H.vnode(G),G}function T(X){return X.children}function E(X,Y){this.props=X,this.context=Y}function x(X,Y){if(Y==null)return X.__?x(X.__,X.__i+1):null;for(var Z;Y<X.__k.length;Y++)if((Z=X.__k[Y])!=null&&Z.__e!=null)return Z.__e;return typeof X.type=="function"?x(X):null}function d0(X){var Y,Z;if((X=X.__)!=null&&X.__c!=null){for(X.__e=X.__c.base=null,Y=0;Y<X.__k.length;Y++)if((Z=X.__k[Y])!=null&&Z.__e!=null){X.__e=X.__c.base=Z.__e;break}return d0(X)}}function V0(X){(!X.__d&&(X.__d=!0)&&y.push(X)&&!t.__r++||g0!=H.debounceRendering)&&((g0=H.debounceRendering)||f0)(t)}function t(){for(var X,Y,Z,K,Q,G,W,q=1;y.length;)y.length>q&&y.sort(v0),X=y.shift(),q=y.length,X.__d&&(Z=void 0,K=void 0,Q=(K=(Y=X).__v).__e,G=[],W=[],Y.__P&&((Z=C({},K)).__v=K.__v+1,H.vnode&&H.vnode(Z),U0(Y.__P,Z,K,Y.__n,Y.__P.namespaceURI,32&K.__u?[Q]:null,G,Q==null?x(K):Q,!!(32&K.__u),W),Z.__v=K.__v,Z.__.__k[Z.__i]=Z,s0(G,Z,W),K.__e=K.__=null,Z.__e!=Q&&d0(Z)));t.__r=0}function m0(X,Y,Z,K,Q,G,W,q,F,$,z){var J,A,V,L,D,P,U,w=K&&K.__k||h0,N=Y.length;for(F=v1(Z,Y,w,F,N),J=0;J<N;J++)(V=Z.__k[J])!=null&&(A=V.__i==-1?s:w[V.__i]||s,V.__i=J,P=U0(X,V,A,Q,G,W,q,F,$,z),L=V.__e,V.ref&&A.ref!=V.ref&&(A.ref&&O0(A.ref,null,V),z.push(V.ref,V.__c||L,V)),D==null&&L!=null&&(D=L),(U=!!(4&V.__u))||A.__k===V.__k?F=c0(V,F,X,U):typeof V.type=="function"&&P!==void 0?F=P:L&&(F=L.nextSibling),V.__u&=-7);return Z.__e=D,F}function v1(X,Y,Z,K,Q){var G,W,q,F,$,z=Z.length,J=z,A=0;for(X.__k=Array(Q),G=0;G<Q;G++)(W=Y[G])!=null&&typeof W!="boolean"&&typeof W!="function"?(typeof W=="string"||typeof W=="number"||typeof W=="bigint"||W.constructor==String?W=X.__k[G]=o(null,W,null,null,null):p(W)?W=X.__k[G]=o(T,{children:W},null,null,null):W.constructor==null&&W.__b>0?W=X.__k[G]=o(W.type,W.props,W.key,W.ref?W.ref:null,W.__v):X.__k[G]=W,F=G+A,W.__=X,W.__b=X.__b+1,($=W.__i=x1(W,Z,F,J))!=-1&&(J--,(q=Z[$])&&(q.__u|=2)),q==null||q.__v==null?($==-1&&(Q>z?A--:Q<z&&A++),typeof W.type!="function"&&(W.__u|=4)):$!=F&&($==F-1?A--:$==F+1?A++:($>F?A--:A++,W.__u|=4))):X.__k[G]=null;if(J)for(G=0;G<z;G++)(q=Z[G])!=null&&(2&q.__u)==0&&(q.__e==K&&(K=x(q)),a0(q,q));return K}function c0(X,Y,Z,K){var Q,G;if(typeof X.type=="function"){for(Q=X.__k,G=0;Q&&G<Q.length;G++)Q[G]&&(Q[G].__=X,Y=c0(Q[G],Y,Z,K));return Y}X.__e!=Y&&(K&&(Y&&X.type&&!Y.parentNode&&(Y=x(X)),Z.insertBefore(X.__e,Y||null)),Y=X.__e);do Y=Y&&Y.nextSibling;while(Y!=null&&Y.nodeType==8);return Y}function a(X,Y){return Y=Y||[],X==null||typeof X=="boolean"||(p(X)?X.some(function(Z){a(Z,Y)}):Y.push(X)),Y}function x1(X,Y,Z,K){var Q,G,W,q=X.key,F=X.type,$=Y[Z],z=$!=null&&(2&$.__u)==0;if($===null&&q==null||z&&q==$.key&&F==$.type)return Z;if(K>(z?1:0)){for(Q=Z-1,G=Z+1;Q>=0||G<Y.length;)if(($=Y[W=Q>=0?Q--:G++])!=null&&(2&$.__u)==0&&q==$.key&&F==$.type)return W}return-1}function j0(X,Y,Z){Y[0]=="-"?X.setProperty(Y,Z==null?"":Z):X[Y]=Z==null?"":typeof Z!="number"||f1.test(Y)?Z:Z+"px"}function r(X,Y,Z,K,Q){var G,W;X:if(Y=="style")if(typeof Z=="string")X.style.cssText=Z;else{if(typeof K=="string"&&(X.style.cssText=K=""),K)for(Y in K)Z&&Y in Z||j0(X.style,Y,"");if(Z)for(Y in Z)K&&Z[Y]==K[Y]||j0(X.style,Y,Z[Y])}else if(Y[0]=="o"&&Y[1]=="n")G=Y!=(Y=Y.replace(x0,"$1")),W=Y.toLowerCase(),Y=W in X||Y=="onFocusOut"||Y=="onFocusIn"?W.slice(2):Y.slice(2),X.l||(X.l={}),X.l[Y+G]=Z,Z?K?Z.u=K.u:(Z.u=B0,X.addEventListener(Y,G?z0:H0,G)):X.removeEventListener(Y,G?z0:H0,G);else{if(Q=="http://www.w3.org/2000/svg")Y=Y.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(Y!="width"&&Y!="height"&&Y!="href"&&Y!="list"&&Y!="form"&&Y!="tabIndex"&&Y!="download"&&Y!="rowSpan"&&Y!="colSpan"&&Y!="role"&&Y!="popover"&&Y in X)try{X[Y]=Z==null?"":Z;break X}catch(q){}typeof Z=="function"||(Z==null||Z===!1&&Y[4]!="-"?X.removeAttribute(Y):X.setAttribute(Y,Y=="popover"&&Z==1?"":Z))}}function b0(X){return function(Y){if(this.l){var Z=this.l[Y.type+X];if(Y.t==null)Y.t=B0++;else if(Y.t<Z.u)return;return Z(H.event?H.event(Y):Y)}}}function U0(X,Y,Z,K,Q,G,W,q,F,$){var z,J,A,V,L,D,P,U,w,N,b,u,m,E0,l,c,$0,I=Y.type;if(Y.constructor!=null)return null;128&Z.__u&&(F=!!(32&Z.__u),G=[q=Y.__e=Z.__e]),(z=H.__b)&&z(Y);X:if(typeof I=="function")try{if(U=Y.props,w="prototype"in I&&I.prototype.render,N=(z=I.contextType)&&K[z.__c],b=z?N?N.props.value:z.__:K,Z.__c?P=(J=Y.__c=Z.__c).__=J.__E:(w?Y.__c=J=new I(U,b):(Y.__c=J=new E(U,b),J.constructor=I,J.render=h1),N&&N.sub(J),J.state||(J.state={}),J.__n=K,A=J.__d=!0,J.__h=[],J._sb=[]),w&&J.__s==null&&(J.__s=J.state),w&&I.getDerivedStateFromProps!=null&&(J.__s==J.state&&(J.__s=C({},J.__s)),C(J.__s,I.getDerivedStateFromProps(U,J.__s))),V=J.props,L=J.state,J.__v=Y,A)w&&I.getDerivedStateFromProps==null&&J.componentWillMount!=null&&J.componentWillMount(),w&&J.componentDidMount!=null&&J.__h.push(J.componentDidMount);else{if(w&&I.getDerivedStateFromProps==null&&U!==V&&J.componentWillReceiveProps!=null&&J.componentWillReceiveProps(U,b),Y.__v==Z.__v||!J.__e&&J.shouldComponentUpdate!=null&&J.shouldComponentUpdate(U,J.__s,b)===!1){for(Y.__v!=Z.__v&&(J.props=U,J.state=J.__s,J.__d=!1),Y.__e=Z.__e,Y.__k=Z.__k,Y.__k.some(function(v){v&&(v.__=Y)}),u=0;u<J._sb.length;u++)J.__h.push(J._sb[u]);J._sb=[],J.__h.length&&W.push(J);break X}J.componentWillUpdate!=null&&J.componentWillUpdate(U,J.__s,b),w&&J.componentDidUpdate!=null&&J.__h.push(function(){J.componentDidUpdate(V,L,D)})}if(J.context=b,J.props=U,J.__P=X,J.__e=!1,m=H.__r,E0=0,w){for(J.state=J.__s,J.__d=!1,m&&m(Y),z=J.render(J.props,J.state,J.context),l=0;l<J._sb.length;l++)J.__h.push(J._sb[l]);J._sb=[]}else do J.__d=!1,m&&m(Y),z=J.render(J.props,J.state,J.context),J.state=J.__s;while(J.__d&&++E0<25);J.state=J.__s,J.getChildContext!=null&&(K=C(C({},K),J.getChildContext())),w&&!A&&J.getSnapshotBeforeUpdate!=null&&(D=J.getSnapshotBeforeUpdate(V,L)),c=z,z!=null&&z.type===T&&z.key==null&&(c=p0(z.props.children)),q=m0(X,p(c)?c:[c],Y,Z,K,Q,G,W,q,F,$),J.base=Y.__e,Y.__u&=-161,J.__h.length&&W.push(J),P&&(J.__E=J.__=null)}catch(v){if(Y.__v=null,F||G!=null)if(v.then){for(Y.__u|=F?160:128;q&&q.nodeType==8&&q.nextSibling;)q=q.nextSibling;G[G.indexOf(q)]=null,Y.__e=q}else{for($0=G.length;$0--;)w0(G[$0]);A0(Y)}else Y.__e=Z.__e,Y.__k=Z.__k,v.then||A0(Y);H.__e(v,Y,Z)}else G==null&&Y.__v==Z.__v?(Y.__k=Z.__k,Y.__e=Z.__e):q=Y.__e=k1(Z.__e,Y,Z,K,Q,G,W,F,$);return(z=H.diffed)&&z(Y),128&Y.__u?void 0:q}function A0(X){X&&X.__c&&(X.__c.__e=!0),X&&X.__k&&X.__k.forEach(A0)}function s0(X,Y,Z){for(var K=0;K<Z.length;K++)O0(Z[K],Z[++K],Z[++K]);H.__c&&H.__c(Y,X),X.some(function(Q){try{X=Q.__h,Q.__h=[],X.some(function(G){G.call(Q)})}catch(G){H.__e(G,Q.__v)}})}function p0(X){return typeof X!="object"||X==null||X.__b&&X.__b>0?X:p(X)?X.map(p0):C({},X)}function k1(X,Y,Z,K,Q,G,W,q,F){var $,z,J,A,V,L,D,P=Z.props||s,U=Y.props,w=Y.type;if(w=="svg"?Q="http://www.w3.org/2000/svg":w=="math"?Q="http://www.w3.org/1998/Math/MathML":Q||(Q="http://www.w3.org/1999/xhtml"),G!=null){for($=0;$<G.length;$++)if((V=G[$])&&"setAttribute"in V==!!w&&(w?V.localName==w:V.nodeType==3)){X=V,G[$]=null;break}}if(X==null){if(w==null)return document.createTextNode(U);X=document.createElementNS(Q,w,U.is&&U),q&&(H.__m&&H.__m(Y,G),q=!1),G=null}if(w==null)P===U||q&&X.data==U||(X.data=U);else{if(G=G&&n.call(X.childNodes),!q&&G!=null)for(P={},$=0;$<X.attributes.length;$++)P[(V=X.attributes[$]).name]=V.value;for($ in P)if(V=P[$],$=="children");else if($=="dangerouslySetInnerHTML")J=V;else if(!($ in U)){if($=="value"&&"defaultValue"in U||$=="checked"&&"defaultChecked"in U)continue;r(X,$,null,V,Q)}for($ in U)V=U[$],$=="children"?A=V:$=="dangerouslySetInnerHTML"?z=V:$=="value"?L=V:$=="checked"?D=V:q&&typeof V!="function"||P[$]===V||r(X,$,V,P[$],Q);if(z)q||J&&(z.__html==J.__html||z.__html==X.innerHTML)||(X.innerHTML=z.__html),Y.__k=[];else if(J&&(X.innerHTML=""),m0(Y.type=="template"?X.content:X,p(A)?A:[A],Y,Z,K,w=="foreignObject"?"http://www.w3.org/1999/xhtml":Q,G,W,G?G[0]:Z.__k&&x(Z,0),q,F),G!=null)for($=G.length;$--;)w0(G[$]);q||($="value",w=="progress"&&L==null?X.removeAttribute("value"):L!=null&&(L!==X[$]||w=="progress"&&!L||w=="option"&&L!=P[$])&&r(X,$,L,P[$],Q),$="checked",D!=null&&D!=X[$]&&r(X,$,D,P[$],Q))}return X}function O0(X,Y,Z){try{if(typeof X=="function"){var K=typeof X.__u=="function";K&&X.__u(),K&&Y==null||(X.__u=X(Y))}else X.current=Y}catch(Q){H.__e(Q,Z)}}function a0(X,Y,Z){var K,Q;if(H.unmount&&H.unmount(X),(K=X.ref)&&(K.current&&K.current!=X.__e||O0(K,null,Y)),(K=X.__c)!=null){if(K.componentWillUnmount)try{K.componentWillUnmount()}catch(G){H.__e(G,Y)}K.base=K.__P=null}if(K=X.__k)for(Q=0;Q<K.length;Q++)K[Q]&&a0(K[Q],Y,Z||typeof X.type!="function");Z||w0(X.__e),X.__c=X.__=X.__e=void 0}function h1(X,Y,Z){return this.constructor(X,Z)}function R0(X,Y,Z){var K,Q,G,W;Y==document&&(Y=document.documentElement),H.__&&H.__(X,Y),Q=(K=typeof Z=="function")?null:Z&&Z.__k||Y.__k,G=[],W=[],U0(Y,X=(!K&&Z||Y).__k=S(T,null,[X]),Q||s,s,Y.namespaceURI,!K&&Z?[Z]:Q?null:Y.firstChild?n.call(Y.childNodes):null,G,!K&&Z?Z:Q?Q.__e:Y.firstChild,K,W),s0(G,X,W)}function e(X){function Y(Z){var K,Q;return this.getChildContext||(K=new Set,(Q={})[Y.__c]=this,this.getChildContext=function(){return Q},this.componentWillUnmount=function(){K=null},this.shouldComponentUpdate=function(G){this.props.value!=G.value&&K.forEach(function(W){W.__e=!0,V0(W)})},this.sub=function(G){K.add(G);var W=G.componentWillUnmount;G.componentWillUnmount=function(){K&&K.delete(G),W&&W.call(G)}}),Z.children}return Y.__c="__cC"+k0++,Y.__=X,Y.Provider=Y.__l=(Y.Consumer=function(Z,K){return Z.children(K)}).contextType=Y,Y}n=h0.slice,H={__e:function(X,Y,Z,K){for(var Q,G,W;Y=Y.__;)if((Q=Y.__c)&&!Q.__)try{if((G=Q.constructor)&&G.getDerivedStateFromError!=null&&(Q.setState(G.getDerivedStateFromError(X)),W=Q.__d),Q.componentDidCatch!=null&&(Q.componentDidCatch(X,K||{}),W=Q.__d),W)return Q.__E=Q}catch(q){X=q}throw X}},y0=0,y1=function(X){return X!=null&&X.constructor==null},E.prototype.setState=function(X,Y){var Z;Z=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=C({},this.state),typeof X=="function"&&(X=X(C({},Z),this.props)),X&&C(Z,X),X!=null&&this.__v&&(Y&&this._sb.push(Y),V0(this))},E.prototype.forceUpdate=function(X){this.__v&&(this.__e=!0,X&&this.__h.push(X),V0(this))},E.prototype.render=T,y=[],f0=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,v0=function(X,Y){return X.__v.__b-Y.__v.__b},t.__r=0,x0=/(PointerCapture)$|Capture$/i,B0=0,H0=b0(!1),z0=b0(!0),k0=0;var d1=0;function _(X,Y,Z,K,Q,G){Y||(Y={});var W,q,F=Y;if("ref"in F)for(q in F={},Y)q=="ref"?W=Y[q]:F[q]=Y[q];var $={type:X,props:F,key:Z,ref:W,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--d1,__i:-1,__u:0,__source:Q,__self:G};if(typeof X=="function"&&(W=X.defaultProps))for(q in W)F[q]===void 0&&(F[q]=W[q]);return H.vnode&&H.vnode($),$}var z1=j1(r0(),1);var k,O,L0,o0,Y0=0,Q1=[],R=H,t0=R.__b,n0=R.__r,e0=R.diffed,X1=R.__c,Y1=R.unmount,Z1=R.__;function Z0(X,Y){R.__h&&R.__h(O,X,Y0||Y),Y0=0;var Z=O.__H||(O.__H={__:[],__h:[]});return X>=Z.__.length&&Z.__.push({}),Z.__[X]}function h(X){return Y0=1,G1(J1,X)}function G1(X,Y,Z){var K=Z0(k++,2);if(K.t=X,!K.__c&&(K.__=[Z?Z(Y):J1(void 0,Y),function(q){var F=K.__N?K.__N[0]:K.__[0],$=K.t(F,q);F!==$&&(K.__N=[$,K.__[1]],K.__c.setState({}))}],K.__c=O,!O.__f)){var Q=function(q,F,$){if(!K.__c.__H)return!0;var z=K.__c.__H.__.filter(function(A){return!!A.__c});if(z.every(function(A){return!A.__N}))return!G||G.call(this,q,F,$);var J=K.__c.props!==q;return z.forEach(function(A){if(A.__N){var V=A.__[0];A.__=A.__N,A.__N=void 0,V!==A.__[0]&&(J=!0)}}),G&&G.call(this,q,F,$)||J};O.__f=!0;var{shouldComponentUpdate:G,componentWillUpdate:W}=O;O.componentWillUpdate=function(q,F,$){if(this.__e){var z=G;G=void 0,Q(q,F,$),G=z}W&&W.call(this,q,F,$)},O.shouldComponentUpdate=Q}return K.__N||K.__}function f(X,Y){var Z=Z0(k++,3);!R.__s&&q1(Z.__H,Y)&&(Z.__=X,Z.u=Y,O.__H.__h.push(Z))}function K0(X){return Y0=5,W1(function(){return{current:X}},[])}function W1(X,Y){var Z=Z0(k++,7);return q1(Z.__H,Y)&&(Z.__=X(),Z.__H=Y,Z.__h=X),Z.__}function i(X){var Y=O.context[X.__c],Z=Z0(k++,9);return Z.c=X,Y?(Z.__==null&&(Z.__=!0,Y.sub(O)),Y.props.value):X.__}function p1(){for(var X;X=Q1.shift();)if(X.__P&&X.__H)try{X.__H.__h.forEach(X0),X.__H.__h.forEach(P0),X.__H.__h=[]}catch(Y){X.__H.__h=[],R.__e(Y,X.__v)}}R.__b=function(X){O=null,t0&&t0(X)},R.__=function(X,Y){X&&Y.__k&&Y.__k.__m&&(X.__m=Y.__k.__m),Z1&&Z1(X,Y)},R.__r=function(X){n0&&n0(X),k=0;var Y=(O=X.__c).__H;Y&&(L0===O?(Y.__h=[],O.__h=[],Y.__.forEach(function(Z){Z.__N&&(Z.__=Z.__N),Z.u=Z.__N=void 0})):(Y.__h.forEach(X0),Y.__h.forEach(P0),Y.__h=[],k=0)),L0=O},R.diffed=function(X){e0&&e0(X);var Y=X.__c;Y&&Y.__H&&(Y.__H.__h.length&&(Q1.push(Y)!==1&&o0===R.requestAnimationFrame||((o0=R.requestAnimationFrame)||a1)(p1)),Y.__H.__.forEach(function(Z){Z.u&&(Z.__H=Z.u),Z.u=void 0})),L0=O=null},R.__c=function(X,Y){Y.some(function(Z){try{Z.__h.forEach(X0),Z.__h=Z.__h.filter(function(K){return!K.__||P0(K)})}catch(K){Y.some(function(Q){Q.__h&&(Q.__h=[])}),Y=[],R.__e(K,Z.__v)}}),X1&&X1(X,Y)},R.unmount=function(X){Y1&&Y1(X);var Y,Z=X.__c;Z&&Z.__H&&(Z.__H.__.forEach(function(K){try{X0(K)}catch(Q){Y=Q}}),Z.__H=void 0,Y&&R.__e(Y,Z.__v))};var K1=typeof requestAnimationFrame=="function";function a1(X){var Y,Z=function(){clearTimeout(K),K1&&cancelAnimationFrame(Y),setTimeout(X)},K=setTimeout(Z,35);K1&&(Y=requestAnimationFrame(Z))}function X0(X){var Y=O,Z=X.__c;typeof Z=="function"&&(X.__c=void 0,Z()),O=Y}function P0(X){var Y=O;X.__c=X.__(),O=Y}function q1(X,Y){return!X||X.length!==Y.length||Y.some(function(Z,K){return Z!==X[K]})}function J1(X,Y){return typeof Y=="function"?Y(X):Y}var g={__stop__:!0};function M0(X,Y=10){let Z=new WeakSet;Z.add(X);let K={};for(let Q in X)try{if(d(X[Q],Q))continue;else if(typeof X[Q]==="object"){let G=j(X[Q],Y,Z);if(G!==g)K[Q]=G}else K[Q]=X[Q]}catch{continue}if(typeof window<"u"&&window.Event&&X instanceof window.Event)K.selection=i1(Y,Z);return K}function i1(X,Y){if(typeof window>"u"||!window.getSelection)return null;let Z=window.getSelection();if(!Z)return null;return{type:Z.type,anchorNode:Z.anchorNode?j(Z.anchorNode,X,Y):null,anchorOffset:Z.anchorOffset,focusNode:Z.focusNode?j(Z.focusNode,X,Y):null,focusOffset:Z.focusOffset,isCollapsed:Z.isCollapsed,rangeCount:Z.rangeCount,selectedText:Z.toString()}}function j(X,Y,Z){let K=Y-1;if(K<=0&&typeof X==="object")return g;if(!X||typeof X!=="object")return X;if(Z.has(X))return g;Z.add(X);try{if(Array.isArray(X)||typeof X?.length==="number"&&typeof X[Symbol.iterator]==="function"&&!Object.prototype.toString.call(X).includes("Map")&&!(X instanceof CSSStyleDeclaration))return u1(X,K,Z);return l1(X,K,Z)}finally{Z.delete(X)}}function u1(X,Y,Z){let K=[];for(let Q=0;Q<X.length;Q++)if(d(X[Q]))continue;else if(typeof X[Q]==="object"){let G=j(X[Q],Y,Z);if(G!==g)K.push(G)}else K.push(X[Q]);return K}function l1(X,Y,Z){let K={};for(let q in X)try{if(d(X[q],q,X))continue;else if(typeof X[q]==="object"){let F=j(X[q],Y,Z);if(F!==g)K[q]=F}else K[q]=X[q]}catch{continue}if(X&&typeof X==="object"&&"dataset"in X&&!Object.prototype.hasOwnProperty.call(K,"dataset")){let q=X.dataset;if(!d(q,"dataset",X)){let F=j(q,Y,Z);if(F!==g)K.dataset=F}}let Q=["value","checked","files","type","name"];for(let q of Q)if(X&&typeof X==="object"&&q in X&&!Object.prototype.hasOwnProperty.call(K,q)){let F=X[q];if(!d(F,q,X))if(typeof F==="object"){let $=q==="files"?Math.max(Y,3):Y,z=j(F,$,Z);if(z!==g)K[q]=z}else K[q]=F}let G=typeof window<"u"?window:void 0,W=G?G.HTMLFormElement:typeof HTMLFormElement<"u"?HTMLFormElement:void 0;if(W&&X instanceof W&&X.elements)for(let q=0;q<X.elements.length;q++){let F=X.elements[q];if(F.name&&!Object.prototype.hasOwnProperty.call(K,F.name)&&!d(F,F.name,X))if(typeof F==="object"){let $=j(F,Y,Z);if($!==g)K[F.name]=$}else K[F.name]=F}return K}function d(X,Y="",Z=void 0){return X===null||X===void 0||Y.startsWith("__")||Y.length>0&&/^[A-Z_]+$/.test(Y)||typeof X==="function"||X instanceof CSSStyleSheet||X instanceof Window||X instanceof Document||Y==="view"||Y==="size"||Y==="length"||Z instanceof CSSStyleDeclaration&&X===""||typeof Node<"u"&&Z instanceof Node&&(Y==="parentNode"||Y==="parentElement"||Y==="ownerDocument"||Y==="getRootNode"||Y==="childNodes"||Y==="children"||Y==="firstChild"||Y==="lastChild"||Y==="previousSibling"||Y==="nextSibling"||Y==="previousElementSibling"||Y==="nextElementSibling"||Y==="innerHTML"||Y==="outerHTML"||Y==="offsetParent"||Y==="offsetWidth"||Y==="offsetHeight"||Y==="offsetLeft"||Y==="offsetTop"||Y==="clientTop"||Y==="clientLeft"||Y==="clientWidth"||Y==="clientHeight"||Y==="scrollWidth"||Y==="scrollHeight"||Y==="scrollTop"||Y==="scrollLeft")}async function $1(X,Y){let Z;if(X.sourceType==="URL")Z=await import(X.source);else Z=await Y.loadModule(X.source);if(typeof Z.bind!=="function")throw Error(`${X.source} did not export a function 'bind'`);return(K)=>{let Q=Z.bind(K,{sendMessage:Y.sendMessage,onMessage:Y.onMessage});if(!(typeof Q.create==="function"&&typeof Q.render==="function"&&typeof Q.unmount==="function"))return M.error(`${X.source} returned an impropper binding`),null;return{render:(G)=>Q.render(F1({client:Y,module:Z,binding:Q,model:G,currentImportSource:X})),unmount:Q.unmount}}}function F1(X){let Y;if(X.model.importSource){if(!o1(X.currentImportSource,X.model.importSource))return M.error("Parent element import source "+Q0(X.currentImportSource)+" does not match child's import source "+Q0(X.model.importSource)),null;else if(Y=r1(X.module,X.model.tagName,X.model.importSource),!Y)return null}else Y=X.model.tagName;return X.binding.create(Y,W0(X.model,X.client),G0(X.model,(Z)=>F1({...X,model:Z})))}function r1(X,Y,Z){let K=Y.split("."),Q=null;for(let G=0;G<K.length;G++){let W=K[G];if(Q=G==0?X[W]:Q[W],!Q){if(G==0)M.error("Module from source "+Q0(Z)+` does not export ${W}`);else console.error(`Component ${K.slice(0,G).join(".")} from source `+Q0(Z)+` does not have subcomponent ${W}`);break}}return Q}function o1(X,Y){return X.source===Y.source&&X.sourceType===Y.sourceType}function Q0(X){return JSON.stringify({source:X.source,sourceType:X.sourceType})}function G0(X,Y){if(!X.children)return[];else return X.children.map((Z)=>{switch(typeof Z){case"object":return Y(Z);case"string":return Z}})}function W0(X,Y){return Object.fromEntries(Object.entries({...X.attributes,...Object.fromEntries(Object.entries(X.eventHandlers||{}).map(([Z,K])=>t1(Y,Z,K))),...Object.fromEntries(Object.entries(X.inlineJavaScript||{}).map(([Z,K])=>n1(Z,K)))}))}function t1(X,Y,{target:Z,preventDefault:K,stopPropagation:Q}){let G=function(...W){let q=Array.from(W).map((F)=>{let $=F;if(K)$.preventDefault();if(Q)$.stopPropagation();return M0($)});X.sendMessage({type:"layout-event",data:q,target:Z})};return G.isHandler=!0,[Y,G]}function n1(name,inlineJavaScript){let wrappedExecutable=function(...args){function handleExecution(...args){let evalResult=eval(inlineJavaScript);if(typeof evalResult=="function")return evalResult(...args)}if(args.length>0&&args[0]instanceof Event)return handleExecution.call(args[0].currentTarget,...args);else return handleExecution(...args)};return wrappedExecutable.isHandler=!1,[name,wrappedExecutable]}var q0=e(null);function V1(X){let Y=h({tagName:""})[0],Z=Y4();return f(()=>X.client.onMessage("layout-update",({path:K,model:Q})=>{if(K==="")Object.assign(Y,Q);else z1.set(Y,K,Q);Z()}),[Y,X.client]),_(q0.Provider,{value:X.client,children:_(T0,{model:Y})})}function T0({model:X}){if(X.error!==void 0)if(X.error)return _("pre",{children:X.error});else return null;let Y;if(X.tagName in H1)Y=H1[X.tagName];else if(X.importSource)Y=X4;else Y=A1;return _(Y,{model:X})}function A1({model:X}){let Y=i(q0);return S(X.tagName===""?T:X.tagName,W0(X,Y),...G0(X,(Z)=>{return _(T0,{model:Z},Z.key)}))}function _0({model:X}){let Y=i(q0),Z=W0(X,Y),[K,Q]=h(Z.value);f(()=>Q(Z.value),[Z.value]);let G=Z.onChange;if(typeof G==="function")Z.onChange=(W)=>{if(W.target)Q(W.target.value);G(W)};return S(X.tagName,{...Z,value:K},...G0(X,(W)=>_(T0,{model:W},W.key)))}function e1({model:X}){let Y=K0(null);return f(()=>{if(!Y.current)return;let Z=document.createElement("script");for(let[Q,G]of Object.entries(X.attributes||{}))Z.setAttribute(Q,G);let K=X?.children?.filter((Q)=>typeof Q=="string")[0];if(K)Z.appendChild(document.createTextNode(K));return Y.current.appendChild(Z),()=>{Y.current?.removeChild(Z)}},[X.key]),_("div",{ref:Y})}function X4({model:X}){let Y=X.importSource,Z=Z4(X);if(!Y)return null;let K=Y.fallback;if(!Y)if(!K)return null;else if(typeof K==="string")return _("span",{children:K});else return _(A1,{model:K});else return _("span",{ref:Z})}function Y4(){let[,X]=h(!1);return()=>X((Y)=>!Y)}function Z4(X){let Y=X.importSource,Z=JSON.stringify(Y),K=K0(null),Q=i(q0),[G,W]=h(null);return f(()=>{let q=!1;if(Y)$1(Y,Q).then((F)=>{if(!q&&K.current)W(F(K.current))});return()=>{if(q=!0,G&&Y&&!Y.unmountBeforeUpdate)G.unmount()}},[Q,Z,W,K.current]),f(()=>{if(!(G&&Y))return;if(G.render(X),Y.unmountBeforeUpdate)return G.unmount}),K}var H1={input:_0,script:e1,select:_0,textarea:_0};function K4(X){let Z=`${`ws${window.location.protocol==="https:"?"s":""}:`}//${window.location.host}`,K=new URL(`${Z}${X.pathPrefix}${X.componentPath||""}`);if(K.searchParams.append("http_pathname",window.location.pathname),window.location.search)K.searchParams.append("http_query_string",window.location.search);let Q=new F0({urls:{componentUrl:K,jsModulesPath:`${window.location.origin}${X.pathPrefix}modules/`},reconnectOptions:{interval:X.reconnectInterval||750,maxInterval:X.reconnectMaxInterval||60000,maxRetries:X.reconnectMaxRetries||150,backoffMultiplier:X.reconnectBackoffMultiplier||1.25},mountElement:X.mountElement});R0(_(V1,{client:Q}),X.mountElement)}function G4(X,Y){for(var Z in Y)X[Z]=Y[Z];return X}function B1(X,Y){for(var Z in X)if(Z!=="__source"&&!(Z in Y))return!0;for(var K in Y)if(K!=="__source"&&X[K]!==Y[K])return!0;return!1}function w1(X,Y){this.props=X,this.context=Y}(w1.prototype=new E).isPureReactComponent=!0,w1.prototype.shouldComponentUpdate=function(X,Y){return B1(this.props,X)||B1(this.state,Y)};var U1=H.__b;H.__b=function(X){X.type&&X.type.__f&&X.ref&&(X.props.ref=X.ref,X.ref=null),U1&&U1(X)};var W4=H.__e;H.__e=function(X,Y,Z,K){if(X.then){for(var Q,G=Y;G=G.__;)if((Q=G.__c)&&Q.__c)return Y.__e==null&&(Y.__e=Z.__e,Y.__k=Z.__k),Q.__c(X,Y)}W4(X,Y,Z,K)};var O1=H.unmount;function T1(X,Y,Z){return X&&(X.__c&&X.__c.__H&&(X.__c.__H.__.forEach(function(K){typeof K.__c=="function"&&K.__c()}),X.__c.__H=null),(X=G4({},X)).__c!=null&&(X.__c.__P===Z&&(X.__c.__P=Y),X.__c.__e=!0,X.__c=null),X.__k=X.__k&&X.__k.map(function(K){return T1(K,Y,Z)})),X}function D1(X,Y,Z){return X&&Z&&(X.__v=null,X.__k=X.__k&&X.__k.map(function(K){return D1(K,Y,Z)}),X.__c&&X.__c.__P===Y&&(X.__e&&Z.appendChild(X.__e),X.__c.__e=!0,X.__c.__P=Z)),X}function D0(){this.__u=0,this.o=null,this.__b=null}function E1(X){var Y=X.__.__c;return Y&&Y.__a&&Y.__a(X)}function J0(){this.i=null,this.l=null}H.unmount=function(X){var Y=X.__c;Y&&Y.__R&&Y.__R(),Y&&32&X.__u&&(X.type=null),O1&&O1(X)},(D0.prototype=new E).__c=function(X,Y){var Z=Y.__c,K=this;K.o==null&&(K.o=[]),K.o.push(Z);var Q=E1(K.__v),G=!1,W=function(){G||(G=!0,Z.__R=null,Q?Q(q):q())};Z.__R=W;var q=function(){if(!--K.__u){if(K.state.__a){var F=K.state.__a;K.__v.__k[0]=D1(F,F.__c.__P,F.__c.__O)}var $;for(K.setState({__a:K.__b=null});$=K.o.pop();)$.forceUpdate()}};K.__u++||32&Y.__u||K.setState({__a:K.__b=K.__v.__k[0]}),X.then(W,W)},D0.prototype.componentWillUnmount=function(){this.o=[]},D0.prototype.render=function(X,Y){if(this.__b){if(this.__v.__k){var Z=document.createElement("div"),K=this.__v.__k[0].__c;this.__v.__k[0]=T1(this.__b,Z,K.__O=K.__P)}this.__b=null}var Q=Y.__a&&S(T,null,X.fallback);return Q&&(Q.__u&=-33),[S(T,null,Y.__a?null:X.children),Q]};var R1=function(X,Y,Z){if(++Z[1]===Z[0]&&X.l.delete(Y),X.props.revealOrder&&(X.props.revealOrder[0]!=="t"||!X.l.size))for(Z=X.i;Z;){for(;Z.length>3;)Z.pop()();if(Z[1]<Z[0])break;X.i=Z=Z[2]}};(J0.prototype=new E).__a=function(X){var Y=this,Z=E1(Y.__v),K=Y.l.get(X);return K[0]++,function(Q){var G=function(){Y.props.revealOrder?(K.push(Q),R1(Y,X,K)):Q()};Z?Z(G):G()}},J0.prototype.render=function(X){this.i=null,this.l=new Map;var Y=a(X.children);X.revealOrder&&X.revealOrder[0]==="b"&&Y.reverse();for(var Z=Y.length;Z--;)this.l.set(Y[Z],this.i=[1,0,this.i]);return X.children},J0.prototype.componentDidUpdate=J0.prototype.componentDidMount=function(){var X=this;this.l.forEach(function(Y,Z){R1(X,Z,Y)})};var q4=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,J4=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,$4=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,F4=/[A-Z0-9]/g,H4=typeof document<"u",z4=function(X){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(X)};E.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(X){Object.defineProperty(E.prototype,X,{configurable:!0,get:function(){return this["UNSAFE_"+X]},set:function(Y){Object.defineProperty(this,X,{configurable:!0,writable:!0,value:Y})}})});var L1=H.event;function V4(){}function A4(){return this.cancelBubble}function B4(){return this.defaultPrevented}H.event=function(X){return L1&&(X=L1(X)),X.persist=V4,X.isPropagationStopped=A4,X.isDefaultPrevented=B4,X.nativeEvent=X};var I1,w4={enumerable:!1,configurable:!0,get:function(){return this.class}},P1=H.vnode;H.vnode=function(X){typeof X.type=="string"&&function(Y){var{props:Z,type:K}=Y,Q={},G=K.indexOf("-")===-1;for(var W in Z){var q=Z[W];if(!(W==="value"&&("defaultValue"in Z)&&q==null||H4&&W==="children"&&K==="noscript"||W==="class"||W==="className")){var F=W.toLowerCase();W==="defaultValue"&&"value"in Z&&Z.value==null?W="value":W==="download"&&q===!0?q="":F==="translate"&&q==="no"?q=!1:F[0]==="o"&&F[1]==="n"?F==="ondoubleclick"?W="ondblclick":F!=="onchange"||K!=="input"&&K!=="textarea"||z4(Z.type)?F==="onfocus"?W="onfocusin":F==="onblur"?W="onfocusout":$4.test(W)&&(W=F):F=W="oninput":G&&J4.test(W)?W=W.replace(F4,"-$&").toLowerCase():q===null&&(q=void 0),F==="oninput"&&Q[W=F]&&(W="oninputCapture"),Q[W]=q}}K=="select"&&Q.multiple&&Array.isArray(Q.value)&&(Q.value=a(Z.children).forEach(function($){$.props.selected=Q.value.indexOf($.props.value)!=-1})),K=="select"&&Q.defaultValue!=null&&(Q.value=a(Z.children).forEach(function($){$.props.selected=Q.multiple?Q.defaultValue.indexOf($.props.value)!=-1:Q.defaultValue==$.props.value})),Z.class&&!Z.className?(Q.class=Z.class,Object.defineProperty(Q,"className",w4)):(Z.className&&!Z.class||Z.class&&Z.className)&&(Q.class=Q.className=Z.className),Y.props=Q}(X),X.$$typeof=q4,P1&&P1(X)};var M1=H.__r;H.__r=function(X){M1&&M1(X),I1=X.__c};var _1=H.diffed;H.diffed=function(X){_1&&_1(X);var{props:Y,__e:Z}=X;Z!=null&&X.type==="textarea"&&"value"in Y&&Y.value!==Z.value&&(Z.value=Y.value==null?"":Y.value),I1=null};export{K4 as mountReactPy};
1
+ var N1=Object.create;var{getPrototypeOf:S1,defineProperty:I0,getOwnPropertyNames:g1}=Object;var j1=Object.prototype.hasOwnProperty;var y1=(X,Y,Z)=>{Z=X!=null?N1(S1(X)):{};let K=Y||!X||!X.__esModule?I0(Z,"default",{value:X,enumerable:!0}):Z;for(let Q of g1(X))if(!j1.call(K,Q))I0(K,Q,{get:()=>X[Q],enumerable:!0});return K};var C0=(X,Y)=>()=>(Y||X((Y={exports:{}}).exports,Y),Y.exports);var l0=C0((S4,u0)=>{var c1=Object.prototype.hasOwnProperty,s1=Object.prototype.toString;u0.exports=function(Y,Z,K){if(s1.call(Z)!=="[object Function]")throw TypeError("iterator must be a function");var Q=Y.length;if(Q===+Q)for(var G=0;G<Q;G++)Z.call(K,Y[G],G,Y);else for(var W in Y)if(c1.call(Y,W))Z.call(K,Y[W],W,Y)}});var o0=C0((g4,r0)=>{var p1=l0();r0.exports=B;function B(X,Y,Z){if(arguments.length===3)return B.set(X,Y,Z);if(arguments.length===2)return B.get(X,Y);var K=B.bind(B,X);for(var Q in B)if(B.hasOwnProperty(Q))K[Q]=B[Q].bind(K,X);return K}B.get=function(Y,Z){var K=Array.isArray(Z)?Z:B.parse(Z);for(var Q=0;Q<K.length;++Q){var G=K[Q];if(!(typeof Y=="object"&&(G in Y)))throw Error("Invalid reference token: "+G);Y=Y[G]}return Y};B.set=function(Y,Z,K){var Q=Array.isArray(Z)?Z:B.parse(Z),G=Q[0];if(Q.length===0)throw Error("Can not set the root object");for(var W=0;W<Q.length-1;++W){var q=Q[W];if(typeof q!=="string"&&typeof q!=="number")q=String(q);if(q==="__proto__"||q==="constructor"||q==="prototype")continue;if(q==="-"&&Array.isArray(Y))q=Y.length;if(G=Q[W+1],!(q in Y))if(G.match(/^(\d+|-)$/))Y[q]=[];else Y[q]={};Y=Y[q]}if(G==="-"&&Array.isArray(Y))G=Y.length;return Y[G]=K,this};B.remove=function(X,Y){var Z=Array.isArray(Y)?Y:B.parse(Y),K=Z[Z.length-1];if(K===void 0)throw Error('Invalid JSON pointer for remove: "'+Y+'"');var Q=B.get(X,Z.slice(0,-1));if(Array.isArray(Q)){var G=+K;if(K===""&&isNaN(G))throw Error('Invalid array index: "'+K+'"');Array.prototype.splice.call(Q,G,1)}else delete Q[K]};B.dict=function(Y,Z){var K={};return B.walk(Y,function(Q,G){K[G]=Q},Z),K};B.walk=function(Y,Z,K){var Q=[];K=K||function(G){var W=Object.prototype.toString.call(G);return W==="[object Object]"||W==="[object Array]"},function G(W){p1(W,function(q,F){if(Q.push(String(F)),K(q))G(q);else Z(q,B.compile(Q));Q.pop()})}(Y)};B.has=function(Y,Z){try{B.get(Y,Z)}catch(K){return!1}return!0};B.escape=function(Y){return Y.toString().replace(/~/g,"~0").replace(/\//g,"~1")};B.unescape=function(Y){return Y.replace(/~1/g,"/").replace(/~0/g,"~")};B.parse=function(Y){if(Y==="")return[];if(Y.charAt(0)!=="/")throw Error("Invalid JSON pointer: "+Y);return Y.substring(1).split(/\//).map(B.unescape)};B.compile=function(Y){if(Y.length===0)return"";return"/"+Y.map(B.escape).join("/")}});var M={log:(...X)=>console.log("[ReactPy]",...X),info:(...X)=>console.info("[ReactPy]",...X),warn:(...X)=>console.warn("[ReactPy]",...X),error:(...X)=>console.error("[ReactPy]",...X)};function N0(X){let{interval:Y,maxInterval:Z,maxRetries:K,backoffMultiplier:Q}=X,G=0,W=Y,q=!1,F=!1,$={},z=()=>{if(F)return;$.current=new WebSocket(X.url),$.current.onopen=()=>{if(q=!0,M.info("Connected!"),W=Y,G=0,X.onOpen)X.onOpen()},$.current.onmessage=(J)=>{if(X.onMessage)X.onMessage(J)},$.current.onclose=()=>{if(X.onClose)X.onClose();if(!q){M.info("Failed to connect!");return}if(M.info("Disconnected!"),G>=K){M.info("Connection max retries exhausted!");return}M.info(`Reconnecting in ${(W/1000).toPrecision(4)} seconds...`),setTimeout(z,W),W=b1(W,Q,Z),G++}};return X.readyPromise.then(()=>M.info("Starting client...")).then(z),$}function b1(X,Y,Z){return Math.min(X*Y,Z)}class S0{handlers={};ready;resolveReady;constructor(){this.resolveReady=()=>{},this.ready=new Promise((X)=>this.resolveReady=X)}onMessage(X,Y){return(this.handlers[X]||(this.handlers[X]=[])).push(Y),this.resolveReady(void 0),()=>{this.handlers[X]=this.handlers[X].filter((Z)=>Z!==Y)}}handleIncoming(X){if(!X.type){M.warn("Received message without type",X);return}let Y=this.handlers[X.type];if(!Y){M.warn("Received message without handler",X);return}Y.forEach((Z)=>Z(X))}}class H0 extends S0{urls;socket;mountElement;constructor(X){super();this.urls=X.urls,this.mountElement=X.mountElement,this.socket=N0({url:this.urls.componentUrl,readyPromise:this.ready,...X.reconnectOptions,onMessage:async({data:Y})=>this.handleIncoming(JSON.parse(Y))})}sendMessage(X){this.socket.current?.send(JSON.stringify(X))}loadModule(X){return import(`${this.urls.jsModulesPath}${X}`)}}var e,H,b0,f1,b,g0,f0,v0,x0,w0,z0,V0,k0,p={},h0=[],v1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,a=Array.isArray;function N(X,Y){for(var Z in Y)X[Z]=Y[Z];return X}function U0(X){X&&X.parentNode&&X.parentNode.removeChild(X)}function C(X,Y,Z){var K,Q,G,W={};for(G in Y)G=="key"?K=Y[G]:G=="ref"?Q=Y[G]:W[G]=Y[G];if(arguments.length>2&&(W.children=arguments.length>3?e.call(arguments,2):Z),typeof X=="function"&&X.defaultProps!=null)for(G in X.defaultProps)W[G]===void 0&&(W[G]=X.defaultProps[G]);return t(X,W,K,Q,null)}function t(X,Y,Z,K,Q){var G={type:X,props:Y,key:Z,ref:K,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:Q==null?++b0:Q,__i:-1,__u:0};return Q==null&&H.vnode!=null&&H.vnode(G),G}function E(X){return X.children}function T(X,Y){this.props=X,this.context=Y}function x(X,Y){if(Y==null)return X.__?x(X.__,X.__i+1):null;for(var Z;Y<X.__k.length;Y++)if((Z=X.__k[Y])!=null&&Z.__e!=null)return Z.__e;return typeof X.type=="function"?x(X):null}function d0(X){var Y,Z;if((X=X.__)!=null&&X.__c!=null){for(X.__e=X.__c.base=null,Y=0;Y<X.__k.length;Y++)if((Z=X.__k[Y])!=null&&Z.__e!=null){X.__e=X.__c.base=Z.__e;break}return d0(X)}}function A0(X){(!X.__d&&(X.__d=!0)&&b.push(X)&&!n.__r++||g0!=H.debounceRendering)&&((g0=H.debounceRendering)||f0)(n)}function n(){for(var X,Y,Z,K,Q,G,W,q=1;b.length;)b.length>q&&b.sort(v0),X=b.shift(),q=b.length,X.__d&&(Z=void 0,K=void 0,Q=(K=(Y=X).__v).__e,G=[],W=[],Y.__P&&((Z=N({},K)).__v=K.__v+1,H.vnode&&H.vnode(Z),R0(Y.__P,Z,K,Y.__n,Y.__P.namespaceURI,32&K.__u?[Q]:null,G,Q==null?x(K):Q,!!(32&K.__u),W),Z.__v=K.__v,Z.__.__k[Z.__i]=Z,s0(G,Z,W),K.__e=K.__=null,Z.__e!=Q&&d0(Z)));n.__r=0}function m0(X,Y,Z,K,Q,G,W,q,F,$,z){var J,A,V,P,D,O,U,w=K&&K.__k||h0,S=Y.length;for(F=x1(Z,Y,w,F,S),J=0;J<S;J++)(V=Z.__k[J])!=null&&(A=V.__i==-1?p:w[V.__i]||p,V.__i=J,O=R0(X,V,A,Q,G,W,q,F,$,z),P=V.__e,V.ref&&A.ref!=V.ref&&(A.ref&&L0(A.ref,null,V),z.push(V.ref,V.__c||P,V)),D==null&&P!=null&&(D=P),(U=!!(4&V.__u))||A.__k===V.__k?F=c0(V,F,X,U):typeof V.type=="function"&&O!==void 0?F=O:P&&(F=P.nextSibling),V.__u&=-7);return Z.__e=D,F}function x1(X,Y,Z,K,Q){var G,W,q,F,$,z=Z.length,J=z,A=0;for(X.__k=Array(Q),G=0;G<Q;G++)(W=Y[G])!=null&&typeof W!="boolean"&&typeof W!="function"?(typeof W=="string"||typeof W=="number"||typeof W=="bigint"||W.constructor==String?W=X.__k[G]=t(null,W,null,null,null):a(W)?W=X.__k[G]=t(E,{children:W},null,null,null):W.constructor==null&&W.__b>0?W=X.__k[G]=t(W.type,W.props,W.key,W.ref?W.ref:null,W.__v):X.__k[G]=W,F=G+A,W.__=X,W.__b=X.__b+1,($=W.__i=k1(W,Z,F,J))!=-1&&(J--,(q=Z[$])&&(q.__u|=2)),q==null||q.__v==null?($==-1&&(Q>z?A--:Q<z&&A++),typeof W.type!="function"&&(W.__u|=4)):$!=F&&($==F-1?A--:$==F+1?A++:($>F?A--:A++,W.__u|=4))):X.__k[G]=null;if(J)for(G=0;G<z;G++)(q=Z[G])!=null&&(2&q.__u)==0&&(q.__e==K&&(K=x(q)),a0(q,q));return K}function c0(X,Y,Z,K){var Q,G;if(typeof X.type=="function"){for(Q=X.__k,G=0;Q&&G<Q.length;G++)Q[G]&&(Q[G].__=X,Y=c0(Q[G],Y,Z,K));return Y}X.__e!=Y&&(K&&(Y&&X.type&&!Y.parentNode&&(Y=x(X)),Z.insertBefore(X.__e,Y||null)),Y=X.__e);do Y=Y&&Y.nextSibling;while(Y!=null&&Y.nodeType==8);return Y}function i(X,Y){return Y=Y||[],X==null||typeof X=="boolean"||(a(X)?X.some(function(Z){i(Z,Y)}):Y.push(X)),Y}function k1(X,Y,Z,K){var Q,G,W,q=X.key,F=X.type,$=Y[Z],z=$!=null&&(2&$.__u)==0;if($===null&&q==null||z&&q==$.key&&F==$.type)return Z;if(K>(z?1:0)){for(Q=Z-1,G=Z+1;Q>=0||G<Y.length;)if(($=Y[W=Q>=0?Q--:G++])!=null&&(2&$.__u)==0&&q==$.key&&F==$.type)return W}return-1}function j0(X,Y,Z){Y[0]=="-"?X.setProperty(Y,Z==null?"":Z):X[Y]=Z==null?"":typeof Z!="number"||v1.test(Y)?Z:Z+"px"}function o(X,Y,Z,K,Q){var G,W;X:if(Y=="style")if(typeof Z=="string")X.style.cssText=Z;else{if(typeof K=="string"&&(X.style.cssText=K=""),K)for(Y in K)Z&&Y in Z||j0(X.style,Y,"");if(Z)for(Y in Z)K&&Z[Y]==K[Y]||j0(X.style,Y,Z[Y])}else if(Y[0]=="o"&&Y[1]=="n")G=Y!=(Y=Y.replace(x0,"$1")),W=Y.toLowerCase(),Y=W in X||Y=="onFocusOut"||Y=="onFocusIn"?W.slice(2):Y.slice(2),X.l||(X.l={}),X.l[Y+G]=Z,Z?K?Z.u=K.u:(Z.u=w0,X.addEventListener(Y,G?V0:z0,G)):X.removeEventListener(Y,G?V0:z0,G);else{if(Q=="http://www.w3.org/2000/svg")Y=Y.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(Y!="width"&&Y!="height"&&Y!="href"&&Y!="list"&&Y!="form"&&Y!="tabIndex"&&Y!="download"&&Y!="rowSpan"&&Y!="colSpan"&&Y!="role"&&Y!="popover"&&Y in X)try{X[Y]=Z==null?"":Z;break X}catch(q){}typeof Z=="function"||(Z==null||Z===!1&&Y[4]!="-"?X.removeAttribute(Y):X.setAttribute(Y,Y=="popover"&&Z==1?"":Z))}}function y0(X){return function(Y){if(this.l){var Z=this.l[Y.type+X];if(Y.t==null)Y.t=w0++;else if(Y.t<Z.u)return;return Z(H.event?H.event(Y):Y)}}}function R0(X,Y,Z,K,Q,G,W,q,F,$){var z,J,A,V,P,D,O,U,w,S,y,l,c,T0,r,s,F0,I=Y.type;if(Y.constructor!=null)return null;128&Z.__u&&(F=!!(32&Z.__u),G=[q=Y.__e=Z.__e]),(z=H.__b)&&z(Y);X:if(typeof I=="function")try{if(U=Y.props,w="prototype"in I&&I.prototype.render,S=(z=I.contextType)&&K[z.__c],y=z?S?S.props.value:z.__:K,Z.__c?O=(J=Y.__c=Z.__c).__=J.__E:(w?Y.__c=J=new I(U,y):(Y.__c=J=new T(U,y),J.constructor=I,J.render=d1),S&&S.sub(J),J.state||(J.state={}),J.__n=K,A=J.__d=!0,J.__h=[],J._sb=[]),w&&J.__s==null&&(J.__s=J.state),w&&I.getDerivedStateFromProps!=null&&(J.__s==J.state&&(J.__s=N({},J.__s)),N(J.__s,I.getDerivedStateFromProps(U,J.__s))),V=J.props,P=J.state,J.__v=Y,A)w&&I.getDerivedStateFromProps==null&&J.componentWillMount!=null&&J.componentWillMount(),w&&J.componentDidMount!=null&&J.__h.push(J.componentDidMount);else{if(w&&I.getDerivedStateFromProps==null&&U!==V&&J.componentWillReceiveProps!=null&&J.componentWillReceiveProps(U,y),Y.__v==Z.__v||!J.__e&&J.shouldComponentUpdate!=null&&J.shouldComponentUpdate(U,J.__s,y)===!1){for(Y.__v!=Z.__v&&(J.props=U,J.state=J.__s,J.__d=!1),Y.__e=Z.__e,Y.__k=Z.__k,Y.__k.some(function(v){v&&(v.__=Y)}),l=0;l<J._sb.length;l++)J.__h.push(J._sb[l]);J._sb=[],J.__h.length&&W.push(J);break X}J.componentWillUpdate!=null&&J.componentWillUpdate(U,J.__s,y),w&&J.componentDidUpdate!=null&&J.__h.push(function(){J.componentDidUpdate(V,P,D)})}if(J.context=y,J.props=U,J.__P=X,J.__e=!1,c=H.__r,T0=0,w){for(J.state=J.__s,J.__d=!1,c&&c(Y),z=J.render(J.props,J.state,J.context),r=0;r<J._sb.length;r++)J.__h.push(J._sb[r]);J._sb=[]}else do J.__d=!1,c&&c(Y),z=J.render(J.props,J.state,J.context),J.state=J.__s;while(J.__d&&++T0<25);J.state=J.__s,J.getChildContext!=null&&(K=N(N({},K),J.getChildContext())),w&&!A&&J.getSnapshotBeforeUpdate!=null&&(D=J.getSnapshotBeforeUpdate(V,P)),s=z,z!=null&&z.type===E&&z.key==null&&(s=p0(z.props.children)),q=m0(X,a(s)?s:[s],Y,Z,K,Q,G,W,q,F,$),J.base=Y.__e,Y.__u&=-161,J.__h.length&&W.push(J),O&&(J.__E=J.__=null)}catch(v){if(Y.__v=null,F||G!=null)if(v.then){for(Y.__u|=F?160:128;q&&q.nodeType==8&&q.nextSibling;)q=q.nextSibling;G[G.indexOf(q)]=null,Y.__e=q}else{for(F0=G.length;F0--;)U0(G[F0]);B0(Y)}else Y.__e=Z.__e,Y.__k=Z.__k,v.then||B0(Y);H.__e(v,Y,Z)}else G==null&&Y.__v==Z.__v?(Y.__k=Z.__k,Y.__e=Z.__e):q=Y.__e=h1(Z.__e,Y,Z,K,Q,G,W,F,$);return(z=H.diffed)&&z(Y),128&Y.__u?void 0:q}function B0(X){X&&X.__c&&(X.__c.__e=!0),X&&X.__k&&X.__k.forEach(B0)}function s0(X,Y,Z){for(var K=0;K<Z.length;K++)L0(Z[K],Z[++K],Z[++K]);H.__c&&H.__c(Y,X),X.some(function(Q){try{X=Q.__h,Q.__h=[],X.some(function(G){G.call(Q)})}catch(G){H.__e(G,Q.__v)}})}function p0(X){return typeof X!="object"||X==null||X.__b&&X.__b>0?X:a(X)?X.map(p0):N({},X)}function h1(X,Y,Z,K,Q,G,W,q,F){var $,z,J,A,V,P,D,O=Z.props||p,U=Y.props,w=Y.type;if(w=="svg"?Q="http://www.w3.org/2000/svg":w=="math"?Q="http://www.w3.org/1998/Math/MathML":Q||(Q="http://www.w3.org/1999/xhtml"),G!=null){for($=0;$<G.length;$++)if((V=G[$])&&"setAttribute"in V==!!w&&(w?V.localName==w:V.nodeType==3)){X=V,G[$]=null;break}}if(X==null){if(w==null)return document.createTextNode(U);X=document.createElementNS(Q,w,U.is&&U),q&&(H.__m&&H.__m(Y,G),q=!1),G=null}if(w==null)O===U||q&&X.data==U||(X.data=U);else{if(G=G&&e.call(X.childNodes),!q&&G!=null)for(O={},$=0;$<X.attributes.length;$++)O[(V=X.attributes[$]).name]=V.value;for($ in O)if(V=O[$],$=="children");else if($=="dangerouslySetInnerHTML")J=V;else if(!($ in U)){if($=="value"&&"defaultValue"in U||$=="checked"&&"defaultChecked"in U)continue;o(X,$,null,V,Q)}for($ in U)V=U[$],$=="children"?A=V:$=="dangerouslySetInnerHTML"?z=V:$=="value"?P=V:$=="checked"?D=V:q&&typeof V!="function"||O[$]===V||o(X,$,V,O[$],Q);if(z)q||J&&(z.__html==J.__html||z.__html==X.innerHTML)||(X.innerHTML=z.__html),Y.__k=[];else if(J&&(X.innerHTML=""),m0(Y.type=="template"?X.content:X,a(A)?A:[A],Y,Z,K,w=="foreignObject"?"http://www.w3.org/1999/xhtml":Q,G,W,G?G[0]:Z.__k&&x(Z,0),q,F),G!=null)for($=G.length;$--;)U0(G[$]);q||($="value",w=="progress"&&P==null?X.removeAttribute("value"):P!=null&&(P!==X[$]||w=="progress"&&!P||w=="option"&&P!=O[$])&&o(X,$,P,O[$],Q),$="checked",D!=null&&D!=X[$]&&o(X,$,D,O[$],Q))}return X}function L0(X,Y,Z){try{if(typeof X=="function"){var K=typeof X.__u=="function";K&&X.__u(),K&&Y==null||(X.__u=X(Y))}else X.current=Y}catch(Q){H.__e(Q,Z)}}function a0(X,Y,Z){var K,Q;if(H.unmount&&H.unmount(X),(K=X.ref)&&(K.current&&K.current!=X.__e||L0(K,null,Y)),(K=X.__c)!=null){if(K.componentWillUnmount)try{K.componentWillUnmount()}catch(G){H.__e(G,Y)}K.base=K.__P=null}if(K=X.__k)for(Q=0;Q<K.length;Q++)K[Q]&&a0(K[Q],Y,Z||typeof X.type!="function");Z||U0(X.__e),X.__c=X.__=X.__e=void 0}function d1(X,Y,Z){return this.constructor(X,Z)}function k(X,Y,Z){var K,Q,G,W;Y==document&&(Y=document.documentElement),H.__&&H.__(X,Y),Q=(K=typeof Z=="function")?null:Z&&Z.__k||Y.__k,G=[],W=[],R0(Y,X=(!K&&Z||Y).__k=C(E,null,[X]),Q||p,p,Y.namespaceURI,!K&&Z?[Z]:Q?null:Y.firstChild?e.call(Y.childNodes):null,G,!K&&Z?Z:Q?Q.__e:Y.firstChild,K,W),s0(G,X,W)}function X0(X){function Y(Z){var K,Q;return this.getChildContext||(K=new Set,(Q={})[Y.__c]=this,this.getChildContext=function(){return Q},this.componentWillUnmount=function(){K=null},this.shouldComponentUpdate=function(G){this.props.value!=G.value&&K.forEach(function(W){W.__e=!0,A0(W)})},this.sub=function(G){K.add(G);var W=G.componentWillUnmount;G.componentWillUnmount=function(){K&&K.delete(G),W&&W.call(G)}}),Z.children}return Y.__c="__cC"+k0++,Y.__=X,Y.Provider=Y.__l=(Y.Consumer=function(Z,K){return Z.children(K)}).contextType=Y,Y}e=h0.slice,H={__e:function(X,Y,Z,K){for(var Q,G,W;Y=Y.__;)if((Q=Y.__c)&&!Q.__)try{if((G=Q.constructor)&&G.getDerivedStateFromError!=null&&(Q.setState(G.getDerivedStateFromError(X)),W=Q.__d),Q.componentDidCatch!=null&&(Q.componentDidCatch(X,K||{}),W=Q.__d),W)return Q.__E=Q}catch(q){X=q}throw X}},b0=0,f1=function(X){return X!=null&&X.constructor==null},T.prototype.setState=function(X,Y){var Z;Z=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=N({},this.state),typeof X=="function"&&(X=X(N({},Z),this.props)),X&&N(Z,X),X!=null&&this.__v&&(Y&&this._sb.push(Y),A0(this))},T.prototype.forceUpdate=function(X){this.__v&&(this.__e=!0,X&&this.__h.push(X),A0(this))},T.prototype.render=E,b=[],f0=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,v0=function(X,Y){return X.__v.__b-Y.__v.__b},n.__r=0,x0=/(PointerCapture)$|Capture$/i,w0=0,z0=y0(!1),V0=y0(!0),k0=0;var m1=0;function _(X,Y,Z,K,Q,G){Y||(Y={});var W,q,F=Y;if("ref"in F)for(q in F={},Y)q=="ref"?W=Y[q]:F[q]=Y[q];var $={type:X,props:F,key:Z,ref:W,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--m1,__i:-1,__u:0,__source:Q,__self:G};if(typeof X=="function"&&(W=X.defaultProps))for(q in W)F[q]===void 0&&(F[q]=W[q]);return H.vnode&&H.vnode($),$}var V1=y1(o0(),1);var h,R,P0,t0,Z0=0,G1=[],L=H,n0=L.__b,e0=L.__r,X1=L.diffed,Y1=L.__c,Z1=L.unmount,K1=L.__;function K0(X,Y){L.__h&&L.__h(R,X,Z0||Y),Z0=0;var Z=R.__H||(R.__H={__:[],__h:[]});return X>=Z.__.length&&Z.__.push({}),Z.__[X]}function d(X){return Z0=1,W1($1,X)}function W1(X,Y,Z){var K=K0(h++,2);if(K.t=X,!K.__c&&(K.__=[Z?Z(Y):$1(void 0,Y),function(q){var F=K.__N?K.__N[0]:K.__[0],$=K.t(F,q);F!==$&&(K.__N=[$,K.__[1]],K.__c.setState({}))}],K.__c=R,!R.__f)){var Q=function(q,F,$){if(!K.__c.__H)return!0;var z=K.__c.__H.__.filter(function(A){return!!A.__c});if(z.every(function(A){return!A.__N}))return!G||G.call(this,q,F,$);var J=K.__c.props!==q;return z.forEach(function(A){if(A.__N){var V=A.__[0];A.__=A.__N,A.__N=void 0,V!==A.__[0]&&(J=!0)}}),G&&G.call(this,q,F,$)||J};R.__f=!0;var{shouldComponentUpdate:G,componentWillUpdate:W}=R;R.componentWillUpdate=function(q,F,$){if(this.__e){var z=G;G=void 0,Q(q,F,$),G=z}W&&W.call(this,q,F,$)},R.shouldComponentUpdate=Q}return K.__N||K.__}function f(X,Y){var Z=K0(h++,3);!L.__s&&J1(Z.__H,Y)&&(Z.__=X,Z.u=Y,R.__H.__h.push(Z))}function Q0(X){return Z0=5,q1(function(){return{current:X}},[])}function q1(X,Y){var Z=K0(h++,7);return J1(Z.__H,Y)&&(Z.__=X(),Z.__H=Y,Z.__h=X),Z.__}function u(X){var Y=R.context[X.__c],Z=K0(h++,9);return Z.c=X,Y?(Z.__==null&&(Z.__=!0,Y.sub(R)),Y.props.value):X.__}function a1(){for(var X;X=G1.shift();)if(X.__P&&X.__H)try{X.__H.__h.forEach(Y0),X.__H.__h.forEach(O0),X.__H.__h=[]}catch(Y){X.__H.__h=[],L.__e(Y,X.__v)}}L.__b=function(X){R=null,n0&&n0(X)},L.__=function(X,Y){X&&Y.__k&&Y.__k.__m&&(X.__m=Y.__k.__m),K1&&K1(X,Y)},L.__r=function(X){e0&&e0(X),h=0;var Y=(R=X.__c).__H;Y&&(P0===R?(Y.__h=[],R.__h=[],Y.__.forEach(function(Z){Z.__N&&(Z.__=Z.__N),Z.u=Z.__N=void 0})):(Y.__h.forEach(Y0),Y.__h.forEach(O0),Y.__h=[],h=0)),P0=R},L.diffed=function(X){X1&&X1(X);var Y=X.__c;Y&&Y.__H&&(Y.__H.__h.length&&(G1.push(Y)!==1&&t0===L.requestAnimationFrame||((t0=L.requestAnimationFrame)||i1)(a1)),Y.__H.__.forEach(function(Z){Z.u&&(Z.__H=Z.u),Z.u=void 0})),P0=R=null},L.__c=function(X,Y){Y.some(function(Z){try{Z.__h.forEach(Y0),Z.__h=Z.__h.filter(function(K){return!K.__||O0(K)})}catch(K){Y.some(function(Q){Q.__h&&(Q.__h=[])}),Y=[],L.__e(K,Z.__v)}}),Y1&&Y1(X,Y)},L.unmount=function(X){Z1&&Z1(X);var Y,Z=X.__c;Z&&Z.__H&&(Z.__H.__.forEach(function(K){try{Y0(K)}catch(Q){Y=Q}}),Z.__H=void 0,Y&&L.__e(Y,Z.__v))};var Q1=typeof requestAnimationFrame=="function";function i1(X){var Y,Z=function(){clearTimeout(K),Q1&&cancelAnimationFrame(Y),setTimeout(X)},K=setTimeout(Z,35);Q1&&(Y=requestAnimationFrame(Z))}function Y0(X){var Y=R,Z=X.__c;typeof Z=="function"&&(X.__c=void 0,Z()),R=Y}function O0(X){var Y=R;X.__c=X.__(),R=Y}function J1(X,Y){return!X||X.length!==Y.length||Y.some(function(Z,K){return Z!==X[K]})}function $1(X,Y){return typeof Y=="function"?Y(X):Y}var g={__stop__:!0};function M0(X,Y=10){if(!X||typeof X!=="object")return console.warn("eventToObject: Expected an object input, received:",X),X;let Z=new WeakSet;Z.add(X);let K={};for(let Q in X)try{if(m(X[Q],Q))continue;else if(typeof X[Q]==="object"){let G=j(X[Q],Y,Z);if(G!==g)K[Q]=G}else K[Q]=X[Q]}catch{continue}if(typeof window<"u"&&window.Event&&X instanceof window.Event)K.selection=u1(Y,Z);return K}function u1(X,Y){if(typeof window>"u"||!window.getSelection)return null;let Z=window.getSelection();if(!Z)return null;return{type:Z.type,anchorNode:Z.anchorNode?j(Z.anchorNode,X,Y):null,anchorOffset:Z.anchorOffset,focusNode:Z.focusNode?j(Z.focusNode,X,Y):null,focusOffset:Z.focusOffset,isCollapsed:Z.isCollapsed,rangeCount:Z.rangeCount,selectedText:Z.toString()}}function j(X,Y,Z){let K=Y-1;if(K<=0&&typeof X==="object")return g;if(!X||typeof X!=="object")return X;if(Z.has(X))return g;Z.add(X);try{if(Array.isArray(X)||typeof X?.length==="number"&&typeof X[Symbol.iterator]==="function"&&!Object.prototype.toString.call(X).includes("Map")&&!(X instanceof CSSStyleDeclaration))return l1(X,K,Z);return r1(X,K,Z)}finally{Z.delete(X)}}function l1(X,Y,Z){let K=[];for(let Q=0;Q<X.length;Q++)if(m(X[Q]))continue;else if(typeof X[Q]==="object"){let G=j(X[Q],Y,Z);if(G!==g)K.push(G)}else K.push(X[Q]);return K}function r1(X,Y,Z){let K={};for(let q in X)try{if(m(X[q],q,X))continue;else if(typeof X[q]==="object"){let F=j(X[q],Y,Z);if(F!==g)K[q]=F}else K[q]=X[q]}catch{continue}if(X&&typeof X==="object"&&"dataset"in X&&!Object.prototype.hasOwnProperty.call(K,"dataset")){let q=X.dataset;if(!m(q,"dataset",X)){let F=j(q,Y,Z);if(F!==g)K.dataset=F}}let Q=["value","checked","files","type","name"];for(let q of Q)if(X&&typeof X==="object"&&q in X&&!Object.prototype.hasOwnProperty.call(K,q)){let F=X[q];if(!m(F,q,X))if(typeof F==="object"){let $=q==="files"?Math.max(Y,3):Y,z=j(F,$,Z);if(z!==g)K[q]=z}else K[q]=F}let G=typeof window<"u"?window:void 0,W=G?G.HTMLFormElement:typeof HTMLFormElement<"u"?HTMLFormElement:void 0;if(W&&X instanceof W&&X.elements)for(let q=0;q<X.elements.length;q++){let F=X.elements[q];if(F.name&&!Object.prototype.hasOwnProperty.call(K,F.name)&&!m(F,F.name,X))if(typeof F==="object"){let $=j(F,Y,Z);if($!==g)K[F.name]=$}else K[F.name]=F}return K}function m(X,Y="",Z=void 0){return X===null||X===void 0||Y.startsWith("__")||Y.length>0&&/^[A-Z_]+$/.test(Y)||typeof X==="function"||X instanceof CSSStyleSheet||X instanceof Window||X instanceof Document||Y==="view"||Y==="size"||Y==="length"||Z instanceof CSSStyleDeclaration&&X===""||typeof Node<"u"&&Z instanceof Node&&(Y==="parentNode"||Y==="parentElement"||Y==="ownerDocument"||Y==="getRootNode"||Y==="childNodes"||Y==="children"||Y==="firstChild"||Y==="lastChild"||Y==="previousSibling"||Y==="nextSibling"||Y==="previousElementSibling"||Y==="nextElementSibling"||Y==="innerHTML"||Y==="outerHTML"||Y==="offsetParent"||Y==="offsetWidth"||Y==="offsetHeight"||Y==="offsetLeft"||Y==="offsetTop"||Y==="clientTop"||Y==="clientLeft"||Y==="clientWidth"||Y==="clientHeight"||Y==="scrollWidth"||Y==="scrollHeight"||Y==="scrollTop"||Y==="scrollLeft")}async function F1(X,Y){let Z;if(X.sourceType==="URL")Z=await import(X.source);else Z=await Y.loadModule(X.source);let{bind:K}=Z;if(typeof K!=="function")console.debug("Using generic ReactJS binding for components in module",Z),K=X4;return(Q)=>{let G=K(Q,{sendMessage:Y.sendMessage,onMessage:Y.onMessage});if(!(typeof G.create==="function"&&typeof G.render==="function"&&typeof G.unmount==="function"))return M.error(`${X.source} returned an impropper binding`),null;return{render:(W)=>G.render(H1({client:Y,module:Z,binding:G,model:W,currentImportSource:X})),unmount:G.unmount}}}function H1(X){let Y;if(X.model.importSource){if(!t1(X.currentImportSource,X.model.importSource))return M.error("Parent element import source "+G0(X.currentImportSource)+" does not match child's import source "+G0(X.model.importSource)),null;else if(Y=o1(X.module,X.model.tagName,X.model.importSource),!Y)return null}else Y=X.model.tagName;return X.binding.create(Y,q0(X.model,X.client),W0(X.model,(Z)=>H1({...X,model:Z})))}function o1(X,Y,Z){let K=Y.split("."),Q=null;for(let G=0;G<K.length;G++){let W=K[G];if(Q=G==0?X[W]:Q[W],!Q){if(G==0)M.error("Module from source "+G0(Z)+` does not export ${W}`);else console.error(`Component ${K.slice(0,G).join(".")} from source `+G0(Z)+` does not have subcomponent ${W}`);break}}return Q}function t1(X,Y){return X.source===Y.source&&X.sourceType===Y.sourceType}function G0(X){return JSON.stringify({source:X.source,sourceType:X.sourceType})}function W0(X,Y){if(!X.children)return[];else return X.children.map((Z)=>{switch(typeof Z){case"object":return Y(Z);case"string":return Z}})}function q0(X,Y){return Object.fromEntries(Object.entries({...X.attributes,...Object.fromEntries(Object.entries(X.eventHandlers||{}).map(([Z,K])=>n1(Y,Z,K))),...Object.fromEntries(Object.entries(X.inlineJavaScript||{}).map(([Z,K])=>e1(Z,K)))}))}function n1(X,Y,{target:Z,preventDefault:K,stopPropagation:Q}){let G=function(...W){let q=Array.from(W).map((F)=>{let $=F;if(K)$.preventDefault();if(Q)$.stopPropagation();if(typeof $==="object")return M0($);else return $});X.sendMessage({type:"layout-event",data:q,target:Z})};return G.isHandler=!0,[Y,G]}function e1(name,inlineJavaScript){let wrappedExecutable=function(...args){function handleExecution(...args){let evalResult=eval(inlineJavaScript);if(typeof evalResult=="function")return evalResult(...args)}if(args.length>0&&args[0]instanceof Event)return handleExecution.call(args[0].currentTarget,...args);else return handleExecution(...args)};return wrappedExecutable.isHandler=!1,[name,wrappedExecutable]}function X4(X){return{create:(Y,Z,K)=>C(Y,Z,...K||[]),render:(Y)=>{k(Y,X)},unmount:()=>k(null,X)}}var J0=X0(null);function A1(X){let Y=d({tagName:""})[0],Z=K4();return f(()=>X.client.onMessage("layout-update",({path:K,model:Q})=>{if(K==="")Object.assign(Y,Q);else V1.set(Y,K,Q);Z()}),[Y,X.client]),_(J0.Provider,{value:X.client,children:_(E0,{model:Y})})}function E0({model:X}){if(X.error!==void 0)if(X.error)return _("pre",{children:X.error});else return null;let Y;if(X.tagName in z1)Y=z1[X.tagName];else if(X.importSource)Y=Z4;else Y=B1;return _(Y,{model:X})}function B1({model:X}){let Y=u(J0);return C(X.tagName===""?E:X.tagName,q0(X,Y),...W0(X,(Z)=>{return _(E0,{model:Z},Z.key)}))}function _0({model:X}){let Y=u(J0),Z=q0(X,Y),[K,Q]=d(Z.value);f(()=>Q(Z.value),[Z.value]);let G=Z.onChange;if(typeof G==="function")Z.onChange=(W)=>{if(W.target)Q(W.target.value);G(W)};return C(X.tagName,{...Z,value:K},...W0(X,(W)=>_(E0,{model:W},W.key)))}function Y4({model:X}){let Y=Q0(null);return f(()=>{if(!Y.current)return;let Z=document.createElement("script");for(let[Q,G]of Object.entries(X.attributes||{}))Z.setAttribute(Q,G);let K=X?.children?.filter((Q)=>typeof Q=="string")[0];if(K)Z.appendChild(document.createTextNode(K));return Y.current.appendChild(Z),()=>{Y.current?.removeChild(Z)}},[X.key]),_("div",{ref:Y})}function Z4({model:X}){let Y=X.importSource,Z=Q4(X);if(!Y)return null;let K=Y.fallback;if(!Y)if(!K)return null;else if(typeof K==="string")return _("span",{children:K});else return _(B1,{model:K});else return _("span",{ref:Z})}function K4(){let[,X]=d(!1);return()=>X((Y)=>!Y)}function Q4(X){let Y=X.importSource,Z=JSON.stringify(Y),K=Q0(null),Q=u(J0),[G,W]=d(null);return f(()=>{let q=!1;if(Y)F1(Y,Q).then((F)=>{if(!q&&K.current)W(F(K.current))});return()=>{if(q=!0,G&&Y&&!Y.unmountBeforeUpdate)G.unmount()}},[Q,Z,W,K.current]),f(()=>{if(!(G&&Y))return;if(G.render(X),Y.unmountBeforeUpdate)return G.unmount}),K}var z1={input:_0,script:Y4,select:_0,textarea:_0};function G4(X){let Z=`${`ws${window.location.protocol==="https:"?"s":""}:`}//${window.location.host}`,K=new URL(`${Z}${X.pathPrefix}${X.componentPath||""}`);if(K.searchParams.append("http_pathname",window.location.pathname),window.location.search)K.searchParams.append("http_query_string",window.location.search);let Q=new H0({urls:{componentUrl:K,jsModulesPath:`${window.location.origin}${X.pathPrefix}modules/`},reconnectOptions:{interval:X.reconnectInterval||750,maxInterval:X.reconnectMaxInterval||60000,maxRetries:X.reconnectMaxRetries||150,backoffMultiplier:X.reconnectBackoffMultiplier||1.25},mountElement:X.mountElement});k(_(A1,{client:Q}),X.mountElement)}function q4(X,Y){for(var Z in Y)X[Z]=Y[Z];return X}function w1(X,Y){for(var Z in X)if(Z!=="__source"&&!(Z in Y))return!0;for(var K in Y)if(K!=="__source"&&X[K]!==Y[K])return!0;return!1}function U1(X,Y){this.props=X,this.context=Y}(U1.prototype=new T).isPureReactComponent=!0,U1.prototype.shouldComponentUpdate=function(X,Y){return w1(this.props,X)||w1(this.state,Y)};var R1=H.__b;H.__b=function(X){X.type&&X.type.__f&&X.ref&&(X.props.ref=X.ref,X.ref=null),R1&&R1(X)};var J4=H.__e;H.__e=function(X,Y,Z,K){if(X.then){for(var Q,G=Y;G=G.__;)if((Q=G.__c)&&Q.__c)return Y.__e==null&&(Y.__e=Z.__e,Y.__k=Z.__k),Q.__c(X,Y)}J4(X,Y,Z,K)};var L1=H.unmount;function D1(X,Y,Z){return X&&(X.__c&&X.__c.__H&&(X.__c.__H.__.forEach(function(K){typeof K.__c=="function"&&K.__c()}),X.__c.__H=null),(X=q4({},X)).__c!=null&&(X.__c.__P===Z&&(X.__c.__P=Y),X.__c.__e=!0,X.__c=null),X.__k=X.__k&&X.__k.map(function(K){return D1(K,Y,Z)})),X}function T1(X,Y,Z){return X&&Z&&(X.__v=null,X.__k=X.__k&&X.__k.map(function(K){return T1(K,Y,Z)}),X.__c&&X.__c.__P===Y&&(X.__e&&Z.appendChild(X.__e),X.__c.__e=!0,X.__c.__P=Z)),X}function D0(){this.__u=0,this.o=null,this.__b=null}function I1(X){var Y=X.__.__c;return Y&&Y.__a&&Y.__a(X)}function $0(){this.i=null,this.l=null}H.unmount=function(X){var Y=X.__c;Y&&Y.__R&&Y.__R(),Y&&32&X.__u&&(X.type=null),L1&&L1(X)},(D0.prototype=new T).__c=function(X,Y){var Z=Y.__c,K=this;K.o==null&&(K.o=[]),K.o.push(Z);var Q=I1(K.__v),G=!1,W=function(){G||(G=!0,Z.__R=null,Q?Q(q):q())};Z.__R=W;var q=function(){if(!--K.__u){if(K.state.__a){var F=K.state.__a;K.__v.__k[0]=T1(F,F.__c.__P,F.__c.__O)}var $;for(K.setState({__a:K.__b=null});$=K.o.pop();)$.forceUpdate()}};K.__u++||32&Y.__u||K.setState({__a:K.__b=K.__v.__k[0]}),X.then(W,W)},D0.prototype.componentWillUnmount=function(){this.o=[]},D0.prototype.render=function(X,Y){if(this.__b){if(this.__v.__k){var Z=document.createElement("div"),K=this.__v.__k[0].__c;this.__v.__k[0]=D1(this.__b,Z,K.__O=K.__P)}this.__b=null}var Q=Y.__a&&C(E,null,X.fallback);return Q&&(Q.__u&=-33),[C(E,null,Y.__a?null:X.children),Q]};var P1=function(X,Y,Z){if(++Z[1]===Z[0]&&X.l.delete(Y),X.props.revealOrder&&(X.props.revealOrder[0]!=="t"||!X.l.size))for(Z=X.i;Z;){for(;Z.length>3;)Z.pop()();if(Z[1]<Z[0])break;X.i=Z=Z[2]}};($0.prototype=new T).__a=function(X){var Y=this,Z=I1(Y.__v),K=Y.l.get(X);return K[0]++,function(Q){var G=function(){Y.props.revealOrder?(K.push(Q),P1(Y,X,K)):Q()};Z?Z(G):G()}},$0.prototype.render=function(X){this.i=null,this.l=new Map;var Y=i(X.children);X.revealOrder&&X.revealOrder[0]==="b"&&Y.reverse();for(var Z=Y.length;Z--;)this.l.set(Y[Z],this.i=[1,0,this.i]);return X.children},$0.prototype.componentDidUpdate=$0.prototype.componentDidMount=function(){var X=this;this.l.forEach(function(Y,Z){P1(X,Z,Y)})};var $4=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,F4=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,H4=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,z4=/[A-Z0-9]/g,V4=typeof document<"u",A4=function(X){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(X)};T.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(X){Object.defineProperty(T.prototype,X,{configurable:!0,get:function(){return this["UNSAFE_"+X]},set:function(Y){Object.defineProperty(this,X,{configurable:!0,writable:!0,value:Y})}})});var O1=H.event;function B4(){}function w4(){return this.cancelBubble}function U4(){return this.defaultPrevented}H.event=function(X){return O1&&(X=O1(X)),X.persist=B4,X.isPropagationStopped=w4,X.isDefaultPrevented=U4,X.nativeEvent=X};var C1,R4={enumerable:!1,configurable:!0,get:function(){return this.class}},M1=H.vnode;H.vnode=function(X){typeof X.type=="string"&&function(Y){var{props:Z,type:K}=Y,Q={},G=K.indexOf("-")===-1;for(var W in Z){var q=Z[W];if(!(W==="value"&&("defaultValue"in Z)&&q==null||V4&&W==="children"&&K==="noscript"||W==="class"||W==="className")){var F=W.toLowerCase();W==="defaultValue"&&"value"in Z&&Z.value==null?W="value":W==="download"&&q===!0?q="":F==="translate"&&q==="no"?q=!1:F[0]==="o"&&F[1]==="n"?F==="ondoubleclick"?W="ondblclick":F!=="onchange"||K!=="input"&&K!=="textarea"||A4(Z.type)?F==="onfocus"?W="onfocusin":F==="onblur"?W="onfocusout":H4.test(W)&&(W=F):F=W="oninput":G&&F4.test(W)?W=W.replace(z4,"-$&").toLowerCase():q===null&&(q=void 0),F==="oninput"&&Q[W=F]&&(W="oninputCapture"),Q[W]=q}}K=="select"&&Q.multiple&&Array.isArray(Q.value)&&(Q.value=i(Z.children).forEach(function($){$.props.selected=Q.value.indexOf($.props.value)!=-1})),K=="select"&&Q.defaultValue!=null&&(Q.value=i(Z.children).forEach(function($){$.props.selected=Q.multiple?Q.defaultValue.indexOf($.props.value)!=-1:Q.defaultValue==$.props.value})),Z.class&&!Z.className?(Q.class=Z.class,Object.defineProperty(Q,"className",R4)):(Z.className&&!Z.class||Z.class&&Z.className)&&(Q.class=Q.className=Z.className),Y.props=Q}(X),X.$$typeof=$4,M1&&M1(X)};var _1=H.__r;H.__r=function(X){_1&&_1(X),C1=X.__c};var E1=H.diffed;H.diffed=function(X){E1&&E1(X);var{props:Y,__e:Z}=X;Z!=null&&X.type==="textarea"&&"value"in Y&&Y.value!==Z.value&&(Z.value=Y.value==null?"":Y.value),C1=null};export{G4 as mountReactPy};
2
2
 
3
- //# debugId=C1434DC94305F87F64756E2164756E21
3
+ //# debugId=83C2A083BCE051E864756E2164756E21
4
4
  //# sourceMappingURL=index.js.map