{"version":3,"file":"index.mjs","sources":["../../../../packages/hooks/use-popper-container/index.ts"],"sourcesContent":["import { onBeforeMount } from 'vue'\nimport { isClient } from '@vueuse/core'\nimport { generateId } from '@element-ultra/utils'\n\nlet cachedContainer: HTMLElement\n\nexport const POPPER_CONTAINER_ID = `el-popper-container-${generateId()}`\n\nexport const POPPER_CONTAINER_SELECTOR = `#${POPPER_CONTAINER_ID}`\n\nexport const usePopperContainer = () => {\n  onBeforeMount(() => {\n    if (!isClient) return\n\n    // This is for bypassing the error that when under testing env, we often encounter\n    // document.body.innerHTML = '' situation\n    // for this we need to disable the caching since it's not really needed\n    if (process.env.NODE_ENV === 'test' || !cachedContainer) {\n      const container = document.createElement('div')\n      container.id = POPPER_CONTAINER_ID\n      document.body.appendChild(container)\n      cachedContainer = container\n    }\n  })\n}\n"],"names":[],"mappings":";;;;;AAIA,IAAI,eAAA,CAAA;AAES,MAAA,mBAAA,GAAsB,uBAAuB,UAAW,EAAA,CAAA,EAAA;AAE9D,MAAM,4BAA4B,CAAI,CAAA,EAAA,mBAAA,CAAA,EAAA;AAEtC,MAAM,qBAAqB,MAAM;AACtC,EAAA,aAAA,CAAc,MAAM;AAClB,IAAA,IAAI,CAAC,QAAA;AAAU,MAAA,OAAA;AAKf,IAAA,IAAI,OAAQ,CAAA,GAAA,CAAI,QAAa,KAAA,MAAA,IAAU,CAAC,eAAiB,EAAA;AACvD,MAAM,MAAA,SAAA,GAAY,QAAS,CAAA,aAAA,CAAc,KAAK,CAAA,CAAA;AAC9C,MAAA,SAAA,CAAU,EAAK,GAAA,mBAAA,CAAA;AACf,MAAS,QAAA,CAAA,IAAA,CAAK,YAAY,SAAS,CAAA,CAAA;AACnC,MAAkB,eAAA,GAAA,SAAA,CAAA;AAAA,KACpB;AAAA,GACD,CAAA,CAAA;AACH;;;;"}