{"version":3,"file":"element.mjs","sources":["../../../../../packages/utils/dom/element.ts"],"sourcesContent":["import { isString } from '../types'\nimport { isClient } from '../browser'\n\ntype GetElement = <T extends string | HTMLElement | Window | null | undefined>(\n  target: T\n) => T extends string ? HTMLElement | null : T\n\nexport const getElement = ((\n  target: string | HTMLElement | Window | null | undefined\n) => {\n  if (!isClient || target === '') return null\n  if (isString(target)) {\n    try {\n      return document.querySelector<HTMLElement>(target)\n    } catch {\n      return null\n    }\n  }\n  return target\n}) as GetElement\n"],"names":["getElement","e","t","n","document","querySelector","l"],"mappings":"2HAAsF,MAACA,EAAWC,IAAI,IAAIC,GAAO,KAAJD,EAAO,OAAO,KAAK,GAAGE,EAAEF,GAAG,IAAI,OAAOG,SAASC,cAAcJ,EAAE,CAAC,MAAMK,GAAG,OAAO,IAAI,CAAC,OAAOL"}