3rd party javascript not working

I have some codes from a software we use. it is supposed to embed a button and then show something.

I can’t get this to work.
I see a console error:
Uncaught TypeError: Cannot read properties of undefined (reading ‘showClientPortal’)
at HTMLAnchorElement.onclick

This is the code:

                        <link rel="stylesheet" href="https://us.idexxneo.com/public/clientportal/v1/clientportal.css">
                        <script type="text/javascript">
                            if (typeof beefreeClientPortal == "undefined") {
                                var beefreeClientPortal = new BeeFree.ClientPortal({
                                    server: 'https://us.idexxneo.com/',
                                    companyId: '6030',
                                    branch: '1'
                                });
                            }
                        </script>
                        <a class="beefree-btn" href="javascript:void(0);"
                           onclick="beefreeClientPortal.showClientPortal()">Client Portal</a>

here is a site where you can see in action: Schedule an Appointment - Culver City Animal Hospital

you can click either button and see that neither of them work (2 different codes).

What am I doing wrong?

Update: perfmatters was deferring the code.