import t from"./getVariation.js";import{variationPlacements as e,basePlacements as o,placements as n}from"../enums.js";import r from"./detectOverflow.js";import a from"./getBasePlacement.js";function i(i,l){void 0===l&&(l={});var u=l,s=u.placement,d=u.boundary,c=u.rootBoundary,m=u.padding,p=u.flipVariations,f=u.allowedAutoPlacements,v=void 0===f?n:f,h=t(s),j=h?p?e:e.filter((function(e){return t(e)===h})):o,w=j.filter((function(t){return v.indexOf(t)>=0}));0===w.length&&(w=j,"production"!==process.env.NODE_ENV&&console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var y=w.reduce((function(t,e){return t[e]=r(i,{placement:e,boundary:d,rootBoundary:c,padding:m})[a(e)],t}),{});return Object.keys(y).sort((function(t,e){return y[t]-y[e]}))}export default i;
//# sourceMappingURL=computeAutoPlacement.js.map
