"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
function hasVirtualProps(value) {
  return typeof value === "object" && value !== null && VIRTUAL_PROP_NAMES.every((name) => name in value);
}
function enrichRowWithVirtualProps(row, key, collectionId, computeSynced, computeOrigin) {
  const existingRow = row;
  return {
    ...row,
    $synced: existingRow.$synced ?? computeSynced(),
    $origin: existingRow.$origin ?? computeOrigin(),
    $key: existingRow.$key ?? key,
    $collectionId: existingRow.$collectionId ?? collectionId
  };
}
const VIRTUAL_PROP_NAMES = [
  "$synced",
  "$origin",
  "$key",
  "$collectionId"
];
function isVirtualPropName(name) {
  return VIRTUAL_PROP_NAMES.includes(name);
}
function hasVirtualPropPath(path) {
  return path.some((segment) => isVirtualPropName(segment));
}
exports.VIRTUAL_PROP_NAMES = VIRTUAL_PROP_NAMES;
exports.enrichRowWithVirtualProps = enrichRowWithVirtualProps;
exports.hasVirtualPropPath = hasVirtualPropPath;
exports.hasVirtualProps = hasVirtualProps;
exports.isVirtualPropName = isVirtualPropName;
//# sourceMappingURL=virtual-props.cjs.map
