/** * SAM3 Interactive Collector Widget * Multi-region prompt collection with live segmentation preview via "Run" button. * Based on sam3_multiregion_widget.js */ import { app } from "../../scripts/app.js"; const PROMPT_COLORS = [ { name: "cyan", primary: "#00FFFF", dim: "#006666" }, { name: "yellow", primary: "#FFFF00", dim: "#666600" }, { name: "magenta", primary: "#FF00FF", dim: "#660066" }, { name: "lime", primary: "#00FF00", dim: "#006600" }, { name: "orange", primary: "#FF8000", dim: "#663300" }, { name: "pink", primary: "#FF69B4", dim: "#662944" }, { name: "blue", primary: "#4169E1", dim: "#1a2a5c" }, { name: "teal", primary: "#20B2AA", dim: "#0d4744" }, ]; const MAX_PROMPTS = PROMPT_COLORS.length; function hideWidgetForGood(node, widget, suffix = '') { if (!widget) return; widget.origType = widget.type; widget.origComputeSize = widget.computeSize; widget.computeSize = () => [0, -4]; widget.type = "converted-widget" + suffix; widget.hidden = true; if (widget.element) { widget.element.style.display = "none"; widget.element.style.visibility = "hidden"; } } // Spinner styling is inlined on the element and animated via the Web // Animations API rather than an injected