import{closest as t,getElementRect as o,parentNode as e}from"./domUtils.prod.js";import r from"./extend.prod.js";import i from"./is.prod.js";export function getStringOptionResult(o,r,i){return"parent"===o?e(i):"self"===o?r.getRect(i):t(i,o)}export function resolveRectLike(t,e,r,n){let p=t;return i.string(p)?p=getStringOptionResult(p,e,r):i.func(p)&&(p=p(...n)),i.element(p)&&(p=o(p)),p}export function rectToXY(t){return t&&{x:"x"in t?t.x:t.left,y:"y"in t?t.y:t.top}}export function xywhToTlbr(t){return!t||"left"in t&&"top"in t||((t=r({},t)).left=t.x||0,t.top=t.y||0,t.right=t.right||t.left+t.width,t.bottom=t.bottom||t.top+t.height),t}export function tlbrToXywh(t){return!t||"x"in t&&"y"in t||((t=r({},t)).x=t.left||0,t.y=t.top||0,t.width=t.width||(t.right||0)-t.x,t.height=t.height||(t.bottom||0)-t.y),t}export function addEdges(t,o,e){t.left&&(o.left+=e.x),t.right&&(o.right+=e.x),t.top&&(o.top+=e.y),t.bottom&&(o.bottom+=e.y),o.width=o.right-o.left,o.height=o.bottom-o.top} //# sourceMappingURL=rect.prod.js.map