diff --git a/metaflow/client/core.py b/metaflow/client/core.py index e6852b71901..18b4d1c4d97 100644 --- a/metaflow/client/core.py +++ b/metaflow/client/core.py @@ -2121,8 +2121,9 @@ def parent_steps(self) -> Iterator["Step"]: Parent step """ graph_info = self.task["_graph_info"].data + start_step = graph_info.get("start_step", "start") - if self.id != "start": + if self.id != start_step: flow, run, _ = self.path_components for node_name, attributes in graph_info["steps"].items(): if self.id in attributes["next"]: @@ -2139,8 +2140,9 @@ def child_steps(self) -> Iterator["Step"]: Child step """ graph_info = self.task["_graph_info"].data + end_step = graph_info.get("end_step", "end") - if self.id != "end": + if self.id != end_step: flow, run, _ = self.path_components for next_step in graph_info["steps"][self.id]["next"]: yield Step(f"{flow}/{run}/{next_step}", _namespace_check=False) @@ -2153,7 +2155,7 @@ class Run(MetaflowObject): Attributes ---------- data : MetaflowData - a shortcut to run['end'].task.data, i.e. data produced by this run. + A shortcut to the terminal step's task data produced by this run. successful : bool True if the run completed successfully. finished : bool @@ -2165,7 +2167,7 @@ class Run(MetaflowObject): trigger : MetaflowTrigger Information about event(s) that triggered this run (if present). See `MetaflowTrigger`. end_task : Task - `Task` for the end step (if it is present already). + `Task` for the terminal step (if it is present already). """ _NAME = "run" @@ -2176,6 +2178,36 @@ def _iter_filter(self, x): # exclude _parameters step return x.id[0] != "_" + @property + def _graph_endpoints(self): + """ + Returns (start_step_name, end_step_name) from ``_parameters`` task + metadata. + + The metadata is written by ``persist_constants``, which every + runtime path calls before any step executes — the native runtime + directly, and orchestrators (Argo Workflows, Airflow, Step + Functions) through the ``init`` command they insert into their + generated command line. Falls back to the literal + ``("start", "end")`` for old runs that predate custom endpoint + support. + """ + if not hasattr(self, "_cached_endpoints"): + start, end = "start", "end" + try: + params_meta = self["_parameters"].task.metadata_dict + start = params_meta.get("start_step", "start") + end = params_meta.get("end_step", "end") + except (KeyError, MetaflowNotFound): + # Expected for old runs without _parameters or metadata. + pass + except Exception: + # Transient error (network, metadata service) -- do NOT cache + # the fallback so a subsequent access can retry. + return (start, end) + self._cached_endpoints = (start, end) + return self._cached_endpoints + def steps(self, *tags: str) -> Iterator[Step]: """ [Legacy function - do not use] @@ -2298,17 +2330,18 @@ def finished_at(self) -> Optional[datetime]: @property def end_task(self) -> Optional[Task]: """ - Returns the Task corresponding to the 'end' step. + Returns the Task corresponding to the terminal step. - This returns None if the end step does not yet exist. + This returns None if the terminal step does not yet exist. Returns ------- Task, optional - The 'end' task + The terminal step's task """ try: - end_step = self["end"] + _, end_step_name = self._graph_endpoints + end_step = self[end_step_name] except KeyError: return None @@ -2481,8 +2514,9 @@ def trigger(self) -> Optional[Trigger]: Trigger, optional Container of triggering events """ - if "start" in self and self["start"].task: - meta = self["start"].task.metadata_dict.get("execution-triggers") + start_step, _ = self._graph_endpoints + if start_step in self and self[start_step].task: + meta = self[start_step].task.metadata_dict.get("execution-triggers") if meta: return Trigger(json.loads(meta)) return None diff --git a/metaflow/decorators.py b/metaflow/decorators.py index 54c41ef4834..6bd45e726a4 100644 --- a/metaflow/decorators.py +++ b/metaflow/decorators.py @@ -588,6 +588,27 @@ def _base_step_decorator(decotype, *args, **kwargs): func = args[0] if isinstance(func, (StepMutator, UserStepDecoratorBase)): func = func._my_step + + # Step decorator applied to a class with a synthesized step method. + # This branch exists to support an upcoming FunctionSpec feature + # (currently shipped as an out-of-tree extension): its metaclass + # (FunctionSpecMeta) creates a single `@step(start=True, end=True)` + # method on the class and sets `_function_spec_step_name` to its + # attribute name. That lets class-level step decorators like + # ``@retry``/``@resources`` forward to the synthetic step. + # + # The `_function_spec_step_name` attribute is not set anywhere else + # in this repo — it is deliberately an extension contract. See the + # DAGNode module comment in graph.py for the wider context. This + # hook may be removed once FunctionSpec is folded into core. + if isinstance(func, type) and hasattr(func, "_function_spec_step_name"): + step_func = getattr(func, func._function_spec_step_name) + if hasattr(step_func, "is_step"): + step_func.decorators.append( + decotype(attributes=kwargs, statically_defined=True) + ) + return func + if not hasattr(func, "is_step"): raise BadStepDecoratorException(decotype.name, func) @@ -1009,7 +1030,11 @@ def step( def step( - f: Union[Callable[[FlowSpecDerived], None], Callable[[FlowSpecDerived, Any], None]], + f=None, + *, + start=False, + end=False, + node_info=None, ): """ Marks a method in a FlowSpec as a Metaflow Step. Note that this @@ -1034,20 +1059,41 @@ def foo(self): Parameters ---------- - f : Union[Callable[[FlowSpecDerived], None], Callable[[FlowSpecDerived, Any], None]] - Function to make into a Metaflow Step + f : callable, optional + Function to make into a Metaflow Step. When using keyword arguments + (e.g. ``@step(start=True)``), this is ``None`` and a decorator + function is returned instead. + start : bool, default False + Mark this step as the start (entry) step of the flow. + end : bool, default False + Mark this step as the end (terminal) step of the flow. + node_info : dict, optional + Extra metadata to attach to this step's DAGNode. Extensions can use + this to store arbitrary information accessible via ``flow._graph`` + (live references) and ``_graph_info`` (serialized via ``to_pod``). Returns ------- - Union[Callable[[FlowSpecDerived, StepFlag], None], Callable[[FlowSpecDerived, Any, StepFlag], None]] - Function that is a Metaflow Step + callable + The decorated function, or a decorator if keyword arguments were used. """ - f.is_step = True - f.decorators = [] - f.config_decorators = [] - f.wrappers = [] - f.name = f.__name__ - return f + + def _apply(func): + func.is_step = True + func.decorators = [] + func.config_decorators = [] + func.wrappers = [] + func.name = func.__name__ + func.is_start_step = start + func.is_end_step = end + func.node_info = node_info or {} + return func + + if f is not None: + # Called as @step (no parens) + return _apply(f) + # Called as @step(start=True) etc. + return _apply def _import_plugin_decorators(globals_dict): diff --git a/metaflow/events.py b/metaflow/events.py index 54c52ecd7d3..0d5972c5ef3 100644 --- a/metaflow/events.py +++ b/metaflow/events.py @@ -57,18 +57,39 @@ def __init__(self, _meta=None): @classmethod def from_runs(cls, run_objs: List["metaflow.Run"]): run_objs.sort(key=lambda x: x.finished_at, reverse=True) - trigger = Trigger( - [ + valid_runs = [] + meta = [] + for run_obj in run_objs: + end_task = run_obj.end_task + if end_task is None: + continue + valid_runs.append(run_obj) + end_step_name = end_task.parent.id + meta.append( { "type": "run", "timestamp": run_obj.finished_at, - "name": "metaflow.%s.%s" % (run_obj.parent.id, run_obj["end"].id), - "id": run_obj.end_task.pathspec, + "name": "metaflow.%s.%s" % (run_obj.parent.id, end_step_name), + "id": end_task.pathspec, } - for run_obj in run_objs - ] - ) - trigger._runs = run_objs + ) + # For custom-named end steps, also emit the well-known ".end" + # alias so downstream code that filters on "metaflow..end" + # keeps matching. This mirrors the dual-emit in + # argo_workflows_decorator.py so the Argo publish path and the + # programmatic Trigger.from_runs path stay symmetric. + if end_step_name != "end": + meta.append( + { + "type": "run", + "timestamp": run_obj.finished_at, + "name": "metaflow.%s.end" % run_obj.parent.id, + "id": end_task.pathspec, + } + ) + + trigger = Trigger(meta) + trigger._runs = valid_runs return trigger @property diff --git a/metaflow/flowspec.py b/metaflow/flowspec.py index b09d95c4c6f..307c19df2c5 100644 --- a/metaflow/flowspec.py +++ b/metaflow/flowspec.py @@ -522,6 +522,8 @@ def _set_constants(self, graph, kwargs, config_options): graph_info = { "file": os.path.basename(os.path.abspath(sys.argv[0])), + "start_step": graph.start_step, + "end_step": graph.end_step, "parameters": parameters_info, "constants": constants_info, "steps": steps_info, diff --git a/metaflow/graph.py b/metaflow/graph.py index 1c5dd53bfc5..aa79ad916cb 100644 --- a/metaflow/graph.py +++ b/metaflow/graph.py @@ -46,20 +46,79 @@ def deindent_docstring(doc): return "" +# --------------------------------------------------------------------------- +# Note on "sourceless" DAGNodes (used by FunctionSpec) +# --------------------------------------------------------------------------- +# FunctionSpec is an upcoming FlowSpec-like construct, currently shipped as an +# out-of-tree extension, that represents a single-computation spec (one +# `@step(start=True, end=True)` method synthesized by a metaclass). Because +# the synthetic step is built dynamically (typically via compile()+exec()), +# `inspect.getsourcelines()` on the resulting function fails and we cannot +# feed it to ast.parse(). +# +# To support FunctionSpec without pulling it into core, DAGNode accepts +# optional `name` and `num_args` kwargs and tolerates `func_ast=None`: +# callers that have an AST (the common @step path) use the AST branch; +# callers that don't (FunctionSpec-style synthesized single steps) supply +# the attributes directly. This is safe for single-step flows because they +# have no `self.next()` transitions to analyze. +# +# `FunctionSpecMeta` sets `_function_spec_step_name` on the generated class +# so step decorators applied at the class level (e.g. `@retry`) can find the +# synthetic step. See also `_create_sourceless_single_step_node` below and +# `_base_step_decorator` in decorators.py. +# +# These hooks may become unnecessary if FunctionSpec is folded into core; +# they are intentionally minimal and narrowly scoped for now. +# --------------------------------------------------------------------------- + + class DAGNode(object): def __init__( - self, func_ast, decos, wrappers, config_decorators, doc, source_file, lineno + self, + func_ast, + decos, + wrappers, + config_decorators, + doc, + source_file, + lineno, + is_start_step=False, + is_end_step=False, + node_info=None, + name=None, + num_args=None, ): - self.name = func_ast.name + # `name` and `num_args` are optional fallbacks used when `func_ast` + # is None (e.g. for FunctionSpec-synthesized steps — see the module + # comment above). The normal @step path always passes a `func_ast` + # and both values are derived from it. + if func_ast is None and name is None: + raise ValueError("name is required when func_ast is None") + + # Prefer explicit `name` (the attribute name under which the step was + # discovered) over the AST-derived `def` name. This matters when a + # metaclass renames a function via __name__ — the attribute name is + # what getattr(cls, node.name) later looks up in FlowSpec._init_graph. + self.name = name if name is not None else func_ast.name self.source_file = source_file # lineno is the start line of decorators in source_file # func_ast.lineno is lines from decorators start to def of function - self.func_lineno = lineno + func_ast.lineno - 1 + if func_ast is not None: + self.func_lineno = lineno + func_ast.lineno - 1 + else: + self.func_lineno = lineno self.decorators = decos self.wrappers = wrappers self.config_decorators = config_decorators self.doc = deindent_docstring(doc) self.parallel_step = any(getattr(deco, "IS_PARALLEL", False) for deco in decos) + # Explicit start/end annotations from @step(start=True) / @step(end=True) + self.is_start_step = is_start_step + self.is_end_step = is_end_step + # Generic metadata dict for extensions to attach extra info to this node. + # Serialized to _graph_info via to_pod; live references accessible via flow._graph. + self.node_info = node_info or {} # these attributes are populated by _parse self.tail_next_lineno = 0 @@ -67,13 +126,17 @@ def __init__( self.out_funcs = [] self.has_tail_next = False self.invalid_tail_next = False - self.num_args = 0 + # num_args: derived from the AST by _parse() in the normal @step path; + # passed in explicitly by callers that synthesize a step without an AST + # (see module comment above). + self.num_args = 0 if num_args is None else num_args self.switch_cases = {} self.condition = None self.foreach_param = None self.num_parallel = 0 self.parallel_foreach = False - self._parse(func_ast, lineno) + if func_ast is not None: + self._parse(func_ast, lineno) # these attributes are populated by _traverse_graph self.in_funcs = set() @@ -140,10 +203,9 @@ def _parse(self, func_ast, lineno): self.num_args = len(func_ast.args.args) tail = func_ast.body[-1] - # end doesn't need a transition - if self.name == "end": - # TYPE: end - self.type = "end" + # Note: type assignment for start/end steps is handled by + # FlowGraph._identify_start_end() based on graph structure, + # not by name. # ensure that the tail an expression if not isinstance(tail, ast.Expr): @@ -212,10 +274,10 @@ def _parse(self, func_ast, lineno): self.type = "split" self.invalid_tail_next = False elif len(self.out_funcs) == 1: - # TYPE: linear - if self.name == "start": - self.type = "start" - elif self.num_args > 1: + # TYPE: linear (or join) + # Note: "start" type is assigned later by + # FlowGraph._identify_start_end() based on structure. + if self.num_args > 1: self.type = "join" else: self.type = "linear" @@ -259,29 +321,138 @@ def __init__(self, flow): self.doc = deindent_docstring(flow.__doc__) # nodes sorted in topological order. self.sorted_nodes = [] + self._identify_start_end() self._traverse_graph() self._postprocess() + def _identify_start_end(self): + """ + Determine the start and end steps. + + Uses explicit @step(start=True) / @step(end=True) annotations if present. + Falls back to steps named "start" / "end" for backward compatibility. + Sets self.start_step and self.end_step to step name strings, or None + if the graph is malformed (validated later by lint). + """ + + def _resolve(attr, fallback_name): + """Find the unique annotated step, or fall back to a named step.""" + annotated = [ + name for name, node in self.nodes.items() if getattr(node, attr) + ] + if len(annotated) == 1: + return annotated[0] + if len(annotated) == 0: + return fallback_name if fallback_name in self.nodes else None + return None # Multiple annotated, lint will catch. + + self.start_step = _resolve("is_start_step", "start") + self.end_step = _resolve("is_end_step", "end") + + # Single-step flow ergonomics: if the flow has exactly one step, that + # step is implicitly both the entry and terminal node. Lets users write + # a bare @step on the single-step case instead of requiring + # @step(start=True, end=True). Skipped when more than one step exists, + # so the explicit-annotation contract still holds for real DAGs. + if len(self.nodes) == 1: + (only_step,) = self.nodes + self.start_step = self.end_step = only_step + + # Assign node types for graph traversal. + # Only upgrade "linear" -> "start" for the entry point; do NOT override + # "split", "foreach", etc. since those types are needed for + # split/join balance checking. + if self.start_step and self.start_step == self.end_step: + # Single-step flow: terminal node that is also the entry point. + self.nodes[self.start_step].type = "end" + else: + if self.start_step: + node = self.nodes[self.start_step] + if node.type in (None, "linear"): + node.type = "start" + if self.end_step: + self.nodes[self.end_step].type = "end" + + def _create_sourceless_single_step_node( + self, name, func, is_start_step, is_end_step + ): + """Create a DAGNode for a dynamically-generated single-step method. + + When ``inspect.getsourcelines()`` fails (e.g. for steps synthesized + via ``compile()`` + ``exec()`` by extension metaclasses like + ``FunctionSpecMeta``), this method builds a DAGNode without AST + parsing. This is safe because single-step flows (``start=True, + end=True``) have no ``self.next()`` transitions to analyze. + + See the module-level comment on DAGNode for the broader FunctionSpec + context. This path may be removed once FunctionSpec is folded into + core; it's intentionally narrow to keep the core FlowSpec path + unaffected. + """ + code = getattr(func, "__code__", None) + source_file = inspect.getsourcefile(func) or inspect.getfile(func) + lineno = getattr(code, "co_firstlineno", 0) + + try: + num_args = len(inspect.signature(func).parameters) + except (TypeError, ValueError): + num_args = getattr(code, "co_argcount", 0) + + return DAGNode( + None, + func.decorators, + func.wrappers, + func.config_decorators, + func.__doc__, + source_file, + lineno, + is_start_step=is_start_step, + is_end_step=is_end_step, + node_info=getattr(func, "node_info", None), + name=name, + num_args=num_args, + ) + def _create_nodes(self, flow): nodes = {} for element in dir(flow): func = getattr(flow, element) if callable(func) and hasattr(func, "is_step"): - source_file = inspect.getsourcefile(func) - source_lines, lineno = inspect.getsourcelines(func) - # This also works for code (strips out leading whitspace based on - # first line) - source_code = deindent_docstring("".join(source_lines)) - function_ast = ast.parse(source_code).body[0] - node = DAGNode( - function_ast, - func.decorators, - func.wrappers, - func.config_decorators, - func.__doc__, - source_file, - lineno, - ) + is_start = getattr(func, "is_start_step", False) + is_end = getattr(func, "is_end_step", False) + + try: + source_file = inspect.getsourcefile(func) or inspect.getfile(func) + source_lines, lineno = inspect.getsourcelines(func) + except OSError: + # No readable source — only tolerated for synthesized + # single-step methods (see DAGNode module comment for + # the FunctionSpec context). Any other @step without a + # source file is genuinely broken, so re-raise. + if is_start and is_end: + node = self._create_sourceless_single_step_node( + element, func, is_start, is_end + ) + else: + raise + else: + # This also works for code (strips out leading whitespace based on + # first line) + source_code = deindent_docstring("".join(source_lines)) + function_ast = ast.parse(source_code).body[0] + node = DAGNode( + function_ast, + func.decorators, + func.wrappers, + func.config_decorators, + func.__doc__, + source_file, + lineno, + is_start_step=is_start, + is_end_step=is_end, + node_info=getattr(func, "node_info", None), + name=element, + ) nodes[element] = node return nodes @@ -338,8 +509,8 @@ def traverse(node, seen, split_parents, split_branches): split_branches + ([n] if add_split_branch else []), ) - if "start" in self: - traverse(self["start"], [], [], []) + if self.start_step and self.start_step in self: + traverse(self[self.start_step], [], [], []) # fix the order of in_funcs for node in self.nodes.values(): @@ -445,6 +616,7 @@ def node_to_dict(name, node): for deco in chain(node.wrappers, node.config_decorators) ], "next": node.out_funcs, + "node_info": to_pod(node.node_info), } if d["type"] == "split-foreach": d["foreach_artifact"] = node.foreach_param @@ -493,9 +665,27 @@ def populate_block(start_name, end_name): break return resulting_list - graph_structure = populate_block("start", "end") + if self.start_step is None or self.end_step is None: + missing = [] + if self.start_step is None: + missing.append("start") + if self.end_step is None: + missing.append("end") + raise ValueError( + "Cannot compute graph structure: no %s step identified. " + "Use @step(start=True)/@step(end=True) or name your steps " + "'start'/'end'." % " or ".join(missing) + ) - steps_info["end"] = node_to_dict("end", self.nodes["end"]) - graph_structure.append("end") + if self.start_step == self.end_step: + # Single-step flow + graph_structure = [] + else: + graph_structure = populate_block(self.start_step, self.end_step) + + steps_info[self.end_step] = node_to_dict( + self.end_step, self.nodes[self.end_step] + ) + graph_structure.append(self.end_step) return steps_info, graph_structure diff --git a/metaflow/lint.py b/metaflow/lint.py index 8f82c813b0d..b95e7ba0e95 100644 --- a/metaflow/lint.py +++ b/metaflow/lint.py @@ -58,23 +58,97 @@ def check_reserved_words(graph): @linter.ensure_fundamentals @linter.check def check_basic_steps(graph): - msg = "Add %s *%s* step in your flow." - for prefix, node in (("a", "start"), ("an", "end")): - if node not in graph: - raise LintWarn(msg % (prefix, node)) + if graph.start_step is None: + annotated = [name for name, node in graph.nodes.items() if node.is_start_step] + if len(annotated) > 1: + raise LintWarn( + "Multiple steps annotated with @step(start=True): %s. " + "Exactly one is allowed." % ", ".join(sorted(annotated)) + ) + raise LintWarn( + "Your flow must have exactly one start step. Either name a step " + "'start' or use @step(start=True)." + ) + if graph.end_step is None: + annotated = [name for name, node in graph.nodes.items() if node.is_end_step] + if len(annotated) > 1: + raise LintWarn( + "Multiple steps annotated with @step(end=True): %s. " + "Exactly one is allowed." % ", ".join(sorted(annotated)) + ) + raise LintWarn( + "Your flow must have exactly one end step. Either name a step " + "'end' or use @step(end=True)." + ) + + +@linter.ensure_fundamentals +@linter.check +def check_annotation_name_conflict(graph): + """Detect conflict between @step(start/end=True) and legacy step names.""" + if ( + graph.start_step is not None + and graph.start_step != "start" + and "start" in graph.nodes + ): + raise LintWarn( + "Ambiguous start step: step '%s' is annotated with @step(start=True) " + "but a step named 'start' also exists. Remove the 'start' name or " + "the @step(start=True) annotation." % graph.start_step + ) + + if graph.end_step is not None and graph.end_step != "end" and "end" in graph.nodes: + raise LintWarn( + "Ambiguous end step: step '%s' is annotated with @step(end=True) " + "but a step named 'end' also exists. Remove the 'end' name or " + "the @step(end=True) annotation." % graph.end_step + ) + + +@linter.ensure_static_graph +@linter.check +def check_start_end_degree(graph): + """Validate that the start step has no incoming and the end step has no outgoing.""" + if graph.start_step is None or graph.end_step is None: + return + + start_node = graph[graph.start_step] + if start_node.in_funcs: + raise LintWarn( + "The start step *%s* has incoming transitions from %s. " + "A start step must have no incoming transitions." + % (graph.start_step, ", ".join(start_node.in_funcs)), + start_node.func_lineno, + start_node.source_file, + ) + + end_node = graph[graph.end_step] + if end_node.out_funcs: + raise LintWarn( + "The end step *%s* has outgoing transitions. " + "An end step must have no outgoing transitions (no self.next())." + % graph.end_step, + end_node.func_lineno, + end_node.source_file, + ) @linter.ensure_static_graph @linter.check def check_that_end_is_end(graph): - msg0 = "The *end* step should not have a step.next() transition. " "Just remove it." + if graph.end_step is None: + return + + node = graph[graph.end_step] + msg0 = ( + "The terminal step *%s* should not have a self.next() transition. " + "Just remove it." % graph.end_step + ) msg1 = ( - "The *end* step should not be a join step (it gets an extra " - "argument). Add a join step before it." + "The terminal step *%s* should not be a join step (it gets an extra " + "argument). Add a join step before it." % graph.end_step ) - node = graph["end"] - if node.has_tail_next or node.invalid_tail_next: raise LintWarn(msg0, node.tail_next_lineno, node.source_file) if node.num_args > 1: @@ -192,11 +266,14 @@ def check_path(node, seen): @linter.ensure_static_graph @linter.check def check_for_orphans(graph): + if graph.start_step is None: + return + msg = ( - "Step *{0.name}* is unreachable from the start step. Add " - "self.next({0.name}) in another step or remove *{0.name}*." + "Step *{0.name}* is unreachable from the entry step *%s*. Add " + "self.next({0.name}) in another step or remove *{0.name}*." % graph.start_step ) - seen = set(["start"]) + seen = set([graph.start_step]) def traverse(node): for n in node.out_funcs: @@ -204,7 +281,7 @@ def traverse(node): seen.add(n) traverse(graph[n]) - traverse(graph["start"]) + traverse(graph[graph.start_step]) nodeset = frozenset(n.name for n in graph) orphans = nodeset - seen if orphans: @@ -215,9 +292,12 @@ def traverse(node): @linter.ensure_static_graph @linter.check def check_split_join_balance(graph): + if graph.start_step is None or graph.end_step is None: + return + msg0 = ( - "Step *end* reached before a split started at step(s) *{roots}* " - "were joined. Add a join step before *end*." + "The terminal step *{end}* was reached before a split started at step(s) " + "*{roots}* were joined. Add a join step before *{end}*." ) msg1 = ( "Step *{0.name}* seems like a join step (it takes an extra input " @@ -253,7 +333,9 @@ def traverse(node, split_stack): _, split_roots = split_stack.pop() roots = ", ".join(split_roots) raise LintWarn( - msg0.format(roots=roots), node.func_lineno, node.source_file + msg0.format(roots=roots, end=graph.end_step), + node.func_lineno, + node.source_file, ) elif node.type == "join": new_stack = split_stack @@ -301,7 +383,7 @@ def parents(n): continue traverse(graph[n], new_stack) - traverse(graph["start"], []) + traverse(graph[graph.start_step], []) @linter.ensure_static_graph diff --git a/metaflow/plugins/airflow/airflow.py b/metaflow/plugins/airflow/airflow.py index a2c39899599..43ef65efacb 100644 --- a/metaflow/plugins/airflow/airflow.py +++ b/metaflow/plugins/airflow/airflow.py @@ -289,7 +289,7 @@ def _to_job(self, node): # The below if/else block handles "input paths". # Input Paths help manage dataflow across the graph. - if node.name == "start": + if node.name == self.graph.start_step: # POSSIBLE_FUTURE_IMPROVEMENT: # We can extract metadata about the possible upstream sensor triggers. # There is a previous commit (7bdf6) in the `airflow` branch that has `SensorMetaExtractor` class and @@ -561,7 +561,7 @@ def _step_cli(self, node, paths, code_package_url, user_code_retries): "--with=airflow_internal", ] - if node.name == "start": + if node.name == self.graph.start_step: # We need a separate unique ID for the special _parameters task task_id_params = "%s-params" % AIRFLOW_MACROS.create_task_id( self.contains_foreach @@ -749,7 +749,7 @@ def _visit(node, workflow, exit_node=None): ), **airflow_dag_args ) - workflow = _visit(self.graph["start"], workflow) + workflow = _visit(self.graph[self.graph.start_step], workflow) workflow.set_parameters(self.parameters) if len(appending_sensors) > 0: diff --git a/metaflow/plugins/airflow/airflow_cli.py b/metaflow/plugins/airflow/airflow_cli.py index b3afba4189a..75420475c6c 100644 --- a/metaflow/plugins/airflow/airflow_cli.py +++ b/metaflow/plugins/airflow/airflow_cli.py @@ -371,7 +371,7 @@ def traverse_graph(node, state): for func in node.out_funcs: traverse_graph(graph[func], state) - traverse_graph(graph["start"], {}) + traverse_graph(graph[graph.start_step], {}) def _validate_workflow(flow, graph, flow_datastore, metadata, workflow_timeout): diff --git a/metaflow/plugins/argo/argo_workflows.py b/metaflow/plugins/argo/argo_workflows.py index 105c65ae598..b49c0f252f6 100644 --- a/metaflow/plugins/argo/argo_workflows.py +++ b/metaflow/plugins/argo/argo_workflows.py @@ -1206,8 +1206,9 @@ def _is_recursive_node(self, node): return node.name in self.recursive_nodes def _matching_conditional_join(self, node): - # If no earlier conditional join step is found during parsing, then 'end' is always one. - return self.matching_conditional_join_dict.get(node.name, "end") + # If no earlier conditional join step is found during parsing, + # fall back to the graph's terminal step. + return self.matching_conditional_join_dict.get(node.name, self.graph.end_step) # Visit every node and yield the uber DAGTemplate(s). def _dag_templates(self): @@ -1243,7 +1244,7 @@ def _visit( # helper variable for recursive conditional inputs has_foreach_inputs = False - if node.name == "start": + if node.name == self.graph.start_step: # Start node has no dependencies. dag_task = DAGTask(self._sanitize(node.name)).template( self._sanitize(node.name) @@ -1945,7 +1946,9 @@ def build_ancestor_tree(node_groups, switch_ancestors): for daemon_template in self._daemon_templates() ] - templates, dag_tasks = _visit(node=self.graph["start"], dag_tasks=daemon_tasks) + templates, dag_tasks = _visit( + node=self.graph[self.graph.start_step], dag_tasks=daemon_tasks + ) # Add the DAG template only after fully traversing the graph so we are guaranteed to have all the dag_tasks collected. templates.append( Template(self.flow.name).dag(DAGTemplate().fail_fast().tasks(dag_tasks)) @@ -1997,7 +2000,7 @@ def _container_templates(self): # input paths and parallel join will derive input paths based on a # formulaic approach using `num-parallel` and `task-id-entropy`. if not ( - node.name == "start" + node.name == self.graph.start_step or (node.type == "join" and self.graph[node.in_funcs[0]].parallel_step) ): # For parallel joins we don't pass the INPUT_PATHS but are dynamically constructed. @@ -2160,7 +2163,7 @@ def _container_templates(self): % self.auto_emit_argo_events, ] - if node.name == "start": + if node.name == self.graph.start_step: # Execute `init` before any step of the workflow executes task_id_params = "%s-params" % task_id init = ( @@ -2457,7 +2460,7 @@ def _container_templates(self): # input paths and parallel join will derive input paths based on a # formulaic approach. if not ( - node.name == "start" + node.name == self.graph.start_step or (node.type == "join" and self.graph[node.in_funcs[0]].parallel_step) ): inputs.append(Parameter("input-paths")) @@ -2511,7 +2514,7 @@ def _container_templates(self): outputs = [] # @parallel steps will not have a task-id as an output parameter since task-ids # are derived at runtime. - if not (node.name == "end" or node.parallel_step): + if not (node.name == self.graph.end_step or node.parallel_step): outputs = [Parameter("task-id").valueFrom({"path": "/mnt/out/task_id"})] # If this step is a split-switch one, we need to output the switch step name @@ -2983,7 +2986,7 @@ def _lifecycle_hooks(self): def _lifecycle_hook_from_deco(self, deco): from kubernetes import client as kubernetes_sdk - start_step = [step for step in self.graph if step.name == "start"][0] + start_step = self.graph[self.graph.start_step] # We want to grab the base image used by the start step, as this is known to be pullable from within the cluster, # and it might contain the required libraries, allowing us to start up faster. start_kube_deco = [ @@ -3130,7 +3133,7 @@ def _exit_hook_templates(self): def _error_msg_capture_hook_templates(self): from kubernetes import client as kubernetes_sdk - start_step = [step for step in self.graph if step.name == "start"][0] + start_step = self.graph[self.graph.start_step] # We want to grab the base image used by the start step, as this is known to be pullable from within the cluster, # and it might contain the required libraries, allowing us to start up faster. resources = dict( @@ -3693,7 +3696,7 @@ def _heartbeat_daemon_template(self): # We want to grab the base image used by the start step, as this is known to be pullable from within the cluster, # and it might contain the required libraries, allowing us to start up faster. - start_step = next(step for step in self.flow if step.name == "start") + start_step = self.graph[self.graph.start_step] resources = dict( [deco for deco in start_step.decorators if deco.name == "kubernetes"][ 0 diff --git a/metaflow/plugins/argo/argo_workflows_decorator.py b/metaflow/plugins/argo/argo_workflows_decorator.py index 67c8fd91363..172d5c77ab4 100644 --- a/metaflow/plugins/argo/argo_workflows_decorator.py +++ b/metaflow/plugins/argo/argo_workflows_decorator.py @@ -65,7 +65,7 @@ def task_pre_step( # size of the metadata field yet! However we don't really need this # metadata outside of the start step so we can save a few bytes in the # db. - if step_name == "start": + if step_name == graph.start_step: meta["execution-triggers"] = json.dumps(triggers) meta["argo-workflow-template"] = os.environ["ARGO_WORKFLOW_TEMPLATE"] @@ -152,33 +152,49 @@ def task_finished( # place explicit dependencies on namespaced events. Also, argo events # sensors don't allow for filtering against absent fields - which limits # our ability to subset non-project namespaced events. + # For the end step, we always publish with the well-known ".end" + # suffix (in addition to its actual name) so @trigger_on_finish + # subscribers — which don't know the publisher's end step name at + # deploy time — continue to work with custom-named end steps. # TODO: Check length limits for fields in Argo Events - event = ArgoEvent( - name="metaflow.%s.%s" + event_names = [ + "metaflow.%s.%s" % (current.get("project_flow_name", flow.name), step_name) - ) - # There should only be one event generated even when the task is retried. - # Take care to only add to the list and not modify existing values. - event.add_to_payload("id", current.pathspec) - event.add_to_payload("pathspec", current.pathspec) - event.add_to_payload("flow_name", flow.name) - event.add_to_payload("run_id", self.run_id) - event.add_to_payload("step_name", step_name) - event.add_to_payload("task_id", self.task_id) - # Add @project decorator related fields. These are used to subset - # @trigger_on_finish related filters. - for key in ( - "project_name", - "branch_name", - "is_user_branch", - "is_production", - "project_flow_name", - ): - if current.get(key): - event.add_to_payload(key, current.get(key)) - # Add more fields here... - event.add_to_payload("auto-generated-by-metaflow", True) - # Keep in mind that any errors raised here will fail the run but the task - # will still be marked as success. That's why we explicitly swallow any - # errors and instead print them to std.err. - event.safe_publish(ignore_errors=True) + ] + if step_name == graph.end_step and step_name != "end": + event_names.append( + "metaflow.%s.end" % current.get("project_flow_name", flow.name) + ) + + # Note on idempotency: we publish one ArgoEvent per name in + # event_names (1 for most steps, 2 for custom-named end steps + # due to the ".end" alias). Retries of the same task will + # re-publish the same event(s); the `id` payload (current.pathspec) + # is stable across retries so Argo Events-side filtering can + # dedupe if needed. When adding fields below, only add to the + # payload — don't mutate existing values. + for event_name in event_names: + event = ArgoEvent(name=event_name) + event.add_to_payload("id", current.pathspec) + event.add_to_payload("pathspec", current.pathspec) + event.add_to_payload("flow_name", flow.name) + event.add_to_payload("run_id", self.run_id) + event.add_to_payload("step_name", step_name) + event.add_to_payload("task_id", self.task_id) + # Add @project decorator related fields. These are used to subset + # @trigger_on_finish related filters. + for key in ( + "project_name", + "branch_name", + "is_user_branch", + "is_production", + "project_flow_name", + ): + if current.get(key): + event.add_to_payload(key, current.get(key)) + # Add more fields here... + event.add_to_payload("auto-generated-by-metaflow", True) + # Keep in mind that any errors raised here will fail the run but the task + # will still be marked as success. That's why we explicitly swallow any + # errors and instead print them to std.err. + event.safe_publish(ignore_errors=True) diff --git a/metaflow/plugins/aws/step_functions/step_functions.py b/metaflow/plugins/aws/step_functions/step_functions.py index 3c36a97efe9..b3e191bd987 100644 --- a/metaflow/plugins/aws/step_functions/step_functions.py +++ b/metaflow/plugins/aws/step_functions/step_functions.py @@ -240,7 +240,9 @@ def get_existing_deployment(cls, name): workflow = StepFunctionsClient().get(name) if workflow is not None: try: - start = json.loads(workflow["definition"])["States"]["start"] + definition = json.loads(workflow["definition"]) + start_state_name = definition.get("StartAt", "start") + start = definition["States"][start_state_name] parameters = start["Parameters"]["Parameters"] return parameters.get("metaflow.owner"), parameters.get( "metaflow.production_token" @@ -271,13 +273,22 @@ def get_execution(cls, state_machine_name, name): ) try: state_machine_arn = state_machine.get("stateMachineArn") + definition = json.loads(state_machine.get("definition")) + start_state_name = definition.get("StartAt", "start") + # Explicit guards rather than chained .get() so we produce + # readable errors if the state machine has an unexpected shape + # (e.g., deployed by something other than Metaflow). + states = definition.get("States") or {} + start_state = states.get(start_state_name) + if start_state is None: + raise StepFunctionsException( + "State machine *%s* has no state named *%s* in its " + "States block." % (state_machine_name, start_state_name) + ) environment_vars = ( - json.loads(state_machine.get("definition")) - .get("States") - .get("start") - .get("Parameters") - .get("ContainerOverrides") - .get("Environment") + start_state.get("Parameters", {}) + .get("ContainerOverrides", {}) + .get("Environment", []) ) parameters = { item.get("Name"): item.get("Value") for item in environment_vars @@ -478,10 +489,10 @@ def _visit(node, workflow, exit_node=None): ) return workflow - workflow = Workflow(self.name).start_at("start") + workflow = Workflow(self.name).start_at(self.graph.start_step) if self.workflow_timeout: workflow.timeout_seconds(self.workflow_timeout) - return _visit(self.graph["start"], workflow) + return _visit(self.graph[self.graph.start_step], workflow) def _cron(self): schedule = self.flow._flow_decorators.get("schedule") @@ -597,7 +608,7 @@ def _batch(self, node): # Store production token within the `start` step, so that subsequent # `step-functions create` calls can perform a rudimentary authorization # check. - if node.name == "start": + if node.name == self.graph.start_step: attrs["metaflow.production_token"] = self.production_token # Add env vars from the optional @environment decorator. @@ -610,7 +621,7 @@ def _batch(self, node): if S3_ENDPOINT_URL is not None: env["METAFLOW_S3_ENDPOINT_URL"] = S3_ENDPOINT_URL - if node.name == "start": + if node.name == self.graph.start_step: # metaflow.run_id maps to AWS Step Functions State Machine Execution in all # cases except for when within a for-each construct that relies on # Distributed Map. To work around this issue, we pass the run id from the @@ -956,7 +967,7 @@ def _step_cli(self, node, paths, code_package_url, user_code_retries): "--with=step_functions_internal", ] - if node.name == "start": + if node.name == self.graph.start_step: # We need a separate unique ID for the special _parameters task task_id_params = "%s-params" % task_id # Export user-defined parameters into runtime environment diff --git a/metaflow/plugins/cards/card_cli.py b/metaflow/plugins/cards/card_cli.py index a44c31bfc98..5fed227de30 100644 --- a/metaflow/plugins/cards/card_cli.py +++ b/metaflow/plugins/cards/card_cli.py @@ -649,6 +649,15 @@ def create( full_pathspec = "/".join([flowname, pathspec]) graph_dict, _ = ctx.obj.graph.output_steps() + # Backward-compat: `graph` keeps the old shape (dict of step_name -> info) + # so third-party card modules that expect the pre-annotation format continue + # to work. New cards should use `graph_info` which carries start/end + # metadata needed for flows with custom-named entry/terminal steps. + graph_info = { + "steps": graph_dict, + "start_step": ctx.obj.graph.start_step, + "end_step": ctx.obj.graph.end_step, + } if card_uuid is None: card_uuid = str(uuid.uuid4()).replace("-", "") @@ -698,16 +707,33 @@ def create( # then check for render_error_card and accordingly # store the exception as a string or raise the exception try: + # Probe for `graph_info` support so we can stay backward compatible + # with third-party card modules whose __init__ only accepts `graph`. + import inspect as _inspect + + try: + accepts_graph_info = ( + "graph_info" in _inspect.signature(filtered_card).parameters + ) + except (TypeError, ValueError): + accepts_graph_info = False + + extra_kwargs = {"graph_info": graph_info} if accepts_graph_info else {} + if options is not None: mf_card = filtered_card( options=options, components=component_arr, graph=graph_dict, flow=ctx.obj.flow, + **extra_kwargs, ) else: mf_card = filtered_card( - components=component_arr, graph=graph_dict, flow=ctx.obj.flow + components=component_arr, + graph=graph_dict, + flow=ctx.obj.flow, + **extra_kwargs, ) except TypeError as e: if render_error_card: diff --git a/metaflow/plugins/cards/card_modules/basic.py b/metaflow/plugins/cards/card_modules/basic.py index f578a9e03fc..79e83963300 100644 --- a/metaflow/plugins/cards/card_modules/basic.py +++ b/metaflow/plugins/cards/card_modules/basic.py @@ -12,7 +12,17 @@ CSS_PATH = os.path.join(ABS_DIR_PATH, "bundle.css") -def transform_flow_graph(step_info): +def transform_flow_graph(graph): + # new graph format + if "steps" in graph and "start_step" in graph and "end_step" in graph: + step_info = graph["steps"] + start_step = graph["start_step"] + end_step = graph["end_step"] + else: + step_info = graph + start_step = "start" if "start" in graph else None + end_step = "end" if "end" in graph else None + def node_to_type(node_type): if node_type in ["linear", "start", "end", "join"]: return node_type @@ -47,7 +57,11 @@ def node_to_type(node_type): graph_dict[stepname] = node_info - return graph_dict + return { + "steps": graph_dict, + "start_step": start_step, + "end_step": end_step, + } def read_file(path): @@ -603,9 +617,15 @@ class ErrorCard(MetaflowCard): RELOAD_POLICY = MetaflowCard.RELOAD_POLICY_ONCHANGE - def __init__(self, options={}, components=[], graph=None, **kwargs): + def __init__( + self, options={}, components=[], graph=None, graph_info=None, **kwargs + ): self._only_repr = True - self._graph = None if graph is None else transform_flow_graph(graph) + # Prefer graph_info (carries start_step/end_step metadata) when available + _graph_source = graph_info if graph_info is not None else graph + self._graph = ( + None if _graph_source is None else transform_flow_graph(_graph_source) + ) self._components = components def reload_content_token(self, task, data): @@ -664,11 +684,15 @@ def __init__( options=dict(only_repr=True), components=[], graph=None, + graph_info=None, flow=None, **kwargs ): self._only_repr = True - self._graph = None if graph is None else transform_flow_graph(graph) + _graph_source = graph_info if graph_info is not None else graph + self._graph = ( + None if _graph_source is None else transform_flow_graph(_graph_source) + ) self._flow = flow if "only_repr" in options: self._only_repr = options["only_repr"] @@ -700,13 +724,17 @@ def __init__( options=dict(only_repr=True), components=[], graph=None, + graph_info=None, flow=None, **kwargs ): self._only_repr = True # Default max artifact size uses the global MAX_ARTIFACT_SIZE constant (200MB) self._max_artifact_size = MAX_ARTIFACT_SIZE - self._graph = None if graph is None else transform_flow_graph(graph) + _graph_source = graph_info if graph_info is not None else graph + self._graph = ( + None if _graph_source is None else transform_flow_graph(_graph_source) + ) self._flow = flow if "only_repr" in options: self._only_repr = options["only_repr"] diff --git a/metaflow/plugins/cards/card_modules/main.js b/metaflow/plugins/cards/card_modules/main.js index 8ed210e8229..3c5f9e9453a 100644 --- a/metaflow/plugins/cards/card_modules/main.js +++ b/metaflow/plugins/cards/card_modules/main.js @@ -1,48 +1,48 @@ -(function(X,Ue){typeof exports=="object"&&typeof module<"u"?module.exports=Ue():typeof define=="function"&&define.amd?define(Ue):(X=typeof globalThis<"u"?globalThis:X||self,X["Outerbounds Cards"]=Ue())})(this,function(){"use strict";var uxe=Object.defineProperty;var nB=X=>{throw TypeError(X)};var lxe=(X,Ue,wi)=>Ue in X?uxe(X,Ue,{enumerable:!0,configurable:!0,writable:!0,value:wi}):X[Ue]=wi;var Pt=(X,Ue,wi)=>lxe(X,typeof Ue!="symbol"?Ue+"":Ue,wi),cxe=(X,Ue,wi)=>Ue.has(X)||nB("Cannot "+wi);var iB=(X,Ue,wi)=>Ue.has(X)?nB("Cannot add the same private member more than once"):Ue instanceof WeakSet?Ue.add(X):Ue.set(X,wi);var u2=(X,Ue,wi)=>(cxe(X,Ue,"access private method"),wi);var Zu,m5,rB,eB,tB;function X(){}function Ue(e,t){for(const n in t)e[n]=t[n];return e}function wi(e){return e()}function y5(){return Object.create(null)}function Ku(e){e.forEach(wi)}function b5(e){return typeof e=="function"}function pe(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let Ih;function Ph(e,t){return e===t?!0:(Ih||(Ih=document.createElement("a")),Ih.href=t,e===Ih.href)}function sB(e){return Object.keys(e).length===0}function oB(e,...t){if(e==null){for(const i of t)i(void 0);return X}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function zh(e,t,n){e.$$.on_destroy.push(oB(t,n))}function yt(e,t,n,i){if(e){const r=v5(e,t,n,i);return e[0](r)}}function v5(e,t,n,i){return e[1]&&i?Ue(n.ctx.slice(),e[1](i(t))):n.ctx}function bt(e,t,n,i){return e[2],t.dirty}function vt(e,t,n,i,r,s){if(r){const o=v5(t,n,i,s);e.p(o,r)}}function _t(e){if(e.ctx.length>32){const t=[],n=e.ctx.length/32;for(let i=0;ie.removeEventListener(t,n,i)}function $(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}const uB=["width","height"];function x5(e,t){const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const i in t)t[i]==null?e.removeAttribute(i):i==="style"?e.style.cssText=t[i]:i==="__value"?e.value=e[i]=t[i]:n[i]&&n[i].set&&uB.indexOf(i)===-1?e[i]=t[i]:$(e,i,t[i])}function w5(e,t){for(const n in t)$(e,n,t[n])}function lB(e){return Array.from(e.childNodes)}function Me(e,t){t=""+t,e.data!==t&&(e.data=t)}function ki(e,t,n,i){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,"")}function At(e,t,n){e.classList.toggle(t,!!n)}function cB(e,t,{bubbles:n=!1,cancelable:i=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:i})}class fB{constructor(t=!1){Pt(this,"is_svg",!1);Pt(this,"e");Pt(this,"n");Pt(this,"t");Pt(this,"a");this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,n,i=null){this.e||(this.is_svg?this.e=zi(n.nodeName):this.e=I(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(t)),this.i(i)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(t){for(let n=0;n{const r=e.$$.callbacks[t];if(r){const s=cB(t,n,{cancelable:i});return r.slice().forEach(o=>{o.call(e,s)}),!s.defaultPrevented}return!0}}function k5(e,t){return Wc().$$.context.set(e,t),t}function E5(e){return Wc().$$.context.get(e)}function C5(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(i=>i.call(this,t))}const Ju=[],jn=[];let Qu=[];const d2=[],dB=Promise.resolve();let h2=!1;function hB(){h2||(h2=!0,dB.then(A5))}function p2(e){Qu.push(e)}function g2(e){d2.push(e)}const m2=new Set;let el=0;function A5(){if(el!==0)return;const e=Uc;do{try{for(;ele.indexOf(i)===-1?t.push(i):n.push(i)),n.forEach(i=>i()),Qu=t}const Bh=new Set;let ka;function Ee(){ka={r:0,c:[],p:ka}}function Ce(){ka.r||Ku(ka.c),ka=ka.p}function D(e,t){e&&e.i&&(Bh.delete(e),e.i(t))}function N(e,t,n,i){if(e&&e.o){if(Bh.has(e))return;Bh.add(e),ka.c.push(()=>{Bh.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function Pe(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function Ei(e,t){const n={},i={},r={$$scope:1};let s=e.length;for(;s--;){const o=e[s],a=t[s];if(a){for(const u in o)u in a||(i[u]=1);for(const u in a)r[u]||(n[u]=a[u],r[u]=1);e[s]=a}else for(const u in o)r[u]=1}for(const o in i)o in n||(n[o]=void 0);return n}function lr(e){return typeof e=="object"&&e!==null?e:{}}function y2(e,t,n){const i=e.$$.props[t];i!==void 0&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}function he(e){e&&e.c()}function fe(e,t,n){const{fragment:i,after_update:r}=e.$$;i&&i.m(t,n),p2(()=>{const s=e.$$.on_mount.map(wi).filter(b5);e.$$.on_destroy?e.$$.on_destroy.push(...s):Ku(s),e.$$.on_mount=[]}),r.forEach(p2)}function de(e,t){const n=e.$$;n.fragment!==null&&(gB(n.after_update),Ku(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function mB(e,t){e.$$.dirty[0]===-1&&(Ju.push(e),hB(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const p=h.length?h[0]:d;return l.ctx&&r(l.ctx[f],l.ctx[f]=p)&&(!l.skip_bound&&l.bound[f]&&l.bound[f](p),c&&mB(e,f)),d}):[],l.update(),c=!0,Ku(l.before_update),l.fragment=i?i(l.ctx):!1,t.target){if(t.hydrate){const f=lB(t.target);l.fragment&&l.fragment.l(f),f.forEach(O)}else l.fragment&&l.fragment.c();t.intro&&D(e.$$.fragment),fe(e,t.target,t.anchor),A5()}qc(u)}class _e{constructor(){Pt(this,"$$");Pt(this,"$$set")}$destroy(){de(this,1),this.$destroy=X}$on(t,n){if(!b5(n))return X;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(t){this.$$set&&!sB(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const yB="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(yB);var bB=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{},xe=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,i={},r={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function p(g){return g instanceof s?new s(g.type,p(g.content),g.alias):Array.isArray(g)?g.map(p):g.replace(/&/g,"&").replace(/"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(y){var p=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(y.stack)||[])[1];if(p){var g=document.getElementsByTagName("script");for(var m in g)if(g[m].src==p)return g[m]}return null}},isActive:function(p,g,m){for(var y="no-"+g;p;){var b=p.classList;if(b.contains(g))return!0;if(b.contains(y))return!1;p=p.parentElement}return!!m}},languages:{plain:i,plaintext:i,text:i,txt:i,extend:function(p,g){var m=r.util.clone(r.languages[p]);for(var y in g)m[y]=g[y];return m},insertBefore:function(p,g,m,y){var b=(y=y||r.languages)[p],v={};for(var _ in b)if(b.hasOwnProperty(_)){if(_==g)for(var x in m)m.hasOwnProperty(x)&&(v[x]=m[x]);m.hasOwnProperty(_)||(v[_]=b[_])}var k=y[p];return y[p]=v,r.languages.DFS(r.languages,function(w,E){E===k&&w!=p&&(this[w]=v)}),v},DFS:function p(g,m,y,b){b=b||{};var v=r.util.objId;for(var _ in g)if(g.hasOwnProperty(_)){m.call(g,_,g[_],y||_);var x=g[_],k=r.util.type(x);k!=="Object"||b[v(x)]?k!=="Array"||b[v(x)]||(b[v(x)]=!0,p(x,m,_,b)):(b[v(x)]=!0,p(x,m,null,b))}}},plugins:{},highlightAll:function(p,g){r.highlightAllUnder(document,p,g)},highlightAllUnder:function(p,g,m){var y={callback:m,container:p,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",y),y.elements=Array.prototype.slice.apply(y.container.querySelectorAll(y.selector)),r.hooks.run("before-all-elements-highlight",y);for(var b,v=0;b=y.elements[v++];)r.highlightElement(b,g===!0,y.callback)},highlightElement:function(p,g,m){var y=r.util.getLanguage(p),b=r.languages[y];r.util.setLanguage(p,y);var v=p.parentElement;v&&v.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(v,y);var _={element:p,language:y,grammar:b,code:p.textContent};function x(w){_.highlightedCode=w,r.hooks.run("before-insert",_),_.element.innerHTML=_.highlightedCode,r.hooks.run("after-highlight",_),r.hooks.run("complete",_),m&&m.call(_.element)}if(r.hooks.run("before-sanity-check",_),(v=_.element.parentElement)&&v.nodeName.toLowerCase()==="pre"&&!v.hasAttribute("tabindex")&&v.setAttribute("tabindex","0"),!_.code)return r.hooks.run("complete",_),void(m&&m.call(_.element));if(r.hooks.run("before-highlight",_),_.grammar)if(g&&e.Worker){var k=new Worker(r.filename);k.onmessage=function(w){x(w.data)},k.postMessage(JSON.stringify({language:_.language,code:_.code,immediateClose:!0}))}else x(r.highlight(_.code,_.grammar,_.language));else x(r.util.encode(_.code))},highlight:function(p,g,m){var y={code:p,grammar:g,language:m};if(r.hooks.run("before-tokenize",y),!y.grammar)throw new Error('The language "'+y.language+'" has no grammar.');return y.tokens=r.tokenize(y.code,y.grammar),r.hooks.run("after-tokenize",y),s.stringify(r.util.encode(y.tokens),y.language)},tokenize:function(p,g){var m=g.rest;if(m){for(var y in m)g[y]=m[y];delete g.rest}var b=new u;return l(b,b.head,p),a(p,b,g,b.head,0),function(v){for(var _=[],x=v.head.next;x!==v.tail;)_.push(x.value),x=x.next;return _}(b)},hooks:{all:{},add:function(p,g){var m=r.hooks.all;m[p]=m[p]||[],m[p].push(g)},run:function(p,g){var m=r.hooks.all[p];if(m&&m.length)for(var y,b=0;y=m[b++];)y(g)}},Token:s};function s(p,g,m,y){this.type=p,this.content=g,this.alias=m,this.length=0|(y||"").length}function o(p,g,m,y){p.lastIndex=g;var b=p.exec(m);if(b&&y&&b[1]){var v=b[1].length;b.index+=v,b[0]=b[0].slice(v)}return b}function a(p,g,m,y,b,v){for(var _ in m)if(m.hasOwnProperty(_)&&m[_]){var x=m[_];x=Array.isArray(x)?x:[x];for(var k=0;k=v.reach);A+=T.value.length,T=T.next){var M=T.value;if(g.length>p.length)return;if(!(M instanceof s)){var B,V=1;if(F){if(!(B=o(P,A,p,C))||B.index>=p.length)break;var H=B.index,oe=B.index+B[0].length,ke=A;for(ke+=T.value.length;H>=ke;)ke+=(T=T.next).value.length;if(A=ke-=T.value.length,T.value instanceof s)continue;for(var we=T;we!==g.tail&&(kev.reach&&(v.reach=Wt);var or=T.prev;if(rt&&(or=l(g,or,rt),A+=rt.length),c(g,or,V),T=l(g,or,new s(_,E?r.tokenize(Oe,E):Oe,S,Oe)),Ie&&l(g,T,Ie),V>1){var ar={cause:_+","+k,reach:Wt};a(p,g,m,T.prev,A,ar),v&&ar.reach>v.reach&&(v.reach=ar.reach)}}}}}}function u(){var p={value:null,prev:null,next:null},g={value:null,prev:p,next:null};p.next=g,this.head=p,this.tail=g,this.length=0}function l(p,g,m){var y=g.next,b={value:m,prev:g,next:y};return g.next=b,y.prev=b,p.length++,b}function c(p,g,m){for(var y=g.next,b=0;b"+b.content+""},!e.document)return e.addEventListener&&(r.disableWorkerMessageHandler||e.addEventListener("message",function(p){var g=JSON.parse(p.data),m=g.language,y=g.code,b=g.immediateClose;e.postMessage(r.highlight(y,r.languages[m],m)),b&&e.close()},!1)),r;var f=r.util.currentScript();function d(){r.manual||r.highlightAll()}if(f&&(r.filename=f.src,f.hasAttribute("data-manual")&&(r.manual=!0)),!r.manual){var h=document.readyState;h==="loading"||h==="interactive"&&f&&f.defer?document.addEventListener("DOMContentLoaded",d):window.requestAnimationFrame?window.requestAnimationFrame(d):window.setTimeout(d,16)}return r}(bB);typeof module<"u"&&module.exports&&(module.exports=xe),typeof global<"u"&&(global.Prism=xe),xe.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},xe.languages.markup.tag.inside["attr-value"].inside.entity=xe.languages.markup.entity,xe.languages.markup.doctype.inside["internal-subset"].inside=xe.languages.markup,xe.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(xe.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:xe.languages[t]},n.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:n}};i["language-"+t]={pattern:/[\s\S]+/,inside:xe.languages[t]};var r={};r[e]={pattern:RegExp("(<__[^>]*>)(?:))*\\]\\]>|(?!)".replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:i},xe.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(xe.languages.markup.tag,"addAttribute",{value:function(e,t){xe.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:xe.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),xe.languages.html=xe.languages.markup,xe.languages.mathml=xe.languages.markup,xe.languages.svg=xe.languages.markup,xe.languages.xml=xe.languages.extend("markup",{}),xe.languages.ssml=xe.languages.xml,xe.languages.atom=xe.languages.xml,xe.languages.rss=xe.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+")*?(?:;|(?=\\s*\\{))"),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+`|(?:[^\\\\\r -()"']|\\\\[^])*)\\)`,"i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(xe),xe.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},xe.languages.javascript=xe.languages.extend("clike",{"class-name":[xe.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp("(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])"),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),xe.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,xe.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)/(?:(?:\\[(?:[^\\]\\\\\r +(function(Y,Oe){typeof exports=="object"&&typeof module<"u"?module.exports=Oe():typeof define=="function"&&define.amd?define(Oe):(Y=typeof globalThis<"u"?globalThis:Y||self,Y["Outerbounds Cards"]=Oe())})(this,function(){"use strict";var o_e=Object.defineProperty;var uz=Y=>{throw TypeError(Y)};var a_e=(Y,Oe,Pt)=>Oe in Y?o_e(Y,Oe,{enumerable:!0,configurable:!0,writable:!0,value:Pt}):Y[Oe]=Pt;var U=(Y,Oe,Pt)=>a_e(Y,typeof Oe!="symbol"?Oe+"":Oe,Pt),R5=(Y,Oe,Pt)=>Oe.has(Y)||uz("Cannot "+Pt);var cz=(Y,Oe,Pt)=>(R5(Y,Oe,"read from private field"),Pt?Pt.call(Y):Oe.get(Y)),O5=(Y,Oe,Pt)=>Oe.has(Y)?uz("Cannot add the same private member more than once"):Oe instanceof WeakSet?Oe.add(Y):Oe.set(Y,Pt),L5=(Y,Oe,Pt,$c)=>(R5(Y,Oe,"write to private field"),$c?$c.call(Y,Pt):Oe.set(Y,Pt),Pt),Mm=(Y,Oe,Pt)=>(R5(Y,Oe,"access private method"),Pt);var Dl,I5,fz,Ec,oz,az;function Y(){}function Oe(e,t){for(const n in t)e[n]=t[n];return e}function Pt(e){return e()}function $c(){return Object.create(null)}function Nl(e){e.forEach(Pt)}function P5(e){return typeof e=="function"}function pe(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let hh;function ph(e,t){return e===t?!0:(hh||(hh=document.createElement("a")),hh.href=t,e===hh.href)}function dz(e){return Object.keys(e).length===0}function hz(e,...t){if(e==null){for(const i of t)i(void 0);return Y}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function gh(e,t,n){e.$$.on_destroy.push(hz(t,n))}function ht(e,t,n,i){if(e){const r=z5(e,t,n,i);return e[0](r)}}function z5(e,t,n,i){return e[1]&&i?Oe(n.ctx.slice(),e[1](i(t))):n.ctx}function pt(e,t,n,i){return e[2],t.dirty}function gt(e,t,n,i,r,s){if(r){const o=z5(t,n,i,s);e.p(o,r)}}function mt(e){if(e.ctx.length>32){const t=[],n=e.ctx.length/32;for(let i=0;ie.removeEventListener(t,n,i)}function C(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}const gz=["width","height"];function j5(e,t){const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const i in t)t[i]==null?e.removeAttribute(i):i==="style"?e.style.cssText=t[i]:i==="__value"?e.value=e[i]=t[i]:n[i]&&n[i].set&&gz.indexOf(i)===-1?e[i]=t[i]:C(e,i,t[i])}function U5(e,t){for(const n in t)C(e,n,t[n])}function mz(e){return Array.from(e.childNodes)}function Me(e,t){t=""+t,e.data!==t&&(e.data=t)}function fi(e,t,n,i){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,"")}function wt(e,t,n){e.classList.toggle(t,!!n)}function yz(e,t,{bubbles:n=!1,cancelable:i=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:i})}class bz{constructor(t=!1){U(this,"is_svg",!1);U(this,"e");U(this,"n");U(this,"t");U(this,"a");this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,n,i=null){this.e||(this.is_svg?this.e=Ai(n.nodeName):this.e=I(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(t)),this.i(i)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(t){for(let n=0;n{const r=e.$$.callbacks[t];if(r){const s=yz(t,n,{cancelable:i});return r.slice().forEach(o=>{o.call(e,s)}),!s.defaultPrevented}return!0}}function q5(e,t){return Ac().$$.context.set(e,t),t}function W5(e){return Ac().$$.context.get(e)}function H5(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(i=>i.call(this,t))}const Rl=[],Nn=[];let Ol=[];const Om=[],vz=Promise.resolve();let Lm=!1;function _z(){Lm||(Lm=!0,vz.then(G5))}function Im(e){Ol.push(e)}function Pm(e){Om.push(e)}const zm=new Set;let Ll=0;function G5(){if(Ll!==0)return;const e=Sc;do{try{for(;Lle.indexOf(i)===-1?t.push(i):n.push(i)),n.forEach(i=>i()),Ol=t}const mh=new Set;let la;function ke(){la={r:0,c:[],p:la}}function Ee(){la.r||Nl(la.c),la=la.p}function T(e,t){e&&e.i&&(mh.delete(e),e.i(t))}function N(e,t,n,i){if(e&&e.o){if(mh.has(e))return;mh.add(e),la.c.push(()=>{mh.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}function Pe(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function di(e,t){const n={},i={},r={$$scope:1};let s=e.length;for(;s--;){const o=e[s],a=t[s];if(a){for(const l in o)l in a||(i[l]=1);for(const l in a)r[l]||(n[l]=a[l],r[l]=1);e[s]=a}else for(const l in o)r[l]=1}for(const o in i)o in n||(n[o]=void 0);return n}function Ji(e){return typeof e=="object"&&e!==null?e:{}}function Bm(e,t,n){const i=e.$$.props[t];i!==void 0&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}function he(e){e&&e.c()}function fe(e,t,n){const{fragment:i,after_update:r}=e.$$;i&&i.m(t,n),Im(()=>{const s=e.$$.on_mount.map(Pt).filter(P5);e.$$.on_destroy?e.$$.on_destroy.push(...s):Nl(s),e.$$.on_mount=[]}),r.forEach(Im)}function de(e,t){const n=e.$$;n.fragment!==null&&(wz(n.after_update),Nl(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function kz(e,t){e.$$.dirty[0]===-1&&(Rl.push(e),_z(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const p=h.length?h[0]:d;return u.ctx&&r(u.ctx[f],u.ctx[f]=p)&&(!u.skip_bound&&u.bound[f]&&u.bound[f](p),c&&kz(e,f)),d}):[],u.update(),c=!0,Nl(u.before_update),u.fragment=i?i(u.ctx):!1,t.target){if(t.hydrate){const f=mz(t.target);u.fragment&&u.fragment.l(f),f.forEach(O)}else u.fragment&&u.fragment.c();t.intro&&T(e.$$.fragment),fe(e,t.target,t.anchor),G5()}Cc(l)}class ve{constructor(){U(this,"$$");U(this,"$$set")}$destroy(){de(this,1),this.$destroy=Y}$on(t,n){if(!P5(n))return Y;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const r=i.indexOf(n);r!==-1&&i.splice(r,1)}}$set(t){this.$$set&&!dz(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Ez="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Ez);var $z=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{},_e=function(e){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,i={},r={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function p(g){return g instanceof s?new s(g.type,p(g.content),g.alias):Array.isArray(g)?g.map(p):g.replace(/&/g,"&").replace(/"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(y){var p=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(y.stack)||[])[1];if(p){var g=document.getElementsByTagName("script");for(var m in g)if(g[m].src==p)return g[m]}return null}},isActive:function(p,g,m){for(var y="no-"+g;p;){var b=p.classList;if(b.contains(g))return!0;if(b.contains(y))return!1;p=p.parentElement}return!!m}},languages:{plain:i,plaintext:i,text:i,txt:i,extend:function(p,g){var m=r.util.clone(r.languages[p]);for(var y in g)m[y]=g[y];return m},insertBefore:function(p,g,m,y){var b=(y=y||r.languages)[p],v={};for(var _ in b)if(b.hasOwnProperty(_)){if(_==g)for(var x in m)m.hasOwnProperty(x)&&(v[x]=m[x]);m.hasOwnProperty(_)||(v[_]=b[_])}var k=y[p];return y[p]=v,r.languages.DFS(r.languages,function(w,E){E===k&&w!=p&&(this[w]=v)}),v},DFS:function p(g,m,y,b){b=b||{};var v=r.util.objId;for(var _ in g)if(g.hasOwnProperty(_)){m.call(g,_,g[_],y||_);var x=g[_],k=r.util.type(x);k!=="Object"||b[v(x)]?k!=="Array"||b[v(x)]||(b[v(x)]=!0,p(x,m,_,b)):(b[v(x)]=!0,p(x,m,null,b))}}},plugins:{},highlightAll:function(p,g){r.highlightAllUnder(document,p,g)},highlightAllUnder:function(p,g,m){var y={callback:m,container:p,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",y),y.elements=Array.prototype.slice.apply(y.container.querySelectorAll(y.selector)),r.hooks.run("before-all-elements-highlight",y);for(var b,v=0;b=y.elements[v++];)r.highlightElement(b,g===!0,y.callback)},highlightElement:function(p,g,m){var y=r.util.getLanguage(p),b=r.languages[y];r.util.setLanguage(p,y);var v=p.parentElement;v&&v.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(v,y);var _={element:p,language:y,grammar:b,code:p.textContent};function x(w){_.highlightedCode=w,r.hooks.run("before-insert",_),_.element.innerHTML=_.highlightedCode,r.hooks.run("after-highlight",_),r.hooks.run("complete",_),m&&m.call(_.element)}if(r.hooks.run("before-sanity-check",_),(v=_.element.parentElement)&&v.nodeName.toLowerCase()==="pre"&&!v.hasAttribute("tabindex")&&v.setAttribute("tabindex","0"),!_.code)return r.hooks.run("complete",_),void(m&&m.call(_.element));if(r.hooks.run("before-highlight",_),_.grammar)if(g&&e.Worker){var k=new Worker(r.filename);k.onmessage=function(w){x(w.data)},k.postMessage(JSON.stringify({language:_.language,code:_.code,immediateClose:!0}))}else x(r.highlight(_.code,_.grammar,_.language));else x(r.util.encode(_.code))},highlight:function(p,g,m){var y={code:p,grammar:g,language:m};if(r.hooks.run("before-tokenize",y),!y.grammar)throw new Error('The language "'+y.language+'" has no grammar.');return y.tokens=r.tokenize(y.code,y.grammar),r.hooks.run("after-tokenize",y),s.stringify(r.util.encode(y.tokens),y.language)},tokenize:function(p,g){var m=g.rest;if(m){for(var y in m)g[y]=m[y];delete g.rest}var b=new l;return u(b,b.head,p),a(p,b,g,b.head,0),function(v){for(var _=[],x=v.head.next;x!==v.tail;)_.push(x.value),x=x.next;return _}(b)},hooks:{all:{},add:function(p,g){var m=r.hooks.all;m[p]=m[p]||[],m[p].push(g)},run:function(p,g){var m=r.hooks.all[p];if(m&&m.length)for(var y,b=0;y=m[b++];)y(g)}},Token:s};function s(p,g,m,y){this.type=p,this.content=g,this.alias=m,this.length=0|(y||"").length}function o(p,g,m,y){p.lastIndex=g;var b=p.exec(m);if(b&&y&&b[1]){var v=b[1].length;b.index+=v,b[0]=b[0].slice(v)}return b}function a(p,g,m,y,b,v){for(var _ in m)if(m.hasOwnProperty(_)&&m[_]){var x=m[_];x=Array.isArray(x)?x:[x];for(var k=0;k=v.reach);S+=M.value.length,M=M.next){var D=M.value;if(g.length>p.length)return;if(!(D instanceof s)){var B,V=1;if(F){if(!(B=o(P,S,p,$))||B.index>=p.length)break;var H=B.index,oe=B.index+B[0].length,we=S;for(we+=M.value.length;H>=we;)we+=(M=M.next).value.length;if(S=we-=M.value.length,M.value instanceof s)continue;for(var xe=M;xe!==g.tail&&(wev.reach&&(v.reach=jt);var Xi=M.prev;if(nt&&(Xi=u(g,Xi,nt),S+=nt.length),c(g,Xi,V),M=u(g,Xi,new s(_,E?r.tokenize(Re,E):Re,A,Re)),Ie&&u(g,M,Ie),V>1){var Zi={cause:_+","+k,reach:jt};a(p,g,m,M.prev,S,Zi),v&&Zi.reach>v.reach&&(v.reach=Zi.reach)}}}}}}function l(){var p={value:null,prev:null,next:null},g={value:null,prev:p,next:null};p.next=g,this.head=p,this.tail=g,this.length=0}function u(p,g,m){var y=g.next,b={value:m,prev:g,next:y};return g.next=b,y.prev=b,p.length++,b}function c(p,g,m){for(var y=g.next,b=0;b"+b.content+""},!e.document)return e.addEventListener&&(r.disableWorkerMessageHandler||e.addEventListener("message",function(p){var g=JSON.parse(p.data),m=g.language,y=g.code,b=g.immediateClose;e.postMessage(r.highlight(y,r.languages[m],m)),b&&e.close()},!1)),r;var f=r.util.currentScript();function d(){r.manual||r.highlightAll()}if(f&&(r.filename=f.src,f.hasAttribute("data-manual")&&(r.manual=!0)),!r.manual){var h=document.readyState;h==="loading"||h==="interactive"&&f&&f.defer?document.addEventListener("DOMContentLoaded",d):window.requestAnimationFrame?window.requestAnimationFrame(d):window.setTimeout(d,16)}return r}($z);typeof module<"u"&&module.exports&&(module.exports=_e),typeof global<"u"&&(global.Prism=_e),_e.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},_e.languages.markup.tag.inside["attr-value"].inside.entity=_e.languages.markup.entity,_e.languages.markup.doctype.inside["internal-subset"].inside=_e.languages.markup,_e.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(_e.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:_e.languages[t]},n.cdata=/^$/i;var i={"included-cdata":{pattern://i,inside:n}};i["language-"+t]={pattern:/[\s\S]+/,inside:_e.languages[t]};var r={};r[e]={pattern:RegExp("(<__[^>]*>)(?:))*\\]\\]>|(?!)".replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:i},_e.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(_e.languages.markup.tag,"addAttribute",{value:function(e,t){_e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:_e.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),_e.languages.html=_e.languages.markup,_e.languages.mathml=_e.languages.markup,_e.languages.svg=_e.languages.markup,_e.languages.xml=_e.languages.extend("markup",{}),_e.languages.ssml=_e.languages.xml,_e.languages.atom=_e.languages.xml,_e.languages.rss=_e.languages.xml,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+")*?(?:;|(?=\\s*\\{))"),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+`|(?:[^\\\\\r +()"']|\\\\[^])*)\\)`,"i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(_e),_e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},_e.languages.javascript=_e.languages.extend("clike",{"class-name":[_e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp("(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])"),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),_e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,_e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)/(?:(?:\\[(?:[^\\]\\\\\r ]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\r ])+/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\r ]|\\\\.|\\[(?:[^[\\]\\\\\r ]|\\\\.|\\[(?:[^[\\]\\\\\r ]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\r ])+/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|/\\*(?:[^*]|\\*(?!/))*\\*/)*(?:$|[\r -,.;:})\\]]|//))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:xe.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:xe.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:xe.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:xe.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:xe.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),xe.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:xe.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),xe.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),xe.languages.markup&&(xe.languages.markup.tag.addInlined("script","javascript"),xe.languages.markup.tag.addAttribute("on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)","javascript")),xe.languages.js=xe.languages.javascript,xe.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},xe.languages.webmanifest=xe.languages.json,xe.languages.log={string:{pattern:/"(?:[^"\\\r\n]|\\.)*"|'(?![st] | \w)(?:[^'\\\r\n]|\\.)*'/,greedy:!0},exception:{pattern:/(^|[^\w.])[a-z][\w.]*(?:Error|Exception):.*(?:(?:\r\n?|\n)[ \t]*(?:at[ \t].+|\.{3}.*|Caused by:.*))+(?:(?:\r\n?|\n)[ \t]*\.\.\. .*)?/,lookbehind:!0,greedy:!0,alias:["javastacktrace","language-javastacktrace"],inside:xe.languages.javastacktrace||{keyword:/\bat\b/,function:/[a-z_][\w$]*(?=\()/,punctuation:/[.:()]/}},level:[{pattern:/\b(?:ALERT|CRIT|CRITICAL|EMERG|EMERGENCY|ERR|ERROR|FAILURE|FATAL|SEVERE)\b/,alias:["error","important"]},{pattern:/\b(?:WARN|WARNING|WRN)\b/,alias:["warning","important"]},{pattern:/\b(?:DISPLAY|INF|INFO|NOTICE|STATUS)\b/,alias:["info","keyword"]},{pattern:/\b(?:DBG|DEBUG|FINE)\b/,alias:["debug","keyword"]},{pattern:/\b(?:FINER|FINEST|TRACE|TRC|VERBOSE|VRB)\b/,alias:["trace","comment"]}],property:{pattern:/((?:^|[\]|])[ \t]*)[a-z_](?:[\w-]|\b\/\b)*(?:[. ]\(?\w(?:[\w-]|\b\/\b)*\)?)*:(?=\s)/im,lookbehind:!0},separator:{pattern:/(^|[^-+])-{3,}|={3,}|\*{3,}|- - /m,lookbehind:!0,alias:"comment"},url:/\b(?:file|ftp|https?):\/\/[^\s|,;'"]*[^\s|,;'">.]/,email:{pattern:/(^|\s)[-\w+.]+@[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+(?=\s)/,lookbehind:!0,alias:"url"},"ip-address":{pattern:/\b(?:\d{1,3}(?:\.\d{1,3}){3})\b/,alias:"constant"},"mac-address":{pattern:/\b[a-f0-9]{2}(?::[a-f0-9]{2}){5}\b/i,alias:"constant"},domain:{pattern:/(^|\s)[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*\.[a-z][a-z0-9-]+(?=\s)/,lookbehind:!0,alias:"constant"},uuid:{pattern:/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i,alias:"constant"},hash:{pattern:/\b(?:[a-f0-9]{32}){1,2}\b/i,alias:"constant"},"file-path":{pattern:/\b[a-z]:[\\/][^\s|,;:(){}\[\]"']+|(^|[\s:\[\](>|])\.{0,2}\/\w[^\s|,;:(){}\[\]"']*/i,lookbehind:!0,greedy:!0,alias:"string"},date:{pattern:RegExp("\\b\\d{4}[-/]\\d{2}[-/]\\d{2}(?:T(?=\\d{1,2}:)|(?=\\s\\d{1,2}:))|\\b\\d{1,4}[-/ ](?:\\d{1,2}|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)[-/ ]\\d{2,4}T?\\b|\\b(?:(?:Fri|Mon|Sat|Sun|Thu|Tue|Wed)(?:\\s{1,2}(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep))?|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)\\s{1,2}\\d{1,2}\\b","i"),alias:"number"},time:{pattern:/\b\d{1,2}:\d{1,2}:\d{1,2}(?:[.,:]\d+)?(?:\s?[+-]\d{2}:?\d{2}|Z)?\b/,alias:"number"},boolean:/\b(?:false|null|true)\b/i,number:{pattern:/(^|[^.\w])(?:0x[a-f0-9]+|0o[0-7]+|0b[01]+|v?\d[\da-f]*(?:\.\d+)*(?:e[+-]?\d+)?[a-z]{0,3}\b)\b(?!\.\w)/i,lookbehind:!0},operator:/[;:?<=>~/@!$%&+\-|^(){}*#]/,punctuation:/[\[\].,]/},xe.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},xe.languages.python["string-interpolation"].inside.interpolation.inside.rest=xe.languages.python,xe.languages.py=xe.languages.python,function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,i="(?:"+n.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+n.source+")?)",r="(?:[^\\s\\x00-\\x08\\x0e-\\x1f!\"#%&'*,\\-:>?@[\\]`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-])(?:[ ]*(?:(?![#:])|:))*".replace(//g,function(){return"[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]"}),s=`"(?:[^"\\\\\r +,.;:})\\]]|//))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:_e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:_e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:_e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:_e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:_e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),_e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:_e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),_e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),_e.languages.markup&&(_e.languages.markup.tag.addInlined("script","javascript"),_e.languages.markup.tag.addAttribute("on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)","javascript")),_e.languages.js=_e.languages.javascript,_e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},_e.languages.webmanifest=_e.languages.json,_e.languages.log={string:{pattern:/"(?:[^"\\\r\n]|\\.)*"|'(?![st] | \w)(?:[^'\\\r\n]|\\.)*'/,greedy:!0},exception:{pattern:/(^|[^\w.])[a-z][\w.]*(?:Error|Exception):.*(?:(?:\r\n?|\n)[ \t]*(?:at[ \t].+|\.{3}.*|Caused by:.*))+(?:(?:\r\n?|\n)[ \t]*\.\.\. .*)?/,lookbehind:!0,greedy:!0,alias:["javastacktrace","language-javastacktrace"],inside:_e.languages.javastacktrace||{keyword:/\bat\b/,function:/[a-z_][\w$]*(?=\()/,punctuation:/[.:()]/}},level:[{pattern:/\b(?:ALERT|CRIT|CRITICAL|EMERG|EMERGENCY|ERR|ERROR|FAILURE|FATAL|SEVERE)\b/,alias:["error","important"]},{pattern:/\b(?:WARN|WARNING|WRN)\b/,alias:["warning","important"]},{pattern:/\b(?:DISPLAY|INF|INFO|NOTICE|STATUS)\b/,alias:["info","keyword"]},{pattern:/\b(?:DBG|DEBUG|FINE)\b/,alias:["debug","keyword"]},{pattern:/\b(?:FINER|FINEST|TRACE|TRC|VERBOSE|VRB)\b/,alias:["trace","comment"]}],property:{pattern:/((?:^|[\]|])[ \t]*)[a-z_](?:[\w-]|\b\/\b)*(?:[. ]\(?\w(?:[\w-]|\b\/\b)*\)?)*:(?=\s)/im,lookbehind:!0},separator:{pattern:/(^|[^-+])-{3,}|={3,}|\*{3,}|- - /m,lookbehind:!0,alias:"comment"},url:/\b(?:file|ftp|https?):\/\/[^\s|,;'"]*[^\s|,;'">.]/,email:{pattern:/(^|\s)[-\w+.]+@[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+(?=\s)/,lookbehind:!0,alias:"url"},"ip-address":{pattern:/\b(?:\d{1,3}(?:\.\d{1,3}){3})\b/,alias:"constant"},"mac-address":{pattern:/\b[a-f0-9]{2}(?::[a-f0-9]{2}){5}\b/i,alias:"constant"},domain:{pattern:/(^|\s)[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*\.[a-z][a-z0-9-]+(?=\s)/,lookbehind:!0,alias:"constant"},uuid:{pattern:/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i,alias:"constant"},hash:{pattern:/\b(?:[a-f0-9]{32}){1,2}\b/i,alias:"constant"},"file-path":{pattern:/\b[a-z]:[\\/][^\s|,;:(){}\[\]"']+|(^|[\s:\[\](>|])\.{0,2}\/\w[^\s|,;:(){}\[\]"']*/i,lookbehind:!0,greedy:!0,alias:"string"},date:{pattern:RegExp("\\b\\d{4}[-/]\\d{2}[-/]\\d{2}(?:T(?=\\d{1,2}:)|(?=\\s\\d{1,2}:))|\\b\\d{1,4}[-/ ](?:\\d{1,2}|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)[-/ ]\\d{2,4}T?\\b|\\b(?:(?:Fri|Mon|Sat|Sun|Thu|Tue|Wed)(?:\\s{1,2}(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep))?|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)\\s{1,2}\\d{1,2}\\b","i"),alias:"number"},time:{pattern:/\b\d{1,2}:\d{1,2}:\d{1,2}(?:[.,:]\d+)?(?:\s?[+-]\d{2}:?\d{2}|Z)?\b/,alias:"number"},boolean:/\b(?:false|null|true)\b/i,number:{pattern:/(^|[^.\w])(?:0x[a-f0-9]+|0o[0-7]+|0b[01]+|v?\d[\da-f]*(?:\.\d+)*(?:e[+-]?\d+)?[a-z]{0,3}\b)\b(?!\.\w)/i,lookbehind:!0},operator:/[;:?<=>~/@!$%&+\-|^(){}*#]/,punctuation:/[\[\].,]/},_e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},_e.languages.python["string-interpolation"].inside.interpolation.inside.rest=_e.languages.python,_e.languages.py=_e.languages.python,function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,i="(?:"+n.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+n.source+")?)",r="(?:[^\\s\\x00-\\x08\\x0e-\\x1f!\"#%&'*,\\-:>?@[\\]`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-])(?:[ ]*(?:(?![#:])|:))*".replace(//g,function(){return"[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]"}),s=`"(?:[^"\\\\\r ]|\\\\.)*"|'(?:[^'\\\\\r -]|\\\\.)*'`;function o(a,u){u=(u||"").replace(/m/g,"")+"m";var l=`([:\\-,[{]\\s*(?:\\s<>[ ]+)?)(?:<>)(?=[ ]*(?:$|,|\\]|\\}|(?:[\r -]\\s*)?#))`.replace(/<>/g,function(){return i}).replace(/<>/g,function(){return a});return RegExp(l,u)}e.languages.yaml={scalar:{pattern:RegExp(`([\\-:]\\s*(?:\\s<>[ ]+)?[|>])[ ]*(?:((?:\r? +]|\\\\.)*'`;function o(a,l){l=(l||"").replace(/m/g,"")+"m";var u=`([:\\-,[{]\\s*(?:\\s<>[ ]+)?)(?:<>)(?=[ ]*(?:$|,|\\]|\\}|(?:[\r +]\\s*)?#))`.replace(/<>/g,function(){return i}).replace(/<>/g,function(){return a});return RegExp(u,l)}e.languages.yaml={scalar:{pattern:RegExp(`([\\-:]\\s*(?:\\s<>[ ]+)?[|>])[ ]*(?:((?:\r? |\r)[ ]+)\\S[^\r ]*(?:\\2[^\r ]+)*)`.replace(/<>/g,function(){return i})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(`((?:^|[:\\-,[{\r -?])[ ]*(?:<>[ ]+)?)<>(?=\\s*:\\s)`.replace(/<>/g,function(){return i}).replace(/<>/g,function(){return"(?:"+r+"|"+s+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o("\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ ]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ ]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?"),lookbehind:!0,alias:"number"},boolean:{pattern:o("false|true","i"),lookbehind:!0,alias:"important"},null:{pattern:o("null|~","i"),lookbehind:!0,alias:"important"},string:{pattern:o(s),lookbehind:!0,greedy:!0},number:{pattern:o("[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)","i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(xe);const tl=[];function $5(e,t=X){let n;const i=new Set;function r(a){if(pe(e,a)&&(e=a,n)){const u=!tl.length;for(const l of i)l[1](),tl.push(l,e);if(u){for(let l=0;l{i.delete(l),i.size===0&&n&&(n(),n=null)}}return{set:r,update:s,subscribe:o}}const Ea=$5(void 0);window.metaflow_card_update=e=>(Ea==null||Ea.update(t=>{const n={...t};return Object.values(e).forEach(i=>(n==null?void 0:n.components)&&S5(n.components,i)),n}),!0);const vB=(e,t)=>{e.data&&(e.data=JSON.parse(JSON.stringify(t.data))),JSON.stringify(t.spec)===JSON.stringify(e.spec)||(e.spec=JSON.parse(JSON.stringify(t.spec)))},S5=(e,t)=>{const n=e.findIndex(i=>t.id===(i==null?void 0:i.id));n>-1?e[n].type=="vegaChart"?vB(e[n],t):Object.assign(e[n],t):e.forEach(i=>{var r;(i.type==="section"||i.type==="page")&&((r=i==null?void 0:i.contents)!=null&&r.length)&&S5(i.contents,t)})},_B=e=>{try{const t=JSON.parse(atob(window.__MF_DATA__[e]));Ea.set(t)}catch{fetch("/card-example.json").then(n=>n.json()).then(n=>{Ea.set(n)}).catch(console.error)}},Hc=$5(void 0),F5=e=>{const t={};if(!e)return t;function n(i,r=[]){var s;if(i.type==="page"){const o=[];t[i.title]=o,(s=i==null?void 0:i.contents)==null||s.forEach(a=>n(a,o))}i.type==="section"&&i.title&&r.push(i.title)}return e==null||e.forEach(i=>n(i)),t},bo=(e,t)=>e/16,xB=e=>{const t=e.split("/");return{flowname:t[0],runid:t[1],stepname:t==null?void 0:t[2],taskid:t==null?void 0:t[3]}},wB=(e,t)=>{var n;if(!(!e||!t))return(n=xB(e))==null?void 0:n[t]},kB=e=>e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth;function EB(e){let t,n,i,r,s,o,a,u;return{c(){t=zi("svg"),n=zi("title"),i=ce("metaflow_logo_horizontal"),r=zi("g"),s=zi("g"),o=zi("g"),a=zi("path"),u=zi("path"),$(a,"d","M223.990273,66.33 C223.515273,61.851 222.686273,57.512 221.505273,53.33 C220.325273,49.148 218.795273,45.122 216.916273,41.271 C212.845273,32.921 207.254273,25.587 200.268273,19.422 C199.270273,18.541 198.243273,17.684 197.189273,16.851 C191.255273,12.166 184.481273,8.355 177.253273,5.55 C174.156273,4.347 170.975273,3.33 167.741273,2.508 C161.273273,0.863 154.593273,0 147.943273,0 C141.755273,0 135.332273,0.576 128.687273,1.722 C127.025273,2.01 125.350273,2.332 123.661273,2.69 C120.283273,3.406 116.851273,4.265 113.365273,5.267 C104.650273,7.769 95.6022727,11.161 86.2442727,15.433 C78.7592727,18.851 71.0762727,22.832 63.2072727,27.373 C47.9762727,36.162 35.7372727,44.969 29.3592727,49.791 C29.0692727,50.01 28.7922727,50.221 28.5262727,50.423 C26.1382727,52.244 24.7522727,53.367 24.5662727,53.519 L0.549272727,73.065 C0.191272727,73.356 0.00727272727,73.773 0,74.194 C-0.00372727273,74.403 0.0362727273,74.614 0.120272727,74.811 C0.205272727,75.008 0.334272727,75.189 0.508272727,75.341 L11.7612727,85.195 C12.1692727,85.552 12.7252727,85.651 13.2162727,85.487 C13.3792727,85.432 13.5362727,85.348 13.6762727,85.234 L35.8492727,67.382 C36.0422727,67.224 37.6152727,65.949 40.3252727,63.903 C44.1192727,61.036 50.1422727,56.656 57.7292727,51.711 C62.0642727,48.884 66.9102727,45.873 72.1412727,42.854 C100.864273,26.278 126.367273,17.874 147.943273,17.874 C148.366273,17.874 148.790273,17.892 149.213273,17.902 C149.655273,17.911 150.096273,17.911 150.538273,17.93 C153.769273,18.068 156.995273,18.463 160.170273,19.097 C164.931273,20.049 169.577273,21.542 173.953273,23.524 C178.328273,25.505 182.433273,27.975 186.112273,30.88 C186.771273,31.4 187.406273,31.94 188.035273,32.485 C188.913273,33.245 189.771273,34.023 190.591273,34.83 C191.998273,36.217 193.317273,37.673 194.548273,39.195 C196.395273,41.479 198.042273,43.912 199.480273,46.485 C199.960273,47.342 200.417273,48.216 200.850273,49.105 C201.112273,49.642 201.343273,50.196 201.587273,50.743 C202.231273,52.185 202.834273,53.649 203.354273,55.158 C203.712273,56.198 204.041273,57.255 204.340273,58.326 C205.836273,63.683 206.590273,69.417 206.590273,75.469 C206.590273,81.221 205.892273,86.677 204.541273,91.804 C203.617273,95.308 202.397273,98.662 200.850273,101.833 C200.417273,102.722 199.960273,103.595 199.480273,104.453 C197.562273,107.884 195.275273,111.066 192.636273,113.976 C190.657273,116.159 188.480273,118.189 186.113273,120.058 C184.553273,121.29 182.909273,122.432 181.208273,123.503 C180.313273,124.067 179.400273,124.609 178.470273,125.126 C177.462273,125.688 176.442273,126.232 175.398273,126.737 C166.961273,130.823 157.423273,133.064 147.943273,133.064 C126.367273,133.064 100.864273,124.659 72.1412727,108.084 C70.5382727,107.159 68.4382727,105.886 66.3072727,104.575 C65.0292727,103.788 63.7402727,102.986 62.5412727,102.237 C59.3442727,100.238 56.7882727,98.61 56.7882727,98.61 C61.8362727,93.901 69.3232727,87.465 78.6472727,81.047 C80.0092727,80.11 81.4192727,79.174 82.8572727,78.243 C84.1052727,77.436 85.3712727,76.63 86.6732727,75.835 C88.2042727,74.9 89.7802727,73.981 91.3822727,73.074 C93.0482727,72.131 94.7512727,71.207 96.4902727,70.307 C111.473273,62.55 129.094273,56.602 147.943273,56.602 C151.750273,56.602 157.745273,57.825 162.114273,61.276 C162.300273,61.422 162.489273,61.578 162.677273,61.74 C163.337273,62.305 164.006273,62.966 164.634273,63.78 C164.957273,64.198 165.269273,64.657 165.564273,65.162 C166.006273,65.92 166.409273,66.782 166.750273,67.775 C166.891273,68.185 167.016273,68.627 167.134273,69.083 C167.586273,70.833 167.863273,72.924 167.863273,75.469 C167.863273,78.552 167.460273,80.974 166.824273,82.92 C166.578273,83.674 166.300273,84.363 165.992273,84.983 C165.855273,85.259 165.711273,85.524 165.564273,85.776 C165.376273,86.099 165.178273,86.396 164.977273,86.682 C164.631273,87.175 164.269273,87.618 163.900273,88.018 C163.730273,88.202 163.559273,88.379 163.387273,88.546 C162.962273,88.96 162.534273,89.331 162.114273,89.662 C157.745273,93.112 151.750273,94.337 147.943273,94.337 C144.485273,94.337 140.682273,93.926 136.589273,93.121 C133.860273,92.584 131.003273,91.871 128.033273,90.987 C123.579273,89.662 118.873273,87.952 113.970273,85.872 C113.768273,85.786 113.552273,85.747 113.336273,85.753 C113.122273,85.76 112.908273,85.813 112.713273,85.912 C106.990273,88.816 101.641273,91.995 96.7462727,95.223 C96.6232727,95.304 96.5182727,95.397 96.4302727,95.5 C95.8122727,96.22 96.0172727,97.397 96.9492727,97.822 L102.445273,100.328 C104.606273,101.314 106.737273,102.238 108.835273,103.102 C110.934273,103.966 113.001273,104.77 115.035273,105.511 C118.086273,106.624 121.064273,107.599 123.965273,108.436 C127.834273,109.551 131.567273,110.421 135.157273,111.043 C139.646273,111.82 143.912273,112.211 147.943273,112.211 C148.367273,112.211 148.923273,112.201 149.591273,112.169 C149.925273,112.153 150.287273,112.131 150.674273,112.102 C155.712273,111.724 165.055273,110.114 173.190273,103.691 C173.547273,103.41 173.869273,103.105 174.210273,102.813 C175.324273,101.86 176.381273,100.866 177.333273,99.8 C177.470273,99.648 177.590273,99.485 177.724273,99.331 C181.300273,95.167 183.699273,90.185 184.875273,84.406 C185.444273,81.609 185.737273,78.631 185.737273,75.469 C185.737273,63.315 181.516273,53.82 173.190273,47.247 C167.050273,42.399 160.228273,40.299 155.083273,39.395 C153.892273,39.186 152.790273,39.037 151.809273,38.938 C150.116273,38.766 148.774273,38.727 147.943273,38.727 C133.456273,38.727 118.519273,41.679 103.545273,47.5 C99.1222727,49.22 94.6912727,51.191 90.2702727,53.403 C88.7972727,54.141 87.3242727,54.905 85.8542727,55.696 C83.5092727,56.957 81.1722727,58.303 78.8382727,59.697 C77.3922727,60.562 75.9492727,61.451 74.5082727,62.366 C72.4422727,63.678 70.3802727,65.023 68.3302727,66.437 C63.8372727,69.535 59.7422727,72.63 56.0902727,75.567 C54.8732727,76.547 53.7052727,77.508 52.5882727,78.446 C48.1222727,82.2 44.4752727,85.581 41.7602727,88.226 C38.3032727,91.593 36.3592727,93.766 36.1632727,93.986 L35.8282727,94.362 L32.0332727,98.61 L30.6432727,100.164 C30.4962727,100.329 30.3932727,100.517 30.3312727,100.715 C30.1482727,101.307 30.3472727,101.981 30.8882727,102.368 L37.2812727,106.938 L37.4862727,107.083 L37.6922727,107.228 C39.8732727,108.766 42.0702727,110.277 44.2792727,111.758 C45.8422727,112.807 47.4102727,113.84 48.9832727,114.858 C51.5302727,116.508 54.0902727,118.103 56.6542727,119.665 C57.8412727,120.388 59.0282727,121.101 60.2162727,121.804 C61.2142727,122.394 62.2102727,122.989 63.2072727,123.565 C76.9772727,131.512 90.1802727,137.744 102.748273,142.242 C104.544273,142.884 106.326273,143.491 108.096273,144.063 C111.635273,145.206 115.121273,146.207 118.553273,147.067 C121.986273,147.925 125.364273,148.642 128.687273,149.215 C135.332273,150.362 141.755273,150.938 147.943273,150.938 C154.593273,150.938 161.273273,150.074 167.741273,148.43 C174.209273,146.786 180.465273,144.361 186.265273,141.238 C190.133273,139.156 193.798273,136.764 197.189273,134.087 C200.352273,131.589 203.264273,128.872 205.911273,125.949 C207.677273,124 209.325273,121.96 210.854273,119.831 C211.618273,118.766 212.353273,117.68 213.057273,116.571 C214.466273,114.356 215.753273,112.053 216.916273,109.667 C220.701273,101.906 223.073273,93.439 224.008273,84.406 C224.310273,81.485 224.465273,78.505 224.465273,75.469 C224.465273,72.364 224.306273,69.316 223.990273,66.33"),$(a,"id","Fill-1"),$(a,"fill","#146EE6"),$(u,"d","M758.389273,75.346 C752.632273,111.56 742.681273,122.23 712.102273,122.23 C710.847273,122.23 709.640273,122.207 708.464273,122.17 C708.321273,122.191 708.191273,122.23 708.028273,122.23 L637.994273,122.23 C636.795273,122.23 636.315273,121.632 636.435273,120.311 L650.585273,31.22 C650.704273,30.016 651.424273,29.417 652.623273,29.417 L667.852273,29.417 C669.050273,29.417 669.530273,30.016 669.410273,31.22 L657.659273,105.802 L714.249273,105.802 L714.249273,105.787 C714.410273,105.794 714.568273,105.802 714.741273,105.802 C718.878273,105.802 722.250273,105.351 725.040273,104.313 C726.434273,103.794 727.684273,103.129 728.810273,102.298 C729.373273,101.884 729.905273,101.426 730.410273,100.927 C734.951273,96.431 737.231273,88.43 739.322273,75.346 C739.328273,75.312 739.331273,75.282 739.337273,75.25 C739.642273,73.311 739.896273,71.474 740.130273,69.679 C740.203273,69.116 740.272273,68.557 740.338273,68.008 C740.412273,67.392 740.461273,66.821 740.525273,66.222 C742.136273,49.927 738.622273,44.525 724.454273,44.525 C723.419273,44.525 722.433273,44.554 721.490273,44.613 C708.297273,45.444 703.831273,52.303 700.461273,71.126 C700.220273,72.472 699.984273,73.877 699.752273,75.346 C699.483273,77.027 699.255273,78.6 699.052273,80.115 C698.993273,80.545 698.948273,80.946 698.895273,81.361 C698.757273,82.465 698.638273,83.528 698.540273,84.544 C698.502273,84.943 698.466273,85.334 698.434273,85.72 C698.344273,86.815 698.281273,87.856 698.246273,88.847 C698.238273,89.049 698.224273,89.269 698.219273,89.469 C698.161273,91.88 698.289273,93.972 698.621273,95.782 C698.649273,95.941 698.686273,96.089 698.717273,96.246 C698.874273,96.992 699.067273,97.689 699.301273,98.337 C699.346273,98.464 699.390273,98.594 699.439273,98.718 C700.039273,100.231 700.864273,101.478 701.963273,102.469 C702.263273,102.738 702.586273,102.987 702.925273,103.22 L679.436273,103.22 C679.393273,102.969 679.343273,102.727 679.305273,102.471 L679.304273,102.471 C679.304273,102.467 679.304273,102.462 679.303273,102.459 C679.259273,102.17 679.236273,101.854 679.198273,101.558 C679.083273,100.634 678.995273,99.671 678.934273,98.674 C678.908273,98.258 678.879273,97.845 678.862273,97.419 C678.816273,96.174 678.804273,94.876 678.832273,93.518 C678.840273,93.114 678.861273,92.69 678.876273,92.276 C678.920273,91.042 678.991273,89.765 679.092273,88.441 C679.117273,88.109 679.134273,87.79 679.162273,87.452 C679.299273,85.836 679.483273,84.137 679.698273,82.382 C679.750273,81.957 679.807273,81.518 679.863273,81.084 C680.104273,79.238 680.369273,77.344 680.687273,75.346 C681.046273,73.067 681.423273,70.889 681.819273,68.808 C687.040273,41.397 695.809273,30.748 717.267273,28.554 C720.250273,28.25 723.472273,28.103 726.971273,28.103 C726.972273,28.103 726.972273,28.103 726.972273,28.103 C747.994273,28.103 757.680273,33.202 759.811273,48.236 C760.779273,55.067 760.187273,63.953 758.389273,75.346 Z M894.023273,31.336 L866.923273,108.56 C863.472273,118.182 861.113273,121.41 854.499273,122.41 C852.379273,122.733 849.831273,122.828 846.659273,122.828 C831.670273,122.828 830.350273,121.267 829.392273,108.56 L825.794273,63.232 L825.794273,63.231 L807.928273,108.56 C804.255273,117.613 802.201273,120.996 795.961273,122.202 C793.442273,122.687 790.260273,122.829 785.985273,122.829 C772.914273,122.829 770.756273,121.267 770.396273,108.56 L767.638273,31.337 C767.638273,29.899 768.238273,29.417 769.557273,29.417 L785.385273,29.417 C786.464273,29.417 786.704273,29.899 786.824273,31.337 L788.895273,100.572 L788.895273,100.571 C789.054273,103.091 789.563273,103.641 791.021273,103.641 C792.939273,103.641 793.419273,103.042 794.618273,100.043 L820.758273,34.576 C821.358273,33.132 822.437273,32.657 823.516273,32.657 L837.665273,32.657 C838.519273,32.657 839.279273,32.977 839.626273,33.817 C839.718273,34.038 839.799273,34.274 839.824273,34.576 L845.220273,100.043 C845.460273,103.042 845.819273,103.641 847.738273,103.641 C849.297273,103.641 849.896273,103.042 850.976273,100.043 L874.838273,31.336 C875.317273,29.898 875.677273,29.417 876.756273,29.417 L892.584273,29.417 C893.903273,29.417 894.383273,29.898 894.023273,31.336 Z M362.708273,31.219 L357.192273,120.311 C357.192273,121.632 356.353273,122.23 355.154273,122.23 L339.926273,122.23 C338.726273,122.23 338.366273,121.632 338.366273,120.311 L342.324273,62.756 L311.986273,117.551 C311.386273,118.749 310.428273,119.348 309.229273,119.348 L297.837273,119.348 C296.758273,119.348 296.038273,118.749 295.560273,117.551 L282.851273,62.767 L282.848273,62.755 L268.339273,120.31 C268.212273,121.009 267.974273,121.492 267.612273,121.807 C267.288273,122.085 266.865273,122.23 266.301273,122.23 L251.073273,122.23 C249.874273,122.23 249.273273,121.632 249.514273,120.31 L272.296273,31.336 C272.537273,30.138 272.897273,29.417 274.095273,29.417 L288.605273,29.417 C291.236273,29.417 292.726273,29.895 293.682273,31.379 C294.120273,32.059 294.457273,32.928 294.720273,34.095 L307.790273,92.489 L339.326273,34.095 C341.485273,30.256 343.043273,29.299 346.880273,29.299 L361.389273,29.299 C362.376273,29.299 362.682273,30.684 362.682273,30.684 C362.682273,30.684 362.708273,31.029 362.708273,31.219 Z M501.706273,31.219 L499.667273,44.049 C499.547273,45.246 498.708273,45.845 497.509273,45.845 L472.448273,45.845 L460.696273,120.31 C460.457273,121.632 459.738273,122.23 458.538273,122.23 L443.309273,122.23 C442.111273,122.23 441.631273,121.632 441.870273,120.31 L453.622273,45.845 L394.820273,45.845 L391.224273,68.507 L391.224273,68.508 L430.555273,68.508 C431.754273,68.508 432.353273,69.106 432.234273,70.31 L430.196273,82.542 C430.076273,83.738 429.236273,84.338 428.038273,84.338 L388.706273,84.338 L385.349273,105.801 L428.397273,105.801 C429.596273,105.801 430.076273,106.4 429.955273,107.597 L427.797273,120.428 C427.676273,121.632 426.958273,122.23 425.759273,122.23 L365.683273,122.23 C364.484273,122.23 364.004273,121.632 364.124273,120.31 L378.273273,31.219 C378.393273,30.015 379.112273,29.417 380.313273,29.417 L500.147273,29.417 C501.346273,29.417 501.826273,30.015 501.706273,31.219 Z M629.471273,70.426 L627.433273,82.659 C627.313273,83.856 626.473273,84.454 625.275273,84.454 L588.223273,84.454 L582.466273,120.311 C582.347273,121.632 581.627273,122.23 580.428273,122.23 L565.200273,122.23 C564.001273,122.23 563.522273,121.632 563.640273,120.311 L577.790273,31.219 C577.910273,30.016 578.629273,29.417 579.828273,29.417 L643.004273,29.417 C644.202273,29.417 644.802273,30.016 644.682273,31.219 L642.644273,44.05 C642.403273,45.247 641.685273,45.846 640.486273,45.846 L594.337273,45.846 L590.741273,68.631 L627.793273,68.631 C628.991273,68.631 629.592273,69.23 629.471273,70.426 Z M388.706273,84.338 L388.712273,84.338 L388.309273,86.876 L388.706273,84.338 Z M510.726273,79.783 L524.396273,48.006 C525.036273,46.466 525.443273,45.589 525.990273,45.096 C526.465273,44.667 527.044273,44.525 527.993273,44.525 C530.391273,44.525 530.391273,45.124 530.751273,48.006 L534.348273,79.783 L510.726273,79.783 Z M542.334273,29.886 C539.756273,28.905 536.043273,28.702 530.511273,28.702 C516.601273,28.702 513.963273,30.016 508.208273,43.087 L474.633273,120.311 C474.154273,121.749 474.513273,122.23 475.832273,122.23 L491.060273,122.23 C492.259273,122.23 492.500273,121.749 493.099273,120.311 L504.011273,95.372 L536.026273,95.372 L539.024273,120.311 C539.144273,121.749 539.144273,122.23 540.344273,122.23 L555.572273,122.23 C556.891273,122.23 557.490273,121.749 557.490273,120.311 L548.617273,43.087 C547.658273,35.042 546.460273,31.458 542.334273,29.886 L542.334273,29.886 Z"),$(u,"id","Fill-2"),$(u,"fill","#333333"),$(o,"id","metaflow_logo_horizontal"),$(o,"transform","translate(92.930727, 93.190000)"),$(s,"id","Metaflow_Logo_Horizontal_TwoColor_Dark_RGB"),$(s,"transform","translate(-92.000000, -93.000000)"),$(r,"id","Page-1"),$(r,"stroke","none"),$(r,"stroke-width","1"),$(r,"fill","none"),$(r,"fill-rule","evenodd"),$(t,"xmlns","http://www.w3.org/2000/svg"),$(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),$(t,"width","896px"),$(t,"height","152px"),$(t,"viewBox","0 0 896 152"),$(t,"version","1.1")},m(l,c){L(l,t,c),R(t,n),R(n,i),R(t,r),R(r,s),R(s,o),R(o,a),R(o,u)},d(l){l&&O(t)}}}function CB(e){let t,n,i;return{c(){t=zi("svg"),n=zi("path"),i=zi("path"),$(n,"fill-rule","evenodd"),$(n,"clip-rule","evenodd"),$(n,"d","M223.991 66.33C223.516 61.851 222.687 57.512 221.506 53.33C220.326 49.148 218.796 45.122 216.917 41.271C212.846 32.921 207.255 25.587 200.269 19.422C199.271 18.541 198.244 17.684 197.19 16.851C191.256 12.166 184.482 8.355 177.254 5.55C174.157 4.347 170.976 3.33 167.742 2.508C161.274 0.863 154.594 0 147.944 0C141.756 0 135.333 0.576 128.688 1.722C127.026 2.01 125.351 2.332 123.662 2.69C120.284 3.406 116.852 4.265 113.366 5.267C104.651 7.769 95.6025 11.161 86.2445 15.433C78.7595 18.851 71.0765 22.832 63.2075 27.373C47.9765 36.162 35.7375 44.969 29.3595 49.791C29.0695 50.01 28.7925 50.221 28.5265 50.423C26.1385 52.244 24.7525 53.367 24.5665 53.519L0.549511 73.065C0.191511 73.356 0.00751099 73.773 0.000238261 74.194C-0.00348901 74.403 0.036511 74.614 0.120511 74.811C0.205511 75.008 0.334511 75.189 0.508511 75.341L11.7615 85.195C12.1695 85.552 12.7255 85.651 13.2165 85.487C13.3795 85.432 13.5365 85.348 13.6765 85.234L35.8495 67.382C36.0425 67.224 37.6155 65.949 40.3255 63.903C44.1195 61.036 50.1425 56.656 57.7295 51.711C62.0645 48.884 66.9105 45.873 72.1415 42.854C100.865 26.278 126.368 17.874 147.944 17.874C148.367 17.874 148.791 17.892 149.214 17.902C149.656 17.911 150.097 17.911 150.539 17.93C153.77 18.068 156.996 18.463 160.171 19.097C164.932 20.049 169.578 21.542 173.954 23.524C178.329 25.505 182.434 27.975 186.113 30.88C186.772 31.4 187.407 31.94 188.036 32.485C188.914 33.245 189.772 34.023 190.592 34.83C191.999 36.217 193.318 37.673 194.549 39.195C196.396 41.479 198.043 43.912 199.481 46.485C199.961 47.342 200.418 48.216 200.851 49.105C201.113 49.642 201.344 50.196 201.588 50.743C202.232 52.185 202.835 53.649 203.355 55.158C203.713 56.198 204.042 57.255 204.341 58.326C205.837 63.683 206.591 69.417 206.591 75.469C206.591 81.221 205.893 86.677 204.542 91.804C203.618 95.308 202.398 98.662 200.851 101.833C200.418 102.722 199.961 103.595 199.481 104.453C197.563 107.884 195.276 111.066 192.637 113.976C190.658 116.159 188.481 118.189 186.114 120.058C184.554 121.29 182.91 122.432 181.209 123.503C180.314 124.067 179.401 124.609 178.471 125.126C177.463 125.688 176.443 126.232 175.399 126.737C166.962 130.823 157.424 133.064 147.944 133.064C126.368 133.064 100.865 124.659 72.1415 108.084C70.5385 107.159 68.4385 105.886 66.3075 104.575C65.0295 103.788 63.7405 102.986 62.5415 102.237C59.3445 100.238 56.7885 98.61 56.7885 98.61C61.8365 93.901 69.3235 87.465 78.6475 81.047C80.0095 80.11 81.4195 79.174 82.8575 78.243C84.1055 77.436 85.3715 76.63 86.6735 75.835C88.2045 74.9 89.7805 73.981 91.3825 73.074C93.0485 72.131 94.7515 71.207 96.4905 70.307C111.474 62.55 129.095 56.602 147.944 56.602C151.751 56.602 157.746 57.825 162.115 61.276C162.301 61.422 162.49 61.578 162.678 61.74C163.338 62.305 164.007 62.966 164.635 63.78C164.958 64.198 165.27 64.657 165.565 65.162C166.007 65.92 166.41 66.782 166.751 67.775C166.892 68.185 167.017 68.627 167.135 69.083C167.587 70.833 167.864 72.924 167.864 75.469C167.864 78.552 167.461 80.974 166.825 82.92C166.579 83.674 166.301 84.363 165.993 84.983C165.856 85.259 165.712 85.524 165.565 85.776C165.377 86.099 165.179 86.396 164.978 86.682C164.632 87.175 164.27 87.618 163.901 88.018C163.731 88.202 163.56 88.379 163.388 88.546C162.963 88.96 162.535 89.331 162.115 89.662C157.746 93.112 151.751 94.337 147.944 94.337C144.486 94.337 140.683 93.926 136.59 93.121C133.861 92.584 131.004 91.871 128.034 90.987C123.58 89.662 118.874 87.952 113.971 85.872C113.769 85.786 113.553 85.747 113.337 85.753C113.123 85.76 112.909 85.813 112.714 85.912C106.991 88.816 101.642 91.995 96.7465 95.223C96.6235 95.304 96.5185 95.397 96.4305 95.5C95.8125 96.22 96.0175 97.397 96.9495 97.822L102.446 100.328C104.607 101.314 106.738 102.238 108.836 103.102C110.935 103.966 113.002 104.77 115.036 105.511C118.087 106.624 121.065 107.599 123.966 108.436C127.835 109.551 131.568 110.421 135.158 111.043C139.647 111.82 143.913 112.211 147.944 112.211C148.368 112.211 148.924 112.201 149.592 112.169C149.926 112.153 150.288 112.131 150.675 112.102C155.713 111.724 165.056 110.114 173.191 103.691C173.548 103.41 173.87 103.105 174.211 102.813C175.325 101.86 176.382 100.866 177.334 99.8C177.471 99.648 177.591 99.485 177.725 99.331C181.301 95.167 183.7 90.185 184.876 84.406C185.445 81.609 185.738 78.631 185.738 75.469C185.738 63.315 181.517 53.82 173.191 47.247C167.051 42.399 160.229 40.299 155.084 39.395C153.893 39.186 152.791 39.037 151.81 38.938C150.117 38.766 148.775 38.727 147.944 38.727C133.457 38.727 118.52 41.679 103.546 47.5C99.1225 49.22 94.6915 51.191 90.2705 53.403C88.7975 54.141 87.3245 54.905 85.8545 55.696C83.5095 56.957 81.1725 58.303 78.8385 59.697C77.3925 60.562 75.9495 61.451 74.5085 62.366C72.4425 63.678 70.3805 65.023 68.3305 66.437C63.8375 69.535 59.7425 72.63 56.0905 75.567C54.8735 76.547 53.7055 77.508 52.5885 78.446C48.1225 82.2 44.4755 85.581 41.7605 88.226C38.3035 91.593 36.3595 93.766 36.1635 93.986L35.8285 94.362L32.0335 98.61L30.6435 100.164C30.4965 100.329 30.3935 100.517 30.3315 100.715C30.1485 101.307 30.3475 101.981 30.8885 102.368L37.2815 106.938L37.4865 107.083L37.6925 107.228C39.8735 108.766 42.0705 110.277 44.2795 111.758C45.8425 112.807 47.4105 113.84 48.9835 114.858C51.5305 116.508 54.0905 118.103 56.6545 119.665C57.8415 120.388 59.0285 121.101 60.2165 121.804C61.2145 122.394 62.2105 122.989 63.2075 123.565C76.9775 131.512 90.1805 137.744 102.749 142.242C104.545 142.884 106.327 143.491 108.097 144.063C111.636 145.206 115.122 146.207 118.554 147.067C121.987 147.925 125.365 148.642 128.688 149.215C135.333 150.362 141.756 150.938 147.944 150.938C154.594 150.938 161.274 150.074 167.742 148.43C174.21 146.786 180.466 144.361 186.266 141.238C190.134 139.156 193.799 136.764 197.19 134.087C200.353 131.589 203.265 128.872 205.912 125.949C207.678 124 209.326 121.96 210.855 119.831C211.619 118.766 212.354 117.68 213.058 116.571C214.467 114.356 215.754 112.053 216.917 109.667C220.702 101.906 223.074 93.439 224.009 84.406C224.311 81.485 224.466 78.505 224.466 75.469C224.466 72.364 224.307 69.316 223.991 66.33Z"),$(n,"fill","#146EE6"),$(i,"fill-rule","evenodd"),$(i,"clip-rule","evenodd"),$(i,"d","M758.39 75.346C752.633 111.56 742.682 122.23 712.103 122.23C710.848 122.23 709.641 122.207 708.465 122.17C708.322 122.191 708.192 122.23 708.029 122.23H637.995C636.796 122.23 636.316 121.632 636.436 120.311L650.586 31.22C650.705 30.016 651.425 29.417 652.624 29.417H667.853C669.051 29.417 669.531 30.016 669.411 31.22L657.66 105.802H714.25V105.787C714.411 105.794 714.569 105.802 714.742 105.802C718.879 105.802 722.251 105.351 725.041 104.313C726.435 103.794 727.685 103.129 728.811 102.298C729.374 101.884 729.906 101.426 730.411 100.927C734.952 96.431 737.232 88.43 739.323 75.346C739.329 75.312 739.332 75.282 739.338 75.25C739.643 73.311 739.896 71.474 740.13 69.679C740.203 69.116 740.273 68.557 740.339 68.008C740.413 67.392 740.462 66.821 740.526 66.222C742.137 49.927 738.623 44.525 724.455 44.525C723.42 44.525 722.434 44.554 721.491 44.613C708.298 45.444 703.831 52.303 700.461 71.126C700.22 72.472 699.985 73.877 699.753 75.346C699.484 77.027 699.255 78.6 699.052 80.115C698.993 80.545 698.949 80.946 698.896 81.361C698.758 82.465 698.639 83.528 698.541 84.544C698.503 84.943 698.467 85.334 698.435 85.72C698.345 86.815 698.282 87.856 698.247 88.847C698.239 89.049 698.225 89.269 698.22 89.469C698.162 91.88 698.29 93.972 698.622 95.782C698.65 95.941 698.687 96.089 698.718 96.246C698.875 96.992 699.068 97.689 699.302 98.337C699.347 98.464 699.391 98.594 699.44 98.718C700.04 100.231 700.865 101.478 701.964 102.469C702.264 102.738 702.587 102.987 702.926 103.22H679.437C679.394 102.969 679.344 102.727 679.306 102.471H679.305C679.305 102.467 679.305 102.462 679.304 102.459C679.26 102.17 679.237 101.854 679.199 101.558C679.084 100.634 678.996 99.671 678.935 98.674C678.909 98.258 678.879 97.845 678.862 97.419C678.816 96.174 678.805 94.876 678.833 93.518C678.841 93.114 678.862 92.69 678.877 92.276C678.921 91.042 678.992 89.765 679.093 88.441C679.118 88.109 679.135 87.79 679.163 87.452C679.3 85.836 679.484 84.137 679.699 82.382C679.751 81.957 679.808 81.518 679.864 81.084C680.105 79.238 680.37 77.344 680.688 75.346C681.046 73.067 681.424 70.889 681.82 68.808C687.041 41.397 695.81 30.748 717.268 28.554C720.251 28.25 723.472 28.103 726.971 28.103C726.972 28.103 726.973 28.103 726.973 28.103C747.995 28.103 757.681 33.202 759.812 48.236C760.78 55.067 760.188 63.953 758.39 75.346ZM894.023 31.336L866.924 108.56C863.473 118.182 861.114 121.41 854.5 122.41C852.38 122.733 849.832 122.828 846.66 122.828C831.671 122.828 830.351 121.267 829.393 108.56L825.794 63.232V63.231L807.929 108.56C804.256 117.613 802.201 120.996 795.961 122.202C793.442 122.687 790.261 122.829 785.986 122.829C772.915 122.829 770.757 121.267 770.397 108.56L767.638 31.337C767.638 29.899 768.238 29.417 769.557 29.417H785.385C786.464 29.417 786.705 29.899 786.825 31.337L788.896 100.572V100.571C789.055 103.091 789.564 103.641 791.022 103.641C792.94 103.641 793.42 103.042 794.619 100.043L820.759 34.576C821.359 33.132 822.438 32.657 823.517 32.657H837.666C838.52 32.657 839.28 32.977 839.627 33.817C839.719 34.038 839.8 34.274 839.825 34.576L845.221 100.043C845.461 103.042 845.82 103.641 847.739 103.641C849.298 103.641 849.897 103.042 850.977 100.043L874.839 31.336C875.318 29.898 875.678 29.417 876.757 29.417H892.585C893.904 29.417 894.383 29.898 894.023 31.336ZM362.709 31.219L357.193 120.311C357.193 121.632 356.354 122.23 355.155 122.23H339.927C338.727 122.23 338.367 121.632 338.367 120.311L342.325 62.756L311.987 117.551C311.387 118.749 310.429 119.348 309.23 119.348H297.838C296.759 119.348 296.039 118.749 295.561 117.551L282.852 62.767L282.849 62.755L268.34 120.31C268.213 121.009 267.975 121.492 267.613 121.807C267.289 122.085 266.866 122.23 266.302 122.23H251.074C249.875 122.23 249.274 121.632 249.515 120.31L272.297 31.336C272.538 30.138 272.898 29.417 274.096 29.417H288.606C291.237 29.417 292.727 29.895 293.683 31.379C294.121 32.059 294.458 32.928 294.721 34.095L307.791 92.489L339.327 34.095C341.486 30.256 343.044 29.299 346.881 29.299H361.39C362.377 29.299 362.683 30.684 362.683 30.684C362.683 30.684 362.709 31.029 362.709 31.219ZM501.707 31.219L499.668 44.049C499.548 45.246 498.709 45.845 497.51 45.845H472.449L460.697 120.31C460.458 121.632 459.739 122.23 458.539 122.23H443.31C442.112 122.23 441.632 121.632 441.871 120.31L453.623 45.845H394.821L391.225 68.507V68.508H430.556C431.755 68.508 432.354 69.106 432.235 70.31L430.197 82.542C430.077 83.738 429.237 84.338 428.039 84.338H388.707L385.35 105.801H428.398C429.597 105.801 430.077 106.4 429.956 107.597L427.798 120.428C427.677 121.632 426.959 122.23 425.76 122.23H365.684C364.485 122.23 364.005 121.632 364.125 120.31L378.274 31.219C378.394 30.015 379.113 29.417 380.314 29.417H500.148C501.347 29.417 501.827 30.015 501.707 31.219ZM629.471 70.426L627.434 82.659C627.314 83.856 626.474 84.454 625.276 84.454H588.224L582.466 120.311C582.347 121.632 581.628 122.23 580.429 122.23H565.201C564.002 122.23 563.523 121.632 563.641 120.311L577.791 31.219C577.911 30.016 578.629 29.417 579.828 29.417H643.005C644.203 29.417 644.802 30.016 644.682 31.219L642.645 44.05C642.404 45.247 641.686 45.846 640.487 45.846H594.338L590.742 68.631H627.794C628.992 68.631 629.592 69.23 629.471 70.426ZM388.707 84.338H388.713L388.31 86.876L388.707 84.338ZM510.727 79.783L524.397 48.006C525.037 46.466 525.444 45.589 525.991 45.096C526.466 44.667 527.045 44.525 527.994 44.525C530.392 44.525 530.392 45.124 530.752 48.006L534.349 79.783H510.727ZM542.335 29.886C539.757 28.905 536.044 28.702 530.512 28.702C516.602 28.702 513.964 30.016 508.209 43.087L474.634 120.311C474.155 121.749 474.514 122.23 475.833 122.23H491.061C492.26 122.23 492.501 121.749 493.1 120.311L504.012 95.372H536.026L539.025 120.311C539.145 121.749 539.145 122.23 540.345 122.23H555.573C556.892 122.23 557.491 121.749 557.491 120.311L548.617 43.087C547.658 35.042 546.461 31.458 542.335 29.886Z"),$(i,"fill","white"),$(t,"width","895"),$(t,"height","151"),$(t,"viewBox","0 0 895 151"),$(t,"fill","none"),$(t,"xmlns","http://www.w3.org/2000/svg")},m(r,s){L(r,t,s),R(t,n),R(t,i)},d(r){r&&O(t)}}}function AB(e){let t;function n(s,o){return s[0]?CB:EB}let i=n(e),r=i(e);return{c(){r.c(),t=Ne()},m(s,o){r.m(s,o),L(s,t,o)},p(s,[o]){i!==(i=n(s))&&(r.d(1),r=i(s),r&&(r.c(),r.m(t.parentNode,t)))},i:X,o:X,d(s){s&&O(t),r.d(s)}}}function $B(e,t,n){let{light:i=!1}=t;return e.$$set=r=>{"light"in r&&n(0,i=r.light)},[i]}class SB extends _e{constructor(t){super(),ve(this,t,$B,AB,pe,{light:0})}}function FB(e){let t,n,i,r,s,o;r=new SB({});const a=e[1].default,u=yt(a,e,e[0],null);return{c(){t=I("aside"),n=I("div"),i=I("div"),he(r.$$.fragment),s=ge(),u&&u.c(),$(i,"class","logoContainer"),$(t,"class","svelte-1okdv0e")},m(l,c){L(l,t,c),R(t,n),R(n,i),fe(r,i,null),R(n,s),u&&u.m(n,null),o=!0},p(l,[c]){u&&u.p&&(!o||c&1)&&vt(u,a,l,l[0],o?bt(a,l[0],c,null):_t(l[0]),null)},i(l){o||(D(r.$$.fragment,l),D(u,l),o=!0)},o(l){N(r.$$.fragment,l),N(u,l),o=!1},d(l){l&&O(t),de(r),u&&u.d(l)}}}function DB(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class TB extends _e{constructor(t){super(),ve(this,t,DB,FB,pe,{})}}function D5(e){let t,n;return{c(){t=I("td"),n=ce(e[0]),$(t,"class","idCell svelte-pt8vzv"),$(t,"data-component","artifact-row")},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&1&&Me(n,i[0])},d(i){i&&O(t)}}}function MB(e){let t,n,i,r,s=e[1].data+"",o,a,u=e[0]!==null&&D5(e);return{c(){t=I("tr"),u&&u.c(),n=ge(),i=I("td"),r=I("code"),o=ce(s),$(r,"class","mono"),$(i,"class","codeCell svelte-pt8vzv"),$(i,"colspan",a=e[0]===null?2:1),$(i,"data-component","artifact-row")},m(l,c){L(l,t,c),u&&u.m(t,null),R(t,n),R(t,i),R(i,r),R(r,o),e[3](r)},p(l,[c]){l[0]!==null?u?u.p(l,c):(u=D5(l),u.c(),u.m(t,n)):u&&(u.d(1),u=null),c&2&&s!==(s=l[1].data+"")&&Me(o,s),c&1&&a!==(a=l[0]===null?2:1)&&$(i,"colspan",a)},i:X,o:X,d(l){l&&O(t),u&&u.d(),e[3](null)}}}function NB(e,t,n){let{id:i}=t,{artifact:r}=t,s;function o(){var u;s&&!s.classList.contains("language-python")&&typeof window<"u"&&((u=window==null?void 0:window.Prism)==null||u.highlightElement(s))}function a(u){jn[u?"unshift":"push"](()=>{s=u,n(2,s)})}return e.$$set=u=>{"id"in u&&n(0,i=u.id),"artifact"in u&&n(1,r=u.artifact)},e.$$.update=()=>{e.$$.dirty&4&&s&&o()},[i,r,s,a]}class RB extends _e{constructor(t){super(),ve(this,t,NB,MB,pe,{id:0,artifact:1})}}function T5(e,t,n){const i=e.slice();return i[2]=t[n],i}function M5(e){let t,n;return t=new RB({props:{id:e[2].name,artifact:e[2]}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p:X,i(i){n||(D(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function OB(e){let t,n,i,r=Pe(e[0]),s=[];for(let a=0;aN(s[a],1,1,()=>{s[a]=null});return{c(){t=I("div"),n=I("table");for(let a=0;a{if(s.name&&o.name){if(s.name>o.name)return 1;if(s.name{"componentData"in s&&n(1,i=s.componentData)},[r,i]}class N5 extends _e{constructor(t){super(),ve(this,t,LB,OB,pe,{componentData:1})}}function IB(e){let t,n,i;return{c(){t=I("div"),n=ge(),i=I("div"),$(t,"class","path topLeft svelte-19jpdwh"),$(i,"class","path bottomRight svelte-19jpdwh")},m(r,s){L(r,t,s),L(r,n,s),L(r,i,s)},d(r){r&&(O(t),O(n),O(i))}}}function PB(e){let t;return{c(){t=I("div"),$(t,"class","path straightLine svelte-19jpdwh")},m(n,i){L(n,t,i)},d(n){n&&O(t)}}}function zB(e){let t;return{c(){t=I("div"),$(t,"class","path loop svelte-19jpdwh")},m(n,i){L(n,t,i)},d(n){n&&O(t)}}}function BB(e){let t;function n(s,o){return s[6]?zB:s[5]?PB:IB}let i=n(e),r=i(e);return{c(){t=I("div"),r.c(),$(t,"class","connectorwrapper svelte-19jpdwh"),ki(t,"top",e[1]+"rem"),ki(t,"left",e[0]+"rem"),ki(t,"width",e[3]+"rem"),ki(t,"height",e[4]+"rem"),At(t,"flip",e[2])},m(s,o){L(s,t,o),r.m(t,null)},p(s,[o]){i!==(i=n(s))&&(r.d(1),r=i(s),r&&(r.c(),r.m(t,null))),o&2&&ki(t,"top",s[1]+"rem"),o&1&&ki(t,"left",s[0]+"rem"),o&8&&ki(t,"width",s[3]+"rem"),o&16&&ki(t,"height",s[4]+"rem"),o&4&&At(t,"flip",s[2])},i:X,o:X,d(s){s&&O(t),r.d()}}}const Ca=.5;function jB(e,t,n){let{top:i=0}=t,{left:r=0}=t,{bottom:s=0}=t,{right:o=0}=t,a,u,l,c=!1,f=!1;return e.$$set=d=>{"top"in d&&n(1,i=d.top),"left"in d&&n(0,r=d.left),"bottom"in d&&n(8,s=d.bottom),"right"in d&&n(7,o=d.right)},e.$$.update=()=>{e.$$.dirty&415&&(n(2,a=o-r<0),n(3,u=Math.abs(o-r)),u<=Ca?(n(3,u=Ca),n(5,c=!0),n(0,r-=Ca/2)):(a?(n(0,r+=Ca/2),n(7,o-=Ca/2)):(n(0,r-=Ca/2),n(7,o+=Ca/2)),n(3,u=Math.abs(o-r))),n(4,l=s-i),l<0&&(n(6,f=!0),n(4,l=5.5),n(3,u=10.25)))},[r,i,a,u,l,c,f,o,s]}class UB extends _e{constructor(t){super(),ve(this,t,jB,BB,pe,{top:1,left:0,bottom:8,right:7})}}function R5(e,t,n){const i=e.slice();return i[3]=t[n],i}function O5(e){let t,n;return t=new UB({props:{top:bo(e[3].top),left:bo(e[3].left),bottom:bo(e[3].bottom),right:bo(e[3].right)}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.top=bo(i[3].top)),r&1&&(s.left=bo(i[3].left)),r&1&&(s.bottom=bo(i[3].bottom)),r&1&&(s.right=bo(i[3].right)),t.$set(s)},i(i){n||(D(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function qB(e){let t,n,i=Pe(e[0]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{"dagStructure"in o&&n(1,i=o.dagStructure),"container"in o&&n(2,r=o.container)},e.$$.update=()=>{if(e.$$.dirty&7&&(n(0,s=[]),r)){const o=r.getBoundingClientRect(),a=o.top,u=o.left;Object.values(i).forEach(l=>{var f;const c=l.node.getBoundingClientRect();(f=l.connections)==null||f.forEach(d=>{const h=i[d];if(!h){console.warn("Connection node not found:",d);return}const p=h.node.getBoundingClientRect(),g={top:c.bottom-a,left:c.left-u+c.width/2,bottom:p.top-a,right:p.left-u+p.width/2};n(0,s=[...s,g])})})}},[s,i,r]}class HB extends _e{constructor(t){super(),ve(this,t,WB,qB,pe,{dagStructure:1,container:2})}}const L5="currentStep";function I5(e,t,n){const i=e.slice();return i[16]=t[n],i[18]=n,i}function P5(e){let t,n,i;return{c(){t=I("div"),n=ce("x"),i=ce(e[6]),$(t,"class","levelstoshow svelte-117ceti")},m(r,s){L(r,t,s),R(t,n),R(t,i)},p(r,s){s&64&&Me(i,r[6])},d(r){r&&O(t)}}}function z5(e){let t,n;return{c(){t=I("div"),$(t,"class",n="level rectangle "+e[16]+" svelte-117ceti"),ki(t,"z-index",(e[18]+1)*-1),ki(t,"top",(e[18]+1)*B5+"px"),ki(t,"left",(e[18]+1)*B5+"px")},m(i,r){L(i,t,r)},p(i,r){r&128&&n!==(n="level rectangle "+i[16]+" svelte-117ceti")&&$(t,"class",n)},d(i){i&&O(t)}}}function GB(e){let t,n,i,r,s,o,a,u,l=e[2].doc+"",c,f,d,h=e[6]&&P5(e),p=Pe(e[7]),g=[];for(let m=0;m1&&(c=new Intl.NumberFormat().format(r.num_possible_tasks)),s=r.num_possible_tasks-1,Object.keys(f).forEach(v=>{const _=Number.parseInt(v);r.num_possible_tasks&&r.num_possible_tasks>_&&n(11,s=f[_])})):s*=VB,s>0&&(d=new Array(s).fill("")),d=d.map((v,_)=>{if(r.num_possible_tasks){const x=r.num_failed??0,k=r.successful_tasks??0;return(x-1)/r.num_possible_tasks>=(_+1)/d.length?"error":(x+k)/r.num_possible_tasks>=(_+1)/d.length?"success":"running"}return""});const h=E5(L5),p=i===h;r.failed||r.num_failed?u=!0:(r.num_possible_tasks??0)>(r.successful_tasks??0)?l=!0:r.num_possible_tasks&&r.num_possible_tasks===r.successful_tasks&&(a=!0);let g,m=!1;yo(()=>{n(9,m=kB(g))});function y(v){jn[v?"unshift":"push"](()=>{g=v,n(8,g)})}function b(v){jn[v?"unshift":"push"](()=>{o=v,n(0,o)})}return e.$$set=v=>{"name"in v&&n(1,i=v.name),"step"in v&&n(2,r=v.step),"numLevels"in v&&n(11,s=v.numLevels),"el"in v&&n(0,o=v.el)},[o,i,r,a,u,l,c,d,g,m,p,s,y,b]}let XB=class extends _e{constructor(t){super(),ve(this,t,YB,GB,pe,{name:1,step:2,numLevels:11,el:0})}};function j5(e,t,n){const i=e.slice();return i[13]=t[n],i}function ZB(e){let t,n,i,r,s,o,a;function u(h){e[11](h)}let l={name:e[2],numLevels:e[3],step:e[7]};e[5]!==void 0&&(l.el=e[5]),n=new XB({props:l}),jn.push(()=>y2(n,"el",u));let c=e[8]&&KB(e),f=e[7].box_ends&&tj(e),d=e[2]==="start"&&q5(e);return{c(){t=I("div"),he(n.$$.fragment),r=ge(),c&&c.c(),s=ge(),f&&f.c(),o=ge(),d&&d.c(),$(t,"class","stepwrapper svelte-18aex7a")},m(h,p){L(h,t,p),fe(n,t,null),R(t,r),c&&c.m(t,null),R(t,s),f&&f.m(t,null),R(t,o),d&&d.m(t,null),a=!0},p(h,p){const g={};p&4&&(g.name=h[2]),p&8&&(g.numLevels=h[3]),!i&&p&32&&(i=!0,g.el=h[5],g2(()=>i=!1)),n.$set(g),h[8]&&c.p(h,p),h[7].box_ends&&f.p(h,p),h[2]==="start"?d?(d.p(h,p),p&4&&D(d,1)):(d=q5(h),d.c(),D(d,1),d.m(t,null)):d&&(Ee(),N(d,1,1,()=>{d=null}),Ce())},i(h){a||(D(n.$$.fragment,h),D(c),D(f),D(d),a=!0)},o(h){N(n.$$.fragment,h),N(c),N(f),N(d),a=!1},d(h){h&&O(t),de(n),c&&c.d(),f&&f.d(),d&&d.d()}}}function KB(e){let t,n,i,r,s=Pe(e[7].next),o=[];for(let u=0;uN(o[u],1,1,()=>{o[u]=null});return{c(){t=I("div"),n=ge(),i=I("div");for(let u=0;u{o[c]=null}),Ce(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),D(n,1),n.m(i.parentNode,i))},i(u){r||(D(n),r=!0)},o(u){N(n),r=!1},d(u){u&&O(i),o[t].d(u)}}}function tj(e){let t,n,i,r;return i=new jh({props:{steps:e[1],stepName:e[7].box_ends,levels:e[3],dagStructure:e[0],pathToStep:e[6],joins:e[4]}}),{c(){t=I("div"),n=ge(),he(i.$$.fragment),$(t,"class","gap svelte-18aex7a")},m(s,o){L(s,t,o),L(s,n,o),fe(i,s,o),r=!0},p(s,o){const a={};o&2&&(a.steps=s[1]),o&8&&(a.levels=s[3]),o&1&&(a.dagStructure=s[0]),o&16&&(a.joins=s[4]),i.$set(a)},i(s){r||(D(i.$$.fragment,s),r=!0)},o(s){N(i.$$.fragment,s),r=!1},d(s){s&&(O(t),O(n)),de(i,s)}}}function q5(e){let t,n,i,r;return i=new jh({props:{steps:e[1],stepName:"end",levels:e[3],dagStructure:e[0]}}),{c(){t=I("div"),n=ge(),he(i.$$.fragment),$(t,"class","gap svelte-18aex7a")},m(s,o){L(s,t,o),L(s,n,o),fe(i,s,o),r=!0},p(s,o){const a={};o&2&&(a.steps=s[1]),o&8&&(a.levels=s[3]),o&1&&(a.dagStructure=s[0]),i.$set(a)},i(s){r||(D(i.$$.fragment,s),r=!0)},o(s){N(i.$$.fragment,s),r=!1},d(s){s&&(O(t),O(n)),de(i,s)}}}function nj(e){let t,n,i=e[7]&&ZB(e);return{c(){i&&i.c(),t=Ne()},m(r,s){i&&i.m(r,s),L(r,t,s),n=!0},p(r,[s]){r[7]&&i.p(r,s)},i(r){n||(D(i),n=!0)},o(r){N(i),n=!1},d(r){r&&O(t),i&&i.d(r)}}}function ij(e,t,n){var m;let{steps:i}=t,{stepName:r}=t,{levels:s=0}=t,{joins:o=[]}=t,{pathToStep:a=""}=t,{dagStructure:u={}}=t,l=null;const c=a?`${a}/${r}`:r,f=i[r];yo(()=>{if(u[c]){console.log("Node already registered:",c);return}if(!l){console.warn("Step element not found:",c);return}const y=[];for(const b of f.next){const v=i[b];if((v==null?void 0:v.type)==="join"){const _=o.find(x=>x.endsWith("/"+b));_&&y.push(_)}else b==="end"?y.push("end"):b===r?y.push(c):y.push(c+"/"+b)}n(0,u[c]={stepName:r,pathToStep:a,connections:y,node:l},u)});let h=(m=f==null?void 0:f.next)==null?void 0:m.find(y=>{var b;return((b=i[y])==null?void 0:b.type)!=="join"&&y!=="end"});const p=(f==null?void 0:f.type)==="foreach"?s+1:(f==null?void 0:f.type)==="join"?s-1:s;function g(y){l=y,n(5,l)}return e.$$set=y=>{"steps"in y&&n(1,i=y.steps),"stepName"in y&&n(2,r=y.stepName),"levels"in y&&n(3,s=y.levels),"joins"in y&&n(4,o=y.joins),"pathToStep"in y&&n(10,a=y.pathToStep),"dagStructure"in y&&n(0,u=y.dagStructure)},[u,i,r,s,o,l,c,f,h,p,a,g]}class jh extends _e{constructor(t){super(),ve(this,t,ij,nj,pe,{steps:1,stepName:2,levels:3,joins:4,pathToStep:10,dagStructure:0})}}function rj(e){let t;return{c(){t=I("p"),t.textContent="No start step"},m(n,i){L(n,t,i)},p:X,i:X,o:X,d(n){n&&O(t)}}}function sj(e){let t,n,i;function r(o){e[6](o)}let s={steps:e[3],stepName:"start"};return e[1]!==void 0&&(s.dagStructure=e[1]),t=new jh({props:s}),jn.push(()=>y2(t,"dagStructure",r)),{c(){he(t.$$.fragment)},m(o,a){fe(t,o,a),i=!0},p(o,a){const u={};!n&&a&2&&(n=!0,u.dagStructure=o[1],g2(()=>n=!1)),t.$set(u)},i(o){i||(D(t.$$.fragment,o),i=!0)},o(o){N(t.$$.fragment,o),i=!1},d(o){de(t,o)}}}function W5(e){let t,n;return t=new HB({props:{dagStructure:e[1],container:e[0]}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,r){const s={};r&2&&(s.dagStructure=i[1]),r&1&&(s.container=i[0]),t.$set(s)},i(i){n||(D(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function oj(e){let t,n,i,r,s,o,a;const u=[sj,rj],l=[];function c(d,h){var p;return(p=d[3])!=null&&p.start?0:1}n=c(e),i=l[n]=u[n](e);let f=!e[2]&&W5(e);return{c(){t=I("div"),i.c(),r=ge(),f&&f.c(),ki(t,"position","relative"),ki(t,"line-height","1"),$(t,"data-component","dag")},m(d,h){L(d,t,h),l[n].m(t,null),R(t,r),f&&f.m(t,null),e[7](t),s=!0,o||(a=ur(window,"resize",e[4]),o=!0)},p(d,[h]){i.p(d,h),d[2]?f&&(Ee(),N(f,1,1,()=>{f=null}),Ce()):f?(f.p(d,h),h&4&&D(f,1)):(f=W5(d),f.c(),D(f,1),f.m(t,null))},i(d){s||(D(i),D(f),s=!0)},o(d){N(i),N(f),s=!1},d(d){d&&O(t),l[n].d(),f&&f.d(),e[7](null),o=!1,a()}}}const aj=100;function uj(e,t,n){var h;let i;zh(e,Ea,p=>n(9,i=p));let{componentData:r}=t;const{data:s}=r;let o,a={};k5(L5,wB((h=i==null?void 0:i.metadata)==null?void 0:h.pathspec,"stepname"));let u,l=!1;const c=()=>{n(2,l=!0),clearTimeout(u),u=setTimeout(()=>{n(2,l=!1)},aj)};function f(p){a=p,n(1,a)}function d(p){jn[p?"unshift":"push"](()=>{o=p,n(0,o)})}return e.$$set=p=>{"componentData"in p&&n(5,r=p.componentData)},[o,a,l,s,c,r,f,d]}class H5 extends _e{constructor(t){super(),ve(this,t,uj,oj,pe,{componentData:5})}}function lj(e){var r;let t,n=(((r=e[0])==null?void 0:r.text)||"")+"",i;return{c(){t=I("h2"),i=ce(n),$(t,"class","title svelte-117s0ws"),$(t,"data-component","title")},m(s,o){L(s,t,o),R(t,i)},p(s,[o]){var a;o&1&&n!==(n=(((a=s[0])==null?void 0:a.text)||"")+"")&&Me(i,n)},i:X,o:X,d(s){s&&O(t)}}}function cj(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class G5 extends _e{constructor(t){super(),ve(this,t,cj,lj,pe,{componentData:0})}}function fj(e){var r;let t,n=(((r=e[0])==null?void 0:r.text)||"")+"",i;return{c(){t=I("p"),i=ce(n),$(t,"class","subtitle svelte-lu9pnn"),$(t,"data-component","subtitle")},m(s,o){L(s,t,o),R(t,i)},p(s,[o]){var a;o&1&&n!==(n=(((a=s[0])==null?void 0:a.text)||"")+"")&&Me(i,n)},i:X,o:X,d(s){s&&O(t)}}}function dj(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class V5 extends _e{constructor(t){super(),ve(this,t,dj,fj,pe,{componentData:0})}}function Y5(e){let t,n;return t=new G5({props:{componentData:{type:"title",text:e[1]}}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,r){const s={};r&2&&(s.componentData={type:"title",text:i[1]}),t.$set(s)},i(i){n||(D(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function X5(e){let t,n;return t=new V5({props:{componentData:{type:"subtitle",text:e[0]}}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.componentData={type:"subtitle",text:i[0]}),t.$set(s)},i(i){n||(D(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function hj(e){let t,n,i,r=e[1]&&Y5(e),s=e[0]&&X5(e);return{c(){t=I("header"),r&&r.c(),n=ge(),s&&s.c(),$(t,"class","container svelte-1ugmt5d"),$(t,"data-component","heading")},m(o,a){L(o,t,a),r&&r.m(t,null),R(t,n),s&&s.m(t,null),i=!0},p(o,[a]){o[1]?r?(r.p(o,a),a&2&&D(r,1)):(r=Y5(o),r.c(),D(r,1),r.m(t,n)):r&&(Ee(),N(r,1,1,()=>{r=null}),Ce()),o[0]?s?(s.p(o,a),a&1&&D(s,1)):(s=X5(o),s.c(),D(s,1),s.m(t,null)):s&&(Ee(),N(s,1,1,()=>{s=null}),Ce())},i(o){i||(D(r),D(s),i=!0)},o(o){N(r),N(s),i=!1},d(o){o&&O(t),r&&r.d(),s&&s.d()}}}function pj(e,t,n){let i,r,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(2,s=o.componentData)},e.$$.update=()=>{e.$$.dirty&4&&n(1,{title:i,subtitle:r}=s,i,(n(0,r),n(2,s)))},[r,i,s]}let Z5=class extends _e{constructor(t){super(),ve(this,t,pj,hj,pe,{componentData:2})}};function K5(e){let t,n;return{c(){t=I("div"),n=ce(e[2]),$(t,"class","label svelte-1x96yvr")},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&4&&Me(n,i[2])},d(i){i&&O(t)}}}function J5(e){let t,n;return{c(){t=I("figcaption"),n=ce(e[1]),$(t,"class","description svelte-1x96yvr")},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&2&&Me(n,i[1])},d(i){i&&O(t)}}}function gj(e){let t,n,i,r,s,o,a,u,l,c=e[2]&&K5(e),f=e[1]&&J5(e);return{c(){t=I("figure"),n=I("div"),i=I("img"),o=ge(),c&&c.c(),a=ge(),f&&f.c(),Ph(i.src,r=e[3])||$(i,"src",r),$(i,"alt",s=e[2]||"image"),$(i,"class","svelte-1x96yvr"),$(n,"class","imageContainer"),$(t,"data-component","image"),$(t,"class","svelte-1x96yvr")},m(d,h){L(d,t,h),R(t,n),R(n,i),R(t,o),c&&c.m(t,null),R(t,a),f&&f.m(t,null),u||(l=ur(t,"click",e[4]),u=!0)},p(d,[h]){h&8&&!Ph(i.src,r=d[3])&&$(i,"src",r),h&4&&s!==(s=d[2]||"image")&&$(i,"alt",s),d[2]?c?c.p(d,h):(c=K5(d),c.c(),c.m(t,a)):c&&(c.d(1),c=null),d[1]?f?f.p(d,h):(f=J5(d),f.c(),f.m(t,null)):f&&(f.d(1),f=null)},i:X,o:X,d(d){d&&O(t),c&&c.d(),f&&f.d(),u=!1,l()}}}function mj(e,t,n){let i,r,s,{componentData:o}=t;const a=()=>Hc.set(o);return e.$$set=u=>{"componentData"in u&&n(0,o=u.componentData)},e.$$.update=()=>{e.$$.dirty&1&&n(3,{src:i,label:r,description:s}=o,i,(n(2,r),n(0,o)),(n(1,s),n(0,o)))},[o,s,r,i,a]}let Q5=class extends _e{constructor(t){super(),ve(this,t,mj,gj,pe,{componentData:0})}};function yj(e){let t,n,i,r,s=e[0].data+"",o,a,u;return{c(){t=I("pre"),n=ce(` +?])[ ]*(?:<>[ ]+)?)<>(?=\\s*:\\s)`.replace(/<>/g,function(){return i}).replace(/<>/g,function(){return"(?:"+r+"|"+s+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o("\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ ]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ ]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?"),lookbehind:!0,alias:"number"},boolean:{pattern:o("false|true","i"),lookbehind:!0,alias:"important"},null:{pattern:o("null|~","i"),lookbehind:!0,alias:"important"},string:{pattern:o(s),lookbehind:!0,greedy:!0},number:{pattern:o("[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)","i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(_e);const Il=[];function V5(e,t=Y){let n;const i=new Set;function r(a){if(pe(e,a)&&(e=a,n)){const l=!Il.length;for(const u of i)u[1](),Il.push(u,e);if(l){for(let u=0;u{i.delete(u),i.size===0&&n&&(n(),n=null)}}return{set:r,update:s,subscribe:o}}const ua=V5(void 0);window.metaflow_card_update=e=>(ua==null||ua.update(t=>{const n={...t};return Object.values(e).forEach(i=>(n==null?void 0:n.components)&&Y5(n.components,i)),n}),!0);const Sz=(e,t)=>{e.data&&(e.data=JSON.parse(JSON.stringify(t.data))),JSON.stringify(t.spec)===JSON.stringify(e.spec)||(e.spec=JSON.parse(JSON.stringify(t.spec)))},Y5=(e,t)=>{const n=e.findIndex(i=>t.id===(i==null?void 0:i.id));n>-1?e[n].type=="vegaChart"?Sz(e[n],t):Object.assign(e[n],t):e.forEach(i=>{var r;(i.type==="section"||i.type==="page")&&((r=i==null?void 0:i.contents)!=null&&r.length)&&Y5(i.contents,t)})},Cz=e=>{try{const t=JSON.parse(atob(window.__MF_DATA__[e]));ua.set(t)}catch{fetch("/card-example.json").then(n=>n.json()).then(n=>{ua.set(n)}).catch(console.error)}},Fc=V5(void 0),X5=e=>{const t={};if(!e)return t;function n(i,r=[]){var s;if(i.type==="page"){const o=[];t[i.title]=o,(s=i==null?void 0:i.contents)==null||s.forEach(a=>n(a,o))}i.type==="section"&&i.title&&r.push(i.title)}return e==null||e.forEach(i=>n(i)),t},io=(e,t)=>e/16,Az=e=>{const t=e.split("/");return{flowname:t[0],runid:t[1],stepname:t==null?void 0:t[2],taskid:t==null?void 0:t[3]}},Fz=(e,t)=>{var n;if(!(!e||!t))return(n=Az(e))==null?void 0:n[t]},Tz=e=>e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth;function Mz(e){let t,n,i,r,s,o,a,l;return{c(){t=Ai("svg"),n=Ai("title"),i=ce("metaflow_logo_horizontal"),r=Ai("g"),s=Ai("g"),o=Ai("g"),a=Ai("path"),l=Ai("path"),C(a,"d","M223.990273,66.33 C223.515273,61.851 222.686273,57.512 221.505273,53.33 C220.325273,49.148 218.795273,45.122 216.916273,41.271 C212.845273,32.921 207.254273,25.587 200.268273,19.422 C199.270273,18.541 198.243273,17.684 197.189273,16.851 C191.255273,12.166 184.481273,8.355 177.253273,5.55 C174.156273,4.347 170.975273,3.33 167.741273,2.508 C161.273273,0.863 154.593273,0 147.943273,0 C141.755273,0 135.332273,0.576 128.687273,1.722 C127.025273,2.01 125.350273,2.332 123.661273,2.69 C120.283273,3.406 116.851273,4.265 113.365273,5.267 C104.650273,7.769 95.6022727,11.161 86.2442727,15.433 C78.7592727,18.851 71.0762727,22.832 63.2072727,27.373 C47.9762727,36.162 35.7372727,44.969 29.3592727,49.791 C29.0692727,50.01 28.7922727,50.221 28.5262727,50.423 C26.1382727,52.244 24.7522727,53.367 24.5662727,53.519 L0.549272727,73.065 C0.191272727,73.356 0.00727272727,73.773 0,74.194 C-0.00372727273,74.403 0.0362727273,74.614 0.120272727,74.811 C0.205272727,75.008 0.334272727,75.189 0.508272727,75.341 L11.7612727,85.195 C12.1692727,85.552 12.7252727,85.651 13.2162727,85.487 C13.3792727,85.432 13.5362727,85.348 13.6762727,85.234 L35.8492727,67.382 C36.0422727,67.224 37.6152727,65.949 40.3252727,63.903 C44.1192727,61.036 50.1422727,56.656 57.7292727,51.711 C62.0642727,48.884 66.9102727,45.873 72.1412727,42.854 C100.864273,26.278 126.367273,17.874 147.943273,17.874 C148.366273,17.874 148.790273,17.892 149.213273,17.902 C149.655273,17.911 150.096273,17.911 150.538273,17.93 C153.769273,18.068 156.995273,18.463 160.170273,19.097 C164.931273,20.049 169.577273,21.542 173.953273,23.524 C178.328273,25.505 182.433273,27.975 186.112273,30.88 C186.771273,31.4 187.406273,31.94 188.035273,32.485 C188.913273,33.245 189.771273,34.023 190.591273,34.83 C191.998273,36.217 193.317273,37.673 194.548273,39.195 C196.395273,41.479 198.042273,43.912 199.480273,46.485 C199.960273,47.342 200.417273,48.216 200.850273,49.105 C201.112273,49.642 201.343273,50.196 201.587273,50.743 C202.231273,52.185 202.834273,53.649 203.354273,55.158 C203.712273,56.198 204.041273,57.255 204.340273,58.326 C205.836273,63.683 206.590273,69.417 206.590273,75.469 C206.590273,81.221 205.892273,86.677 204.541273,91.804 C203.617273,95.308 202.397273,98.662 200.850273,101.833 C200.417273,102.722 199.960273,103.595 199.480273,104.453 C197.562273,107.884 195.275273,111.066 192.636273,113.976 C190.657273,116.159 188.480273,118.189 186.113273,120.058 C184.553273,121.29 182.909273,122.432 181.208273,123.503 C180.313273,124.067 179.400273,124.609 178.470273,125.126 C177.462273,125.688 176.442273,126.232 175.398273,126.737 C166.961273,130.823 157.423273,133.064 147.943273,133.064 C126.367273,133.064 100.864273,124.659 72.1412727,108.084 C70.5382727,107.159 68.4382727,105.886 66.3072727,104.575 C65.0292727,103.788 63.7402727,102.986 62.5412727,102.237 C59.3442727,100.238 56.7882727,98.61 56.7882727,98.61 C61.8362727,93.901 69.3232727,87.465 78.6472727,81.047 C80.0092727,80.11 81.4192727,79.174 82.8572727,78.243 C84.1052727,77.436 85.3712727,76.63 86.6732727,75.835 C88.2042727,74.9 89.7802727,73.981 91.3822727,73.074 C93.0482727,72.131 94.7512727,71.207 96.4902727,70.307 C111.473273,62.55 129.094273,56.602 147.943273,56.602 C151.750273,56.602 157.745273,57.825 162.114273,61.276 C162.300273,61.422 162.489273,61.578 162.677273,61.74 C163.337273,62.305 164.006273,62.966 164.634273,63.78 C164.957273,64.198 165.269273,64.657 165.564273,65.162 C166.006273,65.92 166.409273,66.782 166.750273,67.775 C166.891273,68.185 167.016273,68.627 167.134273,69.083 C167.586273,70.833 167.863273,72.924 167.863273,75.469 C167.863273,78.552 167.460273,80.974 166.824273,82.92 C166.578273,83.674 166.300273,84.363 165.992273,84.983 C165.855273,85.259 165.711273,85.524 165.564273,85.776 C165.376273,86.099 165.178273,86.396 164.977273,86.682 C164.631273,87.175 164.269273,87.618 163.900273,88.018 C163.730273,88.202 163.559273,88.379 163.387273,88.546 C162.962273,88.96 162.534273,89.331 162.114273,89.662 C157.745273,93.112 151.750273,94.337 147.943273,94.337 C144.485273,94.337 140.682273,93.926 136.589273,93.121 C133.860273,92.584 131.003273,91.871 128.033273,90.987 C123.579273,89.662 118.873273,87.952 113.970273,85.872 C113.768273,85.786 113.552273,85.747 113.336273,85.753 C113.122273,85.76 112.908273,85.813 112.713273,85.912 C106.990273,88.816 101.641273,91.995 96.7462727,95.223 C96.6232727,95.304 96.5182727,95.397 96.4302727,95.5 C95.8122727,96.22 96.0172727,97.397 96.9492727,97.822 L102.445273,100.328 C104.606273,101.314 106.737273,102.238 108.835273,103.102 C110.934273,103.966 113.001273,104.77 115.035273,105.511 C118.086273,106.624 121.064273,107.599 123.965273,108.436 C127.834273,109.551 131.567273,110.421 135.157273,111.043 C139.646273,111.82 143.912273,112.211 147.943273,112.211 C148.367273,112.211 148.923273,112.201 149.591273,112.169 C149.925273,112.153 150.287273,112.131 150.674273,112.102 C155.712273,111.724 165.055273,110.114 173.190273,103.691 C173.547273,103.41 173.869273,103.105 174.210273,102.813 C175.324273,101.86 176.381273,100.866 177.333273,99.8 C177.470273,99.648 177.590273,99.485 177.724273,99.331 C181.300273,95.167 183.699273,90.185 184.875273,84.406 C185.444273,81.609 185.737273,78.631 185.737273,75.469 C185.737273,63.315 181.516273,53.82 173.190273,47.247 C167.050273,42.399 160.228273,40.299 155.083273,39.395 C153.892273,39.186 152.790273,39.037 151.809273,38.938 C150.116273,38.766 148.774273,38.727 147.943273,38.727 C133.456273,38.727 118.519273,41.679 103.545273,47.5 C99.1222727,49.22 94.6912727,51.191 90.2702727,53.403 C88.7972727,54.141 87.3242727,54.905 85.8542727,55.696 C83.5092727,56.957 81.1722727,58.303 78.8382727,59.697 C77.3922727,60.562 75.9492727,61.451 74.5082727,62.366 C72.4422727,63.678 70.3802727,65.023 68.3302727,66.437 C63.8372727,69.535 59.7422727,72.63 56.0902727,75.567 C54.8732727,76.547 53.7052727,77.508 52.5882727,78.446 C48.1222727,82.2 44.4752727,85.581 41.7602727,88.226 C38.3032727,91.593 36.3592727,93.766 36.1632727,93.986 L35.8282727,94.362 L32.0332727,98.61 L30.6432727,100.164 C30.4962727,100.329 30.3932727,100.517 30.3312727,100.715 C30.1482727,101.307 30.3472727,101.981 30.8882727,102.368 L37.2812727,106.938 L37.4862727,107.083 L37.6922727,107.228 C39.8732727,108.766 42.0702727,110.277 44.2792727,111.758 C45.8422727,112.807 47.4102727,113.84 48.9832727,114.858 C51.5302727,116.508 54.0902727,118.103 56.6542727,119.665 C57.8412727,120.388 59.0282727,121.101 60.2162727,121.804 C61.2142727,122.394 62.2102727,122.989 63.2072727,123.565 C76.9772727,131.512 90.1802727,137.744 102.748273,142.242 C104.544273,142.884 106.326273,143.491 108.096273,144.063 C111.635273,145.206 115.121273,146.207 118.553273,147.067 C121.986273,147.925 125.364273,148.642 128.687273,149.215 C135.332273,150.362 141.755273,150.938 147.943273,150.938 C154.593273,150.938 161.273273,150.074 167.741273,148.43 C174.209273,146.786 180.465273,144.361 186.265273,141.238 C190.133273,139.156 193.798273,136.764 197.189273,134.087 C200.352273,131.589 203.264273,128.872 205.911273,125.949 C207.677273,124 209.325273,121.96 210.854273,119.831 C211.618273,118.766 212.353273,117.68 213.057273,116.571 C214.466273,114.356 215.753273,112.053 216.916273,109.667 C220.701273,101.906 223.073273,93.439 224.008273,84.406 C224.310273,81.485 224.465273,78.505 224.465273,75.469 C224.465273,72.364 224.306273,69.316 223.990273,66.33"),C(a,"id","Fill-1"),C(a,"fill","#146EE6"),C(l,"d","M758.389273,75.346 C752.632273,111.56 742.681273,122.23 712.102273,122.23 C710.847273,122.23 709.640273,122.207 708.464273,122.17 C708.321273,122.191 708.191273,122.23 708.028273,122.23 L637.994273,122.23 C636.795273,122.23 636.315273,121.632 636.435273,120.311 L650.585273,31.22 C650.704273,30.016 651.424273,29.417 652.623273,29.417 L667.852273,29.417 C669.050273,29.417 669.530273,30.016 669.410273,31.22 L657.659273,105.802 L714.249273,105.802 L714.249273,105.787 C714.410273,105.794 714.568273,105.802 714.741273,105.802 C718.878273,105.802 722.250273,105.351 725.040273,104.313 C726.434273,103.794 727.684273,103.129 728.810273,102.298 C729.373273,101.884 729.905273,101.426 730.410273,100.927 C734.951273,96.431 737.231273,88.43 739.322273,75.346 C739.328273,75.312 739.331273,75.282 739.337273,75.25 C739.642273,73.311 739.896273,71.474 740.130273,69.679 C740.203273,69.116 740.272273,68.557 740.338273,68.008 C740.412273,67.392 740.461273,66.821 740.525273,66.222 C742.136273,49.927 738.622273,44.525 724.454273,44.525 C723.419273,44.525 722.433273,44.554 721.490273,44.613 C708.297273,45.444 703.831273,52.303 700.461273,71.126 C700.220273,72.472 699.984273,73.877 699.752273,75.346 C699.483273,77.027 699.255273,78.6 699.052273,80.115 C698.993273,80.545 698.948273,80.946 698.895273,81.361 C698.757273,82.465 698.638273,83.528 698.540273,84.544 C698.502273,84.943 698.466273,85.334 698.434273,85.72 C698.344273,86.815 698.281273,87.856 698.246273,88.847 C698.238273,89.049 698.224273,89.269 698.219273,89.469 C698.161273,91.88 698.289273,93.972 698.621273,95.782 C698.649273,95.941 698.686273,96.089 698.717273,96.246 C698.874273,96.992 699.067273,97.689 699.301273,98.337 C699.346273,98.464 699.390273,98.594 699.439273,98.718 C700.039273,100.231 700.864273,101.478 701.963273,102.469 C702.263273,102.738 702.586273,102.987 702.925273,103.22 L679.436273,103.22 C679.393273,102.969 679.343273,102.727 679.305273,102.471 L679.304273,102.471 C679.304273,102.467 679.304273,102.462 679.303273,102.459 C679.259273,102.17 679.236273,101.854 679.198273,101.558 C679.083273,100.634 678.995273,99.671 678.934273,98.674 C678.908273,98.258 678.879273,97.845 678.862273,97.419 C678.816273,96.174 678.804273,94.876 678.832273,93.518 C678.840273,93.114 678.861273,92.69 678.876273,92.276 C678.920273,91.042 678.991273,89.765 679.092273,88.441 C679.117273,88.109 679.134273,87.79 679.162273,87.452 C679.299273,85.836 679.483273,84.137 679.698273,82.382 C679.750273,81.957 679.807273,81.518 679.863273,81.084 C680.104273,79.238 680.369273,77.344 680.687273,75.346 C681.046273,73.067 681.423273,70.889 681.819273,68.808 C687.040273,41.397 695.809273,30.748 717.267273,28.554 C720.250273,28.25 723.472273,28.103 726.971273,28.103 C726.972273,28.103 726.972273,28.103 726.972273,28.103 C747.994273,28.103 757.680273,33.202 759.811273,48.236 C760.779273,55.067 760.187273,63.953 758.389273,75.346 Z M894.023273,31.336 L866.923273,108.56 C863.472273,118.182 861.113273,121.41 854.499273,122.41 C852.379273,122.733 849.831273,122.828 846.659273,122.828 C831.670273,122.828 830.350273,121.267 829.392273,108.56 L825.794273,63.232 L825.794273,63.231 L807.928273,108.56 C804.255273,117.613 802.201273,120.996 795.961273,122.202 C793.442273,122.687 790.260273,122.829 785.985273,122.829 C772.914273,122.829 770.756273,121.267 770.396273,108.56 L767.638273,31.337 C767.638273,29.899 768.238273,29.417 769.557273,29.417 L785.385273,29.417 C786.464273,29.417 786.704273,29.899 786.824273,31.337 L788.895273,100.572 L788.895273,100.571 C789.054273,103.091 789.563273,103.641 791.021273,103.641 C792.939273,103.641 793.419273,103.042 794.618273,100.043 L820.758273,34.576 C821.358273,33.132 822.437273,32.657 823.516273,32.657 L837.665273,32.657 C838.519273,32.657 839.279273,32.977 839.626273,33.817 C839.718273,34.038 839.799273,34.274 839.824273,34.576 L845.220273,100.043 C845.460273,103.042 845.819273,103.641 847.738273,103.641 C849.297273,103.641 849.896273,103.042 850.976273,100.043 L874.838273,31.336 C875.317273,29.898 875.677273,29.417 876.756273,29.417 L892.584273,29.417 C893.903273,29.417 894.383273,29.898 894.023273,31.336 Z M362.708273,31.219 L357.192273,120.311 C357.192273,121.632 356.353273,122.23 355.154273,122.23 L339.926273,122.23 C338.726273,122.23 338.366273,121.632 338.366273,120.311 L342.324273,62.756 L311.986273,117.551 C311.386273,118.749 310.428273,119.348 309.229273,119.348 L297.837273,119.348 C296.758273,119.348 296.038273,118.749 295.560273,117.551 L282.851273,62.767 L282.848273,62.755 L268.339273,120.31 C268.212273,121.009 267.974273,121.492 267.612273,121.807 C267.288273,122.085 266.865273,122.23 266.301273,122.23 L251.073273,122.23 C249.874273,122.23 249.273273,121.632 249.514273,120.31 L272.296273,31.336 C272.537273,30.138 272.897273,29.417 274.095273,29.417 L288.605273,29.417 C291.236273,29.417 292.726273,29.895 293.682273,31.379 C294.120273,32.059 294.457273,32.928 294.720273,34.095 L307.790273,92.489 L339.326273,34.095 C341.485273,30.256 343.043273,29.299 346.880273,29.299 L361.389273,29.299 C362.376273,29.299 362.682273,30.684 362.682273,30.684 C362.682273,30.684 362.708273,31.029 362.708273,31.219 Z M501.706273,31.219 L499.667273,44.049 C499.547273,45.246 498.708273,45.845 497.509273,45.845 L472.448273,45.845 L460.696273,120.31 C460.457273,121.632 459.738273,122.23 458.538273,122.23 L443.309273,122.23 C442.111273,122.23 441.631273,121.632 441.870273,120.31 L453.622273,45.845 L394.820273,45.845 L391.224273,68.507 L391.224273,68.508 L430.555273,68.508 C431.754273,68.508 432.353273,69.106 432.234273,70.31 L430.196273,82.542 C430.076273,83.738 429.236273,84.338 428.038273,84.338 L388.706273,84.338 L385.349273,105.801 L428.397273,105.801 C429.596273,105.801 430.076273,106.4 429.955273,107.597 L427.797273,120.428 C427.676273,121.632 426.958273,122.23 425.759273,122.23 L365.683273,122.23 C364.484273,122.23 364.004273,121.632 364.124273,120.31 L378.273273,31.219 C378.393273,30.015 379.112273,29.417 380.313273,29.417 L500.147273,29.417 C501.346273,29.417 501.826273,30.015 501.706273,31.219 Z M629.471273,70.426 L627.433273,82.659 C627.313273,83.856 626.473273,84.454 625.275273,84.454 L588.223273,84.454 L582.466273,120.311 C582.347273,121.632 581.627273,122.23 580.428273,122.23 L565.200273,122.23 C564.001273,122.23 563.522273,121.632 563.640273,120.311 L577.790273,31.219 C577.910273,30.016 578.629273,29.417 579.828273,29.417 L643.004273,29.417 C644.202273,29.417 644.802273,30.016 644.682273,31.219 L642.644273,44.05 C642.403273,45.247 641.685273,45.846 640.486273,45.846 L594.337273,45.846 L590.741273,68.631 L627.793273,68.631 C628.991273,68.631 629.592273,69.23 629.471273,70.426 Z M388.706273,84.338 L388.712273,84.338 L388.309273,86.876 L388.706273,84.338 Z M510.726273,79.783 L524.396273,48.006 C525.036273,46.466 525.443273,45.589 525.990273,45.096 C526.465273,44.667 527.044273,44.525 527.993273,44.525 C530.391273,44.525 530.391273,45.124 530.751273,48.006 L534.348273,79.783 L510.726273,79.783 Z M542.334273,29.886 C539.756273,28.905 536.043273,28.702 530.511273,28.702 C516.601273,28.702 513.963273,30.016 508.208273,43.087 L474.633273,120.311 C474.154273,121.749 474.513273,122.23 475.832273,122.23 L491.060273,122.23 C492.259273,122.23 492.500273,121.749 493.099273,120.311 L504.011273,95.372 L536.026273,95.372 L539.024273,120.311 C539.144273,121.749 539.144273,122.23 540.344273,122.23 L555.572273,122.23 C556.891273,122.23 557.490273,121.749 557.490273,120.311 L548.617273,43.087 C547.658273,35.042 546.460273,31.458 542.334273,29.886 L542.334273,29.886 Z"),C(l,"id","Fill-2"),C(l,"fill","#333333"),C(o,"id","metaflow_logo_horizontal"),C(o,"transform","translate(92.930727, 93.190000)"),C(s,"id","Metaflow_Logo_Horizontal_TwoColor_Dark_RGB"),C(s,"transform","translate(-92.000000, -93.000000)"),C(r,"id","Page-1"),C(r,"stroke","none"),C(r,"stroke-width","1"),C(r,"fill","none"),C(r,"fill-rule","evenodd"),C(t,"xmlns","http://www.w3.org/2000/svg"),C(t,"xmlns:xlink","http://www.w3.org/1999/xlink"),C(t,"width","896px"),C(t,"height","152px"),C(t,"viewBox","0 0 896 152"),C(t,"version","1.1")},m(u,c){L(u,t,c),R(t,n),R(n,i),R(t,r),R(r,s),R(s,o),R(o,a),R(o,l)},d(u){u&&O(t)}}}function Dz(e){let t,n,i;return{c(){t=Ai("svg"),n=Ai("path"),i=Ai("path"),C(n,"fill-rule","evenodd"),C(n,"clip-rule","evenodd"),C(n,"d","M223.991 66.33C223.516 61.851 222.687 57.512 221.506 53.33C220.326 49.148 218.796 45.122 216.917 41.271C212.846 32.921 207.255 25.587 200.269 19.422C199.271 18.541 198.244 17.684 197.19 16.851C191.256 12.166 184.482 8.355 177.254 5.55C174.157 4.347 170.976 3.33 167.742 2.508C161.274 0.863 154.594 0 147.944 0C141.756 0 135.333 0.576 128.688 1.722C127.026 2.01 125.351 2.332 123.662 2.69C120.284 3.406 116.852 4.265 113.366 5.267C104.651 7.769 95.6025 11.161 86.2445 15.433C78.7595 18.851 71.0765 22.832 63.2075 27.373C47.9765 36.162 35.7375 44.969 29.3595 49.791C29.0695 50.01 28.7925 50.221 28.5265 50.423C26.1385 52.244 24.7525 53.367 24.5665 53.519L0.549511 73.065C0.191511 73.356 0.00751099 73.773 0.000238261 74.194C-0.00348901 74.403 0.036511 74.614 0.120511 74.811C0.205511 75.008 0.334511 75.189 0.508511 75.341L11.7615 85.195C12.1695 85.552 12.7255 85.651 13.2165 85.487C13.3795 85.432 13.5365 85.348 13.6765 85.234L35.8495 67.382C36.0425 67.224 37.6155 65.949 40.3255 63.903C44.1195 61.036 50.1425 56.656 57.7295 51.711C62.0645 48.884 66.9105 45.873 72.1415 42.854C100.865 26.278 126.368 17.874 147.944 17.874C148.367 17.874 148.791 17.892 149.214 17.902C149.656 17.911 150.097 17.911 150.539 17.93C153.77 18.068 156.996 18.463 160.171 19.097C164.932 20.049 169.578 21.542 173.954 23.524C178.329 25.505 182.434 27.975 186.113 30.88C186.772 31.4 187.407 31.94 188.036 32.485C188.914 33.245 189.772 34.023 190.592 34.83C191.999 36.217 193.318 37.673 194.549 39.195C196.396 41.479 198.043 43.912 199.481 46.485C199.961 47.342 200.418 48.216 200.851 49.105C201.113 49.642 201.344 50.196 201.588 50.743C202.232 52.185 202.835 53.649 203.355 55.158C203.713 56.198 204.042 57.255 204.341 58.326C205.837 63.683 206.591 69.417 206.591 75.469C206.591 81.221 205.893 86.677 204.542 91.804C203.618 95.308 202.398 98.662 200.851 101.833C200.418 102.722 199.961 103.595 199.481 104.453C197.563 107.884 195.276 111.066 192.637 113.976C190.658 116.159 188.481 118.189 186.114 120.058C184.554 121.29 182.91 122.432 181.209 123.503C180.314 124.067 179.401 124.609 178.471 125.126C177.463 125.688 176.443 126.232 175.399 126.737C166.962 130.823 157.424 133.064 147.944 133.064C126.368 133.064 100.865 124.659 72.1415 108.084C70.5385 107.159 68.4385 105.886 66.3075 104.575C65.0295 103.788 63.7405 102.986 62.5415 102.237C59.3445 100.238 56.7885 98.61 56.7885 98.61C61.8365 93.901 69.3235 87.465 78.6475 81.047C80.0095 80.11 81.4195 79.174 82.8575 78.243C84.1055 77.436 85.3715 76.63 86.6735 75.835C88.2045 74.9 89.7805 73.981 91.3825 73.074C93.0485 72.131 94.7515 71.207 96.4905 70.307C111.474 62.55 129.095 56.602 147.944 56.602C151.751 56.602 157.746 57.825 162.115 61.276C162.301 61.422 162.49 61.578 162.678 61.74C163.338 62.305 164.007 62.966 164.635 63.78C164.958 64.198 165.27 64.657 165.565 65.162C166.007 65.92 166.41 66.782 166.751 67.775C166.892 68.185 167.017 68.627 167.135 69.083C167.587 70.833 167.864 72.924 167.864 75.469C167.864 78.552 167.461 80.974 166.825 82.92C166.579 83.674 166.301 84.363 165.993 84.983C165.856 85.259 165.712 85.524 165.565 85.776C165.377 86.099 165.179 86.396 164.978 86.682C164.632 87.175 164.27 87.618 163.901 88.018C163.731 88.202 163.56 88.379 163.388 88.546C162.963 88.96 162.535 89.331 162.115 89.662C157.746 93.112 151.751 94.337 147.944 94.337C144.486 94.337 140.683 93.926 136.59 93.121C133.861 92.584 131.004 91.871 128.034 90.987C123.58 89.662 118.874 87.952 113.971 85.872C113.769 85.786 113.553 85.747 113.337 85.753C113.123 85.76 112.909 85.813 112.714 85.912C106.991 88.816 101.642 91.995 96.7465 95.223C96.6235 95.304 96.5185 95.397 96.4305 95.5C95.8125 96.22 96.0175 97.397 96.9495 97.822L102.446 100.328C104.607 101.314 106.738 102.238 108.836 103.102C110.935 103.966 113.002 104.77 115.036 105.511C118.087 106.624 121.065 107.599 123.966 108.436C127.835 109.551 131.568 110.421 135.158 111.043C139.647 111.82 143.913 112.211 147.944 112.211C148.368 112.211 148.924 112.201 149.592 112.169C149.926 112.153 150.288 112.131 150.675 112.102C155.713 111.724 165.056 110.114 173.191 103.691C173.548 103.41 173.87 103.105 174.211 102.813C175.325 101.86 176.382 100.866 177.334 99.8C177.471 99.648 177.591 99.485 177.725 99.331C181.301 95.167 183.7 90.185 184.876 84.406C185.445 81.609 185.738 78.631 185.738 75.469C185.738 63.315 181.517 53.82 173.191 47.247C167.051 42.399 160.229 40.299 155.084 39.395C153.893 39.186 152.791 39.037 151.81 38.938C150.117 38.766 148.775 38.727 147.944 38.727C133.457 38.727 118.52 41.679 103.546 47.5C99.1225 49.22 94.6915 51.191 90.2705 53.403C88.7975 54.141 87.3245 54.905 85.8545 55.696C83.5095 56.957 81.1725 58.303 78.8385 59.697C77.3925 60.562 75.9495 61.451 74.5085 62.366C72.4425 63.678 70.3805 65.023 68.3305 66.437C63.8375 69.535 59.7425 72.63 56.0905 75.567C54.8735 76.547 53.7055 77.508 52.5885 78.446C48.1225 82.2 44.4755 85.581 41.7605 88.226C38.3035 91.593 36.3595 93.766 36.1635 93.986L35.8285 94.362L32.0335 98.61L30.6435 100.164C30.4965 100.329 30.3935 100.517 30.3315 100.715C30.1485 101.307 30.3475 101.981 30.8885 102.368L37.2815 106.938L37.4865 107.083L37.6925 107.228C39.8735 108.766 42.0705 110.277 44.2795 111.758C45.8425 112.807 47.4105 113.84 48.9835 114.858C51.5305 116.508 54.0905 118.103 56.6545 119.665C57.8415 120.388 59.0285 121.101 60.2165 121.804C61.2145 122.394 62.2105 122.989 63.2075 123.565C76.9775 131.512 90.1805 137.744 102.749 142.242C104.545 142.884 106.327 143.491 108.097 144.063C111.636 145.206 115.122 146.207 118.554 147.067C121.987 147.925 125.365 148.642 128.688 149.215C135.333 150.362 141.756 150.938 147.944 150.938C154.594 150.938 161.274 150.074 167.742 148.43C174.21 146.786 180.466 144.361 186.266 141.238C190.134 139.156 193.799 136.764 197.19 134.087C200.353 131.589 203.265 128.872 205.912 125.949C207.678 124 209.326 121.96 210.855 119.831C211.619 118.766 212.354 117.68 213.058 116.571C214.467 114.356 215.754 112.053 216.917 109.667C220.702 101.906 223.074 93.439 224.009 84.406C224.311 81.485 224.466 78.505 224.466 75.469C224.466 72.364 224.307 69.316 223.991 66.33Z"),C(n,"fill","#146EE6"),C(i,"fill-rule","evenodd"),C(i,"clip-rule","evenodd"),C(i,"d","M758.39 75.346C752.633 111.56 742.682 122.23 712.103 122.23C710.848 122.23 709.641 122.207 708.465 122.17C708.322 122.191 708.192 122.23 708.029 122.23H637.995C636.796 122.23 636.316 121.632 636.436 120.311L650.586 31.22C650.705 30.016 651.425 29.417 652.624 29.417H667.853C669.051 29.417 669.531 30.016 669.411 31.22L657.66 105.802H714.25V105.787C714.411 105.794 714.569 105.802 714.742 105.802C718.879 105.802 722.251 105.351 725.041 104.313C726.435 103.794 727.685 103.129 728.811 102.298C729.374 101.884 729.906 101.426 730.411 100.927C734.952 96.431 737.232 88.43 739.323 75.346C739.329 75.312 739.332 75.282 739.338 75.25C739.643 73.311 739.896 71.474 740.13 69.679C740.203 69.116 740.273 68.557 740.339 68.008C740.413 67.392 740.462 66.821 740.526 66.222C742.137 49.927 738.623 44.525 724.455 44.525C723.42 44.525 722.434 44.554 721.491 44.613C708.298 45.444 703.831 52.303 700.461 71.126C700.22 72.472 699.985 73.877 699.753 75.346C699.484 77.027 699.255 78.6 699.052 80.115C698.993 80.545 698.949 80.946 698.896 81.361C698.758 82.465 698.639 83.528 698.541 84.544C698.503 84.943 698.467 85.334 698.435 85.72C698.345 86.815 698.282 87.856 698.247 88.847C698.239 89.049 698.225 89.269 698.22 89.469C698.162 91.88 698.29 93.972 698.622 95.782C698.65 95.941 698.687 96.089 698.718 96.246C698.875 96.992 699.068 97.689 699.302 98.337C699.347 98.464 699.391 98.594 699.44 98.718C700.04 100.231 700.865 101.478 701.964 102.469C702.264 102.738 702.587 102.987 702.926 103.22H679.437C679.394 102.969 679.344 102.727 679.306 102.471H679.305C679.305 102.467 679.305 102.462 679.304 102.459C679.26 102.17 679.237 101.854 679.199 101.558C679.084 100.634 678.996 99.671 678.935 98.674C678.909 98.258 678.879 97.845 678.862 97.419C678.816 96.174 678.805 94.876 678.833 93.518C678.841 93.114 678.862 92.69 678.877 92.276C678.921 91.042 678.992 89.765 679.093 88.441C679.118 88.109 679.135 87.79 679.163 87.452C679.3 85.836 679.484 84.137 679.699 82.382C679.751 81.957 679.808 81.518 679.864 81.084C680.105 79.238 680.37 77.344 680.688 75.346C681.046 73.067 681.424 70.889 681.82 68.808C687.041 41.397 695.81 30.748 717.268 28.554C720.251 28.25 723.472 28.103 726.971 28.103C726.972 28.103 726.973 28.103 726.973 28.103C747.995 28.103 757.681 33.202 759.812 48.236C760.78 55.067 760.188 63.953 758.39 75.346ZM894.023 31.336L866.924 108.56C863.473 118.182 861.114 121.41 854.5 122.41C852.38 122.733 849.832 122.828 846.66 122.828C831.671 122.828 830.351 121.267 829.393 108.56L825.794 63.232V63.231L807.929 108.56C804.256 117.613 802.201 120.996 795.961 122.202C793.442 122.687 790.261 122.829 785.986 122.829C772.915 122.829 770.757 121.267 770.397 108.56L767.638 31.337C767.638 29.899 768.238 29.417 769.557 29.417H785.385C786.464 29.417 786.705 29.899 786.825 31.337L788.896 100.572V100.571C789.055 103.091 789.564 103.641 791.022 103.641C792.94 103.641 793.42 103.042 794.619 100.043L820.759 34.576C821.359 33.132 822.438 32.657 823.517 32.657H837.666C838.52 32.657 839.28 32.977 839.627 33.817C839.719 34.038 839.8 34.274 839.825 34.576L845.221 100.043C845.461 103.042 845.82 103.641 847.739 103.641C849.298 103.641 849.897 103.042 850.977 100.043L874.839 31.336C875.318 29.898 875.678 29.417 876.757 29.417H892.585C893.904 29.417 894.383 29.898 894.023 31.336ZM362.709 31.219L357.193 120.311C357.193 121.632 356.354 122.23 355.155 122.23H339.927C338.727 122.23 338.367 121.632 338.367 120.311L342.325 62.756L311.987 117.551C311.387 118.749 310.429 119.348 309.23 119.348H297.838C296.759 119.348 296.039 118.749 295.561 117.551L282.852 62.767L282.849 62.755L268.34 120.31C268.213 121.009 267.975 121.492 267.613 121.807C267.289 122.085 266.866 122.23 266.302 122.23H251.074C249.875 122.23 249.274 121.632 249.515 120.31L272.297 31.336C272.538 30.138 272.898 29.417 274.096 29.417H288.606C291.237 29.417 292.727 29.895 293.683 31.379C294.121 32.059 294.458 32.928 294.721 34.095L307.791 92.489L339.327 34.095C341.486 30.256 343.044 29.299 346.881 29.299H361.39C362.377 29.299 362.683 30.684 362.683 30.684C362.683 30.684 362.709 31.029 362.709 31.219ZM501.707 31.219L499.668 44.049C499.548 45.246 498.709 45.845 497.51 45.845H472.449L460.697 120.31C460.458 121.632 459.739 122.23 458.539 122.23H443.31C442.112 122.23 441.632 121.632 441.871 120.31L453.623 45.845H394.821L391.225 68.507V68.508H430.556C431.755 68.508 432.354 69.106 432.235 70.31L430.197 82.542C430.077 83.738 429.237 84.338 428.039 84.338H388.707L385.35 105.801H428.398C429.597 105.801 430.077 106.4 429.956 107.597L427.798 120.428C427.677 121.632 426.959 122.23 425.76 122.23H365.684C364.485 122.23 364.005 121.632 364.125 120.31L378.274 31.219C378.394 30.015 379.113 29.417 380.314 29.417H500.148C501.347 29.417 501.827 30.015 501.707 31.219ZM629.471 70.426L627.434 82.659C627.314 83.856 626.474 84.454 625.276 84.454H588.224L582.466 120.311C582.347 121.632 581.628 122.23 580.429 122.23H565.201C564.002 122.23 563.523 121.632 563.641 120.311L577.791 31.219C577.911 30.016 578.629 29.417 579.828 29.417H643.005C644.203 29.417 644.802 30.016 644.682 31.219L642.645 44.05C642.404 45.247 641.686 45.846 640.487 45.846H594.338L590.742 68.631H627.794C628.992 68.631 629.592 69.23 629.471 70.426ZM388.707 84.338H388.713L388.31 86.876L388.707 84.338ZM510.727 79.783L524.397 48.006C525.037 46.466 525.444 45.589 525.991 45.096C526.466 44.667 527.045 44.525 527.994 44.525C530.392 44.525 530.392 45.124 530.752 48.006L534.349 79.783H510.727ZM542.335 29.886C539.757 28.905 536.044 28.702 530.512 28.702C516.602 28.702 513.964 30.016 508.209 43.087L474.634 120.311C474.155 121.749 474.514 122.23 475.833 122.23H491.061C492.26 122.23 492.501 121.749 493.1 120.311L504.012 95.372H536.026L539.025 120.311C539.145 121.749 539.145 122.23 540.345 122.23H555.573C556.892 122.23 557.491 121.749 557.491 120.311L548.617 43.087C547.658 35.042 546.461 31.458 542.335 29.886Z"),C(i,"fill","white"),C(t,"width","895"),C(t,"height","151"),C(t,"viewBox","0 0 895 151"),C(t,"fill","none"),C(t,"xmlns","http://www.w3.org/2000/svg")},m(r,s){L(r,t,s),R(t,n),R(t,i)},d(r){r&&O(t)}}}function Nz(e){let t;function n(s,o){return s[0]?Dz:Mz}let i=n(e),r=i(e);return{c(){r.c(),t=De()},m(s,o){r.m(s,o),L(s,t,o)},p(s,[o]){i!==(i=n(s))&&(r.d(1),r=i(s),r&&(r.c(),r.m(t.parentNode,t)))},i:Y,o:Y,d(s){s&&O(t),r.d(s)}}}function Rz(e,t,n){let{light:i=!1}=t;return e.$$set=r=>{"light"in r&&n(0,i=r.light)},[i]}class Oz extends ve{constructor(t){super(),be(this,t,Rz,Nz,pe,{light:0})}}function Lz(e){let t,n,i,r,s,o;r=new Oz({});const a=e[1].default,l=ht(a,e,e[0],null);return{c(){t=I("aside"),n=I("div"),i=I("div"),he(r.$$.fragment),s=ge(),l&&l.c(),C(i,"class","logoContainer"),C(t,"class","svelte-1okdv0e")},m(u,c){L(u,t,c),R(t,n),R(n,i),fe(r,i,null),R(n,s),l&&l.m(n,null),o=!0},p(u,[c]){l&&l.p&&(!o||c&1)&>(l,a,u,u[0],o?pt(a,u[0],c,null):mt(u[0]),null)},i(u){o||(T(r.$$.fragment,u),T(l,u),o=!0)},o(u){N(r.$$.fragment,u),N(l,u),o=!1},d(u){u&&O(t),de(r),l&&l.d(u)}}}function Iz(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class Pz extends ve{constructor(t){super(),be(this,t,Iz,Lz,pe,{})}}function Z5(e){let t,n;return{c(){t=I("td"),n=ce(e[0]),C(t,"class","idCell svelte-pt8vzv"),C(t,"data-component","artifact-row")},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&1&&Me(n,i[0])},d(i){i&&O(t)}}}function zz(e){let t,n,i,r,s=e[1].data+"",o,a,l=e[0]!==null&&Z5(e);return{c(){t=I("tr"),l&&l.c(),n=ge(),i=I("td"),r=I("code"),o=ce(s),C(r,"class","mono"),C(i,"class","codeCell svelte-pt8vzv"),C(i,"colspan",a=e[0]===null?2:1),C(i,"data-component","artifact-row")},m(u,c){L(u,t,c),l&&l.m(t,null),R(t,n),R(t,i),R(i,r),R(r,o),e[3](r)},p(u,[c]){u[0]!==null?l?l.p(u,c):(l=Z5(u),l.c(),l.m(t,n)):l&&(l.d(1),l=null),c&2&&s!==(s=u[1].data+"")&&Me(o,s),c&1&&a!==(a=u[0]===null?2:1)&&C(i,"colspan",a)},i:Y,o:Y,d(u){u&&O(t),l&&l.d(),e[3](null)}}}function Bz(e,t,n){let{id:i}=t,{artifact:r}=t,s;function o(){var l;s&&!s.classList.contains("language-python")&&typeof window<"u"&&((l=window==null?void 0:window.Prism)==null||l.highlightElement(s))}function a(l){Nn[l?"unshift":"push"](()=>{s=l,n(2,s)})}return e.$$set=l=>{"id"in l&&n(0,i=l.id),"artifact"in l&&n(1,r=l.artifact)},e.$$.update=()=>{e.$$.dirty&4&&s&&o()},[i,r,s,a]}class jz extends ve{constructor(t){super(),be(this,t,Bz,zz,pe,{id:0,artifact:1})}}function K5(e,t,n){const i=e.slice();return i[2]=t[n],i}function J5(e){let t,n;return t=new jz({props:{id:e[2].name,artifact:e[2]}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p:Y,i(i){n||(T(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function Uz(e){let t,n,i,r=Pe(e[0]),s=[];for(let a=0;aN(s[a],1,1,()=>{s[a]=null});return{c(){t=I("div"),n=I("table");for(let a=0;a{if(s.name&&o.name){if(s.name>o.name)return 1;if(s.name{"componentData"in s&&n(1,i=s.componentData)},[r,i]}class Q5 extends ve{constructor(t){super(),be(this,t,qz,Uz,pe,{componentData:1})}}function Wz(e){let t,n,i;return{c(){t=I("div"),n=ge(),i=I("div"),C(t,"class","path topLeft svelte-19jpdwh"),C(i,"class","path bottomRight svelte-19jpdwh")},m(r,s){L(r,t,s),L(r,n,s),L(r,i,s)},d(r){r&&(O(t),O(n),O(i))}}}function Hz(e){let t;return{c(){t=I("div"),C(t,"class","path straightLine svelte-19jpdwh")},m(n,i){L(n,t,i)},d(n){n&&O(t)}}}function Gz(e){let t;return{c(){t=I("div"),C(t,"class","path loop svelte-19jpdwh")},m(n,i){L(n,t,i)},d(n){n&&O(t)}}}function Vz(e){let t;function n(s,o){return s[6]?Gz:s[5]?Hz:Wz}let i=n(e),r=i(e);return{c(){t=I("div"),r.c(),C(t,"class","connectorwrapper svelte-19jpdwh"),fi(t,"top",e[1]+"rem"),fi(t,"left",e[0]+"rem"),fi(t,"width",e[3]+"rem"),fi(t,"height",e[4]+"rem"),wt(t,"flip",e[2])},m(s,o){L(s,t,o),r.m(t,null)},p(s,[o]){i!==(i=n(s))&&(r.d(1),r=i(s),r&&(r.c(),r.m(t,null))),o&2&&fi(t,"top",s[1]+"rem"),o&1&&fi(t,"left",s[0]+"rem"),o&8&&fi(t,"width",s[3]+"rem"),o&16&&fi(t,"height",s[4]+"rem"),o&4&&wt(t,"flip",s[2])},i:Y,o:Y,d(s){s&&O(t),r.d()}}}const ca=.5;function Yz(e,t,n){let{top:i=0}=t,{left:r=0}=t,{bottom:s=0}=t,{right:o=0}=t,a,l,u,c=!1,f=!1;return e.$$set=d=>{"top"in d&&n(1,i=d.top),"left"in d&&n(0,r=d.left),"bottom"in d&&n(8,s=d.bottom),"right"in d&&n(7,o=d.right)},e.$$.update=()=>{e.$$.dirty&415&&(n(2,a=o-r<0),n(3,l=Math.abs(o-r)),l<=ca?(n(3,l=ca),n(5,c=!0),n(0,r-=ca/2)):(a?(n(0,r+=ca/2),n(7,o-=ca/2)):(n(0,r-=ca/2),n(7,o+=ca/2)),n(3,l=Math.abs(o-r))),n(4,u=s-i),u<0&&(n(6,f=!0),n(4,u=5.5),n(3,l=10.25)))},[r,i,a,l,u,c,f,o,s]}class Xz extends ve{constructor(t){super(),be(this,t,Yz,Vz,pe,{top:1,left:0,bottom:8,right:7})}}function e6(e,t,n){const i=e.slice();return i[3]=t[n],i}function t6(e){let t,n;return t=new Xz({props:{top:io(e[3].top),left:io(e[3].left),bottom:io(e[3].bottom),right:io(e[3].right)}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.top=io(i[3].top)),r&1&&(s.left=io(i[3].left)),r&1&&(s.bottom=io(i[3].bottom)),r&1&&(s.right=io(i[3].right)),t.$set(s)},i(i){n||(T(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function Zz(e){let t,n,i=Pe(e[0]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{"dagStructure"in o&&n(1,i=o.dagStructure),"container"in o&&n(2,r=o.container)},e.$$.update=()=>{if(e.$$.dirty&7&&(n(0,s=[]),r)){const o=r.getBoundingClientRect(),a=o.top,l=o.left;Object.values(i).forEach(u=>{var f;const c=u.node.getBoundingClientRect();(f=u.connections)==null||f.forEach(d=>{const h=i[d];if(!h){console.warn("Connection node not found:",d);return}const p=h.node.getBoundingClientRect(),g={top:c.bottom-a,left:c.left-l+c.width/2,bottom:p.top-a,right:p.left-l+p.width/2};n(0,s=[...s,g])})})}},[s,i,r]}class Jz extends ve{constructor(t){super(),be(this,t,Kz,Zz,pe,{dagStructure:1,container:2})}}const n6="currentStep";function i6(e,t,n){const i=e.slice();return i[16]=t[n],i[18]=n,i}function r6(e){let t,n,i;return{c(){t=I("div"),n=ce("x"),i=ce(e[6]),C(t,"class","levelstoshow svelte-117ceti")},m(r,s){L(r,t,s),R(t,n),R(t,i)},p(r,s){s&64&&Me(i,r[6])},d(r){r&&O(t)}}}function s6(e){let t,n;return{c(){t=I("div"),C(t,"class",n="level rectangle "+e[16]+" svelte-117ceti"),fi(t,"z-index",(e[18]+1)*-1),fi(t,"top",(e[18]+1)*o6+"px"),fi(t,"left",(e[18]+1)*o6+"px")},m(i,r){L(i,t,r)},p(i,r){r&128&&n!==(n="level rectangle "+i[16]+" svelte-117ceti")&&C(t,"class",n)},d(i){i&&O(t)}}}function Qz(e){let t,n,i,r,s,o,a,l,u=e[2].doc+"",c,f,d,h=e[6]&&r6(e),p=Pe(e[7]),g=[];for(let m=0;m1&&(c=new Intl.NumberFormat().format(r.num_possible_tasks)),s=r.num_possible_tasks-1,Object.keys(f).forEach(v=>{const _=Number.parseInt(v);r.num_possible_tasks&&r.num_possible_tasks>_&&n(11,s=f[_])})):s*=eB,s>0&&(d=new Array(s).fill("")),d=d.map((v,_)=>{if(r.num_possible_tasks){const x=r.num_failed??0,k=r.successful_tasks??0;return(x-1)/r.num_possible_tasks>=(_+1)/d.length?"error":(x+k)/r.num_possible_tasks>=(_+1)/d.length?"success":"running"}return""});const h=W5(n6),p=i===h;r.failed||r.num_failed?l=!0:(r.num_possible_tasks??0)>(r.successful_tasks??0)?u=!0:r.num_possible_tasks&&r.num_possible_tasks===r.successful_tasks&&(a=!0);let g,m=!1;no(()=>{n(9,m=Tz(g))});function y(v){Nn[v?"unshift":"push"](()=>{g=v,n(8,g)})}function b(v){Nn[v?"unshift":"push"](()=>{o=v,n(0,o)})}return e.$$set=v=>{"name"in v&&n(1,i=v.name),"step"in v&&n(2,r=v.step),"numLevels"in v&&n(11,s=v.numLevels),"el"in v&&n(0,o=v.el)},[o,i,r,a,l,u,c,d,g,m,p,s,y,b]}let nB=class extends ve{constructor(t){super(),be(this,t,tB,Qz,pe,{name:1,step:2,numLevels:11,el:0})}};function a6(e,t,n){const i=e.slice();return i[15]=t[n],i}function iB(e){let t,n,i,r,s,o,a;function l(h){e[13](h)}let u={name:e[2],numLevels:e[5],step:e[9]};e[7]!==void 0&&(u.el=e[7]),n=new nB({props:u}),Nn.push(()=>Bm(n,"el",l));let c=e[10]&&rB(e),f=e[9].box_ends&&lB(e),d=e[4]&&e[4]!==e[3]&&e[2]===e[3]&&u6(e);return{c(){t=I("div"),he(n.$$.fragment),r=ge(),c&&c.c(),s=ge(),f&&f.c(),o=ge(),d&&d.c(),C(t,"class","stepwrapper svelte-18aex7a")},m(h,p){L(h,t,p),fe(n,t,null),R(t,r),c&&c.m(t,null),R(t,s),f&&f.m(t,null),R(t,o),d&&d.m(t,null),a=!0},p(h,p){const g={};p&4&&(g.name=h[2]),p&32&&(g.numLevels=h[5]),!i&&p&128&&(i=!0,g.el=h[7],Pm(()=>i=!1)),n.$set(g),h[10]&&c.p(h,p),h[9].box_ends&&f.p(h,p),h[4]&&h[4]!==h[3]&&h[2]===h[3]?d?(d.p(h,p),p&28&&T(d,1)):(d=u6(h),d.c(),T(d,1),d.m(t,null)):d&&(ke(),N(d,1,1,()=>{d=null}),Ee())},i(h){a||(T(n.$$.fragment,h),T(c),T(f),T(d),a=!0)},o(h){N(n.$$.fragment,h),N(c),N(f),N(d),a=!1},d(h){h&&O(t),de(n),c&&c.d(),f&&f.d(),d&&d.d()}}}function rB(e){let t,n,i,r,s=Pe(e[9].next),o=[];for(let l=0;lN(o[l],1,1,()=>{o[l]=null});return{c(){t=I("div"),n=ge(),i=I("div");for(let l=0;l{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),T(n,1),n.m(i.parentNode,i))},i(l){r||(T(n),r=!0)},o(l){N(n),r=!1},d(l){l&&O(i),o[t].d(l)}}}function lB(e){let t,n,i,r;return i=new yh({props:{steps:e[1],stepName:e[9].box_ends,startStep:e[3],endStep:e[4],levels:e[5],dagStructure:e[0],pathToStep:e[8],joins:e[6]}}),{c(){t=I("div"),n=ge(),he(i.$$.fragment),C(t,"class","gap svelte-18aex7a")},m(s,o){L(s,t,o),L(s,n,o),fe(i,s,o),r=!0},p(s,o){const a={};o&2&&(a.steps=s[1]),o&8&&(a.startStep=s[3]),o&16&&(a.endStep=s[4]),o&32&&(a.levels=s[5]),o&1&&(a.dagStructure=s[0]),o&64&&(a.joins=s[6]),i.$set(a)},i(s){r||(T(i.$$.fragment,s),r=!0)},o(s){N(i.$$.fragment,s),r=!1},d(s){s&&(O(t),O(n)),de(i,s)}}}function u6(e){let t,n,i,r;return i=new yh({props:{steps:e[1],stepName:e[4],startStep:e[3],endStep:e[4],levels:e[5],dagStructure:e[0]}}),{c(){t=I("div"),n=ge(),he(i.$$.fragment),C(t,"class","gap svelte-18aex7a")},m(s,o){L(s,t,o),L(s,n,o),fe(i,s,o),r=!0},p(s,o){const a={};o&2&&(a.steps=s[1]),o&16&&(a.stepName=s[4]),o&8&&(a.startStep=s[3]),o&16&&(a.endStep=s[4]),o&32&&(a.levels=s[5]),o&1&&(a.dagStructure=s[0]),i.$set(a)},i(s){r||(T(i.$$.fragment,s),r=!0)},o(s){N(i.$$.fragment,s),r=!1},d(s){s&&(O(t),O(n)),de(i,s)}}}function uB(e){let t,n,i=e[9]&&iB(e);return{c(){i&&i.c(),t=De()},m(r,s){i&&i.m(r,s),L(r,t,s),n=!0},p(r,[s]){r[9]&&i.p(r,s)},i(r){n||(T(i),n=!0)},o(r){N(i),n=!1},d(r){r&&O(t),i&&i.d(r)}}}function cB(e,t,n){var b;let{steps:i}=t,{stepName:r}=t,{startStep:s}=t,{endStep:o=null}=t,{levels:a=0}=t,{joins:l=[]}=t,{pathToStep:u=""}=t,{dagStructure:c={}}=t,f=null;const d=u?`${u}/${r}`:r,h=i[r];no(()=>{if(c[d]){console.log("Node already registered:",d);return}if(!f){console.warn("Step element not found:",d);return}const v=[];for(const _ of h.next){const x=i[_];if((x==null?void 0:x.type)==="join"){const k=l.find(w=>w.endsWith("/"+_));k&&v.push(k)}else o&&_===o?v.push(o):_===r?v.push(d):v.push(d+"/"+_)}n(0,c[d]={stepName:r,pathToStep:u,connections:v,node:f},c)});let g=(b=h==null?void 0:h.next)==null?void 0:b.find(v=>{var _;return((_=i[v])==null?void 0:_.type)!=="join"&&v!==o});const m=(h==null?void 0:h.type)==="foreach"?a+1:(h==null?void 0:h.type)==="join"?a-1:a;function y(v){f=v,n(7,f)}return e.$$set=v=>{"steps"in v&&n(1,i=v.steps),"stepName"in v&&n(2,r=v.stepName),"startStep"in v&&n(3,s=v.startStep),"endStep"in v&&n(4,o=v.endStep),"levels"in v&&n(5,a=v.levels),"joins"in v&&n(6,l=v.joins),"pathToStep"in v&&n(12,u=v.pathToStep),"dagStructure"in v&&n(0,c=v.dagStructure)},[c,i,r,s,o,a,l,f,d,h,g,m,u,y]}class yh extends ve{constructor(t){super(),be(this,t,cB,uB,pe,{steps:1,stepName:2,startStep:3,endStep:4,levels:5,joins:6,pathToStep:12,dagStructure:0})}}function fB(e){let t;return{c(){t=I("p"),t.textContent="No start step"},m(n,i){L(n,t,i)},p:Y,i:Y,o:Y,d(n){n&&O(t)}}}function dB(e){let t,n,i;function r(o){e[8](o)}let s={steps:e[3],stepName:e[4],startStep:e[4],endStep:e[5]};return e[1]!==void 0&&(s.dagStructure=e[1]),t=new yh({props:s}),Nn.push(()=>Bm(t,"dagStructure",r)),{c(){he(t.$$.fragment)},m(o,a){fe(t,o,a),i=!0},p(o,a){const l={};!n&&a&2&&(n=!0,l.dagStructure=o[1],Pm(()=>n=!1)),t.$set(l)},i(o){i||(T(t.$$.fragment,o),i=!0)},o(o){N(t.$$.fragment,o),i=!1},d(o){de(t,o)}}}function c6(e){let t,n;return t=new Jz({props:{dagStructure:e[1],container:e[0]}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,r){const s={};r&2&&(s.dagStructure=i[1]),r&1&&(s.container=i[0]),t.$set(s)},i(i){n||(T(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function hB(e){let t,n,i,r,s,o,a;const l=[dB,fB],u=[];function c(d,h){var p;return d[4]&&((p=d[3])!=null&&p[d[4]])?0:1}n=c(e),i=u[n]=l[n](e);let f=!e[2]&&c6(e);return{c(){t=I("div"),i.c(),r=ge(),f&&f.c(),fi(t,"position","relative"),fi(t,"line-height","1"),C(t,"data-component","dag")},m(d,h){L(d,t,h),u[n].m(t,null),R(t,r),f&&f.m(t,null),e[9](t),s=!0,o||(a=Ki(window,"resize",e[6]),o=!0)},p(d,[h]){i.p(d,h),d[2]?f&&(ke(),N(f,1,1,()=>{f=null}),Ee()):f?(f.p(d,h),h&4&&T(f,1)):(f=c6(d),f.c(),T(f,1),f.m(t,null))},i(d){s||(T(i),T(f),s=!0)},o(d){N(i),N(f),s=!1},d(d){d&&O(t),u[n].d(),f&&f.d(),e[9](null),o=!1,a()}}}const pB=100;function gB(e,t,n){var g;let i;gh(e,ua,m=>n(11,i=m));let{componentData:r}=t;const{steps:s,start_step:o,end_step:a}=r.data;let l,u={};q5(n6,Fz((g=i==null?void 0:i.metadata)==null?void 0:g.pathspec,"stepname"));let c,f=!1;const d=()=>{n(2,f=!0),clearTimeout(c),c=setTimeout(()=>{n(2,f=!1)},pB)};function h(m){u=m,n(1,u)}function p(m){Nn[m?"unshift":"push"](()=>{l=m,n(0,l)})}return e.$$set=m=>{"componentData"in m&&n(7,r=m.componentData)},[l,u,f,s,o,a,d,r,h,p]}class f6 extends ve{constructor(t){super(),be(this,t,gB,hB,pe,{componentData:7})}}function mB(e){var r;let t,n=(((r=e[0])==null?void 0:r.text)||"")+"",i;return{c(){t=I("h2"),i=ce(n),C(t,"class","title svelte-117s0ws"),C(t,"data-component","title")},m(s,o){L(s,t,o),R(t,i)},p(s,[o]){var a;o&1&&n!==(n=(((a=s[0])==null?void 0:a.text)||"")+"")&&Me(i,n)},i:Y,o:Y,d(s){s&&O(t)}}}function yB(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class d6 extends ve{constructor(t){super(),be(this,t,yB,mB,pe,{componentData:0})}}function bB(e){var r;let t,n=(((r=e[0])==null?void 0:r.text)||"")+"",i;return{c(){t=I("p"),i=ce(n),C(t,"class","subtitle svelte-lu9pnn"),C(t,"data-component","subtitle")},m(s,o){L(s,t,o),R(t,i)},p(s,[o]){var a;o&1&&n!==(n=(((a=s[0])==null?void 0:a.text)||"")+"")&&Me(i,n)},i:Y,o:Y,d(s){s&&O(t)}}}function vB(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class h6 extends ve{constructor(t){super(),be(this,t,vB,bB,pe,{componentData:0})}}function p6(e){let t,n;return t=new d6({props:{componentData:{type:"title",text:e[1]}}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,r){const s={};r&2&&(s.componentData={type:"title",text:i[1]}),t.$set(s)},i(i){n||(T(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function g6(e){let t,n;return t=new h6({props:{componentData:{type:"subtitle",text:e[0]}}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.componentData={type:"subtitle",text:i[0]}),t.$set(s)},i(i){n||(T(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function _B(e){let t,n,i,r=e[1]&&p6(e),s=e[0]&&g6(e);return{c(){t=I("header"),r&&r.c(),n=ge(),s&&s.c(),C(t,"class","container svelte-1ugmt5d"),C(t,"data-component","heading")},m(o,a){L(o,t,a),r&&r.m(t,null),R(t,n),s&&s.m(t,null),i=!0},p(o,[a]){o[1]?r?(r.p(o,a),a&2&&T(r,1)):(r=p6(o),r.c(),T(r,1),r.m(t,n)):r&&(ke(),N(r,1,1,()=>{r=null}),Ee()),o[0]?s?(s.p(o,a),a&1&&T(s,1)):(s=g6(o),s.c(),T(s,1),s.m(t,null)):s&&(ke(),N(s,1,1,()=>{s=null}),Ee())},i(o){i||(T(r),T(s),i=!0)},o(o){N(r),N(s),i=!1},d(o){o&&O(t),r&&r.d(),s&&s.d()}}}function xB(e,t,n){let i,r,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(2,s=o.componentData)},e.$$.update=()=>{e.$$.dirty&4&&n(1,{title:i,subtitle:r}=s,i,(n(0,r),n(2,s)))},[r,i,s]}let m6=class extends ve{constructor(t){super(),be(this,t,xB,_B,pe,{componentData:2})}};function y6(e){let t,n;return{c(){t=I("div"),n=ce(e[2]),C(t,"class","label svelte-1x96yvr")},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&4&&Me(n,i[2])},d(i){i&&O(t)}}}function b6(e){let t,n;return{c(){t=I("figcaption"),n=ce(e[1]),C(t,"class","description svelte-1x96yvr")},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&2&&Me(n,i[1])},d(i){i&&O(t)}}}function wB(e){let t,n,i,r,s,o,a,l,u,c=e[2]&&y6(e),f=e[1]&&b6(e);return{c(){t=I("figure"),n=I("div"),i=I("img"),o=ge(),c&&c.c(),a=ge(),f&&f.c(),ph(i.src,r=e[3])||C(i,"src",r),C(i,"alt",s=e[2]||"image"),C(i,"class","svelte-1x96yvr"),C(n,"class","imageContainer"),C(t,"data-component","image"),C(t,"class","svelte-1x96yvr")},m(d,h){L(d,t,h),R(t,n),R(n,i),R(t,o),c&&c.m(t,null),R(t,a),f&&f.m(t,null),l||(u=Ki(t,"click",e[4]),l=!0)},p(d,[h]){h&8&&!ph(i.src,r=d[3])&&C(i,"src",r),h&4&&s!==(s=d[2]||"image")&&C(i,"alt",s),d[2]?c?c.p(d,h):(c=y6(d),c.c(),c.m(t,a)):c&&(c.d(1),c=null),d[1]?f?f.p(d,h):(f=b6(d),f.c(),f.m(t,null)):f&&(f.d(1),f=null)},i:Y,o:Y,d(d){d&&O(t),c&&c.d(),f&&f.d(),l=!1,u()}}}function kB(e,t,n){let i,r,s,{componentData:o}=t;const a=()=>Fc.set(o);return e.$$set=l=>{"componentData"in l&&n(0,o=l.componentData)},e.$$.update=()=>{e.$$.dirty&1&&n(3,{src:i,label:r,description:s}=o,i,(n(2,r),n(0,o)),(n(1,s),n(0,o)))},[o,s,r,i,a]}let v6=class extends ve{constructor(t){super(),be(this,t,kB,wB,pe,{componentData:0})}};function EB(e){let t,n,i,r,s=e[0].data+"",o,a,l;return{c(){t=I("pre"),n=ce(` `),i=I("code"),r=ce(` `),o=ce(s),a=ce(` - `),u=ce(` -`),$(i,"class","mono language-log"),$(t,"class","log svelte-1jhmsu"),$(t,"data-component","log")},m(l,c){L(l,t,c),R(t,n),R(t,i),R(i,r),R(i,o),R(i,a),e[2](i),R(t,u)},p(l,[c]){c&1&&s!==(s=l[0].data+"")&&Me(o,s)},i:X,o:X,d(l){l&&O(t),e[2](null)}}}function bj(e,t,n){let{componentData:i}=t,r;function s(){var a;r&&((a=window==null?void 0:window.Prism)==null||a.highlightElement(r))}function o(a){jn[a?"unshift":"push"](()=>{r=a,n(1,r)})}return e.$$set=a=>{"componentData"in a&&n(0,i=a.componentData)},e.$$.update=()=>{e.$$.dirty&2&&r&&s()},[i,r,o]}let e4=class extends _e{constructor(t){super(),ve(this,t,bj,yj,pe,{componentData:0})}};function vj(){const e=console.warn;console.warn=t=>{t.includes("unknown prop")||t.includes("unexpected slot")||e(t)},yo(()=>{console.warn=e})}function t4(e,t,n){const i=e.slice();return i[18]=t[n],i}function n4(e,t,n){const i=e.slice();return i[18]=t[n],i}function i4(e,t,n){const i=e.slice();return i[10]=t[n],i}function r4(e,t,n){const i=e.slice();return i[13]=t[n],i[15]=n,i}function s4(e,t,n){const i=e.slice();return i[16]=t[n],i[15]=n,i}function o4(e,t,n){const i=e.slice();return i[7]=t[n],i}function _j(e){let t,n,i,r;const s=[Ej,kj,wj],o=[];function a(u,l){return u[0]==="table"?0:u[0]==="list"?1:2}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ne()},m(u,l){o[t].m(u,l),L(u,i,l),r=!0},p(u,l){let c=t;t=a(u),t===c?o[t].p(u,l):(Ee(),N(o[c],1,1,()=>{o[c]=null}),Ce(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),D(n,1),n.m(i.parentNode,i))},i(u){r||(D(n),r=!0)},o(u){N(n),r=!1},d(u){u&&O(i),o[t].d(u)}}}function xj(e){let t,n,i=Pe(e[1]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{de(l,1)}),Ce()}s?(t=Ke(s,o(a,u)),he(t.$$.fragment),D(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(s){const l=u&64?Ei(r,[lr(a[6])]):{};u&8388706&&(l.$$scope={dirty:u,ctx:a}),t.$set(l)}},i(a){i||(t&&D(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&O(n),t&&de(t,a)}}}function kj(e){let t,n,i,r;const s=[Fj,Sj],o=[];function a(u,l){return u[4]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ne()},m(u,l){o[t].m(u,l),L(u,i,l),r=!0},p(u,l){let c=t;t=a(u),t===c?o[t].p(u,l):(Ee(),N(o[c],1,1,()=>{o[c]=null}),Ce(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),D(n,1),n.m(i.parentNode,i))},i(u){r||(D(n),r=!0)},o(u){N(n),r=!1},d(u){u&&O(i),o[t].d(u)}}}function Ej(e){let t,n,i;var r=e[5].table;function s(o,a){return{props:{$$slots:{default:[Bj]},$$scope:{ctx:o}}}}return r&&(t=Ke(r,s(e))),{c(){t&&he(t.$$.fragment),n=Ne()},m(o,a){t&&fe(t,o,a),L(o,n,a),i=!0},p(o,a){if(a&32&&r!==(r=o[5].table)){if(t){Ee();const u=t;N(u.$$.fragment,1,0,()=>{de(u,1)}),Ce()}r?(t=Ke(r,s(o)),he(t.$$.fragment),D(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(r){const u={};a&8388716&&(u.$$scope={dirty:a,ctx:o}),t.$set(u)}},i(o){i||(t&&D(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&O(n),t&&de(t,o)}}}function Cj(e){let t=e[6].raw+"",n;return{c(){n=ce(t)},m(i,r){L(i,n,r)},p(i,r){r&64&&t!==(t=i[6].raw+"")&&Me(n,t)},i:X,o:X,d(i){i&&O(n)}}}function Aj(e){let t,n;return t=new Aa({props:{tokens:e[1],renderers:e[5]}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,r){const s={};r&2&&(s.tokens=i[1]),r&32&&(s.renderers=i[5]),t.$set(s)},i(i){n||(D(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function $j(e){let t,n,i,r;const s=[Aj,Cj],o=[];function a(u,l){return u[1]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ne()},m(u,l){o[t].m(u,l),L(u,i,l),r=!0},p(u,l){let c=t;t=a(u),t===c?o[t].p(u,l):(Ee(),N(o[c],1,1,()=>{o[c]=null}),Ce(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),D(n,1),n.m(i.parentNode,i))},i(u){r||(D(n),r=!0)},o(u){N(n),r=!1},d(u){u&&O(i),o[t].d(u)}}}function Sj(e){let t,n,i;const r=[{ordered:e[4]},e[6]];var s=e[5].list;function o(a,u){let l={$$slots:{default:[Tj]},$$scope:{ctx:a}};for(let c=0;c{de(l,1)}),Ce()}s?(t=Ke(s,o(a,u)),he(t.$$.fragment),D(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(s){const l=u&80?Ei(r,[u&16&&{ordered:a[4]},u&64&&lr(a[6])]):{};u&8388704&&(l.$$scope={dirty:u,ctx:a}),t.$set(l)}},i(a){i||(t&&D(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&O(n),t&&de(t,a)}}}function Fj(e){let t,n,i;const r=[{ordered:e[4]},e[6]];var s=e[5].list;function o(a,u){let l={$$slots:{default:[Nj]},$$scope:{ctx:a}};for(let c=0;c{de(l,1)}),Ce()}s?(t=Ke(s,o(a,u)),he(t.$$.fragment),D(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(s){const l=u&80?Ei(r,[u&16&&{ordered:a[4]},u&64&&lr(a[6])]):{};u&8388704&&(l.$$scope={dirty:u,ctx:a}),t.$set(l)}},i(a){i||(t&&D(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&O(n),t&&de(t,a)}}}function Dj(e){let t,n,i;return t=new Aa({props:{tokens:e[18].tokens,renderers:e[5]}}),{c(){he(t.$$.fragment),n=ge()},m(r,s){fe(t,r,s),L(r,n,s),i=!0},p(r,s){const o={};s&64&&(o.tokens=r[18].tokens),s&32&&(o.renderers=r[5]),t.$set(o)},i(r){i||(D(t.$$.fragment,r),i=!0)},o(r){N(t.$$.fragment,r),i=!1},d(r){r&&O(n),de(t,r)}}}function a4(e){let t,n,i;const r=[e[18]];var s=e[5].unorderedlistitem||e[5].listitem;function o(a,u){let l={$$slots:{default:[Dj]},$$scope:{ctx:a}};for(let c=0;c{de(l,1)}),Ce()}s?(t=Ke(s,o(a,u)),he(t.$$.fragment),D(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(s){const l=u&64?Ei(r,[lr(a[18])]):{};u&8388704&&(l.$$scope={dirty:u,ctx:a}),t.$set(l)}},i(a){i||(t&&D(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&O(n),t&&de(t,a)}}}function Tj(e){let t,n,i=Pe(e[6].items),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{de(l,1)}),Ce()}s?(t=Ke(s,o(a,u)),he(t.$$.fragment),D(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(s){const l=u&64?Ei(r,[lr(a[18])]):{};u&8388704&&(l.$$scope={dirty:u,ctx:a}),t.$set(l)}},i(a){i||(t&&D(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&O(n),t&&de(t,a)}}}function Nj(e){let t,n,i=Pe(e[6].items),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{de(u,1)}),Ce()}r?(t=Ke(r,s(o)),he(t.$$.fragment),D(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(r){const u={};a&64&&(u.align=o[6].align[o[15]]||"center"),a&8388644&&(u.$$scope={dirty:a,ctx:o}),t.$set(u)}},i(o){i||(t&&D(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&O(n),t&&de(t,o)}}}function Oj(e){let t,n,i=Pe(e[2]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{de(u,1)}),Ce()}r?(t=Ke(r,s(o)),he(t.$$.fragment),D(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(r){const u={};a&8388708&&(u.$$scope={dirty:a,ctx:o}),t.$set(u)}},i(o){i||(t&&D(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&O(n),t&&de(t,o)}}}function Ij(e){let t,n;return t=new Aa({props:{tokens:e[13].tokens,renderers:e[5]}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,r){const s={};r&8&&(s.tokens=i[13].tokens),r&32&&(s.renderers=i[5]),t.$set(s)},i(i){n||(D(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function c4(e){let t,n,i;var r=e[5].tablecell;function s(o,a){return{props:{header:!1,align:o[6].align[o[15]]||"center",$$slots:{default:[Ij]},$$scope:{ctx:o}}}}return r&&(t=Ke(r,s(e))),{c(){t&&he(t.$$.fragment),n=Ne()},m(o,a){t&&fe(t,o,a),L(o,n,a),i=!0},p(o,a){if(a&32&&r!==(r=o[5].tablecell)){if(t){Ee();const u=t;N(u.$$.fragment,1,0,()=>{de(u,1)}),Ce()}r?(t=Ke(r,s(o)),he(t.$$.fragment),D(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(r){const u={};a&64&&(u.align=o[6].align[o[15]]||"center"),a&8388648&&(u.$$scope={dirty:a,ctx:o}),t.$set(u)}},i(o){i||(t&&D(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&O(n),t&&de(t,o)}}}function Pj(e){let t,n,i=Pe(e[10]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{de(u,1)}),Ce()}r?(t=Ke(r,s(o)),he(t.$$.fragment),D(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(r){const u={};a&8388712&&(u.$$scope={dirty:a,ctx:o}),t.$set(u)}},i(o){i||(t&&D(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&O(n),t&&de(t,o)}}}function zj(e){let t,n,i=Pe(e[3]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{de(d,1)}),Ce()}o?(t=Ke(o,a(c)),he(t.$$.fragment),D(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(o){const d={};f&8388708&&(d.$$scope={dirty:f,ctx:c}),t.$set(d)}if(f&32&&u!==(u=c[5].tablebody)){if(i){Ee();const d=i;N(d.$$.fragment,1,0,()=>{de(d,1)}),Ce()}u?(i=Ke(u,l(c)),he(i.$$.fragment),D(i.$$.fragment,1),fe(i,r.parentNode,r)):i=null}else if(u){const d={};f&8388712&&(d.$$scope={dirty:f,ctx:c}),i.$set(d)}},i(c){s||(t&&D(t.$$.fragment,c),i&&D(i.$$.fragment,c),s=!0)},o(c){t&&N(t.$$.fragment,c),i&&N(i.$$.fragment,c),s=!1},d(c){c&&(O(n),O(r)),t&&de(t,c),i&&de(i,c)}}}function d4(e){let t,n;const i=[e[7],{renderers:e[5]}];let r={};for(let s=0;s{o[c]=null}),Ce()),~t?(n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),D(n,1),n.m(i.parentNode,i)):n=null)},i(u){r||(D(n),r=!0)},o(u){N(n),r=!1},d(u){u&&O(i),~t&&o[t].d(u)}}}function Uj(e,t,n){const i=["type","tokens","header","rows","ordered","renderers"];let r=_5(t,i),{type:s=void 0}=t,{tokens:o=void 0}=t,{header:a=void 0}=t,{rows:u=void 0}=t,{ordered:l=!1}=t,{renderers:c}=t;return vj(),e.$$set=f=>{t=Ue(Ue({},t),l2(f)),n(6,r=_5(t,i)),"type"in f&&n(0,s=f.type),"tokens"in f&&n(1,o=f.tokens),"header"in f&&n(2,a=f.header),"rows"in f&&n(3,u=f.rows),"ordered"in f&&n(4,l=f.ordered),"renderers"in f&&n(5,c=f.renderers)},[s,o,a,u,l,c,r]}let Aa=class extends _e{constructor(t){super(),ve(this,t,Uj,jj,pe,{type:0,tokens:1,header:2,rows:3,ordered:4,renderers:5})}};function b2(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let vo=b2();function h4(e){vo=e}const p4=/[&<>"']/,qj=new RegExp(p4.source,"g"),g4=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Wj=new RegExp(g4.source,"g"),Hj={"&":"&","<":"<",">":">",'"':""","'":"'"},m4=e=>Hj[e];function kn(e,t){if(t){if(p4.test(e))return e.replace(qj,m4)}else if(g4.test(e))return e.replace(Wj,m4);return e}const Gj=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function y4(e){return e.replace(Gj,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const Vj=/(^|[^\[])\^/g;function st(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(i,r)=>(r=r.source||r,r=r.replace(Vj,"$1"),e=e.replace(i,r),n),getRegex:()=>new RegExp(e,t)};return n}const Yj=/[^\w:]/g,Xj=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function b4(e,t,n){if(e){let i;try{i=decodeURIComponent(y4(n)).replace(Yj,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}t&&!Xj.test(n)&&(n=Qj(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const Uh={},Zj=/^[^:]+:\/*[^/]*$/,Kj=/^([^:]+:)[\s\S]*$/,Jj=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Qj(e,t){Uh[" "+e]||(Zj.test(e)?Uh[" "+e]=e+"/":Uh[" "+e]=Wh(e,"/",!0)),e=Uh[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(Kj,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(Jj,"$1")+t:e+t}const qh={exec:function(){}};function v4(e,t){const n=e.replace(/\|/g,(s,o,a)=>{let u=!1,l=o;for(;--l>=0&&a[l]==="\\";)u=!u;return u?"|":" |"}),i=n.split(/ \|/);let r=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length{r=a,n(1,r)})}return e.$$set=a=>{"componentData"in a&&n(0,i=a.componentData)},e.$$.update=()=>{e.$$.dirty&2&&r&&s()},[i,r,o]}let _6=class extends ve{constructor(t){super(),be(this,t,$B,EB,pe,{componentData:0})}};function SB(){const e=console.warn;console.warn=t=>{t.includes("unknown prop")||t.includes("unexpected slot")||e(t)},no(()=>{console.warn=e})}function x6(e,t,n){const i=e.slice();return i[18]=t[n],i}function w6(e,t,n){const i=e.slice();return i[18]=t[n],i}function k6(e,t,n){const i=e.slice();return i[10]=t[n],i}function E6(e,t,n){const i=e.slice();return i[13]=t[n],i[15]=n,i}function $6(e,t,n){const i=e.slice();return i[16]=t[n],i[15]=n,i}function S6(e,t,n){const i=e.slice();return i[7]=t[n],i}function CB(e){let t,n,i,r;const s=[MB,TB,FB],o=[];function a(l,u){return l[0]==="table"?0:l[0]==="list"?1:2}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=De()},m(l,u){o[t].m(l,u),L(l,i,u),r=!0},p(l,u){let c=t;t=a(l),t===c?o[t].p(l,u):(ke(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),T(n,1),n.m(i.parentNode,i))},i(l){r||(T(n),r=!0)},o(l){N(n),r=!1},d(l){l&&O(i),o[t].d(l)}}}function AB(e){let t,n,i=Pe(e[1]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{de(u,1)}),Ee()}s?(t=Ze(s,o(a,l)),he(t.$$.fragment),T(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(s){const u=l&64?di(r,[Ji(a[6])]):{};l&8388706&&(u.$$scope={dirty:l,ctx:a}),t.$set(u)}},i(a){i||(t&&T(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&O(n),t&&de(t,a)}}}function TB(e){let t,n,i,r;const s=[LB,OB],o=[];function a(l,u){return l[4]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=De()},m(l,u){o[t].m(l,u),L(l,i,u),r=!0},p(l,u){let c=t;t=a(l),t===c?o[t].p(l,u):(ke(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),T(n,1),n.m(i.parentNode,i))},i(l){r||(T(n),r=!0)},o(l){N(n),r=!1},d(l){l&&O(i),o[t].d(l)}}}function MB(e){let t,n,i;var r=e[5].table;function s(o,a){return{props:{$$slots:{default:[VB]},$$scope:{ctx:o}}}}return r&&(t=Ze(r,s(e))),{c(){t&&he(t.$$.fragment),n=De()},m(o,a){t&&fe(t,o,a),L(o,n,a),i=!0},p(o,a){if(a&32&&r!==(r=o[5].table)){if(t){ke();const l=t;N(l.$$.fragment,1,0,()=>{de(l,1)}),Ee()}r?(t=Ze(r,s(o)),he(t.$$.fragment),T(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(r){const l={};a&8388716&&(l.$$scope={dirty:a,ctx:o}),t.$set(l)}},i(o){i||(t&&T(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&O(n),t&&de(t,o)}}}function DB(e){let t=e[6].raw+"",n;return{c(){n=ce(t)},m(i,r){L(i,n,r)},p(i,r){r&64&&t!==(t=i[6].raw+"")&&Me(n,t)},i:Y,o:Y,d(i){i&&O(n)}}}function NB(e){let t,n;return t=new fa({props:{tokens:e[1],renderers:e[5]}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,r){const s={};r&2&&(s.tokens=i[1]),r&32&&(s.renderers=i[5]),t.$set(s)},i(i){n||(T(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function RB(e){let t,n,i,r;const s=[NB,DB],o=[];function a(l,u){return l[1]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=De()},m(l,u){o[t].m(l,u),L(l,i,u),r=!0},p(l,u){let c=t;t=a(l),t===c?o[t].p(l,u):(ke(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),T(n,1),n.m(i.parentNode,i))},i(l){r||(T(n),r=!0)},o(l){N(n),r=!1},d(l){l&&O(i),o[t].d(l)}}}function OB(e){let t,n,i;const r=[{ordered:e[4]},e[6]];var s=e[5].list;function o(a,l){let u={$$slots:{default:[PB]},$$scope:{ctx:a}};for(let c=0;c{de(u,1)}),Ee()}s?(t=Ze(s,o(a,l)),he(t.$$.fragment),T(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(s){const u=l&80?di(r,[l&16&&{ordered:a[4]},l&64&&Ji(a[6])]):{};l&8388704&&(u.$$scope={dirty:l,ctx:a}),t.$set(u)}},i(a){i||(t&&T(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&O(n),t&&de(t,a)}}}function LB(e){let t,n,i;const r=[{ordered:e[4]},e[6]];var s=e[5].list;function o(a,l){let u={$$slots:{default:[BB]},$$scope:{ctx:a}};for(let c=0;c{de(u,1)}),Ee()}s?(t=Ze(s,o(a,l)),he(t.$$.fragment),T(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(s){const u=l&80?di(r,[l&16&&{ordered:a[4]},l&64&&Ji(a[6])]):{};l&8388704&&(u.$$scope={dirty:l,ctx:a}),t.$set(u)}},i(a){i||(t&&T(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&O(n),t&&de(t,a)}}}function IB(e){let t,n,i;return t=new fa({props:{tokens:e[18].tokens,renderers:e[5]}}),{c(){he(t.$$.fragment),n=ge()},m(r,s){fe(t,r,s),L(r,n,s),i=!0},p(r,s){const o={};s&64&&(o.tokens=r[18].tokens),s&32&&(o.renderers=r[5]),t.$set(o)},i(r){i||(T(t.$$.fragment,r),i=!0)},o(r){N(t.$$.fragment,r),i=!1},d(r){r&&O(n),de(t,r)}}}function C6(e){let t,n,i;const r=[e[18]];var s=e[5].unorderedlistitem||e[5].listitem;function o(a,l){let u={$$slots:{default:[IB]},$$scope:{ctx:a}};for(let c=0;c{de(u,1)}),Ee()}s?(t=Ze(s,o(a,l)),he(t.$$.fragment),T(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(s){const u=l&64?di(r,[Ji(a[18])]):{};l&8388704&&(u.$$scope={dirty:l,ctx:a}),t.$set(u)}},i(a){i||(t&&T(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&O(n),t&&de(t,a)}}}function PB(e){let t,n,i=Pe(e[6].items),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{de(u,1)}),Ee()}s?(t=Ze(s,o(a,l)),he(t.$$.fragment),T(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(s){const u=l&64?di(r,[Ji(a[18])]):{};l&8388704&&(u.$$scope={dirty:l,ctx:a}),t.$set(u)}},i(a){i||(t&&T(t.$$.fragment,a),i=!0)},o(a){t&&N(t.$$.fragment,a),i=!1},d(a){a&&O(n),t&&de(t,a)}}}function BB(e){let t,n,i=Pe(e[6].items),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{de(l,1)}),Ee()}r?(t=Ze(r,s(o)),he(t.$$.fragment),T(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(r){const l={};a&64&&(l.align=o[6].align[o[15]]||"center"),a&8388644&&(l.$$scope={dirty:a,ctx:o}),t.$set(l)}},i(o){i||(t&&T(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&O(n),t&&de(t,o)}}}function UB(e){let t,n,i=Pe(e[2]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{de(l,1)}),Ee()}r?(t=Ze(r,s(o)),he(t.$$.fragment),T(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(r){const l={};a&8388708&&(l.$$scope={dirty:a,ctx:o}),t.$set(l)}},i(o){i||(t&&T(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&O(n),t&&de(t,o)}}}function WB(e){let t,n;return t=new fa({props:{tokens:e[13].tokens,renderers:e[5]}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,r){const s={};r&8&&(s.tokens=i[13].tokens),r&32&&(s.renderers=i[5]),t.$set(s)},i(i){n||(T(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function T6(e){let t,n,i;var r=e[5].tablecell;function s(o,a){return{props:{header:!1,align:o[6].align[o[15]]||"center",$$slots:{default:[WB]},$$scope:{ctx:o}}}}return r&&(t=Ze(r,s(e))),{c(){t&&he(t.$$.fragment),n=De()},m(o,a){t&&fe(t,o,a),L(o,n,a),i=!0},p(o,a){if(a&32&&r!==(r=o[5].tablecell)){if(t){ke();const l=t;N(l.$$.fragment,1,0,()=>{de(l,1)}),Ee()}r?(t=Ze(r,s(o)),he(t.$$.fragment),T(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(r){const l={};a&64&&(l.align=o[6].align[o[15]]||"center"),a&8388648&&(l.$$scope={dirty:a,ctx:o}),t.$set(l)}},i(o){i||(t&&T(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&O(n),t&&de(t,o)}}}function HB(e){let t,n,i=Pe(e[10]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{de(l,1)}),Ee()}r?(t=Ze(r,s(o)),he(t.$$.fragment),T(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(r){const l={};a&8388712&&(l.$$scope={dirty:a,ctx:o}),t.$set(l)}},i(o){i||(t&&T(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&O(n),t&&de(t,o)}}}function GB(e){let t,n,i=Pe(e[3]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{de(d,1)}),Ee()}o?(t=Ze(o,a(c)),he(t.$$.fragment),T(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(o){const d={};f&8388708&&(d.$$scope={dirty:f,ctx:c}),t.$set(d)}if(f&32&&l!==(l=c[5].tablebody)){if(i){ke();const d=i;N(d.$$.fragment,1,0,()=>{de(d,1)}),Ee()}l?(i=Ze(l,u(c)),he(i.$$.fragment),T(i.$$.fragment,1),fe(i,r.parentNode,r)):i=null}else if(l){const d={};f&8388712&&(d.$$scope={dirty:f,ctx:c}),i.$set(d)}},i(c){s||(t&&T(t.$$.fragment,c),i&&T(i.$$.fragment,c),s=!0)},o(c){t&&N(t.$$.fragment,c),i&&N(i.$$.fragment,c),s=!1},d(c){c&&(O(n),O(r)),t&&de(t,c),i&&de(i,c)}}}function D6(e){let t,n;const i=[e[7],{renderers:e[5]}];let r={};for(let s=0;s{o[c]=null}),Ee()),~t?(n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),T(n,1),n.m(i.parentNode,i)):n=null)},i(l){r||(T(n),r=!0)},o(l){N(n),r=!1},d(l){l&&O(i),~t&&o[t].d(l)}}}function XB(e,t,n){const i=["type","tokens","header","rows","ordered","renderers"];let r=B5(t,i),{type:s=void 0}=t,{tokens:o=void 0}=t,{header:a=void 0}=t,{rows:l=void 0}=t,{ordered:u=!1}=t,{renderers:c}=t;return SB(),e.$$set=f=>{t=Oe(Oe({},t),Dm(f)),n(6,r=B5(t,i)),"type"in f&&n(0,s=f.type),"tokens"in f&&n(1,o=f.tokens),"header"in f&&n(2,a=f.header),"rows"in f&&n(3,l=f.rows),"ordered"in f&&n(4,u=f.ordered),"renderers"in f&&n(5,c=f.renderers)},[s,o,a,l,u,c,r]}let fa=class extends ve{constructor(t){super(),be(this,t,XB,YB,pe,{type:0,tokens:1,header:2,rows:3,ordered:4,renderers:5})}};function jm(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let ro=jm();function N6(e){ro=e}const R6=/[&<>"']/,ZB=new RegExp(R6.source,"g"),O6=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,KB=new RegExp(O6.source,"g"),JB={"&":"&","<":"<",">":">",'"':""","'":"'"},L6=e=>JB[e];function yn(e,t){if(t){if(R6.test(e))return e.replace(ZB,L6)}else if(O6.test(e))return e.replace(KB,L6);return e}const QB=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function I6(e){return e.replace(QB,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const ej=/(^|[^\[])\^/g;function it(e,t){e=typeof e=="string"?e:e.source,t=t||"";const n={replace:(i,r)=>(r=r.source||r,r=r.replace(ej,"$1"),e=e.replace(i,r),n),getRegex:()=>new RegExp(e,t)};return n}const tj=/[^\w:]/g,nj=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function P6(e,t,n){if(e){let i;try{i=decodeURIComponent(I6(n)).replace(tj,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}t&&!nj.test(n)&&(n=oj(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const bh={},ij=/^[^:]+:\/*[^/]*$/,rj=/^([^:]+:)[\s\S]*$/,sj=/^([^:]+:\/*[^/]*)[\s\S]*$/;function oj(e,t){bh[" "+e]||(ij.test(e)?bh[" "+e]=e+"/":bh[" "+e]=_h(e,"/",!0)),e=bh[" "+e];const n=e.indexOf(":")===-1;return t.substring(0,2)==="//"?n?t:e.replace(rj,"$1")+t:t.charAt(0)==="/"?n?t:e.replace(sj,"$1")+t:e+t}const vh={exec:function(){}};function z6(e,t){const n=e.replace(/\|/g,(s,o,a)=>{let l=!1,u=o;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),i=n.split(/ \|/);let r=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length{const s=r.match(/^\s+/);if(s===null)return r;const[o]=s;return o.length>=i.length?r.slice(i.length):r}).join(` -`)}class Hh{constructor(t){this.options=t||vo}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const i=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?i:Wh(i,` -`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const i=n[0],r=nU(i,n[3]||"");return{type:"code",raw:i,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:r}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let i=n[2].trim();if(/#$/.test(i)){const r=Wh(i,"#");(this.options.pedantic||!r||/ $/.test(r))&&(i=r.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const i=n[0].replace(/^ *>[ \t]?/gm,""),r=this.lexer.state.top;this.lexer.state.top=!0;const s=this.lexer.blockTokens(i);return this.lexer.state.top=r,{type:"blockquote",raw:n[0],tokens:s,text:i}}}list(t){let n=this.rules.block.list.exec(t);if(n){let i,r,s,o,a,u,l,c,f,d,h,p,g=n[1].trim();const m=g.length>1,y={type:"list",raw:"",ordered:m,start:m?+g.slice(0,-1):"",loose:!1,items:[]};g=m?`\\d{1,9}\\${g.slice(-1)}`:`\\${g}`,this.options.pedantic&&(g=m?g:"[*+-]");const b=new RegExp(`^( {0,3}${g})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(p=!1,!(!(n=b.exec(t))||this.rules.block.hr.test(t)));){if(i=n[0],t=t.substring(i.length),c=n[2].split(` +`)}class xh{constructor(t){this.options=t||ro}space(t){const n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){const n=this.rules.block.code.exec(t);if(n){const i=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?i:_h(i,` +`)}}}fences(t){const n=this.rules.block.fences.exec(t);if(n){const i=n[0],r=uj(i,n[3]||"");return{type:"code",raw:i,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:r}}}heading(t){const n=this.rules.block.heading.exec(t);if(n){let i=n[2].trim();if(/#$/.test(i)){const r=_h(i,"#");(this.options.pedantic||!r||/ $/.test(r))&&(i=r.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(t){const n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){const n=this.rules.block.blockquote.exec(t);if(n){const i=n[0].replace(/^ *>[ \t]?/gm,""),r=this.lexer.state.top;this.lexer.state.top=!0;const s=this.lexer.blockTokens(i);return this.lexer.state.top=r,{type:"blockquote",raw:n[0],tokens:s,text:i}}}list(t){let n=this.rules.block.list.exec(t);if(n){let i,r,s,o,a,l,u,c,f,d,h,p,g=n[1].trim();const m=g.length>1,y={type:"list",raw:"",ordered:m,start:m?+g.slice(0,-1):"",loose:!1,items:[]};g=m?`\\d{1,9}\\${g.slice(-1)}`:`\\${g}`,this.options.pedantic&&(g=m?g:"[*+-]");const b=new RegExp(`^( {0,3}${g})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;t&&(p=!1,!(!(n=b.exec(t))||this.rules.block.hr.test(t)));){if(i=n[0],t=t.substring(i.length),c=n[2].split(` `,1)[0].replace(/^\t+/,_=>" ".repeat(3*_.length)),f=t.split(` -`,1)[0],this.options.pedantic?(o=2,h=c.trimLeft()):(o=n[2].search(/[^ ]/),o=o>4?1:o,h=c.slice(o),o+=n[1].length),u=!1,!c&&/^ *$/.test(f)&&(i+=f+` +`,1)[0],this.options.pedantic?(o=2,h=c.trimLeft()):(o=n[2].search(/[^ ]/),o=o>4?1:o,h=c.slice(o),o+=n[1].length),l=!1,!c&&/^ *$/.test(f)&&(i+=f+` `,t=t.substring(f.length+1),p=!0),!p){const _=new RegExp(`^ {0,${Math.min(3,o-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),x=new RegExp(`^ {0,${Math.min(3,o-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),k=new RegExp(`^ {0,${Math.min(3,o-1)}}(?:\`\`\`|~~~)`),w=new RegExp(`^ {0,${Math.min(3,o-1)}}#`);for(;t&&(d=t.split(` `,1)[0],f=d,this.options.pedantic&&(f=f.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(k.test(f)||w.test(f)||_.test(f)||x.test(t)));){if(f.search(/[^ ]/)>=o||!f.trim())h+=` -`+f.slice(o);else{if(u||c.search(/[^ ]/)>=4||k.test(c)||w.test(c)||x.test(c))break;h+=` -`+f}!u&&!f.trim()&&(u=!0),i+=d+` -`,t=t.substring(d.length+1),c=f.slice(o)}}y.loose||(l?y.loose=!0:/\n *\n *$/.test(i)&&(l=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(h),r&&(s=r[0]!=="[ ] ",h=h.replace(/^\[[ xX]\] +/,""))),y.items.push({type:"list_item",raw:i,task:!!r,checked:s,loose:!1,text:h}),y.raw+=i}y.items[y.items.length-1].raw=i.trimRight(),y.items[y.items.length-1].text=h.trimRight(),y.raw=y.raw.trimRight();const v=y.items.length;for(a=0;ak.type==="space"),x=_.length>0&&_.some(k=>/\n.*\n/.test(k.raw));y.loose=x}if(y.loose)for(a=0;a$/,"$1").replace(this.rules.inline._escapes,"$1"):"",s=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:i,raw:n[0],href:r,title:s}}}table(t){const n=this.rules.block.table.exec(t);if(n){const i={type:"table",header:v4(n[1]).map(r=>({text:r})),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(` -`):[]};if(i.header.length===i.align.length){i.raw=n[0];let r=i.align.length,s,o,a,u;for(s=0;s({text:l}));for(r=i.header.length,o=0;o/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):kn(n[0]):n[0]}}link(t){const n=this.rules.inline.link.exec(t);if(n){const i=n[2].trim();if(!this.options.pedantic&&/^$/.test(i))return;const o=Wh(i.slice(0,-1),"\\");if((i.length-o.length)%2===0)return}else{const o=eU(n[2],"()");if(o>-1){const u=(n[0].indexOf("!")===0?5:4)+n[1].length+o;n[2]=n[2].substring(0,o),n[0]=n[0].substring(0,u).trim(),n[3]=""}}let r=n[2],s="";if(this.options.pedantic){const o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);o&&(r=o[1],s=o[3])}else s=n[3]?n[3].slice(1,-1):"";return r=r.trim(),/^$/.test(i)?r=r.slice(1):r=r.slice(1,-1)),_4(n,{href:r&&r.replace(this.rules.inline._escapes,"$1"),title:s&&s.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(t,n){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let r=(i[2]||i[1]).replace(/\s+/g," ");if(r=n[r.toLowerCase()],!r){const s=i[0].charAt(0);return{type:"text",raw:s,text:s}}return _4(i,r,i[0],this.lexer)}}emStrong(t,n,i=""){let r=this.rules.inline.emStrong.lDelim.exec(t);if(!r||r[3]&&i.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!i||this.rules.inline.punctuation.exec(i)){const o=r[0].length-1;let a,u,l=o,c=0;const f=r[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(f.lastIndex=0,n=n.slice(-1*t.length+o);(r=f.exec(n))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(u=a.length,r[3]||r[4]){l+=u;continue}else if((r[5]||r[6])&&o%3&&!((o+u)%3)){c+=u;continue}if(l-=u,l>0)continue;u=Math.min(u,u+l+c);const d=t.slice(0,o+r.index+u+1);if(Math.min(o,u)%2){const p=d.slice(1,-1);return{type:"em",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}const h=d.slice(2,-2);return{type:"strong",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let i=n[2].replace(/\n/g," ");const r=/[^ ]/.test(i),s=/^ /.test(i)&&/ $/.test(i);return r&&s&&(i=i.substring(1,i.length-1)),i=kn(i,!0),{type:"codespan",raw:n[0],text:i}}}br(t){const n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){const n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t,n){const i=this.rules.inline.autolink.exec(t);if(i){let r,s;return i[2]==="@"?(r=kn(this.options.mangle?n(i[1]):i[1]),s="mailto:"+r):(r=kn(i[1]),s=r),{type:"link",raw:i[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(t,n){let i;if(i=this.rules.inline.url.exec(t)){let r,s;if(i[2]==="@")r=kn(this.options.mangle?n(i[0]):i[0]),s="mailto:"+r;else{let o;do o=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0];while(o!==i[0]);r=kn(i[0]),i[1]==="www."?s="http://"+i[0]:s=i[0]}return{type:"link",raw:i[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t,n){const i=this.rules.inline.text.exec(t);if(i){let r;return this.lexer.state.inRawBlock?r=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):kn(i[0]):i[0]:r=kn(this.options.smartypants?n(i[0]):i[0]),{type:"text",raw:i[0],text:r}}}}const Fe={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:qh,lheading:/^((?:(?!^bull ).|\n(?!\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};Fe._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Fe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Fe.def=st(Fe.def).replace("label",Fe._label).replace("title",Fe._title).getRegex(),Fe.bullet=/(?:[*+-]|\d{1,9}[.)])/,Fe.listItemStart=st(/^( *)(bull) */).replace("bull",Fe.bullet).getRegex(),Fe.list=st(Fe.list).replace(/bull/g,Fe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Fe.def.source+")").getRegex(),Fe._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Fe._comment=/|$)/,Fe.html=st(Fe.html,"i").replace("comment",Fe._comment).replace("tag",Fe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Fe.lheading=st(Fe.lheading).replace(/bull/g,Fe.bullet).getRegex(),Fe.paragraph=st(Fe._paragraph).replace("hr",Fe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Fe._tag).getRegex(),Fe.blockquote=st(Fe.blockquote).replace("paragraph",Fe.paragraph).getRegex(),Fe.normal={...Fe},Fe.gfm={...Fe.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},Fe.gfm.table=st(Fe.gfm.table).replace("hr",Fe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Fe._tag).getRegex(),Fe.gfm.paragraph=st(Fe._paragraph).replace("hr",Fe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Fe.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Fe._tag).getRegex(),Fe.pedantic={...Fe.normal,html:st(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Fe._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:qh,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:st(Fe.normal._paragraph).replace("hr",Fe.hr).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",Fe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const ae={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:qh,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:qh,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`^|~",ae.punctuation=st(ae.punctuation,"u").replace(/punctuation/g,ae._punctuation).getRegex(),ae.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,ae.anyPunctuation=/\\[punct]/g,ae._escapes=/\\([punct])/g,ae._comment=st(Fe._comment).replace("(?:-->|$)","-->").getRegex(),ae.emStrong.lDelim=st(ae.emStrong.lDelim,"u").replace(/punct/g,ae._punctuation).getRegex(),ae.emStrong.rDelimAst=st(ae.emStrong.rDelimAst,"gu").replace(/punct/g,ae._punctuation).getRegex(),ae.emStrong.rDelimUnd=st(ae.emStrong.rDelimUnd,"gu").replace(/punct/g,ae._punctuation).getRegex(),ae.anyPunctuation=st(ae.anyPunctuation,"gu").replace(/punct/g,ae._punctuation).getRegex(),ae._escapes=st(ae._escapes,"gu").replace(/punct/g,ae._punctuation).getRegex(),ae._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ae._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,ae.autolink=st(ae.autolink).replace("scheme",ae._scheme).replace("email",ae._email).getRegex(),ae._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ae.tag=st(ae.tag).replace("comment",ae._comment).replace("attribute",ae._attribute).getRegex(),ae._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ae._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,ae._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ae.link=st(ae.link).replace("label",ae._label).replace("href",ae._href).replace("title",ae._title).getRegex(),ae.reflink=st(ae.reflink).replace("label",ae._label).replace("ref",Fe._label).getRegex(),ae.nolink=st(ae.nolink).replace("ref",Fe._label).getRegex(),ae.reflinkSearch=st(ae.reflinkSearch,"g").replace("reflink",ae.reflink).replace("nolink",ae.nolink).getRegex(),ae.normal={...ae},ae.pedantic={...ae.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:st(/^!?\[(label)\]\((.*?)\)/).replace("label",ae._label).getRegex(),reflink:st(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ae._label).getRegex()},ae.gfm={...ae.normal,escape:st(ae.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),t+="&#"+i+";";return t}class cr{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||vo,this.options.tokenizer=this.options.tokenizer||new Hh,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:Fe.normal,inline:ae.normal};this.options.pedantic?(n.block=Fe.pedantic,n.inline=ae.pedantic):this.options.gfm&&(n.block=Fe.gfm,this.options.breaks?n.inline=ae.breaks:n.inline=ae.gfm),this.tokenizer.rules=n}static get rules(){return{block:Fe,inline:ae}}static lex(t,n){return new cr(n).lex(t)}static lexInline(t,n){return new cr(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,` -`),this.blockTokens(t,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(t,n=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(a,u,l)=>u+" ".repeat(l.length));let i,r,s,o;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(i=a.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))){if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length),i.raw.length===1&&n.length>0?n[n.length-1].raw+=` +`+f.slice(o);else{if(l||c.search(/[^ ]/)>=4||k.test(c)||w.test(c)||x.test(c))break;h+=` +`+f}!l&&!f.trim()&&(l=!0),i+=d+` +`,t=t.substring(d.length+1),c=f.slice(o)}}y.loose||(u?y.loose=!0:/\n *\n *$/.test(i)&&(u=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(h),r&&(s=r[0]!=="[ ] ",h=h.replace(/^\[[ xX]\] +/,""))),y.items.push({type:"list_item",raw:i,task:!!r,checked:s,loose:!1,text:h}),y.raw+=i}y.items[y.items.length-1].raw=i.trimRight(),y.items[y.items.length-1].text=h.trimRight(),y.raw=y.raw.trimRight();const v=y.items.length;for(a=0;ak.type==="space"),x=_.length>0&&_.some(k=>/\n.*\n/.test(k.raw));y.loose=x}if(y.loose)for(a=0;a$/,"$1").replace(this.rules.inline._escapes,"$1"):"",s=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:i,raw:n[0],href:r,title:s}}}table(t){const n=this.rules.block.table.exec(t);if(n){const i={type:"table",header:z6(n[1]).map(r=>({text:r})),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(` +`):[]};if(i.header.length===i.align.length){i.raw=n[0];let r=i.align.length,s,o,a,l;for(s=0;s({text:u}));for(r=i.header.length,o=0;o/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):yn(n[0]):n[0]}}link(t){const n=this.rules.inline.link.exec(t);if(n){const i=n[2].trim();if(!this.options.pedantic&&/^$/.test(i))return;const o=_h(i.slice(0,-1),"\\");if((i.length-o.length)%2===0)return}else{const o=aj(n[2],"()");if(o>-1){const l=(n[0].indexOf("!")===0?5:4)+n[1].length+o;n[2]=n[2].substring(0,o),n[0]=n[0].substring(0,l).trim(),n[3]=""}}let r=n[2],s="";if(this.options.pedantic){const o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);o&&(r=o[1],s=o[3])}else s=n[3]?n[3].slice(1,-1):"";return r=r.trim(),/^$/.test(i)?r=r.slice(1):r=r.slice(1,-1)),B6(n,{href:r&&r.replace(this.rules.inline._escapes,"$1"),title:s&&s.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(t,n){let i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){let r=(i[2]||i[1]).replace(/\s+/g," ");if(r=n[r.toLowerCase()],!r){const s=i[0].charAt(0);return{type:"text",raw:s,text:s}}return B6(i,r,i[0],this.lexer)}}emStrong(t,n,i=""){let r=this.rules.inline.emStrong.lDelim.exec(t);if(!r||r[3]&&i.match(/[\p{L}\p{N}]/u))return;if(!(r[1]||r[2]||"")||!i||this.rules.inline.punctuation.exec(i)){const o=r[0].length-1;let a,l,u=o,c=0;const f=r[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(f.lastIndex=0,n=n.slice(-1*t.length+o);(r=f.exec(n))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(l=a.length,r[3]||r[4]){u+=l;continue}else if((r[5]||r[6])&&o%3&&!((o+l)%3)){c+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+c);const d=t.slice(0,o+r.index+l+1);if(Math.min(o,l)%2){const p=d.slice(1,-1);return{type:"em",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}const h=d.slice(2,-2);return{type:"strong",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){const n=this.rules.inline.code.exec(t);if(n){let i=n[2].replace(/\n/g," ");const r=/[^ ]/.test(i),s=/^ /.test(i)&&/ $/.test(i);return r&&s&&(i=i.substring(1,i.length-1)),i=yn(i,!0),{type:"codespan",raw:n[0],text:i}}}br(t){const n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){const n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t,n){const i=this.rules.inline.autolink.exec(t);if(i){let r,s;return i[2]==="@"?(r=yn(this.options.mangle?n(i[1]):i[1]),s="mailto:"+r):(r=yn(i[1]),s=r),{type:"link",raw:i[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(t,n){let i;if(i=this.rules.inline.url.exec(t)){let r,s;if(i[2]==="@")r=yn(this.options.mangle?n(i[0]):i[0]),s="mailto:"+r;else{let o;do o=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0];while(o!==i[0]);r=yn(i[0]),i[1]==="www."?s="http://"+i[0]:s=i[0]}return{type:"link",raw:i[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t,n){const i=this.rules.inline.text.exec(t);if(i){let r;return this.lexer.state.inRawBlock?r=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):yn(i[0]):i[0]:r=yn(this.options.smartypants?n(i[0]):i[0]),{type:"text",raw:i[0],text:r}}}}const Ae={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:vh,lheading:/^((?:(?!^bull ).|\n(?!\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};Ae._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Ae._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Ae.def=it(Ae.def).replace("label",Ae._label).replace("title",Ae._title).getRegex(),Ae.bullet=/(?:[*+-]|\d{1,9}[.)])/,Ae.listItemStart=it(/^( *)(bull) */).replace("bull",Ae.bullet).getRegex(),Ae.list=it(Ae.list).replace(/bull/g,Ae.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ae.def.source+")").getRegex(),Ae._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ae._comment=/|$)/,Ae.html=it(Ae.html,"i").replace("comment",Ae._comment).replace("tag",Ae._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ae.lheading=it(Ae.lheading).replace(/bull/g,Ae.bullet).getRegex(),Ae.paragraph=it(Ae._paragraph).replace("hr",Ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ae._tag).getRegex(),Ae.blockquote=it(Ae.blockquote).replace("paragraph",Ae.paragraph).getRegex(),Ae.normal={...Ae},Ae.gfm={...Ae.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},Ae.gfm.table=it(Ae.gfm.table).replace("hr",Ae.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ae._tag).getRegex(),Ae.gfm.paragraph=it(Ae._paragraph).replace("hr",Ae.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Ae.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Ae._tag).getRegex(),Ae.pedantic={...Ae.normal,html:it(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ae._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:vh,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:it(Ae.normal._paragraph).replace("hr",Ae.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",Ae.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const ae={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:vh,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:vh,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`^|~",ae.punctuation=it(ae.punctuation,"u").replace(/punctuation/g,ae._punctuation).getRegex(),ae.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,ae.anyPunctuation=/\\[punct]/g,ae._escapes=/\\([punct])/g,ae._comment=it(Ae._comment).replace("(?:-->|$)","-->").getRegex(),ae.emStrong.lDelim=it(ae.emStrong.lDelim,"u").replace(/punct/g,ae._punctuation).getRegex(),ae.emStrong.rDelimAst=it(ae.emStrong.rDelimAst,"gu").replace(/punct/g,ae._punctuation).getRegex(),ae.emStrong.rDelimUnd=it(ae.emStrong.rDelimUnd,"gu").replace(/punct/g,ae._punctuation).getRegex(),ae.anyPunctuation=it(ae.anyPunctuation,"gu").replace(/punct/g,ae._punctuation).getRegex(),ae._escapes=it(ae._escapes,"gu").replace(/punct/g,ae._punctuation).getRegex(),ae._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ae._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,ae.autolink=it(ae.autolink).replace("scheme",ae._scheme).replace("email",ae._email).getRegex(),ae._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ae.tag=it(ae.tag).replace("comment",ae._comment).replace("attribute",ae._attribute).getRegex(),ae._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ae._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,ae._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ae.link=it(ae.link).replace("label",ae._label).replace("href",ae._href).replace("title",ae._title).getRegex(),ae.reflink=it(ae.reflink).replace("label",ae._label).replace("ref",Ae._label).getRegex(),ae.nolink=it(ae.nolink).replace("ref",Ae._label).getRegex(),ae.reflinkSearch=it(ae.reflinkSearch,"g").replace("reflink",ae.reflink).replace("nolink",ae.nolink).getRegex(),ae.normal={...ae},ae.pedantic={...ae.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:it(/^!?\[(label)\]\((.*?)\)/).replace("label",ae._label).getRegex(),reflink:it(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ae._label).getRegex()},ae.gfm={...ae.normal,escape:it(ae.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),t+="&#"+i+";";return t}class Qi{constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||ro,this.options.tokenizer=this.options.tokenizer||new xh,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:Ae.normal,inline:ae.normal};this.options.pedantic?(n.block=Ae.pedantic,n.inline=ae.pedantic):this.options.gfm&&(n.block=Ae.gfm,this.options.breaks?n.inline=ae.breaks:n.inline=ae.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ae,inline:ae}}static lex(t,n){return new Qi(n).lex(t)}static lexInline(t,n){return new Qi(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,` +`),this.blockTokens(t,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(t,n=[]){this.options.pedantic?t=t.replace(/\t/g," ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(a,l,u)=>l+" ".repeat(u.length));let i,r,s,o;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(i=a.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))){if(i=this.tokenizer.space(t)){t=t.substring(i.raw.length),i.raw.length===1&&n.length>0?n[n.length-1].raw+=` `:n.push(i);continue}if(i=this.tokenizer.code(t)){t=t.substring(i.raw.length),r=n[n.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=` `+i.raw,r.text+=` `+i.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text):n.push(i);continue}if(i=this.tokenizer.fences(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(t)){t=t.substring(i.raw.length),r=n[n.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=` `+i.raw,r.text+=` -`+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),n.push(i);continue}if(s=t,this.options.extensions&&this.options.extensions.startBlock){let a=1/0;const u=t.slice(1);let l;this.options.extensions.startBlock.forEach(function(c){l=c.call({lexer:this},u),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(s=t.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(s))){r=n[n.length-1],o&&r.type==="paragraph"?(r.raw+=` +`+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(t)){t=t.substring(i.raw.length),n.push(i);continue}if(s=t,this.options.extensions&&this.options.extensions.startBlock){let a=1/0;const l=t.slice(1);let u;this.options.extensions.startBlock.forEach(function(c){u=c.call({lexer:this},l),typeof u=="number"&&u>=0&&(a=Math.min(a,u))}),a<1/0&&a>=0&&(s=t.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(s))){r=n[n.length-1],o&&r.type==="paragraph"?(r.raw+=` `+i.raw,r.text+=` `+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):n.push(i),o=s.length!==t.length,t=t.substring(i.raw.length);continue}if(i=this.tokenizer.text(t)){t=t.substring(i.raw.length),r=n[n.length-1],r&&r.type==="text"?(r.raw+=` `+i.raw,r.text+=` -`+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):n.push(i);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let i,r,s,o=t,a,u,l;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)c.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,a.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(u||(l=""),u=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(i=c.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))){if(i=this.tokenizer.escape(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.tag(t)){t=t.substring(i.raw.length),r=n[n.length-1],r&&i.type==="text"&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):n.push(i);continue}if(i=this.tokenizer.link(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(i.raw.length),r=n[n.length-1],r&&i.type==="text"&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):n.push(i);continue}if(i=this.tokenizer.emStrong(t,o,l)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.codespan(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.br(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.del(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.autolink(t,x4)){t=t.substring(i.raw.length),n.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(t,x4))){t=t.substring(i.raw.length),n.push(i);continue}if(s=t,this.options.extensions&&this.options.extensions.startInline){let c=1/0;const f=t.slice(1);let d;this.options.extensions.startInline.forEach(function(h){d=h.call({lexer:this},f),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(s=t.substring(0,c+1))}if(i=this.tokenizer.inlineText(s,iU)){t=t.substring(i.raw.length),i.raw.slice(-1)!=="_"&&(l=i.raw.slice(-1)),u=!0,r=n[n.length-1],r&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):n.push(i);continue}if(t){const c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return n}}let Gh=class{constructor(t){this.options=t||vo}code(t,n,i){const r=(n||"").match(/\S*/)[0];if(this.options.highlight){const s=this.options.highlight(t,r);s!=null&&s!==t&&(i=!0,t=s)}return t=t.replace(/\n$/,"")+` -`,r?'
'+(i?t:kn(t,!0))+`
-`:"
"+(i?t:kn(t,!0))+`
+`+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):n.push(i);continue}if(t){const a="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let i,r,s,o=t,a,l,u;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)c.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,a.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(l||(u=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(i=c.call({lexer:this},t,n))?(t=t.substring(i.raw.length),n.push(i),!0):!1))){if(i=this.tokenizer.escape(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.tag(t)){t=t.substring(i.raw.length),r=n[n.length-1],r&&i.type==="text"&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):n.push(i);continue}if(i=this.tokenizer.link(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(i.raw.length),r=n[n.length-1],r&&i.type==="text"&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):n.push(i);continue}if(i=this.tokenizer.emStrong(t,o,u)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.codespan(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.br(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.del(t)){t=t.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.autolink(t,j6)){t=t.substring(i.raw.length),n.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(t,j6))){t=t.substring(i.raw.length),n.push(i);continue}if(s=t,this.options.extensions&&this.options.extensions.startInline){let c=1/0;const f=t.slice(1);let d;this.options.extensions.startInline.forEach(function(h){d=h.call({lexer:this},f),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(s=t.substring(0,c+1))}if(i=this.tokenizer.inlineText(s,cj)){t=t.substring(i.raw.length),i.raw.slice(-1)!=="_"&&(u=i.raw.slice(-1)),l=!0,r=n[n.length-1],r&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):n.push(i);continue}if(t){const c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return n}}let wh=class{constructor(t){this.options=t||ro}code(t,n,i){const r=(n||"").match(/\S*/)[0];if(this.options.highlight){const s=this.options.highlight(t,r);s!=null&&s!==t&&(i=!0,t=s)}return t=t.replace(/\n$/,"")+` +`,r?'
'+(i?t:yn(t,!0))+`
+`:"
"+(i?t:yn(t,!0))+`
`}blockquote(t){return`
${t}
`}html(t,n){return t}heading(t,n,i,r){if(this.options.headerIds){const s=this.options.headerPrefix+r.slug(i);return`${t} @@ -60,25 +60,23 @@ ${t} `}tablerow(t){return` ${t} `}tablecell(t,n){const i=n.header?"th":"td";return(n.align?`<${i} align="${n.align}">`:`<${i}>`)+t+` -`}strong(t){return`${t}`}em(t){return`${t}`}codespan(t){return`${t}`}br(){return this.options.xhtml?"
":"
"}del(t){return`${t}`}link(t,n,i){if(t=b4(this.options.sanitize,this.options.baseUrl,t),t===null)return i;let r='",r}image(t,n,i){if(t=b4(this.options.sanitize,this.options.baseUrl,t),t===null)return i;let r=`${i}":">",r}text(t){return t}};class v2{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,n,i){return""+i}image(t,n,i){return""+i}br(){return""}}class Vh{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,n){let i=t,r=0;if(this.seen.hasOwnProperty(i)){r=this.seen[t];do r++,i=t+"-"+r;while(this.seen.hasOwnProperty(i))}return n||(this.seen[t]=r,this.seen[i]=0),i}slug(t,n={}){const i=this.serialize(t);return this.getNextSafeSlug(i,n.dryrun)}}class Ur{constructor(t){this.options=t||vo,this.options.renderer=this.options.renderer||new Gh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new v2,this.slugger=new Vh}static parse(t,n){return new Ur(n).parse(t)}static parseInline(t,n){return new Ur(n).parseInline(t)}parse(t,n=!0){let i="",r,s,o,a,u,l,c,f,d,h,p,g,m,y,b,v,_,x,k;const w=t.length;for(r=0;r0&&b.tokens[0].type==="paragraph"?(b.tokens[0].text=x+" "+b.tokens[0].text,b.tokens[0].tokens&&b.tokens[0].tokens.length>0&&b.tokens[0].tokens[0].type==="text"&&(b.tokens[0].tokens[0].text=x+" "+b.tokens[0].tokens[0].text)):b.tokens.unshift({type:"text",text:x}):y+=x),y+=this.parse(b.tokens,m),d+=this.renderer.listitem(y,_,v);i+=this.renderer.list(d,p,g);continue}case"html":{i+=this.renderer.html(h.text,h.block);continue}case"paragraph":{i+=this.renderer.paragraph(this.parseInline(h.tokens));continue}case"text":{for(d=h.tokens?this.parseInline(h.tokens):h.text;r+1{i=i.concat(this.walkTokens(r[s],n))}):r.tokens&&(i=i.concat(this.walkTokens(r.tokens,n)))}return i}use(...t){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{const r={...i};if(r.async=this.defaults.async||r.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if(s.renderer){const o=n.renderers[s.name];o?n.renderers[s.name]=function(...a){let u=s.renderer.apply(this,a);return u===!1&&(u=o.apply(this,a)),u}:n.renderers[s.name]=s.renderer}if(s.tokenizer){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");n[s.level]?n[s.level].unshift(s.tokenizer):n[s.level]=[s.tokenizer],s.start&&(s.level==="block"?n.startBlock?n.startBlock.push(s.start):n.startBlock=[s.start]:s.level==="inline"&&(n.startInline?n.startInline.push(s.start):n.startInline=[s.start]))}s.childTokens&&(n.childTokens[s.name]=s.childTokens)}),r.extensions=n),i.renderer){const s=this.defaults.renderer||new Gh(this.defaults);for(const o in i.renderer){const a=s[o];s[o]=(...u)=>{let l=i.renderer[o].apply(s,u);return l===!1&&(l=a.apply(s,u)),l}}r.renderer=s}if(i.tokenizer){const s=this.defaults.tokenizer||new Hh(this.defaults);for(const o in i.tokenizer){const a=s[o];s[o]=(...u)=>{let l=i.tokenizer[o].apply(s,u);return l===!1&&(l=a.apply(s,u)),l}}r.tokenizer=s}if(i.hooks){const s=this.defaults.hooks||new Gc;for(const o in i.hooks){const a=s[o];Gc.passThroughHooks.has(o)?s[o]=u=>{if(this.defaults.async)return Promise.resolve(i.hooks[o].call(s,u)).then(c=>a.call(s,c));const l=i.hooks[o].call(s,u);return a.call(s,l)}:s[o]=(...u)=>{let l=i.hooks[o].apply(s,u);return l===!1&&(l=a.apply(s,u)),l}}r.hooks=s}if(i.walkTokens){const s=this.defaults.walkTokens;r.walkTokens=function(o){let a=[];return a.push(i.walkTokens.call(this,o)),s&&(a=a.concat(s.call(this,o))),a}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}}Zu=new WeakSet,m5=function(t,n){return(i,r,s)=>{typeof r=="function"&&(s=r,r=null);const o={...r};r={...this.defaults,...o};const a=u2(this,Zu,rB).call(this,r.silent,r.async,s);if(typeof i>"u"||i===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));if(tU(r,s),r.hooks&&(r.hooks.options=r),s){const u=r.highlight;let l;try{r.hooks&&(i=r.hooks.preprocess(i)),l=t(i,r)}catch(d){return a(d)}const c=d=>{let h;if(!d)try{r.walkTokens&&this.walkTokens(l,r.walkTokens),h=n(l,r),r.hooks&&(h=r.hooks.postprocess(h))}catch(p){d=p}return r.highlight=u,d?a(d):s(null,h)};if(!u||u.length<3||(delete r.highlight,!l.length))return c();let f=0;this.walkTokens(l,d=>{d.type==="code"&&(f++,setTimeout(()=>{u(d.text,d.lang,(h,p)=>{if(h)return c(h);p!=null&&p!==d.text&&(d.text=p,d.escaped=!0),f--,f===0&&c()})},0))}),f===0&&c();return}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(i):i).then(u=>t(u,r)).then(u=>r.walkTokens?Promise.all(this.walkTokens(u,r.walkTokens)).then(()=>u):u).then(u=>n(u,r)).then(u=>r.hooks?r.hooks.postprocess(u):u).catch(a);try{r.hooks&&(i=r.hooks.preprocess(i));const u=t(i,r);r.walkTokens&&this.walkTokens(u,r.walkTokens);let l=n(u,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(u){return a(u)}}},rB=function(t,n,i){return r=>{if(r.message+=` -Please report this to https://github.com/markedjs/marked.`,t){const s="

An error occurred:

"+kn(r.message+"",!0)+"
";if(n)return Promise.resolve(s);if(i){i(null,s);return}return s}if(n)return Promise.reject(r);if(i){i(r);return}throw r}};const $a=new rU(vo);function at(e,t,n){return $a.parse(e,t,n)}at.options=at.setOptions=function(e){return $a.setOptions(e),at.defaults=$a.defaults,h4(at.defaults),at},at.getDefaults=b2,at.defaults=vo,at.use=function(...e){return $a.use(...e),at.defaults=$a.defaults,h4(at.defaults),at},at.walkTokens=function(e,t){return $a.walkTokens(e,t)},at.parseInline=$a.parseInline,at.Parser=Ur,at.parser=Ur.parse,at.Renderer=Gh,at.TextRenderer=v2,at.Lexer=cr,at.lexer=cr.lex,at.Tokenizer=Hh,at.Slugger=Vh,at.Hooks=Gc,at.parse=at,at.options,at.setOptions,at.use,at.walkTokens,at.parseInline,Ur.parse,cr.lex;const w4={};function sU(e){let t;return{c(){t=ce(e[1])},m(n,i){L(n,t,i)},p(n,i){i&2&&Me(t,n[1])},i:X,o:X,d(n){n&&O(t)}}}function oU(e){let t,n;const i=e[5].default,r=yt(i,e,e[4],null);return{c(){t=I("h6"),r&&r.c(),$(t,"id",e[2])},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&vt(r,i,s,s[4],n?bt(i,s[4],o,null):_t(s[4]),null),(!n||o&4)&&$(t,"id",s[2])},i(s){n||(D(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function aU(e){let t,n;const i=e[5].default,r=yt(i,e,e[4],null);return{c(){t=I("h5"),r&&r.c(),$(t,"id",e[2])},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&vt(r,i,s,s[4],n?bt(i,s[4],o,null):_t(s[4]),null),(!n||o&4)&&$(t,"id",s[2])},i(s){n||(D(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function uU(e){let t,n;const i=e[5].default,r=yt(i,e,e[4],null);return{c(){t=I("h4"),r&&r.c(),$(t,"id",e[2])},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&vt(r,i,s,s[4],n?bt(i,s[4],o,null):_t(s[4]),null),(!n||o&4)&&$(t,"id",s[2])},i(s){n||(D(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function lU(e){let t,n;const i=e[5].default,r=yt(i,e,e[4],null);return{c(){t=I("h3"),r&&r.c(),$(t,"id",e[2])},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&vt(r,i,s,s[4],n?bt(i,s[4],o,null):_t(s[4]),null),(!n||o&4)&&$(t,"id",s[2])},i(s){n||(D(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function cU(e){let t,n;const i=e[5].default,r=yt(i,e,e[4],null);return{c(){t=I("h2"),r&&r.c(),$(t,"id",e[2])},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&vt(r,i,s,s[4],n?bt(i,s[4],o,null):_t(s[4]),null),(!n||o&4)&&$(t,"id",s[2])},i(s){n||(D(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function fU(e){let t,n;const i=e[5].default,r=yt(i,e,e[4],null);return{c(){t=I("h1"),r&&r.c(),$(t,"id",e[2])},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&&vt(r,i,s,s[4],n?bt(i,s[4],o,null):_t(s[4]),null),(!n||o&4)&&$(t,"id",s[2])},i(s){n||(D(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function dU(e){let t,n,i,r;const s=[fU,cU,lU,uU,aU,oU,sU],o=[];function a(u,l){return u[0]===1?0:u[0]===2?1:u[0]===3?2:u[0]===4?3:u[0]===5?4:u[0]===6?5:6}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ne()},m(u,l){o[t].m(u,l),L(u,i,l),r=!0},p(u,[l]){let c=t;t=a(u),t===c?o[t].p(u,l):(Ee(),N(o[c],1,1,()=>{o[c]=null}),Ce(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),D(n,1),n.m(i.parentNode,i))},i(u){r||(D(n),r=!0)},o(u){N(n),r=!1},d(u){u&&O(i),o[t].d(u)}}}function hU(e,t,n){let i,{$$slots:r={},$$scope:s}=t,{depth:o}=t,{raw:a}=t,{text:u}=t;const{slug:l,getOptions:c}=E5(w4),f=c();return e.$$set=d=>{"depth"in d&&n(0,o=d.depth),"raw"in d&&n(1,a=d.raw),"text"in d&&n(3,u=d.text),"$$scope"in d&&n(4,s=d.$$scope)},e.$$.update=()=>{e.$$.dirty&8&&n(2,i=f.headerIds?f.headerPrefix+l(u):void 0)},[o,a,i,u,s,r]}class pU extends _e{constructor(t){super(),ve(this,t,hU,dU,pe,{depth:0,raw:1,text:3})}}function gU(e){let t,n;const i=e[1].default,r=yt(i,e,e[0],null);return{c(){t=I("p"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&vt(r,i,s,s[0],n?bt(i,s[0],o,null):_t(s[0]),null)},i(s){n||(D(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function mU(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class yU extends _e{constructor(t){super(),ve(this,t,mU,gU,pe,{})}}function bU(e){let t;const n=e[3].default,i=yt(n,e,e[2],null);return{c(){i&&i.c()},m(r,s){i&&i.m(r,s),t=!0},p(r,[s]){i&&i.p&&(!t||s&4)&&vt(i,n,r,r[2],t?bt(n,r[2],s,null):_t(r[2]),null)},i(r){t||(D(i,r),t=!0)},o(r){N(i,r),t=!1},d(r){i&&i.d(r)}}}function vU(e,t,n){let{$$slots:i={},$$scope:r}=t,{text:s}=t,{raw:o}=t;return e.$$set=a=>{"text"in a&&n(0,s=a.text),"raw"in a&&n(1,o=a.raw),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}let _U=class extends _e{constructor(t){super(),ve(this,t,vU,bU,pe,{text:0,raw:1})}};function xU(e){let t,n;return{c(){t=I("img"),Ph(t.src,n=e[0])||$(t,"src",n),$(t,"title",e[1]),$(t,"alt",e[2])},m(i,r){L(i,t,r)},p(i,[r]){r&1&&!Ph(t.src,n=i[0])&&$(t,"src",n),r&2&&$(t,"title",i[1]),r&4&&$(t,"alt",i[2])},i:X,o:X,d(i){i&&O(t)}}}function wU(e,t,n){let{href:i=""}=t,{title:r=void 0}=t,{text:s=""}=t;return e.$$set=o=>{"href"in o&&n(0,i=o.href),"title"in o&&n(1,r=o.title),"text"in o&&n(2,s=o.text)},[i,r,s]}let kU=class extends _e{constructor(t){super(),ve(this,t,wU,xU,pe,{href:0,title:1,text:2})}};function EU(e){let t,n;const i=e[3].default,r=yt(i,e,e[2],null);return{c(){t=I("a"),r&&r.c(),$(t,"href",e[0]),$(t,"title",e[1])},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&4)&&vt(r,i,s,s[2],n?bt(i,s[2],o,null):_t(s[2]),null),(!n||o&1)&&$(t,"href",s[0]),(!n||o&2)&&$(t,"title",s[1])},i(s){n||(D(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function CU(e,t,n){let{$$slots:i={},$$scope:r}=t,{href:s=""}=t,{title:o=void 0}=t;return e.$$set=a=>{"href"in a&&n(0,s=a.href),"title"in a&&n(1,o=a.title),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}class AU extends _e{constructor(t){super(),ve(this,t,CU,EU,pe,{href:0,title:1})}}function $U(e){let t,n;const i=e[1].default,r=yt(i,e,e[0],null);return{c(){t=I("em"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&vt(r,i,s,s[0],n?bt(i,s[0],o,null):_t(s[0]),null)},i(s){n||(D(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function SU(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class FU extends _e{constructor(t){super(),ve(this,t,SU,$U,pe,{})}}function DU(e){let t,n;const i=e[1].default,r=yt(i,e,e[0],null);return{c(){t=I("del"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&vt(r,i,s,s[0],n?bt(i,s[0],o,null):_t(s[0]),null)},i(s){n||(D(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function TU(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class MU extends _e{constructor(t){super(),ve(this,t,TU,DU,pe,{})}}function NU(e){let t,n=e[0].replace(/`/g,"")+"",i;return{c(){t=I("code"),i=ce(n)},m(r,s){L(r,t,s),R(t,i)},p(r,[s]){s&1&&n!==(n=r[0].replace(/`/g,"")+"")&&Me(i,n)},i:X,o:X,d(r){r&&O(t)}}}function RU(e,t,n){let{raw:i}=t;return e.$$set=r=>{"raw"in r&&n(0,i=r.raw)},[i]}class OU extends _e{constructor(t){super(),ve(this,t,RU,NU,pe,{raw:0})}}function LU(e){let t,n;const i=e[1].default,r=yt(i,e,e[0],null);return{c(){t=I("strong"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&vt(r,i,s,s[0],n?bt(i,s[0],o,null):_t(s[0]),null)},i(s){n||(D(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function IU(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class PU extends _e{constructor(t){super(),ve(this,t,IU,LU,pe,{})}}function zU(e){let t,n;const i=e[1].default,r=yt(i,e,e[0],null);return{c(){t=I("table"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&vt(r,i,s,s[0],n?bt(i,s[0],o,null):_t(s[0]),null)},i(s){n||(D(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function BU(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}let jU=class extends _e{constructor(t){super(),ve(this,t,BU,zU,pe,{})}};function UU(e){let t,n;const i=e[1].default,r=yt(i,e,e[0],null);return{c(){t=I("thead"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&vt(r,i,s,s[0],n?bt(i,s[0],o,null):_t(s[0]),null)},i(s){n||(D(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function qU(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class WU extends _e{constructor(t){super(),ve(this,t,qU,UU,pe,{})}}function HU(e){let t,n;const i=e[1].default,r=yt(i,e,e[0],null);return{c(){t=I("tbody"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&vt(r,i,s,s[0],n?bt(i,s[0],o,null):_t(s[0]),null)},i(s){n||(D(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function GU(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class VU extends _e{constructor(t){super(),ve(this,t,GU,HU,pe,{})}}function YU(e){let t,n;const i=e[1].default,r=yt(i,e,e[0],null);return{c(){t=I("tr"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&vt(r,i,s,s[0],n?bt(i,s[0],o,null):_t(s[0]),null)},i(s){n||(D(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function XU(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class ZU extends _e{constructor(t){super(),ve(this,t,XU,YU,pe,{})}}function KU(e){let t,n;const i=e[3].default,r=yt(i,e,e[2],null);return{c(){t=I("td"),r&&r.c(),$(t,"align",e[1])},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&&vt(r,i,s,s[2],n?bt(i,s[2],o,null):_t(s[2]),null),(!n||o&2)&&$(t,"align",s[1])},i(s){n||(D(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function JU(e){let t,n;const i=e[3].default,r=yt(i,e,e[2],null);return{c(){t=I("th"),r&&r.c(),$(t,"align",e[1])},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&&vt(r,i,s,s[2],n?bt(i,s[2],o,null):_t(s[2]),null),(!n||o&2)&&$(t,"align",s[1])},i(s){n||(D(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function QU(e){let t,n,i,r;const s=[JU,KU],o=[];function a(u,l){return u[0]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ne()},m(u,l){o[t].m(u,l),L(u,i,l),r=!0},p(u,[l]){let c=t;t=a(u),t===c?o[t].p(u,l):(Ee(),N(o[c],1,1,()=>{o[c]=null}),Ce(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),D(n,1),n.m(i.parentNode,i))},i(u){r||(D(n),r=!0)},o(u){N(n),r=!1},d(u){u&&O(i),o[t].d(u)}}}function eq(e,t,n){let{$$slots:i={},$$scope:r}=t,{header:s}=t,{align:o}=t;return e.$$set=a=>{"header"in a&&n(0,s=a.header),"align"in a&&n(1,o=a.align),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}class tq extends _e{constructor(t){super(),ve(this,t,eq,QU,pe,{header:0,align:1})}}function nq(e){let t,n;const i=e[3].default,r=yt(i,e,e[2],null);return{c(){t=I("ul"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&&vt(r,i,s,s[2],n?bt(i,s[2],o,null):_t(s[2]),null)},i(s){n||(D(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function iq(e){let t,n;const i=e[3].default,r=yt(i,e,e[2],null);return{c(){t=I("ol"),r&&r.c(),$(t,"start",e[1])},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&&vt(r,i,s,s[2],n?bt(i,s[2],o,null):_t(s[2]),null),(!n||o&2)&&$(t,"start",s[1])},i(s){n||(D(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function rq(e){let t,n,i,r;const s=[iq,nq],o=[];function a(u,l){return u[0]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ne()},m(u,l){o[t].m(u,l),L(u,i,l),r=!0},p(u,[l]){let c=t;t=a(u),t===c?o[t].p(u,l):(Ee(),N(o[c],1,1,()=>{o[c]=null}),Ce(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),D(n,1),n.m(i.parentNode,i))},i(u){r||(D(n),r=!0)},o(u){N(n),r=!1},d(u){u&&O(i),o[t].d(u)}}}function sq(e,t,n){let{$$slots:i={},$$scope:r}=t,{ordered:s}=t,{start:o}=t;return e.$$set=a=>{"ordered"in a&&n(0,s=a.ordered),"start"in a&&n(1,o=a.start),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}class oq extends _e{constructor(t){super(),ve(this,t,sq,rq,pe,{ordered:0,start:1})}}function aq(e){let t,n;const i=e[1].default,r=yt(i,e,e[0],null);return{c(){t=I("li"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&vt(r,i,s,s[0],n?bt(i,s[0],o,null):_t(s[0]),null)},i(s){n||(D(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function uq(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class lq extends _e{constructor(t){super(),ve(this,t,uq,aq,pe,{})}}function cq(e){let t;return{c(){t=I("hr")},m(n,i){L(n,t,i)},p:X,i:X,o:X,d(n){n&&O(t)}}}class fq extends _e{constructor(t){super(),ve(this,t,null,cq,pe,{})}}function dq(e){let t,n;return{c(){t=new fB(!1),n=Ne(),t.a=n},m(i,r){t.m(e[0],i,r),L(i,n,r)},p(i,[r]){r&1&&t.p(i[0])},i:X,o:X,d(i){i&&(O(n),t.d())}}}function hq(e,t,n){let{text:i}=t;return e.$$set=r=>{"text"in r&&n(0,i=r.text)},[i]}class pq extends _e{constructor(t){super(),ve(this,t,hq,dq,pe,{text:0})}}function gq(e){let t,n;const i=e[1].default,r=yt(i,e,e[0],null);return{c(){t=I("blockquote"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&vt(r,i,s,s[0],n?bt(i,s[0],o,null):_t(s[0]),null)},i(s){n||(D(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function mq(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class yq extends _e{constructor(t){super(),ve(this,t,mq,gq,pe,{})}}function bq(e){let t,n,i;return{c(){t=I("pre"),n=I("code"),i=ce(e[1]),$(t,"class",e[0])},m(r,s){L(r,t,s),R(t,n),R(n,i)},p(r,[s]){s&2&&Me(i,r[1]),s&1&&$(t,"class",r[0])},i:X,o:X,d(r){r&&O(t)}}}function vq(e,t,n){let{lang:i}=t,{text:r}=t;return e.$$set=s=>{"lang"in s&&n(0,i=s.lang),"text"in s&&n(1,r=s.text)},[i,r]}class _q extends _e{constructor(t){super(),ve(this,t,vq,bq,pe,{lang:0,text:1})}}function xq(e){let t,n;const i=e[1].default,r=yt(i,e,e[0],null);return{c(){t=I("br"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(s,o),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&&vt(r,i,s,s[0],n?bt(i,s[0],o,null):_t(s[0]),null)},i(s){n||(D(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function wq(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class kq extends _e{constructor(t){super(),ve(this,t,wq,xq,pe,{})}}const Eq={heading:pU,paragraph:yU,text:_U,image:kU,link:AU,em:FU,strong:PU,codespan:OU,del:MU,table:jU,tablehead:WU,tablebody:VU,tablerow:ZU,tablecell:tq,list:oq,orderedlistitem:null,unorderedlistitem:null,listitem:lq,hr:fq,html:pq,blockquote:yq,code:_q,br:kq},Cq={baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,xhtml:!1};function Aq(e){let t,n;return t=new Aa({props:{tokens:e[0],renderers:e[1]}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,[r]){const s={};r&1&&(s.tokens=i[0]),r&2&&(s.renderers=i[1]),t.$set(s)},i(i){n||(D(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function $q(e,t,n){let i,r,s,o,{source:a=[]}=t,{renderers:u={}}=t,{options:l={}}=t,{isInline:c=!1}=t;const f=f2();let d,h,p;return k5(w4,{slug:g=>r?r.slug(g):"",getOptions:()=>s}),yo(()=>{n(7,p=!0)}),e.$$set=g=>{"source"in g&&n(2,a=g.source),"renderers"in g&&n(3,u=g.renderers),"options"in g&&n(4,l=g.options),"isInline"in g&&n(5,c=g.isInline)},e.$$.update=()=>{e.$$.dirty&4&&n(8,i=Array.isArray(a)),e.$$.dirty&4&&(r=a?new Vh:void 0),e.$$.dirty&16&&n(9,s={...Cq,...l}),e.$$.dirty&869&&(i?n(0,d=a):(n(6,h=new cr(s)),n(0,d=c?h.inlineTokens(a):h.lex(a)),f("parsed",{tokens:d}))),e.$$.dirty&8&&n(1,o={...Eq,...u}),e.$$.dirty&385&&p&&!i&&f("parsed",{tokens:d})},[d,o,a,u,l,c,h,p,i,s]}class Sq extends _e{constructor(t){super(),ve(this,t,$q,Aq,pe,{source:2,renderers:3,options:4,isInline:5})}}function Fq(e){let t,n;return t=new Sq({props:{source:e[0].source}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,[r]){const s={};r&1&&(s.source=i[0].source),t.$set(s)},i(i){n||(D(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function Dq(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class k4 extends _e{constructor(t){super(),ve(this,t,Dq,Fq,pe,{componentData:0})}}function Tq(e){let t,n,i;const r=e[2].default,s=yt(r,e,e[1],null);return{c(){var o;t=I("div"),s&&s.c(),$(t,"id",n=`page-${((o=e[0])==null?void 0:o.title)||"No Title"}`),$(t,"class","page svelte-v7ihqd"),$(t,"data-component","page")},m(o,a){L(o,t,a),s&&s.m(t,null),i=!0},p(o,[a]){var u;s&&s.p&&(!i||a&2)&&vt(s,r,o,o[1],i?bt(r,o[1],a,null):_t(o[1]),null),(!i||a&1&&n!==(n=`page-${((u=o[0])==null?void 0:u.title)||"No Title"}`))&&$(t,"id",n)},i(o){i||(D(s,o),i=!0)},o(o){N(s,o),i=!1},d(o){o&&O(t),s&&s.d(o)}}}function Mq(e,t,n){let{$$slots:i={},$$scope:r}=t,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(0,s=o.componentData),"$$scope"in o&&n(1,r=o.$$scope)},[s,r,i]}class Nq extends _e{constructor(t){super(),ve(this,t,Mq,Tq,pe,{componentData:0})}}function E4(e){let t,n,i=e[5]&&C4(e),r=e[4]&&A4(e);return{c(){t=I("div"),i&&i.c(),n=ge(),r&&r.c(),$(t,"class","info svelte-ljrmzp")},m(s,o){L(s,t,o),i&&i.m(t,null),R(t,n),r&&r.m(t,null)},p(s,o){s[5]?i?i.p(s,o):(i=C4(s),i.c(),i.m(t,n)):i&&(i.d(1),i=null),s[4]?r?r.p(s,o):(r=A4(s),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(s){s&&O(t),i&&i.d(),r&&r.d()}}}function C4(e){let t,n,i,r,s;return{c(){t=I("label"),n=ce(e[5]),i=ge(),r=I("span"),s=ce(e[3]),$(r,"class","labelValue svelte-ljrmzp"),$(t,"for",e[6]),$(t,"class","svelte-ljrmzp")},m(o,a){L(o,t,a),R(t,n),R(t,i),R(t,r),R(r,s)},p(o,a){a&32&&Me(n,o[5]),a&8&&Me(s,o[3]),a&64&&$(t,"for",o[6])},d(o){o&&O(t)}}}function A4(e){let t,n;return{c(){t=I("span"),n=ce(e[4]),$(t,"title",e[4]),$(t,"class","details svelte-ljrmzp")},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&16&&Me(n,i[4]),r&16&&$(t,"title",i[4])},d(i){i&&O(t)}}}function Rq(e){let t,n,i,r,s,o=(e[0]||"")+"",a,u=(e[5]||e[4])&&E4(e);return{c(){t=I("div"),n=I("div"),u&&u.c(),i=ge(),r=I("progress"),s=ce(e[1]),a=ce(o),$(r,"id",e[6]),$(r,"max",e[2]),r.value=e[1],$(r,"style","color: red !important"),$(r,"class","svelte-ljrmzp"),$(n,"class","inner svelte-ljrmzp"),$(t,"class","container svelte-ljrmzp")},m(l,c){L(l,t,c),R(t,n),u&&u.m(n,null),R(n,i),R(n,r),R(r,s),R(r,a)},p(l,[c]){l[5]||l[4]?u?u.p(l,c):(u=E4(l),u.c(),u.m(n,i)):u&&(u.d(1),u=null),c&2&&Me(s,l[1]),c&1&&o!==(o=(l[0]||"")+"")&&Me(a,o),c&64&&$(r,"id",l[6]),c&4&&$(r,"max",l[2]),c&2&&(r.value=l[1])},i:X,o:X,d(l){l&&O(t),u&&u.d()}}}function Oq(e,t,n){let i,r,s,o,a,u,{componentData:l}=t;s==null&&(s=0);let c=s.toString();return e.$$set=f=>{"componentData"in f&&n(7,l=f.componentData)},e.$$.update=()=>{e.$$.dirty&128&&n(2,{max:i,id:r,value:s,label:o,unit:a,details:u}=l,i,(n(6,r),n(7,l)),(n(1,s),n(7,l)),(n(5,o),n(7,l)),(n(0,a),n(7,l)),(n(4,u),n(7,l))),e.$$.dirty&7&&(i?n(3,c=`${s}/${i}`):a&&n(3,c=`${s} ${a}`))},[a,s,i,c,u,o,r,l]}class $4 extends _e{constructor(t){super(),ve(this,t,Oq,Rq,pe,{componentData:7})}}function S4(e){let t,n;return{c(){t=I("h3"),n=ce(e[3])},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&8&&Me(n,i[3])},d(i){i&&O(t)}}}function F4(e){let t,n;return{c(){t=I("p"),n=ce(e[2]),$(t,"class","description")},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&4&&Me(n,i[2])},d(i){i&&O(t)}}}function Lq(e){let t,n,i,r,s,o,a,u,l=e[3]&&S4(e),c=e[2]&&F4(e);const f=e[6].default,d=yt(f,e,e[5],null);return{c(){t=I("section"),n=I("div"),l&&l.c(),i=ge(),c&&c.c(),r=ge(),s=I("div"),d&&d.c(),o=ge(),a=I("hr"),$(n,"class","heading svelte-17n0qr8"),$(s,"class","sectionItems svelte-17n0qr8"),$(s,"style",e[0]),$(a,"class","svelte-17n0qr8"),$(t,"class","container svelte-17n0qr8"),$(t,"data-component","section"),$(t,"data-section-id",e[3]),At(t,"columns",e[1])},m(h,p){L(h,t,p),R(t,n),l&&l.m(n,null),R(n,i),c&&c.m(n,null),R(t,r),R(t,s),d&&d.m(s,null),R(t,o),R(t,a),u=!0},p(h,[p]){h[3]?l?l.p(h,p):(l=S4(h),l.c(),l.m(n,i)):l&&(l.d(1),l=null),h[2]?c?c.p(h,p):(c=F4(h),c.c(),c.m(n,null)):c&&(c.d(1),c=null),d&&d.p&&(!u||p&32)&&vt(d,f,h,h[5],u?bt(f,h[5],p,null):_t(h[5]),null),(!u||p&1)&&$(s,"style",h[0]),(!u||p&8)&&$(t,"data-section-id",h[3]),(!u||p&2)&&At(t,"columns",h[1])},i(h){u||(D(d,h),u=!0)},o(h){N(d,h),u=!1},d(h){h&&O(t),l&&l.d(),c&&c.d(),d&&d.d(h)}}}function Iq(e,t,n){let i,r,s,{$$slots:o={},$$scope:a}=t,{componentData:u}=t,l;return s&&(l=`grid-template-columns: repeat(${s||1}, 1fr);`),e.$$set=c=>{"componentData"in c&&n(4,u=c.componentData),"$$scope"in c&&n(5,a=c.$$scope)},e.$$.update=()=>{e.$$.dirty&16&&n(3,{title:i,subtitle:r,columns:s}=u,i,(n(2,r),n(4,u)),(n(1,s),n(4,u)))},[l,s,r,i,u,a,o]}class Pq extends _e{constructor(t){super(),ve(this,t,Iq,Lq,pe,{componentData:4})}}const zq=/("(?:[^\\"]|\\.)*")|[:,]/g;function _2(e,t={}){const n=JSON.stringify([1],void 0,t.indent===void 0?2:t.indent).slice(2,-3),i=n===""?1/0:t.maxLength===void 0?80:t.maxLength;let{replacer:r}=t;return function s(o,a,u){o&&typeof o.toJSON=="function"&&(o=o.toJSON());const l=JSON.stringify(o,r);if(l===void 0)return l;const c=i-a.length-u;if(l.length<=c){const f=l.replace(zq,(d,h)=>h||`${d} `);if(f.length<=c)return f}if(r!=null&&(o=JSON.parse(l),r=void 0),typeof o=="object"&&o!==null){const f=a+n,d=[];let h=0,p,g;if(Array.isArray(o)){p="[",g="]";const{length:m}=o;for(;h0)return[p,n+d.join(`, +`}strong(t){return`${t}`}em(t){return`${t}`}codespan(t){return`${t}`}br(){return this.options.xhtml?"
":"
"}del(t){return`${t}`}link(t,n,i){if(t=P6(this.options.sanitize,this.options.baseUrl,t),t===null)return i;let r='
",r}image(t,n,i){if(t=P6(this.options.sanitize,this.options.baseUrl,t),t===null)return i;let r=`${i}":">",r}text(t){return t}};class Um{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,n,i){return""+i}image(t,n,i){return""+i}br(){return""}}class kh{constructor(){this.seen={}}serialize(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(t,n){let i=t,r=0;if(this.seen.hasOwnProperty(i)){r=this.seen[t];do r++,i=t+"-"+r;while(this.seen.hasOwnProperty(i))}return n||(this.seen[t]=r,this.seen[i]=0),i}slug(t,n={}){const i=this.serialize(t);return this.getNextSafeSlug(i,n.dryrun)}}class Tr{constructor(t){this.options=t||ro,this.options.renderer=this.options.renderer||new wh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Um,this.slugger=new kh}static parse(t,n){return new Tr(n).parse(t)}static parseInline(t,n){return new Tr(n).parseInline(t)}parse(t,n=!0){let i="",r,s,o,a,l,u,c,f,d,h,p,g,m,y,b,v,_,x,k;const w=t.length;for(r=0;r0&&b.tokens[0].type==="paragraph"?(b.tokens[0].text=x+" "+b.tokens[0].text,b.tokens[0].tokens&&b.tokens[0].tokens.length>0&&b.tokens[0].tokens[0].type==="text"&&(b.tokens[0].tokens[0].text=x+" "+b.tokens[0].tokens[0].text)):b.tokens.unshift({type:"text",text:x}):y+=x),y+=this.parse(b.tokens,m),d+=this.renderer.listitem(y,_,v);i+=this.renderer.list(d,p,g);continue}case"html":{i+=this.renderer.html(h.text,h.block);continue}case"paragraph":{i+=this.renderer.paragraph(this.parseInline(h.tokens));continue}case"text":{for(d=h.tokens?this.parseInline(h.tokens):h.text;r+1{i=i.concat(this.walkTokens(r[s],n))}):r.tokens&&(i=i.concat(this.walkTokens(r.tokens,n)))}return i}use(...t){const n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(i=>{const r={...i};if(r.async=this.defaults.async||r.async||!1,i.extensions&&(i.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if(s.renderer){const o=n.renderers[s.name];o?n.renderers[s.name]=function(...a){let l=s.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:n.renderers[s.name]=s.renderer}if(s.tokenizer){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");n[s.level]?n[s.level].unshift(s.tokenizer):n[s.level]=[s.tokenizer],s.start&&(s.level==="block"?n.startBlock?n.startBlock.push(s.start):n.startBlock=[s.start]:s.level==="inline"&&(n.startInline?n.startInline.push(s.start):n.startInline=[s.start]))}s.childTokens&&(n.childTokens[s.name]=s.childTokens)}),r.extensions=n),i.renderer){const s=this.defaults.renderer||new wh(this.defaults);for(const o in i.renderer){const a=s[o];s[o]=(...l)=>{let u=i.renderer[o].apply(s,l);return u===!1&&(u=a.apply(s,l)),u}}r.renderer=s}if(i.tokenizer){const s=this.defaults.tokenizer||new xh(this.defaults);for(const o in i.tokenizer){const a=s[o];s[o]=(...l)=>{let u=i.tokenizer[o].apply(s,l);return u===!1&&(u=a.apply(s,l)),u}}r.tokenizer=s}if(i.hooks){const s=this.defaults.hooks||new Tc;for(const o in i.hooks){const a=s[o];Tc.passThroughHooks.has(o)?s[o]=l=>{if(this.defaults.async)return Promise.resolve(i.hooks[o].call(s,l)).then(c=>a.call(s,c));const u=i.hooks[o].call(s,l);return a.call(s,u)}:s[o]=(...l)=>{let u=i.hooks[o].apply(s,l);return u===!1&&(u=a.apply(s,l)),u}}r.hooks=s}if(i.walkTokens){const s=this.defaults.walkTokens;r.walkTokens=function(o){let a=[];return a.push(i.walkTokens.call(this,o)),s&&(a=a.concat(s.call(this,o))),a}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}}Dl=new WeakSet,I5=function(t,n){return(i,r,s)=>{typeof r=="function"&&(s=r,r=null);const o={...r};r={...this.defaults,...o};const a=Mm(this,Dl,fz).call(this,r.silent,r.async,s);if(typeof i>"u"||i===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));if(lj(r,s),r.hooks&&(r.hooks.options=r),s){const l=r.highlight;let u;try{r.hooks&&(i=r.hooks.preprocess(i)),u=t(i,r)}catch(d){return a(d)}const c=d=>{let h;if(!d)try{r.walkTokens&&this.walkTokens(u,r.walkTokens),h=n(u,r),r.hooks&&(h=r.hooks.postprocess(h))}catch(p){d=p}return r.highlight=l,d?a(d):s(null,h)};if(!l||l.length<3||(delete r.highlight,!u.length))return c();let f=0;this.walkTokens(u,d=>{d.type==="code"&&(f++,setTimeout(()=>{l(d.text,d.lang,(h,p)=>{if(h)return c(h);p!=null&&p!==d.text&&(d.text=p,d.escaped=!0),f--,f===0&&c()})},0))}),f===0&&c();return}if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(i):i).then(l=>t(l,r)).then(l=>r.walkTokens?Promise.all(this.walkTokens(l,r.walkTokens)).then(()=>l):l).then(l=>n(l,r)).then(l=>r.hooks?r.hooks.postprocess(l):l).catch(a);try{r.hooks&&(i=r.hooks.preprocess(i));const l=t(i,r);r.walkTokens&&this.walkTokens(l,r.walkTokens);let u=n(l,r);return r.hooks&&(u=r.hooks.postprocess(u)),u}catch(l){return a(l)}}},fz=function(t,n,i){return r=>{if(r.message+=` +Please report this to https://github.com/markedjs/marked.`,t){const s="

An error occurred:

"+yn(r.message+"",!0)+"
";if(n)return Promise.resolve(s);if(i){i(null,s);return}return s}if(n)return Promise.reject(r);if(i){i(r);return}throw r}};const da=new fj(ro);function at(e,t,n){return da.parse(e,t,n)}at.options=at.setOptions=function(e){return da.setOptions(e),at.defaults=da.defaults,N6(at.defaults),at},at.getDefaults=jm,at.defaults=ro,at.use=function(...e){return da.use(...e),at.defaults=da.defaults,N6(at.defaults),at},at.walkTokens=function(e,t){return da.walkTokens(e,t)},at.parseInline=da.parseInline,at.Parser=Tr,at.parser=Tr.parse,at.Renderer=wh,at.TextRenderer=Um,at.Lexer=Qi,at.lexer=Qi.lex,at.Tokenizer=xh,at.Slugger=kh,at.Hooks=Tc,at.parse=at,at.options,at.setOptions,at.use,at.walkTokens,at.parseInline,Tr.parse,Qi.lex;const U6={};function dj(e){let t;return{c(){t=ce(e[1])},m(n,i){L(n,t,i)},p(n,i){i&2&&Me(t,n[1])},i:Y,o:Y,d(n){n&&O(t)}}}function hj(e){let t,n;const i=e[5].default,r=ht(i,e,e[4],null);return{c(){t=I("h6"),r&&r.c(),C(t,"id",e[2])},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&>(r,i,s,s[4],n?pt(i,s[4],o,null):mt(s[4]),null),(!n||o&4)&&C(t,"id",s[2])},i(s){n||(T(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function pj(e){let t,n;const i=e[5].default,r=ht(i,e,e[4],null);return{c(){t=I("h5"),r&&r.c(),C(t,"id",e[2])},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&>(r,i,s,s[4],n?pt(i,s[4],o,null):mt(s[4]),null),(!n||o&4)&&C(t,"id",s[2])},i(s){n||(T(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function gj(e){let t,n;const i=e[5].default,r=ht(i,e,e[4],null);return{c(){t=I("h4"),r&&r.c(),C(t,"id",e[2])},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&>(r,i,s,s[4],n?pt(i,s[4],o,null):mt(s[4]),null),(!n||o&4)&&C(t,"id",s[2])},i(s){n||(T(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function mj(e){let t,n;const i=e[5].default,r=ht(i,e,e[4],null);return{c(){t=I("h3"),r&&r.c(),C(t,"id",e[2])},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&>(r,i,s,s[4],n?pt(i,s[4],o,null):mt(s[4]),null),(!n||o&4)&&C(t,"id",s[2])},i(s){n||(T(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function yj(e){let t,n;const i=e[5].default,r=ht(i,e,e[4],null);return{c(){t=I("h2"),r&&r.c(),C(t,"id",e[2])},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&>(r,i,s,s[4],n?pt(i,s[4],o,null):mt(s[4]),null),(!n||o&4)&&C(t,"id",s[2])},i(s){n||(T(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function bj(e){let t,n;const i=e[5].default,r=ht(i,e,e[4],null);return{c(){t=I("h1"),r&&r.c(),C(t,"id",e[2])},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&16)&>(r,i,s,s[4],n?pt(i,s[4],o,null):mt(s[4]),null),(!n||o&4)&&C(t,"id",s[2])},i(s){n||(T(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function vj(e){let t,n,i,r;const s=[bj,yj,mj,gj,pj,hj,dj],o=[];function a(l,u){return l[0]===1?0:l[0]===2?1:l[0]===3?2:l[0]===4?3:l[0]===5?4:l[0]===6?5:6}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=De()},m(l,u){o[t].m(l,u),L(l,i,u),r=!0},p(l,[u]){let c=t;t=a(l),t===c?o[t].p(l,u):(ke(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),T(n,1),n.m(i.parentNode,i))},i(l){r||(T(n),r=!0)},o(l){N(n),r=!1},d(l){l&&O(i),o[t].d(l)}}}function _j(e,t,n){let i,{$$slots:r={},$$scope:s}=t,{depth:o}=t,{raw:a}=t,{text:l}=t;const{slug:u,getOptions:c}=W5(U6),f=c();return e.$$set=d=>{"depth"in d&&n(0,o=d.depth),"raw"in d&&n(1,a=d.raw),"text"in d&&n(3,l=d.text),"$$scope"in d&&n(4,s=d.$$scope)},e.$$.update=()=>{e.$$.dirty&8&&n(2,i=f.headerIds?f.headerPrefix+u(l):void 0)},[o,a,i,l,s,r]}class xj extends ve{constructor(t){super(),be(this,t,_j,vj,pe,{depth:0,raw:1,text:3})}}function wj(e){let t,n;const i=e[1].default,r=ht(i,e,e[0],null);return{c(){t=I("p"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&>(r,i,s,s[0],n?pt(i,s[0],o,null):mt(s[0]),null)},i(s){n||(T(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function kj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class Ej extends ve{constructor(t){super(),be(this,t,kj,wj,pe,{})}}function $j(e){let t;const n=e[3].default,i=ht(n,e,e[2],null);return{c(){i&&i.c()},m(r,s){i&&i.m(r,s),t=!0},p(r,[s]){i&&i.p&&(!t||s&4)&>(i,n,r,r[2],t?pt(n,r[2],s,null):mt(r[2]),null)},i(r){t||(T(i,r),t=!0)},o(r){N(i,r),t=!1},d(r){i&&i.d(r)}}}function Sj(e,t,n){let{$$slots:i={},$$scope:r}=t,{text:s}=t,{raw:o}=t;return e.$$set=a=>{"text"in a&&n(0,s=a.text),"raw"in a&&n(1,o=a.raw),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}let Cj=class extends ve{constructor(t){super(),be(this,t,Sj,$j,pe,{text:0,raw:1})}};function Aj(e){let t,n;return{c(){t=I("img"),ph(t.src,n=e[0])||C(t,"src",n),C(t,"title",e[1]),C(t,"alt",e[2])},m(i,r){L(i,t,r)},p(i,[r]){r&1&&!ph(t.src,n=i[0])&&C(t,"src",n),r&2&&C(t,"title",i[1]),r&4&&C(t,"alt",i[2])},i:Y,o:Y,d(i){i&&O(t)}}}function Fj(e,t,n){let{href:i=""}=t,{title:r=void 0}=t,{text:s=""}=t;return e.$$set=o=>{"href"in o&&n(0,i=o.href),"title"in o&&n(1,r=o.title),"text"in o&&n(2,s=o.text)},[i,r,s]}let Tj=class extends ve{constructor(t){super(),be(this,t,Fj,Aj,pe,{href:0,title:1,text:2})}};function Mj(e){let t,n;const i=e[3].default,r=ht(i,e,e[2],null);return{c(){t=I("a"),r&&r.c(),C(t,"href",e[0]),C(t,"title",e[1])},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&4)&>(r,i,s,s[2],n?pt(i,s[2],o,null):mt(s[2]),null),(!n||o&1)&&C(t,"href",s[0]),(!n||o&2)&&C(t,"title",s[1])},i(s){n||(T(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function Dj(e,t,n){let{$$slots:i={},$$scope:r}=t,{href:s=""}=t,{title:o=void 0}=t;return e.$$set=a=>{"href"in a&&n(0,s=a.href),"title"in a&&n(1,o=a.title),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}class Nj extends ve{constructor(t){super(),be(this,t,Dj,Mj,pe,{href:0,title:1})}}function Rj(e){let t,n;const i=e[1].default,r=ht(i,e,e[0],null);return{c(){t=I("em"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&>(r,i,s,s[0],n?pt(i,s[0],o,null):mt(s[0]),null)},i(s){n||(T(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function Oj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class Lj extends ve{constructor(t){super(),be(this,t,Oj,Rj,pe,{})}}function Ij(e){let t,n;const i=e[1].default,r=ht(i,e,e[0],null);return{c(){t=I("del"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&>(r,i,s,s[0],n?pt(i,s[0],o,null):mt(s[0]),null)},i(s){n||(T(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function Pj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class zj extends ve{constructor(t){super(),be(this,t,Pj,Ij,pe,{})}}function Bj(e){let t,n=e[0].replace(/`/g,"")+"",i;return{c(){t=I("code"),i=ce(n)},m(r,s){L(r,t,s),R(t,i)},p(r,[s]){s&1&&n!==(n=r[0].replace(/`/g,"")+"")&&Me(i,n)},i:Y,o:Y,d(r){r&&O(t)}}}function jj(e,t,n){let{raw:i}=t;return e.$$set=r=>{"raw"in r&&n(0,i=r.raw)},[i]}class Uj extends ve{constructor(t){super(),be(this,t,jj,Bj,pe,{raw:0})}}function qj(e){let t,n;const i=e[1].default,r=ht(i,e,e[0],null);return{c(){t=I("strong"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&>(r,i,s,s[0],n?pt(i,s[0],o,null):mt(s[0]),null)},i(s){n||(T(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function Wj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class Hj extends ve{constructor(t){super(),be(this,t,Wj,qj,pe,{})}}function Gj(e){let t,n;const i=e[1].default,r=ht(i,e,e[0],null);return{c(){t=I("table"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&>(r,i,s,s[0],n?pt(i,s[0],o,null):mt(s[0]),null)},i(s){n||(T(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function Vj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}let Yj=class extends ve{constructor(t){super(),be(this,t,Vj,Gj,pe,{})}};function Xj(e){let t,n;const i=e[1].default,r=ht(i,e,e[0],null);return{c(){t=I("thead"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&>(r,i,s,s[0],n?pt(i,s[0],o,null):mt(s[0]),null)},i(s){n||(T(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function Zj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class Kj extends ve{constructor(t){super(),be(this,t,Zj,Xj,pe,{})}}function Jj(e){let t,n;const i=e[1].default,r=ht(i,e,e[0],null);return{c(){t=I("tbody"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&>(r,i,s,s[0],n?pt(i,s[0],o,null):mt(s[0]),null)},i(s){n||(T(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function Qj(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class eU extends ve{constructor(t){super(),be(this,t,Qj,Jj,pe,{})}}function tU(e){let t,n;const i=e[1].default,r=ht(i,e,e[0],null);return{c(){t=I("tr"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&>(r,i,s,s[0],n?pt(i,s[0],o,null):mt(s[0]),null)},i(s){n||(T(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function nU(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class iU extends ve{constructor(t){super(),be(this,t,nU,tU,pe,{})}}function rU(e){let t,n;const i=e[3].default,r=ht(i,e,e[2],null);return{c(){t=I("td"),r&&r.c(),C(t,"align",e[1])},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&>(r,i,s,s[2],n?pt(i,s[2],o,null):mt(s[2]),null),(!n||o&2)&&C(t,"align",s[1])},i(s){n||(T(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function sU(e){let t,n;const i=e[3].default,r=ht(i,e,e[2],null);return{c(){t=I("th"),r&&r.c(),C(t,"align",e[1])},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&>(r,i,s,s[2],n?pt(i,s[2],o,null):mt(s[2]),null),(!n||o&2)&&C(t,"align",s[1])},i(s){n||(T(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function oU(e){let t,n,i,r;const s=[sU,rU],o=[];function a(l,u){return l[0]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=De()},m(l,u){o[t].m(l,u),L(l,i,u),r=!0},p(l,[u]){let c=t;t=a(l),t===c?o[t].p(l,u):(ke(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),T(n,1),n.m(i.parentNode,i))},i(l){r||(T(n),r=!0)},o(l){N(n),r=!1},d(l){l&&O(i),o[t].d(l)}}}function aU(e,t,n){let{$$slots:i={},$$scope:r}=t,{header:s}=t,{align:o}=t;return e.$$set=a=>{"header"in a&&n(0,s=a.header),"align"in a&&n(1,o=a.align),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}class lU extends ve{constructor(t){super(),be(this,t,aU,oU,pe,{header:0,align:1})}}function uU(e){let t,n;const i=e[3].default,r=ht(i,e,e[2],null);return{c(){t=I("ul"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&>(r,i,s,s[2],n?pt(i,s[2],o,null):mt(s[2]),null)},i(s){n||(T(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function cU(e){let t,n;const i=e[3].default,r=ht(i,e,e[2],null);return{c(){t=I("ol"),r&&r.c(),C(t,"start",e[1])},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,o){r&&r.p&&(!n||o&4)&>(r,i,s,s[2],n?pt(i,s[2],o,null):mt(s[2]),null),(!n||o&2)&&C(t,"start",s[1])},i(s){n||(T(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function fU(e){let t,n,i,r;const s=[cU,uU],o=[];function a(l,u){return l[0]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=De()},m(l,u){o[t].m(l,u),L(l,i,u),r=!0},p(l,[u]){let c=t;t=a(l),t===c?o[t].p(l,u):(ke(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),T(n,1),n.m(i.parentNode,i))},i(l){r||(T(n),r=!0)},o(l){N(n),r=!1},d(l){l&&O(i),o[t].d(l)}}}function dU(e,t,n){let{$$slots:i={},$$scope:r}=t,{ordered:s}=t,{start:o}=t;return e.$$set=a=>{"ordered"in a&&n(0,s=a.ordered),"start"in a&&n(1,o=a.start),"$$scope"in a&&n(2,r=a.$$scope)},[s,o,r,i]}class hU extends ve{constructor(t){super(),be(this,t,dU,fU,pe,{ordered:0,start:1})}}function pU(e){let t,n;const i=e[1].default,r=ht(i,e,e[0],null);return{c(){t=I("li"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&>(r,i,s,s[0],n?pt(i,s[0],o,null):mt(s[0]),null)},i(s){n||(T(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function gU(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class mU extends ve{constructor(t){super(),be(this,t,gU,pU,pe,{})}}function yU(e){let t;return{c(){t=I("hr")},m(n,i){L(n,t,i)},p:Y,i:Y,o:Y,d(n){n&&O(t)}}}class bU extends ve{constructor(t){super(),be(this,t,null,yU,pe,{})}}function vU(e){let t,n;return{c(){t=new bz(!1),n=De(),t.a=n},m(i,r){t.m(e[0],i,r),L(i,n,r)},p(i,[r]){r&1&&t.p(i[0])},i:Y,o:Y,d(i){i&&(O(n),t.d())}}}function _U(e,t,n){let{text:i}=t;return e.$$set=r=>{"text"in r&&n(0,i=r.text)},[i]}class xU extends ve{constructor(t){super(),be(this,t,_U,vU,pe,{text:0})}}function wU(e){let t,n;const i=e[1].default,r=ht(i,e,e[0],null);return{c(){t=I("blockquote"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(t,null),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&>(r,i,s,s[0],n?pt(i,s[0],o,null):mt(s[0]),null)},i(s){n||(T(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function kU(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class EU extends ve{constructor(t){super(),be(this,t,kU,wU,pe,{})}}function $U(e){let t,n,i;return{c(){t=I("pre"),n=I("code"),i=ce(e[1]),C(t,"class",e[0])},m(r,s){L(r,t,s),R(t,n),R(n,i)},p(r,[s]){s&2&&Me(i,r[1]),s&1&&C(t,"class",r[0])},i:Y,o:Y,d(r){r&&O(t)}}}function SU(e,t,n){let{lang:i}=t,{text:r}=t;return e.$$set=s=>{"lang"in s&&n(0,i=s.lang),"text"in s&&n(1,r=s.text)},[i,r]}class CU extends ve{constructor(t){super(),be(this,t,SU,$U,pe,{lang:0,text:1})}}function AU(e){let t,n;const i=e[1].default,r=ht(i,e,e[0],null);return{c(){t=I("br"),r&&r.c()},m(s,o){L(s,t,o),r&&r.m(s,o),n=!0},p(s,[o]){r&&r.p&&(!n||o&1)&>(r,i,s,s[0],n?pt(i,s[0],o,null):mt(s[0]),null)},i(s){n||(T(r,s),n=!0)},o(s){N(r,s),n=!1},d(s){s&&O(t),r&&r.d(s)}}}function FU(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class TU extends ve{constructor(t){super(),be(this,t,FU,AU,pe,{})}}const MU={heading:xj,paragraph:Ej,text:Cj,image:Tj,link:Nj,em:Lj,strong:Hj,codespan:Uj,del:zj,table:Yj,tablehead:Kj,tablebody:eU,tablerow:iU,tablecell:lU,list:hU,orderedlistitem:null,unorderedlistitem:null,listitem:mU,hr:bU,html:xU,blockquote:EU,code:CU,br:TU},DU={baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,xhtml:!1};function NU(e){let t,n;return t=new fa({props:{tokens:e[0],renderers:e[1]}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,[r]){const s={};r&1&&(s.tokens=i[0]),r&2&&(s.renderers=i[1]),t.$set(s)},i(i){n||(T(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function RU(e,t,n){let i,r,s,o,{source:a=[]}=t,{renderers:l={}}=t,{options:u={}}=t,{isInline:c=!1}=t;const f=Rm();let d,h,p;return q5(U6,{slug:g=>r?r.slug(g):"",getOptions:()=>s}),no(()=>{n(7,p=!0)}),e.$$set=g=>{"source"in g&&n(2,a=g.source),"renderers"in g&&n(3,l=g.renderers),"options"in g&&n(4,u=g.options),"isInline"in g&&n(5,c=g.isInline)},e.$$.update=()=>{e.$$.dirty&4&&n(8,i=Array.isArray(a)),e.$$.dirty&4&&(r=a?new kh:void 0),e.$$.dirty&16&&n(9,s={...DU,...u}),e.$$.dirty&869&&(i?n(0,d=a):(n(6,h=new Qi(s)),n(0,d=c?h.inlineTokens(a):h.lex(a)),f("parsed",{tokens:d}))),e.$$.dirty&8&&n(1,o={...MU,...l}),e.$$.dirty&385&&p&&!i&&f("parsed",{tokens:d})},[d,o,a,l,u,c,h,p,i,s]}class OU extends ve{constructor(t){super(),be(this,t,RU,NU,pe,{source:2,renderers:3,options:4,isInline:5})}}function LU(e){let t,n;return t=new OU({props:{source:e[0].source}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,[r]){const s={};r&1&&(s.source=i[0].source),t.$set(s)},i(i){n||(T(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function IU(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class q6 extends ve{constructor(t){super(),be(this,t,IU,LU,pe,{componentData:0})}}function PU(e){let t,n,i;const r=e[2].default,s=ht(r,e,e[1],null);return{c(){var o;t=I("div"),s&&s.c(),C(t,"id",n=`page-${((o=e[0])==null?void 0:o.title)||"No Title"}`),C(t,"class","page svelte-v7ihqd"),C(t,"data-component","page")},m(o,a){L(o,t,a),s&&s.m(t,null),i=!0},p(o,[a]){var l;s&&s.p&&(!i||a&2)&>(s,r,o,o[1],i?pt(r,o[1],a,null):mt(o[1]),null),(!i||a&1&&n!==(n=`page-${((l=o[0])==null?void 0:l.title)||"No Title"}`))&&C(t,"id",n)},i(o){i||(T(s,o),i=!0)},o(o){N(s,o),i=!1},d(o){o&&O(t),s&&s.d(o)}}}function zU(e,t,n){let{$$slots:i={},$$scope:r}=t,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(0,s=o.componentData),"$$scope"in o&&n(1,r=o.$$scope)},[s,r,i]}class BU extends ve{constructor(t){super(),be(this,t,zU,PU,pe,{componentData:0})}}function W6(e){let t,n,i=e[5]&&H6(e),r=e[4]&&G6(e);return{c(){t=I("div"),i&&i.c(),n=ge(),r&&r.c(),C(t,"class","info svelte-ljrmzp")},m(s,o){L(s,t,o),i&&i.m(t,null),R(t,n),r&&r.m(t,null)},p(s,o){s[5]?i?i.p(s,o):(i=H6(s),i.c(),i.m(t,n)):i&&(i.d(1),i=null),s[4]?r?r.p(s,o):(r=G6(s),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(s){s&&O(t),i&&i.d(),r&&r.d()}}}function H6(e){let t,n,i,r,s;return{c(){t=I("label"),n=ce(e[5]),i=ge(),r=I("span"),s=ce(e[3]),C(r,"class","labelValue svelte-ljrmzp"),C(t,"for",e[6]),C(t,"class","svelte-ljrmzp")},m(o,a){L(o,t,a),R(t,n),R(t,i),R(t,r),R(r,s)},p(o,a){a&32&&Me(n,o[5]),a&8&&Me(s,o[3]),a&64&&C(t,"for",o[6])},d(o){o&&O(t)}}}function G6(e){let t,n;return{c(){t=I("span"),n=ce(e[4]),C(t,"title",e[4]),C(t,"class","details svelte-ljrmzp")},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&16&&Me(n,i[4]),r&16&&C(t,"title",i[4])},d(i){i&&O(t)}}}function jU(e){let t,n,i,r,s,o=(e[0]||"")+"",a,l=(e[5]||e[4])&&W6(e);return{c(){t=I("div"),n=I("div"),l&&l.c(),i=ge(),r=I("progress"),s=ce(e[1]),a=ce(o),C(r,"id",e[6]),C(r,"max",e[2]),r.value=e[1],C(r,"style","color: red !important"),C(r,"class","svelte-ljrmzp"),C(n,"class","inner svelte-ljrmzp"),C(t,"class","container svelte-ljrmzp")},m(u,c){L(u,t,c),R(t,n),l&&l.m(n,null),R(n,i),R(n,r),R(r,s),R(r,a)},p(u,[c]){u[5]||u[4]?l?l.p(u,c):(l=W6(u),l.c(),l.m(n,i)):l&&(l.d(1),l=null),c&2&&Me(s,u[1]),c&1&&o!==(o=(u[0]||"")+"")&&Me(a,o),c&64&&C(r,"id",u[6]),c&4&&C(r,"max",u[2]),c&2&&(r.value=u[1])},i:Y,o:Y,d(u){u&&O(t),l&&l.d()}}}function UU(e,t,n){let i,r,s,o,a,l,{componentData:u}=t;s==null&&(s=0);let c=s.toString();return e.$$set=f=>{"componentData"in f&&n(7,u=f.componentData)},e.$$.update=()=>{e.$$.dirty&128&&n(2,{max:i,id:r,value:s,label:o,unit:a,details:l}=u,i,(n(6,r),n(7,u)),(n(1,s),n(7,u)),(n(5,o),n(7,u)),(n(0,a),n(7,u)),(n(4,l),n(7,u))),e.$$.dirty&7&&(i?n(3,c=`${s}/${i}`):a&&n(3,c=`${s} ${a}`))},[a,s,i,c,l,o,r,u]}class V6 extends ve{constructor(t){super(),be(this,t,UU,jU,pe,{componentData:7})}}function Y6(e){let t,n;return{c(){t=I("h3"),n=ce(e[3])},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&8&&Me(n,i[3])},d(i){i&&O(t)}}}function X6(e){let t,n;return{c(){t=I("p"),n=ce(e[2]),C(t,"class","description")},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&4&&Me(n,i[2])},d(i){i&&O(t)}}}function qU(e){let t,n,i,r,s,o,a,l,u=e[3]&&Y6(e),c=e[2]&&X6(e);const f=e[6].default,d=ht(f,e,e[5],null);return{c(){t=I("section"),n=I("div"),u&&u.c(),i=ge(),c&&c.c(),r=ge(),s=I("div"),d&&d.c(),o=ge(),a=I("hr"),C(n,"class","heading svelte-17n0qr8"),C(s,"class","sectionItems svelte-17n0qr8"),C(s,"style",e[0]),C(a,"class","svelte-17n0qr8"),C(t,"class","container svelte-17n0qr8"),C(t,"data-component","section"),C(t,"data-section-id",e[3]),wt(t,"columns",e[1])},m(h,p){L(h,t,p),R(t,n),u&&u.m(n,null),R(n,i),c&&c.m(n,null),R(t,r),R(t,s),d&&d.m(s,null),R(t,o),R(t,a),l=!0},p(h,[p]){h[3]?u?u.p(h,p):(u=Y6(h),u.c(),u.m(n,i)):u&&(u.d(1),u=null),h[2]?c?c.p(h,p):(c=X6(h),c.c(),c.m(n,null)):c&&(c.d(1),c=null),d&&d.p&&(!l||p&32)&>(d,f,h,h[5],l?pt(f,h[5],p,null):mt(h[5]),null),(!l||p&1)&&C(s,"style",h[0]),(!l||p&8)&&C(t,"data-section-id",h[3]),(!l||p&2)&&wt(t,"columns",h[1])},i(h){l||(T(d,h),l=!0)},o(h){N(d,h),l=!1},d(h){h&&O(t),u&&u.d(),c&&c.d(),d&&d.d(h)}}}function WU(e,t,n){let i,r,s,{$$slots:o={},$$scope:a}=t,{componentData:l}=t,u;return s&&(u=`grid-template-columns: repeat(${s||1}, 1fr);`),e.$$set=c=>{"componentData"in c&&n(4,l=c.componentData),"$$scope"in c&&n(5,a=c.$$scope)},e.$$.update=()=>{e.$$.dirty&16&&n(3,{title:i,subtitle:r,columns:s}=l,i,(n(2,r),n(4,l)),(n(1,s),n(4,l)))},[u,s,r,i,l,a,o]}class HU extends ve{constructor(t){super(),be(this,t,WU,qU,pe,{componentData:4})}}const GU=/("(?:[^\\"]|\\.)*")|[:,]/g;function qm(e,t={}){const n=JSON.stringify([1],void 0,t.indent===void 0?2:t.indent).slice(2,-3),i=n===""?1/0:t.maxLength===void 0?80:t.maxLength;let{replacer:r}=t;return function s(o,a,l){o&&typeof o.toJSON=="function"&&(o=o.toJSON());const u=JSON.stringify(o,r);if(u===void 0)return u;const c=i-a.length-l;if(u.length<=c){const f=u.replace(GU,(d,h)=>h||`${d} `);if(f.length<=c)return f}if(r!=null&&(o=JSON.parse(u),r=void 0),typeof o=="object"&&o!==null){const f=a+n,d=[];let h=0,p,g;if(Array.isArray(o)){p="[",g="]";const{length:m}=o;for(;h0)return[p,n+d.join(`, ${f}`),g].join(` -${a}`)}return l}(e,"",0)}function si(e,t,n){return e.fields=t||[],e.fname=n,e}function Rt(e){return e==null?null:e.fname}function En(e){return e==null?null:e.fields}function D4(e){return e.length===1?Bq(e[0]):jq(e)}const Bq=e=>function(t){return t[e]},jq=e=>{const t=e.length;return function(n){for(let i=0;io?l():o=a+1:u==="["?(a>o&&l(),r=o=a+1):u==="]"&&(r||W("Access path missing open bracket: "+e),r>0&&l(),r=0,o=a+1)}return r&&W("Access path missing closing bracket: "+e),i&&W("Access path missing closing quote: "+e),a>o&&(a++,l()),t}function Bi(e,t,n){const i=qr(e);return e=i.length===1?i[0]:e,si((n&&n.get||D4)(i),[e],t||e)}const Vc=Bi("id"),Cn=si(e=>e,[],"identity"),_o=si(()=>0,[],"zero"),nl=si(()=>1,[],"one"),ji=si(()=>!0,[],"true"),xo=si(()=>!1,[],"false");function Uq(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const T4=0,x2=1,w2=2,M4=3,N4=4;function k2(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Uq,i=e||T4;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=x2&&n(t||"error","ERROR",arguments),this},warn(){return i>=w2&&n(t||"warn","WARN",arguments),this},info(){return i>=M4&&n(t||"log","INFO",arguments),this},debug(){return i>=N4&&n(t||"log","DEBUG",arguments),this}}}var G=Array.isArray;function ie(e){return e===Object(e)}const R4=e=>e!=="__proto__";function il(){for(var e=arguments.length,t=new Array(e),n=0;n{for(const s in r)if(s==="signals")i.signals=qq(i.signals,r.signals);else{const o=s==="legend"?{layout:1}:s==="style"?!0:null;rl(i,s,r[s],o)}return i},{})}function rl(e,t,n,i){if(!R4(t))return;let r,s;if(ie(n)&&!G(n)){s=ie(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?rl(s,r,n[r]):R4(r)&&(s[r]=n[r])}else e[t]=n}function qq(e,t){if(e==null)return t;const n={},i=[];function r(s){n[s.name]||(n[s.name]=1,i.push(s))}return t.forEach(r),e.forEach(r),i}function Ye(e){return e[e.length-1]}function An(e){return e==null||e===""?null:+e}const O4=e=>t=>e*Math.exp(t),L4=e=>t=>Math.log(e*t),I4=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),P4=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,Yh=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function Xh(e,t,n,i){const r=n(e[0]),s=n(Ye(e)),o=(s-r)*t;return[i(r-o),i(s-o)]}function z4(e,t){return Xh(e,t,An,Cn)}function B4(e,t){var n=Math.sign(e[0]);return Xh(e,t,L4(n),O4(n))}function j4(e,t,n){return Xh(e,t,Yh(n),Yh(1/n))}function U4(e,t,n){return Xh(e,t,I4(n),P4(n))}function Zh(e,t,n,i,r){const s=i(e[0]),o=i(Ye(e)),a=t!=null?i(t):(s+o)/2;return[r(a+(s-a)*n),r(a+(o-a)*n)]}function E2(e,t,n){return Zh(e,t,n,An,Cn)}function C2(e,t,n){const i=Math.sign(e[0]);return Zh(e,t,n,L4(i),O4(i))}function Kh(e,t,n,i){return Zh(e,t,n,Yh(i),Yh(1/i))}function A2(e,t,n,i){return Zh(e,t,n,I4(i),P4(i))}function q4(e){return 1+~~(new Date(e).getMonth()/3)}function W4(e){return 1+~~(new Date(e).getUTCMonth()/3)}function se(e){return e!=null?G(e)?e:[e]:[]}function H4(e,t,n){let i=e[0],r=e[1],s;return r=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-s),i+s]}function ze(e){return typeof e=="function"}const Wq="descending";function $2(e,t,n){n=n||{},t=se(t)||[];const i=[],r=[],s={},o=n.comparator||Hq;return se(e).forEach((a,u)=>{a!=null&&(i.push(t[u]===Wq?-1:1),r.push(a=ze(a)?a:Bi(a,null,n)),(En(a)||[]).forEach(l=>s[l]=1))}),r.length===0?null:si(o(r,i),Object.keys(s))}const sl=(e,t)=>(et||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),Hq=(e,t)=>e.length===1?Gq(e[0],t[0]):Vq(e,t,e.length),Gq=(e,t)=>function(n,i){return sl(e(n),e(i))*t},Vq=(e,t,n)=>(t.push(0),function(i,r){let s,o=0,a=-1;for(;o===0&&++ae}function S2(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function Be(e){for(let t,n,i=1,r=arguments.length;io&&(o=r))}else{for(r=t(e[n]);no&&(o=r))}return[s,o]}function G4(e,t){const n=e.length;let i=-1,r,s,o,a,u;if(t==null){for(;++i=s){r=o=s;break}if(i===n)return[-1,-1];for(a=u=i;++is&&(r=s,a=i),o=s){r=o=s;break}if(i===n)return[-1,-1];for(a=u=i;++is&&(r=s,a=i),o{r.set(s,e[s])}),r}function V4(e,t,n,i,r,s){if(!n&&n!==0)return s;const o=+n;let a=e[0],u=Ye(e),l;us&&(o=r,r=s,s=o),n=n===void 0||n,i=i===void 0||i,(n?r<=e:ra.replace(/\\(.)/g,"$1")):se(e));const i=e&&e.length,r=n&&n.get||D4,s=a=>r(t?[a]:qr(a));let o;if(!i)o=function(){return""};else if(i===1){const a=s(e[0]);o=function(u){return""+a(u)}}else{const a=e.map(s);o=function(u){let l=""+a[0](u),c=0;for(;++c{t={},n={},i=0},s=(o,a)=>(++i>e&&(n=t,t={},i=1),t[o]=a);return r(),{clear:r,has:o=>ue(t,o)||ue(n,o),get:o=>ue(t,o)?t[o]:ue(n,o)?s(o,n[o]):void 0,set:(o,a)=>ue(t,o)?t[o]=a:s(o,a)}}function K4(e,t,n,i){const r=t.length,s=n.length;if(!s)return t;if(!r)return n;const o=i||new t.constructor(r+s);let a=0,u=0,l=0;for(;a0?n[u++]:t[a++];for(;a=0;)n+=e;return n}function J4(e,t,n,i){const r=n||" ",s=e+"",o=t-s.length;return o<=0?s:i==="left"?Yc(r,o)+s:i==="center"?Yc(r,~~(o/2))+s+Yc(r,Math.ceil(o/2)):s+Yc(r,o)}function Xc(e){return e&&Ye(e)-e[0]||0}function ee(e){return G(e)?"["+e.map(ee)+"]":ie(e)||re(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function T2(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const Xq=e=>Je(e)||ko(e)?e:Date.parse(e);function M2(e,t){return t=t||Xq,e==null||e===""?null:t(e)}function N2(e){return e==null||e===""?null:e+""}function fr(e){const t={},n=e.length;for(let i=0;i9999?"+"+oi(e,6):oi(e,4)}function Jq(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":Kq(e.getUTCFullYear())+"-"+oi(e.getUTCMonth()+1,2)+"-"+oi(e.getUTCDate(),2)+(r?"T"+oi(t,2)+":"+oi(n,2)+":"+oi(i,2)+"."+oi(r,3)+"Z":i?"T"+oi(t,2)+":"+oi(n,2)+":"+oi(i,2)+"Z":n||t?"T"+oi(t,2)+":"+oi(n,2)+"Z":"")}function Qq(e){var t=new RegExp('["'+e+` -\r]`),n=e.charCodeAt(0);function i(f,d){var h,p,g=r(f,function(m,y){if(h)return h(m,y-1);p=m,h=d?Zq(m,d):t8(m)});return g.columns=p||[],g}function r(f,d){var h=[],p=f.length,g=0,m=0,y,b=p<=0,v=!1;f.charCodeAt(p-1)===Zc&&--p,f.charCodeAt(p-1)===L2&&--p;function _(){if(b)return R2;if(v)return v=!1,e8;var k,w=g,E;if(f.charCodeAt(w)===O2){for(;g++=p?b=!0:(E=f.charCodeAt(g++))===Zc?v=!0:E===L2&&(v=!0,f.charCodeAt(g)===Zc&&++g),f.slice(w+1,k-1).replace(/""/g,'"')}for(;g1)i=aW(e,t,n);else for(r=0,i=new Array(s=e.arcs.length);rt?1:e>=t?0:NaN}function uW(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function ul(e){let t,n,i;e.length!==2?(t=Ts,n=(a,u)=>Ts(e(a),u),i=(a,u)=>e(a)-u):(t=e===Ts||e===uW?e:lW,n=e,i=e);function r(a,u,l=0,c=a.length){if(l>>1;n(a[f],u)<0?l=f+1:c=f}while(l>>1;n(a[f],u)<=0?l=f+1:c=f}while(ll&&i(a[f-1],u)>-i(a[f],u)?f-1:f}return{left:r,center:o,right:s}}function lW(){return 0}function s8(e){return e===null?NaN:+e}function*cW(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(i=+i)>=i&&(yield i)}}const o8=ul(Ts),Co=o8.right,fW=o8.left;ul(s8).center;function dW(e,t){let n=0,i,r=0,s=0;if(t===void 0)for(let o of e)o!=null&&(o=+o)>=o&&(i=o-r,r+=i/++n,s+=i*(o-r));else{let o=-1;for(let a of e)(a=t(a,++o,e))!=null&&(a=+a)>=a&&(i=a-r,r+=i/++n,s+=i*(a-r))}if(n>1)return s/(n-1)}function hW(e,t){const n=dW(e,t);return n&&Math.sqrt(n)}class Un{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let i=0;for(let r=0;r0){for(o=t[--n];n>0&&(i=o,r=t[--n],o=i+r,s=r-(o-i),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(r=s*2,i=o+r,r==i-o&&(o=i))}return o}}class a8 extends Map{constructor(t,n=c8){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[i,r]of t)this.set(i,r)}get(t){return super.get(I2(this,t))}has(t){return super.has(I2(this,t))}set(t,n){return super.set(u8(this,t),n)}delete(t){return super.delete(l8(this,t))}}class Qh extends Set{constructor(t,n=c8){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const i of t)this.add(i)}has(t){return super.has(I2(this,t))}add(t){return super.add(u8(this,t))}delete(t){return super.delete(l8(this,t))}}function I2({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function u8({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function l8({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function c8(e){return e!==null&&typeof e=="object"?e.valueOf():e}function pW(e,t){return Array.from(t,n=>e[n])}function gW(e=Ts){if(e===Ts)return f8;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||i===0?i:(e(n,n)===0)-(e(t,t)===0)}}function f8(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const mW=Math.sqrt(50),yW=Math.sqrt(10),bW=Math.sqrt(2);function e0(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),s=i/Math.pow(10,r),o=s>=mW?10:s>=yW?5:s>=bW?2:1;let a,u,l;return r<0?(l=Math.pow(10,-r)/o,a=Math.round(e*l),u=Math.round(t*l),a/lt&&--u,l=-l):(l=Math.pow(10,r)*o,a=Math.round(e/l),u=Math.round(t/l),a*lt&&--u),u0))return[];if(e===t)return[e];const i=t=r))return[];const a=s-r+1,u=new Array(a);if(i)if(o<0)for(let l=0;l=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n=r)&&(n=r)}return n}function B2(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function d8(e,t,n=0,i=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=r===void 0?f8:gW(r);i>n;){if(i-n>600){const u=i-n+1,l=t-n+1,c=Math.log(u),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(u-f)/u)*(l-u/2<0?-1:1),h=Math.max(n,Math.floor(t-l*f/u+d)),p=Math.min(i,Math.floor(t+(u-l)*f/u+d));d8(e,t,h,p,r)}const s=e[t];let o=n,a=i;for(Kc(e,n,t),r(e[i],s)>0&&Kc(e,n,i);o0;)--a}r(e[n],s)===0?Kc(e,n,a):(++a,Kc(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}return e}function Kc(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function j2(e,t,n){if(e=Float64Array.from(cW(e,n)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return B2(e);if(t>=1)return Sa(e);var i,r=(i-1)*t,s=Math.floor(r),o=Sa(d8(e,s).subarray(0,s+1)),a=B2(e.subarray(s+1));return o+(a-o)*(r-s)}}function h8(e,t,n=s8){if(!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return+n(e[0],0,e);if(t>=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,s=Math.floor(r),o=+n(e[s],s,e),a=+n(e[s+1],s+1,e);return o+(a-o)*(r-s)}}function vW(e,t){let n=0,i=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(++n,i+=r);else{let r=-1;for(let s of e)(s=t(s,++r,e))!=null&&(s=+s)>=s&&(++n,i+=s)}if(n)return i/n}function p8(e,t){return j2(e,.5,t)}function*_W(e){for(const t of e)yield*t}function g8(e){return Array.from(_W(e))}function Ci(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(r);++i=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function t0(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function ll(e){return e=t0(Math.abs(e)),e?e[1]:NaN}function CW(e,t){return function(n,i){for(var r=n.length,s=[],o=0,a=e[0],u=0;r>0&&a>0&&(u+a+1>i&&(a=Math.max(1,i-u)),s.push(n.substring(r-=a,r+a)),!((u+=a+1)>i));)a=e[o=(o+1)%e.length];return s.reverse().join(t)}}function AW(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var $W=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Fa(e){if(!(t=$W.exec(e)))throw new Error("invalid format: "+e);var t;return new U2({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Fa.prototype=U2.prototype;function U2(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}U2.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function SW(e){e:for(var t=e.length,n=1,i=-1,r;n0&&(i=0);break}return i>0?e.slice(0,i)+e.slice(r+1):e}var y8;function FW(e,t){var n=t0(e,t);if(!n)return e+"";var i=n[0],r=n[1],s=r-(y8=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,o=i.length;return s===o?i:s>o?i+new Array(s-o+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+t0(e,Math.max(0,t+s-1))[0]}function b8(e,t){var n=t0(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const v8={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:EW,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>b8(e*100,t),r:b8,s:FW,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function _8(e){return e}var x8=Array.prototype.map,w8=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function k8(e){var t=e.grouping===void 0||e.thousands===void 0?_8:CW(x8.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",i=e.currency===void 0?"":e.currency[1]+"",r=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?_8:AW(x8.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",u=e.nan===void 0?"NaN":e.nan+"";function l(f){f=Fa(f);var d=f.fill,h=f.align,p=f.sign,g=f.symbol,m=f.zero,y=f.width,b=f.comma,v=f.precision,_=f.trim,x=f.type;x==="n"?(b=!0,x="g"):v8[x]||(v===void 0&&(v=12),_=!0,x="g"),(m||d==="0"&&h==="=")&&(m=!0,d="0",h="=");var k=g==="$"?n:g==="#"&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",w=g==="$"?i:/[%p]/.test(x)?o:"",E=v8[x],C=/[defgprs%]/.test(x);v=v===void 0?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function F(S){var z=k,P=w,T,A,M;if(x==="c")P=E(S)+P,S="";else{S=+S;var B=S<0||1/S<0;if(S=isNaN(S)?u:E(Math.abs(S),v),_&&(S=SW(S)),B&&+S==0&&p!=="+"&&(B=!1),z=(B?p==="("?p:a:p==="-"||p==="("?"":p)+z,P=(x==="s"?w8[8+y8/3]:"")+P+(B&&p==="("?")":""),C){for(T=-1,A=S.length;++TM||M>57){P=(M===46?r+S.slice(T+1):S.slice(T))+P,S=S.slice(0,T);break}}}b&&!m&&(S=t(S,1/0));var V=z.length+S.length+P.length,H=V>1)+z+S+P+H.slice(V);break;default:S=H+z+S+P;break}return s(S)}return F.toString=function(){return f+""},F}function c(f,d){var h=l((f=Fa(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(ll(d)/3)))*3,g=Math.pow(10,-p),m=w8[8+p/3];return function(y){return h(g*y)+m}}return{format:l,formatPrefix:c}}var n0,i0,q2;DW({thousands:",",grouping:[3],currency:["$",""]});function DW(e){return n0=k8(e),i0=n0.format,q2=n0.formatPrefix,n0}function E8(e){return Math.max(0,-ll(Math.abs(e)))}function C8(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ll(t)/3)))*3-ll(Math.abs(e)))}function A8(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ll(t)-ll(e))+1}const W2=new Date,H2=new Date;function Ht(e,t,n,i){function r(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return r.floor=s=>(e(s=new Date(+s)),s),r.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),r.round=s=>{const o=r(s),a=r.ceil(s);return s-o(t(s=new Date(+s),o==null?1:Math.floor(o)),s),r.range=(s,o,a)=>{const u=[];if(s=r.ceil(s),a=a==null?1:Math.floor(a),!(s0))return u;let l;do u.push(l=new Date(+s)),t(s,a),e(s);while(lHt(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,a)=>{if(o>=o)if(a<0)for(;++a<=0;)for(;t(o,-1),!s(o););else for(;--a>=0;)for(;t(o,1),!s(o););}),n&&(r.count=(s,o)=>(W2.setTime(+s),H2.setTime(+o),e(W2),e(H2),Math.floor(n(W2,H2))),r.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?r.filter(i?o=>i(o)%s===0:o=>r.count(0,o)%s===0):r)),r}const cl=Ht(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);cl.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Ht(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):cl),cl.range;const Ms=1e3,Ui=Ms*60,Ns=Ui*60,Rs=Ns*24,G2=Rs*7,$8=Rs*30,V2=Rs*365,Os=Ht(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ms)},(e,t)=>(t-e)/Ms,e=>e.getUTCSeconds());Os.range;const r0=Ht(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ms)},(e,t)=>{e.setTime(+e+t*Ui)},(e,t)=>(t-e)/Ui,e=>e.getMinutes());r0.range;const s0=Ht(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ui)},(e,t)=>(t-e)/Ui,e=>e.getUTCMinutes());s0.range;const o0=Ht(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ms-e.getMinutes()*Ui)},(e,t)=>{e.setTime(+e+t*Ns)},(e,t)=>(t-e)/Ns,e=>e.getHours());o0.range;const a0=Ht(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ns)},(e,t)=>(t-e)/Ns,e=>e.getUTCHours());a0.range;const Ls=Ht(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ui)/Rs,e=>e.getDate()-1);Ls.range;const $o=Ht(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Rs,e=>e.getUTCDate()-1);$o.range;const S8=Ht(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Rs,e=>Math.floor(e/Rs));S8.range;function Da(e){return Ht(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Ui)/G2)}const fl=Da(0),u0=Da(1),TW=Da(2),MW=Da(3),dl=Da(4),NW=Da(5),RW=Da(6);fl.range,u0.range,TW.range,MW.range,dl.range,NW.range,RW.range;function Ta(e){return Ht(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/G2)}const hl=Ta(0),l0=Ta(1),OW=Ta(2),LW=Ta(3),pl=Ta(4),IW=Ta(5),PW=Ta(6);hl.range,l0.range,OW.range,LW.range,pl.range,IW.range,PW.range;const Jc=Ht(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Jc.range;const Qc=Ht(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Qc.range;const Hr=Ht(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Hr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ht(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Hr.range;const Gr=Ht(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Gr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ht(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),Gr.range;function F8(e,t,n,i,r,s){const o=[[Os,1,Ms],[Os,5,5*Ms],[Os,15,15*Ms],[Os,30,30*Ms],[s,1,Ui],[s,5,5*Ui],[s,15,15*Ui],[s,30,30*Ui],[r,1,Ns],[r,3,3*Ns],[r,6,6*Ns],[r,12,12*Ns],[i,1,Rs],[i,2,2*Rs],[n,1,G2],[t,1,$8],[t,3,3*$8],[e,1,V2]];function a(l,c,f){const d=cm).right(o,d);if(h===o.length)return e.every(Ao(l/V2,c/V2,f));if(h===0)return cl.every(Math.max(Ao(l,c,f),1));const[p,g]=o[d/o[h-1][2](e[t]=1+n,e),{});function Z2(e){const t=se(e).slice(),n={};return t.length||W("Missing time unit."),t.forEach(r=>{ue(X2,r)?n[r]=1:W(`Invalid time unit: ${r}.`)}),(n[Gt]||n[Fn]?1:0)+(n[ai]||n[Sn]||n[ui]?1:0)+(n[Vr]?1:0)>1&&W(`Incompatible time units: ${e}`),t.sort((r,s)=>X2[r]-X2[s]),t}const qW={[fn]:"%Y ",[ai]:"Q%q ",[Sn]:"%b ",[ui]:"%d ",[Gt]:"W%U ",[Fn]:"%a ",[Vr]:"%j ",[Ai]:"%H:00",[$i]:"00:%M",[qi]:":%S",[dr]:".%L",[`${fn}-${Sn}`]:"%Y-%m ",[`${fn}-${Sn}-${ui}`]:"%Y-%m-%d ",[`${Ai}-${$i}`]:"%H:%M"};function D8(e,t){const n=Be({},qW,t),i=Z2(e),r=i.length;let s="",o=0,a,u;for(o=0;oo;--a)if(u=i.slice(o,a).join("-"),n[u]!=null){s+=n[u],o=a;break}return s.trim()}const Ma=new Date;function K2(e){return Ma.setFullYear(e),Ma.setMonth(0),Ma.setDate(1),Ma.setHours(0,0,0,0),Ma}function T8(e){return N8(new Date(e))}function M8(e){return J2(new Date(e))}function N8(e){return Ls.count(K2(e.getFullYear())-1,e)}function J2(e){return fl.count(K2(e.getFullYear())-1,e)}function Q2(e){return K2(e).getDay()}function WW(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(-1,t,n,i,r,s,o);return a.setFullYear(e),a}return new Date(e,t,n,i,r,s,o)}function R8(e){return L8(new Date(e))}function O8(e){return ey(new Date(e))}function L8(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return $o.count(t-1,e)}function ey(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return hl.count(t-1,e)}function ty(e){return Ma.setTime(Date.UTC(e,0,1)),Ma.getUTCDay()}function HW(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(Date.UTC(-1,t,n,i,r,s,o));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(e,t,n,i,r,s,o))}function I8(e,t,n,i,r){const s=t||1,o=Ye(e),a=(y,b,v)=>(v=v||y,GW(n[v],i[v],y===o&&s,b)),u=new Date,l=fr(e),c=l[fn]?a(fn):$n(2012),f=l[Sn]?a(Sn):l[ai]?a(ai):_o,d=l[Gt]&&l[Fn]?a(Fn,1,Gt+Fn):l[Gt]?a(Gt,1):l[Fn]?a(Fn,1):l[ui]?a(ui,1):l[Vr]?a(Vr,1):nl,h=l[Ai]?a(Ai):_o,p=l[$i]?a($i):_o,g=l[qi]?a(qi):_o,m=l[dr]?a(dr):_o;return function(y){u.setTime(+y);const b=c(u);return r(b,f(u),d(u,b),h(u),p(u),g(u),m(u))}}function GW(e,t,n,i){const r=n<=1?e:i?(s,o)=>i+n*Math.floor((e(s,o)-i)/n):(s,o)=>n*Math.floor(e(s,o)/n);return t?(s,o)=>t(r(s,o),o):r}function gl(e,t,n){return t+e*7-(n+6)%7}const VW={[fn]:e=>e.getFullYear(),[ai]:e=>Math.floor(e.getMonth()/3),[Sn]:e=>e.getMonth(),[ui]:e=>e.getDate(),[Ai]:e=>e.getHours(),[$i]:e=>e.getMinutes(),[qi]:e=>e.getSeconds(),[dr]:e=>e.getMilliseconds(),[Vr]:e=>N8(e),[Gt]:e=>J2(e),[Gt+Fn]:(e,t)=>gl(J2(e),e.getDay(),Q2(t)),[Fn]:(e,t)=>gl(1,e.getDay(),Q2(t))},YW={[ai]:e=>3*e,[Gt]:(e,t)=>gl(e,0,Q2(t))};function P8(e,t){return I8(e,t||1,VW,YW,WW)}const XW={[fn]:e=>e.getUTCFullYear(),[ai]:e=>Math.floor(e.getUTCMonth()/3),[Sn]:e=>e.getUTCMonth(),[ui]:e=>e.getUTCDate(),[Ai]:e=>e.getUTCHours(),[$i]:e=>e.getUTCMinutes(),[qi]:e=>e.getUTCSeconds(),[dr]:e=>e.getUTCMilliseconds(),[Vr]:e=>L8(e),[Gt]:e=>ey(e),[Fn]:(e,t)=>gl(1,e.getUTCDay(),ty(t)),[Gt+Fn]:(e,t)=>gl(ey(e),e.getUTCDay(),ty(t))},ZW={[ai]:e=>3*e,[Gt]:(e,t)=>gl(e,0,ty(t))};function z8(e,t){return I8(e,t||1,XW,ZW,HW)}const KW={[fn]:Hr,[ai]:Jc.every(3),[Sn]:Jc,[Gt]:fl,[ui]:Ls,[Fn]:Ls,[Vr]:Ls,[Ai]:o0,[$i]:r0,[qi]:Os,[dr]:cl},JW={[fn]:Gr,[ai]:Qc.every(3),[Sn]:Qc,[Gt]:hl,[ui]:$o,[Fn]:$o,[Vr]:$o,[Ai]:a0,[$i]:s0,[qi]:Os,[dr]:cl};function ml(e){return KW[e]}function yl(e){return JW[e]}function B8(e,t,n){return e?e.offset(t,n):void 0}function j8(e,t,n){return B8(ml(e),t,n)}function U8(e,t,n){return B8(yl(e),t,n)}function q8(e,t,n,i){return e?e.range(t,n,i):void 0}function W8(e,t,n,i){return q8(ml(e),t,n,i)}function H8(e,t,n,i){return q8(yl(e),t,n,i)}const ef=1e3,tf=ef*60,nf=tf*60,c0=nf*24,QW=c0*7,G8=c0*30,ny=c0*365,V8=[fn,Sn,ui,Ai,$i,qi,dr],rf=V8.slice(0,-1),sf=rf.slice(0,-1),of=sf.slice(0,-1),eH=of.slice(0,-1),tH=[fn,Gt],Y8=[fn,Sn],X8=[fn],af=[[rf,1,ef],[rf,5,5*ef],[rf,15,15*ef],[rf,30,30*ef],[sf,1,tf],[sf,5,5*tf],[sf,15,15*tf],[sf,30,30*tf],[of,1,nf],[of,3,3*nf],[of,6,6*nf],[of,12,12*nf],[eH,1,c0],[tH,1,QW],[Y8,1,G8],[Y8,3,3*G8],[X8,1,ny]];function Z8(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(Xc(t))/n;let r=ul(a=>a[2]).right(af,i),s,o;return r===af.length?(s=X8,o=Ao(t[0]/ny,t[1]/ny,n)):r?(r=af[i/af[r-1][2]53)return null;"w"in Q||(Q.w=1),"Z"in Q?(dt=ry(uf(Q.y,0,1)),Bn=dt.getUTCDay(),dt=Bn>4||Bn===0?l0.ceil(dt):l0(dt),dt=$o.offset(dt,(Q.V-1)*7),Q.y=dt.getUTCFullYear(),Q.m=dt.getUTCMonth(),Q.d=dt.getUTCDate()+(Q.w+6)%7):(dt=iy(uf(Q.y,0,1)),Bn=dt.getDay(),dt=Bn>4||Bn===0?u0.ceil(dt):u0(dt),dt=Ls.offset(dt,(Q.V-1)*7),Q.y=dt.getFullYear(),Q.m=dt.getMonth(),Q.d=dt.getDate()+(Q.w+6)%7)}else("W"in Q||"U"in Q)&&("w"in Q||(Q.w="u"in Q?Q.u%7:"W"in Q?1:0),Bn="Z"in Q?ry(uf(Q.y,0,1)).getUTCDay():iy(uf(Q.y,0,1)).getDay(),Q.m=0,Q.d="W"in Q?(Q.w+6)%7+Q.W*7-(Bn+5)%7:Q.w+Q.U*7-(Bn+6)%7);return"Z"in Q?(Q.H+=Q.Z/100|0,Q.M+=Q.Z%100,ry(Q)):iy(Q)}}function E(le,je,Ge,Q){for(var wn=0,dt=je.length,Bn=Ge.length,cn,Ds;wn=Bn)return-1;if(cn=je.charCodeAt(wn++),cn===37){if(cn=je.charAt(wn++),Ds=x[cn in J8?je.charAt(wn++):cn],!Ds||(Q=Ds(le,Ge,Q))<0)return-1}else if(cn!=Ge.charCodeAt(Q++))return-1}return Q}function C(le,je,Ge){var Q=l.exec(je.slice(Ge));return Q?(le.p=c.get(Q[0].toLowerCase()),Ge+Q[0].length):-1}function F(le,je,Ge){var Q=h.exec(je.slice(Ge));return Q?(le.w=p.get(Q[0].toLowerCase()),Ge+Q[0].length):-1}function S(le,je,Ge){var Q=f.exec(je.slice(Ge));return Q?(le.w=d.get(Q[0].toLowerCase()),Ge+Q[0].length):-1}function z(le,je,Ge){var Q=y.exec(je.slice(Ge));return Q?(le.m=b.get(Q[0].toLowerCase()),Ge+Q[0].length):-1}function P(le,je,Ge){var Q=g.exec(je.slice(Ge));return Q?(le.m=m.get(Q[0].toLowerCase()),Ge+Q[0].length):-1}function T(le,je,Ge){return E(le,t,je,Ge)}function A(le,je,Ge){return E(le,n,je,Ge)}function M(le,je,Ge){return E(le,i,je,Ge)}function B(le){return o[le.getDay()]}function V(le){return s[le.getDay()]}function H(le){return u[le.getMonth()]}function oe(le){return a[le.getMonth()]}function ke(le){return r[+(le.getHours()>=12)]}function we(le){return 1+~~(le.getMonth()/3)}function Oe(le){return o[le.getUTCDay()]}function rt(le){return s[le.getUTCDay()]}function Ie(le){return u[le.getUTCMonth()]}function Wt(le){return a[le.getUTCMonth()]}function or(le){return r[+(le.getUTCHours()>=12)]}function ar(le){return 1+~~(le.getUTCMonth()/3)}return{format:function(le){var je=k(le+="",v);return je.toString=function(){return le},je},parse:function(le){var je=w(le+="",!1);return je.toString=function(){return le},je},utcFormat:function(le){var je=k(le+="",_);return je.toString=function(){return le},je},utcParse:function(le){var je=w(le+="",!0);return je.toString=function(){return le},je}}}var J8={"-":"",_:" ",0:"0"},Jt=/^\s*\d+/,nH=/^%/,iH=/[\\^$*+?|[\]().{}]/g;function Qe(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",s=r.length;return i+(s[t.toLowerCase(),n]))}function sH(e,t,n){var i=Jt.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function oH(e,t,n){var i=Jt.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function aH(e,t,n){var i=Jt.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function uH(e,t,n){var i=Jt.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function lH(e,t,n){var i=Jt.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function Q8(e,t,n){var i=Jt.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function ek(e,t,n){var i=Jt.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function cH(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function fH(e,t,n){var i=Jt.exec(t.slice(n,n+1));return i?(e.q=i[0]*3-3,n+i[0].length):-1}function dH(e,t,n){var i=Jt.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function tk(e,t,n){var i=Jt.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function hH(e,t,n){var i=Jt.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function nk(e,t,n){var i=Jt.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function pH(e,t,n){var i=Jt.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function gH(e,t,n){var i=Jt.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function mH(e,t,n){var i=Jt.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function yH(e,t,n){var i=Jt.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function bH(e,t,n){var i=nH.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function vH(e,t,n){var i=Jt.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function _H(e,t,n){var i=Jt.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function ik(e,t){return Qe(e.getDate(),t,2)}function xH(e,t){return Qe(e.getHours(),t,2)}function wH(e,t){return Qe(e.getHours()%12||12,t,2)}function kH(e,t){return Qe(1+Ls.count(Hr(e),e),t,3)}function rk(e,t){return Qe(e.getMilliseconds(),t,3)}function EH(e,t){return rk(e,t)+"000"}function CH(e,t){return Qe(e.getMonth()+1,t,2)}function AH(e,t){return Qe(e.getMinutes(),t,2)}function $H(e,t){return Qe(e.getSeconds(),t,2)}function SH(e){var t=e.getDay();return t===0?7:t}function FH(e,t){return Qe(fl.count(Hr(e)-1,e),t,2)}function sk(e){var t=e.getDay();return t>=4||t===0?dl(e):dl.ceil(e)}function DH(e,t){return e=sk(e),Qe(dl.count(Hr(e),e)+(Hr(e).getDay()===4),t,2)}function TH(e){return e.getDay()}function MH(e,t){return Qe(u0.count(Hr(e)-1,e),t,2)}function NH(e,t){return Qe(e.getFullYear()%100,t,2)}function RH(e,t){return e=sk(e),Qe(e.getFullYear()%100,t,2)}function OH(e,t){return Qe(e.getFullYear()%1e4,t,4)}function LH(e,t){var n=e.getDay();return e=n>=4||n===0?dl(e):dl.ceil(e),Qe(e.getFullYear()%1e4,t,4)}function IH(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Qe(t/60|0,"0",2)+Qe(t%60,"0",2)}function ok(e,t){return Qe(e.getUTCDate(),t,2)}function PH(e,t){return Qe(e.getUTCHours(),t,2)}function zH(e,t){return Qe(e.getUTCHours()%12||12,t,2)}function BH(e,t){return Qe(1+$o.count(Gr(e),e),t,3)}function ak(e,t){return Qe(e.getUTCMilliseconds(),t,3)}function jH(e,t){return ak(e,t)+"000"}function UH(e,t){return Qe(e.getUTCMonth()+1,t,2)}function qH(e,t){return Qe(e.getUTCMinutes(),t,2)}function WH(e,t){return Qe(e.getUTCSeconds(),t,2)}function HH(e){var t=e.getUTCDay();return t===0?7:t}function GH(e,t){return Qe(hl.count(Gr(e)-1,e),t,2)}function uk(e){var t=e.getUTCDay();return t>=4||t===0?pl(e):pl.ceil(e)}function VH(e,t){return e=uk(e),Qe(pl.count(Gr(e),e)+(Gr(e).getUTCDay()===4),t,2)}function YH(e){return e.getUTCDay()}function XH(e,t){return Qe(l0.count(Gr(e)-1,e),t,2)}function ZH(e,t){return Qe(e.getUTCFullYear()%100,t,2)}function KH(e,t){return e=uk(e),Qe(e.getUTCFullYear()%100,t,2)}function JH(e,t){return Qe(e.getUTCFullYear()%1e4,t,4)}function QH(e,t){var n=e.getUTCDay();return e=n>=4||n===0?pl(e):pl.ceil(e),Qe(e.getUTCFullYear()%1e4,t,4)}function eG(){return"+0000"}function lk(){return"%"}function ck(e){return+e}function fk(e){return Math.floor(+e/1e3)}var bl,sy,dk,oy,hk;tG({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function tG(e){return bl=K8(e),sy=bl.format,dk=bl.parse,oy=bl.utcFormat,hk=bl.utcParse,bl}function ff(e){const t={};return n=>t[n]||(t[n]=e(n))}function nG(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let s=iG(i,r);const o=sr;)if(i[s]!=="0"){++s;break}return i.slice(0,s)+o}}function iG(e,t){let n=e.lastIndexOf("e"),i;if(n>0)return n;for(n=e.length;--n>t;)if(i=e.charCodeAt(n),i>=48&&i<=57)return n+1}function pk(e){const t=ff(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(i){const r=Fa(i||",");if(r.precision==null){switch(r.precision=12,r.type){case"%":r.precision-=2;break;case"e":r.precision-=1;break}return nG(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,s,o){o=Fa(o??",f");const a=Ao(i,r,s),u=Math.max(Math.abs(i),Math.abs(r));let l;if(o.precision==null)switch(o.type){case"s":return isNaN(l=C8(a,u))||(o.precision=l),n(o,u);case"":case"e":case"g":case"p":case"r":{isNaN(l=A8(a,u))||(o.precision=l-(o.type==="e"));break}case"f":case"%":{isNaN(l=E8(a))||(o.precision=l-(o.type==="%")*2);break}}return t(o)}}}let ay;gk();function gk(){return ay=pk({format:i0,formatPrefix:q2})}function mk(e){return pk(k8(e))}function f0(e){return arguments.length?ay=mk(e):ay}function yk(e,t,n){n=n||{},ie(n)||W(`Invalid time multi-format specifier: ${n}`);const i=t(qi),r=t($i),s=t(Ai),o=t(ui),a=t(Gt),u=t(Sn),l=t(ai),c=t(fn),f=e(n[dr]||".%L"),d=e(n[qi]||":%S"),h=e(n[$i]||"%I:%M"),p=e(n[Ai]||"%I %p"),g=e(n[ui]||n[Fn]||"%a %d"),m=e(n[Gt]||"%b %d"),y=e(n[Sn]||"%B"),b=e(n[ai]||"%B"),v=e(n[fn]||"%Y");return _=>(i(_)<_?f:r(_)<_?d:s(_)<_?h:o(_)<_?p:u(_)<_?a(_)<_?g:m:c(_)<_?l(_)<_?y:b:v)(_)}function bk(e){const t=ff(e.format),n=ff(e.utcFormat);return{timeFormat:i=>re(i)?t(i):yk(t,ml,i),utcFormat:i=>re(i)?n(i):yk(n,yl,i),timeParse:ff(e.parse),utcParse:ff(e.utcParse)}}let uy;vk();function vk(){return uy=bk({format:sy,parse:dk,utcFormat:oy,utcParse:hk})}function _k(e){return bk(K8(e))}function df(e){return arguments.length?uy=_k(e):uy}const ly=(e,t)=>Be({},e,t);function xk(e,t){const n=e?mk(e):f0(),i=t?_k(t):df();return ly(n,i)}function cy(e,t){const n=arguments.length;return n&&n!==2&&W("defaultLocale expects either zero or two arguments."),n?ly(f0(e),df(t)):ly(f0(),df())}function rG(){return gk(),vk(),cy()}const sG=/^(data:|([A-Za-z]+:)?\/\/)/,oG=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,aG=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,wk="file://";function uG(e,t){return n=>({options:n||{},sanitize:cG,load:lG,fileAccess:!1,file:fG(t),http:hG(e)})}async function lG(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t)}async function cG(e,t){t=Be({},this.options,t);const n=this.fileAccess,i={href:null};let r,s,o;const a=oG.test(e.replace(aG,""));(e==null||typeof e!="string"||!a)&&W("Sanitize failure, invalid URI: "+ee(e));const u=sG.test(e);return(o=t.baseURL)&&!u&&(!e.startsWith("/")&&!o.endsWith("/")&&(e="/"+e),e=o+e),s=(r=e.startsWith(wk))||t.mode==="file"||t.mode!=="http"&&!u&&n,r?e=e.slice(wk.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),s=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!s}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function fG(e){return e?t=>new Promise((n,i)=>{e.readFile(t,(r,s)=>{r?i(r):n(s)})}):dG}async function dG(){W("No file system access.")}function hG(e){return e?async function(t,n){const i=Be({},this.options.http,n),r=n&&n.response,s=await e(t,i);return s.ok?ze(s[r])?s[r]():s.text():W(s.status+""+s.statusText)}:pG}async function pG(){W("No HTTP fetch method available.")}const gG=e=>e!=null&&e===e,mG=e=>e==="true"||e==="false"||e===!0||e===!1,yG=e=>!Number.isNaN(Date.parse(e)),kk=e=>!Number.isNaN(+e)&&!(e instanceof Date),bG=e=>kk(e)&&Number.isInteger(+e),fy={boolean:T2,integer:An,number:An,date:M2,string:N2,unknown:Cn},d0=[mG,bG,kk,yG],vG=["boolean","integer","number","date"];function Ek(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=d0.length,r=d0.map((s,o)=>o+1);for(let s=0,o=0,a,u;ss===0?o:s,0)-1]}function Ck(e,t){return t.reduce((n,i)=>(n[i]=Ek(e,i),n),{})}function Ak(e){const t=function(n,i){const r={delimiter:e};return dy(n,i?Be(i,r):r)};return t.responseType="text",t}function dy(e,t){return t.header&&(e=t.header.map(ee).join(t.delimiter)+` -`+e),Qq(t.delimiter).parse(e+"")}dy.responseType="text";function _G(e){return typeof Buffer=="function"&&ze(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function hy(e,t){const n=t&&t.property?Bi(t.property):Cn;return ie(e)&&!_G(e)?xG(n(e),t):n(JSON.parse(e))}hy.responseType="json";function xG(e,t){return!G(e)&&Y4(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const wG={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function $k(e,t){let n,i,r,s;return e=hy(e,t),t&&t.feature?(n=iW,r=t.feature):t&&t.mesh?(n=sW,r=t.mesh,s=wG[t.filter]):W("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,s):W("Invalid TopoJSON object: "+r),i&&i.features||[i]}$k.responseType="json";const h0={dsv:dy,csv:Ak(","),tsv:Ak(" "),json:hy,topojson:$k};function py(e,t){return arguments.length>1?(h0[e]=t,this):ue(h0,e)?h0[e]:null}function Sk(e){const t=py(e);return t&&t.responseType||"text"}function Fk(e,t,n,i){t=t||{};const r=py(t.type||"json");return r||W("Unknown data format type: "+t.type),e=r(e,t),t.parse&&kG(e,t.parse,n,i),ue(e,"columns")&&delete e.columns,e}function kG(e,t,n,i){if(!e.length)return;const r=df();n=n||r.timeParse,i=i||r.utcParse;let s=e.columns||Object.keys(e[0]),o,a,u,l,c,f;t==="auto"&&(t=Ck(e,s)),s=Object.keys(t);const d=s.map(h=>{const p=t[h];let g,m;if(p&&(p.startsWith("date:")||p.startsWith("utc:")))return g=p.split(/:(.+)?/,2),m=g[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(g[0]==="utc"?i:n)(m);if(!fy[p])throw Error("Illegal format pattern: "+h+":"+p);return fy[p]});for(u=0,c=e.length,f=s.length;u{const s=t(r);return i[s]||(i[s]=1,n.push(r)),n},n.remove=r=>{const s=t(r);if(i[s]){i[s]=0;const o=n.indexOf(r);o>=0&&n.splice(o,1)}return n},n}async function m0(e,t){try{await t(e)}catch(n){e.error(n)}}const Dk=Symbol("vega_id");let EG=1;function y0(e){return!!(e&&Ae(e))}function Ae(e){return e[Dk]}function Tk(e,t){return e[Dk]=t,e}function it(e){const t=e===Object(e)?e:{data:e};return Ae(t)?t:Tk(t,EG++)}function gy(e){return b0(e,it({}))}function b0(e,t){for(const n in e)t[n]=e[n];return t}function Mk(e,t){return Tk(t,Ae(e))}function Na(e,t){return e?t?(n,i)=>e(n,i)||Ae(t(n))-Ae(t(i)):(n,i)=>e(n,i)||Ae(n)-Ae(i):null}function Nk(e){return e&&e.constructor===So}function So(){const e=[],t=[],n=[],i=[],r=[];let s=null,o=!1;return{constructor:So,insert(a){const u=se(a),l=u.length;for(let c=0;c{p(b)&&(l[Ae(b)]=-1)});for(f=0,d=e.length;f0&&(y(g,p,h.value),a.modifies(p));for(f=0,d=r.length;f{p(b)&&l[Ae(b)]>0&&y(b,h.field,h.value)}),a.modifies(h.field);if(o)a.mod=t.length||i.length?u.filter(b=>l[Ae(b)]>0):u.slice();else for(m in c)a.mod.push(c[m]);return(s||s==null&&(t.length||i.length))&&a.clean(!0),a}}}const v0="_:mod:_";function _0(){Object.defineProperty(this,v0,{writable:!0,value:{}})}_0.prototype={set(e,t,n,i){const r=this,s=r[e],o=r[v0];return t!=null&&t>=0?(s[t]!==n||i)&&(s[t]=n,o[t+":"+e]=-1,o[e]=-1):(s!==n||i)&&(r[e]=n,o[e]=G(n)?1+n.length:-1),r},modified(e,t){const n=this[v0];if(arguments.length){if(G(e)){for(let i=0;i=0?t+1{h instanceof xt?(h!==this&&(t&&h.targets().add(this),s.push(h)),r.push({op:h,name:f,index:d})):i.set(f,d,h)};for(o in e)if(a=e[o],o===AG)se(a).forEach(f=>{f instanceof xt?f!==this&&(f.targets().add(this),s.push(f)):W("Pulse parameters must be operator instances.")}),this.source=a;else if(G(a))for(i.set(o,-1,Array(u=a.length)),l=0;l{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=Fo();return this.targets().add(Fo(null,null,S2(e,n=>{const i=n.dataflow;t.receive(n),i&&i.run&&i.run()}))),t},between(e,t){let n=!1;return e.targets().add(Fo(null,null,()=>n=!0)),t.targets().add(Fo(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=ji,this._targets=null}};function NG(e,t,n,i){const r=this,s=Fo(n,i),o=function(l){l.dataflow=r;try{s.receive(l)}catch(c){r.error(c)}finally{r.run()}};let a;typeof e=="string"&&typeof document<"u"?a=document.querySelectorAll(e):a=se(e);const u=a.length;for(let l=0;lt=i);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const zG={skip:!0};function BG(e,t,n,i,r){return(e instanceof xt?UG:jG)(this,e,t,n,i,r),this}function jG(e,t,n,i,r,s){const o=Be({},s,zG);let a,u;ze(n)||(n=$n(n)),i===void 0?a=l=>e.touch(n(l)):ze(i)?(u=new xt(null,i,r,!1),a=l=>{u.evaluate(l);const c=n(l),f=u.value;Nk(f)?e.pulse(c,f,s):e.update(c,f,o)}):a=l=>e.update(n(l),i,o),t.apply(a)}function UG(e,t,n,i,r,s){if(i===void 0)t.targets().add(n);else{const o=s||{},a=new xt(null,qG(n,i),r,!1);a.modified(o.force),a.rank=t.rank,t.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),e.connect(n,[a]))}}function qG(e,t){return t=ze(t)?t:$n(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function WG(e){e.rank=++this._rank}function HG(e){const t=[e];let n,i,r;for(;t.length;)if(this.rank(n=t.pop()),i=n._targets)for(r=i.length;--r>=0;)t.push(n=i[r]),n===e&&W("Cycle detected in dataflow graph.")}const w0={},Yr=1,Do=2,Is=4,GG=Yr|Do,Ok=Yr|Is,vl=Yr|Do|Is,Lk=8,hf=16,Ik=32,Pk=64;function To(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function my(e,t){const n=[];return Eo(e,t,i=>n.push(i)),n}function zk(e,t){const n={};return e.visit(t,i=>{n[Ae(i)]=1}),i=>n[Ae(i)]?null:i}function k0(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}To.prototype={StopPropagation:w0,ADD:Yr,REM:Do,MOD:Is,ADD_REM:GG,ADD_MOD:Ok,ALL:vl,REFLOW:Lk,SOURCE:hf,NO_SOURCE:Ik,NO_FIELDS:Pk,fork(e){return new To(this.dataflow).init(this,e)},clone(){const e=this.fork(vl);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(vl|hf)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new To(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,e.fields&&!(t&Pk)&&(n.fields=e.fields),t&Yr?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&Do?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&Is?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&Ik?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||vl;return t&Yr&&this.add.length||t&Do&&this.rem.length||t&Is&&this.mod.length},reflow(e){if(e)return this.fork(vl).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(Is,zk(this,Yr))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return G(e)?e.forEach(n=>t[n]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return(t||this.mod.length)&&n?arguments.length?G(e)?e.some(i=>n[i]):n[e]:!!n:!1},filter(e,t){const n=this;return e&Yr&&(n.addF=k0(n.addF,t)),e&Do&&(n.remF=k0(n.remF,t)),e&Is&&(n.modF=k0(n.modF,t)),e&hf&&(n.srcF=k0(n.srcF,t)),n},materialize(e){e=e||vl;const t=this;return e&Yr&&t.addF&&(t.add=my(t.add,t.addF),t.addF=null),e&Do&&t.remF&&(t.rem=my(t.rem,t.remF),t.remF=null),e&Is&&t.modF&&(t.mod=my(t.mod,t.modF),t.modF=null),e&hf&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(e&hf)return Eo(n.source,n.srcF,i),n;e&Yr&&Eo(n.add,n.addF,i),e&Do&&Eo(n.rem,n.remF,i),e&Is&&Eo(n.mod,n.modF,i);const r=n.source;if(e&Lk&&r){const s=n.add.length+n.mod.length;s===r.length||(s?Eo(r,zk(n,Ok),i):Eo(r,n.srcF,i))}return n}};function yy(e,t,n,i){const r=this;let s=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=i||null,this.pulses=n;for(const o of n)if(o.stamp===t){if(o.fields){const a=r.fields||(r.fields={});for(const u in o.fields)a[u]=1}o.changed(r.ADD)&&(s|=r.ADD),o.changed(r.REM)&&(s|=r.REM),o.changed(r.MOD)&&(s|=r.MOD)}this.changes=s}te(yy,To,{fork(e){const t=new To(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,n=>t.add.push(n)),e&t.REM&&this.visit(t.REM,n=>t.rem.push(n)),e&t.MOD&&this.visit(t.MOD,n=>t.mod.push(n))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?G(e)?e.some(i=>n[i]):n[e]:0},filter(){W("MultiPulse does not support filtering.")},materialize(){W("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let s=0;if(e&n.SOURCE)for(;si._enqueue(c,!0)),i._touched=g0(Vc);let o=0,a,u,l;try{for(;i._heap.size()>0;){if(a=i._heap.pop(),a.rank!==a.qrank){i._enqueue(a,!0);continue}u=a.run(i._getPulse(a,e)),u.then?u=await u:u.async&&(r.push(u.async),u=w0),u!==w0&&a._targets&&a._targets.forEach(c=>i._enqueue(c)),++o}}catch(c){i._heap.clear(),l=c}if(i._input={},i._pulse=null,i.debug(`Pulse ${s}: ${o} operators`),l&&(i._postrun=[],i.error(l)),i._postrun.length){const c=i._postrun.sort((f,d)=>d.priority-f.priority);i._postrun=[];for(let f=0;fi.runAsync(null,()=>{c.forEach(f=>{try{f(i)}catch(d){i.error(d)}})})),i}async function YG(e,t,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(i,i),this._running}function XG(e,t,n){return this._pulse?Bk(this):(this.evaluate(e,t,n),this)}function ZG(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(i){this.error(i)}}function Bk(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function KG(e,t){const n=e.stampr.pulse),t):this._input[e.id]||QG(this._pulse,n&&n.pulse)}function QG(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==w0&&(e.source=t.source),e)}const by={skip:!1,force:!1};function eV(e,t){const n=t||by;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function tV(e,t,n){const i=n||by;return(e.set(t)||i.force)&&this.touch(e,i),this}function nV(e,t,n){this.touch(e,n||by);const i=new To(this,this._clock+(this._pulse?0:1)),r=e.pulse&&e.pulse.source||[];return i.target=e,this._input[e.id]=t.pulse(i,r),this}function iV(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),jk(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,rV(t,0,e)):i=n,i}}}function jk(e,t,n,i){let r,s;const o=e[n];for(;n>t;){if(s=n-1>>1,r=e[s],i(o,r)<0){e[n]=r,n=s;continue}break}return e[n]=o}function rV(e,t,n){const i=t,r=e.length,s=e[t];let o=(t<<1)+1,a;for(;o=0&&(o=a),e[t]=e[o],t=o,o=(t<<1)+1;return e[t]=s,jk(e,i,t,n)}function _l(){this.logger(k2()),this.logLevel(x2),this._clock=0,this._rank=0,this._locale=cy();try{this._loader=p0()}catch{}this._touched=g0(Vc),this._input={},this._pulse=null,this._heap=iV((e,t)=>e.qrank-t.qrank),this._postrun=[]}function pf(e){return function(){return this._log[e].apply(this,arguments)}}_l.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:pf("error"),warn:pf("warn"),info:pf("info"),debug:pf("debug"),logLevel:pf("level"),cleanThreshold:1e4,add:DG,connect:TG,rank:WG,rerank:HG,pulse:nV,touch:eV,update:tV,changeset:So,ingest:OG,parse:RG,preload:IG,request:LG,events:NG,on:BG,evaluate:VG,run:XG,runAsync:YG,runAfter:ZG,_enqueue:KG,_getPulse:JG};function j(e,t){xt.call(this,e,null,t)}te(j,xt,{run(e){if(e.stampthis.pulse=n):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const xl={};function Uk(e){const t=qk(e);return t&&t.Definition||null}function qk(e){return e=e&&e.toLowerCase(),ue(xl,e)?xl[e]:null}function*Wk(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)i=t(i,++n,e),i!=null&&i!==""&&(i=+i)>=i&&(yield i)}}function vy(e,t,n){const i=Float64Array.from(Wk(e,n));return i.sort(Ts),t.map(r=>h8(i,r))}function _y(e,t){return vy(e,[.25,.5,.75],t)}function xy(e,t){const n=e.length,i=hW(e,t),r=_y(e,t),s=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,s)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function Hk(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let s=e.extent[0],o=e.extent[1],a,u,l,c,f,d;const h=e.span||o-s||Math.abs(s)||1;if(e.step)a=e.step;else if(e.steps){for(c=h/t,f=0,d=e.steps.length;ft;)a*=n;for(f=0,d=r.length;f=l&&h/c<=t&&(a=c)}c=Math.log(a);const p=c>=0?0:~~(-c/i)+1,g=Math.pow(n,-p-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(s/a+g)*a,s=sd);const r=e.length,s=new Float64Array(r);let o=0,a=1,u=i(e[0]),l=u,c=u+t,f;for(;a=c){for(l=(u+l)/2;o>1);or;)e[o--]=e[i]}i=r,r=s}return e}function aV(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function uV(e,t){t==null&&(t=e,e=0);let n,i,r;const s={min(o){return arguments.length?(n=o||0,r=i-n,s):n},max(o){return arguments.length?(i=o||0,r=i-n,s):i},sample(){return n+Math.floor(r*Wi())},pdf(o){return o===Math.floor(o)&&o>=n&&o=i?1:(a-n+1)/r},icdf(o){return o>=0&&o<=1?n-1+Math.floor(o*r):NaN}};return s.min(e).max(t)}const Yk=Math.sqrt(2*Math.PI),lV=Math.SQRT2;let gf=NaN;function E0(e,t){e=e||0,t=t??1;let n=0,i=0,r,s;if(gf===gf)n=gf,gf=NaN;else{do n=Wi()*2-1,i=Wi()*2-1,r=n*n+i*i;while(r===0||r>1);s=Math.sqrt(-2*Math.log(r)/r),n*=s,gf=i*s}return e+n*t}function wy(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*Yk)}function C0(e,t,n){t=t||0,n=n??1;const i=(e-t)/n,r=Math.abs(i);let s;if(r>37)s=0;else{const o=Math.exp(-r*r/2);let a;r<7.07106781186547?(a=.0352624965998911*r+.700383064443688,a=a*r+6.37396220353165,a=a*r+33.912866078383,a=a*r+112.079291497871,a=a*r+221.213596169931,a=a*r+220.206867912376,s=o*a,a=.0883883476483184*r+1.75566716318264,a=a*r+16.064177579207,a=a*r+86.7807322029461,a=a*r+296.564248779674,a=a*r+637.333633378831,a=a*r+793.826512519948,a=a*r+440.413735824752,s=s/a):(a=r+.65,a=r+4/a,a=r+3/a,a=r+2/a,a=r+1/a,s=o/a/2.506628274631)}return i>0?1-s:s}function A0(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*lV*cV(2*e-1)}function cV(e){let t=-Math.log((1-e)*(1+e)),n;return t<6.25?(t-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*t,n=128584807152564e-32+n*t,n=11157877678025181e-33+n*t,n=-1333171662854621e-31+n*t,n=20972767875968562e-33+n*t,n=6637638134358324e-30+n*t,n=-4054566272975207e-29+n*t,n=-8151934197605472e-29+n*t,n=26335093153082323e-28+n*t,n=-12975133253453532e-27+n*t,n=-5415412054294628e-26+n*t,n=10512122733215323e-25+n*t,n=-4112633980346984e-24+n*t,n=-29070369957882005e-24+n*t,n=42347877827932404e-23+n*t,n=-13654692000834679e-22+n*t,n=-13882523362786469e-21+n*t,n=.00018673420803405714+n*t,n=-.000740702534166267+n*t,n=-.006033670871430149+n*t,n=.24015818242558962+n*t,n=1.6536545626831027+n*t):t<16?(t=Math.sqrt(t)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*t,n=-27517406297064545e-23+n*t,n=18239629214389228e-24+n*t,n=15027403968909828e-22+n*t,n=-4013867526981546e-21+n*t,n=29234449089955446e-22+n*t,n=12475304481671779e-21+n*t,n=-47318229009055734e-21+n*t,n=6828485145957318e-20+n*t,n=24031110387097894e-21+n*t,n=-.0003550375203628475+n*t,n=.0009532893797373805+n*t,n=-.0016882755560235047+n*t,n=.002491442096107851+n*t,n=-.003751208507569241+n*t,n=.005370914553590064+n*t,n=1.0052589676941592+n*t,n=3.0838856104922208+n*t):Number.isFinite(t)?(t=Math.sqrt(t)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*t,n=15076572693500548e-25+n*t,n=-3789465440126737e-24+n*t,n=761570120807834e-23+n*t,n=-1496002662714924e-23+n*t,n=2914795345090108e-23+n*t,n=-6771199775845234e-23+n*t,n=22900482228026655e-23+n*t,n=-99298272942317e-20+n*t,n=4526062597223154e-21+n*t,n=-1968177810553167e-20+n*t,n=7599527703001776e-20+n*t,n=-.00021503011930044477+n*t,n=-.00013871931833623122+n*t,n=1.0103004648645344+n*t,n=4.849906401408584+n*t):n=1/0,n*e}function ky(e,t){let n,i;const r={mean(s){return arguments.length?(n=s||0,r):n},stdev(s){return arguments.length?(i=s??1,r):i},sample:()=>E0(n,i),pdf:s=>wy(s,n,i),cdf:s=>C0(s,n,i),icdf:s=>A0(s,n,i)};return r.mean(e).stdev(t)}function Ey(e,t){const n=ky();let i=0;const r={data(s){return arguments.length?(e=s,i=s?s.length:0,r.bandwidth(t)):e},bandwidth(s){return arguments.length?(t=s,!t&&e&&(t=xy(e)),r):t},sample(){return e[~~(Wi()*i)]+t*n.sample()},pdf(s){let o=0,a=0;for(;aCy(n,i),pdf:s=>Ay(s,n,i),cdf:s=>$y(s,n,i),icdf:s=>Sy(s,n,i)};return r.mean(e).stdev(t)}function Zk(e,t){let n=0,i;function r(o){const a=[];let u=0,l;for(l=0;l=t&&e<=n?1/(n-t):0}function Ty(e,t,n){return n==null&&(n=t??1,t=0),en?1:(e-t)/(n-t)}function My(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function Kk(e,t){let n,i;const r={min(s){return arguments.length?(n=s||0,r):n},max(s){return arguments.length?(i=s??1,r):i},sample:()=>Fy(n,i),pdf:s=>Dy(s,n,i),cdf:s=>Ty(s,n,i),icdf:s=>My(s,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function Ny(e,t,n){let i=0,r=0;for(const s of e){const o=n(s);t(s)==null||o==null||isNaN(o)||(i+=(o-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function mf(e,t,n,i){const r=i-e*e,s=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-s*e,s]}function $0(e,t,n,i){e=e.filter(h=>{let p=t(h),g=n(h);return p!=null&&(p=+p)>=p&&g!=null&&(g=+g)>=g}),i&&e.sort((h,p)=>t(h)-t(p));const r=e.length,s=new Float64Array(r),o=new Float64Array(r);let a=0,u=0,l=0,c,f,d;for(d of e)s[a]=c=+t(d),o[a]=f=+n(d),++a,u+=(c-u)/a,l+=(f-l)/a;for(a=0;a=s&&o!=null&&(o=+o)>=o&&i(s,o,++r)}function wl(e,t,n,i,r){let s=0,o=0;return yf(e,t,n,(a,u)=>{const l=u-r(a),c=u-i;s+=l*l,o+=c*c}),1-s/o}function Ry(e,t,n){let i=0,r=0,s=0,o=0,a=0;yf(e,t,n,(c,f)=>{++a,i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const u=mf(i,r,s,o),l=c=>u[0]+u[1]*c;return{coef:u,predict:l,rSquared:wl(e,t,n,r,l)}}function Jk(e,t,n){let i=0,r=0,s=0,o=0,a=0;yf(e,t,n,(c,f)=>{++a,c=Math.log(c),i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const u=mf(i,r,s,o),l=c=>u[0]+u[1]*Math.log(c);return{coef:u,predict:l,rSquared:wl(e,t,n,r,l)}}function Qk(e,t,n){const[i,r,s,o]=$0(e,t,n);let a=0,u=0,l=0,c=0,f=0,d,h,p;yf(e,t,n,(b,v)=>{d=i[f++],h=Math.log(v),p=d*v,a+=(v*h-a)/f,u+=(p-u)/f,l+=(p*h-l)/f,c+=(d*p-c)/f});const[g,m]=mf(u/o,a/o,l/o,c/o),y=b=>Math.exp(g+m*(b-s));return{coef:[Math.exp(g-m*s),m],predict:y,rSquared:wl(e,t,n,o,y)}}function eE(e,t,n){let i=0,r=0,s=0,o=0,a=0,u=0;yf(e,t,n,(f,d)=>{const h=Math.log(f),p=Math.log(d);++u,i+=(h-i)/u,r+=(p-r)/u,s+=(h*p-s)/u,o+=(h*h-o)/u,a+=(d-a)/u});const l=mf(i,r,s,o),c=f=>l[0]*Math.pow(f,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:wl(e,t,n,a,c)}}function Oy(e,t,n){const[i,r,s,o]=$0(e,t,n),a=i.length;let u=0,l=0,c=0,f=0,d=0,h,p,g,m;for(h=0;h(w=w-s,v*w*w+_*w+x+o);return{coef:[x-_*s+v*s*s+o,_-2*v*s,v],predict:k,rSquared:wl(e,t,n,o,k)}}function tE(e,t,n,i){if(i===0)return Ny(e,t,n);if(i===1)return Ry(e,t,n);if(i===2)return Oy(e,t,n);const[r,s,o,a]=$0(e,t,n),u=r.length,l=[],c=[],f=i+1;let d,h,p,g,m;for(d=0;d{v-=o;let _=a+y[0]+y[1]*v+y[2]*v*v;for(d=3;d=0;--s)for(a=t[s],u=1,r[s]+=a,o=1;o<=s;++o)u*=(s+1-o)/o,r[s-o]+=a*Math.pow(n,o)*u;return r[0]+=i,r}function dV(e){const t=e.length-1,n=[];let i,r,s,o,a;for(i=0;iMath.abs(e[i][o])&&(o=r);for(s=i;s=i;s--)e[s][r]-=e[s][i]*e[i][r]/e[i][i]}for(r=t-1;r>=0;--r){for(a=0,s=r+1;sr[v]-y?b:v;let x=0,k=0,w=0,E=0,C=0;const F=1/Math.abs(r[_]-y||1);for(let P=b;P<=v;++P){const T=r[P],A=s[P],M=hV(Math.abs(y-T)*F)*d[P],B=T*M;x+=M,k+=B,w+=A*M,E+=A*B,C+=T*B}const[S,z]=mf(k/x,w/x,E/x,C/x);c[m]=S+z*y,f[m]=Math.abs(s[m]-c[m]),pV(r,m+1,p)}if(h===nE)break;const g=p8(f);if(Math.abs(g)=1?iE:(b=1-y*y)*b}return gV(r,c,o,a)}function hV(e){return(e=1-e*e*e)*e*e}function pV(e,t,n){const i=e[t];let r=n[0],s=n[1]+1;if(!(s>=e.length))for(;t>r&&e[s]-i<=i-e[r];)n[0]=++r,n[1]=s,++s}function gV(e,t,n,i){const r=e.length,s=[];let o=0,a=0,u=[],l;for(;o[g,e(g)],s=t[0],o=t[1],a=o-s,u=a/i,l=[r(s)],c=[];if(n===i){for(let g=1;g0;)c.push(r(s+g/n*a))}let f=l[0],d=c[c.length-1];const h=1/a,p=yV(f[1],c);for(;d;){const g=r((f[0]+d[0])/2);g[0]-f[0]>=u&&bV(f,g,d,h,p)>mV?c.push(g):(f=d,l.push(d),c.pop()),d=c[c.length-1]}return l}function yV(e,t){let n=e,i=e;const r=t.length;for(let s=0;si&&(i=o)}return 1/(i-n)}function bV(e,t,n,i,r){const s=Math.atan2(r*(n[1]-e[1]),i*(n[0]-e[0])),o=Math.atan2(r*(t[1]-e[1]),i*(t[0]-e[0]));return Math.abs(s-o)}function vV(e){return t=>{const n=e.length;let i=1,r=String(e[0](t));for(;i{},_V={init:Iy,add:Iy,rem:Iy,idx:0},bf={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||e.max===void 0)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},vf=Object.keys(bf).filter(e=>e!=="__count__");function xV(e,t){return(n,i)=>Be({name:e,aggregate_param:i,out:n||e},_V,t)}[...vf,"__count__"].forEach(e=>{bf[e]=xV(e,bf[e])});function oE(e,t,n){return bf[e](n,t)}function aE(e,t){return e.idx-t.idx}function wV(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=bf[r]())})};return e.forEach(n),Object.values(t).sort(aE)}function kV(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function EV(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function CV(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function AV(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function uE(e,t){const n=t||Cn,i=wV(e),r=e.slice().sort(aE);function s(o){this._ops=i,this._out=r,this.cell=o,this.init()}return s.prototype.init=kV,s.prototype.add=EV,s.prototype.rem=CV,s.prototype.set=AV,s.prototype.get=n,s.fields=e.map(o=>o.out),s}function Py(e){this._key=e?Bi(e):Ae,this.reset()}const dn=Py.prototype;dn.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},dn.add=function(e){this._add.push(e)},dn.rem=function(e){this._rem.push(e)},dn.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,i=e.length,r=t.length,s=Array(i-r),o={};let a,u,l;for(a=0;a=0;)s=e(t[i])+"",ue(n,s)||(n[s]=1,++r);return r},dn.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=G4(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext},dn.argmin=function(e){return this.extent(e)[0]||{}},dn.argmax=function(e){return this.extent(e)[1]||{}},dn.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0},dn.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0},dn.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=_y(this.values(),e),this._get=e),this._q},dn.q1=function(e){return this.quartile(e)[0]},dn.q2=function(e){return this.quartile(e)[1]},dn.q3=function(e){return this.quartile(e)[2]},dn.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=Gk(this.values(),1e3,.05,e),this._get=e),this._ci},dn.ci0=function(e){return this.ci(e)[0]},dn.ci1=function(e){return this.ci(e)[1]};function Mo(e){j.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}Mo.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:vf},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]},te(Mo,j,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();return n.stamp=i.stamp,n.value&&(r||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(e):Object.create(null),t.visit(t.SOURCE,s=>n.add(s))):(n.value=n.value||n.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),i.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&i.clean(!0).runAfter(()=>this.clean()),n.changes(i)},cross(){const e=this,t=e.value,n=e._dnames,i=n.map(()=>({})),r=n.length;function s(a){let u,l,c,f;for(u in a)for(c=a[u].tuple,l=0;l{const v=Rt(b);return r(b),n.push(v),v}),this.cellkey=e.key?e.key:Ly(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const s=e.fields||[null],o=e.ops||["count"],a=e.aggregate_params||[null],u=e.as||[],l=s.length,c={};let f,d,h,p,g,m,y;for(l!==o.length&&W("Unmatched number of fields and aggregate ops."),y=0;yuE(b,b.field)),Object.create(null)},cellkey:Ly(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp{const f=i(c);c[a]=f,c[u]=f==null?null:r+s*(1+(f-r)/s)}:c=>c[a]=i(c)),t.modifies(n?o:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=Hk(e),i=n.step;let r=n.start,s=r+Math.ceil((n.stop-r)/i)*i,o,a;(o=e.anchor)!=null&&(a=o-(r+i*Math.floor((o-r)/i)),r+=a,s+=a);const u=function(l){let c=An(t(l));return c==null?null:cs?1/0:(c=Math.max(r,Math.min(c,s-i)),r+i*Math.floor($V+(c-r)/i))};return u.start=r,u.stop=n.stop,u.step=i,this.value=si(u,En(t),e.name||"bin_"+Rt(t))}});function lE(e,t,n){const i=e;let r=t||[],s=n||[],o={},a=0;return{add:u=>s.push(u),remove:u=>o[i(u)]=++a,size:()=>r.length,data:(u,l)=>(a&&(r=r.filter(c=>!o[i(c)]),o={},a=0),l&&u&&r.sort(u),s.length&&(r=u?K4(u,r,s.sort(u)):r.concat(s),s=[]),r)}}function By(e){j.call(this,[],e)}By.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},te(By,j,{transform(e,t){const n=t.fork(t.ALL),i=lE(Ae,this.value,n.materialize(n.ADD).add),r=e.sort,s=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(s),this.value=n.source=i.data(Na(r),s),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function cE(e){xt.call(this,null,SV,e)}te(cE,xt);function SV(e){return this.value&&!e.modified()?this.value:$2(e.fields,e.orders)}function jy(e){j.call(this,null,e)}jy.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function FV(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}te(jy,j,{transform(e,t){const n=f=>d=>{for(var h=FV(a(d),e.case,s)||[],p,g=0,m=h.length;gr[f]=1+(r[f]||0)),c=n(f=>r[f]-=1);return i?t.visit(t.SOURCE,l):(t.visit(t.ADD,l),t.visit(t.REM,c)),this._finish(t,u)},_parameterCheck(e,t){let n=!1;return(e.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),(e.modified("pattern")||!this._match)&&(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,i=this._tuples||(this._tuples={}),r=t[0],s=t[1],o=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,u,l;for(a in n)u=i[a],l=n[a]||0,!u&&l?(i[a]=u=it({}),u[r]=a,u[s]=l,o.add.push(u)):l===0?(u&&o.rem.push(u),n[a]=null,i[a]=null):u[s]!==l&&(u[s]=l,o.mod.push(u));return o.modifies(t)}});function Uy(e){j.call(this,null,e)}Uy.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},te(Uy,j,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],s=i[1],o=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return o?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=DV(a,r,s,e.filter||ji)):n.mod=a,n.source=this.value,n.modifies(i)}});function DV(e,t,n,i){for(var r=[],s={},o=e.length,a=0,u,l;ahE(s,t))):typeof i[r]===dE&&i[r](e[r]);return i}function qy(e){j.call(this,null,e)}const pE=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],NV={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:pE},{name:"weights",type:"number",array:!0}]};qy.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:pE.concat(NV)},{name:"as",type:"string",array:!0,default:["value","density"]}]},te(qy,j,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=hE(e.distribution,RV(t)),r=e.steps||e.minsteps||25,s=e.steps||e.maxsteps||200;let o=e.method||"pdf";o!=="pdf"&&o!=="cdf"&&W("Invalid density method: "+o),!e.extent&&!i.data&&W("Missing density extent parameter."),o=i[o];const a=e.as||["value","density"],u=e.extent||Wr(i.data()),l=S0(o,u,r,s).map(c=>{const f={};return f[a[0]]=c[0],f[a[1]]=c[1],it(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=l}return n}});function RV(e){return()=>e.materialize(e.SOURCE).source}function gE(e,t){return e?e.map((n,i)=>t[i]||Rt(n)):null}function Wy(e,t,n){const i=[],r=f=>f(u);let s,o,a,u,l,c;if(t==null)i.push(e.map(n));else for(s={},o=0,a=e.length;oXc(Wr(e,t))/30;te(Hy,j,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=Wy(t.source,e.groupby,Cn),r=e.smooth||!1,s=e.field,o=e.step||OV(n,s),a=Na((p,g)=>s(p)-s(g)),u=e.as||mE,l=i.length;let c=1/0,f=-1/0,d=0,h;for(;df&&(f=g),p[++h][u]=g}return this.value={start:c,stop:f,step:o},t.reflow(!0).modifies(u)}});function yE(e){xt.call(this,null,LV,e),this.modified(!0)}te(yE,xt);function LV(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:si(n=>t(n,e),En(t),Rt(t))}function Gy(e){j.call(this,[void 0,void 0],e)}Gy.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},te(Gy,j,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let s=n[0],o=n[1];if((r||s==null)&&(s=1/0,o=-1/0),t.visit(r?t.SOURCE:t.ADD,a=>{const u=An(i(a));u!=null&&(uo&&(o=u))}),!Number.isFinite(s)||!Number.isFinite(o)){let a=Rt(i);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${s}, ${o}]`),s=o=void 0}this.value=[s,o]}});function Vy(e,t){xt.call(this,e),this.parent=t,this.count=0}te(Vy,xt,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}});function F0(e){j.call(this,{},e),this._keys=ol();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let i=0,r=t.active;ii&&i.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,i=e?e.length:0;let r=0;for(;rthis.subflow(u,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,u=>{const l=Ae(u),c=s.get(l);c!==void 0&&(s.delete(l),a(c).rem(u))}),t.visit(t.ADD,u=>{const l=i(u);s.set(Ae(u),l),a(l).add(u)}),o||t.modified(i.fields)?t.visit(t.MOD,u=>{const l=Ae(u),c=s.get(l),f=i(u);c===f?a(f).mod(u):(s.set(l,f),a(c).rem(u),a(f).add(u))}):t.changed(t.MOD)&&t.visit(t.MOD,u=>{a(s.get(Ae(u))).mod(u)}),o&&t.visit(t.REFLOW,u=>{const l=Ae(u),c=s.get(l),f=i(u);c!==f&&(s.set(l,f),a(c).rem(u),a(f).add(u))}),t.clean()?n.runAfter(()=>{this.clean(),s.clean()}):s.empty>n.cleanThreshold&&n.runAfter(s.clean),t}});function bE(e){xt.call(this,null,IV,e)}te(bE,xt);function IV(e){return this.value&&!e.modified()?this.value:G(e.name)?se(e.name).map(t=>Bi(t)):Bi(e.name,e.as)}function Yy(e){j.call(this,ol(),e)}Yy.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},te(Yy,j,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),s=r.add,o=r.rem,a=r.mod,u=e.expr;let l=!0;t.visit(t.REM,f=>{const d=Ae(f);i.has(d)?i.delete(d):o.push(f)}),t.visit(t.ADD,f=>{u(f,e)?s.push(f):i.set(Ae(f),1)});function c(f){const d=Ae(f),h=u(f,e),p=i.get(d);h&&p?(i.delete(d),s.push(f)):!h&&!p?(i.set(d,1),o.push(f)):l&&h&&!p&&a.push(f)}return t.visit(t.MOD,c),e.modified()&&(l=!1,t.visit(t.REFLOW,c)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}});function Xy(e){j.call(this,[],e)}Xy.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},te(Xy,j,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=gE(i,e.as||[]),s=e.index||null,o=r.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const u=i.map(p=>p(a)),l=u.reduce((p,g)=>Math.max(p,g.length),0);let c=0,f,d,h;for(;c{for(let c=0,f;co[i]=n(o,e))}});function vE(e){j.call(this,[],e)}te(vE,j,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r=this.value,s=e.size-r.length,o,a,u;if(s>0){for(o=[];--s>=0;)o.push(u=it(i(e))),r.push(u);n.add=n.add.length?n.materialize(n.ADD).add.concat(o):o}else a=r.slice(0,-s),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,r=r.slice(-s);return n.source=this.value=r,n}});const D0={value:"value",median:p8,mean:vW,min:B2,max:Sa},PV=[];function Jy(e){j.call(this,[],e)}Jy.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function zV(e){var t=e.method||D0.value,n;if(D0[t]==null)W("Unrecognized imputation method: "+t);else return t===D0.value?(n=e.value!==void 0?e.value:0,()=>n):D0[t]}function BV(e){const t=e.field;return n=>n?t(n):NaN}te(Jy,j,{transform(e,t){var n=t.fork(t.ALL),i=zV(e),r=BV(e),s=Rt(e.field),o=Rt(e.key),a=(e.groupby||[]).map(Rt),u=jV(t.source,e.groupby,e.key,e.keyvals),l=[],c=this.value,f=u.domain.length,d,h,p,g,m,y,b,v,_,x;for(m=0,v=u.length;my(m),s=[],o=i?i.slice():[],a={},u={},l,c,f,d,h,p,g,m;for(o.forEach((y,b)=>a[y]=b+1),d=0,g=e.length;dn.add(s))):(r=n.value=n.value||this.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),n.changes(),t.visit(t.SOURCE,s=>{Be(s,r[n.cellkey(s)].tuple)}),t.reflow(i).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,i;for(n=0,i=this._alen;n{const p=Ey(h,o)[a],g=e.counts?h.length:1,m=c||Wr(h);S0(p,m,f,d).forEach(y=>{const b={};for(let v=0;v(this._pending=se(r.data),s=>s.touch(this)))}:n.request(e.url,e.format).then(i=>tb(this,t,se(i.data)))}});function qV(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function tb(e,t,n){n.forEach(it);const i=t.fork(t.NO_FIELDS&t.NO_SOURCE);return i.rem=e.value,e.value=i.source=i.add=n,e._pending=null,i.rem.length&&i.clean(!0),i}function nb(e){j.call(this,{},e)}nb.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},te(nb,j,{transform(e,t){const n=e.fields,i=e.index,r=e.values,s=e.default==null?null:e.default,o=e.modified(),a=n.length;let u=o?t.SOURCE:t.ADD,l=t,c=e.as,f,d,h;return r?(d=r.length,a>1&&!c&&W('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==a*d&&W('The "as" parameter has too few output field names.'),c=c||r.map(Rt),f=function(p){for(var g=0,m=0,y,b;gt.modified(p.fields)),u|=h?t.MOD:0),t.visit(u,f),l.modifies(c)}});function wE(e){xt.call(this,null,WV,e)}te(wE,xt);function WV(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let i=1/0,r=-1/0,s,o;for(s=0;sr&&(r=o[1]);return[i,r]}function kE(e){xt.call(this,null,HV,e)}te(kE,xt);function HV(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function EE(e){j.call(this,null,e)}te(EE,j,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function ib(e){Mo.call(this,e)}ib.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:vf,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},te(ib,Mo,{_transform:Mo.prototype.transform,transform(e,t){return this._transform(GV(e,t),t)}});function GV(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",s=En(n).concat(En(i)),o=YV(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:o.map(()=>r),fields:o.map(a=>VV(a,n,i,s)),as:o.map(a=>a+""),modified:e.modified.bind(e)}}function VV(e,t,n,i){return si(r=>t(r)===e?n(r):NaN,i,e+"")}function YV(e,t,n){const i={},r=[];return n.visit(n.SOURCE,s=>{const o=e(s);i[o]||(i[o]=1,r.push(o))}),r.sort(sl),t?r.slice(0,t):r}function CE(e){F0.call(this,e)}te(CE,F0,{transform(e,t){const n=e.subflow,i=e.field,r=s=>this.subflow(Ae(s),n,t,s);return(e.modified("field")||i&&t.modified(En(i)))&&W("PreFacet does not support field modification."),this.initTargets(),i?(t.visit(t.MOD,s=>{const o=r(s);i(s).forEach(a=>o.mod(a))}),t.visit(t.ADD,s=>{const o=r(s);i(s).forEach(a=>o.add(it(a)))}),t.visit(t.REM,s=>{const o=r(s);i(s).forEach(a=>o.rem(a))})):(t.visit(t.MOD,s=>r(s).mod(s)),t.visit(t.ADD,s=>r(s).add(s)),t.visit(t.REM,s=>r(s).rem(s))),t.clean()&&t.runAfter(()=>this.clean()),t}});function rb(e){j.call(this,null,e)}rb.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},te(rb,j,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=gE(e.fields,e.as||[]),s=i?(a,u)=>XV(a,u,i,r):b0;let o;return this.value?o=this.value:(t=t.addAll(),o=this.value={}),t.visit(t.REM,a=>{const u=Ae(a);n.rem.push(o[u]),o[u]=null}),t.visit(t.ADD,a=>{const u=s(a,it({}));o[Ae(a)]=u,n.add.push(u)}),t.visit(t.MOD,a=>{n.mod.push(s(a,o[Ae(a)]))}),n}});function XV(e,t,n,i){for(let r=0,s=n.length;r{const d=vy(f,l);for(let h=0;h{const s=Ae(r);n.rem.push(i[s]),i[s]=null}),t.visit(t.ADD,r=>{const s=gy(r);i[Ae(r)]=s,n.add.push(s)}),t.visit(t.MOD,r=>{const s=i[Ae(r)];for(const o in r)s[o]=r[o],n.modifies(o);n.mod.push(s)})),n}});function ob(e){j.call(this,[],e),this.count=0}ob.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},te(ob,j,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,s=this.value.reduce((c,f)=>(c[Ae(f)]=1,c),{});let o=this.value,a=this.count,u=0;function l(c){let f,d;o.length=u&&(f=o[d],s[Ae(f)]&&n.rem.push(f),o[d]=c)),++a}if(t.rem.length&&(t.visit(t.REM,c=>{const f=Ae(c);s[f]&&(s[f]=-1,n.rem.push(c)),--a}),o=o.filter(c=>s[Ae(c)]!==-1)),(t.rem.length||i)&&o.length{s[Ae(c)]||l(c)}),u=-1),i&&o.length>r){const c=o.length-r;for(let f=0;f{s[Ae(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,l),(t.add.length||u<0)&&(n.add=o.filter(c=>!s[Ae(c)])),this.count=a,this.value=n.source=o,n}});function ab(e){j.call(this,null,e)}ab.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},te(ab,j,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=Ci(e.start,e.stop,e.step||1).map(r=>{const s={};return s[i]=r,it(s)}),n.add=t.add.concat(this.value),n}});function SE(e){j.call(this,null,e),this.modified(!0)}te(SE,j,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function ub(e){j.call(this,null,e)}const FE=["unit0","unit1"];ub.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:Y2,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:FE}]},te(ub,j,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",s=this._floor(e,t),o=(r?yl:ml)(s.unit).offset,a=e.as||FE,u=a[0],l=a[1],c=s.step;let f=s.start||1/0,d=s.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(En(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,p=>{const g=n(p);let m,y;g==null?(p[u]=null,i&&(p[l]=null)):(p[u]=m=y=s(g),i&&(p[l]=y=o(m,c)),md&&(d=y))}),s.start=f,s.stop=d,t.modifies(i?a:u)},_floor(e,t){const n=e.timezone==="utc",{units:i,step:r}=e.units?{units:e.units,step:e.step||1}:Z8({extent:e.extent||Wr(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),s=Z2(i),o=this.value||{},a=(n?z8:P8)(s,r);return a.unit=Ye(s),a.units=s,a.step=r,a.start=o.start,a.stop=o.stop,this.value=a}});function DE(e){j.call(this,ol(),e)}te(DE,j,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,s=a=>r.set(i(a),a);let o=!0;return e.modified("field")||t.modified(i.fields)?(r.clear(),t.visit(t.SOURCE,s)):t.changed()?(t.visit(t.REM,a=>r.delete(i(a))),t.visit(t.ADD,s)):o=!1,this.modified(o),r.empty>n.cleanThreshold&&n.runAfter(r.clean),t.fork()}});function TE(e){j.call(this,null,e)}te(TE,j,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(Na(e.sort)):t.source).map(e.field))}});function KV(e,t,n,i){const r=_f[e](t,n);return{init:r.init||_o,update:function(s,o){o[i]=r.next(s)}}}const _f={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?++e:e}}},percent_rank:function(){const e=_f.rank(),t=e.next;return{init:e.init,next:n=>(t(n)-1)/(n.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,i=t.compare;let r=t.index;if(e0||W("ntile num must be greater than zero.");const n=_f.cume_dist(),i=n.next;return{init:n.init,next:r=>Math.ceil(t*i(r))}},lag:function(e,t){return t=+t||1,{next:n=>{const i=n.index-t;return i>=0?e(n.data[i]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const i=n.index+t,r=n.data;return ie(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return t=+t,t>0||W("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(t-1);return it=null,next:n=>{const i=e(n.data[n.index]);return i!=null?t=i:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:i=>{const r=i.data;return i.index<=n?t:(n=JV(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function JV(e,t,n){for(let i=t.length;nu[g]=1)}h(e.sort),t.forEach((p,g)=>{const m=n[g],y=i[g],b=r[g]||null,v=Rt(m),_=sE(p,v,s[g]);if(h(m),o.push(_),ue(_f,p))a.push(KV(p,m,y,_));else{if(m==null&&p!=="count"&&W("Null aggregate field specified."),p==="count"){c.push(_);return}d=!1;let x=l[v];x||(x=l[v]=[],x.field=m,f.push(x)),x.push(oE(p,b,_))}}),(c.length||f.length)&&(this.cell=eY(f,c,d)),this.inputs=Object.keys(u)}const NE=ME.prototype;NE.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()},NE.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,s=i&&i.length;let o;if(n){for(o=e.p0;ouE(u,u.field));const i={num:0,agg:null,store:!1,count:t};if(!n)for(var r=e.length,s=i.agg=Array(r),o=0;othis.group(r(a));let o=this.state;(!o||n)&&(o=this.state=new ME(e)),n||t.modified(o.inputs)?(this.value={},t.visit(t.SOURCE,a=>s(a).add(a))):(t.visit(t.REM,a=>s(a).remove(a)),t.visit(t.ADD,a=>s(a).add(a)));for(let a=0,u=this._mlen;a0&&!r(s[n],s[n-1])&&(e.i0=t.left(s,s[n])),i1?0:e<-1?kl:Math.acos(e)}function LE(e){return e>=1?T0:e<=-1?-T0:Math.asin(e)}const fb=Math.PI,db=2*fb,La=1e-6,aY=db-La;function IE(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return IE;const n=10**t;return function(i){this._+=i[0];for(let r=1,s=i.length;rLa)if(!(Math.abs(f*u-l*c)>La)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let h=i-o,p=r-a,g=u*u+l*l,m=h*h+p*p,y=Math.sqrt(g),b=Math.sqrt(d),v=s*Math.tan((fb-Math.acos((g+d-m)/(2*y*b)))/2),_=v/b,x=v/y;Math.abs(_-1)>La&&this._append`L${t+_*c},${n+_*f}`,this._append`A${s},${s},0,0,${+(f*h>c*p)},${this._x1=t+x*u},${this._y1=n+x*l}`}}arc(t,n,i,r,s,o){if(t=+t,n=+n,i=+i,o=!!o,i<0)throw new Error(`negative radius: ${i}`);let a=i*Math.cos(r),u=i*Math.sin(r),l=t+a,c=n+u,f=1^o,d=o?r-s:s-r;this._x1===null?this._append`M${l},${c}`:(Math.abs(this._x1-l)>La||Math.abs(this._y1-c)>La)&&this._append`L${l},${c}`,i&&(d<0&&(d=d%db+db),d>aY?this._append`A${i},${i},0,1,${f},${t-a},${n-u}A${i},${i},0,1,${f},${this._x1=l},${this._y1=c}`:d>La&&this._append`A${i},${i},0,${+(d>=fb)},${f},${this._x1=t+i*Math.cos(s)},${this._y1=n+i*Math.sin(s)}`)}rect(t,n,i,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}};function M0(){return new hb}M0.prototype=hb.prototype;function N0(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);t=i}return e},()=>new hb(t)}function lY(e){return e.innerRadius}function cY(e){return e.outerRadius}function fY(e){return e.startAngle}function dY(e){return e.endAngle}function hY(e){return e&&e.padAngle}function pY(e,t,n,i,r,s,o,a){var u=n-e,l=i-t,c=o-r,f=a-s,d=f*u-c*l;if(!(d*dT*T+A*A&&(E=F,C=S),{cx:E,cy:C,x01:-c,y01:-f,x11:E*(r/x-1),y11:C*(r/x-1)}}function gY(){var e=lY,t=cY,n=ot(0),i=null,r=fY,s=dY,o=hY,a=null,u=N0(l);function l(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=r.apply(this,arguments)-T0,g=s.apply(this,arguments)-T0,m=RE(g-p),y=g>p;if(a||(a=c=u()),hTn))a.moveTo(0,0);else if(m>OE-Tn)a.moveTo(h*Ra(p),h*Xr(p)),a.arc(0,0,h,p,g,!y),d>Tn&&(a.moveTo(d*Ra(g),d*Xr(g)),a.arc(0,0,d,g,p,y));else{var b=p,v=g,_=p,x=g,k=m,w=m,E=o.apply(this,arguments)/2,C=E>Tn&&(i?+i.apply(this,arguments):Oa(d*d+h*h)),F=cb(RE(h-d)/2,+n.apply(this,arguments)),S=F,z=F,P,T;if(C>Tn){var A=LE(C/d*Xr(E)),M=LE(C/h*Xr(E));(k-=A*2)>Tn?(A*=y?1:-1,_+=A,x-=A):(k=0,_=x=(p+g)/2),(w-=M*2)>Tn?(M*=y?1:-1,b+=M,v-=M):(w=0,b=v=(p+g)/2)}var B=h*Ra(b),V=h*Xr(b),H=d*Ra(x),oe=d*Xr(x);if(F>Tn){var ke=h*Ra(v),we=h*Xr(v),Oe=d*Ra(_),rt=d*Xr(_),Ie;if(mTn?z>Tn?(P=R0(Oe,rt,B,V,h,z,y),T=R0(ke,we,H,oe,h,z,y),a.moveTo(P.cx+P.x01,P.cy+P.y01),zTn)||!(k>Tn)?a.lineTo(H,oe):S>Tn?(P=R0(H,oe,ke,we,d,-S,y),T=R0(B,V,Oe,rt,d,-S,y),a.lineTo(P.cx+P.x01,P.cy+P.y01),S=h;--p)a.point(v[p],_[p]);a.lineEnd(),a.areaEnd()}y&&(v[d]=+e(m,d,f),_[d]=+t(m,d,f),a.point(i?+i(m,d,f):v[d],n?+n(m,d,f):_[d]))}if(b)return a=null,b+""||null}function c(){return UE().defined(r).curve(o).context(s)}return l.x=function(f){return arguments.length?(e=typeof f=="function"?f:ot(+f),i=null,l):e},l.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ot(+f),l):e},l.x1=function(f){return arguments.length?(i=f==null?null:typeof f=="function"?f:ot(+f),l):i},l.y=function(f){return arguments.length?(t=typeof f=="function"?f:ot(+f),n=null,l):t},l.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ot(+f),l):t},l.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ot(+f),l):n},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(n)},l.lineX1=function(){return c().x(i).y(t)},l.defined=function(f){return arguments.length?(r=typeof f=="function"?f:ot(!!f),l):r},l.curve=function(f){return arguments.length?(o=f,s!=null&&(a=o(s)),l):o},l.context=function(f){return arguments.length?(f==null?s=a=null:a=o(s=f),l):s},l}const mY={draw(e,t){const n=Oa(t/kl);e.moveTo(n,0),e.arc(0,0,n,0,OE)}};function yY(e,t){let n=null,i=N0(r);e=typeof e=="function"?e:ot(e||mY),t=typeof t=="function"?t:ot(t===void 0?64:+t);function r(){let s;if(n||(n=s=i()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return r.type=function(s){return arguments.length?(e=typeof s=="function"?s:ot(s),r):e},r.size=function(s){return arguments.length?(t=typeof s=="function"?s:ot(+s),r):t},r.context=function(s){return arguments.length?(n=s??null,r):n},r}function No(){}function O0(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function L0(e){this._context=e}L0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:O0(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:O0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function bY(e){return new L0(e)}function WE(e){this._context=e}WE.prototype={areaStart:No,areaEnd:No,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:O0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function vY(e){return new WE(e)}function HE(e){this._context=e}HE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:O0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _Y(e){return new HE(e)}function GE(e,t){this._basis=new L0(e),this._beta=t}GE.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var i=e[0],r=t[0],s=e[n]-i,o=t[n]-r,a=-1,u;++a<=n;)u=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(i+u*s),this._beta*t[a]+(1-this._beta)*(r+u*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const xY=function e(t){function n(i){return t===1?new L0(i):new GE(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function I0(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function gb(e,t){this._context=e,this._k=(1-t)/6}gb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:I0(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:I0(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const wY=function e(t){function n(i){return new gb(i,t)}return n.tension=function(i){return e(+i)},n}(0);function mb(e,t){this._context=e,this._k=(1-t)/6}mb.prototype={areaStart:No,areaEnd:No,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:I0(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const kY=function e(t){function n(i){return new mb(i,t)}return n.tension=function(i){return e(+i)},n}(0);function yb(e,t){this._context=e,this._k=(1-t)/6}yb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:I0(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const EY=function e(t){function n(i){return new yb(i,t)}return n.tension=function(i){return e(+i)},n}(0);function bb(e,t,n){var i=e._x1,r=e._y1,s=e._x2,o=e._y2;if(e._l01_a>Tn){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,u=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/u,r=(r*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/u}if(e._l23_a>Tn){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*l+e._x1*e._l23_2a-t*e._l12_2a)/c,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(i,r,s,o,e._x2,e._y2)}function VE(e,t){this._context=e,this._alpha=t}VE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:bb(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const CY=function e(t){function n(i){return t?new VE(i,t):new gb(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function YE(e,t){this._context=e,this._alpha=t}YE.prototype={areaStart:No,areaEnd:No,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:bb(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const AY=function e(t){function n(i){return t?new YE(i,t):new mb(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function XE(e,t){this._context=e,this._alpha=t}XE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:bb(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const $Y=function e(t){function n(i){return t?new XE(i,t):new yb(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function ZE(e){this._context=e}ZE.prototype={areaStart:No,areaEnd:No,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function SY(e){return new ZE(e)}function KE(e){return e<0?-1:1}function JE(e,t,n){var i=e._x1-e._x0,r=t-e._x1,s=(e._y1-e._y0)/(i||r<0&&-0),o=(n-e._y1)/(r||i<0&&-0),a=(s*r+o*i)/(i+r);return(KE(s)+KE(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function QE(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function vb(e,t,n){var i=e._x0,r=e._y0,s=e._x1,o=e._y1,a=(s-i)/3;e._context.bezierCurveTo(i+a,r+a*t,s-a,o-a*n,s,o)}function P0(e){this._context=e}P0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:vb(this,this._t0,QE(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,vb(this,QE(this,n=JE(this,e,t)),n);break;default:vb(this,this._t0,n=JE(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function eC(e){this._context=new tC(e)}(eC.prototype=Object.create(P0.prototype)).point=function(e,t){P0.prototype.point.call(this,t,e)};function tC(e){this._context=e}tC.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,s){this._context.bezierCurveTo(t,e,i,n,s,r)}};function FY(e){return new P0(e)}function DY(e){return new eC(e)}function nC(e){this._context=e}nC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var i=iC(e),r=iC(t),s=0,o=1;o=0;--t)r[t]=(o[t]-r[t+1])/s[t];for(s[n-1]=(e[n]+r[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function MY(e){return new z0(e,.5)}function NY(e){return new z0(e,0)}function RY(e){return new z0(e,1)}function Ro(e,t){if(typeof document<"u"&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}const OY=()=>typeof Image<"u"?Image:null;function Zr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Oo(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const _b=Symbol("implicit");function xb(){var e=new a8,t=[],n=[],i=_b;function r(s){let o=e.get(s);if(o===void 0){if(i!==_b)return i;e.set(s,o=t.push(s)-1)}return n[o%n.length]}return r.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new a8;for(const o of s)e.has(o)||e.set(o,t.push(o)-1);return r},r.range=function(s){return arguments.length?(n=Array.from(s),r):n.slice()},r.unknown=function(s){return arguments.length?(i=s,r):i},r.copy=function(){return xb(t,n).unknown(i)},Zr.apply(r,arguments),r}function El(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function xf(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Lo(){}var Ia=.7,Cl=1/Ia,Al="\\s*([+-]?\\d+)\\s*",wf="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Kr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",LY=/^#([0-9a-f]{3,8})$/,IY=new RegExp(`^rgb\\(${Al},${Al},${Al}\\)$`),PY=new RegExp(`^rgb\\(${Kr},${Kr},${Kr}\\)$`),zY=new RegExp(`^rgba\\(${Al},${Al},${Al},${wf}\\)$`),BY=new RegExp(`^rgba\\(${Kr},${Kr},${Kr},${wf}\\)$`),jY=new RegExp(`^hsl\\(${wf},${Kr},${Kr}\\)$`),UY=new RegExp(`^hsla\\(${wf},${Kr},${Kr},${wf}\\)$`),rC={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};El(Lo,kf,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:sC,formatHex:sC,formatHex8:qY,formatHsl:WY,formatRgb:oC,toString:oC});function sC(){return this.rgb().formatHex()}function qY(){return this.rgb().formatHex8()}function WY(){return fC(this).formatHsl()}function oC(){return this.rgb().formatRgb()}function kf(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=LY.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?aC(t):n===3?new Qt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?B0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?B0(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=IY.exec(e))?new Qt(t[1],t[2],t[3],1):(t=PY.exec(e))?new Qt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=zY.exec(e))?B0(t[1],t[2],t[3],t[4]):(t=BY.exec(e))?B0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=jY.exec(e))?cC(t[1],t[2]/100,t[3]/100,1):(t=UY.exec(e))?cC(t[1],t[2]/100,t[3]/100,t[4]):rC.hasOwnProperty(e)?aC(rC[e]):e==="transparent"?new Qt(NaN,NaN,NaN,0):null}function aC(e){return new Qt(e>>16&255,e>>8&255,e&255,1)}function B0(e,t,n,i){return i<=0&&(e=t=n=NaN),new Qt(e,t,n,i)}function wb(e){return e instanceof Lo||(e=kf(e)),e?(e=e.rgb(),new Qt(e.r,e.g,e.b,e.opacity)):new Qt}function Io(e,t,n,i){return arguments.length===1?wb(e):new Qt(e,t,n,i??1)}function Qt(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}El(Qt,Io,xf(Lo,{brighter(e){return e=e==null?Cl:Math.pow(Cl,e),new Qt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ia:Math.pow(Ia,e),new Qt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Qt(Pa(this.r),Pa(this.g),Pa(this.b),j0(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:uC,formatHex:uC,formatHex8:HY,formatRgb:lC,toString:lC}));function uC(){return`#${za(this.r)}${za(this.g)}${za(this.b)}`}function HY(){return`#${za(this.r)}${za(this.g)}${za(this.b)}${za((isNaN(this.opacity)?1:this.opacity)*255)}`}function lC(){const e=j0(this.opacity);return`${e===1?"rgb(":"rgba("}${Pa(this.r)}, ${Pa(this.g)}, ${Pa(this.b)}${e===1?")":`, ${e})`}`}function j0(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Pa(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function za(e){return e=Pa(e),(e<16?"0":"")+e.toString(16)}function cC(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new hr(e,t,n,i)}function fC(e){if(e instanceof hr)return new hr(e.h,e.s,e.l,e.opacity);if(e instanceof Lo||(e=kf(e)),!e)return new hr;if(e instanceof hr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),o=NaN,a=s-r,u=(s+r)/2;return a?(t===s?o=(n-i)/a+(n0&&u<1?0:o,new hr(o,a,u,e.opacity)}function U0(e,t,n,i){return arguments.length===1?fC(e):new hr(e,t,n,i??1)}function hr(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}El(hr,U0,xf(Lo,{brighter(e){return e=e==null?Cl:Math.pow(Cl,e),new hr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ia:Math.pow(Ia,e),new hr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new Qt(kb(e>=240?e-240:e+120,r,i),kb(e,r,i),kb(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new hr(dC(this.h),q0(this.s),q0(this.l),j0(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=j0(this.opacity);return`${e===1?"hsl(":"hsla("}${dC(this.h)}, ${q0(this.s)*100}%, ${q0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function dC(e){return e=(e||0)%360,e<0?e+360:e}function q0(e){return Math.max(0,Math.min(1,e||0))}function kb(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const hC=Math.PI/180,pC=180/Math.PI,W0=18,gC=.96422,mC=1,yC=.82521,bC=4/29,$l=6/29,vC=3*$l*$l,GY=$l*$l*$l;function _C(e){if(e instanceof Jr)return new Jr(e.l,e.a,e.b,e.opacity);if(e instanceof Ps)return xC(e);e instanceof Qt||(e=wb(e));var t=$b(e.r),n=$b(e.g),i=$b(e.b),r=Eb((.2225045*t+.7168786*n+.0606169*i)/mC),s,o;return t===n&&n===i?s=o=r:(s=Eb((.4360747*t+.3850649*n+.1430804*i)/gC),o=Eb((.0139322*t+.0971045*n+.7141733*i)/yC)),new Jr(116*r-16,500*(s-r),200*(r-o),e.opacity)}function H0(e,t,n,i){return arguments.length===1?_C(e):new Jr(e,t,n,i??1)}function Jr(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}El(Jr,H0,xf(Lo,{brighter(e){return new Jr(this.l+W0*(e??1),this.a,this.b,this.opacity)},darker(e){return new Jr(this.l-W0*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=gC*Cb(t),e=mC*Cb(e),n=yC*Cb(n),new Qt(Ab(3.1338561*t-1.6168667*e-.4906146*n),Ab(-.9787684*t+1.9161415*e+.033454*n),Ab(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function Eb(e){return e>GY?Math.pow(e,1/3):e/vC+bC}function Cb(e){return e>$l?e*e*e:vC*(e-bC)}function Ab(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function $b(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function VY(e){if(e instanceof Ps)return new Ps(e.h,e.c,e.l,e.opacity);if(e instanceof Jr||(e=_C(e)),e.a===0&&e.b===0)return new Ps(NaN,0=1?(n=1,t-1):Math.floor(n*t),r=e[i],s=e[i+1],o=i>0?e[i-1]:2*r-s,a=i()=>e;function FC(e,t){return function(n){return e+n*t}}function XY(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function X0(e,t){var n=t-e;return n?FC(e,n>180||n<-180?n-360*Math.round(n/360):n):Y0(isNaN(e)?t:e)}function ZY(e){return(e=+e)==1?en:function(t,n){return n-t?XY(t,n,e):Y0(isNaN(t)?n:t)}}function en(e,t){var n=t-e;return n?FC(e,n):Y0(isNaN(e)?t:e)}const Tb=function e(t){var n=ZY(t);function i(r,s){var o=n((r=Io(r)).r,(s=Io(s)).r),a=n(r.g,s.g),u=n(r.b,s.b),l=en(r.opacity,s.opacity);return function(c){return r.r=o(c),r.g=a(c),r.b=u(c),r.opacity=l(c),r+""}}return i.gamma=e,i}(1);function DC(e){return function(t){var n=t.length,i=new Array(n),r=new Array(n),s=new Array(n),o,a;for(o=0;on&&(s=t.slice(n,s),a[o]?a[o]+=s:a[++o]=s),(i=i[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,u.push({i:o,x:pr(i,r)})),n=Rb.lastIndex;return n180?c+=360:c-l>180&&(l+=360),d.push({i:f.push(r(f)+"rotate(",null,i)-2,x:pr(l,c)})):c&&f.push(r(f)+"rotate("+c+i)}function a(l,c,f,d){l!==c?d.push({i:f.push(r(f)+"skewX(",null,i)-2,x:pr(l,c)}):c&&f.push(r(f)+"skewX("+c+i)}function u(l,c,f,d,h,p){if(l!==f||c!==d){var g=h.push(r(h)+"scale(",null,",",null,")");p.push({i:g-4,x:pr(l,f)},{i:g-2,x:pr(c,d)})}else(f!==1||d!==1)&&h.push(r(h)+"scale("+f+","+d+")")}return function(l,c){var f=[],d=[];return l=e(l),c=e(c),s(l.translateX,l.translateY,c.translateX,c.translateY,f,d),o(l.rotate,c.rotate,f,d),a(l.skewX,c.skewX,f,d),u(l.scaleX,l.scaleY,c.scaleX,c.scaleY,f,d),l=c=null,function(h){for(var p=-1,g=d.length,m;++pt&&(n=e,e=t,t=n),function(i){return Math.max(e,Math.min(t,i))}}function kX(e,t,n){var i=e[0],r=e[1],s=t[0],o=t[1];return r2?EX:kX,u=l=null,f}function f(d){return d==null||isNaN(d=+d)?s:(u||(u=a(e.map(i),t,n)))(i(o(d)))}return f.invert=function(d){return o(r((l||(l=a(t,e.map(i),pr)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,Ib),c()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=Cf,c()},f.clamp=function(d){return arguments.length?(o=d?!0:li,c()):o!==li},f.interpolate=function(d){return arguments.length?(n=d,c()):n},f.unknown=function(d){return arguments.length?(s=d,f):s},function(d,h){return i=d,r=h,c()}}function WC(){return K0()(li,li)}function HC(e,t,n,i){var r=Ao(e,t,n),s;switch(i=Fa(i??",f"),i.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return i.precision==null&&!isNaN(s=C8(r,o))&&(i.precision=s),q2(i,o)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(s=A8(r,Math.max(Math.abs(e),Math.abs(t))))&&(i.precision=s-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(s=E8(r))&&(i.precision=s-(i.type==="%")*2);break}}return i0(i)}function ja(e){var t=e.domain;return e.ticks=function(n){var i=t();return P2(i[0],i[i.length-1],n??10)},e.tickFormat=function(n,i){var r=t();return HC(r[0],r[r.length-1],n??10,i)},e.nice=function(n){n==null&&(n=10);var i=t(),r=0,s=i.length-1,o=i[r],a=i[s],u,l,c=10;for(a0;){if(l=z2(o,a,n),l===u)return i[r]=o,i[s]=a,t(i);if(l>0)o=Math.floor(o/l)*l,a=Math.ceil(a/l)*l;else if(l<0)o=Math.ceil(o*l)/l,a=Math.floor(a*l)/l;else break;u=l}return e},e}function GC(){var e=WC();return e.copy=function(){return Af(e,GC())},Zr.apply(e,arguments),ja(e)}function VC(e){var t;function n(i){return i==null||isNaN(i=+i)?t:i}return n.invert=n,n.domain=n.range=function(i){return arguments.length?(e=Array.from(i,Ib),n):e.slice()},n.unknown=function(i){return arguments.length?(t=i,n):t},n.copy=function(){return VC(e).unknown(t)},e=arguments.length?Array.from(e,Ib):[0,1],ja(n)}function YC(e,t){e=e.slice();var n=0,i=e.length-1,r=e[n],s=e[i],o;return sMath.pow(e,t)}function FX(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function KC(e){return(t,n)=>-e(-t,n)}function zb(e){const t=e(XC,ZC),n=t.domain;let i=10,r,s;function o(){return r=FX(i),s=SX(i),n()[0]<0?(r=KC(r),s=KC(s),e(CX,AX)):e(XC,ZC),t}return t.base=function(a){return arguments.length?(i=+a,o()):i},t.domain=function(a){return arguments.length?(n(a),o()):n()},t.ticks=a=>{const u=n();let l=u[0],c=u[u.length-1];const f=c0){for(;d<=h;++d)for(p=1;pc)break;y.push(g)}}else for(;d<=h;++d)for(p=i-1;p>=1;--p)if(g=d>0?p/s(-d):p*s(d),!(gc)break;y.push(g)}y.length*2{if(a==null&&(a=10),u==null&&(u=i===10?"s":","),typeof u!="function"&&(!(i%1)&&(u=Fa(u)).precision==null&&(u.trim=!0),u=i0(u)),a===1/0)return u;const l=Math.max(1,i*a/t.ticks().length);return c=>{let f=c/s(Math.round(r(c)));return f*in(YC(n(),{floor:a=>s(Math.floor(r(a))),ceil:a=>s(Math.ceil(r(a)))})),t}function JC(){const e=zb(K0()).domain([1,10]);return e.copy=()=>Af(e,JC()).base(e.base()),Zr.apply(e,arguments),e}function QC(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function e9(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Bb(e){var t=1,n=e(QC(t),e9(t));return n.constant=function(i){return arguments.length?e(QC(t=+i),e9(t)):t},ja(n)}function t9(){var e=Bb(K0());return e.copy=function(){return Af(e,t9()).constant(e.constant())},Zr.apply(e,arguments)}function n9(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function DX(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function TX(e){return e<0?-e*e:e*e}function jb(e){var t=e(li,li),n=1;function i(){return n===1?e(li,li):n===.5?e(DX,TX):e(n9(n),n9(1/n))}return t.exponent=function(r){return arguments.length?(n=+r,i()):n},ja(t)}function Ub(){var e=jb(K0());return e.copy=function(){return Af(e,Ub()).exponent(e.exponent())},Zr.apply(e,arguments),e}function MX(){return Ub.apply(null,arguments).exponent(.5)}function i9(){var e=[],t=[],n=[],i;function r(){var o=0,a=Math.max(1,t.length);for(n=new Array(a-1);++o0?n[a-1]:e[0],a=n?[i[n-1],t]:[i[l-1],i[l]]},o.unknown=function(u){return arguments.length&&(s=u),o},o.thresholds=function(){return i.slice()},o.copy=function(){return r9().domain([e,t]).range(r).unknown(s)},Zr.apply(ja(o),arguments)}function s9(){var e=[.5],t=[0,1],n,i=1;function r(s){return s!=null&&s<=s?t[Co(e,s,0,i)]:n}return r.domain=function(s){return arguments.length?(e=Array.from(s),i=Math.min(e.length,t.length-1),r):e.slice()},r.range=function(s){return arguments.length?(t=Array.from(s),i=Math.min(e.length,t.length-1),r):t.slice()},r.invertExtent=function(s){var o=t.indexOf(s);return[e[o-1],e[o]]},r.unknown=function(s){return arguments.length?(n=s,r):n},r.copy=function(){return s9().domain(e).range(t).unknown(n)},Zr.apply(r,arguments)}function NX(e){return new Date(e)}function RX(e){return e instanceof Date?+e:+new Date(+e)}function qb(e,t,n,i,r,s,o,a,u,l){var c=WC(),f=c.invert,d=c.domain,h=l(".%L"),p=l(":%S"),g=l("%I:%M"),m=l("%I %p"),y=l("%a %d"),b=l("%b %d"),v=l("%B"),_=l("%Y");function x(k){return(u(k)0?i:1:0}const XX="identity",Sl="linear",zs="log",$f="pow",Sf="sqrt",ep="symlog",Ua="time",qa="utc",es="sequential",Fl="diverging",Dl="quantile",tp="quantize",np="threshold",Yb="ordinal",Xb="point",f9="band",Zb="bin-ordinal",Vt="continuous",Ff="discrete",Df="discretizing",Hi="interpolating",Kb="temporal";function ZX(e){return function(t){let n=t[0],i=t[1],r;return i=i&&n[u]<=r&&(s<0&&(s=u),o=u);if(!(s<0))return i=e.invertExtent(n[s]),r=e.invertExtent(n[o]),[i[0]===void 0?i[1]:i[0],r[1]===void 0?r[0]:r[1]]}}function Jb(){const e=xb().unknown(void 0),t=e.domain,n=e.range;let i=[0,1],r,s,o=!1,a=0,u=0,l=.5;delete e.unknown;function c(){const f=t().length,d=i[1]g+r*y);return n(d?m.reverse():m)}return e.domain=function(f){return arguments.length?(t(f),c()):t()},e.range=function(f){return arguments.length?(i=[+f[0],+f[1]],c()):i.slice()},e.rangeRound=function(f){return i=[+f[0],+f[1]],o=!0,c()},e.bandwidth=function(){return s},e.step=function(){return r},e.round=function(f){return arguments.length?(o=!!f,c()):o},e.padding=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),a=u,c()):a},e.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),c()):a},e.paddingOuter=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),c()):u},e.align=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),c()):l},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=i[1]i[1-d])))return y=Math.max(0,Co(h,g)-1),b=g===m?y:Co(h,m)-1,g-h[y]>s+1e-10&&++y,d&&(v=y,y=p-b,b=p-v),y>b?void 0:t().slice(y,b+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return Jb().domain(t()).range(i).round(o).paddingInner(a).paddingOuter(u).align(l)},c()}function d9(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return d9(t())},e}function JX(){return d9(Jb().paddingInner(1))}var QX=Array.prototype.map;function eZ(e){return QX.call(e,An)}const tZ=Array.prototype.slice;function h9(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(Co(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=eZ(i),n):e.slice()},n.range=function(i){return arguments.length?(t=tZ.call(i),n):t.slice()},n.tickFormat=function(i,r){return HC(e[0],Ye(e),i??10,r)},n.copy=function(){return h9().domain(n.domain()).range(n.range())},n}const ip=new Map,p9=Symbol("vega_scale");function g9(e){return e[p9]=!0,e}function m9(e){return e&&e[p9]===!0}function nZ(e,t,n){const i=function(){const s=t();return s.invertRange||(s.invertRange=s.invert?ZX(s):s.invertExtent?KX(s):void 0),s.type=e,g9(s)};return i.metadata=fr(se(n)),i}function et(e,t,n){return arguments.length>1?(ip.set(e,nZ(e,t,n)),this):y9(e)?ip.get(e):void 0}et(XX,VC),et(Sl,GC,Vt),et(zs,JC,[Vt,zs]),et($f,Ub,Vt),et(Sf,MX,Vt),et(ep,t9,Vt),et(Ua,OX,[Vt,Kb]),et(qa,LX,[Vt,Kb]),et(es,Wb,[Vt,Hi]),et(`${es}-${Sl}`,Wb,[Vt,Hi]),et(`${es}-${zs}`,o9,[Vt,Hi,zs]),et(`${es}-${$f}`,Hb,[Vt,Hi]),et(`${es}-${Sf}`,IX,[Vt,Hi]),et(`${es}-${ep}`,a9,[Vt,Hi]),et(`${Fl}-${Sl}`,u9,[Vt,Hi]),et(`${Fl}-${zs}`,l9,[Vt,Hi,zs]),et(`${Fl}-${$f}`,Gb,[Vt,Hi]),et(`${Fl}-${Sf}`,PX,[Vt,Hi]),et(`${Fl}-${ep}`,c9,[Vt,Hi]),et(Dl,i9,[Df,Dl]),et(tp,r9,Df),et(np,s9,Df),et(Zb,h9,[Ff,Df]),et(Yb,xb,Ff),et(f9,Jb,Ff),et(Xb,JX,Ff);function y9(e){return ip.has(e)}function Wa(e,t){const n=ip.get(e);return n&&n.metadata[t]}function Qb(e){return Wa(e,Vt)}function Tl(e){return Wa(e,Ff)}function e3(e){return Wa(e,Df)}function b9(e){return Wa(e,zs)}function iZ(e){return Wa(e,Kb)}function v9(e){return Wa(e,Hi)}function _9(e){return Wa(e,Dl)}const rZ=["clamp","base","constant","exponent"];function x9(e,t){const n=t[0],i=Ye(t)-n;return function(r){return e(n+r*i)}}function rp(e,t,n){return Lb(t3(t||"rgb",n),e)}function w9(e,t){const n=new Array(t),i=t+1;for(let r=0;re[a]?o[a](e[a]()):0),o)}function t3(e,t){const n=_X[sZ(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function sZ(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const oZ={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},aZ={accent:BX,category10:zX,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:jX,observable10:UX,paired:qX,pastel1:WX,pastel2:HX,set1:GX,set2:VX,set3:YX,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function E9(e){if(G(e))return e;const t=e.length/6|0,n=new Array(t);for(let i=0;irp(E9(e)));function n3(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(A9[e]=t,this):A9[e]}const sp="symbol",uZ="discrete",lZ="gradient",cZ=e=>G(e)?e.map(t=>String(t)):String(e),fZ=(e,t)=>e[1]-t[1],dZ=(e,t)=>t[1]-e[1];function i3(e,t,n){let i;return Je(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(Xc(e.domain())/n||1)+1))),ie(t)&&(i=t.step,t=t.interval),re(t)&&(t=e.type===Ua?ml(t):e.type==qa?yl(t):W("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function $9(e,t,n){let i=e.range(),r=i[0],s=Ye(i),o=fZ;if(r>s&&(i=s,s=r,r=i,o=dZ),r=Math.floor(r),s=Math.ceil(s),t=t.map(a=>[a,e(a)]).filter(a=>r<=a[1]&&a[1]<=s).sort(o).map(a=>a[0]),n>0&&t.length>1){const a=[t[0],Ye(t)];for(;t.length>n&&t.length>=3;)t=t.filter((u,l)=>!(l%2));t.length<3&&(t=a)}return t}function r3(e,t){return e.bins?$9(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function S9(e,t,n,i,r,s){const o=t.type;let a=cZ;if(o===Ua||r===Ua)a=e.timeFormat(i);else if(o===qa||r===qa)a=e.utcFormat(i);else if(b9(o)){const u=e.formatFloat(i);if(s||t.bins)a=u;else{const l=F9(t,n,!1);a=c=>l(c)?u(c):""}}else if(t.tickFormat){const u=t.domain();a=e.formatSpan(u[0],u[u.length-1],n,i)}else i&&(a=e.format(i));return a}function F9(e,t,n){const i=r3(e,t),r=e.base(),s=Math.log(r),o=Math.max(1,r*t/i.length),a=u=>{let l=u/Math.pow(r,Math.round(Math.log(u)/s));return l*r1?i[1]-i[0]:i[0],o;for(o=1;os3[e.type]||e.bins;function M9(e,t,n,i,r,s,o){const a=D9[t.type]&&s!==Ua&&s!==qa?hZ(e,t,r):S9(e,t,n,r,s,o);return i===sp&&mZ(t)?yZ(a):i===uZ?bZ(a):vZ(a)}const yZ=e=>(t,n,i)=>{const r=N9(i[n+1],N9(i.max,1/0)),s=R9(t,e),o=R9(r,e);return s&&o?s+" – "+o:o?"< "+o:"≥ "+s},N9=(e,t)=>e??t,bZ=e=>(t,n)=>n?e(t):null,vZ=e=>t=>e(t),R9=(e,t)=>Number.isFinite(e)?t(e):null;function _Z(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+Ye(t),s=r-i;if(e.type===np){const o=n?s/n:.1;i-=o,r+=o,s=r-i}return o=>(o-i)/s}function xZ(e,t,n,i){const r=i||t.type;return re(n)&&iZ(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&r===Ua?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===qa?e.utcFormat("%A, %d %B %Y, %X UTC"):M9(e,t,5,null,n,i,!0)}function O9(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=xZ(e,t,n.format,n.formatType);if(e3(t.type)){const s=T9(t).slice(1).map(r),o=s.length;return`${o} boundar${o===1?"y":"ies"}: ${s.join(", ")}`}else if(Tl(t.type)){const s=t.domain(),o=s.length,a=o>i?s.slice(0,i-2).map(r).join(", ")+", ending with "+s.slice(-1).map(r):s.map(r).join(", ");return`${o} value${o===1?"":"s"}: ${a}`}else{const s=t.domain();return`values from ${r(s[0])} to ${r(Ye(s))}`}}let L9=0;function wZ(){L9=0}const op="p_";function o3(e){return e&&e.gradient}function I9(e,t,n){const i=e.gradient;let r=e.id,s=i==="radial"?op:"";return r||(r=e.id="gradient_"+L9++,i==="radial"?(e.x1=ts(e.x1,.5),e.y1=ts(e.y1,.5),e.r1=ts(e.r1,0),e.x2=ts(e.x2,.5),e.y2=ts(e.y2,.5),e.r2=ts(e.r2,.5),s=op):(e.x1=ts(e.x1,0),e.y1=ts(e.y1,0),e.x2=ts(e.x2,1),e.y2=ts(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+s+r+")"}function ts(e,t){return e??t}function P9(e,t){var n=[],i;return i={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(r,s){return n.push({offset:r,color:s}),i}}}const z9={basis:{curve:bY},"basis-closed":{curve:vY},"basis-open":{curve:_Y},bundle:{curve:xY,tension:"beta",value:.85},cardinal:{curve:wY,tension:"tension",value:0},"cardinal-open":{curve:EY,tension:"tension",value:0},"cardinal-closed":{curve:kY,tension:"tension",value:0},"catmull-rom":{curve:CY,tension:"alpha",value:.5},"catmull-rom-closed":{curve:AY,tension:"alpha",value:.5},"catmull-rom-open":{curve:$Y,tension:"alpha",value:.5},linear:{curve:pb},"linear-closed":{curve:SY},monotone:{horizontal:DY,vertical:FY},natural:{curve:TY},step:{curve:MY},"step-after":{curve:RY},"step-before":{curve:NY}};function a3(e,t,n){var i=ue(z9,e)&&z9[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const kZ={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},EZ=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,CZ=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,AZ=/^((\s+,?\s*)|(,\s*))/,$Z=/^[01]/;function Ml(e){const t=[];return(e.match(EZ)||[]).forEach(i=>{let r=i[0];const s=r.toLowerCase(),o=kZ[s],a=SZ(s,o,i.slice(1).trim()),u=a.length;if(u1&&(g=Math.sqrt(g),n*=g,i*=g);const m=d/n,y=f/n,b=-f/i,v=d/i,_=m*a+y*u,x=b*a+v*u,k=m*e+y*t,w=b*e+v*t;let C=1/((k-_)*(k-_)+(w-x)*(w-x))-.25;C<0&&(C=0);let F=Math.sqrt(C);s==r&&(F=-F);const S=.5*(_+k)-F*(w-x),z=.5*(x+w)+F*(k-_),P=Math.atan2(x-z,_-S);let A=Math.atan2(w-z,k-S)-P;A<0&&s===1?A+=ns:A>0&&s===0&&(A-=ns);const M=Math.ceil(Math.abs(A/(Ha+.001))),B=[];for(let V=0;V+e}function ap(e,t,n){return Math.max(t,Math.min(e,n))}function H9(){var e=RZ,t=OZ,n=LZ,i=IZ,r=Bs(0),s=r,o=r,a=r,u=null;function l(c,f,d){var h,p=f??+e.call(this,c),g=d??+t.call(this,c),m=+n.call(this,c),y=+i.call(this,c),b=Math.min(m,y)/2,v=ap(+r.call(this,c),0,b),_=ap(+s.call(this,c),0,b),x=ap(+o.call(this,c),0,b),k=ap(+a.call(this,c),0,b);if(u||(u=h=M0()),v<=0&&_<=0&&x<=0&&k<=0)u.rect(p,g,m,y);else{var w=p+m,E=g+y;u.moveTo(p+v,g),u.lineTo(w-_,g),u.bezierCurveTo(w-jo*_,g,w,g+jo*_,w,g+_),u.lineTo(w,E-k),u.bezierCurveTo(w,E-jo*k,w-jo*k,E,w-k,E),u.lineTo(p+x,E),u.bezierCurveTo(p+jo*x,E,p,E-jo*x,p,E-x),u.lineTo(p,g+v),u.bezierCurveTo(p,g+jo*v,p+jo*v,g,p+v,g),u.closePath()}if(h)return u=null,h+""||null}return l.x=function(c){return arguments.length?(e=Bs(c),l):e},l.y=function(c){return arguments.length?(t=Bs(c),l):t},l.width=function(c){return arguments.length?(n=Bs(c),l):n},l.height=function(c){return arguments.length?(i=Bs(c),l):i},l.cornerRadius=function(c,f,d,h){return arguments.length?(r=Bs(c),s=f!=null?Bs(f):r,a=d!=null?Bs(d):r,o=h!=null?Bs(h):s,l):r},l.context=function(c){return arguments.length?(u=c??null,l):u},l}function G9(){var e,t,n,i,r=null,s,o,a,u;function l(f,d,h){const p=h/2;if(s){var g=a-d,m=f-o;if(g||m){var y=Math.hypot(g,m),b=(g/=y)*u,v=(m/=y)*u,_=Math.atan2(m,g);r.moveTo(o-b,a-v),r.lineTo(f-g*p,d-m*p),r.arc(f,d,p,_-Math.PI,_),r.lineTo(o+b,a+v),r.arc(o,a,u,_,_+Math.PI)}else r.arc(f,d,p,0,ns);r.closePath()}else s=1;o=f,a=d,u=p}function c(f){var d,h=f.length,p,g=!1,m;for(r==null&&(r=m=M0()),d=0;d<=h;++d)!(de.x||0,Rf=e=>e.y||0,PZ=e=>e.width||0,zZ=e=>e.height||0,BZ=e=>(e.x||0)+(e.width||0),jZ=e=>(e.y||0)+(e.height||0),UZ=e=>e.startAngle||0,qZ=e=>e.endAngle||0,WZ=e=>e.padAngle||0,HZ=e=>e.innerRadius||0,GZ=e=>e.outerRadius||0,VZ=e=>e.cornerRadius||0,YZ=e=>Mf(e.cornerRadiusTopLeft,e.cornerRadius)||0,XZ=e=>Mf(e.cornerRadiusTopRight,e.cornerRadius)||0,ZZ=e=>Mf(e.cornerRadiusBottomRight,e.cornerRadius)||0,KZ=e=>Mf(e.cornerRadiusBottomLeft,e.cornerRadius)||0,JZ=e=>Mf(e.size,64),QZ=e=>e.size||1,up=e=>e.defined!==!1,eK=e=>W9(e.shape||"circle"),tK=gY().startAngle(UZ).endAngle(qZ).padAngle(WZ).innerRadius(HZ).outerRadius(GZ).cornerRadius(VZ),nK=qE().x(Nf).y1(Rf).y0(jZ).defined(up),iK=qE().y(Rf).x1(Nf).x0(BZ).defined(up),rK=UE().x(Nf).y(Rf).defined(up),sK=H9().x(Nf).y(Rf).width(PZ).height(zZ).cornerRadius(YZ,XZ,ZZ,KZ),oK=yY().type(eK).size(JZ),aK=G9().x(Nf).y(Rf).defined(up).size(QZ);function f3(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function uK(e,t){return tK.context(e)(t)}function lK(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?iK:nK).curve(a3(i,n.orient,n.tension)).context(e)(t)}function cK(e,t){const n=t[0],i=n.interpolate||"linear";return rK.curve(a3(i,n.orient,n.tension)).context(e)(t)}function Rl(e,t,n,i){return sK.context(e)(t,n,i)}function fK(e,t){return(t.mark.shape||t.shape).context(e)(t)}function dK(e,t){return oK.context(e)(t)}function hK(e,t){return aK.context(e)(t)}var V9=1;function Y9(){V9=1}function d3(e,t,n){var i=t.clip,r=e._defs,s=t.clip_id||(t.clip_id="clip"+V9++),o=r.clipping[s]||(r.clipping[s]={id:s});return ze(i)?o.path=i(null):f3(n)?o.path=Rl(null,n,0,0):(o.width=n.width||0,o.height=n.height||0),"url(#"+s+")"}function qt(e){this.clear(),e&&this.union(e)}qt.prototype={clone(){return new qt(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,i){return nthis.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const i=this.rotatedPoints(e,t,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(e,t,n){var{x1:i,y1:r,x2:s,y2:o}=this,a=Math.cos(e),u=Math.sin(e),l=t-t*a+n*u,c=n-t*u-n*a;return[a*i-u*r+l,u*i+a*r+c,a*i-u*o+l,u*i+a*o+c,a*s-u*r+l,u*s+a*r+c,a*s-u*o+l,u*s+a*o+c]},union(e){return e.x1this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function lp(e){this.mark=e,this.bounds=this.bounds||new qt}function cp(e){lp.call(this,e),this.items=this.items||[]}te(cp,lp);class X9{constructor(t){this._pending=0,this._loader=t||p0()}pending(){return this._pending}sanitizeURL(t){const n=this;return Z9(n),n._loader.sanitize(t,{context:"href"}).then(i=>(Of(n),i)).catch(()=>(Of(n),null))}loadImage(t){const n=this,i=OY();return Z9(n),n._loader.sanitize(t,{context:"image"}).then(r=>{const s=r.href;if(!s||!i)throw{url:s};const o=new i,a=ue(r,"crossOrigin")?r.crossOrigin:"anonymous";return a!=null&&(o.crossOrigin=a),o.onload=()=>Of(n),o.onerror=()=>Of(n),o.src=s,o}).catch(r=>(Of(n),{complete:!1,width:0,height:0,src:r&&r.url||""}))}ready(){const t=this;return new Promise(n=>{function i(r){t.pending()?setTimeout(()=>{i(!0)},10):n(r)}i(!1)})}}function Z9(e){e._pending+=1}function Of(e){e._pending-=1}function js(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?pK(t,i):0))}return e}function pK(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const gK=ns-1e-8;let fp,dp,hp,Ga,h3,pp,p3,g3;const Uo=(e,t)=>fp.add(e,t),gp=(e,t)=>Uo(dp=e,hp=t),K9=e=>Uo(e,fp.y1),J9=e=>Uo(fp.x1,e),Va=(e,t)=>h3*e+p3*t,Ya=(e,t)=>pp*e+g3*t,m3=(e,t)=>Uo(Va(e,t),Ya(e,t)),y3=(e,t)=>gp(Va(e,t),Ya(e,t));function Lf(e,t){return fp=e,t?(Ga=t*Bo,h3=g3=Math.cos(Ga),pp=Math.sin(Ga),p3=-pp):(h3=g3=1,Ga=pp=p3=0),mK}const mK={beginPath(){},closePath(){},moveTo:y3,lineTo:y3,rect(e,t,n,i){Ga?(m3(e+n,t),m3(e+n,t+i),m3(e,t+i),y3(e,t)):(Uo(e+n,t+i),gp(e,t))},quadraticCurveTo(e,t,n,i){const r=Va(e,t),s=Ya(e,t),o=Va(n,i),a=Ya(n,i);Q9(dp,r,o,K9),Q9(hp,s,a,J9),gp(o,a)},bezierCurveTo(e,t,n,i,r,s){const o=Va(e,t),a=Ya(e,t),u=Va(n,i),l=Ya(n,i),c=Va(r,s),f=Ya(r,s);eA(dp,o,u,c,K9),eA(hp,a,l,f,J9),gp(c,f)},arc(e,t,n,i,r,s){if(i+=Ga,r+=Ga,dp=n*Math.cos(r)+e,hp=n*Math.sin(r)+t,Math.abs(r-i)>gK)Uo(e-n,t-n),Uo(e+n,t+n);else{const o=l=>Uo(n*Math.cos(l)+e,n*Math.sin(l)+t);let a,u;if(o(i),o(r),r!==i)if(i=i%ns,i<0&&(i+=ns),r=r%ns,r<0&&(r+=ns),rr;++u,a-=Ha)o(a);else for(a=i-i%Ha+Ha,u=0;u<4&&aFZ?(c=o*o+a*s,c>=0&&(c=Math.sqrt(c),u=(-o+c)/s,l=(-o-c)/s)):u=.5*a/o,0d)return!1;g>f&&(f=g)}else if(h>0){if(g0?(e.globalAlpha=n,e.fillStyle=sA(e,t,t.fill),!0):!1}var bK=[];function Il(e,t,n){var i=(i=t.strokeWidth)!=null?i:1;return i<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=sA(e,t,t.stroke),e.lineWidth=i,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||bK),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function vK(e,t){return e.zindex-t.zindex||e.index-t.index}function x3(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],i,r,s;for(r=0,s=t.length;r=0;)if(i=t(n[r]))return i;if(n===s){for(n=e.items,r=n.length;--r>=0;)if(!n[r].zindex&&(i=t(n[r])))return i}return null}function w3(e){return function(t,n,i){mr(n,r=>{(!i||i.intersects(r.bounds))&&oA(e,t,r,r)})}}function _K(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&oA(e,t,n.items[0],n.items)}}function oA(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||(Ll(t,n),n.fill&&mp(t,n,r)&&t.fill(),n.stroke&&Il(t,n,r)&&t.stroke()))}function bp(e){return e=e||ji,function(t,n,i,r,s,o){return i*=t.pixelRatio,r*=t.pixelRatio,yp(n,a=>{const u=a.bounds;if(!(u&&!u.contains(s,o)||!u)&&e(t,a,i,r,s,o))return a})}}function If(e,t){return function(n,i,r,s){var o=Array.isArray(i)?i[0]:i,a=t??o.fill,u=o.stroke&&n.isPointInStroke,l,c;return u&&(l=o.strokeWidth,c=o.strokeCap,n.lineWidth=l??1,n.lineCap=c??"butt"),e(n,i)?!1:a&&n.isPointInPath(r,s)||u&&n.isPointInStroke(r,s)}}function k3(e){return bp(If(e))}function Xa(e,t){return"translate("+e+","+t+")"}function E3(e){return"rotate("+e+")"}function xK(e,t){return"scale("+e+","+t+")"}function aA(e){return Xa(e.x||0,e.y||0)}function wK(e){return Xa(e.x||0,e.y||0)+(e.angle?" "+E3(e.angle):"")}function kK(e){return Xa(e.x||0,e.y||0)+(e.angle?" "+E3(e.angle):"")+(e.scaleX||e.scaleY?" "+xK(e.scaleX||1,e.scaleY||1):"")}function C3(e,t,n){function i(o,a){o("transform",wK(a)),o("d",t(null,a))}function r(o,a){return t(Lf(o,a.angle),a),js(o,a).translate(a.x||0,a.y||0)}function s(o,a){var u=a.x||0,l=a.y||0,c=a.angle||0;o.translate(u,l),c&&o.rotate(c*=Bo),o.beginPath(),t(o,a),c&&o.rotate(-c),o.translate(-u,-l)}return{type:e,tag:"path",nested:!1,attr:i,bound:r,draw:w3(s),pick:k3(s),isect:n||v3(s)}}var EK=C3("arc",uK);function CK(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],i=e[0].orient==="horizontal"?"y":"x",r=e.length,s=1/0,o,a;--r>=0;)e[r].defined!==!1&&(a=Math.abs(e[r][i]-n),a=0;)if(e[i].defined!==!1&&(r=e[i].x-t[0],s=e[i].y-t[1],o=r*r+s*s,o=0;)if(e[n].defined!==!1&&(i=e[n].x-t[0],r=e[n].y-t[1],s=i*i+r*r,i=e[n].size||1,s.5&&t<1.5?.5-Math.abs(t-1):0}function DK(e,t){e("transform",aA(t))}function cA(e,t){const n=lA(t);e("d",Rl(null,t,n,n))}function TK(e,t){e("class","background"),e("aria-hidden",!0),cA(e,t)}function MK(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?cA(e,t):e("d","")}function NK(e,t,n){const i=t.clip?d3(n,t,t):null;e("clip-path",i)}function RK(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let r=0;r{const s=r.x||0,o=r.y||0,a=r.strokeForeground,u=r.opacity==null?1:r.opacity;(r.stroke||r.fill)&&u&&(Pf(e,r,s,o),Ll(e,r),r.fill&&mp(e,r,u)&&e.fill(),r.stroke&&!a&&Il(e,r,u)&&e.stroke()),e.save(),e.translate(s,o),r.clip&&uA(e,r),n&&n.translate(-s,-o),mr(r,l=>{(l.marktype==="group"||i==null||i.includes(l.marktype))&&this.draw(e,l,n,i)}),n&&n.translate(s,o),e.restore(),a&&r.stroke&&u&&(Pf(e,r,s,o),Ll(e,r),Il(e,r,u)&&e.stroke())})}function zK(e,t,n,i,r,s){if(t.bounds&&!t.bounds.contains(r,s)||!t.items)return null;const o=n*e.pixelRatio,a=i*e.pixelRatio;return yp(t,u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(r,s))return;c=u.x||0,f=u.y||0;const h=c+(u.width||0),p=f+(u.height||0),g=u.clip;if(g&&(rh||sp))return;if(e.save(),e.translate(c,f),c=r-c,f=s-f,g&&f3(u)&&!IK(e,u,o,a))return e.restore(),null;const m=u.strokeForeground,y=t.interactive!==!1;return y&&m&&u.stroke&&LK(e,u,o,a)?(e.restore(),u):(l=yp(u,b=>BK(b,c,f)?this.pick(b,n,i,c,f):null),!l&&y&&(u.fill||!m&&u.stroke)&&OK(e,u,o,a)&&(l=u),e.restore(),l||null)})}function BK(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var jK={type:"group",tag:"g",nested:!1,attr:DK,bound:RK,draw:PK,pick:zK,isect:nA,content:NK,background:TK,foreground:MK},zf={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function $3(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(i=>{e.image=i,e.image.url=e.url})),n}function S3(e,t){return e.width!=null?e.width:!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width}function F3(e,t){return e.height!=null?e.height:!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height}function vp(e,t){return e==="center"?t/2:e==="right"?t:0}function _p(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function UK(e,t,n){const i=$3(t,n),r=S3(t,i),s=F3(t,i),o=(t.x||0)-vp(t.align,r),a=(t.y||0)-_p(t.baseline,s),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",u,zf["xmlns:xlink"],"xlink:href"),e("transform",Xa(o,a)),e("width",r),e("height",s),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function qK(e,t){const n=t.image,i=S3(t,n),r=F3(t,n),s=(t.x||0)-vp(t.align,i),o=(t.y||0)-_p(t.baseline,r);return e.set(s,o,s+i,o+r)}function WK(e,t,n){mr(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=$3(i,this);let s=S3(i,r),o=F3(i,r);if(s===0||o===0)return;let a=(i.x||0)-vp(i.align,s),u=(i.y||0)-_p(i.baseline,o),l,c,f,d;i.aspect!==!1&&(c=r.width/r.height,f=i.width/i.height,c===c&&f===f&&c!==f&&(f{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&dA(e,i,r)&&(Ll(e,i),e.stroke())}})}function nJ(e,t,n,i){return e.isPointInStroke?dA(e,t,1)&&e.isPointInStroke(n,i):!1}var iJ={type:"rule",tag:"line",nested:!1,attr:QK,bound:eJ,draw:tJ,pick:bp(nJ),isect:iA},rJ=C3("shape",fK),sJ=C3("symbol",dK,_3);const hA=Z4();var Si={height:is,measureWidth:D3,estimateWidth:wp,width:wp,canvas:pA};pA(!0);function pA(e){Si.width=e&&qo?D3:wp}function wp(e,t){return gA(Ho(e,t),is(e))}function gA(e,t){return~~(.8*e.length*t)}function D3(e,t){return is(e)<=0||!(t=Ho(e,t))?0:mA(t,kp(e))}function mA(e,t){const n=`(${t}) ${e}`;let i=hA.get(n);return i===void 0&&(qo.font=t,i=qo.measureText(e).width,hA.set(n,i)),i}function is(e){return e.fontSize!=null?+e.fontSize||0:11}function Wo(e){return e.lineHeight!=null?e.lineHeight:is(e)+2}function oJ(e){return G(e)?e.length>1?e:e[0]:e}function Bf(e){return oJ(e.lineBreak&&e.text&&!G(e.text)?e.text.split(e.lineBreak):e.text)}function T3(e){const t=Bf(e);return(G(t)?t.length-1:0)*Wo(e)}function Ho(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?uJ(e,n):n}function aJ(e){if(Si.width===D3){const t=kp(e);return n=>mA(n,t)}else if(Si.width===wp){const t=is(e);return n=>gA(n,t)}else return t=>Si.width(e,t)}function uJ(e,t){var n=+e.limit,i=aJ(e);if(i(t)>>1,i(t.slice(u))>n?o=u+1:a=u;return r+t.slice(o)}else{for(;o>>1),i(t.slice(0,u))Math.max(d,Si.width(t,h)),0)):f=Si.width(t,c),r==="center"?u-=f/2:r==="right"&&(u-=f),e.set(u+=o,l+=a,u+f,l+i),t.angle&&!n)e.rotate(t.angle*Bo,o,a);else if(n===2)return e.rotatedPoints(t.angle*Bo,o,a);return e}function fJ(e,t,n){mr(t,i=>{var r=i.opacity==null?1:i.opacity,s,o,a,u,l,c,f;if(!(n&&!n.intersects(i.bounds)||r===0||i.fontSize<=0||i.text==null||i.text.length===0)){if(e.font=kp(i),e.textAlign=i.align||"left",s=Ep(i),o=s.x1,a=s.y1,i.angle&&(e.save(),e.translate(o,a),e.rotate(i.angle*Bo),o=a=0),o+=i.dx||0,a+=(i.dy||0)+M3(i),c=Bf(i),Ll(e,i),G(c))for(l=Wo(i),u=0;ut;)e.removeChild(n[--i]);return e}function EA(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function Cp(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function yJ(e,t,n,i){var r=e&&e.mark,s,o;if(r&&(s=Fi[r.marktype]).tip){for(o=Cp(t,n),o[0]-=i[0],o[1]-=i[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=s.tip(r.items,o)}return e}let L3=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||p0(),this._tooltip=n||bJ}initialize(t,n,i){return this._el=t,this._obj=i||null,this.origin(n)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()}scene(t){return arguments.length?(this._scene=t,this):this._scene}on(){}off(){}_handlerIndex(t,n,i){for(let r=t?t.length:0;--r>=0;)if(t[r].type===n&&(!i||t[r].handler===i))return r;return-1}handlers(t){const n=this._handlers,i=[];if(t)i.push(...n[this.eventName(t)]);else for(const r in n)i.push(...n[r]);return i}eventName(t){const n=t.indexOf(".");return n<0?t:t.slice(0,n)}handleHref(t,n,i){this._loader.sanitize(i,{context:"href"}).then(r=>{const s=new MouseEvent(t.type,t),o=Go(null,"a");for(const a in r)o.setAttribute(a,r[a]);o.dispatchEvent(s)}).catch(()=>{})}handleTooltip(t,n,i){if(n&&n.tooltip!=null){n=yJ(n,t,this.canvas(),this._origin);const r=i&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,t,n,r)}}getItemBoundingClientRect(t){const n=this.canvas();if(!n)return;const i=n.getBoundingClientRect(),r=this._origin,s=t.bounds,o=s.width(),a=s.height();let u=s.x1+r[0]+i.left,l=s.y1+r[1]+i.top;for(;t.mark&&(t=t.mark.group);)u+=t.x||0,l+=t.y||0;return{x:u,y:l,width:o,height:a,left:u,top:l,right:u+o,bottom:l+a}}};function bJ(e,t,n,i){e.element().setAttribute("title",i||"")}class qf{constructor(t){this._el=null,this._bgcolor=null,this._loader=new X9(t)}initialize(t,n,i,r,s){return this._el=t,this.resize(n,i,r,s)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(t){return arguments.length===0?this._bgcolor:(this._bgcolor=t,this)}resize(t,n,i,r){return this._width=t,this._height=n,this._origin=i||[0,0],this._scale=r||1,this}dirty(){}render(t,n){const i=this;return i._call=function(){i._render(t,n)},i._call(),i._call=null,i}_render(){}renderAsync(t,n){const i=this.render(t,n);return this._ready?this._ready.then(()=>i):Promise.resolve(i)}_load(t,n){var i=this,r=i._loader[t](n);if(!i._ready){const s=i._call;i._ready=i._loader.ready().then(o=>{o&&s(),i._ready=null})}return r}sanitizeURL(t){return this._load("sanitizeURL",t)}loadImage(t){return this._load("loadImage",t)}}const vJ="keydown",_J="keypress",xJ="keyup",CA="dragenter",Ap="dragleave",AA="dragover",I3="pointerdown",wJ="pointerup",$p="pointermove",Sp="pointerout",$A="pointerover",P3="mousedown",kJ="mouseup",SA="mousemove",Fp="mouseout",FA="mouseover",Dp="click",EJ="dblclick",CJ="wheel",DA="mousewheel",Tp="touchstart",Mp="touchmove",Np="touchend",AJ=[vJ,_J,xJ,CA,Ap,AA,I3,wJ,$p,Sp,$A,P3,kJ,SA,Fp,FA,Dp,EJ,CJ,DA,Tp,Mp,Np],z3=$p,Wf=Fp,B3=Dp;class Hf extends L3{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=AJ,this.pointermove=MA([$p,SA],[$A,FA],[Sp,Fp]),this.dragover=MA([AA],[CA],[Ap]),this.pointerout=NA([Sp,Fp]),this.dragleave=NA([Ap])}initialize(t,n,i){return this._canvas=t&&O3(t,"canvas"),[Dp,P3,I3,$p,Sp,Ap].forEach(r=>TA(this,r)),super.initialize(t,n,i)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(DA,t)}pointerdown(t){this._down=this._active,this.fire(I3,t)}mousedown(t){this._down=this._active,this.fire(P3,t)}click(t){this._down===this._active&&(this.fire(Dp,t),this._down=null)}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(Tp,t,!0)}touchmove(t){this.fire(Mp,t,!0)}touchend(t){this.fire(Np,t,!0),this._touch=null}fire(t,n,i){const r=i?this._touch:this._active,s=this._handlers[t];if(n.vegaType=t,t===B3&&r&&r.href?this.handleHref(n,r,r.href):(t===z3||t===Wf)&&this.handleTooltip(n,r,t!==Wf),s)for(let o=0,a=s.length;o=0&&r.splice(s,1),this}pickEvent(t){const n=Cp(t,this._canvas),i=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-i[0],n[1]-i[1])}pick(t,n,i,r,s){const o=this.context();return Fi[t.marktype].pick.call(this,o,t,n,i,r,s)}}const $J=e=>e===Tp||e===Mp||e===Np?[Tp,Mp,Np]:[e];function TA(e,t){$J(t).forEach(n=>SJ(e,n))}function SJ(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?i=>e[t](i):i=>e.fire(t,i)))}function Gf(e,t,n){t.forEach(i=>e.fire(i,n))}function MA(e,t,n){return function(i){const r=this._active,s=this.pickEvent(i);s===r?Gf(this,e,i):((!r||!r.exit)&&Gf(this,n,i),this._active=s,Gf(this,t,i),Gf(this,e,i))}}function NA(e){return function(t){Gf(this,e,t),this._active=null}}function FJ(){return typeof window<"u"&&window.devicePixelRatio||1}function DJ(e,t,n,i,r,s){const o=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),u=o?FJ():r;e.width=t*u,e.height=n*u;for(const l in s)a[l]=s[l];return o&&u!==1&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=u,a.setTransform(u,0,0,u,u*i[0],u*i[1]),e}class Rp extends qf{constructor(t){super(t),this._options={},this._redraw=!1,this._dirty=new qt,this._tempb=new qt}initialize(t,n,i,r,s,o){return this._options=o||{},this._canvas=this._options.externalContext?null:Ro(1,1,this._options.type),t&&this._canvas&&(Vi(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(t,n,i,r,s)}resize(t,n,i,r){if(super.resize(t,n,i,r),this._canvas)DJ(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const s=this._options.externalContext;s||W("CanvasRenderer is missing a valid canvas or context"),s.scale(this._scale,this._scale),s.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(t){const n=this._tempb.clear().union(t.bounds);let i=t.mark.group;for(;i;)n.translate(i.x||0,i.y||0),i=i.mark.group;this._dirty.union(n)}_render(t,n){const i=this.context(),r=this._origin,s=this._width,o=this._height,a=this._dirty,u=TJ(r,s,o);i.save();const l=this._redraw||a.empty()?(this._redraw=!1,u.expand(1)):MJ(i,u.intersect(a),r);return this.clear(-r[0],-r[1],s,o),this.draw(i,t,l,n),i.restore(),a.clear(),this}draw(t,n,i,r){if(n.marktype!=="group"&&r!=null&&!r.includes(n.marktype))return;const s=Fi[n.marktype];n.clip&&FK(t,n),s.draw.call(this,t,n,i,r),n.clip&&t.restore()}clear(t,n,i,r){const s=this._options,o=this.context();s.type!=="pdf"&&!s.externalContext&&o.clearRect(t,n,i,r),this._bgcolor!=null&&(o.fillStyle=this._bgcolor,o.fillRect(t,n,i,r))}}const TJ=(e,t,n)=>new qt().set(0,0,t,n).translate(-e[0],-e[1]);function MJ(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-(n[0]%1),-(n[1]%1)),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}class RA extends L3{constructor(t,n){super(t,n);const i=this;i._hrefHandler=j3(i,(r,s)=>{s&&s.href&&i.handleHref(r,s,s.href)}),i._tooltipHandler=j3(i,(r,s)=>{i.handleTooltip(r,s,r.type!==Wf)})}initialize(t,n,i){let r=this._svg;return r&&(r.removeEventListener(B3,this._hrefHandler),r.removeEventListener(z3,this._tooltipHandler),r.removeEventListener(Wf,this._tooltipHandler)),this._svg=r=t&&O3(t,"svg"),r&&(r.addEventListener(B3,this._hrefHandler),r.addEventListener(z3,this._tooltipHandler),r.addEventListener(Wf,this._tooltipHandler)),super.initialize(t,n,i)}canvas(){return this._svg}on(t,n){const i=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[i],t,n)<0){const o={type:t,handler:n,listener:j3(this,n)};(r[i]||(r[i]=[])).push(o),this._svg&&this._svg.addEventListener(i,o.listener)}return this}off(t,n){const i=this.eventName(t),r=this._handlers[i],s=this._handlerIndex(r,t,n);return s>=0&&(this._svg&&this._svg.removeEventListener(i,r[s].listener),r.splice(s,1)),this}}const j3=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,t.call(e._obj,n,i)},OA="aria-hidden",U3="aria-label",q3="role",W3="aria-roledescription",LA="graphics-object",H3="graphics-symbol",IA=(e,t,n)=>({[q3]:e,[W3]:t,[U3]:n||void 0}),NJ=fr(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),PA={axis:{desc:"axis",caption:LJ},legend:{desc:"legend",caption:IJ},"title-text":{desc:"title",caption:e=>`Title text '${UA(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${UA(e)}'`}},zA={ariaRole:q3,ariaRoleDescription:W3,description:U3};function BA(e,t){const n=t.aria===!1;if(e(OA,n||void 0),n||t.description==null)for(const i in zA)e(zA[i],void 0);else{const i=t.mark.marktype;e(U3,t.description),e(q3,t.ariaRole||(i==="group"?LA:H3)),e(W3,t.ariaRoleDescription||`${i} mark`)}}function jA(e){return e.aria===!1?{[OA]:!0}:NJ[e.role]?null:PA[e.role]?OJ(e,PA[e.role]):RJ(e)}function RJ(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return IA(n?LA:H3,`${t} mark container`,e.description)}function OJ(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return IA(t.role||H3,t.desc,n.description||i(n))}catch{return null}}function UA(e){return se(e.text).join(" ")}function LJ(e){const t=e.datum,n=e.orient,i=t.title?qA(e):null,r=e.context,s=r.scales[t.scale].value,o=r.dataflow.locale(),a=s.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(i?` titled '${i}'`:"")+` for a ${Tl(a)?"discrete":a} scale with ${O9(o,s,e)}`}function IJ(e){const t=e.datum,n=t.title?qA(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,s=Object.keys(r),o=e.context,a=o.scales[r[s[0]]].value,u=o.dataflow.locale();return zJ(i)+(n?` titled '${n}'`:"")+` for ${PJ(s)} with ${O9(u,a,e)}`}function qA(e){try{return se(Ye(e.items).items[0].text).join(" ")}catch{return null}}function PJ(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+Ye(e)}function zJ(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const WA=e=>(e+"").replace(/&/g,"&").replace(//g,">"),BJ=e=>WA(e).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function G3(){let e="",t="",n="";const i=[],r=()=>t=n="",s=u=>{t&&(e+=`${t}>${n}`,r()),i.push(u)},o=(u,l)=>(l!=null&&(t+=` ${u}="${BJ(l)}"`),a),a={open(u){s(u),t="<"+u;for(var l=arguments.length,c=new Array(l>1?l-1:0),f=1;f${n}`:"/>"):e+=``,r(),a},attr:o,text:u=>(n+=WA(u),a),toString:()=>e};return a}const HA=e=>GA(G3(),e)+"";function GA(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,i=n.length;for(let r=0;r{c.dirty=n})),!r.zdirty){if(i.exit){o.nested&&r.items.length?(l=r.items[0],l._svg&&this._update(o,l._svg,l)):i._svg&&(l=i._svg.parentNode,l&&l.removeChild(i._svg)),i._svg=null;continue}i=o.nested?r.items[0]:i,i._update!==n&&(!i._svg||!i._svg.ownerSVGElement?(this._dirtyAll=!1,XA(i,n)):this._update(o,i._svg,i),i._update=n)}return!this._dirtyAll}mark(t,n,i,r){if(!this.isDirty(n))return n._svg;const s=this._svg,o=n.marktype,a=Fi[o],u=n.interactive===!1?"none":null,l=a.tag==="g",c=ZA(n,t,i,"g",s);if(o!=="group"&&r!=null&&!r.includes(o))return Vi(c,0),n._svg;c.setAttribute("class",EA(n));const f=jA(n);for(const g in f)qn(c,g,f[g]);l||qn(c,"pointer-events",u),qn(c,"clip-path",n.clip?d3(this,n,n.group):null);let d=null,h=0;const p=g=>{const m=this.isDirty(g),y=ZA(g,c,d,a.tag,s);m&&(this._update(a,y,g),l&&qJ(this,y,g,r)),d=y,++h};return a.nested?n.items.length&&p(n.items[0]):mr(n,p),Vi(c,h),c}_update(t,n,i){Us=n,Mn=n.__values__,BA(Yf,i),t.attr(Yf,i,this);const r=HJ[t.type];r&&r.call(this,t,n,i),Us&&this.style(Us,i)}style(t,n){if(n!=null){for(const i in Op){let r=i==="font"?jf(n):n[i];if(r===Mn[i])continue;const s=Op[i];r==null?t.removeAttribute(s):(o3(r)&&(r=I9(r,this._defs.gradient,KA())),t.setAttribute(s,r+"")),Mn[i]=r}for(const i in Lp)Ip(t,Lp[i],n[i])}}defs(){const t=this._svg,n=this._defs;let i=n.el,r=0;for(const s in n.gradient)i||(n.el=i=Yt(t,Vf+1,"defs",Xt)),r=jJ(i,n.gradient[s],r);for(const s in n.clipping)i||(n.el=i=Yt(t,Vf+1,"defs",Xt)),r=UJ(i,n.clipping[s],r);i&&(r===0?(t.removeChild(i),n.el=null):Vi(i,r))}_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}}function XA(e,t){for(;e&&e.dirty!==t;e=e.mark.group)if(e.dirty=t,e.mark&&e.mark.dirty!==t)e.mark.dirty=t;else return}function jJ(e,t,n){let i,r,s;if(t.gradient==="radial"){let o=Yt(e,n++,"pattern",Xt);Vo(o,{id:op+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),o=Yt(o,0,"rect",Xt),Vo(o,{width:1,height:1,fill:`url(${KA()}#${t.id})`}),e=Yt(e,n++,"radialGradient",Xt),Vo(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=Yt(e,n++,"linearGradient",Xt),Vo(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(i=0,r=t.stops.length;i{r=e.mark(t,o,r,i),++s}),Vi(t,1+s)}function ZA(e,t,n,i,r){let s=e._svg,o;if(!s&&(o=t.ownerDocument,s=Go(o,i,Xt),e._svg=s,e.mark&&(s.__data__=e,s.__values__={fill:"default"},i==="g"))){const a=Go(o,"path",Xt);s.appendChild(a),a.__data__=e;const u=Go(o,"g",Xt);s.appendChild(u),u.__data__=e;const l=Go(o,"path",Xt);s.appendChild(l),l.__data__=e,l.__values__={fill:"default"}}return(s.ownerSVGElement!==r||WJ(s,n))&&t.insertBefore(s,n?n.nextSibling:t.firstChild),s}function WJ(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let Us=null,Mn=null;const HJ={group(e,t,n){const i=Us=t.childNodes[2];Mn=i.__values__,e.foreground(Yf,n,this),Mn=t.__values__,Us=t.childNodes[1],e.content(Yf,n,this);const r=Us=t.childNodes[0];e.background(Yf,n,this);const s=n.mark.interactive===!1?"none":null;if(s!==Mn.events&&(qn(i,"pointer-events",s),qn(r,"pointer-events",s),Mn.events=s),n.strokeForeground&&n.stroke){const o=n.fill;qn(i,"display",null),this.style(r,n),qn(r,"stroke",null),o&&(n.fill=null),Mn=i.__values__,this.style(i,n),o&&(n.fill=o),Us=null}else qn(i,"display","none")},image(e,t,n){n.smooth===!1?(Ip(t,"image-rendering","optimizeSpeed"),Ip(t,"image-rendering","pixelated")):Ip(t,"image-rendering",null)},text(e,t,n){const i=Bf(n);let r,s,o,a;G(i)?(s=i.map(u=>Ho(n,u)),r=s.join(` -`),r!==Mn.text&&(Vi(t,0),o=t.ownerDocument,a=Wo(n),s.forEach((u,l)=>{const c=Go(o,"tspan",Xt);c.__data__=n,c.textContent=u,l&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),Mn.text=r)):(s=Ho(n,i),s!==Mn.text&&(t.textContent=s,Mn.text=s)),qn(t,"font-family",jf(n)),qn(t,"font-size",is(n)+"px"),qn(t,"font-style",n.fontStyle),qn(t,"font-variant",n.fontVariant),qn(t,"font-weight",n.fontWeight)}};function Yf(e,t,n){t!==Mn[e]&&(n?GJ(Us,e,t,n):qn(Us,e,t),Mn[e]=t)}function Ip(e,t,n){n!==Mn[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),Mn[t]=n)}function Vo(e,t){for(const n in t)qn(e,n,t[n])}function qn(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function GJ(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function KA(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class JA extends qf{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=G3();n.open("svg",Be({},zf,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const i=this._bgcolor;return i&&i!=="transparent"&&i!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:i}).close(),n.open("g",VA,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this}mark(t,n){const i=Fi[n.marktype],r=i.tag,s=[BA,i.attr];t.open("g",{class:EA(n),"clip-path":n.clip?d3(this,n,n.group):null},jA(n),{"pointer-events":r!=="g"&&n.interactive===!1?"none":null});const o=a=>{const u=this.href(a);if(u&&t.open("a",u),t.open(r,this.attr(n,a,s,r!=="g"?r:null)),r==="text"){const l=Bf(a);if(G(l)){const c={x:0,dy:Wo(a)};for(let f=0;fthis.mark(t,d)),t.close(),l&&f?(c&&(a.fill=null),a.stroke=f,t.open("path",this.attr(n,a,i.foreground,"bgrect")).close(),c&&(a.fill=c)):t.open("path",this.attr(n,a,i.foreground,"bgfore")).close()}t.close(),u&&t.close()};return i.nested?n.items&&n.items.length&&o(n.items[0]):mr(n,o),t.close()}href(t){const n=t.href;let i;if(n){if(i=this._hrefs&&this._hrefs[n])return i;this.sanitizeURL(n).then(r=>{r["xlink:href"]=r.href,r.href=null,(this._hrefs||(this._hrefs={}))[n]=r})}return null}attr(t,n,i,r){const s={},o=(a,u,l,c)=>{s[c||a]=u};return Array.isArray(i)?i.forEach(a=>a(o,n,this)):i(o,n,this),r&&VJ(s,n,t,r,this._defs),s}defs(t){const n=this._defs.gradient,i=this._defs.clipping;if(Object.keys(n).length+Object.keys(i).length!==0){t.open("defs");for(const s in n){const o=n[s],a=o.stops;o.gradient==="radial"?(t.open("pattern",{id:op+s,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+s+")"}).close(),t.close(),t.open("radialGradient",{id:s,fx:o.x1,fy:o.y1,fr:o.r1,cx:o.x2,cy:o.y2,r:o.r2})):t.open("linearGradient",{id:s,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2});for(let u=0;u!yr.svgMarkTypes.includes(s));this._svgRenderer.render(t,yr.svgMarkTypes),this._canvasRenderer.render(t,r)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svgRenderer.resize(t,n,i,r),this._canvasRenderer.resize(t,n,i,r),this}background(t){return yr.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}}class QA extends Hf{constructor(t,n){super(t,n)}initialize(t,n,i){const r=Yt(Yt(t,0,"div"),yr.svgOnTop?0:1,"div");return super.initialize(r,n,i)}}const e$="canvas",t$="hybrid",n$="png",i$="svg",r$="none",Yo={Canvas:e$,PNG:n$,SVG:i$,Hybrid:t$,None:r$},Za={};Za[e$]=Za[n$]={renderer:Rp,headless:Rp,handler:Hf},Za[i$]={renderer:V3,headless:JA,handler:RA},Za[t$]={renderer:Y3,headless:Y3,handler:QA},Za[r$]={};function Pp(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(Za[e]=t,this):Za[e]}function s$(e,t,n){const i=[],r=new qt().union(t),s=e.marktype;return s?o$(e,r,n,i):s==="group"?a$(e,r,n,i):W("Intersect scene must be mark node or group item.")}function o$(e,t,n,i){if(XJ(e,t,n)){const r=e.items,s=e.marktype,o=r.length;let a=0;if(s==="group")for(;a=0;s--)if(n[s]!=i[s])return!1;for(s=n.length-1;s>=0;s--)if(r=n[s],!Z3(e[r],t[r],r))return!1;return typeof e==typeof t}function JJ(){Y9(),wZ()}const Pl="top",br="left",vr="right",Xo="bottom",QJ="top-left",eQ="top-right",tQ="bottom-left",nQ="bottom-right",K3="start",J3="middle",Wn="end",iQ="x",rQ="y",zp="group",Q3="axis",ev="title",sQ="frame",oQ="scope",tv="legend",f$="row-header",d$="row-footer",h$="row-title",p$="column-header",g$="column-footer",m$="column-title",aQ="padding",uQ="symbol",y$="fit",b$="fit-x",v$="fit-y",lQ="pad",nv="none",Bp="all",iv="each",rv="flush",Zo="column",Ko="row";function _$(e){j.call(this,null,e)}te(_$,j,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,s=Fi[r],o=s.bound;let a=i.bounds,u;if(s.nested)i.items.length&&n.dirty(i.items[0]),a=jp(i,o),i.items.forEach(l=>{l.bounds.clear().union(a)});else if(r===zp||e.modified())switch(t.visit(t.MOD,l=>n.dirty(l)),a.clear(),i.items.forEach(l=>a.union(jp(l,o))),i.role){case Q3:case tv:case ev:t.reflow()}else u=t.changed(t.REM),t.visit(t.ADD,l=>{a.union(jp(l,o))}),t.visit(t.MOD,l=>{u=u||a.alignsWith(l.bounds),n.dirty(l),a.union(jp(l,o))}),u&&(a.clear(),i.items.forEach(l=>a.union(l.bounds)));return l$(i),t.modifies("bounds")}});function jp(e,t,n){return t(e.bounds.clear(),e,n)}const x$=":vega_identifier:";function sv(e){j.call(this,0,e)}sv.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},te(sv,j,{transform(e,t){const n=cQ(t.dataflow),i=e.as;let r=n.value;return t.visit(t.ADD,s=>s[i]=s[i]||++r),n.set(this.value=r),t}});function cQ(e){return e._signals[x$]||(e._signals[x$]=e.add(0))}function w$(e){j.call(this,null,e)}te(w$,j,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,fQ(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const i=n.marktype===zp?cp:lp;return t.visit(t.ADD,r=>i.call(r,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});function fQ(e){const t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function k$(e){j.call(this,null,e)}const E$={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!C$(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},C$=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),A$=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,s;n{const t=e.bounds;return t.width()>1&&t.height()>1},hQ=(e,t,n)=>{var i=e.range(),r=new qt;return t===Pl||t===Xo?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),s=>r.encloses(s.bounds)},$$=e=>(e.forEach(t=>t.opacity=1),e),S$=(e,t)=>e.reflow(t.modified()).modifies("opacity");te(k$,j,{transform(e,t){const n=E$[e.method]||E$.parity,i=e.separation||0;let r=t.materialize(t.SOURCE).source,s,o;if(!r||!r.length)return;if(!e.method)return e.modified("method")&&($$(r),t=S$(t,e)),t;if(r=r.filter(dQ),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),s=$$(r),t=S$(t,e),s.length>=3&&A$(s,i)){do s=n(s,i);while(s.length>=3&&A$(s,i));s.length<3&&!Ye(r).opacity&&(s.length>1&&(Ye(s).opacity=0),Ye(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(o=hQ(e.boundScale,e.boundOrient,+e.boundTolerance),r.forEach(u=>{o(u)||(u.opacity=0)}));const a=s[0].mark.bounds.clear();return r.forEach(u=>{u.opacity&&a.union(u.bounds)}),t}});function F$(e){j.call(this,null,e)}te(F$,j,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,i=>n.dirty(i)),t.fields&&t.fields.zindex){const i=t.source&&t.source[0];i&&(i.mark.zdirty=!0)}}});const Nn=new qt;function zl(e,t,n){return e[t]===n?0:(e[t]=n,1)}function pQ(e){var t=e.items[0].orient;return t===br||t===vr}function gQ(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function mQ(e,t,n,i){var r=t.items[0],s=r.datum,o=r.translate!=null?r.translate:.5,a=r.orient,u=gQ(s),l=r.range,c=r.offset,f=r.position,d=r.minExtent,h=r.maxExtent,p=s.title&&r.items[u[2]].items[0],g=r.titlePadding,m=r.bounds,y=p&&T3(p),b=0,v=0,_,x;switch(Nn.clear().union(m),m.clear(),(_=u[0])>-1&&m.union(r.items[_].bounds),(_=u[1])>-1&&m.union(r.items[_].bounds),a){case Pl:b=f||0,v=-c,x=Math.max(d,Math.min(h,-m.y1)),m.add(0,-x).add(l,0),p&&Up(e,p,x,g,y,0,-1,m);break;case br:b=-c,v=f||0,x=Math.max(d,Math.min(h,-m.x1)),m.add(-x,0).add(0,l),p&&Up(e,p,x,g,y,1,-1,m);break;case vr:b=n+c,v=f||0,x=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(x,l),p&&Up(e,p,x,g,y,1,1,m);break;case Xo:b=f||0,v=i+c,x=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(l,x),p&&Up(e,p,x,g,0,0,1,m);break;default:b=r.x,v=r.y}return js(m.translate(b,v),r),zl(r,"x",b+o)|zl(r,"y",v+o)&&(r.bounds=Nn,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function Up(e,t,n,i,r,s,o,a){const u=t.bounds;if(t.auto){const l=o*(n+r+i);let c=0,f=0;e.dirty(t),s?c=(t.x||0)-(t.x=l):f=(t.y||0)-(t.y=l),t.mark.bounds.clear().union(u.translate(-c,-f)),e.dirty(t)}a.union(u)}const D$=(e,t)=>Math.floor(Math.min(e,t)),T$=(e,t)=>Math.ceil(Math.max(e,t));function yQ(e){var t=e.items,n=t.length,i=0,r,s;const o={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i1)for(w=0;w0&&(v[w]+=T/2);if(a&&$t(n.center,Ko)&&c!==1)for(w=0;w0&&(_[w]+=A/2);for(w=0;wr&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),g+=s,b=0,_=t.length;b<_;++b)e.dirty(t[b]),t[b].mark.bounds.clear();for(y=c,b=0,_=t.length;b<_;++b,y+=f){for(k=t[b],x=k.mark.bounds,v=y;v>=0&&(w=n[v])==null;v-=d);a?(E=h==null?w.x:Math.round(w.bounds.x1+h*w.bounds.width()),C=g):(E=g,C=h==null?w.y:Math.round(w.bounds.y1+h*w.bounds.height())),x.union(k.bounds.translate(E-(k.x||0),C-(k.y||0))),k.x=E,k.y=C,e.dirty(k),m=o(m,x[l])}return m}function R$(e,t,n,i,r,s){if(t){e.dirty(t);var o=n,a=n;i?o=Math.round(r.x1+s*r.width()):a=Math.round(r.y1+s*r.height()),t.bounds.translate(o-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=o,t.y=a,e.dirty(t)}}function kQ(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function EQ(e,t){let n=-1/0;return e.forEach(i=>{i.offset!=null&&(n=Math.max(n,i.offset))}),n>-1/0?n:t}function CQ(e,t,n,i,r,s,o){const a=kQ(n,t),u=EQ(e,a("offset",0)),l=a("anchor",K3),c=l===Wn?1:l===J3?.5:0,f={align:iv,bounds:a("bounds",rv),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case br:f.anchor={x:Math.floor(i.x1)-u,column:Wn,y:c*(o||i.height()+2*i.y1),row:l};break;case vr:f.anchor={x:Math.ceil(i.x2)+u,y:c*(o||i.height()+2*i.y1),row:l};break;case Pl:f.anchor={y:Math.floor(r.y1)-u,row:Wn,x:c*(s||r.width()+2*r.x1),column:l};break;case Xo:f.anchor={y:Math.ceil(r.y2)+u,x:c*(s||r.width()+2*r.x1),column:l};break;case QJ:f.anchor={x:u,y:u};break;case eQ:f.anchor={x:s-u,y:u,column:Wn};break;case tQ:f.anchor={x:u,y:o-u,row:Wn};break;case nQ:f.anchor={x:s-u,y:o-u,column:Wn,row:Wn};break}return f}function AQ(e,t){var n=t.items[0],i=n.datum,r=n.orient,s=n.bounds,o=n.x,a=n.y,u,l;return n._bounds?n._bounds.clear().union(s):n._bounds=s.clone(),s.clear(),SQ(e,n,n.items[0].items[0]),s=$Q(n,s),u=2*n.padding,l=2*n.padding,s.empty()||(u=Math.ceil(s.width()+u),l=Math.ceil(s.height()+l)),i.type===uQ&&FQ(n.items[0].items[0].items[0].items),r!==nv&&(n.x=o=0,n.y=a=0),n.width=u,n.height=l,js(s.set(o,a,o+u,a+l),n),n.mark.bounds.clear().union(s),n}function $Q(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function SQ(e,t,n){var i=t.padding,r=i-n.x,s=i-n.y;if(!t.datum.title)(r||s)&&Xf(e,n,r,s);else{var o=t.items[1].items[0],a=o.anchor,u=t.titlePadding||0,l=i-o.x,c=i-o.y;switch(o.orient){case br:r+=Math.ceil(o.bounds.width())+u;break;case vr:case Xo:break;default:s+=o.bounds.height()+u}switch((r||s)&&Xf(e,n,r,s),o.orient){case br:c+=Bl(t,n,o,a,1,1);break;case vr:l+=Bl(t,n,o,Wn,0,0)+u,c+=Bl(t,n,o,a,1,1);break;case Xo:l+=Bl(t,n,o,a,0,0),c+=Bl(t,n,o,Wn,-1,0,1)+u;break;default:l+=Bl(t,n,o,a,0,0)}(l||c)&&Xf(e,o,l,c),(l=Math.round(o.bounds.x1-i))<0&&(Xf(e,n,-l,0),Xf(e,o,-l,0))}}function Bl(e,t,n,i,r,s,o){const a=e.datum.type!=="symbol",u=n.datum.vgrad,l=a&&(s||!u)&&!o?t.items[0]:t,c=l.bounds[r?"y2":"x2"]-e.padding,f=u&&s?c:0,d=u&&s?0:c,h=r<=0?0:T3(n);return Math.round(i===K3?f:i===Wn?d-h:.5*(c-h))}function Xf(e,t,n,i){t.x+=n,t.y+=i,t.bounds.translate(n,i),t.mark.bounds.translate(n,i),e.dirty(t)}function FQ(e){const t=e.reduce((n,i)=>(n[i.column]=Math.max(i.bounds.x2-i.x,n[i.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function DQ(e,t,n,i,r){var s=t.items[0],o=s.frame,a=s.orient,u=s.anchor,l=s.offset,c=s.padding,f=s.items[0].items[0],d=s.items[1]&&s.items[1].items[0],h=a===br||a===vr?i:n,p=0,g=0,m=0,y=0,b=0,v;if(o!==zp?a===br?(p=r.y2,h=r.y1):a===vr?(p=r.y1,h=r.y2):(p=r.x1,h=r.x2):a===br&&(p=i,h=0),v=u===K3?p:u===Wn?h:(p+h)/2,d&&d.text){switch(a){case Pl:case Xo:b=f.bounds.height()+c;break;case br:y=f.bounds.width()+c;break;case vr:y=-f.bounds.width()-c;break}Nn.clear().union(d.bounds),Nn.translate(y-(d.x||0),b-(d.y||0)),zl(d,"x",y)|zl(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(Nn),d.mark.bounds.clear().union(Nn),e.dirty(d)),Nn.clear().union(d.bounds)}else Nn.clear();switch(Nn.union(f.bounds),a){case Pl:g=v,m=r.y1-Nn.height()-l;break;case br:g=r.x1-Nn.width()-l,m=v;break;case vr:g=r.x2+Nn.width()+l,m=v;break;case Xo:g=v,m=r.y2+l;break;default:g=s.x,m=s.y}return zl(s,"x",g)|zl(s,"y",m)&&(Nn.translate(g,m),e.dirty(s),s.bounds.clear().union(Nn),t.bounds.clear().union(Nn),e.dirty(s)),s.bounds}function O$(e){j.call(this,null,e)}te(O$,j,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&_Q(n,i,e.layout),MQ(n,i,e)}),TQ(e.mark.group)?t.reflow():t}});function TQ(e){return e&&e.mark.role!=="legend-entry"}function MQ(e,t,n){var i=t.items,r=Math.max(0,t.width||0),s=Math.max(0,t.height||0),o=new qt().set(0,0,r,s),a=o.clone(),u=o.clone(),l=[],c,f,d,h,p,g;for(p=0,g=i.length;p{d=y.orient||vr,d!==nv&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];N$(e,b,CQ(b,y,n.legends,a,u,r,s))}l.forEach(y=>{const b=y.bounds;if(b.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=b,e.dirty(y)),n.autosize&&(n.autosize.type===y$||n.autosize.type===b$||n.autosize.type===v$))switch(y.orient){case br:case vr:o.add(b.x1,0).add(b.x2,0);break;case Pl:case Xo:o.add(0,b.y1).add(0,b.y2)}else o.union(b)})}o.union(a).union(u),c&&o.union(DQ(e,c,r,s,o)),t.clip&&o.set(0,0,t.width||0,t.height||0),NQ(e,t,o,n)}function NQ(e,t,n,i){const r=i.autosize||{},s=r.type;if(e._autosize<1||!s)return;let o=e._width,a=e._height,u=Math.max(0,t.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),h=Math.max(0,Math.ceil(n.y2-c));if(r.contains===aQ){const p=e.padding();o-=p.left+p.right,a-=p.top+p.bottom}s===nv?(l=0,f=0,u=o,c=a):s===y$?(u=Math.max(0,o-l-d),c=Math.max(0,a-f-h)):s===b$?(u=Math.max(0,o-l-d),a=c+f+h):s===v$?(o=u+l+d,c=Math.max(0,a-f-h)):s===lQ&&(o=u+l+d,a=c+f+h),e._resizeView(o,a,u,c,[l,f],r.resize)}const RQ=Object.freeze(Object.defineProperty({__proto__:null,bound:_$,identifier:sv,mark:w$,overlap:k$,render:F$,viewlayout:O$},Symbol.toStringTag,{value:"Module"}));function L$(e){j.call(this,null,e)}te(L$,j,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.scale,o=e.count==null?e.values?e.values.length:10:e.count,a=i3(s,o,e.minstep),u=e.format||S9(n,s,a,e.formatSpecifier,e.formatType,!!e.values),l=e.values?$9(s,e.values,a):r3(s,a);return r&&(i.rem=r),r=l.map((c,f)=>it({index:f/(l.length-1||1),value:c,label:u(c)})),e.extra&&r.length&&r.push(it({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function I$(e){j.call(this,null,e)}function OQ(){return it({})}function LQ(e){const t=ol().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}te(I$,j,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||OQ,s=e.key||Ae,o=this.value;return G(i.encode)&&(i.encode=null),o&&(e.modified("key")||t.modified(s))&&W("DataJoin does not support modified key function or fields."),o||(t=t.addAll(),this.value=o=LQ(s)),t.visit(t.ADD,a=>{const u=s(a);let l=o.get(u);l?l.exit?(o.empty--,i.add.push(l)):i.mod.push(l):(l=r(a),o.set(u,l),i.add.push(l)),l.datum=a,l.exit=!1}),t.visit(t.MOD,a=>{const u=s(a),l=o.get(u);l&&(l.datum=a,i.mod.push(l))}),t.visit(t.REM,a=>{const u=s(a),l=o.get(u);a===l.datum&&!l.exit&&(i.rem.push(l),l.exit=!0,++o.empty)}),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&o.empty>n.cleanThreshold)&&n.runAfter(o.clean),i}});function P$(e){j.call(this,null,e)}te(P$,j,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,s=t.encode;if(G(s))if(n.changed()||s.every(f=>r[f]))s=s[0],n.encode=null;else return t.StopPropagation;var o=s==="enter",a=r.update||xo,u=r.enter||xo,l=r.exit||xo,c=(s&&!o?r[s]:a)||xo;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{u(f,e),a(f,e)}),n.modifies(u.output),n.modifies(a.output),c!==xo&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&l!==xo&&(t.visit(t.REM,f=>{l(f,e)}),n.modifies(l.output)),o||c!==xo){const f=t.MOD|(e.modified()?t.REFLOW:0);o?(t.visit(f,d=>{const h=u(d,e)||i;(c(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(u.output)):t.visit(f,d=>{(c(d,e)||i)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function z$(e){j.call(this,[],e)}te(z$,j,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.type||sp,o=e.scale,a=+e.limit,u=i3(o,e.count==null?5:e.count,e.minstep),l=!!e.values||s===sp,c=e.format||M9(n,o,u,s,e.formatSpecifier,e.formatType,l),f=e.values||T9(o,u),d,h,p,g,m;return r&&(i.rem=r),s===sp?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,a-1),m=!0):r=f,ze(p=e.size)?(!e.values&&o(r[0])===0&&(r=r.slice(1)),g=r.reduce((y,b)=>Math.max(y,p(b,e)),0)):p=$n(g=p||8),r=r.map((y,b)=>it({index:b,label:c(y,b,r),value:y,offset:g,size:p(y,e)})),m&&(m=f[r.length],r.push(it({index:r.length,label:`…${f.length-r.length} entries`,value:m,offset:g,size:p(m,e)})))):s===lZ?(d=o.domain(),h=k9(o,d[0],Ye(d)),f.length<3&&!e.values&&d[0]!==Ye(d)&&(f=[d[0],Ye(d)]),r=f.map((y,b)=>it({index:b,label:c(y,b,f),value:y,perc:h(y)}))):(p=f.length-1,h=_Z(o),r=f.map((y,b)=>it({index:b,label:c(y,b,f),value:y,perc:b?h(y):0,perc2:b===p?1:h(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const IQ=e=>e.source.x,PQ=e=>e.source.y,zQ=e=>e.target.x,BQ=e=>e.target.y;function ov(e){j.call(this,{},e)}ov.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},te(ov,j,{transform(e,t){var n=e.sourceX||IQ,i=e.sourceY||PQ,r=e.targetX||zQ,s=e.targetY||BQ,o=e.as||"path",a=e.orient||"vertical",u=e.shape||"line",l=q$.get(u+"-"+a)||q$.get(u);return l||W("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[o]=l(n(c),i(c),r(c),s(c))}),t.reflow(e.modified()).modifies(o)}});const B$=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,jQ=(e,t,n,i)=>B$(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),j$=(e,t,n,i)=>{var r=n-e,s=i-t,o=Math.hypot(r,s)/2,a=180*Math.atan2(s,r)/Math.PI;return"M"+e+","+t+"A"+o+","+o+" "+a+" 0 1 "+n+","+i},UQ=(e,t,n,i)=>j$(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),U$=(e,t,n,i)=>{const r=n-e,s=i-t,o=.2*(r+s),a=.2*(s-r);return"M"+e+","+t+"C"+(e+o)+","+(t+a)+" "+(n+a)+","+(i-o)+" "+n+","+i},q$=ol({line:B$,"line-radial":jQ,arc:j$,"arc-radial":UQ,curve:U$,"curve-radial":(e,t,n,i)=>U$(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),"orthogonal-horizontal":(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,"orthogonal-vertical":(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,"orthogonal-radial":(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),u=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*r+","+t*s+"A"+t+","+t+" 0 0,"+(u?1:0)+" "+t*o+","+t*a+"L"+i*o+","+i*a},"diagonal-horizontal":(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},"diagonal-vertical":(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},"diagonal-radial":(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),u=(t+i)/2;return"M"+t*r+","+t*s+"C"+u*r+","+u*s+" "+u*o+","+u*a+" "+i*o+","+i*a}});function av(e){j.call(this,null,e)}av.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},te(av,j,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],s=e.field||nl,o=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,u=t.source,l=u.map(s),c=l.length,f=o,d=(a-o)/m8(l),h=Ci(c),p,g,m;for(e.sort&&h.sort((y,b)=>l[y]-l[b]),p=0;p-1)return i;var r=t.domain,s=e.type,o=t.zero||t.zero===void 0&&WQ(e),a,u;if(!r)return 0;if((o||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(r=r.slice()).length-1||1,o&&(r[0]>0&&(r[0]=0),r[a]<0&&(r[a]=0)),t.domainMin!=null&&(r[0]=t.domainMin),t.domainMax!=null&&(r[a]=t.domainMax),t.domainMid!=null)){u=t.domainMid;const l=u>r[a]?a+1:ur+(s<0?-1:s>0?1:0),0));i!==t.length&&n.warn("Log scale domain includes zero: "+ee(t))}return t}function KQ(e,t,n){let i=t.bins;if(i&&!G(i)){const r=e.domain(),s=r[0],o=Ye(r),a=i.step;let u=i.start==null?s:i.start,l=i.stop==null?o:i.stop;a||W("Scale bins parameter missing step property."),uo&&(l=a*Math.floor(o/a)),i=Ci(u,l+a/2,a)}return i?e.bins=i:e.bins&&delete e.bins,e.type===Zb&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function JQ(e,t,n){var i=e.type,r=t.round||!1,s=t.range;if(t.rangeStep!=null)s=QQ(i,t,n);else if(t.scheme&&(s=eee(i,t,n),ze(s))){if(e.interpolator)return e.interpolator(s);W(`Scale type ${i} does not support interpolating color schemes.`)}if(s&&v9(i))return e.interpolator(rp(uv(s,t.reverse),t.interpolate,t.interpolateGamma));s&&t.interpolate&&e.interpolate?e.interpolate(t3(t.interpolate,t.interpolateGamma)):ze(e.round)?e.round(r):ze(e.rangeRound)&&e.interpolate(r?Cf:Po),s&&e.range(uv(s,t.reverse))}function QQ(e,t,n){e!==f9&&e!==Xb&&W("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===Xb?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*Vb(n,r,i)]}function eee(e,t,n){var i=t.schemeExtent,r,s;return G(t.scheme)?s=rp(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),s=n3(r),s||W(`Unrecognized scheme name: ${t.scheme}`)),n=e===np?n+1:e===Zb?n-1:e===Dl||e===tp?+t.schemeCount||qQ:n,v9(e)?V$(s,i,t.reverse):ze(s)?w9(V$(s,i),n):e===Yb?s:s.slice(0,n)}function V$(e,t,n){return ze(e)&&(t||n)?x9(e,uv(t||[0,1],n)):e}function uv(e,t){return t?e.slice().reverse():e}function Y$(e){j.call(this,null,e)}te(Y$,j,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(Na(e.sort)),this.modified(n),t}});const X$="zero",Z$="center",K$="normalize",J$=["y0","y1"];function lv(e){j.call(this,null,e)}lv.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:X$,values:[X$,Z$,K$]},{name:"as",type:"string",array:!0,length:2,default:J$}]},te(lv,j,{transform(e,t){var n=e.as||J$,i=n[0],r=n[1],s=Na(e.sort),o=e.field||nl,a=e.offset===Z$?tee:e.offset===K$?nee:iee,u,l,c,f;for(u=ree(t.source,e.groupby,s,o),l=0,c=u.length,f=u.max;lg(c),o,a,u,l,c,f,d,h,p;if(t==null)r.push(e.slice());else for(o={},a=0,u=e.length;ap&&(p=h),n&&d.sort(n)}return r.max=p,r}const see=Object.freeze(Object.defineProperty({__proto__:null,axisticks:L$,datajoin:I$,encode:P$,legendentries:z$,linkpath:ov,pie:av,scale:H$,sortitems:Y$,stack:lv},Symbol.toStringTag,{value:"Module"}));var De=1e-6,Wp=1e-12,We=Math.PI,Ot=We/2,Hp=We/4,Hn=We*2,zt=180/We,qe=We/180,Xe=Math.abs,jl=Math.atan,Yi=Math.atan2,Te=Math.cos,Gp=Math.ceil,Q$=Math.exp,cv=Math.hypot,Vp=Math.log,fv=Math.pow,$e=Math.sin,Xi=Math.sign||function(e){return e>0?1:e<0?-1:0},Gn=Math.sqrt,dv=Math.tan;function eS(e){return e>1?0:e<-1?We:Math.acos(e)}function ci(e){return e>1?Ot:e<-1?-Ot:Math.asin(e)}function hn(){}function Yp(e,t){e&&nS.hasOwnProperty(e.type)&&nS[e.type](e,t)}var tS={Feature:function(e,t){Yp(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i=0?1:-1,r=i*n,s=Te(t),o=$e(t),a=mv*o,u=gv*s+a*Te(r),l=a*i*$e(r);Xp.add(Yi(l,u)),pv=e,gv=s,mv=o}function lee(e){return Zp=new Un,qs(e,rs),Zp*2}function Kp(e){return[Yi(e[1],e[0]),ci(e[2])]}function Ka(e){var t=e[0],n=e[1],i=Te(n);return[i*Te(t),i*$e(t),$e(n)]}function Jp(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ul(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function yv(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Qp(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function eg(e){var t=Gn(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var Dt,fi,Lt,Di,Ja,aS,uS,ql,Zf,Jo,Ws,Hs={point:bv,lineStart:cS,lineEnd:fS,polygonStart:function(){Hs.point=dS,Hs.lineStart=cee,Hs.lineEnd=fee,Zf=new Un,rs.polygonStart()},polygonEnd:function(){rs.polygonEnd(),Hs.point=bv,Hs.lineStart=cS,Hs.lineEnd=fS,Xp<0?(Dt=-(Lt=180),fi=-(Di=90)):Zf>De?Di=90:Zf<-De&&(fi=-90),Ws[0]=Dt,Ws[1]=Lt},sphere:function(){Dt=-(Lt=180),fi=-(Di=90)}};function bv(e,t){Jo.push(Ws=[Dt=e,Lt=e]),tDi&&(Di=t)}function lS(e,t){var n=Ka([e*qe,t*qe]);if(ql){var i=Ul(ql,n),r=[i[1],-i[0],0],s=Ul(r,i);eg(s),s=Kp(s);var o=e-Ja,a=o>0?1:-1,u=s[0]*zt*a,l,c=Xe(o)>180;c^(a*JaDi&&(Di=l)):(u=(u+360)%360-180,c^(a*JaDi&&(Di=t))),c?eTi(Dt,Lt)&&(Lt=e):Ti(e,Lt)>Ti(Dt,Lt)&&(Dt=e):Lt>=Dt?(eLt&&(Lt=e)):e>Ja?Ti(Dt,e)>Ti(Dt,Lt)&&(Lt=e):Ti(e,Lt)>Ti(Dt,Lt)&&(Dt=e)}else Jo.push(Ws=[Dt=e,Lt=e]);tDi&&(Di=t),ql=n,Ja=e}function cS(){Hs.point=lS}function fS(){Ws[0]=Dt,Ws[1]=Lt,Hs.point=bv,ql=null}function dS(e,t){if(ql){var n=e-Ja;Zf.add(Xe(n)>180?n+(n>0?360:-360):n)}else aS=e,uS=t;rs.point(e,t),lS(e,t)}function cee(){rs.lineStart()}function fee(){dS(aS,uS),rs.lineEnd(),Xe(Zf)>De&&(Dt=-(Lt=180)),Ws[0]=Dt,Ws[1]=Lt,ql=null}function Ti(e,t){return(t-=e)<0?t+360:t}function dee(e,t){return e[0]-t[0]}function hS(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tTi(i[0],i[1])&&(i[1]=r[1]),Ti(r[0],i[1])>Ti(i[0],i[1])&&(i[0]=r[0])):s.push(i=r);for(o=-1/0,n=s.length-1,t=0,i=s[n];t<=n;i=r,++t)r=s[t],(a=Ti(i[1],r[0]))>o&&(o=a,Dt=r[0],Lt=i[1])}return Jo=Ws=null,Dt===1/0||fi===1/0?[[NaN,NaN],[NaN,NaN]]:[[Dt,fi],[Lt,Di]]}var Kf,tg,ng,ig,rg,sg,og,ag,vv,_v,xv,pS,gS,Vn,Yn,Xn,_r={sphere:hn,point:wv,lineStart:mS,lineEnd:yS,polygonStart:function(){_r.lineStart=mee,_r.lineEnd=yee},polygonEnd:function(){_r.lineStart=mS,_r.lineEnd=yS}};function wv(e,t){e*=qe,t*=qe;var n=Te(t);Jf(n*Te(e),n*$e(e),$e(t))}function Jf(e,t,n){++Kf,ng+=(e-ng)/Kf,ig+=(t-ig)/Kf,rg+=(n-rg)/Kf}function mS(){_r.point=pee}function pee(e,t){e*=qe,t*=qe;var n=Te(t);Vn=n*Te(e),Yn=n*$e(e),Xn=$e(t),_r.point=gee,Jf(Vn,Yn,Xn)}function gee(e,t){e*=qe,t*=qe;var n=Te(t),i=n*Te(e),r=n*$e(e),s=$e(t),o=Yi(Gn((o=Yn*s-Xn*r)*o+(o=Xn*i-Vn*s)*o+(o=Vn*r-Yn*i)*o),Vn*i+Yn*r+Xn*s);tg+=o,sg+=o*(Vn+(Vn=i)),og+=o*(Yn+(Yn=r)),ag+=o*(Xn+(Xn=s)),Jf(Vn,Yn,Xn)}function yS(){_r.point=wv}function mee(){_r.point=bee}function yee(){bS(pS,gS),_r.point=wv}function bee(e,t){pS=e,gS=t,e*=qe,t*=qe,_r.point=bS;var n=Te(t);Vn=n*Te(e),Yn=n*$e(e),Xn=$e(t),Jf(Vn,Yn,Xn)}function bS(e,t){e*=qe,t*=qe;var n=Te(t),i=n*Te(e),r=n*$e(e),s=$e(t),o=Yn*s-Xn*r,a=Xn*i-Vn*s,u=Vn*r-Yn*i,l=cv(o,a,u),c=ci(l),f=l&&-c/l;vv.add(f*o),_v.add(f*a),xv.add(f*u),tg+=c,sg+=c*(Vn+(Vn=i)),og+=c*(Yn+(Yn=r)),ag+=c*(Xn+(Xn=s)),Jf(Vn,Yn,Xn)}function vee(e){Kf=tg=ng=ig=rg=sg=og=ag=0,vv=new Un,_v=new Un,xv=new Un,qs(e,_r);var t=+vv,n=+_v,i=+xv,r=cv(t,n,i);return rWe&&(e-=Math.round(e/Hn)*Hn),[e,t]}Ev.invert=Ev;function vS(e,t,n){return(e%=Hn)?t||n?kv(xS(e),wS(t,n)):xS(e):t||n?wS(t,n):Ev}function _S(e){return function(t,n){return t+=e,Xe(t)>We&&(t-=Math.round(t/Hn)*Hn),[t,n]}}function xS(e){var t=_S(e);return t.invert=_S(-e),t}function wS(e,t){var n=Te(e),i=$e(e),r=Te(t),s=$e(t);function o(a,u){var l=Te(u),c=Te(a)*l,f=$e(a)*l,d=$e(u),h=d*n+c*i;return[Yi(f*r-h*s,c*n-d*i),ci(h*r+f*s)]}return o.invert=function(a,u){var l=Te(u),c=Te(a)*l,f=$e(a)*l,d=$e(u),h=d*r-f*s;return[Yi(f*r+d*s,c*n+h*i),ci(h*n-c*i)]},o}function _ee(e){e=vS(e[0]*qe,e[1]*qe,e.length>2?e[2]*qe:0);function t(n){return n=e(n[0]*qe,n[1]*qe),n[0]*=zt,n[1]*=zt,n}return t.invert=function(n){return n=e.invert(n[0]*qe,n[1]*qe),n[0]*=zt,n[1]*=zt,n},t}function xee(e,t,n,i,r,s){if(n){var o=Te(t),a=$e(t),u=i*n;r==null?(r=t+i*Hn,s=t-u/2):(r=kS(o,r),s=kS(o,s),(i>0?rs)&&(r+=i*Hn));for(var l,c=r;i>0?c>s:c1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function ug(e,t){return Xe(e[0]-t[0])=0;--a)r.point((f=c[a])[0],f[1]);else i(d.x,d.p.x,-1,r);d=d.p}d=d.o,c=d.z,h=!h}while(!d.v);r.lineEnd()}}}function AS(e){if(t=e.length){for(var t,n=0,i=e[0],r;++n=0?1:-1,F=C*E,S=F>We,z=m*k;if(u.add(Yi(z*C*$e(F),y*w+z*Te(F))),o+=S?E+C*Hn:E,S^p>=n^_>=n){var P=Ul(Ka(h),Ka(v));eg(P);var T=Ul(s,P);eg(T);var A=(S^E>=0?-1:1)*ci(T[2]);(i>A||i===A&&(P[0]||P[1]))&&(a+=S^E>=0?1:-1)}}return(o<-De||o0){for(u||(r.polygonStart(),u=!0),r.lineStart(),k=0;k1&&_&2&&x.push(x.pop().concat(x.shift())),c.push(x.filter(kee))}}return d}}function kee(e){return e.length>1}function Eee(e,t){return((e=e.x)[0]<0?e[1]-Ot-De:Ot-e[1])-((t=t.x)[0]<0?t[1]-Ot-De:Ot-t[1])}const SS=$S(function(){return!0},Cee,$ee,[-We,-Ot]);function Cee(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(s,o){var a=s>0?We:-We,u=Xe(s-t);Xe(u-We)0?Ot:-Ot),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(s,n),r=0):i!==a&&u>=We&&(Xe(t-i)De?jl(($e(t)*(s=Te(i))*$e(n)-$e(i)*(r=Te(t))*$e(e))/(r*s*o)):(t+i)/2}function $ee(e,t,n,i){var r;if(e==null)r=n*Ot,i.point(-We,r),i.point(0,r),i.point(We,r),i.point(We,0),i.point(We,-r),i.point(0,-r),i.point(-We,-r),i.point(-We,0),i.point(-We,r);else if(Xe(e[0]-t[0])>De){var s=e[0]0,r=Xe(t)>De;function s(c,f,d,h){xee(h,e,n,d,c,f)}function o(c,f){return Te(c)*Te(f)>t}function a(c){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(m,y){var b=[m,y],v,_=o(m,y),x=i?_?0:l(m,y):_?l(m+(m<0?We:-We),y):0;if(!f&&(p=h=_)&&c.lineStart(),_!==h&&(v=u(f,b),(!v||ug(f,v)||ug(b,v))&&(b[2]=1)),_!==h)g=0,_?(c.lineStart(),v=u(b,f),c.point(v[0],v[1])):(v=u(f,b),c.point(v[0],v[1],2),c.lineEnd()),f=v;else if(r&&f&&i^_){var k;!(x&d)&&(k=u(b,f,!0))&&(g=0,i?(c.lineStart(),c.point(k[0][0],k[0][1]),c.point(k[1][0],k[1][1]),c.lineEnd()):(c.point(k[1][0],k[1][1]),c.lineEnd(),c.lineStart(),c.point(k[0][0],k[0][1],3)))}_&&(!f||!ug(f,b))&&c.point(b[0],b[1]),f=b,h=_,d=x},lineEnd:function(){h&&c.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function u(c,f,d){var h=Ka(c),p=Ka(f),g=[1,0,0],m=Ul(h,p),y=Jp(m,m),b=m[0],v=y-b*b;if(!v)return!d&&c;var _=t*y/v,x=-t*b/v,k=Ul(g,m),w=Qp(g,_),E=Qp(m,x);yv(w,E);var C=k,F=Jp(w,C),S=Jp(C,C),z=F*F-S*(Jp(w,w)-1);if(!(z<0)){var P=Gn(z),T=Qp(C,(-F-P)/S);if(yv(T,w),T=Kp(T),!d)return T;var A=c[0],M=f[0],B=c[1],V=f[1],H;M0^T[1]<(Xe(T[0]-A)We^(A<=T[0]&&T[0]<=M)){var Oe=Qp(C,(-F+P)/S);return yv(Oe,w),[T,Kp(Oe)]}}}function l(c,f){var d=i?e:We-e,h=0;return c<-d?h|=1:c>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return $S(o,a,s,i?[0,-e]:[-We,e-We])}function Fee(e,t,n,i,r,s){var o=e[0],a=e[1],u=t[0],l=t[1],c=0,f=1,d=u-o,h=l-a,p;if(p=n-o,!(!d&&p>0)){if(p/=d,d<0){if(p0){if(p>f)return;p>c&&(c=p)}if(p=r-o,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>c&&(c=p)}else if(d>0){if(p0)){if(p/=h,h<0){if(p0){if(p>f)return;p>c&&(c=p)}if(p=s-a,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>c&&(c=p)}else if(h>0){if(p0&&(e[0]=o+c*d,e[1]=a+c*h),f<1&&(t[0]=o+f*d,t[1]=a+f*h),!0}}}}}var Qf=1e9,cg=-Qf;function FS(e,t,n,i){function r(l,c){return e<=l&&l<=n&&t<=c&&c<=i}function s(l,c,f,d){var h=0,p=0;if(l==null||(h=o(l,f))!==(p=o(c,f))||u(l,c)<0^f>0)do d.point(h===0||h===3?e:n,h>1?i:t);while((h=(h+f+4)%4)!==p);else d.point(c[0],c[1])}function o(l,c){return Xe(l[0]-e)0?0:3:Xe(l[0]-n)0?2:1:Xe(l[1]-t)0?1:0:c>0?3:2}function a(l,c){return u(l.x,c.x)}function u(l,c){var f=o(l,1),d=o(c,1);return f!==d?f-d:f===0?c[1]-l[1]:f===1?l[0]-c[0]:f===2?l[1]-c[1]:c[0]-l[0]}return function(l){var c=l,f=ES(),d,h,p,g,m,y,b,v,_,x,k,w={point:E,lineStart:z,lineEnd:P,polygonStart:F,polygonEnd:S};function E(A,M){r(A,M)&&c.point(A,M)}function C(){for(var A=0,M=0,B=h.length;Mi&&(rt-we)*(i-Oe)>(Ie-Oe)*(e-we)&&++A:Ie<=i&&(rt-we)*(i-Oe)<(Ie-Oe)*(e-we)&&--A;return A}function F(){c=f,d=[],h=[],k=!0}function S(){var A=C(),M=k&&A,B=(d=g8(d)).length;(M||B)&&(l.polygonStart(),M&&(l.lineStart(),s(null,null,1,l),l.lineEnd()),B&&CS(d,a,A,s,l),l.polygonEnd()),c=l,d=h=p=null}function z(){w.point=T,h&&h.push(p=[]),x=!0,_=!1,b=v=NaN}function P(){d&&(T(g,m),y&&_&&f.rejoin(),d.push(f.result())),w.point=E,_&&c.lineEnd()}function T(A,M){var B=r(A,M);if(h&&p.push([A,M]),x)g=A,m=M,y=B,x=!1,B&&(c.lineStart(),c.point(A,M));else if(B&&_)c.point(A,M);else{var V=[b=Math.max(cg,Math.min(Qf,b)),v=Math.max(cg,Math.min(Qf,v))],H=[A=Math.max(cg,Math.min(Qf,A)),M=Math.max(cg,Math.min(Qf,M))];Fee(V,H,e,t,n,i)?(_||(c.lineStart(),c.point(V[0],V[1])),c.point(H[0],H[1]),B||c.lineEnd(),k=!1):B&&(c.lineStart(),c.point(A,M),k=!1)}b=A,v=M,_=B}return w}}function DS(e,t,n){var i=Ci(e,t-De,n).concat(t);return function(r){return i.map(function(s){return[r,s]})}}function TS(e,t,n){var i=Ci(e,t-De,n).concat(t);return function(r){return i.map(function(s){return[s,r]})}}function Dee(){var e,t,n,i,r,s,o,a,u=10,l=u,c=90,f=360,d,h,p,g,m=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return Ci(Gp(i/c)*c,n,c).map(p).concat(Ci(Gp(a/f)*f,o,f).map(g)).concat(Ci(Gp(t/u)*u,e,u).filter(function(v){return Xe(v%c)>De}).map(d)).concat(Ci(Gp(s/l)*l,r,l).filter(function(v){return Xe(v%f)>De}).map(h))}return y.lines=function(){return b().map(function(v){return{type:"LineString",coordinates:v}})},y.outline=function(){return{type:"Polygon",coordinates:[p(i).concat(g(o).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},y.extent=function(v){return arguments.length?y.extentMajor(v).extentMinor(v):y.extentMinor()},y.extentMajor=function(v){return arguments.length?(i=+v[0][0],n=+v[1][0],a=+v[0][1],o=+v[1][1],i>n&&(v=i,i=n,n=v),a>o&&(v=a,a=o,o=v),y.precision(m)):[[i,a],[n,o]]},y.extentMinor=function(v){return arguments.length?(t=+v[0][0],e=+v[1][0],s=+v[0][1],r=+v[1][1],t>e&&(v=t,t=e,e=v),s>r&&(v=s,s=r,r=v),y.precision(m)):[[t,s],[e,r]]},y.step=function(v){return arguments.length?y.stepMajor(v).stepMinor(v):y.stepMinor()},y.stepMajor=function(v){return arguments.length?(c=+v[0],f=+v[1],y):[c,f]},y.stepMinor=function(v){return arguments.length?(u=+v[0],l=+v[1],y):[u,l]},y.precision=function(v){return arguments.length?(m=+v,d=DS(s,r,90),h=TS(t,e,m),p=DS(a,o,90),g=TS(i,n,m),y):m},y.extentMajor([[-180,-90+De],[180,90-De]]).extentMinor([[-180,-80-De],[180,80+De]])}const ed=e=>e;var Av=new Un,$v=new Un,MS,NS,Sv,Fv,Gs={point:hn,lineStart:hn,lineEnd:hn,polygonStart:function(){Gs.lineStart=Tee,Gs.lineEnd=Nee},polygonEnd:function(){Gs.lineStart=Gs.lineEnd=Gs.point=hn,Av.add(Xe($v)),$v=new Un},result:function(){var e=Av/2;return Av=new Un,e}};function Tee(){Gs.point=Mee}function Mee(e,t){Gs.point=RS,MS=Sv=e,NS=Fv=t}function RS(e,t){$v.add(Fv*e-Sv*t),Sv=e,Fv=t}function Nee(){RS(MS,NS)}var Wl=1/0,fg=Wl,td=-Wl,dg=td,hg={point:Ree,lineStart:hn,lineEnd:hn,polygonStart:hn,polygonEnd:hn,result:function(){var e=[[Wl,fg],[td,dg]];return td=dg=-(fg=Wl=1/0),e}};function Ree(e,t){etd&&(td=e),tdg&&(dg=t)}var Dv=0,Tv=0,nd=0,pg=0,gg=0,Hl=0,Mv=0,Nv=0,id=0,OS,LS,ss,os,Zi={point:Qa,lineStart:IS,lineEnd:PS,polygonStart:function(){Zi.lineStart=Iee,Zi.lineEnd=Pee},polygonEnd:function(){Zi.point=Qa,Zi.lineStart=IS,Zi.lineEnd=PS},result:function(){var e=id?[Mv/id,Nv/id]:Hl?[pg/Hl,gg/Hl]:nd?[Dv/nd,Tv/nd]:[NaN,NaN];return Dv=Tv=nd=pg=gg=Hl=Mv=Nv=id=0,e}};function Qa(e,t){Dv+=e,Tv+=t,++nd}function IS(){Zi.point=Oee}function Oee(e,t){Zi.point=Lee,Qa(ss=e,os=t)}function Lee(e,t){var n=e-ss,i=t-os,r=Gn(n*n+i*i);pg+=r*(ss+e)/2,gg+=r*(os+t)/2,Hl+=r,Qa(ss=e,os=t)}function PS(){Zi.point=Qa}function Iee(){Zi.point=zee}function Pee(){zS(OS,LS)}function zee(e,t){Zi.point=zS,Qa(OS=ss=e,LS=os=t)}function zS(e,t){var n=e-ss,i=t-os,r=Gn(n*n+i*i);pg+=r*(ss+e)/2,gg+=r*(os+t)/2,Hl+=r,r=os*e-ss*t,Mv+=r*(ss+e),Nv+=r*(os+t),id+=r*3,Qa(ss=e,os=t)}function BS(e){this._context=e}BS.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Hn);break}}},result:hn};var Rv=new Un,Ov,jS,US,rd,sd,od={point:hn,lineStart:function(){od.point=Bee},lineEnd:function(){Ov&&qS(jS,US),od.point=hn},polygonStart:function(){Ov=!0},polygonEnd:function(){Ov=null},result:function(){var e=+Rv;return Rv=new Un,e}};function Bee(e,t){od.point=qS,jS=rd=e,US=sd=t}function qS(e,t){rd-=e,sd-=t,Rv.add(Gn(rd*rd+sd*sd)),rd=e,sd=t}let WS,mg,HS,GS;class VS{constructor(t){this._append=t==null?YS:jee(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==HS||this._append!==mg){const i=this._radius,r=this._;this._="",this._append`m0,${i}a${i},${i} 0 1,1 0,${-2*i}a${i},${i} 0 1,1 0,${2*i}z`,HS=i,mg=this._append,GS=this._,this._=r}this._+=GS;break}}}result(){const t=this._;return this._="",t.length?t:null}}function YS(e){let t=1;this._+=e[0];for(const n=e.length;t=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return YS;if(t!==WS){const n=10**t;WS=t,mg=function(r){let s=1;this._+=r[0];for(const o=r.length;s=0))throw new RangeError(`invalid digits: ${a}`);n=u}return t===null&&(s=new VS(n)),o},o.projection(e).digits(n).context(t)}function yg(e){return function(t){var n=new Lv;for(var i in e)n[i]=e[i];return n.stream=t,n}}function Lv(){}Lv.prototype={constructor:Lv,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Iv(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),qs(n,e.stream(hg)),t(hg.result()),i!=null&&e.clipExtent(i),e}function bg(e,t,n){return Iv(e,function(i){var r=t[1][0]-t[0][0],s=t[1][1]-t[0][1],o=Math.min(r/(i[1][0]-i[0][0]),s/(i[1][1]-i[0][1])),a=+t[0][0]+(r-o*(i[1][0]+i[0][0]))/2,u=+t[0][1]+(s-o*(i[1][1]+i[0][1]))/2;e.scale(150*o).translate([a,u])},n)}function Pv(e,t,n){return bg(e,[[0,0],t],n)}function zv(e,t,n){return Iv(e,function(i){var r=+t,s=r/(i[1][0]-i[0][0]),o=(r-s*(i[1][0]+i[0][0]))/2,a=-s*i[0][1];e.scale(150*s).translate([o,a])},n)}function Bv(e,t,n){return Iv(e,function(i){var r=+t,s=r/(i[1][1]-i[0][1]),o=-s*i[0][0],a=(r-s*(i[1][1]+i[0][1]))/2;e.scale(150*s).translate([o,a])},n)}var ZS=16,Uee=Te(30*qe);function KS(e,t){return+t?Wee(e,t):qee(e)}function qee(e){return yg({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Wee(e,t){function n(i,r,s,o,a,u,l,c,f,d,h,p,g,m){var y=l-i,b=c-r,v=y*y+b*b;if(v>4*t&&g--){var _=o+d,x=a+h,k=u+p,w=Gn(_*_+x*x+k*k),E=ci(k/=w),C=Xe(Xe(k)-1)t||Xe((y*P+b*T)/v-.5)>.3||o*d+a*h+u*p2?A[2]%360*qe:0,P()):[a*zt,u*zt,l*zt]},S.angle=function(A){return arguments.length?(f=A%360*qe,P()):f*zt},S.reflectX=function(A){return arguments.length?(d=A?-1:1,P()):d<0},S.reflectY=function(A){return arguments.length?(h=A?-1:1,P()):h<0},S.precision=function(A){return arguments.length?(k=KS(w,x=A*A),T()):Gn(x)},S.fitExtent=function(A,M){return bg(S,A,M)},S.fitSize=function(A,M){return Pv(S,A,M)},S.fitWidth=function(A,M){return zv(S,A,M)},S.fitHeight=function(A,M){return Bv(S,A,M)};function P(){var A=JS(n,0,0,d,h,f).apply(null,t(s,o)),M=JS(n,i-A[0],r-A[1],d,h,f);return c=vS(a,u,l),w=kv(t,M),E=kv(c,w),k=KS(w,x),T()}function T(){return C=F=null,S}return function(){return t=e.apply(this,arguments),S.invert=t.invert&&z,P()}}function jv(e){var t=0,n=We/3,i=QS(e),r=i(t,n);return r.parallels=function(s){return arguments.length?i(t=s[0]*qe,n=s[1]*qe):[t*zt,n*zt]},r}function Yee(e){var t=Te(e);function n(i,r){return[i*t,$e(r)/t]}return n.invert=function(i,r){return[i/t,ci(r*t)]},n}function Xee(e,t){var n=$e(e),i=(n+$e(t))/2;if(Xe(i)=.12&&m<.234&&g>=-.425&&g<-.214?r:m>=.166&&m<.234&&g>=-.214&&g<-.115?o:n).invert(d)},c.stream=function(d){return e&&t===d?e:e=Zee([n.stream(t=d),r.stream(d),o.stream(d)])},c.precision=function(d){return arguments.length?(n.precision(d),r.precision(d),o.precision(d),f()):n.precision()},c.scale=function(d){return arguments.length?(n.scale(d),r.scale(d*.35),o.scale(d),c.translate(n.translate())):n.scale()},c.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],g=+d[1];return i=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(l),s=r.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+De,g+.12*h+De],[p-.214*h-De,g+.234*h-De]]).stream(l),a=o.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+De,g+.166*h+De],[p-.115*h-De,g+.234*h-De]]).stream(l),f()},c.fitExtent=function(d,h){return bg(c,d,h)},c.fitSize=function(d,h){return Pv(c,d,h)},c.fitWidth=function(d,h){return zv(c,d,h)},c.fitHeight=function(d,h){return Bv(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}function tF(e){return function(t,n){var i=Te(t),r=Te(n),s=e(i*r);return s===1/0?[2,0]:[s*r*$e(t),s*$e(n)]}}function ad(e){return function(t,n){var i=Gn(t*t+n*n),r=e(i),s=$e(r),o=Te(r);return[Yi(t*s,i*o),ci(i&&n*s/i)]}}var nF=tF(function(e){return Gn(2/(1+e))});nF.invert=ad(function(e){return 2*ci(e/2)});function Jee(){return as(nF).scale(124.75).clipAngle(180-.001)}var iF=tF(function(e){return(e=eS(e))&&e/$e(e)});iF.invert=ad(function(e){return e});function Qee(){return as(iF).scale(79.4188).clipAngle(180-.001)}function _g(e,t){return[e,Vp(dv((Ot+t)/2))]}_g.invert=function(e,t){return[e,2*jl(Q$(t))-Ot]};function ete(){return rF(_g).scale(961/Hn)}function rF(e){var t=as(e),n=t.center,i=t.scale,r=t.translate,s=t.clipExtent,o=null,a,u,l;t.scale=function(f){return arguments.length?(i(f),c()):i()},t.translate=function(f){return arguments.length?(r(f),c()):r()},t.center=function(f){return arguments.length?(n(f),c()):n()},t.clipExtent=function(f){return arguments.length?(f==null?o=a=u=l=null:(o=+f[0][0],a=+f[0][1],u=+f[1][0],l=+f[1][1]),c()):o==null?null:[[o,a],[u,l]]};function c(){var f=We*i(),d=t(_ee(t.rotate()).invert([0,0]));return s(o==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===_g?[[Math.max(d[0]-f,o),a],[Math.min(d[0]+f,u),l]]:[[o,Math.max(d[1]-f,a)],[u,Math.min(d[1]+f,l)]])}return c()}function xg(e){return dv((Ot+e)/2)}function tte(e,t){var n=Te(e),i=e===t?$e(e):Vp(n/Te(t))/Vp(xg(t)/xg(e)),r=n*fv(xg(e),i)/i;if(!i)return _g;function s(o,a){r>0?a<-Ot+De&&(a=-Ot+De):a>Ot-De&&(a=Ot-De);var u=r/fv(xg(a),i);return[u*$e(i*o),r-u*Te(i*o)]}return s.invert=function(o,a){var u=r-a,l=Xi(i)*Gn(o*o+u*u),c=Yi(o,Xe(u))*Xi(u);return u*i<0&&(c-=We*Xi(o)*Xi(u)),[c/i,2*jl(fv(r/l,1/i))-Ot]},s}function nte(){return jv(tte).scale(109.5).parallels([30,30])}function wg(e,t){return[e,t]}wg.invert=wg;function ite(){return as(wg).scale(152.63)}function rte(e,t){var n=Te(e),i=e===t?$e(e):(n-Te(t))/(t-e),r=n/i+e;if(Xe(i)De&&--i>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function cte(){return as(aF).scale(175.295)}function uF(e,t){return[Te(t)*$e(e),$e(t)]}uF.invert=ad(ci);function fte(){return as(uF).scale(249.5).clipAngle(90+De)}function lF(e,t){var n=Te(t),i=1+Te(e)*n;return[n*$e(e)/i,$e(t)/i]}lF.invert=ad(function(e){return 2*jl(e)});function dte(){return as(lF).scale(250).clipAngle(142)}function cF(e,t){return[Vp(dv((Ot+t)/2)),-e]}cF.invert=function(e,t){return[-t,2*jl(Q$(e))-Ot]};function hte(){var e=rF(cF),t=e.center,n=e.rotate;return e.center=function(i){return arguments.length?t([-i[1],i[0]]):(i=t(),[i[1],-i[0]])},e.rotate=function(i){return arguments.length?n([i[0],i[1],i.length>2?i[2]+90:90]):(i=n(),[i[0],i[1],i[2]-90])},n([0,0,90]).scale(159.155)}var pte=Math.abs,Uv=Math.cos,Eg=Math.sin,gte=1e-6,fF=Math.PI,qv=fF/2,dF=mte(2);function hF(e){return e>1?qv:e<-1?-qv:Math.asin(e)}function mte(e){return e>0?Math.sqrt(e):0}function yte(e,t){var n=e*Eg(t),i=30,r;do t-=r=(t+Eg(t)-n)/(1+Uv(t));while(pte(r)>gte&&--i>0);return t/2}function bte(e,t,n){function i(r,s){return[e*r*Uv(s=yte(n,s)),t*Eg(s)]}return i.invert=function(r,s){return s=hF(s/t),[r/(e*Uv(s)),hF((2*s+Eg(2*s))/n)]},i}var vte=bte(dF/qv,dF,fF);function _te(){return as(vte).scale(169.529)}const xte=XS(),Wv=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function wte(e,t){return function n(){const i=t();return i.type=e,i.path=XS().projection(i),i.copy=i.copy||function(){const r=n();return Wv.forEach(s=>{i[s]&&r[s](i[s]())}),r.path.pointRadius(i.path.pointRadius()),r},g9(i)}}function Hv(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(Cg[e]=wte(e,t),this):Cg[e]||null}function pF(e){return e&&e.path||xte}const Cg={albers:eF,albersusa:Kee,azimuthalequalarea:Jee,azimuthalequidistant:Qee,conicconformal:nte,conicequalarea:vg,conicequidistant:ste,equalEarth:ate,equirectangular:ite,gnomonic:ute,identity:lte,mercator:ete,mollweide:_te,naturalEarth1:cte,orthographic:fte,stereographic:dte,transversemercator:hte};for(const e in Cg)Hv(e,Cg[e]);function kte(){}const Vs=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function gF(){var e=1,t=1,n=a;function i(u,l){return l.map(c=>r(u,c))}function r(u,l){var c=[],f=[];return s(u,l,d=>{n(d,u,l),Ete(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=c.length,g;h=l,Vs[m<<1].forEach(v);++h=l,Vs[g|m<<1].forEach(v);for(Vs[m<<0].forEach(v);++p=l,y=u[p*e]>=l,Vs[m<<1|y<<2].forEach(v);++h=l,b=y,y=u[p*e+h+1]>=l,Vs[g|m<<1|y<<2|b<<3].forEach(v);Vs[m|y<<3].forEach(v)}for(h=-1,y=u[p*e]>=l,Vs[y<<2].forEach(v);++h=l,Vs[y<<2|b<<3].forEach(v);Vs[y<<3].forEach(v);function v(_){var x=[_[0][0]+h,_[0][1]+p],k=[_[1][0]+h,_[1][1]+p],w=o(x),E=o(k),C,F;(C=d[w])?(F=f[E])?(delete d[C.end],delete f[F.start],C===F?(C.ring.push(k),c(C.ring)):f[C.start]=d[F.end]={start:C.start,end:F.end,ring:C.ring.concat(F.ring)}):(delete d[C.end],C.ring.push(k),d[C.end=E]=C):(C=f[E])?(F=d[w])?(delete f[C.start],delete d[F.end],C===F?(C.ring.push(k),c(C.ring)):f[F.start]=d[C.end]={start:F.start,end:C.end,ring:F.ring.concat(C.ring)}):(delete f[C.start],C.ring.unshift(x),f[C.start=w]=C):f[w]=d[E]={start:w,end:E,ring:[x,k]}}}function o(u){return u[0]*2+u[1]*(e+1)*4}function a(u,l,c){u.forEach(f=>{var d=f[0],h=f[1],p=d|0,g=h|0,m,y=l[g*e+p];d>0&&d0&&h=0&&c>=0||W("invalid size"),e=l,t=c,i},i.smooth=function(u){return arguments.length?(n=u?a:kte,i):n===a},i}function Ete(e){for(var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++ti!=h>i&&n<(d-l)*(i-c)/(h-c)+l&&(r=-r)}return r}function $te(e,t,n){var i;return Ste(e,t,n)&&Fte(e[i=+(e[0]===t[0])],n[i],t[i])}function Ste(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function Fte(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function mF(e,t,n){return function(i){var r=Wr(i),s=n?Math.min(r[0],0):r[0],o=r[1],a=o-s,u=t?Ao(s,o,e):a/(e+1);return Ci(s+u,o,u)}}function Gv(e){j.call(this,null,e)}Gv.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},te(Gv,j,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||Cn,s=gF().smooth(e.smooth!==!1),o=e.thresholds||Dte(i,r,e),a=e.as===null?null:e.as||"contour",u=[];return i.forEach(l=>{const c=r(l),f=s.size([c.width,c.height])(c.values,G(o)?o:o(c.values));Tte(f,c,l,e),f.forEach(d=>{u.push(b0(l,it(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function Dte(e,t,n){const i=mF(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>Sa(t(r).values)))}function Tte(e,t,n,i){let r=i.scale||t.scale,s=i.translate||t.translate;if(ze(r)&&(r=r(n,i)),ze(s)&&(s=s(n,i)),(r===1||r==null)&&!s)return;const o=(Je(r)?r:r[0])||1,a=(Je(r)?r:r[1])||1,u=s&&s[0]||0,l=s&&s[1]||0;e.forEach(yF(t,o,a,u,l))}function yF(e,t,n,i,r){const s=e.x1||0,o=e.y1||0,a=t*n<0;function u(f){f.forEach(l)}function l(f){a&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-s)*t+i,f[1]=(f[1]-o)*n+r}return function(f){return f.coordinates.forEach(u),f}}function bF(e,t,n){const i=e>=0?e:xy(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function Vv(e){return ze(e)?e:$n(+e)}function vF(){var e=u=>u[0],t=u=>u[1],n=nl,i=[-1,-1],r=960,s=500,o=2;function a(u,l){const c=bF(i[0],u,e)>>o,f=bF(i[1],u,t)>>o,d=c?c+2:0,h=f?f+2:0,p=2*d+(r>>o),g=2*h+(s>>o),m=new Float32Array(p*g),y=new Float32Array(p*g);let b=m;u.forEach(_=>{const x=d+(+e(_)>>o),k=h+(+t(_)>>o);x>=0&&x=0&&k0&&f>0?(Gl(p,g,m,y,c),Vl(p,g,y,m,f),Gl(p,g,m,y,c),Vl(p,g,y,m,f),Gl(p,g,m,y,c),Vl(p,g,y,m,f)):c>0?(Gl(p,g,m,y,c),Gl(p,g,y,m,c),Gl(p,g,m,y,c),b=y):f>0&&(Vl(p,g,m,y,f),Vl(p,g,y,m,f),Vl(p,g,m,y,f),b=y);const v=l?Math.pow(2,-2*o):1/m8(b);for(let _=0,x=p*g;_>o),y2:h+(s>>o)}}return a.x=function(u){return arguments.length?(e=Vv(u),a):e},a.y=function(u){return arguments.length?(t=Vv(u),a):t},a.weight=function(u){return arguments.length?(n=Vv(u),a):n},a.size=function(u){if(!arguments.length)return[r,s];var l=+u[0],c=+u[1];return l>=0&&c>=0||W("invalid size"),r=l,s=c,a},a.cellSize=function(u){return arguments.length?((u=+u)>=1||W("invalid cell size"),o=Math.floor(Math.log(u)/Math.LN2),a):1<=r&&(a>=s&&(u-=n[a-s+o*e]),i[a-r+o*e]=u/Math.min(a+1,e-1+s-a,s))}function Vl(e,t,n,i,r){const s=(r<<1)+1;for(let o=0;o=r&&(a>=s&&(u-=n[o+(a-s)*e]),i[o+(a-r)*e]=u/Math.min(a+1,t-1+s-a,s))}function Yv(e){j.call(this,null,e)}Yv.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const Mte=["x","y","weight","size","cellSize","bandwidth"];function _F(e,t){return Mte.forEach(n=>t[n]!=null?e[n](t[n]):0),e}te(Yv,j,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=Nte(i,e.groupby),s=(e.groupby||[]).map(Rt),o=_F(vF(),e),a=e.as||"grid",u=[];function l(c,f){for(let d=0;dit(l({[a]:o(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=u,n}});function Nte(e,t){var n=[],i=c=>c(a),r,s,o,a,u,l;if(t==null)n.push(e);else for(r={},s=0,o=e.length;sn.push(a(c))),s&&o&&(t.visit(u,c=>{var f=s(c),d=o(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&i.push([f,d])}),n=n.concat({type:Zv,geometry:{type:Rte,coordinates:i}})),this.value={type:Kv,features:n}}});function Qv(e){j.call(this,null,e)}Qv.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},te(Qv,j,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||Cn,s=e.as||"path",o=n.SOURCE;!i||e.modified()?(this.value=i=pF(e.projection),n.materialize().reflow()):o=r===Cn||t.modified(r.fields)?n.ADD_MOD:n.ADD;const a=Ote(i,e.pointRadius);return n.visit(o,u=>u[s]=i(r(u))),i.pointRadius(a),n.modifies(s)}});function Ote(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function e_(e){j.call(this,null,e)}e_.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},te(e_,j,{transform(e,t){var n=e.projection,i=e.fields[0],r=e.fields[1],s=e.as||["x","y"],o=s[0],a=s[1],u;function l(c){const f=n([i(c),r(c)]);f?(c[o]=f[0],c[a]=f[1]):(c[o]=void 0,c[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,l):(u=t.modified(i.fields)||t.modified(r.fields),t.visit(u?t.ADD_MOD:t.ADD,l)),t.modifies(s)}});function t_(e){j.call(this,null,e)}t_.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},te(t_,j,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",s=n.ADD;return(!i||e.modified())&&(this.value=i=Lte(pF(e.projection),e.field||Bi("datum"),e.pointRadius),n.materialize().reflow(),s=n.SOURCE),n.visit(s,o=>o[r]=i),n.modifies(r)}});function Lte(e,t,n){const i=n==null?r=>e(t(r)):r=>{var s=e.pointRadius(),o=e.pointRadius(n)(t(r));return e.pointRadius(s),o};return i.context=r=>(e.context(r),i),i}function n_(e){j.call(this,[],e),this.generator=Dee()}n_.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},te(n_,j,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const s in e)ze(i[s])&&i[s](e[s]);return r=i(),n.length?t.mod.push(Mk(n[0],r)):t.add.push(it(r)),n[0]=r,t}});function i_(e){j.call(this,null,e)}i_.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},te(i_,j,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i=e.resolve==="shared",r=e.field||Cn,s=Pte(e.opacity,e),o=Ite(e.color,e),a=e.as||"image",u={$x:0,$y:0,$value:0,$max:i?Sa(n.map(l=>Sa(r(l).values))):0};return n.forEach(l=>{const c=r(l),f=Be({},l,u);i||(f.$max=Sa(c.values||[])),l[a]=zte(c,f,o.dep?o:$n(o(f)),s.dep?s:$n(s(f)))}),t.reflow(!0).modifies(a)}});function Ite(e,t){let n;return ze(e)?(n=i=>Io(e(i,t)),n.dep=xF(e)):n=$n(Io(e||"#888")),n}function Pte(e,t){let n;return ze(e)?(n=i=>e(i,t),n.dep=xF(e)):e?n=$n(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function xF(e){if(!ze(e))return!1;const t=fr(En(e));return t.$x||t.$y||t.$value||t.$max}function zte(e,t,n,i){const r=e.width,s=e.height,o=e.x1||0,a=e.y1||0,u=e.x2||r,l=e.y2||s,c=e.values,f=c?m=>c[m]:_o,d=Ro(u-o,l-a),h=d.getContext("2d"),p=h.getImageData(0,0,u-o,l-a),g=p.data;for(let m=a,y=0;m{e[i]!=null&&kF(n,i,e[i])})):Wv.forEach(i=>{e.modified(i)&&kF(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&Bte(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function Bte(e,t){const n=Ute(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function jte(e){const t=Hv((e||"mercator").toLowerCase());return t||W("Unrecognized projection type: "+e),t()}function kF(e,t,n){ze(e[t])&&e[t](n)}function Ute(e){return e=se(e),e.length===1?e[0]:{type:Kv,features:e.reduce((t,n)=>t.concat(qte(n)),[])}}function qte(e){return e.type===Kv?e.features:se(e).filter(t=>t!=null).map(t=>t.type===Zv?t:{type:Zv,geometry:t})}const Wte=Object.freeze(Object.defineProperty({__proto__:null,contour:Xv,geojson:Jv,geopath:Qv,geopoint:e_,geoshape:t_,graticule:n_,heatmap:i_,isocontour:Gv,kde2d:Yv,projection:wF},Symbol.toStringTag,{value:"Module"}));function Hte(e,t){var n,i=1;e==null&&(e=0),t==null&&(t=0);function r(){var s,o=n.length,a,u=0,l=0;for(s=0;s=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d,r=s,!(s=s[y=m<<1|g]))return r[y]=o,e;if(h=+e._x.call(null,s.data),p=+e._y.call(null,s.data),t===h&&n===p)return o.next=s,r?r[y]=o:e._root=o,e;do r=r?r[y]=new Array(4):e._root=new Array(4),(g=t>=(f=(a+l)/2))?a=f:l=f,(m=n>=(d=(u+c)/2))?u=d:c=d;while((y=m<<1|g)===(b=(p>=d)<<1|h>=f));return r[b]=s,r[y]=o,e}function Vte(e){var t,n,i=e.length,r,s,o=new Array(i),a=new Array(i),u=1/0,l=1/0,c=-1/0,f=-1/0;for(n=0;nc&&(c=r),sf&&(f=s));if(u>c||l>f)return this;for(this.cover(u,l).cover(c,f),n=0;ne||e>=r||i>t||t>=s;)switch(l=(tc||(a=p.y0)>f||(u=p.x1)=y)<<1|e>=m)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=p)}else{var b=e-+this._x.call(null,h.data),v=t-+this._y.call(null,h.data),_=b*b+v*v;if(_=(d=(o+u)/2))?o=d:u=d,(g=f>=(h=(a+l)/2))?a=h:l=h,t=n,!(n=n[m=g<<1|p]))return this;if(!n.length)break;(t[m+1&3]||t[m+2&3]||t[m+3&3])&&(i=t,y=m)}for(;n.data!==e;)if(r=n,!(n=n.next))return this;return(s=n.next)&&delete n.next,r?(s?r.next=s:delete r.next,this):t?(s?t[m]=s:delete t[m],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(i?i[y]=n:this._root=n),this):(this._root=s,this)}function Qte(e){for(var t=0,n=e.length;td.index){var S=h-E.x-E.vx,z=p-E.y-E.vy,P=S*S+z*z;Ph+F||kp+F||wl.r&&(l.r=l[c].r)}function u(){if(t){var l,c=t.length,f;for(n=new Array(c),l=0;l[t(x,k,o),x])),_;for(m=0,a=new Array(y);m{}};function $F(){for(var e=0,t=arguments.length,n={},i;e=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}Ag.prototype=$F.prototype={constructor:Ag,on:function(e,t){var n=this._,i=pne(e+"",n),r,s=-1,o=i.length;if(arguments.length<2){for(;++s0)for(var n=new Array(r),i=0,r,s;i=0&&e._call.call(void 0,t),e=e._next;--Yl}function MF(){eu=(Sg=gd.now())+Fg,Yl=dd=0;try{yne()}finally{Yl=0,vne(),eu=0}}function bne(){var e=gd.now(),t=e-Sg;t>FF&&(Fg-=t,Sg=e)}function vne(){for(var e,t=$g,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:$g=n);pd=e,a_(i)}function a_(e){if(!Yl){dd&&(dd=clearTimeout(dd));var t=e-eu;t>24?(e<1/0&&(dd=setTimeout(MF,e-gd.now()-Fg)),hd&&(hd=clearInterval(hd))):(hd||(Sg=gd.now(),hd=setInterval(bne,FF)),Yl=1,DF(MF))}}function _ne(e,t,n){var i=new Dg,r=t;return t==null?(i.restart(e,t,n),i):(i._restart=i.restart,i.restart=function(s,o,a){o=+o,a=a==null?o_():+a,i._restart(function u(l){l+=r,i._restart(u,r+=o,a),s(l)},o,a)},i.restart(e,t,n),i)}const xne=1664525,wne=1013904223,NF=4294967296;function kne(){let e=1;return()=>(e=(xne*e+wne)%NF)/NF}function Ene(e){return e.x}function Cne(e){return e.y}var Ane=10,$ne=Math.PI*(3-Math.sqrt(5));function Sne(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),s=0,o=.6,a=new Map,u=TF(f),l=$F("tick","end"),c=kne();e==null&&(e=[]);function f(){d(),l.call("tick",t),n1?(m==null?a.delete(g):a.set(g,p(m)),t):a.get(g)},find:function(g,m,y){var b=0,v=e.length,_,x,k,w,E;for(y==null?y=1/0:y*=y,b=0;b1?(l.on(g,m),t):l.on(g)}}}function Fne(){var e,t,n,i,r=Jn(-30),s,o=1,a=1/0,u=.81;function l(h){var p,g=e.length,m=r_(e,Ene,Cne).visitAfter(f);for(i=h,p=0;p=a)return;(h.data!==t||h.next)&&(y===0&&(y=Qo(n),_+=y*y),b===0&&(b=Qo(n),_+=b*b),_=0;)n.tick();else if(n.stopped()&&n.restart(),!i)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,u=0,l=a.length,c;ue.touch(t).run()}function Rne(e,t){const n=Sne(e),i=n.stop,r=n.restart;let s=!1;return n.stopped=()=>s,n.restart=()=>(s=!1,r()),n.stop=()=>(s=!0,i()),LF(n,t,!0).on("end",()=>s=!0)}function LF(e,t,n,i){var r=se(t.forces),s,o,a,u;for(s=0,o=u_.length;st(i,n):t)}const Pne=Object.freeze(Object.defineProperty({__proto__:null,force:l_},Symbol.toStringTag,{value:"Module"}));function zne(e,t){return e.parent===t.parent?1:2}function Bne(e){return e.reduce(jne,0)/e.length}function jne(e,t){return e+t.x}function Une(e){return 1+e.reduce(qne,0)}function qne(e,t){return Math.max(e,t.y)}function Wne(e){for(var t;t=e.children;)e=t[0];return e}function Hne(e){for(var t;t=e.children;)e=t[t.length-1];return e}function Gne(){var e=zne,t=1,n=1,i=!1;function r(s){var o,a=0;s.eachAfter(function(d){var h=d.children;h?(d.x=Bne(h),d.y=Une(h)):(d.x=o?a+=e(d,o):0,d.y=0,o=d)});var u=Wne(s),l=Hne(s),c=u.x-e(u,l)/2,f=l.x+e(l,u)/2;return s.eachAfter(i?function(d){d.x=(d.x-s.x)*t,d.y=(s.y-d.y)*n}:function(d){d.x=(d.x-c)/(f-c)*t,d.y=(1-(s.y?d.y/s.y:1))*n})}return r.separation=function(s){return arguments.length?(e=s,r):e},r.size=function(s){return arguments.length?(i=!1,t=+s[0],n=+s[1],r):i?null:[t,n]},r.nodeSize=function(s){return arguments.length?(i=!0,t=+s[0],n=+s[1],r):i?[t,n]:null},r}function Vne(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else for(;--i>=0;)t+=n[i].value;e.value=t}function Yne(){return this.eachAfter(Vne)}function Xne(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function Zne(e,t){for(var n=this,i=[n],r,s,o=-1;n=i.pop();)if(e.call(t,n,++o,this),r=n.children)for(s=r.length-1;s>=0;--s)i.push(r[s]);return this}function Kne(e,t){for(var n=this,i=[n],r=[],s,o,a,u=-1;n=i.pop();)if(r.push(n),s=n.children)for(o=0,a=s.length;o=0;)n+=i[r].value;t.value=n})}function eie(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function tie(e){for(var t=this,n=nie(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function nie(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function iie(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function rie(){return Array.from(this)}function sie(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function oie(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*aie(){var e=this,t,n=[e],i,r,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,s=i.length;r=0;--a)r.push(s=o[a]=new Xl(o[a])),s.parent=i,s.depth=i.depth+1;return n.eachBefore(IF)}function uie(){return c_(this).eachBefore(fie)}function lie(e){return e.children}function cie(e){return Array.isArray(e)?e[1]:null}function fie(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function IF(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Xl(e){this.data=e,this.depth=this.height=0,this.parent=null}Xl.prototype=c_.prototype={constructor:Xl,count:Yne,each:Xne,eachAfter:Kne,eachBefore:Zne,find:Jne,sum:Qne,sort:eie,path:tie,ancestors:iie,descendants:rie,leaves:sie,links:oie,copy:uie,[Symbol.iterator]:aie};function Tg(e){return e==null?null:PF(e)}function PF(e){if(typeof e!="function")throw new Error;return e}function tu(){return 0}function Zl(e){return function(){return e}}const die=1664525,hie=1013904223,zF=4294967296;function pie(){let e=1;return()=>(e=(die*e+hie)%zF)/zF}function gie(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function mie(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function yie(e,t){for(var n=0,i=(e=mie(Array.from(e),t)).length,r=[],s,o;n0&&n*n>i*i+r*r}function f_(e,t){for(var n=0;n1e-6?(S+Math.sqrt(S*S-4*F*z))/(2*F):z/S);return{x:i+k+w*P,y:r+E+C*P,r:P}}function UF(e,t,n){var i=e.x-t.x,r,s,o=e.y-t.y,a,u,l=i*i+o*o;l?(s=t.r+n.r,s*=s,u=e.r+n.r,u*=u,s>u?(r=(l+u-s)/(2*l),a=Math.sqrt(Math.max(0,u/l-r*r)),n.x=e.x-r*i-a*o,n.y=e.y-r*o+a*i):(r=(l+s-u)/(2*l),a=Math.sqrt(Math.max(0,s/l-r*r)),n.x=t.x+r*i-a*o,n.y=t.y+r*o+a*i)):(n.x=t.x+n.r,n.y=t.y)}function qF(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function WF(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,s=(t.y*n.r+n.y*t.r)/i;return r*r+s*s}function Ng(e){this._=e,this.next=null,this.previous=null}function xie(e,t){if(!(s=(e=gie(e)).length))return 0;var n,i,r,s,o,a,u,l,c,f,d;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(s>2))return n.r+i.r;UF(i,n,r=e[2]),n=new Ng(n),i=new Ng(i),r=new Ng(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(u=3;uSie(n(_,x,r))),b=y.map(ZF),v=new Set(y).add("");for(const _ of b)v.has(_)||(v.add(_),y.push(_),b.push(ZF(_)),s.push(h_));o=(_,x)=>y[x],a=(_,x)=>b[x]}for(c=0,u=s.length;c=0&&(h=s[y],h.data===h_);--y)h.data=null}if(f.parent=Cie,f.eachBefore(function(y){y.depth=y.parent.depth+1,--u}).eachBefore(IF),f.parent=null,u>0)throw new Error("cycle");return f}return i.id=function(r){return arguments.length?(e=Tg(r),i):e},i.parentId=function(r){return arguments.length?(t=Tg(r),i):t},i.path=function(r){return arguments.length?(n=Tg(r),i):n},i}function Sie(e){e=`${e}`;let t=e.length;return p_(e,t-1)&&!p_(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function ZF(e){let t=e.length;if(t<2)return"";for(;--t>1&&!p_(e,t););return e.slice(0,t)}function p_(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function Fie(e,t){return e.parent===t.parent?1:2}function g_(e){var t=e.children;return t?t[0]:e.t}function m_(e){var t=e.children;return t?t[t.length-1]:e.t}function Die(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function Tie(e){for(var t=0,n=0,i=e.children,r=i.length,s;--r>=0;)s=i[r],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function Mie(e,t,n){return e.a.parent===t.parent?e.a:n}function Rg(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}Rg.prototype=Object.create(Xl.prototype);function Nie(e){for(var t=new Rg(e,0),n,i=[t],r,s,o,a;n=i.pop();)if(s=n._.children)for(n.children=new Array(a=s.length),o=a-1;o>=0;--o)i.push(r=n.children[o]=new Rg(s[o],o)),r.parent=n;return(t.parent=new Rg(null,0)).children=[t],t}function Rie(){var e=Fie,t=1,n=1,i=null;function r(l){var c=Nie(l);if(c.eachAfter(s),c.parent.m=-c.z,c.eachBefore(o),i)l.eachBefore(u);else{var f=l,d=l,h=l;l.eachBefore(function(b){b.xd.x&&(d=b),b.depth>h.depth&&(h=b)});var p=f===d?1:e(f,d)/2,g=p-f.x,m=t/(d.x+p+g),y=n/(h.depth||1);l.eachBefore(function(b){b.x=(b.x+g)*m,b.y=b.depth*y})}return l}function s(l){var c=l.children,f=l.parent.children,d=l.i?f[l.i-1]:null;if(c){Tie(l);var h=(c[0].z+c[c.length-1].z)/2;d?(l.z=d.z+e(l._,d._),l.m=l.z-h):l.z=h}else d&&(l.z=d.z+e(l._,d._));l.parent.A=a(l,d,l.parent.A||f[0])}function o(l){l._.x=l.z+l.parent.m,l.m+=l.parent.m}function a(l,c,f){if(c){for(var d=l,h=l,p=c,g=d.parent.children[0],m=d.m,y=h.m,b=p.m,v=g.m,_;p=m_(p),d=g_(d),p&&d;)g=g_(g),h=m_(h),h.a=l,_=p.z+b-d.z-m+e(p._,d._),_>0&&(Die(Mie(p,l,f),l,_),m+=_,y+=_),b+=p.m,m+=d.m,v+=g.m,y+=h.m;p&&!m_(h)&&(h.t=p,h.m+=b-y),d&&!g_(g)&&(g.t=d,g.m+=m-v,f=l)}return f}function u(l){l.x*=t,l.y=l.depth*n}return r.separation=function(l){return arguments.length?(e=l,r):e},r.size=function(l){return arguments.length?(i=!1,t=+l[0],n=+l[1],r):i?null:[t,n]},r.nodeSize=function(l){return arguments.length?(i=!0,t=+l[0],n=+l[1],r):i?[t,n]:null},r}function Og(e,t,n,i,r){for(var s=e.children,o,a=-1,u=s.length,l=e.value&&(r-n)/e.value;++ab&&(b=l),k=m*m*x,v=Math.max(b/k,k/y),v>_){m-=l;break}_=v}o.push(u={value:m,dice:h1?i:1)},n}(KF);function Oie(){var e=QF,t=!1,n=1,i=1,r=[0],s=tu,o=tu,a=tu,u=tu,l=tu;function c(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(f),r=[0],t&&d.eachBefore(VF),d}function f(d){var h=r[d.depth],p=d.x0+h,g=d.y0+h,m=d.x1-h,y=d.y1-h;m=d-1){var b=s[f];b.x0=p,b.y0=g,b.x1=m,b.y1=y;return}for(var v=l[f],_=h/2+v,x=f+1,k=d-1;x>>1;l[w]<_?x=w+1:k=w}_-l[x-1]y-g){var F=h?(p*C+m*E)/h:m;c(f,x,E,p,g,F,y),c(x,d,C,F,g,m,y)}else{var S=h?(g*C+y*E)/h:y;c(f,x,E,p,g,m,S),c(x,d,C,p,S,m,y)}}}function Iie(e,t,n,i,r){(e.depth&1?Og:bd)(e,t,n,i,r)}const Pie=function e(t){function n(i,r,s,o,a){if((u=i._squarify)&&u.ratio===t)for(var u,l,c,f,d=-1,h,p=u.length,g=i.value;++d1?i:1)},n}(KF);function y_(e,t,n){const i={};return e.each(r=>{const s=r.data;n(s)&&(i[t(s)]=r)}),e.lookup=i,e}function b_(e){j.call(this,null,e)}b_.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const zie=e=>e.values;te(b_,j,{transform(e,t){t.source||W("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),s=this.value;return(!s||i||t.changed())&&(s&&s.each(o=>{o.children&&y0(o.data)&&r.rem.push(o.data)}),this.value=s=c_({values:se(e.keys).reduce((o,a)=>(o.key(a),o),Bie()).entries(r.source)},zie),n&&s.each(o=>{o.children&&(o=it(o.data),r.add.push(o),r.source.push(o))}),y_(s,Ae,Ae)),r.source.root=s,r}});function Bie(){const e=[],t={entries:r=>i(n(r,0),0),key:r=>(e.push(r),t)};function n(r,s){if(s>=e.length)return r;const o=r.length,a=e[s++],u={},l={};let c=-1,f,d,h;for(;++ce.length)return r;const o=[];for(const a in r)o.push({key:a,values:i(r[a],s)});return o}return t}function Ys(e){j.call(this,null,e)}const jie=(e,t)=>e.parent===t.parent?1:2;te(Ys,j,{transform(e,t){(!t.source||!t.source.root)&&W(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,s=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(Na(e.sort,o=>o.data)),Uie(n,this.params,e),n.separation&&n.separation(e.separation!==!1?jie:nl);try{this.value=n(r)}catch(o){W(o)}return r.each(o=>qie(o,i,s)),t.reflow(e.modified()).modifies(s).modifies("leaf")}});function Uie(e,t,n){for(let i,r=0,s=t.length;rs[Ae(o)]=1),i.each(o=>{const a=o.data,u=o.parent&&o.parent.data;u&&s[Ae(a)]&&s[Ae(u)]&&r.add.push(it({source:u,target:a}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,o=>s[Ae(o)]=1),n.forEach(o=>{(s[Ae(o.source)]||s[Ae(o.target)])&&r.mod.push(o)})),r}});const tD={binary:Lie,dice:bd,slice:Og,slicedice:Iie,squarify:QF,resquarify:Pie},$_=["x0","y0","x1","y1","depth","children"];function S_(e){Ys.call(this,e)}S_.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:$_.length,default:$_}]},te(S_,Ys,{layout(){const e=Oie();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{ue(tD,t)?e.tile(tD[t]):W("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:$_});const Wie=Object.freeze(Object.defineProperty({__proto__:null,nest:b_,pack:__,partition:w_,stratify:k_,tree:C_,treelinks:A_,treemap:S_},Symbol.toStringTag,{value:"Module"})),F_=4278190080;function Hie(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function Gie(e,t,n,i,r){const s=e.width,o=e.height,a=i||r,u=Ro(s,o).getContext("2d"),l=Ro(s,o).getContext("2d"),c=a&&Ro(s,o).getContext("2d");n.forEach(E=>Lg(u,E,!1)),Lg(l,t,!1),a&&Lg(c,t,!0);const f=D_(u,s,o),d=D_(l,s,o),h=a&&D_(c,s,o),p=e.bitmap(),g=a&&e.bitmap();let m,y,b,v,_,x,k,w;for(y=0;y{r.items.forEach(s=>Lg(e,s.items,n))}):Fi[i].draw(e,{items:n?t.map(Vie):t})}function Vie(e){const t=b0(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const Xs=5,Qn=31,vd=32,ea=new Uint32Array(vd+1),xr=new Uint32Array(vd+1);xr[0]=0,ea[0]=~xr[0];for(let e=1;e<=vd;++e)xr[e]=xr[e-1]<<1|1,ea[e]=~xr[e];function Yie(e,t){const n=new Uint32Array(~~((e*t+vd)/vd));function i(s,o){n[s]|=o}function r(s,o){n[s]&=o}return{array:n,get:(s,o)=>{const a=o*e+s;return n[a>>>Xs]&1<<(a&Qn)},set:(s,o)=>{const a=o*e+s;i(a>>>Xs,1<<(a&Qn))},clear:(s,o)=>{const a=o*e+s;r(a>>>Xs,~(1<<(a&Qn)))},getRange:(s,o,a,u)=>{let l=u,c,f,d,h;for(;l>=o;--l)if(c=l*e+s,f=l*e+a,d=c>>>Xs,h=f>>>Xs,d===h){if(n[d]&ea[c&Qn]&xr[(f&Qn)+1])return!0}else{if(n[d]&ea[c&Qn]||n[h]&xr[(f&Qn)+1])return!0;for(let p=d+1;p{let l,c,f,d,h;for(;o<=u;++o)if(l=o*e+s,c=o*e+a,f=l>>>Xs,d=c>>>Xs,f===d)i(f,ea[l&Qn]&xr[(c&Qn)+1]);else for(i(f,ea[l&Qn]),i(d,xr[(c&Qn)+1]),h=f+1;h{let l,c,f,d,h;for(;o<=u;++o)if(l=o*e+s,c=o*e+a,f=l>>>Xs,d=c>>>Xs,f===d)r(f,xr[l&Qn]|ea[(c&Qn)+1]);else for(r(f,xr[l&Qn]),r(d,ea[(c&Qn)+1]),h=f+1;hs<0||o<0||u>=t||a>=e}}function Xie(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),s=~~((t+2*n+i)/i),o=a=>~~((a+n)/i);return o.invert=a=>a*i-n,o.bitmap=()=>Yie(r,s),o.ratio=i,o.padding=n,o.width=e,o.height=t,o}function Zie(e,t,n,i){const r=e.width,s=e.height;return function(o){const a=o.datum.datum.items[i].items,u=a.length,l=o.datum.fontSize,c=Si.width(o.datum,o.datum.text);let f=0,d,h,p,g,m,y,b;for(let v=0;v=f&&(f=b,o.x=m,o.y=y);return m=c/2,y=l/2,d=o.x-m,h=o.x+m,p=o.y-y,g=o.y+y,o.align="center",d<0&&h<=r?o.align="left":0<=d&&rr||t-(o=i/2)<0||t+o>s}function ta(e,t,n,i,r,s,o,a){const u=r*s/(i*2),l=e(t-u),c=e(t+u),f=e(n-(s=s/2)),d=e(n+s);return o.outOfBounds(l,f,c,d)||o.getRange(l,f,c,d)||a&&a.getRange(l,f,c,d)}function Kie(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1];function u(l,c,f,d,h){const p=e.invert(l),g=e.invert(c);let m=f,y=s,b;if(!Ig(p,g,d,h,r,s)&&!ta(e,p,g,h,d,m,o,a)&&!ta(e,p,g,h,d,h,o,null)){for(;y-m>=1;)b=(m+y)/2,ta(e,p,g,h,d,b,o,a)?y=b:m=b;if(m>f)return[p,g,m,!0]}}return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Si.width(l.datum,l.datum.text);let p=n?d:0,g=!1,m=!1,y=0,b,v,_,x,k,w,E,C,F,S,z,P,T,A,M,B,V;for(let H=0;Hv&&(V=b,b=v,v=V),_>x&&(V=_,_=x,x=V),F=e(b),z=e(v),S=~~((F+z)/2),P=e(_),A=e(x),T=~~((P+A)/2),E=S;E>=F;--E)for(C=T;C>=P;--C)B=u(E,C,p,h,d),B&&([l.x,l.y,p,g]=B);for(E=S;E<=z;++E)for(C=T;C<=A;++C)B=u(E,C,p,h,d),B&&([l.x,l.y,p,g]=B);!g&&!n&&(M=Math.abs(v-b+x-_),k=(b+v)/2,w=(_+x)/2,M>=y&&!Ig(k,w,h,d,r,s)&&!ta(e,k,w,d,h,d,o,null)&&(y=M,l.x=k,l.y=w,m=!0))}return g||m?(k=h/2,w=d/2,o.setRange(e(l.x-k),e(l.y-w),e(l.x+k),e(l.y+w)),l.align="center",l.baseline="middle",!0):!1}}const Jie=[-1,-1,1,1],Qie=[-1,1,-1,1];function ere(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],u=e.bitmap();return function(l){const c=l.datum.datum.items[i].items,f=c.length,d=l.datum.fontSize,h=Si.width(l.datum,l.datum.text),p=[];let g=n?d:0,m=!1,y=!1,b=0,v,_,x,k,w,E,C,F,S,z,P,T;for(let A=0;A=1;)P=(S+z)/2,ta(e,w,E,d,h,P,o,a)?z=P:S=P;S>g&&(l.x=w,l.y=E,g=S,m=!0)}}!m&&!n&&(T=Math.abs(_-v+k-x),w=(v+_)/2,E=(x+k)/2,T>=b&&!Ig(w,E,h,d,r,s)&&!ta(e,w,E,d,h,d,o,null)&&(b=T,l.x=w,l.y=E,y=!0))}return m||y?(w=h/2,E=d/2,o.setRange(e(l.x-w),e(l.y-E),e(l.x+w),e(l.y+E)),l.align="center",l.baseline="middle",!0):!1}}const tre=["right","center","left"],nre=["bottom","middle","top"];function ire(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],u=i.length;return function(l){const c=l.boundary,f=l.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>r||c[3]>s)return!1;let d=l.textWidth??0,h,p,g,m,y,b,v,_,x,k,w,E,C,F,S;for(let z=0;z>>2&3)-1,g=h===0&&p===0||i[z]<0,m=h&&p?Math.SQRT1_2:1,y=i[z]<0?-1:1,b=c[1+h]+i[z]*h*m,w=c[4+p]+y*f*p/2+i[z]*p*m,_=w-f/2,x=w+f/2,E=e(b),F=e(_),S=e(x),!d)if(nD(E,E,F,S,o,a,b,b,_,x,c,g))d=Si.width(l.datum,l.datum.text);else continue;if(k=b+y*d*h/2,b=k-d/2,v=k+d/2,E=e(b),C=e(v),nD(E,C,F,S,o,a,b,v,_,x,c,g))return l.x=h?h*y<0?v:b:k,l.y=p?p*y<0?x:_:w,l.align=tre[h*y+1],l.baseline=nre[p*y+1],o.setRange(E,F,C,S),!0}return!1}}function nD(e,t,n,i,r,s,o,a,u,l,c,f){return!(r.outOfBounds(e,n,t,i)||(f&&s||r).getRange(e,n,t,i))}const T_=0,M_=4,N_=8,R_=0,O_=1,L_=2,rre={"top-left":T_+R_,top:T_+O_,"top-right":T_+L_,left:M_+R_,middle:M_+O_,right:M_+L_,"bottom-left":N_+R_,bottom:N_+O_,"bottom-right":N_+L_},sre={naive:Zie,"reduced-search":Kie,floodfill:ere};function ore(e,t,n,i,r,s,o,a,u,l,c){if(!e.length)return e;const f=Math.max(i.length,r.length),d=are(i,f),h=ure(r,f),p=lre(e[0].datum),g=p==="group"&&e[0].datum.items[u].marktype,m=g==="area",y=cre(p,g,a,u),b=l===null||l===1/0,v=m&&c==="naive";let _=-1,x=-1;const k=e.map(F=>{const S=b?Si.width(F,F.text):void 0;return _=Math.max(_,S),x=Math.max(x,F.fontSize),{datum:F,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(F),textWidth:S}});l=l===null||l===1/0?Math.max(_,x)+Math.max(...i):l;const w=Xie(t[0],t[1],l);let E;if(!v){n&&k.sort((z,P)=>n(z.datum,P.datum));let F=!1;for(let z=0;zz.datum);E=s.length||S?Gie(w,S||[],s,F,m):Hie(w,o&&k)}const C=m?sre[c](w,E,o,u):ire(w,E,h,d);return k.forEach(F=>F.opacity=+C(F)),k}function are(e,t){const n=new Float64Array(t),i=e.length;for(let r=0;r[s.x,s.x,s.x,s.y,s.y,s.y];return e?e==="line"||e==="area"?s=>r(s.datum):t==="line"?s=>{const o=s.datum.items[i].items;return r(o.length?o[n==="start"?0:o.length-1]:{x:NaN,y:NaN})}:s=>{const o=s.datum.bounds;return[o.x1,(o.x1+o.x2)/2,o.x2,o.y1,(o.y1+o.y2)/2,o.y2]}:r}const I_=["x","y","opacity","align","baseline"],iD=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function P_(e){j.call(this,null,e)}P_.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:iD},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:I_.length,default:I_}]},te(P_,j,{transform(e,t){function n(s){const o=e[s];return ze(o)&&t.modified(o.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&W("Size parameter should be specified as a [width, height] array.");const r=e.as||I_;return ore(t.materialize(t.SOURCE).source||[],e.size,e.sort,se(e.offset==null?1:e.offset),se(e.anchor||iD),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(s=>{const o=s.datum;o[r[0]]=s.x,o[r[1]]=s.y,o[r[2]]=s.opacity,o[r[3]]=s.align,o[r[4]]=s.baseline}),t.reflow(i).modifies(r)}});const fre=Object.freeze(Object.defineProperty({__proto__:null,label:P_},Symbol.toStringTag,{value:"Module"}));function rD(e,t){var n=[],i=function(c){return c(a)},r,s,o,a,u,l;if(t==null)n.push(e);else for(r={},s=0,o=e.length;s{rE(l,e.x,e.y,e.bandwidth||.3).forEach(c=>{const f={};for(let d=0;de==="poly"?t:e==="quad"?2:1;function j_(e){j.call(this,null,e)}j_.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(B_)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]},te(j_,j,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=rD(i,e.groupby),s=(e.groupby||[]).map(Rt),o=e.method||"linear",a=e.order==null?3:e.order,u=dre(o,a),l=e.as||[Rt(e.x),Rt(e.y)],c=B_[o],f=[];let d=e.extent;ue(B_,o)||W("Invalid regression method: "+o),d!=null&&o==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),r.forEach(h=>{if(h.length<=u){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=c(h,e.x,e.y,a);if(e.params){f.push(it({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||Wr(h,e.x),y=b=>{const v={};for(let _=0;_y([b,g.predict(b)])):S0(g.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const hre=Object.freeze(Object.defineProperty({__proto__:null,loess:z_,regression:j_},Symbol.toStringTag,{value:"Module"})),Zs=11102230246251565e-32,Rn=134217729,pre=(3+8*Zs)*Zs;function U_(e,t,n,i,r){let s,o,a,u,l=t[0],c=i[0],f=0,d=0;c>l==c>-l?(s=l,l=t[++f]):(s=c,c=i[++d]);let h=0;if(fl==c>-l?(o=l+s,a=s-(o-l),l=t[++f]):(o=c+s,a=s-(o-c),c=i[++d]),s=o,a!==0&&(r[h++]=a);fl==c>-l?(o=s+l,u=o-s,a=s-(o-u)+(l-u),l=t[++f]):(o=s+c,u=o-s,a=s-(o-u)+(c-u),c=i[++d]),s=o,a!==0&&(r[h++]=a);for(;f=T||-P>=T||(f=e-C,a=e-(C+f)+(f-r),f=n-F,l=n-(F+f)+(f-r),f=t-S,u=t-(S+f)+(f-s),f=i-z,c=i-(z+f)+(f-s),a===0&&u===0&&l===0&&c===0)||(T=bre*o+pre*Math.abs(P),P+=C*c+z*a-(S*l+F*u),P>=T||-P>=T))return P;_=a*z,d=Rn*a,h=d-(d-a),p=a-h,d=Rn*z,g=d-(d-z),m=z-g,x=p*m-(_-h*g-p*g-h*m),k=u*F,d=Rn*u,h=d-(d-u),p=u-h,d=Rn*F,g=d-(d-F),m=F-g,w=p*m-(k-h*g-p*g-h*m),y=x-w,f=x-y,ei[0]=x-(y+f)+(f-w),b=_+y,f=b-_,v=_-(b-f)+(y-f),y=v-k,f=v-y,ei[1]=v-(y+f)+(f-k),E=b+y,f=E-b,ei[2]=b-(E-f)+(y-f),ei[3]=E;const A=U_(4,Kl,4,ei,sD);_=C*c,d=Rn*C,h=d-(d-C),p=C-h,d=Rn*c,g=d-(d-c),m=c-g,x=p*m-(_-h*g-p*g-h*m),k=S*l,d=Rn*S,h=d-(d-S),p=S-h,d=Rn*l,g=d-(d-l),m=l-g,w=p*m-(k-h*g-p*g-h*m),y=x-w,f=x-y,ei[0]=x-(y+f)+(f-w),b=_+y,f=b-_,v=_-(b-f)+(y-f),y=v-k,f=v-y,ei[1]=v-(y+f)+(f-k),E=b+y,f=E-b,ei[2]=b-(E-f)+(y-f),ei[3]=E;const M=U_(A,sD,4,ei,oD);_=a*c,d=Rn*a,h=d-(d-a),p=a-h,d=Rn*c,g=d-(d-c),m=c-g,x=p*m-(_-h*g-p*g-h*m),k=u*l,d=Rn*u,h=d-(d-u),p=u-h,d=Rn*l,g=d-(d-l),m=l-g,w=p*m-(k-h*g-p*g-h*m),y=x-w,f=x-y,ei[0]=x-(y+f)+(f-w),b=_+y,f=b-_,v=_-(b-f)+(y-f),y=v-k,f=v-y,ei[1]=v-(y+f)+(f-k),E=b+y,f=E-b,ei[2]=b-(E-f)+(y-f),ei[3]=E;const B=U_(M,oD,4,ei,aD);return aD[B-1]}function Pg(e,t,n,i,r,s){const o=(t-s)*(n-r),a=(e-r)*(i-s),u=o-a,l=Math.abs(o+a);return Math.abs(u)>=mre*l?u:-vre(e,t,n,i,r,s,l)}const uD=Math.pow(2,-52),zg=new Uint32Array(512);class Bg{static from(t,n=Ere,i=Cre){const r=t.length,s=new Float64Array(r*2);for(let o=0;o>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const i=Math.max(2*n-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:i,_hullTri:r,_hullHash:s}=this,o=t.length>>1;let a=1/0,u=1/0,l=-1/0,c=-1/0;for(let C=0;Cl&&(l=F),S>c&&(c=S),this._ids[C]=C}const f=(a+l)/2,d=(u+c)/2;let h,p,g;for(let C=0,F=1/0;C0&&(p=C,F=S)}let b=t[2*p],v=t[2*p+1],_=1/0;for(let C=0;Cz&&(C[F++]=P,z=T)}this.hull=C.subarray(0,F),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Pg(m,y,b,v,x,k)<0){const C=p,F=b,S=v;p=g,b=x,v=k,g=C,x=F,k=S}const w=kre(m,y,b,v,x,k);this._cx=w.x,this._cy=w.y;for(let C=0;C0&&Math.abs(P-F)<=uD&&Math.abs(T-S)<=uD||(F=P,S=T,z===h||z===p||z===g))continue;let A=0;for(let oe=0,ke=this._hashKey(P,T);oe=0;)if(M=B,M===A){M=-1;break}if(M===-1)continue;let V=this._addTriangle(M,z,i[M],-1,-1,r[M]);r[z]=this._legalize(V+2),r[M]=V,E++;let H=i[M];for(;B=i[H],Pg(P,T,t[2*H],t[2*H+1],t[2*B],t[2*B+1])<0;)V=this._addTriangle(H,z,B,r[z],-1,r[H]),r[z]=this._legalize(V+2),i[H]=H,E--,H=B;if(M===A)for(;B=n[M],Pg(P,T,t[2*B],t[2*B+1],t[2*M],t[2*M+1])<0;)V=this._addTriangle(B,z,M,-1,r[M],r[B]),this._legalize(V+2),r[B]=V,i[M]=M,E--,M=B;this._hullStart=n[z]=M,i[M]=n[H]=z,i[z]=H,s[this._hashKey(P,T)]=z,s[this._hashKey(t[2*M],t[2*M+1])]=M}this.hull=new Uint32Array(E);for(let C=0,F=this._hullStart;C0?3-n:1+n)/4}function q_(e,t,n,i){const r=e-n,s=t-i;return r*r+s*s}function xre(e,t,n,i,r,s,o,a){const u=e-o,l=t-a,c=n-o,f=i-a,d=r-o,h=s-a,p=u*u+l*l,g=c*c+f*f,m=d*d+h*h;return u*(f*m-g*h)-l*(c*m-g*d)+p*(c*h-f*d)<0}function wre(e,t,n,i,r,s){const o=n-e,a=i-t,u=r-e,l=s-t,c=o*o+a*a,f=u*u+l*l,d=.5/(o*l-a*u),h=(l*c-a*f)*d,p=(o*f-u*c)*d;return h*h+p*p}function kre(e,t,n,i,r,s){const o=n-e,a=i-t,u=r-e,l=s-t,c=o*o+a*a,f=u*u+l*l,d=.5/(o*l-a*u),h=e+(l*c-a*f)*d,p=t+(o*f-u*c)*d;return{x:h,y:p}}function Jl(e,t,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const s=e[r],o=t[s];let a=r-1;for(;a>=n&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=s}else{const r=n+i>>1;let s=n+1,o=i;xd(e,r,s),t[e[n]]>t[e[i]]&&xd(e,n,i),t[e[s]]>t[e[i]]&&xd(e,s,i),t[e[n]]>t[e[s]]&&xd(e,n,s);const a=e[s],u=t[a];for(;;){do s++;while(t[e[s]]u);if(o=o-n?(Jl(e,t,s,i),Jl(e,t,n,o-1)):(Jl(e,t,n,o-1),Jl(e,t,s,i))}}function xd(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function Ere(e){return e[0]}function Cre(e){return e[1]}const lD=1e-6;class nu{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,i){t=+t,n=+n,i=+i;const r=t+i,s=n;if(i<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${s}`:(Math.abs(this._x1-r)>lD||Math.abs(this._y1-s)>lD)&&(this._+="L"+r+","+s),i&&(this._+=`A${i},${i},0,1,1,${t-i},${n}A${i},${i},0,1,1,${this._x1=r},${this._y1=s}`)}rect(t,n,i,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+i}v${+r}h${-i}Z`}value(){return this._||null}}class W_{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}let Are=class{constructor(t,[n,i,r,s]=[0,0,960,500]){if(!((r=+r)>=(n=+n))||!((s=+s)>=(i=+i)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=r,this.xmin=n,this.ymax=s,this.ymin=i,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:i},vectors:r}=this;let s,o;const a=this.circumcenters=this._circumcenters.subarray(0,i.length/3*2);for(let g=0,m=0,y=i.length,b,v;g1;)s-=2;for(let o=2;o0){if(n>=this.ymax)return null;(o=(this.ymax-n)/r)0){if(t>=this.xmax)return null;(o=(this.xmax-t)/i)this.xmax?2:0)|(nthis.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n1e-10)return!1}return!0}function Tre(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class H_{static from(t,n=Sre,i=Fre,r){return new H_("length"in t?Mre(t,n,i,r):Float64Array.from(Nre(t,n,i,r)))}constructor(t){this._delaunator=new Bg(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&Dre(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const u=this.collinear[0],l=this.collinear[this.collinear.length-1],c=[n[2*u],n[2*u+1],n[2*l],n[2*l+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,h=n.length/2;d0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,r.length===2&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new Are(this,t)}*neighbors(t){const{inedges:n,hull:i,_hullIndex:r,halfedges:s,triangles:o,collinear:a}=this;if(a){const f=a.indexOf(t);f>0&&(yield a[f-1]),f=0&&s!==i&&s!==r;)i=s;return s}_step(t,n,i){const{inedges:r,hull:s,_hullIndex:o,halfedges:a,triangles:u,points:l}=this;if(r[t]===-1||!l.length)return(t+1)%(l.length>>1);let c=t,f=Ql(n-l[t*2],2)+Ql(i-l[t*2+1],2);const d=r[t];let h=d;do{let p=u[h];const g=Ql(n-l[p*2],2)+Ql(i-l[p*2+1],2);if(g>5)*e[1]),m=null,y=l.length,b=-1,v=[],_=l.map(k=>({text:t(k),font:n(k),style:r(k),weight:s(k),rotate:o(k),size:~~(i(k)+1e-14),padding:a(k),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:k})).sort((k,w)=>w.size-k.size);++b>1,x.y=e[1]*(c()+.5)>>1,zre(p,x,_,b),x.hasText&&h(g,x,m)&&(v.push(x),m?jre(m,x):m=[{x:x.x+x.x0,y:x.y+x.y0},{x:x.x+x.x1,y:x.y+x.y1}],x.x-=e[0]>>1,x.y-=e[1]>>1)}return v};function d(p){p.width=p.height=1;var g=Math.sqrt(p.getContext("2d").getImageData(0,0,1,1).data.length>>2);p.width=(wd<<5)/g,p.height=jg/g;var m=p.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:g}}function h(p,g,m){for(var y=g.x,b=g.y,v=Math.hypot(e[0],e[1]),_=u(e),x=c()<.5?1:-1,k=-x,w,E,C;(w=_(k+=x))&&(E=~~w[0],C=~~w[1],!(Math.min(Math.abs(E),Math.abs(C))>=v));)if(g.x=y+E,g.y=b+C,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>e[0]||g.y+g.y1>e[1])&&(!m||!Bre(g,p,e[0]))&&(!m||Ure(g,m))){for(var F=g.sprite,S=g.width>>5,z=e[0]>>5,P=g.x-(S<<4),T=P&127,A=32-T,M=g.y1-g.y0,B=(g.y+g.y0)*z+(P>>5),V,H=0;H>>T:0);B+=z}return g.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(l=p,f):l},f.size=function(p){return arguments.length?(e=[+p[0],+p[1]],f):e},f.font=function(p){return arguments.length?(n=iu(p),f):n},f.fontStyle=function(p){return arguments.length?(r=iu(p),f):r},f.fontWeight=function(p){return arguments.length?(s=iu(p),f):s},f.rotate=function(p){return arguments.length?(o=iu(p),f):o},f.text=function(p){return arguments.length?(t=iu(p),f):t},f.spiral=function(p){return arguments.length?(u=Hre[p]||p,f):u},f.fontSize=function(p){return arguments.length?(i=iu(p),f):i},f.padding=function(p){return arguments.length?(a=iu(p),f):a},f.random=function(p){return arguments.length?(c=p,f):c},f}function zre(e,t,n,i){if(!t.sprite){var r=e.context,s=e.ratio;r.clearRect(0,0,(wd<<5)/s,jg/s);var o=0,a=0,u=0,l=n.length,c,f,d,h,p;for(--i;++i>5<<5,d=~~Math.max(Math.abs(b+v),Math.abs(b-v))}else c=c+31>>5<<5;if(d>u&&(u=d),o+c>=wd<<5&&(o=0,a+=u,u=0),a+d>=jg)break;r.translate((o+(c>>1))/s,(a+(d>>1))/s),t.rotate&&r.rotate(t.rotate*V_),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=c,t.height=d,t.xoff=o,t.yoff=a,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,o+=c}for(var x=r.getImageData(0,0,(wd<<5)/s,jg/s).data,k=[];--i>=0;)if(t=n[i],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,h=0;h>5),F=x[(a+p)*(wd<<5)+(o+h)<<2]?1<<31-h%32:0;k[C]|=F,w|=F}w?E=p:(t.y0++,d--,p--,a++)}t.y1=t.y0+E,t.sprite=k.slice(0,(t.y1-t.y0)*f)}}}function Bre(e,t,n){n>>=5;for(var i=e.sprite,r=e.width>>5,s=e.x-(r<<4),o=s&127,a=32-o,u=e.y1-e.y0,l=(e.y+e.y0)*n+(s>>5),c,f=0;f>>o:0))&t[l+d])return!0;l+=n}return!1}function jre(e,t){var n=e[0],i=e[1];t.x+t.x0i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function Ure(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0t[0].y&&e.y+e.y0g(p(m))}r.forEach(p=>{p[o[0]]=NaN,p[o[1]]=NaN,p[o[3]]=0});const l=s.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(a).random(Wi).layout(),c=s.size(),f=c[0]>>1,d=c[1]>>1,h=l.length;for(let p=0,g,m;pnew Uint8Array(e),Xre=e=>new Uint16Array(e),kd=e=>new Uint32Array(e);function Zre(){let e=8,t=[],n=kd(0),i=Ug(0,e),r=Ug(0,e);return{data:()=>t,seen:()=>n=Kre(n,t.length),add(s){for(let o=0,a=t.length,u=s.length,l;ot.length,curr:()=>i,prev:()=>r,reset:s=>r[s]=i[s],all:()=>e<257?255:e<65537?65535:4294967295,set(s,o){i[s]|=o},clear(s,o){i[s]&=~o},resize(s,o){const a=i.length;(s>a||o>e)&&(e=Math.max(o,e),i=Ug(s,e,i),r=Ug(s,e))}}}function Kre(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function Ug(e,t,n){const i=(t<257?Yre:t<65537?Xre:kd)(e);return n&&i.set(n),i}function dD(e,t,n){const i=1<0)for(m=0;me,size:()=>n}}function Jre(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],s=e[i];return rs?1:0}),pW(e,t)}function Qre(e,t,n,i,r,s,o,a,u){let l=0,c=0,f;for(f=0;lt.modified(i.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},s=this._dims=[],o=i.length;let a=0,u,l;for(;a{const s=r.remove(t,n);for(const o in i)i[o].reindex(s)})},update(e,t,n){const i=this._dims,r=e.query,s=t.stamp,o=i.length;let a=0,u,l;for(n.filters=0,l=0;lh)for(m=h,y=Math.min(f,p);mp)for(m=Math.max(f,p),y=d;mf)for(p=f,g=Math.min(l,d);pd)for(p=Math.max(l,d),g=c;pa[c]&n?null:o[c];return s.filter(s.MOD,l),r&r-1?(s.filter(s.ADD,c=>{const f=a[c]&n;return!f&&f^u[c]&n?o[c]:null}),s.filter(s.REM,c=>{const f=a[c]&n;return f&&!(f^(f^u[c]&n))?o[c]:null})):(s.filter(s.ADD,l),s.filter(s.REM,c=>(a[c]&n)===r?o[c]:null)),s.filter(s.SOURCE,c=>l(c._index))}});const ese=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:X_,resolvefilter:Z_},Symbol.toStringTag,{value:"Module"})),tse="RawCode",ru="Literal",nse="Property",ise="Identifier",rse="ArrayExpression",sse="BinaryExpression",pD="CallExpression",ose="ConditionalExpression",ase="LogicalExpression",use="MemberExpression",lse="ObjectExpression",cse="UnaryExpression";function wr(e){this.type=e}wr.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=fse(this),n=0,i=t.length;n",us[su]="Identifier",us[na]="Keyword",us[Wg]="Null",us[ou]="Numeric",us[di]="Punctuator",us[Cd]="String",us[dse]="RegularExpression";var hse="ArrayExpression",pse="BinaryExpression",gse="CallExpression",mse="ConditionalExpression",gD="Identifier",yse="Literal",bse="LogicalExpression",vse="MemberExpression",_se="ObjectExpression",xse="Property",wse="UnaryExpression",tn="Unexpected token %0",kse="Unexpected number",Ese="Unexpected string",Cse="Unexpected identifier",Ase="Unexpected reserved word",$se="Unexpected end of input",K_="Invalid regular expression",J_="Invalid regular expression: missing /",mD="Octal literals are not allowed in strict mode.",Sse="Duplicate data property in object literal not allowed in strict mode",pn="ILLEGAL",Ad="Disabled.",Fse=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),Dse=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function Hg(e,t){if(!e)throw new Error("ASSERT: "+t)}function Ks(e){return e>=48&&e<=57}function Q_(e){return"0123456789abcdefABCDEF".includes(e)}function $d(e){return"01234567".includes(e)}function Tse(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function Sd(e){return e===10||e===13||e===8232||e===8233}function Fd(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&Fse.test(String.fromCharCode(e))}function Gg(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&Dse.test(String.fromCharCode(e))}const Mse={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function yD(){for(;U1114111||e!=="}")&&tt({},tn,pn),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function bD(){var e,t;for(e=me.charCodeAt(U++),t=String.fromCharCode(e),e===92&&(me.charCodeAt(U)!==117&&tt({},tn,pn),++U,e=e7("u"),(!e||e==="\\"||!Fd(e.charCodeAt(0)))&&tt({},tn,pn),t=e);U>>=")return U+=4,{type:di,value:o,start:e,end:U};if(s=o.substr(0,3),s===">>>"||s==="<<="||s===">>=")return U+=3,{type:di,value:s,start:e,end:U};if(r=s.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return U+=2,{type:di,value:r,start:e,end:U};if(r==="//"&&tt({},tn,pn),"<>=!+-*%&|^/".includes(i))return++U,{type:di,value:i,start:e,end:U};tt({},tn,pn)}function Lse(e){let t="";for(;U{if(parseInt(r,16)<=1114111)return"x";tt({},K_)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{tt({},K_)}try{return new RegExp(e,t)}catch{return null}}function Bse(){var e,t,n,i,r;for(e=me[U],Hg(e==="/","Regular expression literal must start with a slash"),t=me[U++],n=!1,i=!1;U=0&&tt({},K_,n),{value:n,literal:t}}function Use(){var e,t,n,i;return ut=null,yD(),e=U,t=Bse(),n=jse(),i=zse(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:U}}function qse(e){return e.type===su||e.type===na||e.type===qg||e.type===Wg}function _D(){if(yD(),U>=On)return{type:Ed,start:U,end:U};const e=me.charCodeAt(U);return Fd(e)?Ose():e===40||e===41||e===59?t7():e===39||e===34?Pse():e===46?Ks(me.charCodeAt(U+1))?vD():t7():Ks(e)?vD():t7()}function hi(){const e=ut;return U=e.end,ut=_D(),U=e.end,e}function xD(){const e=U;ut=_D(),U=e}function Wse(e){const t=new wr(hse);return t.elements=e,t}function wD(e,t,n){const i=new wr(e==="||"||e==="&&"?bse:pse);return i.operator=e,i.left=t,i.right=n,i}function Hse(e,t){const n=new wr(gse);return n.callee=e,n.arguments=t,n}function Gse(e,t,n){const i=new wr(mse);return i.test=e,i.consequent=t,i.alternate=n,i}function n7(e){const t=new wr(gD);return t.name=e,t}function Dd(e){const t=new wr(yse);return t.value=e.value,t.raw=me.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function kD(e,t,n){const i=new wr(vse);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function Vse(e){const t=new wr(_se);return t.properties=e,t}function ED(e,t,n){const i=new wr(xse);return i.key=t,i.value=n,i.kind=e,i}function Yse(e,t){const n=new wr(wse);return n.operator=e,n.argument=t,n.prefix=!0,n}function tt(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(s,o)=>(Hg(o":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function ooe(){var e,t,n,i,r,s,o,a,u,l;if(e=ut,u=Yg(),i=ut,r=$D(i),r===0)return u;for(i.prec=r,hi(),t=[e,ut],o=Yg(),s=[u,i,o];(r=$D(ut))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)o=s.pop(),a=s.pop().value,u=s.pop(),t.pop(),n=wD(a,u,o),s.push(n);i=hi(),i.prec=r,s.push(i),t.push(ut),n=Yg(),s.push(n)}for(l=s.length-1,n=s[l],t.pop();l>1;)t.pop(),n=wD(s[l-1].value,s[l-2],n),l-=2;return n}function au(){var e,t,n;return e=ooe(),kt("?")&&(hi(),t=au(),Ln(":"),n=au(),e=Gse(e,t,n)),e}function r7(){const e=au();if(kt(","))throw new Error(Ad);return e}function SD(e){me=e,U=0,On=me.length,ut=null,xD();const t=r7();if(ut.type!==Ed)throw new Error("Unexpect token after expression.");return t}var FD={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function DD(e){function t(o,a,u,l){let c=e(a[0]);return u&&(c=u+"("+c+")",u.lastIndexOf("new ",0)===0&&(c="("+c+")")),c+"."+o+(l<0?"":l===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(o,a,u){return l=>t(o,l,a,u)}const i="new Date",r="String",s="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(o){o.length<3&&W("Missing arguments to clamp function."),o.length>3&&W("Too many arguments to clamp function.");const a=o.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:n("getDate",i,0),day:n("getDay",i,0),year:n("getFullYear",i,0),month:n("getMonth",i,0),hours:n("getHours",i,0),minutes:n("getMinutes",i,0),seconds:n("getSeconds",i,0),milliseconds:n("getMilliseconds",i,0),time:n("getTime",i,0),timezoneoffset:n("getTimezoneOffset",i,0),utcdate:n("getUTCDate",i,0),utcday:n("getUTCDay",i,0),utcyear:n("getUTCFullYear",i,0),utcmonth:n("getUTCMonth",i,0),utchours:n("getUTCHours",i,0),utcminutes:n("getUTCMinutes",i,0),utcseconds:n("getUTCSeconds",i,0),utcmilliseconds:n("getUTCMilliseconds",i,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",r,0),lower:n("toLowerCase",r,0),substring:n("substring",r),split:n("split",r),trim:n("trim",r,0),btoa:"btoa",atob:"atob",regexp:s,test:n("test",s),if:function(o){o.length<3&&W("Missing arguments to if function."),o.length>3&&W("Too many arguments to if function.");const a=o.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function aoe(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function TD(e){e=e||{};const t=e.allowed?fr(e.allowed):{},n=e.forbidden?fr(e.forbidden):{},i=e.constants||FD,r=(e.functions||DD)(f),s=e.globalvar,o=e.fieldvar,a=ze(s)?s:p=>`${s}["${p}"]`;let u={},l={},c=0;function f(p){if(re(p))return p;const g=d[p.type];return g==null&&W("Unsupported type: "+p.type),g(p)}const d={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return c>0?g:ue(n,g)?W("Illegal identifier: "+g):ue(i,g)?i[g]:ue(t,g)?g:(u[g]=1,a(g))},MemberExpression:p=>{const g=!p.computed,m=f(p.object);g&&(c+=1);const y=f(p.property);return m===o&&(l[aoe(y)]=1),g&&(c-=1),m+(g?"."+y:"["+y+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&W("Illegal callee type: "+p.callee.type);const g=p.callee.name,m=p.arguments,y=ue(r,g)&&r[g];return y||W("Unrecognized function: "+g),ze(y)?y(m):y+"("+m.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>"{"+p.properties.map(f).join(",")+"}",Property:p=>{c+=1;const g=f(p.key);return c-=1,g+":"+f(p.value)}};function h(p){const g={code:f(p),globals:Object.keys(u),fields:Object.keys(l)};return u={},l={},g}return h.functions=r,h.constants=i,h}const MD=Symbol("vega_selection_getter");function ND(e){return(!e.getter||!e.getter[MD])&&(e.getter=Bi(e.field),e.getter[MD]=!0),e.getter}const s7="intersect",RD="union",uoe="vlMulti",loe="vlPoint",OD="or",coe="and",ls="_vgsid_",Td=Bi(ls),foe="E",doe="R",hoe="R-E",poe="R-LE",goe="R-RE",moe="E-LT",yoe="E-LTE",boe="E-GT",voe="E-GTE",_oe="E-VALID",xoe="E-ONE",Xg="index:unit";function LD(e,t){for(var n=t.fields,i=t.values,r=n.length,s=0,o,a;s=i[s])return!1}else if(a.type===yoe){if(o>i[s])return!1}else if(a.type===boe){if(o<=i[s])return!1}else if(a.type===voe){if(oBe(t.fields?{values:t.fields.map(i=>ND(i)(n.datum))}:{[ls]:Td(n.datum)},t))}function $oe(e,t,n,i){for(var r=this.context.data[e],s=r?r.values.value:[],o={},a={},u={},l,c,f,d,h,p,g,m,y,b,v=s.length,_=0,x,k;_(w[c[C].field]=E,w),{})))}else h=ls,p=Td(l),g=o[h]||(o[h]={}),m=g[d]||(g[d]=[]),m.push(p),n&&(m=a[d]||(a[d]=[]),m.push({[ls]:p}));if(t=t||RD,o[ls]?o[ls]=o7[`${ls}_${t}`](...Object.values(o[ls])):Object.keys(o).forEach(w=>{o[w]=Object.keys(o[w]).map(E=>o[w][E]).reduce((E,C)=>E===void 0?C:o7[`${u[w]}_${t}`](E,C))}),s=Object.keys(a),n&&s.length){const w=i?loe:uoe;o[w]=t===RD?{[OD]:s.reduce((E,C)=>(E.push(...a[C]),E),[])}:{[coe]:s.map(E=>({[OD]:a[E]}))}}return o}var o7={[`${ls}_union`]:kW,[`${ls}_intersect`]:xW,E_union:function(e,t){if(!e.length)return t;for(var n=0,i=t.length;nt.includes(n)):t},R_union:function(e,t){var n=An(t[0]),i=An(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]i&&(n=t[1],i=t[0]),e.length?ii&&(e[1]=i),e):[n,i]}};const Soe=":",Foe="@";function a7(e,t,n,i){t[0].type!==ru&&W("First argument to selection functions must be a string literal.");const r=t[0].value,s=t.length>=2&&Ye(t).value,o="unit",a=Foe+o,u=Soe+r;s===s7&&!ue(i,a)&&(i[a]=n.getData(r).indataRef(n,o)),ue(i,u)||(i[u]=n.getData(r).tuplesRef())}function PD(e){const t=this.context.data[e];return t?t.values.value:[]}function Doe(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r&&r.count}function Toe(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;return n.pulse(r,n.changeset().remove(ji).insert(t)),1}function Moe(e,t,n){if(e){const i=this.context.dataflow,r=e.mark.source;i.pulse(r,i.changeset().encode(e,t))}return n!==void 0?n:e}const Md=e=>function(t,n){const i=this.context.dataflow.locale();return t===null?"null":i[e](n)(t)},Noe=Md("format"),zD=Md("timeFormat"),Roe=Md("utcFormat"),Ooe=Md("timeParse"),Loe=Md("utcParse"),Zg=new Date(2e3,0,1);function Kg(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(Zg.setYear(2e3),Zg.setMonth(e),Zg.setDate(t),zD.call(this,Zg,n))}function Ioe(e){return Kg.call(this,e,1,"%B")}function Poe(e){return Kg.call(this,e,1,"%b")}function zoe(e){return Kg.call(this,0,2+e,"%A")}function Boe(e){return Kg.call(this,0,2+e,"%a")}const joe=":",Uoe="@",u7="%",BD="$";function l7(e,t,n,i){t[0].type!==ru&&W("First argument to data functions must be a string literal.");const r=t[0].value,s=joe+r;if(!ue(s,i))try{i[s]=n.getData(r).tuplesRef()}catch{}}function qoe(e,t,n,i){t[0].type!==ru&&W("First argument to indata must be a string literal."),t[1].type!==ru&&W("Second argument to indata must be a string literal.");const r=t[0].value,s=t[1].value,o=Uoe+s;ue(o,i)||(i[o]=n.getData(r).indataRef(n,s))}function ti(e,t,n,i){if(t[0].type===ru)jD(n,i,t[0].value);else for(e in n.scales)jD(n,i,e)}function jD(e,t,n){const i=u7+n;if(!ue(t,i))try{t[i]=e.scaleRef(n)}catch{}}function cs(e,t){if(re(e)){const n=t.scales[e];return n&&m9(n.value)?n.value:void 0}else if(ze(e))return m9(e)?e:void 0}function Woe(e,t,n){t.__bandwidth=r=>r&&r.bandwidth?r.bandwidth():0,n._bandwidth=ti,n._range=ti,n._scale=ti;const i=r=>"_["+(r.type===ru?ee(u7+r.value):ee(u7)+"+"+e(r))+"]";return{_bandwidth:r=>`this.__bandwidth(${i(r[0])})`,_range:r=>`${i(r[0])}.range()`,_scale:r=>`${i(r[0])}(${e(r[1])})`}}function c7(e,t){return function(n,i,r){if(n){const s=cs(n,(r||this).context);return s&&s.path[e](i)}else return t(i)}}const Hoe=c7("area",lee),Goe=c7("bounds",hee),Voe=c7("centroid",vee);function Yoe(e,t){const n=cs(e,(t||this).context);return n&&n.scale()}function Xoe(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n}function f7(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function Zoe(){return f7(this.context.dataflow,"warn",arguments)}function Koe(){return f7(this.context.dataflow,"info",arguments)}function Joe(){return f7(this.context.dataflow,"debug",arguments)}function d7(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function h7(e){const t=Io(e),n=d7(t.r),i=d7(t.g),r=d7(t.b);return .2126*n+.7152*i+.0722*r}function Qoe(e,t){const n=h7(e),i=h7(t),r=Math.max(n,i),s=Math.min(n,i);return(r+.05)/(s+.05)}function eae(){const e=[].slice.call(arguments);return e.unshift({}),Be(...e)}function UD(e,t){return e===t||e!==e&&t!==t?!0:G(e)?G(t)&&e.length===t.length?tae(e,t):!1:ie(e)&&ie(t)?qD(e,t):!1}function tae(e,t){for(let n=0,i=e.length;nqD(e,t)}function nae(e,t,n,i,r,s){const o=this.context.dataflow,a=this.context.data[e],u=a.input,l=o.stamp();let c=a.changes,f,d;if(o._trigger===!1||!(u.value.length||t||i))return 0;if((!c||c.stamp{a.modified=!0,o.pulse(u,c).run()},!0,1)),n&&(f=n===!0?ji:G(n)||y0(n)?n:WD(n),c.remove(f)),t&&c.insert(t),i&&(f=WD(i),u.value.some(f)?c.remove(f):c.insert(i)),r)for(d in s)c.modify(r,d,s[d]);return 1}function iae(e){const t=e.touches,n=t[0].clientX-t[1].clientX,i=t[0].clientY-t[1].clientY;return Math.hypot(n,i)}function rae(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const HD={};function sae(e,t){const n=HD[t]||(HD[t]=Bi(t));return G(e)?e.map(n):n(e)}function Jg(e){return G(e)||ArrayBuffer.isView(e)?e:null}function p7(e){return Jg(e)||(re(e)?e:null)}function oae(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i1?t-1:0),i=1;i1?t-1:0),i=1;i1?t-1:0),i=1;is.stop(l(c),e(c))),s}function xae(e,t,n){const i=cs(e,(n||this).context);return function(r){return i?i.path.context(r)(t):""}}function wae(e){let t=null;return function(n){return n?Tf(n,t=t||Ml(e)):e}}const GD=e=>e.data;function VD(e,t){const n=PD.call(t,e);return n.root&&n.root.lookup||{}}function kae(e,t,n){const i=VD(e,this),r=i[t],s=i[n];return r&&s?r.path(s).map(GD):void 0}function Eae(e,t){const n=VD(e,this)[t];return n?n.ancestors().map(GD):void 0}const YD=()=>typeof window<"u"&&window||null;function Cae(){const e=YD();return e?e.screen:{}}function Aae(){const e=YD();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function $ae(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function XD(e,t,n){if(!e)return[];const[i,r]=e,s=new qt().set(i[0],i[1],r[0],r[1]),o=n||this.context.dataflow.scenegraph().root;return s$(o,s,Sae(t))}function Sae(e){let t=null;if(e){const n=se(e.marktype),i=se(e.markname);t=r=>(!n.length||n.some(s=>r.marktype===s))&&(!i.length||i.some(s=>r.name===s))}return t}function Fae(e,t,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5;e=se(e);const r=e[e.length-1];return r===void 0||Math.hypot(r[0]-t,r[1]-n)>i?[...e,[t,n]]:e}function Dae(e){return se(e).reduce((t,n,i)=>{let[r,s]=n;return t+=i==0?`M ${r},${s} `:i===e.length-1?" Z":`L ${r},${s} `},"")}function Tae(e,t,n){const{x:i,y:r,mark:s}=n,o=new qt().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[u,l]of t)uo.x2&&(o.x2=u),lo.y2&&(o.y2=l);return o.translate(i,r),XD([[o.x1,o.y1],[o.x2,o.y2]],e,s).filter(u=>Mae(u.x,u.y,t))}function Mae(e,t,n){let i=0;for(let r=0,s=n.length-1;rt!=a>t&&e<(o-u)*(t-l)/(a-l)+u&&i++}return i&1}const Nd={random(){return Wi()},cumulativeNormal:C0,cumulativeLogNormal:$y,cumulativeUniform:Ty,densityNormal:wy,densityLogNormal:Ay,densityUniform:Dy,quantileNormal:A0,quantileLogNormal:Sy,quantileUniform:My,sampleNormal:E0,sampleLogNormal:Cy,sampleUniform:Fy,isArray:G,isBoolean:wo,isDate:ko,isDefined(e){return e!==void 0},isNumber:Je,isObject:ie,isRegExp:F2,isString:re,isTuple:y0,isValid(e){return e!=null&&e===e},toBoolean:T2,toDate(e){return M2(e)},toNumber:An,toString:N2,indexof:aae,join:oae,lastindexof:uae,replace:cae,reverse:fae,sort:dae,slice:lae,flush:V4,lerp:X4,merge:eae,pad:J4,peek:Ye,pluck:sae,span:Xc,inrange:al,truncate:Q4,rgb:Io,lab:H0,hcl:G0,hsl:U0,luminance:h7,contrast:Qoe,sequence:Ci,format:Noe,utcFormat:Roe,utcParse:Loe,utcOffset:U8,utcSequence:H8,timeFormat:zD,timeParse:Ooe,timeOffset:j8,timeSequence:W8,timeUnitSpecifier:D8,monthFormat:Ioe,monthAbbrevFormat:Poe,dayFormat:zoe,dayAbbrevFormat:Boe,quarter:q4,utcquarter:W4,week:M8,utcweek:O8,dayofyear:T8,utcdayofyear:R8,warn:Zoe,info:Koe,debug:Joe,extent(e){return Wr(e)},inScope:Xoe,intersect:XD,clampRange:H4,pinchDistance:iae,pinchAngle:rae,screen:Cae,containerSize:$ae,windowSize:Aae,bandspace:hae,setdata:Toe,pathShape:wae,panLinear:z4,panLog:B4,panPow:j4,panSymlog:U4,zoomLinear:E2,zoomLog:C2,zoomPow:Kh,zoomSymlog:A2,encode:Moe,modify:nae,lassoAppend:Fae,lassoPath:Dae,intersectLasso:Tae},Nae=["view","item","group","xy","x","y"],Rae="event.vega.",ZD="this.",g7={},KD={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${ee(BD+e)}]`,functions:Oae,constants:FD,visitors:g7},m7=TD(KD);function Oae(e){const t=DD(e);Nae.forEach(n=>t[n]=Rae+n);for(const n in Nd)t[n]=ZD+n;return Be(t,Woe(e,Nd,g7)),t}function Bt(e,t,n){return arguments.length===1?Nd[e]:(Nd[e]=t,n&&(g7[e]=n),m7&&(m7.functions[e]=ZD+e),this)}Bt("bandwidth",pae,ti),Bt("copy",gae,ti),Bt("domain",mae,ti),Bt("range",bae,ti),Bt("invert",yae,ti),Bt("scale",vae,ti),Bt("gradient",_ae,ti),Bt("geoArea",Hoe,ti),Bt("geoBounds",Goe,ti),Bt("geoCentroid",Voe,ti),Bt("geoShape",xae,ti),Bt("geoScale",Yoe,ti),Bt("indata",Doe,qoe),Bt("data",PD,l7),Bt("treePath",kae,l7),Bt("treeAncestors",Eae,l7),Bt("vlSelectionTest",woe,a7),Bt("vlSelectionIdTest",Coe,a7),Bt("vlSelectionResolve",$oe,a7),Bt("vlSelectionTuples",Aoe);function fs(e,t){const n={};let i;try{e=re(e)?e:ee(e)+"",i=SD(e)}catch{W("Expression parse error: "+e)}i.visit(s=>{if(s.type!==pD)return;const o=s.callee.name,a=KD.visitors[o];a&&a(o,s.arguments,t,n)});const r=m7(i);return r.globals.forEach(s=>{const o=BD+s;!ue(n,o)&&t.getSignal(s)&&(n[o]=t.signalRef(s))}),{$expr:Be({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function Lae(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(i=>t.parseOperator(i)),n.forEach(i=>t.parseOperatorParameters(i)),(e.streams||[]).forEach(i=>t.parseStream(i)),(e.updates||[]).forEach(i=>t.parseUpdate(i)),t.resolve()}const Iae=fr(["rule"]),JD=fr(["group","image","rect"]);function Pae(e,t){let n="";return Iae[t]||(e.x2&&(e.x?(JD[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(JD[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}function y7(e){return(e+"").toLowerCase()}function zae(e){return y7(e)==="operator"}function Bae(e){return y7(e)==="collect"}function Rd(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}function jae(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n} +${a}`)}return u}(e,"",0)}function Kn(e,t,n){return e.fields=t||[],e.fname=n,e}function Tt(e){return e==null?null:e.fname}function bn(e){return e==null?null:e.fields}function Z6(e){return e.length===1?VU(e[0]):YU(e)}const VU=e=>function(t){return t[e]},YU=e=>{const t=e.length;return function(n){for(let i=0;io?u():o=a+1:l==="["?(a>o&&u(),r=o=a+1):l==="]"&&(r||q("Access path missing open bracket: "+e),r>0&&u(),r=0,o=a+1)}return r&&q("Access path missing closing bracket: "+e),i&&q("Access path missing closing quote: "+e),a>o&&(a++,u()),t}function Fi(e,t,n){const i=Mr(e);return e=i.length===1?i[0]:e,Kn((n&&n.get||Z6)(i),[e],t||e)}const Mc=Fi("id"),vn=Kn(e=>e,[],"identity"),so=Kn(()=>0,[],"zero"),Pl=Kn(()=>1,[],"one"),Ti=Kn(()=>!0,[],"true"),oo=Kn(()=>!1,[],"false"),Wm=new Set([...Object.getOwnPropertyNames(Object.prototype).filter(e=>typeof Object.prototype[e]=="function"),"__proto__"]);function XU(e,t,n){const i=[t].concat([].slice.call(n));console[e].apply(console,i)}const K6=0,Hm=1,Gm=2,J6=3,Q6=4;function Eh(e,t,n=XU){let i=e||K6;return{level(r){return arguments.length?(i=+r,this):i},error(){return i>=Hm&&n(t||"error","ERROR",arguments),this},warn(){return i>=Gm&&n(t||"warn","WARN",arguments),this},info(){return i>=J6&&n(t||"log","INFO",arguments),this},debug(){return i>=Q6&&n(t||"log","DEBUG",arguments),this}}}var G=Array.isArray;function ie(e){return e===Object(e)}const ek=e=>e!=="__proto__";function zl(...e){return e.reduce((t,n)=>{for(const i in n)if(i==="signals")t.signals=ZU(t.signals,n.signals);else{const r=i==="legend"?{layout:1}:i==="style"?!0:null;Bl(t,i,n[i],r)}return t},{})}function Bl(e,t,n,i){if(!ek(t))return;let r,s;if(ie(n)&&!G(n)){s=ie(e[t])?e[t]:e[t]={};for(r in n)i&&(i===!0||i[r])?Bl(s,r,n[r]):ek(r)&&(s[r]=n[r])}else e[t]=n}function ZU(e,t){if(e==null)return t;const n={},i=[];function r(s){n[s.name]||(n[s.name]=1,i.push(s))}return t.forEach(r),e.forEach(r),i}function Ve(e){return e[e.length-1]}function _n(e){return e==null||e===""?null:+e}const tk=e=>t=>e*Math.exp(t),nk=e=>t=>Math.log(e*t),ik=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e)),rk=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e,$h=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function Sh(e,t,n,i){const r=n(e[0]),s=n(Ve(e)),o=(s-r)*t;return[i(r-o),i(s-o)]}function sk(e,t){return Sh(e,t,_n,vn)}function ok(e,t){var n=Math.sign(e[0]);return Sh(e,t,nk(n),tk(n))}function ak(e,t,n){return Sh(e,t,$h(n),$h(1/n))}function lk(e,t,n){return Sh(e,t,ik(n),rk(n))}function Ch(e,t,n,i,r){const s=i(e[0]),o=i(Ve(e)),a=t!=null?i(t):(s+o)/2;return[r(a+(s-a)*n),r(a+(o-a)*n)]}function Vm(e,t,n){return Ch(e,t,n,_n,vn)}function Ym(e,t,n){const i=Math.sign(e[0]);return Ch(e,t,n,nk(i),tk(i))}function Ah(e,t,n,i){return Ch(e,t,n,$h(i),$h(1/i))}function Xm(e,t,n,i){return Ch(e,t,n,ik(i),rk(i))}function uk(e){return 1+~~(new Date(e).getMonth()/3)}function ck(e){return 1+~~(new Date(e).getUTCMonth()/3)}function se(e){return e!=null?G(e)?e:[e]:[]}function fk(e,t,n){let i=e[0],r=e[1],s;return r=n-t?[t,n]:[i=Math.min(Math.max(i,t),n-s),i+s]}function ze(e){return typeof e=="function"}const KU="descending";function Zm(e,t,n){n=n||{},t=se(t)||[];const i=[],r=[],s={},o=n.comparator||JU;return se(e).forEach((a,l)=>{a!=null&&(i.push(t[l]===KU?-1:1),r.push(a=ze(a)?a:Fi(a,null,n)),(bn(a)||[]).forEach(u=>s[u]=1))}),r.length===0?null:Kn(o(r,i),Object.keys(s))}const jl=(e,t)=>(et||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,(e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0),JU=(e,t)=>e.length===1?QU(e[0],t[0]):eq(e,t,e.length),QU=(e,t)=>function(n,i){return jl(e(n),e(i))*t},eq=(e,t,n)=>(t.push(0),function(i,r){let s,o=0,a=-1;for(;o===0&&++ae}function Km(e,t){let n;return i=>{n&&clearTimeout(n),n=setTimeout(()=>(t(i),n=null),e)}}function Be(e){for(let t,n,i=1,r=arguments.length;io&&(o=r))}else{for(r=t(e[n]);no&&(o=r))}return[s,o]}function dk(e,t){const n=e.length;let i=-1,r,s,o,a,l;if(t==null){for(;++i=s){r=o=s;break}if(i===n)return[-1,-1];for(a=l=i;++is&&(r=s,a=i),o=s){r=o=s;break}if(i===n)return[-1,-1];for(a=l=i;++is&&(r=s,a=i),o{r.set(s,e[s])}),r}function hk(e,t,n,i,r,s){if(!n&&n!==0)return s;const o=+n;let a=e[0],l=Ve(e),u;ls&&(o=r,r=s,s=o),n=n===void 0||n,i=i===void 0||i,(n?r<=e:ra.replace(/\\(.)/g,"$1")):se(e));const i=e&&e.length,r=n&&n.get||Z6,s=a=>r(t?[a]:Mr(a));let o;if(!i)o=function(){return""};else if(i===1){const a=s(e[0]);o=function(l){return""+a(l)}}else{const a=e.map(s);o=function(l){let u=""+a[0](l),c=0;for(;++c{t={},n={},i=0},s=(o,a)=>(++i>e&&(n=t,t={},i=1),t[o]=a);return r(),{clear:r,has:o=>le(t,o)||le(n,o),get:o=>le(t,o)?t[o]:le(n,o)?s(o,n[o]):void 0,set:(o,a)=>le(t,o)?t[o]=a:s(o,a)}}function yk(e,t,n,i){const r=t.length,s=n.length;if(!s)return t;if(!r)return n;const o=i||new t.constructor(r+s);let a=0,l=0,u=0;for(;a0?n[l++]:t[a++];for(;a=0;)n+=e;return n}function bk(e,t,n,i){const r=n||" ",s=e+"",o=t-s.length;return o<=0?s:i==="left"?Dc(r,o)+s:i==="center"?Dc(r,~~(o/2))+s+Dc(r,Math.ceil(o/2)):s+Dc(r,o)}function Nc(e){return e&&Ve(e)-e[0]||0}function ee(e){return G(e)?`[${e.map(t=>t===null?"null":ee(t))}]`:ie(e)||re(e)?JSON.stringify(e).replaceAll("\u2028","\\u2028").replaceAll("\u2029","\\u2029"):e}function e2(e){return e==null||e===""?null:!e||e==="false"||e==="0"?!1:!!e}const nq=e=>Ke(e)||lo(e)?e:Date.parse(e);function t2(e,t){return t=t||nq,e==null||e===""?null:t(e)}function n2(e){return e==null||e===""?null:e+""}function er(e){const t={},n=e.length;for(let i=0;i9999?"+"+Jn(e,6):Jn(e,4)}function sq(e){var t=e.getUTCHours(),n=e.getUTCMinutes(),i=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":rq(e.getUTCFullYear())+"-"+Jn(e.getUTCMonth()+1,2)+"-"+Jn(e.getUTCDate(),2)+(r?"T"+Jn(t,2)+":"+Jn(n,2)+":"+Jn(i,2)+"."+Jn(r,3)+"Z":i?"T"+Jn(t,2)+":"+Jn(n,2)+":"+Jn(i,2)+"Z":n||t?"T"+Jn(t,2)+":"+Jn(n,2)+"Z":"")}function oq(e){var t=new RegExp('["'+e+` +\r]`),n=e.charCodeAt(0);function i(f,d){var h,p,g=r(f,function(m,y){if(h)return h(m,y-1);p=m,h=d?iq(m,d):xk(m)});return g.columns=p||[],g}function r(f,d){var h=[],p=f.length,g=0,m=0,y,b=p<=0,v=!1;f.charCodeAt(p-1)===Rc&&--p,f.charCodeAt(p-1)===s2&&--p;function _(){if(b)return i2;if(v)return v=!1,_k;var k,w=g,E;if(f.charCodeAt(w)===r2){for(;g++=p?b=!0:(E=f.charCodeAt(g++))===Rc?v=!0:E===s2&&(v=!0,f.charCodeAt(g)===Rc&&++g),f.slice(w+1,k-1).replace(/""/g,'"')}for(;g1)i=pq(e,t,n);else for(r=0,i=new Array(s=e.arcs.length);rt?1:e>=t?0:NaN}function gq(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Wl(e){let t,n,i;e.length!==2?(t=ys,n=(a,l)=>ys(e(a),l),i=(a,l)=>e(a)-l):(t=e===ys||e===gq?e:mq,n=e,i=e);function r(a,l,u=0,c=a.length){if(u>>1;n(a[f],l)<0?u=f+1:c=f}while(u>>1;n(a[f],l)<=0?u=f+1:c=f}while(uu&&i(a[f-1],l)>-i(a[f],l)?f-1:f}return{left:r,center:o,right:s}}function mq(){return 0}function $k(e){return e===null?NaN:+e}function*yq(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(i=+i)>=i&&(yield i)}}const Sk=Wl(ys),co=Sk.right,bq=Sk.left;Wl($k).center;function vq(e,t){let n=0,i,r=0,s=0;if(t===void 0)for(let o of e)o!=null&&(o=+o)>=o&&(i=o-r,r+=i/++n,s+=i*(o-r));else{let o=-1;for(let a of e)(a=t(a,++o,e))!=null&&(a=+a)>=a&&(i=a-r,r+=i/++n,s+=i*(a-r))}if(n>1)return s/(n-1)}function _q(e,t){const n=vq(e,t);return n&&Math.sqrt(n)}class Rn{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let i=0;for(let r=0;r0){for(o=t[--n];n>0&&(i=o,r=t[--n],o=i+r,s=r-(o-i),!s););n>0&&(s<0&&t[n-1]<0||s>0&&t[n-1]>0)&&(r=s*2,i=o+r,r==i-o&&(o=i))}return o}}class Ck extends Map{constructor(t,n=Tk){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[i,r]of t)this.set(i,r)}get(t){return super.get(o2(this,t))}has(t){return super.has(o2(this,t))}set(t,n){return super.set(Ak(this,t),n)}delete(t){return super.delete(Fk(this,t))}}class Th extends Set{constructor(t,n=Tk){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const i of t)this.add(i)}has(t){return super.has(o2(this,t))}add(t){return super.add(Ak(this,t))}delete(t){return super.delete(Fk(this,t))}}function o2({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):n}function Ak({_intern:e,_key:t},n){const i=t(n);return e.has(i)?e.get(i):(e.set(i,n),n)}function Fk({_intern:e,_key:t},n){const i=t(n);return e.has(i)&&(n=e.get(i),e.delete(i)),n}function Tk(e){return e!==null&&typeof e=="object"?e.valueOf():e}function xq(e,t){return Array.from(t,n=>e[n])}function wq(e=ys){if(e===ys)return Mk;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const i=e(t,n);return i||i===0?i:(e(n,n)===0)-(e(t,t)===0)}}function Mk(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const kq=Math.sqrt(50),Eq=Math.sqrt(10),$q=Math.sqrt(2);function Mh(e,t,n){const i=(t-e)/Math.max(0,n),r=Math.floor(Math.log10(i)),s=i/Math.pow(10,r),o=s>=kq?10:s>=Eq?5:s>=$q?2:1;let a,l,u;return r<0?(u=Math.pow(10,-r)/o,a=Math.round(e*u),l=Math.round(t*u),a/ut&&--l,u=-u):(u=Math.pow(10,r)*o,a=Math.round(e/u),l=Math.round(t/u),a*ut&&--l),l0))return[];if(e===t)return[e];const i=t=r))return[];const a=s-r+1,l=new Array(a);if(i)if(o<0)for(let u=0;u=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n=r)&&(n=r)}return n}function u2(e,t){let n;if(t===void 0)for(const i of e)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let r of e)(r=t(r,++i,e))!=null&&(n>r||n===void 0&&r>=r)&&(n=r)}return n}function Dk(e,t,n=0,i=1/0,r){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),i=Math.floor(Math.min(e.length-1,i)),!(n<=t&&t<=i))return e;for(r=r===void 0?Mk:wq(r);i>n;){if(i-n>600){const l=i-n+1,u=t-n+1,c=Math.log(l),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(l-f)/l)*(u-l/2<0?-1:1),h=Math.max(n,Math.floor(t-u*f/l+d)),p=Math.min(i,Math.floor(t+(l-u)*f/l+d));Dk(e,t,h,p,r)}const s=e[t];let o=n,a=i;for(Oc(e,n,t),r(e[i],s)>0&&Oc(e,n,i);o0;)--a}r(e[n],s)===0?Oc(e,n,a):(++a,Oc(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}return e}function Oc(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function c2(e,t,n){if(e=Float64Array.from(yq(e,n)),!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return u2(e);if(t>=1)return ha(e);var i,r=(i-1)*t,s=Math.floor(r),o=ha(Dk(e,s).subarray(0,s+1)),a=u2(e.subarray(s+1));return o+(a-o)*(r-s)}}function Nk(e,t,n=$k){if(!(!(i=e.length)||isNaN(t=+t))){if(t<=0||i<2)return+n(e[0],0,e);if(t>=1)return+n(e[i-1],i-1,e);var i,r=(i-1)*t,s=Math.floor(r),o=+n(e[s],s,e),a=+n(e[s+1],s+1,e);return o+(a-o)*(r-s)}}function Sq(e,t){let n=0,i=0;if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(++n,i+=r);else{let r=-1;for(let s of e)(s=t(s,++r,e))!=null&&(s=+s)>=s&&(++n,i+=s)}if(n)return i/n}function Rk(e,t){return c2(e,.5,t)}function*Cq(e){for(const t of e)yield*t}function Ok(e){return Array.from(Cq(e))}function hi(e,t,n){e=+e,t=+t,n=(r=arguments.length)<2?(t=e,e=0,1):r<3?1:+n;for(var i=-1,r=Math.max(0,Math.ceil((t-e)/n))|0,s=new Array(r);++i=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Dh(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function Hl(e){return e=Dh(Math.abs(e)),e?e[1]:NaN}function Dq(e,t){return function(n,i){for(var r=n.length,s=[],o=0,a=e[0],l=0;r>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),s.push(n.substring(r-=a,r+a)),!((l+=a+1)>i));)a=e[o=(o+1)%e.length];return s.reverse().join(t)}}function Nq(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var Rq=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function pa(e){if(!(t=Rq.exec(e)))throw new Error("invalid format: "+e);var t;return new f2({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}pa.prototype=f2.prototype;function f2(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}f2.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Oq(e){e:for(var t=e.length,n=1,i=-1,r;n0&&(i=0);break}return i>0?e.slice(0,i)+e.slice(r+1):e}var Ik;function Lq(e,t){var n=Dh(e,t);if(!n)return e+"";var i=n[0],r=n[1],s=r-(Ik=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,o=i.length;return s===o?i:s>o?i+new Array(s-o+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+Dh(e,Math.max(0,t+s-1))[0]}function Pk(e,t){var n=Dh(e,t);if(!n)return e+"";var i=n[0],r=n[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const zk={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:Mq,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Pk(e*100,t),r:Pk,s:Lq,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Bk(e){return e}var jk=Array.prototype.map,Uk=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function qk(e){var t=e.grouping===void 0||e.thousands===void 0?Bk:Dq(jk.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",i=e.currency===void 0?"":e.currency[1]+"",r=e.decimal===void 0?".":e.decimal+"",s=e.numerals===void 0?Bk:Nq(jk.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",a=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(f){f=pa(f);var d=f.fill,h=f.align,p=f.sign,g=f.symbol,m=f.zero,y=f.width,b=f.comma,v=f.precision,_=f.trim,x=f.type;x==="n"?(b=!0,x="g"):zk[x]||(v===void 0&&(v=12),_=!0,x="g"),(m||d==="0"&&h==="=")&&(m=!0,d="0",h="=");var k=g==="$"?n:g==="#"&&/[boxX]/.test(x)?"0"+x.toLowerCase():"",w=g==="$"?i:/[%p]/.test(x)?o:"",E=zk[x],$=/[defgprs%]/.test(x);v=v===void 0?6:/[gprs]/.test(x)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function F(A){var z=k,P=w,M,S,D;if(x==="c")P=E(A)+P,A="";else{A=+A;var B=A<0||1/A<0;if(A=isNaN(A)?l:E(Math.abs(A),v),_&&(A=Oq(A)),B&&+A==0&&p!=="+"&&(B=!1),z=(B?p==="("?p:a:p==="-"||p==="("?"":p)+z,P=(x==="s"?Uk[8+Ik/3]:"")+P+(B&&p==="("?")":""),$){for(M=-1,S=A.length;++MD||D>57){P=(D===46?r+A.slice(M+1):A.slice(M))+P,A=A.slice(0,M);break}}}b&&!m&&(A=t(A,1/0));var V=z.length+A.length+P.length,H=V>1)+z+A+P+H.slice(V);break;default:A=H+z+A+P;break}return s(A)}return F.toString=function(){return f+""},F}function c(f,d){var h=u((f=pa(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor(Hl(d)/3)))*3,g=Math.pow(10,-p),m=Uk[8+p/3];return function(y){return h(g*y)+m}}return{format:u,formatPrefix:c}}var Nh,Rh,d2;Iq({thousands:",",grouping:[3],currency:["$",""]});function Iq(e){return Nh=qk(e),Rh=Nh.format,d2=Nh.formatPrefix,Nh}function Wk(e){return Math.max(0,-Hl(Math.abs(e)))}function Hk(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Hl(t)/3)))*3-Hl(Math.abs(e)))}function Gk(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Hl(t)-Hl(e))+1}const h2=new Date,p2=new Date;function Ut(e,t,n,i){function r(s){return e(s=arguments.length===0?new Date:new Date(+s)),s}return r.floor=s=>(e(s=new Date(+s)),s),r.ceil=s=>(e(s=new Date(s-1)),t(s,1),e(s),s),r.round=s=>{const o=r(s),a=r.ceil(s);return s-o(t(s=new Date(+s),o==null?1:Math.floor(o)),s),r.range=(s,o,a)=>{const l=[];if(s=r.ceil(s),a=a==null?1:Math.floor(a),!(s0))return l;let u;do l.push(u=new Date(+s)),t(s,a),e(s);while(uUt(o=>{if(o>=o)for(;e(o),!s(o);)o.setTime(o-1)},(o,a)=>{if(o>=o)if(a<0)for(;++a<=0;)for(;t(o,-1),!s(o););else for(;--a>=0;)for(;t(o,1),!s(o););}),n&&(r.count=(s,o)=>(h2.setTime(+s),p2.setTime(+o),e(h2),e(p2),Math.floor(n(h2,p2))),r.every=s=>(s=Math.floor(s),!isFinite(s)||!(s>0)?null:s>1?r.filter(i?o=>i(o)%s===0:o=>r.count(0,o)%s===0):r)),r}const Gl=Ut(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Gl.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Ut(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):Gl),Gl.range;const bs=1e3,Mi=bs*60,vs=Mi*60,_s=vs*24,g2=_s*7,Vk=_s*30,m2=_s*365,xs=Ut(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*bs)},(e,t)=>(t-e)/bs,e=>e.getUTCSeconds());xs.range;const Oh=Ut(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*bs)},(e,t)=>{e.setTime(+e+t*Mi)},(e,t)=>(t-e)/Mi,e=>e.getMinutes());Oh.range;const Lh=Ut(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Mi)},(e,t)=>(t-e)/Mi,e=>e.getUTCMinutes());Lh.range;const Ih=Ut(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*bs-e.getMinutes()*Mi)},(e,t)=>{e.setTime(+e+t*vs)},(e,t)=>(t-e)/vs,e=>e.getHours());Ih.range;const Ph=Ut(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*vs)},(e,t)=>(t-e)/vs,e=>e.getUTCHours());Ph.range;const ws=Ut(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Mi)/_s,e=>e.getDate()-1);ws.range;const ho=Ut(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/_s,e=>e.getUTCDate()-1);ho.range;const Yk=Ut(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/_s,e=>Math.floor(e/_s));Yk.range;function ga(e){return Ut(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Mi)/g2)}const Vl=ga(0),zh=ga(1),Pq=ga(2),zq=ga(3),Yl=ga(4),Bq=ga(5),jq=ga(6);Vl.range,zh.range,Pq.range,zq.range,Yl.range,Bq.range,jq.range;function ma(e){return Ut(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/g2)}const Xl=ma(0),Bh=ma(1),Uq=ma(2),qq=ma(3),Zl=ma(4),Wq=ma(5),Hq=ma(6);Xl.range,Bh.range,Uq.range,qq.range,Zl.range,Wq.range,Hq.range;const Lc=Ut(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Lc.range;const Ic=Ut(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Ic.range;const Nr=Ut(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Nr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ut(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),Nr.range;const Rr=Ut(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Rr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ut(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),Rr.range;function Xk(e,t,n,i,r,s){const o=[[xs,1,bs],[xs,5,5*bs],[xs,15,15*bs],[xs,30,30*bs],[s,1,Mi],[s,5,5*Mi],[s,15,15*Mi],[s,30,30*Mi],[r,1,vs],[r,3,3*vs],[r,6,6*vs],[r,12,12*vs],[i,1,_s],[i,2,2*_s],[n,1,g2],[t,1,Vk],[t,3,3*Vk],[e,1,m2]];function a(u,c,f){const d=cm).right(o,d);if(h===o.length)return e.every(fo(u/m2,c/m2,f));if(h===0)return Gl.every(Math.max(fo(u,c,f),1));const[p,g]=o[d/o[h-1][2](e[t]=1+n,e),{});function v2(e){const t=se(e).slice(),n={};return t.length||q("Missing time unit."),t.forEach(r=>{le(b2,r)?n[r]=1:q(`Invalid time unit: ${r}.`)}),(n[qt]||n[kn]?1:0)+(n[Qn]||n[wn]||n[ei]?1:0)+(n[Or]?1:0)>1&&q(`Incompatible time units: ${e}`),t.sort((r,s)=>b2[r]-b2[s]),t}const Zq={[an]:"%Y ",[Qn]:"Q%q ",[wn]:"%b ",[ei]:"%d ",[qt]:"W%U ",[kn]:"%a ",[Or]:"%j ",[pi]:"%H:00",[gi]:"00:%M",[Di]:":%S",[tr]:".%L",[`${an}-${wn}`]:"%Y-%m ",[`${an}-${wn}-${ei}`]:"%Y-%m-%d ",[`${pi}-${gi}`]:"%H:%M"};function Zk(e,t){const n=Be({},Zq,t),i=v2(e),r=i.length;let s="",o=0,a,l;for(o=0;oo;--a)if(l=i.slice(o,a).join("-"),n[l]!=null){s+=n[l],o=a;break}return s.trim()}const ya=new Date;function _2(e){return ya.setFullYear(e),ya.setMonth(0),ya.setDate(1),ya.setHours(0,0,0,0),ya}function Kk(e){return Qk(new Date(e))}function Jk(e){return x2(new Date(e))}function Qk(e){return ws.count(_2(e.getFullYear())-1,e)}function x2(e){return Vl.count(_2(e.getFullYear())-1,e)}function w2(e){return _2(e).getDay()}function Kq(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(-1,t,n,i,r,s,o);return a.setFullYear(e),a}return new Date(e,t,n,i,r,s,o)}function e4(e){return n4(new Date(e))}function t4(e){return k2(new Date(e))}function n4(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return ho.count(t-1,e)}function k2(e){const t=Date.UTC(e.getUTCFullYear(),0,1);return Xl.count(t-1,e)}function E2(e){return ya.setTime(Date.UTC(e,0,1)),ya.getUTCDay()}function Jq(e,t,n,i,r,s,o){if(0<=e&&e<100){const a=new Date(Date.UTC(-1,t,n,i,r,s,o));return a.setUTCFullYear(n.y),a}return new Date(Date.UTC(e,t,n,i,r,s,o))}function i4(e,t,n,i,r){const s=t||1,o=Ve(e),a=(y,b,v)=>(v=v||y,Qq(n[v],i[v],y===o&&s,b)),l=new Date,u=er(e),c=u[an]?a(an):xn(2012),f=u[wn]?a(wn):u[Qn]?a(Qn):so,d=u[qt]&&u[kn]?a(kn,1,qt+kn):u[qt]?a(qt,1):u[kn]?a(kn,1):u[ei]?a(ei,1):u[Or]?a(Or,1):Pl,h=u[pi]?a(pi):so,p=u[gi]?a(gi):so,g=u[Di]?a(Di):so,m=u[tr]?a(tr):so;return function(y){l.setTime(+y);const b=c(l);return r(b,f(l),d(l,b),h(l),p(l),g(l),m(l))}}function Qq(e,t,n,i){const r=n<=1?e:i?(s,o)=>i+n*Math.floor((e(s,o)-i)/n):(s,o)=>n*Math.floor(e(s,o)/n);return t?(s,o)=>t(r(s,o),o):r}function Kl(e,t,n){return t+e*7-(n+6)%7}const eW={[an]:e=>e.getFullYear(),[Qn]:e=>Math.floor(e.getMonth()/3),[wn]:e=>e.getMonth(),[ei]:e=>e.getDate(),[pi]:e=>e.getHours(),[gi]:e=>e.getMinutes(),[Di]:e=>e.getSeconds(),[tr]:e=>e.getMilliseconds(),[Or]:e=>Qk(e),[qt]:e=>x2(e),[qt+kn]:(e,t)=>Kl(x2(e),e.getDay(),w2(t)),[kn]:(e,t)=>Kl(1,e.getDay(),w2(t))},tW={[Qn]:e=>3*e,[qt]:(e,t)=>Kl(e,0,w2(t))};function r4(e,t){return i4(e,t||1,eW,tW,Kq)}const nW={[an]:e=>e.getUTCFullYear(),[Qn]:e=>Math.floor(e.getUTCMonth()/3),[wn]:e=>e.getUTCMonth(),[ei]:e=>e.getUTCDate(),[pi]:e=>e.getUTCHours(),[gi]:e=>e.getUTCMinutes(),[Di]:e=>e.getUTCSeconds(),[tr]:e=>e.getUTCMilliseconds(),[Or]:e=>n4(e),[qt]:e=>k2(e),[kn]:(e,t)=>Kl(1,e.getUTCDay(),E2(t)),[qt+kn]:(e,t)=>Kl(k2(e),e.getUTCDay(),E2(t))},iW={[Qn]:e=>3*e,[qt]:(e,t)=>Kl(e,0,E2(t))};function s4(e,t){return i4(e,t||1,nW,iW,Jq)}const rW={[an]:Nr,[Qn]:Lc.every(3),[wn]:Lc,[qt]:Vl,[ei]:ws,[kn]:ws,[Or]:ws,[pi]:Ih,[gi]:Oh,[Di]:xs,[tr]:Gl},sW={[an]:Rr,[Qn]:Ic.every(3),[wn]:Ic,[qt]:Xl,[ei]:ho,[kn]:ho,[Or]:ho,[pi]:Ph,[gi]:Lh,[Di]:xs,[tr]:Gl};function Jl(e){return rW[e]}function Ql(e){return sW[e]}function o4(e,t,n){return e?e.offset(t,n):void 0}function a4(e,t,n){return o4(Jl(e),t,n)}function l4(e,t,n){return o4(Ql(e),t,n)}function u4(e,t,n,i){return e?e.range(t,n,i):void 0}function c4(e,t,n,i){return u4(Jl(e),t,n,i)}function f4(e,t,n,i){return u4(Ql(e),t,n,i)}const Pc=1e3,zc=Pc*60,Bc=zc*60,jh=Bc*24,oW=jh*7,d4=jh*30,$2=jh*365,h4=[an,wn,ei,pi,gi,Di,tr],jc=h4.slice(0,-1),Uc=jc.slice(0,-1),qc=Uc.slice(0,-1),aW=qc.slice(0,-1),lW=[an,qt],p4=[an,wn],g4=[an],Wc=[[jc,1,Pc],[jc,5,5*Pc],[jc,15,15*Pc],[jc,30,30*Pc],[Uc,1,zc],[Uc,5,5*zc],[Uc,15,15*zc],[Uc,30,30*zc],[qc,1,Bc],[qc,3,3*Bc],[qc,6,6*Bc],[qc,12,12*Bc],[aW,1,jh],[lW,1,oW],[p4,1,d4],[p4,3,3*d4],[g4,1,$2]];function m4(e){const t=e.extent,n=e.maxbins||40,i=Math.abs(Nc(t))/n;let r=Wl(a=>a[2]).right(Wc,i),s,o;return r===Wc.length?(s=g4,o=fo(t[0]/$2,t[1]/$2,n)):r?(r=Wc[i/Wc[r-1][2]53)return null;"w"in Q||(Q.w=1),"Z"in Q?(ft=C2(Hc(Q.y,0,1)),on=ft.getUTCDay(),ft=on>4||on===0?Bh.ceil(ft):Bh(ft),ft=ho.offset(ft,(Q.V-1)*7),Q.y=ft.getUTCFullYear(),Q.m=ft.getUTCMonth(),Q.d=ft.getUTCDate()+(Q.w+6)%7):(ft=S2(Hc(Q.y,0,1)),on=ft.getDay(),ft=on>4||on===0?zh.ceil(ft):zh(ft),ft=ws.offset(ft,(Q.V-1)*7),Q.y=ft.getFullYear(),Q.m=ft.getMonth(),Q.d=ft.getDate()+(Q.w+6)%7)}else("W"in Q||"U"in Q)&&("w"in Q||(Q.w="u"in Q?Q.u%7:"W"in Q?1:0),on="Z"in Q?C2(Hc(Q.y,0,1)).getUTCDay():S2(Hc(Q.y,0,1)).getDay(),Q.m=0,Q.d="W"in Q?(Q.w+6)%7+Q.W*7-(on+5)%7:Q.w+Q.U*7-(on+6)%7);return"Z"in Q?(Q.H+=Q.Z/100|0,Q.M+=Q.Z%100,C2(Q)):S2(Q)}}function E(ue,je,He,Q){for(var mn=0,ft=je.length,on=He.length,Dn,to;mn=on)return-1;if(Dn=je.charCodeAt(mn++),Dn===37){if(Dn=je.charAt(mn++),to=x[Dn in b4?je.charAt(mn++):Dn],!to||(Q=to(ue,He,Q))<0)return-1}else if(Dn!=He.charCodeAt(Q++))return-1}return Q}function $(ue,je,He){var Q=u.exec(je.slice(He));return Q?(ue.p=c.get(Q[0].toLowerCase()),He+Q[0].length):-1}function F(ue,je,He){var Q=h.exec(je.slice(He));return Q?(ue.w=p.get(Q[0].toLowerCase()),He+Q[0].length):-1}function A(ue,je,He){var Q=f.exec(je.slice(He));return Q?(ue.w=d.get(Q[0].toLowerCase()),He+Q[0].length):-1}function z(ue,je,He){var Q=y.exec(je.slice(He));return Q?(ue.m=b.get(Q[0].toLowerCase()),He+Q[0].length):-1}function P(ue,je,He){var Q=g.exec(je.slice(He));return Q?(ue.m=m.get(Q[0].toLowerCase()),He+Q[0].length):-1}function M(ue,je,He){return E(ue,t,je,He)}function S(ue,je,He){return E(ue,n,je,He)}function D(ue,je,He){return E(ue,i,je,He)}function B(ue){return o[ue.getDay()]}function V(ue){return s[ue.getDay()]}function H(ue){return l[ue.getMonth()]}function oe(ue){return a[ue.getMonth()]}function we(ue){return r[+(ue.getHours()>=12)]}function xe(ue){return 1+~~(ue.getMonth()/3)}function Re(ue){return o[ue.getUTCDay()]}function nt(ue){return s[ue.getUTCDay()]}function Ie(ue){return l[ue.getUTCMonth()]}function jt(ue){return a[ue.getUTCMonth()]}function Xi(ue){return r[+(ue.getUTCHours()>=12)]}function Zi(ue){return 1+~~(ue.getUTCMonth()/3)}return{format:function(ue){var je=k(ue+="",v);return je.toString=function(){return ue},je},parse:function(ue){var je=w(ue+="",!1);return je.toString=function(){return ue},je},utcFormat:function(ue){var je=k(ue+="",_);return je.toString=function(){return ue},je},utcParse:function(ue){var je=w(ue+="",!0);return je.toString=function(){return ue},je}}}var b4={"-":"",_:" ",0:"0"},Xt=/^\s*\d+/,uW=/^%/,cW=/[\\^$*+?|[\]().{}]/g;function Je(e,t,n){var i=e<0?"-":"",r=(i?-e:e)+"",s=r.length;return i+(s[t.toLowerCase(),n]))}function dW(e,t,n){var i=Xt.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function hW(e,t,n){var i=Xt.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function pW(e,t,n){var i=Xt.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function gW(e,t,n){var i=Xt.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function mW(e,t,n){var i=Xt.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function v4(e,t,n){var i=Xt.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function _4(e,t,n){var i=Xt.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function yW(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function bW(e,t,n){var i=Xt.exec(t.slice(n,n+1));return i?(e.q=i[0]*3-3,n+i[0].length):-1}function vW(e,t,n){var i=Xt.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function x4(e,t,n){var i=Xt.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function _W(e,t,n){var i=Xt.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function w4(e,t,n){var i=Xt.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function xW(e,t,n){var i=Xt.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function wW(e,t,n){var i=Xt.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function kW(e,t,n){var i=Xt.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function EW(e,t,n){var i=Xt.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function $W(e,t,n){var i=uW.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function SW(e,t,n){var i=Xt.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function CW(e,t,n){var i=Xt.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function k4(e,t){return Je(e.getDate(),t,2)}function AW(e,t){return Je(e.getHours(),t,2)}function FW(e,t){return Je(e.getHours()%12||12,t,2)}function TW(e,t){return Je(1+ws.count(Nr(e),e),t,3)}function E4(e,t){return Je(e.getMilliseconds(),t,3)}function MW(e,t){return E4(e,t)+"000"}function DW(e,t){return Je(e.getMonth()+1,t,2)}function NW(e,t){return Je(e.getMinutes(),t,2)}function RW(e,t){return Je(e.getSeconds(),t,2)}function OW(e){var t=e.getDay();return t===0?7:t}function LW(e,t){return Je(Vl.count(Nr(e)-1,e),t,2)}function $4(e){var t=e.getDay();return t>=4||t===0?Yl(e):Yl.ceil(e)}function IW(e,t){return e=$4(e),Je(Yl.count(Nr(e),e)+(Nr(e).getDay()===4),t,2)}function PW(e){return e.getDay()}function zW(e,t){return Je(zh.count(Nr(e)-1,e),t,2)}function BW(e,t){return Je(e.getFullYear()%100,t,2)}function jW(e,t){return e=$4(e),Je(e.getFullYear()%100,t,2)}function UW(e,t){return Je(e.getFullYear()%1e4,t,4)}function qW(e,t){var n=e.getDay();return e=n>=4||n===0?Yl(e):Yl.ceil(e),Je(e.getFullYear()%1e4,t,4)}function WW(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Je(t/60|0,"0",2)+Je(t%60,"0",2)}function S4(e,t){return Je(e.getUTCDate(),t,2)}function HW(e,t){return Je(e.getUTCHours(),t,2)}function GW(e,t){return Je(e.getUTCHours()%12||12,t,2)}function VW(e,t){return Je(1+ho.count(Rr(e),e),t,3)}function C4(e,t){return Je(e.getUTCMilliseconds(),t,3)}function YW(e,t){return C4(e,t)+"000"}function XW(e,t){return Je(e.getUTCMonth()+1,t,2)}function ZW(e,t){return Je(e.getUTCMinutes(),t,2)}function KW(e,t){return Je(e.getUTCSeconds(),t,2)}function JW(e){var t=e.getUTCDay();return t===0?7:t}function QW(e,t){return Je(Xl.count(Rr(e)-1,e),t,2)}function A4(e){var t=e.getUTCDay();return t>=4||t===0?Zl(e):Zl.ceil(e)}function eH(e,t){return e=A4(e),Je(Zl.count(Rr(e),e)+(Rr(e).getUTCDay()===4),t,2)}function tH(e){return e.getUTCDay()}function nH(e,t){return Je(Bh.count(Rr(e)-1,e),t,2)}function iH(e,t){return Je(e.getUTCFullYear()%100,t,2)}function rH(e,t){return e=A4(e),Je(e.getUTCFullYear()%100,t,2)}function sH(e,t){return Je(e.getUTCFullYear()%1e4,t,4)}function oH(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Zl(e):Zl.ceil(e),Je(e.getUTCFullYear()%1e4,t,4)}function aH(){return"+0000"}function F4(){return"%"}function T4(e){return+e}function M4(e){return Math.floor(+e/1e3)}var eu,A2,D4,F2,N4;lH({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function lH(e){return eu=y4(e),A2=eu.format,D4=eu.parse,F2=eu.utcFormat,N4=eu.utcParse,eu}function Yc(e){const t={};return n=>t[n]||(t[n]=e(n))}function uH(e,t){return n=>{const i=e(n),r=i.indexOf(t);if(r<0)return i;let s=cH(i,r);const o=sr;)if(i[s]!=="0"){++s;break}return i.slice(0,s)+o}}function cH(e,t){let n=e.lastIndexOf("e"),i;if(n>0)return n;for(n=e.length;--n>t;)if(i=e.charCodeAt(n),i>=48&&i<=57)return n+1}function R4(e){const t=Yc(e.format),n=e.formatPrefix;return{format:t,formatPrefix:n,formatFloat(i){const r=pa(i||",");if(r.precision==null){switch(r.precision=12,r.type){case"%":r.precision-=2;break;case"e":r.precision-=1;break}return uH(t(r),t(".1f")(1)[1])}else return t(r)},formatSpan(i,r,s,o){o=pa(o??",f");const a=fo(i,r,s),l=Math.max(Math.abs(i),Math.abs(r));let u;if(o.precision==null)switch(o.type){case"s":return isNaN(u=Hk(a,l))||(o.precision=u),n(o,l);case"":case"e":case"g":case"p":case"r":{isNaN(u=Gk(a,l))||(o.precision=u-(o.type==="e"));break}case"f":case"%":{isNaN(u=Wk(a))||(o.precision=u-(o.type==="%")*2);break}}return t(o)}}}let T2;O4();function O4(){return T2=R4({format:Rh,formatPrefix:d2})}function L4(e){return R4(qk(e))}function Uh(e){return arguments.length?T2=L4(e):T2}function I4(e,t,n){n=n||{},ie(n)||q(`Invalid time multi-format specifier: ${n}`);const i=t(Di),r=t(gi),s=t(pi),o=t(ei),a=t(qt),l=t(wn),u=t(Qn),c=t(an),f=e(n[tr]||".%L"),d=e(n[Di]||":%S"),h=e(n[gi]||"%I:%M"),p=e(n[pi]||"%I %p"),g=e(n[ei]||n[kn]||"%a %d"),m=e(n[qt]||"%b %d"),y=e(n[wn]||"%B"),b=e(n[Qn]||"%B"),v=e(n[an]||"%Y");return _=>(i(_)<_?f:r(_)<_?d:s(_)<_?h:o(_)<_?p:l(_)<_?a(_)<_?g:m:c(_)<_?u(_)<_?y:b:v)(_)}function P4(e){const t=Yc(e.format),n=Yc(e.utcFormat);return{timeFormat:i=>re(i)?t(i):I4(t,Jl,i),utcFormat:i=>re(i)?n(i):I4(n,Ql,i),timeParse:Yc(e.parse),utcParse:Yc(e.utcParse)}}let M2;z4();function z4(){return M2=P4({format:A2,parse:D4,utcFormat:F2,utcParse:N4})}function B4(e){return P4(y4(e))}function Xc(e){return arguments.length?M2=B4(e):M2}const D2=(e,t)=>Be({},e,t);function j4(e,t){const n=e?L4(e):Uh(),i=t?B4(t):Xc();return D2(n,i)}function N2(e,t){const n=arguments.length;return n&&n!==2&&q("defaultLocale expects either zero or two arguments."),n?D2(Uh(e),Xc(t)):D2(Uh(),Xc())}function fH(){return O4(),z4(),N2()}const dH=/^(data:|([A-Za-z]+:)?\/\/)/,hH=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,pH=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g,U4="file://";function gH(e){return t=>({options:t||{},sanitize:yH,load:mH,fileAccess:!1,file:bH(),http:_H})}async function mH(e,t){const n=await this.sanitize(e,t),i=n.href;return n.localFile?this.file(i):this.http(i,t==null?void 0:t.http)}async function yH(e,t){t=Be({},this.options,t);const n=this.fileAccess,i={href:null};let r,s,o;const a=hH.test(e.replace(pH,""));(e==null||typeof e!="string"||!a)&&q("Sanitize failure, invalid URI: "+ee(e));const l=dH.test(e);return(o=t.baseURL)&&!l&&(!e.startsWith("/")&&!o.endsWith("/")&&(e="/"+e),e=o+e),s=(r=e.startsWith(U4))||t.mode==="file"||t.mode!=="http"&&!l&&n,r?e=e.slice(U4.length):e.startsWith("//")&&(t.defaultProtocol==="file"?(e=e.slice(2),s=!0):e=(t.defaultProtocol||"http")+":"+e),Object.defineProperty(i,"localFile",{value:!!s}),i.href=e,t.target&&(i.target=t.target+""),t.rel&&(i.rel=t.rel+""),t.context==="image"&&t.crossOrigin&&(i.crossOrigin=t.crossOrigin+""),i}function bH(e){return vH}async function vH(){q("No file system access.")}async function _H(e,t){const n=Be({},this.options.http,t),i=t&&t.response,r=await fetch(e,n);return r.ok?ze(r[i])?r[i]():r.text():q(r.status+""+r.statusText)}const xH=e=>e!=null&&e===e,wH=e=>e==="true"||e==="false"||e===!0||e===!1,kH=e=>!Number.isNaN(Date.parse(e)),q4=e=>!Number.isNaN(+e)&&!(e instanceof Date),EH=e=>q4(e)&&Number.isInteger(+e),R2={boolean:e2,integer:_n,number:_n,date:t2,string:n2,unknown:vn},qh=[wH,EH,q4,kH],$H=["boolean","integer","number","date"];function W4(e,t){if(!e||!e.length)return"unknown";const n=e.length,i=qh.length,r=qh.map((s,o)=>o+1);for(let s=0,o=0,a,l;ss===0?o:s,0)-1]}function H4(e,t){return t.reduce((n,i)=>(n[i]=W4(e,i),n),{})}function G4(e){const t=function(n,i){const r={delimiter:e};return O2(n,i?Be(i,r):r)};return t.responseType="text",t}function O2(e,t){return t.header&&(e=t.header.map(ee).join(t.delimiter)+` +`+e),oq(t.delimiter).parse(e+"")}O2.responseType="text";function SH(e){return typeof Buffer=="function"&&ze(Buffer.isBuffer)?Buffer.isBuffer(e):!1}function L2(e,t){const n=t&&t.property?Fi(t.property):vn;return ie(e)&&!SH(e)?CH(n(e),t):n(JSON.parse(e))}L2.responseType="json";function CH(e,t){return!G(e)&&pk(e)&&(e=[...e]),t&&t.copy?JSON.parse(JSON.stringify(e)):e}const AH={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function V4(e,t){let n,i,r,s;return e=L2(e,t),t&&t.feature?(n=cq,r=t.feature):t&&t.mesh?(n=dq,r=t.mesh,s=AH[t.filter]):q("Missing TopoJSON feature or mesh parameter."),i=(i=e.objects[r])?n(e,i,s):q("Invalid TopoJSON object: "+r),i&&i.features||[i]}V4.responseType="json";const Wh={dsv:O2,csv:G4(","),tsv:G4(" "),json:L2,topojson:V4};function I2(e,t){return arguments.length>1?(Wh[e]=t,this):le(Wh,e)?Wh[e]:null}function Y4(e){const t=I2(e);return t&&t.responseType||"text"}function X4(e,t,n,i){t=t||{};const r=I2(t.type||"json");return r||q("Unknown data format type: "+t.type),e=r(e,t),t.parse&&FH(e,t.parse,n,i),le(e,"columns")&&delete e.columns,e}function FH(e,t,n,i){if(!e.length)return;const r=Xc();n=n||r.timeParse,i=i||r.utcParse;let s=e.columns||Object.keys(e[0]),o,a,l,u,c,f;t==="auto"&&(t=H4(e,s)),s=Object.keys(t);const d=s.map(h=>{const p=t[h];let g,m;if(p&&(p.startsWith("date:")||p.startsWith("utc:")))return g=p.split(/:(.+)?/,2),m=g[1],(m[0]==="'"&&m[m.length-1]==="'"||m[0]==='"'&&m[m.length-1]==='"')&&(m=m.slice(1,-1)),(g[0]==="utc"?i:n)(m);if(!R2[p])throw Error("Illegal format pattern: "+h+":"+p);return R2[p]});for(l=0,c=e.length,f=s.length;l{const s=t(r);return i[s]||(i[s]=1,n.push(r)),n},n.remove=r=>{const s=t(r);if(i[s]){i[s]=0;const o=n.indexOf(r);o>=0&&n.splice(o,1)}return n},n}async function Vh(e,t){try{await t(e)}catch(n){e.error(n)}}const Z4=Symbol("vega_id");let TH=1;function Yh(e){return!!(e&&$e(e))}function $e(e){return e[Z4]}function K4(e,t){return e[Z4]=t,e}function tt(e){const t=e===Object(e)?e:{data:e};return $e(t)?t:K4(t,TH++)}function P2(e){return Xh(e,tt({}))}function Xh(e,t){for(const n in e)t[n]=e[n];return t}function J4(e,t){return K4(t,$e(e))}function ba(e,t){return e?t?(n,i)=>e(n,i)||$e(t(n))-$e(t(i)):(n,i)=>e(n,i)||$e(n)-$e(i):null}function Q4(e){return e&&e.constructor===po}function po(){const e=[],t=[],n=[],i=[],r=[];let s=null,o=!1;return{constructor:po,insert(a){const l=se(a),u=l.length;for(let c=0;c{p(b)&&(u[$e(b)]=-1)});for(f=0,d=e.length;f0&&(y(g,p,h.value),a.modifies(p));for(f=0,d=r.length;f{p(b)&&u[$e(b)]>0&&y(b,h.field,h.value)}),a.modifies(h.field);if(o)a.mod=t.length||i.length?l.filter(b=>u[$e(b)]>0):l.slice();else for(m in c)a.mod.push(c[m]);return(s||s==null&&(t.length||i.length))&&a.clean(!0),a}}}const Zh="_:mod:_";function Kh(){Object.defineProperty(this,Zh,{writable:!0,value:{}})}Kh.prototype={set(e,t,n,i){const r=this,s=r[e],o=r[Zh];return t!=null&&t>=0?(s[t]!==n||i)&&(s[t]=n,o[t+":"+e]=-1,o[e]=-1):(s!==n||i)&&(r[e]=n,o[e]=G(n)?1+n.length:-1),r},modified(e,t){const n=this[Zh];if(arguments.length){if(G(e)){for(let i=0;i=0?t+1{h instanceof yt?(h!==this&&(t&&h.targets().add(this),s.push(h)),r.push({op:h,name:f,index:d})):i.set(f,d,h)};for(o in e)if(a=e[o],o===DH)se(a).forEach(f=>{f instanceof yt?f!==this&&(f.targets().add(this),s.push(f)):q("Pulse parameters must be operator instances.")}),this.source=a;else if(G(a))for(i.set(o,-1,Array(l=a.length)),u=0;u{const n=Date.now();return n-t>e?(t=n,1):0})},debounce(e){const t=go();return this.targets().add(go(null,null,Km(e,n=>{const i=n.dataflow;t.receive(n),i&&i.run&&i.run()}))),t},between(e,t){let n=!1;return e.targets().add(go(null,null,()=>n=!0)),t.targets().add(go(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=Ti,this._targets=null}};function zH(e,t,n,i){const r=this,s=go(n,i),o=function(u){u.dataflow=r;try{s.receive(u)}catch(c){r.error(c)}finally{r.run()}};let a;typeof e=="string"&&typeof document<"u"?a=document.querySelectorAll(e):a=se(e);const l=a.length;for(let u=0;ut=i);return n.requests=0,n.done=()=>{--n.requests===0&&(e._pending=null,t(e))},e._pending=n}const HH={skip:!0};function GH(e,t,n,i,r){return(e instanceof yt?YH:VH)(this,e,t,n,i,r),this}function VH(e,t,n,i,r,s){const o=Be({},s,HH);let a,l;ze(n)||(n=xn(n)),i===void 0?a=u=>e.touch(n(u)):ze(i)?(l=new yt(null,i,r,!1),a=u=>{l.evaluate(u);const c=n(u),f=l.value;Q4(f)?e.pulse(c,f,s):e.update(c,f,o)}):a=u=>e.update(n(u),i,o),t.apply(a)}function YH(e,t,n,i,r,s){if(i===void 0)t.targets().add(n);else{const o=s||{},a=new yt(null,XH(n,i),r,!1);a.modified(o.force),a.rank=t.rank,t.targets().add(a),n&&(a.skip(!0),a.value=n.value,a.targets().add(n),e.connect(n,[a]))}}function XH(e,t){return t=ze(t)?t:xn(t),e?function(n,i){const r=t(n,i);return e.skip()||(e.skip(r!==this.value).value=r),r}:t}function ZH(e){e.rank=++this._rank}function KH(e){const t=[e];let n,i,r;for(;t.length;)if(this.rank(n=t.pop()),i=n._targets)for(r=i.length;--r>=0;)t.push(n=i[r]),n===e&&q("Cycle detected in dataflow graph.")}const Qh={},Lr=1,mo=2,ks=4,JH=Lr|mo,t8=Lr|ks,tu=Lr|mo|ks,n8=8,Zc=16,i8=32,r8=64;function yo(e,t,n){this.dataflow=e,this.stamp=t??-1,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function z2(e,t){const n=[];return uo(e,t,i=>n.push(i)),n}function s8(e,t){const n={};return e.visit(t,i=>{n[$e(i)]=1}),i=>n[$e(i)]?null:i}function ep(e,t){return e?(n,i)=>e(n,i)&&t(n,i):t}yo.prototype={StopPropagation:Qh,ADD:Lr,REM:mo,MOD:ks,ADD_REM:JH,ADD_MOD:t8,ALL:tu,REFLOW:n8,SOURCE:Zc,NO_SOURCE:i8,NO_FIELDS:r8,fork(e){return new yo(this.dataflow).init(this,e)},clone(){const e=this.fork(tu);return e.add=e.add.slice(),e.rem=e.rem.slice(),e.mod=e.mod.slice(),e.source&&(e.source=e.source.slice()),e.materialize(tu|Zc)},addAll(){let e=this;return!e.source||e.add===e.rem||!e.rem.length&&e.source.length===e.add.length||(e=new yo(this.dataflow).init(this),e.add=e.source,e.rem=[]),e},init(e,t){const n=this;return n.stamp=e.stamp,n.encode=e.encode,e.fields&&!(t&r8)&&(n.fields=e.fields),t&Lr?(n.addF=e.addF,n.add=e.add):(n.addF=null,n.add=[]),t&mo?(n.remF=e.remF,n.rem=e.rem):(n.remF=null,n.rem=[]),t&ks?(n.modF=e.modF,n.mod=e.mod):(n.modF=null,n.mod=[]),t&i8?(n.srcF=null,n.source=null):(n.srcF=e.srcF,n.source=e.source,e.cleans&&(n.cleans=e.cleans)),n},runAfter(e){this.dataflow.runAfter(e)},changed(e){const t=e||tu;return t&Lr&&this.add.length||t&mo&&this.rem.length||t&ks&&this.mod.length},reflow(e){if(e)return this.fork(tu).reflow();const t=this.add.length,n=this.source&&this.source.length;return n&&n!==t&&(this.mod=this.source,t&&this.filter(ks,s8(this,Lr))),this},clean(e){return arguments.length?(this.cleans=!!e,this):this.cleans},modifies(e){const t=this.fields||(this.fields={});return G(e)?e.forEach(n=>t[n]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return(t||this.mod.length)&&n?arguments.length?G(e)?e.some(i=>n[i]):n[e]:!!n:!1},filter(e,t){const n=this;return e&Lr&&(n.addF=ep(n.addF,t)),e&mo&&(n.remF=ep(n.remF,t)),e&ks&&(n.modF=ep(n.modF,t)),e&Zc&&(n.srcF=ep(n.srcF,t)),n},materialize(e){e=e||tu;const t=this;return e&Lr&&t.addF&&(t.add=z2(t.add,t.addF),t.addF=null),e&mo&&t.remF&&(t.rem=z2(t.rem,t.remF),t.remF=null),e&ks&&t.modF&&(t.mod=z2(t.mod,t.modF),t.modF=null),e&Zc&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){const n=this,i=t;if(e&Zc)return uo(n.source,n.srcF,i),n;e&Lr&&uo(n.add,n.addF,i),e&mo&&uo(n.rem,n.remF,i),e&ks&&uo(n.mod,n.modF,i);const r=n.source;if(e&n8&&r){const s=n.add.length+n.mod.length;s===r.length||(s?uo(r,s8(n,t8),i):uo(r,n.srcF,i))}return n}};function B2(e,t,n,i){const r=this;let s=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=i||null,this.pulses=n;for(const o of n)if(o.stamp===t){if(o.fields){const a=r.fields||(r.fields={});for(const l in o.fields)a[l]=1}o.changed(r.ADD)&&(s|=r.ADD),o.changed(r.REM)&&(s|=r.REM),o.changed(r.MOD)&&(s|=r.MOD)}this.changes=s}te(B2,yo,{fork(e){const t=new yo(this.dataflow).init(this,e&this.NO_FIELDS);return e!==void 0&&(e&t.ADD&&this.visit(t.ADD,n=>t.add.push(n)),e&t.REM&&this.visit(t.REM,n=>t.rem.push(n)),e&t.MOD&&this.visit(t.MOD,n=>t.mod.push(n))),t},changed(e){return this.changes&e},modified(e){const t=this,n=t.fields;return n&&t.changes&t.MOD?G(e)?e.some(i=>n[i]):n[e]:0},filter(){q("MultiPulse does not support filtering.")},materialize(){q("MultiPulse does not support materialization.")},visit(e,t){const n=this,i=n.pulses,r=i.length;let s=0;if(e&n.SOURCE)for(;si._enqueue(c,!0)),i._touched=Gh(Mc);let o=0,a,l,u;try{for(;i._heap.size()>0;){if(a=i._heap.pop(),a.rank!==a.qrank){i._enqueue(a,!0);continue}l=a.run(i._getPulse(a,e)),l.then?l=await l:l.async&&(r.push(l.async),l=Qh),l!==Qh&&a._targets&&a._targets.forEach(c=>i._enqueue(c)),++o}}catch(c){i._heap.clear(),u=c}if(i._input={},i._pulse=null,i.debug(`Pulse ${s}: ${o} operators`),u&&(i._postrun=[],i.error(u)),i._postrun.length){const c=i._postrun.sort((f,d)=>d.priority-f.priority);i._postrun=[];for(let f=0;fi.runAsync(null,()=>{c.forEach(f=>{try{f(i)}catch(d){i.error(d)}})})),i}async function eG(e,t,n){for(;this._running;)await this._running;const i=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(i,i),this._running}function tG(e,t,n){return this._pulse?o8(this):(this.evaluate(e,t,n),this)}function nG(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(i){this.error(i)}}function o8(e){return e.error("Dataflow already running. Use runAsync() to chain invocations."),e}function iG(e,t){const n=e.stampr.pulse),t):this._input[e.id]||sG(this._pulse,n&&n.pulse)}function sG(e,t){return t&&t.stamp===e.stamp?t:(e=e.fork(),t&&t!==Qh&&(e.source=t.source),e)}const j2={skip:!1,force:!1};function oG(e,t){const n=t||j2;return this._pulse?this._enqueue(e):this._touched.add(e),n.skip&&e.skip(!0),this}function aG(e,t,n){const i=n||j2;return(e.set(t)||i.force)&&this.touch(e,i),this}function lG(e,t,n){this.touch(e,n||j2);const i=new yo(this,this._clock+(this._pulse?0:1)),r=e.pulse&&e.pulse.source||[];return i.target=e,this._input[e.id]=t.pulse(i,r),this}function uG(e){let t=[];return{clear:()=>t=[],size:()=>t.length,peek:()=>t[0],push:n=>(t.push(n),a8(t,0,t.length-1,e)),pop:()=>{const n=t.pop();let i;return t.length?(i=t[0],t[0]=n,cG(t,0,e)):i=n,i}}}function a8(e,t,n,i){let r,s;const o=e[n];for(;n>t;){if(s=n-1>>1,r=e[s],i(o,r)<0){e[n]=r,n=s;continue}break}return e[n]=o}function cG(e,t,n){const i=t,r=e.length,s=e[t];let o=(t<<1)+1,a;for(;o=0&&(o=a),e[t]=e[o],t=o,o=(t<<1)+1;return e[t]=s,a8(e,i,t,n)}function nu(){this.logger(Eh()),this.logLevel(Hm),this._clock=0,this._rank=0,this._locale=N2();try{this._loader=Hh()}catch{}this._touched=Gh(Mc),this._input={},this._pulse=null,this._heap=uG((e,t)=>e.qrank-t.qrank),this._postrun=[]}function Kc(e){return function(){return this._log[e].apply(this,arguments)}}nu.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:Kc("error"),warn:Kc("warn"),info:Kc("info"),debug:Kc("debug"),logLevel:Kc("level"),cleanThreshold:1e4,add:LH,connect:IH,rank:ZH,rerank:KH,pulse:lG,touch:oG,update:aG,changeset:po,ingest:jH,parse:BH,preload:qH,request:UH,events:zH,on:GH,evaluate:QH,run:tG,runAsync:eG,runAfter:nG,_enqueue:iG,_getPulse:rG};function j(e,t){yt.call(this,e,null,t)}te(j,yt,{run(e){if(e.stampthis.pulse=n):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const iu={};function l8(e){const t=u8(e);return t&&t.Definition||null}function u8(e){return e=e&&e.toLowerCase(),le(iu,e)?iu[e]:null}function*c8(e,t){if(t==null)for(let n of e)n!=null&&n!==""&&(n=+n)>=n&&(yield n);else{let n=-1;for(let i of e)i=t(i,++n,e),i!=null&&i!==""&&(i=+i)>=i&&(yield i)}}function U2(e,t,n){const i=Float64Array.from(c8(e,n));return i.sort(ys),t.map(r=>Nk(i,r))}function q2(e,t){return U2(e,[.25,.5,.75],t)}function W2(e,t){const n=e.length,i=_q(e,t),r=q2(e,t),s=(r[2]-r[0])/1.34;return 1.06*(Math.min(i,s)||i||Math.abs(r[0])||1)*Math.pow(n,-.2)}function f8(e){const t=e.maxbins||20,n=e.base||10,i=Math.log(n),r=e.divide||[5,2];let s=e.extent[0],o=e.extent[1],a,l,u,c,f,d;const h=e.span||o-s||Math.abs(s)||1;if(e.step)a=e.step;else if(e.steps){for(c=h/t,f=0,d=e.steps.length;ft;)a*=n;for(f=0,d=r.length;f=u&&h/c<=t&&(a=c)}c=Math.log(a);const p=c>=0?0:~~(-c/i)+1,g=Math.pow(n,-p-1);return(e.nice||e.nice===void 0)&&(c=Math.floor(s/a+g)*a,s=sd);const r=e.length,s=new Float64Array(r);let o=0,a=1,l=i(e[0]),u=l,c=l+t,f;for(;a=c){for(u=(l+u)/2;o>1);or;)e[o--]=e[i]}i=r,r=s}return e}function hG(e){return function(){return e=(1103515245*e+12345)%2147483647,e/2147483647}}function pG(e,t){t==null&&(t=e,e=0);let n,i,r;const s={min(o){return arguments.length?(n=o||0,r=i-n,s):n},max(o){return arguments.length?(i=o||0,r=i-n,s):i},sample(){return n+Math.floor(r*Ni())},pdf(o){return o===Math.floor(o)&&o>=n&&o=i?1:(a-n+1)/r},icdf(o){return o>=0&&o<=1?n-1+Math.floor(o*r):NaN}};return s.min(e).max(t)}const p8=Math.sqrt(2*Math.PI),gG=Math.SQRT2;let Jc=NaN;function tp(e,t){e=e||0,t=t??1;let n=0,i=0,r,s;if(Jc===Jc)n=Jc,Jc=NaN;else{do n=Ni()*2-1,i=Ni()*2-1,r=n*n+i*i;while(r===0||r>1);s=Math.sqrt(-2*Math.log(r)/r),n*=s,Jc=i*s}return e+n*t}function H2(e,t,n){n=n??1;const i=(e-(t||0))/n;return Math.exp(-.5*i*i)/(n*p8)}function np(e,t,n){t=t||0,n=n??1;const i=(e-t)/n,r=Math.abs(i);let s;if(r>37)s=0;else{const o=Math.exp(-r*r/2);let a;r<7.07106781186547?(a=.0352624965998911*r+.700383064443688,a=a*r+6.37396220353165,a=a*r+33.912866078383,a=a*r+112.079291497871,a=a*r+221.213596169931,a=a*r+220.206867912376,s=o*a,a=.0883883476483184*r+1.75566716318264,a=a*r+16.064177579207,a=a*r+86.7807322029461,a=a*r+296.564248779674,a=a*r+637.333633378831,a=a*r+793.826512519948,a=a*r+440.413735824752,s=s/a):(a=r+.65,a=r+4/a,a=r+3/a,a=r+2/a,a=r+1/a,s=o/a/2.506628274631)}return i>0?1-s:s}function ip(e,t,n){return e<0||e>1?NaN:(t||0)+(n??1)*gG*mG(2*e-1)}function mG(e){let t=-Math.log((1-e)*(1+e)),n;return t<6.25?(t-=3.125,n=-364441206401782e-35,n=-16850591381820166e-35+n*t,n=128584807152564e-32+n*t,n=11157877678025181e-33+n*t,n=-1333171662854621e-31+n*t,n=20972767875968562e-33+n*t,n=6637638134358324e-30+n*t,n=-4054566272975207e-29+n*t,n=-8151934197605472e-29+n*t,n=26335093153082323e-28+n*t,n=-12975133253453532e-27+n*t,n=-5415412054294628e-26+n*t,n=10512122733215323e-25+n*t,n=-4112633980346984e-24+n*t,n=-29070369957882005e-24+n*t,n=42347877827932404e-23+n*t,n=-13654692000834679e-22+n*t,n=-13882523362786469e-21+n*t,n=.00018673420803405714+n*t,n=-.000740702534166267+n*t,n=-.006033670871430149+n*t,n=.24015818242558962+n*t,n=1.6536545626831027+n*t):t<16?(t=Math.sqrt(t)-3.25,n=22137376921775787e-25,n=9075656193888539e-23+n*t,n=-27517406297064545e-23+n*t,n=18239629214389228e-24+n*t,n=15027403968909828e-22+n*t,n=-4013867526981546e-21+n*t,n=29234449089955446e-22+n*t,n=12475304481671779e-21+n*t,n=-47318229009055734e-21+n*t,n=6828485145957318e-20+n*t,n=24031110387097894e-21+n*t,n=-.0003550375203628475+n*t,n=.0009532893797373805+n*t,n=-.0016882755560235047+n*t,n=.002491442096107851+n*t,n=-.003751208507569241+n*t,n=.005370914553590064+n*t,n=1.0052589676941592+n*t,n=3.0838856104922208+n*t):Number.isFinite(t)?(t=Math.sqrt(t)-5,n=-27109920616438573e-27,n=-2555641816996525e-25+n*t,n=15076572693500548e-25+n*t,n=-3789465440126737e-24+n*t,n=761570120807834e-23+n*t,n=-1496002662714924e-23+n*t,n=2914795345090108e-23+n*t,n=-6771199775845234e-23+n*t,n=22900482228026655e-23+n*t,n=-99298272942317e-20+n*t,n=4526062597223154e-21+n*t,n=-1968177810553167e-20+n*t,n=7599527703001776e-20+n*t,n=-.00021503011930044477+n*t,n=-.00013871931833623122+n*t,n=1.0103004648645344+n*t,n=4.849906401408584+n*t):n=1/0,n*e}function G2(e,t){let n,i;const r={mean(s){return arguments.length?(n=s||0,r):n},stdev(s){return arguments.length?(i=s??1,r):i},sample:()=>tp(n,i),pdf:s=>H2(s,n,i),cdf:s=>np(s,n,i),icdf:s=>ip(s,n,i)};return r.mean(e).stdev(t)}function V2(e,t){const n=G2();let i=0;const r={data(s){return arguments.length?(e=s,i=s?s.length:0,r.bandwidth(t)):e},bandwidth(s){return arguments.length?(t=s,!t&&e&&(t=W2(e)),r):t},sample(){return e[~~(Ni()*i)]+t*n.sample()},pdf(s){let o=0,a=0;for(;aY2(n,i),pdf:s=>X2(s,n,i),cdf:s=>Z2(s,n,i),icdf:s=>K2(s,n,i)};return r.mean(e).stdev(t)}function m8(e,t){let n=0,i;function r(o){const a=[];let l=0,u;for(u=0;u=t&&e<=n?1/(n-t):0}function ey(e,t,n){return n==null&&(n=t??1,t=0),en?1:(e-t)/(n-t)}function ty(e,t,n){return n==null&&(n=t??1,t=0),e>=0&&e<=1?t+e*(n-t):NaN}function y8(e,t){let n,i;const r={min(s){return arguments.length?(n=s||0,r):n},max(s){return arguments.length?(i=s??1,r):i},sample:()=>J2(n,i),pdf:s=>Q2(s,n,i),cdf:s=>ey(s,n,i),icdf:s=>ty(s,n,i)};return t==null&&(t=e??1,e=0),r.min(e).max(t)}function ny(e,t,n){let i=0,r=0;for(const s of e){const o=n(s);t(s)==null||o==null||isNaN(o)||(i+=(o-i)/++r)}return{coef:[i],predict:()=>i,rSquared:0}}function Qc(e,t,n,i){const r=i-e*e,s=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-s*e,s]}function rp(e,t,n,i){e=e.filter(h=>{let p=t(h),g=n(h);return p!=null&&(p=+p)>=p&&g!=null&&(g=+g)>=g}),i&&e.sort((h,p)=>t(h)-t(p));const r=e.length,s=new Float64Array(r),o=new Float64Array(r);let a=0,l=0,u=0,c,f,d;for(d of e)s[a]=c=+t(d),o[a]=f=+n(d),++a,l+=(c-l)/a,u+=(f-u)/a;for(a=0;a=s&&o!=null&&(o=+o)>=o&&i(s,o,++r)}function ru(e,t,n,i,r){let s=0,o=0;return ef(e,t,n,(a,l)=>{const u=l-r(a),c=l-i;s+=u*u,o+=c*c}),1-s/o}function iy(e,t,n){let i=0,r=0,s=0,o=0,a=0;ef(e,t,n,(c,f)=>{++a,i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const l=Qc(i,r,s,o),u=c=>l[0]+l[1]*c;return{coef:l,predict:u,rSquared:ru(e,t,n,r,u)}}function b8(e,t,n){let i=0,r=0,s=0,o=0,a=0;ef(e,t,n,(c,f)=>{++a,c=Math.log(c),i+=(c-i)/a,r+=(f-r)/a,s+=(c*f-s)/a,o+=(c*c-o)/a});const l=Qc(i,r,s,o),u=c=>l[0]+l[1]*Math.log(c);return{coef:l,predict:u,rSquared:ru(e,t,n,r,u)}}function v8(e,t,n){const[i,r,s,o]=rp(e,t,n);let a=0,l=0,u=0,c=0,f=0,d,h,p;ef(e,t,n,(b,v)=>{d=i[f++],h=Math.log(v),p=d*v,a+=(v*h-a)/f,l+=(p-l)/f,u+=(p*h-u)/f,c+=(d*p-c)/f});const[g,m]=Qc(l/o,a/o,u/o,c/o),y=b=>Math.exp(g+m*(b-s));return{coef:[Math.exp(g-m*s),m],predict:y,rSquared:ru(e,t,n,o,y)}}function _8(e,t,n){let i=0,r=0,s=0,o=0,a=0,l=0;ef(e,t,n,(f,d)=>{const h=Math.log(f),p=Math.log(d);++l,i+=(h-i)/l,r+=(p-r)/l,s+=(h*p-s)/l,o+=(h*h-o)/l,a+=(d-a)/l});const u=Qc(i,r,s,o),c=f=>u[0]*Math.pow(f,u[1]);return u[0]=Math.exp(u[0]),{coef:u,predict:c,rSquared:ru(e,t,n,a,c)}}function ry(e,t,n){const[i,r,s,o]=rp(e,t,n),a=i.length;let l=0,u=0,c=0,f=0,d=0,h,p,g,m;for(h=0;h(w=w-s,v*w*w+_*w+x+o);return{coef:[x-_*s+v*s*s+o,_-2*v*s,v],predict:k,rSquared:ru(e,t,n,o,k)}}function x8(e,t,n,i){if(i===0)return ny(e,t,n);if(i===1)return iy(e,t,n);if(i===2)return ry(e,t,n);const[r,s,o,a]=rp(e,t,n),l=r.length,u=[],c=[],f=i+1;let d,h,p,g,m;for(d=0;d{v-=o;let _=a+y[0]+y[1]*v+y[2]*v*v;for(d=3;d=0;--s)for(a=t[s],l=1,r[s]+=a,o=1;o<=s;++o)l*=(s+1-o)/o,r[s-o]+=a*Math.pow(n,o)*l;return r[0]+=i,r}function bG(e){const t=e.length-1,n=[];let i,r,s,o,a;for(i=0;iMath.abs(e[i][o])&&(o=r);for(s=i;s=i;s--)e[s][r]-=e[s][i]*e[i][r]/e[i][i]}for(r=t-1;r>=0;--r){for(a=0,s=r+1;sr[v]-y?b:v;let x=0,k=0,w=0,E=0,$=0;const F=1/Math.abs(r[_]-y||1);for(let P=b;P<=v;++P){const M=r[P],S=s[P],D=vG(Math.abs(y-M)*F)*d[P],B=M*D;x+=D,k+=B,w+=S*D,E+=S*B,$+=M*B}const[A,z]=Qc(k/x,w/x,E/x,$/x);c[m]=A+z*y,f[m]=Math.abs(s[m]-c[m]),_G(r,m+1,p)}if(h===w8)break;const g=Rk(f);if(Math.abs(g)=1?k8:(b=1-y*y)*b}return xG(r,c,o,a)}function vG(e){return(e=1-e*e*e)*e*e}function _G(e,t,n){const i=e[t];let r=n[0],s=n[1]+1;if(!(s>=e.length))for(;t>r&&e[s]-i<=i-e[r];)n[0]=++r,n[1]=s,++s}function xG(e,t,n,i){const r=e.length,s=[];let o=0,a=0,l=[],u;for(;o[g,e(g)],s=t[0],o=t[1],a=o-s,l=a/i,u=[r(s)],c=[];if(n===i){for(let g=1;g0;)c.push(r(s+g/n*a))}let f=u[0],d=c[c.length-1];const h=1/a,p=kG(f[1],c);for(;d;){const g=r((f[0]+d[0])/2);g[0]-f[0]>=l&&EG(f,g,d,h,p)>wG?c.push(g):(f=d,u.push(d),c.pop()),d=c[c.length-1]}return u}function kG(e,t){let n=e,i=e;const r=t.length;for(let s=0;si&&(i=o)}return 1/(i-n)}function EG(e,t,n,i,r){const s=Math.atan2(r*(n[1]-e[1]),i*(n[0]-e[0])),o=Math.atan2(r*(t[1]-e[1]),i*(t[0]-e[0]));return Math.abs(s-o)}function $G(e){return t=>{const n=e.length;let i=1,r=String(e[0](t));for(;i{},SG={init:oy,add:oy,rem:oy,idx:0},tf={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.valid?e.sum:void 0,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>e.valid>1?e.dev/(e.valid-1):void 0,add:(e,t)=>e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>e.valid>1?e.dev/e.valid:void 0,req:["variance"],idx:2},stdev:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid-1)):void 0,req:["variance"],idx:2},stdevp:{value:e=>e.valid>1?Math.sqrt(e.dev/e.valid):void 0,req:["variance"],idx:2},stderr:{value:e=>e.valid>1?Math.sqrt(e.dev/(e.valid*(e.valid-1))):void 0,req:["variance"],idx:2},distinct:{value:e=>e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||e.max===void 0)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3},exponential:{init:(e,t)=>{e.exp=0,e.exp_r=t},value:e=>e.valid?e.exp*(1-e.exp_r)/(1-e.exp_r**e.valid):void 0,add:(e,t)=>e.exp=e.exp_r*e.exp+t,rem:(e,t)=>e.exp=(e.exp-t/e.exp_r**(e.valid-1))/e.exp_r},exponentialb:{value:e=>e.valid?e.exp*(1-e.exp_r):void 0,req:["exponential"],idx:1}},nf=Object.keys(tf).filter(e=>e!=="__count__");function CG(e,t){return(n,i)=>Be({name:e,aggregate_param:i,out:n||e},SG,t)}[...nf,"__count__"].forEach(e=>{tf[e]=CG(e,tf[e])});function S8(e,t,n){return tf[e](n,t)}function C8(e,t){return e.idx-t.idx}function AG(e){const t={};e.forEach(i=>t[i.name]=i);const n=i=>{i.req&&i.req.forEach(r=>{t[r]||n(t[r]=tf[r]())})};return e.forEach(n),Object.values(t).sort(C8)}function FG(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.aggregate_param==null?e.init(this):e.init(this,e.aggregate_param))}function TG(e,t){if(e==null||e===""){++this.missing;return}e===e&&(++this.valid,this._ops.forEach(n=>n.add(this,e,t)))}function MG(e,t){if(e==null||e===""){--this.missing;return}e===e&&(--this.valid,this._ops.forEach(n=>n.rem(this,e,t)))}function DG(e){return this._out.forEach(t=>e[t.out]=t.value(this)),e}function A8(e,t){const n=t||vn,i=AG(e),r=e.slice().sort(C8);function s(o){this._ops=i,this._out=r,this.cell=o,this.init()}return s.prototype.init=FG,s.prototype.add=TG,s.prototype.rem=MG,s.prototype.set=DG,s.prototype.get=n,s.fields=e.map(o=>o.out),s}function ay(e){this._key=e?Fi(e):$e,this.reset()}const ln=ay.prototype;ln.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},ln.add=function(e){this._add.push(e)},ln.rem=function(e){this._rem.push(e)},ln.values=function(){if(this._get=null,this._rem.length===0)return this._add;const e=this._add,t=this._rem,n=this._key,i=e.length,r=t.length,s=Array(i-r),o={};let a,l,u;for(a=0;a=0;)s=e(t[i])+"",le(n,s)||(n[s]=1,++r);return r},ln.extent=function(e){if(this._get!==e||!this._ext){const t=this.values(),n=dk(t,e);this._ext=[t[n[0]],t[n[1]]],this._get=e}return this._ext},ln.argmin=function(e){return this.extent(e)[0]||{}},ln.argmax=function(e){return this.extent(e)[1]||{}},ln.min=function(e){const t=this.extent(e)[0];return t!=null?e(t):void 0},ln.max=function(e){const t=this.extent(e)[1];return t!=null?e(t):void 0},ln.quartile=function(e){return(this._get!==e||!this._q)&&(this._q=q2(this.values(),e),this._get=e),this._q},ln.q1=function(e){return this.quartile(e)[0]},ln.q2=function(e){return this.quartile(e)[1]},ln.q3=function(e){return this.quartile(e)[2]},ln.ci=function(e){return(this._get!==e||!this._ci)&&(this._ci=d8(this.values(),1e3,.05,e),this._get=e),this._ci},ln.ci0=function(e){return this.ci(e)[0]},ln.ci1=function(e){return this.ci(e)[1]};function bo(e){j.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}bo.Definition={type:"Aggregate",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"ops",type:"enum",array:!0,values:nf},{name:"aggregate_params",type:"number",null:!0,array:!0},{name:"fields",type:"field",null:!0,array:!0},{name:"as",type:"string",null:!0,array:!0},{name:"drop",type:"boolean",default:!0},{name:"cross",type:"boolean",default:!1},{name:"key",type:"field"}]},te(bo,j,{transform(e,t){const n=this,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.modified();return n.stamp=i.stamp,n.value&&(r||t.modified(n._inputs,!0))?(n._prev=n.value,n.value=r?n.init(e):Object.create(null),t.visit(t.SOURCE,s=>n.add(s))):(n.value=n.value||n.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),i.modifies(n._outputs),n._drop=e.drop!==!1,e.cross&&n._dims.length>1&&(n._drop=!1,n.cross()),t.clean()&&n._drop&&i.clean(!0).runAfter(()=>this.clean()),n.changes(i)},cross(){const e=this,t=e.value,n=e._dnames,i=n.map(()=>({})),r=n.length;function s(a){let l,u,c,f;for(l in a)for(c=a[l].tuple,u=0;u{const v=Tt(b);return r(b),n.push(v),v}),this.cellkey=e.key?e.key:sy(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const s=e.fields||[null],o=e.ops||["count"],a=e.aggregate_params||[null],l=e.as||[],u=s.length,c={};let f,d,h,p,g,m,y;for(u!==o.length&&q("Unmatched number of fields and aggregate ops."),y=0;yA8(b,b.field)),Object.create(null)},cellkey:sy(),cell(e,t){let n=this.value[e];return n?n.num===0&&this._drop&&n.stamp{const f=i(c);c[a]=f,c[l]=f==null?null:r+s*(1+(f-r)/s)}:c=>c[a]=i(c)),t.modifies(n?o:a)},_bins(e){if(this.value&&!e.modified())return this.value;const t=e.field,n=f8(e),i=n.step;let r=n.start,s=r+Math.ceil((n.stop-r)/i)*i,o,a;(o=e.anchor)!=null&&(a=o-(r+i*Math.floor((o-r)/i)),r+=a,s+=a);const l=function(u){let c=_n(t(u));return c==null?null:cs?1/0:(c=Math.max(r,Math.min(c,s-i)),r+i*Math.floor(NG+(c-r)/i))};return l.start=r,l.stop=n.stop,l.step=i,this.value=Kn(l,bn(t),e.name||"bin_"+Tt(t))}});function F8(e,t,n){const i=e;let r=t||[],s=n||[],o={},a=0;return{add:l=>s.push(l),remove:l=>o[i(l)]=++a,size:()=>r.length,data:(l,u)=>(a&&(r=r.filter(c=>!o[i(c)]),o={},a=0),u&&l&&r.sort(l),s.length&&(r=l?yk(l,r,s.sort(l)):r.concat(s),s=[]),r)}}function uy(e){j.call(this,[],e)}uy.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},te(uy,j,{transform(e,t){const n=t.fork(t.ALL),i=F8($e,this.value,n.materialize(n.ADD).add),r=e.sort,s=t.changed()||r&&(e.modified("sort")||t.modified(r.fields));return n.visit(n.REM,i.remove),this.modified(s),this.value=n.source=i.data(ba(r),s),t.source&&t.source.root&&(this.value.root=t.source.root),n}});function T8(e){yt.call(this,null,RG,e)}te(T8,yt);function RG(e){return this.value&&!e.modified()?this.value:Zm(e.fields,e.orders)}function cy(e){j.call(this,null,e)}cy.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]};function OG(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase();break}return e.match(n)}te(cy,j,{transform(e,t){const n=f=>d=>{for(var h=OG(a(d),e.case,s)||[],p,g=0,m=h.length;gr[f]=1+(r[f]||0)),c=n(f=>r[f]-=1);return i?t.visit(t.SOURCE,u):(t.visit(t.ADD,u),t.visit(t.REM,c)),this._finish(t,l)},_parameterCheck(e,t){let n=!1;return(e.modified("stopwords")||!this._stop)&&(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),(e.modified("pattern")||!this._match)&&(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(e.modified("field")||t.modified(e.field.fields))&&(n=!0),n&&(this._counts={}),n},_finish(e,t){const n=this._counts,i=this._tuples||(this._tuples={}),r=t[0],s=t[1],o=e.fork(e.NO_SOURCE|e.NO_FIELDS);let a,l,u;for(a in n)l=i[a],u=n[a]||0,!l&&u?(i[a]=l=tt({}),l[r]=a,l[s]=u,o.add.push(l)):u===0?(l&&o.rem.push(l),n[a]=null,i[a]=null):l[s]!==u&&(l[s]=u,o.mod.push(l));return o.modifies(t)}});function fy(e){j.call(this,null,e)}fy.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},te(fy,j,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.as||["a","b"],r=i[0],s=i[1],o=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let a=this.value;return o?(a&&(n.rem=a),a=t.materialize(t.SOURCE).source,n.add=this.value=LG(a,r,s,e.filter||Ti)):n.mod=a,n.source=this.value,n.modifies(i)}});function LG(e,t,n,i){for(var r=[],s={},o=e.length,a=0,l,u;aN8(s,t))):typeof i[r]===D8&&i[r](e[r]);return i}function dy(e){j.call(this,null,e)}const R8=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:!0},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}],zG={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:!0,params:R8},{name:"weights",type:"number",array:!0}]};dy.Definition={type:"Density",metadata:{generates:!0},params:[{name:"extent",type:"number",array:!0,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:R8.concat(zG)},{name:"as",type:"string",array:!0,default:["value","density"]}]},te(dy,j,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=N8(e.distribution,BG(t)),r=e.steps||e.minsteps||25,s=e.steps||e.maxsteps||200;let o=e.method||"pdf";o!=="pdf"&&o!=="cdf"&&q("Invalid density method: "+o),!e.extent&&!i.data&&q("Missing density extent parameter."),o=i[o];const a=e.as||["value","density"],l=e.extent||Dr(i.data()),u=sp(o,l,r,s).map(c=>{const f={};return f[a[0]]=c[0],f[a[1]]=c[1],tt(f)});this.value&&(n.rem=this.value),this.value=n.add=n.source=u}return n}});function BG(e){return()=>e.materialize(e.SOURCE).source}function O8(e,t){return e?e.map((n,i)=>t[i]||Tt(n)):null}function hy(e,t,n){const i=[],r=f=>f(l);let s,o,a,l,u,c;if(t==null)i.push(e.map(n));else for(s={},o=0,a=e.length;oNc(Dr(e,t))/30;te(py,j,{transform(e,t){if(this.value&&!(e.modified()||t.changed()))return t;const n=t.materialize(t.SOURCE).source,i=hy(t.source,e.groupby,vn),r=e.smooth||!1,s=e.field,o=e.step||jG(n,s),a=ba((p,g)=>s(p)-s(g)),l=e.as||L8,u=i.length;let c=1/0,f=-1/0,d=0,h;for(;df&&(f=g),p[++h][l]=g}return this.value={start:c,stop:f,step:o},t.reflow(!0).modifies(l)}});function I8(e){yt.call(this,null,UG,e),this.modified(!0)}te(I8,yt);function UG(e){const t=e.expr;return this.value&&!e.modified("expr")?this.value:Kn(n=>t(n,e),bn(t),Tt(t))}function gy(e){j.call(this,[void 0,void 0],e)}gy.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},te(gy,j,{transform(e,t){const n=this.value,i=e.field,r=t.changed()||t.modified(i.fields)||e.modified("field");let s=n[0],o=n[1];if((r||s==null)&&(s=1/0,o=-1/0),t.visit(r?t.SOURCE:t.ADD,a=>{const l=_n(i(a));l!=null&&(lo&&(o=l))}),!Number.isFinite(s)||!Number.isFinite(o)){let a=Tt(i);a&&(a=` for field "${a}"`),t.dataflow.warn(`Infinite extent${a}: [${s}, ${o}]`),s=o=void 0}this.value=[s,o]}});function my(e,t){yt.call(this,e),this.parent=t,this.count=0}te(my,yt,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){this.count-=1,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}});function op(e){j.call(this,{},e),this._keys=Ul();const t=this._targets=[];t.active=0,t.forEach=n=>{for(let i=0,r=t.active;ii&&i.count>0);this.initTargets(n)}},initTargets(e){const t=this._targets,n=t.length,i=e?e.length:0;let r=0;for(;rthis.subflow(l,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,l=>{const u=$e(l),c=s.get(u);c!==void 0&&(s.delete(u),a(c).rem(l))}),t.visit(t.ADD,l=>{const u=i(l);s.set($e(l),u),a(u).add(l)}),o||t.modified(i.fields)?t.visit(t.MOD,l=>{const u=$e(l),c=s.get(u),f=i(l);c===f?a(f).mod(l):(s.set(u,f),a(c).rem(l),a(f).add(l))}):t.changed(t.MOD)&&t.visit(t.MOD,l=>{a(s.get($e(l))).mod(l)}),o&&t.visit(t.REFLOW,l=>{const u=$e(l),c=s.get(u),f=i(l);c!==f&&(s.set(u,f),a(c).rem(l),a(f).add(l))}),t.clean()?n.runAfter(()=>{this.clean(),s.clean()}):s.empty>n.cleanThreshold&&n.runAfter(s.clean),t}});function P8(e){yt.call(this,null,qG,e)}te(P8,yt);function qG(e){return this.value&&!e.modified()?this.value:G(e.name)?se(e.name).map(t=>Fi(t)):Fi(e.name,e.as)}function yy(e){j.call(this,Ul(),e)}yy.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},te(yy,j,{transform(e,t){const n=t.dataflow,i=this.value,r=t.fork(),s=r.add,o=r.rem,a=r.mod,l=e.expr;let u=!0;t.visit(t.REM,f=>{const d=$e(f);i.has(d)?i.delete(d):o.push(f)}),t.visit(t.ADD,f=>{l(f,e)?s.push(f):i.set($e(f),1)});function c(f){const d=$e(f),h=l(f,e),p=i.get(d);h&&p?(i.delete(d),s.push(f)):!h&&!p?(i.set(d,1),o.push(f)):u&&h&&!p&&a.push(f)}return t.visit(t.MOD,c),e.modified()&&(u=!1,t.visit(t.REFLOW,c)),i.empty>n.cleanThreshold&&n.runAfter(i.clean),r}});function by(e){j.call(this,[],e)}by.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},te(by,j,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=O8(i,e.as||[]),s=e.index||null,o=r.length;return n.rem=this.value,t.visit(t.SOURCE,a=>{const l=i.map(p=>p(a)),u=l.reduce((p,g)=>Math.max(p,g.length),0);let c=0,f,d,h;for(;c{for(let c=0,f;co[i]=n(o,e))}});function z8(e){j.call(this,[],e)}te(z8,j,{transform(e,t){const n=t.fork(t.ALL),i=e.generator;let r=this.value,s=e.size-r.length,o,a,l;if(s>0){for(o=[];--s>=0;)o.push(l=tt(i(e))),r.push(l);n.add=n.add.length?n.materialize(n.ADD).add.concat(o):o}else a=r.slice(0,-s),n.rem=n.rem.length?n.materialize(n.REM).rem.concat(a):a,r=r.slice(-s);return n.source=this.value=r,n}});const ap={value:"value",median:Rk,mean:Sq,min:u2,max:ha},WG=[];function xy(e){j.call(this,[],e)}xy.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function HG(e){var t=e.method||ap.value,n;if(ap[t]==null)q("Unrecognized imputation method: "+t);else return t===ap.value?(n=e.value!==void 0?e.value:0,()=>n):ap[t]}function GG(e){const t=e.field;return n=>n?t(n):NaN}te(xy,j,{transform(e,t){var n=t.fork(t.ALL),i=HG(e),r=GG(e),s=Tt(e.field),o=Tt(e.key),a=(e.groupby||[]).map(Tt),l=VG(t.source,e.groupby,e.key,e.keyvals),u=[],c=this.value,f=l.domain.length,d,h,p,g,m,y,b,v,_,x;for(m=0,v=l.length;my(m),s=[],o=i?i.slice():[],a={},l={},u,c,f,d,h,p,g,m;for(o.forEach((y,b)=>a[y]=b+1),d=0,g=e.length;dn.add(s))):(r=n.value=n.value||this.init(e),t.visit(t.REM,s=>n.rem(s)),t.visit(t.ADD,s=>n.add(s))),n.changes(),t.visit(t.SOURCE,s=>{Be(s,r[n.cellkey(s)].tuple)}),t.reflow(i).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,i;for(n=0,i=this._alen;n{const p=V2(h,o)[a],g=e.counts?h.length:1,m=c||Dr(h);sp(p,m,f,d).forEach(y=>{const b={};for(let v=0;v(this._pending=se(r.data),s=>s.touch(this)))}:n.request(e.url,e.format).then(i=>Ey(this,t,se(i.data)))}});function XG(e){return e.modified("async")&&!(e.modified("values")||e.modified("url")||e.modified("format"))}function Ey(e,t,n){n.forEach(tt);const i=t.fork(t.NO_FIELDS&t.NO_SOURCE);return i.rem=e.value,e.value=i.source=i.add=n,e._pending=null,i.rem.length&&i.clean(!0),i}function $y(e){j.call(this,{},e)}$y.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},te($y,j,{transform(e,t){const n=e.fields,i=e.index,r=e.values,s=e.default==null?null:e.default,o=e.modified(),a=n.length;let l=o?t.SOURCE:t.ADD,u=t,c=e.as,f,d,h;return r?(d=r.length,a>1&&!c&&q('Multi-field lookup requires explicit "as" parameter.'),c&&c.length!==a*d&&q('The "as" parameter has too few output field names.'),c=c||r.map(Tt),f=function(p){for(var g=0,m=0,y,b;gt.modified(p.fields)),l|=h?t.MOD:0),t.visit(l,f),u.modifies(c)}});function U8(e){yt.call(this,null,ZG,e)}te(U8,yt);function ZG(e){if(this.value&&!e.modified())return this.value;const t=e.extents,n=t.length;let i=1/0,r=-1/0,s,o;for(s=0;sr&&(r=o[1]);return[i,r]}function q8(e){yt.call(this,null,KG,e)}te(q8,yt);function KG(e){return this.value&&!e.modified()?this.value:e.values.reduce((t,n)=>t.concat(n),[])}function W8(e){j.call(this,null,e)}te(W8,j,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function Sy(e){bo.call(this,e)}Sy.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:nf,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},te(Sy,bo,{_transform:bo.prototype.transform,transform(e,t){return this._transform(JG(e,t),t)}});function JG(e,t){const n=e.field,i=e.value,r=(e.op==="count"?"__count__":e.op)||"sum",s=bn(n).concat(bn(i)),o=eV(n,e.limit||0,t);return t.changed()&&e.set("__pivot__",null,null,!0),{key:e.key,groupby:e.groupby,ops:o.map(()=>r),fields:o.map(a=>QG(a,n,i,s)),as:o.map(a=>a+""),modified:e.modified.bind(e)}}function QG(e,t,n,i){return Kn(r=>t(r)===e?n(r):NaN,i,e+"")}function eV(e,t,n){const i={},r=[];return n.visit(n.SOURCE,s=>{const o=e(s);i[o]||(i[o]=1,r.push(o))}),r.sort(jl),t?r.slice(0,t):r}function H8(e){op.call(this,e)}te(H8,op,{transform(e,t){const n=e.subflow,i=e.field,r=s=>this.subflow($e(s),n,t,s);return(e.modified("field")||i&&t.modified(bn(i)))&&q("PreFacet does not support field modification."),this.initTargets(),i?(t.visit(t.MOD,s=>{const o=r(s);i(s).forEach(a=>o.mod(a))}),t.visit(t.ADD,s=>{const o=r(s);i(s).forEach(a=>o.add(tt(a)))}),t.visit(t.REM,s=>{const o=r(s);i(s).forEach(a=>o.rem(a))})):(t.visit(t.MOD,s=>r(s).mod(s)),t.visit(t.ADD,s=>r(s).add(s)),t.visit(t.REM,s=>r(s).rem(s))),t.clean()&&t.runAfter(()=>this.clean()),t}});function Cy(e){j.call(this,null,e)}Cy.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},te(Cy,j,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.fields,r=O8(e.fields,e.as||[]),s=i?(a,l)=>tV(a,l,i,r):Xh;let o;return this.value?o=this.value:(t=t.addAll(),o=this.value={}),t.visit(t.REM,a=>{const l=$e(a);n.rem.push(o[l]),o[l]=null}),t.visit(t.ADD,a=>{const l=s(a,tt({}));o[$e(a)]=l,n.add.push(l)}),t.visit(t.MOD,a=>{n.mod.push(s(a,o[$e(a)]))}),n}});function tV(e,t,n,i){for(let r=0,s=n.length;r{const d=U2(f,u);for(let h=0;h{const s=$e(r);n.rem.push(i[s]),i[s]=null}),t.visit(t.ADD,r=>{const s=P2(r);i[$e(r)]=s,n.add.push(s)}),t.visit(t.MOD,r=>{const s=i[$e(r)];for(const o in r)s[o]=r[o],n.modifies(o);n.mod.push(s)})),n}});function Fy(e){j.call(this,[],e),this.count=0}Fy.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},te(Fy,j,{transform(e,t){const n=t.fork(t.NO_SOURCE),i=e.modified("size"),r=e.size,s=this.value.reduce((c,f)=>(c[$e(f)]=1,c),{});let o=this.value,a=this.count,l=0;function u(c){let f,d;o.length=l&&(f=o[d],s[$e(f)]&&n.rem.push(f),o[d]=c)),++a}if(t.rem.length&&(t.visit(t.REM,c=>{const f=$e(c);s[f]&&(s[f]=-1,n.rem.push(c)),--a}),o=o.filter(c=>s[$e(c)]!==-1)),(t.rem.length||i)&&o.length{s[$e(c)]||u(c)}),l=-1),i&&o.length>r){const c=o.length-r;for(let f=0;f{s[$e(c)]&&n.mod.push(c)}),t.add.length&&t.visit(t.ADD,u),(t.add.length||l<0)&&(n.add=o.filter(c=>!s[$e(c)])),this.count=a,this.value=n.source=o,n}});function Ty(e){j.call(this,null,e)}Ty.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},te(Ty,j,{transform(e,t){if(this.value&&!e.modified())return;const n=t.materialize().fork(t.MOD),i=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=hi(e.start,e.stop,e.step||1).map(r=>{const s={};return s[i]=r,tt(s)}),n.add=t.add.concat(this.value),n}});function Y8(e){j.call(this,null,e),this.modified(!0)}te(Y8,j,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});function My(e){j.call(this,null,e)}const X8=["unit0","unit1"];My.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:y2,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:X8}]},te(My,j,{transform(e,t){const n=e.field,i=e.interval!==!1,r=e.timezone==="utc",s=this._floor(e,t),o=(r?Ql:Jl)(s.unit).offset,a=e.as||X8,l=a[0],u=a[1],c=s.step;let f=s.start||1/0,d=s.stop||-1/0,h=t.ADD;return(e.modified()||t.changed(t.REM)||t.modified(bn(n)))&&(t=t.reflow(!0),h=t.SOURCE,f=1/0,d=-1/0),t.visit(h,p=>{const g=n(p);let m,y;g==null?(p[l]=null,i&&(p[u]=null)):(p[l]=m=y=s(g),i&&(p[u]=y=o(m,c)),md&&(d=y))}),s.start=f,s.stop=d,t.modifies(i?a:l)},_floor(e,t){const n=e.timezone==="utc",{units:i,step:r}=e.units?{units:e.units,step:e.step||1}:m4({extent:e.extent||Dr(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins}),s=v2(i),o=this.value||{},a=(n?s4:r4)(s,r);return a.unit=Ve(s),a.units=s,a.step=r,a.start=o.start,a.stop=o.stop,this.value=a}});function Z8(e){j.call(this,Ul(),e)}te(Z8,j,{transform(e,t){const n=t.dataflow,i=e.field,r=this.value,s=a=>r.set(i(a),a);let o=!0;return e.modified("field")||t.modified(i.fields)?(r.clear(),t.visit(t.SOURCE,s)):t.changed()?(t.visit(t.REM,a=>r.delete(i(a))),t.visit(t.ADD,s)):o=!1,this.modified(o),r.empty>n.cleanThreshold&&n.runAfter(r.clean),t.fork()}});function K8(e){j.call(this,null,e)}te(K8,j,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(ba(e.sort)):t.source).map(e.field))}});function iV(e,t,n,i){const r=rf[e](t,n);return{init:r.init||so,update:function(s,o){o[i]=r.next(s)}}}const rf={row_number:function(){return{next:e=>e.index+1}},rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?e=n+1:e}}},dense_rank:function(){let e;return{init:()=>e=1,next:t=>{const n=t.index,i=t.data;return n&&t.compare(i[n-1],i[n])?++e:e}}},percent_rank:function(){const e=rf.rank(),t=e.next;return{init:e.init,next:n=>(t(n)-1)/(n.data.length-1)}},cume_dist:function(){let e;return{init:()=>e=0,next:t=>{const n=t.data,i=t.compare;let r=t.index;if(e0||q("ntile num must be greater than zero.");const n=rf.cume_dist(),i=n.next;return{init:n.init,next:r=>Math.ceil(t*i(r))}},lag:function(e,t){return t=+t||1,{next:n=>{const i=n.index-t;return i>=0?e(n.data[i]):null}}},lead:function(e,t){return t=+t||1,{next:n=>{const i=n.index+t,r=n.data;return ie(t.data[t.i0])}},last_value:function(e){return{next:t=>e(t.data[t.i1-1])}},nth_value:function(e,t){return t=+t,t>0||q("nth_value nth must be greater than zero."),{next:n=>{const i=n.i0+(t-1);return it=null,next:n=>{const i=e(n.data[n.index]);return i!=null?t=i:t}}},next_value:function(e){let t,n;return{init:()=>(t=null,n=-1),next:i=>{const r=i.data;return i.index<=n?t:(n=rV(e,r,i.index))<0?(n=r.length,t=null):t=e(r[n])}}}};function rV(e,t,n){for(let i=t.length;nl[g]=1)}h(e.sort),t.forEach((p,g)=>{const m=n[g],y=i[g],b=r[g]||null,v=Tt(m),_=$8(p,v,s[g]);if(h(m),o.push(_),le(rf,p))a.push(iV(p,m,y,_));else{if(m==null&&p!=="count"&&q("Null aggregate field specified."),p==="count"){c.push(_);return}d=!1;let x=u[v];x||(x=u[v]=[],x.field=m,f.push(x)),x.push(S8(p,b,_))}}),(c.length||f.length)&&(this.cell=oV(f,c,d)),this.inputs=Object.keys(l)}const Q8=J8.prototype;Q8.init=function(){this.windows.forEach(e=>e.init()),this.cell&&this.cell.init()},Q8.update=function(e,t){const n=this.cell,i=this.windows,r=e.data,s=i&&i.length;let o;if(n){for(o=e.p0;oA8(l,l.field));const i={num:0,agg:null,store:!1,count:t};if(!n)for(var r=e.length,s=i.agg=Array(r),o=0;othis.group(r(a));let o=this.state;(!o||n)&&(o=this.state=new J8(e)),n||t.modified(o.inputs)?(this.value={},t.visit(t.SOURCE,a=>s(a).add(a))):(t.visit(t.REM,a=>s(a).remove(a)),t.visit(t.ADD,a=>s(a).add(a)));for(let a=0,l=this._mlen;a0&&!r(s[n],s[n-1])&&(e.i0=t.left(s,s[n])),i1?0:e<-1?su:Math.acos(e)}function n9(e){return e>=1?lp:e<=-1?-lp:Math.asin(e)}const Ry=Math.PI,Oy=2*Ry,xa=1e-6,hV=Oy-xa;function i9(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return i9;const n=10**t;return function(i){this._+=i[0];for(let r=1,s=i.length;rxa)if(!(Math.abs(f*l-u*c)>xa)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let h=i-o,p=r-a,g=l*l+u*u,m=h*h+p*p,y=Math.sqrt(g),b=Math.sqrt(d),v=s*Math.tan((Ry-Math.acos((g+d-m)/(2*y*b)))/2),_=v/b,x=v/y;Math.abs(_-1)>xa&&this._append`L${t+_*c},${n+_*f}`,this._append`A${s},${s},0,0,${+(f*h>c*p)},${this._x1=t+x*l},${this._y1=n+x*u}`}}arc(t,n,i,r,s,o){if(t=+t,n=+n,i=+i,o=!!o,i<0)throw new Error(`negative radius: ${i}`);let a=i*Math.cos(r),l=i*Math.sin(r),u=t+a,c=n+l,f=1^o,d=o?r-s:s-r;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>xa||Math.abs(this._y1-c)>xa)&&this._append`L${u},${c}`,i&&(d<0&&(d=d%Oy+Oy),d>hV?this._append`A${i},${i},0,1,${f},${t-a},${n-l}A${i},${i},0,1,${f},${this._x1=u},${this._y1=c}`:d>xa&&this._append`A${i},${i},0,${+(d>=Ry)},${f},${this._x1=t+i*Math.cos(s)},${this._y1=n+i*Math.sin(s)}`)}rect(t,n,i,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${i=+i}v${+r}h${-i}Z`}toString(){return this._}};function up(){return new Ly}up.prototype=Ly.prototype;function cp(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);t=i}return e},()=>new Ly(t)}function gV(e){return e.innerRadius}function mV(e){return e.outerRadius}function yV(e){return e.startAngle}function bV(e){return e.endAngle}function vV(e){return e&&e.padAngle}function _V(e,t,n,i,r,s,o,a){var l=n-e,u=i-t,c=o-r,f=a-s,d=f*l-c*u;if(!(d*d<$n))return d=(c*(t-s)-f*(e-r))/d,[e+d*l,t+d*u]}function fp(e,t,n,i,r,s,o){var a=e-n,l=t-i,u=(o?s:-s)/_a(a*a+l*l),c=u*l,f=-u*a,d=e+c,h=t+f,p=n+c,g=i+f,m=(d+p)/2,y=(h+g)/2,b=p-d,v=g-h,_=b*b+v*v,x=r-s,k=d*g-p*h,w=(v<0?-1:1)*_a(fV(0,x*x*_-k*k)),E=(k*v-b*w)/_,$=(-k*b-v*w)/_,F=(k*v+b*w)/_,A=(-k*b+v*w)/_,z=E-m,P=$-y,M=F-m,S=A-y;return z*z+P*P>M*M+S*S&&(E=F,$=A),{cx:E,cy:$,x01:-c,y01:-f,x11:E*(r/x-1),y11:$*(r/x-1)}}function xV(){var e=gV,t=mV,n=rt(0),i=null,r=yV,s=bV,o=vV,a=null,l=cp(u);function u(){var c,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=r.apply(this,arguments)-lp,g=s.apply(this,arguments)-lp,m=e9(g-p),y=g>p;if(a||(a=c=l()),h$n))a.moveTo(0,0);else if(m>t9-$n)a.moveTo(h*va(p),h*Ir(p)),a.arc(0,0,h,p,g,!y),d>$n&&(a.moveTo(d*va(g),d*Ir(g)),a.arc(0,0,d,g,p,y));else{var b=p,v=g,_=p,x=g,k=m,w=m,E=o.apply(this,arguments)/2,$=E>$n&&(i?+i.apply(this,arguments):_a(d*d+h*h)),F=Ny(e9(h-d)/2,+n.apply(this,arguments)),A=F,z=F,P,M;if($>$n){var S=n9($/d*Ir(E)),D=n9($/h*Ir(E));(k-=S*2)>$n?(S*=y?1:-1,_+=S,x-=S):(k=0,_=x=(p+g)/2),(w-=D*2)>$n?(D*=y?1:-1,b+=D,v-=D):(w=0,b=v=(p+g)/2)}var B=h*va(b),V=h*Ir(b),H=d*va(x),oe=d*Ir(x);if(F>$n){var we=h*va(v),xe=h*Ir(v),Re=d*va(_),nt=d*Ir(_),Ie;if(m$n?z>$n?(P=fp(Re,nt,B,V,h,z,y),M=fp(we,xe,H,oe,h,z,y),a.moveTo(P.cx+P.x01,P.cy+P.y01),z$n)||!(k>$n)?a.lineTo(H,oe):A>$n?(P=fp(H,oe,we,xe,d,-A,y),M=fp(B,V,Re,nt,d,-A,y),a.lineTo(P.cx+P.x01,P.cy+P.y01),A=h;--p)a.point(v[p],_[p]);a.lineEnd(),a.areaEnd()}y&&(v[d]=+e(m,d,f),_[d]=+t(m,d,f),a.point(i?+i(m,d,f):v[d],n?+n(m,d,f):_[d]))}if(b)return a=null,b+""||null}function c(){return l9().defined(r).curve(o).context(s)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:rt(+f),i=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:rt(+f),u):e},u.x1=function(f){return arguments.length?(i=f==null?null:typeof f=="function"?f:rt(+f),u):i},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:rt(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:rt(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:rt(+f),u):n},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(n)},u.lineX1=function(){return c().x(i).y(t)},u.defined=function(f){return arguments.length?(r=typeof f=="function"?f:rt(!!f),u):r},u.curve=function(f){return arguments.length?(o=f,s!=null&&(a=o(s)),u):o},u.context=function(f){return arguments.length?(f==null?s=a=null:a=o(s=f),u):s},u}const wV={draw(e,t){const n=_a(t/su);e.moveTo(n,0),e.arc(0,0,n,0,t9)}};function kV(e,t){let n=null,i=cp(r);e=typeof e=="function"?e:rt(e||wV),t=typeof t=="function"?t:rt(t===void 0?64:+t);function r(){let s;if(n||(n=s=i()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),s)return n=null,s+""||null}return r.type=function(s){return arguments.length?(e=typeof s=="function"?s:rt(s),r):e},r.size=function(s){return arguments.length?(t=typeof s=="function"?s:rt(+s),r):t},r.context=function(s){return arguments.length?(n=s??null,r):n},r}function vo(){}function dp(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function hp(e){this._context=e}hp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:dp(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:dp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function EV(e){return new hp(e)}function c9(e){this._context=e}c9.prototype={areaStart:vo,areaEnd:vo,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:dp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function $V(e){return new c9(e)}function f9(e){this._context=e}f9.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,i=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:dp(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function SV(e){return new f9(e)}function d9(e,t){this._basis=new hp(e),this._beta=t}d9.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var i=e[0],r=t[0],s=e[n]-i,o=t[n]-r,a=-1,l;++a<=n;)l=a/n,this._basis.point(this._beta*e[a]+(1-this._beta)*(i+l*s),this._beta*t[a]+(1-this._beta)*(r+l*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};const CV=function e(t){function n(i){return t===1?new hp(i):new d9(i,t)}return n.beta=function(i){return e(+i)},n}(.85);function pp(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Py(e,t){this._context=e,this._k=(1-t)/6}Py.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:pp(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:pp(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const AV=function e(t){function n(i){return new Py(i,t)}return n.tension=function(i){return e(+i)},n}(0);function zy(e,t){this._context=e,this._k=(1-t)/6}zy.prototype={areaStart:vo,areaEnd:vo,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:pp(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const FV=function e(t){function n(i){return new zy(i,t)}return n.tension=function(i){return e(+i)},n}(0);function By(e,t){this._context=e,this._k=(1-t)/6}By.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:pp(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const TV=function e(t){function n(i){return new By(i,t)}return n.tension=function(i){return e(+i)},n}(0);function jy(e,t,n){var i=e._x1,r=e._y1,s=e._x2,o=e._y2;if(e._l01_a>$n){var a=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);i=(i*a-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,r=(r*a-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>$n){var u=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,c=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*u+e._x1*e._l23_2a-t*e._l12_2a)/c,o=(o*u+e._y1*e._l23_2a-n*e._l12_2a)/c}e._context.bezierCurveTo(i,r,s,o,e._x2,e._y2)}function h9(e,t){this._context=e,this._alpha=t}h9.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:jy(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const MV=function e(t){function n(i){return t?new h9(i,t):new Py(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function p9(e,t){this._context=e,this._alpha=t}p9.prototype={areaStart:vo,areaEnd:vo,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:jy(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const DV=function e(t){function n(i){return t?new p9(i,t):new zy(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function g9(e,t){this._context=e,this._alpha=t}g9.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,i=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:jy(this,e,t);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const NV=function e(t){function n(i){return t?new g9(i,t):new By(i,0)}return n.alpha=function(i){return e(+i)},n}(.5);function m9(e){this._context=e}m9.prototype={areaStart:vo,areaEnd:vo,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function RV(e){return new m9(e)}function y9(e){return e<0?-1:1}function b9(e,t,n){var i=e._x1-e._x0,r=t-e._x1,s=(e._y1-e._y0)/(i||r<0&&-0),o=(n-e._y1)/(r||i<0&&-0),a=(s*r+o*i)/(i+r);return(y9(s)+y9(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(a))||0}function v9(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Uy(e,t,n){var i=e._x0,r=e._y0,s=e._x1,o=e._y1,a=(s-i)/3;e._context.bezierCurveTo(i+a,r+a*t,s-a,o-a*n,s,o)}function gp(e){this._context=e}gp.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Uy(this,this._t0,v9(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Uy(this,v9(this,n=b9(this,e,t)),n);break;default:Uy(this,this._t0,n=b9(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function _9(e){this._context=new x9(e)}(_9.prototype=Object.create(gp.prototype)).point=function(e,t){gp.prototype.point.call(this,t,e)};function x9(e){this._context=e}x9.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,i,r,s){this._context.bezierCurveTo(t,e,i,n,s,r)}};function OV(e){return new gp(e)}function LV(e){return new _9(e)}function w9(e){this._context=e}w9.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var i=k9(e),r=k9(t),s=0,o=1;o=0;--t)r[t]=(o[t]-r[t+1])/s[t];for(s[n-1]=(e[n]+r[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function PV(e){return new mp(e,.5)}function zV(e){return new mp(e,0)}function BV(e){return new mp(e,1)}function _o(e,t){if(typeof document<"u"&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext)return n.width=e,n.height=t,n}return null}const jV=()=>typeof Image<"u"?Image:null;function Pr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function xo(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const qy=Symbol("implicit");function Wy(){var e=new Ck,t=[],n=[],i=qy;function r(s){let o=e.get(s);if(o===void 0){if(i!==qy)return i;e.set(s,o=t.push(s)-1)}return n[o%n.length]}return r.domain=function(s){if(!arguments.length)return t.slice();t=[],e=new Ck;for(const o of s)e.has(o)||e.set(o,t.push(o)-1);return r},r.range=function(s){return arguments.length?(n=Array.from(s),r):n.slice()},r.unknown=function(s){return arguments.length?(i=s,r):i},r.copy=function(){return Wy(t,n).unknown(i)},Pr.apply(r,arguments),r}function ou(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function sf(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function wo(){}var wa=.7,au=1/wa,lu="\\s*([+-]?\\d+)\\s*",of="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",zr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",UV=/^#([0-9a-f]{3,8})$/,qV=new RegExp(`^rgb\\(${lu},${lu},${lu}\\)$`),WV=new RegExp(`^rgb\\(${zr},${zr},${zr}\\)$`),HV=new RegExp(`^rgba\\(${lu},${lu},${lu},${of}\\)$`),GV=new RegExp(`^rgba\\(${zr},${zr},${zr},${of}\\)$`),VV=new RegExp(`^hsl\\(${of},${zr},${zr}\\)$`),YV=new RegExp(`^hsla\\(${of},${zr},${zr},${of}\\)$`),E9={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ou(wo,af,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:$9,formatHex:$9,formatHex8:XV,formatHsl:ZV,formatRgb:S9,toString:S9});function $9(){return this.rgb().formatHex()}function XV(){return this.rgb().formatHex8()}function ZV(){return M9(this).formatHsl()}function S9(){return this.rgb().formatRgb()}function af(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=UV.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?C9(t):n===3?new Zt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?yp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?yp(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=qV.exec(e))?new Zt(t[1],t[2],t[3],1):(t=WV.exec(e))?new Zt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=HV.exec(e))?yp(t[1],t[2],t[3],t[4]):(t=GV.exec(e))?yp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=VV.exec(e))?T9(t[1],t[2]/100,t[3]/100,1):(t=YV.exec(e))?T9(t[1],t[2]/100,t[3]/100,t[4]):E9.hasOwnProperty(e)?C9(E9[e]):e==="transparent"?new Zt(NaN,NaN,NaN,0):null}function C9(e){return new Zt(e>>16&255,e>>8&255,e&255,1)}function yp(e,t,n,i){return i<=0&&(e=t=n=NaN),new Zt(e,t,n,i)}function Hy(e){return e instanceof wo||(e=af(e)),e?(e=e.rgb(),new Zt(e.r,e.g,e.b,e.opacity)):new Zt}function ko(e,t,n,i){return arguments.length===1?Hy(e):new Zt(e,t,n,i??1)}function Zt(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}ou(Zt,ko,sf(wo,{brighter(e){return e=e==null?au:Math.pow(au,e),new Zt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?wa:Math.pow(wa,e),new Zt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Zt(ka(this.r),ka(this.g),ka(this.b),bp(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:A9,formatHex:A9,formatHex8:KV,formatRgb:F9,toString:F9}));function A9(){return`#${Ea(this.r)}${Ea(this.g)}${Ea(this.b)}`}function KV(){return`#${Ea(this.r)}${Ea(this.g)}${Ea(this.b)}${Ea((isNaN(this.opacity)?1:this.opacity)*255)}`}function F9(){const e=bp(this.opacity);return`${e===1?"rgb(":"rgba("}${ka(this.r)}, ${ka(this.g)}, ${ka(this.b)}${e===1?")":`, ${e})`}`}function bp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ka(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ea(e){return e=ka(e),(e<16?"0":"")+e.toString(16)}function T9(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new nr(e,t,n,i)}function M9(e){if(e instanceof nr)return new nr(e.h,e.s,e.l,e.opacity);if(e instanceof wo||(e=af(e)),!e)return new nr;if(e instanceof nr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,i=e.b/255,r=Math.min(t,n,i),s=Math.max(t,n,i),o=NaN,a=s-r,l=(s+r)/2;return a?(t===s?o=(n-i)/a+(n0&&l<1?0:o,new nr(o,a,l,e.opacity)}function vp(e,t,n,i){return arguments.length===1?M9(e):new nr(e,t,n,i??1)}function nr(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}ou(nr,vp,sf(wo,{brighter(e){return e=e==null?au:Math.pow(au,e),new nr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?wa:Math.pow(wa,e),new nr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,r=2*n-i;return new Zt(Gy(e>=240?e-240:e+120,r,i),Gy(e,r,i),Gy(e<120?e+240:e-120,r,i),this.opacity)},clamp(){return new nr(D9(this.h),_p(this.s),_p(this.l),bp(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=bp(this.opacity);return`${e===1?"hsl(":"hsla("}${D9(this.h)}, ${_p(this.s)*100}%, ${_p(this.l)*100}%${e===1?")":`, ${e})`}`}}));function D9(e){return e=(e||0)%360,e<0?e+360:e}function _p(e){return Math.max(0,Math.min(1,e||0))}function Gy(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const N9=Math.PI/180,R9=180/Math.PI,xp=18,O9=.96422,L9=1,I9=.82521,P9=4/29,uu=6/29,z9=3*uu*uu,JV=uu*uu*uu;function B9(e){if(e instanceof Br)return new Br(e.l,e.a,e.b,e.opacity);if(e instanceof Es)return j9(e);e instanceof Zt||(e=Hy(e));var t=Zy(e.r),n=Zy(e.g),i=Zy(e.b),r=Vy((.2225045*t+.7168786*n+.0606169*i)/L9),s,o;return t===n&&n===i?s=o=r:(s=Vy((.4360747*t+.3850649*n+.1430804*i)/O9),o=Vy((.0139322*t+.0971045*n+.7141733*i)/I9)),new Br(116*r-16,500*(s-r),200*(r-o),e.opacity)}function wp(e,t,n,i){return arguments.length===1?B9(e):new Br(e,t,n,i??1)}function Br(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}ou(Br,wp,sf(wo,{brighter(e){return new Br(this.l+xp*(e??1),this.a,this.b,this.opacity)},darker(e){return new Br(this.l-xp*(e??1),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return t=O9*Yy(t),e=L9*Yy(e),n=I9*Yy(n),new Zt(Xy(3.1338561*t-1.6168667*e-.4906146*n),Xy(-.9787684*t+1.9161415*e+.033454*n),Xy(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}}));function Vy(e){return e>JV?Math.pow(e,1/3):e/z9+P9}function Yy(e){return e>uu?e*e*e:z9*(e-P9)}function Xy(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Zy(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function QV(e){if(e instanceof Es)return new Es(e.h,e.c,e.l,e.opacity);if(e instanceof Br||(e=B9(e)),e.a===0&&e.b===0)return new Es(NaN,0=1?(n=1,t-1):Math.floor(n*t),r=e[i],s=e[i+1],o=i>0?e[i-1]:2*r-s,a=i()=>e;function X9(e,t){return function(n){return e+n*t}}function tY(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}function Sp(e,t){var n=t-e;return n?X9(e,n>180||n<-180?n-360*Math.round(n/360):n):$p(isNaN(e)?t:e)}function nY(e){return(e=+e)==1?Kt:function(t,n){return n-t?tY(t,n,e):$p(isNaN(t)?n:t)}}function Kt(e,t){var n=t-e;return n?X9(e,n):$p(isNaN(e)?t:e)}const eb=function e(t){var n=nY(t);function i(r,s){var o=n((r=ko(r)).r,(s=ko(s)).r),a=n(r.g,s.g),l=n(r.b,s.b),u=Kt(r.opacity,s.opacity);return function(c){return r.r=o(c),r.g=a(c),r.b=l(c),r.opacity=u(c),r+""}}return i.gamma=e,i}(1);function Z9(e){return function(t){var n=t.length,i=new Array(n),r=new Array(n),s=new Array(n),o,a;for(o=0;on&&(s=t.slice(n,s),a[o]?a[o]+=s:a[++o]=s),(i=i[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,l.push({i:o,x:ir(i,r)})),n=ib.lastIndex;return n180?c+=360:c-u>180&&(u+=360),d.push({i:f.push(r(f)+"rotate(",null,i)-2,x:ir(u,c)})):c&&f.push(r(f)+"rotate("+c+i)}function a(u,c,f,d){u!==c?d.push({i:f.push(r(f)+"skewX(",null,i)-2,x:ir(u,c)}):c&&f.push(r(f)+"skewX("+c+i)}function l(u,c,f,d,h,p){if(u!==f||c!==d){var g=h.push(r(h)+"scale(",null,",",null,")");p.push({i:g-4,x:ir(u,f)},{i:g-2,x:ir(c,d)})}else(f!==1||d!==1)&&h.push(r(h)+"scale("+f+","+d+")")}return function(u,c){var f=[],d=[];return u=e(u),c=e(c),s(u.translateX,u.translateY,c.translateX,c.translateY,f,d),o(u.rotate,c.rotate,f,d),a(u.skewX,c.skewX,f,d),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,d),u=c=null,function(h){for(var p=-1,g=d.length,m;++pt&&(n=e,e=t,t=n),function(i){return Math.max(e,Math.min(t,i))}}function FY(e,t,n){var i=e[0],r=e[1],s=t[0],o=t[1];return r2?TY:FY,l=u=null,f}function f(d){return d==null||isNaN(d=+d)?s:(l||(l=a(e.map(i),t,n)))(i(o(d)))}return f.invert=function(d){return o(r((u||(u=a(t,e.map(i),ir)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,ob),c()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=uf,c()},f.clamp=function(d){return arguments.length?(o=d?!0:ti,c()):o!==ti},f.interpolate=function(d){return arguments.length?(n=d,c()):n},f.unknown=function(d){return arguments.length?(s=d,f):s},function(d,h){return i=d,r=h,c()}}function cE(){return Ap()(ti,ti)}function fE(e,t,n,i){var r=fo(e,t,n),s;switch(i=pa(i??",f"),i.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return i.precision==null&&!isNaN(s=Hk(r,o))&&(i.precision=s),d2(i,o)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(s=Gk(r,Math.max(Math.abs(e),Math.abs(t))))&&(i.precision=s-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(s=Wk(r))&&(i.precision=s-(i.type==="%")*2);break}}return Rh(i)}function Sa(e){var t=e.domain;return e.ticks=function(n){var i=t();return a2(i[0],i[i.length-1],n??10)},e.tickFormat=function(n,i){var r=t();return fE(r[0],r[r.length-1],n??10,i)},e.nice=function(n){n==null&&(n=10);var i=t(),r=0,s=i.length-1,o=i[r],a=i[s],l,u,c=10;for(a0;){if(u=l2(o,a,n),u===l)return i[r]=o,i[s]=a,t(i);if(u>0)o=Math.floor(o/u)*u,a=Math.ceil(a/u)*u;else if(u<0)o=Math.ceil(o*u)/u,a=Math.floor(a*u)/u;else break;l=u}return e},e}function dE(){var e=cE();return e.copy=function(){return cf(e,dE())},Pr.apply(e,arguments),Sa(e)}function hE(e){var t;function n(i){return i==null||isNaN(i=+i)?t:i}return n.invert=n,n.domain=n.range=function(i){return arguments.length?(e=Array.from(i,ob),n):e.slice()},n.unknown=function(i){return arguments.length?(t=i,n):t},n.copy=function(){return hE(e).unknown(t)},e=arguments.length?Array.from(e,ob):[0,1],Sa(n)}function pE(e,t){e=e.slice();var n=0,i=e.length-1,r=e[n],s=e[i],o;return sMath.pow(e,t)}function OY(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function yE(e){return(t,n)=>-e(-t,n)}function lb(e){const t=e(gE,mE),n=t.domain;let i=10,r,s;function o(){return r=OY(i),s=RY(i),n()[0]<0?(r=yE(r),s=yE(s),e(MY,DY)):e(gE,mE),t}return t.base=function(a){return arguments.length?(i=+a,o()):i},t.domain=function(a){return arguments.length?(n(a),o()):n()},t.ticks=a=>{const l=n();let u=l[0],c=l[l.length-1];const f=c0){for(;d<=h;++d)for(p=1;pc)break;y.push(g)}}else for(;d<=h;++d)for(p=i-1;p>=1;--p)if(g=d>0?p/s(-d):p*s(d),!(gc)break;y.push(g)}y.length*2{if(a==null&&(a=10),l==null&&(l=i===10?"s":","),typeof l!="function"&&(!(i%1)&&(l=pa(l)).precision==null&&(l.trim=!0),l=Rh(l)),a===1/0)return l;const u=Math.max(1,i*a/t.ticks().length);return c=>{let f=c/s(Math.round(r(c)));return f*in(pE(n(),{floor:a=>s(Math.floor(r(a))),ceil:a=>s(Math.ceil(r(a)))})),t}function bE(){const e=lb(Ap()).domain([1,10]);return e.copy=()=>cf(e,bE()).base(e.base()),Pr.apply(e,arguments),e}function vE(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function _E(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function ub(e){var t=1,n=e(vE(t),_E(t));return n.constant=function(i){return arguments.length?e(vE(t=+i),_E(t)):t},Sa(n)}function xE(){var e=ub(Ap());return e.copy=function(){return cf(e,xE()).constant(e.constant())},Pr.apply(e,arguments)}function wE(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function LY(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function IY(e){return e<0?-e*e:e*e}function cb(e){var t=e(ti,ti),n=1;function i(){return n===1?e(ti,ti):n===.5?e(LY,IY):e(wE(n),wE(1/n))}return t.exponent=function(r){return arguments.length?(n=+r,i()):n},Sa(t)}function fb(){var e=cb(Ap());return e.copy=function(){return cf(e,fb()).exponent(e.exponent())},Pr.apply(e,arguments),e}function PY(){return fb.apply(null,arguments).exponent(.5)}function kE(){var e=[],t=[],n=[],i;function r(){var o=0,a=Math.max(1,t.length);for(n=new Array(a-1);++o0?n[a-1]:e[0],a=n?[i[n-1],t]:[i[u-1],i[u]]},o.unknown=function(l){return arguments.length&&(s=l),o},o.thresholds=function(){return i.slice()},o.copy=function(){return EE().domain([e,t]).range(r).unknown(s)},Pr.apply(Sa(o),arguments)}function $E(){var e=[.5],t=[0,1],n,i=1;function r(s){return s!=null&&s<=s?t[co(e,s,0,i)]:n}return r.domain=function(s){return arguments.length?(e=Array.from(s),i=Math.min(e.length,t.length-1),r):e.slice()},r.range=function(s){return arguments.length?(t=Array.from(s),i=Math.min(e.length,t.length-1),r):t.slice()},r.invertExtent=function(s){var o=t.indexOf(s);return[e[o-1],e[o]]},r.unknown=function(s){return arguments.length?(n=s,r):n},r.copy=function(){return $E().domain(e).range(t).unknown(n)},Pr.apply(r,arguments)}function zY(e){return new Date(e)}function BY(e){return e instanceof Date?+e:+new Date(+e)}function db(e,t,n,i,r,s,o,a,l,u){var c=cE(),f=c.invert,d=c.domain,h=u(".%L"),p=u(":%S"),g=u("%I:%M"),m=u("%I %p"),y=u("%a %d"),b=u("%b %d"),v=u("%B"),_=u("%Y");function x(k){return(l(k)0?i:1:0}const tX="identity",cu="linear",$s="log",ff="pow",df="sqrt",Mp="symlog",Ca="time",Aa="utc",Ur="sequential",fu="diverging",du="quantile",Dp="quantize",Np="threshold",yb="ordinal",bb="point",ME="band",vb="bin-ordinal",Wt="continuous",hf="discrete",pf="discretizing",Ri="interpolating",_b="temporal";function nX(e){return function(t){let n=t[0],i=t[1],r;return i=i&&n[l]<=r&&(s<0&&(s=l),o=l);if(!(s<0))return i=e.invertExtent(n[s]),r=e.invertExtent(n[o]),[i[0]===void 0?i[1]:i[0],r[1]===void 0?r[0]:r[1]]}}function xb(){const e=Wy().unknown(void 0),t=e.domain,n=e.range;let i=[0,1],r,s,o=!1,a=0,l=0,u=.5;delete e.unknown;function c(){const f=t().length,d=i[1]g+r*y);return n(d?m.reverse():m)}return e.domain=function(f){return arguments.length?(t(f),c()):t()},e.range=function(f){return arguments.length?(i=[+f[0],+f[1]],c()):i.slice()},e.rangeRound=function(f){return i=[+f[0],+f[1]],o=!0,c()},e.bandwidth=function(){return s},e.step=function(){return r},e.round=function(f){return arguments.length?(o=!!f,c()):o},e.padding=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),a=l,c()):a},e.paddingInner=function(f){return arguments.length?(a=Math.max(0,Math.min(1,f)),c()):a},e.paddingOuter=function(f){return arguments.length?(l=Math.max(0,Math.min(1,f)),c()):l},e.align=function(f){return arguments.length?(u=Math.max(0,Math.min(1,f)),c()):u},e.invertRange=function(f){if(f[0]==null||f[1]==null)return;const d=i[1]i[1-d])))return y=Math.max(0,co(h,g)-1),b=g===m?y:co(h,m)-1,g-h[y]>s+1e-10&&++y,d&&(v=y,y=p-b,b=p-v),y>b?void 0:t().slice(y,b+1)},e.invert=function(f){const d=e.invertRange([f,f]);return d&&d[0]},e.copy=function(){return xb().domain(t()).range(i).round(o).paddingInner(a).paddingOuter(l).align(u)},c()}function DE(e){const t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return DE(t())},e}function rX(){return DE(xb().paddingInner(1))}var sX=Array.prototype.map;function oX(e){return sX.call(e,_n)}const aX=Array.prototype.slice;function NE(){let e=[],t=[];function n(i){return i==null||i!==i?void 0:t[(co(e,i)-1)%t.length]}return n.domain=function(i){return arguments.length?(e=oX(i),n):e.slice()},n.range=function(i){return arguments.length?(t=aX.call(i),n):t.slice()},n.tickFormat=function(i,r){return fE(e[0],Ve(e),i??10,r)},n.copy=function(){return NE().domain(n.domain()).range(n.range())},n}const Rp=new Map,RE=Symbol("vega_scale");function OE(e){return e[RE]=!0,e}function LE(e){return e&&e[RE]===!0}function lX(e,t,n){const i=function(){const s=t();return s.invertRange||(s.invertRange=s.invert?nX(s):s.invertExtent?iX(s):void 0),s.type=e,OE(s)};return i.metadata=er(se(n)),i}function Qe(e,t,n){return arguments.length>1?(Rp.set(e,lX(e,t,n)),this):IE(e)?Rp.get(e):void 0}Qe(tX,hE),Qe(cu,dE,Wt),Qe($s,bE,[Wt,$s]),Qe(ff,fb,Wt),Qe(df,PY,Wt),Qe(Mp,xE,Wt),Qe(Ca,jY,[Wt,_b]),Qe(Aa,UY,[Wt,_b]),Qe(Ur,hb,[Wt,Ri]),Qe(`${Ur}-${cu}`,hb,[Wt,Ri]),Qe(`${Ur}-${$s}`,SE,[Wt,Ri,$s]),Qe(`${Ur}-${ff}`,pb,[Wt,Ri]),Qe(`${Ur}-${df}`,qY,[Wt,Ri]),Qe(`${Ur}-${Mp}`,CE,[Wt,Ri]),Qe(`${fu}-${cu}`,AE,[Wt,Ri]),Qe(`${fu}-${$s}`,FE,[Wt,Ri,$s]),Qe(`${fu}-${ff}`,gb,[Wt,Ri]),Qe(`${fu}-${df}`,WY,[Wt,Ri]),Qe(`${fu}-${Mp}`,TE,[Wt,Ri]),Qe(du,kE,[pf,du]),Qe(Dp,EE,pf),Qe(Np,$E,pf),Qe(vb,NE,[hf,pf]),Qe(yb,Wy,hf),Qe(ME,xb,hf),Qe(bb,rX,hf);function IE(e){return Rp.has(e)}function Fa(e,t){const n=Rp.get(e);return n&&n.metadata[t]}function wb(e){return Fa(e,Wt)}function hu(e){return Fa(e,hf)}function kb(e){return Fa(e,pf)}function PE(e){return Fa(e,$s)}function uX(e){return Fa(e,_b)}function zE(e){return Fa(e,Ri)}function BE(e){return Fa(e,du)}const cX=["clamp","base","constant","exponent"];function jE(e,t){const n=t[0],i=Ve(t)-n;return function(r){return e(n+r*i)}}function Op(e,t,n){return sb(Eb(t||"rgb",n),e)}function UE(e,t){const n=new Array(t),i=t+1;for(let r=0;re[a]?o[a](e[a]()):0),o)}function Eb(e,t){const n=SY[fX(e)];return t!=null&&n&&n.gamma?n.gamma(t):n}function fX(e){return"interpolate"+e.toLowerCase().split("-").map(t=>t[0].toUpperCase()+t.slice(1)).join("")}const dX={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},hX={accent:GY,category10:HY,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:VY,observable10:YY,paired:XY,pastel1:ZY,pastel2:KY,set1:JY,set2:QY,set3:eX,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function WE(e){if(G(e))return e;const t=e.length/6|0,n=new Array(t);for(let i=0;iOp(WE(e)));function $b(e,t){return e=e&&e.toLowerCase(),arguments.length>1?(GE[e]=t,this):GE[e]}const Lp="symbol",pX="discrete",gX="gradient",mX=e=>G(e)?e.map(t=>String(t)):String(e),yX=(e,t)=>e[1]-t[1],bX=(e,t)=>t[1]-e[1];function Sb(e,t,n){let i;return Ke(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),n!=null&&(t=Math.min(t,Math.floor(Nc(e.domain())/n||1)+1))),ie(t)&&(i=t.step,t=t.interval),re(t)&&(t=e.type===Ca?Jl(t):e.type==Aa?Ql(t):q("Only time and utc scales accept interval strings."),i&&(t=t.every(i))),t}function VE(e,t,n){let i=e.range(),r=i[0],s=Ve(i),o=yX;if(r>s&&(i=s,s=r,r=i,o=bX),r=Math.floor(r),s=Math.ceil(s),t=t.map(a=>[a,e(a)]).filter(a=>r<=a[1]&&a[1]<=s).sort(o).map(a=>a[0]),n>0&&t.length>1){const a=[t[0],Ve(t)];for(;t.length>n&&t.length>=3;)t=t.filter((l,u)=>!(u%2));t.length<3&&(t=a)}return t}function Cb(e,t){return e.bins?VE(e,e.bins,t):e.ticks?e.ticks(t):e.domain()}function YE(e,t,n,i,r,s){const o=t.type;let a=mX;if(o===Ca||r===Ca)a=e.timeFormat(i);else if(o===Aa||r===Aa)a=e.utcFormat(i);else if(PE(o)){const l=e.formatFloat(i);if(s||t.bins)a=l;else{const u=XE(t,n,!1);a=c=>u(c)?l(c):""}}else if(t.tickFormat){const l=t.domain();a=e.formatSpan(l[0],l[l.length-1],n,i)}else i&&(a=e.format(i));return a}function XE(e,t,n){const i=Cb(e,t),r=e.base(),s=Math.log(r),o=Math.max(1,r*t/i.length),a=l=>{let u=l/Math.pow(r,Math.round(Math.log(l)/s));return u*r1?i[1]-i[0]:i[0],o;for(o=1;oAb[e.type]||e.bins;function JE(e,t,n,i,r,s,o){const a=ZE[t.type]&&s!==Ca&&s!==Aa?vX(e,t,r):YE(e,t,n,r,s,o);return i===Lp&&wX(t)?kX(a):i===pX?EX(a):$X(a)}const kX=e=>(t,n,i)=>{const r=QE(i[n+1],QE(i.max,1/0)),s=e$(t,e),o=e$(r,e);return s&&o?s+" – "+o:o?"< "+o:"≥ "+s},QE=(e,t)=>e??t,EX=e=>(t,n)=>n?e(t):null,$X=e=>t=>e(t),e$=(e,t)=>Number.isFinite(e)?t(e):null;function SX(e){const t=e.domain(),n=t.length-1;let i=+t[0],r=+Ve(t),s=r-i;if(e.type===Np){const o=n?s/n:.1;i-=o,r+=o,s=r-i}return o=>(o-i)/s}function CX(e,t,n,i){const r=i||t.type;return re(n)&&uX(r)&&(n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")),!n&&r===Ca?e.timeFormat("%A, %d %B %Y, %X"):!n&&r===Aa?e.utcFormat("%A, %d %B %Y, %X UTC"):JE(e,t,5,null,n,i,!0)}function t$(e,t,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=CX(e,t,n.format,n.formatType);if(kb(t.type)){const s=KE(t).slice(1).map(r),o=s.length;return`${o} boundar${o===1?"y":"ies"}: ${s.join(", ")}`}else if(hu(t.type)){const s=t.domain(),o=s.length,a=o>i?s.slice(0,i-2).map(r).join(", ")+", ending with "+s.slice(-1).map(r):s.map(r).join(", ");return`${o} value${o===1?"":"s"}: ${a}`}else{const s=t.domain();return`values from ${r(s[0])} to ${r(Ve(s))}`}}let n$=0;function AX(){n$=0}const Ip="p_";function Fb(e){return e&&e.gradient}function i$(e,t,n){const i=e.gradient;let r=e.id,s=i==="radial"?Ip:"";return r||(r=e.id="gradient_"+n$++,i==="radial"?(e.x1=qr(e.x1,.5),e.y1=qr(e.y1,.5),e.r1=qr(e.r1,0),e.x2=qr(e.x2,.5),e.y2=qr(e.y2,.5),e.r2=qr(e.r2,.5),s=Ip):(e.x1=qr(e.x1,0),e.y1=qr(e.y1,0),e.x2=qr(e.x2,1),e.y2=qr(e.y2,0))),t[r]=e,"url("+(n||"")+"#"+s+r+")"}function qr(e,t){return e??t}function r$(e,t){var n=[],i;return i={gradient:"linear",x1:e?e[0]:0,y1:e?e[1]:0,x2:t?t[0]:1,y2:t?t[1]:0,stops:n,stop:function(r,s){return n.push({offset:r,color:s}),i}}}const s$={basis:{curve:EV},"basis-closed":{curve:$V},"basis-open":{curve:SV},bundle:{curve:CV,tension:"beta",value:.85},cardinal:{curve:AV,tension:"tension",value:0},"cardinal-open":{curve:TV,tension:"tension",value:0},"cardinal-closed":{curve:FV,tension:"tension",value:0},"catmull-rom":{curve:MV,tension:"alpha",value:.5},"catmull-rom-closed":{curve:DV,tension:"alpha",value:.5},"catmull-rom-open":{curve:NV,tension:"alpha",value:.5},linear:{curve:Iy},"linear-closed":{curve:RV},monotone:{horizontal:LV,vertical:OV},natural:{curve:IV},step:{curve:PV},"step-after":{curve:BV},"step-before":{curve:zV}};function Tb(e,t,n){var i=le(s$,e)&&s$[e],r=null;return i&&(r=i.curve||i[t||"vertical"],i.tension&&n!=null&&(r=r[i.tension](n))),r}const FX={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7},TX=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi,MX=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/,DX=/^((\s+,?\s*)|(,\s*))/,NX=/^[01]/;function pu(e){const t=[];return(e.match(TX)||[]).forEach(i=>{let r=i[0];const s=r.toLowerCase(),o=FX[s],a=RX(s,o,i.slice(1).trim()),l=a.length;if(l1&&(g=Math.sqrt(g),n*=g,i*=g);const m=d/n,y=f/n,b=-f/i,v=d/i,_=m*a+y*l,x=b*a+v*l,k=m*e+y*t,w=b*e+v*t;let $=1/((k-_)*(k-_)+(w-x)*(w-x))-.25;$<0&&($=0);let F=Math.sqrt($);s==r&&(F=-F);const A=.5*(_+k)-F*(w-x),z=.5*(x+w)+F*(k-_),P=Math.atan2(x-z,_-A);let S=Math.atan2(w-z,k-A)-P;S<0&&s===1?S+=Wr:S>0&&s===0&&(S-=Wr);const D=Math.ceil(Math.abs(S/(Ta+.001))),B=[];for(let V=0;V+e}function Pp(e,t,n){return Math.max(t,Math.min(e,n))}function f$(){var e=BX,t=jX,n=UX,i=qX,r=Ss(0),s=r,o=r,a=r,l=null;function u(c,f,d){var h,p=f??+e.call(this,c),g=d??+t.call(this,c),m=+n.call(this,c),y=+i.call(this,c),b=Math.min(m,y)/2,v=Pp(+r.call(this,c),0,b),_=Pp(+s.call(this,c),0,b),x=Pp(+o.call(this,c),0,b),k=Pp(+a.call(this,c),0,b);if(l||(l=h=up()),v<=0&&_<=0&&x<=0&&k<=0)l.rect(p,g,m,y);else{var w=p+m,E=g+y;l.moveTo(p+v,g),l.lineTo(w-_,g),l.bezierCurveTo(w-Co*_,g,w,g+Co*_,w,g+_),l.lineTo(w,E-k),l.bezierCurveTo(w,E-Co*k,w-Co*k,E,w-k,E),l.lineTo(p+x,E),l.bezierCurveTo(p+Co*x,E,p,E-Co*x,p,E-x),l.lineTo(p,g+v),l.bezierCurveTo(p,g+Co*v,p+Co*v,g,p+v,g),l.closePath()}if(h)return l=null,h+""||null}return u.x=function(c){return arguments.length?(e=Ss(c),u):e},u.y=function(c){return arguments.length?(t=Ss(c),u):t},u.width=function(c){return arguments.length?(n=Ss(c),u):n},u.height=function(c){return arguments.length?(i=Ss(c),u):i},u.cornerRadius=function(c,f,d,h){return arguments.length?(r=Ss(c),s=f!=null?Ss(f):r,a=d!=null?Ss(d):r,o=h!=null?Ss(h):s,u):r},u.context=function(c){return arguments.length?(l=c??null,u):l},u}function d$(){var e,t,n,i,r=null,s,o,a,l;function u(f,d,h){const p=h/2;if(s){var g=a-d,m=f-o;if(g||m){var y=Math.hypot(g,m),b=(g/=y)*l,v=(m/=y)*l,_=Math.atan2(m,g);r.moveTo(o-b,a-v),r.lineTo(f-g*p,d-m*p),r.arc(f,d,p,_-Math.PI,_),r.lineTo(o+b,a+v),r.arc(o,a,l,_,_+Math.PI)}else r.arc(f,d,p,0,Wr);r.closePath()}else s=1;o=f,a=d,l=p}function c(f){var d,h=f.length,p,g=!1,m;for(r==null&&(r=m=up()),d=0;d<=h;++d)!(de.x||0,bf=e=>e.y||0,WX=e=>e.width||0,HX=e=>e.height||0,GX=e=>(e.x||0)+(e.width||0),VX=e=>(e.y||0)+(e.height||0),YX=e=>e.startAngle||0,XX=e=>e.endAngle||0,ZX=e=>e.padAngle||0,KX=e=>e.innerRadius||0,JX=e=>e.outerRadius||0,QX=e=>e.cornerRadius||0,eZ=e=>mf(e.cornerRadiusTopLeft,e.cornerRadius)||0,tZ=e=>mf(e.cornerRadiusTopRight,e.cornerRadius)||0,nZ=e=>mf(e.cornerRadiusBottomRight,e.cornerRadius)||0,iZ=e=>mf(e.cornerRadiusBottomLeft,e.cornerRadius)||0,rZ=e=>mf(e.size,64),sZ=e=>e.size||1,zp=e=>e.defined!==!1,oZ=e=>c$(e.shape||"circle"),aZ=xV().startAngle(YX).endAngle(XX).padAngle(ZX).innerRadius(KX).outerRadius(JX).cornerRadius(QX),lZ=u9().x(yf).y1(bf).y0(VX).defined(zp),uZ=u9().y(bf).x1(yf).x0(GX).defined(zp),cZ=l9().x(yf).y(bf).defined(zp),fZ=f$().x(yf).y(bf).width(WX).height(HX).cornerRadius(eZ,tZ,nZ,iZ),dZ=kV().type(oZ).size(rZ),hZ=d$().x(yf).y(bf).defined(zp).size(sZ);function Rb(e){return e.cornerRadius||e.cornerRadiusTopLeft||e.cornerRadiusTopRight||e.cornerRadiusBottomRight||e.cornerRadiusBottomLeft}function pZ(e,t){return aZ.context(e)(t)}function gZ(e,t){const n=t[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?uZ:lZ).curve(Tb(i,n.orient,n.tension)).context(e)(t)}function mZ(e,t){const n=t[0],i=n.interpolate||"linear";return cZ.curve(Tb(i,n.orient,n.tension)).context(e)(t)}function mu(e,t,n,i){return fZ.context(e)(t,n,i)}function yZ(e,t){return(t.mark.shape||t.shape).context(e)(t)}function bZ(e,t){return dZ.context(e)(t)}function vZ(e,t){return hZ.context(e)(t)}var h$=1;function _Z(){h$=1}function Ob(e,t,n){var i=t.clip,r=e._defs,s=t.clip_id||(t.clip_id="clip"+h$++),o=r.clipping[s]||(r.clipping[s]={id:s});return ze(i)?o.path=i(null):Rb(n)?o.path=mu(null,n,0,0):(o.width=n.width||0,o.height=n.height||0),"url(#"+s+")"}function zt(e){this.clear(),e&&this.union(e)}zt.prototype={clone(){return new zt(this)},clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(e){return this.x1===e.x1&&this.y1===e.y1&&this.x2===e.x2&&this.y2===e.y2},set(e,t,n,i){return nthis.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){const i=this.rotatedPoints(e,t,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(e,t,n){var{x1:i,y1:r,x2:s,y2:o}=this,a=Math.cos(e),l=Math.sin(e),u=t-t*a+n*l,c=n-t*l-n*a;return[a*i-l*r+u,l*i+a*r+c,a*i-l*o+u,l*i+a*o+c,a*s-l*r+u,l*s+a*r+c,a*s-l*o+u,l*s+a*o+c]},union(e){return e.x1this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function Bp(e){this.mark=e,this.bounds=this.bounds||new zt}function jp(e){Bp.call(this,e),this.items=this.items||[]}te(jp,Bp);class p${constructor(t){this._pending=0,this._loader=t||Hh()}pending(){return this._pending}sanitizeURL(t){const n=this;return g$(n),n._loader.sanitize(t,{context:"href"}).then(i=>(vf(n),i)).catch(()=>(vf(n),null))}loadImage(t){const n=this,i=jV();return g$(n),n._loader.sanitize(t,{context:"image"}).then(r=>{const s=r.href;if(!s||!i)throw{url:s};const o=new i,a=le(r,"crossOrigin")?r.crossOrigin:"anonymous";return a!=null&&(o.crossOrigin=a),o.onload=()=>vf(n),o.onerror=()=>vf(n),o.src=s,o}).catch(r=>(vf(n),{complete:!1,width:0,height:0,src:r&&r.url||""}))}ready(){const t=this;return new Promise(n=>{function i(r){t.pending()?setTimeout(()=>{i(!0)},10):n(r)}i(!1)})}}function g$(e){e._pending+=1}function vf(e){e._pending-=1}function Cs(e,t,n){if(t.stroke&&t.opacity!==0&&t.strokeOpacity!==0){const i=t.strokeWidth!=null?+t.strokeWidth:1;e.expand(i+(n?xZ(t,i):0))}return e}function xZ(e,t){return e.strokeJoin&&e.strokeJoin!=="miter"?0:t}const wZ=Wr-1e-8;let Up,qp,Wp,Ma,Lb,Hp,Ib,Pb;const Ao=(e,t)=>Up.add(e,t),Gp=(e,t)=>Ao(qp=e,Wp=t),m$=e=>Ao(e,Up.y1),y$=e=>Ao(Up.x1,e),Da=(e,t)=>Lb*e+Ib*t,Na=(e,t)=>Hp*e+Pb*t,zb=(e,t)=>Ao(Da(e,t),Na(e,t)),Bb=(e,t)=>Gp(Da(e,t),Na(e,t));function _f(e,t){return Up=e,t?(Ma=t*So,Lb=Pb=Math.cos(Ma),Hp=Math.sin(Ma),Ib=-Hp):(Lb=Pb=1,Ma=Hp=Ib=0),kZ}const kZ={beginPath(){},closePath(){},moveTo:Bb,lineTo:Bb,rect(e,t,n,i){Ma?(zb(e+n,t),zb(e+n,t+i),zb(e,t+i),Bb(e,t)):(Ao(e+n,t+i),Gp(e,t))},quadraticCurveTo(e,t,n,i){const r=Da(e,t),s=Na(e,t),o=Da(n,i),a=Na(n,i);b$(qp,r,o,m$),b$(Wp,s,a,y$),Gp(o,a)},bezierCurveTo(e,t,n,i,r,s){const o=Da(e,t),a=Na(e,t),l=Da(n,i),u=Na(n,i),c=Da(r,s),f=Na(r,s);v$(qp,o,l,c,m$),v$(Wp,a,u,f,y$),Gp(c,f)},arc(e,t,n,i,r,s){if(i+=Ma,r+=Ma,qp=n*Math.cos(r)+e,Wp=n*Math.sin(r)+t,Math.abs(r-i)>wZ)Ao(e-n,t-n),Ao(e+n,t+n);else{const o=u=>Ao(n*Math.cos(u)+e,n*Math.sin(u)+t);let a,l;if(o(i),o(r),r!==i)if(i=i%Wr,i<0&&(i+=Wr),r=r%Wr,r<0&&(r+=Wr),rr;++l,a-=Ta)o(a);else for(a=i-i%Ta+Ta,l=0;l<4&&aOX?(c=o*o+a*s,c>=0&&(c=Math.sqrt(c),l=(-o+c)/s,u=(-o-c)/s)):l=.5*a/o,0d)return!1;g>f&&(f=g)}else if(h>0){if(g0?(e.globalAlpha=n,e.fillStyle=E$(e,t,t.fill),!0):!1}var $Z=[];function vu(e,t,n){var i=(i=t.strokeWidth)!=null?i:1;return i<=0?!1:(n*=t.strokeOpacity==null?1:t.strokeOpacity,n>0?(e.globalAlpha=n,e.strokeStyle=E$(e,t,t.stroke),e.lineWidth=i,e.lineCap=t.strokeCap||"butt",e.lineJoin=t.strokeJoin||"miter",e.miterLimit=t.strokeMiterLimit||10,e.setLineDash&&(e.setLineDash(t.strokeDash||$Z),e.lineDashOffset=t.strokeDashOffset||0),!0):!1)}function SZ(e,t){return e.zindex-t.zindex||e.index-t.index}function Wb(e){if(!e.zdirty)return e.zitems;var t=e.items,n=[],i,r,s;for(r=0,s=t.length;r=0;)if(i=t(n[r]))return i;if(n===s){for(n=e.items,r=n.length;--r>=0;)if(!n[r].zindex&&(i=t(n[r])))return i}return null}function Hb(e){return function(t,n,i){sr(n,r=>{(!i||i.intersects(r.bounds))&&$$(e,t,r,r)})}}function CZ(e){return function(t,n,i){n.items.length&&(!i||i.intersects(n.bounds))&&$$(e,t,n.items[0],n.items)}}function $$(e,t,n,i){var r=n.opacity==null?1:n.opacity;r!==0&&(e(t,i)||(bu(t,n),n.fill&&Vp(t,n,r)&&t.fill(),n.stroke&&vu(t,n,r)&&t.stroke()))}function Xp(e){return e=e||Ti,function(t,n,i,r,s,o){return i*=t.pixelRatio,r*=t.pixelRatio,Yp(n,a=>{const l=a.bounds;if(!(l&&!l.contains(s,o)||!l)&&e(t,a,i,r,s,o))return a})}}function xf(e,t){return function(n,i,r,s){var o=Array.isArray(i)?i[0]:i,a=t??o.fill,l=o.stroke&&n.isPointInStroke,u,c;return l&&(u=o.strokeWidth,c=o.strokeCap,n.lineWidth=u??1,n.lineCap=c??"butt"),e(n,i)?!1:a&&n.isPointInPath(r,s)||l&&n.isPointInStroke(r,s)}}function Gb(e){return Xp(xf(e))}function Ra(e,t){return"translate("+e+","+t+")"}function Vb(e){return"rotate("+e+")"}function AZ(e,t){return"scale("+e+","+t+")"}function S$(e){return Ra(e.x||0,e.y||0)}function FZ(e){return Ra(e.x||0,e.y||0)+(e.angle?" "+Vb(e.angle):"")}function TZ(e){return Ra(e.x||0,e.y||0)+(e.angle?" "+Vb(e.angle):"")+(e.scaleX||e.scaleY?" "+AZ(e.scaleX||1,e.scaleY||1):"")}function Yb(e,t,n){function i(o,a){o("transform",FZ(a)),o("d",t(null,a))}function r(o,a){return t(_f(o,a.angle),a),Cs(o,a).translate(a.x||0,a.y||0)}function s(o,a){var l=a.x||0,u=a.y||0,c=a.angle||0;o.translate(l,u),c&&o.rotate(c*=So),o.beginPath(),t(o,a),c&&o.rotate(-c),o.translate(-l,-u)}return{type:e,tag:"path",nested:!1,attr:i,bound:r,draw:Hb(s),pick:Gb(s),isect:n||Ub(s)}}var MZ=Yb("arc",pZ);function DZ(e,t){for(var n=e[0].orient==="horizontal"?t[1]:t[0],i=e[0].orient==="horizontal"?"y":"x",r=e.length,s=1/0,o,a;--r>=0;)e[r].defined!==!1&&(a=Math.abs(e[r][i]-n),a=0;)if(e[i].defined!==!1&&(r=e[i].x-t[0],s=e[i].y-t[1],o=r*r+s*s,o=0;)if(e[n].defined!==!1&&(i=e[n].x-t[0],r=e[n].y-t[1],s=i*i+r*r,i=e[n].size||1,s.5&&t<1.5?.5-Math.abs(t-1):0}function IZ(e,t){e("transform",S$(t))}function F$(e,t){const n=A$(t);e("d",mu(null,t,n,n))}function PZ(e,t){e("class","background"),e("aria-hidden",!0),F$(e,t)}function zZ(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?F$(e,t):e("d","")}function BZ(e,t,n){const i=t.clip?Ob(n,t,t):null;e("clip-path",i)}function jZ(e,t){if(!t.clip&&t.items){const n=t.items,i=n.length;for(let r=0;r{const s=r.x||0,o=r.y||0,a=r.strokeForeground,l=r.opacity==null?1:r.opacity;(r.stroke||r.fill)&&l&&(wf(e,r,s,o),bu(e,r),r.fill&&Vp(e,r,l)&&e.fill(),r.stroke&&!a&&vu(e,r,l)&&e.stroke()),e.save(),e.translate(s,o),r.clip&&C$(e,r),n&&n.translate(-s,-o),sr(r,u=>{(u.marktype==="group"||i==null||i.includes(u.marktype))&&this.draw(e,u,n,i)}),n&&n.translate(s,o),e.restore(),a&&r.stroke&&l&&(wf(e,r,s,o),bu(e,r),vu(e,r,l)&&e.stroke())})}function GZ(e,t,n,i,r,s){if(t.bounds&&!t.bounds.contains(r,s)||!t.items)return null;const o=n*e.pixelRatio,a=i*e.pixelRatio;return Yp(t,l=>{let u,c,f;const d=l.bounds;if(d&&!d.contains(r,s))return;c=l.x||0,f=l.y||0;const h=c+(l.width||0),p=f+(l.height||0),g=l.clip;if(g&&(rh||sp))return;if(e.save(),e.translate(c,f),c=r-c,f=s-f,g&&Rb(l)&&!WZ(e,l,o,a))return e.restore(),null;const m=l.strokeForeground,y=t.interactive!==!1;return y&&m&&l.stroke&&qZ(e,l,o,a)?(e.restore(),l):(u=Yp(l,b=>VZ(b,c,f)?this.pick(b,n,i,c,f):null),!u&&y&&(l.fill||!m&&l.stroke)&&UZ(e,l,o,a)&&(u=l),e.restore(),u||null)})}function VZ(e,t,n){return(e.interactive!==!1||e.marktype==="group")&&e.bounds&&e.bounds.contains(t,n)}var YZ={type:"group",tag:"g",nested:!1,attr:IZ,bound:jZ,draw:HZ,pick:GZ,isect:x$,content:BZ,background:PZ,foreground:zZ},kf={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Zb(e,t){var n=e.image;return(!n||e.url&&e.url!==n.url)&&(n={complete:!1,width:0,height:0},t.loadImage(e.url).then(i=>{e.image=i,e.image.url=e.url})),n}function Kb(e,t){return e.width!=null?e.width:!t||!t.width?0:e.aspect!==!1&&e.height?e.height*t.width/t.height:t.width}function Jb(e,t){return e.height!=null?e.height:!t||!t.height?0:e.aspect!==!1&&e.width?e.width*t.height/t.width:t.height}function Zp(e,t){return e==="center"?t/2:e==="right"?t:0}function Kp(e,t){return e==="middle"?t/2:e==="bottom"?t:0}function XZ(e,t,n){const i=Zb(t,n),r=Kb(t,i),s=Jb(t,i),o=(t.x||0)-Zp(t.align,r),a=(t.y||0)-Kp(t.baseline,s),l=!i.src&&i.toDataURL?i.toDataURL():i.src||"";e("href",l,kf["xmlns:xlink"],"xlink:href"),e("transform",Ra(o,a)),e("width",r),e("height",s),e("preserveAspectRatio",t.aspect===!1?"none":"xMidYMid")}function ZZ(e,t){const n=t.image,i=Kb(t,n),r=Jb(t,n),s=(t.x||0)-Zp(t.align,i),o=(t.y||0)-Kp(t.baseline,r);return e.set(s,o,s+i,o+r)}function KZ(e,t,n){sr(t,i=>{if(n&&!n.intersects(i.bounds))return;const r=Zb(i,this);let s=Kb(i,r),o=Jb(i,r);if(s===0||o===0)return;let a=(i.x||0)-Zp(i.align,s),l=(i.y||0)-Kp(i.baseline,o),u,c,f,d;i.aspect!==!1&&(c=r.width/r.height,f=i.width/i.height,c===c&&f===f&&c!==f&&(f{if(!(n&&!n.intersects(i.bounds))){var r=i.opacity==null?1:i.opacity;r&&M$(e,i,r)&&(bu(e,i),e.stroke())}})}function uK(e,t,n,i){return e.isPointInStroke?M$(e,t,1)&&e.isPointInStroke(n,i):!1}var cK={type:"rule",tag:"line",nested:!1,attr:oK,bound:aK,draw:lK,pick:Xp(uK),isect:w$},fK=Yb("shape",yZ),dK=Yb("symbol",bZ,qb);const D$=mk();var mi={height:Hr,measureWidth:Qb,estimateWidth:Qp,width:Qp,canvas:N$};N$(!0);function N$(e){mi.width=e&&Fo?Qb:Qp}function Qp(e,t){return R$(Mo(e,t),Hr(e))}function R$(e,t){return~~(.8*e.length*t)}function Qb(e,t){return Hr(e)<=0||!(t=Mo(e,t))?0:O$(t,eg(e))}function O$(e,t){const n=`(${t}) ${e}`;let i=D$.get(n);return i===void 0&&(Fo.font=t,i=Fo.measureText(e).width,D$.set(n,i)),i}function Hr(e){return e.fontSize!=null?+e.fontSize||0:11}function To(e){return e.lineHeight!=null?e.lineHeight:Hr(e)+2}function hK(e){return G(e)?e.length>1?e:e[0]:e}function Ef(e){return hK(e.lineBreak&&e.text&&!G(e.text)?e.text.split(e.lineBreak):e.text)}function e3(e){const t=Ef(e);return(G(t)?t.length-1:0)*To(e)}function Mo(e,t){const n=t==null?"":(t+"").trim();return e.limit>0&&n.length?gK(e,n):n}function pK(e){if(mi.width===Qb){const t=eg(e);return n=>O$(n,t)}else if(mi.width===Qp){const t=Hr(e);return n=>R$(n,t)}else return t=>mi.width(e,t)}function gK(e,t){var n=+e.limit,i=pK(e);if(i(t)>>1,i(t.slice(l))>n?o=l+1:a=l;return r+t.slice(o)}else{for(;o>>1),i(t.slice(0,l))Math.max(d,mi.width(t,h)),0)):f=mi.width(t,c),r==="center"?l-=f/2:r==="right"&&(l-=f),e.set(l+=o,u+=a,l+f,u+i),t.angle&&!n)e.rotate(t.angle*So,o,a);else if(n===2)return e.rotatedPoints(t.angle*So,o,a);return e}function bK(e,t,n){sr(t,i=>{var r=i.opacity==null?1:i.opacity,s,o,a,l,u,c,f;if(!(n&&!n.intersects(i.bounds)||r===0||i.fontSize<=0||i.text==null||i.text.length===0)){if(e.font=eg(i),e.textAlign=i.align||"left",s=tg(i),o=s.x1,a=s.y1,i.angle&&(e.save(),e.translate(o,a),e.rotate(i.angle*So),o=a=0),o+=i.dx||0,a+=(i.dy||0)+t3(i),c=Ef(i),bu(e,i),G(c))for(u=To(i),l=0;lt;)e.removeChild(n[--i]);return e}function q$(e){return"mark-"+e.marktype+(e.role?" role-"+e.role:"")+(e.name?" "+e.name:"")}function ng(e,t){const n=t.getBoundingClientRect();return[e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0)]}function EK(e,t,n,i){var r=e&&e.mark,s,o;if(r&&(s=yi[r.marktype]).tip){for(o=ng(t,n),o[0]-=i[0],o[1]-=i[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=s.tip(r.items,o)}return e}let s3=class{constructor(t,n){this._active=null,this._handlers={},this._loader=t||Hh(),this._tooltip=n||$K}initialize(t,n,i){return this._el=t,this._obj=i||null,this.origin(n)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(t){return arguments.length?(this._origin=t||[0,0],this):this._origin.slice()}scene(t){return arguments.length?(this._scene=t,this):this._scene}on(){}off(){}_handlerIndex(t,n,i){for(let r=t?t.length:0;--r>=0;)if(t[r].type===n&&(!i||t[r].handler===i))return r;return-1}handlers(t){const n=this._handlers,i=[];if(t)i.push(...n[this.eventName(t)]);else for(const r in n)i.push(...n[r]);return i}eventName(t){const n=t.indexOf(".");return n<0?t:t.slice(0,n)}handleHref(t,n,i){this._loader.sanitize(i,{context:"href"}).then(r=>{const s=new MouseEvent(t.type,t),o=Do(null,"a");for(const a in r)o.setAttribute(a,r[a]);o.dispatchEvent(s)}).catch(()=>{})}handleTooltip(t,n,i){if(n&&n.tooltip!=null){n=EK(n,t,this.canvas(),this._origin);const r=i&&n&&n.tooltip||null;this._tooltip.call(this._obj,this,t,n,r)}}getItemBoundingClientRect(t){const n=this.canvas();if(!n)return;const i=n.getBoundingClientRect(),r=this._origin,s=t.bounds,o=s.width(),a=s.height();let l=s.x1+r[0]+i.left,u=s.y1+r[1]+i.top;for(;t.mark&&(t=t.mark.group);)l+=t.x||0,u+=t.y||0;return{x:l,y:u,width:o,height:a,left:l,top:u,right:l+o,bottom:u+a}}};function $K(e,t,n,i){e.element().setAttribute("title",i||"")}class Cf{constructor(t){this._el=null,this._bgcolor=null,this._loader=new p$(t)}initialize(t,n,i,r,s){return this._el=t,this.resize(n,i,r,s)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(t){return arguments.length===0?this._bgcolor:(this._bgcolor=t,this)}resize(t,n,i,r){return this._width=t,this._height=n,this._origin=i||[0,0],this._scale=r||1,this}dirty(){}render(t,n){const i=this;return i._call=function(){i._render(t,n)},i._call(),i._call=null,i}_render(){}renderAsync(t,n){const i=this.render(t,n);return this._ready?this._ready.then(()=>i):Promise.resolve(i)}_load(t,n){var i=this,r=i._loader[t](n);if(!i._ready){const s=i._call;i._ready=i._loader.ready().then(o=>{o&&s(),i._ready=null})}return r}sanitizeURL(t){return this._load("sanitizeURL",t)}loadImage(t){return this._load("loadImage",t)}}const SK="keydown",CK="keypress",AK="keyup",W$="dragenter",ig="dragleave",H$="dragover",o3="pointerdown",FK="pointerup",rg="pointermove",sg="pointerout",G$="pointerover",a3="mousedown",TK="mouseup",V$="mousemove",og="mouseout",Y$="mouseover",ag="click",MK="dblclick",DK="wheel",X$="mousewheel",lg="touchstart",ug="touchmove",cg="touchend",NK=[SK,CK,AK,W$,ig,H$,o3,FK,rg,sg,G$,a3,TK,V$,og,Y$,ag,MK,DK,X$,lg,ug,cg],l3=rg,Af=og,u3=ag;class Ff extends s3{constructor(t,n){super(t,n),this._down=null,this._touch=null,this._first=!0,this._events={},this.events=NK,this.pointermove=K$([rg,V$],[G$,Y$],[sg,og]),this.dragover=K$([H$],[W$],[ig]),this.pointerout=J$([sg,og]),this.dragleave=J$([ig])}initialize(t,n,i){return this._canvas=t&&r3(t,"canvas"),[ag,a3,o3,rg,sg,ig].forEach(r=>Z$(this,r)),super.initialize(t,n,i)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(X$,t)}pointerdown(t){this._down=this._active,this.fire(o3,t)}mousedown(t){this._down=this._active,this.fire(a3,t)}click(t){this._down===this._active&&(this.fire(ag,t),this._down=null)}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(lg,t,!0)}touchmove(t){this.fire(ug,t,!0)}touchend(t){this.fire(cg,t,!0),this._touch=null}fire(t,n,i){const r=i?this._touch:this._active,s=this._handlers[t];if(n.vegaType=t,t===u3&&r&&r.href?this.handleHref(n,r,r.href):(t===l3||t===Af)&&this.handleTooltip(n,r,t!==Af),s)for(let o=0,a=s.length;o=0&&r.splice(s,1),this}pickEvent(t){const n=ng(t,this._canvas),i=this._origin;return this.pick(this._scene,n[0],n[1],n[0]-i[0],n[1]-i[1])}pick(t,n,i,r,s){const o=this.context();return yi[t.marktype].pick.call(this,o,t,n,i,r,s)}}const RK=e=>e===lg||e===ug||e===cg?[lg,ug,cg]:[e];function Z$(e,t){RK(t).forEach(n=>OK(e,n))}function OK(e,t){const n=e.canvas();n&&!e._events[t]&&(e._events[t]=1,n.addEventListener(t,e[t]?i=>e[t](i):i=>e.fire(t,i)))}function Tf(e,t,n){t.forEach(i=>e.fire(i,n))}function K$(e,t,n){return function(i){const r=this._active,s=this.pickEvent(i);s===r?Tf(this,e,i):((!r||!r.exit)&&Tf(this,n,i),this._active=s,Tf(this,t,i),Tf(this,e,i))}}function J$(e){return function(t){Tf(this,e,t),this._active=null}}function LK(){return typeof window<"u"&&window.devicePixelRatio||1}function IK(e,t,n,i,r,s){const o=typeof HTMLElement<"u"&&e instanceof HTMLElement&&e.parentNode!=null,a=e.getContext("2d"),l=o?LK():r;e.width=t*l,e.height=n*l;for(const u in s)a[u]=s[u];return o&&l!==1&&(e.style.width=t+"px",e.style.height=n+"px"),a.pixelRatio=l,a.setTransform(l,0,0,l,l*i[0],l*i[1]),e}class fg extends Cf{constructor(t){super(t),this._options={},this._redraw=!1,this._dirty=new zt,this._tempb=new zt}initialize(t,n,i,r,s,o){return this._options=o||{},this._canvas=this._options.externalContext?null:_o(1,1,this._options.type),t&&this._canvas&&(Li(t,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),super.initialize(t,n,i,r,s)}resize(t,n,i,r){if(super.resize(t,n,i,r),this._canvas)IK(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const s=this._options.externalContext;s||q("CanvasRenderer is missing a valid canvas or context"),s.scale(this._scale,this._scale),s.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(t){const n=this._tempb.clear().union(t.bounds);let i=t.mark.group;for(;i;)n.translate(i.x||0,i.y||0),i=i.mark.group;this._dirty.union(n)}_render(t,n){const i=this.context(),r=this._origin,s=this._width,o=this._height,a=this._dirty,l=PK(r,s,o);i.save();const u=this._redraw||a.empty()?(this._redraw=!1,l.expand(1)):zK(i,l.intersect(a),r);return this.clear(-r[0],-r[1],s,o),this.draw(i,t,u,n),i.restore(),a.clear(),this}draw(t,n,i,r){if(n.marktype!=="group"&&r!=null&&!r.includes(n.marktype))return;const s=yi[n.marktype];n.clip&&LZ(t,n),s.draw.call(this,t,n,i,r),n.clip&&t.restore()}clear(t,n,i,r){const s=this._options,o=this.context();s.type!=="pdf"&&!s.externalContext&&o.clearRect(t,n,i,r),this._bgcolor!=null&&(o.fillStyle=this._bgcolor,o.fillRect(t,n,i,r))}}const PK=(e,t,n)=>new zt().set(0,0,t,n).translate(-e[0],-e[1]);function zK(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-(n[0]%1),-(n[1]%1)),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}class Q$ extends s3{constructor(t,n){super(t,n);const i=this;i._hrefHandler=c3(i,(r,s)=>{s&&s.href&&i.handleHref(r,s,s.href)}),i._tooltipHandler=c3(i,(r,s)=>{i.handleTooltip(r,s,r.type!==Af)})}initialize(t,n,i){let r=this._svg;return r&&(r.removeEventListener(u3,this._hrefHandler),r.removeEventListener(l3,this._tooltipHandler),r.removeEventListener(Af,this._tooltipHandler)),this._svg=r=t&&r3(t,"svg"),r&&(r.addEventListener(u3,this._hrefHandler),r.addEventListener(l3,this._tooltipHandler),r.addEventListener(Af,this._tooltipHandler)),super.initialize(t,n,i)}canvas(){return this._svg}on(t,n){const i=this.eventName(t),r=this._handlers;if(this._handlerIndex(r[i],t,n)<0){const o={type:t,handler:n,listener:c3(this,n)};(r[i]||(r[i]=[])).push(o),this._svg&&this._svg.addEventListener(i,o.listener)}return this}off(t,n){const i=this.eventName(t),r=this._handlers[i],s=this._handlerIndex(r,t,n);return s>=0&&(this._svg&&this._svg.removeEventListener(i,r[s].listener),r.splice(s,1)),this}}const c3=(e,t)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i,n.vegaType=n.type,t.call(e._obj,n,i)},eS="aria-hidden",f3="aria-label",d3="role",h3="aria-roledescription",tS="graphics-object",p3="graphics-symbol",nS=(e,t,n)=>({[d3]:e,[h3]:t,[f3]:n||void 0}),BK=er(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),iS={axis:{desc:"axis",caption:qK},legend:{desc:"legend",caption:WK},"title-text":{desc:"title",caption:e=>`Title text '${aS(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${aS(e)}'`}},rS={ariaRole:d3,ariaRoleDescription:h3,description:f3};function sS(e,t){const n=t.aria===!1;if(e(eS,n||void 0),n||t.description==null)for(const i in rS)e(rS[i],void 0);else{const i=t.mark.marktype;e(f3,t.description),e(d3,t.ariaRole||(i==="group"?tS:p3)),e(h3,t.ariaRoleDescription||`${i} mark`)}}function oS(e){return e.aria===!1?{[eS]:!0}:BK[e.role]?null:iS[e.role]?UK(e,iS[e.role]):jK(e)}function jK(e){const t=e.marktype,n=t==="group"||t==="text"||e.items.some(i=>i.description!=null&&i.aria!==!1);return nS(n?tS:p3,`${t} mark container`,e.description)}function UK(e,t){try{const n=e.items[0],i=t.caption||(()=>"");return nS(t.role||p3,t.desc,n.description||i(n))}catch{return null}}function aS(e){return se(e.text).join(" ")}function qK(e){const t=e.datum,n=e.orient,i=t.title?lS(e):null,r=e.context,s=r.scales[t.scale].value,o=r.dataflow.locale(),a=s.type;return`${n==="left"||n==="right"?"Y":"X"}-axis`+(i?` titled '${i}'`:"")+` for a ${hu(a)?"discrete":a} scale with ${t$(o,s,e)}`}function WK(e){const t=e.datum,n=t.title?lS(e):null,i=`${t.type||""} legend`.trim(),r=t.scales,s=Object.keys(r),o=e.context,a=o.scales[r[s[0]]].value,l=o.dataflow.locale();return GK(i)+(n?` titled '${n}'`:"")+` for ${HK(s)} with ${t$(l,a,e)}`}function lS(e){try{return se(Ve(e.items).items[0].text).join(" ")}catch{return null}}function HK(e){return e=e.map(t=>t+(t==="fill"||t==="stroke"?" color":"")),e.length<2?e[0]:e.slice(0,-1).join(", ")+" and "+Ve(e)}function GK(e){return e.length?e[0].toUpperCase()+e.slice(1):e}const uS=e=>(e+"").replace(/&/g,"&").replace(//g,">"),VK=e=>uS(e).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function g3(){let e="",t="",n="";const i=[],r=()=>t=n="",s=l=>{t&&(e+=`${t}>${n}`,r()),i.push(l)},o=(l,u)=>(u!=null&&(t+=` ${l}="${VK(u)}"`),a),a={open(l,...u){s(l),t="<"+l;for(const c of u)for(const f in c)o(f,c[f]);return a},close(){const l=i.pop();return t?e+=t+(n?`>${n}`:"/>"):e+=``,r(),a},attr:o,text:l=>(n+=uS(l),a),toString:()=>e};return a}const cS=e=>fS(g3(),e)+"";function fS(e,t){if(e.open(t.tagName),t.hasAttributes()){const n=t.attributes,i=n.length;for(let r=0;r{c.dirty=n})),!r.zdirty){if(i.exit){o.nested&&r.items.length?(u=r.items[0],u._svg&&this._update(o,u._svg,u)):i._svg&&(u=i._svg.parentNode,u&&u.removeChild(i._svg)),i._svg=null;continue}i=o.nested?r.items[0]:i,i._update!==n&&(!i._svg||!i._svg.ownerSVGElement?(this._dirtyAll=!1,pS(i,n)):this._update(o,i._svg,i),i._update=n)}return!this._dirtyAll}mark(t,n,i,r){if(!this.isDirty(n))return n._svg;const s=this._svg,o=n.marktype,a=yi[o],l=n.interactive===!1?"none":null,u=a.tag==="g",c=gS(n,t,i,"g",s);if(o!=="group"&&r!=null&&!r.includes(o))return Li(c,0),n._svg;c.setAttribute("class",q$(n));const f=oS(n);for(const g in f)On(c,g,f[g]);u||On(c,"pointer-events",l),On(c,"clip-path",n.clip?Ob(this,n,n.group):null);let d=null,h=0;const p=g=>{const m=this.isDirty(g),y=gS(g,c,d,a.tag,s);m&&(this._update(a,y,g),u&&ZK(this,y,g,r)),d=y,++h};return a.nested?n.items.length&&p(n.items[0]):sr(n,p),Li(c,h),c}_update(t,n,i){As=n,Sn=n.__values__,sS(Df,i),t.attr(Df,i,this);const r=JK[t.type];r&&r.call(this,t,n,i),As&&this.style(As,i)}style(t,n){if(n!=null){for(const i in dg){let r=i==="font"?$f(n):n[i];if(r===Sn[i])continue;const s=dg[i];r==null?t.removeAttribute(s):(Fb(r)&&(r=i$(r,this._defs.gradient,mS())),t.setAttribute(s,r+"")),Sn[i]=r}for(const i in hg)pg(t,hg[i],n[i])}}defs(){const t=this._svg,n=this._defs;let i=n.el,r=0;for(const s in n.gradient)i||(n.el=i=Ht(t,Mf+1,"defs",Gt)),r=YK(i,n.gradient[s],r);for(const s in n.clipping)i||(n.el=i=Ht(t,Mf+1,"defs",Gt)),r=XK(i,n.clipping[s],r);i&&(r===0?(t.removeChild(i),n.el=null):Li(i,r))}_clearDefs(){const t=this._defs;t.gradient={},t.clipping={}}}function pS(e,t){for(;e&&e.dirty!==t;e=e.mark.group)if(e.dirty=t,e.mark&&e.mark.dirty!==t)e.mark.dirty=t;else return}function YK(e,t,n){let i,r,s;if(t.gradient==="radial"){let o=Ht(e,n++,"pattern",Gt);No(o,{id:Ip+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),o=Ht(o,0,"rect",Gt),No(o,{width:1,height:1,fill:`url(${mS()}#${t.id})`}),e=Ht(e,n++,"radialGradient",Gt),No(e,{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})}else e=Ht(e,n++,"linearGradient",Gt),No(e,{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2});for(i=0,r=t.stops.length;i{r=e.mark(t,o,r,i),++s}),Li(t,1+s)}function gS(e,t,n,i,r){let s=e._svg,o;if(!s&&(o=t.ownerDocument,s=Do(o,i,Gt),e._svg=s,e.mark&&(s.__data__=e,s.__values__={fill:"default"},i==="g"))){const a=Do(o,"path",Gt);s.appendChild(a),a.__data__=e;const l=Do(o,"g",Gt);s.appendChild(l),l.__data__=e;const u=Do(o,"path",Gt);s.appendChild(u),u.__data__=e,u.__values__={fill:"default"}}return(s.ownerSVGElement!==r||KK(s,n))&&t.insertBefore(s,n?n.nextSibling:t.firstChild),s}function KK(e,t){return e.parentNode&&e.parentNode.childNodes.length>1&&e.previousSibling!=t}let As=null,Sn=null;const JK={group(e,t,n){const i=As=t.childNodes[2];Sn=i.__values__,e.foreground(Df,n,this),Sn=t.__values__,As=t.childNodes[1],e.content(Df,n,this);const r=As=t.childNodes[0];e.background(Df,n,this);const s=n.mark.interactive===!1?"none":null;if(s!==Sn.events&&(On(i,"pointer-events",s),On(r,"pointer-events",s),Sn.events=s),n.strokeForeground&&n.stroke){const o=n.fill;On(i,"display",null),this.style(r,n),On(r,"stroke",null),o&&(n.fill=null),Sn=i.__values__,this.style(i,n),o&&(n.fill=o),As=null}else On(i,"display","none")},image(e,t,n){n.smooth===!1?(pg(t,"image-rendering","optimizeSpeed"),pg(t,"image-rendering","pixelated")):pg(t,"image-rendering",null)},text(e,t,n){const i=Ef(n);let r,s,o,a;G(i)?(s=i.map(l=>Mo(n,l)),r=s.join(` +`),r!==Sn.text&&(Li(t,0),o=t.ownerDocument,a=To(n),s.forEach((l,u)=>{const c=Do(o,"tspan",Gt);c.__data__=n,c.textContent=l,u&&(c.setAttribute("x",0),c.setAttribute("dy",a)),t.appendChild(c)}),Sn.text=r)):(s=Mo(n,i),s!==Sn.text&&(t.textContent=s,Sn.text=s)),On(t,"font-family",$f(n)),On(t,"font-size",Hr(n)+"px"),On(t,"font-style",n.fontStyle),On(t,"font-variant",n.fontVariant),On(t,"font-weight",n.fontWeight)}};function Df(e,t,n){t!==Sn[e]&&(n?QK(As,e,t,n):On(As,e,t),Sn[e]=t)}function pg(e,t,n){n!==Sn[t]&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n+""),Sn[t]=n)}function No(e,t){for(const n in t)On(e,n,t[n])}function On(e,t,n){n!=null?e.setAttribute(t,n):e.removeAttribute(t)}function QK(e,t,n,i){n!=null?e.setAttributeNS(i,t,n):e.removeAttributeNS(i,t)}function mS(){let e;return typeof window>"u"?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}class yS extends Cf{constructor(t){super(t),this._text=null,this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const n=g3();n.open("svg",Be({},kf,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const i=this._bgcolor;return i&&i!=="transparent"&&i!=="none"&&n.open("rect",{width:this._width,height:this._height,fill:i}).close(),n.open("g",dS,{transform:"translate("+this._origin+")"}),this.mark(n,t),n.close(),this.defs(n),this._text=n.close()+"",this}mark(t,n){const i=yi[n.marktype],r=i.tag,s=[sS,i.attr];t.open("g",{class:q$(n),"clip-path":n.clip?Ob(this,n,n.group):null},oS(n),{"pointer-events":r!=="g"&&n.interactive===!1?"none":null});const o=a=>{const l=this.href(a);if(l&&t.open("a",l),t.open(r,this.attr(n,a,s,r!=="g"?r:null)),r==="text"){const u=Ef(a);if(G(u)){const c={x:0,dy:To(a)};for(let f=0;fthis.mark(t,d)),t.close(),u&&f?(c&&(a.fill=null),a.stroke=f,t.open("path",this.attr(n,a,i.foreground,"bgrect")).close(),c&&(a.fill=c)):t.open("path",this.attr(n,a,i.foreground,"bgfore")).close()}t.close(),l&&t.close()};return i.nested?n.items&&n.items.length&&o(n.items[0]):sr(n,o),t.close()}href(t){const n=t.href;let i;if(n){if(i=this._hrefs&&this._hrefs[n])return i;this.sanitizeURL(n).then(r=>{r["xlink:href"]=r.href,r.href=null,(this._hrefs||(this._hrefs={}))[n]=r})}return null}attr(t,n,i,r){const s={},o=(a,l,u,c)=>{s[c||a]=l};return Array.isArray(i)?i.forEach(a=>a(o,n,this)):i(o,n,this),r&&eJ(s,n,t,r,this._defs),s}defs(t){const n=this._defs.gradient,i=this._defs.clipping;if(Object.keys(n).length+Object.keys(i).length!==0){t.open("defs");for(const s in n){const o=n[s],a=o.stops;o.gradient==="radial"?(t.open("pattern",{id:Ip+s,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+s+")"}).close(),t.close(),t.open("radialGradient",{id:s,fx:o.x1,fy:o.y1,fr:o.r1,cx:o.x2,cy:o.y2,r:o.r2})):t.open("linearGradient",{id:s,x1:o.x1,x2:o.x2,y1:o.y1,y2:o.y2});for(let l=0;l!or.svgMarkTypes.includes(s));this._svgRenderer.render(t,or.svgMarkTypes),this._canvasRenderer.render(t,r)}resize(t,n,i,r){return super.resize(t,n,i,r),this._svgRenderer.resize(t,n,i,r),this._canvasRenderer.resize(t,n,i,r),this}background(t){return or.svgOnTop?this._canvasRenderer.background(t):this._svgRenderer.background(t),this}}class bS extends Ff{constructor(t,n){super(t,n)}initialize(t,n,i){const r=Ht(Ht(t,0,"div"),or.svgOnTop?0:1,"div");return super.initialize(r,n,i)}}const vS="canvas",_S="hybrid",xS="png",wS="svg",kS="none",Ro={Canvas:vS,PNG:xS,SVG:wS,Hybrid:_S,None:kS},Oa={};Oa[vS]=Oa[xS]={renderer:fg,headless:fg,handler:Ff},Oa[wS]={renderer:m3,headless:yS,handler:Q$},Oa[_S]={renderer:y3,headless:y3,handler:bS},Oa[kS]={};function gg(e,t){return e=String(e||"").toLowerCase(),arguments.length>1?(Oa[e]=t,this):Oa[e]}function ES(e,t,n){const i=[],r=new zt().union(t),s=e.marktype;return s?$S(e,r,n,i):s==="group"?SS(e,r,n,i):q("Intersect scene must be mark node or group item.")}function $S(e,t,n,i){if(nJ(e,t,n)){const r=e.items,s=e.marktype,o=r.length;let a=0;if(s==="group")for(;a=0;s--)if(n[s]!=i[s])return!1;for(s=n.length-1;s>=0;s--)if(r=n[s],!v3(e[r],t[r],r))return!1;return typeof e==typeof t}function sJ(){_Z(),AX()}const _u="top",ar="left",lr="right",Oo="bottom",oJ="top-left",aJ="top-right",lJ="bottom-left",uJ="bottom-right",_3="start",x3="middle",Ln="end",cJ="x",fJ="y",mg="group",w3="axis",k3="title",dJ="frame",hJ="scope",E3="legend",TS="row-header",MS="row-footer",DS="row-title",NS="column-header",RS="column-footer",OS="column-title",pJ="padding",gJ="symbol",LS="fit",IS="fit-x",PS="fit-y",mJ="pad",$3="none",yg="all",S3="each",C3="flush",Lo="column",Io="row";function zS(e){j.call(this,null,e)}te(zS,j,{transform(e,t){const n=t.dataflow,i=e.mark,r=i.marktype,s=yi[r],o=s.bound;let a=i.bounds,l;if(s.nested)i.items.length&&n.dirty(i.items[0]),a=bg(i,o),i.items.forEach(u=>{u.bounds.clear().union(a)});else if(r===mg||e.modified())switch(t.visit(t.MOD,u=>n.dirty(u)),a.clear(),i.items.forEach(u=>a.union(bg(u,o))),i.role){case w3:case E3:case k3:t.reflow()}else l=t.changed(t.REM),t.visit(t.ADD,u=>{a.union(bg(u,o))}),t.visit(t.MOD,u=>{l=l||a.alignsWith(u.bounds),n.dirty(u),a.union(bg(u,o))}),l&&(a.clear(),i.items.forEach(u=>a.union(u.bounds)));return AS(i),t.modifies("bounds")}});function bg(e,t,n){return t(e.bounds.clear(),e,n)}const BS=":vega_identifier:";function A3(e){j.call(this,0,e)}A3.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},te(A3,j,{transform(e,t){const n=yJ(t.dataflow),i=e.as;let r=n.value;return t.visit(t.ADD,s=>s[i]=s[i]||++r),n.set(this.value=r),t}});function yJ(e){return e._signals[BS]||(e._signals[BS]=e.add(0))}function jS(e){j.call(this,null,e)}te(jS,j,{transform(e,t){let n=this.value;n||(n=t.dataflow.scenegraph().mark(e.markdef,bJ(e),e.index),n.group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const i=n.marktype===mg?jp:Bp;return t.visit(t.ADD,r=>i.call(r,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});function bJ(e){const t=e.groups,n=e.parent;return t&&t.size===1?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}function US(e){j.call(this,null,e)}const qS={parity:e=>e.filter((t,n)=>n%2?t.opacity=0:1),greedy:(e,t)=>{let n;return e.filter((i,r)=>!r||!WS(n.bounds,i.bounds,t)?(n=i,1):i.opacity=0)}},WS=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),HS=(e,t)=>{for(var n=1,i=e.length,r=e[0].bounds,s;n{const t=e.bounds;return t.width()>1&&t.height()>1},_J=(e,t,n)=>{var i=e.range(),r=new zt;return t===_u||t===Oo?r.set(i[0],-1/0,i[1],1/0):r.set(-1/0,i[0],1/0,i[1]),r.expand(n||1),s=>r.encloses(s.bounds)},GS=e=>(e.forEach(t=>t.opacity=1),e),VS=(e,t)=>e.reflow(t.modified()).modifies("opacity");te(US,j,{transform(e,t){const n=qS[e.method]||qS.parity,i=e.separation||0;let r=t.materialize(t.SOURCE).source,s,o;if(!r||!r.length)return;if(!e.method)return e.modified("method")&&(GS(r),t=VS(t,e)),t;if(r=r.filter(vJ),!r.length)return;if(e.sort&&(r=r.slice().sort(e.sort)),s=GS(r),t=VS(t,e),s.length>=3&&HS(s,i)){do s=n(s,i);while(s.length>=3&&HS(s,i));s.length<3&&!Ve(r).opacity&&(s.length>1&&(Ve(s).opacity=0),Ve(r).opacity=1)}e.boundScale&&e.boundTolerance>=0&&(o=_J(e.boundScale,e.boundOrient,+e.boundTolerance),r.forEach(l=>{o(l)||(l.opacity=0)}));const a=s[0].mark.bounds.clear();return r.forEach(l=>{l.opacity&&a.union(l.bounds)}),t}});function YS(e){j.call(this,null,e)}te(YS,j,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,i=>n.dirty(i)),t.fields&&t.fields.zindex){const i=t.source&&t.source[0];i&&(i.mark.zdirty=!0)}}});const Cn=new zt;function xu(e,t,n){return e[t]===n?0:(e[t]=n,1)}function xJ(e){var t=e.items[0].orient;return t===ar||t===lr}function wJ(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}function kJ(e,t,n,i){var r=t.items[0],s=r.datum,o=r.translate!=null?r.translate:.5,a=r.orient,l=wJ(s),u=r.range,c=r.offset,f=r.position,d=r.minExtent,h=r.maxExtent,p=s.title&&r.items[l[2]].items[0],g=r.titlePadding,m=r.bounds,y=p&&e3(p),b=0,v=0,_,x;switch(Cn.clear().union(m),m.clear(),(_=l[0])>-1&&m.union(r.items[_].bounds),(_=l[1])>-1&&m.union(r.items[_].bounds),a){case _u:b=f||0,v=-c,x=Math.max(d,Math.min(h,-m.y1)),m.add(0,-x).add(u,0),p&&vg(e,p,x,g,y,0,-1,m);break;case ar:b=-c,v=f||0,x=Math.max(d,Math.min(h,-m.x1)),m.add(-x,0).add(0,u),p&&vg(e,p,x,g,y,1,-1,m);break;case lr:b=n+c,v=f||0,x=Math.max(d,Math.min(h,m.x2)),m.add(0,0).add(x,u),p&&vg(e,p,x,g,y,1,1,m);break;case Oo:b=f||0,v=i+c,x=Math.max(d,Math.min(h,m.y2)),m.add(0,0).add(u,x),p&&vg(e,p,x,g,0,0,1,m);break;default:b=r.x,v=r.y}return Cs(m.translate(b,v),r),xu(r,"x",b+o)|xu(r,"y",v+o)&&(r.bounds=Cn,e.dirty(r),r.bounds=m,e.dirty(r)),r.mark.bounds.clear().union(m)}function vg(e,t,n,i,r,s,o,a){const l=t.bounds;if(t.auto){const u=o*(n+r+i);let c=0,f=0;e.dirty(t),s?c=(t.x||0)-(t.x=u):f=(t.y||0)-(t.y=u),t.mark.bounds.clear().union(l.translate(-c,-f)),e.dirty(t)}a.union(l)}const XS=(e,t)=>Math.floor(Math.min(e,t)),ZS=(e,t)=>Math.ceil(Math.max(e,t));function EJ(e){var t=e.items,n=t.length,i=0,r,s;const o={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i1)for(w=0;w0&&(v[w]+=M/2);if(a&&kt(n.center,Io)&&c!==1)for(w=0;w0&&(_[w]+=S/2);for(w=0;wr&&(e.warn("Grid headers exceed limit: "+r),t=t.slice(0,r)),g+=s,b=0,_=t.length;b<_;++b)e.dirty(t[b]),t[b].mark.bounds.clear();for(y=c,b=0,_=t.length;b<_;++b,y+=f){for(k=t[b],x=k.mark.bounds,v=y;v>=0&&(w=n[v])==null;v-=d);a?(E=h==null?w.x:Math.round(w.bounds.x1+h*w.bounds.width()),$=g):(E=g,$=h==null?w.y:Math.round(w.bounds.y1+h*w.bounds.height())),x.union(k.bounds.translate(E-(k.x||0),$-(k.y||0))),k.x=E,k.y=$,e.dirty(k),m=o(m,x[u])}return m}function QS(e,t,n,i,r,s){if(t){e.dirty(t);var o=n,a=n;i?o=Math.round(r.x1+s*r.width()):a=Math.round(r.y1+s*r.height()),t.bounds.translate(o-(t.x||0),a-(t.y||0)),t.mark.bounds.clear().union(t.bounds),t.x=o,t.y=a,e.dirty(t)}}function TJ(e,t){const n=e[t]||{};return(i,r)=>n[i]!=null?n[i]:e[i]!=null?e[i]:r}function MJ(e,t){let n=-1/0;return e.forEach(i=>{i.offset!=null&&(n=Math.max(n,i.offset))}),n>-1/0?n:t}function DJ(e,t,n,i,r,s,o){const a=TJ(n,t),l=MJ(e,a("offset",0)),u=a("anchor",_3),c=u===Ln?1:u===x3?.5:0,f={align:S3,bounds:a("bounds",C3),columns:a("direction")==="vertical"?1:e.length,padding:a("margin",8),center:a("center"),nodirty:!0};switch(t){case ar:f.anchor={x:Math.floor(i.x1)-l,column:Ln,y:c*(o||i.height()+2*i.y1),row:u};break;case lr:f.anchor={x:Math.ceil(i.x2)+l,y:c*(o||i.height()+2*i.y1),row:u};break;case _u:f.anchor={y:Math.floor(r.y1)-l,row:Ln,x:c*(s||r.width()+2*r.x1),column:u};break;case Oo:f.anchor={y:Math.ceil(r.y2)+l,x:c*(s||r.width()+2*r.x1),column:u};break;case oJ:f.anchor={x:l,y:l};break;case aJ:f.anchor={x:s-l,y:l,column:Ln};break;case lJ:f.anchor={x:l,y:o-l,row:Ln};break;case uJ:f.anchor={x:s-l,y:o-l,column:Ln,row:Ln};break}return f}function NJ(e,t){var n=t.items[0],i=n.datum,r=n.orient,s=n.bounds,o=n.x,a=n.y,l,u;return n._bounds?n._bounds.clear().union(s):n._bounds=s.clone(),s.clear(),OJ(e,n,n.items[0].items[0]),s=RJ(n,s),l=2*n.padding,u=2*n.padding,s.empty()||(l=Math.ceil(s.width()+l),u=Math.ceil(s.height()+u)),i.type===gJ&&LJ(n.items[0].items[0].items[0].items),r!==$3&&(n.x=o=0,n.y=a=0),n.width=l,n.height=u,Cs(s.set(o,a,o+l,a+u),n),n.mark.bounds.clear().union(s),n}function RJ(e,t){return e.items.forEach(n=>t.union(n.bounds)),t.x1=e.padding,t.y1=e.padding,t}function OJ(e,t,n){var i=t.padding,r=i-n.x,s=i-n.y;if(!t.datum.title)(r||s)&&Nf(e,n,r,s);else{var o=t.items[1].items[0],a=o.anchor,l=t.titlePadding||0,u=i-o.x,c=i-o.y;switch(o.orient){case ar:r+=Math.ceil(o.bounds.width())+l;break;case lr:case Oo:break;default:s+=o.bounds.height()+l}switch((r||s)&&Nf(e,n,r,s),o.orient){case ar:c+=wu(t,n,o,a,1,1);break;case lr:u+=wu(t,n,o,Ln,0,0)+l,c+=wu(t,n,o,a,1,1);break;case Oo:u+=wu(t,n,o,a,0,0),c+=wu(t,n,o,Ln,-1,0,1)+l;break;default:u+=wu(t,n,o,a,0,0)}(u||c)&&Nf(e,o,u,c),(u=Math.round(o.bounds.x1-i))<0&&(Nf(e,n,-u,0),Nf(e,o,-u,0))}}function wu(e,t,n,i,r,s,o){const a=e.datum.type!=="symbol",l=n.datum.vgrad,u=a&&(s||!l)&&!o?t.items[0]:t,c=u.bounds[r?"y2":"x2"]-e.padding,f=l&&s?c:0,d=l&&s?0:c,h=r<=0?0:e3(n);return Math.round(i===_3?f:i===Ln?d-h:.5*(c-h))}function Nf(e,t,n,i){t.x+=n,t.y+=i,t.bounds.translate(n,i),t.mark.bounds.translate(n,i),e.dirty(t)}function LJ(e){const t=e.reduce((n,i)=>(n[i.column]=Math.max(i.bounds.x2-i.x,n[i.column]||0),n),{});e.forEach(n=>{n.width=t[n.column],n.height=n.bounds.y2-n.y})}function IJ(e,t,n,i,r){var s=t.items[0],o=s.frame,a=s.orient,l=s.anchor,u=s.offset,c=s.padding,f=s.items[0].items[0],d=s.items[1]&&s.items[1].items[0],h=a===ar||a===lr?i:n,p=0,g=0,m=0,y=0,b=0,v;if(o!==mg?a===ar?(p=r.y2,h=r.y1):a===lr?(p=r.y1,h=r.y2):(p=r.x1,h=r.x2):a===ar&&(p=i,h=0),v=l===_3?p:l===Ln?h:(p+h)/2,d&&d.text){switch(a){case _u:case Oo:b=f.bounds.height()+c;break;case ar:y=f.bounds.width()+c;break;case lr:y=-f.bounds.width()-c;break}Cn.clear().union(d.bounds),Cn.translate(y-(d.x||0),b-(d.y||0)),xu(d,"x",y)|xu(d,"y",b)&&(e.dirty(d),d.bounds.clear().union(Cn),d.mark.bounds.clear().union(Cn),e.dirty(d)),Cn.clear().union(d.bounds)}else Cn.clear();switch(Cn.union(f.bounds),a){case _u:g=v,m=r.y1-Cn.height()-u;break;case ar:g=r.x1-Cn.width()-u,m=v;break;case lr:g=r.x2+Cn.width()+u,m=v;break;case Oo:g=v,m=r.y2+u;break;default:g=s.x,m=s.y}return xu(s,"x",g)|xu(s,"y",m)&&(Cn.translate(g,m),e.dirty(s),s.bounds.clear().union(Cn),t.bounds.clear().union(Cn),e.dirty(s)),s.bounds}function eC(e){j.call(this,null,e)}te(eC,j,{transform(e,t){const n=t.dataflow;return e.mark.items.forEach(i=>{e.layout&&CJ(n,i,e.layout),zJ(n,i,e)}),PJ(e.mark.group)?t.reflow():t}});function PJ(e){return e&&e.mark.role!=="legend-entry"}function zJ(e,t,n){var i=t.items,r=Math.max(0,t.width||0),s=Math.max(0,t.height||0),o=new zt().set(0,0,r,s),a=o.clone(),l=o.clone(),u=[],c,f,d,h,p,g;for(p=0,g=i.length;p{d=y.orient||lr,d!==$3&&(m[d]||(m[d]=[])).push(y)});for(const y in m){const b=m[y];JS(e,b,DJ(b,y,n.legends,a,l,r,s))}u.forEach(y=>{const b=y.bounds;if(b.equals(y._bounds)||(y.bounds=y._bounds,e.dirty(y),y.bounds=b,e.dirty(y)),n.autosize&&(n.autosize.type===LS||n.autosize.type===IS||n.autosize.type===PS))switch(y.orient){case ar:case lr:o.add(b.x1,0).add(b.x2,0);break;case _u:case Oo:o.add(0,b.y1).add(0,b.y2)}else o.union(b)})}o.union(a).union(l),c&&o.union(IJ(e,c,r,s,o)),t.clip&&o.set(0,0,t.width||0,t.height||0),BJ(e,t,o,n)}function BJ(e,t,n,i){const r=i.autosize||{},s=r.type;if(e._autosize<1||!s)return;let o=e._width,a=e._height,l=Math.max(0,t.width||0),u=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,t.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-l)),h=Math.max(0,Math.ceil(n.y2-c));if(r.contains===pJ){const p=e.padding();o-=p.left+p.right,a-=p.top+p.bottom}s===$3?(u=0,f=0,l=o,c=a):s===LS?(l=Math.max(0,o-u-d),c=Math.max(0,a-f-h)):s===IS?(l=Math.max(0,o-u-d),a=c+f+h):s===PS?(o=l+u+d,c=Math.max(0,a-f-h)):s===mJ&&(o=l+u+d,a=c+f+h),e._resizeView(o,a,l,c,[u,f],r.resize)}const jJ=Object.freeze(Object.defineProperty({__proto__:null,bound:zS,identifier:A3,mark:jS,overlap:US,render:YS,viewlayout:eC},Symbol.toStringTag,{value:"Module"}));function tC(e){j.call(this,null,e)}te(tC,j,{transform(e,t){if(this.value&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.scale,o=e.count==null?e.values?e.values.length:10:e.count,a=Sb(s,o,e.minstep),l=e.format||YE(n,s,a,e.formatSpecifier,e.formatType,!!e.values),u=e.values?VE(s,e.values,a):Cb(s,a);return r&&(i.rem=r),r=u.map((c,f)=>tt({index:f/(u.length-1||1),value:c,label:l(c)})),e.extra&&r.length&&r.push(tt({index:-1,extra:{value:r[0].value},label:""})),i.source=r,i.add=r,this.value=r,i}});function nC(e){j.call(this,null,e)}function UJ(){return tt({})}function qJ(e){const t=Ul().test(n=>n.exit);return t.lookup=n=>t.get(e(n)),t}te(nC,j,{transform(e,t){var n=t.dataflow,i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=e.item||UJ,s=e.key||$e,o=this.value;return G(i.encode)&&(i.encode=null),o&&(e.modified("key")||t.modified(s))&&q("DataJoin does not support modified key function or fields."),o||(t=t.addAll(),this.value=o=qJ(s)),t.visit(t.ADD,a=>{const l=s(a);let u=o.get(l);u?u.exit?(o.empty--,i.add.push(u)):i.mod.push(u):(u=r(a),o.set(l,u),i.add.push(u)),u.datum=a,u.exit=!1}),t.visit(t.MOD,a=>{const l=s(a),u=o.get(l);u&&(u.datum=a,i.mod.push(u))}),t.visit(t.REM,a=>{const l=s(a),u=o.get(l);a===u.datum&&!u.exit&&(i.rem.push(u),u.exit=!0,++o.empty)}),t.changed(t.ADD_MOD)&&i.modifies("datum"),(t.clean()||e.clean&&o.empty>n.cleanThreshold)&&n.runAfter(o.clean),i}});function iC(e){j.call(this,null,e)}te(iC,j,{transform(e,t){var n=t.fork(t.ADD_REM),i=e.mod||!1,r=e.encoders,s=t.encode;if(G(s))if(n.changed()||s.every(f=>r[f]))s=s[0],n.encode=null;else return t.StopPropagation;var o=s==="enter",a=r.update||oo,l=r.enter||oo,u=r.exit||oo,c=(s&&!o?r[s]:a)||oo;if(t.changed(t.ADD)&&(t.visit(t.ADD,f=>{l(f,e),a(f,e)}),n.modifies(l.output),n.modifies(a.output),c!==oo&&c!==a&&(t.visit(t.ADD,f=>{c(f,e)}),n.modifies(c.output))),t.changed(t.REM)&&u!==oo&&(t.visit(t.REM,f=>{u(f,e)}),n.modifies(u.output)),o||c!==oo){const f=t.MOD|(e.modified()?t.REFLOW:0);o?(t.visit(f,d=>{const h=l(d,e)||i;(c(d,e)||h)&&n.mod.push(d)}),n.mod.length&&n.modifies(l.output)):t.visit(f,d=>{(c(d,e)||i)&&n.mod.push(d)}),n.mod.length&&n.modifies(c.output)}return n.changed()?n:t.StopPropagation}});function rC(e){j.call(this,[],e)}te(rC,j,{transform(e,t){if(this.value!=null&&!e.modified())return t.StopPropagation;var n=t.dataflow.locale(),i=t.fork(t.NO_SOURCE|t.NO_FIELDS),r=this.value,s=e.type||Lp,o=e.scale,a=+e.limit,l=Sb(o,e.count==null?5:e.count,e.minstep),u=!!e.values||s===Lp,c=e.format||JE(n,o,l,s,e.formatSpecifier,e.formatType,u),f=e.values||KE(o,l),d,h,p,g,m;return r&&(i.rem=r),s===Lp?(a&&f.length>a?(t.dataflow.warn("Symbol legend count exceeds limit, filtering items."),r=f.slice(0,a-1),m=!0):r=f,ze(p=e.size)?(!e.values&&o(r[0])===0&&(r=r.slice(1)),g=r.reduce((y,b)=>Math.max(y,p(b,e)),0)):p=xn(g=p||8),r=r.map((y,b)=>tt({index:b,label:c(y,b,r),value:y,offset:g,size:p(y,e)})),m&&(m=f[r.length],r.push(tt({index:r.length,label:`…${f.length-r.length} entries`,value:m,offset:g,size:p(m,e)})))):s===gX?(d=o.domain(),h=qE(o,d[0],Ve(d)),f.length<3&&!e.values&&d[0]!==Ve(d)&&(f=[d[0],Ve(d)]),r=f.map((y,b)=>tt({index:b,label:c(y,b,f),value:y,perc:h(y)}))):(p=f.length-1,h=SX(o),r=f.map((y,b)=>tt({index:b,label:c(y,b,f),value:y,perc:b?h(y):0,perc2:b===p?1:h(f[b+1])}))),i.source=r,i.add=r,this.value=r,i}});const WJ=e=>e.source.x,HJ=e=>e.source.y,GJ=e=>e.target.x,VJ=e=>e.target.y;function F3(e){j.call(this,{},e)}F3.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},te(F3,j,{transform(e,t){var n=e.sourceX||WJ,i=e.sourceY||HJ,r=e.targetX||GJ,s=e.targetY||VJ,o=e.as||"path",a=e.orient||"vertical",l=e.shape||"line",u=lC.get(l+"-"+a)||lC.get(l);return u||q("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,c=>{c[o]=u(n(c),i(c),r(c),s(c))}),t.reflow(e.modified()).modifies(o)}});const sC=(e,t,n,i)=>"M"+e+","+t+"L"+n+","+i,YJ=(e,t,n,i)=>sC(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),oC=(e,t,n,i)=>{var r=n-e,s=i-t,o=Math.hypot(r,s)/2,a=180*Math.atan2(s,r)/Math.PI;return"M"+e+","+t+"A"+o+","+o+" "+a+" 0 1 "+n+","+i},XJ=(e,t,n,i)=>oC(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),aC=(e,t,n,i)=>{const r=n-e,s=i-t,o=.2*(r+s),a=.2*(s-r);return"M"+e+","+t+"C"+(e+o)+","+(t+a)+" "+(n+a)+","+(i-o)+" "+n+","+i},lC=Ul({line:sC,"line-radial":YJ,arc:oC,"arc-radial":XJ,curve:aC,"curve-radial":(e,t,n,i)=>aC(t*Math.cos(e),t*Math.sin(e),i*Math.cos(n),i*Math.sin(n)),"orthogonal-horizontal":(e,t,n,i)=>"M"+e+","+t+"V"+i+"H"+n,"orthogonal-vertical":(e,t,n,i)=>"M"+e+","+t+"H"+n+"V"+i,"orthogonal-radial":(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),l=Math.abs(n-e)>Math.PI?n<=e:n>e;return"M"+t*r+","+t*s+"A"+t+","+t+" 0 0,"+(l?1:0)+" "+t*o+","+t*a+"L"+i*o+","+i*a},"diagonal-horizontal":(e,t,n,i)=>{const r=(e+n)/2;return"M"+e+","+t+"C"+r+","+t+" "+r+","+i+" "+n+","+i},"diagonal-vertical":(e,t,n,i)=>{const r=(t+i)/2;return"M"+e+","+t+"C"+e+","+r+" "+n+","+r+" "+n+","+i},"diagonal-radial":(e,t,n,i)=>{const r=Math.cos(e),s=Math.sin(e),o=Math.cos(n),a=Math.sin(n),l=(t+i)/2;return"M"+t*r+","+t*s+"C"+l*r+","+l*s+" "+l*o+","+l*a+" "+i*o+","+i*a}});function T3(e){j.call(this,null,e)}T3.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},te(T3,j,{transform(e,t){var n=e.as||["startAngle","endAngle"],i=n[0],r=n[1],s=e.field||Pl,o=e.startAngle||0,a=e.endAngle!=null?e.endAngle:2*Math.PI,l=t.source,u=l.map(s),c=u.length,f=o,d=(a-o)/Lk(u),h=hi(c),p,g,m;for(e.sort&&h.sort((y,b)=>u[y]-u[b]),p=0;p-1)return i;var r=t.domain,s=e.type,o=t.zero||t.zero===void 0&&KJ(e),a,l;if(!r)return 0;if((o||t.domainMin!=null||t.domainMax!=null||t.domainMid!=null)&&(a=(r=r.slice()).length-1||1,o&&(r[0]>0&&(r[0]=0),r[a]<0&&(r[a]=0)),t.domainMin!=null&&(r[0]=t.domainMin),t.domainMax!=null&&(r[a]=t.domainMax),t.domainMid!=null)){l=t.domainMid;const u=l>r[a]?a+1:lr+(s<0?-1:s>0?1:0),0));i!==t.length&&n.warn("Log scale domain includes zero: "+ee(t))}return t}function rQ(e,t,n){let i=t.bins;if(i&&!G(i)){const r=e.domain(),s=r[0],o=Ve(r),a=i.step;let l=i.start==null?s:i.start,u=i.stop==null?o:i.stop;a||q("Scale bins parameter missing step property."),lo&&(u=a*Math.floor(o/a)),i=hi(l,u+a/2,a)}return i?e.bins=i:e.bins&&delete e.bins,e.type===vb&&(i?!t.domain&&!t.domainRaw&&(e.domain(i),n=i.length):e.bins=e.domain()),n}function sQ(e,t,n){var i=e.type,r=t.round||!1,s=t.range;if(t.rangeStep!=null)s=oQ(i,t,n);else if(t.scheme&&(s=aQ(i,t,n),ze(s))){if(e.interpolator)return e.interpolator(s);q(`Scale type ${i} does not support interpolating color schemes.`)}if(s&&zE(i))return e.interpolator(Op(M3(s,t.reverse),t.interpolate,t.interpolateGamma));s&&t.interpolate&&e.interpolate?e.interpolate(Eb(t.interpolate,t.interpolateGamma)):ze(e.round)?e.round(r):ze(e.rangeRound)&&e.interpolate(r?uf:Eo),s&&e.range(M3(s,t.reverse))}function oQ(e,t,n){e!==ME&&e!==bb&&q("Only band and point scales support rangeStep.");var i=(t.paddingOuter!=null?t.paddingOuter:t.padding)||0,r=e===bb?1:(t.paddingInner!=null?t.paddingInner:t.padding)||0;return[0,t.rangeStep*mb(n,r,i)]}function aQ(e,t,n){var i=t.schemeExtent,r,s;return G(t.scheme)?s=Op(t.scheme,t.interpolate,t.interpolateGamma):(r=t.scheme.toLowerCase(),s=$b(r),s||q(`Unrecognized scheme name: ${t.scheme}`)),n=e===Np?n+1:e===vb?n-1:e===du||e===Dp?+t.schemeCount||ZJ:n,zE(e)?dC(s,i,t.reverse):ze(s)?UE(dC(s,i),n):e===yb?s:s.slice(0,n)}function dC(e,t,n){return ze(e)&&(t||n)?jE(e,M3(t||[0,1],n)):e}function M3(e,t){return t?e.slice().reverse():e}function hC(e){j.call(this,null,e)}te(hC,j,{transform(e,t){const n=e.modified("sort")||t.changed(t.ADD)||t.modified(e.sort.fields)||t.modified("datum");return n&&t.source.sort(ba(e.sort)),this.modified(n),t}});const pC="zero",gC="center",mC="normalize",yC=["y0","y1"];function D3(e){j.call(this,null,e)}D3.Definition={type:"Stack",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:!0},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:pC,values:[pC,gC,mC]},{name:"as",type:"string",array:!0,length:2,default:yC}]},te(D3,j,{transform(e,t){var n=e.as||yC,i=n[0],r=n[1],s=ba(e.sort),o=e.field||Pl,a=e.offset===gC?lQ:e.offset===mC?uQ:cQ,l,u,c,f;for(l=fQ(t.source,e.groupby,s,o),u=0,c=l.length,f=l.max;ug(c),o,a,l,u,c,f,d,h,p;if(t==null)r.push(e.slice());else for(o={},a=0,l=e.length;ap&&(p=h),n&&d.sort(n)}return r.max=p,r}const dQ=Object.freeze(Object.defineProperty({__proto__:null,axisticks:tC,datajoin:nC,encode:iC,legendentries:rC,linkpath:F3,pie:T3,scale:cC,sortitems:hC,stack:D3},Symbol.toStringTag,{value:"Module"}));var Fe=1e-6,xg=1e-12,qe=Math.PI,Mt=qe/2,wg=qe/4,In=qe*2,Rt=180/qe,Ue=qe/180,Ye=Math.abs,ku=Math.atan,Ii=Math.atan2,Te=Math.cos,kg=Math.ceil,bC=Math.exp,N3=Math.hypot,Eg=Math.log,R3=Math.pow,Se=Math.sin,Pi=Math.sign||function(e){return e>0?1:e<0?-1:0},Pn=Math.sqrt,O3=Math.tan;function vC(e){return e>1?0:e<-1?qe:Math.acos(e)}function ni(e){return e>1?Mt:e<-1?-Mt:Math.asin(e)}function un(){}function $g(e,t){e&&xC.hasOwnProperty(e.type)&&xC[e.type](e,t)}var _C={Feature:function(e,t){$g(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,i=-1,r=n.length;++i=0?1:-1,r=i*n,s=Te(t),o=Se(t),a=z3*o,l=P3*s+a*Te(r),u=a*i*Se(r);Sg.add(Ii(u,l)),I3=e,P3=s,z3=o}function mQ(e){return Cg=new Rn,Fs(e,Gr),Cg*2}function Ag(e){return[Ii(e[1],e[0]),ni(e[2])]}function La(e){var t=e[0],n=e[1],i=Te(n);return[i*Te(t),i*Se(t),Se(n)]}function Fg(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Eu(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function B3(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Tg(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Mg(e){var t=Pn(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var St,ii,Dt,bi,Ia,SC,CC,$u,Rf,Po,Ts,Ms={point:j3,lineStart:FC,lineEnd:TC,polygonStart:function(){Ms.point=MC,Ms.lineStart=yQ,Ms.lineEnd=bQ,Rf=new Rn,Gr.polygonStart()},polygonEnd:function(){Gr.polygonEnd(),Ms.point=j3,Ms.lineStart=FC,Ms.lineEnd=TC,Sg<0?(St=-(Dt=180),ii=-(bi=90)):Rf>Fe?bi=90:Rf<-Fe&&(ii=-90),Ts[0]=St,Ts[1]=Dt},sphere:function(){St=-(Dt=180),ii=-(bi=90)}};function j3(e,t){Po.push(Ts=[St=e,Dt=e]),tbi&&(bi=t)}function AC(e,t){var n=La([e*Ue,t*Ue]);if($u){var i=Eu($u,n),r=[i[1],-i[0],0],s=Eu(r,i);Mg(s),s=Ag(s);var o=e-Ia,a=o>0?1:-1,l=s[0]*Rt*a,u,c=Ye(o)>180;c^(a*Iabi&&(bi=u)):(l=(l+360)%360-180,c^(a*Iabi&&(bi=t))),c?evi(St,Dt)&&(Dt=e):vi(e,Dt)>vi(St,Dt)&&(St=e):Dt>=St?(eDt&&(Dt=e)):e>Ia?vi(St,e)>vi(St,Dt)&&(Dt=e):vi(e,Dt)>vi(St,Dt)&&(St=e)}else Po.push(Ts=[St=e,Dt=e]);tbi&&(bi=t),$u=n,Ia=e}function FC(){Ms.point=AC}function TC(){Ts[0]=St,Ts[1]=Dt,Ms.point=j3,$u=null}function MC(e,t){if($u){var n=e-Ia;Rf.add(Ye(n)>180?n+(n>0?360:-360):n)}else SC=e,CC=t;Gr.point(e,t),AC(e,t)}function yQ(){Gr.lineStart()}function bQ(){MC(SC,CC),Gr.lineEnd(),Ye(Rf)>Fe&&(St=-(Dt=180)),Ts[0]=St,Ts[1]=Dt,$u=null}function vi(e,t){return(t-=e)<0?t+360:t}function vQ(e,t){return e[0]-t[0]}function DC(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tvi(i[0],i[1])&&(i[1]=r[1]),vi(r[0],i[1])>vi(i[0],i[1])&&(i[0]=r[0])):s.push(i=r);for(o=-1/0,n=s.length-1,t=0,i=s[n];t<=n;i=r,++t)r=s[t],(a=vi(i[1],r[0]))>o&&(o=a,St=r[0],Dt=i[1])}return Po=Ts=null,St===1/0||ii===1/0?[[NaN,NaN],[NaN,NaN]]:[[St,ii],[Dt,bi]]}var Of,Dg,Ng,Rg,Og,Lg,Ig,Pg,U3,q3,W3,NC,RC,zn,Bn,jn,ur={sphere:un,point:H3,lineStart:OC,lineEnd:LC,polygonStart:function(){ur.lineStart=kQ,ur.lineEnd=EQ},polygonEnd:function(){ur.lineStart=OC,ur.lineEnd=LC}};function H3(e,t){e*=Ue,t*=Ue;var n=Te(t);Lf(n*Te(e),n*Se(e),Se(t))}function Lf(e,t,n){++Of,Ng+=(e-Ng)/Of,Rg+=(t-Rg)/Of,Og+=(n-Og)/Of}function OC(){ur.point=xQ}function xQ(e,t){e*=Ue,t*=Ue;var n=Te(t);zn=n*Te(e),Bn=n*Se(e),jn=Se(t),ur.point=wQ,Lf(zn,Bn,jn)}function wQ(e,t){e*=Ue,t*=Ue;var n=Te(t),i=n*Te(e),r=n*Se(e),s=Se(t),o=Ii(Pn((o=Bn*s-jn*r)*o+(o=jn*i-zn*s)*o+(o=zn*r-Bn*i)*o),zn*i+Bn*r+jn*s);Dg+=o,Lg+=o*(zn+(zn=i)),Ig+=o*(Bn+(Bn=r)),Pg+=o*(jn+(jn=s)),Lf(zn,Bn,jn)}function LC(){ur.point=H3}function kQ(){ur.point=$Q}function EQ(){IC(NC,RC),ur.point=H3}function $Q(e,t){NC=e,RC=t,e*=Ue,t*=Ue,ur.point=IC;var n=Te(t);zn=n*Te(e),Bn=n*Se(e),jn=Se(t),Lf(zn,Bn,jn)}function IC(e,t){e*=Ue,t*=Ue;var n=Te(t),i=n*Te(e),r=n*Se(e),s=Se(t),o=Bn*s-jn*r,a=jn*i-zn*s,l=zn*r-Bn*i,u=N3(o,a,l),c=ni(u),f=u&&-c/u;U3.add(f*o),q3.add(f*a),W3.add(f*l),Dg+=c,Lg+=c*(zn+(zn=i)),Ig+=c*(Bn+(Bn=r)),Pg+=c*(jn+(jn=s)),Lf(zn,Bn,jn)}function SQ(e){Of=Dg=Ng=Rg=Og=Lg=Ig=Pg=0,U3=new Rn,q3=new Rn,W3=new Rn,Fs(e,ur);var t=+U3,n=+q3,i=+W3,r=N3(t,n,i);return rqe&&(e-=Math.round(e/In)*In),[e,t]}V3.invert=V3;function PC(e,t,n){return(e%=In)?t||n?G3(BC(e),jC(t,n)):BC(e):t||n?jC(t,n):V3}function zC(e){return function(t,n){return t+=e,Ye(t)>qe&&(t-=Math.round(t/In)*In),[t,n]}}function BC(e){var t=zC(e);return t.invert=zC(-e),t}function jC(e,t){var n=Te(e),i=Se(e),r=Te(t),s=Se(t);function o(a,l){var u=Te(l),c=Te(a)*u,f=Se(a)*u,d=Se(l),h=d*n+c*i;return[Ii(f*r-h*s,c*n-d*i),ni(h*r+f*s)]}return o.invert=function(a,l){var u=Te(l),c=Te(a)*u,f=Se(a)*u,d=Se(l),h=d*r-f*s;return[Ii(f*r+d*s,c*n+h*i),ni(h*n-c*i)]},o}function CQ(e){e=PC(e[0]*Ue,e[1]*Ue,e.length>2?e[2]*Ue:0);function t(n){return n=e(n[0]*Ue,n[1]*Ue),n[0]*=Rt,n[1]*=Rt,n}return t.invert=function(n){return n=e.invert(n[0]*Ue,n[1]*Ue),n[0]*=Rt,n[1]*=Rt,n},t}function AQ(e,t,n,i,r,s){if(n){var o=Te(t),a=Se(t),l=i*n;r==null?(r=t+i*In,s=t-l/2):(r=UC(o,r),s=UC(o,s),(i>0?rs)&&(r+=i*In));for(var u,c=r;i>0?c>s:c1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function zg(e,t){return Ye(e[0]-t[0])=0;--a)r.point((f=c[a])[0],f[1]);else i(d.x,d.p.x,-1,r);d=d.p}d=d.o,c=d.z,h=!h}while(!d.v);r.lineEnd()}}}function HC(e){if(t=e.length){for(var t,n=0,i=e[0],r;++n=0?1:-1,F=$*E,A=F>qe,z=m*k;if(l.add(Ii(z*$*Se(F),y*w+z*Te(F))),o+=A?E+$*In:E,A^p>=n^_>=n){var P=Eu(La(h),La(v));Mg(P);var M=Eu(s,P);Mg(M);var S=(A^E>=0?-1:1)*ni(M[2]);(i>S||i===S&&(P[0]||P[1]))&&(a+=A^E>=0?1:-1)}}return(o<-Fe||o0){for(l||(r.polygonStart(),l=!0),r.lineStart(),k=0;k1&&_&2&&x.push(x.pop().concat(x.shift())),c.push(x.filter(TQ))}}return d}}function TQ(e){return e.length>1}function MQ(e,t){return((e=e.x)[0]<0?e[1]-Mt-Fe:Mt-e[1])-((t=t.x)[0]<0?t[1]-Mt-Fe:Mt-t[1])}const VC=GC(function(){return!0},DQ,RQ,[-qe,-Mt]);function DQ(e){var t=NaN,n=NaN,i=NaN,r;return{lineStart:function(){e.lineStart(),r=1},point:function(s,o){var a=s>0?qe:-qe,l=Ye(s-t);Ye(l-qe)0?Mt:-Mt),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(s,n),r=0):i!==a&&l>=qe&&(Ye(t-i)Fe?ku((Se(t)*(s=Te(i))*Se(n)-Se(i)*(r=Te(t))*Se(e))/(r*s*o)):(t+i)/2}function RQ(e,t,n,i){var r;if(e==null)r=n*Mt,i.point(-qe,r),i.point(0,r),i.point(qe,r),i.point(qe,0),i.point(qe,-r),i.point(0,-r),i.point(-qe,-r),i.point(-qe,0),i.point(-qe,r);else if(Ye(e[0]-t[0])>Fe){var s=e[0]0,r=Ye(t)>Fe;function s(c,f,d,h){AQ(h,e,n,d,c,f)}function o(c,f){return Te(c)*Te(f)>t}function a(c){var f,d,h,p,g;return{lineStart:function(){p=h=!1,g=1},point:function(m,y){var b=[m,y],v,_=o(m,y),x=i?_?0:u(m,y):_?u(m+(m<0?qe:-qe),y):0;if(!f&&(p=h=_)&&c.lineStart(),_!==h&&(v=l(f,b),(!v||zg(f,v)||zg(b,v))&&(b[2]=1)),_!==h)g=0,_?(c.lineStart(),v=l(b,f),c.point(v[0],v[1])):(v=l(f,b),c.point(v[0],v[1],2),c.lineEnd()),f=v;else if(r&&f&&i^_){var k;!(x&d)&&(k=l(b,f,!0))&&(g=0,i?(c.lineStart(),c.point(k[0][0],k[0][1]),c.point(k[1][0],k[1][1]),c.lineEnd()):(c.point(k[1][0],k[1][1]),c.lineEnd(),c.lineStart(),c.point(k[0][0],k[0][1],3)))}_&&(!f||!zg(f,b))&&c.point(b[0],b[1]),f=b,h=_,d=x},lineEnd:function(){h&&c.lineEnd(),f=null},clean:function(){return g|(p&&h)<<1}}}function l(c,f,d){var h=La(c),p=La(f),g=[1,0,0],m=Eu(h,p),y=Fg(m,m),b=m[0],v=y-b*b;if(!v)return!d&&c;var _=t*y/v,x=-t*b/v,k=Eu(g,m),w=Tg(g,_),E=Tg(m,x);B3(w,E);var $=k,F=Fg(w,$),A=Fg($,$),z=F*F-A*(Fg(w,w)-1);if(!(z<0)){var P=Pn(z),M=Tg($,(-F-P)/A);if(B3(M,w),M=Ag(M),!d)return M;var S=c[0],D=f[0],B=c[1],V=f[1],H;D0^M[1]<(Ye(M[0]-S)qe^(S<=M[0]&&M[0]<=D)){var Re=Tg($,(-F+P)/A);return B3(Re,w),[M,Ag(Re)]}}}function u(c,f){var d=i?e:qe-e,h=0;return c<-d?h|=1:c>d&&(h|=2),f<-d?h|=4:f>d&&(h|=8),h}return GC(o,a,s,i?[0,-e]:[-qe,e-qe])}function LQ(e,t,n,i,r,s){var o=e[0],a=e[1],l=t[0],u=t[1],c=0,f=1,d=l-o,h=u-a,p;if(p=n-o,!(!d&&p>0)){if(p/=d,d<0){if(p0){if(p>f)return;p>c&&(c=p)}if(p=r-o,!(!d&&p<0)){if(p/=d,d<0){if(p>f)return;p>c&&(c=p)}else if(d>0){if(p0)){if(p/=h,h<0){if(p0){if(p>f)return;p>c&&(c=p)}if(p=s-a,!(!h&&p<0)){if(p/=h,h<0){if(p>f)return;p>c&&(c=p)}else if(h>0){if(p0&&(e[0]=o+c*d,e[1]=a+c*h),f<1&&(t[0]=o+f*d,t[1]=a+f*h),!0}}}}}var If=1e9,jg=-If;function YC(e,t,n,i){function r(u,c){return e<=u&&u<=n&&t<=c&&c<=i}function s(u,c,f,d){var h=0,p=0;if(u==null||(h=o(u,f))!==(p=o(c,f))||l(u,c)<0^f>0)do d.point(h===0||h===3?e:n,h>1?i:t);while((h=(h+f+4)%4)!==p);else d.point(c[0],c[1])}function o(u,c){return Ye(u[0]-e)0?0:3:Ye(u[0]-n)0?2:1:Ye(u[1]-t)0?1:0:c>0?3:2}function a(u,c){return l(u.x,c.x)}function l(u,c){var f=o(u,1),d=o(c,1);return f!==d?f-d:f===0?c[1]-u[1]:f===1?u[0]-c[0]:f===2?u[1]-c[1]:c[0]-u[0]}return function(u){var c=u,f=qC(),d,h,p,g,m,y,b,v,_,x,k,w={point:E,lineStart:z,lineEnd:P,polygonStart:F,polygonEnd:A};function E(S,D){r(S,D)&&c.point(S,D)}function $(){for(var S=0,D=0,B=h.length;Di&&(nt-xe)*(i-Re)>(Ie-Re)*(e-xe)&&++S:Ie<=i&&(nt-xe)*(i-Re)<(Ie-Re)*(e-xe)&&--S;return S}function F(){c=f,d=[],h=[],k=!0}function A(){var S=$(),D=k&&S,B=(d=Ok(d)).length;(D||B)&&(u.polygonStart(),D&&(u.lineStart(),s(null,null,1,u),u.lineEnd()),B&&WC(d,a,S,s,u),u.polygonEnd()),c=u,d=h=p=null}function z(){w.point=M,h&&h.push(p=[]),x=!0,_=!1,b=v=NaN}function P(){d&&(M(g,m),y&&_&&f.rejoin(),d.push(f.result())),w.point=E,_&&c.lineEnd()}function M(S,D){var B=r(S,D);if(h&&p.push([S,D]),x)g=S,m=D,y=B,x=!1,B&&(c.lineStart(),c.point(S,D));else if(B&&_)c.point(S,D);else{var V=[b=Math.max(jg,Math.min(If,b)),v=Math.max(jg,Math.min(If,v))],H=[S=Math.max(jg,Math.min(If,S)),D=Math.max(jg,Math.min(If,D))];LQ(V,H,e,t,n,i)?(_||(c.lineStart(),c.point(V[0],V[1])),c.point(H[0],H[1]),B||c.lineEnd(),k=!1):B&&(c.lineStart(),c.point(S,D),k=!1)}b=S,v=D,_=B}return w}}function XC(e,t,n){var i=hi(e,t-Fe,n).concat(t);return function(r){return i.map(function(s){return[r,s]})}}function ZC(e,t,n){var i=hi(e,t-Fe,n).concat(t);return function(r){return i.map(function(s){return[s,r]})}}function IQ(){var e,t,n,i,r,s,o,a,l=10,u=l,c=90,f=360,d,h,p,g,m=2.5;function y(){return{type:"MultiLineString",coordinates:b()}}function b(){return hi(kg(i/c)*c,n,c).map(p).concat(hi(kg(a/f)*f,o,f).map(g)).concat(hi(kg(t/l)*l,e,l).filter(function(v){return Ye(v%c)>Fe}).map(d)).concat(hi(kg(s/u)*u,r,u).filter(function(v){return Ye(v%f)>Fe}).map(h))}return y.lines=function(){return b().map(function(v){return{type:"LineString",coordinates:v}})},y.outline=function(){return{type:"Polygon",coordinates:[p(i).concat(g(o).slice(1),p(n).reverse().slice(1),g(a).reverse().slice(1))]}},y.extent=function(v){return arguments.length?y.extentMajor(v).extentMinor(v):y.extentMinor()},y.extentMajor=function(v){return arguments.length?(i=+v[0][0],n=+v[1][0],a=+v[0][1],o=+v[1][1],i>n&&(v=i,i=n,n=v),a>o&&(v=a,a=o,o=v),y.precision(m)):[[i,a],[n,o]]},y.extentMinor=function(v){return arguments.length?(t=+v[0][0],e=+v[1][0],s=+v[0][1],r=+v[1][1],t>e&&(v=t,t=e,e=v),s>r&&(v=s,s=r,r=v),y.precision(m)):[[t,s],[e,r]]},y.step=function(v){return arguments.length?y.stepMajor(v).stepMinor(v):y.stepMinor()},y.stepMajor=function(v){return arguments.length?(c=+v[0],f=+v[1],y):[c,f]},y.stepMinor=function(v){return arguments.length?(l=+v[0],u=+v[1],y):[l,u]},y.precision=function(v){return arguments.length?(m=+v,d=XC(s,r,90),h=ZC(t,e,m),p=XC(a,o,90),g=ZC(i,n,m),y):m},y.extentMajor([[-180,-90+Fe],[180,90-Fe]]).extentMinor([[-180,-80-Fe],[180,80+Fe]])}const Pf=e=>e;var X3=new Rn,Z3=new Rn,KC,JC,K3,J3,Ds={point:un,lineStart:un,lineEnd:un,polygonStart:function(){Ds.lineStart=PQ,Ds.lineEnd=BQ},polygonEnd:function(){Ds.lineStart=Ds.lineEnd=Ds.point=un,X3.add(Ye(Z3)),Z3=new Rn},result:function(){var e=X3/2;return X3=new Rn,e}};function PQ(){Ds.point=zQ}function zQ(e,t){Ds.point=QC,KC=K3=e,JC=J3=t}function QC(e,t){Z3.add(J3*e-K3*t),K3=e,J3=t}function BQ(){QC(KC,JC)}var Su=1/0,Ug=Su,zf=-Su,qg=zf,Wg={point:jQ,lineStart:un,lineEnd:un,polygonStart:un,polygonEnd:un,result:function(){var e=[[Su,Ug],[zf,qg]];return zf=qg=-(Ug=Su=1/0),e}};function jQ(e,t){ezf&&(zf=e),tqg&&(qg=t)}var Q3=0,ev=0,Bf=0,Hg=0,Gg=0,Cu=0,tv=0,nv=0,jf=0,eA,tA,Vr,Yr,zi={point:Pa,lineStart:nA,lineEnd:iA,polygonStart:function(){zi.lineStart=WQ,zi.lineEnd=HQ},polygonEnd:function(){zi.point=Pa,zi.lineStart=nA,zi.lineEnd=iA},result:function(){var e=jf?[tv/jf,nv/jf]:Cu?[Hg/Cu,Gg/Cu]:Bf?[Q3/Bf,ev/Bf]:[NaN,NaN];return Q3=ev=Bf=Hg=Gg=Cu=tv=nv=jf=0,e}};function Pa(e,t){Q3+=e,ev+=t,++Bf}function nA(){zi.point=UQ}function UQ(e,t){zi.point=qQ,Pa(Vr=e,Yr=t)}function qQ(e,t){var n=e-Vr,i=t-Yr,r=Pn(n*n+i*i);Hg+=r*(Vr+e)/2,Gg+=r*(Yr+t)/2,Cu+=r,Pa(Vr=e,Yr=t)}function iA(){zi.point=Pa}function WQ(){zi.point=GQ}function HQ(){rA(eA,tA)}function GQ(e,t){zi.point=rA,Pa(eA=Vr=e,tA=Yr=t)}function rA(e,t){var n=e-Vr,i=t-Yr,r=Pn(n*n+i*i);Hg+=r*(Vr+e)/2,Gg+=r*(Yr+t)/2,Cu+=r,r=Yr*e-Vr*t,tv+=r*(Vr+e),nv+=r*(Yr+t),jf+=r*3,Pa(Vr=e,Yr=t)}function sA(e){this._context=e}sA.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,In);break}}},result:un};var iv=new Rn,rv,oA,aA,Uf,qf,Wf={point:un,lineStart:function(){Wf.point=VQ},lineEnd:function(){rv&&lA(oA,aA),Wf.point=un},polygonStart:function(){rv=!0},polygonEnd:function(){rv=null},result:function(){var e=+iv;return iv=new Rn,e}};function VQ(e,t){Wf.point=lA,oA=Uf=e,aA=qf=t}function lA(e,t){Uf-=e,qf-=t,iv.add(Pn(Uf*Uf+qf*qf)),Uf=e,qf=t}let uA,Vg,cA,fA;class dA{constructor(t){this._append=t==null?hA:YQ(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==cA||this._append!==Vg){const i=this._radius,r=this._;this._="",this._append`m0,${i}a${i},${i} 0 1,1 0,${-2*i}a${i},${i} 0 1,1 0,${2*i}z`,cA=i,Vg=this._append,fA=this._,this._=r}this._+=fA;break}}}result(){const t=this._;return this._="",t.length?t:null}}function hA(e){let t=1;this._+=e[0];for(const n=e.length;t=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return hA;if(t!==uA){const n=10**t;uA=t,Vg=function(r){let s=1;this._+=r[0];for(const o=r.length;s=0))throw new RangeError(`invalid digits: ${a}`);n=l}return t===null&&(s=new dA(n)),o},o.projection(e).digits(n).context(t)}function Yg(e){return function(t){var n=new sv;for(var i in e)n[i]=e[i];return n.stream=t,n}}function sv(){}sv.prototype={constructor:sv,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function ov(e,t,n){var i=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),i!=null&&e.clipExtent(null),Fs(n,e.stream(Wg)),t(Wg.result()),i!=null&&e.clipExtent(i),e}function Xg(e,t,n){return ov(e,function(i){var r=t[1][0]-t[0][0],s=t[1][1]-t[0][1],o=Math.min(r/(i[1][0]-i[0][0]),s/(i[1][1]-i[0][1])),a=+t[0][0]+(r-o*(i[1][0]+i[0][0]))/2,l=+t[0][1]+(s-o*(i[1][1]+i[0][1]))/2;e.scale(150*o).translate([a,l])},n)}function av(e,t,n){return Xg(e,[[0,0],t],n)}function lv(e,t,n){return ov(e,function(i){var r=+t,s=r/(i[1][0]-i[0][0]),o=(r-s*(i[1][0]+i[0][0]))/2,a=-s*i[0][1];e.scale(150*s).translate([o,a])},n)}function uv(e,t,n){return ov(e,function(i){var r=+t,s=r/(i[1][1]-i[0][1]),o=-s*i[0][0],a=(r-s*(i[1][1]+i[0][1]))/2;e.scale(150*s).translate([o,a])},n)}var gA=16,XQ=Te(30*Ue);function mA(e,t){return+t?KQ(e,t):ZQ(e)}function ZQ(e){return Yg({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function KQ(e,t){function n(i,r,s,o,a,l,u,c,f,d,h,p,g,m){var y=u-i,b=c-r,v=y*y+b*b;if(v>4*t&&g--){var _=o+d,x=a+h,k=l+p,w=Pn(_*_+x*x+k*k),E=ni(k/=w),$=Ye(Ye(k)-1)t||Ye((y*P+b*M)/v-.5)>.3||o*d+a*h+l*p2?S[2]%360*Ue:0,P()):[a*Rt,l*Rt,u*Rt]},A.angle=function(S){return arguments.length?(f=S%360*Ue,P()):f*Rt},A.reflectX=function(S){return arguments.length?(d=S?-1:1,P()):d<0},A.reflectY=function(S){return arguments.length?(h=S?-1:1,P()):h<0},A.precision=function(S){return arguments.length?(k=mA(w,x=S*S),M()):Pn(x)},A.fitExtent=function(S,D){return Xg(A,S,D)},A.fitSize=function(S,D){return av(A,S,D)},A.fitWidth=function(S,D){return lv(A,S,D)},A.fitHeight=function(S,D){return uv(A,S,D)};function P(){var S=yA(n,0,0,d,h,f).apply(null,t(s,o)),D=yA(n,i-S[0],r-S[1],d,h,f);return c=PC(a,l,u),w=G3(t,D),E=G3(c,w),k=mA(w,x),M()}function M(){return $=F=null,A}return function(){return t=e.apply(this,arguments),A.invert=t.invert&&z,P()}}function cv(e){var t=0,n=qe/3,i=bA(e),r=i(t,n);return r.parallels=function(s){return arguments.length?i(t=s[0]*Ue,n=s[1]*Ue):[t*Rt,n*Rt]},r}function tee(e){var t=Te(e);function n(i,r){return[i*t,Se(r)/t]}return n.invert=function(i,r){return[i/t,ni(r*t)]},n}function nee(e,t){var n=Se(e),i=(n+Se(t))/2;if(Ye(i)=.12&&m<.234&&g>=-.425&&g<-.214?r:m>=.166&&m<.234&&g>=-.214&&g<-.115?o:n).invert(d)},c.stream=function(d){return e&&t===d?e:e=iee([n.stream(t=d),r.stream(d),o.stream(d)])},c.precision=function(d){return arguments.length?(n.precision(d),r.precision(d),o.precision(d),f()):n.precision()},c.scale=function(d){return arguments.length?(n.scale(d),r.scale(d*.35),o.scale(d),c.translate(n.translate())):n.scale()},c.translate=function(d){if(!arguments.length)return n.translate();var h=n.scale(),p=+d[0],g=+d[1];return i=n.translate(d).clipExtent([[p-.455*h,g-.238*h],[p+.455*h,g+.238*h]]).stream(u),s=r.translate([p-.307*h,g+.201*h]).clipExtent([[p-.425*h+Fe,g+.12*h+Fe],[p-.214*h-Fe,g+.234*h-Fe]]).stream(u),a=o.translate([p-.205*h,g+.212*h]).clipExtent([[p-.214*h+Fe,g+.166*h+Fe],[p-.115*h-Fe,g+.234*h-Fe]]).stream(u),f()},c.fitExtent=function(d,h){return Xg(c,d,h)},c.fitSize=function(d,h){return av(c,d,h)},c.fitWidth=function(d,h){return lv(c,d,h)},c.fitHeight=function(d,h){return uv(c,d,h)};function f(){return e=t=null,c}return c.scale(1070)}function _A(e){return function(t,n){var i=Te(t),r=Te(n),s=e(i*r);return s===1/0?[2,0]:[s*r*Se(t),s*Se(n)]}}function Hf(e){return function(t,n){var i=Pn(t*t+n*n),r=e(i),s=Se(r),o=Te(r);return[Ii(t*s,i*o),ni(i&&n*s/i)]}}var xA=_A(function(e){return Pn(2/(1+e))});xA.invert=Hf(function(e){return 2*ni(e/2)});function see(){return Xr(xA).scale(124.75).clipAngle(180-.001)}var wA=_A(function(e){return(e=vC(e))&&e/Se(e)});wA.invert=Hf(function(e){return e});function oee(){return Xr(wA).scale(79.4188).clipAngle(180-.001)}function Kg(e,t){return[e,Eg(O3((Mt+t)/2))]}Kg.invert=function(e,t){return[e,2*ku(bC(t))-Mt]};function aee(){return kA(Kg).scale(961/In)}function kA(e){var t=Xr(e),n=t.center,i=t.scale,r=t.translate,s=t.clipExtent,o=null,a,l,u;t.scale=function(f){return arguments.length?(i(f),c()):i()},t.translate=function(f){return arguments.length?(r(f),c()):r()},t.center=function(f){return arguments.length?(n(f),c()):n()},t.clipExtent=function(f){return arguments.length?(f==null?o=a=l=u=null:(o=+f[0][0],a=+f[0][1],l=+f[1][0],u=+f[1][1]),c()):o==null?null:[[o,a],[l,u]]};function c(){var f=qe*i(),d=t(CQ(t.rotate()).invert([0,0]));return s(o==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===Kg?[[Math.max(d[0]-f,o),a],[Math.min(d[0]+f,l),u]]:[[o,Math.max(d[1]-f,a)],[l,Math.min(d[1]+f,u)]])}return c()}function Jg(e){return O3((Mt+e)/2)}function lee(e,t){var n=Te(e),i=e===t?Se(e):Eg(n/Te(t))/Eg(Jg(t)/Jg(e)),r=n*R3(Jg(e),i)/i;if(!i)return Kg;function s(o,a){r>0?a<-Mt+Fe&&(a=-Mt+Fe):a>Mt-Fe&&(a=Mt-Fe);var l=r/R3(Jg(a),i);return[l*Se(i*o),r-l*Te(i*o)]}return s.invert=function(o,a){var l=r-a,u=Pi(i)*Pn(o*o+l*l),c=Ii(o,Ye(l))*Pi(l);return l*i<0&&(c-=qe*Pi(o)*Pi(l)),[c/i,2*ku(R3(r/u,1/i))-Mt]},s}function uee(){return cv(lee).scale(109.5).parallels([30,30])}function Qg(e,t){return[e,t]}Qg.invert=Qg;function cee(){return Xr(Qg).scale(152.63)}function fee(e,t){var n=Te(e),i=e===t?Se(e):(n-Te(t))/(t-e),r=n/i+e;if(Ye(i)Fe&&--i>0);return[e/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function yee(){return Xr(SA).scale(175.295)}function CA(e,t){return[Te(t)*Se(e),Se(t)]}CA.invert=Hf(ni);function bee(){return Xr(CA).scale(249.5).clipAngle(90+Fe)}function AA(e,t){var n=Te(t),i=1+Te(e)*n;return[n*Se(e)/i,Se(t)/i]}AA.invert=Hf(function(e){return 2*ku(e)});function vee(){return Xr(AA).scale(250).clipAngle(142)}function FA(e,t){return[Eg(O3((Mt+t)/2)),-e]}FA.invert=function(e,t){return[-t,2*ku(bC(e))-Mt]};function _ee(){var e=kA(FA),t=e.center,n=e.rotate;return e.center=function(i){return arguments.length?t([-i[1],i[0]]):(i=t(),[i[1],-i[0]])},e.rotate=function(i){return arguments.length?n([i[0],i[1],i.length>2?i[2]+90:90]):(i=n(),[i[0],i[1],i[2]-90])},n([0,0,90]).scale(159.155)}var xee=Math.abs,fv=Math.cos,t0=Math.sin,wee=1e-6,TA=Math.PI,dv=TA/2,MA=kee(2);function DA(e){return e>1?dv:e<-1?-dv:Math.asin(e)}function kee(e){return e>0?Math.sqrt(e):0}function Eee(e,t){var n=e*t0(t),i=30,r;do t-=r=(t+t0(t)-n)/(1+fv(t));while(xee(r)>wee&&--i>0);return t/2}function $ee(e,t,n){function i(r,s){return[e*r*fv(s=Eee(n,s)),t*t0(s)]}return i.invert=function(r,s){return s=DA(s/t),[r/(e*fv(s)),DA((2*s+t0(2*s))/n)]},i}var See=$ee(MA/dv,MA,TA);function Cee(){return Xr(See).scale(169.529)}const Aee=pA(),hv=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function Fee(e,t){return function n(){const i=t();return i.type=e,i.path=pA().projection(i),i.copy=i.copy||function(){const r=n();return hv.forEach(s=>{i[s]&&r[s](i[s]())}),r.path.pointRadius(i.path.pointRadius()),r},OE(i)}}function pv(e,t){if(!e||typeof e!="string")throw new Error("Projection type must be a name string.");return e=e.toLowerCase(),arguments.length>1?(n0[e]=Fee(e,t),this):n0[e]||null}function NA(e){return e&&e.path||Aee}const n0={albers:vA,albersusa:ree,azimuthalequalarea:see,azimuthalequidistant:oee,conicconformal:uee,conicequalarea:Zg,conicequidistant:dee,equalEarth:pee,equirectangular:cee,gnomonic:gee,identity:mee,mercator:aee,mollweide:Cee,naturalEarth1:yee,orthographic:bee,stereographic:vee,transversemercator:_ee};for(const e in n0)pv(e,n0[e]);function Tee(){}const Ns=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function RA(){var e=1,t=1,n=a;function i(l,u){return u.map(c=>r(l,c))}function r(l,u){var c=[],f=[];return s(l,u,d=>{n(d,l,u),Mee(d)>0?c.push([d]):f.push(d)}),f.forEach(d=>{for(var h=0,p=c.length,g;h=u,Ns[m<<1].forEach(v);++h=u,Ns[g|m<<1].forEach(v);for(Ns[m<<0].forEach(v);++p=u,y=l[p*e]>=u,Ns[m<<1|y<<2].forEach(v);++h=u,b=y,y=l[p*e+h+1]>=u,Ns[g|m<<1|y<<2|b<<3].forEach(v);Ns[m|y<<3].forEach(v)}for(h=-1,y=l[p*e]>=u,Ns[y<<2].forEach(v);++h=u,Ns[y<<2|b<<3].forEach(v);Ns[y<<3].forEach(v);function v(_){var x=[_[0][0]+h,_[0][1]+p],k=[_[1][0]+h,_[1][1]+p],w=o(x),E=o(k),$,F;($=d[w])?(F=f[E])?(delete d[$.end],delete f[F.start],$===F?($.ring.push(k),c($.ring)):f[$.start]=d[F.end]={start:$.start,end:F.end,ring:$.ring.concat(F.ring)}):(delete d[$.end],$.ring.push(k),d[$.end=E]=$):($=f[E])?(F=d[w])?(delete f[$.start],delete d[F.end],$===F?($.ring.push(k),c($.ring)):f[F.start]=d[$.end]={start:F.start,end:$.end,ring:F.ring.concat($.ring)}):(delete f[$.start],$.ring.unshift(x),f[$.start=w]=$):f[w]=d[E]={start:w,end:E,ring:[x,k]}}}function o(l){return l[0]*2+l[1]*(e+1)*4}function a(l,u,c){l.forEach(f=>{var d=f[0],h=f[1],p=d|0,g=h|0,m,y=u[g*e+p];d>0&&d0&&h=0&&c>=0||q("invalid size"),e=u,t=c,i},i.smooth=function(l){return arguments.length?(n=l?a:Tee,i):n===a},i}function Mee(e){for(var t=0,n=e.length,i=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++ti!=h>i&&n<(d-u)*(i-c)/(h-c)+u&&(r=-r)}return r}function Ree(e,t,n){var i;return Oee(e,t,n)&&Lee(e[i=+(e[0]===t[0])],n[i],t[i])}function Oee(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function Lee(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function OA(e,t,n){return function(i){var r=Dr(i),s=n?Math.min(r[0],0):r[0],o=r[1],a=o-s,l=t?fo(s,o,e):a/(e+1);return hi(s+l,o,l)}}function gv(e){j.call(this,null,e)}gv.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},te(gv,j,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=e.field||vn,s=RA().smooth(e.smooth!==!1),o=e.thresholds||Iee(i,r,e),a=e.as===null?null:e.as||"contour",l=[];return i.forEach(u=>{const c=r(u),f=s.size([c.width,c.height])(c.values,G(o)?o:o(c.values));Pee(f,c,u,e),f.forEach(d=>{l.push(Xh(u,tt(a!=null?{[a]:d}:d)))})}),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function Iee(e,t,n){const i=OA(n.levels||10,n.nice,n.zero!==!1);return n.resolve!=="shared"?i:i(e.map(r=>ha(t(r).values)))}function Pee(e,t,n,i){let r=i.scale||t.scale,s=i.translate||t.translate;if(ze(r)&&(r=r(n,i)),ze(s)&&(s=s(n,i)),(r===1||r==null)&&!s)return;const o=(Ke(r)?r:r[0])||1,a=(Ke(r)?r:r[1])||1,l=s&&s[0]||0,u=s&&s[1]||0;e.forEach(LA(t,o,a,l,u))}function LA(e,t,n,i,r){const s=e.x1||0,o=e.y1||0,a=t*n<0;function l(f){f.forEach(u)}function u(f){a&&f.reverse(),f.forEach(c)}function c(f){f[0]=(f[0]-s)*t+i,f[1]=(f[1]-o)*n+r}return function(f){return f.coordinates.forEach(l),f}}function IA(e,t,n){const i=e>=0?e:W2(t,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function mv(e){return ze(e)?e:xn(+e)}function PA(){var e=l=>l[0],t=l=>l[1],n=Pl,i=[-1,-1],r=960,s=500,o=2;function a(l,u){const c=IA(i[0],l,e)>>o,f=IA(i[1],l,t)>>o,d=c?c+2:0,h=f?f+2:0,p=2*d+(r>>o),g=2*h+(s>>o),m=new Float32Array(p*g),y=new Float32Array(p*g);let b=m;l.forEach(_=>{const x=d+(+e(_)>>o),k=h+(+t(_)>>o);x>=0&&x=0&&k0&&f>0?(Au(p,g,m,y,c),Fu(p,g,y,m,f),Au(p,g,m,y,c),Fu(p,g,y,m,f),Au(p,g,m,y,c),Fu(p,g,y,m,f)):c>0?(Au(p,g,m,y,c),Au(p,g,y,m,c),Au(p,g,m,y,c),b=y):f>0&&(Fu(p,g,m,y,f),Fu(p,g,y,m,f),Fu(p,g,m,y,f),b=y);const v=u?Math.pow(2,-2*o):1/Lk(b);for(let _=0,x=p*g;_>o),y2:h+(s>>o)}}return a.x=function(l){return arguments.length?(e=mv(l),a):e},a.y=function(l){return arguments.length?(t=mv(l),a):t},a.weight=function(l){return arguments.length?(n=mv(l),a):n},a.size=function(l){if(!arguments.length)return[r,s];var u=+l[0],c=+l[1];return u>=0&&c>=0||q("invalid size"),r=u,s=c,a},a.cellSize=function(l){return arguments.length?((l=+l)>=1||q("invalid cell size"),o=Math.floor(Math.log(l)/Math.LN2),a):1<=r&&(a>=s&&(l-=n[a-s+o*e]),i[a-r+o*e]=l/Math.min(a+1,e-1+s-a,s))}function Fu(e,t,n,i,r){const s=(r<<1)+1;for(let o=0;o=r&&(a>=s&&(l-=n[o+(a-s)*e]),i[o+(a-r)*e]=l/Math.min(a+1,t-1+s-a,s))}function yv(e){j.call(this,null,e)}yv.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const zee=["x","y","weight","size","cellSize","bandwidth"];function zA(e,t){return zee.forEach(n=>t[n]!=null?e[n](t[n]):0),e}te(yv,j,{transform(e,t){if(this.value&&!t.changed()&&!e.modified())return t.StopPropagation;var n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=t.materialize(t.SOURCE).source,r=Bee(i,e.groupby),s=(e.groupby||[]).map(Tt),o=zA(PA(),e),a=e.as||"grid",l=[];function u(c,f){for(let d=0;dtt(u({[a]:o(c,e.counts)},c.dims))),this.value&&(n.rem=this.value),this.value=n.source=n.add=l,n}});function Bee(e,t){var n=[],i=c=>c(a),r,s,o,a,l,u;if(t==null)n.push(e);else for(r={},s=0,o=e.length;sn.push(a(c))),s&&o&&(t.visit(l,c=>{var f=s(c),d=o(c);f!=null&&d!=null&&(f=+f)===f&&(d=+d)===d&&i.push([f,d])}),n=n.concat({type:vv,geometry:{type:jee,coordinates:i}})),this.value={type:_v,features:n}}});function wv(e){j.call(this,null,e)}wv.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},te(wv,j,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.field||vn,s=e.as||"path",o=n.SOURCE;!i||e.modified()?(this.value=i=NA(e.projection),n.materialize().reflow()):o=r===vn||t.modified(r.fields)?n.ADD_MOD:n.ADD;const a=Uee(i,e.pointRadius);return n.visit(o,l=>l[s]=i(r(l))),i.pointRadius(a),n.modifies(s)}});function Uee(e,t){const n=e.pointRadius();return e.context(null),t!=null&&e.pointRadius(t),n}function kv(e){j.call(this,null,e)}kv.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},te(kv,j,{transform(e,t){var n=e.projection,i=e.fields[0],r=e.fields[1],s=e.as||["x","y"],o=s[0],a=s[1],l;function u(c){const f=n([i(c),r(c)]);f?(c[o]=f[0],c[a]=f[1]):(c[o]=void 0,c[a]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,u):(l=t.modified(i.fields)||t.modified(r.fields),t.visit(l?t.ADD_MOD:t.ADD,u)),t.modifies(s)}});function Ev(e){j.call(this,null,e)}Ev.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},te(Ev,j,{transform(e,t){var n=t.fork(t.ALL),i=this.value,r=e.as||"shape",s=n.ADD;return(!i||e.modified())&&(this.value=i=qee(NA(e.projection),e.field||Fi("datum"),e.pointRadius),n.materialize().reflow(),s=n.SOURCE),n.visit(s,o=>o[r]=i),n.modifies(r)}});function qee(e,t,n){const i=n==null?r=>e(t(r)):r=>{var s=e.pointRadius(),o=e.pointRadius(n)(t(r));return e.pointRadius(s),o};return i.context=r=>(e.context(r),i),i}function $v(e){j.call(this,[],e),this.generator=IQ()}$v.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},te($v,j,{transform(e,t){var n=this.value,i=this.generator,r;if(!n.length||e.modified())for(const s in e)ze(i[s])&&i[s](e[s]);return r=i(),n.length?t.mod.push(J4(n[0],r)):t.add.push(tt(r)),n[0]=r,t}});function Sv(e){j.call(this,null,e)}Sv.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},te(Sv,j,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,i=e.resolve==="shared",r=e.field||vn,s=Hee(e.opacity,e),o=Wee(e.color,e),a=e.as||"image",l={$x:0,$y:0,$value:0,$max:i?ha(n.map(u=>ha(r(u).values))):0};return n.forEach(u=>{const c=r(u),f=Be({},u,l);i||(f.$max=ha(c.values||[])),u[a]=Gee(c,f,o.dep?o:xn(o(f)),s.dep?s:xn(s(f)))}),t.reflow(!0).modifies(a)}});function Wee(e,t){let n;return ze(e)?(n=i=>ko(e(i,t)),n.dep=BA(e)):n=xn(ko(e||"#888")),n}function Hee(e,t){let n;return ze(e)?(n=i=>e(i,t),n.dep=BA(e)):e?n=xn(e):(n=i=>i.$value/i.$max||0,n.dep=!0),n}function BA(e){if(!ze(e))return!1;const t=er(bn(e));return t.$x||t.$y||t.$value||t.$max}function Gee(e,t,n,i){const r=e.width,s=e.height,o=e.x1||0,a=e.y1||0,l=e.x2||r,u=e.y2||s,c=e.values,f=c?m=>c[m]:so,d=_o(l-o,u-a),h=d.getContext("2d"),p=h.getImageData(0,0,l-o,u-a),g=p.data;for(let m=a,y=0;m{e[i]!=null&&UA(n,i,e[i])})):hv.forEach(i=>{e.modified(i)&&UA(n,i,e[i])}),e.pointRadius!=null&&n.path.pointRadius(e.pointRadius),e.fit&&Vee(n,e),t.fork(t.NO_SOURCE|t.NO_FIELDS)}});function Vee(e,t){const n=Xee(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}function Yee(e){const t=pv((e||"mercator").toLowerCase());return t||q("Unrecognized projection type: "+e),t()}function UA(e,t,n){ze(e[t])&&e[t](n)}function Xee(e){return e=se(e),e.length===1?e[0]:{type:_v,features:e.reduce((t,n)=>t.concat(Zee(n)),[])}}function Zee(e){return e.type===_v?e.features:se(e).filter(t=>t!=null).map(t=>t.type===vv?t:{type:vv,geometry:t})}const Kee=Object.freeze(Object.defineProperty({__proto__:null,contour:bv,geojson:xv,geopath:wv,geopoint:kv,geoshape:Ev,graticule:$v,heatmap:Sv,isocontour:gv,kde2d:yv,projection:jA},Symbol.toStringTag,{value:"Module"}));function Jee(e,t){var n,i=1;e==null&&(e=0),t==null&&(t=0);function r(){var s,o=n.length,a,l=0,u=0;for(s=0;s=(f=(a+u)/2))?a=f:u=f,(m=n>=(d=(l+c)/2))?l=d:c=d,r=s,!(s=s[y=m<<1|g]))return r[y]=o,e;if(h=+e._x.call(null,s.data),p=+e._y.call(null,s.data),t===h&&n===p)return o.next=s,r?r[y]=o:e._root=o,e;do r=r?r[y]=new Array(4):e._root=new Array(4),(g=t>=(f=(a+u)/2))?a=f:u=f,(m=n>=(d=(l+c)/2))?l=d:c=d;while((y=m<<1|g)===(b=(p>=d)<<1|h>=f));return r[b]=s,r[y]=o,e}function ete(e){var t,n,i=e.length,r,s,o=new Array(i),a=new Array(i),l=1/0,u=1/0,c=-1/0,f=-1/0;for(n=0;nc&&(c=r),sf&&(f=s));if(l>c||u>f)return this;for(this.cover(l,u).cover(c,f),n=0;ne||e>=r||i>t||t>=s;)switch(u=(tc||(a=p.y0)>f||(l=p.x1)=y)<<1|e>=m)&&(p=d[d.length-1],d[d.length-1]=d[d.length-1-g],d[d.length-1-g]=p)}else{var b=e-+this._x.call(null,h.data),v=t-+this._y.call(null,h.data),_=b*b+v*v;if(_=(d=(o+l)/2))?o=d:l=d,(g=f>=(h=(a+u)/2))?a=h:u=h,t=n,!(n=n[m=g<<1|p]))return this;if(!n.length)break;(t[m+1&3]||t[m+2&3]||t[m+3&3])&&(i=t,y=m)}for(;n.data!==e;)if(r=n,!(n=n.next))return this;return(s=n.next)&&delete n.next,r?(s?r.next=s:delete r.next,this):t?(s?t[m]=s:delete t[m],(n=t[0]||t[1]||t[2]||t[3])&&n===(t[3]||t[2]||t[1]||t[0])&&!n.length&&(i?i[y]=n:this._root=n),this):(this._root=s,this)}function ote(e){for(var t=0,n=e.length;td.index){var A=h-E.x-E.vx,z=p-E.y-E.vy,P=A*A+z*z;Ph+F||kp+F||wu.r&&(u.r=u[c].r)}function l(){if(t){var u,c=t.length,f;for(n=new Array(c),u=0;u[t(x,k,o),x])),_;for(m=0,a=new Array(y);m{}};function GA(){for(var e=0,t=arguments.length,n={},i;e=0&&(i=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}i0.prototype=GA.prototype={constructor:i0,on:function(e,t){var n=this._,i=xte(e+"",n),r,s=-1,o=i.length;if(arguments.length<2){for(;++s0)for(var n=new Array(r),i=0,r,s;i=0&&e._call.call(void 0,t),e=e._next;--Tu}function KA(){za=(s0=Qf.now())+o0,Tu=Zf=0;try{Ete()}finally{Tu=0,Ste(),za=0}}function $te(){var e=Qf.now(),t=e-s0;t>YA&&(o0-=t,s0=e)}function Ste(){for(var e,t=r0,n,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:r0=n);Jf=e,Tv(i)}function Tv(e){if(!Tu){Zf&&(Zf=clearTimeout(Zf));var t=e-za;t>24?(e<1/0&&(Zf=setTimeout(KA,e-Qf.now()-o0)),Kf&&(Kf=clearInterval(Kf))):(Kf||(s0=Qf.now(),Kf=setInterval($te,YA)),Tu=1,XA(KA))}}function Cte(e,t,n){var i=new a0,r=t;return t==null?(i.restart(e,t,n),i):(i._restart=i.restart,i.restart=function(s,o,a){o=+o,a=a==null?Fv():+a,i._restart(function l(u){u+=r,i._restart(l,r+=o,a),s(u)},o,a)},i.restart(e,t,n),i)}const Ate=1664525,Fte=1013904223,JA=4294967296;function Tte(){let e=1;return()=>(e=(Ate*e+Fte)%JA)/JA}function Mte(e){return e.x}function Dte(e){return e.y}var Nte=10,Rte=Math.PI*(3-Math.sqrt(5));function Ote(e){var t,n=1,i=.001,r=1-Math.pow(i,1/300),s=0,o=.6,a=new Map,l=ZA(f),u=GA("tick","end"),c=Tte();e==null&&(e=[]);function f(){d(),u.call("tick",t),n1?(m==null?a.delete(g):a.set(g,p(m)),t):a.get(g)},find:function(g,m,y){var b=0,v=e.length,_,x,k,w,E;for(y==null?y=1/0:y*=y,b=0;b1?(u.on(g,m),t):u.on(g)}}}function Lte(){var e,t,n,i,r=Wn(-30),s,o=1,a=1/0,l=.81;function u(h){var p,g=e.length,m=Cv(e,Mte,Dte).visitAfter(f);for(i=h,p=0;p=a)return;(h.data!==t||h.next)&&(y===0&&(y=zo(n),_+=y*y),b===0&&(b=zo(n),_+=b*b),_=0;)n.tick();else if(n.stopped()&&n.restart(),!i)return t.StopPropagation}return this.finish(e,t)},finish(e,t){const n=t.dataflow;for(let a=this._argops,l=0,u=a.length,c;le.touch(t).run()}function jte(e,t){const n=Ote(e),i=n.stop,r=n.restart;let s=!1;return n.stopped=()=>s,n.restart=()=>(s=!1,r()),n.stop=()=>(s=!0,i()),tF(n,t,!0).on("end",()=>s=!0)}function tF(e,t,n,i){var r=se(t.forces),s,o,a,l;for(s=0,o=Mv.length;st(i,n):t)}const Hte=Object.freeze(Object.defineProperty({__proto__:null,force:Dv},Symbol.toStringTag,{value:"Module"}));function Gte(e,t){return e.parent===t.parent?1:2}function Vte(e){return e.reduce(Yte,0)/e.length}function Yte(e,t){return e+t.x}function Xte(e){return 1+e.reduce(Zte,0)}function Zte(e,t){return Math.max(e,t.y)}function Kte(e){for(var t;t=e.children;)e=t[0];return e}function Jte(e){for(var t;t=e.children;)e=t[t.length-1];return e}function Qte(){var e=Gte,t=1,n=1,i=!1;function r(s){var o,a=0;s.eachAfter(function(d){var h=d.children;h?(d.x=Vte(h),d.y=Xte(h)):(d.x=o?a+=e(d,o):0,d.y=0,o=d)});var l=Kte(s),u=Jte(s),c=l.x-e(l,u)/2,f=u.x+e(u,l)/2;return s.eachAfter(i?function(d){d.x=(d.x-s.x)*t,d.y=(s.y-d.y)*n}:function(d){d.x=(d.x-c)/(f-c)*t,d.y=(1-(s.y?d.y/s.y:1))*n})}return r.separation=function(s){return arguments.length?(e=s,r):e},r.size=function(s){return arguments.length?(i=!1,t=+s[0],n=+s[1],r):i?null:[t,n]},r.nodeSize=function(s){return arguments.length?(i=!0,t=+s[0],n=+s[1],r):i?[t,n]:null},r}function ene(e){var t=0,n=e.children,i=n&&n.length;if(!i)t=1;else for(;--i>=0;)t+=n[i].value;e.value=t}function tne(){return this.eachAfter(ene)}function nne(e,t){let n=-1;for(const i of this)e.call(t,i,++n,this);return this}function ine(e,t){for(var n=this,i=[n],r,s,o=-1;n=i.pop();)if(e.call(t,n,++o,this),r=n.children)for(s=r.length-1;s>=0;--s)i.push(r[s]);return this}function rne(e,t){for(var n=this,i=[n],r=[],s,o,a,l=-1;n=i.pop();)if(r.push(n),s=n.children)for(o=0,a=s.length;o=0;)n+=i[r].value;t.value=n})}function ane(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function lne(e){for(var t=this,n=une(t,e),i=[t];t!==n;)t=t.parent,i.push(t);for(var r=i.length;e!==n;)i.splice(r,0,e),e=e.parent;return i}function une(e,t){if(e===t)return e;var n=e.ancestors(),i=t.ancestors(),r=null;for(e=n.pop(),t=i.pop();e===t;)r=e,e=n.pop(),t=i.pop();return r}function cne(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function fne(){return Array.from(this)}function dne(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function hne(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*pne(){var e=this,t,n=[e],i,r,s;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,i=e.children)for(r=0,s=i.length;r=0;--a)r.push(s=o[a]=new Mu(o[a])),s.parent=i,s.depth=i.depth+1;return n.eachBefore(nF)}function gne(){return Nv(this).eachBefore(bne)}function mne(e){return e.children}function yne(e){return Array.isArray(e)?e[1]:null}function bne(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function nF(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Mu(e){this.data=e,this.depth=this.height=0,this.parent=null}Mu.prototype=Nv.prototype={constructor:Mu,count:tne,each:nne,eachAfter:rne,eachBefore:ine,find:sne,sum:one,sort:ane,path:lne,ancestors:cne,descendants:fne,leaves:dne,links:hne,copy:gne,[Symbol.iterator]:pne};function l0(e){return e==null?null:iF(e)}function iF(e){if(typeof e!="function")throw new Error;return e}function Ba(){return 0}function Du(e){return function(){return e}}const vne=1664525,_ne=1013904223,rF=4294967296;function xne(){let e=1;return()=>(e=(vne*e+_ne)%rF)/rF}function wne(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function kne(e,t){let n=e.length,i,r;for(;n;)r=t()*n--|0,i=e[n],e[n]=e[r],e[r]=i;return e}function Ene(e,t){for(var n=0,i=(e=kne(Array.from(e),t)).length,r=[],s,o;n0&&n*n>i*i+r*r}function Rv(e,t){for(var n=0;n1e-6?(A+Math.sqrt(A*A-4*F*z))/(2*F):z/A);return{x:i+k+w*P,y:r+E+$*P,r:P}}function aF(e,t,n){var i=e.x-t.x,r,s,o=e.y-t.y,a,l,u=i*i+o*o;u?(s=t.r+n.r,s*=s,l=e.r+n.r,l*=l,s>l?(r=(u+l-s)/(2*u),a=Math.sqrt(Math.max(0,l/u-r*r)),n.x=e.x-r*i-a*o,n.y=e.y-r*o+a*i):(r=(u+s-l)/(2*u),a=Math.sqrt(Math.max(0,s/u-r*r)),n.x=t.x+r*i-a*o,n.y=t.y+r*o+a*i)):(n.x=t.x+n.r,n.y=t.y)}function lF(e,t){var n=e.r+t.r-1e-6,i=t.x-e.x,r=t.y-e.y;return n>0&&n*n>i*i+r*r}function uF(e){var t=e._,n=e.next._,i=t.r+n.r,r=(t.x*n.r+n.x*t.r)/i,s=(t.y*n.r+n.y*t.r)/i;return r*r+s*s}function c0(e){this._=e,this.next=null,this.previous=null}function Ane(e,t){if(!(s=(e=wne(e)).length))return 0;var n,i,r,s,o,a,l,u,c,f,d;if(n=e[0],n.x=0,n.y=0,!(s>1))return n.r;if(i=e[1],n.x=-i.r,i.x=n.r,i.y=0,!(s>2))return n.r+i.r;aF(i,n,r=e[2]),n=new c0(n),i=new c0(i),r=new c0(r),n.next=r.previous=i,i.next=n.previous=r,r.next=i.previous=n;e:for(l=3;lOne(n(_,x,r))),b=y.map(gF),v=new Set(y).add("");for(const _ of b)v.has(_)||(v.add(_),y.push(_),b.push(gF(_)),s.push(Lv));o=(_,x)=>y[x],a=(_,x)=>b[x]}for(c=0,l=s.length;c=0&&(h=s[y],h.data===Lv);--y)h.data=null}if(f.parent=Dne,f.eachBefore(function(y){y.depth=y.parent.depth+1,--l}).eachBefore(nF),f.parent=null,l>0)throw new Error("cycle");return f}return i.id=function(r){return arguments.length?(e=l0(r),i):e},i.parentId=function(r){return arguments.length?(t=l0(r),i):t},i.path=function(r){return arguments.length?(n=l0(r),i):n},i}function One(e){e=`${e}`;let t=e.length;return Iv(e,t-1)&&!Iv(e,t-2)&&(e=e.slice(0,-1)),e[0]==="/"?e:`/${e}`}function gF(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Iv(e,t););return e.slice(0,t)}function Iv(e,t){if(e[t]==="/"){let n=0;for(;t>0&&e[--t]==="\\";)++n;if(!(n&1))return!0}return!1}function Lne(e,t){return e.parent===t.parent?1:2}function Pv(e){var t=e.children;return t?t[0]:e.t}function zv(e){var t=e.children;return t?t[t.length-1]:e.t}function Ine(e,t,n){var i=n/(t.i-e.i);t.c-=i,t.s+=n,e.c+=i,t.z+=n,t.m+=n}function Pne(e){for(var t=0,n=0,i=e.children,r=i.length,s;--r>=0;)s=i[r],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function zne(e,t,n){return e.a.parent===t.parent?e.a:n}function f0(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}f0.prototype=Object.create(Mu.prototype);function Bne(e){for(var t=new f0(e,0),n,i=[t],r,s,o,a;n=i.pop();)if(s=n._.children)for(n.children=new Array(a=s.length),o=a-1;o>=0;--o)i.push(r=n.children[o]=new f0(s[o],o)),r.parent=n;return(t.parent=new f0(null,0)).children=[t],t}function jne(){var e=Lne,t=1,n=1,i=null;function r(u){var c=Bne(u);if(c.eachAfter(s),c.parent.m=-c.z,c.eachBefore(o),i)u.eachBefore(l);else{var f=u,d=u,h=u;u.eachBefore(function(b){b.xd.x&&(d=b),b.depth>h.depth&&(h=b)});var p=f===d?1:e(f,d)/2,g=p-f.x,m=t/(d.x+p+g),y=n/(h.depth||1);u.eachBefore(function(b){b.x=(b.x+g)*m,b.y=b.depth*y})}return u}function s(u){var c=u.children,f=u.parent.children,d=u.i?f[u.i-1]:null;if(c){Pne(u);var h=(c[0].z+c[c.length-1].z)/2;d?(u.z=d.z+e(u._,d._),u.m=u.z-h):u.z=h}else d&&(u.z=d.z+e(u._,d._));u.parent.A=a(u,d,u.parent.A||f[0])}function o(u){u._.x=u.z+u.parent.m,u.m+=u.parent.m}function a(u,c,f){if(c){for(var d=u,h=u,p=c,g=d.parent.children[0],m=d.m,y=h.m,b=p.m,v=g.m,_;p=zv(p),d=Pv(d),p&&d;)g=Pv(g),h=zv(h),h.a=u,_=p.z+b-d.z-m+e(p._,d._),_>0&&(Ine(zne(p,u,f),u,_),m+=_,y+=_),b+=p.m,m+=d.m,v+=g.m,y+=h.m;p&&!zv(h)&&(h.t=p,h.m+=b-y),d&&!Pv(g)&&(g.t=d,g.m+=m-v,f=u)}return f}function l(u){u.x*=t,u.y=u.depth*n}return r.separation=function(u){return arguments.length?(e=u,r):e},r.size=function(u){return arguments.length?(i=!1,t=+u[0],n=+u[1],r):i?null:[t,n]},r.nodeSize=function(u){return arguments.length?(i=!0,t=+u[0],n=+u[1],r):i?[t,n]:null},r}function d0(e,t,n,i,r){for(var s=e.children,o,a=-1,l=s.length,u=e.value&&(r-n)/e.value;++ab&&(b=u),k=m*m*x,v=Math.max(b/k,k/y),v>_){m-=u;break}_=v}o.push(l={value:m,dice:h1?i:1)},n}(mF);function Une(){var e=bF,t=!1,n=1,i=1,r=[0],s=Ba,o=Ba,a=Ba,l=Ba,u=Ba;function c(d){return d.x0=d.y0=0,d.x1=n,d.y1=i,d.eachBefore(f),r=[0],t&&d.eachBefore(dF),d}function f(d){var h=r[d.depth],p=d.x0+h,g=d.y0+h,m=d.x1-h,y=d.y1-h;m=d-1){var b=s[f];b.x0=p,b.y0=g,b.x1=m,b.y1=y;return}for(var v=u[f],_=h/2+v,x=f+1,k=d-1;x>>1;u[w]<_?x=w+1:k=w}_-u[x-1]y-g){var F=h?(p*$+m*E)/h:m;c(f,x,E,p,g,F,y),c(x,d,$,F,g,m,y)}else{var A=h?(g*$+y*E)/h:y;c(f,x,E,p,g,m,A),c(x,d,$,p,A,m,y)}}}function Wne(e,t,n,i,r){(e.depth&1?d0:nd)(e,t,n,i,r)}const Hne=function e(t){function n(i,r,s,o,a){if((l=i._squarify)&&l.ratio===t)for(var l,u,c,f,d=-1,h,p=l.length,g=i.value;++d1?i:1)},n}(mF);function Bv(e,t,n){const i={};return e.each(r=>{const s=r.data;n(s)&&(i[t(s)]=r)}),e.lookup=i,e}function jv(e){j.call(this,null,e)}jv.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const Gne=e=>e.values;te(jv,j,{transform(e,t){t.source||q("Nest transform requires an upstream data source.");var n=e.generate,i=e.modified(),r=t.clone(),s=this.value;return(!s||i||t.changed())&&(s&&s.each(o=>{o.children&&Yh(o.data)&&r.rem.push(o.data)}),this.value=s=Nv({values:se(e.keys).reduce((o,a)=>(o.key(a),o),Vne()).entries(r.source)},Gne),n&&s.each(o=>{o.children&&(o=tt(o.data),r.add.push(o),r.source.push(o))}),Bv(s,$e,$e)),r.source.root=s,r}});function Vne(){const e=[],t={entries:r=>i(n(r,0),0),key:r=>(e.push(r),t)};function n(r,s){if(s>=e.length)return r;const o=r.length,a=e[s++],l={},u={};let c=-1,f,d,h;for(;++ce.length)return r;const o=[];for(const a in r)o.push({key:a,values:i(r[a],s)});return o}return t}function Rs(e){j.call(this,null,e)}const Yne=(e,t)=>e.parent===t.parent?1:2;te(Rs,j,{transform(e,t){(!t.source||!t.source.root)&&q(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),i=this.fields,r=t.source.root,s=e.as||i;e.field?r.sum(e.field):r.count(),e.sort&&r.sort(ba(e.sort,o=>o.data)),Xne(n,this.params,e),n.separation&&n.separation(e.separation!==!1?Yne:Pl);try{this.value=n(r)}catch(o){q(o)}return r.each(o=>Zne(o,i,s)),t.reflow(e.modified()).modifies(s).modifies("leaf")}});function Xne(e,t,n){for(let i,r=0,s=t.length;rs[$e(o)]=1),i.each(o=>{const a=o.data,l=o.parent&&o.parent.data;l&&s[$e(a)]&&s[$e(l)]&&r.add.push(tt({source:l,target:a}))}),this.value=r.add):t.changed(t.MOD)&&(t.visit(t.MOD,o=>s[$e(o)]=1),n.forEach(o=>{(s[$e(o.source)]||s[$e(o.target)])&&r.mod.push(o)})),r}});const _F={binary:qne,dice:nd,slice:d0,slicedice:Wne,squarify:bF,resquarify:Hne},Zv=["x0","y0","x1","y1","depth","children"];function Kv(e){Rs.call(this,e)}Kv.Definition={type:"Treemap",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:!1},{name:"size",type:"number",array:!0,length:2},{name:"as",type:"string",array:!0,length:Zv.length,default:Zv}]},te(Kv,Rs,{layout(){const e=Une();return e.ratio=t=>{const n=e.tile();n.ratio&&e.tile(n.ratio(t))},e.method=t=>{le(_F,t)?e.tile(_F[t]):q("Unrecognized Treemap layout method: "+t)},e},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:Zv});const Kne=Object.freeze(Object.defineProperty({__proto__:null,nest:jv,pack:qv,partition:Hv,stratify:Gv,tree:Yv,treelinks:Xv,treemap:Kv},Symbol.toStringTag,{value:"Module"})),Jv=4278190080;function Jne(e,t){const n=e.bitmap();return(t||[]).forEach(i=>n.set(e(i.boundary[0]),e(i.boundary[3]))),[n,void 0]}function Qne(e,t,n,i,r){const s=e.width,o=e.height,a=i||r,l=_o(s,o).getContext("2d"),u=_o(s,o).getContext("2d"),c=a&&_o(s,o).getContext("2d");n.forEach(E=>h0(l,E,!1)),h0(u,t,!1),a&&h0(c,t,!0);const f=Qv(l,s,o),d=Qv(u,s,o),h=a&&Qv(c,s,o),p=e.bitmap(),g=a&&e.bitmap();let m,y,b,v,_,x,k,w;for(y=0;y{r.items.forEach(s=>h0(e,s.items,n))}):yi[i].draw(e,{items:n?t.map(eie):t})}function eie(e){const t=Xh(e,{});return t.stroke&&t.strokeOpacity!==0||t.fill&&t.fillOpacity!==0?{...t,strokeOpacity:1,stroke:"#000",fillOpacity:0}:t}const Os=5,Hn=31,id=32,Bo=new Uint32Array(id+1),cr=new Uint32Array(id+1);cr[0]=0,Bo[0]=~cr[0];for(let e=1;e<=id;++e)cr[e]=cr[e-1]<<1|1,Bo[e]=~cr[e];function tie(e,t){const n=new Uint32Array(~~((e*t+id)/id));function i(s,o){n[s]|=o}function r(s,o){n[s]&=o}return{array:n,get:(s,o)=>{const a=o*e+s;return n[a>>>Os]&1<<(a&Hn)},set:(s,o)=>{const a=o*e+s;i(a>>>Os,1<<(a&Hn))},clear:(s,o)=>{const a=o*e+s;r(a>>>Os,~(1<<(a&Hn)))},getRange:(s,o,a,l)=>{let u=l,c,f,d,h;for(;u>=o;--u)if(c=u*e+s,f=u*e+a,d=c>>>Os,h=f>>>Os,d===h){if(n[d]&Bo[c&Hn]&cr[(f&Hn)+1])return!0}else{if(n[d]&Bo[c&Hn]||n[h]&cr[(f&Hn)+1])return!0;for(let p=d+1;p{let u,c,f,d,h;for(;o<=l;++o)if(u=o*e+s,c=o*e+a,f=u>>>Os,d=c>>>Os,f===d)i(f,Bo[u&Hn]&cr[(c&Hn)+1]);else for(i(f,Bo[u&Hn]),i(d,cr[(c&Hn)+1]),h=f+1;h{let u,c,f,d,h;for(;o<=l;++o)if(u=o*e+s,c=o*e+a,f=u>>>Os,d=c>>>Os,f===d)r(f,cr[u&Hn]|Bo[(c&Hn)+1]);else for(r(f,cr[u&Hn]),r(d,Bo[(c&Hn)+1]),h=f+1;hs<0||o<0||l>=t||a>=e}}function nie(e,t,n){const i=Math.max(1,Math.sqrt(e*t/1e6)),r=~~((e+2*n+i)/i),s=~~((t+2*n+i)/i),o=a=>~~((a+n)/i);return o.invert=a=>a*i-n,o.bitmap=()=>tie(r,s),o.ratio=i,o.padding=n,o.width=e,o.height=t,o}function iie(e,t,n,i){const r=e.width,s=e.height;return function(o){const a=o.datum.datum.items[i].items,l=a.length,u=o.datum.fontSize,c=mi.width(o.datum,o.datum.text);let f=0,d,h,p,g,m,y,b;for(let v=0;v=f&&(f=b,o.x=m,o.y=y);return m=c/2,y=u/2,d=o.x-m,h=o.x+m,p=o.y-y,g=o.y+y,o.align="center",d<0&&h<=r?o.align="left":0<=d&&rr||t-(o=i/2)<0||t+o>s}function jo(e,t,n,i,r,s,o,a){const l=r*s/(i*2),u=e(t-l),c=e(t+l),f=e(n-(s=s/2)),d=e(n+s);return o.outOfBounds(u,f,c,d)||o.getRange(u,f,c,d)||a&&a.getRange(u,f,c,d)}function rie(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1];function l(u,c,f,d,h){const p=e.invert(u),g=e.invert(c);let m=f,y=s,b;if(!p0(p,g,d,h,r,s)&&!jo(e,p,g,h,d,m,o,a)&&!jo(e,p,g,h,d,h,o,null)){for(;y-m>=1;)b=(m+y)/2,jo(e,p,g,h,d,b,o,a)?y=b:m=b;if(m>f)return[p,g,m,!0]}}return function(u){const c=u.datum.datum.items[i].items,f=c.length,d=u.datum.fontSize,h=mi.width(u.datum,u.datum.text);let p=n?d:0,g=!1,m=!1,y=0,b,v,_,x,k,w,E,$,F,A,z,P,M,S,D,B,V;for(let H=0;Hv&&(V=b,b=v,v=V),_>x&&(V=_,_=x,x=V),F=e(b),z=e(v),A=~~((F+z)/2),P=e(_),S=e(x),M=~~((P+S)/2),E=A;E>=F;--E)for($=M;$>=P;--$)B=l(E,$,p,h,d),B&&([u.x,u.y,p,g]=B);for(E=A;E<=z;++E)for($=M;$<=S;++$)B=l(E,$,p,h,d),B&&([u.x,u.y,p,g]=B);!g&&!n&&(D=Math.abs(v-b+x-_),k=(b+v)/2,w=(_+x)/2,D>=y&&!p0(k,w,h,d,r,s)&&!jo(e,k,w,d,h,d,o,null)&&(y=D,u.x=k,u.y=w,m=!0))}return g||m?(k=h/2,w=d/2,o.setRange(e(u.x-k),e(u.y-w),e(u.x+k),e(u.y+w)),u.align="center",u.baseline="middle",!0):!1}}const sie=[-1,-1,1,1],oie=[-1,1,-1,1];function aie(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],l=e.bitmap();return function(u){const c=u.datum.datum.items[i].items,f=c.length,d=u.datum.fontSize,h=mi.width(u.datum,u.datum.text),p=[];let g=n?d:0,m=!1,y=!1,b=0,v,_,x,k,w,E,$,F,A,z,P,M;for(let S=0;S=1;)P=(A+z)/2,jo(e,w,E,d,h,P,o,a)?z=P:A=P;A>g&&(u.x=w,u.y=E,g=A,m=!0)}}!m&&!n&&(M=Math.abs(_-v+k-x),w=(v+_)/2,E=(x+k)/2,M>=b&&!p0(w,E,h,d,r,s)&&!jo(e,w,E,d,h,d,o,null)&&(b=M,u.x=w,u.y=E,y=!0))}return m||y?(w=h/2,E=d/2,o.setRange(e(u.x-w),e(u.y-E),e(u.x+w),e(u.y+E)),u.align="center",u.baseline="middle",!0):!1}}const lie=["right","center","left"],uie=["bottom","middle","top"];function cie(e,t,n,i){const r=e.width,s=e.height,o=t[0],a=t[1],l=i.length;return function(u){const c=u.boundary,f=u.datum.fontSize;if(c[2]<0||c[5]<0||c[0]>r||c[3]>s)return!1;let d=u.textWidth??0,h,p,g,m,y,b,v,_,x,k,w,E,$,F,A;for(let z=0;z>>2&3)-1,g=h===0&&p===0||i[z]<0,m=h&&p?Math.SQRT1_2:1,y=i[z]<0?-1:1,b=c[1+h]+i[z]*h*m,w=c[4+p]+y*f*p/2+i[z]*p*m,_=w-f/2,x=w+f/2,E=e(b),F=e(_),A=e(x),!d)if(xF(E,E,F,A,o,a,b,b,_,x,c,g))d=mi.width(u.datum,u.datum.text);else continue;if(k=b+y*d*h/2,b=k-d/2,v=k+d/2,E=e(b),$=e(v),xF(E,$,F,A,o,a,b,v,_,x,c,g))return u.x=h?h*y<0?v:b:k,u.y=p?p*y<0?x:_:w,u.align=lie[h*y+1],u.baseline=uie[p*y+1],o.setRange(E,F,$,A),!0}return!1}}function xF(e,t,n,i,r,s,o,a,l,u,c,f){return!(r.outOfBounds(e,n,t,i)||(f&&s||r).getRange(e,n,t,i))}const e_=0,t_=4,n_=8,i_=0,r_=1,s_=2,fie={"top-left":e_+i_,top:e_+r_,"top-right":e_+s_,left:t_+i_,middle:t_+r_,right:t_+s_,"bottom-left":n_+i_,bottom:n_+r_,"bottom-right":n_+s_},die={naive:iie,"reduced-search":rie,floodfill:aie};function hie(e,t,n,i,r,s,o,a,l,u,c){if(!e.length)return e;const f=Math.max(i.length,r.length),d=pie(i,f),h=gie(r,f),p=mie(e[0].datum),g=p==="group"&&e[0].datum.items[l].marktype,m=g==="area",y=yie(p,g,a,l),b=u===null||u===1/0,v=m&&c==="naive";let _=-1,x=-1;const k=e.map(F=>{const A=b?mi.width(F,F.text):void 0;return _=Math.max(_,A),x=Math.max(x,F.fontSize),{datum:F,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:y(F),textWidth:A}});u=u===null||u===1/0?Math.max(_,x)+Math.max(...i):u;const w=nie(t[0],t[1],u);let E;if(!v){n&&k.sort((z,P)=>n(z.datum,P.datum));let F=!1;for(let z=0;zz.datum);E=s.length||A?Qne(w,A||[],s,F,m):Jne(w,o&&k)}const $=m?die[c](w,E,o,l):cie(w,E,h,d);return k.forEach(F=>F.opacity=+$(F)),k}function pie(e,t){const n=new Float64Array(t),i=e.length;for(let r=0;r[s.x,s.x,s.x,s.y,s.y,s.y];return e?e==="line"||e==="area"?s=>r(s.datum):t==="line"?s=>{const o=s.datum.items[i].items;return r(o.length?o[n==="start"?0:o.length-1]:{x:NaN,y:NaN})}:s=>{const o=s.datum.bounds;return[o.x1,(o.x1+o.x2)/2,o.x2,o.y1,(o.y1+o.y2)/2,o.y2]}:r}const o_=["x","y","opacity","align","baseline"],wF=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function a_(e){j.call(this,null,e)}a_.Definition={type:"Label",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:!0,default:wF},{name:"offset",type:"number",array:!0,default:[1]},{name:"padding",type:"number",default:0,null:!0},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:!0},{name:"avoidMarks",type:"data",array:!0},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:!0,length:o_.length,default:o_}]},te(a_,j,{transform(e,t){function n(s){const o=e[s];return ze(o)&&t.modified(o.fields)}const i=e.modified();if(!(i||t.changed(t.ADD_REM)||n("sort")))return;(!e.size||e.size.length!==2)&&q("Size parameter should be specified as a [width, height] array.");const r=e.as||o_;return hie(t.materialize(t.SOURCE).source||[],e.size,e.sort,se(e.offset==null?1:e.offset),se(e.anchor||wF),e.avoidMarks||[],e.avoidBaseMark!==!1,e.lineAnchor||"end",e.markIndex||0,e.padding===void 0?0:e.padding,e.method||"naive").forEach(s=>{const o=s.datum;o[r[0]]=s.x,o[r[1]]=s.y,o[r[2]]=s.opacity,o[r[3]]=s.align,o[r[4]]=s.baseline}),t.reflow(i).modifies(r)}});const bie=Object.freeze(Object.defineProperty({__proto__:null,label:a_},Symbol.toStringTag,{value:"Module"}));function kF(e,t){var n=[],i=function(c){return c(a)},r,s,o,a,l,u;if(t==null)n.push(e);else for(r={},s=0,o=e.length;s{E8(u,e.x,e.y,e.bandwidth||.3).forEach(c=>{const f={};for(let d=0;de==="poly"?t:e==="quad"?2:1;function c_(e){j.call(this,null,e)}c_.Definition={type:"Regression",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"string",default:"linear",values:Object.keys(u_)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:!0,length:2},{name:"params",type:"boolean",default:!1},{name:"as",type:"string",array:!0}]},te(c_,j,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const i=t.materialize(t.SOURCE).source,r=kF(i,e.groupby),s=(e.groupby||[]).map(Tt),o=e.method||"linear",a=e.order==null?3:e.order,l=vie(o,a),u=e.as||[Tt(e.x),Tt(e.y)],c=u_[o],f=[];let d=e.extent;le(u_,o)||q("Invalid regression method: "+o),d!=null&&o==="log"&&d[0]<=0&&(t.dataflow.warn("Ignoring extent with values <= 0 for log regression."),d=null),r.forEach(h=>{if(h.length<=l){t.dataflow.warn("Skipping regression with more parameters than data points.");return}const g=c(h,e.x,e.y,a);if(e.params){f.push(tt({keys:h.dims,coef:g.coef,rSquared:g.rSquared}));return}const m=d||Dr(h,e.x),y=b=>{const v={};for(let _=0;_y([b,g.predict(b)])):sp(g.predict,m,25,200).forEach(y)}),this.value&&(n.rem=this.value),this.value=n.add=n.source=f}return n}});const _ie=Object.freeze(Object.defineProperty({__proto__:null,loess:l_,regression:c_},Symbol.toStringTag,{value:"Module"})),Ls=11102230246251565e-32,An=134217729,xie=(3+8*Ls)*Ls;function f_(e,t,n,i,r){let s,o,a,l,u=t[0],c=i[0],f=0,d=0;c>u==c>-u?(s=u,u=t[++f]):(s=c,c=i[++d]);let h=0;if(fu==c>-u?(o=u+s,a=s-(o-u),u=t[++f]):(o=c+s,a=s-(o-c),c=i[++d]),s=o,a!==0&&(r[h++]=a);fu==c>-u?(o=s+u,l=o-s,a=s-(o-l)+(u-l),u=t[++f]):(o=s+c,l=o-s,a=s-(o-l)+(c-l),c=i[++d]),s=o,a!==0&&(r[h++]=a);for(;f=M||-P>=M||(f=e-$,a=e-($+f)+(f-r),f=n-F,u=n-(F+f)+(f-r),f=t-A,l=t-(A+f)+(f-s),f=i-z,c=i-(z+f)+(f-s),a===0&&l===0&&u===0&&c===0)||(M=$ie*o+xie*Math.abs(P),P+=$*c+z*a-(A*u+F*l),P>=M||-P>=M))return P;_=a*z,d=An*a,h=d-(d-a),p=a-h,d=An*z,g=d-(d-z),m=z-g,x=p*m-(_-h*g-p*g-h*m),k=l*F,d=An*l,h=d-(d-l),p=l-h,d=An*F,g=d-(d-F),m=F-g,w=p*m-(k-h*g-p*g-h*m),y=x-w,f=x-y,Gn[0]=x-(y+f)+(f-w),b=_+y,f=b-_,v=_-(b-f)+(y-f),y=v-k,f=v-y,Gn[1]=v-(y+f)+(f-k),E=b+y,f=E-b,Gn[2]=b-(E-f)+(y-f),Gn[3]=E;const S=f_(4,Nu,4,Gn,EF);_=$*c,d=An*$,h=d-(d-$),p=$-h,d=An*c,g=d-(d-c),m=c-g,x=p*m-(_-h*g-p*g-h*m),k=A*u,d=An*A,h=d-(d-A),p=A-h,d=An*u,g=d-(d-u),m=u-g,w=p*m-(k-h*g-p*g-h*m),y=x-w,f=x-y,Gn[0]=x-(y+f)+(f-w),b=_+y,f=b-_,v=_-(b-f)+(y-f),y=v-k,f=v-y,Gn[1]=v-(y+f)+(f-k),E=b+y,f=E-b,Gn[2]=b-(E-f)+(y-f),Gn[3]=E;const D=f_(S,EF,4,Gn,$F);_=a*c,d=An*a,h=d-(d-a),p=a-h,d=An*c,g=d-(d-c),m=c-g,x=p*m-(_-h*g-p*g-h*m),k=l*u,d=An*l,h=d-(d-l),p=l-h,d=An*u,g=d-(d-u),m=u-g,w=p*m-(k-h*g-p*g-h*m),y=x-w,f=x-y,Gn[0]=x-(y+f)+(f-w),b=_+y,f=b-_,v=_-(b-f)+(y-f),y=v-k,f=v-y,Gn[1]=v-(y+f)+(f-k),E=b+y,f=E-b,Gn[2]=b-(E-f)+(y-f),Gn[3]=E;const B=f_(D,$F,4,Gn,SF);return SF[B-1]}function g0(e,t,n,i,r,s){const o=(t-s)*(n-r),a=(e-r)*(i-s),l=o-a,u=Math.abs(o+a);return Math.abs(l)>=kie*u?l:-Sie(e,t,n,i,r,s,u)}const CF=Math.pow(2,-52),m0=new Uint32Array(512);class y0{static from(t,n=Mie,i=Die){const r=t.length,s=new Float64Array(r*2);for(let o=0;o>1;if(n>0&&typeof t[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const i=Math.max(2*n-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:i,_hullTri:r,_hullHash:s}=this,o=t.length>>1;let a=1/0,l=1/0,u=-1/0,c=-1/0;for(let $=0;$u&&(u=F),A>c&&(c=A),this._ids[$]=$}const f=(a+u)/2,d=(l+c)/2;let h,p,g;for(let $=0,F=1/0;$0&&(p=$,F=A)}let b=t[2*p],v=t[2*p+1],_=1/0;for(let $=0;$z&&($[F++]=P,z=M)}this.hull=$.subarray(0,F),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(g0(m,y,b,v,x,k)<0){const $=p,F=b,A=v;p=g,b=x,v=k,g=$,x=F,k=A}const w=Tie(m,y,b,v,x,k);this._cx=w.x,this._cy=w.y;for(let $=0;$0&&Math.abs(P-F)<=CF&&Math.abs(M-A)<=CF||(F=P,A=M,z===h||z===p||z===g))continue;let S=0;for(let oe=0,we=this._hashKey(P,M);oe=0;)if(D=B,D===S){D=-1;break}if(D===-1)continue;let V=this._addTriangle(D,z,i[D],-1,-1,r[D]);r[z]=this._legalize(V+2),r[D]=V,E++;let H=i[D];for(;B=i[H],g0(P,M,t[2*H],t[2*H+1],t[2*B],t[2*B+1])<0;)V=this._addTriangle(H,z,B,r[z],-1,r[H]),r[z]=this._legalize(V+2),i[H]=H,E--,H=B;if(D===S)for(;B=n[D],g0(P,M,t[2*B],t[2*B+1],t[2*D],t[2*D+1])<0;)V=this._addTriangle(B,z,D,-1,r[D],r[B]),this._legalize(V+2),r[B]=V,i[D]=D,E--,D=B;this._hullStart=n[z]=D,i[D]=n[H]=z,i[z]=H,s[this._hashKey(P,M)]=z,s[this._hashKey(t[2*D],t[2*D+1])]=D}this.hull=new Uint32Array(E);for(let $=0,F=this._hullStart;$0?3-n:1+n)/4}function d_(e,t,n,i){const r=e-n,s=t-i;return r*r+s*s}function Aie(e,t,n,i,r,s,o,a){const l=e-o,u=t-a,c=n-o,f=i-a,d=r-o,h=s-a,p=l*l+u*u,g=c*c+f*f,m=d*d+h*h;return l*(f*m-g*h)-u*(c*m-g*d)+p*(c*h-f*d)<0}function Fie(e,t,n,i,r,s){const o=n-e,a=i-t,l=r-e,u=s-t,c=o*o+a*a,f=l*l+u*u,d=.5/(o*u-a*l),h=(u*c-a*f)*d,p=(o*f-l*c)*d;return h*h+p*p}function Tie(e,t,n,i,r,s){const o=n-e,a=i-t,l=r-e,u=s-t,c=o*o+a*a,f=l*l+u*u,d=.5/(o*u-a*l),h=e+(u*c-a*f)*d,p=t+(o*f-l*c)*d;return{x:h,y:p}}function Ru(e,t,n,i){if(i-n<=20)for(let r=n+1;r<=i;r++){const s=e[r],o=t[s];let a=r-1;for(;a>=n&&t[e[a]]>o;)e[a+1]=e[a--];e[a+1]=s}else{const r=n+i>>1;let s=n+1,o=i;sd(e,r,s),t[e[n]]>t[e[i]]&&sd(e,n,i),t[e[s]]>t[e[i]]&&sd(e,s,i),t[e[n]]>t[e[s]]&&sd(e,n,s);const a=e[s],l=t[a];for(;;){do s++;while(t[e[s]]l);if(o=o-n?(Ru(e,t,s,i),Ru(e,t,n,o-1)):(Ru(e,t,n,o-1),Ru(e,t,s,i))}}function sd(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function Mie(e){return e[0]}function Die(e){return e[1]}const AF=1e-6;class ja{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,i){t=+t,n=+n,i=+i;const r=t+i,s=n;if(i<0)throw new Error("negative radius");this._x1===null?this._+=`M${r},${s}`:(Math.abs(this._x1-r)>AF||Math.abs(this._y1-s)>AF)&&(this._+="L"+r+","+s),i&&(this._+=`A${i},${i},0,1,1,${t-i},${n}A${i},${i},0,1,1,${this._x1=r},${this._y1=s}`)}rect(t,n,i,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+i}v${+r}h${-i}Z`}value(){return this._||null}}class h_{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}let Nie=class{constructor(t,[n,i,r,s]=[0,0,960,500]){if(!((r=+r)>=(n=+n))||!((s=+s)>=(i=+i)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(t.points.length*2),this.vectors=new Float64Array(t.points.length*2),this.xmax=r,this.xmin=n,this.ymax=s,this.ymin=i,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:i},vectors:r}=this;let s,o;const a=this.circumcenters=this._circumcenters.subarray(0,i.length/3*2);for(let g=0,m=0,y=i.length,b,v;g1;)s-=2;for(let o=2;o0){if(n>=this.ymax)return null;(o=(this.ymax-n)/r)0){if(t>=this.xmax)return null;(o=(this.xmax-t)/i)this.xmax?2:0)|(nthis.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n1e-10)return!1}return!0}function Pie(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class p_{static from(t,n=Oie,i=Lie,r){return new p_("length"in t?zie(t,n,i,r):Float64Array.from(Bie(t,n,i,r)))}constructor(t){this._delaunator=new y0(t),this.inedges=new Int32Array(t.length/2),this._hullIndex=new Int32Array(t.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const t=this._delaunator,n=this.points;if(t.hull&&t.hull.length>2&&Iie(t)){this.collinear=Int32Array.from({length:n.length/2},(d,h)=>h).sort((d,h)=>n[2*d]-n[2*h]||n[2*d+1]-n[2*h+1]);const l=this.collinear[0],u=this.collinear[this.collinear.length-1],c=[n[2*l],n[2*l+1],n[2*u],n[2*u+1]],f=1e-8*Math.hypot(c[3]-c[1],c[2]-c[0]);for(let d=0,h=n.length/2;d0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,r.length===2&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new Nie(this,t)}*neighbors(t){const{inedges:n,hull:i,_hullIndex:r,halfedges:s,triangles:o,collinear:a}=this;if(a){const f=a.indexOf(t);f>0&&(yield a[f-1]),f=0&&s!==i&&s!==r;)i=s;return s}_step(t,n,i){const{inedges:r,hull:s,_hullIndex:o,halfedges:a,triangles:l,points:u}=this;if(r[t]===-1||!u.length)return(t+1)%(u.length>>1);let c=t,f=Ou(n-u[t*2],2)+Ou(i-u[t*2+1],2);const d=r[t];let h=d;do{let p=l[h];const g=Ou(n-u[p*2],2)+Ou(i-u[p*2+1],2);if(g>5)*e[1]),m=null,y=u.length,b=-1,v=[],_=u.map(k=>({text:t(k),font:n(k),style:r(k),weight:s(k),rotate:o(k),size:~~(i(k)+1e-14),padding:a(k),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:k})).sort((k,w)=>w.size-k.size);++b>1,x.y=e[1]*(c()+.5)>>1,Gie(p,x,_,b),x.hasText&&h(g,x,m)&&(v.push(x),m?Yie(m,x):m=[{x:x.x+x.x0,y:x.y+x.y0},{x:x.x+x.x1,y:x.y+x.y1}],x.x-=e[0]>>1,x.y-=e[1]>>1)}return v};function d(p){p.width=p.height=1;var g=Math.sqrt(p.getContext("2d").getImageData(0,0,1,1).data.length>>2);p.width=(od<<5)/g,p.height=b0/g;var m=p.getContext("2d");return m.fillStyle=m.strokeStyle="red",m.textAlign="center",{context:m,ratio:g}}function h(p,g,m){for(var y=g.x,b=g.y,v=Math.hypot(e[0],e[1]),_=l(e),x=c()<.5?1:-1,k=-x,w,E,$;(w=_(k+=x))&&(E=~~w[0],$=~~w[1],!(Math.min(Math.abs(E),Math.abs($))>=v));)if(g.x=y+E,g.y=b+$,!(g.x+g.x0<0||g.y+g.y0<0||g.x+g.x1>e[0]||g.y+g.y1>e[1])&&(!m||!Vie(g,p,e[0]))&&(!m||Xie(g,m))){for(var F=g.sprite,A=g.width>>5,z=e[0]>>5,P=g.x-(A<<4),M=P&127,S=32-M,D=g.y1-g.y0,B=(g.y+g.y0)*z+(P>>5),V,H=0;H>>M:0);B+=z}return g.sprite=null,!0}return!1}return f.words=function(p){return arguments.length?(u=p,f):u},f.size=function(p){return arguments.length?(e=[+p[0],+p[1]],f):e},f.font=function(p){return arguments.length?(n=Ua(p),f):n},f.fontStyle=function(p){return arguments.length?(r=Ua(p),f):r},f.fontWeight=function(p){return arguments.length?(s=Ua(p),f):s},f.rotate=function(p){return arguments.length?(o=Ua(p),f):o},f.text=function(p){return arguments.length?(t=Ua(p),f):t},f.spiral=function(p){return arguments.length?(l=Jie[p]||p,f):l},f.fontSize=function(p){return arguments.length?(i=Ua(p),f):i},f.padding=function(p){return arguments.length?(a=Ua(p),f):a},f.random=function(p){return arguments.length?(c=p,f):c},f}function Gie(e,t,n,i){if(!t.sprite){var r=e.context,s=e.ratio;r.clearRect(0,0,(od<<5)/s,b0/s);var o=0,a=0,l=0,u=n.length,c,f,d,h,p;for(--i;++i>5<<5,d=~~Math.max(Math.abs(b+v),Math.abs(b-v))}else c=c+31>>5<<5;if(d>l&&(l=d),o+c>=od<<5&&(o=0,a+=l,l=0),a+d>=b0)break;r.translate((o+(c>>1))/s,(a+(d>>1))/s),t.rotate&&r.rotate(t.rotate*m_),r.fillText(t.text,0,0),t.padding&&(r.lineWidth=2*t.padding,r.strokeText(t.text,0,0)),r.restore(),t.width=c,t.height=d,t.xoff=o,t.yoff=a,t.x1=c>>1,t.y1=d>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,o+=c}for(var x=r.getImageData(0,0,(od<<5)/s,b0/s).data,k=[];--i>=0;)if(t=n[i],!!t.hasText){for(c=t.width,f=c>>5,d=t.y1-t.y0,h=0;h>5),F=x[(a+p)*(od<<5)+(o+h)<<2]?1<<31-h%32:0;k[$]|=F,w|=F}w?E=p:(t.y0++,d--,p--,a++)}t.y1=t.y0+E,t.sprite=k.slice(0,(t.y1-t.y0)*f)}}}function Vie(e,t,n){n>>=5;for(var i=e.sprite,r=e.width>>5,s=e.x-(r<<4),o=s&127,a=32-o,l=e.y1-e.y0,u=(e.y+e.y0)*n+(s>>5),c,f=0;f>>o:0))&t[u+d])return!0;u+=n}return!1}function Yie(e,t){var n=e[0],i=e[1];t.x+t.x0i.x&&(i.x=t.x+t.x1),t.y+t.y1>i.y&&(i.y=t.y+t.y1)}function Xie(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0t[0].y&&e.y+e.y0g(p(m))}r.forEach(p=>{p[o[0]]=NaN,p[o[1]]=NaN,p[o[3]]=0});const u=s.words(r).text(e.text).size(e.size||[500,500]).padding(e.padding||1).spiral(e.spiral||"archimedean").rotate(e.rotate||0).font(e.font||"sans-serif").fontStyle(e.fontStyle||"normal").fontWeight(e.fontWeight||"normal").fontSize(a).random(Ni).layout(),c=s.size(),f=c[0]>>1,d=c[1]>>1,h=u.length;for(let p=0,g,m;pnew Uint8Array(e),nre=e=>new Uint16Array(e),ad=e=>new Uint32Array(e);function ire(){let e=8,t=[],n=ad(0),i=v0(0,e),r=v0(0,e);return{data:()=>t,seen:()=>n=rre(n,t.length),add(s){for(let o=0,a=t.length,l=s.length,u;ot.length,curr:()=>i,prev:()=>r,reset:s=>r[s]=i[s],all:()=>e<257?255:e<65537?65535:4294967295,set(s,o){i[s]|=o},clear(s,o){i[s]&=~o},resize(s,o){const a=i.length;(s>a||o>e)&&(e=Math.max(o,e),i=v0(s,e,i),r=v0(s,e))}}}function rre(e,t,n){return e.length>=t?e:(n=n||new e.constructor(t),n.set(e),n)}function v0(e,t,n){const i=(t<257?tre:t<65537?nre:ad)(e);return n&&i.set(n),i}function MF(e,t,n){const i=1<0)for(m=0;me,size:()=>n}}function sre(e,t){return e.sort.call(t,(n,i)=>{const r=e[n],s=e[i];return rs?1:0}),xq(e,t)}function ore(e,t,n,i,r,s,o,a,l){let u=0,c=0,f;for(f=0;ut.modified(i.fields));return n?this.reinit(e,t):this.eval(e,t)}else return this.init(e,t)},init(e,t){const n=e.fields,i=e.query,r=this._indices={},s=this._dims=[],o=i.length;let a=0,l,u;for(;a{const s=r.remove(t,n);for(const o in i)i[o].reindex(s)})},update(e,t,n){const i=this._dims,r=e.query,s=t.stamp,o=i.length;let a=0,l,u;for(n.filters=0,u=0;uh)for(m=h,y=Math.min(f,p);mp)for(m=Math.max(f,p),y=d;mf)for(p=f,g=Math.min(u,d);pd)for(p=Math.max(u,d),g=c;pa[c]&n?null:o[c];return s.filter(s.MOD,u),r&r-1?(s.filter(s.ADD,c=>{const f=a[c]&n;return!f&&f^l[c]&n?o[c]:null}),s.filter(s.REM,c=>{const f=a[c]&n;return f&&!(f^(f^l[c]&n))?o[c]:null})):(s.filter(s.ADD,u),s.filter(s.REM,c=>(a[c]&n)===r?o[c]:null)),s.filter(s.SOURCE,c=>u(c._index))}});const are=Object.freeze(Object.defineProperty({__proto__:null,crossfilter:b_,resolvefilter:v_},Symbol.toStringTag,{value:"Module"})),lre="RawCode",qa="Literal",ure="Property",cre="Identifier",fre="ArrayExpression",dre="BinaryExpression",NF="CallExpression",hre="ConditionalExpression",pre="LogicalExpression",gre="MemberExpression",mre="ObjectExpression",yre="UnaryExpression";function fr(e){this.type=e}fr.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=bre(this),n=0,i=t.length;n",Zr[Wa]="Identifier",Zr[Uo]="Keyword",Zr[x0]="Null",Zr[Ha]="Numeric",Zr[ri]="Punctuator",Zr[ud]="String",Zr[vre]="RegularExpression";var _re="ArrayExpression",xre="BinaryExpression",wre="CallExpression",kre="ConditionalExpression",RF="Identifier",Ere="Literal",$re="LogicalExpression",Sre="MemberExpression",Cre="ObjectExpression",Are="Property",Fre="UnaryExpression",Jt="Unexpected token %0",Tre="Unexpected number",Mre="Unexpected string",Dre="Unexpected identifier",Nre="Unexpected reserved word",Rre="Unexpected end of input",__="Invalid regular expression",x_="Invalid regular expression: missing /",OF="Octal literals are not allowed in strict mode.",Ore="Duplicate data property in object literal not allowed in strict mode",cn="ILLEGAL",cd="Disabled.",Lre=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),Ire=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function w0(e,t){if(!e)throw new Error("ASSERT: "+t)}function Is(e){return e>=48&&e<=57}function w_(e){return"0123456789abcdefABCDEF".includes(e)}function fd(e){return"01234567".includes(e)}function Pre(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function dd(e){return e===10||e===13||e===8232||e===8233}function hd(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&Lre.test(String.fromCharCode(e))}function k0(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&Ire.test(String.fromCharCode(e))}const zre={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function LF(){for(;W1114111||e!=="}")&&et({},Jt,cn),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function IF(){var e,t;for(e=me.charCodeAt(W++),t=String.fromCharCode(e),e===92&&(me.charCodeAt(W)!==117&&et({},Jt,cn),++W,e=k_("u"),(!e||e==="\\"||!hd(e.charCodeAt(0)))&&et({},Jt,cn),t=e);W>>=")return W+=4,{type:ri,value:o,start:e,end:W};if(s=o.substr(0,3),s===">>>"||s==="<<="||s===">>=")return W+=3,{type:ri,value:s,start:e,end:W};if(r=s.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return W+=2,{type:ri,value:r,start:e,end:W};if(r==="//"&&et({},Jt,cn),"<>=!+-*%&|^/".includes(i))return++W,{type:ri,value:i,start:e,end:W};et({},Jt,cn)}function qre(e){let t="";for(;W{if(parseInt(r,16)<=1114111)return"x";et({},__)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{et({},__)}try{return new RegExp(e,t)}catch{return null}}function Vre(){var e,t,n,i,r;for(e=me[W],w0(e==="/","Regular expression literal must start with a slash"),t=me[W++],n=!1,i=!1;W=0&&et({},__,n),{value:n,literal:t}}function Xre(){var e,t,n,i;return lt=null,LF(),e=W,t=Vre(),n=Yre(),i=Gre(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:W}}function Zre(e){return e.type===Wa||e.type===Uo||e.type===_0||e.type===x0}function zF(){if(LF(),W>=Fn)return{type:ld,start:W,end:W};const e=me.charCodeAt(W);return hd(e)?Ure():e===40||e===41||e===59?E_():e===39||e===34?Hre():e===46?Is(me.charCodeAt(W+1))?PF():E_():Is(e)?PF():E_()}function si(){const e=lt;return W=e.end,lt=zF(),W=e.end,e}function BF(){const e=W;lt=zF(),W=e}function Kre(e){const t=new fr(_re);return t.elements=e,t}function jF(e,t,n){const i=new fr(e==="||"||e==="&&"?$re:xre);return i.operator=e,i.left=t,i.right=n,i}function Jre(e,t){const n=new fr(wre);return n.callee=e,n.arguments=t,n}function Qre(e,t,n){const i=new fr(kre);return i.test=e,i.consequent=t,i.alternate=n,i}function $_(e){const t=new fr(RF);return t.name=e,t}function pd(e){const t=new fr(Ere);return t.value=e.value,t.raw=me.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function UF(e,t,n){const i=new fr(Sre);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function ese(e){const t=new fr(Cre);return t.properties=e,t}function qF(e,t,n){const i=new fr(Are);return i.key=t,i.value=n,i.kind=e,i}function tse(e,t){const n=new fr(Fre);return n.operator=e,n.argument=t,n.prefix=!0,n}function et(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(s,o)=>(w0(o":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function hse(){var e,t,n,i,r,s,o,a,l,u;if(e=lt,l=$0(),i=lt,r=GF(i),r===0)return l;for(i.prec=r,si(),t=[e,lt],o=$0(),s=[l,i,o];(r=GF(lt))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)o=s.pop(),a=s.pop().value,l=s.pop(),t.pop(),n=jF(a,l,o),s.push(n);i=si(),i.prec=r,s.push(i),t.push(lt),n=$0(),s.push(n)}for(u=s.length-1,n=s[u],t.pop();u>1;)t.pop(),n=jF(s[u-1].value,s[u-2],n),u-=2;return n}function Ga(){var e,t,n;return e=hse(),_t("?")&&(si(),t=Ga(),Tn(":"),n=Ga(),e=Qre(e,t,n)),e}function C_(){const e=Ga();if(_t(","))throw new Error(cd);return e}function A_(e){me=e,W=0,Fn=me.length,lt=null,BF();const t=C_();if(lt.type!==ld)throw new Error("Unexpect token after expression.");return t}var VF={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function YF(e){function t(o,a,l,u){let c=e(a[0]);return l&&(c=l+"("+c+")",l.lastIndexOf("new ",0)===0&&(c="("+c+")")),c+"."+o+(u<0?"":u===0?"()":"("+a.slice(1).map(e).join(",")+")")}function n(o,a,l){return u=>t(o,u,a,l)}const i="new Date",r="String",s="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(o){o.length<3&&q("Missing arguments to clamp function."),o.length>3&&q("Too many arguments to clamp function.");const a=o.map(e);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:n("getDate",i,0),day:n("getDay",i,0),year:n("getFullYear",i,0),month:n("getMonth",i,0),hours:n("getHours",i,0),minutes:n("getMinutes",i,0),seconds:n("getSeconds",i,0),milliseconds:n("getMilliseconds",i,0),time:n("getTime",i,0),timezoneoffset:n("getTimezoneOffset",i,0),utcdate:n("getUTCDate",i,0),utcday:n("getUTCDay",i,0),utcyear:n("getUTCFullYear",i,0),utcmonth:n("getUTCMonth",i,0),utchours:n("getUTCHours",i,0),utcminutes:n("getUTCMinutes",i,0),utcseconds:n("getUTCSeconds",i,0),utcmilliseconds:n("getUTCMilliseconds",i,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",r,0),lower:n("toLowerCase",r,0),substring:n("substring",r),split:n("split",r),trim:n("trim",r,0),btoa:"btoa",atob:"atob",regexp:s,test:n("test",s),if:function(o){o.length<3&&q("Missing arguments to if function."),o.length>3&&q("Too many arguments to if function.");const a=o.map(e);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function pse(e){const t=e&&e.length-1;return t&&(e[0]==='"'&&e[t]==='"'||e[0]==="'"&&e[t]==="'")?e.slice(1,-1):e}function XF(e){e=e||{};const t=e.allowed?er(e.allowed):{},n=e.forbidden?er(e.forbidden):{},i=e.constants||VF,r=(e.functions||YF)(f),s=e.globalvar,o=e.fieldvar,a=ze(s)?s:p=>`${s}["${p}"]`;[...Object.getOwnPropertyNames(Object.prototype).filter(p=>typeof Object.prototype[p]=="function")];let l={},u={},c=0;function f(p){if(re(p))return p;const g=d[p.type];return g==null&&q("Unsupported type: "+p.type),g(p)}const d={Literal:p=>p.raw,Identifier:p=>{const g=p.name;return c>0?g:le(n,g)?q("Illegal identifier: "+g):le(i,g)?i[g]:le(t,g)?g:(l[g]=1,a(g))},MemberExpression:p=>{const g=!p.computed,m=f(p.object);g&&(c+=1);const y=f(p.property);return m===o&&(u[pse(y)]=1),g&&(c-=1),m+(g?"."+y:"["+y+"]")},CallExpression:p=>{p.callee.type!=="Identifier"&&q("Illegal callee type: "+p.callee.type);const g=p.callee.name,m=p.arguments,y=le(r,g)&&r[g];return y||q("Unrecognized function: "+g),ze(y)?y(m):y+"("+m.map(f).join(",")+")"},ArrayExpression:p=>"["+p.elements.map(f).join(",")+"]",BinaryExpression:p=>"("+f(p.left)+" "+p.operator+" "+f(p.right)+")",UnaryExpression:p=>"("+p.operator+f(p.argument)+")",ConditionalExpression:p=>"("+f(p.test)+"?"+f(p.consequent)+":"+f(p.alternate)+")",LogicalExpression:p=>"("+f(p.left)+p.operator+f(p.right)+")",ObjectExpression:p=>{for(const g of p.properties){const m=g.key.name;Wm.has(m)&&q("Illegal property: "+m)}return"{"+p.properties.map(f).join(",")+"}"},Property:p=>{c+=1;const g=f(p.key);return c-=1,g+":"+f(p.value)}};function h(p){const g={code:f(p),globals:Object.keys(l),fields:Object.keys(u)};return l={},u={},g}return h.functions=r,h.constants=i,h}const ZF=Symbol("vega_selection_getter");function KF(e){return(!e.getter||!e.getter[ZF])&&(e.getter=Fi(e.field),e.getter[ZF]=!0),e.getter}const F_="intersect",JF="union",gse="vlMulti",mse="vlPoint",QF="or",yse="and",Kr="_vgsid_",gd=Fi(Kr),bse="E",vse="R",_se="R-E",xse="R-LE",wse="R-RE",kse="E-LT",Ese="E-LTE",$se="E-GT",Sse="E-GTE",Cse="E-VALID",Ase="E-ONE",S0="index:unit";function eT(e,t){for(var n=t.fields,i=t.values,r=n.length,s=0,o,a;s=i[s])return!1}else if(a.type===Ese){if(o>i[s])return!1}else if(a.type===$se){if(o<=i[s])return!1}else if(a.type===Sse){if(oBe(t.fields?{values:t.fields.map(i=>KF(i)(n.datum))}:{[Kr]:gd(n.datum)},t))}function Rse(e,t,n,i){for(var r=this.context.data[e],s=r?r.values.value:[],o={},a={},l={},u,c,f,d,h,p,g,m,y,b,v=s.length,_=0,x,k;_(w[c[$].field]=E,w),{})))}else h=Kr,p=gd(u),g=o[h]||(o[h]={}),m=g[d]||(g[d]=[]),m.push(p),n&&(m=a[d]||(a[d]=[]),m.push({[Kr]:p}));if(t=t||JF,o[Kr]?o[Kr]=T_[`${Kr}_${t}`](...Object.values(o[Kr])):Object.keys(o).forEach(w=>{o[w]=Object.keys(o[w]).map(E=>o[w][E]).reduce((E,$)=>E===void 0?$:T_[`${l[w]}_${t}`](E,$))}),s=Object.keys(a),n&&s.length){const w=i?mse:gse;o[w]=t===JF?{[QF]:s.reduce((E,$)=>(E.push(...a[$]),E),[])}:{[yse]:s.map(E=>({[QF]:a[E]}))}}return o}var T_={[`${Kr}_union`]:Tq,[`${Kr}_intersect`]:Aq,E_union:function(e,t){if(!e.length)return t;for(var n=0,i=t.length;nt.includes(n)):t},R_union:function(e,t){var n=_n(t[0]),i=_n(t[1]);return n>i&&(n=t[1],i=t[0]),e.length?(e[0]>n&&(e[0]=n),e[1]i&&(n=t[1],i=t[0]),e.length?ii&&(e[1]=i),e):[n,i]}};const Ose=":",Lse="@";function M_(e,t,n,i){t[0].type!==qa&&q("First argument to selection functions must be a string literal.");const r=t[0].value,s=t.length>=2&&Ve(t).value,o="unit",a=Lse+o,l=Ose+r;s===F_&&!le(i,a)&&(i[a]=n.getData(r).indataRef(n,o)),le(i,l)||(i[l]=n.getData(r).tuplesRef())}function nT(e){const t=this.context.data[e];return t?t.values.value:[]}function Ise(e,t,n){const i=this.context.data[e]["index:"+t],r=i?i.value.get(n):void 0;return r&&r.count}function Pse(e,t){const n=this.context.dataflow,i=this.context.data[e],r=i.input;return n.pulse(r,n.changeset().remove(Ti).insert(t)),1}function zse(e,t,n){if(e){const i=this.context.dataflow,r=e.mark.source;i.pulse(r,i.changeset().encode(e,t))}return n!==void 0?n:e}const md=e=>function(t,n){const i=this.context.dataflow.locale();return t===null?"null":i[e](n)(t)},Bse=md("format"),iT=md("timeFormat"),jse=md("utcFormat"),Use=md("timeParse"),qse=md("utcParse"),C0=new Date(2e3,0,1);function A0(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)?"":(C0.setYear(2e3),C0.setMonth(e),C0.setDate(t),iT.call(this,C0,n))}function Wse(e){return A0.call(this,e,1,"%B")}function Hse(e){return A0.call(this,e,1,"%b")}function Gse(e){return A0.call(this,0,2+e,"%A")}function Vse(e){return A0.call(this,0,2+e,"%a")}const Yse=":",Xse="@",D_="%",rT="$";function N_(e,t,n,i){t[0].type!==qa&&q("First argument to data functions must be a string literal.");const r=t[0].value,s=Yse+r;if(!le(s,i))try{i[s]=n.getData(r).tuplesRef()}catch{}}function Zse(e,t,n,i){t[0].type!==qa&&q("First argument to indata must be a string literal."),t[1].type!==qa&&q("Second argument to indata must be a string literal.");const r=t[0].value,s=t[1].value,o=Xse+s;le(o,i)||(i[o]=n.getData(r).indataRef(n,s))}function Vn(e,t,n,i){if(t[0].type===qa)sT(n,i,t[0].value);else for(e in n.scales)sT(n,i,e)}function sT(e,t,n){const i=D_+n;if(!le(t,i))try{t[i]=e.scaleRef(n)}catch{}}function Jr(e,t){if(re(e)){const n=t.scales[e];return n&&LE(n.value)?n.value:void 0}else if(ze(e))return LE(e)?e:void 0}function Kse(e,t,n){t.__bandwidth=r=>r&&r.bandwidth?r.bandwidth():0,n._bandwidth=Vn,n._range=Vn,n._scale=Vn;const i=r=>"_["+(r.type===qa?ee(D_+r.value):ee(D_)+"+"+e(r))+"]";return{_bandwidth:r=>`this.__bandwidth(${i(r[0])})`,_range:r=>`${i(r[0])}.range()`,_scale:r=>`${i(r[0])}(${e(r[1])})`}}function R_(e,t){return function(n,i,r){if(n){const s=Jr(n,(r||this).context);return s&&s.path[e](i)}else return t(i)}}const Jse=R_("area",mQ),Qse=R_("bounds",_Q),eoe=R_("centroid",SQ);function toe(e,t){const n=Jr(e,(t||this).context);return n&&n.scale()}function noe(e){const t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n}function O_(e,t,n){try{e[t].apply(e,["EXPRESSION"].concat([].slice.call(n)))}catch(i){e.warn(i)}return n[n.length-1]}function ioe(){return O_(this.context.dataflow,"warn",arguments)}function roe(){return O_(this.context.dataflow,"info",arguments)}function soe(){return O_(this.context.dataflow,"debug",arguments)}function L_(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}function I_(e){const t=ko(e),n=L_(t.r),i=L_(t.g),r=L_(t.b);return .2126*n+.7152*i+.0722*r}function ooe(e,t){const n=I_(e),i=I_(t),r=Math.max(n,i),s=Math.min(n,i);return(r+.05)/(s+.05)}function aoe(){const e=[].slice.call(arguments);return e.unshift({}),Be(...e)}function oT(e,t){return e===t||e!==e&&t!==t?!0:G(e)?G(t)&&e.length===t.length?loe(e,t):!1:ie(e)&&ie(t)?aT(e,t):!1}function loe(e,t){for(let n=0,i=e.length;naT(e,t)}function uoe(e,t,n,i,r,s){const o=this.context.dataflow,a=this.context.data[e],l=a.input,u=o.stamp();let c=a.changes,f,d;if(o._trigger===!1||!(l.value.length||t||i))return 0;if((!c||c.stamp{a.modified=!0,o.pulse(l,c).run()},!0,1)),n&&(f=n===!0?Ti:G(n)||Yh(n)?n:lT(n),c.remove(f)),t&&c.insert(t),i&&(f=lT(i),l.value.some(f)?c.remove(f):c.insert(i)),r){if(ze(r))throw Error("modify parameter must be a data tuple, not a function");for(d in s)c.modify(r,d,s[d])}return 1}function coe(e){const t=e.touches,n=t[0].clientX-t[1].clientX,i=t[0].clientY-t[1].clientY;return Math.hypot(n,i)}function foe(e){const t=e.touches;return Math.atan2(t[0].clientY-t[1].clientY,t[0].clientX-t[1].clientX)}const uT={};function doe(e,t){const n=uT[t]||(uT[t]=Fi(t));return G(e)?e.map(n):n(e)}function F0(e){return G(e)||ArrayBuffer.isView(e)?e:null}function P_(e){return F0(e)||(re(e)?e:null)}function hoe(e,...t){return F0(e).join(...t)}function poe(e,...t){return P_(e).indexOf(...t)}function goe(e,...t){return P_(e).lastIndexOf(...t)}function moe(e,...t){return P_(e).slice(...t)}function yoe(e,t,n){return ze(n)&&q("Function argument passed to replace."),!re(t)&&!Jm(t)&&q("Please pass a string or RegExp argument to replace."),String(e).replace(t,n)}function boe(e){return F0(e).slice().reverse()}function voe(e){return F0(e).slice().sort(jl)}function _oe(e,t,n){return mb(e||0,t||0,n||0)}function xoe(e,t){const n=Jr(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0}function woe(e,t){const n=Jr(e,(t||this).context);return n?n.copy():void 0}function koe(e,t){const n=Jr(e,(t||this).context);return n?n.domain():[]}function Eoe(e,t,n){const i=Jr(e,(n||this).context);return i?G(t)?(i.invertRange||i.invert)(t):(i.invert||i.invertExtent)(t):void 0}function $oe(e,t){const n=Jr(e,(t||this).context);return n&&n.range?n.range():[]}function Soe(e,t,n){const i=Jr(e,(n||this).context);return i?i(t):void 0}function Coe(e,t,n,i,r){e=Jr(e,(r||this).context);const s=r$(t,n);let o=e.domain(),a=o[0],l=Ve(o),u=vn;return l-a?u=qE(e,a,l):e=(e.interpolator?Qe("sequential")().interpolator(e.interpolator()):Qe("linear")().interpolate(e.interpolate()).range(e.range())).domain([a=0,l=1]),e.ticks&&(o=e.ticks(+i||15),a!==o[0]&&o.unshift(a),l!==Ve(o)&&o.push(l)),o.forEach(c=>s.stop(u(c),e(c))),s}function Aoe(e,t,n){const i=Jr(e,(n||this).context);return function(r){return i?i.path.context(r)(t):""}}function Foe(e){let t=null;return function(n){return n?gf(n,t=t||pu(e)):e}}const cT=e=>e.data;function fT(e,t){const n=nT.call(t,e);return n.root&&n.root.lookup||{}}function Toe(e,t,n){const i=fT(e,this),r=i[t],s=i[n];return r&&s?r.path(s).map(cT):void 0}function Moe(e,t){const n=fT(e,this)[t];return n?n.ancestors().map(cT):void 0}const dT=()=>typeof window<"u"&&window||null;function Doe(){const e=dT();return e?e.screen:{}}function Noe(){const e=dT();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]}function Roe(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]}function hT(e,t,n){if(!e)return[];const[i,r]=e,s=new zt().set(i[0],i[1],r[0],r[1]),o=n||this.context.dataflow.scenegraph().root;return ES(o,s,Ooe(t))}function Ooe(e){let t=null;if(e){const n=se(e.marktype),i=se(e.markname);t=r=>(!n.length||n.some(s=>r.marktype===s))&&(!i.length||i.some(s=>r.name===s))}return t}function Loe(e,t,n,i=5){e=se(e);const r=e[e.length-1];return r===void 0||Math.hypot(r[0]-t,r[1]-n)>i?[...e,[t,n]]:e}function Ioe(e){return se(e).reduce((t,[n,i],r)=>t+=r==0?`M ${n},${i} `:r===e.length-1?" Z":`L ${n},${i} `,"")}function Poe(e,t,n){const{x:i,y:r,mark:s}=n,o=new zt().set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[l,u]of t)lo.x2&&(o.x2=l),uo.y2&&(o.y2=u);return o.translate(i,r),hT([[o.x1,o.y1],[o.x2,o.y2]],e,s).filter(l=>zoe(l.x,l.y,t))}function zoe(e,t,n){let i=0;for(let r=0,s=n.length-1;rt!=a>t&&e<(o-l)*(t-u)/(a-u)+l&&i++}return i&1}const yd={random(){return Ni()},cumulativeNormal:np,cumulativeLogNormal:Z2,cumulativeUniform:ey,densityNormal:H2,densityLogNormal:X2,densityUniform:Q2,quantileNormal:ip,quantileLogNormal:K2,quantileUniform:ty,sampleNormal:tp,sampleLogNormal:Y2,sampleUniform:J2,isArray:G,isBoolean:ao,isDate:lo,isDefined(e){return e!==void 0},isNumber:Ke,isObject:ie,isRegExp:Jm,isString:re,isTuple:Yh,isValid(e){return e!=null&&e===e},toBoolean:e2,toDate(e){return t2(e)},toNumber:_n,toString:n2,indexof:poe,join:hoe,lastindexof:goe,replace:yoe,reverse:boe,sort:voe,slice:moe,flush:hk,lerp:gk,merge:aoe,pad:bk,peek:Ve,pluck:doe,span:Nc,inrange:ql,truncate:vk,rgb:ko,lab:wp,hcl:kp,hsl:vp,luminance:I_,contrast:ooe,sequence:hi,format:Bse,utcFormat:jse,utcParse:qse,utcOffset:l4,utcSequence:f4,timeFormat:iT,timeParse:Use,timeOffset:a4,timeSequence:c4,timeUnitSpecifier:Zk,monthFormat:Wse,monthAbbrevFormat:Hse,dayFormat:Gse,dayAbbrevFormat:Vse,quarter:uk,utcquarter:ck,week:Jk,utcweek:t4,dayofyear:Kk,utcdayofyear:e4,warn:ioe,info:roe,debug:soe,extent(e){return Dr(e)},inScope:noe,intersect:hT,clampRange:fk,pinchDistance:coe,pinchAngle:foe,screen:Doe,containerSize:Roe,windowSize:Noe,bandspace:_oe,setdata:Pse,pathShape:Foe,panLinear:sk,panLog:ok,panPow:ak,panSymlog:lk,zoomLinear:Vm,zoomLog:Ym,zoomPow:Ah,zoomSymlog:Xm,encode:zse,modify:uoe,lassoAppend:Loe,lassoPath:Ioe,intersectLasso:Poe},Boe=["view","item","group","xy","x","y"],joe="event.vega.",pT="this.",z_={},gT={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${ee(rT+e)}]`,functions:Uoe,constants:VF,visitors:z_},B_=XF(gT);function Uoe(e){const t=YF(e);Boe.forEach(n=>t[n]=joe+n);for(const n in yd)t[n]=pT+n;return Be(t,Kse(e,yd,z_)),t}function Ot(e,t,n){return arguments.length===1?yd[e]:(yd[e]=t,n&&(z_[e]=n),B_&&(B_.functions[e]=pT+e),this)}Ot("bandwidth",xoe,Vn),Ot("copy",woe,Vn),Ot("domain",koe,Vn),Ot("range",$oe,Vn),Ot("invert",Eoe,Vn),Ot("scale",Soe,Vn),Ot("gradient",Coe,Vn),Ot("geoArea",Jse,Vn),Ot("geoBounds",Qse,Vn),Ot("geoCentroid",eoe,Vn),Ot("geoShape",Aoe,Vn),Ot("geoScale",toe,Vn),Ot("indata",Ise,Zse),Ot("data",nT,N_),Ot("treePath",Toe,N_),Ot("treeAncestors",Moe,N_),Ot("vlSelectionTest",Fse,M_),Ot("vlSelectionIdTest",Dse,M_),Ot("vlSelectionResolve",Rse,M_),Ot("vlSelectionTuples",Nse);function Qr(e,t){const n={};let i;try{e=re(e)?e:ee(e)+"",i=A_(e)}catch{q("Expression parse error: "+e)}i.visit(s=>{if(s.type!==NF)return;const o=s.callee.name,a=gT.visitors[o];a&&a(o,s.arguments,t,n)});const r=B_(i);return r.globals.forEach(s=>{const o=rT+s;!le(n,o)&&t.getSignal(s)&&(n[o]=t.signalRef(s))}),{$expr:Be({code:r.code},t.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function qoe(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(i=>t.parseOperator(i)),n.forEach(i=>t.parseOperatorParameters(i)),(e.streams||[]).forEach(i=>t.parseStream(i)),(e.updates||[]).forEach(i=>t.parseUpdate(i)),t.resolve()}const Woe=er(["rule"]),mT=er(["group","image","rect"]);function Hoe(e,t){let n="";return Woe[t]||(e.x2&&(e.x?(mT[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(mT[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}function j_(e){return(e+"").toLowerCase()}function Goe(e){return j_(e)==="operator"}function Voe(e){return j_(e)==="collect"}function bd(e,t,n){n.endsWith(";")||(n="return("+n+");");const i=Function(...t.concat(n));return e&&e.functions?i.bind(e.functions):i}function Yoe(e,t,n,i){return`((u = ${e}) < (v = ${t}) || u == null) && v != null ? ${n} : (u > v || v == null) && u != null ? ${i} : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n} - : v !== v && u === u ? ${i} : `}var Uae={operator:(e,t)=>Rd(e,["_"],t.code),parameter:(e,t)=>Rd(e,["datum","_"],t.code),event:(e,t)=>Rd(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return Rd(e,["_","event"],n)},encode:(e,t)=>{const{marktype:n,channels:i}=t;let r="var o=item,datum=o.datum,m=0,$;";for(const s in i){const o="o["+ee(s)+"]";r+=`$=${i[s].code};if(${o}!==$)${o}=$,m=1;`}return r+=Pae(i,n),r+="return m;",Rd(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(ee).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const i=(s,o)=>{const a=t[o];let u,l;return s.path?(u=`a${s.path}`,l=`b${s.path}`):((n=n||{})["f"+o]=s,u=`this.f${o}(a)`,l=`this.f${o}(b)`),jae(u,l,-a,a)},r=Function("a","b","var u, v; return "+e.map(i).join("")+"0;");return n?r.bind(n):r}}};function qae(e){const t=this;zae(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function Wae(e){const t=this;if(e.params){const n=t.get(e.id);n||W("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function Hae(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=G(r)?r.map(s=>QD(s,n,t)):QD(r,n,t)}return t}function QD(e,t,n){if(!e||!ie(e))return e;for(let i=0,r=eT.length,s;ir&&r.$tupleid?Ae:r);return t.fn[n]||(t.fn[n]=$2(i,e.$order,t.expr.codegen))}function Kae(e,t){const n=e.$encode,i={};for(const r in n){const s=n[r];i[r]=si(t.encodeExpression(s.$expr),s.$fields),i[r].output=s.$output}return i}function Jae(e,t){return t}function Qae(e,t){const n=e.$subflow;return function(i,r,s){const o=t.fork().parse(n),a=o.get(n.operators[0].id),u=o.signals.parent;return u&&u.set(s),a.detachSubflow=()=>t.detach(o),a}}function eue(){return Ae}function tue(e){var t=this,n=e.filter!=null?t.eventExpression(e.filter):void 0,i=e.stream!=null?t.get(e.stream):void 0,r;e.source?i=t.events(e.source,e.type,n):e.merge&&(r=e.merge.map(s=>t.get(s)),i=r[0].merge.apply(r[0],r.slice(1))),e.between&&(r=e.between.map(s=>t.get(s)),i=i.between(r[0],r[1])),e.filter&&(i=i.filter(n)),e.throttle!=null&&(i=i.throttle(+e.throttle)),e.debounce!=null&&(i=i.debounce(+e.debounce)),i==null&&W("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),t.stream(e,i)}function nue(e){var t=this,n=ie(n=e.source)?n.$ref:n,i=t.get(n),r=null,s=e.update,o=void 0;i||W("Source not defined: "+e.source),r=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),s&&s.$expr&&(s.$params&&(o=t.parseParameters(s.$params)),s=t.handlerExpression(s.$expr)),t.update(e,i,r,s,o)}const iue={skip:!0};function rue(e){var t=this,n={};if(e.signals){var i=n.signals={};Object.keys(t.signals).forEach(s=>{const o=t.signals[s];e.signals(s,o)&&(i[s]=o.value)})}if(e.data){var r=n.data={};Object.keys(t.data).forEach(s=>{const o=t.data[s];e.data(s,o)&&(r[s]=o.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(s=>s.getState(e))),n}function sue(e){var t=this,n=t.dataflow,i=e.data,r=e.signals;Object.keys(r||{}).forEach(s=>{n.update(t.signals[s],r[s],iue)}),Object.keys(i||{}).forEach(s=>{n.pulse(t.data[s].input,n.changeset().remove(ji).insert(i[s]))}),(e.subcontext||[]).forEach((s,o)=>{const a=t.subcontext[o];a&&a.setState(s)})}function tT(e,t,n,i){return new nT(e,t,n,i)}function nT(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||Uae,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function iT(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}nT.prototype=iT.prototype={fork(){const e=new iT(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(n=>n!==e);const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,i=n.dataflow,r=e.value;if(n.set(e.id,t),Bae(e.type)&&r&&(r.$ingest?i.ingest(t,r.$ingest,r.$format):r.$request?i.preload(t,r.$request,r.$format):i.pulse(t,i.changeset().insert(r))),e.root&&(n.root=t),e.parent){let s=n.get(e.parent.$ref);s?(i.connect(s,[t]),t.targets().add(s)):(n.unresolved=n.unresolved||[]).push(()=>{s=n.get(e.parent.$ref),i.connect(s,[t]),t.targets().add(s)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const s in e.data){const o=n.data[s]||(n.data[s]={});e.data[s].forEach(a=>o[a]=t)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[y7(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,i,r){this.dataflow.on(t,n,i,r,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:Lae,parseOperator:qae,parseOperatorParameters:Wae,parseParameters:Hae,parseStream:tue,parseUpdate:nue,getState:rue,setState:sue};function oue(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),rT(t,e.description()))}function rT(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function aue(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const b7="default";function uue(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:b7,item:null}));e.on(e.events("view","pointermove"),t,(n,i)=>{const r=t.value,s=r?re(r)?r:r.user:b7,o=i.item&&i.item.cursor||null;return r&&s===r.user&&o==r.item?r:{user:s,item:o}}),e.add(null,function(n){let i=n.cursor,r=this.value;return re(i)||(r=i.item,i=i.user),v7(e,i&&i!==b7?i:r||i),r},{cursor:t})}function v7(e,t){const n=e.globalCursor()?typeof document<"u"&&document.body:e.container();if(n)return t==null?n.style.removeProperty("cursor"):n.style.cursor=t}function Qg(e,t){var n=e._runtime.data;return ue(n,t)||W("Unrecognized data set: "+t),n[t]}function lue(e,t){return arguments.length<2?Qg(this,e).values.value:e1.call(this,e,So().remove(ji).insert(t))}function e1(e,t){Nk(t)||W("Second argument to changes must be a changeset.");const n=Qg(this,e);return n.modified=!0,this.pulse(n.input,t)}function cue(e,t){return e1.call(this,e,So().insert(t))}function fue(e,t){return e1.call(this,e,So().remove(t))}function sT(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function oT(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function t1(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function due(e){var t=t1(e),n=sT(e),i=oT(e);e._renderer.background(e.background()),e._renderer.resize(n,i,t),e._handler.origin(t),e._resizeListeners.forEach(r=>{try{r(n,i)}catch(s){e.error(s)}})}function hue(e,t,n){var i=e._renderer,r=i&&i.canvas(),s,o,a;return r&&(a=t1(e),o=t.changedTouches?t.changedTouches[0]:t,s=Cp(o,r),s[0]-=a[0],s[1]-=a[1]),t.dataflow=e,t.item=n,t.vega=pue(e,n,s),t}function pue(e,t,n){const i=t?t.mark.marktype==="group"?t:t.mark.group:null;function r(o){var a=i,u;if(o){for(u=t;u;u=u.mark.group)if(u.mark.name===o){a=u;break}}return a&&a.mark&&a.mark.interactive?a:{}}function s(o){if(!o)return n;re(o)&&(o=r(o));const a=n.slice();for(;o;)a[0]-=o.x||0,a[1]-=o.y||0,o=o.mark&&o.mark.group;return a}return{view:$n(e),item:$n(t||{}),group:r,xy:s,x:o=>s(o)[0],y:o=>s(o)[1]}}const aT="view",gue="timer",mue="window",yue={trap:!1};function bue(e){const t=Be({defaults:{}},e),n=(i,r)=>{r.forEach(s=>{G(i[s])&&(i[s]=fr(i[s]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function uT(e,t,n,i){e._eventListeners.push({type:n,sources:se(t),handler:i})}function vue(e,t){var n=e._eventConfig.defaults,i=n.prevent,r=n.allow;return i===!1||r===!0?!1:i===!0||r===!1?!0:i?i[t]:r?!r[t]:e.preventDefault()}function n1(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return i===!1||ie(i)&&!i[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function _ue(e,t,n){var i=this,r=new x0(n),s=function(l,c){i.runAsync(null,()=>{e===aT&&vue(i,t)&&l.preventDefault(),r.receive(hue(i,l,c))})},o;if(e===gue)n1(i,"timer",t)&&i.timer(s,t);else if(e===aT)n1(i,"view",t)&&i.addEventListener(t,s,yue);else if(e===mue?n1(i,"window",t)&&typeof window<"u"&&(o=[window]):typeof document<"u"&&n1(i,"selector",t)&&(o=Array.from(document.querySelectorAll(e))),!o)i.warn("Can not resolve event source: "+e);else{for(var a=0,u=o.length;a=0;)t[r].stop();for(r=i.length;--r>=0;)for(o=i[r],s=o.sources.length;--s>=0;)o.sources[s].removeEventListener(o.type,o.handler);for(e&&e.call(this,this._handler,null,null,null),r=n.length;--r>=0;)u=n[r].type,a=n[r].handler,this._handler.off(u,a);return this}function Mi(e,t,n){const i=document.createElement(e);for(const r in t)i.setAttribute(r,t[r]);return n!=null&&(i.textContent=n),i}const kue="vega-bind",Eue="vega-bind-name",Cue="vega-bind-radio";function Aue(e,t,n){if(!t)return;const i=n.param;let r=n.state;return r||(r=n.state={elements:null,active:!1,set:null,update:o=>{o!=e.signal(i.signal)&&e.runAsync(null,()=>{r.source=!0,e.signal(i.signal,o)})}},i.debounce&&(r.update=S2(i.debounce,r.update))),(i.input==null&&i.element?$ue:Fue)(r,t,i,e),r.active||(e.on(e._signals[i.signal],null,()=>{r.source?r.source=!1:r.set(e.signal(i.signal))}),r.active=!0),r}function $ue(e,t,n,i){const r=n.event||"input",s=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,s),uT(i,t,r,s),e.set=o=>{t.value=o,t.dispatchEvent(Sue(r))}}function Sue(e){return typeof Event<"u"?new Event(e):{type:e}}function Fue(e,t,n,i){const r=i.signal(n.signal),s=Mi("div",{class:kue}),o=n.input==="radio"?s:s.appendChild(Mi("label"));o.appendChild(Mi("span",{class:Eue},n.name||n.signal)),t.appendChild(s);let a=Due;switch(n.input){case"checkbox":a=Tue;break;case"select":a=Mue;break;case"radio":a=Nue;break;case"range":a=Rue;break}a(e,o,n,r)}function Due(e,t,n,i){const r=Mi("input");for(const s in n)s!=="signal"&&s!=="element"&&r.setAttribute(s==="input"?"type":s,n[s]);r.setAttribute("name",n.signal),r.value=i,t.appendChild(r),r.addEventListener("input",()=>e.update(r.value)),e.elements=[r],e.set=s=>r.value=s}function Tue(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const s=Mi("input",r);t.appendChild(s),s.addEventListener("change",()=>e.update(s.checked)),e.elements=[s],e.set=o=>s.checked=!!o||null}function Mue(e,t,n,i){const r=Mi("select",{name:n.signal}),s=n.labels||[];n.options.forEach((o,a)=>{const u={value:o};i1(o,i)&&(u.selected=!0),r.appendChild(Mi("option",u,(s[a]||o)+""))}),t.appendChild(r),r.addEventListener("change",()=>{e.update(n.options[r.selectedIndex])}),e.elements=[r],e.set=o=>{for(let a=0,u=n.options.length;a{const u={type:"radio",name:n.signal,value:o};i1(o,i)&&(u.checked=!0);const l=Mi("input",u);l.addEventListener("change",()=>e.update(o));const c=Mi("label",{},(s[a]||o)+"");return c.prepend(l),r.appendChild(c),l}),e.set=o=>{const a=e.elements,u=a.length;for(let l=0;l{u.textContent=a.value,e.update(+a.value)};a.addEventListener("input",l),a.addEventListener("change",l),e.elements=[a],e.set=c=>{a.value=c,u.textContent=c}}function i1(e,t){return e===t||e+""==t+""}function dT(e,t,n,i,r,s){return t=t||new i(e.loader()),t.initialize(n,sT(e),oT(e),t1(e),r,s).background(e.background())}function _7(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function Oue(e,t,n,i){const r=new i(e.loader(),_7(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,t1(e),e);return t&&t.handlers().forEach(s=>{r.on(s.type,s.handler)}),r}function Lue(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,s=Pp(i);e=n._el=e?x7(n,e,!0):null,oue(n),s||n.error("Unrecognized renderer type: "+i);const o=s.handler||Hf,a=e?s.renderer:s.headless;return n._renderer=a?dT(n,n._renderer,e,a):null,n._handler=Oue(n,n._handler,e,o),n._redraw=!0,e&&r!=="none"&&(t=t?n._elBind=x7(n,t,!0):e.appendChild(Mi("form",{class:"vega-bindings"})),n._bind.forEach(u=>{u.param.element&&r!=="container"&&(u.element=x7(n,u.param.element,!!u.param.input))}),n._bind.forEach(u=>{Aue(n,u.element||t,u)})),n}function x7(e,t,n){if(typeof t=="string")if(typeof document<"u"){if(t=document.querySelector(t),!t)return e.error("Signal bind element not found: "+t),null}else return e.error("DOM document instance not found."),null;if(t&&n)try{t.textContent=""}catch(i){t=null,e.error(i)}return t}const Od=e=>+e||0,Iue=e=>({top:e,bottom:e,left:e,right:e});function hT(e){return ie(e)?{top:Od(e.top),bottom:Od(e.bottom),left:Od(e.left),right:Od(e.right)}:Iue(Od(e))}async function w7(e,t,n,i){const r=Pp(t),s=r&&r.headless;return s||W("Unrecognized renderer type: "+t),await e.runAsync(),dT(e,null,null,s,n,i).renderAsync(e._scenegraph.root)}async function Pue(e,t){e!==Yo.Canvas&&e!==Yo.SVG&&e!==Yo.PNG&&W("Unrecognized image type: "+e);const n=await w7(this,e,t);return e===Yo.SVG?zue(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function zue(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function Bue(e,t){return(await w7(this,Yo.Canvas,e,t)).canvas()}async function jue(e){return(await w7(this,Yo.SVG,e)).svg()}function Uue(e,t,n){return tT(e,xl,Nd,n).parse(t)}function que(e){var t=this._runtime.scales;return ue(t,e)||W("Unrecognized scale or projection: "+e),t[e].value}var pT="width",gT="height",k7="padding",mT={skip:!0};function yT(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===k7?i.left+i.right:0)}function bT(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===k7?i.top+i.bottom:0)}function Wue(e){var t=e._signals,n=t[pT],i=t[gT],r=t[k7];function s(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,a=>{e._width=a.size,e._viewWidth=yT(e,a.size),s()},{size:n}),e._resizeHeight=e.add(null,a=>{e._height=a.size,e._viewHeight=bT(e,a.size),s()},{size:i});const o=e.add(null,s,{pad:r});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=i.rank+1,o.rank=r.rank+1}function Hue(e,t,n,i,r,s){this.runAfter(o=>{let a=0;o._autosize=0,o.width()!==n&&(a=1,o.signal(pT,n,mT),o._resizeWidth.skip(!0)),o.height()!==i&&(a=1,o.signal(gT,i,mT),o._resizeHeight.skip(!0)),o._viewWidth!==e&&(o._resize=1,o._viewWidth=e),o._viewHeight!==t&&(o._resize=1,o._viewHeight=t),(o._origin[0]!==r[0]||o._origin[1]!==r[1])&&(o._resize=1,o._origin=r),a&&o.run("enter"),s&&o.runAfter(u=>u.resize())},!1,1)}function Gue(e){return this._runtime.getState(e||{data:Vue,signals:Yue,recurse:!0})}function Vue(e,t){return t.modified&&G(t.input.value)&&!e.startsWith("_:vega:_")}function Yue(e,t){return!(e==="parent"||t instanceof xl.proxy)}function Xue(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function Zue(e,t){function n(i){e({timestamp:Date.now(),elapsed:i})}this._timers.push(_ne(n,t))}function Kue(e,t,n,i){const r=e.element();r&&r.setAttribute("title",Jue(i))}function Jue(e){return e==null?"":G(e)?vT(e):ie(e)&&!ko(e)?Que(e):e+""}function Que(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(G(n)?vT(n):_T(n))}).join(` -`)}function vT(e){return"["+e.map(_T).join(", ")+"]"}function _T(e){return G(e)?"[…]":ie(e)&&!ko(e)?"{…}":e}function ele(){if(this.renderer()==="canvas"&&this._renderer._canvas){let e=null;const t=()=>{e!=null&&e();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",t),e=()=>{n.removeEventListener("change",t)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};t()}}function xT(e,t){const n=this;if(t=t||{},_l.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),t.logLevel!=null&&n.logLevel(t.logLevel),t.locale||e.locale){const s=Be({},e.locale,t.locale);n.locale(xk(s.number,s.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||Yo.Canvas,n._scenegraph=new wA;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||Kue,n._redraw=!0,n._handler=new Hf().scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=bue(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=Uue(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map(s=>({state:null,param:Be({},s)})),r.root&&r.root.set(i),i.source=r.data.root.input,n.pulse(r.data.root.input,n.changeset().insert(i.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=yT(n,n._width),n._viewHeight=bT(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,Wue(n),aue(n),uue(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function r1(e,t){return ue(e._signals,t)?e._signals[t]:W("Unrecognized signal name: "+ee(t))}function wT(e,t){const n=(e._targets||[]).filter(i=>i._update&&i._update.handler===t);return n.length?n[0]:null}function kT(e,t,n,i){let r=wT(n,i);return r||(r=_7(e,()=>i(t,n.value)),r.handler=i,e.on(n,null,r)),e}function ET(e,t,n){const i=wT(t,n);return i&&t._targets.remove(i),e}te(xT,_l,{async evaluate(e,t,n){if(await _l.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,due(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return n&&m0(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=e!=null?e+"":null;return t!==this._desc&&rT(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const i=r1(this,e);return arguments.length===1?i.value:this.update(i,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",hT(e)):hT(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(Pp(e)||W("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(_l.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(r1(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:Hue,addEventListener(e,t,n){let i=t;return n&&n.trap===!1||(i=_7(this,t),i.raw=t),this._handler.on(e,i),this},removeEventListener(e,t){for(var n=this._handler.handlers(e),i=n.length,r,s;--i>=0;)if(s=n[i].type,r=n[i].handler,e===s&&(t===r||t===r.raw)){this._handler.off(s,r);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.includes(e)||t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return kT(this,e,r1(this,e),t)},removeSignalListener(e,t){return ET(this,r1(this,e),t)},addDataListener(e,t){return kT(this,e,Qg(this,e).values,t)},removeDataListener(e,t){return ET(this,Qg(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=v7(this,null);this._globalCursor=!!e,t&&v7(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:Zue,events:_ue,finalize:wue,hover:xue,data:lue,change:e1,insert:cue,remove:fue,scale:que,initialize:Lue,toImageURL:Pue,toCanvas:Bue,toSVG:jue,getState:Gue,setState:Xue,_watchPixelRatio:ele});const tle="view",s1="[",o1="]",CT="{",AT="}",nle=":",$T=",",ile="@",rle=">",sle=/[[\]{}]/,ole={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let ST,FT;function ia(e,t,n){return ST=t||tle,FT=n||ole,DT(e.trim()).map(E7)}function ale(e){return FT[e]}function Ld(e,t,n,i,r){const s=e.length;let o=0,a;for(;t=0?--o:i&&i.indexOf(a)>=0&&++o}return t}function DT(e){const t=[],n=e.length;let i=0,r=0;for(;r' after between selector: "+e;i=i.map(E7);const r=E7(e.slice(1).trim());return r.between?{between:i,stream:r}:(r.between=i,r)}function lle(e){const t={source:ST},n=[];let i=[0,0],r=0,s=0,o=e.length,a=0,u,l;if(e[o-1]===AT){if(a=e.lastIndexOf(CT),a>=0){try{i=cle(e.substring(a+1,o-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,a).trim(),o=e.length}else throw"Unmatched right brace: "+e;a=0}if(!o)throw e;if(e[0]===ile&&(r=++a),u=Ld(e,a,nle),u1?(t.type=n[1],r?t.markname=n[0].slice(1):ale(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)==="!"&&(t.consume=!0,t.type=t.type.slice(0,-1)),l!=null&&(t.filter=l),i[0]&&(t.throttle=i[0]),i[1]&&(t.debounce=i[1]),t}function cle(e){const t=e.split($T);if(!e.length||t.length>2)throw e;return t.map(n=>{const i=+n;if(i!==i)throw e;return i})}function fle(e){return ie(e)?e:{type:e||"pad"}}const Id=e=>+e||0,dle=e=>({top:e,bottom:e,left:e,right:e});function hle(e){return ie(e)?e.signal?e:{top:Id(e.top),bottom:Id(e.bottom),left:Id(e.left),right:Id(e.right)}:dle(Id(e))}const nn=e=>ie(e)&&!G(e)?Be({},e):{value:e};function TT(e,t,n,i){return n!=null?(ie(n)&&!G(n)||G(n)&&n.length&&ie(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1):0}function gn(e,t,n){for(const i in t)TT(e,i,t[i]);for(const i in n)TT(e,i,n[i],"update")}function ec(e,t,n){for(const i in t)n&&ue(n,i)||(e[i]=Be(e[i]||{},t[i]));return e}function tc(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const C7="mark",A7="frame",$7="scope",ple="axis",gle="axis-domain",mle="axis-grid",yle="axis-label",ble="axis-tick",vle="axis-title",_le="legend",xle="legend-band",wle="legend-entry",kle="legend-gradient",MT="legend-label",Ele="legend-symbol",Cle="legend-title",Ale="title",$le="title-text",Sle="title-subtitle";function Fle(e,t,n,i,r){const s={},o={};let a,u,l,c;u="lineBreak",t==="text"&&r[u]!=null&&!tc(u,e)&&S7(s,u,r[u]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),c=n===A7?r.group:n===C7?Be({},r.mark,r[t]):null;for(u in c)l=tc(u,e)||(u==="fill"||u==="stroke")&&(tc("fill",e)||tc("stroke",e)),l||S7(s,u,c[u]);se(i).forEach(f=>{const d=r.style&&r.style[f];for(const h in d)tc(h,e)||S7(s,h,d[h])}),e=Be({},e);for(u in s)c=s[u],c.signal?(a=a||{})[u]=c:o[u]=c;return e.enter=Be(o,e.enter),a&&(e.update=Be(a,e.update)),e}function S7(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const NT=e=>re(e)?ee(e):e.signal?`(${e.signal})`:RT(e);function a1(e){if(e.gradient!=null)return Tle(e);let t=e.signal?`(${e.signal})`:e.color?Dle(e.color):e.field!=null?RT(e.field):e.value!==void 0?ee(e.value):void 0;return e.scale!=null&&(t=Mle(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${l1(e.exponent)})`),e.mult!=null&&(t+=`*${l1(e.mult)}`),e.offset!=null&&(t+=`+${l1(e.offset)}`),e.round&&(t=`round(${t})`),t}const u1=(e,t,n,i)=>`(${e}(${[t,n,i].map(a1).join(",")})+'')`;function Dle(e){return e.c?u1("hcl",e.h,e.c,e.l):e.h||e.s?u1("hsl",e.h,e.s,e.l):e.l||e.a?u1("lab",e.l,e.a,e.b):e.r||e.g||e.b?u1("rgb",e.r,e.g,e.b):null}function Tle(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:ee(n));for(;t.length&&Ye(t)==null;)t.pop();return t.unshift(NT(e.gradient)),`gradient(${t.join(",")})`}function l1(e){return ie(e)?"("+a1(e)+")":e}function RT(e){return OT(ie(e)?e:{datum:e})}function OT(e){let t,n,i;if(e.signal)t="datum",i=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(i=e.parent,t+=".datum"):i=e.group}else e.datum?(t="datum",i=e.datum):W("Invalid field reference: "+ee(e));return e.signal||(i=re(i)?qr(i).map(ee).join("]["):OT(i)),t+"["+i+"]"}function Mle(e,t){const n=NT(e.scale);return e.range!=null?t=`lerp(_range(${n}), ${+e.range})`:(t!==void 0&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(+e.band==1?"":"*"+l1(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function Nle(e){let t="";return e.forEach(n=>{const i=a1(n);t+=n.test?`(${n.test})?${i}:`:i}),Ye(t)===":"&&(t+="null"),t}function LT(e,t,n,i,r,s){const o={};s=s||{},s.encoders={$encode:o},e=Fle(e,t,n,i,r.config);for(const a in e)o[a]=Rle(e[a],t,s,r);return s}function Rle(e,t,n,i){const r={},s={};for(const o in e)e[o]!=null&&(r[o]=Lle(Ole(e[o]),i,n,s));return{$expr:{marktype:t,channels:r},$fields:Object.keys(s),$output:Object.keys(e)}}function Ole(e){return G(e)?Nle(e):a1(e)}function Lle(e,t,n,i){const r=fs(e,t);return r.$fields.forEach(s=>i[s]=1),Be(n,r.$params),r.$expr}const Ile="outer",Ple=["value","update","init","react","bind"];function IT(e,t){W(e+' for "outer" push: '+ee(t))}function PT(e,t){const n=e.name;if(e.push===Ile)t.signals[n]||IT("No prior signal definition",n),Ple.forEach(i=>{e[i]!==void 0&&IT("Invalid property ",i)});else{const i=t.addSignal(n,e.value);e.react===!1&&(i.react=!1),e.bind&&t.addBinding(n,e.bind)}}function F7(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function c1(e,t,n,i){return new F7(e,t,n,i)}function f1(e,t){return c1("operator",e,t)}function Se(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function Pd(e,t){return t?{$field:e,$name:t}:{$field:e}}const D7=Pd("key");function zT(e,t){return{$compare:e,$order:t}}function zle(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const Ble="ascending",jle="descending";function Ule(e){return ie(e)?(e.order===jle?"-":"+")+d1(e.op,e.field):""}function d1(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const T7="scope",M7="view";function Zt(e){return e&&e.signal}function qle(e){return e&&e.expr}function h1(e){if(Zt(e))return!0;if(ie(e)){for(const t in e)if(h1(e[t]))return!0}return!1}function kr(e,t){return e??t}function uu(e){return e&&e.signal||e}const BT="timer";function zd(e,t){return(e.merge?Hle:e.stream?Gle:e.type?Vle:W("Invalid stream specification: "+ee(e)))(e,t)}function Wle(e){return e===T7?M7:e||M7}function Hle(e,t){const n=e.merge.map(r=>zd(r,t)),i=N7({merge:n},e,t);return t.addStream(i).id}function Gle(e,t){const n=zd(e.stream,t),i=N7({stream:n},e,t);return t.addStream(i).id}function Vle(e,t){let n;e.type===BT?(n=t.event(BT,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(Wle(e.source),e.type);const i=N7({stream:n},e,t);return Object.keys(i).length===1?n:t.addStream(i).id}function N7(e,t,n){let i=t.between;return i&&(i.length!==2&&W('Stream "between" parameter must have 2 entries: '+ee(t)),e.between=[zd(i[0],n),zd(i[1],n)]),i=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&i.push(Yle(t.marktype,t.markname,t.markrole)),t.source===T7&&i.push("inScope(event.item)"),i.length&&(e.filter=fs("("+i.join(")&&(")+")",n).$expr),(i=t.throttle)!=null&&(e.throttle=+i),(i=t.debounce)!=null&&(e.debounce=+i),t.consume&&(e.consume=!0),e}function Yle(e,t,n){const i="event.item";return i+(e&&e!=="*"?"&&"+i+".mark.marktype==='"+e+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(t?"&&"+i+".mark.name==='"+t+"'":"")}const Xle={code:"_.$value",ast:{type:"Identifier",value:"value"}};function Zle(e,t,n){const i=e.encode,r={target:n};let s=e.events,o=e.update,a=[];s||W("Signal update missing events specification."),re(s)&&(s=ia(s,t.isSubscope()?T7:M7)),s=se(s).filter(u=>u.signal||u.scale?(a.push(u),0):1),a.length>1&&(a=[Jle(a)]),s.length&&a.push(s.length>1?{merge:s}:s[0]),i!=null&&(o&&W("Signal encode and update are mutually exclusive."),o="encode(item(),"+ee(i)+")"),r.update=re(o)?fs(o,t):o.expr!=null?fs(o.expr,t):o.value!=null?o.value:o.signal!=null?{$expr:Xle,$params:{$value:t.signalRef(o.signal)}}:W("Invalid signal update specification."),e.force&&(r.options={force:!0}),a.forEach(u=>t.addUpdate(Be(Kle(u,t),r)))}function Kle(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):zd(e,t)}}function Jle(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function Qle(e,t){const n=t.getSignal(e.name);let i=e.update;e.init&&(i?W("Signals can not include both init and update expressions."):(i=e.init,n.initonly=!0)),i&&(i=fs(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach(r=>Zle(r,t,n.id))}const ht=e=>(t,n,i)=>c1(e,n,t||void 0,i),jT=ht("aggregate"),ece=ht("axisticks"),UT=ht("bound"),Er=ht("collect"),qT=ht("compare"),tce=ht("datajoin"),WT=ht("encode"),nce=ht("expression"),ice=ht("facet"),rce=ht("field"),sce=ht("key"),oce=ht("legendentries"),ace=ht("load"),uce=ht("mark"),lce=ht("multiextent"),cce=ht("multivalues"),fce=ht("overlap"),dce=ht("params"),HT=ht("prefacet"),hce=ht("projection"),pce=ht("proxy"),gce=ht("relay"),GT=ht("render"),mce=ht("scale"),lu=ht("sieve"),yce=ht("sortitems"),VT=ht("viewlayout"),bce=ht("values");let vce=0;const YT={min:"min",max:"max",count:"sum"};function _ce(e,t){const n=e.type||"linear";y9(n)||W("Unrecognized scale type: "+ee(n)),t.addScale(e.name,{type:n,domain:void 0})}function xce(e,t){const n=t.getScale(e.name).params;let i;n.domain=XT(e.domain,e,t),e.range!=null&&(n.range=KT(e,t,n)),e.interpolate!=null&&Tce(e.interpolate,n),e.nice!=null&&(n.nice=Dce(e.nice,t)),e.bins!=null&&(n.bins=Fce(e.bins,t));for(i in e)ue(n,i)||i==="name"||(n[i]=Ki(e[i],t))}function Ki(e,t){return ie(e)?e.signal?t.signalRef(e.signal):W("Unsupported object: "+ee(e)):e}function p1(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>Ki(n,t))}function g1(e){W("Can not find data set: "+ee(e))}function XT(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&W("No scale domain defined for domainMin/domainMax to override.");return}return e.signal?n.signalRef(e.signal):(G(e)?wce:e.fields?Ece:kce)(e,t,n)}function wce(e,t,n){return e.map(i=>Ki(i,n))}function kce(e,t,n){const i=n.getData(e.data);return i||g1(e.data),Tl(t.type)?i.valuesRef(n,e.field,ZT(e.sort,!1)):_9(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function Ece(e,t,n){const i=e.data,r=e.fields.reduce((s,o)=>(o=re(o)?{data:i,field:o}:G(o)||o.signal?Cce(o,n):o,s.push(o),s),[]);return(Tl(t.type)?Ace:_9(t.type)?$ce:Sce)(e,n,r)}function Cce(e,t){const n="_:vega:_"+vce++,i=Er({});if(G(e))i.value={$ingest:e};else if(e.signal){const r="setdata("+ee(n)+","+e.signal+")";i.params.input=t.signalRef(r)}return t.addDataPipeline(n,[i,lu({})]),{data:n,field:"data"}}function Ace(e,t,n){const i=ZT(e.sort,!0);let r,s;const o=n.map(l=>{const c=t.getData(l.data);return c||g1(l.data),c.countsRef(t,l.field,i)}),a={groupby:D7,pulse:o};i&&(r=i.op||"count",s=i.field?d1(r,i.field):"count",a.ops=[YT[r]],a.fields=[t.fieldRef(s)],a.as=[s]),r=t.add(jT(a));const u=t.add(Er({pulse:Se(r)}));return s=t.add(bce({field:D7,sort:t.sortRef(i),pulse:Se(u)})),Se(s)}function ZT(e,t){return e&&(!e.field&&!e.op?ie(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?W("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!YT[e.op]&&W("Multiple domain scales can not be sorted using "+e.op)),e}function $ce(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||g1(r.data),s.domainRef(t,r.field)});return Se(t.add(cce({values:i})))}function Sce(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||g1(r.data),s.extentRef(t,r.field)});return Se(t.add(lce({extents:i})))}function Fce(e,t){return e.signal||G(e)?p1(e,t):t.objectProperty(e)}function Dce(e,t){return e.signal?t.signalRef(e.signal):ie(e)?{interval:Ki(e.interval),step:Ki(e.step)}:Ki(e)}function Tce(e,t){t.interpolate=Ki(e.type||e),e.gamma!=null&&(t.interpolateGamma=Ki(e.gamma))}function KT(e,t,n){const i=t.config.range;let r=e.range;if(r.signal)return t.signalRef(r.signal);if(re(r)){if(i&&ue(i,r))return e=Be({},e,{range:i[r]}),KT(e,t,n);r==="width"?r=[0,{signal:"width"}]:r==="height"?r=Tl(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:W("Unrecognized scale range value: "+ee(r))}else if(r.scheme){n.scheme=G(r.scheme)?p1(r.scheme,t):Ki(r.scheme,t),r.extent&&(n.schemeExtent=p1(r.extent,t)),r.count&&(n.schemeCount=Ki(r.count,t));return}else if(r.step){n.rangeStep=Ki(r.step,t);return}else{if(Tl(e.type)&&!G(r))return XT(r,e,t);G(r)||W("Unsupported range type: "+ee(r))}return r.map(s=>(G(s)?p1:Ki)(s,t))}function Mce(e,t){const n=t.config.projection||{},i={};for(const r in e)r!=="name"&&(i[r]=R7(e[r],r,t));for(const r in n)i[r]==null&&(i[r]=R7(n[r],r,t));t.addProjection(e.name,i)}function R7(e,t,n){return G(e)?e.map(i=>R7(i,t,n)):ie(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:W("Unsupported parameter object: "+ee(e)):e}const Cr="top",nc="left",ic="right",ra="bottom",JT="center",Nce="vertical",Rce="start",Oce="middle",Lce="end",O7="index",L7="label",Ice="offset",rc="perc",Pce="perc2",Ji="value",Bd="guide-label",I7="guide-title",zce="group-title",Bce="group-subtitle",QT="symbol",m1="gradient",P7="discrete",z7="size",B7=[z7,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],jd={name:1,style:1,interactive:1},Ze={value:0},Qi={value:1},y1="group",eM="rect",j7="rule",jce="symbol",cu="text";function Ud(e){return e.type=y1,e.interactive=e.interactive||!1,e}function pi(e,t){const n=(i,r)=>kr(e[i],kr(t[i],r));return n.isVertical=i=>Nce===kr(e.direction,t.direction||(i?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>kr(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>kr(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>kr(e.columns,kr(t.columns,+n.isVertical(!0))),n}function tM(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function Uce(e,t,n){const i=t.config.style[n];return i&&i[e]}function b1(e,t,n){return`item.anchor === '${Rce}' ? ${e} : item.anchor === '${Lce}' ? ${t} : ${n}`}const U7=b1(ee(nc),ee(ic),ee(JT));function qce(e){const t=e("tickBand");let n=e("tickOffset"),i,r;return t?t.signal?(i={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},r={signal:`(${t.signal}) === 'extent'`},ie(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`})):t==="extent"?(i=1,r=!0,n=0):(i=.5,r=!1):(i=e("bandPosition"),r=e("tickExtra")),{extra:r,band:i,offset:n}}function nM(e,t){return t?e?ie(e)?Object.assign({},e,{offset:nM(e.offset,t)}):{value:e,offset:t}:t:e}function Ni(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=ec(e.encode,t,jd)):e.interactive=!1,e}function Wce(e,t,n,i){const r=pi(e,n),s=r.isVertical(),o=r.gradientThickness(),a=r.gradientLength();let u,l,c,f,d;s?(l=[0,1],c=[0,0],f=o,d=a):(l=[0,0],c=[1,0],f=a,d=o);const h={enter:u={opacity:Ze,x:Ze,y:Ze,width:nn(f),height:nn(d)},update:Be({},u,{opacity:Qi,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:Ze}};return gn(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),Ni({type:eM,role:kle,encode:h},i)}function Hce(e,t,n,i,r){const s=pi(e,n),o=s.isVertical(),a=s.gradientThickness(),u=s.gradientLength();let l,c,f,d,h="";o?(l="y",f="y2",c="x",d="width",h="1-"):(l="x",f="x2",c="y",d="height");const p={opacity:Ze,fill:{scale:t,field:Ji}};p[l]={signal:h+"datum."+rc,mult:u},p[c]=Ze,p[f]={signal:h+"datum."+Pce,mult:u},p[d]=nn(a);const g={enter:p,update:Be({},p,{opacity:Qi}),exit:{opacity:Ze}};return gn(g,{stroke:s("gradientStrokeColor"),strokeWidth:s("gradientStrokeWidth")},{opacity:s("gradientOpacity")}),Ni({type:eM,role:xle,key:Ji,from:r,encode:g},i)}const Gce=`datum.${rc}<=0?"${nc}":datum.${rc}>=1?"${ic}":"${JT}"`,Vce=`datum.${rc}<=0?"${ra}":datum.${rc}>=1?"${Cr}":"${Oce}"`;function iM(e,t,n,i){const r=pi(e,t),s=r.isVertical(),o=nn(r.gradientThickness()),a=r.gradientLength();let u=r("labelOverlap"),l,c,f,d,h="";const p={enter:l={opacity:Ze},update:c={opacity:Qi,text:{field:L7}},exit:{opacity:Ze}};return gn(p,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:kr(e.labelLimit,t.gradientLabelLimit)}),s?(l.align={value:"left"},l.baseline=c.baseline={signal:Vce},f="y",d="x",h="1-"):(l.align=c.align={signal:Gce},l.baseline={value:"top"},f="x",d="y"),l[f]=c[f]={signal:h+"datum."+rc,mult:a},l[d]=c[d]=o,o.offset=kr(e.labelOffset,t.gradientLabelOffset)||0,u=u?{separation:r("labelSeparation"),method:u,order:"datum."+O7}:void 0,Ni({type:cu,role:MT,style:Bd,key:Ji,from:i,encode:p,overlap:u},n)}function Yce(e,t,n,i,r){const s=pi(e,t),o=n.entries,a=!!(o&&o.interactive),u=o?o.name:void 0,l=s("clipHeight"),c=s("symbolOffset"),f={data:"value"},d=`(${r}) ? datum.${Ice} : datum.${z7}`,h=l?nn(l):{field:z7},p=`datum.${O7}`,g=`max(1, ${r})`;let m,y,b,v,_;h.mult=.5,m={enter:y={opacity:Ze,x:{signal:d,mult:.5,offset:c},y:h},update:b={opacity:Qi,x:y.x,y:y.y},exit:{opacity:Ze}};let x=null,k=null;e.fill||(x=t.symbolBaseFillColor,k=t.symbolBaseStrokeColor),gn(m,{fill:s("symbolFillColor",x),shape:s("symbolType"),size:s("symbolSize"),stroke:s("symbolStrokeColor",k),strokeDash:s("symbolDash"),strokeDashOffset:s("symbolDashOffset"),strokeWidth:s("symbolStrokeWidth")},{opacity:s("symbolOpacity")}),B7.forEach(F=>{e[F]&&(b[F]=y[F]={scale:e[F],field:Ji})});const w=Ni({type:jce,role:Ele,key:Ji,from:f,clip:l?!0:void 0,encode:m},n.symbols),E=nn(c);E.offset=s("labelOffset"),m={enter:y={opacity:Ze,x:{signal:d,offset:E},y:h},update:b={opacity:Qi,text:{field:L7},x:y.x,y:y.y},exit:{opacity:Ze}},gn(m,{align:s("labelAlign"),baseline:s("labelBaseline"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontStyle:s("labelFontStyle"),fontWeight:s("labelFontWeight"),limit:s("labelLimit")});const C=Ni({type:cu,role:MT,style:Bd,key:Ji,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!l},width:Ze,height:l?nn(l):Ze,opacity:Ze},exit:{opacity:Ze},update:b={opacity:Qi,row:{signal:null},column:{signal:null}}},s.isVertical(!0)?(v=`ceil(item.mark.items.length / ${g})`,b.row.signal=`${p}%${v}`,b.column.signal=`floor(${p} / ${v})`,_={field:["row",p]}):(b.row.signal=`floor(${p} / ${g})`,b.column.signal=`${p} % ${g}`,_={field:p}),b.column.signal=`(${r})?${b.column.signal}:${p}`,i={facet:{data:i,name:"value",groupby:O7}},Ud({role:$7,from:i,encode:ec(m,o,jd),marks:[w,C],name:u,interactive:a,sort:_})}function Xce(e,t){const n=pi(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const q7='item.orient === "left"',W7='item.orient === "right"',v1=`(${q7} || ${W7})`,Zce=`datum.vgrad && ${v1}`,Kce=b1('"top"','"bottom"','"middle"'),Jce=b1('"right"','"left"','"center"'),Qce=`datum.vgrad && ${W7} ? (${Jce}) : (${v1} && !(datum.vgrad && ${q7})) ? "left" : ${U7}`,efe=`item._anchor || (${v1} ? "middle" : "start")`,tfe=`${Zce} ? (${q7} ? -90 : 90) : 0`,nfe=`${v1} ? (datum.vgrad ? (${W7} ? "bottom" : "top") : ${Kce}) : "top"`;function ife(e,t,n,i){const r=pi(e,t),s={enter:{opacity:Ze},update:{opacity:Qi,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:Ze}};return gn(s,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:efe},angle:{signal:tfe},align:{signal:Qce},baseline:{signal:nfe},text:e.title,fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),baseline:r("titleBaseline")}),Ni({type:cu,role:Cle,style:I7,from:i,encode:s},n)}function rfe(e,t){let n;return ie(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+rM(e.path)+")":e.sphere&&(n="geoShape("+rM(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function rM(e){return ie(e)&&e.signal?e.signal:ee(e)}function sM(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===y1?$7:t||C7}function sfe(e){return{marktype:e.type,name:e.name||void 0,role:e.role||sM(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function ofe(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function H7(e,t){const n=Uk(e.type);n||W("Unrecognized transform type: "+ee(e.type));const i=c1(n.type.toLowerCase(),null,oM(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function oM(e,t,n){const i={},r=e.params.length;for(let s=0;saM(e,s,n)):aM(e,r,n)}function aM(e,t,n){const i=e.type;if(Zt(t))return lM(i)?W("Expression references can not be signals."):G7(i)?n.fieldRef(t):cM(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||G7(i);return r&&cfe(t)?n.exprRef(t.expr,t.as):r&&ffe(t)?Pd(t.field,t.as):lM(i)?fs(t,n):dfe(i)?Se(n.getData(t).values):G7(i)?Pd(t):cM(i)?n.compareRef(t):t}}function ufe(e,t,n){return re(t.from)||W('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function lfe(e,t,n){const i=t[e.name];return e.array?(G(i)||W("Expected an array of sub-parameters. Instead: "+ee(i)),i.map(r=>uM(e,r,n))):uM(e,i,n)}function uM(e,t,n){const i=e.params.length;let r;for(let o=0;oe&&e.expr,ffe=e=>e&&e.field,dfe=e=>e==="data",lM=e=>e==="expr",G7=e=>e==="field",cM=e=>e==="compare";function hfe(e,t,n){let i,r,s,o,a;return e?(i=e.facet)&&(t||W("Only group marks can be faceted."),i.field!=null?o=a=_1(i,n):(e.data?a=Se(n.getData(e.data).aggregate):(s=H7(Be({type:"aggregate",groupby:se(i.groupby)},i.aggregate),n),s.params.key=n.keyRef(i.groupby),s.params.pulse=_1(i,n),o=a=Se(n.add(s))),r=n.keyRef(i.groupby,!0))):o=Se(n.add(Er(null,[{}]))),o||(o=_1(e,n)),{key:r,pulse:o,parent:a}}function _1(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:Se(t.getData(e.data).output)}function fu(e,t,n,i,r){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=r,this.index={}}fu.fromEntries=function(e,t){const n=t.length,i=t[n-1],r=t[n-2];let s=t[0],o=null,a=1;for(s&&s.type==="load"&&(s=t[1]),e.add(t[0]);af??"null").join(",")+"),0)",c=fs(l,t);u.update=c.$expr,u.params=c.$params}function x1(e,t){const n=sM(e),i=e.type===y1,r=e.from&&e.from.facet,s=e.overlap;let o=e.layout||n===$7||n===A7,a,u,l,c,f,d,h;const p=n===C7||o||r,g=hfe(e.from,i,t);u=t.add(tce({key:g.key||(e.key?Pd(e.key):void 0),pulse:g.pulse,clean:!i}));const m=Se(u);u=l=t.add(Er({pulse:m})),u=t.add(uce({markdef:sfe(e),interactive:ofe(e.interactive,t),clip:rfe(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:Se(u)}));const y=Se(u);u=c=t.add(WT(LT(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),u.params.parent=t.encode(),e.transform&&e.transform.forEach(k=>{const w=H7(k,t),E=w.metadata;(E.generates||E.changes)&&W("Mark transforms should not generate new data."),E.nomod||(c.params.mod=!0),w.params.pulse=Se(u),t.add(u=w)}),e.sort&&(u=t.add(yce({sort:t.compareRef(e.sort),pulse:Se(u)})));const b=Se(u);(r||o)&&(o=t.add(VT({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:b})),d=Se(o));const v=t.add(UT({mark:y,pulse:d||b}));h=Se(v),i&&(p&&(a=t.operators,a.pop(),o&&a.pop()),t.pushState(b,d||h,m),r?pfe(e,t,g):p?gfe(e,t,g):t.parse(e),t.popState(),p&&(o&&a.push(o),a.push(v))),s&&(h=mfe(s,h,t));const _=t.add(GT({pulse:h})),x=t.add(lu({pulse:Se(_)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new fu(t,l,_,x)),e.on&&e.on.forEach(k=>{(k.insert||k.remove||k.toggle)&&W("Marks only support modify triggers."),hM(k,t,f)}))}function mfe(e,t,n){const i=e.method,r=e.bound,s=e.separation,o={separation:Zt(s)?n.signalRef(s.signal):s,method:Zt(i)?n.signalRef(i.signal):i,pulse:t};if(e.order&&(o.sort=n.compareRef({field:e.order})),r){const a=r.tolerance;o.boundTolerance=Zt(a)?n.signalRef(a.signal):+a,o.boundScale=n.scaleRef(r.scale),o.boundOrient=r.orient}return Se(n.add(fce(o)))}function yfe(e,t){const n=t.config.legend,i=e.encode||{},r=pi(e,n),s=i.legend||{},o=s.name||void 0,a=s.interactive,u=s.style,l={};let c=0,f,d,h;B7.forEach(v=>e[v]?(l[v]=e[v],c=c||e[v]):0),c||W("Missing valid scale for legend.");const p=bfe(e,t.scaleType(c)),g={title:e.title!=null,scales:l,type:p,vgrad:p!=="symbol"&&r.isVertical()},m=Se(t.add(Er(null,[g]))),y={enter:{x:{value:0},y:{value:0}}},b=Se(t.add(oce(d={type:p,scale:t.scaleRef(c),count:t.objectProperty(r("tickCount")),limit:t.property(r("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===m1?(h=[Wce(e,c,n,i.gradient),iM(e,n,i.labels,b)],d.count=d.count||t.signalRef(`max(2,2*floor((${uu(r.gradientLength())})/100))`)):p===P7?h=[Hce(e,c,n,i.gradient,b),iM(e,n,i.labels,b)]:(f=Xce(e,n),h=[Yce(e,n,i,b,uu(f.columns))],d.size=xfe(e,t,h[0].marks)),h=[Ud({role:wle,from:m,encode:y,marks:h,layout:f,interactive:a})],g.title&&h.push(ife(e,n,i.title,m)),x1(Ud({role:_le,from:m,encode:ec(_fe(r,e,n),s,jd),marks:h,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:o,interactive:a,style:u}),t)}function bfe(e,t){let n=e.type||QT;return!e.type&&vfe(e)===1&&(e.fill||e.stroke)&&(n=Qb(t)?m1:e3(t)?P7:QT),n!==m1?n:e3(t)?P7:m1}function vfe(e){return B7.reduce((t,n)=>t+(e[n]?1:0),0)}function _fe(e,t,n){const i={enter:{},update:{}};return gn(i,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),i}function xfe(e,t,n){const i=uu(pM("size",e,n)),r=uu(pM("strokeWidth",e,n)),s=uu(wfe(n[1].encode,t,Bd));return fs(`max(ceil(sqrt(${i})+${r}),${s})`,t)}function pM(e,t,n){return t[e]?`scale("${t[e]}",datum)`:tM(e,n[0].encode)}function wfe(e,t,n){return tM("fontSize",e)||Uce("fontSize",t,n)}const kfe=`item.orient==="${nc}"?-90:item.orient==="${ic}"?90:0`;function Efe(e,t){e=re(e)?{text:e}:e;const n=pi(e,t.config.title),i=e.encode||{},r=i.group||{},s=r.name||void 0,o=r.interactive,a=r.style,u=[],l={},c=Se(t.add(Er(null,[l])));return u.push($fe(e,n,Cfe(e),c)),e.subtitle&&u.push(Sfe(e,n,i.subtitle,c)),x1(Ud({role:Ale,from:c,encode:Afe(n,r),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:s,interactive:o,style:a}),t)}function Cfe(e){const t=e.encode;return t&&t.title||Be({name:e.name,interactive:e.interactive,style:e.style},t)}function Afe(e,t){const n={enter:{},update:{}};return gn(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:U7},angle:{signal:kfe},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),ec(n,t,jd)}function $fe(e,t,n,i){const r={value:0},s=e.text,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return gn(o,{text:s,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),Ni({type:cu,role:$le,style:zce,from:i,encode:o},n)}function Sfe(e,t,n,i){const r={value:0},s=e.subtitle,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return gn(o,{text:s,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),Ni({type:cu,role:Sle,style:Bce,from:i,encode:o},n)}function Ffe(e,t){const n=[];e.transform&&e.transform.forEach(i=>{n.push(H7(i,t))}),e.on&&e.on.forEach(i=>{hM(i,t,e.name)}),t.addDataPipeline(e.name,Dfe(e,t,n))}function Dfe(e,t,n){const i=[];let r=null,s=!1,o=!1,a,u,l,c,f;for(e.values?Zt(e.values)||h1(e.format)?(i.push(gM(t,e)),i.push(r=du())):i.push(r=du({$ingest:e.values,$format:e.format})):e.url?h1(e.url)||h1(e.format)?(i.push(gM(t,e)),i.push(r=du())):i.push(r=du({$request:e.url,$format:e.format})):e.source&&(r=a=se(e.source).map(d=>Se(t.getData(d).output)),i.push(null)),u=0,l=n.length;ue===ra||e===Cr,w1=(e,t,n)=>Zt(e)?Rfe(e.signal,t,n):e===nc||e===Cr?t:n,rn=(e,t,n)=>Zt(e)?Mfe(e.signal,t,n):mM(e)?t:n,Ar=(e,t,n)=>Zt(e)?Nfe(e.signal,t,n):mM(e)?n:t,yM=(e,t,n)=>Zt(e)?Ofe(e.signal,t,n):e===Cr?{value:t}:{value:n},Tfe=(e,t,n)=>Zt(e)?Lfe(e.signal,t,n):e===ic?{value:t}:{value:n},Mfe=(e,t,n)=>bM(`${e} === '${Cr}' || ${e} === '${ra}'`,t,n),Nfe=(e,t,n)=>bM(`${e} !== '${Cr}' && ${e} !== '${ra}'`,t,n),Rfe=(e,t,n)=>V7(`${e} === '${nc}' || ${e} === '${Cr}'`,t,n),Ofe=(e,t,n)=>V7(`${e} === '${Cr}'`,t,n),Lfe=(e,t,n)=>V7(`${e} === '${ic}'`,t,n),bM=(e,t,n)=>(t=t!=null?nn(t):t,n=n!=null?nn(n):n,vM(t)&&vM(n)?(t=t?t.signal||ee(t.value):null,n=n?n.signal||ee(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[Be({test:e},t)].concat(n||[])),vM=e=>e==null||Object.keys(e).length===1,V7=(e,t,n)=>({signal:`${e} ? (${sc(t)}) : (${sc(n)})`}),Ife=(e,t,n,i,r)=>({signal:(i!=null?`${e} === '${nc}' ? (${sc(i)}) : `:"")+(n!=null?`${e} === '${ra}' ? (${sc(n)}) : `:"")+(r!=null?`${e} === '${ic}' ? (${sc(r)}) : `:"")+(t!=null?`${e} === '${Cr}' ? (${sc(t)}) : `:"")+"(null)"}),sc=e=>Zt(e)?e.signal:e==null?null:ee(e),Pfe=(e,t)=>t===0?0:Zt(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},oc=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function ac(e,t,n,i){let r;if(t&&ue(t,e))return t[e];if(ue(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=e[5].toLowerCase()+e.slice(6)}return i[I7][r]}else if(e.startsWith("label")){switch(e){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=e[5].toLowerCase()+e.slice(6)}return i[Bd][r]}return null}function _M(e){const t={};for(const n of e)if(n)for(const i in n)t[i]=1;return Object.keys(t)}function zfe(e,t){var n=t.config,i=n.style,r=n.axis,s=t.scaleType(e.scale)==="band"&&n.axisBand,o=e.orient,a,u,l;if(Zt(o)){const f=_M([n.axisX,n.axisY]),d=_M([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(l of f)a[l]=rn(o,ac(l,n.axisX,r,i),ac(l,n.axisY,r,i));u={};for(l of d)u[l]=Ife(o.signal,ac(l,n.axisTop,r,i),ac(l,n.axisBottom,r,i),ac(l,n.axisLeft,r,i),ac(l,n.axisRight,r,i))}else a=o===Cr||o===ra?n.axisX:n.axisY,u=n["axis"+o[0].toUpperCase()+o.slice(1)];return a||u||s?Be({},r,a,u,s):r}function Bfe(e,t,n,i){const r=pi(e,t),s=e.orient;let o,a;const u={enter:o={opacity:Ze},update:a={opacity:Qi},exit:{opacity:Ze}};gn(u,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const l=xM(e,0),c=xM(e,1);return o.x=a.x=rn(s,l,Ze),o.x2=a.x2=rn(s,c),o.y=a.y=Ar(s,l,Ze),o.y2=a.y2=Ar(s,c),Ni({type:j7,role:gle,from:i,encode:u},n)}function xM(e,t){return{scale:e.scale,range:t}}function jfe(e,t,n,i,r){const s=pi(e,t),o=e.orient,a=e.gridScale,u=w1(o,1,-1),l=Ufe(e.offset,u);let c,f,d;const h={enter:c={opacity:Ze},update:d={opacity:Qi},exit:f={opacity:Ze}};gn(h,{stroke:s("gridColor"),strokeCap:s("gridCap"),strokeDash:s("gridDash"),strokeDashOffset:s("gridDashOffset"),strokeOpacity:s("gridOpacity"),strokeWidth:s("gridWidth")});const p={scale:e.scale,field:Ji,band:r.band,extra:r.extra,offset:r.offset,round:s("tickRound")},g=rn(o,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:u,offset:l}:{value:0,offset:l},y=a?{scale:a,range:1,mult:u,offset:l}:Be(g,{mult:u,offset:l});return c.x=d.x=rn(o,p,m),c.y=d.y=Ar(o,p,m),c.x2=d.x2=Ar(o,y),c.y2=d.y2=rn(o,y),f.x=rn(o,p),f.y=Ar(o,p),Ni({type:j7,role:mle,key:Ji,from:i,encode:h},n)}function Ufe(e,t){if(t!==1)if(!ie(e))e=Zt(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=Be({},e);for(;n.mult!=null;)if(ie(n.mult))n=n.mult=Be({},n.mult);else return n.mult=Zt(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function qfe(e,t,n,i,r,s){const o=pi(e,t),a=e.orient,u=w1(a,-1,1);let l,c,f;const d={enter:l={opacity:Ze},update:f={opacity:Qi},exit:c={opacity:Ze}};gn(d,{stroke:o("tickColor"),strokeCap:o("tickCap"),strokeDash:o("tickDash"),strokeDashOffset:o("tickDashOffset"),strokeOpacity:o("tickOpacity"),strokeWidth:o("tickWidth")});const h=nn(r);h.mult=u;const p={scale:e.scale,field:Ji,band:s.band,extra:s.extra,offset:s.offset,round:o("tickRound")};return f.y=l.y=rn(a,Ze,p),f.y2=l.y2=rn(a,h),c.x=rn(a,p),f.x=l.x=Ar(a,Ze,p),f.x2=l.x2=Ar(a,h),c.y=Ar(a,p),Ni({type:j7,role:ble,key:Ji,from:i,encode:d},n)}function Y7(e,t,n,i,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}function Wfe(e,t,n,i,r,s){const o=pi(e,t),a=e.orient,u=e.scale,l=w1(a,-1,1),c=uu(o("labelFlush")),f=uu(o("labelFlushOffset")),d=o("labelAlign"),h=o("labelBaseline");let p=c===0||!!c,g;const m=nn(r);m.mult=l,m.offset=nn(o("labelPadding")||0),m.offset.mult=l;const y={scale:u,field:Ji,band:.5,offset:nM(s.offset,o("labelOffset"))},b=rn(a,p?Y7(u,c,'"left"','"right"','"center"'):{value:"center"},Tfe(a,"left","right")),v=rn(a,yM(a,"bottom","top"),p?Y7(u,c,'"top"','"bottom"','"middle"'):{value:"middle"}),_=Y7(u,c,`-(${f})`,f,0);p=p&&f;const x={opacity:Ze,x:rn(a,y,m),y:Ar(a,y,m)},k={enter:x,update:g={opacity:Qi,text:{field:L7},x:x.x,y:x.y,align:b,baseline:v},exit:{opacity:Ze,x:x.x,y:x.y}};gn(k,{dx:!d&&p?rn(a,_):null,dy:!h&&p?Ar(a,_):null}),gn(k,{angle:o("labelAngle"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontWeight:o("labelFontWeight"),fontStyle:o("labelFontStyle"),limit:o("labelLimit"),lineHeight:o("labelLineHeight")},{align:d,baseline:h});const w=o("labelBound");let E=o("labelOverlap");return E=E||w?{separation:o("labelSeparation"),method:E,order:"datum.index",bound:w?{scale:u,orient:a,tolerance:w}:null}:void 0,g.align!==b&&(g.align=oc(g.align,b)),g.baseline!==v&&(g.baseline=oc(g.baseline,v)),Ni({type:cu,role:yle,style:Bd,key:Ji,from:i,encode:k,overlap:E},n)}function Hfe(e,t,n,i){const r=pi(e,t),s=e.orient,o=w1(s,-1,1);let a,u;const l={enter:a={opacity:Ze,anchor:nn(r("titleAnchor",null)),align:{signal:U7}},update:u=Be({},a,{opacity:Qi,text:nn(e.title)}),exit:{opacity:Ze}},c={signal:`lerp(range("${e.scale}"), ${b1(0,1,.5)})`};return u.x=rn(s,c),u.y=Ar(s,c),a.angle=rn(s,Ze,Pfe(o,90)),a.baseline=rn(s,yM(s,ra,Cr),{value:ra}),u.angle=a.angle,u.baseline=a.baseline,gn(l,{fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),angle:r("titleAngle"),baseline:r("titleBaseline")}),Gfe(r,s,l,n),l.update.align=oc(l.update.align,a.align),l.update.angle=oc(l.update.angle,a.angle),l.update.baseline=oc(l.update.baseline,a.baseline),Ni({type:cu,role:vle,style:I7,from:i,encode:l},n)}function Gfe(e,t,n,i){const r=(a,u)=>a!=null?(n.update[u]=oc(nn(a),n.update[u]),!1):!tc(u,i),s=r(e("titleX"),"x"),o=r(e("titleY"),"y");n.enter.auto=o===s?nn(o):rn(t,nn(o),nn(s))}function Vfe(e,t){const n=zfe(e,t),i=e.encode||{},r=i.axis||{},s=r.name||void 0,o=r.interactive,a=r.style,u=pi(e,n),l=qce(u),c={scale:e.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:e.title!=null},f=Se(t.add(Er({},[c]))),d=Se(t.add(ece({scale:t.scaleRef(e.scale),extra:t.property(l.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let p;return c.grid&&h.push(jfe(e,n,i.grid,d,l)),c.ticks&&(p=u("tickSize"),h.push(qfe(e,n,i.ticks,d,p,l))),c.labels&&(p=c.ticks?p:0,h.push(Wfe(e,n,i.labels,d,p,l))),c.domain&&h.push(Bfe(e,n,i.domain,f)),c.title&&h.push(Hfe(e,n,i.title,f)),x1(Ud({role:ple,from:f,encode:ec(Yfe(u,e),r,jd),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:s,interactive:o,style:a}),t)}function Yfe(e,t){const n={enter:{},update:{}};return gn(n,{orient:e("orient"),offset:e("offset")||0,position:kr(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function wM(e,t,n){const i=se(e.signals),r=se(e.scales);return n||i.forEach(s=>PT(s,t)),se(e.projections).forEach(s=>Mce(s,t)),r.forEach(s=>_ce(s,t)),se(e.data).forEach(s=>Ffe(s,t)),r.forEach(s=>xce(s,t)),(n||i).forEach(s=>Qle(s,t)),se(e.axes).forEach(s=>Vfe(s,t)),se(e.marks).forEach(s=>x1(s,t)),se(e.legends).forEach(s=>yfe(s,t)),e.title&&Efe(e.title,t),t.parseLambdas(),t}const Xfe=e=>ec({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function Zfe(e,t){const n=t.config,i=Se(t.root=t.add(f1())),r=Kfe(e,n);r.forEach(l=>PT(l,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const s=t.add(Er()),o=t.add(WT(LT(Xfe(e.encode),y1,A7,e.style,t,{pulse:Se(s)}))),a=t.add(VT({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:Se(o)}));t.operators.pop(),t.pushState(Se(o),Se(a),null),wM(e,t,r),t.operators.push(a);let u=t.add(UT({mark:i,pulse:Se(a)}));return u=t.add(GT({pulse:Se(u)})),u=t.add(lu({pulse:Se(u)})),t.addData("root",new fu(t,s,s,u)),t}function Wd(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function Kfe(e,t){const n=o=>kr(e[o],t[o]),i=[Wd("background",n("background")),Wd("autosize",fle(n("autosize"))),Wd("padding",hle(n("padding"))),Wd("width",n("width")||0),Wd("height",n("height")||0)],r=i.reduce((o,a)=>(o[a.name]=a,o),{}),s={};return se(e.signals).forEach(o=>{ue(r,o.name)?o=Be(r[o.name],o):i.push(o),s[o.name]=o}),se(t.signals).forEach(o=>{!ue(s,o.name)&&!ue(r,o.name)&&i.push(o)}),i}function kM(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function EM(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}kM.prototype=EM.prototype={parse(e){return wM(e,this)},fork(){return new EM(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach(t=>{t.$ref=e.id}),e.refs=null),e},proxy(e){const t=e instanceof F7?Se(e):e;return this.add(pce({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;this.root&&(this.root.root=!0);for(e in this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(i,r,s){let o,a;i&&(o=i.data||(i.data={}),a=o[r]||(o[r]=[]),a.push(s))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const i in t.index)n(t.index[i],e,"index:"+i)}return this},pushState(e,t,n){this._encode.push(Se(this.add(lu({pulse:e})))),this._parent.push(t),this._lookup.push(n?Se(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return Ye(this._parent)},encode(){return Ye(this._encode)},lookup(){return Ye(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(re(e))return Pd(e,t);e.signal||W("Unsupported field reference: "+ee(e));const n=e.signal;let i=this.field[n];if(!i){const r={name:this.signalRef(n)};t&&(r.as=t),this.field[n]=i=Se(this.add(rce(r)))}return i},compareRef(e){let t=!1;const n=s=>Zt(s)?(t=!0,this.signalRef(s.signal)):qle(s)?(t=!0,this.exprRef(s.expr)):s,i=se(e.field).map(n),r=se(e.order).map(n);return t?Se(this.add(qT({fields:i,orders:r}))):zT(i,r)},keyRef(e,t){let n=!1;const i=s=>Zt(s)?(n=!0,Se(r[s.signal])):s,r=this.signals;return e=se(e).map(i),n?Se(this.add(sce({fields:e,flat:t}))):zle(e,t)},sortRef(e){if(!e)return e;const t=d1(e.op,e.field),n=e.order||Ble;return n.signal?Se(this.add(qT({fields:t,orders:this.signalRef(n.signal)}))):zT(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:e,type:t}),this.events[n]=i}return this.events[n]},hasOwnSignal(e){return ue(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&W("Duplicate signal name: "+ee(e));const n=t instanceof F7?t:this.add(f1(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||W("Unrecognized signal name: "+ee(e)),this.signals[e]},signalRef(e){return this.signals[e]?Se(this.signals[e]):(ue(this.lambdas,e)||(this.lambdas[e]=this.add(f1(null))),Se(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t0?",":"")+(ie(r)?r.signal||X7(r):ee(r))}return n+"]"}function Qfe(e){let t="{",n=0,i,r;for(i in e)r=e[i],t+=(++n>1?",":"")+ee(i)+":"+(ie(r)?r.signal||X7(r):ee(r));return t+"}"}function ede(){const e="sans-serif",i="#4c78a8",r="#000",s="#888",o="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:i},area:{fill:i},image:null,line:{stroke:i,strokeWidth:2},path:{stroke:i},rect:{fill:i},rule:{stroke:r},shape:{stroke:i},symbol:{fill:i,size:64},text:{fill:r,font:e,fontSize:11},trail:{fill:i,size:2},style:{"guide-label":{fill:r,font:e,fontSize:10},"guide-title":{fill:r,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:r,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:r,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:o},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:s,grid:!1,gridWidth:1,gridColor:o,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:s,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:o,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:s,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function tde(e,t,n){return ie(e)||W("Input Vega specification must be an object."),t=il(ede(),t,e.config),Zfe(e,new kM(t,n)).toRuntime()}var nde="5.33.0";Be(xl,rY,RQ,see,Wte,Pne,fre,Wie,hre,Ire,Vre,ese);const ide=Object.freeze(Object.defineProperty({__proto__:null,Bounds:qt,CanvasHandler:Hf,CanvasRenderer:Rp,DATE:ui,DAY:Fn,DAYOFYEAR:Vr,Dataflow:_l,Debug:N4,Error:x2,EventStream:x0,Gradient:P9,GroupItem:cp,HOURS:Ai,Handler:L3,HybridHandler:QA,HybridRenderer:Y3,Info:M4,Item:lp,MILLISECONDS:dr,MINUTES:$i,MONTH:Sn,Marks:Fi,MultiPulse:yy,None:T4,Operator:xt,Parameters:_0,Pulse:To,QUARTER:ai,RenderType:Yo,Renderer:qf,ResourceLoader:X9,SECONDS:qi,SVGHandler:RA,SVGRenderer:V3,SVGStringRenderer:JA,Scenegraph:wA,TIME_UNITS:Y2,Transform:j,View:xT,WEEK:Gt,Warn:w2,YEAR:fn,accessor:si,accessorFields:En,accessorName:Rt,array:se,ascending:sl,bandwidthNRD:xy,bin:Hk,bootstrapCI:Gk,boundClip:l$,boundContext:Lf,boundItem:R3,boundMark:bA,boundStroke:js,changeset:So,clampRange:H4,codegenExpression:TD,compare:$2,constant:$n,cumulativeLogNormal:$y,cumulativeNormal:C0,cumulativeUniform:Ty,dayofyear:T8,debounce:S2,defaultLocale:cy,definition:Uk,densityLogNormal:Ay,densityNormal:wy,densityUniform:Dy,domChild:Yt,domClear:Vi,domCreate:Go,domFind:O3,dotbin:Vk,error:W,expressionFunction:Bt,extend:Be,extent:Wr,extentIndex:G4,falsy:xo,fastmap:ol,field:Bi,flush:V4,font:kp,fontFamily:jf,fontSize:is,format:h0,formatLocale:f0,formats:py,hasOwnProperty:ue,id:Vc,identity:Cn,inferType:Ek,inferTypes:Ck,ingest:it,inherits:te,inrange:al,interpolate:t3,interpolateColors:rp,interpolateRange:x9,intersect:s$,intersectBoxLine:Ol,intersectPath:v3,intersectPoint:_3,intersectRule:iA,isArray:G,isBoolean:wo,isDate:ko,isFunction:ze,isIterable:Y4,isNumber:Je,isObject:ie,isRegExp:F2,isString:re,isTuple:y0,key:D2,lerp:X4,lineHeight:Wo,loader:p0,locale:xk,logger:k2,lruCache:Z4,markup:G3,merge:K4,mergeConfig:il,multiLineOffset:T3,one:nl,pad:J4,panLinear:z4,panLog:B4,panPow:j4,panSymlog:U4,parse:tde,parseExpression:SD,parseSelector:ia,path:M0,pathCurves:a3,pathEqual:c$,pathParse:Ml,pathRectangle:H9,pathRender:Tf,pathSymbols:W9,pathTrail:G9,peek:Ye,point:Cp,projection:Hv,quantileLogNormal:Sy,quantileNormal:A0,quantileUniform:My,quantiles:vy,quantizeInterpolator:w9,quarter:q4,quartiles:_y,get random(){return Wi},randomInteger:uV,randomKDE:Ey,randomLCG:aV,randomLogNormal:Xk,randomMixture:Zk,randomNormal:ky,randomUniform:Kk,read:Fk,regressionConstant:Ny,regressionExp:Qk,regressionLinear:Ry,regressionLoess:rE,regressionLog:Jk,regressionPoly:tE,regressionPow:eE,regressionQuad:Oy,renderModule:Pp,repeat:Yc,resetDefaultLocale:rG,resetSVGClipId:Y9,resetSVGDefIds:JJ,responseType:Sk,runtimeContext:tT,sampleCurve:S0,sampleLogNormal:Cy,sampleNormal:E0,sampleUniform:Fy,scale:et,sceneEqual:Z3,sceneFromJSON:_A,scenePickVisit:yp,sceneToJSON:vA,sceneVisit:mr,sceneZOrder:x3,scheme:n3,serializeXML:HA,setHybridRendererOptions:YJ,setRandom:sV,span:Xc,splitAccessPath:qr,stringValue:ee,textMetrics:Si,timeBin:Z8,timeFloor:P8,timeFormatLocale:df,timeInterval:ml,timeOffset:j8,timeSequence:W8,timeUnitSpecifier:D8,timeUnits:Z2,toBoolean:T2,toDate:M2,toNumber:An,toSet:fr,toString:N2,transform:qk,transforms:xl,truncate:Q4,truthy:ji,tupleid:Ae,typeParsers:fy,utcFloor:z8,utcInterval:yl,utcOffset:U8,utcSequence:H8,utcdayofyear:R8,utcquarter:W4,utcweek:O8,version:nde,visitArray:Eo,week:M8,writeConfig:rl,zero:_o,zoomLinear:E2,zoomLog:C2,zoomPow:Kh,zoomSymlog:A2},Symbol.toStringTag,{value:"Module"}));function rde(e,t,n){let i;t.x2&&(t.x?(n&&e.x>e.x2&&(i=e.x,e.x=e.x2,e.x2=i),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(i=e.y,e.y=e.y2,e.y2=i),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}var sde={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},ode={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>ee<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},ade={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const ude=Array.prototype.slice,hu=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,ude.call(t,1))},lde=(e,t,n,i,r,s,o)=>new Date(e,t||0,n??1,i||0,r||0,s||0,o||0);var cde={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:lde,date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return hu("join",arguments)},indexof:function(){return hu("indexOf",arguments)},lastindexof:function(){return hu("lastIndexOf",arguments)},slice:function(){return hu("slice",arguments)},reverse:e=>e.slice().reverse(),sort:e=>e.slice().sort(sl),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return hu("substring",arguments,String)},split:function(){return hu("split",arguments,String)},replace:function(){return hu("replace",arguments,String)},trim:e=>String(e).trim(),btoa:e=>btoa(e),atob:e=>atob(e),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const fde=["view","item","group","xy","x","y"],Z7=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&Z7.add(setImmediate);const dde={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:n==="datum"?e.datum:n==="event"?e.event:n==="item"?e.item:sde[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,i=e(t.object);n&&(e.memberDepth+=1);const r=e(t.property);if(n&&(e.memberDepth-=1),Z7.has(i[r])){console.error(`Prevented interpretation of member "${r}" which could lead to insecure code execution`);return}return i[r]},CallExpression:(e,t)=>{const n=t.arguments;let i=t.callee.name;return i.startsWith("_")&&(i=i.slice(1)),i==="if"?e(n[0])?e(n[1]):e(n[2]):(e.fn[i]||cde[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>ode[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>ade[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>t.operator==="&&"?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce((n,i)=>{e.memberDepth+=1;const r=e(i.key);return e.memberDepth-=1,Z7.has(e(i.value))?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):n[r]=e(i.value),n},{})};function Hd(e,t,n,i,r,s){const o=a=>dde[a.type](o,a);return o.memberDepth=0,o.fn=Object.create(t),o.params=n,o.datum=i,o.event=r,o.item=s,fde.forEach(a=>o.fn[a]=function(){return r.vega[a](...arguments)}),o(e)}var hde={operator(e,t){const n=t.ast,i=e.functions;return r=>Hd(n,i,r)},parameter(e,t){const n=t.ast,i=e.functions;return(r,s)=>Hd(n,i,s,r)},event(e,t){const n=t.ast,i=e.functions;return r=>Hd(n,i,void 0,void 0,r)},handler(e,t){const n=t.ast,i=e.functions;return(r,s)=>{const o=s.item&&s.item.datum;return Hd(n,i,r,o,s)}},encode(e,t){const{marktype:n,channels:i}=t,r=e.functions,s=n==="group"||n==="image"||n==="rect";return(o,a)=>{const u=o.datum;let l=0,c;for(const f in i)c=Hd(i[f].ast,r,a,u,void 0,o),o[f]!==c&&(o[f]=c,l=1);return n!=="rule"&&rde(o,i,s),l}}};const pde={version:"5.23.0"};function K7(e){return Z(e,"or")}function J7(e){return Z(e,"and")}function Q7(e){return Z(e,"not")}function k1(e,t){if(Q7(e))k1(e.not,t);else if(J7(e))for(const n of e.and)k1(n,t);else if(K7(e))for(const n of e.or)k1(n,t);else t(e)}function uc(e,t){return Q7(e)?{not:uc(e.not,t)}:J7(e)?{and:e.and.map(n=>uc(n,t))}:K7(e)?{or:e.or.map(n=>uc(n,t))}:t(e)}const Re=structuredClone;function CM(e){throw new Error(e)}function lc(e,t){const n={};for(const i of t)ue(e,i)&&(n[i]=e[i]);return n}function gi(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>gt(e)).join(",")})`};function Ve(e){if(Je(e))return e;const t=re(e)?e:gt(e);if(t.length<250)return t;let n=0;for(let i=0;ia===0?o:`[${o}]`),s=r.map((o,a)=>r.slice(0,a+1).join(""));for(const o of s)t.add(o)}return t}function rx(e,t){return e===void 0||t===void 0?!0:nx(ix(e),ix(t))}function pt(e){return Y(e).length===0}const Y=Object.keys,mn=Object.values,sa=Object.entries;function Gd(e){return e===!0||e===!1}function St(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function Vd(e,t){return Q7(e)?`!(${Vd(e.not,t)})`:J7(e)?`(${e.and.map(n=>Vd(n,t)).join(") && (")})`:K7(e)?`(${e.or.map(n=>Vd(n,t)).join(") || (")})`:t(e)}function E1(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&E1(e[n],t)&&delete e[n],pt(e)}function Yd(e){return e.charAt(0).toUpperCase()+e.substr(1)}function sx(e,t="datum"){const n=qr(e),i=[];for(let r=1;r<=n.length;r++){const s=`[${n.slice(0,r).map(ee).join("][")}]`;i.push(`${t}${s}`)}return i.join(" && ")}function SM(e,t="datum"){return`${t}[${ee(qr(e).join("."))}]`}function lt(e){return`datum['${e.replaceAll("'","\\'")}']`}function yde(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function er(e){return`${qr(e).map(yde).join("\\.")}`}function pu(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function fc(e){return`${qr(e).join(".")}`}function dc(e){return e?qr(e).length:0}function jt(...e){return e.find(t=>t!==void 0)}let FM=42;function DM(e){const t=++FM;return e?String(e)+t:t}function bde(){FM=42}function TM(e){return MM(e)?e:`__${e}`}function MM(e){return e.startsWith("__")}function Xd(e){if(e!==void 0)return(e%360+360)%360}function C1(e){return Je(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const NM=Object.getPrototypeOf(structuredClone({}));function Ri(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor.name!==t.constructor.name)return!1;let n,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!Ri(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const s of e.entries())if(!t.has(s[0]))return!1;for(const s of e.entries())if(!Ri(s[1],t.get(s[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e.entries())if(!t.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(e[i]!==t[i])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf!==NM.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==NM.toString)return e.toString()===t.toString();const r=Object.keys(e);if(n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!Ri(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function gt(e){const t=[];return function n(i){if(i&&i.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i===void 0)return;if(typeof i=="number")return isFinite(i)?""+i:"null";if(typeof i!="object")return JSON.stringify(i);let r,s;if(Array.isArray(i)){for(s="[",r=0;rN1(e[t])?St(`_${t}_${sa(e[t])}`):St(`_${t}_${e[t]}`)).join("")}function wt(e){return e===!0||bu(e)&&!e.binned}function yn(e){return e==="binned"||bu(e)&&e.binned===!0}function bu(e){return ie(e)}function N1(e){return Z(e,"param")}function VM(e){switch(e){case Js:case Qs:case no:case mi:case ps:case gs:case ca:case io:case ua:case la:case yi:return 6;case fa:return 4;default:return 10}}function Qd(e){return Z(e,"expr")}function bn(e,{level:t}={level:0}){const n=Y(e||{}),i={};for(const r of n)i[r]=t===0?Oi(e[r]):bn(e[r],{level:t-1});return i}function YM(e){const{anchor:t,frame:n,offset:i,orient:r,angle:s,limit:o,color:a,subtitleColor:u,subtitleFont:l,subtitleFontSize:c,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...g}=e,m={...g,...a?{fill:a}:{}},y={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...s!==void 0?{angle:s}:{},...o!==void 0?{limit:o}:{}},b={...u?{subtitleColor:u}:{},...l?{subtitleFont:l}:{},...c?{subtitleFontSize:c}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}},v=lc(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:v,nonMarkTitleProperties:y,subtitle:b}}function pa(e){return re(e)||G(e)&&re(e[0])}function be(e){return Z(e,"signal")}function vu(e){return Z(e,"step")}function qde(e){return G(e)?!1:Z(e,"fields")&&!Z(e,"data")}function Wde(e){return G(e)?!1:Z(e,"fields")&&Z(e,"data")}function oo(e){return G(e)?!1:Z(e,"field")&&Z(e,"data")}const Hde=Y({aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1}),Gde={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},yx=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"];function XM(e){const t=G(e.condition)?e.condition.map(ZM):ZM(e.condition);return{...Oi(e),condition:t}}function Oi(e){if(Qd(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function ZM(e){if(Qd(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function Et(e){if(Qd(e)){const{expr:t,...n}=e;return{signal:t,...n}}return be(e)?e:e!==void 0?{value:e}:void 0}function Vde(e){return be(e)?e.signal:ee(e)}function KM(e){return be(e)?e.signal:ee(e.value)}function Mr(e){return be(e)?e.signal:e==null?null:ee(e)}function Yde(e,t,n){for(const i of n){const r=bs(i,t.markDef,t.config);r!==void 0&&(e[i]=Et(r))}return e}function JM(e){return[].concat(e.type,e.style??[])}function mt(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:s}=i;return r&&Z(t,r)?t[r]:t[e]!==void 0?t[e]:s&&(!r||r===e)?void 0:bs(e,t,n,i)}function bs(e,t,n,{vgChannel:i}={}){const r=bx(e,t,n.style);return jt(i?r:void 0,r,i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function bx(e,t,n){return QM(e,JM(t),n)}function QM(e,t,n){t=se(t);let i;for(const r of t){const s=n[r];Z(s,e)&&(i=s[e])}return i}function eN(e,t){return se(e).reduce((n,i)=>(n.field.push(ne(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function tN(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(Ri(r,i))return;n.push(i)}),n}function nN(e,t){return Ri(e,t)||!t?e:e?[...se(e),...se(t)].join(", "):t}function iN(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((pa(n)||be(n))&&(pa(i)||be(i)))return{explicit:e.explicit,value:nN(n,i)};if(pa(n)||be(n))return{explicit:e.explicit,value:n};if(pa(i)||be(i))return{explicit:e.explicit,value:i};if(!pa(n)&&!be(n)&&!pa(i)&&!be(i))return{explicit:e.explicit,value:tN(n,i)};throw new Error("It should never reach here")}function vx(e){return`Invalid specification ${gt(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const Xde='Autosize "fit" only works for single views and layered views.';function rN(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function sN(e){const t=e=="width"?"Width":"Height",n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function oN(e){return e?`Dropping "fit-${e}" because spec has discrete ${bi(e)}.`:'Dropping "fit" because spec has discrete size.'}function _x(e){return`Unknown field for ${e}. Cannot calculate view size.`}function aN(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function Zde(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function Kde(e){return`The "nearest" transform is not supported for ${e} marks.`}function uN(e){return`Selection not supported for ${e} yet.`}function Jde(e){return`Cannot find a selection named "${e}".`}const Qde="Scale bindings are currently only supported for scales with unbinned, continuous domains.",ehe="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",the="Legend bindings are only supported for selections over an individual field or encoding channel.";function nhe(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function ihe(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const rhe="The same selection must be used to override scale domains in a layered view.",she='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function ohe(e){return`Unknown repeated value "${e}".`}function lN(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const ahe="Multiple timer selections in one unit spec are not supported. Ignoring all but the first.",xx="Animation involving facet, layer, or concat is currently unsupported.";function uhe(e){return`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${ee(e)}.`}function lhe(e,t,n,i){return(e.length?"Multiple ":"No ")+`matching ${ee(t)} encoding found for selection ${ee(n.param)}. Using "field": ${ee(i)}.`}const che="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function fhe(e){return`Unrecognized parse "${e}".`}function cN(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const dhe="Attempt to add the same child twice.";function hhe(e){return`Ignoring an invalid transform: ${gt(e)}.`}const phe='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function fN(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function ghe(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${gt(t)} is overridden by a child projection ${gt(n)}.`}const mhe="Arc marks uses theta channel rather than angle, replacing angle with theta.";function yhe(e){return`${e}Offset dropped because ${e} is continuous`}function bhe(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${gt(n)}}.`}function dN(e){return`Invalid field type "${e}".`}function vhe(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function _he(e){return`Invalid aggregation operator "${e}".`}function hN(e,t){const{fill:n,stroke:i}=t;return`Dropping color ${e} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`}function xhe(e){return`Position range does not support relative band size for ${e}.`}function wx(e,t){return`Dropping ${gt(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const whe="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function R1(e,t,n){return`${e} dropped as it is incompatible with "${t}".`}function khe(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function Ehe(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function Che(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function Ahe(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function kx(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function $he(e){return`The ${e} for range marks cannot be an expression`}function She(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function Fhe(e,t){return`Specified orient "${e}" overridden with "${t}".`}function Dhe(e){return`Cannot use the scale property "${e}" with non-color channel.`}function The(e){return`Cannot use the relative band size with ${e} scale.`}function Mhe(e){return`Using unaggregated domain with raw field has no effect (${gt(e)}).`}function Nhe(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function Rhe(e){return`Unaggregated domain is currently unsupported for log scale (${gt(e)}).`}function Ohe(e){return`Cannot apply size to non-oriented mark "${e}".`}function Lhe(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function Ihe(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function pN(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function gN(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function Phe(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${gt(n)} and ${gt(i)}). Using ${gt(n)}.`}function zhe(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${gt(n)} and ${gt(i)}). Using the union of the two domains.`}function Bhe(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function jhe(e){return`Dropping sort property ${gt(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const mN="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",Uhe="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",qhe="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",Whe="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function Hhe(e){return`Cannot stack "${e}" if there is already "${e}2".`}function Ghe(e){return`Stack is applied to a non-linear scale (${e}).`}function Vhe(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function O1(e,t){return`Invalid ${e}: ${gt(t)}.`}function Yhe(e){return`Dropping day from datetime ${gt(e)} as day cannot be combined with other units.`}function Xhe(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function Zhe(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function Khe(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function yN(e){return`1D error band does not support ${e}.`}function bN(e){return`Channel ${e} is required for "binned" bin.`}function Jhe(e){return`Channel ${e} should not be used with "binned" bin.`}function Qhe(e){return`Domain for ${e} is required for threshold scale.`}const vN=k2(w2);let _u=vN;function e0e(e){return _u=e,_u}function t0e(){return _u=vN,_u}function Ex(...e){_u.error(...e)}function K(...e){_u.warn(...e)}function n0e(...e){_u.debug(...e)}function xu(e){if(e&&ie(e)){for(const t of Ax)if(Z(e,t))return!0}return!1}const _N=["january","february","march","april","may","june","july","august","september","october","november","december"],i0e=_N.map(e=>e.substr(0,3)),xN=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],r0e=xN.map(e=>e.substr(0,3));function s0e(e){if(C1(e)&&(e=+e),Je(e))return e>4&&K(O1("quarter",e)),e-1;throw new Error(O1("quarter",e))}function o0e(e){if(C1(e)&&(e=+e),Je(e))return e-1;{const t=e.toLowerCase(),n=_N.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=i0e.indexOf(i);if(r!==-1)return r;throw new Error(O1("month",e))}}function a0e(e){if(C1(e)&&(e=+e),Je(e))return e%7;{const t=e.toLowerCase(),n=xN.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=r0e.indexOf(i);if(r!==-1)return r;throw new Error(O1("day",e))}}function Cx(e,t){const n=[];if(t&&e.day!==void 0&&Y(e).length>1&&(K(Yhe(e)),e=Re(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const i=t?o0e(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?s0e(e.quarter):e.quarter;n.push(Je(i)?i*3:`${i}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){const i=t?a0e(e.day):e.day;n.push(Je(i)?i+1:`${i}+1`)}else n.push(1);for(const i of["hours","minutes","seconds","milliseconds"]){const r=e[i];n.push(typeof r>"u"?0:r)}return n}function wu(e){const n=Cx(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function u0e(e){const n=Cx(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function l0e(e){const t=Cx(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const wN={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},Ax=Y(wN);function c0e(e){return ue(wN,e)}function ku(e){return ie(e)?e.binned:kN(e)}function kN(e){return e&&e.startsWith("binned")}function $x(e){return e.startsWith("utc")}function f0e(e){return e.substring(3)}const d0e={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function L1(e){return Ax.filter(t=>CN(e,t))}function EN(e){const t=L1(e);return t[t.length-1]}function CN(e,t){const n=e.indexOf(t);return!(n<0||n>0&&t==="seconds"&&e.charAt(n-1)==="i"||e.length>n+3&&t==="day"&&e.charAt(n+3)==="o"||n>0&&t==="year"&&e.charAt(n-1)==="f")}function h0e(e,t,{end:n}={end:!1}){const i=sx(t),r=$x(e)?"utc":"";function s(u){return u==="quarter"?`(${r}quarter(${i})-1)`:`${r}${u}(${i})`}let o;const a={};for(const u of Ax)CN(e,u)&&(a[u]=s(u),o=u);return n&&(a[o]+="+1"),u0e(a)}function AN(e){if(!e)return;const t=L1(e);return`timeUnitSpecifier(${gt(t)}, ${gt(d0e)})`}function p0e(e,t,n){if(!e)return;const i=AN(e);return`${n||$x(e)?"utc":"time"}Format(${t}, ${i})`}function on(e){if(!e)return;let t;return re(e)?kN(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:ie(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),$x(t.unit)&&(t.utc=!0,t.unit=f0e(t.unit)),t}function g0e(e){const{utc:t,...n}=on(e);return n.unit?(t?"utc":"")+Y(n).map(i=>St(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):(t?"utc":"")+"timeunit"+Y(n).map(i=>St(`_${i}_${n[i]}`)).join("")}function $N(e,t=n=>n){const n=on(e),i=EN(n.unit);if(i&&i!=="day"){const r={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:s,part:o}=SN(i,n.step),a={...r,[o]:+r[o]+s};return`${t(wu(a))} - ${t(wu(r))}`}}const m0e={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function y0e(e){return ue(m0e,e)}function SN(e,t=1){if(y0e(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:t*3};case"week":return{part:"date",step:t*7}}}function b0e(e){return Z(e,"param")}function Sx(e){return!!(e!=null&&e.field)&&e.equal!==void 0}function Fx(e){return!!(e!=null&&e.field)&&e.lt!==void 0}function Dx(e){return!!(e!=null&&e.field)&&e.lte!==void 0}function Tx(e){return!!(e!=null&&e.field)&&e.gt!==void 0}function Mx(e){return!!(e!=null&&e.field)&&e.gte!==void 0}function Nx(e){if(e!=null&&e.field){if(G(e.range)&&e.range.length===2)return!0;if(be(e.range))return!0}return!1}function Rx(e){return!!(e!=null&&e.field)&&(G(e.oneOf)||G(e.in))}function v0e(e){return!!(e!=null&&e.field)&&e.valid!==void 0}function FN(e){return Rx(e)||Sx(e)||Nx(e)||Fx(e)||Tx(e)||Dx(e)||Mx(e)}function vs(e,t){return J1(e,{timeUnit:t,wrapTime:!0})}function _0e(e,t){return e.map(n=>vs(n,t))}function DN(e,t=!0){const{field:n}=e,i=on(e.timeUnit),{unit:r,binned:s}=i||{},o=ne(e,{expr:"datum"}),a=r?`time(${s?o:h0e(r,n)})`:o;if(Sx(e))return`${a}===${vs(e.equal,r)}`;if(Fx(e)){const u=e.lt;return`${a}<${vs(u,r)}`}else if(Tx(e)){const u=e.gt;return`${a}>${vs(u,r)}`}else if(Dx(e)){const u=e.lte;return`${a}<=${vs(u,r)}`}else if(Mx(e)){const u=e.gte;return`${a}>=${vs(u,r)}`}else{if(Rx(e))return`indexof([${_0e(e.oneOf,r).join(",")}], ${a}) !== -1`;if(v0e(e))return I1(a,e.valid);if(Nx(e)){const{range:u}=bn(e),l=be(u)?{signal:`${u.signal}[0]`}:u[0],c=be(u)?{signal:`${u.signal}[1]`}:u[1];if(l!==null&&c!==null&&t)return"inrange("+a+", ["+vs(l,r)+", "+vs(c,r)+"])";const f=[];return l!==null&&f.push(`${a} >= ${vs(l,r)}`),c!==null&&f.push(`${a} <= ${vs(c,r)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${gt(e)}`)}function I1(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function x0e(e){return FN(e)&&e.timeUnit?{...e,timeUnit:on(e.timeUnit)}:e}const eh={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function w0e(e){return e==="quantitative"||e==="temporal"}function TN(e){return e==="ordinal"||e==="nominal"}const Eu=eh.quantitative,Ox=eh.ordinal,mc=eh.temporal,Lx=eh.nominal,yc=eh.geojson;function k0e(e){if(e)switch(e=e.toLowerCase(),e){case"q":case Eu:return"quantitative";case"t":case mc:return"temporal";case"o":case Ox:return"ordinal";case"n":case Lx:return"nominal";case yc:return"geojson"}}const vn={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",TIME:"time",UTC:"utc",POINT:"point",BAND:"band"},Ix={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function E0e(e,t){const n=Ix[e],i=Ix[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const C0e={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function MN(e){return C0e[e]}const NN=new Set(["linear","log","pow","sqrt","symlog"]),RN=new Set([...NN,"time","utc"]);function ON(e){return NN.has(e)}const LN=new Set(["quantile","quantize","threshold"]),A0e=new Set([...RN,...LN,"sequential","identity"]),$0e=new Set(["ordinal","bin-ordinal","point","band"]);function an(e){return $0e.has(e)}function Nr(e){return A0e.has(e)}function _s(e){return RN.has(e)}function bc(e){return LN.has(e)}const S0e={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0,framesPerSecond:2,animationDuration:5};function F0e(e){return!re(e)&&Z(e,"name")}function IN(e){return Z(e,"param")}function D0e(e){return Z(e,"unionWith")}function T0e(e){return ie(e)&&"field"in e}const M0e={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:twe,domain:nwe,range:iwe,rangeMax:rwe,rangeMin:swe,scheme:owe,...N0e}=M0e,R0e=Y(N0e);function Px(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return _s(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return _s(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return _s(e);case"nice":return _s(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return Nr(e)&&!He(["log","time","utc","threshold","quantile"],e)}}function PN(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return gc(e)?void 0:Dhe(t);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function O0e(e,t){return He([Ox,Lx],t)?e===void 0||an(e):t===mc?He([vn.TIME,vn.UTC,void 0],e):t===Eu?ON(e)||bc(e)||e===void 0:!0}function L0e(e,t,n=!1){if(!ys(e))return!1;switch(e){case Ft:case sn:case oa:case hc:case tr:case Sr:return _s(t)||t==="band"?!0:t==="point"?!n:!1;case aa:return He(["linear","band"],t);case no:case ca:case io:case ua:case la:case gu:return _s(t)||bc(t)||He(["band","point","ordinal"],t);case mi:case ps:case gs:return t!=="band";case fa:case yi:return t==="ordinal"||bc(t)}}function I0e(e){return ie(e)&&"value"in e}const ni={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},zN=ni.arc,P1=ni.area,z1=ni.bar,P0e=ni.image,B1=ni.line,j1=ni.point,z0e=ni.rect,U1=ni.rule,BN=ni.text,zx=ni.tick,B0e=ni.trail,Bx=ni.circle,jx=ni.square,jN=ni.geoshape;function ga(e){return["line","area","trail"].includes(e)}function th(e){return["rect","bar","image","arc","tick"].includes(e)}const j0e=new Set(Y(ni));function xs(e){return Z(e,"type")}const U0e=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],q0e=["fill","fillOpacity"],W0e=[...U0e,...q0e],UN=Y({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1}),Ux=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],H0e={area:["line","point"],bar:Ux,rect:Ux,line:["point"],tick:["bandSize","thickness",...Ux]},G0e={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},qN=Y({mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1});function Cu(e){return Z(e,"band")}const V0e={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},qx={binSpacing:0,continuousBandSize:5,minBandSize:.25,timeUnitBandPosition:.5},Y0e={...qx,binSpacing:1},X0e={...qx,thickness:1};function Z0e(e){return xs(e)?e.type:e}function WN(e,{isPath:t}){return e===void 0||e==="break-paths-show-path-domains"?t?"break-paths-show-domains":"filter":e===null?"show":e}function Wx({markDef:e,config:t,scaleChannel:n,scaleType:i,isCountAggregate:r}){var a,u;if(!i||!Nr(i)||r)return"always-valid";const s=WN(mt("invalid",e,t),{isPath:ga(e.type)});return((u=(a=t.scale)==null?void 0:a.invalid)==null?void 0:u[n])!==void 0?"show":s}function K0e(e){return e==="break-paths-filter-domains"||e==="break-paths-show-domains"}function HN({scaleName:e,scale:t,mode:n}){const i=`domain('${e}')`;if(!t||!e)return;const r=`${i}[0]`,s=`peek(${i})`,o=t.domainHasZero();return o==="definitely"?{scale:e,value:0}:o==="maybe"?{signal:`scale('${e}', inrange(0, ${i}) ? 0 : ${n==="zeroOrMin"?r:s})`}:{signal:`scale('${e}', ${n==="zeroOrMin"?r:s})`}}function GN({scaleChannel:e,channelDef:t,scale:n,scaleName:i,markDef:r,config:s}){var c;const o=n==null?void 0:n.get("type"),a=Lr(t),u=M1(a==null?void 0:a.aggregate),l=Wx({scaleChannel:e,markDef:r,config:s,scaleType:o,isCountAggregate:u});if(a&&l==="show"){const f=((c=s.scale.invalid)==null?void 0:c[e])??"zero-or-min";return{test:I1(ne(a,{expr:"datum"}),!1),...J0e(f,n,i)}}}function J0e(e,t,n){if(I0e(e)){const{value:i}=e;return be(i)?{signal:i.signal}:{value:i}}return HN({scale:t,scaleName:n,mode:"zeroOrMin"})}function Hx(e){const{channel:t,channelDef:n,markDef:i,scale:r,scaleName:s,config:o}=e,a=yu(t),u=Gx(e),l=GN({scaleChannel:a,channelDef:n,scale:r,scaleName:s,markDef:i,config:o});return l!==void 0?[l,u]:u}function Q0e(e){const{datum:t}=e;return xu(t)?wu(t):`${gt(t)}`}function Au(e,t,n,i){const r={};if(t&&(r.scale=t),ws(e)){const{datum:s}=e;xu(s)?r.signal=wu(s):be(s)?r.signal=s.signal:Qd(s)?r.signal=s.expr:r.value=s}else r.field=ne(e,n);if(i){const{offset:s,band:o}=i;s&&(r.offset=s),o&&(r.band=o)}return r}function q1({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,endSuffix:s="end",bandPosition:o=.5}){const a=!be(o)&&0{switch(t.fieldTitle){case"plain":return e.field;case"functional":return ppe(e);default:return hpe(e,t)}};let lR=uR;function cR(e){lR=e}function gpe(){cR(uR)}function xc(e,t,{allowDisabling:n,includeDefault:i=!0}){var a;const r=(a=Kx(e))==null?void 0:a.title;if(!J(e))return r??e.title;const s=e,o=i?Jx(s,t):void 0;return n?jt(r,s.title,o):r??s.title??o}function Kx(e){if(_c(e)&&e.axis)return e.axis;if(oR(e)&&e.legend)return e.legend;if(Xx(e)&&e.header)return e.header}function Jx(e,t){return lR(e,t)}function X1(e){if(aR(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=Kx(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function mpe(e,t){var s;switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(Zx(e)&&G(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!ha(n)&&!so(n))return"quantitative";if(Su(e)&&((s=e.scale)!=null&&s.type))switch(Ix[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function Lr(e){if(J(e))return e;if(G1(e))return e.condition}function Kt(e){if(Le(e))return e;if(oh(e))return e.condition}function fR(e,t,n,i={}){if(re(e)||Je(e)||wo(e)){const r=re(e)?"string":Je(e)?"number":"boolean";return K(bhe(t,r,e)),{value:e}}return Le(e)?Z1(e,t,n,i):oh(e)?{...e,condition:Z1(e.condition,t,n,i)}:e}function Z1(e,t,n,i){if(aR(e)){const{format:r,formatType:s,...o}=e;if($u(s)&&!n.customFormatTypes)return K(fN(t)),Z1(o,t,n,i)}else{const r=_c(e)?"axis":oR(e)?"legend":Xx(e)?"header":null;if(r&&e[r]){const{format:s,formatType:o,...a}=e[r];if($u(o)&&!n.customFormatTypes)return K(fN(t)),Z1({...e,[r]:a},t,n,i)}}return J(e)?Qx(e,t,i):ype(e)}function ype(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=Je(n)?"quantitative":re(n)?"nominal":xu(n)?"temporal":void 0,{...e,type:t}}function Qx(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:s,field:o}=e,a={...e};if(!n&&i&&!mx(i)&&!ha(i)&&!so(i)&&(K(_he(i)),delete a.aggregate),r&&(a.timeUnit=on(r)),o&&(a.field=`${o}`),wt(s)&&(a.bin=K1(s,t)),yn(s)&&!Ut(t)&&K(Jhe(t)),ii(a)){const{type:u}=a,l=k0e(u);u!==l&&(a.type=l),u!=="quantitative"&&M1(i)&&(K(vhe(u,i)),a.type="quantitative")}else if(!BM(t)){const u=mpe(a,t);a.type=u}if(ii(a)){const{compatible:u,warning:l}=bpe(a,t)||{};u===!1&&K(l)}if(Zx(a)&&re(a.sort)){const{sort:u}=a;if(QN(u))return{...a,sort:{encoding:u}};const l=u.substring(1);if(u.charAt(0)==="-"&&QN(l))return{...a,sort:{encoding:l,order:"descending"}}}if(Xx(a)){const{header:u}=a;if(u){const{orient:l,...c}=u;if(l)return{...a,header:{...c,labelOrient:u.labelOrient||l,titleOrient:u.titleOrient||l}}}}return a}function K1(e,t){return wo(e)?{maxbins:VM(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:VM(t)}:e}const wc={compatible:!0};function bpe(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case Js:case Qs:case A1:return Y1(e)?wc:{compatible:!1,warning:Ehe(t)};case Ft:case sn:case oa:case hc:case mi:case ps:case gs:case Zd:case Kd:case $1:case mu:case S1:case F1:case gu:case tr:case Sr:case D1:return wc;case Dr:case nr:case Fr:case Tr:return n!==Eu?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:wc;case io:case ua:case la:case ca:case no:case to:case eo:case $r:case hs:case aa:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:wc;case yi:case fa:return!Y1(e)&&!fpe(e)?{compatible:!1,warning:Che(t)}:wc;case pc:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:wc}}function kc(e){const{formatType:t}=X1(e);return t==="time"||!t&&vpe(e)}function vpe(e){return e&&(e.type==="temporal"||J(e)&&!!e.timeUnit)}function J1(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){var u;const s=t&&((u=on(t))==null?void 0:u.unit);let o=s||n==="temporal",a;return Qd(e)?a=e.expr:be(e)?a=e.signal:xu(e)?(o=!0,a=wu(e)):(re(e)||Je(e))&&o&&(a=`datetime(${gt(e)})`,c0e(s)&&(Je(e)&&e<1e4||re(e)&&isNaN(Date.parse(e)))&&(a=wu({[s]:e}))),a?i&&o?`time(${a})`:a:r?void 0:gt(e)}function dR(e,t){const{type:n}=e;return t.map(i=>{const r=J(e)&&!ku(e.timeUnit)?e.timeUnit:void 0,s=J1(i,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return s!==void 0?{signal:s}:i})}function ah(e,t){return wt(e.bin)?ys(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const hR={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function uh(e){return e==null?void 0:e.condition}const pR=["domain","grid","labels","ticks","title"],_pe={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},gR={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},xpe={...gR,style:1,labelExpr:1,encoding:1};function mR(e){return ue(xpe,e)}const yR=Y({axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1});function uo(e){return Z(e,"mark")}class Q1{constructor(t,n){this.name=t,this.run=n}hasMatchingType(t){return uo(t)?Z0e(t.mark)===this.name:!1}}function Fu(e,t){const n=e&&e[t];return n?G(n)?cc(n,i=>!!i.field):J(n)||G1(n):!1}function bR(e,t){const n=e&&e[t];return n?G(n)?cc(n,i=>!!i.field):J(n)||ws(n)||oh(n):!1}function vR(e,t){if(Ut(t)){const n=e[t];if((J(n)||ws(n))&&(TN(n.type)||J(n)&&n.timeUnit)){const i=lx(t);return bR(e,i)}}return!1}function _R(e){return cc(xde,t=>{if(Fu(e,t)){const n=e[t];if(G(n))return cc(n,i=>!!i.aggregate);{const i=Lr(n);return i&&!!i.aggregate}}return!1})}function xR(e,t){const n=[],i=[],r=[],s=[],o={};return ew(e,(a,u)=>{if(J(a)){const{field:l,aggregate:c,bin:f,timeUnit:d,...h}=a;if(c||d||f){const p=Kx(a),g=p==null?void 0:p.title;let m=ne(a,{forAs:!0});const y={...g?[]:{title:xc(a,t,{allowDisabling:!0})},...h,field:m};if(c){let b;if(ha(c)?(b="argmax",m=ne({op:"argmax",field:c.argmax},{forAs:!0}),y.field=`${m}.${l}`):so(c)?(b="argmin",m=ne({op:"argmin",field:c.argmin},{forAs:!0}),y.field=`${m}.${l}`):c!=="boxplot"&&c!=="errorbar"&&c!=="errorband"&&(b=c),b){const v={op:b,as:m};l&&(v.field=l),s.push(v)}}else if(n.push(m),ii(a)&&wt(f)){if(i.push({bin:f,field:l,as:m}),n.push(ne(a,{binSuffix:"end"})),ah(a,u)&&n.push(ne(a,{binSuffix:"range"})),Ut(u)){const b={field:`${m}_end`};o[`${u}2`]=b}y.bin="binned",BM(u)||(y.type=Eu)}else if(d&&!ku(d)){r.push({timeUnit:d,field:l,as:m});const b=ii(a)&&a.type!==mc&&"time";b&&(u===Zd||u===mu?y.formatType=b:Mde(u)?y.legend={formatType:b,...y.legend}:Ut(u)&&(y.axis={formatType:b,...y.axis}))}o[u]=y}else n.push(l),o[u]=e[u]}else o[u]=e[u]}),{bins:i,timeUnits:r,aggregate:s,groupby:n,encoding:o}}function wpe(e,t,n){const i=Rde(t,n);if(i){if(i==="binned"){const r=e[t===$r?Ft:sn];return!!(J(r)&&J(e[t])&&yn(r.bin))}}else return!1;return!0}function kpe(e,t,n,i){const r={};for(const s of Y(e))zM(s)||K(khe(s));for(let s of $de){if(!e[s])continue;const o=e[s];if(Jd(s)){const a=Ade(s),u=r[a];if(J(u)&&w0e(u.type)&&J(o)&&!u.timeUnit){K(yhe(a));continue}}if(s==="angle"&&t==="arc"&&!e.theta&&(K(mhe),s=tr),!wpe(e,s,t)){K(R1(s,t));continue}if(s===no&&t==="line"){const a=Lr(e[s]);if(a!=null&&a.aggregate){K(whe);continue}}if(s===mi&&(n?"fill"in e:"stroke"in e)){K(hN("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(s===Kd||s===pc&&!G(o)&&!Or(o)||s===mu&&G(o)){if(o){if(s===pc){const a=e[s];if(rR(a)){r[s]=a;continue}}r[s]=se(o).reduce((a,u)=>(J(u)?a.push(Qx(u,s)):K(wx(u,s)),a),[])}}else{if(s===mu&&o===null)r[s]=null;else if(!J(o)&&!ws(o)&&!Or(o)&&!sh(o)&&!be(o)){K(wx(o,s));continue}r[s]=fR(o,s,i)}}return r}function em(e,t){const n={};for(const i of Y(e)){const r=fR(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function Epe(e){const t=[];for(const n of Y(e))if(Fu(e,n)){const i=e[n],r=se(i);for(const s of r)J(s)?t.push(s):G1(s)&&t.push(s.condition)}return t}function ew(e,t,n){if(e)for(const i of Y(e)){const r=e[i];if(G(r))for(const s of r)t.call(n,s,i);else t.call(n,r,i)}}function Cpe(e,t,n,i){return e?Y(e).reduce((r,s)=>{const o=e[s];return G(o)?o.reduce((a,u)=>t.call(i,a,u,s),r):t.call(i,r,o,s)},n):n}function wR(e,t){return Y(t).reduce((n,i)=>{switch(i){case Ft:case sn:case S1:case D1:case F1:case $r:case hs:case oa:case hc:case tr:case to:case Sr:case eo:case aa:case Fr:case Dr:case Tr:case nr:case Zd:case yi:case gu:case mu:return n;case pc:if(e==="line"||e==="trail")return n;case Kd:case $1:{const r=t[i];if(G(r)||J(r))for(const s of se(r))s.aggregate||n.push(ne(s,{}));return n}case no:if(e==="trail")return n;case mi:case ps:case gs:case io:case ua:case la:case fa:case ca:{const r=Lr(t[i]);return r&&!r.aggregate&&n.push(ne(r,{})),n}}},[])}function Ape(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if(G(t)){for(const s of t)s.aggregate?(i||(i=[]),i.push(s)):(r||(r=[]),r.push(s));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:r=t;return G(r)&&r.length===1&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}function tw(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};const r=e.map(({fieldPrefix:o,titlePrefix:a})=>{const u=i?` of ${nw(t)}`:"";return{field:o+t.field,type:t.type,title:be(a)?{signal:`${a}"${escape(u)}"`}:a+u}}),s=Epe(n).map(lpe);return{tooltip:[...r,...ds(s,Ve)]}}function nw(e){const{title:t,field:n}=e;return jt(t,n)}function iw(e,t,n,i,r){const{scale:s,axis:o}=n;return({partName:a,mark:u,positionPrefix:l,endPositionPrefix:c=void 0,extraEncoding:f={}})=>{const d=nw(n);return kR(e,a,r,{mark:u,encoding:{[t]:{field:`${l}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...s!==void 0?{scale:s}:{},...o!==void 0?{axis:o}:{}},...re(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...i,...f}})}}function kR(e,t,n,i){const{clip:r,color:s,opacity:o}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...i,mark:{...n[t],...r?{clip:r}:{},...s?{color:s}:{},...o?{opacity:o}:{},...xs(i.mark)?i.mark:{type:i.mark},style:`${a}-${String(t)}`,...wo(e[t])?{}:e[t]}}]:[]}function ER(e,t,n){const{encoding:i}=e,r=t==="vertical"?"y":"x",s=i[r],o=i[`${r}2`],a=i[`${r}Error`],u=i[`${r}Error2`];return{continuousAxisChannelDef:tm(s,n),continuousAxisChannelDef2:tm(o,n),continuousAxisChannelDefError:tm(a,n),continuousAxisChannelDefError2:tm(u,n),continuousAxis:r}}function tm(e,t){if(e!=null&&e.aggregate){const{aggregate:n,...i}=e;return n!==t&&K(Khe(n,t)),i}else return e}function CR(e,t){const{mark:n,encoding:i}=e,{x:r,y:s}=i;if(xs(n)&&n.orient)return n.orient;if(ya(r)){if(ya(s)){const o=J(r)&&r.aggregate,a=J(s)&&s.aggregate;if(!o&&a===t)return"vertical";if(!a&&o===t)return"horizontal";if(o===t&&a===t)throw new Error("Both x and y cannot have aggregate");return kc(s)&&!kc(r)?"horizontal":"vertical"}return"horizontal"}else{if(ya(s))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const nm="boxplot",$pe=["box","median","outliers","rule","ticks"],Spe=new Q1(nm,$R);function AR(e){return Je(e)?"tukey":e}function $R(e,{config:t}){e={...e,encoding:em(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:s,...o}=e,a=xs(n)?n:{type:n};r&&K(uN("boxplot"));const u=a.extent??t.boxplot.extent,l=mt("size",a,t),c=a.invalid,f=AR(u),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:g,continuousAxis:m,groupby:y,aggregate:b,encodingWithoutContinuousAxis:v,ticksOrient:_,boxOrient:x,customTooltipWithoutAggregatedField:k}=Fpe(e,u,t),w=fc(g.field),{color:E,size:C,...F}=v,S=a2=>iw(a,m,g,a2,t.boxplot),z=S(F),P=S(v),T=(ie(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",A=S({...F,...C?{size:C}:{},color:{condition:{test:`${lt(`lower_box_${g.field}`)} >= ${lt(`upper_box_${g.field}`)}`,...E||{value:T}}}}),M=tw([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],g,v),B={type:"tick",color:"black",opacity:1,orient:_,invalid:c,aria:!1},V=f==="min-max"?M:tw([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,v),H=[...z({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:V}),...z({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:V}),...z({partName:"ticks",mark:B,positionPrefix:"lower_whisker",extraEncoding:V}),...z({partName:"ticks",mark:B,positionPrefix:"upper_whisker",extraEncoding:V})],oe=[...f!=="tukey"?H:[],...P({partName:"box",mark:{type:"bar",...l?{size:l}:{},orient:x,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:M}),...A({partName:"median",mark:{type:"tick",invalid:c,...ie(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...l?{size:l}:{},orient:_,aria:!1},positionPrefix:"mid_box",extraEncoding:M})];if(f==="min-max")return{...o,transform:(o.transform??[]).concat(p),layer:oe};const ke=lt(`lower_box_${g.field}`),we=lt(`upper_box_${g.field}`),Oe=`(${we} - ${ke})`,rt=`${ke} - ${u} * ${Oe}`,Ie=`${we} + ${u} * ${Oe}`,Wt=lt(g.field),or={joinaggregate:SR(g.field),groupby:y},ar={transform:[{filter:`(${rt} <= ${Wt}) && (${Wt} <= ${Ie})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${w}`},{op:"max",field:g.field,as:`upper_whisker_${w}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${w}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${w}`},...b],groupby:y}],layer:H},{tooltip:le,...je}=F,{scale:Ge,axis:Q}=g,wn=nw(g),dt=gi(Q,["title"]),Bn=kR(a,"outliers",t.boxplot,{transform:[{filter:`(${Wt} < ${rt}) || (${Wt} > ${Ie})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...wn!==void 0?{title:wn}:{},...Ge!==void 0?{scale:Ge}:{},...pt(dt)?{}:{axis:dt}},...je,...E?{color:E}:{},...k?{tooltip:k}:{}}})[0];let cn;const Ds=[...d,...h,or];return Bn?cn={transform:Ds,layer:[Bn,ar]}:(cn=ar,cn.transform.unshift(...Ds)),{...o,layer:[cn,{transform:p,layer:oe}]}}function SR(e){const t=fc(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}function Fpe(e,t,n){const i=CR(e,nm),{continuousAxisChannelDef:r,continuousAxis:s}=ER(e,i,nm),o=r.field,a=fc(o),u=AR(t),l=[...SR(o),{op:"median",field:o,as:`mid_box_${a}`},{op:"min",field:o,as:(u==="min-max"?"lower_whisker_":"min_")+a},{op:"max",field:o,as:(u==="min-max"?"upper_whisker_":"max_")+a}],c=u==="min-max"||u==="tukey"?[]:[{calculate:`${lt(`upper_box_${a}`)} - ${lt(`lower_box_${a}`)}`,as:`iqr_${a}`},{calculate:`min(${lt(`upper_box_${a}`)} + ${lt(`iqr_${a}`)} * ${t}, ${lt(`max_${a}`)})`,as:`upper_whisker_${a}`},{calculate:`max(${lt(`lower_box_${a}`)} - ${lt(`iqr_${a}`)} * ${t}, ${lt(`min_${a}`)})`,as:`lower_whisker_${a}`}],{[s]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:p}=Ape(d),{bins:g,timeUnits:m,aggregate:y,groupby:b,encoding:v}=xR(p,n),_=i==="vertical"?"horizontal":"vertical",x=i,k=[...g,...m,{aggregate:[...y,...l],groupby:b},...c];return{bins:g,timeUnits:m,transform:k,groupby:b,aggregate:y,continuousAxisChannelDef:r,continuousAxis:s,encodingWithoutContinuousAxis:v,ticksOrient:_,boxOrient:x,customTooltipWithoutAggregatedField:h}}const rw="errorbar",Dpe=["ticks","rule"],Tpe=new Q1(rw,FR);function FR(e,{config:t}){e={...e,encoding:em(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,ticksOrient:o,markDef:a,outerSpec:u,tooltipEncoding:l}=DR(e,rw,t);delete s.size;const c=iw(a,r,i,s,t.errorbar),f=a.thickness,d=a.size,h={type:"tick",orient:o,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},p=[...c({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:l}),...c({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:l}),...c({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l})];return{...u,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function Mpe(e,t){const{encoding:n}=e;if(Npe(n))return{orient:CR(e,t),inputType:"raw"};const i=Rpe(n),r=Ope(n),s=n.x,o=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,u=n.y2;if(Le(a)&&Le(u))throw new Error(`${t} cannot have both x2 and y2`);if(Le(a)){if(ya(s))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(Le(u)){if(ya(o))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}else{const a=n.xError,u=n.xError2,l=n.yError,c=n.yError2;if(Le(u)&&!Le(a))throw new Error(`${t} cannot have xError2 without xError`);if(Le(c)&&!Le(l))throw new Error(`${t} cannot have yError2 without yError`);if(Le(a)&&Le(l))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(Le(a)){if(ya(s))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(Le(l)){if(ya(o))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function Npe(e){return(Le(e.x)||Le(e.y))&&!Le(e.x2)&&!Le(e.y2)&&!Le(e.xError)&&!Le(e.xError2)&&!Le(e.yError)&&!Le(e.yError2)}function Rpe(e){return Le(e.x2)||Le(e.y2)}function Ope(e){return Le(e.xError)||Le(e.xError2)||Le(e.yError)||Le(e.yError2)}function DR(e,t,n){const{mark:i,encoding:r,params:s,projection:o,...a}=e,u=xs(i)?i:{type:i};s&&K(uN(t));const{orient:l,inputType:c}=Mpe(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:g}=ER(e,l,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:v}=Lpe(u,f,d,h,p,c,t,n),{[g]:_,[g==="x"?"x2":"y2"]:x,[g==="x"?"xError":"yError"]:k,[g==="x"?"xError2":"yError2"]:w,...E}=r,{bins:C,timeUnits:F,aggregate:S,groupby:z,encoding:P}=xR(E,n),T=[...S,...m],A=c!=="raw"?[]:z,M=tw(b,f,P,v);return{transform:[...a.transform??[],...C,...F,...T.length===0?[]:[{aggregate:T,groupby:A}],...y],groupby:A,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:P,ticksOrient:l==="vertical"?"horizontal":"vertical",markDef:u,outerSpec:a,tooltipEncoding:M}}function Lpe(e,t,n,i,r,s,o,a){let u=[],l=[];const c=t.field;let f,d=!1;if(s==="raw"){const h=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,p=e.extent?e.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(p==="iqr")&&K(Zhe(h,p,o)),p==="stderr"||p==="stdev")u=[{op:p,field:c,as:`extent_${c}`},{op:h,field:c,as:`center_${c}`}],l=[{calculate:`${lt(`center_${c}`)} + ${lt(`extent_${c}`)}`,as:`upper_${c}`},{calculate:`${lt(`center_${c}`)} - ${lt(`extent_${c}`)}`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:Yd(h)},{fieldPrefix:"upper_",titlePrefix:TR(h,p,"+")},{fieldPrefix:"lower_",titlePrefix:TR(h,p,"-")}],d=!0;else{let g,m,y;p==="ci"?(g="mean",m="ci0",y="ci1"):(g="median",m="q1",y="q3"),u=[{op:m,field:c,as:`lower_${c}`},{op:y,field:c,as:`upper_${c}`},{op:g,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:xc({field:c,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:xc({field:c,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:xc({field:c,aggregate:g,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&K(Xhe(e.center,e.extent)),s==="aggregated-upper-lower"?(f=[],l=[{calculate:lt(n.field),as:`upper_${c}`},{calculate:lt(c),as:`lower_${c}`}]):s==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:c}],l=[{calculate:`${lt(c)} + ${lt(i.field)}`,as:`upper_${c}`}],r?l.push({calculate:`${lt(c)} + ${lt(r.field)}`,as:`lower_${c}`}):l.push({calculate:`${lt(c)} - ${lt(i.field)}`,as:`lower_${c}`}));for(const h of l)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:pu(pu(h.calculate,"datum['",""),"']","")})}return{postAggregateCalculates:l,errorBarSpecificAggregate:u,tooltipSummary:f,tooltipTitleWithFieldName:d}}function TR(e,t,n){return`${Yd(e)} ${n} ${t}`}const sw="errorband",Ipe=["band","borders"],Ppe=new Q1(sw,MR);function MR(e,{config:t}){e={...e,encoding:em(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,markDef:o,outerSpec:a,tooltipEncoding:u}=DR(e,sw,t),l=o,c=iw(l,r,i,s,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p={...l.interpolate?{interpolate:l.interpolate}:{},...l.tension&&l.interpolate?{tension:l.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):l.interpolate?K(yN("interpolate")):l.tension&&K(yN("tension")),{...a,transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:u})]}}const NR={};function ow(e,t,n){const i=new Q1(e,t);NR[e]={normalizer:i,parts:n}}function zpe(){return Y(NR)}ow(nm,$R,$pe),ow(rw,FR,Dpe),ow(sw,MR,Ipe);const Bpe=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],RR={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},OR={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},jpe=Y(RR),Upe=Y(OR),LR=Y({header:1,headerRow:1,headerColumn:1,headerFacet:1}),IR=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],qpe={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},Wpe={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},Ir="_vgsid_",Hpe={point:{on:"click",fields:[Ir],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function aw(e){return e==="legend"||!!(e!=null&&e.legend)}function uw(e){return aw(e)&&ie(e)}function lw(e){return!!(e!=null&&e.select)}function PR(e){const t=[];for(const n of e||[]){if(lw(n))continue;const{expr:i,bind:r,...s}=n;if(r&&i){const o={...s,bind:r,init:i};t.push(o)}else{const o={...s,...i?{update:i}:{},...r?{bind:r}:{}};t.push(o)}}return t}function Gpe(e){return im(e)||fw(e)||cw(e)}function cw(e){return Z(e,"concat")}function im(e){return Z(e,"vconcat")}function fw(e){return Z(e,"hconcat")}function zR({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function ks(e){return Z(e,"step")}function BR(e){return Z(e,"view")||Z(e,"width")||Z(e,"height")}const jR=20,Vpe=Y({align:1,bounds:1,center:1,columns:1,spacing:1});function Ype(e,t,n){const i=n[t],r={},{spacing:s,columns:o}=i;s!==void 0&&(r.spacing=s),o!==void 0&&(H1(e)&&!rh(e.facet)||cw(e))&&(r.columns=o),im(e)&&(r.columns=1);for(const a of Vpe)if(e[a]!==void 0)if(a==="spacing"){const u=e[a];r[a]=Je(u)?u:{row:u.row??s,column:u.column??s}}else r[a]=e[a];return r}function dw(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function hw(e,t){const n=rm(e,t);return ks(n)?n.step:UR}function rm(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return jt(n,{step:e.step})}const UR=20,Xpe={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:200,continuousHeight:200,step:UR},mark:G0e,arc:{},area:{},bar:Y0e,circle:{},geoshape:{},image:{},line:{},point:{},rect:qx,rule:{color:"black"},square:{},text:{color:"black"},tick:X0e,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:S0e,projection:{},legend:qpe,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:Hpe,style:{},title:{},facet:{spacing:jR},concat:{spacing:jR},normalizedNumberFormat:".0%"},lo=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],qR={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},WR={blue:lo[0],orange:lo[1],red:lo[2],teal:lo[3],green:lo[4],yellow:lo[5],purple:lo[6],pink:lo[7],brown:lo[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function Zpe(e={}){return{signals:[{name:"color",value:ie(e)?{...WR,...e}:WR}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function Kpe(e){return{signals:[{name:"fontSize",value:ie(e)?{...qR,...e}:qR}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function Jpe(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function HR(e){const t=Y(e||{}),n={};for(const i of t){const r=e[i];n[i]=uh(r)?XM(r):Oi(r)}return n}function Qpe(e){const t=Y(e),n={};for(const i of t)n[i]=HR(e[i]);return n}const ege=[...qN,...yR,...LR,"background","padding","legend","lineBreak","scale","style","title","view"];function GR(e={}){const{color:t,font:n,fontSize:i,selection:r,...s}=e,o=il({},Re(Xpe),n?Jpe(n):{},t?Zpe(t):{},i?Kpe(i):{},s||{});r&&rl(o,"selection",r,!0);const a=gi(o,ege);for(const u of["background","lineBreak","padding"])o[u]&&(a[u]=Oi(o[u]));for(const u of qN)o[u]&&(a[u]=bn(o[u]));for(const u of yR)o[u]&&(a[u]=HR(o[u]));for(const u of LR)o[u]&&(a[u]=bn(o[u]));if(o.legend&&(a.legend=bn(o.legend)),o.scale){const{invalid:u,...l}=o.scale,c=bn(u,{level:1});a.scale={...bn(l),...Y(c).length>0?{invalid:c}:{}}}return o.style&&(a.style=Qpe(o.style)),o.title&&(a.title=bn(o.title)),o.view&&(a.view=bn(o.view)),a}const tge=new Set(["view",...j0e]),nge=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],ige={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...H0e};function rge(e){e=Re(e);for(const t of nge)delete e[t];if(e.axis)for(const t in e.axis)uh(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of Bpe)delete e.legend[t];if(e.mark){for(const t of UN)delete e.mark[t];e.mark.tooltip&&ie(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(PR(e.params)),delete e.params);for(const t of tge){for(const i of UN)delete e[t][i];const n=ige[t];if(n)for(const i of n)delete e[t][i];oge(e,t)}for(const t of zpe())delete e[t];sge(e);for(const t in e)ie(e[t])&&pt(e[t])&&delete e[t];return pt(e)?void 0:e}function sge(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=YM(e.title);pt(t)||(e.style["group-title"]={...e.style["group-title"],...t}),pt(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),pt(i)?delete e.title:e.title=i}function oge(e,t,n,i){const r=e[t];t==="view"&&(n="cell");const s={...r,...e.style[n??t]};pt(s)||(e.style[n??t]=s),delete e[t]}function sm(e){return Z(e,"layer")}function age(e){return Z(e,"repeat")}function uge(e){return!G(e.repeat)&&Z(e.repeat,"layer")}class pw{map(t,n){return H1(t)?this.mapFacet(t,n):age(t)?this.mapRepeat(t,n):fw(t)?this.mapHConcat(t,n):im(t)?this.mapVConcat(t,n):cw(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(sm(t))return this.mapLayer(t,n);if(uo(t))return this.mapUnit(t,n);throw new Error(vx(t))}mapLayer(t,n){return{...t,layer:t.layer.map(i=>this.mapLayerOrUnit(i,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(i=>this.map(i,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(i=>this.map(i,n))}}mapConcat(t,n){const{concat:i,...r}=t;return{...r,concat:i.map(s=>this.map(s,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const lge={zero:1,center:1,normalize:1};function cge(e){return ue(lge,e)}const fge=new Set([zN,z1,P1,U1,j1,Bx,jx,B1,BN,zx]),dge=new Set([z1,P1,zN]);function Ec(e){return J(e)&&vc(e)==="quantitative"&&!e.bin}function VR(e,t,{orient:n,type:i}){const r=t==="x"?"y":"radius",s=t==="x"&&["bar","area"].includes(i),o=e[t],a=e[r];if(J(o)&&J(a))if(Ec(o)&&Ec(a)){if(o.stack)return t;if(a.stack)return r;const u=J(o)&&!!o.aggregate,l=J(a)&&!!a.aggregate;if(u!==l)return u?t:r;if(s){if(n==="vertical")return r;if(n==="horizontal")return t}}else{if(Ec(o))return t;if(Ec(a))return r}else{if(Ec(o))return s&&n==="vertical"?void 0:t;if(Ec(a))return s&&n==="horizontal"?void 0:r}}function hge(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function YR(e,t){var g,m;const n=xs(e)?e:{type:e},i=n.type;if(!fge.has(i))return null;const r=VR(t,"x",n)||VR(t,"theta",n);if(!r)return null;const s=t[r],o=J(s)?ne(s,{}):void 0,a=hge(r),u=[],l=new Set;if(t[a]){const y=t[a],b=J(y)?ne(y,{}):void 0;b&&b!==o&&(u.push(a),l.add(b))}const c=a==="x"?"xOffset":"yOffset",f=t[c],d=J(f)?ne(f,{}):void 0;d&&d!==o&&(u.push(c),l.add(d));const h=Sde.reduce((y,b)=>{if(b!=="tooltip"&&Fu(t,b)){const v=t[b];for(const _ of se(v)){const x=Lr(_);if(x.aggregate)continue;const k=ne(x,{});(!k||!l.has(k))&&y.push({channel:b,fieldDef:x})}}return y},[]);let p;return s.stack!==void 0?wo(s.stack)?p=s.stack?"zero":null:p=s.stack:dge.has(i)&&(p="zero"),!p||!cge(p)||_R(t)&&h.length===0?null:((g=s==null?void 0:s.scale)!=null&&g.type&&((m=s==null?void 0:s.scale)==null?void 0:m.type)!==vn.LINEAR&&s!=null&&s.stack&&K(Ghe(s.scale.type)),Le(t[ms(r)])?(s.stack!==void 0&&K(Hhe(r)),null):(J(s)&&s.aggregate&&!jde.has(s.aggregate)&&K(Vhe(s.aggregate)),{groupbyChannels:u,groupbyFields:l,fieldChannel:r,impute:s.impute===null?!1:ga(i),stackBy:h,offset:p}))}function XR(e,t,n){const i=bn(e),r=mt("orient",i,n);if(i.orient=yge(i.type,t,r),r!==void 0&&r!==i.orient&&K(Fhe(i.orient,r)),i.type==="bar"&&i.orient){const u=mt("cornerRadiusEnd",i,n);if(u!==void 0){const l=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:V0e[i.orient];for(const c of l)i[c]=u;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}const s=mt("opacity",i,n),o=mt("fillOpacity",i,n);return s===void 0&&o===void 0&&(i.opacity=gge(i.type,t)),mt("cursor",i,n)===void 0&&(i.cursor=pge(i,t,n)),i}function pge(e,t,n){return t.href||e.href||mt("href",e,n)?"pointer":e.cursor}function gge(e,t){if(He([j1,zx,Bx,jx],e)&&!_R(t))return .7}function mge(e,t,{graticule:n}){if(n)return!1;const i=bs("filled",e,t),r=e.type;return jt(i,r!==j1&&r!==B1&&r!==U1)}function yge(e,t,n){switch(e){case j1:case Bx:case jx:case BN:case z0e:case P0e:return}const{x:i,y:r,x2:s,y2:o}=t;switch(e){case z1:if(J(i)&&(yn(i.bin)||J(r)&&r.aggregate&&!i.aggregate))return"vertical";if(J(r)&&(yn(r.bin)||J(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(o||s){if(n)return n;if(!s)return(J(i)&&i.type===Eu&&!wt(i.bin)||V1(i))&&J(r)&&yn(r.bin)?"horizontal":"vertical";if(!o)return(J(r)&&r.type===Eu&&!wt(r.bin)||V1(r))&&J(i)&&yn(i.bin)?"vertical":"horizontal"}case U1:if(s&&!(J(i)&&yn(i.bin))&&o&&!(J(r)&&yn(r.bin)))return;case P1:if(o)return J(r)&&yn(r.bin)?"horizontal":"vertical";if(s)return J(i)&&yn(i.bin)?"vertical":"horizontal";if(e===U1){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case B1:case zx:{const a=sR(i),u=sR(r);if(n)return n;if(a&&!u)return e!=="tick"?"horizontal":"vertical";if(!a&&u)return e!=="tick"?"vertical":"horizontal";if(a&&u)return"vertical";{const l=ii(i)&&i.type===mc,c=ii(r)&&r.type===mc;if(l&&!c)return"vertical";if(!l&&c)return"horizontal"}return}}return"vertical"}function bge(e){const{point:t,line:n,...i}=e;return Y(i).length>1?i:i.type}function vge(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:gi(e[t],["point","line"])});return e}function gw(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?ie(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?ie(t.point)?t.point:{}:void 0}function ZR(e,t={}){return e.line?e.line===!0?{}:e.line:e.line!==void 0?null:t.line?t.line===!0?{}:t.line:void 0}class _ge{constructor(){this.name="path-overlay"}hasMatchingType(t,n){if(uo(t)){const{mark:i,encoding:r}=t,s=xs(i)?i:{type:i};switch(s.type){case"line":case"rule":case"trail":return!!gw(s,n[s.type],r);case"area":return!!gw(s,n[s.type],r)||!!ZR(s,n[s.type])}}return!1}run(t,n,i){const{config:r}=n,{params:s,projection:o,mark:a,name:u,encoding:l,...c}=t,f=em(l,r),d=xs(a)?a:{type:a},h=gw(d,r[d.type],f),p=d.type==="area"&&ZR(d,r[d.type]),g=[{name:u,...s?{params:s}:{},mark:bge({...d.type==="area"&&d.opacity===void 0&&d.fillOpacity===void 0?{opacity:.7}:{},...d}),encoding:gi(f,["shape"])}],m=YR(XR(d,f,r),f);let y=f;if(m){const{fieldChannel:b,offset:v}=m;y={...f,[b]:{...f[b],...v?{stack:v}:{}}}}return y=gi(y,["y2","x2"]),p&&g.push({...o?{projection:o}:{},mark:{type:"line",...lc(d,["clip","interpolate","tension","tooltip"]),...p},encoding:y}),h&&g.push({...o?{projection:o}:{},mark:{type:"point",opacity:1,filled:!0,...lc(d,["clip","tooltip"]),...h},encoding:y}),i({...c,layer:g},{...n,config:vge(r)})}}function xge(e,t){return t?rh(e)?eO(e,t):KR(e,t):e}function mw(e,t){return t?eO(e,t):e}function yw(e,t,n){const i=t[e];if(ape(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};K(ohe(i.repeat));return}return t}function KR(e,t){if(e=yw("field",e,t),e!==void 0){if(e===null)return null;if(Zx(e)&&ao(e.sort)){const n=yw("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function JR(e,t){if(J(e))return KR(e,t);{const n=yw("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function QR(e,t){if(Le(e)){const n=JR(e,t);if(n)return n;if(sh(e))return{condition:e.condition}}else{if(oh(e)){const n=JR(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}}function eO(e,t){const n={};for(const i in e)if(Z(e,i)){const r=e[i];if(G(r))n[i]=r.map(s=>QR(s,t)).filter(s=>s);else{const s=QR(r,t);s!==void 0&&(n[i]=s)}}return n}class wge{constructor(){this.name="RuleForRangedLine"}hasMatchingType(t){if(uo(t)){const{encoding:n,mark:i}=t;if(i==="line"||xs(i)&&i.type==="line")for(const r of Cde){const s=yu(r),o=n[s];if(n[r]&&(J(o)&&!yn(o.bin)||ws(o)))return!0}}return!1}run(t,n,i){const{encoding:r,mark:s}=t;return K(She(!!r.x2,!!r.y2)),i({...t,mark:ie(s)?{...s,type:"rule"}:"rule"},n)}}class kge extends pw{constructor(){super(...arguments),this.nonFacetUnitNormalizers=[Spe,Tpe,Ppe,new _ge,new wge]}map(t,n){if(uo(t)){const i=Fu(t.encoding,Js),r=Fu(t.encoding,Qs),s=Fu(t.encoding,A1);if(i||r||s)return this.mapFacetedUnit(t,n)}return super.map(t,n)}mapUnit(t,n){const{parentEncoding:i,parentProjection:r}=n,s=mw(t.encoding,n.repeater),o={...t,...t.name?{name:[n.repeaterPrefix,t.name].filter(u=>u).join("_")}:{},...s?{encoding:s}:{}};if(i||r)return this.mapUnitWithParentEncodingOrProjection(o,n);const a=this.mapLayerOrUnit.bind(this);for(const u of this.nonFacetUnitNormalizers)if(u.hasMatchingType(o,n.config))return u.run(o,n,a);return o}mapRepeat(t,n){return uge(t)?this.mapLayerRepeat(t,n):this.mapNonLayerRepeat(t,n)}mapLayerRepeat(t,n){const{repeat:i,spec:r,...s}=t,{row:o,column:a,layer:u}=i,{repeater:l={},repeaterPrefix:c=""}=n;return o||a?this.mapRepeat({...t,repeat:{...o?{row:o}:{},...a?{column:a}:{}},spec:{repeat:{layer:u},spec:r}},n):{...s,layer:u.map(f=>{const d={...l,layer:f},h=`${(r.name?`${r.name}_`:"")+c}child__layer_${St(f)}`,p=this.mapLayerOrUnit(r,{...n,repeater:d,repeaterPrefix:h});return p.name=h,p})}}mapNonLayerRepeat(t,n){const{repeat:i,spec:r,data:s,...o}=t;!G(i)&&t.columns&&(t=gi(t,["columns"]),K(lN("repeat")));const a=[],{repeater:u={},repeaterPrefix:l=""}=n,c=!G(i)&&i.row||[u?u.row:null],f=!G(i)&&i.column||[u?u.column:null],d=G(i)&&i||[u?u.repeat:null];for(const p of d)for(const g of c)for(const m of f){const y={repeat:p,row:g,column:m,layer:u.layer},b=(r.name?`${r.name}_`:"")+l+"child__"+(G(i)?`${St(p)}`:(i.row?`row_${St(g)}`:"")+(i.column?`column_${St(m)}`:"")),v=this.map(r,{...n,repeater:y,repeaterPrefix:b});v.name=b,a.push(gi(v,["data"]))}const h=G(i)?t.columns:i.column?i.column.length:1;return{data:r.data??s,align:"all",...o,columns:h,concat:a}}mapFacet(t,n){const{facet:i}=t;return rh(i)&&t.columns&&(t=gi(t,["columns"]),K(lN("facet"))),super.mapFacet(t,n)}mapUnitWithParentEncodingOrProjection(t,n){const{encoding:i,projection:r}=t,{parentEncoding:s,parentProjection:o,config:a}=n,u=nO({parentProjection:o,projection:r}),l=tO({parentEncoding:s,encoding:mw(i,n.repeater)});return this.mapUnit({...t,...u?{projection:u}:{},...l?{encoding:l}:{}},{config:a})}mapFacetedUnit(t,n){const{row:i,column:r,facet:s,...o}=t.encoding,{mark:a,width:u,projection:l,height:c,view:f,params:d,encoding:h,...p}=t,{facetMapping:g,layout:m}=this.getFacetMappingAndLayout({row:i,column:r,facet:s},n),y=mw(o,n.repeater);return this.mapFacet({...p,...m,facet:g,spec:{...u?{width:u}:{},...c?{height:c}:{},...f?{view:f}:{},...l?{projection:l}:{},mark:a,encoding:y,...d?{params:d}:{}}},n)}getFacetMappingAndLayout(t,n){const{row:i,column:r,facet:s}=t;if(i||r){s&&K(Ahe([...i?[Js]:[],...r?[Qs]:[]]));const o={},a={};for(const u of[Js,Qs]){const l=t[u];if(l){const{align:c,center:f,spacing:d,columns:h,...p}=l;o[u]=p;for(const g of["align","center","spacing"])l[g]!==void 0&&(a[g]??(a[g]={}),a[g][u]=l[g])}}return{facetMapping:o,layout:a}}else{const{align:o,center:a,spacing:u,columns:l,...c}=s;return{facetMapping:xge(c,n.repeater),layout:{...o?{align:o}:{},...a?{center:a}:{},...u?{spacing:u}:{},...l?{columns:l}:{}}}}}mapLayer(t,{parentEncoding:n,parentProjection:i,...r}){const{encoding:s,projection:o,...a}=t,u={...r,parentEncoding:tO({parentEncoding:n,encoding:s,layer:!0}),parentProjection:nO({parentProjection:i,projection:o})};return super.mapLayer({...a,...t.name?{name:[u.repeaterPrefix,t.name].filter(l=>l).join("_")}:{}},u)}}function tO({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...Y(e),...Y(t)]);for(const s of r){const o=t[s],a=e[s];if(Le(o)){const u={...a,...o};i[s]=u}else oh(o)?i[s]={...o,condition:{...a,...o.condition}}:o||o===null?i[s]=o:(n||Or(a)||be(a)||Le(a)||G(a))&&(i[s]=a)}}else i=t;return!i||pt(i)?void 0:i}function nO(e){const{parentProjection:t,projection:n}=e;return t&&n&&K(ghe({parentProjection:t,projection:n})),n??t}function bw(e){return Z(e,"filter")}function Ege(e){return Z(e,"stop")}function iO(e){return Z(e,"lookup")}function Cge(e){return Z(e,"data")}function Age(e){return Z(e,"param")}function $ge(e){return Z(e,"pivot")}function Sge(e){return Z(e,"density")}function Fge(e){return Z(e,"quantile")}function Dge(e){return Z(e,"regression")}function Tge(e){return Z(e,"loess")}function Mge(e){return Z(e,"sample")}function Nge(e){return Z(e,"window")}function Rge(e){return Z(e,"joinaggregate")}function Oge(e){return Z(e,"flatten")}function Lge(e){return Z(e,"calculate")}function rO(e){return Z(e,"bin")}function Ige(e){return Z(e,"impute")}function Pge(e){return Z(e,"timeUnit")}function zge(e){return Z(e,"aggregate")}function Bge(e){return Z(e,"stack")}function jge(e){return Z(e,"fold")}function Uge(e){return Z(e,"extent")&&!Z(e,"density")&&!Z(e,"regression")}function qge(e){return e.map(t=>bw(t)?{filter:uc(t.filter,x0e)}:t)}class Wge extends pw{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=sO(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=sO(t,n),t.encoding){const i={};for(const[r,s]of sa(t.encoding))i[r]=oO(s,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:sa(i).map(([s,o])=>{const{init:a,bind:u,empty:l,...c}=o;c.type==="single"?(c.type="point",c.toggle=!1):c.type==="multi"&&(c.type="point"),n.emptySelections[s]=l!=="none";for(const f of mn(n.selectionPredicates[s]??{}))f.empty=l!=="none";return{name:s,value:a,select:c,bind:u}})}:t}}function sO(e,t){const{transform:n,...i}=e;if(n){const r=n.map(s=>{if(bw(s))return{filter:vw(s,t)};if(rO(s)&&bu(s.bin))return{...s,bin:aO(s.bin)};if(iO(s)){const{selection:o,...a}=s.from;return o?{...s,from:{param:o,...a}}:s}return s});return{...i,transform:r}}return e}function oO(e,t){var i,r;const n=Re(e);if(J(n)&&bu(n.bin)&&(n.bin=aO(n.bin)),Su(n)&&((r=(i=n.scale)==null?void 0:i.domain)!=null&&r.selection)){const{selection:s,...o}=n.scale.domain;n.scale.domain={...o,...s?{param:s}:{}}}if(sh(n))if(G(n.condition))n.condition=n.condition.map(s=>{const{selection:o,param:a,test:u,...l}=s;return a?s:{...l,test:vw(s,t)}});else{const{selection:s,param:o,test:a,...u}=oO(n.condition,t);n.condition=o?n.condition:{...u,test:vw(n.condition,t)}}return n}function aO(e){const t=e.extent;if(t!=null&&t.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function vw(e,t){const n=i=>uc(i,r=>{var s;const o=t.emptySelections[r]??!0,a={param:r,empty:o};return(s=t.selectionPredicates)[r]??(s[r]=[]),t.selectionPredicates[r].push(a),a});return e.selection?n(e.selection):uc(e.test||e.filter,i=>i.selection?n(i.selection):i)}class _w extends pw{map(t,n){const i=n.selections??[];if(t.params&&!uo(t)){const r=[];for(const s of t.params)lw(s)?i.push(s):r.push(s);t.params=r}return n.selections=i,super.map(t,n)}mapUnit(t,n){const i=n.selections;if(!i||!i.length)return t;const r=(n.path??[]).concat(t.name),s=[];for(const o of i)if(!o.views||!o.views.length)s.push(o);else for(const a of o.views)(re(a)&&(a===t.name||r.includes(a))||G(a)&&a.map(u=>r.indexOf(u)).every((u,l,c)=>u!==-1&&(l===0||u>c[l-1])))&&s.push(o);return s.length&&(t.params=s),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=_w.prototype[e];_w.prototype[e]=function(n,i){return t.call(this,n,Hge(n,i))}}function Hge(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function uO(e,t){t===void 0&&(t=GR(e.config));const n=Xge(e,t),{width:i,height:r}=e,s=Zge(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...s?{autosize:s}:{}}}const Gge=new kge,Vge=new Wge,Yge=new _w;function Xge(e,t={}){const n={config:t};return Yge.map(Gge.map(Vge.map(e,n),n),n)}function lO(e){return re(e)?{type:e}:e??{}}function Zge(e,t,n){let{width:i,height:r}=t;const s=uo(e)||sm(e),o={};s?i=="container"&&r=="container"?(o.type="fit",o.contains="padding"):i=="container"?(o.type="fit-x",o.contains="padding"):r=="container"&&(o.type="fit-y",o.contains="padding"):(i=="container"&&(K(rN("width")),i=void 0),r=="container"&&(K(rN("height")),r=void 0));const a={type:"pad",...o,...n?lO(n.autosize):{},...lO(e.autosize)};if(a.type==="fit"&&!s&&(K(Xde),a.type="pad"),i=="container"&&!(a.type=="fit"||a.type=="fit-x")&&K(sN("width")),r=="container"&&!(a.type=="fit"||a.type=="fit-y")&&K(sN("height")),!Ri(a,{type:"pad"}))return a}function Kge(e){return["fit","fit-x","fit-y"].includes(e)}function Jge(e){return e?`fit-${T1(e)}`:"fit"}const Qge=["background","padding"];function cO(e,t){const n={};for(const i of Qge)e&&e[i]!==void 0&&(n[i]=Oi(e[i]));return t&&(n.params=e.params),n}class co{constructor(t={},n={}){this.explicit=t,this.implicit=n}clone(){return new co(Re(this.explicit),Re(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return jt(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:i}){n!==void 0&&this.set(t,n,i)}set(t,n,i){return delete this[i?"implicit":"explicit"][t],this[i?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:i}){n[t]!==void 0?this.set(t,n[t],!0):i[t]!==void 0&&this.set(t,i[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of Y(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function Es(e){return{explicit:!0,value:e}}function Li(e){return{explicit:!1,value:e}}function fO(e){return(t,n,i,r)=>{const s=e(t.value,n.value);return s>0?t:s<0?n:om(t,n,i,r)}}function om(e,t,n,i){return e.explicit&&t.explicit&&K(Phe(n,i,e.value,t.value)),e}function ba(e,t,n,i,r=om){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:Ri(e.value,t.value)?e:r(e,t,n,i)}class e1e extends co{constructor(t={},n={},i=!1){super(t,n),this.explicit=t,this.implicit=n,this.parseNothing=i}clone(){const t=super.clone();return t.parseNothing=this.parseNothing,t}}function Cc(e){return Z(e,"url")}function lh(e){return Z(e,"values")}function dO(e){return Z(e,"name")&&!Cc(e)&&!lh(e)&&!va(e)}function va(e){return e&&(hO(e)||pO(e)||xw(e))}function hO(e){return Z(e,"sequence")}function pO(e){return Z(e,"sphere")}function xw(e){return Z(e,"graticule")}var Tt;(function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup",e[e.PreFilterInvalid=5]="PreFilterInvalid",e[e.PostFilterInvalid=6]="PostFilterInvalid"})(Tt||(Tt={}));function gO({invalid:e,isPath:t}){switch(WN(e,{isPath:t})){case"filter":return{marks:"exclude-invalid-values",scales:"exclude-invalid-values"};case"break-paths-show-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"include-invalid-values"};case"break-paths-filter-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"exclude-invalid-values"};case"show":return{marks:"include-invalid-values",scales:"include-invalid-values"}}}function t1e(e){const{marks:t,scales:n}=gO(e);return t===n?Tt.Main:n==="include-invalid-values"?Tt.PreFilterInvalid:Tt.PostFilterInvalid}class ct{constructor(t,n){this.debugName=n,this._children=[],this._parent=null,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,n){if(this._children.includes(t)){K(dhe);return}n!==void 0?this._children.splice(n,0,t):this._children.push(t)}removeChild(t){const n=this._children.indexOf(t);return this._children.splice(n,1),n}remove(){let t=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,t++)}insertAsParentOf(t){const n=t.parent;n.removeChild(this),this.parent=n,t.parent=this}swapWithParent(){const t=this._parent,n=t.parent;for(const r of this._children)r.parent=t;this._children=[],t.removeChild(this);const i=t.parent.removeChild(t);this._parent=n,n.addChild(this,i),t.parent=this}}class vi extends ct{clone(){const t=new this.constructor;return t.debugName=`clone_${this.debugName}`,t._source=this._source,t._name=`clone_${this._name}`,t.type=this.type,t.refCounts=this.refCounts,t.refCounts[t._name]=0,t}constructor(t,n,i,r){super(t,n),this.type=i,this.refCounts=r,this._source=this._name=n,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${DM()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(t){this._source=t}}function ww(e){return e.as!==void 0}function mO(e){return`${e}_end`}class Cs extends ct{clone(){return new Cs(null,Re(this.timeUnits))}constructor(t,n){super(t),this.timeUnits=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s,o)=>{const{field:a,timeUnit:u}=s;if(u){let l;if(ku(u)){if(Mt(n)){const{mark:c,markDef:f,config:d}=n,h=ma({fieldDef:s,markDef:f,config:d});(th(c)||h)&&(l={timeUnit:on(u),field:a})}}else l={as:ne(s,{forAs:!0}),field:a,timeUnit:u};if(Mt(n)){const{mark:c,markDef:f,config:d}=n,h=ma({fieldDef:s,markDef:f,config:d});th(c)&&Ut(o)&&h!==.5&&(l.rectBandPosition=h)}l&&(r[Ve(l)]=l)}return r},{});return pt(i)?null:new Cs(t,i)}static makeFromTransform(t,n){const{timeUnit:i,...r}={...n},s=on(i),o={...r,timeUnit:s};return new Cs(t,{[Ve(o)]:o})}merge(t){this.timeUnits={...this.timeUnits};for(const n in t.timeUnits)this.timeUnits[n]||(this.timeUnits[n]=t.timeUnits[n]);for(const n of t.children)t.removeChild(n),n.parent=this;t.remove()}removeFormulas(t){const n={};for(const[i,r]of sa(this.timeUnits)){const s=ww(r)?r.as:`${r.field}_end`;t.has(s)||(n[i]=r)}this.timeUnits=n}producedFields(){return new Set(mn(this.timeUnits).map(t=>ww(t)?t.as:mO(t.field)))}dependentFields(){return new Set(mn(this.timeUnits).map(t=>t.field))}hash(){return`TimeUnit ${Ve(this.timeUnits)}`}assemble(){const t=[];for(const n of mn(this.timeUnits)){const{rectBandPosition:i}=n,r=on(n.timeUnit);if(ww(n)){const{field:s,as:o}=n,{unit:a,utc:u,...l}=r,c=[o,`${o}_end`];t.push({field:er(s),type:"timeunit",...a?{units:L1(a)}:{},...u?{timezone:"utc"}:{},...l,as:c}),t.push(...bO(c,i,r))}else if(n){const{field:s}=n,o=s.replaceAll("\\.","."),a=yO({timeUnit:r,field:o}),u=mO(o);t.push({type:"formula",expr:a,as:u}),t.push(...bO([o,u],i,r))}}return t}}const am="offsetted_rect_start",um="offsetted_rect_end";function yO({timeUnit:e,field:t,reverse:n}){const{unit:i,utc:r}=e,s=EN(i),{part:o,step:a}=SN(s,e.step);return`${r?"utcOffset":"timeOffset"}('${o}', ${lt(t)}, ${n?-a:a})`}function bO([e,t],n,i){if(n!==void 0&&n!==.5){const r=lt(e),s=lt(t);return[{type:"formula",expr:vO([yO({timeUnit:i,field:e,reverse:!0}),r],n+.5),as:`${e}_${am}`},{type:"formula",expr:vO([r,s],n+.5),as:`${e}_${um}`}]}return[]}function vO([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const ch="_tuple_fields";class n1e{constructor(...t){this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const i1e={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new n1e),s={},o={},a=new Set,u=(p,g)=>{const m=g==="visual"?p.channel:p.field;let y=St(`${i}_${m}`);for(let b=1;a.has(y);b++)y=St(`${i}_${m}_${b}`);return a.add(y),{[g]:y}},l=t.type,c=e.config.selection[l],f=n.value!==void 0?se(n.value):null;let{fields:d,encodings:h}=ie(n.select)?n.select:{};if(!d&&!h&&f){for(const p of f)if(ie(p))for(const g of Y(p))Ede(g)?(h||(h=[])).push(g):l==="interval"?(K(she),h=c.encodings):(d??(d=[])).push(g)}!d&&!h&&(h=c.encodings,"fields"in c&&(d=c.fields));for(const p of h??[]){const g=e.fieldDef(p);if(g){let m=g.field;if(g.aggregate){K(Zde(p,g.aggregate));continue}else if(!m){K(aN(p));continue}if(g.timeUnit&&!ku(g.timeUnit)){m=e.vgField(p);const y={timeUnit:g.timeUnit,as:m,field:g.field};o[Ve(y)]=y}if(!s[m]){const y=l==="interval"&&ys(p)&&Nr(e.getScaleComponent(p).get("type"))?"R":g.bin?"R-RE":"E",b={field:m,channel:p,type:y,index:r.items.length};b.signals={...u(b,"data"),...u(b,"visual")},r.items.push(s[m]=b),r.hasField[m]=s[m],r.hasSelectionId=r.hasSelectionId||m===Ir,IM(p)?(b.geoChannel=p,b.channel=LM(p),r.hasChannel[b.channel]=s[m]):r.hasChannel[p]=s[m]}}else K(aN(p))}for(const p of d??[]){if(r.hasField[p])continue;const g={type:"E",field:p,index:r.items.length};g.signals={...u(g,"data")},r.items.push(g),r.hasField[p]=g,r.hasSelectionId=r.hasSelectionId||p===Ir}f&&(t.init=f.map(p=>r.items.map(g=>ie(p)?p[g.geoChannel||g.channel]!==void 0?p[g.geoChannel||g.channel]:p[g.field]:p))),pt(o)||(r.timeUnit=new Cs(null,o))},signals:(e,t,n)=>{const i=t.name+ch;return n.filter(s=>s.name===i).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(kO)})}},_O="_curr",lm="anim_value",Ac="anim_clock",kw="eased_anim_clock",xO="min_extent",wO="max_range_extent",Ew="last_tick_at",Cw="is_playing",r1e=1/60*1e3,s1e=(e,t)=>[{name:kw,update:Ac},{name:`${e}_domain`,init:`domain('${t}')`},{name:xO,init:`extent(${e}_domain)[0]`},{name:wO,init:`extent(range('${t}'))[1]`},{name:lm,update:`invert('${t}', ${kw})`}],o1e={defined:e=>e.type==="point",topLevelSignals:(e,t,n)=>(As(t)&&(n=n.concat([{name:Ac,init:"0",on:[{events:{type:"timer",throttle:r1e},update:`${Cw} ? (${Ac} + (now() - ${Ew}) > ${wO} ? 0 : ${Ac} + (now() - ${Ew})) : ${Ac}`}]},{name:Ew,init:"now()",on:[{events:[{signal:Ac},{signal:Cw}],update:"now()"}]},{name:Cw,init:"true"}])),n),signals:(e,t,n)=>{const i=t.name,r=i+ch,s=t.project,o="(item().isVoronoi ? datum.datum : datum)",a=mn(e.component.selection??{}).reduce((c,f)=>f.type==="interval"?c.concat(f.name+$c):c,[]).map(c=>`indexof(item().mark.name, '${c}') < 0`).join(" && "),u=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let l=`unit: ${Mu(e)}, `;if(t.project.hasSelectionId)l+=`${Ir}: ${o}[${ee(Ir)}]`;else if(As(t))l+=`fields: ${r}, values: [${lm} ? ${lm} : ${xO}]`;else{const c=s.items.map(f=>{const d=e.fieldDef(f.channel);return d!=null&&d.bin?`[${o}[${ee(e.vgField(f.channel,{}))}], ${o}[${ee(e.vgField(f.channel,{binSuffix:"end"}))}]]`:`${o}[${ee(f.field)}]`}).join(", ");l+=`fields: ${r}, values: [${c}]`}if(As(t))return n.concat(s1e(t.name,e.scaleName(aa)),[{name:i+po,on:[{events:[{signal:kw},{signal:lm}],update:`{${l}}`,force:!0}]}]);{const c=t.events;return n.concat([{name:i+po,on:c?[{events:c,update:`${u} ? {${l}} : null`,force:!0}]:[]}])}}};function kO(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=er(r.field),r}function Du(e,t=!0,n=Cn){if(G(e)){const i=e.map(r=>Du(r,t,n));return t?`[${i.join(", ")}]`:i}else if(xu(e))return n(t?wu(e):l0e(e));return t?n(gt(e)):e}function a1e(e,t){for(const n of mn(e.component.selection??{})){const i=n.name;let r=`${i}${po}, ${n.resolve==="global"?"true":`{unit: ${Mu(e)}}`}`;for(const s of pm)s.defined(n)&&(s.signals&&(t=s.signals(e,n,t)),s.modifyExpr&&(r=s.modifyExpr(e,n,r)));t.push({name:i+R1e,on:[{events:{signal:n.name+po},update:`modify(${ee(n.name+Tu)}, ${r})`}]})}return Aw(t)}function u1e(e,t){if(e.component.selection&&Y(e.component.selection).length){const n=ee(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:ia("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return Aw(t)}function l1e(e,t){let n=!1;for(const i of mn(e.component.selection??{})){const r=i.name,s=ee(r+Tu);if(t.filter(a=>a.name===r).length===0){const a=i.resolve==="global"?"union":i.resolve,u=i.type==="point"?", true, true)":")";t.push({name:i.name,update:`${YO}(${s}, ${ee(a)}${u}`})}n=!0;for(const a of pm)a.defined(i)&&a.topLevelSignals&&(t=a.topLevelSignals(e,i,t))}return n&&t.filter(r=>r.name==="unit").length===0&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),Aw(t)}function c1e(e,t){const n=[],i=[],r=Mu(e,{escape:!1});for(const s of mn(e.component.selection??{})){const o={name:s.name+Tu};if(s.project.hasSelectionId&&(o.transform=[{type:"collect",sort:{field:Ir}}]),s.init){const u=s.project.items.map(kO);o.values=s.project.hasSelectionId?s.init.map(l=>({unit:r,[Ir]:Du(l,!1)[0]})):s.init.map(l=>({unit:r,fields:u,values:Du(l,!1)}))}if([...n,...t].filter(u=>u.name===s.name+Tu).length||n.push(o),As(s)&&t.length){const u=e.lookupDataSource(e.getDataName(Tt.Main)),l=t.find(f=>f.name===u),c=l.transform.find(f=>f.type==="filter"&&f.expr.includes("vlSelectionTest"));if(c){l.transform=l.transform.filter(d=>d!==c);const f={name:l.name+_O,source:l.name,transform:[c]};i.push(f)}}}return n.concat(t,i)}function EO(e,t){for(const n of mn(e.component.selection??{}))for(const i of pm)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function f1e(e,t){for(const n of e.children)Mt(n)&&(t=EO(n,t));return t}function d1e(e,t,n,i){const r=dL(e,t.param,t);return{signal:Nr(n.get("type"))&&G(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function Aw(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}const fo={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const r=i.channel;if(!ys(r))continue;const s=e.getScaleComponent(r),o=s?s.get("type"):void 0;if(o=="sequential"&&K(ehe),!s||!Nr(o)){K(Qde);continue}s.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter(o=>n.filter(a=>a.name===o.signals.data).length===0);if(!e.parent||Sw(e)||i.length===0)return n;const r=n.find(o=>o.name===t.name);let s=r.update;if(s.includes(YO))r.update=`{${i.map(o=>`${ee(er(o.field))}: ${o.signals.data}`).join(", ")}}`;else{for(const o of i){const a=`${ee(er(o.field))}: ${o.signals.data}`;s.includes(a)||(s=`${s.substring(0,s.length-1)}, ${a}}`)}r.update=s}return n.concat(i.map(o=>({name:o.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!Sw(e))for(const i of t.scales){const r=n.find(s=>s.name===i.signals.data);r.push="outer",delete r.value,delete r.update}return n}};function $w(e,t){return`domain(${ee(e.scaleName(t))})`}function Sw(e){return e.parent&&Ic(e.parent)&&(!e.parent.parent||Sw(e.parent.parent))}const $c="_brush",CO="_scale_trigger",fh="geo_interval_init_tick",AO="_init",h1e="_center",p1e={defined:e=>e.type==="interval",parse:(e,t,n)=>{var i;if(e.hasProjection){const r={...ie(n.select)?n.select:{}};r.fields=[Ir],r.encodings||(r.encodings=n.value?Y(n.value):[Dr,Fr]),n.select={type:"interval",...r}}if(t.translate&&!fo.defined(t)){const r=`!event.item || event.item.mark.name !== ${ee(t.name+$c)}`;for(const s of t.events){if(!s.between){K(`${s} is not an ordered event stream for interval selections.`);continue}const o=se((i=s.between[0]).filter??(i.filter=[]));o.includes(r)||o.push(r)}}},signals:(e,t,n)=>{const i=t.name,r=i+po,s=mn(t.project.hasChannel).filter(a=>a.channel===Ft||a.channel===sn),o=t.init?t.init[0]:null;if(n.push(...s.reduce((a,u)=>a.concat(g1e(e,t,u,o&&o[u.index])),[])),e.hasProjection){const a=ee(e.projectionName()),u=e.projectionName()+h1e,{x:l,y:c}=t.project.hasChannel,f=l&&l.signals.visual,d=c&&c.signals.visual,h=l?o&&o[l.index]:`${u}[0]`,p=c?o&&o[c.index]:`${u}[1]`,g=x=>e.getSizeSignalRef(x).signal,m=`[[${f?f+"[0]":"0"}, ${d?d+"[0]":"0"}],[${f?f+"[1]":g("width")}, ${d?d+"[1]":g("height")}]]`;o&&(n.unshift({name:i+AO,init:`[scale(${a}, [${l?h[0]:h}, ${c?p[0]:p}]), scale(${a}, [${l?h[1]:h}, ${c?p[1]:p}])]`}),(!l||!c)&&(n.find(k=>k.name===u)||n.unshift({name:u,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})));const y=`intersect(${m}, {markname: ${ee(e.getName("marks"))}}, unit.mark)`,b=`{unit: ${Mu(e)}}`,v=`vlSelectionTuples(${y}, ${b})`,_=s.map(x=>x.signals.visual);return n.concat({name:r,on:[{events:[..._.length?[{signal:_.join(" || ")}]:[],...o?[{signal:fh}]:[]],update:v}]})}else{if(!fo.defined(t)){const l=i+CO,c=s.map(f=>{const d=f.channel,{data:h,visual:p}=f.signals,g=ee(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),y=Nr(m)?"+":"";return`(!isArray(${h}) || (${y}invert(${g}, ${p})[0] === ${y}${h}[0] && ${y}invert(${g}, ${p})[1] === ${y}${h}[1]))`});c.length&&n.push({name:l,value:{},on:[{events:s.map(f=>({scale:e.scaleName(f.channel)})),update:c.join(" && ")+` ? ${l} : {}`}]})}const a=s.map(l=>l.signals.data),u=`unit: ${Mu(e)}, fields: ${i+ch}, values`;return n.concat({name:r,...o?{init:`{${u}: ${Du(o)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${u}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(Mt(e)&&e.hasProjection&&t.init&&(n.filter(r=>r.name===fh).length||n.unshift({name:fh,value:null,on:[{events:"timer{1}",update:`${fh} === null ? {} : ${fh}`}]})),n),marks:(e,t,n)=>{const i=t.name,{x:r,y:s}=t.project.hasChannel,o=r==null?void 0:r.signals.visual,a=s==null?void 0:s.signals.visual,u=`data(${ee(t.name+Tu)})`;if(fo.defined(t)||!r&&!s)return n;const l={x:r!==void 0?{signal:`${o}[0]`}:{value:0},y:s!==void 0?{signal:`${a}[0]`}:{value:0},x2:r!==void 0?{signal:`${o}[1]`}:{field:{group:"width"}},y2:s!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const m of Y(l))l[m]=[{test:`${u}.length && ${u}[0].unit === ${Mu(e)}`,...l[m]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,p=Y(h).reduce((m,y)=>(m[y]=[{test:[r!==void 0&&`${o}[0] !== ${o}[1]`,s!==void 0&&`${a}[0] !== ${a}[1]`].filter(b=>b).join(" && "),value:h[y]},{value:null}],m),{}),g=d??(t.translate?"move":null);return[{name:`${i+$c}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:l}},...n,{name:i+$c,type:"rect",clip:!0,encode:{enter:{...g?{cursor:{value:g}}:{},fill:{value:"transparent"}},update:{...l,...p}}}]}};function g1e(e,t,n,i){const r=!e.hasProjection,s=n.channel,o=n.signals.visual,a=ee(r?e.scaleName(s):e.projectionName()),u=d=>`scale(${a}, ${d})`,l=e.getSizeSignalRef(s===Ft?"width":"height").signal,c=`${s}(unit)`,f=t.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${c}, ${c}]`},{events:h,update:`[${o}[0], clamp(${c}, 0, ${l})]`}],[]);if(r){const d=n.signals.data,h=fo.defined(t),p=e.getScaleComponent(s),g=p?p.get("type"):void 0,m=i?{init:Du(i,!0,u)}:{value:[]};return f.push({events:{signal:t.name+CO},update:Nr(g)?`[${u(`${d}[0]`)}, ${u(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:o,...m,on:f},{name:d,...i?{init:Du(i)}:{},on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${a}, ${o})`}]}]}else{const d=s===Ft?0:1,h=t.name+AO,p=i?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:o,...p,on:f}]}}function Sc({model:e,channelDef:t,vgChannel:n,invalidValueRef:i,mainRefFn:r}){const s=sh(t)&&t.condition;let o=[];s&&(o=se(s).map(l=>{const c=r(l);if(ope(l)){const{param:f,empty:d}=l;return{test:fL(e,{param:f,empty:d}),...c}}else return{test:xm(e,l.test),...c}})),i!==void 0&&o.push(i);const a=r(t);return a!==void 0&&o.push(a),o.length>1||o.length===1&&o[0].test?{[n]:o}:o.length===1?{[n]:o[0]}:{}}function Fw(e,t="text"){const n=e.encoding[t];return Sc({model:e,channelDef:n,vgChannel:t,mainRefFn:i=>cm(i,e.config),invalidValueRef:void 0})}function cm(e,t,n="datum"){if(e){if(Or(e))return Et(e.value);if(Le(e)){const{format:i,formatType:r}=X1(e);return Vx({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function $O(e,t={}){const{encoding:n,markDef:i,config:r,stack:s}=e,o=n.tooltip;if(G(o))return{tooltip:FO({tooltip:o},s,r,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return Sc({model:e,channelDef:o,vgChannel:"tooltip",mainRefFn:l=>{const c=cm(l,r,a);if(c)return c;if(l===null)return;let f=mt("tooltip",i,r);if(f===!0&&(f={content:"encoding"}),re(f))return{value:f};if(ie(f))return be(f)?f:f.content==="encoding"?FO(n,s,r,t):{signal:a}},invalidValueRef:void 0})}}function SO(e,t,n,{reactiveGeom:i}={}){const r={...n,...n.tooltipFormat},s=new Set,o=i?"datum.datum":"datum",a=[];function u(c,f){const d=yu(f),h=ii(c)?c:{...c,type:e[d].type},p=h.title||Jx(h,r),g=se(p).join(", ").replaceAll(/"/g,'\\"');let m;if(Ut(f)){const y=f==="x"?"x2":"y2",b=Lr(e[y]);if(yn(h.bin)&&b){const v=ne(h,{expr:o}),_=ne(b,{expr:o}),{format:x,formatType:k}=X1(h);m=ih(v,_,x,k,r),s.add(y)}}if((Ut(f)||f===tr||f===Sr)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:b}=X1(h);m=Vx({fieldOrDatumDef:h,format:y,formatType:b,expr:o,config:r,normalizeStack:!0}).signal}m??(m=cm(h,r,o).signal),a.push({channel:f,key:g,value:m})}ew(e,(c,f)=>{J(c)?u(c,f):G1(c)&&u(c.condition,f)});const l={};for(const{channel:c,key:f,value:d}of a)!s.has(c)&&!l[f]&&(l[f]=d);return l}function FO(e,t,n,{reactiveGeom:i}={}){const r=SO(e,t,n,{reactiveGeom:i}),s=sa(r).map(([o,a])=>`"${o}": ${a}`);return s.length>0?{signal:`{${s.join(", ")}}`}:void 0}function m1e(e){const{markDef:t,config:n}=e,i=mt("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...y1e(e),...b1e(e)}}function y1e(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=mt("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:ue(Gde,t)?{}:{ariaRoleDescription:{value:t}}}function b1e(e){const{encoding:t,markDef:n,config:i,stack:r}=e,s=t.description;if(s)return Sc({model:e,channelDef:s,vgChannel:"description",mainRefFn:u=>cm(u,e.config),invalidValueRef:void 0});const o=mt("description",n,i);if(o!=null)return{description:Et(o)};if(i.aria===!1)return{};const a=SO(t,r,i);if(!pt(a))return{description:{signal:sa(a).map(([u,l],c)=>`"${c>0?"; ":""}${u}: " + (${l})`).join(" + ")}}}function _n(e,t,n={}){const{markDef:i,encoding:r,config:s}=t,{vgChannel:o}=n;let{defaultRef:a,defaultValue:u}=n;const l=r[e];a===void 0&&(u??(u=mt(e,i,s,{vgChannel:o,ignoreVgConfig:!sh(l)})),u!==void 0&&(a=Et(u)));const c={markDef:i,config:s,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},f=GN({...c,scaleChannel:e,channelDef:l});return Sc({model:t,channelDef:l,vgChannel:o??e,invalidValueRef:f,mainRefFn:h=>Gx({...c,channel:e,channelDef:h,stack:null,defaultRef:a})})}function DO(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:s}=n,o=t.filled??mt("filled",n,r),a=He(["bar","point","circle","square","geoshape"],s)?"transparent":void 0,u=mt(o===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[o===!0&&"color"]??a,l=mt(o===!1?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[o===!1&&"color"],c=o?"fill":"stroke",f={...u?{fill:Et(u)}:{},...l?{stroke:Et(l)}:{}};return n.color&&(o?n.fill:n.stroke)&&K(hN("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,..._n("color",e,{vgChannel:c,defaultValue:o?u:l}),..._n("fill",e,{defaultValue:i.fill?u:void 0}),..._n("stroke",e,{defaultValue:i.stroke?l:void 0})}}function v1e(e){const{encoding:t,mark:n}=e,i=t.order;return!ga(n)&&Or(i)?Sc({model:e,channelDef:i,vgChannel:"zindex",mainRefFn:r=>Et(r.value),invalidValueRef:void 0}):{}}function Fc({channel:e,markDef:t,encoding:n={},model:i,bandPosition:r}){const s=`${e}Offset`,o=t[s],a=n[s];if((s==="xOffset"||s==="yOffset")&&a)return{offsetType:"encoding",offset:Gx({channel:s,channelDef:a,markDef:t,config:i==null?void 0:i.config,scaleName:i.scaleName(s),scale:i.getScaleComponent(s),stack:null,defaultRef:Et(o),bandPosition:r})};const u=t[s];return u?{offsetType:"visual",offset:u}:{}}function ri(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:s,config:o,stack:a}=t,u=r[e],l=r[ms(e)],c=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:h}=Fc({channel:e,markDef:s,encoding:r,model:t,bandPosition:.5}),p=Dw({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),g=!u&&Ut(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:_1e({channel:e,channelDef:u,channel2Def:l,markDef:s,config:o,scaleName:c,scale:f,stack:a,offset:d,defaultRef:p,bandPosition:h==="encoding"?0:void 0});return g?{[i||e]:g}:void 0}function _1e(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:s,markDef:o}=e;if(Le(n)&&r&&t===r.fieldChannel){if(J(n)){let a=n.bandPosition;if(a===void 0&&o.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return q1({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:s})}return Au(n,i,{suffix:"end"},{offset:s})}return Hx(e)}function Dw({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:s,config:o}=e;return()=>{const a=yu(n),u=da(n),l=mt(n,s,o,{vgChannel:u});if(l!==void 0)return nh(n,l);switch(t){case"zeroOrMin":return TO({scaleName:i,scale:r,mode:"zeroOrMin",mainChannel:a,config:o});case"zeroOrMax":return TO({scaleName:i,scale:r,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:a,config:o});case"mid":return{...e[bi(n)],mult:.5}}}}function TO({mainChannel:e,config:t,...n}){const i=HN(n),{mode:r}=n;if(i)return i;switch(e){case"radius":{if(r==="zeroOrMin")return{value:0};const{widthSignal:s,heightSignal:o}=r.zeroOrMax;return{signal:`min(${s},${o})/2`}}case"theta":return r==="zeroOrMin"?{value:0}:{signal:"2*PI"};case"x":return r==="zeroOrMin"?{value:0}:{field:{group:"width"}};case"y":return r==="zeroOrMin"?{field:{group:"height"}}:{value:0}}}const x1e={left:"x",center:"xc",right:"x2"},w1e={top:"y",middle:"yc",bottom:"y2"};function MO(e,t,n,i="middle"){if(e==="radius"||e==="theta")return da(e);const r=e==="x"?"align":"baseline",s=mt(r,t,n);let o;return be(s)?(K($he(r)),o=void 0):o=s,e==="x"?x1e[o||(i==="top"?"left":"center")]:w1e[o||i]}function fm(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?NO(e,t,{defaultPos:n,defaultPos2:i}):ri(e,t,{defaultPos:n})}function NO(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:s}=t,o=ms(e),a=bi(e),u=k1e(t,i,o),l=u[a]?MO(e,r,s):da(e);return{...ri(e,t,{defaultPos:n,vgChannel:l}),...u}}function k1e(e,t,n){const{encoding:i,mark:r,markDef:s,stack:o,config:a}=e,u=yu(n),l=bi(n),c=da(n),f=i[u],d=e.scaleName(u),h=e.getScaleComponent(u),{offset:p}=n in i||n in s?Fc({channel:n,markDef:s,encoding:i,model:e}):Fc({channel:u,markDef:s,encoding:i,model:e});if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const m=bi(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[c]:{field:e.getName(n)}}}const g=E1e({channel:n,channelDef:f,channel2Def:i[n],markDef:s,config:a,scaleName:d,scale:h,stack:o,offset:p,defaultRef:void 0});return g!==void 0?{[c]:g}:dm(n,s)||dm(n,{[n]:bx(n,s,a.style),[l]:bx(l,s,a.style)})||dm(n,a[r])||dm(n,a.mark)||{[c]:Dw({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function E1e({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:o,stack:a,offset:u,defaultRef:l}){return Le(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?Au(t,s,{suffix:"start"},{offset:u}):Hx({channel:e,channelDef:n,scaleName:s,scale:o,stack:a,markDef:i,config:r,offset:u,defaultRef:l})}function dm(e,t){const n=bi(e),i=da(e);if(t[i]!==void 0)return{[i]:nh(e,t[i])};if(t[e]!==void 0)return{[i]:nh(e,t[e])};if(t[n]){const r=t[n];if(Cu(r))K(xhe(n));else return{[n]:nh(e,r)}}}function ho(e,t){const{config:n,encoding:i,markDef:r}=e,s=r.type,o=ms(t),a=bi(t),u=i[t],l=i[o],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=r.orient,h=i[a]??i.size??mt("size",r,n,{vgChannel:a}),p=jM(t),g=s==="bar"&&(t==="x"?d==="vertical":d==="horizontal")||s==="tick"&&(t==="y"?d==="vertical":d==="horizontal");return J(u)&&(wt(u.bin)||yn(u.bin)||u.timeUnit&&!l)&&!(h&&!Cu(h))&&!i[p]&&!an(f)?$1e({fieldDef:u,fieldDef2:l,channel:t,model:e}):(Le(u)&&an(f)||g)&&!l?A1e(u,t,e):NO(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function C1e(e,t,n,i,r,s,o){if(Cu(r))if(n){const u=n.get("type");if(u==="band"){let l=`bandwidth('${t}')`;r.band!==1&&(l=`${r.band} * ${l}`);const c=bs("minBandSize",{type:o},i);return{signal:c?`max(${Mr(c)}, ${l})`:l}}else r.band!==1&&(K(The(u)),r=void 0)}else return{mult:r.band,field:{group:e}};else{if(be(r))return r;if(r)return{value:r}}if(n){const u=n.get("range");if(vu(u)&&Je(u.step))return{value:u.step-2}}if(!s){const{bandPaddingInner:u,barBandPaddingInner:l,rectBandPaddingInner:c,tickBandPaddingInner:f}=i.scale,d=jt(u,o==="tick"?f:o==="bar"?l:c);if(be(d))return{signal:`(1 - (${d.signal})) * ${e}`};if(Je(d))return{signal:`${1-d} * ${e}`}}return{value:hw(i.view,e)-2}}function A1e(e,t,n){var C,F;const{markDef:i,encoding:r,config:s,stack:o}=n,a=i.orient,u=n.scaleName(t),l=n.getScaleComponent(t),c=bi(t),f=ms(t),d=jM(t),h=n.scaleName(d),p=n.getScaleComponent(lx(t)),g=i.type==="tick"||a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let m;(r.size||i.size)&&(g?m=_n("size",n,{vgChannel:c,defaultRef:Et(i.size)}):K(Ohe(i.type)));const y=!!m,b=nR({channel:t,fieldDef:e,markDef:i,config:s,scaleType:(C=l||p)==null?void 0:C.get("type"),useVlSizeChannel:g});m=m||{[c]:C1e(c,h||u,p||l,s,b,!!e,i.type)};const v=((F=l||p)==null?void 0:F.get("type"))==="band"&&Cu(b)&&!y?"top":"middle",_=MO(t,i,s,v),x=_==="xc"||_==="yc",{offset:k,offsetType:w}=Fc({channel:t,markDef:i,encoding:r,model:n,bandPosition:x?.5:0}),E=Hx({channel:t,channelDef:e,markDef:i,config:s,scaleName:u,scale:l,stack:o,offset:k,defaultRef:Dw({model:n,defaultPos:"mid",channel:t,scaleName:u,scale:l}),bandPosition:x?w==="encoding"?0:.5:be(b)?{signal:`(1-${b})/2`}:Cu(b)?(1-b.band)/2:0});if(c)return{[_]:E,...m};{const S=da(f),z=m[c],P=k?{...z,offset:k}:z;return{[_]:E,[S]:G(E)?[E[0],{...E[1],offset:P}]:{...E,offset:P}}}}function RO(e,t,n,i,r,s,o){if(OM(e))return 0;const a=e==="x"||e==="y2",u=a?-t/2:t/2;if(be(n)||be(r)||be(i)||s){const l=Mr(n),c=Mr(r),f=Mr(i),d=Mr(s),p=s?`(${o} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${o})) : ${u})`:u,g=f?`${f} + `:"",m=l?`(${l} ? -1 : 1) * `:"",y=c?`(${c} + ${p})`:p;return{signal:g+m+y}}else return r=r||0,i+(n?-r-u:+r+u)}function $1e({fieldDef:e,fieldDef2:t,channel:n,model:i}){var F;const{config:r,markDef:s,encoding:o}=i,a=i.getScaleComponent(n),u=i.scaleName(n),l=a?a.get("type"):void 0,c=a.get("reverse"),f=nR({channel:n,fieldDef:e,markDef:s,config:r,scaleType:l}),d=(F=i.component.axes[n])==null?void 0:F[0],h=(d==null?void 0:d.get("translate"))??.5,p=Ut(n)?mt("binSpacing",s,r)??0:0,g=ms(n),m=da(n),y=da(g),b=bs("minBandSize",s,r),{offset:v}=Fc({channel:n,markDef:s,encoding:o,model:i,bandPosition:0}),{offset:_}=Fc({channel:g,markDef:s,encoding:o,model:i,bandPosition:0}),x=epe({fieldDef:e,scaleName:u}),k=RO(n,p,c,h,v,b,x),w=RO(g,p,c,h,_??v,b,x),E=be(f)?{signal:`(1-${f.signal})/2`}:Cu(f)?(1-f.band)/2:.5,C=ma({fieldDef:e,fieldDef2:t,markDef:s,config:r});if(wt(e.bin)||e.timeUnit){const S=e.timeUnit&&C!==.5;return{[y]:OO({fieldDef:e,scaleName:u,bandPosition:E,offset:w,useRectOffsetField:S}),[m]:OO({fieldDef:e,scaleName:u,bandPosition:be(E)?{signal:`1-${E.signal}`}:1-E,offset:k,useRectOffsetField:S})}}else if(yn(e.bin)){const S=Au(e,u,{},{offset:w});if(J(t))return{[y]:S,[m]:Au(t,u,{},{offset:k})};if(bu(e.bin)&&e.bin.step)return{[y]:S,[m]:{signal:`scale("${u}", ${ne(e,{expr:"datum"})} + ${e.bin.step})`,offset:k}}}K(bN(g))}function OO({fieldDef:e,scaleName:t,bandPosition:n,offset:i,useRectOffsetField:r}){return q1({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i,...r?{startSuffix:am,endSuffix:um}:{}})}const S1e=new Set(["aria","width","height"]);function rr(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?DO(e):{};return{...F1e(e.markDef,t),...LO("fill",n),...LO("stroke",i),..._n("opacity",e),..._n("fillOpacity",e),..._n("strokeOpacity",e),..._n("strokeWidth",e),..._n("strokeDash",e),...v1e(e),...$O(e),...Fw(e,"href"),...m1e(e)}}function LO(e,t){return t?{[e]:t}:{}}function F1e(e,t){return Hde.reduce((n,i)=>(!S1e.has(i)&&Z(e,i)&&t[i]!=="ignore"&&(n[i]=Et(e[i])),n),{})}function Tw(e){const{config:t,markDef:n}=e,i=new Set;if(e.forEachFieldDef((r,s)=>{var l;let o;if(!ys(s)||!(o=e.getScaleType(s)))return;const a=M1(r.aggregate),u=Wx({scaleChannel:s,markDef:n,config:t,scaleType:o,isCountAggregate:a});if(K0e(u)){const c=e.vgField(s,{expr:"datum",binSuffix:(l=e.stack)!=null&&l.impute?"mid":void 0});c&&i.add(c)}}),i.size>0)return{defined:{signal:[...i].map(s=>I1(s,!0)).join(" && ")}}}function IO(e,t){if(t!==void 0)return{[e]:Et(t)}}const Mw="voronoi",PO={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(Mw)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,s=e.mark;if(ga(s))return K(Kde(s)),n;const o={name:e.getName(Mw),type:"path",interactive:!0,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...$O(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,u=!1;return n.forEach((l,c)=>{const f=l.name??"";f===e.component.mark[0].name?a=c:f.includes(Mw)&&(u=!0)}),u||n.splice(a+1,0,o),n}},zO={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!aw(e.bind),parse:(e,t,n)=>XO(t,n),topLevelSignals:(e,t,n)=>{const i=t.name,r=t.project,s=t.bind,o=t.init&&t.init[0],a=PO.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach((u,l)=>{const c=St(`${i}_${u.field}`);n.filter(d=>d.name===c).length||n.unshift({name:c,...o?{init:Du(o[l])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${ee(u.field)}] : null`}]:[],bind:s[u.field]??s[u.channel]??s})}),n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(l=>l.name===i+po),o=i+ch,a=r.items.map(l=>St(`${i}_${l.field}`)),u=a.map(l=>`${l} !== null`).join(" && ");return a.length&&(s.update=`${u} ? {fields: ${o}, values: [${a.join(", ")}]} : null`),delete s.value,delete s.on,n}},hm="_toggle",BO={defined:e=>e.type==="point"&&!As(e)&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+hm,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+po,i=t.name+hm;return`${i} ? null : ${n}, `+(t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${Mu(e)}}, `)+`${i} ? ${n} : null`}},D1e={defined:e=>e.clear!==void 0&&e.clear!==!1&&!As(e),parse:(e,t)=>{t.clear&&(t.clear=re(t.clear)?ia(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(zO.defined(t))for(const i of t.project.items){const r=n.findIndex(s=>s.name===St(`${t.name}_${i.field}`));r!==-1&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(r,s){r!==-1&&n[r].on&&n[r].on.push({events:t.clear,update:s})}if(t.type==="interval")for(const r of t.project.items){const s=n.findIndex(o=>o.name===r.signals.visual);if(i(s,"[0, 0]"),s===-1){const o=n.findIndex(a=>a.name===r.signals.data);i(o,"null")}}else{let r=n.findIndex(s=>s.name===t.name+po);i(r,"null"),BO.defined(t)&&(r=n.findIndex(s=>s.name===t.name+hm),i(r,"false"))}return n}},jO={defined:e=>{const t=e.resolve==="global"&&e.bind&&aw(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==Ir;return t&&!n&&K(the),t&&n},parse:(e,t,n)=>{const i=Re(n);if(i.select=re(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},XO(t,i),ie(n.select)&&(n.select.on||n.select.clear)){const o='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=se(a.filter??[]),a.filter.includes(o)||a.filter.push(o)}const r=uw(t.bind)?t.bind.legend:"click",s=re(r)?ia(r,"view"):se(r);t.bind={legend:{merge:s}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=uw(t.bind)&&t.bind.legend,s=o=>a=>{const u=Re(a);return u.markname=o,u};for(const o of t.project.items){if(!o.hasLegend)continue;const a=`${St(o.field)}_legend`,u=`${i}_${a}`;if(n.filter(c=>c.name===u).length===0){const c=r.merge.map(s(`${a}_symbols`)).concat(r.merge.map(s(`${a}_labels`))).concat(r.merge.map(s(`${a}_entries`)));n.unshift({name:u,...t.init?{}:{value:null},on:[{events:c,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:`!event.item || !datum ? null : ${u}`,force:!0}]})}}return n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(d=>d.name===i+po),o=i+ch,a=r.items.filter(d=>d.hasLegend).map(d=>St(`${i}_${St(d.field)}_legend`)),l=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${o}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?s.on.push({events:a.map(d=>({signal:d})),update:l}):a.length>0&&(s.update=l,delete s.value,delete s.on);const c=n.find(d=>d.name===i+hm),f=uw(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:f}):c.on[0].events=f),n}};function T1e(e,t,n){var r;const i=(r=e.fieldDef(t))==null?void 0:r.field;for(const s of mn(e.component.selection??{})){const o=s.project.hasField[i]??s.project.hasChannel[t];if(o&&jO.defined(s)){const a=n.get("selections")??[];a.push(s.name),n.set("selections",a,!1),o.hasLegend=!0}}}const UO="_translate_anchor",qO="_translate_delta",M1e={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=fo.defined(t),s=i+UO,{x:o,y:a}=t.project.hasChannel;let u=ia(t.translate,"scope");return r||(u=u.map(l=>(l.between[0].markname=i+$c,l))),n.push({name:s,value:{},on:[{events:u.map(l=>l.between[0]),update:"{x: x(unit), y: y(unit)"+(o!==void 0?`, extent_x: ${r?$w(e,Ft):`slice(${o.signals.visual})`}`:"")+(a!==void 0?`, extent_y: ${r?$w(e,sn):`slice(${a.signals.visual})`}`:"")+"}"}]},{name:i+qO,value:{},on:[{events:u,update:`{x: ${s}.x - x(unit), y: ${s}.y - y(unit)}`}]}),o!==void 0&&WO(e,t,o,"width",n),a!==void 0&&WO(e,t,a,"height",n),n}};function WO(e,t,n,i,r){const s=t.name,o=s+UO,a=s+qO,u=n.channel,l=fo.defined(t),c=r.find(x=>x.name===n.signals[l?"data":"visual"]),f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(u),h=d&&d.get("type"),p=d&&d.get("reverse"),g=l?u===Ft?p?"":"-":p?"-":"":"",m=`${o}.extent_${u}`,y=`${g}${a}.${u} / ${l?`${f}`:`span(${m})`}`,b=!l||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",v=l?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",_=`${b}(${m}, ${y}${v})`;c.on.push({events:{signal:a},update:l?_:`clampRange(${_}, 0, ${f})`})}const HO="_zoom_anchor",GO="_zoom_delta",N1e={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=fo.defined(t),s=i+GO,{x:o,y:a}=t.project.hasChannel,u=ee(e.scaleName(Ft)),l=ee(e.scaleName(sn));let c=ia(t.zoom,"scope");return r||(c=c.map(f=>(f.markname=i+$c,f))),n.push({name:i+HO,on:[{events:c,update:r?"{"+[u?`x: invert(${u}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter(f=>f).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:s,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),o!==void 0&&VO(e,t,o,"width",n),a!==void 0&&VO(e,t,a,"height",n),n}};function VO(e,t,n,i,r){const s=t.name,o=n.channel,a=fo.defined(t),u=r.find(b=>b.name===n.signals[a?"data":"visual"]),l=e.getSizeSignalRef(i).signal,c=e.getScaleComponent(o),f=c&&c.get("type"),d=a?$w(e,o):u.name,h=s+GO,p=`${s}${HO}.${o}`,g=!a||!c?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=a?f==="pow"?`, ${c.get("exponent")??1}`:f==="symlog"?`, ${c.get("constant")??1}`:"":"",y=`${g}(${d}, ${p}, ${h}${m})`;u.on.push({events:{signal:h},update:a?y:`clampRange(${y}, 0, ${l})`})}const Tu="_store",po="_tuple",R1e="_modify",YO="vlSelectionResolve",pm=[o1e,p1e,i1e,BO,zO,fo,jO,D1e,M1e,N1e,PO];function O1e(e){let t=e.parent;for(;t&&!Ii(t);)t=t.parent;return t}function Mu(e,{escape:t}={escape:!0}){let n=t?ee(e.name):e.name;const i=O1e(e);if(i){const{facet:r}=i;for(const s of ir)r[s]&&(n+=` + '__facet_${s}_' + (facet[${ee(i.vgField(s))}])`)}return n}function Nw(e){return mn(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function XO(e,t){(re(t.select)||!t.select.on)&&delete e.events,(re(t.select)||!t.select.clear)&&delete e.clear,(re(t.select)||!t.select.toggle)&&delete e.toggle}function As(e){var t;return(t=e.events)==null?void 0:t.find(n=>"type"in n&&n.type==="timer")}const L1e="RawCode",I1e="Literal",P1e="Property",z1e="Identifier",B1e="ArrayExpression",j1e="BinaryExpression",U1e="CallExpression",q1e="ConditionalExpression",W1e="LogicalExpression",H1e="MemberExpression",G1e="ObjectExpression",V1e="UnaryExpression";function Pr(e){this.type=e}Pr.prototype.visit=function(e){let t,n,i;if(e(this))return 1;for(t=Y1e(this),n=0,i=t.length;n",$s[Nu]="Identifier",$s[_a]="Keyword",$s[mm]="Null",$s[Ru]="Numeric",$s[_i]="Punctuator",$s[hh]="String",$s[X1e]="RegularExpression";var Z1e="ArrayExpression",K1e="BinaryExpression",J1e="CallExpression",Q1e="ConditionalExpression",ZO="Identifier",eme="Literal",tme="LogicalExpression",nme="MemberExpression",ime="ObjectExpression",rme="Property",sme="UnaryExpression",un="Unexpected token %0",ome="Unexpected number",ame="Unexpected string",ume="Unexpected identifier",lme="Unexpected reserved word",cme="Unexpected end of input",Rw="Invalid regular expression",Ow="Invalid regular expression: missing /",KO="Octal literals are not allowed in strict mode.",fme="Duplicate data property in object literal not allowed in strict mode",xn="ILLEGAL",ph="Disabled.",dme=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),hme=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function ym(e,t){if(!e)throw new Error("ASSERT: "+t)}function go(e){return e>=48&&e<=57}function Lw(e){return"0123456789abcdefABCDEF".includes(e)}function gh(e){return"01234567".includes(e)}function pme(e){return e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e)}function mh(e){return e===10||e===13||e===8232||e===8233}function yh(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&dme.test(String.fromCharCode(e))}function bm(e){return e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&hme.test(String.fromCharCode(e))}const gme={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function JO(){for(;q1114111||e!=="}")&&nt({},un,xn),t<=65535?String.fromCharCode(t):(n=(t-65536>>10)+55296,i=(t-65536&1023)+56320,String.fromCharCode(n,i))}function QO(){var e,t;for(e=ye.charCodeAt(q++),t=String.fromCharCode(e),e===92&&(ye.charCodeAt(q)!==117&&nt({},un,xn),++q,e=Iw("u"),(!e||e==="\\"||!yh(e.charCodeAt(0)))&&nt({},un,xn),t=e);q>>=")return q+=4,{type:_i,value:o,start:e,end:q};if(s=o.substr(0,3),s===">>>"||s==="<<="||s===">>=")return q+=3,{type:_i,value:s,start:e,end:q};if(r=s.substr(0,2),i===r[1]&&"+-<>&|".includes(i)||r==="=>")return q+=2,{type:_i,value:r,start:e,end:q};if(r==="//"&&nt({},un,xn),"<>=!+-*%&|^/".includes(i))return++q,{type:_i,value:i,start:e,end:q};nt({},un,xn)}function vme(e){let t="";for(;q{if(parseInt(r,16)<=1114111)return"x";nt({},Rw)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch{nt({},Rw)}try{return new RegExp(e,t)}catch{return null}}function kme(){var e,t,n,i,r;for(e=ye[q],ym(e==="/","Regular expression literal must start with a slash"),t=ye[q++],n=!1,i=!1;q=0&&nt({},Rw,n),{value:n,literal:t}}function Cme(){var e,t,n,i;return ft=null,JO(),e=q,t=kme(),n=Eme(),i=wme(t.value,n.value),{literal:t.literal+n.literal,value:i,regex:{pattern:t.value,flags:n.value},start:e,end:q}}function Ame(e){return e.type===Nu||e.type===_a||e.type===gm||e.type===mm}function tL(){if(JO(),q>=In)return{type:dh,start:q,end:q};const e=ye.charCodeAt(q);return yh(e)?bme():e===40||e===41||e===59?Pw():e===39||e===34?xme():e===46?go(ye.charCodeAt(q+1))?eL():Pw():go(e)?eL():Pw()}function xi(){const e=ft;return q=e.end,ft=tL(),q=e.end,e}function nL(){const e=q;ft=tL(),q=e}function $me(e){const t=new Pr(Z1e);return t.elements=e,t}function iL(e,t,n){const i=new Pr(e==="||"||e==="&&"?tme:K1e);return i.operator=e,i.left=t,i.right=n,i}function Sme(e,t){const n=new Pr(J1e);return n.callee=e,n.arguments=t,n}function Fme(e,t,n){const i=new Pr(Q1e);return i.test=e,i.consequent=t,i.alternate=n,i}function zw(e){const t=new Pr(ZO);return t.name=e,t}function bh(e){const t=new Pr(eme);return t.value=e.value,t.raw=ye.slice(e.start,e.end),e.regex&&(t.raw==="//"&&(t.raw="/(?:)/"),t.regex=e.regex),t}function rL(e,t,n){const i=new Pr(nme);return i.computed=e==="[",i.object=t,i.property=n,i.computed||(n.member=!0),i}function Dme(e){const t=new Pr(ime);return t.properties=e,t}function sL(e,t,n){const i=new Pr(rme);return i.key=t,i.value=n,i.kind=e,i}function Tme(e,t){const n=new Pr(sme);return n.operator=e,n.argument=t,n.prefix=!0,n}function nt(e,t){var n,i=Array.prototype.slice.call(arguments,2),r=t.replace(/%(\d)/g,(s,o)=>(ym(o":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11;break}return t}function qme(){var e,t,n,i,r,s,o,a,u,l;if(e=ft,u=_m(),i=ft,r=uL(i),r===0)return u;for(i.prec=r,xi(),t=[e,ft],o=_m(),s=[u,i,o];(r=uL(ft))>0;){for(;s.length>2&&r<=s[s.length-2].prec;)o=s.pop(),a=s.pop().value,u=s.pop(),t.pop(),n=iL(a,u,o),s.push(n);i=xi(),i.prec=r,s.push(i),t.push(ft),n=_m(),s.push(n)}for(l=s.length-1,n=s[l],t.pop();l>1;)t.pop(),n=iL(s[l-1].value,s[l-2],n),l-=2;return n}function Ou(){var e,t,n;return e=qme(),Ct("?")&&(xi(),t=Ou(),Pn(":"),n=Ou(),e=Fme(e,t,n)),e}function jw(){const e=Ou();if(Ct(","))throw new Error(ph);return e}function Wme(e){ye=e,q=0,In=ye.length,ft=null,nL();const t=jw();if(ft.type!==dh)throw new Error("Unexpect token after expression.");return t}function Uw(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...Uw(e.object)),t.push(...Uw(e.property))),t)}function lL(e){return e.object.type==="MemberExpression"?lL(e.object):e.object.name==="datum"}function cL(e){const t=Wme(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&lL(i)&&n.add(Uw(i).slice(1).join("."))}),n}class Dc extends ct{clone(){return new Dc(null,this.model,Re(this.filter))}constructor(t,n,i){super(t),this.model=n,this.filter=i,this.expr=xm(this.model,this.filter,this),this._dependentFields=cL(this.expr)}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function Hme(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;let r=0;for(const s of t){const o=St(s.name),a=s.select,u=re(a)?a:a.type,l=ie(a)?Re(a):{type:u},c=i[u];for(const h in c)h==="fields"||h==="encodings"||(h==="mark"&&(l.mark={...c.mark,...l.mark}),(l[h]===void 0||l[h]===!0)&&(l[h]=Re(c[h]??l[h])));const f=n[o]={...l,name:o,type:u,init:s.value,bind:s.bind,events:re(l.on)?ia(l.on,"scope"):se(Re(l.on))};if(As(f)&&(r++,r>1)){delete n[o];continue}const d=Re(s);for(const h of pm)h.defined(f)&&h.parse&&h.parse(e,f,d)}return r>1&&K(ahe),n}function fL(e,t,n,i="datum"){const r=re(t)?t:t.param,s=St(r),o=ee(s+Tu);let a;try{a=e.getSelectionComponent(s,r)}catch{return`!!${s}`}if(a.project.timeUnit){const d=n??e.component.data.raw,h=a.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const u=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",l=a.resolve==="global"?")":`, ${ee(a.resolve)})`,c=`${u}${o}, ${i}${l}`,f=`length(data(${o}))`;return t.empty===!1?`${f} && ${c}`:`!${f} || ${c}`}function dL(e,t,n){const i=St(t),r=n.encoding;let s=n.field,o;try{o=e.getSelectionComponent(i,t)}catch{return i}if(!r&&!s)s=o.project.items[0].field,o.project.items.length>1&&K(uhe(s));else if(r&&!s){const a=o.project.items.filter(u=>u.channel===r);!a.length||a.length>1?(s=o.project.items[0].field,K(lhe(a,r,n,s))):s=a[0].field}return`${o.name}[${ee(er(s))}]`}function Gme(e,t){for(const[n,i]of sa(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new vi(new Dc(t,e,{param:n}),r,Tt.Lookup,e.component.data.outputNodeRefCounts)}}function xm(e,t,n){return Vd(t,i=>re(i)?i:b0e(i)?fL(e,i,n):DN(i))}function Vme(e,t){if(e)return G(e)&&!pa(e)?e.map(n=>Jx(n,t)).join(", "):e}function qw(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function vh(e,t,n,i={header:!1}){var f,d;const{disable:r,orient:s,scale:o,labelExpr:a,title:u,zindex:l,...c}=e.combine();if(!r){for(const h in c){const p=h,g=_pe[p],m=c[p];if(g&&g!==t&&g!=="both")delete c[p];else if(uh(m)){const{condition:y,...b}=m,v=se(y),_=hR[p];if(_){const{vgProp:x,part:k}=_,w=[...v.map(E=>{const{test:C,...F}=E;return{test:xm(null,C),...F}}),b];qw(c,k,x,w),delete c[p]}else if(_===null){const x={signal:v.map(k=>{const{test:w,...E}=k;return`${xm(null,w)} ? ${KM(E)} : `}).join("")+KM(b)};c[p]=x}}else if(be(m)){const y=hR[p];if(y){const{vgProp:b,part:v}=y;qw(c,v,b,m),delete c[p]}}He(["labelAlign","labelBaseline"],p)&&c[p]===null&&delete c[p]}if(t==="grid"){if(!c.grid)return;if(c.encode){const{grid:h}=c.encode;c.encode={...h?{grid:h}:{}},pt(c.encode)&&delete c.encode}return{scale:o,orient:s,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:jt(l,0)}}else{if(!i.header&&e.mainExtracted)return;if(a!==void 0){let p=a;(d=(f=c.encode)==null?void 0:f.labels)!=null&&d.update&&be(c.encode.labels.update.text)&&(p=pu(a,"datum.label",c.encode.labels.update.text.signal)),qw(c,"labels","text",{signal:p})}if(c.labelAlign===null&&delete c.labelAlign,c.encode){for(const p of pR)e.hasAxisPart(p)||delete c.encode[p];pt(c.encode)&&delete c.encode}const h=Vme(u,n);return{scale:o,orient:s,grid:!1,...h?{title:h}:{},...c,...n.aria===!1?{aria:!1}:{},zindex:jt(l,0)}}}}function hL(e){const{axes:t}=e.component,n=[];for(const i of ro)if(t[i]){for(const r of t[i])if(!r.get("disable")&&!r.get("gridScale")){const s=i==="x"?"height":"width",o=e.getSizeSignalRef(s).signal;s!==o&&n.push({name:s,update:o})}}return n}function Yme(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>vh(r,"grid",t)),...i.map(r=>vh(r,"grid",t)),...n.map(r=>vh(r,"main",t)),...i.map(r=>vh(r,"main",t))].filter(r=>r)}function pL(e,t,n,i){return Object.assign.apply(null,[{},...e.map(r=>{if(r==="axisOrient"){const s=n==="x"?"bottom":"left",o=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},u=new Set([...Y(o),...Y(a)]),l={};for(const c of u.values())l[c]={signal:`${i.signal} === "${s}" ? ${Mr(o[c])} : ${Mr(a[c])}`};return l}return t[r]})])}function Xme(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:ON(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],s=e==="x"?"axisX":"axisY",o=be(n)?"axisOrient":`axis${Yd(n)}`,a=[...r,...r.map(l=>s+l.substr(4))],u=["axis",o,s];return{vlOnlyAxisConfig:pL(a,i,e,n),vgAxisConfig:pL(u,i,e,n),axisConfigStyle:Zme([...u,...a],i)}}function Zme(e,t){var i;const n=[{}];for(const r of e){let s=(i=t[r])==null?void 0:i.style;if(s){s=se(s);for(const o of s)n.push(t.style[o])}}return Object.assign.apply(null,n)}function Ww(e,t,n,i={}){var s;const r=QM(e,n,t);if(r!==void 0)return{configFrom:"style",configValue:r};for(const o of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((s=i[o])==null?void 0:s[e])!==void 0)return{configFrom:o,configValue:i[o][e]};return{}}const gL={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??Kme(n,e),gridScale:({model:e,channel:t})=>Jme(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||yL(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||mL(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??e2e(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??t2e(t.type,n,J(t)&&!!t.timeUnit,J(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:i,scaleType:r})=>{const s=e==="x"?"width":e==="y"?"height":void 0,o=s?t.getSizeSignalRef(s):void 0;return n.tickCount??i2e({fieldOrDatumDef:i,scaleType:r,size:o,values:n.values})},tickMinStep:r2e,title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=bL(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),s=n==="x"?"x2":"y2",o=t.fieldDef(s);return tN(r?[tR(r)]:[],J(o)?[tR(o)]:[])},values:({axis:e,fieldOrDatumDef:t})=>s2e(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??o2e(n,t)};function Kme(e,t){return!an(e)&&J(t)&&!wt(t==null?void 0:t.bin)&&!yn(t==null?void 0:t.bin)}function Jme(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function Qme(e,t,n,i,r){const s=t==null?void 0:t.labelAngle;if(s!==void 0)return be(s)?s:Xd(s);{const{configValue:o}=Ww("labelAngle",i,t==null?void 0:t.style,r);return o!==void 0?Xd(o):n===Ft&&He([Lx,Ox],e.type)&&!(J(e)&&e.timeUnit)?270:void 0}}function Hw(e){return`(((${e.signal} % 360) + 360) % 360)`}function mL(e,t,n,i){if(e!==void 0)if(n==="x"){if(be(e)){const r=Hw(e),s=be(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${r} && ${r} < 135) || (225 < ${r} && ${r} < 315) ? "middle" :(${r} <= 45 || 315 <= ${r}) === ${s} ? "bottom" : "top"`}}if(45{if(Su(i)&&eR(i.sort)){const{field:s,timeUnit:o}=i,a=i.sort,u=a.map((l,c)=>`${DN({field:s,timeUnit:o,equal:l})} ? ${c} : `).join("")+a.length;t=new Tc(t,{calculate:u,as:Mc(i,r,{forAs:!0})})}}),t}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${Ve(this.transform)}`}}function Mc(e,t,n){return ne(e,{prefix:t,suffix:"sort_index",...n})}function wm(e,t){return He(["top","bottom"],t)?"column":He(["left","right"],t)||e==="row"?"row":"column"}function Nc(e,t,n,i){const r=i==="row"?n.headerRow:i==="column"?n.headerColumn:n.headerFacet;return jt((t||{})[e],r[e],n.header[e])}function km(e,t,n,i){const r={};for(const s of e){const o=Nc(s,t||{},n,i);o!==void 0&&(r[s]=o)}return r}const Gw=["row","column"],Vw=["header","footer"];function a2e(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,r=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:s,titleAngle:o,titleOrient:a}=km(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),u=wm(t,a),l=Xd(o);return{name:`${t}-title`,type:"group",role:`${u}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",..._L(l,u),...vL(u,l,s),...xL(i,r,t,jpe,RR)}}}function vL(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=yL(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function _L(e,t){const n=mL(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function u2e(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of Vw)if(n[r])for(const s of n[r]){const o=c2e(e,t,r,n,s);o!=null&&i.push(o)}return i}function l2e(e,t){const{sort:n}=e;return ao(n)?{field:ne(n,{expr:"datum"}),order:n.order??"ascending"}:G(n)?{field:Mc(e,t,{expr:"datum"}),order:"ascending"}:{field:ne(e,{expr:"datum"}),order:n??"ascending"}}function Yw(e,t,n){const{format:i,formatType:r,labelAngle:s,labelAnchor:o,labelOrient:a,labelExpr:u}=km(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),l=Vx({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,c=wm(t,a);return{text:{signal:u?pu(pu(u,"datum.label",l),"datum.value",ne(e,{expr:"parent"})):l},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",..._L(s,c),...vL(c,s,o),...xL(n,e,t,Upe,OR)}}function c2e(e,t,n,i,r){if(r){let s=null;const{facetFieldDef:o}=i,a=e.config?e.config:void 0;if(o&&r.labels){const{labelOrient:f}=km(["labelOrient"],o.header,a,t);(t==="row"&&!He(["top","bottom"],f)||t==="column"&&!He(["left","right"],f))&&(s=Yw(o,t,a))}const u=Ii(e)&&!rh(e.facet),l=r.axes,c=(l==null?void 0:l.length)>0;if(s||c){const f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...i.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:l2e(o,t)}:{},...c&&u?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...s?{title:s}:{},...r.sizeSignal?{encode:{update:{[f]:r.sizeSignal}}}:{},...c?{axes:l}:{}}}}return null}const f2e={column:{start:0,end:1},row:{start:1,end:0}};function d2e(e,t){return f2e[t][e]}function h2e(e,t){const n={};for(const i of ir){const r=e[i];if(r!=null&&r.facetFieldDef){const{titleAnchor:s,titleOrient:o}=km(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=wm(i,o),u=d2e(s,a);u!==void 0&&(n[a]=u)}}return pt(n)?void 0:n}function xL(e,t,n,i,r){const s={};for(const o of i){if(!r[o])continue;const a=Nc(o,t==null?void 0:t.header,e,n);a!==void 0&&(s[r[o]]=a)}return s}function Xw(e){return[...Em(e,"width"),...Em(e,"height"),...Em(e,"childWidth"),...Em(e,"childHeight")]}function Em(e,t){const n=t==="width"?"x":"y",i=e.component.layoutSize.get(t);if(!i||i==="merged")return[];const r=e.getSizeSignalRef(t).signal;if(i==="step"){const s=e.getScaleComponent(n);if(s){const o=s.get("type"),a=s.get("range");if(an(o)&&vu(a)){const u=e.scaleName(n);return Ii(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[wL(u,a)]:[wL(u,a),{name:r,update:kL(u,s,`domain('${u}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(i=="container"){const s=r.endsWith("width"),o=s?"containerSize()[0]":"containerSize()[1]",a=dw(e.config.view,s?"width":"height"),u=`isFinite(${o}) ? ${o} : ${a}`;return[{name:r,init:u,on:[{update:u,events:"window:resize"}]}]}else return[{name:r,value:i}]}function wL(e,t){const n=`${e}_step`;return be(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function kL(e,t,n){const i=t.get("type"),r=t.get("padding"),s=jt(t.get("paddingOuter"),r);let o=t.get("paddingInner");return o=i==="band"?o!==void 0?o:r:1,`bandspace(${n}, ${Mr(o)}, ${Mr(s)}) * ${e}_step`}function EL(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function CL(e,t){return Y(e).reduce((n,i)=>({...n,...Sc({model:t,channelDef:e[i],vgChannel:i,mainRefFn:r=>Et(r.value),invalidValueRef:void 0})}),{})}function AL(e,t){if(Ii(t))return e==="theta"?"independent":"shared";if(Ic(t))return"shared";if(f6(t))return Ut(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function Zw(e,t){const n=e.scale[t],i=Ut(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&K(Bhe(t)),"independent"):e[i][t]||"shared"}const p2e={...Wpe,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},$L=Y(p2e);class g2e extends co{}const SL={symbols:m2e,gradient:y2e,labels:b2e,entries:v2e};function m2e(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r,legendType:s}){if(s!=="symbol")return;const{markDef:o,encoding:a,config:u,mark:l}=n,c=o.filled&&l!=="trail";let f={...Yde({},n,W0e),...DO(n,{filled:c})};const d=r.get("symbolOpacity")??u.legend.symbolOpacity,h=r.get("symbolFillColor")??u.legend.symbolFillColor,p=r.get("symbolStrokeColor")??u.legend.symbolStrokeColor,g=d===void 0?FL(a.opacity)??o.opacity:void 0;if(f.fill){if(i==="fill"||c&&i===mi)delete f.fill;else if(Z(f.fill,"field"))h?delete f.fill:(f.fill=Et(u.legend.symbolBaseFillColor??"black"),f.fillOpacity=Et(g??1));else if(G(f.fill)){const m=Kw(a.fill??a.color)??o.fill??(c&&o.color);m&&(f.fill=Et(m))}}if(f.stroke){if(i==="stroke"||!c&&i===mi)delete f.stroke;else if(Z(f.stroke,"field")||p)delete f.stroke;else if(G(f.stroke)){const m=jt(Kw(a.stroke||a.color),o.stroke,c?o.color:void 0);m&&(f.stroke={value:m})}}if(i!==io){const m=J(t)&&TL(n,r,t);m?f.opacity=[{test:m,...Et(g??1)},Et(u.legend.unselectedOpacity)]:g&&(f.opacity=Et(g))}return f={...f,...e},pt(f)?void 0:f}function y2e(e,{model:t,legendType:n,legendCmpt:i}){if(n!=="gradient")return;const{config:r,markDef:s,encoding:o}=t;let a={};const l=(i.get("gradientOpacity")??r.legend.gradientOpacity)===void 0?FL(o.opacity)||s.opacity:void 0;return l&&(a.opacity=Et(l)),a={...a,...e},pt(a)?void 0:a}function b2e(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const s=n.legend(i)||{},o=n.config,a=J(t)?TL(n,r,t):void 0,u=a?[{test:a,value:1},{value:o.legend.unselectedOpacity}]:void 0,{format:l,formatType:c}=s;let f;$u(c)?f=Rr({fieldOrDatumDef:t,field:"datum.value",format:l,formatType:c,config:o}):l===void 0&&c===void 0&&o.customFormatTypes&&(t.type==="quantitative"&&o.numberFormatType?f=Rr({fieldOrDatumDef:t,field:"datum.value",format:o.numberFormat,formatType:o.numberFormatType,config:o}):t.type==="temporal"&&o.timeFormatType&&J(t)&&t.timeUnit===void 0&&(f=Rr({fieldOrDatumDef:t,field:"datum.value",format:o.timeFormat,formatType:o.timeFormatType,config:o})));const d={...u?{opacity:u}:{},...f?{text:f}:{},...e};return pt(d)?void 0:d}function v2e(e,{legendCmpt:t}){const n=t.get("selections");return n!=null&&n.length?{...e,fill:{value:"transparent"}}:e}function FL(e){return DL(e,(t,n)=>Math.max(t,n.value))}function Kw(e){return DL(e,(t,n)=>jt(t,n.value))}function DL(e,t){if(upe(e))return se(e.condition).reduce(t,e.value);if(Or(e))return e.value}function TL(e,t,n){const i=t.get("selections");if(!(i!=null&&i.length))return;const r=ee(n.field);return i.map(s=>`(!length(data(${ee(St(s)+Tu)})) || (${s}[${r}] && indexof(${s}[${r}], datum.value) >= 0))`).join(" || ")}const ML={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return XN(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return ZN(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??A2e(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??$2e(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??x2e(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>xc(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(gc(n)&&_s(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>_2e(t,e)};function _2e(e,t){const n=e.values;if(G(n))return dR(t,n);if(be(n))return n}function x2e(e,t,n,i){if(t!=="shape"){const r=Kw(n)??i;if(r)return r}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function w2e(e){const{legend:t}=e;return jt(t.type,k2e(e))}function k2e({channel:e,timeUnit:t,scaleType:n}){if(gc(e)){if(He(["quarter","month","day"],t))return"symbol";if(_s(n))return"gradient"}return"symbol"}function E2e({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??C2e(n,t)}function C2e(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return t==="gradient"?"horizontal":void 0}}function A2e({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:s,gradientHorizontalMinLength:o,gradientVerticalMaxLength:a,gradientVerticalMinLength:u}=e;if(_s(r))return n==="horizontal"?i==="top"||i==="bottom"?NL(t,"width",o,s):o:NL(t,"height",u,a)}function NL(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function $2e(e){if(He(["quantile","threshold","log","symlog"],e))return"greedy"}function RL(e){const t=Mt(e)?S2e(e):M2e(e);return e.component.legends=t,t}function S2e(e){const{encoding:t}=e,n={};for(const i of[mi,...IR]){const r=Kt(t[i]);!r||!e.getScaleComponent(i)||i===yi&&J(r)&&r.type===yc||(n[i]=T2e(e,i))}return n}function F2e(e,t){const n=e.scaleName(t);if(e.mark==="trail"){if(t==="color")return{stroke:n};if(t==="size")return{strokeWidth:n}}return t==="color"?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function D2e(e,t,n,i){switch(t){case"disable":return n!==void 0;case"values":return!!(n!=null&&n.values);case"title":if(t==="title"&&e===(i==null?void 0:i.title))return!0}return e===(n||{})[t]}function T2e(e,t){var _;let n=e.legend(t);const{markDef:i,encoding:r,config:s}=e,o=s.legend,a=new g2e({},F2e(e,t));T1e(e,t,a);const u=n!==void 0?!n:o.disable;if(a.set("disable",u,n!==void 0),u)return a;n=n||{};const l=e.getScaleComponent(t).get("type"),c=Kt(r[t]),f=J(c)?(_=on(c.timeUnit))==null?void 0:_.unit:void 0,d=n.orient||s.legend.orient||"right",h=w2e({legend:n,channel:t,timeUnit:f,scaleType:l}),p=E2e({legend:n,legendType:h,orient:d,legendConfig:o}),g={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:c,legendConfig:o,config:s,scaleType:l,orient:d,legendType:h,direction:p};for(const x of $L){if(h==="gradient"&&x.startsWith("symbol")||h==="symbol"&&x.startsWith("gradient"))continue;const k=x in ML?ML[x](g):n[x];if(k!==void 0){const w=D2e(k,x,n,e.fieldDef(t));(w||s.legend[x]===void 0)&&a.set(x,k,w)}}const m=(n==null?void 0:n.encoding)??{},y=a.get("selections"),b={},v={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:a,legendType:h};for(const x of["labels","legend","title","symbols","gradient","entries"]){const k=CL(m[x]??{},e),w=x in SL?SL[x](k,v):k;w!==void 0&&!pt(w)&&(b[x]={...y!=null&&y.length&&J(c)?{name:`${St(c.field)}_legend_${x}`}:{},...y!=null&&y.length?{interactive:!!y}:{},update:w})}return pt(b)||a.set("encode",b,!!(n!=null&&n.encoding)),a}function M2e(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){RL(i);for(const r of Y(i.component.legends))n.legend[r]=Zw(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=OL(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of Y(t))for(const r of e.children)r.component.legends[i]&&n.legend[i]==="shared"&&delete r.component.legends[i];return t}function OL(e,t){var s,o,a,u;if(!e)return t.clone();const n=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const l of $L){const c=ba(e.getWithExplicit(l),t.getWithExplicit(l),l,"legend",(f,d)=>{switch(l){case"symbolType":return N2e(f,d);case"title":return iN(f,d);case"type":return r=!0,Li("symbol")}return om(f,d,l,"legend")});e.setWithExplicit(l,c)}return r&&((o=(s=e.implicit)==null?void 0:s.encode)!=null&&o.gradient&&E1(e.implicit,["encode","gradient"]),(u=(a=e.explicit)==null?void 0:a.encode)!=null&&u.gradient&&E1(e.explicit,["encode","gradient"])),e}function N2e(e,t){return t.value==="circle"?t:e}function R2e(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function LL(e){const t=e.component.legends,n={};for(const r of Y(t)){const s=e.getScaleComponent(r),o=gt(s.get("domains"));if(n[o])for(const a of n[o])OL(a,t[r])||n[o].push(t[r]);else n[o]=[t[r].clone()]}return mn(n).flat().map(r=>O2e(r,e.config)).filter(r=>r!==void 0)}function O2e(e,t){var o,a,u;const{disable:n,labelExpr:i,selections:r,...s}=e.combine();if(!n){if(t.aria===!1&&s.aria==null&&(s.aria=!1),(o=s.encode)!=null&&o.symbols){const l=s.encode.symbols.update;l.fill&&l.fill.value!=="transparent"&&!l.stroke&&!s.stroke&&(l.stroke={value:"transparent"});for(const c of IR)s[c]&&delete l[c]}if(s.title||delete s.title,i!==void 0){let l=i;(u=(a=s.encode)==null?void 0:a.labels)!=null&&u.update&&be(s.encode.labels.update.text)&&(l=pu(i,"datum.label",s.encode.labels.update.text.signal)),R2e(s,"labels","text",{signal:l})}return s}}function L2e(e){return Ic(e)||f6(e)?I2e(e):IL(e)}function I2e(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),IL(e))}function IL(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n;if(t.data){const r={signal:`[${t.size.map(o=>o.signal).join(", ")}]`},s=t.data.reduce((o,a)=>{const u=be(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return He(o,u)||o.push(u),o},[]);if(s.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:r,fit:{signal:s.length>1?`[${s.join(", ")}]`:s[0]},...n}]}else return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const P2e=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class PL extends co{constructor(t,n,i,r){super({...n},{name:t}),this.specifiedProjection=n,this.size=i,this.data=r,this.merged=!1}get isFit(){return!!this.data}}function zL(e){e.component.projection=Mt(e)?z2e(e):U2e(e)}function z2e(e){if(e.hasProjection){const t=bn(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),i=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=n?B2e(e):void 0,s=new PL(e.projectionName(!0),{...bn(e.config.projection),...t},i,r);return s.get("type")||s.set("type","equalEarth",!1),s}}function B2e(e){const t=[],{encoding:n}=e;for(const i of[[Dr,Fr],[nr,Tr]])(Kt(n[i[0]])||Kt(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(yi)&&e.typedFieldDef(yi).type===yc&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(Tt.Main)),t}function j2e(e,t){const n=tx(P2e,r=>!!(!ue(e.explicit,r)&&!ue(t.explicit,r)||ue(e.explicit,r)&&ue(t.explicit,r)&&Ri(e.get(r),t.get(r))));if(Ri(e.size,t.size)){if(n)return e;if(Ri(e.explicit,{}))return t;if(Ri(t.explicit,{}))return e}return null}function U2e(e){if(e.children.length===0)return;let t;for(const i of e.children)zL(i);const n=tx(e.children,i=>{const r=i.component.projection;if(r)if(t){const s=j2e(t,r);return s&&(t=s),!!s}else return t=r,!0;else return!0});if(t&&n){const i=e.projectionName(!0),r=new PL(i,t.specifiedProjection,t.size,Re(t.data));for(const s of e.children){const o=s.component.projection;o&&(o.isFit&&r.data.push(...s.component.projection.data),s.renameProjection(o.get("name"),i),o.merged=!0)}return r}}function q2e(e,t,n,i){if(ah(t,n)){const r=Mt(e)?e.axis(n)??e.legend(n)??{}:{},s=ne(t,{expr:"datum"}),o=ne(t,{expr:"datum",binSuffix:"end"});return{formulaAs:ne(t,{binSuffix:"range",forAs:!0}),formula:ih(s,o,r.format,r.formatType,i)}}return{}}function BL(e,t){return`${GM(e)}_${t}`}function W2e(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function Jw(e,t,n){const i=K1(n,void 0)??{},r=BL(i,t);return e.getName(`${r}_bins`)}function H2e(e){return"as"in e}function jL(e,t,n){let i,r;H2e(e)?i=re(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:i=[ne(e,{forAs:!0}),ne(e,{binSuffix:"end",forAs:!0})];const s={...K1(t,void 0)},o=BL(s,e.field),{signal:a,extentSignal:u}=W2e(n,o);if(N1(s.extent)){const c=s.extent;r=dL(n,c.param,c),delete s.extent}const l={bin:s,field:e.field,as:[i],...a?{signal:a}:{},...u?{extentSignal:u}:{},...r?{span:r}:{}};return{key:o,binComponent:l}}class Ss extends ct{clone(){return new Ss(null,Re(this.bins))}constructor(t,n){super(t),this.bins=n}static makeFromEncoding(t,n){const i=n.reduceFieldDef((r,s,o)=>{if(ii(s)&&wt(s.bin)){const{key:a,binComponent:u}=jL(s,s.bin,n);r[a]={...u,...r[a],...q2e(n,s,o,n.config)}}return r},{});return pt(i)?null:new Ss(t,i)}static makeFromTransform(t,n,i){const{key:r,binComponent:s}=jL(n,n.bin,i);return new Ss(t,{[r]:s})}merge(t,n){for(const i of Y(t.bins))i in this.bins?(n(t.bins[i].signal,this.bins[i].signal),this.bins[i].as=ds([...this.bins[i].as,...t.bins[i].as],Ve)):this.bins[i]=t.bins[i];for(const i of t.children)t.removeChild(i),i.parent=this;t.remove()}producedFields(){return new Set(mn(this.bins).map(t=>t.as).flat(2))}dependentFields(){return new Set(mn(this.bins).map(t=>t.field))}hash(){return`Bin ${Ve(this.bins)}`}assemble(){return mn(this.bins).flatMap(t=>{const n=[],[i,...r]=t.as,{extent:s,...o}=t.bin,a={type:"bin",field:er(t.field),as:i,signal:t.signal,...N1(s)?{extent:null}:{extent:s},...t.span?{span:{signal:`span(${t.span})`}}:{},...o};!s&&t.extentSignal&&(n.push({type:"extent",field:er(t.field),signal:t.extentSignal}),a.extent={signal:t.extentSignal}),n.push(a);for(const u of r)for(let l=0;l<2;l++)n.push({type:"formula",expr:ne({field:i[l]},{expr:"datum"}),as:u[l]});return t.formula&&n.push({type:"formula",expr:t.formula,as:t.formulaAs}),n})}}function G2e(e,t,n,i){var s;const r=Mt(i)?i.encoding[ms(t)]:void 0;if(ii(n)&&Mt(i)&&iR(n,r,i.markDef,i.config)){e.add(ne(n,{})),e.add(ne(n,{suffix:"end"}));const{mark:o,markDef:a,config:u}=i,l=ma({fieldDef:n,markDef:a,config:u});th(o)&&l!==.5&&Ut(t)&&(e.add(ne(n,{suffix:am})),e.add(ne(n,{suffix:um}))),n.bin&&ah(n,t)&&e.add(ne(n,{binSuffix:"range"}))}else if(IM(t)){const o=LM(t);e.add(i.getName(o))}else e.add(ne(n));return Su(n)&&T0e((s=n.scale)==null?void 0:s.range)&&e.add(n.scale.range.field),e}function V2e(e,t){for(const n of Y(t)){const i=t[n];for(const r of Y(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class zr extends ct{clone(){return new zr(null,new Set(this.dimensions),Re(this.measures))}constructor(t,n,i){super(t),this.dimensions=n,this.measures=i}get groupBy(){return this.dimensions}static makeFromEncoding(t,n){let i=!1;n.forEachFieldDef(o=>{o.aggregate&&(i=!0)});const r={},s=new Set;return!i||(n.forEachFieldDef((o,a)=>{const{aggregate:u,field:l}=o;if(u)if(u==="count")r["*"]??(r["*"]={}),r["*"].count=new Set([ne(o,{forAs:!0})]);else{if(so(u)||ha(u)){const c=so(u)?"argmin":"argmax",f=u[c];r[f]??(r[f]={}),r[f][c]=new Set([ne({op:c,field:f},{forAs:!0})])}else r[l]??(r[l]={}),r[l][u]=new Set([ne(o,{forAs:!0})]);ys(a)&&n.scaleDomain(a)==="unaggregated"&&(r[l]??(r[l]={}),r[l].min=new Set([ne({field:l,aggregate:"min"},{forAs:!0})]),r[l].max=new Set([ne({field:l,aggregate:"max"},{forAs:!0})]))}else G2e(s,a,o,n)}),s.size+Y(r).length===0)?null:new zr(t,s,r)}static makeFromTransform(t,n){var i;const r=new Set,s={};for(const o of n.aggregate){const{op:a,field:u,as:l}=o;a&&(a==="count"?(s["*"]??(s["*"]={}),s["*"].count=new Set([l||ne(o,{forAs:!0})])):(s[u]??(s[u]={}),(i=s[u])[a]??(i[a]=new Set),s[u][a].add(l||ne(o,{forAs:!0}))))}for(const o of n.groupby??[])r.add(o);return r.size+Y(s).length===0?null:new zr(t,r,s)}merge(t){return $M(this.dimensions,t.dimensions)?(V2e(this.measures,t.measures),!0):(n0e("different dimensions, cannot merge"),!1)}addDimensions(t){t.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...Y(this.measures)])}producedFields(){const t=new Set;for(const n of Y(this.measures))for(const i of Y(this.measures[n])){const r=this.measures[n][i];r.size===0?t.add(`${i}_${n}`):r.forEach(t.add,t)}return t}hash(){return`Aggregate ${Ve({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const t=[],n=[],i=[];for(const s of Y(this.measures))for(const o of Y(this.measures[s]))for(const a of this.measures[s][o])i.push(a),t.push(o),n.push(s==="*"?null:er(s));return{type:"aggregate",groupby:[...this.dimensions].map(er),ops:t,fields:n,as:i}}}class Rc extends ct{constructor(t,n,i,r){super(t),this.model=n,this.name=i,this.data=r;for(const s of ir){const o=n.facet[s];if(o){const{bin:a,sort:u}=o;this[s]={name:n.getName(`${s}_domain`),fields:[ne(o),...wt(a)?[ne(o,{binSuffix:"end"})]:[]],...ao(u)?{sortField:u}:G(u)?{sortIndexField:Mc(o,s)}:{}}}}this.childModel=n.child}hash(){let t="Facet";for(const n of ir)this[n]&&(t+=` ${n.charAt(0)}:${Ve(this[n])}`);return t}get fields(){var n;const t=[];for(const i of ir)(n=this[i])!=null&&n.fields&&t.push(...this[i].fields);return t}dependentFields(){const t=new Set(this.fields);for(const n of ir)this[n]&&(this[n].sortField&&t.add(this[n].sortField.field),this[n].sortIndexField&&t.add(this[n].sortIndexField));return t}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const t={};for(const n of ro){const i=this.childModel.component.scales[n];if(i&&!i.merged){const r=i.get("type"),s=i.get("range");if(an(r)&&vu(s)){const o=Am(this.childModel,n),a=l6(o);a?t[n]=a:K(_x(n))}}}return t}assembleRowColumnHeaderData(t,n,i){const r={row:"y",column:"x",facet:void 0}[t],s=[],o=[],a=[];r&&i&&i[r]&&(n?(s.push(`distinct_${i[r]}`),o.push("max")):(s.push(i[r]),o.push("distinct")),a.push(`distinct_${i[r]}`));const{sortField:u,sortIndexField:l}=this[t];if(u){const{op:c=W1,field:f}=u;s.push(f),o.push(c),a.push(ne(u,{forAs:!0}))}else l&&(s.push(l),o.push("max"),a.push(l));return{name:this[t].name,source:n??this.data,transform:[{type:"aggregate",groupby:this[t].fields,...s.length?{fields:s,ops:o,as:a}:{}}]}}assembleFacetHeaderData(t){var u;const{columns:n}=this.model.layout,{layoutHeaders:i}=this.model.component,r=[],s={};for(const l of Gw){for(const c of Vw){const f=(i[l]&&i[l][c])??[];for(const d of f)if(((u=d.axes)==null?void 0:u.length)>0){s[l]=!0;break}}if(s[l]){const c=`length(data("${this.facet.name}"))`,f=l==="row"?n?{signal:`ceil(${c} / ${n})`}:1:n?{signal:`min(${c}, ${n})`}:{signal:c};r.push({name:`${this.facet.name}_${l}`,transform:[{type:"sequence",start:0,stop:f}]})}}const{row:o,column:a}=s;return(o||a)&&r.unshift(this.assembleRowColumnHeaderData("facet",null,t)),r}assemble(){const t=[];let n=null;const i=this.getChildIndependentFieldsWithStep(),{column:r,row:s,facet:o}=this;if(r&&s&&(i.x||i.y)){n=`cross_${this.column.name}_${this.row.name}`;const a=[].concat(i.x??[],i.y??[]),u=a.map(()=>"distinct");t.push({name:n,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:u}]})}for(const a of[Qs,Js])this[a]&&t.push(this.assembleRowColumnHeaderData(a,n,i));if(o){const a=this.assembleFacetHeaderData(i);a&&t.push(...a)}return t}}function UL(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function Y2e(e,t){const n=sx(e);if(t==="number")return`toNumber(${n})`;if(t==="boolean")return`toBoolean(${n})`;if(t==="string")return`toString(${n})`;if(t==="date")return`toDate(${n})`;if(t==="flatten")return n;if(t.startsWith("date:")){const i=UL(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=UL(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return K(fhe(t)),null}function X2e(e){const t={};return k1(e.filter,n=>{if(FN(n)){let i=null;Sx(n)?i=Oi(n.equal):Dx(n)?i=Oi(n.lte):Fx(n)?i=Oi(n.lt):Tx(n)?i=Oi(n.gt):Mx(n)?i=Oi(n.gte):Nx(n)?i=n.range[0]:Rx(n)&&(i=(n.oneOf??n.in)[0]),i&&(xu(i)?t[n.field]="date":Je(i)?t[n.field]="number":re(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function Z2e(e){const t={};function n(i){kc(i)?t[i.field]="date":i.type==="quantitative"&&Bde(i.aggregate)?t[i.field]="number":dc(i.field)>1?i.field in t||(t[i.field]="flatten"):Su(i)&&ao(i.sort)&&dc(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((Mt(e)||Ii(e))&&e.forEachFieldDef((i,r)=>{if(ii(i))n(i);else{const s=yu(r),o=e.fieldDef(s);n({...i,type:o.type})}}),Mt(e)){const{mark:i,markDef:r,encoding:s}=e;if(ga(i)&&!e.encoding.order){const o=r.orient==="horizontal"?"y":"x",a=s[o];J(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function K2e(e){const t={};if(Mt(e)&&e.component.selection)for(const n of Y(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&dc(r.field)>1&&(t[r.field]="flatten")}return t}class zn extends ct{clone(){return new zn(null,Re(this._parse))}constructor(t,n){super(t),this._parse=n}hash(){return`Parse ${Ve(this._parse)}`}static makeExplicit(t,n,i){var o;let r={};const s=n.data;return!va(s)&&((o=s==null?void 0:s.format)!=null&&o.parse)&&(r=s.format.parse),this.makeWithAncestors(t,r,{},i)}static makeWithAncestors(t,n,i,r){for(const a of Y(i)){const u=r.getWithExplicit(a);u.value!==void 0&&(u.explicit||u.value===i[a]||u.value==="derived"||i[a]==="flatten"?delete i[a]:K(cN(a,i[a],u.value)))}for(const a of Y(n)){const u=r.get(a);u!==void 0&&(u===n[a]?delete n[a]:K(cN(a,n[a],u)))}const s=new co(n,i);r.copyAll(s);const o={};for(const a of Y(s.combine())){const u=s.get(a);u!==null&&(o[a]=u)}return Y(o).length===0||r.parseNothing?null:new zn(t,o)}get parse(){return this._parse}merge(t){this._parse={...this._parse,...t.parse},t.remove()}assembleFormatParse(){const t={};for(const n of Y(this._parse)){const i=this._parse[n];dc(n)===1&&(t[n]=i)}return t}producedFields(){return new Set(Y(this._parse))}dependentFields(){return new Set(Y(this._parse))}assembleTransforms(t=!1){return Y(this._parse).filter(n=>t?dc(n)>1:!0).map(n=>{const i=Y2e(n,this._parse[n]);return i?{type:"formula",expr:i,as:fc(n)}:null}).filter(n=>n!==null)}}class xa extends ct{clone(){return new xa(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([Ir])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Ir}}}class _h extends ct{clone(){return new _h(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${Ve(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class xh extends ct{clone(){return new xh(null,this.params)}constructor(t,n){super(t),this.params=n}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${Ve(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class Lu extends ct{constructor(t){super(null),t??(t={name:"source"});let n;if(va(t)||(n=t.format?{...gi(t.format,["parse"])}:{}),lh(t))this._data={values:t.values};else if(Cc(t)){if(this._data={url:t.url},!n.type){let i=/(?:\.([^.]+))?$/.exec(t.url)[1];He(["json","csv","tsv","dsv","topojson"],i)||(i="json"),n.type=i}}else pO(t)?this._data={values:[{type:"Sphere"}]}:(dO(t)||va(t))&&(this._data={});this._generator=va(t),t.name&&(this._name=t.name),n&&!pt(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(t){this._name=t}set parent(t){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}var qL=function(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},J2e=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},wh;function Qw(e){return e instanceof Lu||e instanceof _h||e instanceof xh}class e6{constructor(){wh.set(this,void 0),qL(this,wh,!1,"f")}setModified(){qL(this,wh,!0,"f")}get modifiedFlag(){return J2e(this,wh,"f")}}wh=new WeakMap;class Iu extends e6{getNodeDepths(t,n,i){i.set(t,n);for(const r of t.children)this.getNodeDepths(r,n+1,i);return i}optimize(t){const i=[...this.getNodeDepths(t,0,new Map).entries()].sort((r,s)=>s[1]-r[1]);for(const r of i)this.run(r[0]);return this.modifiedFlag}}class t6 extends e6{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class Q2e extends t6{mergeNodes(t,n){const i=n.shift();for(const r of n)t.removeChild(r),r.parent=i,r.remove()}run(t){const n=t.children.map(r=>r.hash()),i={};for(let r=0;r1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class eye extends t6{constructor(t){super(),this.requiresSelectionId=t&&Nw(t)}run(t){t instanceof xa&&(this.requiresSelectionId&&(Qw(t.parent)||t.parent instanceof zr||t.parent instanceof zn)||(this.setModified(),t.remove()))}}class tye extends e6{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof Cs&&(i=t.producedFields(),nx(i,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(const r of t.children)this.run(r,new Set([...n,...i]))}}class nye extends t6{constructor(){super()}run(t){t instanceof vi&&!t.isRequired()&&(this.setModified(),t.remove())}}class iye extends Iu{run(t){if(!Qw(t)&&!(t.numChildren()>1)){for(const n of t.children)if(n instanceof zn)if(t instanceof zn)this.setModified(),t.merge(n);else{if(rx(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class rye extends Iu{run(t){const n=[...t.children],i=t.children.filter(r=>r instanceof zn);if(t.numChildren()>1&&i.length>=1){const r={},s=new Set;for(const o of i){const a=o.parse;for(const u of Y(a))u in r?r[u]!==a[u]&&s.add(u):r[u]=a[u]}for(const o of s)delete r[o];if(!pt(r)){this.setModified();const o=new zn(t,r);for(const a of n){if(a instanceof zn)for(const u of Y(r))delete a.parse[u];t.removeChild(a),a.parent=o,a instanceof zn&&Y(a.parse).length===0&&a.remove()}}}}}class sye extends Iu{run(t){t instanceof vi||t.numChildren()>0||t instanceof Rc||t instanceof Lu||(this.setModified(),t.remove())}}class oye extends Iu{run(t){const n=t.children.filter(r=>r instanceof Cs),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class aye extends Iu{run(t){const n=t.children.filter(r=>r instanceof zr),i={};for(const r of n){const s=Ve(r.groupBy);s in i||(i[s]=[]),i[s].push(r)}for(const r of Y(i)){const s=i[r];if(s.length>1){const o=s.pop();for(const a of s)o.merge(a)&&(t.removeChild(a),a.parent=o,a.remove(),this.setModified())}}}}class uye extends Iu{constructor(t){super(),this.model=t}run(t){const n=!(Qw(t)||t instanceof Dc||t instanceof zn||t instanceof xa),i=[],r=[];for(const s of t.children)s instanceof Ss&&(n&&!rx(t.producedFields(),s.dependentFields())?i.push(s):r.push(s));if(i.length>0){const s=i.pop();for(const o of i)s.merge(o,this.model.renameSignal.bind(this.model));this.setModified(),t instanceof Ss?t.merge(s,this.model.renameSignal.bind(this.model)):s.swapWithParent()}if(r.length>1){const s=r.pop();for(const o of r)s.merge(o,this.model.renameSignal.bind(this.model));this.setModified()}}}class lye extends Iu{run(t){const n=[...t.children];if(!cc(n,o=>o instanceof vi)||t.numChildren()<=1)return;const r=[];let s;for(const o of n)if(o instanceof vi){let a=o;for(;a.numChildren()===1;){const[u]=a.children;if(u instanceof vi)a=u;else break}r.push(...a.children),s?(t.removeChild(o),o.parent=s.parent,s.parent.removeChild(s),s.parent=a,this.setModified()):s=a}else r.push(o);if(r.length){this.setModified();for(const o of r)o.parent.removeChild(o),o.parent=s}}}class Pu extends ct{clone(){return new Pu(null,Re(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=ds(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return this.transform.groupby&&this.transform.groupby.forEach(t.add,t),this.transform.joinaggregate.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(t){return t.as??ne(t)}hash(){return`JoinAggregateTransform ${Ve(this.transform)}`}assemble(){const t=[],n=[],i=[];for(const s of this.transform.joinaggregate)n.push(s.op),i.push(this.getDefaultName(s)),t.push(s.field===void 0?null:s.field);const r=this.transform.groupby;return{type:"joinaggregate",as:i,ops:n,fields:t,...r!==void 0?{groupby:r}:{}}}}class Oc extends ct{clone(){return new Oc(null,{...this.filter})}constructor(t,n){super(t),this.filter=n}static make(t,n,i){const{config:r,markDef:s}=n,{marks:o,scales:a}=i;if(o==="include-invalid-values"&&a==="include-invalid-values")return null;const u=n.reduceFieldDef((l,c,f)=>{const d=ys(f)&&n.getScaleComponent(f);if(d){const h=d.get("type"),{aggregate:p}=c,g=Wx({scaleChannel:f,markDef:s,config:r,scaleType:h,isCountAggregate:M1(p)});g!=="show"&&g!=="always-valid"&&(l[c.field]=c)}return l},{});return Y(u).length?new Oc(t,u):null}dependentFields(){return new Set(Y(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${Ve(this.filter)}`}assemble(){const t=Y(this.filter).reduce((n,i)=>{const r=this.filter[i],s=ne(r,{expr:"datum"});return r!==null&&(r.type==="temporal"?n.push(`(isDate(${s}) || (${n6(s)}))`):r.type==="quantitative"&&n.push(n6(s))),n},[]);return t.length>0?{type:"filter",expr:t.join(" && ")}:null}}function n6(e){return`isValid(${e}) && isFinite(+${e})`}function cye(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=ne(i);return r&&t.push(r),t},[])}function fye(e){return G(e)&&e.every(t=>re(t))&&e.length>1}class mo extends ct{clone(){return new mo(null,Re(this._stack))}constructor(t,n){super(t),this._stack=n}static makeFromTransform(t,n){const{stack:i,groupby:r,as:s,offset:o="zero"}=n,a=[],u=[];if(n.sort!==void 0)for(const f of n.sort)a.push(f.field),u.push(jt(f.order,"ascending"));const l={field:a,order:u};let c;return fye(s)?c=s:re(s)?c=[s,`${s}_end`]:c=[`${n.stack}_start`,`${n.stack}_end`],new mo(t,{dimensionFieldDefs:[],stackField:i,groupby:r,offset:o,sort:l,facetby:[],as:c})}static makeFromEncoding(t,n){const i=n.stack,{encoding:r}=n;if(!i)return null;const{groupbyChannels:s,fieldChannel:o,offset:a,impute:u}=i,l=s.map(h=>{const p=r[h];return Lr(p)}).filter(h=>!!h),c=cye(n),f=n.encoding.order;let d;if(G(f)||J(f))d=eN(f);else{const h=rR(f)?f.sort:o==="y"?"descending":"ascending";d=c.reduce((p,g)=>(p.field.includes(g)||(p.field.push(g),p.order.push(h)),p),{field:[],order:[]})}return new mo(t,{dimensionFieldDefs:l,stackField:n.vgField(o),facetby:[],stackby:c,sort:d,offset:a,impute:u,as:[n.vgField(o,{suffix:"start",forAs:!0}),n.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(t){this._stack.facetby.push(...t)}dependentFields(){const t=new Set;return t.add(this._stack.stackField),this.getGroupbyFields().forEach(t.add,t),this._stack.facetby.forEach(t.add,t),this._stack.sort.field.forEach(t.add,t),t}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${Ve(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:t,impute:n,groupby:i}=this._stack;return t.length>0?t.map(r=>r.bin?n?[ne(r,{binSuffix:"mid"})]:[ne(r,{}),ne(r,{binSuffix:"end"})]:[ne(r)]).flat():i??[]}assemble(){const t=[],{facetby:n,dimensionFieldDefs:i,stackField:r,stackby:s,sort:o,offset:a,impute:u,as:l}=this._stack;if(u)for(const c of i){const{bandPosition:f=.5,bin:d}=c;if(d){const h=ne(c,{expr:"datum"}),p=ne(c,{expr:"datum",binSuffix:"end"});t.push({type:"formula",expr:`${n6(h)} ? ${f}*${h}+${1-f}*${p} : ${h}`,as:ne(c,{binSuffix:"mid",forAs:!0})})}t.push({type:"impute",field:r,groupby:[...s,...n],key:ne(c,{binSuffix:"mid"}),method:"value",value:0})}return t.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:r,sort:o,as:l,offset:a}),t}}class Lc extends ct{clone(){return new Lc(null,Re(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=ds(this.transform.groupby.concat(t),n=>n)}dependentFields(){const t=new Set;return(this.transform.groupby??[]).forEach(t.add,t),(this.transform.sort??[]).forEach(n=>t.add(n.field)),this.transform.window.map(n=>n.field).filter(n=>n!==void 0).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(t){return t.as??ne(t)}hash(){return`WindowTransform ${Ve(this.transform)}`}assemble(){const t=[],n=[],i=[],r=[];for(const f of this.transform.window)n.push(f.op),i.push(this.getDefaultName(f)),r.push(f.param===void 0?null:f.param),t.push(f.field===void 0?null:f.field);const s=this.transform.frame,o=this.transform.groupby;if(s&&s[0]===null&&s[1]===null&&n.every(f=>mx(f)))return{type:"joinaggregate",as:i,ops:n,fields:t,...o!==void 0?{groupby:o}:{}};const a=[],u=[];if(this.transform.sort!==void 0)for(const f of this.transform.sort)a.push(f.field),u.push(f.order??"ascending");const l={field:a,order:u},c=this.transform.ignorePeers;return{type:"window",params:r,as:i,ops:n,fields:t,sort:l,...c!==void 0?{ignorePeers:c}:{},...o!==void 0?{groupby:o}:{},...s!==void 0?{frame:s}:{}}}}function dye(e){function t(n){if(!(n instanceof Rc)){const i=n.clone();if(i instanceof vi){const r=r6+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof zr||i instanceof mo||i instanceof Lc||i instanceof Pu)&&i.addDimensions(e.fields);for(const r of n.children.flatMap(t))r.parent=i;return[i]}return n.children.flatMap(t)}return t}function i6(e){if(e instanceof Rc)if(e.numChildren()===1&&!(e.children[0]instanceof vi)){const t=e.children[0];(t instanceof zr||t instanceof mo||t instanceof Lc||t instanceof Pu)&&t.addDimensions(e.fields),t.swapWithParent(),i6(e)}else{const t=e.model.component.data.main;WL(t);const n=dye(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map(i6)}function WL(e){if(e instanceof vi&&e.type===Tt.Main&&e.numChildren()===1){const t=e.children[0];t instanceof Rc||(t.swapWithParent(),WL(e))}}const r6="scale_",Cm=5;function s6(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!s6(t.children))return!1}return!0}function Br(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function HL(e,t,n){let i=e.sources,r=!1;return r=Br(new nye,i)||r,r=Br(new eye(t),i)||r,i=i.filter(s=>s.numChildren()>0),r=Br(new sye,i)||r,i=i.filter(s=>s.numChildren()>0),n||(r=Br(new iye,i)||r,r=Br(new uye(t),i)||r,r=Br(new tye,i)||r,r=Br(new rye,i)||r,r=Br(new aye,i)||r,r=Br(new oye,i)||r,r=Br(new Q2e,i)||r,r=Br(new lye,i)||r),e.sources=i,r}function hye(e,t){s6(e.sources);let n=0,i=0;for(let r=0;rt(n))}}function GL(e){Mt(e)?pye(e):gye(e)}function pye(e){const t=e.component.scales;for(const n of Y(t)){const i=yye(e,n);if(t[n].setWithExplicit("domains",i),vye(e,n),e.component.data.isFaceted){let s=e;for(;!Ii(s)&&s.parent;)s=s.parent;if(s.component.resolve.scale[n]==="shared")for(const a of i.value)oo(a)&&(a.data=r6+a.data.replace(r6,""))}}}function gye(e){for(const n of e.children)GL(n);const t=e.component.scales;for(const n of Y(t)){let i,r=null;for(const s of e.children){const o=s.component.scales[n];if(o){i===void 0?i=o.getWithExplicit("domains"):i=ba(i,o.getWithExplicit("domains"),"domains","scale",u6);const a=o.get("selectionExtent");r&&a&&r.param!==a.param&&K(rhe),r=a}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function mye(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:s}=VL(t,n);if(!r){K(s);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=VL(t,n);if(r)return"unaggregated"}return e}function yye(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=mye(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return r!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:r}),t==="x"&&Kt(i.x2)?Kt(i.x)?ba(wa(n,r,e,"x"),wa(n,r,e,"x2"),"domain","scale",u6):wa(n,r,e,"x2"):t==="y"&&Kt(i.y2)?Kt(i.y)?ba(wa(n,r,e,"y"),wa(n,r,e,"y2"),"domain","scale",u6):wa(n,r,e,"y2"):wa(n,r,e,t)}function bye(e,t,n){return e.map(i=>({signal:`{data: ${J1(i,{timeUnit:n,type:t})}}`}))}function o6(e,t,n){var r;const i=(r=on(n))==null?void 0:r.unit;return t==="temporal"||i?bye(e,t,i):[e]}function wa(e,t,n,i){const{encoding:r,markDef:s,mark:o,config:a,stack:u}=n,l=Kt(r[i]),{type:c}=l,f=l.timeUnit,d=t1e({invalid:bs("invalid",s,a),isPath:ga(o)});if(D0e(t)){const g=wa(e,void 0,n,i),m=o6(t.unionWith,c,f);return Es([...m,...g.value])}else{if(be(t))return Es([t]);if(t&&t!=="unaggregated"&&!IN(t))return Es(o6(t,c,f))}if(u&&i===u.fieldChannel){if(u.offset==="normalize")return Li([[0,1]]);const g=n.requestDataName(d);return Li([{data:g,field:n.vgField(i,{suffix:"start"})},{data:g,field:n.vgField(i,{suffix:"end"})}])}const h=ys(i)&&J(l)?_ye(n,i,e):void 0;if(ws(l)){const g=o6([l.datum],c,f);return Li(g)}const p=l;if(t==="unaggregated"){const{field:g}=l;return Li([{data:n.requestDataName(d),field:ne({field:g,aggregate:"min"})},{data:n.requestDataName(d),field:ne({field:g,aggregate:"max"})}])}else if(wt(p.bin)){if(an(e))return Li(e==="bin-ordinal"?[]:[{data:Gd(h)?n.requestDataName(d):n.requestDataName(Tt.Raw),field:n.vgField(i,ah(p,i)?{binSuffix:"range"}:{}),sort:h===!0||!ie(h)?{field:n.vgField(i,{}),op:"min"}:h}]);{const{bin:g}=p;if(wt(g)){const m=Jw(n,p.field,g);return Li([new ln(()=>{const y=n.getSignalName(m);return`[${y}.start, ${y}.stop]`})])}else return Li([{data:n.requestDataName(d),field:n.vgField(i,{})}])}}else if(p.timeUnit&&He(["time","utc"],e)){const g=r[ms(i)];if(iR(p,g,s,a)){const m=n.requestDataName(d),y=ma({fieldDef:p,fieldDef2:g,markDef:s,config:a}),b=th(o)&&y!==.5&&Ut(i);return Li([{data:m,field:n.vgField(i,b?{suffix:am}:{})},{data:m,field:n.vgField(i,{suffix:b?um:"end"})}])}}return Li(h?[{data:Gd(h)?n.requestDataName(d):n.requestDataName(Tt.Raw),field:n.vgField(i),sort:h}]:[{data:n.requestDataName(d),field:n.vgField(i)}])}function a6(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":W1),...i?{field:er(i)}:{},...r?{order:r}:{}}}function vye(e,t){var a;const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=(a=e.fieldDef(t))==null?void 0:a.bin,s=IN(i)?i:void 0,o=bu(r)&&N1(r.extent)?r.extent:void 0;(s||o)&&n.set("selectionExtent",s??o,!0)}function _ye(e,t,n){if(!an(n))return;const i=e.fieldDef(t),r=i.sort;if(eR(r))return{op:"min",field:Mc(i,t),order:"ascending"};const{stack:s}=e,o=s?new Set([...s.groupbyFields,...s.stackBy.map(a=>a.fieldDef.field)]):void 0;if(ao(r)){const a=s&&!o.has(r.field);return a6(r,a)}else if(spe(r)){const{encoding:a,order:u}=r,l=e.fieldDef(a),{aggregate:c,field:f}=l,d=s&&!o.has(f);if(so(c)||ha(c))return a6({field:ne(l),order:u},d);if(mx(c)||!c)return a6({op:c,field:f,order:u},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(He(["ascending",void 0],r))return!0}}function VL(e,t){const{aggregate:n,type:i}=e;return n?re(n)&&!Ude.has(n)?{valid:!1,reason:Nhe(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:Rhe(e)}:{valid:!0}:{valid:!1,reason:Mhe(e)}}function u6(e,t,n,i){return e.explicit&&t.explicit&&K(zhe(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function xye(e){const t=ds(e.map(o=>{if(oo(o)){const{sort:a,...u}=o;return u}return o}),Ve),n=ds(e.map(o=>{if(oo(o)){const a=o.sort;return a!==void 0&&!Gd(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(o=>o!==void 0),Ve);if(t.length===0)return;if(t.length===1){const o=e[0];if(oo(o)&&n.length>0){let a=n[0];if(n.length>1){K(mN);const u=n.filter(l=>ie(l)&&"op"in l&&l.op!=="min");n.every(l=>ie(l)&&"op"in l)&&u.length===1?a=u[0]:a=!0}else if(ie(a)&&"field"in a){const u=a.field;o.field===u&&(a=a.order?{order:a.order}:!0)}return{...o,sort:a}}return o}const i=ds(n.map(o=>Gd(o)||!("op"in o)||re(o.op)&&ue(Pde,o.op)?o:(K(jhe(o)),!0)),Ve);let r;i.length===1?r=i[0]:i.length>1&&(K(mN),r=!0);const s=ds(e.map(o=>oo(o)?o.data:null),o=>o);return s.length===1&&s[0]!==null?{data:s[0],fields:t.map(a=>a.field),...r?{sort:r}:{}}:{fields:t,...r?{sort:r}:{}}}function l6(e){if(oo(e)&&re(e.field))return e.field;if(qde(e)){let t;for(const n of e.fields)if(oo(n)&&re(n.field)){if(!t)t=n.field;else if(t!==n.field)return K(Uhe),t}return K(qhe),t}else if(Wde(e)){K(Whe);const t=e.fields[0];return re(t)?t:void 0}}function Am(e,t){const i=e.component.scales[t].get("domains").map(r=>(oo(r)&&(r.data=e.lookupDataSource(r.data)),r));return xye(i)}function YL(e){return Ic(e)||f6(e)?e.children.reduce((t,n)=>t.concat(YL(n)),XL(e)):XL(e)}function XL(e){return Y(e.component.scales).reduce((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:s,type:o,selectionExtent:a,domains:u,range:l,reverse:c,...f}=r,d=wye(r.range,s,n,e),h=Am(e,n),p=a?d1e(e,a,i,h):null;return t.push({name:s,type:o,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...c!==void 0?{reverse:c}:{},...f}),t},[])}function wye(e,t,n,i){if(Ut(n)){if(vu(e))return{step:{signal:`${t}_step`}}}else if(ie(e)&&oo(e))return{...e,data:i.lookupDataSource(e.data)};return e}class ZL extends co{constructor(t,n){super({},{name:t}),this.merged=!1,this.setWithExplicit("type",n)}domainHasZero(){const t=this.get("type");if(He([vn.LOG,vn.TIME,vn.UTC],t))return"definitely-not";const n=this.get("zero");if(n===!0||n===void 0&&He([vn.LINEAR,vn.SQRT,vn.POW],t))return"definitely";const i=this.get("domains");if(i.length>0){let r=!1,s=!1,o=!1;for(const a of i){if(G(a)){const u=a[0],l=a[a.length-1];if(Je(u)&&Je(l))if(u<=0&&l>=0){r=!0;continue}else{s=!0;continue}}o=!0}if(r)return"definitely";if(s&&!o)return"definitely-not"}return"maybe"}}const kye=["range","scheme"];function Eye(e){const t=e.component.scales;for(const n of px){const i=t[n];if(!i)continue;const r=Cye(n,e);i.setWithExplicit("range",r)}}function KL(e,t){const n=e.fieldDef(t);if(n!=null&&n.bin){const{bin:i,field:r}=n,s=bi(t),o=e.getName(s);if(ie(i)&&i.binned&&i.step!==void 0)return new ln(()=>{const a=e.scaleName(t),u=`(domain("${a}")[1] - domain("${a}")[0]) / ${i.step}`;return`${e.getSignalName(o)} / (${u})`});if(wt(i)){const a=Jw(e,r,i);return new ln(()=>{const u=e.getSignalName(a),l=`(${u}.stop - ${u}.start) / ${u}.step`;return`${e.getSignalName(o)} / (${l})`})}}}function Cye(e,t){const n=t.specifiedScales[e],{size:i}=t,s=t.getScaleComponent(e).get("type");for(const f of kye)if(n[f]!==void 0){const d=Px(s,f),h=PN(e,f);if(!d)K(pN(s,f,e));else if(h)K(h);else switch(f){case"range":{const p=n.range;if(G(p)){if(Ut(e))return Es(p.map(g=>{if(g==="width"||g==="height"){const m=t.getName(g),y=t.getSignalName.bind(t);return ln.fromName(y,m)}return g}))}else if(ie(p))return Es({data:t.requestDataName(Tt.Main),field:p.field,sort:{op:"min",field:t.vgField(e)}});return Es(p)}case"scheme":return Es(Aye(n[f]))}}const o=e===Ft||e==="xOffset"?"width":"height",a=i[o];if(ks(a)){if(Ut(e))if(an(s)){const f=QL(a,t,e);if(f)return Es({step:f})}else K(gN(o));else if(Jd(e)){const f=e===oa?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const p=eI(a,s);if(p)return Es(p)}}}const{rangeMin:u,rangeMax:l}=n,c=$ye(e,t);return(u!==void 0||l!==void 0)&&Px(s,"rangeMin")&&G(c)&&c.length===2?Es([u??c[0],l??c[1]]):Li(c)}function Aye(e){return F0e(e)?{scheme:e.name,...gi(e,["name"])}:{scheme:e}}function JL(e,t,n,{center:i}={}){const r=bi(e),s=t.getName(r),o=t.getSignalName.bind(t);return e===sn&&Nr(n)?i?[ln.fromName(a=>`${o(a)}/2`,s),ln.fromName(a=>`-${o(a)}/2`,s)]:[ln.fromName(o,s),0]:i?[ln.fromName(a=>`-${o(a)}/2`,s),ln.fromName(a=>`${o(a)}/2`,s)]:[0,ln.fromName(o,s)]}function $ye(e,t){const{size:n,config:i,mark:r,encoding:s}=t,{type:o}=Kt(s[e]),u=t.getScaleComponent(e).get("type"),{domain:l,domainMid:c}=t.specifiedScales[e];switch(e){case Ft:case sn:{if(He(["point","band"],u)){const f=tI(e,n,i.view);if(ks(f))return{step:QL(f,t,e)}}return JL(e,t,u)}case oa:case hc:return Sye(e,t,u);case no:{const f=Tye(r,i),d=Mye(r,n,t,i);return bc(u)?Dye(f,d,Fye(u,i,l,e)):[f,d]}case tr:return[0,Math.PI*2];case gu:return[0,360];case Sr:return[0,new ln(()=>{const f=t.getSignalName(Ii(t.parent)?"child_width":"width"),d=t.getSignalName(Ii(t.parent)?"child_height":"height");return`min(${f},${d})/2`})];case aa:return{step:1e3/i.scale.framesPerSecond};case ca:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case fa:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case yi:return"symbol";case mi:case ps:case gs:return u==="ordinal"?o==="nominal"?"category":"ordinal":c!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case io:case ua:case la:return[i.scale.minOpacity,i.scale.maxOpacity]}}function QL(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),s=lx(n),o=i[s];if(zR({step:e,offsetIsDiscrete:Le(o)&&TN(o.type)})==="offset"&&bR(i,s)){const u=t.getScaleComponent(s);let c=`domain('${t.scaleName(s)}').length`;if(u.get("type")==="band"){const d=u.get("paddingInner")??u.get("padding")??0,h=u.get("paddingOuter")??u.get("padding")??0;c=`bandspace(${c}, ${d}, ${h})`}const f=r.get("paddingInner")??r.get("padding");return{signal:`${e.step} * ${c} / (1-${Vde(f)})`}}else return e.step}function eI(e,t){if(zR({step:e,offsetIsDiscrete:an(t)})==="offset")return{step:e.step}}function Sye(e,t,n){const i=e===oa?"x":"y",r=t.getScaleComponent(i);if(!r)return JL(i,t,n,{center:!0});const s=r.get("type"),o=t.scaleName(i),{markDef:a,config:u}=t;if(s==="band"){const l=tI(i,t.size,t.config.view);if(ks(l)){const c=eI(l,n);if(c)return c}return[0,{signal:`bandwidth('${o}')`}]}else{const l=t.encoding[i];if(J(l)&&l.timeUnit){const c=$N(l.timeUnit,p=>`scale('${o}', ${p})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=ma({fieldDef:l,markDef:a,config:u})-.5,h=d!==0?` + ${d}`:"";if(f){const p=be(f)?`${f.signal}/2`+h:`${f/2+d}`,g=be(f)?`(1 - ${f.signal}/2)`+h:`${1-f/2+d}`;return[{signal:`${p} * (${c})`},{signal:`${g} * (${c})`}]}return[0,{signal:c}]}return CM(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}function tI(e,t,n){const i=e===Ft?"width":"height",r=t[i];return r||rm(n,i)}function Fye(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&G(n)?n.length+1:(K(Qhe(i)),3)}}function Dye(e,t,n){const i=()=>{const r=Mr(t),s=Mr(e),o=`(${r} - ${s}) / (${n} - 1)`;return`sequence(${s}, ${r} + ${o}, ${o})`};return be(t)?new ln(i):{signal:i()}}function Tye(e,t){switch(e){case"bar":case"tick":return t.scale.minBandSize;case"line":case"trail":case"rule":return t.scale.minStrokeWidth;case"text":return t.scale.minFontSize;case"point":case"square":case"circle":return t.scale.minSize}throw new Error(R1("size",e))}const nI=.95;function Mye(e,t,n,i){const r={x:KL(n,"x"),y:KL(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const s=iI(t,r,i.view);return Je(s)?s-1:new ln(()=>`${s.signal} - 1`)}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const s=iI(t,r,i.view);return Je(s)?Math.pow(nI*s,2):new ln(()=>`pow(${nI} * ${s.signal}, 2)`)}}throw new Error(R1("size",e))}function iI(e,t,n){const i=ks(e.width)?e.width.step:hw(n,"width"),r=ks(e.height)?e.height.step:hw(n,"height");return t.x||t.y?new ln(()=>`min(${[t.x?t.x.signal:i,t.y?t.y.signal:r].join(", ")})`):Math.min(i,r)}function rI(e,t){Mt(e)?Nye(e,t):aI(e,t)}function Nye(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:s,specifiedScales:o}=e;for(const a of Y(n)){const u=o[a],l=n[a],c=e.getScaleComponent(a),f=Kt(r[a]),d=u[t],h=c.get("type"),p=c.get("padding"),g=c.get("paddingInner"),m=Px(h,t),y=PN(a,t);if(d!==void 0&&(m?y&&K(y):K(pN(h,t,a))),m&&y===void 0)if(d!==void 0){const b=f.timeUnit,v=f.type;switch(t){case"domainMax":case"domainMin":xu(u[t])||v==="temporal"||b?l.set(t,{signal:J1(u[t],{type:v,timeUnit:b})},!0):l.set(t,u[t],!0);break;default:l.copyKeyFromObject(t,u)}}else{const b=Z(sI,t)?sI[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:u.domain,domainMin:u.domainMin,domainMax:u.domainMax,markDef:s,config:i,hasNestedOffsetScale:vR(r,a),hasSecondaryRangeChannel:!!r[ms(a)]}):i.scale[t];b!==void 0&&l.set(t,b,!1)}}}const sI={bins:({model:e,fieldOrDatumDef:t})=>J(t)?Rye(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>Oye(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:s})=>Lye(e,t,n,i,r,s),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>Iye(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:s})=>Pye(e,t,n.type,i,r.scale,s),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:s})=>zye(e,t,n,i,r.scale,s),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>{const r=J(e)?e.sort:void 0;return Bye(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:s,hasSecondaryRangeChannel:o})=>jye(e,t,n,i,r,s.scale,o)};function oI(e){Mt(e)?Eye(e):aI(e,"range")}function aI(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?oI(i):rI(i,t);for(const i of Y(n)){let r;for(const s of e.children){const o=s.component.scales[i];if(o){const a=o.getWithExplicit(t);r=ba(r,a,t,"scale",fO((u,l)=>{switch(t){case"range":return u.step&&l.step?u.step-l.step:0}return 0}))}}n[i].setWithExplicit(t,r)}}function Rye(e,t){const n=t.bin;if(wt(n)){const i=Jw(e,t.field,n);return new ln(()=>e.getSignalName(i))}else if(yn(n)&&bu(n)&&n.step!==void 0)return{step:n.step}}function Oye(e,t){if(He([mi,ps,gs],e)&&t!=="nominal")return"hcl"}function Lye(e,t,n,i,r,s){var o;if(!((o=Lr(s))!=null&&o.bin||G(n)||r!=null||i!=null||He([vn.TIME,vn.UTC],e)))return Ut(t)?!0:void 0}function Iye(e,t,n,i,r,s){if(Ut(e)){if(_s(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:o,orient:a}=r;if(o==="bar"&&!(J(i)&&(i.bin||i.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return s.continuousBandSize}if(t===vn.POINT)return n.pointPadding}}function Pye(e,t,n,i,r,s=!1){if(e===void 0){if(Ut(t)){const{bandPaddingInner:o,barBandPaddingInner:a,rectBandPaddingInner:u,tickBandPaddingInner:l,bandWithNestedOffsetPaddingInner:c}=r;return s?c:jt(o,n==="bar"?a:n==="tick"?l:u)}else if(Jd(t)&&i===vn.BAND)return r.offsetBandPaddingInner}}function zye(e,t,n,i,r,s=!1){if(e===void 0){if(Ut(t)){const{bandPaddingOuter:o,bandWithNestedOffsetPaddingOuter:a}=r;if(s)return a;if(n===vn.BAND)return jt(o,be(i)?{signal:`${i.signal}/2`}:i/2)}else if(Jd(t)){if(n===vn.POINT)return .5;if(n===vn.BAND)return r.offsetBandPaddingOuter}}}function Bye(e,t,n,i){if(n==="x"&&i.xReverse!==void 0)return Nr(e)&&t==="descending"?be(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(Nr(e)&&t==="descending")return!0}function jye(e,t,n,i,r,s,o){if(!!n&&n!=="unaggregated"&&Nr(r)){if(G(n)){const u=n[0],l=n[n.length-1];if(Je(u)&&u<=0&&Je(l)&&l>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!bc(r))return!0;if(!(J(t)&&t.bin)&&He([...ro,...Fde],e)){const{orient:u,type:l}=i;return He(["bar","area","line","trail"],l)&&(u==="horizontal"&&e==="y"||u==="vertical"&&e==="x")?!1:He(["bar","area"],l)&&!o?!0:s==null?void 0:s.zero}return!1}function Uye(e,t,n,i,r=!1){const s=qye(t,n,i,r),{type:o}=e;return ys(t)?o!==void 0?L0e(t,o)?J(n)&&!O0e(o,n.type)?(K(Ihe(o,s)),s):o:(K(Lhe(t,o,s)),s):s:null}function qye(e,t,n,i){var r;switch(t.type){case"nominal":case"ordinal":{if(gc(e)||gx(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&K(kx(e,"ordinal")),"ordinal";if(hx(e))return"band";if(Ut(e)||Jd(e)){if(He(["rect","bar","image","rule","tick"],n.type)||i)return"band"}else if(n.type==="arc"&&e in dx)return"band";const s=n[bi(e)];return Cu(s)||_c(t)&&((r=t.axis)!=null&&r.tickBand)?"band":"point"}case"temporal":return gc(e)?"time":gx(e)==="discrete"?(K(kx(e,"temporal")),"ordinal"):J(t)&&t.timeUnit&&on(t.timeUnit).utc?"utc":hx(e)?"band":"time";case"quantitative":return gc(e)?J(t)&&wt(t.bin)?"bin-ordinal":"linear":gx(e)==="discrete"?(K(kx(e,"quantitative")),"ordinal"):hx(e)?"band":"linear";case"geojson":return}throw new Error(dN(t.type))}function Wye(e,{ignoreRange:t}={}){uI(e),GL(e);for(const n of R0e)rI(e,n);t||oI(e)}function uI(e){Mt(e)?e.component.scales=Hye(e):e.component.scales=Vye(e)}function Hye(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const s of px){const o=Kt(t[s]);if(o&&n===jN&&s===yi&&o.type===yc)continue;let a=o&&o.scale;if(o&&a!==null&&a!==!1){a??(a={});const u=vR(t,s),l=Uye(a,s,o,i,u);r[s]=new ZL(e.scaleName(`${s}`,!0),{value:l,explicit:a.type===l})}}return r}const Gye=fO((e,t)=>MN(e)-MN(t));function Vye(e){var t;const n=e.component.scales={},i={},r=e.component.resolve;for(const s of e.children){uI(s);for(const o of Y(s.component.scales))if((t=r.scale)[o]??(t[o]=AL(o,e)),r.scale[o]==="shared"){const a=i[o],u=s.component.scales[o].getWithExplicit("type");a?E0e(a.value,u.value)?i[o]=ba(a,u,"type","scale",Gye):(r.scale[o]="independent",delete i[o]):i[o]=u}}for(const s of Y(i)){const o=e.scaleName(s,!0),a=i[s];n[s]=new ZL(o,a);for(const u of e.children){const l=u.component.scales[s];l&&(u.renameScale(l.get("name"),o),l.merged=!0)}}return n}class c6{constructor(){this.nameMap={}}rename(t,n){this.nameMap[t]=n}has(t){return this.nameMap[t]!==void 0}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function Mt(e){return(e==null?void 0:e.type)==="unit"}function Ii(e){return(e==null?void 0:e.type)==="facet"}function f6(e){return(e==null?void 0:e.type)==="concat"}function Ic(e){return(e==null?void 0:e.type)==="layer"}class d6{constructor(t,n,i,r,s,o,a){this.type=n,this.parent=i,this.config=s,this.parent=i,this.config=s,this.view=bn(a),this.name=t.name??r,this.title=pa(t.title)?{text:t.title}:t.title?bn(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new c6,this.projectionNameMap=i?i.projectionNameMap:new c6,this.signalNameMap=i?i.signalNameMap:new c6,this.data=t.data,this.description=t.description,this.transforms=qge(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:Ype(t,n,s),this.component={data:{sources:i?i.component.data.sources:[],outputNodes:i?i.component.data.outputNodes:{},outputNodeRefCounts:i?i.component.data.outputNodeRefCounts:{},isFaceted:H1(t)||(i==null?void 0:i.component.data.isFaceted)&&t.data===void 0},layoutSize:new co,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...o?Re(o):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){Wye(this)}parseProjection(){zL(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){RL(this)}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const s of Y(i)){const o=i[s];o!==void 0&&(r[s]=Et(o))}return r}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=Et(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:pt(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:i,config:r}=this,s=h2e(i.layoutHeaders,r);return{padding:t,...this.assembleDefaultLayout(),...n,...s?{titleBand:s}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const i of ir)t[i].title&&n.push(a2e(this,i));for(const i of Gw)n=n.concat(u2e(this,i));return n}assembleAxes(){return Yme(this.component.axes,this.config)}assembleLegends(){return LL(this)}assembleProjections(){return L2e(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={...YM(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(i.text)return He(["unit","layer"],this.type)?He(["middle",void 0],i.anchor)&&(i.frame??(i.frame="group")):i.anchor??(i.anchor="start"),pt(i)?void 0:i}assembleGroup(t=[]){const n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);const i=this.assembleLayout();i&&(n.layout=i),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||Ii(this.parent)?YL(this):[];r.length>0&&(n.scales=r);const s=this.assembleAxes();s.length>0&&(n.axes=s);const o=this.assembleLegends();return o.length>0&&(n.legends=o),n}getName(t){return St((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(Tt[t].toLowerCase())}requestDataName(t){const n=this.getDataName(t),i=this.component.data.outputNodeRefCounts;return i[n]=(i[n]||0)+1,n}getSizeSignalRef(t){if(Ii(this.parent)){const n=EL(t),i=T1(n),r=this.component.scales[i];if(r&&!r.merged){const s=r.get("type"),o=r.get("range");if(an(s)&&vu(o)){const a=r.get("name"),u=Am(this,i),l=l6(u);if(l){const c=ne({aggregate:"distinct",field:l},{expr:"datum"});return{signal:kL(a,r,c)}}else return K(_x(i)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const n=this.component.data.outputNodes[t];return n?n.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,n){this.signalNameMap.rename(t,n)}renameScale(t,n){this.scaleNameMap.rename(t,n)}renameProjection(t,n){this.projectionNameMap.rename(t,n)}scaleName(t,n){if(n)return this.getName(t);if(zM(t)&&ys(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t)))return this.scaleNameMap.get(this.getName(t))}projectionName(t){if(t)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[t];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(t):void 0}getScaleType(t){const n=this.getScaleComponent(t);return n?n.get("type"):void 0}getSelectionComponent(t,n){let i=this.component.selection[t];if(!i&&this.parent&&(i=this.parent.getSelectionComponent(t,n)),!i)throw new Error(Jde(n));return i}hasAxisOrientSignalRef(){var t,n;return((t=this.component.axes.x)==null?void 0:t.some(i=>i.hasOrientSignalRef()))||((n=this.component.axes.y)==null?void 0:n.some(i=>i.hasOrientSignalRef()))}}class lI extends d6{vgField(t,n={}){const i=this.fieldDef(t);if(i)return ne(i,n)}reduceFieldDef(t,n){return Cpe(this.getMapping(),(i,r,s)=>{const o=Lr(r);return o?t(i,o,s):i},n)}forEachFieldDef(t,n){ew(this.getMapping(),(i,r)=>{const s=Lr(i);s&&t(s,r)},n)}}class $m extends ct{clone(){return new $m(null,Re(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Re(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"value",i[1]??"density"];const r=this.transform.resolve??"shared";this.transform.resolve=r}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${Ve(this.transform)}`}assemble(){const{density:t,...n}=this.transform,i={type:"kde",field:t,...n};return i.resolve=this.transform.resolve,i}}class Sm extends ct{clone(){return new Sm(null,Re(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Re(n)}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${Ve(this.transform)}`}assemble(){const{extent:t,param:n}=this.transform;return{type:"extent",field:t,signal:n}}}class Fm extends ct{clone(){return new Fm(this.parent,Re(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Re(n);const{flatten:i,as:r=[]}=this.transform;this.transform.as=i.map((s,o)=>r[o]??s)}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${Ve(this.transform)}`}assemble(){const{flatten:t,as:n}=this.transform;return{type:"flatten",fields:t,as:n}}}class Dm extends ct{clone(){return new Dm(null,Re(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Re(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"key",i[1]??"value"]}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${Ve(this.transform)}`}assemble(){const{fold:t,as:n}=this.transform;return{type:"fold",fields:t,as:n}}}class Pc extends ct{clone(){return new Pc(null,Re(this.fields),this.geojson,this.signal)}static parseAll(t,n){if(n.component.projection&&!n.component.projection.isFit)return t;let i=0;for(const r of[[Dr,Fr],[nr,Tr]]){const s=r.map(o=>{const a=Kt(n.encoding[o]);return J(a)?a.field:ws(a)?{expr:`${a.datum}`}:Or(a)?{expr:`${a.value}`}:void 0});(s[0]||s[1])&&(t=new Pc(t,s,null,n.getName(`geojson_${i++}`)))}if(n.channelHasField(yi)){const r=n.typedFieldDef(yi);r.type===yc&&(t=new Pc(t,null,r.field,n.getName(`geojson_${i++}`)))}return t}constructor(t,n,i,r){super(t),this.fields=n,this.geojson=i,this.signal=r}dependentFields(){const t=(this.fields??[]).filter(re);return new Set([...this.geojson?[this.geojson]:[],...t])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${Ve(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class kh extends ct{clone(){return new kh(null,this.projection,Re(this.fields),Re(this.as))}constructor(t,n,i,r){super(t),this.projection=n,this.fields=i,this.as=r}static parseAll(t,n){if(!n.projectionName())return t;for(const i of[[Dr,Fr],[nr,Tr]]){const r=i.map(o=>{const a=Kt(n.encoding[o]);return J(a)?a.field:ws(a)?{expr:`${a.datum}`}:Or(a)?{expr:`${a.value}`}:void 0}),s=i[0]===nr?"2":"";(r[0]||r[1])&&(t=new kh(t,n.projectionName(),r,[n.getName(`x${s}`),n.getName(`y${s}`)]))}return t}dependentFields(){return new Set(this.fields.filter(re))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${Ve(this.fields)} ${Ve(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class zu extends ct{clone(){return new zu(null,Re(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(t){const{start:n=0,stop:i,step:r}=t;return{signal:`sequence(${[n,i,...r?[r]:[]].join(",")})`}}static makeFromTransform(t,n){return new zu(t,n)}static makeFromEncoding(t,n){const i=n.encoding,r=i.x,s=i.y;if(J(r)&&J(s)){const o=r.impute?r:s.impute?s:void 0;if(o===void 0)return;const a=r.impute?s:s.impute?r:void 0,{method:u,value:l,frame:c,keyvals:f}=o.impute,d=wR(n.mark,i);return new zu(t,{impute:o.field,key:a.field,...u?{method:u}:{},...l!==void 0?{value:l}:{},...c?{frame:c}:{},...f!==void 0?{keyvals:f}:{},...d.length?{groupby:d}:{}})}return null}hash(){return`Impute ${Ve(this.transform)}`}assemble(){const{impute:t,key:n,keyvals:i,method:r,groupby:s,value:o,frame:a=[null,null]}=this.transform,u={type:"impute",field:t,key:n,...i?{keyvals:Ege(i)?this.processSequence(i):i}:{},method:"value",...s?{groupby:s}:{},value:!r||r==="value"?o:null};if(r&&r!=="value"){const l={type:"window",as:[`imputed_${t}_value`],ops:[r],fields:[t],frame:a,ignorePeers:!1,...s?{groupby:s}:{}},c={type:"formula",expr:`datum.${t} === null ? datum.imputed_${t}_value : datum.${t}`,as:t};return[u,l,c]}else return[u]}}class Tm extends ct{clone(){return new Tm(null,Re(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Re(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.loess]}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${Ve(this.transform)}`}assemble(){const{loess:t,on:n,...i}=this.transform;return{type:"loess",x:n,y:t,...i}}}class Eh extends ct{clone(){return new Eh(null,Re(this.transform),this.secondary)}constructor(t,n,i){super(t),this.transform=n,this.secondary=i}static make(t,n,i,r){const s=n.component.data.sources,{from:o}=i;let a=null;if(Cge(o)){let u=hI(o.data,s);u||(u=new Lu(o.data),s.push(u));const l=n.getName(`lookup_${r}`);a=new vi(u,l,Tt.Lookup,n.component.data.outputNodeRefCounts),n.component.data.outputNodes[l]=a}else if(Age(o)){const u=o.param;i={as:u,...i};let l;try{l=n.getSelectionComponent(St(u),u)}catch{throw new Error(nhe(u))}if(a=l.materialized,!a)throw new Error(ihe(u))}return new Eh(t,i,a.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?se(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${Ve({transform:this.transform,secondary:this.secondary})}`}assemble(){let t;if(this.transform.from.fields)t={values:this.transform.from.fields,...this.transform.as?{as:se(this.transform.as)}:{}};else{let n=this.transform.as;re(n)||(K(phe),n="_lookup"),t={as:[n]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...t,...this.transform.default?{default:this.transform.default}:{}}}}class Mm extends ct{clone(){return new Mm(null,Re(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Re(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??"prob",i[1]??"value"]}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${Ve(this.transform)}`}assemble(){const{quantile:t,...n}=this.transform;return{type:"quantile",field:t,...n}}}class Nm extends ct{clone(){return new Nm(null,Re(this.transform))}constructor(t,n){super(t),this.transform=n,this.transform=Re(n);const i=this.transform.as??[void 0,void 0];this.transform.as=[i[0]??n.on,i[1]??n.regression]}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${Ve(this.transform)}`}assemble(){const{regression:t,on:n,...i}=this.transform;return{type:"regression",x:n,y:t,...i}}}class Rm extends ct{clone(){return new Rm(null,Re(this.transform))}constructor(t,n){super(t),this.transform=n}addDimensions(t){this.transform.groupby=ds((this.transform.groupby??[]).concat(t),n=>n)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${Ve(this.transform)}`}assemble(){const{pivot:t,value:n,groupby:i,limit:r,op:s}=this.transform;return{type:"pivot",field:t,value:n,...r!==void 0?{limit:r}:{},...s!==void 0?{op:s}:{},...i!==void 0?{groupby:i}:{}}}}class Om extends ct{clone(){return new Om(null,Re(this.transform))}constructor(t,n){super(t),this.transform=n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${Ve(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function cI(e){let t=0;function n(i,r){if(i instanceof Lu&&!i.isGenerator&&!Cc(i.data)&&(e.push(r),r={name:null,source:r.name,transform:[]}),i instanceof zn&&(i.parent instanceof Lu&&!r.source?(r.format={...r.format,parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof Rc){r.name||(r.name=`data_${t++}`),!r.source||r.transform.length>0?(e.push(r),i.data=r.name):i.data=r.source,e.push(...i.assemble());return}switch((i instanceof _h||i instanceof xh||i instanceof Oc||i instanceof Dc||i instanceof Tc||i instanceof kh||i instanceof zr||i instanceof Eh||i instanceof Lc||i instanceof Pu||i instanceof Dm||i instanceof Fm||i instanceof $m||i instanceof Tm||i instanceof Mm||i instanceof Nm||i instanceof xa||i instanceof Om||i instanceof Rm||i instanceof Sm)&&r.transform.push(i.assemble()),(i instanceof Ss||i instanceof Cs||i instanceof zu||i instanceof mo||i instanceof Pc)&&r.transform.push(...i.assemble()),i instanceof vi&&(r.source&&r.transform.length===0?i.setSource(r.source):i.parent instanceof vi?i.setSource(r.name):(r.name||(r.name=`data_${t++}`),i.setSource(r.name),i.numChildren()===1&&(e.push(r),r={name:null,source:r.name,transform:[]}))),i.numChildren()){case 0:i instanceof vi&&(!r.source||r.transform.length>0)&&e.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name=`data_${t++}`);let s=r.name;!r.source||r.transform.length>0?e.push(r):s=r.source;for(const o of i.children)n(o,{name:null,source:s,transform:[]});break}}}return n}function Yye(e){const t=[],n=cI(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function Xye(e,t){const n=[],i=cI(n);let r=0;for(const o of e.sources){o.hasName()||(o.dataName=`source_${r++}`);const a=o.assemble();i(o,a)}for(const o of n)o.transform.length===0&&delete o.transform;let s=0;for(const[o,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(s++,0,n.splice(o,1)[0]);for(const o of n)for(const a of o.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const o of n)o.name in t&&(o.values=t[o.name]);return n}function Zye(e){return e==="top"||e==="left"||be(e)?"header":"footer"}function Kye(e){for(const t of ir)Jye(e,t);dI(e,"x"),dI(e,"y")}function Jye(e,t){var o;const{facet:n,config:i,child:r,component:s}=e;if(e.channelHasField(t)){const a=n[t],u=Nc("title",null,i,t);let l=xc(a,i,{allowDisabling:!0,includeDefault:u===void 0||!!u});r.component.layoutHeaders[t].title&&(l=G(l)?l.join(", "):l,l+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const c=Nc("labelOrient",a.header,i,t),f=a.header!==null?jt((o=a.header)==null?void 0:o.labels,i.header.labels,!0):!1,d=He(["bottom","right"],c)?"footer":"header";s.layoutHeaders[t]={title:a.header!==null?l:null,facetFieldDef:a,[d]:t==="facet"?[]:[fI(e,t,f)]}}}function fI(e,t,n){const i=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function dI(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=Zw(r,t),r.axis[t]==="shared"){const s=t==="x"?"column":"row",o=i[s];for(const a of n.component.axes[t]){const u=Zye(a.get("orient"));o[u]??(o[u]=[fI(e,s,!1)]);const l=vh(a,"main",e.config,{header:!0});l&&o[u][0].axes.push(l),a.mainExtracted=!0}}}}function Qye(e){h6(e),Lm(e,"width"),Lm(e,"height")}function ebe(e){h6(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";Lm(e,t),Lm(e,n)}function h6(e){for(const t of e.children)t.parseLayoutSize()}function Lm(e,t){const n=EL(t),i=T1(n),r=e.component.resolve,s=e.component.layoutSize;let o;for(const a of e.children){const u=a.component.layoutSize.getWithExplicit(n),l=r.scale[i]??AL(i,e);if(l==="independent"&&u.value==="step"){o=void 0;break}if(o){if(l==="independent"&&o.value!==u.value){o=void 0;break}o=ba(o,u,n,"")}else o=u}if(o){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);s.setWithExplicit(t,o)}else s.setWithExplicit(t,{explicit:!1,value:void 0})}function tbe(e){const{size:t,component:n}=e;for(const i of ro){const r=bi(i);if(t[r]){const s=t[r];n.layoutSize.set(r,ks(s)?"step":s,!0)}else{const s=nbe(e,r);n.layoutSize.set(r,s,!1)}}}function nbe(e,t){const n=t==="width"?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const s=r.get("type"),o=r.get("range");if(an(s)){const a=rm(i.view,t);return vu(o)||ks(a)?"step":a}else return dw(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return dw(i.view,t);{const s=rm(i.view,t);return ks(s)?s.step:s}}}function p6(e,t,n){return ne(t,{suffix:`by_${ne(e)}`,...n})}class Ch extends lI{constructor(t,n,i,r){super(t,"facet",n,i,r,t.resolve),this.child=v6(t.spec,this,this.getName("child"),void 0,r),this.children=[this.child],this.facet=this.initFacet(t.facet)}initFacet(t){if(!rh(t))return{facet:this.initFacetFieldDef(t,"facet")};const n=Y(t),i={};for(const r of n){if(![Js,Qs].includes(r)){K(R1(r,"facet"));break}const s=t[r];if(s.field===void 0){K(wx(s,r));break}i[r]=this.initFacetFieldDef(s,r)}return i}initFacetFieldDef(t,n){const i=Qx(t,n);return i.header?i.header=bn(i.header):i.header===null&&(i.header=null),i}channelHasField(t){return Z(this.facet,t)}fieldDef(t){return this.facet[t]}parseData(){this.component.data=Im(this),this.child.parseData()}parseLayoutSize(){h6(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection,Object.values(this.component.selection).some(t=>As(t))&&Ex(xx)}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),Kye(this)}assembleSelectionTopLevelSignals(t){return this.child.assembleSelectionTopLevelSignals(t)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(t){return this.child.assembleSelectionData(t)}getHeaderLayoutMixins(){const t={};for(const n of ir)for(const i of Vw){const r=this.component.layoutHeaders[n],s=r[i],{facetFieldDef:o}=r;if(o){const a=Nc("titleOrient",o.header,this.config,n);if(["right","bottom"].includes(a)){const u=wm(n,a);t.titleAnchor??(t.titleAnchor={}),t.titleAnchor[u]="end"}}if(s!=null&&s[0]){const a=n==="row"?"height":"width",u=i==="header"?"headerBand":"footerBand";n!=="facet"&&!this.child.component.layoutSize.get(a)&&(t[u]??(t[u]={}),t[u][n]=.5),r.title&&(t.offset??(t.offset={}),t.offset[n==="row"?"rowTitle":"columnTitle"]=10)}}return t}assembleDefaultLayout(){const{column:t,row:n}=this.facet,i=t?this.columnDistinctSignal():n?1:void 0;let r="all";return(!n&&this.component.resolve.scale.x==="independent"||!t&&this.component.resolve.scale.y==="independent")&&(r="none"),{...this.getHeaderLayoutMixins(),...i?{columns:i}:{},bounds:"full",align:r}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof Ch))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(t){return this.parent&&this.parent instanceof Ch?{...this.channelHasField("column")?{encode:{update:{columns:{field:ne(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(t)}:super.assembleGroup(t)}getCardinalityAggregateForChild(){const t=[],n=[],i=[];if(this.child instanceof Ch){if(this.child.channelHasField("column")){const r=ne(this.child.facet.column);t.push(r),n.push("distinct"),i.push(`distinct_${r}`)}}else for(const r of ro){const s=this.child.component.scales[r];if(s&&!s.merged){const o=s.get("type"),a=s.get("range");if(an(o)&&vu(a)){const u=Am(this.child,r),l=l6(u);l?(t.push(l),n.push("distinct"),i.push(`distinct_${l}`)):K(_x(r))}}}return{fields:t,ops:n,as:i}}assembleFacet(){const{name:t,data:n}=this.component.data.facetRoot,{row:i,column:r}=this.facet,{fields:s,ops:o,as:a}=this.getCardinalityAggregateForChild(),u=[];for(const c of ir){const f=this.facet[c];if(f){u.push(ne(f));const{bin:d,sort:h}=f;if(wt(d)&&u.push(ne(f,{binSuffix:"end"})),ao(h)){const{field:p,op:g=W1}=h,m=p6(f,h);i&&r?(s.push(m),o.push("max"),a.push(m)):(s.push(p),o.push(g),a.push(m))}else if(G(h)){const p=Mc(f,c);s.push(p),o.push("max"),a.push(p)}}}const l=!!i&&!!r;return{name:t,data:n,groupby:u,...l||s.length>0?{aggregate:{...l?{cross:l}:{},...s.length?{fields:s,ops:o,as:a}:{}}}:{}}}facetSortFields(t){const{facet:n}=this,i=n[t];return i?ao(i.sort)?[p6(i,i.sort,{expr:"datum"})]:G(i.sort)?[Mc(i,t,{expr:"datum"})]:[ne(i,{expr:"datum"})]:[]}facetSortOrder(t){const{facet:n}=this,i=n[t];if(i){const{sort:r}=i;return[(ao(r)?r.order:!G(r)&&r)||"ascending"]}return[]}assembleLabelTitle(){var r;const{facet:t,config:n}=this;if(t.facet)return Yw(t.facet,"facet",n);const i={row:["top","bottom"],column:["left","right"]};for(const s of Gw)if(t[s]){const o=Nc("labelOrient",(r=t[s])==null?void 0:r.header,n,s);if(i[s].includes(o))return Yw(t[s],s,n)}}assembleMarks(){const{child:t}=this,n=this.component.data.facetRoot,i=Yye(n),r=t.assembleGroupEncodeEntry(!1),s=this.assembleLabelTitle()||t.assembleTitle(),o=t.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...s?{title:s}:{},...o?{style:o}:{},from:{facet:this.assembleFacet()},sort:{field:ir.map(u=>this.facetSortFields(u)).flat(),order:ir.map(u=>this.facetSortOrder(u)).flat()},...i.length>0?{data:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup(u1e(this,[]))}]}getMapping(){return this.facet}}function ibe(e,t){const{row:n,column:i}=t;if(n&&i){let r=null;for(const s of[n,i])if(ao(s.sort)){const{field:o,op:a=W1}=s.sort;e=r=new Pu(e,{joinaggregate:[{op:a,field:o,as:p6(s,s.sort,{forAs:!0})}],groupby:[ne(s)]})}return r}return null}function hI(e,t){var n,i,r,s;for(const o of t){const a=o.data;if(e.name&&o.hasName()&&e.name!==o.dataName)continue;const u=(n=e.format)==null?void 0:n.mesh,l=(i=a.format)==null?void 0:i.feature;if(u&&l)continue;const c=(r=e.format)==null?void 0:r.feature;if((c||l)&&c!==l)continue;const f=(s=a.format)==null?void 0:s.mesh;if(!((u||f)&&u!==f)){if(lh(e)&&lh(a)){if(Ri(e.values,a.values))return o}else if(Cc(e)&&Cc(a)){if(e.url===a.url)return o}else if(dO(e)&&e.name===o.dataName)return o}}return null}function rbe(e,t){if(e.data||!e.parent){if(e.data===null){const i=new Lu({values:[]});return t.push(i),i}const n=hI(e.data,t);if(n)return va(e.data)||(n.data.format=AM({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const i=new Lu(e.data);return t.push(i),i}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function sbe(e,t,n){let i=0;for(const r of t.transforms){let s,o;if(Lge(r))o=e=new Tc(e,r),s="derived";else if(bw(r)){const a=X2e(r);o=e=zn.makeWithAncestors(e,{},a,n)??e,e=new Dc(e,t,r.filter)}else if(rO(r))o=e=Ss.makeFromTransform(e,r,t),s="number";else if(Pge(r))s="date",n.getWithExplicit(r.field).value===void 0&&(e=new zn(e,{[r.field]:s}),n.set(r.field,s,!1)),o=e=Cs.makeFromTransform(e,r);else if(zge(r))o=e=zr.makeFromTransform(e,r),s="number",Nw(t)&&(e=new xa(e));else if(iO(r))o=e=Eh.make(e,t,r,i++),s="derived";else if(Nge(r))o=e=new Lc(e,r),s="number";else if(Rge(r))o=e=new Pu(e,r),s="number";else if(Bge(r))o=e=mo.makeFromTransform(e,r),s="derived";else if(jge(r))o=e=new Dm(e,r),s="derived";else if(Uge(r))o=e=new Sm(e,r),s="derived";else if(Oge(r))o=e=new Fm(e,r),s="derived";else if($ge(r))o=e=new Rm(e,r),s="derived";else if(Mge(r))e=new Om(e,r);else if(Ige(r))o=e=zu.makeFromTransform(e,r),s="derived";else if(Sge(r))o=e=new $m(e,r),s="derived";else if(Fge(r))o=e=new Mm(e,r),s="derived";else if(Dge(r))o=e=new Nm(e,r),s="derived";else if(Tge(r))o=e=new Tm(e,r),s="derived";else{K(hhe(r));continue}if(o&&s!==void 0)for(const a of o.producedFields()??[])n.set(a,s,!1)}return e}function Im(e){var m;let t=rbe(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,o=!(r&&(va(r)||Cc(r)||lh(r)))&&e.parent?e.parent.component.data.ancestorParse.clone():new e1e;va(r)?(hO(r)?t=new xh(t,r.sequence):xw(r)&&(t=new _h(t,r.graticule)),o.parseNothing=!0):((m=r==null?void 0:r.format)==null?void 0:m.parse)===null&&(o.parseNothing=!0),t=zn.makeExplicit(t,e,o)??t,t=new xa(t);const a=e.parent&&Ic(e.parent);(Mt(e)||Ii(e))&&a&&(t=Ss.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=sbe(t,e,o));const u=K2e(e),l=Z2e(e);t=zn.makeWithAncestors(t,{},{...u,...l},o)??t,Mt(e)&&(t=Pc.parseAll(t,e),t=kh.parseAll(t,e)),(Mt(e)||Ii(e))&&(a||(t=Ss.makeFromEncoding(t,e)??t),t=Cs.makeFromEncoding(t,e)??t,t=Tc.parseAllForSortIndex(t,e));const c=t=Pm(Tt.Raw,e,t);if(Mt(e)){const y=zr.makeFromEncoding(t,e);y&&(t=y,Nw(e)&&(t=new xa(t))),t=zu.makeFromEncoding(t,e)??t,t=mo.makeFromEncoding(t,e)??t}let f,d;if(Mt(e)){const{markDef:y,mark:b,config:v}=e,_=mt("invalid",y,v),{marks:x,scales:k}=d=gO({invalid:_,isPath:ga(b)});x!==k&&k==="include-invalid-values"&&(f=t=Pm(Tt.PreFilterInvalid,e,t)),x==="exclude-invalid-values"&&(t=Oc.make(t,e,d)??t)}const h=t=Pm(Tt.Main,e,t);let p;if(Mt(e)&&d){const{marks:y,scales:b}=d;y==="include-invalid-values"&&b==="exclude-invalid-values"&&(t=Oc.make(t,e,d)??t,p=t=Pm(Tt.PostFilterInvalid,e,t))}Mt(e)&&Gme(e,h);let g=null;if(Ii(e)){const y=e.getName("facet");t=ibe(t,e.facet)??t,g=new Rc(t,e,y,h.getSource()),n[y]=g}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:c,main:h,facetRoot:g,ancestorParse:o,preFilterInvalid:f,postFilterInvalid:p}}function Pm(e,t,n){const{outputNodes:i,outputNodeRefCounts:r}=t.component.data,s=t.getDataName(e),o=new vi(n,s,e,r);return i[s]=o,o}class obe extends d6{constructor(t,n,i,r){var s,o,a,u;super(t,"concat",n,i,r,t.resolve),(((o=(s=t.resolve)==null?void 0:s.axis)==null?void 0:o.x)==="shared"||((u=(a=t.resolve)==null?void 0:a.axis)==null?void 0:u.y)==="shared")&&K(che),this.children=this.getChildren(t).map((l,c)=>v6(l,this,this.getName(`concat_${c}`),void 0,r))}parseData(){this.component.data=Im(this);for(const t of this.children)t.parseData()}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of Y(t.component.selection))this.component.selection[n]=t.component.selection[n]}Object.values(this.component.selection).some(t=>As(t))&&Ex(xx)}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){for(const t of this.children)t.parseAxesAndHeaders()}getChildren(t){return im(t)?t.vconcat:fw(t)?t.hconcat:t.concat}parseLayoutSize(){ebe(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.forEach(t=>t.assembleSignals()),[]}assembleLayoutSignals(){const t=Xw(this);for(const n of this.children)t.push(...n.assembleLayoutSignals());return t}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleMarks(){return this.children.map(t=>{const n=t.assembleTitle(),i=t.assembleGroupStyle(),r=t.assembleGroupEncodeEntry(!1);return{type:"group",name:t.getName("group"),...n?{title:n}:{},...i?{style:i}:{},...r?{encode:{update:r}}:{},...t.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const t=this.layout.columns;return{...t!=null?{columns:t}:{},bounds:"full",align:"each"}}}function abe(e){return e===!1||e===null}const ube={disable:1,gridScale:1,scale:1,...gR,labelExpr:1,encode:1},pI=Y(ube);class g6 extends co{constructor(t={},n={},i=!1){super(),this.explicit=t,this.implicit=n,this.mainExtracted=i}clone(){return new g6(Re(this.explicit),Re(this.implicit),this.mainExtracted)}hasAxisPart(t){return t==="axis"?!0:t==="grid"||t==="title"?!!this.get(t):!abe(this.get(t))}hasOrientSignalRef(){return be(this.explicit.orient)}}function lbe(e,t,n){const{encoding:i,config:r}=e,s=Kt(i[t])??Kt(i[ms(t)]),o=e.axis(t)||{},{format:a,formatType:u}=o;if($u(u))return{text:Rr({fieldOrDatumDef:s,field:"datum.value",format:a,formatType:u,config:r}),...n};if(a===void 0&&u===void 0&&r.customFormatTypes){if(vc(s)==="quantitative"){if(_c(s)&&s.stack==="normalize"&&r.normalizedNumberFormatType)return{text:Rr({fieldOrDatumDef:s,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:Rr({fieldOrDatumDef:s,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if(vc(s)==="temporal"&&r.timeFormatType&&J(s)&&!s.timeUnit)return{text:Rr({fieldOrDatumDef:s,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}function cbe(e){return ro.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[ybe(n,e)]),t),{})}const fbe={bottom:"top",top:"bottom",left:"right",right:"left"};function dbe(e){const{axes:t,resolve:n}=e.component,i={top:0,bottom:0,right:0,left:0};for(const r of e.children){r.parseAxesAndHeaders();for(const s of Y(r.component.axes))n.axis[s]=Zw(e.component.resolve,s),n.axis[s]==="shared"&&(t[s]=hbe(t[s],r.component.axes[s]),t[s]||(n.axis[s]="independent",delete t[s]))}for(const r of ro){for(const s of e.children)if(s.component.axes[r]){if(n.axis[r]==="independent"){t[r]=(t[r]??[]).concat(s.component.axes[r]);for(const o of s.component.axes[r]){const{value:a,explicit:u}=o.getWithExplicit("orient");if(!be(a)){if(i[a]>0&&!u){const l=fbe[a];i[a]>i[l]&&o.set("orient",l,!1)}i[a]++}}}delete s.component.axes[r]}if(n.axis[r]==="independent"&&t[r]&&t[r].length>1)for(const[s,o]of(t[r]||[]).entries())s>0&&o.get("grid")&&!o.explicit.grid&&(o.implicit.grid=!1)}}function hbe(e,t){if(e){if(e.length!==t.length)return;const n=e.length;for(let i=0;in.clone());return e}function pbe(e,t){for(const n of pI){const i=ba(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,s)=>{switch(n){case"title":return iN(r,s);case"gridScale":return{explicit:r.explicit,value:jt(r.value,s.value)}}return om(r,s,n,"axis")});e.setWithExplicit(n,i)}return e}function gbe(e,t,n,i,r){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(be(n.labelAngle)?n.labelAngle:Xd(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===bL(i,r))return!0}return e===n[t]}const mbe=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function ybe(e,t){var y,b;let n=t.axis(e);const i=new g6,r=Kt(t.encoding[e]),{mark:s,config:o}=t,a=(n==null?void 0:n.orient)||((y=o[e==="x"?"axisX":"axisY"])==null?void 0:y.orient)||((b=o.axis)==null?void 0:b.orient)||n2e(e),u=t.getScaleComponent(e).get("type"),l=Xme(e,u,a,t.config),c=n!==void 0?!n:Ww("disable",o.style,n==null?void 0:n.style,l).configValue;if(i.set("disable",c,n!==void 0),c)return i;n=n||{};const f=Qme(r,n,e,o.style,l),d=ZN(n.formatType,r,u),h=XN(r,r.type,n.format,n.formatType,o,!0),p={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:u,orient:a,labelAngle:f,format:h,formatType:d,mark:s,config:o};for(const v of pI){const _=v in gL?gL[v](p):mR(v)?n[v]:void 0,x=_!==void 0,k=gbe(_,v,n,t,e);if(x&&k)i.set(v,_,k);else{const{configValue:w=void 0,configFrom:E=void 0}=mR(v)&&v!=="values"?Ww(v,o.style,n.style,l):{},C=w!==void 0;x&&!C?i.set(v,_,k):(E!=="vgAxisConfig"||mbe.has(v)&&C||uh(w)||be(w))&&i.set(v,w,!1)}}const g=n.encoding??{},m=pR.reduce((v,_)=>{if(!i.hasAxisPart(_))return v;const x=CL(g[_]??{},t),k=_==="labels"?lbe(t,e,x):x;return k!==void 0&&!pt(k)&&(v[_]={update:k}),v},{});return pt(m)||i.set("encode",m,!!n.encoding||n.labelAngle!==void 0),i}function bbe({encoding:e,size:t}){for(const n of ro){const i=bi(n);ks(t[i])&&ya(e[n])&&(delete t[i],K(gN(i)))}return t}const vbe={vgMark:"arc",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...ri("x",e,{defaultPos:"mid"}),...ri("y",e,{defaultPos:"mid"}),...ho(e,"radius"),...ho(e,"theta")})},_be={vgMark:"area",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...fm("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...fm("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...Tw(e)})},xbe={vgMark:"rect",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...ho(e,"x"),...ho(e,"y")})},wbe={vgMark:"shape",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[{type:"geoshape",projection:e.projectionName(),...n&&J(n)&&n.type===yc?{field:ne(n,{expr:"datum"})}:{}}]}},kbe={vgMark:"image",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...ho(e,"x"),...ho(e,"y"),...Fw(e,"url")})},Ebe={vgMark:"line",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...ri("x",e,{defaultPos:"mid"}),...ri("y",e,{defaultPos:"mid"}),..._n("size",e,{vgChannel:"strokeWidth"}),...Tw(e)})},Cbe={vgMark:"trail",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...ri("x",e,{defaultPos:"mid"}),...ri("y",e,{defaultPos:"mid"}),..._n("size",e),...Tw(e)})};function m6(e,t){const{config:n}=e;return{...rr(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...ri("x",e,{defaultPos:"mid"}),...ri("y",e,{defaultPos:"mid"}),..._n("size",e),..._n("angle",e),...Abe(e,n,t)}}function Abe(e,t,n){return n?{shape:{value:n}}:_n("shape",e)}const $be={vgMark:"symbol",encodeEntry:e=>m6(e)},Sbe={vgMark:"symbol",encodeEntry:e=>m6(e,"circle")},Fbe={vgMark:"symbol",encodeEntry:e=>m6(e,"square")},Dbe={vgMark:"rect",encodeEntry:e=>({...rr(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...ho(e,"x"),...ho(e,"y")})},Tbe={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...rr(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...fm("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...fm("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),..._n("size",e,{vgChannel:"strokeWidth"})}}},Mbe={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...rr(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...ri("x",e,{defaultPos:"mid"}),...ri("y",e,{defaultPos:"mid"}),...Fw(e),..._n("size",e,{vgChannel:"fontSize"}),..._n("angle",e),...IO("align",Nbe(e.markDef,n,t)),...IO("baseline",Rbe(e.markDef,n,t)),...ri("radius",e,{defaultPos:null}),...ri("theta",e,{defaultPos:null})}}};function Nbe(e,t,n){if(mt("align",e,n)===void 0)return"center"}function Rbe(e,t,n){if(mt("baseline",e,n)===void 0)return"middle"}const zm={arc:vbe,area:_be,bar:xbe,circle:Sbe,geoshape:wbe,image:kbe,line:Ebe,point:$be,rect:Dbe,rule:Tbe,square:Fbe,text:Mbe,tick:{vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r=i==="horizontal"?"x":"y",s=i==="horizontal"?"y":"x",o=i==="horizontal"?"height":"width";return{...rr(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...ho(e,r),...ri(s,e,{defaultPos:"mid",vgChannel:s==="y"?"yc":"xc"}),[o]:Et(mt("thickness",n,t))}}},trail:Cbe};function Obe(e){if(He([B1,P1,B0e],e.mark)){const t=wR(e.mark,e.encoding);if(t.length>0)return Lbe(e,t)}else if(e.mark===z1){const t=yx.some(n=>mt(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return Ibe(e)}return y6(e)}const gI="faceted_path_";function Lbe(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:gI+e.requestDataName(Tt.Main),data:e.requestDataName(Tt.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:y6(e,{fromPrefix:gI})}]}const mI="stack_group_";function Ibe(e){var l;const[t]=y6(e,{fromPrefix:mI}),n=e.scaleName(e.stack.fieldChannel),i=(c={})=>e.vgField(e.stack.fieldChannel,c),r=(c,f)=>{const d=[i({prefix:"min",suffix:"start",expr:f}),i({prefix:"max",suffix:"start",expr:f}),i({prefix:"min",suffix:"end",expr:f}),i({prefix:"max",suffix:"end",expr:f})];return`${c}(${d.map(h=>`scale('${n}',${h})`).join(",")})`};let s,o;e.stack.fieldChannel==="x"?(s={...lc(t.encode.update,["y","yc","y2","height",...yx]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},o={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...gi(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(s={...lc(t.encode.update,["x","xc","x2","width"]),y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}},o={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...gi(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const c of yx){const f=bs(c,e.markDef,e.config);t.encode.update[c]?(s[c]=t.encode.update[c],delete t.encode.update[c]):f&&(s[c]=Et(f)),f&&(t.encode.update[c]={value:0})}const a=[];if(((l=e.stack.groupbyChannels)==null?void 0:l.length)>0)for(const c of e.stack.groupbyChannels){const f=e.fieldDef(c),d=ne(f);d&&a.push(d),(f!=null&&f.bin||f!=null&&f.timeUnit)&&a.push(ne(f,{binSuffix:"end"}))}return s=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((c,f)=>{if(t.encode.update[f])return{...c,[f]:t.encode.update[f]};{const d=bs(f,e.markDef,e.config);return d!==void 0?{...c,[f]:Et(d)}:c}},s),s.stroke&&(s.strokeForeground={value:!0},s.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(Tt.Main),name:mI+e.requestDataName(Tt.Main),groupby:a,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:s},marks:[{type:"group",encode:{update:o},marks:[t]}]}]}function Pbe(e){const{encoding:t,stack:n,mark:i,markDef:r,config:s}=e,o=t.order;if(!(!G(o)&&Or(o)&&ex(o.value)||!o&&ex(mt("order",r,s)))){if((G(o)||J(o))&&!n)return eN(o,{expr:"datum"});if(ga(i)){const a=r.orient==="horizontal"?"y":"x",u=t[a];if(J(u))return{field:a}}}}function y6(e,t={fromPrefix:""}){const{mark:n,markDef:i,encoding:r,config:s}=e,o=jt(i.clip,zbe(e),Bbe(e)),a=JM(i),u=r.key,l=Pbe(e),c=jbe(e),f=mt("aria",i,s),d=zm[n].postEncodingTransform?zm[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:zm[n].vgMark,...o?{clip:o}:{},...a?{style:a}:{},...u?{key:u.field}:{},...l?{sort:l}:{},...c||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(Tt.Main)},encode:{update:zm[n].encodeEntry(e)},...d?{transform:d}:{}}]}function zbe(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t!=null&&t.get("selectionExtent")||n!=null&&n.get("selectionExtent")?!0:void 0}function Bbe(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function jbe(e){if(!e.component.selection)return null;const t=Y(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=Y(i.component.selection).length,i=i.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}class yI extends lI{constructor(t,n,i,r={},s){super(t,"unit",n,i,s,void 0,BR(t)?t.view:void 0),this.specifiedScales={},this.specifiedAxes={},this.specifiedLegends={},this.specifiedProjection={},this.selection=[],this.children=[],this.correctDataNames=l=>{var c,f,d;return(c=l.from)!=null&&c.data&&(l.from.data=this.lookupDataSource(l.from.data),"time"in this.encoding&&(l.from.data=l.from.data+_O)),(d=(f=l.from)==null?void 0:f.facet)!=null&&d.data&&(l.from.facet.data=this.lookupDataSource(l.from.facet.data)),l};const o=xs(t.mark)?{...t.mark}:{type:t.mark},a=o.type;o.filled===void 0&&(o.filled=mge(o,s,{graticule:t.data&&xw(t.data)}));const u=this.encoding=kpe(t.encoding||{},a,o.filled,s);this.markDef=XR(o,u,s),this.size=bbe({encoding:u,size:BR(t)?{...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:r}),this.stack=YR(this.markDef,u),this.specifiedScales=this.initScales(a,u),this.specifiedAxes=this.initAxes(u),this.specifiedLegends=this.initLegends(u),this.specifiedProjection=t.projection,this.selection=(t.params??[]).filter(l=>lw(l))}get hasProjection(){const{encoding:t}=this,n=this.mark===jN,i=t&&_de.some(r=>Le(t[r]));return n||i}scaleDomain(t){const n=this.specifiedScales[t];return n?n.domain:void 0}axis(t){return this.specifiedAxes[t]}legend(t){return this.specifiedLegends[t]}initScales(t,n){return px.reduce((i,r)=>{const s=Kt(n[r]);return s&&(i[r]=this.initScale(s.scale??{})),i},{})}initScale(t){const{domain:n,range:i}=t,r=bn(t);return G(n)&&(r.domain=n.map(Oi)),G(i)&&(r.range=i.map(Oi)),r}initAxes(t){return ro.reduce((n,i)=>{const r=t[i];if(Le(r)||i===Ft&&Le(t.x2)||i===sn&&Le(t.y2)){const s=Le(r)?r.axis:void 0;n[i]=s&&this.initAxis({...s})}return n},{})}initAxis(t){const n=Y(t),i={};for(const r of n){const s=t[r];i[r]=uh(s)?XM(s):Oi(s)}return i}initLegends(t){return Tde.reduce((n,i)=>{const r=Kt(t[i]);if(r&&Nde(i)){const s=r.legend;n[i]=s&&bn(s)}return n},{})}parseData(){this.component.data=Im(this)}parseLayoutSize(){tbe(this)}parseSelections(){this.component.selection=Hme(this,this.selection)}parseMarkGroup(){this.component.mark=Obe(this)}parseAxesAndHeaders(){this.component.axes=cbe(this)}assembleSelectionTopLevelSignals(t){return l1e(this,t)}assembleSignals(){return[...hL(this),...a1e(this,[])]}assembleSelectionData(t){return c1e(this,t)}assembleLayout(){return null}assembleLayoutSignals(){return Xw(this)}assembleMarks(){let t=this.component.mark??[];return(!this.parent||!Ic(this.parent))&&(t=EO(this,t)),t.map(this.correctDataNames)}assembleGroupStyle(){const{style:t}=this.view||{};return t!==void 0?t:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(t){return Fu(this.encoding,t)}fieldDef(t){const n=this.encoding[t];return Lr(n)}typedFieldDef(t){const n=this.fieldDef(t);return ii(n)?n:null}}class b6 extends d6{constructor(t,n,i,r,s){super(t,"layer",n,i,s,t.resolve,t.view);const o={...r,...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}};this.children=t.layer.map((a,u)=>{if(sm(a))return new b6(a,this,this.getName(`layer_${u}`),o,s);if(uo(a))return new yI(a,this,this.getName(`layer_${u}`),o,s);throw new Error(vx(a))})}parseData(){this.component.data=Im(this);for(const t of this.children)t.parseData()}parseLayoutSize(){Qye(this)}parseSelections(){this.component.selection={};for(const t of this.children){t.parseSelections();for(const n of Y(t.component.selection))this.component.selection[n]=t.component.selection[n]}Object.values(this.component.selection).some(t=>As(t))&&Ex(xx)}parseMarkGroup(){for(const t of this.children)t.parseMarkGroup()}parseAxesAndHeaders(){dbe(this)}assembleSelectionTopLevelSignals(t){return this.children.reduce((n,i)=>i.assembleSelectionTopLevelSignals(n),t)}assembleSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleSignals()),hL(this))}assembleLayoutSignals(){return this.children.reduce((t,n)=>t.concat(n.assembleLayoutSignals()),Xw(this))}assembleSelectionData(t){return this.children.reduce((n,i)=>i.assembleSelectionData(n),t)}assembleGroupStyle(){const t=new Set;for(const i of this.children)for(const r of se(i.assembleGroupStyle()))t.add(r);const n=Array.from(t);return n.length>1?n:n.length===1?n[0]:void 0}assembleTitle(){let t=super.assembleTitle();if(t)return t;for(const n of this.children)if(t=n.assembleTitle(),t)return t}assembleLayout(){return null}assembleMarks(){return f1e(this,this.children.flatMap(t=>t.assembleMarks()))}assembleLegends(){return this.children.reduce((t,n)=>t.concat(n.assembleLegends()),LL(this))}}function v6(e,t,n,i,r){if(H1(e))return new Ch(e,t,n,r);if(sm(e))return new b6(e,t,n,i,r);if(uo(e))return new yI(e,t,n,i,r);if(Gpe(e))return new obe(e,t,n,r);throw new Error(vx(e))}function Ube(e,t={}){t.logger&&e0e(t.logger),t.fieldTitle&&cR(t.fieldTitle);try{const n=GR(il(t.config,e.config)),i=uO(e,n),r=v6(i,null,"",void 0,n);return r.parse(),hye(r.component.data,r),{spec:Wbe(r,qbe(e,i.autosize,n,r),e.datasets,e.usermeta),normalized:i}}finally{t.logger&&t0e(),t.fieldTitle&&gpe()}}function qbe(e,t,n,i){const r=i.component.layoutSize.get("width"),s=i.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},i.hasAxisOrientSignalRef()&&(t.resize=!0)):re(t)&&(t={type:t}),r&&s&&Kge(t.type)){if(r==="step"&&s==="step")K(oN()),t.type="pad";else if(r==="step"||s==="step"){const o=r==="step"?"width":"height";K(oN(T1(o)));const a=o==="width"?"height":"width";t.type=Jge(a)}}return{...Y(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...cO(n,!1),...cO(e,!0)}}function Wbe(e,t,n={},i){const r=e.config?rge(e.config):void 0,s=Xye(e.component.data,n),o=e.assembleSelectionData(s),a=e.assembleProjections(),u=e.assembleTitle(),l=e.assembleGroupStyle(),c=e.assembleGroupEncodeEntry(!0);let f=e.assembleLayoutSignals();f=f.filter(p=>(p.name==="width"||p.name==="height")&&p.value!==void 0?(t[p.name]=+p.value,!1):!0);const{params:d,...h}=t;return{$schema:"https://vega.github.io/schema/vega/v5.json",...e.description?{description:e.description}:{},...h,...u?{title:u}:{},...l?{style:l}:{},...c?{encode:{update:c}}:{},data:o,...a.length>0?{projections:a}:{},...e.assembleGroup([...f,...e.assembleSelectionTopLevelSignals([]),...PR(d)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const Hbe=pde.version,Gbe=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:dc,accessPathWithDatum:sx,accessWithDatumToUnescapedPath:lt,compile:Ube,contains:He,deepEqual:Ri,deleteNestedProperty:E1,duplicate:Re,entries:sa,every:tx,fieldIntersection:rx,flatAccessWithDatum:SM,getFirstDefined:jt,hasIntersection:nx,hasProperty:Z,hash:Ve,internalField:TM,isBoolean:Gd,isEmpty:pt,isEqual:mde,isInternalField:MM,isNullOrFalse:ex,isNumeric:C1,keys:Y,logicalExpr:Vd,mergeDeep:AM,never:CM,normalize:uO,normalizeAngle:Xd,omit:gi,pick:lc,prefixGenerator:ix,removePathFromField:fc,replaceAll:pu,replacePathInField:er,resetIdCounter:bde,setEqual:$M,some:cc,stringify:gt,titleCase:Yd,unique:ds,uniqueId:DM,vals:mn,varName:St,version:Hbe},Symbol.toStringTag,{value:"Module"}));function bI(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var Vbe="2.15.0",Ybe={version:Vbe};const zc="#fff",vI="#888",Xbe={background:"#333",view:{stroke:vI},title:{color:zc,subtitleColor:zc},style:{"guide-label":{fill:zc},"guide-title":{fill:zc}},axis:{domainColor:zc,gridColor:vI,tickColor:zc}},Bu="#4572a7",Zbe={background:"#fff",arc:{fill:Bu},area:{fill:Bu},line:{stroke:Bu,strokeWidth:2},path:{stroke:Bu},rect:{fill:Bu},shape:{stroke:Bu},symbol:{fill:Bu,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},ju="#30a2da",_6="#cbcbcb",Kbe="#999",Jbe="#333",_I="#f0f0f0",xI="#333",Qbe={arc:{fill:ju},area:{fill:ju},axis:{domainColor:_6,grid:!0,gridColor:_6,gridWidth:1,labelColor:Kbe,labelFontSize:10,titleColor:Jbe,tickColor:_6,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:_I,group:{fill:_I},legend:{labelColor:xI,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:xI,titleFontSize:14,titlePadding:10},line:{stroke:ju,strokeWidth:2},path:{stroke:ju,strokeWidth:.5},rect:{fill:ju},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:ju},bar:{binSpacing:2,fill:ju,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},Uu="#000",e3e={group:{fill:"#e5e5e5"},arc:{fill:Uu},area:{fill:Uu},line:{stroke:Uu},path:{stroke:Uu},rect:{fill:Uu},shape:{stroke:Uu},symbol:{fill:Uu,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},t3e=22,n3e="normal",wI="Benton Gothic, sans-serif",kI=11.5,i3e="normal",qu="#82c6df",x6="Benton Gothic Bold, sans-serif",EI="normal",CI=13,Ah={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"]},r3e={background:"#ffffff",title:{anchor:"start",color:"#000000",font:x6,fontSize:t3e,fontWeight:n3e},arc:{fill:qu},area:{fill:qu},line:{stroke:qu,strokeWidth:2},path:{stroke:qu},rect:{fill:qu},shape:{stroke:qu},symbol:{fill:qu,size:30},axis:{labelFont:wI,labelFontSize:kI,labelFontWeight:i3e,titleFont:x6,titleFontSize:CI,titleFontWeight:EI},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:wI,labelFontSize:kI,symbolType:"square",titleFont:x6,titleFontSize:CI,titleFontWeight:EI},range:{category:Ah["category-6"],diverging:Ah["fireandice-6"],heatmap:Ah["fire-7"],ordinal:Ah["fire-7"],ramp:Ah["fire-7"]}},Wu="#ab5787",Bm="#979797",s3e={background:"#f9f9f9",arc:{fill:Wu},area:{fill:Wu},line:{stroke:Wu},path:{stroke:Wu},rect:{fill:Wu},shape:{stroke:Wu},symbol:{fill:Wu,size:30},axis:{domainColor:Bm,domainWidth:.5,gridWidth:.2,labelColor:Bm,tickColor:Bm,tickWidth:.2,titleColor:Bm},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},Hu="#3e5c69",o3e={background:"#fff",arc:{fill:Hu},area:{fill:Hu},line:{stroke:Hu},path:{stroke:Hu},rect:{fill:Hu},shape:{stroke:Hu},symbol:{fill:Hu},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},sr="#1696d2",AI="#000000",a3e="#FFFFFF",jm="Lato",w6="Lato",u3e="Lato",l3e="#DEDDDD",c3e=18,$h={"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},f3e={background:a3e,title:{anchor:"start",fontSize:c3e,font:jm},axisX:{domain:!0,domainColor:AI,domainWidth:1,grid:!1,labelFontSize:12,labelFont:w6,labelAngle:0,tickColor:AI,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:jm},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:l3e,gridWidth:1,labelFontSize:12,labelFont:w6,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:jm,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:w6,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:jm,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:$h["six-groups-cat-1"],diverging:$h["diverging-colors"],heatmap:$h["diverging-colors"],ordinal:$h["six-groups-seq"],ramp:$h["shades-blue"]},area:{fill:sr},rect:{fill:sr},line:{color:sr,stroke:sr,strokeWidth:5},trail:{color:sr,stroke:sr,strokeWidth:0,size:1},path:{stroke:sr,strokeWidth:.5},point:{filled:!0},text:{font:u3e,color:sr,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:sr,stroke:null}},arc:{fill:sr},shape:{stroke:sr},symbol:{fill:sr,size:30}},Gu="#3366CC",$I="#ccc",Um="Arial, sans-serif",d3e={arc:{fill:Gu},area:{fill:Gu},path:{stroke:Gu},rect:{fill:Gu},shape:{stroke:Gu},symbol:{stroke:Gu},circle:{fill:Gu},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:Um,fontSize:12},"guide-title":{font:Um,fontSize:12},"group-title":{font:Um,fontSize:12}},title:{font:Um,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:$I,tickColor:$I,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},k6=e=>e*(1/3+1),SI=k6(9),FI=k6(10),DI=k6(12),Sh="Segoe UI",TI="wf_standard-font, helvetica, arial, sans-serif",MI="#252423",Fh="#605E5C",NI="transparent",h3e="#C8C6C4",jr="#118DFF",p3e="#12239E",g3e="#E66C37",m3e="#6B007B",y3e="#E044A7",b3e="#744EC2",v3e="#D9B300",_3e="#D64550",RI=jr,OI="#DEEFFF",LI=[OI,RI],x3e={view:{stroke:NI},background:NI,font:Sh,header:{titleFont:TI,titleFontSize:DI,titleColor:MI,labelFont:Sh,labelFontSize:FI,labelColor:Fh},axis:{ticks:!1,grid:!1,domain:!1,labelColor:Fh,labelFontSize:SI,titleFont:TI,titleColor:MI,titleFontSize:DI,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:h3e,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:jr},line:{stroke:jr,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:Sh,fontSize:SI,fill:Fh},arc:{fill:jr},area:{fill:jr,line:!0,opacity:.6},path:{stroke:jr},rect:{fill:jr},point:{fill:jr,filled:!0,size:75},shape:{stroke:jr},symbol:{fill:jr,strokeWidth:1.5,size:50},legend:{titleFont:Sh,titleFontWeight:"bold",titleColor:Fh,labelFont:Sh,labelFontSize:FI,labelColor:Fh,symbolType:"circle",symbolSize:75},range:{category:[jr,p3e,g3e,m3e,y3e,b3e,v3e,_3e],diverging:LI,heatmap:LI,ordinal:[OI,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",RI]}},E6='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',w3e='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',C6=400,qm={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},k3e=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],E3e=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function Wm({theme:e,background:t}){const n=["white","g10"].includes(e)?"light":"dark",i=qm.gridBg[e],r=qm.textPrimary[e],s=qm.textSecondary[e],o=n==="dark"?k3e:E3e,a=n==="dark"?"#d4bbff":"#6929c4";return{background:t,arc:{fill:a},area:{fill:a},path:{stroke:a},rect:{fill:a},shape:{stroke:a},symbol:{stroke:a},circle:{fill:a},view:{fill:i,stroke:i},group:{fill:i},title:{color:r,anchor:"start",dy:-15,fontSize:16,font:E6,fontWeight:600},axis:{labelColor:s,labelFontSize:12,labelFont:w3e,labelFontWeight:C6,titleColor:r,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:qm.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:E6,fill:s,fontWeight:C6},"guide-title":{font:E6,fill:s,fontWeight:C6}},range:{category:o,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const C3e=Wm({theme:"white",background:"#ffffff"}),A3e=Wm({theme:"g10",background:"#f4f4f4"}),$3e=Wm({theme:"g90",background:"#262626"}),S3e=Wm({theme:"g100",background:"#161616"}),F3e=Ybe.version,D3e=Object.freeze(Object.defineProperty({__proto__:null,carbong10:A3e,carbong100:S3e,carbong90:$3e,carbonwhite:C3e,dark:Xbe,excel:Zbe,fivethirtyeight:Qbe,ggplot2:e3e,googlecharts:d3e,latimes:r3e,powerbi:x3e,quartz:s3e,urbaninstitute:f3e,version:F3e,vox:o3e},Symbol.toStringTag,{value:"Module"}));function T3e(e,t,n,i){if(G(e))return`[${e.map(r=>t(re(r)?r:II(r,n))).join(", ")}]`;if(ie(e)){let r="";const{title:s,image:o,...a}=e;s&&(r+=`

${t(s)}

`),o&&(r+=``);const u=Object.keys(a);if(u.length>0){r+="";for(const l of u){let c=a[l];c!==void 0&&(ie(c)&&(c=II(c,n)),r+=``)}r+="
${t(l)}${t(c)}
"}return r||"{}"}return t(e)}function M3e(e){const t=[];return function(n,i){if(typeof i!="object"||i===null)return i;const r=t.indexOf(this)+1;return t.length=r,t.length>e?"[Object]":t.indexOf(i)>=0?"[Circular]":(t.push(i),i)}}function II(e,t){return JSON.stringify(e,M3e(t))}var N3e=`#vg-tooltip-element { + : v !== v && u === u ? ${i} : `}var Xoe={operator:(e,t)=>bd(e,["_"],t.code),parameter:(e,t)=>bd(e,["datum","_"],t.code),event:(e,t)=>bd(e,["event"],t.code),handler:(e,t)=>{const n=`var datum=event.item&&event.item.datum;return ${t.code};`;return bd(e,["_","event"],n)},encode:(e,t)=>{const{marktype:n,channels:i}=t;let r="var o=item,datum=o.datum,m=0,$;";for(const s in i){const o="o["+ee(s)+"]";r+=`$=${i[s].code};if(${o}!==$)${o}=$,m=1;`}return r+=Hoe(i,n),r+="return m;",bd(e,["item","_"],r)},codegen:{get(e){const t=`[${e.map(ee).join("][")}]`,n=Function("_",`return _${t};`);return n.path=t,n},comparator(e,t){let n;const i=(s,o)=>{const a=t[o];let l,u;return s.path?(l=`a${s.path}`,u=`b${s.path}`):((n=n||{})["f"+o]=s,l=`this.f${o}(a)`,u=`this.f${o}(b)`),Yoe(l,u,-a,a)},r=Function("a","b","var u, v; return "+e.map(i).join("")+"0;");return n?r.bind(n):r}}};function Zoe(e){const t=this;Goe(e.type)||!e.type?t.operator(e,e.update?t.operatorExpression(e.update):null):t.transform(e,e.type)}function Koe(e){const t=this;if(e.params){const n=t.get(e.id);n||q("Invalid operator id: "+e.id),t.dataflow.connect(n,n.parameters(t.parseParameters(e.params),e.react,e.initonly))}}function Joe(e,t){t=t||{};const n=this;for(const i in e){const r=e[i];t[i]=G(r)?r.map(s=>yT(s,n,t)):yT(r,n,t)}return t}function yT(e,t,n){if(!e||!ie(e))return e;for(let i=0,r=bT.length,s;ir&&r.$tupleid?$e:r);return t.fn[n]||(t.fn[n]=Zm(i,e.$order,t.expr.codegen))}function rae(e,t){const n=e.$encode,i={};for(const r in n){const s=n[r];i[r]=Kn(t.encodeExpression(s.$expr),s.$fields),i[r].output=s.$output}return i}function sae(e,t){return t}function oae(e,t){const n=e.$subflow;return function(i,r,s){const o=t.fork().parse(n),a=o.get(n.operators[0].id),l=o.signals.parent;return l&&l.set(s),a.detachSubflow=()=>t.detach(o),a}}function aae(){return $e}function lae(e){var t=this,n=e.filter!=null?t.eventExpression(e.filter):void 0,i=e.stream!=null?t.get(e.stream):void 0,r;e.source?i=t.events(e.source,e.type,n):e.merge&&(r=e.merge.map(s=>t.get(s)),i=r[0].merge.apply(r[0],r.slice(1))),e.between&&(r=e.between.map(s=>t.get(s)),i=i.between(r[0],r[1])),e.filter&&(i=i.filter(n)),e.throttle!=null&&(i=i.throttle(+e.throttle)),e.debounce!=null&&(i=i.debounce(+e.debounce)),i==null&&q("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),t.stream(e,i)}function uae(e){var t=this,n=ie(n=e.source)?n.$ref:n,i=t.get(n),r=null,s=e.update,o=void 0;i||q("Source not defined: "+e.source),r=e.target&&e.target.$expr?t.eventExpression(e.target.$expr):t.get(e.target),s&&s.$expr&&(s.$params&&(o=t.parseParameters(s.$params)),s=t.handlerExpression(s.$expr)),t.update(e,i,r,s,o)}const cae={skip:!0};function fae(e){var t=this,n={};if(e.signals){var i=n.signals={};Object.keys(t.signals).forEach(s=>{const o=t.signals[s];e.signals(s,o)&&(i[s]=o.value)})}if(e.data){var r=n.data={};Object.keys(t.data).forEach(s=>{const o=t.data[s];e.data(s,o)&&(r[s]=o.input.value)})}return t.subcontext&&e.recurse!==!1&&(n.subcontext=t.subcontext.map(s=>s.getState(e))),n}function dae(e){var t=this,n=t.dataflow,i=e.data,r=e.signals;Object.keys(r||{}).forEach(s=>{n.update(t.signals[s],r[s],cae)}),Object.keys(i||{}).forEach(s=>{n.pulse(t.data[s].input,n.changeset().remove(Ti).insert(i[s]))}),(e.subcontext||[]).forEach((s,o)=>{const a=t.subcontext[o];a&&a.setState(s)})}function vT(e,t,n,i){return new _T(e,t,n,i)}function _T(e,t,n,i){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=i||Xoe,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function xT(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}_T.prototype=xT.prototype={fork(){const e=new xT(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(e){this.subcontext=this.subcontext.filter(n=>n!==e);const t=Object.keys(e.nodes);for(const n of t)e.nodes[n]._targets=null;for(const n of t)e.nodes[n].detach();e.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(e,t){const n=this,i=n.dataflow,r=e.value;if(n.set(e.id,t),Voe(e.type)&&r&&(r.$ingest?i.ingest(t,r.$ingest,r.$format):r.$request?i.preload(t,r.$request,r.$format):i.pulse(t,i.changeset().insert(r))),e.root&&(n.root=t),e.parent){let s=n.get(e.parent.$ref);s?(i.connect(s,[t]),t.targets().add(s)):(n.unresolved=n.unresolved||[]).push(()=>{s=n.get(e.parent.$ref),i.connect(s,[t]),t.targets().add(s)})}if(e.signal&&(n.signals[e.signal]=t),e.scale&&(n.scales[e.scale]=t),e.data)for(const s in e.data){const o=n.data[s]||(n.data[s]={});e.data[s].forEach(a=>o[a]=t)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[j_(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,i,r){this.dataflow.on(t,n,i,r,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:qoe,parseOperator:Zoe,parseOperatorParameters:Koe,parseParameters:Joe,parseStream:lae,parseUpdate:uae,getState:fae,setState:dae};function hae(e){const t=e.container();t&&(t.setAttribute("role","graphics-document"),t.setAttribute("aria-roleDescription","visualization"),wT(t,e.description()))}function wT(e,t){e&&(t==null?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}function pae(e){e.add(null,t=>(e._background=t.bg,e._resize=1,t.bg),{bg:e._signals.background})}const U_="default";function gae(e){const t=e._signals.cursor||(e._signals.cursor=e.add({user:U_,item:null}));e.on(e.events("view","pointermove"),t,(n,i)=>{const r=t.value,s=r?re(r)?r:r.user:U_,o=i.item&&i.item.cursor||null;return r&&s===r.user&&o==r.item?r:{user:s,item:o}}),e.add(null,function(n){let i=n.cursor,r=this.value;return re(i)||(r=i.item,i=i.user),q_(e,i&&i!==U_?i:r||i),r},{cursor:t})}function q_(e,t){const n=e.globalCursor()?typeof document<"u"&&document.body:e.container();if(n)return t==null?n.style.removeProperty("cursor"):n.style.cursor=t}function T0(e,t){var n=e._runtime.data;return le(n,t)||q("Unrecognized data set: "+t),n[t]}function mae(e,t){return arguments.length<2?T0(this,e).values.value:M0.call(this,e,po().remove(Ti).insert(t))}function M0(e,t){Q4(t)||q("Second argument to changes must be a changeset.");const n=T0(this,e);return n.modified=!0,this.pulse(n.input,t)}function yae(e,t){return M0.call(this,e,po().insert(t))}function bae(e,t){return M0.call(this,e,po().remove(t))}function kT(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function ET(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function D0(e){var t=e.padding(),n=e._origin;return[t.left+n[0],t.top+n[1]]}function vae(e){var t=D0(e),n=kT(e),i=ET(e);e._renderer.background(e.background()),e._renderer.resize(n,i,t),e._handler.origin(t),e._resizeListeners.forEach(r=>{try{r(n,i)}catch(s){e.error(s)}})}function _ae(e,t,n){var i=e._renderer,r=i&&i.canvas(),s,o,a;return r&&(a=D0(e),o=t.changedTouches?t.changedTouches[0]:t,s=ng(o,r),s[0]-=a[0],s[1]-=a[1]),t.dataflow=e,t.item=n,t.vega=xae(e,n,s),t}function xae(e,t,n){const i=t?t.mark.marktype==="group"?t:t.mark.group:null;function r(o){var a=i,l;if(o){for(l=t;l;l=l.mark.group)if(l.mark.name===o){a=l;break}}return a&&a.mark&&a.mark.interactive?a:{}}function s(o){if(!o)return n;re(o)&&(o=r(o));const a=n.slice();for(;o;)a[0]-=o.x||0,a[1]-=o.y||0,o=o.mark&&o.mark.group;return a}return{view:xn(e),item:xn(t||{}),group:r,xy:s,x:o=>s(o)[0],y:o=>s(o)[1]}}const $T="view",wae="timer",kae="window",Eae={trap:!1};function $ae(e){const t=Be({defaults:{}},e),n=(i,r)=>{r.forEach(s=>{G(i[s])&&(i[s]=er(i[s]))})};return n(t.defaults,["prevent","allow"]),n(t,["view","window","selector"]),t}function ST(e,t,n,i){e._eventListeners.push({type:n,sources:se(t),handler:i})}function Sae(e,t){var n=e._eventConfig.defaults,i=n.prevent,r=n.allow;return i===!1||r===!0?!1:i===!0||r===!1?!0:i?i[t]:r?!r[t]:e.preventDefault()}function N0(e,t,n){const i=e._eventConfig&&e._eventConfig[t];return i===!1||ie(i)&&!i[n]?(e.warn(`Blocked ${t} ${n} event listener.`),!1):!0}function Cae(e,t,n){var i=this,r=new Jh(n),s=function(u,c){i.runAsync(null,()=>{e===$T&&Sae(i,t)&&u.preventDefault(),r.receive(_ae(i,u,c))})},o;if(e===wae)N0(i,"timer",t)&&i.timer(s,t);else if(e===$T)N0(i,"view",t)&&i.addEventListener(t,s,Eae);else if(e===kae?N0(i,"window",t)&&typeof window<"u"&&(o=[window]):typeof document<"u"&&N0(i,"selector",t)&&(o=Array.from(document.querySelectorAll(e))),!o)i.warn("Can not resolve event source: "+e);else{for(var a=0,l=o.length;a=0;)t[r].stop();for(r=i.length;--r>=0;)for(o=i[r],s=o.sources.length;--s>=0;)o.sources[s].removeEventListener(o.type,o.handler);for(e&&e.call(this,this._handler,null,null,null),r=n.length;--r>=0;)l=n[r].type,a=n[r].handler,this._handler.off(l,a);return this}function _i(e,t,n){const i=document.createElement(e);for(const r in t)i.setAttribute(r,t[r]);return n!=null&&(i.textContent=n),i}const Tae="vega-bind",Mae="vega-bind-name",Dae="vega-bind-radio";function Nae(e,t,n){if(!t)return;const i=n.param;let r=n.state;return r||(r=n.state={elements:null,active:!1,set:null,update:o=>{o!=e.signal(i.signal)&&e.runAsync(null,()=>{r.source=!0,e.signal(i.signal,o)})}},i.debounce&&(r.update=Km(i.debounce,r.update))),(i.input==null&&i.element?Rae:Lae)(r,t,i,e),r.active||(e.on(e._signals[i.signal],null,()=>{r.source?r.source=!1:r.set(e.signal(i.signal))}),r.active=!0),r}function Rae(e,t,n,i){const r=n.event||"input",s=()=>e.update(t.value);i.signal(n.signal,t.value),t.addEventListener(r,s),ST(i,t,r,s),e.set=o=>{t.value=o,t.dispatchEvent(Oae(r))}}function Oae(e){return typeof Event<"u"?new Event(e):{type:e}}function Lae(e,t,n,i){const r=i.signal(n.signal),s=_i("div",{class:Tae}),o=n.input==="radio"?s:s.appendChild(_i("label"));o.appendChild(_i("span",{class:Mae},n.name||n.signal)),t.appendChild(s);let a=Iae;switch(n.input){case"checkbox":a=Pae;break;case"select":a=zae;break;case"radio":a=Bae;break;case"range":a=jae;break}a(e,o,n,r)}function Iae(e,t,n,i){const r=_i("input");for(const s in n)s!=="signal"&&s!=="element"&&r.setAttribute(s==="input"?"type":s,n[s]);r.setAttribute("name",n.signal),r.value=i,t.appendChild(r),r.addEventListener("input",()=>e.update(r.value)),e.elements=[r],e.set=s=>r.value=s}function Pae(e,t,n,i){const r={type:"checkbox",name:n.signal};i&&(r.checked=!0);const s=_i("input",r);t.appendChild(s),s.addEventListener("change",()=>e.update(s.checked)),e.elements=[s],e.set=o=>s.checked=!!o||null}function zae(e,t,n,i){const r=_i("select",{name:n.signal}),s=n.labels||[];n.options.forEach((o,a)=>{const l={value:o};R0(o,i)&&(l.selected=!0),r.appendChild(_i("option",l,(s[a]||o)+""))}),t.appendChild(r),r.addEventListener("change",()=>{e.update(n.options[r.selectedIndex])}),e.elements=[r],e.set=o=>{for(let a=0,l=n.options.length;a{const l={type:"radio",name:n.signal,value:o};R0(o,i)&&(l.checked=!0);const u=_i("input",l);u.addEventListener("change",()=>e.update(o));const c=_i("label",{},(s[a]||o)+"");return c.prepend(u),r.appendChild(c),u}),e.set=o=>{const a=e.elements,l=a.length;for(let u=0;u{l.textContent=a.value,e.update(+a.value)};a.addEventListener("input",u),a.addEventListener("change",u),e.elements=[a],e.set=c=>{a.value=c,l.textContent=c}}function R0(e,t){return e===t||e+""==t+""}function TT(e,t,n,i,r,s){return t=t||new i(e.loader()),t.initialize(n,kT(e),ET(e),D0(e),r,s).background(e.background())}function W_(e,t){return t?function(){try{t.apply(this,arguments)}catch(n){e.error(n)}}:null}function Uae(e,t,n,i){const r=new i(e.loader(),W_(e,e.tooltip())).scene(e.scenegraph().root).initialize(n,D0(e),e);return t&&t.handlers().forEach(s=>{r.on(s.type,s.handler)}),r}function qae(e,t){const n=this,i=n._renderType,r=n._eventConfig.bind,s=gg(i);e=n._el=e?H_(n,e,!0):null,hae(n),s||n.error("Unrecognized renderer type: "+i);const o=s.handler||Ff,a=e?s.renderer:s.headless;return n._renderer=a?TT(n,n._renderer,e,a):null,n._handler=Uae(n,n._handler,e,o),n._redraw=!0,e&&r!=="none"&&(t=t?n._elBind=H_(n,t,!0):e.appendChild(_i("form",{class:"vega-bindings"})),n._bind.forEach(l=>{l.param.element&&r!=="container"&&(l.element=H_(n,l.param.element,!!l.param.input))}),n._bind.forEach(l=>{Nae(n,l.element||t,l)})),n}function H_(e,t,n){if(typeof t=="string")if(typeof document<"u"){if(t=document.querySelector(t),!t)return e.error("Signal bind element not found: "+t),null}else return e.error("DOM document instance not found."),null;if(t&&n)try{t.textContent=""}catch(i){t=null,e.error(i)}return t}const vd=e=>+e||0,Wae=e=>({top:e,bottom:e,left:e,right:e});function MT(e){return ie(e)?{top:vd(e.top),bottom:vd(e.bottom),left:vd(e.left),right:vd(e.right)}:Wae(vd(e))}async function G_(e,t,n,i){const r=gg(t),s=r&&r.headless;return s||q("Unrecognized renderer type: "+t),await e.runAsync(),TT(e,null,null,s,n,i).renderAsync(e._scenegraph.root)}async function Hae(e,t){e!==Ro.Canvas&&e!==Ro.SVG&&e!==Ro.PNG&&q("Unrecognized image type: "+e);const n=await G_(this,e,t);return e===Ro.SVG?Gae(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function Gae(e,t){const n=new Blob([e],{type:t});return window.URL.createObjectURL(n)}async function Vae(e,t){return(await G_(this,Ro.Canvas,e,t)).canvas()}async function Yae(e){return(await G_(this,Ro.SVG,e)).svg()}function Xae(e,t,n){return vT(e,iu,yd,n).parse(t)}function Zae(e){var t=this._runtime.scales;return le(t,e)||q("Unrecognized scale or projection: "+e),t[e].value}var DT="width",NT="height",V_="padding",RT={skip:!0};function OT(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===V_?i.left+i.right:0)}function LT(e,t){var n=e.autosize(),i=e.padding();return t-(n&&n.contains===V_?i.top+i.bottom:0)}function Kae(e){var t=e._signals,n=t[DT],i=t[NT],r=t[V_];function s(){e._autosize=e._resize=1}e._resizeWidth=e.add(null,a=>{e._width=a.size,e._viewWidth=OT(e,a.size),s()},{size:n}),e._resizeHeight=e.add(null,a=>{e._height=a.size,e._viewHeight=LT(e,a.size),s()},{size:i});const o=e.add(null,s,{pad:r});e._resizeWidth.rank=n.rank+1,e._resizeHeight.rank=i.rank+1,o.rank=r.rank+1}function Jae(e,t,n,i,r,s){this.runAfter(o=>{let a=0;o._autosize=0,o.width()!==n&&(a=1,o.signal(DT,n,RT),o._resizeWidth.skip(!0)),o.height()!==i&&(a=1,o.signal(NT,i,RT),o._resizeHeight.skip(!0)),o._viewWidth!==e&&(o._resize=1,o._viewWidth=e),o._viewHeight!==t&&(o._resize=1,o._viewHeight=t),(o._origin[0]!==r[0]||o._origin[1]!==r[1])&&(o._resize=1,o._origin=r),a&&o.run("enter"),s&&o.runAfter(l=>l.resize())},!1,1)}function Qae(e){return this._runtime.getState(e||{data:ele,signals:tle,recurse:!0})}function ele(e,t){return t.modified&&G(t.input.value)&&!e.startsWith("_:vega:_")}function tle(e,t){return!(e==="parent"||t instanceof iu.proxy)}function nle(e){return this.runAsync(null,t=>{t._trigger=!1,t._runtime.setState(e)},t=>{t._trigger=!0}),this}function ile(e,t){function n(i){e({timestamp:Date.now(),elapsed:i})}this._timers.push(Cte(n,t))}function rle(e,t,n,i){const r=e.element();r&&r.setAttribute("title",sle(i))}function sle(e){return e==null?"":G(e)?IT(e):ie(e)&&!lo(e)?ole(e):e+""}function ole(e){return Object.keys(e).map(t=>{const n=e[t];return t+": "+(G(n)?IT(n):PT(n))}).join(` +`)}function IT(e){return"["+e.map(PT).join(", ")+"]"}function PT(e){return G(e)?"[…]":ie(e)&&!lo(e)?"{…}":e}function ale(){if(this.renderer()==="canvas"&&this._renderer._canvas){let e=null;const t=()=>{e!=null&&e();const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",t),e=()=>{n.removeEventListener("change",t)},this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1,this._redraw=!0,this._resize=1,this.resize().runAsync()};t()}}function zT(e,t){const n=this;if(t=t||{},nu.call(n),t.loader&&n.loader(t.loader),t.logger&&n.logger(t.logger),t.logLevel!=null&&n.logLevel(t.logLevel),t.locale||e.locale){const s=Be({},e.locale,t.locale);n.locale(j4(s.number,s.time))}n._el=null,n._elBind=null,n._renderType=t.renderer||Ro.Canvas,n._scenegraph=new j$;const i=n._scenegraph.root;n._renderer=null,n._tooltip=t.tooltip||rle,n._redraw=!0,n._handler=new Ff().scene(i),n._globalCursor=!1,n._preventDefault=!1,n._timers=[],n._eventListeners=[],n._resizeListeners=[],n._eventConfig=$ae(e.eventConfig),n.globalCursor(n._eventConfig.globalCursor);const r=Xae(n,e,t.expr);n._runtime=r,n._signals=r.signals,n._bind=(e.bindings||[]).map(s=>({state:null,param:Be({},s)})),r.root&&r.root.set(i),i.source=r.data.root.input,n.pulse(r.data.root.input,n.changeset().insert(i.items)),n._width=n.width(),n._height=n.height(),n._viewWidth=OT(n,n._width),n._viewHeight=LT(n,n._height),n._origin=[0,0],n._resize=0,n._autosize=1,Kae(n),pae(n),gae(n),n.description(e.description),t.hover&&n.hover(),t.container&&n.initialize(t.container,t.bind),t.watchPixelRatio&&n._watchPixelRatio()}function O0(e,t){return le(e._signals,t)?e._signals[t]:q("Unrecognized signal name: "+ee(t))}function BT(e,t){const n=(e._targets||[]).filter(i=>i._update&&i._update.handler===t);return n.length?n[0]:null}function jT(e,t,n,i){let r=BT(n,i);return r||(r=W_(e,()=>i(t,n.value)),r.handler=i,e.on(n,null,r)),e}function UT(e,t,n){const i=BT(t,n);return i&&t._targets.remove(i),e}te(zT,nu,{async evaluate(e,t,n){if(await nu.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,vae(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(i){this.error(i)}return n&&Vh(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){if(arguments.length){const t=e!=null?e+"":null;return t!==this._desc&&wT(this._el,this._desc=t),this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){const i=O0(this,e);return arguments.length===1?i.value:this.update(i,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",MT(e)):MT(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(gg(e)||q("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(nu.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(O0(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:Jae,addEventListener(e,t,n){let i=t;return n&&n.trap===!1||(i=W_(this,t),i.raw=t),this._handler.on(e,i),this},removeEventListener(e,t){for(var n=this._handler.handlers(e),i=n.length,r,s;--i>=0;)if(s=n[i].type,r=n[i].handler,e===s&&(t===r||t===r.raw)){this._handler.off(s,r);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.includes(e)||t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,n=t.indexOf(e);return n>=0&&t.splice(n,1),this},addSignalListener(e,t){return jT(this,e,O0(this,e),t)},removeSignalListener(e,t){return UT(this,O0(this,e),t)},addDataListener(e,t){return jT(this,e,T0(this,e).values,t)},removeDataListener(e,t){return UT(this,T0(this,e).values,t)},globalCursor(e){if(arguments.length){if(this._globalCursor!==!!e){const t=q_(this,null);this._globalCursor=!!e,t&&q_(this,t)}return this}else return this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:ile,events:Cae,finalize:Fae,hover:Aae,data:mae,change:M0,insert:yae,remove:bae,scale:Zae,initialize:qae,toImageURL:Hae,toCanvas:Vae,toSVG:Yae,getState:Qae,setState:nle,_watchPixelRatio:ale});const lle="view",L0="[",I0="]",qT="{",WT="}",ule=":",HT=",",cle="@",fle=">",dle=/[[\]{}]/,hle={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let GT,VT;function qo(e,t,n){return GT=t||lle,VT=n||hle,YT(e.trim()).map(Y_)}function ple(e){return VT[e]}function _d(e,t,n,i,r){const s=e.length;let o=0,a;for(;t' after between selector: "+e;i=i.map(Y_);const r=Y_(e.slice(1).trim());return r.between?{between:i,stream:r}:(r.between=i,r)}function mle(e){const t={source:GT},n=[];let i=[0,0],r=0,s=0,o=e.length,a=0,l,u;if(e[o-1]===WT){if(a=e.lastIndexOf(qT),a>=0){try{i=yle(e.substring(a+1,o-1))}catch{throw"Invalid throttle specification: "+e}e=e.slice(0,a).trim(),o=e.length}else throw"Unmatched right brace: "+e;a=0}if(!o)throw e;if(e[0]===cle&&(r=++a),l=_d(e,a,ule),l1?(t.type=n[1],r?t.markname=n[0].slice(1):ple(n[0])?t.marktype=n[0]:t.source=n[0]):t.type=n[0],t.type.slice(-1)==="!"&&(t.consume=!0,t.type=t.type.slice(0,-1)),u!=null&&(t.filter=u),i[0]&&(t.throttle=i[0]),i[1]&&(t.debounce=i[1]),t}function yle(e){const t=e.split(HT);if(!e.length||t.length>2)throw e;return t.map(n=>{const i=+n;if(i!==i)throw e;return i})}function ble(e){return ie(e)?e:{type:e||"pad"}}const xd=e=>+e||0,vle=e=>({top:e,bottom:e,left:e,right:e});function _le(e){return ie(e)?e.signal?e:{top:xd(e.top),bottom:xd(e.bottom),left:xd(e.left),right:xd(e.right)}:vle(xd(e))}const Qt=e=>ie(e)&&!G(e)?Be({},e):{value:e};function XT(e,t,n,i){return n!=null?(ie(n)&&!G(n)||G(n)&&n.length&&ie(n[0])?e.update[t]=n:e[i||"enter"][t]={value:n},1):0}function fn(e,t,n){for(const i in t)XT(e,i,t[i]);for(const i in n)XT(e,i,n[i],"update")}function Lu(e,t,n){for(const i in t)n&&le(n,i)||(e[i]=Be(e[i]||{},t[i]));return e}function Iu(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const X_="mark",Z_="frame",K_="scope",xle="axis",wle="axis-domain",kle="axis-grid",Ele="axis-label",$le="axis-tick",Sle="axis-title",Cle="legend",Ale="legend-band",Fle="legend-entry",Tle="legend-gradient",ZT="legend-label",Mle="legend-symbol",Dle="legend-title",Nle="title",Rle="title-text",Ole="title-subtitle";function Lle(e,t,n,i,r){const s={},o={};let a,l,u,c;l="lineBreak",t==="text"&&r[l]!=null&&!Iu(l,e)&&J_(s,l,r[l]),(n=="legend"||String(n).startsWith("axis"))&&(n=null),c=n===Z_?r.group:n===X_?Be({},r.mark,r[t]):null;for(l in c)u=Iu(l,e)||(l==="fill"||l==="stroke")&&(Iu("fill",e)||Iu("stroke",e)),u||J_(s,l,c[l]);se(i).forEach(f=>{const d=r.style&&r.style[f];for(const h in d)Iu(h,e)||J_(s,h,d[h])}),e=Be({},e);for(l in s)c=s[l],c.signal?(a=a||{})[l]=c:o[l]=c;return e.enter=Be(o,e.enter),a&&(e.update=Be(a,e.update)),e}function J_(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const KT=e=>re(e)?ee(e):e.signal?`(${e.signal})`:JT(e);function P0(e){if(e.gradient!=null)return Ple(e);let t=e.signal?`(${e.signal})`:e.color?Ile(e.color):e.field!=null?JT(e.field):e.value!==void 0?ee(e.value):void 0;return e.scale!=null&&(t=zle(e,t)),t===void 0&&(t=null),e.exponent!=null&&(t=`pow(${t},${B0(e.exponent)})`),e.mult!=null&&(t+=`*${B0(e.mult)}`),e.offset!=null&&(t+=`+${B0(e.offset)}`),e.round&&(t=`round(${t})`),t}const z0=(e,t,n,i)=>`(${e}(${[t,n,i].map(P0).join(",")})+'')`;function Ile(e){return e.c?z0("hcl",e.h,e.c,e.l):e.h||e.s?z0("hsl",e.h,e.s,e.l):e.l||e.a?z0("lab",e.l,e.a,e.b):e.r||e.g||e.b?z0("rgb",e.r,e.g,e.b):null}function Ple(e){const t=[e.start,e.stop,e.count].map(n=>n==null?null:ee(n));for(;t.length&&Ve(t)==null;)t.pop();return t.unshift(KT(e.gradient)),`gradient(${t.join(",")})`}function B0(e){return ie(e)?"("+P0(e)+")":e}function JT(e){return QT(ie(e)?e:{datum:e})}function QT(e){let t,n,i;if(e.signal)t="datum",i=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";n-- >0;)t+=".mark.group";e.parent?(i=e.parent,t+=".datum"):i=e.group}else e.datum?(t="datum",i=e.datum):q("Invalid field reference: "+ee(e));return e.signal||(i=re(i)?Mr(i).map(ee).join("]["):QT(i)),t+"["+i+"]"}function zle(e,t){const n=KT(e.scale);return e.range!=null?t=`lerp(_range(${n}), ${+e.range})`:(t!==void 0&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(+e.band==1?"":"*"+B0(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),t==null&&(t="0")),t}function Ble(e){let t="";return e.forEach(n=>{const i=P0(n);t+=n.test?`(${n.test})?${i}:`:i}),Ve(t)===":"&&(t+="null"),t}function eM(e,t,n,i,r,s){const o={};s=s||{},s.encoders={$encode:o},e=Lle(e,t,n,i,r.config);for(const a in e)o[a]=jle(e[a],t,s,r);return s}function jle(e,t,n,i){const r={},s={};for(const o in e)e[o]!=null&&(r[o]=qle(Ule(e[o]),i,n,s));return{$expr:{marktype:t,channels:r},$fields:Object.keys(s),$output:Object.keys(e)}}function Ule(e){return G(e)?Ble(e):P0(e)}function qle(e,t,n,i){const r=Qr(e,t);return r.$fields.forEach(s=>i[s]=1),Be(n,r.$params),r.$expr}const Wle="outer",Hle=["value","update","init","react","bind"];function tM(e,t){q(e+' for "outer" push: '+ee(t))}function nM(e,t){const n=e.name;if(e.push===Wle)t.signals[n]||tM("No prior signal definition",n),Hle.forEach(i=>{e[i]!==void 0&&tM("Invalid property ",i)});else{const i=t.addSignal(n,e.value);e.react===!1&&(i.react=!1),e.bind&&t.addBinding(n,e.bind)}}function Q_(e,t,n,i){this.id=-1,this.type=e,this.value=t,this.params=n,i&&(this.parent=i)}function j0(e,t,n,i){return new Q_(e,t,n,i)}function U0(e,t){return j0("operator",e,t)}function Ce(e){const t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function wd(e,t){return t?{$field:e,$name:t}:{$field:e}}const e7=wd("key");function iM(e,t){return{$compare:e,$order:t}}function Gle(e,t){const n={$key:e};return t&&(n.$flat=!0),n}const Vle="ascending",Yle="descending";function Xle(e){return ie(e)?(e.order===Yle?"-":"+")+q0(e.op,e.field):""}function q0(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const t7="scope",n7="view";function Vt(e){return e&&e.signal}function Zle(e){return e&&e.expr}function W0(e){if(Vt(e))return!0;if(ie(e)){for(const t in e)if(W0(e[t]))return!0}return!1}function dr(e,t){return e??t}function Va(e){return e&&e.signal||e}const rM="timer";function kd(e,t){return(e.merge?Jle:e.stream?Qle:e.type?eue:q("Invalid stream specification: "+ee(e)))(e,t)}function Kle(e){return e===t7?n7:e||n7}function Jle(e,t){const n=e.merge.map(r=>kd(r,t)),i=i7({merge:n},e,t);return t.addStream(i).id}function Qle(e,t){const n=kd(e.stream,t),i=i7({stream:n},e,t);return t.addStream(i).id}function eue(e,t){let n;e.type===rM?(n=t.event(rM,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(Kle(e.source),e.type);const i=i7({stream:n},e,t);return Object.keys(i).length===1?n:t.addStream(i).id}function i7(e,t,n){let i=t.between;return i&&(i.length!==2&&q('Stream "between" parameter must have 2 entries: '+ee(t)),e.between=[kd(i[0],n),kd(i[1],n)]),i=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&i.push(tue(t.marktype,t.markname,t.markrole)),t.source===t7&&i.push("inScope(event.item)"),i.length&&(e.filter=Qr("("+i.join(")&&(")+")",n).$expr),(i=t.throttle)!=null&&(e.throttle=+i),(i=t.debounce)!=null&&(e.debounce=+i),t.consume&&(e.consume=!0),e}function tue(e,t,n){const i="event.item";return i+(e&&e!=="*"?"&&"+i+".mark.marktype==='"+e+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(t?"&&"+i+".mark.name==='"+t+"'":"")}const nue={code:"_.$value",ast:{type:"Identifier",value:"value"}};function iue(e,t,n){const i=e.encode,r={target:n};let s=e.events,o=e.update,a=[];s||q("Signal update missing events specification."),re(s)&&(s=qo(s,t.isSubscope()?t7:n7)),s=se(s).filter(l=>l.signal||l.scale?(a.push(l),0):1),a.length>1&&(a=[sue(a)]),s.length&&a.push(s.length>1?{merge:s}:s[0]),i!=null&&(o&&q("Signal encode and update are mutually exclusive."),o="encode(item(),"+ee(i)+")"),r.update=re(o)?Qr(o,t):o.expr!=null?Qr(o.expr,t):o.value!=null?o.value:o.signal!=null?{$expr:nue,$params:{$value:t.signalRef(o.signal)}}:q("Invalid signal update specification."),e.force&&(r.options={force:!0}),a.forEach(l=>t.addUpdate(Be(rue(l,t),r)))}function rue(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):kd(e,t)}}function sue(e){return{signal:"["+e.map(t=>t.scale?'scale("'+t.scale+'")':t.signal)+"]"}}function oue(e,t){const n=t.getSignal(e.name);let i=e.update;e.init&&(i?q("Signals can not include both init and update expressions."):(i=e.init,n.initonly=!0)),i&&(i=Qr(i,t),n.update=i.$expr,n.params=i.$params),e.on&&e.on.forEach(r=>iue(r,t,n.id))}const dt=e=>(t,n,i)=>j0(e,n,t||void 0,i),sM=dt("aggregate"),aue=dt("axisticks"),oM=dt("bound"),hr=dt("collect"),aM=dt("compare"),lue=dt("datajoin"),lM=dt("encode"),uue=dt("expression"),cue=dt("facet"),fue=dt("field"),due=dt("key"),hue=dt("legendentries"),pue=dt("load"),gue=dt("mark"),mue=dt("multiextent"),yue=dt("multivalues"),bue=dt("overlap"),vue=dt("params"),uM=dt("prefacet"),_ue=dt("projection"),xue=dt("proxy"),wue=dt("relay"),cM=dt("render"),kue=dt("scale"),Ya=dt("sieve"),Eue=dt("sortitems"),fM=dt("viewlayout"),$ue=dt("values");let Sue=0;const dM={min:"min",max:"max",count:"sum"};function Cue(e,t){const n=e.type||"linear";IE(n)||q("Unrecognized scale type: "+ee(n)),t.addScale(e.name,{type:n,domain:void 0})}function Aue(e,t){const n=t.getScale(e.name).params;let i;n.domain=hM(e.domain,e,t),e.range!=null&&(n.range=gM(e,t,n)),e.interpolate!=null&&Pue(e.interpolate,n),e.nice!=null&&(n.nice=Iue(e.nice,t)),e.bins!=null&&(n.bins=Lue(e.bins,t));for(i in e)le(n,i)||i==="name"||(n[i]=Bi(e[i],t))}function Bi(e,t){return ie(e)?e.signal?t.signalRef(e.signal):q("Unsupported object: "+ee(e)):e}function H0(e,t){return e.signal?t.signalRef(e.signal):e.map(n=>Bi(n,t))}function G0(e){q("Can not find data set: "+ee(e))}function hM(e,t,n){if(!e){(t.domainMin!=null||t.domainMax!=null)&&q("No scale domain defined for domainMin/domainMax to override.");return}return e.signal?n.signalRef(e.signal):(G(e)?Fue:e.fields?Mue:Tue)(e,t,n)}function Fue(e,t,n){return e.map(i=>Bi(i,n))}function Tue(e,t,n){const i=n.getData(e.data);return i||G0(e.data),hu(t.type)?i.valuesRef(n,e.field,pM(e.sort,!1)):BE(t.type)?i.domainRef(n,e.field):i.extentRef(n,e.field)}function Mue(e,t,n){const i=e.data,r=e.fields.reduce((s,o)=>(o=re(o)?{data:i,field:o}:G(o)||o.signal?Due(o,n):o,s.push(o),s),[]);return(hu(t.type)?Nue:BE(t.type)?Rue:Oue)(e,n,r)}function Due(e,t){const n="_:vega:_"+Sue++,i=hr({});if(G(e))i.value={$ingest:e};else if(e.signal){const r="setdata("+ee(n)+","+e.signal+")";i.params.input=t.signalRef(r)}return t.addDataPipeline(n,[i,Ya({})]),{data:n,field:"data"}}function Nue(e,t,n){const i=pM(e.sort,!0);let r,s;const o=n.map(u=>{const c=t.getData(u.data);return c||G0(u.data),c.countsRef(t,u.field,i)}),a={groupby:e7,pulse:o};i&&(r=i.op||"count",s=i.field?q0(r,i.field):"count",a.ops=[dM[r]],a.fields=[t.fieldRef(s)],a.as=[s]),r=t.add(sM(a));const l=t.add(hr({pulse:Ce(r)}));return s=t.add($ue({field:e7,sort:t.sortRef(i),pulse:Ce(l)})),Ce(s)}function pM(e,t){return e&&(!e.field&&!e.op?ie(e)?e.field="key":e={field:"key"}:!e.field&&e.op!=="count"?q("No field provided for sort aggregate op: "+e.op):t&&e.field&&e.op&&!dM[e.op]&&q("Multiple domain scales can not be sorted using "+e.op)),e}function Rue(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||G0(r.data),s.domainRef(t,r.field)});return Ce(t.add(yue({values:i})))}function Oue(e,t,n){const i=n.map(r=>{const s=t.getData(r.data);return s||G0(r.data),s.extentRef(t,r.field)});return Ce(t.add(mue({extents:i})))}function Lue(e,t){return e.signal||G(e)?H0(e,t):t.objectProperty(e)}function Iue(e,t){return e.signal?t.signalRef(e.signal):ie(e)?{interval:Bi(e.interval),step:Bi(e.step)}:Bi(e)}function Pue(e,t){t.interpolate=Bi(e.type||e),e.gamma!=null&&(t.interpolateGamma=Bi(e.gamma))}function gM(e,t,n){const i=t.config.range;let r=e.range;if(r.signal)return t.signalRef(r.signal);if(re(r)){if(i&&le(i,r))return e=Be({},e,{range:i[r]}),gM(e,t,n);r==="width"?r=[0,{signal:"width"}]:r==="height"?r=hu(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:q("Unrecognized scale range value: "+ee(r))}else if(r.scheme){n.scheme=G(r.scheme)?H0(r.scheme,t):Bi(r.scheme,t),r.extent&&(n.schemeExtent=H0(r.extent,t)),r.count&&(n.schemeCount=Bi(r.count,t));return}else if(r.step){n.rangeStep=Bi(r.step,t);return}else{if(hu(e.type)&&!G(r))return hM(r,e,t);G(r)||q("Unsupported range type: "+ee(r))}return r.map(s=>(G(s)?H0:Bi)(s,t))}function zue(e,t){const n=t.config.projection||{},i={};for(const r in e)r!=="name"&&(i[r]=r7(e[r],r,t));for(const r in n)i[r]==null&&(i[r]=r7(n[r],r,t));t.addProjection(e.name,i)}function r7(e,t,n){return G(e)?e.map(i=>r7(i,t,n)):ie(e)?e.signal?n.signalRef(e.signal):t==="fit"?e:q("Unsupported parameter object: "+ee(e)):e}const pr="top",Pu="left",zu="right",Wo="bottom",mM="center",Bue="vertical",jue="start",Uue="middle",que="end",s7="index",o7="label",Wue="offset",Bu="perc",Hue="perc2",ji="value",Ed="guide-label",a7="guide-title",Gue="group-title",Vue="group-subtitle",yM="symbol",V0="gradient",l7="discrete",u7="size",c7=[u7,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],$d={name:1,style:1,interactive:1},Xe={value:0},Ui={value:1},Y0="group",bM="rect",f7="rule",Yue="symbol",Xa="text";function Sd(e){return e.type=Y0,e.interactive=e.interactive||!1,e}function oi(e,t){const n=(i,r)=>dr(e[i],dr(t[i],r));return n.isVertical=i=>Bue===dr(e.direction,t.direction||(i?t.symbolDirection:t.gradientDirection)),n.gradientLength=()=>dr(e.gradientLength,t.gradientLength||t.gradientWidth),n.gradientThickness=()=>dr(e.gradientThickness,t.gradientThickness||t.gradientHeight),n.entryColumns=()=>dr(e.columns,dr(t.columns,+n.isVertical(!0))),n}function vM(e,t){const n=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return n&&n.signal?n:n?n.value:null}function Xue(e,t,n){const i=t.config.style[n];return i&&i[e]}function X0(e,t,n){return`item.anchor === '${jue}' ? ${e} : item.anchor === '${que}' ? ${t} : ${n}`}const d7=X0(ee(Pu),ee(zu),ee(mM));function Zue(e){const t=e("tickBand");let n=e("tickOffset"),i,r;return t?t.signal?(i={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},r={signal:`(${t.signal}) === 'extent'`},ie(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : ${n}`})):t==="extent"?(i=1,r=!0,n=0):(i=.5,r=!1):(i=e("bandPosition"),r=e("tickExtra")),{extra:r,band:i,offset:n}}function _M(e,t){return t?e?ie(e)?Object.assign({},e,{offset:_M(e.offset,t)}):{value:e,offset:t}:t:e}function xi(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=Lu(e.encode,t,$d)):e.interactive=!1,e}function Kue(e,t,n,i){const r=oi(e,n),s=r.isVertical(),o=r.gradientThickness(),a=r.gradientLength();let l,u,c,f,d;s?(u=[0,1],c=[0,0],f=o,d=a):(u=[0,0],c=[1,0],f=a,d=o);const h={enter:l={opacity:Xe,x:Xe,y:Xe,width:Qt(f),height:Qt(d)},update:Be({},l,{opacity:Ui,fill:{gradient:t,start:u,stop:c}}),exit:{opacity:Xe}};return fn(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")}),xi({type:bM,role:Tle,encode:h},i)}function Jue(e,t,n,i,r){const s=oi(e,n),o=s.isVertical(),a=s.gradientThickness(),l=s.gradientLength();let u,c,f,d,h="";o?(u="y",f="y2",c="x",d="width",h="1-"):(u="x",f="x2",c="y",d="height");const p={opacity:Xe,fill:{scale:t,field:ji}};p[u]={signal:h+"datum."+Bu,mult:l},p[c]=Xe,p[f]={signal:h+"datum."+Hue,mult:l},p[d]=Qt(a);const g={enter:p,update:Be({},p,{opacity:Ui}),exit:{opacity:Xe}};return fn(g,{stroke:s("gradientStrokeColor"),strokeWidth:s("gradientStrokeWidth")},{opacity:s("gradientOpacity")}),xi({type:bM,role:Ale,key:ji,from:r,encode:g},i)}const Que=`datum.${Bu}<=0?"${Pu}":datum.${Bu}>=1?"${zu}":"${mM}"`,ece=`datum.${Bu}<=0?"${Wo}":datum.${Bu}>=1?"${pr}":"${Uue}"`;function xM(e,t,n,i){const r=oi(e,t),s=r.isVertical(),o=Qt(r.gradientThickness()),a=r.gradientLength();let l=r("labelOverlap"),u,c,f,d,h="";const p={enter:u={opacity:Xe},update:c={opacity:Ui,text:{field:o7}},exit:{opacity:Xe}};return fn(p,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:dr(e.labelLimit,t.gradientLabelLimit)}),s?(u.align={value:"left"},u.baseline=c.baseline={signal:ece},f="y",d="x",h="1-"):(u.align=c.align={signal:Que},u.baseline={value:"top"},f="x",d="y"),u[f]=c[f]={signal:h+"datum."+Bu,mult:a},u[d]=c[d]=o,o.offset=dr(e.labelOffset,t.gradientLabelOffset)||0,l=l?{separation:r("labelSeparation"),method:l,order:"datum."+s7}:void 0,xi({type:Xa,role:ZT,style:Ed,key:ji,from:i,encode:p,overlap:l},n)}function tce(e,t,n,i,r){const s=oi(e,t),o=n.entries,a=!!(o&&o.interactive),l=o?o.name:void 0,u=s("clipHeight"),c=s("symbolOffset"),f={data:"value"},d=`(${r}) ? datum.${Wue} : datum.${u7}`,h=u?Qt(u):{field:u7},p=`datum.${s7}`,g=`max(1, ${r})`;let m,y,b,v,_;h.mult=.5,m={enter:y={opacity:Xe,x:{signal:d,mult:.5,offset:c},y:h},update:b={opacity:Ui,x:y.x,y:y.y},exit:{opacity:Xe}};let x=null,k=null;e.fill||(x=t.symbolBaseFillColor,k=t.symbolBaseStrokeColor),fn(m,{fill:s("symbolFillColor",x),shape:s("symbolType"),size:s("symbolSize"),stroke:s("symbolStrokeColor",k),strokeDash:s("symbolDash"),strokeDashOffset:s("symbolDashOffset"),strokeWidth:s("symbolStrokeWidth")},{opacity:s("symbolOpacity")}),c7.forEach(F=>{e[F]&&(b[F]=y[F]={scale:e[F],field:ji})});const w=xi({type:Yue,role:Mle,key:ji,from:f,clip:u?!0:void 0,encode:m},n.symbols),E=Qt(c);E.offset=s("labelOffset"),m={enter:y={opacity:Xe,x:{signal:d,offset:E},y:h},update:b={opacity:Ui,text:{field:o7},x:y.x,y:y.y},exit:{opacity:Xe}},fn(m,{align:s("labelAlign"),baseline:s("labelBaseline"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontStyle:s("labelFontStyle"),fontWeight:s("labelFontWeight"),limit:s("labelLimit")});const $=xi({type:Xa,role:ZT,style:Ed,key:ji,from:f,encode:m},n.labels);return m={enter:{noBound:{value:!u},width:Xe,height:u?Qt(u):Xe,opacity:Xe},exit:{opacity:Xe},update:b={opacity:Ui,row:{signal:null},column:{signal:null}}},s.isVertical(!0)?(v=`ceil(item.mark.items.length / ${g})`,b.row.signal=`${p}%${v}`,b.column.signal=`floor(${p} / ${v})`,_={field:["row",p]}):(b.row.signal=`floor(${p} / ${g})`,b.column.signal=`${p} % ${g}`,_={field:p}),b.column.signal=`(${r})?${b.column.signal}:${p}`,i={facet:{data:i,name:"value",groupby:s7}},Sd({role:K_,from:i,encode:Lu(m,o,$d),marks:[w,$],name:l,interactive:a,sort:_})}function nce(e,t){const n=oi(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const h7='item.orient === "left"',p7='item.orient === "right"',Z0=`(${h7} || ${p7})`,ice=`datum.vgrad && ${Z0}`,rce=X0('"top"','"bottom"','"middle"'),sce=X0('"right"','"left"','"center"'),oce=`datum.vgrad && ${p7} ? (${sce}) : (${Z0} && !(datum.vgrad && ${h7})) ? "left" : ${d7}`,ace=`item._anchor || (${Z0} ? "middle" : "start")`,lce=`${ice} ? (${h7} ? -90 : 90) : 0`,uce=`${Z0} ? (datum.vgrad ? (${p7} ? "bottom" : "top") : ${rce}) : "top"`;function cce(e,t,n,i){const r=oi(e,t),s={enter:{opacity:Xe},update:{opacity:Ui,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:Xe}};return fn(s,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:ace},angle:{signal:lce},align:{signal:oce},baseline:{signal:uce},text:e.title,fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),baseline:r("titleBaseline")}),xi({type:Xa,role:Dle,style:a7,from:i,encode:s},n)}function fce(e,t){let n;return ie(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+wM(e.path)+")":e.sphere&&(n="geoShape("+wM(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}function wM(e){return ie(e)&&e.signal?e.signal:ee(e)}function kM(e){const t=e.role||"";return t.startsWith("axis")||t.startsWith("legend")||t.startsWith("title")?t:e.type===Y0?K_:t||X_}function dce(e){return{marktype:e.type,name:e.name||void 0,role:e.role||kM(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}function hce(e,t){return e&&e.signal?t.signalRef(e.signal):e!==!1}function g7(e,t){const n=l8(e.type);n||q("Unrecognized transform type: "+ee(e.type));const i=j0(n.type.toLowerCase(),null,EM(n,e,t));return e.signal&&t.addSignal(e.signal,t.proxy(i)),i.metadata=n.metadata||{},i}function EM(e,t,n){const i={},r=e.params.length;for(let s=0;s$M(e,s,n)):$M(e,r,n)}function $M(e,t,n){const i=e.type;if(Vt(t))return CM(i)?q("Expression references can not be signals."):m7(i)?n.fieldRef(t):AM(i)?n.compareRef(t):n.signalRef(t.signal);{const r=e.expr||m7(i);return r&&yce(t)?n.exprRef(t.expr,t.as):r&&bce(t)?wd(t.field,t.as):CM(i)?Qr(t,n):vce(i)?Ce(n.getData(t).values):m7(i)?wd(t):AM(i)?n.compareRef(t):t}}function gce(e,t,n){return re(t.from)||q('Lookup "from" parameter must be a string literal.'),n.getData(t.from).lookupRef(n,t.key)}function mce(e,t,n){const i=t[e.name];return e.array?(G(i)||q("Expected an array of sub-parameters. Instead: "+ee(i)),i.map(r=>SM(e,r,n))):SM(e,i,n)}function SM(e,t,n){const i=e.params.length;let r;for(let o=0;oe&&e.expr,bce=e=>e&&e.field,vce=e=>e==="data",CM=e=>e==="expr",m7=e=>e==="field",AM=e=>e==="compare";function _ce(e,t,n){let i,r,s,o,a;return e?(i=e.facet)&&(t||q("Only group marks can be faceted."),i.field!=null?o=a=K0(i,n):(e.data?a=Ce(n.getData(e.data).aggregate):(s=g7(Be({type:"aggregate",groupby:se(i.groupby)},i.aggregate),n),s.params.key=n.keyRef(i.groupby),s.params.pulse=K0(i,n),o=a=Ce(n.add(s))),r=n.keyRef(i.groupby,!0))):o=Ce(n.add(hr(null,[{}]))),o||(o=K0(e,n)),{key:r,pulse:o,parent:a}}function K0(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:Ce(t.getData(e.data).output)}function Za(e,t,n,i,r){this.scope=e,this.input=t,this.output=n,this.values=i,this.aggregate=r,this.index={}}Za.fromEntries=function(e,t){const n=t.length,i=t[n-1],r=t[n-2];let s=t[0],o=null,a=1;for(s&&s.type==="load"&&(s=t[1]),e.add(t[0]);af??"null").join(",")+"),0)",c=Qr(u,t);l.update=c.$expr,l.params=c.$params}function J0(e,t){const n=kM(e),i=e.type===Y0,r=e.from&&e.from.facet,s=e.overlap;let o=e.layout||n===K_||n===Z_,a,l,u,c,f,d,h;const p=n===X_||o||r,g=_ce(e.from,i,t);l=t.add(lue({key:g.key||(e.key?wd(e.key):void 0),pulse:g.pulse,clean:!i}));const m=Ce(l);l=u=t.add(hr({pulse:m})),l=t.add(gue({markdef:dce(e),interactive:hce(e.interactive,t),clip:fce(e.clip,t),context:{$context:!0},groups:t.lookup(),parent:t.signals.parent?t.signalRef("parent"):null,index:t.markpath(),pulse:Ce(l)}));const y=Ce(l);l=c=t.add(lM(eM(e.encode,e.type,n,e.style,t,{mod:!1,pulse:y}))),l.params.parent=t.encode(),e.transform&&e.transform.forEach(k=>{const w=g7(k,t),E=w.metadata;(E.generates||E.changes)&&q("Mark transforms should not generate new data."),E.nomod||(c.params.mod=!0),w.params.pulse=Ce(l),t.add(l=w)}),e.sort&&(l=t.add(Eue({sort:t.compareRef(e.sort),pulse:Ce(l)})));const b=Ce(l);(r||o)&&(o=t.add(fM({layout:t.objectProperty(e.layout),legends:t.legends,mark:y,pulse:b})),d=Ce(o));const v=t.add(oM({mark:y,pulse:d||b}));h=Ce(v),i&&(p&&(a=t.operators,a.pop(),o&&a.pop()),t.pushState(b,d||h,m),r?xce(e,t,g):p?wce(e,t,g):t.parse(e),t.popState(),p&&(o&&a.push(o),a.push(v))),s&&(h=kce(s,h,t));const _=t.add(cM({pulse:h})),x=t.add(Ya({pulse:Ce(_)},void 0,t.parent()));e.name!=null&&(f=e.name,t.addData(f,new Za(t,u,_,x)),e.on&&e.on.forEach(k=>{(k.insert||k.remove||k.toggle)&&q("Marks only support modify triggers."),MM(k,t,f)}))}function kce(e,t,n){const i=e.method,r=e.bound,s=e.separation,o={separation:Vt(s)?n.signalRef(s.signal):s,method:Vt(i)?n.signalRef(i.signal):i,pulse:t};if(e.order&&(o.sort=n.compareRef({field:e.order})),r){const a=r.tolerance;o.boundTolerance=Vt(a)?n.signalRef(a.signal):+a,o.boundScale=n.scaleRef(r.scale),o.boundOrient=r.orient}return Ce(n.add(bue(o)))}function Ece(e,t){const n=t.config.legend,i=e.encode||{},r=oi(e,n),s=i.legend||{},o=s.name||void 0,a=s.interactive,l=s.style,u={};let c=0,f,d,h;c7.forEach(v=>e[v]?(u[v]=e[v],c=c||e[v]):0),c||q("Missing valid scale for legend.");const p=$ce(e,t.scaleType(c)),g={title:e.title!=null,scales:u,type:p,vgrad:p!=="symbol"&&r.isVertical()},m=Ce(t.add(hr(null,[g]))),y={enter:{x:{value:0},y:{value:0}}},b=Ce(t.add(hue(d={type:p,scale:t.scaleRef(c),count:t.objectProperty(r("tickCount")),limit:t.property(r("symbolLimit")),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));return p===V0?(h=[Kue(e,c,n,i.gradient),xM(e,n,i.labels,b)],d.count=d.count||t.signalRef(`max(2,2*floor((${Va(r.gradientLength())})/100))`)):p===l7?h=[Jue(e,c,n,i.gradient,b),xM(e,n,i.labels,b)]:(f=nce(e,n),h=[tce(e,n,i,b,Va(f.columns))],d.size=Ace(e,t,h[0].marks)),h=[Sd({role:Fle,from:m,encode:y,marks:h,layout:f,interactive:a})],g.title&&h.push(cce(e,n,i.title,m)),J0(Sd({role:Cle,from:m,encode:Lu(Cce(r,e,n),s,$d),marks:h,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:o,interactive:a,style:l}),t)}function $ce(e,t){let n=e.type||yM;return!e.type&&Sce(e)===1&&(e.fill||e.stroke)&&(n=wb(t)?V0:kb(t)?l7:yM),n!==V0?n:kb(t)?l7:V0}function Sce(e){return c7.reduce((t,n)=>t+(e[n]?1:0),0)}function Cce(e,t,n){const i={enter:{},update:{}};return fn(i,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),i}function Ace(e,t,n){const i=Va(DM("size",e,n)),r=Va(DM("strokeWidth",e,n)),s=Va(Fce(n[1].encode,t,Ed));return Qr(`max(ceil(sqrt(${i})+${r}),${s})`,t)}function DM(e,t,n){return t[e]?`scale("${t[e]}",datum)`:vM(e,n[0].encode)}function Fce(e,t,n){return vM("fontSize",e)||Xue("fontSize",t,n)}const Tce=`item.orient==="${Pu}"?-90:item.orient==="${zu}"?90:0`;function Mce(e,t){e=re(e)?{text:e}:e;const n=oi(e,t.config.title),i=e.encode||{},r=i.group||{},s=r.name||void 0,o=r.interactive,a=r.style,l=[],u={},c=Ce(t.add(hr(null,[u])));return l.push(Rce(e,n,Dce(e),c)),e.subtitle&&l.push(Oce(e,n,i.subtitle,c)),J0(Sd({role:Nle,from:c,encode:Nce(n,r),marks:l,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:s,interactive:o,style:a}),t)}function Dce(e){const t=e.encode;return t&&t.title||Be({name:e.name,interactive:e.interactive,style:e.style},t)}function Nce(e,t){const n={enter:{},update:{}};return fn(n,{orient:e("orient"),anchor:e("anchor"),align:{signal:d7},angle:{signal:Tce},limit:e("limit"),frame:e("frame"),offset:e("offset")||0,padding:e("subtitlePadding")}),Lu(n,t,$d)}function Rce(e,t,n,i){const r={value:0},s=e.text,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return fn(o,{text:s,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("color"),font:t("font"),fontSize:t("fontSize"),fontStyle:t("fontStyle"),fontWeight:t("fontWeight"),lineHeight:t("lineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),xi({type:Xa,role:Rle,style:Gue,from:i,encode:o},n)}function Oce(e,t,n,i){const r={value:0},s=e.subtitle,o={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};return fn(o,{text:s,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:t("dx"),dy:t("dy"),fill:t("subtitleColor"),font:t("subtitleFont"),fontSize:t("subtitleFontSize"),fontStyle:t("subtitleFontStyle"),fontWeight:t("subtitleFontWeight"),lineHeight:t("subtitleLineHeight")},{align:t("align"),angle:t("angle"),baseline:t("baseline")}),xi({type:Xa,role:Ole,style:Vue,from:i,encode:o},n)}function Lce(e,t){const n=[];e.transform&&e.transform.forEach(i=>{n.push(g7(i,t))}),e.on&&e.on.forEach(i=>{MM(i,t,e.name)}),t.addDataPipeline(e.name,Ice(e,t,n))}function Ice(e,t,n){const i=[];let r=null,s=!1,o=!1,a,l,u,c,f;for(e.values?Vt(e.values)||W0(e.format)?(i.push(NM(t,e)),i.push(r=Ka())):i.push(r=Ka({$ingest:e.values,$format:e.format})):e.url?W0(e.url)||W0(e.format)?(i.push(NM(t,e)),i.push(r=Ka())):i.push(r=Ka({$request:e.url,$format:e.format})):e.source&&(r=a=se(e.source).map(d=>Ce(t.getData(d).output)),i.push(null)),l=0,u=n.length;le===Wo||e===pr,Q0=(e,t,n)=>Vt(e)?jce(e.signal,t,n):e===Pu||e===pr?t:n,en=(e,t,n)=>Vt(e)?zce(e.signal,t,n):RM(e)?t:n,gr=(e,t,n)=>Vt(e)?Bce(e.signal,t,n):RM(e)?n:t,OM=(e,t,n)=>Vt(e)?Uce(e.signal,t,n):e===pr?{value:t}:{value:n},Pce=(e,t,n)=>Vt(e)?qce(e.signal,t,n):e===zu?{value:t}:{value:n},zce=(e,t,n)=>LM(`${e} === '${pr}' || ${e} === '${Wo}'`,t,n),Bce=(e,t,n)=>LM(`${e} !== '${pr}' && ${e} !== '${Wo}'`,t,n),jce=(e,t,n)=>y7(`${e} === '${Pu}' || ${e} === '${pr}'`,t,n),Uce=(e,t,n)=>y7(`${e} === '${pr}'`,t,n),qce=(e,t,n)=>y7(`${e} === '${zu}'`,t,n),LM=(e,t,n)=>(t=t!=null?Qt(t):t,n=n!=null?Qt(n):n,IM(t)&&IM(n)?(t=t?t.signal||ee(t.value):null,n=n?n.signal||ee(n.value):null,{signal:`${e} ? (${t}) : (${n})`}):[Be({test:e},t)].concat(n||[])),IM=e=>e==null||Object.keys(e).length===1,y7=(e,t,n)=>({signal:`${e} ? (${ju(t)}) : (${ju(n)})`}),Wce=(e,t,n,i,r)=>({signal:(i!=null?`${e} === '${Pu}' ? (${ju(i)}) : `:"")+(n!=null?`${e} === '${Wo}' ? (${ju(n)}) : `:"")+(r!=null?`${e} === '${zu}' ? (${ju(r)}) : `:"")+(t!=null?`${e} === '${pr}' ? (${ju(t)}) : `:"")+"(null)"}),ju=e=>Vt(e)?e.signal:e==null?null:ee(e),Hce=(e,t)=>t===0?0:Vt(e)?{signal:`(${e.signal}) * ${t}`}:{value:e*t},Uu=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function qu(e,t,n,i){let r;if(t&&le(t,e))return t[e];if(le(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=e[5].toLowerCase()+e.slice(6)}return i[a7][r]}else if(e.startsWith("label")){switch(e){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=e[5].toLowerCase()+e.slice(6)}return i[Ed][r]}return null}function PM(e){const t={};for(const n of e)if(n)for(const i in n)t[i]=1;return Object.keys(t)}function Gce(e,t){var n=t.config,i=n.style,r=n.axis,s=t.scaleType(e.scale)==="band"&&n.axisBand,o=e.orient,a,l,u;if(Vt(o)){const f=PM([n.axisX,n.axisY]),d=PM([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);a={};for(u of f)a[u]=en(o,qu(u,n.axisX,r,i),qu(u,n.axisY,r,i));l={};for(u of d)l[u]=Wce(o.signal,qu(u,n.axisTop,r,i),qu(u,n.axisBottom,r,i),qu(u,n.axisLeft,r,i),qu(u,n.axisRight,r,i))}else a=o===pr||o===Wo?n.axisX:n.axisY,l=n["axis"+o[0].toUpperCase()+o.slice(1)];return a||l||s?Be({},r,a,l,s):r}function Vce(e,t,n,i){const r=oi(e,t),s=e.orient;let o,a;const l={enter:o={opacity:Xe},update:a={opacity:Ui},exit:{opacity:Xe}};fn(l,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const u=zM(e,0),c=zM(e,1);return o.x=a.x=en(s,u,Xe),o.x2=a.x2=en(s,c),o.y=a.y=gr(s,u,Xe),o.y2=a.y2=gr(s,c),xi({type:f7,role:wle,from:i,encode:l},n)}function zM(e,t){return{scale:e.scale,range:t}}function Yce(e,t,n,i,r){const s=oi(e,t),o=e.orient,a=e.gridScale,l=Q0(o,1,-1),u=Xce(e.offset,l);let c,f,d;const h={enter:c={opacity:Xe},update:d={opacity:Ui},exit:f={opacity:Xe}};fn(h,{stroke:s("gridColor"),strokeCap:s("gridCap"),strokeDash:s("gridDash"),strokeDashOffset:s("gridDashOffset"),strokeOpacity:s("gridOpacity"),strokeWidth:s("gridWidth")});const p={scale:e.scale,field:ji,band:r.band,extra:r.extra,offset:r.offset,round:s("tickRound")},g=en(o,{signal:"height"},{signal:"width"}),m=a?{scale:a,range:0,mult:l,offset:u}:{value:0,offset:u},y=a?{scale:a,range:1,mult:l,offset:u}:Be(g,{mult:l,offset:u});return c.x=d.x=en(o,p,m),c.y=d.y=gr(o,p,m),c.x2=d.x2=gr(o,y),c.y2=d.y2=en(o,y),f.x=en(o,p),f.y=gr(o,p),xi({type:f7,role:kle,key:ji,from:i,encode:h},n)}function Xce(e,t){if(t!==1)if(!ie(e))e=Vt(t)?{signal:`(${t.signal}) * (${e||0})`}:t*(e||0);else{let n=e=Be({},e);for(;n.mult!=null;)if(ie(n.mult))n=n.mult=Be({},n.mult);else return n.mult=Vt(t)?{signal:`(${n.mult}) * (${t.signal})`}:n.mult*t,e;n.mult=t}return e}function Zce(e,t,n,i,r,s){const o=oi(e,t),a=e.orient,l=Q0(a,-1,1);let u,c,f;const d={enter:u={opacity:Xe},update:f={opacity:Ui},exit:c={opacity:Xe}};fn(d,{stroke:o("tickColor"),strokeCap:o("tickCap"),strokeDash:o("tickDash"),strokeDashOffset:o("tickDashOffset"),strokeOpacity:o("tickOpacity"),strokeWidth:o("tickWidth")});const h=Qt(r);h.mult=l;const p={scale:e.scale,field:ji,band:s.band,extra:s.extra,offset:s.offset,round:o("tickRound")};return f.y=u.y=en(a,Xe,p),f.y2=u.y2=en(a,h),c.x=en(a,p),f.x=u.x=gr(a,Xe,p),f.x2=u.x2=gr(a,h),c.y=gr(a,p),xi({type:f7,role:$le,key:ji,from:i,encode:d},n)}function b7(e,t,n,i,r){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+i+","+r+")"}}function Kce(e,t,n,i,r,s){const o=oi(e,t),a=e.orient,l=e.scale,u=Q0(a,-1,1),c=Va(o("labelFlush")),f=Va(o("labelFlushOffset")),d=o("labelAlign"),h=o("labelBaseline");let p=c===0||!!c,g;const m=Qt(r);m.mult=u,m.offset=Qt(o("labelPadding")||0),m.offset.mult=u;const y={scale:l,field:ji,band:.5,offset:_M(s.offset,o("labelOffset"))},b=en(a,p?b7(l,c,'"left"','"right"','"center"'):{value:"center"},Pce(a,"left","right")),v=en(a,OM(a,"bottom","top"),p?b7(l,c,'"top"','"bottom"','"middle"'):{value:"middle"}),_=b7(l,c,`-(${f})`,f,0);p=p&&f;const x={opacity:Xe,x:en(a,y,m),y:gr(a,y,m)},k={enter:x,update:g={opacity:Ui,text:{field:o7},x:x.x,y:x.y,align:b,baseline:v},exit:{opacity:Xe,x:x.x,y:x.y}};fn(k,{dx:!d&&p?en(a,_):null,dy:!h&&p?gr(a,_):null}),fn(k,{angle:o("labelAngle"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontWeight:o("labelFontWeight"),fontStyle:o("labelFontStyle"),limit:o("labelLimit"),lineHeight:o("labelLineHeight")},{align:d,baseline:h});const w=o("labelBound");let E=o("labelOverlap");return E=E||w?{separation:o("labelSeparation"),method:E,order:"datum.index",bound:w?{scale:l,orient:a,tolerance:w}:null}:void 0,g.align!==b&&(g.align=Uu(g.align,b)),g.baseline!==v&&(g.baseline=Uu(g.baseline,v)),xi({type:Xa,role:Ele,style:Ed,key:ji,from:i,encode:k,overlap:E},n)}function Jce(e,t,n,i){const r=oi(e,t),s=e.orient,o=Q0(s,-1,1);let a,l;const u={enter:a={opacity:Xe,anchor:Qt(r("titleAnchor",null)),align:{signal:d7}},update:l=Be({},a,{opacity:Ui,text:Qt(e.title)}),exit:{opacity:Xe}},c={signal:`lerp(range("${e.scale}"), ${X0(0,1,.5)})`};return l.x=en(s,c),l.y=gr(s,c),a.angle=en(s,Xe,Hce(o,90)),a.baseline=en(s,OM(s,Wo,pr),{value:Wo}),l.angle=a.angle,l.baseline=a.baseline,fn(u,{fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),angle:r("titleAngle"),baseline:r("titleBaseline")}),Qce(r,s,u,n),u.update.align=Uu(u.update.align,a.align),u.update.angle=Uu(u.update.angle,a.angle),u.update.baseline=Uu(u.update.baseline,a.baseline),xi({type:Xa,role:Sle,style:a7,from:i,encode:u},n)}function Qce(e,t,n,i){const r=(a,l)=>a!=null?(n.update[l]=Uu(Qt(a),n.update[l]),!1):!Iu(l,i),s=r(e("titleX"),"x"),o=r(e("titleY"),"y");n.enter.auto=o===s?Qt(o):en(t,Qt(o),Qt(s))}function efe(e,t){const n=Gce(e,t),i=e.encode||{},r=i.axis||{},s=r.name||void 0,o=r.interactive,a=r.style,l=oi(e,n),u=Zue(l),c={scale:e.scale,ticks:!!l("ticks"),labels:!!l("labels"),grid:!!l("grid"),domain:!!l("domain"),title:e.title!=null},f=Ce(t.add(hr({},[c]))),d=Ce(t.add(aue({scale:t.scaleRef(e.scale),extra:t.property(u.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)}))),h=[];let p;return c.grid&&h.push(Yce(e,n,i.grid,d,u)),c.ticks&&(p=l("tickSize"),h.push(Zce(e,n,i.ticks,d,p,u))),c.labels&&(p=c.ticks?p:0,h.push(Kce(e,n,i.labels,d,p,u))),c.domain&&h.push(Vce(e,n,i.domain,f)),c.title&&h.push(Jce(e,n,i.title,f)),J0(Sd({role:xle,from:f,encode:Lu(tfe(l,e),r,$d),marks:h,aria:l("aria"),description:l("description"),zindex:l("zindex"),name:s,interactive:o,style:a}),t)}function tfe(e,t){const n={enter:{},update:{}};return fn(n,{orient:e("orient"),offset:e("offset")||0,position:dr(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}function BM(e,t,n){const i=se(e.signals),r=se(e.scales);return n||i.forEach(s=>nM(s,t)),se(e.projections).forEach(s=>zue(s,t)),r.forEach(s=>Cue(s,t)),se(e.data).forEach(s=>Lce(s,t)),r.forEach(s=>Aue(s,t)),(n||i).forEach(s=>oue(s,t)),se(e.axes).forEach(s=>efe(s,t)),se(e.marks).forEach(s=>J0(s,t)),se(e.legends).forEach(s=>Ece(s,t)),e.title&&Mce(e.title,t),t.parseLambdas(),t}const nfe=e=>Lu({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function ife(e,t){const n=t.config,i=Ce(t.root=t.add(U0())),r=rfe(e,n);r.forEach(u=>nM(u,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;const s=t.add(hr()),o=t.add(lM(eM(nfe(e.encode),Y0,Z_,e.style,t,{pulse:Ce(s)}))),a=t.add(fM({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:i,pulse:Ce(o)}));t.operators.pop(),t.pushState(Ce(o),Ce(a),null),BM(e,t,r),t.operators.push(a);let l=t.add(oM({mark:i,pulse:Ce(a)}));return l=t.add(cM({pulse:Ce(l)})),l=t.add(Ya({pulse:Ce(l)})),t.addData("root",new Za(t,s,s,l)),t}function Ad(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function rfe(e,t){const n=o=>dr(e[o],t[o]),i=[Ad("background",n("background")),Ad("autosize",ble(n("autosize"))),Ad("padding",_le(n("padding"))),Ad("width",n("width")||0),Ad("height",n("height")||0)],r=i.reduce((o,a)=>(o[a.name]=a,o),{}),s={};return se(e.signals).forEach(o=>{le(r,o.name)?o=Be(r[o.name],o):i.push(o),s[o.name]=o}),se(t.signals).forEach(o=>{!le(s,o.name)&&!le(r,o.name)&&i.push(o)}),i}function jM(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function UM(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}jM.prototype=UM.prototype={parse(e){return BM(e,this)},fork(){return new UM(this)},isSubscope(){return this._subid>0},toRuntime(){return this.finish(),{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(e){return this.operators.push(e),e.id=this.id(),e.refs&&(e.refs.forEach(t=>{t.$ref=e.id}),e.refs=null),e},proxy(e){const t=e instanceof Q_?Ce(e):e;return this.add(xue({value:t}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;this.root&&(this.root.root=!0);for(e in this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function n(i,r,s){let o,a;i&&(o=i.data||(i.data={}),a=o[r]||(o[r]=[]),a.push(s))}for(e in this.data){t=this.data[e],n(t.input,e,"input"),n(t.output,e,"output"),n(t.values,e,"values");for(const i in t.index)n(t.index[i],e,"index:"+i)}return this},pushState(e,t,n){this._encode.push(Ce(this.add(Ya({pulse:e})))),this._parent.push(t),this._lookup.push(n?Ce(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return Ve(this._parent)},encode(){return Ve(this._encode)},lookup(){return Ve(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(re(e))return wd(e,t);e.signal||q("Unsupported field reference: "+ee(e));const n=e.signal;let i=this.field[n];if(!i){const r={name:this.signalRef(n)};t&&(r.as=t),this.field[n]=i=Ce(this.add(fue(r)))}return i},compareRef(e){let t=!1;const n=s=>Vt(s)?(t=!0,this.signalRef(s.signal)):Zle(s)?(t=!0,this.exprRef(s.expr)):s,i=se(e.field).map(n),r=se(e.order).map(n);return t?Ce(this.add(aM({fields:i,orders:r}))):iM(i,r)},keyRef(e,t){let n=!1;const i=s=>Vt(s)?(n=!0,Ce(r[s.signal])):s,r=this.signals;return e=se(e).map(i),n?Ce(this.add(due({fields:e,flat:t}))):Gle(e,t)},sortRef(e){if(!e)return e;const t=q0(e.op,e.field),n=e.order||Vle;return n.signal?Ce(this.add(aM({fields:t,orders:this.signalRef(n.signal)}))):iM(t,n)},event(e,t){const n=e+":"+t;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:e,type:t}),this.events[n]=i}return this.events[n]},hasOwnSignal(e){return le(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&q("Duplicate signal name: "+ee(e));const n=t instanceof Q_?t:this.add(U0(t));return this.signals[e]=n},getSignal(e){return this.signals[e]||q("Unrecognized signal name: "+ee(e)),this.signals[e]},signalRef(e){return this.signals[e]?Ce(this.signals[e]):(le(this.lambdas,e)||(this.lambdas[e]=this.add(U0(null))),Ce(this.lambdas[e]))},parseLambdas(){const e=Object.keys(this.lambdas);for(let t=0,n=e.length;t0?",":"")+(ie(r)?r.signal||v7(r):ee(r))}return n+"]"}function ofe(e){let t="{",n=0,i,r;for(i in e)r=e[i],t+=(++n>1?",":"")+ee(i)+":"+(ie(r)?r.signal||v7(r):ee(r));return t+"}"}function afe(){const e="sans-serif",i="#4c78a8",r="#000",s="#888",o="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:i},area:{fill:i},image:null,line:{stroke:i,strokeWidth:2},path:{stroke:i},rect:{fill:i},rule:{stroke:r},shape:{stroke:i},symbol:{fill:i,size:64},text:{fill:r,font:e,fontSize:11},trail:{fill:i,size:2},style:{"guide-label":{fill:r,font:e,fontSize:10},"guide-title":{fill:r,font:e,fontSize:11,fontWeight:"bold"},"group-title":{fill:r,font:e,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:r,font:e,fontSize:12},point:{size:30,strokeWidth:2,shape:"circle"},circle:{size:30,strokeWidth:2},square:{size:30,strokeWidth:2,shape:"square"},cell:{fill:"transparent",stroke:o},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:!0,domainWidth:1,domainColor:s,grid:!1,gridWidth:1,gridColor:o,labels:!0,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:!0,tickColor:s,tickOffset:0,tickRound:!0,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:o,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:!0,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:s,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function lfe(e,t,n){return ie(e)||q("Input Vega specification must be an object."),t=zl(afe(),t,e.config),ife(e,new jM(t,n)).toRuntime()}var ufe="6.2.0";Be(iu,cV,jJ,dQ,Kee,Hte,bie,Kne,_ie,Wie,ere,are);const cfe=Object.freeze(Object.defineProperty({__proto__:null,Bounds:zt,CanvasHandler:Ff,CanvasRenderer:fg,DATE:ei,DAY:kn,DAYOFYEAR:Or,Dataflow:nu,Debug:Q6,DisallowedObjectProperties:Wm,Error:Hm,EventStream:Jh,Gradient:r$,GroupItem:jp,HOURS:pi,Handler:s3,HybridHandler:bS,HybridRenderer:y3,Info:J6,Item:Bp,MILLISECONDS:tr,MINUTES:gi,MONTH:wn,Marks:yi,MultiPulse:B2,None:K6,Operator:yt,Parameters:Kh,Pulse:yo,QUARTER:Qn,RenderType:Ro,Renderer:Cf,ResourceLoader:p$,SECONDS:Di,SVGHandler:Q$,SVGRenderer:m3,SVGStringRenderer:yS,Scenegraph:j$,TIME_UNITS:y2,Transform:j,View:zT,WEEK:qt,Warn:Gm,YEAR:an,accessor:Kn,accessorFields:bn,accessorName:Tt,array:se,ascending:jl,bandwidthNRD:W2,bin:f8,bootstrapCI:d8,boundClip:AS,boundContext:_f,boundItem:i3,boundMark:I$,boundStroke:Cs,changeset:po,clampRange:fk,codegenExpression:XF,compare:Zm,constant:xn,cumulativeLogNormal:Z2,cumulativeNormal:np,cumulativeUniform:ey,dayofyear:Kk,debounce:Km,defaultLocale:N2,definition:l8,densityLogNormal:X2,densityNormal:H2,densityUniform:Q2,domChild:Ht,domClear:Li,domCreate:Do,domFind:r3,dotbin:h8,error:q,expressionFunction:Ot,extend:Be,extent:Dr,extentIndex:dk,falsy:oo,fastmap:Ul,field:Fi,flush:hk,font:eg,fontFamily:$f,fontSize:Hr,format:Wh,formatLocale:Uh,formats:I2,hasOwnProperty:le,id:Mc,identity:vn,inferType:W4,inferTypes:H4,ingest:tt,inherits:te,inrange:ql,interpolate:Eb,interpolateColors:Op,interpolateRange:jE,intersect:ES,intersectBoxLine:yu,intersectPath:Ub,intersectPoint:qb,intersectRule:w$,isArray:G,isBoolean:ao,isDate:lo,isFunction:ze,isIterable:pk,isNumber:Ke,isObject:ie,isRegExp:Jm,isString:re,isTuple:Yh,key:Qm,lerp:gk,lineHeight:To,loader:Hh,locale:j4,logger:Eh,lruCache:mk,markup:g3,merge:yk,mergeConfig:zl,multiLineOffset:e3,one:Pl,pad:bk,panLinear:sk,panLog:ok,panPow:ak,panSymlog:lk,parse:lfe,parseExpression:A_,parseSelector:qo,path:up,pathCurves:Tb,pathEqual:FS,pathParse:pu,pathRectangle:f$,pathRender:gf,pathSymbols:c$,pathTrail:d$,peek:Ve,point:ng,projection:pv,quantileLogNormal:K2,quantileNormal:ip,quantileUniform:ty,quantiles:U2,quantizeInterpolator:UE,quarter:uk,quartiles:q2,get random(){return Ni},randomInteger:pG,randomKDE:V2,randomLCG:hG,randomLogNormal:g8,randomMixture:m8,randomNormal:G2,randomUniform:y8,read:X4,regressionConstant:ny,regressionExp:v8,regressionLinear:iy,regressionLoess:E8,regressionLog:b8,regressionPoly:x8,regressionPow:_8,regressionQuad:ry,renderModule:gg,repeat:Dc,resetDefaultLocale:fH,resetSVGDefIds:sJ,responseType:Y4,runtimeContext:vT,sampleCurve:sp,sampleLogNormal:Y2,sampleNormal:tp,sampleUniform:J2,scale:Qe,sceneEqual:v3,sceneFromJSON:z$,scenePickVisit:Yp,sceneToJSON:P$,sceneVisit:sr,sceneZOrder:Wb,scheme:$b,serializeXML:cS,setHybridRendererOptions:tJ,setRandom:fG,span:Nc,splitAccessPath:Mr,stringValue:ee,textMetrics:mi,timeBin:m4,timeFloor:r4,timeFormatLocale:Xc,timeInterval:Jl,timeOffset:a4,timeSequence:c4,timeUnitSpecifier:Zk,timeUnits:v2,toBoolean:e2,toDate:t2,toNumber:_n,toSet:er,toString:n2,transform:u8,transforms:iu,truncate:vk,truthy:Ti,tupleid:$e,typeParsers:R2,utcFloor:s4,utcInterval:Ql,utcOffset:l4,utcSequence:f4,utcdayofyear:e4,utcquarter:ck,utcweek:t4,version:ufe,visitArray:uo,week:Jk,writeConfig:Bl,zero:so,zoomLinear:Vm,zoomLog:Ym,zoomPow:Ah,zoomSymlog:Xm},Symbol.toStringTag,{value:"Module"}));function ffe(e,t,n){let i;t.x2&&(t.x?(n&&e.x>e.x2&&(i=e.x,e.x=e.x2,e.x2=i),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(i=e.y,e.y=e.y2,e.y2=i),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}var dfe={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},hfe={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>ee<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},pfe={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const gfe=Array.prototype.slice,Ja=(e,t,n)=>{const i=n?n(t[0]):t[0];return i[e].apply(i,gfe.call(t,1))},mfe=(e,t=0,n=1,i=0,r=0,s=0,o=0)=>re(e)?new Date(e):new Date(e,t,n,i,r,s,o);var yfe={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:mfe,date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return Ja("join",arguments)},indexof:function(){return Ja("indexOf",arguments)},lastindexof:function(){return Ja("lastIndexOf",arguments)},slice:function(){return Ja("slice",arguments)},reverse:e=>e.slice().reverse(),sort:e=>e.slice().sort(jl),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return Ja("substring",arguments,String)},split:function(){return Ja("split",arguments,String)},replace:function(){return Ja("replace",arguments,String)},trim:e=>String(e).trim(),btoa:e=>btoa(e),atob:e=>atob(e),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const bfe=["view","item","group","xy","x","y"],_7=new Set([Function,eval,setTimeout,setInterval]);typeof setImmediate=="function"&&_7.add(setImmediate);const vfe={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const n=t.name;return e.memberDepth>0?n:n==="datum"?e.datum:n==="event"?e.event:n==="item"?e.item:dfe[n]||e.params["$"+n]},MemberExpression:(e,t)=>{const n=!t.computed,i=e(t.object);n&&(e.memberDepth+=1);const r=e(t.property);if(n&&(e.memberDepth-=1),_7.has(i[r])){console.error(`Prevented interpretation of member "${r}" which could lead to insecure code execution`);return}return i[r]},CallExpression:(e,t)=>{const n=t.arguments;let i=t.callee.name;return i.startsWith("_")&&(i=i.slice(1)),i==="if"?e(n[0])?e(n[1]):e(n[2]):(e.fn[i]||yfe[i]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>hfe[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>pfe[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>t.operator==="&&"?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce((n,i)=>{e.memberDepth+=1;const r=e(i.key);e.memberDepth-=1;const s=e(i.value);return Wm.has(r)?console.error(`Prevented interpretation of property "${r}" which could lead to insecure code execution`):_7.has(s)?console.error(`Prevented interpretation of method "${r}" which could lead to insecure code execution`):n[r]=s,n},{})};function Fd(e,t,n,i,r,s){const o=a=>vfe[a.type](o,a);return o.memberDepth=0,o.fn=Object.create(t),o.params=n,o.datum=i,o.event=r,o.item=s,bfe.forEach(a=>o.fn[a]=(...l)=>r.vega[a](...l)),o(e)}var _fe={operator(e,t){const n=t.ast,i=e.functions;return r=>Fd(n,i,r)},parameter(e,t){const n=t.ast,i=e.functions;return(r,s)=>Fd(n,i,s,r)},event(e,t){const n=t.ast,i=e.functions;return r=>Fd(n,i,void 0,void 0,r)},handler(e,t){const n=t.ast,i=e.functions;return(r,s)=>{const o=s.item&&s.item.datum;return Fd(n,i,r,o,s)}},encode(e,t){const{marktype:n,channels:i}=t,r=e.functions,s=n==="group"||n==="image"||n==="rect";return(o,a)=>{const l=o.datum;let u=0,c;for(const f in i)c=Fd(i[f].ast,r,a,l,void 0,o),o[f]!==c&&(o[f]=c,u=1);return n!=="rule"&&ffe(o,i,s),u}}},xfe="6.4.1",wfe={version:xfe};function x7(e){return Z(e,"or")}function w7(e){return Z(e,"and")}function k7(e){return Z(e,"not")}function e1(e,t){if(k7(e))e1(e.not,t);else if(w7(e))for(const n of e.and)e1(n,t);else if(x7(e))for(const n of e.or)e1(n,t);else t(e)}function Wu(e,t){return k7(e)?{not:Wu(e.not,t)}:w7(e)?{and:e.and.map(n=>Wu(n,t))}:x7(e)?{or:e.or.map(n=>Wu(n,t))}:t(e)}const Ne=structuredClone;function qM(e){throw new Error(e)}function Hu(e,t){const n={};for(const i of t)le(e,i)&&(n[i]=e[i]);return n}function wi(e,t){const n={...e};for(const i of t)delete n[i];return n}Set.prototype.toJSON=function(){return`Set(${[...this].map(e=>st(e)).join(",")})`};function Ge(e){if(Ke(e))return e;const t=re(e)?e:st(e);if(t.length<250)return t;let n=0;for(let i=0;ia===0?o:`[${o}]`),s=r.map((o,a)=>r.slice(0,a+1).join(""));for(const o of s)t.add(o)}return t}function A7(e,t){return e===void 0||t===void 0?!0:S7(C7(e),C7(t))}function bt(e){return X(e).length===0}const X=Object.keys,Bt=Object.values,Ho=Object.entries;function Td(e){return e===!0||e===!1}function Et(e){const t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function Md(e,t){return k7(e)?`!(${Md(e.not,t)})`:w7(e)?`(${e.and.map(n=>Md(n,t)).join(") && (")})`:x7(e)?`(${e.or.map(n=>Md(n,t)).join(") || (")})`:t(e)}function t1(e,t){if(t.length===0)return!0;const n=t.shift();return n in e&&t1(e[n],t)&&delete e[n],bt(e)}function Dd(e){return e.charAt(0).toUpperCase()+e.substr(1)}function F7(e,t="datum"){const n=Mr(e),i=[];for(let r=1;r<=n.length;r++){const s=`[${n.slice(0,r).map(ee).join("][")}]`;i.push(`${t}${s}`)}return i.join(" && ")}function GM(e,t="datum"){return`${t}[${ee(Mr(e).join("."))}]`}function ut(e){return`datum['${e.replaceAll("'","\\'")}']`}function VM(e){return e.replaceAll("\\'","'").replaceAll("\\.",".")}function $fe(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function qi(e){return`${Mr(e).map($fe).join("\\.")}`}function Qa(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function Vu(e){return`${Mr(e).join(".")}`}function Yu(e){return e?Mr(e).length:0}function Lt(...e){return e.find(t=>t!==void 0)}let YM=42;function XM(e){const t=++YM;return e?String(e)+t:t}function Sfe(){YM=42}function ZM(e){return KM(e)?e:`__${e}`}function KM(e){return e.startsWith("__")}function Nd(e){if(e!==void 0)return(e%360+360)%360}function n1(e){return Ke(e)?!0:!isNaN(e)&&!isNaN(parseFloat(e))}const JM=Object.getPrototypeOf(structuredClone({}));function ki(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor.name!==t.constructor.name)return!1;let n,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!ki(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const s of e.entries())if(!t.has(s[0]))return!1;for(const s of e.entries())if(!ki(s[1],t.get(s[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e.entries())if(!t.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(e[i]!==t[i])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf!==JM.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString!==JM.toString)return e.toString()===t.toString();const r=Object.keys(e);if(n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const s=r[i];if(!ki(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function st(e){const t=[];return function n(i){if(i!=null&&i.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i===void 0)return;if(typeof i=="number")return isFinite(i)?`${i}`:"null";if(typeof i!="object")return JSON.stringify(i);let r,s;if(Array.isArray(i)){for(s="[",r=0;rc1(e[t])?Et(`_${t}_${Ho(e[t])}`):Et(`_${t}_${e[t]}`)).join("")}`}function vt(e){return e===!0||il(e)&&!e.binned}function dn(e){return e==="binned"||il(e)&&e.binned===!0}function il(e){return ie(e)}function c1(e){return Z(e,"param")}function dD(e){switch(e){case Ps:case zs:case Us:case ai:case ns:case is:case Zo:case qs:case Yo:case Xo:case li:return 6;case Ko:return 4;default:return 10}}function Id(e){return Z(e,"expr")}function hn(e,{level:t}={level:0}){const n=X(e||{}),i={};for(const r of n)i[r]=t===0?Ei(e[r]):hn(e[r],{level:t-1});return i}function hD(e){const{anchor:t,frame:n,offset:i,orient:r,angle:s,limit:o,color:a,subtitleColor:l,subtitleFont:u,subtitleFontSize:c,subtitleFontStyle:f,subtitleFontWeight:d,subtitleLineHeight:h,subtitlePadding:p,...g}=e,m={...g,...a?{fill:a}:{}},y={...t?{anchor:t}:{},...n?{frame:n}:{},...i?{offset:i}:{},...r?{orient:r}:{},...s!==void 0?{angle:s}:{},...o!==void 0?{limit:o}:{}},b={...l?{subtitleColor:l}:{},...u?{subtitleFont:u}:{},...c?{subtitleFontSize:c}:{},...f?{subtitleFontStyle:f}:{},...d?{subtitleFontWeight:d}:{},...h?{subtitleLineHeight:h}:{},...p?{subtitlePadding:p}:{}},v=Hu(e,["align","baseline","dx","dy","limit"]);return{titleMarkConfig:m,subtitleMarkConfig:v,nonMarkTitleProperties:y,subtitle:b}}function ea(e){return re(e)||G(e)&&re(e[0])}function ye(e){return Z(e,"signal")}function rl(e){return Z(e,"step")}function Kfe(e){return G(e)?!1:Z(e,"fields")&&!Z(e,"data")}function Jfe(e){return G(e)?!1:Z(e,"fields")&&Z(e,"data")}function Gs(e){return G(e)?!1:Z(e,"field")&&Z(e,"data")}const Qfe=X({aria:1,description:1,ariaRole:1,ariaRoleDescription:1,blend:1,opacity:1,fill:1,fillOpacity:1,stroke:1,strokeCap:1,strokeWidth:1,strokeOpacity:1,strokeDash:1,strokeDashOffset:1,strokeJoin:1,strokeOffset:1,strokeMiterLimit:1,startAngle:1,endAngle:1,padAngle:1,innerRadius:1,outerRadius:1,size:1,shape:1,interpolate:1,tension:1,orient:1,align:1,baseline:1,text:1,dir:1,dx:1,dy:1,ellipsis:1,limit:1,radius:1,theta:1,angle:1,font:1,fontSize:1,fontWeight:1,fontStyle:1,lineBreak:1,lineHeight:1,cursor:1,href:1,tooltip:1,cornerRadius:1,cornerRadiusTopLeft:1,cornerRadiusTopRight:1,cornerRadiusBottomLeft:1,cornerRadiusBottomRight:1,aspect:1,width:1,height:1,url:1,smooth:1}),ede={arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1},j7=["cornerRadius","cornerRadiusTopLeft","cornerRadiusTopRight","cornerRadiusBottomLeft","cornerRadiusBottomRight"],tde=" – ";function pD(e){const t=G(e.condition)?e.condition.map(gD):gD(e.condition);return{...Ei(e),condition:t}}function Ei(e){if(Id(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function gD(e){if(Id(e)){const{expr:t,...n}=e;return{signal:t,...n}}return e}function xt(e){if(Id(e)){const{expr:t,...n}=e;return{signal:t,...n}}return ye(e)?e:e!==void 0?{value:e}:void 0}function nde(e){return ye(e)?e.signal:ee(e)}function mD(e){return ye(e)?e.signal:ee(e.value)}function xr(e){return ye(e)?e.signal:e==null?null:ee(e)}function ide(e,t,n){for(const i of n){const r=os(i,t.markDef,t.config);r!==void 0&&(e[i]=xt(r))}return e}function yD(e){return[].concat(e.type,e.style??[])}function ot(e,t,n,i={}){const{vgChannel:r,ignoreVgConfig:s}=i;return r&&Z(t,r)?t[r]:t[e]!==void 0?t[e]:s&&(!r||r===e)?void 0:os(e,t,n,i)}function os(e,t,n,{vgChannel:i}={}){const r=U7(e,t,n.style);return Lt(i?r:void 0,r,i?n[t.type][i]:void 0,n[t.type][e],i?n.mark[i]:n.mark[e])}function U7(e,t,n){return bD(e,yD(t),n)}function bD(e,t,n){t=se(t);let i;for(const r of t){const s=n[r];Z(s,e)&&(i=s[e])}return i}function vD(e,t){return se(e).reduce((n,i)=>(n.field.push(ne(i,t)),n.order.push(i.sort??"ascending"),n),{field:[],order:[]})}function _D(e,t){const n=[...e];return t.forEach(i=>{for(const r of n)if(ki(r,i))return;n.push(i)}),n}function xD(e,t){return ki(e,t)||!t?e:e?[...se(e),...se(t)].join(", "):t}function wD(e,t){const n=e.value,i=t.value;if(n==null||i===null)return{explicit:e.explicit,value:null};if((ea(n)||ye(n))&&(ea(i)||ye(i)))return{explicit:e.explicit,value:xD(n,i)};if(ea(n)||ye(n))return{explicit:e.explicit,value:n};if(ea(i)||ye(i))return{explicit:e.explicit,value:i};if(!ea(n)&&!ye(n)&&!ea(i)&&!ye(i))return{explicit:e.explicit,value:_D(n,i)};throw new Error("It should never reach here")}function q7(e){return`Invalid specification ${st(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const rde='Autosize "fit" only works for single views and layered views.';function kD(e){return`${e=="width"?"Width":"Height"} "container" only works for single views and layered views.`}function ED(e){const t=e=="width"?"Width":"Height",n=e=="width"?"x":"y";return`${t} "container" only works well with autosize "fit" or "fit-${n}".`}function $D(e){return e?`Dropping "fit-${e}" because spec has discrete ${ui(e)}.`:'Dropping "fit" because spec has discrete size.'}function W7(e){return`Unknown field for ${e}. Cannot calculate view size.`}function SD(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function sde(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function ode(e){return`The "nearest" transform is not supported for ${e} marks.`}function CD(e){return`Selection not supported for ${e} yet.`}function ade(e){return`Cannot find a selection named "${e}".`}const lde="Scale bindings are currently only supported for scales with unbinned, continuous domains.",ude="Sequntial scales are deprecated. The available quantitative scale type values are linear, log, pow, sqrt, symlog, time and utc",cde="Legend bindings are only supported for selections over an individual field or encoding channel.";function fde(e){return`Lookups can only be performed on selection parameters. "${e}" is a variable parameter.`}function dde(e){return`Cannot define and lookup the "${e}" selection in the same view. Try moving the lookup into a second, layered view?`}const hde="The same selection must be used to override scale domains in a layered view.",pde='Interval selections should be initialized using "x", "y", "longitude", or "latitude" keys.';function gde(e){return`Unknown repeated value "${e}".`}function AD(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const mde="Multiple timer selections in one unit spec are not supported. Ignoring all but the first.",H7="Animation involving facet, layer, or concat is currently unsupported.";function yde(e){return`A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${ee(e)}.`}function bde(e,t,n,i){return`${e.length?"Multiple ":"No "}matching ${ee(t)} encoding found for selection ${ee(n.param)}. Using "field": ${ee(i)}.`}const vde="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function _de(e){return`Unrecognized parse "${e}".`}function FD(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const xde="Attempt to add the same child twice.";function wde(e){return`Ignoring an invalid transform: ${st(e)}.`}const kde='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function TD(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function Ede(e){const{parentProjection:t,projection:n}=e;return`Layer's shared projection ${st(t)} is overridden by a child projection ${st(n)}.`}const $de="Arc marks uses theta channel rather than angle, replacing angle with theta.";function Sde(e){return`${e}Offset dropped because ${e} is continuous`}function Cde(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${st(n)}}.`}function MD(e){return`Invalid field type "${e}".`}function Ade(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function Fde(e){return`Invalid aggregation operator "${e}".`}function DD(e,t){const{fill:n,stroke:i}=t;return`Dropping color ${e} as the plot also has ${n&&i?"fill and stroke":n?"fill":"stroke"}.`}function Tde(e){return`Position range does not support relative band size for ${e}.`}function G7(e,t){return`Dropping ${st(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}const Mde="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function f1(e,t,n){return`${e} dropped as it is incompatible with "${t}".`}function Dde(e){return`${e}-encoding is dropped as ${e} is not a valid encoding channel.`}function Nde(e){return`${e} encoding should be discrete (ordinal / nominal / binned).`}function Rde(e){return`${e} encoding should be discrete (ordinal / nominal / binned) or use a discretizing scale (e.g. threshold).`}function Ode(e){return`Facet encoding dropped as ${e.join(" and ")} ${e.length>1?"are":"is"} also specified.`}function V7(e,t){return`Using discrete channel "${e}" to encode "${t}" field can be misleading as it does not encode ${t==="ordinal"?"order":"magnitude"}.`}function Lde(e){return`The ${e} for range marks cannot be an expression`}function Ide(e,t){return`Line mark is for continuous lines and thus cannot be used with ${e&&t?"x2 and y2":e?"x2":"y2"}. We will use the rule mark (line segments) instead.`}function Pde(e,t){return`Specified orient "${e}" overridden with "${t}".`}function zde(e){return`Cannot use the scale property "${e}" with non-color channel.`}function Bde(e){return`Cannot use the relative band size with ${e} scale.`}function jde(e){return`Using unaggregated domain with raw field has no effect (${st(e)}).`}function Ude(e){return`Unaggregated domain not applicable for "${e}" since it produces values outside the origin domain of the source data.`}function qde(e){return`Unaggregated domain is currently unsupported for log scale (${st(e)}).`}function Wde(e){return`Cannot apply size to non-oriented mark "${e}".`}function Hde(e,t,n){return`Channel "${e}" does not work with "${t}" scale. We are using "${n}" scale instead.`}function Gde(e,t){return`FieldDef does not work with "${e}" scale. We are using "${t}" scale instead.`}function ND(e,t,n){return`${n}-scale's "${t}" is dropped as it does not work with ${e} scale.`}function RD(e){return`The step for "${e}" is dropped because the ${e==="width"?"x":"y"} is continuous.`}function Vde(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${st(n)} and ${st(i)}). Using ${st(n)}.`}function Yde(e,t,n,i){return`Conflicting ${t.toString()} property "${e.toString()}" (${st(n)} and ${st(i)}). Using the union of the two domains.`}function Xde(e){return`Setting the scale to be independent for "${e}" means we also have to set the guide (axis or legend) to be independent.`}function Zde(e){return`Dropping sort property ${st(e)} as unioned domains only support boolean or op "count", "min", and "max".`}const OD="Domains that should be unioned has conflicting sort properties. Sort will be set to true.",Kde="Detected faceted independent scales that union domain of multiple fields from different data sources. We will use the first field. The result view size may be incorrect.",Jde="Detected faceted independent scales that union domain of the same fields from different source. We will assume that this is the same field from a different fork of the same data source. However, if this is not the case, the result view size may be incorrect.",Qde="Detected faceted independent scales that union domain of multiple fields from the same data source. We will use the first field. The result view size may be incorrect.";function ehe(e){return`Cannot stack "${e}" if there is already "${e}2".`}function the(e){return`Stack is applied to a non-linear scale (${e}).`}function nhe(e){return`Stacking is applied even though the aggregate function is non-summative ("${e}").`}function d1(e,t){return`Invalid ${e}: ${st(t)}.`}function ihe(e){return`Dropping day from datetime ${st(e)} as day cannot be combined with other units.`}function rhe(e,t){return`${t?"extent ":""}${t&&e?"and ":""}${e?"center ":""}${t&&e?"are ":"is "}not needed when data are aggregated.`}function she(e,t,n){return`${e} is not usually used with ${t} for ${n}.`}function ohe(e,t){return`Continuous axis should not have customized aggregation function ${e}; ${t} already agregates the axis.`}function LD(e){return`1D error band does not support ${e}.`}function ID(e){return`Channel ${e} is required for "binned" bin.`}function ahe(e){return`Channel ${e} should not be used with "binned" bin.`}function lhe(e){return`Domain for ${e} is required for threshold scale.`}const PD=Eh(Gm);let sl=PD;function uhe(e){return sl=e,sl}function che(){return sl=PD,sl}function Y7(...e){sl.error(...e)}function K(...e){sl.warn(...e)}function fhe(...e){sl.debug(...e)}function ol(e){if(e&&ie(e)){for(const t of Z7)if(Z(e,t))return!0}return!1}const zD=["january","february","march","april","may","june","july","august","september","october","november","december"],dhe=zD.map(e=>e.substr(0,3)),BD=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],hhe=BD.map(e=>e.substr(0,3));function phe(e){if(n1(e)&&(e=+e),Ke(e))return e>4&&K(d1("quarter",e)),e-1;throw new Error(d1("quarter",e))}function ghe(e){if(n1(e)&&(e=+e),Ke(e))return e-1;{const t=e.toLowerCase(),n=zD.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=dhe.indexOf(i);if(r!==-1)return r;throw new Error(d1("month",e))}}function mhe(e){if(n1(e)&&(e=+e),Ke(e))return e%7;{const t=e.toLowerCase(),n=BD.indexOf(t);if(n!==-1)return n;const i=t.substr(0,3),r=hhe.indexOf(i);if(r!==-1)return r;throw new Error(d1("day",e))}}function X7(e,t){const n=[];if(t&&e.day!==void 0&&X(e).length>1&&(K(ihe(e)),e=Ne(e),delete e.day),e.year!==void 0?n.push(e.year):n.push(2012),e.month!==void 0){const i=t?ghe(e.month):e.month;n.push(i)}else if(e.quarter!==void 0){const i=t?phe(e.quarter):e.quarter;n.push(Ke(i)?i*3:`${i}*3`)}else n.push(0);if(e.date!==void 0)n.push(e.date);else if(e.day!==void 0){const i=t?mhe(e.day):e.day;n.push(Ke(i)?i+1:`${i}+1`)}else n.push(1);for(const i of["hours","minutes","seconds","milliseconds"]){const r=e[i];n.push(typeof r>"u"?0:r)}return n}function al(e){const n=X7(e,!0).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function yhe(e){const n=X7(e,!1).join(", ");return e.utc?`utc(${n})`:`datetime(${n})`}function bhe(e){const t=X7(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)}const jD={year:1,quarter:1,month:1,week:1,day:1,dayofyear:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1},Z7=X(jD);function vhe(e){return le(jD,e)}function ll(e){return ie(e)?e.binned:UD(e)}function UD(e){return e==null?void 0:e.startsWith("binned")}function K7(e){return e.startsWith("utc")}function _he(e){return e.substring(3)}const xhe={"year-month":"%b %Y ","year-month-date":"%b %d, %Y "};function h1(e){return Z7.filter(t=>WD(e,t))}function qD(e){const t=h1(e);return t[t.length-1]}function WD(e,t){const n=e.indexOf(t);return!(n<0||n>0&&t==="seconds"&&e.charAt(n-1)==="i"||e.length>n+3&&t==="day"&&e.charAt(n+3)==="o"||n>0&&t==="year"&&e.charAt(n-1)==="f")}function whe(e,t,{end:n}={end:!1}){const i=F7(t),r=K7(e)?"utc":"";function s(l){return l==="quarter"?`(${r}quarter(${i})-1)`:`${r}${l}(${i})`}let o;const a={};for(const l of Z7)WD(e,l)&&(a[l]=s(l),o=l);return n&&(a[o]+="+1"),yhe(a)}function HD(e){if(!e)return;const t=h1(e);return`timeUnitSpecifier(${st(t)}, ${st(xhe)})`}function khe(e,t,n){if(!e)return;const i=HD(e);return`${n||K7(e)?"utc":"time"}Format(${t}, ${i})`}function nn(e){if(!e)return;let t;return re(e)?UD(e)?t={unit:e.substring(6),binned:!0}:t={unit:e}:ie(e)&&(t={...e,...e.unit?{unit:e.unit}:{}}),K7(t.unit)&&(t.utc=!0,t.unit=_he(t.unit)),t}function Ehe(e){const{utc:t,...n}=nn(e);return n.unit?(t?"utc":"")+X(n).map(i=>Et(`${i==="unit"?"":`_${i}_`}${n[i]}`)).join(""):`${t?"utc":""}timeunit${X(n).map(i=>Et(`_${i}_${n[i]}`)).join("")}`}function GD(e,t=n=>n){const n=nn(e),i=qD(n.unit);if(i&&i!=="day"){const r={year:2001,month:1,date:1,hours:0,minutes:0,seconds:0,milliseconds:0},{step:s,part:o}=VD(i,n.step),a={...r,[o]:+r[o]+s};return`${t(al(a))} - ${t(al(r))}`}}const $he={year:1,month:1,date:1,hours:1,minutes:1,seconds:1,milliseconds:1};function She(e){return le($he,e)}function VD(e,t=1){if(She(e))return{part:e,step:t};switch(e){case"day":case"dayofyear":return{part:"date",step:t};case"quarter":return{part:"month",step:t*3};case"week":return{part:"date",step:t*7}}}function Che(e){return Z(e,"param")}function J7(e){return!!(e!=null&&e.field)&&e.equal!==void 0}function Q7(e){return!!(e!=null&&e.field)&&e.lt!==void 0}function ex(e){return!!(e!=null&&e.field)&&e.lte!==void 0}function tx(e){return!!(e!=null&&e.field)&&e.gt!==void 0}function nx(e){return!!(e!=null&&e.field)&&e.gte!==void 0}function ix(e){if(e!=null&&e.field){if(G(e.range)&&e.range.length===2)return!0;if(ye(e.range))return!0}return!1}function rx(e){return!!(e!=null&&e.field)&&(G(e.oneOf)||G(e.in))}function Ahe(e){return!!(e!=null&&e.field)&&e.valid!==void 0}function YD(e){return rx(e)||J7(e)||ix(e)||Q7(e)||tx(e)||ex(e)||nx(e)}function as(e,t){return F1(e,{timeUnit:t,wrapTime:!0})}function Fhe(e,t){return e.map(n=>as(n,t))}function XD(e,t=!0){const{field:n}=e,i=nn(e.timeUnit),{unit:r,binned:s}=i||{},o=ne(e,{expr:"datum"}),a=r?`time(${s?o:whe(r,n)})`:o;if(J7(e))return`${a}===${as(e.equal,r)}`;if(Q7(e)){const l=e.lt;return`${a}<${as(l,r)}`}else if(tx(e)){const l=e.gt;return`${a}>${as(l,r)}`}else if(ex(e)){const l=e.lte;return`${a}<=${as(l,r)}`}else if(nx(e)){const l=e.gte;return`${a}>=${as(l,r)}`}else{if(rx(e))return`indexof([${Fhe(e.oneOf,r).join(",")}], ${a}) !== -1`;if(Ahe(e))return p1(a,e.valid);if(ix(e)){const{range:l}=hn(e),u=ye(l)?{signal:`${l.signal}[0]`}:l[0],c=ye(l)?{signal:`${l.signal}[1]`}:l[1];if(u!==null&&c!==null&&t)return`inrange(${a}, [${as(u,r)}, ${as(c,r)}])`;const f=[];return u!==null&&f.push(`${a} >= ${as(u,r)}`),c!==null&&f.push(`${a} <= ${as(c,r)}`),f.length>0?f.join(" && "):"true"}}throw new Error(`Invalid field predicate: ${st(e)}`)}function p1(e,t=!0){return t?`isValid(${e}) && isFinite(+${e})`:`!isValid(${e}) || !isFinite(+${e})`}function The(e){return YD(e)&&e.timeUnit?{...e,timeUnit:nn(e.timeUnit)}:e}const Pd={quantitative:"quantitative",ordinal:"ordinal",temporal:"temporal",nominal:"nominal",geojson:"geojson"};function Mhe(e){return e==="quantitative"||e==="temporal"}function sx(e){return e==="ordinal"||e==="nominal"}const ul=Pd.quantitative,ox=Pd.ordinal,Ju=Pd.temporal,ax=Pd.nominal,Qu=Pd.geojson;function Dhe(e){if(e)switch(e=e.toLowerCase(),e){case"q":case ul:return"quantitative";case"t":case Ju:return"temporal";case"o":case ox:return"ordinal";case"n":case ax:return"nominal";case Qu:return"geojson"}}const pn={LINEAR:"linear",LOG:"log",POW:"pow",SQRT:"sqrt",TIME:"time",UTC:"utc",POINT:"point",BAND:"band"},lx={linear:"numeric",log:"numeric",pow:"numeric",sqrt:"numeric",symlog:"numeric",identity:"numeric",sequential:"numeric",time:"time",utc:"time",ordinal:"ordinal","bin-ordinal":"bin-ordinal",point:"ordinal-position",band:"ordinal-position",quantile:"discretizing",quantize:"discretizing",threshold:"discretizing"};function Nhe(e,t){const n=lx[e],i=lx[t];return n===i||n==="ordinal-position"&&i==="time"||i==="ordinal-position"&&n==="time"}const Rhe={linear:0,log:1,pow:1,sqrt:1,symlog:1,identity:1,sequential:1,time:0,utc:0,point:10,band:11,ordinal:0,"bin-ordinal":0,quantile:0,quantize:0,threshold:0};function ZD(e){return Rhe[e]}const KD=new Set(["linear","log","pow","sqrt","symlog"]),JD=new Set([...KD,"time","utc"]);function QD(e){return KD.has(e)}const eN=new Set(["quantile","quantize","threshold"]),Ohe=new Set([...JD,...eN,"sequential","identity"]),Lhe=new Set(["ordinal","bin-ordinal","point","band"]);function rn(e){return Lhe.has(e)}function wr(e){return Ohe.has(e)}function ls(e){return JD.has(e)}function ec(e){return eN.has(e)}const Ihe={pointPadding:.5,barBandPaddingInner:.1,rectBandPaddingInner:0,tickBandPaddingInner:.25,bandWithNestedOffsetPaddingInner:.2,bandWithNestedOffsetPaddingOuter:.2,minBandSize:2,minFontSize:8,maxFontSize:40,minOpacity:.3,maxOpacity:.8,minSize:4,minStrokeWidth:1,maxStrokeWidth:4,quantileCount:4,quantizeCount:4,zero:!0,framesPerSecond:2,animationDuration:5};function Phe(e){return!re(e)&&Z(e,"name")}function tN(e){return Z(e,"param")}function zhe(e){return Z(e,"unionWith")}function Bhe(e){return ie(e)&&"field"in e}const jhe={type:1,domain:1,domainMax:1,domainMin:1,domainMid:1,domainRaw:1,align:1,range:1,rangeMax:1,rangeMin:1,scheme:1,bins:1,reverse:1,round:1,clamp:1,nice:1,base:1,exponent:1,constant:1,interpolate:1,zero:1,padding:1,paddingInner:1,paddingOuter:1},{type:J_e,domain:Q_e,range:e7e,rangeMax:t7e,rangeMin:n7e,scheme:i7e,...Uhe}=jhe,qhe=X(Uhe);function ux(e,t){switch(t){case"type":case"domain":case"reverse":case"range":return!0;case"scheme":case"interpolate":return!["point","band","identity"].includes(e);case"bins":return!["point","band","identity","ordinal"].includes(e);case"round":return ls(e)||e==="band"||e==="point";case"padding":case"rangeMin":case"rangeMax":return ls(e)||["point","band"].includes(e);case"paddingOuter":case"align":return["point","band"].includes(e);case"paddingInner":return e==="band";case"domainMax":case"domainMid":case"domainMin":case"domainRaw":case"clamp":return ls(e);case"nice":return ls(e)||e==="quantize"||e==="threshold";case"exponent":return e==="pow";case"base":return e==="log";case"constant":return e==="symlog";case"zero":return wr(e)&&!We(["log","time","utc","threshold","quantile"],e)}}function nN(e,t){switch(t){case"interpolate":case"scheme":case"domainMid":return Ku(e)?void 0:zde(t);case"align":case"type":case"bins":case"domain":case"domainMax":case"domainMin":case"domainRaw":case"range":case"base":case"exponent":case"constant":case"nice":case"padding":case"paddingInner":case"paddingOuter":case"rangeMax":case"rangeMin":case"reverse":case"round":case"clamp":case"zero":return}}function Whe(e,t){return We([ox,ax],t)?e===void 0||rn(e):t===Ju?We([pn.TIME,pn.UTC,void 0],e):t===ul?QD(e)||ec(e)||e===void 0:!0}function Hhe(e,t,n=!1){if(!ss(e))return!1;switch(e){case $t:case tn:case Go:case Xu:case Wi:case yr:return ls(t)||t==="band"?!0:t==="point"?!n:!1;case Vo:return We(["linear","band"],t);case Us:case Zo:case qs:case Yo:case Xo:case el:return ls(t)||ec(t)||We(["band","point","ordinal"],t);case ai:case ns:case is:return t!=="band";case Ko:case li:return t==="ordinal"||ec(t)}}function Ghe(e){return ie(e)&&"value"in e}const Yn={arc:"arc",area:"area",bar:"bar",image:"image",line:"line",point:"point",rect:"rect",rule:"rule",text:"text",tick:"tick",trail:"trail",circle:"circle",square:"square",geoshape:"geoshape"},iN=Yn.arc,g1=Yn.area,m1=Yn.bar,Vhe=Yn.image,y1=Yn.line,b1=Yn.point,Yhe=Yn.rect,v1=Yn.rule,rN=Yn.text,cx=Yn.tick,Xhe=Yn.trail,fx=Yn.circle,dx=Yn.square,sN=Yn.geoshape;function ta(e){return["line","area","trail"].includes(e)}function zd(e){return["rect","bar","image","arc","tick"].includes(e)}const Zhe=new Set(X(Yn));function us(e){return Z(e,"type")}const Khe=["stroke","strokeWidth","strokeDash","strokeDashOffset","strokeOpacity","strokeJoin","strokeMiterLimit"],Jhe=["fill","fillOpacity"],Qhe=[...Khe,...Jhe],oN=X({color:1,filled:1,invalid:1,order:1,radius2:1,theta2:1,timeUnitBandSize:1,timeUnitBandPosition:1}),hx=["binSpacing","continuousBandSize","discreteBandSize","minBandSize"],epe={area:["line","point"],bar:hx,rect:hx,line:["point"],tick:["bandSize","thickness",...hx]},tpe={color:"#4c78a8",invalid:"break-paths-show-path-domains",timeUnitBandSize:1},aN=X({mark:1,arc:1,area:1,bar:1,circle:1,image:1,line:1,point:1,rect:1,rule:1,square:1,text:1,tick:1,trail:1,geoshape:1});function cl(e){return Z(e,"band")}const npe={horizontal:["cornerRadiusTopRight","cornerRadiusBottomRight"],vertical:["cornerRadiusTopLeft","cornerRadiusTopRight"]},px={binSpacing:0,continuousBandSize:5,minBandSize:.25,timeUnitBandPosition:.5},ipe={...px,binSpacing:1},rpe={...px,thickness:1};function spe(e){return us(e)?e.type:e}function lN(e,{isPath:t}){return e===void 0||e==="break-paths-show-path-domains"?t?"break-paths-show-domains":"filter":e===null?"show":e}function gx({markDef:e,config:t,scaleChannel:n,scaleType:i,isCountAggregate:r}){var a,l;if(!i||!wr(i)||r)return"always-valid";const s=lN(ot("invalid",e,t),{isPath:ta(e.type)});return((l=(a=t.scale)==null?void 0:a.invalid)==null?void 0:l[n])!==void 0?"show":s}function ope(e){return e==="break-paths-filter-domains"||e==="break-paths-show-domains"}function uN({scaleName:e,scale:t,mode:n}){const i=`domain('${e}')`;if(!t||!e)return;const r=`${i}[0]`,s=`peek(${i})`,o=t.domainHasZero();return o==="definitely"?{scale:e,value:0}:o==="maybe"?{signal:`scale('${e}', inrange(0, ${i}) ? 0 : ${n==="zeroOrMin"?r:s})`}:{signal:`scale('${e}', ${n==="zeroOrMin"?r:s})`}}function cN({scaleChannel:e,channelDef:t,scale:n,scaleName:i,markDef:r,config:s}){var c;const o=n==null?void 0:n.get("type"),a=$r(t),l=u1(a==null?void 0:a.aggregate),u=gx({scaleChannel:e,markDef:r,config:s,scaleType:o,isCountAggregate:l});if(a&&u==="show"){const f=((c=s.scale.invalid)==null?void 0:c[e])??"zero-or-min";return{test:p1(ne(a,{expr:"datum"}),!1),...ape(f,n,i)}}}function ape(e,t,n){if(Ghe(e)){const{value:i}=e;return ye(i)?{signal:i.signal}:{value:i}}return uN({scale:t,scaleName:n,mode:"zeroOrMin"})}function mx(e){const{channel:t,channelDef:n,markDef:i,scale:r,scaleName:s,config:o}=e,a=nl(t),l=yx(e),u=cN({scaleChannel:a,channelDef:n,scale:r,scaleName:s,markDef:i,config:o});return u!==void 0?[u,l]:l}function lpe(e){const{datum:t}=e;return ol(t)?al(t):`${st(t)}`}function fl(e,t,n,i){const r={};if(t&&(r.scale=t),cs(e)){const{datum:s}=e;ol(s)?r.signal=al(s):ye(s)?r.signal=s.signal:Id(s)?r.signal=s.expr:r.value=s}else r.field=ne(e,n);if(i){const{offset:s,band:o}=i;s&&(r.offset=s),o&&(r.band=o)}return r}function _1({scaleName:e,fieldOrDatumDef:t,fieldOrDatumDef2:n,offset:i,startSuffix:r,endSuffix:s="end",bandPosition:o=.5}){const a=!ye(o)&&0{switch(t.fieldTitle){case"plain":return e.field;case"functional":return wpe(e);default:return xpe(e,t)}};let CN=SN;function AN(e){CN=e}function kpe(){AN(SN)}function ic(e,t,{allowDisabling:n,includeDefault:i=!0}){var a;const r=(a=wx(e))==null?void 0:a.title;if(!J(e))return r??e.title;const s=e,o=i?kx(s,t):void 0;return n?Lt(r,s.title,o):r??s.title??o}function wx(e){if(nc(e)&&e.axis)return e.axis;if(EN(e)&&e.legend)return e.legend;if(_x(e)&&e.header)return e.header}function kx(e,t){return CN(e,t)}function S1(e){if($N(e)){const{format:t,formatType:n}=e;return{format:t,formatType:n}}else{const t=wx(e)??{},{format:n,formatType:i}=t;return{format:n,formatType:i}}}function Epe(e,t){var s;switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if(xx(e)&&G(e.sort))return"ordinal";const{aggregate:n,bin:i,timeUnit:r}=e;if(r)return"temporal";if(i||n&&!Qo(n)&&!Hs(n))return"quantitative";if(hl(e)&&((s=e.scale)!=null&&s.type))switch(lx[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}function $r(e){if(J(e))return e;if(k1(e))return e.condition}function Yt(e){if(Le(e))return e;if(Wd(e))return e.condition}function FN(e,t,n,i={}){if(re(e)||Ke(e)||ao(e)){const r=re(e)?"string":Ke(e)?"number":"boolean";return K(Cde(t,r,e)),{value:e}}return Le(e)?C1(e,t,n,i):Wd(e)?{...e,condition:C1(e.condition,t,n,i)}:e}function C1(e,t,n,i){if($N(e)){const{format:r,formatType:s,...o}=e;if(dl(s)&&!n.customFormatTypes)return K(TD(t)),C1(o,t,n,i)}else{const r=nc(e)?"axis":EN(e)?"legend":_x(e)?"header":null;if(r&&e[r]){const{format:s,formatType:o,...a}=e[r];if(dl(o)&&!n.customFormatTypes)return K(TD(t)),C1({...e,[r]:a},t,n,i)}}return J(e)?Ex(e,t,i):$pe(e)}function $pe(e){let t=e.type;if(t)return e;const{datum:n}=e;return t=Ke(n)?"quantitative":re(n)?"nominal":ol(n)?"temporal":void 0,{...e,type:t}}function Ex(e,t,{compositeMark:n=!1}={}){const{aggregate:i,timeUnit:r,bin:s,field:o}=e,a={...e};if(!n&&i&&!B7(i)&&!Qo(i)&&!Hs(i)&&(K(Fde(i)),delete a.aggregate),r&&(a.timeUnit=nn(r)),o&&(a.field=`${o}`),vt(s)&&(a.bin=A1(s,t)),dn(s)&&!It(t)&&K(ahe(t)),Xn(a)){const{type:l}=a,u=Dhe(l);l!==u&&(a.type=u),l!=="quantitative"&&u1(i)&&(K(Ade(l,i)),a.type="quantitative")}else if(!sD(t)){const l=Epe(a,t);a.type=l}if(Xn(a)){const{compatible:l,warning:u}=Spe(a,t)||{};l===!1&&K(u)}if(xx(a)&&re(a.sort)){const{sort:l}=a;if(yN(l))return{...a,sort:{encoding:l}};const u=l.substring(1);if(l.charAt(0)==="-"&&yN(u))return{...a,sort:{encoding:u,order:"descending"}}}if(_x(a)){const{header:l}=a;if(l){const{orient:u,...c}=l;if(u)return{...a,header:{...c,labelOrient:l.labelOrient||u,titleOrient:l.titleOrient||u}}}}return a}function A1(e,t){return ao(e)?{maxbins:dD(t)}:e==="binned"?{binned:!0}:!e.maxbins&&!e.step?{...e,maxbins:dD(t)}:e}const rc={compatible:!0};function Spe(e,t){const n=e.type;if(n==="geojson"&&t!=="shape")return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case Ps:case zs:case i1:return $1(e)?rc:{compatible:!1,warning:Nde(t)};case $t:case tn:case Go:case Xu:case ai:case ns:case is:case Rd:case Od:case r1:case tl:case s1:case o1:case el:case Wi:case yr:case a1:return rc;case vr:case Hi:case br:case _r:return n!==ul?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:rc;case qs:case Yo:case Xo:case Zo:case Us:case js:case Bs:case mr:case ts:case Vo:return n==="nominal"&&!e.sort?{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`}:rc;case li:case Ko:return!$1(e)&&!vpe(e)?{compatible:!1,warning:Rde(t)}:rc;case Zu:return e.type==="nominal"&&!("sort"in e)?{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}:rc}}function sc(e){const{formatType:t}=S1(e);return t==="time"||!t&&Cpe(e)}function Cpe(e){return e&&(e.type==="temporal"||J(e)&&!!e.timeUnit)}function F1(e,{timeUnit:t,type:n,wrapTime:i,undefinedIfExprNotRequired:r}){var l;const s=t&&((l=nn(t))==null?void 0:l.unit);let o=s||n==="temporal",a;return Id(e)?a=e.expr:ye(e)?a=e.signal:ol(e)?(o=!0,a=al(e)):(re(e)||Ke(e))&&o&&(a=`datetime(${st(e)})`,vhe(s)&&(Ke(e)&&e<1e4||re(e)&&isNaN(Date.parse(e)))&&(a=al({[s]:e}))),a?i&&o?`time(${a})`:a:r?void 0:st(e)}function TN(e,t){const{type:n}=e;return t.map(i=>{const r=J(e)&&!ll(e.timeUnit)?e.timeUnit:void 0,s=F1(i,{timeUnit:r,type:n,undefinedIfExprNotRequired:!0});return s!==void 0?{signal:s}:i})}function Hd(e,t){return vt(e.bin)?ss(t)&&["ordinal","nominal"].includes(e.type):(console.warn("Only call this method for binned field defs."),!1)}const MN={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function Gd(e){return e==null?void 0:e.condition}const DN=["domain","grid","labels","ticks","title"],Ape={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"both",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"},NN={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1},Fpe={...NN,style:1,labelExpr:1,encoding:1};function RN(e){return le(Fpe,e)}const ON=X({axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1});function Ys(e){return Z(e,"mark")}class T1{constructor(t,n){U(this,"name");U(this,"run");this.name=t,this.run=n}hasMatchingType(t){return Ys(t)?spe(t.mark)===this.name:!1}}function pl(e,t){const n=e==null?void 0:e[t];return n?G(n)?Gu(n,i=>!!i.field):J(n)||k1(n):!1}function LN(e,t){const n=e==null?void 0:e[t];return n?G(n)?Gu(n,i=>!!i.field):J(n)||cs(n)||Wd(n):!1}function IN(e,t){if(It(t)){const n=e[t];if((J(n)||cs(n))&&(sx(n.type)||J(n)&&n.timeUnit)){const i=N7(t);return LN(e,i)}}return!1}function PN(e){return Gu(Ffe,t=>{if(pl(e,t)){const n=e[t];if(G(n))return Gu(n,i=>!!i.aggregate);{const i=$r(n);return i&&!!i.aggregate}}return!1})}function zN(e,t){const n=[],i=[],r=[],s=[],o={};return $x(e,(a,l)=>{if(J(a)){const{field:u,aggregate:c,bin:f,timeUnit:d,...h}=a;if(c||d||f){const p=wx(a),g=p==null?void 0:p.title;let m=ne(a,{forAs:!0});const y={...g?[]:{title:ic(a,t,{allowDisabling:!0})},...h,field:m};if(c){let b;if(Qo(c)?(b="argmax",m=ne({op:"argmax",field:c.argmax},{forAs:!0}),y.field=`${m}.${u}`):Hs(c)?(b="argmin",m=ne({op:"argmin",field:c.argmin},{forAs:!0}),y.field=`${m}.${u}`):c!=="boxplot"&&c!=="errorbar"&&c!=="errorband"&&(b=c),b){const v={op:b,as:m};u&&(v.field=u),s.push(v)}}else if(n.push(m),Xn(a)&&vt(f)){if(i.push({bin:f,field:u,as:m}),n.push(ne(a,{binSuffix:"end"})),Hd(a,l)&&n.push(ne(a,{binSuffix:"range"})),It(l)){const b={field:`${m}_end`};o[`${l}2`]=b}y.bin="binned",sD(l)||(y.type=ul)}else if(d&&!ll(d)){r.push({timeUnit:d,field:u,as:m});const b=Xn(a)&&a.type!==Ju&&"time";b&&(l===Rd||l===tl?y.formatType=b:Bfe(l)?y.legend={formatType:b,...y.legend}:It(l)&&(y.axis={formatType:b,...y.axis}))}o[l]=y}else n.push(u),o[l]=e[l]}else o[l]=e[l]}),{bins:i,timeUnits:r,aggregate:s,groupby:n,encoding:o}}function Tpe(e,t,n){const i=Ufe(t,n);if(i){if(i==="binned"){const r=e[t===mr?$t:tn];return!!(J(r)&&J(e[t])&&dn(r.bin))}}else return!1;return!0}function Mpe(e,t,n,i){const r={};for(const s of X(e))rD(s)||K(Dde(s));for(let s of Ofe){if(!e[s])continue;const o=e[s];if(Ld(s)){const a=Rfe(s),l=r[a];if(J(l)&&Mhe(l.type)&&J(o)&&!l.timeUnit){K(Sde(a));continue}}if(s==="angle"&&t==="arc"&&!e.theta&&(K($de),s=Wi),!Tpe(e,s,t)){K(f1(s,t));continue}if(s===Us&&t==="line"){const a=$r(e[s]);if(a!=null&&a.aggregate){K(Mde);continue}}if(s===ai&&(n?"fill"in e:"stroke"in e)){K(DD("encoding",{fill:"fill"in e,stroke:"stroke"in e}));continue}if(s===Od||s===Zu&&!G(o)&&!Er(o)||s===tl&&G(o)){if(o){if(s===Zu){const a=e[s];if(wN(a)){r[s]=a;continue}}r[s]=se(o).reduce((a,l)=>(J(l)?a.push(Ex(l,s)):K(G7(l,s)),a),[])}}else{if(s===tl&&o===null)r[s]=null;else if(!J(o)&&!cs(o)&&!Er(o)&&!qd(o)&&!ye(o)){K(G7(o,s));continue}r[s]=FN(o,s,i)}}return r}function M1(e,t){const n={};for(const i of X(e)){const r=FN(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function Dpe(e){const t=[];for(const n of X(e))if(pl(e,n)){const i=e[n],r=se(i);for(const s of r)J(s)?t.push(s):k1(s)&&t.push(s.condition)}return t}function $x(e,t,n){if(e)for(const i of X(e)){const r=e[i];if(G(r))for(const s of r)t.call(n,s,i);else t.call(n,r,i)}}function Npe(e,t,n,i){return e?X(e).reduce((r,s)=>{const o=e[s];return G(o)?o.reduce((a,l)=>t.call(i,a,l,s),r):t.call(i,r,o,s)},n):n}function BN(e,t){return X(t).reduce((n,i)=>{switch(i){case $t:case tn:case s1:case a1:case o1:case mr:case ts:case Go:case Xu:case Wi:case js:case yr:case Bs:case Vo:case br:case vr:case _r:case Hi:case Rd:case li:case el:case tl:return n;case Zu:if(e==="line"||e==="trail")return n;case Od:case r1:{const r=t[i];if(G(r)||J(r))for(const s of se(r))s.aggregate||n.push(ne(s,{}));return n}case Us:if(e==="trail")return n;case ai:case ns:case is:case qs:case Yo:case Xo:case Ko:case Zo:{const r=$r(t[i]);return r&&!r.aggregate&&n.push(ne(r,{})),n}}},[])}function Rpe(e){const{tooltip:t,...n}=e;if(!t)return{filteredEncoding:n};let i,r;if(G(t)){for(const s of t)s.aggregate?(i||(i=[]),i.push(s)):(r||(r=[]),r.push(s));i&&(n.tooltip=i)}else t.aggregate?n.tooltip=t:r=t;return G(r)&&r.length===1&&(r=r[0]),{customTooltipWithoutAggregatedField:r,filteredEncoding:n}}function Sx(e,t,n,i=!0){if("tooltip"in n)return{tooltip:n.tooltip};const r=e.map(({fieldPrefix:o,titlePrefix:a})=>{const l=i?` of ${Cx(t)}`:"";return{field:o+t.field,type:t.type,title:ye(a)?{signal:`${a}"${escape(l)}"`}:a+l}}),s=Dpe(n).map(ype);return{tooltip:[...r,...es(s,Ge)]}}function Cx(e){const{title:t,field:n}=e;return Lt(t,n)}function Ax(e,t,n,i,r){const{scale:s,axis:o}=n;return({partName:a,mark:l,positionPrefix:u,endPositionPrefix:c=void 0,extraEncoding:f={}})=>{const d=Cx(n);return jN(e,a,r,{mark:l,encoding:{[t]:{field:`${u}_${n.field}`,type:n.type,...d!==void 0?{title:d}:{},...s!==void 0?{scale:s}:{},...o!==void 0?{axis:o}:{}},...re(c)?{[`${t}2`]:{field:`${c}_${n.field}`}}:{},...i,...f}})}}function jN(e,t,n,i){const{clip:r,color:s,opacity:o}=e,a=e.type;return e[t]||e[t]===void 0&&n[t]?[{...i,mark:{...n[t],...r?{clip:r}:{},...s?{color:s}:{},...o?{opacity:o}:{},...us(i.mark)?i.mark:{type:i.mark},style:`${a}-${String(t)}`,...ao(e[t])?{}:e[t]}}]:[]}function UN(e,t,n){const{encoding:i}=e,r=t==="vertical"?"y":"x",s=i[r],o=i[`${r}2`],a=i[`${r}Error`],l=i[`${r}Error2`];return{continuousAxisChannelDef:D1(s,n),continuousAxisChannelDef2:D1(o,n),continuousAxisChannelDefError:D1(a,n),continuousAxisChannelDefError2:D1(l,n),continuousAxis:r}}function D1(e,t){if(e!=null&&e.aggregate){const{aggregate:n,...i}=e;return n!==t&&K(ohe(n,t)),i}else return e}function qN(e,t){const{mark:n,encoding:i}=e,{x:r,y:s}=i;if(us(n)&&n.orient)return n.orient;if(ia(r)){if(ia(s)){const o=J(r)&&r.aggregate,a=J(s)&&s.aggregate;if(!o&&a===t)return"vertical";if(!a&&o===t)return"horizontal";if(o===t&&a===t)throw new Error("Both x and y cannot have aggregate");return sc(s)&&!sc(r)?"horizontal":"vertical"}return"horizontal"}else{if(ia(s))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}}const N1="boxplot",Ope=["box","median","outliers","rule","ticks"],Lpe=new T1(N1,HN);function WN(e){return Ke(e)?"tukey":e}function HN(e,{config:t}){e={...e,encoding:M1(e.encoding,t)};const{mark:n,encoding:i,params:r,projection:s,...o}=e,a=us(n)?n:{type:n};r&&K(CD("boxplot"));const l=a.extent??t.boxplot.extent,u=ot("size",a,t),c=a.invalid,f=WN(l),{bins:d,timeUnits:h,transform:p,continuousAxisChannelDef:g,continuousAxis:m,groupby:y,aggregate:b,encodingWithoutContinuousAxis:v,ticksOrient:_,boxOrient:x,customTooltipWithoutAggregatedField:k}=Ipe(e,l,t),w=Vu(g.field),{color:E,size:$,...F}=v,A=to=>Ax(a,m,g,to,t.boxplot),z=A(F),P=A(v),M=(ie(t.boxplot.box)?t.boxplot.box.color:t.mark.color)||"#4c78a8",S=A({...F,...$?{size:$}:{},color:{condition:{test:`${ut(`lower_box_${g.field}`)} >= ${ut(`upper_box_${g.field}`)}`,...E||{value:M}}}}),D=Sx([{fieldPrefix:f==="min-max"?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:f==="min-max"?"lower_whisker_":"min_",titlePrefix:"Min"}],g,v),B={type:"tick",color:"black",opacity:1,orient:_,invalid:c,aria:!1},V=f==="min-max"?D:Sx([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],g,v),H=[...z({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:V}),...z({partName:"rule",mark:{type:"rule",invalid:c,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:V}),...z({partName:"ticks",mark:B,positionPrefix:"lower_whisker",extraEncoding:V}),...z({partName:"ticks",mark:B,positionPrefix:"upper_whisker",extraEncoding:V})],oe=[...f!=="tukey"?H:[],...P({partName:"box",mark:{type:"bar",...u?{size:u}:{},orient:x,invalid:c,ariaRoleDescription:"box"},positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:D}),...S({partName:"median",mark:{type:"tick",invalid:c,...ie(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{},...u?{size:u}:{},orient:_,aria:!1},positionPrefix:"mid_box",extraEncoding:D})];if(f==="min-max")return{...o,transform:(o.transform??[]).concat(p),layer:oe};const we=ut(`lower_box_${g.field}`),xe=ut(`upper_box_${g.field}`),Re=`(${xe} - ${we})`,nt=`${we} - ${l} * ${Re}`,Ie=`${xe} + ${l} * ${Re}`,jt=ut(g.field),Xi={joinaggregate:GN(g.field),groupby:y},Zi={transform:[{filter:`(${nt} <= ${jt}) && (${jt} <= ${Ie})`},{aggregate:[{op:"min",field:g.field,as:`lower_whisker_${w}`},{op:"max",field:g.field,as:`upper_whisker_${w}`},{op:"min",field:`lower_box_${g.field}`,as:`lower_box_${w}`},{op:"max",field:`upper_box_${g.field}`,as:`upper_box_${w}`},...b],groupby:y}],layer:H},{tooltip:ue,...je}=F,{scale:He,axis:Q}=g,mn=Cx(g),ft=jN(a,"outliers",t.boxplot,{transform:[{filter:`(${jt} < ${nt}) || (${jt} > ${Ie})`}],mark:"point",encoding:{[m]:{field:g.field,type:g.type,...mn!==void 0?{title:mn}:{},...He!==void 0?{scale:He}:{},...Q!==void 0?{axis:Q}:{}},...je,...E?{color:E}:{},...k?{tooltip:k}:{}}})[0];let on;const Dn=[...d,...h,Xi];return ft?on={transform:Dn,layer:[ft,Zi]}:(on=Zi,on.transform.unshift(...Dn)),{...o,layer:[on,{transform:p,layer:oe}]}}function GN(e){const t=Vu(e);return[{op:"q1",field:e,as:`lower_box_${t}`},{op:"q3",field:e,as:`upper_box_${t}`}]}function Ipe(e,t,n){const i=qN(e,N1),{continuousAxisChannelDef:r,continuousAxis:s}=UN(e,i,N1),o=r.field,a=Vu(o),l=WN(t),u=[...GN(o),{op:"median",field:o,as:`mid_box_${a}`},{op:"min",field:o,as:(l==="min-max"?"lower_whisker_":"min_")+a},{op:"max",field:o,as:(l==="min-max"?"upper_whisker_":"max_")+a}],c=l==="min-max"||l==="tukey"?[]:[{calculate:`${ut(`upper_box_${a}`)} - ${ut(`lower_box_${a}`)}`,as:`iqr_${a}`},{calculate:`min(${ut(`upper_box_${a}`)} + ${ut(`iqr_${a}`)} * ${t}, ${ut(`max_${a}`)})`,as:`upper_whisker_${a}`},{calculate:`max(${ut(`lower_box_${a}`)} - ${ut(`iqr_${a}`)} * ${t}, ${ut(`min_${a}`)})`,as:`lower_whisker_${a}`}],{[s]:f,...d}=e.encoding,{customTooltipWithoutAggregatedField:h,filteredEncoding:p}=Rpe(d),{bins:g,timeUnits:m,aggregate:y,groupby:b,encoding:v}=zN(p,n),_=i==="vertical"?"horizontal":"vertical",x=i,k=[...g,...m,{aggregate:[...y,...u],groupby:b},...c];return{bins:g,timeUnits:m,transform:k,groupby:b,aggregate:y,continuousAxisChannelDef:r,continuousAxis:s,encodingWithoutContinuousAxis:v,ticksOrient:_,boxOrient:x,customTooltipWithoutAggregatedField:h}}const Fx="errorbar",Ppe=["ticks","rule"],zpe=new T1(Fx,VN);function VN(e,{config:t}){e={...e,encoding:M1(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,ticksOrient:o,markDef:a,outerSpec:l,tooltipEncoding:u}=YN(e,Fx,t);delete s.size;const c=Ax(a,r,i,s,t.errorbar),f=a.thickness,d=a.size,h={type:"tick",orient:o,aria:!1,...f!==void 0?{thickness:f}:{},...d!==void 0?{size:d}:{}},p=[...c({partName:"ticks",mark:h,positionPrefix:"lower",extraEncoding:u}),...c({partName:"ticks",mark:h,positionPrefix:"upper",extraEncoding:u}),...c({partName:"rule",mark:{type:"rule",ariaRoleDescription:"errorbar",...f!==void 0?{size:f}:{}},positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:u})];return{...l,transform:n,...p.length>1?{layer:p}:{...p[0]}}}function Bpe(e,t){const{encoding:n}=e;if(jpe(n))return{orient:qN(e,t),inputType:"raw"};const i=Upe(n),r=qpe(n),s=n.x,o=n.y;if(i){if(r)throw new Error(`${t} cannot be both type aggregated-upper-lower and aggregated-error`);const a=n.x2,l=n.y2;if(Le(a)&&Le(l))throw new Error(`${t} cannot have both x2 and y2`);if(Le(a)){if(ia(s))return{orient:"horizontal",inputType:"aggregated-upper-lower"};throw new Error(`Both x and x2 have to be quantitative in ${t}`)}else if(Le(l)){if(ia(o))return{orient:"vertical",inputType:"aggregated-upper-lower"};throw new Error(`Both y and y2 have to be quantitative in ${t}`)}throw new Error("No ranged axis")}else{const a=n.xError,l=n.xError2,u=n.yError,c=n.yError2;if(Le(l)&&!Le(a))throw new Error(`${t} cannot have xError2 without xError`);if(Le(c)&&!Le(u))throw new Error(`${t} cannot have yError2 without yError`);if(Le(a)&&Le(u))throw new Error(`${t} cannot have both xError and yError with both are quantiative`);if(Le(a)){if(ia(s))return{orient:"horizontal",inputType:"aggregated-error"};throw new Error("All x, xError, and xError2 (if exist) have to be quantitative")}else if(Le(u)){if(ia(o))return{orient:"vertical",inputType:"aggregated-error"};throw new Error("All y, yError, and yError2 (if exist) have to be quantitative")}throw new Error("No ranged axis")}}function jpe(e){return(Le(e.x)||Le(e.y))&&!Le(e.x2)&&!Le(e.y2)&&!Le(e.xError)&&!Le(e.xError2)&&!Le(e.yError)&&!Le(e.yError2)}function Upe(e){return Le(e.x2)||Le(e.y2)}function qpe(e){return Le(e.xError)||Le(e.xError2)||Le(e.yError)||Le(e.yError2)}function YN(e,t,n){const{mark:i,encoding:r,params:s,projection:o,...a}=e,l=us(i)?i:{type:i};s&&K(CD(t));const{orient:u,inputType:c}=Bpe(e,t),{continuousAxisChannelDef:f,continuousAxisChannelDef2:d,continuousAxisChannelDefError:h,continuousAxisChannelDefError2:p,continuousAxis:g}=UN(e,u,t),{errorBarSpecificAggregate:m,postAggregateCalculates:y,tooltipSummary:b,tooltipTitleWithFieldName:v}=Wpe(l,f,d,h,p,c,t,n),{[g]:_,[g==="x"?"x2":"y2"]:x,[g==="x"?"xError":"yError"]:k,[g==="x"?"xError2":"yError2"]:w,...E}=r,{bins:$,timeUnits:F,aggregate:A,groupby:z,encoding:P}=zN(E,n),M=[...A,...m],S=c!=="raw"?[]:z,D=Sx(b,f,P,v);return{transform:[...a.transform??[],...$,...F,...M.length===0?[]:[{aggregate:M,groupby:S}],...y],groupby:S,continuousAxisChannelDef:f,continuousAxis:g,encodingWithoutContinuousAxis:P,ticksOrient:u==="vertical"?"horizontal":"vertical",markDef:l,outerSpec:a,tooltipEncoding:D}}function Wpe(e,t,n,i,r,s,o,a){let l=[],u=[];const c=t.field;let f,d=!1;if(s==="raw"){const h=e.center?e.center:e.extent?e.extent==="iqr"?"median":"mean":a.errorbar.center,p=e.extent?e.extent:h==="mean"?"stderr":"iqr";if(h==="median"!=(p==="iqr")&&K(she(h,p,o)),p==="stderr"||p==="stdev")l=[{op:p,field:c,as:`extent_${c}`},{op:h,field:c,as:`center_${c}`}],u=[{calculate:`${ut(`center_${c}`)} + ${ut(`extent_${c}`)}`,as:`upper_${c}`},{calculate:`${ut(`center_${c}`)} - ${ut(`extent_${c}`)}`,as:`lower_${c}`}],f=[{fieldPrefix:"center_",titlePrefix:Dd(h)},{fieldPrefix:"upper_",titlePrefix:XN(h,p,"+")},{fieldPrefix:"lower_",titlePrefix:XN(h,p,"-")}],d=!0;else{let g,m,y;p==="ci"?(g="mean",m="ci0",y="ci1"):(g="median",m="q1",y="q3"),l=[{op:m,field:c,as:`lower_${c}`},{op:y,field:c,as:`upper_${c}`},{op:g,field:c,as:`center_${c}`}],f=[{fieldPrefix:"upper_",titlePrefix:ic({field:c,aggregate:y,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"lower_",titlePrefix:ic({field:c,aggregate:m,type:"quantitative"},a,{allowDisabling:!1})},{fieldPrefix:"center_",titlePrefix:ic({field:c,aggregate:g,type:"quantitative"},a,{allowDisabling:!1})}]}}else{(e.center||e.extent)&&K(rhe(e.center,e.extent)),s==="aggregated-upper-lower"?(f=[],u=[{calculate:ut(n.field),as:`upper_${c}`},{calculate:ut(c),as:`lower_${c}`}]):s==="aggregated-error"&&(f=[{fieldPrefix:"",titlePrefix:c}],u=[{calculate:`${ut(c)} + ${ut(i.field)}`,as:`upper_${c}`}],r?u.push({calculate:`${ut(c)} + ${ut(r.field)}`,as:`lower_${c}`}):u.push({calculate:`${ut(c)} - ${ut(i.field)}`,as:`lower_${c}`}));for(const h of u)f.push({fieldPrefix:h.as.substring(0,6),titlePrefix:Qa(Qa(h.calculate,"datum['",""),"']","")})}return{postAggregateCalculates:u,errorBarSpecificAggregate:l,tooltipSummary:f,tooltipTitleWithFieldName:d}}function XN(e,t,n){return`${Dd(e)} ${n} ${t}`}const Tx="errorband",Hpe=["band","borders"],Gpe=new T1(Tx,ZN);function ZN(e,{config:t}){e={...e,encoding:M1(e.encoding,t)};const{transform:n,continuousAxisChannelDef:i,continuousAxis:r,encodingWithoutContinuousAxis:s,markDef:o,outerSpec:a,tooltipEncoding:l}=YN(e,Tx,t),u=o,c=Ax(u,r,i,s,t.errorband),f=e.encoding.x!==void 0&&e.encoding.y!==void 0;let d={type:f?"area":"rect"},h={type:f?"line":"rule"};const p={...u.interpolate?{interpolate:u.interpolate}:{},...u.tension&&u.interpolate?{tension:u.tension}:{}};return f?(d={...d,...p,ariaRoleDescription:"errorband"},h={...h,...p,aria:!1}):u.interpolate?K(LD("interpolate")):u.tension&&K(LD("tension")),{...a,transform:n,layer:[...c({partName:"band",mark:d,positionPrefix:"lower",endPositionPrefix:"upper",extraEncoding:l}),...c({partName:"borders",mark:h,positionPrefix:"lower",extraEncoding:l}),...c({partName:"borders",mark:h,positionPrefix:"upper",extraEncoding:l})]}}const KN={};function Mx(e,t,n){const i=new T1(e,t);KN[e]={normalizer:i,parts:n}}function Vpe(){return X(KN)}Mx(N1,HN,Ope),Mx(Fx,VN,Ppe),Mx(Tx,ZN,Hpe);const Ype=["gradientHorizontalMaxLength","gradientHorizontalMinLength","gradientVerticalMaxLength","gradientVerticalMinLength","unselectedOpacity"],JN={titleAlign:"align",titleAnchor:"anchor",titleAngle:"angle",titleBaseline:"baseline",titleColor:"color",titleFont:"font",titleFontSize:"fontSize",titleFontStyle:"fontStyle",titleFontWeight:"fontWeight",titleLimit:"limit",titleLineHeight:"lineHeight",titleOrient:"orient",titlePadding:"offset"},QN={labelAlign:"align",labelAnchor:"anchor",labelAngle:"angle",labelBaseline:"baseline",labelColor:"color",labelFont:"font",labelFontSize:"fontSize",labelFontStyle:"fontStyle",labelFontWeight:"fontWeight",labelLimit:"limit",labelLineHeight:"lineHeight",labelOrient:"orient",labelPadding:"offset"},Xpe=X(JN),Zpe=X(QN),eR=X({header:1,headerRow:1,headerColumn:1,headerFacet:1}),tR=["size","shape","fill","stroke","strokeDash","strokeWidth","opacity"],Kpe={gradientHorizontalMaxLength:200,gradientHorizontalMinLength:100,gradientVerticalMaxLength:200,gradientVerticalMinLength:64,unselectedOpacity:.35},Jpe={aria:1,clipHeight:1,columnPadding:1,columns:1,cornerRadius:1,description:1,direction:1,fillColor:1,format:1,formatType:1,gradientLength:1,gradientOpacity:1,gradientStrokeColor:1,gradientStrokeWidth:1,gradientThickness:1,gridAlign:1,labelAlign:1,labelBaseline:1,labelColor:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labelSeparation:1,legendX:1,legendY:1,offset:1,orient:1,padding:1,rowPadding:1,strokeColor:1,symbolDash:1,symbolDashOffset:1,symbolFillColor:1,symbolLimit:1,symbolOffset:1,symbolOpacity:1,symbolSize:1,symbolStrokeColor:1,symbolStrokeWidth:1,symbolType:1,tickCount:1,tickMinStep:1,title:1,titleAlign:1,titleAnchor:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titleOrient:1,titlePadding:1,type:1,values:1,zindex:1},Sr="_vgsid_",Qpe={point:{on:"click",fields:[Sr],toggle:"event.shiftKey",resolve:"global",clear:"dblclick"},interval:{on:"[pointerdown, window:pointerup] > window:pointermove!",encodings:["x","y"],translate:"[pointerdown, window:pointerup] > window:pointermove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function Dx(e){return e==="legend"||!!(e!=null&&e.legend)}function Nx(e){return Dx(e)&&ie(e)}function Rx(e){return!!(e!=null&&e.select)}function nR(e){const t=[];for(const n of e||[]){if(Rx(n))continue;const{expr:i,bind:r,...s}=n;if(r&&i){const o={...s,bind:r,init:i};t.push(o)}else{const o={...s,...i?{update:i}:{},...r?{bind:r}:{}};t.push(o)}}return t}function ege(e){return R1(e)||Lx(e)||Ox(e)}function Ox(e){return Z(e,"concat")}function R1(e){return Z(e,"vconcat")}function Lx(e){return Z(e,"hconcat")}function iR({step:e,offsetIsDiscrete:t}){return t?e.for??"offset":"position"}function fs(e){return Z(e,"step")}function rR(e){return Z(e,"view")||Z(e,"width")||Z(e,"height")}const sR=20,tge=X({align:1,bounds:1,center:1,columns:1,spacing:1});function nge(e,t,n){const i=n[t],r={},{spacing:s,columns:o}=i;s!==void 0&&(r.spacing=s),o!==void 0&&(w1(e)&&!Ud(e.facet)||Ox(e))&&(r.columns=o),R1(e)&&(r.columns=1);for(const a of tge)if(e[a]!==void 0)if(a==="spacing"){const l=e[a];r[a]=Ke(l)?l:{row:l.row??s,column:l.column??s}}else r[a]=e[a];return r}function Ix(e,t){return e[t]??e[t==="width"?"continuousWidth":"continuousHeight"]}function Px(e,t){const n=O1(e,t);return fs(n)?n.step:oR}function O1(e,t){const n=e[t]??e[t==="width"?"discreteWidth":"discreteHeight"];return Lt(n,{step:e.step})}const oR=20,ige={background:"white",padding:5,timeFormat:"%b %d, %Y",countTitle:"Count of Records",view:{continuousWidth:300,continuousHeight:300,step:oR},mark:tpe,arc:{},area:{},bar:ipe,circle:{},geoshape:{},image:{},line:{},point:{},rect:px,rule:{color:"black"},square:{},text:{color:"black"},tick:rpe,trail:{},boxplot:{size:14,extent:1.5,box:{},median:{color:"white"},outliers:{},rule:{},ticks:null},errorbar:{center:"mean",rule:!0,ticks:!1},errorband:{band:{opacity:.3},borders:!1},scale:Ihe,projection:{},legend:Kpe,header:{titlePadding:10,labelPadding:10},headerColumn:{},headerRow:{},headerFacet:{},selection:Qpe,style:{},title:{},facet:{spacing:sR},concat:{spacing:sR},normalizedNumberFormat:".0%"},Xs=["#4c78a8","#f58518","#e45756","#72b7b2","#54a24b","#eeca3b","#b279a2","#ff9da6","#9d755d","#bab0ac"],aR={text:11,guideLabel:10,guideTitle:11,groupTitle:13,groupSubtitle:12},lR={blue:Xs[0],orange:Xs[1],red:Xs[2],teal:Xs[3],green:Xs[4],yellow:Xs[5],purple:Xs[6],pink:Xs[7],brown:Xs[8],gray0:"#000",gray1:"#111",gray2:"#222",gray3:"#333",gray4:"#444",gray5:"#555",gray6:"#666",gray7:"#777",gray8:"#888",gray9:"#999",gray10:"#aaa",gray11:"#bbb",gray12:"#ccc",gray13:"#ddd",gray14:"#eee",gray15:"#fff"};function rge(e={}){return{signals:[{name:"color",value:ie(e)?{...lR,...e}:lR}],mark:{color:{signal:"color.blue"}},rule:{color:{signal:"color.gray0"}},text:{color:{signal:"color.gray0"}},style:{"guide-label":{fill:{signal:"color.gray0"}},"guide-title":{fill:{signal:"color.gray0"}},"group-title":{fill:{signal:"color.gray0"}},"group-subtitle":{fill:{signal:"color.gray0"}},cell:{stroke:{signal:"color.gray8"}}},axis:{domainColor:{signal:"color.gray13"},gridColor:{signal:"color.gray8"},tickColor:{signal:"color.gray13"}},range:{category:[{signal:"color.blue"},{signal:"color.orange"},{signal:"color.red"},{signal:"color.teal"},{signal:"color.green"},{signal:"color.yellow"},{signal:"color.purple"},{signal:"color.pink"},{signal:"color.brown"},{signal:"color.grey8"}]}}}function sge(e){return{signals:[{name:"fontSize",value:ie(e)?{...aR,...e}:aR}],text:{fontSize:{signal:"fontSize.text"}},style:{"guide-label":{fontSize:{signal:"fontSize.guideLabel"}},"guide-title":{fontSize:{signal:"fontSize.guideTitle"}},"group-title":{fontSize:{signal:"fontSize.groupTitle"}},"group-subtitle":{fontSize:{signal:"fontSize.groupSubtitle"}}}}}function oge(e){return{text:{font:e},style:{"guide-label":{font:e},"guide-title":{font:e},"group-title":{font:e},"group-subtitle":{font:e}}}}function uR(e){const t=X(e||{}),n={};for(const i of t){const r=e[i];n[i]=Gd(r)?pD(r):Ei(r)}return n}function age(e){const t=X(e),n={};for(const i of t)n[i]=uR(e[i]);return n}const lge=[...aN,...ON,...eR,"background","padding","legend","lineBreak","scale","style","title","view"];function cR(e={}){const{color:t,font:n,fontSize:i,selection:r,...s}=e,o=zl({},Ne(ige),n?oge(n):{},t?rge(t):{},i?sge(i):{},s||{});r&&Bl(o,"selection",r,!0);const a=wi(o,lge);for(const l of["background","lineBreak","padding"])o[l]&&(a[l]=Ei(o[l]));for(const l of aN)o[l]&&(a[l]=hn(o[l]));for(const l of ON)o[l]&&(a[l]=uR(o[l]));for(const l of eR)o[l]&&(a[l]=hn(o[l]));if(o.legend&&(a.legend=hn(o.legend)),o.scale){const{invalid:l,...u}=o.scale,c=hn(l,{level:1});a.scale={...hn(u),...X(c).length>0?{invalid:c}:{}}}return o.style&&(a.style=age(o.style)),o.title&&(a.title=hn(o.title)),o.view&&(a.view=hn(o.view)),a}const uge=new Set(["view",...Zhe]),cge=["color","fontSize","background","padding","facet","concat","numberFormat","numberFormatType","normalizedNumberFormat","normalizedNumberFormatType","timeFormat","countTitle","header","axisQuantitative","axisTemporal","axisDiscrete","axisPoint","axisXBand","axisXPoint","axisXDiscrete","axisXQuantitative","axisXTemporal","axisYBand","axisYPoint","axisYDiscrete","axisYQuantitative","axisYTemporal","scale","selection","overlay"],fge={view:["continuousWidth","continuousHeight","discreteWidth","discreteHeight","step"],...epe};function dge(e){e=Ne(e);for(const t of cge)delete e[t];if(e.axis)for(const t in e.axis)Gd(e.axis[t])&&delete e.axis[t];if(e.legend)for(const t of Ype)delete e.legend[t];if(e.mark){for(const t of oN)delete e.mark[t];e.mark.tooltip&&ie(e.mark.tooltip)&&delete e.mark.tooltip}e.params&&(e.signals=(e.signals||[]).concat(nR(e.params)),delete e.params);for(const t of uge){for(const i of oN)delete e[t][i];const n=fge[t];if(n)for(const i of n)delete e[t][i];pge(e,t)}for(const t of Vpe())delete e[t];hge(e);for(const t in e)ie(e[t])&&bt(e[t])&&delete e[t];return bt(e)?void 0:e}function hge(e){const{titleMarkConfig:t,subtitleMarkConfig:n,subtitle:i}=hD(e.title);bt(t)||(e.style["group-title"]={...e.style["group-title"],...t}),bt(n)||(e.style["group-subtitle"]={...e.style["group-subtitle"],...n}),bt(i)?delete e.title:e.title=i}function pge(e,t,n,i){const r=e[t];t==="view"&&(n="cell");const s={...r,...e.style[n??t]};bt(s)||(e.style[n??t]=s),delete e[t]}function L1(e){return Z(e,"layer")}function gge(e){return Z(e,"repeat")}function mge(e){return!G(e.repeat)&&Z(e.repeat,"layer")}class zx{map(t,n){return w1(t)?this.mapFacet(t,n):gge(t)?this.mapRepeat(t,n):Lx(t)?this.mapHConcat(t,n):R1(t)?this.mapVConcat(t,n):Ox(t)?this.mapConcat(t,n):this.mapLayerOrUnit(t,n)}mapLayerOrUnit(t,n){if(L1(t))return this.mapLayer(t,n);if(Ys(t))return this.mapUnit(t,n);throw new Error(q7(t))}mapLayer(t,n){return{...t,layer:t.layer.map(i=>this.mapLayerOrUnit(i,n))}}mapHConcat(t,n){return{...t,hconcat:t.hconcat.map(i=>this.map(i,n))}}mapVConcat(t,n){return{...t,vconcat:t.vconcat.map(i=>this.map(i,n))}}mapConcat(t,n){const{concat:i,...r}=t;return{...r,concat:i.map(s=>this.map(s,n))}}mapFacet(t,n){return{...t,spec:this.map(t.spec,n)}}mapRepeat(t,n){return{...t,spec:this.map(t.spec,n)}}}const yge={zero:1,center:1,normalize:1};function bge(e){return le(yge,e)}const vge=new Set([iN,m1,g1,v1,b1,fx,dx,y1,rN,cx]),_ge=new Set([m1,g1,iN]);function oc(e){return J(e)&&tc(e)==="quantitative"&&!e.bin}function fR(e,t,{orient:n,type:i}){const r=t==="x"?"y":"radius",s=t==="x"&&["bar","area"].includes(i),o=e[t],a=e[r];if(J(o)&&J(a))if(oc(o)&&oc(a)){if(o.stack)return t;if(a.stack)return r;const l=J(o)&&!!o.aggregate,u=J(a)&&!!a.aggregate;if(l!==u)return l?t:r;if(s){if(n==="vertical")return r;if(n==="horizontal")return t}}else{if(oc(o))return t;if(oc(a))return r}else{if(oc(o))return s&&n==="vertical"?void 0:t;if(oc(a))return s&&n==="horizontal"?void 0:r}}function xge(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}function dR(e,t){var g,m;const n=us(e)?e:{type:e},i=n.type;if(!vge.has(i))return null;const r=fR(t,"x",n)||fR(t,"theta",n);if(!r)return null;const s=t[r],o=J(s)?ne(s,{}):void 0,a=xge(r),l=[],u=new Set;if(t[a]){const y=t[a],b=J(y)?ne(y,{}):void 0;b&&b!==o&&(l.push(a),u.add(b))}const c=a==="x"?"xOffset":"yOffset",f=t[c],d=J(f)?ne(f,{}):void 0;d&&d!==o&&(l.push(c),u.add(d));const h=Lfe.reduce((y,b)=>{if(b!=="tooltip"&&pl(t,b)){const v=t[b];for(const _ of se(v)){const x=$r(_);if(x.aggregate)continue;const k=ne(x,{});(!k||!u.has(k))&&y.push({channel:b,fieldDef:x})}}return y},[]);let p;return s.stack!==void 0?ao(s.stack)?p=s.stack?"zero":null:p=s.stack:_ge.has(i)&&(p="zero"),!p||!bge(p)||PN(t)&&h.length===0?null:((g=s==null?void 0:s.scale)!=null&&g.type&&((m=s==null?void 0:s.scale)==null?void 0:m.type)!==pn.LINEAR&&s!=null&&s.stack&&K(the(s.scale.type)),Le(t[rs(r)])?(s.stack!==void 0&&K(ehe(r)),null):(J(s)&&s.aggregate&&!Xfe.has(s.aggregate)&&K(nhe(s.aggregate)),{groupbyChannels:l,groupbyFields:u,fieldChannel:r,impute:s.impute===null?!1:ta(i),stackBy:h,offset:p}))}function hR(e,t,n){const i=hn(e),r=ot("orient",i,n);if(i.orient=$ge(i.type,t,r),r!==void 0&&r!==i.orient&&K(Pde(i.orient,r)),i.type==="bar"&&i.orient){const l=ot("cornerRadiusEnd",i,n);if(l!==void 0){const u=i.orient==="horizontal"&&t.x2||i.orient==="vertical"&&t.y2?["cornerRadius"]:npe[i.orient];for(const c of u)i[c]=l;i.cornerRadiusEnd!==void 0&&delete i.cornerRadiusEnd}}const s=ot("opacity",i,n),o=ot("fillOpacity",i,n);return s===void 0&&o===void 0&&(i.opacity=kge(i.type,t)),ot("cursor",i,n)===void 0&&(i.cursor=wge(i,t,n)),i}function wge(e,t,n){return t.href||e.href||ot("href",e,n)?"pointer":e.cursor}const pR=.7;function kge(e,t){if(We([b1,cx,fx,dx],e)&&!PN(t))return pR}function Ege(e,t,{graticule:n}){if(n)return!1;const i=os("filled",e,t),r=e.type;return Lt(i,r!==b1&&r!==y1&&r!==v1)}function $ge(e,t,n){switch(e){case b1:case fx:case dx:case Yhe:case Vhe:return}const{x:i,y:r,x2:s,y2:o}=t;switch(e){case rN:case m1:if(J(i)&&(dn(i.bin)||J(r)&&r.aggregate&&!i.aggregate))return"vertical";if(J(r)&&(dn(r.bin)||J(i)&&i.aggregate&&!r.aggregate))return"horizontal";if(o||s){if(n)return n;if(!s)return(J(i)&&i.type===ul&&!vt(i.bin)||E1(i))&&J(r)&&dn(r.bin)?"horizontal":"vertical";if(!o)return(J(r)&&r.type===ul&&!vt(r.bin)||E1(r))&&J(i)&&dn(i.bin)?"vertical":"horizontal"}case v1:if(s&&!(J(i)&&dn(i.bin))&&o&&!(J(r)&&dn(r.bin)))return;case g1:if(o)return J(r)&&dn(r.bin)?"horizontal":"vertical";if(s)return J(i)&&dn(i.bin)?"vertical":"horizontal";if(e===v1){if(i&&!r)return"vertical";if(r&&!i)return"horizontal"}case y1:case cx:{const a=kN(i),l=kN(r);if(n)return n;if(a&&!l)return e!=="tick"?"horizontal":"vertical";if(!a&&l)return e!=="tick"?"vertical":"horizontal";if(a&&l)return"vertical";{const u=Xn(i)&&i.type===Ju,c=Xn(r)&&r.type===Ju;if(u&&!c)return"vertical";if(!u&&c)return"horizontal"}return}}return"vertical"}function Sge(e){const{point:t,line:n,...i}=e;return X(i).length>1?i:i.type}function Cge(e){for(const t of["line","area","rule","trail"])e[t]&&(e={...e,[t]:wi(e[t],["point","line"])});return e}function Bx(e,t={},n){return e.point==="transparent"?{opacity:0}:e.point?ie(e.point)?e.point:{}:e.point!==void 0?null:t.point||n.shape?ie(t.point)?t.point:{}:void 0}function gR(e,t={}){return e.line?e.line===!0?{}:e.line:e.line!==void 0?null:t.line?t.line===!0?{}:t.line:void 0}class Age{constructor(){U(this,"name","path-overlay")}hasMatchingType(t,n){if(Ys(t)){const{mark:i,encoding:r}=t,s=us(i)?i:{type:i};switch(s.type){case"line":case"rule":case"trail":return!!Bx(s,n[s.type],r);case"area":return!!Bx(s,n[s.type],r)||!!gR(s,n[s.type])}}return!1}run(t,n,i){const{config:r}=n,{params:s,projection:o,mark:a,name:l,encoding:u,...c}=t,f=M1(u,r),d=us(a)?a:{type:a},h=Bx(d,r[d.type],f),p=d.type==="area"&&gR(d,r[d.type]),g=[{name:l,...s?{params:s}:{},mark:Sge({...d.type==="area"&&ot("opacity",d,r)==null&&ot("fillOpacity",d,r)==null?{opacity:pR}:{},...d}),encoding:wi(f,["shape"])}],m=dR(hR(d,f,r),f);let y=f;if(m){const{fieldChannel:b,offset:v}=m;y={...f,[b]:{...f[b],...v?{stack:v}:{}}}}return y=wi(y,["y2","x2"]),p&&g.push({...o?{projection:o}:{},mark:{type:"line",...Hu(d,["clip","interpolate","tension","tooltip"]),...p},encoding:y}),h&&g.push({...o?{projection:o}:{},mark:{type:"point",opacity:1,filled:!0,...Hu(d,["clip","tooltip"]),...h},encoding:y}),i({...c,layer:g},{...n,config:Cge(r)})}}function Fge(e,t){return t?Ud(e)?vR(e,t):mR(e,t):e}function jx(e,t){return t?vR(e,t):e}function Ux(e,t,n){const i=t[e];if(gpe(i)){if(i.repeat in n)return{...t,[e]:n[i.repeat]};K(gde(i.repeat));return}return t}function mR(e,t){if(e=Ux("field",e,t),e!==void 0){if(e===null)return null;if(xx(e)&&Vs(e.sort)){const n=Ux("field",e.sort,t);e={...e,...n?{sort:n}:{}}}return e}}function yR(e,t){if(J(e))return mR(e,t);{const n=Ux("datum",e,t);return n!==e&&!n.type&&(n.type="nominal"),n}}function bR(e,t){if(Le(e)){const n=yR(e,t);if(n)return n;if(qd(e))return{condition:e.condition}}else{if(Wd(e)){const n=yR(e.condition,t);if(n)return{...e,condition:n};{const{condition:i,...r}=e;return r}}return e}}function vR(e,t){const n={};for(const i in e)if(Z(e,i)){const r=e[i];if(G(r))n[i]=r.map(s=>bR(s,t)).filter(s=>s);else{const s=bR(r,t);s!==void 0&&(n[i]=s)}}return n}class Tge{constructor(){U(this,"name","RuleForRangedLine")}hasMatchingType(t){if(Ys(t)){const{encoding:n,mark:i}=t;if(i==="line"||us(i)&&i.type==="line")for(const r of Nfe){const s=nl(r),o=n[s];if(n[r]&&(J(o)&&!dn(o.bin)||cs(o)))return!0}}return!1}run(t,n,i){const{encoding:r,mark:s}=t;return K(Ide(!!r.x2,!!r.y2)),i({...t,mark:ie(s)?{...s,type:"rule"}:"rule"},n)}}class Mge extends zx{constructor(){super(...arguments);U(this,"nonFacetUnitNormalizers",[Lpe,zpe,Gpe,new Age,new Tge])}map(n,i){if(Ys(n)){const r=pl(n.encoding,Ps),s=pl(n.encoding,zs),o=pl(n.encoding,i1);if(r||s||o)return this.mapFacetedUnit(n,i)}return super.map(n,i)}mapUnit(n,i){const{parentEncoding:r,parentProjection:s}=i,o=jx(n.encoding,i.repeater),a={...n,...n.name?{name:[i.repeaterPrefix,n.name].filter(u=>u).join("_")}:{},...o?{encoding:o}:{}};if(r||s)return this.mapUnitWithParentEncodingOrProjection(a,i);const l=this.mapLayerOrUnit.bind(this);for(const u of this.nonFacetUnitNormalizers)if(u.hasMatchingType(a,i.config))return u.run(a,i,l);return a}mapRepeat(n,i){return mge(n)?this.mapLayerRepeat(n,i):this.mapNonLayerRepeat(n,i)}mapLayerRepeat(n,i){const{repeat:r,spec:s,...o}=n,{row:a,column:l,layer:u}=r,{repeater:c={},repeaterPrefix:f=""}=i;return a||l?this.mapRepeat({...n,repeat:{...a?{row:a}:{},...l?{column:l}:{}},spec:{repeat:{layer:u},spec:s}},i):{...o,layer:u.map(d=>{const h={...c,layer:d},p=`${(s.name?`${s.name}_`:"")+f}child__layer_${Et(d)}`,g=this.mapLayerOrUnit(s,{...i,repeater:h,repeaterPrefix:p});return g.name=p,g})}}mapNonLayerRepeat(n,i){const{repeat:r,spec:s,data:o,...a}=n;!G(r)&&n.columns&&(n=wi(n,["columns"]),K(AD("repeat")));const l=[],{repeater:u={},repeaterPrefix:c=""}=i,f=!G(r)&&r.row||[u?u.row:null],d=!G(r)&&r.column||[u?u.column:null],h=G(r)&&r||[u?u.repeat:null];for(const g of h)for(const m of f)for(const y of d){const b={repeat:g,row:m,column:y,layer:u.layer},v=`${(s.name?`${s.name}_`:"")+c}child__${G(r)?`${Et(g)}`:(r.row?`row_${Et(m)}`:"")+(r.column?`column_${Et(y)}`:"")}`,_=this.map(s,{...i,repeater:b,repeaterPrefix:v});_.name=v,l.push(wi(_,["data"]))}const p=G(r)?n.columns:r.column?r.column.length:1;return{data:s.data??o,align:"all",...a,columns:p,concat:l}}mapFacet(n,i){const{facet:r}=n;return Ud(r)&&n.columns&&(n=wi(n,["columns"]),K(AD("facet"))),super.mapFacet(n,i)}mapUnitWithParentEncodingOrProjection(n,i){const{encoding:r,projection:s}=n,{parentEncoding:o,parentProjection:a,config:l}=i,u=xR({parentProjection:a,projection:s}),c=_R({parentEncoding:o,encoding:jx(r,i.repeater)});return this.mapUnit({...n,...u?{projection:u}:{},...c?{encoding:c}:{}},{config:l})}mapFacetedUnit(n,i){const{row:r,column:s,facet:o,...a}=n.encoding,{mark:l,width:u,projection:c,height:f,view:d,params:h,encoding:p,...g}=n,{facetMapping:m,layout:y}=this.getFacetMappingAndLayout({row:r,column:s,facet:o},i),b=jx(a,i.repeater);return this.mapFacet({...g,...y,facet:m,spec:{...u?{width:u}:{},...f?{height:f}:{},...d?{view:d}:{},...c?{projection:c}:{},mark:l,encoding:b,...h?{params:h}:{}}},i)}getFacetMappingAndLayout(n,i){const{row:r,column:s,facet:o}=n;if(r||s){o&&K(Ode([...r?[Ps]:[],...s?[zs]:[]]));const a={},l={};for(const u of[Ps,zs]){const c=n[u];if(c){const{align:f,center:d,spacing:h,columns:p,...g}=c;a[u]=g;for(const m of["align","center","spacing"])c[m]!==void 0&&(l[m]??(l[m]={}),l[m][u]=c[m])}}return{facetMapping:a,layout:l}}else{const{align:a,center:l,spacing:u,columns:c,...f}=o;return{facetMapping:Fge(f,i.repeater),layout:{...a?{align:a}:{},...l?{center:l}:{},...u?{spacing:u}:{},...c?{columns:c}:{}}}}}mapLayer(n,{parentEncoding:i,parentProjection:r,...s}){const{encoding:o,projection:a,...l}=n,u={...s,parentEncoding:_R({parentEncoding:i,encoding:o,layer:!0}),parentProjection:xR({parentProjection:r,projection:a})};return super.mapLayer({...l,...n.name?{name:[u.repeaterPrefix,n.name].filter(c=>c).join("_")}:{}},u)}}function _R({parentEncoding:e,encoding:t={},layer:n}){let i={};if(e){const r=new Set([...X(e),...X(t)]);for(const s of r){const o=t[s],a=e[s];if(Le(o)){const l={...a,...o};i[s]=l}else Wd(o)?i[s]={...o,condition:{...a,...o.condition}}:o||o===null?i[s]=o:(n||Er(a)||ye(a)||Le(a)||G(a))&&(i[s]=a)}}else i=t;return!i||bt(i)?void 0:i}function xR(e){const{parentProjection:t,projection:n}=e;return t&&n&&K(Ede({parentProjection:t,projection:n})),n??t}function qx(e){return Z(e,"filter")}function Dge(e){return Z(e,"stop")}function wR(e){return Z(e,"lookup")}function Nge(e){return Z(e,"data")}function Rge(e){return Z(e,"param")}function Oge(e){return Z(e,"pivot")}function Lge(e){return Z(e,"density")}function Ige(e){return Z(e,"quantile")}function Pge(e){return Z(e,"regression")}function zge(e){return Z(e,"loess")}function Bge(e){return Z(e,"sample")}function jge(e){return Z(e,"window")}function Uge(e){return Z(e,"joinaggregate")}function qge(e){return Z(e,"flatten")}function Wge(e){return Z(e,"calculate")}function kR(e){return Z(e,"bin")}function Hge(e){return Z(e,"impute")}function Gge(e){return Z(e,"timeUnit")}function Vge(e){return Z(e,"aggregate")}function Yge(e){return Z(e,"stack")}function Xge(e){return Z(e,"fold")}function Zge(e){return Z(e,"extent")&&!Z(e,"density")&&!Z(e,"regression")}function Kge(e){return e.map(t=>qx(t)?{filter:Wu(t.filter,The)}:t)}class Jge extends zx{map(t,n){return n.emptySelections??(n.emptySelections={}),n.selectionPredicates??(n.selectionPredicates={}),t=ER(t,n),super.map(t,n)}mapLayerOrUnit(t,n){if(t=ER(t,n),t.encoding){const i={};for(const[r,s]of Ho(t.encoding))i[r]=$R(s,n);t={...t,encoding:i}}return super.mapLayerOrUnit(t,n)}mapUnit(t,n){const{selection:i,...r}=t;return i?{...r,params:Ho(i).map(([s,o])=>{const{init:a,bind:l,empty:u,...c}=o;c.type==="single"?(c.type="point",c.toggle=!1):c.type==="multi"&&(c.type="point"),n.emptySelections[s]=u!=="none";for(const f of Bt(n.selectionPredicates[s]??{}))f.empty=u!=="none";return{name:s,value:a,select:c,bind:l}})}:t}}function ER(e,t){const{transform:n,...i}=e;if(n){const r=n.map(s=>{if(qx(s))return{filter:Wx(s,t)};if(kR(s)&&il(s.bin))return{...s,bin:SR(s.bin)};if(wR(s)){const{selection:o,...a}=s.from;return o?{...s,from:{param:o,...a}}:s}return s});return{...i,transform:r}}return e}function $R(e,t){var i,r;const n=Ne(e);if(J(n)&&il(n.bin)&&(n.bin=SR(n.bin)),hl(n)&&((r=(i=n.scale)==null?void 0:i.domain)!=null&&r.selection)){const{selection:s,...o}=n.scale.domain;n.scale.domain={...o,...s?{param:s}:{}}}if(qd(n))if(G(n.condition))n.condition=n.condition.map(s=>{const{selection:o,param:a,test:l,...u}=s;return a?s:{...u,test:Wx(s,t)}});else{const{selection:s,param:o,test:a,...l}=$R(n.condition,t);n.condition=o?n.condition:{...l,test:Wx(n.condition,t)}}return n}function SR(e){const t=e.extent;if(t!=null&&t.selection){const{selection:n,...i}=t;return{...e,extent:{...i,param:n}}}return e}function Wx(e,t){const n=i=>Wu(i,r=>{var a;const s=t.emptySelections[r]??!0,o={param:r,empty:s};return(a=t.selectionPredicates)[r]??(a[r]=[]),t.selectionPredicates[r].push(o),o});return e.selection?n(e.selection):Wu(e.test||e.filter,i=>i.selection?n(i.selection):i)}class Hx extends zx{map(t,n){const i=n.selections??[];if(t.params&&!Ys(t)){const r=[];for(const s of t.params)Rx(s)?i.push(s):r.push(s);t.params=r}return n.selections=i,super.map(t,n)}mapUnit(t,n){const i=n.selections;if(!i||!i.length)return t;const r=(n.path??[]).concat(t.name),s=[];for(const o of i)if(!o.views||!o.views.length)s.push(o);else for(const a of o.views)(re(a)&&(a===t.name||r.includes(a))||G(a)&&a.map(l=>r.indexOf(l)).every((l,u,c)=>l!==-1&&(u===0||l>c[u-1])))&&s.push(o);return s.length&&(t.params=s),t}}for(const e of["mapFacet","mapRepeat","mapHConcat","mapVConcat","mapLayer"]){const t=Hx.prototype[e];Hx.prototype[e]=function(n,i){return t.call(this,n,Qge(n,i))}}function Qge(e,t){return e.name?{...t,path:(t.path??[]).concat(e.name)}:t}function CR(e,t){t===void 0&&(t=cR(e.config));const n=i0e(e,t),{width:i,height:r}=e,s=r0e(n,{width:i,height:r,autosize:e.autosize},t);return{...n,...s?{autosize:s}:{}}}const e0e=new Mge,t0e=new Jge,n0e=new Hx;function i0e(e,t={}){const n={config:t};return n0e.map(e0e.map(t0e.map(e,n),n),n)}function AR(e){return re(e)?{type:e}:e??{}}function r0e(e,t,n){let{width:i,height:r}=t;const s=Ys(e)||L1(e),o={};s?i=="container"&&r=="container"?(o.type="fit",o.contains="padding"):i=="container"?(o.type="fit-x",o.contains="padding"):r=="container"&&(o.type="fit-y",o.contains="padding"):(i=="container"&&(K(kD("width")),i=void 0),r=="container"&&(K(kD("height")),r=void 0));const a={type:"pad",...o,...n?AR(n.autosize):{},...AR(e.autosize)};if(a.type==="fit"&&!s&&(K(rde),a.type="pad"),i=="container"&&!(a.type=="fit"||a.type=="fit-x")&&K(ED("width")),r=="container"&&!(a.type=="fit"||a.type=="fit-y")&&K(ED("height")),!ki(a,{type:"pad"}))return a}function s0e(e){return["fit","fit-x","fit-y"].includes(e)}function o0e(e){return e?`fit-${l1(e)}`:"fit"}const a0e=["background","padding"];function FR(e,t){const n={};for(const i of a0e)e&&e[i]!==void 0&&(n[i]=Ei(e[i]));return t&&(n.params=e.params),n}class Zs{constructor(t={},n={}){U(this,"explicit");U(this,"implicit");this.explicit=t,this.implicit=n}clone(){return new Zs(Ne(this.explicit),Ne(this.implicit))}combine(){return{...this.explicit,...this.implicit}}get(t){return Lt(this.explicit[t],this.implicit[t])}getWithExplicit(t){return this.explicit[t]!==void 0?{explicit:!0,value:this.explicit[t]}:this.implicit[t]!==void 0?{explicit:!1,value:this.implicit[t]}:{explicit:!1,value:void 0}}setWithExplicit(t,{value:n,explicit:i}){n!==void 0&&this.set(t,n,i)}set(t,n,i){return delete this[i?"implicit":"explicit"][t],this[i?"explicit":"implicit"][t]=n,this}copyKeyFromSplit(t,{explicit:n,implicit:i}){n[t]!==void 0?this.set(t,n[t],!0):i[t]!==void 0&&this.set(t,i[t],!1)}copyKeyFromObject(t,n){n[t]!==void 0&&this.set(t,n[t],!0)}copyAll(t){for(const n of X(t.combine())){const i=t.getWithExplicit(n);this.setWithExplicit(n,i)}}}function ds(e){return{explicit:!0,value:e}}function $i(e){return{explicit:!1,value:e}}function TR(e){return(t,n,i,r)=>{const s=e(t.value,n.value);return s>0?t:s<0?n:I1(t,n,i,r)}}function I1(e,t,n,i){return e.explicit&&t.explicit&&K(Vde(n,i,e.value,t.value)),e}function ra(e,t,n,i,r=I1){return e===void 0||e.value===void 0?t:e.explicit&&!t.explicit?e:t.explicit&&!e.explicit?t:ki(e.value,t.value)?e:r(e,t,n,i)}class l0e extends Zs{constructor(n={},i={},r=!1){super(n,i);U(this,"explicit");U(this,"implicit");U(this,"parseNothing");this.explicit=n,this.implicit=i,this.parseNothing=r}clone(){const n=super.clone();return n.parseNothing=this.parseNothing,n}}function ac(e){return Z(e,"url")}function Vd(e){return Z(e,"values")}function MR(e){return Z(e,"name")&&!ac(e)&&!Vd(e)&&!sa(e)}function sa(e){return e&&(DR(e)||NR(e)||Gx(e))}function DR(e){return Z(e,"sequence")}function NR(e){return Z(e,"sphere")}function Gx(e){return Z(e,"graticule")}var Ct;(function(e){e[e.Raw=0]="Raw",e[e.Main=1]="Main",e[e.Row=2]="Row",e[e.Column=3]="Column",e[e.Lookup=4]="Lookup",e[e.PreFilterInvalid=5]="PreFilterInvalid",e[e.PostFilterInvalid=6]="PostFilterInvalid"})(Ct||(Ct={}));function RR({invalid:e,isPath:t}){switch(lN(e,{isPath:t})){case"filter":return{marks:"exclude-invalid-values",scales:"exclude-invalid-values"};case"break-paths-show-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"include-invalid-values"};case"break-paths-filter-domains":return{marks:t?"include-invalid-values":"exclude-invalid-values",scales:"exclude-invalid-values"};case"show":return{marks:"include-invalid-values",scales:"include-invalid-values"}}}function u0e(e){const{marks:t,scales:n}=RR(e);return t===n?Ct.Main:n==="include-invalid-values"?Ct.PreFilterInvalid:Ct.PostFilterInvalid}class ct{constructor(t,n){U(this,"debugName");U(this,"_children",[]);U(this,"_parent",null);U(this,"_hash");this.debugName=n,t&&(this.parent=t)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(t){this._parent=t,t&&t.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(t,n){if(this._children.includes(t)){K(xde);return}n!==void 0?this._children.splice(n,0,t):this._children.push(t)}removeChild(t){const n=this._children.indexOf(t);return this._children.splice(n,1),n}remove(){let t=this._parent.removeChild(this);for(const n of this._children)n._parent=this._parent,this._parent.addChild(n,t++)}insertAsParentOf(t){const n=t.parent;n.removeChild(this),this.parent=n,t.parent=this}swapWithParent(){const t=this._parent,n=t.parent;for(const r of this._children)r.parent=t;this._children=[],t.removeChild(this);const i=t.parent.removeChild(t);this._parent=n,n.addChild(this,i),t.parent=this}}class ci extends ct{constructor(n,i,r,s){super(n,i);U(this,"type");U(this,"refCounts");U(this,"_source");U(this,"_name");this.type=r,this.refCounts=s,this._source=this._name=i,this.refCounts&&!(this._name in this.refCounts)&&(this.refCounts[this._name]=0)}clone(){const n=new this.constructor;return n.debugName=`clone_${this.debugName}`,n._source=this._source,n._name=`clone_${this._name}`,n.type=this.type,n.refCounts=this.refCounts,n.refCounts[n._name]=0,n}dependentFields(){return new Set}producedFields(){return new Set}hash(){return this._hash===void 0&&(this._hash=`Output ${XM()}`),this._hash}getSource(){return this.refCounts[this._name]++,this._source}isRequired(){return!!this.refCounts[this._name]}setSource(n){this._source=n}}function Vx(e){return e.as!==void 0}function OR(e){return`${e}_end`}class hs extends ct{constructor(n,i){super(n);U(this,"timeUnits");this.timeUnits=i}clone(){return new hs(null,Ne(this.timeUnits))}static makeFromEncoding(n,i){const r=i.reduceFieldDef((s,o,a)=>{const{field:l,timeUnit:u}=o;if(u){let c;if(ll(u)){if(At(i)){const{mark:f,markDef:d,config:h}=i,p=na({fieldDef:o,markDef:d,config:h});(zd(f)||p)&&(c={timeUnit:nn(u),field:l})}}else c={as:ne(o,{forAs:!0}),field:l,timeUnit:u};if(At(i)){const{mark:f,markDef:d,config:h}=i,p=na({fieldDef:o,markDef:d,config:h});zd(f)&&It(a)&&p!==.5&&(c.rectBandPosition=p)}c&&(s[Ge(c)]=c)}return s},{});return bt(r)?null:new hs(n,r)}static makeFromTransform(n,i){const{timeUnit:r,...s}={...i},o=nn(r),a={...s,timeUnit:o};return new hs(n,{[Ge(a)]:a})}merge(n){this.timeUnits={...this.timeUnits};for(const i in n.timeUnits)this.timeUnits[i]||(this.timeUnits[i]=n.timeUnits[i]);for(const i of n.children)n.removeChild(i),i.parent=this;n.remove()}removeFormulas(n){const i={};for(const[r,s]of Ho(this.timeUnits)){const o=Vx(s)?s.as:`${s.field}_end`;n.has(o)||(i[r]=s)}this.timeUnits=i}producedFields(){return new Set(Bt(this.timeUnits).map(n=>Vx(n)?n.as:OR(n.field)))}dependentFields(){return new Set(Bt(this.timeUnits).map(n=>n.field))}hash(){return`TimeUnit ${Ge(this.timeUnits)}`}assemble(){const n=[];for(const i of Bt(this.timeUnits)){const{rectBandPosition:r}=i,s=nn(i.timeUnit);if(Vx(i)){const{field:o,as:a}=i,{unit:l,utc:u,...c}=s,f=[a,`${a}_end`];n.push({field:qi(o),type:"timeunit",...l?{units:h1(l)}:{},...u?{timezone:"utc"}:{},...c,as:f}),n.push(...IR(f,r,s))}else if(i){const{field:o}=i,a=VM(o),l=LR({timeUnit:s,field:a}),u=OR(a);n.push({type:"formula",expr:l,as:u}),n.push(...IR([a,u],r,s))}}return n}}const P1="offsetted_rect_start",z1="offsetted_rect_end";function LR({timeUnit:e,field:t,reverse:n}){const{unit:i,utc:r}=e,s=qD(i),{part:o,step:a}=VD(s,e.step);return`${r?"utcOffset":"timeOffset"}('${o}', ${ut(t)}, ${n?-a:a})`}function IR([e,t],n,i){if(n!==void 0&&n!==.5){const r=ut(e),s=ut(t);return[{type:"formula",expr:PR([LR({timeUnit:i,field:e,reverse:!0}),r],n+.5),as:`${e}_${P1}`},{type:"formula",expr:PR([r,s],n+.5),as:`${e}_${z1}`}]}return[]}function PR([e,t],n){return`${1-n} * ${e} + ${n} * ${t}`}const Yd="_tuple_fields";class c0e{constructor(...t){U(this,"hasChannel");U(this,"hasField");U(this,"hasSelectionId");U(this,"timeUnit");U(this,"items");this.items=t,this.hasChannel={},this.hasField={},this.hasSelectionId=!1}}const f0e={defined:()=>!0,parse:(e,t,n)=>{const i=t.name,r=t.project??(t.project=new c0e),s={},o={},a=new Set,l=(p,g)=>{const m=g==="visual"?p.channel:p.field;let y=Et(`${i}_${m}`);for(let b=1;a.has(y);b++)y=Et(`${i}_${m}_${b}`);return a.add(y),{[g]:y}},u=t.type,c=e.config.selection[u],f=n.value!==void 0?se(n.value):null;let{fields:d,encodings:h}=ie(n.select)?n.select:{};if(!d&&!h&&f){for(const p of f)if(ie(p))for(const g of X(p))Dfe(g)?(h||(h=[])).push(g):u==="interval"?(K(pde),h=c.encodings):(d??(d=[])).push(g)}!d&&!h&&(h=c.encodings,"fields"in c&&(d=c.fields));for(const p of h??[]){const g=e.fieldDef(p);if(g){let m=g.field;if(g.aggregate){K(sde(p,g.aggregate));continue}else if(!m){K(SD(p));continue}if(g.timeUnit&&!ll(g.timeUnit)){m=e.vgField(p);const y={timeUnit:g.timeUnit,as:m,field:g.field};o[Ge(y)]=y}if(!s[m]){const y=u==="interval"&&ss(p)&&wr(e.getScaleComponent(p).get("type"))?"R":g.bin?"R-RE":"E",b={field:m,channel:p,type:y,index:r.items.length};b.signals={...l(b,"data"),...l(b,"visual")},r.items.push(s[m]=b),r.hasField[m]=s[m],r.hasSelectionId=r.hasSelectionId||m===Sr,nD(p)?(b.geoChannel=p,b.channel=tD(p),r.hasChannel[b.channel]=s[m]):r.hasChannel[p]=s[m]}}else K(SD(p))}for(const p of d??[]){if(r.hasField[p])continue;const g={type:"E",field:p,index:r.items.length};g.signals={...l(g,"data")},r.items.push(g),r.hasField[p]=g,r.hasSelectionId=r.hasSelectionId||p===Sr}f&&(t.init=f.map(p=>r.items.map(g=>ie(p)?p[g.geoChannel||g.channel]!==void 0?p[g.geoChannel||g.channel]:p[g.field]:p))),bt(o)||(r.timeUnit=new hs(null,o))},signals:(e,t,n)=>{const i=t.name+Yd;return n.filter(s=>s.name===i).length>0||t.project.hasSelectionId?n:n.concat({name:i,value:t.project.items.map(UR)})}},zR="_curr",B1="anim_value",lc="anim_clock",Yx="eased_anim_clock",BR="min_extent",jR="max_range_extent",Xx="last_tick_at",Zx="is_playing",d0e=1/60*1e3,h0e=(e,t)=>[{name:Yx,update:lc},{name:`${e}_domain`,init:`domain('${t}')`},{name:BR,init:`extent(${e}_domain)[0]`},{name:jR,init:`extent(range('${t}'))[1]`},{name:B1,update:`invert('${t}', ${Yx})`}],p0e={defined:e=>e.type==="point",topLevelSignals:(e,t,n)=>(ps(t)&&(n=n.concat([{name:lc,init:"0",on:[{events:{type:"timer",throttle:d0e},update:`${Zx} ? (${lc} + (now() - ${Xx}) > ${jR} ? 0 : ${lc} + (now() - ${Xx})) : ${lc}`}]},{name:Xx,init:"now()",on:[{events:[{signal:lc},{signal:Zx}],update:"now()"}]},{name:Zx,init:"true"}])),n),signals:(e,t,n)=>{const i=t.name,r=i+Yd,s=t.project,o="(item().isVoronoi ? datum.datum : datum)",a=Bt(e.component.selection??{}).reduce((c,f)=>f.type==="interval"?c.concat(f.name+uc):c,[]).map(c=>`indexof(item().mark.name, '${c}') < 0`).join(" && "),l=`datum && item().mark.marktype !== 'group' && indexof(item().mark.role, 'legend') < 0${a?` && ${a}`:""}`;let u=`unit: ${yl(e)}, `;if(t.project.hasSelectionId)u+=`${Sr}: ${o}[${ee(Sr)}]`;else if(ps(t))u+=`fields: ${r}, values: [${B1} ? ${B1} : ${BR}]`;else{const c=s.items.map(f=>{const d=e.fieldDef(f.channel);return d!=null&&d.bin?`[${o}[${ee(e.vgField(f.channel,{}))}], ${o}[${ee(e.vgField(f.channel,{binSuffix:"end"}))}]]`:`${o}[${ee(f.field)}]`}).join(", ");u+=`fields: ${r}, values: [${c}]`}if(ps(t))return n.concat(h0e(t.name,e.scaleName(Vo)),[{name:i+Qs,on:[{events:[{signal:Yx},{signal:B1}],update:`{${u}}`,force:!0}]}]);{const c=t.events;return n.concat([{name:i+Qs,on:c?[{events:c,update:`${l} ? {${u}} : null`,force:!0}]:[]}])}}};function UR(e){const{signals:t,hasLegend:n,index:i,...r}=e;return r.field=qi(r.field),r}function gl(e,t=!0,n=vn){if(G(e)){const i=e.map(r=>gl(r,t,n));return t?`[${i.join(", ")}]`:i}else if(ol(e))return n(t?al(e):bhe(e));return t?n(st(e)):e}function g0e(e,t){for(const n of Bt(e.component.selection??{})){const i=n.name;let r=`${i}${Qs}, ${n.resolve==="global"?"true":`{unit: ${yl(e)}}`}`;for(const s of W1)s.defined(n)&&(s.signals&&(t=s.signals(e,n,t)),s.modifyExpr&&(r=s.modifyExpr(e,n,r)));t.push({name:i+U0e,on:[{events:{signal:n.name+Qs},update:`modify(${ee(n.name+ml)}, ${r})`}]})}return Kx(t)}function m0e(e,t){if(e.component.selection&&X(e.component.selection).length){const n=ee(e.getName("cell"));t.unshift({name:"facet",value:{},on:[{events:qo("pointermove","scope"),update:`isTuple(facet) ? facet : group(${n}).datum`}]})}return Kx(t)}function y0e(e,t){let n=!1;for(const i of Bt(e.component.selection??{})){const r=i.name,s=ee(r+ml);if(t.filter(a=>a.name===r).length===0){const a=i.resolve==="global"?"union":i.resolve,l=i.type==="point"?", true, true)":")";t.push({name:i.name,update:`${pO}(${s}, ${ee(a)}${l}`})}n=!0;for(const a of W1)a.defined(i)&&a.topLevelSignals&&(t=a.topLevelSignals(e,i,t))}return n&&t.filter(r=>r.name==="unit").length===0&&t.unshift({name:"unit",value:{},on:[{events:"pointermove",update:"isTuple(group()) ? group() : unit"}]}),Kx(t)}function b0e(e,t){const n=[],i=[],r=yl(e,{escape:!1});for(const s of Bt(e.component.selection??{})){const o={name:s.name+ml};if(s.project.hasSelectionId&&(o.transform=[{type:"collect",sort:{field:Sr}}]),s.init){const l=s.project.items.map(UR);o.values=s.project.hasSelectionId?s.init.map(u=>({unit:r,[Sr]:gl(u,!1)[0]})):s.init.map(u=>({unit:r,fields:l,values:gl(u,!1)}))}if([...n,...t].filter(l=>l.name===s.name+ml).length||n.push(o),ps(s)&&t.length){const l=e.lookupDataSource(e.getDataName(Ct.Main)),u=t.find(f=>f.name===l),c=u.transform.find(f=>f.type==="filter"&&f.expr.includes("vlSelectionTest"));if(c){u.transform=u.transform.filter(d=>d!==c);const f={name:u.name+zR,source:u.name,transform:[c]};i.push(f)}}}return n.concat(t,i)}function qR(e,t){for(const n of Bt(e.component.selection??{}))for(const i of W1)i.defined(n)&&i.marks&&(t=i.marks(e,n,t));return t}function v0e(e,t){for(const n of e.children)At(n)&&(t=qR(n,t));return t}function _0e(e,t,n,i){const r=vO(e,t.param,t);return{signal:wr(n.get("type"))&&G(i)&&i[0]>i[1]?`isValid(${r}) && reverse(${r})`:r}}function Kx(e){return e.map(t=>(t.on&&!t.on.length&&delete t.on,t))}const Ks={defined:e=>e.type==="interval"&&e.resolve==="global"&&e.bind&&e.bind==="scales",parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){const r=i.channel;if(!ss(r))continue;const s=e.getScaleComponent(r),o=s?s.get("type"):void 0;if(o=="sequential"&&K(ude),!s||!wr(o)){K(lde);continue}s.set("selectionExtent",{param:t.name,field:i.field},!0),n.push(i)}},topLevelSignals:(e,t,n)=>{const i=t.scales.filter(o=>n.filter(a=>a.name===o.signals.data).length===0);if(!e.parent||Qx(e)||i.length===0)return n;const r=n.find(o=>o.name===t.name);let s=r.update;if(s.includes(pO))r.update=`{${i.map(o=>`${ee(qi(o.field))}: ${o.signals.data}`).join(", ")}}`;else{for(const o of i){const a=`${ee(qi(o.field))}: ${o.signals.data}`;s.includes(a)||(s=`${s.substring(0,s.length-1)}, ${a}}`)}r.update=s}return n.concat(i.map(o=>({name:o.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!Qx(e))for(const i of t.scales){const r=n.find(s=>s.name===i.signals.data);r.push="outer",delete r.value,delete r.update}return n}};function Jx(e,t){return`domain(${ee(e.scaleName(t))})`}function Qx(e){return e.parent&&vc(e.parent)&&(!e.parent.parent||Qx(e.parent.parent))}const uc="_brush",WR="_scale_trigger",Xd="geo_interval_init_tick",HR="_init",x0e="_center",w0e={defined:e=>e.type==="interval",parse:(e,t,n)=>{var i;if(e.hasProjection){const r={...ie(n.select)?n.select:{}};r.fields=[Sr],r.encodings||(r.encodings=n.value?X(n.value):[vr,br]),n.select={type:"interval",...r}}if(t.translate&&!Ks.defined(t)){const r=`!event.item || event.item.mark.name !== ${ee(t.name+uc)}`;for(const s of t.events){if(!s.between){K(`${s} is not an ordered event stream for interval selections.`);continue}const o=se((i=s.between[0]).filter??(i.filter=[]));o.includes(r)||o.push(r)}}},signals:(e,t,n)=>{const i=t.name,r=i+Qs,s=Bt(t.project.hasChannel).filter(a=>a.channel===$t||a.channel===tn),o=t.init?t.init[0]:null;if(n.push(...s.reduce((a,l)=>a.concat(k0e(e,t,l,o==null?void 0:o[l.index])),[])),e.hasProjection){const a=ee(e.projectionName()),l=e.projectionName()+x0e,{x:u,y:c}=t.project.hasChannel,f=u==null?void 0:u.signals.visual,d=c==null?void 0:c.signals.visual,h=u?o==null?void 0:o[u.index]:`${l}[0]`,p=c?o==null?void 0:o[c.index]:`${l}[1]`,g=x=>e.getSizeSignalRef(x).signal,m=`[[${f?`${f}[0]`:"0"}, ${d?`${d}[0]`:"0"}],[${f?`${f}[1]`:g("width")}, ${d?`${d}[1]`:g("height")}]]`;o&&(n.unshift({name:i+HR,init:`[scale(${a}, [${u?h[0]:h}, ${c?p[0]:p}]), scale(${a}, [${u?h[1]:h}, ${c?p[1]:p}])]`}),(!u||!c)&&(n.find(k=>k.name===l)||n.unshift({name:l,update:`invert(${a}, [${g("width")}/2, ${g("height")}/2])`})));const y=`intersect(${m}, {markname: ${ee(e.getName("marks"))}}, unit.mark)`,b=`{unit: ${yl(e)}}`,v=`vlSelectionTuples(${y}, ${b})`,_=s.map(x=>x.signals.visual);return n.concat({name:r,on:[{events:[..._.length?[{signal:_.join(" || ")}]:[],...o?[{signal:Xd}]:[]],update:v}]})}else{if(!Ks.defined(t)){const u=i+WR,c=s.map(f=>{const d=f.channel,{data:h,visual:p}=f.signals,g=ee(e.scaleName(d)),m=e.getScaleComponent(d).get("type"),y=wr(m)?"+":"";return`(!isArray(${h}) || (${y}invert(${g}, ${p})[0] === ${y}${h}[0] && ${y}invert(${g}, ${p})[1] === ${y}${h}[1]))`});c.length&&n.push({name:u,value:{},on:[{events:s.map(f=>({scale:e.scaleName(f.channel)})),update:`${c.join(" && ")} ? ${u} : {}`}]})}const a=s.map(u=>u.signals.data),l=`unit: ${yl(e)}, fields: ${i+Yd}, values`;return n.concat({name:r,...o?{init:`{${l}: ${gl(o)}}`}:{},...a.length?{on:[{events:[{signal:a.join(" || ")}],update:`${a.join(" && ")} ? {${l}: [${a}]} : null`}]}:{}})}},topLevelSignals:(e,t,n)=>(At(e)&&e.hasProjection&&t.init&&(n.filter(r=>r.name===Xd).length||n.unshift({name:Xd,value:null,on:[{events:"timer{1}",update:`${Xd} === null ? {} : ${Xd}`}]})),n),marks:(e,t,n)=>{const i=t.name,{x:r,y:s}=t.project.hasChannel,o=r==null?void 0:r.signals.visual,a=s==null?void 0:s.signals.visual,l=`data(${ee(t.name+ml)})`;if(Ks.defined(t)||!r&&!s)return n;const u={x:r!==void 0?{signal:`${o}[0]`}:{value:0},y:s!==void 0?{signal:`${a}[0]`}:{value:0},x2:r!==void 0?{signal:`${o}[1]`}:{field:{group:"width"}},y2:s!==void 0?{signal:`${a}[1]`}:{field:{group:"height"}}};if(t.resolve==="global")for(const m of X(u))u[m]=[{test:`${l}.length && ${l}[0].unit === ${yl(e)}`,...u[m]},{value:0}];const{fill:c,fillOpacity:f,cursor:d,...h}=t.mark,p=X(h).reduce((m,y)=>(m[y]=[{test:[r!==void 0&&`${o}[0] !== ${o}[1]`,s!==void 0&&`${a}[0] !== ${a}[1]`].filter(b=>b).join(" && "),value:h[y]},{value:null}],m),{}),g=d??(t.translate?"move":null);return[{name:`${i+uc}_bg`,type:"rect",clip:!0,encode:{enter:{fill:{value:c},fillOpacity:{value:f}},update:u}},...n,{name:i+uc,type:"rect",clip:!0,encode:{enter:{...g?{cursor:{value:g}}:{},fill:{value:"transparent"}},update:{...u,...p}}}]}};function k0e(e,t,n,i){const r=!e.hasProjection,s=n.channel,o=n.signals.visual,a=ee(r?e.scaleName(s):e.projectionName()),l=d=>`scale(${a}, ${d})`,u=e.getSizeSignalRef(s===$t?"width":"height").signal,c=`${s}(unit)`,f=t.events.reduce((d,h)=>[...d,{events:h.between[0],update:`[${c}, ${c}]`},{events:h,update:`[${o}[0], clamp(${c}, 0, ${u})]`}],[]);if(r){const d=n.signals.data,h=Ks.defined(t),p=e.getScaleComponent(s),g=p?p.get("type"):void 0,m=i?{init:gl(i,!0,l)}:{value:[]};return f.push({events:{signal:t.name+WR},update:wr(g)?`[${l(`${d}[0]`)}, ${l(`${d}[1]`)}]`:"[0, 0]"}),h?[{name:d,on:[]}]:[{name:o,...m,on:f},{name:d,...i?{init:gl(i)}:{},on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${a}, ${o})`}]}]}else{const d=s===$t?0:1,h=t.name+HR,p=i?{init:`[${h}[0][${d}], ${h}[1][${d}]]`}:{value:[]};return[{name:o,...p,on:f}]}}function cc({model:e,channelDef:t,vgChannel:n,invalidValueRef:i,mainRefFn:r}){const s=qd(t)&&t.condition;let o=[];s&&(o=se(s).map(u=>{const c=r(u);if(ppe(u)){const{param:f,empty:d}=u;return{test:bO(e,{param:f,empty:d}),...c}}else return{test:H1(e,u.test),...c}})),i!==void 0&&o.push(i);const a=r(t);return a!==void 0&&o.push(a),o.length>1||o.length===1&&o[0].test?{[n]:o}:o.length===1?{[n]:o[0]}:{}}function ew(e,t="text"){const n=e.encoding[t];return cc({model:e,channelDef:n,vgChannel:t,mainRefFn:i=>tw(i,e.config),invalidValueRef:void 0})}function tw(e,t,n="datum"){if(e){if(Er(e))return xt(e.value);if(Le(e)){const{format:i,formatType:r}=S1(e);return bx({fieldOrDatumDef:e,format:i,formatType:r,expr:n,config:t})}}}function GR(e,t={}){const{encoding:n,markDef:i,config:r,stack:s}=e,o=n.tooltip;if(G(o))return{tooltip:YR({tooltip:o},s,r,t)};{const a=t.reactiveGeom?"datum.datum":"datum";return cc({model:e,channelDef:o,vgChannel:"tooltip",mainRefFn:u=>{const c=XR(u,r,a);if(c)return c;if(u===null)return;let f=ot("tooltip",i,r);if(f===!0&&(f={content:"encoding"}),re(f))return{value:f};if(ie(f))return ye(f)?f:f.content==="encoding"?YR(n,s,r,t):{signal:a}},invalidValueRef:void 0})}}function VR(e,t,n,{reactiveGeom:i}={}){const r={...n,...n.tooltipFormat},s=new Set,o=i?"datum.datum":"datum",a=[];function l(c,f){const d=nl(f),h=Xn(c)?c:{...c,type:e[d].type},p=h.title||kx(h,r),g=se(p).join(", ").replaceAll(/"/g,'\\"');let m;if(It(f)){const y=f==="x"?"x2":"y2",b=$r(e[y]);if(dn(h.bin)&&b){const v=ne(h,{expr:o}),_=ne(b,{expr:o}),{format:x,formatType:k}=S1(h);m=jd(v,_,x,k,r),s.add(y)}}if((It(f)||f===Wi||f===yr)&&t&&t.fieldChannel===f&&t.offset==="normalize"){const{format:y,formatType:b}=S1(h);m=bx({fieldOrDatumDef:h,format:y,formatType:b,expr:o,config:r,normalizeStack:!0}).signal}m??(m=XR(h,r,o).signal),a.push({channel:f,key:g,value:m})}$x(e,(c,f)=>{J(c)?l(c,f):k1(c)&&l(c.condition,f)});const u={};for(const{channel:c,key:f,value:d}of a)!s.has(c)&&!u[f]&&(u[f]=d);return u}function YR(e,t,n,{reactiveGeom:i}={}){const r=VR(e,t,n,{reactiveGeom:i}),s=Ho(r).map(([o,a])=>`"${o}": ${a}`);return s.length>0?{signal:`{${s.join(", ")}}`}:void 0}function XR(e,t,n="datum"){if(J(e)&&sx(e.type)&&!Z(e,"format")){const i=`datum["${e.field}"]`;return{signal:`isValid(${i}) ? isArray(${i}) ? join(${i}, '\\n') : ${i} : ""+${i}`}}return tw(e,t,n)}function E0e(e){const{markDef:t,config:n}=e,i=ot("aria",t,n);return i===!1?{}:{...i?{aria:i}:{},...$0e(e),...S0e(e)}}function $0e(e){const{mark:t,markDef:n,config:i}=e;if(i.aria===!1)return{};const r=ot("ariaRoleDescription",n,i);return r!=null?{ariaRoleDescription:{value:r}}:le(ede,t)?{}:{ariaRoleDescription:{value:t}}}function S0e(e){const{encoding:t,markDef:n,config:i,stack:r}=e,s=t.description;if(s)return cc({model:e,channelDef:s,vgChannel:"description",mainRefFn:l=>tw(l,e.config),invalidValueRef:void 0});const o=ot("description",n,i);if(o!=null)return{description:xt(o)};if(i.aria===!1)return{};const a=VR(t,r,i);if(!bt(a))return{description:{signal:Ho(a).filter(([l])=>!l.startsWith("_")).map(([l,u])=>[l,u.replaceAll("\\n"," ")]).map(([l,u],c)=>`"${c>0?"; ":""}${l}: " + (${u})`).join(" + ")}}}function gn(e,t,n={}){const{markDef:i,encoding:r,config:s}=t,{vgChannel:o}=n;let{defaultRef:a,defaultValue:l}=n;const u=r[e];a===void 0&&(l??(l=ot(e,i,s,{vgChannel:o,ignoreVgConfig:!qd(u)})),l!==void 0&&(a=xt(l)));const c={markDef:i,config:s,scaleName:t.scaleName(e),scale:t.getScaleComponent(e)},f=cN({...c,scaleChannel:e,channelDef:u});return cc({model:t,channelDef:u,vgChannel:o??e,invalidValueRef:f,mainRefFn:h=>yx({...c,channel:e,channelDef:h,stack:null,defaultRef:a})})}function ZR(e,t={filled:void 0}){const{markDef:n,encoding:i,config:r}=e,{type:s}=n,o=t.filled??ot("filled",n,r),a=We(["bar","point","circle","square","geoshape"],s)?"transparent":void 0,l=ot(o===!0?"color":void 0,n,r,{vgChannel:"fill"})??r.mark[o===!0&&"color"]??a,u=ot(o===!1?"color":void 0,n,r,{vgChannel:"stroke"})??r.mark[o===!1&&"color"],c=o?"fill":"stroke",f={...l?{fill:xt(l)}:{},...u?{stroke:xt(u)}:{}};return n.color&&(o?n.fill:n.stroke)&&K(DD("property",{fill:"fill"in n,stroke:"stroke"in n})),{...f,...gn("color",e,{vgChannel:c,defaultValue:o?l:u}),...gn("fill",e,{defaultValue:i.fill?l:void 0}),...gn("stroke",e,{defaultValue:i.stroke?u:void 0})}}function C0e(e){const{encoding:t,mark:n}=e,i=t.order;return!ta(n)&&Er(i)?cc({model:e,channelDef:i,vgChannel:"zindex",mainRefFn:r=>xt(r.value),invalidValueRef:void 0}):{}}function fc({channel:e,markDef:t,encoding:n={},model:i,bandPosition:r}){const s=`${e}Offset`,o=t[s],a=n[s];if((s==="xOffset"||s==="yOffset")&&a)return{offsetType:"encoding",offset:yx({channel:s,channelDef:a,markDef:t,config:i==null?void 0:i.config,scaleName:i.scaleName(s),scale:i.getScaleComponent(s),stack:null,defaultRef:xt(o),bandPosition:r})};const l=t[s];return l?{offsetType:"visual",offset:l}:{}}function Zn(e,t,{defaultPos:n,vgChannel:i}){const{encoding:r,markDef:s,config:o,stack:a}=t,l=r[e],u=r[rs(e)],c=t.scaleName(e),f=t.getScaleComponent(e),{offset:d,offsetType:h}=fc({channel:e,markDef:s,encoding:r,model:t,bandPosition:.5}),p=nw({model:t,defaultPos:n,channel:e,scaleName:c,scale:f}),g=!l&&It(e)&&(r.latitude||r.longitude)?{field:t.getName(e)}:A0e({channel:e,channelDef:l,channel2Def:u,markDef:s,config:o,scaleName:c,scale:f,stack:a,offset:d,defaultRef:p,bandPosition:h==="encoding"?0:void 0});return g?{[i||e]:g}:void 0}function A0e(e){const{channel:t,channelDef:n,scaleName:i,stack:r,offset:s,markDef:o}=e;if(Le(n)&&r&&t===r.fieldChannel){if(J(n)){let a=n.bandPosition;if(a===void 0&&o.type==="text"&&(t==="radius"||t==="theta")&&(a=.5),a!==void 0)return _1({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",bandPosition:a,offset:s})}return fl(n,i,{suffix:"end"},{offset:s})}return mx(e)}function nw({model:e,defaultPos:t,channel:n,scaleName:i,scale:r}){const{markDef:s,config:o}=e;return()=>{const a=nl(n),l=Jo(n),u=ot(n,s,o,{vgChannel:l});if(u!==void 0)return Bd(n,u);switch(t){case"zeroOrMin":return KR({scaleName:i,scale:r,mode:"zeroOrMin",mainChannel:a,config:o});case"zeroOrMax":return KR({scaleName:i,scale:r,mode:{zeroOrMax:{widthSignal:e.width.signal,heightSignal:e.height.signal}},mainChannel:a,config:o});case"mid":return{...e[ui(n)],mult:.5}}}}function KR({mainChannel:e,config:t,...n}){const i=uN(n),{mode:r}=n;if(i)return i;switch(e){case"radius":{if(r==="zeroOrMin")return{value:0};const{widthSignal:s,heightSignal:o}=r.zeroOrMax;return{signal:`min(${s},${o})/2`}}case"theta":return r==="zeroOrMin"?{value:0}:{signal:"2*PI"};case"x":return r==="zeroOrMin"?{value:0}:{field:{group:"width"}};case"y":return r==="zeroOrMin"?{field:{group:"height"}}:{value:0}}}const F0e={left:"x",center:"xc",right:"x2"},T0e={top:"y",middle:"yc",bottom:"y2"};function JR(e,t,n,i="middle"){if(e==="radius"||e==="theta")return Jo(e);const r=e==="x"?"align":"baseline",s=ot(r,t,n);let o;return ye(s)?(K(Lde(r)),o=void 0):o=s,e==="x"?F0e[o||(i==="top"?"left":"center")]:T0e[o||i]}function j1(e,t,{defaultPos:n,defaultPos2:i,range:r}){return r?QR(e,t,{defaultPos:n,defaultPos2:i}):Zn(e,t,{defaultPos:n})}function QR(e,t,{defaultPos:n,defaultPos2:i}){const{markDef:r,config:s}=t,o=rs(e),a=ui(e),l=M0e(t,i,o),u=l[a]?JR(e,r,s):Jo(e);return{...Zn(e,t,{defaultPos:n,vgChannel:u}),...l}}function M0e(e,t,n){const{encoding:i,mark:r,markDef:s,stack:o,config:a}=e,l=nl(n),u=ui(n),c=Jo(n),f=i[l],d=e.scaleName(l),h=e.getScaleComponent(l),{offset:p}=n in i||n in s?fc({channel:n,markDef:s,encoding:i,model:e}):fc({channel:l,markDef:s,encoding:i,model:e});if(!f&&(n==="x2"||n==="y2")&&(i.latitude||i.longitude)){const m=ui(n),y=e.markDef[m];return y!=null?{[m]:{value:y}}:{[c]:{field:e.getName(n)}}}const g=D0e({channel:n,channelDef:f,channel2Def:i[n],markDef:s,config:a,scaleName:d,scale:h,stack:o,offset:p,defaultRef:void 0});return g!==void 0?{[c]:g}:U1(n,s)||U1(n,{[n]:U7(n,s,a.style),[u]:U7(u,s,a.style)})||U1(n,a[r])||U1(n,a.mark)||{[c]:nw({model:e,defaultPos:t,channel:n,scaleName:d,scale:h})()}}function D0e({channel:e,channelDef:t,channel2Def:n,markDef:i,config:r,scaleName:s,scale:o,stack:a,offset:l,defaultRef:u}){return Le(t)&&a&&e.charAt(0)===a.fieldChannel.charAt(0)?fl(t,s,{suffix:"start"},{offset:l}):mx({channel:e,channelDef:n,scaleName:s,scale:o,stack:a,markDef:i,config:r,offset:l,defaultRef:u})}function U1(e,t){const n=ui(e),i=Jo(e);if(t[i]!==void 0)return{[i]:Bd(e,t[i])};if(t[e]!==void 0)return{[i]:Bd(e,t[e])};if(t[n]){const r=t[n];if(cl(r))K(Tde(n));else return{[n]:Bd(e,r)}}}function Js(e,t){const{config:n,encoding:i,markDef:r}=e,s=r.type,o=rs(t),a=ui(t),l=i[t],u=i[o],c=e.getScaleComponent(t),f=c?c.get("type"):void 0,d=r.orient,h=i[a]??i.size??ot("size",r,n,{vgChannel:a}),p=oD(t),g=s==="bar"&&(t==="x"?d==="vertical":d==="horizontal")||s==="tick"&&(t==="y"?d==="vertical":d==="horizontal");return J(l)&&(vt(l.bin)||dn(l.bin)||l.timeUnit&&!u)&&!(h&&!cl(h))&&!i[p]&&!rn(f)?O0e({fieldDef:l,fieldDef2:u,channel:t,model:e}):(Le(l)&&rn(f)||g)&&!u?R0e(l,t,e):QR(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"})}function N0e(e,t,n,i,r,s,o){if(cl(r))if(n){const l=n.get("type");if(l==="band"){let u=`bandwidth('${t}')`;r.band!==1&&(u=`${r.band} * ${u}`);const c=os("minBandSize",{type:o},i);return{signal:c?`max(${xr(c)}, ${u})`:u}}else r.band!==1&&(K(Bde(l)),r=void 0)}else return{mult:r.band,field:{group:e}};else{if(ye(r))return r;if(r)return{value:r}}if(n){const l=n.get("range");if(rl(l)&&Ke(l.step))return{value:l.step-2}}if(!s){const{bandPaddingInner:l,barBandPaddingInner:u,rectBandPaddingInner:c,tickBandPaddingInner:f}=i.scale,d=Lt(l,o==="tick"?f:o==="bar"?u:c);if(ye(d))return{signal:`(1 - (${d.signal})) * ${e}`};if(Ke(d))return{signal:`${1-d} * ${e}`}}return{value:Px(i.view,e)-2}}function R0e(e,t,n){var $,F;const{markDef:i,encoding:r,config:s,stack:o}=n,a=i.orient,l=n.scaleName(t),u=n.getScaleComponent(t),c=ui(t),f=rs(t),d=oD(t),h=n.scaleName(d),p=n.getScaleComponent(N7(t)),g=i.type==="tick"||a==="horizontal"&&t==="y"||a==="vertical"&&t==="x";let m;(r.size||i.size)&&(g?m=gn("size",n,{vgChannel:c,defaultRef:xt(i.size)}):K(Wde(i.type)));const y=!!m,b=_N({channel:t,fieldDef:e,markDef:i,config:s,scaleType:($=u||p)==null?void 0:$.get("type"),useVlSizeChannel:g});m=m||{[c]:N0e(c,h||l,p||u,s,b,!!e,i.type)};const v=((F=u||p)==null?void 0:F.get("type"))==="band"&&cl(b)&&!y?"top":"middle",_=JR(t,i,s,v),x=_==="xc"||_==="yc",{offset:k,offsetType:w}=fc({channel:t,markDef:i,encoding:r,model:n,bandPosition:x?.5:0}),E=mx({channel:t,channelDef:e,markDef:i,config:s,scaleName:l,scale:u,stack:o,offset:k,defaultRef:nw({model:n,defaultPos:"mid",channel:t,scaleName:l,scale:u}),bandPosition:x?w==="encoding"?0:.5:ye(b)?{signal:`(1-${b})/2`}:cl(b)?(1-b.band)/2:0});if(c)return{[_]:E,...m};{const A=Jo(f),z=m[c],P=k?{...z,offset:k}:z;return{[_]:E,[A]:G(E)?[E[0],{...E[1],offset:P}]:{...E,offset:P}}}}function eO(e,t,n,i,r,s,o){if(eD(e))return 0;const a=e==="x"||e==="y2",l=a?-t/2:t/2;if(ye(n)||ye(r)||ye(i)||s){const u=xr(n),c=xr(r),f=xr(i),d=xr(s),p=s?`(${o} < ${d} ? ${a?"":"-"}0.5 * (${d} - (${o})) : ${l})`:l,g=f?`${f} + `:"",m=u?`(${u} ? -1 : 1) * `:"",y=c?`(${c} + ${p})`:p;return{signal:g+m+y}}else return r=r||0,i+(n?-r-l:+r+l)}function O0e({fieldDef:e,fieldDef2:t,channel:n,model:i}){var F;const{config:r,markDef:s,encoding:o}=i,a=i.getScaleComponent(n),l=i.scaleName(n),u=a?a.get("type"):void 0,c=a.get("reverse"),f=_N({channel:n,fieldDef:e,markDef:s,config:r,scaleType:u}),d=(F=i.component.axes[n])==null?void 0:F[0],h=(d==null?void 0:d.get("translate"))??.5,p=It(n)?ot("binSpacing",s,r)??0:0,g=rs(n),m=Jo(n),y=Jo(g),b=os("minBandSize",s,r),{offset:v}=fc({channel:n,markDef:s,encoding:o,model:i,bandPosition:0}),{offset:_}=fc({channel:g,markDef:s,encoding:o,model:i,bandPosition:0}),x=upe({fieldDef:e,scaleName:l}),k=eO(n,p,c,h,v,b,x),w=eO(g,p,c,h,_??v,b,x),E=ye(f)?{signal:`(1-${f.signal})/2`}:cl(f)?(1-f.band)/2:.5,$=na({fieldDef:e,fieldDef2:t,markDef:s,config:r});if(vt(e.bin)||e.timeUnit){const A=e.timeUnit&&$!==.5;return{[y]:tO({fieldDef:e,scaleName:l,bandPosition:E,offset:w,useRectOffsetField:A}),[m]:tO({fieldDef:e,scaleName:l,bandPosition:ye(E)?{signal:`1-${E.signal}`}:1-E,offset:k,useRectOffsetField:A})}}else if(dn(e.bin)){const A=fl(e,l,{},{offset:w});if(J(t))return{[y]:A,[m]:fl(t,l,{},{offset:k})};if(il(e.bin)&&e.bin.step)return{[y]:A,[m]:{signal:`scale("${l}", ${ne(e,{expr:"datum"})} + ${e.bin.step})`,offset:k}}}K(ID(g))}function tO({fieldDef:e,scaleName:t,bandPosition:n,offset:i,useRectOffsetField:r}){return _1({scaleName:t,fieldOrDatumDef:e,bandPosition:n,offset:i,...r?{startSuffix:P1,endSuffix:z1}:{}})}const L0e=new Set(["aria","width","height"]);function Vi(e,t){const{fill:n=void 0,stroke:i=void 0}=t.color==="include"?ZR(e):{};return{...I0e(e.markDef,t),...nO("fill",n),...nO("stroke",i),...gn("opacity",e),...gn("fillOpacity",e),...gn("strokeOpacity",e),...gn("strokeWidth",e),...gn("strokeDash",e),...C0e(e),...GR(e),...ew(e,"href"),...E0e(e)}}function nO(e,t){return t?{[e]:t}:{}}function I0e(e,t){return Qfe.reduce((n,i)=>(!L0e.has(i)&&Z(e,i)&&t[i]!=="ignore"&&(n[i]=xt(e[i])),n),{})}function iw(e){const{config:t,markDef:n}=e,i=new Set;if(e.forEachFieldDef((r,s)=>{var u;let o;if(!ss(s)||!(o=e.getScaleType(s)))return;const a=u1(r.aggregate),l=gx({scaleChannel:s,markDef:n,config:t,scaleType:o,isCountAggregate:a});if(ope(l)){const c=e.vgField(s,{expr:"datum",binSuffix:(u=e.stack)!=null&&u.impute?"mid":void 0});c&&i.add(c)}}),i.size>0)return{defined:{signal:[...i].map(s=>p1(s,!0)).join(" && ")}}}function iO(e,t){if(t!==void 0)return{[e]:xt(t)}}const rw="voronoi",rO={defined:e=>e.type==="point"&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(rw)},marks:(e,t,n)=>{const{x:i,y:r}=t.project.hasChannel,s=e.mark;if(ta(s))return K(ode(s)),n;const o={name:e.getName(rw),type:"path",interactive:!0,aria:!1,from:{data:e.getName("marks")},encode:{update:{fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0},...GR(e,{reactiveGeom:!0})}},transform:[{type:"voronoi",x:{expr:i||!r?"datum.datum.x || 0":"0"},y:{expr:r||!i?"datum.datum.y || 0":"0"},size:[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]}]};let a=0,l=!1;return n.forEach((u,c)=>{const f=u.name??"";f===e.component.mark[0].name?a=c:f.includes(rw)&&(l=!0)}),l||n.splice(a+1,0,o),n}},sO={defined:e=>e.type==="point"&&e.resolve==="global"&&e.bind&&e.bind!=="scales"&&!Dx(e.bind),parse:(e,t,n)=>gO(t,n),topLevelSignals:(e,t,n)=>{var l;const i=t.name,r=t.project,s=t.bind,o=(l=t.init)==null?void 0:l[0],a=rO.defined(t)?"(item().isVoronoi ? datum.datum : datum)":"datum";return r.items.forEach((u,c)=>{const f=Et(`${i}_${u.field}`);n.filter(h=>h.name===f).length||n.unshift({name:f,...o?{init:gl(o[c])}:{value:null},on:t.events?[{events:t.events,update:`datum && item().mark.marktype !== 'group' ? ${a}[${ee(u.field)}] : null`}]:[],bind:s[u.field]??s[u.channel]??s})}),n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(u=>u.name===i+Qs),o=i+Yd,a=r.items.map(u=>Et(`${i}_${u.field}`)),l=a.map(u=>`${u} !== null`).join(" && ");return a.length&&(s.update=`${l} ? {fields: ${o}, values: [${a.join(", ")}]} : null`),delete s.value,delete s.on,n}},q1="_toggle",oO={defined:e=>e.type==="point"&&!ps(e)&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+q1,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{const n=t.name+Qs,i=t.name+q1;return`${i} ? null : ${n}, ${t.resolve==="global"?`${i} ? null : true, `:`${i} ? null : {unit: ${yl(e)}}, `}${i} ? ${n} : null`}},P0e={defined:e=>e.clear!==void 0&&e.clear!==!1&&!ps(e),parse:(e,t)=>{t.clear&&(t.clear=re(t.clear)?qo(t.clear,"view"):t.clear)},topLevelSignals:(e,t,n)=>{if(sO.defined(t))for(const i of t.project.items){const r=n.findIndex(s=>s.name===Et(`${t.name}_${i.field}`));r!==-1&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,t,n)=>{function i(r,s){r!==-1&&n[r].on&&n[r].on.push({events:t.clear,update:s})}if(t.type==="interval")for(const r of t.project.items){const s=n.findIndex(o=>o.name===r.signals.visual);if(i(s,"[0, 0]"),s===-1){const o=n.findIndex(a=>a.name===r.signals.data);i(o,"null")}}else{let r=n.findIndex(s=>s.name===t.name+Qs);i(r,"null"),oO.defined(t)&&(r=n.findIndex(s=>s.name===t.name+q1),i(r,"false"))}return n}},aO={defined:e=>{const t=e.resolve==="global"&&e.bind&&Dx(e.bind),n=e.project.items.length===1&&e.project.items[0].field!==Sr;return t&&!n&&K(cde),t&&n},parse:(e,t,n)=>{const i=Ne(n);if(i.select=re(i.select)?{type:i.select,toggle:t.toggle}:{...i.select,toggle:t.toggle},gO(t,i),ie(n.select)&&(n.select.on||n.select.clear)){const o='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=se(a.filter??[]),a.filter.includes(o)||a.filter.push(o)}const r=Nx(t.bind)?t.bind.legend:"click",s=re(r)?qo(r,"view"):se(r);t.bind={legend:{merge:s}}},topLevelSignals:(e,t,n)=>{const i=t.name,r=Nx(t.bind)&&t.bind.legend,s=o=>a=>{const l=Ne(a);return l.markname=o,l};for(const o of t.project.items){if(!o.hasLegend)continue;const a=`${Et(o.field)}_legend`,l=`${i}_${a}`;if(n.filter(c=>c.name===l).length===0){const c=r.merge.map(s(`${a}_symbols`)).concat(r.merge.map(s(`${a}_labels`))).concat(r.merge.map(s(`${a}_entries`)));n.unshift({name:l,...t.init?{}:{value:null},on:[{events:c,update:"isDefined(datum.value) ? datum.value : item().items[0].items[0].datum.value",force:!0},{events:r.merge,update:`!event.item || !datum ? null : ${l}`,force:!0}]})}}return n},signals:(e,t,n)=>{const i=t.name,r=t.project,s=n.find(d=>d.name===i+Qs),o=i+Yd,a=r.items.filter(d=>d.hasLegend).map(d=>Et(`${i}_${Et(d.field)}_legend`)),u=`${a.map(d=>`${d} !== null`).join(" && ")} ? {fields: ${o}, values: [${a.join(", ")}]} : null`;t.events&&a.length>0?s.on.push({events:a.map(d=>({signal:d})),update:u}):a.length>0&&(s.update=u,delete s.value,delete s.on);const c=n.find(d=>d.name===i+q1),f=Nx(t.bind)&&t.bind.legend;return c&&(t.events?c.on.push({...c.on[0],events:f}):c.on[0].events=f),n}};function z0e(e,t,n){var r;const i=(r=e.fieldDef(t))==null?void 0:r.field;for(const s of Bt(e.component.selection??{})){const o=s.project.hasField[i]??s.project.hasChannel[t];if(o&&aO.defined(s)){const a=n.get("selections")??[];a.push(s.name),n.set("selections",a,!1),o.hasLegend=!0}}}const lO="_translate_anchor",uO="_translate_delta",B0e={defined:e=>e.type==="interval"&&e.translate,signals:(e,t,n)=>{const i=t.name,r=Ks.defined(t),s=i+lO,{x:o,y:a}=t.project.hasChannel;let l=qo(t.translate,"scope");return r||(l=l.map(u=>(u.between[0].markname=i+uc,u))),n.push({name:s,value:{},on:[{events:l.map(u=>u.between[0]),update:`{x: x(unit), y: y(unit)${o!==void 0?`, extent_x: ${r?Jx(e,$t):`slice(${o.signals.visual})`}`:""}${a!==void 0?`, extent_y: ${r?Jx(e,tn):`slice(${a.signals.visual})`}`:""}}`}]},{name:i+uO,value:{},on:[{events:l,update:`{x: ${s}.x - x(unit), y: ${s}.y - y(unit)}`}]}),o!==void 0&&cO(e,t,o,"width",n),a!==void 0&&cO(e,t,a,"height",n),n}};function cO(e,t,n,i,r){const s=t.name,o=s+lO,a=s+uO,l=n.channel,u=Ks.defined(t),c=r.find(x=>x.name===n.signals[u?"data":"visual"]),f=e.getSizeSignalRef(i).signal,d=e.getScaleComponent(l),h=d==null?void 0:d.get("type"),p=d==null?void 0:d.get("reverse"),g=u?l===$t?p?"":"-":p?"-":"":"",m=`${o}.extent_${l}`,y=`${g}${a}.${l} / ${u?`${f}`:`span(${m})`}`,b=!u||!d?"panLinear":h==="log"?"panLog":h==="symlog"?"panSymlog":h==="pow"?"panPow":"panLinear",v=u?h==="pow"?`, ${d.get("exponent")??1}`:h==="symlog"?`, ${d.get("constant")??1}`:"":"",_=`${b}(${m}, ${y}${v})`;c.on.push({events:{signal:a},update:u?_:`clampRange(${_}, 0, ${f})`})}const fO="_zoom_anchor",dO="_zoom_delta",j0e={defined:e=>e.type==="interval"&&e.zoom,signals:(e,t,n)=>{const i=t.name,r=Ks.defined(t),s=i+dO,{x:o,y:a}=t.project.hasChannel,l=ee(e.scaleName($t)),u=ee(e.scaleName(tn));let c=qo(t.zoom,"scope");return r||(c=c.map(f=>(f.markname=i+uc,f))),n.push({name:i+fO,on:[{events:c,update:r?`{${[l?`x: invert(${l}, x(unit))`:"",u?`y: invert(${u}, y(unit))`:""].filter(f=>f).join(", ")}}`:"{x: x(unit), y: y(unit)}"}]},{name:s,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),o!==void 0&&hO(e,t,o,"width",n),a!==void 0&&hO(e,t,a,"height",n),n}};function hO(e,t,n,i,r){const s=t.name,o=n.channel,a=Ks.defined(t),l=r.find(b=>b.name===n.signals[a?"data":"visual"]),u=e.getSizeSignalRef(i).signal,c=e.getScaleComponent(o),f=c==null?void 0:c.get("type"),d=a?Jx(e,o):l.name,h=s+dO,p=`${s}${fO}.${o}`,g=!a||!c?"zoomLinear":f==="log"?"zoomLog":f==="symlog"?"zoomSymlog":f==="pow"?"zoomPow":"zoomLinear",m=a?f==="pow"?`, ${c.get("exponent")??1}`:f==="symlog"?`, ${c.get("constant")??1}`:"":"",y=`${g}(${d}, ${p}, ${h}${m})`;l.on.push({events:{signal:h},update:a?y:`clampRange(${y}, 0, ${u})`})}const ml="_store",Qs="_tuple",U0e="_modify",pO="vlSelectionResolve",W1=[p0e,w0e,f0e,oO,sO,Ks,aO,P0e,B0e,j0e,rO];function q0e(e){let t=e.parent;for(;t&&!Si(t);)t=t.parent;return t}function yl(e,{escape:t}={escape:!0}){let n=t?ee(e.name):e.name;const i=q0e(e);if(i){const{facet:r}=i;for(const s of Gi)r[s]&&(n+=` + '__facet_${s}_' + (facet[${ee(i.vgField(s))}])`)}return n}function sw(e){return Bt(e.component.selection??{}).reduce((t,n)=>t||n.project.hasSelectionId,!1)}function gO(e,t){(re(t.select)||!t.select.on)&&delete e.events,(re(t.select)||!t.select.clear)&&delete e.clear,(re(t.select)||!t.select.toggle)&&delete e.toggle}function ps(e){var t;return(t=e.events)==null?void 0:t.find(n=>"type"in n&&n.type==="timer")}function ow(e){const t=[];return e.type==="Identifier"?[e.name]:e.type==="Literal"?[e.value]:(e.type==="MemberExpression"&&(t.push(...ow(e.object)),t.push(...ow(e.property))),t)}function mO(e){return e.object.type==="MemberExpression"?mO(e.object):e.object.name==="datum"}function yO(e){const t=A_(e),n=new Set;return t.visit(i=>{i.type==="MemberExpression"&&mO(i)&&n.add(ow(i).slice(1).join("."))}),n}class dc extends ct{constructor(n,i,r){super(n);U(this,"model");U(this,"filter");U(this,"expr");U(this,"_dependentFields");this.model=i,this.filter=r,this.expr=H1(this.model,this.filter,this),this._dependentFields=yO(this.expr)}clone(){return new dc(null,this.model,Ne(this.filter))}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return`Filter ${this.expr}`}}function W0e(e,t){const n={},i=e.config.selection;if(!t||!t.length)return n;let r=0;for(const s of t){const o=Et(s.name),a=s.select,l=re(a)?a:a.type,u=ie(a)?Ne(a):{type:l},c=i[l];for(const h in c)h==="fields"||h==="encodings"||(h==="mark"&&(u.mark={...c.mark,...u.mark}),(u[h]===void 0||u[h]===!0)&&(u[h]=Ne(c[h]??u[h])));const f=n[o]={...u,name:o,type:l,init:s.value,bind:s.bind,events:re(u.on)?qo(u.on,"scope"):se(Ne(u.on))};if(ps(f)&&(r++,r>1)){delete n[o];continue}const d=Ne(s);for(const h of W1)h.defined(f)&&h.parse&&h.parse(e,f,d)}return r>1&&K(mde),n}function bO(e,t,n,i="datum"){const r=re(t)?t:t.param,s=Et(r),o=ee(s+ml);let a;try{a=e.getSelectionComponent(s,r)}catch{return`!!${s}`}if(a.project.timeUnit){const d=n??e.component.data.raw,h=a.project.timeUnit.clone();d.parent?h.insertAsParentOf(d):d.parent=h}const l=a.project.hasSelectionId?"vlSelectionIdTest(":"vlSelectionTest(",u=a.resolve==="global"?")":`, ${ee(a.resolve)})`,c=`${l}${o}, ${i}${u}`,f=`length(data(${o}))`;return t.empty===!1?`${f} && ${c}`:`!${f} || ${c}`}function vO(e,t,n){const i=Et(t),r=n.encoding;let s=n.field,o;try{o=e.getSelectionComponent(i,t)}catch{return i}if(!r&&!s)s=o.project.items[0].field,o.project.items.length>1&&K(yde(s));else if(r&&!s){const a=o.project.items.filter(l=>l.channel===r);!a.length||a.length>1?(s=o.project.items[0].field,K(bde(a,r,n,s))):s=a[0].field}return`${o.name}[${ee(qi(s))}]`}function H0e(e,t){for(const[n,i]of Ho(e.component.selection??{})){const r=e.getName(`lookup_${n}`);e.component.data.outputNodes[r]=i.materialized=new ci(new dc(t,e,{param:n}),r,Ct.Lookup,e.component.data.outputNodeRefCounts)}}function H1(e,t,n){return Md(t,i=>re(i)?i:Che(i)?bO(e,i,n):XD(i))}function G0e(e,t){if(e)return G(e)&&!ea(e)?e.map(n=>kx(n,t)).join(", "):e}function aw(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function Zd(e,t,n,i={header:!1}){var f,d;const{disable:r,orient:s,scale:o,labelExpr:a,title:l,zindex:u,...c}=e.combine();if(!r){for(const h in c){const p=h,g=Ape[p],m=c[p];if(g&&g!==t&&g!=="both")delete c[p];else if(Gd(m)){const{condition:y,...b}=m,v=se(y),_=MN[p];if(_){const{vgProp:x,part:k}=_,w=[...v.map(E=>{const{test:$,...F}=E;return{test:H1(null,$),...F}}),b];aw(c,k,x,w),delete c[p]}else if(_===null){const x={signal:v.map(k=>{const{test:w,...E}=k;return`${H1(null,w)} ? ${mD(E)} : `}).join("")+mD(b)};c[p]=x}}else if(ye(m)){const y=MN[p];if(y){const{vgProp:b,part:v}=y;aw(c,v,b,m),delete c[p]}}We(["labelAlign","labelBaseline"],p)&&c[p]===null&&delete c[p]}if(t==="grid"){if(!c.grid)return;if(c.encode){const{grid:h}=c.encode;c.encode={...h?{grid:h}:{}},bt(c.encode)&&delete c.encode}return{scale:o,orient:s,...c,domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:Lt(u,0)}}else{if(!i.header&&e.mainExtracted)return;if(a!==void 0){let p=a;(d=(f=c.encode)==null?void 0:f.labels)!=null&&d.update&&ye(c.encode.labels.update.text)&&(p=Qa(a,"datum.label",c.encode.labels.update.text.signal)),aw(c,"labels","text",{signal:p})}if(c.labelAlign===null&&delete c.labelAlign,c.encode){for(const p of DN)e.hasAxisPart(p)||delete c.encode[p];bt(c.encode)&&delete c.encode}const h=G0e(l,n);return{scale:o,orient:s,grid:!1,...h?{title:h}:{},...c,...n.aria===!1?{aria:!1}:{},zindex:Lt(u,0)}}}}function _O(e){const{axes:t}=e.component,n=[];for(const i of Ws)if(t[i]){for(const r of t[i])if(!r.get("disable")&&!r.get("gridScale")){const s=i==="x"?"height":"width",o=e.getSizeSignalRef(s).signal;s!==o&&n.push({name:s,update:o})}}return n}function V0e(e,t){const{x:n=[],y:i=[]}=e;return[...n.map(r=>Zd(r,"grid",t)),...i.map(r=>Zd(r,"grid",t)),...n.map(r=>Zd(r,"main",t)),...i.map(r=>Zd(r,"main",t))].filter(r=>r)}function xO(e,t,n,i){return Object.assign.apply(null,[{},...e.map(r=>{if(r==="axisOrient"){const s=n==="x"?"bottom":"left",o=t[n==="x"?"axisBottom":"axisLeft"]||{},a=t[n==="x"?"axisTop":"axisRight"]||{},l=new Set([...X(o),...X(a)]),u={};for(const c of l.values())u[c]={signal:`${i.signal} === "${s}" ? ${xr(o[c])} : ${xr(a[c])}`};return u}return t[r]})])}function Y0e(e,t,n,i){const r=t==="band"?["axisDiscrete","axisBand"]:t==="point"?["axisDiscrete","axisPoint"]:QD(t)?["axisQuantitative"]:t==="time"||t==="utc"?["axisTemporal"]:[],s=e==="x"?"axisX":"axisY",o=ye(n)?"axisOrient":`axis${Dd(n)}`,a=[...r,...r.map(u=>s+u.substr(4))],l=["axis",o,s];return{vlOnlyAxisConfig:xO(a,i,e,n),vgAxisConfig:xO(l,i,e,n),axisConfigStyle:X0e([...l,...a],i)}}function X0e(e,t){var i;const n=[{}];for(const r of e){let s=(i=t[r])==null?void 0:i.style;if(s){s=se(s);for(const o of s)n.push(t.style[o])}}return Object.assign.apply(null,n)}function lw(e,t,n,i={}){var s;const r=bD(e,n,t);if(r!==void 0)return{configFrom:"style",configValue:r};for(const o of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(((s=i[o])==null?void 0:s[e])!==void 0)return{configFrom:o,configValue:i[o][e]};return{}}const wO={scale:({model:e,channel:t})=>e.scaleName(t),format:({format:e})=>e,formatType:({formatType:e})=>e,grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>t.grid??Z0e(n,e),gridScale:({model:e,channel:t})=>K0e(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelAlign||EO(t,n,i),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:i})=>e.labelBaseline||kO(t,n,i),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>e.labelFlush??Q0e(t.type,n),labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>e.labelOverlap??e1e(t.type,n,J(t)&&!!t.timeUnit,J(t)?t.sort:void 0),orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:i,scaleType:r})=>{const s=e==="x"?"width":e==="y"?"height":void 0,o=s?t.getSizeSignalRef(s):void 0;return n.tickCount??n1e({fieldOrDatumDef:i,scaleType:r,size:o,values:n.values})},tickMinStep:({axis:e,format:t,fieldOrDatumDef:n})=>e.tickMinStep??i1e({format:t,fieldOrDatumDef:n}),title:({axis:e,model:t,channel:n})=>{if(e.title!==void 0)return e.title;const i=$O(t,n);if(i!==void 0)return i;const r=t.typedFieldDef(n),s=n==="x"?"x2":"y2",o=t.fieldDef(s);return _D(r?[vN(r)]:[],J(o)?[vN(o)]:[])},values:({axis:e,fieldOrDatumDef:t})=>r1e(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>e.zindex??s1e(n,t)};function Z0e(e,t){return!rn(e)&&J(t)&&!vt(t==null?void 0:t.bin)&&!dn(t==null?void 0:t.bin)}function K0e(e,t){const n=t==="x"?"y":"x";if(e.getScaleComponent(n))return e.scaleName(n)}function J0e(e,t,n,i,r){const s=t==null?void 0:t.labelAngle;if(s!==void 0)return ye(s)?s:Nd(s);{const{configValue:o}=lw("labelAngle",i,t==null?void 0:t.style,r);return o!==void 0?Nd(o):n===$t&&We([ax,ox],e.type)&&!(J(e)&&e.timeUnit)?270:void 0}}function uw(e){return`(((${e.signal} % 360) + 360) % 360)`}function kO(e,t,n,i){if(e!==void 0)if(n==="x"){if(ye(e)){const r=uw(e),s=ye(t)?`(${t.signal} === "top")`:t==="top";return{signal:`(45 < ${r} && ${r} < 135) || (225 < ${r} && ${r} < 315) ? "middle" :(${r} <= 45 || 315 <= ${r}) === ${s} ? "bottom" : "top"`}}if(45{if(hl(r)&&bN(r.sort)){const{field:o,timeUnit:a}=r,l=r.sort,u=l.map((c,f)=>`${XD({field:o,timeUnit:a,equal:c})} ? ${f} : `).join("")+l.length;n=new hc(n,{calculate:u,as:pc(r,s,{forAs:!0})})}}),n}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return`Calculate ${Ge(this.transform)}`}}function pc(e,t,n){return ne(e,{prefix:t,suffix:"sort_index",...n})}function G1(e,t){return We(["top","bottom"],t)?"column":We(["left","right"],t)||e==="row"?"row":"column"}function gc(e,t,n,i){const r=i==="row"?n.headerRow:i==="column"?n.headerColumn:n.headerFacet;return Lt((t||{})[e],r[e],n.header[e])}function V1(e,t,n,i){const r={};for(const s of e){const o=gc(s,t||{},n,i);o!==void 0&&(r[s]=o)}return r}const cw=["row","column"],fw=["header","footer"];function o1e(e,t){const n=e.component.layoutHeaders[t].title,i=e.config?e.config:void 0,r=e.component.layoutHeaders[t].facetFieldDef?e.component.layoutHeaders[t].facetFieldDef:void 0,{titleAnchor:s,titleAngle:o,titleOrient:a}=V1(["titleAnchor","titleAngle","titleOrient"],r.header,i,t),l=G1(t,a),u=Nd(o);return{name:`${t}-title`,type:"group",role:`${l}-title`,title:{text:n,...t==="row"?{orient:"left"}:{},style:"guide-title",...CO(u,l),...SO(l,u,s),...AO(i,r,t,Xpe,JN)}}}function SO(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}const i=EO(t,e==="row"?"left":"top",e==="row"?"y":"x");return i?{align:i}:{}}function CO(e,t){const n=kO(e,t==="row"?"left":"top",t==="row"?"y":"x",!0);return n?{baseline:n}:{}}function a1e(e,t){const n=e.component.layoutHeaders[t],i=[];for(const r of fw)if(n[r])for(const s of n[r]){const o=u1e(e,t,r,n,s);o!=null&&i.push(o)}return i}function l1e(e,t){const{sort:n}=e;return Vs(n)?{field:ne(n,{expr:"datum"}),order:n.order??"ascending"}:G(n)?{field:pc(e,t,{expr:"datum"}),order:"ascending"}:{field:ne(e,{expr:"datum"}),order:n??"ascending"}}function dw(e,t,n){const{format:i,formatType:r,labelAngle:s,labelAnchor:o,labelOrient:a,labelExpr:l}=V1(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),u=bx({fieldOrDatumDef:e,format:i,formatType:r,expr:"parent",config:n}).signal,c=G1(t,a);return{text:{signal:l?Qa(Qa(l,"datum.label",u),"datum.value",ne(e,{expr:"parent"})):u},...t==="row"?{orient:"left"}:{},style:"guide-label",frame:"group",...CO(s,c),...SO(c,s,o),...AO(n,e,t,Zpe,QN)}}function u1e(e,t,n,i,r){if(r){let s=null;const{facetFieldDef:o}=i,a=e.config?e.config:void 0;if(o&&r.labels){const{labelOrient:f}=V1(["labelOrient"],o.header,a,t);(t==="row"&&!We(["top","bottom"],f)||t==="column"&&!We(["left","right"],f))&&(s=dw(o,t,a))}const l=Si(e)&&!Ud(e.facet),u=r.axes,c=(u==null?void 0:u.length)>0;if(s||c){const f=t==="row"?"height":"width";return{name:e.getName(`${t}_${n}`),type:"group",role:`${t}-${n}`,...i.facetFieldDef?{from:{data:e.getName(`${t}_domain`)},sort:l1e(o,t)}:{},...c&&l?{from:{data:e.getName(`facet_domain_${t}`)}}:{},...s?{title:s}:{},...r.sizeSignal?{encode:{update:{[f]:r.sizeSignal}}}:{},...c?{axes:u}:{}}}}return null}const c1e={column:{start:0,end:1},row:{start:1,end:0}};function f1e(e,t){return c1e[t][e]}function d1e(e,t){const n={};for(const i of Gi){const r=e[i];if(r!=null&&r.facetFieldDef){const{titleAnchor:s,titleOrient:o}=V1(["titleAnchor","titleOrient"],r.facetFieldDef.header,t,i),a=G1(i,o),l=f1e(s,a);l!==void 0&&(n[a]=l)}}return bt(n)?void 0:n}function AO(e,t,n,i,r){const s={};for(const o of i){if(!r[o])continue;const a=gc(o,t==null?void 0:t.header,e,n);a!==void 0&&(s[r[o]]=a)}return s}function hw(e){return[...Y1(e,"width"),...Y1(e,"height"),...Y1(e,"childWidth"),...Y1(e,"childHeight")]}function Y1(e,t){const n=t==="width"?"x":"y",i=e.component.layoutSize.get(t);if(i==null||i==="merged")return[];const r=e.getSizeSignalRef(t).signal;if(i==="step"){const s=e.getScaleComponent(n);if(s){const o=s.get("type"),a=s.get("range");if(rn(o)&&rl(a)){const l=e.scaleName(n);return Si(e.parent)&&e.parent.component.resolve.scale[n]==="independent"?[FO(l,a)]:[FO(l,a),{name:r,update:TO(l,s,`domain('${l}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}else if(i=="container"){const s=r.endsWith("width"),o=s?"containerSize()[0]":"containerSize()[1]",a=Ix(e.config.view,s?"width":"height"),l=`isFinite(${o}) ? ${o} : ${a}`;return[{name:r,init:l,on:[{update:l,events:"window:resize"}]}]}else return[{name:r,value:i}]}function FO(e,t){const n=`${e}_step`;return ye(t.step)?{name:n,update:t.step.signal}:{name:n,value:t.step}}function TO(e,t,n){const i=t.get("type"),r=t.get("padding"),s=Lt(t.get("paddingOuter"),r);let o=t.get("paddingInner");return o=i==="band"?o!==void 0?o:r:1,`bandspace(${n}, ${xr(o)}, ${xr(s)}) * ${e}_step`}function MO(e){return e==="childWidth"?"width":e==="childHeight"?"height":e}function DO(e,t){return X(e).reduce((n,i)=>({...n,...cc({model:t,channelDef:e[i],vgChannel:i,mainRefFn:r=>xt(r.value),invalidValueRef:void 0})}),{})}function NO(e,t){if(Si(t))return e==="theta"?"independent":"shared";if(vc(t))return"shared";if(Fw(t))return It(e)||e==="theta"||e==="radius"?"independent":"shared";throw new Error("invalid model type for resolve")}function pw(e,t){const n=e.scale[t],i=It(t)?"axis":"legend";return n==="independent"?(e[i][t]==="shared"&&K(Xde(t)),"independent"):e[i][t]||"shared"}const h1e={...Jpe,disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1},RO=X(h1e);class p1e extends Zs{}const OO={symbols:g1e,gradient:m1e,labels:y1e,entries:b1e};function g1e(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r,legendType:s}){if(s!=="symbol")return;const{markDef:o,encoding:a,config:l,mark:u}=n,c=o.filled&&u!=="trail";let f={...ide({},n,Qhe),...ZR(n,{filled:c})};const d=r.get("symbolOpacity")??l.legend.symbolOpacity,h=r.get("symbolFillColor")??l.legend.symbolFillColor,p=r.get("symbolStrokeColor")??l.legend.symbolStrokeColor,g=d===void 0?LO(a.opacity)??o.opacity:void 0;if(f.fill){if(i==="fill"||c&&i===ai)delete f.fill;else if(Z(f.fill,"field"))h?delete f.fill:(f.fill=xt(l.legend.symbolBaseFillColor??"black"),f.fillOpacity=xt(g??1));else if(G(f.fill)){const m=gw(a.fill??a.color)??o.fill??(c&&o.color);m&&(f.fill=xt(m))}}if(f.stroke){if(i==="stroke"||!c&&i===ai)delete f.stroke;else if(Z(f.stroke,"field")||p)delete f.stroke;else if(G(f.stroke)){const m=Lt(gw(a.stroke||a.color),o.stroke,c?o.color:void 0);m&&(f.stroke={value:m})}}if(i!==qs){const m=J(t)&&PO(n,r,t);m?f.opacity=[{test:m,...xt(g??1)},xt(l.legend.unselectedOpacity)]:g&&(f.opacity=xt(g))}return f={...f,...e},bt(f)?void 0:f}function m1e(e,{model:t,legendType:n,legendCmpt:i}){if(n!=="gradient")return;const{config:r,markDef:s,encoding:o}=t;let a={};const u=(i.get("gradientOpacity")??r.legend.gradientOpacity)===void 0?LO(o.opacity)||s.opacity:void 0;return u&&(a.opacity=xt(u)),a={...a,...e},bt(a)?void 0:a}function y1e(e,{fieldOrDatumDef:t,model:n,channel:i,legendCmpt:r}){const s=n.legend(i)||{},o=n.config,a=J(t)?PO(n,r,t):void 0,l=a?[{test:a,value:1},{value:o.legend.unselectedOpacity}]:void 0,{format:u,formatType:c}=s;let f;dl(c)?f=kr({fieldOrDatumDef:t,field:"datum.value",format:u,formatType:c,config:o}):u===void 0&&c===void 0&&o.customFormatTypes&&(t.type==="quantitative"&&o.numberFormatType?f=kr({fieldOrDatumDef:t,field:"datum.value",format:o.numberFormat,formatType:o.numberFormatType,config:o}):t.type==="temporal"&&o.timeFormatType&&J(t)&&t.timeUnit===void 0&&(f=kr({fieldOrDatumDef:t,field:"datum.value",format:o.timeFormat,formatType:o.timeFormatType,config:o})));const d={...l?{opacity:l}:{},...f?{text:f}:{},...e};return bt(d)?void 0:d}function b1e(e,{legendCmpt:t}){const n=t.get("selections");return n!=null&&n.length?{...e,fill:{value:"transparent"}}:e}function LO(e){return IO(e,(t,n)=>Math.max(t,n.value))}function gw(e){return IO(e,(t,n)=>Lt(t,n.value))}function IO(e,t){if(mpe(e))return se(e.condition).reduce(t,e.value);if(Er(e))return e.value}function PO(e,t,n){const i=t.get("selections");if(!(i!=null&&i.length))return;const r=ee(n.field);return i.map(s=>`(!length(data(${ee(Et(s)+ml)})) || (${s}[${r}] && indexof(${s}[${r}], datum.value) >= 0))`).join(" || ")}const zO={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{const{format:i,formatType:r}=t;return hN(e,e.type,i,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{const{formatType:i}=e;return pN(i,t,n)},gradientLength:e=>{const{legend:t,legendConfig:n}=e;return t.gradientLength??n.gradientLength??$1e(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>e.labelOverlap??t.labelOverlap??S1e(n),symbolType:({legend:e,markDef:t,channel:n,encoding:i})=>e.symbolType??_1e(t.type,n,i.shape,t.shape),title:({fieldOrDatumDef:e,config:t})=>ic(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(Ku(n)&&ls(t)){if(e==="gradient")return}else if(e==="symbol")return;return e},values:({fieldOrDatumDef:e,legend:t})=>v1e(t,e)};function v1e(e,t){const n=e.values;if(G(n))return TN(t,n);if(ye(n))return n}function _1e(e,t,n,i){if(t!=="shape"){const r=gw(n)??i;if(r)return r}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}function x1e(e){const{legend:t}=e;return Lt(t.type,w1e(e))}function w1e({channel:e,timeUnit:t,scaleType:n}){if(Ku(e)){if(We(["quarter","month","day"],t))return"symbol";if(ls(n))return"gradient"}return"symbol"}function k1e({legendConfig:e,legendType:t,orient:n,legend:i}){return i.direction??e[t?"gradientDirection":"symbolDirection"]??E1e(n,t)}function E1e(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return t==="gradient"?"horizontal":void 0}}function $1e({legendConfig:e,model:t,direction:n,orient:i,scaleType:r}){const{gradientHorizontalMaxLength:s,gradientHorizontalMinLength:o,gradientVerticalMaxLength:a,gradientVerticalMinLength:l}=e;if(ls(r))return n==="horizontal"?i==="top"||i==="bottom"?BO(t,"width",o,s):o:BO(t,"height",l,a)}function BO(e,t,n,i){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${i})`}}function S1e(e){if(We(["quantile","threshold","log","symlog"],e))return"greedy"}function jO(e){const t=At(e)?C1e(e):M1e(e);return e.component.legends=t,t}function C1e(e){const{encoding:t}=e,n={};for(const i of[ai,...tR]){const r=Yt(t[i]);!r||!e.getScaleComponent(i)||i===li&&J(r)&&r.type===Qu||(n[i]=T1e(e,i))}return n}function A1e(e,t){const n=e.scaleName(t);if(e.mark==="trail"){if(t==="color")return{stroke:n};if(t==="size")return{strokeWidth:n}}return t==="color"?e.markDef.filled?{fill:n}:{stroke:n}:{[t]:n}}function F1e(e,t,n,i){switch(t){case"disable":return n!==void 0;case"values":return!!(n!=null&&n.values);case"title":if(t==="title"&&e===(i==null?void 0:i.title))return!0}return e===(n||{})[t]}function T1e(e,t){var _;let n=e.legend(t);const{markDef:i,encoding:r,config:s}=e,o=s.legend,a=new p1e({},A1e(e,t));z0e(e,t,a);const l=n!==void 0?!n:o.disable;if(a.set("disable",l,n!==void 0),l)return a;n=n||{};const u=e.getScaleComponent(t).get("type"),c=Yt(r[t]),f=J(c)?(_=nn(c.timeUnit))==null?void 0:_.unit:void 0,d=n.orient||s.legend.orient||"right",h=x1e({legend:n,channel:t,timeUnit:f,scaleType:u}),p=k1e({legend:n,legendType:h,orient:d,legendConfig:o}),g={legend:n,channel:t,model:e,markDef:i,encoding:r,fieldOrDatumDef:c,legendConfig:o,config:s,scaleType:u,orient:d,legendType:h,direction:p};for(const x of RO){if(h==="gradient"&&x.startsWith("symbol")||h==="symbol"&&x.startsWith("gradient"))continue;const k=x in zO?zO[x](g):n[x];if(k!==void 0){const w=F1e(k,x,n,e.fieldDef(t));(w||s.legend[x]===void 0)&&a.set(x,k,w)}}const m=(n==null?void 0:n.encoding)??{},y=a.get("selections"),b={},v={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:a,legendType:h};for(const x of["labels","legend","title","symbols","gradient","entries"]){const k=DO(m[x]??{},e),w=x in OO?OO[x](k,v):k;w!==void 0&&!bt(w)&&(b[x]={...y!=null&&y.length&&J(c)?{name:`${Et(c.field)}_legend_${x}`}:{},...y!=null&&y.length?{interactive:!0}:{},update:y!=null&&y.length?{...w,cursor:{value:"pointer"}}:w})}return bt(b)||a.set("encode",b,!!(n!=null&&n.encoding)),a}function M1e(e){const{legends:t,resolve:n}=e.component;for(const i of e.children){jO(i);for(const r of X(i.component.legends))n.legend[r]=pw(e.component.resolve,r),n.legend[r]==="shared"&&(t[r]=UO(t[r],i.component.legends[r]),t[r]||(n.legend[r]="independent",delete t[r]))}for(const i of X(t))for(const r of e.children)r.component.legends[i]&&n.legend[i]==="shared"&&delete r.component.legends[i];return t}function UO(e,t){var s,o,a,l;if(!e)return t.clone();const n=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(n.explicit&&i.explicit&&n.value!==i.value)return;let r=!1;for(const u of RO){const c=ra(e.getWithExplicit(u),t.getWithExplicit(u),u,"legend",(f,d)=>{switch(u){case"symbolType":return D1e(f,d);case"title":return wD(f,d);case"type":return r=!0,$i("symbol")}return I1(f,d,u,"legend")});e.setWithExplicit(u,c)}return r&&((o=(s=e.implicit)==null?void 0:s.encode)!=null&&o.gradient&&t1(e.implicit,["encode","gradient"]),(l=(a=e.explicit)==null?void 0:a.encode)!=null&&l.gradient&&t1(e.explicit,["encode","gradient"])),e}function D1e(e,t){return t.value==="circle"?t:e}function N1e(e,t,n,i){var r,s;e.encode??(e.encode={}),(r=e.encode)[t]??(r[t]={}),(s=e.encode[t]).update??(s.update={}),e.encode[t].update[n]=i}function qO(e){const t=e.component.legends,n={};for(const r of X(t)){const s=e.getScaleComponent(r),o=st(s.get("domains"));if(n[o])for(const a of n[o])UO(a,t[r])||n[o].push(t[r]);else n[o]=[t[r].clone()]}return Bt(n).flat().map(r=>R1e(r,e.config)).filter(r=>r!==void 0)}function R1e(e,t){var o,a,l;const{disable:n,labelExpr:i,selections:r,...s}=e.combine();if(!n){if(t.aria===!1&&s.aria==null&&(s.aria=!1),(o=s.encode)!=null&&o.symbols){const u=s.encode.symbols.update;u.fill&&u.fill.value!=="transparent"&&!u.stroke&&!s.stroke&&(u.stroke={value:"transparent"});for(const c of tR)s[c]&&delete u[c]}if(s.title||delete s.title,i!==void 0){let u=i;(l=(a=s.encode)==null?void 0:a.labels)!=null&&l.update&&ye(s.encode.labels.update.text)&&(u=Qa(i,"datum.label",s.encode.labels.update.text.signal)),N1e(s,"labels","text",{signal:u})}return s}}function O1e(e){return vc(e)||Fw(e)?L1e(e):WO(e)}function L1e(e){return e.children.reduce((t,n)=>t.concat(n.assembleProjections()),WO(e))}function WO(e){const t=e.component.projection;if(!t||t.merged)return[];const n=t.combine(),{name:i}=n;if(t.data){const r={signal:`[${t.size.map(o=>o.signal).join(", ")}]`},s=t.data.reduce((o,a)=>{const l=ye(a)?a.signal:`data('${e.lookupDataSource(a)}')`;return We(o,l)||o.push(l),o},[]);if(s.length<=0)throw new Error("Projection's fit didn't find any data sources");return[{name:i,size:r,fit:{signal:s.length>1?`[${s.join(", ")}]`:s[0]},...n}]}else return[{name:i,translate:{signal:"[width / 2, height / 2]"},...n}]}const I1e=["type","clipAngle","clipExtent","center","rotate","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];class HO extends Zs{constructor(n,i,r,s){super({...i},{name:n});U(this,"specifiedProjection");U(this,"size");U(this,"data");U(this,"merged",!1);this.specifiedProjection=i,this.size=r,this.data=s}get isFit(){return!!this.data}}function GO(e){e.component.projection=At(e)?P1e(e):j1e(e)}function P1e(e){if(e.hasProjection){const t=hn(e.specifiedProjection),n=!(t&&(t.scale!=null||t.translate!=null)),i=n?[e.getSizeSignalRef("width"),e.getSizeSignalRef("height")]:void 0,r=n?z1e(e):void 0,s=new HO(e.projectionName(!0),{...hn(e.config.projection),...t},i,r);return s.get("type")||s.set("type","equalEarth",!1),s}}function z1e(e){const t=[],{encoding:n}=e;for(const i of[[vr,br],[Hi,_r]])(Yt(n[i[0]])||Yt(n[i[1]]))&&t.push({signal:e.getName(`geojson_${t.length}`)});return e.channelHasField(li)&&e.typedFieldDef(li).type===Qu&&t.push({signal:e.getName(`geojson_${t.length}`)}),t.length===0&&t.push(e.requestDataName(Ct.Main)),t}function B1e(e,t){const n=$7(I1e,r=>!!(!le(e.explicit,r)&&!le(t.explicit,r)||le(e.explicit,r)&&le(t.explicit,r)&&ki(e.get(r),t.get(r))));if(ki(e.size,t.size)){if(n)return e;if(ki(e.explicit,{}))return t;if(ki(t.explicit,{}))return e}return null}function j1e(e){if(e.children.length===0)return;let t;for(const i of e.children)GO(i);const n=$7(e.children,i=>{const r=i.component.projection;if(r)if(t){const s=B1e(t,r);return s&&(t=s),!!s}else return t=r,!0;else return!0});if(t&&n){const i=e.projectionName(!0),r=new HO(i,t.specifiedProjection,t.size,Ne(t.data));for(const s of e.children){const o=s.component.projection;o&&(o.isFit&&r.data.push(...s.component.projection.data),s.renameProjection(o.get("name"),i),o.merged=!0)}return r}}function U1e(e,t,n,i){if(Hd(t,n)){const r=At(e)?e.axis(n)??e.legend(n)??{}:{},s=ne(t,{expr:"datum"}),o=ne(t,{expr:"datum",binSuffix:"end"});return{formulaAs:ne(t,{binSuffix:"range",forAs:!0}),formula:jd(s,o,r.format,r.formatType,i)}}return{}}function VO(e,t){return`${fD(e)}_${t}`}function q1e(e,t){return{signal:e.getName(`${t}_bins`),extentSignal:e.getName(`${t}_extent`)}}function mw(e,t,n){const i=A1(n,void 0)??{},r=VO(i,t);return e.getName(`${r}_bins`)}function W1e(e){return"as"in e}function YO(e,t,n){let i,r;W1e(e)?i=re(e.as)?[e.as,`${e.as}_end`]:[e.as[0],e.as[1]]:i=[ne(e,{forAs:!0}),ne(e,{binSuffix:"end",forAs:!0})];const s={...A1(t,void 0)},o=VO(s,e.field),{signal:a,extentSignal:l}=q1e(n,o);if(c1(s.extent)){const c=s.extent;r=vO(n,c.param,c),delete s.extent}const u={bin:s,field:e.field,as:[i],...a?{signal:a}:{},...l?{extentSignal:l}:{},...r?{span:r}:{}};return{key:o,binComponent:u}}class gs extends ct{constructor(n,i){super(n);U(this,"bins");this.bins=i}clone(){return new gs(null,Ne(this.bins))}static makeFromEncoding(n,i){const r=i.reduceFieldDef((s,o,a)=>{if(Xn(o)&&vt(o.bin)){const{key:l,binComponent:u}=YO(o,o.bin,i);s[l]={...u,...s[l],...U1e(i,o,a,i.config)}}return s},{});return bt(r)?null:new gs(n,r)}static makeFromTransform(n,i,r){const{key:s,binComponent:o}=YO(i,i.bin,r);return new gs(n,{[s]:o})}merge(n,i){for(const r of X(n.bins))r in this.bins?(i(n.bins[r].signal,this.bins[r].signal),this.bins[r].as=es([...this.bins[r].as,...n.bins[r].as],Ge)):this.bins[r]=n.bins[r];for(const r of n.children)n.removeChild(r),r.parent=this;n.remove()}producedFields(){return new Set(Bt(this.bins).map(n=>n.as).flat(2))}dependentFields(){return new Set(Bt(this.bins).map(n=>n.field))}hash(){return`Bin ${Ge(this.bins)}`}assemble(){return Bt(this.bins).flatMap(n=>{const i=[],[r,...s]=n.as,{extent:o,...a}=n.bin,l={type:"bin",field:qi(n.field),as:r,signal:n.signal,...c1(o)?{extent:null}:{extent:o},...n.span?{span:{signal:`span(${n.span})`}}:{},...a};!o&&n.extentSignal&&(i.push({type:"extent",field:qi(n.field),signal:n.extentSignal}),l.extent={signal:n.extentSignal}),i.push(l);for(const u of s)for(let c=0;c<2;c++)i.push({type:"formula",expr:ne({field:r[c]},{expr:"datum"}),as:u[c]});return n.formula&&i.push({type:"formula",expr:n.formula,as:n.formulaAs}),i})}}function H1e(e,t,n,i){var s;const r=At(i)?i.encoding[rs(t)]:void 0;if(Xn(n)&&At(i)&&xN(n,r,i.markDef,i.config)){e.add(ne(n,{})),e.add(ne(n,{suffix:"end"}));const{mark:o,markDef:a,config:l}=i,u=na({fieldDef:n,markDef:a,config:l});zd(o)&&u!==.5&&It(t)&&(e.add(ne(n,{suffix:P1})),e.add(ne(n,{suffix:z1}))),n.bin&&Hd(n,t)&&e.add(ne(n,{binSuffix:"range"}))}else if(nD(t)){const o=tD(t);e.add(i.getName(o))}else e.add(ne(n));return hl(n)&&Bhe((s=n.scale)==null?void 0:s.range)&&e.add(n.scale.range.field),e}function G1e(e,t){for(const n of X(t)){const i=t[n];for(const r of X(i))n in e?e[n][r]=new Set([...e[n][r]??[],...i[r]]):e[n]={[r]:i[r]}}}class Cr extends ct{constructor(n,i,r){super(n);U(this,"dimensions");U(this,"measures");this.dimensions=i,this.measures=r}clone(){return new Cr(null,new Set(this.dimensions),Ne(this.measures))}get groupBy(){return this.dimensions}static makeFromEncoding(n,i){let r=!1;i.forEachFieldDef(a=>{a.aggregate&&(r=!0)});const s={},o=new Set;return!r||(i.forEachFieldDef((a,l)=>{const{aggregate:u,field:c}=a;if(u)if(u==="count")s["*"]??(s["*"]={}),s["*"].count=new Set([ne(a,{forAs:!0})]);else{if(Hs(u)||Qo(u)){const f=Hs(u)?"argmin":"argmax",d=u[f];s[d]??(s[d]={}),s[d][f]=new Set([ne({op:f,field:d},{forAs:!0})])}else s[c]??(s[c]={}),s[c][u]=new Set([ne(a,{forAs:!0})]);ss(l)&&i.scaleDomain(l)==="unaggregated"&&(s[c]??(s[c]={}),s[c].min=new Set([ne({field:c,aggregate:"min"},{forAs:!0})]),s[c].max=new Set([ne({field:c,aggregate:"max"},{forAs:!0})]))}else H1e(o,l,a,i)}),o.size+X(s).length===0)?null:new Cr(n,o,s)}static makeFromTransform(n,i){var o;const r=new Set,s={};for(const a of i.aggregate){const{op:l,field:u,as:c}=a;l&&(l==="count"?(s["*"]??(s["*"]={}),s["*"].count=new Set([c||ne(a,{forAs:!0})])):(s[u]??(s[u]={}),(o=s[u])[l]??(o[l]=new Set),s[u][l].add(c||ne(a,{forAs:!0}))))}for(const a of i.groupby??[])r.add(a);return r.size+X(s).length===0?null:new Cr(n,r,s)}merge(n){return HM(this.dimensions,n.dimensions)?(G1e(this.measures,n.measures),!0):(fhe("different dimensions, cannot merge"),!1)}addDimensions(n){n.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...X(this.measures)])}producedFields(){const n=new Set;for(const i of X(this.measures))for(const r of X(this.measures[i])){const s=this.measures[i][r];s.size===0?n.add(`${r}_${i}`):s.forEach(n.add,n)}return n}hash(){return`Aggregate ${Ge({dimensions:this.dimensions,measures:this.measures})}`}assemble(){const n=[],i=[],r=[];for(const o of X(this.measures))for(const a of X(this.measures[o]))for(const l of this.measures[o][a])r.push(l),n.push(a),i.push(o==="*"?null:qi(o));return{type:"aggregate",groupby:[...this.dimensions].map(qi),ops:n,fields:i,as:r}}}class mc extends ct{constructor(n,i,r,s){super(n);U(this,"model");U(this,"name");U(this,"data");U(this,"column");U(this,"row");U(this,"facet");U(this,"childModel");this.model=i,this.name=r,this.data=s;for(const o of Gi){const a=i.facet[o];if(a){const{bin:l,sort:u}=a;this[o]={name:i.getName(`${o}_domain`),fields:[ne(a),...vt(l)?[ne(a,{binSuffix:"end"})]:[]],...Vs(u)?{sortField:u}:G(u)?{sortIndexField:pc(a,o)}:{}}}}this.childModel=i.child}hash(){let n="Facet";for(const i of Gi)this[i]&&(n+=` ${i.charAt(0)}:${Ge(this[i])}`);return n}get fields(){var i;const n=[];for(const r of Gi)(i=this[r])!=null&&i.fields&&n.push(...this[r].fields);return n}dependentFields(){const n=new Set(this.fields);for(const i of Gi)this[i]&&(this[i].sortField&&n.add(this[i].sortField.field),this[i].sortIndexField&&n.add(this[i].sortIndexField));return n}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const n={};for(const i of Ws){const r=this.childModel.component.scales[i];if(r&&!r.merged){const s=r.get("type"),o=r.get("range");if(rn(s)&&rl(o)){const a=Z1(this.childModel,i),l=Cw(a);l?n[i]=l:K(W7(i))}}}return n}assembleRowColumnHeaderData(n,i,r){const s={row:"y",column:"x",facet:void 0}[n],o=[],a=[],l=[];s&&r&&r[s]&&(i?(o.push(`distinct_${r[s]}`),a.push("max")):(o.push(r[s]),a.push("distinct")),l.push(`distinct_${r[s]}`));const{sortField:u,sortIndexField:c}=this[n];if(u){const{op:f=x1,field:d}=u;o.push(d),a.push(f),l.push(ne(u,{forAs:!0}))}else c&&(o.push(c),a.push("max"),l.push(c));return{name:this[n].name,source:i??this.data,transform:[{type:"aggregate",groupby:this[n].fields,...o.length?{fields:o,ops:a,as:l}:{}}]}}assembleFacetHeaderData(n){var u,c;const{columns:i}=this.model.layout,{layoutHeaders:r}=this.model.component,s=[],o={};for(const f of cw){for(const d of fw){const h=((u=r[f])==null?void 0:u[d])??[];for(const p of h)if(((c=p.axes)==null?void 0:c.length)>0){o[f]=!0;break}}if(o[f]){const d=`length(data("${this.facet.name}"))`,h=f==="row"?i?{signal:`ceil(${d} / ${i})`}:1:i?{signal:`min(${d}, ${i})`}:{signal:d};s.push({name:`${this.facet.name}_${f}`,transform:[{type:"sequence",start:0,stop:h}]})}}const{row:a,column:l}=o;return(a||l)&&s.unshift(this.assembleRowColumnHeaderData("facet",null,n)),s}assemble(){const n=[];let i=null;const r=this.getChildIndependentFieldsWithStep(),{column:s,row:o,facet:a}=this;if(s&&o&&(r.x||r.y)){i=`cross_${this.column.name}_${this.row.name}`;const l=[].concat(r.x??[],r.y??[]),u=l.map(()=>"distinct");n.push({name:i,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:l,ops:u}]})}for(const l of[zs,Ps])this[l]&&n.push(this.assembleRowColumnHeaderData(l,i,r));if(a){const l=this.assembleFacetHeaderData(r);l&&n.push(...l)}return n}}function XO(e){return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function V1e(e,t){const n=F7(e);if(t==="number")return`toNumber(${n})`;if(t==="boolean")return`toBoolean(${n})`;if(t==="string")return`toString(${n})`;if(t==="date")return`toDate(${n})`;if(t==="flatten")return n;if(t.startsWith("date:")){const i=XO(t.slice(5,t.length));return`timeParse(${n},'${i}')`}else if(t.startsWith("utc:")){const i=XO(t.slice(4,t.length));return`utcParse(${n},'${i}')`}else return K(_de(t)),null}function Y1e(e){const t={};return e1(e.filter,n=>{if(YD(n)){let i=null;J7(n)?i=Ei(n.equal):ex(n)?i=Ei(n.lte):Q7(n)?i=Ei(n.lt):tx(n)?i=Ei(n.gt):nx(n)?i=Ei(n.gte):ix(n)?i=n.range[0]:rx(n)&&(i=(n.oneOf??n.in)[0]),i&&(ol(i)?t[n.field]="date":Ke(i)?t[n.field]="number":re(i)&&(t[n.field]="string")),n.timeUnit&&(t[n.field]="date")}}),t}function X1e(e){const t={};function n(i){sc(i)?t[i.field]="date":i.type==="quantitative"&&Yfe(i.aggregate)?t[i.field]="number":Yu(i.field)>1?i.field in t||(t[i.field]="flatten"):hl(i)&&Vs(i.sort)&&Yu(i.sort.field)>1&&(i.sort.field in t||(t[i.sort.field]="flatten"))}if((At(e)||Si(e))&&e.forEachFieldDef((i,r)=>{if(Xn(i))n(i);else{const s=nl(r),o=e.fieldDef(s);n({...i,type:o.type})}}),At(e)){const{mark:i,markDef:r,encoding:s}=e;if(ta(i)&&!e.encoding.order){const o=r.orient==="horizontal"?"y":"x",a=s[o];J(a)&&a.type==="quantitative"&&!(a.field in t)&&(t[a.field]="number")}}return t}function Z1e(e){const t={};if(At(e)&&e.component.selection)for(const n of X(e.component.selection)){const i=e.component.selection[n];for(const r of i.project.items)!r.channel&&Yu(r.field)>1&&(t[r.field]="flatten")}return t}class Mn extends ct{constructor(n,i){super(n);U(this,"_parse");this._parse=i}clone(){return new Mn(null,Ne(this._parse))}hash(){return`Parse ${Ge(this._parse)}`}static makeExplicit(n,i,r){var a;let s={};const o=i.data;return!sa(o)&&((a=o==null?void 0:o.format)!=null&&a.parse)&&(s=o.format.parse),this.makeWithAncestors(n,s,{},r)}static makeWithAncestors(n,i,r,s){for(const l of X(r)){const u=s.getWithExplicit(l);u.value!==void 0&&(u.explicit||u.value===r[l]||u.value==="derived"||r[l]==="flatten"?delete r[l]:K(FD(l,r[l],u.value)))}for(const l of X(i)){const u=s.get(l);u!==void 0&&(u===i[l]?delete i[l]:K(FD(l,i[l],u)))}const o=new Zs(i,r);s.copyAll(o);const a={};for(const l of X(o.combine())){const u=o.get(l);u!==null&&(a[l]=u)}return X(a).length===0||s.parseNothing?null:new Mn(n,a)}get parse(){return this._parse}merge(n){this._parse={...this._parse,...n.parse},n.remove()}assembleFormatParse(){const n={};for(const i of X(this._parse)){const r=this._parse[i];Yu(i)===1&&(n[i]=r)}return n}producedFields(){return new Set(X(this._parse))}dependentFields(){return new Set(X(this._parse))}assembleTransforms(n=!1){return X(this._parse).filter(i=>n?Yu(i)>1:!0).map(i=>{const r=V1e(i,this._parse[i]);return r?{type:"formula",expr:r,as:Vu(i)}:null}).filter(i=>i!==null)}}class oa extends ct{clone(){return new oa(null)}constructor(t){super(t)}dependentFields(){return new Set}producedFields(){return new Set([Sr])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:Sr}}}class Kd extends ct{constructor(n,i){super(n);U(this,"params");this.params=i}clone(){return new Kd(null,this.params)}dependentFields(){return new Set}producedFields(){}hash(){return`Graticule ${Ge(this.params)}`}assemble(){return{type:"graticule",...this.params===!0?{}:this.params}}}class Jd extends ct{constructor(n,i){super(n);U(this,"params");this.params=i}clone(){return new Jd(null,this.params)}dependentFields(){return new Set}producedFields(){return new Set([this.params.as??"data"])}hash(){return`Hash ${Ge(this.params)}`}assemble(){return{type:"sequence",...this.params}}}class bl extends ct{constructor(n){super(null);U(this,"_data");U(this,"_name");U(this,"_generator");n??(n={name:"source"});let i;if(sa(n)||(i=n.format?{...wi(n.format,["parse"])}:{}),Vd(n))this._data={values:n.values};else if(ac(n)){if(this._data={url:n.url},!i.type){let r=/(?:\.([^.]+))?$/.exec(n.url)[1];We(["json","csv","tsv","dsv","topojson"],r)||(r="json"),i.type=r}}else NR(n)?this._data={values:[{type:"Sphere"}]}:(MR(n)||sa(n))&&(this._data={});this._generator=sa(n),n.name&&(this._name=n.name),i&&!bt(i)&&(this._data.format=i)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(n){this._name=n}set parent(n){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return{name:this._name,...this._data,transform:[]}}}function yw(e){return e instanceof bl||e instanceof Kd||e instanceof Jd}class bw{constructor(){O5(this,Ec);L5(this,Ec,!1)}setModified(){L5(this,Ec,!0)}get modifiedFlag(){return cz(this,Ec)}}Ec=new WeakMap;class vl extends bw{getNodeDepths(t,n,i){i.set(t,n);for(const r of t.children)this.getNodeDepths(r,n+1,i);return i}optimize(t){const i=[...this.getNodeDepths(t,0,new Map).entries()].sort((r,s)=>s[1]-r[1]);for(const r of i)this.run(r[0]);return this.modifiedFlag}}class vw extends bw{optimize(t){this.run(t);for(const n of t.children)this.optimize(n);return this.modifiedFlag}}class K1e extends vw{mergeNodes(t,n){const i=n.shift();for(const r of n)t.removeChild(r),r.parent=i,r.remove()}run(t){const n=t.children.map(r=>r.hash()),i={};for(let r=0;r1&&(this.setModified(),this.mergeNodes(t,i[r]))}}class J1e extends vw{constructor(n){super();U(this,"requiresSelectionId");this.requiresSelectionId=n&&sw(n)}run(n){n instanceof oa&&(this.requiresSelectionId&&(yw(n.parent)||n.parent instanceof Cr||n.parent instanceof Mn)||(this.setModified(),n.remove()))}}class Q1e extends bw{optimize(t){return this.run(t,new Set),this.modifiedFlag}run(t,n){let i=new Set;t instanceof hs&&(i=t.producedFields(),S7(i,n)&&(this.setModified(),t.removeFormulas(n),t.producedFields.length===0&&t.remove()));for(const r of t.children)this.run(r,new Set([...n,...i]))}}class eme extends vw{constructor(){super()}run(t){t instanceof ci&&!t.isRequired()&&(this.setModified(),t.remove())}}class tme extends vl{run(t){if(!yw(t)&&!(t.numChildren()>1)){for(const n of t.children)if(n instanceof Mn)if(t instanceof Mn)this.setModified(),t.merge(n);else{if(A7(t.producedFields(),n.dependentFields()))continue;this.setModified(),n.swapWithParent()}}}}class nme extends vl{run(t){const n=[...t.children],i=t.children.filter(r=>r instanceof Mn);if(t.numChildren()>1&&i.length>=1){const r={},s=new Set;for(const o of i){const a=o.parse;for(const l of X(a))l in r?r[l]!==a[l]&&s.add(l):r[l]=a[l]}for(const o of s)delete r[o];if(!bt(r)){this.setModified();const o=new Mn(t,r);for(const a of n){if(a instanceof Mn)for(const l of X(r))delete a.parse[l];t.removeChild(a),a.parent=o,a instanceof Mn&&X(a.parse).length===0&&a.remove()}}}}}class ime extends vl{run(t){t instanceof ci||t.numChildren()>0||t instanceof mc||t instanceof bl||(this.setModified(),t.remove())}}class rme extends vl{run(t){const n=t.children.filter(r=>r instanceof hs),i=n.pop();for(const r of n)this.setModified(),i.merge(r)}}class sme extends vl{run(t){const n=t.children.filter(r=>r instanceof Cr),i={};for(const r of n){const s=Ge(r.groupBy);s in i||(i[s]=[]),i[s].push(r)}for(const r of X(i)){const s=i[r];if(s.length>1){const o=s.pop();for(const a of s)o.merge(a)&&(t.removeChild(a),a.parent=o,a.remove(),this.setModified())}}}}class ome extends vl{constructor(n){super();U(this,"model");this.model=n}run(n){const i=!(yw(n)||n instanceof dc||n instanceof Mn||n instanceof oa),r=[],s=[];for(const o of n.children)o instanceof gs&&(i&&!A7(n.producedFields(),o.dependentFields())?r.push(o):s.push(o));if(r.length>0){const o=r.pop();for(const a of r)o.merge(a,this.model.renameSignal.bind(this.model));this.setModified(),n instanceof gs?n.merge(o,this.model.renameSignal.bind(this.model)):o.swapWithParent()}if(s.length>1){const o=s.pop();for(const a of s)o.merge(a,this.model.renameSignal.bind(this.model));this.setModified()}}}class ame extends vl{run(t){const n=[...t.children];if(!Gu(n,o=>o instanceof ci)||t.numChildren()<=1)return;const r=[];let s;for(const o of n)if(o instanceof ci){let a=o;for(;a.numChildren()===1;){const[l]=a.children;if(l instanceof ci)a=l;else break}r.push(...a.children),s?(t.removeChild(o),o.parent=s.parent,s.parent.removeChild(s),s.parent=a,this.setModified()):s=a}else r.push(o);if(r.length){this.setModified();for(const o of r)o.parent.removeChild(o),o.parent=s}}}class _l extends ct{constructor(n,i){super(n);U(this,"transform");this.transform=i}clone(){return new _l(null,Ne(this.transform))}addDimensions(n){this.transform.groupby=es(this.transform.groupby.concat(n),i=>i)}dependentFields(){const n=new Set;return this.transform.groupby&&this.transform.groupby.forEach(n.add,n),this.transform.joinaggregate.map(i=>i.field).filter(i=>i!==void 0).forEach(n.add,n),n}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(n){return n.as??ne(n)}hash(){return`JoinAggregateTransform ${Ge(this.transform)}`}assemble(){const n=[],i=[],r=[];for(const o of this.transform.joinaggregate)i.push(o.op),r.push(this.getDefaultName(o)),n.push(o.field===void 0?null:o.field);const s=this.transform.groupby;return{type:"joinaggregate",as:r,ops:i,fields:n,...s!==void 0?{groupby:s}:{}}}}class yc extends ct{constructor(n,i){super(n);U(this,"filter");this.filter=i}clone(){return new yc(null,{...this.filter})}static make(n,i,r){const{config:s,markDef:o}=i,{marks:a,scales:l}=r;if(a==="include-invalid-values"&&l==="include-invalid-values")return null;const u=i.reduceFieldDef((c,f,d)=>{const h=ss(d)&&i.getScaleComponent(d);if(h){const p=h.get("type"),{aggregate:g}=f,m=gx({scaleChannel:d,markDef:o,config:s,scaleType:p,isCountAggregate:u1(g)});m!=="show"&&m!=="always-valid"&&(c[f.field]=f)}return c},{});return X(u).length?new yc(n,u):null}dependentFields(){return new Set(X(this.filter))}producedFields(){return new Set}hash(){return`FilterInvalid ${Ge(this.filter)}`}assemble(){const n=X(this.filter).reduce((i,r)=>{const s=this.filter[r],o=ne(s,{expr:"datum"});return s!==null&&(s.type==="temporal"?i.push(`(isDate(${o}) || (${_w(o)}))`):s.type==="quantitative"&&i.push(_w(o))),i},[]);return n.length>0?{type:"filter",expr:n.join(" && ")}:null}}function _w(e){return`isValid(${e}) && isFinite(+${e})`}function lme(e){return e.stack.stackBy.reduce((t,n)=>{const i=n.fieldDef,r=ne(i);return r&&t.push(r),t},[])}function ume(e){return G(e)&&e.every(t=>re(t))&&e.length>1}class eo extends ct{constructor(n,i){super(n);U(this,"_stack");this._stack=i}clone(){return new eo(null,Ne(this._stack))}static makeFromTransform(n,i){const{stack:r,groupby:s,as:o,offset:a="zero"}=i,l=[],u=[];if(i.sort!==void 0)for(const d of i.sort)l.push(d.field),u.push(Lt(d.order,"ascending"));const c={field:l,order:u};let f;return ume(o)?f=o:re(o)?f=[o,`${o}_end`]:f=[`${i.stack}_start`,`${i.stack}_end`],new eo(n,{dimensionFieldDefs:[],stackField:r,groupby:s,offset:a,sort:c,facetby:[],as:f})}static makeFromEncoding(n,i){const r=i.stack,{encoding:s}=i;if(!r)return null;const{groupbyChannels:o,fieldChannel:a,offset:l,impute:u}=r,c=o.map(p=>{const g=s[p];return $r(g)}).filter(p=>!!p),f=lme(i),d=i.encoding.order;let h;if(G(d)||J(d))h=vD(d);else{const p=wN(d)?d.sort:a==="y"?"descending":"ascending";h=f.reduce((g,m)=>(g.field.includes(m)||(g.field.push(m),g.order.push(p)),g),{field:[],order:[]})}return new eo(n,{dimensionFieldDefs:c,stackField:i.vgField(a),facetby:[],stackby:f,sort:h,offset:l,impute:u,as:[i.vgField(a,{suffix:"start",forAs:!0}),i.vgField(a,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(n){this._stack.facetby.push(...n)}dependentFields(){const n=new Set;return n.add(this._stack.stackField),this.getGroupbyFields().forEach(n.add,n),this._stack.facetby.forEach(n.add,n),this._stack.sort.field.forEach(n.add,n),n}producedFields(){return new Set(this._stack.as)}hash(){return`Stack ${Ge(this._stack)}`}getGroupbyFields(){const{dimensionFieldDefs:n,impute:i,groupby:r}=this._stack;return n.length>0?n.map(s=>s.bin?i?[ne(s,{binSuffix:"mid"})]:[ne(s,{}),ne(s,{binSuffix:"end"})]:[ne(s)]).flat():r??[]}assemble(){const n=[],{facetby:i,dimensionFieldDefs:r,stackField:s,stackby:o,sort:a,offset:l,impute:u,as:c}=this._stack;if(u)for(const f of r){const{bandPosition:d=.5,bin:h}=f;if(h){const p=ne(f,{expr:"datum"}),g=ne(f,{expr:"datum",binSuffix:"end"});n.push({type:"formula",expr:`${_w(p)} ? ${d}*${p}+${1-d}*${g} : ${p}`,as:ne(f,{binSuffix:"mid",forAs:!0})})}n.push({type:"impute",field:s,groupby:[...o,...i],key:ne(f,{binSuffix:"mid"}),method:"value",value:0})}return n.push({type:"stack",groupby:[...this.getGroupbyFields(),...i],field:s,sort:a,as:c,offset:l}),n}}class bc extends ct{constructor(n,i){super(n);U(this,"transform");this.transform=i}clone(){return new bc(null,Ne(this.transform))}addDimensions(n){this.transform.groupby=es(this.transform.groupby.concat(n),i=>i)}dependentFields(){const n=new Set;return(this.transform.groupby??[]).forEach(n.add,n),(this.transform.sort??[]).forEach(i=>n.add(i.field)),this.transform.window.map(i=>i.field).filter(i=>i!==void 0).forEach(n.add,n),n}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(n){return n.as??ne(n)}hash(){return`WindowTransform ${Ge(this.transform)}`}assemble(){const n=[],i=[],r=[],s=[];for(const d of this.transform.window)i.push(d.op),r.push(this.getDefaultName(d)),s.push(d.param===void 0?null:d.param),n.push(d.field===void 0?null:d.field);const o=this.transform.frame,a=this.transform.groupby;if(o&&o[0]===null&&o[1]===null&&i.every(d=>B7(d)))return{type:"joinaggregate",as:r,ops:i,fields:n,...a!==void 0?{groupby:a}:{}};const l=[],u=[];if(this.transform.sort!==void 0)for(const d of this.transform.sort)l.push(d.field),u.push(d.order??"ascending");const c={field:l,order:u},f=this.transform.ignorePeers;return{type:"window",params:s,as:r,ops:i,fields:n,sort:c,...f!==void 0?{ignorePeers:f}:{},...a!==void 0?{groupby:a}:{},...o!==void 0?{frame:o}:{}}}}function cme(e){function t(n){if(!(n instanceof mc)){const i=n.clone();if(i instanceof ci){const r=ww+i.getSource();i.setSource(r),e.model.component.data.outputNodes[r]=i}else(i instanceof Cr||i instanceof eo||i instanceof bc||i instanceof _l)&&i.addDimensions(e.fields);for(const r of n.children.flatMap(t))r.parent=i;return[i]}return n.children.flatMap(t)}return t}function xw(e){if(e instanceof mc)if(e.numChildren()===1&&!(e.children[0]instanceof ci)){const t=e.children[0];(t instanceof Cr||t instanceof eo||t instanceof bc||t instanceof _l)&&t.addDimensions(e.fields),t.swapWithParent(),xw(e)}else{const t=e.model.component.data.main;ZO(t);const n=cme(e),i=e.children.map(n).flat();for(const r of i)r.parent=t}else e.children.map(xw)}function ZO(e){if(e instanceof ci&&e.type===Ct.Main&&e.numChildren()===1){const t=e.children[0];t instanceof mc||(t.swapWithParent(),ZO(e))}}const ww="scale_",X1=5;function kw(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return!1;if(!kw(t.children))return!1}return!0}function Ar(e,t){let n=!1;for(const i of t)n=e.optimize(i)||n;return n}function KO(e,t,n){let i=e.sources,r=!1;return r=Ar(new eme,i)||r,r=Ar(new J1e(t),i)||r,i=i.filter(s=>s.numChildren()>0),r=Ar(new ime,i)||r,i=i.filter(s=>s.numChildren()>0),n||(r=Ar(new tme,i)||r,r=Ar(new ome(t),i)||r,r=Ar(new Q1e,i)||r,r=Ar(new nme,i)||r,r=Ar(new sme,i)||r,r=Ar(new rme,i)||r,r=Ar(new K1e,i)||r,r=Ar(new ame,i)||r),e.sources=i,r}function fme(e,t){kw(e.sources);let n=0,i=0;for(let r=0;rt(n))}}function JO(e){At(e)?dme(e):hme(e)}function dme(e){const t=e.component.scales;for(const n of X(t)){const i=gme(e,n);if(t[n].setWithExplicit("domains",i),yme(e,n),e.component.data.isFaceted){let s=e;for(;!Si(s)&&s.parent;)s=s.parent;if(s.component.resolve.scale[n]==="shared")for(const a of i.value)Gs(a)&&(a.data=ww+a.data.replace(ww,""))}}}function hme(e){for(const n of e.children)JO(n);const t=e.component.scales;for(const n of X(t)){let i,r=null;for(const s of e.children){const o=s.component.scales[n];if(o){i===void 0?i=o.getWithExplicit("domains"):i=ra(i,o.getWithExplicit("domains"),"domains","scale",Sw);const a=o.get("selectionExtent");r&&a&&r.param!==a.param&&K(hde),r=a}}t[n].setWithExplicit("domains",i),r&&t[n].set("selectionExtent",r,!0)}}function pme(e,t,n,i){if(e==="unaggregated"){const{valid:r,reason:s}=QO(t,n);if(!r){K(s);return}}else if(e===void 0&&i.useUnaggregatedDomain){const{valid:r}=QO(t,n);if(r)return"unaggregated"}return e}function gme(e,t){const n=e.getScaleComponent(t).get("type"),{encoding:i}=e,r=pme(e.scaleDomain(t),e.typedFieldDef(t),n,e.config.scale);return r!==e.scaleDomain(t)&&(e.specifiedScales[t]={...e.specifiedScales[t],domain:r}),t==="x"&&Yt(i.x2)?Yt(i.x)?ra(aa(n,r,e,"x"),aa(n,r,e,"x2"),"domain","scale",Sw):aa(n,r,e,"x2"):t==="y"&&Yt(i.y2)?Yt(i.y)?ra(aa(n,r,e,"y"),aa(n,r,e,"y2"),"domain","scale",Sw):aa(n,r,e,"y2"):aa(n,r,e,t)}function mme(e,t,n){return e.map(i=>({signal:`{data: ${F1(i,{timeUnit:n,type:t})}}`}))}function Ew(e,t,n){var r;const i=(r=nn(n))==null?void 0:r.unit;return t==="temporal"||i?mme(e,t,i):[e]}function aa(e,t,n,i){const{encoding:r,markDef:s,mark:o,config:a,stack:l}=n,u=Yt(r[i]),{type:c}=u,f=u.timeUnit,d=u0e({invalid:os("invalid",s,a),isPath:ta(o)});if(zhe(t)){const g=aa(e,void 0,n,i),m=Ew(t.unionWith,c,f);return ds([...m,...g.value])}else{if(ye(t))return ds([t]);if(t&&t!=="unaggregated"&&!tN(t))return ds(Ew(t,c,f))}if(l&&i===l.fieldChannel){if(l.offset==="normalize")return $i([[0,1]]);const g=n.requestDataName(d);return $i([{data:g,field:n.vgField(i,{suffix:"start"})},{data:g,field:n.vgField(i,{suffix:"end"})}])}const h=ss(i)&&J(u)?bme(n,i,e):void 0;if(cs(u)){const g=Ew([u.datum],c,f);return $i(g)}const p=u;if(t==="unaggregated"){const{field:g}=u;return $i([{data:n.requestDataName(d),field:ne({field:g,aggregate:"min"})},{data:n.requestDataName(d),field:ne({field:g,aggregate:"max"})}])}else if(vt(p.bin)){if(rn(e))return $i(e==="bin-ordinal"?[]:[{data:Td(h)?n.requestDataName(d):n.requestDataName(Ct.Raw),field:n.vgField(i,Hd(p,i)?{binSuffix:"range"}:{}),sort:h===!0||!ie(h)?{field:n.vgField(i,{}),op:"min"}:h}]);{const{bin:g}=p;if(vt(g)){const m=mw(n,p.field,g);return $i([new sn(()=>{const y=n.getSignalName(m);return`[${y}.start, ${y}.stop]`})])}else return $i([{data:n.requestDataName(d),field:n.vgField(i,{})}])}}else if(p.timeUnit&&We(["time","utc"],e)){const g=r[rs(i)];if(xN(p,g,s,a)){const m=n.requestDataName(d),y=na({fieldDef:p,fieldDef2:g,markDef:s,config:a}),b=zd(o)&&y!==.5&&It(i);return $i([{data:m,field:n.vgField(i,b?{suffix:P1}:{})},{data:m,field:n.vgField(i,{suffix:b?z1:"end"})}])}}return $i(h?[{data:Td(h)?n.requestDataName(d):n.requestDataName(Ct.Raw),field:n.vgField(i),sort:h}]:[{data:n.requestDataName(d),field:n.vgField(i)}])}function $w(e,t){const{op:n,field:i,order:r}=e;return{op:n??(t?"sum":x1),...i?{field:qi(i)}:{},...r?{order:r}:{}}}function yme(e,t){var a;const n=e.component.scales[t],i=e.specifiedScales[t].domain,r=(a=e.fieldDef(t))==null?void 0:a.bin,s=tN(i)?i:void 0,o=il(r)&&c1(r.extent)?r.extent:void 0;(s||o)&&n.set("selectionExtent",s??o,!0)}function bme(e,t,n){if(!rn(n))return;const i=e.fieldDef(t),r=i.sort;if(bN(r))return{op:"min",field:pc(i,t),order:"ascending"};const{stack:s}=e,o=s?new Set([...s.groupbyFields,...s.stackBy.map(a=>a.fieldDef.field)]):void 0;if(Vs(r)){const a=s&&!o.has(r.field);return $w(r,a)}else if(hpe(r)){const{encoding:a,order:l}=r,u=e.fieldDef(a),{aggregate:c,field:f}=u,d=s&&!o.has(f);if(Hs(c)||Qo(c))return $w({field:ne(u),order:l},d);if(B7(c)||!c)return $w({op:c,field:f,order:l},d)}else{if(r==="descending")return{op:"min",field:e.vgField(t),order:"descending"};if(We(["ascending",void 0],r))return!0}}function QO(e,t){const{aggregate:n,type:i}=e;return n?re(n)&&!Zfe.has(n)?{valid:!1,reason:Ude(n)}:i==="quantitative"&&t==="log"?{valid:!1,reason:qde(e)}:{valid:!0}:{valid:!1,reason:jde(e)}}function Sw(e,t,n,i){return e.explicit&&t.explicit&&K(Yde(n,i,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function vme(e){const t=es(e.map(o=>{if(Gs(o)){const{sort:a,...l}=o;return l}return o}),Ge),n=es(e.map(o=>{if(Gs(o)){const a=o.sort;return a!==void 0&&!Td(a)&&("op"in a&&a.op==="count"&&delete a.field,a.order==="ascending"&&delete a.order),a}}).filter(o=>o!==void 0),Ge);if(t.length===0)return;if(t.length===1){const o=e[0];if(Gs(o)&&n.length>0){let a=n[0];if(n.length>1){K(OD);const l=n.filter(u=>ie(u)&&"op"in u&&u.op!=="min");n.every(u=>ie(u)&&"op"in u)&&l.length===1?a=l[0]:a=!0}else if(ie(a)&&"field"in a){const l=a.field;o.field===l&&(a=a.order?{order:a.order}:!0)}return{...o,sort:a}}return o}const i=es(n.map(o=>Td(o)||!("op"in o)||re(o.op)&&le(Gfe,o.op)?o:(K(Zde(o)),!0)),Ge);let r;i.length===1?r=i[0]:i.length>1&&(K(OD),r=!0);const s=es(e.map(o=>Gs(o)?o.data:null),o=>o);return s.length===1&&s[0]!==null?{data:s[0],fields:t.map(a=>a.field),...r?{sort:r}:{}}:{fields:t,...r?{sort:r}:{}}}function Cw(e){if(Gs(e)&&re(e.field))return e.field;if(Kfe(e)){let t;for(const n of e.fields)if(Gs(n)&&re(n.field)){if(!t)t=n.field;else if(t!==n.field)return K(Kde),t}return K(Jde),t}else if(Jfe(e)){K(Qde);const t=e.fields[0];return re(t)?t:void 0}}function Z1(e,t){const i=e.component.scales[t].get("domains").map(r=>(Gs(r)&&(r.data=e.lookupDataSource(r.data)),r));return vme(i)}function eL(e){return vc(e)||Fw(e)?e.children.reduce((t,n)=>t.concat(eL(n)),tL(e)):tL(e)}function tL(e){return X(e.component.scales).reduce((t,n)=>{const i=e.component.scales[n];if(i.merged)return t;const r=i.combine(),{name:s,type:o,selectionExtent:a,domains:l,range:u,reverse:c,...f}=r,d=_me(r.range,s,n,e),h=Z1(e,n),p=a?_0e(e,a,i,h):null;return t.push({name:s,type:o,...h?{domain:h}:{},...p?{domainRaw:p}:{},range:d,...c!==void 0?{reverse:c}:{},...f}),t},[])}function _me(e,t,n,i){if(It(n)){if(rl(e))return{step:{signal:`${t}_step`}}}else if(ie(e)&&Gs(e))return{...e,data:i.lookupDataSource(e.data)};return e}class nL extends Zs{constructor(n,i){super({},{name:n});U(this,"merged",!1);this.setWithExplicit("type",i)}domainHasZero(){const n=this.get("type");if(We([pn.LOG,pn.TIME,pn.UTC],n))return"definitely-not";const i=this.get("zero");if(i===!0||i===void 0&&We([pn.LINEAR,pn.SQRT,pn.POW],n))return"definitely";const r=this.get("domains");if(r.length>0){let s=!1,o=!1,a=!1;for(const l of r){if(G(l)){const u=l[0],c=l[l.length-1];if(Ke(u)&&Ke(c))if(u<=0&&c>=0){s=!0;continue}else{o=!0;continue}}a=!0}if(s)return"definitely";if(o&&!a)return"definitely-not"}return"maybe"}}const xme=["range","scheme"];function wme(e){const t=e.component.scales;for(const n of P7){const i=t[n];if(!i)continue;const r=kme(n,e);i.setWithExplicit("range",r)}}function iL(e,t){const n=e.fieldDef(t);if(n!=null&&n.bin){const{bin:i,field:r}=n,s=ui(t),o=e.getName(s);if(ie(i)&&i.binned&&i.step!==void 0)return new sn(()=>{const a=e.scaleName(t),l=`(domain("${a}")[1] - domain("${a}")[0]) / ${i.step}`;return`${e.getSignalName(o)} / (${l})`});if(vt(i)){const a=mw(e,r,i);return new sn(()=>{const l=e.getSignalName(a),u=`(${l}.stop - ${l}.start) / ${l}.step`;return`${e.getSignalName(o)} / (${u})`})}}}function kme(e,t){const n=t.specifiedScales[e],{size:i}=t,s=t.getScaleComponent(e).get("type");for(const f of xme)if(n[f]!==void 0){const d=ux(s,f),h=nN(e,f);if(!d)K(ND(s,f,e));else if(h)K(h);else switch(f){case"range":{const p=n.range;if(G(p)){if(It(e))return ds(p.map(g=>{if(g==="width"||g==="height"){const m=t.getName(g),y=t.getSignalName.bind(t);return sn.fromName(y,m)}return g}))}else if(ie(p))return ds({data:t.requestDataName(Ct.Main),field:p.field,sort:{op:"min",field:t.vgField(e)}});return ds(p)}case"scheme":return ds(Eme(n[f]))}}const o=e===$t||e==="xOffset"?"width":"height",a=i[o];if(fs(a)){if(It(e))if(rn(s)){const f=sL(a,t,e);if(f)return ds({step:f})}else K(RD(o));else if(Ld(e)){const f=e===Go?"x":"y";if(t.getScaleComponent(f).get("type")==="band"){const p=oL(a,s);if(p)return ds(p)}}}const{rangeMin:l,rangeMax:u}=n,c=$me(e,t);return(l!==void 0||u!==void 0)&&ux(s,"rangeMin")&&G(c)&&c.length===2?ds([l??c[0],u??c[1]]):$i(c)}function Eme(e){return Phe(e)?{scheme:e.name,...wi(e,["name"])}:{scheme:e}}function rL(e,t,n,{center:i}={}){const r=ui(e),s=t.getName(r),o=t.getSignalName.bind(t);return e===tn&&wr(n)?i?[sn.fromName(a=>`${o(a)}/2`,s),sn.fromName(a=>`-${o(a)}/2`,s)]:[sn.fromName(o,s),0]:i?[sn.fromName(a=>`-${o(a)}/2`,s),sn.fromName(a=>`${o(a)}/2`,s)]:[0,sn.fromName(o,s)]}function $me(e,t){const{size:n,config:i,mark:r,encoding:s}=t,{type:o}=Yt(s[e]),l=t.getScaleComponent(e).get("type"),{domain:u,domainMid:c}=t.specifiedScales[e];switch(e){case $t:case tn:{if(We(["point","band"],l)){const f=aL(e,n,i.view);if(fs(f))return{step:sL(f,t,e)}}return rL(e,t,l)}case Go:case Xu:return Sme(e,t,l);case Us:{const f=Fme(r,i),d=Tme(r,n,t,i);return ec(l)?Ame(f,d,Cme(l,i,u,e)):[f,d]}case Wi:return[0,Math.PI*2];case el:return[0,360];case yr:return[0,new sn(()=>{const f=t.getSignalName(Si(t.parent)?"child_width":"width"),d=t.getSignalName(Si(t.parent)?"child_height":"height");return`min(${f},${d})/2`})];case Vo:return{step:1e3/i.scale.framesPerSecond};case Zo:return[i.scale.minStrokeWidth,i.scale.maxStrokeWidth];case Ko:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case li:return"symbol";case ai:case ns:case is:return l==="ordinal"?o==="nominal"?"category":"ordinal":c!==void 0?"diverging":r==="rect"||r==="geoshape"?"heatmap":"ramp";case qs:case Yo:case Xo:return[i.scale.minOpacity,i.scale.maxOpacity]}}function sL(e,t,n){const{encoding:i}=t,r=t.getScaleComponent(n),s=N7(n),o=i[s];if(iR({step:e,offsetIsDiscrete:Le(o)&&sx(o.type)})==="offset"&&LN(i,s)){const l=t.getScaleComponent(s);let c=`domain('${t.scaleName(s)}').length`;if(l.get("type")==="band"){const d=l.get("paddingInner")??l.get("padding")??0,h=l.get("paddingOuter")??l.get("padding")??0;c=`bandspace(${c}, ${d}, ${h})`}const f=r.get("paddingInner")??r.get("padding");return{signal:`${e.step} * ${c} / (1-${nde(f)})`}}else return e.step}function oL(e,t){if(iR({step:e,offsetIsDiscrete:rn(t)})==="offset")return{step:e.step}}function Sme(e,t,n){const i=e===Go?"x":"y",r=t.getScaleComponent(i);if(!r)return rL(i,t,n,{center:!0});const s=r.get("type"),o=t.scaleName(i),{markDef:a,config:l}=t;if(s==="band"){const u=aL(i,t.size,t.config.view);if(fs(u)){const c=oL(u,n);if(c)return c}return[0,{signal:`bandwidth('${o}')`}]}else{const u=t.encoding[i];if(J(u)&&u.timeUnit){const c=GD(u.timeUnit,p=>`scale('${o}', ${p})`),f=t.config.scale.bandWithNestedOffsetPaddingInner,d=na({fieldDef:u,markDef:a,config:l})-.5,h=d!==0?` + ${d}`:"";if(f){const p=ye(f)?`${f.signal}/2${h}`:`${f/2+d}`,g=ye(f)?`(1 - ${f.signal}/2)${h}`:`${1-f/2+d}`;return[{signal:`${p} * (${c})`},{signal:`${g} * (${c})`}]}return[0,{signal:c}]}return qM(`Cannot use ${e} scale if ${i} scale is not discrete.`)}}function aL(e,t,n){const i=e===$t?"width":"height",r=t[i];return r!==void 0?r:O1(n,i)}function Cme(e,t,n,i){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return n!==void 0&&G(n)?n.length+1:(K(lhe(i)),3)}}function Ame(e,t,n){const i=()=>{const r=xr(t),s=xr(e),o=`(${r} - ${s}) / (${n} - 1)`;return`sequence(${s}, ${r} + ${o}, ${o})`};return ye(t)?new sn(i):{signal:i()}}function Fme(e,t){switch(e){case"bar":case"tick":return t.scale.minBandSize;case"line":case"trail":case"rule":return t.scale.minStrokeWidth;case"text":return t.scale.minFontSize;case"point":case"square":case"circle":return t.scale.minSize}throw new Error(f1("size",e))}const lL=.95;function Tme(e,t,n,i){const r={x:iL(n,"x"),y:iL(n,"y")};switch(e){case"bar":case"tick":{if(i.scale.maxBandSize!==void 0)return i.scale.maxBandSize;const s=uL(t,r,i.view);return Ke(s)?s-1:new sn(()=>`${s.signal} - 1`)}case"line":case"trail":case"rule":return i.scale.maxStrokeWidth;case"text":return i.scale.maxFontSize;case"point":case"square":case"circle":{if(i.scale.maxSize)return i.scale.maxSize;const s=uL(t,r,i.view);return Ke(s)?Math.pow(lL*s,2):new sn(()=>`pow(${lL} * ${s.signal}, 2)`)}}throw new Error(f1("size",e))}function uL(e,t,n){const i=fs(e.width)?e.width.step:Px(n,"width"),r=fs(e.height)?e.height.step:Px(n,"height");return t.x||t.y?new sn(()=>`min(${[t.x?t.x.signal:i,t.y?t.y.signal:r].join(", ")})`):Math.min(i,r)}function cL(e,t){At(e)?Mme(e,t):hL(e,t)}function Mme(e,t){const n=e.component.scales,{config:i,encoding:r,markDef:s,specifiedScales:o}=e;for(const a of X(n)){const l=o[a],u=n[a],c=e.getScaleComponent(a),f=Yt(r[a]),d=l[t],h=c.get("type"),p=c.get("padding"),g=c.get("paddingInner"),m=ux(h,t),y=nN(a,t);if(d!==void 0&&(m?y&&K(y):K(ND(h,t,a))),m&&y===void 0)if(d!==void 0){const b=f.timeUnit,v=f.type;switch(t){case"domainMax":case"domainMin":ol(l[t])||v==="temporal"||b?u.set(t,{signal:F1(l[t],{type:v,timeUnit:b})},!0):u.set(t,l[t],!0);break;default:u.copyKeyFromObject(t,l)}}else{const b=Z(fL,t)?fL[t]({model:e,channel:a,fieldOrDatumDef:f,scaleType:h,scalePadding:p,scalePaddingInner:g,domain:l.domain,domainMin:l.domainMin,domainMax:l.domainMax,markDef:s,config:i,hasNestedOffsetScale:IN(r,a),hasSecondaryRangeChannel:!!r[rs(a)]}):i.scale[t];b!==void 0&&u.set(t,b,!1)}}}const fL={bins:({model:e,fieldOrDatumDef:t})=>J(t)?Dme(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>Nme(e,t.type),nice:({scaleType:e,channel:t,domain:n,domainMin:i,domainMax:r,fieldOrDatumDef:s})=>Rme(e,t,n,i,r,s),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:i,config:r})=>Ome(e,t,r.scale,n,i,r.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,scaleType:i,config:r,hasNestedOffsetScale:s})=>Lme(e,t,n.type,i,r.scale,s),paddingOuter:({scalePadding:e,channel:t,scaleType:n,scalePaddingInner:i,config:r,hasNestedOffsetScale:s})=>Ime(e,t,n,i,r.scale,s),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:i})=>{const r=J(e)?e.sort:void 0;return Pme(t,r,n,i.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:i,scaleType:r,config:s,hasSecondaryRangeChannel:o})=>zme(e,t,n,i,r,s.scale,o)};function dL(e){At(e)?wme(e):hL(e,"range")}function hL(e,t){const n=e.component.scales;for(const i of e.children)t==="range"?dL(i):cL(i,t);for(const i of X(n)){let r;for(const s of e.children){const o=s.component.scales[i];if(o){const a=o.getWithExplicit(t);r=ra(r,a,t,"scale",TR((l,u)=>{switch(t){case"range":return l.step&&u.step?l.step-u.step:0}return 0}))}}n[i].setWithExplicit(t,r)}}function Dme(e,t){const n=t.bin;if(vt(n)){const i=mw(e,t.field,n);return new sn(()=>e.getSignalName(i))}else if(dn(n)&&il(n)&&n.step!==void 0)return{step:n.step}}function Nme(e,t){if(We([ai,ns,is],e)&&t!=="nominal")return"hcl"}function Rme(e,t,n,i,r,s){var o;if(!((o=$r(s))!=null&&o.bin||G(n)||r!=null||i!=null||We([pn.TIME,pn.UTC],e)))return It(t)?!0:void 0}function Ome(e,t,n,i,r,s){if(It(e)){if(ls(t)){if(n.continuousPadding!==void 0)return n.continuousPadding;const{type:o,orient:a}=r;if(o==="bar"&&!(J(i)&&(i.bin||i.timeUnit))&&(a==="vertical"&&e==="x"||a==="horizontal"&&e==="y"))return s.continuousBandSize}if(t===pn.POINT)return n.pointPadding}}function Lme(e,t,n,i,r,s=!1){if(e===void 0){if(It(t)){const{bandPaddingInner:o,barBandPaddingInner:a,rectBandPaddingInner:l,tickBandPaddingInner:u,bandWithNestedOffsetPaddingInner:c}=r;return s?c:Lt(o,n==="bar"?a:n==="tick"?u:l)}else if(Ld(t)&&i===pn.BAND)return r.offsetBandPaddingInner}}function Ime(e,t,n,i,r,s=!1){if(e===void 0){if(It(t)){const{bandPaddingOuter:o,bandWithNestedOffsetPaddingOuter:a}=r;if(s)return a;if(n===pn.BAND)return Lt(o,ye(i)?{signal:`${i.signal}/2`}:i/2)}else if(Ld(t)){if(n===pn.POINT)return .5;if(n===pn.BAND)return r.offsetBandPaddingOuter}}}function Pme(e,t,n,i){if(n==="x"&&i.xReverse!==void 0)return wr(e)&&t==="descending"?ye(i.xReverse)?{signal:`!${i.xReverse.signal}`}:!i.xReverse:i.xReverse;if(wr(e)&&t==="descending")return!0}function zme(e,t,n,i,r,s,o){if(!!n&&n!=="unaggregated"&&wr(r)){if(G(n)){const l=n[0],u=n[n.length-1];if(Ke(l)&&l<=0&&Ke(u)&&u>=0)return!0}return!1}if(e==="size"&&t.type==="quantitative"&&!ec(r))return!0;if(!(J(t)&&t.bin)&&We([...Ws,...Ife],e)){const{orient:l,type:u}=i;return We(["bar","area","line","trail"],u)&&(l==="horizontal"&&e==="y"||l==="vertical"&&e==="x")?!1:We(["bar","area"],u)&&!o?!0:s==null?void 0:s.zero}return!1}function Bme(e,t,n,i,r=!1){const s=jme(t,n,i,r),{type:o}=e;return ss(t)?o!==void 0?Hhe(t,o)?J(n)&&!Whe(o,n.type)?(K(Gde(o,s)),s):o:(K(Hde(t,o,s)),s):s:null}function jme(e,t,n,i){var r;switch(t.type){case"nominal":case"ordinal":{if(Ku(e)||z7(e)==="discrete")return e==="shape"&&t.type==="ordinal"&&K(V7(e,"ordinal")),"ordinal";if(I7(e))return"band";if(It(e)||Ld(e)){if(We(["rect","bar","image","rule","tick"],n.type)||i)return"band"}else if(n.type==="arc"&&e in L7)return"band";const s=n[ui(e)];return cl(s)||nc(t)&&((r=t.axis)!=null&&r.tickBand)?"band":"point"}case"temporal":return Ku(e)?"time":z7(e)==="discrete"?(K(V7(e,"temporal")),"ordinal"):J(t)&&t.timeUnit&&nn(t.timeUnit).utc?"utc":I7(e)?"band":"time";case"quantitative":return Ku(e)?J(t)&&vt(t.bin)?"bin-ordinal":"linear":z7(e)==="discrete"?(K(V7(e,"quantitative")),"ordinal"):I7(e)?"band":"linear";case"geojson":return}throw new Error(MD(t.type))}function Ume(e,{ignoreRange:t}={}){pL(e),JO(e);for(const n of qhe)cL(e,n);t||dL(e)}function pL(e){At(e)?e.component.scales=qme(e):e.component.scales=Hme(e)}function qme(e){const{encoding:t,mark:n,markDef:i}=e,r={};for(const s of P7){const o=Yt(t[s]);if(o&&n===sN&&s===li&&o.type===Qu)continue;let a=o&&o.scale;if(o&&a!==null&&a!==!1){a??(a={});const l=IN(t,s),u=Bme(a,s,o,i,l);r[s]=new nL(e.scaleName(`${s}`,!0),{value:u,explicit:a.type===u})}}return r}const Wme=TR((e,t)=>ZD(e)-ZD(t));function Hme(e){var r;const t=e.component.scales={},n={},i=e.component.resolve;for(const s of e.children){pL(s);for(const o of X(s.component.scales))if((r=i.scale)[o]??(r[o]=NO(o,e)),i.scale[o]==="shared"){const a=n[o],l=s.component.scales[o].getWithExplicit("type");a?Nhe(a.value,l.value)?n[o]=ra(a,l,"type","scale",Wme):(i.scale[o]="independent",delete n[o]):n[o]=l}}for(const s of X(n)){const o=e.scaleName(s,!0),a=n[s];t[s]=new nL(o,a);for(const l of e.children){const u=l.component.scales[s];u&&(l.renameScale(u.get("name"),o),u.merged=!0)}}return t}class Aw{constructor(){U(this,"nameMap");this.nameMap={}}rename(t,n){this.nameMap[t]=n}has(t){return this.nameMap[t]!==void 0}get(t){for(;this.nameMap[t]&&t!==this.nameMap[t];)t=this.nameMap[t];return t}}function At(e){return(e==null?void 0:e.type)==="unit"}function Si(e){return(e==null?void 0:e.type)==="facet"}function Fw(e){return(e==null?void 0:e.type)==="concat"}function vc(e){return(e==null?void 0:e.type)==="layer"}class Tw{constructor(t,n,i,r,s,o,a){U(this,"type");U(this,"parent");U(this,"config");U(this,"name");U(this,"size");U(this,"title");U(this,"description");U(this,"data");U(this,"transforms");U(this,"layout");U(this,"scaleNameMap");U(this,"projectionNameMap");U(this,"signalNameMap");U(this,"component");U(this,"view");this.type=n,this.parent=i,this.config=s,this.parent=i,this.config=s,this.view=hn(a),this.name=t.name??r,this.title=ea(t.title)?{text:t.title}:t.title?hn(t.title):void 0,this.scaleNameMap=i?i.scaleNameMap:new Aw,this.projectionNameMap=i?i.projectionNameMap:new Aw,this.signalNameMap=i?i.signalNameMap:new Aw,this.data=t.data,this.description=t.description,this.transforms=Kge(t.transform??[]),this.layout=n==="layer"||n==="unit"?{}:nge(t,n,s),this.component={data:{sources:i?i.component.data.sources:[],outputNodes:i?i.component.data.outputNodes:{},outputNodeRefCounts:i?i.component.data.outputNodeRefCounts:{},isFaceted:w1(t)||(i==null?void 0:i.component.data.isFaceted)&&t.data===void 0},layoutSize:new Zs,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:{scale:{},axis:{},legend:{},...o?Ne(o):{}},selection:null,scales:null,projection:null,axes:{},legends:{}}}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){Ume(this)}parseProjection(){GO(this)}renameTopLevelLayoutSizeSignal(){this.getName("width")!=="width"&&this.renameSignal(this.getName("width"),"width"),this.getName("height")!=="height"&&this.renameSignal(this.getName("height"),"height")}parseLegends(){jO(this)}assembleEncodeFromView(t){const{style:n,...i}=t,r={};for(const s of X(i)){const o=i[s];o!==void 0&&(r[s]=xt(o))}return r}assembleGroupEncodeEntry(t){let n={};return this.view&&(n=this.assembleEncodeFromView(this.view)),!t&&(this.description&&(n.description=xt(this.description)),this.type==="unit"||this.type==="layer")?{width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height"),...n}:bt(n)?void 0:n}assembleLayout(){if(!this.layout)return;const{spacing:t,...n}=this.layout,{component:i,config:r}=this,s=d1e(i.layoutHeaders,r);return{padding:t,...this.assembleDefaultLayout(),...n,...s?{titleBand:s}:{}}}assembleDefaultLayout(){return{}}assembleHeaderMarks(){const{layoutHeaders:t}=this.component;let n=[];for(const i of Gi)t[i].title&&n.push(o1e(this,i));for(const i of cw)n=n.concat(a1e(this,i));return n}assembleAxes(){return V0e(this.component.axes,this.config)}assembleLegends(){return qO(this)}assembleProjections(){return O1e(this)}assembleTitle(){const{encoding:t,...n}=this.title??{},i={...hD(this.config.title).nonMarkTitleProperties,...n,...t?{encode:{update:t}}:{}};if(i.text)return We(["unit","layer"],this.type)?We(["middle",void 0],i.anchor)&&(i.frame??(i.frame="group")):i.anchor??(i.anchor="start"),bt(i)?void 0:i}assembleGroup(t=[]){const n={};t=t.concat(this.assembleSignals()),t.length>0&&(n.signals=t);const i=this.assembleLayout();i&&(n.layout=i),n.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks());const r=!this.parent||Si(this.parent)?eL(this):[];r.length>0&&(n.scales=r);const s=this.assembleAxes();s.length>0&&(n.axes=s);const o=this.assembleLegends();return o.length>0&&(n.legends=o),n}getName(t){return Et((this.name?`${this.name}_`:"")+t)}getDataName(t){return this.getName(Ct[t].toLowerCase())}requestDataName(t){const n=this.getDataName(t),i=this.component.data.outputNodeRefCounts;return i[n]=(i[n]||0)+1,n}getSizeSignalRef(t){if(Si(this.parent)){const n=MO(t),i=l1(n),r=this.component.scales[i];if(r&&!r.merged){const s=r.get("type"),o=r.get("range");if(rn(s)&&rl(o)){const a=r.get("name"),l=Z1(this,i),u=Cw(l);if(u){const c=ne({aggregate:"distinct",field:u},{expr:"datum"});return{signal:TO(a,r,c)}}else return K(W7(i)),null}}}return{signal:this.signalNameMap.get(this.getName(t))}}lookupDataSource(t){const n=this.component.data.outputNodes[t];return n?n.getSource():t}getSignalName(t){return this.signalNameMap.get(t)}renameSignal(t,n){this.signalNameMap.rename(t,n)}renameScale(t,n){this.scaleNameMap.rename(t,n)}renameProjection(t,n){this.projectionNameMap.rename(t,n)}scaleName(t,n){if(n)return this.getName(t);if(rD(t)&&ss(t)&&this.component.scales[t]||this.scaleNameMap.has(this.getName(t)))return this.scaleNameMap.get(this.getName(t))}projectionName(t){if(t)return this.getName("projection");if(this.component.projection&&!this.component.projection.merged||this.projectionNameMap.has(this.getName("projection")))return this.projectionNameMap.get(this.getName("projection"))}getScaleComponent(t){if(!this.component.scales)throw new Error("getScaleComponent cannot be called before parseScale(). Make sure you have called parseScale or use parseUnitModelWithScale().");const n=this.component.scales[t];return n&&!n.merged?n:this.parent?this.parent.getScaleComponent(t):void 0}getScaleType(t){const n=this.getScaleComponent(t);return n?n.get("type"):void 0}getSelectionComponent(t,n){let i=this.component.selection[t];if(!i&&this.parent&&(i=this.parent.getSelectionComponent(t,n)),!i)throw new Error(ade(n));return i}hasAxisOrientSignalRef(){var t,n;return((t=this.component.axes.x)==null?void 0:t.some(i=>i.hasOrientSignalRef()))||((n=this.component.axes.y)==null?void 0:n.some(i=>i.hasOrientSignalRef()))}}class gL extends Tw{vgField(t,n={}){const i=this.fieldDef(t);if(i)return ne(i,n)}reduceFieldDef(t,n){return Npe(this.getMapping(),(i,r,s)=>{const o=$r(r);return o?t(i,o,s):i},n)}forEachFieldDef(t,n){$x(this.getMapping(),(i,r)=>{const s=$r(i);s&&t(s,r)},n)}}class K1 extends ct{constructor(n,i){super(n);U(this,"transform");this.transform=i,this.transform=Ne(i);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"value",r[1]??"density"];const s=this.transform.resolve??"shared";this.transform.resolve=s}clone(){return new K1(null,Ne(this.transform))}dependentFields(){return new Set([this.transform.density,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`DensityTransform ${Ge(this.transform)}`}assemble(){const{density:n,...i}=this.transform,r={type:"kde",field:n,...i};return r.resolve=this.transform.resolve,r}}class J1 extends ct{constructor(n,i){super(n);U(this,"transform");this.transform=i,this.transform=Ne(i)}clone(){return new J1(null,Ne(this.transform))}dependentFields(){return new Set([this.transform.extent])}producedFields(){return new Set([])}hash(){return`ExtentTransform ${Ge(this.transform)}`}assemble(){const{extent:n,param:i}=this.transform;return{type:"extent",field:n,signal:i}}}class Q1 extends ct{constructor(n,i){super(n);U(this,"transform");this.transform=i,this.transform=Ne(i);const{flatten:r,as:s=[]}=this.transform;this.transform.as=r.map((o,a)=>s[a]??o)}clone(){return new Q1(this.parent,Ne(this.transform))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return`FlattenTransform ${Ge(this.transform)}`}assemble(){const{flatten:n,as:i}=this.transform;return{type:"flatten",fields:n,as:i}}}class em extends ct{constructor(n,i){super(n);U(this,"transform");this.transform=i,this.transform=Ne(i);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"key",r[1]??"value"]}clone(){return new em(null,Ne(this.transform))}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return`FoldTransform ${Ge(this.transform)}`}assemble(){const{fold:n,as:i}=this.transform;return{type:"fold",fields:n,as:i}}}class _c extends ct{constructor(n,i,r,s){super(n);U(this,"fields");U(this,"geojson");U(this,"signal");this.fields=i,this.geojson=r,this.signal=s}clone(){return new _c(null,Ne(this.fields),this.geojson,this.signal)}static parseAll(n,i){if(i.component.projection&&!i.component.projection.isFit)return n;let r=0;for(const s of[[vr,br],[Hi,_r]]){const o=s.map(a=>{const l=Yt(i.encoding[a]);return J(l)?l.field:cs(l)?{expr:`${l.datum}`}:Er(l)?{expr:`${l.value}`}:void 0});(o[0]||o[1])&&(n=new _c(n,o,null,i.getName(`geojson_${r++}`)))}if(i.channelHasField(li)){const s=i.typedFieldDef(li);s.type===Qu&&(n=new _c(n,null,s.field,i.getName(`geojson_${r++}`)))}return n}dependentFields(){const n=(this.fields??[]).filter(re);return new Set([...this.geojson?[this.geojson]:[],...n])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} ${Ge(this.fields)}`}assemble(){return[...this.geojson?[{type:"filter",expr:`isValid(datum["${this.geojson}"])`}]:[],{type:"geojson",...this.fields?{fields:this.fields}:{},...this.geojson?{geojson:this.geojson}:{},signal:this.signal}]}}class Qd extends ct{constructor(n,i,r,s){super(n);U(this,"projection");U(this,"fields");U(this,"as");this.projection=i,this.fields=r,this.as=s}clone(){return new Qd(null,this.projection,Ne(this.fields),Ne(this.as))}static parseAll(n,i){if(!i.projectionName())return n;for(const r of[[vr,br],[Hi,_r]]){const s=r.map(a=>{const l=Yt(i.encoding[a]);return J(l)?l.field:cs(l)?{expr:`${l.datum}`}:Er(l)?{expr:`${l.value}`}:void 0}),o=r[0]===Hi?"2":"";(s[0]||s[1])&&(n=new Qd(n,i.projectionName(),s,[i.getName(`x${o}`),i.getName(`y${o}`)]))}return n}dependentFields(){return new Set(this.fields.filter(re))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${Ge(this.fields)} ${Ge(this.as)}`}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class xl extends ct{constructor(n,i){super(n);U(this,"transform");this.transform=i}clone(){return new xl(null,Ne(this.transform))}dependentFields(){return new Set([this.transform.impute,this.transform.key,...this.transform.groupby??[]])}producedFields(){return new Set([this.transform.impute])}processSequence(n){const{start:i=0,stop:r,step:s}=n;return{signal:`sequence(${[i,r,...s?[s]:[]].join(",")})`}}static makeFromTransform(n,i){return new xl(n,i)}static makeFromEncoding(n,i){const r=i.encoding,s=r.x,o=r.y;if(J(s)&&J(o)){const a=s.impute?s:o.impute?o:void 0;if(a===void 0)return;const l=s.impute?o:o.impute?s:void 0,{method:u,value:c,frame:f,keyvals:d}=a.impute,h=BN(i.mark,r);return new xl(n,{impute:a.field,key:l.field,...u?{method:u}:{},...c!==void 0?{value:c}:{},...f?{frame:f}:{},...d!==void 0?{keyvals:d}:{},...h.length?{groupby:h}:{}})}return null}hash(){return`Impute ${Ge(this.transform)}`}assemble(){const{impute:n,key:i,keyvals:r,method:s,groupby:o,value:a,frame:l=[null,null]}=this.transform,u={type:"impute",field:n,key:i,...r?{keyvals:Dge(r)?this.processSequence(r):r}:{},method:"value",...o?{groupby:o}:{},value:!s||s==="value"?a:null};if(s&&s!=="value"){const c={type:"window",as:[`imputed_${n}_value`],ops:[s],fields:[n],frame:l,ignorePeers:!1,...o?{groupby:o}:{}},f={type:"formula",expr:`datum.${n} === null ? datum.imputed_${n}_value : datum.${n}`,as:n};return[u,c,f]}else return[u]}}class tm extends ct{constructor(n,i){super(n);U(this,"transform");this.transform=i,this.transform=Ne(i);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??i.on,r[1]??i.loess]}clone(){return new tm(null,Ne(this.transform))}dependentFields(){return new Set([this.transform.loess,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`LoessTransform ${Ge(this.transform)}`}assemble(){const{loess:n,on:i,...r}=this.transform;return{type:"loess",x:i,y:n,...r}}}class eh extends ct{constructor(n,i,r){super(n);U(this,"transform");U(this,"secondary");this.transform=i,this.secondary=r}clone(){return new eh(null,Ne(this.transform),this.secondary)}static make(n,i,r,s){const o=i.component.data.sources,{from:a}=r;let l=null;if(Nge(a)){let u=vL(a.data,o);u||(u=new bl(a.data),o.push(u));const c=i.getName(`lookup_${s}`);l=new ci(u,c,Ct.Lookup,i.component.data.outputNodeRefCounts),i.component.data.outputNodes[c]=l}else if(Rge(a)){const u=a.param;r={as:u,...r};let c;try{c=i.getSelectionComponent(Et(u),u)}catch{throw new Error(fde(u))}if(l=c.materialized,!l)throw new Error(dde(u))}return new eh(n,r,l.getSource())}dependentFields(){return new Set([this.transform.lookup])}producedFields(){return new Set(this.transform.as?se(this.transform.as):this.transform.from.fields)}hash(){return`Lookup ${Ge({transform:this.transform,secondary:this.secondary})}`}assemble(){let n;if(this.transform.from.fields)n={values:this.transform.from.fields,...this.transform.as?{as:se(this.transform.as)}:{}};else{let i=this.transform.as;re(i)||(K(kde),i="_lookup"),n={as:[i]}}return{type:"lookup",from:this.secondary,key:this.transform.from.key,fields:[this.transform.lookup],...n,...this.transform.default?{default:this.transform.default}:{}}}}class nm extends ct{constructor(n,i){super(n);U(this,"transform");this.transform=i,this.transform=Ne(i);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??"prob",r[1]??"value"]}clone(){return new nm(null,Ne(this.transform))}dependentFields(){return new Set([this.transform.quantile,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`QuantileTransform ${Ge(this.transform)}`}assemble(){const{quantile:n,...i}=this.transform;return{type:"quantile",field:n,...i}}}class im extends ct{constructor(n,i){super(n);U(this,"transform");this.transform=i,this.transform=Ne(i);const r=this.transform.as??[void 0,void 0];this.transform.as=[r[0]??i.on,r[1]??i.regression]}clone(){return new im(null,Ne(this.transform))}dependentFields(){return new Set([this.transform.regression,this.transform.on,...this.transform.groupby??[]])}producedFields(){return new Set(this.transform.as)}hash(){return`RegressionTransform ${Ge(this.transform)}`}assemble(){const{regression:n,on:i,...r}=this.transform;return{type:"regression",x:i,y:n,...r}}}class rm extends ct{constructor(n,i){super(n);U(this,"transform");this.transform=i}clone(){return new rm(null,Ne(this.transform))}addDimensions(n){this.transform.groupby=es((this.transform.groupby??[]).concat(n),i=>i)}producedFields(){}dependentFields(){return new Set([this.transform.pivot,this.transform.value,...this.transform.groupby??[]])}hash(){return`PivotTransform ${Ge(this.transform)}`}assemble(){const{pivot:n,value:i,groupby:r,limit:s,op:o}=this.transform;return{type:"pivot",field:n,value:i,...s!==void 0?{limit:s}:{},...o!==void 0?{op:o}:{},...r!==void 0?{groupby:r}:{}}}}class sm extends ct{constructor(n,i){super(n);U(this,"transform");this.transform=i}clone(){return new sm(null,Ne(this.transform))}dependentFields(){return new Set}producedFields(){return new Set}hash(){return`SampleTransform ${Ge(this.transform)}`}assemble(){return{type:"sample",size:this.transform.sample}}}function mL(e){let t=0;function n(i,r){if(i instanceof bl&&!i.isGenerator&&!ac(i.data)&&(e.push(r),r={name:null,source:r.name,transform:[]}),i instanceof Mn&&(i.parent instanceof bl&&!r.source?(r.format={...r.format,parse:i.assembleFormatParse()},r.transform.push(...i.assembleTransforms(!0))):r.transform.push(...i.assembleTransforms())),i instanceof mc){r.name||(r.name=`data_${t++}`),!r.source||r.transform.length>0?(e.push(r),i.data=r.name):i.data=r.source,e.push(...i.assemble());return}switch((i instanceof Kd||i instanceof Jd||i instanceof yc||i instanceof dc||i instanceof hc||i instanceof Qd||i instanceof Cr||i instanceof eh||i instanceof bc||i instanceof _l||i instanceof em||i instanceof Q1||i instanceof K1||i instanceof tm||i instanceof nm||i instanceof im||i instanceof oa||i instanceof sm||i instanceof rm||i instanceof J1)&&r.transform.push(i.assemble()),(i instanceof gs||i instanceof hs||i instanceof xl||i instanceof eo||i instanceof _c)&&r.transform.push(...i.assemble()),i instanceof ci&&(r.source&&r.transform.length===0?i.setSource(r.source):i.parent instanceof ci?i.setSource(r.name):(r.name||(r.name=`data_${t++}`),i.setSource(r.name),i.numChildren()===1&&(e.push(r),r={name:null,source:r.name,transform:[]}))),i.numChildren()){case 0:i instanceof ci&&(!r.source||r.transform.length>0)&&e.push(r);break;case 1:n(i.children[0],r);break;default:{r.name||(r.name=`data_${t++}`);let s=r.name;!r.source||r.transform.length>0?e.push(r):s=r.source;for(const o of i.children)n(o,{name:null,source:s,transform:[]});break}}}return n}function Gme(e){const t=[],n=mL(t);for(const i of e.children)n(i,{source:e.name,name:null,transform:[]});return t}function Vme(e,t){const n=[],i=mL(n);let r=0;for(const o of e.sources){o.hasName()||(o.dataName=`source_${r++}`);const a=o.assemble();i(o,a)}for(const o of n)o.transform.length===0&&delete o.transform;let s=0;for(const[o,a]of n.entries())(a.transform??[]).length===0&&!a.source&&n.splice(s++,0,n.splice(o,1)[0]);for(const o of n)for(const a of o.transform??[])a.type==="lookup"&&(a.from=e.outputNodes[a.from].getSource());for(const o of n)o.name in t&&(o.values=t[o.name]);return n}function Yme(e){return e==="top"||e==="left"||ye(e)?"header":"footer"}function Xme(e){for(const t of Gi)Zme(e,t);bL(e,"x"),bL(e,"y")}function Zme(e,t){var o;const{facet:n,config:i,child:r,component:s}=e;if(e.channelHasField(t)){const a=n[t],l=gc("title",null,i,t);let u=ic(a,i,{allowDisabling:!0,includeDefault:l===void 0||!!l});r.component.layoutHeaders[t].title&&(u=G(u)?u.join(", "):u,u+=` / ${r.component.layoutHeaders[t].title}`,r.component.layoutHeaders[t].title=null);const c=gc("labelOrient",a.header,i,t),f=a.header!==null?Lt((o=a.header)==null?void 0:o.labels,i.header.labels,!0):!1,d=We(["bottom","right"],c)?"footer":"header";s.layoutHeaders[t]={title:a.header!==null?u:null,facetFieldDef:a,[d]:t==="facet"?[]:[yL(e,t,f)]}}}function yL(e,t,n){const i=t==="row"?"height":"width";return{labels:n,sizeSignal:e.child.component.layoutSize.get(i)?e.child.getSizeSignalRef(i):void 0,axes:[]}}function bL(e,t){const{child:n}=e;if(n.component.axes[t]){const{layoutHeaders:i,resolve:r}=e.component;if(r.axis[t]=pw(r,t),r.axis[t]==="shared"){const s=t==="x"?"column":"row",o=i[s];for(const a of n.component.axes[t]){const l=Yme(a.get("orient"));o[l]??(o[l]=[yL(e,s,!1)]);const u=Zd(a,"main",e.config,{header:!0});u&&o[l][0].axes.push(u),a.mainExtracted=!0}}}}function Kme(e){Mw(e),om(e,"width"),om(e,"height")}function Jme(e){Mw(e);const t=e.layout.columns===1?"width":"childWidth",n=e.layout.columns===void 0?"height":"childHeight";om(e,t),om(e,n)}function Mw(e){for(const t of e.children)t.parseLayoutSize()}function om(e,t){const n=MO(t),i=l1(n),r=e.component.resolve,s=e.component.layoutSize;let o;for(const a of e.children){const l=a.component.layoutSize.getWithExplicit(n),u=r.scale[i]??NO(i,e);if(u==="independent"&&l.value==="step"){o=void 0;break}if(o){if(u==="independent"&&o.value!==l.value){o=void 0;break}o=ra(o,l,n,"")}else o=l}if(o){for(const a of e.children)e.renameSignal(a.getName(n),e.getName(t)),a.component.layoutSize.set(n,"merged",!1);s.setWithExplicit(t,o)}else s.setWithExplicit(t,{explicit:!1,value:void 0})}function Qme(e){const{size:t,component:n}=e;for(const i of Ws){const r=ui(i);if(t[r]!=null&&t[r]!=null){const s=t[r];n.layoutSize.set(r,fs(s)?"step":s,!0)}else{const s=e2e(e,r);n.layoutSize.set(r,s,!1)}}}function e2e(e,t){const n=t==="width"?"x":"y",i=e.config,r=e.getScaleComponent(n);if(r){const s=r.get("type"),o=r.get("range");if(rn(s)){const a=O1(i.view,t);return rl(o)||fs(a)?"step":a}else return Ix(i.view,t)}else{if(e.hasProjection||e.mark==="arc")return Ix(i.view,t);{const s=O1(i.view,t);return fs(s)?s.step:s}}}function Dw(e,t,n){return ne(t,{suffix:`by_${ne(e)}`,...n})}class th extends gL{constructor(n,i,r,s){super(n,"facet",i,r,s,n.resolve);U(this,"facet");U(this,"child");U(this,"children");this.child=Iw(n.spec,this,this.getName("child"),void 0,s),this.children=[this.child],this.facet=this.initFacet(n.facet)}initFacet(n){if(!Ud(n))return{facet:this.initFacetFieldDef(n,"facet")};const i=X(n),r={};for(const s of i){if(![Ps,zs].includes(s)){K(f1(s,"facet"));break}const o=n[s];if(o.field===void 0){K(G7(o,s));break}r[s]=this.initFacetFieldDef(o,s)}return r}initFacetFieldDef(n,i){const r=Ex(n,i);return r.header?r.header=hn(r.header):r.header===null&&(r.header=null),r}channelHasField(n){return Z(this.facet,n)}fieldDef(n){return this.facet[n]}parseData(){this.component.data=am(this),this.child.parseData()}parseLayoutSize(){Mw(this)}parseSelections(){this.child.parseSelections(),this.component.selection=this.child.component.selection,Bt(this.component.selection).some(n=>ps(n))&&Y7(H7)}parseMarkGroup(){this.child.parseMarkGroup()}parseAxesAndHeaders(){this.child.parseAxesAndHeaders(),Xme(this)}assembleSelectionTopLevelSignals(n){return this.child.assembleSelectionTopLevelSignals(n)}assembleSignals(){return this.child.assembleSignals(),[]}assembleSelectionData(n){return this.child.assembleSelectionData(n)}getHeaderLayoutMixins(){const n={};for(const i of Gi)for(const r of fw){const s=this.component.layoutHeaders[i],o=s[r],{facetFieldDef:a}=s;if(a){const l=gc("titleOrient",a.header,this.config,i);if(["right","bottom"].includes(l)){const u=G1(i,l);n.titleAnchor??(n.titleAnchor={}),n.titleAnchor[u]="end"}}if(o!=null&&o[0]){const l=i==="row"?"height":"width",u=r==="header"?"headerBand":"footerBand";i!=="facet"&&!this.child.component.layoutSize.get(l)&&(n[u]??(n[u]={}),n[u][i]=.5),s.title&&(n.offset??(n.offset={}),n.offset[i==="row"?"rowTitle":"columnTitle"]=10)}}return n}assembleDefaultLayout(){const{column:n,row:i}=this.facet,r=n?this.columnDistinctSignal():i?1:void 0;let s="all";return(!i&&this.component.resolve.scale.x==="independent"||!n&&this.component.resolve.scale.y==="independent")&&(s="none"),{...this.getHeaderLayoutMixins(),...r?{columns:r}:{},bounds:"full",align:s}}assembleLayoutSignals(){return this.child.assembleLayoutSignals()}columnDistinctSignal(){if(!(this.parent&&this.parent instanceof th))return{signal:`length(data('${this.getName("column_domain")}'))`}}assembleGroupStyle(){}assembleGroup(n){return this.parent&&this.parent instanceof th?{...this.channelHasField("column")?{encode:{update:{columns:{field:ne(this.facet.column,{prefix:"distinct"})}}}}:{},...super.assembleGroup(n)}:super.assembleGroup(n)}getCardinalityAggregateForChild(){const n=[],i=[],r=[];if(this.child instanceof th){if(this.child.channelHasField("column")){const s=ne(this.child.facet.column);n.push(s),i.push("distinct"),r.push(`distinct_${s}`)}}else for(const s of Ws){const o=this.child.component.scales[s];if(o&&!o.merged){const a=o.get("type"),l=o.get("range");if(rn(a)&&rl(l)){const u=Z1(this.child,s),c=Cw(u);c?(n.push(c),i.push("distinct"),r.push(`distinct_${c}`)):K(W7(s))}}}return{fields:n,ops:i,as:r}}assembleFacet(){const{name:n,data:i}=this.component.data.facetRoot,{row:r,column:s}=this.facet,{fields:o,ops:a,as:l}=this.getCardinalityAggregateForChild(),u=[];for(const f of Gi){const d=this.facet[f];if(d){u.push(ne(d));const{bin:h,sort:p}=d;if(vt(h)&&u.push(ne(d,{binSuffix:"end"})),Vs(p)){const{field:g,op:m=x1}=p,y=Dw(d,p);r&&s?(o.push(y),a.push("max"),l.push(y)):(o.push(g),a.push(m),l.push(y))}else if(G(p)){const g=pc(d,f);o.push(g),a.push("max"),l.push(g)}}}const c=!!r&&!!s;return{name:n,data:i,groupby:u,...c||o.length>0?{aggregate:{...c?{cross:c}:{},...o.length?{fields:o,ops:a,as:l}:{}}}:{}}}facetSortFields(n){const{facet:i}=this,r=i[n];return r?Vs(r.sort)?[Dw(r,r.sort,{expr:"datum"})]:G(r.sort)?[pc(r,n,{expr:"datum"})]:[ne(r,{expr:"datum"})]:[]}facetSortOrder(n){const{facet:i}=this,r=i[n];if(r){const{sort:s}=r;return[(Vs(s)?s.order:!G(s)&&s)||"ascending"]}return[]}assembleLabelTitle(){var s;const{facet:n,config:i}=this;if(n.facet)return dw(n.facet,"facet",i);const r={row:["top","bottom"],column:["left","right"]};for(const o of cw)if(n[o]){const a=gc("labelOrient",(s=n[o])==null?void 0:s.header,i,o);if(r[o].includes(a))return dw(n[o],o,i)}}assembleMarks(){const{child:n}=this,i=this.component.data.facetRoot,r=Gme(i),s=n.assembleGroupEncodeEntry(!1),o=this.assembleLabelTitle()||n.assembleTitle(),a=n.assembleGroupStyle();return[{name:this.getName("cell"),type:"group",...o?{title:o}:{},...a?{style:a}:{},from:{facet:this.assembleFacet()},sort:{field:Gi.map(u=>this.facetSortFields(u)).flat(),order:Gi.map(u=>this.facetSortOrder(u)).flat()},...r.length>0?{data:r}:{},...s?{encode:{update:s}}:{},...n.assembleGroup(m0e(this,[]))}]}getMapping(){return this.facet}}function t2e(e,t){const{row:n,column:i}=t;if(n&&i){let r=null;for(const s of[n,i])if(Vs(s.sort)){const{field:o,op:a=x1}=s.sort;e=r=new _l(e,{joinaggregate:[{op:a,field:o,as:Dw(s,s.sort,{forAs:!0})}],groupby:[ne(s)]})}return r}return null}function vL(e,t){var n,i,r,s;for(const o of t){const a=o.data;if(e.name&&o.hasName()&&e.name!==o.dataName)continue;const l=(n=e.format)==null?void 0:n.mesh,u=(i=a.format)==null?void 0:i.feature;if(l&&u)continue;const c=(r=e.format)==null?void 0:r.feature;if((c||u)&&c!==u)continue;const f=(s=a.format)==null?void 0:s.mesh;if(!((l||f)&&l!==f)){if(Vd(e)&&Vd(a)){if(ki(e.values,a.values))return o}else if(ac(e)&&ac(a)){if(e.url===a.url)return o}else if(MR(e)&&e.name===o.dataName)return o}}return null}function n2e(e,t){if(e.data||!e.parent){if(e.data===null){const i=new bl({values:[]});return t.push(i),i}const n=vL(e.data,t);if(n)return sa(e.data)||(n.data.format=WM({},e.data.format,n.data.format)),!n.hasName()&&e.data.name&&(n.dataName=e.data.name),n;{const i=new bl(e.data);return t.push(i),i}}else return e.parent.component.data.facetRoot?e.parent.component.data.facetRoot:e.parent.component.data.main}function i2e(e,t,n){let i=0;for(const r of t.transforms){let s,o;if(Wge(r))o=e=new hc(e,r),s="derived";else if(qx(r)){const a=Y1e(r);o=e=Mn.makeWithAncestors(e,{},a,n)??e,e=new dc(e,t,r.filter)}else if(kR(r))o=e=gs.makeFromTransform(e,r,t),s="number";else if(Gge(r))s="date",n.getWithExplicit(r.field).value===void 0&&(e=new Mn(e,{[r.field]:s}),n.set(r.field,s,!1)),o=e=hs.makeFromTransform(e,r);else if(Vge(r))o=e=Cr.makeFromTransform(e,r),s="number",sw(t)&&(e=new oa(e));else if(wR(r))o=e=eh.make(e,t,r,i++),s="derived";else if(jge(r))o=e=new bc(e,r),s="number";else if(Uge(r))o=e=new _l(e,r),s="number";else if(Yge(r))o=e=eo.makeFromTransform(e,r),s="derived";else if(Xge(r))o=e=new em(e,r),s="derived";else if(Zge(r))o=e=new J1(e,r),s="derived";else if(qge(r))o=e=new Q1(e,r),s="derived";else if(Oge(r))o=e=new rm(e,r),s="derived";else if(Bge(r))e=new sm(e,r);else if(Hge(r))o=e=xl.makeFromTransform(e,r),s="derived";else if(Lge(r))o=e=new K1(e,r),s="derived";else if(Ige(r))o=e=new nm(e,r),s="derived";else if(Pge(r))o=e=new im(e,r),s="derived";else if(zge(r))o=e=new tm(e,r),s="derived";else{K(wde(r));continue}if(o&&s!==void 0)for(const a of o.producedFields()??[])n.set(a,s,!1)}return e}function am(e){var m;let t=n2e(e,e.component.data.sources);const{outputNodes:n,outputNodeRefCounts:i}=e.component.data,r=e.data,o=!(r&&(sa(r)||ac(r)||Vd(r)))&&e.parent?e.parent.component.data.ancestorParse.clone():new l0e;sa(r)?(DR(r)?t=new Jd(t,r.sequence):Gx(r)&&(t=new Kd(t,r.graticule)),o.parseNothing=!0):((m=r==null?void 0:r.format)==null?void 0:m.parse)===null&&(o.parseNothing=!0),t=Mn.makeExplicit(t,e,o)??t,t=new oa(t);const a=e.parent&&vc(e.parent);(At(e)||Si(e))&&a&&(t=gs.makeFromEncoding(t,e)??t),e.transforms.length>0&&(t=i2e(t,e,o));const l=Z1e(e),u=X1e(e);t=Mn.makeWithAncestors(t,{},{...l,...u},o)??t,At(e)&&(t=_c.parseAll(t,e),t=Qd.parseAll(t,e)),(At(e)||Si(e))&&(a||(t=gs.makeFromEncoding(t,e)??t),t=hs.makeFromEncoding(t,e)??t,t=hc.parseAllForSortIndex(t,e));const c=t=lm(Ct.Raw,e,t);if(At(e)){const y=Cr.makeFromEncoding(t,e);y&&(t=y,sw(e)&&(t=new oa(t))),t=xl.makeFromEncoding(t,e)??t,t=eo.makeFromEncoding(t,e)??t}let f,d;if(At(e)){const{markDef:y,mark:b,config:v}=e,_=ot("invalid",y,v),{marks:x,scales:k}=d=RR({invalid:_,isPath:ta(b)});x!==k&&k==="include-invalid-values"&&(f=t=lm(Ct.PreFilterInvalid,e,t)),x==="exclude-invalid-values"&&(t=yc.make(t,e,d)??t)}const h=t=lm(Ct.Main,e,t);let p;if(At(e)&&d){const{marks:y,scales:b}=d;y==="include-invalid-values"&&b==="exclude-invalid-values"&&(t=yc.make(t,e,d)??t,p=t=lm(Ct.PostFilterInvalid,e,t))}At(e)&&H0e(e,h);let g=null;if(Si(e)){const y=e.getName("facet");t=t2e(t,e.facet)??t,g=new mc(t,e,y,h.getSource()),n[y]=g}return{...e.component.data,outputNodes:n,outputNodeRefCounts:i,raw:c,main:h,facetRoot:g,ancestorParse:o,preFilterInvalid:f,postFilterInvalid:p}}function lm(e,t,n){const{outputNodes:i,outputNodeRefCounts:r}=t.component.data,s=t.getDataName(e),o=new ci(n,s,e,r);return i[s]=o,o}class r2e extends Tw{constructor(n,i,r,s){var o,a,l,u;super(n,"concat",i,r,s,n.resolve);U(this,"children");(((a=(o=n.resolve)==null?void 0:o.axis)==null?void 0:a.x)==="shared"||((u=(l=n.resolve)==null?void 0:l.axis)==null?void 0:u.y)==="shared")&&K(vde),this.children=this.getChildren(n).map((c,f)=>Iw(c,this,this.getName(`concat_${f}`),void 0,s))}parseData(){this.component.data=am(this);for(const n of this.children)n.parseData()}parseSelections(){this.component.selection={};for(const n of this.children){n.parseSelections();for(const i of X(n.component.selection))this.component.selection[i]=n.component.selection[i]}Bt(this.component.selection).some(n=>ps(n))&&Y7(H7)}parseMarkGroup(){for(const n of this.children)n.parseMarkGroup()}parseAxesAndHeaders(){for(const n of this.children)n.parseAxesAndHeaders()}getChildren(n){return R1(n)?n.vconcat:Lx(n)?n.hconcat:n.concat}parseLayoutSize(){Jme(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(n){return this.children.reduce((i,r)=>r.assembleSelectionTopLevelSignals(i),n)}assembleSignals(){return this.children.forEach(n=>n.assembleSignals()),[]}assembleLayoutSignals(){const n=hw(this);for(const i of this.children)n.push(...i.assembleLayoutSignals());return n}assembleSelectionData(n){return this.children.reduce((i,r)=>r.assembleSelectionData(i),n)}assembleMarks(){return this.children.map(n=>{const i=n.assembleTitle(),r=n.assembleGroupStyle(),s=n.assembleGroupEncodeEntry(!1);return{type:"group",name:n.getName("group"),...i?{title:i}:{},...r?{style:r}:{},...s?{encode:{update:s}}:{},...n.assembleGroup()}})}assembleGroupStyle(){}assembleDefaultLayout(){const n=this.layout.columns;return{...n!=null?{columns:n}:{},bounds:"full",align:"each"}}}function s2e(e){return e===!1||e===null}const o2e={disable:1,gridScale:1,scale:1,...NN,labelExpr:1,encode:1},_L=X(o2e);class Nw extends Zs{constructor(n={},i={},r=!1){super();U(this,"explicit");U(this,"implicit");U(this,"mainExtracted");this.explicit=n,this.implicit=i,this.mainExtracted=r}clone(){return new Nw(Ne(this.explicit),Ne(this.implicit),this.mainExtracted)}hasAxisPart(n){return n==="axis"?!0:n==="grid"||n==="title"?!!this.get(n):!s2e(this.get(n))}hasOrientSignalRef(){return ye(this.explicit.orient)}}function a2e(e,t,n){const{encoding:i,config:r}=e,s=Yt(i[t])??Yt(i[rs(t)]),o=e.axis(t)||{},{format:a,formatType:l}=o;if(dl(l))return{text:kr({fieldOrDatumDef:s,field:"datum.value",format:a,formatType:l,config:r}),...n};if(a===void 0&&l===void 0&&r.customFormatTypes){if(tc(s)==="quantitative"){if(nc(s)&&s.stack==="normalize"&&r.normalizedNumberFormatType)return{text:kr({fieldOrDatumDef:s,field:"datum.value",format:r.normalizedNumberFormat,formatType:r.normalizedNumberFormatType,config:r}),...n};if(r.numberFormatType)return{text:kr({fieldOrDatumDef:s,field:"datum.value",format:r.numberFormat,formatType:r.numberFormatType,config:r}),...n}}if(tc(s)==="temporal"&&r.timeFormatType&&J(s)&&!s.timeUnit)return{text:kr({fieldOrDatumDef:s,field:"datum.value",format:r.timeFormat,formatType:r.timeFormatType,config:r}),...n}}return n}function l2e(e){return Ws.reduce((t,n)=>(e.component.scales[n]&&(t[n]=[g2e(n,e)]),t),{})}const u2e={bottom:"top",top:"bottom",left:"right",right:"left"};function c2e(e){const{axes:t,resolve:n}=e.component,i={top:0,bottom:0,right:0,left:0};for(const r of e.children){r.parseAxesAndHeaders();for(const s of X(r.component.axes))n.axis[s]=pw(e.component.resolve,s),n.axis[s]==="shared"&&(t[s]=f2e(t[s],r.component.axes[s]),t[s]||(n.axis[s]="independent",delete t[s]))}for(const r of Ws){for(const s of e.children)if(s.component.axes[r]){if(n.axis[r]==="independent"){t[r]=(t[r]??[]).concat(s.component.axes[r]);for(const o of s.component.axes[r]){const{value:a,explicit:l}=o.getWithExplicit("orient");if(!ye(a)){if(i[a]>0&&!l){const u=u2e[a];i[a]>i[u]&&o.set("orient",u,!1)}i[a]++}}}delete s.component.axes[r]}if(n.axis[r]==="independent"&&t[r]&&t[r].length>1)for(const[s,o]of(t[r]||[]).entries())s>0&&o.get("grid")&&!o.explicit.grid&&(o.implicit.grid=!1)}}function f2e(e,t){if(e){if(e.length!==t.length)return;const n=e.length;for(let i=0;in.clone());return e}function d2e(e,t){for(const n of _L){const i=ra(e.getWithExplicit(n),t.getWithExplicit(n),n,"axis",(r,s)=>{switch(n){case"title":return wD(r,s);case"gridScale":return{explicit:r.explicit,value:Lt(r.value,s.value)}}return I1(r,s,n,"axis")});e.setWithExplicit(n,i)}return e}function h2e(e,t,n,i,r){if(t==="disable")return n!==void 0;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(ye(n.labelAngle)?n.labelAngle:Nd(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===$O(i,r))return!0}return e===n[t]}const p2e=new Set(["grid","translate","format","formatType","orient","labelExpr","tickCount","position","tickMinStep"]);function g2e(e,t){var y,b;let n=t.axis(e);const i=new Nw,r=Yt(t.encoding[e]),{mark:s,config:o}=t,a=(n==null?void 0:n.orient)||((y=o[e==="x"?"axisX":"axisY"])==null?void 0:y.orient)||((b=o.axis)==null?void 0:b.orient)||t1e(e),l=t.getScaleComponent(e).get("type"),u=Y0e(e,l,a,t.config),c=n!==void 0?!n:lw("disable",o.style,n==null?void 0:n.style,u).configValue;if(i.set("disable",c,n!==void 0),c)return i;n=n||{};const f=J0e(r,n,e,o.style,u),d=pN(n.formatType,r,l),h=hN(r,r.type,n.format,n.formatType,o,!0),p={fieldOrDatumDef:r,axis:n,channel:e,model:t,scaleType:l,orient:a,labelAngle:f,format:h,formatType:d,mark:s,config:o};for(const v of _L){const _=v in wO?wO[v](p):RN(v)?n[v]:void 0,x=_!==void 0,k=h2e(_,v,n,t,e);if(x&&k)i.set(v,_,k);else{const{configValue:w=void 0,configFrom:E=void 0}=RN(v)&&v!=="values"?lw(v,o.style,n.style,u):{},$=w!==void 0;x&&!$?i.set(v,_,k):(E!=="vgAxisConfig"||p2e.has(v)&&$||Gd(w)||ye(w))&&i.set(v,w,!1)}}const g=n.encoding??{},m=DN.reduce((v,_)=>{if(!i.hasAxisPart(_))return v;const x=DO(g[_]??{},t),k=_==="labels"?a2e(t,e,x):x;return k!==void 0&&!bt(k)&&(v[_]={update:k}),v},{});return bt(m)||i.set("encode",m,!!n.encoding||n.labelAngle!==void 0),i}function m2e({encoding:e,size:t}){for(const n of Ws){const i=ui(n);fs(t[i])&&ia(e[n])&&(delete t[i],K(RD(i)))}return t}const y2e={vgMark:"arc",encodeEntry:e=>({...Vi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Zn("x",e,{defaultPos:"mid"}),...Zn("y",e,{defaultPos:"mid"}),...Js(e,"radius"),...Js(e,"theta")})},b2e={vgMark:"area",encodeEntry:e=>({...Vi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"}),...j1("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="horizontal"}),...j1("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:e.markDef.orient==="vertical"}),...iw(e)})},v2e={vgMark:"rect",encodeEntry:e=>({...Vi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Js(e,"x"),...Js(e,"y")})},_2e={vgMark:"shape",encodeEntry:e=>({...Vi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})}),postEncodingTransform:e=>{const{encoding:t}=e,n=t.shape;return[{type:"geoshape",projection:e.projectionName(),...n&&J(n)&&n.type===Qu?{field:ne(n,{expr:"datum"})}:{}}]}},x2e={vgMark:"image",encodeEntry:e=>({...Vi(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"}),...Js(e,"x"),...Js(e,"y"),...ew(e,"url")})},w2e={vgMark:"line",encodeEntry:e=>({...Vi(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"}),...Zn("x",e,{defaultPos:"mid"}),...Zn("y",e,{defaultPos:"mid"}),...gn("size",e,{vgChannel:"strokeWidth"}),...iw(e)})},k2e={vgMark:"trail",encodeEntry:e=>({...Vi(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Zn("x",e,{defaultPos:"mid"}),...Zn("y",e,{defaultPos:"mid"}),...gn("size",e),...iw(e)})};function Rw(e,t){const{config:n}=e;return{...Vi(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"}),...Zn("x",e,{defaultPos:"mid"}),...Zn("y",e,{defaultPos:"mid"}),...gn("size",e),...gn("angle",e),...E2e(e,n,t)}}function E2e(e,t,n){return n?{shape:{value:n}}:gn("shape",e)}const $2e={vgMark:"symbol",encodeEntry:e=>Rw(e)},S2e={vgMark:"symbol",encodeEntry:e=>Rw(e,"circle")},C2e={vgMark:"symbol",encodeEntry:e=>Rw(e,"square")},A2e={vgMark:"rect",encodeEntry:e=>({...Vi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Js(e,"x"),...Js(e,"y")})},F2e={vgMark:"rule",encodeEntry:e=>{const{markDef:t}=e,n=t.orient;return!e.encoding.x&&!e.encoding.y&&!e.encoding.latitude&&!e.encoding.longitude?{}:{...Vi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...j1("x",e,{defaultPos:n==="horizontal"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="vertical"}),...j1("y",e,{defaultPos:n==="vertical"?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:n!=="horizontal"}),...gn("size",e,{vgChannel:"strokeWidth"})}}},T2e={vgMark:"text",encodeEntry:e=>{const{config:t,encoding:n}=e;return{...Vi(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"}),...Zn("x",e,{defaultPos:"mid"}),...Zn("y",e,{defaultPos:"mid"}),...ew(e),...gn("size",e,{vgChannel:"fontSize"}),...gn("angle",e),...iO("align",M2e(e.markDef,n,t)),...iO("baseline",D2e(e.markDef,n,t)),...Zn("radius",e,{defaultPos:null}),...Zn("theta",e,{defaultPos:null})}}};function M2e(e,t,n){if(ot("align",e,n)===void 0)return"center"}function D2e(e,t,n){if(ot("baseline",e,n)===void 0)return"middle"}const um={arc:y2e,area:b2e,bar:v2e,circle:S2e,geoshape:_2e,image:x2e,line:w2e,point:$2e,rect:A2e,rule:F2e,square:C2e,text:T2e,tick:{vgMark:"rect",encodeEntry:e=>{const{config:t,markDef:n}=e,i=n.orient,r=i==="horizontal"?"x":"y",s=i==="horizontal"?"y":"x",o=i==="horizontal"?"height":"width";return{...Vi(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"}),...Js(e,r),...Zn(s,e,{defaultPos:"mid",vgChannel:s==="y"?"yc":"xc"}),[o]:xt(ot("thickness",n,t))}}},trail:k2e};function N2e(e){if(We([y1,g1,Xhe],e.mark)){const t=BN(e.mark,e.encoding);if(t.length>0)return R2e(e,t)}else if(e.mark===m1){const t=j7.some(n=>ot(n,e.markDef,e.config));if(e.stack&&!e.fieldDef("size")&&t)return O2e(e)}return Ow(e)}const xL="faceted_path_";function R2e(e,t){return[{name:e.getName("pathgroup"),type:"group",from:{facet:{name:xL+e.requestDataName(Ct.Main),data:e.requestDataName(Ct.Main),groupby:t}},encode:{update:{width:{field:{group:"width"}},height:{field:{group:"height"}}}},marks:Ow(e,{fromPrefix:xL})}]}const wL="stack_group_";function O2e(e){var u;const[t]=Ow(e,{fromPrefix:wL}),n=e.scaleName(e.stack.fieldChannel),i=(c={})=>e.vgField(e.stack.fieldChannel,c),r=(c,f)=>{const d=[i({prefix:"min",suffix:"start",expr:f}),i({prefix:"max",suffix:"start",expr:f}),i({prefix:"min",suffix:"end",expr:f}),i({prefix:"max",suffix:"end",expr:f})];return`${c}(${d.map(h=>`scale('${n}',${h})`).join(",")})`};let s,o;e.stack.fieldChannel==="x"?(s={...Hu(t.encode.update,["y","yc","y2","height",...j7]),x:{signal:r("min","datum")},x2:{signal:r("max","datum")},clip:{value:!0}},o={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},t.encode.update={...wi(t.encode.update,["y","yc","y2"]),height:{field:{group:"height"}}}):(s={...Hu(t.encode.update,["x","xc","x2","width"]),y:{signal:r("min","datum")},y2:{signal:r("max","datum")},clip:{value:!0}},o={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},t.encode.update={...wi(t.encode.update,["x","xc","x2"]),width:{field:{group:"width"}}});for(const c of j7){const f=os(c,e.markDef,e.config);t.encode.update[c]?(s[c]=t.encode.update[c],delete t.encode.update[c]):f&&(s[c]=xt(f)),f&&(t.encode.update[c]={value:0})}const a=[];if(((u=e.stack.groupbyChannels)==null?void 0:u.length)>0)for(const c of e.stack.groupbyChannels){const f=e.fieldDef(c),d=ne(f);d&&a.push(d),(f!=null&&f.bin||f!=null&&f.timeUnit)&&a.push(ne(f,{binSuffix:"end"}))}return s=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((c,f)=>{if(t.encode.update[f])return{...c,[f]:t.encode.update[f]};{const d=os(f,e.markDef,e.config);return d!==void 0?{...c,[f]:xt(d)}:c}},s),s.stroke&&(s.strokeForeground={value:!0},s.strokeOffset={value:0}),[{type:"group",from:{facet:{data:e.requestDataName(Ct.Main),name:wL+e.requestDataName(Ct.Main),groupby:a,aggregate:{fields:[i({suffix:"start"}),i({suffix:"start"}),i({suffix:"end"}),i({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:s},marks:[{type:"group",encode:{update:o},marks:[t]}]}]}function L2e(e){const{encoding:t,stack:n,mark:i,markDef:r,config:s}=e,o=t.order;if(!(!G(o)&&Er(o)&&E7(o.value)||!o&&E7(ot("order",r,s)))){if((G(o)||J(o))&&!n)return vD(o,{expr:"datum"});if(ta(i)){const a=r.orient==="horizontal"?"y":"x",l=t[a];if(J(l))return{field:a}}}}function Ow(e,t={fromPrefix:""}){var h;const{mark:n,markDef:i,encoding:r,config:s}=e,o=Lt(i.clip,I2e(e),P2e(e)),a=yD(i),l=r.key,u=L2e(e),c=z2e(e);c&&Object.values(e.component.selection).some(p=>p.type==="point"&&!p.bind&&p.on!=="pointerover")&&((h=e.markDef).cursor??(h.cursor="pointer"));const f=ot("aria",i,s),d=um[n].postEncodingTransform?um[n].postEncodingTransform(e):null;return[{name:e.getName("marks"),type:um[n].vgMark,...o?{clip:o}:{},...a?{style:a}:{},...l?{key:l.field}:{},...u?{sort:u}:{},...c||{},...f===!1?{aria:f}:{},from:{data:t.fromPrefix+e.requestDataName(Ct.Main)},encode:{update:um[n].encodeEntry(e)},...d?{transform:d}:{}}]}function I2e(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return t!=null&&t.get("selectionExtent")||n!=null&&n.get("selectionExtent")?!0:void 0}function P2e(e){const t=e.component.projection;return t&&!t.isFit?!0:void 0}function z2e(e){if(!e.component.selection)return null;const t=X(e.component.selection).length;let n=t,i=e.parent;for(;i&&n===0;)n=X(i.component.selection).length,i=i.parent;return n?{interactive:t>0||e.mark==="geoshape"||!!e.encoding.tooltip||!!e.markDef.tooltip}:null}class kL extends gL{constructor(n,i,r,s={},o){super(n,"unit",i,r,o,void 0,rR(n)?n.view:void 0);U(this,"markDef");U(this,"encoding");U(this,"specifiedScales",{});U(this,"stack");U(this,"specifiedAxes",{});U(this,"specifiedLegends",{});U(this,"specifiedProjection",{});U(this,"selection",[]);U(this,"children",[]);U(this,"correctDataNames",n=>{var i,r,s;return(i=n.from)!=null&&i.data&&(n.from.data=this.lookupDataSource(n.from.data),"time"in this.encoding&&(n.from.data=n.from.data+zR)),(s=(r=n.from)==null?void 0:r.facet)!=null&&s.data&&(n.from.facet.data=this.lookupDataSource(n.from.facet.data)),n});const a=us(n.mark)?{...n.mark}:{type:n.mark},l=a.type;a.filled===void 0&&(a.filled=Ege(a,o,{graticule:n.data&&Gx(n.data)}));const u=this.encoding=Mpe(n.encoding||{},l,a.filled,o);this.markDef=hR(a,u,o),this.size=m2e({encoding:u,size:rR(n)?{...s,...n.width!==void 0?{width:n.width}:{},...n.height!==void 0?{height:n.height}:{}}:s}),this.stack=dR(this.markDef,u),this.specifiedScales=this.initScales(l,u),this.specifiedAxes=this.initAxes(u),this.specifiedLegends=this.initLegends(u),this.specifiedProjection=n.projection,this.selection=(n.params??[]).filter(c=>Rx(c)),this.alignStackOrderWithColorDomain()}get hasProjection(){const{encoding:n}=this,i=this.mark===sN,r=n&&Afe.some(s=>Le(n[s]));return i||r}scaleDomain(n){const i=this.specifiedScales[n];return i?i.domain:void 0}axis(n){return this.specifiedAxes[n]}legend(n){return this.specifiedLegends[n]}initScales(n,i){return P7.reduce((r,s)=>{const o=Yt(i[s]);return o&&(r[s]=this.initScale(o.scale??{})),r},{})}initScale(n){const{domain:i,range:r}=n,s=hn(n);return G(i)&&(s.domain=i.map(Ei)),G(r)&&(s.range=r.map(Ei)),s}initAxes(n){return Ws.reduce((i,r)=>{const s=n[r];if(Le(s)||r===$t&&Le(n.x2)||r===tn&&Le(n.y2)){const o=Le(s)?s.axis:void 0;i[r]=o&&this.initAxis({...o})}return i},{})}initAxis(n){const i=X(n),r={};for(const s of i){const o=n[s];r[s]=Gd(o)?pD(o):Ei(o)}return r}initLegends(n){return zfe.reduce((i,r)=>{const s=Yt(n[r]);if(s&&jfe(r)){const o=s.legend;i[r]=o&&hn(o)}return i},{})}alignStackOrderWithColorDomain(){var m;const{color:n,fill:i,order:r,xOffset:s,yOffset:o}=this.encoding,a=i||n,l=J(a)?a:void 0,u=l==null?void 0:l.field,c=l==null?void 0:l.scale,f=l==null?void 0:l.type,d=c==null?void 0:c.domain,h=s||o,p=J(h)?h:void 0,g=`_${u}_sort_index`;if(!r&&Array.isArray(d)&&typeof u=="string"&&f==="nominal")if(p&&!p.sort)p.sort=d;else{if(!this.stack)return;const y=`indexof(${ee(d)}, datum['${u}'])`,b=((m=this.markDef)==null?void 0:m.orient)==="horizontal"?"ascending":"descending";this.transforms.push({calculate:y,as:g}),this.encoding.order={field:g,type:"quantitative",sort:b}}}parseData(){this.component.data=am(this)}parseLayoutSize(){Qme(this)}parseSelections(){this.component.selection=W0e(this,this.selection)}parseMarkGroup(){this.component.mark=N2e(this)}parseAxesAndHeaders(){this.component.axes=l2e(this)}assembleSelectionTopLevelSignals(n){return y0e(this,n)}assembleSignals(){return[..._O(this),...g0e(this,[])]}assembleSelectionData(n){return b0e(this,n)}assembleLayout(){return null}assembleLayoutSignals(){return hw(this)}assembleMarks(){let n=this.component.mark??[];return(!this.parent||!vc(this.parent))&&(n=qR(this,n)),n.map(this.correctDataNames)}assembleGroupStyle(){const{style:n}=this.view||{};return n!==void 0?n:this.encoding.x||this.encoding.y?"cell":"view"}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(n){return pl(this.encoding,n)}fieldDef(n){const i=this.encoding[n];return $r(i)}typedFieldDef(n){const i=this.fieldDef(n);return Xn(i)?i:null}}class Lw extends Tw{constructor(n,i,r,s,o){super(n,"layer",i,r,o,n.resolve,n.view);U(this,"children");const a={...s,...n.width?{width:n.width}:{},...n.height?{height:n.height}:{}};this.children=n.layer.map((l,u)=>{if(L1(l))return new Lw(l,this,this.getName(`layer_${u}`),a,o);if(Ys(l))return new kL(l,this,this.getName(`layer_${u}`),a,o);throw new Error(q7(l))})}parseData(){this.component.data=am(this);for(const n of this.children)n.parseData()}parseLayoutSize(){Kme(this)}parseSelections(){this.component.selection={};for(const n of this.children){n.parseSelections();for(const i of X(n.component.selection))this.component.selection[i]=n.component.selection[i]}Bt(this.component.selection).some(n=>ps(n))&&Y7(H7)}parseMarkGroup(){for(const n of this.children)n.parseMarkGroup()}parseAxesAndHeaders(){c2e(this)}assembleSelectionTopLevelSignals(n){return this.children.reduce((i,r)=>r.assembleSelectionTopLevelSignals(i),n)}assembleSignals(){return this.children.reduce((n,i)=>n.concat(i.assembleSignals()),_O(this))}assembleLayoutSignals(){return this.children.reduce((n,i)=>n.concat(i.assembleLayoutSignals()),hw(this))}assembleSelectionData(n){return this.children.reduce((i,r)=>r.assembleSelectionData(i),n)}assembleGroupStyle(){const n=new Set;for(const r of this.children)for(const s of se(r.assembleGroupStyle()))n.add(s);const i=Array.from(n);return i.length>1?i:i.length===1?i[0]:void 0}assembleTitle(){let n=super.assembleTitle();if(n)return n;for(const i of this.children)if(n=i.assembleTitle(),n)return n}assembleLayout(){return null}assembleMarks(){return v0e(this,this.children.flatMap(n=>n.assembleMarks()))}assembleLegends(){return this.children.reduce((n,i)=>n.concat(i.assembleLegends()),qO(this))}}function Iw(e,t,n,i,r){if(w1(e))return new th(e,t,n,r);if(L1(e))return new Lw(e,t,n,i,r);if(Ys(e))return new kL(e,t,n,i,r);if(ege(e))return new r2e(e,t,n,r);throw new Error(q7(e))}function B2e(e,t={}){t.logger&&uhe(t.logger),t.fieldTitle&&AN(t.fieldTitle);try{const n=cR(zl(t.config,e.config)),i=CR(e,n),r=Iw(i,null,"",void 0,n);return r.parse(),fme(r.component.data,r),{spec:U2e(r,j2e(e,i.autosize,n,r),e.datasets,e.usermeta),normalized:i}}finally{t.logger&&che(),t.fieldTitle&&kpe()}}function j2e(e,t,n,i){const r=i.component.layoutSize.get("width"),s=i.component.layoutSize.get("height");if(t===void 0?(t={type:"pad"},i.hasAxisOrientSignalRef()&&(t.resize=!0)):re(t)&&(t={type:t}),r&&s&&s0e(t.type)){if(r==="step"&&s==="step")K($D()),t.type="pad";else if(r==="step"||s==="step"){const o=r==="step"?"width":"height";K($D(l1(o)));const a=o==="width"?"height":"width";t.type=o0e(a)}}return{...X(t).length===1&&t.type?t.type==="pad"?{}:{autosize:t.type}:{autosize:t},...FR(n,!1),...FR(e,!0)}}function U2e(e,t,n={},i){const r=e.config?dge(e.config):void 0,s=Vme(e.component.data,n),o=e.assembleSelectionData(s),a=e.assembleProjections(),l=e.assembleTitle(),u=e.assembleGroupStyle(),c=e.assembleGroupEncodeEntry(!0);let f=e.assembleLayoutSignals();f=f.filter(p=>(p.name==="width"||p.name==="height")&&p.value!==void 0?(t[p.name]=+p.value,!1):!0);const{params:d,...h}=t;return{$schema:"https://vega.github.io/schema/vega/v6.json",...e.description?{description:e.description}:{},...h,...l?{title:l}:{},...u?{style:u}:{},...c?{encode:{update:c}}:{},data:o,...a.length>0?{projections:a}:{},...e.assembleGroup([...f,...e.assembleSelectionTopLevelSignals([]),...nR(d)]),...r?{config:r}:{},...i?{usermeta:i}:{}}}const q2e=wfe.version,W2e=Object.freeze(Object.defineProperty({__proto__:null,accessPathDepth:Yu,accessPathWithDatum:F7,accessWithDatumToUnescapedPath:ut,compile:B2e,contains:We,deepEqual:ki,deleteNestedProperty:t1,duplicate:Ne,entries:Ho,every:$7,fieldIntersection:A7,flatAccessWithDatum:GM,getFirstDefined:Lt,hasIntersection:S7,hasProperty:Z,hash:Ge,internalField:ZM,isBoolean:Td,isEmpty:bt,isEqual:Efe,isInternalField:KM,isNullOrFalse:E7,isNumeric:n1,keys:X,logicalExpr:Md,mergeDeep:WM,never:qM,normalize:CR,normalizeAngle:Nd,omit:wi,pick:Hu,prefixGenerator:C7,removePathFromField:Vu,replaceAll:Qa,replacePathInField:qi,resetIdCounter:Sfe,setEqual:HM,some:Gu,stringify:st,titleCase:Dd,unescapeSingleQuoteAndPathDot:VM,unique:es,uniqueId:XM,vals:Bt,varName:Et,version:q2e},Symbol.toStringTag,{value:"Module"}));function EL(e){const[t,n]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:n}}var H2e="3.0.0",G2e={version:H2e};const xc="#fff",$L="#888",V2e={background:"#333",view:{stroke:$L},title:{color:xc,subtitleColor:xc},style:{"guide-label":{fill:xc},"guide-title":{fill:xc}},axis:{domainColor:xc,gridColor:$L,tickColor:xc}},wl="#4572a7",Y2e={background:"#fff",arc:{fill:wl},area:{fill:wl},line:{stroke:wl,strokeWidth:2},path:{stroke:wl},rect:{fill:wl},shape:{stroke:wl},symbol:{fill:wl,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:!0,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:!1,tickExtra:!0},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}},kl="#30a2da",Pw="#cbcbcb",X2e="#999",Z2e="#333",SL="#f0f0f0",CL="#333",K2e={arc:{fill:kl},area:{fill:kl},axis:{domainColor:Pw,grid:!0,gridColor:Pw,gridWidth:1,labelColor:X2e,labelFontSize:10,titleColor:Z2e,tickColor:Pw,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:!1},background:SL,group:{fill:SL},legend:{labelColor:CL,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:CL,titleFontSize:14,titlePadding:10},line:{stroke:kl,strokeWidth:2},path:{stroke:kl,strokeWidth:.5},rect:{fill:kl},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:!0,shape:"circle"},shape:{stroke:kl},bar:{binSpacing:2,fill:kl,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}},El="#000",J2e={group:{fill:"#e5e5e5"},arc:{fill:El},area:{fill:El},line:{stroke:El},path:{stroke:El},rect:{fill:El},shape:{stroke:El},symbol:{fill:El,size:40},axis:{domain:!1,grid:!0,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}},Q2e=22,eye="normal",AL="Benton Gothic, sans-serif",FL=11.5,tye="normal",$l="#82c6df",zw="Benton Gothic Bold, sans-serif",TL="normal",ML=13,nh={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"]},nye={background:"#ffffff",title:{anchor:"start",color:"#000000",font:zw,fontSize:Q2e,fontWeight:eye},arc:{fill:$l},area:{fill:$l},line:{stroke:$l,strokeWidth:2},path:{stroke:$l},rect:{fill:$l},shape:{stroke:$l},symbol:{fill:$l,size:30},axis:{labelFont:AL,labelFontSize:FL,labelFontWeight:tye,titleFont:zw,titleFontSize:ML,titleFontWeight:TL},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:AL,labelFontSize:FL,symbolType:"square",titleFont:zw,titleFontSize:ML,titleFontWeight:TL},range:{category:nh["category-6"],diverging:nh["fireandice-6"],heatmap:nh["fire-7"],ordinal:nh["fire-7"],ramp:nh["fire-7"]}},Sl="#ab5787",cm="#979797",iye={background:"#f9f9f9",arc:{fill:Sl},area:{fill:Sl},line:{stroke:Sl},path:{stroke:Sl},rect:{fill:Sl},shape:{stroke:Sl},symbol:{fill:Sl,size:30},axis:{domainColor:cm,domainWidth:.5,gridWidth:.2,labelColor:cm,tickColor:cm,tickWidth:.2,titleColor:cm},axisBand:{grid:!1},axisX:{grid:!0,tickSize:10},axisY:{domain:!1,grid:!0,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}},Cl="#3e5c69",rye={background:"#fff",arc:{fill:Cl},area:{fill:Cl},line:{stroke:Cl},path:{stroke:Cl},rect:{fill:Cl},shape:{stroke:Cl},symbol:{fill:Cl},axis:{domainWidth:.5,grid:!0,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:!1},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}},Yi="#1696d2",DL="#000000",sye="#FFFFFF",fm="Lato",Bw="Lato",oye="Lato",aye="#DEDDDD",lye=18,ih={"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]},uye={background:sye,title:{anchor:"start",fontSize:lye,font:fm},axisX:{domain:!0,domainColor:DL,domainWidth:1,grid:!1,labelFontSize:12,labelFont:Bw,labelAngle:0,tickColor:DL,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:fm},axisY:{domain:!1,domainWidth:1,grid:!0,gridColor:aye,gridWidth:1,labelFontSize:12,labelFont:Bw,labelPadding:8,ticks:!1,titleFontSize:12,titlePadding:10,titleFont:fm,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:Bw,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:fm,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:ih["six-groups-cat-1"],diverging:ih["diverging-colors"],heatmap:ih["diverging-colors"],ordinal:ih["six-groups-seq"],ramp:ih["shades-blue"]},area:{fill:Yi},rect:{fill:Yi},line:{color:Yi,stroke:Yi,strokeWidth:5},trail:{color:Yi,stroke:Yi,strokeWidth:0,size:1},path:{stroke:Yi,strokeWidth:.5},point:{filled:!0},text:{font:oye,color:Yi,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:Yi,stroke:null}},arc:{fill:Yi},shape:{stroke:Yi},symbol:{fill:Yi,size:30}},Al="#3366CC",NL="#ccc",dm="Arial, sans-serif",cye={arc:{fill:Al},area:{fill:Al},path:{stroke:Al},rect:{fill:Al},shape:{stroke:Al},symbol:{stroke:Al},circle:{fill:Al},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:dm,fontSize:12},"guide-title":{font:dm,fontSize:12},"group-title":{font:dm,fontSize:12}},title:{font:dm,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:NL,tickColor:NL,domain:!1,grid:!0},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}},jw=e=>e*(1/3+1),RL=jw(9),OL=jw(10),LL=jw(12),rh="Segoe UI",IL="wf_standard-font, helvetica, arial, sans-serif",PL="#252423",sh="#605E5C",zL="transparent",fye="#C8C6C4",Fr="#118DFF",dye="#12239E",hye="#E66C37",pye="#6B007B",gye="#E044A7",mye="#744EC2",yye="#D9B300",bye="#D64550",BL=Fr,jL="#DEEFFF",UL=[jL,BL],vye={view:{stroke:zL},background:zL,font:rh,header:{titleFont:IL,titleFontSize:LL,titleColor:PL,labelFont:rh,labelFontSize:OL,labelColor:sh},axis:{ticks:!1,grid:!1,domain:!1,labelColor:sh,labelFontSize:RL,titleFont:IL,titleColor:PL,titleFontSize:LL,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:!0,gridColor:fye,gridDash:[1,5],labelFlush:!1},axisBand:{tickExtra:!0},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:Fr},line:{stroke:Fr,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:rh,fontSize:RL,fill:sh},arc:{fill:Fr},area:{fill:Fr,line:!0,opacity:.6},path:{stroke:Fr},rect:{fill:Fr},point:{fill:Fr,filled:!0,size:75},shape:{stroke:Fr},symbol:{fill:Fr,strokeWidth:1.5,size:50},legend:{titleFont:rh,titleFontWeight:"bold",titleColor:sh,labelFont:rh,labelFontSize:OL,labelColor:sh,symbolType:"circle",symbolSize:75},range:{category:[Fr,dye,hye,pye,gye,mye,yye,bye],diverging:UL,heatmap:UL,ordinal:[jL,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",BL]}},Uw='IBM Plex Sans,system-ui,-apple-system,BlinkMacSystemFont,".sfnstext-regular",sans-serif',_ye='IBM Plex Sans Condensed, system-ui, -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif',qw=400,hm={textPrimary:{g90:"#f4f4f4",g100:"#f4f4f4",white:"#161616",g10:"#161616"},textSecondary:{g90:"#c6c6c6",g100:"#c6c6c6",white:"#525252",g10:"#525252"},layerAccent01:{white:"#e0e0e0",g10:"#e0e0e0",g90:"#525252",g100:"#393939"},gridBg:{white:"#ffffff",g10:"#ffffff",g90:"#161616",g100:"#161616"}},xye=["#8a3ffc","#33b1ff","#007d79","#ff7eb6","#fa4d56","#fff1f1","#6fdc8c","#4589ff","#d12771","#d2a106","#08bdba","#bae6ff","#ba4e00","#d4bbff"],wye=["#6929c4","#1192e8","#005d5d","#9f1853","#fa4d56","#570408","#198038","#002d9c","#ee538b","#b28600","#009d9a","#012749","#8a3800","#a56eff"];function pm({theme:e,background:t}){const n=["white","g10"].includes(e)?"light":"dark",i=hm.gridBg[e],r=hm.textPrimary[e],s=hm.textSecondary[e],o=n==="dark"?xye:wye,a=n==="dark"?"#d4bbff":"#6929c4";return{background:t,arc:{fill:a},area:{fill:a},path:{stroke:a},rect:{fill:a},shape:{stroke:a},symbol:{stroke:a},circle:{fill:a},view:{fill:i,stroke:i},group:{fill:i},title:{color:r,anchor:"start",dy:-15,fontSize:16,font:Uw,fontWeight:600},axis:{labelColor:s,labelFontSize:12,labelFont:_ye,labelFontWeight:qw,titleColor:r,titleFontWeight:600,titleFontSize:12,grid:!0,gridColor:hm.layerAccent01[e],labelAngle:0},axisX:{titlePadding:10},axisY:{titlePadding:2.5},style:{"guide-label":{font:Uw,fill:s,fontWeight:qw},"guide-title":{font:Uw,fill:s,fontWeight:qw}},range:{category:o,diverging:["#750e13","#a2191f","#da1e28","#fa4d56","#ff8389","#ffb3b8","#ffd7d9","#fff1f1","#e5f6ff","#bae6ff","#82cfff","#33b1ff","#1192e8","#0072c3","#00539a","#003a6d"],heatmap:["#f6f2ff","#e8daff","#d4bbff","#be95ff","#a56eff","#8a3ffc","#6929c4","#491d8b","#31135e","#1c0f30"]}}}const kye=pm({theme:"white",background:"#ffffff"}),Eye=pm({theme:"g10",background:"#f4f4f4"}),$ye=pm({theme:"g90",background:"#262626"}),Sye=pm({theme:"g100",background:"#161616"}),Cye=G2e.version,Aye=Object.freeze(Object.defineProperty({__proto__:null,carbong10:Eye,carbong100:Sye,carbong90:$ye,carbonwhite:kye,dark:V2e,excel:Y2e,fivethirtyeight:K2e,ggplot2:J2e,googlecharts:cye,latimes:nye,powerbi:vye,quartz:iye,urbaninstitute:uye,version:Cye,vox:rye},Symbol.toStringTag,{value:"Module"}));function Fye(e,t,n,i){if(G(e))return`[${e.map(r=>t(re(r)?r:qL(r,n))).join(", ")}]`;if(ie(e)){let r="";const{title:s,image:o,...a}=e;s&&(r+=`

${t(s)}

`),o&&(r+=``);const l=Object.keys(a);if(l.length>0){r+="";for(const u of l){let c=a[u];c!==void 0&&(ie(c)&&(c=qL(c,n)),r+=``)}r+="
${t(u)}${t(c)}
"}return r||"{}"}return t(e)}function Tye(e){const t=[];return function(n,i){if(typeof i!="object"||i===null)return i;const r=t.indexOf(this)+1;return t.length=r,t.length>e?"[Object]":t.indexOf(i)>=0?"[Circular]":(t.push(i),i)}}function qL(e,t){return JSON.stringify(e,Tye(t))}var Mye=`#vg-tooltip-element { visibility: hidden; padding: 8px; position: fixed; @@ -132,16 +130,16 @@ ${a}`)}return l}(e,"",0)}function si(e,t,n){return e.fields=t||[],e.fname=n,e}fu #vg-tooltip-element.dark-theme td.key { color: #bfbfbf; } -`;const PI="vg-tooltip-element",R3e={offsetX:10,offsetY:10,id:PI,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:O3e,maxDepth:2,formatTooltip:T3e,baseURL:"",anchor:"cursor",position:["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]};function O3e(e){return String(e).replace(/&/g,"&").replace(/=0&&e.y>=0&&e.x+t.width<=window.innerWidth&&e.y+t.height<=window.innerHeight}function z3e(e,t,n){return e.clientX>=t.x&&e.clientX<=t.x+n.width&&e.clientY>=t.y&&e.clientY<=t.y+n.height}class B3e{constructor(t){this.options={...R3e,...t};const n=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const i=document.createElement("style");i.setAttribute("id",this.options.styleId),i.innerHTML=L3e(n);const r=document.head;r.childNodes.length>0?r.insertBefore(i,r.childNodes[0]):r.appendChild(i)}}tooltipHandler(t,n,i,r){if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(document.fullscreenElement??document.body).appendChild(this.el)),r==null||r===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:s,y:o}=this.options.anchor==="mark"?I3e(t,n,i,this.el.getBoundingClientRect(),this.options):zI(n,this.el.getBoundingClientRect(),this.options);this.el.style.top=`${o}px`,this.el.style.left=`${s}px`}}/*! +`;const WL="vg-tooltip-element",Dye={offsetX:10,offsetY:10,id:WL,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:!1,sanitize:Nye,maxDepth:2,formatTooltip:Fye,baseURL:"",anchor:"cursor",position:["top","bottom","left","right","top-left","top-right","bottom-left","bottom-right"]};function Nye(e){return String(e).replace(/&/g,"&").replace(/=0&&e.y>=0&&e.x+t.width<=window.innerWidth&&e.y+t.height<=window.innerHeight}function Iye(e,t,n){return e.clientX>=t.x&&e.clientX<=t.x+n.width&&e.clientY>=t.y&&e.clientY<=t.y+n.height}class Pye{constructor(t){U(this,"call");U(this,"options");U(this,"el");this.options={...Dye,...t};const n=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const i=document.createElement("style");i.setAttribute("id",this.options.styleId),i.innerHTML=Rye(n);const r=document.head;r.childNodes.length>0?r.insertBefore(i,r.childNodes[0]):r.appendChild(i)}}tooltipHandler(t,n,i,r){if(this.el=document.getElementById(this.options.id),this.el||(this.el=document.createElement("div"),this.el.setAttribute("id",this.options.id),this.el.classList.add("vg-tooltip"),(document.fullscreenElement??document.body).appendChild(this.el)),r==null||r===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(r,this.options.sanitize,this.options.maxDepth,this.options.baseURL),this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:s,y:o}=this.options.anchor==="mark"?Oye(t,n,i,this.el.getBoundingClientRect(),this.options):HL(n,this.el.getBoundingClientRect(),this.options);this.el.style.top=`${o}px`,this.el.style.left=`${s}px`}}/*! * https://github.com/Starcounter-Jack/JSON-Patch * (c) 2017-2022 Joachim Wester * MIT licensed - */var j3e=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var s in r)r.hasOwnProperty(s)&&(i[s]=r[s])},e(t,n)};return function(t,n){e(t,n);function i(){this.constructor=t}t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),U3e=Object.prototype.hasOwnProperty;function A6(e,t){return U3e.call(e,t)}function $6(e){if(Array.isArray(e)){for(var t=new Array(e.length),n=0;n=48&&i<=57){t++;continue}return!1}return!0}function Vu(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function UI(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function F6(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t0&&u[c-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(l[h]===void 0?d=u.slice(0,c).join("/"):c==f-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),c++,Array.isArray(l)){if(h==="-")h=l.length;else{if(n&&!S6(h))throw new It("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,t,e);S6(h)&&(h=~~h)}if(c>=f){if(n&&t.op==="add"&&h>l.length)throw new It("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);var o=W3e[t.op].call(t,l,h,e);if(o.test===!1)throw new It("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}}else if(c>=f){var o=Bc[t.op].call(t,l,h,e);if(o.test===!1)throw new It("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}if(l=l[h],n&&c0)throw new It('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new It("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new It("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&F6(e.value))throw new It("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var r=e.path.split("/").length,s=i.split("/").length;if(r!==s+1&&r!==s)throw new It("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==i)throw new It("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var o={op:"_get",path:e.from,value:void 0},a=HI([o],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new It("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new It("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function HI(e,t,n){try{if(!Array.isArray(e))throw new It("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Gm(Pi(t),Pi(e),n||!0);else{n=n||Vm;for(var i=0;i=48&&i<=57){t++;continue}return!1}return!0}function Fl(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function YL(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Vw(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;t0&&l[c-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(u[h]===void 0?d=l.slice(0,c).join("/"):c==f-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),c++,Array.isArray(u)){if(h==="-")h=u.length;else{if(n&&!Gw(h))throw new Nt("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,t,e);Gw(h)&&(h=~~h)}if(c>=f){if(n&&t.op==="add"&&h>u.length)throw new Nt("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);var o=Uye[t.op].call(t,u,h,e);if(o.test===!1)throw new Nt("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}}else if(c>=f){var o=wc[t.op].call(t,u,h,e);if(o.test===!1)throw new Nt("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return o}if(u=u[h],n&&c0)throw new Nt('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,n);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new Nt("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new Nt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,n);if((e.op==="add"||e.op==="replace"||e.op==="test")&&Vw(e.value))throw new Nt("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,n);if(n){if(e.op=="add"){var r=e.path.split("/").length,s=i.split("/").length;if(r!==s+1&&r!==s)throw new Nt("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,n)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==i)throw new Nt("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,n)}else if(e.op==="move"||e.op==="copy"){var o={op:"_get",path:e.from,value:void 0},a=KL([o],n);if(a&&a.name==="OPERATION_PATH_UNRESOLVABLE")throw new Nt("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,n)}}}else throw new Nt("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,n)}function KL(e,t,n){try{if(!Array.isArray(e))throw new Nt("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)mm(Ci(t),Ci(e),n||!0);else{n=n||ym;for(var i=0;i0&&(e.patches=[],e.callback&&e.callback(i)),i}function M6(e,t,n,i,r){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=$6(t),o=$6(e),a=!1,u=o.length-1;u>=0;u--){var l=o[u],c=e[l];if(A6(t,l)&&!(t[l]===void 0&&c!==void 0&&Array.isArray(t)===!1)){var f=t[l];typeof c=="object"&&c!=null&&typeof f=="object"&&f!=null&&Array.isArray(c)===Array.isArray(f)?M6(c,f,n,i+"/"+Vu(l),r):c!==f&&(r&&n.push({op:"test",path:i+"/"+Vu(l),value:Pi(c)}),n.push({op:"replace",path:i+"/"+Vu(l),value:Pi(f)}))}else Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:i+"/"+Vu(l),value:Pi(c)}),n.push({op:"remove",path:i+"/"+Vu(l)}),a=!0):(r&&n.push({op:"test",path:i,value:e}),n.push({op:"replace",path:i,value:t}))}if(!(!a&&s.length==o.length))for(var u=0;u=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(n,i)}return this}}return N6=e,N6}var R6,VI;function O6(){if(VI)return R6;VI=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return R6=i=>i?typeof i!="object"?e:i:t,R6}var Ym={exports:{}},L6,YI;function I6(){if(YI)return L6;YI=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,i=16,r=t-6;return L6={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:r,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},L6}var P6,XI;function Xm(){return XI||(XI=1,P6=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),P6}var ZI;function z6(){return ZI||(ZI=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=I6(),s=Xm();t=e.exports={};const o=t.re=[],a=t.safeRe=[],u=t.src=[],l=t.t={};let c=0;const f="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",r],[f,i]],h=g=>{for(const[m,y]of d)g=g.split(`${m}*`).join(`${m}{0,${y}}`).split(`${m}+`).join(`${m}{1,${y}}`);return g},p=(g,m,y)=>{const b=h(m),v=c++;s(g,v,m),l[g]=v,u[v]=m,o[v]=new RegExp(m,y?"g":void 0),a[v]=new RegExp(b,y?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),p("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${f}+`),p("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),p("FULL",`^${u[l.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),p("LOOSE",`^${u[l.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),p("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?(?:${u[l.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",u[l.COERCE],!0),p("COERCERTLFULL",u[l.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Ym,Ym.exports)),Ym.exports}var B6,KI;function rve(){if(KI)return B6;KI=1;const e=/^[0-9]+$/,t=(i,r)=>{const s=e.test(i),o=e.test(r);return s&&o&&(i=+i,r=+r),i===r?0:s&&!o?-1:o&&!s?1:it(r,i)},B6}var j6,JI;function U6(){if(JI)return j6;JI=1;const e=Xm(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=I6(),{safeRe:i,t:r}=z6(),s=O6(),{compareIdentifiers:o}=rve();class a{constructor(l,c){if(c=s(c),l instanceof a){if(l.loose===!!c.loose&&l.includePrerelease===!!c.includePrerelease)return l;l=l.version}else if(typeof l!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof l}".`);if(l.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",l,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const f=l.trim().match(c.loose?i[r.LOOSE]:i[r.FULL]);if(!f)throw new TypeError(`Invalid Version: ${l}`);if(this.raw=l,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(d=>{if(/^[0-9]+$/.test(d)){const h=+d;if(h>=0&&h=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(c===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(c){let h=[c,d];f===!1&&(h=[c]),o(this.prerelease[0],c)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${l}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return j6=a,j6}var q6,QI;function jc(){if(QI)return q6;QI=1;const e=U6();return q6=(n,i,r)=>new e(n,r).compare(new e(i,r)),q6}var W6,eP;function sve(){if(eP)return W6;eP=1;const e=jc();return W6=(n,i,r)=>e(n,i,r)===0,W6}var H6,tP;function ove(){if(tP)return H6;tP=1;const e=jc();return H6=(n,i,r)=>e(n,i,r)!==0,H6}var G6,nP;function ave(){if(nP)return G6;nP=1;const e=jc();return G6=(n,i,r)=>e(n,i,r)>0,G6}var V6,iP;function uve(){if(iP)return V6;iP=1;const e=jc();return V6=(n,i,r)=>e(n,i,r)>=0,V6}var Y6,rP;function lve(){if(rP)return Y6;rP=1;const e=jc();return Y6=(n,i,r)=>e(n,i,r)<0,Y6}var X6,sP;function cve(){if(sP)return X6;sP=1;const e=jc();return X6=(n,i,r)=>e(n,i,r)<=0,X6}var Z6,oP;function fve(){if(oP)return Z6;oP=1;const e=sve(),t=ove(),n=ave(),i=uve(),r=lve(),s=cve();return Z6=(a,u,l,c)=>{switch(u){case"===":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a===l;case"!==":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a!==l;case"":case"=":case"==":return e(a,l,c);case"!=":return t(a,l,c);case">":return n(a,l,c);case">=":return i(a,l,c);case"<":return r(a,l,c);case"<=":return s(a,l,c);default:throw new TypeError(`Invalid operator: ${u}`)}},Z6}var K6,aP;function dve(){if(aP)return K6;aP=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,f){if(f=n(f),c instanceof t){if(c.loose===!!f.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),o("comparator",c,f),this.options=f,this.loose=!!f.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(c){const f=this.options.loose?i[r.COMPARATORLOOSE]:i[r.COMPARATOR],d=c.match(f);if(!d)throw new TypeError(`Invalid comparator: ${c}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(o("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new a(c,this.options)}catch{return!1}return s(c,this.operator,this.semver,this.options)}intersects(c,f){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(c.value,f).test(this.value):c.operator===""?c.value===""?!0:new u(this.value,f).test(c.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||s(this.semver,"<",c.semver,f)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||s(this.semver,">",c.semver,f)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}K6=t;const n=O6(),{safeRe:i,t:r}=z6(),s=fve(),o=Xm(),a=U6(),u=lP();return K6}var J6,uP;function lP(){if(uP)return J6;uP=1;const e=/\s+/g;class t{constructor(A,M){if(M=r(M),A instanceof t)return A.loose===!!M.loose&&A.includePrerelease===!!M.includePrerelease?A:new t(A.raw,M);if(A instanceof s)return this.raw=A.value,this.set=[[A]],this.formatted=void 0,this;if(this.options=M,this.loose=!!M.loose,this.includePrerelease=!!M.includePrerelease,this.raw=A.trim().replace(e," "),this.set=this.raw.split("||").map(B=>this.parseRange(B.trim())).filter(B=>B.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const B=this.set[0];if(this.set=this.set.filter(V=>!g(V[0])),this.set.length===0)this.set=[B];else if(this.set.length>1){for(const V of this.set)if(V.length===1&&m(V[0])){this.set=[V];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let A=0;A0&&(this.formatted+="||");const M=this.set[A];for(let B=0;B0&&(this.formatted+=" "),this.formatted+=M[B].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(A){const B=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+A,V=i.get(B);if(V)return V;const H=this.options.loose,oe=H?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];A=A.replace(oe,z(this.options.includePrerelease)),o("hyphen replace",A),A=A.replace(u[l.COMPARATORTRIM],c),o("comparator trim",A),A=A.replace(u[l.TILDETRIM],f),o("tilde trim",A),A=A.replace(u[l.CARETTRIM],d),o("caret trim",A);let ke=A.split(" ").map(Ie=>b(Ie,this.options)).join(" ").split(/\s+/).map(Ie=>S(Ie,this.options));H&&(ke=ke.filter(Ie=>(o("loose invalid filter",Ie,this.options),!!Ie.match(u[l.COMPARATORLOOSE])))),o("range list",ke);const we=new Map,Oe=ke.map(Ie=>new s(Ie,this.options));for(const Ie of Oe){if(g(Ie))return[Ie];we.set(Ie.value,Ie)}we.size>1&&we.has("")&&we.delete("");const rt=[...we.values()];return i.set(B,rt),rt}intersects(A,M){if(!(A instanceof t))throw new TypeError("a Range is required");return this.set.some(B=>y(B,M)&&A.set.some(V=>y(V,M)&&B.every(H=>V.every(oe=>H.intersects(oe,M)))))}test(A){if(!A)return!1;if(typeof A=="string")try{A=new a(A,this.options)}catch{return!1}for(let M=0;MT.value==="<0.0.0-0",m=T=>T.value==="",y=(T,A)=>{let M=!0;const B=T.slice();let V=B.pop();for(;M&&B.length;)M=B.every(H=>V.intersects(H,A)),V=B.pop();return M},b=(T,A)=>(o("comp",T,A),T=k(T,A),o("caret",T),T=_(T,A),o("tildes",T),T=E(T,A),o("xrange",T),T=F(T,A),o("stars",T),T),v=T=>!T||T.toLowerCase()==="x"||T==="*",_=(T,A)=>T.trim().split(/\s+/).map(M=>x(M,A)).join(" "),x=(T,A)=>{const M=A.loose?u[l.TILDELOOSE]:u[l.TILDE];return T.replace(M,(B,V,H,oe,ke)=>{o("tilde",T,B,V,H,oe,ke);let we;return v(V)?we="":v(H)?we=`>=${V}.0.0 <${+V+1}.0.0-0`:v(oe)?we=`>=${V}.${H}.0 <${V}.${+H+1}.0-0`:ke?(o("replaceTilde pr",ke),we=`>=${V}.${H}.${oe}-${ke} <${V}.${+H+1}.0-0`):we=`>=${V}.${H}.${oe} <${V}.${+H+1}.0-0`,o("tilde return",we),we})},k=(T,A)=>T.trim().split(/\s+/).map(M=>w(M,A)).join(" "),w=(T,A)=>{o("caret",T,A);const M=A.loose?u[l.CARETLOOSE]:u[l.CARET],B=A.includePrerelease?"-0":"";return T.replace(M,(V,H,oe,ke,we)=>{o("caret",T,V,H,oe,ke,we);let Oe;return v(H)?Oe="":v(oe)?Oe=`>=${H}.0.0${B} <${+H+1}.0.0-0`:v(ke)?H==="0"?Oe=`>=${H}.${oe}.0${B} <${H}.${+oe+1}.0-0`:Oe=`>=${H}.${oe}.0${B} <${+H+1}.0.0-0`:we?(o("replaceCaret pr",we),H==="0"?oe==="0"?Oe=`>=${H}.${oe}.${ke}-${we} <${H}.${oe}.${+ke+1}-0`:Oe=`>=${H}.${oe}.${ke}-${we} <${H}.${+oe+1}.0-0`:Oe=`>=${H}.${oe}.${ke}-${we} <${+H+1}.0.0-0`):(o("no pr"),H==="0"?oe==="0"?Oe=`>=${H}.${oe}.${ke}${B} <${H}.${oe}.${+ke+1}-0`:Oe=`>=${H}.${oe}.${ke}${B} <${H}.${+oe+1}.0-0`:Oe=`>=${H}.${oe}.${ke} <${+H+1}.0.0-0`),o("caret return",Oe),Oe})},E=(T,A)=>(o("replaceXRanges",T,A),T.split(/\s+/).map(M=>C(M,A)).join(" ")),C=(T,A)=>{T=T.trim();const M=A.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return T.replace(M,(B,V,H,oe,ke,we)=>{o("xRange",T,B,V,H,oe,ke,we);const Oe=v(H),rt=Oe||v(oe),Ie=rt||v(ke),Wt=Ie;return V==="="&&Wt&&(V=""),we=A.includePrerelease?"-0":"",Oe?V===">"||V==="<"?B="<0.0.0-0":B="*":V&&Wt?(rt&&(oe=0),ke=0,V===">"?(V=">=",rt?(H=+H+1,oe=0,ke=0):(oe=+oe+1,ke=0)):V==="<="&&(V="<",rt?H=+H+1:oe=+oe+1),V==="<"&&(we="-0"),B=`${V+H}.${oe}.${ke}${we}`):rt?B=`>=${H}.0.0${we} <${+H+1}.0.0-0`:Ie&&(B=`>=${H}.${oe}.0${we} <${H}.${+oe+1}.0-0`),o("xRange return",B),B})},F=(T,A)=>(o("replaceStars",T,A),T.trim().replace(u[l.STAR],"")),S=(T,A)=>(o("replaceGTE0",T,A),T.trim().replace(u[A.includePrerelease?l.GTE0PRE:l.GTE0],"")),z=T=>(A,M,B,V,H,oe,ke,we,Oe,rt,Ie,Wt)=>(v(B)?M="":v(V)?M=`>=${B}.0.0${T?"-0":""}`:v(H)?M=`>=${B}.${V}.0${T?"-0":""}`:oe?M=`>=${M}`:M=`>=${M}${T?"-0":""}`,v(Oe)?we="":v(rt)?we=`<${+Oe+1}.0.0-0`:v(Ie)?we=`<${Oe}.${+rt+1}.0-0`:Wt?we=`<=${Oe}.${rt}.${Ie}-${Wt}`:T?we=`<${Oe}.${rt}.${+Ie+1}-0`:we=`<=${we}`,`${M} ${we}`.trim()),P=(T,A,M)=>{for(let B=0;B0){const V=T[B].semver;if(V.major===A.major&&V.minor===A.minor&&V.patch===A.patch)return!0}return!1}return!0};return J6}var Q6,cP;function hve(){if(cP)return Q6;cP=1;const e=lP();return Q6=(n,i,r)=>{try{i=new e(i,r)}catch{return!1}return i.test(n)},Q6}var pve=hve(),fP=nve(pve);function gve(e,t,n){const i=e.open(t),r=250,{origin:s}=new URL(t);let o=40;function a(l){l.source===i&&(o=0,e.removeEventListener("message",a,!1))}e.addEventListener("message",a,!1);function u(){o<=0||(i.postMessage(n,s),setTimeout(u,r),o-=1)}setTimeout(u,r)}var mve=`.vega-embed { + */var Yw=new WeakMap,Hye=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),Gye=function(){function e(t,n){this.callback=t,this.observer=n}return e}();function Vye(e){return Yw.get(e)}function Yye(e,t){return e.observers.get(t)}function Xye(e,t){e.observers.delete(t.callback)}function Zye(e,t){t.unobserve()}function Kye(e,t){var n=[],i,r=Vye(e);if(!r)r=new Hye(e),Yw.set(e,r);else{var s=Yye(r,t);i=s&&s.observer}if(i)return i;if(i={},r.value=Ci(e),t){i.callback=t,i.next=null;var o=function(){Xw(i)},a=function(){clearTimeout(i.next),i.next=setTimeout(o)};typeof window<"u"&&(window.addEventListener("mouseup",a),window.addEventListener("keyup",a),window.addEventListener("mousedown",a),window.addEventListener("keydown",a),window.addEventListener("change",a))}return i.patches=n,i.object=e,i.unobserve=function(){Xw(i),clearTimeout(i.next),Xye(r,i),typeof window<"u"&&(window.removeEventListener("mouseup",a),window.removeEventListener("keyup",a),window.removeEventListener("mousedown",a),window.removeEventListener("keydown",a),window.removeEventListener("change",a))},r.observers.set(t,new Gye(t,i)),i}function Xw(e,t){t===void 0&&(t=!1);var n=Yw.get(e.object);Zw(n.value,e.object,e.patches,"",t),e.patches.length&&mm(n.value,e.patches);var i=e.patches;return i.length>0&&(e.patches=[],e.callback&&e.callback(i)),i}function Zw(e,t,n,i,r){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=Hw(t),o=Hw(e),a=!1,l=o.length-1;l>=0;l--){var u=o[l],c=e[u];if(Ww(t,u)&&!(t[u]===void 0&&c!==void 0&&Array.isArray(t)===!1)){var f=t[u];typeof c=="object"&&c!=null&&typeof f=="object"&&f!=null&&Array.isArray(c)===Array.isArray(f)?Zw(c,f,n,i+"/"+Fl(u),r):c!==f&&(r&&n.push({op:"test",path:i+"/"+Fl(u),value:Ci(c)}),n.push({op:"replace",path:i+"/"+Fl(u),value:Ci(f)}))}else Array.isArray(e)===Array.isArray(t)?(r&&n.push({op:"test",path:i+"/"+Fl(u),value:Ci(c)}),n.push({op:"remove",path:i+"/"+Fl(u)}),a=!0):(r&&n.push({op:"test",path:i,value:e}),n.push({op:"replace",path:i,value:t}))}if(!(!a&&s.length==o.length))for(var l=0;l=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(n,i)}return this}}return Kw=e,Kw}var Jw,QL;function Qw(){if(QL)return Jw;QL=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Jw=i=>i?typeof i!="object"?e:i:t,Jw}var bm={exports:{}},e5,eI;function t5(){if(eI)return e5;eI=1;const e="2.0.0",t=256,n=Number.MAX_SAFE_INTEGER||9007199254740991,i=16,r=t-6;return e5={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:r,MAX_SAFE_INTEGER:n,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},e5}var n5,tI;function vm(){return tI||(tI=1,n5=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),n5}var nI;function i5(){return nI||(nI=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:r}=t5(),s=vm();t=e.exports={};const o=t.re=[],a=t.safeRe=[],l=t.src=[],u=t.safeSrc=[],c=t.t={};let f=0;const d="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",r],[d,i]],p=m=>{for(const[y,b]of h)m=m.split(`${y}*`).join(`${y}{0,${b}}`).split(`${y}+`).join(`${y}{1,${b}}`);return m},g=(m,y,b)=>{const v=p(y),_=f++;s(m,_,y),c[m]=_,l[_]=y,u[_]=v,o[_]=new RegExp(y,b?"g":void 0),a[_]=new RegExp(v,b?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),g("MAINVERSION",`(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${l[c.NONNUMERICIDENTIFIER]}|${l[c.NUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NONNUMERICIDENTIFIER]}|${l[c.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${d}+`),g("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),g("FULL",`^${l[c.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),g("LOOSE",`^${l[c.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),g("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g("COERCE",`${l[c.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",l[c.COERCEPLAIN]+`(?:${l[c.PRERELEASE]})?(?:${l[c.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",l[c.COERCE],!0),g("COERCERTLFULL",l[c.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(bm,bm.exports)),bm.exports}var r5,iI;function nbe(){if(iI)return r5;iI=1;const e=/^[0-9]+$/,t=(i,r)=>{const s=e.test(i),o=e.test(r);return s&&o&&(i=+i,r=+r),i===r?0:s&&!o?-1:o&&!s?1:it(r,i)},r5}var s5,rI;function o5(){if(rI)return s5;rI=1;const e=vm(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=t5(),{safeRe:i,t:r}=i5(),s=Qw(),{compareIdentifiers:o}=nbe();class a{constructor(u,c){if(c=s(c),u instanceof a){if(u.loose===!!c.loose&&u.includePrerelease===!!c.includePrerelease)return u;u=u.version}else if(typeof u!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof u}".`);if(u.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",u,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const f=u.trim().match(c.loose?i[r.LOOSE]:i[r.FULL]);if(!f)throw new TypeError(`Invalid Version: ${u}`);if(this.raw=u,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(d=>{if(/^[0-9]+$/.test(d)){const h=+d;if(h>=0&&h=0;)typeof this.prerelease[h]=="number"&&(this.prerelease[h]++,h=-2);if(h===-1){if(c===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(d)}}if(c){let h=[c,d];f===!1&&(h=[c]),o(this.prerelease[0],c)===0?isNaN(this.prerelease[1])&&(this.prerelease=h):this.prerelease=h}break}default:throw new Error(`invalid increment argument: ${u}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return s5=a,s5}var a5,sI;function kc(){if(sI)return a5;sI=1;const e=o5();return a5=(n,i,r)=>new e(n,r).compare(new e(i,r)),a5}var l5,oI;function ibe(){if(oI)return l5;oI=1;const e=kc();return l5=(n,i,r)=>e(n,i,r)===0,l5}var u5,aI;function rbe(){if(aI)return u5;aI=1;const e=kc();return u5=(n,i,r)=>e(n,i,r)!==0,u5}var c5,lI;function sbe(){if(lI)return c5;lI=1;const e=kc();return c5=(n,i,r)=>e(n,i,r)>0,c5}var f5,uI;function obe(){if(uI)return f5;uI=1;const e=kc();return f5=(n,i,r)=>e(n,i,r)>=0,f5}var d5,cI;function abe(){if(cI)return d5;cI=1;const e=kc();return d5=(n,i,r)=>e(n,i,r)<0,d5}var h5,fI;function lbe(){if(fI)return h5;fI=1;const e=kc();return h5=(n,i,r)=>e(n,i,r)<=0,h5}var p5,dI;function ube(){if(dI)return p5;dI=1;const e=ibe(),t=rbe(),n=sbe(),i=obe(),r=abe(),s=lbe();return p5=(a,l,u,c)=>{switch(l){case"===":return typeof a=="object"&&(a=a.version),typeof u=="object"&&(u=u.version),a===u;case"!==":return typeof a=="object"&&(a=a.version),typeof u=="object"&&(u=u.version),a!==u;case"":case"=":case"==":return e(a,u,c);case"!=":return t(a,u,c);case">":return n(a,u,c);case">=":return i(a,u,c);case"<":return r(a,u,c);case"<=":return s(a,u,c);default:throw new TypeError(`Invalid operator: ${l}`)}},p5}var g5,hI;function cbe(){if(hI)return g5;hI=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(c,f){if(f=n(f),c instanceof t){if(c.loose===!!f.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),o("comparator",c,f),this.options=f,this.loose=!!f.loose,this.parse(c),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(c){const f=this.options.loose?i[r.COMPARATORLOOSE]:i[r.COMPARATOR],d=c.match(f);if(!d)throw new TypeError(`Invalid comparator: ${c}`);this.operator=d[1]!==void 0?d[1]:"",this.operator==="="&&(this.operator=""),d[2]?this.semver=new a(d[2],this.options.loose):this.semver=e}toString(){return this.value}test(c){if(o("Comparator.test",c,this.options.loose),this.semver===e||c===e)return!0;if(typeof c=="string")try{c=new a(c,this.options)}catch{return!1}return s(c,this.operator,this.semver,this.options)}intersects(c,f){if(!(c instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new l(c.value,f).test(this.value):c.operator===""?c.value===""?!0:new l(this.value,f).test(c.semver):(f=n(f),f.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||s(this.semver,"<",c.semver,f)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||s(this.semver,">",c.semver,f)&&this.operator.startsWith("<")&&c.operator.startsWith(">")))}}g5=t;const n=Qw(),{safeRe:i,t:r}=i5(),s=ube(),o=vm(),a=o5(),l=gI();return g5}var m5,pI;function gI(){if(pI)return m5;pI=1;const e=/\s+/g;class t{constructor(S,D){if(D=r(D),S instanceof t)return S.loose===!!D.loose&&S.includePrerelease===!!D.includePrerelease?S:new t(S.raw,D);if(S instanceof s)return this.raw=S.value,this.set=[[S]],this.formatted=void 0,this;if(this.options=D,this.loose=!!D.loose,this.includePrerelease=!!D.includePrerelease,this.raw=S.trim().replace(e," "),this.set=this.raw.split("||").map(B=>this.parseRange(B.trim())).filter(B=>B.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const B=this.set[0];if(this.set=this.set.filter(V=>!g(V[0])),this.set.length===0)this.set=[B];else if(this.set.length>1){for(const V of this.set)if(V.length===1&&m(V[0])){this.set=[V];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let S=0;S0&&(this.formatted+="||");const D=this.set[S];for(let B=0;B0&&(this.formatted+=" "),this.formatted+=D[B].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(S){const B=((this.options.includePrerelease&&h)|(this.options.loose&&p))+":"+S,V=i.get(B);if(V)return V;const H=this.options.loose,oe=H?l[u.HYPHENRANGELOOSE]:l[u.HYPHENRANGE];S=S.replace(oe,z(this.options.includePrerelease)),o("hyphen replace",S),S=S.replace(l[u.COMPARATORTRIM],c),o("comparator trim",S),S=S.replace(l[u.TILDETRIM],f),o("tilde trim",S),S=S.replace(l[u.CARETTRIM],d),o("caret trim",S);let we=S.split(" ").map(Ie=>b(Ie,this.options)).join(" ").split(/\s+/).map(Ie=>A(Ie,this.options));H&&(we=we.filter(Ie=>(o("loose invalid filter",Ie,this.options),!!Ie.match(l[u.COMPARATORLOOSE])))),o("range list",we);const xe=new Map,Re=we.map(Ie=>new s(Ie,this.options));for(const Ie of Re){if(g(Ie))return[Ie];xe.set(Ie.value,Ie)}xe.size>1&&xe.has("")&&xe.delete("");const nt=[...xe.values()];return i.set(B,nt),nt}intersects(S,D){if(!(S instanceof t))throw new TypeError("a Range is required");return this.set.some(B=>y(B,D)&&S.set.some(V=>y(V,D)&&B.every(H=>V.every(oe=>H.intersects(oe,D)))))}test(S){if(!S)return!1;if(typeof S=="string")try{S=new a(S,this.options)}catch{return!1}for(let D=0;DM.value==="<0.0.0-0",m=M=>M.value==="",y=(M,S)=>{let D=!0;const B=M.slice();let V=B.pop();for(;D&&B.length;)D=B.every(H=>V.intersects(H,S)),V=B.pop();return D},b=(M,S)=>(o("comp",M,S),M=k(M,S),o("caret",M),M=_(M,S),o("tildes",M),M=E(M,S),o("xrange",M),M=F(M,S),o("stars",M),M),v=M=>!M||M.toLowerCase()==="x"||M==="*",_=(M,S)=>M.trim().split(/\s+/).map(D=>x(D,S)).join(" "),x=(M,S)=>{const D=S.loose?l[u.TILDELOOSE]:l[u.TILDE];return M.replace(D,(B,V,H,oe,we)=>{o("tilde",M,B,V,H,oe,we);let xe;return v(V)?xe="":v(H)?xe=`>=${V}.0.0 <${+V+1}.0.0-0`:v(oe)?xe=`>=${V}.${H}.0 <${V}.${+H+1}.0-0`:we?(o("replaceTilde pr",we),xe=`>=${V}.${H}.${oe}-${we} <${V}.${+H+1}.0-0`):xe=`>=${V}.${H}.${oe} <${V}.${+H+1}.0-0`,o("tilde return",xe),xe})},k=(M,S)=>M.trim().split(/\s+/).map(D=>w(D,S)).join(" "),w=(M,S)=>{o("caret",M,S);const D=S.loose?l[u.CARETLOOSE]:l[u.CARET],B=S.includePrerelease?"-0":"";return M.replace(D,(V,H,oe,we,xe)=>{o("caret",M,V,H,oe,we,xe);let Re;return v(H)?Re="":v(oe)?Re=`>=${H}.0.0${B} <${+H+1}.0.0-0`:v(we)?H==="0"?Re=`>=${H}.${oe}.0${B} <${H}.${+oe+1}.0-0`:Re=`>=${H}.${oe}.0${B} <${+H+1}.0.0-0`:xe?(o("replaceCaret pr",xe),H==="0"?oe==="0"?Re=`>=${H}.${oe}.${we}-${xe} <${H}.${oe}.${+we+1}-0`:Re=`>=${H}.${oe}.${we}-${xe} <${H}.${+oe+1}.0-0`:Re=`>=${H}.${oe}.${we}-${xe} <${+H+1}.0.0-0`):(o("no pr"),H==="0"?oe==="0"?Re=`>=${H}.${oe}.${we}${B} <${H}.${oe}.${+we+1}-0`:Re=`>=${H}.${oe}.${we}${B} <${H}.${+oe+1}.0-0`:Re=`>=${H}.${oe}.${we} <${+H+1}.0.0-0`),o("caret return",Re),Re})},E=(M,S)=>(o("replaceXRanges",M,S),M.split(/\s+/).map(D=>$(D,S)).join(" ")),$=(M,S)=>{M=M.trim();const D=S.loose?l[u.XRANGELOOSE]:l[u.XRANGE];return M.replace(D,(B,V,H,oe,we,xe)=>{o("xRange",M,B,V,H,oe,we,xe);const Re=v(H),nt=Re||v(oe),Ie=nt||v(we),jt=Ie;return V==="="&&jt&&(V=""),xe=S.includePrerelease?"-0":"",Re?V===">"||V==="<"?B="<0.0.0-0":B="*":V&&jt?(nt&&(oe=0),we=0,V===">"?(V=">=",nt?(H=+H+1,oe=0,we=0):(oe=+oe+1,we=0)):V==="<="&&(V="<",nt?H=+H+1:oe=+oe+1),V==="<"&&(xe="-0"),B=`${V+H}.${oe}.${we}${xe}`):nt?B=`>=${H}.0.0${xe} <${+H+1}.0.0-0`:Ie&&(B=`>=${H}.${oe}.0${xe} <${H}.${+oe+1}.0-0`),o("xRange return",B),B})},F=(M,S)=>(o("replaceStars",M,S),M.trim().replace(l[u.STAR],"")),A=(M,S)=>(o("replaceGTE0",M,S),M.trim().replace(l[S.includePrerelease?u.GTE0PRE:u.GTE0],"")),z=M=>(S,D,B,V,H,oe,we,xe,Re,nt,Ie,jt)=>(v(B)?D="":v(V)?D=`>=${B}.0.0${M?"-0":""}`:v(H)?D=`>=${B}.${V}.0${M?"-0":""}`:oe?D=`>=${D}`:D=`>=${D}${M?"-0":""}`,v(Re)?xe="":v(nt)?xe=`<${+Re+1}.0.0-0`:v(Ie)?xe=`<${Re}.${+nt+1}.0-0`:jt?xe=`<=${Re}.${nt}.${Ie}-${jt}`:M?xe=`<${Re}.${nt}.${+Ie+1}-0`:xe=`<=${xe}`,`${D} ${xe}`.trim()),P=(M,S,D)=>{for(let B=0;B0){const V=M[B].semver;if(V.major===S.major&&V.minor===S.minor&&V.patch===S.patch)return!0}return!1}return!0};return m5}var y5,mI;function fbe(){if(mI)return y5;mI=1;const e=gI();return y5=(n,i,r)=>{try{i=new e(i,r)}catch{return!1}return i.test(n)},y5}var dbe=fbe(),yI=ebe(dbe);function hbe(e,t,n){const i=e.open(t),r=250,{origin:s}=new URL(t);let o=40;function a(u){u.source===i&&(o=0,e.removeEventListener("message",a,!1))}e.addEventListener("message",a,!1);function l(){o<=0||(i.postMessage(n,s),setTimeout(l,r),o-=1)}setTimeout(l,r)}var pbe=`.vega-embed { position: relative; display: inline-block; box-sizing: border-box; @@ -259,11 +257,11 @@ ${a}`)}return l}(e,"",0)}function si(e,t,n){return e.fields=t||[],e.fname=n,e}fu transform: scale(1); } } -`;function dP(e,...t){for(const n of t)yve(e,n);return e}function yve(e,t){for(const n of Object.keys(t))rl(e,n,t[n],!0)}const Fs=ide;let Th=Gbe;const Zm=typeof window<"u"?window:void 0;Th===void 0&&((eB=Zm==null?void 0:Zm.vl)!=null&&eB.compile)&&(Th=Zm.vl);const bve={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},vve={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},Mh={vega:"Vega","vega-lite":"Vega-Lite"},Km={vega:Fs.version,"vega-lite":Th?Th.version:"not available"},_ve={vega:e=>e,"vega-lite":(e,t)=>Th.compile(e,{config:t}).spec},xve=` +`;function bI(e,...t){for(const n of t)gbe(e,n);return e}function gbe(e,t){for(const n of Object.keys(t))Bl(e,n,t[n],!0)}const ms=cfe;let ah=W2e;const _m=typeof window<"u"?window:void 0;ah===void 0&&((oz=_m==null?void 0:_m.vl)!=null&&oz.compile)&&(ah=_m.vl);const mbe={export:{svg:!0,png:!0},source:!0,compiled:!0,editor:!0},ybe={CLICK_TO_VIEW_ACTIONS:"Click to view actions",COMPILED_ACTION:"View Compiled Vega",EDITOR_ACTION:"Open in Vega Editor",PNG_ACTION:"Save as PNG",SOURCE_ACTION:"View Source",SVG_ACTION:"Save as SVG"},lh={vega:"Vega","vega-lite":"Vega-Lite"},xm={vega:ms.version,"vega-lite":ah?ah.version:"not available"},bbe={vega:e=>e,"vega-lite":(e,t,n)=>ah.compile(e,{config:n,logger:t}).spec},vbe=` -`,wve="chart-wrapper";function kve(e){return typeof e=="function"}function hP(e,t,n,i){const r=`${t}
`,s=`
${n}`,o=window.open("");o.document.write(r+e+s),o.document.title=`${Mh[i]} JSON Source`}function Eve(e,t){if(e.$schema){const n=bI(e.$schema);t&&t!==n.library&&console.warn(`The given visualization spec is written in ${Mh[n.library]}, but mode argument sets ${Mh[t]??t}.`);const i=n.library;return fP(Km[i],`^${n.version.slice(1)}`)||console.warn(`The input spec uses ${Mh[i]} ${n.version}, but the current version of ${Mh[i]} is v${Km[i]}.`),i}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":t??"vega"}function pP(e){return!!(e&&"load"in e)}function gP(e){return pP(e)?e:Fs.loader(e)}function Cve(e){var n;const t=((n=e.usermeta)==null?void 0:n.embedOptions)??{};return re(t.defaultStyle)&&(t.defaultStyle=!1),t}async function Ave(e,t,n={}){let i,r;re(t)?(r=gP(n.loader),i=JSON.parse(await r.load(t))):i=t;const s=Cve(i),o=s.loader;(!r||o)&&(r=gP(n.loader??o));const a=await mP(s,r),u=await mP(n,r),l={...dP(u,a),config:il(u.config??{},a.config??{})};return await Sve(e,i,l,r)}async function mP(e,t){const n=re(e.config)?JSON.parse(await t.load(e.config)):e.config??{},i=re(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...i?{patch:i}:{},...n?{config:n}:{}}}function $ve(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}async function Sve(e,t,n={},i){const r=n.theme?il(D3e[n.theme],n.config??{}):n.config,s=wo(n.actions)?n.actions:dP({},bve,n.actions??{}),o={...vve,...n.i18n},a=n.renderer??"canvas",u=n.logLevel??Fs.Warn,l=n.downloadFileName??"visualization",c=typeof e=="string"?document.querySelector(e):e;if(!c)throw new Error(`${e} does not exist`);if(n.defaultStyle!==!1){const x="vega-embed-style",{root:k,rootContainer:w}=$ve(c);if(!k.getElementById(x)){const E=document.createElement("style");E.id=x,E.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?mve.toString():n.defaultStyle,w.appendChild(E)}}const f=Eve(t,n.mode);let d=_ve[f](t,r);if(f==="vega-lite"&&d.$schema){const x=bI(d.$schema);fP(Km.vega,`^${x.version.slice(1)}`)||console.warn(`The compiled spec uses Vega ${x.version}, but current version is v${Km.vega}.`)}c.classList.add("vega-embed"),s&&c.classList.add("has-actions"),c.innerHTML="";let h=c;if(s){const x=document.createElement("div");x.classList.add(wve),c.appendChild(x),h=x}const p=n.patch;if(p&&(d=p instanceof Function?p(d):Gm(d,p,!0,!1).newDocument),n.formatLocale&&Fs.formatLocale(n.formatLocale),n.timeFormatLocale&&Fs.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const x in n.expressionFunctions){const k=n.expressionFunctions[x];"fn"in k?Fs.expressionFunction(x,k.fn,k.visitor):k instanceof Function&&Fs.expressionFunction(x,k)}const{ast:g}=n,m=Fs.parse(d,f==="vega-lite"?{}:r,{ast:g}),y=new(n.viewClass||Fs.View)(m,{loader:i,logLevel:u,renderer:a,...g?{expr:Fs.expressionInterpreter??n.expr??hde}:{}});if(y.addSignalListener("autosize",(x,k)=>{const{type:w}=k;w=="fit-x"?(h.classList.add("fit-x"),h.classList.remove("fit-y")):w=="fit-y"?(h.classList.remove("fit-x"),h.classList.add("fit-y")):w=="fit"?h.classList.add("fit-x","fit-y"):h.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){const{loader:x,tooltip:k}=n,w=x&&!pP(x)?x==null?void 0:x.baseURL:void 0,E=kve(k)?k:new B3e({baseURL:w,...k===!0?{}:k}).call;y.tooltip(E)}let{hover:b}=n;if(b===void 0&&(b=f==="vega"),b){const{hoverSet:x,updateSet:k}=typeof b=="boolean"?{}:b;y.hover(x,k)}n&&(n.width!=null&&y.width(n.width),n.height!=null&&y.height(n.height),n.padding!=null&&y.padding(n.padding)),await y.initialize(h,n.bind).runAsync();let v;if(s!==!1){let x=c;if(n.defaultStyle!==!1||n.forceActionsMenu){const w=document.createElement("details");w.title=o.CLICK_TO_VIEW_ACTIONS,c.append(w),x=w;const E=document.createElement("summary");E.innerHTML=xve,w.append(E),v=C=>{w.contains(C.target)||w.removeAttribute("open")},document.addEventListener("click",v)}const k=document.createElement("div");if(x.append(k),k.classList.add("vega-actions"),s===!0||s.export!==!1){for(const w of["svg","png"])if(s===!0||s.export===!0||s.export[w]){const E=o[`${w.toUpperCase()}_ACTION`],C=document.createElement("a"),F=ie(n.scaleFactor)?n.scaleFactor[w]:n.scaleFactor;C.text=E,C.href="#",C.target="_blank",C.download=`${l}.${w}`,C.addEventListener("mousedown",async function(S){S.preventDefault();const z=await y.toImageURL(w,F);this.href=z}),k.append(C)}}if(s===!0||s.source!==!1){const w=document.createElement("a");w.text=o.SOURCE_ACTION,w.href="#",w.addEventListener("click",function(E){hP(_2(t),n.sourceHeader??"",n.sourceFooter??"",f),E.preventDefault()}),k.append(w)}if(f==="vega-lite"&&(s===!0||s.compiled!==!1)){const w=document.createElement("a");w.text=o.COMPILED_ACTION,w.href="#",w.addEventListener("click",function(E){hP(_2(d),n.sourceHeader??"",n.sourceFooter??"","vega"),E.preventDefault()}),k.append(w)}if(s===!0||s.editor!==!1){const w=n.editorUrl??"https://vega.github.io/editor/",E=document.createElement("a");E.text=o.EDITOR_ACTION,E.href="#",E.addEventListener("click",function(C){gve(window,w,{config:r,mode:p?"vega":f,renderer:a,spec:_2(p?d:t)}),C.preventDefault()}),k.append(E)}}function _(){v&&document.removeEventListener("click",v),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:_,embedOptions:n}}const Fve=new Set(["width","height"]);function Dve(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tve=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var i,r,s;if(Array.isArray(t)){if(i=t.length,i!=n.length)return!1;for(r=i;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),i=s.length,i!==Object.keys(n).length)return!1;for(r=i;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[r]))return!1;for(r=i;r--!==0;){var o=s[r];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n};const Mve=Dve(Tve);function Nve(e,t){for(const[n,i]of Object.entries(t))i&&(i&&{}.toString.call(i)==="[object Function]"?i(e.data(n)):e.change(n,So().remove(()=>!0).insert(i)))}function Jm(e={},t={},n=new Set){const i=Object.keys(e),r=Object.keys(t);return e===t||i.length===r.length&&i.filter(s=>!n.has(s)).every(s=>e[s]===t[s])}function yP(e,t){const n=Object.keys(t);for(const i of n)try{e.removeSignalListener(i,t[i])}catch(r){console.warn("Cannot remove invalid signal listener.",r)}return n.length>0}function e5(e,t){const n=Object.keys(t);for(const i of n)try{e.addSignalListener(i,t[i])}catch(r){console.warn("Cannot add invalid signal listener.",r)}return n.length>0}function Rve(e){return new Set(e.flatMap(t=>Object.keys(t)))}function Ove(e,t){if(e===t)return!1;const n={width:!1,height:!1,isExpensive:!1},i="width"in e||"width"in t,r="height"in e||"height"in t;return i&&(!("width"in e)||!("width"in t)||e.width!==t.width)&&("width"in e&&typeof e.width=="number"?n.width=e.width:n.isExpensive=!0),r&&(!("height"in e)||!("height"in t)||e.height!==t.height)&&("height"in e&&typeof e.height=="number"?n.height=e.height:n.isExpensive=!0),[...Rve([e,t])].filter(o=>o!=="width"&&o!=="height").some(o=>!(o in e)||!(o in t)||!Mve(e[o],t[o]))&&(n.isExpensive=!0),n.width!==!1||n.height!==!1||n.isExpensive?n:!1}function bP(e,t){const{width:n,height:i}=t;return typeof n<"u"&&typeof i<"u"?{...e,width:n,height:i}:typeof n<"u"?{...e,width:n}:typeof i<"u"?{...e,height:i}:e}function Lve(e){let t;return{c(){t=I("div")},m(n,i){L(n,t,i),e[11](t)},p:X,i:X,o:X,d(n){n&&O(t),e[11](null)}}}function Ive(e,t,n){let{options:i}=t,{spec:r}=t,{view:s}=t,{signalListeners:o={}}=t,{data:a={}}=t;const u=f2();let l,c={},f={},d={},h={},p;c2(()=>{m()});async function g(){m();try{n(6,l=await Ave(p,r,i)),n(1,s=l.view),e5(s,o)&&s.runAsync(),b(s)}catch(x){y(x)}}function m(){l&&(l.finalize(),n(6,l=void 0),n(1,s=void 0))}function y(x){u("onError",{error:x}),console.warn(x)}function b(x){v(),u("onNewView",{view:x})}async function v(){a&&Object.keys(a).length>0&&l!==void 0&&(n(1,s=l.view),Nve(s,a),await s.resize().runAsync())}function _(x){jn[x?"unshift":"push"](()=>{p=x,n(0,p)})}return e.$$set=x=>{"options"in x&&n(2,i=x.options),"spec"in x&&n(3,r=x.spec),"view"in x&&n(1,s=x.view),"signalListeners"in x&&n(4,o=x.signalListeners),"data"in x&&n(5,a=x.data)},e.$$.update=()=>{if(e.$$.dirty&1056&&(Jm(a,h)||v(),n(10,h=a)),e.$$.dirty&991&&p!==void 0){if(!Jm(i,c,Fve))g();else{const x=Ove(bP(r,i),bP(d,c)),k=o,w=f;if(x){if(x.isExpensive)g();else if(l!==void 0){const E=!Jm(k,w);n(1,s=l.view),x.width!==!1&&s.width(x.width),x.height!==!1&&s.height(x.height),E&&(w&&yP(s,w),k&&e5(s,k)),s.runAsync()}}else!Jm(k,w)&&l!==void 0&&(n(1,s=l.view),w&&yP(s,w),k&&e5(s,k),s.runAsync())}n(7,c=i),n(8,f=o),n(9,d=r)}},[p,s,i,r,o,a,l,c,f,d,h,_]}class Pve extends _e{constructor(t){super(),ve(this,t,Ive,Lve,pe,{options:2,spec:3,view:1,signalListeners:4,data:5})}}function zve(e){let t,n,i;function r(o){e[6](o)}let s={spec:e[1],data:e[2],signalListeners:e[3],options:e[4]};return e[0]!==void 0&&(s.view=e[0]),t=new Pve({props:s}),jn.push(()=>y2(t,"view",r)),t.$on("onNewView",e[7]),t.$on("onError",e[8]),{c(){he(t.$$.fragment)},m(o,a){fe(t,o,a),i=!0},p(o,[a]){const u={};a&2&&(u.spec=o[1]),a&4&&(u.data=o[2]),a&8&&(u.signalListeners=o[3]),a&16&&(u.options=o[4]),!n&&a&1&&(n=!0,u.view=o[0],g2(()=>n=!1)),t.$set(u)},i(o){i||(D(t.$$.fragment,o),i=!0)},o(o){N(t.$$.fragment,o),i=!1},d(o){de(t,o)}}}const Bve="vega";function jve(e,t,n){let i,{spec:r}=t,{options:s={}}=t,{data:o={}}=t,{signalListeners:a={}}=t,{view:u=void 0}=t;function l(d){u=d,n(0,u)}function c(d){C5.call(this,e,d)}function f(d){C5.call(this,e,d)}return e.$$set=d=>{"spec"in d&&n(1,r=d.spec),"options"in d&&n(5,s=d.options),"data"in d&&n(2,o=d.data),"signalListeners"in d&&n(3,a=d.signalListeners),"view"in d&&n(0,u=d.view)},e.$$.update=()=>{e.$$.dirty&32&&n(4,i={...s,mode:Bve})},[u,r,o,a,i,s,l,c,f]}class vP extends _e{constructor(t){super(),ve(this,t,jve,zve,pe,{spec:1,options:5,data:2,signalListeners:3,view:0})}}function Uve(e){let t,n;return t=new vP({props:{spec:e[1],options:e[0]}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,r){const s={};r&2&&(s.spec=i[1]),r&1&&(s.options=i[0]),t.$set(s)},i(i){n||(D(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function qve(e){let t,n;return t=new vP({props:{data:e[2],spec:e[1],options:e[0]}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,r){const s={};r&4&&(s.data=i[2]),r&2&&(s.spec=i[1]),r&1&&(s.options=i[0]),t.$set(s)},i(i){n||(D(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function Wve(e){let t,n,i,r;const s=[qve,Uve],o=[];function a(u,l){return u[2]&&u[1]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ne()},m(u,l){o[t].m(u,l),L(u,i,l),r=!0},p(u,[l]){let c=t;t=a(u),t===c?o[t].p(u,l):(Ee(),N(o[c],1,1,()=>{o[c]=null}),Ce(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),D(n,1),n.m(i.parentNode,i))},i(u){r||(D(n),r=!0)},o(u){N(n),r=!1},d(u){u&&O(i),o[t].d(u)}}}function Hve(e,t,n){let i,r,s,{componentData:o}=t;return e.$$set=a=>{"componentData"in a&&n(3,o=a.componentData)},e.$$.update=()=>{e.$$.dirty&8&&n(2,{data:i,spec:r,options:s}=o,i,(n(1,r),n(3,o)),(n(0,s),n(3,o)))},[s,r,i,o]}class _P extends _e{constructor(t){super(),ve(this,t,Hve,Wve,pe,{componentData:3})}}function Gve(e){var r;let t,n=(((r=e[0])==null?void 0:r.text)||"")+"",i;return{c(){t=I("p"),i=ce(n),$(t,"data-component","text")},m(s,o){L(s,t,o),R(t,i)},p(s,[o]){var a;o&1&&n!==(n=(((a=s[0])==null?void 0:a.text)||"")+"")&&Me(i,n)},i:X,o:X,d(s){s&&O(t)}}}function Vve(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class xP extends _e{constructor(t){super(),ve(this,t,Vve,Gve,pe,{componentData:0})}}function wP(e){let t,n;return{c(){t=I("h3"),n=ce(e[4]),$(t,"class","value-box-title svelte-175x1n5")},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&16&&Me(n,i[4])},d(i){i&&O(t)}}}function kP(e){let t,n;return{c(){t=I("p"),n=ce(e[3]),$(t,"class","value-box-subtitle svelte-175x1n5")},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&8&&Me(n,i[3])},d(i){i&&O(t)}}}function EP(e){let t,n;return{c(){t=I("div"),n=ce(e[1]),$(t,"class","value-box-change svelte-175x1n5")},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&2&&Me(n,i[1])},d(i){i&&O(t)}}}function Yve(e){let t,n,i,r,s,o,a,u,l=e[4]&&wP(e),c=e[3]&&kP(e),f=e[1]&&EP(e);return{c(){t=I("div"),n=I("div"),l&&l.c(),i=ge(),r=I("div"),s=ce(e[0]),o=ge(),c&&c.c(),a=ge(),f&&f.c(),$(r,"class","value-box-value svelte-175x1n5"),$(n,"class","value-box-content svelte-175x1n5"),$(t,"class",u="value-box "+(e[2]||"default")+" svelte-175x1n5"),$(t,"id",e[5])},m(d,h){L(d,t,h),R(t,n),l&&l.m(n,null),R(n,i),R(n,r),R(r,s),R(n,o),c&&c.m(n,null),R(n,a),f&&f.m(n,null)},p(d,[h]){d[4]?l?l.p(d,h):(l=wP(d),l.c(),l.m(n,i)):l&&(l.d(1),l=null),h&1&&Me(s,d[0]),d[3]?c?c.p(d,h):(c=kP(d),c.c(),c.m(n,a)):c&&(c.d(1),c=null),d[1]?f?f.p(d,h):(f=EP(d),f.c(),f.m(n,null)):f&&(f.d(1),f=null),h&4&&u!==(u="value-box "+(d[2]||"default")+" svelte-175x1n5")&&$(t,"class",u),h&32&&$(t,"id",d[5])},i:X,o:X,d(d){d&&O(t),l&&l.d(),c&&c.d(),f&&f.d()}}}function Xve(e,t,n){let i,r,s,o,a,u,l,{componentData:c}=t;return e.$$set=f=>{"componentData"in f&&n(6,c=f.componentData)},e.$$.update=()=>{e.$$.dirty&64&&n(5,{id:i,title:r,value:s,subtitle:o,theme:a,change_indicator:u}=c,i,(n(4,r),n(6,c)),(n(7,s),n(6,c)),(n(3,o),n(6,c)),(n(2,a),n(6,c)),(n(1,u),n(6,c))),e.$$.dirty&128&&n(0,l=typeof s=="number"?s.toLocaleString():s)},[l,u,a,o,r,i,c,s]}class CP extends _e{constructor(t){super(),ve(this,t,Xve,Yve,pe,{componentData:6})}}function Zve(e){let t,n,i=e[0].data+"",r,s,o;return{c(){t=I("pre"),n=I("code"),r=ce(i),s=ce(` +`,_be="chart-wrapper";function xbe(e){return typeof e=="function"}function vI(e,t,n,i){const r=`${t}
`,s=`
${n}`,o=window.open("");o.document.write(r+e+s),o.document.title=`${lh[i]} JSON Source`}function wbe(e,t,n){if(e.$schema){const i=EL(e.$schema);n&&n!==i.library&&t.warn(`The given visualization spec is written in ${lh[i.library]}, but mode argument sets ${lh[n]??n}.`);const r=i.library;return yI(xm[r],`^${i.version.slice(1)}`)||t.warn(`The input spec uses ${lh[r]} ${i.version}, but the current version of ${lh[r]} is v${xm[r]}.`),r}return"mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e?"vega-lite":"marks"in e||"signals"in e||"scales"in e||"axes"in e?"vega":n??"vega"}function _I(e){return!!(e&&"load"in e)}function xI(e){return _I(e)?e:ms.loader(e)}function kbe(e){var n;const t=((n=e.usermeta)==null?void 0:n.embedOptions)??{};return re(t.defaultStyle)&&(t.defaultStyle=!1),t}async function Ebe(e,t,n={}){let i,r;re(t)?(r=xI(n.loader),i=JSON.parse(await r.load(t))):i=t;const s=kbe(i),o=s.loader;(!r||o)&&(r=xI(n.loader??o));const a=await wI(s,r),l=await wI(n,r),u={...bI(l,a),config:zl(l.config??{},a.config??{})};return await Sbe(e,i,u,r)}async function wI(e,t){const n=re(e.config)?JSON.parse(await t.load(e.config)):e.config??{},i=re(e.patch)?JSON.parse(await t.load(e.patch)):e.patch;return{...e,...i?{patch:i}:{},...n?{config:n}:{}}}function $be(e){const t=e.getRootNode?e.getRootNode():document;return t instanceof ShadowRoot?{root:t,rootContainer:t}:{root:document,rootContainer:document.head??document.body}}async function Sbe(e,t,n={},i){const r=n.theme?zl(Aye[n.theme],n.config??{}):n.config,s=ao(n.actions)?n.actions:bI({},mbe,n.actions??{}),o={...ybe,...n.i18n},a=n.renderer??"svg",l=n.logger??Eh(ms.Warn);n.logLevel!==void 0&&l.level(n.logLevel);const u=n.downloadFileName??"visualization",c=typeof e=="string"?document.querySelector(e):e;if(!c)throw new Error(`${e} does not exist`);if(n.defaultStyle!==!1){const x="vega-embed-style",{root:k,rootContainer:w}=$be(c);if(!k.getElementById(x)){const E=document.createElement("style");E.id=x,E.innerHTML=n.defaultStyle===void 0||n.defaultStyle===!0?pbe.toString():n.defaultStyle,w.appendChild(E)}}const f=wbe(t,l,n.mode);let d=bbe[f](t,l,r);if(f==="vega-lite"&&d.$schema){const x=EL(d.$schema);yI(xm.vega,`^${x.version.slice(1)}`)||l.warn(`The compiled spec uses Vega ${x.version}, but current version is v${xm.vega}.`)}c.classList.add("vega-embed"),s&&c.classList.add("has-actions"),c.innerHTML="";let h=c;if(s){const x=document.createElement("div");x.classList.add(_be),c.appendChild(x),h=x}const p=n.patch;if(p&&(d=p instanceof Function?p(d):mm(d,p,!0,!1).newDocument),n.formatLocale&&ms.formatLocale(n.formatLocale),n.timeFormatLocale&&ms.timeFormatLocale(n.timeFormatLocale),n.expressionFunctions)for(const x in n.expressionFunctions){const k=n.expressionFunctions[x];"fn"in k?ms.expressionFunction(x,k.fn,k.visitor):k instanceof Function&&ms.expressionFunction(x,k)}const{ast:g}=n,m=ms.parse(d,f==="vega-lite"?{}:r,{ast:g}),y=new(n.viewClass||ms.View)(m,{loader:i,logger:l,renderer:a,...g?{expr:ms.expressionInterpreter??n.expr??_fe}:{}});if(y.addSignalListener("autosize",(x,k)=>{const{type:w}=k;w=="fit-x"?(h.classList.add("fit-x"),h.classList.remove("fit-y")):w=="fit-y"?(h.classList.remove("fit-x"),h.classList.add("fit-y")):w=="fit"?h.classList.add("fit-x","fit-y"):h.classList.remove("fit-x","fit-y")}),n.tooltip!==!1){const{loader:x,tooltip:k}=n,w=x&&!_I(x)?x==null?void 0:x.baseURL:void 0,E=xbe(k)?k:new Pye({baseURL:w,...k===!0?{}:k}).call;y.tooltip(E)}let{hover:b}=n;if(b===void 0&&(b=f==="vega"),b){const{hoverSet:x,updateSet:k}=typeof b=="boolean"?{}:b;y.hover(x,k)}n&&(n.width!=null&&y.width(n.width),n.height!=null&&y.height(n.height),n.padding!=null&&y.padding(n.padding)),await y.initialize(h,n.bind).runAsync();let v;if(s!==!1){let x=c;if(n.defaultStyle!==!1||n.forceActionsMenu){const w=document.createElement("details");w.title=o.CLICK_TO_VIEW_ACTIONS,c.append(w),x=w;const E=document.createElement("summary");E.innerHTML=vbe,w.append(E),v=$=>{w.contains($.target)||w.removeAttribute("open")},document.addEventListener("click",v)}const k=document.createElement("div");if(x.append(k),k.classList.add("vega-actions"),s===!0||s.export!==!1){for(const w of["svg","png"])if(s===!0||s.export===!0||s.export[w]){const E=o[`${w.toUpperCase()}_ACTION`],$=document.createElement("a"),F=ie(n.scaleFactor)?n.scaleFactor[w]:n.scaleFactor;$.text=E,$.href="#",$.target="_blank",$.download=`${u}.${w}`,$.addEventListener("mousedown",async function(A){A.preventDefault();const z=await y.toImageURL(w,F);this.href=z}),k.append($)}}if(s===!0||s.source!==!1){const w=document.createElement("a");w.text=o.SOURCE_ACTION,w.href="#",w.addEventListener("click",function(E){vI(qm(t),n.sourceHeader??"",n.sourceFooter??"",f),E.preventDefault()}),k.append(w)}if(f==="vega-lite"&&(s===!0||s.compiled!==!1)){const w=document.createElement("a");w.text=o.COMPILED_ACTION,w.href="#",w.addEventListener("click",function(E){vI(qm(d),n.sourceHeader??"",n.sourceFooter??"","vega"),E.preventDefault()}),k.append(w)}if(s===!0||s.editor!==!1){const w=n.editorUrl??"https://vega.github.io/editor/",E=document.createElement("a");E.text=o.EDITOR_ACTION,E.href="#",E.addEventListener("click",function($){hbe(window,w,{config:r,mode:p?"vega":f,renderer:a,spec:qm(p?d:t)}),$.preventDefault()}),k.append(E)}}function _(){v&&document.removeEventListener("click",v),y.finalize()}return{view:y,spec:t,vgSpec:d,finalize:_,embedOptions:n}}const Cbe=new Set(["width","height"]);function Abe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fbe=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var i,r,s;if(Array.isArray(t)){if(i=t.length,i!=n.length)return!1;for(r=i;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),i=s.length,i!==Object.keys(n).length)return!1;for(r=i;r--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[r]))return!1;for(r=i;r--!==0;){var o=s[r];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n};const Tbe=Abe(Fbe);function Mbe(e,t){for(const[n,i]of Object.entries(t))i&&(i&&{}.toString.call(i)==="[object Function]"?i(e.data(n)):e.change(n,po().remove(()=>!0).insert(i)))}function wm(e={},t={},n=new Set){const i=Object.keys(e),r=Object.keys(t);return e===t||i.length===r.length&&i.filter(s=>!n.has(s)).every(s=>e[s]===t[s])}function kI(e,t){const n=Object.keys(t);for(const i of n)try{e.removeSignalListener(i,t[i])}catch(r){console.warn("Cannot remove invalid signal listener.",r)}return n.length>0}function b5(e,t){const n=Object.keys(t);for(const i of n)try{e.addSignalListener(i,t[i])}catch(r){console.warn("Cannot add invalid signal listener.",r)}return n.length>0}function Dbe(e){return new Set(e.flatMap(t=>Object.keys(t)))}function Nbe(e,t){if(e===t)return!1;const n={width:!1,height:!1,isExpensive:!1},i="width"in e||"width"in t,r="height"in e||"height"in t;return i&&(!("width"in e)||!("width"in t)||e.width!==t.width)&&("width"in e&&typeof e.width=="number"?n.width=e.width:n.isExpensive=!0),r&&(!("height"in e)||!("height"in t)||e.height!==t.height)&&("height"in e&&typeof e.height=="number"?n.height=e.height:n.isExpensive=!0),[...Dbe([e,t])].filter(o=>o!=="width"&&o!=="height").some(o=>!(o in e)||!(o in t)||!Tbe(e[o],t[o]))&&(n.isExpensive=!0),n.width!==!1||n.height!==!1||n.isExpensive?n:!1}function EI(e,t){const{width:n,height:i}=t;return typeof n<"u"&&typeof i<"u"?{...e,width:n,height:i}:typeof n<"u"?{...e,width:n}:typeof i<"u"?{...e,height:i}:e}function Rbe(e){let t;return{c(){t=I("div")},m(n,i){L(n,t,i),e[11](t)},p:Y,i:Y,o:Y,d(n){n&&O(t),e[11](null)}}}function Obe(e,t,n){let{options:i}=t,{spec:r}=t,{view:s}=t,{signalListeners:o={}}=t,{data:a={}}=t;const l=Rm();let u,c={},f={},d={},h={},p;Nm(()=>{m()});async function g(){m();try{n(6,u=await Ebe(p,r,i)),n(1,s=u.view),b5(s,o)&&s.runAsync(),b(s)}catch(x){y(x)}}function m(){u&&(u.finalize(),n(6,u=void 0),n(1,s=void 0))}function y(x){l("onError",{error:x}),console.warn(x)}function b(x){v(),l("onNewView",{view:x})}async function v(){a&&Object.keys(a).length>0&&u!==void 0&&(n(1,s=u.view),Mbe(s,a),await s.resize().runAsync())}function _(x){Nn[x?"unshift":"push"](()=>{p=x,n(0,p)})}return e.$$set=x=>{"options"in x&&n(2,i=x.options),"spec"in x&&n(3,r=x.spec),"view"in x&&n(1,s=x.view),"signalListeners"in x&&n(4,o=x.signalListeners),"data"in x&&n(5,a=x.data)},e.$$.update=()=>{if(e.$$.dirty&1056&&(wm(a,h)||v(),n(10,h=a)),e.$$.dirty&991&&p!==void 0){if(!wm(i,c,Cbe))g();else{const x=Nbe(EI(r,i),EI(d,c)),k=o,w=f;if(x){if(x.isExpensive)g();else if(u!==void 0){const E=!wm(k,w);n(1,s=u.view),x.width!==!1&&s.width(x.width),x.height!==!1&&s.height(x.height),E&&(w&&kI(s,w),k&&b5(s,k)),s.runAsync()}}else!wm(k,w)&&u!==void 0&&(n(1,s=u.view),w&&kI(s,w),k&&b5(s,k),s.runAsync())}n(7,c=i),n(8,f=o),n(9,d=r)}},[p,s,i,r,o,a,u,c,f,d,h,_]}class Lbe extends ve{constructor(t){super(),be(this,t,Obe,Rbe,pe,{options:2,spec:3,view:1,signalListeners:4,data:5})}}function Ibe(e){let t,n,i;function r(o){e[6](o)}let s={spec:e[1],data:e[2],signalListeners:e[3],options:e[4]};return e[0]!==void 0&&(s.view=e[0]),t=new Lbe({props:s}),Nn.push(()=>Bm(t,"view",r)),t.$on("onNewView",e[7]),t.$on("onError",e[8]),{c(){he(t.$$.fragment)},m(o,a){fe(t,o,a),i=!0},p(o,[a]){const l={};a&2&&(l.spec=o[1]),a&4&&(l.data=o[2]),a&8&&(l.signalListeners=o[3]),a&16&&(l.options=o[4]),!n&&a&1&&(n=!0,l.view=o[0],Pm(()=>n=!1)),t.$set(l)},i(o){i||(T(t.$$.fragment,o),i=!0)},o(o){N(t.$$.fragment,o),i=!1},d(o){de(t,o)}}}const Pbe="vega";function zbe(e,t,n){let i,{spec:r}=t,{options:s={}}=t,{data:o={}}=t,{signalListeners:a={}}=t,{view:l=void 0}=t;function u(d){l=d,n(0,l)}function c(d){H5.call(this,e,d)}function f(d){H5.call(this,e,d)}return e.$$set=d=>{"spec"in d&&n(1,r=d.spec),"options"in d&&n(5,s=d.options),"data"in d&&n(2,o=d.data),"signalListeners"in d&&n(3,a=d.signalListeners),"view"in d&&n(0,l=d.view)},e.$$.update=()=>{e.$$.dirty&32&&n(4,i={...s,mode:Pbe})},[l,r,o,a,i,s,u,c,f]}class $I extends ve{constructor(t){super(),be(this,t,zbe,Ibe,pe,{spec:1,options:5,data:2,signalListeners:3,view:0})}}function Bbe(e){let t,n;return t=new $I({props:{spec:e[1],options:e[0]}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,r){const s={};r&2&&(s.spec=i[1]),r&1&&(s.options=i[0]),t.$set(s)},i(i){n||(T(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function jbe(e){let t,n;return t=new $I({props:{data:e[2],spec:e[1],options:e[0]}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,r){const s={};r&4&&(s.data=i[2]),r&2&&(s.spec=i[1]),r&1&&(s.options=i[0]),t.$set(s)},i(i){n||(T(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function Ube(e){let t,n,i,r;const s=[jbe,Bbe],o=[];function a(l,u){return l[2]&&l[1]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=De()},m(l,u){o[t].m(l,u),L(l,i,u),r=!0},p(l,[u]){let c=t;t=a(l),t===c?o[t].p(l,u):(ke(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),T(n,1),n.m(i.parentNode,i))},i(l){r||(T(n),r=!0)},o(l){N(n),r=!1},d(l){l&&O(i),o[t].d(l)}}}function qbe(e,t,n){let i,r,s,{componentData:o}=t;return e.$$set=a=>{"componentData"in a&&n(3,o=a.componentData)},e.$$.update=()=>{e.$$.dirty&8&&n(2,{data:i,spec:r,options:s}=o,i,(n(1,r),n(3,o)),(n(0,s),n(3,o)))},[s,r,i,o]}class SI extends ve{constructor(t){super(),be(this,t,qbe,Ube,pe,{componentData:3})}}function Wbe(e){var r;let t,n=(((r=e[0])==null?void 0:r.text)||"")+"",i;return{c(){t=I("p"),i=ce(n),C(t,"data-component","text")},m(s,o){L(s,t,o),R(t,i)},p(s,[o]){var a;o&1&&n!==(n=(((a=s[0])==null?void 0:a.text)||"")+"")&&Me(i,n)},i:Y,o:Y,d(s){s&&O(t)}}}function Hbe(e,t,n){let{componentData:i}=t;return e.$$set=r=>{"componentData"in r&&n(0,i=r.componentData)},[i]}class CI extends ve{constructor(t){super(),be(this,t,Hbe,Wbe,pe,{componentData:0})}}function AI(e){let t,n;return{c(){t=I("h3"),n=ce(e[4]),C(t,"class","value-box-title svelte-175x1n5")},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&16&&Me(n,i[4])},d(i){i&&O(t)}}}function FI(e){let t,n;return{c(){t=I("p"),n=ce(e[3]),C(t,"class","value-box-subtitle svelte-175x1n5")},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&8&&Me(n,i[3])},d(i){i&&O(t)}}}function TI(e){let t,n;return{c(){t=I("div"),n=ce(e[1]),C(t,"class","value-box-change svelte-175x1n5")},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&2&&Me(n,i[1])},d(i){i&&O(t)}}}function Gbe(e){let t,n,i,r,s,o,a,l,u=e[4]&&AI(e),c=e[3]&&FI(e),f=e[1]&&TI(e);return{c(){t=I("div"),n=I("div"),u&&u.c(),i=ge(),r=I("div"),s=ce(e[0]),o=ge(),c&&c.c(),a=ge(),f&&f.c(),C(r,"class","value-box-value svelte-175x1n5"),C(n,"class","value-box-content svelte-175x1n5"),C(t,"class",l="value-box "+(e[2]||"default")+" svelte-175x1n5"),C(t,"id",e[5])},m(d,h){L(d,t,h),R(t,n),u&&u.m(n,null),R(n,i),R(n,r),R(r,s),R(n,o),c&&c.m(n,null),R(n,a),f&&f.m(n,null)},p(d,[h]){d[4]?u?u.p(d,h):(u=AI(d),u.c(),u.m(n,i)):u&&(u.d(1),u=null),h&1&&Me(s,d[0]),d[3]?c?c.p(d,h):(c=FI(d),c.c(),c.m(n,a)):c&&(c.d(1),c=null),d[1]?f?f.p(d,h):(f=TI(d),f.c(),f.m(n,null)):f&&(f.d(1),f=null),h&4&&l!==(l="value-box "+(d[2]||"default")+" svelte-175x1n5")&&C(t,"class",l),h&32&&C(t,"id",d[5])},i:Y,o:Y,d(d){d&&O(t),u&&u.d(),c&&c.d(),f&&f.d()}}}function Vbe(e,t,n){let i,r,s,o,a,l,u,{componentData:c}=t;return e.$$set=f=>{"componentData"in f&&n(6,c=f.componentData)},e.$$.update=()=>{e.$$.dirty&64&&n(5,{id:i,title:r,value:s,subtitle:o,theme:a,change_indicator:l}=c,i,(n(4,r),n(6,c)),(n(7,s),n(6,c)),(n(3,o),n(6,c)),(n(2,a),n(6,c)),(n(1,l),n(6,c))),e.$$.dirty&128&&n(0,u=typeof s=="number"?s.toLocaleString():s)},[u,l,a,o,r,i,c,s]}class MI extends ve{constructor(t){super(),be(this,t,Vbe,Gbe,pe,{componentData:6})}}function Ybe(e){let t,n,i=e[0].data+"",r,s,o;return{c(){t=I("pre"),n=I("code"),r=ce(i),s=ce(` `),o=ce(` -`),$(n,"class","language-python"),$(t,"data-component","pythonCode")},m(a,u){L(a,t,u),R(t,n),R(n,r),R(n,s),e[2](n),R(t,o)},p(a,[u]){u&1&&i!==(i=a[0].data+"")&&Me(r,i)},i:X,o:X,d(a){a&&O(t),e[2](null)}}}function Kve(e,t,n){let{componentData:i}=t,r;function s(){var a;r&&((a=window==null?void 0:window.Prism)==null||a.highlightElement(r))}function o(a){jn[a?"unshift":"push"](()=>{r=a,n(1,r)})}return e.$$set=a=>{"componentData"in a&&n(0,i=a.componentData)},e.$$.update=()=>{e.$$.dirty&2&&r&&s()},[i,r,o]}class AP extends _e{constructor(t){super(),ve(this,t,Kve,Zve,pe,{componentData:0})}}function $P(e,t,n){const i=e.slice();return i[17]=t[n],i[19]=n,i}function SP(e,t,n){const i=e.slice();return i[20]=t[n][0],i[21]=t[n][1],i}function FP(e,t,n){const i=e.slice();return i[24]=t[n],i}function DP(e){let t,n;return{c(){t=I("h3"),n=ce(e[5]),$(t,"class","events-title svelte-11m3hns")},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&32&&Me(n,i[5])},d(i){i&&O(t)}}}function TP(e){let t,n,i,r,s,o,a,u,l=e[2].displayed_events+"",c,f,d=e[2].total_events+"",h,p,g,m,y=e[8]()!==null,b=e[2].events_per_minute&&MP(e),v=y&&Jve(e);return{c(){t=I("div"),n=I("div"),i=I("span"),r=ge(),s=I("span"),s.textContent=`${e[10]()}`,o=ge(),a=I("div"),u=I("span"),c=ce(l),f=ce(" of "),h=ce(d),p=ce(" events"),g=ge(),b&&b.c(),m=ge(),v&&v.c(),$(i,"class","live-dot svelte-11m3hns"),$(s,"class","status-text svelte-11m3hns"),$(n,"class","stats-indicator svelte-11m3hns"),$(u,"class","stat-item svelte-11m3hns"),$(a,"class","stats-info svelte-11m3hns"),$(t,"class","stats-header "+e[9]()+" svelte-11m3hns")},m(_,x){L(_,t,x),R(t,n),R(n,i),R(n,r),R(n,s),R(t,o),R(t,a),R(a,u),R(u,c),R(u,f),R(u,h),R(u,p),R(a,g),b&&b.m(a,null),R(a,m),v&&v.m(a,null)},p(_,x){x&4&&l!==(l=_[2].displayed_events+"")&&Me(c,l),x&4&&d!==(d=_[2].total_events+"")&&Me(h,d),_[2].events_per_minute?b?b.p(_,x):(b=MP(_),b.c(),b.m(a,m)):b&&(b.d(1),b=null),y&&v.p(_,x)},d(_){_&&O(t),b&&b.d(),v&&v.d()}}}function MP(e){let t,n=GP("events_per_minute",e[2].events_per_minute)+"",i;return{c(){t=I("span"),i=ce(n),$(t,"class","stat-item svelte-11m3hns")},m(r,s){L(r,t,s),R(t,i)},p(r,s){s&4&&n!==(n=GP("events_per_minute",r[2].events_per_minute)+"")&&Me(i,n)},d(r){r&&O(t)}}}function Jve(e){let t;return{c(){t=I("span"),t.textContent=`Last: ${e[8]()}`,$(t,"class","stat-item svelte-11m3hns")},m(n,i){L(n,t,i)},p:X,d(n){n&&O(t)}}}function Qve(e){let t,n,i=Pe(e[0]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){t=I("div");for(let o=0;oNo events recorded yet.

",$(t,"class","no-events svelte-11m3hns")},m(n,i){L(n,t,i)},p:X,i:X,o:X,d(n){n&&O(t)}}}function NP(e){let t,n,i=e[7](e[17].received_at)+"",r,s,o=e[17].event_id&&RP(e);return{c(){t=I("div"),n=I("span"),r=ce(i),s=ge(),o&&o.c(),$(n,"class","event-time svelte-11m3hns"),$(t,"class","event-meta svelte-11m3hns")},m(a,u){L(a,t,u),R(t,n),R(n,r),R(t,s),o&&o.m(t,null)},p(a,u){u&1&&i!==(i=a[7](a[17].received_at)+"")&&Me(r,i),a[17].event_id?o?o.p(a,u):(o=RP(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&O(t),o&&o.d()}}}function RP(e){let t,n,i=e[17].event_id+"",r;return{c(){t=I("span"),n=ce("#"),r=ce(i),$(t,"class","event-id svelte-11m3hns")},m(s,o){L(s,t,o),R(t,n),R(t,r)},p(s,o){o&1&&i!==(i=s[17].event_id+"")&&Me(r,i)},d(s){s&&O(t)}}}function OP(e){let t,n,i=e[24]+"",r,s,o,a,u=UP(e[17].metadata[e[24]])+"",l,c,f;return{c(){t=I("div"),n=I("span"),r=ce(i),s=ce(":"),o=ge(),a=I("div"),l=ce(u),f=ge(),$(n,"class","field-key svelte-11m3hns"),$(a,"class",c="field-value "+qP(e[24],e[17].metadata[e[24]])+" svelte-11m3hns"),$(t,"class","event-field svelte-11m3hns")},m(d,h){L(d,t,h),R(t,n),R(n,r),R(n,s),R(t,o),R(t,a),R(a,l),R(t,f)},p(d,h){h&16&&i!==(i=d[24]+"")&&Me(r,i),h&17&&u!==(u=UP(d[17].metadata[d[24]])+"")&&Me(l,u),h&17&&c!==(c="field-value "+qP(d[24],d[17].metadata[d[24]])+" svelte-11m3hns")&&$(a,"class",c)},d(d){d&&O(t)}}}function LP(e){let t,n=e[17].metadata[e[24]]!==void 0&&OP(e);return{c(){n&&n.c(),t=Ne()},m(i,r){n&&n.m(i,r),L(i,t,r)},p(i,r){i[17].metadata[i[24]]!==void 0?n?n.p(i,r):(n=OP(i),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(i){i&&O(t),n&&n.d(i)}}}function IP(e){let t,n,i=Pe(Object.entries(e[17].payloads)),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){t=I("div");for(let o=0;o0,l,c,f,d=e[3].show_relative_time&&NP(e),h=Pe(e[4]),p=[];for(let m=0;m0),u?g?(g.p(m,y),y&1&&D(g,1)):(g=IP(m),g.c(),D(g,1),g.m(r,null)):g&&(Ee(),N(g,1,1,()=>{g=null}),Ce()),(!f||y&1&&c!==(c="event-item "+WP(m[17])+" "+HP(m[17])+" svelte-11m3hns"))&&$(t,"class",c),(!f||y&1)&&At(t,"latest",m[19]===0)},i(m){f||(D(g),f=!0)},o(m){N(g),f=!1},d(m){m&&O(t),d&&d.d(),Nt(p,m),g&&g.d()}}}function t_e(e){let t,n,i,r,s,o,a=e[5]&&DP(e),u=e[3].show_stats&&e[2]&&TP(e);const l=[e_e,Qve],c=[];function f(d,h){return d[0].length===0?0:1}return r=f(e),s=c[r]=l[r](e),{c(){t=I("div"),a&&a.c(),n=ge(),u&&u.c(),i=ge(),s.c(),$(t,"class","events-container svelte-11m3hns"),$(t,"id",e[6])},m(d,h){L(d,t,h),a&&a.m(t,null),R(t,n),u&&u.m(t,null),R(t,i),c[r].m(t,null),o=!0},p(d,[h]){d[5]?a?a.p(d,h):(a=DP(d),a.c(),a.m(t,n)):a&&(a.d(1),a=null),d[3].show_stats&&d[2]?u?u.p(d,h):(u=TP(d),u.c(),u.m(t,i)):u&&(u.d(1),u=null);let p=r;r=f(d),r===p?c[r].p(d,h):(Ee(),N(c[p],1,1,()=>{c[p]=null}),Ce(),s=c[r],s?s.p(d,h):(s=c[r]=l[r](d),s.c()),D(s,1),s.m(t,null)),(!o||h&64)&&$(t,"id",d[6])},i(d){o||(D(s),o=!0)},o(d){N(s),o=!1},d(d){d&&O(t),a&&a.d(),u&&u.d(),c[r].d()}}}function UP(e){return e==null?"":typeof e=="number"&&e>1e9&&e<1e10?new Date(e*1e3).toLocaleString():typeof e=="string"&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(e)?new Date(e).toLocaleString():typeof e=="object"&&!n_e(e)?JSON.stringify(e):String(e)}function n_e(e){return e&&typeof e=="object"&&"type"in e}function i_e(){window.dispatchEvent(new Event("resize")),setTimeout(()=>window.dispatchEvent(new Event("resize")),100)}function qP(e,t){if(e.toLowerCase().includes("timestamp")||e.toLowerCase().includes("time"))return"timestamp";if(e.toLowerCase().includes("status")){if(typeof t=="string"){const n=t.toLowerCase();if(n.includes("success")||n.includes("completed")||n.includes("ok"))return"status-success";if(n.includes("error")||n.includes("failed")||n.includes("fail"))return"status-error";if(n.includes("warning")||n.includes("pending"))return"status-warning"}return"status"}return typeof t=="number"?"number":"default"}function WP(e){return e.style_theme?`theme-${e.style_theme}`:"theme-default"}function HP(e){return e.priority?`priority-${e.priority}`:"priority-normal"}function GP(e,t){return typeof t=="number"?`${t}/min`:String(t)}function r_e(e,t,n){let i,r,s,o,a,u,{componentData:l}=t,c=Date.now(),f;yo(()=>{o.show_relative_time&&(f=setInterval(()=>{c=Date.now()},1e3))}),c2(()=>{f&&clearInterval(f)});function d(_){const x=(c-_*1e3)/1e3;return x<60?`${Math.floor(x)}s ago`:x<3600?`${Math.floor(x/60)}m ago`:x<86400?`${Math.floor(x/3600)}h ago`:`${Math.floor(x/86400)}d ago`}function h(){return s&&s.length>0&&typeof s[0].received_at=="number"?s[0].received_at:a&&typeof a.last_update=="number"?a.last_update:null}function p(){const _=h();return _==null?null:Math.max(0,(c-_*1e3)/1e3)}function g(){const _=h();return _==null?null:d(_)}let m=null;function y(){if(a!=null&&a.finished)return"finished";const _=p();return _==null||_<60?"live":_<300?"recent":_<600?"stale":"finished"}function b(){const _=p();return a!=null&&a.finished?"Finished":_==null||_<60?"Live":_<300?"Recent":_<600?"Stale":"Inactive"}function v(_){jn[_?"unshift":"push"](()=>{m=_,n(1,m)})}return e.$$set=_=>{"componentData"in _&&n(11,l=_.componentData)},e.$$.update=()=>{e.$$.dirty&2048&&n(6,{id:i,title:r,events:s,config:o,stats:a}=l,i,(n(5,r),n(11,l)),(n(0,s),n(11,l)),(n(3,o),n(11,l)),(n(2,a),n(11,l))),e.$$.dirty&1&&n(4,u=s.length>0?Array.from(new Set(s.flatMap(_=>Object.keys(_.metadata)))):[])},[s,m,a,o,u,r,i,d,g,y,b,l,v]}class VP extends _e{constructor(t){super(),ve(this,t,r_e,t_e,pe,{componentData:11})}}function s_e(e){let t,n;return{c(){t=I("span"),n=ce(e[5]),$(t,"class","json-label svelte-1b8g4ty")},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&32&&Me(n,i[5])},d(i){i&&O(t)}}}function o_e(e){let t,n,i,r,s,o,a;return{c(){t=I("button"),n=I("span"),n.textContent="▼",i=ge(),r=ce(e[5]),$(n,"class","collapse-icon svelte-1b8g4ty"),At(n,"collapsed",e[2]),$(t,"class","collapse-button svelte-1b8g4ty"),$(t,"aria-label",s=e[2]?"Expand JSON":"Collapse JSON")},m(u,l){L(u,t,l),R(t,n),R(t,i),R(t,r),o||(a=ur(t,"click",e[12]),o=!0)},p(u,l){l&4&&At(n,"collapsed",u[2]),l&32&&Me(r,u[5]),l&4&&s!==(s=u[2]?"Expand JSON":"Collapse JSON")&&$(t,"aria-label",s)},d(u){u&&O(t),o=!1,a()}}}function YP(e){let t,n,i,r;function s(u,l){return u[3]?u_e:a_e}let o=s(e),a=o(e);return{c(){t=I("button"),a.c(),$(t,"class","copy-button svelte-1b8g4ty"),$(t,"title",n=e[3]?"Copied!":"Copy to clipboard"),At(t,"success",e[3])},m(u,l){L(u,t,l),a.m(t,null),i||(r=ur(t,"click",e[9]),i=!0)},p(u,l){o!==(o=s(u))&&(a.d(1),a=o(u),a&&(a.c(),a.m(t,null))),l&8&&n!==(n=u[3]?"Copied!":"Copy to clipboard")&&$(t,"title",n),l&8&&At(t,"success",u[3])},d(u){u&&O(t),a.d(),i=!1,r()}}}function a_e(e){let t;return{c(){t=ce("📋 Copy")},m(n,i){L(n,t,i)},d(n){n&&O(t)}}}function u_e(e){let t;return{c(){t=ce("✓ Copied")},m(n,i){L(n,t,i)},d(n){n&&O(t)}}}function XP(e){let t,n,i,r;return{c(){t=I("div"),n=I("pre"),i=I("code"),r=ce(e[1]),$(i,"class","language-json svelte-1b8g4ty"),$(n,"class","json-code svelte-1b8g4ty"),$(t,"class","json-content svelte-1b8g4ty"),$(t,"style",e[4])},m(s,o){L(s,t,o),R(t,n),R(n,i),R(i,r),e[13](i)},p(s,o){o&2&&Me(r,s[1]),o&16&&$(t,"style",s[4])},d(s){s&&O(t),e[13](null)}}}function l_e(e){let t,n,i,r;function s(c,f){return c[7]?o_e:s_e}let o=s(e),a=o(e),u=e[6]&&YP(e),l=!e[2]&&XP(e);return{c(){t=I("div"),n=I("div"),a.c(),i=ge(),u&&u.c(),r=ge(),l&&l.c(),$(n,"class","json-header svelte-1b8g4ty"),$(t,"class","json-viewer svelte-1b8g4ty"),$(t,"id",e[8])},m(c,f){L(c,t,f),R(t,n),a.m(n,null),R(n,i),u&&u.m(n,null),R(t,r),l&&l.m(t,null)},p(c,[f]){o===(o=s(c))&&a?a.p(c,f):(a.d(1),a=o(c),a&&(a.c(),a.m(n,i))),c[6]?u?u.p(c,f):(u=YP(c),u.c(),u.m(n,null)):u&&(u.d(1),u=null),c[2]?l&&(l.d(1),l=null):l?l.p(c,f):(l=XP(c),l.c(),l.m(t,null)),f&256&&$(t,"id",c[8])},i:X,o:X,d(c){c&&O(t),a.d(),u&&u.d(),l&&l.d()}}}function c_e(e,t,n){let i,r,s,o,a,u,l,{componentData:c}=t,f=!1,d=!1,h,p;async function g(){try{await navigator.clipboard.writeText(r),n(3,d=!0),clearTimeout(h),h=setTimeout(()=>{n(3,d=!1)},2e3)}catch(v){console.error("Failed to copy: ",v)}}function m(){p&&(window!=null&&window.Prism)&&window.Prism.highlightElement(p)}yo(()=>{m()});const y=()=>n(2,f=!f);function b(v){jn[v?"unshift":"push"](()=>{p=v,n(0,p)})}return e.$$set=v=>{"componentData"in v&&n(10,c=v.componentData)},e.$$.update=()=>{e.$$.dirty&1024&&n(8,{id:i,json_string:r,collapsible:s,show_copy_button:o,max_height:a,title:u}=c,i,(n(1,r),n(10,c)),(n(7,s),n(10,c)),(n(6,o),n(10,c)),(n(11,a),n(10,c)),(n(5,u),n(10,c))),e.$$.dirty&3&&p&&r&&m(),e.$$.dirty&2048&&n(4,l=a?`max-height: ${a}`:"")},[p,r,f,d,l,u,o,s,i,g,c,a,y,b]}class ZP extends _e{constructor(t){super(),ve(this,t,c_e,l_e,pe,{componentData:10})}}function f_e(e){let t,n;return{c(){t=I("span"),n=ce(e[5]),$(t,"class","yaml-label svelte-yn00t6")},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&32&&Me(n,i[5])},d(i){i&&O(t)}}}function d_e(e){let t,n,i,r,s,o,a;return{c(){t=I("button"),n=I("span"),n.textContent="▼",i=ge(),r=ce(e[5]),$(n,"class","collapse-icon svelte-yn00t6"),At(n,"collapsed",e[2]),$(t,"class","collapse-button svelte-yn00t6"),$(t,"aria-label",s=e[2]?"Expand YAML":"Collapse YAML")},m(u,l){L(u,t,l),R(t,n),R(t,i),R(t,r),o||(a=ur(t,"click",e[12]),o=!0)},p(u,l){l&4&&At(n,"collapsed",u[2]),l&32&&Me(r,u[5]),l&4&&s!==(s=u[2]?"Expand YAML":"Collapse YAML")&&$(t,"aria-label",s)},d(u){u&&O(t),o=!1,a()}}}function KP(e){let t,n,i,r;function s(u,l){return u[3]?p_e:h_e}let o=s(e),a=o(e);return{c(){t=I("button"),a.c(),$(t,"class","copy-button svelte-yn00t6"),$(t,"title",n=e[3]?"Copied!":"Copy to clipboard"),At(t,"success",e[3])},m(u,l){L(u,t,l),a.m(t,null),i||(r=ur(t,"click",e[9]),i=!0)},p(u,l){o!==(o=s(u))&&(a.d(1),a=o(u),a&&(a.c(),a.m(t,null))),l&8&&n!==(n=u[3]?"Copied!":"Copy to clipboard")&&$(t,"title",n),l&8&&At(t,"success",u[3])},d(u){u&&O(t),a.d(),i=!1,r()}}}function h_e(e){let t;return{c(){t=ce("📋 Copy")},m(n,i){L(n,t,i)},d(n){n&&O(t)}}}function p_e(e){let t;return{c(){t=ce("✓ Copied")},m(n,i){L(n,t,i)},d(n){n&&O(t)}}}function JP(e){let t,n,i,r;return{c(){t=I("div"),n=I("pre"),i=I("code"),r=ce(e[1]),$(i,"class","language-yaml svelte-yn00t6"),$(n,"class","yaml-code svelte-yn00t6"),$(t,"class","yaml-content svelte-yn00t6"),$(t,"style",e[4])},m(s,o){L(s,t,o),R(t,n),R(n,i),R(i,r),e[13](i)},p(s,o){o&2&&Me(r,s[1]),o&16&&$(t,"style",s[4])},d(s){s&&O(t),e[13](null)}}}function g_e(e){let t,n,i,r;function s(c,f){return c[7]?d_e:f_e}let o=s(e),a=o(e),u=e[6]&&KP(e),l=!e[2]&&JP(e);return{c(){t=I("div"),n=I("div"),a.c(),i=ge(),u&&u.c(),r=ge(),l&&l.c(),$(n,"class","yaml-header svelte-yn00t6"),$(t,"class","yaml-viewer svelte-yn00t6"),$(t,"id",e[8])},m(c,f){L(c,t,f),R(t,n),a.m(n,null),R(n,i),u&&u.m(n,null),R(t,r),l&&l.m(t,null)},p(c,[f]){o===(o=s(c))&&a?a.p(c,f):(a.d(1),a=o(c),a&&(a.c(),a.m(n,i))),c[6]?u?u.p(c,f):(u=KP(c),u.c(),u.m(n,null)):u&&(u.d(1),u=null),c[2]?l&&(l.d(1),l=null):l?l.p(c,f):(l=JP(c),l.c(),l.m(t,null)),f&256&&$(t,"id",c[8])},i:X,o:X,d(c){c&&O(t),a.d(),u&&u.d(),l&&l.d()}}}function m_e(e,t,n){let i,r,s,o,a,u,l,{componentData:c}=t,f=!1,d=!1,h,p;async function g(){try{await navigator.clipboard.writeText(r),n(3,d=!0),clearTimeout(h),h=setTimeout(()=>{n(3,d=!1)},2e3)}catch(v){console.error("Failed to copy: ",v)}}function m(){p&&(window!=null&&window.Prism)&&window.Prism.highlightElement(p)}yo(()=>{m()});const y=()=>n(2,f=!f);function b(v){jn[v?"unshift":"push"](()=>{p=v,n(0,p)})}return e.$$set=v=>{"componentData"in v&&n(10,c=v.componentData)},e.$$.update=()=>{e.$$.dirty&1024&&n(8,{id:i,yaml_string:r,collapsible:s,show_copy_button:o,max_height:a,title:u}=c,i,(n(1,r),n(10,c)),(n(7,s),n(10,c)),(n(6,o),n(10,c)),(n(11,a),n(10,c)),(n(5,u),n(10,c))),e.$$.dirty&3&&p&&r&&m(),e.$$.dirty&2048&&n(4,l=a?`max-height: ${a}`:"")},[p,r,f,d,l,u,o,s,i,g,c,a,y,b]}class QP extends _e{constructor(t){super(),ve(this,t,m_e,g_e,pe,{componentData:10})}}function y_e(e){let t;return{c(){t=ce(e[0])},m(n,i){L(n,t,i)},p(n,i){i&1&&Me(t,n[0])},i:X,o:X,d(n){n&&O(t)}}}function b_e(e){let t,n,i;var r=e[1];function s(o,a){return{props:{componentData:o[0]}}}return r&&(t=Ke(r,s(e))),{c(){t&&he(t.$$.fragment),n=Ne()},m(o,a){t&&fe(t,o,a),L(o,n,a),i=!0},p(o,a){if(a&2&&r!==(r=o[1])){if(t){Ee();const u=t;N(u.$$.fragment,1,0,()=>{de(u,1)}),Ce()}r?(t=Ke(r,s(o)),he(t.$$.fragment),D(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(r){const u={};a&1&&(u.componentData=o[0]),t.$set(u)}},i(o){i||(t&&D(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&O(n),t&&de(t,o)}}}function v_e(e){let t,n,i,r;const s=[b_e,y_e],o=[];function a(u,l){return u[1]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ne()},m(u,l){o[t].m(u,l),L(u,i,l),r=!0},p(u,[l]){let c=t;t=a(u),t===c?o[t].p(u,l):(Ee(),N(o[c],1,1,()=>{o[c]=null}),Ce(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),D(n,1),n.m(i.parentNode,i))},i(u){r||(D(n),r=!0)},o(u){N(n),r=!1},d(u){u&&O(i),o[t].d(u)}}}function __e(e,t,n){let{componentData:i}=t,r;const s={artifacts:N5,dag:H5,heading:Z5,image:Q5,log:e4,markdown:k4,progressBar:$4,text:xP,valueBox:CP,vegaChart:_P,pythonCode:AP,eventsTimeline:VP,jsonViewer:ZP,yamlViewer:QP},o=i==null?void 0:i.type;return o&&(r=s==null?void 0:s[o],r||console.error("Unknown component type: ",o)),e.$$set=a=>{"componentData"in a&&n(0,i=a.componentData)},[i,r]}class ez extends _e{constructor(t){super(),ve(this,t,__e,v_e,pe,{componentData:0})}}function tz(e,t,n){const i=e.slice();return i[3]=t[n],i[5]=n,i}function nz(e,t,n){const i=e.slice();return i[6]=t[n],i}function iz(e){let t,n,i,r,s=Pe(e[1]),o=[];for(let u=0;uN(o[u],1,1,()=>{o[u]=null});return{c(){t=I("div"),n=I("table"),i=I("tbody");for(let u=0;uN(l[f],1,1,()=>{l[f]=null});return{c(){t=I("tr"),n=I("td"),r=ce(i),s=ge();for(let f=0;f{i=null}),Ce())},i(r){n||(D(i),n=!0)},o(r){N(i),n=!1},d(r){r&&O(t),i&&i.d(r)}}}function w_e(e,t,n){let i,r,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(2,s=o.componentData)},e.$$.update=()=>{e.$$.dirty&4&&n(1,{columns:i,data:r}=s,i,(n(0,r),n(2,s)))},[r,i,s]}class k_e extends _e{constructor(t){super(),ve(this,t,w_e,x_e,pe,{componentData:2})}}function oz(e,t,n){const i=e.slice();return i[3]=t[n],i}function az(e,t,n){const i=e.slice();return i[6]=t[n],i}function uz(e,t,n){const i=e.slice();return i[9]=t[n],i}function lz(e){let t,n,i,r,s,o,a,u=Pe(e[1]),l=[];for(let h=0;hN(f[h],1,1,()=>{f[h]=null});return{c(){t=I("div"),n=I("table"),i=I("thead"),r=I("tr");for(let h=0;hN(s[a],1,1,()=>{s[a]=null});return{c(){t=I("tr");for(let a=0;a{i=null}),Ce())},i(r){n||(D(i),n=!0)},o(r){N(i),n=!1},d(r){r&&O(t),i&&i.d(r)}}}function C_e(e,t,n){let i,r,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(2,s=o.componentData)},e.$$.update=()=>{e.$$.dirty&4&&n(1,{columns:i,data:r}=s,i,(n(0,r),n(2,s)))},[r,i,s]}class A_e extends _e{constructor(t){super(),ve(this,t,C_e,E_e,pe,{componentData:2})}}function hz(e){let t,n,i;var r=e[3];function s(o,a){return{props:{componentData:o[0]}}}return r&&(t=Ke(r,s(e))),{c(){t&&he(t.$$.fragment),n=Ne()},m(o,a){t&&fe(t,o,a),L(o,n,a),i=!0},p(o,a){if(r!==(r=o[3])){if(t){Ee();const u=t;N(u.$$.fragment,1,0,()=>{de(u,1)}),Ce()}r?(t=Ke(r,s(o)),he(t.$$.fragment),D(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(r){const u={};a&1&&(u.componentData=o[0]),t.$set(u)}},i(o){i||(t&&D(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&O(n),t&&de(t,o)}}}function $_e(e){let t,n,i=e[2]&&e[1]&&hz(e);return{c(){i&&i.c(),t=Ne()},m(r,s){i&&i.m(r,s),L(r,t,s),n=!0},p(r,[s]){r[2]&&r[1]?i?(i.p(r,s),s&6&&D(i,1)):(i=hz(r),i.c(),D(i,1),i.m(t.parentNode,t)):i&&(Ee(),N(i,1,1,()=>{i=null}),Ce())},i(r){n||(D(i),n=!0)},o(r){N(i),n=!1},d(r){r&&O(t),i&&i.d(r)}}}function S_e(e,t,n){let i,r,s,{componentData:o}=t;const a=s?k_e:A_e;return e.$$set=u=>{"componentData"in u&&n(0,o=u.componentData)},e.$$.update=()=>{e.$$.dirty&1&&n(2,{columns:i,data:r,vertical:s}=o,i,(n(1,r),n(0,o)))},[o,r,i,a]}class F_e extends _e{constructor(t){super(),ve(this,t,S_e,$_e,pe,{componentData:0})}}function pz(e,t,n){const i=e.slice();return i[3]=t[n],i}function D_e(e){let t,n,i,r;const s=[M_e,T_e],o=[];function a(u,l){var c;return(u[0].type==="page"||u[0].type==="section")&&((c=u[0])!=null&&c.contents)?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=Ne()},m(u,l){o[t].m(u,l),L(u,i,l),r=!0},p(u,l){let c=t;t=a(u),t===c?o[t].p(u,l):(Ee(),N(o[c],1,1,()=>{o[c]=null}),Ce(),n=o[t],n?n.p(u,l):(n=o[t]=s[t](u),n.c()),D(n,1),n.m(i.parentNode,i))},i(u){r||(D(n),r=!0)},o(u){N(n),r=!1},d(u){u&&O(i),o[t].d(u)}}}function T_e(e){let t,n,i;var r=e[1];function s(o,a){return{props:{componentData:o[0]}}}return r&&(t=Ke(r,s(e))),{c(){t&&he(t.$$.fragment),n=Ne()},m(o,a){t&&fe(t,o,a),L(o,n,a),i=!0},p(o,a){if(r!==(r=o[1])){if(t){Ee();const u=t;N(u.$$.fragment,1,0,()=>{de(u,1)}),Ce()}r?(t=Ke(r,s(o)),he(t.$$.fragment),D(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(r){const u={};a&1&&(u.componentData=o[0]),t.$set(u)}},i(o){i||(t&&D(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&O(n),t&&de(t,o)}}}function M_e(e){let t,n,i;var r=e[1];function s(o,a){return{props:{componentData:o[0],$$slots:{default:[N_e]},$$scope:{ctx:o}}}}return r&&(t=Ke(r,s(e))),{c(){t&&he(t.$$.fragment),n=Ne()},m(o,a){t&&fe(t,o,a),L(o,n,a),i=!0},p(o,a){if(r!==(r=o[1])){if(t){Ee();const u=t;N(u.$$.fragment,1,0,()=>{de(u,1)}),Ce()}r?(t=Ke(r,s(o)),he(t.$$.fragment),D(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(r){const u={};a&1&&(u.componentData=o[0]),a&65&&(u.$$scope={dirty:a,ctx:o}),t.$set(u)}},i(o){i||(t&&D(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&O(n),t&&de(t,o)}}}function gz(e){let t,n;return t=new Qm({props:{componentData:e[3]}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.componentData=i[3]),t.$set(s)},i(i){n||(D(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function N_e(e){let t,n,i=Pe(e[0].contents),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{"componentData"in o&&n(0,i=o.componentData)},[i,s]}class Qm extends _e{constructor(t){super(),ve(this,t,O_e,R_e,pe,{componentData:0})}}function L_e(e){let t,n,i;const r=e[1].default,s=yt(r,e,e[0],null);return{c(){t=I("main"),n=I("div"),s&&s.c(),$(n,"class","mainContainer svelte-mqeomk"),$(t,"class","svelte-mqeomk")},m(o,a){L(o,t,a),R(t,n),s&&s.m(n,null),i=!0},p(o,[a]){s&&s.p&&(!i||a&1)&&vt(s,r,o,o[0],i?bt(r,o[0],a,null):_t(o[0]),null)},i(o){i||(D(s,o),i=!0)},o(o){N(s,o),i=!1},d(o){o&&O(t),s&&s.d(o)}}}function I_e(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class P_e extends _e{constructor(t){super(),ve(this,t,I_e,L_e,pe,{})}}const Nh=/^[a-z0-9]+(-[a-z0-9]+)*$/,e2=(e,t,n,i="")=>{const r=e.split(":");if(e.slice(0,1)==="@"){if(r.length<2||r.length>3)return null;i=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const a=r.pop(),u=r.pop(),l={provider:r.length>0?r[0]:i,prefix:u,name:a};return t&&!t2(l)?null:l}const s=r[0],o=s.split("-");if(o.length>1){const a={provider:i,prefix:o.shift(),name:o.join("-")};return t&&!t2(a)?null:a}if(n&&i===""){const a={provider:i,prefix:"",name:s};return t&&!t2(a,n)?null:a}return null},t2=(e,t)=>e?!!((e.provider===""||e.provider.match(Nh))&&(t&&e.prefix===""||e.prefix.match(Nh))&&e.name.match(Nh)):!1,mz=Object.freeze({left:0,top:0,width:16,height:16}),n2=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),i2=Object.freeze({...mz,...n2}),t5=Object.freeze({...i2,body:"",hidden:!1});function z_e(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(n.rotate=i),n}function yz(e,t){const n=z_e(e,t);for(const i in t5)i in n2?i in e&&!(i in n)&&(n[i]=n2[i]):i in t?n[i]=t[i]:i in e&&(n[i]=e[i]);return n}function B_e(e,t){const n=e.icons,i=e.aliases||Object.create(null),r=Object.create(null);function s(o){if(n[o])return r[o]=[];if(!(o in r)){r[o]=null;const a=i[o]&&i[o].parent,u=a&&s(a);u&&(r[o]=[a].concat(u))}return r[o]}return Object.keys(n).concat(Object.keys(i)).forEach(s),r}function j_e(e,t,n){const i=e.icons,r=e.aliases||Object.create(null);let s={};function o(a){s=yz(i[a]||r[a],s)}return o(t),n.forEach(o),yz(e,s)}function bz(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(r=>{t(r,null),n.push(r)});const i=B_e(e);for(const r in i){const s=i[r];s&&(t(r,j_e(e,r,s)),n.push(r))}return n}const U_e={provider:"",aliases:{},not_found:{},...mz};function n5(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function vz(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!n5(e,U_e))return null;const n=t.icons;for(const r in n){const s=n[r];if(!r.match(Nh)||typeof s.body!="string"||!n5(s,t5))return null}const i=t.aliases||Object.create(null);for(const r in i){const s=i[r],o=s.parent;if(!r.match(Nh)||typeof o!="string"||!n[o]&&!i[o]||!n5(s,t5))return null}return t}const _z=Object.create(null);function q_e(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Xu(e,t){const n=_z[e]||(_z[e]=Object.create(null));return n[t]||(n[t]=q_e(e,t))}function i5(e,t){return vz(t)?bz(t,(n,i)=>{i?e.icons[n]=i:e.missing.add(n)}):[]}function W_e(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let Rh=!1;function xz(e){return typeof e=="boolean"&&(Rh=e),Rh}function H_e(e){const t=typeof e=="string"?e2(e,!0,Rh):e;if(t){const n=Xu(t.provider,t.prefix),i=t.name;return n.icons[i]||(n.missing.has(i)?null:void 0)}}function G_e(e,t){const n=e2(e,!0,Rh);if(!n)return!1;const i=Xu(n.provider,n.prefix);return W_e(i,n.name,t)}function V_e(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),Rh&&!t&&!e.prefix){let r=!1;return vz(e)&&(e.prefix="",bz(e,(s,o)=>{o&&G_e(s,o)&&(r=!0)})),r}const n=e.prefix;if(!t2({provider:t,prefix:n,name:"a"}))return!1;const i=Xu(t,n);return!!i5(i,e)}const wz=Object.freeze({width:null,height:null}),kz=Object.freeze({...wz,...n2}),Y_e=/(-?[0-9.]*[0-9]+[0-9.]*)/g,X_e=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Ez(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const i=e.split(Y_e);if(i===null||!i.length)return e;const r=[];let s=i.shift(),o=X_e.test(s);for(;;){if(o){const a=parseFloat(s);isNaN(a)?r.push(s):r.push(Math.ceil(a*t*n)/n)}else r.push(s);if(s=i.shift(),s===void 0)return r.join("");o=!o}}function Z_e(e,t="defs"){let n="";const i=e.indexOf("<"+t);for(;i>=0;){const r=e.indexOf(">",i),s=e.indexOf("",s);if(o===-1)break;n+=e.slice(r+1,s).trim(),e=e.slice(0,i).trim()+e.slice(o+1)}return{defs:n,content:e}}function K_e(e,t){return e?""+e+""+t:t}function J_e(e,t,n){const i=Z_e(e);return K_e(i.defs,t+i.content+n)}const Q_e=e=>e==="unset"||e==="undefined"||e==="none";function e7e(e,t){const n={...i2,...e},i={...kz,...t},r={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,i].forEach(g=>{const m=[],y=g.hFlip,b=g.vFlip;let v=g.rotate;y?b?v+=2:(m.push("translate("+(r.width+r.left).toString()+" "+(0-r.top).toString()+")"),m.push("scale(-1 1)"),r.top=r.left=0):b&&(m.push("translate("+(0-r.left).toString()+" "+(r.height+r.top).toString()+")"),m.push("scale(1 -1)"),r.top=r.left=0);let _;switch(v<0&&(v-=Math.floor(v/4)*4),v=v%4,v){case 1:_=r.height/2+r.top,m.unshift("rotate(90 "+_.toString()+" "+_.toString()+")");break;case 2:m.unshift("rotate(180 "+(r.width/2+r.left).toString()+" "+(r.height/2+r.top).toString()+")");break;case 3:_=r.width/2+r.left,m.unshift("rotate(-90 "+_.toString()+" "+_.toString()+")");break}v%2===1&&(r.left!==r.top&&(_=r.left,r.left=r.top,r.top=_),r.width!==r.height&&(_=r.width,r.width=r.height,r.height=_)),m.length&&(s=J_e(s,'',""))});const o=i.width,a=i.height,u=r.width,l=r.height;let c,f;o===null?(f=a===null?"1em":a==="auto"?l:a,c=Ez(f,u/l)):(c=o==="auto"?u:o,f=a===null?Ez(c,l/u):a==="auto"?l:a);const d={},h=(g,m)=>{Q_e(m)||(d[g]=m.toString())};h("width",c),h("height",f);const p=[r.left,r.top,u,l];return d.viewBox=p.join(" "),{attributes:d,viewBox:p,body:s}}const t7e=/\sid="(\S+)"/g,n7e="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let i7e=0;function r7e(e,t=n7e){const n=[];let i;for(;i=t7e.exec(e);)n.push(i[1]);if(!n.length)return e;const r="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const o=typeof t=="function"?t(s):t+(i7e++).toString(),a=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+o+r+"$3")}),e=e.replace(new RegExp(r,"g"),""),e}const r5=Object.create(null);function s7e(e,t){r5[e]=t}function s5(e){return r5[e]||r5[""]}function o5(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const a5=Object.create(null),Oh=["https://api.simplesvg.com","https://api.unisvg.com"],r2=[];for(;Oh.length>0;)Oh.length===1||Math.random()>.5?r2.push(Oh.shift()):r2.push(Oh.pop());a5[""]=o5({resources:["https://api.iconify.design"].concat(r2)});function o7e(e,t){const n=o5(t);return n===null?!1:(a5[e]=n,!0)}function u5(e){return a5[e]}let Cz=(()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}})();function a7e(e,t){const n=u5(e);if(!n)return 0;let i;if(!n.maxURL)i=0;else{let r=0;n.resources.forEach(o=>{r=Math.max(r,o.length)});const s=t+".json?icons=";i=n.maxURL-r-n.path.length-s.length}return i}function u7e(e){return e===404}const l7e=(e,t,n)=>{const i=[],r=a7e(e,t),s="icons";let o={type:s,provider:e,prefix:t,icons:[]},a=0;return n.forEach((u,l)=>{a+=u.length+1,a>=r&&l>0&&(i.push(o),o={type:s,provider:e,prefix:t,icons:[]},a=u.length),o.icons.push(u)}),i.push(o),i};function c7e(e){if(typeof e=="string"){const t=u5(e);if(t)return t.path}return"/"}const f7e={prepare:l7e,send:(e,t,n)=>{if(!Cz){n("abort",424);return}let i=c7e(t.provider);switch(t.type){case"icons":{const s=t.prefix,a=t.icons.join(","),u=new URLSearchParams({icons:a});i+=s+".json?"+u.toString();break}case"custom":{const s=t.uri;i+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let r=503;Cz(e+i).then(s=>{const o=s.status;if(o!==200){setTimeout(()=>{n(u7e(o)?"abort":"next",o)});return}return r=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",r)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",r)})}};function d7e(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((r,s)=>r.provider!==s.provider?r.provider.localeCompare(s.provider):r.prefix!==s.prefix?r.prefix.localeCompare(s.prefix):r.name.localeCompare(s.name));let i={provider:"",prefix:"",name:""};return e.forEach(r=>{if(i.name===r.name&&i.prefix===r.prefix&&i.provider===r.provider)return;i=r;const s=r.provider,o=r.prefix,a=r.name,u=n[s]||(n[s]=Object.create(null)),l=u[o]||(u[o]=Xu(s,o));let c;a in l.icons?c=t.loaded:o===""||l.missing.has(a)?c=t.missing:c=t.pending;const f={provider:s,prefix:o,name:a};c.push(f)}),t}function Az(e,t){e.forEach(n=>{const i=n.loaderCallbacks;i&&(n.loaderCallbacks=i.filter(r=>r.id!==t))})}function h7e(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const i=e.provider,r=e.prefix;t.forEach(s=>{const o=s.icons,a=o.pending.length;o.pending=o.pending.filter(u=>{if(u.prefix!==r)return!0;const l=u.name;if(e.icons[l])o.loaded.push({provider:i,prefix:r,name:l});else if(e.missing.has(l))o.missing.push({provider:i,prefix:r,name:l});else return n=!0,!0;return!1}),o.pending.length!==a&&(n||Az([e],s.id),s.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),s.abort))})}))}let p7e=0;function g7e(e,t,n){const i=p7e++,r=Az.bind(null,n,i);if(!t.pending.length)return r;const s={id:i,icons:t,callback:e,abort:r};return n.forEach(o=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(s)}),r}function m7e(e,t=!0,n=!1){const i=[];return e.forEach(r=>{const s=typeof r=="string"?e2(r,t,n):r;s&&i.push(s)}),i}var y7e={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function b7e(e,t,n,i){const r=e.resources.length,s=e.random?Math.floor(Math.random()*r):e.index;let o;if(e.random){let k=e.resources.slice(0);for(o=[];k.length>1;){const w=Math.floor(Math.random()*k.length);o.push(k[w]),k=k.slice(0,w).concat(k.slice(w+1))}o=o.concat(k)}else o=e.resources.slice(s).concat(e.resources.slice(0,s));const a=Date.now();let u="pending",l=0,c,f=null,d=[],h=[];typeof i=="function"&&h.push(i);function p(){f&&(clearTimeout(f),f=null)}function g(){u==="pending"&&(u="aborted"),p(),d.forEach(k=>{k.status==="pending"&&(k.status="aborted")}),d=[]}function m(k,w){w&&(h=[]),typeof k=="function"&&h.push(k)}function y(){return{startTime:a,payload:t,status:u,queriesSent:l,queriesPending:d.length,subscribe:m,abort:g}}function b(){u="failed",h.forEach(k=>{k(void 0,c)})}function v(){d.forEach(k=>{k.status==="pending"&&(k.status="aborted")}),d=[]}function _(k,w,E){const C=w!=="success";switch(d=d.filter(F=>F!==k),u){case"pending":break;case"failed":if(C||!e.dataAfterTimeout)return;break;default:return}if(w==="abort"){c=E,b();return}if(C){c=E,d.length||(o.length?x():b());return}if(p(),v(),!e.random){const F=e.resources.indexOf(k.resource);F!==-1&&F!==e.index&&(e.index=F)}u="completed",h.forEach(F=>{F(E)})}function x(){if(u!=="pending")return;p();const k=o.shift();if(k===void 0){if(d.length){f=setTimeout(()=>{p(),u==="pending"&&(v(),b())},e.timeout);return}b();return}const w={status:"pending",resource:k,callback:(E,C)=>{_(w,E,C)}};d.push(w),l++,f=setTimeout(x,e.rotate),n(k,t,w.callback)}return setTimeout(x),y}function $z(e){const t={...y7e,...e};let n=[];function i(){n=n.filter(a=>a().status==="pending")}function r(a,u,l){const c=b7e(t,a,u,(f,d)=>{i(),l&&l(f,d)});return n.push(c),c}function s(a){return n.find(u=>a(u))||null}return{query:r,find:s,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:i}}function Sz(){}const l5=Object.create(null);function v7e(e){if(!l5[e]){const t=u5(e);if(!t)return;const n=$z(t),i={config:t,redundancy:n};l5[e]=i}return l5[e]}function _7e(e,t,n){let i,r;if(typeof e=="string"){const s=s5(e);if(!s)return n(void 0,424),Sz;r=s.send;const o=v7e(e);o&&(i=o.redundancy)}else{const s=o5(e);if(s){i=$z(s);const o=e.resources?e.resources[0]:"",a=s5(o);a&&(r=a.send)}}return!i||!r?(n(void 0,424),Sz):i.query(t,r,n)().abort}const Fz="iconify2",Lh="iconify",Dz=Lh+"-count",Tz=Lh+"-version",Mz=36e5,x7e=168,w7e=50;function c5(e,t){try{return e.getItem(t)}catch{}}function f5(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Nz(e,t){try{e.removeItem(t)}catch{}}function d5(e,t){return f5(e,Dz,t.toString())}function h5(e){return parseInt(c5(e,Dz))||0}const s2={local:!0,session:!0},Rz={local:new Set,session:new Set};let p5=!1;function k7e(e){p5=e}let o2=typeof window>"u"?{}:window;function Oz(e){const t=e+"Storage";try{if(o2&&o2[t]&&typeof o2[t].length=="number")return o2[t]}catch{}s2[e]=!1}function Lz(e,t){const n=Oz(e);if(!n)return;const i=c5(n,Tz);if(i!==Fz){if(i){const a=h5(n);for(let u=0;u{const u=Lh+a.toString(),l=c5(n,u);if(typeof l=="string"){try{const c=JSON.parse(l);if(typeof c=="object"&&typeof c.cached=="number"&&c.cached>r&&typeof c.provider=="string"&&typeof c.data=="object"&&typeof c.data.prefix=="string"&&t(c,a))return!0}catch{}Nz(n,u)}};let o=h5(n);for(let a=o-1;a>=0;a--)s(a)||(a===o-1?(o--,d5(n,o)):Rz[e].add(a))}function Iz(){if(!p5){k7e(!0);for(const e in s2)Lz(e,t=>{const n=t.data,i=t.provider,r=n.prefix,s=Xu(i,r);if(!i5(s,n).length)return!1;const o=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,o):o,!0})}}function E7e(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const i in s2)Lz(i,r=>{const s=r.data;return r.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function C7e(e,t){p5||Iz();function n(i){let r;if(!s2[i]||!(r=Oz(i)))return;const s=Rz[i];let o;if(s.size)s.delete(o=Array.from(s).shift());else if(o=h5(r),o>=w7e||!d5(r,o+1))return;const a={cached:Math.floor(Date.now()/Mz),provider:e.provider,data:t};return f5(r,Lh+o.toString(),JSON.stringify(a))}t.lastModified&&!E7e(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function Pz(){}function A7e(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,h7e(e)}))}function $7e(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:i}=e,r=e.iconsToLoad;delete e.iconsToLoad;let s;if(!r||!(s=s5(n)))return;s.prepare(n,i,r).forEach(a=>{_7e(n,a,u=>{if(typeof u!="object")a.icons.forEach(l=>{e.missing.add(l)});else try{const l=i5(e,u);if(!l.length)return;const c=e.pendingIcons;c&&l.forEach(f=>{c.delete(f)}),C7e(e,u)}catch(l){console.error(l)}A7e(e)})})}))}const S7e=(e,t)=>{const n=m7e(e,!0,xz()),i=d7e(n);if(!i.pending.length){let u=!0;return t&&setTimeout(()=>{u&&t(i.loaded,i.missing,i.pending,Pz)}),()=>{u=!1}}const r=Object.create(null),s=[];let o,a;return i.pending.forEach(u=>{const{provider:l,prefix:c}=u;if(c===a&&l===o)return;o=l,a=c,s.push(Xu(l,c));const f=r[l]||(r[l]=Object.create(null));f[c]||(f[c]=[])}),i.pending.forEach(u=>{const{provider:l,prefix:c,name:f}=u,d=Xu(l,c),h=d.pendingIcons||(d.pendingIcons=new Set);h.has(f)||(h.add(f),r[l][c].push(f))}),s.forEach(u=>{const{provider:l,prefix:c}=u;r[l][c].length&&$7e(u,r[l][c])}),t?g7e(t,i,s):Pz};function F7e(e,t){const n={...e};for(const i in t){const r=t[i],s=typeof r;i in wz?(r===null||r&&(s==="string"||s==="number"))&&(n[i]=r):s===typeof n[i]&&(n[i]=i==="rotate"?r%4:r)}return n}const D7e=/[\s,]+/;function T7e(e,t){t.split(D7e).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function M7e(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function i(r){for(;r<0;)r+=4;return r%4}if(n===""){const r=parseInt(e);return isNaN(r)?0:i(r)}else if(n!==e){let r=0;switch(n){case"%":r=25;break;case"deg":r=90}if(r){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/r,s%1===0?i(s):0)}}return t}function N7e(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)n+=" "+i+'="'+t[i]+'"';return'"+e+""}function R7e(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function O7e(e){return"data:image/svg+xml,"+R7e(e)}function L7e(e){return'url("'+O7e(e)+'")'}const zz={...kz,inline:!1},I7e={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},P7e={display:"inline-block"},g5={"background-color":"currentColor"},Bz={"background-color":"transparent"},jz={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},Uz={"-webkit-mask":g5,mask:g5,background:Bz};for(const e in Uz){const t=Uz[e];for(const n in jz)t[e+"-"+n]=jz[n]}function z7e(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}function B7e(e,t){const n=F7e(zz,t),i=t.mode||"svg",r=i==="svg"?{...I7e}:{};e.body.indexOf("xlink:")===-1&&delete r["xmlns:xlink"];let s=typeof t.style=="string"?t.style:"";for(let y in t){const b=t[y];if(b!==void 0)switch(y){case"icon":case"style":case"onLoad":case"mode":break;case"inline":case"hFlip":case"vFlip":n[y]=b===!0||b==="true"||b===1;break;case"flip":typeof b=="string"&&T7e(n,b);break;case"color":s=s+(s.length>0&&s.trim().slice(-1)!==";"?";":"")+"color: "+b+"; ";break;case"rotate":typeof b=="string"?n[y]=M7e(b):typeof b=="number"&&(n[y]=b);break;case"ariaHidden":case"aria-hidden":b!==!0&&b!=="true"&&delete r["aria-hidden"];break;default:if(y.slice(0,3)==="on:")break;zz[y]===void 0&&(r[y]=b)}}const o=e7e(e,n),a=o.attributes;if(n.inline&&(s="vertical-align: -0.125em; "+s),i==="svg"){Object.assign(r,a),s!==""&&(r.style=s);let y=0,b=t.id;return typeof b=="string"&&(b=b.replace(/-/g,"_")),{svg:!0,attributes:r,body:r7e(o.body,b?()=>b+"ID"+y++:"iconifySvelte")}}const{body:u,width:l,height:c}=e,f=i==="mask"||(i==="bg"?!1:u.indexOf("currentColor")!==-1),d=N7e(u,{...a,width:l+"",height:c+""}),p={"--svg":L7e(d)},g=y=>{const b=a[y];b&&(p[y]=z7e(b))};g("width"),g("height"),Object.assign(p,P7e,f?g5:Bz);let m="";for(const y in p)m+=y+": "+p[y]+";";return r.style=m+s,{svg:!1,attributes:r}}if(xz(!0),s7e("",f7e),typeof document<"u"&&typeof window<"u"){Iz();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!V_e(i))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const i="IconifyProviders["+n+"] is invalid.";try{const r=t[n];if(typeof r!="object"||!r||r.resources===void 0)continue;o7e(n,r)||console.error(i)}catch{console.error(i)}}}}function j7e(e,t,n,i,r){function s(){t.loading&&(t.loading.abort(),t.loading=null)}if(typeof e=="object"&&e!==null&&typeof e.body=="string")return t.name="",s(),{data:{...i2,...e}};let o;if(typeof e!="string"||(o=e2(e,!1,!0))===null)return s(),null;const a=H_e(o);if(!a)return n&&(!t.loading||t.loading.name!==e)&&(s(),t.name="",t.loading={name:e,abort:S7e([o],i)}),null;s(),t.name!==e&&(t.name=e,r&&!t.destroyed&&r(e));const u=["iconify"];return o.prefix!==""&&u.push("iconify--"+o.prefix),o.provider!==""&&u.push("iconify--"+o.provider),{data:a,classes:u}}function U7e(e,t){return e?B7e({...i2,...e},t):null}function qz(e){let t;function n(s,o){return s[0].svg?W7e:q7e}let i=n(e),r=i(e);return{c(){r.c(),t=Ne()},m(s,o){r.m(s,o),L(s,t,o)},p(s,o){i===(i=n(s))&&r?r.p(s,o):(r.d(1),r=i(s),r&&(r.c(),r.m(t.parentNode,t)))},d(s){s&&O(t),r.d(s)}}}function q7e(e){let t,n=[e[0].attributes],i={};for(let r=0;r{typeof t.onLoad=="function"&&t.onLoad(l),f2()("load",{icon:l})};function u(){n(3,s++,s)}return yo(()=>{n(2,r=!0)}),c2(()=>{n(1,i.destroyed=!0,i),i.loading&&(i.loading.abort(),n(1,i.loading=null,i))}),e.$$set=l=>{n(6,t=Ue(Ue({},t),l2(l)))},e.$$.update=()=>{{const l=j7e(t.icon,i,r,u,a);n(0,o=l?U7e(l.data,t):null),o&&l.classes&&n(0,o.attributes.class=(typeof t.class=="string"?t.class+" ":"")+l.classes.join(" "),o)}},t=l2(t),[o,i,r,s]}class V7e extends _e{constructor(t){super(),ve(this,t,G7e,H7e,pe,{})}}function Wz(e){let t,n,i,r,s,o,a,u,l;return i=new V7e({props:{icon:"mdi:close"}}),o=new Qm({props:{componentData:e[1]}}),{c(){t=I("div"),n=I("span"),he(i.$$.fragment),r=ge(),s=I("div"),he(o.$$.fragment),$(n,"class","cancelButton svelte-1hhf5ym"),$(s,"class","modalContainer"),$(t,"class","modal svelte-1hhf5ym"),$(t,"data-component","modal")},m(c,f){L(c,t,f),R(t,n),fe(i,n,null),R(t,r),R(t,s),fe(o,s,null),a=!0,u||(l=[ur(s,"click",X7e),ur(t,"click",e[3])],u=!0)},p(c,f){const d={};f&2&&(d.componentData=c[1]),o.$set(d)},i(c){a||(D(i.$$.fragment,c),D(o.$$.fragment,c),a=!0)},o(c){N(i.$$.fragment,c),N(o.$$.fragment,c),a=!1},d(c){c&&O(t),de(i),de(o),u=!1,Ku(l)}}}function Y7e(e){let t,n,i,r,s=e[0]&&e[1]&&Wz(e);return{c(){s&&s.c(),t=Ne()},m(o,a){s&&s.m(o,a),L(o,t,a),n=!0,i||(r=ur(window,"keyup",e[2]),i=!0)},p(o,[a]){o[0]&&o[1]?s?(s.p(o,a),a&3&&D(s,1)):(s=Wz(o),s.c(),D(s,1),s.m(t.parentNode,t)):s&&(Ee(),N(s,1,1,()=>{s=null}),Ce())},i(o){n||(D(s),n=!0)},o(o){N(s),n=!1},d(o){o&&O(t),s&&s.d(o),i=!1,r()}}}const X7e=e=>{e==null||e.stopImmediatePropagation()};function Z7e(e,t,n){let i;zh(e,Hc,a=>n(1,i=a));let{componentData:r}=t;function s(a){a.code==="Escape"&&Hc.set(void 0)}function o(a){a.stopImmediatePropagation(),Hc.set(void 0)}return e.$$set=a=>{"componentData"in a&&n(0,r=a.componentData)},[r,i,s,o]}class K7e extends _e{constructor(t){super(),ve(this,t,Z7e,Y7e,pe,{componentData:0})}}function Hz(e,t,n){const i=e.slice();return i[2]=t[n][0],i[3]=t[n][1],i}function Gz(e,t,n){const i=e.slice();return i[6]=t[n],i}function Vz(e){let t,n=e[2]+"",i;return{c(){t=I("span"),i=ce(n),$(t,"class","pageId svelte-1kdpgko")},m(r,s){L(r,t,s),R(t,i)},p(r,s){s&1&&n!==(n=r[2]+"")&&Me(i,n)},d(r){r&&O(t)}}}function Yz(e){let t,n,i=e[6]+"",r,s,o,a;function u(){return e[1](e[6])}return{c(){t=I("li"),n=I("button"),r=ce(i),s=ge(),$(n,"class","textButton"),$(t,"class","sectionLink svelte-1kdpgko")},m(l,c){L(l,t,c),R(t,n),R(n,r),R(t,s),o||(a=ur(n,"click",u),o=!0)},p(l,c){e=l,c&1&&i!==(i=e[6]+"")&&Me(r,i)},d(l){l&&O(t),o=!1,a()}}}function Xz(e){let t,n,i,r,s=e[2]&&Vz(e),o=Pe(e[3]||[]),a=[];for(let u=0;uQ7e(s);return e.$$set=s=>{"pageHierarchy"in s&&n(0,i=s.pageHierarchy)},[i,r]}class txe extends _e{constructor(t){super(),ve(this,t,exe,J7e,pe,{pageHierarchy:0})}}const{Boolean:nxe}=aB;function Zz(e,t,n){const i=e.slice();return i[5]=t[n],i}function ixe(e){var i;let t,n;return t=new txe({props:{pageHierarchy:F5((i=e[0])==null?void 0:i.components)}}),{c(){he(t.$$.fragment)},m(r,s){fe(t,r,s),n=!0},p(r,s){var a;const o={};s&1&&(o.pageHierarchy=F5((a=r[0])==null?void 0:a.components)),t.$set(o)},i(r){n||(D(t.$$.fragment,r),n=!0)},o(r){N(t.$$.fragment,r),n=!1},d(r){de(t,r)}}}function Kz(e){let t,n;return t=new Qm({props:{componentData:e[5]}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.componentData=i[5]),t.$set(s)},i(i){n||(D(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function rxe(e){var o;let t,n,i=Pe(((o=e[0])==null?void 0:o.components)||[]),r=[];for(let a=0;aN(r[a],1,1,()=>{r[a]=null});return{c(){for(let a=0;a{u=null}),Ce())},i(l){a||(D(n.$$.fragment,l),D(r.$$.fragment,l),D(u),a=!0)},o(l){N(n.$$.fragment,l),N(r.$$.fragment,l),N(u),a=!1},d(l){l&&(O(t),O(s),O(o)),de(n),de(r),u&&u.d(l)}}}function oxe(e,t,n){let i,r;zh(e,Ea,u=>n(0,i=u)),zh(e,Hc,u=>n(1,r=u));let{cardDataId:s}=t;_B(s);let a=!!new URLSearchParams(window==null?void 0:window.location.search).get("embed");return e.$$set=u=>{"cardDataId"in u&&n(3,s=u.cardDataId)},[i,r,a,s]}class axe extends _e{constructor(t){super(),ve(this,t,oxe,sxe,pe,{cardDataId:3})}}let Qz;try{const e=window.mfCardDataId,t=window.mfContainerId,n=(tB=document.querySelector(`[data-container="${t}"]`))==null?void 0:tB.querySelector(".card_app");Qz=new axe({target:n??document.querySelector(".card_app"),props:{cardDataId:e}})}catch(e){throw new Error(e)}return Qz}); +`),C(n,"class","language-python"),C(t,"data-component","pythonCode")},m(a,l){L(a,t,l),R(t,n),R(n,r),R(n,s),e[2](n),R(t,o)},p(a,[l]){l&1&&i!==(i=a[0].data+"")&&Me(r,i)},i:Y,o:Y,d(a){a&&O(t),e[2](null)}}}function Xbe(e,t,n){let{componentData:i}=t,r;function s(){var a;r&&((a=window==null?void 0:window.Prism)==null||a.highlightElement(r))}function o(a){Nn[a?"unshift":"push"](()=>{r=a,n(1,r)})}return e.$$set=a=>{"componentData"in a&&n(0,i=a.componentData)},e.$$.update=()=>{e.$$.dirty&2&&r&&s()},[i,r,o]}class DI extends ve{constructor(t){super(),be(this,t,Xbe,Ybe,pe,{componentData:0})}}function NI(e,t,n){const i=e.slice();return i[17]=t[n],i[19]=n,i}function RI(e,t,n){const i=e.slice();return i[20]=t[n][0],i[21]=t[n][1],i}function OI(e,t,n){const i=e.slice();return i[24]=t[n],i}function LI(e){let t,n;return{c(){t=I("h3"),n=ce(e[5]),C(t,"class","events-title svelte-11m3hns")},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&32&&Me(n,i[5])},d(i){i&&O(t)}}}function II(e){let t,n,i,r,s,o,a,l,u=e[2].displayed_events+"",c,f,d=e[2].total_events+"",h,p,g,m,y=e[8]()!==null,b=e[2].events_per_minute&&PI(e),v=y&&Zbe(e);return{c(){t=I("div"),n=I("div"),i=I("span"),r=ge(),s=I("span"),s.textContent=`${e[10]()}`,o=ge(),a=I("div"),l=I("span"),c=ce(u),f=ce(" of "),h=ce(d),p=ce(" events"),g=ge(),b&&b.c(),m=ge(),v&&v.c(),C(i,"class","live-dot svelte-11m3hns"),C(s,"class","status-text svelte-11m3hns"),C(n,"class","stats-indicator svelte-11m3hns"),C(l,"class","stat-item svelte-11m3hns"),C(a,"class","stats-info svelte-11m3hns"),C(t,"class","stats-header "+e[9]()+" svelte-11m3hns")},m(_,x){L(_,t,x),R(t,n),R(n,i),R(n,r),R(n,s),R(t,o),R(t,a),R(a,l),R(l,c),R(l,f),R(l,h),R(l,p),R(a,g),b&&b.m(a,null),R(a,m),v&&v.m(a,null)},p(_,x){x&4&&u!==(u=_[2].displayed_events+"")&&Me(c,u),x&4&&d!==(d=_[2].total_events+"")&&Me(h,d),_[2].events_per_minute?b?b.p(_,x):(b=PI(_),b.c(),b.m(a,m)):b&&(b.d(1),b=null),y&&v.p(_,x)},d(_){_&&O(t),b&&b.d(),v&&v.d()}}}function PI(e){let t,n=JI("events_per_minute",e[2].events_per_minute)+"",i;return{c(){t=I("span"),i=ce(n),C(t,"class","stat-item svelte-11m3hns")},m(r,s){L(r,t,s),R(t,i)},p(r,s){s&4&&n!==(n=JI("events_per_minute",r[2].events_per_minute)+"")&&Me(i,n)},d(r){r&&O(t)}}}function Zbe(e){let t;return{c(){t=I("span"),t.textContent=`Last: ${e[8]()}`,C(t,"class","stat-item svelte-11m3hns")},m(n,i){L(n,t,i)},p:Y,d(n){n&&O(t)}}}function Kbe(e){let t,n,i=Pe(e[0]),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){t=I("div");for(let o=0;oNo events recorded yet.

",C(t,"class","no-events svelte-11m3hns")},m(n,i){L(n,t,i)},p:Y,i:Y,o:Y,d(n){n&&O(t)}}}function zI(e){let t,n,i=e[7](e[17].received_at)+"",r,s,o=e[17].event_id&&BI(e);return{c(){t=I("div"),n=I("span"),r=ce(i),s=ge(),o&&o.c(),C(n,"class","event-time svelte-11m3hns"),C(t,"class","event-meta svelte-11m3hns")},m(a,l){L(a,t,l),R(t,n),R(n,r),R(t,s),o&&o.m(t,null)},p(a,l){l&1&&i!==(i=a[7](a[17].received_at)+"")&&Me(r,i),a[17].event_id?o?o.p(a,l):(o=BI(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&O(t),o&&o.d()}}}function BI(e){let t,n,i=e[17].event_id+"",r;return{c(){t=I("span"),n=ce("#"),r=ce(i),C(t,"class","event-id svelte-11m3hns")},m(s,o){L(s,t,o),R(t,n),R(t,r)},p(s,o){o&1&&i!==(i=s[17].event_id+"")&&Me(r,i)},d(s){s&&O(t)}}}function jI(e){let t,n,i=e[24]+"",r,s,o,a,l=YI(e[17].metadata[e[24]])+"",u,c,f;return{c(){t=I("div"),n=I("span"),r=ce(i),s=ce(":"),o=ge(),a=I("div"),u=ce(l),f=ge(),C(n,"class","field-key svelte-11m3hns"),C(a,"class",c="field-value "+XI(e[24],e[17].metadata[e[24]])+" svelte-11m3hns"),C(t,"class","event-field svelte-11m3hns")},m(d,h){L(d,t,h),R(t,n),R(n,r),R(n,s),R(t,o),R(t,a),R(a,u),R(t,f)},p(d,h){h&16&&i!==(i=d[24]+"")&&Me(r,i),h&17&&l!==(l=YI(d[17].metadata[d[24]])+"")&&Me(u,l),h&17&&c!==(c="field-value "+XI(d[24],d[17].metadata[d[24]])+" svelte-11m3hns")&&C(a,"class",c)},d(d){d&&O(t)}}}function UI(e){let t,n=e[17].metadata[e[24]]!==void 0&&jI(e);return{c(){n&&n.c(),t=De()},m(i,r){n&&n.m(i,r),L(i,t,r)},p(i,r){i[17].metadata[i[24]]!==void 0?n?n.p(i,r):(n=jI(i),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(i){i&&O(t),n&&n.d(i)}}}function qI(e){let t,n,i=Pe(Object.entries(e[17].payloads)),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){t=I("div");for(let o=0;o0,u,c,f,d=e[3].show_relative_time&&zI(e),h=Pe(e[4]),p=[];for(let m=0;m0),l?g?(g.p(m,y),y&1&&T(g,1)):(g=qI(m),g.c(),T(g,1),g.m(r,null)):g&&(ke(),N(g,1,1,()=>{g=null}),Ee()),(!f||y&1&&c!==(c="event-item "+ZI(m[17])+" "+KI(m[17])+" svelte-11m3hns"))&&C(t,"class",c),(!f||y&1)&&wt(t,"latest",m[19]===0)},i(m){f||(T(g),f=!0)},o(m){N(g),f=!1},d(m){m&&O(t),d&&d.d(),Ft(p,m),g&&g.d()}}}function Qbe(e){let t,n,i,r,s,o,a=e[5]&&LI(e),l=e[3].show_stats&&e[2]&&II(e);const u=[Jbe,Kbe],c=[];function f(d,h){return d[0].length===0?0:1}return r=f(e),s=c[r]=u[r](e),{c(){t=I("div"),a&&a.c(),n=ge(),l&&l.c(),i=ge(),s.c(),C(t,"class","events-container svelte-11m3hns"),C(t,"id",e[6])},m(d,h){L(d,t,h),a&&a.m(t,null),R(t,n),l&&l.m(t,null),R(t,i),c[r].m(t,null),o=!0},p(d,[h]){d[5]?a?a.p(d,h):(a=LI(d),a.c(),a.m(t,n)):a&&(a.d(1),a=null),d[3].show_stats&&d[2]?l?l.p(d,h):(l=II(d),l.c(),l.m(t,i)):l&&(l.d(1),l=null);let p=r;r=f(d),r===p?c[r].p(d,h):(ke(),N(c[p],1,1,()=>{c[p]=null}),Ee(),s=c[r],s?s.p(d,h):(s=c[r]=u[r](d),s.c()),T(s,1),s.m(t,null)),(!o||h&64)&&C(t,"id",d[6])},i(d){o||(T(s),o=!0)},o(d){N(s),o=!1},d(d){d&&O(t),a&&a.d(),l&&l.d(),c[r].d()}}}function YI(e){return e==null?"":typeof e=="number"&&e>1e9&&e<1e10?new Date(e*1e3).toLocaleString():typeof e=="string"&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(e)?new Date(e).toLocaleString():typeof e=="object"&&!e3e(e)?JSON.stringify(e):String(e)}function e3e(e){return e&&typeof e=="object"&&"type"in e}function t3e(){window.dispatchEvent(new Event("resize")),setTimeout(()=>window.dispatchEvent(new Event("resize")),100)}function XI(e,t){if(e.toLowerCase().includes("timestamp")||e.toLowerCase().includes("time"))return"timestamp";if(e.toLowerCase().includes("status")){if(typeof t=="string"){const n=t.toLowerCase();if(n.includes("success")||n.includes("completed")||n.includes("ok"))return"status-success";if(n.includes("error")||n.includes("failed")||n.includes("fail"))return"status-error";if(n.includes("warning")||n.includes("pending"))return"status-warning"}return"status"}return typeof t=="number"?"number":"default"}function ZI(e){return e.style_theme?`theme-${e.style_theme}`:"theme-default"}function KI(e){return e.priority?`priority-${e.priority}`:"priority-normal"}function JI(e,t){return typeof t=="number"?`${t}/min`:String(t)}function n3e(e,t,n){let i,r,s,o,a,l,{componentData:u}=t,c=Date.now(),f;no(()=>{o.show_relative_time&&(f=setInterval(()=>{c=Date.now()},1e3))}),Nm(()=>{f&&clearInterval(f)});function d(_){const x=(c-_*1e3)/1e3;return x<60?`${Math.floor(x)}s ago`:x<3600?`${Math.floor(x/60)}m ago`:x<86400?`${Math.floor(x/3600)}h ago`:`${Math.floor(x/86400)}d ago`}function h(){return s&&s.length>0&&typeof s[0].received_at=="number"?s[0].received_at:a&&typeof a.last_update=="number"?a.last_update:null}function p(){const _=h();return _==null?null:Math.max(0,(c-_*1e3)/1e3)}function g(){const _=h();return _==null?null:d(_)}let m=null;function y(){if(a!=null&&a.finished)return"finished";const _=p();return _==null||_<60?"live":_<300?"recent":_<600?"stale":"finished"}function b(){const _=p();return a!=null&&a.finished?"Finished":_==null||_<60?"Live":_<300?"Recent":_<600?"Stale":"Inactive"}function v(_){Nn[_?"unshift":"push"](()=>{m=_,n(1,m)})}return e.$$set=_=>{"componentData"in _&&n(11,u=_.componentData)},e.$$.update=()=>{e.$$.dirty&2048&&n(6,{id:i,title:r,events:s,config:o,stats:a}=u,i,(n(5,r),n(11,u)),(n(0,s),n(11,u)),(n(3,o),n(11,u)),(n(2,a),n(11,u))),e.$$.dirty&1&&n(4,l=s.length>0?Array.from(new Set(s.flatMap(_=>Object.keys(_.metadata)))):[])},[s,m,a,o,l,r,i,d,g,y,b,u,v]}class QI extends ve{constructor(t){super(),be(this,t,n3e,Qbe,pe,{componentData:11})}}function i3e(e){let t,n;return{c(){t=I("span"),n=ce(e[5]),C(t,"class","json-label svelte-1b8g4ty")},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&32&&Me(n,i[5])},d(i){i&&O(t)}}}function r3e(e){let t,n,i,r,s,o,a;return{c(){t=I("button"),n=I("span"),n.textContent="▼",i=ge(),r=ce(e[5]),C(n,"class","collapse-icon svelte-1b8g4ty"),wt(n,"collapsed",e[2]),C(t,"class","collapse-button svelte-1b8g4ty"),C(t,"aria-label",s=e[2]?"Expand JSON":"Collapse JSON")},m(l,u){L(l,t,u),R(t,n),R(t,i),R(t,r),o||(a=Ki(t,"click",e[12]),o=!0)},p(l,u){u&4&&wt(n,"collapsed",l[2]),u&32&&Me(r,l[5]),u&4&&s!==(s=l[2]?"Expand JSON":"Collapse JSON")&&C(t,"aria-label",s)},d(l){l&&O(t),o=!1,a()}}}function eP(e){let t,n,i,r;function s(l,u){return l[3]?o3e:s3e}let o=s(e),a=o(e);return{c(){t=I("button"),a.c(),C(t,"class","copy-button svelte-1b8g4ty"),C(t,"title",n=e[3]?"Copied!":"Copy to clipboard"),wt(t,"success",e[3])},m(l,u){L(l,t,u),a.m(t,null),i||(r=Ki(t,"click",e[9]),i=!0)},p(l,u){o!==(o=s(l))&&(a.d(1),a=o(l),a&&(a.c(),a.m(t,null))),u&8&&n!==(n=l[3]?"Copied!":"Copy to clipboard")&&C(t,"title",n),u&8&&wt(t,"success",l[3])},d(l){l&&O(t),a.d(),i=!1,r()}}}function s3e(e){let t;return{c(){t=ce("📋 Copy")},m(n,i){L(n,t,i)},d(n){n&&O(t)}}}function o3e(e){let t;return{c(){t=ce("✓ Copied")},m(n,i){L(n,t,i)},d(n){n&&O(t)}}}function tP(e){let t,n,i,r;return{c(){t=I("div"),n=I("pre"),i=I("code"),r=ce(e[1]),C(i,"class","language-json svelte-1b8g4ty"),C(n,"class","json-code svelte-1b8g4ty"),C(t,"class","json-content svelte-1b8g4ty"),C(t,"style",e[4])},m(s,o){L(s,t,o),R(t,n),R(n,i),R(i,r),e[13](i)},p(s,o){o&2&&Me(r,s[1]),o&16&&C(t,"style",s[4])},d(s){s&&O(t),e[13](null)}}}function a3e(e){let t,n,i,r;function s(c,f){return c[7]?r3e:i3e}let o=s(e),a=o(e),l=e[6]&&eP(e),u=!e[2]&&tP(e);return{c(){t=I("div"),n=I("div"),a.c(),i=ge(),l&&l.c(),r=ge(),u&&u.c(),C(n,"class","json-header svelte-1b8g4ty"),C(t,"class","json-viewer svelte-1b8g4ty"),C(t,"id",e[8])},m(c,f){L(c,t,f),R(t,n),a.m(n,null),R(n,i),l&&l.m(n,null),R(t,r),u&&u.m(t,null)},p(c,[f]){o===(o=s(c))&&a?a.p(c,f):(a.d(1),a=o(c),a&&(a.c(),a.m(n,i))),c[6]?l?l.p(c,f):(l=eP(c),l.c(),l.m(n,null)):l&&(l.d(1),l=null),c[2]?u&&(u.d(1),u=null):u?u.p(c,f):(u=tP(c),u.c(),u.m(t,null)),f&256&&C(t,"id",c[8])},i:Y,o:Y,d(c){c&&O(t),a.d(),l&&l.d(),u&&u.d()}}}function l3e(e,t,n){let i,r,s,o,a,l,u,{componentData:c}=t,f=!1,d=!1,h,p;async function g(){try{await navigator.clipboard.writeText(r),n(3,d=!0),clearTimeout(h),h=setTimeout(()=>{n(3,d=!1)},2e3)}catch(v){console.error("Failed to copy: ",v)}}function m(){p&&(window!=null&&window.Prism)&&window.Prism.highlightElement(p)}no(()=>{m()});const y=()=>n(2,f=!f);function b(v){Nn[v?"unshift":"push"](()=>{p=v,n(0,p)})}return e.$$set=v=>{"componentData"in v&&n(10,c=v.componentData)},e.$$.update=()=>{e.$$.dirty&1024&&n(8,{id:i,json_string:r,collapsible:s,show_copy_button:o,max_height:a,title:l}=c,i,(n(1,r),n(10,c)),(n(7,s),n(10,c)),(n(6,o),n(10,c)),(n(11,a),n(10,c)),(n(5,l),n(10,c))),e.$$.dirty&3&&p&&r&&m(),e.$$.dirty&2048&&n(4,u=a?`max-height: ${a}`:"")},[p,r,f,d,u,l,o,s,i,g,c,a,y,b]}class nP extends ve{constructor(t){super(),be(this,t,l3e,a3e,pe,{componentData:10})}}function u3e(e){let t,n;return{c(){t=I("span"),n=ce(e[5]),C(t,"class","yaml-label svelte-yn00t6")},m(i,r){L(i,t,r),R(t,n)},p(i,r){r&32&&Me(n,i[5])},d(i){i&&O(t)}}}function c3e(e){let t,n,i,r,s,o,a;return{c(){t=I("button"),n=I("span"),n.textContent="▼",i=ge(),r=ce(e[5]),C(n,"class","collapse-icon svelte-yn00t6"),wt(n,"collapsed",e[2]),C(t,"class","collapse-button svelte-yn00t6"),C(t,"aria-label",s=e[2]?"Expand YAML":"Collapse YAML")},m(l,u){L(l,t,u),R(t,n),R(t,i),R(t,r),o||(a=Ki(t,"click",e[12]),o=!0)},p(l,u){u&4&&wt(n,"collapsed",l[2]),u&32&&Me(r,l[5]),u&4&&s!==(s=l[2]?"Expand YAML":"Collapse YAML")&&C(t,"aria-label",s)},d(l){l&&O(t),o=!1,a()}}}function iP(e){let t,n,i,r;function s(l,u){return l[3]?d3e:f3e}let o=s(e),a=o(e);return{c(){t=I("button"),a.c(),C(t,"class","copy-button svelte-yn00t6"),C(t,"title",n=e[3]?"Copied!":"Copy to clipboard"),wt(t,"success",e[3])},m(l,u){L(l,t,u),a.m(t,null),i||(r=Ki(t,"click",e[9]),i=!0)},p(l,u){o!==(o=s(l))&&(a.d(1),a=o(l),a&&(a.c(),a.m(t,null))),u&8&&n!==(n=l[3]?"Copied!":"Copy to clipboard")&&C(t,"title",n),u&8&&wt(t,"success",l[3])},d(l){l&&O(t),a.d(),i=!1,r()}}}function f3e(e){let t;return{c(){t=ce("📋 Copy")},m(n,i){L(n,t,i)},d(n){n&&O(t)}}}function d3e(e){let t;return{c(){t=ce("✓ Copied")},m(n,i){L(n,t,i)},d(n){n&&O(t)}}}function rP(e){let t,n,i,r;return{c(){t=I("div"),n=I("pre"),i=I("code"),r=ce(e[1]),C(i,"class","language-yaml svelte-yn00t6"),C(n,"class","yaml-code svelte-yn00t6"),C(t,"class","yaml-content svelte-yn00t6"),C(t,"style",e[4])},m(s,o){L(s,t,o),R(t,n),R(n,i),R(i,r),e[13](i)},p(s,o){o&2&&Me(r,s[1]),o&16&&C(t,"style",s[4])},d(s){s&&O(t),e[13](null)}}}function h3e(e){let t,n,i,r;function s(c,f){return c[7]?c3e:u3e}let o=s(e),a=o(e),l=e[6]&&iP(e),u=!e[2]&&rP(e);return{c(){t=I("div"),n=I("div"),a.c(),i=ge(),l&&l.c(),r=ge(),u&&u.c(),C(n,"class","yaml-header svelte-yn00t6"),C(t,"class","yaml-viewer svelte-yn00t6"),C(t,"id",e[8])},m(c,f){L(c,t,f),R(t,n),a.m(n,null),R(n,i),l&&l.m(n,null),R(t,r),u&&u.m(t,null)},p(c,[f]){o===(o=s(c))&&a?a.p(c,f):(a.d(1),a=o(c),a&&(a.c(),a.m(n,i))),c[6]?l?l.p(c,f):(l=iP(c),l.c(),l.m(n,null)):l&&(l.d(1),l=null),c[2]?u&&(u.d(1),u=null):u?u.p(c,f):(u=rP(c),u.c(),u.m(t,null)),f&256&&C(t,"id",c[8])},i:Y,o:Y,d(c){c&&O(t),a.d(),l&&l.d(),u&&u.d()}}}function p3e(e,t,n){let i,r,s,o,a,l,u,{componentData:c}=t,f=!1,d=!1,h,p;async function g(){try{await navigator.clipboard.writeText(r),n(3,d=!0),clearTimeout(h),h=setTimeout(()=>{n(3,d=!1)},2e3)}catch(v){console.error("Failed to copy: ",v)}}function m(){p&&(window!=null&&window.Prism)&&window.Prism.highlightElement(p)}no(()=>{m()});const y=()=>n(2,f=!f);function b(v){Nn[v?"unshift":"push"](()=>{p=v,n(0,p)})}return e.$$set=v=>{"componentData"in v&&n(10,c=v.componentData)},e.$$.update=()=>{e.$$.dirty&1024&&n(8,{id:i,yaml_string:r,collapsible:s,show_copy_button:o,max_height:a,title:l}=c,i,(n(1,r),n(10,c)),(n(7,s),n(10,c)),(n(6,o),n(10,c)),(n(11,a),n(10,c)),(n(5,l),n(10,c))),e.$$.dirty&3&&p&&r&&m(),e.$$.dirty&2048&&n(4,u=a?`max-height: ${a}`:"")},[p,r,f,d,u,l,o,s,i,g,c,a,y,b]}class sP extends ve{constructor(t){super(),be(this,t,p3e,h3e,pe,{componentData:10})}}function g3e(e){let t;return{c(){t=ce(e[0])},m(n,i){L(n,t,i)},p(n,i){i&1&&Me(t,n[0])},i:Y,o:Y,d(n){n&&O(t)}}}function m3e(e){let t,n,i;var r=e[1];function s(o,a){return{props:{componentData:o[0]}}}return r&&(t=Ze(r,s(e))),{c(){t&&he(t.$$.fragment),n=De()},m(o,a){t&&fe(t,o,a),L(o,n,a),i=!0},p(o,a){if(a&2&&r!==(r=o[1])){if(t){ke();const l=t;N(l.$$.fragment,1,0,()=>{de(l,1)}),Ee()}r?(t=Ze(r,s(o)),he(t.$$.fragment),T(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(r){const l={};a&1&&(l.componentData=o[0]),t.$set(l)}},i(o){i||(t&&T(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&O(n),t&&de(t,o)}}}function y3e(e){let t,n,i,r;const s=[m3e,g3e],o=[];function a(l,u){return l[1]?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=De()},m(l,u){o[t].m(l,u),L(l,i,u),r=!0},p(l,[u]){let c=t;t=a(l),t===c?o[t].p(l,u):(ke(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),T(n,1),n.m(i.parentNode,i))},i(l){r||(T(n),r=!0)},o(l){N(n),r=!1},d(l){l&&O(i),o[t].d(l)}}}function b3e(e,t,n){let{componentData:i}=t,r;const s={artifacts:Q5,dag:f6,heading:m6,image:v6,log:_6,markdown:q6,progressBar:V6,text:CI,valueBox:MI,vegaChart:SI,pythonCode:DI,eventsTimeline:QI,jsonViewer:nP,yamlViewer:sP},o=i==null?void 0:i.type;return o&&(r=s==null?void 0:s[o],r||console.error("Unknown component type: ",o)),e.$$set=a=>{"componentData"in a&&n(0,i=a.componentData)},[i,r]}class oP extends ve{constructor(t){super(),be(this,t,b3e,y3e,pe,{componentData:0})}}function aP(e,t,n){const i=e.slice();return i[3]=t[n],i[5]=n,i}function lP(e,t,n){const i=e.slice();return i[6]=t[n],i}function uP(e){let t,n,i,r,s=Pe(e[1]),o=[];for(let l=0;lN(o[l],1,1,()=>{o[l]=null});return{c(){t=I("div"),n=I("table"),i=I("tbody");for(let l=0;lN(u[f],1,1,()=>{u[f]=null});return{c(){t=I("tr"),n=I("td"),r=ce(i),s=ge();for(let f=0;f{i=null}),Ee())},i(r){n||(T(i),n=!0)},o(r){N(i),n=!1},d(r){r&&O(t),i&&i.d(r)}}}function _3e(e,t,n){let i,r,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(2,s=o.componentData)},e.$$.update=()=>{e.$$.dirty&4&&n(1,{columns:i,data:r}=s,i,(n(0,r),n(2,s)))},[r,i,s]}class x3e extends ve{constructor(t){super(),be(this,t,_3e,v3e,pe,{componentData:2})}}function dP(e,t,n){const i=e.slice();return i[3]=t[n],i}function hP(e,t,n){const i=e.slice();return i[6]=t[n],i}function pP(e,t,n){const i=e.slice();return i[9]=t[n],i}function gP(e){let t,n,i,r,s,o,a,l=Pe(e[1]),u=[];for(let h=0;hN(f[h],1,1,()=>{f[h]=null});return{c(){t=I("div"),n=I("table"),i=I("thead"),r=I("tr");for(let h=0;hN(s[a],1,1,()=>{s[a]=null});return{c(){t=I("tr");for(let a=0;a{i=null}),Ee())},i(r){n||(T(i),n=!0)},o(r){N(i),n=!1},d(r){r&&O(t),i&&i.d(r)}}}function k3e(e,t,n){let i,r,{componentData:s}=t;return e.$$set=o=>{"componentData"in o&&n(2,s=o.componentData)},e.$$.update=()=>{e.$$.dirty&4&&n(1,{columns:i,data:r}=s,i,(n(0,r),n(2,s)))},[r,i,s]}class E3e extends ve{constructor(t){super(),be(this,t,k3e,w3e,pe,{componentData:2})}}function vP(e){let t,n,i;var r=e[3];function s(o,a){return{props:{componentData:o[0]}}}return r&&(t=Ze(r,s(e))),{c(){t&&he(t.$$.fragment),n=De()},m(o,a){t&&fe(t,o,a),L(o,n,a),i=!0},p(o,a){if(r!==(r=o[3])){if(t){ke();const l=t;N(l.$$.fragment,1,0,()=>{de(l,1)}),Ee()}r?(t=Ze(r,s(o)),he(t.$$.fragment),T(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(r){const l={};a&1&&(l.componentData=o[0]),t.$set(l)}},i(o){i||(t&&T(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&O(n),t&&de(t,o)}}}function $3e(e){let t,n,i=e[2]&&e[1]&&vP(e);return{c(){i&&i.c(),t=De()},m(r,s){i&&i.m(r,s),L(r,t,s),n=!0},p(r,[s]){r[2]&&r[1]?i?(i.p(r,s),s&6&&T(i,1)):(i=vP(r),i.c(),T(i,1),i.m(t.parentNode,t)):i&&(ke(),N(i,1,1,()=>{i=null}),Ee())},i(r){n||(T(i),n=!0)},o(r){N(i),n=!1},d(r){r&&O(t),i&&i.d(r)}}}function S3e(e,t,n){let i,r,s,{componentData:o}=t;const a=s?x3e:E3e;return e.$$set=l=>{"componentData"in l&&n(0,o=l.componentData)},e.$$.update=()=>{e.$$.dirty&1&&n(2,{columns:i,data:r,vertical:s}=o,i,(n(1,r),n(0,o)))},[o,r,i,a]}class C3e extends ve{constructor(t){super(),be(this,t,S3e,$3e,pe,{componentData:0})}}function _P(e,t,n){const i=e.slice();return i[3]=t[n],i}function A3e(e){let t,n,i,r;const s=[T3e,F3e],o=[];function a(l,u){var c;return(l[0].type==="page"||l[0].type==="section")&&((c=l[0])!=null&&c.contents)?0:1}return t=a(e),n=o[t]=s[t](e),{c(){n.c(),i=De()},m(l,u){o[t].m(l,u),L(l,i,u),r=!0},p(l,u){let c=t;t=a(l),t===c?o[t].p(l,u):(ke(),N(o[c],1,1,()=>{o[c]=null}),Ee(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),T(n,1),n.m(i.parentNode,i))},i(l){r||(T(n),r=!0)},o(l){N(n),r=!1},d(l){l&&O(i),o[t].d(l)}}}function F3e(e){let t,n,i;var r=e[1];function s(o,a){return{props:{componentData:o[0]}}}return r&&(t=Ze(r,s(e))),{c(){t&&he(t.$$.fragment),n=De()},m(o,a){t&&fe(t,o,a),L(o,n,a),i=!0},p(o,a){if(r!==(r=o[1])){if(t){ke();const l=t;N(l.$$.fragment,1,0,()=>{de(l,1)}),Ee()}r?(t=Ze(r,s(o)),he(t.$$.fragment),T(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(r){const l={};a&1&&(l.componentData=o[0]),t.$set(l)}},i(o){i||(t&&T(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&O(n),t&&de(t,o)}}}function T3e(e){let t,n,i;var r=e[1];function s(o,a){return{props:{componentData:o[0],$$slots:{default:[M3e]},$$scope:{ctx:o}}}}return r&&(t=Ze(r,s(e))),{c(){t&&he(t.$$.fragment),n=De()},m(o,a){t&&fe(t,o,a),L(o,n,a),i=!0},p(o,a){if(r!==(r=o[1])){if(t){ke();const l=t;N(l.$$.fragment,1,0,()=>{de(l,1)}),Ee()}r?(t=Ze(r,s(o)),he(t.$$.fragment),T(t.$$.fragment,1),fe(t,n.parentNode,n)):t=null}else if(r){const l={};a&1&&(l.componentData=o[0]),a&65&&(l.$$scope={dirty:a,ctx:o}),t.$set(l)}},i(o){i||(t&&T(t.$$.fragment,o),i=!0)},o(o){t&&N(t.$$.fragment,o),i=!1},d(o){o&&O(n),t&&de(t,o)}}}function xP(e){let t,n;return t=new km({props:{componentData:e[3]}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.componentData=i[3]),t.$set(s)},i(i){n||(T(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function M3e(e){let t,n,i=Pe(e[0].contents),r=[];for(let o=0;oN(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{"componentData"in o&&n(0,i=o.componentData)},[i,s]}class km extends ve{constructor(t){super(),be(this,t,N3e,D3e,pe,{componentData:0})}}function R3e(e){let t,n,i;const r=e[1].default,s=ht(r,e,e[0],null);return{c(){t=I("main"),n=I("div"),s&&s.c(),C(n,"class","mainContainer svelte-mqeomk"),C(t,"class","svelte-mqeomk")},m(o,a){L(o,t,a),R(t,n),s&&s.m(n,null),i=!0},p(o,[a]){s&&s.p&&(!i||a&1)&>(s,r,o,o[0],i?pt(r,o[0],a,null):mt(o[0]),null)},i(o){i||(T(s,o),i=!0)},o(o){N(s,o),i=!1},d(o){o&&O(t),s&&s.d(o)}}}function O3e(e,t,n){let{$$slots:i={},$$scope:r}=t;return e.$$set=s=>{"$$scope"in s&&n(0,r=s.$$scope)},[r,i]}class L3e extends ve{constructor(t){super(),be(this,t,O3e,R3e,pe,{})}}const uh=/^[a-z0-9]+(-[a-z0-9]+)*$/,Em=(e,t,n,i="")=>{const r=e.split(":");if(e.slice(0,1)==="@"){if(r.length<2||r.length>3)return null;i=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const a=r.pop(),l=r.pop(),u={provider:r.length>0?r[0]:i,prefix:l,name:a};return t&&!$m(u)?null:u}const s=r[0],o=s.split("-");if(o.length>1){const a={provider:i,prefix:o.shift(),name:o.join("-")};return t&&!$m(a)?null:a}if(n&&i===""){const a={provider:i,prefix:"",name:s};return t&&!$m(a,n)?null:a}return null},$m=(e,t)=>e?!!((e.provider===""||e.provider.match(uh))&&(t&&e.prefix===""||e.prefix.match(uh))&&e.name.match(uh)):!1,wP=Object.freeze({left:0,top:0,width:16,height:16}),Sm=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Cm=Object.freeze({...wP,...Sm}),v5=Object.freeze({...Cm,body:"",hidden:!1});function I3e(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const i=((e.rotate||0)+(t.rotate||0))%4;return i&&(n.rotate=i),n}function kP(e,t){const n=I3e(e,t);for(const i in v5)i in Sm?i in e&&!(i in n)&&(n[i]=Sm[i]):i in t?n[i]=t[i]:i in e&&(n[i]=e[i]);return n}function P3e(e,t){const n=e.icons,i=e.aliases||Object.create(null),r=Object.create(null);function s(o){if(n[o])return r[o]=[];if(!(o in r)){r[o]=null;const a=i[o]&&i[o].parent,l=a&&s(a);l&&(r[o]=[a].concat(l))}return r[o]}return Object.keys(n).concat(Object.keys(i)).forEach(s),r}function z3e(e,t,n){const i=e.icons,r=e.aliases||Object.create(null);let s={};function o(a){s=kP(i[a]||r[a],s)}return o(t),n.forEach(o),kP(e,s)}function EP(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(r=>{t(r,null),n.push(r)});const i=P3e(e);for(const r in i){const s=i[r];s&&(t(r,z3e(e,r,s)),n.push(r))}return n}const B3e={provider:"",aliases:{},not_found:{},...wP};function _5(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function $P(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!_5(e,B3e))return null;const n=t.icons;for(const r in n){const s=n[r];if(!r.match(uh)||typeof s.body!="string"||!_5(s,v5))return null}const i=t.aliases||Object.create(null);for(const r in i){const s=i[r],o=s.parent;if(!r.match(uh)||typeof o!="string"||!n[o]&&!i[o]||!_5(s,v5))return null}return t}const SP=Object.create(null);function j3e(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Ml(e,t){const n=SP[e]||(SP[e]=Object.create(null));return n[t]||(n[t]=j3e(e,t))}function x5(e,t){return $P(t)?EP(t,(n,i)=>{i?e.icons[n]=i:e.missing.add(n)}):[]}function U3e(e,t,n){try{if(typeof n.body=="string")return e.icons[t]={...n},!0}catch{}return!1}let ch=!1;function CP(e){return typeof e=="boolean"&&(ch=e),ch}function q3e(e){const t=typeof e=="string"?Em(e,!0,ch):e;if(t){const n=Ml(t.provider,t.prefix),i=t.name;return n.icons[i]||(n.missing.has(i)?null:void 0)}}function W3e(e,t){const n=Em(e,!0,ch);if(!n)return!1;const i=Ml(n.provider,n.prefix);return U3e(i,n.name,t)}function H3e(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),ch&&!t&&!e.prefix){let r=!1;return $P(e)&&(e.prefix="",EP(e,(s,o)=>{o&&W3e(s,o)&&(r=!0)})),r}const n=e.prefix;if(!$m({provider:t,prefix:n,name:"a"}))return!1;const i=Ml(t,n);return!!x5(i,e)}const AP=Object.freeze({width:null,height:null}),FP=Object.freeze({...AP,...Sm}),G3e=/(-?[0-9.]*[0-9]+[0-9.]*)/g,V3e=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function TP(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const i=e.split(G3e);if(i===null||!i.length)return e;const r=[];let s=i.shift(),o=V3e.test(s);for(;;){if(o){const a=parseFloat(s);isNaN(a)?r.push(s):r.push(Math.ceil(a*t*n)/n)}else r.push(s);if(s=i.shift(),s===void 0)return r.join("");o=!o}}function Y3e(e,t="defs"){let n="";const i=e.indexOf("<"+t);for(;i>=0;){const r=e.indexOf(">",i),s=e.indexOf("",s);if(o===-1)break;n+=e.slice(r+1,s).trim(),e=e.slice(0,i).trim()+e.slice(o+1)}return{defs:n,content:e}}function X3e(e,t){return e?""+e+""+t:t}function Z3e(e,t,n){const i=Y3e(e);return X3e(i.defs,t+i.content+n)}const K3e=e=>e==="unset"||e==="undefined"||e==="none";function J3e(e,t){const n={...Cm,...e},i={...FP,...t},r={left:n.left,top:n.top,width:n.width,height:n.height};let s=n.body;[n,i].forEach(g=>{const m=[],y=g.hFlip,b=g.vFlip;let v=g.rotate;y?b?v+=2:(m.push("translate("+(r.width+r.left).toString()+" "+(0-r.top).toString()+")"),m.push("scale(-1 1)"),r.top=r.left=0):b&&(m.push("translate("+(0-r.left).toString()+" "+(r.height+r.top).toString()+")"),m.push("scale(1 -1)"),r.top=r.left=0);let _;switch(v<0&&(v-=Math.floor(v/4)*4),v=v%4,v){case 1:_=r.height/2+r.top,m.unshift("rotate(90 "+_.toString()+" "+_.toString()+")");break;case 2:m.unshift("rotate(180 "+(r.width/2+r.left).toString()+" "+(r.height/2+r.top).toString()+")");break;case 3:_=r.width/2+r.left,m.unshift("rotate(-90 "+_.toString()+" "+_.toString()+")");break}v%2===1&&(r.left!==r.top&&(_=r.left,r.left=r.top,r.top=_),r.width!==r.height&&(_=r.width,r.width=r.height,r.height=_)),m.length&&(s=Z3e(s,'',""))});const o=i.width,a=i.height,l=r.width,u=r.height;let c,f;o===null?(f=a===null?"1em":a==="auto"?u:a,c=TP(f,l/u)):(c=o==="auto"?l:o,f=a===null?TP(c,u/l):a==="auto"?u:a);const d={},h=(g,m)=>{K3e(m)||(d[g]=m.toString())};h("width",c),h("height",f);const p=[r.left,r.top,l,u];return d.viewBox=p.join(" "),{attributes:d,viewBox:p,body:s}}const Q3e=/\sid="(\S+)"/g,eve="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16);let tve=0;function nve(e,t=eve){const n=[];let i;for(;i=Q3e.exec(e);)n.push(i[1]);if(!n.length)return e;const r="suffix"+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(s=>{const o=typeof t=="function"?t(s):t+(tve++).toString(),a=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+o+r+"$3")}),e=e.replace(new RegExp(r,"g"),""),e}const w5=Object.create(null);function ive(e,t){w5[e]=t}function k5(e){return w5[e]||w5[""]}function E5(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const $5=Object.create(null),fh=["https://api.simplesvg.com","https://api.unisvg.com"],Am=[];for(;fh.length>0;)fh.length===1||Math.random()>.5?Am.push(fh.shift()):Am.push(fh.pop());$5[""]=E5({resources:["https://api.iconify.design"].concat(Am)});function rve(e,t){const n=E5(t);return n===null?!1:($5[e]=n,!0)}function S5(e){return $5[e]}let MP=(()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}})();function sve(e,t){const n=S5(e);if(!n)return 0;let i;if(!n.maxURL)i=0;else{let r=0;n.resources.forEach(o=>{r=Math.max(r,o.length)});const s=t+".json?icons=";i=n.maxURL-r-n.path.length-s.length}return i}function ove(e){return e===404}const ave=(e,t,n)=>{const i=[],r=sve(e,t),s="icons";let o={type:s,provider:e,prefix:t,icons:[]},a=0;return n.forEach((l,u)=>{a+=l.length+1,a>=r&&u>0&&(i.push(o),o={type:s,provider:e,prefix:t,icons:[]},a=l.length),o.icons.push(l)}),i.push(o),i};function lve(e){if(typeof e=="string"){const t=S5(e);if(t)return t.path}return"/"}const uve={prepare:ave,send:(e,t,n)=>{if(!MP){n("abort",424);return}let i=lve(t.provider);switch(t.type){case"icons":{const s=t.prefix,a=t.icons.join(","),l=new URLSearchParams({icons:a});i+=s+".json?"+l.toString();break}case"custom":{const s=t.uri;i+=s.slice(0,1)==="/"?s.slice(1):s;break}default:n("abort",400);return}let r=503;MP(e+i).then(s=>{const o=s.status;if(o!==200){setTimeout(()=>{n(ove(o)?"abort":"next",o)});return}return r=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?n("abort",s):n("next",r)});return}setTimeout(()=>{n("success",s)})}).catch(()=>{n("next",r)})}};function cve(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((r,s)=>r.provider!==s.provider?r.provider.localeCompare(s.provider):r.prefix!==s.prefix?r.prefix.localeCompare(s.prefix):r.name.localeCompare(s.name));let i={provider:"",prefix:"",name:""};return e.forEach(r=>{if(i.name===r.name&&i.prefix===r.prefix&&i.provider===r.provider)return;i=r;const s=r.provider,o=r.prefix,a=r.name,l=n[s]||(n[s]=Object.create(null)),u=l[o]||(l[o]=Ml(s,o));let c;a in u.icons?c=t.loaded:o===""||u.missing.has(a)?c=t.missing:c=t.pending;const f={provider:s,prefix:o,name:a};c.push(f)}),t}function DP(e,t){e.forEach(n=>{const i=n.loaderCallbacks;i&&(n.loaderCallbacks=i.filter(r=>r.id!==t))})}function fve(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const i=e.provider,r=e.prefix;t.forEach(s=>{const o=s.icons,a=o.pending.length;o.pending=o.pending.filter(l=>{if(l.prefix!==r)return!0;const u=l.name;if(e.icons[u])o.loaded.push({provider:i,prefix:r,name:u});else if(e.missing.has(u))o.missing.push({provider:i,prefix:r,name:u});else return n=!0,!0;return!1}),o.pending.length!==a&&(n||DP([e],s.id),s.callback(o.loaded.slice(0),o.missing.slice(0),o.pending.slice(0),s.abort))})}))}let dve=0;function hve(e,t,n){const i=dve++,r=DP.bind(null,n,i);if(!t.pending.length)return r;const s={id:i,icons:t,callback:e,abort:r};return n.forEach(o=>{(o.loaderCallbacks||(o.loaderCallbacks=[])).push(s)}),r}function pve(e,t=!0,n=!1){const i=[];return e.forEach(r=>{const s=typeof r=="string"?Em(r,t,n):r;s&&i.push(s)}),i}var gve={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function mve(e,t,n,i){const r=e.resources.length,s=e.random?Math.floor(Math.random()*r):e.index;let o;if(e.random){let k=e.resources.slice(0);for(o=[];k.length>1;){const w=Math.floor(Math.random()*k.length);o.push(k[w]),k=k.slice(0,w).concat(k.slice(w+1))}o=o.concat(k)}else o=e.resources.slice(s).concat(e.resources.slice(0,s));const a=Date.now();let l="pending",u=0,c,f=null,d=[],h=[];typeof i=="function"&&h.push(i);function p(){f&&(clearTimeout(f),f=null)}function g(){l==="pending"&&(l="aborted"),p(),d.forEach(k=>{k.status==="pending"&&(k.status="aborted")}),d=[]}function m(k,w){w&&(h=[]),typeof k=="function"&&h.push(k)}function y(){return{startTime:a,payload:t,status:l,queriesSent:u,queriesPending:d.length,subscribe:m,abort:g}}function b(){l="failed",h.forEach(k=>{k(void 0,c)})}function v(){d.forEach(k=>{k.status==="pending"&&(k.status="aborted")}),d=[]}function _(k,w,E){const $=w!=="success";switch(d=d.filter(F=>F!==k),l){case"pending":break;case"failed":if($||!e.dataAfterTimeout)return;break;default:return}if(w==="abort"){c=E,b();return}if($){c=E,d.length||(o.length?x():b());return}if(p(),v(),!e.random){const F=e.resources.indexOf(k.resource);F!==-1&&F!==e.index&&(e.index=F)}l="completed",h.forEach(F=>{F(E)})}function x(){if(l!=="pending")return;p();const k=o.shift();if(k===void 0){if(d.length){f=setTimeout(()=>{p(),l==="pending"&&(v(),b())},e.timeout);return}b();return}const w={status:"pending",resource:k,callback:(E,$)=>{_(w,E,$)}};d.push(w),u++,f=setTimeout(x,e.rotate),n(k,t,w.callback)}return setTimeout(x),y}function NP(e){const t={...gve,...e};let n=[];function i(){n=n.filter(a=>a().status==="pending")}function r(a,l,u){const c=mve(t,a,l,(f,d)=>{i(),u&&u(f,d)});return n.push(c),c}function s(a){return n.find(l=>a(l))||null}return{query:r,find:s,setIndex:a=>{t.index=a},getIndex:()=>t.index,cleanup:i}}function RP(){}const C5=Object.create(null);function yve(e){if(!C5[e]){const t=S5(e);if(!t)return;const n=NP(t),i={config:t,redundancy:n};C5[e]=i}return C5[e]}function bve(e,t,n){let i,r;if(typeof e=="string"){const s=k5(e);if(!s)return n(void 0,424),RP;r=s.send;const o=yve(e);o&&(i=o.redundancy)}else{const s=E5(e);if(s){i=NP(s);const o=e.resources?e.resources[0]:"",a=k5(o);a&&(r=a.send)}}return!i||!r?(n(void 0,424),RP):i.query(t,r,n)().abort}const OP="iconify2",dh="iconify",LP=dh+"-count",IP=dh+"-version",PP=36e5,vve=168,_ve=50;function A5(e,t){try{return e.getItem(t)}catch{}}function F5(e,t,n){try{return e.setItem(t,n),!0}catch{}}function zP(e,t){try{e.removeItem(t)}catch{}}function T5(e,t){return F5(e,LP,t.toString())}function M5(e){return parseInt(A5(e,LP))||0}const Fm={local:!0,session:!0},BP={local:new Set,session:new Set};let D5=!1;function xve(e){D5=e}let Tm=typeof window>"u"?{}:window;function jP(e){const t=e+"Storage";try{if(Tm&&Tm[t]&&typeof Tm[t].length=="number")return Tm[t]}catch{}Fm[e]=!1}function UP(e,t){const n=jP(e);if(!n)return;const i=A5(n,IP);if(i!==OP){if(i){const a=M5(n);for(let l=0;l{const l=dh+a.toString(),u=A5(n,l);if(typeof u=="string"){try{const c=JSON.parse(u);if(typeof c=="object"&&typeof c.cached=="number"&&c.cached>r&&typeof c.provider=="string"&&typeof c.data=="object"&&typeof c.data.prefix=="string"&&t(c,a))return!0}catch{}zP(n,l)}};let o=M5(n);for(let a=o-1;a>=0;a--)s(a)||(a===o-1?(o--,T5(n,o)):BP[e].add(a))}function qP(){if(!D5){xve(!0);for(const e in Fm)UP(e,t=>{const n=t.data,i=t.provider,r=n.prefix,s=Ml(i,r);if(!x5(s,n).length)return!1;const o=n.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,o):o,!0})}}function wve(e,t){const n=e.lastModifiedCached;if(n&&n>=t)return n===t;if(e.lastModifiedCached=t,n)for(const i in Fm)UP(i,r=>{const s=r.data;return r.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function kve(e,t){D5||qP();function n(i){let r;if(!Fm[i]||!(r=jP(i)))return;const s=BP[i];let o;if(s.size)s.delete(o=Array.from(s).shift());else if(o=M5(r),o>=_ve||!T5(r,o+1))return;const a={cached:Math.floor(Date.now()/PP),provider:e.provider,data:t};return F5(r,dh+o.toString(),JSON.stringify(a))}t.lastModified&&!wve(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),n("local")||n("session"))}function WP(){}function Eve(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,fve(e)}))}function $ve(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:i}=e,r=e.iconsToLoad;delete e.iconsToLoad;let s;if(!r||!(s=k5(n)))return;s.prepare(n,i,r).forEach(a=>{bve(n,a,l=>{if(typeof l!="object")a.icons.forEach(u=>{e.missing.add(u)});else try{const u=x5(e,l);if(!u.length)return;const c=e.pendingIcons;c&&u.forEach(f=>{c.delete(f)}),kve(e,l)}catch(u){console.error(u)}Eve(e)})})}))}const Sve=(e,t)=>{const n=pve(e,!0,CP()),i=cve(n);if(!i.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(i.loaded,i.missing,i.pending,WP)}),()=>{l=!1}}const r=Object.create(null),s=[];let o,a;return i.pending.forEach(l=>{const{provider:u,prefix:c}=l;if(c===a&&u===o)return;o=u,a=c,s.push(Ml(u,c));const f=r[u]||(r[u]=Object.create(null));f[c]||(f[c]=[])}),i.pending.forEach(l=>{const{provider:u,prefix:c,name:f}=l,d=Ml(u,c),h=d.pendingIcons||(d.pendingIcons=new Set);h.has(f)||(h.add(f),r[u][c].push(f))}),s.forEach(l=>{const{provider:u,prefix:c}=l;r[u][c].length&&$ve(l,r[u][c])}),t?hve(t,i,s):WP};function Cve(e,t){const n={...e};for(const i in t){const r=t[i],s=typeof r;i in AP?(r===null||r&&(s==="string"||s==="number"))&&(n[i]=r):s===typeof n[i]&&(n[i]=i==="rotate"?r%4:r)}return n}const Ave=/[\s,]+/;function Fve(e,t){t.split(Ave).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}function Tve(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function i(r){for(;r<0;)r+=4;return r%4}if(n===""){const r=parseInt(e);return isNaN(r)?0:i(r)}else if(n!==e){let r=0;switch(n){case"%":r=25;break;case"deg":r=90}if(r){let s=parseFloat(e.slice(0,e.length-n.length));return isNaN(s)?0:(s=s/r,s%1===0?i(s):0)}}return t}function Mve(e,t){let n=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const i in t)n+=" "+i+'="'+t[i]+'"';return'"+e+""}function Dve(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function Nve(e){return"data:image/svg+xml,"+Dve(e)}function Rve(e){return'url("'+Nve(e)+'")'}const HP={...FP,inline:!1},Ove={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Lve={display:"inline-block"},N5={"background-color":"currentColor"},GP={"background-color":"transparent"},VP={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},YP={"-webkit-mask":N5,mask:N5,background:GP};for(const e in YP){const t=YP[e];for(const n in VP)t[e+"-"+n]=VP[n]}function Ive(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}function Pve(e,t){const n=Cve(HP,t),i=t.mode||"svg",r=i==="svg"?{...Ove}:{};e.body.indexOf("xlink:")===-1&&delete r["xmlns:xlink"];let s=typeof t.style=="string"?t.style:"";for(let y in t){const b=t[y];if(b!==void 0)switch(y){case"icon":case"style":case"onLoad":case"mode":break;case"inline":case"hFlip":case"vFlip":n[y]=b===!0||b==="true"||b===1;break;case"flip":typeof b=="string"&&Fve(n,b);break;case"color":s=s+(s.length>0&&s.trim().slice(-1)!==";"?";":"")+"color: "+b+"; ";break;case"rotate":typeof b=="string"?n[y]=Tve(b):typeof b=="number"&&(n[y]=b);break;case"ariaHidden":case"aria-hidden":b!==!0&&b!=="true"&&delete r["aria-hidden"];break;default:if(y.slice(0,3)==="on:")break;HP[y]===void 0&&(r[y]=b)}}const o=J3e(e,n),a=o.attributes;if(n.inline&&(s="vertical-align: -0.125em; "+s),i==="svg"){Object.assign(r,a),s!==""&&(r.style=s);let y=0,b=t.id;return typeof b=="string"&&(b=b.replace(/-/g,"_")),{svg:!0,attributes:r,body:nve(o.body,b?()=>b+"ID"+y++:"iconifySvelte")}}const{body:l,width:u,height:c}=e,f=i==="mask"||(i==="bg"?!1:l.indexOf("currentColor")!==-1),d=Mve(l,{...a,width:u+"",height:c+""}),p={"--svg":Rve(d)},g=y=>{const b=a[y];b&&(p[y]=Ive(b))};g("width"),g("height"),Object.assign(p,Lve,f?N5:GP);let m="";for(const y in p)m+=y+": "+p[y]+";";return r.style=m+s,{svg:!1,attributes:r}}if(CP(!0),ive("",uve),typeof document<"u"&&typeof window<"u"){qP();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(i=>{try{(typeof i!="object"||i===null||i instanceof Array||typeof i.icons!="object"||typeof i.prefix!="string"||!H3e(i))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const i="IconifyProviders["+n+"] is invalid.";try{const r=t[n];if(typeof r!="object"||!r||r.resources===void 0)continue;rve(n,r)||console.error(i)}catch{console.error(i)}}}}function zve(e,t,n,i,r){function s(){t.loading&&(t.loading.abort(),t.loading=null)}if(typeof e=="object"&&e!==null&&typeof e.body=="string")return t.name="",s(),{data:{...Cm,...e}};let o;if(typeof e!="string"||(o=Em(e,!1,!0))===null)return s(),null;const a=q3e(o);if(!a)return n&&(!t.loading||t.loading.name!==e)&&(s(),t.name="",t.loading={name:e,abort:Sve([o],i)}),null;s(),t.name!==e&&(t.name=e,r&&!t.destroyed&&r(e));const l=["iconify"];return o.prefix!==""&&l.push("iconify--"+o.prefix),o.provider!==""&&l.push("iconify--"+o.provider),{data:a,classes:l}}function Bve(e,t){return e?Pve({...Cm,...e},t):null}function XP(e){let t;function n(s,o){return s[0].svg?Uve:jve}let i=n(e),r=i(e);return{c(){r.c(),t=De()},m(s,o){r.m(s,o),L(s,t,o)},p(s,o){i===(i=n(s))&&r?r.p(s,o):(r.d(1),r=i(s),r&&(r.c(),r.m(t.parentNode,t)))},d(s){s&&O(t),r.d(s)}}}function jve(e){let t,n=[e[0].attributes],i={};for(let r=0;r{typeof t.onLoad=="function"&&t.onLoad(u),Rm()("load",{icon:u})};function l(){n(3,s++,s)}return no(()=>{n(2,r=!0)}),Nm(()=>{n(1,i.destroyed=!0,i),i.loading&&(i.loading.abort(),n(1,i.loading=null,i))}),e.$$set=u=>{n(6,t=Oe(Oe({},t),Dm(u)))},e.$$.update=()=>{{const u=zve(t.icon,i,r,l,a);n(0,o=u?Bve(u.data,t):null),o&&u.classes&&n(0,o.attributes.class=(typeof t.class=="string"?t.class+" ":"")+u.classes.join(" "),o)}},t=Dm(t),[o,i,r,s]}class Hve extends ve{constructor(t){super(),be(this,t,Wve,qve,pe,{})}}function ZP(e){let t,n,i,r,s,o,a,l,u;return i=new Hve({props:{icon:"mdi:close"}}),o=new km({props:{componentData:e[1]}}),{c(){t=I("div"),n=I("span"),he(i.$$.fragment),r=ge(),s=I("div"),he(o.$$.fragment),C(n,"class","cancelButton svelte-1hhf5ym"),C(s,"class","modalContainer"),C(t,"class","modal svelte-1hhf5ym"),C(t,"data-component","modal")},m(c,f){L(c,t,f),R(t,n),fe(i,n,null),R(t,r),R(t,s),fe(o,s,null),a=!0,l||(u=[Ki(s,"click",Vve),Ki(t,"click",e[3])],l=!0)},p(c,f){const d={};f&2&&(d.componentData=c[1]),o.$set(d)},i(c){a||(T(i.$$.fragment,c),T(o.$$.fragment,c),a=!0)},o(c){N(i.$$.fragment,c),N(o.$$.fragment,c),a=!1},d(c){c&&O(t),de(i),de(o),l=!1,Nl(u)}}}function Gve(e){let t,n,i,r,s=e[0]&&e[1]&&ZP(e);return{c(){s&&s.c(),t=De()},m(o,a){s&&s.m(o,a),L(o,t,a),n=!0,i||(r=Ki(window,"keyup",e[2]),i=!0)},p(o,[a]){o[0]&&o[1]?s?(s.p(o,a),a&3&&T(s,1)):(s=ZP(o),s.c(),T(s,1),s.m(t.parentNode,t)):s&&(ke(),N(s,1,1,()=>{s=null}),Ee())},i(o){n||(T(s),n=!0)},o(o){N(s),n=!1},d(o){o&&O(t),s&&s.d(o),i=!1,r()}}}const Vve=e=>{e==null||e.stopImmediatePropagation()};function Yve(e,t,n){let i;gh(e,Fc,a=>n(1,i=a));let{componentData:r}=t;function s(a){a.code==="Escape"&&Fc.set(void 0)}function o(a){a.stopImmediatePropagation(),Fc.set(void 0)}return e.$$set=a=>{"componentData"in a&&n(0,r=a.componentData)},[r,i,s,o]}class Xve extends ve{constructor(t){super(),be(this,t,Yve,Gve,pe,{componentData:0})}}function KP(e,t,n){const i=e.slice();return i[2]=t[n][0],i[3]=t[n][1],i}function JP(e,t,n){const i=e.slice();return i[6]=t[n],i}function QP(e){let t,n=e[2]+"",i;return{c(){t=I("span"),i=ce(n),C(t,"class","pageId svelte-1kdpgko")},m(r,s){L(r,t,s),R(t,i)},p(r,s){s&1&&n!==(n=r[2]+"")&&Me(i,n)},d(r){r&&O(t)}}}function ez(e){let t,n,i=e[6]+"",r,s,o,a;function l(){return e[1](e[6])}return{c(){t=I("li"),n=I("button"),r=ce(i),s=ge(),C(n,"class","textButton"),C(t,"class","sectionLink svelte-1kdpgko")},m(u,c){L(u,t,c),R(t,n),R(n,r),R(t,s),o||(a=Ki(n,"click",l),o=!0)},p(u,c){e=u,c&1&&i!==(i=e[6]+"")&&Me(r,i)},d(u){u&&O(t),o=!1,a()}}}function tz(e){let t,n,i,r,s=e[2]&&QP(e),o=Pe(e[3]||[]),a=[];for(let l=0;lKve(s);return e.$$set=s=>{"pageHierarchy"in s&&n(0,i=s.pageHierarchy)},[i,r]}class Qve extends ve{constructor(t){super(),be(this,t,Jve,Zve,pe,{pageHierarchy:0})}}const{Boolean:e_e}=pz;function nz(e,t,n){const i=e.slice();return i[5]=t[n],i}function t_e(e){var i;let t,n;return t=new Qve({props:{pageHierarchy:X5((i=e[0])==null?void 0:i.components)}}),{c(){he(t.$$.fragment)},m(r,s){fe(t,r,s),n=!0},p(r,s){var a;const o={};s&1&&(o.pageHierarchy=X5((a=r[0])==null?void 0:a.components)),t.$set(o)},i(r){n||(T(t.$$.fragment,r),n=!0)},o(r){N(t.$$.fragment,r),n=!1},d(r){de(t,r)}}}function iz(e){let t,n;return t=new km({props:{componentData:e[5]}}),{c(){he(t.$$.fragment)},m(i,r){fe(t,i,r),n=!0},p(i,r){const s={};r&1&&(s.componentData=i[5]),t.$set(s)},i(i){n||(T(t.$$.fragment,i),n=!0)},o(i){N(t.$$.fragment,i),n=!1},d(i){de(t,i)}}}function n_e(e){var o;let t,n,i=Pe(((o=e[0])==null?void 0:o.components)||[]),r=[];for(let a=0;aN(r[a],1,1,()=>{r[a]=null});return{c(){for(let a=0;a{l=null}),Ee())},i(u){a||(T(n.$$.fragment,u),T(r.$$.fragment,u),T(l),a=!0)},o(u){N(n.$$.fragment,u),N(r.$$.fragment,u),N(l),a=!1},d(u){u&&(O(t),O(s),O(o)),de(n),de(r),l&&l.d(u)}}}function r_e(e,t,n){let i,r;gh(e,ua,l=>n(0,i=l)),gh(e,Fc,l=>n(1,r=l));let{cardDataId:s}=t;Cz(s);let a=!!new URLSearchParams(window==null?void 0:window.location.search).get("embed");return e.$$set=l=>{"cardDataId"in l&&n(3,s=l.cardDataId)},[i,r,a,s]}class s_e extends ve{constructor(t){super(),be(this,t,r_e,i_e,pe,{cardDataId:3})}}let sz;try{const e=window.mfCardDataId,t=window.mfContainerId,n=(az=document.querySelector(`[data-container="${t}"]`))==null?void 0:az.querySelector(".card_app");sz=new s_e({target:n??document.querySelector(".card_app"),props:{cardDataId:e}})}catch(e){throw new Error(e)}return sz}); diff --git a/metaflow/plugins/cards/ui/src/components/dag/dag.svelte b/metaflow/plugins/cards/ui/src/components/dag/dag.svelte index 3a44b7dd088..a138601e513 100644 --- a/metaflow/plugins/cards/ui/src/components/dag/dag.svelte +++ b/metaflow/plugins/cards/ui/src/components/dag/dag.svelte @@ -11,7 +11,7 @@ export let componentData: DagComponent; - const { data: steps } = componentData; + const { steps, start_step: startStep, end_step: endStep } = componentData.data; let el: HTMLElement; let dagStructure: DagStructure = {}; @@ -42,8 +42,14 @@ style="position: relative; line-height: 1" data-component="dag" > - {#if steps?.start} - + {#if startStep && steps?.[startStep]} + {:else}

No start step

{/if} diff --git a/metaflow/plugins/cards/ui/src/components/dag/step-wrapper.svelte b/metaflow/plugins/cards/ui/src/components/dag/step-wrapper.svelte index 3f4f2d800dc..9f62ef47744 100644 --- a/metaflow/plugins/cards/ui/src/components/dag/step-wrapper.svelte +++ b/metaflow/plugins/cards/ui/src/components/dag/step-wrapper.svelte @@ -6,6 +6,8 @@ export let steps: Dag; export let stepName: string; + export let startStep: string; + export let endStep: string | null = null; export let levels = 0; export let joins: string[] = [] export let pathToStep: string = ""; @@ -40,8 +42,8 @@ connections.push(fromJoins) } } else { - if (nextStep === 'end') { - connections.push("end"); + if (endStep && nextStep === endStep) { + connections.push(endStep); } else { if (nextStep === stepName) { connections.push(fullStepPath) @@ -63,7 +65,7 @@ onMount(registerNode); let hasNext = currentStep?.next?.find((nextStepName) => { - return steps[nextStepName]?.type !== "join" && nextStepName !== 'end'; + return steps[nextStepName]?.type !== "join" && nextStepName !== endStep; }); // For a static analysis, increase the level for a foreach and decrease it for a join @@ -91,10 +93,12 @@ {#each currentStep.next as nextStepName} {#if nextStepName === stepName} - {:else if steps[nextStepName].type !== 'join' && nextStepName !== 'end'} + {:else if nextStepName !== endStep && steps[nextStepName]?.type !== 'join'} - + {/if} - {#if stepName === 'start'} + {#if endStep && endStep !== startStep && stepName === startStep}
- + {/if}
{/if} diff --git a/metaflow/plugins/cards/ui/src/types.ts b/metaflow/plugins/cards/ui/src/types.ts index 95828a1ab8b..241dd987ea5 100644 --- a/metaflow/plugins/cards/ui/src/types.ts +++ b/metaflow/plugins/cards/ui/src/types.ts @@ -54,6 +54,12 @@ export type PathSpecObject = { export type Dag = Record; +export interface DagData { + steps: Dag; + start_step: string | null; + end_step: string | null; +} + // TODO: add support for switch-split export type StepType = | "linear" @@ -187,7 +193,7 @@ export interface ArtifactsComponent { export interface DagComponent { type: "dag"; id?: string; - data: Dag; + data: DagData; } // handle stderr stdout strings diff --git a/metaflow/runtime.py b/metaflow/runtime.py index 2365892fca6..bbb1e2dd62e 100644 --- a/metaflow/runtime.py +++ b/metaflow/runtime.py @@ -238,7 +238,7 @@ def _format_input_paths(task_pathspec, attempt): if self._input_paths: return self._input_paths - if self._step_func.name == "start": + if self._step_func.name == self._flow._graph.start_step: from metaflow import Step flow_name, run_id, _, _ = self._spin_pathspec.split("/") @@ -514,6 +514,37 @@ def persist_constants(self, task_id=None): if not self._params_task.is_cloned: self._params_task.persist(self._flow) + # Register start/end step metadata on _parameters task so the + # client can determine graph endpoints without loading _graph_info. + # Only write for fresh runs -- cloned tasks carry the original's metadata. + try: + self._metadata.register_metadata( + self._run_id, + "_parameters", + self._params_task.task_id, + [ + MetaDatum( + field="start_step", + value=self._graph.start_step, + type="graph_structure", + tags=[], + ), + MetaDatum( + field="end_step", + value=self._graph.end_step, + type="graph_structure", + tags=[], + ), + ], + ) + except Exception: + self._logger( + "Warning: failed to register graph endpoint metadata. " + "The client will fall back to default step names.", + system_msg=True, + bad=True, + ) + self._is_cloned[self._params_task.path] = self._params_task.is_cloned def should_skip_clone_only_execution(self): @@ -767,9 +798,12 @@ def execute(self): self._active_tasks[0] = 0 else: if self._params_task: - self._queue_push("start", {"input_paths": [self._params_task.path]}) + self._queue_push( + self._graph.start_step, + {"input_paths": [self._params_task.path]}, + ) else: - self._queue_push("start", {}) + self._queue_push(self._graph.start_step, {}) progress_tstamp = time.time() with tempfile.NamedTemporaryFile(mode="w", encoding="utf-8") as config_file: @@ -938,8 +972,8 @@ def execute(self): deco.runtime_finished(exception) self._run_exit_hooks() - # assert that end was executed and it was successful - if ("end", (), ()) in self._finished: + # assert that the terminal step was executed and it was successful + if (self._graph.end_step, (), ()) in self._finished: if self._run_url: self._logger( "Done! See the run in the UI at %s" % self._run_url, @@ -956,7 +990,8 @@ def execute(self): self._params_task.mark_resume_done() else: raise MetaflowInternalError( - "The *end* step was not successful by the end of flow." + "The terminal step *%s* was not successful by the end of flow." + % self._graph.end_step ) def _run_exit_hooks(self): @@ -966,7 +1001,11 @@ def _run_exit_hooks(self): if not exit_hook_decos: return - successful = ("end", (), ()) in self._finished or self._clone_only + successful = ( + self._graph.end_step, + (), + (), + ) in self._finished or self._clone_only pathspec = f"{self._graph.name}/{self._run_id}" flow_file = self._environment.get_environment_info()["script"] diff --git a/metaflow/task.py b/metaflow/task.py index 6d53483ffa6..87a840f1840 100644 --- a/metaflow/task.py +++ b/metaflow/task.py @@ -330,7 +330,7 @@ def _init_foreach(self, step_name, join_type, inputs, split_index): # then used later to write the foreach-stack metadata for that task # case 1) - reset the stack - if step_name == "start": + if step_name == self.flow._graph.start_step: self.flow._foreach_stack = [] # case 2) - this is a join step diff --git a/metaflow/util.py b/metaflow/util.py index cb83bd998ef..8f310a63236 100644 --- a/metaflow/util.py +++ b/metaflow/util.py @@ -11,7 +11,6 @@ from itertools import takewhile from typing import Dict, Any, Tuple, Optional, List, Generator - try: # python2 unicode_type = unicode @@ -582,6 +581,8 @@ def to_pod(value): return [to_pod(v) for v in value] if isinstance(value, DeployTimeField): return value.print_representation + if callable(value): + return getattr(value, "__qualname__", str(value)) return str(value) diff --git a/test/core/tests/resume_recursive_switch.py b/test/core/tests/resume_recursive_switch.py index 2258b8a54ac..758b85481d0 100644 --- a/test/core/tests/resume_recursive_switch.py +++ b/test/core/tests/resume_recursive_switch.py @@ -40,7 +40,7 @@ def check_results(self, flow, checker): "origin-run-id" in start_task_metadata ), "The 'origin-run-id' should be present in a resumed run's metadata." - loop_steps_by_count = {s.data.count: s for s in loop_steps} + loop_steps_by_count = {step.data.count: step for step in loop_steps} task_5_metadata = loop_steps_by_count[5].metadata_dict assert ( diff --git a/test/core/tests/resume_recursive_switch_inside_foreach.py b/test/core/tests/resume_recursive_switch_inside_foreach.py index 2ff562fd020..8d105815992 100644 --- a/test/core/tests/resume_recursive_switch_inside_foreach.py +++ b/test/core/tests/resume_recursive_switch_inside_foreach.py @@ -56,7 +56,7 @@ def check_results(self, flow, checker): checker.assert_artifact("join", "results", expected) exit_steps = run["exit_item_loop"] - exit_steps_by_id = {s.data.item_id: s for s in exit_steps} + exit_steps_by_id = {step.data.item_id: step for step in exit_steps} assert_equals(3, len(list(exit_steps))) # Branch 'B' failed and was re-executed from the start of the branch. diff --git a/test/unit/graph_inference/__init__.py b/test/unit/graph_inference/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/unit/graph_inference/conftest.py b/test/unit/graph_inference/conftest.py new file mode 100644 index 00000000000..75c85ee8741 --- /dev/null +++ b/test/unit/graph_inference/conftest.py @@ -0,0 +1,88 @@ +import os +from importlib.util import module_from_spec, spec_from_file_location + +import pytest +from metaflow import Runner, Flow + +FLOWS_DIR = os.path.join(os.path.dirname(__file__), "flows") + + +def _load_flow_class(flow_file, flow_class_name): + """Import a FlowSpec subclass from a file in FLOWS_DIR. + + Loads the module by file path so FLOWS_DIR is not added to sys.path. + Used by fixtures that need to pass `flow=` to a Card constructor; + `DefaultCardJSON` does `getattr(self.flow, step_name)` and + `inspect.getsource(...)` to build the Task Code panel and crashes if + `flow` is None. + """ + spec = spec_from_file_location(flow_class_name, os.path.join(FLOWS_DIR, flow_file)) + module = module_from_spec(spec) + assert spec.loader is not None + spec.loader.exec_module(module) + return getattr(module, flow_class_name) + + +def create_flow_fixture(flow_name, flow_file): + """Factory function to create flow fixtures.""" + + def flow_fixture(request): + if request.config.getoption("--use-latest", default=False): + flow = Flow(flow_name, _namespace_check=False) + return flow.latest_run + else: + flow_path = os.path.join(FLOWS_DIR, flow_file) + with Runner(flow_path, cwd=FLOWS_DIR).run() as running: + return running.run + + return flow_fixture + + +custom_named_run = pytest.fixture(scope="session")( + create_flow_fixture("CustomNamedFlow", "custom_named_flow.py") +) + +single_step_run = pytest.fixture(scope="session")( + create_flow_fixture("SingleStepFlow", "single_step_flow.py") +) + +custom_branch_run = pytest.fixture(scope="session")( + create_flow_fixture("CustomBranchFlow", "custom_branch_flow.py") +) + +custom_named_card_run = pytest.fixture(scope="session")( + create_flow_fixture("CustomNamedCardFlow", "custom_named_card_flow.py") +) + +single_step_with_config_run = pytest.fixture(scope="session")( + create_flow_fixture("SingleStepWithConfigFlow", "single_step_with_config_flow.py") +) + +single_step_with_stacked_decos_run = pytest.fixture(scope="session")( + create_flow_fixture( + "SingleStepWithStackedDecosFlow", + "single_step_with_stacked_decos_flow.py", + ) +) + +single_step_with_flow_mutator_run = pytest.fixture(scope="session")( + create_flow_fixture( + "SingleStepWithFlowMutatorFlow", + "single_step_with_flow_mutator_flow.py", + ) +) + +single_step_bare_run = pytest.fixture(scope="session")( + create_flow_fixture( + "SingleStepBareFlow", + "single_step_bare_flow.py", + ) +) + + +@pytest.fixture(scope="session") +def custom_named_card_flow(): + """Instance of CustomNamedCardFlow for tests that pass flow= to a Card.""" + return _load_flow_class("custom_named_card_flow.py", "CustomNamedCardFlow")( + use_cli=False + ) diff --git a/test/unit/graph_inference/flows/__init__.py b/test/unit/graph_inference/flows/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/unit/graph_inference/flows/custom_branch_flow.py b/test/unit/graph_inference/flows/custom_branch_flow.py new file mode 100644 index 00000000000..048cb738a51 --- /dev/null +++ b/test/unit/graph_inference/flows/custom_branch_flow.py @@ -0,0 +1,32 @@ +from metaflow import FlowSpec, step + + +class CustomBranchFlow(FlowSpec): + """Flow with branches and custom step names.""" + + @step(start=True) + def entry(self): + self.next(self.a, self.b) + + @step + def a(self): + self.val = "a" + self.next(self.merge) + + @step + def b(self): + self.val = "b" + self.next(self.merge) + + @step + def merge(self, inputs): + self.vals = sorted([i.val for i in inputs]) + self.next(self.done) + + @step(end=True) + def done(self): + pass + + +if __name__ == "__main__": + CustomBranchFlow() diff --git a/test/unit/graph_inference/flows/custom_named_card_flow.py b/test/unit/graph_inference/flows/custom_named_card_flow.py new file mode 100644 index 00000000000..e9ae32eb83a --- /dev/null +++ b/test/unit/graph_inference/flows/custom_named_card_flow.py @@ -0,0 +1,24 @@ +from metaflow import FlowSpec, card, current, step +from metaflow.cards import Markdown + + +class CustomNamedCardFlow(FlowSpec): + @card + @step(start=True) + def begin(self): + current.card.append(Markdown("# Custom graph")) + self.value = 1 + self.next(self.middle) + + @step + def middle(self): + self.value += 1 + self.next(self.finish) + + @step(end=True) + def finish(self): + self.value += 1 + + +if __name__ == "__main__": + CustomNamedCardFlow() diff --git a/test/unit/graph_inference/flows/custom_named_flow.py b/test/unit/graph_inference/flows/custom_named_flow.py new file mode 100644 index 00000000000..82c88e984f6 --- /dev/null +++ b/test/unit/graph_inference/flows/custom_named_flow.py @@ -0,0 +1,23 @@ +from metaflow import FlowSpec, step + + +class CustomNamedFlow(FlowSpec): + """Flow with non-standard step names to test structural inference.""" + + @step(start=True) + def begin(self): + self.x = 1 + self.next(self.middle) + + @step + def middle(self): + self.x += 1 + self.next(self.finish) + + @step(end=True) + def finish(self): + self.x += 1 + + +if __name__ == "__main__": + CustomNamedFlow() diff --git a/test/unit/graph_inference/flows/single_step_bare_flow.py b/test/unit/graph_inference/flows/single_step_bare_flow.py new file mode 100644 index 00000000000..af42635a3c7 --- /dev/null +++ b/test/unit/graph_inference/flows/single_step_bare_flow.py @@ -0,0 +1,18 @@ +from metaflow import FlowSpec, step + + +class SingleStepBareFlow(FlowSpec): + """Single-step flow with a bare @step (no start/end kwargs). + + Verifies that _identify_start_end implicitly treats the only user step + as both start and end, so the trivial single-step case does not require + @step(start=True, end=True). + """ + + @step + def only(self): + self.x = 42 + + +if __name__ == "__main__": + SingleStepBareFlow() diff --git a/test/unit/graph_inference/flows/single_step_flow.py b/test/unit/graph_inference/flows/single_step_flow.py new file mode 100644 index 00000000000..ec4483cb204 --- /dev/null +++ b/test/unit/graph_inference/flows/single_step_flow.py @@ -0,0 +1,13 @@ +from metaflow import FlowSpec, step + + +class SingleStepFlow(FlowSpec): + """Flow with a single step to test start==end inference.""" + + @step(start=True, end=True) + def only(self): + self.x = 42 + + +if __name__ == "__main__": + SingleStepFlow() diff --git a/test/unit/graph_inference/flows/single_step_with_config_flow.py b/test/unit/graph_inference/flows/single_step_with_config_flow.py new file mode 100644 index 00000000000..a8b92683126 --- /dev/null +++ b/test/unit/graph_inference/flows/single_step_with_config_flow.py @@ -0,0 +1,15 @@ +from metaflow import FlowSpec, step, Config + + +class SingleStepWithConfigFlow(FlowSpec): + """Single-step flow wired to a Config, verifies Configs resolve end-to-end.""" + + cfg = Config("cfg", default_value={"x": 7}) + + @step(start=True, end=True) + def only(self): + self.v = self.cfg["x"] + + +if __name__ == "__main__": + SingleStepWithConfigFlow() diff --git a/test/unit/graph_inference/flows/single_step_with_flow_mutator_flow.py b/test/unit/graph_inference/flows/single_step_with_flow_mutator_flow.py new file mode 100644 index 00000000000..344a88a5ac3 --- /dev/null +++ b/test/unit/graph_inference/flows/single_step_with_flow_mutator_flow.py @@ -0,0 +1,22 @@ +from metaflow import FlowSpec, step, retry, FlowMutator + + +class AddRetryToOnly(FlowMutator): + """Adds @retry to every step. Verifies mutators reach the sole step.""" + + def pre_mutate(self, mutable_flow): + for _, s in mutable_flow.steps: + s.add_decorator(retry, deco_kwargs={"times": 1}) + + +@AddRetryToOnly +class SingleStepWithFlowMutatorFlow(FlowSpec): + """Single-step flow with a FlowMutator applied at the class level.""" + + @step(start=True, end=True) + def only(self): + self.v = 1 + + +if __name__ == "__main__": + SingleStepWithFlowMutatorFlow() diff --git a/test/unit/graph_inference/flows/single_step_with_stacked_decos_flow.py b/test/unit/graph_inference/flows/single_step_with_stacked_decos_flow.py new file mode 100644 index 00000000000..49c0b473f4e --- /dev/null +++ b/test/unit/graph_inference/flows/single_step_with_stacked_decos_flow.py @@ -0,0 +1,15 @@ +from metaflow import FlowSpec, step, retry, resources + + +class SingleStepWithStackedDecosFlow(FlowSpec): + """Single-step flow with @retry and @resources stacked on top of @step.""" + + @retry(times=1) + @resources(cpu=1, memory=256) + @step(start=True, end=True) + def only(self): + self.v = 42 + + +if __name__ == "__main__": + SingleStepWithStackedDecosFlow() diff --git a/test/unit/graph_inference/test_card_dag.py b/test/unit/graph_inference/test_card_dag.py new file mode 100644 index 00000000000..bdce054c24c --- /dev/null +++ b/test/unit/graph_inference/test_card_dag.py @@ -0,0 +1,95 @@ +""" +Tests for the cards' DAG-related graph data layer. + +Covers: +- `transform_flow_graph` - the function that normalizes the legacy + flat-step-dict and the new `{steps, start_step, end_step}` shapes + into the structure the DAG card component renders against. +- The end-to-end render path: a Run with custom-named entry/terminal + steps produces a DAG card whose `start_step` / `end_step` / + `steps` reflect the user's actual step names rather than the + legacy hardcoded "start" / "end". +""" + +import json + +from metaflow.plugins.cards.card_modules.basic import ( + DefaultCardJSON, + transform_flow_graph, +) + + +def _find_components_by_type(node, component_type): + if isinstance(node, dict): + if node.get("type") == component_type: + yield node + for value in node.values(): + yield from _find_components_by_type(value, component_type) + elif isinstance(node, list): + for item in node: + yield from _find_components_by_type(item, component_type) + + +# --------------------------------------------------------------------------- +# transform_flow_graph: shape-detection unit tests +# --------------------------------------------------------------------------- + + +def test_transform_flow_graph_supports_explicit_endpoints(): + graph = { + "start_step": "begin", + "end_step": "finish", + "steps": { + "begin": {"type": "start", "next": ["middle"], "doc": "begin"}, + "middle": {"type": "linear", "next": ["finish"], "doc": "middle"}, + "finish": {"type": "end", "next": [], "doc": "finish"}, + }, + } + + transformed = transform_flow_graph(graph) + + assert transformed["start_step"] == "begin" + assert transformed["end_step"] == "finish" + assert set(transformed["steps"]) == {"begin", "middle", "finish"} + assert transformed["steps"]["begin"]["type"] == "start" + assert transformed["steps"]["middle"]["box_next"] is False + assert transformed["steps"]["finish"]["type"] == "end" + + +def test_transform_flow_graph_keeps_legacy_start_end_detection(): + graph = { + "start": {"type": "start", "next": ["end"], "doc": ""}, + "end": {"type": "end", "next": [], "doc": ""}, + } + + transformed = transform_flow_graph(graph) + + assert transformed["start_step"] == "start" + assert transformed["end_step"] == "end" + assert set(transformed["steps"]) == {"start", "end"} + + +# --------------------------------------------------------------------------- +# DefaultCardJSON: end-to-end render with custom-named endpoints +# --------------------------------------------------------------------------- + + +def test_default_card_includes_custom_graph_endpoints( + custom_named_card_run, custom_named_card_flow +): + graph = custom_named_card_run["_parameters"].task["_graph_info"].data + card_data = json.loads( + DefaultCardJSON(graph=graph, flow=custom_named_card_flow).render( + custom_named_card_run["begin"].task + ) + ) + + dag_components = list(_find_components_by_type(card_data["components"], "dag")) + assert len(dag_components) == 1 + + dag_data = dag_components[0]["data"] + assert dag_data["start_step"] == "begin" + assert dag_data["end_step"] == "finish" + assert set(dag_data["steps"]) == {"begin", "middle", "finish"} + assert "start" not in dag_data["steps"] + assert "end" not in dag_data["steps"] diff --git a/test/unit/graph_inference/test_graph_inference.py b/test/unit/graph_inference/test_graph_inference.py new file mode 100644 index 00000000000..f68d6833bfb --- /dev/null +++ b/test/unit/graph_inference/test_graph_inference.py @@ -0,0 +1,244 @@ +""" +Integration tests for structural inference of start/end steps. + +These tests actually execute flows with non-standard step names and verify: +- Flows run to completion +- _graph_info contains start_step/end_step +- _parameters metadata contains start_step/end_step +- Client APIs (end_task, parent_steps, child_steps) work correctly +- Single-step flows execute end-to-end +""" + +from metaflow.events import Trigger + + +# --------------------------------------------------------------------------- +# Custom named flow (begin/middle/finish) +# --------------------------------------------------------------------------- + + +def test_custom_named_flow_completes(custom_named_run): + assert custom_named_run.successful + assert custom_named_run.finished + + +def test_custom_named_graph_info_has_endpoints(custom_named_run): + graph_info = custom_named_run["_parameters"].task["_graph_info"].data + assert graph_info["start_step"] == "begin" + assert graph_info["end_step"] == "finish" + + +def test_custom_named_parameters_metadata_has_endpoints(custom_named_run): + meta = custom_named_run["_parameters"].task.metadata_dict + assert meta.get("start_step") == "begin" + assert meta.get("end_step") == "finish" + + +def test_custom_named_graph_endpoints_property(custom_named_run): + start, end = custom_named_run._graph_endpoints + assert start == "begin" + assert end == "finish" + + +def test_custom_named_end_task(custom_named_run): + end_task = custom_named_run.end_task + assert end_task is not None + assert end_task["x"].data == 3 + + +def test_custom_named_steps_present(custom_named_run): + step_names = {step.id for step in custom_named_run} + assert step_names == {"begin", "middle", "finish"} + + +def test_custom_named_parent_steps(custom_named_run): + assert list(custom_named_run["begin"].parent_steps) == [] + assert [step.id for step in custom_named_run["middle"].parent_steps] == ["begin"] + assert [step.id for step in custom_named_run["finish"].parent_steps] == ["middle"] + + +def test_custom_named_child_steps(custom_named_run): + assert [step.id for step in custom_named_run["begin"].child_steps] == ["middle"] + assert [step.id for step in custom_named_run["middle"].child_steps] == ["finish"] + assert list(custom_named_run["finish"].child_steps) == [] + + +# --------------------------------------------------------------------------- +# Single-step flow (start == end) +# --------------------------------------------------------------------------- + + +def test_single_step_flow_completes(single_step_run): + assert single_step_run.successful + assert single_step_run.finished + + +def test_single_step_graph_info_start_equals_end(single_step_run): + graph_info = single_step_run["_parameters"].task["_graph_info"].data + assert graph_info["start_step"] == "only" + assert graph_info["end_step"] == "only" + assert graph_info["start_step"] == graph_info["end_step"] + + +def test_single_step_parameters_metadata(single_step_run): + meta = single_step_run["_parameters"].task.metadata_dict + assert meta.get("start_step") == "only" + assert meta.get("end_step") == "only" + + +def test_single_step_end_task(single_step_run): + end_task = single_step_run.end_task + assert end_task is not None + assert end_task["x"].data == 42 + + +def test_single_step_present(single_step_run): + assert {step.id for step in single_step_run} == {"only"} + + +def test_single_step_parent_child_empty(single_step_run): + assert list(single_step_run["only"].parent_steps) == [] + assert list(single_step_run["only"].child_steps) == [] + + +# --------------------------------------------------------------------------- +# Single-step flow with bare @step (implicit start == end) +# --------------------------------------------------------------------------- + + +def test_single_step_bare_flow_completes(single_step_bare_run): + assert single_step_bare_run.successful + assert single_step_bare_run.finished + + +def test_single_step_bare_graph_info_start_equals_end(single_step_bare_run): + graph_info = single_step_bare_run["_parameters"].task["_graph_info"].data + assert graph_info["start_step"] == "only" + assert graph_info["end_step"] == "only" + + +def test_single_step_bare_parameters_metadata(single_step_bare_run): + meta = single_step_bare_run["_parameters"].task.metadata_dict + assert meta.get("start_step") == "only" + assert meta.get("end_step") == "only" + + +def test_single_step_bare_end_task(single_step_bare_run): + end_task = single_step_bare_run.end_task + assert end_task is not None + assert end_task["x"].data == 42 + + +def test_single_step_bare_step_present(single_step_bare_run): + assert {step.id for step in single_step_bare_run} == {"only"} + + +def test_single_step_bare_parent_child_empty(single_step_bare_run): + assert list(single_step_bare_run["only"].parent_steps) == [] + assert list(single_step_bare_run["only"].child_steps) == [] + + +# --------------------------------------------------------------------------- +# Custom branch flow (entry/a/b/merge/done) +# --------------------------------------------------------------------------- + + +def test_branch_flow_completes(custom_branch_run): + assert custom_branch_run.successful + assert custom_branch_run.finished + + +def test_branch_graph_info_endpoints(custom_branch_run): + graph_info = custom_branch_run["_parameters"].task["_graph_info"].data + assert graph_info["start_step"] == "entry" + assert graph_info["end_step"] == "done" + + +def test_branch_end_task(custom_branch_run): + assert custom_branch_run.end_task is not None + + +def test_branch_merge_data(custom_branch_run): + merge_task = custom_branch_run["merge"].task + assert sorted(merge_task["vals"].data) == ["a", "b"] + + +def test_branch_steps_present(custom_branch_run): + assert {step.id for step in custom_branch_run} == { + "entry", + "a", + "b", + "merge", + "done", + } + + +def test_branch_entry_has_two_children(custom_branch_run): + children = [step.id for step in custom_branch_run["entry"].child_steps] + assert sorted(children) == ["a", "b"] + + +def test_branch_merge_has_two_parents(custom_branch_run): + parents = [step.id for step in custom_branch_run["merge"].parent_steps] + assert sorted(parents) == ["a", "b"] + + +# --------------------------------------------------------------------------- +# Trigger integration +# --------------------------------------------------------------------------- + + +def test_trigger_from_runs_uses_custom_terminal_step(custom_named_run): + trigger = Trigger.from_runs([custom_named_run]) + + assert trigger.event is not None + assert trigger.event.name == "metaflow.%s.finish" % custom_named_run.parent.id + assert trigger.event.id == custom_named_run.end_task.pathspec + assert trigger.run.pathspec == custom_named_run.pathspec + + +# --------------------------------------------------------------------------- +# Composition: single-step flows with Config, stacked decorators, FlowMutator +# --------------------------------------------------------------------------- + + +def test_single_step_with_config_completes(single_step_with_config_run): + """Config-bearing single-step flow runs to completion.""" + assert single_step_with_config_run.successful + assert single_step_with_config_run.finished + + +def test_single_step_with_config_value_flows_to_artifact(single_step_with_config_run): + """Config descriptor value is readable from the end task's artifact.""" + end_task = single_step_with_config_run.end_task + assert end_task["v"].data == 7 + + +def test_single_step_with_stacked_decos_completes(single_step_with_stacked_decos_run): + """Single-step flow with stacked @retry/@resources runs end-to-end.""" + assert single_step_with_stacked_decos_run.successful + assert single_step_with_stacked_decos_run.finished + + +def test_single_step_with_stacked_decos_graph_info(single_step_with_stacked_decos_run): + """_graph_info records all stacked decorators on the only step.""" + graph_info = ( + single_step_with_stacked_decos_run["_parameters"].task["_graph_info"].data + ) + names = {deco["name"] for deco in graph_info["steps"]["only"]["decorators"]} + assert {"retry", "resources"}.issubset(names) + + +def test_single_step_with_flow_mutator_completes(single_step_with_flow_mutator_run): + """FlowMutator-decorated single-step flow runs end-to-end.""" + assert single_step_with_flow_mutator_run.successful + assert single_step_with_flow_mutator_run.finished + + +def test_single_step_with_flow_mutator_applied(single_step_with_flow_mutator_run): + """FlowMutator.add_decorator landed @retry on the only step.""" + graph_info = ( + single_step_with_flow_mutator_run["_parameters"].task["_graph_info"].data + ) + names = {deco["name"] for deco in graph_info["steps"]["only"]["decorators"]} + assert "retry" in names diff --git a/test/unit/localbatch/test_localbatch.py b/test/unit/localbatch/test_localbatch.py index 12bdfdc2147..de726a06b87 100644 --- a/test/unit/localbatch/test_localbatch.py +++ b/test/unit/localbatch/test_localbatch.py @@ -373,5 +373,5 @@ def test_run_succeeds(self, simple_batch_run): @_NEEDS_CORE_BATCH_PARAMS def test_all_steps_have_tasks(self, simple_batch_run): - step_names = {s.id for s in simple_batch_run.steps()} + step_names = {step.id for step in simple_batch_run.steps()} assert {"start", "end"} <= step_names diff --git a/test/unit/test_graph_endpoints_fallback.py b/test/unit/test_graph_endpoints_fallback.py new file mode 100644 index 00000000000..c067839d79d --- /dev/null +++ b/test/unit/test_graph_endpoints_fallback.py @@ -0,0 +1,62 @@ +"""Tests for Run._graph_endpoints fallback and caching behavior. + +The happy path (custom-named steps producing the right endpoints) is +covered by the integration tests in test/ux/core/test_basic.py +(test_custom_step_names, test_single_step_flow, test_custom_branch_flow). +This file pins the smaller, harder-to-reach behaviors: + +- empty / missing metadata returns the legacy ("start", "end") fallback +- transient errors do NOT cache (so a retry can succeed) +- MetaflowNotFound (old run) DOES cache (no point retrying forever) +""" + +import pytest + +from metaflow.client.core import Run +from metaflow.exception import MetaflowNotFound + + +@pytest.fixture +def run(): + """Bare Run instance, Run.__init__ skipped to avoid metadata service I/O.""" + return Run.__new__(Run) + + +def _params_step(mocker, metadata): + """Stand-in for run["_parameters"] with a controlled metadata_dict.""" + params = mocker.MagicMock() + params.task.metadata_dict = metadata + return params + + +def test_missing_metadata_falls_back_to_literals(run, mocker): + """Empty metadata returns ('start', 'end').""" + mocker.patch.object(Run, "__getitem__", return_value=_params_step(mocker, {})) + assert run._graph_endpoints == ("start", "end") + + +def test_metaflow_not_found_caches_fallback(run, mocker): + """MetaflowNotFound (old run, no _parameters) caches the fallback.""" + mocker.patch.object(Run, "__getitem__", side_effect=MetaflowNotFound("_parameters")) + assert run._graph_endpoints == ("start", "end") + assert run._cached_endpoints == ("start", "end") + + +def test_transient_error_not_cached(run, mocker): + """A transient exception returns the fallback but does NOT cache it.""" + mocker.patch.object( + Run, + "__getitem__", + side_effect=[ + RuntimeError("transient (e.g., metadata service down)"), + _params_step(mocker, {"start_step": "begin", "end_step": "finish"}), + ], + ) + + # First call: transient error, fallback returned, not cached. + assert run._graph_endpoints == ("start", "end") + assert not hasattr(run, "_cached_endpoints") + + # Second call: succeeds, caches. + assert run._graph_endpoints == ("begin", "finish") + assert run._cached_endpoints == ("begin", "finish") diff --git a/test/unit/test_graph_structure.py b/test/unit/test_graph_structure.py new file mode 100644 index 00000000000..b2e48a37c4e --- /dev/null +++ b/test/unit/test_graph_structure.py @@ -0,0 +1,650 @@ +""" +Tests for structural inference of start/end steps in FlowGraph. + +Verifies that: +- Start step is determined by zero in-edges, end step by zero out-edges +- Steps can have any name (not just "start"/"end") +- Single-step flows are supported (start == end) +- Node types are assigned correctly based on structure +- _graph_info contains start_step/end_step fields +- Lint validation works with structural inference +- @step(start=True) / @step(end=True) annotations work correctly +""" + +import pytest +from metaflow import Config, FlowMutator, FlowSpec, step, Parameter, retry, resources +from metaflow.flowspec import FlowStateItems +from metaflow.lint import linter, LintWarn + +# --------------------------------------------------------------------------- +# Flow definitions for testing +# --------------------------------------------------------------------------- + + +class StandardFlow(FlowSpec): + @step + def start(self): + self.x = 1 + self.next(self.end) + + @step + def end(self): + pass + + +class CustomNamedLinearFlow(FlowSpec): + @step(start=True) + def begin(self): + self.x = 1 + self.next(self.middle) + + @step + def middle(self): + self.x += 1 + self.next(self.finish) + + @step(end=True) + def finish(self): + pass + + +class SingleStepFlow(FlowSpec): + @step(start=True, end=True) + def only(self): + self.x = 42 + + +class CustomNamedBranchFlow(FlowSpec): + @step(start=True) + def entry(self): + self.next(self.a, self.b) + + @step + def a(self): + self.next(self.merge) + + @step + def b(self): + self.next(self.merge) + + @step + def merge(self, inputs): + self.next(self.done) + + @step(end=True) + def done(self): + pass + + +class CustomNamedForeachFlow(FlowSpec): + @step(start=True) + def init(self): + self.items = [1, 2, 3] + self.next(self.process, foreach="items") + + @step + def process(self): + self.result = self.input * 2 + self.next(self.collect) + + @step + def collect(self, inputs): + self.results = [i.result for i in inputs] + self.next(self.final) + + @step(end=True) + def final(self): + pass + + +class SplitStartFlow(FlowSpec): + """Start step that is also a split.""" + + @step(start=True) + def origin(self): + self.next(self.left, self.right) + + @step + def left(self): + self.next(self.rejoin) + + @step + def right(self): + self.next(self.rejoin) + + @step + def rejoin(self, inputs): + self.next(self.terminus) + + @step(end=True) + def terminus(self): + pass + + +# --------------------------------------------------------------------------- +# Flow classes: single-step flows composed with configs, decorators, mutators +# --------------------------------------------------------------------------- + + +class _SingleStepWithConfig(FlowSpec): + """Single-step flow with a Config descriptor.""" + + cfg = Config("cfg", default_value={"x": 7}) + + @step(start=True, end=True) + def only(self): + self.v = self.cfg["x"] + + +class _SingleStepWithStackedDecos(FlowSpec): + """Single-step flow with multiple step decorators stacked.""" + + @retry(times=3) + @resources(cpu=2, memory=1024) + @step(start=True, end=True) + def only(self): + self.v = 1 + + +class _AddRetryMutator(FlowMutator): + """Adds @retry to every step. Used to verify mutators reach a single-step flow.""" + + def pre_mutate(self, mutable_flow): + for _, s in mutable_flow.steps: + s.add_decorator(retry, deco_kwargs={"times": 1}) + + +@_AddRetryMutator +class _SingleStepWithFlowMutator(FlowSpec): + """Single-step flow with a FlowMutator applied at the class level.""" + + @step(start=True, end=True) + def only(self): + pass + + +# --------------------------------------------------------------------------- +# Fixtures +# --------------------------------------------------------------------------- + + +@pytest.fixture( + params=[ + (StandardFlow, "start", "end"), + (CustomNamedLinearFlow, "begin", "finish"), + (SingleStepFlow, "only", "only"), + (CustomNamedBranchFlow, "entry", "done"), + (CustomNamedForeachFlow, "init", "final"), + (SplitStartFlow, "origin", "terminus"), + ], + ids=[ + "standard", + "custom_linear", + "single_step", + "branch", + "foreach", + "split_start", + ], +) +def flow_with_endpoints(request): + """Yields (flow_class, expected_start, expected_end) for each topology.""" + return request.param + + +# --------------------------------------------------------------------------- +# Tests: Structural inference +# --------------------------------------------------------------------------- + + +def test_start_end_inference(flow_with_endpoints): + flow_cls, expected_start, expected_end = flow_with_endpoints + graph = flow_cls._graph + assert graph.start_step == expected_start + assert graph.end_step == expected_end + + +# --------------------------------------------------------------------------- +# Tests: Node types +# --------------------------------------------------------------------------- + + +def test_standard_flow_types(): + graph = StandardFlow._graph + assert graph["start"].type == "start" + assert graph["end"].type == "end" + + +def test_custom_linear_types(): + graph = CustomNamedLinearFlow._graph + assert graph["begin"].type == "start" + assert graph["middle"].type == "linear" + assert graph["finish"].type == "end" + + +def test_single_step_type_is_end(): + """Single-step flow: type is 'end' since it's terminal.""" + graph = SingleStepFlow._graph + assert graph["only"].type == "end" + + +def test_branch_entry_is_split(): + """Entry step that splits should keep 'split' type, not be overridden to 'start'.""" + graph = CustomNamedBranchFlow._graph + assert graph["entry"].type == "split" + assert graph["merge"].type == "join" + assert graph["done"].type == "end" + + +def test_split_start_keeps_split_type(): + """Start step that is also a split must keep 'split' type for lint balance.""" + graph = SplitStartFlow._graph + assert graph["origin"].type == "split" + + +def test_foreach_entry_keeps_foreach_type(): + graph = CustomNamedForeachFlow._graph + assert graph["init"].type == "foreach" + assert graph["collect"].type == "join" + assert graph["final"].type == "end" + + +def test_custom_flow_in_funcs_out_funcs(): + graph = CustomNamedLinearFlow._graph + assert graph["begin"].in_funcs == [] + assert graph["begin"].out_funcs == ["middle"] + assert graph["finish"].in_funcs == ["middle"] + assert graph["finish"].out_funcs == [] + + +# --------------------------------------------------------------------------- +# Tests: output_steps / graph_structure +# --------------------------------------------------------------------------- + + +def test_standard_graph_structure(): + steps_info, graph_structure = StandardFlow._graph.output_steps() + assert graph_structure == ["start", "end"] + assert set(steps_info.keys()) == {"start", "end"} + + +def test_custom_linear_graph_structure(): + steps_info, graph_structure = CustomNamedLinearFlow._graph.output_steps() + assert graph_structure == ["begin", "middle", "finish"] + assert set(steps_info.keys()) == {"begin", "middle", "finish"} + + +def test_single_step_graph_structure(): + steps_info, graph_structure = SingleStepFlow._graph.output_steps() + assert graph_structure == ["only"] + assert set(steps_info.keys()) == {"only"} + + +def test_branch_graph_structure(): + steps_info, graph_structure = CustomNamedBranchFlow._graph.output_steps() + assert graph_structure[0] == "entry" + assert graph_structure[-1] == "done" + assert "merge" in graph_structure + assert set(steps_info.keys()) == {"entry", "a", "b", "merge", "done"} + + +def test_steps_info_types_match(): + """Steps info type should match the node_to_type mapping.""" + steps_info, _ = CustomNamedLinearFlow._graph.output_steps() + assert steps_info["begin"]["type"] == "start" + assert steps_info["middle"]["type"] == "linear" + assert steps_info["finish"]["type"] == "end" + + +def test_split_start_type_in_steps_info(): + """When start step is a split, steps_info should show split-static.""" + steps_info, _ = SplitStartFlow._graph.output_steps() + assert steps_info["origin"]["type"] == "split-static" + assert steps_info["terminus"]["type"] == "end" + + +def test_steps_info_has_next(): + steps_info, _ = CustomNamedLinearFlow._graph.output_steps() + assert steps_info["begin"]["next"] == ["middle"] + assert steps_info["middle"]["next"] == ["finish"] + assert steps_info["finish"]["next"] == [] + + +# --------------------------------------------------------------------------- +# Tests: Topological sort +# --------------------------------------------------------------------------- + + +def test_standard_sort(): + assert StandardFlow._graph.sorted_nodes == ["start", "end"] + + +def test_custom_linear_sort(): + assert CustomNamedLinearFlow._graph.sorted_nodes == ["begin", "middle", "finish"] + + +def test_single_step_sort(): + assert SingleStepFlow._graph.sorted_nodes == ["only"] + + +def test_branch_sort_order(): + """Start must come first, end must come last.""" + graph = CustomNamedBranchFlow._graph + assert graph.sorted_nodes[0] == "entry" + assert graph.sorted_nodes[-1] == "done" + + +# --------------------------------------------------------------------------- +# Tests: Lint validation +# --------------------------------------------------------------------------- + + +@pytest.mark.parametrize( + "flow_cls", + [ + StandardFlow, + CustomNamedLinearFlow, + SingleStepFlow, + CustomNamedBranchFlow, + CustomNamedForeachFlow, + SplitStartFlow, + ], + ids=[ + "standard", + "custom_linear", + "single_step", + "branch", + "foreach", + "split_start", + ], +) +def test_flow_passes_lint(flow_cls): + linter.run_checks(flow_cls._graph) + + +# --------------------------------------------------------------------------- +# Tests: node_info metadata +# --------------------------------------------------------------------------- + + +class _NodeInfoFlow(FlowSpec): + @step(start=True, node_info={"label": "entry point", "priority": 1}) + def begin(self): + self.next(self.end) + + @step(end=True) + def end(self): + pass + + +class _NestedNodeInfoFlow(FlowSpec): + @step(start=True, node_info={"tags": ["gpu", "heavy"], "config": {"timeout": 300}}) + def begin(self): + self.next(self.end) + + @step(end=True, node_info={}) + def end(self): + pass + + +def test_node_info_stored_on_dag_node(): + graph = _NodeInfoFlow._graph + assert graph["begin"].node_info == {"label": "entry point", "priority": 1} + + +def test_node_info_default_is_none_or_empty(): + graph = StandardFlow._graph + assert graph["start"].node_info is None or graph["start"].node_info == {} + + +def test_node_info_appears_in_output_steps(): + steps_info, _ = _NodeInfoFlow._graph.output_steps() + assert steps_info["begin"]["node_info"] == {"label": "entry point", "priority": 1} + + +def test_node_info_nested_dict(): + graph = _NestedNodeInfoFlow._graph + assert graph["begin"].node_info == { + "tags": ["gpu", "heavy"], + "config": {"timeout": 300}, + } + + +def test_node_info_nested_in_output_steps(): + steps_info, _ = _NestedNodeInfoFlow._graph.output_steps() + assert steps_info["begin"]["node_info"]["tags"] == ["gpu", "heavy"] + assert steps_info["begin"]["node_info"]["config"]["timeout"] == 300 + + +def test_node_info_empty_dict(): + graph = _NestedNodeInfoFlow._graph + assert graph["end"].node_info == {} + steps_info, _ = _NestedNodeInfoFlow._graph.output_steps() + assert steps_info["end"]["node_info"] == {} + + +def test_node_info_absent_step_in_output_steps(): + """Steps without node_info should have None or {} in output_steps.""" + steps_info, _ = _NodeInfoFlow._graph.output_steps() + end_info = steps_info["end"]["node_info"] + assert end_info is None or end_info == {} + + +# --------------------------------------------------------------------------- +# Tests: Annotation mechanics +# --------------------------------------------------------------------------- + + +def test_plain_step_has_no_annotations(): + """Plain @step sets is_start_step=False and is_end_step=False.""" + graph = StandardFlow._graph + assert graph["start"].is_start_step is False + assert graph["start"].is_end_step is False + assert graph["end"].is_start_step is False + assert graph["end"].is_end_step is False + + +def test_annotated_step_flags(): + """@step(start=True) and @step(end=True) set the flags on the node.""" + graph = CustomNamedLinearFlow._graph + assert graph["begin"].is_start_step is True + assert graph["begin"].is_end_step is False + assert graph["finish"].is_start_step is False + assert graph["finish"].is_end_step is True + assert graph["middle"].is_start_step is False + assert graph["middle"].is_end_step is False + + +def test_annotated_single_step(): + """@step(start=True, end=True) single-step flow works.""" + graph = SingleStepFlow._graph + assert graph["only"].is_start_step is True + assert graph["only"].is_end_step is True + assert graph.start_step == "only" + assert graph.end_step == "only" + + +def test_source_backed_single_step_with_next_still_fails_lint(): + """Source-backed @step(start=True, end=True) with self.next() still fails lint.""" + + class BadSingleStepFlow(FlowSpec): + @step(start=True, end=True) + def only(self): + self.next(self.only) + + with pytest.raises(LintWarn): + linter.run_checks(BadSingleStepFlow._graph) + + +def test_mixed_annotated_start_named_end(): + """Annotated start + name-based end fallback.""" + + class MixedFlow(FlowSpec): + @step(start=True) + def begin(self): + self.next(self.end) + + @step + def end(self): + pass + + graph = MixedFlow._graph + assert graph.start_step == "begin" + assert graph.end_step == "end" + assert graph["begin"].is_start_step is True + assert graph["end"].is_end_step is False + + +def test_backward_compat_name_based(): + """Flow with just 'start'/'end' names still works (no annotations).""" + graph = StandardFlow._graph + assert graph.start_step == "start" + assert graph.end_step == "end" + assert graph["start"].is_start_step is False + assert graph["end"].is_end_step is False + + +# --------------------------------------------------------------------------- +# Tests: composition with configs, stacked decorators, and flow mutators +# --------------------------------------------------------------------------- + + +def test_single_step_with_config_descriptor_registered(): + """Config descriptor is registered on a single-step flow.""" + graph = _SingleStepWithConfig._graph + assert graph.start_step == "only" == graph.end_step + names = {name for name, _ in _SingleStepWithConfig._get_parameters()} + assert "cfg" in names + + +def test_single_step_with_multiple_step_decorators(): + """Multiple step decorators stack correctly on a single-step flow.""" + graph = _SingleStepWithStackedDecos._graph + deco_names = {deco.name for deco in graph["only"].decorators} + assert {"retry", "resources"}.issubset(deco_names) + + +def test_single_step_with_flow_mutator_registered(): + """FlowMutator is registered on a single-step flow at class-definition time. + + pre_mutate only fires when the flow is processed via the CLI layer, so + the decorator it adds won't appear on the graph in a unit test. What we + can verify here is that the mutator syntax is accepted by a single-step + FlowSpec and that it's registered as a flow mutator. End-to-end execution + is covered by the matching integration test. + """ + flow_cls = _SingleStepWithFlowMutator._flow_cls + graph = flow_cls._graph + assert graph.start_step == "only" == graph.end_step + mutators = flow_cls._flow_state[FlowStateItems.FLOW_MUTATORS] + assert any(isinstance(m, _AddRetryMutator) for m in mutators) + + +# --------------------------------------------------------------------------- +# Negative-path tests: malformed annotation patterns caught by lint +# --------------------------------------------------------------------------- + + +def _make_multiple_start(): + class MultipleStartFlow(FlowSpec): + @step(start=True) + def begin(self): + self.next(self.end) + + @step(start=True) + def also_begin(self): + self.next(self.end) + + @step + def end(self): + pass + + return MultipleStartFlow + + +def _make_multiple_end(): + class MultipleEndFlow(FlowSpec): + @step + def start(self): + self.next(self.done) + + @step(end=True) + def done(self): + pass + + @step(end=True) + def also_done(self): + pass + + return MultipleEndFlow + + +def _make_no_start(): + class NoStartFlow(FlowSpec): + @step + def compute(self): + self.next(self.done) + + @step(end=True) + def done(self): + pass + + return NoStartFlow + + +def _make_no_end(): + class NoEndFlow(FlowSpec): + @step(start=True) + def begin(self): + self.next(self.compute) + + @step + def compute(self): + pass + + return NoEndFlow + + +def _lint_warnings(flow_cls): + """Run all lint checks and collect LintWarn exceptions.""" + graph = flow_cls._graph + warnings = [] + for rule in linter._checks: + try: + rule(graph) + except LintWarn as e: + warnings.append(str(e)) + return graph, warnings + + +@pytest.mark.parametrize( + "flow_factory, expected_none_field", + [ + (_make_multiple_start, "start_step"), + (_make_multiple_end, "end_step"), + (_make_no_start, "start_step"), + (_make_no_end, "end_step"), + ], + ids=["multiple_start", "multiple_end", "no_start", "no_end"], +) +def test_malformed_flow_sets_none(flow_factory, expected_none_field): + graph = flow_factory()._graph + assert getattr(graph, expected_none_field) is None + + +@pytest.mark.parametrize( + "flow_factory, match_pattern", + [ + (_make_multiple_start, "start"), + (_make_multiple_end, "end"), + (_make_no_start, "start"), + (_make_no_end, "end"), + ], + ids=["multiple_start_lint", "multiple_end_lint", "no_start_lint", "no_end_lint"], +) +def test_malformed_flow_caught_by_lint(flow_factory, match_pattern): + _, warnings = _lint_warnings(flow_factory()) + combined = " ".join(warnings).lower() + assert match_pattern in combined, "Expected lint warning about '%s', got: %s" % ( + match_pattern, + warnings, + ) diff --git a/test/unit/test_sourceless_dag_node.py b/test/unit/test_sourceless_dag_node.py new file mode 100644 index 00000000000..dea6c318d78 --- /dev/null +++ b/test/unit/test_sourceless_dag_node.py @@ -0,0 +1,52 @@ +""" +Tests for the sourceless DAGNode contract used by FunctionSpec. + +FunctionSpec is an upcoming FlowSpec-like construct, currently shipped as an +out-of-tree extension, that synthesizes a single `@step(start=True, end=True)` +method via a metaclass that uses ``compile()`` + ``exec()``. Because the +synthetic step has no source file, ``inspect.getsourcelines()`` cannot recover +its source and ``ast.parse()`` cannot be applied. + +Core metaflow does not ship FunctionSpec, but it does carry the support hooks +the extension relies on: + +- ``DAGNode`` accepts optional ``name=`` / ``num_args=`` kwargs and tolerates + ``func_ast=None``. +- ``FlowGraph._create_sourceless_single_step_node`` builds a DAGNode without + AST parsing for ``start=True, end=True`` steps. +- The lint pipeline accepts the resulting graph. + +This file pins those hooks against silent regressions. It uses ``compile()`` + +``exec()`` + ``type()`` to simulate what FunctionSpec's metaclass would +produce, without depending on the extension package. +""" + +from metaflow import FlowSpec, step +from metaflow.lint import linter + + +def _make_dynamic_single_step_flow(): + namespace = {} + exec( + compile("def only(self):\n self.x = 42\n", "", "exec"), namespace + ) + only = step(start=True, end=True)(namespace["only"]) + return type( + "DynamicSingleStepFlow", + (FlowSpec,), + {"__module__": __name__, "only": only}, + ) + + +def test_dynamic_single_step_without_inspectable_source(): + """Dynamically-generated @step(start=True, end=True) works without source.""" + graph = _make_dynamic_single_step_flow()._graph + + assert graph.start_step == "only" + assert graph.end_step == "only" + assert graph["only"].type == "end" + assert graph["only"].num_args == 1 + assert graph["only"].func_lineno == 1 + assert graph["only"].source_file == "" + + linter.run_checks(graph) diff --git a/test/unit/test_to_pod.py b/test/unit/test_to_pod.py new file mode 100644 index 00000000000..3968dc1fbbe --- /dev/null +++ b/test/unit/test_to_pod.py @@ -0,0 +1,64 @@ +"""Tests for metaflow.util.to_pod. + +Ensures POD conversion handles all the types we expect, including callables +(used by DAGNode.node_info serialization for extensions like FunctionSpec). +""" + +from metaflow.util import to_pod + + +def _top_level_fn(): + pass + + +class _Wrapper: + @staticmethod + def static_method(): + pass + + def instance_method(self): + pass + + +def test_to_pod_primitives(): + assert to_pod("abc") == "abc" + assert to_pod(42) == 42 + assert to_pod(3.14) == 3.14 + + +def test_to_pod_list_set_tuple(): + assert to_pod([1, 2, 3]) == [1, 2, 3] + assert sorted(to_pod({1, 2, 3})) == [1, 2, 3] + assert to_pod((1, 2, 3)) == [1, 2, 3] + + +def test_to_pod_dict(): + assert to_pod({"a": 1, "b": 2}) == {"a": 1, "b": 2} + + +def test_to_pod_nested(): + value = {"outer": [{"inner": (1, 2)}], "other": {"k": "v"}} + assert to_pod(value) == { + "outer": [{"inner": [1, 2]}], + "other": {"k": "v"}, + } + + +def test_to_pod_callable_uses_qualname(): + """Callables serialize to their __qualname__ for _graph_info persistence.""" + result = to_pod(_top_level_fn) + assert result == "_top_level_fn" + + +def test_to_pod_callable_in_dict(): + """Simulates DAGNode.node_info with function references (FunctionSpec use case).""" + result = to_pod({"init_func": _top_level_fn, "call_func": _Wrapper.static_method}) + assert result["init_func"] == "_top_level_fn" + assert result["call_func"] == "_Wrapper.static_method" + + +def test_to_pod_lambda_uses_qualname(): + """Lambdas have __qualname__ like 'test_to_pod_lambda_uses_qualname..'.""" + fn = lambda x: x # noqa: E731 + result = to_pod(fn) + assert "" in result diff --git a/test/ux/core/flows/basic/custom_branch_flow.py b/test/ux/core/flows/basic/custom_branch_flow.py new file mode 100644 index 00000000000..df9cd14b8b2 --- /dev/null +++ b/test/ux/core/flows/basic/custom_branch_flow.py @@ -0,0 +1,34 @@ +"""A branching flow with custom step names using start/end annotations.""" + +from metaflow import FlowSpec, step, project + + +@project(name="custom_branch") +class CustomBranchFlow(FlowSpec): + @step(start=True) + def entry(self): + self.val = "root" + self.next(self.left, self.right) + + @step + def left(self): + self.branch_val = "left" + self.next(self.merge) + + @step + def right(self): + self.branch_val = "right" + self.next(self.merge) + + @step + def merge(self, inputs): + self.branches = sorted([inp.branch_val for inp in inputs]) + self.next(self.done) + + @step(end=True) + def done(self): + self.result = self.branches + + +if __name__ == "__main__": + CustomBranchFlow() diff --git a/test/ux/core/flows/basic/hello_custom_steps.py b/test/ux/core/flows/basic/hello_custom_steps.py new file mode 100644 index 00000000000..24d13f896d8 --- /dev/null +++ b/test/ux/core/flows/basic/hello_custom_steps.py @@ -0,0 +1,24 @@ +"""A simple linear flow using @step(start=True) and @step(end=True) annotations.""" + +from metaflow import FlowSpec, step, project + + +@project(name="hello_custom_steps") +class HelloCustomStepsFlow(FlowSpec): + @step(start=True) + def begin(self): + self.message = "Hello from custom start step" + self.next(self.process) + + @step + def process(self): + self.message = self.message + " -> processed" + self.next(self.finish) + + @step(end=True) + def finish(self): + self.result = self.message + " -> done" + + +if __name__ == "__main__": + HelloCustomStepsFlow() diff --git a/test/ux/core/flows/basic/single_step_flow.py b/test/ux/core/flows/basic/single_step_flow.py new file mode 100644 index 00000000000..5d25ce30531 --- /dev/null +++ b/test/ux/core/flows/basic/single_step_flow.py @@ -0,0 +1,14 @@ +"""A single-step flow using @step(start=True, end=True).""" + +from metaflow import FlowSpec, step, project + + +@project(name="single_step") +class SingleStepFlow(FlowSpec): + @step(start=True, end=True) + def only(self): + self.result = 42 + + +if __name__ == "__main__": + SingleStepFlow() diff --git a/test/ux/core/test_basic.py b/test/ux/core/test_basic.py index 5b775e1e400..1eef3933964 100644 --- a/test/ux/core/test_basic.py +++ b/test/ux/core/test_basic.py @@ -281,6 +281,88 @@ def test_split_in_branch_deployer( ], "inner_join should receive results from inner_x and inner_y" +def test_custom_step_names(exec_mode, decospecs, compute_env, tag, scheduler_config): + """Verify a linear flow with @step(start=True)/@step(end=True) annotations.""" + run = execute_test_flow( + flow_name="basic/hello_custom_steps.py", + exec_mode=exec_mode, + decospecs=decospecs, + tag=tag, + scheduler_config=scheduler_config, + test_name="custom_step_names", + tl_args_extra={"env": compute_env}, + ) + + assert run.successful, "Run was not successful" + step_names = {step.id for step in run} + assert step_names == {"begin", "process", "finish"}, ( + "Expected custom step names, got %s" % step_names + ) + assert ( + run["finish"].task.data.result + == "Hello from custom start step -> processed -> done" + ), "Data did not flow through custom-named steps" + + # Verify graph endpoint metadata is persisted and readable via client API. + # This exercises the init -> persist_constants -> register_metadata chain + # which runs for all backends (local Runner AND scheduler deployer). + start, end = run._graph_endpoints + assert start == "begin", "Expected start_step=begin, got %s" % start + assert end == "finish", "Expected end_step=finish, got %s" % end + assert run.end_task is not None, "end_task should resolve for custom terminal step" + + +def test_single_step_flow(exec_mode, decospecs, compute_env, tag, scheduler_config): + """Verify a single-step flow with @step(start=True, end=True).""" + run = execute_test_flow( + flow_name="basic/single_step_flow.py", + exec_mode=exec_mode, + decospecs=decospecs, + tag=tag, + scheduler_config=scheduler_config, + test_name="single_step", + tl_args_extra={"env": compute_env}, + ) + + assert run.successful, "Run was not successful" + step_names = {step.id for step in run} + assert step_names == {"only"}, "Expected single step 'only', got %s" % step_names + assert run["only"].task.data.result == 42, "Single step data incorrect" + + start, end = run._graph_endpoints + assert start == "only", "Expected start_step=only, got %s" % start + assert end == "only", "Expected end_step=only, got %s" % end + assert run.end_task is not None + + +def test_custom_branch_flow(exec_mode, decospecs, compute_env, tag, scheduler_config): + """Verify a branching flow with custom start/end step annotations.""" + run = execute_test_flow( + flow_name="basic/custom_branch_flow.py", + exec_mode=exec_mode, + decospecs=decospecs, + tag=tag, + scheduler_config=scheduler_config, + test_name="custom_branch", + tl_args_extra={"env": compute_env}, + ) + + assert run.successful, "Run was not successful" + step_names = {step.id for step in run} + assert step_names == {"entry", "left", "right", "merge", "done"}, ( + "Expected custom branch step names, got %s" % step_names + ) + assert sorted(run["done"].task.data.result) == [ + "left", + "right", + ], "Branch data did not merge correctly" + + start, end = run._graph_endpoints + assert start == "entry", "Expected start_step=entry, got %s" % start + assert end == "done", "Expected end_step=done, got %s" % end + assert run.end_task is not None + + @pytest.mark.scheduler_only @pytest.mark.skip(reason="devstack has no GPU nodes") def test_resources_gpu(exec_mode, decospecs, compute_env, tag, scheduler_config):