var getUrlParameter = function getUrlParameter(sParam) {
    var sPageURL = window.location.search.substring(1),
        sURLVariables = sPageURL.split('&'),
        sParameterName,
        i;

    for (i = 0; i < sURLVariables.length; i++) {
        sParameterName = sURLVariables[i].split('=');

        if (sParameterName[0] === sParam) {
            return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]);
        }
    }
};

var isWebformConf = getUrlParameter('conf');
var sid = getUrlParameter('sid');
var uid = drupalSettings.user.uid;
if (isWebformConf == 1 && !isNaN(sid) && uid == 0) {
  if(jQuery.trim(jQuery('#main-content .admin .admin--messages').html()) == '' || jQuery('#main-content .admin .admin--messages').children().length == 0) {
    var message = '<div> <div class="c-status-message-wrapper" id="js-status-message"><div class="js-message" role="contentinfo" aria-label="Status message"><div class="c-status-message c-status-message--status" style="background-color: #3D9970; color: white;"> <button class="[ c-status-message__close ]" id="js-close-status-message" type="button"><svg width="24" version="1.1" xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 64 64" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 64 64"><g><path d="M28.941,31.786L0.613,60.114c-0.787,0.787-0.787,2.062,0,2.849c0.393,0.394,0.909,0.59,1.424,0.59 c0.516,0,1.031-0.196,1.424-0.59l28.541-28.541l28.541,28.541c0.394,0.394,0.909,0.59,1.424,0.59c0.515,0,1.031-0.196,1.424-0.59 c0.787-0.787,0.787-2.062,0-2.849L35.064,31.786L63.41,3.438c0.787-0.787,0.787-2.062,0-2.849c-0.787-0.786-2.062-0.786-2.848,0 L32.003,29.15L3.441,0.59c-0.787-0.786-2.061-0.786-2.848,0c-0.787,0.787-0.787,2.062,0,2.849L28.941,31.786z"></path></g></svg></button><div class="c-status-message__text">Success! We received your information.</div></div></div></div></div>';
    jQuery('#main-content .admin .admin--messages').html(message);
  }
}
