import { n as DevToolbarWindow, t as settings } from "./astro_runtime_client_dev-toolbar_entrypoint__js.js";
import { n as isDefinedIcon, t as getIconElement } from "./icons-DcM8cGs_.js";
//#region node_modules/astro/dist/runtime/client/dev-toolbar/ui-library/badge.js
var sizes$1 = ["small", "large"];
var styles$6 = [
"purple",
"gray",
"red",
"green",
"yellow",
"blue"
];
var DevToolbarBadge = class extends HTMLElement {
_size = "small";
_badgeStyle = "purple";
get size() {
return this._size;
}
set size(value) {
if (!sizes$1.includes(value)) {
settings.logger.error(`Invalid size: ${value}, expected one of ${sizes$1.join(", ")}, got ${value}.`);
return;
}
this._size = value;
this.updateStyle();
}
get badgeStyle() {
return this._badgeStyle;
}
set badgeStyle(value) {
if (!styles$6.includes(value)) {
settings.logger.error(`Invalid style: ${value}, expected one of ${styles$6.join(", ")}, got ${value}.`);
return;
}
this._badgeStyle = value;
this.updateStyle();
}
shadowRoot;
static observedAttributes = ["badge-style", "size"];
constructor() {
super();
this.shadowRoot = this.attachShadow({ mode: "open" });
this.shadowRoot.innerHTML = `
`;
}
connectedCallback() {
this.updateStyle();
}
attributeChangedCallback() {
if (this.hasAttribute("badge-style")) this.badgeStyle = this.getAttribute("badge-style");
if (this.hasAttribute("size")) this.size = this.getAttribute("size");
}
updateStyle() {
const style = this.shadowRoot.querySelector("#selected-style");
if (style) style.innerHTML = `
.badge {
--text-color: var(--${this.badgeStyle}-text);
--border-color: var(--${this.badgeStyle}-border);
--size: var(--${this.size});
}`;
}
};
//#endregion
//#region node_modules/astro/dist/runtime/client/dev-toolbar/ui-library/button.js
var sizes = [
"small",
"medium",
"large"
];
var styles$5 = [
"ghost",
"outline",
"purple",
"gray",
"red",
"green",
"yellow",
"blue"
];
var borderRadii = ["normal", "rounded"];
var DevToolbarButton = class extends HTMLElement {
_size = "small";
_buttonStyle = "purple";
_buttonBorderRadius = "normal";
get size() {
return this._size;
}
set size(value) {
if (!sizes.includes(value)) {
settings.logger.error(`Invalid size: ${value}, expected one of ${sizes.join(", ")}, got ${value}.`);
return;
}
this._size = value;
this.updateStyle();
}
get buttonStyle() {
return this._buttonStyle;
}
set buttonStyle(value) {
if (!styles$5.includes(value)) {
settings.logger.error(`Invalid style: ${value}, expected one of ${styles$5.join(", ")}, got ${value}.`);
return;
}
this._buttonStyle = value;
this.updateStyle();
}
get buttonBorderRadius() {
return this._buttonBorderRadius;
}
set buttonBorderRadius(value) {
if (!borderRadii.includes(value)) {
settings.logger.error(`Invalid border-radius: ${value}, expected one of ${borderRadii.join(", ")}, got ${value}.`);
return;
}
this._buttonBorderRadius = value;
this.updateStyle();
}
static observedAttributes = [
"button-style",
"size",
"button-border-radius"
];
shadowRoot;
constructor() {
super();
this.shadowRoot = this.attachShadow({ mode: "open" });
this.shadowRoot.innerHTML = `
`;
}
connectedCallback() {
this.updateStyle();
}
updateStyle() {
const style = this.shadowRoot.querySelector("#selected-style");
if (style) style.innerHTML = `
button {
--background: var(--${this.buttonStyle}-background);
--border: var(--${this.buttonStyle}-border);
--font-size: var(--${this.size}-font-size);
--text-color: var(--${this.buttonStyle}-text);
${this.buttonBorderRadius === "normal" ? "--padding: var(--" + this.size + "-padding);" : "--padding: var(--" + this.size + "-rounded-padding);"}
--border-radius: var(--${this.buttonBorderRadius}-border-radius);
}`;
}
attributeChangedCallback() {
if (this.hasAttribute("size")) this.size = this.getAttribute("size");
if (this.hasAttribute("button-style")) this.buttonStyle = this.getAttribute("button-style");
}
};
//#endregion
//#region node_modules/astro/dist/runtime/client/dev-toolbar/ui-library/card.js
var styles$4 = [
"purple",
"gray",
"red",
"green",
"yellow",
"blue"
];
var DevToolbarCard = class extends HTMLElement {
link;
clickAction;
shadowRoot;
_cardStyle = "purple";
get cardStyle() {
return this._cardStyle;
}
set cardStyle(value) {
if (!styles$4.includes(value)) {
settings.logger.error(`Invalid style: ${value}, expected one of ${styles$4.join(", ")}, got ${value}.`);
return;
}
this._cardStyle = value;
this.updateStyle();
}
static observedAttributes = ["card-style"];
constructor() {
super();
this.shadowRoot = this.attachShadow({ mode: "open" });
this.link = this.getAttribute("link");
}
attributeChangedCallback() {
if (this.hasAttribute("card-style")) this.cardStyle = this.getAttribute("card-style");
this.updateStyle();
}
updateStyle() {
const style = this.shadowRoot.querySelector("#selected-style");
if (style) style.innerHTML = `
:host {
--hover-background: var(--${this.cardStyle}-hover-background);
--hover-border: var(--${this.cardStyle}-hover-border);
}
`;
}
connectedCallback() {
const element = this.link ? "a" : this.clickAction ? "button" : "div";
this.shadowRoot.innerHTML += `
<${element}${this.link ? ` href="${this.link}" target="_blank"` : ``} id="astro-overlay-card">
${element}>
`;
this.updateStyle();
if (this.clickAction) this.shadowRoot.getElementById("astro-overlay-card")?.addEventListener("click", this.clickAction);
}
};
//#endregion
//#region node_modules/astro/dist/runtime/client/dev-toolbar/ui-library/highlight.js
var styles$3 = [
"purple",
"gray",
"red",
"green",
"yellow",
"blue"
];
var DevToolbarHighlight = class extends HTMLElement {
icon;
_highlightStyle = "purple";
get highlightStyle() {
return this._highlightStyle;
}
set highlightStyle(value) {
if (!styles$3.includes(value)) {
settings.logger.error(`Invalid style: ${value}, expected one of ${styles$3.join(", ")}, got ${value}.`);
return;
}
this._highlightStyle = value;
this.updateStyle();
}
static observedAttributes = ["highlight-style"];
shadowRoot;
constructor() {
super();
this.shadowRoot = this.attachShadow({ mode: "open" });
this.icon = this.hasAttribute("icon") ? this.getAttribute("icon") : void 0;
this.shadowRoot.innerHTML = `
`;
}
updateStyle() {
const style = this.shadowRoot.querySelector("#selected-style");
if (style) style.innerHTML = `
:host {
--background: var(--${this.highlightStyle}-background);
--border: var(--${this.highlightStyle}-border);
}`;
}
attributeChangedCallback() {
if (this.hasAttribute("highlight-style")) this.highlightStyle = this.getAttribute("highlight-style");
}
connectedCallback() {
this.updateStyle();
if (this.icon) {
let iconContainer = document.createElement("div");
iconContainer.classList.add("icon");
let iconElement;
if (isDefinedIcon(this.icon)) iconElement = getIconElement(this.icon);
else {
iconElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
iconElement.setAttribute("viewBox", "0 0 16 16");
iconElement.innerHTML = this.icon;
}
if (iconElement) {
iconElement?.style.setProperty("width", "16px");
iconElement?.style.setProperty("height", "16px");
iconContainer.append(iconElement);
this.shadowRoot.append(iconContainer);
}
}
}
};
//#endregion
//#region node_modules/astro/dist/runtime/client/dev-toolbar/ui-library/icon.js
var DevToolbarIcon = class extends HTMLElement {
_icon = void 0;
shadowRoot;
get icon() {
return this._icon;
}
set icon(name) {
this._icon = name;
this.buildTemplate();
}
constructor() {
super();
this.shadowRoot = this.attachShadow({ mode: "open" });
if (this.hasAttribute("icon")) this.icon = this.getAttribute("icon");
else this.buildTemplate();
}
getIconHTML(icon) {
if (icon && isDefinedIcon(icon)) return getIconElement(icon)?.outerHTML ?? "";
return "";
}
buildTemplate() {
this.shadowRoot.innerHTML = `
${this.getIconHTML(this._icon)}`;
}
};
//#endregion
//#region node_modules/astro/dist/runtime/client/dev-toolbar/ui-library/radio-checkbox.js
var styles$2 = [
"purple",
"gray",
"red",
"green",
"yellow",
"blue"
];
var DevToolbarRadioCheckbox = class extends HTMLElement {
_radioStyle = "purple";
input;
shadowRoot;
get radioStyle() {
return this._radioStyle;
}
set radioStyle(value) {
if (!styles$2.includes(value)) {
console.error(`Invalid style: ${value}, expected one of ${styles$2.join(", ")}.`);
return;
}
this._radioStyle = value;
this.updateStyle();
}
static observedAttributes = [
"radio-style",
"checked",
"disabled",
"name",
"value"
];
constructor() {
super();
this.shadowRoot = this.attachShadow({ mode: "open" });
this.shadowRoot.innerHTML = `
`;
this.input = document.createElement("input");
this.input.type = "radio";
this.shadowRoot.append(this.input);
}
connectedCallback() {
this.updateInputState();
this.updateStyle();
}
updateStyle() {
const styleElement = this.shadowRoot.querySelector("#selected-style");
if (styleElement) styleElement.innerHTML = `
:host {
--unchecked-color: var(--${this._radioStyle}-unchecked);
--checked-color: var(--${this._radioStyle}-checked);
}
`;
}
updateInputState() {
this.input.checked = this.hasAttribute("checked");
this.input.disabled = this.hasAttribute("disabled");
this.input.name = this.getAttribute("name") || "";
this.input.value = this.getAttribute("value") || "";
}
attributeChangedCallback() {
if (this.hasAttribute("radio-style")) this.radioStyle = this.getAttribute("radio-style");
this.updateInputState();
}
};
//#endregion
//#region node_modules/astro/dist/runtime/client/dev-toolbar/ui-library/select.js
var styles$1 = [
"purple",
"gray",
"red",
"green",
"yellow",
"blue"
];
var DevToolbarSelect = class extends HTMLElement {
shadowRoot;
element;
_selectStyle = "gray";
get selectStyle() {
return this._selectStyle;
}
set selectStyle(value) {
if (!styles$1.includes(value)) {
settings.logger.error(`Invalid style: ${value}, expected one of ${styles$1.join(", ")}.`);
return;
}
this._selectStyle = value;
this.updateStyle();
}
static observedAttributes = ["select-style"];
constructor() {
super();
this.shadowRoot = this.attachShadow({ mode: "open" });
this.shadowRoot.innerHTML = `
`;
this.element = document.createElement("select");
this.shadowRoot.addEventListener("slotchange", (event) => {
if (event.target instanceof HTMLSlotElement) this.element.append(...event.target.assignedNodes());
});
}
connectedCallback() {
this.element.name = "dev-toolbar-select";
this.shadowRoot.append(this.element);
this.updateStyle();
}
attributeChangedCallback() {
if (this.hasAttribute("select-style")) this.selectStyle = this.getAttribute("select-style");
}
updateStyle() {
const style = this.shadowRoot.querySelector("#selected-style");
if (style) style.innerHTML = `
:host {
--text-color: var(--${this.selectStyle}-text);
--border-color: var(--${this.selectStyle}-border);
}
`;
}
};
//#endregion
//#region node_modules/astro/dist/runtime/client/dev-toolbar/ui-library/toggle.js
var styles = [
"purple",
"gray",
"red",
"green",
"yellow",
"blue"
];
var DevToolbarToggle = class extends HTMLElement {
shadowRoot;
input;
_toggleStyle = "gray";
get toggleStyle() {
return this._toggleStyle;
}
set toggleStyle(value) {
if (!styles.includes(value)) {
settings.logger.error(`Invalid style: ${value}, expected one of ${styles.join(", ")}.`);
return;
}
this._toggleStyle = value;
this.updateStyle();
}
static observedAttributes = ["toggle-style"];
constructor() {
super();
this.shadowRoot = this.attachShadow({ mode: "open" });
this.shadowRoot.innerHTML = `
`;
this.input = document.createElement("input");
}
attributeChangedCallback() {
if (this.hasAttribute("toggle-style")) this.toggleStyle = this.getAttribute("toggle-style");
}
updateStyle() {
const style = this.shadowRoot.querySelector("#selected-style");
if (style) style.innerHTML = `
:host {
--bg-on: var(--${this.toggleStyle}-bg-on);
--border-off: var(--${this.toggleStyle}-border-off);
--border-on: var(--${this.toggleStyle}-border-on);
}
`;
}
connectedCallback() {
this.input.type = "checkbox";
this.input.name = "dev-toolbar-toggle";
this.shadowRoot.append(this.input);
this.updateStyle();
}
get value() {
return this.input.value;
}
set value(val) {
this.input.value = val;
}
};
//#endregion
//#region node_modules/astro/dist/runtime/client/dev-toolbar/ui-library/tooltip.js
var DevToolbarTooltip = class extends HTMLElement {
sections = [];
shadowRoot;
constructor() {
super();
this.shadowRoot = this.attachShadow({ mode: "open" });
}
connectedCallback() {
this.shadowRoot.innerHTML = `