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 __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 import_node_test = __toESM(require("node:test"));
var import_strict = __toESM(require("node:assert/strict"));
var THREE = __toESM(require("three"));
var import_src = require("../src/index.js");
(0, import_node_test.default)("createBoxelScene exposes node metadata and animations for editor tooling", () => {
  const entity = {
    id: "scene-smoke",
    geometry: {
      id: "geom",
      root: {
        id: "Root",
        position: [0, 0, 0],
        children: [
          {
            id: "Child",
            position: [1, 0, 0],
            mesh: "box",
            children: []
          }
        ]
      }
    },
    primitives: [
      {
        id: "box",
        kind: "plain_box",
        size: [1, 1, 1],
        material: "mat"
      }
    ],
    materials: [{ id: "mat", baseColor: [200, 120, 60] }],
    textures: [],
    patterns: [],
    animations: [
      {
        id: "wiggle",
        duration: 2,
        channels: [
          {
            node: "Child",
            property: "position",
            keyframes: [
              { time: 0, value: [1, 0, 0] },
              { time: 1, value: [1, 0.5, 0] },
              { time: 2, value: [1, 0, 0] }
            ]
          }
        ]
      }
    ]
  };
  const result = (0, import_src.createBoxelScene)({ THREE, entity });
  import_strict.default.ok(result.root.children.length >= 1, "scene root should contain children");
  const childMeta = result.nodes.get("Child");
  import_strict.default.ok(childMeta, "child node metadata should exist");
  import_strict.default.strictEqual(childMeta.object.userData?.nodeId, "Child");
  import_strict.default.strictEqual(childMeta.object.parent?.userData?.nodeId, "Root");
  import_strict.default.ok(result.animations.length >= 1, "expected animation metadata");
  const clip = result.animations[0]?.clip;
  import_strict.default.ok(clip, "animation clip missing");
  import_strict.default.ok(clip.duration >= 2, "clip duration should cover keyframes");
  result.dispose();
});
