console.warn(['MUI: The `anchorEl` prop provided to the component is invalid.', 'The anchor element should be part of the document layout.', "Make sure the element is present in the document or that it's not display none."].join('\n'));
var top = anchorOffset.top - elemTransformOrigin.vertical;
var left = anchorOffset.left - elemTransformOrigin.horizontal;
var bottom = top + elemRect.height;
var right = left + elemRect.width;
// Use the parent window of the anchorEl if provided
var containerWindow = ownerWindow(resolveAnchorEl(anchorEl));
// Window thresholds taking required margin into account
var heightThreshold = containerWindow.innerHeight - marginThreshold;
var widthThreshold = containerWindow.innerWidth - marginThreshold;
// Check if the vertical axis needs shifting
if (top < marginThreshold) {
var diff = top - marginThreshold;
top -= diff;
elemTransformOrigin.vertical += diff;
} else if (bottom > heightThreshold) {
var _diff = bottom - heightThreshold;
top -= _diff;
elemTransformOrigin.vertical += _diff;
}
if (process.env.NODE_ENV !== 'production') {
if (elemRect.height > heightThreshold && elemRect.height && heightThreshold) {
console.error(['MUI: The popover component is too tall.', "Some part of it can not be seen on the screen (".concat(elemRect.height - heightThreshold, "px)."), 'Please consider adding a `max-height` to improve the user-experience.'].join('\n'));
return new Error(['MUI: The `anchorEl` prop provided to the component is invalid.', 'The anchor element should be part of the document layout.', "Make sure the element is present in the document or that it's not display none."].join('\n'));
}
} else {
return new Error(['MUI: The `anchorEl` prop provided to the component is invalid.', "It should be an Element instance but it's `".concat(resolvedAnchorEl, "` instead.")].join('\n'));
}
}
return null;
}),
/**
* This is the point on the anchor where the popover's
* `anchorEl` will attach to. This is not used when the