Changeset 1732 in genapp


Ignore:
Timestamp:
Dec 1, 2020, 2:38:36 PM (10 months ago)
Author:
ehb
Message:

Updated for latest js changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • languages/html5/add/js/ga.min.js

    r1598 r1732  
    1 var ga={tmp:{},multistage:{},stages:{},stagesdefault:{},currentstage:0,fielderrors:{},customtooltips:{},showcollapse3d:{},plotted3d:{},showcollapse2d:{},plotted2d:{}};
    2 (function(a,c){a.jstree.defaults.conditionalselect=function(){return!0};a.jstree.plugins.conditionalselect=function(a,c){this.activate_node=function(a,b){this.settings.conditionalselect.call(this,this.get_node(a))&&c.activate_node.call(this,a,b)}};a.jstree.plugins.singleselect=function(a,c){this.activate_node=function(a,b){this.is_leaf(a)&&c.activate_node.call(this,a,b)}};a.jstree.plugins.selectonlyleaf=function(a,c){this.activate_node=function(a,b){this.is_leaf(a)&&c.activate_node.call(this,a,b)}};
    3 a.jstree.plugins.singleselectpath=function(a,c){this.activate_node=function(a,b){this.is_leaf(a)||c.activate_node.call(this,a,b)}};a.jstree.plugins.selectnoleaf=function(a,c){this.activate_node=function(a,b){this.is_leaf(a)||c.activate_node.call(this,a,b)}};a.jstree.defaults.sort=function(a,c){return this.get_node(a).data.time<this.get_node(c).data.time?1:-1}})(jQuery);RegExp.quote=function(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")};
    4 Object.size=function(a){var c=0,b;for(b in a)a.hasOwnProperty(b)&&c++;return c};ga.set=function(a,c){c&&(ga.set.data[a]=c);return ga.set.data[a]};ga.set.data={};ga.restricted={};ga.restricted.add=function(a,c){ga.restricted.ids[a]=ga.restricted.ids[a]||[];ga.restricted.ids[a].push(c)};ga.restricted.hideall=function(){var a;ga.restricted.data={};for(a in ga.restricted.ids)$(ga.restricted.ids[a].join()).hide()};
    5 ga.restricted.show=function(a){for(var c in a)ga.restricted.data[a[c]]=1,ga.restricted.ids[a[c]]&&$(ga.restricted.ids[a[c]].join()).show()};ga.specproj=function(a,c){var b={};b.id=a;b.value=c;ga.specproj.data.push(b)};ga.specproj.data=[];ga.specproj.clear=function(){ga.specproj.data=[]};
    6 ga.specproj.gname=function(){var a,c,b="";for(a in ga.specproj.data)ga.specproj.data.hasOwnProperty(a)&&(c=$(ga.specproj.data[a].value).val(),c==parseFloat(c)&&(c=parseFloat(c)),c=ga.specproj.data[a].id+c,b+=c.replace(/[^A-z0-9.-]+/g,"_"));return b};ga.urlparams=function(a){for(var c=window.location.search.substring(1).split("&"),b=0;b<c.length;b++){var e=c[b].split("=");if(e[0]==a)return e[1]}};ga.frontpage=function(a){$("html").load(a)};
    7 ga.loader=function(a,c){ga.loader.jqtag=a;ga.loader.delay=c};ga.loader.timeout=null;ga.loader.startshow=function(){ga.loader.timeout?(clearTimeout(ga.loader.timeout),ga.loader.timeout=null,$(ga.loader.jqtag).show()):$(ga.loader.jqtag).hide()};ga.loader.hide=function(){ga.loader.timeout&&(clearTimeout(ga.loader.timeout),ga.loader.timeout=null);$(ga.loader.jqtag).hide()};ga.loader.show=function(){ga.loader.timeout&&clearTimeout(ga.loader.timeout);ga.loader.timeout=setTimeout(ga.loader.startshow(),ga.loader.delay)};
    8 ga.menumodules=[];ga.group={};ga.group.set=function(a){ga.group.all=a};ga.group.setuser=function(a){var c;ga.group.user=a;ga.group.userhas={};for(c in ga.group.user)ga.group.userhas[ga.group.user[c]]=1;ga.group.show()};
    9 ga.group.inputhtml=function(a){var c="",b,e;ga.group.activeids={};if(!ga.group.all)return c;for(b in ga.group.all)ga.group.all[b].userconfig&&(e="_setgroup_"+a+"_"+b,c+='<tr><td><label for="'+e+'" class="highlight">'+(ga.group.all[b].label?ga.group.all[b].label:b)+'</label></td><td><input type="checkbox" name="'+e+'" id="'+e+'"'+(ga.group.userhas[b]?" checked":"")+(ga.group.all[b].help?' class="help_link"><span class="help">'+ga.group.all[b].help+"</span":"")+"></td></tr>",ga.group.activeids[b]=e);
    10 return c};ga.group.addmenu=function(a,c){ga.group.menuids[a]=ga.group.menuids[a]||[];ga.group.menuids[a].push(c)};ga.group.hideall=function(){for(var a in ga.group.menuids)$(ga.group.menuids[a].join()).hide()};ga.group.show=function(){var a;ga.group.hideall();for(a in ga.group.userhas)ga.group.menuids[a]&&$(ga.group.menuids[a].join()).show();ga.group.menuids.login&&$(ga.group.menuids.login.join()).show()};
    11 ga.browser=function(){var a=navigator.userAgent;ga.browser.type="unknown";ga.browser.prefix="";ga.browser.gradient=!1;ga.browser.clrpkr=!1;-1<a.indexOf("Chrome")?(ga.browser.type="chrome",ga.browser.prefix="-webkit-",ga.browser.gradient=!0,ga.browser.clrpkr=!0):-1<a.indexOf("Safari")?(ga.browser.type="safari",ga.browser.prefix="-webkit-",ga.browser.gradient=!0):-1<a.indexOf("Opera")?(ga.browser.type="opera",ga.browser.prefix="-o-",ga.browser.gradient=!0,ga.browser.clrpkr=!0):-1<a.indexOf("Firefox")?
    12 (ga.browser.type="mozilla",ga.browser.prefix="-moz-",ga.browser.gradient=!0,ga.browser.clrpkr=!0):-1<a.indexOf("MSIE")&&(ga.browser.type="msie",ga.browser.prefix="",ga.browser.gradient=!0)};ga.cssrule={};
    13 ga.cssrule.get=function(a,c){a=a.toLowerCase();if(document.styleSheets)for(var b=0;b<document.styleSheets.length;b++){var e=document.styleSheets[b],f=0,d=!1;do{if((d=e.cssRules?e.cssRules[f]:e.rules[f])&&d.selectorText&&d.selectorText.toLowerCase()==a)return"delete"==c?(e.cssRules?e.deleteRule(f):e.removeRule(f),!0):d;f++}while(d)}return!1};ga.cssrule.kill=function(a){return ga.cssrule.get(a,"delete")};
     1var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(a){return a.raw=a};$jscomp.createTemplateTagFirstArgWithRaw=function(a,b){a.raw=b;return a};$jscomp.arrayIteratorImpl=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;
     2$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,d){if(a==Array.prototype||a==Object.prototype)return a;a[b]=d.value;return a};
     3$jscomp.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var d=a[b];if(d&&d.Math==Math)return d}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};
     4$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(a,b){var d=$jscomp.propertyToPolyfillSymbol[b];if(null==d)return a[b];d=a[d];return void 0!==d?d:a[b]};$jscomp.polyfill=function(a,b,d,e){b&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(a,b,d,e):$jscomp.polyfillUnisolated(a,b,d,e))};
     5$jscomp.polyfillUnisolated=function(a,b,d,e){d=$jscomp.global;a=a.split(".");for(e=0;e<a.length-1;e++){var h=a[e];if(!(h in d))return;d=d[h]}a=a[a.length-1];e=d[a];b=b(e);b!=e&&null!=b&&$jscomp.defineProperty(d,a,{configurable:!0,writable:!0,value:b})};
     6$jscomp.polyfillIsolated=function(a,b,d,e){var h=a.split(".");a=1===h.length;e=h[0];e=!a&&e in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var g=0;g<h.length-1;g++){var m=h[g];if(!(m in e))return;e=e[m]}h=h[h.length-1];d=$jscomp.IS_SYMBOL_NATIVE&&"es6"===d?e[h]:null;b=b(d);null!=b&&(a?$jscomp.defineProperty($jscomp.polyfills,h,{configurable:!0,writable:!0,value:b}):b!==d&&($jscomp.propertyToPolyfillSymbol[h]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(h):$jscomp.POLYFILL_PREFIX+h,h=
     7$jscomp.propertyToPolyfillSymbol[h],$jscomp.defineProperty(e,h,{configurable:!0,writable:!0,value:b})))};$jscomp.initSymbol=function(){};
     8$jscomp.polyfill("Symbol",function(a){if(a)return a;var b=function(h,g){this.$jscomp$symbol$id_=h;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:g})};b.prototype.toString=function(){return this.$jscomp$symbol$id_};var d=0,e=function(h){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new b("jscomp_symbol_"+(h||"")+"_"+d++,h)};return e},"es6","es3");
     9$jscomp.polyfill("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),d=0;d<b.length;d++){var e=$jscomp.global[b[d]];"function"===typeof e&&"function"!=typeof e.prototype[a]&&$jscomp.defineProperty(e.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}})}return a},"es6",
     10"es3");$jscomp.iteratorPrototype=function(a){a={next:a};a[Symbol.iterator]=function(){return this};return a};$jscomp.iteratorFromArray=function(a,b){a instanceof String&&(a+="");var d=0,e=!1,h={next:function(){if(!e&&d<a.length){var g=d++;return{value:b(g,a[g]),done:!1}}e=!0;return{done:!0,value:void 0}}};h[Symbol.iterator]=function(){return h};return h};$jscomp.polyfill("Array.prototype.keys",function(a){return a?a:function(){return $jscomp.iteratorFromArray(this,function(b){return b})}},"es6","es3");
     11$jscomp.checkStringArgs=function(a,b,d){if(null==a)throw new TypeError("The 'this' value for String.prototype."+d+" must not be null or undefined");if(b instanceof RegExp)throw new TypeError("First argument to String.prototype."+d+" must not be a regular expression");return a+""};
     12$jscomp.polyfill("String.prototype.repeat",function(a){return a?a:function(b){var d=$jscomp.checkStringArgs(this,null,"repeat");if(0>b||1342177279<b)throw new RangeError("Invalid count value");b|=0;for(var e="";b;)if(b&1&&(e+=d),b>>>=1)d+=d;return e}},"es6","es3");$jscomp.findInternal=function(a,b,d){a instanceof String&&(a=String(a));for(var e=a.length,h=0;h<e;h++){var g=a[h];if(b.call(d,g,h,a))return{i:h,v:g}}return{i:-1,v:void 0}};
     13$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(b,d){return $jscomp.findInternal(this,b,d).v}},"es6","es3");$jscomp.stringPadding=function(a,b){a=void 0!==a?String(a):" ";return 0<b&&a?a.repeat(Math.ceil(b/a.length)).substring(0,b):""};$jscomp.polyfill("String.prototype.padEnd",function(a){return a?a:function(b,d){var e=$jscomp.checkStringArgs(this,null,"padStart");return e+$jscomp.stringPadding(d,b-e.length)}},"es8","es3");
     14$jscomp.polyfill("Array.prototype.values",function(a){return a?a:function(){return $jscomp.iteratorFromArray(this,function(b,d){return d})}},"es8","es3");var ga={tmp:{},multistage:{},stages:{},stagesdefault:{},currentstage:0,fielderrors:{},customtooltips:{},showcollapse3d:{},plotted3d:{},showcollapse2d:{},plotted2d:{}};
     15(function(a,b){a.jstree.defaults.conditionalselect=function(){return!0};a.jstree.plugins.conditionalselect=function(d,e){this.activate_node=function(h,g){this.settings.conditionalselect.call(this,this.get_node(h))&&e.activate_node.call(this,h,g)}};a.jstree.plugins.singleselect=function(d,e){this.activate_node=function(h,g){this.is_leaf(h)&&e.activate_node.call(this,h,g)}};a.jstree.plugins.selectonlyleaf=function(d,e){this.activate_node=function(h,g){this.is_leaf(h)&&e.activate_node.call(this,h,g)}};
     16a.jstree.plugins.singleselectpath=function(d,e){this.activate_node=function(h,g){this.is_leaf(h)||e.activate_node.call(this,h,g)}};a.jstree.plugins.selectnoleaf=function(d,e){this.activate_node=function(h,g){this.is_leaf(h)||e.activate_node.call(this,h,g)}};a.jstree.defaults.sort=function(d,e){return this.get_node(d).data.time<this.get_node(e).data.time?1:-1}})(jQuery);RegExp.quote=function(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")};
     17Object.size=function(a){var b=0,d;for(d in a)a.hasOwnProperty(d)&&b++;return b};ga.set=function(a,b){b&&(ga.set.data[a]=b);return ga.set.data[a]};ga.set.data={};ga.restricted={};ga.restricted.add=function(a,b){ga.restricted.ids[a]=ga.restricted.ids[a]||[];ga.restricted.ids[a].push(b)};ga.restricted.hideall=function(){var a;ga.restricted.data={};for(a in ga.restricted.ids)$(ga.restricted.ids[a].join()).hide()};
     18ga.restricted.show=function(a){for(var b in a)ga.restricted.data[a[b]]=1,ga.restricted.ids[a[b]]&&$(ga.restricted.ids[a[b]].join()).show()};ga.specproj=function(a,b){var d={};d.id=a;d.value=b;ga.specproj.data.push(d)};ga.specproj.data=[];ga.specproj.clear=function(){ga.specproj.data=[]};
     19ga.specproj.gname=function(){var a,b="";for(a in ga.specproj.data)if(ga.specproj.data.hasOwnProperty(a)){var d=$(ga.specproj.data[a].value).val();d==parseFloat(d)&&(d=parseFloat(d));d=ga.specproj.data[a].id+d;b+=d.replace(/[^A-z0-9.-]+/g,"_")}return b};ga.urlparams=function(a){for(var b=window.location.search.substring(1).split("&"),d=0;d<b.length;d++){var e=b[d].split("=");if(e[0]==a)return e[1]}};ga.frontpage=function(a){$("html").load(a)};
     20ga.loader=function(a,b){ga.loader.jqtag=a;ga.loader.delay=b};ga.loader.timeout=null;ga.loader.startshow=function(){ga.loader.timeout?(clearTimeout(ga.loader.timeout),ga.loader.timeout=null,$(ga.loader.jqtag).show()):$(ga.loader.jqtag).hide()};ga.loader.hide=function(){ga.loader.timeout&&(clearTimeout(ga.loader.timeout),ga.loader.timeout=null);$(ga.loader.jqtag).hide()};ga.loader.show=function(){ga.loader.timeout&&clearTimeout(ga.loader.timeout);ga.loader.timeout=setTimeout(ga.loader.startshow(),ga.loader.delay)};
     21ga.menumodules=[];ga.group={};ga.group.set=function(a){ga.group.all=a};ga.group.setuser=function(a){var b;ga.group.user=a;ga.group.userhas={};for(b in ga.group.user)ga.group.userhas[ga.group.user[b]]=1;ga.group.show()};
     22ga.group.inputhtml=function(a){var b="",d;ga.group.activeids={};if(!ga.group.all)return b;for(d in ga.group.all)if(ga.group.all[d].userconfig){var e="_setgroup_"+a+"_"+d;b+='<tr><td><label for="'+e+'" class="highlight">'+(ga.group.all[d].label?ga.group.all[d].label:d)+'</label></td><td><input type="checkbox" name="'+e+'" id="'+e+'"'+(ga.group.userhas[d]?" checked":"")+(ga.group.all[d].help?' class="help_link"><span class="help">'+ga.group.all[d].help+"</span":"")+"></td></tr>";ga.group.activeids[d]=
     23e}return b};ga.group.addmenu=function(a,b){ga.group.menuids[a]=ga.group.menuids[a]||[];ga.group.menuids[a].push(b)};ga.group.hideall=function(){for(var a in ga.group.menuids)$(ga.group.menuids[a].join()).hide()};ga.group.show=function(){var a;ga.group.hideall();for(a in ga.group.userhas)ga.group.menuids[a]&&$(ga.group.menuids[a].join()).show();ga.group.menuids.login&&$(ga.group.menuids.login.join()).show()};
     24ga.browser=function(){var a=navigator.userAgent;ga.browser.type="unknown";ga.browser.prefix="";ga.browser.gradient=!1;ga.browser.clrpkr=!1;ga.browser.version="unknown";-1<a.indexOf("Version")&&(ga.browser.version=/Version\/([^ ]*)/.exec(a)[1],ga.browser.majversion=/Version\/([\d]*)/.exec(a)[1]);-1<a.indexOf("Chrome")?(ga.browser.type="chrome",ga.browser.prefix="-webkit-",ga.browser.gradient=!0,ga.browser.clrpkr=!0):-1<a.indexOf("Safari")?(ga.browser.type="safari",ga.browser.prefix="-webkit-",ga.browser.gradient=
     25!0):-1<a.indexOf("Opera")?(ga.browser.type="opera",ga.browser.prefix="-o-",ga.browser.gradient=!0,ga.browser.clrpkr=!0):-1<a.indexOf("Firefox")?(ga.browser.type="mozilla",ga.browser.prefix="-moz-",ga.browser.gradient=!0,ga.browser.clrpkr=!0):-1<a.indexOf("MSIE")&&(ga.browser.type="msie",ga.browser.prefix="",ga.browser.gradient=!0)};ga.cssrule={};
     26ga.cssrule.get=function(a,b){a=a.toLowerCase();if(document.styleSheets)for(var d=0;d<document.styleSheets.length;d++){var e=document.styleSheets[d],h=0,g;do{if((g=e.cssRules?e.cssRules[h]:e.rules[h])&&g.selectorText&&g.selectorText.toLowerCase()==a)return"delete"==b?(e.cssRules?e.deleteRule(h):e.removeRule(h),!0):g;h++}while(g)}return!1};ga.cssrule.kill=function(a){return ga.cssrule.get(a,"delete")};
    1427ga.cssrule.add=function(a){document.styleSheets&&(ga.cssrule.get(a)||(document.styleSheets[0].addRule?document.styleSheets[0].addRule(a,null,0):document.styleSheets[0].insertRule(a+" { }",0)));return ga.cssrule.get(a)};ga.cache={};
    15 ga.cache.msg=function(a,c,b,e,f,d,g){switch(a){case "notify":if(ga.restricted.data[c]){ga.msg.box({icon:"question.png",text:"Show or clear previously computed results.",buttons:[{id:"showcached",label:"Show previously computed results",cb:b,adata:[f,0,1,1]},{id:"clear",label:"Clear cached result",cb:ga.cache.clear,adata:[f,c]},{id:"cancel",label:"Cancel"}]});return}ga.msg.box({icon:"information.png",text:"Showing previously computed results."});break;case "askrecompute":ga.restricted.data[c]?ga.msg.box({icon:"question.png",
    16 text:"Previously computed results are available.",buttons:[{id:"showcached",label:"Show previously computed results",cb:b,adata:[f,0,1,1]},{id:"recompute",label:"Recompute results",cb:e,adata:[d,g,1]},{id:"clear",label:"Clear cached result",cb:ga.cache.clear,adata:[f,c]},{id:"cancel",label:"Cancel"}]}):ga.msg.box({icon:"question.png",text:"Previously computed results are available.",buttons:[{id:"showcached",label:"Show previously computed results",cb:b,adata:[f,0,1,1]},{id:"recompute",label:"Recompute results",
    17 cb:e,adata:[d,g,1]},{id:"cancel",label:"Cancel"}]});return;default:if(ga.restricted.data[c]){ga.msg.box({icon:"question.png",text:"Show or clear previously computed results.",buttons:[{id:"showcached",label:"Show previously computed results",cb:b,adata:[f,0,1,1]},{id:"clear",label:"Clear cached result",cb:ga.cache.clear,adata:[f,c]},{id:"cancel",label:"Cancel"}]});return}}b(f,0,1,1)};
    18 ga.cache.clear=function(a,c){ga.msg.box({icon:"admin.png",text:"Are you sure you want to permanently remove this previously computed result?",buttons:[{id:"clear",label:"Clear cached result",cb:ga.cache.doclear,adata:[a,c]},{id:"cancel",label:"Cancel"}]})};
    19 ga.cache.doclear=function(a,c){ga.cache.url_clear?$.getJSON(ga.cache.url_clear,{tagmode:"any",format:"json",_window:window.name,_logon:$("#_state").data("_logon"),_uuid:a,_cachedelete:c}).done(function(a,c,f){"true"==a.success?ga.msg.box({icon:"information.png",text:"Previously computed results cleared"}):ga.msg.box({icon:"toast.png",text:a.error})}).fail(function(a,c,f){console.warn("could not clear cache data");ga.msg.box({icon:"toast.png",text:"Error: server failed to clear cached entry"})}):ga.msg.box({icon:"toast.png",
    20 text:"Internal error: no url defined for cache clear"})};ga.trytilltrue=function(a,c,b,e){if(eval(a))return eval(c);b--;if(0>b)console.warn("ga.trytilltrue failed ... to many tries");else return setTimeout(ga.trytilltrue,e,a,c,b,e)};ga.login={};
    21 ga.login.verify=function(a){var c={text:a.text||"You must verify your email address."};a.useroptions&&(a.useroptions.resend&&(c.buttons=c.buttons||[],c.buttons.push({id:"resend",label:"Resend the verification email",cb:ga.login.verify.resend})),a.useroptions.resend&&(c.buttons=c.buttons||[],c.buttons.push({id:"changeaddress",label:"Change your email address and resend the verification",cb:ga.login.verify.change})),a.useroptions.cancel&&(c.buttons=c.buttons||[],c.buttons.push({id:"cancelregistration",
    22 label:"Cancel your registration",cb:ga.login.verify.cancel})));ga.msg.box(c)};ga.login.verify.resend=function(){var a=$("#sys_login");if(!a)return ga.msg.box({icon:"toast.png",text:"Internal error: form missing"});a.append('<input type="hidden" name="_resendverify" class="toclear">');do_sys_login_submit(a)};
     28ga.cache.msg=function(a,b,d,e,h,g,m){switch(a){case "notify":if(ga.restricted.data[b]){ga.msg.box({icon:"question.png",text:"Show or clear previously computed results.",buttons:[{id:"showcached",label:"Show previously computed results",cb:d,adata:[h,0,1,1]},{id:"clear",label:"Clear cached result",cb:ga.cache.clear,adata:[h,b]},{id:"cancel",label:"Cancel"}]});return}ga.msg.box({icon:"information.png",text:"Showing previously computed results."});break;case "askrecompute":ga.restricted.data[b]?ga.msg.box({icon:"question.png",
     29text:"Previously computed results are available.",buttons:[{id:"showcached",label:"Show previously computed results",cb:d,adata:[h,0,1,1]},{id:"recompute",label:"Recompute results",cb:e,adata:[g,m,1]},{id:"clear",label:"Clear cached result",cb:ga.cache.clear,adata:[h,b]},{id:"cancel",label:"Cancel"}]}):ga.msg.box({icon:"question.png",text:"Previously computed results are available.",buttons:[{id:"showcached",label:"Show previously computed results",cb:d,adata:[h,0,1,1]},{id:"recompute",label:"Recompute results",
     30cb:e,adata:[g,m,1]},{id:"cancel",label:"Cancel"}]});return;default:if(ga.restricted.data[b]){ga.msg.box({icon:"question.png",text:"Show or clear previously computed results.",buttons:[{id:"showcached",label:"Show previously computed results",cb:d,adata:[h,0,1,1]},{id:"clear",label:"Clear cached result",cb:ga.cache.clear,adata:[h,b]},{id:"cancel",label:"Cancel"}]});return}}d(h,0,1,1)};
     31ga.cache.clear=function(a,b){ga.msg.box({icon:"admin.png",text:"Are you sure you want to permanently remove this previously computed result?",buttons:[{id:"clear",label:"Clear cached result",cb:ga.cache.doclear,adata:[a,b]},{id:"cancel",label:"Cancel"}]})};
     32ga.cache.doclear=function(a,b){ga.cache.url_clear?$.getJSON(ga.cache.url_clear,{tagmode:"any",format:"json",_window:window.name,_logon:$("#_state").data("_logon"),_uuid:a,_cachedelete:b}).done(function(d,e,h){"true"==d.success?ga.msg.box({icon:"information.png",text:"Previously computed results cleared"}):ga.msg.box({icon:"toast.png",text:d.error})}).fail(function(d,e,h){console.warn("could not clear cache data");ga.msg.box({icon:"toast.png",text:"Error: server failed to clear cached entry"})}):ga.msg.box({icon:"toast.png",
     33text:"Internal error: no url defined for cache clear"})};ga.trytilltrue=function(a,b,d,e){if(eval(a))return eval(b);d--;if(0>d)console.warn("ga.trytilltrue failed ... to many tries");else return setTimeout(ga.trytilltrue,e,a,b,d,e)};ga.login={};
     34ga.login.verify=function(a){var b={text:a.text||"You must verify your email address."};a.useroptions&&(a.useroptions.resend&&(b.buttons=b.buttons||[],b.buttons.push({id:"resend",label:"Resend the verification email",cb:ga.login.verify.resend})),a.useroptions.resend&&(b.buttons=b.buttons||[],b.buttons.push({id:"changeaddress",label:"Change your email address and resend the verification",cb:ga.login.verify.change})),a.useroptions.cancel&&(b.buttons=b.buttons||[],b.buttons.push({id:"cancelregistration",
     35label:"Cancel your registration",cb:ga.login.verify.cancel})));ga.msg.box(b)};ga.login.verify.resend=function(){var a=$("#sys_login");if(!a)return ga.msg.box({icon:"toast.png",text:"Internal error: form missing"});a.append('<input type="hidden" name="_resendverify" class="toclear">');do_sys_login_submit(a)};
    2336ga.login.verify.change=function(){return ga.msg.box({icon:"question.png",text:'<center><label  class="header3 ">Change email address</label></center><form id="_changeemail"><table><tr><td><label for="_changeemail1">Email address </label></td><td><input type="email" name="_changeemail1" id="_changeemail1" required size="50" class="help_link"><span class="help">Enter a valid email address.  This will be required if you forget your password.  Otherwise, you will have to create a new account lose access to your projects</span><span id="_changeemail1_msg" class="warning field_msg" > </span></td></tr><tr><td><label for="_changeemail2">Repeat email address </label></td><td><input type="email" name="_changeemail2" id="_changeemail2" required size="50" class="help_link"><span class="help">Enter a valid email address.  This will be required if you forget your password.  Otherwise, you will have to create a new account lose access to your projects</span><span id="_changeemail2_msg" class="warning field_msg" > </span></td></tr></table></form><script>$( "#_changeemail1" ).keypress( function() { $( "#_changeemail1_msg" ).empty();});$( "#_changeemail2" ).keypress( function() { $( "#_changeemail2_msg" ).empty();});$( "#_changeemail2" ).blur( function() { ga.valid.checkMatch( "#_changeemail2", "#_changeemail1" ); } );ga.hhelp.set();\x3c/script>',buttons:[{id:"_changeemailbutton",
    2437label:"Submit",cb:ga.login.verify.change.doit},{id:"_changeemailcancel",label:"Cancel"}]})};
    2538ga.login.verify.change.doit=function(){var a=$("#sys_login");if(!a)return ga.msg.box({icon:"toast.png",text:"Internal error: form missing"});a.append('<input type="hidden" name="_resendverify" class="toclear">');a.append('<input type="hidden" name="_changeemail" class="toclear">');a.append('<input type="hidden" name="_changeemail1" value="'+$("#_changeemail1").val()+'" class="toclear">');a.append('<input type="hidden" name="_changeemail2" value="'+$("#_changeemail2").val()+'" class="toclear">');do_sys_login_submit(a)};
    2639ga.login.verify.cancel=function(){var a=$("#sys_login");if(!a)return ga.msg.box({icon:"toast.png",text:"Internal error: form missing"});a.append('<input type="hidden" name="_cancel" class="toclear">');do_sys_login_submit(a)};
    27 ga.login.approve=function(a){var c={text:a.text||"Your registration is pending approval."};a.useroptions&&(a.useroptions.resend&&(c.buttons=c.buttons||[],c.buttons.push({id:"resend",label:"Resend the approval request",cb:ga.login.approve.resend})),a.useroptions.cancel&&(c.buttons=c.buttons||[],c.buttons.push({id:"cancelregistration",label:"Cancel your registration request",cb:ga.login.approve.cancel})));ga.msg.box(c)};
     40ga.login.approve=function(a){var b={text:a.text||"Your registration is pending approval."};a.useroptions&&(a.useroptions.resend&&(b.buttons=b.buttons||[],b.buttons.push({id:"resend",label:"Resend the approval request",cb:ga.login.approve.resend})),a.useroptions.cancel&&(b.buttons=b.buttons||[],b.buttons.push({id:"cancelregistration",label:"Cancel your registration request",cb:ga.login.approve.cancel})));ga.msg.box(b)};
    2841ga.login.approve.resend=function(){var a=$("#sys_login");if(!a)return ga.msg.box({icon:"toast.png",text:"Internal error: form missing"});a.append('<input type="hidden" name="_resendapprove" class="toclear">');do_sys_login_submit(a)};ga.login.approve.cancel=function(){var a=$("#sys_login");if(!a)return ga.msg.box({icon:"toast.png",text:"Internal error: form missing"});a.append('<input type="hidden" name="_cancel" class="toclear">');do_sys_login_submit(a)};ga.admin={};
    29 ga.admin.ajax=function(a,c,b,e,f){$.get(ga.admin.ajax.url,{tagmode:"any",format:"json",_window:window.name,_logon:$("#_state").data("_logon"),_cmd:a,_name:c,_id:b,_manageid:e,_jid:f}).done(function(a,b,c){a=JSON.parse(a.replace(/^\s*[\r\n]/gm,"").split(/\r?\n/)[1]);"true"!=a.success&&ga.msg.box({icon:"toast.png",text:a.error?a.error:"unknown error"});a._submitid&&$("#"+a._submitid).trigger("click")}).fail(function(a,b,c){ga.msg.box({icon:"toast.png",text:"Error: system user management backend command failed to run: "+
    30 c})})};ga.admin.ajax.remove=function(a,c,b,e){ga.msg.box({icon:"admin.png",text:"Are you sure you want to permanently remove this user, all of their job history and their stored data?",buttons:[{id:"yes",label:"Yes, remove this user",cb:ga.admin.ajax,adata:[a,c,b,e]},{id:"cancel",label:"Cancel"}]})};
    31 ga.admin.ajax.group=function(a,c,b,e,f){ga.msg.box({icon:"admin.png",text:"Enter the group for user "+c+'<form id="sys_musergrp"><input id="sys_musergrp_text" class="help_link" type="text" size="25" value="'+f+'"><span class="help">Enter a group for this user, then press ok or cancel</span></form>',eval:"ga.hhelp.reset();$('#sys_musergrp').on('keyup keypress', function(e) { var code = e.keyCode || e.which;  if (code  == 13) { e.preventDefault(); return false; }});",buttons:[{id:"ok",label:"Ok",cb:ga.admin.ajax.group.cb,
    32 adata:[a,c,b,e]},{id:"cancel",label:"Cancel"}]})};
    33 ga.admin.ajax.group.cb=function(a,c,b,e,f){$.get(ga.admin.ajax.url,{tagmode:"any",format:"json",_window:window.name,_logon:$("#_state").data("_logon"),_cmd:a,_name:c,_id:b,_manageid:e,_group:$("#sys_musergrp_text").val()}).done(function(a,b,c){a=JSON.parse(a.replace(/^\s*[\r\n]/gm,"").split(/\r?\n/)[1]);"true"!=a.success&&ga.msg.box({icon:"toast.png",text:a.error?a.error:"unknown error"});a._submitid&&$("#"+a._submitid).trigger("click")}).fail(function(a,b,c){ga.msg.box({icon:"toast.png",text:"Error: system user management backend command failed to run: "+
    34 c})})};ga.admin.ajax.jobview=function(a,c,b,e){$("#configbody").load("etc/userjob.html",function(){$("#jobtext_label").html("Jobs for "+c);$.ajax({url:ga.jc.url,data:{_window:window.name,_asuser:c,_id:b,_manageid:e}}).success(function(a){$("#seluserjobs").html(a)}).error(function(a){$("#seluserjobs").html("error:"+data)})});$(".modalDialog").addClass("modalDialog_on")};
    35 ga.admin.ajax.cancel=function(a,c,b,e,f){ga.msg.box({icon:"admin.png",text:"Are you sure you want to cancel this '"+e+"' job belonging to "+a+" ?",buttons:[{id:"yes",label:"Yes, cancel the job",cb:ga.admin.ajax.cancel.cb,adata:[a,c,b,f]},{id:"no",label:"No"}]})};ga.admin.ajax.cancel.cb=function(a,c,b,e){$(".modalDialog").removeClass("modalDialog_on");ga.admin.ajax("jobcancel",a,c,b,e)};
    36 ga.extrahidden=function(a){if(ga.set.data.extrahidden&&ga.set.data.extrahidden[a]){var c=$("#"+a),b,e="";for(b in ga.set.data.extrahidden[a])e+='<input type="hidden" name="'+b+'" value="'+ga.set.data.extrahidden[a][b]+'">';c.append(e);delete ga.set.data.extrahidden[a]}};ga.hhelp={};ga.hhelp.reset=function(){if($("#global_data").data("hoverhelp")||0!=$("#global_data").data("hoverhelp"))$(".help_link").removeClass("help_link_on"),$(".help_link").addClass("help_link_on")};
     42ga.admin.ajax=function(a,b,d,e,h){$.get(ga.admin.ajax.url,{tagmode:"any",format:"json",_window:window.name,_logon:$("#_state").data("_logon"),_cmd:a,_name:b,_id:d,_manageid:e,_jid:h}).done(function(g,m,l){g=JSON.parse(g.replace(/^\s*[\r\n]/gm,"").split(/\r?\n/)[1]);"true"!=g.success&&ga.msg.box({icon:"toast.png",text:g.error?g.error:"unknown error"});g._submitid&&$("#"+g._submitid).trigger("click")}).fail(function(g,m,l){ga.msg.box({icon:"toast.png",text:"Error: system user management backend command failed to run: "+
     43l})})};ga.admin.ajax.remove=function(a,b,d,e){ga.msg.box({icon:"admin.png",text:"Are you sure you want to permanently remove this user, all of their job history and their stored data?",buttons:[{id:"yes",label:"Yes, remove this user",cb:ga.admin.ajax,adata:[a,b,d,e]},{id:"cancel",label:"Cancel"}]})};
     44ga.admin.ajax.group=function(a,b,d,e,h){ga.msg.box({icon:"admin.png",text:"Enter the group for user "+b+'<form id="sys_musergrp"><input id="sys_musergrp_text" class="help_link" type="text" size="25" value="'+h+'"><span class="help">Enter a group for this user, then press ok or cancel</span></form>',eval:"ga.hhelp.reset();$('#sys_musergrp').on('keyup keypress', function(e) { var code = e.keyCode || e.which;  if (code  == 13) { e.preventDefault(); return false; }});",buttons:[{id:"ok",label:"Ok",cb:ga.admin.ajax.group.cb,
     45adata:[a,b,d,e]},{id:"cancel",label:"Cancel"}]})};
     46ga.admin.ajax.group.cb=function(a,b,d,e,h){$.get(ga.admin.ajax.url,{tagmode:"any",format:"json",_window:window.name,_logon:$("#_state").data("_logon"),_cmd:a,_name:b,_id:d,_manageid:e,_group:$("#sys_musergrp_text").val()}).done(function(g,m,l){g=JSON.parse(g.replace(/^\s*[\r\n]/gm,"").split(/\r?\n/)[1]);"true"!=g.success&&ga.msg.box({icon:"toast.png",text:g.error?g.error:"unknown error"});g._submitid&&$("#"+g._submitid).trigger("click")}).fail(function(g,m,l){ga.msg.box({icon:"toast.png",text:"Error: system user management backend command failed to run: "+
     47l})})};ga.admin.ajax.jobview=function(a,b,d,e){$("#configbody").load("etc/userjob.html",function(){$("#jobtext_label").html("Jobs for "+b);$.ajax({url:ga.jc.url,data:{_window:window.name,_asuser:b,_id:d,_manageid:e}}).success(function(h){$("#seluserjobs").html(h)}).error(function(h){$("#seluserjobs").html("error:"+data)})});$(".modalDialog").addClass("modalDialog_on")};
     48ga.admin.ajax.cancel=function(a,b,d,e,h){ga.msg.box({icon:"admin.png",text:"Are you sure you want to cancel this '"+e+"' job belonging to "+a+" ?",buttons:[{id:"yes",label:"Yes, cancel the job",cb:ga.admin.ajax.cancel.cb,adata:[a,b,d,h]},{id:"no",label:"No"}]})};ga.admin.ajax.cancel.cb=function(a,b,d,e){$(".modalDialog").removeClass("modalDialog_on");ga.admin.ajax("jobcancel",a,b,d,e)};
     49ga.extrahidden=function(a){if(ga.set.data.extrahidden&&ga.set.data.extrahidden[a]){var b=$("#"+a),d,e="";for(d in ga.set.data.extrahidden[a])e+='<input type="hidden" name="'+d+'" value="'+ga.set.data.extrahidden[a][d]+'">';b.append(e);delete ga.set.data.extrahidden[a]}};ga.hhelp={};ga.hhelp.reset=function(){if($("#global_data").data("hoverhelp")||0!=$("#global_data").data("hoverhelp"))$(".help_link").removeClass("help_link_on"),$(".help_link").addClass("help_link_on")};
    3750ga.hhelp.set=function(){$("#global_data").data("hoverhelp")&&0!=$("#global_data").data("hoverhelp")?($(".help_link").addClass("help_link_on"),$("#hoverhelp").html("Help on")):($(".help_link").removeClass("help_link_on"),$("#hoverhelp").html("Help off"))};ga.colors=function(a){ga.colors.background=ga.colors.makeRGB(a.background);ga.colors.text=ga.colors.makeRGB(a.text)};ga.colors.makeRGB=function(a){if(/\d{1,3},\s*\d{1,3},\s*\d{1,3}$/.test(a))return a;a=ga.color.toRGB(a);return a.r+","+a.g+","+a.b};
    3851ga.plot_options=function(){var a="rgb( "+ga.colors.text+" )";return{font:{color:a},grid:{hoverable:!1},xaxis:{color:"gray",lineWidth:.5,font:{color:a}},yaxis:{color:"gray",lineWidth:.5,font:{color:a}},lines:{lineWidth:1},zoom:{interactive:!1},pan:{interactive:!1}}};ga.color=function(a){ga.color.data=a;ga.colors(a.body);ga.color.apply()};ga.color.defaults=function(a){ga.browser();ga.color.defaults.data=a;ga.color(a)};
    39 ga.color.toRGB=function(a){var c,b;if("#"===a.slice(0,1))return b=parseInt(a.slice(1),16),c=parseInt(b/256),b-=256*c,a=parseInt(c/256),{r:a,b:b,g:c-256*a};(bits=/^rgb\(\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\s*\)$/.exec(a))?(a=parseInt(bits[1]),c=parseInt(bits[2]),b=parseInt(bits[3])):b=c=a=128;return{r:a,b:b,g:c}};
    40 ga.color.apply=function(){var a,c,b,e,f,d,g;if(ga.directives.data&&ga.directives.data.usercolors&&!/^(off|0|false)$/.test(ga.directives.data.usercolors)){for(a in ga.color.data)ga.color.data.hasOwnProperty(a)&&(c=$(a))&&c.css(ga.color.data[a]);$(".sidebar ul li, .title").css("color",ga.color.data.body.color).hover(function(){$(this).css("color",ga.color.defaults.data.hovercolor.color)},function(){$(this).css("color",ga.color.data.body.color)});$(".svgmenu").css({color:ga.color.data.body.color,stroke:ga.color.data.body.color}).hover(function(){$(this).css({color:ga.color.defaults.data.hovercolor.color,
    41 stroke:ga.color.defaults.data.hovercolor.color})},function(){$(this).css({color:ga.color.data.body.color,stroke:ga.color.data.body.color})});"#"===ga.color.data.body.background.slice(0,1)?(b=parseInt(ga.color.data.body.background.slice(1),16),c=parseInt(b/256),b-=256*c,a=parseInt(c/256),c-=256*a,a+=128<a?-20:20,c+=128<c?-20:20,b+=128<b?-20:20,$(".help,.coord").css({background:"rgba("+a+","+c+","+b+",0.8)",color:ga.color.data.body.color})):$(".help,.coord").css({background:ga.color.data[".help"].background,
    42 color:ga.color.data[".help"].color});"#"===ga.color.data.body.color.slice(0,1)?(b=parseInt(ga.color.data.body.color.slice(1),16),c=parseInt(b/256),b-=256*c,a=parseInt(c/256),c-=256*a,e=a,f=c,d=b,a+=128<a?-12:12,c+=128<c?-12:12,b+=128<b?-12:12,$(".header1").css({color:"rgb("+a+","+c+","+b+")"}),a+=128<a?-12:12,c+=128<c?-12:12,b+=128<b?-12:12,$(".header2").css({color:"rgb("+a+","+c+","+b+")"}),a+=128<a?-12:12,c+=128<c?-12:12,b+=128<b?-12:12,$(".header3").css({color:"rgb("+a+","+c+","+b+")"}),a+=128<
    43 a?-12:12,c+=128<c?-12:12,b+=128<b?-12:12,$(".header4").css({color:"rgb("+a+","+c+","+b+")"}),a+=128<a?-12:12,c+=128<c?-12:12,b+=128<b?-12:12,$("hr").css({color:"rgb("+a+","+c+","+b+")"}),a=e,c=f,b=d,c+=128<c?-75:75,ga.cssrule.kill("a:link"),g=ga.cssrule.add("a:link"),g.style.color="rgb("+a+","+c+","+b+")",c=f,b+=128<b?-75:75,a+=128<a?-75:75,ga.cssrule.kill("a:visited"),g=ga.cssrule.add("a:visited"),g.style.color="rgb("+a+","+c+","+b+")",b=d,a=e,a+=128<a?-75:75,ga.cssrule.kill("a:active"),g=ga.cssrule.add("a:active"),
    44 g.style.color="rgb("+a+","+c+","+b+")"):($(".header1").css({color:ga.color.data[".header1"]?ga.color.data[".header1"].color:ga.color.data.body.color}),$(".header2").css({color:ga.color.data[".header2"]?ga.color.data[".header2"].color:ga.color.data.body.color}),$(".header3").css({color:ga.color.data[".header3"]?ga.color.data[".header3"].color:ga.color.data.body.color}),$(".header4").css({color:ga.color.data[".header4"]?ga.color.data[".header4"].color:ga.color.data.body.color}));$(".modalDialog > div, .modalDialog2 > div, .modalDialog3 > div, .modalDialog4 > div").css({background:ga.browser.gradient?
    45 ga.browser.prefix+"linear-gradient("+ga.color.data.body.background+", #222)":ga.color.data.body.background})}};ga.color.reset=function(){ga.color(ga.color.defaults.data)};ga.color.spectrum=function(a){if(!ga.browser.clrpkr)$(a).on("change.spectrum",function(c,b){console.log("hi spectrum"+a);$(a).val(b.toHexString())})};ga.color.spectrum.val=function(a,c){if(!ga.browser.clrpkr)if(c)$(a).spectrum({color:c});else return $(a).spectrum("get").toHexString()};
    46 ga.event=function(a,c,b){ga.event.log.push({menu:a,module:c,action:b,when:new Date})};ga.event.log=[];ga.event.list=function(){for(var a=0,c=ga.event.log.length,b="Client Date/Time is "+(new Date).toUTCString()+"\n";a<c;a++)b+=ga.event.log[a].menu+" "+ga.event.log[a].module+" "+ga.event.log[a].action+" "+ga.event.log[a].when.toUTCString()+"\n";return b};
    47 ga.fc=function(a,c){var b,e;ga.fc.cache[a]?c(ga.fc.cache[a]):ga.fc.waits[a]?ga.fc.waits[a].push(c):(ga.fc.waits[a]=[c],$.ajax(ga.fc.url+a).success(function(c){e=ga.fc.waits[a];delete ga.fc.waits[a];c=$.parseJSON(c);ga.fc.cache[a]=c;for(b=e.length;b--;)e[b](c)}).error(function(c){e=ga.fc.waits[a];delete ga.fc.waits[a];console.log("ajax error");console.dir(c);for(b=e.length;b--;)e[b]("**error**");ga.fc.ajax_error_msg("ajax get error: "+c.statusText)}));return!0};
    48 ga.fc.clear=function(a){var c,b=ga.fc.children(a);for(c in b)ga.fc.cache[c]&&delete ga.fc.cache[c];ga.fc.cache[a]&&delete ga.fc.cache[a];for(c in ga.fc.trees)$(c).length&&("#"!==a?$(c).jstree(!0).refresh_node(a):$(c).jstree(!0).refresh())};ga.fc.refresh=function(a){for(var c in ga.fc.trees)$(c).length&&ga.fc.cache[a]&&("#"!==a?$(c).jstree(!0).refresh_node(a):$(c).jstree(!0).refresh())};
    49 ga.fc.delete_node=function(a){a.length&&(ga.fc.url_delete&&0!==ga.fc.url_delete.length?$.ajax({url:ga.fc.url_delete,data:{_window:window.name,_spec:"fc_cache",_delete:a.join(",")},dataType:"json",method:"POST"}).success(function(c){console.log("ajax delete done");c.error&&c.error.length?ga.fc.delete_error_msg(a,c.error):ga.fc.clear("#")}).error(function(a){console.log("ajax error");console.dir(a);ga.fc.ajax_error_msg("ajax delete error: "+a.statusText)}):console.log("ga.fc.delete_node, no url_delete "+
    50 a.join(",")))};ga.fc.delete_node_message=function(a){var c="You are about to permanently remove "+a.length+" file";if(!a.length)return"Can not remove a directory from here";c=1<a.length?c+"s and/or directories":c+" or directory";return c+" and the contents, including subdirectories, of any directory listed below<p>"};
    51 ga.fc.delete_node_message_files=function(a){return a.length?'<div class="table-wrapper"><table><tr><td>'+$.map($.map(a,$.base64.decode),function(a){return a.substr(2)}).join("</td></tr><tr><td>")+"</td></tr></table></div>":""};ga.fc.children=function(a,c){var b,e;c=c||{};if(ga.fc.cache[a])for(b=ga.fc.cache[a].length;b--;)ga.fc.cache[a][b].children&&(e=ga.fc.cache[a][b].id,ga.fc.cache[e]&&(c[e]=!0,c=ga.fc.children(e,c)));return c};ga.fc.cache={};ga.fc.waits={};ga.fc.trees={};
    52 ga.jc=function(a,c){var b,e;ga.jc.cache[a]?c(ga.jc.cache[a]):ga.jc.waits[a]?ga.jc.waits[a].push(c):(ga.jc.waits[a]=[c],$.ajax({url:ga.jc.url,data:{_tree:a,_window:window.name}}).success(function(c){e=ga.jc.waits[a];delete ga.jc.waits[a];c=$.parseJSON(c);ga.jc.cache[a]=c;for(b=e.length;b--;)e[b](c)}).error(function(c){e=ga.jc.waits[a];delete ga.jc.waits[a];console.log("ajax error");console.dir(c);for(b=e.length;b--;)e[b]("**error**");ga.jc.ajax_error_msg("ajax get error: "+c.statusText)}));return!0};
    53 ga.jc.clear_leaf=function(a){var c,b=0,e;for(c in ga.jc.trees)if($(c).length&&(e=$(c).jstree(!0).get_node(a))){b=1;break}b?ga.jc.clear(e.parent):ga.jc.clear("#")};ga.jc.clear=function(a){var c,b=ga.jc.children(a);for(c in b)ga.jc.cache[c]&&delete ga.jc.cache[c];ga.jc.cache[a]&&delete ga.jc.cache[a];for(c in ga.jc.trees)$(c).length&&("#"!==a?$(c).jstree(!0).refresh_node(a):$(c).jstree(!0).refresh())};
    54 ga.jc.refresh=function(a){for(var c in ga.jc.trees)$(c).length&&ga.jc.cache[a]&&("#"!==a?$(c).jstree(!0).refresh_node(a):$(c).jstree(!0).refresh())};
    55 ga.jc.delete_node=function(a){a.length&&(ga.jc.url_delete&&0!==ga.jc.url_delete.length?$.ajax({url:ga.jc.url_delete,data:{_window:window.name,_spec:"fc_cache",_delete:a.join(",")},dataType:"json",method:"POST"}).success(function(c){console.log("ajax delete done");c.error&&c.error.length?ga.jc.delete_error_msg(a,c.error):ga.jc.clear("#")}).error(function(a){console.log("ajax error");console.dir(a);ga.jc.ajax_error_msg("ajax delete error: "+a.statusText)}):console.log("ga.jc.delete_node, no url_delete "+
    56 a.join(",")))};ga.jc.delete_node_message=function(a){var c="You are about to permanently remove "+a.length+" job";1<a.length&&(c+="s");return c};ga.jc.delete_node_message_files=function(a){return a.length?'<div class="table-wrapper"><table><tr><td>'+$.map($.map(a,$.base64.decode),function(a){return a.substr(2)}).join("</td></tr><tr><td>")+"</td></tr></table></div>":""};
    57 ga.jc.children=function(a,c){var b,e;c=c||{};if(ga.jc.cache[a])for(b=ga.jc.cache[a].length;b--;)ga.jc.cache[a][b].children&&(e=ga.jc.cache[a][b].id,ga.jc.cache[e]&&(c[e]=!0,c=ga.jc.children(e,c)));return c};ga.jc.cache={};ga.jc.waits={};ga.jc.trees={};ga.altfile=function(a,c,b){ga.altfile.data[a]=ga.altfile.data[a]||{};ga.altfile.data[a][c]=b};ga.altfile.data={};ga.altfile.bdata={};
    58 ga.altfile.list=function(a){var c;if(ga.altfile.data[a])for(c in ga.altfile.data[a])console.log("module:"+a+" idfile:"+c+" idref:"+ga.altfile.data[a][c]);else console.log("module:"+a+" Empty")};ga.altfile.listall=function(){var a;if(ga.altfile.data)for(a in ga.altfile.data)ga.altfile.list(a);else console.log("ga.altfile:no modules")};ga.altfile.test=function(){ga.altfile("module1","field1","ref1");ga.altfile("module1","field2","ref2");ga.altfile("module2","field3","ref3");ga.altfile.listall()};
    59 ga.altfile.add=function(a){var c,b="",e="#"+a;$(e+" ._hidden_altfiles").remove();$(e+" ._hidden_buttonvals").remove();if(ga.altfile.data[a])for(c in ga.altfile.data[a])b+='<input type="hidden" name="_selaltval_'+c+'" value="'+ga.altfile.data[a][c]+'" class="_hidden_altfiles">';if(ga.altfile.bdata[a])for(c in ga.altfile.bdata[a])b+='<input type="hidden" name="'+c+'" value="'+ga.altfile.bdata[a][c].val+'" class="_hidden_buttonvals">';b.length&&$(e).append(b)};
    60 ga.altfile.button=function(a,c,b,e,f,d){ga.altfile.bdata[a]=ga.altfile.bdata[a]||{};ga.altfile.bdata[a][c]={};ga.altfile.bdata[a][c].val={};ga.altfile.bdata[a][c].text=b;ga.altfile.bdata[a][c].call=e;ga.altfile.bdata[a][c].cb=f;ga.altfile.bdata[a][c].req=d||0};ga.altfile.button.value=function(a,c,b){ga.altfile.bdata[a][c].val=b};
    61 ga.altfile.button.call=function(a,c){var b;ga.altfile.bdata[a][c].call.length?(b=$("#_state").data("_logon"))&&b.length?($("#configbody").load("etc/"+ga.altfile.bdata[a][c].call+".html",function(){ga.altfile.bdata[ga.altfile.bdata[a][c].call]={};ga.altfile.bdata[ga.altfile.bdata[a][c].call].cb=ga.altfile.bdata[a][c].cb;$("#"+ga.altfile.bdata[a][c].call+"text_label").text(ga.altfile.bdata[a][c].text)}),ga.repeats.save(),$(".modalDialog").addClass("modalDialog_on")):ga.msg.box({icon:"warning.png",text:"You must login to browse server information",
    62 buttons:[{id:"ok",label:"OK"}]}):ga.altfile.bdata[a][c].cb("cb");return!1};ga.altfile.button.simplecall=function(a,c){$("#configbody").load("ajax/"+a+"/"+c+".html",function(){});ga.repeats.save();$(".modalDialog").addClass("modalDialog_on");return!1};ga.altfile.button.cb=function(){ga.msg.close(1)};
    63 ga.altfile.button.lrfile=function(a,c,b){var e=[],f="#"+c,d="#"+b,g="",h="_hidden_lrfile_sels_"+b;$(f+" ."+h).remove();$.each($(a).jstree("get_checked",!0),function(){this.children.length||(g+='<input type="hidden" name="'+b+'_altval[]" value="'+this.id+'" class="'+h+'" data-type="rfile_val">',e.push($.base64.decode(this.id).substr(2)))});e.length&&($(d+"_altval").html("<i>Server</i>: "+e),$(d+"_msg").empty(),$(d).val(""),$(f).append(g),ga.value.input[c]&&ga.value.input[c][b]&&ga.value.setInputfromRFile(e,
    64 ga.value.input[c][b].mode,ga.value.input[c][b].ids))};
    65 ga.altfile.button.rpath=function(a,c,b){var e=[];c="#"+c;var f="#"+b,d="",g="_hidden_rpath_sels_"+b,h=$(a).jstree(!0);$(c+" ."+g).remove();$.each(h.get_top_checked(!0),function(){h.is_leaf(this)||(d+='<input type="hidden" name="'+b+'[]" value="'+this.id+'" class="'+g+'"><input type="hidden" name="_decodepath_'+b+'" class="'+g+'">',e.push($.base64.decode(this.id).substr(2)))});e.length&&($(f+"_altval").html("<i>Server</i>: "+e),$(f+"_msg").empty(),$(f).val(""),$(c).append(d))};
    66 ga.altfile.button.rfile=function(a,c,b){var e=[],f="#"+c,d="#"+b,g="",h="_hidden_rfile_sels_"+b;$(a).jstree(!0);$(f+" ."+h).remove();$.each($(a).jstree("get_checked",!0),function(){this.children.length||(g+='<input type="hidden" name="'+b+'_altval[]" value="'+this.id+'" class="'+h+'" data-type="rfile_val">',e.push($.base64.decode(this.id).substr(2)))});e.length&&($(d+"_altval").html("<i>Server</i>: "+e),$(d+"_msg").empty(),$(d).val(""),$(f).append(g),ga.value.input[c]&&ga.value.input[c][b]&&ga.value.setInputfromRFile(e,
    67 ga.value.input[c][b].mode,ga.value.input[c][b].ids))};ga.altfile.button.job=function(a,c,b){var e="";c="#"+c;var f="#"+b,d="",g="_hidden_job_sels_"+b;$(a).jstree(!0);$(c+" ."+g).remove();$.each($(a).jstree("get_checked",!0),function(){this.children.length||(d+='<input type="hidden" name="'+b+'_altval[]" value="'+this.id+'" class="'+g+'">',e+="<tr><td>"+this.parent+":"+this.text+"</td></tr>")});e.length&&($(f+"_altval").html("<table>"+e+"</table>"),$(f+"_msg").empty(),$(f).val(""),$(c).append(d))};
    68 ga.altfile.button.getnames=function(a,c){var b=[];switch(c){case "rpath":b.push(a+"[]");break;case "rfile":b.push(a+"_altval[]");break;case "lrfile":a=a.replace(/_button$/,"");b.push(a+"_altval[]");break;default:console.warn("ga.altfile.button.getnames( "+a+" , "+c+" )")}return b};
    69 ga.altfile.button.getnamesinput=function(a,c){var b=[];switch(c){case "rpath":b.push(a);break;case "rfile":b.push(a+"_altval");break;case "lrfile":a=a.replace(/_button$/,"");b.push(a+"_altval");break;default:console.warn("ga.altfile.button.getnames( "+a+" , "+c+" )")}return b};
    70 ga.altfile.button.addhtml=function(a,c,b,e){var f="";switch(b){case "rpath":b="_hidden_rpath_sels_"+c;f+='<input type="hidden" name="'+c+'[]" value="'+e[0]+'" class="'+b+'"><input type="hidden" name="_decodepath_'+c+'" class="'+b+'">';break;case "rfile":f+='<input type="hidden" name="'+c+'_altval[]" value="'+e[0]+'" class="'+("_hidden_rfile_sels_"+c)+'">';break;case "lrfile":c=c.replace(/_button$/,"");f+='<input type="hidden" name="'+c+'_altval[]" value="'+e[0]+'" class="'+("_hidden_lrfile_sels_"+
    71 c)+'">';break;default:console.warn("ga.altfile.button.getnames( "+c+" , "+b+" )")}$("#"+a).append(f)};ga.valid={};ga.valid.checkMatch=function(a,c){$(a).val()!=$(c).val()?$(a+"_msg").html(" does not match"):$(a+"_msg").empty()};ga.valid.checkText=function(a){var c=$(a),b=c.val(),e=0,f=c.attr("pattern"),d=new RegExp(f);f?d.test(b)?(e=1,$(a+"_msg").empty()):b.length||c.prop("required")?$(a+"_msg").html(" wrong format"):e=1:!b&&c.prop("required")?$(a+"_msg").html(" missing required field"):e=1;return e};
    72 ga.valid.checkFloat=function(a){var c=$(a),b=c.val(),e=0;b.match(/^-?(([1-9][0-9]*)|(0))?([.][0-9]+)?([eE][-+]?[0-9]+)?$/)?(e=1,b<parseFloat(c.attr("min"))?(c.val(c.attr("min")),$(a+"_msg").html(" value set to minimum allowed")):b>parseFloat(c.attr("max"))?(c.val(c.attr("max")),$(a+"_msg").html(" value set to maximum allowed")):$(a+"_msg").empty()):b.length||c.prop("required")?$(a+"_msg").html(" wrong format"):e=1;return e};
    73 ga.valid.checkInt=function(a){var c=$(a),b=c.val(),e=0;b.match(/^-?((0)|([1-9][0-9]*))$/)?(e=1,b<parseInt(c.attr("min"))?(c.val(c.attr("min")),$(a+"_msg").html(" value set to minimum allowed")):b>parseInt(c.attr("max"))?(c.val(c.attr("max")),$(a+"_msg").html(" value set to maximum allowed")):parseInt(b)!=b?($(a+"_msg").html(" value rounded to nearset integer"),c.val(parseInt(parseFloat(b)+.5))):$(a+"_msg").empty()):b.length||c.prop("required")?$(a+"_msg").html(" wrong format"):e=1;return e};
    74 ga.valid.safeFile=function(a){var c=$(a);c.val().match("^[a-zA-Z0-9]+([a-zA-Z0-9_.-]+|/[a-zA-Z0-9_-])+$")?$(a+"_msg").empty():(c.val(c.prop("defaultValue")),$(a+"_msg").html("Not an acceptable filename, reset to default"))};ga.valid.checkLrfile=function(a){var c=$(a),b=$(a+"_altval > i");a=$(a+"_msg");var e=0;if(!c||!c.is(":visible"))return 1;c&&c.val()&&c.val().length?e=1:b&&b.html()&&b.html().length&&"Server"===b.html()&&(e=1);e||a.html(" missing required field");return e};
    75 ga.valid.checkRpath=function(a){var c=$(a),b=$(a+"_altval > i");a=$(a+"_msg");var e=0;if(!c||!c.is(":visible"))return 1;b&&b.html()&&b.html().length&&"Server"===b.html()&&(e=1);e||a.html(" missing required field");return e};ga.valid.checkRfile=function(a){var c=$(a),b=$(a+"_altval > i");a=$(a+"_msg");var e=0;if(!c||!c.is(":visible"))return 1;b&&b.html()&&b.html().length&&"Server"===b.html()&&(e=1);e||a.html(" missing required field");return e};
    76 ga.valid.checksubmit=function(a){var c,b=1;if(!ga.altfile.bdata[a]&&!ga.value.types[a])return 1;ga.valid.clearerrorcounter(a);for(c in ga.altfile.bdata[a])if(ga.altfile.bdata[a][c].req)switch(ga.altfile.bdata[a][c].req){case "lrfile":b=b&&ga.valid.checkLrfile("#"+c);$("#"+c).length&&!ga.valid.checkLrfile("#"+c)&&++ga.fielderrors[a];break;case "rpath":b=b&&ga.valid.checkRpath("#"+c);$("#"+c).length&&!ga.valid.checkRpath("#"+c)&&++ga.fielderrors[a];break;case "rfile":b=b&&ga.valid.checkRfile("#"+c);
    77 $("#"+c).length&&!ga.valid.checkRfile("#"+c)&&++ga.fielderrors[a];break;default:console.log("ga.valid.checksubmit() unsupported required check "+ga.altfile.bdata[a][c].req)}for(c in ga.value.types[a])if(ga.value.types[a][c].req)switch(ga.value.types[a][c].req){case "float":$("#"+c).length&&!ga.valid.checkFloat("#"+c)&&++ga.fielderrors[a];break;case "integer":$("#"+c).length&&!ga.valid.checkInt("#"+c)&&++ga.fielderrors[a];break;case "text":$("#"+c).length&&!ga.valid.checkText("#"+c)&&++ga.fielderrors[a];
    78 break;case "file":$("#"+c).length&&!ga.valid.checkLrfile("#"+c)&&++ga.fielderrors[a];break;default:console.log("ga.valid.checksubmit() unsupported required check "+ga.value.types[a][c].req)}0<ga.fielderrors[a]&&(b=0);return b};ga.valid.showerrormessage=function(a){ga.msg.box({icon:"warning.png",text:""+ga.fielderrors[a]+" fields are missing or not set correctly!",buttons:[{id:"ok",label:"OK"}]});ga.fielderrors[a]=0};ga.valid.clearerrorcounter=function(a){ga.fielderrors[a]=0};ga.airavata={};
    79 ga.airavata.select=function(a,c,b,e){var f=ga.airavata.data,d="",g=[],h,m,k;if("__resource__"==a&&!f.defaultresource||"airavata"!=a&&"__resource__"!=a)return"notused";if(!f.resources||!f.resources.length)return ga.msg.box({icon:"warning.png",text:"No resources currently enabled for Airavata submission"}),"abort";if(1==f.resources.length)return Object.keys(f.resources[k])[0];a="__airavataselect__"!=c?c:f.select.length?f.select:"random";switch(a){case "random":return k=Math.floor(f.resources.length*
    80 Math.random()),Object.keys(f.resources[k])[0];case "choose":g.push({id:"submit_module",label:"Submit",data:[b,e,f.resources],cb:function(a){a[0](a[1],Object.keys(a[2][$("#airavata input[name=selectresource]:checked").val()])[0])}});d='<h3>Select a compute resource and press submit</h3><form id="airavata"><table>';for(h in f.resources)for(m in f.resources[h])d+='<tr><td><input type="radio" name="selectresource" id="airavata_'+h+'" value="'+h+'"'+(0==h?'checked="checked"':"")+'></td><td class="hoverhighlight" style="text-align:left"><label for="airavata_'+
    81 h+'">'+f.resources[h][m]+"</label></td></tr>";ga.msg.box({icon:"question.png",text:d+"</table>",buttons:g});return"deferred";default:return ga.msg.box({icon:"toast.png",text:"ga.airavata.select, unknown selection type '"+a+"'"}),"abort"}};ga.resource={};ga.xsede={};ga.resource.xsedeprojecttokeys=function(){var a;ga.resource.xsedepkeys={};for(a in ga.resource.xsedeproject)ga.resource.xsedepkeys[ga.resource.xsedeproject[a]]=1};
    82 ga.xsede.select=function(a,c,b){var e=ga.xsede.data;a="__resource__"==a?ga.resource.defaultval:a;var f="",d=[],g;delete ga.xsede.useproject;if(!(ga.resource.xsedeproject&&a in ga.resource.xsedepkeys))return c(b);if(!e||!e.length)return ga.msg.box({icon:"warning.png",text:"No XSEDE projects currently defined.  Create one under the user configuration button at the top right."}),"abort";if(1==e.length)return ga.xsede.useproject=e[0],c(b);d.push({id:"submit_xsedeproject",label:"Submit",data:[c,b,e],cb:function(a){ga.xsede.useproject=
    83 a[2][$("#xsedeproject input[name=selectxsedeproject]:checked").val()];a[0](a[1])}});f='<h3>Select an XSEDE project and press submit</h3><form id="xsedeproject"><table>';for(g in e)f+='<tr><td><input type="radio" name="selectxsedeproject" id="xsedeproject_'+g+'" value="'+g+'"'+(0==g?'checked="checked"':"")+'></td><td class="hoverhighlight" style="text-align:left"><label for="xsedeproject_'+g+'">'+e[g]+"</label></td></tr>";ga.msg.box({icon:"question.png",text:f+"</table>",buttons:d});return"deferred"};
     52ga.color.toRGB=function(a){if("#"===a.slice(0,1)){var b=parseInt(a.slice(1),16);var d=parseInt(b/256);b-=256*d;a=parseInt(d/256);return{r:a,b:b,g:d-256*a}}(bits=/^rgb\(\s*(\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\s*\)$/.exec(a))?(a=parseInt(bits[1]),d=parseInt(bits[2]),b=parseInt(bits[3])):b=d=a=128;return{r:a,b:b,g:d}};
     53ga.color.apply=function(){var a;if(ga.directives.data&&ga.directives.data.usercolors&&!/^(off|0|false)$/.test(ga.directives.data.usercolors)){for(d in ga.color.data)ga.color.data.hasOwnProperty(d)&&(a=$(d))&&a.css(ga.color.data[d]);$(".sidebar ul li, .title").css("color",ga.color.data.body.color).hover(function(){$(this).css("color",ga.color.defaults.data.hovercolor.color)},function(){$(this).css("color",ga.color.data.body.color)});$(".svgmenu").css({color:ga.color.data.body.color,stroke:ga.color.data.body.color}).hover(function(){$(this).css({color:ga.color.defaults.data.hovercolor.color,
     54stroke:ga.color.defaults.data.hovercolor.color})},function(){$(this).css({color:ga.color.data.body.color,stroke:ga.color.data.body.color})});if("#"===ga.color.data.body.background.slice(0,1)){var b=parseInt(ga.color.data.body.background.slice(1),16);a=parseInt(b/256);b-=256*a;var d=parseInt(a/256);a-=256*d;d+=128<d?-20:20;a+=128<a?-20:20;b+=128<b?-20:20;$(".help,.coord").css({background:"rgba("+d+","+a+","+b+",0.8)",color:ga.color.data.body.color})}else $(".help,.coord").css({background:ga.color.data[".help"].background,
     55color:ga.color.data[".help"].color});if("#"===ga.color.data.body.color.slice(0,1)){b=parseInt(ga.color.data.body.color.slice(1),16);a=parseInt(b/256);b-=256*a;d=parseInt(a/256);a-=256*d;var e=d;var h=a;var g=b;d+=128<d?-12:12;a+=128<a?-12:12;b+=128<b?-12:12;$(".header1").css({color:"rgb("+d+","+a+","+b+")"});d+=128<d?-12:12;a+=128<a?-12:12;b+=128<b?-12:12;$(".header2").css({color:"rgb("+d+","+a+","+b+")"});d+=128<d?-12:12;a+=128<a?-12:12;b+=128<b?-12:12;$(".header3").css({color:"rgb("+d+","+a+","+
     56b+")"});d+=128<d?-12:12;a+=128<a?-12:12;b+=128<b?-12:12;$(".header4").css({color:"rgb("+d+","+a+","+b+")"});d+=128<d?-12:12;a+=128<a?-12:12;b+=128<b?-12:12;$("hr").css({color:"rgb("+d+","+a+","+b+")"});d=e;a=h;b=g;a+=128<a?-75:75;ga.cssrule.kill("a:link");var m=ga.cssrule.add("a:link");m.style.color="rgb("+d+","+a+","+b+")";a=h;b+=128<b?-75:75;d+=128<d?-75:75;ga.cssrule.kill("a:visited");m=ga.cssrule.add("a:visited");m.style.color="rgb("+d+","+a+","+b+")";b=g;d=e;d+=128<d?-75:75;ga.cssrule.kill("a:active");
     57m=ga.cssrule.add("a:active");m.style.color="rgb("+d+","+a+","+b+")"}else $(".header1").css({color:ga.color.data[".header1"]?ga.color.data[".header1"].color:ga.color.data.body.color}),$(".header2").css({color:ga.color.data[".header2"]?ga.color.data[".header2"].color:ga.color.data.body.color}),$(".header3").css({color:ga.color.data[".header3"]?ga.color.data[".header3"].color:ga.color.data.body.color}),$(".header4").css({color:ga.color.data[".header4"]?ga.color.data[".header4"].color:ga.color.data.body.color});
     58$(".modalDialog > div, .modalDialog2 > div, .modalDialog3 > div, .modalDialog4 > div").css({background:ga.browser.gradient?ga.browser.prefix+"linear-gradient("+ga.color.data.body.background+", #222)":ga.color.data.body.background})}};ga.color.reset=function(){ga.color(ga.color.defaults.data)};ga.color.spectrum=function(a){if(!ga.browser.clrpkr)$(a).on("change.spectrum",function(b,d){console.log("hi spectrum"+a);$(a).val(d.toHexString())})};
     59ga.color.spectrum.val=function(a,b){if(!ga.browser.clrpkr)if(b)$(a).spectrum({color:b});else return $(a).spectrum("get").toHexString()};ga.event=function(a,b,d){ga.event.log.push({menu:a,module:b,action:d,when:new Date})};ga.event.log=[];ga.event.list=function(){for(var a=0,b=ga.event.log.length,d="Client Date/Time is "+(new Date).toUTCString()+"\n";a<b;a++)d+=ga.event.log[a].menu+" "+ga.event.log[a].module+" "+ga.event.log[a].action+" "+ga.event.log[a].when.toUTCString()+"\n";return d};
     60ga.fc=function(a,b){var d,e;ga.fc.cache[a]?b(ga.fc.cache[a]):ga.fc.waits[a]?ga.fc.waits[a].push(b):(ga.fc.waits[a]=[b],$.ajax(ga.fc.url+a).success(function(h){e=ga.fc.waits[a];delete ga.fc.waits[a];h=$.parseJSON(h);ga.fc.cache[a]=h;for(d=e.length;d--;)e[d](h)}).error(function(h){e=ga.fc.waits[a];delete ga.fc.waits[a];console.log("ajax error");console.dir(h);for(d=e.length;d--;)e[d]("**error**");ga.fc.ajax_error_msg("ajax get error: "+h.statusText)}));return!0};
     61ga.fc.clear=function(a){var b,d=ga.fc.children(a);for(b in d)ga.fc.cache[b]&&delete ga.fc.cache[b];ga.fc.cache[a]&&delete ga.fc.cache[a];for(b in ga.fc.trees)$(b).length&&("#"!==a?$(b).jstree(!0).refresh_node(a):$(b).jstree(!0).refresh())};ga.fc.refresh=function(a){for(var b in ga.fc.trees)$(b).length&&ga.fc.cache[a]&&("#"!==a?$(b).jstree(!0).refresh_node(a):$(b).jstree(!0).refresh())};
     62ga.fc.delete_node=function(a){a.length&&(ga.fc.url_delete&&0!==ga.fc.url_delete.length?$.ajax({url:ga.fc.url_delete,data:{_window:window.name,_spec:"fc_cache",_delete:a.join(",")},dataType:"json",method:"POST"}).success(function(b){console.log("ajax delete done");b.error&&b.error.length?ga.fc.delete_error_msg(a,b.error):ga.fc.clear("#")}).error(function(b){console.log("ajax error");console.dir(b);ga.fc.ajax_error_msg("ajax delete error: "+b.statusText)}):console.log("ga.fc.delete_node, no url_delete "+
     63a.join(",")))};ga.fc.delete_node_message=function(a){var b="You are about to permanently remove "+a.length+" file";if(!a.length)return"Can not remove a directory from here";b=1<a.length?b+"s and/or directories":b+" or directory";return b+" and the contents, including subdirectories, of any directory listed below<p>"};
     64ga.fc.delete_node_message_files=function(a){return a.length?'<div class="table-wrapper"><table><tr><td>'+$.map($.map(a,$.base64.decode),function(b){return b.substr(2)}).join("</td></tr><tr><td>")+"</td></tr></table></div>":""};ga.fc.children=function(a,b){var d;b=b||{};if(ga.fc.cache[a])for(d=ga.fc.cache[a].length;d--;)if(ga.fc.cache[a][d].children){var e=ga.fc.cache[a][d].id;ga.fc.cache[e]&&(b[e]=!0,b=ga.fc.children(e,b))}return b};ga.fc.cache={};ga.fc.waits={};ga.fc.trees={};
     65ga.jc=function(a,b){var d,e;ga.jc.cache[a]?b(ga.jc.cache[a]):ga.jc.waits[a]?ga.jc.waits[a].push(b):(ga.jc.waits[a]=[b],$.ajax({url:ga.jc.url,data:{_tree:a,_window:window.name}}).success(function(h){e=ga.jc.waits[a];delete ga.jc.waits[a];h=$.parseJSON(h);ga.jc.cache[a]=h;for(d=e.length;d--;)e[d](h)}).error(function(h){e=ga.jc.waits[a];delete ga.jc.waits[a];console.log("ajax error");console.dir(h);for(d=e.length;d--;)e[d]("**error**");ga.jc.ajax_error_msg("ajax get error: "+h.statusText)}));return!0};
     66ga.jc.clear_leaf=function(a){var b,d=0,e;for(b in ga.jc.trees)if($(b).length&&(e=$(b).jstree(!0).get_node(a))){d=1;break}d?ga.jc.clear(e.parent):ga.jc.clear("#")};ga.jc.clear=function(a){var b,d=ga.jc.children(a);for(b in d)ga.jc.cache[b]&&delete ga.jc.cache[b];ga.jc.cache[a]&&delete ga.jc.cache[a];for(b in ga.jc.trees)$(b).length&&("#"!==a?$(b).jstree(!0).refresh_node(a):$(b).jstree(!0).refresh())};
     67ga.jc.refresh=function(a){for(var b in ga.jc.trees)$(b).length&&ga.jc.cache[a]&&("#"!==a?$(b).jstree(!0).refresh_node(a):$(b).jstree(!0).refresh())};
     68ga.jc.delete_node=function(a){a.length&&(ga.jc.url_delete&&0!==ga.jc.url_delete.length?$.ajax({url:ga.jc.url_delete,data:{_window:window.name,_spec:"fc_cache",_delete:a.join(",")},dataType:"json",method:"POST"}).success(function(b){console.log("ajax delete done");b.error&&b.error.length?ga.jc.delete_error_msg(a,b.error):ga.jc.clear("#")}).error(function(b){console.log("ajax error");console.dir(b);ga.jc.ajax_error_msg("ajax delete error: "+b.statusText)}):console.log("ga.jc.delete_node, no url_delete "+
     69a.join(",")))};ga.jc.delete_node_message=function(a){var b="You are about to permanently remove "+a.length+" job";1<a.length&&(b+="s");return b};ga.jc.delete_node_message_files=function(a){return a.length?'<div class="table-wrapper"><table><tr><td>'+$.map($.map(a,$.base64.decode),function(b){return b.substr(2)}).join("</td></tr><tr><td>")+"</td></tr></table></div>":""};
     70ga.jc.children=function(a,b){var d;b=b||{};if(ga.jc.cache[a])for(d=ga.jc.cache[a].length;d--;)if(ga.jc.cache[a][d].children){var e=ga.jc.cache[a][d].id;ga.jc.cache[e]&&(b[e]=!0,b=ga.jc.children(e,b))}return b};ga.jc.cache={};ga.jc.waits={};ga.jc.trees={};ga.altfile=function(a,b,d){ga.altfile.data[a]=ga.altfile.data[a]||{};ga.altfile.data[a][b]=d};ga.altfile.data={};ga.altfile.bdata={};
     71ga.altfile.list=function(a){var b;if(ga.altfile.data[a])for(b in ga.altfile.data[a])console.log("module:"+a+" idfile:"+b+" idref:"+ga.altfile.data[a][b]);else console.log("module:"+a+" Empty")};ga.altfile.listall=function(){var a;if(ga.altfile.data)for(a in ga.altfile.data)ga.altfile.list(a);else console.log("ga.altfile:no modules")};ga.altfile.test=function(){ga.altfile("module1","field1","ref1");ga.altfile("module1","field2","ref2");ga.altfile("module2","field3","ref3");ga.altfile.listall()};
     72ga.altfile.add=function(a){var b,d="",e="#"+a;$(e+" ._hidden_altfiles").remove();$(e+" ._hidden_buttonvals").remove();if(ga.altfile.data[a])for(b in ga.altfile.data[a])d+='<input type="hidden" name="_selaltval_'+b+'" value="'+ga.altfile.data[a][b]+'" class="_hidden_altfiles">';if(ga.altfile.bdata[a])for(b in ga.altfile.bdata[a])d+='<input type="hidden" name="'+b+'" value="'+ga.altfile.bdata[a][b].val+'" class="_hidden_buttonvals">';d.length&&$(e).append(d)};
     73ga.altfile.button=function(a,b,d,e,h,g){ga.altfile.bdata[a]=ga.altfile.bdata[a]||{};ga.altfile.bdata[a][b]={};ga.altfile.bdata[a][b].val={};ga.altfile.bdata[a][b].text=d;ga.altfile.bdata[a][b].call=e;ga.altfile.bdata[a][b].cb=h;ga.altfile.bdata[a][b].req=g||0};ga.altfile.button.value=function(a,b,d){ga.altfile.bdata[a][b].val=d};
     74ga.altfile.button.call=function(a,b){var d;ga.altfile.bdata[a][b].call.length?(d=$("#_state").data("_logon"))&&d.length?($("#configbody").load("etc/"+ga.altfile.bdata[a][b].call+".html",function(){ga.altfile.bdata[ga.altfile.bdata[a][b].call]={};ga.altfile.bdata[ga.altfile.bdata[a][b].call].cb=ga.altfile.bdata[a][b].cb;$("#"+ga.altfile.bdata[a][b].call+"text_label").text(ga.altfile.bdata[a][b].text)}),ga.repeats.save(),$(".modalDialog").addClass("modalDialog_on")):ga.msg.box({icon:"warning.png",text:"You must login to browse server information",
     75buttons:[{id:"ok",label:"OK"}]}):ga.altfile.bdata[a][b].cb("cb");return!1};ga.altfile.button.simplecall=function(a,b){$("#configbody").load("ajax/"+a+"/"+b+".html",function(){});ga.repeats.save();$(".modalDialog").addClass("modalDialog_on");return!1};ga.altfile.button.cb=function(){ga.msg.close(1)};
     76ga.altfile.button.lrfile=function(a,b,d){var e=[],h="#"+b,g="#"+d,m="",l="_hidden_lrfile_sels_"+d;$(h+" ."+l).remove();$.each($(a).jstree("get_checked",!0),function(){this.children.length||(m+='<input type="hidden" name="'+d+'_altval[]" value="'+this.id+'" class="'+l+'" data-type="rfile_val">',e.push($.base64.decode(this.id).substr(2)))});e.length&&($(g+"_altval").html("<i>Server</i>: "+e),$(g+"_msg").empty(),$(g).val(""),$(h).append(m),ga.value.input[b]&&ga.value.input[b][d]&&ga.value.setInputfromRFile(e,
     77ga.value.input[b][d].mode,ga.value.input[b][d].ids))};
     78ga.altfile.button.rpath=function(a,b,d){var e=[];b="#"+b;var h="#"+d,g="",m="_hidden_rpath_sels_"+d,l=$(a).jstree(!0);$(b+" ."+m).remove();$.each(l.get_top_checked(!0),function(){l.is_leaf(this)||(g+='<input type="hidden" name="'+d+'[]" value="'+this.id+'" class="'+m+'"><input type="hidden" name="_decodepath_'+d+'" class="'+m+'">',e.push($.base64.decode(this.id).substr(2)))});e.length&&($(h+"_altval").html("<i>Server</i>: "+e),$(h+"_msg").empty(),$(h).val(""),$(b).append(g))};
     79ga.altfile.button.rfile=function(a,b,d){var e=[],h="#"+b,g="#"+d,m="",l="_hidden_rfile_sels_"+d;$(a).jstree(!0);$(h+" ."+l).remove();$.each($(a).jstree("get_checked",!0),function(){this.children.length||(m+='<input type="hidden" name="'+d+'_altval[]" value="'+this.id+'" class="'+l+'" data-type="rfile_val">',e.push($.base64.decode(this.id).substr(2)))});e.length&&($(g+"_altval").html("<i>Server</i>: "+e),$(g+"_msg").empty(),$(g).val(""),$(h).append(m),ga.value.input[b]&&ga.value.input[b][d]&&ga.value.setInputfromRFile(e,
     80ga.value.input[b][d].mode,ga.value.input[b][d].ids))};ga.altfile.button.job=function(a,b,d){var e="";b="#"+b;var h="#"+d,g="",m="_hidden_job_sels_"+d;$(a).jstree(!0);$(b+" ."+m).remove();$.each($(a).jstree("get_checked",!0),function(){this.children.length||(g+='<input type="hidden" name="'+d+'_altval[]" value="'+this.id+'" class="'+m+'">',e+="<tr><td>"+this.parent+":"+this.text+"</td></tr>")});e.length&&($(h+"_altval").html("<table>"+e+"</table>"),$(h+"_msg").empty(),$(h).val(""),$(b).append(g))};
     81ga.altfile.button.getnames=function(a,b){var d=[];switch(b){case "rpath":d.push(a+"[]");break;case "rfile":d.push(a+"_altval[]");break;case "lrfile":a=a.replace(/_button$/,"");d.push(a+"_altval[]");break;default:console.warn("ga.altfile.button.getnames( "+a+" , "+b+" )")}return d};
     82ga.altfile.button.getnamesinput=function(a,b){var d=[];switch(b){case "rpath":d.push(a);break;case "rfile":d.push(a+"_altval");break;case "lrfile":a=a.replace(/_button$/,"");d.push(a+"_altval");break;default:console.warn("ga.altfile.button.getnames( "+a+" , "+b+" )")}return d};
     83ga.altfile.button.addhtml=function(a,b,d,e){var h="";switch(d){case "rpath":d="_hidden_rpath_sels_"+b;h+='<input type="hidden" name="'+b+'[]" value="'+e[0]+'" class="'+d+'"><input type="hidden" name="_decodepath_'+b+'" class="'+d+'">';break;case "rfile":h+='<input type="hidden" name="'+b+'_altval[]" value="'+e[0]+'" class="_hidden_rfile_sels_'+b+'">';break;case "lrfile":b=b.replace(/_button$/,"");h+='<input type="hidden" name="'+b+'_altval[]" value="'+e[0]+'" class="_hidden_lrfile_sels_'+b+'">';break;
     84default:console.warn("ga.altfile.button.getnames( "+b+" , "+d+" )")}$("#"+a).append(h)};ga.valid={};ga.valid.checkMatch=function(a,b){$(a).val()!=$(b).val()?$(a+"_msg").html(" does not match"):$(a+"_msg").empty()};ga.valid.checkText=function(a){var b=$(a),d=b.val(),e=0,h=b.attr("pattern"),g=new RegExp(h);h?g.test(d)?(e=1,$(a+"_msg").empty()):d.length||b.prop("required")?$(a+"_msg").html(" wrong format"):e=1:!d&&b.prop("required")?$(a+"_msg").html(" missing required field"):e=1;return e};
     85ga.valid.checkFloat=function(a){var b=$(a),d=b.val(),e=0;d.match(/^-?(([1-9][0-9]*)|(0))?([.][0-9]+)?([eE][-+]?[0-9]+)?$/)?(e=1,d<parseFloat(b.attr("min"))?(b.val(b.attr("min")),$(a+"_msg").html(" value set to minimum allowed")):d>parseFloat(b.attr("max"))?(b.val(b.attr("max")),$(a+"_msg").html(" value set to maximum allowed")):$(a+"_msg").empty()):d.length||b.prop("required")?$(a+"_msg").html(" wrong format"):e=1;return e};
     86ga.valid.checkInt=function(a){var b=$(a),d=b.val(),e=0;d.match(/^-?((0)|([1-9][0-9]*))$/)?(e=1,d<parseInt(b.attr("min"))?(b.val(b.attr("min")),$(a+"_msg").html(" value set to minimum allowed")):d>parseInt(b.attr("max"))?(b.val(b.attr("max")),$(a+"_msg").html(" value set to maximum allowed")):parseInt(d)!=d?($(a+"_msg").html(" value rounded to nearset integer"),b.val(parseInt(parseFloat(d)+.5))):$(a+"_msg").empty()):d.length||b.prop("required")?$(a+"_msg").html(" wrong format"):e=1;return e};
     87ga.valid.safeFile=function(a){var b=$(a);b.val().match("^[a-zA-Z0-9]+([a-zA-Z0-9_.-]+|/[a-zA-Z0-9_-])+$")?$(a+"_msg").empty():(b.val(b.prop("defaultValue")),$(a+"_msg").html("Not an acceptable filename, reset to default"))};ga.valid.checkLrfile=function(a){var b=$(a),d=$(a+"_altval > i");a=$(a+"_msg");var e=0;if(!b||!b.is(":visible"))return 1;b&&b.val()&&b.val().length?e=1:d&&d.html()&&d.html().length&&"Server"===d.html()&&(e=1);e||a.html(" missing required field");return e};
     88ga.valid.checkRpath=function(a){var b=$(a),d=$(a+"_altval > i");a=$(a+"_msg");var e=0;if(!b||!b.is(":visible"))return 1;d&&d.html()&&d.html().length&&"Server"===d.html()&&(e=1);e||a.html(" missing required field");return e};ga.valid.checkRfile=function(a){var b=$(a),d=$(a+"_altval > i");a=$(a+"_msg");var e=0;if(!b||!b.is(":visible"))return 1;d&&d.html()&&d.html().length&&"Server"===d.html()&&(e=1);e||a.html(" missing required field");return e};
     89ga.valid.checksubmit=function(a){var b,d=1;if(!ga.altfile.bdata[a]&&!ga.value.types[a])return 1;ga.valid.clearerrorcounter(a);for(b in ga.altfile.bdata[a])if(ga.altfile.bdata[a][b].req)switch(ga.altfile.bdata[a][b].req){case "lrfile":d=d&&ga.valid.checkLrfile("#"+b);$("#"+b).length&&!ga.valid.checkLrfile("#"+b)&&++ga.fielderrors[a];break;case "rpath":d=d&&ga.valid.checkRpath("#"+b);$("#"+b).length&&!ga.valid.checkRpath("#"+b)&&++ga.fielderrors[a];break;case "rfile":d=d&&ga.valid.checkRfile("#"+b);
     90$("#"+b).length&&!ga.valid.checkRfile("#"+b)&&++ga.fielderrors[a];break;default:console.log("ga.valid.checksubmit() unsupported required check "+ga.altfile.bdata[a][b].req)}for(b in ga.value.types[a])if(ga.value.types[a][b].req)switch(ga.value.types[a][b].req){case "float":$("#"+b).length&&!ga.valid.checkFloat("#"+b)&&++ga.fielderrors[a];break;case "integer":$("#"+b).length&&!ga.valid.checkInt("#"+b)&&++ga.fielderrors[a];break;case "text":$("#"+b).length&&!ga.valid.checkText("#"+b)&&++ga.fielderrors[a];
     91break;case "file":$("#"+b).length&&!ga.valid.checkLrfile("#"+b)&&++ga.fielderrors[a];break;default:console.log("ga.valid.checksubmit() unsupported required check "+ga.value.types[a][b].req)}0<ga.fielderrors[a]&&(d=0);return d};ga.valid.showerrormessage=function(a){ga.msg.box({icon:"warning.png",text:""+ga.fielderrors[a]+" fields are missing or not set correctly!",buttons:[{id:"ok",label:"OK"}]});ga.fielderrors[a]=0};ga.valid.clearerrorcounter=function(a){ga.fielderrors[a]=0};ga.airavata={};
     92ga.airavata.select=function(a,b,d,e){var h=ga.airavata.data,g="",m=[],l,f;if("__resource__"==a&&!h.defaultresource||"airavata"!=a&&"__resource__"!=a)return"notused";if(!h.resources||!h.resources.length)return ga.msg.box({icon:"warning.png",text:"No resources currently enabled for Airavata submission"}),"abort";if(1==h.resources.length)return Object.keys(h.resources[p])[0];a="__airavataselect__"!=b?b:h.select.length?h.select:"random";switch(a){case "random":var p=Math.floor(h.resources.length*Math.random());
     93return Object.keys(h.resources[p])[0];case "choose":m.push({id:"submit_module",label:"Submit",data:[d,e,h.resources],cb:function(q){q[0](q[1],Object.keys(q[2][$("#airavata input[name=selectresource]:checked").val()])[0])}});g='<h3>Select a compute resource and press submit</h3><form id="airavata"><table>';for(l in h.resources)for(f in h.resources[l])g+='<tr><td><input type="radio" name="selectresource" id="airavata_'+l+'" value="'+l+'"'+(0==l?'checked="checked"':"")+'></td><td class="hoverhighlight" style="text-align:left"><label for="airavata_'+
     94l+'">'+h.resources[l][f]+"</label></td></tr>";ga.msg.box({icon:"question.png",text:g+"</table>",buttons:m});return"deferred";default:return ga.msg.box({icon:"toast.png",text:"ga.airavata.select, unknown selection type '"+a+"'"}),"abort"}};ga.resource={};ga.xsede={};ga.resource.xsedeprojecttokeys=function(){var a;ga.resource.xsedepkeys={};for(a in ga.resource.xsedeproject)ga.resource.xsedepkeys[ga.resource.xsedeproject[a]]=1};
     95ga.xsede.select=function(a,b,d){var e=ga.xsede.data;a="__resource__"==a?ga.resource.defaultval:a;var h="",g=[],m;delete ga.xsede.useproject;if(!(ga.resource.xsedeproject&&a in ga.resource.xsedepkeys))return b(d);if(!e||!e.length)return ga.msg.box({icon:"warning.png",text:"No XSEDE projects currently defined.  Create one under the user configuration button at the top right."}),"abort";if(1==e.length)return ga.xsede.useproject=e[0],b(d);g.push({id:"submit_xsedeproject",label:"Submit",data:[b,d,e],cb:function(l){ga.xsede.useproject=
     96l[2][$("#xsedeproject input[name=selectxsedeproject]:checked").val()];l[0](l[1])}});h='<h3>Select an XSEDE project and press submit</h3><form id="xsedeproject"><table>';for(m in e)h+='<tr><td><input type="radio" name="selectxsedeproject" id="xsedeproject_'+m+'" value="'+m+'"'+(0==m?'checked="checked"':"")+'></td><td class="hoverhighlight" style="text-align:left"><label for="xsedeproject_'+m+'">'+e[m]+"</label></td></tr>";ga.msg.box({icon:"question.png",text:h+"</table>",buttons:g});return"deferred"};
    8497ga.value={};ga.value.settings={};
    85 ga.value.checkFloatIntOK=function(a,c){var b=$(a);if(isNaN(c[0]))return b.val(b.prop("defaultValue")),!1;"float"==b.data("type")?c[0]<parseFloat(b.attr("min"))?(c.splice(0,c.length),c.push(b.attr("min"))):c[0]>parseFloat(b.attr("max"))?(c.splice(0,c.length),c.push(b.attr("max"))):$(a+"_msg").empty():"integer"==b.data("type")&&(c[0]<parseInt(b.attr("min"))?(c.splice(0,c.length),c.push(b.attr("min"))):c[0]>parseInt(b.attr("max"))?(c.splice(0,c.length),c.push(b.attr("max"))):parseInt(c[0])!=c[0]?(b=
    86 c[0],c.splice(0,c.length),c.push(parseInt(parseFloat(b)+.5))):$(a+"_msg").empty());return!0};ga.value.sethiddenfields=function(a,c){var b=[],e;$.each(a[c],function(a,c){$.each(c,function(a,c){b.push(c)})});b=ga.repeat.map.convert(b);for(e=0;e<b.length;e++)$("#"+b[e]).data("repeater")&&$("#"+b[e]+"-repeater").hide(),$("#"+b[e]+", label[for="+b[e]+"]").hide()};
    87 ga.value.showfields=function(a,c,b,e){var f=[];$.each(a[c],function(a,c){console.log(a);a==b[e]&&$.each(c,function(a,b){console.log(b);f.push(b)})});for(a=0;a<f.length;a++)$("#"+f[a]).data("repeater")&&$("#"+f[a]+"-repeater").show(),$("#"+f[a]+", label[for="+f[a]+"]").show()};
    88 ga.value.modifyformdata=function(a,c,b,e,f){var d=[],g,h;console.log(e);$.each(a[c],function(a,b){console.log(a);-1!==jQuery.inArray(a,e)&&$.each(b,function(a,b){d.push(b)})});d=ga.repeat.map.convert(d);for(a=0;a<d.length;a++){if($("#"+d[a]).data("repeater"))for(g in h=ga.repeat.children(c,d[a]),h)h=d[a]+"-"+g,b["delete"](h);b["delete"](d[a])}b.append("currentstage",ga.stages[c][f])};
    89 ga.value.processInputfromFiles=function(a,c,b,e){var f=a.trim().split(/[\r\n]+/g),d=[],g=0;b=ga.repeat.map.convert(b);for(var h=0;h<f.length;h++){var m=f[h].trim().split(/\s+/),g=g+m.length;d.push(g)}var g=[],k=[],r=[],l=[],u=[],v=[],m=[],y=0;switch(c){case "whitespace_formulchcompost":a=[];for(h=0;h<f.length;h++)d=f[h].split("#")[0],d=d.replace(/\s{2,}/g," "),d=d.replace(/\t/g," "),d=d.toString().trim().replace(/(\r\n|\n|\r)/g,""),a.push(d);for(var f=parseInt(a[1]),p,h=0;h<a.length;h++)if(2<h&&h<
    90 3+f)for(p=a[h].trim().split(/\s+/),d=0;d<p.length;d++)k.push(p[d]);else g.push(a[h]);m.push(k);for(h=0;h<b.length;h++)switch($("#"+b[h]).attr("type")){case "text":k=new RegExp($("#"+b[h]).attr("pattern"));if(!k.test(g[h])){ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+y+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",buttons:[{id:"ok",label:"OK"}]});return}break;case "number":k=[g[h]];
    91 if(ga.value.checkFloatIntOK("#"+b[h],k))g[h]=k[0];else{ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+y+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",buttons:[{id:"ok",label:"OK"}]});return}break;default:ga.msg.box({icon:"warning.png",text:"Selected input type is currently not supported. Contact the developer",buttons:[{id:"ok",label:"OK"}]});return}break;case "whitespace_formulchrg":case "whitespace_formulchcontrast":a=
    92 [];for(h=0;h<f.length;h++)d=f[h].split("#")[0],d=d.replace(/\s{2,}/g," "),d=d.replace(/\t/g," "),d=d.toString().trim().replace(/(\r\n|\n|\r)/g,""),a.push(d);for(var f=parseInt(a[1]),w=parseInt(a[2+f]),z=parseInt(a[5+f+w]),B=parseInt(a[9+f+w+z]),h=0;h<a.length;h++)if(1<h&&h<2+f)for(p=a[h].trim().split(/\s+/),d=0;d<p.length;d++)k.push(p[d]);else h>2+f&&h<3+f+w?(p=a[h].trim().split(/\s+/),r.push(p[1]),r.push(p[2]),r.push(p[0]),r.push(p[3])):h>5+f+w&&h<6+f+w+z?(p=a[h].trim().split(/\s+/),l.push(p[1]),
    93 l.push(p[2]),l.push(p[0]),l.push(p[3])):h>8+f+w+z&&h<9+f+w+z+B?(p=a[h].trim().split(/\s+/),u.push(p[1]),u.push(p[2]),u.push(p[0]),u.push(p[3])):g.push(a[h]);v.push(k);v.push(r);v.push(l);v.push(u);for(h=d=0;h<b.length;h++)if($("#"+b[h]).length)switch($("#"+b[h]).data("repeater")&&(m.push(v[d]),d++),$("#"+b[h]).attr("type")){case "text":k=new RegExp($("#"+b[h]).attr("pattern"));if(!k.test(g[h])){ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+y+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",
    94 buttons:[{id:"ok",label:"OK"}]});return}break;case "number":k=[g[h]];if(ga.value.checkFloatIntOK("#"+b[h],k))g[h]=k[0];else{ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+y+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",buttons:[{id:"ok",label:"OK"}]});return}break;default:ga.msg.box({icon:"warning.png",text:"Selected input type is currently not supported. Contact the developer",buttons:[{id:"ok",
    95 label:"OK"}]});return}else d++;break;case "whitespaceseparated":case "whitespaceseparated_reverselogic":g=a.trim().split(/\s+/);if(g.length==b.length)for(h=0;h<g.length;h++){for(v=0;v<d.length;v++)if(h+1<=d[v]){y=v+1;break}switch($("#"+b[h]).attr("type")){case "checkbox":k=/^(0|1|n|y|true|false|t|f|yes|no)$/;if(!k.test(g[h].toLowerCase())){ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Checkbox input value on the line #"+y+" is not valid. Options are: [1 | 0 | yes | no | true | false | t | f | T | F | y | n | Y | N ]. Check your input file",
    96 buttons:[{id:"ok",label:"OK"}]});return}break;case "number":k=[g[h]];if(ga.value.checkFloatIntOK("#"+b[h],k))g[h]=k[0];else{ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+y+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",buttons:[{id:"ok",label:"OK"}]});return}break;case "text":k=new RegExp($("#"+b[h]).attr("pattern"));if(!k.test(g[h])){ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+
    97 y+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",buttons:[{id:"ok",label:"OK"}]});return}break;default:ga.msg.box({icon:"warning.png",text:"Selected input type is currently not supported. Contact the developer",buttons:[{id:"ok",label:"OK"}]});return}}else{ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Number of parameters is inconsistent with the model chosen. Check your parameter file",buttons:[{id:"ok",label:"OK"}]});
    98 return}break;default:ga.msg.box({icon:"warning.png",text:"Selected file parsing mode is currently not supported. Contact the developer",buttons:[{id:"ok",label:"OK"}]});return}for(h=y=0;h<g.length;h++){switch($("#"+b[h]).attr("type")){case "checkbox":if(0<=c.indexOf("reverselogic"))switch(g[h].toLowerCase()){case "0":case "false":case "f":case "n":case "no":$("#"+b[h]).prop("checked",!0);break;case "1":case "true":case "t":case "yes":case "y":case "r":$("#"+b[h]).prop("checked",!1);break}else switch(g[h].toLowerCase()){case "0":case "false":case "f":case "n":case "no":$("#"+
    99 b[h]).prop("checked",!1);break;case "1":case "true":case "t":case "yes":case "y":case "r":$("#"+b[h]).prop("checked",!0);break}default:$("#"+b[h]).val(g[h]),$("#"+b[h]).prop("defaultValue",g[h])}if($("#"+b[h]).data("repeater")){ga.repeat.change(e,b[h]);children=ga.repeat.children(e,b[h]);k=$("#"+b[h]).val();l=r=0;for(v=1;v<=k;++v)for(t in l=0,children)if(u=m[y][r],d=b[h]+"-"+t+"-"+(v-1),++l,"whitespace_formulchrg"!=c&&"whitespace_formulchcompost"!=c||1!=l)"whitespace_formulchcompost"==c&&2==l?("r"==
    100 u.toLowerCase()&&$("#"+d).prop("checked",!0),"f"==u.toLowerCase()&&$("#"+d).prop("checked",!1)):"whitespace_formulchcompost"==c&&5==l||$("#"+d).val(u),r++;ga.repeat.change(e,b[h]);y++}}};ga.value.input={};ga.value.setInputForRFile=function(a,c,b,e,f){ga.value.input[a]=ga.value.input[a]||{};ga.value.input[a][b]={};ga.value.input[a][b].id=b;ga.value.input[a][b].tag=c;ga.value.input[a][b].mode=e;ga.value.input[a][b].ids=f};ga.value.types={};
    101 ga.value.registerid=function(a,c,b,e){ga.value.types[a]=ga.value.types[a]||{};ga.value.types[a][c]={};ga.value.types[a][c].id=c;ga.value.types[a][c].label=b;ga.value.types[a][c].req=e||0};ga.value.setInputfromRFile=function(a,c,b,e){var f=b.split(",");a="results/users/"+$("#_state").data("_logon")+"/"+a;$.get(a,function(a){ga.value.processInputfromFiles(a,c,f,e)},"text")};
    102 ga.value.setInputfromFile=function(a,c,b,e){$(a).hide();var f=b.split(",");$(a).change(function(b){b=$(a)[0].files[0];var g=new FileReader;g.onload=function(a){ga.value.processInputfromFiles(a.target.result,c,f,e)};g.readAsText(b)})};
    103 ga.value.setLastValue=function(a,c,b){var e=a+":"+c+":last_value",f=a+":"+c+":default_value",d=$(c);if(!/_output$/.test(a))return!1;if(void 0==$("#global_data").data(e))switch(d.attr("type")){case "checkbox":case "radio":$("#global_data").data(e,d.is(":checked"));$("#global_data").data(f,d.is(":checked"));break;case "div":case "msgs":$("#global_data").data(e,d.html());$("#global_data").data(f,d.html());break;case "plot3d":case "plotly":c=c.replace(/^#/,"");Plotly.newPlot(c,[],{});Plotly.purge(c);
    104 break;case "plot2d":break;case "ngl":ga.ngl.clear(e,c);break;case "bokeh":ga.bokeh.renderdata(a,c.replace(/^#/,""));break;case "filelink":case "filelinkm":$("#global_data").data(e,$(c+"_filelink").html());break;default:b&&d.val(b),$("#global_data").data(e,d.val()),$("#global_data").data(f,d.val())}else switch(d.attr("type")){case "checkbox":case "radio":d.prop("checked",$("#global_data").data(e));break;case "div":case "msgs":d.html($("#global_data").data(e));break;case "atomicstructure":c=c.replace(/^#/,
    105 "");$("#global_data").data(e)?(_jmol_info[c].script=$("#global_data").data(e),d.html(Jmol.getAppletHtml("jmolApplet"+c,_jmol_info[c]))):d.empty();break;case "plot2d":a=gd.data(e);a.data?(ga.value.set.plot2d(c,a.options),d.plot(a.data,ga.value.get.plot2d.plot_options(c,a.options))):d.plot(a,ga.value.get.plot2d.plot_options(c));break;case "plot3d":case "plotly":d=gd.data(e);d.data&&Plotly.plot(c.replace(/^#/,""),d.data,d.layout);break;case "bokeh":break;case "ngl":(d=gd.data(e))&&ga.value.nglshow(a,
    106 c.replace(/^#/,""),d);break;case "filelink":case "filelinkm":$(c+"_filelink").html($("#global_data").data(e));break;default:d.val($("#global_data").data(e))}};
    107 ga.value.saveLastValue=function(a,c){var b=$(c);switch(b.attr("type")){case "file":break;case "checkbox":case "radio":$("#global_data").data(a+":"+c+":last_value",b.is(":checked"));break;case "div":case "msgs":$("#global_data").data(a+":"+c+":last_value",b.html());break;case "plot2d":break;case "bokeh":break;case "filelink":case "filelinkm":$("#global_data").data(a+":"+c+":last_value",$(c+"_filelink").html());break;case "atomicstructure":b=c.replace(/^#/,"");_jmol_info&&_jmol_info[b]&&_jmol_info[b].length?
    108 $("#global_data").data(a+":"+c+":last_value",_jmol_info[b].script):$("#global_data").data(a+":"+c+":last_value","");break;default:$("#global_data").data(a+":"+c+":last_value",b.val())}};ga.value.saveLastValues=function(a){$("#"+a+" :input").each(function(){ga.value.saveLastValue(a,"#"+$(this).attr("id"))})};
    109 ga.value.resetDefaultValue=function(a,c){var b=$(c);if("SELECT"==b.prop("tagName"))b.val($("#global_data").data(a+":"+c+":default_value"));else switch(b.attr("type")){case "ngl":ga.ngl.clear(a+":"+c+":last_value",c);break;case "file":return;case "checkbox":$("#global_data").removeData(a+":"+c+":repeat:count");case "radio":b.prop("checked",$("#global_data").data(a+":"+c+":default_value"));break;case "div":case "msgs":b.html($("#global_data").data(a+":"+c+":default_value"));break;case "filelink":case "filelinkm":$(c+
    110 "_filelink").html(" ");break;case "plot2d":console.log("ga.value.resetDefaultValue() plot2d, t is "+c);$("#global_data").data(a+":"+c+":last_value",[[]]);ga.value.clear.plot2d(c);b.plot([[]],ga.value.get.plot2d.plot_options(c));$(c+"_showcollapse").length&&($(c+"_div").hide(),$(c+"_savetofile").length&&($(c+"_savetofile").hide(),$(c+"_savetofile_link").hide()),$(c+"_changescalex").length&&($(c+"_changescalex").hide(),$(c+"_changescalex_message").hide()),$(c+"_changescaley").length&&($(c+"_changescaley").hide(),
    111 $(c+"_changescaley_message").hide()),$(c+"_showcollapse").length&&$(c+"_showcollapse").addClass("hidden"));break;case "bokeh":ga.bokeh.reset(a,c.replace(/^#/,""));break;case "plot3d":case "plotly":console.log("reset default value for plot3d: "+c);Plotly.purge(c.replace(/^#/,""));$(c+"_showcollapse").length&&$(c+"_showcollapse").addClass("hidden");break;case "image":b.empty();break;case "video":b.empty();break;case "atomicstructure":c.replace(/^#/,"");$("#global_data").data(a+":"+c+":last_value","");
    112 $(c).empty();break;default:b.val(b.attr("value"))}ga.value.saveLastValue(a,c);$(c+"_msg").empty()};ga.value.resetDefaultValues=function(a,c){var b;if(!/_output$/.test(a))return!1;$("#"+a+" :input").each(function(){ga.value.resetDefaultValue(a,"#"+$(this).attr("id"))});ga.sync.reset(a);for(b in ga.value.extra_resets.data)ga.value.resetDefaultValue(a,"#"+b);c&&(ga.value.resetDefaultValue(a,"#"+a+"_msgs"),b="#"+a+"_textarea",ga.value.resetDefaultValue(a,b),$(b).hide(),$(b+"_label").hide())};
     98ga.value.checkFloatIntOK=function(a,b){var d=$(a);if(isNaN(b[0]))return d.val(d.prop("defaultValue")),!1;"float"==d.data("type")?b[0]<parseFloat(d.attr("min"))?(b.splice(0,b.length),b.push(d.attr("min"))):b[0]>parseFloat(d.attr("max"))?(b.splice(0,b.length),b.push(d.attr("max"))):$(a+"_msg").empty():"integer"==d.data("type")&&(b[0]<parseInt(d.attr("min"))?(b.splice(0,b.length),b.push(d.attr("min"))):b[0]>parseInt(d.attr("max"))?(b.splice(0,b.length),b.push(d.attr("max"))):parseInt(b[0])!=b[0]?(a=
     99b[0],b.splice(0,b.length),b.push(parseInt(parseFloat(a)+.5))):$(a+"_msg").empty());return!0};ga.value.sethiddenfields=function(a,b){var d=[];$.each(a[b],function(e,h){$.each(h,function(g,m){d.push(m)})});d=ga.repeat.map.convert(d);for(a=0;a<d.length;a++)$("#"+d[a]).data("repeater")&&$("#"+d[a]+"-repeater").hide(),$("#"+d[a]+", label[for="+d[a]+"]").hide()};
     100ga.value.showfields=function(a,b,d,e){var h=[];$.each(a[b],function(g,m){console.log(g);g==d[e]&&$.each(m,function(l,f){console.log(f);h.push(f)})});for(a=0;a<h.length;a++)$("#"+h[a]).data("repeater")&&$("#"+h[a]+"-repeater").show(),$("#"+h[a]+", label[for="+h[a]+"]").show()};
     101ga.value.modifyformdata=function(a,b,d,e,h){var g=[],m;console.log(e);$.each(a[b],function(f,p){console.log(f);-1!==jQuery.inArray(f,e)&&$.each(p,function(q,n){g.push(n)})});g=ga.repeat.map.convert(g);for(a=0;a<g.length;a++){if($("#"+g[a]).data("repeater")){var l=ga.repeat.children(b,g[a]);for(m in l)l=g[a]+"-"+m,d.delete(l)}d.delete(g[a])}d.append("currentstage",ga.stages[b][h])};
     102ga.value.processInputfromFiles=function(a,b,d,e){var h=a.trim().split(/[\r\n]+/g),g=[],m=0;d=ga.repeat.map.convert(d);for(var l=0;l<h.length;l++){var f=h[l].trim().split(/\s+/);m+=f.length;g.push(m)}m=[];var p=[],q=[],n=[],x=[],w=[];f=[];var z=0;switch(b){case "whitespace_formulchcompost":a=[];for(l=0;l<h.length;l++)g=h[l].split("#")[0],g=g.replace(/\s{2,}/g," "),g=g.replace(/\t/g," "),g=g.toString().trim().replace(/(\r\n|\n|\r)/g,""),a.push(g);h=parseInt(a[1]);for(l=0;l<a.length;l++)if(2<l&&l<3+
     103h){var u=a[l].trim().split(/\s+/);for(g=0;g<u.length;g++)p.push(u[g])}else m.push(a[l]);f.push(p);for(l=0;l<d.length;l++)switch($("#"+d[l]).attr("type")){case "text":p=new RegExp($("#"+d[l]).attr("pattern"));if(!p.test(m[l])){ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+z+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",buttons:[{id:"ok",label:"OK"}]});return}break;case "number":p=
     104[m[l]];if(ga.value.checkFloatIntOK("#"+d[l],p))m[l]=p[0];else{ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+z+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",buttons:[{id:"ok",label:"OK"}]});return}break;default:ga.msg.box({icon:"warning.png",text:"Selected input type is currently not supported. Contact the developer",buttons:[{id:"ok",label:"OK"}]});return}break;case "whitespace_formulchrg":case "whitespace_formulchcontrast":a=
     105[];for(l=0;l<h.length;l++)g=h[l].split("#")[0],g=g.replace(/\s{2,}/g," "),g=g.replace(/\t/g," "),g=g.toString().trim().replace(/(\r\n|\n|\r)/g,""),a.push(g);h=parseInt(a[1]);var A=parseInt(a[2+h]),B=parseInt(a[5+h+A]),G=parseInt(a[9+h+A+B]);for(l=0;l<a.length;l++)if(1<l&&l<2+h)for(u=a[l].trim().split(/\s+/),g=0;g<u.length;g++)p.push(u[g]);else l>2+h&&l<3+h+A?(u=a[l].trim().split(/\s+/),q.push(u[1]),q.push(u[2]),q.push(u[0]),q.push(u[3])):l>5+h+A&&l<6+h+A+B?(u=a[l].trim().split(/\s+/),n.push(u[1]),
     106n.push(u[2]),n.push(u[0]),n.push(u[3])):l>8+h+A+B&&l<9+h+A+B+G?(u=a[l].trim().split(/\s+/),x.push(u[1]),x.push(u[2]),x.push(u[0]),x.push(u[3])):m.push(a[l]);w.push(p);w.push(q);w.push(n);w.push(x);for(l=g=0;l<d.length;l++)if($("#"+d[l]).length)switch($("#"+d[l]).data("repeater")&&(f.push(w[g]),g++),$("#"+d[l]).attr("type")){case "text":p=new RegExp($("#"+d[l]).attr("pattern"));if(!p.test(m[l])){ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+z+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",
     107buttons:[{id:"ok",label:"OK"}]});return}break;case "number":p=[m[l]];if(ga.value.checkFloatIntOK("#"+d[l],p))m[l]=p[0];else{ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+z+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",buttons:[{id:"ok",label:"OK"}]});return}break;default:ga.msg.box({icon:"warning.png",text:"Selected input type is currently not supported. Contact the developer",buttons:[{id:"ok",
     108label:"OK"}]});return}else g++;break;case "whitespaceseparated":case "whitespaceseparated_reverselogic":m=a.trim().split(/\s+/);if(m.length==d.length)for(l=0;l<m.length;l++){for(w=0;w<g.length;w++)if(l+1<=g[w]){z=w+1;break}switch($("#"+d[l]).attr("type")){case "checkbox":p=/^(0|1|n|y|true|false|t|f|yes|no)$/;if(!p.test(m[l].toLowerCase())){ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Checkbox input value on the line #"+z+" is not valid. Options are: [1 | 0 | yes | no | true | false | t | f | T | F | y | n | Y | N ]. Check your input file",
     109buttons:[{id:"ok",label:"OK"}]});return}break;case "number":p=[m[l]];if(ga.value.checkFloatIntOK("#"+d[l],p))m[l]=p[0];else{ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+z+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",buttons:[{id:"ok",label:"OK"}]});return}break;case "text":p=new RegExp($("#"+d[l]).attr("pattern"));if(!p.test(m[l])){ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Input value on the line #"+
     110z+" is not a valid number. Options are: [Integer | Float point number | Number with exponent]. Check your input file",buttons:[{id:"ok",label:"OK"}]});return}break;default:ga.msg.box({icon:"warning.png",text:"Selected input type is currently not supported. Contact the developer",buttons:[{id:"ok",label:"OK"}]});return}}else{ga.msg.box({icon:"warning.png",text:"Wrong format of the input file! Number of parameters is inconsistent with the model chosen. Check your parameter file",buttons:[{id:"ok",label:"OK"}]});
     111return}break;default:ga.msg.box({icon:"warning.png",text:"Selected file parsing mode is currently not supported. Contact the developer",buttons:[{id:"ok",label:"OK"}]});return}for(l=z=0;l<m.length;l++){switch($("#"+d[l]).attr("type")){case "checkbox":if(0<=b.indexOf("reverselogic"))switch(m[l].toLowerCase()){case "0":case "false":case "f":case "n":case "no":$("#"+d[l]).prop("checked",!0);break;case "1":case "true":case "t":case "yes":case "y":case "r":$("#"+d[l]).prop("checked",!1)}else switch(m[l].toLowerCase()){case "0":case "false":case "f":case "n":case "no":$("#"+
     112d[l]).prop("checked",!1);break;case "1":case "true":case "t":case "yes":case "y":case "r":$("#"+d[l]).prop("checked",!0)}default:$("#"+d[l]).val(m[l]),$("#"+d[l]).prop("defaultValue",m[l])}if($("#"+d[l]).data("repeater")){ga.repeat.change(e,d[l]);children=ga.repeat.children(e,d[l]);p=$("#"+d[l]).val();q=0;for(w=1;w<=p;++w)for(t in n=0,children)if(x=f[z][q],g=d[l]+"-"+t+"-"+(w-1),++n,"whitespace_formulchrg"!=b&&"whitespace_formulchcompost"!=b||1!=n)"whitespace_formulchcompost"==b&&2==n?("r"==x.toLowerCase()&&
     113$("#"+g).prop("checked",!0),"f"==x.toLowerCase()&&$("#"+g).prop("checked",!1)):"whitespace_formulchcompost"==b&&5==n||$("#"+g).val(x),q++;ga.repeat.change(e,d[l]);z++}}};ga.value.input={};ga.value.setInputForRFile=function(a,b,d,e,h){ga.value.input[a]=ga.value.input[a]||{};ga.value.input[a][d]={};ga.value.input[a][d].id=d;ga.value.input[a][d].tag=b;ga.value.input[a][d].mode=e;ga.value.input[a][d].ids=h};ga.value.types={};
     114ga.value.registerid=function(a,b,d,e){ga.value.types[a]=ga.value.types[a]||{};ga.value.types[a][b]={};ga.value.types[a][b].id=b;ga.value.types[a][b].label=d;ga.value.types[a][b].req=e||0};ga.value.setInputfromRFile=function(a,b,d,e){var h=d.split(",");d=$("#_state").data("_logon");$.get("results/users/"+d+"/"+a,function(g){ga.value.processInputfromFiles(g,b,h,e)},"text")};
     115ga.value.setInputfromFile=function(a,b,d,e){$(a).hide();var h=d.split(",");$(a).change(function(g){g=$(a)[0].files[0];var m=new FileReader;m.onload=function(l){ga.value.processInputfromFiles(l.target.result,b,h,e)};m.readAsText(g)})};
     116ga.value.setLastValue=function(a,b,d){var e=a+":"+b+":last_value",h=a+":"+b+":default_value",g=$(b);if(!/_output$/.test(a))return!1;if(void 0==$("#global_data").data(e))switch(g.attr("type")){case "checkbox":case "radio":$("#global_data").data(e,g.is(":checked"));$("#global_data").data(h,g.is(":checked"));break;case "div":case "msgs":$("#global_data").data(e,g.html());$("#global_data").data(h,g.html());break;case "plot3d":case "plotly":b=b.replace(/^#/,"");Plotly.newPlot(b,[],{});Plotly.purge(b);
     117break;case "plot2d":break;case "ngl":ga.ngl.clear(e,b);break;case "bokeh":ga.bokeh.renderdata(a,b.replace(/^#/,""));break;case "filelink":case "filelinkm":$("#global_data").data(e,$(b+"_filelink").html());break;default:d&&g.val(d),$("#global_data").data(e,g.val()),$("#global_data").data(h,g.val())}else switch(g.attr("type")){case "checkbox":case "radio":g.prop("checked",$("#global_data").data(e));break;case "div":case "msgs":g.html($("#global_data").data(e));break;case "atomicstructure":b=b.replace(/^#/,
     118"");$("#global_data").data(e)?(_jmol_info[b].script=$("#global_data").data(e),g.html(Jmol.getAppletHtml("jmolApplet"+b,_jmol_info[b]))):g.empty();break;case "plot2d":a=gd.data(e);a.data?(ga.value.set.plot2d(b,a.options),g.plot(a.data,ga.value.get.plot2d.plot_options(b,a.options))):g.plot(a,ga.value.get.plot2d.plot_options(b));break;case "plot3d":case "plotly":g=gd.data(e);g.data&&Plotly.plot(b.replace(/^#/,""),g.data,g.layout);break;case "bokeh":break;case "ngl":(g=gd.data(e))&&ga.value.nglshow(a,
     119b.replace(/^#/,""),g);break;case "filelink":case "filelinkm":$(b+"_filelink").html($("#global_data").data(e));break;default:g.val($("#global_data").data(e))}};
     120ga.value.saveLastValue=function(a,b){var d=$(b);switch(d.attr("type")){case "file":break;case "checkbox":case "radio":$("#global_data").data(a+":"+b+":last_value",d.is(":checked"));break;case "div":case "msgs":$("#global_data").data(a+":"+b+":last_value",d.html());break;case "plot2d":break;case "bokeh":break;case "filelink":case "filelinkm":$("#global_data").data(a+":"+b+":last_value",$(b+"_filelink").html());break;case "atomicstructure":d=b.replace(/^#/,"");_jmol_info&&_jmol_info[d]&&_jmol_info[d].length?
     121$("#global_data").data(a+":"+b+":last_value",_jmol_info[d].script):$("#global_data").data(a+":"+b+":last_value","");break;default:$("#global_data").data(a+":"+b+":last_value",d.val())}};ga.value.saveLastValues=function(a){$("#"+a+" :input").each(function(){ga.value.saveLastValue(a,"#"+$(this).attr("id"))})};
     122ga.value.resetDefaultValue=function(a,b){var d=$(b);if("SELECT"==d.prop("tagName"))d.val($("#global_data").data(a+":"+b+":default_value"));else switch(d.attr("type")){case "ngl":ga.ngl.clear(a+":"+b+":last_value",b);break;case "file":return;case "checkbox":$("#global_data").removeData(a+":"+b+":repeat:count");case "radio":d.prop("checked",$("#global_data").data(a+":"+b+":default_value"));break;case "div":case "msgs":d.html($("#global_data").data(a+":"+b+":default_value"));break;case "filelink":case "filelinkm":$(b+
     123"_filelink").html(" ");break;case "plot2d":console.log("ga.value.resetDefaultValue() plot2d, t is "+b);$("#global_data").data(a+":"+b+":last_value",[[]]);ga.value.clear.plot2d(b);d.plot([[]],ga.value.get.plot2d.plot_options(b));$(b+"_showcollapse").length&&($(b+"_div").hide(),$(b+"_savetofile").length&&($(b+"_savetofile").hide(),$(b+"_savetofile_link").hide()),$(b+"_changescalex").length&&($(b+"_changescalex").hide(),$(b+"_changescalex_message").hide()),$(b+"_changescaley").length&&($(b+"_changescaley").hide(),
     124$(b+"_changescaley_message").hide()),$(b+"_showcollapse").length&&$(b+"_showcollapse").addClass("hidden"));break;case "bokeh":ga.bokeh.reset(a,b.replace(/^#/,""));break;case "plot3d":case "plotly":console.log("reset default value for plot3d: "+b);Plotly.purge(b.replace(/^#/,""));$(b+"_showcollapse").length&&$(b+"_showcollapse").addClass("hidden");break;case "image":d.empty();break;case "video":d.empty();break;case "atomicstructure":b.replace(/^#/,"");$("#global_data").data(a+":"+b+":last_value","");
     125$(b).empty();break;default:d.val(d.attr("value"))}ga.value.saveLastValue(a,b);$(b+"_msg").empty()};ga.value.resetDefaultValues=function(a,b){var d;if(!/_output$/.test(a))return!1;$("#"+a+" :input").each(function(){ga.value.resetDefaultValue(a,"#"+$(this).attr("id"))});ga.sync.reset(a);for(d in ga.value.extra_resets.data)ga.value.resetDefaultValue(a,"#"+d);b&&(ga.value.resetDefaultValue(a,"#"+a+"_msgs"),b="#"+a+"_textarea",ga.value.resetDefaultValue(a,b),$(b).hide(),$(b+"_label").hide())};
    113126ga.value.extra_resets=function(a){ga.value.extra_resets.data=ga.value.extra_resets.data||{};ga.value.extra_resets.data[a]=1};ga.value.extra_resets.clear=function(){ga.value.extra_resets.data={}};
    114 ga.value.setLastValueOutput=function(a){var c="#"+a,b=c+"_textarea",e=$(b);ga.value.setLastValue(a,c+"_msgs");ga.value.setLastValue(a,b);e.val()?(e.show(),$(b+"_label").show(),e.height(parseFloat(e.prop("scrollHeight"))+parseFloat(e.css("borderTopWidth"))+parseFloat(e.css("borderBottomWidth")))):(e.hide(),$(b+"_label").hide())};ga.value.get={};ga.value.set={};ga.value.clear={};
    115 ga.value.set.plot2d=function(a,c){var b=a+"_xlabel",e=a+"_ylabel";$(a+"_title").html(c.title?c.title:"");$(b).html(c.xlabel?c.xlabel:"");$(e).html(c.ylabel?c.ylabel:"")};ga.value.clear.plot2d=function(a){var c=a+"_xlabel",b=a+"_ylabel";tagxy=a+"_xy";$(a+"_title").empty();$(c).empty();$(b).empty();$(tagxy).empty()};ga.value.set.plot2d.pan=function(a,c){ga.value.settings[a]=ga.value.settings[a]||{};ga.value.settings[a].pan=c?!0:!1};
    116 ga.value.set.plot2d.zoom=function(a,c,b){tagxy=a+"_xy";ga.value.settings[a]=ga.value.settings[a]||{};ga.value.settings[a].zoom=c?!0:!1;c&&(ga.value.settings[a].pkg=b,$(a+"_title,"+a+"_xlabel,"+a+"_ylabel,"+a+"_xy").on("click",ga.value.set.plot2d.zoom.click))};ga.value.set.plot2d.pkg=function(a,c){ga.value.settings[c]=ga.value.settings[c]||{};ga.value.settings[c].pkg=a;$(c+"_title,"+c+"_xlabel,"+c+"_ylabel,"+c+"_xy").on("click",ga.value.set.plot2d.reset)};
    117 ga.value.set.plot2d.reset=function(a){var c="#"+a.target.id.replace(/(_title|_xlabel|_ylabel|_xy)$/,"");a.preventDefault();ga.value.setLastValue(ga.value.settings[c].pkg,c)};ga.value.set.plot2d.hover=function(a,c){ga.value.settings[a]=ga.value.settings[a]||{};ga.value.settings[a].hover=c?!0:!1};ga.value.set.plot2d.selzoom=function(a,c){ga.value.settings[a]=ga.value.settings[a]||{};ga.value.settings[a].selzoom=c?!0:!1};
    118 ga.value.set.plot2d.backgroundcolor=function(a,c){ga.value.settings[a]=ga.value.settings[a]||{};ga.value.settings[a].backgroundcolor=c};ga.value.get.plot2d={};
    119 ga.value.get.plot2d.plot_options=function(a,c){var b=ga.plot_options();ga.value.settings[a].backgroundcolor&&(b.grid={backgroundColor:ga.value.settings[a].backgroundcolor});ga.value.settings[a].selzoom&&(b.selection={mode:"xy"});c&&(c.grid&&(b.grid=$.extend({},b.grid,c.grid)),c.selection&&(b.selection=$.extend({},b.selection,c.selection)));b.pan.interactive=ga.value.settings[a].pan?!0:!1;b.zoom.interactive=ga.value.settings[a].zoom?!0:!1;b.grid.hoverable=ga.value.settings[a].hover?!0:!1;if(c){c.legend&&
    120 (b.legend=c.legend,c.legend.container&&(b.legend.container=$(a+"_legend")));c.xmin&&(b.xaxis.min=c.xmin);c.xmax&&(b.xaxis.max=c.xmax);if(c.xscale)switch(c.xscale){case "log":b.xaxis.transform=function(a){return 0<a?Math.log(a):1E-99};b.xaxis.inverseTransform=function(a){return Math.exp(a)};b.xaxis.tickFormatter=ga.value.plot2d.ticformatter;break;default:console.log("ga.value.get.plot2d.plot_options( "+a+" , options ) has unsupported xscale of "+c.xscale)}c.xtics&&(b.xaxis.ticks=c.xtics);c.ymin&&(b.yaxis.min=
    121 c.ymin);c.ymax&&(b.yaxis.max=c.ymax);if(c.yscale)switch(c.yscale){case "log":b.yaxis.transform=function(a){return 0<a?Math.log(a):1E-99};b.yaxis.inverseTransform=function(a){return Math.exp(a)};b.yaxis.tickFormatter=ga.value.plot2d.ticformatter;break;default:console.log("ga.value.get.plot2d.plot_options( "+a+" , options ) has unsupported yscale of "+c.yscale)}c.ytics&&(b.yaxis.ticks=c.ytics)}return b};ga.value.plot2d={};ga.value.plot2d.zstack={};
     127ga.value.setLastValueOutput=function(a){var b="#"+a,d=b+"_textarea",e=$(d);ga.value.setLastValue(a,b+"_msgs");ga.value.setLastValue(a,d);e.val()?(e.show(),$(d+"_label").show(),e.height(parseFloat(e.prop("scrollHeight"))+parseFloat(e.css("borderTopWidth"))+parseFloat(e.css("borderBottomWidth")))):(e.hide(),$(d+"_label").hide())};ga.value.get={};ga.value.set={};ga.value.clear={};
     128ga.value.set.plot2d=function(a,b){var d=a+"_xlabel",e=a+"_ylabel";$(a+"_title").html(b.title?b.title:"");$(d).html(b.xlabel?b.xlabel:"");$(e).html(b.ylabel?b.ylabel:"")};ga.value.clear.plot2d=function(a){var b=a+"_xlabel",d=a+"_ylabel";tagxy=a+"_xy";$(a+"_title").empty();$(b).empty();$(d).empty();$(tagxy).empty()};ga.value.set.plot2d.pan=function(a,b){ga.value.settings[a]=ga.value.settings[a]||{};ga.value.settings[a].pan=b?!0:!1};
     129ga.value.set.plot2d.zoom=function(a,b,d){tagxy=a+"_xy";ga.value.settings[a]=ga.value.settings[a]||{};ga.value.settings[a].zoom=b?!0:!1;b&&(ga.value.settings[a].pkg=d,$(a+"_title,"+a+"_xlabel,"+a+"_ylabel,"+a+"_xy").on("click",ga.value.set.plot2d.zoom.click))};ga.value.set.plot2d.pkg=function(a,b){ga.value.settings[b]=ga.value.settings[b]||{};ga.value.settings[b].pkg=a;$(b+"_title,"+b+"_xlabel,"+b+"_ylabel,"+b+"_xy").on("click",ga.value.set.plot2d.reset)};
     130ga.value.set.plot2d.reset=function(a){var b="#"+a.target.id.replace(/(_title|_xlabel|_ylabel|_xy)$/,"");a.preventDefault();ga.value.setLastValue(ga.value.settings[b].pkg,b)};ga.value.set.plot2d.hover=function(a,b){ga.value.settings[a]=ga.value.settings[a]||{};ga.value.settings[a].hover=b?!0:!1};ga.value.set.plot2d.selzoom=function(a,b){ga.value.settings[a]=ga.value.settings[a]||{};ga.value.settings[a].selzoom=b?!0:!1};
     131ga.value.set.plot2d.backgroundcolor=function(a,b){ga.value.settings[a]=ga.value.settings[a]||{};ga.value.settings[a].backgroundcolor=b};ga.value.get.plot2d={};
     132ga.value.get.plot2d.plot_options=function(a,b){var d=ga.plot_options();ga.value.settings[a].backgroundcolor&&(d.grid={backgroundColor:ga.value.settings[a].backgroundcolor});ga.value.settings[a].selzoom&&(d.selection={mode:"xy"});b&&(b.grid&&(d.grid=$.extend({},d.grid,b.grid)),b.selection&&(d.selection=$.extend({},d.selection,b.selection)));d.pan.interactive=ga.value.settings[a].pan?!0:!1;d.zoom.interactive=ga.value.settings[a].zoom?!0:!1;d.grid.hoverable=ga.value.settings[a].hover?!0:!1;if(b){b.legend&&
     133(d.legend=b.legend,b.legend.container&&(d.legend.container=$(a+"_legend")));b.xmin&&(d.xaxis.min=b.xmin);b.xmax&&(d.xaxis.max=b.xmax);if(b.xscale)switch(b.xscale){case "log":d.xaxis.transform=function(e){return 0<e?Math.log(e):1E-99};d.xaxis.inverseTransform=function(e){return Math.exp(e)};d.xaxis.tickFormatter=ga.value.plot2d.ticformatter;break;default:console.log("ga.value.get.plot2d.plot_options( "+a+" , options ) has unsupported xscale of "+b.xscale)}b.xtics&&(d.xaxis.ticks=b.xtics);b.ymin&&(d.yaxis.min=
     134b.ymin);b.ymax&&(d.yaxis.max=b.ymax);if(b.yscale)switch(b.yscale){case "log":d.yaxis.transform=function(e){return 0<e?Math.log(e):1E-99};d.yaxis.inverseTransform=function(e){return Math.exp(e)};d.yaxis.tickFormatter=ga.value.plot2d.ticformatter;break;default:console.log("ga.value.get.plot2d.plot_options( "+a+" , options ) has unsupported yscale of "+b.yscale)}b.ytics&&(d.yaxis.ticks=b.ytics)}return d};ga.value.plot2d={};ga.value.plot2d.zstack={};
    122135ga.value.plot2d.zstack.reset=function(a){ga.value.plot2d.stack=ga.value.plot2d.stack||{};ga.value.plot2d.stack[a]=[];ga.value.plot2d.waspush=ga.value.plot2d.waspush||{};ga.value.plot2d.waspush[a]=!1};ga.value.plot2d.zstack.dopop=function(a){ga.value.plot2d.waspush=ga.value.plot2d.waspush||{};return ga.value.plot2d.stack[a]&&ga.value.plot2d.stack[a].length?(ga.value.plot2d.waspush[a]&&ga.value.plot2d.stack[a].pop(),ga.value.plot2d.waspush[a]=!1,ga.value.plot2d.stack[a].pop()):!1};
    123 ga.value.plot2d.zstack.dopush=function(a,c){ga.value.plot2d.stack=ga.value.plot2d.stack||{};ga.value.plot2d.stack[a]=ga.value.plot2d.stack[a]||[];ga.value.plot2d.stack[a].push(c);ga.value.plot2d.waspush=ga.value.plot2d.waspush||{};ga.value.plot2d.waspush[a]=!0};ga.value.plot2d.toFP=function(a,c){return 0<c?a.toFixed(c):6<a.toString().length?a.toExponential(3).replace(/0+e/,"e").replace(/\.e/,"e"):a.toFixed(0)};
    124 ga.value.plot2d.ticformatter=function(a,c){var b;if(!c._ehb||a<=c.min)return c._ehb={},c._ehb.pv=a,c._ehb.min=Math.min(c.min,c.max),c._ehb.max=Math.max(c.min,c.max),c._ehb.tmin=c.options.transform(c._ehb.min),c._ehb.tmax=c.options.transform(c._ehb.max),c._ehb.tmaxr=1/c._ehb.tmax,c._ehb.rnge=c._ehb.max-c._ehb.min,ga.value.plot2d.toFP(a,c.tickDecimals);if(!c._ehb.snd)return c._ehb.snd=!0,c._ehb.sndv=a,c._ehb.ptd=(c.options.transform(a)-c._ehb.tmin)*c._ehb.tmaxr,ga.value.plot2d.toFP(a,c.tickDecimals);
    125 if(!c._ehb.tr)return c._ehb.tr=2*Math.abs(a-c._ehb.sndv)/c._ehb.rnge,c._ehb.ptd=Math.abs(c.options.transform(a)-c._ehb.tmin)*c._ehb.tmaxr,ga.value.plot2d.toFP(a,c.tickDecimals);b=(c.options.transform(a)-c._ehb.tmin)*c._ehb.tmaxr;return Math.min(Math.abs(b-c._ehb.ptd),1-b)>=c._ehb.tr?(c._ehb.ptd=b,ga.value.plot2d.toFP(a,c.tickDecimals)):""};ga.ngl={};ga.ngl.types="backbone ball+stick cartoon contact helixorient hyperball label licorice line point ribbon rocket rope spacefill surface trace tube".split(" ");
    126 ga.ngl.clear=function(a,c){ga.ngl[a]&&(ga.ngl[a].stage&&ga.ngl[a].stage.dispose(),delete ga.ngl[a]);$(c+"_plot").empty();$(c+"_buttons").empty();$("#global_data").removeData(a)};
    127 ga.value.nglshow=function(a,c,b){var e="#"+c;ga.ngl=ga.ngl||{};var f=a+":"+e+":last_value";ga.ngl.clear(f,e);b.loadname&&(b.loadparams||(b.loadparams={}),b.representation||(b.representation="cartoon"),ga.ngl[f]={},ga.ngl[f].stage=new NGL.Stage(c+"_plot"),ga.ngl[f].stage.loadFile(b.loadname,b.loadparams).then(function(a){ga.ngl[f].component=a;ga.ngl[f].reps={};ga.ngl[f].reps[b.representation]=a.addRepresentation(b.representation);a.autoView();a=ga.ngl.types.length;for(var c="",h="",m=0;m<a;++m)c+=
    128 '<button id="'+ga.ngl.types[m].replace("+","")+'">'+ga.ngl.types[m]+"</button>",h+='$("#'+ga.ngl.types[m].replace("+","")+'").on("click", function() { var sk = ga.ngl["'+f+'"]; var comp = sk.component; var crep = sk.reps["'+ga.ngl.types[m]+'"]; if ( comp && crep ) { comp.removeRepresentation( crep ); delete sk.reps["'+ga.ngl.types[m]+'"]; } else { sk.reps["'+ga.ngl.types[m]+'"] = comp.addRepresentation("'+ga.ngl.types[m]+'");} return false; });';$(e+"_buttons").html(c);eval(h)}),$("#global_data").data(f,
    129 b));ga.value.extra_resets(c)};ga.pull={};ga.pull.clearPull=function(a){a&&"string"==typeof a&&0!=a.length&&"#__fields:repeat__"!=a||(a="");$("#global_data").data("_pull_json"+a,{});$("#global_data").data("_pull_update"+a,{});$("#global_data").data("_pull_type"+a,{})};
    130 ga.pull.toPull=function(a,c,b,e,f){f&&"string"==typeof f&&0!=f.length&&"#__fields:repeat__"!=f||(f="");a=$("#global_data");var d=a.data("_pull_json"+f)||{},g=a.data("_pull_update"+f)||{};d[e]=0;"object"!=typeof g[e]&&(g[e]={});g[e][c]=b;a.data("_pull_json"+f,d);a.data("_pull_update"+f,g)};
    131 ga.pull.doPull=function(a){a&&"string"==typeof a&&0!=a.length&&"#__fields:repeat__"!=a||(a="");var c=$("#global_data"),b=$("#_state").data("_logon");if(b&&b.length){var e=c.data("_pull_json"+a);e._window=window.name;e._logon=b;2<Object.size(e)&&$.getJSON("ajax/sys_config/sys_pull.php",e).done(function(b,d,e){var h=c.data("_pull_update"+a);$.each(b,function(a,b){"object"==typeof h[a]&&$.each(h[a],function(a,c){var d=$(a);switch(c){case "checkbox":d.prop("checked","on"==b);break;case "text":"color"==
    132 d.attr("data-type")&&ga.color.spectrum.val(a,b);case "email":case "text":case "integer":case "float":d.val(b);break;case "listbox":d.empty();$.each(b,function(a,b){d.append($("<option></option>").attr("value",b).text(b))});break;case "label":d.html(b);break;default:console.log("ga.pull.doPull(): not yet")}})})}).fail(function(a,b,c){})}};ga.repeats={};ga.repeats.cache={};ga.repeats.cache._jmol_info={};ga.repeats.cache.specproj=[];
     136ga.value.plot2d.zstack.dopush=function(a,b){ga.value.plot2d.stack=ga.value.plot2d.stack||{};ga.value.plot2d.stack[a]=ga.value.plot2d.stack[a]||[];ga.value.plot2d.stack[a].push(b);ga.value.plot2d.waspush=ga.value.plot2d.waspush||{};ga.value.plot2d.waspush[a]=!0};ga.value.plot2d.toFP=function(a,b){return 0<b?a.toFixed(b):6<a.toString().length?a.toExponential(3).replace(/0+e/,"e").replace(/\.e/,"e"):a.toFixed(0)};
     137ga.value.plot2d.ticformatter=function(a,b){if(!b._ehb||a<=b.min)return b._ehb={},b._ehb.pv=a,b._ehb.min=Math.min(b.min,b.max),b._ehb.max=Math.max(b.min,b.max),b._ehb.tmin=b.options.transform(b._ehb.min),b._ehb.tmax=b.options.transform(b._ehb.max),b._ehb.tmaxr=1/b._ehb.tmax,b._ehb.rnge=b._ehb.max-b._ehb.min,ga.value.plot2d.toFP(a,b.tickDecimals);if(!b._ehb.snd)return b._ehb.snd=!0,b._ehb.sndv=a,b._ehb.ptd=(b.options.transform(a)-b._ehb.tmin)*b._ehb.tmaxr,ga.value.plot2d.toFP(a,b.tickDecimals);if(!b._ehb.tr)return b._ehb.tr=
     1382*Math.abs(a-b._ehb.sndv)/b._ehb.rnge,b._ehb.ptd=Math.abs(b.options.transform(a)-b._ehb.tmin)*b._ehb.tmaxr,ga.value.plot2d.toFP(a,b.tickDecimals);var d=(b.options.transform(a)-b._ehb.tmin)*b._ehb.tmaxr;return Math.min(Math.abs(d-b._ehb.ptd),1-d)>=b._ehb.tr?(b._ehb.ptd=d,ga.value.plot2d.toFP(a,b.tickDecimals)):""};ga.ngl={};ga.ngl.types="backbone ball+stick cartoon contact helixorient hyperball label licorice line point ribbon rocket rope spacefill surface trace tube".split(" ");
     139ga.ngl.clear=function(a,b){ga.ngl[a]&&(ga.ngl[a].stage&&ga.ngl[a].stage.dispose(),delete ga.ngl[a]);$(b+"_plot").empty();$(b+"_buttons").empty();$("#global_data").removeData(a)};
     140ga.value.nglshow=function(a,b,d){var e="#"+b;ga.ngl=ga.ngl||{};var h=a+":"+e+":last_value";ga.ngl.clear(h,e);d.loadname&&(d.loadparams||(d.loadparams={}),d.representation||(d.representation="cartoon"),ga.ngl[h]={},ga.ngl[h].stage=new NGL.Stage(b+"_plot"),ga.ngl[h].stage.loadFile(d.loadname,d.loadparams).then(function(g){ga.ngl[h].component=g;ga.ngl[h].reps={};ga.ngl[h].reps[d.representation]=g.addRepresentation(d.representation);g.autoView();g=ga.ngl.types.length;for(var m="",l="",f=0;f<g;++f)m+=
     141'<button id="'+ga.ngl.types[f].replace("+","")+'">'+ga.ngl.types[f]+"</button>",l+='$("#'+ga.ngl.types[f].replace("+","")+'").on("click", function() { var sk = ga.ngl["'+h+'"]; var comp = sk.component; var crep = sk.reps["'+ga.ngl.types[f]+'"]; if ( comp && crep ) { comp.removeRepresentation( crep ); delete sk.reps["'+ga.ngl.types[f]+'"]; } else { sk.reps["'+ga.ngl.types[f]+'"] = comp.addRepresentation("'+ga.ngl.types[f]+'");} return false; });';$(e+"_buttons").html(m);eval(l)}),$("#global_data").data(h,
     142d));ga.value.extra_resets(b)};ga.pull={};ga.pull.clearPull=function(a){a&&"string"==typeof a&&0!=a.length&&"#__fields:repeat__"!=a||(a="");$("#global_data").data("_pull_json"+a,{});$("#global_data").data("_pull_update"+a,{});$("#global_data").data("_pull_type"+a,{})};
     143ga.pull.toPull=function(a,b,d,e,h){h&&"string"==typeof h&&0!=h.length&&"#__fields:repeat__"!=h||(h="");a=$("#global_data");var g=a.data("_pull_json"+h)||{},m=a.data("_pull_update"+h)||{};g[e]=0;"object"!=typeof m[e]&&(m[e]={});m[e][b]=d;a.data("_pull_json"+h,g);a.data("_pull_update"+h,m)};
     144ga.pull.doPull=function(a){a&&"string"==typeof a&&0!=a.length&&"#__fields:repeat__"!=a||(a="");var b=$("#global_data"),d=$("#_state").data("_logon");if(d&&d.length){var e=b.data("_pull_json"+a);e._window=window.name;e._logon=d;2<Object.size(e)&&$.getJSON("ajax/sys_config/sys_pull.php",e).done(function(h,g,m){var l=b.data("_pull_update"+a);$.each(h,function(f,p){"object"==typeof l[f]&&$.each(l[f],function(q,n){var x=$(q);switch(n){case "checkbox":x.prop("checked","on"==p);break;case "text":"color"==
     145x.attr("data-type")&&ga.color.spectrum.val(q,p);case "email":case "integer":case "float":x.val(p);break;case "listbox":x.empty();$.each(p,function(w,z){x.append($("<option></option>").attr("value",z).text(z))});break;case "label":x.html(p);break;default:console.log("ga.pull.doPull(): not yet")}})})}).fail(function(h,g,m){})}};ga.repeats={};ga.repeats.cache={};ga.repeats.cache._jmol_info={};ga.repeats.cache.specproj=[];
    133146ga.repeats.save=function(){ga.repeats.cache._jmol_info=_jmol_info||{};ga.repeats.cache.specproj=ga.specproj.data||[]};ga.repeats.restore=function(){_jmol_info=ga.repeats.cache._jmol_info;ga.specproj.data=ga.repeats.cache.specproj};ga.repeat={};ga.repeat.data={};ga.repeat.map={};
    134 ga.repeat.repeat=function(a,c,b,e){ga.repeat.data[a]=ga.repeat.data[a]||{};ga.repeat.data[a].repeat=ga.repeat.data[a].repeat||{};ga.repeat.data[a].repeat[c]={};ga.repeat.data[a].repeat[c].html=b;ga.repeat.data[a].repeat[c].eval=e;ga.repeat.map[c]=c;ga.repeat.data[a].repeat[c].htmlr=b.replace(/<\/label>/,"%%label%%</label>").replace(RegExp('id="'+c+'"'),'id="%%id%%"').replace(RegExp('name="'+c),'name="%%id%%').replace(RegExp('for="'+c+'"'),'for="%%id%%"').replace(RegExp('id="'+c+'_msg"'),'id="%%id%%_msg"').replace(RegExp('id="'+
    135 c+'_tr"'),'id="%%id%%_tr"').replace(RegExp('id="'+c+'_button"'),'id="%%id%%_button"').replace(RegExp('="'+c+'_altval"',"g"),'="%%id%%_altval"').replace(RegExp('name="_selaltval_'+c+'"'),'name="_selaltval_%%id%%"').replace(RegExp('id="'+c+'-repeater"'),'id="%%id%%-repeater"');ga.repeat.data[a].repeat[c].htmls=b.replace(/<td><label.*?>(.*?)<\/label>\s*<\/td>/,"%%td%%$1%%etd%%").replace(/(<td[^>]*>).*?<\/td>/g,"$1</td>").replace(/<input[^>]*>/g,"").replace(/<span[^>]*>.*?<\/span>/g,"").replace(/\s*id=".*?"\s*/g,
    136 "").replace("%%td%%","<td>").replace("%%etd%%","</td>").replace("<td></td>","");ga.repeat.data[a].repeat[c].evalr=e.replace(RegExp('"#'+c+'"',"g"),'"#%%id%%"').replace(RegExp('"#'+c+" option","g"),'"#%%id%% option').replace(RegExp(":"+c+":","g"),":%%id%%:").replace(RegExp('"#'+c+'_msg"',"g"),'"#%%id%%_msg"').replace(RegExp('"'+c+'"',"g"),'"%%id%%"').replace(RegExp('"#'+c+'_button"',"g"),'"#%%id%%_button"').replace(RegExp('"'+c+'_altval"',"g"),'"%%id%%_altval"').replace(RegExp('"#'+c+'_altval"',"g"),
    137 '"#%%id%%_altval"');return'<tr><td></td><td><span id="'+c+'-span"></span></td></tr>'};
    138 ga.repeat.repeatOn=function(a,c,b){var e=/^(.*):(.*)$/.exec(b);b=b.replace(":","-");ga.repeat.data[a].repeater=ga.repeat.data[a].repeater||{};ga.repeat.data[a].repeater[b]=ga.repeat.data[a].repeater[b]||{};ga.repeat.data[a].repeater[b].child=ga.repeat.data[a].repeater[b].child||[];ga.repeat.data[a].repeater[b].child.push(c);ga.repeat.data[a].repeat[c].refid=b;e&&(b=e[1],e=e[2],ga.repeat.data[a].repeater[b]=ga.repeat.data[a].repeater[b]||{},ga.repeat.data[a].repeater[b].child=ga.repeat.data[a].repeater[b].child||
    139 [],ga.repeat.data[a].repeater[b].choice=ga.repeat.data[a].repeater[b].choice||[],ga.repeat.data[a].repeater[b].child.push(c),ga.repeat.data[a].repeater[b].choice.push(e))};
    140 ga.repeat.repeater=function(a,c,b,e){ga.repeat.data[a]=ga.repeat.data[a]||{};ga.repeat.data[a].repeater=ga.repeat.data[a].repeater||{};ga.repeat.data[a].repeater[c]=ga.repeat.data[a].repeater[c]||{};ga.repeat.data[a].repeater[c].type=b;e&&"__fields:tableize__"!=e&&!/^(off|false)$/i.test(e)&&(ga.repeat.data[a].repeater[c].tableize=1)};
    141 ga.repeat.children=function(a,c,b){var e;b=b||{};if(!(ga.repeat.data[a]&&ga.repeat.data[a].repeater&&ga.repeat.data[a].repeater[c]&&ga.repeat.data[a].repeater[c].child))return b;for(e=0;e<ga.repeat.data[a].repeater[c].child.length;++e)b[ga.repeat.data[a].repeater[c].child[e]]=!0,ga.repeat.data[a].repeater[e]&&(b=ga.repeat.children(a,e,b));return b};
    142 ga.repeat.change=function(a,c,b){var e,f=[],d="#"+c;e=$(d);var g,h="",m="",k,r,l;if(!(ga.repeat.data[a]&&ga.repeat.data[a].repeater&&ga.repeat.data[a].repeater[c]&&e.length))return!1;switch(ga.repeat.data[a].repeater[c].type){case "checkbox":e=e.prop("checked")?1:0;break;case "integer":case "listbox":e=e.val();break;default:return console.warn("ga.repeat.change( "+a+" , "+c+" ) type "+ga.repeat.data[a].repeater[c].type+" not supported"),!1}if(!b&&ga.repeat.data[a].repeater[c].value===e)return!1;g=
    143 ga.repeat.children(a,c);switch(ga.repeat.data[a].repeater[c].type){case "checkbox":if(e)for(k in g)l=c+"-"+k,ga.repeat.map[k]=l,h+=ga.repeat.data[a].repeat[k].htmlr.replace(/%%id%%/g,l).replace("%%label%%",""),m+=ga.repeat.data[a].repeat[k].evalr.replace(/%%id%%/g,l),ga.repeat.data[a].repeater[k]&&(ga.repeat.data[a].repeater[l]||(ga.repeat.data[a].repeater[l]=jQuery.extend({},ga.repeat.data[a].repeater[k])),f.push(l),ga.repeat.data[a].repeater[l].value&&delete ga.repeat.data[a].repeater[l].value);
    144 break;case "integer":if(ga.repeat.data[a].repeater[c].tableize&&0<e)for(k in g)h+=ga.repeat.data[a].repeat[k].htmls;for(r=1;r<=e;++r)for(k in g)l=c+"-"+k+"-"+(r-1),ga.repeat.map[k]=l,h+=ga.repeat.data[a].repeat[k].htmlr.replace(/%%id%%/g,l).replace("%%label%%","["+r+"]").replace(ga.repeat.data[a].repeater[c].tableize?/<td.*?><label.*?>.*?<\/label><\/td>/:"",""),m+=ga.repeat.data[a].repeat[k].evalr.replace(/%%id%%/g,l),ga.repeat.data[a].repeater[k]&&(ga.repeat.data[a].repeater[l]||(ga.repeat.data[a].repeater[l]=
    145 jQuery.extend({},ga.repeat.data[a].repeater[k])),f.push(l),ga.repeat.data[a].repeater[l].value&&delete ga.repeat.data[a].repeater[l].value);break;case "listbox":g=c.replace(/-[0-9]+$/,"").replace(/^(.*)-([A-ZA-z0-9_]*)$/,"$2")+"-"+e;r=c+"-"+e;g=ga.repeat.children(a,g);for(k in g)l=r+"-"+k,ga.repeat.map[k]=l,h+=ga.repeat.data[a].repeat[k].htmlr.replace(/%%id%%/g,l).replace("%%label%%",""),m+=ga.repeat.data[a].repeat[k].evalr.replace(/%%id%%/g,l),ga.repeat.data[a].repeater[k]&&(ga.repeat.data[a].repeater[l]||
    146 (ga.repeat.data[a].repeater[l]=jQuery.extend({},ga.repeat.data[a].repeater[k])),f.push(l),ga.repeat.data[a].repeater[l].value&&delete ga.repeat.data[a].repeater[l].value);break;default:return console.warn("ga.repeat.change( "+a+" , "+c+" ) type "+ga.repeat.data[a].repeater[c].type+" not supported"),!1}!/^<tr>/.test(h)&&/<\/tr>$/.test(h)&&(h="<tr>"+h);$(d+"-repeater").html(h);eval(m);ga.repeat.data[a].repeater[c].value=e;for(k=0;k<f.length;++k)ga.repeat.change(a,f[k],b);$("#global_data").data("_pull_json#"+
    147 c)&&ga.pull.doPull("#"+c);ga.hhelp.reset()};ga.repeat.map.convert=function(a){var c,b=[];for(c=0;c<a.length;++c)b[c]=ga.repeat.map[a[c]]||a[c];return b};ga.hide=function(a,c){ga.hide.data=ga.hide.data||{};ga.hide.data[a]=ga.hide.data[a]||{};ga.hide.data[a][c]=ga.hide.data[a][c]||{};ga.hide.data[a][c].active=1};ga.hide.data={};
    148 ga.hide.update=function(a,c){var b;if(ga.hide.data[a]&&ga.hide.data[a][c])if(ga.hide.data[a][c].hides){if($(c).prop("checked"))for(b in ga.hide.data[a][c].hides)$(b+"-itd").html(" "),$(b).hide();else for(b in ga.hide.data[a][c].hides)$(b+"-itd").html(ga.hide.data[a][c].hides[b]),$(b).show();ga.hhelp.set()}else console.log("ga.hide.update( "+a+" , "+c+" ) error, no hides attached to this hider");else console.log("ga.hide.update( "+a+" , "+c+" ) error, hider has not been defined")};
    149 ga.hide.add=function(a,c,b){ga.hide.data=ga.hide.data||{};ga.hide.data[a]=ga.hide.data[a]||{};ga.hide.data[a][b]=ga.hide.data[a][b]||{};ga.hide.data[a][b].hides=ga.hide.data[a][b].hides||{};ga.hide.data[a][b].hides[c]=$(c+"-itd").html()};ga.directives=function(a,c){ga.directives.data=ga.directives.data||{};ga.directives.data[a]=c};ga.hideifnot=function(a,c){ga.directives.data&&ga.directives.data[c]&&!/^(off|false|0$)/.test(ga.directives.data[c].toLowerCase())||$(a).hide()};ga.data={};
    150 ga.data.nofcrefresh={};function showTooltip(a,c,b,e){$('<div id="rtooltip">'+b+"</div>").css({position:"absolute",top:c+5,left:a+5,border:"1px solid #181616",padding:"2px","background-color":e,color:"white"}).appendTo("body")}ga.data.dataURLtoFile=function(a,c){for(var b=a.split(","),e=b[0].match(/:(.*?);/)[1],b=atob(b[1]),f=b.length,d=new Uint8Array(f);f--;)d[f]=b.charCodeAt(f);return new File([d],c,{type:e})};
    151 ga.data.create_image_htmltocanvas=function(a){if($("#"+a+"_savetofile").length){var c=$("#"+a+"_div");html2canvas(c.get(0),{background:"#ffffff",onrendered:function(b){b='<a href="'+b.toDataURL("image/png").replace("image/png","image/octet-stream")+'" target="_blank" download="plot.png">plot.png</a>';$("#"+a+"_savetofile_link").html(b)}})}};
    152 ga.data.create_image=function(a,c){if($("#"+a+"_savetofile").length){var b=document.getElementById(a+"_savetofile"),e=c.getCanvas().toDataURL("image/png").replace("image/png","image/octet-stream"),e=ga.data.dataURLtoFile(e,"plot.png");b.href=URL.createObjectURL(e);$("#"+a+"_savetofile").removeClass("hidden")}};
    153 ga.data.update=function(a,c,b,e){var f=0,d=0,g=0,h=0,m=0,k=a+"_output",r="#"+k,l=$(r),u={},v=r+"_msgs",y=$(v),p,w,z,B,x,C,A;b&&($("#"+a+"_progress").empty(),y.text(""));$.each(c,function(q,n){A=l.find("#"+q);if(A.length)switch(f||(y.text(""),f=1),A.attr("type")){case "plot3d":case "plotly":p="#"+q;ga.plot3dglobal=n.layout;ga.dataplot3dglobal=n.data;ga.plotted3d[a]=0;$(p+"_showcollapse").length&&$(p+"_showcollapse").removeClass("hidden");Plotly.plot(q,n.data,n.layout);ga.showcollapse3d[a]&&(ga.plotted3d[a]=
    154 1,$(p+"_showcollapse").trigger("click"));z=k+":#"+q+":last_value";$("#global_data").data(z,n);break;case "plot2d":p="#"+q;ga.value.plot2d.zstack.reset(p);if(n.data){if(ga.value.set.plot2d(p,n.options),ga.plotglobal=n.options,ga.dataplotglobal=n.data,$.plot(p,n.data,ga.value.get.plot2d.plot_options(p,n.options)),ga.customtooltips[a]){var v=null;$(p).bind("plothover",function(a,b,c){c?v!=c.dataIndex&&(v=c.dataIndex,$("#rtooltip").remove(),c.datapoint[0].toFixed(2),c.datapoint[1].toFixed(2),c.series.tooltips.length&&
    155 showTooltip(c.pageX,c.pageY,c.series.tooltips[c.dataIndex],c.series.color)):($("#rtooltip").remove(),v=null)})}}else $.plot(p,n,ga.value.get.plot2d.plot_options(p));$(p+"_savetofile").length&&$(p+"_savetofile").removeClass("hidden");$(p+"_changescalex").length&&($(p+"_changescalex").removeClass("hidden"),"log"==n.options.xscale?$(p+"_changescalex_message").html("X-log"):$(p+"_changescalex_message").html("X-lin"));$(p+"_changescaley").length&&($(p+"_changescaley").removeClass("hidden"),"log"==n.options.yscale?
    156 $(p+"_changescaley_message").html("Y-log"):$(p+"_changescaley_message").html("Y-lin"));$(p+"_showcollapse").length&&($(p+"_showcollapse").removeClass("hidden"),$(p).show(),ga.plotted2d[a]=1,$(p+"_showcollapse").trigger("click"));if(ga.value.settings[p].selzoom||n.options&&n.options.selection&&n.options.selection.mode&&"xy"==n.options.selection.mode)$(p).on("plotselected",{htag:p,data:n.data?n.data:n,options:n.data?ga.value.get.plot2d.plot_options(p,n.options):ga.value.get.plot2d.plot_options(p)},
    157 function(a,b){1E-5>b.xaxis.to-b.xaxis.from&&(b.xaxis.to=b.xaxis.from+1E-5);1E-5>b.yaxis.to-b.yaxis.from&&(b.yaxis.to=b.yaxis.from+1E-5);ga.value.plot2d.zstack.dopush(a.data.htag,b);$.plot(a.data.htag,a.data.data,$.extend(!0,{},a.data.options,{xaxis:{min:b.xaxis.from,max:b.xaxis.to},yaxis:{min:b.yaxis.from,max:b.yaxis.to}}))}).on("contextmenu",{htag:p,data:n.data?n.data:n,options:n.data?ga.value.get.plot2d.plot_options(p,n.options):ga.value.get.plot2d.plot_options(p)},function(a){a.preventDefault();
    158 var b=ga.value.plot2d.zstack.dopop(a.data.htag);b?$.plot(a.data.htag,a.data.data,$.extend(!0,{},a.data.options,{xaxis:{min:b.xaxis.from,max:b.xaxis.to},yaxis:{min:b.yaxis.from,max:b.yaxis.to}})):$.plot(a.data.htag,a.data.data,a.data.options)});z=k+":#"+q+":last_value";$("#global_data").data(z,n);break;case "bokeh":ga.bokeh.render(a,q,n);break;case "ngl":ga.value.nglshow(k,q,n);break;case "atomicstructure":z=k+":#"+q+":last_value";C=n.file?n.file:n;_jmol_info[q].script="set background ["+ga.colors.background+
    159 "]; set zoomlarge false;set echo top center;echo loading "+C.split("/").pop()+';refresh;load "'+C+'";';ga.set(a+":jsmoladd")&&(_jmol_info[q].script+=ga.set(a+":jsmoladd"));n.script&&(_jmol_info[q].script+=";"+n.script);$("#global_data").data(z,_jmol_info[q].script);$("#"+q).html(Jmol.getAppletHtml("jmolApplet"+q,_jmol_info[q]));break;case "checkbox":case "radio":A.prop("checked",!0);break;case "div":A.html(n);break;case "video":w=$("#"+q);x="<video ";w.attr("data-width")&&(x+=' width="'+w.attr("data-width")+
    160 '"');w.attr("data-height")&&(x+=' height="'+w.attr("data-height")+'"');x+=" controls>";x+='<source src="'+n+'.mp4" type="video/mp4" /><source src="'+n+'.webm" type="video/webm" />';x+="</video>";w.html(x);break;case "image":w=$("#"+q);x="<img ";w.attr("data-width")&&(x+=' width="'+w.attr("data-width")+'"');w.attr("data-height")&&(x+=' height="'+w.attr("data-height")+'"');x+=' src="'+n+'">';w.html(x);break;case "filelink":B='<a href="'+n+'" target="_blank">'+n.split("/").pop()+"</a>";z=k+":#"+q+":last_value";
    161 $("#global_data").data(z,B);$("#"+q+"_filelink").html(B);break;case "filelinkm":z=k+":#"+q+":last_value";B="";$.each(n,function(a,b){B+='<a href="'+b+'" target="_blank">'+b.split("/").pop()+"</a> "});$("#global_data").data(z,B);$("#"+q+"_filelink").html(B);break;default:$("#global_data").data("_append:"+k+"_"+q)?(A.val(A.val()+"\n"+n),A.height(parseFloat(A.prop("scrollHeight")+parseFloat(A.css("borderTopWidth"))+parseFloat(A.css("borderBottomWidth"))))):A.val(n)}else b?"_"==q.charAt(0)?/^_fs_/.test(q)&&
    162 ga.data.nofcrefresh[a]||("_message"==q&&ga.msg.box(n),"_question"==q&&ga.qr.question(a,c),"_question_answered"==q&&ga.qr.answered(a,c),"_question_timeout"==q&&ga.qr.timeout(a,c),/^_getinput/.test(q)&&"_getinput"==q&&ga.valuen.input(a,n),"_textarea"==q&&ga.data.textarea(r,n),"_airavata"==q&&ga.data.airavata(r,n),"_status"==q&&"complete"==n&&b(e,0,0)):(d||(y.append("<p>Unexpected results:</p>"),d=1),y.append("<p>"+q+" => "+n+"</p>")):"_"==q.charAt(0)?/^_fs_/.test(q)&&ga.data.nofcrefresh[a]||($("#_state").data(q,
    163 n),g=1,"_status"==q&&(u.job_status=n),/^_getinput/.test(q)&&"_getinput"==q&&ga.valuen.input(a,n),"_textarea"==q&&ga.data.textarea(r,n),"_airavata"==q&&ga.data.airavata(r,n),"_loginverify"==q&&ga.login.verify(n),"_loginapprove"==q&&ga.login.approve(n)):"-close"==q?h=1:"-close2"==q?m=1:(d||(y.text(""),y.append("<p>Unexpected results:</p>"),f=d=1),y.append("<p>"+q+" => "+n+"</p>"))});ga.value.saveLastValues(k);ga.value.saveLastValue(k,v);$(r+"_progress").empty();g&&syncState();h&&ga.msg.close(1);m&&
    164 ga.msg.close(2);return u};
    165 ga.data.textarea=function(a,c){var b=a+"_textarea",e=$(b);isatend=e[0].scrollHeight-e[0].scrollTop===e[0].clientHeight;c||(c="");e.is(":hidden")&&(e.show(),$(b+"_label").show());"__reset__\n"==c.substr(0,10)?e.val(c.substr(10)):e.val(e.val()+c);ga.set("textarea:rows")?ga.data.textarea.h[a]?e.height(ga.data.textarea.h[a]):ga.data.textarea.h[a]=parseFloat(e.prop("clientHeight"))+parseFloat(e.css("borderTopWidth"))+parseFloat(e.css("borderBottomWidth")):e.height(parseFloat(e.prop("scrollHeight"))+parseFloat(e.css("borderTopWidth"))+
    166 parseFloat(e.css("borderBottomWidth")));isatend&&e.scrollTop(e[0].scrollHeight)};ga.data.textarea.h={};ga.data.airavata=function(a,c){var b=$(a+"_airavata");b.is(":hidden")&&b.show();b.html(c)};
    167 ga.sync=function(a,c,b){var e,f=$("#"+c),d;if(f&&ga.sync.data&&ga.sync.data[a]&&ga.sync.data[a][b]){ga.sync.data[a][b][c]=!0;for(e in ga.sync.data[a][b])if(e!=c&&(d=$("#"+e))&&$.isNumeric(d.val())){f.val(d.val());f.change();return}ga.sync.data[a][b]._lastval&&$.isNumeric(ga.sync.data[a][b]._lastval)&&(f.val(ga.sync.data[a][b]._lastval),f.change())}else ga.sync.data=ga.sync.data||{},ga.sync.data[a]=ga.sync.data[a]||{},ga.sync.data[a][b]=ga.sync.data[a][b]||{},ga.sync.data[a][b][c]=!0};
    168 ga.sync.change=function(a,c,b){var e,f=$("#"+c);if(f&&$.isNumeric(f.val())&&ga.sync.data&&ga.sync.data[a]&&ga.sync.data[a][b])for(e in ga.sync.data[a][b]._lastval=f.val(),ga.sync.data[a][b])e!=c&&(a=$("#"+e))&&a.val()!=f.val()&&(a.val(f.val()),a.change())};ga.sync.reset=function(a){var c;if(ga.sync.data&&ga.sync.data[a])for(c in ga.sync.data[a])ga.sync.data[a][c]._lastval&&delete ga.sync.data[a][c]._lastval};ga.valuen={};ga.valuen.data={};ga.valuen.html={};ga.valuen.dflt={};ga.valuen.dflt.data={};
     147ga.repeat.repeat=function(a,b,d,e){ga.repeat.data[a]=ga.repeat.data[a]||{};ga.repeat.data[a].repeat=ga.repeat.data[a].repeat||{};ga.repeat.data[a].repeat[b]={};ga.repeat.data[a].repeat[b].html=d;ga.repeat.data[a].repeat[b].eval=e;ga.repeat.map[b]=b;ga.repeat.data[a].repeat[b].htmlr=d.replace(/<\/label>/,"%%label%%</label>").replace(RegExp('id="'+b+'"'),'id="%%id%%"').replace(RegExp('name="'+b),'name="%%id%%').replace(RegExp('for="'+b+'"'),'for="%%id%%"').replace(RegExp('id="'+b+'_msg"'),'id="%%id%%_msg"').replace(RegExp('id="'+
     148b+'_tr"'),'id="%%id%%_tr"').replace(RegExp('id="'+b+'_button"'),'id="%%id%%_button"').replace(RegExp('="'+b+'_altval"',"g"),'="%%id%%_altval"').replace(RegExp('name="_selaltval_'+b+'"'),'name="_selaltval_%%id%%"').replace(RegExp('id="'+b+'-repeater"'),'id="%%id%%-repeater"');ga.repeat.data[a].repeat[b].htmls=d.replace(/<td><label.*?>(.*?)<\/label>\s*<\/td>/,"%%td%%$1%%etd%%").replace(/(<td[^>]*>).*?<\/td>/g,"$1</td>").replace(/<input[^>]*>/g,"").replace(/<span[^>]*>.*?<\/span>/g,"").replace(/\s*id=".*?"\s*/g,
     149"").replace("%%td%%","<td>").replace("%%etd%%","</td>").replace("<td></td>","");ga.repeat.data[a].repeat[b].evalr=e.replace(RegExp('"#'+b+'"',"g"),'"#%%id%%"').replace(RegExp('"#'+b+" option","g"),'"#%%id%% option').replace(RegExp(":"+b+":","g"),":%%id%%:").replace(RegExp('"#'+b+'_msg"',"g"),'"#%%id%%_msg"').replace(RegExp('"'+b+'"',"g"),'"%%id%%"').replace(RegExp('"#'+b+'_button"',"g"),'"#%%id%%_button"').replace(RegExp('"'+b+'_altval"',"g"),'"%%id%%_altval"').replace(RegExp('"#'+b+'_altval"',"g"),
     150'"#%%id%%_altval"');return'<tr><td></td><td><span id="'+b+'-span"></span></td></tr>'};
     151ga.repeat.repeatOn=function(a,b,d){var e=/^(.*):(.*)$/.exec(d);d=d.replace(":","-");ga.repeat.data[a].repeater=ga.repeat.data[a].repeater||{};ga.repeat.data[a].repeater[d]=ga.repeat.data[a].repeater[d]||{};ga.repeat.data[a].repeater[d].child=ga.repeat.data[a].repeater[d].child||[];ga.repeat.data[a].repeater[d].child.push(b);ga.repeat.data[a].repeat[b].refid=d;e&&(d=e[1],e=e[2],ga.repeat.data[a].repeater[d]=ga.repeat.data[a].repeater[d]||{},ga.repeat.data[a].repeater[d].child=ga.repeat.data[a].repeater[d].child||
     152[],ga.repeat.data[a].repeater[d].choice=ga.repeat.data[a].repeater[d].choice||[],ga.repeat.data[a].repeater[d].child.push(b),ga.repeat.data[a].repeater[d].choice.push(e))};
     153ga.repeat.repeater=function(a,b,d,e){ga.repeat.data[a]=ga.repeat.data[a]||{};ga.repeat.data[a].repeater=ga.repeat.data[a].repeater||{};ga.repeat.data[a].repeater[b]=ga.repeat.data[a].repeater[b]||{};ga.repeat.data[a].repeater[b].type=d;e&&"__fields:tableize__"!=e&&!/^(off|false)$/i.test(e)&&(ga.repeat.data[a].repeater[b].tableize=1)};
     154ga.repeat.children=function(a,b,d){var e;d=d||{};if(!(ga.repeat.data[a]&&ga.repeat.data[a].repeater&&ga.repeat.data[a].repeater[b]&&ga.repeat.data[a].repeater[b].child))return d;for(e=0;e<ga.repeat.data[a].repeater[b].child.length;++e)d[ga.repeat.data[a].repeater[b].child[e]]=!0,ga.repeat.data[a].repeater[e]&&(d=ga.repeat.children(a,e,d));return d};
     155ga.repeat.change=function(a,b,d){var e=[],h="#"+b;var g=$(h);var m="",l="",f,p;if(!(ga.repeat.data[a]&&ga.repeat.data[a].repeater&&ga.repeat.data[a].repeater[b]&&g.length))return!1;switch(ga.repeat.data[a].repeater[b].type){case "checkbox":g=g.prop("checked")?1:0;break;case "integer":case "listbox":g=g.val();break;default:return console.warn("ga.repeat.change( "+a+" , "+b+" ) type "+ga.repeat.data[a].repeater[b].type+" not supported"),!1}if(!d&&ga.repeat.data[a].repeater[b].value===g)return!1;var q=
     156ga.repeat.children(a,b);switch(ga.repeat.data[a].repeater[b].type){case "checkbox":if(g)for(f in q){var n=b+"-"+f;ga.repeat.map[f]=n;m+=ga.repeat.data[a].repeat[f].htmlr.replace(/%%id%%/g,n).replace("%%label%%","");l+=ga.repeat.data[a].repeat[f].evalr.replace(/%%id%%/g,n);ga.repeat.data[a].repeater[f]&&(ga.repeat.data[a].repeater[n]||(ga.repeat.data[a].repeater[n]=jQuery.extend({},ga.repeat.data[a].repeater[f])),e.push(n),ga.repeat.data[a].repeater[n].value&&delete ga.repeat.data[a].repeater[n].value)}break;
     157case "integer":if(ga.repeat.data[a].repeater[b].tableize&&0<g)for(f in q)m+=ga.repeat.data[a].repeat[f].htmls;for(p=1;p<=g;++p)for(f in q)n=b+"-"+f+"-"+(p-1),ga.repeat.map[f]=n,m+=ga.repeat.data[a].repeat[f].htmlr.replace(/%%id%%/g,n).replace("%%label%%","["+p+"]").replace(ga.repeat.data[a].repeater[b].tableize?/<td.*?><label.*?>.*?<\/label><\/td>/:"",""),l+=ga.repeat.data[a].repeat[f].evalr.replace(/%%id%%/g,n),ga.repeat.data[a].repeater[f]&&(ga.repeat.data[a].repeater[n]||(ga.repeat.data[a].repeater[n]=
     158jQuery.extend({},ga.repeat.data[a].repeater[f])),e.push(n),ga.repeat.data[a].repeater[n].value&&delete ga.repeat.data[a].repeater[n].value);break;case "listbox":q=b.replace(/-[0-9]+$/,"").replace(/^(.*)-([A-ZA-z0-9_]*)$/,"$2")+"-"+g;p=b+"-"+g;q=ga.repeat.children(a,q);for(f in q)n=p+"-"+f,ga.repeat.map[f]=n,m+=ga.repeat.data[a].repeat[f].htmlr.replace(/%%id%%/g,n).replace("%%label%%",""),l+=ga.repeat.data[a].repeat[f].evalr.replace(/%%id%%/g,n),ga.repeat.data[a].repeater[f]&&(ga.repeat.data[a].repeater[n]||
     159(ga.repeat.data[a].repeater[n]=jQuery.extend({},ga.repeat.data[a].repeater[f])),e.push(n),ga.repeat.data[a].repeater[n].value&&delete ga.repeat.data[a].repeater[n].value);break;default:return console.warn("ga.repeat.change( "+a+" , "+b+" ) type "+ga.repeat.data[a].repeater[b].type+" not supported"),!1}!/^<tr>/.test(m)&&/<\/tr>$/.test(m)&&(m="<tr>"+m);$(h+"-repeater").html(m);eval(l);ga.repeat.data[a].repeater[b].value=g;for(f=0;f<e.length;++f)ga.repeat.change(a,e[f],d);$("#global_data").data("_pull_json#"+
     160b)&&ga.pull.doPull("#"+b);ga.hhelp.reset()};ga.repeat.map.convert=function(a){var b,d=[];for(b=0;b<a.length;++b)d[b]=ga.repeat.map[a[b]]||a[b];return d};ga.hide=function(a,b){ga.hide.data=ga.hide.data||{};ga.hide.data[a]=ga.hide.data[a]||{};ga.hide.data[a][b]=ga.hide.data[a][b]||{};ga.hide.data[a][b].active=1};ga.hide.data={};
     161ga.hide.update=function(a,b){var d;if(ga.hide.data[a]&&ga.hide.data[a][b])if(ga.hide.data[a][b].hides){if($(b).prop("checked"))for(d in ga.hide.data[a][b].hides)$(d+"-itd").html(" "),$(d).hide();else for(d in ga.hide.data[a][b].hides)$(d+"-itd").html(ga.hide.data[a][b].hides[d]),$(d).show();ga.hhelp.set()}else console.log("ga.hide.update( "+a+" , "+b+" ) error, no hides attached to this hider");else console.log("ga.hide.update( "+a+" , "+b+" ) error, hider has not been defined")};
     162ga.hide.add=function(a,b,d){ga.hide.data=ga.hide.data||{};ga.hide.data[a]=ga.hide.data[a]||{};ga.hide.data[a][d]=ga.hide.data[a][d]||{};ga.hide.data[a][d].hides=ga.hide.data[a][d].hides||{};ga.hide.data[a][d].hides[b]=$(b+"-itd").html()};ga.directives=function(a,b){ga.directives.data=ga.directives.data||{};ga.directives.data[a]=b};ga.hideifnot=function(a,b){ga.directives.data&&ga.directives.data[b]&&!/^(off|false|0$)/.test(ga.directives.data[b].toLowerCase())||$(a).hide()};ga.data={};
     163ga.data.nofcrefresh={};function showTooltip(a,b,d,e){$('<div id="rtooltip">'+d+"</div>").css({position:"absolute",top:b+5,left:a+5,border:"1px solid #181616",padding:"2px","background-color":e,color:"white"}).appendTo("body")}ga.data.dataURLtoFile=function(a,b){var d=a.split(",");a=d[0].match(/:(.*?);/)[1];d=atob(d[1]);for(var e=d.length,h=new Uint8Array(e);e--;)h[e]=d.charCodeAt(e);return new File([h],b,{type:a})};
     164ga.data.create_image_htmltocanvas=function(a){if($("#"+a+"_savetofile").length){var b=$("#"+a+"_div");html2canvas(b.get(0),{background:"#ffffff",onrendered:function(d){d='<a href="'+d.toDataURL("image/png").replace("image/png","image/octet-stream")+'" target="_blank" download="plot.png">plot.png</a>';$("#"+a+"_savetofile_link").html(d)}})}};
     165ga.data.create_image=function(a,b){if($("#"+a+"_savetofile").length){var d=document.getElementById(a+"_savetofile");b=b.getCanvas().toDataURL("image/png").replace("image/png","image/octet-stream");b=ga.data.dataURLtoFile(b,"plot.png");d.href=URL.createObjectURL(b);$("#"+a+"_savetofile").removeClass("hidden")}};
     166ga.data.update=function(a,b,d,e){var h=0,g=0,m=0,l=0,f=0,p=a+"_output",q="#"+p,n=$(q),x={},w=q+"_msgs",z=$(w),u,A,B,G,D,H,E;d&&($("#"+a+"_progress").empty(),z.text(""));$.each(b,function(v,r){E=n.find("#"+v);if(E.length)switch(h||(z.text(""),h=1),E.attr("type")){case "plot3d":case "plotly":u="#"+v;ga.plot3dglobal=r.layout;ga.dataplot3dglobal=r.data;ga.plotted3d[a]=0;$(u+"_showcollapse").length&&$(u+"_showcollapse").removeClass("hidden");Plotly.plot(v,r.data,r.layout);ga.showcollapse3d[a]&&(ga.plotted3d[a]=
     1671,$(u+"_showcollapse").trigger("click"));B=p+":#"+v+":last_value";$("#global_data").data(B,r);break;case "plot2d":u="#"+v;ga.value.plot2d.zstack.reset(u);if(r.data){if(ga.value.set.plot2d(u,r.options),ga.plotglobal=r.options,ga.dataplotglobal=r.data,$.plot(u,r.data,ga.value.get.plot2d.plot_options(u,r.options)),ga.customtooltips[a]){var I=null;$(u).bind("plothover",function(C,y,F){F?I!=F.dataIndex&&(I=F.dataIndex,$("#rtooltip").remove(),F.datapoint[0].toFixed(2),F.datapoint[1].toFixed(2),F.series.tooltips.length&&
     168showTooltip(F.pageX,F.pageY,F.series.tooltips[F.dataIndex],F.series.color)):($("#rtooltip").remove(),I=null)})}}else $.plot(u,r,ga.value.get.plot2d.plot_options(u));$(u+"_savetofile").length&&$(u+"_savetofile").removeClass("hidden");$(u+"_changescalex").length&&($(u+"_changescalex").removeClass("hidden"),"log"==r.options.xscale?$(u+"_changescalex_message").html("X-log"):$(u+"_changescalex_message").html("X-lin"));$(u+"_changescaley").length&&($(u+"_changescaley").removeClass("hidden"),"log"==r.options.yscale?
     169$(u+"_changescaley_message").html("Y-log"):$(u+"_changescaley_message").html("Y-lin"));$(u+"_showcollapse").length&&($(u+"_showcollapse").removeClass("hidden"),$(u).show(),ga.plotted2d[a]=1,$(u+"_showcollapse").trigger("click"));if(ga.value.settings[u].selzoom||r.options&&r.options.selection&&r.options.selection.mode&&"xy"==r.options.selection.mode)$(u).on("plotselected",{htag:u,data:r.data?r.data:r,options:r.data?ga.value.get.plot2d.plot_options(u,r.options):ga.value.get.plot2d.plot_options(u)},
     170function(C,y){1E-5>y.xaxis.to-y.xaxis.from&&(y.xaxis.to=y.xaxis.from+1E-5);1E-5>y.yaxis.to-y.yaxis.from&&(y.yaxis.to=y.yaxis.from+1E-5);ga.value.plot2d.zstack.dopush(C.data.htag,y);$.plot(C.data.htag,C.data.data,$.extend(!0,{},C.data.options,{xaxis:{min:y.xaxis.from,max:y.xaxis.to},yaxis:{min:y.yaxis.from,max:y.yaxis.to}}))}).on("contextmenu",{htag:u,data:r.data?r.data:r,options:r.data?ga.value.get.plot2d.plot_options(u,r.options):ga.value.get.plot2d.plot_options(u)},function(C){C.preventDefault();
     171var y=ga.value.plot2d.zstack.dopop(C.data.htag);y?$.plot(C.data.htag,C.data.data,$.extend(!0,{},C.data.options,{xaxis:{min:y.xaxis.from,max:y.xaxis.to},yaxis:{min:y.yaxis.from,max:y.yaxis.to}})):$.plot(C.data.htag,C.data.data,C.data.options)});B=p+":#"+v+":last_value";$("#global_data").data(B,r);break;case "bokeh":ga.bokeh.render(a,v,r);break;case "ngl":ga.value.nglshow(p,v,r);break;case "atomicstructure":B=p+":#"+v+":last_value";H=r.file?r.file:r;_jmol_info[v].script="set background ["+ga.colors.background+
     172"]; set zoomlarge false;set echo top center;echo loading "+H.split("/").pop()+';refresh;load "'+H+'";';ga.set(a+":jsmoladd")&&(_jmol_info[v].script+=ga.set(a+":jsmoladd"));r.script&&(_jmol_info[v].script+=";"+r.script);$("#global_data").data(B,_jmol_info[v].script);$("#"+v).html(Jmol.getAppletHtml("jmolApplet"+v,_jmol_info[v]));break;case "checkbox":case "radio":E.prop("checked",!0);break;case "div":E.html(r);break;case "video":A=$("#"+v);D="<video ";A.attr("data-width")&&(D+=' width="'+A.attr("data-width")+
     173'"');A.attr("data-height")&&(D+=' height="'+A.attr("data-height")+'"');D+=" controls>";D+='<source src="'+r+'.mp4" type="video/mp4" /><source src="'+r+'.webm" type="video/webm" />';D+="</video>";A.html(D);break;case "image":A=$("#"+v);D="<img ";A.attr("data-width")&&(D+=' width="'+A.attr("data-width")+'"');A.attr("data-height")&&(D+=' height="'+A.attr("data-height")+'"');D+=' src="'+r+'">';A.html(D);break;case "filelink":G='<a href="'+r+'" target="_blank">'+r.split("/").pop()+"</a>";B=p+":#"+v+":last_value";
     174$("#global_data").data(B,G);$("#"+v+"_filelink").html(G);break;case "filelinkm":B=p+":#"+v+":last_value";G="";$.each(r,function(C,y){G+='<a href="'+y+'" target="_blank">'+y.split("/").pop()+"</a> "});$("#global_data").data(B,G);$("#"+v+"_filelink").html(G);break;default:$("#global_data").data("_append:"+p+"_"+v)?(E.val(E.val()+"\n"+r),E.height(parseFloat(E.prop("scrollHeight")+parseFloat(E.css("borderTopWidth"))+parseFloat(E.css("borderBottomWidth"))))):E.val(r)}else d?"_"==v.charAt(0)?/^_fs_/.test(v)&&
     175ga.data.nofcrefresh[a]||("_message"==v&&ga.msg.box(r),"_question"==v&&ga.qr.question(a,b),"_question_answered"==v&&ga.qr.answered(a,b),"_question_timeout"==v&&ga.qr.timeout(a,b),/^_getinput/.test(v)&&"_getinput"==v&&ga.valuen.input(a,r),"_textarea"==v&&ga.data.textarea(q,r),"_airavata"==v&&ga.data.airavata(q,r),"_status"==v&&"complete"==r&&d(e,0,0)):(g||(z.append("<p>Unexpected results:</p>"),g=1),z.append("<p>"+v+" => "+r+"</p>")):"_"==v.charAt(0)?/^_fs_/.test(v)&&ga.data.nofcrefresh[a]||($("#_state").data(v,
     176r),m=1,"_status"==v&&(x.job_status=r),/^_getinput/.test(v)&&"_getinput"==v&&ga.valuen.input(a,r),"_textarea"==v&&ga.data.textarea(q,r),"_airavata"==v&&ga.data.airavata(q,r),"_loginverify"==v&&ga.login.verify(r),"_loginapprove"==v&&ga.login.approve(r)):"-close"==v?l=1:"-close2"==v?f=1:(g||(z.text(""),z.append("<p>Unexpected results:</p>"),h=g=1),z.append("<p>"+v+" => "+r+"</p>"))});ga.value.saveLastValues(p);ga.value.saveLastValue(p,w);$(q+"_progress").empty();m&&syncState();l&&ga.msg.close(1);f&&
     177ga.msg.close(2);return x};
     178ga.data.textarea=function(a,b){var d=a+"_textarea",e=$(d);isatend=e[0].scrollHeight-e[0].scrollTop===e[0].clientHeight;b||(b="");e.is(":hidden")&&(e.show(),$(d+"_label").show());"__reset__\n"==b.substr(0,10)?e.val(b.substr(10)):e.val(e.val()+b);ga.set("textarea:rows")?ga.data.textarea.h[a]?e.height(ga.data.textarea.h[a]):ga.data.textarea.h[a]=parseFloat(e.prop("clientHeight"))+parseFloat(e.css("borderTopWidth"))+parseFloat(e.css("borderBottomWidth")):e.height(parseFloat(e.prop("scrollHeight"))+parseFloat(e.css("borderTopWidth"))+
     179parseFloat(e.css("borderBottomWidth")));isatend&&e.scrollTop(e[0].scrollHeight)};ga.data.textarea.h={};ga.data.airavata=function(a,b){a=$(a+"_airavata");a.is(":hidden")&&a.show();a.html(b)};
     180ga.sync=function(a,b,d){var e,h=$("#"+b),g;if(h&&ga.sync.data&&ga.sync.data[a]&&ga.sync.data[a][d]){ga.sync.data[a][d][b]=!0;for(e in ga.sync.data[a][d])if(e!=b&&(g=$("#"+e))&&$.isNumeric(g.val())){h.val(g.val());h.change();return}ga.sync.data[a][d]._lastval&&$.isNumeric(ga.sync.data[a][d]._lastval)&&(h.val(ga.sync.data[a][d]._lastval),h.change())}else ga.sync.data=ga.sync.data||{},ga.sync.data[a]=ga.sync.data[a]||{},ga.sync.data[a][d]=ga.sync.data[a][d]||{},ga.sync.data[a][d][b]=!0};
     181ga.sync.change=function(a,b,d){var e,h=$("#"+b);if(h&&$.isNumeric(h.val())&&ga.sync.data&&ga.sync.data[a]&&ga.sync.data[a][d])for(e in ga.sync.data[a][d]._lastval=h.val(),ga.sync.data[a][d])e!=b&&(a=$("#"+e))&&a.val()!=h.val()&&(a.val(h.val()),a.change())};ga.sync.reset=function(a){var b;if(ga.sync.data&&ga.sync.data[a])for(b in ga.sync.data[a])ga.sync.data[a][b]._lastval&&delete ga.sync.data[a][b]._lastval};ga.valuen={};ga.valuen.data={};ga.valuen.html={};ga.valuen.dflt={};ga.valuen.dflt.data={};
    169182ga.valuen.dflt.html={};ga.valuen.lastload="";
    170 ga.valuen.restore=function(a,c,b){var e="#"+a,f=$(e),d=f.find(":input").get(),g={},h,m;c=c||ga.valuen.data[a];b=b||ga.valuen.html[a];if(c){$(e+" .field_msg").empty();do h=!1,$.each(d,function(){var b,e,l=$(this),m,v;if(l.attr("data-repeater")&&!g[this.name]){g[this.name]=!0;if(this.name&&(c[this.name]||/checkbox|radio/i.test(this.type))){e=c[this.name];if(/checkbox|radio/i.test(this.type)){m=l.val();v=!1;if(e)for(b=0;b<e.length;b++)if(e[b]==m){v=!0;break}l.prop("checked",v)}else l.val(e[0]);h=!0;
    171 ga.repeat.change(a,this.name,!0);d=f.find(":input").get();return!1}c[this.name]||/checkbox|radio/i.test(this.type)||console.warn("ga.valuen.restore() no data found for repeater setting value on "+this.name+" type "+this.type+" to "+e[0])}});while(h);$.each(d,function(){var b,d,e,f,h;if(this.name&&!g[this.name])if(e=$(this),(c[this.name]||/checkbox|radio/i.test(this.type))&&!/button/i.test(this.nodeName))if(d=c[this.name],/checkbox|radio/i.test(this.type)){f=e.val();h=!1;if(d)for(b=0;b<d.length;b++)if(d[b]==
    172 f){h=!0;break}e.prop("checked",h)}else"file"===this.type?d[0]?$("#"+this.id+"_msg").html(" "+d[0]+" please reload manually (programmatic setting of local files disallowed by browser security)"):e.val(""):e.val(d[0]);else if(/button/i.test(this.nodeName)&&(d=e.attr("data-type"))&&(e=ga.altfile.button.getnames(this.id,d)))for(b=0;b<e.length;++b)c[e[b]]&&ga.altfile.button.addhtml(a,this.id,d,c[e[b]])});for(m in b)$("#"+m).html(b[m])}};
     183ga.valuen.restore=function(a,b,d){var e="#"+a,h=$(e),g=h.find(":input").get(),m={},l;b=b||ga.valuen.data[a];d=d||ga.valuen.html[a];if(b){$(e+" .field_msg").empty();do{var f=!1;$.each(g,function(){var p,q=$(this);if(q.attr("data-repeater")&&!m[this.name]){m[this.name]=!0;if(this.name&&(b[this.name]||/checkbox|radio/i.test(this.type))){var n=b[this.name];if(/checkbox|radio/i.test(this.type)){var x=q.val();var w=!1;if(n)for(p=0;p<n.length;p++)if(n[p]==x){w=!0;break}q.prop("checked",w)}else q.val(n[0]);
     184f=!0;ga.repeat.change(a,this.name,!0);g=h.find(":input").get();return!1}b[this.name]||/checkbox|radio/i.test(this.type)||console.warn("ga.valuen.restore() no data found for repeater setting value on "+this.name+" type "+this.type+" to "+n[0])}})}while(f);$.each(g,function(){var p;if(this.name&&!m[this.name]){var q=$(this);if((b[this.name]||/checkbox|radio/i.test(this.type))&&!/button/i.test(this.nodeName)){var n=b[this.name];if(/checkbox|radio/i.test(this.type)){var x=q.val();var w=!1;if(n)for(p=
     1850;p<n.length;p++)if(n[p]==x){w=!0;break}q.prop("checked",w)}else"file"===this.type?n[0]?$("#"+this.id+"_msg").html(" "+n[0]+" please reload manually (programmatic setting of local files disallowed by browser security)"):q.val(""):q.val(n[0])}else if(/button/i.test(this.nodeName)&&(n=q.attr("data-type"))&&(q=ga.altfile.button.getnames(this.id,n)))for(p=0;p<q.length;++p)b[q[p]]&&ga.altfile.button.addhtml(a,this.id,n,b[q[p]])}});for(l in d)$("#"+l).html(d[l])}};
    173186ga.valuen.restore.dflt=function(a){return ga.valuen.restore(a,ga.valuen.dflt.data[a],ga.valuen.dflt.html[a])};
    174 ga.valuen.save=function(a,c){var b=$("#"+a).find(":input").get();data={};html={};$.each(b,function(){var a=$(this),b=this.name&&!this.disabled,c=a.attr("data-add");if(b){if(this.checked||/select|textarea/i.test(this.nodeName)||/file|email|number|text|hidden|password/i.test(this.type))void 0==data[this.name]&&(data[this.name]=[]),data[this.name].push(a.val());c&&(void 0==html[c]&&(html[c]=[]),html[c].push($("#"+c).html()))}});c?(ga.valuen.dflt.data[a]=data,ga.valuen.dflt.html[a]=html):(ga.valuen.data[a]=
     187ga.valuen.save=function(a,b){var d=$("#"+a).find(":input").get();data={};html={};$.each(d,function(){var e=$(this),h=this.name&&!this.disabled,g=e.attr("data-add");if(h){if(this.checked||/select|textarea/i.test(this.nodeName)||/file|email|number|text|hidden|password/i.test(this.type))void 0==data[this.name]&&(data[this.name]=[]),data[this.name].push(e.val());g&&(void 0==html[g]&&(html[g]=[]),html[g].push($("#"+g).html()))}});b?(ga.valuen.dflt.data[a]=data,ga.valuen.dflt.html[a]=html):(ga.valuen.data[a]=
    175188data,ga.valuen.html[a]=html)};
    176 ga.valuen.input=function(a,c){var b=$("#"+a),e=b.find(":input").get(),f={},d;if(c){do d=!1,$.each(e,function(){var g,h,m=$(this),k,r;if(m.attr("data-repeater")&&!f[this.name]){f[this.name]=!0;if(this.name&&(c[this.name]||/checkbox|radio/i.test(this.type))){h=c[this.name];"[object Array]"!==Object.prototype.toString.call(h)&&(h=[h]);if(/checkbox|radio/i.test(this.type)){k=m.val();r=!1;if(h)for(g=0;g<h.length;g++)if(h[g]==k){r=!0;break}m.prop("checked",r)}else m.val(h[0]);d=!0;ga.repeat.change(a,this.name,
    177 !0);e=b.find(":input").get();return!1}c[this.name]||/checkbox|radio/i.test(this.type)||console.warn("ga.valuen.input() no data found for repeater setting value on "+this.name+" type "+this.type+" to "+h[0])}});while(d);$.each(e,function(){var b,d,e,k,r;if(this.name&&!f[this.name])if(e=$(this),(c[this.name]||/checkbox|radio/i.test(this.type))&&!/button/i.test(this.nodeName))if(d=c[this.name],"[object Array]"!==Object.prototype.toString.call(d)&&(d=[d]),/checkbox|radio/i.test(this.type)){k=e.val();
    178 r=!1;if(d)for(b=0;b<d.length;b++)if(d[b]==k){r=!0;break}e.prop("checked",r)}else"file"===this.type?d[0]&&$("#"+this.id+"_msg").html(" "+d[0]+" please reload manually (programmatic setting of local files disallowed by browser security)"):e.val(d[0]);else if(/button/i.test(this.nodeName)&&(d=e.attr("data-type"))&&(e=ga.altfile.button.getnames(this.id,d),typenamesinput=ga.altfile.button.getnamesinput(this.id,d),e))for(b=0;b<e.length;++b)c[typenamesinput[b]]&&ga.altfile.button.addhtml(a,this.id,d,c[typenamesinput[b]])});
    179 $.each(c,function(a,b){var c;/^_html_/.test(a)&&(a=a.replace(/^_html_/,""),(c=$("#"+a))&&c.html(b))})}else console.warn("ga.valuen.input( "+a+" ) no data")};ga.valuen.addhtml=function(a){a=$("#"+a);var c=a.find(":input").get(),b="";$.each(c,function(){var a=$(this),c=this.name&&!this.disabled,a=a.attr("data-add");c&&a&&(b+='<input type="hidden" name="_html_'+a+'" value="'+$("#"+a).html()+'">')});a.append(b)};
     189ga.valuen.input=function(a,b){var d=$("#"+a),e=d.find(":input").get(),h={};if(b){do{var g=!1;$.each(e,function(){var m,l=$(this);if(l.attr("data-repeater")&&!h[this.name]){h[this.name]=!0;if(this.name&&(b[this.name]||/checkbox|radio/i.test(this.type))){var f=b[this.name];"[object Array]"!==Object.prototype.toString.call(f)&&(f=[f]);if(/checkbox|radio/i.test(this.type)){var p=l.val();var q=!1;if(f)for(m=0;m<f.length;m++)if(f[m]==p){q=!0;break}l.prop("checked",q)}else l.val(f[0]);g=!0;ga.repeat.change(a,
     190this.name,!0);e=d.find(":input").get();return!1}b[this.name]||/checkbox|radio/i.test(this.type)||console.warn("ga.valuen.input() no data found for repeater setting value on "+this.name+" type "+this.type+" to "+f[0])}})}while(g);$.each(e,function(){var m;if(this.name&&!h[this.name]){var l=$(this);if((b[this.name]||/checkbox|radio/i.test(this.type))&&!/button/i.test(this.nodeName)){var f=b[this.name];"[object Array]"!==Object.prototype.toString.call(f)&&(f=[f]);if(/checkbox|radio/i.test(this.type)){var p=
     191l.val();var q=!1;if(f)for(m=0;m<f.length;m++)if(f[m]==p){q=!0;break}l.prop("checked",q)}else"file"===this.type?f[0]&&$("#"+this.id+"_msg").html(" "+f[0]+" please reload manually (programmatic setting of local files disallowed by browser security)"):l.val(f[0])}else if(/button/i.test(this.nodeName)&&(f=l.attr("data-type"))&&(l=ga.altfile.button.getnames(this.id,f),typenamesinput=ga.altfile.button.getnamesinput(this.id,f),l))for(m=0;m<l.length;++m)b[typenamesinput[m]]&&ga.altfile.button.addhtml(a,this.id,
     192f,b[typenamesinput[m]])}});$.each(b,function(m,l){var f;/^_html_/.test(m)&&(m=m.replace(/^_html_/,""),(f=$("#"+m))&&f.html(l))})}else console.warn("ga.valuen.input( "+a+" ) no data")};ga.valuen.addhtml=function(a){a=$("#"+a);var b=a.find(":input").get(),d="";$.each(b,function(){var e=$(this),h=this.name&&!this.disabled;e=e.attr("data-add");h&&e&&(d+='<input type="hidden" name="_html_'+e+'" value="'+$("#"+e).html()+'">')});a.append(d)};
    180193ga.valuen.reset=function(){ga.valuen.data={};ga.valuen.html={};ga.valuen.dflt={};ga.valuen.dflt.data={};ga.valuen.dflt.html={};ga.valuen.lastload=""};
    181 ga.license=function(a){a=a.split(",");var c=[],b,e=[],f;a.length&&(b="<p>Submitting to this module requires "+(1<a.length?"approved licenses":"an approved license")+" for <em>"+a.join("</em> and <em>")+"</em></p>");for(f in a)if(e.push({id:a[f],label:a[f]+" Management",data:a[f],cb:function(a){return ga.altfile.button.simplecall("license",a)}}),ga.license.data[a[f]]&&ga.license.data[a[f]].status)switch(ga.license.data[a[f]].status){case "approved":break;case "denied":b+="<p>Your license request for <em>"+
    182 a[f]+"</em> has been <strong>denied</strong>.</p>";c.push(a[f]);break;case "pending":b+="<p>Your license request for <em>"+a[f]+"</em> is pending approval.</p>";c.push(a[f]);break;default:console.warn("ga.license() "+a[f]+" unknown status "+ga.license.data[a[f]].status),c.push(a[f])}else c.push(a[f]);return c.length?(ga.msg.box({icon:"warning.png",text:b,buttons:e}),!1):!0};ga.license.data={};
    183 ga.license.get=function(){ga.license.data={};ga.license.url&&$.getJSON(ga.license.url,{tagmode:"any",format:"json",_window:window.name,_logon:$("#_state").data("_logon")}).done(function(a,c,b){a.license&&(ga.license.data=a.license);a.restricted?ga.restricted.show(a.restricted):ga.restricted.hideall()}).fail(function(a,c,b){console.warn("could not get license data")})};
    184 ga.captcha=function(a,c){var b="";$.ajax({url:ga.captcha.url,data:{_window:window.name}}).success(function(e){e=$.parseJSON(e);e.error?ga.msg.box({icon:"toast.png",text:e.error}):(b='<img src="data:image/png;base64,'+e.captcha+'"><form id="sys_captcha"><label for="sys_captcha_text">Verify </label><input id="sys_captcha_text" class="help_link" type="text" maxlength="6" size="6" required><span class="help">Enter the 6 character alphanumeric code shown in the image and then press submit</span><input id="sys_captcha_id" type="hidden" value="'+
    185 e.id+'"></form>',ga.msg.box({text:b,eval:"ga.hhelp.reset();$('#sys_captcha').on('keyup keypress', function(e) { var code = e.keyCode || e.which;  if (code  == 13) { e.preventDefault(); return false; }});",buttons:[{id:"submit",label:"Submit",cb:ga.captcha.verify,data:{cb:a,data:c}}]}))}).error(function(a){ga.msg.box({icon:"toast.png",text:"Error contacting server"})})};
    186 ga.captcha.verify=function(a){$.ajax({url:ga.captcha.url_verify,data:{_window:window.name,captcha:$("#sys_captcha_text").val(),id:$("#sys_captcha_id").val()}}).success(function(c){c=$.parseJSON(c);if(c.error)ga.msg.box({icon:"toast.png",text:c.error});else if(c.success)a.cb(a.data);else return ga.captcha(a.cb,a.data)}).error(function(a){ga.msg.box({icon:"toast.png",text:"Error contacting server"})})};
    187 ga.register=function(a){a=a.split(",");var c=[],b,e=[],f;a.length&&(b="<p>Submitting to this module requires "+(1<a.length?"approved registers":"an approved register")+" for <em>"+a.join("</em> and <em>")+"</em></p>");for(f in a)if(e.push({id:a[f],label:a[f]+" Management",data:a[f],cb:function(a){return ga.altfile.button.simplecall("register",a)}}),ga.register.data[a[f]]&&ga.register.data[a[f]].status)switch(ga.register.data[a[f]].status){case "approved":break;case "denied":b+="<p>Your register request for <em>"+
    188 a[f]+"</em> has been <strong>denied</strong>.</p>";c.push(a[f]);break;case "pending":b+="<p>Your register request for <em>"+a[f]+"</em> is pending approval.</p>";c.push(a[f]);break;default:console.warn("ga.register() "+a[f]+" unknown status "+ga.register.data[a[f]].status),c.push(a[f])}else c.push(a[f]);return c.length?(ga.msg.box({icon:"warning.png",text:b,buttons:e}),!1):!0};ga.register.data={};
    189 ga.register.get=function(){ga.register.data={};ga.register.url&&$.getJSON(ga.register.url,{tagmode:"any",format:"json",_window:window.name,_logon:$("#_state").data("_logon")}).done(function(a,c,b){a.register&&(ga.register.data=a.register);a.restricted?ga.restricted.show(a.restricted):ga.restricted.hideall()}).fail(function(a,c,b){console.warn("could not get register data")})};ga.calc={};ga.calc.data={};ga.calc.str_atom_numeric="(?:(?:-?[1-9][0-9]*)|(?:-?0))?(?:[.][0-9]+)?(?:[eE][-+]?[0-9]+)?";
     194ga.license=function(a){a=a.split(",");var b=[],d,e=[],h;a.length&&(d="<p>Submitting to this module requires "+(1<a.length?"approved licenses":"an approved license")+" for <em>"+a.join("</em> and <em>")+"</em></p>");for(h in a)if(e.push({id:a[h],label:a[h]+" Management",data:a[h],cb:function(g){return ga.altfile.button.simplecall("license",g)}}),ga.license.data[a[h]]&&ga.license.data[a[h]].status)switch(ga.license.data[a[h]].status){case "approved":break;case "denied":d+="<p>Your license request for <em>"+
     195a[h]+"</em> has been <strong>denied</strong>.</p>";b.push(a[h]);break;case "pending":d+="<p>Your license request for <em>"+a[h]+"</em> is pending approval.</p>";b.push(a[h]);break;default:console.warn("ga.license() "+a[h]+" unknown status "+ga.license.data[a[h]].status),b.push(a[h])}else b.push(a[h]);return b.length?(ga.msg.box({icon:"warning.png",text:d,buttons:e}),!1):!0};ga.license.data={};
     196ga.license.get=function(){ga.license.data={};ga.license.url&&$.getJSON(ga.license.url,{tagmode:"any",format:"json",_window:window.name,_logon:$("#_state").data("_logon")}).done(function(a,b,d){a.license&&(ga.license.data=a.license);a.restricted?ga.restricted.show(a.restricted):ga.restricted.hideall()}).fail(function(a,b,d){console.warn("could not get license data")})};
     197ga.captcha=function(a,b){var d="";$.ajax({url:ga.captcha.url,data:{_window:window.name}}).success(function(e){e=$.parseJSON(e);e.error?ga.msg.box({icon:"toast.png",text:e.error}):(d='<img src="data:image/png;base64,'+e.captcha+'"><form id="sys_captcha"><label for="sys_captcha_text">Verify </label><input id="sys_captcha_text" class="help_link" type="text" maxlength="6" size="6" required><span class="help">Enter the 6 character alphanumeric code shown in the image and then press submit</span><input id="sys_captcha_id" type="hidden" value="'+
     198e.id+'"></form>',ga.msg.box({text:d,eval:"ga.hhelp.reset();$('#sys_captcha').on('keyup keypress', function(e) { var code = e.keyCode || e.which;  if (code  == 13) { e.preventDefault(); return false; }});",buttons:[{id:"submit",label:"Submit",cb:ga.captcha.verify,data:{cb:a,data:b}}]}))}).error(function(e){ga.msg.box({icon:"toast.png",text:"Error contacting server"})})};
     199ga.captcha.verify=function(a){$.ajax({url:ga.captcha.url_verify,data:{_window:window.name,captcha:$("#sys_captcha_text").val(),id:$("#sys_captcha_id").val()}}).success(function(b){b=$.parseJSON(b);if(b.error)ga.msg.box({icon:"toast.png",text:b.error});else if(b.success)a.cb(a.data);else return ga.captcha(a.cb,a.data)}).error(function(b){ga.msg.box({icon:"toast.png",text:"Error contacting server"})})};
     200ga.register=function(a){a=a.split(",");var b=[],d,e=[],h;a.length&&(d="<p>Submitting to this module requires "+(1<a.length?"approved registers":"an approved register")+" for <em>"+a.join("</em> and <em>")+"</em></p>");for(h in a)if(e.push({id:a[h],label:a[h]+" Management",data:a[h],cb:function(g){return ga.altfile.button.simplecall("register",g)}}),ga.register.data[a[h]]&&ga.register.data[a[h]].status)switch(ga.register.data[a[h]].status){case "approved":break;case "denied":d+="<p>Your register request for <em>"+
     201a[h]+"</em> has been <strong>denied</strong>.</p>";b.push(a[h]);break;case "pending":d+="<p>Your register request for <em>"+a[h]+"</em> is pending approval.</p>";b.push(a[h]);break;default:console.warn("ga.register() "+a[h]+" unknown status "+ga.register.data[a[h]].status),b.push(a[h])}else b.push(a[h]);return b.length?(ga.msg.box({icon:"warning.png",text:d,buttons:e}),!1):!0};ga.register.data={};
     202ga.register.get=function(){ga.register.data={};ga.register.url&&$.getJSON(ga.register.url,{tagmode:"any",format:"json",_window:window.name,_logon:$("#_state").data("_logon")}).done(function(a,b,d){a.register&&(ga.register.data=a.register);a.restricted?ga.restricted.show(a.restricted):ga.restricted.hideall()}).fail(function(a,b,d){console.warn("could not get register data")})};ga.calc={};ga.calc.data={};ga.calc.str_atom_numeric="(?:(?:-?[1-9][0-9]*)|(?:-?0))?(?:[.][0-9]+)?(?:[eE][-+]?[0-9]+)?";
    190203ga.calc.str_atom_id="[A-Za-z][A-Za-z0-9_:]*";ga.calc.str_function="(?:abs\\(|acos\\(|asin\\(|atan\\(|atan2\\(|ceil\\(|cos\\(|exp\\(|floor\\(|log\\(|max\\(|min\\(|pow\\(|random\\(|round\\(|sin\\(|sqrt\\(|tan\\(|-)";ga.calc.str_function_paren="(?:abs\\(|acos\\(|asin\\(|atan\\(|atan2\\(|ceil\\(|cos\\(|exp\\(|floor\\(|log\\(|max\\(|min\\(|pow\\(|random\\(|round\\(|sin\\(|sqrt\\(|tan\\()";ga.calc.str_function_no_paren="-";ga.calc.str_binary="[-,+*/^]";ga.calc.str_open_paren="\\(";
    191204ga.calc.str_close_paren="\\)";ga.calc.str_paren="[()]";ga.calc.is_atom_numeric=RegExp("^"+ga.calc.str_atom_numeric+"$");ga.calc.is_atom_id=RegExp("^"+ga.calc.str_atom_id+"$");ga.calc.is_function=RegExp("^"+ga.calc.str_function+"$");ga.calc.is_function_paren=RegExp("^"+ga.calc.str_function_paren+"$");ga.calc.is_function_no_paren=RegExp("^"+ga.calc.str_function_no_paren+"$");ga.calc.is_binary=RegExp("^"+ga.calc.str_binary+"$");ga.calc.is_open_paren=RegExp("^"+ga.calc.str_open_paren+"$");
    192205ga.calc.is_close_paren=RegExp("^"+ga.calc.str_close_paren+"$");ga.calc.is_paren=RegExp("^"+ga.calc.str_paren+"$");ga.calc.is_atom=RegExp("^("+ga.calc.str_atom_id+"|"+ga.calc.str_atom_numeric+")$");ga.calc.inc_paren=RegExp("^("+ga.calc.str_paren+"|"+ga.calc.str_function_paren+")$");ga.calc.precedence={"^":4,"*":5,"/":5,"+":6,"-":6,",":8};
    193 ga.calc.register=function(a,c,b){ga.calc.data[a]=ga.calc.data[a]||{};ga.calc.data[a].calc=ga.calc.data[a].calc||{};ga.calc.data[a].calc[c]={};ga.calc.data[a].calc[c].calc=b;ga.calc.data[a].calc[c].tokens=ga.calc.tokens(b);ga.calc.data[a].calc[c].tokens._error?ga.msg.box({icon:"toast.png",text:"Module field calc internal error: "+ga.calc.data[a].calc[c].tokens._error+" in calc field id "+c}):(ga.calc.repeatertokens(a,c),ga.calc.data[a].calc[c].dependents=ga.calc.dependents(a,c),99<ga.calc.depthofdeps(a,
    194 c)?ga.msg.box({icon:"toast.png",text:"Module field calc internal error: maximum recursion depth found in calc field id "+c}):(ga.calc.data[a].calc[c].tree=ga.calc.mktree(ga.calc.data[a].calc[c].tokens),ga.calc.data[a].calc[c].tree._error?ga.msg.box({icon:"toast.png",text:"Module field calc internal error: "+ga.calc.data[a].calc[c].tree._error+" in calc field id "+c}):ga.calc.install(a,c)))};
    195 ga.calc.repeatertokens=function(a,c){var b,e;if(/-/.test(c))for(i in b=c.split("-"),/\d+/.test(b[b.length-1])?(e=b.slice(0,b.length-2).join(":")+":",b=":"+b[b.length-1]):(e=b.slice(0,b.length-1).join(":")+":",b=""),ga.calc.data[a].calc[c].tokens)ga.calc.is_atom_id.test(ga.calc.data[a].calc[c].tokens[i])&&!$("#"+ga.calc.data[a].calc[c].tokens[i]).length&&(ga.calc.data[a].calc[c].tokens[i]=e+ga.calc.data[a].calc[c].tokens[i]+b)};
    196 ga.calc.depthofdeps=function(a,c,b){var e,f,d=0;b=b||0;ga.calc.data[a].calc[c].dependents&&b++;if(99<b)return b;for(e=0;e<ga.calc.data[a].calc[c].dependents.length;++e)ga.calc.data[a].calc[ga.calc.data[a].calc[c].dependents[e]]&&(f=ga.calc.depthofdeps(a,ga.calc.data[a].calc[c].dependents[e],b),d<f&&(d=f));return b+d};
    197 ga.calc.dependents=function(a,c){var b,e=[];for(b in ga.calc.data[a].calc[c].tokens)ga.calc.is_atom_id.test(ga.calc.data[a].calc[c].tokens[b])&&e.push(ga.calc.data[a].calc[c].tokens[b]);return e};ga.calc.install=function(a,c){for(var b in ga.calc.data[a].calc[c].dependents)$("#"+ga.calc.data[a].calc[c].dependents[b].replace(/:/g,"-")).on("change",function(){ga.calc.process(a,c)})};
    198 ga.calc.process=function(a,c){var b=ga.calc.evaltree(jQuery.extend(!0,{},ga.calc.data[a].calc[c].tree));b._error?ga.msg.box({icon:"toast.png",text:"Module field calc internal error: "+ga.calc.data[a].calc[c].tokens._error+" in calc field id "+c}):$("#"+c).val(b).trigger("change")};
    199 ga.calc.tokens=function(a){var c=[],b,e=[],f=RegExp("^("+ga.calc.str_function_paren+"|"+ga.calc.str_atom_id+"|"+ga.calc.str_paren+"|"+ga.calc.str_atom_numeric+"|"+ga.calc.str_function_no_paren+")"),d=RegExp("^("+ga.calc.str_binary+"|"+ga.calc.str_close_paren+")"),g=500;a=a.replace(/\s+/g,"");e.push(0);do{if(0<e.length&&e[e.length-1]){b=d.exec(a);if(!b)return{_error:"Invalid token found "+a};if(ga.calc.is_close_paren.test(b[0])){if(!e.length)return{_error:"Invalid closing parenthesis "+a};e.pop()}else e[e.length-
    200 1]=0}else{b=f.exec(a);if(!b)return{_error:"Invalid token found "+a};if(ga.calc.is_atom.test(b[0]))e[e.length-1]=1;else if(ga.calc.is_open_paren.test(b[0]))e.push(0);else if(ga.calc.is_close_paren.test(b[0])){if(!e.length)return{_error:"Invalid closing parenthesis "+a};e.pop()}else ga.calc.is_function_paren.test(b[0])&&e.push(0)}a=a.substring(b[0].length);c.push(b[0])}while(b&&b.length&&a.length&&0<--g);return 0>=g?{_error:"maximum token limit of 500 reached"}:c};
    201 ga.calc.parensub=function(a){for(var c=1,b={a:[]},e=1;e<a.length;++e){if(")"==a[e]&&(c--,0==c))return b.newofs=e,b;b.a.push(a[e]);/\($/.test(a[e])&&c++}return{_error:"Closing parenthesis error"}};
    202 ga.calc.mktree=function(a,c){for(var b=[],e=null,f,d,g=0;g<a.length;++g){token=a[g];if(ga.calc.is_function_paren.test(token)){f=ga.calc.parensub(a.slice(g));if(f._error)return f;g+=f.newofs;token={op:token,args:[f=ga.calc.mktree(f.a)]};d=1;if(f._error)return f}else if(ga.calc.is_open_paren.test(token)){f=ga.calc.parensub(a.slice(g));if(f._error)return f;g+=f.newofs;token=ga.calc.mktree(f.a);if(token._error)return token;d=1}else d=0;d||ga.calc.is_atom.test(token)?(b.push(token),e&&(c?ga.calc.precedence[e]<
    203 ga.calc.precedence[c.op]?(console.log("replace 2nd arg"),c.args[1]={op:e,args:[c.args[1],token]}):(console.log("replace parent object"),c={op:e,args:[c,token]}):(c={op:e,args:b},e=null,b=[]))):ga.calc.is_binary.test(token)&&(e=token)}!c&&b.length&&(c={op:"()",args:b});return c};
    204 ga.calc.arraytovals=function(a){var c;if(a.constructor===Array)for(c=0;c<a.length;++c)a[c]=Number(ga.calc.is_atom_id.test(a[c])?$("#"+a[c].replace(/:/g,"-")).val():a[c]);else a=Number(ga.calc.is_atom_id.test(a)?$("#"+a.replace(/:/g,"-")).val():a);return a};
    205 ga.calc.evaltree=function(a){var c,b,e,f,d,g,h,m,k;e=1;if(!a)return{_error:"no object in ga.calc.evaltree"};if(a._error)return a;if(!a.op)return{_error:"no op in object in ga.calc.evaltree"};if(!a.args)return{_error:"no args in object in ga.calc.evaltree"};if(1>a.args.length||2<a.args.length)return{_error:"args incorrect length in object in ga.calc.evaltree"};(b=2==a.args.length)&&"undefined"==typeof a.args[1]&&(b=0);"undefined"==typeof a.args[0]&&(e=0);e&&a.args[0].op&&(a.args[0]=ga.calc.evaltree(a.args[0]));
    206 b&&a.args[1].op&&(a.args[1]=ga.calc.evaltree(a.args[1]));e&&(a.args[0]=ga.calc.arraytovals(a.args[0]),b&&(a.args[1]=ga.calc.arraytovals(a.args[1])));e=e&&a.args[0].constructor===Array;b&&(f=a.args[1].constructor===Array,c=e||f,(d=e&&f)?a.args[0].length<a.args[1].length?(g=a.args[0],h=a.args[1],m=1):(g=a.args[1],h=a.args[0],m=0):c&&(h=a.args[e?0:1],k=a.args[e?1:0]));switch(a.op){case ",":c=e?a.args[0]:[a.args[0]];b&&"undefined"!=typeof a.args[1]&&(c=c.concat(f?a.args[1]:[a.args[1]]));break;case "()":b?
    207 (c=e?a.args[0]:[a.args[0]],b&&a.args[1]&&(c=c.concat(f?a.args[1]:[a.args[1]]))):c=a.args[0];break;case "+":if(!b)return{_error:"operator : "+a.op+" is binary and only has one argument"};if(c)if(c=h,d)for(b=0;b<g.length;++b)c[b]+=g[b];else for(b=0;b<h.length;++b)c[b]+=k;else c=a.args[0]+a.args[1];break;case "*":if(!b)return{_error:"operator : "+a.op+" is binary and only has one argument"};if(c)if(c=h,d)for(b=0;b<g.length;++b)c[b]*=g[b];else for(b=0;b<h.length;++b)c[b]*=k;else c=a.args[0]*a.args[1];
    208 break;case "-":if(!b)return{_error:"operator : "+a.op+" is binary and only has one argument"};if(c)if(d){c=a.args[0];for(b=0;b<g.length;++b)c[b]-=a.args[1][b];if(m)for(b=a.args[0].length;b<a.args[1].length;++b)c.push(-a.args[1][b]);else for(b=a.args[1].length;b<a.args[0].length;++b)c.push(a.args[0][b])}else if(e)for(c=a.args[0],b=0;b<a.args[0].length;++b)c[b]-=a.args[1];else for(c=[],b=0;b<a.args[1].length;++b)c.push(a.args[0]-a.args[1][b]);else c=a.args[0]-a.args[1];break;case "/":if(!b)return{_error:"operator : "+
    209 a.op+" is binary and only has one argument"};if(c)if(d){c=a.args[0];for(b=0;b<g.length;++b)c[b]/=a.args[1][b];if(m)for(b=a.args[0].length;b<a.args[1].length;++b)c.push(0);else for(b=a.args[1].length;b<a.args[0].length;++b)c.push(a.args[0][b]/0)}else if(e)for(c=a.args[0],b=0;b<a.args[0].length;++b)c[b]/=a.args[1];else for(c=[],b=0;b<a.args[1].length;++b)c.push(a.args[0]/a.args[1][b]);else c=a.args[0]/a.args[1];break;case "^":if(!b)return{_error:"operator : "+a.op+" is binary and only has one argument"};
    210 if(c)if(d){c=a.args[0];for(b=0;b<g.length;++b)c[b]=Math.pow(c[b],a.args[1][b]);if(m)for(b=a.args[0].length;b<a.args[1].length;++b)c.push(0);else for(b=a.args[1].length;b<a.args[0].length;++b)c.push(1)}else if(e)for(c=a.args[0],b=0;b<a.args[0].length;++b)c[b]=pow(c[b],a.args[1]);else for(c=[],b=0;b<a.args[1].length;++b)c.push(pow(a.args[0],a.args[1][b]));else c=Math.pow(a.args[0],a.args[1]);break;case "abs(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];
    211 if(e)for(b=0;b<c.length;++b)c[b]=Math.abs(c[b]);else c=Math.abs(a.args[0]);break;case "acos(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.acos(c[b]);else c=Math.acos(a.args[0]);break;case "asin(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.asin(c[b]);else c=Math.asin(a.args[0]);break;case "atan(":if(b)return{_error:"operator : "+
    212 a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.atan(c[b]);else c=Math.atan(a.args[0]);break;case "ceil(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.ceil(c[b]);else c=Math.ceil(a.args[0]);break;case "cos(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.cos(c[b]);else c=Math.cos(a.args[0]);
    213 break;case "exp(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.exp(c[b]);else c=Math.exp(a.args[0]);break;case "floor(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.floor(c[b]);else c=Math.floor(a.args[0]);break;case "log(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=
    214 Math.log(c[b]);else c=Math.log(a.args[0]);break;case "random(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.random();else c=Math.random();break;case "round(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.round(c[b]);else c=Math.round(a.args[0]);break;case "sin(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};
    215 c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.sin(c[b]);else c=Math.sin(a.args[0]);break;case "sqrt(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.sqrt(c[b]);else c=Math.sqrt(a.args[0]);break;case "tan(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=a.args[0];if(e)for(b=0;b<c.length;++b)c[b]=Math.tan(c[b]);else c=Math.tan(a.args[0]);break;case "max(":if(b)return{_error:"operator : "+
    216 a.op+" has 2 arguments but only accepts one"};c=e?Math.max.apply(null,a.args[0]):a.args[0];break;case "min(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};c=e?Math.min.apply(null,a.args[0]):a.args[0];break;case "atan2(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};if(!e)return{_error:"operator : "+a.op+"  needs the first argument to be an even sized array"};c=[];for(b=0;b<a.args[0].length;b+=2)c.push(Math.atan2(a.args[0][b],a.args[0][b+
    217 1]));break;case "pow(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};if(!e)return{_error:"operator : "+a.op+"  needs the first argument to be an even sized array"};c=[];for(b=0;b<a.args[0].length;b+=2)c.push(Math.pow(a.args[0][b],a.args[0][b+1]));1==c.length&&(c=c[0]);break;default:return{_error:"operator : "+a.op+" unknown or unsupported"}}return c};ga.bokeh={};ga.bokeh.data={};
    218 ga.bokeh.getdata=function(a,c){var b={},e=c.split(/\r?\n/),f=e.length,d,g=0;for(d=0;d<f;++d)if(g||-1!==e[d].indexOf("var docs_json ="))if(!g)g=1,b.docs_json=$.parseJSON(e[d].replace(/^\s*var\s+docs_json\s+=\s+/,"").replace(/(^'|('|);$)/g,""));else if(1==g&&-1!==e[d].indexOf("var render_items =")){b.render_items=$.parseJSON(e[d].replace(/^\s*var\s+render_items\s+=\s+/,"").replace(/;$/,""));break}return b};
    219 ga.bokeh.render=function(a,c,b){b=ga.bokeh.getdata(c,b);a+="_output";ga.bokeh.savedata(a,c,b);ga.bokeh.renderdata(a,c)};
    220 ga.bokeh.renderdata=function(a,c){var b,e,f="";if(ga.bokeh.data[a]&&ga.bokeh.data[a][c]&&ga.bokeh.data[a][c].docs_json&&ga.bokeh.data[a][c].render_items){e=ga.bokeh.data[a][c].render_items.length;for(b=0;b<e;++b)f+='<div class="bk-root"><div class="bk-plotdiv" id="'+ga.bokeh.data[a][c].render_items[b].elementid+'"></div></div>';$("#"+c).html(f);Bokeh.embed.embed_items(ga.bokeh.data[a][c].docs_json,ga.bokeh.data[a][c].render_items)}};
    221 ga.bokeh.savedata=function(a,c,b){ga.bokeh.data[a]=ga.bokeh.data[a]||{};ga.bokeh.data[a][c]=b};ga.bokeh.reset=function(a,c){ga.bokeh.data[a]&&ga.bokeh.data[a][c]&&(ga.bokeh.data[a][c]={},$("#"+c).empty())};ga.grid={};ga.grid.rc=function(a,c,b,e){var f="";a&&b&&a<b-1?f+="grid-row-start:"+a+";grid-row-end:"+b+";":a&&(f+="grid-row:"+a+";");c&&e&&c<e-1?f+="grid-column-start:"+c+";grid-column-end:"+e+";":c&&(f+="grid-column:"+c+";");return f};
    222 ga.grid.rcs=function(a,c,b,e){return'style="'+ga.grid.rc(a,c,b,e)+'"'};ga.grid.drcs=function(a,c,b,e,f,d){f=(f||"")+ga.grid.rc(a,c,b,e);return d?'<div class="'+d+'" style="'+f+'">':'<div style="'+f+'">'};ga.grid.init=function(){return{row:0,col:1}};ga.grid.newrow=function(a){a.row++;a.col=1};
    223 ga.grid.next=function(a,c,b,e){var f,d;a=a||{row:1,col:1};c?(a.col=c[0]?c[0]:a.col,f=c[1]?c[1]+a.col:a.col,a.row=c[2]?c[2]:a.row,d=c[3]?c[3]+a.row:a.row):(f=a.col,d=a.row);c=a.col;a.col=f+1;return ga.grid.drcs(a.row,c,d,f,b,e)};ga.grid.nextstyle=function(a,c,b){var e,f;b=b||"";a=a||{row:1,col:1};c?(a.col=c[0]?c[0]:a.col,e=c[1]?c[1]+a.col:a.col,a.row=c[2]?c[2]:a.row,f=c[3]?c[3]+a.row:a.row):(e=a.col,f=a.row);c=a.col;a.col=e+1;return ga.grid.rc(a.row,c,f,e,b)+b};ga.qr={};ga.qr.openq={};
    224 ga.qr.question=function(a,c){var b="",e,f,d,g="",h="",m,k=[],r={},l,u;c._uuid||(g+="no _uuid in received data. ");c._msgid||(g+="no _msgid in received data. ");c._question||(g+="no _question in received data. ");c._question.fields||(g+="no _question:fields in received data. ");if(g.length)return ga.qr.rerror(c,g);c._question.title&&(b+="<h3>"+c._question.title+"</h3>");c._question.text&&(b+=c._question.text);m=c._uuid+"-"+c._msgid;if(c._question.grid){ga.grid.align=ga.grid.align||"left";d="display:grid;grid-gap:";
    225 l=ga.grid.init();if("object"===typeof c._question.grid){c._question.grid.colwidths?"object"!==typeof c._question.grid.colwidths&&(g+=" _question:grid:colwidths specified, but it is not an array."):g+=" _question:grid specified, but it is not a number and colwidths not defined.";if(g.length)return ga.qr.rerror(c,g);d=c._question.grid.gap?d+c._question.grid.gap:d+"10px";d+=";grid-template-columns:";for(e=0;e<c._question.grid.colwidths.length;++e)d+=c._question.grid.colwidths[e]+"fr "}else for(d+="10px;grid-template-columns:auto ",
    226 2>c._question.grid&&(c._question.grid=2),e=1;e<c._question.grid;++e)d+=" auto";b+='<form id="'+m+'" style="'+(d+";")+'">';for(e=row_start=0;e<c._question.fields.length;++e)if(d=c._question.fields[e],d.id||(g+="No id in field "+e+". "),/^[A-Za-z][A-Za-z0-9_]*$/.test(d.id)||(g+="Invalid id for field "+e+' with id value "'+d.id+'". Only alpha in first character and alphanumeric and underscores subsequently allowed.'),d.type||(g+="No type in field "+e+". "),d.id&&d.type)switch(u="text-align:"+(d.grid&&
    227 d.grid.align?d.grid.align:ga.grid.align)+";",r[d.id]&&(g+="Duplicate id in _question fields:"+d.id+". "),r[d.id]=1,d.help?(f=' class="help_link"',help_span='<span class="help">'+d.help+"</span>"):help_span=f="",d.type){case "label":ga.grid.newrow(l);b+=ga.grid.next(l,d.grid?d.grid.label:null,u)+"<label"+f+">";d.label&&(b+=d.label);b+="</label>"+help_span+"</div>";break;case "file":ga.grid.newrow(l);d.label&&(b+=ga.grid.next(l,d.grid?d.grid.label:null,u)+'<label for="'+d.id+'"'+f+">"+d.label+"</label></div>");
    228 b+=ga.grid.next(l,d.grid?d.grid.data:null,u)+'<input type="file" id="'+d.id+'" name="'+d.id+'[]"'+f;d.required&&(b+=" required");d.multiple&&(b+=" multiple");d.accept&&(b+=' accept="'+d.accept+'"');b+=">"+help_span+"</div>";break;case "lrfile":ga.grid.newrow(l);d.label&&(b+=ga.grid.next(l,d.grid?d.grid.label:null,u)+'<label for="'+d.id+'"'+f+">"+d.label+"</label></div>");b+=ga.grid.next(l,d.grid?d.grid.data:null,u)+'<input type="file" id="'+d.id+'" name="'+d.id+'[]" data-add="'+d.id+'_altval"'+f;
    229 d.required&&(b+=" required");d.multiple&&(b+=" multiple");d.accept&&(b+=' accept="'+d.accept+'"');b+=">"+help_span+' or <button id="'+d.id+'_button" name="'+d.id+'_button" data-type="lrfile"'+f+'><span class="buttontext">Browse server</span></button>'+help_span+'<span id="'+d.id+'_altval"></span><input type="hidden" name="_selaltval_'+d.id+'" value="'+d.id+'_altval"</input></div>';h+='ga.altfile("'+m+'","'+d.id+'","'+d.id+'_altval" );$( "#'+m+'" ).change( function(){ $( "#'+d.id+'_altval" ).html( "<i>Local</i>: " + $( "#'+
    230 d.id+'" ).val().replace(/^C:.fakepath./,""));});ga.altfile.button( "'+m+'","'+d.id+'","'+d.label+'","rfile",function(v){ga.altfile.button.lrfile(v,"'+m+'","'+d.id+'")}';d.required&&(h+=',"lrfile"');h+=");";h+='$("#'+d.id+'_button").on("click",function(){return ga.altfile.button.call("'+m+'","'+d.id+'");});';break;case "text":ga.grid.newrow(l);d.label&&(b+=ga.grid.next(l,d.grid?d.grid.label:null,u)+'<label for="'+d.id+'"'+f+">"+d.label+"</label></div>");b+=ga.grid.next(l,d.grid?d.grid.data:null,u)+
    231 '<input type="text" id="'+d.id+'" name="'+d.id+'"'+f;d.required&&(b+=" required");d.readonly&&(b+=" readonly");d["default"]&&(b+=' value="'+d["default"]+'"');d.pattern&&(b+=' pattern="'+d.pattern+'"');d.maxlength&&(b+=' maxlength="'+d.maxlength+'"');d.size&&(b+=' size="'+d.size+'"');b+=">"+help_span+"</div>";break;case "integer":ga.grid.newrow(l);d.label&&(b+=ga.grid.next(l,d.grid?d.grid.label:null,u)+'<label for="'+d.id+'"'+f+">"+d.label+"</label></div>");b+=ga.grid.next(l,d.grid?d.grid.data:null,
    232 u)+'<input type="number" id="'+d.id+'" step="1" name="'+d.id+'"'+f;d.required&&(b+=" required");d.readonly&&(b+=" readonly");d["default"]&&(b+=' value="'+d["default"]+'"');d.pattern&&(b+=' pattern="'+d.pattern+'"');d.min&&(b+=' min="'+d.min+'"');d.max&&(b+=' max="'+d.max+'"');b+=">"+help_span+"</div>";break;case "float":ga.grid.newrow(l);d.label&&(b+=ga.grid.next(l,d.grid?d.grid.label:null,u)+'<label for="'+d.id+'"'+f+">"+d.label+"</label></div>");b+=ga.grid.next(l,d.grid?d.grid.data:null,u)+'<input type="number" id="'+
    233 d.id+'" name="'+d.id+'"'+f;d.required&&(b+=" required");d.readonly&&(b+=" readonly");d.required&&(b+=" required");d["default"]&&(b+=' value="'+d["default"]+'"');d.pattern&&(b+=' pattern="'+d.pattern+'"');d.step&&(b+=' step="'+d.step+'"');d.min&&(b+=' min="'+d.min+'"');d.max&&(b+=' max="'+d.max+'"');b+=">"+help_span+"</div>";break;case "textarea":ga.grid.newrow(l);d.label&&(b+=ga.grid.next(l,d.grid?d.grid.label:null,u)+'<label for="'+d.id+'"'+f+">"+d.label+"</label></div>");b+=ga.grid.next(l,d.grid?
    234 d.grid.data:null,u)+'<textarea id="'+d.id+'" name="'+d.id+'"'+f;d.required&&(b+=" required");b+=" readonly";d.fontfamily&&(b+=' style="font-family: '+d.fontfamily+';"');d.cols&&(b+=" cols="+d.cols);d.rows&&(b+=" rows="+d.rows);b+=">";d["default"]&&(b+=d["default"]);b+="</textarea>"+help_span+"</div>";break;case "checkbox":ga.grid.newrow(l);d.label&&(b+=ga.grid.next(l,d.grid?d.grid.label:null,u)+'<label for="'+d.id+'"'+f+">"+d.label+"</label></div>");b+=ga.grid.next(l,d.grid?d.grid.data:null,u)+'<input type="checkbox" id="'+
    235 d.id+'" name="'+d.id+'"'+f;d.checked&&(b+=" checked");d.readonly&&(b+=" readonly");b+=">"+help_span+"</div>";break;case "listbox":ga.grid.newrow(l);if(d.header){d.label&&ga.grid.next(l,d.grid?d.grid.label:null);b+='<div style="';if(d.fontfamily||d.fontsize)d.fontfamily&&(b+="font-family:"+d.fontfamily+";"),d.fontsize&&(b+="font-size:"+d.fontsize+";");b+=ga.grid.nextstyle(l,d.grid?d.grid.data:null,u);b+='"';d.width&&(d.header=d.header.padEnd(d.width));d.header=d.header.replace(/ /g,"&nbsp;");b+=">"+
    236 d.header+"</div>";ga.grid.newrow(l)}d.label&&(b+=ga.grid.next(l,d.grid?d.grid.label:null,u)+'<label for="'+d.id+'"'+f+">"+d.label+"</label></div>");b+=ga.grid.next(l,d.grid?d.grid.data:null,u)+'<select id="'+d.id+'" name="'+d.id+'"'+f;d.required&&(b+=" required");d.fontfamily&&(b+=' style="font-family: '+d.fontfamily+';"');d.size&&(b+=" size="+d.size);d.multiple&&(b+=" multiple");b+=">";if(!d.values){g+="No values for listbox "+d.id+". ";break}if(d.returns){if(d.returns&&d.returns.length!=d.values.length){g+=
    237 "Listbox values length ("+d.values.length+") does not equal return length ("+d.returns.length+") for listbox "+d.id+". ";break}for(f=0;f<d.values.length;++f)b+='<option value="'+d.returns[f]+'">'+d.values[f].replace(/ /g,"&nbsp")+"</option>"}else for(f=0;f<d.values.length;++f)b+='<option value="'+f+'">'+d.values[f].replace(/ /g,"&nbsp")+"</option>";d["default"]&&(h+='$("#'+d.id+" option[value='"+d["default"]+'\']").attr("selected", "true");');b+="</select>"+help_span+"</div>";break;default:g+="Unknown or currently unsupported field:type "+
    238 d.type+". "}b+="</form>"}else{b+='<form id="'+m+'"><table>';for(e=0;e<c._question.fields.length;++e)if(d=c._question.fields[e],d.id||(g+="No id in field "+e+". "),/^[A-Za-z][A-Za-z0-9_]*$/.test(d.id)||(g+="Invalid id for field "+e+' with id value "'+d.id+'". Only alpha in first character and alphanumeric and underscores subsequently allowed.'),d.type||(g+="No type in field "+e+". "),d.id&&d.type)switch(r[d.id]&&(g+="Duplicate id in _question fields:"+d.id+". "),r[d.id]=1,d.help?(f=' class="help_link"',
    239 l=' class="highlight help_link"',help_span='<span class="help">'+d.help+"</span>"):(f="",l=' class="highlight"',help_span=""),d.type){case "label":b+="<tr><td colspan=2><label"+f+">";d.label&&(b+=d.label);b+="</label>"+help_span+"</td></tr>";break;case "file":b+="<tr><td>";d.label&&(b+='<label for="'+d.id+'"'+f+">"+d.label+"</label>");b+='</td><td><input type="file" id="'+d.id+'" name="'+d.id+'[]"'+f;d.required&&(b+=" required");d.multiple&&(b+=" multiple");d.accept&&(b+=' accept="'+d.accept+'"');
    240 b+=">"+help_span+"</td></tr>";break;case "lrfile":b+="<tr><td>";d.label&&(b+='<label for="'+d.id+'"'+f+">"+d.label+"</label>");b+='</td><td><input type="file" id="'+d.id+'" name="'+d.id+'[]" data-add="'+d.id+'_altval"'+f;d.required&&(b+=" required");d.multiple&&(b+=" multiple");d.accept&&(b+=' accept="'+d.accept+'"');b+=">"+help_span+' or <button id="'+d.id+'_button" name="'+d.id+'_button" data-type="lrfile"'+f+'><span class="buttontext">Browse server</span></button>'+help_span+'</td><td><span id="'+
    241 d.id+'_altval"></td></span><input type="hidden" name="_selaltval_'+d.id+'" value="'+d.id+'_altval"</input></td></tr>';h+='ga.altfile("'+m+'","'+d.id+'","'+d.id+'_altval" );$( "#'+m+'" ).change( function(){ $( "#'+d.id+'_altval" ).html( "<i>Local</i>: " + $( "#'+d.id+'" ).val().replace(/^C:.fakepath./,""));});ga.altfile.button( "'+m+'","'+d.id+'","'+d.label+'","rfile",function(v){ga.altfile.button.lrfile(v,"'+m+'","'+d.id+'")}';d.required&&(h+=',"lrfile"');h+=");";h+='$("#'+d.id+'_button").on("click",function(){return ga.altfile.button.call("'+
    242 m+'","'+d.id+'");});';break;case "text":b+="<tr><td>";d.label&&(b+='<label for="'+d.id+'"'+f+">"+d.label+"</label>");b+='</td><td><input type="text" id="'+d.id+'" name="'+d.id+'"'+f;d.required&&(b+=" required");d.readonly&&(b+=" readonly");d["default"]&&(b+=' value="'+d["default"]+'"');d.pattern&&(b+=' pattern="'+d.pattern+'"');d.maxlength&&(b+=' maxlength="'+d.maxlength+'"');d.size&&(b+=' size="'+d.size+'"');b+=">"+help_span+"</td></tr>";break;case "integer":b+="<tr><td>";d.label&&(b+='<label for="'+
    243 d.id+'"'+f+">"+d.label+"</label>");b+='</td><td><input type="number" id="'+d.id+'" step="1" name="'+d.id+'"'+f;d.required&&(b+=" required");d.readonly&&(b+=" readonly");d["default"]&&(b+=' value="'+d["default"]+'"');d.pattern&&(b+=' pattern="'+d.pattern+'"');d.min&&(b+=' min="'+d.min+'"');d.max&&(b+=' max="'+d.max+'"');b+=">"+help_span+"</td></tr>";break;case "float":b+="<tr><td>";d.label&&(b+='<label for="'+d.id+'"'+f+">"+d.label+"</label>");b+='</td><td><input type="number" id="'+d.id+'" name="'+
    244 d.id+'"'+f;d.required&&(b+=" required");d.readonly&&(b+=" readonly");d.required&&(b+=" required");d["default"]&&(b+=' value="'+d["default"]+'"');d.pattern&&(b+=' pattern="'+d.pattern+'"');d.step&&(b+=' step="'+d.step+'"');d.min&&(b+=' min="'+d.min+'"');d.max&&(b+=' max="'+d.max+'"');b+=">"+help_span+"</td></tr>";break;case "textarea":b+="<tr><td>";d.label&&(b+='<label for="'+d.id+'"'+f+">"+d.label+"</label>");b+='</td><td><textarea id="'+d.id+'" name="'+d.id+'"'+f;d.required&&(b+=" required");b+=
    245 " readonly";d.fontfamily&&(b+=' style="font-family: '+d.fontfamily+';"');d.cols&&(b+=" cols="+d.cols);d.rows&&(b+=" rows="+d.rows);b+=">";d["default"]&&(b+=d["default"]);b+="</textarea>"+help_span+"</td></tr>";break;case "checkbox":b+="<tr><td>";d.label&&(b+='<label for="'+d.id+'"'+l+">"+d.label+"</label>");b+='</td><td><input type="checkbox" id="'+d.id+'" name="'+d.id+'"'+f;d.checked&&(b+=" checked");d.readonly&&(b+=" readonly");b+=">"+help_span+"</td></tr>";break;case "listbox":if(d.header){b+=
    246 "<tr><td colspan=2";if(d.fontfamily||d.fontsize)b+=' style="',d.fontfamily&&(b+="font-family:"+d.fontfamily+";"),d.fontsize&&(b+="font-size:"+d.fontsize+";"),b+='"';d.width&&(d.header=d.header.padEnd(d.width));d.header=d.header.replace(/ /g,"&nbsp;");b+=">"+d.header+"</td></tr>"}b+="<tr><td>";d.label&&(b+='<label for="'+d.id+'"'+l+">"+d.label+"</label>");b+="</td>";b=d.size&&1<d.size?b+"</tr><tr><td colspan=2>":b+"<td>";b+='<select id="'+d.id+'" name="'+d.id+'"'+f;d.required&&(b+=" required");d.fontfamily&&
    247 (b+=' style="font-family: '+d.fontfamily+';"');d.size&&(b+=" size="+d.size);d.multiple&&(b+=" multiple");b+=">";if(!d.values){g+="No values for listbox "+d.id+". ";break}if(d.returns){if(d.returns&&d.returns.length!=d.values.length){g+="Listbox values length ("+d.values.length+") does not equal return length ("+d.returns.length+") for listbox "+d.id+". ";break}for(f=0;f<d.values.length;++f)b+='<option value="'+d.returns[f]+'">'+d.values[f].replace(/ /g,"&nbsp")+"</option>"}else for(f=0;f<d.values.length;++f)b+=
    248 '<option value="'+f+'">'+d.values[f].replace(/ /g,"&nbsp")+"</option>";d["default"]&&(h+='$("#'+d.id+" option[value='"+d["default"]+'\']").attr("selected", "true");');b+="</select>"+help_span+"</td></tr>";break;default:g+="Unknown or currently unsupported field:type "+d.type+". "}b+="</table></form>"}if(c._question.buttons&&c._question.buttons.length)for(e=0;e<c._question.buttons.length;++e)switch(d=c._question.buttons[e],typeof d){case "string":bid=d.replace(/\W/g,"").toLowerCase();r[bid]&&(g+="Duplicate id in _question fields & buttons:"+
    249 bid+". ");r[bid]=1;k.push({id:bid,label:d,cb:ga.qr.cb,adata:[c,bid,d.skiprequired?0:1]});break;case "object":!d.id&&d.label&&(d.id=d.label.replace(/\W/g,"").toLowerCase());d.id?(r[d.id]&&(g+="Duplicate id in _question fields & buttons:"+d.id+". "),r[d.id]=1,d.id!=d.id.replace(/\W/g,"")&&(g+="Buttons array object entry "+(e+1)+" id is not pure alphanumeric. ")):g+="Buttons array object entry "+(e+1)+" does not have an id. ";d.label||(g+="Buttons array object entry "+(e+1)+" does not have a label. ");
    250 if(!g.length){k.push({id:d.id,label:d.label,cb:ga.qr.cb,adata:[c,d.id,d.skiprequired?0:1]});d.help&&(k[k.length-1].help=d.help);break}break;default:g+="Buttons array entry "+(e+1)+" unknown type: "+typeof d+". "}else bid="ok",r[bid]&&(g+="Duplicate id in _question fields & buttons:"+bid+". "),r[bid]=1,bid="cancel",r[bid]&&(g+="Duplicate id in _question fields & buttons:"+bid+". "),r[bid]=1,k=[{id:"ok",label:"OK",cb:ga.qr.cb,adata:[c,"ok",1]},{id:"cancel",label:"Cancel",cb:ga.qr.cb,adata:[c,"cancel",
    251 0]}];if(g.length)return ga.qr.rerror(c,g);ga.qr.openq[m]="open";ga.msg.box({icon:c._question.icon?c._question.icon:"question.png",noclose:1,closeif:1,text:b+"<p></p>",eval:'$("#'+m+'").on("keyup keypress", function(e) { var code = e.keyCode || e.which;  if (code  == 13) { e.preventDefault(); return false; }});'+h,buttons:k,ptext:"<p></p>"},0,2)};
    252 ga.qr.cb=function(a,c,b){var e=a._uuid+"-"+a._msgid;if(ga.qr.openq[e])switch(ga.qr.openq[e]){case "open":break;case "answered":return ga.msg.box({icon:"information.png",text:"Question has already been answered in another session"}),delete ga.qr.openq[e],!0;case "timeout":return ga.msg.box({icon:"information.png",text:"The time for answering a question has expired"}),delete ga.qr.openq[e],!0;default:return ga.msg.box({icon:"toast.png",text:"Internal error, unknown message state"}),delete ga.qr.openq[e],
    253 !0}else return ga.msg.box({icon:"warning.png",text:a._question.requiredmsg?a._question.requiredmsg:"Not all required fields have been entered."}),!0;if(b){var f=!1;$("#"+e+" *").filter(":input").each(function(){if(this.required){var a=!0;this.dataset&&"rfile_val"==this.dataset.type&&this.value.length&&(a=!1);if(a)switch(this.type){case "text":case "number":case "select-one":this.value.length||(f=!0);break;case "select-multiple":($("#"+this.id).val()||[]).length()||(f=!0);break;case "file":0==this.files.length&&
    254 (f=!0)}}});if(f)return ga.msg.box({icon:"warning.png",text:a._question.requiredmsg?a._question.requiredmsg:"Not all required fields have been entered."}),!1}delete ga.qr.openq[e];var d={};d._uuid=a._uuid;d._msgid=parseFloat(a._msgid);d._response={};d._response.button=c;a._question&&a._question.id&&(d._response.id=a._question.id);var g=!1;$("#"+e+" *").filter(":input").each(function(){this.dataset&&"rfile_val"==this.dataset.type&&this.value.length&&(g=!0);switch(this.type){case "text":case "number":case "select-one":d._response[this.id]=
    255 this.value;break;case "select-multiple":d._response[this.id]=$("#"+this.id).val()||[];break;case "checkbox":this.checked&&(d._response[this.id]=!0);break;case "file":0==this.files.length?this.remove():g=!0}});g?ga.qr.postfiles(e,d):ga.qr.post(d);return!0};ga.qr.answered=function(a,c){var b;c._uuid&&c._msgid&&(b=c._uuid+"-"+c._msgid,ga.qr.openq[b]&&(ga.qr.openq[b]="answered"))};ga.qr.timeout=function(a,c){var b;c._uuid&&c._msgid&&(b=c._uuid+"-"+c._msgid,ga.qr.openq[b]&&(ga.qr.openq[b]="timeout"))};
    256 ga.qr.rerror=function(a,c){var b={};b._uuid=a._uuid;b._msgid=parseFloat(a._msgid);b._response={};b._response.error=c;a._question&&a._question.id&&(b._response.id=a._question.id);ga.qr.post(b);ga.msg.box({icon:"toast.png",text:c})};
    257 ga.qr.post=function(a){$.ajax({url:ga.qr.url,data:{_window:window.name,_data:a},dataType:"json",method:"POST"}).success(function(a){a.error&&a.error.length&&ga.msg.box({icon:"toast.png",text:"ajax data error: "+a.error,buttons:[{id:"ok",label:"OK"}]})}).error(function(a){console.log("ajax error");console.dir(a);ga.msg.box({icon:"toast.png",text:"ajax error: "+a.statusText,buttons:[{id:"ok",label:"OK"}]})})};
    258 ga.qr.postfiles=function(a,c){var b="#"+a+"_progress";ga.msg.box({icon:"information.png",noclose:1,text:'Uploading files:<progress id="'+a+'_progress"></progress>'});var e=new FormData($("#"+a)[0]);e.append("_window",window.name);e.append("_logon",$("#_state").data("_logon"));e.append("_uuid",c._uuid);$.ajax({dataType:"json",cache:!1,type:"POST",url:"ajax/sys/uploader.php",data:e,xhr:function(){var a=$.ajaxSettings.xhr();a.upload&&a.upload.addEventListener("progress",function(a){a.lengthComputable&&
    259 $(b).attr({value:a.loaded,max:a.total})},!1);return a},contentType:!1,processData:!1}).success(function(b){ga.msg.close(3);if(b.error&&b.error.length)delete ga.qr.openq[a],ga.qr.rerror(c,"ajax data error: "+b.error);else{if(b.files)for(var d in b.files)b.files.hasOwnProperty(d)&&(c[d]=b.files[d]);ga.qr.post(c)}}).error(function(b){ga.msg.close(3);console.log("ajax error");console.dir(b);delete ga.qr.openq[a];ga.qr.rerror(c,"ajax error: "+b.statusText)})};ga.msg={};
    260 ga.msg.box=function(a,c,b){b=b||3;if(!c&&$(".modalDialog"+b).hasClass("modalDialog"+b+"_on")){c=$("#_state").data("__msgs");if(!c||c&&"[object Array]"!=Object.prototype.toString.call(c))c=[];c.push(a);$("#_state").data("__msgs",c)}else{a.icon?$("#configbody"+b).html("<table style='width:95%;vertical-align:middle'><tr><td style='width:10%'><img src='pngs/"+a.icon+"' width=40px></td><td style='text-align:center'>"+a.text+"</td></tr></table>"):$("#configbody"+b).html("<center>"+a.text+"</center>");a.noclose?
    261 $("#closeModal"+b).hasClass("close"+b)&&$("#closeModal"+b).removeClass("close"+b).empty():4>b&&!$("#closeModal"+b).hasClass("close"+b)&&$("#closeModal"+b).addClass("close"+b).html("X");if(a.buttons){tmp="<center><table><tr>";for(i=0;i<a.buttons.length;i++)tmp=a.buttons[i].help?tmp+'<td><button id="_mbb_'+a.buttons[i].id+'" class="help_link">'+a.buttons[i].label+'</button><span class="help">'+a.buttons[i].help+"</span></td>":tmp+'<td><button id="_mbb_'+a.buttons[i].id+'">'+a.buttons[i].label+"</button></td>";
    262 tmp+="</tr></table><center>";$("#configbody"+b).append(tmp);for(i=0;i<a.buttons.length;i++)if(a.buttons[i].cb)if(a.buttons[i].adata)switch(a.buttons[i].adata.length){case 2:if(a.closeif)$("#_mbb_"+a.buttons[i].id).off().on("click",a.buttons[i],function(a){a.data.cb(a.data.adata[0],a.data.adata[1])&&ga.msg.close(b)});else $("#_mbb_"+a.buttons[i].id).off().one("click",a.buttons[i],function(a){a.data.cb(a.data.adata[0],a.data.adata[1]);ga.msg.close(b)});break;case 3:if(a.closeif)$("#_mbb_"+a.buttons[i].id).off().on("click",
    263 a.buttons[i],function(a){a.data.cb(a.data.adata[0],a.data.adata[1],a.data.adata[2])&&ga.msg.close(b)});else $("#_mbb_"+a.buttons[i].id).off().one("click",a.buttons[i],function(a){a.data.cb(a.data.adata[0],a.data.adata[1],a.data.adata[2]);ga.msg.close(b)});break;case 4:$("#_mbb_"+a.buttons[i].id).off().one("click",a.buttons[i],function(a){a.data.cb(a.data.adata[0],a.data.adata[1],a.data.adata[2],a.data.adata[3]);ga.msg.close(b)});break;case 5:$("#_mbb_"+a.buttons[i].id).off().one("click",a.buttons[i],
    264 function(a){a.data.cb(a.data.adata[0],a.data.adata[1],a.data.adata[2],a.data.adata[3],a.data.adata[4]);ga.msg.close(b)});break;case 6:$("#_mbb_"+a.buttons[i].id).off().one("click",a.buttons[i],function(a){a.data.cb(a.data.adata[0],a.data.adata[1],a.data.adata[2],a.data.adata[3],a.data.adata[4],a.data.adata[5]);ga.msg.close(b)});break;default:console.warn("in ga.msg.box unsupported number of adata arguments "+a.buttons[i].adata.length)}else $("#_mbb_"+a.buttons[i].id).off().one("click",a.buttons[i],
    265 function(a){a.data.cb(a.data.data);ga.msg.close(b)});else $("#_mbb_"+a.buttons[i].id).off().one("click",a.buttons[i],function(a){ga.msg.close(b)})}a.ptext&&$("#configbody"+b).append(a.ptext);a.eval&&eval(a.eval);ga.repeats.save();ga.hhelp.reset();$(".modalDialog"+b).addClass("modalDialog"+b+"_on")}};ga.msg.close1=function(){ga.repeats.restore();$(".modalDialog").removeClass("modalDialog_on");setTimeout(function(){$("#configbody").empty()},400);ga.usesplash&&setTimeout(function(){splashlogin()},500)};
    266 ga.msg.close2=function(){ga.repeats.restore();$(".modalDialog2").removeClass("modalDialog2_on");$("#configbody2").empty();ga.usesplash&&setTimeout(function(){splashlogin()},500)};ga.msg.close3=function(){ga.repeats.restore();$(".modalDialog3").removeClass("modalDialog3_on");$("#configbody3").empty();var a=$("#_state").data("__msgs");if(a&&a.length){var c=a.shift();$("#_state").data("__msgs",a);ga.msg.box(c,1)}ga.usesplash&&setTimeout(function(){splashlogin()},500)};
     206ga.calc.register=function(a,b,d){ga.calc.data[a]=ga.calc.data[a]||{};ga.calc.data[a].calc=ga.calc.data[a].calc||{};ga.calc.data[a].calc[b]={};ga.calc.data[a].calc[b].calc=d;ga.calc.data[a].calc[b].tokens=ga.calc.tokens(d);ga.calc.data[a].calc[b].tokens._error?ga.msg.box({icon:"toast.png",text:"Module field calc internal error: "+ga.calc.data[a].calc[b].tokens._error+" in calc field id "+b}):(ga.calc.repeatertokens(a,b),ga.calc.data[a].calc[b].dependents=ga.calc.dependents(a,b),99<ga.calc.depthofdeps(a,
     207b)?ga.msg.box({icon:"toast.png",text:"Module field calc internal error: maximum recursion depth found in calc field id "+b}):(ga.calc.data[a].calc[b].tree=ga.calc.mktree(ga.calc.data[a].calc[b].tokens),ga.calc.data[a].calc[b].tree._error?ga.msg.box({icon:"toast.png",text:"Module field calc internal error: "+ga.calc.data[a].calc[b].tree._error+" in calc field id "+b}):ga.calc.install(a,b)))};
     208ga.calc.repeatertokens=function(a,b){if(/-/.test(b)){var d=b.split("-");if(/\d+/.test(d[d.length-1])){var e=d.slice(0,d.length-2).join(":")+":";d=":"+d[d.length-1]}else e=d.slice(0,d.length-1).join(":")+":",d="";for(i in ga.calc.data[a].calc[b].tokens)ga.calc.is_atom_id.test(ga.calc.data[a].calc[b].tokens[i])&&!$("#"+ga.calc.data[a].calc[b].tokens[i]).length&&(ga.calc.data[a].calc[b].tokens[i]=e+ga.calc.data[a].calc[b].tokens[i]+d)}};
     209ga.calc.depthofdeps=function(a,b,d){var e,h=0;d=d||0;ga.calc.data[a].calc[b].dependents&&d++;if(99<d)return d;for(e=0;e<ga.calc.data[a].calc[b].dependents.length;++e)if(ga.calc.data[a].calc[ga.calc.data[a].calc[b].dependents[e]]){var g=ga.calc.depthofdeps(a,ga.calc.data[a].calc[b].dependents[e],d);h<g&&(h=g)}return d+h};
     210ga.calc.dependents=function(a,b){var d,e=[];for(d in ga.calc.data[a].calc[b].tokens)ga.calc.is_atom_id.test(ga.calc.data[a].calc[b].tokens[d])&&e.push(ga.calc.data[a].calc[b].tokens[d]);return e};ga.calc.install=function(a,b){for(var d in ga.calc.data[a].calc[b].dependents)$("#"+ga.calc.data[a].calc[b].dependents[d].replace(/:/g,"-")).on("change",function(){ga.calc.process(a,b)})};
     211ga.calc.process=function(a,b){var d=ga.calc.evaltree(jQuery.extend(!0,{},ga.calc.data[a].calc[b].tree));d._error?ga.msg.box({icon:"toast.png",text:"Module field calc internal error: "+ga.calc.data[a].calc[b].tokens._error+" in calc field id "+b}):$("#"+b).val(d).trigger("change")};
     212ga.calc.tokens=function(a){var b=[],d=[],e=RegExp("^("+ga.calc.str_function_paren+"|"+ga.calc.str_atom_id+"|"+ga.calc.str_paren+"|"+ga.calc.str_atom_numeric+"|"+ga.calc.str_function_no_paren+")"),h=RegExp("^("+ga.calc.str_binary+"|"+ga.calc.str_close_paren+")"),g=500;a=a.replace(/\s+/g,"");d.push(0);do{if(0<d.length&&d[d.length-1]){var m=h.exec(a);if(!m)return{_error:"Invalid token found "+a};if(ga.calc.is_close_paren.test(m[0])){if(!d.length)return{_error:"Invalid closing parenthesis "+a};d.pop()}else d[d.length-
     2131]=0}else{m=e.exec(a);if(!m)return{_error:"Invalid token found "+a};if(ga.calc.is_atom.test(m[0]))d[d.length-1]=1;else if(ga.calc.is_open_paren.test(m[0]))d.push(0);else if(ga.calc.is_close_paren.test(m[0])){if(!d.length)return{_error:"Invalid closing parenthesis "+a};d.pop()}else ga.calc.is_function_paren.test(m[0])&&d.push(0)}a=a.substring(m[0].length);b.push(m[0])}while(m&&m.length&&a.length&&0<--g);return 0>=g?{_error:"maximum token limit of 500 reached"}:b};
     214ga.calc.parensub=function(a){for(var b=1,d={a:[]},e=1;e<a.length;++e){if(")"==a[e]&&(b--,0==b))return d.newofs=e,d;d.a.push(a[e]);/\($/.test(a[e])&&b++}return{_error:"Closing parenthesis error"}};
     215ga.calc.mktree=function(a,b){for(var d=[],e=null,h,g,m=0;m<a.length;++m){token=a[m];if(ga.calc.is_function_paren.test(token)){h=ga.calc.parensub(a.slice(m));if(h._error)return h;m+=h.newofs;token={op:token,args:[h=ga.calc.mktree(h.a)]};g=1;if(h._error)return h}else if(ga.calc.is_open_paren.test(token)){h=ga.calc.parensub(a.slice(m));if(h._error)return h;m+=h.newofs;token=ga.calc.mktree(h.a);if(token._error)return token;g=1}else g=0;g||ga.calc.is_atom.test(token)?(d.push(token),e&&(b?ga.calc.precedence[e]<
     216ga.calc.precedence[b.op]?(console.log("replace 2nd arg"),b.args[1]={op:e,args:[b.args[1],token]}):(console.log("replace parent object"),b={op:e,args:[b,token]}):(b={op:e,args:d},e=null,d=[]))):ga.calc.is_binary.test(token)&&(e=token)}!b&&d.length&&(b={op:"()",args:d});return b};
     217ga.calc.arraytovals=function(a){var b;if(a.constructor===Array)for(b=0;b<a.length;++b)a[b]=Number(ga.calc.is_atom_id.test(a[b])?$("#"+a[b].replace(/:/g,"-")).val():a[b]);else a=Number(ga.calc.is_atom_id.test(a)?$("#"+a.replace(/:/g,"-")).val():a);return a};
     218ga.calc.evaltree=function(a){var b,d;var e=1;if(!a)return{_error:"no object in ga.calc.evaltree"};if(a._error)return a;if(!a.op)return{_error:"no op in object in ga.calc.evaltree"};if(!a.args)return{_error:"no args in object in ga.calc.evaltree"};if(1>a.args.length||2<a.args.length)return{_error:"args incorrect length in object in ga.calc.evaltree"};(b=2==a.args.length)&&"undefined"==typeof a.args[1]&&(b=0);"undefined"==typeof a.args[0]&&(e=0);e&&a.args[0].op&&(a.args[0]=ga.calc.evaltree(a.args[0]));
     219b&&a.args[1].op&&(a.args[1]=ga.calc.evaltree(a.args[1]));e&&(a.args[0]=ga.calc.arraytovals(a.args[0]),b&&(a.args[1]=ga.calc.arraytovals(a.args[1])));e=e&&a.args[0].constructor===Array;if(b){var h=a.args[1].constructor===Array;var g=e||h;if(d=e&&h)if(a.args[0].length<a.args[1].length){var m=a.args[0];var l=a.args[1];var f=1}else m=a.args[1],l=a.args[0],f=0;else if(g){l=a.args[e?0:1];var p=a.args[e?1:0]}}switch(a.op){case ",":g=e?a.args[0]:[a.args[0]];b&&"undefined"!=typeof a.args[1]&&(g=g.concat(h?
     220a.args[1]:[a.args[1]]));break;case "()":b?(g=e?a.args[0]:[a.args[0]],b&&a.args[1]&&(g=g.concat(h?a.args[1]:[a.args[1]]))):g=a.args[0];break;case "+":if(!b)return{_error:"operator : "+a.op+" is binary and only has one argument"};if(g)if(g=l,d)for(b=0;b<m.length;++b)g[b]+=m[b];else for(b=0;b<l.length;++b)g[b]+=p;else g=a.args[0]+a.args[1];break;case "*":if(!b)return{_error:"operator : "+a.op+" is binary and only has one argument"};if(g)if(g=l,d)for(b=0;b<m.length;++b)g[b]*=m[b];else for(b=0;b<l.length;++b)g[b]*=
     221p;else g=a.args[0]*a.args[1];break;case "-":if(!b)return{_error:"operator : "+a.op+" is binary and only has one argument"};if(g)if(d){g=a.args[0];for(b=0;b<m.length;++b)g[b]-=a.args[1][b];if(f)for(b=a.args[0].length;b<a.args[1].length;++b)g.push(-a.args[1][b]);else for(b=a.args[1].length;b<a.args[0].length;++b)g.push(a.args[0][b])}else if(e)for(g=a.args[0],b=0;b<a.args[0].length;++b)g[b]-=a.args[1];else for(g=[],b=0;b<a.args[1].length;++b)g.push(a.args[0]-a.args[1][b]);else g=a.args[0]-a.args[1];
     222break;case "/":if(!b)return{_error:"operator : "+a.op+" is binary and only has one argument"};if(g)if(d){g=a.args[0];for(b=0;b<m.length;++b)g[b]/=a.args[1][b];if(f)for(b=a.args[0].length;b<a.args[1].length;++b)g.push(0);else for(b=a.args[1].length;b<a.args[0].length;++b)g.push(a.args[0][b]/0)}else if(e)for(g=a.args[0],b=0;b<a.args[0].length;++b)g[b]/=a.args[1];else for(g=[],b=0;b<a.args[1].length;++b)g.push(a.args[0]/a.args[1][b]);else g=a.args[0]/a.args[1];break;case "^":if(!b)return{_error:"operator : "+
     223a.op+" is binary and only has one argument"};if(g)if(d){g=a.args[0];for(b=0;b<m.length;++b)g[b]=Math.pow(g[b],a.args[1][b]);if(f)for(b=a.args[0].length;b<a.args[1].length;++b)g.push(0);else for(b=a.args[1].length;b<a.args[0].length;++b)g.push(1)}else if(e)for(g=a.args[0],b=0;b<a.args[0].length;++b)g[b]=pow(g[b],a.args[1]);else for(g=[],b=0;b<a.args[1].length;++b)g.push(pow(a.args[0],a.args[1][b]));else g=Math.pow(a.args[0],a.args[1]);break;case "abs(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};
     224g=a.args[0];if(e)for(b=0;b<g.length;++b)g[b]=Math.abs(g[b]);else g=Math.abs(a.args[0]);break;case "acos(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};g=a.args[0];if(e)for(b=0;b<g.length;++b)g[b]=Math.acos(g[b]);else g=Math.acos(a.args[0]);break;case "asin(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};g=a.args[0];if(e)for(b=0;b<g.length;++b)g[b]=Math.asin(g[b]);else g=Math.asin(a.args[0]);break;case "atan(":if(b)return{_error:"operator : "+
     225a.op+" has 2 arguments but only accepts one"};g=a.args[0];if(e)for(b=0;b<g.length;++b)g[b]=Math.atan(g[b]);else g=Math.atan(a.args[0]);break;case "ceil(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};g=a.args[0];if(e)for(b=0;b<g.length;++b)g[b]=Math.ceil(g[b]);else g=Math.ceil(a.args[0]);break;case "cos(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};g=a.args[0];if(e)for(b=0;b<g.length;++b)g[b]=Math.cos(g[b]);else g=Math.cos(a.args[0]);
     226break;case "exp(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};g=a.args[0];if(e)for(b=0;b<g.length;++b)g[b]=Math.exp(g[b]);else g=Math.exp(a.args[0]);break;case "floor(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};g=a.args[0];if(e)for(b=0;b<g.length;++b)g[b]=Math.floor(g[b]);else g=Math.floor(a.args[0]);break;case "log(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};g=a.args[0];if(e)for(b=0;b<g.length;++b)g[b]=
     227Math.log(g[b]);else g=Math.log(a.args[0]);break;case "random(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};g=a.args[0];if(e)for(b=0;b<g.length;++b)g[b]=Math.random();else g=Math.random();break;case "round(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};g=a.args[0];if(e)for(b=0;b<g.length;++b)g[b]=Math.round(g[b]);else g=Math.round(a.args[0]);break;case "sin(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};
     228g=a.args[0];if(e)for(b=0;b<g.length;++b)g[b]=Math.sin(g[b]);else g=Math.sin(a.args[0]);break;case "sqrt(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};g=a.args[0];if(e)for(b=0;b<g.length;++b)g[b]=Math.sqrt(g[b]);else g=Math.sqrt(a.args[0]);break;case "tan(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};g=a.args[0];if(e)for(b=0;b<g.length;++b)g[b]=Math.tan(g[b]);else g=Math.tan(a.args[0]);break;case "max(":if(b)return{_error:"operator : "+
     229a.op+" has 2 arguments but only accepts one"};g=e?Math.max.apply(null,a.args[0]):a.args[0];break;case "min(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};g=e?Math.min.apply(null,a.args[0]):a.args[0];break;case "atan2(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};if(!e)return{_error:"operator : "+a.op+"  needs the first argument to be an even sized array"};g=[];for(b=0;b<a.args[0].length;b+=2)g.push(Math.atan2(a.args[0][b],a.args[0][b+
     2301]));break;case "pow(":if(b)return{_error:"operator : "+a.op+" has 2 arguments but only accepts one"};if(!e)return{_error:"operator : "+a.op+"  needs the first argument to be an even sized array"};g=[];for(b=0;b<a.args[0].length;b+=2)g.push(Math.pow(a.args[0][b],a.args[0][b+1]));1==g.length&&(g=g[0]);break;default:return{_error:"operator : "+a.op+" unknown or unsupported"}}return g};ga.bokeh={};ga.bokeh.data={};
     231ga.bokeh.getdata=function(a,b){a={};b=b.split(/\r?\n/);var d=b.length,e,h=0;for(e=0;e<d;++e)if(h||-1!==b[e].indexOf("var docs_json ="))if(!h)h=1,a.docs_json=$.parseJSON(b[e].replace(/^\s*var\s+docs_json\s+=\s+/,"").replace(/(^'|('|);$)/g,""));else if(1==h&&-1!==b[e].indexOf("var render_items =")){a.render_items=$.parseJSON(b[e].replace(/^\s*var\s+render_items\s+=\s+/,"").replace(/;$/,""));break}return a};
     232ga.bokeh.render=function(a,b,d){d=ga.bokeh.getdata(b,d);a+="_output";ga.bokeh.savedata(a,b,d);ga.bokeh.renderdata(a,b)};
     233ga.bokeh.renderdata=function(a,b){var d,e="";if(ga.bokeh.data[a]&&ga.bokeh.data[a][b]&&ga.bokeh.data[a][b].docs_json&&ga.bokeh.data[a][b].render_items){var h=ga.bokeh.data[a][b].render_items.length;for(d=0;d<h;++d){var g=ga.bokeh.data[a][b].render_items[d].elementid;if(!g){c=0;for(k in ga.bokeh.data[a][b].render_items[d].roots)ga.bokeh.data[a][b].render_items[d].roots.hasOwnProperty(k)&&(g=ga.bokeh.data[a][b].render_items[d].roots[k]),++c;1<c&&console.error("ga.bokeh.renderdata( "+a+", "+b+" ) - no bokeh more than one doc id")}g||
     234console.error("ga.bokeh.renderdata( "+a+", "+b+" ) - no bokeh doc id found");e+='<div class="bk-root"><div class="bk-plotdiv" id="'+g+'"></div></div>'}$("#"+b).html(e);Bokeh.embed.embed_items(ga.bokeh.data[a][b].docs_json,ga.bokeh.data[a][b].render_items)}};ga.bokeh.savedata=function(a,b,d){ga.bokeh.data[a]=ga.bokeh.data[a]||{};ga.bokeh.data[a][b]=d};ga.bokeh.reset=function(a,b){ga.bokeh.data[a]&&ga.bokeh.data[a][b]&&(ga.bokeh.data[a][b]={},$("#"+b).empty())};ga.grid={};
     235ga.grid.rc=function(a,b,d,e){var h="";a&&d&&a<d-1?h+="grid-row-start:"+a+";grid-row-end:"+d+";":a&&(h+="grid-row:"+a+";");b&&e&&b<e-1?h+="grid-column-start:"+b+";grid-column-end:"+e+";":b&&(h+="grid-column:"+b+";");return h};ga.grid.rcs=function(a,b,d,e){return'style="'+ga.grid.rc(a,b,d,e)+'"'};ga.grid.drcs=function(a,b,d,e,h,g){h=(h||"")+ga.grid.rc(a,b,d,e);return g?'<div class="'+g+'" style="'+h+'">':'<div style="'+h+'">'};ga.grid.init=function(){return{row:0,col:1}};
     236ga.grid.newrow=function(a){a.row++;a.col=1};ga.grid.next=function(a,b,d,e){a=a||{row:1,col:1};if(b){a.col=b[0]?b[0]:a.col;var h=b[1]?b[1]+a.col:a.col;a.row=b[2]?b[2]:a.row;var g=b[3]?b[3]+a.row:a.row}else h=a.col,g=a.row;b=a.col;a.col=h+1;return ga.grid.drcs(a.row,b,g,h,d,e)};
     237ga.grid.nextstyle=function(a,b,d){d=d||"";a=a||{row:1,col:1};if(b){a.col=b[0]?b[0]:a.col;var e=b[1]?b[1]+a.col:a.col;a.row=b[2]?b[2]:a.row;var h=b[3]?b[3]+a.row:a.row}else e=a.col,h=a.row;b=a.col;a.col=e+1;return ga.grid.rc(a.row,b,h,e,d)+d};ga.qr={};ga.qr.openq={};
     238ga.qr.question=function(a,b){a="";var d,e="",h="",g=[],m={};b._uuid||(e+="no _uuid in received data. ");b._msgid||(e+="no _msgid in received data. ");b._question||(e+="no _question in received data. ");b._question.fields||(e+="no _question:fields in received data. ");if(e.length)return ga.qr.rerror(b,e);b._question.title&&(a+="<h3>"+b._question.title+"</h3>");b._question.text&&(a+=b._question.text);var l=b._uuid+"-"+b._msgid;if(b._question.grid){ga.grid.align=ga.grid.align||"left";var f="display:grid;grid-gap:";
     239var p=ga.grid.init();if("object"===typeof b._question.grid){b._question.grid.colwidths?"object"!==typeof b._question.grid.colwidths&&(e+=" _question:grid:colwidths specified, but it is not an array."):e+=" _question:grid specified, but it is not a number and colwidths not defined.";if(e.length)return ga.qr.rerror(b,e);f=b._question.grid.gap?f+b._question.grid.gap:f+"10px";f+=";grid-template-columns:";for(d=0;d<b._question.grid.colwidths.length;++d)f+=b._question.grid.colwidths[d]+"fr "}else for(f+=
     240"10px;grid-template-columns:auto ",2>b._question.grid&&(b._question.grid=2),d=1;d<b._question.grid;++d)f+=" auto";a+='<form id="'+l+'" style="'+(f+';">');for(d=row_start=0;d<b._question.fields.length;++d)if(f=b._question.fields[d],f.id||(e+="No id in field "+d+". "),/^[A-Za-z][A-Za-z0-9_]*$/.test(f.id)||(e+="Invalid id for field "+d+' with id value "'+f.id+'". Only alpha in first character and alphanumeric and underscores subsequently allowed.'),f.type||(e+="No type in field "+d+". "),f.id&&f.type){var q=
     241"text-align:"+(f.grid&&f.grid.align?f.grid.align:ga.grid.align)+";";m[f.id]&&(e+="Duplicate id in _question fields:"+f.id+". ");m[f.id]=1;if(f.help){var n=' class="help_link"';help_span='<span class="help">'+f.help+"</span>"}else help_span=n="";switch(f.type){case "label":ga.grid.newrow(p);a+=ga.grid.next(p,f.grid?f.grid.label:null,q)+"<label"+n+">";f.label&&(a+=f.label);a+="</label>"+help_span+"</div>";break;case "file":ga.grid.newrow(p);f.label&&(a+=ga.grid.next(p,f.grid?f.grid.label:null,q)+'<label for="'+
     242f.id+'"'+n+">"+f.label+"</label></div>");a+=ga.grid.next(p,f.grid?f.grid.data:null,q)+'<input type="file" id="'+f.id+'" name="'+f.id+'[]"'+n;f.required&&(a+=" required");f.multiple&&(a+=" multiple");f.accept&&(a+=' accept="'+f.accept+'"');a+=">"+help_span+"</div>";break;case "lrfile":ga.grid.newrow(p);f.label&&(a+=ga.grid.next(p,f.grid?f.grid.label:null,q)+'<label for="'+f.id+'"'+n+">"+f.label+"</label></div>");a+=ga.grid.next(p,f.grid?f.grid.data:null,q)+'<input type="file" id="'+f.id+'" name="'+
     243f.id+'[]" data-add="'+f.id+'_altval"'+n;f.required&&(a+=" required");f.multiple&&(a+=" multiple");f.accept&&(a+=' accept="'+f.accept+'"');a+=">"+help_span+' or <button id="'+f.id+'_button" name="'+f.id+'_button" data-type="lrfile"'+n+'><span class="buttontext">Browse server</span></button>'+help_span+'<span id="'+f.id+'_altval"></span><input type="hidden" name="_selaltval_'+f.id+'" value="'+f.id+'_altval"</input></div>';h+='ga.altfile("'+l+'","'+f.id+'","'+f.id+'_altval" );$( "#'+l+'" ).change( function(){ $( "#'+
     244f.id+'_altval" ).html( "<i>Local</i>: " + $( "#'+f.id+'" ).val().replace(/^C:.fakepath./,""));});ga.altfile.button( "'+l+'","'+f.id+'","'+f.label+'","rfile",function(v){ga.altfile.button.lrfile(v,"'+l+'","'+f.id+'")}';f.required&&(h+=',"lrfile"');h+=");";h+='$("#'+f.id+'_button").on("click",function(){return ga.altfile.button.call("'+l+'","'+f.id+'");});';break;case "text":ga.grid.newrow(p);f.label&&(a+=ga.grid.next(p,f.grid?f.grid.label:null,q)+'<label for="'+f.id+'"'+n+">"+f.label+"</label></div>");
     245a+=ga.grid.next(p,f.grid?f.grid.data:null,q)+'<input type="text" id="'+f.id+'" name="'+f.id+'"'+n;f.required&&(a+=" required");f.readonly&&(a+=" readonly");f["default"]&&(a+=' value="'+f["default"]+'"');f.pattern&&(a+=' pattern="'+f.pattern+'"');f.maxlength&&(a+=' maxlength="'+f.maxlength+'"');f.size&&(a+=' size="'+f.size+'"');a+=">"+help_span+"</div>";break;case "integer":ga.grid.newrow(p);f.label&&(a+=ga.grid.next(p,f.grid?f.grid.label:null,q)+'<label for="'+f.id+'"'+n+">"+f.label+"</label></div>");
     246a+=ga.grid.next(p,f.grid?f.grid.data:null,q)+'<input type="number" id="'+f.id+'" step="1" name="'+f.id+'"'+n;f.required&&(a+=" required");f.readonly&&(a+=" readonly");f["default"]&&(a+=' value="'+f["default"]+'"');f.pattern&&(a+=' pattern="'+f.pattern+'"');f.min&&(a+=' min="'+f.min+'"');f.max&&(a+=' max="'+f.max+'"');a+=">"+help_span+"</div>";break;case "float":ga.grid.newrow(p);f.label&&(a+=ga.grid.next(p,f.grid?f.grid.label:null,q)+'<label for="'+f.id+'"'+n+">"+f.label+"</label></div>");a+=ga.grid.next(p,
     247f.grid?f.grid.data:null,q)+'<input type="number" id="'+f.id+'" name="'+f.id+'"'+n;f.required&&(a+=" required");f.readonly&&(a+=" readonly");f.required&&(a+=" required");f["default"]&&(a+=' value="'+f["default"]+'"');f.pattern&&(a+=' pattern="'+f.pattern+'"');f.step&&(a+=' step="'+f.step+'"');f.min&&(a+=' min="'+f.min+'"');f.max&&(a+=' max="'+f.max+'"');a+=">"+help_span+"</div>";break;case "textarea":ga.grid.newrow(p);f.label&&(a+=ga.grid.next(p,f.grid?f.grid.label:null,q)+'<label for="'+f.id+'"'+
     248n+">"+f.label+"</label></div>");a+=ga.grid.next(p,f.grid?f.grid.data:null,q)+'<textarea id="'+f.id+'" name="'+f.id+'"'+n;f.required&&(a+=" required");a+=" readonly";f.fontfamily&&(a+=' style="font-family: '+f.fontfamily+';"');f.cols&&(a+=" cols="+f.cols);f.rows&&(a+=" rows="+f.rows);a+=">";f["default"]&&(a+=f["default"]);a+="</textarea>"+help_span+"</div>";break;case "checkbox":ga.grid.newrow(p);f.label&&(a+=ga.grid.next(p,f.grid?f.grid.label:null,q)+'<label for="'+f.id+'"'+n+">"+f.label+"</label></div>");
     249a+=ga.grid.next(p,f.grid?f.grid.data:null,q)+'<input type="checkbox" id="'+f.id+'" name="'+f.id+'"'+n;f.checked&&(a+=" checked");f.readonly&&(a+=" readonly");a+=">"+help_span+"</div>";break;case "listbox":ga.grid.newrow(p);if(f.header){f.label&&ga.grid.next(p,f.grid?f.grid.label:null);a+='<div style="';if(f.fontfamily||f.fontsize)f.fontfamily&&(a+="font-family:"+f.fontfamily+";"),f.fontsize&&(a+="font-size:"+f.fontsize+";");a+=ga.grid.nextstyle(p,f.grid?f.grid.data:null,q);a+='"';f.width&&(f.header=
     250f.header.padEnd(f.width));f.header=f.header.replace(/ /g,"&nbsp;");a+=">"+f.header+"</div>";ga.grid.newrow(p)}f.label&&(a+=ga.grid.next(p,f.grid?f.grid.label:null,q)+'<label for="'+f.id+'"'+n+">"+f.label+"</label></div>");a+=ga.grid.next(p,f.grid?f.grid.data:null,q)+'<select id="'+f.id+'" name="'+f.id+'"'+n;f.required&&(a+=" required");f.fontfamily&&(a+=' style="font-family: '+f.fontfamily+';"');f.size&&(a+=" size="+f.size);f.multiple&&(a+=" multiple");a+=">";if(!f.values){e+="No values for listbox "+
     251f.id+". ";break}if(f.returns){if(f.returns&&f.returns.length!=f.values.length){e+="Listbox values length ("+f.values.length+") does not equal return length ("+f.returns.length+") for listbox "+f.id+". ";break}for(n=0;n<f.values.length;++n)a+='<option value="'+f.returns[n]+'">'+f.values[n].replace(/ /g,"&nbsp")+"</option>"}else for(n=0;n<f.values.length;++n)a+='<option value="'+n+'">'+f.values[n].replace(/ /g,"&nbsp")+"</option>";f["default"]&&(h+='$("#'+f.id+" option[value='"+f["default"]+'\']").attr("selected", "true");');
     252a+="</select>"+help_span+"</div>";break;default:e+="Unknown or currently unsupported field:type "+f.type+". "}}a+="</form>"}else{a+='<form id="'+l+'"><table>';for(d=0;d<b._question.fields.length;++d)if(f=b._question.fields[d],f.id||(e+="No id in field "+d+". "),/^[A-Za-z][A-Za-z0-9_]*$/.test(f.id)||(e+="Invalid id for field "+d+' with id value "'+f.id+'". Only alpha in first character and alphanumeric and underscores subsequently allowed.'),f.type||(e+="No type in field "+d+". "),f.id&&f.type)switch(m[f.id]&&
     253(e+="Duplicate id in _question fields:"+f.id+". "),m[f.id]=1,f.help?(n=' class="help_link"',p=' class="highlight help_link"',help_span='<span class="help">'+f.help+"</span>"):(n="",p=' class="highlight"',help_span=""),f.type){case "label":a+="<tr><td colspan=2><label"+n+">";f.label&&(a+=f.label);a+="</label>"+help_span+"</td></tr>";break;case "file":a+="<tr><td>";f.label&&(a+='<label for="'+f.id+'"'+n+">"+f.label+"</label>");a+='</td><td><input type="file" id="'+f.id+'" name="'+f.id+'[]"'+n;f.required&&
     254(a+=" required");f.multiple&&(a+=" multiple");f.accept&&(a+=' accept="'+f.accept+'"');a+=">"+help_span+"</td></tr>";break;case "lrfile":a+="<tr><td>";f.label&&(a+='<label for="'+f.id+'"'+n+">"+f.label+"</label>");a+='</td><td><input type="file" id="'+f.id+'" name="'+f.id+'[]" data-add="'+f.id+'_altval"'+n;f.required&&(a+=" required");f.multiple&&(a+=" multiple");f.accept&&(a+=' accept="'+f.accept+'"');a+=">"+help_span+' or <button id="'+f.id+'_button" name="'+f.id+'_button" data-type="lrfile"'+n+
     255'><span class="buttontext">Browse server</span></button>'+help_span+'</td><td><span id="'+f.id+'_altval"></td></span><input type="hidden" name="_selaltval_'+f.id+'" value="'+f.id+'_altval"</input></td></tr>';h+='ga.altfile("'+l+'","'+f.id+'","'+f.id+'_altval" );$( "#'+l+'" ).change( function(){ $( "#'+f.id+'_altval" ).html( "<i>Local</i>: " + $( "#'+f.id+'" ).val().replace(/^C:.fakepath./,""));});ga.altfile.button( "'+l+'","'+f.id+'","'+f.label+'","rfile",function(v){ga.altfile.button.lrfile(v,"'+
     256l+'","'+f.id+'")}';f.required&&(h+=',"lrfile"');h+=");";h+='$("#'+f.id+'_button").on("click",function(){return ga.altfile.button.call("'+l+'","'+f.id+'");});';break;case "text":a+="<tr><td>";f.label&&(a+='<label for="'+f.id+'"'+n+">"+f.label+"</label>");a+='</td><td><input type="text" id="'+f.id+'" name="'+f.id+'"'+n;f.required&&(a+=" required");f.readonly&&(a+=" readonly");f["default"]&&(a+=' value="'+f["default"]+'"');f.pattern&&(a+=' pattern="'+f.pattern+'"');f.maxlength&&(a+=' maxlength="'+f.maxlength+
     257'"');f.size&&(a+=' size="'+f.size+'"');a+=">"+help_span+"</td></tr>";break;case "integer":a+="<tr><td>";f.label&&(a+='<label for="'+f.id+'"'+n+">"+f.label+"</label>");a+='</td><td><input type="number" id="'+f.id+'" step="1" name="'+f.id+'"'+n;f.required&&(a+=" required");f.readonly&&(a+=" readonly");f["default"]&&(a+=' value="'+f["default"]+'"');f.pattern&&(a+=' pattern="'+f.pattern+'"');f.min&&(a+=' min="'+f.min+'"');f.max&&(a+=' max="'+f.max+'"');a+=">"+help_span+"</td></tr>";break;case "float":a+=
     258"<tr><td>";f.label&&(a+='<label for="'+f.id+'"'+n+">"+f.label+"</label>");a+='</td><td><input type="number" id="'+f.id+'" name="'+f.id+'"'+n;f.required&&(a+=" required");f.readonly&&(a+=" readonly");f.required&&(a+=" required");f["default"]&&(a+=' value="'+f["default"]+'"');f.pattern&&(a+=' pattern="'+f.pattern+'"');f.step&&(a+=' step="'+f.step+'"');f.min&&(a+=' min="'+f.min+'"');f.max&&(a+=' max="'+f.max+'"');a+=">"+help_span+"</td></tr>";break;case "textarea":a+="<tr><td>";f.label&&(a+='<label for="'+
     259f.id+'"'+n+">"+f.label+"</label>");a+='</td><td><textarea id="'+f.id+'" name="'+f.id+'"'+n;f.required&&(a+=" required");a+=" readonly";f.fontfamily&&(a+=' style="font-family: '+f.fontfamily+';"');f.cols&&(a+=" cols="+f.cols);f.rows&&(a+=" rows="+f.rows);a+=">";f["default"]&&(a+=f["default"]);a+="</textarea>"+help_span+"</td></tr>";break;case "checkbox":a+="<tr><td>";f.label&&(a+='<label for="'+f.id+'"'+p+">"+f.label+"</label>");a+='</td><td><input type="checkbox" id="'+f.id+'" name="'+f.id+'"'+n;
     260f.checked&&(a+=" checked");f.readonly&&(a+=" readonly");a+=">"+help_span+"</td></tr>";break;case "listbox":if(f.header){a+="<tr><td colspan=2";if(f.fontfamily||f.fontsize)a+=' style="',f.fontfamily&&(a+="font-family:"+f.fontfamily+";"),f.fontsize&&(a+="font-size:"+f.fontsize+";"),a+='"';f.width&&(f.header=f.header.padEnd(f.width));f.header=f.header.replace(/ /g,"&nbsp;");a+=">"+f.header+"</td></tr>"}a+="<tr><td>";f.label&&(a+='<label for="'+f.id+'"'+p+">"+f.label+"</label>");a+="</td>";a=f.size&&
     2611<f.size?a+"</tr><tr><td colspan=2>":a+"<td>";a+='<select id="'+f.id+'" name="'+f.id+'"'+n;f.required&&(a+=" required");f.fontfamily&&(a+=' style="font-family: '+f.fontfamily+';"');f.size&&(a+=" size="+f.size);f.multiple&&(a+=" multiple");a+=">";if(!f.values){e+="No values for listbox "+f.id+". ";break}if(f.returns){if(f.returns&&f.returns.length!=f.values.length){e+="Listbox values length ("+f.values.length+") does not equal return length ("+f.returns.length+") for listbox "+f.id+". ";break}for(n=
     2620;n<f.values.length;++n)a+='<option value="'+f.returns[n]+'">'+f.values[n].replace(/ /g,"&nbsp")+"</option>"}else for(n=0;n<f.values.length;++n)a+='<option value="'+n+'">'+f.values[n].replace(/ /g,"&nbsp")+"</option>";f["default"]&&(h+='$("#'+f.id+" option[value='"+f["default"]+'\']").attr("selected", "true");');a+="</select>"+help_span+"</td></tr>";break;default:e+="Unknown or currently unsupported field:type "+f.type+". "}a+="</table></form>"}if(b._question.buttons&&b._question.buttons.length)for(d=
     2630;d<b._question.buttons.length;++d)switch(f=b._question.buttons[d],typeof f){case "string":bid=f.replace(/\W/g,"").toLowerCase();m[bid]&&(e+="Duplicate id in _question fields & buttons:"+bid+". ");m[bid]=1;g.push({id:bid,label:f,cb:ga.qr.cb,adata:[b,bid,f.skiprequired?0:1]});break;case "object":!f.id&&f.label&&(f.id=f.label.replace(/\W/g,"").toLowerCase());f.id?(m[f.id]&&(e+="Duplicate id in _question fields & buttons:"+f.id+". "),m[f.id]=1,f.id!=f.id.replace(/\W/g,"")&&(e+="Buttons array object entry "+
     264(d+1)+" id is not pure alphanumeric. ")):e+="Buttons array object entry "+(d+1)+" does not have an id. ";f.label||(e+="Buttons array object entry "+(d+1)+" does not have a label. ");e.length||(g.push({id:f.id,label:f.label,cb:ga.qr.cb,adata:[b,f.id,f.skiprequired?0:1]}),f.help&&(g[g.length-1].help=f.help));break;default:e+="Buttons array entry "+(d+1)+" unknown type: "+typeof f+". "}else bid="ok",m[bid]&&(e+="Duplicate id in _question fields & buttons:"+bid+". "),m[bid]=1,bid="cancel",m[bid]&&(e+=
     265"Duplicate id in _question fields & buttons:"+bid+". "),m[bid]=1,g=[{id:"ok",label:"OK",cb:ga.qr.cb,adata:[b,"ok",1]},{id:"cancel",label:"Cancel",cb:ga.qr.cb,adata:[b,"cancel",0]}];if(e.length)return ga.qr.rerror(b,e);ga.qr.openq[l]="open";ga.msg.box({icon:b._question.icon?b._question.icon:"question.png",noclose:1,closeif:1,text:a+"<p></p>",eval:'$("#'+l+'").on("keyup keypress", function(e) { var code = e.keyCode || e.which;  if (code  == 13) { e.preventDefault(); return false; }});'+h,buttons:g,
     266ptext:"<p></p>"},0,2)};
     267ga.qr.cb=function(a,b,d){var e=a._uuid+"-"+a._msgid;if(ga.qr.openq[e])switch(ga.qr.openq[e]){case "open":break;case "answered":return ga.msg.box({icon:"information.png",text:"Question has already been answered in another session"}),delete ga.qr.openq[e],!0;case "timeout":return ga.msg.box({icon:"information.png",text:"The time for answering a question has expired"}),delete ga.qr.openq[e],!0;default:return ga.msg.box({icon:"toast.png",text:"Internal error, unknown message state"}),delete ga.qr.openq[e],
     268!0}else return ga.msg.box({icon:"warning.png",text:a._question.requiredmsg?a._question.requiredmsg:"Not all required fields have been entered."}),!0;if(d){var h=!1;$("#"+e+" *").filter(":input").each(function(){if(this.required){var l=!0;this.dataset&&"rfile_val"==this.dataset.type&&this.value.length&&(l=!1);if(l)switch(this.type){case "text":case "number":case "select-one":this.value.length||(h=!0);break;case "select-multiple":($("#"+this.id).val()||[]).length()||(h=!0);break;case "file":0==this.files.length&&
     269(h=!0)}}});if(h)return ga.msg.box({icon:"warning.png",text:a._question.requiredmsg?a._question.requiredmsg:"Not all required fields have been entered."}),!1}delete ga.qr.openq[e];var g={};g._uuid=a._uuid;g._msgid=parseFloat(a._msgid);g._response={};g._response.button=b;a._question&&a._question.id&&(g._response.id=a._question.id);var m=!1;$("#"+e+" *").filter(":input").each(function(){this.dataset&&"rfile_val"==this.dataset.type&&this.value.length&&(m=!0);switch(this.type){case "text":case "number":case "select-one":g._response[this.id]=
     270this.value;break;case "select-multiple":g._response[this.id]=$("#"+this.id).val()||[];break;case "checkbox":this.checked&&(g._response[this.id]=!0);break;case "file":0==this.files.length?this.remove():m=!0}});m?ga.qr.postfiles(e,g):ga.qr.post(g);return!0};ga.qr.answered=function(a,b){b._uuid&&b._msgid&&(a=b._uuid+"-"+b._msgid,ga.qr.openq[a]&&(ga.qr.openq[a]="answered"))};ga.qr.timeout=function(a,b){b._uuid&&b._msgid&&(a=b._uuid+"-"+b._msgid,ga.qr.openq[a]&&(ga.qr.openq[a]="timeout"))};
     271ga.qr.rerror=function(a,b){var d={};d._uuid=a._uuid;d._msgid=parseFloat(a._msgid);d._response={};d._response.error=b;a._question&&a._question.id&&(d._response.id=a._question.id);ga.qr.post(d);ga.msg.box({icon:"toast.png",text:b})};
     272ga.qr.post=function(a){$.ajax({url:ga.qr.url,data:{_window:window.name,_data:a},dataType:"json",method:"POST"}).success(function(b){b.error&&b.error.length&&ga.msg.box({icon:"toast.png",text:"ajax data error: "+b.error,buttons:[{id:"ok",label:"OK"}]})}).error(function(b){console.log("ajax error");console.dir(b);ga.msg.box({icon:"toast.png",text:"ajax error: "+b.statusText,buttons:[{id:"ok",label:"OK"}]})})};
     273ga.qr.postfiles=function(a,b){var d="#"+a+"_progress";ga.msg.box({icon:"information.png",noclose:1,text:'Uploading files:<progress id="'+a+'_progress"></progress>'});var e=new FormData($("#"+a)[0]);e.append("_window",window.name);e.append("_logon",$("#_state").data("_logon"));e.append("_uuid",b._uuid);$.ajax({dataType:"json",cache:!1,type:"POST",url:"ajax/sys/uploader.php",data:e,xhr:function(){var h=$.ajaxSettings.xhr();h.upload&&h.upload.addEventListener("progress",function(g){g.lengthComputable&&
     274$(d).attr({value:g.loaded,max:g.total})},!1);return h},contentType:!1,processData:!1}).success(function(h){ga.msg.close(3);if(h.error&&h.error.length)delete ga.qr.openq[a],ga.qr.rerror(b,"ajax data error: "+h.error);else{if(h.files)for(var g in h.files)h.files.hasOwnProperty(g)&&(b[g]=h.files[g]);ga.qr.post(b)}}).error(function(h){ga.msg.close(3);console.log("ajax error");console.dir(h);delete ga.qr.openq[a];ga.qr.rerror(b,"ajax error: "+h.statusText)})};ga.msg={};
     275ga.msg.box=function(a,b,d){d=d||3;if(!b&&$(".modalDialog"+d).hasClass("modalDialog"+d+"_on")){b=$("#_state").data("__msgs");if(!b||b&&"[object Array]"!=Object.prototype.toString.call(b))b=[];b.push(a);$("#_state").data("__msgs",b)}else{a.icon?$("#configbody"+d).html("<table style='width:95%;vertical-align:middle'><tr><td style='width:10%'><img src='pngs/"+a.icon+"' width=40px></td><td style='text-align:center'>"+a.text+"</td></tr></table>"):$("#configbody"+d).html("<center>"+a.text+"</center>");a.noclose?
     276$("#closeModal"+d).hasClass("close"+d)&&$("#closeModal"+d).removeClass("close"+d).empty():4>d&&!$("#closeModal"+d).hasClass("close"+d)&&$("#closeModal"+d).addClass("close"+d).html("X");if(a.buttons){tmp="<center><table><tr>";for(i=0;i<a.buttons.length;i++)tmp=a.buttons[i].help?tmp+'<td><button id="_mbb_'+a.buttons[i].id+'" class="help_link">'+a.buttons[i].label+'</button><span class="help">'+a.buttons[i].help+"</span></td>":tmp+'<td><button id="_mbb_'+a.buttons[i].id+'">'+a.buttons[i].label+"</button></td>";
     277tmp+="</tr></table><center>";$("#configbody"+d).append(tmp);for(i=0;i<a.buttons.length;i++)if(a.buttons[i].cb)if(a.buttons[i].adata)switch(a.buttons[i].adata.length){case 2:if(a.closeif)$("#_mbb_"+a.buttons[i].id).off().on("click",a.buttons[i],function(e){e.data.cb(e.data.adata[0],e.data.adata[1])&&ga.msg.close(d)});else $("#_mbb_"+a.buttons[i].id).off().one("click",a.buttons[i],function(e){e.data.cb(e.data.adata[0],e.data.adata[1]);ga.msg.close(d)});break;case 3:if(a.closeif)$("#_mbb_"+a.buttons[i].id).off().on("click",
     278a.buttons[i],function(e){e.data.cb(e.data.adata[0],e.data.adata[1],e.data.adata[2])&&ga.msg.close(d)});else $("#_mbb_"+a.buttons[i].id).off().one("click",a.buttons[i],function(e){e.data.cb(e.data.adata[0],e.data.adata[1],e.data.adata[2]);ga.msg.close(d)});break;case 4:$("#_mbb_"+a.buttons[i].id).off().one("click",a.buttons[i],function(e){e.data.cb(e.data.adata[0],e.data.adata[1],e.data.adata[2],e.data.adata[3]);ga.msg.close(d)});break;case 5:$("#_mbb_"+a.buttons[i].id).off().one("click",a.buttons[i],
     279function(e){e.data.cb(e.data.adata[0],e.data.adata[1],e.data.adata[2],e.data.adata[3],e.data.adata[4]);ga.msg.close(d)});break;case 6:$("#_mbb_"+a.buttons[i].id).off().one("click",a.buttons[i],function(e){e.data.cb(e.data.adata[0],e.data.adata[1],e.data.adata[2],e.data.adata[3],e.data.adata[4],e.data.adata[5]);ga.msg.close(d)});break;default:console.warn("in ga.msg.box unsupported number of adata arguments "+a.buttons[i].adata.length)}else $("#_mbb_"+a.buttons[i].id).off().one("click",a.buttons[i],
     280function(e){e.data.cb(e.data.data);ga.msg.close(d)});else $("#_mbb_"+a.buttons[i].id).off().one("click",a.buttons[i],function(e){ga.msg.close(d)})}a.ptext&&$("#configbody"+d).append(a.ptext);a.eval&&eval(a.eval);ga.repeats.save();ga.hhelp.reset();$(".modalDialog"+d).addClass("modalDialog"+d+"_on")}};ga.msg.close1=function(){ga.repeats.restore();$(".modalDialog").removeClass("modalDialog_on");setTimeout(function(){$("#configbody").empty()},400);ga.usesplash&&setTimeout(function(){splashlogin()},500)};
     281ga.msg.close2=function(){ga.repeats.restore();$(".modalDialog2").removeClass("modalDialog2_on");$("#configbody2").empty();ga.usesplash&&setTimeout(function(){splashlogin()},500)};ga.msg.close3=function(){ga.repeats.restore();$(".modalDialog3").removeClass("modalDialog3_on");$("#configbody3").empty();var a=$("#_state").data("__msgs");if(a&&a.length){var b=a.shift();$("#_state").data("__msgs",a);ga.msg.box(b,1)}ga.usesplash&&setTimeout(function(){splashlogin()},500)};
    267282ga.msg.close4=function(){ga.repeats.restore();$(".modalDialog4").removeClass("modalDialog4_on");$("#configbody4").empty();ga.frontpageurl&&!ga.apprun?ga.frontpage(ga.frontpageurl):(ga.apprun=0,ga.usesplash&&setTimeout(function(){splashlogin()},500))};ga.msg.close=function(a){switch(a){case 1:ga.msg.close1();break;case 2:ga.msg.close2();break;case 3:ga.msg.close3();break;case 4:ga.msg.close4();break;default:console_warn("ga.msg.close called with unknown modal number "+a)}};
    268283ga.msg.clicks=function(){$("#closeModal").click(function(){ga.msg.close(1)});$("#closeModal2").click(function(){ga.msg.close(2)});$("#closeModal3").click(function(){ga.msg.close(3)});$("#closeModal4").click(function(){ga.msg.close(4)})};ga.ws={};ga.ws.subd=[];
    269 ga.ws.set=function(){var a=$("#_state").data("_ws");if(a){var c=$("#_state").data("_wssession");c&&c.isOpen?console.log("ga.ws.set: connection is already open"):c=new ab.Session(a,function(){$(".wsstatus").css("color","green");ga.event("global","ws messaging","connection established");$("#_state").data("_wssession",c);ga.ws.sub("keepalive",ga.ws.alive,"keepalive")},function(){$(".wsstatus").css("color","red");if(0==gd.data("_unload"))return ga.ws.set();console.log("ws connection closed on unload of page")},
    270 {skipSubprotocolCheck:!0,maxRetries:60,retryDelay:2E3})}else console.log("ga.ws.set: ws not defined")};ga.ws.alive=function(){};ga.ws.sub=function(a,c,b){b in ga.ws.subd&&ga.ws.unsub(ga.ws.subd[b],b);ga.ws.subd[b]=a;$("#_state").data("_ws")?(b=$("#_state").data("_wssession"))?b.subscribe(a,c):console.log("ga.ws.sub: connection is not open"):console.log("ga.ws.sub: ws not defined")};
    271 ga.ws.unsub=function(a,c){if(c in ga.ws.subd)if(delete ga.ws.subd[c],$("#_state").data("_ws")){var b=$("#_state").data("_wssession");b?(b.unsubscribe(a),$("#_state").data("_wssub:"+a,null)):console.log("ga.ws.sub: connection is not open")}else console.log("ga.ws.sub: ws not defined")};ga.ws.generic=function(a,c){console.log("ga.ws.generic "+a+" : "+c.json)};
     284ga.ws.set=function(){var a=$("#_state").data("_ws");if(a){var b=$("#_state").data("_wssession");b&&b.isOpen?console.log("ga.ws.set: connection is already open"):b=new ab.Session(a,function(){$(".wsstatus").css("color","green");ga.event("global","ws messaging","connection established");$("#_state").data("_wssession",b);ga.ws.sub("keepalive",ga.ws.alive,"keepalive")},function(){$(".wsstatus").css("color","red");if(0==gd.data("_unload"))return ga.ws.set();console.log("ws connection closed on unload of page")},
     285{skipSubprotocolCheck:!0,maxRetries:60,retryDelay:2E3})}else console.log("ga.ws.set: ws not defined")};ga.ws.alive=function(){};ga.ws.sub=function(a,b,d){d in ga.ws.subd&&ga.ws.unsub(ga.ws.subd[d],d);ga.ws.subd[d]=a;$("#_state").data("_ws")?(d=$("#_state").data("_wssession"))?d.subscribe(a,b):console.log("ga.ws.sub: connection is not open"):console.log("ga.ws.sub: ws not defined")};
     286ga.ws.unsub=function(a,b){b in ga.ws.subd&&(delete ga.ws.subd[b],$("#_state").data("_ws")?(b=$("#_state").data("_wssession"))?(b.unsubscribe(a),$("#_state").data("_wssub:"+a,null)):console.log("ga.ws.sub: connection is not open"):console.log("ga.ws.sub: ws not defined"))};ga.ws.generic=function(a,b){console.log("ga.ws.generic "+a+" : "+b.json)};
Note: See TracChangeset for help on using the changeset viewer.