/**
 * @license
 * Copyright 2022-2025 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { InvalidMetadataError } from "#decoration/errors.js";
import { InternalError } from "#general";
import { FieldModel } from "#models/FieldModel.js";
import { Semantics } from "./Semantics.js";
class FieldSemantics extends Semantics {
  constructor(owner, name) {
    super();
    this.mutableModel = new FieldModel({ name, parent: owner.mutableModel });
  }
  createModel() {
    throw new InternalError("Unexpected FieldSemantics.createModel");
  }
  integrateModel(model) {
    if (this.localModel === void 0) {
      return model;
    }
    this.mutableModel.operationalBase = model;
    return this.mutableModel;
  }
  static of(source) {
    if (source.kind === "class") {
      throw new InvalidMetadataError(
        `Cannot retrieve field semantics for class decorator ${source.name ?? "of anonymous class"}`
      );
    }
    return Semantics.classOf(source).fieldFor(source.name);
  }
}
export {
  FieldSemantics
};
//# sourceMappingURL=FieldSemantics.js.map
