{"version":3,"file":"interactiveTarget.mjs","names":[],"sources":["../../../../package/common/utils/interactiveTarget.ts"],"sourcesContent":["/** Elements that answer a pointer themselves, so a click on one is not a click on its container. */\nconst INTERACTIVE_SELECTOR = [\n  'a[href]',\n  'button',\n  'input',\n  'select',\n  'textarea',\n  'label',\n  '[contenteditable=\"\"]',\n  '[contenteditable=\"true\"]',\n  '[role=\"button\"]',\n  '[role=\"link\"]',\n  '[role=\"checkbox\"]',\n  '[role=\"combobox\"]',\n  '[role=\"menuitem\"]',\n  '[role=\"menuitemcheckbox\"]',\n  '[role=\"menuitemradio\"]',\n  '[role=\"option\"]',\n  '[role=\"radio\"]',\n  '[role=\"searchbox\"]',\n  '[role=\"slider\"]',\n  '[role=\"spinbutton\"]',\n  '[role=\"switch\"]',\n  '[role=\"tab\"]',\n  '[role=\"textbox\"]',\n  '[role=\"treeitem\"]',\n].join(', ');\n\n/**\n * Whether a click landed on a control of its own inside `container`, rather than on the container.\n *\n * `container` itself never counts, or one carrying `role=\"button\"` would exclude every click it is\n * meant to answer. `role=\"group\"` is absent for the same reason: it marks a wrapper, not a control.\n */\nexport function isInteractiveTarget(target: EventTarget | null, container: Element | null): boolean {\n  if (!container || !(target instanceof Element)) return false;\n  const hit = target.closest(INTERACTIVE_SELECTOR);\n  return !!hit && hit !== container && container.contains(hit);\n}\n"],"mappings":"aACA,IAAM,EAAuB,CAC3B,UACA,SACA,QACA,SACA,WACA,QACA,uBACA,2BACA,kBACA,gBACA,oBACA,oBACA,oBACA,4BACA,yBACA,kBACA,iBACA,qBACA,kBACA,sBACA,kBACA,eACA,mBACA,mBACF,CAAC,CAAC,KAAK,IAAI,EAQX,SAAgB,EAAoB,EAA4B,EAAoC,CAClG,GAAI,CAAC,GAAa,EAAE,aAAkB,SAAU,MAAO,GACvD,IAAM,EAAM,EAAO,QAAQ,CAAoB,EAC/C,MAAO,CAAC,CAAC,GAAO,IAAQ,GAAa,EAAU,SAAS,CAAG,CAC7D"}