/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { Schema } from "@matter/model";
const cache = /* @__PURE__ */ new WeakMap();
function EnumForValueModel(model) {
  let result = cache.get(model);
  if (result !== void 0) {
    return result;
  }
  const values = {};
  for (const child of model.children) {
    if (typeof child.id === "number") {
      values[child.name] = child.id;
    }
  }
  result = Object.freeze(values);
  Schema.set(result, model);
  cache.set(model, result);
  return result;
}
export {
  EnumForValueModel
};
//# sourceMappingURL=EnumForValueModel.js.map
