{"mappings":";;AAAA;;;;;;;;;;CAUC;AAKM,MAAM;IAGX,YAAY,GAAkC,CAAE;QAC9C,IAAI,CAAC,GAAG,GAAG;IACb;IAEA,YAAY,GAAQ,EAAe;QACjC,IAAI,YAAY,IAAI,CAAC,GAAG,CAAC,OAAO;QAChC,IAAI,CAAC,WACH,OAAO;QAET,IAAI,OAAO,OAAO,OAAO,CAAA,GAAA,yCAAa,EAAE,IAAI,CAAC,GAAG,EAAE,OAAO;QACzD,IAAI,CAAC,MACH,OAAO;QAGT,IAAI,gBAAgB,UAAU,qBAAqB;QACnD,IAAI,WAAW,KAAK,qBAAqB;QAEzC,OAAO;YACL,GAAG,SAAS,IAAI,GAAG,cAAc,IAAI,GAAG,UAAU,UAAU,GAAG,UAAU,UAAU;YACnF,GAAG,SAAS,GAAG,GAAG,cAAc,GAAG,GAAG,UAAU,SAAS,GAAG,UAAU,SAAS;YAC/E,OAAO,SAAS,KAAK;YACrB,QAAQ,SAAS,MAAM;QACzB;IACF;IAEA,iBAAuB;QACrB,IAAI,YAAY,IAAI,CAAC,GAAG,CAAC,OAAO;QAChC,OAAO;YACL,OAAO,WAAW,eAAe;YACjC,QAAQ,WAAW,gBAAgB;QACrC;IACF;IAEA,iBAAuB;QACrB,IAAI,YAAY,IAAI,CAAC,GAAG,CAAC,OAAO;QAChC,OAAO;YACL,GAAG,WAAW,cAAc;YAC5B,GAAG,WAAW,aAAa;YAC3B,OAAO,WAAW,eAAe;YACjC,QAAQ,WAAW,gBAAgB;QACrC;IACF;AACF","sources":["packages/react-aria/src/selection/DOMLayoutDelegate.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {getItemElement} from './utils';\nimport {Key, LayoutDelegate, Rect, RefObject, Size} from '@react-types/shared';\n\nexport class DOMLayoutDelegate implements LayoutDelegate {\n  private ref: RefObject<HTMLElement | null>;\n\n  constructor(ref: RefObject<HTMLElement | null>) {\n    this.ref = ref;\n  }\n\n  getItemRect(key: Key): Rect | null {\n    let container = this.ref.current;\n    if (!container) {\n      return null;\n    }\n    let item = key != null ? getItemElement(this.ref, key) : null;\n    if (!item) {\n      return null;\n    }\n\n    let containerRect = container.getBoundingClientRect();\n    let itemRect = item.getBoundingClientRect();\n\n    return {\n      x: itemRect.left - containerRect.left - container.clientLeft + container.scrollLeft,\n      y: itemRect.top - containerRect.top - container.clientTop + container.scrollTop,\n      width: itemRect.width,\n      height: itemRect.height\n    };\n  }\n\n  getContentSize(): Size {\n    let container = this.ref.current;\n    return {\n      width: container?.scrollWidth ?? 0,\n      height: container?.scrollHeight ?? 0\n    };\n  }\n\n  getVisibleRect(): Rect {\n    let container = this.ref.current;\n    return {\n      x: container?.scrollLeft ?? 0,\n      y: container?.scrollTop ?? 0,\n      width: container?.clientWidth ?? 0,\n      height: container?.clientHeight ?? 0\n    };\n  }\n}\n"],"names":[],"version":3,"file":"DOMLayoutDelegate.mjs.map"}