{"version":3,"file":"_polyfill-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/src/cdk-experimental/popover-edit/polyfill.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/** closest implementation that is able to start from non-Element Nodes. */\nexport function closest(\n  element: EventTarget | Element | null | undefined,\n  selector: string,\n): Element | null {\n  if (!(element instanceof Node)) {\n    return null;\n  }\n\n  let curr: Node | null = element;\n  while (curr != null && !(curr instanceof Element)) {\n    curr = curr.parentNode;\n  }\n\n  return curr?.closest(selector) ?? null;\n}\n"],"names":["closest","element","selector","Node","curr","Element","parentNode"],"mappings":"AASM,SAAUA,OAAOA,CACrBC,OAAiD,EACjDC,QAAgB,EAAA;AAEhB,EAAA,IAAI,EAAED,OAAO,YAAYE,IAAI,CAAC,EAAE;AAC9B,IAAA,OAAO,IAAI;AACb,EAAA;EAEA,IAAIC,IAAI,GAAgBH,OAAO;EAC/B,OAAOG,IAAI,IAAI,IAAI,IAAI,EAAEA,IAAI,YAAYC,OAAO,CAAC,EAAE;IACjDD,IAAI,GAAGA,IAAI,CAACE,UAAU;AACxB,EAAA;AAEA,EAAA,OAAOF,IAAI,EAAEJ,OAAO,CAACE,QAAQ,CAAC,IAAI,IAAI;AACxC;;;;"}