{
  "version": 3,
  "sources": ["../../src/popover/overlay-middlewares.tsx"],
  "sourcesContent": ["/**\n * External dependencies\n */\n\nimport { size } from '@floating-ui/react-dom';\nexport function overlayMiddlewares() {\n  return [{\n    name: 'overlay',\n    fn({\n      rects\n    }) {\n      return rects.reference;\n    }\n  }, size({\n    apply({\n      rects,\n      elements\n    }) {\n      const {\n        firstElementChild\n      } = elements.floating ?? {};\n\n      // Only HTMLElement instances have the `style` property.\n      if (!(firstElementChild instanceof HTMLElement)) {\n        return;\n      }\n\n      // Reduce the height of the popover to the available space.\n      Object.assign(firstElementChild.style, {\n        width: `${rects.reference.width}px`,\n        height: `${rects.reference.height}px`\n      });\n    }\n  })];\n}"],
  "mappings": ";AAIA,SAAS,YAAY;AACd,SAAS,qBAAqB;AACnC,SAAO,CAAC;AAAA,IACN,MAAM;AAAA,IACN,GAAG;AAAA,MACD;AAAA,IACF,GAAG;AACD,aAAO,MAAM;AAAA,IACf;AAAA,EACF,GAAG,KAAK;AAAA,IACN,MAAM;AAAA,MACJ;AAAA,MACA;AAAA,IACF,GAAG;AACD,YAAM;AAAA,QACJ;AAAA,MACF,IAAI,SAAS,YAAY,CAAC;AAG1B,UAAI,EAAE,6BAA6B,cAAc;AAC/C;AAAA,MACF;AAGA,aAAO,OAAO,kBAAkB,OAAO;AAAA,QACrC,OAAO,GAAG,MAAM,UAAU,KAAK;AAAA,QAC/B,QAAQ,GAAG,MAAM,UAAU,MAAM;AAAA,MACnC,CAAC;AAAA,IACH;AAAA,EACF,CAAC,CAAC;AACJ;",
  "names": []
}
