',
+function setupCommandButton(b){try{var r="",D=b.onewordcommand,q=b.title,B=b.command_sequence;b="button_"+D;var x="onCommandButtonClick('"+D+"')";r+='
"}catch(L){return console.log("Error in setupCommandButton: "+
L),""}}
function setupInputBoxForButton(b,r,D,q,B,x,O){B="";try{if("int"!==D)return console.log("Error in setupInputBoxForButton: only type 'int' supported at the moment."),B;D="input_"+(r+"_"+b);r="validateInputButton('change', '"+b+"', '"+r+"', '"+O+"')";b=D+"_rule";B+=" ";B+='
";B+=" "+q;B+='
';B+="undefined"!==typeof x&&""!=x.trim()?'
'+replaceAll(x,'"',""")+"":"";q={};$.extend($.idealforms.rules,(q[b]=function(L,z,t,v){return RegExp(O,"g").test(z)},q));q={};$.extend($.idealforms.errors,(q[b]=x,q));return B+="
"}catch(L){console.log("Error in setupInputBoxForButton: "+L)}return B}
function getButtonFromCommand(b){if("buttons"in myGenerator&&0!==myGenerator.buttons.length)for(var r in myGenerator.buttons)if(button=myGenerator.buttons[r],button_command=button.onewordcommand,b==button_command)return button;console.log("Error in getButtonCommand: button not found: "+b);return null}
function sendButtonCommand(b){try{if(!b.hasOwnProperty("onewordcommand")||!b.hasOwnProperty("title")||!b.hasOwnProperty("command_sequence"))return console.log("Error: invalid of button object."),!1;var r=!1,D=JSON.stringify([b]),q=baseurl.concat("set_button_command");$.getJSON(q,{set_button_command:D},function(B){if("OK"!==B)return console.log("Error: failure sending set_button_command: "+B),r=!0,!1});return 0==r}catch(B){return console.log("Error in setButonCommand: "+B),!1}}
-function onCommandButtonClick(b){try{var r=getButtonFromCommand(b);if(null==r)return console.log("Error in onCommandButtonClick: button object not found."),!1;var D=r.title;if(!validateButtonCommand(b))return!1;DisplayStrAnswer=!1;msg="Issue generator command: "+D+'?
Are you sure you want to isssue this command?';vex.dialog.open({unsafeMessage:msg,overlayClosesOnClick:!1,buttons:[{text:"Cancel",type:"button",className:"vex-dialog-button-secondary",click:function(){DisplayStrAnswer=
-!1;this.close()}},{text:"OK",type:"submit",className:"vex-dialog-button-primary",click:function(){DisplayStrAnswer=!0}}],onSubmit:function(q){DisplayStrAnswer&&(DisplayStrAnswer=!1,q.preventDefault(),issueButtonCommand(b),q="Sending Command "+D+"...",$(".vex-dialog-message").html(q),$(".vex-dialog-buttons").html('
'),$(".progress-bar-fill").queue(function(){$(this).css("width","100%")}),setTimeout(function(){vex.closeAll()},
+function onCommandButtonClick(b){try{var r=getButtonFromCommand(b);if(null==r)return console.log("Error in onCommandButtonClick: button object not found."),!1;var D=r.title;if(!validateButtonCommand(b))return!1;DisplayStrAnswer=!1;msg="Issue generator command: "+D+'?
Are you sure you want to isssue this command?';vex.dialog.open({unsafeMessage:msg,overlayClosesOnClick:!1,buttons:[{text:"OK",type:"submit",className:"vex-dialog-button-primary",click:function(){DisplayStrAnswer=
+!0}},{text:"Cancel",type:"button",className:"vex-dialog-button-secondary",click:function(){DisplayStrAnswer=!1;this.close()}}],onSubmit:function(q){DisplayStrAnswer&&(DisplayStrAnswer=!1,q.preventDefault(),issueButtonCommand(b),q="Sending Command "+D+"...",$(".vex-dialog-message").html(q),$(".vex-dialog-buttons").html('
'),$(".progress-bar-fill").queue(function(){$(this).css("width","100%")}),setTimeout(function(){vex.closeAll()},
5E3))}});return!0}catch(q){return console.log("Error in onCommandButton: "+q),!1}}
function validateButtonCommand(b){try{var r=getButtonFromCommand(b);if(null==r)return console.log("Error in validateButtonCommand: button object not found."),!1;var D=r.title,q=r.command_sequence,B;for(B in q)if(command=q[B],command.hasOwnProperty("input_title")&&command.hasOwnProperty("type")){title=command.input_title;bounds="";command.hasOwnProperty("bounds_regex")&&(bounds=command.bounds_regex);var x=document.getElementById("input_"+b+"_"+B).value;if(!validateRegEx(x,bounds,dialog_on_error=!0))return!1}else return console.log("Error in validateButtonCommand: button command_sequence does not have both 'input'title' and 'type': "+
D),!1;return!0}catch(O){return console.log("Error in validateButtonCommand: "+O),!1}}