(function(U,Z,$,I,aa,C,q,E,D,H,B,V,G,ba,y,O,M,N,W,Q,S,ca,P,da,ea,T,fa,ga,ha,ia,ja,ka,la,ma,X,Y,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za,Aa,Ba,Ca,Da,Ea,Fa,Ga,e,p){C("J.api");P(J.api,"JmolParallelProcessor");C("J.api");P(J.api,"JmolScriptEvaluator");C("J.api");P(J.api,"JmolScriptFunction");C("J.api");P(J.api,"JmolScriptManager");C("JS");E(["J.thread.JmolThread"],"JS.CommandWatcherThread",["java.lang.Thread","JU.Logger"],function(){c$=H(function(){this.scriptManager=null;D(this,arguments)},JS,"CommandWatcherThread",
J.thread.JmolThread);G(c$,function(){S(this,JS.CommandWatcherThread,[])});p(c$,"setManager",function(a,b){this.scriptManager=a;this.setViewer(b,"CommmandWatcherThread");return 0},"~O,JV.Viewer,~O");p(c$,"run",function(){for(Thread.currentThread().setPriority(1);!this.stopped;)try{Thread.sleep(50),this.stopped||this.scriptManager.runScriptNow()}catch(a){if(y(a,InterruptedException)){var b=a;JU.Logger.warn("CommandWatcher InterruptedException! "+this);break}else if(y(a,Exception)){b=a;JU.Logger.warn("CommandWatcher Exception! script processing ERROR:\n\n"+
b.toString());break}else throw a;}});p(c$,"run1",function(){},"~N");M(c$,"commandDelay",50)});C("JS");E(["J.thread.JmolThread"],"JS.FileLoadThread",null,function(){c$=H(function(){this.key=this.cacheName=this.fileName=null;D(this,arguments)},JS,"FileLoadThread",J.thread.JmolThread);G(c$,function(a,b,c,d,f){this.setViewer(b,"FileLoadThread");this.fileName=c;this.key=d;this.cacheName=f;this.setEval(a);this.sc.pc--},"J.api.JmolScriptEvaluator,JV.Viewer,~S,~S,~S");p(c$,"run1",function(a){for(;;)switch(a){case -1:a=
0;break;case 0:if(this.stopped||!this.vwr.testAsync&&this.eval.isStopped()){a=-2;break}return Jmol._loadFileAsynchronously(this,this.vwr.html5Applet,this.fileName,null);case 1:a=this.vwr.fm.getFileAsBytes(this.fileName,null);this.setData(this.fileName,this.fileName,a,null);return;case -2:this.resumeEval();return}},"~N");e(c$,"setData",function(a,b,c){var d=a.equals("#CANCELED#");this.sc.parentContext.htFileCache.put(this.key,d?a:this.cacheName=this.cacheName.substring(0,this.cacheName.lastIndexOf("_")+
1)+a);this.vwr.cachePut(this.cacheName,c);null!=b&&this.vwr.cachePut(this.vwr.fm.getFilePath(a,!0,!1),c);this.run1(-2)},"~S,~S,~O,~O")});C("JS");P(JS,"JmolCmdExtension");C("JS");P(JS,"JmolMathExtension");C("JS");P(JS,"JmolSmilesExtension");C("JS");E(["JS.ScriptTokenParser","JU.Lst"],"JS.ScriptCompiler","java.lang.Boolean $.Float java.util.Hashtable JU.AU $.BS $.M34 $.M4 $.PT $.SB J.api.Interface J.i18n.GT J.io.JmolBinary JM.BondSet $.Group JS.ContextToken $.SV $.ScriptContext $.ScriptError $.ScriptFlowContext $.ScriptFunction $.ScriptManager $.ScriptParam $.T JU.Escape $.Logger JV.Viewer".split(" "),
function(){c$=H(function(){this.filename=null;this.isSilent=!1;this.lineIndices=this.lineNumbers=this.aatokenCompiled=this.contextVariables=null;this.lnLength=8;this.haveComments=this.isCheckOnly=this.isShowScriptOutput=this.preDefining=!1;this.vBraces=this.lltoken=this.ltoken=this.flowContext=this.thisFunction=this.scriptExtensions=null;this.iBrace=this.setEqualPt=this.forPoint3=this.ptSemi=this.bracketCount=this.setBraceCount=this.braceCount=this.parenCount=this.nSemiSkip=this.cchScript=this.cchToken=
this.ichBrace=0;this.endOfLine=this.needRightParen=this.isEndOfCommand=this.iHaveQuotedString=!1;this.comment=null;this.tokLastMath=0;this.checkImpliedScriptCmd=!1;this.vFunctionStack=null;this.implicitString=this.isUserToken=this.isComment=this.isShowCommand=this.allowMissingEnd=!1;this.afterWhite=this.tokInitialPlusPlus=0;this.isDotDot=!1;this.vPush=this.identLC=this.ident=null;this.pushCount=0;this.chFirst="\x00";this.afterMath=0;D(this,arguments)},JS,"ScriptCompiler",JS.ScriptTokenParser);Q(c$,
function(){this.vPush=new JU.Lst});G(c$,function(a){this.vwr=a},"JV.Viewer");e(c$,"compile",function(a,b,c,d,f,g){this.isCheckOnly=g;this.filename=a;this.isSilent=d;this.script=b;this.logMessages=!d&&!c&&f;this.preDefining="#predefine"===a;a=this.compile0(!0);this.atokenInfix=null;a||this.handleError();c=new JS.ScriptContext;a=0==this.iBrace&&0==this.parenCount&&0==this.braceCount&&0==this.bracketCount;c.isComplete=a;c.script=b;c.scriptExtensions=this.scriptExtensions;c.errorType=this.errorType;null!=
this.errorType&&(c.iCommandError=this.iCommand,this.setAaTokenCompiled());c.aatoken=this.aatokenCompiled;c.errorMessage=this.errorMessage;c.errorMessageUntranslated=null==this.errorMessageUntranslated?this.errorMessage:this.errorMessageUntranslated;this.allowMissingEnd&&(null!=c.errorMessage&&0<=c.errorMessageUntranslated.indexOf("missing END"))&&(c.errorMessage=c.errorMessageUntranslated);c.lineIndices=this.lineIndices;c.lineNumbers=this.lineNumbers;c.vars=this.contextVariables;return c},"~S,~S,~B,~B,~B,~B");
e(c$,"newContextVariable",function(a){this.theToken=JS.T.o(1073741824,a);if(0<this.pushCount){var b=this.vPush.get(this.pushCount-1);b.addName(a);if(364558!=b.tok)return}null==this.thisFunction?(null==this.contextVariables&&(this.contextVariables=new java.util.Hashtable),JS.ScriptCompiler.addContextVariable(this.contextVariables,a)):this.thisFunction.addVariable(a,!1)},"~S");c$.addContextVariable=e(c$,"addContextVariable",function(a,b){a.put(b,JS.SV.newS("").setName(b))},"java.util.Map,~S");e(c$,
"isContextVariable",function(a){for(var b=this.vPush.size();0<=--b;){var c=this.vPush.get(b);if(null!=c.contextVariables&&c.contextVariables.containsKey(a))return!0}return null!=this.thisFunction?this.thisFunction.isVariable(a):null!=this.contextVariables&&this.contextVariables.containsKey(a)},"~S");e(c$,"cleanScriptComments",function(a){0<=a.indexOf("\u201c")&&(a=a.$replace("\u201c",'"'));0<=a.indexOf("\u201d")&&(a=a.$replace("\u201d",'"'));0<=a.indexOf("\ufeff")&&(a=a.$replace("\ufeff"," "));var b=
a.indexOf("\u0001##");0<=b&&(this.scriptExtensions=a.substring(b+1),a=a.substring(0,b),this.allowMissingEnd=0<=this.scriptExtensions.indexOf("##noendcheck"));this.haveComments=0<=a.indexOf("#");return J.io.JmolBinary.getEmbeddedScript(a)},"~S");e(c$,"addTokenToPrefix",function(a){this.logMessages&&JU.Logger.info("addTokenToPrefix"+a);this.ltoken.addLast(a);0!=a.tok&&(this.lastToken=a)},"JS.T");e(c$,"compile0",function(a){this.vFunctionStack=new JU.Lst;this.htUserFunctions=new java.util.Hashtable;
this.script=this.cleanScriptComments(this.script);this.ichToken=this.script.indexOf("# Jmol state version ");if(this.isStateScript=0<=this.ichToken)this.ptSemi=this.script.indexOf(";",this.ichToken),this.ptSemi>=this.ichToken&&JS.ScriptManager.setStateScriptVersion(this.vwr,this.script.substring(this.ichToken+21,this.ptSemi).trim());this.cchScript=this.script.length;this.errorLine=this.errorMessageUntranslated=this.errorMessage=this.errorType=this.flowContext=this.thisFunction=this.aatokenCompiled=
this.lineIndices=this.lineNumbers=this.contextVariables=null;this.ichBrace=this.ichComment=this.ichCurrentCommand=this.ichToken=this.nSemiSkip=0;this.lineCurrent=1;this.tokLastMath=this.iCommand=0;this.lastToken=JS.T.tokenOff;this.vBraces=new JU.Lst;this.vPush=new JU.Lst;this.parenCount=this.braceCount=this.iBrace=this.pushCount=0;this.isDotDot=!1;this.ptSemi=-10;this.cchToken=0;this.lnLength=8;this.lineNumbers=T(this.lnLength,0);this.lineIndices=O(this.lnLength,2,0);this.isNewSet=this.isSetBrace=
!1;this.ptNewSetModifier=1;this.checkImpliedScriptCmd=this.iHaveQuotedString=this.isShowScriptOutput=!1;this.lltoken=new JU.Lst;this.ltoken=new JU.Lst;this.tokCommand=0;this.tokenAndEquals=this.lastFlowCommand=null;this.bracketCount=this.setBraceCount=this.tokInitialPlusPlus=0;this.forPoint3=-1;this.setEqualPt=2147483647;this.endOfLine=!1;this.comment=null;this.needRightParen=this.isEndOfCommand=!1;this.theTok=0;for(var b=1;;this.ichToken+=this.cchToken){if(0==(this.nTokens=this.ltoken.size()))null!=
this.thisFunction&&0==this.thisFunction.chpt0&&(this.thisFunction.chpt0=this.ichToken),this.ichCurrentCommand=this.ichToken,b=this.lineCurrent;if(!this.lookingAtLeadingWhitespace()){this.endOfLine=!1;if(!this.isEndOfCommand){this.endOfLine=this.lookingAtEndOfLine();switch(this.endOfLine?0:this.lookingAtComment()){case 2:continue;case 3:this.isEndOfCommand=!0;continue;case 1:this.isEndOfCommand=!0,this.comment=this.script.substring(this.ichToken,this.ichToken+this.cchToken).trim()}this.isEndOfCommand=
this.isEndOfCommand||this.endOfLine||this.lookingAtTerminator()}if(this.isEndOfCommand){this.isEndOfCommand=!1;switch(this.processTokenList(b,a)){case 2:continue;case 4:return!1}this.checkImpliedScriptCmd=!1;if(this.ichToken<this.cchScript)continue;this.setAaTokenCompiled();return null==this.flowContext||this.errorStr(11,JS.T.nameOf(this.flowContext.token.tok))}if(0<this.nTokens&&!this.isDotDot)switch(this.checkSpecialParameterSyntax()){case 2:continue;case 4:return!1}if(this.lookingAtLookupToken(this.ichToken)){switch(this.parseKnownToken()){case 2:continue;
case 4:return!1}switch(this.parseCommandParameter()){case 2:continue;case 4:return!1}this.addTokenToPrefix(this.theToken)}else{if(0==this.nTokens||(this.isNewSet||this.isSetBrace)&&this.nTokens==this.ptNewSetModifier){if(0==this.nTokens){if(this.lookingAtString(!0)){this.addTokenToPrefix(this.setCommand(JS.T.tokenScript));this.cchToken=0;continue}this.lookingAtImpliedString(!0,!0,!0)&&(this.ichEnd=this.ichToken+this.cchToken)}return this.commandExpected()}return this.errorStr(19,this.script.substring(this.ichToken,
this.ichToken+1))}}}},"~B");e(c$,"setAaTokenCompiled",function(){this.aatokenCompiled=this.lltoken.toArray(Array(this.lltoken.size()))});e(c$,"lookingAtLeadingWhitespace",function(){for(var a=this.ichToken;JS.ScriptCompiler.isSpaceOrTab(this.charAt(a));)++a;this.isLineContinuation(a,!0)&&(a+=1+this.nCharNewLine(a+1));this.cchToken=a-this.ichToken;if(0==this.cchToken)return!1;this.afterWhite=a;return!0});e(c$,"isLineContinuation",function(a,b){var c=a+2<this.cchScript&&"\\"==this.script.charAt(a)&&
0<this.nCharNewLine(a+1)||b&&this.lookingAtMathContinuation(a);c&&this.lineCurrent++;return c},"~N,~B");e(c$,"lookingAtMathContinuation",function(a){var b;if(0==(b=this.nCharNewLine(a))||1048586==this.lastToken.tok)return!1;if(0<this.parenCount||0<this.bracketCount)return!0;if((1085443!=this.tokCommand||!this.isNewSet)&&36865!=this.tokCommand&&36869!=this.tokCommand)return!1;if(this.lastToken.tok==this.tokLastMath)return!0;for(a+=b;JS.ScriptCompiler.isSpaceOrTab(this.charAt(a));)++a;return this.lookingAtLookupToken(a)&&
1==this.tokLastMath},"~N");e(c$,"lookingAtEndOfLine",function(){return this.ichToken>=this.cchScript?(this.ichEnd=this.cchScript,!0):0<(this.cchToken=this.nCharNewLine(this.ichEnd=this.ichToken))});e(c$,"nCharNewLine",function(a){var b;return"\r"!=(b=this.charAt(a))?"\n"==b?1:0:"\n"==this.charAt(++a)?2:1},"~N");e(c$,"lookingAtTerminator",function(){var a=";"==this.script.charAt(this.ichToken);a&&0<this.nTokens&&(this.ptSemi=this.nTokens);if(!a||0<this.nSemiSkip--)return!1;this.cchToken=1;return!0});
e(c$,"lookingAtComment",function(){var a=this.script.charAt(this.ichToken),b=this.ichToken,c=-1;if(this.ichToken==this.ichCurrentCommand&&"$"==a&&(this.isShowScriptOutput||0==this.ichToken)){this.isShowCommand=this.isShowScriptOutput=!0;if("["==this.charAt(++b))for(;"]"!=a&&!this.eol(a=this.charAt(b));)++b;this.cchToken=b-this.ichToken;return 2}this.isShowScriptOutput&&!this.isShowCommand&&(c=b);if("/"==a&&b+1<this.cchScript)switch(this.script.charAt(++b)){case "/":c=this.ichToken;this.ichEnd=b-1;
break;case "*":this.ichEnd=b-1;b="*"==(a=this.charAt(++b))?"**/":"*/";b=this.script.indexOf(b,this.ichToken+2);if(0>b)return this.ichToken=this.cchScript,3;this.incrementLineCount(this.script.substring(this.ichToken,b));this.cchToken=b+("*"==a?3:2)-this.ichToken;return 2;default:return 0}var d=0>c;if(d&&!this.haveComments)return 0;this.ichComment>b&&(b=this.ichComment);for(;b<this.cchScript;b++){if(this.eol(a=this.script.charAt(b))){this.ichEnd=b;if(0<b&&this.isLineContinuation(b-1,!1)){b+=this.nCharNewLine(b);
continue}if(!d&&";"==a)continue;break}0<=c||"#"==a&&(c=b)}if(0>c)return 0;this.ichComment=c;if(d&&0==this.nTokens&&3<=this.cchScript-c&&"j"==this.script.charAt(c+1)&&"c"==this.script.charAt(c+2))return this.cchToken=b-this.ichToken,2;if(c!=this.ichToken)return 0;if(d&&this.cchScript>this.ichToken+3&&"j"==this.script.charAt(this.ichToken+1)&&"x"==this.script.charAt(this.ichToken+2)&&JS.ScriptCompiler.isSpaceOrTab(this.script.charAt(this.ichToken+3)))return this.cchToken=4,2;if(b==this.ichToken)return 0;
this.cchToken=b-this.ichToken;return 0==this.nTokens?1:2});e(c$,"charAt",function(a){return a<this.cchScript?this.script.charAt(a):"\x00"},"~N");e(c$,"processTokenList",function(a,b){if(0<this.nTokens||null!=this.comment){if(0==this.nTokens)this.ichCurrentCommand=this.ichToken,null!=this.comment&&(this.isComment=!0,this.addTokenToPrefix(JS.T.o(0,this.comment)));else if(0<this.setBraceCount&&this.endOfLine&&this.ichToken<this.cchScript)return 2;if(this.wasImpliedScript())return 2;this.isNewSet&&2<
this.nTokens&&1048583==this.tokAt(2)&&(1276117011==this.tokAt(3)||1141899269==this.tokAt(3)||1276384259==this.tokAt(3)||1276383249==this.tokAt(3))?(this.ltoken.set(0,JS.T.tokenSet),this.ltoken.add(1,1276383249==this.tokAt(3)?JS.T.tokenAll:this.ltoken.get(1))):0!=this.tokInitialPlusPlus&&(this.isNewSet||this.checkNewSetCommand(),this.tokenizePlusPlus(this.tokInitialPlusPlus,!0),this.ichCurrentCommand-=2);this.iCommand=this.lltoken.size();null!=this.thisFunction&&0>this.thisFunction.cmdpt0&&(this.thisFunction.cmdpt0=
this.iCommand);if(1==this.nTokens&&1==this.braceCount)if(null==this.lastFlowCommand){this.parenCount=this.setBraceCount=this.braceCount=0;this.ltoken.remove(0);this.iBrace++;var c=JS.ContextToken.newContext(!0);this.addTokenToPrefix(this.setCommand(c));this.pushCount++;this.vPush.addLast(c);this.vBraces.addLast(this.tokenCommand)}else this.parenCount=this.setBraceCount=0,this.setCommand(this.lastFlowCommand),102439!=this.lastFlowCommand.tok&&1048586==this.tokAt(0)&&this.ltoken.remove(0),this.lastFlowCommand=
null;if(0<this.bracketCount||0<this.setBraceCount||0<this.parenCount||1==this.braceCount&&!this.checkFlowStartBrace(!0))return this.error(1==this.nTokens?2:4),4;this.needRightParen&&(this.addTokenToPrefix(JS.T.tokenRightParen),this.needRightParen=!1);if(1074790550==this.tokAt(1)&&JS.T.tokAttr(this.tokCommand,135168))switch(this.tokAt(2)){case 0:case 4:case 1060866:break;default:c=this.ltoken.remove(2),this.ltoken.add(2,JS.T.o(4,2==c.tok?""+c.intValue:c.value.toString()))}if(0<this.ltoken.size()){if(b&&
!this.compileCommand())return 4;this.logMessages&&JU.Logger.debug("-------------------------------------");c=!0;switch(this.tokCommand){case 364558:case 102436:case 135368713:case 1150985:c=0<this.atokenInfix.length&&2147483647!=this.atokenInfix[0].intValue}c&&(this.iCommand==this.lnLength&&(this.lineNumbers=JU.AU.doubleLengthShort(this.lineNumbers),c=O(2*this.lnLength,2,0),System.arraycopy(this.lineIndices,0,c,0,this.lnLength),this.lineIndices=c,this.lnLength*=2),this.lineNumbers[this.iCommand]=
a,this.lineIndices[this.iCommand][0]=this.ichCurrentCommand,this.lineIndices[this.iCommand][1]=Math.max(this.ichCurrentCommand,Math.min(this.cchScript,this.ichEnd==this.ichCurrentCommand?this.ichToken:this.ichEnd)),this.lltoken.addLast(this.atokenInfix),this.iCommand=this.lltoken.size());1085443==this.tokCommand&&(this.lastFlowCommand=null)}this.setCommand(null);this.comment=null;this.iHaveQuotedString=this.isNewSet=this.isSetBrace=this.needRightParen=!1;this.ptNewSetModifier=1;this.ltoken.clear();
this.tokInitialPlusPlus=this.nTokens=this.nSemiSkip=0;this.tokenAndEquals=null;this.ptSemi=-10;this.forPoint3=-1;this.setEqualPt=2147483647}if(this.endOfLine){if(null!=this.flowContext&&this.flowContext.checkForceEndIf())return this.isComment||this.forceFlowEnd(this.flowContext.token),this.isEndOfCommand=!0,this.cchToken=0,this.ichCurrentCommand=this.ichToken,this.lineCurrent--,2;this.isShowCommand=this.isComment=!1;++this.lineCurrent}if(this.ichToken>=this.cchScript){this.setCommand(JS.T.tokenAll);
this.theTok=0;switch(this.checkFlowEndBrace()){case 4:return 4;case 2:return this.isEndOfCommand=!0,this.cchToken=0,2}this.ichToken=this.cchScript}return 0},"~N,~B");e(c$,"wasImpliedScript",function(){if(2<=this.nTokens&&135271429==this.tokCommand&&this.checkImpliedScriptCmd){var a=2==this.nTokens?this.lastToken.value.toString().toUpperCase():null;if(2<this.nTokens?!(269484048==this.tokAt(2)&&this.ltoken.get(1).value.toString().endsWith(".spt")):a.endsWith(".SORT")||a.endsWith(".REVERSE")||a.endsWith(".POP")||
0<=a.indexOf(".SORT(")||0<=a.indexOf(".REVERSE(")||0<=a.indexOf(".POP(")||0<=a.indexOf(".PUSH(")||a.endsWith("++")||a.endsWith("--")||a.endsWith("=")||0!=this.tokInitialPlusPlus)return this.ichToken=this.ichCurrentCommand,this.nTokens=0,this.ltoken.clear(),this.tokCommand=this.cchToken=0,!0}return!1});e(c$,"compileCommand",function(){switch(this.ltoken.size()){case 0:return this.atokenInfix=[],!0;case 4:if(this.isNewSet&&this.tokenAt(2).value.equals(".")&&this.tokenAt(3).value.equals("spt")){var a=
this.tokenAt(1).value+"."+this.tokenAt(3).value;this.ltoken.clear();this.addTokenToPrefix(JS.T.tokenScript);this.addTokenToPrefix(JS.T.o(4,a));this.isNewSet=!1}}this.setCommand(this.tokenAt(0));a=this.ltoken.size();1==a&&JS.T.tokAttr(this.tokCommand,524288)&&this.addTokenToPrefix(JS.T.tokenOn);if(null!=this.tokenAndEquals){for(var b,c=0,c=1;c<a&&269484242!=this.tokAt(c);c++);a=c;c++;if(this.ltoken.size()<c)JU.Logger.error("COMPILER ERROR! - andEquals ");else{for(b=1;b<a;b++,c++)this.ltoken.add(c,
this.tokenAt(b));this.ltoken.set(a,JS.T.tokenEquals);this.ltoken.add(c,this.tokenAndEquals);this.ltoken.add(++c,JS.T.tokenLeftParen);this.addTokenToPrefix(JS.T.tokenRightParen)}}this.atokenInfix=this.ltoken.toArray(Array(this.ltoken.size()));if(this.logMessages){JU.Logger.debug("token list:");for(c=0;c<this.atokenInfix.length;c++)JU.Logger.debug(c+": "+this.atokenInfix[c]);JU.Logger.debug("vBraces list:");for(c=0;c<this.vBraces.size();c++)JU.Logger.debug(c+": "+this.vBraces.get(c));JU.Logger.debug("-------------------------------------")}return this.compileExpressions()});
e(c$,"tokenAt",function(a){return this.ltoken.get(a)},"~N");p(c$,"tokAt",function(a){return a<this.ltoken.size()?this.tokenAt(a).tok:0},"~N");e(c$,"setCommand",function(a){this.tokenCommand=a;null==a?this.tokCommand=0:(this.tokCommand=this.tokenCommand.tok,this.isMathExpressionCommand=1073741824==this.tokCommand||JS.T.tokAttr(this.tokCommand,36864),this.isSetOrDefine=1085443==this.tokCommand||1060866==this.tokCommand,this.isCommaAsOrAllowed=JS.T.tokAttr(this.tokCommand,12288),this.implicitString=
JS.T.tokAttr(this.tokCommand,20480));return a},"JS.T");e(c$,"replaceCommand",function(a){this.ltoken.remove(0);this.ltoken.add(0,this.setCommand(a))},"JS.T");e(c$,"getPrefixToken",function(){this.ident=this.script.substring(this.ichToken,this.ichToken+this.cchToken);this.identLC=this.ident.toLowerCase();var a=this.isContextVariable(this.identLC);0==this.nTokens&&(this.isUserToken=a);if(1==this.nTokens&&(135368713==this.tokCommand||102436==this.tokCommand||36868==this.tokCommand)||0!=this.nTokens&&
a&&1048583!=this.lastToken.tok||this.isUserFunction(this.identLC)&&(null==this.thisFunction||!this.thisFunction.name.equals(this.identLC)))this.ident=this.identLC,this.theToken=null;else if(1==this.ident.length||269484066==this.lastToken.tok){if(null==(this.theToken=JS.T.getTokenFromName(this.ident))&&null!=(this.theToken=JS.T.getTokenFromName(this.identLC)))this.theToken=JS.T.tv(this.theToken.tok,this.theToken.intValue,this.ident)}else if(this.theToken=JS.T.getTokenFromName(this.identLC),null!=this.theToken&&
(1048583==this.lastToken.tok||269484096==this.lastToken.tok))this.theToken=JS.T.o(this.theToken.tok,this.ident);null==this.theToken&&(this.theToken=0==this.identLC.indexOf("property_")?JS.T.o(1716520985,this.identLC):JS.T.o(1073741824,this.ident));this.theTok=this.theToken.tok});e(c$,"checkSpecialParameterSyntax",function(){if(this.lookingAtString(!this.implicitString)){if(0>this.cchToken)return this.ERROR(4);var a=this.getUnescapedStringLiteral(null!=this.lastToken&&!this.iHaveQuotedString&&1073741983!=
this.lastToken.tok&&(1085443==this.tokCommand&&2==this.nTokens&&545259546==this.lastToken.tok||135271427==this.tokCommand||1610616835==this.tokCommand||135271429==this.tokCommand));this.iHaveQuotedString=!0;if(135271427==this.tokCommand&&135270408==this.lastToken.tok||135270408==this.tokCommand&&0>a.indexOf("@")){if(!this.getData(a))return this.ERROR(11,"data")}else this.addTokenToPrefix(JS.T.o(4,a)),this.implicitString&&(this.ichEnd=this.ichToken+this.cchToken,this.isEndOfCommand=!0);return 2}if(this.nTokens==
this.ptNewSetModifier){var a=this.script.charAt(this.ichToken),b=0<="+-\\*/&|=".indexOf(a),c=b||"."==a||"["==a,d=this.charAt(this.ichToken+1);if(!this.isNewSet&&this.isUserToken&&c&&("="==a||d==a||"="==d))this.isNewSet=!0;if(this.isNewSet||1085443==this.tokCommand||JS.T.tokAttr(this.tokCommand,536870912))if("="==a&&(this.setEqualPt=this.ichToken),JS.T.tokAttr(this.tokCommand,536870912)&&"="==a||(this.isNewSet||this.isSetBrace)&&c)switch(this.setCommand(b?JS.T.tokenSet:"["==a&&!this.isSetBrace||"."==
a&&"."==d?JS.T.tokenSetArray:JS.T.tokenSetProperty),this.ltoken.add(0,this.tokenCommand),this.cchToken=1,a){case "[":return this.addTokenToPrefix(JS.T.o(269484096,"[")),this.bracketCount++,2;case ".":if("."==d)return this.addTokenToPrefix(JS.T.o(269484096,"[")),this.cchToken=2,this.isDotDot=!0,2;this.addTokenToPrefix(JS.T.o(1048583,"."));return 2;case "-":case "+":case "*":case "/":case "\\":case "&":case "|":if(0==d.charCodeAt(0))return this.ERROR(4);if(d!=a&&"="!=d)return this.ERROR(1,'"'+a+'"');
break;default:return this.lastToken=JS.T.tokenMinus,2}}switch(this.tokCommand){case 135270926:if(2!=this.nTokens||1073741925!=this.lastToken.tok&&1073742189!=this.lastToken.tok)return 0;case 135271427:case 135271429:case 1276121098:if("@"==this.script.charAt(this.ichToken))return this.iHaveQuotedString=!0,0;if(135271427==this.tokCommand){if(1==this.nTokens||2==this.nTokens&&1073741839==this.tokAt(1))if(a=JV.Viewer.isDatabaseCode(this.charAt(this.ichToken)),this.lookingAtLoadFormat(a)){var f=this.script.substring(this.ichToken,
this.ichToken+this.cchToken),g=JS.T.getTokenFromName(f.toLowerCase());switch(null==g?0:g.tok){case 1073742015:case 1073742077:case 1073741839:case 1610616855:if(1!=this.nTokens)return 4;case 135270408:case 1229984263:case 1073741983:case 1095766030:case 135267336:case 536870926:case 1073741849:this.addTokenToPrefix(g);break;default:g=a?4:JU.PT.isOneOf(f=f.toLowerCase(),";xyz;vxyz;vibration;temperature;occupancy;partialcharge;")?1073741824:0,0!=g&&(this.addTokenToPrefix(JS.T.o(g,f)),this.iHaveQuotedString=
4==g)}return 2}if("{"==this.script.charAt(this.ichToken)||0<this.parenCount)break;if(null!=(a=this.lookingAtBitset()))return this.addTokenToPrefix(JS.T.o(10,a)),2}if(!this.iHaveQuotedString&&this.lookingAtImpliedString(135270926==this.tokCommand,135271427==this.tokCommand,1<this.nTokens||135271429!=this.tokCommand)){a=this.script.substring(this.ichToken,this.ichToken+this.cchToken);if(135271429==this.tokCommand)if(a.startsWith("javascript:"))this.lookingAtImpliedString(!0,!0,!0),a=this.script.substring(this.ichToken,
this.ichToken+this.cchToken);else if(0<=a.toUpperCase().indexOf(".PUSH("))return this.cchToken=0,this.iHaveQuotedString=!0,2;this.iHaveQuotedString=!0;this.addTokenToPrefix(JS.T.o(4,a));return 2}break;case 4156:if(1==this.nTokens&&this.lookForSyncID())return f=this.script.substring(this.ichToken,this.ichToken+this.cchToken),g=JU.PT.parseInt(f),-2147483648==g||1E3>Math.abs(g)?this.addTokenToPrefix(JS.T.o(1073741824,f)):this.addTokenToPrefix(JS.T.i(g)),2;break;case 135270422:if(2==this.nTokens&&4115==
this.lastToken.tok&&(this.iHaveQuotedString=!0),!this.iHaveQuotedString){if("@"==this.script.charAt(this.ichToken))return this.iHaveQuotedString=!0,0;if(this.lookingAtImpliedString(!0,!0,!0)){b=this.cchToken;a=this.script.substring(this.ichToken,this.ichToken+this.cchToken);if(0>a.indexOf(" "))return this.addTokenToPrefix(JS.T.o(4,a)),this.iHaveQuotedString=!0,2;this.cchToken=b}}}if((this.implicitString=(new Boolean(this.implicitString&1==this.nTokens)).valueOf())&&!(135271429==this.tokCommand&&this.iHaveQuotedString)&&
this.lookingAtImpliedString(!0,!0,!0))return a=this.script.substring(this.ichToken,this.ichToken+this.cchToken),1826248716==this.tokCommand&&JU.PT.isOneOf(a.toLowerCase(),";on;off;hide;display;")?this.addTokenToPrefix(JS.T.getTokenFromName(a.toLowerCase())):this.addTokenToPrefix(JS.T.o(4,a)),2;if(this.lookingAtObjectID())return this.addTokenToPrefix(JS.T.getTokenFromName("$")),this.addTokenToPrefix(JS.T.o(1073741824,this.script.substring(this.ichToken,this.ichToken+this.cchToken))),2;if(!Float.isNaN(a=
this.lookingAtExponential()))return this.addNumber(3,2147483647,Float.$valueOf(a)),2;if(this.lookingAtDecimal())return a=JU.PT.fVal(this.script.substring(this.ichToken,this.ichToken+this.cchToken)),f=JS.ScriptParam.getFloatEncodedInt(this.script.substring(this.ichToken,this.ichToken+this.cchToken)),this.addNumber(3,f,Float.$valueOf(a)),2;if(this.lookingAtSeqcode()){a=this.script.charAt(this.ichToken);try{f="*"==a||"^"==a?2147483647:Integer.parseInt(this.script.substring(this.ichToken,this.ichToken+
this.cchToken-2));g=this.script.charAt(this.ichToken+this.cchToken-1);"^"==g&&(g=" ");0>f&&(f=-f,this.addTokenToPrefix(JS.T.tokenMinus));var e=JM.Group.getSeqcodeFor(f,g);this.addTokenToPrefix(JS.T.tv(5,e,"seqcode"))}catch(h){if(y(h,NumberFormatException))return this.ERROR(9,""+a);throw h;}return 2}f=this.lookingAtInteger();if(2147483647!=f){g=this.script.substring(this.ichToken,this.ichToken+this.cchToken);if(102407==this.tokCommand||102408==this.tokCommand){if(1!=this.nTokens)return this.ERROR(0);
e=null==this.flowContext?null:this.flowContext.getBreakableContext(f=Math.abs(f));if(null==e)return this.ERROR(1,this.tokenCommand.value);this.tokenAt(0).intValue=e.pt0}0==f&&g.equals("-0")&&this.addTokenToPrefix(JS.T.tokenMinus);this.addNumber(2,f,g);return 2}if(!this.isMathExpressionCommand&&0==this.parenCount||1073741824!=this.lastToken.tok&&!JS.ScriptTokenParser.tokenAttr(this.lastToken,135266304)){f="["==this.script.charAt(this.ichToken);a=this.lookingAtBitset();if(null!=a)return this.addTokenToPrefix(JS.T.o(10,
f?JM.BondSet.newBS(a,null):a)),2;if(f&&(f=this.lookingAtMatrix(),q(f,JU.M34)))return this.addTokenToPrefix(JS.T.o(q(f,JU.M4)?12:11,f)),2}return 0});e(c$,"addNumber",function(a,b,c){this.addTokenToPrefix(this.afterWhite==this.ichToken?JS.SV.newSV(a,b,c):JS.T.tv(a,b,c))},"~N,~N,~O");e(c$,"lookingAtMatrix",function(){var a,b;if(this.ichToken+4>=this.cchScript||"["!=this.script.charAt(this.ichToken)||"["!=this.script.charAt(this.ichToken+1)||0>(a=this.script.indexOf("]]",this.ichToken))||null==(b=JU.Escape.unescapeMatrix(this.script.substring(this.ichToken,
a+2))))return null;this.cchToken=a+2-this.ichToken;return b});e(c$,"parseKnownToken",function(){this.getPrefixToken();var a;if(this.isDotDot)return this.addTokenToPrefix(JS.T.o(4,this.ident)),this.addTokenToPrefix(JS.T.o(269484097,"]")),this.isDotDot=!1,2;0!=this.tokLastMath&&(this.tokLastMath=this.theTok);if(null!=this.flowContext&&102410==this.flowContext.token.tok&&null!=this.flowContext.$var&&102411!=this.theTok&&102413!=this.theTok&&102410!=this.lastToken.tok)return this.ERROR(1,this.ident);
if(1060866==this.lastToken.tok&&1048586!=this.theTok&&1!=this.nTokens)return this.addTokenToPrefix(JS.T.o(4,this.ident)),2;switch(this.theTok){case 1073741824:if(0==this.nTokens&&!this.checkImpliedScriptCmd){if("'"==this.ident.charAt(0))return this.addTokenToPrefix(this.setCommand(JS.T.tokenScript)),this.cchToken=0,2;if("."==this.charAt(this.ichToken+this.cchToken))return this.addTokenToPrefix(this.setCommand(JS.T.tokenScript)),this.nTokens=1,this.cchToken=0,this.checkImpliedScriptCmd=!0,2}break;
case 269484242:if(this.nSemiSkip==this.forPoint3&&this.nTokens==this.ptSemi+2)return a=this.lastToken,this.addTokenToPrefix(JS.T.tokenEquals),this.addTokenToPrefix(a),a=JS.T.getTokenFromName(this.ident.substring(0,1)),this.addTokenToPrefix(a),this.addTokenToPrefix(JS.T.tokenLeftParen),this.needRightParen=!0,2;this.checkNewSetCommand();if(1085443==this.tokCommand){this.tokenAndEquals=JS.T.getTokenFromName(this.ident.substring(0,1));this.setEqualPt=this.ichToken;break}if(554176565==this.tokCommand||
554176526==this.tokCommand){this.addTokenToPrefix(this.tokenCommand);this.replaceCommand(JS.T.tokenSet);this.tokenAndEquals=JS.T.getTokenFromName(this.ident.substring(0,1));this.setEqualPt=this.ichToken;break}return 2;case 1150985:if(135174==this.tokCommand||4103==this.tokCommand&&1==this.nTokens)break;case 364548:null!=this.flowContext&&(this.flowContext.forceEndIf=!1);case 364547:if(0<this.nTokens)return this.isEndOfCommand=!0,this.cchToken=0,2;break;case 135369224:if(0<this.bracketCount)break;
case 102411:case 102413:case 102402:case 135369225:case 102410:case 102406:case 102412:if(1<this.nTokens&&1085443!=this.tokCommand&&0==this.nSemiSkip)return this.isEndOfCommand=!0,null!=this.flowContext&&(this.flowContext.forceEndIf=!0),this.cchToken=0,2;break;case 269484225:case 269484226:if(this.afterWhite==this.ichToken||this.afterMath==this.ichToken)this.theToken=JS.T.tv(this.theToken.tok,-1,this.theToken.value);!this.isNewSet&&1==this.nTokens&&this.checkNewSetCommand();if(this.isNewSet&&0==this.parenCount&&
0==this.bracketCount&&this.ichToken<=this.setEqualPt)return this.tokenizePlusPlus(this.theTok,!1),2;if(this.nSemiSkip==this.forPoint3&&this.nTokens==this.ptSemi+2)return a=this.lastToken,this.addTokenToPrefix(JS.T.tokenEquals),this.addTokenToPrefix(a),this.addTokenToPrefix(269484225==this.theTok?JS.T.tokenMinus:JS.T.tokenPlus),this.addTokenToPrefix(JS.T.i(1)),2;break;case 269484436:0==this.parenCount&&0==this.bracketCount&&(this.setEqualPt=this.ichToken);break;case 1048583:1085443==this.tokCommand&&
(0==this.parenCount&&0==this.bracketCount&&this.ichToken<this.setEqualPt&&1<this.ltoken.size()&&1048586==this.ltoken.get(1).tok)&&(this.ltoken.set(0,JS.T.tokenSetProperty),this.ltoken.add(1,JS.T.tokenExpressionBegin),this.addTokenToPrefix(JS.T.tokenExpressionEnd),this.setEqualPt=0);break;case 1048586:if(this.braceCount++,1==this.braceCount&&0==this.parenCount&&this.checkFlowStartBrace(!1))return this.isEndOfCommand=!0,null!=this.flowContext&&(this.flowContext.forceEndIf=!1),2;case 269484048:this.parenCount++;
if(1<this.nTokens&&(135280132==this.lastToken.tok||135369224==this.lastToken.tok||135369225==this.lastToken.tok))this.nSemiSkip+=2;break;case 1048590:if(0<this.iBrace&&0==this.parenCount&&0==this.braceCount)if(this.ichBrace=this.ichToken,0==this.nTokens)this.braceCount=this.parenCount=1;else return this.wasImpliedScript()||(this.braceCount=this.parenCount=this.nSemiSkip=0,102411!=this.theToken.tok&&102413!=this.theToken.tok&&this.vBraces.addLast(this.theToken),this.iBrace++,this.isEndOfCommand=!0,
this.ichEnd=this.ichToken),2;this.braceCount--;case 269484049:this.parenCount--;if(0>this.parenCount)return this.ERROR(16,this.ident);0==this.parenCount&&(this.nSemiSkip=0);this.needRightParen&&(this.addTokenToPrefix(JS.T.tokenRightParen),this.needRightParen=!1);break;case 269484096:0<this.ichToken&&JU.PT.isWhitespace(this.script.charAt(this.ichToken-1))&&this.addTokenToPrefix(JS.T.tokenSpaceBeforeSquare);this.bracketCount++;break;case 269484097:this.bracketCount--;if(0>this.bracketCount)return this.ERROR(16,
"]");break;case 1048584:return this.isDotDot=!0,this.addTokenToPrefix(JS.T.o(269484096,"[")),2}return 0});e(c$,"tokenizePlusPlus",function(a,b){b&&(this.setCommand(JS.T.tokenSet),1==this.nTokens&&this.ltoken.add(0,this.tokenCommand));this.nTokens=this.ltoken.size();this.addTokenToPrefix(JS.T.tokenEquals);this.setEqualPt=0;for(var c=1;c<this.nTokens;c++)this.addTokenToPrefix(this.ltoken.get(c));this.addTokenToPrefix(269484225==a?JS.T.tokenMinus:JS.T.tokenPlus);this.addTokenToPrefix(JS.T.i(1))},"~N,~B");
e(c$,"checkNewSetCommand",function(){var a=this.ltoken.get(0).value.toString();if(!this.isContextVariable(a.toLowerCase()))return!1;a=this.setNewSetCommand(!1,a);this.setCommand(JS.T.tokenSet);this.ltoken.add(0,this.tokenCommand);this.ltoken.set(1,a);return!0});e(c$,"parseCommandParameter",function(){this.nTokens=this.ltoken.size();switch(this.tokCommand){case 0:this.lastToken=JS.T.tokenOff;this.ichCurrentCommand=this.ichEnd=this.ichToken;this.setCommand(this.theToken);JS.T.tokAttr(this.tokCommand,
102400)&&(this.lastFlowCommand=this.tokenCommand);var a=this.checkFlowEndBrace();if(4==a)return 4;if(2==a)return this.isEndOfCommand=!0,this.cchToken=0,2;if(JS.T.tokAttr(this.tokCommand,102400)){if(!this.checkFlowCommand(this.tokenCommand.value))return 4;this.theToken=this.tokenCommand;102411==this.theTok&&(this.addTokenToPrefix(this.tokenCommand),this.theToken=JS.T.tokenLeftParen);break}if(269484066==this.theTok){this.braceCount++;this.isEndOfCommand=!0;break}if(1048590==this.theTok)return this.vBraces.addLast(this.tokenCommand),
this.iBrace++,this.tokCommand=0,2;1048586!=this.theTok&&(this.lastFlowCommand=null);if(269484128==this.theTok){this.setCommand(this.theToken=JS.T.o(4143,"resume"));this.addTokenToPrefix(this.theToken);this.theToken=JS.T.o(14,"context");break}if(JS.T.tokAttr(this.tokCommand,4096))break;if(this.isSetBrace=1048586==this.theTok)this.lookingAtSetBraceSyntax()||(this.isEndOfCommand=!0,null!=this.flowContext&&(this.flowContext.forceEndIf=!1));else switch(this.theTok){case 269484226:case 269484225:return this.tokInitialPlusPlus=
this.theTok,this.tokCommand=0,2;case 1073741824:case 36868:case 1060866:case 269484048:break;default:if(!JS.T.tokAttr(this.theTok,1073741824)&&!JS.T.tokAttr(this.theTok,536870912)&&!this.isContextVariable(this.identLC))return this.commandExpected(),4}this.theToken=this.setNewSetCommand(this.isSetBrace,this.ident);break;case 102412:switch(this.nTokens){case 1:if(269484048!=this.theTok)return this.ERROR(15,"(");break;case 2:269484049!=this.theTok&&(this.tokenCommand.name0=this.ident);this.newContextVariable(this.ident);
break;case 3:if(269484049!=this.theTok)return this.ERROR(15,")");this.isEndOfCommand=!0;this.ichEnd=this.ichToken+1;this.flowContext.setLine();break;default:return this.ERROR(0)}break;case 102436:case 135368713:if(0==this.tokenCommand.intValue){if(1!=this.nTokens)break;this.tokenCommand.value=this.ident;return 2}if(1==this.nTokens){null!=this.thisFunction&&this.vFunctionStack.add(0,this.thisFunction);this.thisFunction=102436==this.tokCommand?JS.ScriptCompiler.newScriptParallelProcessor(this.ident,
this.tokCommand):new JS.ScriptFunction(this.ident,this.tokCommand);this.htUserFunctions.put(this.ident,Boolean.TRUE);this.flowContext.setFunction(this.thisFunction);break}if(2==this.nTokens){if(269484048!=this.theTok)return this.ERROR(15,"(");break}if(3==this.nTokens&&269484049==this.theTok)break;if(0==this.nTokens%2){if(269484080!=this.theTok&&269484049!=this.theTok)return this.ERROR(15,")");break}this.thisFunction.addVariable(this.ident,!0);break;case 102411:if(1<this.nTokens&&0==this.parenCount&&
0==this.braceCount&&269484066==this.theTok)return this.addTokenToPrefix(JS.T.tokenRightParen),this.braceCount=1,this.isEndOfCommand=!0,this.cchToken=0,2;break;case 102413:if(1<this.nTokens)return this.braceCount=1,this.isEndOfCommand=!0,this.cchToken=0,2;break;case 364547:if(1==this.nTokens&&135369225!=this.theTok)return this.isEndOfCommand=!0,this.cchToken=0,2;if(1!=this.nTokens||135369225!=this.theTok&&1048586!=this.theTok)return this.ERROR(0);this.replaceCommand(this.flowContext.token=JS.ContextToken.newCmd(102402,
"elseif"));this.tokCommand=102402;return 2;case 1150985:if(1!=this.nTokens)return this.ERROR(0);if(!this.checkFlowEnd(this.theTok,this.ident,this.ichCurrentCommand))return 4;if(135368713==this.theTok||102436==this.theTok)return 2;break;case 102410:case 102406:2<this.nTokens&&(0==this.braceCount&&0==this.parenCount)&&(this.isEndOfCommand=!0,this.ichEnd=this.ichToken+1,this.flowContext.setLine());break;case 102402:case 135369225:2<this.nTokens&&(0==this.braceCount&&0==this.parenCount)&&(this.isEndOfCommand=
!0,this.ichEnd=this.ichToken+1,this.flowContext.setLine());break;case 102439:this.isEndOfCommand=!0;this.ichEnd=this.ichToken+1;this.flowContext.setLine();break;case 135369224:if(1==this.nTokens){if(269484048!=this.theTok)return this.ERROR(19,this.ident);this.forPoint3=this.nSemiSkip=0;this.nSemiSkip+=2}else 3==this.nTokens&&36868==this.tokAt(2)?this.newContextVariable(this.ident):(3==this.nTokens||4==this.nTokens)&&1276116993==this.theTok?(this.nSemiSkip-=2,this.forPoint3=2,this.addTokenToPrefix(this.theToken),
this.theToken=JS.T.tokenLeftParen):0==this.braceCount&&0==this.parenCount&&(this.isEndOfCommand=!0,this.ichEnd=this.ichToken+1,this.flowContext.setLine());break;case 1085443:case 36868:if(36868==this.tokCommand)if(1==this.nTokens){this.replaceCommand(JS.T.tokenSetVar);this.newContextVariable(this.ident);break}else{if(this.ident.equals(","))return 2;if(JU.PT.isLetter(this.ident.charAt(0))){this.newContextVariable(this.ident);break}else{if(2!=this.nTokens)return this.ERROR(0);this.replaceCommand(JS.T.tokenSet)}}1048586==
this.theTok?this.setBraceCount++:1048590==this.theTok&&(this.setBraceCount--,this.isSetBrace&&(0==this.setBraceCount&&2147483647==this.ptNewSetModifier)&&(this.ptNewSetModifier=this.nTokens+1));if(this.nTokens==this.ptNewSetModifier){a=this.tokenAt(0);if(269484048==this.theTok||this.isUserFunction(a.value.toString())){this.ltoken.set(0,this.setCommand(JS.T.tv(1073741824,0,a.value)));this.setBraceCount=0;break}if(1073741824!=this.theTok&&269484242!=this.theTok&&1060866!=this.theTok&&!JS.T.tokAttr(this.theTok,
536870912))return this.isNewSet?this.commandExpected():this.errorIntStr2(18,"SET",": "+this.ident),4;if(1==this.nTokens&&(269484226==this.lastToken.tok||269484225==this.lastToken.tok)){this.replaceCommand(JS.T.tokenSet);this.addTokenToPrefix(this.lastToken);break}}break;case 135271427:if(1060866==this.theTok&&(1==this.nTokens||1073741940==this.lastToken.tok||1073742152==this.lastToken.tok))return this.addTokenToPrefix(JS.T.tokenDefineString),2;1073741848==this.theTok&&(this.iHaveQuotedString=!1);
break;case 1610625028:case 12294:case 12295:case 135280132:case 12291:case 1060866:if(1060866==this.tokCommand){if(1==this.nTokens){if(1073741824!=this.theTok)if(this.preDefining){if(!JS.T.tokAttr(this.theTok,3145728))return this.errorStr2("ERROR IN Token.java or JmolConstants.java -- the following term was used in JmolConstants.java but not listed as predefinedset in Token.java: "+this.ident,null),4}else JS.T.tokAttr(this.theTok,3145728)?JU.Logger.warn("WARNING: predefined term '"+this.ident+"' has been redefined by the user until the next file load."):
!this.isCheckOnly&&1<this.ident.length&&(JU.Logger.warn("WARNING: redefining "+this.ident+"; was "+this.theToken+"not all commands may continue to be functional for the life of the applet!"),this.theTok=this.theToken.tok=1073741824,JS.T.addToken(this.ident,this.theToken));this.addTokenToPrefix(this.theToken);this.lastToken=JS.T.tokenComma;return 2}if(2==this.nTokens&&269484436==this.theTok)return this.ltoken.add(0,JS.T.tokenSet),2}if(0==this.bracketCount&&1073741824!=this.theTok&&!JS.T.tokAttr(this.theTok,
1048576)&&!JS.T.tokAttr(this.theTok,1073741824)&&(this.theTok&480)!=this.theTok)return this.ERROR(9,this.ident);break;case 12289:if(1073741824!=this.theTok&&1048582!=this.theTok&&!JS.T.tokAttr(this.theTok,1048576))return this.ERROR(9,this.ident);break;case 135190:case 135188:case 135180:a=this.charAt(this.ichToken+this.cchToken);0==this.parenCount&&(0==this.bracketCount&&0<=".:/\\+-!?".indexOf(a)&&!("-"==a&&this.ident.equals("=")))&&this.checkUnquotedFileName();break;case 135270926:2==this.nTokens&&
(1073742158==this.tokAt(1)&&269484208==this.theTok)&&(this.implicitString=!0)}return 0});c$.newScriptParallelProcessor=e(c$,"newScriptParallelProcessor",function(a,b){var c=J.api.Interface.getInterface("JS.ScriptParallelProcessor",null,null);c.set(a,b);return c},"~S,~N");e(c$,"setNewSetCommand",function(a,b){this.tokCommand=1085443;this.isNewSet=!a&&!this.isUserFunction(b);this.setBraceCount=a?1:0;this.bracketCount=0;this.setEqualPt=2147483647;this.ptNewSetModifier=this.isNewSet?b.equals("(")?2:1:
2147483647;return a||536870918==this.theToken.tok||269484226==this.theToken.tok||269484225==this.theToken.tok?this.theToken:JS.T.o(1073741824,b)},"~B,~S");e(c$,"checkUnquotedFileName",function(){for(var a=this.ichToken,b;++a<this.cchScript&&!JU.PT.isWhitespace(b=this.script.charAt(a))&&"#"!=b&&";"!=b&&"}"!=b;);b=this.script.substring(this.ichToken,a).$replace("\\","/");this.cchToken=a-this.ichToken;this.theToken=JS.T.o(4,b)});e(c$,"checkFlowStartBrace",function(a){if(!JS.T.tokAttr(this.tokCommand,
102400)||102407==this.tokCommand||102408==this.tokCommand)return!1;a&&(102411!=this.tokenCommand.tok&&102413!=this.tokenCommand.tok&&(this.iBrace++,this.vBraces.addLast(this.tokenCommand),this.lastFlowCommand=null),this.parenCount=this.braceCount=0);return!0},"~B");e(c$,"checkFlowEndBrace",function(){if(0>=this.iBrace||1048590!=this.vBraces.get(this.iBrace-1).tok)return 0;this.vBraces.remove(--this.iBrace);var a=this.vBraces.remove(--this.iBrace);1048586==this.theTok&&(this.braceCount--,this.parenCount--);
if(1276384259==a.tok)return this.vPush.remove(--this.pushCount),this.addTokenToPrefix(this.setCommand(JS.ContextToken.newContext(!1))),this.isEndOfCommand=!0,2;switch(null==this.flowContext?0:this.flowContext.token.tok){case 135369225:case 102402:case 364547:if(364547==this.tokCommand||102402==this.tokCommand)return 0;break;case 102410:case 102411:case 102413:if(102411==this.tokCommand||102413==this.tokCommand)return 0}return this.forceFlowEnd(a)});e(c$,"forceFlowEnd",function(a){var b=this.tokenCommand;
this.setCommand(JS.T.o(1150985,"end"));if(!this.checkFlowCommand("end"))return 0;this.addTokenToPrefix(this.tokenCommand);switch(a.tok){case 135369225:case 364547:case 102402:a=JS.T.tokenIf;break;case 102413:case 102411:a=JS.T.tokenSwitch;break;default:a=JS.T.getTokenFromName(a.value)}if(!this.checkFlowEnd(a.tok,a.value,this.ichBrace))return 4;135368713!=a.tok&&(102436!=a.tok&&364558!=a.tok)&&this.addTokenToPrefix(a);this.setCommand(b);return 2},"JS.T");c$.isBreakableContext=e(c$,"isBreakableContext",
function(a){return 135369224==a||102439==a||102406==a||102411==a||102413==a},"~N");e(c$,"checkFlowCommand",function(a){var b=this.lltoken.size(),c=!1,d=!0;switch(this.tokCommand){case 135368713:case 102436:if(null!=this.flowContext)return this.errorStr(1,JS.T.nameOf(this.tokCommand));break;case 1150985:if(null==this.flowContext)return this.errorStr(1,a);c=!0;135368713!=this.flowContext.token.tok&&(102436!=this.flowContext.token.tok&&364558!=this.flowContext.token.tok)&&this.setCommand(JS.T.tv(this.tokCommand,
0<this.flowContext.ptDefault?this.flowContext.ptDefault:-this.flowContext.pt0,a));break;case 364548:c=!0;if(null==this.flowContext||135369225!=this.flowContext.token.tok&&102439!=this.flowContext.token.tok&&364547!=this.flowContext.token.tok&&102402!=this.flowContext.token.tok)return this.errorStr(1,a);break;case 364547:if(null==this.flowContext||135369225!=this.flowContext.token.tok&&102402!=this.flowContext.token.tok)return this.errorStr(1,a);this.flowContext.token.intValue=this.flowContext.setPt0(b,
!1);break;case 102407:case 102408:var d=!1,f=null==this.flowContext?null:this.flowContext.getBreakableContext(0);if(102408==this.tokCommand)for(;null!=f&&135369224!=f.token.tok&&102406!=f.token.tok;)f=f.getParent();if(null==f)return this.errorStr(1,a);this.setCommand(JS.T.tv(this.tokCommand,f.pt0,a));break;case 102413:if(null==this.flowContext||102410!=this.flowContext.token.tok&&102411!=this.flowContext.token.tok&&0<this.flowContext.ptDefault)return this.errorStr(1,a);this.flowContext.token.intValue=
this.flowContext.setPt0(b,!0);break;case 102411:if(null==this.flowContext||102410!=this.flowContext.token.tok&&102411!=this.flowContext.token.tok&&102413!=this.flowContext.token.tok)return this.errorStr(1,a);this.flowContext.token.intValue=this.flowContext.setPt0(b,!1);break;case 102402:if(null==this.flowContext||135369225!=this.flowContext.token.tok&&102402!=this.flowContext.token.tok&&364547!=this.flowContext.token.tok)return this.errorStr(1,"elseif");this.flowContext.token.intValue=this.flowContext.setPt0(b,
!1)}if(c)this.flowContext.token.intValue=102412==this.tokCommand?-b:b,364548==this.tokCommand&&(this.flowContext=this.flowContext.getParent());else if(d)switch(a=JS.ContextToken.newCmd(this.tokCommand,this.tokenCommand.value),102410==this.tokCommand&&a.addName("_var"),this.setCommand(a),this.tokCommand){case 364558:this.flowContext=new JS.ScriptFlowContext(this,a,b,this.flowContext);null!=this.thisFunction&&this.vFunctionStack.add(0,this.thisFunction);this.thisFunction=JS.ScriptCompiler.newScriptParallelProcessor("",
this.tokCommand);this.flowContext.setFunction(this.thisFunction);this.pushCount++;this.vPush.addLast(a);break;case 364547:case 102402:this.flowContext.token=a;break;case 102411:case 102413:a.contextVariables=this.flowContext.token.contextVariables;this.flowContext.token=a;break;case 102439:case 135369224:case 102406:case 102412:this.pushCount++,this.vPush.addLast(a);default:this.flowContext=new JS.ScriptFlowContext(this,a,b,this.flowContext)}return!0},"~S");e(c$,"checkFlowEnd",function(a,b,c){if(null==
this.flowContext||this.flowContext.token.tok!=a){var d=!0;switch(a){case 135369225:d=364547==this.flowContext.token.tok||102402==this.flowContext.token.tok;break;case 102410:d=102411==this.flowContext.token.tok||102413==this.flowContext.token.tok;break;default:d=!1}if(!d)return this.errorStr(1,"end "+b)}switch(a){case 135369225:case 102410:break;case 102412:case 135369224:case 102439:case 102406:this.vPush.remove(--this.pushCount);break;case 102436:case 135368713:case 364558:this.isCheckOnly||(this.addTokenToPrefix(JS.T.o(a,
this.thisFunction)),JS.ScriptFunction.setFunction(this.thisFunction,this.script,c,this.lltoken.size(),this.lineNumbers,this.lineIndices,this.lltoken));this.thisFunction=0==this.vFunctionStack.size()?null:this.vFunctionStack.remove(0);this.tokenCommand.intValue=0;364558==a&&this.vPush.remove(--this.pushCount);break;default:return this.errorStr(19,"end "+b)}this.flowContext=this.flowContext.getParent();return!0},"~N,~S,~N");e(c$,"getData",function(a){this.addTokenToPrefix(JS.T.o(4,a));this.ichToken+=
a.length+2;"\r"==this.charAt(this.ichToken)&&(this.lineCurrent++,this.ichToken++);"\n"==this.charAt(this.ichToken)&&(this.lineCurrent++,this.ichToken++);var b=this.script.indexOf(this.chFirst+a+this.chFirst,this.ichToken)-4;if(0>b||!this.script.substring(b,b+4).equalsIgnoreCase("END "))return!1;var c=this.script.substring(this.ichToken,b);this.incrementLineCount(c);this.addTokenToPrefix(JS.T.o(135270408,c));this.addTokenToPrefix(JS.T.o(1073741824,"end"));this.addTokenToPrefix(JS.T.o(4,a));this.cchToken=
b-this.ichToken+a.length+6;return!0},"~S");e(c$,"incrementLineCount",function(a){var b,c=a.indexOf("\r"),d=a.indexOf("\n");if(0>c&&0>d)return 0;var f=this.lineCurrent;if(0>c||d<c)c=d;for(d=a.length;--d>=c;)("\n"==(b=a.charAt(d))||"\r"==b)&&this.lineCurrent++;return this.lineCurrent-f},"~S");c$.isSpaceOrTab=e(c$,"isSpaceOrTab",function(a){return" "==a||"\t"==a},"~S");e(c$,"eol",function(a){return"\x00"==a||"\r"==a||"\n"==a||";"==a&&0>=this.nSemiSkip},"~S");e(c$,"lookingAtSetBraceSyntax",function(){for(var a=
this.ichToken,b=1;++a<this.cchScript&&0<b;)switch(this.script.charAt(a)){case "{":b++;break;case "}":b--}if("["==this.charAt(a)&&1==++b)for(;++a<this.cchScript&&0<b;)switch(this.script.charAt(a)){case "[":b++;break;case "]":"["==this.charAt(a+1)?a++:b--}return"."==this.charAt(a)&&0==b?!0:!1});e(c$,"lookingAtString",function(a){if(this.ichToken+2>this.cchScript)return!1;this.chFirst=this.script.charAt(this.ichToken);if('"'!=this.chFirst&&(!a||"'"!=this.chFirst))return!1;a=this.ichToken;for(var b,c=
!1;++a<this.cchScript;){b=this.script.charAt(a);if(b==this.chFirst&&!c)break;c="\\"==b?!c:!1}a==this.cchScript?(this.cchToken=-1,this.ichEnd=this.cchScript):this.cchToken=++a-this.ichToken;return!0},"~B");e(c$,"getUnescapedStringLiteral",function(a){if(a&&(a=this.script.substring(this.ichToken+1,this.ichToken+this.cchToken-1),0<=a.indexOf("\\u")&&(a=JU.Escape.unescapeUnicode(a)),0!=a.indexOf(";base64,")))return a;a=JU.SB.newN(this.cchToken-2);for(var b=this.ichToken+this.cchToken-1,c=this.ichToken+
1;c<b;){var d=this.script.charAt(c++);if("\\"==d&&c<b)switch(d=this.script.charAt(c++),d){case "n":d="\n";break;case "t":d="\t";break;case "r":d="\r";case '"':case "\\":case "'":break;case "x":case "u":var f="x"==d?2:4;if(c<b){for(d=0;0<=--f&&c<b;){var g=this.script.charAt(c),g=JU.Escape.getHexitValue(g);if(0>g)break;d<<=4;d+=g;++c}d=String.fromCharCode(d)}}a.appendC(d)}return a.toString()},"~B");e(c$,"lookingAtLoadFormat",function(a){for(var b=this.ichToken,c;JU.PT.isLetterOrDigit(c=this.charAt(b))&&
(a||JU.PT.isLetter(c))||a&&!this.eol(c)&&!JU.PT.isWhitespace(c);)++b;if(!a&&b==this.ichToken||!JS.ScriptCompiler.isSpaceOrTab(c))return!1;this.cchToken=b-this.ichToken;return!0},"~B");e(c$,"lookingAtImpliedString",function(a,b,c){var d=this.ichToken,f=this.script.charAt(d),g=1074790550==this.lastToken.tok,e=JS.T.tokAttr(this.tokCommand,20480)&&1==(this.tokCommand&1),h="@"==f;if(h&&(d+3<this.cchScript&&"{"==this.script.charAt(d+1))&&(g||!e))return!1;for(var e=g=-1,n=!0,l=0;n&&!this.eol(f=this.charAt(d));){switch(f){case "(":if(!c&&
5<=d&&(this.script.substring(d-4,d).equals(".spt")||this.script.substring(d-4,d).equals(".png")||this.script.substring(d-5,d).equals(".pngj"))){n=!1;continue}break;case "=":if(!b){n=!1;continue}break;case "{":l++;break;case "}":if(l--,0>l&&(0<this.braceCount||0<this.iBrace)){n=!1;continue}default:JU.PT.isWhitespace(f)?0>g&&(g=d):e=d}++d}a?d=e+1:0<g&&(d=g);return h&&(!a||0>g&&0>=l&&1<d-this.ichToken)?!1:0<(this.cchToken=d-this.ichToken)},"~B,~B,~B");e(c$,"lookingAtExponential",function(){if(this.ichToken==
this.cchScript)return NaN;var a=this.ichToken,b=a;"-"==this.script.charAt(a)&&++a;for(var c=!1,d="X";JU.PT.isDigit(d=this.charAt(a));)++a,c=!0;for(a<this.cchScript&&"."==d&&++a;JU.PT.isDigit(d=this.charAt(a));)++a,c=!0;if(a==this.cchScript||!c||(c="E"!=d&&"e"!=d)||++a==this.cchScript)return NaN;d=this.script.charAt(a);for(("-"==d||"+"==d)&&a++;JU.PT.isDigit(this.charAt(a));)a++,c=!0;if(!c)return NaN;this.cchToken=a-this.ichToken;return JU.PT.dVal(this.script.substring(b,a))});e(c$,"lookingAtDecimal",
function(){if(this.ichToken==this.cchScript)return!1;var a=this.ichToken;"-"==this.script.charAt(a)&&++a;for(var b=!1,c;JU.PT.isDigit(c=this.charAt(a++));)b=!0;if("."!=c)return!1;if(!this.eol(c=this.charAt(a)))if(JU.PT.isLetter(c)||"?"==c||"*"==c||JU.PT.isLetter(c=this.charAt(a+1))||"?"==c)return!1;for(;JU.PT.isDigit(this.charAt(a));)++a,b=!0;this.cchToken=a-this.ichToken;return b});e(c$,"lookingAtSeqcode",function(){var a=this.ichToken,b;if("^"==this.charAt(a+1)&&"*"==this.script.charAt(a))b="^",
++a;else for("-"==this.script.charAt(a)&&++a;JU.PT.isDigit(b=this.charAt(a));)++a;if("^"!=b)return!1;a++;b=a==this.cchScript?" ":this.script.charAt(a++);if(" "!=b&&"*"!=b&&"?"!=b&&!JU.PT.isLetter(b))return!1;this.cchToken=a-this.ichToken;return!0});e(c$,"lookingAtInteger",function(){if(this.ichToken==this.cchScript)return 2147483647;var a=this.ichToken;"-"==this.script.charAt(this.ichToken)&&++a;for(var b=a;JU.PT.isDigit(this.charAt(a));)++a;if(b==a)return 2147483647;this.cchToken=a-this.ichToken;
try{return Integer.parseInt(this.ident=this.script.substring(this.ichToken,a))}catch(c){if(!y(c,NumberFormatException))throw c;}return 2147483647});e(c$,"lookingAtBitset",function(){if(this.script.indexOf("({null})",this.ichToken)==this.ichToken)return this.cchToken=8,new JU.BS;var a;if(this.ichToken+4>this.cchScript||"{"!=this.script.charAt(this.ichToken+1)||0>(a=this.script.indexOf("}",this.ichToken))||a+1==this.cchScript)return null;var b=JU.BS.unescape(this.script.substring(this.ichToken,a+2));
null!=b&&(this.cchToken=a+2-this.ichToken);return b});e(c$,"lookingAtObjectID",function(){var a=1==this.nTokens,b=this.ichToken;if("$"!=this.charAt(b)||'"'==this.charAt(++b))return!1;for(;b<this.cchScript;){var c;if(JU.PT.isWhitespace(c=this.script.charAt(b))){if(b==this.ichToken+1)return!1;break}if(!JU.PT.isLetterOrDigit(c))switch(c){default:return!1;case "*":if(!a)return!1;case "~":case "_":}b++}this.cchToken=b-++this.ichToken;return!0});e(c$,"lookingAtLookupToken",function(a){if(a==this.cchScript)return!1;
var b=a;this.afterMath=0!=this.tokLastMath?a:0;this.tokLastMath=0;var c;switch(c=this.script.charAt(a++)){case "-":case "+":case "&":case "|":case "*":if(a<this.cchScript)if(this.script.charAt(a)==c){++a;if("-"==c||"+"==c)break;"&"==c&&this.charAt(a)==c&&++a}else"="==this.script.charAt(a)&&++a;this.tokLastMath=1;break;case "/":if("/"==this.charAt(a))break;case "\\":case "!":"="==this.charAt(a)&&++a;this.tokLastMath=1;break;case ")":case "]":case "}":break;case ".":"."==this.charAt(a)&&++a;break;case "@":case "{":this.tokLastMath=
2;break;case ":":this.tokLastMath=1;break;case "(":case ",":case "$":case ";":case "[":case "%":this.tokLastMath=1;break;case "<":case "=":case ">":("<"==(c=this.charAt(a))||"="==c||">"==c)&&++a;this.tokLastMath=1;break;default:if(!JU.PT.isLetter(c)&&!this.isDotDot)return!1;case "~":case "_":case "'":case "?":"?"==c&&(this.tokLastMath=1);for(;JU.PT.isLetterOrDigit(c=this.charAt(a))||"_"==c||"*"==c&&"?"==this.charAt(a-1)||"?"==c||"~"==c||"'"==c||"\\"==c&&"?"==this.charAt(a+1)||"^"==c&&a>b&&JU.PT.isDigit(this.charAt(a-
1));)++a}this.cchToken=a-b;return!0},"~N");e(c$,"lookForSyncID",function(){var a;if('"'==(a=this.charAt(this.ichToken))||"@"==a||"\x00"==a)return!1;for(var b=this.ichToken;!JS.ScriptCompiler.isSpaceOrTab(a=this.charAt(b))&&"#"!=a&&"}"!=a&&!this.eol(a);)++b;this.cchToken=b-this.ichToken;return!0});e(c$,"ERROR",function(a){this.errorIntStr2(a,null,null);return 4},"~N");e(c$,"ERROR",function(a,b){this.errorStr(a,b);return 4},"~N,~S");e(c$,"handleError",function(){this.errorType=this.errorMessage;this.errorLine=
this.script.substring(this.ichCurrentCommand,this.ichEnd<=this.ichCurrentCommand?this.ichToken:this.ichEnd);var a=(this.ichToken<this.ichEnd?this.errorLine.substring(0,this.ichToken-this.ichCurrentCommand)+" >>>> "+this.errorLine.substring(this.ichToken-this.ichCurrentCommand):this.errorLine)+" <<<<";this.errorMessage=J.i18n.GT._("script compiler ERROR: ")+this.errorMessage+JS.ScriptError.getErrorLineMessage(null,this.filename,this.lineCurrent,this.iCommand,a);if(!this.isSilent){for(this.ichToken=
Math.max(this.ichEnd,this.ichToken);!this.lookingAtEndOfLine()&&!this.lookingAtTerminator();)this.ichToken++;this.errorLine=this.script.substring(this.ichCurrentCommand,this.ichToken);this.vwr.addCommand(this.errorLine+"#??");JU.Logger.error(this.errorMessage)}return!1});M(c$,"OK",0,"OK2",1,"CONTINUE",2,"EOL",3,"$ERROR",4)});C("JS");E(["J.thread.JmolThread"],"JS.ScriptDelayThread",null,function(){c$=H(function(){this.seconds=this.millis=0;this.isPauseDelay=this.doPopPush=!1;D(this,arguments)},JS,
"ScriptDelayThread",J.thread.JmolThread);G(c$,function(a,b,c){S(this,JS.ScriptDelayThread,[]);this.setViewer(b,"ScriptDelayThread");this.millis=c;this.setEval(a)},"J.api.JmolScriptEvaluator,JV.Viewer,~N");p(c$,"run1",function(a){for(;;)switch(a){case -1:var b;this.doPopPush=0<this.millis;this.isPauseDelay=-100==this.millis;if(this.doPopPush){if(0<(b=this.vwr.getDelayMaximumMs())&&this.millis>b)this.millis=b}else this.millis=-this.millis;this.millis-=System.currentTimeMillis()-this.startTime;this.isJS?
this.seconds=0:(this.seconds=I(this.millis/1E3),this.millis-=1E3*this.seconds,0>=this.millis&&(this.millis=1));this.doPopPush&&this.vwr.popHoldRepaint("scriptDelayThread INIT");a=0;break;case 0:if(this.stopped||this.eval.isStopped()){a=-2;break}if(!this.runSleep(0<this.seconds--?1E3:this.millis,-2))return;0>this.seconds&&(this.millis=0);a=0<this.seconds||0<this.millis?0:-2;break;case -2:this.doPopPush&&this.vwr.pushHoldRepaintWhy("delay FINISH");this.isPauseDelay&&this.eval.notifyResumeStatus();this.resumeEval();
return}},"~N");M(c$,"PAUSE_DELAY",-100)});C("JS");E(["J.api.JmolScriptEvaluator"],"JS.ScriptError",["java.lang.NullPointerException","JU.PT","J.i18n.GT","JS.ScriptException"],function(){c$=H(function(){this.vwr=null;this.$error=this.ignoreError=this.chk=!1;this.errorType=this.errorMessageUntranslated=this.errorMessage=null;this.iCommandError=0;D(this,arguments)},JS,"ScriptError",null,J.api.JmolScriptEvaluator);p(c$,"getErrorMessage",function(){return this.errorMessage});p(c$,"getErrorMessageUntranslated",
function(){return null==this.errorMessageUntranslated?this.errorMessage:this.errorMessageUntranslated});e(c$,"invArg",function(){this.error(22)});e(c$,"bad",function(){this.error(2)});e(c$,"integerOutOfRange",function(a,b){this.errorOrWarn(21,""+a,""+b,null,!0)},"~N,~N");e(c$,"numberOutOfRange",function(a,b){this.errorOrWarn(36,""+a,""+b,null,!0)},"~N,~N");e(c$,"error",function(a){this.errorOrWarn(a,null,null,null,!1)},"~N");e(c$,"errorStr",function(a,b){this.errorOrWarn(a,b,null,null,!1)},"~N,~S");
e(c$,"errorStr2",function(a,b,c){this.errorOrWarn(a,b,c,null,!1)},"~N,~S,~S");e(c$,"errorMore",function(a,b,c,d){this.errorOrWarn(a,b,c,d,!1)},"~N,~S,~S,~S");e(c$,"warning",function(a,b,c){this.errorOrWarn(a,b,c,null,!0)},"~N,~S,~S");e(c$,"errorOrWarn",function(a,b,c,d,f){var g=this.ignoreError?null:JS.ScriptError.errorString(a,b,c,d,!0);a=this.ignoreError||!J.i18n.GT.getDoTranslate()?null:JS.ScriptError.errorString(a,b,c,d,!1);f||this.evalError(g,a);this.showString(g)},"~N,~S,~S,~S,~B");e(c$,"evalError",
function(a,b){if(this.ignoreError)throw new NullPointerException;this.chk||(this.setCursorWait(!1),this.vwr.setBooleanProperty("refreshing",!0),this.vwr.setStringProperty("_errormessage",b));throw new JS.ScriptException(this,a,b,!0);},"~S,~S");e(c$,"setCursorWait",function(a){this.chk||this.vwr.setCursor(a?3:0)},"~B");c$.errorString=e(c$,"errorString",function(a,b,c,d,f){d=!1;!f&&!0==(d=J.i18n.GT.getDoTranslate())&&J.i18n.GT.setDoTranslate(!1);switch(a){default:a="Unknown error message number: "+
a;break;case 0:a=J.i18n.GT._("x y z axis expected");break;case 1:a=J.i18n.GT._("{0} not allowed with background model displayed");break;case 2:a=J.i18n.GT._("bad argument count");break;case 3:a=J.i18n.GT._("Miller indices cannot all be zero.");break;case 4:a=J.i18n.GT._("bad [R,G,B] color");break;case 5:a=J.i18n.GT._("boolean expected");break;case 6:a=J.i18n.GT._("boolean or number expected");break;case 7:a=J.i18n.GT._("boolean, number, or {0} expected");break;case 56:a=J.i18n.GT._("cannot set value");
break;case 8:a=J.i18n.GT._("color expected");break;case 9:a=J.i18n.GT._("a color or palette name (Jmol, Rasmol) is required");break;case 10:a=J.i18n.GT._("command expected");break;case 11:a=J.i18n.GT._("{x y z} or $name or (atom expression) required");break;case 12:a=J.i18n.GT._("draw object not defined");break;case 13:a=J.i18n.GT._("unexpected end of script command");break;case 14:a=J.i18n.GT._("valid (atom expression) expected");break;case 15:a=J.i18n.GT._("(atom expression) or integer expected");
break;case 16:a=J.i18n.GT._("filename expected");break;case 17:a=J.i18n.GT._("file not found");break;case 18:a=J.i18n.GT._("incompatible arguments");break;case 19:a=J.i18n.GT._("insufficient arguments");break;case 20:a=J.i18n.GT._("integer expected");break;case 21:a=J.i18n.GT._("integer out of range ({0} - {1})");break;case 22:a=J.i18n.GT._("invalid argument");break;case 23:a=J.i18n.GT._("invalid parameter order");break;case 24:a=J.i18n.GT._("keyword expected");break;case 25:a=J.i18n.GT._("no MO coefficient data available");
break;case 26:a=J.i18n.GT._("An MO index from 1 to {0} is required");break;case 27:a=J.i18n.GT._("no MO basis/coefficient data available for this frame");break;case 28:a=J.i18n.GT._("no MO occupancy data available");break;case 29:a=J.i18n.GT._("Only one molecular orbital is available in this file");break;case 30:a=J.i18n.GT._("{0} require that only one model be displayed");break;case 55:a=J.i18n.GT._("{0} requires that only one model be loaded");break;case 31:a=J.i18n.GT._("No data available");break;
case 32:a=J.i18n.GT._("No partial charges were read from the file; Jmol needs these to render the MEP data.");break;case 33:a=J.i18n.GT._("No unit cell");break;case 34:a=J.i18n.GT._("number expected");break;case 35:a=J.i18n.GT._("number must be ({0} or {1})");break;case 36:a=J.i18n.GT._("decimal number out of range ({0} - {1})");break;case 37:a=J.i18n.GT._("object name expected after '$'");break;case 38:a=J.i18n.GT._("plane expected -- either three points or atom expressions or {0} or {1} or {2}");
break;case 39:a=J.i18n.GT._("property name expected");break;case 40:a=J.i18n.GT._("space group {0} was not found.");break;case 41:a=J.i18n.GT._("quoted string expected");break;case 42:a=J.i18n.GT._("quoted string or identifier expected");break;case 43:a=J.i18n.GT._("too many rotation points were specified");break;case 44:a=J.i18n.GT._("too many script levels");break;case 45:a=J.i18n.GT._("unrecognized atom property");break;case 46:a=J.i18n.GT._("unrecognized bond property");break;case 47:a=J.i18n.GT._("unrecognized command");
break;case 48:a=J.i18n.GT._("runtime unrecognized expression");break;case 49:a=J.i18n.GT._("unrecognized object");break;case 50:a=J.i18n.GT._("unrecognized {0} parameter");break;case 51:a=J.i18n.GT._("unrecognized {0} parameter in Jmol state script (set anyway)");break;case 52:a=J.i18n.GT._("unrecognized SHOW parameter --  use {0}");break;case 53:a="{0}";break;case 54:a=J.i18n.GT._('write what? {0} or {1} "filename"')}0>a.indexOf("{0}")?null!=b&&(a+=": "+b):(a=JU.PT.rep(a,"{0}",b),0<=a.indexOf("{1}")?
a=JU.PT.rep(a,"{1}",c):null!=c&&(a+=": "+c),0<=a.indexOf("{2}")&&(a=JU.PT.rep(a,"{2}",c)));d&&J.i18n.GT.setDoTranslate(!0);return a},"~N,~S,~S,~S,~B");c$.getErrorLineMessage=e(c$,"getErrorLineMessage",function(a,b,c,d,f){var g="\n----";if(null!=b||null!=a)g+="line "+c+" command "+(d+1)+" of "+(null==a?b:a.equals("try")?"try":"function "+a)+":";return g+("\n         "+f)},"~S,~S,~N,~N,~S");e(c$,"setErrorMessage",function(a){this.errorMessageUntranslated=null;null==a?(this.$error=!1,this.errorMessage=
this.errorType=null,this.iCommandError=-1):(this.$error=!0,null==this.errorMessage&&(this.errorMessage=J.i18n.GT._("script ERROR: ")),this.errorMessage+=a)},"~S");M(c$,"ERROR_axisExpected",0,"ERROR_backgroundModelError",1,"ERROR_badArgumentCount",2,"ERROR_badMillerIndices",3,"ERROR_badRGBColor",4,"ERROR_booleanExpected",5,"ERROR_booleanOrNumberExpected",6,"ERROR_booleanOrWhateverExpected",7,"ERROR_colorExpected",8,"ERROR_colorOrPaletteRequired",9,"ERROR_commandExpected",10,"ERROR_coordinateOrNameOrExpressionRequired",
11,"ERROR_drawObjectNotDefined",12,"ERROR_endOfStatementUnexpected",13,"ERROR_expressionExpected",14,"ERROR_expressionOrIntegerExpected",15,"ERROR_filenameExpected",16,"ERROR_fileNotFoundException",17,"ERROR_incompatibleArguments",18,"ERROR_insufficientArguments",19,"ERROR_integerExpected",20,"ERROR_integerOutOfRange",21,"ERROR_invalidArgument",22,"ERROR_invalidParameterOrder",23,"ERROR_keywordExpected",24,"ERROR_moCoefficients",25,"ERROR_moIndex",26,"ERROR_moModelError",27,"ERROR_moOccupancy",28,
"ERROR_moOnlyOne",29,"ERROR_multipleModelsDisplayedNotOK",30,"ERROR_noData",31,"ERROR_noPartialCharges",32,"ERROR_noUnitCell",33,"ERROR_numberExpected",34,"ERROR_numberMustBe",35,"ERROR_numberOutOfRange",36,"ERROR_objectNameExpected",37,"ERROR_planeExpected",38,"ERROR_propertyNameExpected",39,"ERROR_spaceGroupNotFound",40,"ERROR_stringExpected",41,"ERROR_stringOrIdentifierExpected",42,"ERROR_tooManyPoints",43,"ERROR_tooManyScriptLevels",44,"ERROR_unrecognizedAtomProperty",45,"ERROR_unrecognizedBondProperty",
46,"ERROR_unrecognizedCommand",47,"ERROR_unrecognizedExpression",48,"ERROR_unrecognizedObject",49,"ERROR_unrecognizedParameter",50,"ERROR_unrecognizedParameterWarning",51,"ERROR_unrecognizedShowParameter",52,"ERROR_what",53,"ERROR_writeWhat",54,"ERROR_multipleModelsNotOK",55,"ERROR_cannotSet",56)});C("JS");E(["JS.ScriptExpr"],"JS.ScriptEval","java.lang.Boolean $.Float $.NullPointerException $.Thread java.util.Arrays $.Hashtable javajs.awt.Font JU.BArray $.BS $.Base64 $.Lst $.M3 $.M4 $.Measure $.P3 $.P4 $.PT $.Quat $.SB $.V3 J.api.Interface $.JmolParallelProcessor J.atomdata.RadiusData J.c.PAL $.STR $.VDW J.i18n.GT J.io.JmolBinary JM.BondSet $.Group JS.FileLoadThread $.SV $.ScriptCompiler $.ScriptContext $.ScriptDelayThread $.ScriptInterruption $.ScriptManager $.ScriptMathProcessor $.T JU.BSUtil $.ColorEncoder $.Edge $.Elements $.Escape $.Logger $.Parser $.SimpleUnitCell $.Txt JV.ActionManager $.FileManager $.JC $.StateManager $.Viewer".split(" "),
function(){c$=H(function(){this.sm=this.cmdIso=this.smilesExt=this.mathExt=null;this.isJS=!1;this.fileLoadThread=this.scriptDelayThread=null;this.allowJSThreads=!0;this.executing=this.executionStepping=this.executionPaused=this.executionStopped=this.tQuiet=this.listCommands=this.isCmdLine_c_or_C_Option=this.isCmdLine_C_Option=this.debugScript=this.historyDisabled=!1;this.timeEndExecution=this.timeBeginExecution=0;this.mustResumeEval=!1;this.outputBuffer=this.definedAtomSets=this.compiler=this.currentThread=
null;this.contextPath="";this.functionName=this.scriptFileName=null;this.$isStateScript=!1;this.commandHistoryLevelMax=this.scriptReportingLevel=this.scriptLevel=0;this.scriptExtensions=this.script=this.lineIndices=this.lineNumbers=this.aatoken=null;this.pc=0;this.fullCommand=this.thisCommand=null;this.pcEnd=this.lineEnd=0;this.forceNoAddHydrogens=!1;this.parallelProcessor=null;this.pcResume=-1;D(this,arguments)},JS,"ScriptEval",JS.ScriptExpr);e(c$,"getMathExt",function(){return null==this.mathExt?
(this.mathExt=this.getExt("Math")).init(this):this.mathExt});e(c$,"getSmilesExt",function(){return null==this.smilesExt?(this.smilesExt=this.getExt("Smiles")).init(this):this.smilesExt});e(c$,"getIsoExt",function(){return null==this.cmdIso?(this.cmdIso=this.getExt("Iso")).init(this):this.cmdIso});p(c$,"getAllowJSThreads",function(){return this.allowJSThreads});e(c$,"doReport",function(){return!this.tQuiet&&this.scriptLevel<=this.scriptReportingLevel});p(c$,"getDefinedAtomSets",function(){return this.definedAtomSets});
p(c$,"isStateScript",function(){return this.$isStateScript});p(c$,"getScript",function(){return this.script});G(c$,function(){this.currentThread=Thread.currentThread()});p(c$,"setViewer",function(a){this.vwr=a;this.compiler=null==this.compiler?a.compiler:this.compiler;this.isJS=a.isSingleThreaded;this.definedAtomSets=a.definedAtomSets;return this},"JV.Viewer");p(c$,"setCompiler",function(){this.vwr.compiler=this.compiler=new JS.ScriptCompiler(this.vwr)});p(c$,"compileScriptString",function(a,b){this.clearState(b);
this.contextPath="[script]";return this.compileScript(null,a,this.debugScript)},"~S,~B");p(c$,"compileScriptFile",function(a,b){this.clearState(b);this.contextPath=a;return this.compileScriptFileInternal(a,null,null,null)},"~S,~B");p(c$,"evaluateCompiledScript",function(a,b,c,d,f,g){var e=this.isCmdLine_C_Option;this.isCmdLine_C_Option=b;this.chk=this.isCmdLine_c_or_C_Option=a;this.historyDisabled=c;this.outputBuffer=f;this.currentThread=Thread.currentThread();this.allowJSThreads=g;this.listCommands=
d;this.timeBeginExecution=System.currentTimeMillis();this.executionStepping=this.executionStopped=this.executionPaused=!1;this.executing=!0;this.vwr.pushHoldRepaintWhy("runEval");this.setScriptExtensions();this.executeCommands(!1,!0);this.isCmdLine_C_Option=e;this.$isStateScript&&JS.ScriptManager.setStateScriptVersion(this.vwr,null)},"~B,~B,~B,~B,JU.SB,~B");e(c$,"useThreads",function(){return!this.chk&&!this.vwr.headless&&!this.vwr.autoExit&&this.vwr.haveDisplay&&null==this.outputBuffer&&this.allowJSThreads});
e(c$,"executeCommands",function(a,b){var c=!1;try{if(!this.dispatchCommands(!1,!1,a))return}catch(d){if(y(d,Error))this.vwr.handleError(d,!1),this.setErrorMessage(""+d+" "+this.vwr.getShapeErrorState()),this.errorMessageUntranslated=""+d,this.report(this.errorMessage),c=!0;else if(y(d,JS.ScriptException)){if(q(d,JS.ScriptInterruption)&&(!a||!d.isError))return;if(a){this.vwr.setStringProperty("_errormessage",""+d);return}this.setErrorMessage(d.toString());this.errorMessageUntranslated=d.getErrorMessageUntranslated();
this.report(this.errorMessage);this.vwr.notifyError(null!=this.errorMessage&&0<=this.errorMessage.indexOf("java.lang.OutOfMemoryError")?"Error":"ScriptException",this.errorMessage,this.errorMessageUntranslated);c=!0}else throw d;}if(c||!this.isJS||!this.allowJSThreads)this.vwr.setTainted(!0),this.vwr.popHoldRepaint("executeCommands "+(0<this.scriptLevel?"\u0001## REPAINT_IGNORE ##":""));this.timeEndExecution=System.currentTimeMillis();null==this.errorMessage&&this.executionStopped?this.setErrorMessage("execution interrupted"):
!this.tQuiet&&b&&this.vwr.scriptStatus("Script completed");this.executing=this.chk=this.isCmdLine_c_or_C_Option=this.historyDisabled=!1;c=this.getErrorMessageUntranslated();this.vwr.setErrorMessage(this.errorMessage,c);!this.tQuiet&&b&&this.vwr.setScriptStatus("Jmol script terminated",this.errorMessage,1+(this.timeEndExecution-this.timeBeginExecution),c)},"~B,~B");p(c$,"resumeEval",function(a){this.setErrorMessage(null);this.executionStopped||null==a||!a.mustResumeEval?this.resumeViewer("resumeEval"):
(this.executionPaused||a.pc++,this.thisContext=a,0<a.scriptLevel&&(this.scriptLevel=a.scriptLevel-1),this.restoreScriptContext(a,!0,!1,!1),this.pcResume=a.pc,this.executeCommands(a.isTryCatch,0>=this.scriptLevel),this.pcResume=-1)},"JS.ScriptContext");e(c$,"resumeViewer",function(a){this.vwr.setTainted(!0);this.vwr.popHoldRepaint(a);this.vwr.queueOnHold=!1},"~S");p(c$,"runScript",function(a){this.vwr.isPreviewOnly||this.runScriptBuffer(a,this.outputBuffer)},"~S");p(c$,"runScriptBuffer",function(a,
b){this.pushContext(null,"runScriptBuffer");this.contextPath+=" >> script() ";this.outputBuffer=b;this.allowJSThreads=!1;this.compileScript(null,a+"\u0001## EDITOR_IGNORE ##\u0001## REPAINT_IGNORE ##",!1)&&this.dispatchCommands(!1,!1,!1);this.popContext(!1,!1)},"~S,JU.SB");p(c$,"checkScriptSilent",function(a){a=this.compiler.compile(null,a,!1,!0,!1,!0);if(null!=a.errorType)return a;this.restoreScriptContext(a,!1,!1,!1);this.chk=!0;this.isCmdLine_c_or_C_Option=this.isCmdLine_C_Option=!1;this.pc=0;
try{this.dispatchCommands(!1,!1,!1)}catch(b){if(y(b,JS.ScriptException))this.setErrorMessage(b.toString()),a=this.getScriptContext("checkScriptSilent");else throw b;}this.chk=!1;return a},"~S");c$.getContextTrace=e(c$,"getContextTrace",function(a,b,c,d){null==c&&(c=new JU.SB);c.append(JS.ScriptError.getErrorLineMessage(b.functionName,b.scriptFileName,b.lineNumbers[b.pc],b.pc,JS.ScriptEval.statementAsString(a,b.statement,d?b.iToken:9999,!1)));null!=b.parentContext&&JS.ScriptEval.getContextTrace(a,
b.parentContext,c,!1);return c},"JV.Viewer,JS.ScriptContext,JU.SB,~B");p(c$,"setDebugging",function(){this.debugHigh=(this.debugScript=this.vwr.getBoolean(603979825))&&JU.Logger.debugging});p(c$,"haltExecution",function(){this.resumePausedExecution();this.executionStopped=!0});p(c$,"pauseExecution",function(a){!this.chk&&!this.vwr.headless&&(a&&!this.isJS&&this.delayScript(-100),this.vwr.popHoldRepaint("pauseExecution "+a),this.executionStepping=!1,this.executionPaused=!0)},"~B");p(c$,"stepPausedExecution",
function(){this.executionStepping=!0;this.executionPaused=!1});p(c$,"resumePausedExecution",function(){this.executionStepping=this.executionPaused=!1});p(c$,"isExecuting",function(){return this.executing&&!this.executionStopped});p(c$,"isPaused",function(){return this.executionPaused});p(c$,"isStepping",function(){return this.executionStepping});p(c$,"isStopped",function(){return this.executionStopped||!this.isJS&&this.currentThread!==Thread.currentThread()});p(c$,"getNextStatement",function(){return this.pc<
this.aatoken.length?JS.ScriptError.getErrorLineMessage(this.functionName,this.scriptFileName,this.getLinenumber(null),this.pc,JS.ScriptEval.statementAsString(this.vwr,this.aatoken[this.pc],-9999,this.debugHigh)):""});e(c$,"getCommand",function(a,b){if(a>=this.lineIndices.length)return"";if(b){for(var c=-1,d=this.script.length,f=0;f<this.lineNumbers.length;f++)if(this.lineNumbers[f]==this.lineNumbers[a])0>c&&(c=this.lineIndices[f][0]),d=this.lineIndices[f][1];else if(0==this.lineNumbers[f]||this.lineNumbers[f]>
this.lineNumbers[a])break;f=this.script;0<=f.indexOf("\u0001")&&(f=f.substring(0,f.indexOf("\u0001")));d==f.length-1&&f.endsWith("}")&&d++;return c==f.length||d<c?"":f.substring(Math.max(c,0),Math.min(f.length,d))}c=this.lineIndices[a][0];d=this.lineIndices[a][1];f="";if(0>c||d<=c||d>this.script.length)return"";try{f=this.script.substring(c,d),0<=f.indexOf("\\\n")&&(f=JU.PT.rep(f,"\\\n","  ")),0<=f.indexOf("\\\r")&&(f=JU.PT.rep(f,"\\\r","  ")),0<f.length&&!f.endsWith(";")&&(f+=";")}catch(g){if(y(g,
Exception))JU.Logger.error("darn problem in Eval getCommand: ichBegin="+c+" ichEnd="+d+" len = "+this.script.length+"\n"+g);else throw g;}return f},"~N,~B,~B");e(c$,"logDebugScript",function(a,b){this.iToken=-9999;if(this.debugHigh){0<a.length&&JU.Logger.debug(a[0].toString());for(var c=1;c<a.length;++c)null!=a[c]&&JU.Logger.debug(a[c].toString());var c=new JU.SB,d=0<b?"                          ".substring(0,2*b):"";c.append(d).append(JS.ScriptEval.statementAsString(this.vwr,a,this.iToken,this.debugHigh));
this.vwr.scriptStatus(c.toString())}else c=this.getCommand(this.pc,!1,!1),""!==c&&this.vwr.scriptStatus(c)},"~A,~N");p(c$,"evaluateExpression",function(a,b,c){var d=(new JS.ScriptEval).setViewer(this.vwr);try{d.pushContext(null,"evalExp"),d.allowJSThreads=!1}catch(f){if(!y(f,JS.ScriptException))throw f;}var g=this.executing;a=d.evaluate(a,b,c);this.executing=g;return a},"~O,~B,~B");e(c$,"evaluate",function(a,b,c){try{if(q(a,String)){if(this.compileScript(null,"e_x_p_r_e_s_s_i_o_n = "+a,!1)){if(c)return this.aatoken[0];
this.contextVariables=this.vwr.getContextVariables();this.setStatement(this.aatoken[0]);return b?this.parameterExpressionList(2,-1,!1).get(0):this.parameterExpressionString(2,0)}}else if(q(a,Array)){this.contextVariables=this.vwr.getContextVariables();var d=this.atomExpression(a,0,0,!0,!1,!0,!1);return b?JS.SV.newV(10,d):d}}catch(f){if(y(f,Exception))JU.Logger.error("Error evaluating: "+a+"\n"+f);else throw f;}return b?JS.SV.getVariable("ERROR"):"ERROR"},"~O,~B,~B");p(c$,"checkSelect",function(a,
b){var c=!1;try{this.pushContext(null,"checkSelect"),c=this.parameterExpressionSelect(a,b)}catch(d){if(y(d,Exception))JU.Logger.error("checkSelect "+d);else throw d;}this.popContext(!1,!1);return c},"java.util.Map,~A");p(c$,"getAtomBitSet",function(a){if(q(a,JU.BS))return a;var b=new JU.BS;try{this.pushContext(null,"getAtomBitSet");var c="select ("+a+")",c=JU.PT.replaceAllCharacters(c,"\n\r","),("),c=JU.PT.rep(c,"()","(none)");this.compileScript(null,c,!1)&&(this.st=this.aatoken[0],b=this.atomExpression(this.st,
1,0,!1,!1,!0,!0));this.popContext(!1,!1)}catch(d){if(y(d,Exception))JU.Logger.error("getAtomBitSet "+a+"\n"+d);else throw d;}return b},"~O");p(c$,"getAtomBitSetVector",function(a,b){for(var c=new JU.Lst,d=this.getAtomBitSet(b),f=d.nextSetBit(0);0<=f;f=d.nextSetBit(f+1))c.addLast(Integer.$valueOf(f));return c},"~N,~O");e(c$,"compileScript",function(a,b,c){this.scriptFileName=a;b=this.fixScriptPath(b,a);this.restoreScriptContext(this.compiler.compile(a,b,!1,!1,c&&JU.Logger.debugging,!1),!1,!1,!1);this.forceNoAddHydrogens=
(this.$isStateScript=this.compiler.isStateScript)&&0>this.script.indexOf("pdbAddHydrogens");a=this.script;this.pc=this.setScriptExtensions();!this.chk&&(this.vwr.scriptEditorVisible&&0>b.indexOf("\u0001## EDITOR_IGNORE ##"))&&this.vwr.scriptStatus("");this.script=a;return!this.$error},"~S,~S,~B");e(c$,"fixScriptPath",function(a,b){if(null!=b&&0<=a.indexOf("$SCRIPT_PATH$")){var c=b,d=Math.max(b.lastIndexOf("|"),b.lastIndexOf("/")),c=c.substring(0,d+1);a=JU.PT.rep(a,"$SCRIPT_PATH$/",c);a=JU.PT.rep(a,
"$SCRIPT_PATH$",c)}return a},"~S,~S");e(c$,"setScriptExtensions",function(){var a=this.scriptExtensions;if(null==a)return 0;var b=a.indexOf("##SCRIPT_STEP");0<=b&&(this.executionStepping=!0);b=a.indexOf("##SCRIPT_START=");if(0>b)return 0;b=JU.PT.parseInt(a.substring(b+15));if(-2147483648==b)return 0;for(this.pc=0;this.pc<this.lineIndices.length&&!(this.lineIndices[this.pc][0]>b||this.lineIndices[this.pc][1]>=b);this.pc++);0<this.pc&&(this.pc<this.lineIndices.length&&this.lineIndices[this.pc][0]>b)&&
--this.pc;return this.pc});e(c$,"compileScriptFileInternal",function(a,b,c,d){if(0==a.toLowerCase().indexOf("javascript:"))return this.compileScript(a,this.vwr.jsEval(a.substring(11)),this.debugScript);var f=Array(2);f[0]=a;if(!this.vwr.fm.getFileDataAsString(f,-1,!1,!0,!1))return this.setErrorMessage("io error reading "+f[0]+": "+f[1]),!1;if(0<=("\n"+f[1]).indexOf("\nJmolManifest.txt\n")){var g;if(a.endsWith(".all.pngj")||a.endsWith(".all.png"))g="|state.spt",a+="|";else{f[0]=a+="|JmolManifest.txt";
if(!this.vwr.fm.getFileDataAsString(f,-1,!1,!0,!1))return this.setErrorMessage("io error reading "+f[0]+": "+f[1]),!1;g=J.io.JmolBinary.getManifestScriptPath(f[1])}if(null!=g&&0<g.length&&(f[0]=a=a.substring(0,a.lastIndexOf("|"))+g,!this.vwr.fm.getFileDataAsString(f,-1,!1,!0,!1)))return this.setErrorMessage("io error reading "+f[0]+": "+f[1]),!1}this.scriptFileName=a;f[1]=J.io.JmolBinary.getEmbeddedScript(f[1]);f=this.fixScriptPath(f[1],f[0]);null==d&&(d=this.vwr.fm.getFilePath(a,!1,!1),d=d.substring(0,
Math.max(d.lastIndexOf("|"),d.lastIndexOf("/"))));f=JV.FileManager.setScriptFileReferences(f,b,c,d);return this.compileScript(a,f,this.debugScript)},"~S,~S,~S,~S");p(c$,"evalFunctionFloat",function(a,b,c){try{for(var d=0;d<c.length;d++)b.get(d).value=Float.$valueOf(c[d]);return JS.SV.fValue(this.runFunctionAndRet(a,a.name,b,null,!0,!1,!1))}catch(f){if(y(f,Exception))return NaN;throw f;}},"~O,~O,~A");p(c$,"getUserFunctionResult",function(a,b,c){return this.runFunctionAndRet(null,a,b,c,!0,!0,!1)},"~S,JU.Lst,JS.SV");
e(c$,"runFunctionAndRet",function(a,b,c,d,f,g,e){if(null==a){b=b.toLowerCase();a=this.vwr.getFunction(b);if(null==a)return null;g&&(this.contextPath+=" >> function "+b)}else g&&(this.contextPath+=" >> "+b);this.pushContext(null,"runFunctionAndRet ");this.allowJSThreads&&(this.allowJSThreads=e);g=364558==a.getTok();this.thisContext.isTryCatch=g;this.thisContext.isFunction=!g;this.functionName=b;if(g){this.resetError();this.thisContext.displayLoadErrorsSave=this.vwr.displayLoadErrors;this.thisContext.tryPt=
++this.vwr.tryPt;this.vwr.displayLoadErrors=!1;this.restoreFunction(a,c,d);this.contextVariables.put("_breakval",JS.SV.newI(2147483647));this.contextVariables.put("_errorval",JS.SV.newS(""));a=this.contextVariables;for(this.executeCommands(!0,!1);this.thisContext.tryPt>this.vwr.tryPt;)this.popContext(!1,!1);this.processTry(a);return null}q(a,J.api.JmolParallelProcessor)?(this.parallelProcessor=a,this.restoreFunction(a,c,d),this.dispatchCommands(!1,!0,!1),a.runAllProcesses(this.vwr)):(this.restoreFunction(a,
c,d),this.dispatchCommands(!1,!0,!1));a=f?this.getContextVariableAsVariable("_retval"):null;this.popContext(!1,!1);return a},"J.api.JmolScriptFunction,~S,JU.Lst,JS.SV,~B,~B,~B");e(c$,"processTry",function(a){this.vwr.displayLoadErrors=this.thisContext.displayLoadErrorsSave;this.popContext(!1,!1);var b=this.vwr.getP("_errormessage");0<b.length&&(a.put("_errorval",JS.SV.newS(b)),this.resetError());a.put("_tryret",a.get("_retval"));b=a.get("_tryret");if(null!=b.value||2147483647!=b.intValue)this.cmdReturn(b);
else{b=a.get("_errorval").value;if(0==b.length&&(a=a.get("_breakval").intValue,2147483647!=a)){this.breakAt(this.pc-a);return}this.pc+1<this.aatoken.length&&102412==this.aatoken[this.pc+1][0].tok&&(a=this.aatoken[this.pc+1][0],null!=a.contextVariables&&null!=a.name0&&a.contextVariables.put(a.name0,JS.SV.newS(b)),a.intValue=(0<b.length?1:-1)*Math.abs(a.intValue))}},"java.util.Map");e(c$,"breakAt",function(a){if(0>a)this.getContextVariableAsVariable("_breakval").intValue=-a,this.pcEnd=this.pc;else{var b=
Math.abs(this.aatoken[a][0].intValue),c=this.aatoken[a][0].tok;if(102411==c||102413==c)this.theToken=this.aatoken[b--][0],a=Math.abs(this.theToken.intValue),1150985!=this.theToken.tok&&(this.theToken.intValue=-a);else for(this.pc=-1;this.pc!=a&&null!=this.thisContext;){for(;null!=this.thisContext&&!JS.ScriptCompiler.isBreakableContext(this.thisContext.token.tok);)this.popContext(!0,!1);this.pc=this.thisContext.pc;this.popContext(!0,!1)}this.pc=b}},"~N");e(c$,"restoreFunction",function(a,b,c){this.aatoken=
a.aatoken;this.lineNumbers=a.lineNumbers;this.lineIndices=a.lineIndices;this.script=a.script;this.pc=0;null!=a.names&&(this.contextVariables=new java.util.Hashtable,a.setVariables(this.contextVariables,b));null!=c&&this.contextVariables.put("_x",c)},"J.api.JmolScriptFunction,JU.Lst,JS.SV");p(c$,"clearDefinedVariableAtomSets",function(){this.definedAtomSets.remove("# variable")});e(c$,"defineSets",function(){if(!this.definedAtomSets.containsKey("# static")){for(var a=0;a<JV.JC.predefinedStatic.length;a++)this.defineAtomSet(JV.JC.predefinedStatic[a]);
this.defineAtomSet("# static")}if(!this.definedAtomSets.containsKey("# variable")){for(a=0;a<JV.JC.predefinedVariable.length;a++)this.defineAtomSet(JV.JC.predefinedVariable[a]);for(a=JU.Elements.elementNumberMax;0<=--a;){var b=" elemno="+a;this.defineAtomSet("@"+JU.Elements.elementNameFromNumber(a)+b);this.defineAtomSet("@_"+JU.Elements.elementSymbolFromNumber(a)+b)}for(a=4;0<=--a;)b="@"+JU.Elements.altElementNameFromIndex(a)+" _e="+JU.Elements.altElementNumberFromIndex(a),this.defineAtomSet(b);for(a=
JU.Elements.altElementMax;4<=--a;){var c=JU.Elements.altElementNumberFromIndex(a),d=" _e="+c,b="@_"+JU.Elements.altElementSymbolFromIndex(a);this.defineAtomSet(b+d);b="@_"+JU.Elements.altIsotopeSymbolFromIndex(a);this.defineAtomSet(b+d);b="@_"+JU.Elements.altIsotopeSymbolFromIndex2(a);this.defineAtomSet(b+d);b="@"+JU.Elements.altElementNameFromIndex(a);1<b.length&&this.defineAtomSet(b+d);b=JU.Elements.getElementNumber(c);c=JU.Elements.getNaturalIsotope(b);0<c&&(d=JU.Elements.elementSymbolFromNumber(b),
this.defineAtomSet("@_"+d+c+" _e="+b),this.defineAtomSet("@_"+c+d+" _e="+b))}this.defineAtomSet("# variable")}});e(c$,"defineAtomSet",function(a){if(0==a.indexOf("#"))this.definedAtomSets.put(a,Boolean.TRUE);else{var b=this.compiler.compile("#predefine",a,!0,!1,!1,!1);if(null!=b.errorType)this.vwr.scriptStatus("JmolConstants.java ERROR: predefined set compile error:"+a+"\ncompile error:"+b.errorMessageUntranslated);else if(1!=b.aatoken.length)this.vwr.scriptStatus("JmolConstants.java ERROR: predefinition does not have exactly 1 command:"+
a);else if(b=b.aatoken[0],2>=b.length)this.vwr.scriptStatus("JmolConstants.java ERROR: bad predefinition length:"+a);else{var c=b[1].tok;!JS.T.tokAttr(c,1073741824)&&!JS.T.tokAttr(c,3145728)?this.vwr.scriptStatus("JmolConstants.java ERROR: invalid variable name:"+a):(a=b[1].value.toLowerCase(),a.startsWith("dynamic_")&&(a="!"+a.substring(8)),this.definedAtomSets.put(a,b))}}},"~S");p(c$,"lookupIdentifierValue",function(a){var b=this.lookupValue(a,!1);if(null!=b)return JU.BSUtil.copy(b);b=this.getAtomBits(1073741824,
a);return null==b?new JU.BS:b},"~S");e(c$,"lookupValue",function(a,b){if(this.chk)return new JU.BS;this.defineSets();a=a.toLowerCase();var c=this.definedAtomSets.get(a),d=!1;null==c&&(c=this.definedAtomSets.get("!"+a),d=null!=c);if(q(c,JU.BS))return c;if(q(c,Array))return this.pushContext(null,"lookupValue"),c=this.atomExpression(c,-2,0,!0,!1,!0,!0),this.popContext(!1,!1),d||this.definedAtomSets.put(a,c),c;if(a.equals("water"))return c=this.vwr.ms.getAtoms(1613758488,null),d||this.definedAtomSets.put(a,
c),c;if(b)return null;d=a.length;if(5>d||"s"!=a.charAt(d-1))return null;a=a.endsWith("ies")?a.substring(0,d-3)+"y":a.substring(0,d-1);return this.lookupValue(a,!0)},"~S,~B");p(c$,"deleteAtomsInVariables",function(a){for(var b,c=this.definedAtomSets.entrySet().iterator();c.hasNext()&&((b=c.next())||1);){var d=b.getValue();q(d,JU.BS)&&(JU.BSUtil.deleteBits(d,a),b.getKey().startsWith("!")||this.vwr.g.setUserVariable("@"+b.getKey(),JS.SV.newV(10,d)))}},"JU.BS");p(c$,"getContextVariables",function(){return this.contextVariables});
p(c$,"getThisContext",function(){return this.thisContext});e(c$,"clearState",function(a){this.thisContext=null;this.scriptLevel=0;this.setErrorMessage(null);this.contextPath="";this.tQuiet=a},"~B");p(c$,"pushContextDown",function(a){this.scriptLevel--;this.pushContext2(null,a)},"~S");e(c$,"pushContext",function(a,b){100==this.scriptLevel&&this.error(44);this.pushContext2(a,b)},"JS.ContextToken,~S");e(c$,"pushContext2",function(a,b){this.thisContext=this.getScriptContext(b);this.thisContext.token=
a;if(null==a)this.scriptLevel=++this.thisContext.scriptLevel;else if(this.thisContext.scriptLevel=-1,this.contextVariables=new java.util.Hashtable,null!=a.contextVariables)for(var c,d=a.contextVariables.keySet().iterator();d.hasNext()&&((c=d.next())||1);)JS.ScriptCompiler.addContextVariable(this.contextVariables,c);(this.debugHigh||this.isCmdLine_c_or_C_Option)&&JU.Logger.info("--\x3e>----------------------".substring(0,Math.min(15,this.scriptLevel+5))+this.scriptLevel+" "+this.scriptFileName+" "+
a+" "+this.thisContext.id+" "+b+" path="+this.thisContext.contextPath)},"JS.ContextToken,~S");p(c$,"getScriptContext",function(a){var b=new JS.ScriptContext;this.debugHigh&&JU.Logger.info("creating context "+b.id+" for "+a+" path="+this.contextPath);b.scriptLevel=this.scriptLevel;b.parentContext=this.thisContext;b.contextPath=this.contextPath;b.scriptFileName=this.scriptFileName;b.parallelProcessor=this.parallelProcessor;b.functionName=this.functionName;b.script=this.script;b.lineNumbers=this.lineNumbers;
b.lineIndices=this.lineIndices;b.aatoken=this.aatoken;b.statement=this.st;b.statementLength=this.slen;b.pc=b.pc0=this.pc;b.lineEnd=this.lineEnd;b.pcEnd=this.pcEnd;b.iToken=this.iToken;b.theToken=this.theToken;b.theTok=this.theTok;b.outputBuffer=this.outputBuffer;b.vars=this.contextVariables;b.isStateScript=this.$isStateScript;b.errorMessage=this.errorMessage;b.errorType=this.errorType;b.iCommandError=this.iCommandError;b.chk=this.chk;b.executionStepping=this.executionStepping;b.executionPaused=this.executionPaused;
b.scriptExtensions=this.scriptExtensions;b.mustResumeEval=this.mustResumeEval;b.allowJSThreads=this.allowJSThreads;return b},"~S");e(c$,"popContext",function(a,b){if(null!=this.thisContext){0<this.thisContext.scriptLevel&&(this.scriptLevel=this.thisContext.scriptLevel-1);var c=a?this.getScriptContext("popFlow"):null;this.restoreScriptContext(this.thisContext,!0,a,b);null!=c&&this.restoreScriptContext(c,!0,!1,!0);if(this.debugHigh||this.isCmdLine_c_or_C_Option)JU.Logger.info("--<<------------".substring(0,
Math.min(15,this.scriptLevel+5))+(this.scriptLevel+1)+" "+this.scriptFileName+" isFlow "+a+" thisContext="+(null==this.thisContext?"":""+this.thisContext.id)+" pc="+this.pc+"--\x3e"+this.pc+" path="+(null==this.thisContext?"":this.thisContext.contextPath))}},"~B,~B");e(c$,"restoreScriptContext",function(a,b,c,d){this.executing=!this.chk;if(null!=a){if(!c&&(this.st=a.statement,this.slen=a.statementLength,this.pc=a.pc,this.lineEnd=a.lineEnd,this.pcEnd=a.pcEnd,d))return;this.mustResumeEval=a.mustResumeEval;
this.script=a.script;this.lineNumbers=a.lineNumbers;this.lineIndices=a.lineIndices;this.aatoken=a.aatoken;this.contextVariables=a.vars;this.scriptExtensions=a.scriptExtensions;b?(this.contextPath=a.contextPath,d=null==this.contextPath?-1:this.contextPath.indexOf(" >> "),0<=d&&(this.contextPath=this.contextPath.substring(0,d)),this.scriptFileName=a.scriptFileName,this.parallelProcessor=a.parallelProcessor,this.functionName=a.functionName,this.iToken=a.iToken,this.theToken=a.theToken,this.theTok=a.theTok,
this.outputBuffer=a.outputBuffer,this.$isStateScript=a.isStateScript,this.thisContext=a.parentContext,this.allowJSThreads=a.allowJSThreads,(this.debugHigh||this.isCmdLine_c_or_C_Option)&&JU.Logger.info("--r------------".substring(0,Math.min(15,this.scriptLevel+5))+this.scriptLevel+" "+this.scriptFileName+" isPop "+b+" isFlow "+c+" context.id="+a.id+" pc="+this.pc+"--\x3e"+a.pc+" "+this.contextPath)):(this.$error=null!=a.errorType,this.errorMessage=a.errorMessage,this.errorMessageUntranslated=a.errorMessageUntranslated,
this.iCommandError=a.iCommandError,this.errorType=a.errorType)}},"JS.ScriptContext,~B,~B,~B");e(c$,"setException",function(a,b,c){a.untranslated=null==c?b:c;c="!".equals(c);this.errorType=b;this.iCommandError=this.pc;if(null==a.message)a.message="";else{for(var d=JS.ScriptEval.getContextTrace(this.vwr,this.getScriptContext("setException"),null,!0).toString();null!=this.thisContext&&!this.thisContext.isTryCatch;)this.popContext(!1,!1);a.message+=d;a.untranslated+=d;this.resumeViewer(c?"throw context":
"scriptException");if(!c&&!(null!=this.thisContext||this.chk||0<=b.indexOf("NOTE: file recognized as a script file: ")))JU.Logger.error("eval ERROR: "+this.toString()),this.vwr.autoExit&&this.vwr.exitJmol()}},"JS.ScriptException,~S,~S");c$.statementAsString=e(c$,"statementAsString",function(a,b,c,d){if(0==b.length)return"";var f=new JU.SB,g=b[0].tok;switch(g){case 0:return b[0].value;case 1150985:if(2==b.length&&(135368713==b[1].tok||102436==b[1].tok))return b[1].value.toString()}for(var e=!0,h=!1,
n=!1,g=1<b.length&&1085443==g&&b[0].value.equals("")&&(61==b[0].intValue||35==b[0].intValue)&&1048577!=b[1].tok,l=b.length,j=0;j<l;++j){var m=b[j];if(null==m){l=j;break}c==j-1&&f.append(" <<");0!=j&&f.appendC(" ");if(2==j&&g&&((g=269484436!=m.tok)||35==b[0].intValue))if(f.append(g?"= ":"== "),!g)continue;c==j&&1048578!=m.tok&&f.append(">> ");switch(m.tok){case 1048577:e&&f.append("{");continue;case 1048578:n&&j==b.length-1&&(e=!1);e&&f.append("}");continue;case 269484096:case 269484097:break;case 1048586:case 1048590:h=
1048586==m.tok;break;case 1060866:if(0<j&&m.value.equals("define")){f.append("@");j+1<b.length&&1048577==b[j+1].tok&&(e||(n=!0),e=!0);continue}break;case 1048589:f.append("true");continue;case 1048588:f.append("false");continue;case 135280132:break;case 2:f.appendI(m.intValue);continue;case 8:case 9:case 10:f.append(JS.SV.sValue(m));continue;case 6:if(Boolean.TRUE===m.value.get("$_BINARY_$")){f.append("<BINARY DATA>");continue}case 7:f.append(m.escape());continue;case 5:f.appendC("^");continue;case 1048615:2147483647!=
m.intValue?f.appendI(m.intValue):f.append(JM.Group.getSeqcodeStringFor(JS.ScriptExpr.getSeqCode(m))),m=b[++j],f.appendC(" "),f.append(h?"-":"- ");case 1048614:2147483647!=m.intValue?f.appendI(m.intValue):f.append(JM.Group.getSeqcodeStringFor(JS.ScriptExpr.getSeqCode(m)));continue;case 1048609:f.append("*:");f.append(a.getChainIDStr(m.intValue));continue;case 1048607:f.append("*%");null!=m.value&&f.append(m.value.toString());continue;case 1048610:f.append("*/");case 1048611:case 3:2147483647>m.intValue?
f.append(JU.Escape.escapeModelFileNumber(m.intValue)):f.append(""+m.value);continue;case 1048613:f.appendC("[");m=6*m.intValue+1;f.append(JM.Group.standardGroupList.substring(m,m+3).trim());f.appendC("]");continue;case 1048612:f.appendC("[");f.appendO(m.value);f.appendC("]");continue;case 1048608:f.append("*.");break;case 1095761925:if(q(m.value,JU.P3)){m=m.value;f.append("cell=").append(JU.Escape.eP(m));continue}break;case 4:f.append('"').appendO(m.value).append('"');continue;case 269484436:case 269484434:case 269484433:case 269484432:case 269484435:case 269484437:1716520985==
m.intValue?f.append(b[++j].value).append(" "):2147483647!=m.intValue&&f.append(JS.T.nameOf(m.intValue)).append(" ");break;case 364558:continue;case 1150985:f.append("end");continue;default:if(JS.T.tokAttr(m.tok,1073741824)||!d)break;f.appendC("\n").append(m.toString()).appendC("\n");continue}null!=m.value&&f.append(m.value.toString())}c>=l-1&&9999!=c&&f.append(" <<");return f.toString()},"JV.Viewer,~A,~N,~B");p(c$,"setObjectPropSafe",function(a,b){try{return this.setObjectProp(a,b,-1)}catch(c){if(y(c,
JS.ScriptException))return null;throw c;}},"~S,~N");p(c$,"restrictSelected",function(a,b){this.chk||this.sm.restrictSelected(a,b)},"~B,~B");p(c$,"showString",function(a){this.showStringPrint(a,!1)},"~S");e(c$,"showStringPrint",function(a,b){this.chk||null==a||(null!=this.outputBuffer&&JU.Logger.isActiveLevel(3)?this.outputBuffer.append(a).appendC("\n"):this.vwr.showString(a,b))},"~S,~B");e(c$,"report",function(a){this.chk||(null!=this.outputBuffer?this.outputBuffer.append(a).appendC("\n"):this.vwr.scriptStatus(a))},
"~S");e(c$,"addProcess",function(a,b,c){if(null!=this.parallelProcessor){for(var d=Array(c),f=0;f<a.size();f++)d[f+1-b]=a.get(f);a=this.getScriptContext("addProcess");a.aatoken=d;a.pc=1-b;a.pcEnd=c;this.parallelProcessor.addProcess("p"+ ++JS.ScriptEval.iProcess,a)}},"JU.Lst,~N,~N");e(c$,"checkContinue",function(){if(this.executionStopped)return!1;if(this.executionStepping&&this.isCommandDisplayable(this.pc))this.vwr.setScriptStatus("Next: "+this.getNextStatement(),"stepping -- type RESUME to continue",
0,null),this.executionPaused=!0;else if(!this.executionPaused)return!0;JU.Logger.debugging&&JU.Logger.debug("script execution paused at command "+(this.pc+1)+" level "+this.scriptLevel+": "+this.thisCommand);for(this.refresh(!1);this.executionPaused;){this.vwr.popHoldRepaint("pause \u0001## REPAINT_IGNORE ##");var a=this.vwr.getInsertedCommand();if(0<a.length){this.resumePausedExecution();this.setErrorMessage(null);var b=this.getScriptContext("script insertion");this.pc--;try{this.runScript(a)}catch(c){if(y(c,
Exception))this.setErrorMessage(""+c);else if(y(c,Error))this.setErrorMessage(""+c);else throw c;}this.$error&&(this.report(this.errorMessage),this.setErrorMessage(null));this.restoreScriptContext(b,!0,!1,!1);this.pauseExecution(!1)}this.doDelay(-100);this.vwr.pushHoldRepaintWhy("pause")}this.notifyResumeStatus();return!this.$error&&!this.executionStopped});e(c$,"delayScript",function(a){this.vwr.autoExit||(this.stopScriptThreads(),this.scriptDelayThread=new JS.ScriptDelayThread(this,this.vwr,a),
this.scriptDelayThread.run())},"~N");e(c$,"doDelay",function(a){if(this.useThreads()){if(this.isJS)throw new JS.ScriptInterruption(this,"delay",a);this.delayScript(a)}},"~N");p(c$,"evalParallel",function(a,b){return this.getCmdExt().evalParallel(a,b)},"JS.ScriptContext,JV.ShapeManager");e(c$,"isCommandDisplayable",function(a){return a>=this.aatoken.length||a>=this.pcEnd||null==this.aatoken[a]?!1:this.lineIndices[a][1]>this.lineIndices[a][0]},"~N");p(c$,"loadFileResourceAsync",function(a){this.loadFileAsync(null,
a,-Math.abs(a.hashCode()),!1)},"~S");e(c$,"loadFileAsync",function(a,b,c,d){if(null!=this.vwr.fm.cacheGet(b,!1))return b;null!=a&&(a="cache://local"+a);var f=this.pc+"_"+c+"_"+b,g;if(null==this.thisContext||null==this.thisContext.htFileCache)this.pushContext(null,"loadFileAsync"),this.thisContext.htFileCache=new java.util.Hashtable;g=this.thisContext.htFileCache.get(f);if(null!=g&&0<g.length)return this.fileLoadThread=null,this.popContext(!1,!1),this.vwr.queueOnHold=!1,("#CANCELED#".equals(g)||"#CANCELED#".equals(this.vwr.fm.cacheGet(g,
!1)))&&this.evalError("#CANCELED#",null),g;this.thisContext.htFileCache.put(f,g=a+System.currentTimeMillis());d&&this.vwr.cacheFileByName(a+"*",!1);this.fileLoadThread=new JS.FileLoadThread(this,this.vwr,b,f,g);this.vwr.testAsync?this.fileLoadThread.start():this.fileLoadThread.run();0>c&&(this.fileLoadThread=null);throw new JS.ScriptInterruption(this,"load",1);},"~S,~S,~N,~B");e(c$,"logLoadInfo",function(a){0<a.length&&JU.Logger.info(a);a=new JU.SB;var b=this.vwr.ms.mc;1<b&&a.append((this.vwr.am.isMovie?
this.vwr.am.getFrameCount()+" frames":b+" models")+"\n");for(var c=0;c<b;c++){var d=this.vwr.ms.getInfo(c,"moData");null!=d&&a.appendI(d.get("mos").size()).append(" molecular orbitals in model ").append(this.vwr.getModelNumberDotted(c)).append("\n")}0<a.length()&&this.vwr.showString(a.toString(),!1)},"~S");p(c$,"notifyResumeStatus",function(){!this.chk&&(!this.executionStopped&&!this.executionStepping)&&this.vwr.scriptStatus("script execution "+(this.$error||this.executionStopped?"interrupted":"resumed"));
JU.Logger.debugging&&JU.Logger.debug("script execution resumed")});p(c$,"refresh",function(a){this.chk||(this.vwr.setTainted(!0),this.vwr.requestRepaintAndWait("refresh cmd"),this.isJS&&a&&this.doDelay(10))},"~B");p(c$,"stopScriptThreads",function(){null!=this.scriptDelayThread&&(this.scriptDelayThread.interrupt(),this.scriptDelayThread=null);null!=this.fileLoadThread&&(this.fileLoadThread.interrupt(),this.fileLoadThread.resumeEval(),null!=this.thisContext&&this.popContext(!1,!1),this.fileLoadThread=
null)});e(c$,"getErrorLineMessage2",function(){return JS.ScriptError.getErrorLineMessage(this.functionName,this.scriptFileName,this.getLinenumber(null),this.pc,JS.ScriptEval.statementAsString(this.vwr,this.st,-9999,this.debugHigh))});e(c$,"getLinenumber",function(a){return null==a?this.lineNumbers[this.pc]:a.lineNumbers[a.pc]},"JS.ScriptContext");e(c$,"dispatchCommands",function(a,b,c){null==this.sm&&(this.sm=this.vwr.shm);this.debugScript=this.debugHigh=!1;this.chk||this.setDebugging();0==this.pcEnd&&
(this.pcEnd=2147483647);0==this.lineEnd&&(this.lineEnd=2147483647);if(null==this.aatoken)return!0;var d=this.isJS&&!b&&this.useThreads();this.commandLoop(d);if(this.chk)return!0;var f=this.vwr.getInsertedCommand();"".equals(f)?a&&(this.debugScript&&this.vwr.getBoolean(603979880))&&this.vwr.scriptStatus("script <exiting>"):this.runScriptBuffer(f,null);return!this.mustResumeEval&&!d||b?!0:!c&&this.mustResumeEval||null==this.thisContext?(a=null==this.thisContext,this.resumeEval(this.thisContext),this.mustResumeEval=
!1,a):!0},"~B,~B,~B");e(c$,"commandLoop",function(a){var b="",c=!1,d=null,f=System.currentTimeMillis();if(this.debugScript&&this.debugHigh&&!this.chk){for(var g=this.pc;g<this.aatoken.length&&g<this.pcEnd;g++)JU.Logger.info("Command "+g),this.debugScript&&this.logDebugScript(this.aatoken[g],0);JU.Logger.info("-----")}for(;this.pc<this.aatoken.length&&this.pc<this.pcEnd;this.pc++){a&&(!this.executionPaused&&1E3<System.currentTimeMillis()-f&&(this.pc--,this.doDelay(-1)),f=System.currentTimeMillis());
if(!this.chk&&!this.checkContinue())break;if(this.lineNumbers[this.pc]>this.lineEnd)break;this.debugHigh&&(g=0,g=System.currentTimeMillis(),this.vwr.scriptStatus("Eval.dispatchCommands():"+g),this.vwr.scriptStatus(this.script));this.debugScript&&!this.chk&&JU.Logger.info("Command "+this.pc+(null==this.thisContext?"":" path="+this.thisContext.contextPath));this.theToken=0==this.aatoken[this.pc].length?null:this.aatoken[this.pc][0];if(!this.historyDisabled&&(!this.chk&&this.scriptLevel<=this.commandHistoryLevelMax&&
!this.tQuiet)&&(g=this.getCommand(this.pc,!0,!0),null!=this.theToken&&0<g.length&&!g.equals(b)&&(135368713==this.theToken.tok||102436==this.theToken.tok||!JS.T.tokAttr(this.theToken.tok,102400))))this.vwr.addCommand(b=g);this.chk||(g=this.vwr.getInsertedCommand(),"".equals(g)||this.runScript(g));if(this.setStatement(this.aatoken[this.pc])){this.thisCommand=this.getCommand(this.pc,!1,!0);this.debugScript&&JU.Logger.info(this.thisCommand);g=this.getCommand(this.pc+1,!1,!0);this.fullCommand=this.thisCommand+
(g.startsWith("#")?g:"");this.getToken(0);this.iToken=0;if((this.listCommands||!this.chk&&0<this.scriptLevel)&&!this.isJS)if(g=this.vwr.getInt(536870922),this.listCommands||0<g)0<g&&this.delayScript(-g),this.vwr.scriptEcho("$["+this.scriptLevel+"."+this.lineNumbers[this.pc]+"."+(this.pc+1)+"] "+this.thisCommand);if(null!=d&&(1150985!=this.theTok||2>this.slen||102439!=this.st[1].tok))d.addLast(this.st);else{if(this.chk){if(this.isCmdLine_c_or_C_Option&&JU.Logger.info(this.thisCommand),1==this.slen&&
135368713!=this.st[0].tok&&102436!=this.st[0].tok)continue}else this.debugScript&&this.logDebugScript(this.st,0),0==this.scriptLevel&&this.vwr.g.logCommands&&this.vwr.log(this.thisCommand),this.debugHigh&&null!=this.theToken&&JU.Logger.debug(this.theToken.toString());null!=this.theToken&&(g=this.theToken.tok,JS.T.tokAttr(g,102400)?(c=this.cmdFlow(g,c,d),102439==this.theTok&&(d=null)):102439==g?(this.pushContext(this.theToken,"PROCESS"),null!=this.parallelProcessor&&(d=new JU.Lst)):this.processCommand(g),
this.setCursorWait(!1),this.executionStepping&&(this.executionPaused=this.isCommandDisplayable(this.pc+1)))}}else JU.Logger.info(this.getCommand(this.pc,!0,!1)+" -- STATEMENT CONTAINING @{} SKIPPED")}},"~B");e(c$,"terminateAfterStep",function(){this.pc=this.pcEnd});e(c$,"processCommand",function(a){if(JS.T.tokAttr(this.theToken.tok,135168))this.processShapeCommand(a);else switch(a){case 0:if(this.chk||!this.vwr.getBoolean(603979880))break;a=this.theToken.value;if(null==a)break;null==this.outputBuffer&&
this.vwr.warn(a);this.report(a);break;case 1276384259:this.pushContext(this.theToken,"PUSH");break;case 1276383249:this.popContext(!0,!1);break;case 269484066:break;case 4097:this.cmdAnimation();break;case 1610616835:this.cmdBackground(1);break;case 4100:this.cmdBind();break;case 4101:this.cmdBondorder();break;case 1069064:this.cmdCD();break;case 12289:this.cmdCenter(1);break;case 1766856708:this.cmdColor();break;case 1060866:this.cmdDefine();break;case 528397:this.cmdDelay();break;case 12291:this.cmdDelete();
break;case 554176526:this.cmdSlab(!0);break;case 1610625028:this.cmdDisplay(!0);break;case 266255:case 266281:if(this.chk)break;0<this.pc&&266255==this.theToken.tok&&this.vwr.clearScriptQueue();this.executionStopped=0<this.pc||!this.vwr.g.useScriptQueue;break;case 266256:if(this.chk)break;null!=this.outputBuffer&&JU.Logger.warn(this.outputBuffer.toString());this.vwr.exitJmol();break;case 1229984263:this.cmdFile();break;case 1060869:this.cmdFixed();break;case 4114:this.cmdFont(-1,0);break;case 4115:case 1095766030:this.cmdModel(1);
break;case 1073741824:this.cmdFunc();break;case 1276121098:this.cmdGetProperty();break;case 20500:if(this.vwr.headless)break;this.cmdGoto(!0);break;case 20482:this.cmdHelp();break;case 12294:this.cmdDisplay(!1);break;case 1612189718:this.cmdHbond();break;case 1610616855:this.cmdHistory(1);break;case 544771:this.cmdHover();break;case 266264:this.chk||this.vwr.initialize(!this.$isStateScript);break;case 4121:this.cmdInvertSelected();break;case 135287308:this.cmdScript(135287308,null,null);break;case 135271427:this.cmdLoad();
break;case 36869:this.cmdLog();break;case 528410:this.cmdLoop();break;case 20485:this.cmdMessage();break;case 4128:this.cmdMove();break;case 4130:this.cmdMoveto();break;case 20487:this.cmdPause();break;case 36865:this.cmdPrint();break;case 135304707:this.cmdPrompt();break;case 4139:case 4165:this.cmdUndoRedoMove();break;case 266284:this.refresh(!0);break;case 4141:this.cmdReset();break;case 12295:this.cmdRestrict();break;case 4143:if(0==this.slen){this.chk||this.resumePausedExecution();break}case 4142:this.cmdRestore();
break;case 36866:this.cmdReturn(null);break;case 528432:this.cmdRotate(!1,!1);break;case 4145:this.cmdRotate(!1,!0);break;case 4146:this.cmdSave();break;case 1085443:this.cmdSet();break;case 135271429:this.cmdScript(135271429,null,null);break;case 135280132:this.cmdSelect(1);break;case 1611141171:this.cmdSelectionHalos(1);break;case 554176565:this.cmdSlab(!1);break;case 1611141175:this.cmdRotate(!0,!1);break;case 1611141176:this.cmdSsbond();break;case 266298:this.cmdPause()&&this.stepPausedExecution();
break;case 1641025539:this.cmdStructure();break;case 3158024:this.cmdSubset();break;case 4156:this.cmdSync();break;case 36870:this.cmdThrow();break;case 536875070:this.cmdTimeout(1);break;case 4160:this.cmdTranslate(!1);break;case 4162:this.cmdTranslate(!0);break;case 4164:this.cmdUnbind();break;case 36868:break;case 4166:this.cmdVibration();break;case 1060873:this.cmdZap(!0);break;case 4168:this.cmdZoom(!1);break;case 4170:this.cmdZoom(!0);break;default:this.checkExtension(this.theToken.tok)}},"~N");
e(c$,"checkExtension",function(a){switch(a){case 4098:case 135270423:case 4102:case 4103:case 4105:case 135270405:case 1095766024:case 4106:case 528395:case 1612189718:case 528443:case 1052700:case 4126:case 1276121113:case 135270408:case 4131:case 4133:case 135270418:case 1052714:case 135270926:case 135270422:this.getCmdExt().dispatch(this.theToken.tok,!1,this.st);break;default:this.error(47)}},"~N");e(c$,"processShapeCommand",function(a){var b=0;switch(a){case 1611272194:b=34;break;case 1115297793:b=
9;break;case 1679429641:b=32;break;case 1113200642:b=11;break;case 135174:b=23;break;case 135402505:b=25;break;case 135175:b=17;break;case 1113198595:b=16;break;case 135176:b=22;break;case 537022465:b=31;break;case 1113198596:b=20;break;case 1611272202:b=36;break;case 1113198597:b=19;break;case 1113200646:b=8;break;case 135180:b=24;break;case 1826248716:b=5;break;case 135182:b=26;break;case 537006096:case 1746538509:b=6;break;case 1113200647:b=13;break;case 1073877010:b=27;break;case 1073877011:b=
28;break;case 135190:b=30;break;case 135188:b=29;break;case 135192:b=21;break;case 1113200649:b=14;break;case 1113200650:b=15;break;case 1113200651:b=0;break;case 1113200652:b=7;break;case 1650071565:b=12;break;case 1708058:b=4;break;case 1113200654:b=10;break;case 1614417948:b=33;break;case 135198:b=18;break;case 659488:b=1;break;default:this.error(47)}if(null==this.sm.getShape(b)&&2==this.slen)switch(this.st[1].tok){case 1048588:case 12291:case 1048587:return}switch(a){case 1115297793:case 1113200642:case 1113200647:case 1113200649:case 1113200650:case 1650071565:case 1113200654:this.setSizeBio(b);
return;case 1113198595:case 1113198597:this.cmdDots(b);return;case 1113200646:case 1113200651:case 1113200652:this.setSize(b,1113200646==a?-1E3:1);return;case 1826248716:this.cmdLabel(1);return;case 135198:this.cmdVector();return;case 659488:this.cmdWireframe();return}switch(a){case 1611272194:this.cmdAxes(1);break;case 1679429641:this.cmdBoundbox(1);break;case 537022465:this.cmdEcho(1);break;case 1611272202:this.cmdFrank(1);break;case 1614417948:this.cmdUnitcell(1);break;case 1113198596:case 537006096:case 1746538509:case 135192:case 1708058:this.getCmdExt().dispatch(b,
!1,this.st);break;case 135174:case 135402505:case 135175:case 135176:case 135180:case 135182:case 1073877010:case 1073877011:case 135190:case 135188:this.getIsoExt().dispatch(b,!1,this.st)}},"~N");e(c$,"cmdAnimation",function(){var a=!1;switch(this.getToken(1).tok){case 1048589:a=!0;case 1048588:this.chk||this.vwr.setAnimationOn(a);break;case 1073742030:a=B(this.floatParameter(2));this.chk||this.vwr.am.setMorphCount(Math.abs(a));break;case 1610625028:this.iToken=2;a=1048579==this.tokAt(2)?null:this.atomExpressionAt(2);
this.checkLength(this.iToken+1);this.chk||this.vwr.setAnimDisplay(a);break;case 4115:if(this.isArrayParameter(2)){a=this.expandFloatArray(this.floatParameterSet(2,0,2147483647),1);this.checkLength(this.iToken+1);if(this.chk)break;var b=new java.util.Hashtable;0<a.length&&b.put("frames",a);b.put("currentFrame",Integer.$valueOf(0));this.vwr.am.setMovie(b)}else this.cmdModel(2);break;case 1073742024:b=a=1;5<this.slen&&this.bad();var c=JS.T.getTokFromName(this.paramAsStr(2));switch(c){case 1073742070:a=
b=0;break;case 528410:case 1073742082:break;default:this.invArg()}4<=this.slen&&(a=b=this.floatParameter(3),5==this.slen&&(b=this.floatParameter(4)));this.chk||this.vwr.am.setAnimationReplayMode(c,a,b);break;case 1073741918:a=2;b=0;switch(this.tokAt(a)){case 269484192:b=-this.intParameter(++a);break;case 269484193:b=this.intParameter(++a);break;case 2:b=this.intParameter(a);break;default:this.invArg()}this.checkLength(++a);1!=b&&-1!=b&&this.errorStr2(35,"-1","1");this.chk||this.vwr.am.setAnimationDirection(b);
break;case 1074790526:this.setIntProperty("animationFps",this.intParameter(this.checkLast(2)));break;default:this.frameControl(1)}});e(c$,"cmdAxes",function(a){var b=this.tickParamAsStr(a,!0,!0,!1);a=this.iToken+1;var c=this.tokAt(a),d=this.optParameterAsString(a).toLowerCase();if(this.slen==a+1&&JU.PT.isOneOf(d,";window;unitcell;molecular;"))this.setBooleanProperty("axes"+d,!0);else{switch(c){case 12289:a=this.centerParameter(a+1);this.setShapeProperty(34,"origin",a);this.checkLast(this.iToken);
return;case 1141899272:a=this.stringParameter(a+1);JU.PT.isOneOf(a,";a;b;c;ab;ac;bc;abc;")||this.invArg();this.setShapeProperty(34,"type",a);this.checkLast(this.iToken);return;case 1073742138:this.setFloatProperty("axesScale",this.floatParameter(this.checkLast(++a)));return;case 1826248716:switch(c=this.tokAt(a+1)){case 1048588:case 1048589:this.checkLength(a+2);this.setShapeProperty(34,"labels"+(1048589==c?"On":"Off"),null);return}b=null;switch(this.slen-a){case 7:this.setShapeProperty(34,"labels",
[this.paramAsStr(++a),this.paramAsStr(++a),this.paramAsStr(++a),this.paramAsStr(++a),this.paramAsStr(++a),this.paramAsStr(++a)]);break;case 5:b=this.paramAsStr(a+4);case 4:this.setShapeProperty(34,"labels",[this.paramAsStr(++a),this.paramAsStr(++a),this.paramAsStr(++a),b]);break;default:this.bad()}return}d.equals("position")?(1048588==this.tokAt(++a)?a=new JU.P3:(a=this.xypParameter(a),null==a&&this.invArg()),this.setShapeProperty(34,"position",a)):(a=this.getSetAxesTypeMad(a),this.chk||2147483647==
a||(this.setObjectMad(34,"axes",a),null!=b&&this.setShapeProperty(34,"tickInfo",b)))}},"~N");e(c$,"cmdBackground",function(a){this.getToken(a);if(1073741979==this.theTok){var b=null;switch(this.tokAt(++a)){case 15:case 6:b=this.getToken(a).value;break;default:a=this.paramAsStr(this.checkLast(a));if(a.equalsIgnoreCase("none")||0==a.length){this.vwr.setBackgroundImage(null,null);return}b=a.startsWith(";base64,")?new JU.BArray(JU.Base64.decodeBase64(a)):a}this.chk||this.vwr.fm.loadImage(b,null)}else 1048587==
this.theTok||this.isColorParam(a)?(a=this.getArgbParamLast(a,!0),this.chk||(this.setObjectArgb("background",a),this.vwr.setBackgroundImage(null,null))):(b=this.getShapeType(this.theTok),this.colorShape(b,a+1,!0))},"~N");e(c$,"cmdBind",function(){var a=this.stringParameter(1),b=this.paramAsStr(2);this.checkLength(3);this.chk||this.vwr.bindAction(a,b)});e(c$,"cmdBondorder",function(){this.checkLength(-3);var a=0;switch(this.getToken(1).tok){case 2:case 3:131071==(a=JU.Edge.getBondOrderFromFloat(this.floatParameter(1)))&&
this.invArg();break;default:131071==(a=JS.ScriptParam.getBondOrderFromString(this.paramAsStr(1)))&&this.invArg(),33==a&&3==this.tokAt(2)&&(a=JS.ScriptParam.getPartialBondOrderFromFloatEncodedInt(this.st[2].intValue))}this.setShapeProperty(1,"bondOrder",Integer.$valueOf(a))});e(c$,"cmdBoundbox",function(a){var b=this.tickParamAsStr(a,!1,!0,!1);a=this.iToken+1;var c=1;if(1073742138==this.tokAt(a)&&(c=this.floatParameter(++a),!this.chk&&0==c&&this.invArg(),a++,a==this.slen)){this.chk||this.vwr.ms.setBoundBox(null,
null,!0,c);return}var d=1073741902==this.tokAt(a);d&&a++;if(this.isCenterParameter(a)){this.expressionResult=null;var f=a,g=this.centerParameter(a);a=this.iToken+1;if(d||this.isCenterParameter(a))f=d?this.centerParameter(a):this.getPoint3f(a,!0),a=this.iToken+1,this.chk||this.vwr.ms.setBoundBox(g,f,d,c);else if(null!=this.expressionResult&&q(this.expressionResult,JU.BS))this.chk||this.vwr.calcBoundBoxDimensions(this.expressionResult,c);else if(null==this.expressionResult&&1048582==this.tokAt(f)){if(this.chk)return;
a=this.getObjectBoundingBox(this.objectNameParameter(++f));null==a&&this.invArg();this.vwr.ms.setBoundBox(a[0],a[1],!0,c);a=this.iToken+1}else this.invArg();if(a==this.slen)return}c=this.getSetAxesTypeMad(a);this.chk||2147483647==c||(null!=b&&this.setShapeProperty(32,"tickInfo",b),this.setObjectMad(32,"boundbox",c))},"~N");e(c$,"cmdCD",function(){if(!this.chk){var a=1==this.slen?null:this.paramAsStr(1);this.showString(this.vwr.cd(a))}});e(c$,"cmdCenter",function(a){1==this.slen?this.vwr.setNewRotationCenter(null):
(a=this.centerParameter(a),null==a&&this.invArg(),this.chk||this.vwr.setNewRotationCenter(a))},"~N");e(c$,"cmdColor",function(){var a=1;if(this.isColorParam(1))this.theTok=1141899265;else{var b=0,a=2,c=this.getToken(1).tok;switch(c){case 1048582:this.setObjectProperty();return;case 1087373315:case 3145730:case 1087373316:case 1073741946:case 1632634891:case 1087373318:case 1114638362:case 1087373322:case 1073741991:case 1095761936:case 1073742029:case 1048587:case 1073742074:case 1112541195:case 1095761937:case 1716520985:case 1073742116:case 1073742110:case 1113200651:case 1073742144:case 1112539150:case 1641025539:case 1112539151:case 1112541196:case 603979967:case 1073742186:case 1649412120:this.theTok=
1141899265;a=1;break;case 4:a=1;b=this.stringParameter(a++);this.isArrayParameter(a)&&(b=b+="="+JS.SV.sValue(JS.SV.getVariableAS(this.stringParameterSet(a))).$replace("\n"," "),a=this.iToken+1);c=603979967==this.tokAt(a);this.chk||this.vwr.setPropertyColorScheme(b,c,!0);c&&++a;if(1073742114==this.tokAt(a)||1073741826==this.tokAt(a))b=this.floatParameter(++a),a=this.floatParameter(++a),this.chk||this.vwr.cm.setPropertyColorRange(b,a);return;case 1073742114:case 1073741826:b=this.floatParameter(2);
a=this.floatParameter(this.checkLast(3));this.chk||this.vwr.cm.setPropertyColorRange(b,a);return;case 1610616835:b=this.getArgbParamLast(2,!0);this.chk||this.setObjectArgb("background",b);return;case 10:case 1048577:a=-1;this.theTok=1141899265;break;case 1073742134:b=this.getArgbParamLast(2,!1);this.chk||this.vwr.cm.setRubberbandArgb(b);return;case 536870920:case 1611141171:a=2;1073742074==this.tokAt(2)&&a++;b=this.getArgbParamLast(a,!0);if(this.chk)return;this.sm.loadShape(8);this.setShapeProperty(8,
1611141171==c?"argbSelection":"argbHighlight",Integer.$valueOf(b));return;case 1611272194:case 1679429641:case 1614417948:case 1073741824:case 1613758476:c=this.paramAsStr(1);if(this.checkToken(2))switch(b=this.getToken(2).tok,b){case 1048587:b=1073741991;break;case 1073741991:case 1073742116:case 1073742110:break;default:b=this.getArgbParam(2)}0==b&&this.error(9);this.checkLast(this.iToken);if(c.equalsIgnoreCase("axes")||0<=JV.StateManager.getObjectIdFromName(c)){this.setObjectArgb(c,b);return}if(this.setElementColor(c,
b))return;this.invArg();break;case 135180:case 135402505:this.setShapeProperty(JV.JC.shapeTokenIndex(c),"thisID","+PREVIOUS_MESH+")}}this.colorShape(this.getShapeType(this.theTok),a,!1)});e(c$,"cmdDefine",function(){(3>this.slen||!q(this.getToken(1).value,String))&&this.invArg();var a=this.getToken(1).value.toLowerCase();-2147483648!=JU.PT.parseInt(a)&&this.invArg();if(!this.chk){var b=a.startsWith("site_");if(0==a.indexOf("dynamic_")||b){for(var c=Array(this.slen),d=this.slen;0<=--d;)c[d]=this.st[d];
this.definedAtomSets.put("!"+(b?a:a.substring(8)),c)}else b=this.atomExpressionAt(2),this.definedAtomSets.put(a,b),this.chk||this.vwr.g.setUserVariable("@"+a,JS.SV.newV(10,b))}});e(c$,"cmdDelay",function(){var a=0;switch(this.getToken(1).tok){case 1048589:a=1;break;case 2:a=1E3*this.intParameter(1);break;case 3:a=B(1E3*this.floatParameter(1));break;default:this.error(34)}this.refresh(!1);this.doDelay(Math.abs(a))});e(c$,"cmdDelete",function(){if(1048582==this.tokAt(1))4==this.slen&&this.optParameterAsString(2).equals("saved")&&
4==this.slen?(this.vwr.stm.deleteSaved(this.optParameterAsString(3)),this.doReport()&&this.report(J.i18n.GT.o(J.i18n.GT._("show saved: {0}"),this.vwr.stm.listSavedStates()))):this.setObjectProperty();else{var a=1==this.slen?null:this.atomExpression(this.st,1,0,!0,!1,!0,!1);this.chk||(null==a&&(a=this.vwr.getAllAtoms()),a=this.vwr.deleteAtoms(a,!1),this.doReport()&&this.report(J.i18n.GT.i(J.i18n.GT._("{0} atoms deleted"),a)))}});e(c$,"cmdDisplay",function(a){var b=null,c=0,d=1,f;switch(f=this.tokAt(1)){case 1276118017:case 1073742119:c=
f,f=this.tokAt(++d)}var g=1087373318==f;g&&(f=this.tokAt(++d));switch(f){case 1048582:this.setObjectProperty();return;case 0:break;default:b=4==this.slen&&1678770178==this.tokAt(2)?JM.BondSet.newBS(JU.BSUtil.newBitSet2(0,this.vwr.ms.bondCount),null):this.atomExpressionAt(d)}this.chk||(q(b,JM.BondSet)?this.vwr.ms.displayBonds(b,a):this.vwr.displayAtoms(b,a,g,c,this.tQuiet))},"~B");e(c$,"cmdDots",function(a){this.chk||this.sm.loadShape(a);this.setShapeProperty(a,"init",null);for(var b=NaN,c=J.atomdata.RadiusData.EnumType.ABSOLUTE,
d=1;;){switch(this.getToken(d).tok){case 1073742072:this.restrictSelected(!1,!1);b=1;c=J.atomdata.RadiusData.EnumType.FACTOR;break;case 1048589:b=1;c=J.atomdata.RadiusData.EnumType.FACTOR;break;case 1048588:b=0;break;case 1073741976:this.setShapeProperty(a,"ignore",this.atomExpressionAt(d+1));d=this.iToken+1;continue;case 2:var f=this.intParameter(d);if(1666189314==this.tokAt(d+1)){d++;this.setShapeProperty(a,"atom",Integer.$valueOf(f));this.setShapeProperty(a,"radius",Float.$valueOf(this.floatParameter(++d)));
1766856708==this.tokAt(++d)&&(this.setShapeProperty(a,"colorRGB",Integer.$valueOf(this.getArgbParam(++d))),d++);10!=this.getToken(d).tok&&this.invArg();this.setShapeProperty(a,"dots",this.st[d].value);return}}break}b=Float.isNaN(b)?this.encodeRadiusParameter(d,!1,!0):new J.atomdata.RadiusData(null,b,c,J.c.VDW.AUTO);null!=b&&(Float.isNaN(b.value)&&this.invArg(),this.setShapeSize(a,b))},"~N");e(c$,"cmdEcho",function(a){if(!this.chk){a=this.optParameterAsString(a);var b=!0;this.vwr.ms.getEchoStateActive()&&
(a.startsWith("\u0001")&&(a=a.substring(1),b=!1),null!=a&&this.setShapeProperty(31,"text",a));b&&this.vwr.getRefreshing()&&this.showString(JU.Txt.formatText(this.vwr,a))}},"~N");e(c$,"cmdFile",function(){var a=this.intParameter(this.checkLast(1));if(!this.chk){var b=this.vwr.ms.getModelNumberIndex(1E6*a+1,!1,!1),c=-1;0<=b&&(c=this.vwr.ms.getModelNumberIndex(1E6*(a+1)+1,!1,!1),0>c&&(c=this.vwr.ms.mc),c--);this.vwr.setAnimationOn(!1);this.vwr.am.setAnimationDirection(1);this.vwr.setAnimationRange(b,
c);this.vwr.setCurrentModelIndex(-1)}});e(c$,"cmdFixed",function(){var a=1==this.slen?null:this.atomExpressionAt(1);this.chk||this.vwr.setMotionFixedAtoms(a)});e(c$,"cmdFlow",function(a,b,c){var d,f;f=this.st[0].intValue;var g=0>f&&!this.chk;d=!0;var e=0;switch(a){case 135368713:case 102436:return this.cmdFunc(),b;case 364558:return b;case 102412:d=this.theToken;this.pushContext(d,"CATCH");!g&&null!=d.name0&&this.contextVariables.put(d.name0,d.contextVariables.get(d.name0));d=!g;this.st[0].intValue=
-Math.abs(f);break;case 102410:case 102413:case 102411:e=Math.abs(this.aatoken[Math.abs(f)][0].intValue);switch(g?0:this.cmdFlowSwitch(this.theToken,a)){case 0:e=-e;d=!1;break;case -1:d=!1}this.aatoken[this.pc][0].intValue=Math.abs(f);this.theToken=this.aatoken[Math.abs(f)][0];1150985!=this.theToken.tok&&(this.theToken.intValue=e);break;case 135369225:case 102402:d=!g&&this.parameterExpressionBoolean(1,0);if(this.chk)break;e=Math.abs(this.aatoken[Math.abs(f)][0].intValue);this.aatoken[Math.abs(f)][0].intValue=
g||d?-e:e;102412==a&&(this.aatoken[this.pc][0].intValue=-f);break;case 364547:this.checkLength(1);0>f&&!this.chk&&(this.pc=-f-1);break;case 364548:this.checkLength(1);break;case 102406:b||this.pushContext(this.theToken,"WHILE");b=!1;!this.parameterExpressionBoolean(1,0)&&!this.chk&&(this.pc=f,this.popContext(!0,!1));break;case 102407:if(!this.chk){this.breakAt(f);break}if(1==this.slen)break;a=this.intParameter(this.checkLast(1));if(this.chk)break;for(var h=0;h<a;h++)this.popContext(!0,!1);break;case 102408:b=
!0;this.chk||(this.pc=f-1);1<this.slen&&this.intParameter(this.checkLast(1));break;case 135369224:var n=this.theToken,g=O(2,0);c=0;for(var l=null,e=null,h=1,j=0;h<this.slen&&2>c;h++)switch(a=this.tokAt(h)){case 1048591:0<j?j--:g[c++]=h;break;case 1276116993:e=this.paramAsStr(h-1);if(b){h=this.slen;continue}j-=2;if(1048577==this.tokAt(++h)||10==this.tokAt(h))l=this.atomExpressionAt(h),this.isBondSet&&(l=JM.BondSet.newBS(l,null));else switch(h=this.parameterExpressionList(-h,1,!1),(null==h||1>h.size())&&
this.invArg(),h=h.get(0),h.tok){case 10:l=JS.SV.getBitSet(h,!1);break;case 7:l=h.getList();break;case 6:l=h.getMap();h=Array(l.keySet().size());java.util.Arrays.sort(h);l=l.keySet().toArray(h);break;default:this.invArg()}h=this.iToken;break;case 135280132:j+=2}h=!1;null==e&&(b?c=null==l?g[1]+1:2:(this.pushContext(n,"FOR"),c=2),36868==this.tokAt(c)&&c++,e=this.paramAsStr(c),(h=e.equals("--")||e.equals("++"))&&(e=this.paramAsStr(++c)));j=null;if(1276116993==a||JS.T.tokAttr(this.tokAt(c),1073741824)||
null!=this.getContextVariableAsVariable(e))1276116993!=a&&(!h&&269484436!=this.getToken(++c).tok)&&this.invArg(),1276116993==a?(d=!0,b||this.pushContext(n,"FOR"),n=this.getForVar(e),j=this.getForVar(e+"/value"),b?n.isModified()?d=!1:7==j.tok?d=++j.intValue<=j.getList().size():0>j.value.nextSetBit((c=j.value.nextSetBit(0))+1)?d=!1:j.value.clear(c):(j.setv(JS.SV.getVariable(q(l,JU.BS)?JU.BSUtil.copy(l):l)),j.intValue=1,n.setModified(!1)),d&&n.setv(JS.SV.selectItemVar(j))):(h&&(c-=2),this.setVariable(++c,
this.slen-1,e,!1));1276116993!=a&&(d=this.parameterExpressionBoolean(g[0]+1,g[1]));f++;d||this.popContext(!0,!1);b=!1;break;case 1150985:switch(this.getToken(this.checkLast(1)).tok){case 364558:b=this.getToken(1).value;if(this.chk)return!1;this.runFunctionAndRet(b,"try",null,null,!0,!0,!0);return!1;case 102412:this.popContext(!0,!1);break;case 135368713:case 102436:return this.vwr.addFunction(this.theToken.value),b;case 102439:this.addProcess(c,f,this.pc);this.popContext(!0,!1);break;case 102410:if(0<
f&&-1==this.cmdFlowSwitch(this.aatoken[f][0],0)){for(;f<this.pc&&!(102413!=(a=this.aatoken[f][0].tok)&&102411!=a);f++);d=this.pc==f}}d&&(d=102412==this.theTok||102439==this.theTok||135369225==this.theTok||102410==this.theTok);b=135369224==this.theTok||102406==this.theTok}!d&&!this.chk&&(this.pc=Math.abs(f)-1);return b},"~N,~B,JU.Lst");e(c$,"cmdFlowSwitch",function(a,b){102410==b&&a.addName("_var");var c=a.contextVariables.get("_var");if(null==c)return 1;if(0==b)return a.contextVariables.remove("_var"),
-1;if(102413==b)return-1;var d=this.parameterExpressionToken(1);if(102411==b)return(c=JS.SV.areEqual(c,d))&&a.contextVariables.remove("_var"),c?1:-1;a.contextVariables.put("_var",d);return 1},"JS.ContextToken,~N");e(c$,"cmdFont",function(a,b){var c="SansSerif",d="Plain",f=0,g=-1;switch(this.iToken=this.slen){case 6:g=this.floatParameter(5),5<=g&&(g=this.vwr.tm.getZoomSetting()/g/this.vwr.getScalePixelsPerAngstrom(!1));case 5:1073741824!=this.getToken(4).tok&&this.invArg(),d=this.paramAsStr(4);case 4:1073741824!=
this.getToken(3).tok&&this.invArg();c=this.paramAsStr(3);this.isFloatParameter(2)||this.error(34);b=this.floatParameter(2);a=this.getShapeType(this.getToken(1).tok);break;case 3:this.isFloatParameter(2)||this.error(34);-1==a?(a=this.getShapeType(this.getToken(1).tok),b=this.floatParameter(2)):1<=b&&(b+=f=5);break;default:if(5==a){b=13;break}this.bad()}if(5==a){if(0>b||1<=b&&(6>b||63<b)){this.integerOutOfRange(6-f,63-f);return}this.setShapeProperty(5,"setDefaults",this.vwr.slm.noneSelected)}this.chk||
(0<=javajs.awt.Font.getFontStyleID(c)&&(d=c,c="SansSerif"),c=this.vwr.getFont3D(c,d,b),this.sm.loadShape(a),this.setShapeProperty(a,"font",c),0<=g&&this.setShapeProperty(a,"scalereference",Float.$valueOf(g)))},"~N,~N");e(c$,"cmdFrank",function(a){var b=!0;if(this.slen>a)switch(this.getToken(this.checkLast(a)).tok){case 1048589:break;case 1048588:b=!1;break;default:this.error(5)}this.setBooleanProperty("frank",b)},"~N");e(c$,"cmdFunc",function(){if(!this.chk||this.isCmdLine_c_or_C_Option){var a=this.getToken(0).value.toLowerCase();
this.vwr.isFunction(a)||this.error(10);var b=1==this.slen||3==this.slen&&269484048==this.tokAt(1)&&269484049==this.tokAt(2)?null:this.parameterExpressionList(1,-1,!1);this.chk||this.runFunctionAndRet(null,a,b,null,!1,!0,!0)}});e(c$,"cmdGetProperty",function(){if(!this.chk){var a="",b=a=this.optParameterAsString(1);0<=b.indexOf(".")&&(b=b.substring(0,b.indexOf(".")));0<=b.indexOf("[")&&(b=b.substring(0,b.indexOf("[")));var b=this.vwr.getPropertyNumber(b),c="";switch(this.tokAt(2)){default:c=this.optParameterAsString(2);
break;case 1048577:case 10:if(c=this.atomExpressionAt(2),a.equalsIgnoreCase("bondInfo"))switch(this.tokAt(++this.iToken)){case 1048577:case 10:c=[c,this.atomExpressionAt(this.iToken)]}}if(0<a.length&&0>b)c=a="";else if(0<=b&&3>this.slen){if((c=this.vwr.getDefaultPropertyParam(b)).equals("(visible)"))c=this.vwr.ms.getVisibleSet(!0)}else if(b==this.vwr.getPropertyNumber("fileContents")){b=c.toString();for(c=3;c<this.slen;c++)b+=this.paramAsStr(c);c=b}a=this.vwr.getProperty("readable",a,c);this.showString(a)}});
e(c$,"cmdGoto",function(a){a=a?this.paramAsStr(this.checkLast(1)):null;for(var b=null==a?this.aatoken.length-1:-1,c=null,d=b+1;d<this.aatoken.length;d++){var c=this.aatoken[d],f=c[0].tok;switch(f){case 20485:case 0:c=c[c.length-1].value;0==f&&(c=c.substring(c.startsWith("#")?1:2));break;default:continue}if(c.equalsIgnoreCase(a)){b=d;break}}0>b&&this.invArg();null==a&&(b=0);f=b<this.pc?1:-1;c=0;for(d=b;d!=this.pc;d+=f)switch(this.aatoken[d][0].tok){case 1276384259:case 102439:case 135369224:case 102412:case 102406:c++;
break;case 1276383249:c--;break;case 1150985:switch(this.aatoken[d][1].tok){case 102439:case 135369224:case 102412:case 102406:c--}}if(null==a)for(b=2147483647;0<c;--c)this.popContext(!1,!1);0!=c&&this.invArg();this.chk||(this.pc=b-1)},"~B");e(c$,"cmdHbond",function(){if(2==this.slen&&4102==this.getToken(1).tok){if(!this.chk){var a=this.vwr.autoHbond(null,null,!1);this.report(J.i18n.GT.i(J.i18n.GT._("{0} hydrogen bonds"),Math.abs(a)))}}else 2==this.slen&&12291==this.getToken(1).tok?this.chk||this.checkExtension(1612189718):
(a=this.getMadParameter(),2147483647!=a&&(this.setShapeProperty(1,"type",Integer.$valueOf(30720)),this.setShapeSizeBs(1,a,null),this.setShapeProperty(1,"type",Integer.$valueOf(1023))))});e(c$,"cmdHelp",function(){if(!this.chk){var a=this.optParameterAsString(1).toLowerCase(),b=0;a.startsWith("mouse")&&0<=(b=a.indexOf(" "))&&b==a.lastIndexOf(" ")?this.showString(this.vwr.getBindingInfo(a.substring(b+1))):(JS.T.tokAttr(JS.T.getTokFromName(a),4096)&&(a="?command="+a),this.vwr.getHelp(a))}});e(c$,"cmdHistory",
function(a){if(1==this.slen)this.showString(this.vwr.getSetHistory(2147483647));else if(2==a)a=this.intParameter(this.checkLast(2)),0>a&&this.invArg(),this.chk||this.vwr.getSetHistory(0==a?0:-2-a);else switch(this.getToken(this.checkLast(1)).tok){case 1048589:case 1073741882:this.chk||this.vwr.getSetHistory(-2147483648);break;case 1048588:this.chk||this.vwr.getSetHistory(0);break;default:this.errorStr(24,"ON, OFF, CLEAR")}},"~N");e(c$,"cmdHover",function(){if(!this.chk){var a=this.paramAsStr(1);a.equalsIgnoreCase("on")?
a="%U":a.equalsIgnoreCase("off")&&(a=null);this.vwr.setHoverLabel(a)}});e(c$,"cmdInvertSelected",function(){var a=null,b=null,c=null,d=-2147483648;switch(this.tokAt(1)){case 0:if(this.chk)return;c=this.vwr.bsA();a=this.vwr.ms.getAtomSetCenter(c);this.vwr.invertAtomCoordPt(a,c);return;case 528443:d=this.atomExpressionAt(2).nextSetBit(0);c=this.atomExpressionAt(this.iToken+1);break;case 135266320:a=this.centerParameter(2);break;case 135266319:b=this.planeParameter(1);break;case 135267841:b=this.hklParameter(2)}this.checkLengthErrorPt(this.iToken+
1,1);null==b&&(null==a&&-2147483648==d)&&this.invArg();this.chk||-1!=d&&this.vwr.invertSelected(a,b,d,c)});e(c$,"cmdLabel",function(a){if(!this.chk){this.sm.loadShape(5);var b=null;switch(this.getToken(a).tok){case 1048589:b=this.vwr.getStandardLabelFormat(0);break;case 1048588:break;case 12294:case 1610625028:this.setShapeProperty(5,"display",1610625028==this.theTok?Boolean.TRUE:Boolean.FALSE);return;case 7:b=this.theToken.value;break;default:b=this.paramAsStr(a)}this.sm.setLabel(b,this.vwr.bsA())}},
"~N");e(c$,"cmdLoad",function(){var a=!this.chk||this.isCmdLine_C_Option,b=!1,c=!1,d=!1,f=!1,g=this.vwr.async,e=!1,h=!1,n=this.vwr.getBoolean(603979792),l,j=135270408==this.tokAt(0)?0:1,m=null,p=this.vwr.ms.mc-(this.vwr.fm.getFileName().equals("zapped")?1:0),r=this.vwr.ms.ac,s=(new JU.SB).append("load"),q=1,v=new java.util.Hashtable;this.$isStateScript&&(v.put("isStateScript",Boolean.TRUE),this.forceNoAddHydrogens&&v.put("doNotAddHydrogens",Boolean.TRUE));var A=null,x=null,t=null,w=null,w=new JU.SB,
z=0,K;if(1==this.slen)j=0;else{A=this.paramAsStr(j);if(2==this.slen&&!this.chk&&(A.endsWith(".spt")||A.endsWith(".png")||A.endsWith(".pngj"))){this.cmdScript(0,A,null);return}K=this.tokAt(j);switch(K){case 1073742015:b=this.paramAsStr(this.checkLast(2));this.chk||this.vwr.setMenu(b,!0);return;case 1610616855:b=this.paramAsStr(this.checkLast(2));this.chk||this.vwr.setHistory(b);return;case 135270408:f=!0;s.append(" /*data*/ data");l=this.stringParameter(++j).toLowerCase();s.append(" ").append(JU.PT.esc(l));
var b=l.startsWith("append"),h=0<=l.indexOf("orientation"),u=0<=l.indexOf("@")?""+this.getParameter(l.substring(l.indexOf("@")+1),4,!0):this.paramAsStr(++j),u=JV.Viewer.fixInlineString(u,this.vwr.getInlineChar());v.put("fileData",u);v.put("isData",Boolean.TRUE);s.appendC("\n");s.append(u);0>l.indexOf("@")&&(s.append(" end ").append(JU.PT.esc(l)),j+=2);break;case 1073741839:b=!0;s.append(" append");A=this.optParameterAsString(++j);K=JS.T.getTokFromName(A);break;case 1073742077:h=!0;s.append(" orientation");
this.vwr.stm.saveOrientation("preload",null);A=this.optParameterAsString(++j);K=JS.T.getTokFromName(A);break;case 1073741824:j++,s.append(" "+A),z=1073741824==K&&JU.PT.isOneOf(A.toLowerCase(),";xyz;vxyz;vibration;temperature;occupancy;partialcharge;")?JS.T.getTokFromName(A):0,0!=z&&(v.put("atomDataOnly",Boolean.TRUE),v.put("modelNumber",Integer.$valueOf(1)),4166==z&&(z=1146095631),t=this.vwr.fm.getFileInfo(),b=!0)}switch(K){case 1229984263:j++;s.append(" "+A);this.optParameterAsString(j).equals("+")&&
(e=!0,j++,s.append(" +"));7==this.tokAt(j)&&(x=this.stringParameterSet(j),j=this.iToken,j+1!=this.slen&&this.invArg(),null!=x&&(q=x.length));break;case 1073741983:c=!0;j++;s.append(" "+A);break;case 135267336:d=!0;j++;break;case 1073741849:g=!0;v.put("async",Boolean.TRUE);j++;break;case 536870926:case 1095766030:j++;s.append(" "+A);536870926==K&&v.put("isTrajectory",Boolean.TRUE);if(this.isPoint3f(j)){var y=this.getPoint3f(j,!1),j=this.iToken+1;v.put("firstLastStep",[B(y.x),B(y.y),B(y.z)]);s.append(" "+
JU.Escape.eP(y))}else 10==this.tokAt(j)?(l=this.getToken(j++).value,v.put("bsModels",l),s.append(" "+JU.Escape.eBS(l))):v.put("firstLastStep",[0,-1,1]);break;case 1073741824:break;default:A="fileset"}null==x&&4!=this.getToken(j).tok&&this.error(16)}K=j;l=null;1073741848==this.tokAt(K+1)&&(l=this.stringParameter(j+=2),""!==this.vwr.fm.getPathForAllFiles()&&(l=null,K=j));var C=y=u=null;if(this.slen==j+1){if(0==j||null==x&&0==(u=this.paramAsStr(K)).length)u=this.getFullPathName();if(null==u&&null==x){this.cmdZap(!1);
return}if(null==x&&!c)if(d)u="$"+u;else{if(0<=u.indexOf("[]"))return;0==u.indexOf("[")&&(x=JU.Escape.unescapeStringArray(u),null!=x&&(1==j&&s.append(" files"),q=x.length))}if(null!=x)for(d=0;d<q;d++)s.append(" /*file*/").append(JU.PT.esc(x[d]))}else if(this.isLoadOption(this.getToken(j+1).tok)){if(0==(u=this.paramAsStr(K)).length&&null==(u=this.getFullPathName())){this.cmdZap(!1);return}(K==j||null!=l)&&j++;if(0<=u.indexOf("[]"))return;if(1073742010==(K=this.tokAt(j)))d=this.stringParameter(++j),
v.put("manifest",d),w.append(" MANIFEST "+JU.PT.esc(d)),K=this.tokAt(++j);switch(K){case 2:case 7:case 269484096:case 1073742195:this.getLoadModelIndex(j,w,v),this.tokAt(j=++this.iToken)}j=this.getLoadSymmetryParams(j,w,v);1073741839==this.tokAt(j)&&(135270408==this.tokAt(++j)?(j+=2,y=this.getToken(j++).value,C=this.stringParameter(++j),++j):(C=this.stringParameter(j++),y=this.stringParameter(j++)),v.put(C,y));1073741940==this.tokAt(j)&&(m=this.stringParameter(++j))}else q=new JU.Lst,1==j&&(j++,s.append(" "+
A)),m=this.getLoadFilesList(j,s,w,v,q),x=q.toArray(Array(q=q.size())),!e&&0<=s.indexOf("/*concat*/")&&(e=!0);if(a){null!=x&&(u="fileSet");null!=y&&w.append(' APPEND data "'+C+'"\n'+y+(y.endsWith("\n")?"":"\n")+'end "'+C+'"');null==m&&(m=this.vwr.g.defaultLoadFilter);0<m.length&&(0<=m.toUpperCase().indexOf("DOCACHE")&&!this.$isStateScript&&!b&&this.vwr.cacheClear(),v.put("filter",m),m.equalsIgnoreCase("2d")&&(m="2D-noMin"),w.append(" FILTER "+JU.PT.esc(m)));a=!1;if(null==x)if(c)v.put("fileData",u);
else if(u.startsWith("@")&&1<u.length)a=!0,g=this.getStringParameter(u.substring(1),!1),v.put("fileData",g),s=(new JU.SB).append("{\n    var ").append(u.substring(1)).append(" = ").append(JU.PT.esc(g)).append(";\n    ").appendSB(s);else if((this.vwr.testAsync||this.vwr.isJS)&&(g||u.startsWith("?")))l=null,u=this.loadFileAsync("LOAD"+(b?"_APPEND_":"_"),u,j,!b&&this.pc!=this.pcResume);g=null;null!=l&&(l.equals(".")&&(l=this.vwr.fm.getFilePath(u,!1,!0)),(0==l.length||this.vwr.fm.getFilePath(l,!1,!1).equalsIgnoreCase(this.vwr.fm.getFilePath(u,
!1,!1)))&&this.invArg(),j=[l],g=this.vwr.getOutputChannel(l,j),null==g?JU.Logger.error("Could not create output stream for "+j[0]):v.put("outputChannel",g));if(null==x&&0==z){s.append(" ");a||c?s.append(JU.PT.esc(u)):f||(null!=l&&(l=this.vwr.fm.getFilePath(l,!1,!1)),!u.equals("string")&&!u.equals("string[]")&&s.append("/*file*/").append(null!=l?JU.PT.esc(l):"$FILENAME$"));if(!e&&(u.startsWith("=")||u.startsWith("*"))&&1<u.indexOf("/")){e=!0;y=u.indexOf("/");s=u.substring(1,y);c=u.substring(y+1);u=
u.substring(0,y);if(0<=(y=u.indexOf(".")))u=u.substring(0,y);u.startsWith("=")&&(u+=".cif");x=c.equals("all")?[u,"*dom/"+s,"*val/"+s]:[u,"*"+c+"/"+s];u="fileSet";s=null}else 0<w.length()&&s.append(" /*options*/ ").append(w.toString()),a&&s.append("\n  }");null!=s&&v.put("loadScript",s)}this.setCursorWait(!0);(c=this.vwr.getBoolean(603979934))&&JU.Logger.startTimer("load");!this.$isStateScript&&!b&&this.vwr.setBooleanProperty("legacyJavaFloat",!1);w=this.vwr.loadModelFromFile(null,u,x,null,b,v,s,w,
z,e);c&&this.showString(JU.Logger.getTimerMsg("load",0));null!=g&&(this.vwr.fm.setFileInfo([l]),JU.Logger.info(J.i18n.GT.o(J.i18n.GT._("file {0} created"),l)),this.showString(this.vwr.fm.getFilePath(l,!1,!1)+" created"),g.closeChannel());if(0<z)this.vwr.fm.setFileInfo(t),null!=w&&!this.isCmdLine_c_or_C_Option&&this.evalError(w,null);else{if(null!=w&&!this.isCmdLine_c_or_C_Option){if(0==w.indexOf("NOTE: file recognized as a script file: ")){u=w.substring(40).trim();this.cmdScript(0,u,null);return}if(this.vwr.async&&
w.startsWith(JV.JC.READER_NOT_FOUND))throw new JS.ScriptInterruption(this,"async",1);this.evalError(w,null)}this.debugHigh&&this.report("Successfully loaded:"+(null==x?v.get("fullPathName"):A));this.finalizeLoad(b,n,e,h,q,r,p)}}});e(c$,"getLoadFilesList",function(a,b,c,d,f){for(var g=null,e=null,h=null,n=null;a<this.slen;){switch(this.tokAt(a)){case 269484193:b.append("/*concat*/ +");++a;continue;case 2:case 7:case 269484096:case 1073742195:this.getLoadModelIndex(a,c,d);a=this.iToken+1;continue;case 1073741940:e=
this.stringParameter(++a);++a;continue;case 1048581:d.remove("isTrajectory");null==g&&(g=new JU.Lst,h=JU.P3.new3(0,-1,1));this.isPoint3f(++a)?(h=this.getPoint3f(a,!1),a=this.iToken+1):10==this.tokAt(a)&&(n=this.getToken(a).value,h=null,a=this.iToken+1);break;case 1073741824:this.invArg()}f.addLast(this.paramAsStr(a++));null!=h?(g.addLast([B(h.x),B(h.y),B(h.z)]),b.append(" COORD "+JU.Escape.eP(h))):null!=n&&(g.addLast(n),b.append(" COORD "+JU.Escape.eBS(n)));b.append(" /*file*/$FILENAME"+f.size()+
"$")}null!=g&&d.put("firstLastSteps",g);return e},"~N,JU.SB,JU.SB,java.util.Map,JU.Lst");e(c$,"isLoadOption",function(a){switch(a){case 1073742010:case 2:case 7:case 269484096:case 1073742195:case 1048586:case 8:case 1073742080:case 1095761926:case 1073742163:case 1073742114:case 1073742152:case 1614417948:case 1073742066:case 1073741839:return!0;case 1073741940:case 1073741824:return 1048581!=this.tokAt(this.iToken+2)}return!1},"~N");e(c$,"getLoadModelIndex",function(a,b,c){switch(this.tokAt(a)){case 2:a=
this.intParameter(a);b.append(" ").appendI(a);0>a?c.put("vibrationNumber",Integer.$valueOf(-a)):c.put("modelNumber",Integer.$valueOf(a));break;case 7:case 269484096:case 1073742195:var d=this.floatParameterSet(a,1,2147483647);a=new JU.BS;for(var f=0;f<d.length;f++)1<=d[f]&&d[f]==B(d[f])&&a.set(B(d[f])-1);c.put("bsModels",a);c=O(a.cardinality(),0);d=0;for(f=a.nextSetBit(0);0<=f;f=a.nextSetBit(f+1))c[d++]=f+1;b.append(" "+JU.Escape.eAI(c))}},"~N,JU.SB,java.util.Map");e(c$,"getLoadSymmetryParams",function(a,
b,c){var d=null,f=this.tokAt(a);if(1048586==f||8==f)d=this.getPoint3f(a,!1),a=this.iToken+1,f=this.tokAt(a);switch(f){case 1073742080:case 1095761926:case 1073742163:case 1073742114:case 1073742152:case 1614417948:null==d&&(d=JU.P3.new3(555,555,-1)),this.iToken=a-1}f=null;if(null!=d){c.put("lattice",d);a=this.iToken+1;b.append(" {"+B(d.x)+" "+B(d.y)+" "+B(d.z)+"}");a=this.checkPacked(a,c,b);1095761926==this.tokAt(a)&&(c.put("centroid",Boolean.TRUE),b.append(" CENTROID"),a=this.checkPacked(++a,c,b));
if(1073742163==this.tokAt(a)){var g;b.append(" SUPERCELL ");if(this.isPoint3f(++a)){g=this.getPoint3f(a,!1);if(g.x!=B(g.x)||g.y!=B(g.y)||g.z!=B(g.z)||1>g.x||1>g.y||1>g.z)this.iToken=a,this.invArg();a=this.iToken}else g=this.stringParameter(a);b.append(JU.Escape.e(g));c.put("supercell",g);a=this.checkPacked(++a,c,b)}g=0;1073742114==this.tokAt(a)&&(a++,g=this.floatParameter(a++),b.append(" range "+g));c.put("symmetryRange",Float.$valueOf(g));g=null;g=-2147483648;1073742152==this.tokAt(a)&&(++a,g=JU.PT.rep(this.paramAsStr(a++),
"''",'"'),b.append(" spacegroup "+JU.PT.esc(g)),g.equalsIgnoreCase("ignoreOperators")?g=-999:(0==g.length?(d=this.vwr.getCurrentUnitCell(),null!=d&&(g=d.getSpaceGroupName())):0<=g.indexOf(",")&&9>d.x&&(9>d.y&&0==d.z)&&(g+="#doNormalize=0"),c.put("spaceGroupName",g),g=-2));var e=null;if(1614417948==this.tokAt(a)){++a;0==this.optParameterAsString(a).length?(d=this.vwr.getCurrentUnitCell(),null!=d&&(e=d.getUnitCellAsArray(!0),f=d.getCartesianOffset())):e=this.floatParameterSet(a,6,9);(null==e||6!=e.length&&
9!=e.length)&&this.invArg();b.append(" unitcell {");for(a=0;a<e.length;a++)b.append((0==a?"":" ")+e[a]);b.append("}");c.put("unitcell",e);-2147483648==g&&(g=-1);a=this.iToken+1}-2147483648!=g&&c.put("spaceGroupIndex",Integer.$valueOf(g))}null!=f?this.coordinatesAreFractional=!1:1073742066==this.tokAt(a)&&(f=this.getPoint3f(++a,!0));null!=f&&(this.coordinatesAreFractional?(f.setT(this.fractionalPoint),c.put("unitCellOffsetFractional",this.coordinatesAreFractional?Boolean.TRUE:Boolean.FALSE),b.append(" offset {"+
f.x+" "+f.y+" "+f.z+"/1}")):b.append(" offset "+JU.Escape.eP(f)),c.put("unitCellOffset",f),a=this.iToken+1);return a},"~N,JU.SB,java.util.Map");e(c$,"checkPacked",function(a,b,c){if(1073742080==this.tokAt(a)&&(b.put("packed",Boolean.TRUE),c.append(" PACKED"),this.isFloatParameter(++a))){var d=this.floatParameter(a++);b.put("packingError",Float.$valueOf(d));c.append(" "+d)}return a},"~N,java.util.Map,JU.SB");e(c$,"finalizeLoad",function(a,b,c,d,f,g,e){if(a&&(b||1<f))this.vwr.setAnimationRange(-1,-1),
this.vwr.setCurrentModelIndex(e);0==this.scriptLevel&&(!a&&(c||2>f))&&this.vwr.showString(this.vwr.ms.getInfoM("modelLoadNote"),!1);b=this.vwr.ms.getInfoM("centroidMinMax");JU.PT.isAI(b)&&0<this.vwr.ms.ac&&(a=JU.BSUtil.newBitSet2(a?g:0,this.vwr.ms.ac),this.vwr.ms.setCentroid(a,b));a=this.vwr.g.defaultLoadScript;g="";0<a.length&&(g+="\nUsing defaultLoadScript: "+a);var h;b=this.vwr.ms.msInfo;null!=b&&this.vwr.allowEmbeddedScripts()&&null!=(h=b.remove("jmolscript"))&&0<h.length?(g+="\nAdding embedded #jmolscript: "+
h,a+=";"+h,this.setStringProperty("_loadScript",a),a="allowEmbeddedScripts = false;try{"+a+"} allowEmbeddedScripts = true;"):this.setStringProperty("_loadScript","");this.logLoadInfo(g);h=null==b?null:b.remove("sitescript");null!=h&&(a=h+";"+a);d&&(a+=";restore orientation preload");0<a.length&&!this.isCmdLine_c_or_C_Option&&this.runScript(a)},"~B,~B,~B,~B,~N,~N,~N");e(c$,"cmdLog",function(){1==this.slen&&this.bad();if(!this.chk){var a=this.parameterExpressionString(1,0);1048588==this.tokAt(1)?this.setStringProperty("logFile",
""):this.vwr.log(a)}});e(c$,"cmdLoop",function(){this.vwr.headless||(this.chk||(this.pc=-1),this.cmdDelay())});e(c$,"cmdMessage",function(){var a=this.paramAsStr(this.checkLast(1));this.chk||(a=JU.Txt.formatText(this.vwr,a),null==this.outputBuffer&&this.vwr.warn(a),a.startsWith("_")||this.report(a))});e(c$,"cmdModel",function(a){var b=4115==this.theTok,c=!0;if(1==this.slen&&1==a){var d=this.vwr.am.cmi,f;if(!this.chk&&0<=d&&0<=(f=this.vwr.ms.getJmolDataSourceFrame(d)))this.vwr.setCurrentModelIndex(f==
d?-2147483648:f)}else{switch(this.tokAt(1)){case 2:if(b&&2==this.slen){this.chk||this.vwr.am.setFrame(this.intParameter(1)-1);return}break;case 1048577:case 10:var g=this.atomExpressionAt(1).nextSetBit(0);this.checkLength(this.iToken+1);if(this.chk||0>g)return;c=new JU.BS;c.set(g);this.vwr.setCurrentModelIndex(this.vwr.ms.getModelBS(c,!1).nextSetBit(0));return;case 1073741904:this.iToken=1;c=2==this.tokAt(2)?this.intParameter(++this.iToken):1;this.checkLength(this.iToken+1);!this.chk&&0<c&&this.vwr.ms.createModels(c);
return;case 1074790550:this.checkLength(3);d=this.stringParameter(2);this.chk||this.vwr.setCurrentModelID(d);return;case 528397:c=0;this.checkLength(3);switch(this.getToken(2).tok){case 2:case 3:c=V(1E3*this.floatParameter(2));break;default:this.error(20)}this.chk||this.vwr.setFrameDelayMs(c);return;case 1073742166:0<this.checkLength23()&&(this.chk||this.vwr.setFrameTitleObj(2==this.slen?"@{_modelName}":7==this.tokAt(2)?JS.SV.strListValue(this.st[2]):this.paramAsStr(2)));return;case 1073741832:c=
2==this.slen||1048587==this.tokAt(2)?null:this.atomExpressionAt(2);this.chk||this.vwr.setFrameOffsets(c);return}if(269484192==this.getToken(a).tok)++a,(2!=this.getToken(this.checkLast(a)).tok||1!=this.intParameter(a))&&this.invArg(),this.chk||this.vwr.setAnimation(1073742108);else{for(var b=f=!1,e=null,h=null,n=!1,l=!1,j=[-1,-1],m=0,q=0,r=this.vwr.haveFileSet(),g=a;g<this.slen;g++)switch(this.getToken(g).tok){case 1048579:case 269484209:this.checkLength(a+(b?2:1));n=!0;break;case 269484192:1!=m&&
this.invArg();l=!0;break;case 1048587:this.checkLength(a+1);break;case 3:if(c=!1,0>(q=this.floatParameter(g))){this.checkLength(g+1);this.chk||this.vwr.am.morph(-q);return}case 2:case 4:2==m&&this.invArg();d=4==this.theTok?JS.ScriptParam.getFloatEncodedInt(this.theToken.value):this.theToken.intValue;0>d&&1==m&&(l=!0,d=-d,r&&1E6>d&&(d*=1E6));3==this.theTok&&(r&&q==B(q))&&(d=1E6*B(q));if(2147483647==d){if(1==g&&(d=this.theToken.value.toString(),d=this.chk?-1:this.vwr.getModelIndexFromId(d),0<=d)){this.checkLength(2);
this.vwr.setCurrentModelIndex(d);return}d=0}if(-1==d){this.checkLength(a+1);this.chk||this.vwr.setAnimation(1073742108);return}1E3<=d&&(1E6>d&&r)&&(d=1E6*I(d/1E3)+d%1E3);!c&&(0==d&&0==m)&&(n=!0);1E6<=d&&(c=!1);j[m++]=d;break;case 1073742096:f=!0;break;case 1073742114:b=!0;break;case 1716520985:e=this.stringParameter(3);g=this.setVariable(4,-1,"",!1);null!=g&&(h=JS.SV.oValue(g));g=this.slen;break;default:this.frameControl(a);return}b&&0==m&&(n=!0);if(!this.chk)if(n)this.vwr.setAnimationOn(!1),this.vwr.setAnimationRange(-1,
-1),b||this.vwr.setCurrentModelIndex(-1);else{2==m&&!b&&(l=!0);if(r)c=!1;else if(c)for(g=0;g<m;g++)0<=j[g]&&(j[g]%=1E6);d=this.vwr.ms.getModelNumberIndex(j[0],c,!1);a=-1;if(r&&0>d&&0!=j[0])if(1E6>j[0]&&(j[0]*=1E6),2==m&&1E6>j[1]&&(j[1]*=1E6),0==j[0]%1E6)j[0]++,d=this.vwr.ms.getModelNumberIndex(j[0],!1,!1),0<=d&&(a=this.vwr.ms.getModelNumberIndex(1==m?j[0]+1E6:0==j[1]?-1:0==j[1]%1E6?j[1]+1000001:j[1]+1,!1,!1),0>a&&(a=this.vwr.ms.mc),a--,b?m=2:!l&&a!=d&&(l=!0),b=b||d==a);else return;if(null!=e)0<=d&&
this.vwr.ms.setInfo(d,e,h);else{(!f&&!b||0<=d)&&this.vwr.setCurrentModelIndexClear(d,!1);if(f&&2==m||b||l)0>a&&(a=this.vwr.ms.getModelNumberIndex(j[1],c,!1)),this.vwr.setAnimationOn(!1),this.vwr.am.setAnimationDirection(1),this.vwr.setAnimationRange(d,a),this.vwr.setCurrentModelIndexClear(l&&!b?-1:0<=d?d:0,!1);f&&this.vwr.setAnimation(4143)}}}}},"~N");e(c$,"cmdMove",function(){this.checkLength(-11);var a=JU.V3.new3(this.floatParameter(1),this.floatParameter(2),this.floatParameter(3)),b=this.floatParameter(4),
c=JU.V3.new3(this.intParameter(5),this.intParameter(6),this.intParameter(7)),d=this.floatParameter(8),f=this.floatParameter(9),g=11==this.slen?this.intParameter(10):30;if(!this.chk&&(this.refresh(!1),this.useThreads()||(f=0),this.vwr.move(this,a,b,c,d,f,g),0<f&&this.isJS))throw new JS.ScriptInterruption(this,"move",1);});e(c$,"cmdMoveto",function(){if(2==this.slen&&1073742162==this.tokAt(1))this.chk||this.vwr.tm.stopMotion();else{var a;if(2==this.slen&&this.isFloatParameter(1)){if(a=this.floatParameter(1),
!this.chk&&(this.useThreads()||(a=0),0<a&&this.refresh(!1),this.vwr.moveTo(this,a,null,JV.JC.axisZ,0,null,100,0,0,0,null,NaN,NaN,NaN,NaN,NaN,NaN),this.isJS&&0<a&&this.vwr.g.waitForMoveTo))throw new JS.ScriptInterruption(this,"moveTo",1);}else{var b=JU.V3.new3(NaN,0,0),c=null,d=1;a=this.isFloatParameter(d)?this.floatParameter(d++):2;var f=90,g=null,e=!0,e=!1,h=0,n=0,l=NaN,j=NaN,m=this.vwr.tm.getZoomSetting(),p=null,r=NaN,s=NaN,y=NaN,v=NaN,A=NaN,x=NaN,t=null,w=null;switch(this.getToken(d).tok){case 1073742110:t=
this.floatParameterSet(++d,18,21);d=this.iToken+1;if(this.chk&&0<this.checkLength(d))return;break;case 135270418:1073742028==this.tokAt(++d)&&(e=!0,d++);10==this.tokAt(d)||1048577==this.tokAt(d)?(e=!0,c=this.centerParameter(d),q(this.expressionResult,JU.BS)||this.invArg(),g=this.expressionResult,w=this.chk?new JU.Quat:this.vwr.ms.getQuaternion(g.nextSetBit(0),this.vwr.getQuaternionFrame())):w=this.getQuaternionParameter(d);d=this.iToken+1;null==w&&this.invArg();break;case 9:case 8:case 1048586:this.isPoint3f(d)?
(b.setT(this.getPoint3f(d,!0)),d=this.iToken+1,f=this.floatParameter(d++)):(f=this.getPoint4f(d),d=this.iToken+1,b.set(f.x,f.y,f.z),f=0==f.x&&0==f.y&&0==f.z?NaN:f.w);break;case 1073741954:b.set(1,0,0);f=0;this.checkLength(++d);break;case 1073741859:b.set(0,1,0);f=180;this.checkLength(++d);break;case 1073741996:b.set(0,1,0);this.checkLength(++d);break;case 1073742126:b.set(0,-1,0);this.checkLength(++d);break;case 1074790748:b.set(1,0,0);this.checkLength(++d);break;case 1073741871:b.set(-1,0,0);this.checkLength(++d);
break;case 1073741854:w=this.paramAsStr(++d);this.checkLength(++d);switch("xyz".indexOf(w)){case 0:w=JU.Quat.new4(0.5,0.5,0.5,-0.5);break;case 1:w=JU.Quat.new4(0.5,0.5,0.5,0.5);break;case 2:w=JU.Quat.new4(0,0,0,1);break;default:var z;z=this.vwr.getCurrentUnitCell();null==z&&(z=this.vwr.ms.getSymTemp(!0),z.setUnitCell([1,1,1,90,90,90],!1));w=z.getQuaternionRotation(w);null==w&&this.invArg()}break;default:b=JU.V3.new3(this.floatParameter(d++),this.floatParameter(d++),this.floatParameter(d++)),f=this.floatParameter(d++)}null!=
w&&(f=w.toAxisAngle4f(),b.set(f.x,f.y,f.z),f=(e?-1:1)*(180*f.angle/3.141592653589793));Float.isNaN(b.x)||Float.isNaN(b.y)||Float.isNaN(b.z)?b.set(0,0,0):0==b.length()&&0==f&&(f=NaN);e=!this.vwr.tm.isInPosition(b,f);this.isFloatParameter(d)&&(l=this.floatParameter(d++));this.isFloatParameter(d)&&!this.isCenterParameter(d)&&(h=this.floatParameter(d++),n=this.floatParameter(d++),!e&&1<=Math.abs(h-this.vwr.tm.getTranslationXPercent())&&(e=!0),!e&&1<=Math.abs(n-this.vwr.tm.getTranslationYPercent())&&(e=
!0));null==g&&d!=this.slen&&(c=this.centerParameter(d),q(this.expressionResult,JU.BS)&&(g=this.expressionResult),d=this.iToken+1);if(null!=c){!e&&0.1<=c.distance(this.vwr.tm.fixedRotationCenter)&&(e=!0);this.isFloatParameter(d)&&(j=this.floatParameter(d++));this.isCenterParameter(d)||((0==j||Float.isNaN(j))&&(0==l||Float.isNaN(l))?(g=Math.abs(this.getZoom(0,d,g,0==l?0:m)),d=this.iToken+1,l=g):!e&&0.1<=Math.abs(j-this.vwr.getFloat(570425388))&&(e=!0));if(0==l||Float.isNaN(l))l=100;Float.isNaN(j)&&
(j=0);!e&&1<=Math.abs(l-m)&&(e=!0);d!=this.slen&&(p=this.centerParameter(d),d=this.iToken+1,d!=this.slen&&(r=this.floatParameter(d++),s=this.floatParameter(d++)),d!=this.slen&&(y=this.floatParameter(d++)),d!=this.slen&&(v=this.floatParameter(d++),!e&&0.01<=Math.abs(v-this.vwr.tm.getCameraDepth())&&(e=!0)),d+1<this.slen&&(A=this.floatParameter(d++),x=this.floatParameter(d++),!e&&0.01<=Math.abs(A-this.vwr.tm.camera.x)&&(e=!0),!e&&0.01<=Math.abs(x-this.vwr.tm.camera.y)&&(e=!0)))}this.checkLength(d);
if(!this.chk&&(e||(a=0),0<a&&this.refresh(!1),this.useThreads()||(a=0),0==v&&(v=A=x=NaN),null!=t?this.vwr.tm.moveToPyMOL(this,a,t):this.vwr.moveTo(this,a,c,b,f,null,l,h,n,j,p,r,s,y,v,A,x),this.isJS&&0<a&&this.vwr.g.waitForMoveTo))throw new JS.ScriptInterruption(this,"moveTo",1);}}});e(c$,"cmdPause",function(){if(this.chk||this.isJS&&!this.allowJSThreads)return!1;var a=this.optParameterAsString(1);this.vwr.getBooleanProperty("_useCommandThread");if(this.vwr.autoExit||!this.vwr.haveDisplay&&!this.vwr.isWebGL)return!1;
if(0==this.scriptLevel&&this.pc==this.aatoken.length-1)return this.vwr.scriptStatus("nothing to pause: "+a),!1;a=0==a.length?": RESUME to continue.":": "+JU.Txt.formatText(this.vwr,a);this.pauseExecution(!0);this.vwr.scriptStatusMsg("script execution paused"+a,"script paused for RESUME");return!0});e(c$,"cmdPrint",function(){1==this.slen&&this.bad();this.showStringPrint(this.parameterExpressionString(1,0),!0)});e(c$,"cmdPrompt",function(){var a=null;1==this.slen?this.chk||(a=JS.ScriptEval.getContextTrace(this.vwr,
this.getScriptContext("prompt"),null,!0).toString()):a=this.parameterExpressionString(1,0);this.chk||this.vwr.prompt(a,"OK",null,!0)});e(c$,"cmdReset",function(){if(3==this.slen&&135368713==this.tokAt(1))this.chk||this.vwr.removeFunction(this.stringParameter(2));else if(this.checkLength(-2),!this.chk)if(1==this.slen)this.vwr.reset(!1);else{switch(this.tokAt(1)){case 36865:!this.chk&&null!=this.outputBuffer&&this.outputBuffer.setLength(0);return;case 135270423:this.vwr.cacheClear();return;case 1073741935:this.resetError();
return;case 1073741995:this.vwr.stm.resetLighting();return;case 1087373323:this.vwr.resetShapes(!0);return;case 135368713:this.vwr.clearFunctions();return;case 1641025539:var a=new JU.BS;this.runScript(this.vwr.ms.getDefaultStructure(this.vwr.bsA(),a));this.vwr.shm.resetBioshapes(a);return;case 1649412120:this.vwr.setData("element_vdw",[null,""],0,0,0,0,0);return;case 1076887572:this.vwr.ms.resetAromatic();return;case 1611141175:this.vwr.reset(!0);return}a=this.paramAsStr(1);"_"==a.charAt(0)&&this.invArg();
this.vwr.unsetProperty(a)}});e(c$,"resetError",function(){this.vwr.g.removeParam("_errormessage")});e(c$,"cmdRestrict",function(){var a=1678770178==this.tokAt(1);this.cmdSelect(a?2:1);this.restrictSelected(a,!0)});e(c$,"cmdReturn",function(a){if(!this.chk){var b=this.getContextVariableAsVariable("_retval");if(null!=b){var c=null!=a||1==this.slen?null:this.parameterExpressionToken(1);null==a&&(a=null==c?JS.SV.newI(0):c);b.value=a.value;b.intValue=a.intValue;b.tok=a.tok}this.cmdGoto(!1)}},"JS.SV");
e(c$,"cmdRotate",function(a,b){if(2==this.slen)switch(this.getToken(1).tok){case 1048589:this.chk||this.vwr.tm.setSpinOn();return;case 1048588:this.chk||this.vwr.tm.setSpinOff();return}for(var c=null,d=1.4E-45,f=0,g=3.4028235E38,e=!1,h=!1,n=null,l=null,j=Array(2),m=JU.V3.new3(0,1,0),q=null,r=null,l=null,s=!1,p=1,v,l=null,A=!1,x=null,t=null,w=null,z=null,y=this.vwr.getBoolean(603979806),u=1;u<this.slen;++u){switch(v=this.getToken(u).tok){case 10:case 1048577:case 1048586:case 8:case 1048582:if(10==
v||1048577==v)if(null!=q||null!=l||2==f){c=this.atomExpressionAt(u);x=null;b=!0;break}h=!0;2==f&&(f=0);var C=this.centerParameterForModel(u,this.vwr.am.cmi);!this.chk&&(1048582==v&&269484096!=this.tokAt(u+2))&&(e=!0,m=[this.objectNameParameter(++u),Integer.$valueOf(this.vwr.am.cmi),null],m=this.getShapePropertyData(22,"getSpinAxis",m)?m[2]:null);j[f++]=C;break;case 1611141175:a=!0;continue;case 1073741988:case 1073742028:e=!0;continue;case 1114638363:b=!0;break;case 269484080:continue;case 2:case 3:if(a)if(1.4E-45==
d){d=this.floatParameter(u);continue}else{if(3.4028235E38==g){g=d;d=this.floatParameter(u);continue}}else if(3.4028235E38==g){g=this.floatParameter(u);continue}else if(1.4E-45==d){d=this.floatParameter(u);a=!0;continue}this.invArg();break;case 269484192:p=-1;continue;case 1112541205:h=!0;m.set(p,0,0);continue;case 1112541206:h=!0;m.set(0,p,0);continue;case 1112541207:h=!0;m.set(0,0,y&&!e?-p:p);continue;case 9:case 135270418:case 1073741863:135270418==v&&u++;h=!0;l=this.getQuaternionParameter(u);if(null!=
l){if(1073741863==v&&!(e=b))l=l.mulQ(JU.Quat.newM(this.vwr.tm.matrixRotate).mul(-1));m.setT(l.getNormal());g=l.getTheta()}break;case 135266307:h=!0;if(this.isPoint3f(++u)){m.setT(this.centerParameter(u));break}g=this.getPoint4f(u);m.set(g.x,g.y,g.z);g=g.w;l=JU.Quat.newVA(m,g);break;case 1048580:h=e=b=!0;if(this.isArrayParameter(++u))n=this.floatParameterSet(u,6,2147483647);else{f=this.atomExpressionAt(u).nextSetBit(0);u=this.atomExpressionAt(++this.iToken).nextSetBit(0);if(0>f||0>u)return;c=this.vwr.getBranchBitSet(u,
f,!0);j[0]=this.vwr.ms.at[f];j[1]=this.vwr.ms.at[u];f=2}break;case 4160:q=JU.V3.newV(this.centerParameter(++u));e=b=!0;break;case 137363467:A=!0;continue;case 1297090050:v=this.intParameter(++u);if(this.chk)continue;q=this.vwr.ms.getSymTemp(!0).getSpaceGroupInfo(this.vwr.ms,null);e=null==q?null:q.get("operations");(0==v||null==e||e.length<Math.abs(v))&&this.invArg();e=e[Math.abs(v)-1];q=e[5];w=e[6];j[0]=e[7];null!=e[8]&&(m=e[8]);g=e[9].intValue();0>v&&(g=-g,null!=q&&q.scale(-1));0==g&&null!=j[0]&&
(m.normalize(),JU.Measure.getPlaneThroughPoint(j[0],m,z=new JU.P4));l=JU.Quat.newVA(m,g);f=null==j[0]?0:1;b=h=e=!0;continue;case 135270405:t=this.atomExpressionAt(++u);l=this.vwr.ms.getAtomPointVector(t);null==l&&(this.iToken=u,this.invArg());u=this.iToken;x=this.getPointVector(this.getToken(++u),u);if(null==x||l.size()!=x.size())this.iToken=u,this.invArg();r=new JU.M4;j[0]=new JU.P3;f=1;J.api.Interface.getInterface("JU.Eigen",this.vwr,"script");if(0.001<(this.chk?0:JU.Measure.getTransformMatrix4(l,
x,r,j[0])))x=null;case 12:case 11:h=!0;l=new JU.M3;12==v&&(s=!0,r=this.theToken.value);null!=r?(q=new JU.V3,r.getTranslation(q),r.getRotationScale(l)):l=this.theToken.value;l=this.chk?new JU.Quat:JU.Quat.newM(l);m.setT(l.getNormal());g=l.getTheta();e=!0;break;default:this.invArg()}u=this.iToken}if(!this.chk){null!=n&&3.4028235E38!=g&&(a=!0,d=g);b&&null==c&&(c=this.vwr.bsA());null!=t&&(b=!0,null==c&&(c=t));p=1.4E-45==d?10:3.4028235E38==g?d:0>d==0<g?-g/d:d;if(null!=n){if(!a){this.vwr.setDihedrals(n,
null,1);return}q=null}null!=l&&(0==f&&(null!=q&&!s)&&(j[0]=this.vwr.ms.getAtomSetCenter(null!=c?c:b?this.vwr.bsA():this.vwr.getAllAtoms())),A&&null!=q&&(j[1]=JU.P3.newP(j[0]),j[1].add(q),r=JU.Measure.computeHelicalAxis(j[0],j[1],l),j[0]=r[0],A=r[3].x,0!=A&&(q=r[1],m=JU.V3.newV(q),0>A&&m.scale(-1)),r=null),a&&null==r&&(r=JS.ScriptMathProcessor.getMatrix4f(l.getMatrix(),q)),null!=j[0]&&(f=1));if(null!=w&&(this.vwr.invertAtomCoordPt(w,c),null==m)||null!=z&&(this.vwr.invertAtomCoordPlane(z,c),null==m))return;
z=a&&(!this.vwr.headless||3.4028235E38==g);a&&!z&&(a=!1);if(2>f&&null==n){if(!e){if(z&&(null==c&&!this.useThreads())&&(a=!1,3.4028235E38==g))return;if(this.vwr.rotateAxisAngleAtCenter(this,j[0],m,p,g,a,c)&&this.isJS&&a&&null==c&&this.vwr.g.waitForMoveTo&&3.4028235E38!=g)throw new JS.ScriptInterruption(this,"rotate",1);return}0==f&&(j[0]=new JU.P3);j[1]=JU.P3.newP(j[0]);j[1].add(m);f=2}0==f&&(j[0]=new JU.P3);if(2>f||0==j[0].distance(j[1]))j[1]=JU.P3.newP(j[0]),j[1].y+=1;3.4028235E38==g&&(g=0);0!=g&&
(null!=q&&!h)&&q.scale(g/q.length());if(a&&null!=q&&(0==g||0==d))g=0.01,p=1.4E-45==d?0.01:0>d?-g/d:0.01*d/q.length();null!=c&&(a&&null==x&&null!=r)&&(l=this.vwr.ms.getAtomPointVector(c),x=JU.Measure.transformPoints(l,r,j[0]));if(null!=c&&!a&&null!=x)this.vwr.setAtomCoords(c,1146095626,x);else if(!z||this.useThreads())if(this.vwr.rotateAboutPointsInternal(this,j[0],j[1],p,g,a,c,q,x,n,s?r:null)&&this.isJS&&a)throw new JS.ScriptInterruption(this,"rotate",1);}},"~B,~B");e(c$,"cmdRestore",function(){if(1<
this.slen){var a=this.optParameterAsString(2),b=this.tokAt(1);switch(b){case 1614417948:this.chk||this.setCurrentCagePts(null,null);return;case 1073742077:case 1073742132:case 1073742139:var c=3<this.slen?this.floatParameter(3):0;0>c&&this.invArg();if(this.chk)return;var d="";switch(b){case 1073742077:d="Orientation";this.vwr.stm.restoreOrientation(a,c,!0);break;case 1073742132:d="Rotation";this.vwr.stm.restoreOrientation(a,c,!1);break;case 1073742139:d="Scene",this.vwr.stm.restoreScene(a,c)}if(this.isJS&&
0<c&&this.vwr.g.waitForMoveTo)throw new JS.ScriptInterruption(this,"restore"+d,1);return}this.checkLength23();switch(b){case 1678770178:this.chk||this.vwr.stm.restoreBonds(a);return;case 14:if(this.chk)return;a=this.vwr.stm.getContext(a);null!=a&&(this.restoreScriptContext(a,!0,!1,!1),null!=this.thisContext&&(this.thisContext.setMustResume(),this.tQuiet=this.mustResumeEval=!0));return;case 1048581:if(this.chk)return;a=this.vwr.stm.getSavedCoordinates(a);null==a&&this.invArg();this.runScript(a);this.vwr.checkCoordinatesChanged();
return;case 1073742140:this.chk||this.vwr.stm.restoreSelection(a);return;case 1073742158:if(this.chk)return;a=this.vwr.stm.getSavedState(a);null==a&&this.invArg();this.runScript(a);return;case 1641025539:if(this.chk)return;a=this.vwr.stm.getSavedStructure(a);null==a&&this.invArg();this.runScript(a);return}}this.errorStr2(53,"RESTORE","bonds? context? coordinates? orientation? rotation? selection? state? structure?")});e(c$,"cmdSave",function(){if(1<this.slen){var a=this.optParameterAsString(2);switch(this.tokAt(1)){case 1678770178:this.chk||
this.vwr.stm.saveBonds(a);return;case 14:this.chk||this.saveContext(a);return;case 1048581:this.chk||this.vwr.stm.saveCoordinates(a,this.vwr.bsA());return;case 1073742077:case 1073742132:this.chk||this.vwr.stm.saveOrientation(a,null);return;case 1073742140:this.chk||(this.vwr.stm.saveSelection(a,this.vwr.bsA()),this.vwr.stm.restoreSelection(a));return;case 1073742158:this.chk||this.vwr.stm.saveState(a);return;case 1641025539:this.chk||this.vwr.stm.saveStructure(a);return}}this.errorStr2(53,"SAVE",
"bonds? context? coordinates? orientation? rotation? selection? state? structure?")});e(c$,"cmdScript",function(a,b,c){var d=!0,f=!1,g=!1,e=0,h=0,n=0,l=0,j=1,m=null,q=null,r=null,s=null;if(135287308==a)this.checkLength(2),this.chk||this.vwr.jsEval(this.paramAsStr(1));else{var p=this.vwr.async;if(null==b&&null==c)if(a=this.tokAt(j),4!=a&&this.error(16),b=this.paramAsStr(j),b.equalsIgnoreCase("async")&&(p=!0,b=this.paramAsStr(++j)),b.equalsIgnoreCase("applet")){a=this.paramAsStr(++j);c=this.parameterExpressionString(++j,
0);this.checkLast(this.iToken);if(this.chk)return;if(0==a.length||a.equals("all"))a="*";if(!a.equals(".")&&(this.vwr.jsEval(a+"\u0001"+c),!a.equals("*")))return}else{a=this.tokAt(this.slen-1);g=266298==a;b.equalsIgnoreCase("inline")&&(c=this.parameterExpressionString(++j,g?this.slen-1:0),j=this.iToken);for(;b.equalsIgnoreCase("localPath")||b.equalsIgnoreCase("remotePath")||b.equalsIgnoreCase("scriptPath");)b.equalsIgnoreCase("localPath")?m=this.paramAsStr(++j):b.equalsIgnoreCase("scriptPath")?r=this.paramAsStr(++j):
q=this.paramAsStr(++j),b=this.paramAsStr(++j);if((this.vwr.isJS||this.vwr.testAsync)&&(p||b.startsWith("?")))b=this.loadFileAsync("SCRIPT_",b,j,!0);if(1073741878==(a=this.tokAt(++j)))f=!0,a=this.tokAt(++j);1073742050==a&&(d=!1,a=this.tokAt(++j));if(1073741998==a||1141899268==a)j++,n=e=Math.max(this.intParameter(j++),0),this.checkToken(j)&&(n=269484192==this.getToken(j).tok?this.checkToken(++j)?this.intParameter(j++):0:-this.intParameter(j++),0>=n&&this.invArg());else if(1073741890==a||1073741892==
a)j++,h=Math.max(this.intParameter(j++)-1,0),l=h+1,this.checkToken(j)&&(l=269484192==this.getToken(j).tok?this.checkToken(++j)?this.intParameter(j++):0:-this.intParameter(j++),0>=l&&this.invArg());269484048==this.tokAt(j)&&(s=this.parameterExpressionList(j,-1,!1),j=this.iToken+1);this.checkLength(g?j+1:j)}else null!=b&&p&&(b=this.loadFileAsync("SCRIPT_",b,j,!0));if(!this.chk||this.isCmdLine_c_or_C_Option){this.isCmdLine_c_or_C_Option&&(f=!0);j=this.chk;a=this.isCmdLine_c_or_C_Option;f&&(this.chk=
this.isCmdLine_c_or_C_Option=!0);this.pushContext(null,"SCRIPT");this.contextPath+=" >> "+b;if(null==c?this.compileScriptFileInternal(b,m,q,r):this.compileScript(null,c,!1)){this.pcEnd=l;for(this.lineEnd=n;h<this.lineNumbers.length&&this.lineNumbers[h]<e;)h++;this.pc=h;b=this.isCmdLine_C_Option;this.isCmdLine_C_Option=(new Boolean(this.isCmdLine_C_Option&d)).valueOf();this.executionStepping=(new Boolean(this.executionStepping|g)).valueOf();null==this.contextVariables&&(this.contextVariables=new java.util.Hashtable);
this.contextVariables.put("_arguments",null==s?JS.SV.getVariableAI([]):JS.SV.getVariableList(s));f&&(this.listCommands=!0);(d=this.vwr.getBoolean(603979934))&&JU.Logger.startTimer("script");this.dispatchCommands(!1,!1,!1);this.$isStateScript&&JS.ScriptManager.setStateScriptVersion(this.vwr,null);d&&this.showString(JU.Logger.getTimerMsg("script",0));this.isCmdLine_C_Option=b;this.popContext(!1,!1)}else JU.Logger.error(J.i18n.GT._("script ERROR: ")+this.errorMessage),this.popContext(!1,!1),a?this.setErrorMessage(null):
this.evalError(null,null);this.chk=j;this.isCmdLine_c_or_C_Option=a}}},"~N,~S,~S");e(c$,"cmdSelect",function(a){if(1==this.slen)this.vwr.select(null,!1,0,!this.doReport());else if(!(2==this.slen&&1073742072==this.tokAt(1))){var b=this.tokAt(2);this.vwr.slm.noneSelected=Boolean.$valueOf(4==this.slen&&1048587==b);var c=null;switch(b){case 10:if(q(this.getToken(2).value,JM.BondSet)||1678770178==this.tokAt(2)&&10==this.getToken(3).tok){this.slen!=this.iToken+2&&this.invArg();this.chk||this.vwr.selectBonds(this.theToken.value);
return}break;case 1746538509:case 1678770178:if(5==this.slen&&10==this.tokAt(3))c=this.getToken(3).value,this.iToken++;else if(this.isArrayParameter(4)){var c=new JU.BS,d=this.expandFloatArray(this.floatParameterSet(4,0,2147483647),0);for(a=d.length;0<=--a;)0<=d[a]&&c.set(d[a])}this.checkLast(this.iToken);if(this.chk)return;null==c&&this.invArg();1746538509==b?this.setShapeProperty(6,"select",c):this.vwr.selectBonds(c);return}d=0;b=!1;if(0==this.getToken(1).intValue&&1048588!=this.theTok)c=this.parameterExpressionToken(0).value,
q(c,JU.BS)||this.invArg(),this.checkLast(this.iToken);else{b=this.tokAt(a);switch(b){case 1048589:case 1048588:if(this.chk||this.vwr.setSelectionHalos(1048589==b),b=this.tokAt(++a),0==b)return}switch(b){case 1276118017:case 1073742119:d=b,b=this.tokAt(++a)}(b=1087373318==b)&&this.tokAt(++a);c=this.atomExpressionAt(a)}this.chk||(this.isBondSet?this.vwr.selectBonds(c):(c.length()>this.vwr.ms.ac&&(a=this.vwr.getAllAtoms(),a.and(c),c=a),this.vwr.select(c,b,d,!this.doReport())))}},"~N");e(c$,"cmdSelectionHalos",
function(a){var b=!1;switch(a==this.slen?1048589:this.getToken(a).tok){case 1048589:case 1114638363:b=!0;case 1048588:case 1048587:case 1073742056:this.setBooleanProperty("selectionHalos",b);break;default:this.invArg()}},"~N");e(c$,"cmdSet",function(){if(1==this.slen)this.showString(this.vwr.getAllSettings(null));else{var a=this.paramAsStr(0).equals("set"),b=this.optParameterAsString(1);if(a&&2==this.slen&&0<=b.indexOf("?"))this.showString(this.vwr.getAllSettings(b.substring(0,b.indexOf("?"))));else{var c=
this.getToken(1).tok,d=0,f,g=2147483647,e;e=!this.chk&&this.doReport()&&!this.st[0].value.equals("var");switch(c){case 1611272194:this.cmdAxes(2);return;case 1610616835:this.cmdBackground(2);return;case 1679429641:this.cmdBoundbox(2);return;case 1611272202:this.cmdFrank(2);return;case 1610616855:this.cmdHistory(2);return;case 1826248716:this.cmdLabel(2);return;case 1614417948:this.cmdUnitcell(2);return;case 536870920:this.sm.loadShape(8);this.setShapeProperty(8,"highlight",1048588==this.tokAt(2)?
null:this.atomExpressionAt(2));return;case 1610625028:case 1611141171:this.cmdSelectionHalos(2);return;case 536875070:this.cmdTimeout(2);return}switch(c){case 1641025539:e=J.c.STR.getProteinStructureType(this.paramAsStr(2));e===J.c.STR.NOT&&this.invArg();a=this.floatParameterSet(3,0,2147483647);0!=a.length%4&&this.invArg();this.vwr.setStructureList(a,e);this.checkLast(this.iToken);return;case 545259526:g=this.getArgbParam(2);this.chk||this.setObjectArgb("axes",g);return;case 1610612737:e=!1;switch(this.getToken(this.checkLast(2)).tok){case 269484128:break;
case 269484112:e=!0;break;default:this.invArg()}this.setBooleanProperty("bondModeOr",e);return;case 536870916:if(this.chk)return;a=1048588==this.tokAt(2)||2==this.tokAt(2)&&0==this.intParameter(2)?4:5;JU.Logger.setLogLevel(a);this.setIntProperty("logLevel",a);4==a&&(this.vwr.setDebugScript(!1),e&&this.vwr.showParameter("debugScript",!0,80));this.setDebugging();e&&this.vwr.showParameter("logLevel",!0,80);return;case 537022465:this.cmdSetEcho();return;case 1610612738:this.cmdFont(5,2==this.checkLength23()?
0:this.floatParameter(2));return;case 1612189718:e=!1;switch(this.tokAt(this.checkLast(2))){case 1115297793:e=!0;case 3145754:this.setBooleanProperty("hbondsBackbone",e);break;case 1073742150:e=!0;case 1073741926:this.setBooleanProperty("hbondsSolid",e);break;default:this.invArg()}return;case 1746538509:case 537006096:switch(c=this.tokAt(this.checkLast(2))){case 1048589:case 1048588:this.setBooleanProperty("measurementlabels",1048589==c);return;case 1073741926:case 2:case 3:this.vwr.shm.loadShape(6);
e=this.getSetAxesTypeMad(2);2147483647!=e&&this.setShapeSizeBs(6,e,null);return}this.setUnits(this.paramAsStr(2),545259568);return;case 1611141176:e=!1;switch(this.tokAt(this.checkLast(2))){case 1115297793:e=!0;break;case 3145754:break;default:this.invArg()}this.setBooleanProperty("ssbondsBackbone",e);return;case 1610612741:this.cmdSetLabel("toggle");return;case 536870930:e=new JU.Lst;for(b=2;b<this.slen;b++)a=this.getArgbParam(b),e.addLast(Integer.$valueOf(a)),b=this.iToken;if(this.chk)return;b=
e.size();for(a=O(b,0);0<=--b;)a[b]=e.get(b).intValue();this.vwr.cm.ce.setUserScale(a);return;case 553648188:this.isFloatParameter(2)?(this.checkLength(3),this.setIntProperty("zSlab",B(this.floatParameter(2))),f=null):(this.isCenterParameter(2)||this.invArg(),f=this.centerParameter(2),this.checkLength(this.iToken+1));this.chk||(this.vwr.tm.zSlabPoint=null==f?null:JU.P3.newP(f));return}var h=!0;switch(c){case 536870914:if(2<this.slen){a=this.getSettingStr(2,!1);e=!1;0>a.indexOf(".")?(a=JU.PT.parseInt(a),
e=!0):a=JS.ScriptParam.getFloatEncodedInt(a);if(this.chk)return;e=this.vwr.ms.getModelNumberIndex(a,e,!0);this.vwr.setBackgroundModelIndex(e);return}break;case 1649412120:if(this.chk)return;this.vwr.setAtomProperty(this.vwr.getAllAtoms(),1649412120,-1,NaN,null,null,null);if(2<this.slen&&"probe".equalsIgnoreCase(this.getSettingStr(2,!1))){this.runScript("#VDW radii for PROBE;{_H}.vdw = 1.0;{_H and connected(_C) and not connected(within(smiles,'[a]'))}.vdw = 1.17;{_C}.vdw = 1.75;{_C and connected(3) and connected(_O)}.vdw = 1.65;{_N}.vdw = 1.55;{_O}.vdw = 1.4;{_P}.vdw = 1.8;{_S}.vdw = 1.8;message VDW radii for H, C, N, O, P, and S set according to Word, et al., J. Mol. Biol. (1999) 285, 1711-1733");
return}d=545259555;case 545259555:2<this.slen&&(f=this.paramAsStr(2),3==this.slen&&(null==J.c.VDW.getVdwType(f)&&null==J.c.VDW.getVdwType(f=this.getSettingStr(2,!1)))&&this.invArg(),this.setStringProperty(b,f));break;case 536870918:if(2<this.slen){var n=this.parameterExpressionToken(2);8==n.tok?f=n.value:(f=new JU.P3,n=n.asInt(),100<=n&&JU.SimpleUnitCell.ijkToPoint3f(n,f,-1));this.chk||this.vwr.setDefaultLattice(f)}break;case 545259552:case 545259545:2<this.slen&&(f=1073741991==(this.theTok=this.tokAt(2))||
1073742116==this.theTok?this.paramAsStr(this.checkLast(2)):this.getSettingStr(2,!1),this.setStringProperty(b,f));break;case 1632634891:g=this.getSettingInt(2);-2147483648==g&&this.invArg();this.chk||this.vwr.ms.setFormalCharges(this.vwr.bsA(),g);return;case 553648148:g=this.getSettingInt(2);this.chk||(-2147483648!=g&&(this.commandHistoryLevelMax=g),this.setIntProperty(b,g));break;case 545259564:2<this.slen&&this.setStringProperty(b,this.getSettingStr(2,a));break;case 545259568:case 545259559:2<this.slen&&
this.setUnits(this.getSettingStr(2,a),c);break;case 545259572:this.chk||this.vwr.setPicked(-1);if(2<this.slen){this.cmdSetPicking();return}break;case 545259574:if(2<this.slen){this.cmdSetPickingStyle();return}break;case 1716520985:break;case 553648168:g=this.getSettingInt(2);!this.chk&&-2147483648!=g&&this.setIntProperty(b,this.scriptReportingLevel=g);break;case 536870924:g=this.getSettingInt(2);if(-2147483648==g||0==g||1==g){h=!1;break}c=553648174;b="specularPercent";this.setIntProperty(b,g);break;
case 1650071565:c=553648178;b="strandCount";this.setIntProperty(b,this.getSettingInt(2));break;default:h=!1}if(!h||e){n=!h&&!a&&null!=this.getContextVariableAsVariable(b);if(!h&&!n)switch(c){case 1678770178:d=603979928;break;case 1613758470:d=603979908;break;case 1613758476:d=603979910;break;case 1610612739:d=603979879;break;case 1666189314:d=570425394;this.setFloatProperty("solventProbeRadius",this.getSettingFloat(2));h=!0;break;case 1610612740:d=570425390;break;case 1613758488:d=603979948;break;
case 1766856708:d=545259545;break;case 1611141175:f=this.paramAsStr(2).toLowerCase();switch("x;y;z;fps".indexOf(f+";")){case 0:d=570425398;break;case 2:d=570425400;break;case 4:d=570425402;break;case 6:d=570425396;break;default:this.errorStr2(50,"set SPIN ",f)}this.chk||this.vwr.setSpin(f,B(this.floatParameter(this.checkLast(3))));h=!0}if(0!=d)b=JS.T.nameOf(c=d);else if(!h&&!n){(0==b.length||"_"==b.charAt(0)&&269484096!=this.tokAt(2))&&this.error(56);d=b.toLowerCase();if(0==d.indexOf("label")&&JU.PT.isOneOf(d.substring(5),
";front;group;atom;offset;offsetexact;pointer;alignment;toggle;scalereference;")&&this.cmdSetLabel(d.substring(5)))return;if(a&&0==d.indexOf("shift_")){e=this.floatParameter(2);this.checkLength(3);this.chk||this.vwr.getNMRCalculation().setChemicalShiftReference(d.substring(6),e);return}d.endsWith("callback")&&(c=536870912)}a&&!JS.T.tokAttr(c,536870912)&&(this.iToken=1,this.$isStateScript||this.errorStr2(50,"SET",b),this.warning(51,"SET",b));if(!h&&a)switch(this.slen){case 2:this.setBooleanProperty(b,
!0);h=!0;break;case 3:2147483647!=g&&(this.setIntProperty(b,g),h=!0)}!h&&(!a&&1048587==this.tokAt(2))&&(this.chk||this.vwr.removeUserVariable(b.toLowerCase()),h=!0);if(!h&&(this.setVariable(1,0,b,!0),!a))return;e&&this.vwr.showParameter(b,!0,80)}}}});e(c$,"cmdSetEcho",function(){var a=null,b=null,c=null,d=!0,f=2;switch(this.getToken(2).tok){case 1048588:c=a="allOff";this.checkLength(++f);break;case 1048587:d=!1;case 1048579:c=this.paramAsStr(2);this.checkLength(++f);break;case 1073741996:case 12289:case 1073742126:case 1074790748:case 1073742019:case 1073741871:case 1073741824:case 4:case 1074790550:1074790550==
this.theTok&&f++,c=this.paramAsStr(f++)}this.chk||(this.vwr.ms.setEchoStateActive(d),this.sm.loadShape(31),null!=c&&this.setShapeProperty(31,null==a?"target":a,c));if(f<this.slen)switch(this.getToken(f++).tok){case 1073741832:a="align";switch(this.getToken(f).tok){case 1073741996:case 1073742126:case 12289:b=this.paramAsStr(f++);break;default:this.invArg()}break;case 12289:case 1073741996:case 1073742126:a="align";b=this.paramAsStr(f-1);break;case 554176526:a="%zpos";b=Integer.$valueOf(B(this.floatParameter(f++)));
break;case 1610625028:case 3145768:case 1048589:a="hidden";b=Boolean.FALSE;break;case 12294:case 3145770:a="hidden";b=Boolean.TRUE;break;case 1095766030:b=this.chk?0:this.modelNumberParameter(f++);b>=this.vwr.ms.mc&&this.invArg();a="model";b=Integer.$valueOf(b);break;case 269484096:case 1073742195:a="xypos";b=this.xypParameter(--f);null==b&&this.invArg();f=this.iToken+1;break;case 2:c=this.intParameter(f-1);d="xpos";269484210==this.tokAt(f)&&(d="%xpos",f++);a="ypos";b=Integer.$valueOf(this.intParameter(f++));
269484210==this.tokAt(f)&&(a="%ypos",f++);this.checkLength(f);this.setShapeProperty(31,d,Integer.$valueOf(c));break;case 1048588:a="off";break;case 1073742138:a="scale";b=Float.$valueOf(this.floatParameter(f++));break;case 135271429:a="script";b=this.paramAsStr(f++);break;case 1073741979:f++;case 4:a=4!=this.theTok;this.checkLength(f--);if(a){null==c&&(a=Array(1),this.getShapePropertyData(31,"currentTarget",a),c=a[0]);!this.chk&&this.vwr.ms.getEchoStateActive()&&this.vwr.fm.loadImage(this.getToken(f).value,
c);return}this.cmdEcho(f-1);return;case 135266320:a="point";b=this.isCenterParameter(f)?this.centerParameter(f):null;f=this.iToken+1;break;default:if(this.isCenterParameter(f-1)){a="xyz";b=this.centerParameter(f-1);f=this.iToken+1;break}this.invArg()}this.checkLength(f);!this.chk&&null!=a&&this.setShapeProperty(31,a,b)});e(c$,"cmdSetLabel",function(a){this.sm.loadShape(5);var b=null;for(this.setShapeProperty(5,"setDefaults",this.vwr.slm.noneSelected);;){if(a.equals("scalereference")){b=this.floatParameter(2);
5<=b&&(b=this.vwr.tm.getZoomSetting()/b/this.vwr.getScalePixelsPerAngstrom(!1));b=Float.$valueOf(b);break}if(a.equals("offset")||a.equals("offsetexact")){if(this.isPoint3f(2))b=this.getPoint3f(2,!1),b=[1,b.x,b.y,b.z,0,0,0];else if(this.isArrayParameter(2))b=this.floatParameterSet(2,7,7);else{var b=this.intParameterRange(2,-127,127),c=this.intParameterRange(3,-127,127);if(2147483647==b||2147483647==c)return!0;b=Integer.$valueOf(JV.JC.getOffset(b,c))}break}if(a.equals("alignment")){switch(this.getToken(2).tok){case 1073741996:case 1073742126:case 12289:a=
"align";b=this.theToken.value;break;default:this.invArg()}break}if(a.equals("pointer")){b=0;switch(this.getToken(2).tok){case 1048588:case 1048587:break;case 1610616835:b|=2;case 1048589:b|=1;break;default:this.invArg()}b=Integer.$valueOf(b);break}if(a.equals("toggle")){this.iToken=1;c=2==this.slen?this.vwr.bsA():this.atomExpressionAt(2);this.checkLast(this.iToken);if(this.chk)return!0;this.vwr.shm.loadShape(5);this.vwr.shm.setShapePropertyBs(5,"toggleLabel",null,c);return!0}this.iToken=1;b=2==this.slen||
1048589==this.getToken(2).tok;if(a.equals("front")||a.equals("group")){!b&&1048588!=this.tokAt(2)&&this.invArg();b||(a="front");b=b?Boolean.TRUE:Boolean.FALSE;break}if(a.equals("atom")){!b&&1048588!=this.tokAt(2)&&this.invArg();a="front";b=b?Boolean.FALSE:Boolean.TRUE;break}return!1}c=this.iToken+1<this.slen?this.atomExpressionAt(++this.iToken):null;this.checkLast(this.iToken);if(this.chk)return!0;null==c?this.setShapeProperty(5,a,b):this.setShapePropertyBs(5,a,b,c);return!0},"~S");e(c$,"cmdSetPicking",
function(){if(2==this.slen)this.setStringProperty("picking","identify");else if(4<this.slen||4==this.tokAt(2))this.setStringProperty("picking",this.getSettingStr(2,!1));else{var a=2,b="SELECT";switch(this.getToken(2).tok){case 135280132:case 1746538509:case 1611141175:4==this.checkLength34()&&(b=this.paramAsStr(2).toUpperCase(),b.equals("SPIN")?this.setIntProperty("pickingSpinRate",this.intParameter(3)):a=3);break;case 12291:break;default:this.checkLength(3)}var c=this.paramAsStr(a);switch(this.getToken(a).tok){case 1048589:case 1073742056:c=
"identify";break;case 1048588:case 1048587:c="off";break;case 135280132:c="atom";break;case 1826248716:c="label";break;case 1678770178:c="bond";break;case 12291:this.checkLength(4),1678770178!=this.tokAt(3)&&this.invArg(),c="deleteBond"}var d=0<=(d=c.indexOf("_"))?d:c.length,d=JV.ActionManager.getPickingMode(c.substring(0,d));0>d&&this.errorStr2(50,"SET PICKING "+b,c);this.setStringProperty("picking",c)}});e(c$,"cmdSetPickingStyle",function(){if(4<this.slen||4==this.tokAt(2))this.setStringProperty("pickingStyle",
this.getSettingStr(2,!1));else{var a=2,b=!1,c="SELECT";switch(this.getToken(2).tok){case 1746538509:b=!0,c="MEASURE";case 135280132:4==this.checkLength34()&&(a=3);break;default:this.checkLength(3)}var d=this.paramAsStr(a);switch(this.getToken(a).tok){case 1048587:case 1048588:d=b?"measureoff":"toggle";break;case 1048589:b&&(d="measure")}0>JV.ActionManager.getPickingStyleIndex(d)&&this.errorStr2(50,"SET PICKINGSTYLE "+c,d);this.setStringProperty("pickingStyle",d)}});e(c$,"cmdSlab",function(a){var b=
!1,c=null;if(this.isCenterParameter(1)||9==this.tokAt(1))c=this.planeParameter(1);else switch(this.getToken(1).tok){case 2:c=this.intParameter(this.checkLast(1));this.chk||(a?this.vwr.tm.depthToPercent(c):this.vwr.tm.slabToPercent(c));return;case 1048589:this.checkLength(2),b=!0;case 1048588:this.checkLength(2);this.setBooleanProperty("slabEnabled",b);return;case 4141:this.checkLength(2);if(this.chk)return;this.vwr.tm.slabReset();this.setBooleanProperty("slabEnabled",!0);return;case 1085443:this.checkLength(2);
if(this.chk)return;this.vwr.tm.setSlabDepthInternal(a);this.setBooleanProperty("slabEnabled",!0);return;case 269484192:b=this.paramAsStr(2);b.equalsIgnoreCase("hkl")?c=this.hklParameter(3):b.equalsIgnoreCase("plane")&&(c=this.planeParameter(2));null==c&&this.invArg();c.scale4(-1);break;case 135266319:switch(this.getToken(2).tok){case 1048587:break;default:c=this.planeParameter(1)}break;case 135267841:c=1048587==this.getToken(2).tok?null:this.hklParameter(2);break;case 1073742118:return;default:this.invArg()}this.chk||
this.vwr.tm.slabInternal(c,a)},"~B");e(c$,"cmdSsbond",function(){var a=this.getMadParameter();2147483647!=a&&(this.setShapeProperty(1,"type",Integer.$valueOf(256)),this.setShapeSizeBs(1,a,null),this.setShapeProperty(1,"type",Integer.$valueOf(1023)))});e(c$,"cmdStructure",function(){var a=J.c.STR.getProteinStructureType(this.paramAsStr(1));a===J.c.STR.NOT&&this.invArg();var b=null;switch(this.tokAt(2)){case 10:case 1048577:b=this.atomExpressionAt(2);this.checkLast(this.iToken);break;default:this.checkLength(2)}this.chk||
(this.clearDefinedVariableAtomSets(),this.vwr.setProteinType(a,b))});e(c$,"cmdSubset",function(){var a=null;this.chk||this.vwr.slm.setSelectionSubset(null);if(1!=this.slen&&(4!=this.slen||!this.getToken(2).value.equals("off")))a=this.atomExpressionAt(1);this.chk||this.vwr.slm.setSelectionSubset(a)});e(c$,"cmdSync",function(){var a="",b="",c=JU.PT.parseInt(this.optParameterAsString(1));if(-2147483648==c)switch(this.checkLength(-3),c=0,this.slen){case 1:b="*";a="ON";break;case 2:b=this.paramAsStr(1);
if(0==b.indexOf("jmolApplet")||JU.PT.isOneOf(b,";*;.;^;")){a="ON";this.chk||this.vwr.syncScript(a,b,0);b=".";break}a=b;b="*";break;case 3:b=this.paramAsStr(1),a=528443==this.tokAt(2)?"GET_GRAPHICS":this.paramAsStr(2)}else{a=null;if(2<this.slen&&null==(a=this.setVariable(2,-1,"",!1)))return;a=2==this.slen?null:6==a.tok?a.toJSON():a.asString();b=null}this.chk||this.vwr.syncScript(a,b,c)});e(c$,"cmdThrow",function(){if(!this.chk){var a=14==this.tokAt(1)?2:1,b=(1==a?this.setVariable(1,this.slen,"thrown_value",
!1):this.vwr.g.setUserVariable("thrown_value",JS.SV.newS(this.optParameterAsString(2)))).asString();if(0==b.length&&0==(b=this.optParameterAsString(1)).length)b="context";if(2==a)throw this.saveContext(b),this.doReport()&&this.report(J.i18n.GT.o(J.i18n.GT._("to resume, enter: &{0}"),b)),new JS.ScriptInterruption(this,b,-2147483648);this.evalError(b,null)}});e(c$,"saveContext",function(a){var b=this.getScriptContext("Context_"+a);this.vwr.stm.saveContext(a,b);this.vwr.g.setUserVariable(a,JS.SV.newV(14,
b));return b},"~S");e(c$,"cmdTimeout",function(a){var b=null,c=null,d=0;if(this.slen==a)this.showString(this.vwr.showTimeout(null));else{for(;a<this.slen;a++)switch(this.getToken(a).tok){case 1074790550:b=this.paramAsStr(++a);if(3==this.slen){this.chk||this.vwr.triggerTimeout(b);return}break;case 1048588:break;case 2:d=this.intParameter(a);break;case 3:d=Math.round(1E3*this.floatParameter(a));break;default:null==b?b=this.paramAsStr(a):null==c?c=this.paramAsStr(a):this.invArg()}this.chk||this.vwr.setTimeout(b,
d,c)}},"~N");e(c$,"cmdTranslate",function(a){var b=null,c=1,b=0;1114638363==this.tokAt(1)&&(a=!0,b=1,c=2);if(this.isPoint3f(c)){var d=this.getPoint3f(c,!0),b=!a&&this.iToken+1<this.slen?this.atomExpressionAt(++this.iToken):null;this.checkLast(this.iToken);this.chk||this.vwr.setAtomCoordsRelative(d,b)}else{d=(this.paramAsStr(c).toLowerCase()+" ").charAt(0);0>"xyz".indexOf(d)&&this.error(0);var f=this.floatParameter(++c);switch(this.tokAt(++c)){case 0:case 10:case 1048577:c="\x00";break;default:c=(this.optParameterAsString(c).toLowerCase()+
"\x00").charAt(0)}0==f&&"\x00"!=c||(this.iToken=b+("\x00"==c?2:3),b=a?this.vwr.bsA():this.iToken+1<this.slen?this.atomExpressionAt(++this.iToken):null,this.checkLast(this.iToken),this.chk||this.vwr.translate(d,f,c,b))}},"~B");e(c$,"cmdUnbind",function(){1!=this.slen&&this.checkLength23();var a=this.optParameterAsString(1),b=this.optParameterAsString(2);if(0==a.length||1048579==this.tokAt(1))a=null;if(0==b.length||1048579==this.tokAt(2))b=null;null==b&&(null!=a&&0<=JV.ActionManager.getActionFromName(a))&&
(b=a,a=null);this.chk||this.vwr.unBindAction(a,b)});e(c$,"cmdUndoRedoMove",function(){var a=1,b=2;switch(this.tokAt(1)){case 0:b=1;break;case 1048579:a=0;break;case 2:a=this.intParameter(1);break;default:this.invArg()}this.checkLength(b);this.chk||this.vwr.undoMoveAction(this.tokAt(0),a)});e(c$,"cmdUnitcell",function(a){var b=2147483647,c=2147483647,d=null,f=this.tickParamAsStr(a,!0,!1,!1);a=this.iToken;var e=null,k=null,h=null,n=null,l=c=!1;switch(this.tokAt(++a)){case 4142:case 4141:l=!0;d=JU.P4.new4(0,
0,0,-1);this.iToken++;break;case 4:case 1073741824:n=c=this.paramAsStr(a).toLowerCase();0>c.indexOf(",")&&!this.chk&&(this.setCurrentCagePts(null,null),JU.PT.isOneOf(c,";parent;standard;primitive;")&&(h=this.vwr.ms.getInfo(this.vwr.am.cmi,"unitcell_conventional"),null!=h&&this.setCurrentCagePts(this.vwr.getV0abc(h),""+h)),c=this.vwr.ms.getInfo(this.vwr.am.cmi,"unitcell_"+c),this.showString(c));h=c;break;case 135180:case 1048582:e=this.objectNameParameter(++a);break;case 1679429641:k=JU.P3.newP(this.vwr.getBoundBoxCenter());
d=this.vwr.getBoundBoxCornerVector();k.sub(d);k=[k,JU.P3.new3(2*d.x,0,0),JU.P3.new3(0,2*d.y,0),JU.P3.new3(0,0,2*d.z)];d=null;this.iToken=a;break;case 11:case 12:h=this.getToken(a).value;break;case 12289:switch(this.tokAt(++a)){case 10:case 1048577:d=JU.P3.newP(this.vwr.ms.getAtomSetCenter(this.atomExpressionAt(a)));this.vwr.toFractional(d,!0);a=this.iToken;break;default:if(this.isCenterParameter(a)){d=this.centerParameter(a);a=this.iToken;break}this.invArg()}d.x-=0.5;d.y-=0.5;d.z-=0.5;break;case 10:case 1048577:a=
this.atomExpressionAt(a).nextSetBit(0);this.chk||(this.vwr.am.cai=a);if(0>a)return;a=this.iToken;break;case 1073742066:c=!0;case 1073742114:d=this.getPointOrPlane(++a,!1,!0,!1,!0,3,3);d=JU.P4.new4(d.x,d.y,d.z,c?1:0);a=this.iToken;break;case 3:case 2:if(111>this.floatParameter(a)){a--;break}b=this.intParameter(a);break;default:this.isArrayParameter(a)?(k=this.getPointArray(a,4,!1),a=this.iToken):this.slen>a+1?(d=this.getPointOrPlane(a,!1,!0,!1,!0,3,3),a=this.iToken):a--}c=this.getSetAxesTypeMad(++a);
this.checkLast(this.iToken);this.chk||2147483647==c||(2147483647==c&&(this.vwr.am.cai=-1),null!=h&&(k=this.vwr.getV0abc(h)),2147483647!=b?this.vwr.ms.setUnitCellOffset(this.vwr.getCurrentUnitCell(),null,b):null!=e?this.vwr.setCurrentCage(e):(l||null!=k)&&this.setCurrentCagePts(k,n),this.setObjectMad(33,"unitCell",c),null!=d&&this.vwr.ms.setUnitCellOffset(this.vwr.getCurrentUnitCell(),d,0),null!=f&&this.setShapeProperty(33,"tickInfo",f))},"~N");e(c$,"setCurrentCagePts",function(a,b){var c=J.api.Interface.getSymmetry(this.vwr,
"eval");if(null==c&&this.vwr.async)throw new NullPointerException;try{this.vwr.ms.setModelCage(this.vwr.am.cmi,null==a?null:c.getUnitCell(a,!1,b))}catch(d){if(!y(d,Exception))throw d;}},"~A,~S");e(c$,"cmdVector",function(){var a=J.atomdata.RadiusData.EnumType.SCREEN,b=1;this.checkLength(-3);switch(this.iToken=this.slen){case 2:switch(this.getToken(1).tok){case 1048589:break;case 1048588:b=0;break;case 2:b=this.intParameterRange(1,0,19);if(2147483647==b)return;break;case 3:a=J.atomdata.RadiusData.EnumType.ABSOLUTE;
if(Float.isNaN(b=this.floatParameterRange(1,0,3)))return;break;default:this.error(6)}break;case 3:switch(this.tokAt(1)){case 1073742138:Float.isNaN(b=this.floatParameterRange(2,-100,100))||this.setFloatProperty("vectorScale",b);return;case 64:a=this.floatParameter(2);this.chk||this.vwr.ms.scaleVectorsToMax(a);return}}this.setShapeSize(18,new J.atomdata.RadiusData(null,b,a,null))});e(c$,"cmdVibration",function(){this.checkLength(-3);var a=0;switch(this.getToken(1).tok){case 1048589:this.checkLength(2);
a=this.vwr.getFloat(570425412);break;case 1048588:this.checkLength(2);a=0;break;case 2:case 3:this.checkLength(2);a=this.floatParameter(1);break;case 1073742138:Float.isNaN(a=this.floatParameterRange(2,-100,100))||this.setFloatProperty("vibrationScale",a);return;case 64:var b=this.floatParameter(2);this.chk||this.vwr.ms.scaleVectorsToMax(b);break;case 1073742090:this.setFloatProperty("vibrationPeriod",this.floatParameter(2));return;case 1073741824:this.invArg();break;default:a=-1}0>a&&this.invArg();
this.chk||(0==a?this.vwr.tm.setVibrationPeriod(0):this.vwr.setVibrationPeriod(-a))});e(c$,"cmdWireframe",function(){var a=-2147483648;4141==this.tokAt(1)?this.checkLast(1):a=this.getMadParameter();this.chk||2147483647==a||(this.setShapeProperty(1,"type",Integer.$valueOf(1023)),this.setShapeSizeBs(1,-2147483648==a?300:a,null))});e(c$,"cmdZap",function(a){if(1==this.slen||!a)(a=a&&!this.$isStateScript)&&this.vwr.cacheFileByName(null,!1),this.vwr.zap(!0,a,!0),this.refresh(!1);else if(a=this.atomExpressionAt(1),
!this.chk)if(0>a.nextSetBit(0)&&4==this.slen&&1048611==this.tokAt(2))a=this.vwr.ms.getModelNumberIndex(this.getToken(2).intValue,!1,!0),0<=a&&this.vwr.deleteModels(a,null);else{a=this.vwr.deleteAtoms(a,!0);var b=!this.doReport();b||this.report(J.i18n.GT.i(J.i18n.GT._("{0} atoms deleted"),a));this.vwr.select(null,!1,0,b)}},"~B");e(c$,"cmdZoom",function(a){if(!a){var b=1<this.slen?this.getToken(1).tok:1048589;switch(b){case 1048589:case 1048588:2<this.slen&&this.bad();this.chk||this.setBooleanProperty("zoomEnabled",
1048589==b);return}}var c=null,d=1,b=a?this.isFloatParameter(d)?this.floatParameter(d++):1:0;0>b&&(d--,b=0);var f=0,e=null;this.isCenterParameter(d)?(f=d,c=this.centerParameter(d),q(this.expressionResult,JU.BS)&&(e=this.expressionResult),d=this.iToken+1):2==this.tokAt(d)&&0==this.getToken(d).intValue&&(e=this.vwr.getAtomBitSet("visible"),c=this.vwr.ms.getAtomSetCenter(e));var k=this.vwr.tm.getZoomSetting(),e=this.getZoom(f,d,e,k),d=this.iToken+1,h=k=NaN;d!=this.slen&&(k=this.floatParameter(d++),h=
this.floatParameter(d++));d!=this.slen&&this.invArg();0>e&&(e=-e,a&&(1==this.slen?e*=2:null==c&&(e/=2)));(5>e||2E5<e)&&this.numberOutOfRange(5,2E5);this.vwr.tm.isWindowCentered()||(null!=c&&(a=this.atomExpressionAt(f),this.chk||this.vwr.setCenterBitSet(a,!1)),c=this.vwr.tm.fixedRotationCenter,Float.isNaN(k)&&(k=this.vwr.tm.getTranslationXPercent()),Float.isNaN(h)&&(h=this.vwr.tm.getTranslationYPercent()));if(!this.chk&&(this.vwr.moveTo(this,b,c,JV.JC.center,NaN,null,e,k,h,NaN,null,NaN,NaN,NaN,NaN,
NaN,NaN),this.isJS&&0<b&&this.vwr.g.waitForMoveTo))throw new JS.ScriptInterruption(this,"zoomTo",1);},"~B");e(c$,"colorShape",function(a,b,c){var d=null,f=null,e=null,k=null,h=2==b&&1073741860==this.tokAt(1)?"ball":"",n=!1,l=24==a||25==a,j=0,m=!1,p=3.4028235E38;0>b&&(k=this.atomExpressionAt(-b),b=this.iToken+1,this.isBondSet&&(m=!0,a=1));var r=this.getToken(b).tok;c?this.getToken(b):!0==(c=1610616835==r)&&this.getToken(++b);if(c)h="bg";else if(l)switch(this.theTok){case 1073742018:this.getToken(++b);
h="mesh";break;case 1073742094:c=this.getArgbParamOrNone(++b,!1);e=0==c?null:Integer.$valueOf(c);this.getToken(b=this.iToken+1);break;case 10:case 1048577:q(this.theToken.value,JM.BondSet)?(k=this.theToken.value,h="vertex"):(k=this.atomExpressionAt(b),h="atom"),this.getToken(b=this.iToken+1)}if(this.chk||!((27==a||28==a)&&null!=this.getIsoExt().dispatch(a,!0,this.st))){if((c=603979967==this.theTok)||1073742074==this.theTok)1.4E-45==p&&this.invArg(),d=this.paramAsStr(b++),c&&this.isFloatParameter(b)&&
(p=this.getTranslucentLevel(b++));r=0;if(b<this.slen&&1048589!=this.tokAt(b)&&1048588!=this.tokAt(b))if(n=!0,r=this.getToken(b).tok,(!l||1074790746!=this.tokAt(b+1))&&this.isColorParam(b)){if(c=this.getArgbParamOrNone(b,!1),f=0==c?null:Integer.$valueOf(c),null==d&&0!=this.tokAt(b=this.iToken+1))this.getToken(b),(c=603979967==this.theTok)||1073742074==this.theTok?(d=this.paramAsStr(b),c&&this.isFloatParameter(b+1)&&(p=this.getTranslucentLevel(++b))):this.isColorParam(b)&&(c=this.getArgbParamOrNone(b,
!1),e=0==c?null:Integer.$valueOf(c))}else if(26==a)this.iToken--;else{var j=this.paramAsStr(b).toLowerCase(),s=0==j.indexOf("byelement"),y=s||0==j.indexOf("byresidue"),f=y||l?J.c.PAL.PROPERTY:1113200651==r?J.c.PAL.CPK:J.c.PAL.getPalette(j);(f===J.c.PAL.UNKNOWN||(f===J.c.PAL.TYPE||f===J.c.PAL.ENERGY)&&2!=a)&&this.invArg();var v=null,A=f!==J.c.PAL.PROPERTY&&f!==J.c.PAL.VARIABLE||!this.vwr.g.rangeSelected?null:this.vwr.bsA();f===J.c.PAL.PROPERTY?y?this.chk||(v=this.getBitsetPropertyFloat(A,(s?1095763978:
1095761932)|256,NaN,NaN)):(s=j.equals("property"))&&JS.T.tokAttr(r=this.getToken(++b).tok,1078984704)&&!JS.T.tokAttr(r,1087373312)?(this.chk||(v=this.getBitsetPropertyFloat(A,this.getToken(b).tok|256,NaN,NaN)),b++):!s&&!l&&b++:f===J.c.PAL.VARIABLE&&(b++,j=this.paramAsStr(b++),v=N(this.vwr.ms.ac,0),JU.Parser.parseStringInfestedFloatArray(""+this.getParameter(j,4,!0),null,v),f=J.c.PAL.PROPERTY);if(f===J.c.PAL.PROPERTY){var x=null;4==this.tokAt(b)?(x=this.paramAsStr(b++).toLowerCase(),this.isArrayParameter(b)&&
(x+="="+JS.SV.sValue(JS.SV.getVariableAS(this.stringParameterSet(b))).$replace("\n"," "),b=this.iToken+1)):l&&this.isColorParam(b)&&(x=this.getColorRange(b),b=this.iToken+1);null!=x&&!l&&(this.setStringProperty("propertyColorScheme",(c&&3.4028235E38==p?"translucent ":"")+x),y=0==x.indexOf("byelement")||0==x.indexOf("byresidue"));var s=0,t=3.4028235E38;if(!y&&(1073741826==this.tokAt(b)||1073742114==this.tokAt(b)))s=this.floatParameter(b+1),t=this.floatParameter(b+2),b+=3,s==t&&l?(y=this.getShapeProperty(a,
"dataRange"),null!=y&&(s=y[0],t=y[1])):s==t&&(t=3.4028235E38);l||(null==v?this.chk||this.vwr.setCurrentColorRange(j):this.chk||this.vwr.cm.setPropertyColorRangeData(v,A));if(l){this.checkLength(b);if(this.chk)return;n=!1;j=this.vwr.cm.getColorEncoder(x);if(null==j)return;j.isTranslucent=c&&3.4028235E38==p;j.setRange(s,t,s>t);3.4028235E38==t&&(j.hi=t);this.setShapeProperty(a,"remapColor",j);this.showString(this.getShapeProperty(24,"dataRangeStr").$replace("\n"," "));if(3.4028235E38==p)return}else 3.4028235E38!=
t&&this.vwr.cm.setPropertyColorRange(s,t)}else b++;this.checkLength(b)}if(!(this.chk||0>a)){switch(a){case 4:j=32768;break;case 2:j=30720;break;case 3:j=256;break;case 1:j=1023;break;default:j=0}0==j?(this.sm.loadShape(a),5==a&&this.setShapeProperty(5,"setDefaults",this.vwr.slm.noneSelected)):(null!=k&&(this.vwr.selectBonds(k),k=null),a=1,this.setShapeProperty(a,"type",Integer.$valueOf(j)));if(n){switch(r){case 1112539151:case 1112539150:this.vwr.autoCalculate(r);break;case 1112541196:this.vwr.g.rangeSelected&&
this.vwr.ms.clearBfactorRange();break;case 1087373318:this.vwr.ms.calcSelectedGroupsCount();break;case 1095761937:case 1073742029:this.vwr.ms.calcSelectedMonomersCount();break;case 1095761936:this.vwr.ms.calcSelectedMoleculesCount()}null!=e&&(l||11==a||14==a)?this.setShapeProperty(a,"colorPhase",[e,f]):null==k?this.setShapeProperty(a,h+"color",f):this.setShapePropertyBs(a,h+"color",f,k)}null!=d&&this.setShapeTranslucency(a,h,d,p,k);0!=j&&this.setShapeProperty(1,"type",Integer.$valueOf(1023));m&&this.vwr.selectBonds(null);
0==a&&this.vwr.shm.checkInheritedShapes()}}},"~N,~N,~B");e(c$,"encodeRadiusParameter",function(a,b,c){var d=NaN,f=J.atomdata.RadiusData.EnumType.ABSOLUTE,e=null,k=-1==a?1649412120:this.getToken(a).tok;switch(k){case 1112539137:case 1112539138:case 1112541194:case 1114638362:case 1112541196:case 1649412120:d=1,f=J.atomdata.RadiusData.EnumType.FACTOR,e=1649412120==k?null:J.c.VDW.getVdwType2(JS.T.nameOf(k)),k=this.tokAt(++a)}switch(k){case 4141:return this.vwr.rd;case 1073741852:case 1073742116:case 1073741856:case 1073741858:case 1073741991:d=
1;f=J.atomdata.RadiusData.EnumType.FACTOR;this.iToken=a-1;break;case 269484193:case 2:case 3:if(269484193==k)a++;else if(269484210==this.tokAt(a+1)){d=Math.round(this.floatParameter(a));this.iToken=++a;f=J.atomdata.RadiusData.EnumType.FACTOR;if(0>d||200<d)return this.integerOutOfRange(0,200),null;d/=100;break}else if(2==k){d=this.intParameter(a);if(749<d||-200>d)return this.integerOutOfRange(-200,749),null;0<d?(d/=250,f=J.atomdata.RadiusData.EnumType.ABSOLUTE):(d/=-100,f=J.atomdata.RadiusData.EnumType.FACTOR);
break}269484193==k||!c?(f=J.atomdata.RadiusData.EnumType.OFFSET,d=16):(f=J.atomdata.RadiusData.EnumType.ABSOLUTE,e=J.c.VDW.NADA,d=100);d=this.floatParameterRange(a,b||!c?-d:0,d);if(Float.isNaN(d))return null;b&&(d=-d);16<d&&(d=16.1);break;default:1==d&&a--}null==e&&(e=J.c.VDW.getVdwType(this.optParameterAsString(++this.iToken)),null==e&&(this.iToken=a,e=J.c.VDW.AUTO));return new J.atomdata.RadiusData(null,d,f,e)},"~N,~B,~B");e(c$,"expandFloatArray",function(a,b){var c=a.length,d=!1;try{for(var f=
0;f<a.length;f++)0>a[f]&&(c+=Math.abs(a[f-1]+a[f])-1,d=!0);if(d){for(var e=N(c,0),f=d=0;f<a.length;f++)if(c=B(a[f]),0<=c)c<b&&this.invArg(),e[d++]=c;else for(var k=0>B(a[f-1]+c)?1:-1,h=B(a[f-1]);h!=-a[f];h+=k,d++)e[d]=e[d-1]+k;a=e;c=a.length}for(var n=O(c,0),f=c;0<=--f;)n[f]=B(a[f]);return n}catch(l){if(y(l,Exception))return this.invArg(),null;throw l;}},"~A,~N");e(c$,"frameControl",function(a){switch(this.getToken(this.checkLast(a)).tok){case 1073742098:case 1073742096:case 4143:case 20487:case 1073742037:case 1073742108:case 1073742125:case 1073741942:case 1073741993:this.chk||
this.vwr.setAnimation(this.theTok);return}this.invArg()},"~N");e(c$,"getColorRange",function(a){a=this.getArgbParam(a);1074790746!=this.tokAt(++this.iToken)&&this.invArg();var b=this.getArgbParam(++this.iToken),c=2==this.tokAt(this.iToken+1)?this.intParameter(++this.iToken):0;return JU.ColorEncoder.getColorSchemeList(JU.ColorEncoder.getPaletteAtoB(a,b,c))},"~N");e(c$,"getForVar",function(a){var b=this.getContextVariableAsVariable(a);null==b&&(a.startsWith("_")&&this.invArg(),0<=a.indexOf("/")?this.contextVariables.put(a.toLowerCase(),
b=JS.SV.newI(0)):b=this.vwr.g.getOrSetNewVariable(a,!0));return b},"~S");e(c$,"getFullPathName",function(){var a=!this.chk||this.isCmdLine_C_Option?this.vwr.fm.getFullPathName(!0):"test.xyz";null==a&&this.invArg();return a});e(c$,"getObjectBoundingBox",function(a){a=[a,null,null];return this.getShapePropertyData(24,"getBoundingBox",a)||this.getShapePropertyData(29,"getBoundingBox",a)||this.getShapePropertyData(25,"getBoundingBox",a)||this.getShapePropertyData(28,"getBoundingBox",a)||this.getShapePropertyData(27,
"getBoundingBox",a)?a[2]:null},"~S");p(c$,"getObjectCenter",function(a,b,c){a=[a,Integer.$valueOf(b),Integer.$valueOf(c)];return this.getShapePropertyData(22,"getCenter",a)||this.getShapePropertyData(24,"getCenter",a)||this.getShapePropertyData(29,"getCenter",a)||this.getShapePropertyData(25,"getCenter",a)||this.getShapePropertyData(28,"getCenter",a)||this.getShapePropertyData(27,"getCenter",a)?a[2]:null},"~S,~N,~N");p(c$,"getPlaneForObject",function(a,b){switch(this.sm.getShapeIdFromObjectName(a)){case 22:this.setShapeProperty(22,
"thisID",a);var c=this.getShapeProperty(22,"vertices");if(null==c||3>c.length||null==c[0]||null==c[1]||null==c[2])break;return JU.Measure.getPlaneThroughPoints(c[0],c[1],c[2],new JU.V3,b,new JU.P4);case 24:return this.setShapeProperty(24,"thisID",a),this.getShapeProperty(24,"plane")}return null},"~S,JU.V3");e(c$,"getQuaternionArray",function(a,b){var c;switch(b){case 135270418:c=a;break;case 9:c=Array(a.length);for(var d=0;d<a.length;d++)c[d]=JU.Quat.newP4(a[d]);break;case 1073742001:c=Array(a.size());
for(d=0;d<a.size();d++){var f=JS.SV.pt4Value(a.get(d));if(null==f)return null;c[d]=JU.Quat.newP4(f)}break;default:return null}return c},"~O,~N");e(c$,"getSetAxesTypeMad",function(a){if(a==this.slen)return 1;switch(this.getToken(this.checkLast(a)).tok){case 1048589:return 1;case 1048588:return 0;case 1073741926:return-1;case 2:return this.intParameterRange(a,-1,19);case 3:return a=this.floatParameterRange(a,0,2),Float.isNaN(a)?2147483647:I(Math.floor(2E3*a))}this.errorStr(7,'"DOTTED"');return 0},"~N");
e(c$,"getSettingFloat",function(a){return a>=this.slen?NaN:JS.SV.fValue(this.parameterExpressionToken(a))},"~N");e(c$,"getSettingInt",function(a){return a>=this.slen?-2147483648:this.parameterExpressionToken(a).asInt()},"~N");e(c$,"getSettingStr",function(a,b){return b&&this.slen==a+1?this.paramAsStr(a):this.parameterExpressionToken(a).asString()},"~N,~B");e(c$,"getShapeProperty",function(a,b){return this.sm.getShapePropertyIndex(a,b,-2147483648)},"~N,~S");e(c$,"getShapePropertyData",function(a,b,
c){return this.sm.getShapePropertyData(a,b,c)},"~N,~S,~A");e(c$,"getShapeType",function(a){a=JV.JC.shapeTokenIndex(a);0>a&&this.error(49);return a},"~N");e(c$,"getTranslucentLevel",function(a){a=this.floatParameter(a);return 2==this.theTok&&0<a&&9>a?a+1:a},"~N");e(c$,"getZoom",function(a,b,c,d){var f=this.isFloatParameter(b)?this.floatParameter(b++):NaN;if(0==f||0==d)d=NaN,null==c?1048582==this.tokAt(a)&&(f=this.getObjectBoundingBox(this.objectNameParameter(a+1)),(null==f||0==(d=f[0].distance(f[1])/
2))&&this.invArg()):d=this.vwr.ms.calcRotationRadiusBs(c),Float.isNaN(d)&&this.invArg(),d=100*(this.vwr.getFloat(570425388)/d),f=NaN;if(0>f)f+=d;else if(Float.isNaN(f))switch(a=this.tokAt(b),a){case 1073742079:case 1276116993:f=d*(1073742079==a?0.5:2);b++;break;case 269484208:case 269484209:case 269484193:c=this.floatParameter(++b);b++;switch(a){case 269484208:f=d/c;break;case 269484209:f=d*c;break;case 269484193:f=d+c}break;default:f=null==c?-d:d}this.iToken=b-1;return f},"~N,~N,JU.BS,~N");e(c$,
"setElementColor",function(a,b){for(var c=JU.Elements.elementNumberMax;0<=--c;)if(a.equalsIgnoreCase(JU.Elements.elementNameFromNumber(c)))return this.chk||this.vwr.setElementArgb(c,b),!0;for(c=JU.Elements.altElementMax;0<=--c;)if(a.equalsIgnoreCase(JU.Elements.altElementNameFromIndex(c)))return this.chk||this.vwr.setElementArgb(JU.Elements.altElementNumberFromIndex(c),b),!0;if("_"!=a.charAt(0))return!1;for(c=JU.Elements.elementNumberMax;0<=--c;)if(a.equalsIgnoreCase("_"+JU.Elements.elementSymbolFromNumber(c)))return this.chk||
this.vwr.setElementArgb(c,b),!0;for(c=JU.Elements.altElementMax;4<=--c;)if(a.equalsIgnoreCase("_"+JU.Elements.altElementSymbolFromIndex(c))||a.equalsIgnoreCase("_"+JU.Elements.altIsotopeSymbolFromIndex(c)))return this.chk||this.vwr.setElementArgb(JU.Elements.altElementNumberFromIndex(c),b),!0;return!1},"~S,~N");e(c$,"setMeshDisplayProperty",function(a,b,c){var d=null,f=null,e=25==a,k=0==b;k||(c=this.getToken(b).tok);switch(c){case 1766856708:if(e)this.iToken++;else break;case 1073742074:case 603979967:return k||
this.colorShape(a,this.iToken,!1),!0;case 0:case 12291:case 1048589:case 1048588:case 12294:case 3145770:case 1610625028:case 3145768:1==this.iToken&&(0<=a&&0==this.tokAt(2))&&this.setShapeProperty(a,"thisID",null);if(0==c)return 1==this.iToken;if(k)return!0;switch(c){case 12291:return this.setShapeProperty(a,"delete",null),!0;case 3145770:case 12294:c=1048588;break;case 3145768:c=1048589;break;case 1610625028:b+1==this.slen&&(c=1048589);break}case 1073741958:case 1073741862:case 1073741964:case 1073741898:case 1073742039:case 1113198595:case 1073742042:case 1073742018:case 1073742052:case 1073741938:case 1073742046:case 1073742182:case 1073742060:case 1073741960:case 1073742058:d=
"token",f=Integer.$valueOf(c)}if(null==d)return!1;if(k)return!0;this.setShapeProperty(a,d,f);0!=this.tokAt(this.iToken+1)&&(this.setMeshDisplayProperty(a,++this.iToken,0)||--this.iToken);return!0},"~N,~N,~N");e(c$,"setObjectArgb",function(a,b){this.chk||this.vwr.setObjectArgb(a,b)},"~S,~N");e(c$,"setObjectMad",function(a,b,c){this.chk||this.vwr.setObjectMad(a,b,c)},"~N,~S,~N");e(c$,"setObjectProp",function(a,b,c){for(var d=[a,null],f="",e=JU.PT.isWild(a),k=17;;){if(this.getShapePropertyData(k,"checkID",
d)){this.setShapeProperty(k,"thisID",a);switch(b){case 12291:this.setShapeProperty(k,"delete",null);break;case 12294:case 1610625028:this.setShapeProperty(k,"hidden",1610625028==b?Boolean.FALSE:Boolean.TRUE);break;case 135270926:f+=this.getShapeProperty(k,"command")+"\n";break;case 1766856708:0<=c&&this.colorShape(k,c+1,!1)}if(!e)break}switch(k){case 17:k=20;continue;case 20:k=32}switch(--k){case 27:k--;break;case 28:k-=2}if(22>k)break}return f},"~S,~N,~N");e(c$,"setObjectProperty",function(){var a=
this.setShapeNameParameter(2);return this.chk?"":this.setObjectProp(a,this.tokAt(0),this.iToken)});e(c$,"setShapeNameParameter",function(a){var b=this.paramAsStr(a),c=b.equals("*");0==b.length&&this.invArg();if(c)switch(this.tokAt(a+1)){case 0:case 1048589:case 1048588:case 3145768:case 3145770:case 1766856708:case 12291:break;default:if(this.setMeshDisplayProperty(-1,0,this.tokAt(a+1)))break;b+=this.optParameterAsString(++a)}269484209==this.tokAt(a+1)&&(b+=this.paramAsStr(++a));this.iToken=a;return b},
"~N");e(c$,"setShapeProperty",function(a,b,c){this.chk||this.sm.setShapePropertyBs(a,b,c,null)},"~N,~S,~O");e(c$,"setShapePropertyBs",function(a,b,c,d){this.chk||this.sm.setShapePropertyBs(a,b,c,d)},"~N,~S,~O,JU.BS");e(c$,"setShapeSize",function(a,b){this.chk||this.sm.setShapeSizeBs(a,0,b,null)},"~N,J.atomdata.RadiusData");e(c$,"setShapeSizeBs",function(a,b,c){this.chk||this.sm.setShapeSizeBs(a,b,null,c)},"~N,~N,JU.BS");e(c$,"setShapeTranslucency",function(a,b,c,d,f){3.4028235E38==d&&(d=this.vwr.getFloat(570425354));
this.setShapeProperty(a,"translucentLevel",Float.$valueOf(d));null!=b&&(null==f?this.setShapeProperty(a,b+"translucency",c):this.chk||this.setShapePropertyBs(a,b+"translucency",c,f))},"~N,~S,~S,~N,JU.BS");e(c$,"setSize",function(a,b){var c=null,d=!1;switch(this.tokAt(1)){case 1073742072:this.restrictSelected(!1,!1);break;case 1048589:break;case 1048588:b=0;break;case 3:d=0>this.floatParameter(1);default:c=this.encodeRadiusParameter(1,d,!0);if(null==c)return;Float.isNaN(c.value)&&this.invArg()}null==
c&&(c=new J.atomdata.RadiusData(null,b,J.atomdata.RadiusData.EnumType.FACTOR,J.c.VDW.AUTO));d&&this.restrictSelected(!1,!1);this.setShapeSize(a,c)},"~N,~N");e(c$,"setSizeBio",function(a){var b=0;switch(this.getToken(1).tok){case 1073742072:if(this.chk)return;this.restrictSelected(!1,!1);b=-1;break;case 1048589:b=-1;break;case 1048588:break;case 1641025539:b=-2;break;case 1112541196:case 1073741922:b=-4;break;case 2:if(2147483647==(b=8*this.intParameterRange(1,0,1E3)))return;break;case 3:b=Math.round(2E3*
this.floatParameterRange(1,-4,4));if(2147483647==b)return;0>b&&(this.restrictSelected(!1,!1),b=-b);break;case 10:this.chk||this.sm.loadShape(a);this.setShapeProperty(a,"bitset",this.theToken.value);return;default:this.error(6)}this.setShapeSizeBs(a,b,null)},"~N");e(c$,"setUnits",function(a,b){545259568==b&&(a.endsWith("hz")||JU.PT.isOneOf(a.toLowerCase(),";angstroms;au;bohr;nanometers;nm;picometers;pm;vanderwaals;vdw;"))?this.chk||this.vwr.setUnits(a,!0):545259559==b&&JU.PT.isOneOf(a.toLowerCase(),
";kcal;kj;")?this.chk||this.vwr.setUnits(a,!1):this.errorStr2(50,"set "+JS.T.nameOf(b),a);return!0},"~S,~N");e(c$,"toString",function(){var a=new JU.SB;a.append("Eval\n pc:");a.appendI(this.pc);a.append("\n");a.appendI(this.aatoken.length);a.append(" statements\n");for(var b=0;b<this.aatoken.length;++b){a.append("----\n");for(var c=this.aatoken[b],d=0;d<c.length;++d)a.appendO(c[d]),a.appendC("\n");a.appendC("\n")}a.append("END\n");return a.toString()});p(c$,"setAtomProp",function(a,b,c){this.setShapePropertyBs(0,
a,b,c)},"~S,~O,JU.BS");M(c$,"scriptLevelMax",100,"saveList","bonds? context? coordinates? orientation? rotation? selection? state? structure?","iProcess",0)});C("JS");E(["JS.ScriptParam"],"JS.ScriptExpr","java.lang.Boolean $.Float java.util.Hashtable $.Map JU.BArray $.BS $.CU $.Lst $.M34 $.M4 $.Measure $.P3 $.P4 $.PT $.SB J.api.Interface JM.BondSet $.Group $.ModelSet JS.SV $.ScriptContext $.ScriptMathProcessor $.T JU.BSUtil $.Elements $.Escape $.Logger".split(" "),function(){c$=H(function(){this.debugHigh=
!1;this.ptTemp=this.tempStatement=this.cmdExt=null;D(this,arguments)},JS,"ScriptExpr",JS.ScriptParam);e(c$,"getCmdExt",function(){return null==this.cmdExt?(this.cmdExt=this.getExt("Cmd")).init(this):this.cmdExt});e(c$,"getExt",function(a){return J.api.Interface.getInterface("JS."+a+"Ext",this.vwr,"script")},"~S");p(c$,"parameterExpressionList",function(a,b,c){return this.parameterExpression(a,-1,null,!0,!0,b,c,null,null,!1)},"~N,~N,~B");e(c$,"parameterExpressionString",function(a,b){return this.parameterExpression(a,
b,"",!0,!1,-1,!1,null,null,!1)},"~N,~N");e(c$,"parameterExpressionBoolean",function(a,b){return this.parameterExpression(a,b,null,!0,!1,-1,!1,null,null,!1).booleanValue()},"~N,~N");e(c$,"parameterExpressionToken",function(a){a=this.parameterExpressionList(a,-1,!1);return 0<a.size()?a.get(0):JS.SV.newS("")},"~N");e(c$,"parameterExpressionSelect",function(a,b){this.st=b;this.slen=this.st.length;return this.parameterExpression(2,-2147483648,null,!0,!1,-1,!1,a,null,!1).booleanValue()},"java.util.Map,~A");
e(c$,"parameterExpression",function(a,b,c,d,f,e,k,h,n,l){var j=null!=n,m=0>a,p=!f&&null==c,r=!f&&null!=c&&0==c.length;m&&(a=-a);var s=null==h||-2147483648!=b;b<a&&(b=this.slen);var C=l?0:1;c=new JS.ScriptMathProcessor(this,l,k,f,!1,!1,c);var v,A;k=f=0;var x=!0,t=a;a:for(;t<b;t++){v=null;var w=this.getToken(t).tok;if(j&&1048583!=this.tokAt(t+1)){var z=null!=h&&h.containsKey(this.theToken.value)?null:this.getBitsetPropertySelector(t,!1,!1);if(null!=z){c.addX(h.get(n));c.addOpAllowMath(z,269484048==
this.tokAt(t+1))||this.invArg();if((135368713==z.intValue||102436==z.intValue)&&269484048!=this.tokAt(this.iToken+1))c.addOp(JS.T.tokenLeftParen),c.addOp(JS.T.tokenRightParen);t=this.iToken;continue}}switch(w){case 269484097:case 1048590:if(!d&&x)break a;1048590==w&&this.invArg();l&&(1==f&&269484436==this.tokAt(t+1))&&(l=c.endAssignment())}switch(w){case 1060866:if(1048577==this.tokAt(++t))v=this.parameterExpressionToken(++t),t=this.iToken;else if(2==this.tokAt(t)){v=this.vwr.ms.getAtoms(1095763969,
Integer.$valueOf(this.st[t].intValue));break}else v=this.getParameter(JS.SV.sValue(this.st[t]),1073742190,!0);v=this.getParameter(v.asString(),1073742190,!0);break;case 135369225:269484048!=this.getToken(++t).tok&&this.invArg();null==h&&(h=new java.util.Hashtable);A=this.parameterExpression(++t,-1,null,d,!1,-1,!1,h,n,!1);z=A.booleanValue();w=this.iToken;1048591!=this.getToken(w++).tok&&this.invArg();this.parameterExpressionBoolean(w,-1);var B=this.iToken;1048591!=this.tokAt(B++)&&this.invArg();this.parameterExpression(-B,
-1,null,d,!1,1,!1,h,n,!1);t=this.iToken;269484049!=this.tokAt(t)&&this.invArg();v=this.parameterExpression(z?w:B,z?B:t,"XXX",d,!1,1,!1,h,n,!1);t=this.iToken=t;break;case 135369224:case 135280132:w=(z=0<a)&&135369224==w;z?((269484048!=this.getToken(++t).tok||!JS.T.tokAttr(this.getToken(++t).tok,1073741824))&&this.invArg(),B=this.paramAsStr(t),1048591!=this.getToken(++t).tok&&this.invArg()):B="_x";v=this.parameterExpressionToken(-++t).value;q(v,JU.BS)||this.invArg();t=this.iToken;z&&1048591!=this.getToken(t++).tok&&
this.invArg();var u=new JU.BS,E=new JU.BS,D=w?Array(JU.BSUtil.cardinalityOf(v)):null;null==h&&(h=new java.util.Hashtable);E.set(0);var H=JS.SV.newV(10,E);H.index=0;h.put(B,H.setName(B));var R=-1;if(z){R=t-1;A=0;for(var F;0<=A&&++R<b;)269484049==(F=this.tokAt(R))?A--:269484048==F&&A++}var I=0,G=0,L=v.nextSetBit(0);if(0>L)this.iToken=R-1;else if(!this.chk)for(;0<=L;L=v.nextSetBit(L+1))0<=G&&E.clear(G),G=L,E.set(L),H.index=L,A=this.parameterExpression(t,R,w?"XXX":null,d,w,L,!1,h,z?null:B,!1),w?((null==
A||0==A.size())&&this.invArg(),D[I++]=A.get(0).asString()):A.booleanValue()&&u.set(L);if(w)v=D;else if(z)v=u;else return this.listBS(u);t=this.iToken+1;break;case 1048591:break a;case 2:case 3:case 1048614:c.addXNum(this.theToken);break;case 135266319:if(269484048==this.tokAt(this.iToken+1)){c.addOpAllowMath(this.theToken,!0)||this.invArg();break}case 1087375362:case 1087375361:case 1048580:case 1679429641:case 1087373316:case 1048581:case 1087375365:case 1087373318:case 1095766030:case 1095761936:case 1087373320:case 1095761941:case 135267335:case 135267336:case 1238369286:case 1641025539:case 1073741916:case 1073742128:case 1048589:case 1048588:case 4:case 8:case 9:case 11:case 12:case 7:case 10:case 6:case 14:c.addX(JS.SV.newT(this.theToken));
break;case 1048582:this.ignoreError=!0;var M;try{M=this.centerParameter(t),c.addX(JS.SV.newV(8,M))}catch(N){if(y(N,Exception))c.addXStr("");else throw N;}this.ignoreError=!1;t=this.iToken;break;case 1048586:if(4==this.tokAt(t+1)){if(1048590==this.tokAt(t+2)){v=this.chk?new JU.BS:this.getAtomBitSet(this.stringParameter(t+1));t+=2;break}v=this.getAssocArray(t)}else v=this.getPointOrPlane(t,!1,!0,!0,!1,3,4);t=this.iToken;break;case 1048577:if(1048578==this.tokAt(t+1)){v=new java.util.Hashtable;t++;break}else 1048579==
this.tokAt(t+1)&&1048578==this.tokAt(t+2)&&(w=1048579,this.iToken+=2);case 1048579:v=1048579==w?this.vwr.getAllAtoms():this.atomExpression(this.st,t,0,!0,!0,!0,!0);t=this.iToken;if(0==k&&m)return this.iToken++,this.listBS(v);break;case 1073742195:c.addOp(this.theToken);continue;case 1048578:break a;case 269484080:if(!d&&x)break a;c.addOp(this.theToken)||this.invArg();break;case 1048584:case 1048583:l&&(x&&269484436==this.tokAt(t+2))&&(l=c.endAssignment());if(0==C&&x)switch(this.tokAt(t+1)){case 0:break;
case 1141899270:case 1141899282:case 1141899272:if(1048583==w)break;default:c.addOp(JS.T.o(269484096,"["));c.addXStr(this.optParameterAsString(++t));c.addOp(JS.T.o(269484097,"]"));continue}z=this.getBitsetPropertySelector(t+1,!1,!1);null==z&&this.invArg();t=135368713==z.intValue;w=!0;F=this.tokAt(this.iToken+2);if(1048583==this.tokAt(this.iToken+1))switch(F){case 1048579:F=480,1048583==this.tokAt(this.iToken+3)&&1276118529==this.tokAt(this.iToken+4)&&(F=224);case 32:case 64:case 192:case 128:case 160:case 96:w=
t||1276118018==z.intValue||480==F||224==F,z.intValue|=F,this.getToken(this.iToken+2)}w=(new Boolean(w&(269484048==this.tokAt(this.iToken+1)||t))).valueOf();c.addOpAllowMath(z,w)||this.invArg();t=this.iToken;135368713==z.intValue&&269484048!=this.tokAt(t+1)&&(c.addOp(JS.T.tokenLeftParen),c.addOp(JS.T.tokenRightParen));break;default:if(269484096==this.theTok&&269484066==this.tokAt(t+2)){v=this.getAssocArray(t);t=this.iToken;break}if(JS.T.tokAttr(this.theTok,269484032)||JS.T.tokAttr(this.theTok,135266304)&&
269484048==this.tokAt(this.iToken+1)){if(!c.addOp(this.theToken)){if(0<=e)break a;this.invArg()}switch(this.theTok){case 269484436:x&&(C=t);break;case 269484048:k++;x=!1;break;case 269484049:if(0>=--k&&0==f){if(m){this.iToken++;break a}x=!0}break;case 269484096:f++;x=!1;break;case 269484097:if(0==--f&&0==k){if(m){this.iToken++;break a}x=!0}}}else{z=this.paramAsStr(t).toLowerCase();w=269484048==this.tokAt(t+1);if(this.chk)v=z;else if(!w&&(null==h||null==(v=JU.PT.getMapValueNoCase(h,z))&&s))v=this.getContextVariableAsVariable(z);
if(null==v)if(JS.T.tokAttr(this.theTok,1073741824)&&this.vwr.isFunction(z))c.addOp(JS.SV.newV(135368713,this.theToken.value))||this.invArg(),w||(c.addOp(JS.T.tokenLeftParen),c.addOp(JS.T.tokenRightParen));else{z=this.vwr.g.getOrSetNewVariable(z,!1);switch(z.tok){case 2:case 3:if(this.noCopy(t,-1)||this.noCopy(t,1))break;c.addXCopy(z);continue}c.addX(z)}}}null!=v&&(q(v,JU.BS)?c.addXBs(v):c.addXObj(v))}a=c.getResult();null==a&&(this.chk||c.dumpStacks("null result"),this.error(13));if(135198==a.tok)return a.value;
if(this.chk){if(p)return Boolean.TRUE;if(r)return""}else{if(p)return Boolean.$valueOf(a.asBoolean());if(r)return 4==a.tok&&(a.intValue=2147483647),a.asString()}switch(a.tok){case 1048589:case 1048588:return Boolean.$valueOf(1==a.intValue);case 2:return Integer.$valueOf(a.intValue);default:return a.value}},"~N,~N,~S,~B,~B,~N,~B,java.util.Map,~S,~B");p(c$,"atomExpressionAt",function(a){this.checkToken(a)||(this.iToken=a,this.bad());return this.atomExpression(this.st,a,0,!0,!1,!0,!0)},"~N");p(c$,"atomExpression",
function(a,b,c,d,f,e){this.isBondSet=!1;a!==this.st&&(this.tempStatement=this.st,this.st=a);var k=new JS.ScriptMathProcessor(this,!1,!1,!1,e,f,null),h,n=!1;this.iToken=1E3;var l=0>b,j=!1,m=0,p=this.vwr.ms.ac;l&&(b=-b);l=(new Boolean(l|this.chk)).valueOf();0==c&&a.length>b&&(c=b+1);a:for(;b<c;++b){this.iToken=b;h=a[b];if(null==h)break;var r=h.value;switch(h.tok){case 1048577:c=a.length;m++;break;case 1048578:m--;if(0<m)continue;break a;case 1048586:if(this.isPoint3f(b)&&(r=this.getPoint3f(b,!0),null!=
r)){k.addXPt(r);b=this.iToken;break}break;case 1048590:0<b&&1048586==a[b-1].tok&&k.addXBs(new JU.BS);break;case 269484096:j=!0;k.addOp(h);break;case 269484097:j=!1;k.addOp(h);break;case 1060866:k.addXBs(this.getAtomBitSet(r));break;case 135267841:k.addX(JS.SV.newT(h));k.addX(JS.SV.newV(9,this.hklParameter(b+2)));b=this.iToken;break;case 135266319:k.addX(JS.SV.newT(h));k.addX(JS.SV.newV(9,this.planeParameter(b+2)));b=this.iToken;break;case 1048581:k.addX(JS.SV.newT(h));k.addXPt(this.getPoint3f(b+2,
!0));b=this.iToken;break;case 4:if(0==r.indexOf("({")){var s=JU.BS.unescape(r);if(null!=s){k.addXBs(s);break}}k.addX(JS.SV.newT(h));r.equals("hkl")&&(k.addX(JS.SV.newV(9,this.hklParameter(b+2))),b=this.iToken);break;case 135267336:case 135267335:case 1238369286:case 135266325:case 135402505:case 135266310:case 269484080:k.addOp(h);break;case 1048579:k.addXBs(this.vwr.getAllAtoms());break;case 1048587:k.addXBs(new JU.BS);break;case 1048589:case 1048588:k.addX(JS.SV.newT(h));break;case 1114638363:k.addXBs(JU.BSUtil.copy(this.vwr.bsA()));
break;case 3145770:k.addXBs(JU.BSUtil.copy(this.vwr.slm.getHiddenSet()));break;case 1060869:k.addXBs(JU.BSUtil.copy(this.vwr.getMotionFixedAtoms()));break;case 3145768:k.addXBs(JU.BSUtil.copyInvert(this.vwr.slm.getHiddenSet(),p));break;case 3145776:k.addXBs(this.vwr.getBaseModelBitSet());break;case 3145774:k.addXBs(this.chk?new JU.BS:JU.BSUtil.copy(this.vwr.ms.getVisibleSet(!n)));n=!0;break;case 3145766:!this.chk&&d&&this.refresh(!1);k.addXBs(this.chk?new JU.BS:this.vwr.ms.getClickableSet(!d));d=
!1;break;case 1048608:this.vwr.ms.allowSpecAtom()?(s=h.intValue,0<s?k.addXBs(this.compareInt(1095761922,269484436,s)):k.addXBs(this.getAtomBits(h.tok,r))):k.addXBs(this.lookupIdentifierValue("_"+r));break;case 3145764:case 3145732:case 1613758470:case 1048585:case 3145742:case 3145741:case 3145744:case 3145746:case 3145748:case 3145750:case 1048612:case 1048607:case 3145772:case 1089470478:case 3145778:case 1614417948:k.addXBs(this.getAtomBits(h.tok,r));break;case 1048610:case 1048611:h=h.intValue;
if(2147483647==h&&q(r,Integer)){h=r.intValue();if(!this.vwr.haveFileSet()){k.addXBs(this.getAtomBits(1048610,Integer.$valueOf(h)));break}2147>=h&&(h*=1E6)}k.addXBs(this.bitSetForModelFileNumber(h));break;case 1048613:case 1048609:k.addXBs(this.getAtomBits(h.tok,Integer.$valueOf(h.intValue)));break;case 1048614:j?k.addXNum(h):k.addXBs(this.getAtomBits(1048614,Integer.$valueOf(JS.ScriptExpr.getSeqCode(h))));break;case 1048615:if(j){k.addXNum(h);k.addOp(JS.T.tokenMinus);k.addXNum(a[++b]);break}r=b+3<
a.length&&269484160==a[b+2].tok&&1048609==a[b+3].tok?a[b+3].intValue:-1;k.addXBs(this.getAtomBits(1048615,[JS.ScriptExpr.getSeqCode(h),JS.ScriptExpr.getSeqCode(a[++b]),r]));-1!=r&&(b+=2);break;case 1095761926:case 1095761925:k.addXBs(this.getAtomBits(h.tok,[I(Math.floor(1E3*r.x)),I(Math.floor(1E3*r.y)),I(Math.floor(1E3*r.z))]));break;case 3145758:k.addXBs(this.vwr.getModelUndeletedAtomsBitSet(this.vwr.am.cmi));break;case 1613758476:case 3145730:case 1115297793:case 1613758488:case 137363467:case 3145735:case 3145736:case 3145738:case 3145754:case 3145756:k.addXBs(this.lookupIdentifierValue(r));
break;case 269484435:case 269484434:case 269484433:case 269484432:case 269484436:case 269484437:case 269484438:s=h.tok;h=h.intValue;1095766024==h&&269484436!=s&&this.invArg();var y=null;1716520985==h&&(b+2==a.length&&this.invArg(),this.chk||(y=this.vwr.getDataFloat(a[++b].value)));++b==a.length&&this.invArg();k.addXBs(this.chk?new JU.BS:this.getComparison(a[b],h,s,r,y));break;case 3:case 2:k.addXNum(h);break;case 10:r=JU.BSUtil.copy(r);k.addXBs(r);break;case 8:k.addXPt(r);break;default:if(JS.T.tokAttr(h.tok,
269484032)){k.addOp(h)||this.invArg();break}if(!q(r,String)){k.addXObj(r);break}h=this.getParameter(r,0,!0);if(j){k.addXObj(h);break}q(h,String)&&(h=this.getStringObjectAsVariable(h,null));q(h,JU.Lst)&&(s=JS.SV.unEscapeBitSetArray(h,!0),h=null==s?"":h);q(h,String)&&(h=this.lookupIdentifierValue(r));k.addXObj(h)}}this.expressionResult=k.getResult();if(null==this.expressionResult){if(f)return null;this.chk||k.dumpStacks("after getResult");this.error(13)}this.expressionResult=this.expressionResult.value;
if(q(this.expressionResult,String)&&(e||this.expressionResult.startsWith("({")))this.expressionResult=this.chk?new JU.BS:this.getAtomBitSet(this.expressionResult);if(!e&&!q(this.expressionResult,JU.BS))return null;s=q(this.expressionResult,JU.BS)?this.expressionResult:new JU.BS;this.isBondSet=q(this.expressionResult,JM.BondSet);!this.isBondSet&&(s=this.vwr.slm.excludeAtoms(s,l)).length()>this.vwr.ms.ac&&s.clearAll();null!=this.tempStatement&&(this.st=this.tempStatement,this.tempStatement=null);return s},
"~A,~N,~N,~B,~B,~B,~B");e(c$,"getComparison",function(a,b,c,d,f){var e=a.tok;if(7==e){e=new JU.BS;269484436!=c&&e.setBits(0,this.vwr.ms.ac);a=a.getList();for(var k=a.size();0<=--k;){var h=this.getComparison(a.get(k),b,c,d,f);269484436==c?e.or(h):e.and(h)}return e}var n=a.intValue,k=NaN,h=1095766030==b,l=JS.T.tokAttr(b,1095761920),j=JS.T.tokAttr(b,1112539136)||1078984704==(b&1137704960),m=l&&j,p=!l&&JS.T.tokAttr(b,1087373312);1087375365==b&&(l=!(p=!1));var r=a.value;if(JS.T.tokAttr(e,1073741824))if("_modelNumber".equalsIgnoreCase(r))n=
this.vwr.am.cmi,r=Integer.$valueOf(n=0>n?0:this.vwr.getModelFileNumber(n));else{var s=this.getParameter(r,1073742190,!1);if(null!=s){if(7==s.tok)return this.getComparison(s,b,c,d,f);n=s.intValue;r=p?JS.SV.sValue(s):JS.SV.nValue(s)}}q(r,JU.P3)?1766856708==b&&(n=JU.CU.colorPtToFFRGB(r),e=2,l=!0):q(r,String)&&(1766856708==b?(n=JU.CU.getArgbFromString(r),0==n&&JS.T.tokAttr(e,1073741824)&&(r=this.getStringParameter(r,!0),r.startsWith("{")?(r=JU.Escape.uP(r),n=q(r,JU.P3)?JU.CU.colorPtToFFRGB(r):0):n=JU.CU.getArgbFromString(r)),
e=2,l=!0):p||(1641025539==b||1238369286==b||1087375365==b?p=!(l=2147483647!=n):r=JS.SV.nValue(a),q(r,Integer)?k=n=r.intValue():q(r,Float)&&h&&(n=JM.ModelSet.modelFileNumberFromFloat(r.floatValue()))));p&&!q(r,String)&&(r=""+r);q(r,Integer)||2==e?h?1E6<=n&&(b=-1095766030):m||j&&(k=n):q(r,Float)?h?b=-1095766030:(k=r.floatValue(),m?l=!1:l&&(n=B(k))):p||(this.iToken++,this.invArg());h&&(1E6<=n&&0==n%1E6)&&(n/=1E6,b=1229984263);if(-1095766030==b&&269484436==c)return this.bitSetForModelFileNumber(n);null!=
d&&0<=d.indexOf("-")&&(l?n=-n:Float.isNaN(k)||(k=-k));return l?this.compareInt(b,c,n):p?this.compareString(b,c,r):this.compareFloatData(b,f,c,k)},"JS.T,~N,~N,~S,~A");e(c$,"noCopy",function(a,b){switch(this.tokAt(a+b)){case 269484226:case 269484225:return-1==this.st[a+b].intValue==(-1==b);default:return!1}},"~N,~N");e(c$,"getAssocArray",function(a){var b=new java.util.Hashtable,c=1048586==this.tokAt(a)?1048590:269484097;for(a+=1;a<this.slen&&this.tokAt(a)!=c;a++){var d=this.optParameterAsString(a++);
269484066!=this.tokAt(a++)&&this.invArg();a=this.parameterExpression(a,0,null,!1,!0,-1,!1,null,null,!1);b.put(d,a.get(0));a=this.iToken;if(269484080!=this.tokAt(a))break}this.iToken=a;this.tokAt(a)!=c&&this.invArg();return b},"~N");e(c$,"listBS",function(a){var b=new JU.Lst;b.addLast(JS.SV.newV(10,a));return b},"JU.BS");e(c$,"compareFloatData",function(a,b,c,d){var f=new JU.BS,e=this.vwr.ms.ac,k=this.vwr.ms.at,h=0;this.vwr.autoCalculate(a);var n=1716520985==a;!n&&null==this.ptTemp&&(this.ptTemp=new JU.P3);
for(;0<=--e;){h=!1;h=k[e];if(n){if(null==b||b.length<=e)continue;h=b[e]}else h=h.atomPropertyFloat(this.vwr,a,this.ptTemp);(h=this.compareFloat(c,h,d))&&f.set(e)}return f},"~N,~A,~N,~N");e(c$,"compareFloat",function(a,b,c){switch(a){case 269484435:return b<c;case 269484434:return b<=c;case 269484433:return b>=c;case 269484432:return b>c;case 269484436:return b==c;case 269484437:return b!=c&&!Float.isNaN(b)}return!1},"~N,~N,~N");e(c$,"compareString",function(a,b,c){var d=new JU.BS,f=this.vwr.ms.at,
e=this.vwr.ms.ac,k=269484438==b||1087373316==a&&this.vwr.getBoolean(603979823);for(k||(c=c.toLowerCase());0<=--e;){var h=f[e].atomPropertyString(this.vwr,a);k||(h=h.toLowerCase());this.compareStringValues(b,h,c)&&d.set(e)}return d},"~N,~N,~S");e(c$,"compareStringValues",function(a,b,c){switch(a){case 269484436:case 269484437:return JU.PT.isMatch(b,c,!0,!0)==(269484436==a);case 269484438:return JU.PT.isLike(b,c);default:this.invArg()}return!1},"~N,~S,~S");e(c$,"compareInt",function(a,b,c){var d=2147483647,
f=null,e=b,k=c,h=this.vwr.ms,n=h.at,l=h.ac,j=-1,m=0,q=-1,p=null,s=0,B;switch(a){case 1297090050:switch(e){case 269484433:case 269484432:j=2147483647}break;case 1095761923:try{switch(b){case 269484435:return JU.BSUtil.newBitSet2(0,c);case 269484434:return JU.BSUtil.newBitSet2(0,c+1);case 269484433:return JU.BSUtil.newBitSet2(c,l);case 269484432:return JU.BSUtil.newBitSet2(c+1,l);case 269484436:return c<l?JU.BSUtil.newBitSet2(c,c+1):new JU.BS;default:return B=JU.BSUtil.setAll(l),0<=c&&B.clear(c),B}}catch(v){if(y(v,
Exception))return new JU.BS;throw v;}}B=JU.BS.newN(l);for(var A=0;A<l;++A){var x=!1,t=n[A];switch(a){default:d=t.atomPropertyInt(a);break;case 1095761943:case 1095766024:return JU.BSUtil.copy(this.vwr.ms.getConformation(-1,c-1,!1));case 1297090050:f=t.atomSymmetry;if(null==f)continue;t.mi!=q&&(q=t.mi,p=h.getModelCellRange(q),s=h.getModelSymmetryCount(q));if(200<=k){if(null==p)continue;c=k%1E3;var w=I(k/1E3)-1;if(0>w)x=!0;else if(0==s||0<=w&&!(x=f.get(w)))continue;e=1048587;d=0>w?t.getCellTranslation(c,
p,s):t.getSymmetryTranslation(w,p,s)}else if(0<s){if(c>s&&269484435!=e&&269484434!=e)continue;if(269484437==e){0<c&&(c<=s&&!f.get(c))&&B.set(A);continue}f=JU.BSUtil.copy(f);f.clearBits(s,f.length())}switch(e){case 269484435:j=c-1;break;case 269484434:j=c;break;case 269484433:m=c-1;break;case 269484432:m=c;break;case 269484436:j=c;m=c-1;break;case 269484437:x=!f.get(c)}0>m&&(m=0);m<j&&(f=f.nextSetBit(m),0<=f&&f<j&&(x=!0));if(!x||2147483647==d)b=1048587}switch(b){case 269484435:x=d<c;break;case 269484434:x=
d<=c;break;case 269484433:x=d>=c;break;case 269484432:x=d>c;break;case 269484436:x=d==c;break;case 269484437:x=d!=c}x&&B.set(A)}return B},"~N,~N,~N");e(c$,"getBitsetPropertySelector",function(a,b,c){var d=this.getToken(a).tok;switch(d){case 32:case 64:case 96:case 192:case 128:case 160:case 1716520985:break;default:if(JS.T.tokAttrOr(d,1078984704,1141899264))break;if(806354977!=d&&!JS.T.tokAttr(d,1073741824))return null;var f=this.paramAsStr(a);if(!b&&this.vwr.isFunction(f)){d=135368713;break}if(c&&
!f.endsWith("?"))return null;c&&(d=1073741824)}return b&&c&&!JS.T.tokAttr(d,2048)?null:JS.SV.newSV(269484241,d,this.paramAsStr(a))},"~N,~B,~B");e(c$,"getBitsetPropertyFloat",function(a,b,c,d){a=this.getBitsetProperty(a,b,null,null,null,null,!1,2147483647,!1);if(!Float.isNaN(c))for(b=0;b<a.length;b++)a[b]<c&&(a[b]=NaN);if(!Float.isNaN(d))for(b=0;b<a.length;b++)a[b]>d&&(a[b]=NaN);return a},"JU.BS,~N,~N,~N");e(c$,"getBitsetProperty",function(a,b,c,d,f,e,k,h,n){var l=2147483647!=h,j=l||!q(f,JM.BondSet),
m=b&480,p=224==m,r=this.vwr.ms.ac,s=256==m?N(r,0):null,y=480==m||p;b&=-481;0==b&&(b=j?1141899265:1678770178);var v=!1,A=!1,x=!1;switch(b){case 1146095626:case 1146095631:case 1146095627:case 1146095629:case 1146093584:case 1146093582:case 1766856708:case 1146095628:v=!0;break;case 135368713:case 1276118018:break;default:A=JS.T.tokAttr(b,1095761920)&&!JS.T.tokAttr(b,1112539136),x=!A&&JS.T.tokAttr(b,1087373312)}var t=v||!j?new JU.P3:null;if(y||x&&!l&&256!=m&&32!=m)m=1048579;var w=1048579==m?new JU.Lst:
null,z=null,B=z=null,u=null,C=null,E=null,H=null;switch(b){case 1141899265:case 1678770178:if(this.chk)return a;z=1141899265==b?j?a:this.vwr.ms.getAtoms(1678770178,a):j?JM.BondSet.newBS(this.vwr.getBondsForSelectedAtoms(a),null):a;switch(m){case 32:h=z.nextSetBit(0);break;case 64:h=z.length()-1;break;case 192:case 128:case 160:return Float.$valueOf(NaN);default:return z}z.clearAll();0<=h&&z.set(h);return z;case 1087373321:switch(m){case 0:case 1048579:return this.getCmdExt().getBitsetIdent(a,null,
f,k,h,y)}return"";case 135368713:z=e[0];B=e[1];u=JU.BS.newN(r);C=JS.SV.newV(10,u);break;case 1112539150:case 1112539151:this.vwr.autoCalculate(b);break;case 1276118018:if(null==c&&null==d)return new JU.P3;break;case 1766856708:E=new JU.P3;break;case 1716520985:H=this.vwr.getDataFloat(e)}var D=k=e=0,F=0,G=0;switch(m){case 32:k=2147483647;D=3.4028235E38;break;case 64:k=-2147483648,D=-3.4028235E38}var M=this.vwr.ms;f=v?3:x?2:A?1:0;if(j){E=null!=a;l?(j=h,r=h+1):E?(j=a.nextSetBit(0),r=Math.min(r,a.length())):
j=0;this.chk&&(r=0);for(h=j;0<=h&&h<r;h=E?a.nextSetBit(h+1):h+1){e++;var L=M.at[h];switch(f){case 0:j=3.4028235E38;switch(b){case 135368713:u.set(h);j=JS.SV.fValue(this.getUserFunctionResult(z,B,C));u.clear(h);break;case 1716520985:j=null==H?0:H[h];break;case 1276118018:j=null!=d?JU.Measure.distanceToPlane(d,L):L.distance(c);break;default:j=L.atomPropertyFloat(this.vwr,b,this.ptTemp)}if(3.4028235E38==j||Float.isNaN(j)&&1048579!=m){e--;continue}switch(m){case 32:j<D&&(D=j);break;case 64:j>D&&(D=j);
break;case 256:s[h]=j;break;case 1048579:w.addLast(Float.$valueOf(j));break;case 160:case 192:G+=j*j;default:F+=j}break;case 1:j=0;switch(b){case 1095766024:case 1095761925:this.errorStr(45,JS.T.nameOf(b));break;default:j=L.atomPropertyInt(b)}switch(m){case 32:j<k&&(k=j);break;case 64:j>k&&(k=j);break;case 256:s[h]=j;break;case 1048579:w.addLast(Integer.$valueOf(j));break;case 160:case 192:G+=j*j;default:F+=j}break;case 2:j=L.atomPropertyString(this.vwr,b);switch(m){case 256:s[h]=JU.PT.parseFloat(j);
break;default:if(null==w)return j;w.addLast(j)}break;case 3:switch(j=L.atomPropertyTuple(this.vwr,b,this.ptTemp),m){case 256:s[h]=null==t?-1:j.length();break;case 1048579:w.addLast(null==j?Integer.$valueOf(-1):JU.P3.newP(j));break;default:null==j?e--:t.add(j)}}if(l)break}}else{j=(c=null==a)?0:a.nextSetBit(0);r=this.vwr.ms.bondCount;for(h=j;0<=h&&h<r;h=c?h+1:a.nextSetBit(h+1))switch(e++,d=M.bo[h],b){case 1141899267:j=d.atom1.distance(d.atom2);switch(m){case 32:j<D&&(D=j);break;case 64:j>D&&(D=j);break;
case 1048579:w.addLast(Float.$valueOf(j));break;case 160:case 192:G+=j*j;default:F+=j}break;case 1146095626:switch(m){case 1048579:t.ave(d.atom1,d.atom2);w.addLast(JU.P3.newP(t));break;default:t.add(d.atom1),t.add(d.atom2),e++}break;case 1766856708:JU.CU.colorPtFromInt(this.vwr.gdata.getColorArgbOrGray(d.colix),E);switch(m){case 1048579:w.addLast(JU.P3.newP(E));break;default:t.add(E)}break;default:this.errorStr(46,JS.T.nameOf(b))}}if(256==m)return s;if(1048579==m){if(n)return w;a=w.size();if(x&&!y&&
1==a)return w.get(0);if(p){s=N(a,0);for(h=a;0<=--h;)switch(b=w.get(h),f){case 0:s[h]=b.floatValue();break;case 1:s[h]=b.floatValue();break;case 2:s[h]=JU.PT.parseFloat(b);break;case 3:s[h]=null==b?-1:b.length()}return s}if(1087373320==b){s=new JU.SB;for(h=0;h<a;h++)s.append(w.get(h));return s.toString()}s=Array(a);for(h=a;0<=--h;)b=w.get(h),s[h]=q(b,JU.P3)?JU.Escape.eP(b):""+w.get(h);return s}if(v)return 0==e?Integer.$valueOf(-1):JU.P3.new3(t.x/e,t.y/e,t.z/e);if(0==e||1==e&&192==m)return Float.$valueOf(NaN);
if(A)switch(m){case 32:case 64:return Integer.$valueOf(k);case 160:case 192:break;case 128:return Integer.$valueOf(I(F));default:return F/e==I(F/e)?Integer.$valueOf(I(F/e)):Float.$valueOf(F/e)}switch(m){case 32:case 64:F=D;break;case 128:break;case 160:F=G;break;case 192:F=Math.sqrt((G-F*F/e)/(e-1));break;default:F/=e}return Float.$valueOf(F)},"JU.BS,~N,JU.P3,JU.P4,~O,~O,~B,~N,~B");e(c$,"bitSetForModelFileNumber",function(a){var b=JU.BS.newN(this.vwr.ms.ac);if(this.chk)return b;var c=this.vwr.ms.mc,
d=this.vwr.haveFileSet();1E6>a&&d&&(a*=1E6);if(0==a%1E6){d=this.vwr.ms.getModelNumberIndex(a+1,!1,!1);if(0>d)return b;a=0==a?c:this.vwr.ms.getModelNumberIndex(a+1000001,!1,!1);0>d&&(d=0);0>a&&(a=c);this.vwr.ms.isTrajectory(d)&&(a=d+1);for(c=d;c<a;c++)b.or(this.vwr.getModelUndeletedAtomsBitSet(c))}else c=this.vwr.ms.getModelNumberIndex(a,!1,!0),0<=c&&b.or(this.vwr.getModelUndeletedAtomsBitSet(c));return b},"~N");e(c$,"getStringObjectAsVariable",function(a,b){if(null==a||0==a.length)return a;var c=
JS.SV.unescapePointOrBitsetAsVariable(a);return q(c,String)&&null!=b?this.vwr.g.setUserVariable(b,JS.SV.newS(c)):c},"~S,~S");e(c$,"getAtomBits",function(a,b){return this.chk?new JU.BS:this.vwr.ms.getAtoms(a,b)},"~N,~O");c$.getSeqCode=e(c$,"getSeqCode",function(a){return 2147483647==a.intValue?a.value.intValue():JM.Group.getSeqcodeFor(a.intValue," ")},"JS.T");e(c$,"setVariable",function(a,b,c,d){var f=null,e="",f=c.startsWith("property_"),k=c.equals("thrown_value"),e=1048577==this.tokAt(1),h=f?null:
0==c.length?new JS.SV:this.getContextVariableAsVariable(c);if(d&&!e){switch(this.tokAt(2)){case 1073742195:case 269484096:61==this.st[0].intValue&&(a=2);break;case 1048583:case 1048584:break;case 269484436:a=3;break;default:a=2}1==a&&(c=null)}e=0;b=this.parameterExpression(a,b,c,!0,!0,-1,!1,null,null,d&&1==a);e=b.size();0==e&&this.invArg();if(this.chk)return null;a=JS.SV.newS("").setv(b.get(e-1));if(1<e){c=2<e?b.get(1):null;h=b.get(0);b=!1;switch(h.tok){case 6:case 14:3<e&&this.invArg();h.mapPut(c.asString(),
a);break;case 7:e>2+(null==c?0:1)&&this.invArg();null==c?c=h:h=JS.SV.selectItemVar(h);b=!0;break;case 4:if(2!=c.tok){h.value=JU.PT.rep(h.asString(),c.asString(),a.asString());h.intValue=2147483647;break}case 11:case 12:2147483647==h.intValue?b=!0:h.setSelectedValue(h.intValue,c.asInt(),a);break;case 8:f=h.value=JU.P3.newP(h.value);e=a.asFloat();switch(JS.T.getTokFromName(c.asString())){case 1112541205:f.x=e;break;case 1112541206:f.y=e;break;case 1112541207:f.z=e}break;case 10:e=c.asString();f=JS.SV.getBitSet(h,
!0);d=this.vwr.ms.ac;k=f.cardinality();if(e.startsWith("property_")){k=7==a.tok?JS.SV.flistValue(a,a.getList().size()==k?k:d):a.asString();this.vwr.setData(e,[e,k,JU.BSUtil.copy(f),Integer.$valueOf(-1)],d,0,0,7==a.tok?2147483647:-2147483648,0);break}this.setBitsetProperty(f,JS.T.getTokFromName(e),a.asInt(),a.asFloat(),a)}b&&h.setSelectedValue(c.intValue,2147483647,a);return null}if(!f&&(null==h&&(k||!q(a.value,String)&&!(2==a.tok||q(a.value,Integer)||q(a.value,Float)||q(a.value,Boolean))))&&null!=
c)(c.startsWith("_")||null==(h=this.vwr.g.getOrSetNewVariable(c,!0)))&&this.errorStr(22,c);if(null!=h)return h.setv(a),h.setModified(!0),h;h=JS.SV.oValue(a);if(f)return 7==a.tok&&(h=a.asString()),this.vwr.setData(c,[c,""+h,JU.BSUtil.copy(this.vwr.bsA()),Integer.$valueOf(0)],this.vwr.ms.ac,0,0,-2147483648,0),null;q(h,Boolean)?this.setBooleanProperty(c,h.booleanValue()):q(h,Integer)?this.setIntProperty(c,h.intValue()):q(h,Float)?this.setFloatProperty(c,h.floatValue()):q(h,String)?this.setStringProperty(c,
h):JU.Logger.error("ERROR -- return from propertyExpression was "+h);return a},"~N,~N,~S,~B");e(c$,"setBitsetProperty",function(a,b,c,d,f){if(!(this.chk||0==JU.BSUtil.cardinalityOf(a))){var e=null,k=null,h=null,n,l=null;n=0;var j=JS.T.tokAttr(b,1087373312);if(7==f.tok&&(l=f.getList(),0==(n=l.size())))return;switch(b){case 1146095626:case 1146095627:case 1146095629:case 1146095631:switch(f.tok){case 8:this.vwr.setAtomCoords(a,b,f.value);break;case 7:this.theToken=f,this.vwr.setAtomCoords(a,b,this.getPointArray(-1,
n,!0))}return;case 1766856708:var m=null;b="color";switch(f.tok){case 7:f=O(n,0);for(m=n;0<=--m;)b=l.get(m),n=JS.SV.ptValue(b),null!=n?f[m]=JU.CU.colorPtToFFRGB(n):2==b.tok?f[m]=b.intValue:(f[m]=JU.CU.getArgbFromString(b.asString()),0==f[m]&&(f[m]=b.asInt())),0==f[m]&&this.errorStr2(50,"ARRAY",b.asString());m=f;b="colorValues";break;case 8:m=Integer.$valueOf(JU.CU.colorPtToFFRGB(f.value));break;case 4:m=f.value;break;default:m=Integer.$valueOf(JS.SV.iValue(f))}this.setAtomProp(b,m,a);return;case 1826248716:case 1288701959:7!=
f.tok&&(k=JS.SV.sValue(f));break;case 1087375365:case 1095763978:this.clearDefinedVariableAtomSets(),j=!1}switch(f.tok){case 7:j?e=JS.SV.strListValue(f):h=JS.SV.flistValue(f,n);break;case 4:null==k&&(e=JU.PT.getTokens(JS.SV.sValue(f)))}if(null!=e){n=e.length;if(!j){h=N(n,0);for(m=n;0<=--m;)h[m]=1087375365==b?JU.Elements.elementNumberFromSymbol(e[m],!1):JU.PT.parseFloat(e[m])}7!=f.tok&&1==n&&(j?k=e[0]:d=h[0],c=B(d),h=e=null)}this.vwr.setAtomProperty(a,b,c,d,k,h,e)}},"JU.BS,~N,~N,~N,JS.T");e(c$,"setStatement",
function(a){this.st=a;this.slen=this.st.length;if(0==this.slen)return!0;var b,c;for(b=1;b<this.slen;b++){if(null==this.st[b])return this.slen=b,!0;if(1060866==this.st[b].tok)break}if(b==this.slen)return b==this.slen;switch(this.st[0].tok){case 102436:case 135368713:case 1073741824:if(269484048==this.tokAt(1))return!0}a=Array(this.slen);a[0]=this.st[0];var d=!1,f=1;for(b=1;b<this.slen;b++)if(null!=this.st[b]){switch(c=this.getToken(b).tok){default:a[f]=this.st[b];break;case 1048577:case 1048578:d=
1048577==c;a[f]=this.st[b];break;case 1060866:++b==this.slen&&this.invArg();var e,k=4==this.theToken.intValue,h;h=this.paramAsStr(b);var n=1048577==this.tokAt(b),l=1==f&&this.st[0]===JS.T.tokenSetCmd;n?(e=this.parameterExpressionToken(++b),b=this.iToken,e=7==e.tok?e:JS.SV.oValue(e)):(e=2==this.tokAt(b)?this.vwr.ms.getAtoms(1095763969,Integer.$valueOf(this.st[b].intValue)):this.getParameter(h,0,!0),!d&&!l&&(n=!0));c=this.tokAt(0);k=(new Boolean(k|(JS.T.tokAttr(c,20480)||135271429==c))).valueOf();if(q(e,
JS.SV))a[f]=e,d&&7==a[f].tok&&(k=JS.SV.getBitSet(e,!0),a[f]=JS.SV.newV(10,null==k?this.getAtomBitSet(JS.SV.sValue(a[f])):k));else if(q(e,Boolean))a[f]=e.booleanValue()?JS.T.tokenOn:JS.T.tokenOff;else if(q(e,Integer))a[f]=JS.T.tv(2,e.intValue(),e);else if(q(e,Float))a[f]=JS.T.tv(3,JS.ScriptParam.getFloatEncodedInt(""+e),e);else if(q(e,String)){if(!k&&!d){if((1085443!=c||1<f&&537022465!=this.st[1].tok)&&JS.T.tokAttr(c,36864))e=this.getParameter(e,1073742190,!0);q(e,String)&&(e=this.getStringObjectAsVariable(e,
null))}q(e,JS.SV)?a[f]=e:(h=e,d&&!k?a[f]=JS.T.tokAttr(a[f-1].tok,269484288)?JS.T.o(4,h):JS.T.o(10,this.getAtomBitSet(h)):(c=l?JS.T.getTokFromName(h):n||k||0==h.length||0<=h.indexOf(".")||0<=h.indexOf(" ")||0<=h.indexOf("=")||0<=h.indexOf(";")||0<=h.indexOf("[")||0<=h.indexOf("{")?4:1073741824,a[f]=JS.T.o(c,e)))}else if(q(e,JU.BArray))a[f]=JS.SV.newV(15,e);else if(q(e,JU.BS))a[f]=JS.SV.newV(10,e);else if(q(e,JU.P3))a[f]=JS.SV.newV(8,e);else if(q(e,JU.P4))a[f]=JS.SV.newV(9,e);else if(q(e,JU.M34))a[f]=
JS.SV.newV(q(e,JU.M4)?12:11,e);else if(q(e,java.util.Map))a[f]=JS.SV.newV(6,e);else if(q(e,JS.ScriptContext))a[f]=JS.SV.newV(6,e.getFullMap());else if(q(e,JU.Lst)){n=e;k=null;for(h=0;h<n.size();h++){c=n.get(h);if(10!=c.tok){k=null;break}null==k&&(k=new JU.BS);k.or(c.value)}a[f]=null==k?JS.SV.getVariable(e):JS.T.o(10,k)}else e=this.getObjectCenter(h,-2147483648,-2147483648),null==e&&this.invArg(),a[f]=JS.T.o(8,e);l&&!JS.T.tokAttr(a[f].tok,536870912)&&this.invArg()}f++}this.st=a;for(b=f;b<this.st.length;b++)this.st[b]=
null;this.slen=f;return!0},"~A")});C("JS");E(null,"JS.ScriptFlowContext",["JS.ScriptCompiler"],function(){c$=H(function(){this.token=this.compiler=null;this.ptDefault=this.pt0=0;this.parent=this.$var=this.$function=null;this.ptCommand=this.ptLine=this.commandStart=this.lineStart=0;this.forceEndIf=!0;this.ident=null;D(this,arguments)},JS,"ScriptFlowContext");G(c$,function(a,b,c,d){this.compiler=a;this.token=b;this.ident=b.value;this.pt0=c;this.parent=d;this.lineStart=this.ptLine=this.compiler.lineCurrent;
this.commandStart=this.ptCommand=this.compiler.iCommand},"JS.ScriptCompiler,JS.ContextToken,~N,JS.ScriptFlowContext");e(c$,"getBreakableContext",function(a){for(var b=this;null!=b&&(!JS.ScriptCompiler.isBreakableContext(b.token.tok)||0<a--);)b=b.getParent();return b},"~N");e(c$,"checkForceEndIf",function(){var a=this.forceEndIf&&this.ptCommand<this.compiler.iCommand&&this.ptLine==this.compiler.lineCurrent;a&&(this.forceEndIf=!1);return a});e(c$,"setPt0",function(a,b){this.pt0=a;b&&(this.ptDefault=
a);this.setLine();return a},"~N,~B");e(c$,"setLine",function(){this.ptLine=this.compiler.lineCurrent;this.ptCommand=this.compiler.iCommand+1});p(c$,"toString",function(){return"ident "+this.ident+" line "+this.lineStart+" command "+this.commandStart});e(c$,"getParent",function(){return this.parent});e(c$,"path",function(){for(var a="",b=this;null!=b;)a=b.ident+"-"+a,b=b.parent;return"["+a+"]"});e(c$,"setFunction",function(a){this.$function=a},"JS.ScriptFunction")});C("JS");E(["J.api.JmolScriptFunction",
"java.util.Hashtable","JU.Lst"],"JS.ScriptFunction",["JU.AU","$.SB","JS.SV","$.T"],function(){c$=H(function(){this.chpt0=this.pt0=0;this.cmdpt0=-1;this.name=this.typeName=null;this.nParameters=0;this.names=null;this.tok=0;this.script=this.lineNumbers=this.lineIndices=this.aatoken=this.returnValue=this.variables=null;D(this,arguments)},JS,"ScriptFunction",null,J.api.JmolScriptFunction);Q(c$,function(){this.names=new JU.Lst;this.variables=new java.util.Hashtable});e(c$,"isVariable",function(a){return this.variables.containsKey(a)},
"~S");G(c$,function(){});G(c$,function(a,b){this.set(a,b);this.typeName=JS.T.nameOf(b)},"~S,~N");e(c$,"set",function(a,b){this.name=a;this.tok=b},"~S,~N");e(c$,"setVariables",function(a,b){for(var c=null==b?0:b.size(),d=this.names.size();0<=--d;){var f=this.names.get(d).toLowerCase(),e=d<this.nParameters&&d<c?b.get(d):null;null!=e&&7!=e.tok&&(e=JS.SV.newT(e));a.put(f,null==e?JS.SV.newS("").setName(f):e)}a.put("_retval",JS.SV.newI(364558==this.tok?2147483647:0))},"java.util.Map,JU.Lst");e(c$,"unsetVariables",
function(a,b){var c=null==b?0:b.size(),d=this.names.size();if(!(0==c||0==d))for(var e=0;e<d&&e<c;e++){var g=b.get(e);if(7==g.tok){var k=a.get(this.names.get(e).toLowerCase());7==k.tok&&(g.value=k.value)}}},"java.util.Map,JU.Lst");e(c$,"addVariable",function(a,b){this.variables.put(a,a);this.names.addLast(a);b&&this.nParameters++},"~S,~B");c$.setFunction=e(c$,"setFunction",function(a,b,c,d,e,g,k){var h=a.cmdpt0,n=a.chpt0,l=d-h;a.setScript(b.substring(n,c));b=a.aatoken=Array(l);a.lineIndices=JU.AU.newInt2(l);
a.lineNumbers=T(l,0);c=e[h]-1;for(var j=0;j<l;j++)if(a.lineNumbers[j]=e[h+j]-c,a.lineIndices[j]=[g[h+j][0]-n,g[h+j][1]-n],b[j]=k.get(h+j),0<b[j].length){var m=b[j][0];JS.T.tokAttr(m.tok,102400)&&(m.intValue-=0>m.intValue?-h:h)}for(j=d;--j>=h;)k.remove(j),g[j][0]=g[j][1]=0},"JS.ScriptFunction,~S,~N,~N,~A,~A,JU.Lst");e(c$,"setScript",function(a){this.script=a;null!=this.script&&(""!==this.script&&!this.script.endsWith("\n"))&&(this.script+="\n")},"~S");p(c$,"toString",function(){var a=(new JU.SB).append("/*\n * ").append(this.name).append("\n */\n").append(this.getSignature()).append("{\n");
null!=this.script&&a.append(this.script);a.append("}\n");return a.toString()});p(c$,"getSignature",function(){for(var a=(new JU.SB).append(this.typeName).append(" ").append(this.name).append(" ("),b=0;b<this.nParameters;b++)0<b&&a.append(", "),a.append(this.names.get(b));a.append(")");return a.toString()});p(c$,"geTokens",function(){return this.aatoken});p(c$,"getName",function(){return this.name});p(c$,"getTok",function(){return this.tok})});C("JS");E(["JS.ScriptException"],"JS.ScriptInterruption",
null,function(){c$=W(JS,"ScriptInterruption",JS.ScriptException);G(c$,function(a,b,c){S(this,JS.ScriptInterruption,[a,b,"!",-2147483648==c||a.vwr.autoExit]);b.equals("delay")&&a.delayScript(c)},"JS.ScriptEval,~S,~N")});C("JS");E(["J.api.JmolScriptManager","JU.Lst"],"JS.ScriptManager","java.io.BufferedReader java.lang.Boolean $.Thread javajs.api.ZInputStream JU.BS $.PT $.Rdr $.SB J.api.Interface JS.ScriptQueueThread JU.Elements $.Logger".split(" "),function(){c$=H(function(){this.scriptQueue=this.commandWatcherThread=
this.scriptQueueRunning=this.queueThreads=this.evalTemp=this.eval=this.vwr=null;this.useCommandWatcherThread=!1;this.scriptIndex=0;this.$isScriptQueued=!0;D(this,arguments)},JS,"ScriptManager",null,J.api.JmolScriptManager);Q(c$,function(){this.queueThreads=Array(2);this.scriptQueueRunning=X(2,!1);this.scriptQueue=new JU.Lst});p(c$,"getScriptQueue",function(){return this.scriptQueue});p(c$,"isScriptQueued",function(){return this.$isScriptQueued});G(c$,function(){});p(c$,"setViewer",function(a){this.vwr=
a;this.eval=this.newScriptEvaluator();this.eval.setCompiler();return this.eval},"JV.Viewer");e(c$,"newScriptEvaluator",function(){return J.api.Interface.getInterface("JS.ScriptEval",this.vwr,"setOptions").setViewer(this.vwr)});p(c$,"clear",function(a){a?(this.startCommandWatcher(!1),this.interruptQueueThreads()):this.evalTemp=null},"~B");p(c$,"addScript",function(a,b){return this.addScr("String",a,"",b)},"~S,~B");e(c$,"addScr",function(a,b,c,d){this.useCommandWatcherThread=!1;this.vwr.g.useScriptQueue||
(this.clearQueue(),this.vwr.haltScriptExecution());null==this.commandWatcherThread&&this.useCommandWatcherThread&&this.startCommandWatcher(!0);if(null!=this.commandWatcherThread&&0<=b.indexOf("/*SPLIT*/")){b=JU.PT.split(b,"/*SPLIT*/");for(var e=0;e<b.length;e++)this.addScr(a,b[e],c,d);return"split into "+b.length+" sections for processing"}var e=null!=this.commandWatcherThread&&(0>b.indexOf("javascript")||0<=b.indexOf("#javascript ")),g=new JU.Lst;g.addLast(b);g.addLast(c);g.addLast(a);g.addLast(d?
Boolean.TRUE:Boolean.FALSE);g.addLast(Integer.$valueOf(e?-1:1));this.scriptQueue.addLast(g);this.startScriptQueue(!1);return"pending"},"~S,~S,~S,~B");p(c$,"clearQueue",function(){this.scriptQueue.clear()});p(c$,"waitForQueue",function(){if(!this.vwr.isSingleThreaded)for(var a=0;this.isQueueProcessing();)try{Thread.sleep(100),0==a++%10&&JU.Logger.debugging&&JU.Logger.debug("...scriptManager waiting for queue: "+this.scriptQueue.size()+" thread="+Thread.currentThread().getName())}catch(b){if(!y(b,InterruptedException))throw b;
}});p(c$,"isQueueProcessing",function(){return null!=this.queueThreads[0]||null!=this.queueThreads[1]});e(c$,"flushQueue",function(a){for(var b=this.scriptQueue.size();0<=--b;){var c=this.scriptQueue.get(b).get(0);0==c.indexOf(a)&&(this.scriptQueue.remove(b),JU.Logger.debugging&&JU.Logger.debug(this.scriptQueue.size()+" scripts; removed: "+c))}},"~S");e(c$,"startScriptQueue",function(a){var b=a?1:0;this.scriptQueueRunning[b]||(this.scriptQueueRunning[b]=!0,this.queueThreads[b]=new JS.ScriptQueueThread(this,
this.vwr,a,b),this.queueThreads[b].start())},"~B");p(c$,"getScriptItem",function(a,b){if(this.vwr.isSingleThreaded&&this.vwr.queueOnHold)return null;var c=this.scriptQueue.get(0),d=c.get(4).intValue();return(a?0>d:b?0==d:1==d)?c:null},"~B,~B");p(c$,"startCommandWatcher",function(a){if(this.useCommandWatcherThread=a){if(null!=this.commandWatcherThread)return;this.commandWatcherThread=J.api.Interface.getInterface("JS.CommandWatcherThread",this.vwr,"setOptions");this.commandWatcherThread.setManager(this,
this.vwr,null);this.commandWatcherThread.start()}else{if(null==this.commandWatcherThread)return;this.clearCommandWatcherThread()}JU.Logger.debugging&&JU.Logger.debug("command watcher "+(a?"started":"stopped")+this.commandWatcherThread)},"~B");e(c$,"interruptQueueThreads",function(){for(var a=0;a<this.queueThreads.length;a++)null!=this.queueThreads[a]&&this.queueThreads[a].interrupt()});e(c$,"clearCommandWatcherThread",function(){null!=this.commandWatcherThread&&(this.commandWatcherThread.interrupt(),
this.commandWatcherThread=null)});p(c$,"queueThreadFinished",function(a){this.queueThreads[a].interrupt();this.scriptQueueRunning[a]=!1;this.queueThreads[a]=null;this.vwr.setSyncDriver(4);this.vwr.queueOnHold=!1},"~N");e(c$,"runScriptNow",function(){if(0<this.scriptQueue.size()){var a=this.getScriptItem(!0,!0);null!=a&&(a.set(4,Integer.$valueOf(0)),this.startScriptQueue(!0))}});p(c$,"evalFile",function(a){var b=a.indexOf(" -noqueue");return 0<=b?this.evalStringWaitStatusQueued("String","script "+
JU.PT.esc(a.substring(0,b)),"",!1,!1):this.addScript("script "+JU.PT.esc(a),!1)},"~S");p(c$,"evalStringWaitStatusQueued",function(a,b,c,d,e){if(null==b)return null;var g=this.checkScriptExecution(b,!1);if(null!=g)return g;var k=null==c||c.equals("output")?new JU.SB:null,g=this.vwr.sm.statusList;this.vwr.getStatusChanged(c);this.vwr.isSyntaxCheck&&JU.Logger.info("--checking script:\n"+this.eval.getScript()+"\n----\n");var h=0==b.indexOf(")");h&&(b=b.substring(1));h=h||!e;this.vwr.setErrorMessage(null,
null);var n=this.eval.compileScriptString(b,d),l=this.eval.getErrorMessage(),j=this.eval.getErrorMessageUntranslated();this.vwr.setErrorMessage(l,j);this.vwr.refresh(7,"script complete");n?(this.$isScriptQueued=e,d||this.vwr.setScriptStatus(null,b,-2-++this.scriptIndex,null),this.eval.evaluateCompiledScript(this.vwr.isSyntaxCheck,this.vwr.isSyntaxAndFileCheck,h,this.vwr.listCommands,k,e||!this.vwr.isSingleThreaded)):(this.vwr.scriptStatus(l),this.vwr.setScriptStatus("Jmol script terminated",l,1,j),
this.eval.isStateScript()&&JS.ScriptManager.setStateScriptVersion(this.vwr,null));null!=l&&this.vwr.autoExit&&this.vwr.exitJmol();this.vwr.isSyntaxCheck&&(null==l?JU.Logger.info("--script check ok"):JU.Logger.error("--script check error\n"+j),JU.Logger.info("(use 'exit' to stop checking)"));this.$isScriptQueued=!0;if(a.equalsIgnoreCase("String"))return j;if(null!=k)return null==j?k.toString():j;a=this.vwr.getProperty(a,"jmolStatus",c);this.vwr.getStatusChanged(g);return a},"~S,~S,~S,~B,~B");e(c$,
"checkScriptExecution",function(a,b){var c=a;0<=c.indexOf("\u0001##")&&(c=c.substring(0,c.indexOf("\u0001##")));return this.checkResume(c)?"script processing resumed":this.checkStepping(c)?"script processing stepped":this.checkHalt(c,b)?"script execution halted":null},"~S,~B");e(c$,"checkResume",function(a){return a.equalsIgnoreCase("resume")?(this.vwr.setScriptStatus("","execution resumed",0,null),this.eval.resumePausedExecution(),!0):!1},"~S");e(c$,"checkStepping",function(a){return a.equalsIgnoreCase("step")?
(this.eval.stepPausedExecution(),!0):a.equalsIgnoreCase("?")?(this.vwr.scriptStatus(this.eval.getNextStatement()),!0):!1},"~S");p(c$,"evalStringQuietSync",function(a,b,c){c&&(this.vwr.sm.syncingScripts&&0>a.indexOf("#NOSYNC;"))&&this.vwr.syncScript(a+" #NOSYNC;",null,0);this.eval.isPaused()&&"!"!=a.charAt(0)&&(a="!"+JU.PT.trim(a,"\n\r\t "));(c=0<a.length&&"!"==a.charAt(0))&&(a=a.substring(1));var d=this.checkScriptExecution(a,c);if(null!=d)return d;if(this.vwr.isScriptExecuting()&&(c||this.eval.isPaused()))return this.vwr.setInsertedCommand(a),
0==a.indexOf("moveto ")&&this.flushQueue("moveto "),"!"+a;this.vwr.setInsertedCommand("");b&&(a+="\u0001## EDITOR_IGNORE ##");return this.addScript(a,b&&!this.vwr.getBoolean(603979880))},"~S,~B,~B");p(c$,"checkHalt",function(a,b){if(a.equalsIgnoreCase("pause"))return this.vwr.pauseScriptExecution(),this.vwr.scriptEditorVisible&&this.vwr.setScriptStatus("","paused -- type RESUME to continue",0,null),!0;if(a.equalsIgnoreCase("menu"))return this.vwr.getProperty("DATA_API","getPopupMenu","\x00"),!0;a=
a.toLowerCase();var c=!1,d=null;a.startsWith("exit")?(this.vwr.haltScriptExecution(),this.vwr.clearScriptQueue(),this.vwr.clearTimeouts(),c=a.equals(d="exit")):a.startsWith("quit")&&(this.vwr.haltScriptExecution(),c=a.equals(d="quit"));if(null==d)return!1;b&&(this.vwr.clearThreads(),this.vwr.queueOnHold=!1);(b||this.vwr.g.waitForMoveTo)&&this.vwr.tm.stopMotion();JU.Logger.info(this.vwr.isSyntaxCheck?d+" -- stops script checking":(b?"!":"")+d+" received");this.vwr.isSyntaxCheck=!1;return c},"~S,~B");
p(c$,"getAtomBitSetEval",function(a,b){null==a&&(a=this.evalTemp,null==a&&(a=this.evalTemp=this.newScriptEvaluator()));return this.vwr.slm.excludeAtoms(a.getAtomBitSet(b),!1)},"J.api.JmolScriptEvaluator,~O");p(c$,"scriptCheckRet",function(a,b){if(0==a.indexOf(")")||0==a.indexOf("!"))a=a.substring(1);var c=this.newScriptEvaluator().checkScriptSilent(a);return b||null==c.errorMessage?c:c.errorMessage},"~S,~B");p(c$,"openFileAsync",function(a,b){var c=2==(b&2),d=4==(b&4),e=1==(b&1)&&!d,g=null;a=a.trim();
a.startsWith("\t")&&(c=!0,a=a.substring(1));a=a.$replace("\\","/");var k=a.startsWith("cache://");this.vwr.isApplet&&0>a.indexOf("://")&&(a="file://"+(a.startsWith("/")?"":"/")+a);try{if(a.endsWith(".pse"))g=(k?"":"zap;")+"load SYNC "+JU.PT.esc(a)+" filter 'DORESIZE'";else if(a.endsWith("jvxl"))g="isosurface ";else{if(!a.toLowerCase().endsWith(".spt")){var h=this.getDragDropFileTypeName(a);if(null==h){h=this.vwr.fm.jmb.determineSurfaceTypeIs(this.vwr.getBufferedInputStream(a));null!=h&&(g="if (_filetype == 'Pdb') { isosurface sigma 1.0 within 2.0 {*} "+
JU.PT.esc(a)+" mesh nofill }; else; { isosurface "+JU.PT.esc(a)+"}");return}if(h.equals("Jmol"))g="script ";else if(h.equals("Cube"))g="isosurface sign red blue ";else if(!h.equals("spt")){g=this.vwr.g.defaultDropScript;g=JU.PT.rep(g,"%FILE",a);g=JU.PT.rep(g,"%ALLOWCARTOONS",""+e);if(g.toLowerCase().startsWith("zap")&&(k||d))g=g.substring(3);d&&(g=JU.PT.rep(g,"load SYNC","load append"));return}}!c&&this.vwr.scriptEditorVisible&&null==g?this.vwr.showEditor([a,this.vwr.getFileAsString3(a,!0,null)]):
g=(null==g?"script ":g)+JU.PT.esc(a)}}finally{null!=g&&this.vwr.evalString(g)}},"~S,~N");e(c$,"getDragDropFileTypeName",function(a){var b=a.indexOf("::");if(0<=b)return a.substring(0,b);if(a.startsWith("="))return"pdb";b=this.vwr.fm.getUnzippedReaderOrStreamFromName(a,null,!0,!1,!0,!0,null);return q(b,java.io.BufferedReader)?this.vwr.getModelAdapter().getFileTypeName(b):q(b,javajs.api.ZInputStream)?(a=this.getZipDirectoryAsString(a),0<=a.indexOf("JmolManifest")?"Jmol":this.vwr.getModelAdapter().getFileTypeName(JU.Rdr.getBR(a))):
JU.PT.isAS(b)?b[0]:null},"~S");e(c$,"getZipDirectoryAsString",function(a){a=this.vwr.fm.getBufferedInputStreamOrErrorMessageFromName(a,a,!1,!1,null,!1,!0);return JU.Rdr.getZipDirectoryAsStringAndClose(this.vwr.getJzt(),a)},"~S");c$.setStateScriptVersion=e(c$,"setStateScriptVersion",function(a,b){if(null!=b){JS.ScriptManager.prevCovalentVersion=JU.Elements.bondingVersion;var c=JU.PT.getTokens(b.$replace("."," ").$replace("_"," "));try{var d=JU.PT.parseInt(c[0]),e=JU.PT.parseInt(c[1]),g=JU.PT.parseInt(c[2]);
-2147483648==g&&(g=0);if(-2147483648!=d&&-2147483648!=e){var k=a.stateScriptVersionInt=1E4*d+100*e+g;a.setBooleanProperty("legacyautobonding",110924>k);a.g.legacyHAddition=130117>k;a.setBooleanProperty("legacyjavafloat",140206>k||140300<=k&&140306>k);a.setIntProperty("bondingVersion",140111>k?0:1);return}}catch(h){if(!y(h,Exception))throw h;}}a.setIntProperty("bondingVersion",JS.ScriptManager.prevCovalentVersion);a.setBooleanProperty("legacyautobonding",!1);a.g.legacyHAddition=!1;a.stateScriptVersionInt=
2147483647},"JV.Viewer,~S");p(c$,"addHydrogensInline",function(a,b,c){var d=this.vwr.ms.at[a.nextSetBit(0)].mi;if(d!=this.vwr.ms.mc-1)return new JU.BS;a=this.vwr.getModelUndeletedAtomsBitSet(d);this.vwr.g.appendNew=!1;for(var e=this.vwr.ms.ac,g=this.vwr.ms.getAtomCountInModel(d),k=new JU.SB,h=0;h<b.size();h++){var n=b.get(h);k.append(";  connect 0 100 ").append("({"+e++ +"}) ").append("({"+n.i+"}) group;")}b=new JU.SB;b.appendI(c.length).append("\n").append("Viewer.AddHydrogens").append("#noautobond").append("\n");
for(h=0;h<c.length;h++)b.append("H ").appendF(c[h].x).append(" ").appendF(c[h].y).append(" ").appendF(c[h].z).append(" - - - - ").appendI(++g).appendC("\n");this.vwr.openStringInlineParamsAppend(b.toString(),null,!0);this.eval.runScriptBuffer(k.toString(),null);c=this.vwr.getModelUndeletedAtomsBitSet(d);c.andNot(a);return c},"JU.BS,JU.Lst,~A");M(c$,"prevCovalentVersion",1)});C("JS");E(null,"JS.ScriptMathProcessor","java.lang.Float java.util.Arrays $.Hashtable JU.A4 $.AU $.BS $.CU $.DF $.Lst $.M3 $.M4 $.P3 $.P4 $.PT $.Quat $.V3 JM.BondSet JS.SV $.T JU.BSUtil $.Escape $.Logger".split(" "),
function(){c$=H(function(){this.asBitSet=this.wasX=!1;this.oPt=-1;this.debugHigh=this.wasSyntaxCheck=this.chk=!1;this.ifStack=this.xStack=this.oStack=this.vwr=this.eval=null;this.xPt=this.ifPt=-1;this.braceCount=this.squareCount=this.parenCount=0;this.haveSpaceBeforeSquare=this.asVector=this.isArrayItem=!1;this.ptid=this.equalCount=0;this.pto=this.ptx=2147483647;this.isSpecialAssignment=!1;this.doSelections=!0;this.skipping=this.isAssignment=this.allowUnderflow=this.assignLeft=!1;this.lastAssignedString=
null;D(this,arguments)},JS,"ScriptMathProcessor");Q(c$,function(){this.oStack=Array(8);this.xStack=Array(8);this.ifStack=Y(8,"\x00")});G(c$,function(a,b,c,d,e,g,k){this.eval=a;this.isAssignment=(this.isSpecialAssignment=this.assignLeft=b)||null!=k;this.vwr=a.vwr;this.debugHigh=a.debugHigh;this.chk=this.wasSyntaxCheck=a.chk;this.isArrayItem=c;this.asVector=d||c;this.asBitSet=e;this.allowUnderflow=g;this.wasX=c;this.debugHigh&&JU.Logger.debug("initialize RPN")},"JS.ScriptExpr,~B,~B,~B,~B,~B,~S");e(c$,
"endAssignment",function(){return this.doSelections=this.assignLeft=!1});e(c$,"getResult",function(){for(var a=!0;a&&0<=this.oPt&&null!=this.oStack[this.oPt];)a=this.operate();if(a){if(this.asVector){this.isAssignment&&(0<this.xPt&&0>this.oPt||0<=this.oPt&&null!=this.oStack[this.oPt])&&this.eval.invArg();for(var a=new JU.Lst,b=0;b<=this.xPt;b++)a.addLast(this.isSpecialAssignment?this.xStack[b]:JS.SV.selectItemVar(this.xStack[b]));null!=this.lastAssignedString&&(a.remove(0),a.add(0,this.lastAssignedString),
this.lastAssignedString.intValue=this.xStack[0].intValue);return JS.SV.newV(135198,a)}if(0==this.xPt){a=this.xStack[0];if(this.chk)return this.asBitSet?JS.SV.newV(10,new JU.BS):a;if(10==a.tok||7==a.tok||15==a.tok||4==a.tok||11==a.tok||12==a.tok)a=JS.SV.selectItemVar(a);this.asBitSet&&7==a.tok&&(a=JS.SV.newV(10,JS.SV.unEscapeBitSetArray(a.value,!1)));return a}}!this.allowUnderflow&&(0<=this.xPt||0<=this.oPt)&&this.eval.invArg();return null});e(c$,"putX",function(a){if(!this.skipping){if(this.wasX)try{this.addOp(JS.T.tokenComma)}catch(b){if(y(b,
JS.ScriptException))System.out.println("Error adding comma");else throw b;}++this.xPt==this.xStack.length&&(this.xStack=JU.AU.doubleLength(this.xStack));this.xStack[this.xPt]=a;this.ptx=++this.ptid;this.debugHigh&&JU.Logger.debug("\nputx= "+a+" ptx="+this.ptid)}},"JS.SV");e(c$,"putOp",function(a){++this.oPt>=this.oStack.length&&(this.oStack=JU.AU.doubleLength(this.oStack));this.oStack[this.oPt]=a;this.pto=++this.ptid;this.debugHigh&&JU.Logger.debug("\nputop="+a+" pto="+this.ptid)},"JS.T");e(c$,"putIf",
function(a){++this.ifPt>=this.ifStack.length&&(this.ifStack=JU.AU.doubleLength(this.ifStack));this.ifStack[this.ifPt]=a},"~S");e(c$,"addXCopy",function(a){switch(a.tok){case 2:a=JS.SV.newI(a.intValue);break;case 3:a=JS.SV.newV(3,a.value)}return this.addX(a)},"JS.SV");e(c$,"addX",function(a){this.putX(a);return this.wasX=!0},"JS.SV");e(c$,"addXObj",function(a){a=JS.SV.getVariable(a);if(null==a)return!1;this.putX(a);return this.wasX=!0},"~O");e(c$,"addXStr",function(a){this.putX(JS.SV.newS(a));return this.wasX=
!0},"~S");e(c$,"addXBool",function(a){this.putX(JS.SV.getBoolean(a));return this.wasX=!0},"~B");e(c$,"addXInt",function(a){this.putX(JS.SV.newI(a));return this.wasX=!0},"~N");e(c$,"addXList",function(a){this.putX(JS.SV.getVariableList(a));return this.wasX=!0},"JU.Lst");e(c$,"addXMap",function(a){this.putX(JS.SV.getVariableMap(a));return this.wasX=!0},"java.util.Map");e(c$,"addXM3",function(a){this.putX(JS.SV.newV(11,a));return this.wasX=!0},"JU.M3");e(c$,"addXM4",function(a){this.putX(JS.SV.newV(12,
a));return this.wasX=!0},"JU.M4");e(c$,"addXFloat",function(a){if(Float.isNaN(a))return this.addXStr("NaN");this.putX(JS.SV.newV(3,Float.$valueOf(a)));return this.wasX=!0},"~N");e(c$,"addXBs",function(a){this.putX(JS.SV.newV(10,a));return this.wasX=!0},"JU.BS");e(c$,"addXPt",function(a){this.putX(JS.SV.newV(8,a));return this.wasX=!0},"JU.P3");e(c$,"addXPt4",function(a){this.putX(JS.SV.newV(9,a));return this.wasX=!0},"JU.P4");e(c$,"addXNum",function(a){if(!q(a,JS.SV))switch(a.tok){case 3:if(this.wasX){var b=
a.value.floatValue();if(0>b||0==b&&-Infinity==1/b){this.addOp(JS.T.tokenMinus);a=JS.SV.newV(3,Float.$valueOf(-b));break}}a=JS.SV.newV(3,a.value);break;default:a=a.intValue,this.wasX&&0>a&&(this.addOp(JS.T.tokenMinus),a=-a),a=JS.SV.newI(a)}this.putX(a);return this.wasX=!0},"JS.T");e(c$,"addXAV",function(a){this.putX(JS.SV.getVariableAV(a));return this.wasX=!0},"~A");e(c$,"addXAD",function(a){this.putX(JS.SV.getVariableAD(a));return this.wasX=!0},"~A");e(c$,"addXAS",function(a){this.putX(JS.SV.getVariableAS(a));
return this.wasX=!0},"~A");e(c$,"addXAI",function(a){this.putX(JS.SV.getVariableAI(a));return this.wasX=!0},"~A");e(c$,"addXAII",function(a){this.putX(JS.SV.getVariableAII(a));return this.wasX=!0},"~A");e(c$,"addXAF",function(a){this.putX(JS.SV.getVariableAF(a));return this.wasX=!0},"~A");e(c$,"addXAFF",function(a){this.putX(JS.SV.getVariableAFF(a));return this.wasX=!0},"~A");c$.isOpFunc=e(c$,"isOpFunc",function(a){return JS.T.tokAttr(a.tok,135266304)&&a!==JS.T.tokenArraySquare||269484241==a.tok&&
JS.T.tokAttr(a.intValue,135266304)},"JS.T");e(c$,"addOp",function(a){return this.addOpAllowMath(a,!0)},"JS.T");e(c$,"addOpAllowMath",function(a,b){this.debugHigh&&this.dumpStacks("adding "+a+" wasx="+this.wasX);var c=0<=this.oPt&&null!=this.oStack[this.oPt]?this.oStack[this.oPt].tok:0;if(this.skipping=0<=this.ifPt&&("F"==this.ifStack[this.ifPt]||"X"==this.ifStack[this.ifPt]))return this.checkSkip(a,c);var d=269484241==a.tok;if(d&&!this.wasX)return!1;var e=b&&JS.ScriptMathProcessor.isOpFunc(a);1<=
this.oPt&&(269484048!=a.tok&&135266319==c)&&(c=this.oStack[--this.oPt].tok);var g=null,k=!1;switch(a.tok){case 1073742195:return this.haveSpaceBeforeSquare=!0;case 269484080:if(!this.wasX)return!1;break;case 269484225:case 269484226:if(this.wasX&&-1==a.intValue&&this.addOp(JS.T.tokenComma))return this.addOp(a);break;case 269484097:break;case 269484049:if(!this.wasX&&1<=this.oPt&&269484048==c&&!JS.ScriptMathProcessor.isOpFunc(this.oStack[this.oPt-1]))return!1;break;case 269484192:this.wasX||(a=JS.SV.newV(269484224,
"-"));break;case 32:case 64:case 96:case 128:case 160:case 192:case 480:c=0>this.oPt?0:c;if(!this.wasX||!(269484241==c||1678770178==c||1141899265==c))return!1;this.oStack[this.oPt].intValue|=a.tok;return!0;case 269484096:k=!0;if(!this.wasX||this.haveSpaceBeforeSquare)this.squareCount++,a=g=JS.T.tokenArraySquare,this.haveSpaceBeforeSquare=!1;break;case 269484144:case 269484048:k=!0;default:if(e){e=1<=this.oPt&&269484048==c;if(!d&&this.wasX&&!e)return!1;g=a;k=!0;break}if(this.wasX==k&&269484241!=c){if(!this.wasX||
!b)return!1;if(this.addOp(JS.T.tokenComma))return this.addOp(a)}}for(;0<=this.oPt&&269484066!=c&&(269484225!=a.tok&&269484226!=a.tok||this.wasX)&&(!k||269484241==c&&(269484241==a.tok||269484096==a.tok))&&JS.T.getPrecedence(c)>=JS.T.getPrecedence(a.tok)&&(269484224!=c||269484224!=a.tok);){if(269484049==a.tok&&269484048==c){0<=this.xPt&&(this.xStack[this.xPt]=JS.SV.selectItemVar(this.xStack[this.xPt]));this.wasX=!0;break}if(269484097==a.tok&&135266306==c)break;if(269484097==a.tok&&269484096==c){if(this.isArrayItem&&
1==this.squareCount&&0==this.equalCount){this.wasX=!1;this.addX(JS.SV.newT(JS.T.tokenArraySelector));break}if(!this.doSelection())return!1;this.wasX=!0;break}if(!this.operate())return!1;c=0<=this.oPt&&null!=this.oStack[this.oPt]?this.oStack[this.oPt].tok:0}null!=g&&(this.wasX=!1,this.addX(JS.SV.newV(269484436,g)));switch(a.tok){case 269484048:this.parenCount++;this.wasX=!1;break;case 806354977:return d=this.getX().asBoolean(),269484066==c?this.ifPt--:this.putOp(JS.T.tokenColon),this.putIf(d?"T":"F"),
this.skipping=!d,this.wasX=!1,!0;case 269484066:if(269484066!=c||0>this.ifPt)return!1;this.ifStack[this.ifPt]="X";this.wasX=!1;return this.skipping=!0;case 269484049:this.wasX=!0;if(0>=this.parenCount--)return!1;269484066==c&&(this.ifPt--,this.oPt--);this.oPt--;if(0>this.oPt)return!0;if(JS.ScriptMathProcessor.isOpFunc(this.oStack[this.oPt])&&(this.wasX=!1,!this.evaluateFunction(0)))return!1;this.skipping=0<=this.ifPt&&"X"==this.ifStack[this.ifPt];return!0;case 269484080:return this.wasX=!1,!0;case 269484096:this.squareCount++;
this.wasX=!1;break;case 269484097:this.wasX=!0;if(0>=this.squareCount--||0>this.oPt||!this.doSelections)return!this.doSelections;if(135266306==this.oStack[this.oPt].tok)return this.evaluateFunction(269484096);this.oPt--;return!0;case 269484241:this.wasX=!b||!JS.T.tokAttr(a.intValue,135266304);break;case 1048586:this.braceCount++;this.wasX=!1;break;case 1048590:if(0>=this.braceCount--)return!1;this.wasX=!1;break;case 269484128:case 269484112:if(!this.wasSyntaxCheck&&0>this.xPt)return!1;!this.wasSyntaxCheck&&
(10!=this.xStack[this.xPt].tok&&7!=this.xStack[this.xPt].tok)&&(c=this.getX().asBoolean(),this.addX(JS.SV.getBoolean(c)),c==(269484112==a.tok)&&(this.chk=!0,a=269484112==a.tok?JS.T.tokenOrTRUE:JS.T.tokenAndFALSE));this.wasX=!1;break;case 269484226:case 269484225:break;case 269484436:0==this.squareCount&&(this.doSelections=!0,this.assignLeft=!1,this.equalCount++);this.wasX=!1;break;default:this.wasX=!1}this.putOp(a);switch(a.tok){case 269484241:return 135368713==(a.intValue&-481)&&135368713!=a.intValue?
this.evaluateFunction(0):!0;case 269484226:case 269484225:return this.wasX?this.operate():!0}return!0},"JS.T,~B");e(c$,"checkSkip",function(a,b){switch(a.tok){case 269484048:this.putOp(a);break;case 269484066:if(269484066!=b||"X"==this.ifStack[this.ifPt])break;this.ifStack[this.ifPt]="T";this.skipping=this.wasX=!1;break;case 269484049:if(269484048==b){this.oPt--;break}if(269484066!=b){this.putOp(a);break}this.wasX=!0;this.ifPt--;this.oPt-=2;this.skipping=!1}return!0},"JS.T,~N");e(c$,"doSelection",
function(){if(0>this.xPt||0==this.xPt&&!this.isArrayItem)return!1;var a=this.xStack[this.xPt--],b=this.xStack[this.xPt];if((7==b.tok||15==b.tok)&&2147483647!=b.intValue)if(4==a.tok||this.assignLeft&&1==this.squareCount)this.xStack[this.xPt]=b=JS.SV.selectItemTok(b,-2147483648);this.assignLeft&&4!=b.tok&&(this.lastAssignedString=null);switch(b.tok){case 6:case 14:this.doSelections?(a=b.mapValue(JS.SV.sValue(a)),this.xStack[this.xPt]=null==a?JS.SV.newS(""):a):(this.xPt++,this.putOp(null));break;default:b=
JS.SV.newS(JS.SV.sValue(b));case 10:case 15:case 7:case 4:case 11:case 12:this.doSelections||7==b.tok&&2147483647==b.intValue?(this.xStack[this.xPt]=JS.SV.selectItemTok(b,a.asInt()),this.assignLeft&&(4==b.tok&&1==this.squareCount)&&(this.lastAssignedString=b)):this.xPt++,this.doSelections||this.putOp(null)}return!0});e(c$,"dumpStacks",function(a){JU.Logger.debug("\n\n------------------\nRPN stacks: "+a+"\n");for(a=0;a<=this.xPt;a++)JU.Logger.debug("x["+a+"]: "+this.xStack[a]);JU.Logger.debug("\n");
for(a=0;a<=this.oPt;a++)JU.Logger.debug("o["+a+"]: "+this.oStack[a]+" prec="+(null==this.oStack[a]?"--":""+JS.T.getPrecedence(this.oStack[a].tok)));JU.Logger.debug(" ifStack = "+String.instantialize(this.ifStack).substring(0,this.ifPt+1))},"~S");e(c$,"getX",function(){0>this.xPt&&this.eval.error(13);var a=JS.SV.selectItemVar(this.xStack[this.xPt]);this.xStack[this.xPt--]=null;this.wasX=!1;return a});e(c$,"evaluateFunction",function(a){var b=this.oStack[this.oPt--];0==a&&(a=269484241==b.tok?b.intValue&
-481:b.tok);for(var c=JS.T.getMaxMathParams(a),d=0,e=this.xPt;0<=e&&this.xStack[e--].value!==b;)d++;if(0<c&&d>c)return!1;for(c=Array(d);0<=--d;)c[d]=this.getX();this.xPt--;if(!this.chk)return this.getMathExt().evaluate(this,b,c,a);269484241==b.tok&&this.xPt--;return this.addXBool(!0)},"~N");e(c$,"operate",function(){var a=this.oStack[this.oPt--],b;this.debugHigh&&this.dumpStacks("operate: "+a);if(269484436==a.tok&&(this.isArrayItem&&0==this.squareCount&&1==this.equalCount&&0>this.oPt||0<=this.oPt&&
null==this.oStack[this.oPt]))return!0;var c=this.getX();if(c===JS.T.tokenArraySelector)return!1;switch(a.tok){case 269484225:case 269484226:b=c;if(!this.chk){this.ptx<this.pto&&(b=JS.SV.newS("").setv(c));if(!c.increment(269484226==a.tok?1:-1))return!1;this.ptx>this.pto&&(b=JS.SV.newS("").setv(c))}this.wasX=!1;this.putX(b);return this.wasX=!0;case 269484224:switch(c.tok){case 2:return this.addXInt(-c.asInt());case 8:return a=JU.P3.newP(c.value),a.scale(-1),this.addXPt(a);case 9:return a=JU.P4.newPt(c.value),
a.scale4(-1),this.addXPt4(a);case 11:return a=JU.M3.newM3(c.value),a.transpose(),this.addXM3(a);case 12:return a=JU.M4.newM4(c.value),a.transpose(),this.addXM4(a);case 10:return this.addXBs(JU.BSUtil.copyInvert(JS.SV.bsSelectVar(c),q(c.value,JM.BondSet)?this.vwr.ms.bondCount:this.vwr.ms.ac))}return this.addXFloat(-c.asFloat());case 269484144:if(this.chk)return this.addXBool(!0);switch(c.tok){case 9:return this.addXPt4(JU.Quat.newP4(c.value).inv().toPoint4f());case 11:return a=JU.M3.newM3(c.value),
a.invert(),this.addXM3(a);case 12:return this.addXM4(JU.M4.newM4(c.value).invert());case 10:return this.addXBs(JU.BSUtil.copyInvert(JS.SV.bsSelectVar(c),q(c.value,JM.BondSet)?this.vwr.ms.bondCount:this.vwr.ms.ac));default:return this.addXBool(!c.asBoolean())}case 269484241:b=a.intValue&-481;if(this.chk)return this.addXObj(JS.SV.newS(""));if(this.vwr.allowArrayDotNotation)switch(c.tok){case 6:case 14:switch(b){case 1141899272:case 1141899282:case 1141899270:break;default:return a=c.mapValue(a.value),
this.addXObj(null==a?JS.SV.newS(""):a)}}switch(b){case 1073741824:return 10==c.tok&&this.getAllProperties(c,a.value);case 1141899272:return this.addXStr(JS.ScriptMathProcessor.typeOf(c));case 1141899282:return this.getKeys(c,480==(a.intValue&480));case 1141899267:case 1276117012:case 1141899270:if(1141899267==b&&q(c.value,JM.BondSet))break;return this.addXInt(JS.SV.sizeOf(c));case 1141899268:switch(c.tok){case 11:case 12:a=JS.SV.sValue(c);a=JU.PT.rep(a.substring(1,a.length-1),"],[","]\n[");break;
case 4:a=c.value;break;default:a=JS.SV.sValue(c)}a=JU.PT.rep(a,"\n\r","\n").$replace("\r","\n");return this.addXAS(JU.PT.split(a,"\n"));case 1766856708:switch(c.tok){case 4:case 7:return this.addXPt(JU.CU.colorPtFromString(JS.SV.sValue(c)));case 2:case 3:return this.addXPt(this.vwr.getColorPointForPropertyValue(JS.SV.fValue(c)));case 8:return this.addXStr(JU.Escape.escapeColor(JU.CU.colorPtToFFRGB(c.value)))}break;case 1679429641:return this.chk?this.addXStr("x"):this.getBoundBox(c)}if(this.chk)return this.addXStr(JS.SV.sValue(c));
if(4==c.tok&&(c=JS.SV.unescapePointOrBitsetAsVariable(JS.SV.sValue(c)),!q(c,JS.SV)))return!1;a.tok==c.tok&&(c=this.getX());return this.getPointOrBitsetOperation(a,c)}b=this.getX();if(this.chk){if(a===JS.T.tokenAndFALSE||a===JS.T.tokenOrTRUE)this.chk=!1;return this.addX(JS.SV.newT(b))}return this.binaryOp(a,b,c)});e(c$,"getKeys",function(a,b){switch(a.tok){case 6:case 14:case 7:break;default:return this.addXStr("")}var c=new JU.Lst;this.getKeyList(a,b,c,"");c=c.toArray(Array(c.size()));java.util.Arrays.sort(c);
return this.addXAS(c)},"JS.SV,~B");e(c$,"getKeyList",function(a,b,c,d){var e=a.getMap();if(null==e){if(b){var g,k;null!=(g=a.getList())&&0<(k=g.size())&&this.getKeyList(g.get(k-1),!0,c,d+k+".")}}else{var h;for(a=e.entrySet().iterator();a.hasNext()&&((h=a.next())||1);){e=h.getKey();if(b&&(0==e.length||!JU.PT.isLetter(e.charAt(0))))d.endsWith(".")&&(d=d.substring(0,d.length-1)),e="["+JU.PT.esc(e)+"]";c.addLast(d+e);b&&this.getKeyList(h.getValue(),!0,c,d+e+".")}}},"JS.SV,~B,JU.Lst,~S");e(c$,"binaryOp",
function(a,b,c){var d;switch(a.tok){case 269484160:case 269484128:switch(b.tok){case 10:switch(a=JS.SV.bsSelectVar(b),c.tok){case 2:var e=c.asInt();return this.addXBool(0>e?!1:a.get(e));case 10:return a=JU.BSUtil.copy(a),a.and(JS.SV.bsSelectVar(c)),this.addXBs(a)}}return this.addXBool(b.asBoolean()&&c.asBoolean());case 269484112:switch(b.tok){case 10:a=JU.BSUtil.copy(JS.SV.bsSelectVar(b));switch(c.tok){case 10:return a.or(JS.SV.bsSelectVar(c)),this.addXBs(a);case 2:e=c.asInt();if(0>e)break;a.set(e);
return this.addXBs(a);case 7:e=c.value;for(c=e.size();0<=--c;)b=e.get(c).asInt(),0<=b&&a.set(b);return this.addXBs(a)}break;case 7:return this.addX(JS.SV.concatList(b,c,!1))}return this.addXBool(b.asBoolean()||c.asBoolean());case 269484113:if(10==b.tok&&10==c.tok)return a=JU.BSUtil.copy(JS.SV.bsSelectVar(b)),a.xor(JS.SV.bsSelectVar(c)),this.addXBs(a);a=b.asBoolean();b=c.asBoolean();return this.addXBool(a&&!b||b&&!a);case 269484114:return 10!=b.tok||10!=c.tok?!1:this.addXBs(JU.BSUtil.toggleInPlace(JU.BSUtil.copy(JS.SV.bsSelectVar(b)),
JS.SV.bsSelectVar(c)));case 269484434:return this.addXBool(b.asFloat()<=c.asFloat());case 269484433:return this.addXBool(b.asFloat()>=c.asFloat());case 269484432:return this.addXBool(b.asFloat()>c.asFloat());case 269484435:return this.addXBool(b.asFloat()<c.asFloat());case 269484436:return this.addXBool(JS.SV.areEqual(b,c));case 269484437:return this.addXBool(!JS.SV.areEqual(b,c));case 269484438:return this.addXBool(JS.SV.isLike(b,c));case 269484193:switch(b.tok){case 2:if(!this.isDecimal(c))return this.addXInt(b.intValue+
c.asInt());break;case 4:return this.addX(JS.SV.newS(JS.SV.sValue(b)+JS.SV.sValue(c)));case 8:switch(a=JU.P3.newP(b.value),c.tok){case 8:return a.add(c.value),this.addXPt(a);case 9:return d=c.value,a.add(JU.P3.new3(d.x,d.y,d.z)),this.addXPt(a);default:return d=c.asFloat(),this.addXPt(JU.P3.new3(a.x+d,a.y+d,a.z+d))}case 11:switch(c.tok){default:return this.addXFloat(b.asFloat()+c.asFloat());case 11:return b=JU.M3.newM3(b.value),b.add(c.value),this.addXM3(b);case 8:return this.addXM4(JS.ScriptMathProcessor.getMatrix4f(b.value,
c.value))}case 9:switch(b=JU.Quat.newP4(b.value),c.tok){default:return this.addXPt4(b.add(c.asFloat()).toPoint4f());case 9:return this.addXPt4(b.mulQ(JU.Quat.newP4(c.value)).toPoint4f())}case 7:return this.addX(JS.SV.concatList(b,c,!0))}return this.addXFloat(b.asFloat()+c.asFloat());case 269484192:switch(b.tok){case 2:if(!this.isDecimal(c))return this.addXInt(b.intValue-c.asInt());break;case 4:if(!this.isDecimal(c)&&!this.isDecimal(b))return this.addXInt(b.asInt()-c.asInt());break;case 6:return b=
new java.util.Hashtable(b.value),b.remove(JS.SV.sValue(c)),this.addX(JS.SV.getVariableMap(b));case 11:if(11!=c.tok)break;b=JU.M3.newM3(b.value);b.sub(c.value);return this.addXM3(b);case 12:if(12!=c.tok)break;b=JU.M4.newM4(b.value);b.sub(c.value);return this.addXM4(b);case 8:a=JU.P3.newP(b.value);switch(c.tok){case 8:return a.sub(c.value),this.addXPt(a);case 9:return d=c.value,a.sub(JU.P3.new3(d.x,d.y,d.z)),this.addXPt(a)}d=c.asFloat();return this.addXPt(JU.P3.new3(a.x-d,a.y-d,a.z-d));case 9:return b=
JU.Quat.newP4(b.value),9==c.tok?(c=JU.Quat.newP4(c.value),this.addXPt4(c.mulQ(b.inv()).toPoint4f())):this.addXPt4(b.add(-c.asFloat()).toPoint4f())}return this.addXFloat(b.asFloat()-c.asFloat());case 1276117508:if(8==b.tok&&8==c.tok)return a=b.value,c=c.value,this.addXPt(JU.P3.new3(a.x*c.x,a.y*c.y,a.z*c.z));case 269484209:switch(b.tok){case 2:return this.isDecimal(c)?this.addXFloat(b.intValue*c.asFloat()):this.addXInt(b.intValue*c.asInt());case 4:return this.isDecimal(c)||this.isDecimal(b)?this.addXFloat(b.asFloat()*
c.asFloat()):this.addXInt(b.asInt()*c.asInt())}a=11==b.tok?this.ptValue(c,!1):11==c.tok?this.ptValue(b,!1):null;d=12==b.tok?this.planeValue(c):12==c.tok?this.planeValue(b):null;switch(c.tok){case 11:if(null!=a)return c=JU.M3.newM3(c.value),c.transpose(),c.rotate(a),7==b.tok?this.addX(JS.SV.getVariableAF([a.x,a.y,a.z])):this.addXPt(a);if(null!=d)return this.addXPt4(JU.Quat.newP4(d).mulQ(JU.Quat.newM(c.value)).toPoint4f());break;case 12:if(null!=d)return c=JU.M4.newM4(c.value),c.transpose(),c.transform(d),
7==b.tok?this.addX(JS.SV.getVariableAF([d.x,d.y,d.z,d.w])):this.addXPt4(d)}switch(b.tok){case 11:e=b.value;if(null!=a)return e.rotate(a),7==c.tok?this.addX(JS.SV.getVariableAF([a.x,a.y,a.z])):this.addXPt(a);switch(c.tok){case 11:return b=JU.M3.newM3(c.value),b.mul2(e,b),this.addXM3(b);case 9:return this.addXM3(JU.Quat.newM(e).mulQ(JU.Quat.newP4(c.value)).getMatrix())}d=c.asFloat();c=new JU.A4;c.setM(e);c.angle*=d;return this.addXM3((new JU.M3).setAA(c));case 12:return b=b.value,null!=a?(b.rotTrans(a),
7==c.tok?this.addX(JS.SV.getVariableAF([a.x,a.y,a.z])):this.addXPt(a)):null!=d?(b.transform(d),7==c.tok?this.addX(JS.SV.getVariableAF([d.x,d.y,d.z,d.w])):this.addXPt4(d)):12==c.tok?(c=JU.M4.newM4(c.value),c.mul2(b,c),this.addXM4(c)):this.addXStr("NaN");case 8:a=JU.P3.newP(b.value);switch(c.tok){case 8:return c=c.value,this.addXFloat(a.x*c.x+a.y*c.y+a.z*c.z)}d=c.asFloat();return this.addXPt(JU.P3.new3(a.x*d,a.y*d,a.z*d));case 9:return 9==c.tok?this.addXPt4(JU.Quat.newP4(b.value).mulQ(JU.Quat.newP4(c.value)).toPoint4f()):
this.addXPt4(JU.Quat.newP4(b.value).mul(c.asFloat()).toPoint4f())}return this.addXFloat(b.asFloat()*c.asFloat());case 269484208:switch(b.tok){case 2:if(2==c.tok&&0!=c.intValue)return this.addXInt(I(b.intValue/c.intValue));e=this.isDecimal(c)?0:c.asInt();if(0!=e)return this.addXInt(I(b.intValue/e));break;case 4:if(!this.isDecimal(b)&&!this.isDecimal(c)&&0!=(d=c.asInt()))return this.addXInt(I(b.asInt()/d));break;case 8:return a=JU.P3.newP(b.value),this.addXPt(0==(e=c.asFloat())?JU.P3.new3(NaN,NaN,NaN):
JU.P3.new3(a.x/e,a.y/e,a.z/e));case 9:return this.addXPt4(9==c.tok?JU.Quat.newP4(b.value).div(JU.Quat.newP4(c.value)).toPoint4f():0==(e=c.asFloat())?JU.P4.new4(NaN,NaN,NaN,NaN):JU.Quat.newP4(b.value).mul(1/e).toPoint4f())}return this.addXFloat(b.asFloat()/c.asFloat());case 269484211:return d=c.asFloat(),9==b.tok?0==d?this.addXPt4(JU.P4.new4(NaN,NaN,NaN,NaN)):9==c.tok?this.addXPt4(JU.Quat.newP4(b.value).divLeft(JU.Quat.newP4(c.value)).toPoint4f()):this.addXPt4(JU.Quat.newP4(b.value).mul(1/d).toPoint4f()):
this.addXInt(0==d?0:I(Math.floor(b.asFloat()/c.asFloat())));case 269484227:return d=Math.pow(b.asFloat(),c.asFloat()),2==b.tok&&2==c.tok?this.addXInt(B(d)):this.addXFloat(d);case 269484210:a=null;e=c.asInt();switch(b.tok){case 3:d=b.asFloat();if(0==e)return this.addXInt(Math.round(d));a=JU.DF.formatDecimal(d,e);return this.addXStr(a);case 4:return a=b.value,0==e?this.addXStr(JU.PT.trim(a,"\n\t ")):9999==e?this.addXStr(a.toUpperCase()):-9999==e?this.addXStr(a.toLowerCase()):0<e?this.addXStr(JU.PT.formatS(a,
e,e,!1,!1)):this.addXStr(JU.PT.formatS(a,e,e-1,!0,!1));case 7:b=JS.SV.strListValue(b);for(c=0;c<b.length;c++)b[c]=0==e?b[c].trim():0<e?JU.PT.formatS(b[c],e,e,!0,!1):JU.PT.formatS(a,-e,e,!1,!1);return this.addXAS(b);case 8:return a=JU.P3.newP(b.value),this.vwr.toUnitCell(a,JU.P3.new3(e,e,e)),this.addXPt(a);case 9:d=b.value;if(8==c.tok)return this.addXPt(JU.Quat.newP4(d).transform2(c.value,new JU.P3));if(9==c.tok)return c=JU.P4.newPt(c.value),JU.Quat.newP4(d).getThetaDirected(c),this.addXPt4(c);0==
e&&4==c.tok&&(a=" "+c.value.toString().trim().toLowerCase()+":",c=" w:0 x:1 y:2 z:3 normal:4 eulerzxz:5 eulerzyz:6 vector:-1 theta:-2 axisx:-3 axisy:-4 axisz:-5 axisangle:-6 matrix:-9".indexOf(a),e=0<=c?JU.PT.parseInt(" w:0 x:1 y:2 z:3 normal:4 eulerzxz:5 eulerzyz:6 vector:-1 theta:-2 axisx:-3 axisy:-4 axisz:-5 axisangle:-6 matrix:-9".substring(c+a.length)):-99);switch(e){case 0:return this.addXFloat(d.w);case 1:return this.addXFloat(d.x);case 2:return this.addXFloat(d.y);case 3:return this.addXFloat(d.z)}c=
JU.Quat.newP4(d);switch(e){case 4:return this.addXPt(JU.P3.newP(c.getNormal()));case 5:return this.addXAF(c.getEulerZXZ());case 6:return this.addXAF(c.getEulerZYZ());case -1:return this.addXPt(JU.P3.newP(c.getVector(-1)));case -2:return this.addXFloat(c.getTheta());case -3:return this.addXPt(JU.P3.newP(c.getVector(0)));case -4:return this.addXPt(JU.P3.newP(c.getVector(1)));case -5:return this.addXPt(JU.P3.newP(c.getVector(2)));case -6:return c=c.toAxisAngle4f(),this.addXPt4(JU.P4.new4(c.x,c.y,c.z,
180*c.angle/3.141592653589793));case -9:return this.addXM3(c.getMatrix());default:return this.addXStr("NaN")}case 12:switch(b=b.value,e){case 1:return e=new JU.M3,b.getRotationScale(e),this.addXM3(e);case 2:return c=new JU.V3,b.getTranslation(c),this.addXPt(JU.P3.newP(c));default:return!1}case 10:return this.addXBs(JS.SV.bsSelectRange(b,e))}return this.addXInt(0==e?0:b.asInt()%e)}return!0},"JS.T,JS.SV,JS.SV");e(c$,"isDecimal",function(a){var b;return 3==a.tok||4==a.tok&&(0<=(b=JS.SV.sValue(a).trim()).indexOf(".")||
0<b.indexOf("+")||0<b.lastIndexOf("-"))},"JS.SV");e(c$,"ptValue",function(a,b){var c;if(this.chk)return new JU.P3;switch(a.tok){case 8:return a.value;case 10:return this.eval.getBitsetProperty(JS.SV.bsSelectVar(a),1146095626,null,null,a.value,null,!1,2147483647,!1);case 4:c=JU.Escape.uP(JS.SV.sValue(a));if(q(c,JU.P3))return c;break;case 7:if(c=JU.Escape.uP("{"+JS.SV.sValue(a).$replace("]"," ").$replace("["," ")+"}"),q(c,JU.P3))return c}if(!b)return null;c=JS.SV.fValue(a);return JU.P3.new3(c,c,c)},
"JS.SV,~B");e(c$,"planeValue",function(a){if(this.chk)return new JU.P4;switch(a.tok){case 9:return a.value;case 7:case 4:return a=JU.Escape.uP(JS.SV.sValue(a)),q(a,JU.P4)?a:null}return null},"JS.T");c$.typeOf=e(c$,"typeOf",function(a){var b=null==a?0:a.tok;switch(b){case 1048589:case 1048588:return"boolean";case 10:return q(a.value,JM.BondSet)?"bondset":"bitset";case 2:case 3:case 8:case 9:case 4:case 7:case 6:case 15:case 11:case 12:case 14:return JS.T.astrType[b]}return"?"},"JS.SV");e(c$,"getAllProperties",
function(a,b){if(this.chk)return this.addXStr("");var c=JS.SV.bsSelectVar(a),d,e=c.cardinality();if(0==e||!b.endsWith("?")||null==(d=JS.T.getAtomPropertiesLike(b.substring(0,b.length-1))))return this.addXStr("");for(var g=new java.util.Hashtable,e=1==e?c.nextSetBit(0):2147483647,k=d.size();0<=--k;){var h=d.get(k),n=h.tok;switch(n){case 1095766024:case 1095761925:continue;default:2147483647==e&&(n|=480),g.put(h.value,JS.SV.getVariable(this.eval.getBitsetProperty(c,n,null,null,null,null,!1,e,!0)))}}return this.addXMap(g)},
"JS.SV,~S");c$.getMatrix4f=e(c$,"getMatrix4f",function(a,b){return JU.M4.newMV(a,null==b?new JU.V3:JU.V3.newV(b))},"JU.M3,JU.T3");e(c$,"getBoundBox",function(a){if(10!=a.tok)return!1;if(this.chk)return this.addXStr("");a=this.vwr.ms.getBoxInfo(JS.SV.bsSelectVar(a),1).getBoundBoxPoints(!0);for(var b=new JU.Lst,c=0;4>c;c++)b.addLast(a[c]);return this.addXList(b)},"JS.SV");e(c$,"getPointOrBitsetOperation",function(a,b){switch(b.tok){case 7:switch(a.intValue){case 32:case 64:case 96:case 192:case 128:case 160:return this.addXObj(this.getMathExt().getMinMax(b.getList(),
a.intValue));case 1276383249:return this.addX(b.pushPop(null,null));case 1276117011:case 1141899269:return this.addX(b.sortOrReverse(1141899269==a.intValue?-2147483648:1))}for(var c=Array(b.getList().size()),d=0;d<c.length;d++){var e=JS.SV.unescapePointOrBitsetAsVariable(b.getList().get(d));if(!q(e,JS.SV)||!this.getPointOrBitsetOperation(a,e))return!1;c[d]=this.xStack[this.xPt--]}return this.addXAV(c);case 8:switch(a.intValue){case 1112541185:case 1112541205:return this.addXFloat(b.value.x);case 1112541186:case 1112541206:return this.addXFloat(b.value.y);
case 1112541187:case 1112541207:return this.addXFloat(b.value.z);case 1146095626:return c=JU.P3.newP(b.value),this.vwr.toCartesian(c,!0),this.addXPt(c);case 1112541188:case 1112541189:case 1112541190:case 1146095627:return c=JU.P3.newP(b.value),this.vwr.toFractional(c,!0),1146095627==a.intValue?this.addXPt(c):this.addXFloat(1112541188==a.intValue?c.x:1112541189==a.intValue?c.y:c.z);case 1112541191:case 1112541192:case 1112541193:case 1146095629:return c=JU.P3.newP(b.value),this.vwr.toFractional(c,
!1),1146095629==a.intValue?this.addXPt(c):this.addXFloat(1112541191==a.intValue?c.x:1112541192==a.intValue?c.y:c.z);case 1112539153:case 1112539154:case 1112539155:case 1146093582:return c=JU.P3.newP(b.value),this.vwr.toUnitCell(c,null),this.vwr.toFractional(c,!1),1146093582==a.intValue?this.addXPt(c):this.addXFloat(1112539153==a.intValue?c.x:1112539154==a.intValue?c.y:c.z)}break;case 9:switch(a.intValue){case 1112541185:case 1112541205:return this.addXFloat(b.value.x);case 1112541186:case 1112541206:return this.addXFloat(b.value.y);
case 1112541187:case 1112541207:return this.addXFloat(b.value.z);case 1141899281:return this.addXFloat(b.value.w)}break;case 10:if(1678770178==a.intValue&&q(b.value,JM.BondSet))return this.addX(b);c=JS.SV.bsSelectVar(b);1==c.cardinality()&&0==(a.intValue&480)&&(a.intValue|=32);d=this.eval.getBitsetProperty(c,a.intValue,null,null,b.value,a.value,!1,b.index,!0);return 1678770178!=a.intValue?this.addXObj(d):this.addX(JS.SV.newV(10,JM.BondSet.newBS(d,this.vwr.ms.getAtomIndices(c))))}return!1},"JS.T,JS.SV");
e(c$,"getMathExt",function(){return this.eval.getMathExt()});e(c$,"evalOp",function(a){return!this.addOp(a)||!this.operate()?null:this.xStack[this.xPt--]},"JS.T");M(c$,"qMods"," w:0 x:1 y:2 z:3 normal:4 eulerzxz:5 eulerzyz:6 vector:-1 theta:-2 axisx:-3 axisy:-4 axisz:-5 axisangle:-6 matrix:-9")});C("JS");E(["J.api.JmolParallelProcessor","JS.ScriptFunction","JU.Lst"],"JS.ScriptParallelProcessor","java.util.concurrent.Executors JS.ScriptProcess $.ScriptProcessRunnable JU.Logger JV.ShapeManager $.Viewer".split(" "),
function(){c$=H(function(){this.vwr=null;this.counter=0;this.processes=this.lock=this.error=null;D(this,arguments)},JS,"ScriptParallelProcessor",JS.ScriptFunction,J.api.JmolParallelProcessor);Q(c$,function(){this.lock=new U._O;this.processes=new JU.Lst});G(c$,function(){S(this,JS.ScriptParallelProcessor,[])});p(c$,"getExecutor",function(){return java.util.concurrent.Executors.newCachedThreadPool()});p(c$,"runAllProcesses",function(a){if(0!=this.processes.size()){this.vwr=a;var b=!a.isParallel()&&
a.setParallel(!0),c=new JU.Lst;this.error=null;this.counter=0;JU.Logger.debugging&&JU.Logger.debug("running "+this.processes.size()+" processes on "+JV.Viewer.nProcessors+" processesors inParallel="+b);this.counter=this.processes.size();for(var d=this.processes.size();0<=--d;){var e=null;b&&(e=new JV.ShapeManager(a),e.setParallel(),c.addLast(e));this.runProcess(this.processes.remove(0),e)}for(;0<this.counter;){try{this.lock.wait()}catch(g){if(!y(g,InterruptedException))throw g;}if(null!=this.error)throw this.error;
}this.mergeResults(c);a.setParallel(!1)}},"JV.Viewer");e(c$,"mergeResults",function(a){try{for(var b=0;b<a.size();b++)this.vwr.shm.mergeShapes(a.get(b).getShapes())}catch(c){throw y(c,Error),c;}finally{this.counter=-1}},"JU.Lst");e(c$,"clearShapeManager",function(a){this.error=a;this.notifyAll()},"Error");p(c$,"addProcess",function(a,b){this.processes.addLast(new JS.ScriptProcess(a,b))},"~S,JS.ScriptContext");e(c$,"runProcess",function(a,b){var c=new JS.ScriptProcessRunnable(this,a,this.lock,b),d=
null==b?null:this.vwr.getExecutor();null!=d?d.execute(c):c.run()},"JS.ScriptProcess,JV.ShapeManager");e(c$,"eval",function(a,b){this.vwr.evalParallel(a,b)},"JS.ScriptContext,JV.ShapeManager")});C("JS");E(["JS.ScriptError"],"JS.ScriptParam","java.lang.Float JU.CU $.Lst $.Measure $.P3 $.P4 $.PT $.Quat $.SB $.V3 JM.TickInfo JS.SV $.T JU.Edge $.Escape $.Logger".split(" "),function(){c$=H(function(){this.thisContext=this.contextVariables=null;this.theTok=this.iToken=0;this.st=this.theToken=null;this.slen=
0;this.fractionalPoint=null;this.isBondSet=this.coordinatesAreFractional=!1;this.expressionResult=null;D(this,arguments)},JS,"ScriptParam",JS.ScriptError);e(c$,"getToken",function(a){this.checkToken(a)||this.error(13);this.theToken=this.st[a];this.theTok=this.theToken.tok;return this.theToken},"~N");e(c$,"tokAt",function(a){return a<this.slen&&null!=this.st[a]?this.st[a].tok:0},"~N");e(c$,"checkToken",function(a){return(this.iToken=a)<this.slen},"~N");e(c$,"getParameter",function(a,b,c){var d=this.getContextVariableAsVariable(a);
if(null==d)if(c)d=this.vwr.getP(a);else if(null==(d=this.vwr.getPOrNull(a)))return null;switch(b){case 1073742190:return JS.SV.getVariable(d);case 4:if(!q(d,JU.Lst))break;a=d;b=new JU.SB;for(c=0;c<a.size();c++)b.append(a.get(c).asString()).appendC("\n");return b.toString()}return q(d,JS.SV)?JS.SV.oValue(d):d},"~S,~N,~B");e(c$,"getStringParameter",function(a,b){var c=this.getContextVariableAsVariable(a);if(null!=c)return c.asString();c=""+this.vwr.getP(a);return 0==c.length&&b?a:c},"~S,~B");e(c$,"getContextVariableAsVariable",
function(a){if(a.equals("expressionBegin"))return null;a=a.toLowerCase();return null!=this.contextVariables&&this.contextVariables.containsKey(a)?this.contextVariables.get(a):null==this.thisContext?null:this.thisContext.getVariable(a)},"~S");e(c$,"paramAsStr",function(a){this.getToken(a);null==this.theToken&&this.error(13);return JS.SV.sValue(this.theToken)},"~N");e(c$,"stringParameter",function(a){(!this.checkToken(a)||4!=this.getToken(a).tok)&&this.error(41);return this.theToken.value},"~N");e(c$,
"stringParameterSet",function(a){switch(this.tokAt(a)){case 4:var b=this.stringParameter(a);return b.startsWith('["')&&(a=this.vwr.evaluateExpression(b),q(a,String))?JU.PT.split(a,"\n"):[b];case 1073742195:a+=2;break;case 269484096:++a;break;case 7:return JS.SV.strListValue(this.getToken(a));default:this.invArg()}for(var c,b=new JU.Lst;269484097!=(c=this.tokAt(a));){switch(c){case 269484080:break;case 4:b.addLast(this.stringParameter(a));break;default:case 0:this.invArg()}a++}this.iToken=a;a=b.size();
c=Array(a);for(var d=0;d<a;d++)c[d]=b.get(d);return c},"~N");e(c$,"objectNameParameter",function(a){this.checkToken(a)||this.error(37);return this.paramAsStr(a)},"~N");e(c$,"atomCenterOrCoordinateParameter",function(a){switch(this.getToken(a).tok){case 10:case 1048577:a=this.atomExpression(this.st,a,0,!0,!1,!1,!0);if(null!=a&&1==a.cardinality())return this.vwr.ms.at[a.nextSetBit(0)];if(null!=a)return this.vwr.ms.getAtomSetCenter(a);if(q(this.expressionResult,JU.P3))return this.expressionResult;this.invArg();
break;case 1048586:case 8:return this.getPoint3f(a,!0)}this.invArg();return null},"~N");e(c$,"isCenterParameter",function(a){a=this.tokAt(a);return 1048582==a||1048586==a||1048577==a||8==a||10==a},"~N");e(c$,"centerParameter",function(a){return this.centerParameterForModel(a,-2147483648)},"~N");e(c$,"centerParameterForModel",function(a,b){var c=null;this.expressionResult=null;if(this.checkToken(a))switch(this.getToken(a).tok){case 1048582:var d=this.objectNameParameter(++a),c=-2147483648;269484096==
this.tokAt(a+1)&&(c=this.parameterExpressionList(-a-1,-1,!0).get(0).asInt(),269484097!=this.getToken(--this.iToken).tok&&this.invArg());if(this.chk)return new JU.P3;if(1048583==this.tokAt(a+1)&&(1141899267==this.tokAt(a+2)||1141899270==this.tokAt(a+2)))c=2147483647,this.iToken=a+2;null==(c=this.getObjectCenter(d,c,b))&&this.errorStr(12,d);break;case 10:case 1048577:case 1048586:case 8:c=this.atomCenterOrCoordinateParameter(a)}null==c&&this.error(11);return c},"~N,~N");e(c$,"planeParameter",function(a){var b=
new JU.V3,c=new JU.V3,d=null;135266319==this.tokAt(a)&&a++;var e=269484192==this.tokAt(a);e&&a++;if(a<this.slen)switch(this.getToken(a).tok){case 9:d=JU.P4.newPt(this.theToken.value);break;case 1048582:d=this.objectNameParameter(++a);if(this.chk)return new JU.P4;d=this.getPlaneForObject(d,b);break;case 1112541205:(!this.checkToken(++a)||269484436!=this.getToken(a++).tok)&&this.evalError("x=?",null);d=JU.P4.new4(1,0,0,-this.floatParameter(a));break;case 1112541206:(!this.checkToken(++a)||269484436!=
this.getToken(a++).tok)&&this.evalError("y=?",null);d=JU.P4.new4(0,1,0,-this.floatParameter(a));break;case 1112541207:(!this.checkToken(++a)||269484436!=this.getToken(a++).tok)&&this.evalError("z=?",null);d=JU.P4.new4(0,0,1,-this.floatParameter(a));break;case 1073741824:case 4:b=this.paramAsStr(a);b.equalsIgnoreCase("xy")?d=JU.P4.new4(0,0,e?-1:1,0):b.equalsIgnoreCase("xz")?d=JU.P4.new4(0,e?-1:1,0,0):b.equalsIgnoreCase("yz")&&(d=JU.P4.new4(e?-1:1,0,0,0));break;case 1048586:case 8:if(!this.isPoint3f(a)){d=
this.getPoint4f(a);break}case 10:case 1048577:a=this.atomCenterOrCoordinateParameter(a);269484080==this.getToken(++this.iToken).tok&&++this.iToken;var g=this.atomCenterOrCoordinateParameter(this.iToken);269484080==this.getToken(++this.iToken).tok&&++this.iToken;if(this.isFloatParameter(this.iToken)){var k=this.floatParameter(this.iToken),d=new JU.P4;b.sub2(g,a);b.scale(2*k);JU.Measure.getBisectingPlane(a,b,c,b,d)}else d=this.atomCenterOrCoordinateParameter(this.iToken),c=new JU.V3,b=JU.Measure.getNormalThroughPoints(a,
g,d,c,b),d=new JU.P4,d.set4(c.x,c.y,c.z,b);!this.chk&&JU.Logger.debugging&&JU.Logger.debug(" defined plane: "+d)}null==d&&this.errorMore(38,"{a b c d}",'"xy" "xz" "yz" "x=..." "y=..." "z=..."',"$xxxxx");e&&d.scale4(-1);return d},"~N");e(c$,"hklParameter",function(a){!this.chk&&null==this.vwr.getCurrentUnitCell()&&this.error(33);a=this.getPointOrPlane(a,!1,!0,!1,!0,3,3);a=this.getHklPlane(a);null==a&&this.error(3);!this.chk&&JU.Logger.debugging&&JU.Logger.debug("defined plane: "+a);return a},"~N");
e(c$,"getHklPlane",function(a){var b=JU.P3.new3(0==a.x?1:1/a.x,0,0),c=JU.P3.new3(0,0==a.y?1:1/a.y,0),d=JU.P3.new3(0,0,0==a.z?1:1/a.z);if(0==a.x&&0==a.y&&0==a.z)return null;0==a.x&&0==a.y?(b.set(1,0,d.z),c.set(0,1,d.z)):0==a.y&&0==a.z?(c.set(b.x,0,1),d.set(b.x,1,0)):0==a.z&&0==a.x?(d.set(0,c.y,1),b.set(1,c.y,0)):0==a.x?b.set(1,c.y,0):0==a.y?c.set(0,1,d.z):0==a.z&&d.set(b.x,0,1);this.vwr.toCartesian(b,!1);this.vwr.toCartesian(c,!1);this.vwr.toCartesian(d,!1);return JU.Measure.getPlaneThroughPoints(b,
c,d,new JU.V3,new JU.V3,new JU.P4)},"JU.P3");e(c$,"getPointOrPlane",function(a,b,c,d,e,g,k){var h=N(6,0),n=0;this.coordinatesAreFractional=e;if(8==this.tokAt(a)){if(3>=g&&3<=k)return this.getToken(a).value;this.invArg()}if(9==this.tokAt(a)){if(4>=g&&4<=k)return this.getToken(a).value;this.invArg()}e=1;a:for(;a<this.st.length;a++)switch(this.getToken(a).tok){case 1048586:case 269484080:case 269484128:case 269484160:break;case 1048590:break a;case 269484192:e=-1;break;case 1048615:6==n&&this.invArg();
h[n++]=this.theToken.intValue;e=-1;break;case 2:case 1048614:6==n&&this.invArg();h[n++]=this.theToken.intValue*e;e=1;break;case 269484208:case 1048610:c||this.invArg();269484208==this.theTok&&this.getToken(++a);n--;(0>n||b)&&this.invArg();q(this.theToken.value,Integer)||2==this.theTok?h[n++]/=2147483647==this.theToken.intValue?this.theToken.value.intValue():this.theToken.intValue:q(this.theToken.value,Float)&&(h[n++]/=this.theToken.value.floatValue());this.coordinatesAreFractional=!0;break;case 1048609:case 1073741824:h[n++]=
NaN;break;case 3:case 1048611:b&&this.invArg();6==n&&this.invArg();h[n++]=this.theToken.value.floatValue();break;default:this.invArg()}(n<g||n>k)&&this.invArg();return 3==n?(b=JU.P3.new3(h[0],h[1],h[2]),this.coordinatesAreFractional&&d&&(this.fractionalPoint=JU.P3.newP(b),this.chk||this.vwr.toCartesian(b,!1)),b):4==n?(this.coordinatesAreFractional&&this.invArg(),JU.P4.new4(h[0],h[1],h[2],h[3])):h},"~N,~B,~B,~B,~B,~N,~N");e(c$,"isPoint3f",function(a){var b;if((b=8==this.tokAt(a))||9==this.tokAt(a)||
this.isFloatParameter(a+1)&&this.isFloatParameter(a+2)&&this.isFloatParameter(a+3)&&this.isFloatParameter(a+4))return b;this.ignoreError=!0;var c=this.iToken;b=!0;try{this.getPoint3f(a,!0)}catch(d){if(y(d,Exception))b=!1;else throw d;}this.ignoreError=!1;this.iToken=c;return b},"~N");e(c$,"getPoint3f",function(a,b){return this.getPointOrPlane(a,!1,b,!0,!1,3,3)},"~N,~B");e(c$,"getPoint4f",function(a){return this.getPointOrPlane(a,!1,!1,!1,!1,4,4)},"~N");e(c$,"xypParameter",function(a){var b=this.tokAt(a);
1073742195==b&&(b=this.tokAt(++a));if(269484096!=b||!this.isFloatParameter(++a))return null;b=new JU.P3;b.x=this.floatParameter(a);269484080==this.tokAt(++a)&&a++;if(!this.isFloatParameter(a))return null;b.y=this.floatParameter(a);var c=269484210==this.tokAt(++a);c&&++a;if(269484097!=this.tokAt(a))return null;this.iToken=a;b.z=3.4028235E38*(c?-1:1);return b},"~N");e(c$,"optParameterAsString",function(a){return a>=this.slen?"":this.paramAsStr(a)},"~N");e(c$,"intParameter",function(a){if(this.checkToken(a)&&
2==this.getToken(a).tok)return this.theToken.intValue;this.error(20);return 0},"~N");e(c$,"isFloatParameter",function(a){switch(this.tokAt(a)){case 2:case 3:return!0}return!1},"~N");e(c$,"floatParameter",function(a){if(this.checkToken(a))switch(this.getToken(a),this.theTok){case 1048615:return-this.theToken.intValue;case 1048614:case 2:return this.theToken.intValue;case 1048611:case 3:return this.theToken.value.floatValue()}this.error(34);return 0},"~N");e(c$,"getPointArray",function(a,b,c){var d=
0>b?null:Array(b),e=0>b?new JU.Lst:null,g=0>a?7:this.getToken(a++).tok;switch(g){case 7:e=this.theToken.getList();0<=b&&e.size()!=b&&this.invArg();b=e.size();null==d&&(d=Array(b));for(g=0;g<b;g++)null==(d[g]=JS.SV.ptValue(e.get(g)))&&!c&&this.invArg();return d;case 1073742195:g=this.tokAt(a++)}269484096!=g&&this.invArg();for(c=0;269484097!=g&&0!=g;)switch(g=this.getToken(a).tok,g){case 0:case 269484097:break;case 269484080:a++;break;default:if(0<=b&&c==b){g=0;break}a=this.centerParameter(a);null==
d?e.addLast(a):d[c]=a;c++;a=this.iToken+1}269484097!=g&&this.invArg();null==d&&(d=e.toArray(Array(e.size())));0<b&&null==d[b-1]&&this.invArg();return d},"~N,~N,~B");e(c$,"listParameter",function(a,b,c){var d=new JU.Lst,e;e=this.tokAt(a);1073742195==e&&(e=this.tokAt(++a));var g=1048586==e,k=269484096==e;(g||k)&&a++;for(var h=0;h<c;){e=this.tokAt(a);if(g&&1048590==e||k&&269484097==e)break;switch(e){case 269484080:case 1048586:case 1048590:break;case 4:break;case 8:e=this.getPoint3f(a,!1);d.addLast(Float.$valueOf(e.x));
d.addLast(Float.$valueOf(e.y));d.addLast(Float.$valueOf(e.z));h+=3;break;case 9:e=this.getPoint4f(a);d.addLast(Float.$valueOf(e.x));d.addLast(Float.$valueOf(e.y));d.addLast(Float.$valueOf(e.z));d.addLast(Float.$valueOf(e.w));h+=4;break;default:d.addLast(Float.$valueOf(this.floatParameter(a))),h++,h==c&&(k&&1048590==this.tokAt(a+1))&&a++}a++}(g&&1048590!=this.tokAt(a++)||k&&269484097!=this.tokAt(a++)||h<b||h>c)&&this.invArg();this.iToken=a-1;return d},"~N,~N,~N");e(c$,"floatParameterSet",function(a,
b,c){var d=null,e=null,g=0,g=null;this.iToken=a;switch(this.tokAt(a)){case 4:g=JS.SV.sValue(this.st[a]);g=JU.PT.replaceWithCharacter(g,"{},[]\"'"," ");e=JU.PT.parseFloatArray(g);g=e.length;break;case 7:e=JS.SV.flistValue(this.st[a],0);g=e.length;break;default:d=this.listParameter(a,b,c),g=d.size()}(g<b||g>c)&&this.invArg();if(null==e){e=N(g,0);for(a=0;a<g;a++)e[a]=d.get(a).floatValue()}return e},"~N,~N,~N");e(c$,"isArrayParameter",function(a){switch(this.tokAt(a)){case 7:case 11:case 12:case 1073742195:case 269484096:return!0}return!1},
"~N");e(c$,"getQuaternionParameter",function(a){switch(this.tokAt(a)){case 7:a=this.getToken(a).getList();var b=null;(0==a.size()||null==(b=JS.SV.pt4Value(a.get(0))))&&this.invArg();return JU.Quat.newP4(b);case 1073741863:return this.chk?null:JU.Quat.newP4(JU.Escape.uP(this.vwr.getOrientationText(1073741863,null)));default:return JU.Quat.newP4(this.getPoint4f(a))}},"~N");e(c$,"checkLast",function(a){return this.checkLength(a+1)-1},"~N");e(c$,"checkLength",function(a){if(0<=a)return this.checkLengthErrorPt(a,
0);this.slen>-a&&(this.iToken=-a,this.bad());return this.slen},"~N");e(c$,"checkLengthErrorPt",function(a,b){this.slen!=a&&(this.iToken=0<b?b:this.slen,0<b?this.invArg():this.bad());return this.slen},"~N,~N");e(c$,"checkLength23",function(){this.iToken=this.slen;2!=this.slen&&3!=this.slen&&this.bad();return this.slen});e(c$,"checkLength34",function(){this.iToken=this.slen;3!=this.slen&&4!=this.slen&&this.bad();return this.slen});e(c$,"modelNumberParameter",function(a){var b=0,c=!1;switch(this.tokAt(a)){case 2:c=
!0;case 3:b=this.getToken(a).intValue;break;case 4:b=JS.ScriptParam.getFloatEncodedInt(this.stringParameter(a));break;default:this.invArg()}return this.vwr.ms.getModelNumberIndex(b,c,!0)},"~N");e(c$,"getMadParameter",function(){var a=1;switch(this.getToken(1).tok){case 1073742072:this.restrictSelected(!1,!1);break;case 1048589:break;case 1048588:a=0;break;case 2:a=8*this.intParameterRange(1,0,750);break;case 3:a=this.floatParameterRange(1,-3,3);a=Float.isNaN(a)?2147483647:I(Math.floor(2E3*a));0>a&&
(this.restrictSelected(!1,!1),a=-a);break;default:this.error(6)}return a});e(c$,"intParameterRange",function(a,b,c){a=this.intParameter(a);return a<b||a>c?(this.integerOutOfRange(b,c),2147483647):a},"~N,~N,~N");e(c$,"floatParameterRange",function(a,b,c){a=this.floatParameter(a);return a<b||a>c?(this.numberOutOfRange(b,c),NaN):a},"~N,~N,~N");e(c$,"getPointVector",function(a,b){switch(a.tok){case 10:return this.vwr.ms.getAtomPointVector(a.value);case 7:for(var c=new JU.Lst,d,e=a.getList(),g=0;g<e.size();g++)if(null!=
(d=JS.SV.ptValue(e.get(g))))c.addLast(d);else return null;return c}return 0<b?this.vwr.ms.getAtomPointVector(this.atomExpressionAt(b)):null},"JS.T,~N");c$.getFloatEncodedInt=e(c$,"getFloatEncodedInt",function(a){var b=a.indexOf(".");if(1>b||"-"==a.charAt(0)||a.endsWith(".")||a.contains(".0"))return 2147483647;var c=0,d=0;if(0<b)try{c=Integer.parseInt(a.substring(0,b)),0>c&&(c=-c)}catch(e){if(y(e,NumberFormatException))c=-1;else throw e;}if(b<a.length-1)try{d=Integer.parseInt(a.substring(b+1))}catch(g){if(!y(g,
NumberFormatException))throw g;}c=1E6*c+d;return 0>c?2147483647:c},"~S");c$.getPartialBondOrderFromFloatEncodedInt=e(c$,"getPartialBondOrderFromFloatEncodedInt",function(a){return(I(a/1E6)%6<<5)+(a%1E6&31)},"~N");c$.getBondOrderFromString=e(c$,"getBondOrderFromString",function(a){return 0>a.indexOf(" ")?JU.Edge.getBondOrderFromString(a):0==a.toLowerCase().indexOf("partial ")?JS.ScriptParam.getPartialBondOrderFromString(a.substring(8).trim()):131071},"~S");c$.getPartialBondOrderFromString=e(c$,"getPartialBondOrderFromString",
function(a){return JS.ScriptParam.getPartialBondOrderFromFloatEncodedInt(JS.ScriptParam.getFloatEncodedInt(a))},"~S");e(c$,"isColorParam",function(a){var b=this.tokAt(a);return 570425378==b||1073742195==b||269484096==b||7==b||8==b||this.isPoint3f(a)||(4==b||JS.T.tokAttr(b,1073741824))&&0!=JU.CU.getArgbFromString(this.st[a].value)},"~N");e(c$,"getArgbParam",function(a){return this.getArgbParamOrNone(a,!1)},"~N");e(c$,"getArgbParamLast",function(a,b){var c=this.getArgbParamOrNone(a,b);this.checkLast(this.iToken);
return c},"~N,~B");e(c$,"getArgbParamOrNone",function(a,b){var c=null;if(this.checkToken(a))switch(this.getToken(a).tok){default:if(!JS.T.tokAttr(this.theTok,1073741824))break;case 570425378:case 4:return JU.CU.getArgbFromString(this.paramAsStr(a));case 1073742195:return this.getColorTriad(a+2);case 269484096:return this.getColorTriad(++a);case 7:var d=JS.SV.flistValue(this.theToken,3);null!=d&&3!=d.length&&(c=JU.P3.new3(d[0],d[1],d[2]));break;case 8:c=this.theToken.value;break;case 1048586:c=this.getPoint3f(a,
!1);break;case 1048587:if(b)return 0}null==c&&this.error(8);return JU.CU.colorPtToFFRGB(c)},"~N,~B");e(c$,"getColorTriad",function(a){var b=N(3,0),c=0,d="";this.getToken(a);var e=null,g=0;a:switch(this.theTok){case 2:case 1048614:case 3:for(;a<this.slen;a++){switch(this.getToken(a).tok){case 269484080:continue;case 1073741824:(1!=c||0!=b[0])&&this.error(4);d="0"+this.paramAsStr(a);break a;case 3:2<c&&this.error(4);g=this.floatParameter(a);break;case 2:2<c&&this.error(4);g=this.theToken.intValue;break;
case 1048614:2<c&&this.error(4);g=this.theToken.value.intValue()%256;break;case 269484097:3!=c&&this.error(4);--a;e=JU.P3.new3(b[0],b[1],b[2]);break a;default:this.error(4)}b[c++]=g}this.error(4);break;case 8:e=this.theToken.value;break;case 1073741824:d=this.paramAsStr(a);break;default:this.error(4)}269484097!=this.getToken(++a).tok&&this.error(4);if(null!=e)return JU.CU.colorPtToFFRGB(e);0==(c=JU.CU.getArgbFromString("["+d+"]"))&&this.error(4);return c},"~N");e(c$,"tickParamAsStr",function(a,b,
c,d){this.iToken=a-1;if(1073742164!=this.tokAt(a))return null;var e=" ";switch(this.tokAt(a+1)){case 1112541205:case 1112541206:case 1112541207:e=this.paramAsStr(++a).toLowerCase();break;case 1073741824:this.invArg()}if(1048587==this.tokAt(++a))return b=new JM.TickInfo(null),b.type=e,this.iToken=a,b;b=new JM.TickInfo(this.getPointOrPlane(a,!1,!0,!1,!1,3,3));if(this.coordinatesAreFractional||1614417948==this.tokAt(this.iToken+1))b.scale=JU.P3.new3(NaN,NaN,NaN),c=!1;1614417948==this.tokAt(this.iToken+
1)&&this.iToken++;b.type=e;1288701959==this.tokAt(this.iToken+1)&&(b.tickLabelFormats=this.stringParameterSet(this.iToken+2));if(!c)return b;1073742138==this.tokAt(this.iToken+1)&&(this.isFloatParameter(this.iToken+2)?(a=this.floatParameter(this.iToken+2),b.scale=JU.P3.new3(a,a,a)):b.scale=this.getPoint3f(this.iToken+2,!0));d&&1073741942==this.tokAt(this.iToken+1)&&(b.first=this.floatParameter(this.iToken+2));return b},"~N,~B,~B,~B");e(c$,"setBooleanProperty",function(a,b){this.chk||this.vwr.setBooleanProperty(a,
b)},"~S,~B");e(c$,"setIntProperty",function(a,b){this.chk||this.vwr.setIntProperty(a,b);return!0},"~S,~N");e(c$,"setFloatProperty",function(a,b){this.chk||this.vwr.setFloatProperty(a,b);return!0},"~S,~N");e(c$,"setStringProperty",function(a,b){this.chk||this.vwr.setStringProperty(a,b)},"~S,~S")});C("JS");c$=H(function(){this.context=this.processName=null;D(this,arguments)},JS,"ScriptProcess");G(c$,function(a,b){this.processName=a;this.context=b},"~S,JS.ScriptContext");C("JS");E(null,"JS.ScriptProcessRunnable",
["JU.Logger"],function(){c$=H(function(){this.shapeManager=this.processLock=this.process=this.parallelProcessor=null;D(this,arguments)},JS,"ScriptProcessRunnable",null,Runnable);G(c$,function(a,b,c,d){this.parallelProcessor=a;this.process=b;this.processLock=c;this.shapeManager=d},"JS.ScriptParallelProcessor,JS.ScriptProcess,~O,JV.ShapeManager");p(c$,"run",function(){try{null==this.parallelProcessor.error&&(JU.Logger.debugging&&JU.Logger.debug("Running process "+this.process.processName+" "+this.process.context.pc+
" - "+(this.process.context.pcEnd-1)),this.parallelProcessor.eval(this.process.context,this.shapeManager),JU.Logger.debugging&&JU.Logger.debug("Process "+this.process.processName+" complete"))}catch(a){if(y(a,Exception))364558!=this.parallelProcessor.getTok()&&a.printStackTrace();else if(y(a,Error))this.parallelProcessor.clearShapeManager(a);else throw a;}finally{--this.parallelProcessor.counter,this.processLock.notifyAll()}})});C("JS");E(["J.thread.JmolThread"],"JS.ScriptQueueThread",["JU.Logger"],
function(){c$=H(function(){this.scriptManager=null;this.startedByCommandThread=!1;this.pt=0;D(this,arguments)},JS,"ScriptQueueThread",J.thread.JmolThread);G(c$,function(a,b,c,d){this.setViewer(b,"QueueThread"+d);this.scriptManager=a;this.vwr=b;this.startedByCommandThread=c;this.pt=d},"J.api.JmolScriptManager,JV.Viewer,~B,~N");p(c$,"run1",function(a){for(;;)switch(a){case -1:a=0;break;case 0:if(this.stopped||0==this.scriptManager.getScriptQueue().size()){a=-2;break}if(!this.runNextScript()&&!this.runSleep(100,
0))return;break;case -2:this.scriptManager.queueThreadFinished(this.pt);return}},"~N");e(c$,"runNextScript",function(){var a=this.scriptManager.getScriptQueue();if(0==a.size())return!1;var b=this.scriptManager.getScriptItem(!1,this.startedByCommandThread);if(null==b)return!1;var c=b.get(0),d=b.get(1),e=b.get(2),b=b.get(3).booleanValue();JU.Logger.debugging&&JU.Logger.debug("Queue["+this.pt+"]["+a.size()+"] scripts; running: "+c);a.remove(0);this.vwr.evalStringWaitStatusQueued(e,c,d,b,!0);return 0==
a.size()?!1:!0})});C("JS");E(null,"JS.ScriptTokenParser","java.lang.Float JU.Lst $.P3 $.PT J.i18n.GT JS.ScriptParam $.T JU.Logger $.SimpleUnitCell".split(" "),function(){c$=H(function(){this.script=this.vwr=null;this.isStateScript=!1;this.ichToken=this.ichEnd=this.ichComment=this.ichCurrentCommand=this.iCommand=this.lineCurrent=0;this.tokenAndEquals=this.lastToken=this.tokenCommand=this.lastFlowCommand=this.theToken=null;this.ptNewSetModifier=this.tokCommand=this.nTokens=this.theTok=0;this.logMessages=
this.isNewSet=!1;this.atokenInfix=null;this.itokenInfix=0;this.isSetOrDefine=this.isMathExpressionCommand=this.isSetBrace=!1;this.ltokenPostfix=null;this.isCommaAsOrAllowed=this.isEmbeddedExpression=!1;this.htUserFunctions=this.theValue=null;this.residueSpecCodeGenerated=this.haveString=!1;this.errorType=this.errorLine=this.errorMessageUntranslated=this.errorMessage=null;D(this,arguments)},JS,"ScriptTokenParser");e(c$,"compileExpressions",function(){var a=135271429==this.tokCommand&&269484048==this.tokAt(2);
this.isEmbeddedExpression=a||0!=this.tokCommand&&(135368713!=this.tokCommand&&102436!=this.tokCommand&&364558!=this.tokCommand&&102412!=this.tokCommand||2147483647!=this.tokenCommand.intValue)&&1150985!=this.tokCommand&&!JS.T.tokAttr(this.tokCommand,12288)&&(2<this.nTokens||!JS.T.tokAttr(this.tokCommand,20480));this.isMathExpressionCommand=1073741824==this.tokCommand||a||JS.T.tokAttr(this.tokCommand,36864);a=this.isEmbeddedExpression||JS.T.tokAttr(this.tokCommand,12288);1048582==this.tokAt(1)&&JS.T.tokAttr(this.tokCommand,
12288)&&(a=!1);if(a&&!this.compileExpression())return!1;for(var a=this.atokenInfix.length,b=0,c=1;c<a;c++)1060866==this.tokAt(c)&&b++;a-=b;this.isNewSet&&1==a&&(this.atokenInfix[0]=JS.T.tv(135368713,0,this.atokenInfix[0].value),this.isNewSet=!1);return(this.isNewSet||this.isSetBrace)&&a<this.ptNewSetModifier+2?this.commandExpected():1==a||!JS.T.tokAttr(this.tokCommand,262144)?!0:this.error(0)});e(c$,"compileExpression",function(){var a=this.isSetOrDefine&&!this.isSetBrace?2:1;this.ltokenPostfix=new JU.Lst;
this.itokenInfix=0;var b=null,c=this.tokAt(1);switch(this.tokCommand){case 1060866:2==this.tokAt(1)&&(1048583==this.tokAt(2)&&269484436==this.tokAt(4))&&(this.tokCommand=1085443,this.isSetBrace=!0,this.ptNewSetModifier=4,this.isEmbeddedExpression=this.isMathExpressionCommand=!0,this.addTokenToPostfixToken(JS.T.tokenSetProperty),this.addTokenToPostfixToken(JS.T.tokenExpressionBegin),this.addNextToken(),this.addNextToken(),this.addTokenToPostfixToken(JS.T.tokenExpressionEnd),a=0);break;case 12295:1678770178==
c&&(a=2);break;case 135280132:switch(c){case 1048589:case 1048588:c=this.tokAt(++a);break}case 12294:case 1610625028:switch(c){case 1276118017:case 1073742119:c=this.tokAt(++a)}1087373318==c&&!JS.T.tokAttr(this.tokAt(a+1),269484032)&&a++}for(c=0;c<a&&this.addNextToken();c++);for(;this.moreTokens();){if(this.isEmbeddedExpression){for(;!this.isExpressionNext();){if(this.tokPeekIs(1073741824)&&!(135271427==this.tokCommand&&1==this.itokenInfix)&&(a=this.atokenInfix[this.itokenInfix].value,c=JS.T.getTokenFromName(a),
null!=c&&(!this.isMathExpressionCommand&&1060866!=this.lastToken.tok||(1048583==this.lastToken.tok||269484048==this.tokAt(this.itokenInfix+1))&&!this.isUserFunction(a))))this.atokenInfix[this.itokenInfix]=c;if(!this.addNextToken())break}if(!this.moreTokens())break}if(1060866==this.lastToken.tok){if(!this.clauseDefine(!0,!1))return!1}else{this.isMathExpressionCommand||this.addTokenToPostfixToken(b=JS.T.o(1048577,"implicitExpressionBegin"));if(!this.clauseOr(this.isCommaAsOrAllowed||!this.isMathExpressionCommand&&
this.tokPeekIs(269484048)))return!1;!this.isMathExpressionCommand&&!(this.isEmbeddedExpression&&this.lastToken===JS.T.tokenCoordinateEnd)&&this.addTokenToPostfixToken(JS.T.tokenExpressionEnd);if(this.moreTokens()){if(135280132!=this.tokCommand&&12291!=this.tokCommand&&!this.isEmbeddedExpression)return this.error(5);135280132==this.tokCommand&&(this.tokCommand=b.intValue=0,this.isMathExpressionCommand=this.isEmbeddedExpression=!0,this.isCommaAsOrAllowed=!1)}}}this.atokenInfix=this.ltokenPostfix.toArray(Array(this.ltokenPostfix.size()));
return!0});e(c$,"isUserFunction",function(a){return!this.isStateScript&&(this.vwr.isFunction(a)||this.htUserFunctions.containsKey(a))},"~S");e(c$,"isExpressionNext",function(){return this.tokPeekIs(1048586)&&!(4==this.tokAt(this.itokenInfix+1)&&269484066==this.tokAt(this.itokenInfix+2))||!this.isMathExpressionCommand&&this.tokPeekIs(269484048)});c$.tokenAttr=e(c$,"tokenAttr",function(a,b){return null!=a&&JS.T.tokAttr(a.tok,b)},"JS.T,~N");e(c$,"moreTokens",function(){return this.itokenInfix<this.atokenInfix.length});
e(c$,"tokAt",function(a){return a<this.atokenInfix.length?this.atokenInfix[a].tok:0},"~N");e(c$,"tokPeek",function(){return this.itokenInfix>=this.atokenInfix.length?0:this.atokenInfix[this.itokenInfix].tok});e(c$,"tokPeekIs",function(a){return this.tokAt(this.itokenInfix)==a},"~N");e(c$,"intPeek",function(){return this.itokenInfix>=this.atokenInfix.length?2147483647:this.atokenInfix[this.itokenInfix].intValue});e(c$,"valuePeek",function(){return this.moreTokens()?this.atokenInfix[this.itokenInfix].value:
""});e(c$,"tokenNext",function(){return this.itokenInfix>=this.atokenInfix.length?null:this.atokenInfix[this.itokenInfix++]});e(c$,"tokenNextTok",function(a){var b=this.tokenNext();return null!=b&&b.tok==a},"~N");e(c$,"returnToken",function(){this.itokenInfix--;return!1});e(c$,"getToken",function(){this.theValue=null==(this.theToken=this.tokenNext())?null:this.theToken.value;return this.theToken});e(c$,"isToken",function(a){return null!=this.theToken&&this.theToken.tok==a},"~N");e(c$,"getNumericalToken",
function(){return null!=this.getToken()&&(this.isToken(2)||this.isToken(3))});e(c$,"floatValue",function(){switch(this.theToken.tok){case 2:return this.theToken.intValue;case 3:return this.theValue.floatValue()}return 0});e(c$,"addTokenToPostfix",function(a,b){return this.addTokenToPostfixToken(JS.T.o(a,b))},"~N,~O");e(c$,"addTokenToPostfixInt",function(a,b,c){return this.addTokenToPostfixToken(JS.T.tv(a,b,c))},"~N,~N,~O");e(c$,"addTokenToPostfixToken",function(a){if(null==a)return!1;this.logMessages&&
JU.Logger.debug("addTokenToPostfix"+a);this.ltokenPostfix.addLast(a);this.lastToken=a;return!0},"JS.T");e(c$,"addNextToken",function(){return this.addTokenToPostfixToken(this.tokenNext())});e(c$,"addNextTokenIf",function(a){return this.tokPeekIs(a)&&this.addNextToken()},"~N");e(c$,"addSubstituteTokenIf",function(a,b){if(!this.tokPeekIs(a))return!1;this.itokenInfix++;return this.addTokenToPostfixToken(b)},"~N,JS.T");e(c$,"clauseOr",function(a){this.haveString=!1;if(!this.clauseAnd())return!1;if(this.isEmbeddedExpression&&
1048578==this.lastToken.tok)return!0;for(var b;269484112==(b=this.tokPeek())||269484113==b||269484114==b||a&&269484080==b;){269484080==b&&!this.haveString?this.addSubstituteTokenIf(269484080,JS.T.tokenOr):this.addNextToken();if(!this.clauseAnd())return!1;if(a&&(1048590==this.lastToken.tok||10==this.lastToken.tok))this.haveString=!0}return!0},"~B");e(c$,"clauseAnd",function(){if(!this.clauseNot())return!1;if(this.isEmbeddedExpression&&1048578==this.lastToken.tok)return!0;for(;this.tokPeekIs(269484128);)if(this.addNextToken(),
!this.clauseNot())return!1;return!0});e(c$,"clauseNot",function(){return this.tokPeekIs(269484144)?(this.addNextToken(),this.clauseNot()):this.clausePrimitive()});e(c$,"clausePrimitive",function(){var a=this.tokPeek();switch(a){case 1073742195:return this.itokenInfix++,this.clausePrimitive();case 0:return this.error(4);case 1048579:case 10:case 269484208:case 137363467:case 3145736:case 3145735:case 3145738:case 1048585:case 1048587:case 3145760:return this.addNextToken();case 4:return this.haveString=
!0,this.addNextToken();case 3:return this.addTokenToPostfixInt(1048611,this.fixModelSpec(this.getToken()),this.theValue);case 1095761925:case 1095761926:return this.clauseCell(a);case 135266310:return this.clauseConnected();case 135267335:case 135267336:return this.clauseSubstructure();case 135266325:case 135402505:return this.clauseWithin(135266325==a);case 1060866:return this.clauseDefine(!1,!1);case 1678770178:case 1746538509:this.addNextToken();if(this.tokPeekIs(10))this.addNextToken();else if(this.tokPeekIs(1060866))return this.clauseDefine(!1,
!1);return!0;case 269484048:return this.addNextToken(),!this.clauseOr(!0)?!1:!this.addNextTokenIf(269484049)?this.errorStr(15,")"):this.checkForItemSelector(!0);case 1048586:return this.checkForCoordinate(this.isMathExpressionCommand);default:if(this.clauseResidueSpec())return!0;if(this.isError())return!1;if(JS.T.tokAttr(a,1078984704)){var b=this.itokenInfix,c=this.clauseComparator(!0);if(c||this.itokenInfix!=b)return c;if(1238369286==a)return this.clauseSubstructure()}return this.addNextToken()}});
e(c$,"checkForCoordinate",function(a){var b=!1,c=this.ltokenPostfix.size();a?(this.addTokenToPostfixToken(JS.T.tokenExpressionBegin),this.tokenNext()):this.isEmbeddedExpression?(this.tokenNext(),c--):this.addNextToken();var d=this.tokPeekIs(4);if(d){a=!1;this.returnToken();this.ltokenPostfix.remove(this.ltokenPostfix.size()-1);this.addNextToken();for(var e=1;0!=e;){if(this.tokPeekIs(1048586))if(this.isExpressionNext()){this.addTokenToPostfixToken(JS.T.o(1048577,"implicitExpressionBegin"));if(!this.clauseOr(!0))return!1;
this.lastToken!==JS.T.tokenCoordinateEnd&&this.addTokenToPostfixToken(JS.T.tokenExpressionEnd)}else e++;this.tokPeekIs(1048590)&&e--;this.addNextToken()}}else{if(!this.tokPeekIs(1048590)&&!this.clauseOr(!1))return!1;for(b=1;!this.tokPeekIs(1048590);){e=this.addNextTokenIf(269484080);if(!this.clauseOr(!1))return e||3>b?!1:this.errorStr(15,"}");b++}b=2<=b}b&&(a||this.isEmbeddedExpression)?(this.ltokenPostfix.set(c,JS.T.tokenCoordinateBegin),this.addTokenToPostfixToken(JS.T.tokenCoordinateEnd),this.tokenNext()):
a?(this.addTokenToPostfixToken(JS.T.tokenExpressionEnd),this.tokenNext()):this.isEmbeddedExpression&&!d?this.tokenNext():this.addNextToken();return this.checkForItemSelector(!d)},"~B");e(c$,"checkForItemSelector",function(a){var b;if(269484096==(b=this.tokAt(this.itokenInfix+1))||a&&1048586==b)return!0;for(;this.addNextTokenIf(269484096);){if(!this.clauseItemSelector())return!1;if(!this.addNextTokenIf(269484097))return this.errorStr(15,"]")}return!0},"~B");e(c$,"clauseWithin",function(a){this.addNextToken();
if(!this.addNextTokenIf(269484048)||null==this.getToken())return!1;var b=3.4028235E38,c=null,d=a,e,g=this.theToken.tok;if(!a){e=-1;for(var k=this.itokenInfix;0!=e;k++)switch(e=this.tokAt(k)){case 269484080:e=0;break;case 1048586:case 269484048:case 269484049:b=100,this.returnToken(),g=e=0}}switch(g){case 269484192:if(null==this.getToken())return!1;if(2!=this.theToken.tok)return this.error(12);b=-this.theToken.intValue;break;case 2:case 3:b=this.floatValue();break;case 1060866:this.addTokenToPostfixToken(this.theToken);
if(!this.clauseDefine(!0,!1))return!1;c="";d=!1}if(a&&3.4028235E38==b)switch(g){case 1060866:break;case 1073741916:case 1073742128:case 135267335:case 135267336:case 1238369286:case 1073741925:case 1073742189:this.addTokenToPostfix(4,this.theValue);if(!this.addNextTokenIf(269484080))return!1;d=!1;e=this.tokPeek();switch(e){case 0:return!1;case 4:this.addNextToken();c="";break;case 1060866:if(!this.clauseDefine(!1,!0))return!1;c="";break;default:return!1}break;case 1048580:d=!1;case 1087375361:case 1087375362:case 1073741864:case 1679429641:case 1087373316:case 1048581:case 1087375365:case 1087373318:case 137363467:case 1095766030:case 1095761936:case 135266319:case 135267841:case 1095761937:case 1087373320:case 3145760:case 1095761941:case 1641025539:case 4:case 1649412120:c=
this.theValue;break;case 1073741824:c=this.theValue.toLowerCase();break;default:return this.errorIntStr2(18,"WITHIN",": "+this.theToken.value)}null==c?this.addTokenToPostfix(3,Float.$valueOf(b)):0<c.length&&this.addTokenToPostfix(4,c);for(k=!1;!k&&(0==g||this.addNextTokenIf(269484080));){0==g&&(g=135402505);var h=!1;e=this.tokPeek();if(a){switch(g){case 2:case 3:if(1048589==e||1048588==e){this.addTokenToPostfixToken(this.getToken());if(!this.addNextTokenIf(269484080))break;e=this.tokPeek()}}if(null==
c){switch(e){case 135267841:case 1048581:case 135266319:h=!0;this.addNextToken();break;case 1048582:this.getToken();this.getToken();this.addTokenToPostfix(4,"$"+this.theValue);k=!0;break;case 1087373318:case 1649412120:this.getToken();this.addTokenToPostfix(4,JS.T.nameOf(e));break;case 1048586:this.returnToken(),h=!0,this.addTokenToPostfixToken(JS.T.getTokenFromName(3.4028235E38==b?"plane":"coord"))}k||this.addNextTokenIf(269484080)}}this.tokPeek();if(k)break;if(h)for(;!this.tokPeekIs(269484049);)switch(this.tokPeek()){case 0:return this.error(4);
case 269484048:this.addTokenToPostfixToken(JS.T.tokenExpressionBegin);this.addNextToken();if(!this.clauseOr(!1))return this.errorIntStr2(18,"WITHIN",": ?");if(!this.addNextTokenIf(269484049))return this.errorStr(15,", / )");this.addTokenToPostfixToken(JS.T.tokenExpressionEnd);break;case 1060866:if(!this.clauseDefine(!1,!1))return!1;break;default:this.addTokenToPostfixToken(this.getToken())}else this.clauseOr(d)}return!this.addNextTokenIf(269484049)?this.errorStr(15,")"):!0},"~B");e(c$,"clauseConnected",
function(){this.addNextToken();if(!this.addNextTokenIf(269484048))return this.addTokenToPostfixToken(JS.T.tokenLeftParen),this.addTokenToPostfixToken(JS.T.tokenRightParen),!0;for(;(!this.addNextTokenIf(2)||this.addNextTokenIf(269484080))&&(!this.addNextTokenIf(2)||this.addNextTokenIf(269484080))&&(!this.addNextTokenIf(3)||this.addNextTokenIf(269484080))&&(!this.addNextTokenIf(3)||this.addNextTokenIf(269484080));){var a=this.getToken().value,a=q(a,String)?a:" ";if(131071==JS.ScriptParam.getBondOrderFromString(a))this.returnToken();
else if(this.addTokenToPostfix(4,a),!this.addNextTokenIf(269484080))break;if(this.addNextTokenIf(269484049))return!0;if(!this.clauseOr(this.tokPeekIs(269484048)))return!1;if(this.addNextTokenIf(269484049))return!0;if(!this.addNextTokenIf(269484080)||!this.clauseOr(this.tokPeekIs(269484048)))return!1;break}return!this.addNextTokenIf(269484049)?this.errorStr(15,")"):!0});e(c$,"clauseSubstructure",function(){this.addNextToken();if(!this.addNextTokenIf(269484048))return!1;if(this.tokPeekIs(1060866)){if(!this.clauseDefine(!1,
!0))return!1}else if(!this.addNextTokenIf(4))return this.errorStr(15,'"..."');return this.addNextTokenIf(269484080)&&!this.clauseOr(this.tokPeekIs(269484048))?!1:!this.addNextTokenIf(269484049)?this.errorStr(15,")"):!0});e(c$,"clauseItemSelector",function(){for(var a,b=0;0!=(a=this.tokPeek())&&269484097!=a;)this.addNextToken(),269484096==a&&b++,269484097==this.tokPeek()&&0<b--&&this.addNextToken();return!0});e(c$,"clauseComparator",function(a){var b=this.tokenNext(),c=this.tokenNext();if(!JS.ScriptTokenParser.tokenAttr(c,
269484288)){if(!a)return this.errorStr(15,"== != < > <= >=");null!=c&&this.returnToken();this.returnToken();return!1}if(JS.ScriptTokenParser.tokenAttr(b,1087373312)&&269484436!=c.tok&&269484438!=c.tok&&269484437!=c.tok)return this.errorStr(15,"== !=");if(269484096==this.tokPeek()){this.getToken();for(this.addTokenToPostfixToken(JS.T.tokenLeftParen);;){if(!this.addCompare(b,c))return!1;if(269484080==this.tokPeek())this.getToken();else if(269484097==this.tokPeek())break;this.addTokenToPostfixToken(269484437==
c.tok?JS.T.tokenAnd:JS.T.tokenOr)}this.getToken();this.addTokenToPostfixToken(JS.T.tokenRightParen);return!0}return this.addCompare(b,c)},"~B");e(c$,"addCompare",function(a,b){if(null==this.getToken())return this.errorStr(17,""+this.valuePeek());var c=this.isToken(269484192);if(c&&null==this.getToken())return this.error(12);switch(this.theToken.tok){case 2:case 3:case 1073741824:case 4:case 1048586:case 1060866:break;default:if(!JS.T.tokAttr(this.theToken.tok,1073741824))return this.error(13)}this.addTokenToPostfixInt(b.tok,
a.tok,b.value+(c?" -":""));1716520985==a.tok&&this.addTokenToPostfixToken(a);if(this.isToken(1048586))return this.returnToken(),this.clausePrimitive();this.addTokenToPostfixToken(this.theToken);return 1060866==this.theToken.tok?this.clauseDefine(!0,!1):!0},"JS.T,JS.T");e(c$,"clauseCell",function(a){var b=new JU.P3;this.tokenNext();if(!this.tokenNextTok(269484436))return this.errorStr(15,"=");if(null==this.getToken())return this.error(3);if(this.isToken(2))return JU.SimpleUnitCell.ijkToPoint3f(this.theToken.intValue,
b,1),this.addTokenToPostfix(a,b);if(!this.isToken(1048586)||!this.getNumericalToken())return this.error(3);b.x=this.floatValue();this.tokPeekIs(269484080)&&this.tokenNext();if(!this.getNumericalToken())return this.error(3);b.y=this.floatValue();this.tokPeekIs(269484080)&&this.tokenNext();if(!this.getNumericalToken()||!this.tokenNextTok(1048590))return this.error(3);b.z=this.floatValue();return this.addTokenToPostfix(a,b)},"~N");e(c$,"clauseDefine",function(a,b){if(!a){var c=this.tokenNext();b&&(c=
JS.T.tokenDefineString);this.addTokenToPostfixToken(c)}if(0==this.tokPeek())return this.error(4);if(!this.addSubstituteTokenIf(1048586,JS.T.tokenExpressionBegin))return this.addNextToken()&&this.checkForItemSelector(!0);for(;this.moreTokens()&&!this.tokPeekIs(1048590);)if(this.tokPeekIs(1048586)){if(!this.checkForCoordinate(!0))return!1}else this.addNextToken();return this.addSubstituteTokenIf(1048590,JS.T.tokenExpressionEnd)&&this.checkForItemSelector(!0)},"~B,~B");e(c$,"generateResidueSpecCode",
function(a){this.residueSpecCodeGenerated&&this.addTokenToPostfixToken(JS.T.tokenAndSpec);this.addTokenToPostfixToken(a);return this.residueSpecCodeGenerated=!0},"JS.T");e(c$,"clauseResidueSpec",function(){var a=this.tokPeek(),b=this.residueSpecCodeGenerated=!1;switch(a){case 0:case 3145732:case 3145750:return!1;case 2:case 269484066:case 269484210:case 5:break;case 269484209:case 269484096:case 1073741824:b=!0;break;default:if(JS.T.tokAttr(a,269484288))return!1;b=""+this.valuePeek();b=2==b.length||
3==b.length;if(!b)return!1}var c=!1;if(b){if(!this.clauseResNameSpec())return!1;c=!0;a=this.tokPeek()}if(2==a||269484209==a||5==a){if(!this.clauseSequenceSpec())return!1;c=!0;a=this.tokPeek()}if(269484066==a){if(!this.clauseChainSpec(a))return!1;c=!0;a=this.tokPeek()}if(1048583==a){if(!this.clauseAtomSpec())return!1;c=!0;a=this.tokPeek()}if(269484210==a){if(!this.clauseAlternateSpec())return!1;c=!0;a=this.tokPeek()}if(269484208==a){if(!this.clauseModelSpec())return!1;c=!0;this.tokPeek()}if(!c)return this.error(14);
this.residueSpecCodeGenerated||this.addTokenToPostfixToken(JS.T.tokenAll);return!0});e(c$,"clauseResNameSpec",function(){this.getToken();var a=this.tokPeek();switch(this.theToken.tok){case 269484209:return!0;case 269484096:for(a="";null!=this.getToken()&&!this.isToken(269484097);)a+=this.theValue;if(!this.isToken(269484097))return!1;if(""===a)return!0;var b;return 0<a.length&&0<=(b=a.indexOf("*"))&&b!=a.length-1?this.error(14):this.generateResidueSpecCode(JS.T.o(1048612,a.toUpperCase()));default:if(JS.T.tokAttr(a,
269484288))return this.returnToken(),!1;b=this.theValue;269484209==a&&(b=this.theValue+"*",this.getToken());return this.generateResidueSpecCode(JS.T.o(1073741824,b))}});e(c$,"clauseSequenceSpec",function(){if(269484209==this.tokPeek())return null!=this.getToken();var a=this.getSequenceCode(!1);if(null==a)return!1;var b=this.tokPeek();return 269484192==b||2==b&&0>this.intPeek()?(269484192==b?this.tokenNext():(b=-this.intPeek(),this.tokenNext().intValue=b,this.returnToken()),a.tok=1048615,this.generateResidueSpecCode(a),
this.addTokenToPostfixToken(this.getSequenceCode(!0))):this.generateResidueSpecCode(a)});e(c$,"getSequenceCode",function(a){var b=2147483647,c=2147483647;switch(this.tokPeek()){case 5:b=this.tokenNext().intValue;break;case 2:c=this.tokenNext().intValue;break;default:if(!a)return null}return JS.T.tv(1048614,c,Integer.$valueOf(b))},"~B");e(c$,"clauseChainSpec",function(a){this.tokenNext();a=this.tokPeek();if(this.isTerminator(a))a=" ";else{switch(a){case 269484209:return null!=this.getToken();case 2:this.getToken();
a=this.theToken.intValue;if(0>a||9999<a)return this.error(8);a=""+a;break;case 4:this.vwr.getChainID("a",!0);default:a=""+this.getToken().value}if(0==a.length)a=" ";else if(a.equals("?"))return!0}a=this.vwr.getChainID(a,!1);return this.generateResidueSpecCode(JS.T.tv(1048609,a,"spec_chain"))},"~N");e(c$,"clauseAlternateSpec",function(){this.tokenNext();if(this.isTerminator(this.tokPeek()))return this.generateResidueSpecCode(JS.T.o(1048607,null));switch(this.getToken().tok){case 269484209:case 4:case 2:case 1073741824:break;
default:return this.error(10)}return this.generateResidueSpecCode(JS.T.o(1048607,this.theToken.value))});e(c$,"isTerminator",function(a){switch(a){case 0:case 269484208:case 269484128:case 269484112:case 269484144:case 269484080:case 269484049:case 1048590:return!0;default:return!1}},"~N");e(c$,"clauseModelSpec",function(){this.getToken();switch(this.tokPeek()){case 269484209:return this.getToken(),!0;case 2:return this.generateResidueSpecCode(JS.T.o(1048610,Integer.$valueOf(this.getToken().intValue)));
case 3:return this.generateResidueSpecCode(JS.T.tv(1048610,this.fixModelSpec(this.getToken()),this.theValue))}return this.error(10)});e(c$,"fixModelSpec",function(a){a=a.intValue;if(2147483647==a){var b=this.theValue.floatValue();b==B(b)&&(a=1E6*B(b));0>a&&(a=2147483647)}return a},"JS.T");e(c$,"clauseAtomSpec",function(){if(!this.tokenNextTok(1048583))return this.error(7);if(null==this.getToken())return!0;var a="";if(this.isToken(2)&&(a+=""+this.theToken.intValue,null==this.getToken()))return this.error(7);
switch(this.theToken.tok){case 269484209:return!0}a+=""+this.theToken.value;this.tokPeekIs(269484209)&&(this.tokenNext(),a+="'");var b=this.vwr.getJBR().lookupSpecialAtomID(a.toUpperCase());return this.generateResidueSpecCode(JS.T.tv(1048608,b,a))});c$.errorString=e(c$,"errorString",function(a,b,c,d){var e=!1;!d&&!0==(e=J.i18n.GT.getDoTranslate())&&J.i18n.GT.setDoTranslate(!1);switch(a){default:a="Unknown compiler error message number: "+a;break;case 0:a=J.i18n.GT._("bad argument count");break;case 1:a=
J.i18n.GT._("invalid context for {0}");break;case 2:a=J.i18n.GT._("command expected");break;case 3:a=J.i18n.GT._("{ number number number } expected");break;case 4:a=J.i18n.GT._("unexpected end of script command");break;case 5:a=J.i18n.GT._("end of expression expected");break;case 6:a=J.i18n.GT._("identifier or residue specification expected");break;case 7:a=J.i18n.GT._("invalid atom specification");break;case 8:a=J.i18n.GT._("invalid chain specification");break;case 9:a=J.i18n.GT._("invalid expression token: {0}");
break;case 10:a=J.i18n.GT._("invalid model specification");break;case 11:a=J.i18n.GT._("missing END for {0}");break;case 12:a=J.i18n.GT._("number expected");break;case 13:a=J.i18n.GT._("number or variable name expected");break;case 14:a=J.i18n.GT._("residue specification (ALA, AL?, A*) expected");break;case 15:a=J.i18n.GT._("{0} expected");break;case 16:a=J.i18n.GT._("{0} unexpected");break;case 17:a=J.i18n.GT._("unrecognized expression token: {0}");break;case 18:a=J.i18n.GT._("unrecognized {0} parameter");
break;case 19:a=J.i18n.GT._("unrecognized token: {0}")}0>a.indexOf("{0}")?null!=b&&(a+=": "+b):(a=JU.PT.rep(a,"{0}",b),0<=a.indexOf("{1}")?a=JU.PT.rep(a,"{1}",c):null!=c&&(a+=": "+c));d||J.i18n.GT.setDoTranslate(e);return a},"~N,~S,~S,~B");e(c$,"commandExpected",function(){this.ichToken=this.ichCurrentCommand;return this.error(2)});e(c$,"error",function(a){return this.errorIntStr2(a,null,null)},"~N");e(c$,"errorStr",function(a,b){return this.errorIntStr2(a,b,null)},"~N,~S");e(c$,"errorIntStr2",function(a,
b,c){var d=JS.ScriptTokenParser.errorString(a,b,c,!0);a=J.i18n.GT.getDoTranslate()?JS.ScriptTokenParser.errorString(a,b,c,!1):null;return this.errorStr2(d,a)},"~N,~S,~S");e(c$,"isError",function(){return null!=this.errorMessage});e(c$,"errorStr2",function(a,b){this.errorMessage=a;this.errorMessageUntranslated=b;return!1},"~S,~S");M(c$,"ERROR_badArgumentCount",0,"ERROR_badContext",1,"ERROR_commandExpected",2,"ERROR_endOfCommandUnexpected",4,"ERROR_invalidExpressionToken",9,"ERROR_missingEnd",11,"ERROR_tokenExpected",
15,"ERROR_tokenUnexpected",16,"ERROR_unrecognizedParameter",18,"ERROR_unrecognizedToken",19,"ERROR_coordinateExpected",3,"ERROR_endOfExpressionExpected",5,"ERROR_identifierOrResidueSpecificationExpected",6,"ERROR_invalidAtomSpecification",7,"ERROR_invalidChainSpecification",8,"ERROR_invalidModelSpecification",10,"ERROR_numberExpected",12,"ERROR_numberOrVariableNameExpected",13,"ERROR_residueSpecificationExpected",14,"ERROR_unrecognizedExpressionToken",17)})})(Clazz,Clazz.newLongArray,Clazz.doubleToByte,
Clazz.doubleToInt,Clazz.doubleToLong,Clazz.declarePackage,Clazz.instanceOf,Clazz.load,Clazz.instantialize,Clazz.decorateAsClass,Clazz.floatToInt,Clazz.floatToLong,Clazz.makeConstructor,Clazz.defineEnumConstant,Clazz.exceptionOf,Clazz.newIntArray,Clazz.defineStatics,Clazz.newFloatArray,Clazz.declareType,Clazz.prepareFields,Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,Clazz.p0p,Clazz.pu$h,Clazz.newShortArray,Clazz.innerTypeInstance,Clazz.isClassDefined,Clazz.prepareCallback,Clazz.newArray,
Clazz.castNullAs,Clazz.floatToShort,Clazz.superCall,Clazz.decorateAsType,Clazz.newBooleanArray,Clazz.newCharArray,Clazz.implementOf,Clazz.newDoubleArray,Clazz.overrideConstructor,Clazz.clone,Clazz.doubleToShort,Clazz.getInheritedLevel,Clazz.getParamsType,Clazz.isAF,Clazz.isAI,Clazz.isAS,Clazz.isASS,Clazz.isAP,Clazz.isAFloat,Clazz.isAII,Clazz.isAFF,Clazz.isAFFF,Clazz.tryToSearchAndExecute,Clazz.getStackTrace,Clazz.inheritArgs,Clazz.alert,Clazz.defineMethod,Clazz.overrideMethod,Clazz.declareAnonymous,
Clazz.cloneFinals);
