Problem with INP score

We use Debugbear to collect RUM data. And we found that one of tawk.to scripts affects INP score.
Here is a link to this script:
https://embed.tawk.to/_s/v4/app/69e0c09cf0a/js/twk-chunk-common.js

The problem is in this code:

this.initialDocumentClick = function () {
  (t.$TawkAudioPlayer.init(), window.removeEventListener("click", t.initialDocumentClick));
}

This code calls t.$TawkAudioPlayer.init() on first “click” event and then removes it from event listener. This init() function could take more than 200ms and it causes INP issue (INP should be less than 200ms).

As a solution for such INP issues, web.dev recommends to use timeout function:

So, this small fix could solve INP issue:

this.initialDocumentClick = function () {
  (setTimeout(function () {
    t.$TawkAudioPlayer.init()
  }, 0), window.removeEventListener("click", t.initialDocumentClick));
}

Hi @m1sha87 ,

Thank you for bringing this to our attention. We appreciate you taking the time to inform us.

I have shared the details with our development team for further review. I’ll keep you updated and get back to you as soon as we have more information.

Please don’t hesitate to reach out if you have any additional details to share in the meantime.

Screenshot from Debugbear: