;
{
  try {
    let e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
    n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "68565975-5bac-4d10-ad44-348430fc4892", e._sentryDebugIdIdentifier = "sentry-dbid-68565975-5bac-4d10-ad44-348430fc4892");
  } catch (e) {
  }
}
;
function getProp(object, path) {
  const splitPath = path.split(".");
  return splitPath.reduce((xs, x) => xs && xs[x] !== void 0 ? xs[x] : void 0, object);
}
function assignToProp(path, obj, val) {
  const splitPath = path.split(".");
  const pathDepth = splitPath.length;
  let currentObj = obj;
  splitPath.forEach((key, index) => {
    if (index === pathDepth - 1) {
      currentObj[key] = val;
    } else {
      if (!currentObj[key]) {
        currentObj[key] = {};
      }
      currentObj = currentObj[key];
    }
  });
}
function deleteProp(path, obj) {
  const splitPath = path.split(".");
  const pathDepth = splitPath.length;
  let currentObj = obj;
  splitPath.forEach((key, index) => {
    if (currentObj[key] === void 0) {
      throw Error(`The given path does not exist on the object: ${key} (${path})`);
    }
    if (index === pathDepth - 1) {
      delete currentObj[key];
    } else {
      currentObj = currentObj[key];
    }
  });
}
const formatObject = (obj, mapping) => {
  const formattedObj = {};
  Object.entries(mapping).forEach(([targetKey, sourceKey]) => {
    const value = getProp(obj, sourceKey);
    if (value !== void 0) {
      assignToProp(targetKey, formattedObj, value);
    }
  });
  return formattedObj;
};
const mapWith = (obj, mapping) => {
  const formattedObj = {};
  for (const [sourceKey, targetKey] of Object.entries(mapping)) {
    const value = getProp(obj, sourceKey);
    if (value !== void 0) {
      assignToProp(targetKey, formattedObj, value);
    }
  }
  return formattedObj;
};
export {
  assignToProp as a,
  deleteProp as d,
  formatObject as f,
  getProp as g,
  mapWith as m
};
