
    (function (e, s) {
        e.src = s;
        e.onload = function () {
            jQuery.noConflict();

            const buildTextBox = function (id) {

                if(!jQuery("#" + id).length) {
                    return;
                }

                let lbl = jQuery("#" + id + " label").clone();
                jQuery("#" + id + " label").remove();
                jQuery("#" + id + " input").addClass("empty");
                jQuery("#" + id + " input").after(lbl);
                jQuery("#" + id + " label").after("<span class='bar'></span>");
                jQuery("#" + id + " label").after("<span class='highlight'></span>");
                jQuery("#" + id + " input").attr("placeholder", "").attr("required", "required");

                jQuery("#" + id + " input").blur(function() {
                    if(jQuery("#" + id + " input").val() === "") {
                        jQuery("#" + id + " input").addClass("empty");
                    }
                    else {
                        jQuery("#" + id + " input").removeClass("empty");
                    }
                });

                jQuery("#" + id + " input").change(function() {
                    if(jQuery("#" + id + " input").val() !== "") {
                        jQuery("#" + id + " input").removeClass("empty");
                    }
                });
            }

            const buildCheckBox = function (id) {
                if(!jQuery("#" + id).length) {
                    return;
                }

                jQuery("#" + id + " label").addClass("checkbox");
                jQuery("#" + id).removeClass("form-group");
            }

            buildTextBox("login-username");
            buildTextBox("login-password");

            buildTextBox("register-forename");
            buildTextBox("register-surname");
            buildTextBox("register-email");
            buildTextBox("register-password");
            buildTextBox("register-repassword");

            buildTextBox("forgotten-email");
            buildTextBox("forgotten-password");
            buildTextBox("forgotten-repassword");

            buildTextBox("two-fa-code");

            buildCheckBox("login-remember");

            jQuery(".register-optin").each(function (i, e) {
                buildCheckBox(jQuery(e).attr("id"));
            });

            jQuery(".ex-google a").append("<span class='ex-title'>Google</span>");
            jQuery(".ex-facebook a").append("<span class='ex-title'>Facebook</span>");
            jQuery(".ex-amazon a").append("<span class='ex-title'>Amazon</span>");
            jQuery(".ex-apple a").append("<span class='ex-title'>Apple</span>");

            jQuery(".application-scopes .consent-item .name").addClass("material-toggle");
            jQuery(".consent-scopecheck").addClass("switch");

            jQuery(".consent-scopecheck").each(function () {
                let x = jQuery(this);
                let parent = x.parent();
                let checkbox = x.clone();
                let text = parent.text().trim();
                console.log(text, x);
                parent.html('');
                parent.append(checkbox);
                let lbl = jQuery("<label for='" + checkbox.attr("id") + "'>" + text + "</label>");
                parent.append(lbl);
            });

            jQuery(".page-wrapper, .page-consent, .error-page").prepend('<img class="logo" src="https://cdn.parcel2go.com/42c5534b-0f47-4342-80f0-8f21203f0669/layout/p2g_logo_new.svg" alt="Parcel2Go.com" />');
        };
        document.head.appendChild(e);
    })(document.createElement('script'), '/auth/js/jquery-3.4.1.min.js');
