import {
isDefinedIcon
} from "./chunk-ZUETELRC.js";
import {
closeOnOutsideClick,
createWindowElement,
synchronizePlacementOnUpdate
} from "./chunk-WM2KMMIK.js";
import "./chunk-LEX3GG7N.js";
import "./chunk-5WRI5ZAA.js";
// node_modules/astro/dist/runtime/client/dev-toolbar/apps/utils/icons.js
function randomFromArray(list) {
return list[Math.floor(Math.random() * list.length)];
}
var categoryIcons = new Map(
Object.entries({
frameworks: ["puzzle", "grid"],
adapters: ["puzzle", "grid", "compress"],
"css+ui": ["compress", "grid", "image", "resizeImage", "puzzle"],
"performance+seo": ["approveUser", "checkCircle", "compress", "robot", "searchFile", "sitemap"],
analytics: ["checkCircle", "compress", "searchFile"],
accessibility: ["approveUser", "checkCircle"],
other: ["checkCircle", "grid", "puzzle", "sitemap"]
})
);
function iconForIntegration(integration) {
const icons = integration.categories.filter((category) => categoryIcons.has(category)).flatMap((category) => categoryIcons.get(category));
return randomFromArray(icons);
}
var iconColors = [
"#BC52EE",
"#6D6AF0",
"#52EEBD",
"#52B7EE",
"#52EE55",
"#B7EE52",
"#EEBD52",
"#EE5552",
"#EE52B7",
"#858B98"
];
function colorForIntegration() {
return randomFromArray(iconColors);
}
// node_modules/astro/dist/runtime/client/dev-toolbar/apps/astro.js
var astroLogo = '';
var integrationData;
var astro_default = {
id: "astro:home",
name: "Menu",
icon: "astro:logo",
async init(canvas, eventTarget) {
createCanvas();
document.addEventListener("astro:after-swap", createCanvas);
eventTarget.addEventListener("app-toggled", async (event) => {
resetDebugButton();
if (!(event instanceof CustomEvent)) return;
if (event.detail.state === true) {
if (!integrationData) fetchIntegrationData();
}
});
closeOnOutsideClick(eventTarget);
synchronizePlacementOnUpdate(eventTarget, canvas);
function fetchIntegrationData() {
fetch("https://astro.build/api/v1/dev-overlay/", {
cache: "no-cache"
}).then((res) => res.json()).then((data) => {
integrationData = data;
integrationData.data = integrationData.data.map((integration) => {
return integration;
});
refreshIntegrationList();
});
}
function createCanvas() {
const links = [
{
icon: "bug",
name: "Report a Bug",
link: "https://github.com/withastro/astro/issues/new/choose"
},
{
icon: "lightbulb",
name: "Feedback",
link: "https://github.com/withastro/roadmap/discussions/new/choose"
},
{
icon: "file-search",
name: "Documentation",
link: "https://docs.astro.build"
},
{
icon: '',
name: "Community",
link: "https://astro.build/chat"
}
];
const { latestAstroVersion, version, debugInfo } = window.__astro_dev_toolbar__ ?? {};
const windowComponent = createWindowElement(
`