/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
const behaviorCache = /* @__PURE__ */ new WeakMap();
const clientCache = /* @__PURE__ */ new WeakMap();
var ClusterBehaviorCache;
((ClusterBehaviorCache2) => {
  function get(base, schema, forClient) {
    const cache = forClient ? clientCache : behaviorCache;
    const baseCache = cache.get(base);
    if (baseCache === void 0) {
      return;
    }
    return baseCache.get(schema)?.deref();
  }
  ClusterBehaviorCache2.get = get;
  function set(base, schema, type) {
    let baseCache = behaviorCache.get(base);
    if (baseCache === void 0) {
      behaviorCache.set(base, baseCache = /* @__PURE__ */ new WeakMap());
    }
    baseCache.set(schema, new WeakRef(type));
  }
  ClusterBehaviorCache2.set = set;
})(ClusterBehaviorCache || (ClusterBehaviorCache = {}));
export {
  ClusterBehaviorCache
};
//# sourceMappingURL=ClusterBehaviorCache.js.map
