var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/plus/pisellTopology/topologyLocale.ts
var topologyLocale_exports = {};
__export(topologyLocale_exports, {
  getTopologyCanvasDevicesName: () => getTopologyCanvasDevicesName,
  getTopologyCategoryAreaLabel: () => getTopologyCategoryAreaLabel,
  getTopologyCategoryDevicesLabel: () => getTopologyCategoryDevicesLabel,
  getTopologyText: () => getTopologyText,
  normalizeTopologyLocaleMaps: () => normalizeTopologyLocaleMaps,
  resolveTopologyDisplayLocale: () => resolveTopologyDisplayLocale
});
module.exports = __toCommonJS(topologyLocale_exports);
var import_materials = require("@pisell/materials");
var import_utils = require("@pisell/utils");
var import_locales = __toESM(require("./locales"));
function normalizeTopologyLocaleMaps(maps) {
  return {
    en: maps.en ?? {},
    "zh-CN": maps["zh-CN"] ?? maps.zh ?? {},
    "zh-HK": maps["zh-HK"] ?? maps.tc ?? {}
  };
}
function resolveTopologyDisplayLocale(engineCtx) {
  return (0, import_materials.getFloorMapDisplayLocale)(engineCtx);
}
function getTopologyText(id, displayLocale) {
  var _a, _b, _c, _d, _e, _f;
  const lang = import_utils.locales.formatLocale(displayLocale);
  const maps = import_locales.default;
  return ((_a = maps[lang]) == null ? void 0 : _a[id]) ?? ((_b = maps["zh-CN"]) == null ? void 0 : _b[id]) ?? ((_c = maps.zh) == null ? void 0 : _c[id]) ?? ((_d = maps["zh-HK"]) == null ? void 0 : _d[id]) ?? ((_e = maps.tc) == null ? void 0 : _e[id]) ?? ((_f = maps.en) == null ? void 0 : _f[id]);
}
function getTopologyCanvasDevicesName(displayLocale) {
  return getTopologyText("pisell-topology.canvas.devices", displayLocale) ?? "设备";
}
function getTopologyCategoryDevicesLabel(displayLocale) {
  return getTopologyText("pisell-topology.category.devices", displayLocale) ?? "设备";
}
function getTopologyCategoryAreaLabel(displayLocale) {
  return getTopologyText("pisell-topology.category.area", displayLocale) ?? "分区";
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  getTopologyCanvasDevicesName,
  getTopologyCategoryAreaLabel,
  getTopologyCategoryDevicesLabel,
  getTopologyText,
  normalizeTopologyLocaleMaps,
  resolveTopologyDisplayLocale
});
