{"version":3,"file":"getLogicalBoundaries.cjs","names":["getLogicalBoundaries","element","isRTL","document","documentElement","getAttribute","top","bottom","left","right","getBoundingClientRect","exports"],"sources":["../../src/getLogicalBoundaries.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\n/**\n * Retrieves the logical boundaries (top, bottom, left, right) of a given HTML element.\n *\n * The function considers the document's text direction (`dir` attribute) to determine whether the left and right boundaries should be swapped.\n */\nexport const getLogicalBoundaries = (element: HTMLElement) => {\n  const isRTL = document.documentElement.getAttribute(\"dir\") === \"rtl\";\n\n  const { top, bottom, left, right } = element.getBoundingClientRect();\n\n  return {\n    top,\n    bottom,\n    // left and right are swapped for RTL\n    left: isRTL ? right : left,\n    right: isRTL ? left : right,\n  };\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAOO,MAAMA,oBAAoB,GAAIC,OAAoB,IAAK;EAC5D,MAAMC,KAAK,GAAGC,QAAQ,CAACC,eAAe,CAACC,YAAY,CAAC,KAAK,CAAC,KAAK,KAAK;EAEpE,MAAM;IAAEC,GAAG;IAAEC,MAAM;IAAEC,IAAI;IAAEC;EAAM,CAAC,GAAGR,OAAO,CAACS,qBAAqB,CAAC,CAAC;EAEpE,OAAO;IACLJ,GAAG;IACHC,MAAM;IAENC,IAAI,EAAEN,KAAK,GAAGO,KAAK,GAAGD,IAAI;IAC1BC,KAAK,EAAEP,KAAK,GAAGM,IAAI,GAAGC;EACxB,CAAC;AACH,CAAC;AAACE,OAAA,CAAAX,oBAAA,GAAAA,oBAAA","ignoreList":[]}