feat: add health check API and handle app configuration warnings
- Removed the old index.html file from the frontend build. - Integrated a health check query in App component to verify app configuration. - Display a warning alert if the app is not configured with AZURE_SUBSCRIPTION_ID. - Updated API module to include health check endpoint.
This commit is contained in:
1 parent
599ac49a76
commit
28d0720ffa
12 files changed
+66
-490
No files matched your search
+3
-3
@@ -12,12 +12,12 @@
|
||||
**/playground.py
|
||||
|
||||
# Azure Secrets and Configuration.
|
||||
/.acr-pat
|
||||
/azure.env
|
||||
.acr-pat
|
||||
azure.env
|
||||
|
||||
# MacOS Finder files
|
||||
**/.DS_Store
|
||||
|
||||
# Node/React rewrite outputs
|
||||
**/node_modules
|
||||
/dist
|
||||
**/dist
|
||||
@@ -42,27 +42,32 @@ const makeApp = () => {
|
||||
app.use(cors());
|
||||
app.use(express.json());
|
||||
|
||||
if (!subscriptionId) {
|
||||
app.get("/api/health", (_req, res) => {
|
||||
const azure = subscriptionId ? new AzureImageService(subscriptionId) : null;
|
||||
const templates = new TemplateService();
|
||||
|
||||
app.get("/api/health", (_req, res) => {
|
||||
if (!subscriptionId) {
|
||||
res.status(500).json({
|
||||
status: "error",
|
||||
message: "Missing AZURE_SUBSCRIPTION_ID"
|
||||
});
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
return { app, port };
|
||||
}
|
||||
|
||||
const azure = new AzureImageService(subscriptionId);
|
||||
const templates = new TemplateService();
|
||||
|
||||
app.get("/api/health", (_req, res) => {
|
||||
res.json({ status: "ok" });
|
||||
});
|
||||
|
||||
const requireAzure = (): AzureImageService => {
|
||||
if (!azure) {
|
||||
throw new Error("Missing AZURE_SUBSCRIPTION_ID");
|
||||
}
|
||||
|
||||
return azure;
|
||||
};
|
||||
|
||||
app.get("/api/locations", async (_req, res, next) => {
|
||||
try {
|
||||
res.json(await azure.getLocations());
|
||||
res.json(await requireAzure().getLocations());
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
@@ -71,7 +76,7 @@ const makeApp = () => {
|
||||
app.get("/api/publishers", async (req, res, next) => {
|
||||
try {
|
||||
const { location } = queryLocation.parse(req.query);
|
||||
res.json(await azure.getPublishers(location));
|
||||
res.json(await requireAzure().getPublishers(location));
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
@@ -80,7 +85,7 @@ const makeApp = () => {
|
||||
app.get("/api/offers", async (req, res, next) => {
|
||||
try {
|
||||
const { location, publisher } = queryOffer.parse(req.query);
|
||||
res.json(await azure.getOffers(location, publisher));
|
||||
res.json(await requireAzure().getOffers(location, publisher));
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
@@ -89,7 +94,7 @@ const makeApp = () => {
|
||||
app.get("/api/skus", async (req, res, next) => {
|
||||
try {
|
||||
const { location, publisher, offer } = querySku.parse(req.query);
|
||||
res.json(await azure.getSkus(location, publisher, offer));
|
||||
res.json(await requireAzure().getSkus(location, publisher, offer));
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
@@ -98,7 +103,7 @@ const makeApp = () => {
|
||||
app.get("/api/versions", async (req, res, next) => {
|
||||
try {
|
||||
const { location, publisher, offer, sku } = queryVersion.parse(req.query);
|
||||
res.json(await azure.getVersions(location, publisher, offer, sku));
|
||||
res.json(await requireAzure().getVersions(location, publisher, offer, sku));
|
||||
} catch (error) {
|
||||
next(error);
|
||||
}
|
||||
@@ -121,7 +126,7 @@ const makeApp = () => {
|
||||
app.get("/api/sku-export", async (req, res, next) => {
|
||||
try {
|
||||
const { location, publisher, offer } = querySku.parse(req.query);
|
||||
const skus = await azure.getSkus(location, publisher, offer);
|
||||
const skus = await requireAzure().getSkus(location, publisher, offer);
|
||||
res.json({ rendered: templates.buildSkuExport(skus) });
|
||||
} catch (error) {
|
||||
next(error);
|
||||
@@ -151,10 +156,40 @@ const makeApp = () => {
|
||||
|
||||
if (require.main === module) {
|
||||
const { app, port } = makeApp();
|
||||
app.listen(port, () => {
|
||||
const server = app.listen(port, () => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`azure-image-chooser listening on ${port}`);
|
||||
});
|
||||
|
||||
let shuttingDown = false;
|
||||
const shutdown = (signal: NodeJS.Signals) => {
|
||||
if (shuttingDown) {
|
||||
return;
|
||||
}
|
||||
|
||||
shuttingDown = true;
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`received ${signal}, shutting down`);
|
||||
server.close((error) => {
|
||||
if (error) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("graceful shutdown failed", error);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
// Force-exit if connections do not close in time.
|
||||
setTimeout(() => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error("shutdown timeout reached, forcing exit");
|
||||
process.exit(1);
|
||||
}, 10_000).unref();
|
||||
};
|
||||
|
||||
process.on("SIGTERM", shutdown);
|
||||
process.on("SIGINT", shutdown);
|
||||
}
|
||||
|
||||
export { makeApp };
|
||||
-107
@@ -1,107 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AzureImageService = void 0;
|
||||
const arm_compute_1 = require("@azure/arm-compute");
|
||||
const identity_1 = require("@azure/identity");
|
||||
const cache_1 = require("./cache");
|
||||
const version_1 = require("./version");
|
||||
const CACHE_TTL_MS = 5 * 60 * 1000;
|
||||
class AzureImageService {
|
||||
subscriptionId;
|
||||
credential = new identity_1.DefaultAzureCredential();
|
||||
computeClient;
|
||||
cache = new cache_1.MemoryCache();
|
||||
constructor(subscriptionId) {
|
||||
this.subscriptionId = subscriptionId;
|
||||
this.computeClient = new arm_compute_1.ComputeManagementClient(this.credential, subscriptionId);
|
||||
}
|
||||
async getLocations() {
|
||||
const cacheKey = "locations";
|
||||
const cached = this.cache.get(cacheKey);
|
||||
if (cached) {
|
||||
return cached;
|
||||
}
|
||||
const token = await this.credential.getToken("https://management.azure.com/.default");
|
||||
const url = `https://management.azure.com/subscriptions/${this.subscriptionId}/locations?api-version=2022-12-01`;
|
||||
const response = await fetch(url, {
|
||||
headers: {
|
||||
Authorization: `Bearer ${token?.token ?? ""}`
|
||||
}
|
||||
});
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to fetch Azure locations: ${response.status} ${response.statusText}`);
|
||||
}
|
||||
const payload = (await response.json());
|
||||
const allLocations = (payload.value ?? [])
|
||||
.filter((loc) => Boolean(loc.name))
|
||||
.map((loc) => ({
|
||||
name: loc.name,
|
||||
displayName: loc.displayName ?? loc.name,
|
||||
regionType: loc.metadata?.regionType
|
||||
}));
|
||||
const physical = allLocations.filter((loc) => loc.regionType?.toLowerCase() === "physical");
|
||||
const locations = (physical.length > 0 ? physical : allLocations).map((loc) => ({
|
||||
name: loc.name,
|
||||
displayName: loc.displayName
|
||||
}));
|
||||
locations.sort((a, b) => a.name.localeCompare(b.name));
|
||||
this.cache.set(cacheKey, locations, CACHE_TTL_MS);
|
||||
return locations;
|
||||
}
|
||||
async getPublishers(location) {
|
||||
const cacheKey = `publishers:${location}`;
|
||||
const cached = this.cache.get(cacheKey);
|
||||
if (cached) {
|
||||
return cached;
|
||||
}
|
||||
const response = await this.computeClient.virtualMachineImages.listPublishers(location);
|
||||
const publishers = this.extractNames(response).sort((a, b) => a.localeCompare(b));
|
||||
this.cache.set(cacheKey, publishers, CACHE_TTL_MS);
|
||||
return publishers;
|
||||
}
|
||||
async getOffers(location, publisher) {
|
||||
const cacheKey = `offers:${location}:${publisher}`;
|
||||
const cached = this.cache.get(cacheKey);
|
||||
if (cached) {
|
||||
return cached;
|
||||
}
|
||||
const response = await this.computeClient.virtualMachineImages.listOffers(location, publisher);
|
||||
const offers = this.extractNames(response).sort((a, b) => a.localeCompare(b));
|
||||
this.cache.set(cacheKey, offers, CACHE_TTL_MS);
|
||||
return offers;
|
||||
}
|
||||
async getSkus(location, publisher, offer) {
|
||||
const cacheKey = `skus:${location}:${publisher}:${offer}`;
|
||||
const cached = this.cache.get(cacheKey);
|
||||
if (cached) {
|
||||
return cached;
|
||||
}
|
||||
const response = await this.computeClient.virtualMachineImages.listSkus(location, publisher, offer);
|
||||
const skus = this.extractNames(response).sort((a, b) => a.localeCompare(b));
|
||||
this.cache.set(cacheKey, skus, CACHE_TTL_MS);
|
||||
return skus;
|
||||
}
|
||||
async getVersions(location, publisher, offer, sku) {
|
||||
const cacheKey = `versions:${location}:${publisher}:${offer}:${sku}`;
|
||||
const cached = this.cache.get(cacheKey);
|
||||
if (cached) {
|
||||
return cached;
|
||||
}
|
||||
const response = await this.computeClient.virtualMachineImages.list(location, publisher, offer, sku);
|
||||
const versions = this.extractNames(response);
|
||||
const sorted = (0, version_1.sortImageVersionsIfSemantic)(versions);
|
||||
this.cache.set(cacheKey, sorted, CACHE_TTL_MS);
|
||||
return sorted;
|
||||
}
|
||||
extractNames(source) {
|
||||
const items = Array.isArray(source)
|
||||
? source
|
||||
: typeof source === "object" && source !== null && "value" in source && Array.isArray(source.value)
|
||||
? source.value
|
||||
: [];
|
||||
return items
|
||||
.map((item) => (typeof item === "object" && item !== null && "name" in item ? item.name : undefined))
|
||||
.filter((value) => Boolean(value));
|
||||
}
|
||||
}
|
||||
exports.AzureImageService = AzureImageService;
|
||||
Vendored
-24
@@ -1,24 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.MemoryCache = void 0;
|
||||
class MemoryCache {
|
||||
store = new Map();
|
||||
get(key) {
|
||||
const hit = this.store.get(key);
|
||||
if (!hit) {
|
||||
return undefined;
|
||||
}
|
||||
if (Date.now() >= hit.expiresAt) {
|
||||
this.store.delete(key);
|
||||
return undefined;
|
||||
}
|
||||
return hit.value;
|
||||
}
|
||||
set(key, value, ttlMs) {
|
||||
this.store.set(key, {
|
||||
value,
|
||||
expiresAt: Date.now() + ttlMs
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.MemoryCache = MemoryCache;
|
||||
Vendored
-148
@@ -1,148 +0,0 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.makeApp = void 0;
|
||||
const node_fs_1 = require("node:fs");
|
||||
const node_path_1 = require("node:path");
|
||||
const cors_1 = __importDefault(require("cors"));
|
||||
const express_1 = __importDefault(require("express"));
|
||||
const zod_1 = require("zod");
|
||||
const azure_service_1 = require("./azure-service");
|
||||
const template_service_1 = require("./template-service");
|
||||
const findAppNewRoot = () => {
|
||||
const candidates = [(0, node_path_1.join)(__dirname, "../../.."), (0, node_path_1.join)(__dirname, "../..")];
|
||||
for (const candidate of candidates) {
|
||||
if ((0, node_fs_1.existsSync)((0, node_path_1.join)(candidate, "templates.json"))) {
|
||||
return candidate;
|
||||
}
|
||||
}
|
||||
throw new Error("Unable to resolve app-new root");
|
||||
};
|
||||
const queryLocation = zod_1.z.object({ location: zod_1.z.string().min(1) });
|
||||
const queryOffer = zod_1.z.object({ location: zod_1.z.string().min(1), publisher: zod_1.z.string().min(1) });
|
||||
const querySku = zod_1.z.object({ location: zod_1.z.string().min(1), publisher: zod_1.z.string().min(1), offer: zod_1.z.string().min(1) });
|
||||
const queryVersion = zod_1.z.object({ location: zod_1.z.string().min(1), publisher: zod_1.z.string().min(1), offer: zod_1.z.string().min(1), sku: zod_1.z.string().min(1) });
|
||||
const renderBody = zod_1.z.object({
|
||||
templateFile: zod_1.z.string().min(1),
|
||||
selection: zod_1.z.object({
|
||||
location: zod_1.z.string().min(1),
|
||||
publisher: zod_1.z.string().min(1),
|
||||
offer: zod_1.z.string().min(1),
|
||||
sku: zod_1.z.string().min(1),
|
||||
version: zod_1.z.string().min(1)
|
||||
})
|
||||
});
|
||||
const makeApp = () => {
|
||||
const app = (0, express_1.default)();
|
||||
const port = Number.parseInt(process.env.PORT ?? "3000", 10);
|
||||
const subscriptionId = process.env.AZURE_SUBSCRIPTION_ID;
|
||||
app.use((0, cors_1.default)());
|
||||
app.use(express_1.default.json());
|
||||
if (!subscriptionId) {
|
||||
app.get("/api/health", (_req, res) => {
|
||||
res.status(500).json({
|
||||
status: "error",
|
||||
message: "Missing AZURE_SUBSCRIPTION_ID"
|
||||
});
|
||||
});
|
||||
return { app, port };
|
||||
}
|
||||
const azure = new azure_service_1.AzureImageService(subscriptionId);
|
||||
const templates = new template_service_1.TemplateService();
|
||||
app.get("/api/health", (_req, res) => {
|
||||
res.json({ status: "ok" });
|
||||
});
|
||||
app.get("/api/locations", async (_req, res, next) => {
|
||||
try {
|
||||
res.json(await azure.getLocations());
|
||||
}
|
||||
catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
app.get("/api/publishers", async (req, res, next) => {
|
||||
try {
|
||||
const { location } = queryLocation.parse(req.query);
|
||||
res.json(await azure.getPublishers(location));
|
||||
}
|
||||
catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
app.get("/api/offers", async (req, res, next) => {
|
||||
try {
|
||||
const { location, publisher } = queryOffer.parse(req.query);
|
||||
res.json(await azure.getOffers(location, publisher));
|
||||
}
|
||||
catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
app.get("/api/skus", async (req, res, next) => {
|
||||
try {
|
||||
const { location, publisher, offer } = querySku.parse(req.query);
|
||||
res.json(await azure.getSkus(location, publisher, offer));
|
||||
}
|
||||
catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
app.get("/api/versions", async (req, res, next) => {
|
||||
try {
|
||||
const { location, publisher, offer, sku } = queryVersion.parse(req.query);
|
||||
res.json(await azure.getVersions(location, publisher, offer, sku));
|
||||
}
|
||||
catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
app.get("/api/templates", (_req, res) => {
|
||||
res.json(templates.getTemplates());
|
||||
});
|
||||
app.post("/api/render", (req, res, next) => {
|
||||
try {
|
||||
const payload = renderBody.parse(req.body);
|
||||
const rendered = templates.render(payload.templateFile, payload.selection);
|
||||
res.json({ rendered });
|
||||
}
|
||||
catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
app.get("/api/sku-export", async (req, res, next) => {
|
||||
try {
|
||||
const { location, publisher, offer } = querySku.parse(req.query);
|
||||
const skus = await azure.getSkus(location, publisher, offer);
|
||||
res.json({ rendered: templates.buildSkuExport(skus) });
|
||||
}
|
||||
catch (error) {
|
||||
next(error);
|
||||
}
|
||||
});
|
||||
app.use((err, _req, res, _next) => {
|
||||
if (err instanceof zod_1.z.ZodError) {
|
||||
res.status(400).json({ message: "Invalid request", issues: err.issues });
|
||||
return;
|
||||
}
|
||||
const message = err instanceof Error ? err.message : "Unexpected error";
|
||||
res.status(500).json({ message });
|
||||
});
|
||||
const frontendRoot = (0, node_path_1.join)(findAppNewRoot(), "dist/frontend");
|
||||
if ((0, node_fs_1.existsSync)(frontendRoot)) {
|
||||
app.use(express_1.default.static(frontendRoot));
|
||||
app.get(/^(?!\/api).*/, (_req, res) => {
|
||||
res.sendFile((0, node_path_1.join)(frontendRoot, "index.html"));
|
||||
});
|
||||
}
|
||||
return { app, port };
|
||||
};
|
||||
exports.makeApp = makeApp;
|
||||
if (require.main === module) {
|
||||
const { app, port } = makeApp();
|
||||
app.listen(port, () => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`azure-image-chooser listening on ${port}`);
|
||||
});
|
||||
}
|
||||
-36
@@ -1,36 +0,0 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.TemplateService = void 0;
|
||||
const node_fs_1 = require("node:fs");
|
||||
const node_path_1 = require("node:path");
|
||||
const nunjucks_1 = __importDefault(require("nunjucks"));
|
||||
const findAppNewRoot = () => {
|
||||
const candidates = [(0, node_path_1.join)(__dirname, "../../.."), (0, node_path_1.join)(__dirname, "../..")];
|
||||
for (const candidate of candidates) {
|
||||
if ((0, node_fs_1.existsSync)((0, node_path_1.join)(candidate, "templates.json"))) {
|
||||
return candidate;
|
||||
}
|
||||
}
|
||||
throw new Error("Unable to resolve app-new template root");
|
||||
};
|
||||
class TemplateService {
|
||||
appNewRoot = findAppNewRoot();
|
||||
env = nunjucks_1.default.configure((0, node_path_1.join)(this.appNewRoot, "templates"), {
|
||||
autoescape: false,
|
||||
noCache: true
|
||||
});
|
||||
templates = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(this.appNewRoot, "templates.json"), "utf8"));
|
||||
getTemplates() {
|
||||
return this.templates;
|
||||
}
|
||||
render(templateFile, selection) {
|
||||
return this.env.render(templateFile, selection);
|
||||
}
|
||||
buildSkuExport(skus) {
|
||||
return `[\n${skus.map((sku) => `\t\"${sku}\"`).join(",\n")}\n]`;
|
||||
}
|
||||
}
|
||||
exports.TemplateService = TemplateService;
|
||||
Vendored
-2
@@ -1,2 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
Vendored
-21
@@ -1,21 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.sortImageVersionsIfSemantic = void 0;
|
||||
const SEMVER_PATTERN = /^[0-9]+\.[0-9]+\.[0-9]+$/;
|
||||
const semverSortKey = (value) => value.split(".").map((part) => Number.parseInt(part, 10));
|
||||
const sortImageVersionsIfSemantic = (versions) => {
|
||||
if (!versions.every((value) => SEMVER_PATTERN.test(value))) {
|
||||
return [...versions].sort((a, b) => a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }));
|
||||
}
|
||||
return [...versions].sort((a, b) => {
|
||||
const aParts = semverSortKey(a);
|
||||
const bParts = semverSortKey(b);
|
||||
for (let i = 0; i < aParts.length; i += 1) {
|
||||
if (aParts[i] !== bParts[i]) {
|
||||
return aParts[i] - bParts[i];
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
};
|
||||
exports.sortImageVersionsIfSemantic = sortImageVersionsIfSemantic;
|
||||
-119
@@ -1,119 +0,0 @@
|
||||
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ee=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function j(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function te(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,te(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+A(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ee,`$&/`)+`/`),te(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ee,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+A(a,u),c+=te(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+A(a,u++),c+=te(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return te(j(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ne(e,t,n){if(e==null)return e;var r=[],i=0;return te(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function re(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var M=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof
Line truncated
|
||||
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
||||
`+he+e+ge}var L=!1;function ve(e,t){if(!e||L)return``;L=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
||||
`),l=s.split(`
|
||||
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
||||
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{L=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?_e(n):``}function R(e,t){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e(`Lazy`);case 13:return e.child!==t&&t!==null?_e(`Suspense Fallback`):_e(`Suspense`);case 19:return _e(`SuspenseList`);case 0:case 15:return ve(e.type,!1);case 11:return ve(e.type.render,!1);case 1:return ve(e.type,!0);case 31:return _e(`Activity`);default:return``}}function ye(e){try{var t=``,n=null;do t+=R(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
||||
Error generating stack: `+e.message+`
|
||||
`+e.stack}}var be=Object.prototype.hasOwnProperty,xe=t.unstable_scheduleCallback,Se=t.unstable_cancelCallback,Ce=t.unstable_shouldYield,we=t.unstable_requestPaint,Te=t.unstable_now,Ee=t.unstable_getCurrentPriorityLevel,De=t.unstable_ImmediatePriority,Oe=t.unstable_UserBlockingPriority,ke=t.unstable_NormalPriority,Ae=t.unstable_LowPriority,je=t.unstable_IdlePriority,Me=t.log,Ne=t.unstable_setDisableYieldValue,Pe=null,Fe=null;function Ie(e){if(typeof Me==`function`&&Ne(e),Fe&&typeof Fe.setStrictMode==`function`)try{Fe.setStrictMode(Pe,e)}catch{}}var Le=Math.clz32?Math.clz32:Be,Re=Math.log,ze=Math.LN2;function Be(e){return e>>>=0,e===0?32:31-(Re(e)/ze|0)|0}var Ve=256,z=262144,B=4194304;function He(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ue(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=He(n))):i=He(o):i=He(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=He(n))):i=He(o)):i=He(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function We(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ge(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ke(){var e=B;return B<<=1,!(B&62914560)&&(B=4194304),e}function qe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Je(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ye(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Le(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Xe(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Xe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Le(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ze(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Le(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Qe(e,t){var n=t&-t;return n=n&42?1:$e(n),(n&(e.suspendedLanes|t))===0?n:0}function $e(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function et(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function tt(){var e=N.p;return e===0?(e=window.event,e===void 0?32:hp(e.type)):e}function nt(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}var rt=Math.random().toString(36).slice(2),it=`__reactFiber$`+rt,at=`__reactProps$`+rt,ot=`__reactContainer$`+rt,st=`__reactEvents$`+rt,ct=`__reactListeners$`+rt,lt=`__reactHandles$`+rt,ut=`__reactResources$`+rt,dt=`__reactMarker$`+rt;function ft(e){delete e[it],delete e[at],delete e[st],delete e[ct],delete e[lt]}function pt(e){var t=e[it];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ot]||n[it]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ff(e);e!==null;){if(n=e[it])return n;e=ff(e)}return t}e=n,n=e.parentNode}return null}function mt(e){if(e=e[it]||e[ot]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ht(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function gt(e){var t=e[ut];return t||=e[ut]={hoistableStyles:new Map,hoistableScripts:new Map},t}function _t(e){e[dt]=!0}var vt=new Set,yt={};function bt(e,t){xt(e,t),xt(e+`Capture`,t)}function xt(e,t){for(yt[e]=t,e=0;e<t.length;e++)vt.add(t[e])}var St=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7Line truncated
|
||||
`).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function Nd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Ut(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Ut(e,``+r);break;case`className`:Dt(e,`class`,r);break;case`tabIndex`:Dt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Dt(e,n,r);break;case`style`:Kt(e,r,o);break;case`data`:if(t!==`object`){Dt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Xt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Nd(e,t,`name`,a.name,a,null),Nd(e,t,`formEncType`,a.formEncType,a,null),Nd(e,t,`formMethod`,a.formMethod,a,null),Nd(e,t,`formTarget`,a.formTarget,a,null)):(Nd(e,t,`encType`,a.encType,a,null),Nd(e,t,`method`,a.method,a,null),Nd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Xt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Zt);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Xt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),Et(e,`popover`,r);break;case`xlinkActuate`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Ot(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Ot(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Ot(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Ot(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Et(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Jt.get(n)||n,Et(e,n,r))}}function Pd(e,t,n,r,a,o){switch(n){case`style`:Kt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Ut(e,r):(typeof r==`number`||typeof r==`bigint`)&&Ut(e,``+r);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Zt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`
Line truncated
|
||||
|
||||
const theme = ${JSON.stringify(t,null,2)};
|
||||
|
||||
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
|
||||
theme.transitions = createTransitions(theme.transitions || {});
|
||||
|
||||
export default theme;`}function Rs(e){return typeof e==`number`?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}var zs=e=>{if(!Number.isNaN(+e))return+e;let t=e.match(/\d*\.?\d+/g);if(!t)return 0;let n=0;for(let e=0;e<t.length;e+=1)n+=+t[e];return n};function Bs(e){Object.assign(e,{alpha(t,n){let r=this||e;return r.colorSpace?`oklch(from ${t} l c h / ${typeof n==`string`?`calc(${n})`:n})`:r.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,`var(--$1Channel)`)} / ${typeof n==`string`?`calc(${n})`:n})`:to(t,zs(n))},lighten(t,n){let r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #fff ${Rs(n)})`:io(t,n)},darken(t,n){let r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #000 ${Rs(n)})`:ro(t,n)}})}function Vs(e={},...t){let{breakpoints:n,mixins:r={},spacing:i,palette:a={},transitions:o={},typography:s={},shape:c,colorSpace:l,...u}=e;if(e.vars&&e.generateThemeVars===void 0)throw Error(pt(22));let d=vs({...a,colorSpace:l}),f=_a(e),p=Lr(f,{mixins:bs(f.breakpoints,r),palette:d,shadows:ks.slice(),typography:ws(d,s),transitions:Ps(o),zIndex:{...Fs}});return p=Lr(p,u),p=t.reduce((e,t)=>Lr(e,t),p),p.unstable_sxConfig={...ua,...u?.unstable_sxConfig},p.unstable_sx=function(e){return pa({sx:e,theme:this})},p.toRuntimeSource=Ls,Bs(p),p}function Hs(e){let t;return t=e<1?5.11916*e**2:4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}var Us=[...Array(25)].map((e,t)=>{if(t===0)return`none`;let n=Hs(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function Ws(e){return{inputPlaceholder:e===`dark`?.5:.42,inputUnderline:e===`dark`?.7:.42,switchTrackDisabled:e===`dark`?.2:.12,switchTrack:e===`dark`?.3:.38}}function Gs(e){return e===`dark`?Us:[]}function Ks(e){let{palette:t={mode:`light`},opacity:n,overlays:r,colorSpace:i,...a}=e,o=vs({...t,colorSpace:i});return{palette:o,opacity:{...Ws(o.mode),...n},overlays:r||Gs(o.mode),...a}}function qs(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]===`palette`&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}var Js=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:``}overlays-${n}`),`--${e?`${e}-`:``}palette-AppBar-darkBg`,`--${e?`${e}-`:``}palette-AppBar-darkColor`],Ys=e=>(t,n)=>{let r=e.rootSelector||`:root`,i=e.colorSchemeSelector,a=i;if(i===`class`&&(a=`.%s`),i===`data`&&(a=`[data-%s]`),i?.startsWith(`data-`)&&!i.includes(`%s`)&&(a=`[${i}="%s"]`),e.defaultColorScheme===t){if(t===`dark`){let i={};return Js(e.cssVarPrefix).forEach(e=>{i[e]=n[e],delete n[e]}),a===`media`?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:i}}:a?{[a.replace(`%s`,t)]:i,[`${r}, ${a.replace(`%s`,t)}`]:n}:{[r]:{...n,...i}}}if(a&&a!==`media`)return`${r}, ${a.replace(`%s`,String(t))}`}else if(t){if(a===`media`)return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(a)return a.replace(`%s`,String(t))}return r};function Xs(e,t){t.forEach(t=>{e[t]||(e[t]={})})}function J(e,t,n){!e[t]&&n&&(e[t]=n)}function Zs(e){return typeof e!=`string`||!e.startsWith(`hsl`)?e:Qa(e)}function Qs(e,t){`${t}Channel`in e||(e[`${t}Channel`]=Xa(Zs(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
|
||||
To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function $s(e){return typeof e==`number`?`${e}px`:typeof e==`string`||typeof e==`function`||Array.isArray(e)?e:`8px`}var ec=e=>{try{return e()}catch{}},tc=(e=`mui`)=>yo(e);function nc(e,t,n,r,i){if(!n)return;n=n===!0?{}:n;let a=i===`dark`?`dark`:`light`;if(!r){t[i]=Ks({...n,palette:{mode:a,...n?.palette},colorSpace:e});return}let{palette:o,...s}=Vs({...r,palette:{mode:a,...n?.palette},colorSpace:e});return t[i]={...n,palette:o,opacity:{...Ws(a),...n?.opacity},overlays:n?.overlays||Gs(a)},s}function rc(e={},...t){let{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:a=`mui`,nativeColor:o=!1,shouldSkipGeneratingVar:s=qs,colorSchemeSelector:c=n.light&&n.dark?`media`:void 0,rootSelector:l=`:root`,...u}=e,d=Object.keys(n)[0],f=r||(n.light&&d!==`light`?`light`:d),p=tc(a),{[f]:m,light:h,dark:g,..._}=n,v={..._},y=m;if((f===`dark`&&!(`dark`in n)||f===`light`&&!(`light`in n))&&(y=!0),!y)throw Error(pt(21,f));let b;o&&(b=`oklch`);let x=nc(b,v,y,u,f);h&&!v.light&&nc(b,v,h,void 0,`light`),g&&!v.dark&&nc(b,v,g,void 0,`dark`);let S={defaultColorScheme:f,...x,cssVarPrefix:a,colorSchemeSelector:c,rootSelector:l,getCssVar:p,colorSchemes:v,font:{...ys(x.typography),...x.font},spacing:$s(u.spacing)};Object.keys(S.colorSchemes).forEach(e=>{let t=S.colorSchemes[e].palette,n=e=>{let n=e.split(`-`),r=n[1],i=n[2];return p(e,t[r][i])};t.mode===`light`&&(J(t.common,`background`,`#fff`),J(t.common,`onBackground`,`#000`)),t.mode===`dark`&&(J(t.common,`background`,`#000`),J(t.common,`onBackground`,`#fff`));function r(e,t,n){if(b){let r;return e===no&&(r=`transparent ${((1-n)*100).toFixed(0)}%`),e===G&&(r=`#000 ${(n*100).toFixed(0)}%`),e===ao&&(r=`#fff ${(n*100).toFixed(0)}%`),`color-mix(in ${b}, ${t}, ${r})`}return e(t,n)}if(Xs(t,[`Alert`,`AppBar`,`Avatar`,`Button`,`Chip`,`FilledInput`,`LinearProgress`,`Skeleton`,`Slider`,`SnackbarContent`,`SpeedDialAction`,`StepConnector`,`StepContent`,`Switch`,`TableCell`,`Tooltip`]),t.mode===`light`){J(t.Alert,`errorColor`,r(G,o?p(`palette-error-light`):t.error.light,.6)),J(t.Alert,`infoColor`,r(G,o?p(`palette-info-light`):t.info.light,.6)),J(t.Alert,`successColor`,r(G,o?p(`palette-success-light`):t.success.light,.6)),J(t.Alert,`warningColor`,r(G,o?p(`palette-warning-light`):t.warning.light,.6)),J(t.Alert,`errorFilledBg`,n(`palette-error-main`)),J(t.Alert,`infoFilledBg`,n(`palette-info-main`)),J(t.Alert,`successFilledBg`,n(`palette-success-main`)),J(t.Alert,`warningFilledBg`,n(`palette-warning-main`)),J(t.Alert,`errorFilledColor`,ec(()=>t.getContrastText(t.error.main))),J(t.Alert,`infoFilledColor`,ec(()=>t.getContrastText(t.info.main))),J(t.Alert,`successFilledColor`,ec(()=>t.getContrastText(t.success.main))),J(t.Alert,`warningFilledColor`,ec(()=>t.getContrastText(t.warning.main))),J(t.Alert,`errorStandardBg`,r(ao,o?p(`palette-error-light`):t.error.light,.9)),J(t.Alert,`infoStandardBg`,r(ao,o?p(`palette-info-light`):t.info.light,.9)),J(t.Alert,`successStandardBg`,r(ao,o?p(`palette-success-light`):t.success.light,.9)),J(t.Alert,`warningStandardBg`,r(ao,o?p(`palette-warning-light`):t.warning.light,.9)),J(t.Alert,`errorIconColor`,n(`palette-error-main`)),J(t.Alert,`infoIconColor`,n(`palette-info-main`)),J(t.Alert,`successIconColor`,n(`palette-success-main`)),J(t.Alert,`warningIconColor`,n(`palette-warning-main`)),J(t.AppBar,`defaultBg`,n(`palette-grey-100`)),J(t.Avatar,`defaultBg`,n(`palette-grey-400`)),J(t.Button,`inheritContainedBg`,n(`palette-grey-300`)),J(t.Button,`inheritContainedHoverBg`,n(`palette-grey-A100`)),J(t.Chip,`defaultBorder`,n(`palette-grey-400`)),J(t.Chip,`defaultAvatarColor`,n(`palette-grey-700`)),J(t.Chip,`defaultIconColor`,n(`palette-grey-700`)),J(t.FilledInput,`bg`,`rgba(0, 0, 0, 0.06)`),J(t.FilledInput,`hoverBg`,`rgba(0, 0, 0, 0.09)`),J(t.FilledInput,`disabledBg`,`rgba(0, 0, 0, 0.12)`),J(t.LinearProgress,`primaryBg`,r(ao,o?p(`palette-primary-main`):t.primary.main,.62)),J(t.LinearProgress,`secondaryBg`,r(ao,o?p(`palette-secondary-main`):t.secondary.main,.62)),J(t.LinearProgress,`errorBg`,r(ao,o?p(`palette-error-main`):t.error.main,.62)),J(t.LinearProgress,`infoBg`,r(ao,o?p(`palette-info-main`):t.info.main,.62)),J(t.LinearProgress,`successBg`,r(ao,o?p(`palette-success-main`):t.success.main,.62)),J(t.LinearProgress,`warningBg`,r(ao,o?p(`palette-warning-light`):t.warning.main,.62)),J(t.Skeleton,`bg`,b?r(no,o?p(`palette-text-primary`):t.text.primary,.11):`rgba(${n(`palette-text-primaryChannel`)} / 0.11)`),J(t.Slider,`primaryTrack`,r(ao,o?p(`palette-primary-main`):t.primary.main,.62)),J(t.Slider,`secondaryTrack`,r(ao,o?p(`palette-secondary-main`):t.secondary.main,.62)),J(t.Slider,`errorTrack`,r(ao,o?p(`palette-error-main`):t.error.main,.62)),J(t.Slider,`infoTrack`,r(ao,o?p(`palette-info-main`):t.info.main,.62)),J(t.Slider,`successTrack`,r(ao,o?p(`palette-succ
Line truncated
|
||||
0% {
|
||||
transform: scale(0);
|
||||
opacity: 0.1;
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: scale(1);
|
||||
opacity: 0.3;
|
||||
}
|
||||
`,Bl=hr`
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
`,Vl=hr`
|
||||
0% {
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: scale(0.92);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: scale(1);
|
||||
}
|
||||
`,Hl=Y(`span`,{name:`MuiTouchRipple`,slot:`Root`})({overflow:`hidden`,pointerEvents:`none`,position:`absolute`,zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:`inherit`}),Ul=Y(Ll,{name:`MuiTouchRipple`,slot:`Ripple`})`
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
|
||||
&.${Z.rippleVisible} {
|
||||
opacity: 0.3;
|
||||
transform: scale(1);
|
||||
animation-name: ${zl};
|
||||
animation-duration: ${Rl}ms;
|
||||
animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
|
||||
}
|
||||
|
||||
&.${Z.ripplePulsate} {
|
||||
animation-duration: ${({theme:e})=>e.transitions.duration.shorter}ms;
|
||||
}
|
||||
|
||||
& .${Z.child} {
|
||||
opacity: 1;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
background-color: currentColor;
|
||||
}
|
||||
|
||||
& .${Z.childLeaving} {
|
||||
opacity: 0;
|
||||
animation-name: ${Bl};
|
||||
animation-duration: ${Rl}ms;
|
||||
animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
|
||||
}
|
||||
|
||||
& .${Z.childPulsate} {
|
||||
position: absolute;
|
||||
/* @noflip */
|
||||
left: 0px;
|
||||
top: 0;
|
||||
animation-name: ${Vl};
|
||||
animation-duration: 2500ms;
|
||||
animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut};
|
||||
animation-iteration-count: infinite;
|
||||
animation-delay: 200ms;
|
||||
}
|
||||
`,Wl=z.forwardRef(function(e,t){let{center:n=!1,classes:r={},className:i,...a}=mc({props:e,name:`MuiTouchRipple`}),[o,s]=z.useState([]),c=z.useRef(0),l=z.useRef(null);z.useEffect(()=>{l.current&&=(l.current(),null)},[o]);let u=z.useRef(!1),d=ml(),f=z.useRef(null),p=z.useRef(null),m=z.useCallback(e=>{let{pulsate:t,rippleX:n,rippleY:i,rippleSize:a,cb:o}=e;s(e=>[...e,(0,B.jsx)(Ul,{classes:{ripple:H(r.ripple,Z.ripple),rippleVisible:H(r.rippleVisible,Z.rippleVisible),ripplePulsate:H(r.ripplePulsate,Z.ripplePulsate),child:H(r.child,Z.child),childLeaving:H(r.childLeaving,Z.childLeaving),childPulsate:H(r.childPulsate,Z.childPulsate)},timeout:Rl,pulsate:t,rippleX:n,rippleY:i,rippleSize:a},c.current)]),c.current+=1,l.current=o},[r]),h=z.useCallback((e={},t={},r=()=>{})=>{let{pulsate:i=!1,center:a=n||t.pulsate,fakeElement:o=!1}=t;if(e?.type===`mousedown`&&u.current){u.current=!1;return}e?.type===`touchstart`&&(u.current=!0);let s=o?null:p.current,c=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0},l,h,g;if(a||e===void 0||e.clientX===0&&e.clientY===0||!e.clientX&&!e.touches)l=Math.round(c.width/2),h=Math.round(c.height/2);else{let{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;l=Math.round(t-c.left),h=Math.round(n-c.top)}if(a)g=Math.sqrt((2*c.width**2+c.height**2)/3),g%2==0&&(g+=1);else{let e=Math.max(Math.abs((s?s.clientWidth:0)-l),l)*2+2,t=Math.max(Math.abs((s?s.clientHeight:0)-h),h)*2+2;g=Math.sqrt(e**2+t**2)}e?.touches?f.current===null&&(f.current=()=>{m({pulsate:i,rippleX:l,rippleY:h,rippleSize:g,cb:r})},d.start(80,()=>{f.current&&=(f.current(),null)})):m({pulsate:i,rippleX:l,rippleY:h,rippleSize:g,cb:r})},[n,m,d]),g=z.useCallback(()=>{h({},{pulsate:!0})},[h]),_=z.useCallback((e,t)=>{if(d.clear(),e?.type===`touchend`&&f.current){f.current(),f.current=null,d.start(0,()=>{_(e,t)});return}f.current=null,s(e=>e.length>0?e.slice(1):e),l.current=t},[d]);return z.useImperativeHandle(t,()=>({pulsate:g,start:h,stop:_}),[g,h,_]),(0,B.jsx)(Hl,{className:H(Z.root,r.root,i),ref:p,...a,children:(0,B.jsx)(cl,{component:null,exit:!0,children:o})})});function Gl(e){return U(`MuiButtonBase`,e)}var Kl=W(`MuiButtonBase`,[`root`,`disabled`,`focusVisible`]),ql=e=>{let{disabled:t,focusVisible:n,focusVisibleClassName:r,suppressFocusVisible:i,classes:a}=e,o=q({root:[`root`,t&&`disabled`,n&&!i&&`focusVisible`]},Gl,a);return n&&!i&&r&&(o.root+=` ${r}`),o},Jl=Y(`button`,{name:`MuiButtonBase`,slot:`Root`})({display:`inline-flex`,alignItems:`center`,justifyContent:`center`,position:`relative`,boxSizing:`border-box`,WebkitTapHighlightColor:`transparent`,backgroundColor:`transparent`,outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:`pointer`,userSelect:`none`,verticalAlign:`middle`,MozAppearance:`none`,WebkitAppearance:`none`,textDecoration:`none`,color:`inherit`,"&::-moz-focus-inner":{borderStyle:`none`},[`&.${Kl.disabled}`]:{pointerEvents:`none`,cursor:`default`},"@media print":{colorAdjust:`exact`}}),Yl=z.forwardRef(function(e,t){let n=mc({props:e,name:`MuiButtonBase`}),{action:r,centerRipple:i=!1,children:a,className:o,component:s=`button`,disabled:c=!1,disableRipple:l=!1,disableTouchRipple:u=!1,focusRipple:d=!1,focusVisibleClassName:f,focusableWhenDisabled:p,suppressFocusVisible:m=!1,internalNativeButton:h,LinkComponent:g=`a`,nativeButton:_,onBlur:v,onClick:y,onContextMenu:b,onDragLeave:x,onFocus:S,onFocusVisible:C,onKeyDown:w,onKeyUp:T,onMouseDown:E,onMouseLeave:D,onMouseUp:O,onTouchEnd:k,onTouchMove:ee,onTouchStart:A,tabIndex:j=0,TouchRippleProps:te,touchRippleRef:ne,type:re,...M}=n,N=!!(M.href||M.to),ie=!!M.formAction,ae=s;ae===`button`&&N&&(ae=g);let oe=typeof ae==`string`?ae===`button`:h??!1,P=_??oe,F=Fl(),I=Lc(F.ref,ne),[se,ce]=z.useState(!1);(c||m)&&se&&ce(!1);let le=Fc(e=>{d&&!e.repeat&&se&&e.key===` `&&F.stop(e,()=>{F.start(e)})}),ue=Fc(e=>{d&&e.key===` `&&se&&!e.defaultPrevented&&F.stop(e,()=>{F.pulsate(e)})}),{getButtonProps:de,rootRef:fe}=Nl({nativeButton:P,nativeButtonProp:_,internalNativeButton:oe,allowInferredHostMismatch:N||typeof ae==`string`,disabled:c,type:re,hasFormAction:ie,tabIndex:j,onBeforeKeyDown:le,onBeforeKeyUp:ue}),{onClick:pe,onKeyDown:me,onKeyUp:he,...ge}=de({onClick:y,onKeyDown:w,onKeyUp:T});z.useImperativeHandle(r,()=>({focusVisible:()=>{ce(!0),fe.current.focus()}}),[fe]);let _e=F.shouldMount&&!l&&!c;z.useEffect(()=>{se&&d&&!l&&F.pulsate()},[l,d,se,F]);let L=Xl(F,`start`,E,u),ve=Xl(F,`stop`,b,u),R=Xl(F,`stop`,x,u),ye=Xl(F,`stop`,O,u),be=Xl(F,`stop`,e=>{se&&e.preventDefault(),D&&D(e)},u),xe=Xl(F,`start`,A,u),Se=Xl(F,`stop`,k,u),Ce=Xl(F,`stop`,ee,u),we=Xl(F,`stop`,e=>{Al(e.target)||ce(!1),v&&v(e)},!1),Te=Fc(e=>{fe.current||=e.currentTarget,!m&&Al(e.target)&&(ce(!0),C&&C(e)),S&&S(e)}),Ee={};N&&(Ee.tabIndex=c?-1:j,c&&(Ee[`aria-disabled`]=c),Ee.type=re);let De=Lc(t,fe),Oe={...n,centerRipple:i,component:s,disabled:c,disableRipple:l,disableTouchRipple:u,focusRipple:d,suppressFocusVisible:m,tabIndex:j,focusVisible:se},ke=ql(Oe);return(0,B.jsxs)(Jl,{as:ae,className:H(ke.root,o)
Line truncated
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
`,au=hr`
|
||||
0% {
|
||||
stroke-dasharray: 1px, 200px;
|
||||
stroke-dashoffset: 0;
|
||||
}
|
||||
|
||||
50% {
|
||||
stroke-dasharray: 100px, 200px;
|
||||
stroke-dashoffset: -15px;
|
||||
}
|
||||
|
||||
100% {
|
||||
stroke-dasharray: 1px, 200px;
|
||||
stroke-dashoffset: -126px;
|
||||
}
|
||||
`,ou=typeof iu==`string`?null:mr`
|
||||
animation: ${iu} 1.4s linear infinite;
|
||||
`,su=typeof au==`string`?null:mr`
|
||||
animation: ${au} 1.4s ease-in-out infinite;
|
||||
`,cu=e=>{let{classes:t,variant:n,color:r,disableShrink:i}=e;return q({root:[`root`,n,`color${X(r)}`],svg:[`svg`],track:[`track`],circle:[`circle`,i&&`circleDisableShrink`]},nu,t)},lu=Y(`span`,{name:`MuiCircularProgress`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t[`color${X(n.color)}`]]}})(pc(({theme:e})=>({display:`inline-block`,variants:[{props:{variant:`determinate`},style:{transition:e.transitions.create(`transform`)}},{props:{variant:`indeterminate`},style:ou||{animation:`${iu} 1.4s linear infinite`}},...Object.entries(e.palette).filter($l()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),uu=Y(`svg`,{name:`MuiCircularProgress`,slot:`Svg`})({display:`block`}),du=Y(`circle`,{name:`MuiCircularProgress`,slot:`Circle`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.circle,n.disableShrink&&t.circleDisableShrink]}})(pc(({theme:e})=>({stroke:`currentColor`,variants:[{props:{variant:`determinate`},style:{transition:e.transitions.create(`stroke-dashoffset`)}},{props:{variant:`indeterminate`},style:{strokeDasharray:`80px, 200px`,strokeDashoffset:0}},{props:({ownerState:e})=>e.variant===`indeterminate`&&!e.disableShrink,style:su||{animation:`${au} 1.4s ease-in-out infinite`}}]}))),fu=Y(`circle`,{name:`MuiCircularProgress`,slot:`Track`})(pc(({theme:e})=>({stroke:`currentColor`,opacity:(e.vars||e).palette.action.activatedOpacity}))),pu=z.forwardRef(function(e,t){let n=mc({props:e,name:`MuiCircularProgress`}),{className:r,color:i=`primary`,disableShrink:a=!1,enableTrackSlot:o=!1,size:s=40,style:c,thickness:l=3.6,value:u=0,variant:d=`indeterminate`,...f}=n,p={...n,color:i,disableShrink:a,size:s,thickness:l,value:u,variant:d,enableTrackSlot:o},m=cu(p),h={},g={},_={};if(d===`determinate`){let e=2*Math.PI*((ru-l)/2);h.strokeDasharray=e.toFixed(3),_[`aria-valuenow`]=Math.round(u),h.strokeDashoffset=`${((100-u)/100*e).toFixed(3)}px`,g.transform=`rotate(-90deg)`}return(0,B.jsx)(lu,{className:H(m.root,r),style:{width:s,height:s,...g,...c},ownerState:p,ref:t,role:`progressbar`,..._,...f,children:(0,B.jsxs)(uu,{className:m.svg,ownerState:p,viewBox:`${ru/2} ${ru/2} ${ru} ${ru}`,children:[o?(0,B.jsx)(fu,{className:m.track,ownerState:p,cx:ru,cy:ru,r:(ru-l)/2,fill:`none`,strokeWidth:l,"aria-hidden":`true`}):null,(0,B.jsx)(du,{className:m.circle,style:h,ownerState:p,cx:ru,cy:ru,r:(ru-l)/2,fill:`none`,strokeWidth:l})]})})});function mu(e){return U(`MuiIconButton`,e)}var hu=W(`MuiIconButton`,[`root`,`disabled`,`colorInherit`,`colorPrimary`,`colorSecondary`,`colorError`,`colorInfo`,`colorSuccess`,`colorWarning`,`edgeStart`,`edgeEnd`,`sizeSmall`,`sizeMedium`,`sizeLarge`,`loading`,`loadingIndicator`,`loadingWrapper`]),gu=e=>{let{classes:t,disabled:n,color:r,edge:i,size:a,loading:o}=e;return q({root:[`root`,o&&`loading`,n&&`disabled`,r!==`default`&&`color${X(r)}`,i&&`edge${X(i)}`,`size${X(a)}`],loadingIndicator:[`loadingIndicator`],loadingWrapper:[`loadingWrapper`]},mu,t)},_u=Y(Yl,{name:`MuiIconButton`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!==`default`&&t[`color${X(n.color)}`],n.edge&&t[`edge${X(n.edge)}`],t[`size${X(n.size)}`]]}})(pc(({theme:e})=>({textAlign:`center`,flex:`0 0 auto`,fontSize:e.typography.pxToRem(24),padding:8,borderRadius:`50%`,color:(e.vars||e).palette.action.active,transition:e.transitions.create(`background-color`,{duration:e.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"&:hover":{backgroundColor:`var(--IconButton-hoverBg)`,"@media (hover: none)":{backgroundColor:`transparent`}}}},{props:{edge:`start`},style:{marginLeft:-12}},{props:{edge:`start`,size:`small`},style:{marginLeft:-3}},{props:{edge:`end`},style:{marginRight:-12}},{props:{edge:`end`,size:`small`},style:{marginRight:-3}}]})),pc(({theme:e})=>({variants:[{props:{color:`inherit`},style:{color:`inherit`}},...Object.entries(e.palette).filter($l()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter($l()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}})),{props:{size:`small`},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:`large`},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${hu.disabled}`]:{backgroundColor:`transparent`,color:(e.vars||e).palette.action.disabled},[`&.${hu.loading}`]:{color:`transparent`}}))),vu=Y(`span`,{name:`MuiIconButton`,slot:`LoadingIndicator`})(({theme:e})=>({display:`none`,position:`absolute`,visibility:`visible`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:`flex`}}]})),yu=z.forwardRef(function(e,t){let n=mc({props:e,name:`MuiIconButton`}),{edge:r=!1,children:i,className:a,color:o=`Line truncated
|
||||
`&&(n.value+=` `);let o=a.boxSizing,s=pp(a.paddingBottom)+pp(a.paddingTop),c=pp(a.borderBottomWidth)+pp(a.borderTopWidth),u=n.scrollHeight;n.value=`x`;let d=n.scrollHeight,p=u;return i&&(p=Math.max(Number(i)*d,p)),r&&(p=Math.min(Number(r)*d,p)),p=Math.max(p,d),{outerHeightStyle:p+(o===`border-box`?s+c:0),overflowing:Math.abs(p-u)<=1}},[r,i,e.placeholder]),m=Pc(()=>{let e=l.current,t=p();if(!e||!t||gp(t))return!1;let n=t.outerHeightStyle;return d.current!=null&&d.current!==n}),h=z.useCallback(()=>{let e=l.current,t=p();if(!e||!t||gp(t))return;let n=t.outerHeightStyle;d.current!==n&&(d.current=n,e.style.height=`${n}px`),e.style.overflow=t.overflowing?`hidden`:``},[p]),g=z.useRef(-1);return Wa(()=>{let e=bc(h),t=l?.current;if(!t)return;let n=Dc(t);n.addEventListener(`resize`,e);let r;return typeof ResizeObserver<`u`&&(r=new ResizeObserver(()=>{m()&&(r.unobserve(t),cancelAnimationFrame(g.current),h(),g.current=requestAnimationFrame(()=>{r.observe(t)}))}),r.observe(t)),()=>{e.clear(),cancelAnimationFrame(g.current),n.removeEventListener(`resize`,e),r&&r.disconnect()}},[p,h,m]),Wa(()=>{h()}),(0,B.jsxs)(z.Fragment,{children:[(0,B.jsx)(`textarea`,{value:o,onChange:e=>{c||h();let t=e.target,r=t.value.length,i=t.value.endsWith(`
|
||||
`),a=t.selectionStart===r;i&&a&&t.setSelectionRange(r,r),n&&n(e)},ref:u,rows:i,style:a,...s}),(0,B.jsx)(`textarea`,{"aria-hidden":!0,className:e.className,readOnly:!0,ref:f,tabIndex:-1,style:{...mp.shadow,...a,paddingTop:0,paddingBottom:0}})]})});function vp({props:e,states:t,muiFormControl:n}){return t.reduce((t,r)=>(t[r]=e[r],n&&e[r]===void 0&&(t[r]=n[r]),t),{})}var yp=z.createContext(void 0);function bp(){return z.useContext(yp)}function xp(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function Sp(e,t=!1){return e&&(xp(e.value)&&e.value!==``||t&&xp(e.defaultValue)&&e.defaultValue!==``)}function Cp(e){return e.startAdornment}function wp(e){return U(`MuiInputBase`,e)}var Tp=W(`MuiInputBase`,[`root`,`formControl`,`focused`,`disabled`,`adornedStart`,`adornedEnd`,`error`,`sizeSmall`,`multiline`,`colorSecondary`,`fullWidth`,`hiddenLabel`,`readOnly`,`input`,`inputTypeSearch`]),Ep,Dp=(e,t)=>{let{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size===`small`&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${X(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},Op=(e,t)=>{let{ownerState:n}=e;return[t.input,n.type===`search`&&t.inputTypeSearch]},kp=e=>{let{classes:t,color:n,disabled:r,error:i,endAdornment:a,focused:o,formControl:s,fullWidth:c,hiddenLabel:l,multiline:u,readOnly:d,size:f,startAdornment:p,type:m}=e;return q({root:[`root`,`color${X(n)}`,r&&`disabled`,i&&`error`,c&&`fullWidth`,o&&`focused`,s&&`formControl`,f&&f!==`medium`&&`size${X(f)}`,u&&`multiline`,p&&`adornedStart`,a&&`adornedEnd`,l&&`hiddenLabel`,d&&`readOnly`],input:[`input`,r&&`disabled`,m===`search`&&`inputTypeSearch`,d&&`readOnly`]},wp,t)},Ap=Y(`div`,{name:`MuiInputBase`,slot:`Root`,overridesResolver:Dp})(pc(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:`1.4375em`,boxSizing:`border-box`,position:`relative`,cursor:`text`,display:`inline-flex`,alignItems:`center`,[`&.${Tp.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:`default`},variants:[{props:({ownerState:e})=>e.multiline,style:{padding:`4px 0 5px`}},{props:({ownerState:e,size:t})=>e.multiline&&t===`small`,style:{paddingTop:1}},{props:({ownerState:e})=>e.fullWidth,style:{width:`100%`}}]}))),jp=Y(`input`,{name:`MuiInputBase`,slot:`Input`,overridesResolver:Op})(pc(({theme:e})=>{let t=e.palette.mode===`light`,n={color:`currentColor`,...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create(`opacity`,{duration:e.transitions.duration.shorter})},r={opacity:`0 !important`},i=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:`inherit`,letterSpacing:`inherit`,color:`currentColor`,padding:`4px 0 5px`,border:0,boxSizing:`content-box`,background:`none`,height:`1.4375em`,margin:0,WebkitTapHighlightColor:`transparent`,display:`block`,minWidth:0,width:`100%`,"&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:`none`},"&::-webkit-search-decoration":{WebkitAppearance:`none`},[`label[data-shrink=false] + .${Tp.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":i,"&:focus::-moz-placeholder":i,"&:focus::-ms-input-placeholder":i},[`&.${Tp.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:e})=>!e.disableInjectingGlobalStyles,style:{animationName:`mui-auto-fill-cancel`,animationDuration:`10ms`,"&:-webkit-autofill":{animationDuration:`5000s`,animationName:`mui-auto-fill`}}},{props:{size:`small`},style:{paddingTop:1}},{props:({ownerState:e})=>e.multiline,style:{height:`auto`,resize:`none`,padding:0,paddingTop:0}},{props:{type:`search`},style:{MozAppearance:`textfield`}}]}})),Mp=fc({"@keyframes mui-auto-fill":{from:{display:`block`}},"@keyframes mui-auto-fill-cancel":{from:{display:`block`}}}),Np=z.forwardRef(function(e,t){let n=mc({props:e,name:`MuiInputBase`}),{"aria-describedby":r,autoComplete:i,autoFocus:a,className:o,color:s,defaultValue:c,disabled:l,disableInjectingGlobalStyles:u,endAdornment:d,error:f,fullWidth:p=!1,id:m,inputComponent:h=`input`,inputProps:g={},inputRef:_,margin:v,maxRows:y,minRows:b,multiline:x=!1,name:S,onBlur:C,onChange:w,onClick:T,onFocus:E,onKeyDown:D,onKeyUp:O,placeholder:k,readOnly:ee,renderSuffix:A,rows:j,size:te,slotProps:ne={},slots:re={},startAdornment:M,type:N=`text`,value:ie,...ae}=n,oe=g.value==null?ie:g.value,{current:P}=z.useRef(oe!=null),F=z.useRef(),I=z.useCallback(e=>{},[]),se=Lc(F,_,g.ref,I),[ce,le]=z.useState(!1),ue=bp(),de=vp({props:n,muiFormControl:ue,states:[`color`,`disabled`,`error`,`hiddenLabel`,`size`,`required`,`filled`]});de.focused=ue?ue.focused:ce,z.useEffect(()=>{!ue&&l&&ce&&(le(!1),C&&C())},[ue,l,ce,C]);let fe=ue&&ue.onFilled,pe=ue&&ue.onEmpty,me=z.useCallback(e=>{Sp(e)?fe&&fe():pe&&pe()},[fe
Line truncated
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Azure Image Chooser</title>
|
||||
<script type="module" crossorigin src="/assets/index-DPvVOxFj.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -36,6 +36,7 @@ const App = () => {
|
||||
const [skuExport, setSkuExport] = useState("");
|
||||
const [renderError, setRenderError] = useState("");
|
||||
|
||||
const healthQuery = useQuery({ queryKey: ["health"], queryFn: api.health });
|
||||
const locationsQuery = useQuery({ queryKey: ["locations"], queryFn: api.locations });
|
||||
const publishersQuery = useQuery({
|
||||
queryKey: ["publishers", selection.location],
|
||||
@@ -127,6 +128,8 @@ const App = () => {
|
||||
};
|
||||
|
||||
const loading = locationsQuery.isLoading || templatesQuery.isLoading;
|
||||
const healthError = healthQuery.error instanceof Error ? healthQuery.error.message : "";
|
||||
const appNotConfigured = healthError.includes("Missing AZURE_SUBSCRIPTION_ID");
|
||||
const locationsError = locationsQuery.error instanceof Error ? locationsQuery.error.message : "Failed to load locations";
|
||||
|
||||
return (
|
||||
@@ -140,10 +143,16 @@ const App = () => {
|
||||
Select a marketplace image and generate reusable snippets.
|
||||
</Typography>
|
||||
|
||||
{appNotConfigured ? (
|
||||
<Alert severity="warning">
|
||||
App is not configured. Set AZURE_SUBSCRIPTION_ID (and Azure credentials) in the container start environment, then restart the app.
|
||||
</Alert>
|
||||
) : null}
|
||||
|
||||
{loading ? (
|
||||
<CircularProgress />
|
||||
) : locationsQuery.isError ? (
|
||||
<Alert severity="error">{locationsError}</Alert>
|
||||
<Alert severity={appNotConfigured ? "warning" : "error"}>{locationsError}</Alert>
|
||||
) : (
|
||||
<Card>
|
||||
<CardContent>
|
||||
|
||||
@@ -18,6 +18,7 @@ const json = async <T>(path: string): Promise<T> => {
|
||||
};
|
||||
|
||||
export const api = {
|
||||
health: () => json<{ status: string; message?: string }>("/api/health"),
|
||||
locations: () => json<LocationOption[]>("/api/locations"),
|
||||
publishers: (location: string) => json<string[]>(`/api/publishers?location=${encodeURIComponent(location)}`),
|
||||
offers: (location: string, publisher: string) =>
|
||||
|
||||
Reference in new issue
Block a user