import{cssVars as e,toTransformOrigin as r,getBoxShadow as t}from"./utils.js";var a={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:e=>{var{state:r}=e;r.styles.popper.width=r.rects.reference.width+"px"},effect:e=>{var{state:r}=e;return()=>{var e=r.elements.reference;r.elements.popper.style.width=e.offsetWidth+"px"}}},o={name:"transformOrigin",enabled:!0,phase:"write",fn:e=>{var{state:r}=e;s(r)},effect:e=>{var{state:r}=e;return()=>{s(r)}}},s=t=>{t.elements.popper.style.setProperty(e.transformOrigin.var,r(t.placement))},n={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:e=>{var{state:r}=e;f(r)}},f=r=>{var t;if(r.placement){var a=i(r.placement);if(null!=(t=r.elements)&&t.arrow&&a){Object.assign(r.elements.arrow.style,{[a.property]:a.value,width:e.arrowSize.varRef,height:e.arrowSize.varRef,zIndex:-1});var o={[e.arrowSizeHalf.var]:"calc("+e.arrowSize.varRef+" / 2)",[e.arrowOffset.var]:"calc("+e.arrowSizeHalf.varRef+" * -1)"};for(var s in o)r.elements.arrow.style.setProperty(s,o[s])}}},i=r=>r.startsWith("top")?{property:"bottom",value:e.arrowOffset.varRef}:r.startsWith("bottom")?{property:"top",value:e.arrowOffset.varRef}:r.startsWith("left")?{property:"right",value:e.arrowOffset.varRef}:r.startsWith("right")?{property:"left",value:e.arrowOffset.varRef}:void 0,p={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:e=>{var{state:r}=e;l(r)},effect:e=>{var{state:r}=e;return()=>{l(r)}}},l=r=>{if(r.elements.arrow){var a=r.elements.arrow.querySelector("[data-popper-arrow-inner]");a&&Object.assign(a.style,{transform:"rotate(45deg)",background:e.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:t(r.placement)})}};export{p as innerArrow,a as matchWidth,n as positionArrow,o as transformOrigin};
//# sourceMappingURL=modifiers.js.map
