diff --git a/org-tweetyproject-arg-deductive/src/main/java/org/tweetyproject/arg/deductive/util/RandomDeductiveKnowledgeBaseGenerator.java b/org-tweetyproject-arg-deductive/src/main/java/org/tweetyproject/arg/deductive/util/RandomDeductiveKnowledgeBaseGenerator.java index c331db172..c2aee3555 100644 --- a/org-tweetyproject-arg-deductive/src/main/java/org/tweetyproject/arg/deductive/util/RandomDeductiveKnowledgeBaseGenerator.java +++ b/org-tweetyproject-arg-deductive/src/main/java/org/tweetyproject/arg/deductive/util/RandomDeductiveKnowledgeBaseGenerator.java @@ -89,7 +89,7 @@ public DeductiveKnowledgeBase next() { return kb; } - + /** * Description missing * @param Description missing diff --git a/org-tweetyproject-arg-dung/src/main/java/org/tweetyproject/arg/dung/examples/GraphPlotterExample.java b/org-tweetyproject-arg-dung/src/main/java/org/tweetyproject/arg/dung/examples/GraphPlotterExample.java new file mode 100644 index 000000000..2bb678be4 --- /dev/null +++ b/org-tweetyproject-arg-dung/src/main/java/org/tweetyproject/arg/dung/examples/GraphPlotterExample.java @@ -0,0 +1,54 @@ +/* + * This file is part of "TweetyProject", a collection of Java libraries for + * logical aspects of artificial intelligence and knowledge representation. + * + * TweetyProject is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Copyright 2025 The TweetyProject Team + */ +package org.tweetyproject.arg.dung.examples; + +import org.tweetyproject.arg.dung.semantics.Semantics; +import org.tweetyproject.arg.dung.serialisability.util.AigSerialisationPlotter; +import org.tweetyproject.arg.dung.syntax.Argument; +import org.tweetyproject.arg.dung.syntax.DungTheory; +import org.tweetyproject.arg.dung.util.DefaultDungTheoryGenerator; +import org.tweetyproject.graphs.util.AigGraphPlotter; + +import java.io.IOException; +import java.net.URISyntaxException; + +/** + * Example Usage of the {@link AigGraphPlotter} which renders a given graph via html in the webbrowser + * + * @author Lars Bengel + */ +public class GraphPlotterExample { + public static void main(String[] args) throws URISyntaxException, IOException { + DungTheory theory = new DefaultDungTheoryGenerator(9, 0.2).next(); + + // Initialize plotter for argumentation framework + AigGraphPlotter plotter = new AigGraphPlotter<>(theory); + + // Set options for rendering of the graph, eg + plotter.setLinkDeletable(false); + + // Render graph + plotter.show(); + + // Plot an argumentation framework and its serialisation wrt. complete semantics + //AigSerialisationPlotter.showSerialisation(theory, Semantics.CO); + + + } +} diff --git a/org-tweetyproject-arg-dung/src/main/java/org/tweetyproject/arg/dung/serialisability/semantics/SerialisationGraph.java b/org-tweetyproject-arg-dung/src/main/java/org/tweetyproject/arg/dung/serialisability/semantics/SerialisationGraph.java index 0216aff31..e6bccbf8e 100644 --- a/org-tweetyproject-arg-dung/src/main/java/org/tweetyproject/arg/dung/serialisability/semantics/SerialisationGraph.java +++ b/org-tweetyproject-arg-dung/src/main/java/org/tweetyproject/arg/dung/serialisability/semantics/SerialisationGraph.java @@ -18,7 +18,6 @@ */ package org.tweetyproject.arg.dung.serialisability.semantics; -import org.tweetyproject.arg.dung.reasoner.AbstractExtensionReasoner; import org.tweetyproject.arg.dung.reasoner.SerialisedExtensionReasoner; import org.tweetyproject.arg.dung.semantics.Extension; import org.tweetyproject.arg.dung.semantics.Semantics; @@ -46,6 +45,8 @@ public class SerialisationGraph implements Graph { /** explicit storage of children for each node */ private Map> children = new HashMap<>(); + private Collection> edges = new HashSet<>(); + /** * Construct a serialisation graph for the given argumentation framework and serialisation reasoner @@ -65,7 +66,7 @@ public SerialisationGraph(DungTheory theory, SerialisedExtensionReasoner reasone DungTheory reduct = theory.getReduct(ext); SerialisationState node = new SerialisationState(reduct, new Extension<>(ext), reasoner.isTerminal(reduct, ext)); this.add(node); - this.add(new DirectedEdge<>(predecessor, node)); + this.add(new DirectedEdge<>(predecessor, node, set.toString())); predecessor = node; } predecessor = root; @@ -84,7 +85,7 @@ public SerialisationGraph(DungTheory theory, Semantics semantics) { /** Pretty print of the graph. * @return the pretty print of the graph. */ - public String prettyPrint(){ + public String prettyPrint() { StringBuilder output = new StringBuilder(); for (SerialisationState serialisationNode : this) output.append("node(").append(serialisationNode.toString()).append(").\n"); @@ -162,6 +163,7 @@ public boolean add(GeneralEdge edge) { result |= this.add(e.getNodeB()); result |= children.get(e.getNodeA()).add(e.getNodeB()); result |= parents.get(e.getNodeB()).add(e.getNodeA()); + result |= edges.add(e); return result; } @@ -190,19 +192,18 @@ public boolean areAdjacent(SerialisationState a, SerialisationState b) { @Override public GeneralEdge getEdge(SerialisationState a, SerialisationState b) { - return new DirectedEdge<>(a, b); + for (GeneralEdge edge : edges) { + DirectedEdge e = (DirectedEdge) edge; + if (e.getNodeA().equals(a) && e.getNodeB().equals(b)) { + return new DirectedEdge<>(e.getNodeA(), e.getNodeB(), e.getLabel()); + } + } + return null; } @Override public Collection> getEdges() { - Collection> edges = new HashSet<>(); - for (SerialisationState node: this) { - for (SerialisationState succ: this.children.get(node)) { - DirectedEdge edge = new DirectedEdge<>(node, succ); - edges.add(edge); - } - } - return edges; + return new HashSet<>(this.edges); } @Override diff --git a/org-tweetyproject-arg-dung/src/main/java/org/tweetyproject/arg/dung/serialisability/util/AigSerialisationPlotter.java b/org-tweetyproject-arg-dung/src/main/java/org/tweetyproject/arg/dung/serialisability/util/AigSerialisationPlotter.java new file mode 100644 index 000000000..a958e8d06 --- /dev/null +++ b/org-tweetyproject-arg-dung/src/main/java/org/tweetyproject/arg/dung/serialisability/util/AigSerialisationPlotter.java @@ -0,0 +1,54 @@ +package org.tweetyproject.arg.dung.serialisability.util; + +import org.tweetyproject.arg.dung.reasoner.SerialisedExtensionReasoner; +import org.tweetyproject.arg.dung.semantics.Extension; +import org.tweetyproject.arg.dung.semantics.Semantics; +import org.tweetyproject.arg.dung.serialisability.semantics.SerialisationGraph; +import org.tweetyproject.arg.dung.serialisability.semantics.SerialisationState; +import org.tweetyproject.arg.dung.syntax.Argument; +import org.tweetyproject.arg.dung.syntax.DungTheory; +import org.tweetyproject.graphs.util.AigGraphPlotter; + +import java.awt.*; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; + + +public abstract class AigSerialisationPlotter extends AigGraphPlotter { + + public AigSerialisationPlotter(DungTheory graph) { + super(graph); + } + + public static void showSerialisation(DungTheory theory, Semantics semantics) { + SerialisedExtensionReasoner reasoner = new SerialisedExtensionReasoner(semantics); + + SerialisationGraph serialisation = reasoner.getSerialisationGraph(theory); + SerialisationState root = new SerialisationState(theory, new Extension<>(), reasoner.isTerminal(theory, new Extension<>())); + + AigGraphPlotter plotter1 = new AigGraphPlotter<>(theory); + AigGraphPlotter plotter2 = new AigGraphPlotter<>(serialisation); + plotter2.makeLeveled(root); + + Path outputPath = Paths.get("index.html"); + try { + String template = Files.readString(Paths.get(getResource("aiggraph/serialisation.template"))); + String output = String.format(template, + plotter1.write(), plotter2.write(), + getResource("aiggraph/favicon.ico"), getResource("aiggraph/style.css"), + getResource("aiggraph/load-mathjax.js"), getResource("aiggraph/graph-component.js") + ); + + Files.writeString(outputPath, output); + + // show graph in web browser + File htmlFile = new File("index.html"); + Desktop.getDesktop().browse(htmlFile.toURI()); + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/org-tweetyproject-graphs/src/main/java/org/tweetyproject/graphs/util/AigGraphPlotter.java b/org-tweetyproject-graphs/src/main/java/org/tweetyproject/graphs/util/AigGraphPlotter.java new file mode 100644 index 000000000..d89dcba7c --- /dev/null +++ b/org-tweetyproject-graphs/src/main/java/org/tweetyproject/graphs/util/AigGraphPlotter.java @@ -0,0 +1,369 @@ +/* + * This file is part of "TweetyProject", a collection of Java libraries for + * logical aspects of artificial intelligence and knowledge representation. + * + * TweetyProject is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Copyright 2025 The TweetyProject Team + */ +package org.tweetyproject.graphs.util; + +import org.tweetyproject.graphs.*; + +import java.awt.*; +import java.io.File; +import java.io.IOException; +import java.net.URISyntaxException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Implements methods for displaying graphs via the aig-graph-component + * + * @see AIG Graph Component + * + * @author Lars Bengel + */ +public class AigGraphPlotter, N extends Node> { + // General options + protected boolean enableLatex = true; + protected boolean toggleZoom = true; + protected boolean toggleNodePhysics = true; + protected boolean toggleFixedLinkDistance = false; + protected boolean toggleGraphEditingInGUI = true; + protected boolean toggleNodeLabels = true; + protected boolean toggleLinkLabels = false; + + /** internal storage of nodes */ + private Map nodes; + /** internal storage of links */ + private Map,AigLink> links; + + /** + * Initializes a new instance of the graph plotter for the given graph + * @param graph some graph + */ + public AigGraphPlotter(G graph) { + int id = 1; + this.nodes = new HashMap<>(); + this.links = new HashMap<>(); + for (N node : graph.getNodes()) { + if (enableLatex) { + this.nodes.put(node, new AigNode(id++, convert(node.toString()))); + } else { + this.nodes.put(node, new AigNode(id++, node)); + } + } + for (GeneralEdge edge : graph.getEdges()) { + if (edge instanceof DirectedEdge) { + DirectedEdge dirEdge = (DirectedEdge) edge; + links.put(edge, (new AigLink(nodes.get(dirEdge.getNodeA()), nodes.get(dirEdge.getNodeB()), convert(dirEdge.getLabel())))); + } else if (edge instanceof UndirectedEdge) { + throw new IllegalArgumentException("AigGraphWriter currently only supports directed graphs."); + } else throw new IllegalArgumentException("AigGraphWriter currently only supports directed graphs."); + } + + } + + /** + * Creates a JSON-String for the given graph in the aig-graph format + * @param graph some graph + * @return JSON-String representation of the given graph + */ + public static String write(Graph graph) { + AigGraphPlotter plotter = new AigGraphPlotter<>(graph); + return plotter.write(); + } + + /** + * Creates a JSON-String for the graph in the aig-graph format + * @return JSON-String representation of the graph + */ + public String write() { + StringBuilder s = new StringBuilder(); + + // Write Nodes + s.append("{\nnodes: [\n"); + for (AigNode node : this.nodes.values()) { + s.append(node.toJson()).append(",\n"); + } + + // Write Links + s.append("],\nlinks: [\n"); + for (AigLink edge : links.values()) { + s.append(edge.toJson()).append(",\n"); + } + s.append("]\n}\n"); + return s.toString(); + } + + /** + * ensures that the graph nodes are positioned in levels depending on their distance to the given root node + * @param root origin node + */ + public void makeLeveled(N root) { + Graph graph = new DefaultGraph<>(); + for (AigNode node : this.nodes.values()) { + graph.add(node); + } + for (AigLink link : this.links.values()) { + graph.add(link); + } + Stack frontier = new Stack<>(); + frontier.push(this.nodes.get(root)); + int level = 0; + int levelDistance = 300; + while (!frontier.isEmpty()) { + Collection states = new HashSet<>(frontier); + frontier.clear(); + for (AigNode node : states) { + frontier.addAll(graph.getChildren(node)); + node.setX(levelDistance + (level * levelDistance)); + } + level++; + } + this.setNodeFixedPositionX(true); + } + + /** + * Renders the given graph in the web browser via the aig-graph-component + * @param graph some graph + */ + public static void show(Graph graph) { + AigGraphPlotter plotter = new AigGraphPlotter<>(graph); + plotter.show(); + } + + /** + * Renders the graph in the web browser via the aig-graph-component + */ + public void show() { + Path outputPath = Paths.get("index.html"); + + try { + String template = Files.readString(Paths.get(getResource("aiggraph/graph.template"))); + String output = String.format(template, + toggleZoom, toggleNodePhysics, toggleFixedLinkDistance, toggleGraphEditingInGUI, + toggleNodeLabels, toggleLinkLabels, + write(), + getResource("aiggraph/favicon.ico"), getResource("aiggraph/style.css"), + getResource("aiggraph/load-mathjax.js"), getResource("aiggraph/graph-component.js") + ); + + Files.writeString(outputPath, output); + + // show graph in web browser + File htmlFile = new File("index.html"); + Desktop.getDesktop().browse(htmlFile.toURI()); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + // Node options + protected boolean nodeAllowIncomingLinks = true; + protected boolean nodeAllowOutgoingLinks = true; + + + /** + * Utility method that converts a String into a LaTeX-math string + * @param input some string containing LaTeX math-code + * @return the converted string + */ + public static String convert(String input) { + if (input == null) return ""; + + String latexMath = input.replace("{", "\\\\{").replace("}", "\\\\}"); + + Pattern pattern = Pattern.compile("([a-zA-Z])(\\d+)"); // Match letter followed by number(s) + Matcher matcher = pattern.matcher(latexMath); + + // Replace each match with the LaTeX subscript format + StringBuilder result = new StringBuilder(); + while (matcher.find()) { + String replacement = matcher.group(1) + "_{" + matcher.group(2) + "}"; + matcher.appendReplacement(result, replacement); + } + matcher.appendTail(result); + + // Wrap the output in math mode delimiters + return "$" + result + "$"; + } + + /** + * Utility method to extract relative path to resource file + * @param name name of resource file + * @return relative path to resource file + */ + protected static String getResource(String name) { + Path workingDir = Paths.get(System.getProperty("user.dir")); + try { + Path resourcePath = Paths.get(Objects.requireNonNull(AigGraphPlotter.class.getClassLoader().getResource(name)).toURI()); + return workingDir.relativize(resourcePath).toString().replace("\\", "/"); + } catch (URISyntaxException | NullPointerException e) { + throw new RuntimeException(e); + } + } + + public void setEnableLatex(boolean enableLatex) { + this.enableLatex = enableLatex; + } + + public void setToggleZoom(boolean toggleZoom) { + this.toggleZoom = toggleZoom; + } + + public void setToggleNodePhysics(boolean toggleNodePhysics) { + this.toggleNodePhysics = toggleNodePhysics; + } + + public void setToggleFixedLinkDistance(boolean toggleFixedLinkDistance) { + this.toggleFixedLinkDistance = toggleFixedLinkDistance; + } + + public void setToggleGraphEditingInGUI(boolean toggleGraphEditingInGUI) { + this.toggleGraphEditingInGUI = toggleGraphEditingInGUI; + } + + public void setToggleNodeLabels(boolean toggleNodeLabels) { + this.toggleNodeLabels = toggleNodeLabels; + } + + public void setToggleLinkLabels(boolean toggleLinkLabels) { + this.toggleLinkLabels = toggleLinkLabels; + } + + public void setDeletable(N node, boolean nodeDeletable) { + this.nodes.get(node).setDeletable(nodeDeletable); + } + + public void setNodeDeletable(boolean nodeDeletable) { + for (N node : nodes.keySet()) { + this.nodes.get(node).setDeletable(nodeDeletable); + } + } + + public boolean isDeletable(N node) { + return this.nodes.get(node).isDeletable(); + } + + public void setLabelEditable(N node, boolean labelEditable) { + this.nodes.get(node).setLabelEditable(labelEditable); + } + + public void setNodeLabelEditable(boolean labelEditable) { + for (N node : nodes.keySet()) { + this.nodes.get(node).setLabelEditable(labelEditable); + } + } + + public boolean isLabelEditable(N node) { + return this.nodes.get(node).isLabelEditable(); + } + + public void setNodeFixedPositionX(N node, boolean fixedPositionX) { + this.nodes.get(node).setFixedPositionX(fixedPositionX); + } + + public void setNodeFixedPositionX(boolean fixedPositionX) { + for (N node : nodes.keySet()) { + this.nodes.get(node).setFixedPositionX(fixedPositionX); + } + } + + public boolean isNodeFixedPositionX(N node) { + return this.nodes.get(node).isFixedPositionX(); + } + + public void setNodeFixedPositionY(N node, boolean fixedPositionY) { + this.nodes.get(node).setFixedPositionY(fixedPositionY); + } + + public void setNodeFixedPositionY(boolean fixedPositionY) { + for (N node : nodes.keySet()) { + this.nodes.get(node).setFixedPositionY(fixedPositionY); + } + } + + public boolean isNodeFixedPositionY(N node) { + return this.nodes.get(node).isFixedPositionY(); + } + + public void setNodePositionX(N node, int positionX) { + this.nodes.get(node).setX(positionX); + } + + public void setNodePositionY(N node, int positionY) { + this.nodes.get(node).setY(positionY); + } + + public void setDeletable(GeneralEdge link, boolean linkDeletable) { + this.links.get(link).setDeletable(linkDeletable); + } + + public void setLinkDeletable(boolean linkDeletable) { + for (GeneralEdge node : links.keySet()) { + this.links.get(node).setDeletable(linkDeletable); + } + } + + public boolean isDeletable(GeneralEdge link) { + return this.links.get(link).isDeletable(); + } + + public void setLabelEditable(GeneralEdge link, boolean labelEditable) { + this.links.get(link).setLabelEditable(labelEditable); + } + + public void setLinkLabelEditable(boolean labelEditable) { + for (GeneralEdge link : links.keySet()) { + this.links.get(link).setLabelEditable(labelEditable); + } + } + + public boolean isLabelEditable(GeneralEdge link) { + return this.links.get(link).isLabelEditable(); + } + + public void setColor(GeneralEdge link, String color) { + this.links.get(link).setColor(color); + } + + public void setColor(N node, String color) { + this.nodes.get(node).setColor(color); + } + + public void setNodeColor(String color) { + for (N node : nodes.keySet()) { + this.nodes.get(node).setColor(color); + } + } + + public void setLinkColor(String color) { + for (GeneralEdge link : links.keySet()) { + this.links.get(link).setColor(color); + } + } + + public String getColor(GeneralEdge link) { + return this.links.get(link).getColor(); + } + + public String getColor(N node) { + return this.nodes.get(node).getColor(); + } +} diff --git a/org-tweetyproject-graphs/src/main/java/org/tweetyproject/graphs/util/AigLink.java b/org-tweetyproject-graphs/src/main/java/org/tweetyproject/graphs/util/AigLink.java new file mode 100644 index 000000000..67d133586 --- /dev/null +++ b/org-tweetyproject-graphs/src/main/java/org/tweetyproject/graphs/util/AigLink.java @@ -0,0 +1,146 @@ +/* + * This file is part of "TweetyProject", a collection of Java libraries for + * logical aspects of artificial intelligence and knowledge representation. + * + * TweetyProject is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Copyright 2025 The TweetyProject Team + */ +package org.tweetyproject.graphs.util; + +import org.tweetyproject.graphs.DirectedEdge; + +/** + * Representation of a link/edge in a graph. + * Implements and handles all options relevant for the aig-graph-component + * + * @see AIG Graph Component + * + * @author Lars Bengel + */ +public class AigLink extends DirectedEdge { + + /** whether the link is deletable via the GUI */ + private boolean deletable = true; + /** whether the link label is editable via the GUI */ + private boolean labelEditable = true; + + /** the color of this link */ + private String color; + + /** + * Initializes a new link for the given two nodes + * @param source some node + * @param target some node + */ + public AigLink(AigNode source, AigNode target) { + super(source, target); + } + + /** + * Initializes a new link for the given two nodes with the label + * @param source some node + * @param target some node + * @param label some link label + */ + public AigLink(AigNode source, AigNode target, String label) { + super(source, target, label); + } + + /** + * Converts the link to a JSON-String while overriding the options with the given values + * @param deletable whether the link should be deletable + * @param labelEditable whether the link label should be editable + * @return JSON-String representation of this link + */ + public String toJson(boolean deletable, boolean labelEditable) { + this.setDeletable(deletable); + this.setLabelEditable(labelEditable); + return toJson(); + } + + /** + * Converts the link to a JSON-String + * @return JSON-String representation of this link + */ + public String toJson() { + StringBuilder s = new StringBuilder("{"); + + s.append(String.format("sourceId: %s, ", getNodeA().getId())); + s.append(String.format("targetId: %s, ", getNodeB().getId())); + + if (color != null) { + s.append(String.format("color: %s, ", getColor())); + } + + if (getLabel() != null) { + s.append(String.format("label: \"%s\", ", getLabel())); + } else { + s.append("label: \"\", "); + } + + if (!isDeletable()) + s.append("deletable: false, "); + + if (!isLabelEditable()) + s.append("labelEditable: false, "); + + s.append("}"); + return s.toString(); + } + + public boolean isDeletable() { + return deletable; + } + + public void setDeletable(boolean deletable) { + this.deletable = deletable; + } + + public boolean isLabelEditable() { + return labelEditable; + } + + public void setLabelEditable(boolean labelEditable) { + this.labelEditable = labelEditable; + } + + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + @Override + public String toString() { + return getLabel(); + } + + /* (non-Javadoc) + * @see java.lang.Object#equals(java.lang.Object) + */ + public boolean equals(Object o){ + if(!o.getClass().equals(this.getClass())) return false; + if(!this.getNodeA().equals(((AigLink)o).getNodeA())) return false; + return this.getNodeB().equals(((AigLink) o).getNodeB()); + } + + /* (non-Javadoc) + * @see java.lang.Object#hashCode() + */ + public int hashCode(){ + return this.getNodeB().hashCode() + 7 * this.getNodeA().hashCode() + 13 * this.getLabel().hashCode(); + } +} diff --git a/org-tweetyproject-graphs/src/main/java/org/tweetyproject/graphs/util/AigNode.java b/org-tweetyproject-graphs/src/main/java/org/tweetyproject/graphs/util/AigNode.java new file mode 100644 index 000000000..e8b4f45ce --- /dev/null +++ b/org-tweetyproject-graphs/src/main/java/org/tweetyproject/graphs/util/AigNode.java @@ -0,0 +1,223 @@ +/* + * This file is part of "TweetyProject", a collection of Java libraries for + * logical aspects of artificial intelligence and knowledge representation. + * + * TweetyProject is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Copyright 2025 The TweetyProject Team + */ +package org.tweetyproject.graphs.util; + +import org.tweetyproject.graphs.Node; + +/** + * Representation of a node in a graph. + * Implements and handles all options relevant for the aig-graph-component + * + * @see AIG Graph Component + * + * @author Lars Bengel + */ +public class AigNode implements Node, Comparable { + /** unique id of this node */ + private final int id; + /** label of this node */ + private String name; + /** horizontal position of this node (default: random placement) */ + private int x = -1; + /** vertical position of this node (default: random placement) */ + private int y = -1; + /** color of this node */ + private String color; + + /** whether this node is deletable via the GUI */ + private boolean deletable = true; + /** whether the label of this node is editable via the GUI */ + private boolean labelEditable = true; + /** whether the horizontal position of this node should be fixed */ + private boolean fixedPositionX = false; + /** whether the vertical position of this node should be fixed */ + private boolean fixedPositionY = false; + + private boolean allowOutgoingLinks = true; + + /** + * Initializes a new node with the given ID and label + * @param id unique identifier of this node + * @param name some node label + */ + public AigNode(int id, String name) { + this.id = id; + this.name = name; + } + + /** + * Initializes a new node for the given ID and Node + * @param id unique identifier of this node + * @param node some node + */ + public AigNode(int id, Node node) { + this.id = id; + this.name = node.toString(); + } + + /** + * Converts the node to a JSON-String while overriding the options with the given values + * @param deletable whether the node should be deletable + * @param labelEditable whether the node label should be editable + * @param fixedPositionX whether the X position should be fixed + * @param fixedPositionY whether the Y position should be fixed + * @return JSON-String representation of this node + */ + public String toJson(boolean deletable, boolean labelEditable, boolean fixedPositionX, boolean fixedPositionY) { + this.setDeletable(deletable); + this.setLabelEditable(labelEditable); + this.setFixedPositionX(fixedPositionX); + this.setFixedPositionY(fixedPositionY); + return this.toJson(); + } + + /** + * Converts the node to a JSON-String + * @return JSON-String representation of this node + */ + public String toJson() { + StringBuilder s = new StringBuilder("{"); + s.append(String.format("id: %s, ", getId())); + s.append(String.format("label: \"%s\", ", getName())); + + if (getX() != -1) + s.append(String.format("x: %s, ", getX())); + + if (getY() != -1) + s.append(String.format("y: %s, ", getY())); + + if (getColor() != null) + s.append(String.format("color: \"%s\", ", getColor())); + + if (!isDeletable()) + s.append("deletable: false, "); + + if (!isLabelEditable()) + s.append("labelEditable: false, "); + + if (!isAllowOutgoingLinks()) + s.append("allowOutgoingLinks: false, "); + + if (isFixedPositionX() || isFixedPositionY()) { + s.append(String.format("fixedPosition: {x: %s, y: %s}", isFixedPositionX() ? "true" : "false", isFixedPositionY() ? "true" : "false")); + } + + s.append("}"); + return s.toString(); + } + + public int getId() { + return id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getX() { + return x; + } + + public void setX(int x) { + this.x = x; + } + + public int getY() { + return y; + } + + public void setY(int y) { + this.y = y; + } + + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + public boolean isDeletable() { + return deletable; + } + + public void setDeletable(boolean deletable) { + this.deletable = deletable; + } + + public boolean isLabelEditable() { + return labelEditable; + } + + public void setLabelEditable(boolean labelEditable) { + this.labelEditable = labelEditable; + } + + public boolean isAllowOutgoingLinks() { + return allowOutgoingLinks; + } + + public void setAllowOutgoingLinks(boolean allowOutgoingLinks) { + this.allowOutgoingLinks = allowOutgoingLinks; + } + + public boolean isFixedPositionX() { + return fixedPositionX; + } + + public void setFixedPositionX(boolean fixedPositionX) { + this.fixedPositionX = fixedPositionX; + } + + public boolean isFixedPositionY() { + return fixedPositionY; + } + + public void setFixedPositionY(boolean fixedPositionY) { + this.fixedPositionY = fixedPositionY; + } + + @Override + public String toString() { + return getName(); + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof AigNode) { + return getName().equals(((AigNode) obj).getName()); + } + return false; + } + + @Override + public int hashCode() { + return getName().hashCode()*17 + getId(); + } + + @Override + public int compareTo(AigNode o) { + return this.name.compareTo(o.name); + } +} diff --git a/org-tweetyproject-graphs/src/main/resources/aiggraph/favicon.ico b/org-tweetyproject-graphs/src/main/resources/aiggraph/favicon.ico new file mode 100644 index 000000000..c36655d49 Binary files /dev/null and b/org-tweetyproject-graphs/src/main/resources/aiggraph/favicon.ico differ diff --git a/org-tweetyproject-graphs/src/main/resources/aiggraph/graph-component.js b/org-tweetyproject-graphs/src/main/resources/aiggraph/graph-component.js new file mode 100644 index 000000000..b1bbac076 --- /dev/null +++ b/org-tweetyproject-graphs/src/main/resources/aiggraph/graph-component.js @@ -0,0 +1,11211 @@ +var Fu = Object.defineProperty; +var ju = (t, e, n) => e in t ? Fu(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; +var yt = (t, e, n) => ju(t, typeof e != "symbol" ? e + "" : e, n); +/** +* @vue/shared v3.4.21 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +function Yi(t, e) { + const n = new Set(t.split(",")); + return (r) => n.has(r); +} +const bt = {}, un = [], ie = () => { +}, Bu = () => !1, qr = (t) => t.charCodeAt(0) === 111 && t.charCodeAt(1) === 110 && // uppercase letter +(t.charCodeAt(2) > 122 || t.charCodeAt(2) < 97), Ji = (t) => t.startsWith("onUpdate:"), Tt = Object.assign, Qi = (t, e) => { + const n = t.indexOf(e); + n > -1 && t.splice(n, 1); +}, zu = Object.prototype.hasOwnProperty, ft = (t, e) => zu.call(t, e), rt = Array.isArray, cn = (t) => Gr(t) === "[object Map]", Uo = (t) => Gr(t) === "[object Set]", ut = (t) => typeof t == "function", Ct = (t) => typeof t == "string", _n = (t) => typeof t == "symbol", St = (t) => t !== null && typeof t == "object", Wo = (t) => (St(t) || ut(t)) && ut(t.then) && ut(t.catch), Ko = Object.prototype.toString, Gr = (t) => Ko.call(t), Du = (t) => Gr(t).slice(8, -1), Xo = (t) => Gr(t) === "[object Object]", Zi = (t) => Ct(t) && t !== "NaN" && t[0] !== "-" && "" + parseInt(t, 10) === t, Cn = /* @__PURE__ */ Yi( + // the leading comma is intentional so empty string "" is also included + ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" +), Hr = (t) => { + const e = /* @__PURE__ */ Object.create(null); + return (n) => e[n] || (e[n] = t(n)); +}, Vu = /-(\w)/g, ke = Hr((t) => t.replace(Vu, (e, n) => n ? n.toUpperCase() : "")), qu = /\B([A-Z])/g, ue = Hr( + (t) => t.replace(qu, "-$1").toLowerCase() +), Yo = Hr((t) => t.charAt(0).toUpperCase() + t.slice(1)), li = Hr((t) => t ? `on${Yo(t)}` : ""), ze = (t, e) => !Object.is(t, e), ui = (t, e) => { + for (let n = 0; n < t.length; n++) + t[n](e); +}, Nr = (t, e, n) => { + Object.defineProperty(t, e, { + configurable: !0, + enumerable: !1, + value: n + }); +}, Gu = (t) => { + const e = parseFloat(t); + return isNaN(e) ? t : e; +}, $s = (t) => { + const e = Ct(t) ? Number(t) : NaN; + return isNaN(e) ? t : e; +}; +let Os; +const Jo = () => Os || (Os = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {}); +function ts(t) { + if (rt(t)) { + const e = {}; + for (let n = 0; n < t.length; n++) { + const r = t[n], i = Ct(r) ? Ku(r) : ts(r); + if (i) + for (const s in i) + e[s] = i[s]; + } + return e; + } else if (Ct(t) || St(t)) + return t; +} +const Hu = /;(?![^(]*\))/g, Uu = /:([^]+)/, Wu = /\/\*[^]*?\*\//g; +function Ku(t) { + const e = {}; + return t.replace(Wu, "").split(Hu).forEach((n) => { + if (n) { + const r = n.split(Uu); + r.length > 1 && (e[r[0].trim()] = r[1].trim()); + } + }), e; +} +function es(t) { + let e = ""; + if (Ct(t)) + e = t; + else if (rt(t)) + for (let n = 0; n < t.length; n++) { + const r = es(t[n]); + r && (e += r + " "); + } + else if (St(t)) + for (const n in t) + t[n] && (e += n + " "); + return e.trim(); +} +const Xu = "itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly", Yu = /* @__PURE__ */ Yi(Xu); +function Qo(t) { + return !!t || t === ""; +} +const Te = (t) => Ct(t) ? t : t == null ? "" : rt(t) || St(t) && (t.toString === Ko || !ut(t.toString)) ? JSON.stringify(t, Zo, 2) : String(t), Zo = (t, e) => e && e.__v_isRef ? Zo(t, e.value) : cn(e) ? { + [`Map(${e.size})`]: [...e.entries()].reduce( + (n, [r, i], s) => (n[ci(r, s) + " =>"] = i, n), + {} + ) +} : Uo(e) ? { + [`Set(${e.size})`]: [...e.values()].map((n) => ci(n)) +} : _n(e) ? ci(e) : St(e) && !rt(e) && !Xo(e) ? String(e) : e, ci = (t, e = "") => { + var n; + return _n(t) ? `Symbol(${(n = t.description) != null ? n : e})` : t; +}; +/** +* @vue/reactivity v3.4.21 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +let se; +class Ju { + constructor(e = !1) { + this.detached = e, this._active = !0, this.effects = [], this.cleanups = [], this.parent = se, !e && se && (this.index = (se.scopes || (se.scopes = [])).push( + this + ) - 1); + } + get active() { + return this._active; + } + run(e) { + if (this._active) { + const n = se; + try { + return se = this, e(); + } finally { + se = n; + } + } + } + /** + * This should only be called on non-detached scopes + * @internal + */ + on() { + se = this; + } + /** + * This should only be called on non-detached scopes + * @internal + */ + off() { + se = this.parent; + } + stop(e) { + if (this._active) { + let n, r; + for (n = 0, r = this.effects.length; n < r; n++) + this.effects[n].stop(); + for (n = 0, r = this.cleanups.length; n < r; n++) + this.cleanups[n](); + if (this.scopes) + for (n = 0, r = this.scopes.length; n < r; n++) + this.scopes[n].stop(!0); + if (!this.detached && this.parent && !e) { + const i = this.parent.scopes.pop(); + i && i !== this && (this.parent.scopes[this.index] = i, i.index = this.index); + } + this.parent = void 0, this._active = !1; + } + } +} +function Qu(t, e = se) { + e && e.active && e.effects.push(t); +} +function Zu() { + return se; +} +let Ye; +class ns { + constructor(e, n, r, i) { + this.fn = e, this.trigger = n, this.scheduler = r, this.active = !0, this.deps = [], this._dirtyLevel = 4, this._trackId = 0, this._runnings = 0, this._shouldSchedule = !1, this._depsLength = 0, Qu(this, i); + } + get dirty() { + if (this._dirtyLevel === 2 || this._dirtyLevel === 3) { + this._dirtyLevel = 1, en(); + for (let e = 0; e < this._depsLength; e++) { + const n = this.deps[e]; + if (n.computed && (tc(n.computed), this._dirtyLevel >= 4)) + break; + } + this._dirtyLevel === 1 && (this._dirtyLevel = 0), nn(); + } + return this._dirtyLevel >= 4; + } + set dirty(e) { + this._dirtyLevel = e ? 4 : 0; + } + run() { + if (this._dirtyLevel = 0, !this.active) + return this.fn(); + let e = je, n = Ye; + try { + return je = !0, Ye = this, this._runnings++, As(this), this.fn(); + } finally { + Fs(this), this._runnings--, Ye = n, je = e; + } + } + stop() { + var e; + this.active && (As(this), Fs(this), (e = this.onStop) == null || e.call(this), this.active = !1); + } +} +function tc(t) { + return t.value; +} +function As(t) { + t._trackId++, t._depsLength = 0; +} +function Fs(t) { + if (t.deps.length > t._depsLength) { + for (let e = t._depsLength; e < t.deps.length; e++) + tl(t.deps[e], t); + t.deps.length = t._depsLength; + } +} +function tl(t, e) { + const n = t.get(e); + n !== void 0 && e._trackId !== n && (t.delete(e), t.size === 0 && t.cleanup()); +} +let je = !0, Mi = 0; +const el = []; +function en() { + el.push(je), je = !1; +} +function nn() { + const t = el.pop(); + je = t === void 0 ? !0 : t; +} +function rs() { + Mi++; +} +function is() { + for (Mi--; !Mi && Ni.length; ) + Ni.shift()(); +} +function nl(t, e, n) { + if (e.get(t) !== t._trackId) { + e.set(t, t._trackId); + const r = t.deps[t._depsLength]; + r !== e ? (r && tl(r, t), t.deps[t._depsLength++] = e) : t._depsLength++; + } +} +const Ni = []; +function rl(t, e, n) { + rs(); + for (const r of t.keys()) { + let i; + r._dirtyLevel < e && (i ?? (i = t.get(r) === r._trackId)) && (r._shouldSchedule || (r._shouldSchedule = r._dirtyLevel === 0), r._dirtyLevel = e), r._shouldSchedule && (i ?? (i = t.get(r) === r._trackId)) && (r.trigger(), (!r._runnings || r.allowRecurse) && r._dirtyLevel !== 2 && (r._shouldSchedule = !1, r.scheduler && Ni.push(r.scheduler))); + } + is(); +} +const il = (t, e) => { + const n = /* @__PURE__ */ new Map(); + return n.cleanup = t, n.computed = e, n; +}, Ri = /* @__PURE__ */ new WeakMap(), Je = Symbol(""), Ti = Symbol(""); +function Wt(t, e, n) { + if (je && Ye) { + let r = Ri.get(t); + r || Ri.set(t, r = /* @__PURE__ */ new Map()); + let i = r.get(n); + i || r.set(n, i = il(() => r.delete(n))), nl( + Ye, + i + ); + } +} +function Me(t, e, n, r, i, s) { + const o = Ri.get(t); + if (!o) + return; + let l = []; + if (e === "clear") + l = [...o.values()]; + else if (n === "length" && rt(t)) { + const u = Number(r); + o.forEach((c, a) => { + (a === "length" || !_n(a) && a >= u) && l.push(c); + }); + } else + switch (n !== void 0 && l.push(o.get(n)), e) { + case "add": + rt(t) ? Zi(n) && l.push(o.get("length")) : (l.push(o.get(Je)), cn(t) && l.push(o.get(Ti))); + break; + case "delete": + rt(t) || (l.push(o.get(Je)), cn(t) && l.push(o.get(Ti))); + break; + case "set": + cn(t) && l.push(o.get(Je)); + break; + } + rs(); + for (const u of l) + u && rl( + u, + 4 + ); + is(); +} +const ec = /* @__PURE__ */ Yi("__proto__,__v_isRef,__isVue"), sl = new Set( + /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((t) => t !== "arguments" && t !== "caller").map((t) => Symbol[t]).filter(_n) +), js = /* @__PURE__ */ nc(); +function nc() { + const t = {}; + return ["includes", "indexOf", "lastIndexOf"].forEach((e) => { + t[e] = function(...n) { + const r = dt(this); + for (let s = 0, o = this.length; s < o; s++) + Wt(r, "get", s + ""); + const i = r[e](...n); + return i === -1 || i === !1 ? r[e](...n.map(dt)) : i; + }; + }), ["push", "pop", "shift", "unshift", "splice"].forEach((e) => { + t[e] = function(...n) { + en(), rs(); + const r = dt(this)[e].apply(this, n); + return is(), nn(), r; + }; + }), t; +} +function rc(t) { + const e = dt(this); + return Wt(e, "has", t), e.hasOwnProperty(t); +} +class ol { + constructor(e = !1, n = !1) { + this._isReadonly = e, this._isShallow = n; + } + get(e, n, r) { + const i = this._isReadonly, s = this._isShallow; + if (n === "__v_isReactive") + return !i; + if (n === "__v_isReadonly") + return i; + if (n === "__v_isShallow") + return s; + if (n === "__v_raw") + return r === (i ? s ? mc : al : s ? cl : ul).get(e) || // receiver is not the reactive proxy, but has the same prototype + // this means the reciever is a user proxy of the reactive proxy + Object.getPrototypeOf(e) === Object.getPrototypeOf(r) ? e : void 0; + const o = rt(e); + if (!i) { + if (o && ft(js, n)) + return Reflect.get(js, n, r); + if (n === "hasOwnProperty") + return rc; + } + const l = Reflect.get(e, n, r); + return (_n(n) ? sl.has(n) : ec(n)) || (i || Wt(e, "get", n), s) ? l : Kt(l) ? o && Zi(n) ? l : l.value : St(l) ? i ? fl(l) : Wr(l) : l; + } +} +class ll extends ol { + constructor(e = !1) { + super(!1, e); + } + set(e, n, r, i) { + let s = e[n]; + if (!this._isShallow) { + const u = gn(s); + if (!Rr(r) && !gn(r) && (s = dt(s), r = dt(r)), !rt(e) && Kt(s) && !Kt(r)) + return u ? !1 : (s.value = r, !0); + } + const o = rt(e) && Zi(n) ? Number(n) < e.length : ft(e, n), l = Reflect.set(e, n, r, i); + return e === dt(i) && (o ? ze(r, s) && Me(e, "set", n, r) : Me(e, "add", n, r)), l; + } + deleteProperty(e, n) { + const r = ft(e, n); + e[n]; + const i = Reflect.deleteProperty(e, n); + return i && r && Me(e, "delete", n, void 0), i; + } + has(e, n) { + const r = Reflect.has(e, n); + return (!_n(n) || !sl.has(n)) && Wt(e, "has", n), r; + } + ownKeys(e) { + return Wt( + e, + "iterate", + rt(e) ? "length" : Je + ), Reflect.ownKeys(e); + } +} +class ic extends ol { + constructor(e = !1) { + super(!0, e); + } + set(e, n) { + return !0; + } + deleteProperty(e, n) { + return !0; + } +} +const sc = /* @__PURE__ */ new ll(), oc = /* @__PURE__ */ new ic(), lc = /* @__PURE__ */ new ll( + !0 +), ss = (t) => t, Ur = (t) => Reflect.getPrototypeOf(t); +function tr(t, e, n = !1, r = !1) { + t = t.__v_raw; + const i = dt(t), s = dt(e); + n || (ze(e, s) && Wt(i, "get", e), Wt(i, "get", s)); + const { has: o } = Ur(i), l = r ? ss : n ? us : An; + if (o.call(i, e)) + return l(t.get(e)); + if (o.call(i, s)) + return l(t.get(s)); + t !== i && t.get(e); +} +function er(t, e = !1) { + const n = this.__v_raw, r = dt(n), i = dt(t); + return e || (ze(t, i) && Wt(r, "has", t), Wt(r, "has", i)), t === i ? n.has(t) : n.has(t) || n.has(i); +} +function nr(t, e = !1) { + return t = t.__v_raw, !e && Wt(dt(t), "iterate", Je), Reflect.get(t, "size", t); +} +function Bs(t) { + t = dt(t); + const e = dt(this); + return Ur(e).has.call(e, t) || (e.add(t), Me(e, "add", t, t)), this; +} +function zs(t, e) { + e = dt(e); + const n = dt(this), { has: r, get: i } = Ur(n); + let s = r.call(n, t); + s || (t = dt(t), s = r.call(n, t)); + const o = i.call(n, t); + return n.set(t, e), s ? ze(e, o) && Me(n, "set", t, e) : Me(n, "add", t, e), this; +} +function Ds(t) { + const e = dt(this), { has: n, get: r } = Ur(e); + let i = n.call(e, t); + i || (t = dt(t), i = n.call(e, t)), r && r.call(e, t); + const s = e.delete(t); + return i && Me(e, "delete", t, void 0), s; +} +function Vs() { + const t = dt(this), e = t.size !== 0, n = t.clear(); + return e && Me(t, "clear", void 0, void 0), n; +} +function rr(t, e) { + return function(r, i) { + const s = this, o = s.__v_raw, l = dt(o), u = e ? ss : t ? us : An; + return !t && Wt(l, "iterate", Je), o.forEach((c, a) => r.call(i, u(c), u(a), s)); + }; +} +function ir(t, e, n) { + return function(...r) { + const i = this.__v_raw, s = dt(i), o = cn(s), l = t === "entries" || t === Symbol.iterator && o, u = t === "keys" && o, c = i[t](...r), a = n ? ss : e ? us : An; + return !e && Wt( + s, + "iterate", + u ? Ti : Je + ), { + // iterator protocol + next() { + const { value: f, done: h } = c.next(); + return h ? { value: f, done: h } : { + value: l ? [a(f[0]), a(f[1])] : a(f), + done: h + }; + }, + // iterable protocol + [Symbol.iterator]() { + return this; + } + }; + }; +} +function Ce(t) { + return function(...e) { + return t === "delete" ? !1 : t === "clear" ? void 0 : this; + }; +} +function uc() { + const t = { + get(s) { + return tr(this, s); + }, + get size() { + return nr(this); + }, + has: er, + add: Bs, + set: zs, + delete: Ds, + clear: Vs, + forEach: rr(!1, !1) + }, e = { + get(s) { + return tr(this, s, !1, !0); + }, + get size() { + return nr(this); + }, + has: er, + add: Bs, + set: zs, + delete: Ds, + clear: Vs, + forEach: rr(!1, !0) + }, n = { + get(s) { + return tr(this, s, !0); + }, + get size() { + return nr(this, !0); + }, + has(s) { + return er.call(this, s, !0); + }, + add: Ce("add"), + set: Ce("set"), + delete: Ce("delete"), + clear: Ce("clear"), + forEach: rr(!0, !1) + }, r = { + get(s) { + return tr(this, s, !0, !0); + }, + get size() { + return nr(this, !0); + }, + has(s) { + return er.call(this, s, !0); + }, + add: Ce("add"), + set: Ce("set"), + delete: Ce("delete"), + clear: Ce("clear"), + forEach: rr(!0, !0) + }; + return ["keys", "values", "entries", Symbol.iterator].forEach((s) => { + t[s] = ir( + s, + !1, + !1 + ), n[s] = ir( + s, + !0, + !1 + ), e[s] = ir( + s, + !1, + !0 + ), r[s] = ir( + s, + !0, + !0 + ); + }), [ + t, + n, + e, + r + ]; +} +const [ + cc, + ac, + fc, + hc +] = /* @__PURE__ */ uc(); +function os(t, e) { + const n = e ? t ? hc : fc : t ? ac : cc; + return (r, i, s) => i === "__v_isReactive" ? !t : i === "__v_isReadonly" ? t : i === "__v_raw" ? r : Reflect.get( + ft(n, i) && i in r ? n : r, + i, + s + ); +} +const dc = { + get: /* @__PURE__ */ os(!1, !1) +}, pc = { + get: /* @__PURE__ */ os(!1, !0) +}, gc = { + get: /* @__PURE__ */ os(!0, !1) +}, ul = /* @__PURE__ */ new WeakMap(), cl = /* @__PURE__ */ new WeakMap(), al = /* @__PURE__ */ new WeakMap(), mc = /* @__PURE__ */ new WeakMap(); +function wc(t) { + switch (t) { + case "Object": + case "Array": + return 1; + case "Map": + case "Set": + case "WeakMap": + case "WeakSet": + return 2; + default: + return 0; + } +} +function yc(t) { + return t.__v_skip || !Object.isExtensible(t) ? 0 : wc(Du(t)); +} +function Wr(t) { + return gn(t) ? t : ls( + t, + !1, + sc, + dc, + ul + ); +} +function _c(t) { + return ls( + t, + !1, + lc, + pc, + cl + ); +} +function fl(t) { + return ls( + t, + !0, + oc, + gc, + al + ); +} +function ls(t, e, n, r, i) { + if (!St(t) || t.__v_raw && !(e && t.__v_isReactive)) + return t; + const s = i.get(t); + if (s) + return s; + const o = yc(t); + if (o === 0) + return t; + const l = new Proxy( + t, + o === 2 ? r : n + ); + return i.set(t, l), l; +} +function an(t) { + return gn(t) ? an(t.__v_raw) : !!(t && t.__v_isReactive); +} +function gn(t) { + return !!(t && t.__v_isReadonly); +} +function Rr(t) { + return !!(t && t.__v_isShallow); +} +function hl(t) { + return an(t) || gn(t); +} +function dt(t) { + const e = t && t.__v_raw; + return e ? dt(e) : t; +} +function dl(t) { + return Object.isExtensible(t) && Nr(t, "__v_skip", !0), t; +} +const An = (t) => St(t) ? Wr(t) : t, us = (t) => St(t) ? fl(t) : t; +class pl { + constructor(e, n, r, i) { + this.getter = e, this._setter = n, this.dep = void 0, this.__v_isRef = !0, this.__v_isReadonly = !1, this.effect = new ns( + () => e(this._value), + () => mr( + this, + this.effect._dirtyLevel === 2 ? 2 : 3 + ) + ), this.effect.computed = this, this.effect.active = this._cacheable = !i, this.__v_isReadonly = r; + } + get value() { + const e = dt(this); + return (!e._cacheable || e.effect.dirty) && ze(e._value, e._value = e.effect.run()) && mr(e, 4), gl(e), e.effect._dirtyLevel >= 2 && mr(e, 2), e._value; + } + set value(e) { + this._setter(e); + } + // #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x + get _dirty() { + return this.effect.dirty; + } + set _dirty(e) { + this.effect.dirty = e; + } + // #endregion +} +function vc(t, e, n = !1) { + let r, i; + const s = ut(t); + return s ? (r = t, i = ie) : (r = t.get, i = t.set), new pl(r, i, s || !i, n); +} +function gl(t) { + var e; + je && Ye && (t = dt(t), nl( + Ye, + (e = t.dep) != null ? e : t.dep = il( + () => t.dep = void 0, + t instanceof pl ? t : void 0 + ) + )); +} +function mr(t, e = 4, n) { + t = dt(t); + const r = t.dep; + r && rl( + r, + e + ); +} +function Kt(t) { + return !!(t && t.__v_isRef === !0); +} +function qs(t) { + return bc(t, !1); +} +function bc(t, e) { + return Kt(t) ? t : new xc(t, e); +} +class xc { + constructor(e, n) { + this.__v_isShallow = n, this.dep = void 0, this.__v_isRef = !0, this._rawValue = n ? e : dt(e), this._value = n ? e : An(e); + } + get value() { + return gl(this), this._value; + } + set value(e) { + const n = this.__v_isShallow || Rr(e) || gn(e); + e = n ? e : dt(e), ze(e, this._rawValue) && (this._rawValue = e, this._value = n ? e : An(e), mr(this, 4)); + } +} +function Tr(t) { + return Kt(t) ? t.value : t; +} +const Ec = { + get: (t, e, n) => Tr(Reflect.get(t, e, n)), + set: (t, e, n, r) => { + const i = t[e]; + return Kt(i) && !Kt(n) ? (i.value = n, !0) : Reflect.set(t, e, n, r); + } +}; +function ml(t) { + return an(t) ? t : new Proxy(t, Ec); +} +/** +* @vue/runtime-core v3.4.21 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/ +function Be(t, e, n, r) { + try { + return r ? t(...r) : t(); + } catch (i) { + Kr(i, e, n); + } +} +function fe(t, e, n, r) { + if (ut(t)) { + const s = Be(t, e, n, r); + return s && Wo(s) && s.catch((o) => { + Kr(o, e, n); + }), s; + } + const i = []; + for (let s = 0; s < t.length; s++) + i.push(fe(t[s], e, n, r)); + return i; +} +function Kr(t, e, n, r = !0) { + const i = e ? e.vnode : null; + if (e) { + let s = e.parent; + const o = e.proxy, l = `https://vuejs.org/error-reference/#runtime-${n}`; + for (; s; ) { + const c = s.ec; + if (c) { + for (let a = 0; a < c.length; a++) + if (c[a](t, o, l) === !1) + return; + } + s = s.parent; + } + const u = e.appContext.config.errorHandler; + if (u) { + Be( + u, + null, + 10, + [t, o, l] + ); + return; + } + } + Sc(t, n, i, r); +} +function Sc(t, e, n, r = !0) { + console.error(t); +} +let Fn = !1, Ci = !1; +const Lt = []; +let ye = 0; +const fn = []; +let $e = null, We = 0; +const wl = /* @__PURE__ */ Promise.resolve(); +let cs = null; +function yl(t) { + const e = cs || wl; + return t ? e.then(this ? t.bind(this) : t) : e; +} +function kc(t) { + let e = ye + 1, n = Lt.length; + for (; e < n; ) { + const r = e + n >>> 1, i = Lt[r], s = jn(i); + s < t || s === t && i.pre ? e = r + 1 : n = r; + } + return e; +} +function as(t) { + (!Lt.length || !Lt.includes( + t, + Fn && t.allowRecurse ? ye + 1 : ye + )) && (t.id == null ? Lt.push(t) : Lt.splice(kc(t.id), 0, t), _l()); +} +function _l() { + !Fn && !Ci && (Ci = !0, cs = wl.then(bl)); +} +function Mc(t) { + const e = Lt.indexOf(t); + e > ye && Lt.splice(e, 1); +} +function Nc(t) { + rt(t) ? fn.push(...t) : (!$e || !$e.includes( + t, + t.allowRecurse ? We + 1 : We + )) && fn.push(t), _l(); +} +function Gs(t, e, n = Fn ? ye + 1 : 0) { + for (; n < Lt.length; n++) { + const r = Lt[n]; + if (r && r.pre) { + if (t && r.id !== t.uid) + continue; + Lt.splice(n, 1), n--, r(); + } + } +} +function vl(t) { + if (fn.length) { + const e = [...new Set(fn)].sort( + (n, r) => jn(n) - jn(r) + ); + if (fn.length = 0, $e) { + $e.push(...e); + return; + } + for ($e = e, We = 0; We < $e.length; We++) + $e[We](); + $e = null, We = 0; + } +} +const jn = (t) => t.id == null ? 1 / 0 : t.id, Rc = (t, e) => { + const n = jn(t) - jn(e); + if (n === 0) { + if (t.pre && !e.pre) + return -1; + if (e.pre && !t.pre) + return 1; + } + return n; +}; +function bl(t) { + Ci = !1, Fn = !0, Lt.sort(Rc); + try { + for (ye = 0; ye < Lt.length; ye++) { + const e = Lt[ye]; + e && e.active !== !1 && Be(e, null, 14); + } + } finally { + ye = 0, Lt.length = 0, vl(), Fn = !1, cs = null, (Lt.length || fn.length) && bl(); + } +} +function Tc(t, e, ...n) { + if (t.isUnmounted) + return; + const r = t.vnode.props || bt; + let i = n; + const s = e.startsWith("update:"), o = s && e.slice(7); + if (o && o in r) { + const a = `${o === "modelValue" ? "model" : o}Modifiers`, { number: f, trim: h } = r[a] || bt; + h && (i = n.map((p) => Ct(p) ? p.trim() : p)), f && (i = n.map(Gu)); + } + let l, u = r[l = li(e)] || // also try camelCase event handler (#2249) + r[l = li(ke(e))]; + !u && s && (u = r[l = li(ue(e))]), u && fe( + u, + t, + 6, + i + ); + const c = r[l + "Once"]; + if (c) { + if (!t.emitted) + t.emitted = {}; + else if (t.emitted[l]) + return; + t.emitted[l] = !0, fe( + c, + t, + 6, + i + ); + } +} +function xl(t, e, n = !1) { + const r = e.emitsCache, i = r.get(t); + if (i !== void 0) + return i; + const s = t.emits; + let o = {}, l = !1; + if (!ut(t)) { + const u = (c) => { + const a = xl(c, e, !0); + a && (l = !0, Tt(o, a)); + }; + !n && e.mixins.length && e.mixins.forEach(u), t.extends && u(t.extends), t.mixins && t.mixins.forEach(u); + } + return !s && !l ? (St(t) && r.set(t, null), null) : (rt(s) ? s.forEach((u) => o[u] = null) : Tt(o, s), St(t) && r.set(t, o), o); +} +function Xr(t, e) { + return !t || !qr(e) ? !1 : (e = e.slice(2).replace(/Once$/, ""), ft(t, e[0].toLowerCase() + e.slice(1)) || ft(t, ue(e)) || ft(t, e)); +} +let Jt = null, El = null; +function Cr(t) { + const e = Jt; + return Jt = t, El = t && t.type.__scopeId || null, e; +} +function Cc(t, e = Jt, n) { + if (!e || t._n) + return t; + const r = (...i) => { + r._d && eo(-1); + const s = Cr(e); + let o; + try { + o = t(...i); + } finally { + Cr(s), r._d && eo(1); + } + return o; + }; + return r._n = !0, r._c = !0, r._d = !0, r; +} +function ai(t) { + const { + type: e, + vnode: n, + proxy: r, + withProxy: i, + props: s, + propsOptions: [o], + slots: l, + attrs: u, + emit: c, + render: a, + renderCache: f, + data: h, + setupState: p, + ctx: w, + inheritAttrs: _ + } = t; + let v, d; + const T = Cr(t); + try { + if (n.shapeFlag & 4) { + const y = i || r, k = y; + v = me( + a.call( + k, + y, + f, + s, + p, + h, + w + ) + ), d = u; + } else { + const y = e; + v = me( + y.length > 1 ? y( + s, + { attrs: u, slots: l, emit: c } + ) : y( + s, + null + /* we know it doesn't need it */ + ) + ), d = e.props ? u : Pc(u); + } + } catch (y) { + In.length = 0, Kr(y, t, 1), v = _e(Bn); + } + let P = v; + if (d && _ !== !1) { + const y = Object.keys(d), { shapeFlag: k } = P; + y.length && k & 7 && (o && y.some(Ji) && (d = Lc( + d, + o + )), P = mn(P, d)); + } + return n.dirs && (P = mn(P), P.dirs = P.dirs ? P.dirs.concat(n.dirs) : n.dirs), n.transition && (P.transition = n.transition), v = P, Cr(T), v; +} +const Pc = (t) => { + let e; + for (const n in t) + (n === "class" || n === "style" || qr(n)) && ((e || (e = {}))[n] = t[n]); + return e; +}, Lc = (t, e) => { + const n = {}; + for (const r in t) + (!Ji(r) || !(r.slice(9) in e)) && (n[r] = t[r]); + return n; +}; +function Ic(t, e, n) { + const { props: r, children: i, component: s } = t, { props: o, children: l, patchFlag: u } = e, c = s.emitsOptions; + if (e.dirs || e.transition) + return !0; + if (n && u >= 0) { + if (u & 1024) + return !0; + if (u & 16) + return r ? Hs(r, o, c) : !!o; + if (u & 8) { + const a = e.dynamicProps; + for (let f = 0; f < a.length; f++) { + const h = a[f]; + if (o[h] !== r[h] && !Xr(c, h)) + return !0; + } + } + } else + return (i || l) && (!l || !l.$stable) ? !0 : r === o ? !1 : r ? o ? Hs(r, o, c) : !0 : !!o; + return !1; +} +function Hs(t, e, n) { + const r = Object.keys(e); + if (r.length !== Object.keys(t).length) + return !0; + for (let i = 0; i < r.length; i++) { + const s = r[i]; + if (e[s] !== t[s] && !Xr(n, s)) + return !0; + } + return !1; +} +function $c({ vnode: t, parent: e }, n) { + for (; e; ) { + const r = e.subTree; + if (r.suspense && r.suspense.activeBranch === t && (r.el = t.el), r === t) + (t = e.vnode).el = n, e = e.parent; + else + break; + } +} +const Oc = Symbol.for("v-ndc"), Ac = (t) => t.__isSuspense; +function Fc(t, e) { + e && e.pendingBranch ? rt(t) ? e.effects.push(...t) : e.effects.push(t) : Nc(t); +} +const jc = Symbol.for("v-scx"), Bc = () => _r(jc), sr = {}; +function fi(t, e, n) { + return Sl(t, e, n); +} +function Sl(t, e, { + immediate: n, + deep: r, + flush: i, + once: s, + onTrack: o, + onTrigger: l +} = bt) { + if (e && s) { + const L = e; + e = (...z) => { + L(...z), k(); + }; + } + const u = Ft, c = (L) => r === !0 ? L : ( + // for deep: false, only traverse root-level properties + Ke(L, r === !1 ? 1 : void 0) + ); + let a, f = !1, h = !1; + if (Kt(t) ? (a = () => t.value, f = Rr(t)) : an(t) ? (a = () => c(t), f = !0) : rt(t) ? (h = !0, f = t.some((L) => an(L) || Rr(L)), a = () => t.map((L) => { + if (Kt(L)) + return L.value; + if (an(L)) + return c(L); + if (ut(L)) + return Be(L, u, 2); + })) : ut(t) ? e ? a = () => Be(t, u, 2) : a = () => (p && p(), fe( + t, + u, + 3, + [w] + )) : a = ie, e && r) { + const L = a; + a = () => Ke(L()); + } + let p, w = (L) => { + p = P.onStop = () => { + Be(L, u, 4), p = P.onStop = void 0; + }; + }, _; + if (Zr) + if (w = ie, e ? n && fe(e, u, 3, [ + a(), + h ? [] : void 0, + w + ]) : a(), i === "sync") { + const L = Bc(); + _ = L.__watcherHandles || (L.__watcherHandles = []); + } else + return ie; + let v = h ? new Array(t.length).fill(sr) : sr; + const d = () => { + if (!(!P.active || !P.dirty)) + if (e) { + const L = P.run(); + (r || f || (h ? L.some((z, G) => ze(z, v[G])) : ze(L, v))) && (p && p(), fe(e, u, 3, [ + L, + // pass undefined as the old value when it's changed for the first time + v === sr ? void 0 : h && v[0] === sr ? [] : v, + w + ]), v = L); + } else + P.run(); + }; + d.allowRecurse = !!e; + let T; + i === "sync" ? T = d : i === "post" ? T = () => Gt(d, u && u.suspense) : (d.pre = !0, u && (d.id = u.uid), T = () => as(d)); + const P = new ns(a, ie, T), y = Zu(), k = () => { + P.stop(), y && Qi(y.effects, P); + }; + return e ? n ? d() : v = P.run() : i === "post" ? Gt( + P.run.bind(P), + u && u.suspense + ) : P.run(), _ && _.push(k), k; +} +function zc(t, e, n) { + const r = this.proxy, i = Ct(t) ? t.includes(".") ? kl(r, t) : () => r[t] : t.bind(r, r); + let s; + ut(e) ? s = e : (s = e.handler, n = e); + const o = Wn(this), l = Sl(i, s.bind(r), n); + return o(), l; +} +function kl(t, e) { + const n = e.split("."); + return () => { + let r = t; + for (let i = 0; i < n.length && r; i++) + r = r[n[i]]; + return r; + }; +} +function Ke(t, e, n = 0, r) { + if (!St(t) || t.__v_skip) + return t; + if (e && e > 0) { + if (n >= e) + return t; + n++; + } + if (r = r || /* @__PURE__ */ new Set(), r.has(t)) + return t; + if (r.add(t), Kt(t)) + Ke(t.value, e, n, r); + else if (rt(t)) + for (let i = 0; i < t.length; i++) + Ke(t[i], e, n, r); + else if (Uo(t) || cn(t)) + t.forEach((i) => { + Ke(i, e, n, r); + }); + else if (Xo(t)) + for (const i in t) + Ke(t[i], e, n, r); + return t; +} +function wr(t, e) { + if (Jt === null) + return t; + const n = ti(Jt) || Jt.proxy, r = t.dirs || (t.dirs = []); + for (let i = 0; i < e.length; i++) { + let [s, o, l, u = bt] = e[i]; + s && (ut(s) && (s = { + mounted: s, + updated: s + }), s.deep && Ke(o), r.push({ + dir: s, + instance: n, + value: o, + oldValue: void 0, + arg: l, + modifiers: u + })); + } + return t; +} +function qe(t, e, n, r) { + const i = t.dirs, s = e && e.dirs; + for (let o = 0; o < i.length; o++) { + const l = i[o]; + s && (l.oldValue = s[o].value); + let u = l.dir[r]; + u && (en(), fe(u, n, 8, [ + t.el, + l, + t, + e + ]), nn()); + } +} +/*! #__NO_SIDE_EFFECTS__ */ +// @__NO_SIDE_EFFECTS__ +function fs(t, e) { + return ut(t) ? ( + // #8326: extend call and options.name access are considered side-effects + // by Rollup, so we have to wrap it in a pure-annotated IIFE. + Tt({ name: t.name }, e, { setup: t }) + ) : t; +} +const yr = (t) => !!t.type.__asyncLoader, Ml = (t) => t.type.__isKeepAlive; +function Dc(t, e) { + Nl(t, "a", e); +} +function Vc(t, e) { + Nl(t, "da", e); +} +function Nl(t, e, n = Ft) { + const r = t.__wdc || (t.__wdc = () => { + let i = n; + for (; i; ) { + if (i.isDeactivated) + return; + i = i.parent; + } + return t(); + }); + if (Yr(e, r, n), n) { + let i = n.parent; + for (; i && i.parent; ) + Ml(i.parent.vnode) && qc(r, e, n, i), i = i.parent; + } +} +function qc(t, e, n, r) { + const i = Yr( + e, + t, + r, + !0 + /* prepend */ + ); + hs(() => { + Qi(r[e], i); + }, n); +} +function Yr(t, e, n = Ft, r = !1) { + if (n) { + const i = n[t] || (n[t] = []), s = e.__weh || (e.__weh = (...o) => { + if (n.isUnmounted) + return; + en(); + const l = Wn(n), u = fe(e, n, t, o); + return l(), nn(), u; + }); + return r ? i.unshift(s) : i.push(s), s; + } +} +const Re = (t) => (e, n = Ft) => ( + // post-create lifecycle registrations are noops during SSR (except for serverPrefetch) + (!Zr || t === "sp") && Yr(t, (...r) => e(...r), n) +), Rl = Re("bm"), Tl = Re("m"), Gc = Re("bu"), Hc = Re("u"), Uc = Re("bum"), hs = Re("um"), Wc = Re("sp"), Kc = Re( + "rtg" +), Xc = Re( + "rtc" +); +function Yc(t, e = Ft) { + Yr("ec", t, e); +} +function Us(t, e, n, r) { + let i; + const s = n; + if (rt(t) || Ct(t)) { + i = new Array(t.length); + for (let o = 0, l = t.length; o < l; o++) + i[o] = e(t[o], o, void 0, s); + } else if (typeof t == "number") { + i = new Array(t); + for (let o = 0; o < t; o++) + i[o] = e(o + 1, o, void 0, s); + } else if (St(t)) + if (t[Symbol.iterator]) + i = Array.from( + t, + (o, l) => e(o, l, void 0, s) + ); + else { + const o = Object.keys(t); + i = new Array(o.length); + for (let l = 0, u = o.length; l < u; l++) { + const c = o[l]; + i[l] = e(t[c], c, l, s); + } + } + else + i = []; + return i; +} +const Pi = (t) => t ? zl(t) ? ti(t) || t.proxy : Pi(t.parent) : null, Pn = ( + // Move PURE marker to new line to workaround compiler discarding it + // due to type annotation + /* @__PURE__ */ Tt(/* @__PURE__ */ Object.create(null), { + $: (t) => t, + $el: (t) => t.vnode.el, + $data: (t) => t.data, + $props: (t) => t.props, + $attrs: (t) => t.attrs, + $slots: (t) => t.slots, + $refs: (t) => t.refs, + $parent: (t) => Pi(t.parent), + $root: (t) => Pi(t.root), + $emit: (t) => t.emit, + $options: (t) => ds(t), + $forceUpdate: (t) => t.f || (t.f = () => { + t.effect.dirty = !0, as(t.update); + }), + $nextTick: (t) => t.n || (t.n = yl.bind(t.proxy)), + $watch: (t) => zc.bind(t) + }) +), hi = (t, e) => t !== bt && !t.__isScriptSetup && ft(t, e), Jc = { + get({ _: t }, e) { + const { ctx: n, setupState: r, data: i, props: s, accessCache: o, type: l, appContext: u } = t; + let c; + if (e[0] !== "$") { + const p = o[e]; + if (p !== void 0) + switch (p) { + case 1: + return r[e]; + case 2: + return i[e]; + case 4: + return n[e]; + case 3: + return s[e]; + } + else { + if (hi(r, e)) + return o[e] = 1, r[e]; + if (i !== bt && ft(i, e)) + return o[e] = 2, i[e]; + if ( + // only cache other properties when instance has declared (thus stable) + // props + (c = t.propsOptions[0]) && ft(c, e) + ) + return o[e] = 3, s[e]; + if (n !== bt && ft(n, e)) + return o[e] = 4, n[e]; + Li && (o[e] = 0); + } + } + const a = Pn[e]; + let f, h; + if (a) + return e === "$attrs" && Wt(t, "get", e), a(t); + if ( + // css module (injected by vue-loader) + (f = l.__cssModules) && (f = f[e]) + ) + return f; + if (n !== bt && ft(n, e)) + return o[e] = 4, n[e]; + if ( + // global properties + h = u.config.globalProperties, ft(h, e) + ) + return h[e]; + }, + set({ _: t }, e, n) { + const { data: r, setupState: i, ctx: s } = t; + return hi(i, e) ? (i[e] = n, !0) : r !== bt && ft(r, e) ? (r[e] = n, !0) : ft(t.props, e) || e[0] === "$" && e.slice(1) in t ? !1 : (s[e] = n, !0); + }, + has({ + _: { data: t, setupState: e, accessCache: n, ctx: r, appContext: i, propsOptions: s } + }, o) { + let l; + return !!n[o] || t !== bt && ft(t, o) || hi(e, o) || (l = s[0]) && ft(l, o) || ft(r, o) || ft(Pn, o) || ft(i.config.globalProperties, o); + }, + defineProperty(t, e, n) { + return n.get != null ? t._.accessCache[e] = 0 : ft(n, "value") && this.set(t, e, n.value, null), Reflect.defineProperty(t, e, n); + } +}; +function Ws(t) { + return rt(t) ? t.reduce( + (e, n) => (e[n] = null, e), + {} + ) : t; +} +let Li = !0; +function Qc(t) { + const e = ds(t), n = t.proxy, r = t.ctx; + Li = !1, e.beforeCreate && Ks(e.beforeCreate, t, "bc"); + const { + // state + data: i, + computed: s, + methods: o, + watch: l, + provide: u, + inject: c, + // lifecycle + created: a, + beforeMount: f, + mounted: h, + beforeUpdate: p, + updated: w, + activated: _, + deactivated: v, + beforeDestroy: d, + beforeUnmount: T, + destroyed: P, + unmounted: y, + render: k, + renderTracked: L, + renderTriggered: z, + errorCaptured: G, + serverPrefetch: Q, + // public API + expose: X, + inheritAttrs: et, + // assets + components: ot, + directives: U, + filters: x + } = e; + if (c && Zc(c, r, null), o) + for (const j in o) { + const B = o[j]; + ut(B) && (r[j] = B.bind(n)); + } + if (i) { + const j = i.call(n, n); + St(j) && (t.data = Wr(j)); + } + if (Li = !0, s) + for (const j in s) { + const B = s[j], Y = ut(B) ? B.bind(n, n) : ut(B.get) ? B.get.bind(n, n) : ie, J = !ut(B) && ut(B.set) ? B.set.bind(n) : ie, it = Fi({ + get: Y, + set: J + }); + Object.defineProperty(r, j, { + enumerable: !0, + configurable: !0, + get: () => it.value, + set: (lt) => it.value = lt + }); + } + if (l) + for (const j in l) + Cl(l[j], r, n, j); + if (u) { + const j = ut(u) ? u.call(n) : u; + Reflect.ownKeys(j).forEach((B) => { + sa(B, j[B]); + }); + } + a && Ks(a, t, "c"); + function N(j, B) { + rt(B) ? B.forEach((Y) => j(Y.bind(n))) : B && j(B.bind(n)); + } + if (N(Rl, f), N(Tl, h), N(Gc, p), N(Hc, w), N(Dc, _), N(Vc, v), N(Yc, G), N(Xc, L), N(Kc, z), N(Uc, T), N(hs, y), N(Wc, Q), rt(X)) + if (X.length) { + const j = t.exposed || (t.exposed = {}); + X.forEach((B) => { + Object.defineProperty(j, B, { + get: () => n[B], + set: (Y) => n[B] = Y + }); + }); + } else t.exposed || (t.exposed = {}); + k && t.render === ie && (t.render = k), et != null && (t.inheritAttrs = et), ot && (t.components = ot), U && (t.directives = U); +} +function Zc(t, e, n = ie) { + rt(t) && (t = Ii(t)); + for (const r in t) { + const i = t[r]; + let s; + St(i) ? "default" in i ? s = _r( + i.from || r, + i.default, + !0 + ) : s = _r(i.from || r) : s = _r(i), Kt(s) ? Object.defineProperty(e, r, { + enumerable: !0, + configurable: !0, + get: () => s.value, + set: (o) => s.value = o + }) : e[r] = s; + } +} +function Ks(t, e, n) { + fe( + rt(t) ? t.map((r) => r.bind(e.proxy)) : t.bind(e.proxy), + e, + n + ); +} +function Cl(t, e, n, r) { + const i = r.includes(".") ? kl(n, r) : () => n[r]; + if (Ct(t)) { + const s = e[t]; + ut(s) && fi(i, s); + } else if (ut(t)) + fi(i, t.bind(n)); + else if (St(t)) + if (rt(t)) + t.forEach((s) => Cl(s, e, n, r)); + else { + const s = ut(t.handler) ? t.handler.bind(n) : e[t.handler]; + ut(s) && fi(i, s, t); + } +} +function ds(t) { + const e = t.type, { mixins: n, extends: r } = e, { + mixins: i, + optionsCache: s, + config: { optionMergeStrategies: o } + } = t.appContext, l = s.get(e); + let u; + return l ? u = l : !i.length && !n && !r ? u = e : (u = {}, i.length && i.forEach( + (c) => Pr(u, c, o, !0) + ), Pr(u, e, o)), St(e) && s.set(e, u), u; +} +function Pr(t, e, n, r = !1) { + const { mixins: i, extends: s } = e; + s && Pr(t, s, n, !0), i && i.forEach( + (o) => Pr(t, o, n, !0) + ); + for (const o in e) + if (!(r && o === "expose")) { + const l = ta[o] || n && n[o]; + t[o] = l ? l(t[o], e[o]) : e[o]; + } + return t; +} +const ta = { + data: Xs, + props: Ys, + emits: Ys, + // objects + methods: Nn, + computed: Nn, + // lifecycle + beforeCreate: Ot, + created: Ot, + beforeMount: Ot, + mounted: Ot, + beforeUpdate: Ot, + updated: Ot, + beforeDestroy: Ot, + beforeUnmount: Ot, + destroyed: Ot, + unmounted: Ot, + activated: Ot, + deactivated: Ot, + errorCaptured: Ot, + serverPrefetch: Ot, + // assets + components: Nn, + directives: Nn, + // watch + watch: na, + // provide / inject + provide: Xs, + inject: ea +}; +function Xs(t, e) { + return e ? t ? function() { + return Tt( + ut(t) ? t.call(this, this) : t, + ut(e) ? e.call(this, this) : e + ); + } : e : t; +} +function ea(t, e) { + return Nn(Ii(t), Ii(e)); +} +function Ii(t) { + if (rt(t)) { + const e = {}; + for (let n = 0; n < t.length; n++) + e[t[n]] = t[n]; + return e; + } + return t; +} +function Ot(t, e) { + return t ? [...new Set([].concat(t, e))] : e; +} +function Nn(t, e) { + return t ? Tt(/* @__PURE__ */ Object.create(null), t, e) : e; +} +function Ys(t, e) { + return t ? rt(t) && rt(e) ? [.../* @__PURE__ */ new Set([...t, ...e])] : Tt( + /* @__PURE__ */ Object.create(null), + Ws(t), + Ws(e ?? {}) + ) : e; +} +function na(t, e) { + if (!t) + return e; + if (!e) + return t; + const n = Tt(/* @__PURE__ */ Object.create(null), t); + for (const r in e) + n[r] = Ot(t[r], e[r]); + return n; +} +function Pl() { + return { + app: null, + config: { + isNativeTag: Bu, + performance: !1, + globalProperties: {}, + optionMergeStrategies: {}, + errorHandler: void 0, + warnHandler: void 0, + compilerOptions: {} + }, + mixins: [], + components: {}, + directives: {}, + provides: /* @__PURE__ */ Object.create(null), + optionsCache: /* @__PURE__ */ new WeakMap(), + propsCache: /* @__PURE__ */ new WeakMap(), + emitsCache: /* @__PURE__ */ new WeakMap() + }; +} +let ra = 0; +function ia(t, e) { + return function(r, i = null) { + ut(r) || (r = Tt({}, r)), i != null && !St(i) && (i = null); + const s = Pl(), o = /* @__PURE__ */ new WeakSet(); + let l = !1; + const u = s.app = { + _uid: ra++, + _component: r, + _props: i, + _container: null, + _context: s, + _instance: null, + version: Pa, + get config() { + return s.config; + }, + set config(c) { + }, + use(c, ...a) { + return o.has(c) || (c && ut(c.install) ? (o.add(c), c.install(u, ...a)) : ut(c) && (o.add(c), c(u, ...a))), u; + }, + mixin(c) { + return s.mixins.includes(c) || s.mixins.push(c), u; + }, + component(c, a) { + return a ? (s.components[c] = a, u) : s.components[c]; + }, + directive(c, a) { + return a ? (s.directives[c] = a, u) : s.directives[c]; + }, + mount(c, a, f) { + if (!l) { + const h = _e(r, i); + return h.appContext = s, f === !0 ? f = "svg" : f === !1 && (f = void 0), a && e ? e(h, c) : t(h, c, f), l = !0, u._container = c, c.__vue_app__ = u, ti(h.component) || h.component.proxy; + } + }, + unmount() { + l && (t(null, u._container), delete u._container.__vue_app__); + }, + provide(c, a) { + return s.provides[c] = a, u; + }, + runWithContext(c) { + const a = Ln; + Ln = u; + try { + return c(); + } finally { + Ln = a; + } + } + }; + return u; + }; +} +let Ln = null; +function sa(t, e) { + if (Ft) { + let n = Ft.provides; + const r = Ft.parent && Ft.parent.provides; + r === n && (n = Ft.provides = Object.create(r)), n[t] = e; + } +} +function _r(t, e, n = !1) { + const r = Ft || Jt; + if (r || Ln) { + const i = r ? r.parent == null ? r.vnode.appContext && r.vnode.appContext.provides : r.parent.provides : Ln._context.provides; + if (i && t in i) + return i[t]; + if (arguments.length > 1) + return n && ut(e) ? e.call(r && r.proxy) : e; + } +} +function oa(t, e, n, r = !1) { + const i = {}, s = {}; + Nr(s, Qr, 1), t.propsDefaults = /* @__PURE__ */ Object.create(null), Ll(t, e, i, s); + for (const o in t.propsOptions[0]) + o in i || (i[o] = void 0); + n ? t.props = r ? i : _c(i) : t.type.props ? t.props = i : t.props = s, t.attrs = s; +} +function la(t, e, n, r) { + const { + props: i, + attrs: s, + vnode: { patchFlag: o } + } = t, l = dt(i), [u] = t.propsOptions; + let c = !1; + if ( + // always force full diff in dev + // - #1942 if hmr is enabled with sfc component + // - vite#872 non-sfc component used by sfc component + (r || o > 0) && !(o & 16) + ) { + if (o & 8) { + const a = t.vnode.dynamicProps; + for (let f = 0; f < a.length; f++) { + let h = a[f]; + if (Xr(t.emitsOptions, h)) + continue; + const p = e[h]; + if (u) + if (ft(s, h)) + p !== s[h] && (s[h] = p, c = !0); + else { + const w = ke(h); + i[w] = $i( + u, + l, + w, + p, + t, + !1 + ); + } + else + p !== s[h] && (s[h] = p, c = !0); + } + } + } else { + Ll(t, e, i, s) && (c = !0); + let a; + for (const f in l) + (!e || // for camelCase + !ft(e, f) && // it's possible the original props was passed in as kebab-case + // and converted to camelCase (#955) + ((a = ue(f)) === f || !ft(e, a))) && (u ? n && // for camelCase + (n[f] !== void 0 || // for kebab-case + n[a] !== void 0) && (i[f] = $i( + u, + l, + f, + void 0, + t, + !0 + )) : delete i[f]); + if (s !== l) + for (const f in s) + (!e || !ft(e, f)) && (delete s[f], c = !0); + } + c && Me(t, "set", "$attrs"); +} +function Ll(t, e, n, r) { + const [i, s] = t.propsOptions; + let o = !1, l; + if (e) + for (let u in e) { + if (Cn(u)) + continue; + const c = e[u]; + let a; + i && ft(i, a = ke(u)) ? !s || !s.includes(a) ? n[a] = c : (l || (l = {}))[a] = c : Xr(t.emitsOptions, u) || (!(u in r) || c !== r[u]) && (r[u] = c, o = !0); + } + if (s) { + const u = dt(n), c = l || bt; + for (let a = 0; a < s.length; a++) { + const f = s[a]; + n[f] = $i( + i, + u, + f, + c[f], + t, + !ft(c, f) + ); + } + } + return o; +} +function $i(t, e, n, r, i, s) { + const o = t[n]; + if (o != null) { + const l = ft(o, "default"); + if (l && r === void 0) { + const u = o.default; + if (o.type !== Function && !o.skipFactory && ut(u)) { + const { propsDefaults: c } = i; + if (n in c) + r = c[n]; + else { + const a = Wn(i); + r = c[n] = u.call( + null, + e + ), a(); + } + } else + r = u; + } + o[ + 0 + /* shouldCast */ + ] && (s && !l ? r = !1 : o[ + 1 + /* shouldCastTrue */ + ] && (r === "" || r === ue(n)) && (r = !0)); + } + return r; +} +function Il(t, e, n = !1) { + const r = e.propsCache, i = r.get(t); + if (i) + return i; + const s = t.props, o = {}, l = []; + let u = !1; + if (!ut(t)) { + const a = (f) => { + u = !0; + const [h, p] = Il(f, e, !0); + Tt(o, h), p && l.push(...p); + }; + !n && e.mixins.length && e.mixins.forEach(a), t.extends && a(t.extends), t.mixins && t.mixins.forEach(a); + } + if (!s && !u) + return St(t) && r.set(t, un), un; + if (rt(s)) + for (let a = 0; a < s.length; a++) { + const f = ke(s[a]); + Js(f) && (o[f] = bt); + } + else if (s) + for (const a in s) { + const f = ke(a); + if (Js(f)) { + const h = s[a], p = o[f] = rt(h) || ut(h) ? { type: h } : Tt({}, h); + if (p) { + const w = to(Boolean, p.type), _ = to(String, p.type); + p[ + 0 + /* shouldCast */ + ] = w > -1, p[ + 1 + /* shouldCastTrue */ + ] = _ < 0 || w < _, (w > -1 || ft(p, "default")) && l.push(f); + } + } + } + const c = [o, l]; + return St(t) && r.set(t, c), c; +} +function Js(t) { + return t[0] !== "$" && !Cn(t); +} +function Qs(t) { + return t === null ? "null" : typeof t == "function" ? t.name || "" : typeof t == "object" && t.constructor && t.constructor.name || ""; +} +function Zs(t, e) { + return Qs(t) === Qs(e); +} +function to(t, e) { + return rt(e) ? e.findIndex((n) => Zs(n, t)) : ut(e) && Zs(e, t) ? 0 : -1; +} +const $l = (t) => t[0] === "_" || t === "$stable", ps = (t) => rt(t) ? t.map(me) : [me(t)], ua = (t, e, n) => { + if (e._n) + return e; + const r = Cc((...i) => ps(e(...i)), n); + return r._c = !1, r; +}, Ol = (t, e, n) => { + const r = t._ctx; + for (const i in t) { + if ($l(i)) + continue; + const s = t[i]; + if (ut(s)) + e[i] = ua(i, s, r); + else if (s != null) { + const o = ps(s); + e[i] = () => o; + } + } +}, Al = (t, e) => { + const n = ps(e); + t.slots.default = () => n; +}, ca = (t, e) => { + if (t.vnode.shapeFlag & 32) { + const n = e._; + n ? (t.slots = dt(e), Nr(e, "_", n)) : Ol( + e, + t.slots = {} + ); + } else + t.slots = {}, e && Al(t, e); + Nr(t.slots, Qr, 1); +}, aa = (t, e, n) => { + const { vnode: r, slots: i } = t; + let s = !0, o = bt; + if (r.shapeFlag & 32) { + const l = e._; + l ? n && l === 1 ? s = !1 : (Tt(i, e), !n && l === 1 && delete i._) : (s = !e.$stable, Ol(e, i)), o = e; + } else e && (Al(t, e), o = { default: 1 }); + if (s) + for (const l in i) + !$l(l) && o[l] == null && delete i[l]; +}; +function Oi(t, e, n, r, i = !1) { + if (rt(t)) { + t.forEach( + (h, p) => Oi( + h, + e && (rt(e) ? e[p] : e), + n, + r, + i + ) + ); + return; + } + if (yr(r) && !i) + return; + const s = r.shapeFlag & 4 ? ti(r.component) || r.component.proxy : r.el, o = i ? null : s, { i: l, r: u } = t, c = e && e.r, a = l.refs === bt ? l.refs = {} : l.refs, f = l.setupState; + if (c != null && c !== u && (Ct(c) ? (a[c] = null, ft(f, c) && (f[c] = null)) : Kt(c) && (c.value = null)), ut(u)) + Be(u, l, 12, [o, a]); + else { + const h = Ct(u), p = Kt(u); + if (h || p) { + const w = () => { + if (t.f) { + const _ = h ? ft(f, u) ? f[u] : a[u] : u.value; + i ? rt(_) && Qi(_, s) : rt(_) ? _.includes(s) || _.push(s) : h ? (a[u] = [s], ft(f, u) && (f[u] = a[u])) : (u.value = [s], t.k && (a[t.k] = u.value)); + } else h ? (a[u] = o, ft(f, u) && (f[u] = o)) : p && (u.value = o, t.k && (a[t.k] = o)); + }; + o ? (w.id = -1, Gt(w, n)) : w(); + } + } +} +const Gt = Fc; +function fa(t) { + return ha(t); +} +function ha(t, e) { + const n = Jo(); + n.__VUE__ = !0; + const { + insert: r, + remove: i, + patchProp: s, + createElement: o, + createText: l, + createComment: u, + setText: c, + setElementText: a, + parentNode: f, + nextSibling: h, + setScopeId: p = ie, + insertStaticContent: w + } = t, _ = (m, b, C, $ = null, A = null, q = null, W = void 0, V = null, H = !!b.dynamicChildren) => { + if (m === b) + return; + m && !xn(m, b) && ($ = xt(m), lt(m, A, q, !0), m = null), b.patchFlag === -2 && (H = !1, b.dynamicChildren = null); + const { type: F, ref: K, shapeFlag: tt } = b; + switch (F) { + case Jr: + v(m, b, C, $); + break; + case Bn: + d(m, b, C, $); + break; + case pi: + m == null && T(b, C, $, W); + break; + case re: + ot( + m, + b, + C, + $, + A, + q, + W, + V, + H + ); + break; + default: + tt & 1 ? k( + m, + b, + C, + $, + A, + q, + W, + V, + H + ) : tt & 6 ? U( + m, + b, + C, + $, + A, + q, + W, + V, + H + ) : (tt & 64 || tt & 128) && F.process( + m, + b, + C, + $, + A, + q, + W, + V, + H, + Zt + ); + } + K != null && A && Oi(K, m && m.ref, q, b || m, !b); + }, v = (m, b, C, $) => { + if (m == null) + r( + b.el = l(b.children), + C, + $ + ); + else { + const A = b.el = m.el; + b.children !== m.children && c(A, b.children); + } + }, d = (m, b, C, $) => { + m == null ? r( + b.el = u(b.children || ""), + C, + $ + ) : b.el = m.el; + }, T = (m, b, C, $) => { + [m.el, m.anchor] = w( + m.children, + b, + C, + $, + m.el, + m.anchor + ); + }, P = ({ el: m, anchor: b }, C, $) => { + let A; + for (; m && m !== b; ) + A = h(m), r(m, C, $), m = A; + r(b, C, $); + }, y = ({ el: m, anchor: b }) => { + let C; + for (; m && m !== b; ) + C = h(m), i(m), m = C; + i(b); + }, k = (m, b, C, $, A, q, W, V, H) => { + b.type === "svg" ? W = "svg" : b.type === "math" && (W = "mathml"), m == null ? L( + b, + C, + $, + A, + q, + W, + V, + H + ) : Q( + m, + b, + A, + q, + W, + V, + H + ); + }, L = (m, b, C, $, A, q, W, V) => { + let H, F; + const { props: K, shapeFlag: tt, transition: Z, dirs: nt } = m; + if (H = m.el = o( + m.type, + q, + K && K.is, + K + ), tt & 8 ? a(H, m.children) : tt & 16 && G( + m.children, + H, + null, + $, + A, + di(m, q), + W, + V + ), nt && qe(m, null, $, "created"), z(H, m, m.scopeId, W, $), K) { + for (const ht in K) + ht !== "value" && !Cn(ht) && s( + H, + ht, + null, + K[ht], + q, + m.children, + $, + A, + mt + ); + "value" in K && s(H, "value", null, K.value, q), (F = K.onVnodeBeforeMount) && pe(F, $, m); + } + nt && qe(m, null, $, "beforeMount"); + const ct = da(A, Z); + ct && Z.beforeEnter(H), r(H, b, C), ((F = K && K.onVnodeMounted) || ct || nt) && Gt(() => { + F && pe(F, $, m), ct && Z.enter(H), nt && qe(m, null, $, "mounted"); + }, A); + }, z = (m, b, C, $, A) => { + if (C && p(m, C), $) + for (let q = 0; q < $.length; q++) + p(m, $[q]); + if (A) { + let q = A.subTree; + if (b === q) { + const W = A.vnode; + z( + m, + W, + W.scopeId, + W.slotScopeIds, + A.parent + ); + } + } + }, G = (m, b, C, $, A, q, W, V, H = 0) => { + for (let F = H; F < m.length; F++) { + const K = m[F] = V ? Oe(m[F]) : me(m[F]); + _( + null, + K, + b, + C, + $, + A, + q, + W, + V + ); + } + }, Q = (m, b, C, $, A, q, W) => { + const V = b.el = m.el; + let { patchFlag: H, dynamicChildren: F, dirs: K } = b; + H |= m.patchFlag & 16; + const tt = m.props || bt, Z = b.props || bt; + let nt; + if (C && Ge(C, !1), (nt = Z.onVnodeBeforeUpdate) && pe(nt, C, b, m), K && qe(b, m, C, "beforeUpdate"), C && Ge(C, !0), F ? X( + m.dynamicChildren, + F, + V, + C, + $, + di(b, A), + q + ) : W || B( + m, + b, + V, + null, + C, + $, + di(b, A), + q, + !1 + ), H > 0) { + if (H & 16) + et( + V, + b, + tt, + Z, + C, + $, + A + ); + else if (H & 2 && tt.class !== Z.class && s(V, "class", null, Z.class, A), H & 4 && s(V, "style", tt.style, Z.style, A), H & 8) { + const ct = b.dynamicProps; + for (let ht = 0; ht < ct.length; ht++) { + const vt = ct[ht], Rt = tt[vt], Vt = Z[vt]; + (Vt !== Rt || vt === "value") && s( + V, + vt, + Rt, + Vt, + A, + m.children, + C, + $, + mt + ); + } + } + H & 1 && m.children !== b.children && a(V, b.children); + } else !W && F == null && et( + V, + b, + tt, + Z, + C, + $, + A + ); + ((nt = Z.onVnodeUpdated) || K) && Gt(() => { + nt && pe(nt, C, b, m), K && qe(b, m, C, "updated"); + }, $); + }, X = (m, b, C, $, A, q, W) => { + for (let V = 0; V < b.length; V++) { + const H = m[V], F = b[V], K = ( + // oldVNode may be an errored async setup() component inside Suspense + // which will not have a mounted element + H.el && // - In the case of a Fragment, we need to provide the actual parent + // of the Fragment itself so it can move its children. + (H.type === re || // - In the case of different nodes, there is going to be a replacement + // which also requires the correct parent container + !xn(H, F) || // - In the case of a component, it could contain anything. + H.shapeFlag & 70) ? f(H.el) : ( + // In other cases, the parent container is not actually used so we + // just pass the block element here to avoid a DOM parentNode call. + C + ) + ); + _( + H, + F, + K, + null, + $, + A, + q, + W, + !0 + ); + } + }, et = (m, b, C, $, A, q, W) => { + if (C !== $) { + if (C !== bt) + for (const V in C) + !Cn(V) && !(V in $) && s( + m, + V, + C[V], + null, + W, + b.children, + A, + q, + mt + ); + for (const V in $) { + if (Cn(V)) + continue; + const H = $[V], F = C[V]; + H !== F && V !== "value" && s( + m, + V, + F, + H, + W, + b.children, + A, + q, + mt + ); + } + "value" in $ && s(m, "value", C.value, $.value, W); + } + }, ot = (m, b, C, $, A, q, W, V, H) => { + const F = b.el = m ? m.el : l(""), K = b.anchor = m ? m.anchor : l(""); + let { patchFlag: tt, dynamicChildren: Z, slotScopeIds: nt } = b; + nt && (V = V ? V.concat(nt) : nt), m == null ? (r(F, C, $), r(K, C, $), G( + // #10007 + // such fragment like `<>` will be compiled into + // a fragment which doesn't have a children. + // In this case fallback to an empty array + b.children || [], + C, + K, + A, + q, + W, + V, + H + )) : tt > 0 && tt & 64 && Z && // #2715 the previous fragment could've been a BAILed one as a result + // of renderSlot() with no valid children + m.dynamicChildren ? (X( + m.dynamicChildren, + Z, + C, + A, + q, + W, + V + ), // #2080 if the stable fragment has a key, it's a