code: function getTargetFromShadowDom(event, defaultTarget) {
        var path, target = defaultTarget;
  
        // When target element is inside Shadow DOM we need to take first element from path
        // otherwise we'll get Shadow Root parent, not actual target element
  
        // Normalize target for WebComponents v0 implementation (in Chrome)
        path = event.path;
        if (path && path.length > 0) {
          target = path[0];
        }
  
        // Normalize target for WebComponents v1 implementation (standard)
        if (event.deepPath) {
          path = event.deepPath();
          if (path && path.length > 0) {
            target = path[0];
          }
        }
  
        return target;
      }
docs: Gets the event target based on shadow dom properties like path and deepPath.