(function(Z,ea,fa,ga,T,ha,L,u,M,O,Q,F,ba,R,ia,D,K,S,$,X,V,ja,Y,aa,ka,la,ma,P,na,oa,pa,qa,ca,da,ra,sa,ta,ua,va,wa,xa,ya,za,Aa,Ba,Ca,Da,Ea,Fa,Ga,Ha,Ia,Ja,Ka,La,f,s){L("J.api");Y(J.api,"JmolParallelProcessor");L("J.api");Y(J.api,"JmolScriptEvaluator");L("J.api");Y(J.api,"JmolScriptFunction");L("J.api");Y(J.api,"JmolScriptManager");L("JS");M(["J.thread.JmolThread"],"JS.CommandWatcherThread",["JU.Logger"],function(){var d=Q(function(){this.scriptManager=null;O(this,arguments)},JS,"CommandWatcherThread",
J.thread.JmolThread);R(d,function(){V(this,JS.CommandWatcherThread,[])});s(d,"setManager",function(a,b){this.scriptManager=a;this.setViewer(b,"CommmandWatcherThread");return 0},"~O,JV.Viewer,~O");s(d,"run",function(){for(Thread.currentThread().setPriority(1);!this.stopped;)try{Thread.sleep(50),this.stopped||this.scriptManager.runScriptNow()}catch(a){if(D(a,"InterruptedException")){var b=a;JU.Logger.warn("CommandWatcher InterruptedException! "+this);break}else if(D(a,Exception)){b=a;JU.Logger.warn("CommandWatcher Exception! script processing ERROR:\n\n"+
b.toString());break}else throw a;}});s(d,"run1",function(){},"~N")});L("JS");M(["J.thread.JmolThread"],"JS.FileLoadThread",["JV.Viewer"],function(){var d=Q(function(){this.key=this.cacheName=this.fileName=null;O(this,arguments)},JS,"FileLoadThread",J.thread.JmolThread);R(d,function(a,b,c,e,g){this.setViewer(b,"FileLoadThread");this.fileName=c;this.key=e;this.cacheName=g;this.setEval(a);this.sc.pc--},"J.api.JmolScriptEvaluator,JV.Viewer,~S,~S,~S");s(d,"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}null!=JV.Viewer.jmolObject&&JV.Viewer.jmolObject.loadFileAsynchronously(this,this.vwr.html5Applet,this.fileName,null);return;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");f(d,"setData",function(a,b,c){var e=a.equals("#CANCELED#");this.sc.parentContext.htFileCache.put(this.key,e?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")});L("JS");M(["JS.ScriptTokenParser","JU.Lst"],"JS.ScriptCompiler","java.util.Hashtable JU.AU $.BS $.PT $.SB J.api.Interface J.i18n.GT JM.BondSet $.Group JS.ContextToken $.SV $.ScriptContext $.ScriptError $.ScriptFlowContext $.ScriptFunction $.ScriptManager $.T JU.Edge $.Escape $.Logger JV.FileManager $.Viewer".split(" "),function(){var d=
Q(function(){this.filename=null;this.isSilent=!1;this.lineIndices=this.lineNumbers=this.aatokenCompiled=this.contextVariables=null;this.lnLength=8;this.isPrivateScript=this.isPrivateFunc=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.forceFlowContext=null;this.haveENDIF=this.isWhere=!1;this.chFirst="\x00";
this.afterMath=0;O(this,arguments)},JS,"ScriptCompiler",JS.ScriptTokenParser);X(d,function(){this.vPush=new JU.Lst});R(d,function(a){V(this,JS.ScriptCompiler,[]);this.vwr=a},"JV.Viewer");f(d,"compile",function(a,b,c,e,g,n){this.isCheckOnly=n;this.filename=a;this.isSilent=e;this.script=b;this.isWhere=b.startsWith("w_h_e_r_e = ");this.logMessages=!e&&!c&&g;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.isEditor=null!=this.scriptExtensions&&0<=this.scriptExtensions.indexOf("\u0001## ISEDITOR");c.errorType=this.errorType;null!=this.errorType&&(c.iCommandError=this.iCommand,this.setAaTokenCompiled());c.saveTokens(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");f(d,"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");d.addContextVariable=f(d,"addContextVariable",function(a,b){a.put(b,JS.SV.newS("").setName(b))},"java.util.Map,~S");f(d,"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");f(d,"cleanScriptComments",function(a){0<=a.indexOf("\u00a0")&&(a=a.$replace("\u00a0"," "));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.allowMissingEnd=0<=a.indexOf("\u0001##NOENDCHECK",b),this.scriptExtensions=a.substring(b),a=a.substring(0,b));this.haveComments=0<=a.indexOf("#");return JV.FileManager.getEmbeddedScript(a)},"~S");f(d,"addTokenToPrefix",
function(a){this.logMessages&&JU.Logger.info("addTokenToPrefix"+this.lineCurrent+" "+this.iCommand+" "+a);this.ltoken.addLast(a);0!=a.tok&&(this.lastToken=a)},"JS.T");f(d,"compile0",function(a){this.haveENDIF=!1;this.script=this.cleanScriptComments(this.script);this.ichToken=this.script.indexOf("# Jmol state version ");if(this.isStateScript=0<=this.ichToken&&10>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;a:for(;;){this.vFunctionStack=new JU.Lst;this.htUserFunctions=new java.util.Hashtable;this.errorLine=this.errorMessageUntranslated=this.errorMessage=this.errorType=this.flowContext=this.thisFunction=this.aatokenCompiled=this.lineIndices=this.lineNumbers=this.contextVariables=null;this.isPrivateFunc=this.isPrivateScript=!1;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=aa(this.lnLength,0);this.lineIndices=K(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.forceFlowContext=this.lastFlowCommand=null;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;if(null!=this.flowContext){for(this.ichCurrentCommand=this.ichToken=this.cchScript;null!=this.flowContext;)if(this.fixFlowAddLine(this.flowContext),!this.haveENDIF&&this.flowContext.checkForceEndIf(0))this.forceFlowEnd(this.flowContext.token),this.processTokenList(b,a);else return this.lineCurrent=this.flowContext.lineStart,this.iCommand=this.flowContext.pt0,
this.ichCurrentCommand=this.lineIndices[this.iCommand][0],this.ichToken=this.ichEnd=this.lineIndices[this.iCommand][1],this.errorStr(11,null==this.flowContext.$function?JS.T.nameOf(this.flowContext.token.tok):this.flowContext.$function.getSignature());this.lltoken.addLast(P(-1,[JS.T.o(0,"// end of script")]))}this.setAaTokenCompiled();return!0}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;case 5:this.haveENDIF=!0;continue a}switch(this.parseCommandParameter(b,a)){case 2:continue;case 4:return!1;case 5:this.haveENDIF=!0;continue a}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");f(d,"setAaTokenCompiled",function(){this.aatokenCompiled=this.lltoken.toArray(Array(this.lltoken.size()))});f(d,"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});f(d,"isLineContinuation",function(a,b){var c=a+2<this.cchScript&&
"\\"==this.script.charAt(a)&&0<this.nCharNewLine(a+1)||!this.isShowScriptOutput&&b&&this.lookingAtMathContinuation(a);c&&this.lineCurrent++;return c},"~N,~B");f(d,"lookingAtMathContinuation",function(a){var b;if(0==(b=this.nCharNewLine(a))||1073742332==this.lastToken.tok)return!1;if(0<this.parenCount||0<this.bracketCount)return!0;switch(this.tokCommand){case 134320141:case 102436:return this.flowContext.forceEndIf=!1;case 134320648:case 102406:case 134320649:case 364547:case 102402:return this.haveENDIF||
(this.flowContext.addLine=1,this.flowContext.forceEndIf=!0),!1;case 36867:if(1<this.nTokens&&537022465==this.ltoken.get(1).tok)return!1;case 36865:case 36869:break;default: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");f(d,"lookingAtEndOfLine",function(){return this.ichToken>=this.cchScript?(this.ichEnd=this.cchScript,!0):0<(this.cchToken=this.nCharNewLine(this.ichEnd=
this.ichToken))});f(d,"nCharNewLine",function(a){var b;return"\r"!=(b=this.charAt(a))?"\n"==b?1:0:"\n"==this.charAt(++a)?2:1},"~N");f(d,"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});f(d,"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).charCodeAt(0)){case 47:c=this.ichToken;this.ichEnd=b-1;break;case 42: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 e=0>c;if(e&&!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(!e&&";"==a)continue;break}0<=c||"#"==a&&(c=b)}if(0>c)return 0;this.ichComment=c;if(e&&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(e&&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;!e&&(10==this.cchToken&&this.script.substring(this.ichToken,b).equals("//@private"))&&(this.isPrivateScript=!0);return 0==this.nTokens?1:2});f(d,"charAt",function(a){return a<this.cchScript?
this.script.charAt(a):"\x00"},"~N");f(d,"processTokenList",function(a,b){var c=this.ltoken.size();if(0<c||null!=this.comment){if(0==c)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<c&&1073742336==this.tokAt(2)&&(1275068444==this.tokAt(3)||1140850693==this.tokAt(3)||1275335685==this.tokAt(3)||
1275334681==this.tokAt(3))?(this.ltoken.set(0,JS.T.tokenSet),this.ltoken.add(1,1275334681==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==c&&1==this.braceCount)if(null==this.lastFlowCommand){this.parenCount=this.setBraceCount=
this.braceCount=0;this.ltoken.removeItemAt(0);var e=JS.ContextToken.newContext(!0);this.addTokenToPrefix(this.setCommand(e));this.pushContext(e);this.addBrace(this.tokenCommand)}else this.parenCount=this.setBraceCount=0,this.setCommand(this.lastFlowCommand),102439!=this.lastFlowCommand.tok&&1073742332==this.tokAt(0)&&this.ltoken.removeItemAt(0),this.lastFlowCommand=null,this.forceFlowContext=this.flowContext;if(0<this.bracketCount||0<this.setBraceCount||0<this.parenCount||1==this.braceCount&&!this.checkFlowStartBrace(!0))return this.error(1==
c?2:4),4;this.needRightParen&&(this.addTokenToPrefix(JS.T.tokenRightParen),this.needRightParen=!1);if(1073741974==this.tokAt(1)&&JS.T.tokAttr(this.tokCommand,135168))switch(this.tokAt(2)){case 0:case 4:case 12290:break;default:e=this.ltoken.removeItemAt(2),this.ltoken.add(2,JS.T.o(4,2==e.tok?""+e.intValue:e.value.toString()))}if(0<this.ltoken.size()){if(b&&!this.compileCommand())return 4;this.logMessages&&JU.Logger.info("-------------------------------------");e=!0;switch(this.tokCommand){case 364558:case 102436:case 134320141:case 102409:e=
0<this.atokenInfix.length&&2147483647!=this.atokenInfix[0].intValue}e&&(this.iCommand==this.lnLength&&(this.lineNumbers=JU.AU.doubleLengthShort(this.lineNumbers),e=K(2*this.lnLength,2,0),System.arraycopy(this.lineIndices,0,e,0,this.lnLength),this.lineIndices=e,this.lnLength*=2),this.lineNumbers[this.iCommand]=this.lineNumbers[this.lineNumbers.length-1]=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());36867==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}var e=null!=
this.flowContext&&0==this.flowContext.addLine,g=(this.endOfLine||!e)&&!this.haveENDIF&&null!=this.flowContext&&this.flowContext.checkForceEndIf(-1);if(this.endOfLine){if(g){if(this.isComment)e||(this.flowContext.addLine++,this.flowContext.forceEndIf=!0);else if(0<c&&!this.haveENDIF||e)this.forceFlowEnd(this.flowContext.token),e||(this.forceFlowContext.forceEndIf=!0);this.isEndOfCommand=!0;this.cchToken=0;this.ichCurrentCommand=this.ichToken;return 2}this.isShowCommand=this.isComment=!1;++this.lineCurrent}else g&&
(this.forceFlowEnd(this.flowContext.token),this.forceFlowContext.forceEndIf=!0);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");f(d,"addBrace",function(a){this.vBraces.addLast(a);this.iBrace++},"JS.T");f(d,"pushContext",function(a){this.pushCount++;this.vPush.addLast(a)},"JS.T");f(d,"wasImpliedScript",function(){if(this.checkImpliedScriptCmd&&
2<=this.nTokens&&(134222850==this.tokCommand||4124==this.tokCommand)){var a=2==this.nTokens?this.lastToken.value.toString().toUpperCase():null;if(2<this.nTokens?!(268435968==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});f(d,"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&&268442114!=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()));
return this.compileExpressions()});f(d,"tokenAt",function(a){return this.ltoken.get(a)},"~N");s(d,"tokAt",function(a){return a<this.ltoken.size()?this.tokenAt(a).tok:0},"~N");f(d,"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=36867==this.tokCommand||12290==this.tokCommand,this.isCommaAsOrAllowed=JS.T.tokAttr(this.tokCommand,
12288),this.implicitString=JS.T.tokAttr(this.tokCommand,20480));return a},"JS.T");f(d,"replaceCommand",function(a){this.ltoken.removeItemAt(0);this.ltoken.add(0,this.setCommand(a))},"JS.T");f(d,"getPrefixToken",function(){this.ident=this.script.substring(this.ichToken,this.ichToken+this.cchToken);if(this.ident.equals("NaN"))return this.addTokenToPrefix(JS.SV.vNaN),3;this.identLC=this.ident.toLowerCase();var a=1073742336!=this.lastToken.tok&&!this.isDotDot&&this.isContextVariable(this.identLC),b=this.ident,
c=null;0==this.nTokens&&(this.isUserToken=a);if(1==this.nTokens&&(134320141==this.tokCommand||102436==this.tokCommand||36868==this.tokCommand)||0!=this.nTokens&&a||!this.isDotDot&&this.isUserFunction(this.identLC)&&null!=(c=this.ident)&&(null==this.thisFunction||!this.thisFunction.name.equals(this.identLC)))this.ident=null==c?this.identLC:c,this.theToken=null;else if(1==this.ident.length||268436482==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),a&&(null!=this.theToken&&!this.theToken.value.toString().equalsIgnoreCase(this.identLC))&&(this.theToken=null),null!=this.theToken)switch(this.lastToken.tok){default:if(!this.isWhere)break;case 1073742336:case 268437504:case 268436992:this.theToken=JS.T.o(this.theToken.tok,this.ident)}null==this.theToken&&(this.theToken=JS.SV.newSV(0==
this.identLC.indexOf("property_")?1715472409:1073741824,2147483647,this.ident).setName(b));return this.theTok=this.theToken.tok});f(d,"checkSpecialParameterSyntax",function(){if(this.lookingAtString(!this.implicitString)){if(0>this.cchToken)return this.ERROR(4);var a=this.getUnescapedStringLiteral(null!=this.lastToken&&!this.iHaveQuotedString&&1073741984!=this.lastToken.tok&&(36867==this.tokCommand&&2==this.nTokens&&545259546==this.lastToken.tok||134223363==this.tokCommand||1610616835==this.tokCommand||
134222850==this.tokCommand||4124==this.tokCommand));this.iHaveQuotedString=!0;if((134223363==this.tokCommand||135174==this.tokCommand)&&134221834==this.lastToken.tok||134221834==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,e=this.charAt(this.ichToken+1);if(!this.isNewSet&&this.isUserToken&&c&&("="==a||e==a||"="==e))this.isNewSet=!0;if(this.isNewSet||36867==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&&"."==e?JS.T.tokenSetArray:JS.T.tokenSetProperty),this.ltoken.add(0,this.tokenCommand),this.cchToken=
1,a.charCodeAt(0)){case 91:return this.tokLastMath=1,this.addTokenToPrefix(JS.T.tokenArrayOpen),this.bracketCount++,2;case 46:if("."==e)return this.addTokenToPrefix(JS.T.tokenArrayOpen),this.cchToken=2,this.isDotDot=!0,2;this.addTokenToPrefix(JS.T.o(1073742336,"."));return 2;case 45:case 43:case 42:case 47:case 92:case 38:case 124:if(0==e.charCodeAt(0))return this.ERROR(4);if(e!=a&&"="!=e)return this.ERROR(1,'"'+a+'"');break;default:return this.lastToken=JS.T.tokenMinus,2}}a:switch(this.tokCommand){case 134222350:switch(this.lastToken.tok){case 4120:case 1296041985:case 1715472409:case 1073877010:2==
this.nTokens&&(this.iHaveQuotedString=!0);break;case 1073741925:case 1073742189:break;default:if(!this.iHaveQuotedString&&2!=this.nTokens)return 0;break}case 134223363:case 134222850:case 4124:case 1275072526:if("@"==this.script.charAt(this.ichToken))return this.iHaveQuotedString=!0,0;switch(this.tokCommand){case 4124:this.haveMacro=!0;break a;case 134223363:a=1073741839==this.tokAt(1);if(1==this.nTokens||a&&(2==this.nTokens||3==this.nTokens&&2==this.tokAt(2))){if(a&&2==this.nTokens&&JU.PT.isDigit(this.charAt(this.ichToken)))break a;
a=JV.Viewer.isDatabaseCode(this.charAt(this.ichToken));if(this.lookingAtLoadFormat(a)){var g=this.script.substring(this.ichToken,this.ichToken+this.cchToken),n=JS.T.getTokenFromName(g.toLowerCase());switch(null==n?0:n.tok){case 1073742015:case 1073742077:case 1073741839:case 1610616855:case 4130:case 1073877011:if(1!=this.nTokens)return 4;case 36868:case 134221834:case 1228935687:case 134217764:case 1073741984:case 1094717454:case 134218757:case 536870926:case 1073741849:case 1073741851:this.addTokenToPrefix(n);
break;default:n=a?4:JU.PT.isOneOf(g=g.toLowerCase(),";xyz;vxyz;vibration;temperature;occupancy;partialcharge;")?1073741824:0,0!=n&&(this.addTokenToPrefix(JS.T.o(n,g)),this.iHaveQuotedString=4==n)}return 2}break}if("{"==this.script.charAt(this.ichToken)||0<this.parenCount)break a;if(null!=(a=this.lookingAtBitset()))return this.addTokenToPrefix(JS.T.o(10,a)),2}if(!this.iHaveQuotedString&&this.lookingAtImpliedString(134222350==this.tokCommand,134223363==this.tokCommand,1<this.nTokens||134222850!=this.tokCommand&&
4124!=this.tokCommand)){a=this.script.substring(this.ichToken,this.ichToken+this.cchToken);if(134222850==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 g=this.script.substring(this.ichToken,
this.ichToken+this.cchToken),n=JU.PT.parseInt(g),-2147483648==n||1E3>Math.abs(n)?this.addTokenToPrefix(JS.T.o(1073741824,g)):this.addTokenToPrefix(JS.T.i(n)),2;break;case 134221856: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)&&(a=this.script.substring(this.ichToken,this.ichToken+this.cchToken),b=a.indexOf(" as "),0<b&&(a=a.substring(0,
this.cchToken=b)),0>a.indexOf(" ")&&0<=a.indexOf(".")))return this.addTokenToPrefix(JS.T.o(4,a)),this.iHaveQuotedString=!0,2}}if((this.implicitString=(new Boolean(this.implicitString&1==this.nTokens)).valueOf())&&(!(134222850==this.tokCommand||4124==this.tokCommand)||!this.iHaveQuotedString)&&this.lookingAtImpliedString(!0,!0,!0))return a=this.script.substring(this.ichToken,this.ichToken+this.cchToken),1825200146==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;a=this.lookingAtExponential();if(null!=a)return this.addNumber(3,2147483647,a),2;if(this.lookingAtDecimal())return a=Float.$valueOf(this.script.substring(this.ichToken,this.ichToken+this.cchToken)),g=JU.Edge.getFloatEncodedInt(this.script.substring(this.ichToken,this.ichToken+
this.cchToken)),this.addNumber(3,g,a),2;if(this.lookingAtSeqcode()){a=this.script.charAt(this.ichToken);try{g="*"==a||"^"==a?2147483647:Integer.parseInt(this.script.substring(this.ichToken,this.ichToken+this.cchToken-2));n=this.script.charAt(this.ichToken+this.cchToken-1);"^"==n&&(n=" ");0>g&&(g=-g,this.addTokenToPrefix(JS.T.tokenMinus));var h=JM.Group.getSeqcodeFor(g,n);this.addTokenToPrefix(JS.T.tv(5,h,"seqcode"))}catch(d){if(D(d,"NumberFormatException"))return this.ERROR(9,""+a);throw d;}return 2}g=
this.lookingAtInteger();if(2147483647!=g){n=this.script.substring(this.ichToken,this.ichToken+this.cchToken);if(102407==this.tokCommand||102408==this.tokCommand){if(1!=this.nTokens)return this.ERROR(0);h=null==this.flowContext?null:this.flowContext.getBreakableContext(g=Math.abs(g));if(null==h)return this.ERROR(1,this.tokenCommand.value);this.tokenAt(0).intValue=h.pt0}this.addNumber(2,g,n);return 2}if(!this.isMathExpressionCommand&&0==this.parenCount||1073741824!=this.lastToken.tok&&!JS.ScriptTokenParser.tokenAttr(this.lastToken,
134217728)){g="["==this.script.charAt(this.ichToken);a=this.lookingAtBitset();if(null!=a)return this.addTokenToPrefix(JS.T.o(10,g?JM.BondSet.newBS(a):a)),2;if(g&&(g=this.lookingAtMatrix(),u(g,"JU.M34")))return this.addTokenToPrefix(JS.T.o(u(g,"JU.M4")?12:11,g)),2}return 0});f(d,"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");f(d,"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});f(d,"parseKnownToken",function(){var a=this.getPrefixToken();if(3==a)return 2;var b;if(this.isDotDot)return 268437504==a?this.bracketCount++:(this.addTokenToPrefix(JS.T.o(4,this.ident)),this.addTokenToPrefix(JS.T.tokenArrayClose)),this.isDotDot=!1,2;0!=this.tokLastMath&&(this.tokLastMath=
a);if(null!=this.flowContext&&102410==this.flowContext.token.tok&&null!=this.flowContext.$var&&102411!=a&&102413!=a&&102410!=this.lastToken.tok)return this.ERROR(1,this.ident);if(12290==this.lastToken.tok&&1073742332!=a&&1!=this.nTokens)return this.addTokenToPrefix(12290==a?this.lastToken:JS.T.o(4,this.ident)),2;switch(a){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 268442114:if(this.nSemiSkip==this.forPoint3&&this.nTokens==this.ptSemi+2)return b=this.lastToken,this.addTokenToPrefix(JS.T.tokenEquals),this.addTokenToPrefix(b),b=JS.T.getTokenFromName(this.ident.substring(0,1)),this.addTokenToPrefix(b),this.addTokenToPrefix(JS.T.tokenLeftParen),this.needRightParen=!0,2;this.checkNewSetCommand();
return 36867==this.tokCommand?(this.tokenAndEquals=JS.T.getTokenFromName(this.ident.substring(0,1)),this.setEqualPt=this.ichToken,0):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,0):2;case 268441601:case 268441602: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(a,!1),2;if(this.nSemiSkip==this.forPoint3&&this.nTokens==this.ptSemi+2)return b=this.lastToken,this.addTokenToPrefix(JS.T.tokenEquals),this.addTokenToPrefix(b),this.addTokenToPrefix(268441601==a?JS.T.tokenMinus:JS.T.tokenPlus),this.addTokenToPrefix(JS.T.i(1)),2;break;case 268440324:0==this.parenCount&&
0==this.bracketCount&&(this.setEqualPt=this.ichToken);break;case 1073742336:36867==this.tokCommand&&(0==this.parenCount&&0==this.bracketCount&&this.ichToken<this.setEqualPt&&1<this.ltoken.size()&&1073742332==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 1073742332:if(1==++this.braceCount&&0==this.parenCount&&this.checkFlowStartBrace(!1))return this.isEndOfCommand=
!0,a=null!=this.flowContext&&0==this.flowContext.addLine||null==this.forceFlowContext?this.flowContext:this.forceFlowContext,null!=a&&(a.addLine=0,a.forceEndIf=!1,this.lastToken=JS.T.tokenLeftBrace,this.forceFlowContext=a),2;this.parenCount++;break;case 268435968:this.parenCount++;if(1<this.nTokens&&(1275082241==this.lastToken.tok||134320648==this.lastToken.tok||134320649==this.lastToken.tok))this.nSemiSkip+=2;break;case 1073742338: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,this.addBrace(this.theToken),this.isEndOfCommand=!0,this.ichEnd=this.ichToken),2;this.braceCount--;case 268435969: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 268437504:0<this.ichToken&&JU.PT.isWhitespace(this.script.charAt(this.ichToken-
1))&&this.addTokenToPrefix(JS.T.tokenSpaceBeforeSquare);this.bracketCount++;break;case 268437505:this.bracketCount--;if(0>this.bracketCount)return this.ERROR(16,"]");break;case 1073742337:return this.isDotDot=!0,this.addTokenToPrefix(JS.T.tokenArrayOpen),2}switch(this.lastToken.tok){case 1073742336:case 1073742337:case 268436992:case 268437504:return 0}switch(a){case 4134:return this.isPrivateFunc=!0,2;case 102409:if(135174==this.tokCommand||4103==this.tokCommand&&1==this.nTokens)break;if(!this.haveENDIF)return 5;
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 134320648:case 102411:case 102413:case 102402:case 134320649:case 102410:case 102406:case 102412:if(1<this.nTokens&&36867!=this.tokCommand&&0==this.nSemiSkip)return this.isEndOfCommand=!0,null!=this.flowContext&&(this.flowContext.forceEndIf=!0),this.cchToken=0,2}return 0});f(d,"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(268441601==a?JS.T.tokenMinus:JS.T.tokenPlus);this.addTokenToPrefix(JS.T.i(1))},"~N,~B");f(d,"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});f(d,"parseCommandParameter",function(a,b){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);this.logMessages&&JU.Logger.info("compiling "+this.theToken);var c=JS.T.tokAttr(this.tokCommand,102400);c&&(this.lastFlowCommand=this.tokenCommand);var e=this.checkFlowEndBrace();if(4==e)return 4;if(2==e)return this.isEndOfCommand=
!0,this.cchToken=0,268435968==this.theTok&&this.parenCount--,2;switch(this.theTok){case 1073742332:break;case 268436482:return this.braceCount++,this.isEndOfCommand=!0,0;case 102409:return 0;case 364547:case 102402:if(this.fixFlowAddLine(this.flowContext),102409==this.lltoken.get(this.iCommand-1)[0].tok&&null!=this.forceFlowContext&&this.forceFlowContext.forceEndIf&&0<this.forceFlowContext.addLine&&this.isFlowIfContextOK(this.forceFlowContext))this.flowContext=this.forceFlowContext,this.flowContext.forceEndIf=
!0,this.lltoken.removeItemAt(--this.iCommand);else if(null!=this.flowContext&&0<this.flowContext.addLine)for(;null!=this.flowContext&&!this.isFlowIfContextOK(this.flowContext);)if(this.flowContext.checkForceEndIf(0))this.forceFlowEnd(this.flowContext.token),this.processTokenList(a,b),this.fixFlowAddLine(this.flowContext),this.setCommand(this.theToken),this.theTok=this.theToken.tok;else break;default:if(c)switch(this.checkFlowCommand(this.tokenCommand.value)){case 4:return 4;case 2:return 2;case 5:return 5;
case 0:return this.theToken=this.tokenCommand,102411==this.theTok&&(this.addTokenToPrefix(this.tokenCommand),this.theToken=JS.T.tokenLeftParen),0}if(null!=this.flowContext&&!this.haveENDIF&&0<this.flowContext.addLine)for(this.fixFlowAddLine(this.flowContext);null!=this.flowContext;)if(this.flowContext.checkForceEndIf(0))this.forceFlowEnd(this.flowContext.token),this.processTokenList(a,b),this.setCommand(this.theToken),this.theTok=this.theToken.tok;else break;if(1073742338==this.theTok)return this.forceFlowContext=
null,this.addBrace(this.tokenCommand),this.tokCommand=0,2;this.lastFlowCommand=null}if(268438528==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=1073742332==this.theTok)this.lookingAtSetBraceSyntax()||(this.isEndOfCommand=!0,null!=this.flowContext&&(this.flowContext.forceEndIf=!1));else switch(this.theTok){case 268441602:case 268441601:return this.tokInitialPlusPlus=
this.theTok,this.tokCommand=0,2;case 1073741824:case 36868:case 12290:case 268435968: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(268435968!=this.theTok)return this.ERROR(15,"(");break;case 2:268435969!=this.theTok&&(this.tokenCommand.name0=this.ident);this.newContextVariable(this.ident);
break;case 3:if(268435969!=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 134320141: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?J.api.Interface.getInterface("JS.ScriptParallelProcessor",
null,null):new JS.ScriptFunction(this.ident,this.tokCommand);this.thisFunction.set(this.ident,this.tokCommand);this.thisFunction.isPrivate=this.isStateScript||this.isPrivateScript||this.isPrivateFunc;this.isPrivateFunc=!1;this.htUserFunctions.put(this.ident,Boolean.TRUE);this.flowContext.setFunction(this.thisFunction);break}if(2==this.nTokens){if(268435968!=this.theTok)return this.ERROR(15,"(");break}if(3==this.nTokens&&268435969==this.theTok)break;if(0==this.nTokens%2){if(268436992!=this.theTok&&
268435969!=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&&268436482==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&&134320649!=this.theTok)return this.isEndOfCommand=!0,
this.cchToken=0,2;if(1!=this.nTokens||134320649!=this.theTok&&1073742332!=this.theTok)return this.ERROR(0);this.replaceCommand(this.flowContext.token=JS.ContextToken.newCmd(102402,"elseif"));this.tokCommand=102402;return 2;case 102409:if(1!=this.nTokens)return this.ERROR(0);if(!this.checkFlowEnd(this.theTok,this.ident,this.ichCurrentCommand,!0))return 4;if(134320141==this.theTok||102436==this.theTok)return 2;break;case 134320648:if(1==this.nTokens){if(268435968!=this.theTok)return this.ERROR(19,this.ident);
this.forPoint3=this.nSemiSkip=0;this.nSemiSkip+=2;break}if(3==this.nTokens&&36868==this.tokAt(2)){this.newContextVariable(this.ident);break}if((3==this.nTokens||4==this.nTokens)&&1275068432==this.theTok){this.nSemiSkip-=2;this.forPoint3=2;this.addTokenToPrefix(this.theToken);this.theToken=JS.T.tokenLeftParen;break}case 102410:case 102406:case 102402:case 134320649:if(2>=this.nTokens||0!=this.braceCount||0!=this.parenCount)break;case 102439:this.isEndOfCommand=!0;this.ichEnd=this.ichToken+1;this.flowContext.setLine();
break;case 36868: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||this.ident.equals("["))return this.ERROR(0);this.replaceCommand(JS.T.tokenSet)}}case 36867:1073742332==this.theTok?this.setBraceCount++:1073742338==this.theTok&&(this.setBraceCount--,this.isSetBrace&&(0==this.setBraceCount&&2147483647==
this.ptNewSetModifier)&&(this.ptNewSetModifier=this.nTokens+1));if(this.nTokens==this.ptNewSetModifier){c=this.tokenAt(0);if(268435968==this.theTok||this.isUserFunction(c.value.toString())){this.ltoken.set(0,this.setCommand(JS.T.tv(1073741824,0,c.value)));this.setBraceCount=0;break}if(1073741824!=this.theTok&&268442114!=this.theTok&&12290!=this.theTok&&!JS.T.tokAttr(this.theTok,536870912))return this.isNewSet?this.commandExpected():this.errorIntStr2(18,"SET",": "+this.ident),4;if(1==this.nTokens&&
(268441602==this.lastToken.tok||268441601==this.lastToken.tok)){this.replaceCommand(JS.T.tokenSet);this.addTokenToPrefix(this.lastToken);break}}break;case 134223363:if(12290==this.theTok&&(1==this.nTokens||1073741940==this.lastToken.tok||134217764==this.lastToken.tok))return this.addTokenToPrefix(JS.T.tokenDefineString),2;1073741848==this.theTok&&(this.iHaveQuotedString=!1);break;case 12290:if(1==this.nTokens){if(1073741824!=this.theTok)if(this.preDefining){if(!JS.T.tokAttr(this.theTok,2097152))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,2097152)?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&&268440324==this.theTok)return this.ltoken.add(0,JS.T.tokenSet),2;break;case 135190:case 135188:case 135180:c=this.charAt(this.ichToken+this.cchToken),0==this.parenCount&&(0==this.bracketCount&&0<=".:/\\+-!?".indexOf(c)&&!("-"==c&&this.ident.equals("=")))&&this.checkUnquotedFileName()}return 0},"~N,~B");f(d,"setNewSetCommand",function(a,b){this.tokCommand=36867;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||268435968==this.theToken.tok||536870918==this.theToken.tok||268441602==this.theToken.tok||268441601==this.theToken.tok?this.theToken:JS.T.o(1073741824,b)},"~B,~S");f(d,"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)});f(d,"checkFlowStartBrace",function(a){var b=this.tokCommand;switch(b){default:if(JS.T.tokAttr(b,102400)){if(a){switch(b){case 102411:case 102413:break;default:this.flowContext.addLine=0,this.addBrace(this.tokenCommand),this.lastFlowCommand=null}this.parenCount=this.braceCount=0}return!0}case 102407:case 102408:return!1}},"~B");f(d,"checkFlowEndBrace",function(){if(0>=this.iBrace||1073742338!=this.vBraces.get(this.iBrace-1).tok)return 0;this.vBraces.removeItemAt(--this.iBrace);var a=this.vBraces.removeItemAt(--this.iBrace);
1073742332==this.theTok&&(this.braceCount--,this.parenCount--);if(1275335685==a.tok)return this.vPush.removeItemAt(--this.pushCount),this.addTokenToPrefix(this.setCommand(JS.ContextToken.newContext(!1))),this.isEndOfCommand=!0,2;switch(null==this.flowContext?0:this.flowContext.token.tok){case 134320649: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)});
f(d,"forceFlowEnd",function(a){var b=this.tokenCommand;this.forceFlowContext=this.flowContext;a=this.flowStart(a);if(!this.checkFlowEnd(a.tok,a.value,this.ichBrace,!1))return 4;switch(a.tok){case 134320141:case 102436:case 364558:break;default:this.addTokenToPrefix(a)}this.setCommand(b);return 2},"JS.T");f(d,"flowStart",function(a){switch(a.tok){case 134320649:case 364547:case 102402:return JS.T.tokenIf;case 102413:case 102411:return JS.T.tokenSwitch;default:return JS.T.getTokenFromName(a.value)}},
"JS.T");d.isBreakableContext=f(d,"isBreakableContext",function(a){return 134320648==a||102439==a||102406==a||102411==a||102413==a},"~N");f(d,"checkFlowCommand",function(a){var b=this.lltoken.size();switch(this.tokCommand){case 364548:if(!this.isFlowIfContextOK(this.flowContext)){if(!this.haveENDIF)return 5;this.errorStr(1,a);return 4}this.flowContext.token.intValue=this.flowContext.setPt0(b,!1);this.setFlowEnd(this.tokCommand,a);this.flowContext=this.flowContext.parent;return 0;case 102407:case 102408:b=
null==this.flowContext?null:this.flowContext.getBreakableContext(0);if(102408==this.tokCommand)for(;null!=b&&134320648!=b.token.tok&&102406!=b.token.tok;)b=b.parent;if(null==b)return this.errorStr(1,a),4;this.setCommand(JS.T.tv(this.tokCommand,b.pt0,a));this.theToken=this.tokenCommand;return 1;case 134320141:case 102436:if(null!=this.flowContext)return this.errorStr(1,JS.T.nameOf(this.tokCommand)),4;break;case 102402:case 364547:null!=this.flowContext&&!this.isFlowIfContextOK(this.flowContext)&&(this.flowContext=
this.flowContext.parent);if(!this.isFlowIfContextOK(this.flowContext)){if(!this.haveENDIF)return 5;this.errorStr(1,a);return 4}this.flowContext.token.intValue=this.flowContext.setPt0(b,!1);break;case 102411:case 102413:if(null==this.flowContext||102410!=this.flowContext.token.tok&&102411!=this.flowContext.token.tok&&(102413==this.tokCommand?0<this.flowContext.ptDefault:102413!=this.flowContext.token.tok))return this.errorStr(1,a),4;this.flowContext.token.intValue=this.flowContext.setPt0(b,102413==
this.tokCommand)}a=JS.ContextToken.newCmd(this.tokCommand,this.tokenCommand.value);102410==this.tokCommand&&a.addName("_var");this.setCommand(a);switch(this.tokCommand){case 364558:this.flowContext=new JS.ScriptFlowContext(this,a,b,this.flowContext,this.ichCurrentCommand,this.lineCurrent);null!=this.thisFunction&&this.vFunctionStack.add(0,this.thisFunction);this.thisFunction=new JS.ScriptFunction("",364558);this.flowContext.setFunction(this.thisFunction);this.pushContext(a);break;case 102411:case 102413:a.contextVariables=
this.flowContext.token.contextVariables;case 364547:case 102402:this.flowContext.token=a;break;case 102439:case 134320648:case 102406:case 102412:this.pushContext(a);default:this.flowContext=new JS.ScriptFlowContext(this,a,b,this.flowContext,this.ichCurrentCommand,this.lineCurrent)}return 0},"~S");f(d,"setFlowEnd",function(a,b){this.setCommand(JS.T.tv(a,0<this.flowContext.ptDefault?this.flowContext.ptDefault:-this.flowContext.pt0,b))},"~N,~S");f(d,"isFlowIfContextOK",function(a){switch(null==a?0:
a.token.tok){case 134320649:case 102402:return!0;case 364547:return 364547!=this.tokCommand}return!1},"JS.ScriptFlowContext");f(d,"checkFlowEnd",function(a,b,c,e){if(e){if(null==this.flowContext)return this.errorStr(1,"end "+b);this.flowContext.addLine=0;this.flowContext.forceEndIf=!1;switch(this.flowContext.token.tok){case 134320141:case 102436:case 364558:break;default:this.setFlowEnd(102409,"end"),this.ltoken.set(0,this.tokenCommand)}}else this.setFlowEnd(102409,"end"),this.addTokenToPrefix(this.tokenCommand);
if(null==this.flowContext||a!=this.flowContext.tok0)return this.errorStr(1,"end "+b);var g=this.lltoken.size();this.flowContext.token.intValue=102412==this.tokCommand?-g:g;switch(a){case 134320649:case 102410:break;case 102412:case 134320648:case 102439:case 102406:e||this.vPush.removeItemAt(--this.pushCount);break;case 102436:case 134320141: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.removeItemAt(0);this.tokenCommand.intValue=0;364558==a&&this.vPush.removeItemAt(--this.pushCount);break;default:return this.errorStr(19,"end "+b)}this.flowContext=this.flowContext.parent;this.fixFlowAddLine(this.flowContext);return!0},"~N,~S,~N,~B");f(d,"fixFlowAddLine",function(a){for(;null!=a;){if(0<a.addLine||a.forceEndIf)a.addLine=this.lineCurrent-a.ptLine,a.forceEndIf=!0;
a=a.parent}},"JS.ScriptFlowContext");f(d,"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(134221834,
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");f(d,"incrementLineCount",function(a){var b,c=a.indexOf("\r"),e=a.indexOf("\n");if(0>c&&0>e)return 0;var g=this.lineCurrent;if(0>c||e<c)c=e;for(e=a.length;--e>=c;)("\n"==(b=a.charAt(e))||"\r"==b)&&this.lineCurrent++;return this.lineCurrent-g},"~S");d.isSpaceOrTab=f(d,"isSpaceOrTab",function(a){return" "==a||"\t"==a},"~S");f(d,"eol",function(a){return"\x00"==
a||"\r"==a||"\n"==a||";"==a&&0>=this.nSemiSkip},"~S");f(d,"lookingAtSetBraceSyntax",function(){for(var a=this.ichToken,b=1;++a<this.cchScript&&0<b;)switch(this.script.charAt(a).charCodeAt(0)){case 123:b++;break;case 125:b--}if("["==this.charAt(a)&&1==++b)for(;++a<this.cchScript&&0<b;)switch(this.script.charAt(a).charCodeAt(0)){case 91:b++;break;case 93:"["==this.charAt(a+1)?a++:b--}return"."==this.charAt(a)&&0==b?!0:!1});f(d,"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");f(d,"getUnescapedStringLiteral",function(a){return 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,"))?a:JS.ScriptCompiler.unescapeString(this.script,this.ichToken+1,this.cchToken-2)},"~B");d.unescapeString=f(d,"unescapeString",function(a,b,c){var e=JU.SB.newN(c);for(c=b+c;b<c;){var g=a.charAt(b++);if("\\"==g&&b<c)switch(g=a.charAt(b++),g.charCodeAt(0)){case 110:g="\n";break;case 116:g="\t";break;case 114:g="\r";case 34:case 92:case 39:break;case 120:case 117:var n="x"==g?2:4;if(b<c){for(g=0;0<=--n&&b<c;){var h=a.charAt(b),h=JU.Escape.getHexitValue(h);if(0>h)break;g<<=4;g+=
h;++b}g=String.fromCharCode(g)}}e.appendC(g)}return e.toString()},"~S,~N,~N");f(d,"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");f(d,"lookingAtImpliedString",function(a,b,c){var e=this.ichToken,g=this.script.charAt(e),n=1073741974==this.lastToken.tok,h=JS.T.tokAttr(this.tokCommand,
20480)&&1==(this.tokCommand&1),d="@"==g;if(d&&(e+3<this.cchScript&&"{"==this.script.charAt(e+1))&&(n||!h))return!1;for(var h=n=-1,f=!0,r=0;f&&!this.eol(g=this.charAt(e));){switch(g.charCodeAt(0)){case 40:if(!c&&(4124==this.tokCommand||5<=e&&(this.script.substring(e-4,e).equals(".spt")||this.script.substring(e-4,e).equals(".png")||this.script.substring(e-5,e).equals(".pngj")))){f=!1;continue}break;case 61:if(!b){f=!1;continue}break;case 123:r++;break;case 125:if(r--,0>r&&(0<this.braceCount||0<this.iBrace)){f=
!1;continue}default:JU.PT.isWhitespace(g)?0>n&&(n=e):h=e}++e}if(d&&(0>n||n>h))return!1;a?e=h+1:0<n&&(e=n);return d&&(!a||0>n&&0>=r&&1<e-this.ichToken)?!1:0<(this.cchToken=e-this.ichToken)},"~B,~B,~B");f(d,"lookingAtExponential",function(){if(this.ichToken==this.cchScript)return null;var a=this.ichToken,b=a;"-"==this.script.charAt(a)&&++a;for(var c=!1,e="X";JU.PT.isDigit(e=this.charAt(a));)++a,c=!0;for(a<this.cchScript&&"."==e&&++a;JU.PT.isDigit(e=this.charAt(a));)++a,c=!0;if(a==this.cchScript||!c||
(c="E"!=e&&"e"!=e)||++a==this.cchScript)return null;e=this.script.charAt(a);for(("-"==e||"+"==e)&&a++;JU.PT.isDigit(this.charAt(a));)a++,c=!0;if(!c)return null;this.cchToken=a-this.ichToken;return Float.$valueOf(JU.PT.dVal(this.script.substring(b,a)))});f(d,"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;c=this.charAt(a);if(!JS.ScriptCompiler.isSpaceOrTab(c)&&
!this.eol(c)&&(JU.PT.isLetter(c)||"?"==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});f(d,"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});f(d,"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(!D(c,"NumberFormatException"))throw c;}return 2147483647});f(d,"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});f(d,"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.charCodeAt(0)){default:return!1;case 42:if(!a)return!1;case 126:case 95:}b++}this.cchToken=b-++this.ichToken;return!0});f(d,"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++)).charCodeAt(0)){case 45:case 43:case 38:case 124:case 42: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 47:if("/"==this.charAt(a))break;case 92:case 33:"="==this.charAt(a)&&++a;this.tokLastMath=1;break;case 41:case 93:case 125:break;case 46:"."==this.charAt(a)&&++a;this.tokLastMath=1;break;case 64:case 123:this.tokLastMath=2;break;case 58:this.tokLastMath=1;break;case 40:case 44:case 36:case 59:case 91:case 37:this.tokLastMath=1;break;case 60:case 61:case 62:("<"==(c=this.charAt(a))||
"="==c||">"==c)&&++a;this.tokLastMath=1;break;default:if(!JU.PT.isLetter(c)&&!this.isDotDot)return!1;case 126:case 95:case 39:case 63:"?"==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");f(d,"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});f(d,"ERROR",function(a){this.errorIntStr2(a,null,null);return 4},"~N");f(d,"ERROR",function(a,b){this.errorStr(a,b);return 4},"~N,~S");f(d,"handleError",function(){this.errorType=this.errorMessage;var a=this.script,b=a.indexOf("; ## GUI ##");0>b&&(b=this.ichEnd);this.errorLine=a.substring(this.ichCurrentCommand,Math.min(b,this.ichEnd<=this.ichCurrentCommand?this.ichToken+
this.cchToken:this.ichEnd));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})});L("JS");M(["J.thread.JmolThread"],"JS.ScriptDelayThread",null,function(){var d=Q(function(){this.seconds=this.millis=0;this.isPauseDelay=this.doPopPush=!1;O(this,arguments)},JS,"ScriptDelayThread",J.thread.JmolThread);R(d,function(a,b,c){V(this,JS.ScriptDelayThread,[]);this.setViewer(b,"ScriptDelayThread");this.millis=c;this.setEval(a)},
"J.api.JmolScriptEvaluator,JV.Viewer,~N");s(d,"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=T(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")});L("JS");M(["J.api.JmolScriptEvaluator"],"JS.ScriptError",["JU.PT","J.i18n.GT","JS.ScriptException"],function(){var d=Q(function(){this.vwr=null;
this.$error=this.ignoreError=this.chk=!1;this.errorType=this.errorMessageUntranslated=this.errorMessage=null;this.iCommandError=0;O(this,arguments)},JS,"ScriptError",null,J.api.JmolScriptEvaluator);s(d,"getErrorMessage",function(){return this.errorMessage});s(d,"getErrorMessageUntranslated",function(){return null==this.errorMessageUntranslated?this.errorMessage:this.errorMessageUntranslated});f(d,"invArg",function(){this.error(22)});f(d,"invArgStr",function(a){this.errorOrWarn(22,a,null,null,!1)},
"~S");f(d,"bad",function(){this.error(2)});f(d,"integerOutOfRange",function(a,b){this.errorOrWarn(21,""+a,""+b,null,!0)},"~N,~N");f(d,"numberOutOfRange",function(a,b){this.errorOrWarn(36,""+a,""+b,null,!0)},"~N,~N");f(d,"error",function(a){this.errorOrWarn(a,null,null,null,!1)},"~N");f(d,"errorStr",function(a,b){this.errorOrWarn(a,b,null,null,!1)},"~N,~S");f(d,"errorStr2",function(a,b,c){this.errorOrWarn(a,b,c,null,!1)},"~N,~S,~S");f(d,"errorMore",function(a,b,c,e){this.errorOrWarn(a,b,c,e,!1)},"~N,~S,~S,~S");
f(d,"warning",function(a,b,c){this.errorOrWarn(a,b,c,null,!0)},"~N,~S,~S");f(d,"errorOrWarn",function(a,b,c,e,g){var n=this.ignoreError?null:JS.ScriptError.errorString(a,b,c,e,!0);a=this.ignoreError||!J.i18n.GT.getDoTranslate()?null:JS.ScriptError.errorString(a,b,c,e,!1);g||this.evalError(n,a);this.showStringPrint(n,!0)},"~N,~S,~S,~S,~B");f(d,"evalError",function(a,b){if(this.ignoreError)throw new NullPointerException;null==b&&(b=a);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");f(d,"setCursorWait",function(a){this.chk||this.vwr.setCursor(a?3:0)},"~B");d.errorString=f(d,"errorString",function(a,b,c,e,g){e=!1;!g&&!0==(e=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} requires 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 57:a=J.i18n.GT.$("operation canceled");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)));e&&J.i18n.GT.setDoTranslate(!0);
return a},"~N,~S,~S,~S,~B");d.getErrorLineMessage=f(d,"getErrorLineMessage",function(a,b,c,e,g){var n="\n----";if(null!=b||null!=a)n+="line "+c+" command "+(e+1)+" of "+(null==a?b:a.equals("try")?"try":"function "+a)+":";return n+("\n         "+g)},"~S,~S,~N,~N,~S");f(d,"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")});L("JS");M(["JS.ScriptExpr"],"JS.ScriptEval","java.util.Arrays $.Hashtable JU.AU $.BArray $.BS $.Base64 $.Lst $.M3 $.M4 $.Measure $.P3 $.P4 $.PT $.Quat $.SB $.V3 J.api.Interface J.atomdata.RadiusData J.c.PAL $.STR $.VDW J.i18n.GT JM.BondSet $.Group $.Measurement JS.FileLoadThread $.SV $.ScriptCompiler $.ScriptContext $.ScriptDelayThread $.ScriptInterruption $.ScriptManager $.ScriptMathProcessor $.T JU.BSUtil $.BoxInfo $.ColorEncoder $.Edge $.Elements $.Escape $.Font $.Logger $.Parser $.SimpleUnitCell JV.ActionManager $.FileManager $.JC $.StateManager $.Viewer".split(" "),
function(){var d=Q(function(){this.sm=null;this.isJS=!1;this.fileLoadThread=this.scriptDelayThread=null;this.allowJSThreads=!0;this.isEditor=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=this.isFuncReturn=!1;this.timeEndExecution=this.timeBeginExecution=0;this.mustResumeEval=!1;this.outputBuffer=this.compiler=this.currentThread=null;this.contextPath=
"";this.functionName=this.scriptFileName=null;this.$isStateScript=!1;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.isGUI=this.isEmbedded=this.forceNoAddHydrogens=!1;this.parallelProcessor=null;this.pcResume=-1;O(this,arguments)},JS,"ScriptEval",JS.ScriptExpr);R(d,function(){V(this,JS.ScriptEval,[]);this.currentThread=Thread.currentThread()});s(d,"getAllowJSThreads",
function(){return this.allowJSThreads});f(d,"setAllowJSThreads",function(a){this.allowJSThreads=a},"~B");f(d,"doReport",function(){return!this.tQuiet&&this.scriptLevel<=JS.ScriptEval.scriptReportingLevel});s(d,"isStateScript",function(){return this.$isStateScript});s(d,"setStatic",function(a,b){switch(a){case 553648167:return 10<=b&&(JS.ScriptEval.contextDepthMax=b),JS.ScriptEval.contextDepthMax;case 553648144:return 0<=b&&(JS.ScriptEval.commandHistoryLevelMax=b),JS.ScriptEval.commandHistoryLevelMax;
case 553648168:return 0<=b&&(JS.ScriptEval.scriptReportingLevel=b),JS.ScriptEval.scriptReportingLevel}return 0},"~N,~N");s(d,"getScript",function(){return this.script});s(d,"setViewer",function(a){this.vwr=a;this.compiler=null==this.compiler?a.compiler:this.compiler;this.isJS=a.isSingleThreaded;return this},"JV.Viewer");s(d,"setCompiler",function(){this.vwr.compiler=this.compiler=new JS.ScriptCompiler(this.vwr)});s(d,"compileScriptString",function(a,b){this.clearState(b);this.contextPath="[script]";
return this.compileScript(null,a,this.debugScript)},"~S,~B");s(d,"compileScriptFile",function(a,b){this.clearState(b);this.contextPath=a;var c=this.getScriptFileInternal(a,null,null,null);return null!=c&&this.compileScript(a,c,this.debugScript)},"~S,~B");s(d,"evaluateCompiledScript",function(a,b,c,e,g,n,h){var d=this.isCmdLine_C_Option;this.isCmdLine_C_Option=c;this.chk=this.isCmdLine_c_or_C_Option=b;this.historyDisabled=e;this.outputBuffer=n;this.privateFuncs=null;this.currentThread=Thread.currentThread();
this.setAllowJSThreads((new Boolean(h&!this.vwr.getBoolean(603979892))).valueOf());this.listCommands=g;this.timeBeginExecution=System.currentTimeMillis();this.executionStepping=this.executionStopped=this.executionPaused=!1;this.executing=!0;this.vwr.pushHoldRepaintWhy("runEval"+(null==a?"":"+params"));this.setScriptExtensions();this.vwr.hasSelected=!1;this.executeCommands(a,!1,!0);this.isCmdLine_C_Option=d;this.$isStateScript&&JS.ScriptManager.setStateScriptVersion(this.vwr,null);this.vwr.hasSelected&&
this.isGUI&&this.vwr.setStatusSelect(null);this.vwr.hasSelected=!1},"~A,~B,~B,~B,~B,JU.SB,~B");f(d,"useThreads",function(){return!this.chk&&!this.vwr.headless&&!this.vwr.autoExit&&this.vwr.haveDisplay&&null==this.outputBuffer&&this.allowJSThreads});f(d,"executeCommands",function(a,b,c){var e=!1;try{null!=a&&(this.pushContext(null,"runCallback"),this.contextPath+=" >> "+a[0]+"callback ",this.setScriptArguments(a,!0));if(!this.dispatchCommands(!1,!1,b))return-1;null!=a&&this.popContext(!1,!1)}catch(g){if(D(g,
"JS.ScriptException")){if(u(g,"JS.ScriptInterruption")&&(!b||!g.isError))return-1;if(b)return this.vwr.setStringProperty("_errormessage",""+g),1;this.setErrorMessage(g.toString());this.errorMessageUntranslated=g.getErrorMessageUntranslated();this.report(this.errorMessage,!0);this.vwr.notifyError(null!=this.errorMessage&&0<=this.errorMessage.indexOf("java.lang.OutOfMemoryError")?"Error":"ScriptException",this.errorMessage,this.errorMessageUntranslated)}else this.vwr.handleError(g,!1),this.setErrorMessage(""+
g+" "+this.vwr.getShapeErrorState()),this.errorMessageUntranslated=""+g,this.report(this.errorMessage,!0);e=!0}if(e||!this.isJS||!this.allowJSThreads||null!=a)this.vwr.setTainted(!0),this.vwr.popHoldRepaint("CLEAR HOLD - executeCommands "+(0<this.scriptLevel?"\u0001## REPAINT_IGNORE ##":"")),e&&this.resumeViewer("exception");this.timeEndExecution=System.currentTimeMillis();null==this.errorMessage&&this.executionStopped?this.setErrorMessage("execution interrupted"):!this.tQuiet&&c&&this.vwr.scriptStatus("Script completed");
this.executing=this.chk=this.isCmdLine_c_or_C_Option=this.historyDisabled=!1;a=this.getErrorMessageUntranslated();this.vwr.setErrorMessage(this.errorMessage,a);!this.tQuiet&&c&&this.vwr.setScriptStatus("Jmol script terminated",this.errorMessage,1+(this.timeEndExecution-this.timeBeginExecution),a);return e?1:0},"~A,~B,~B");s(d,"resumeEval",function(a){this.setErrorMessage(null);if(this.executionStopped||null==a||!a.mustResumeEval)this.resumeViewer("resumeEval");else{this.thisContext=a;0<a.scriptLevel&&
"getEvalContextAndHoldQueue"!==a.why&&(this.scriptLevel=a.scriptLevel-1);a.isTryCatch?(this.postProcessTry(null),this.pcResume=-1):(this.executionPaused||a.pc++,this.restoreScriptContext(a,!0,!1,!1),this.pcResume=a.pc);switch(this.executeCommands(null,null!=this.thisContext&&this.thisContext.isTryCatch,0>=this.scriptLevel)){case 1:case 0:this.postProcessTry(null),this.executing&&this.executeCommands(null,!0,!1)}this.pcResume=-1}},"~O");f(d,"resumeViewer",function(a){this.vwr.setTainted(!0);this.vwr.popHoldRepaint(a+
(this.chk?"\u0001## REPAINT_IGNORE ##":""));this.vwr.queueOnHold=!1;this.vwr.clearScriptQueue();this.vwr.scm.queueThreadFinished(-1)},"~S");s(d,"runScript",function(a){this.vwr.isPreviewOnly||this.runScriptBuffer(a,this.outputBuffer,!1)},"~S");s(d,"runScriptBuffer",function(a,b,c){this.pushContext(null,"runScriptBuffer");this.contextPath+=" >> script() ";this.outputBuffer=b;this.setAllowJSThreads(!1);b=this.isFuncReturn;this.isFuncReturn=(new Boolean(this.isFuncReturn|c)).valueOf();this.compileScript(null,
a+"\u0001## EDITOR_IGNORE ##\u0001## REPAINT_IGNORE ##",!1)&&this.dispatchCommands(!1,!1,!1);this.popContext(!1,!1);this.isFuncReturn=b},"~S,JU.SB,~B");s(d,"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(D(b,"JS.ScriptException"))this.setErrorMessage(b.toString()),a=this.getScriptContext("checkScriptSilent");
else throw b;}this.chk=!1;return a},"~S");d.getContextTrace=f(d,"getContextTrace",function(a,b,c,e){null==c&&(c=new JU.SB);var g=Math.min(b.pc,b.lineNumbers[b.lineNumbers.length-1]);c.append(JS.ScriptError.getErrorLineMessage(b.functionName,b.scriptFileName,b.lineNumbers[g],g,JS.ScriptEval.statementAsString(a,b.statement,e?b.iToken:9999,!1)));null!=b.parentContext&&JS.ScriptEval.getContextTrace(a,b.parentContext,c,!1);return c},"JV.Viewer,JS.ScriptContext,JU.SB,~B");s(d,"setDebugging",function(){this.debugHigh=
(this.debugScript=this.vwr.getBoolean(603979825))&&JU.Logger.debugging});s(d,"haltExecution",function(){this.isEmbedded&&(this.vwr.setBooleanProperty("allowEmbeddedScripts",!0),this.isEmbedded=!1);this.resumePausedExecution();this.executionStopped=!0});s(d,"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");s(d,"stepPausedExecution",function(){this.executionStepping=
!0;this.executionPaused=!1});s(d,"resumePausedExecution",function(){this.executionStepping=this.executionPaused=!1;this.tQuiet||this.vwr.setScriptStatus("Jmol script resumed",this.errorMessage,1+(this.timeEndExecution-this.timeBeginExecution),"resumed")});s(d,"isExecuting",function(){return this.executing&&!this.executionStopped});s(d,"isPaused",function(){return this.executionPaused});s(d,"isStepping",function(){return this.executionStepping});s(d,"isStopped",function(){return this.executionStopped||
!this.isJS&&this.currentThread!==Thread.currentThread()});s(d,"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)):""});f(d,"getCommand",function(a,b){if(a>=this.lineIndices.length)return"";if(b){for(var c=-1,e=this.script,g=e.length,n=0;n<this.lineNumbers.length;n++)if(this.lineNumbers[n]==this.lineNumbers[a])0>
c&&(c=this.lineIndices[n][0]),g=this.lineIndices[n][1];else if(0==this.lineNumbers[n]||this.lineNumbers[n]>this.lineNumbers[a])break;0<=e.indexOf("\u0001")&&(e=e.substring(0,e.indexOf("\u0001")));n=e.length;g==n-1&&e.endsWith("}")&&g++;return c>=n||g<c||0>g?"":e.substring(Math.max(c,0),Math.min(n,g))}c=this.lineIndices[a][0];g=this.lineIndices[a][1];e="";if(0>c||g<=c||g>this.script.length)return"";try{e=this.script.substring(c,g),0<=e.indexOf("\\\n")&&(e=JU.PT.rep(e,"\\\n","  ")),0<=e.indexOf("\\\r")&&
(e=JU.PT.rep(e,"\\\r","  ")),0<e.length&&!e.endsWith(";")&&(e+=";")}catch(h){if(D(h,Exception))JU.Logger.error("darn problem in Eval getCommand: ichBegin="+c+" ichEnd="+g+" len = "+this.script.length+"\n"+h);else throw h;}return e},"~N,~B,~B");f(d,"logDebugScript",function(a,b){var c=this.iToken;this.iToken=-9999;if(this.debugHigh){0<a.length&&JU.Logger.debug(a[0].toString());for(var e=1;e<a.length;++e)null!=a[e]&&JU.Logger.debug(a[e].toString());var e=new JU.SB,g=0<b?"                          ".substring(0,
2*b):"";e.append(g).append(JS.ScriptEval.statementAsString(this.vwr,a,this.iToken,this.debugHigh));this.vwr.scriptStatus(e.toString())}else e=this.getCommand(this.pc,!1,!1),""!==e&&this.vwr.scriptStatus(e);this.iToken=c},"~A,~N");s(d,"evaluateExpression",function(a,b,c){var e=(new JS.ScriptEval).setViewer(this.vwr);try{e.thisContext=this.thisContext,e.contextVariables=this.contextVariables,e.pushContext(null,"evalExp"),e.setAllowJSThreads(!1)}catch(g){if(!D(g,"JS.ScriptException"))throw g;}var n=
this.executing;a=e.evaluate(a,b,c);this.executing=n;return a},"~O,~B,~B");f(d,"runBufferedSafely",function(a,b){null==b&&(b=this.outputBuffer);var c=(new JS.ScriptEval).setViewer(this.vwr),e=this.executing;try{c.runScriptBuffer(a,b,!1)}catch(g){if(D(g,"JS.ScriptException"))g.printStackTrace();else throw g;}this.executing=e},"~S,JU.SB");d.runUserAction=f(d,"runUserAction",function(a,b,c){var e=(new JS.ScriptEval).setViewer(c);a=c.getFunction(a.toLowerCase());if(null==a)return null;try{var g=JS.SV.getVariableAO(b).getList();
e.restoreFunction(a,g,null);e.dispatchCommands(!1,!0,!1)}catch(n){if(D(n,"JS.ScriptException"))return null;throw n;}b=e.getContextVariableAsVariable("_retval",!1);return null==b?JS.SV.vT:b},"~S,~A,JV.Viewer");f(d,"evaluate",function(a,b,c){try{if("string"==typeof a){if(this.compileScript(null,(c?"w_h_e_r_e":"e_x_p_r_e_s_s_i_o_n")+" = "+a,!1)){if(c)return this.aatoken[0];this.setStatement(this.aatoken[0],1);return b?this.parameterExpressionList(2,-1,!1).get(0):this.parameterExpressionString(2,0)}}else{if(u(a,
Array)&&u(a[0],Array))return this.setStatement(a[0],1),b?this.parameterExpressionList(0,-1,!1).get(0):this.parameterExpressionString(0,-1);if(u(a,Array)){var e=this.atomExpression(a,0,0,!0,!1,null,!1);return b?JS.SV.newV(10,e):e}}}catch(g){if(D(g,Exception))JU.Logger.error("Error evaluating: "+a+"\n"+g);else throw g;}return b?JS.SV.getVariable("ERROR"):"ERROR"},"~O,~B,~B");s(d,"checkSelect",function(a,b){var c=!1;try{this.pushContext(null,"checkSelect"),c=this.parameterExpressionSelect(a,b)}catch(e){if(D(e,
Exception))JU.Logger.error("checkSelect "+e);else throw e;}this.popContext(!1,!1);return c},"java.util.Map,~A");s(d,"getAtomBitSet",function(a){if(u(a,"JU.BS"))return a;var b=new JU.BS,c=this.executing;try{this.pushContext(null,"getAtomBitSet");var e="select ("+a+")",e=JU.PT.replaceAllCharacters(e,"\n\r","),("),e=JU.PT.rep(e,"()","(none)");this.compileScript(null,e,!1)&&(this.st=this.aatoken[0],this.setStatement(this.st,0),b=this.atomExpression(this.st,1,0,!1,!1,null,!0));this.popContext(!1,!1)}catch(g){if(D(g,
Exception))JU.Logger.error("getAtomBitSet "+a+"\n"+g);else throw g;}this.executing=c;return b},"~O");f(d,"compileScript",function(a,b,c){this.scriptFileName=a;b=this.fixScriptPath(b,a);a=this.compiler.compile(a,b,!1,!1,c&&JU.Logger.debugging,!1);this.addFunction(null);c=this.privateFuncs;this.restoreScriptContext(a,!1,!1,!1);this.privateFuncs=null;null!=this.thisContext&&(this.thisContext.privateFuncs=c);this.forceNoAddHydrogens=(this.$isStateScript=this.compiler.isStateScript)&&0>this.script.indexOf("pdbAddHydrogens");
a=this.script;(this.isGUI=0<=a.indexOf("; ## GUI ##"))&&(a=JU.PT.rep(a,"; ## GUI ##",""));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");f(d,"fixScriptPath",function(a,b){if(null!=b&&0<=a.indexOf("$SCRIPT_PATH$")){var c=b,e=Math.max(b.lastIndexOf("|"),b.lastIndexOf("/")),c=c.substring(0,e+1);a=JU.PT.rep(a,"$SCRIPT_PATH$/",c);a=JU.PT.rep(a,"$SCRIPT_PATH$",
c)}return a},"~S,~S");f(d,"setScriptExtensions",function(){var a=this.scriptExtensions;if(null==a)return 0;var b=a.indexOf("\u0001##SCRIPT_STEP");0<=b&&(this.executionStepping=!0);b=a.indexOf("\u0001##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});f(d,"getScriptFileInternal",function(a,b,c,e){if(0==a.toLowerCase().indexOf("javascript:"))return this.vwr.jsEval(a.substring(11));var g=Array(2);g[0]=a;if(!this.vwr.fm.getFileDataAsString(g,-1,!1,!0,!1))return this.setErrorMessage("io error reading "+g[0]+": "+g[1]),null;var n="";if(0<=("\n"+g[1]).indexOf("\nJmolManifest.txt\n")){var h;if(a.endsWith(".all.pngj")||a.endsWith(".all.png"))h="|state.spt",a+="|";else{0<=g[1].indexOf("movie.spt")&&(g[0]=a+"|movie.spt",this.vwr.fm.getFileDataAsString(g,
-1,!1,!0,!1)&&(n=g[1]));a+="|JmolManifest.txt";g[0]=a;if(!this.vwr.fm.getFileDataAsString(g,-1,!1,!0,!1))return this.setErrorMessage("io error reading "+g[0]+": "+g[1]),null;h=JV.FileManager.getManifestScriptPath(g[1])}if(null!=h&&0<h.length&&(g[0]=a=a.substring(0,a.lastIndexOf("|"))+h,!this.vwr.fm.getFileDataAsString(g,-1,!1,!0,!1)))return this.setErrorMessage("io error reading "+g[0]+": "+g[1]),null;a.endsWith("|state.spt")&&this.vwr.g.setO("_pngjFile",a.substring(0,a.length-10)+"?")}this.scriptFileName=
a;g[1]=JV.FileManager.getEmbeddedScript(g[1]);g=this.fixScriptPath(g[1],g[0]);null==e&&(e=this.vwr.fm.getFilePath(a,!1,!1),e=e.substring(0,Math.max(e.lastIndexOf("|"),e.lastIndexOf("/"))));return JV.FileManager.setScriptFileReferences(g,b,c,e)+n},"~S,~S,~S,~S");s(d,"evalFunctionFloat",function(a,b,c){try{for(var e=0;e<c.length;e++)b.get(e).value=Float.$valueOf(c[e]);return JS.SV.fValue(this.runFunctionAndRet(a,a.name,b,null,!0,!1,!1))}catch(g){if(D(g,Exception))return NaN;throw g;}},"~O,~O,~A");f(d,
"getUserFunctionResult",function(a,b,c){return this.runFunctionAndRet(null,a,b,c,!0,!0,!1)},"~S,JU.Lst,JS.SV");f(d,"runFunctionAndRet",function(a,b,c,e,g,n,h){if(null==a){b=b.toLowerCase();a=this.getFunction(b);if(null==a)return null;n&&(this.contextPath+=" >> function "+b)}else n&&(this.contextPath+=" >> "+b);this.pushContext(null,"runFunctionAndRet ");this.allowJSThreads&&this.setAllowJSThreads(h);n=364558==a.getTok();this.thisContext.isTryCatch=n;this.thisContext.isFunction=!n;this.functionName=
b;if(n){this.resetError();this.thisContext.displayLoadErrorsSave=this.vwr.displayLoadErrors;this.thisContext.tryPt=++this.vwr.tryPt;this.vwr.displayLoadErrors=!1;this.restoreFunction(a,c,e);this.contextVariables.put("_breakval",JS.SV.newI(2147483647));this.contextVariables.put("_errorval",JS.SV.newS(""));a=this.contextVariables;switch(this.executeCommands(null,!0,!1)){case 1:case 0:this.postProcessTry(a)}return null}u(a,"J.api.JmolParallelProcessor")?(this.parallelProcessor=a,this.restoreFunction(a,
c,e),this.dispatchCommands(!1,!0,!1),a.runAllProcesses(this.vwr)):(this.restoreFunction(a,c,e),this.dispatchCommands(!1,!0,!1));a=g?this.getContextVariableAsVariable("_retval",!1):null;this.popContext(!1,!1);return a},"J.api.JmolScriptFunction,~S,JU.Lst,JS.SV,~B,~B,~B");f(d,"postProcessTry",function(a){if(null!=this.thisContext){for(;this.thisContext.tryPt>this.vwr.tryPt;)this.popContext(!1,!1);var b=null==a;b&&(a=this.contextVariables);this.vwr.displayLoadErrors=this.thisContext.displayLoadErrorsSave;
this.popContext(!1,!1);var c=this.vwr.getP("_errormessage");0<c.length&&(a.put("_errorval",JS.SV.newS(c)),this.resetError());a.put("_tryret",a.get("_retval"));c=a.get("_tryret");if(null!=c.value||2147483647!=c.intValue)try{this.cmdReturn(c)}catch(e){if(D(e,"JS.ScriptException"))e.printStackTrace();else throw e;}else{c=a.get("_errorval").value;if(0==c.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(c)),a.intValue=(0<c.length?1:-1)*Math.abs(a.intValue));b&&this.pc++}}},"java.util.Map");f(d,"breakAt",function(a){if(0>a)this.getContextVariableAsVariable("_breakval",!1).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),102409!=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");f(d,"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");f(d,"clearDefinedVariableAtomSets",function(){this.vwr.definedAtomSets.remove("# variable")});f(d,"defineSets",function(){if(!this.vwr.definedAtomSets.containsKey("# static")){for(var a=0;a<JV.JC.predefinedStatic.length;a++)this.defineAtomSet(JV.JC.predefinedStatic[a]);this.defineAtomSet("# static")}if(!this.vwr.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),e=" _e="+c,b="@_"+JU.Elements.altElementSymbolFromIndex(a);this.defineAtomSet(b+e);b="@_"+
JU.Elements.altIsotopeSymbolFromIndex(a);this.defineAtomSet(b+e);b="@_"+JU.Elements.altIsotopeSymbolFromIndex2(a);this.defineAtomSet(b+e);b="@"+JU.Elements.altElementNameFromIndex(a);1<b.length&&this.defineAtomSet(b+e);b=JU.Elements.getElementNumber(c);c=JU.Elements.getNaturalIsotope(b);0<c&&(e=JU.Elements.elementSymbolFromNumber(b),this.defineAtomSet("@_"+e+c+" _e="+b),this.defineAtomSet("@_"+c+e+" _e="+b))}this.defineAtomSet("# variable")}});f(d,"defineAtomSet",function(a){if(0==a.indexOf("#"))this.vwr.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.getTokenCount())this.vwr.scriptStatus("JmolConstants.java ERROR: predefinition does not have exactly 1 command:"+a);else if(b=b.getToken(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,2097152)?this.vwr.scriptStatus("JmolConstants.java ERROR: invalid variable name:"+a):(a=b[1].value.toLowerCase(),a.startsWith("dynamic_")&&(a="!"+a.substring(8)),this.vwr.definedAtomSets.put(a,b))}}},"~S");f(d,"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");f(d,"lookupValue",function(a,b){if(this.chk)return new JU.BS;this.defineSets();a=a.toLowerCase();
var c=this.vwr.definedAtomSets.get(a),e=!1;null==c&&(c=this.vwr.definedAtomSets.get("!"+a),e=null!=c);if(u(c,"JU.BS"))return c;if(u(c,Array))return this.pushContext(null,"lookupValue"),c=this.atomExpression(c,-2,0,!0,!1,null,!0),this.popContext(!1,!1),e||this.vwr.definedAtomSets.put(a,c),c;if(a.equals("water"))return c=this.vwr.ms.getAtoms(1612709912,null),e||this.vwr.definedAtomSets.put(a,c),c;if(b)return null;e=a.length;if(5>e||"s"!=a.charAt(e-1))return null;a=a.endsWith("ies")?a.substring(0,e-
3)+"y":a.substring(0,e-1);return this.lookupValue(a,!0)},"~S,~B");s(d,"deleteAtomsInVariables",function(a){for(var b,c=this.vwr.definedAtomSets.entrySet().iterator();c.hasNext()&&((b=c.next())||1);){var e=b.getValue();u(e,"JU.BS")&&(JU.BSUtil.deleteBits(e,a),b.getKey().startsWith("!")||this.vwr.g.setUserVariable("@"+b.getKey(),JS.SV.newV(10,e)))}},"JU.BS");s(d,"getThisContext",function(){return this.thisContext});f(d,"clearState",function(a){this.thisContext=null;this.scriptLevel=0;this.setErrorMessage(null);
this.contextPath="";this.tQuiet=a},"~B");s(d,"pushContextDown",function(a){this.scriptLevel--;this.pushContext2(null,a)},"~S");f(d,"pushContext",function(a,b){this.scriptLevel==JS.ScriptEval.contextDepthMax&&this.error(44);this.pushContext2(a,b)},"JS.ContextToken,~S");f(d,"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,e=a.contextVariables.keySet().iterator();e.hasNext()&&((c=e.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");s(d,"getScriptContext",function(a){var b=new JS.ScriptContext;
this.debugHigh&&JU.Logger.info("creating context "+b.id+" for "+a+" path="+this.contextPath);b.why=a;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.saveTokens(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.isEditor=this.isEditor;b.mustResumeEval=this.mustResumeEval;b.allowJSThreads=this.allowJSThreads;
return b},"~S");f(d,"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");f(d,"restoreScriptContext",function(a,b,c,e){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,e))return;null!=a.privateFuncs&&(this.privateFuncs=a.privateFuncs);this.mustResumeEval=a.mustResumeEval;this.script=a.script;this.lineNumbers=a.lineNumbers;
this.lineIndices=a.lineIndices;this.aatoken=a.restoreTokens();this.contextVariables=a.vars;this.scriptExtensions=a.scriptExtensions;this.isEditor=a.isEditor;b?(this.contextPath=a.contextPath,e=null==this.contextPath?-1:this.contextPath.indexOf(" >> "),0<=e&&(this.contextPath=this.contextPath.substring(0,e)),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");f(d,"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 e=JS.ScriptEval.getContextTrace(this.vwr,this.getScriptContext("setException"),null,!0).toString();null!=this.thisContext&&!this.thisContext.isTryCatch;)this.popContext(!1,!1);0>a.message.indexOf(e)&&(a.message+=e,a.untranslated+=e);this.resumeViewer(c?
"throw context":"scriptException");if(!c&&!(null!=this.thisContext||this.chk||0<=b.indexOf("NOTE: file recognized as a script file: ")))this.isFuncReturn=!1,JU.Logger.error("eval ERROR: "+e+"\n"+this.toString()),this.vwr.autoExit&&this.vwr.exitJmol()}},"JS.ScriptException,~S,~S");d.statementAsString=f(d,"statementAsString",function(a,b,c,e){if(null==b||0==b.length)return"";var g=new JU.SB,n=b[0].tok;switch(n){case 0:return b[0].value;case 102409:if(2==b.length&&(134320141==b[1].tok||102436==b[1].tok))return b[1].value.toString()}for(var h=
!0,d=!1,f=!1,n=1<b.length&&36867==n&&b[0].value.equals("")&&(61==b[0].intValue||35==b[0].intValue)&&1073742325!=b[1].tok,r=b.length,m=0;m<r;++m){var k=b[m];if(null==k)break;c==m-1&&g.append(" <<");0!=m&&g.appendC(" ");if(2==m&&n&&((n=268440324!=k.tok)||35==b[0].intValue))if(g.append(n?"= ":"== "),!n)continue;var p=k.value;switch(k.tok){case 1073742325:h&&g.append("{");continue;case 1073742326:f&&m==b.length-1&&(h=!1);h&&g.append("}");continue;case 268437504:case 268437505:break;case 1073742332:case 1073742338:d=
1073742332==k.tok;break;case 12290:if(0<m&&k.value.equals("define")){g.append("@");m+1<b.length&&1073742325==b[m+1].tok&&(h||(f=!0),h=!0);continue}break;case 1073742335:g.append("true");p=null;break;case 1073742334:g.append("false");p=null;break;case 1275082241:break;case 2:g.appendI(k.intValue);p=null;break;case 8:case 9:case 10:g.append(JS.SV.sValue(k));p=null;break;case 6:if(Boolean.TRUE===k.value.get("$_BINARY_$")){g.append("<BINARY DATA>");p=null;break}case 7:g.append(k.escape());p=null;break;
case 5:g.appendC("^");p=null;break;case 1073742363:2147483647!=k.intValue?g.appendI(k.intValue):g.append(JM.Group.getSeqcodeStringFor(JS.ScriptExpr.getSeqCode(k))),k=b[++m],g.appendC(" "),g.append(d?"-":"- ");case 1073742362:2147483647!=k.intValue?g.appendI(k.intValue):g.append(JM.Group.getSeqcodeStringFor(JS.ScriptExpr.getSeqCode(k)));p=null;break;case 1073742357:g.append("*:");g.append(a.getChainIDStr(k.intValue));p=null;break;case 1073742355:g.append("*%");null!=k.value&&g.append(k.value.toString());
p=null;break;case 1073742358:g.append("*/");case 1073742359:case 3:2147483647>k.intValue?g.append(JU.Escape.escapeModelFileNumber(k.intValue)):g.append(""+k.value);p=null;break;case 1073742361:g.appendC("[");p=6*k.intValue+1;g.append(JM.Group.standardGroupList.substring(p,p+3).trim());g.appendC("]");p=null;break;case 1073742360:g.appendC("[");g.appendO(k.value);g.appendC("]");p=null;break;case 1073742356:g.append("*.");break;case 1094713349:if(u(k.value,"JU.P3")){p=k.value;g.append("cell=").append(JU.Escape.eP(p));
p=null;break}break;case 4:g.append('"').appendO(k.value).append('"');p=null;break;case 268440324:case 268440322:case 268440321:case 268440320:case 268440323:case 268440325:1715472409==k.intValue?g.append(b[++m].value).append(" "):2147483647!=k.intValue&&g.append(JS.T.nameOf(k.intValue)).append(" ");break;case 364558:p=null;break;case 102409:g.append("end");p=null;break;default:if(JS.T.tokAttr(k.tok,1073741824)||!e)break;g.appendC("\n").append(k.toString()).appendC("\n");p=null}null!=p&&g.append(k.value.toString());
c==m&&g.append("<<<<")}return g.toString()},"JV.Viewer,~A,~N,~B");s(d,"setObjectPropSafe",function(a,b){try{return this.setObjectProp(a,b,-1)}catch(c){if(D(c,"JS.ScriptException"))return null;throw c;}},"~S,~N");f(d,"setAtomProp",function(a,b,c){this.setShapePropertyBs(0,a,b,c)},"~S,~O,JU.BS");f(d,"restrictSelected",function(a,b){this.chk||this.sm.restrictSelected(a,b)},"~B,~B");f(d,"showString",function(a){this.showStringPrint(a,!1)},"~S");s(d,"showStringPrint",function(a,b){this.chk||null==a||(null==
this.outputBuffer?this.vwr.showString(a,b):this.appendBuffer(a,b))},"~S,~B");f(d,"report",function(a,b){this.chk||b&&0<=a.indexOf(" of try:")||(null==this.outputBuffer?this.vwr.scriptStatus(a):this.appendBuffer(a,b))},"~S,~B");f(d,"appendBuffer",function(a,b){(b||this.isFuncReturn||JU.Logger.isActiveLevel(4))&&this.outputBuffer.append(a).appendC("\n")},"~S,~B");f(d,"addProcess",function(a,b,c){if(null!=this.parallelProcessor){for(var e=Array(c),g=0;g<a.size();g++)e[g+1-b]=a.get(g);a=this.getScriptContext("addProcess");
a.saveTokens(e);a.pc=1-b;a.pcEnd=c;this.parallelProcessor.addProcess("p"+ ++JS.ScriptEval.iProcess,a)}},"JU.Lst,~N,~N");f(d,"checkContinue",function(){if(this.executionStopped)return!1;if(this.executionStepping&&this.isCommandDisplayable(this.pc))this.vwr.scriptStatusMsg("Next: "+this.getNextStatement(),"stepping -- type RESUME to continue"),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);this.refresh(!1);for(var a=!0;this.executionPaused;){this.isJS||Thread.yield();this.isEditor&&a&&this.notifyScriptEditor(this.pc);a=!1;this.vwr.popHoldRepaint("pause \u0001## REPAINT_IGNORE ##");var b=this.vwr.getInsertedCommand();if(0<b.length){this.resumePausedExecution();this.setErrorMessage(null);var c=this.getScriptContext("script insertion");this.pc--;try{this.runScript(b)}catch(e){if(D(e,Exception))this.setErrorMessage(""+e);else if(D(e,Error))this.setErrorMessage(""+
e);else throw e;}this.$error&&(this.report(this.errorMessage,!0),this.setErrorMessage(null));this.restoreScriptContext(c,!0,!1,!1);!b.startsWith("resume\u0001")&&!b.startsWith("step\u0001")&&this.pauseExecution(!1)}this.doDelay(-100);this.vwr.pushHoldRepaintWhy("pause")}this.notifyResumeStatus();return!this.$error&&!this.executionStopped});f(d,"delayScript",function(a){this.vwr.autoExit||(this.stopScriptThreads(),null!=this.vwr.captureParams&&0<a&&this.vwr.captureParams.put("captureDelayMS",Integer.$valueOf(a)),
this.scriptDelayThread=new JS.ScriptDelayThread(this,this.vwr,a),this.isJS&&this.allowJSThreads&&(this.pc=this.aatoken.length),this.scriptDelayThread.run())},"~N");f(d,"doDelay",function(a){if(this.useThreads()){if(this.isJS)throw new JS.ScriptInterruption(this,"delay",a);this.delayScript(a)}},"~N");s(d,"evalParallel",function(a,b){return this.getCmdExt().evalParallel(a,b)},"JS.ScriptContext,JV.ShapeManager");f(d,"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");s(d,"loadFileResourceAsync",function(a){this.loadFileAsync(null,a,-Math.abs(a.hashCode()),!1)},"~S");f(d,"loadFileAsync",function(a,b,c,e){if(!b.startsWith("?")){var g=this.vwr.getFullPathNameOrError(b);b=g[0];null!=g[1]&&this.errorStr(17,b+":"+g[1]);if(null!=this.vwr.fm.cacheGet(b,!1))return this.cancelFileThread(),b}null!=a&&(a="cache://local"+a);var g=this.pc+"_"+c+"_"+b,n;null==this.thisContext&&this.pushContext(null,"loadFileAsync");
null==this.thisContext.htFileCache&&(this.thisContext.htFileCache=new java.util.Hashtable);n=this.thisContext.htFileCache.get(g);if(null!=n&&0<n.length)return this.cancelFileThread(),this.vwr.queueOnHold=!1,("#CANCELED#".equals(n)||"#CANCELED#".equals(this.vwr.fm.cacheGet(n,!1)))&&this.evalError("#CANCELED#",null),n;this.thisContext.htFileCache.put(g,n=a+System.currentTimeMillis());e&&this.vwr.cacheFileByName(a+"*",!1);this.fileLoadThread=new JS.FileLoadThread(this,this.vwr,b,g,n);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");f(d,"cancelFileThread",function(){this.fileLoadThread=null;null!=this.thisContext&&"loadFileAsync"===this.thisContext.why&&this.popContext(!1,!1)});f(d,"logLoadInfo",function(a,b){0<a.length&&JU.Logger.info(a);var c=new JU.SB,e=this.vwr.ms.mc;1<e&&!b&&c.append((this.vwr.am.isMovie?this.vwr.am.getFrameCount()+" frames":e+" models")+"\n");for(var g=0;g<
e;g++){var n=this.vwr.ms.getInfo(g,"moData");null!=n&&n.containsKey("mos")&&c.appendI(n.get("mos").size()).append(" molecular orbitals in model ").append(this.vwr.getModelNumberDotted(g)).append("\n")}0<c.length()&&this.showString(c.toString())},"~S,~B");s(d,"notifyResumeStatus",function(){!this.chk&&(!this.executionStopped&&!this.executionStepping&&!this.executionPaused)&&this.vwr.scriptStatus("script execution "+(this.$error||this.executionStopped?"interrupted":"resumed"))});f(d,"refresh",function(a){this.chk||
(this.vwr.setTainted(!0),this.vwr.requestRepaintAndWait("refresh cmd"),this.isJS&&a&&this.doDelay(10))},"~B");s(d,"stopScriptThreads",function(){null!=this.scriptDelayThread&&(this.scriptDelayThread.interrupt(),this.scriptDelayThread=null);null!=this.fileLoadThread&&(this.fileLoadThread.interrupt(),this.fileLoadThread.resumeEval(),this.cancelFileThread())});f(d,"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))});f(d,"getLinenumber",function(a){return null==a?this.lineNumbers[this.pc]:a.lineNumbers[a.pc]},"JS.ScriptContext");f(d,"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;this.tQuiet||(this.tQuiet=0>this.vwr.getInt(536870922));
var e=this.isJS&&!b&&this.useThreads()&&0<=this.vwr.getInt(536870922);this.commandLoop(e);if(this.chk)return!0;var g=this.vwr.getInsertedCommand();"".equals(g)?a&&(this.debugScript&&this.vwr.getBoolean(603979879))&&this.vwr.getChimeMessenger().update(null):this.runScriptBuffer(g,null,!1);return!this.mustResumeEval&&!e||b?!0:!c&&this.mustResumeEval||null==this.thisContext?(a=null==this.thisContext,this.resumeEval(this.thisContext),this.mustResumeEval=!1,a):!0},"~B,~B,~B");f(d,"commandLoop",function(a){var b=
"",c=!1,e=null,g=System.currentTimeMillis();if(this.debugScript&&this.debugHigh&&!this.chk){for(var n=this.pc;n<this.aatoken.length&&n<this.pcEnd;n++)JU.Logger.info("Command "+n),this.debugScript&&this.logDebugScript(this.aatoken[n],0);JU.Logger.info("-----")}for(n=!0;this.pc<this.aatoken.length&&this.pc<this.pcEnd;this.pc++){a&&(!this.executionPaused&&1E6<System.currentTimeMillis()-g&&(this.pc--,this.doDelay(-1)),g=System.currentTimeMillis());if(!this.chk&&(!this.executionStepping||!n)&&!this.checkContinue())break;
n=!1;if(this.pc>=this.lineNumbers.length||this.lineNumbers[this.pc]>this.lineEnd)break;if(this.debugHigh){var h=0,h=System.currentTimeMillis();this.vwr.scriptStatus("Eval.dispatchCommands():"+h);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<=JS.ScriptEval.commandHistoryLevelMax&&
!this.tQuiet)&&(h=this.getCommand(this.pc,!0,!0),null!=this.theToken&&0<h.length&&!h.equals(b)&&(134320141==this.theToken.tok||102436==this.theToken.tok||!JS.T.tokAttr(this.theToken.tok,102400))))this.vwr.addCommand(b=h);!this.chk&&a&&(h=this.vwr.getInsertedCommand(),"".equals(h)||this.runScript(h));if(this.setStatement(this.aatoken[this.pc],1)){this.thisCommand=this.getCommand(this.pc,!1,!0);(this.debugHigh||this.debugScript)&&JU.Logger.info(this.thisCommand);h=this.getCommand(this.pc+1,!1,!0);this.fullCommand=
this.thisCommand+(h.startsWith("#")?h:"");this.getToken(0);this.iToken=0;if((this.listCommands||!this.chk&&0<this.scriptLevel)&&!this.isJS)if(h=this.vwr.getInt(536870922),this.listCommands||0<h)0<h&&this.delayScript(-h),this.vwr.scriptEcho("$["+this.scriptLevel+"."+this.lineNumbers[this.pc]+"."+(this.pc+1)+"] "+this.thisCommand);if(null!=e&&(102409!=this.theTok||2>this.slen||102439!=this.st[1].tok))e.addLast(this.st);else{if(this.chk){if(this.isCmdLine_c_or_C_Option&&JU.Logger.info(this.thisCommand),
1==this.slen&&134320141!=this.st[0].tok&&102436!=this.st[0].tok)continue}else if(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()),!this.isJS&&this.isEditor&&0==this.scriptLevel){this.notifyScriptEditor(this.pc);try{Thread.sleep(100)}catch(d){if(!D(d,"InterruptedException"))throw d;}}if(null!=this.theToken)switch(h=this.theToken.tok,h){case 36867:this.cmdSet();
continue;case 134320648:c=this.cmdFor(h,c);continue;case 102439:this.pushContext(this.theToken,"PROCESS");null!=this.parallelProcessor&&(e=new JU.Lst);continue;default:if(JS.T.tokAttr(h,102400)){c=this.cmdFlow(h,c,e);102439==this.theTok&&(e=null);continue}this.processCommand(h);this.setCursorWait(!1);266298!=h&&this.executionStepping&&(this.executionPaused=this.isCommandDisplayable(this.pc+1))}}}}},"~B");f(d,"notifyScriptEditor",function(a){this.vwr.notifyScriptEditor(this.lineIndices[a][0]<<16|this.lineIndices[a][1],
null)},"~N");f(d,"processCommand",function(a){if(JS.T.tokAttr(this.theToken.tok,135168))this.processShapeCommand(a);else switch(a){case 0:!this.chk&&this.vwr.getBoolean(603979879)&&this.vwr.getChimeMessenger().showHash(this.outputBuffer,this.theToken.value);break;case 1275335685:this.pushContext(this.theToken,"PUSH");break;case 1275334681:this.popContext(!0,!1);break;case 268436482:break;case 4097:this.cmdAnimation();break;case 1610616835:this.cmdBackground(1);break;case 4100:this.cmdBind();break;
case 4101:this.cmdBondorder();break;case 20488:this.cmdCD();break;case 12289:this.cmdCenter(1);break;case 1765808134:this.cmdColor();break;case 12290: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.autoExit)&&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 1228935687:this.cmdFile();break;case 12293:this.cmdFixed();break;case 4114:this.cmdFont(-1,0);break;case 4115:case 1094717454:this.cmdModel(1);break;case 1073741824:this.cmdFunc();break;case 1275072526: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 1613238294:this.cmdHbond();
break;case 1610616855:this.cmdHistory(1);break;case 544771:this.cmdHover();break;case 4121:switch(this.slen){case 1:this.chk||this.vwr.initialize(!this.$isStateScript,!1);break;case 2:if(1275068433==this.tokAt(1)){this.vwr.getInchi(null,null,null);!this.chk&&JV.Viewer.isJS&&(this.vwr.showString("InChI module initialized",!1),this.doDelay(1));break}default:this.bad()}break;case 134238732:this.cmdScript(134238732,null,null,null);break;case 134223363:this.cmdLoad();break;case 36869:this.cmdLog();break;
case 528411:this.cmdLoop();break;case 20485:this.cmdMessage();break;case 4128:this.cmdMove();break;case 4129:this.cmdMoveto();break;case 20487:this.cmdPause();break;case 36865:this.cmdPrint();break;case 134256129:this.cmdPrompt();break;case 536875059:this.cmdScale(1);break;case 603984065:case 4139:case 4140:case 4165:this.cmdUndoRedo(a);break;case 266284:this.refresh(!0);break;case 4141:this.cmdReset();break;case 12295:this.cmdRestrict();break;case 4143:if(1==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 134222850:this.cmdScript(134222850,null,null,null);break;case 1275082241:this.cmdSelect(1);break;case 1611141172: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 1639976963:this.cmdStructure();break;case 2109448: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 4163:this.cmdUnbind();break;case 36868:break;case 4166:this.cmdVibration();break;case 12297:this.cmdZap(!0);break;case 4168:this.cmdZoom(!1);break;case 4170:this.cmdZoom(!0);break;default:this.checkExtension(this.theToken.tok)}},"~N");
f(d,"checkExtension",function(a){switch(a){case 4098:case 134221829:case 4102:case 4103:case 4105:case 134221831:case 1094717448:case 4106:case 528395:case 1613238294:case 4120:case 4122:case 528443:case 4124:case 4125:case 4126:case 603983903:case 1275072532:case 4130:case 134221834:case 4131:case 4133:case 134221850:case 4138:case 134222350:case 134221856:this.getCmdExt().dispatch(a,!1,this.st);break;default:System.out.println(JS.T.nameOf(a)+" is not a command"),this.error(47)}},"~N");f(d,"processShapeCommand",
function(a){var b=0;switch(a){case 1611272194:b=34;break;case 1114249217:b=9;break;case 1812599299:b=32;break;case 1112152066:b=11;break;case 135174:b=23;break;case 134353926:b=25;break;case 135175:b=17;break;case 1112150019:b=16;break;case 135176:b=22;break;case 537022465:b=31;break;case 1112150020:b=20;break;case 1611272202:b=36;break;case 1112150021:b=19;break;case 1112152070:b=8;break;case 135180:b=24;break;case 1825200146:b=5;break;case 135182:b=26;break;case 537006096:case 1745489939:b=6;break;
case 1112152071:b=13;break;case 1073877010:b=27;break;case 1073877011:b=28;break;case 135190:b=30;break;case 135188:b=29;break;case 1275203608:b=21;break;case 1112152073:b=14;break;case 1112152074:b=15;break;case 1112152075:b=0;break;case 1112152076:b=7;break;case 1649022989:b=12;break;case 659482:b=4;break;case 1112152078:b=10;break;case 1814695966: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 1073742334:case 12291:case 1073742333:return}switch(a){case 1114249217:case 1112152066:case 1112152071:case 1112152073:case 1112152074:case 1649022989:case 1112152078:this.setSizeBio(b);
return;case 1112150019:case 1112150021:this.cmdDots(b);return;case 1112152070:case 1112152075:case 1112152076:this.setSize(b,1112152070==a?-1E3:1);return;case 1825200146:this.cmdLabel(1,null);return;case 135198:this.cmdVector();return;case 659488:this.cmdWireframe();return}switch(a){case 1611272194:this.cmdAxes(1);break;case 1812599299:this.cmdBoundbox(1);break;case 537022465:this.cmdEcho(1);break;case 1611272202:this.cmdFrank(1);break;case 1814695966:this.cmdUnitcell(1);break;case 1112150020:case 537006096:case 1745489939:case 1275203608:case 659482:this.getCmdExt().dispatch(b,
!1,this.st);break;case 135174:case 134353926:case 135175:case 135176:case 135180:case 135182:case 1073877010:case 1073877011:case 135190:case 135188:this.getIsoExt().dispatch(b,!1,this.st)}},"~N");f(d,"cmdAnimation",function(){var a=!1;switch(this.getToken(1).tok){case 1073742335:a=!0;case 1073742334:this.chk||this.vwr.setAnimationOn(a);break;case 1073742029:a=F(this.floatParameter(2));this.chk||this.vwr.am.setMorphCount(Math.abs(a));break;case 1610625028:this.iToken=2;a=1073742327==this.tokAt(2)?
null:this.atomExpressionAt(2);this.checkLength(this.iToken+1);this.chk||this.vwr.setAnimDisplay(a);break;case 4115:this.isArrayParameter(2)?this.setFrameSet(2):this.cmdModel(2);break;case 1073742024:var 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 528411: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 268440576:b=-this.intParameter(++a);break;case 268440577: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 1073741950:this.setIntProperty("animationFps",this.intParameter(this.checkLast(2)));break;default:this.frameControl(1)}});f(d,"setFrameSet",function(a){a=this.expandFloatArray(this.floatParameterSet(a,
0,2147483647),1,!1);this.checkLength(this.iToken+1);if(!this.chk){var b=new java.util.Hashtable;0<a.length&&b.put("frames",a);b.put("currentFrame",Integer.$valueOf(0));this.vwr.am.setMovie(b)}},"~N");f(d,"cmdAxes",function(a){var b=this.tickParamAsStr(a,!0,!0,!1);a=this.iToken+1;var c=this.tokAt(a),e=this.optParameterAsString(a).toLowerCase();if(this.slen==a+1&&JU.PT.isOneOf(e,";window;unitcell;molecular;"))this.setBooleanProperty("axes"+e,!0);else{switch(c){case 1073742066:this.setFloatProperty("axisOffset",
this.floatParameter(++a));this.checkLast(this.iToken);return;case 12289:this.setShapeProperty(34,"origin",this.centerParameter(a+1,null));this.checkLast(this.iToken);return;case 1140850696:a=this.stringParameter(a+1);JU.PT.isOneOf(a,";a;b;c;ab;ac;bc;abc;")||(a=null);this.setShapeProperty(34,"type",a);this.checkLast(this.iToken);return;case 536875059:this.setFloatProperty("axesScale",this.floatParameter(this.checkLast(++a)));return;case 1825200146:switch(c=this.tokAt(a+1)){case 1073742334:case 1073742335:this.checkLength(a+
2);this.setShapeProperty(34,"labels"+(1073742335==c?"On":"Off"),null);return}b=null;switch(this.slen-a){case 7:this.setShapeProperty(34,"labels",P(-1,[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",P(-1,[this.paramAsStr(++a),this.paramAsStr(++a),this.paramAsStr(++a),b]));break;default:this.bad()}return}e.equals("position")?(1073742334==this.tokAt(++a)?
b=new JU.P3:(b=this.xypParameter(a),null==b&&this.invArg(),a=this.iToken,this.setShapeProperty(34,"axes2",4==this.tokAt(a+1)?this.stringParameter(++a):null)),this.setShapeProperty(34,"position",b)):(a=this.getSetAxesTypeMad10(a),this.chk||2147483647==a||(this.setObjectMad10(34,"axes",a),null!=b&&this.setShapeProperty(34,"tickInfo",b)))}},"~N");f(d,"cmdBackground",function(a){this.getToken(a);if(4120==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(this.chk)return;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}if(this.vwr.fm.loadImage(b,null,!this.useThreads()))throw new JS.ScriptInterruption(this,"backgroundImage",1);}else 1073742333==this.theTok||this.isColorParam(a)?(a=this.getArgbParamLast(a,!0),this.chk||(this.setObjectArgb("background",a),this.vwr.setBackgroundImage(null,null))):this.colorShape(-this.theTok,
a+1,!0)},"~N");f(d,"cmdBind",function(){var a=this.stringParameter(1),b=this.paramAsStr(2);this.checkLength(3);this.chk||this.vwr.bindAction(a,b)});f(d,"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=JU.Edge.getBondOrderFromString(this.paramAsStr(1)))&&this.invArg(),33==a&&3==this.tokAt(2)&&(a=JU.Edge.getPartialBondOrderFromFloatEncodedInt(this.st[2].intValue))}this.setShapeProperty(1,
"bondOrder",Integer.$valueOf(a))});f(d,"cmdBoundbox",function(a){var b=this.tickParamAsStr(a,!1,!0,!1);a=this.iToken+1;var c=1;if(536875059==this.tokAt(a)){if(c=this.floatParameter(++a),a++,a==this.slen){this.chk||this.vwr.ms.setBoundBox(null,null,!0,c);return}}else if(4141==this.tokAt(a)){this.chk||this.vwr.ms.setBoundBox(null,null,!0,0);return}var e=1073741902==this.tokAt(a);e&&a++;if(this.isCenterParameter(a)){var g=Array(1),n=a,h=this.centerParameter(a,g);a=this.iToken+1;if(e||this.isCenterParameter(a))g=
e?this.centerParameter(a,g):this.getPoint3f(a,!0,!0),a=this.iToken+1,this.chk||this.vwr.ms.setBoundBox(h,g,e,c);else if(null!=g[0]&&u(g[0],"JU.BS"))this.chk||this.vwr.calcBoundBoxDimensions(g[0],c);else if(null==g[0]&&1073742330==this.tokAt(n)){if(this.chk)return;a=this.getObjectBoundingBox(this.objectNameParameter(++n));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.getSetAxesTypeMad10(a);this.chk||2147483647==c||(null!=
b&&this.setShapeProperty(32,"tickInfo",b),this.setObjectMad10(32,"boundbox",c))},"~N");f(d,"cmdCD",function(){if(!this.chk){var a=1==this.slen?null:this.paramAsStr(1);this.showString(this.vwr.cd(a))}});f(d,"cmdCenter",function(a){1==this.slen?this.vwr.setNewRotationCenter(null):(4==this.slen&&1814695966==this.tokAt(2)&&(a=2),a=this.centerParameter(a,null),null==a&&this.invArg(),this.chk||this.vwr.setNewRotationCenter(a))},"~N");f(d,"cmdColor",function(){var a=1,b=4==this.tokAt(1)?this.stringParameter(1):
null;if(this.isColorParam(1))this.theTok=1153433601;else{var c=0,a=2,e=this.getToken(1).tok;if(4==e&&(e=JS.T.getTokFromName(b),0==e||1073742186==e))e=4;switch(e){case 1073742330:this.setObjectProperty();return;case 1086324739:case 2097154:case 2097166:case 1086326788:case 1073741946:case 1631586315:case 1086324742:case 1113589786:case 1086324746:case 1073741991:case 1094713360:case 1094713361:case 1073742333:case 1073742074:case 1111492619:case 1094713362:case 1715472409:case 1073742116:case 1073742110:case 1112152075:case 1073742144:case 1111490574:case 1639976963:case 1111490575:case 1111492620:case 603979967:case 1648363544:this.theTok=
1153433601;a=1;break;case 4:a=2;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:c=this.getArgbParamLast(2,!0);this.chk||this.setObjectArgb("background",c);return;case 12290:case 10:case 1073742325:a=-1;this.theTok=1153433601;break;case 1073742134:c=this.getArgbParamLast(2,!1);this.chk||this.vwr.cm.setRubberbandArgb(c);return;case 536870920:case 1611141172:a=2;1073742074==this.tokAt(2)&&a++;c=this.getArgbParamLast(a,!0);if(this.chk)return;this.sm.loadShape(8);this.setShapeProperty(8,1611141172==e?"argbSelection":
"argbHighlight",Integer.$valueOf(c));return;case 1611272194:case 1812599299:case 1814695966:case 1073741824:case 1612709900:b=this.paramAsStr(1);if(this.checkToken(2))switch(c=this.getToken(2).tok,c){case 1073742333:c=1073741991;break;case 1073741991:case 1073742116:case 1073742110:break;default:c=this.getArgbParam(2)}0==c&&this.error(9);this.checkLast(this.iToken);if(b.equalsIgnoreCase("axes")||0<=JV.StateManager.getObjectIdFromName(b)){this.setObjectArgb(b,c);return}if(this.setElementColor(b,c))return;
this.invArg();break;case 135180:case 134353926:this.setShapeProperty(JV.JC.shapeTokenIndex(e),"thisID","+PREVIOUS_MESH+")}}this.colorShape(-this.theTok,a,!1)});f(d,"cmdDefine",function(){(3>this.slen||"string"!=typeof this.getToken(1).value)&&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),e=this.slen;0<=--e;)c[e]=this.st[e];this.vwr.definedAtomSets.put("!"+
(b?a:a.substring(8)),c)}else b=this.atomExpressionAt(2),this.vwr.definedAtomSets.put(a,b),this.chk||this.vwr.g.setUserVariable("@"+a,JS.SV.newV(10,b))}});f(d,"cmdDelay",function(){var a=0;switch(this.getToken(1).tok){case 1073742335:a=1;break;case 2:a=1E3*this.intParameter(1);break;case 3:a=F(1E3*this.floatParameter(1));break;default:this.error(34)}this.refresh(!1);this.doDelay(Math.abs(a))});f(d,"cmdDelete",function(){if(1073742330==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()),!1)):this.setObjectProperty();else{var a=1==this.slen?null:this.atomExpression(this.st,1,0,!0,!1,null,!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),!1))}});f(d,"cmdDisplay",function(a){var b=null,c=0,e=1,g;switch(g=this.tokAt(1)){case 1275069441:case 1073742119:c=
g,g=this.tokAt(++e)}var n=1086324742==g;n&&(g=this.tokAt(++e));switch(g){case 1073742330:this.setObjectProperty();return;case 0:break;default:b=4==this.slen&&1677721602==this.tokAt(2)?JM.BondSet.newBS(JU.BSUtil.newBitSet2(0,this.vwr.ms.bondCount)):this.atomExpressionAt(e)}this.chk||(u(b,"JM.BondSet")?this.vwr.ms.displayBonds(b,a):this.vwr.displayAtoms(b,a,n,c,this.tQuiet))},"~B");f(d,"cmdDots",function(a){this.chk||this.sm.loadShape(a);this.setShapeProperty(a,"init",null);for(var b=NaN,c=J.atomdata.RadiusData.EnumType.ABSOLUTE,
e=1,g=!1;;){switch(this.getToken(e).tok){case 1073742072:g=!0;case 1073742335:b=1;c=J.atomdata.RadiusData.EnumType.FACTOR;break;case 1073742334:b=0;break;case 1073741976:this.setShapeProperty(a,"ignore",this.atomExpressionAt(e+1));e=this.iToken+1;continue;case 3:g=1073742072==this.tokAt(e+1)||0>this.floatParameter(e);break;case 2:var n=this.intParameter(e);if(1665140738==this.tokAt(e+1)){e++;this.setShapeProperty(a,"atom",Integer.$valueOf(n));this.setShapeProperty(a,"radius",Float.$valueOf(this.floatParameter(++e)));
1765808134==this.tokAt(++e)&&(this.setShapeProperty(a,"colorRGB",Integer.$valueOf(this.getArgbParam(++e))),e++);10!=this.getToken(e).tok&&this.invArg();this.setShapeProperty(a,"dots",this.st[e].value);return}}break}b=Float.isNaN(b)?this.encodeRadiusParameter(e,g,!0):new J.atomdata.RadiusData(null,b,c,J.c.VDW.AUTO);null!=b&&(Float.isNaN(b.value)&&this.invArg(),g&&this.restrictSelected(!1,!1),this.setShapeSize(a,b))},"~N");f(d,"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()&&null!=a&&!a.startsWith("%SCALE"))&&this.showString(this.vwr.formatText(a))}},"~N");f(d,"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)}});f(d,"cmdFixed",function(){var a=1==this.slen?null:this.atomExpressionAt(1);this.chk||this.vwr.setMotionFixedAtoms(a)});f(d,"cmdFor",function(a,b){var c=this.theToken,e=this.st[0].intValue,g=c.forVars,n=K(2,0),h=null,d=null,f=null,r=0,m=!0,k=!1,p=0,q=null;if(b&&null!=g)if(a=1275068432,f=g[0],d=g[1],h=g[1].value,p=++d.intValue,2==d.tok){k=0>p;n=h[0];m=h[1];if(m=n!=m&&m<n==k)f.intValue=h[0]=n+(k?
-1:1);p=-1}else 7==d.tok?((m=p<=h.size())&&f.setv(JS.SV.selectItemVar(d)),p=-1):(this.isBondSet=u(h,"JM.BondSet"),p=h.nextSetBit(p),m=0<=p);else{for(var C=!1,B=1,s=0;B<this.slen&&2>p;B++)switch(a=this.tokAt(B)){case 36868:C=!0;break;case 1073742339:0<s?s--:n[p++]=B;break;case 1275068432:case 1073741952:q=this.paramAsStr(B-1);s-=2;if(this.isAtomExpression(++B))r=10,h=this.atomExpressionAt(B),this.isBondSet&&(h=JM.BondSet.newBS(h)),m=0<=h.nextSetBit(0);else switch(r=this.parameterExpressionList(-B,
1,!1),(null==r||1>r.size())&&this.invArg(),B=r.get(0),r=B.tok){case 10:h=B.value;m=!h.isEmpty();break;case 7:h=B.getList();p=h.size();if((m=0<p)&&1073741952==a)h=K(-1,[JS.SV.iValue(h.get(0)),JS.SV.iValue(h.get(p-1))]),k=h[1]<h[0],a=1275068432,r=2;break;case 6:var B=B.getMap(),y=B.keySet().size();if(m=0<y)h=Array(y),B.keySet().toArray(h),java.util.Arrays.sort(h);break;default:this.invArg()}B=this.iToken;break;case 1275082241:s+=2}b||(this.pushContext(c,"FOR"),this.thisContext.forVars=g,g=null);null==
q&&(p=b?null==h?n[1]+1:2:2,36868==this.tokAt(p)&&p++,q=this.paramAsStr(p),(k=q.equals("--")||q.equals("++"))&&(q=this.paramAsStr(++p)));if(m)if(1275068432==a){f=this.getContextVariableAsVariable(q,C);null==f&&!C&&(f=this.vwr.g.getAndSetNewVariable(q,!1));if(null==f||null==f.myName)q.startsWith("_")&&this.invArg(),C?this.contextVariables.put(q.toLowerCase(),f=JS.SV.newI(0)):f=this.vwr.g.getAndSetNewVariable(q,!0);2==r?(f.tok=2,f.intValue=h[0],d=JS.SV.newV(2,h),d.intValue=k?-2147483648:0,p=-1):(d=JS.SV.getVariable(h),
10==r?(p=h.nextSetBit(0),d.intValue=0):(d.intValue=1,f.setv(JS.SV.selectItemVar(d)),p=-1));null==g&&(g=c.forVars=Array(2));g[0]=f;g[1]=d}else{m=this.tokAt(p);if(1073742339!=m&&(JS.T.tokAttr(m,1073741824)||null!=(d=this.getContextVariableAsVariable(q,!1))))!k&&268440324!=this.getToken(++p).tok&&this.invArg(),k&&(p-=2),this.setVariable(++p,this.slen-1,q,!1);m=n[0]+1==n[1]||this.parameterExpressionBoolean(n[0]+1,n[1])}}m&&(1275068432==a&&0<=p)&&(d.intValue=p,f.tok=10,this.isBondSet?(f.value=new JM.BondSet,
f.value.set(p)):f.value=JU.BSUtil.newAndSetBit(p));e++;m||(c.forVars=this.thisContext.forVars,this.popContext(!0,!1));b=!1;!m&&!this.chk&&(this.pc=Math.abs(e)-1);return b},"~N,~B");f(d,"cmdFlow",function(a,b,c){var e,g=this.st[0].intValue,n=0>g&&!this.chk;e=!0;var h=0;switch(a){case 134320141:case 102436:return this.cmdFunc(),b;case 364558:return b;case 102412:e=this.theToken;this.pushContext(e,"CATCH");!n&&null!=e.name0&&this.contextVariables.put(e.name0,e.contextVariables.get(e.name0));e=!n;this.st[0].intValue=
-Math.abs(g);break;case 102410:case 102413:case 102411:h=Math.abs(this.aatoken[Math.abs(g)][0].intValue);switch(n?0:this.cmdFlowSwitch(this.theToken,a)){case 0:h=-h;e=!1;break;case -1:e=!1}this.aatoken[this.pc][0].intValue=Math.abs(g);this.theToken=this.aatoken[Math.abs(g)][0];102409!=this.theToken.tok&&(this.theToken.intValue=h);break;case 134320649:case 102402:e=!n&&this.parameterExpressionBoolean(1,0);if(this.chk)break;h=Math.abs(this.aatoken[Math.abs(g)][0].intValue);this.aatoken[Math.abs(g)][0].intValue=
n||e?-h:h;102412==a&&(this.aatoken[this.pc][0].intValue=-g);break;case 364547:this.checkLength(1);0>g&&!this.chk&&(this.pc=-g-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=g,this.popContext(!0,!1));break;case 102407:if(!this.chk){this.breakAt(g);break}if(1==this.slen)break;n=this.intParameter(this.checkLast(1));if(this.chk)break;for(a=0;a<n;a++)this.popContext(!0,!1);break;case 102408:b=
!0;this.chk||(this.pc=g-1);1<this.slen&&this.intParameter(this.checkLast(1));break;case 102409: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 134320141:case 102436:return this.addFunction(this.theToken.value),b;case 102412:this.popContext(!0,!1);break;case 102439:this.addProcess(c,g,this.pc);this.popContext(!0,!1);break;case 102410:if(0<g&&-1==this.cmdFlowSwitch(this.aatoken[g][0],
0)){for(;g<this.pc&&!(102413!=(a=this.aatoken[g][0].tok)&&102411!=a);g++);e=this.pc==g}break;case 134320648:case 102406:e=!1,b=!0}}!e&&!this.chk&&(this.pc=Math.abs(g)-1);return b},"~N,~B,JU.Lst");f(d,"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 e=this.parameterExpressionToken(1);if(102411==b)return(c=JS.SV.areEqual(c,e))&&a.contextVariables.remove("_var"),
c?1:-1;a.contextVariables.put("_var",e);return 1},"JS.ContextToken,~N");f(d,"cmdFont",function(a,b){var c="SansSerif",e="Plain",g="font",n=0,h=-1;switch(this.iToken=this.slen){case 6:h=this.floatParameter(5),5<=h&&(h=this.vwr.tm.getZoomSetting()/h/this.vwr.getScalePixelsPerAngstrom(!1));case 5:1073741824!=this.getToken(4).tok&&this.invArg(),e=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=-1;break;case 3:this.isFloatParameter(2)||this.error(34);-1==a?b=this.floatParameter(2):(1<=b&&(b+=n=5),c=null);break;default:if(5==a){b=13;g="fontsize";break}this.bad()}var d=536875059==this.tokAt(1);-1==a&&(a=d?31:this.getShapeType(this.getToken(1).tok));if(5==a){if(0>b||1<=b&&(6>b||63<b)){this.integerOutOfRange(6-n,63-n);return}this.chk||this.setShapeProperty(5,"setDefaults",0==b?this.vwr.slm.noneSelected:Boolean.FALSE)}this.chk||("font"===g?(0<=JU.Font.getFontStyleID(c)&&(e=c,c="SansSerif"),
c=this.vwr.getFont3D(c,e,b)):c=Float.$valueOf(b),this.sm.loadShape(a),d&&this.setShapeProperty(31,"target","%SCALE"),this.setShapeProperty(a,g,c),0<=h&&this.setShapeProperty(a,"scalereference",Float.$valueOf(h)),d&&this.setShapeProperty(31,"thisID",null))},"~N,~N");f(d,"cmdFrank",function(a){var b=!0;if(this.slen>a)switch(this.getToken(this.checkLast(a)).tok){case 1073742335:break;case 1073742334:b=!1;break;default:this.error(5)}this.setBooleanProperty("frank",b)},"~N");f(d,"cmdFunc",function(){if(!this.chk||
this.isCmdLine_c_or_C_Option){var a=this.getToken(0).value.toLowerCase();if(268440324==this.tokAt(1)&&1073742333==this.tokAt(2))this.vwr.removeFunction(a);else{this.isFunction(a)||this.error(10);var b=1==this.slen||3==this.slen&&268435968==this.tokAt(1)&&268435969==this.tokAt(2)?null:this.parameterExpressionList(1,-1,!1);this.chk||this.runFunctionAndRet(null,a,b,null,!1,!0,!0)}}});f(d,"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 12290:case 1073742325:case 10:c=this.atomExpressionAt(2),a.equalsIgnoreCase("bondInfo")&&this.isAtomExpression(++this.iToken)&&(c=P(-1,[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)}});f(d,"cmdGoto",function(a){a=a?this.paramAsStr(this.checkLast(1)):null;for(var b=null==a?this.aatoken.length-1:-1,c=null,e=b+1;e<this.aatoken.length;e++){var c=this.aatoken[e],g=c[0].tok;switch(g){case 20485:case 0:c=c[c.length-1].value;0==g&&(c=c.substring(c.startsWith("#")?1:2));break;default:continue}if(c.equalsIgnoreCase(a)){b=
e;break}}0>b&&this.invArg();null==a&&(b=0);g=b<this.pc?1:-1;c=0;for(e=b;e!=this.pc;e+=g)switch(this.aatoken[e][0].tok){case 1275335685:case 102439:case 134320648:case 102412:case 102406:c++;break;case 1275334681:c--;break;case 102409:switch(this.aatoken[e][1].tok){case 102439:case 134320648: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");f(d,"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)),!1)}}else 2==this.slen&&12291==this.getToken(1).tok?this.chk||this.checkExtension(1613238294):(a=this.getMadParameter(),2147483647!=a&&(this.setShapeProperty(1,"type",Integer.$valueOf(30720)),this.setShapeSizeBs(1,a,null),this.setShapeProperty(1,"type",Integer.$valueOf(1023))))});f(d,"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))}});f(d,"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 1073742335:case 1073741882:this.chk||this.vwr.getSetHistory(-2147483648);
break;case 1073742334:this.chk||this.vwr.getSetHistory(0);break;default:this.errorStr(24,"ON, OFF, CLEAR")}},"~N");f(d,"cmdHover",function(){if(!this.chk){var a=1==this.slen?"on":this.paramAsStr(1);a.equalsIgnoreCase("on")?a="%U":a.equalsIgnoreCase("off")&&(a=null);this.vwr.setHoverLabel(a)}});f(d,"cmdLabel",function(a,b){if(!this.chk){this.sm.loadShape(5);var c=null;switch(this.getToken(a).tok){case 1073742335:c=this.vwr.getStandardLabelFormat(0);break;case 1073742334:break;case 12294:case 1610625028:this.setShapeProperty(5,
"display",1610625028==this.theTok?Boolean.TRUE:Boolean.FALSE);return;case 7:c=this.theToken.value;break;default:c=this.paramAsStr(a)}this.sm.setLabel(c,null==b?this.vwr.bsA():b)}},"~N,JU.BS");f(d,"cmdLoad",function(){var a=!this.chk||this.isCmdLine_C_Option,b=!1,c=!1,e=!1,g=!1,n=!1,h=this.vwr.async,d=!1,f=!1,r=this.vwr.getBoolean(603979792),m=!1,k=null,p,q=134221834==this.tokAt(0)?0:1,C=null,s=this.vwr.ms.mc-(this.vwr.fm.getFileName().equals("zapped")?1:0),E=this.vwr.ms.ac,y=(new JU.SB).append("load"),
x=1,v=new java.util.Hashtable;this.$isStateScript&&(v.put("isStateScript",Boolean.TRUE),this.forceNoAddHydrogens&&v.put("doNotAddHydrogens",Boolean.TRUE));var w=null,t=null,H=null,A=null,A=new JU.SB,G=0,D;if(1==this.slen)q=0;else{w=this.paramAsStr(q);if(2==this.slen&&!this.chk&&(w.endsWith(".spt")||w.endsWith(".png")||w.endsWith(".pngj"))){this.cmdScript(0,w,null,null);return}D=this.tokAt(q);switch(D){case 1073742077:f=!0,y.append(" orientation"),this.vwr.stm.saveOrientation("preload",null),w=this.paramAsStr(++q),
D=JS.T.getTokFromName(w)}switch(D){case 1073741839:w=this.optParameterAsString(++q);p=JU.PT.parseInt(w);(b=!this.$isStateScript||0<this.vwr.ms.mc)&&y.append(" append");0<=p&&(w=this.optParameterAsString(++q),b&&(y.append(" "+p),r=!1,v.put("appendToModelIndex",Integer.$valueOf(p))));D=JS.T.getTokFromName(w);break;case 1073877011:case 1610616855:case 1073742015:b=this.paramAsStr(this.checkLast(2));if(!this.chk)switch(D){case 1073877011:v.put("service","nbo");v.put("mode",Integer.$valueOf(1));v.put("action",
"load");v.put("value",b);v.put("sync",Boolean.TRUE);this.vwr.sm.processService(v);this.runScript(v.get("ret"));break;case 1610616855:this.vwr.setHistory(b);break;case 1073742015:this.vwr.setMenu(b,!0)}return;case 4130:g=b=!0;r=!1;y.append(" mutate");w=this.optParameterAsString(++q);D=JS.T.getTokFromName(w);v.put("appendToModelIndex",Integer.$valueOf(this.vwr.am.cmi));break;case 1073741851:m=!0;q++;break;case 1073741824:q++,y.append(" "+w),G=1073741824==D&&JU.PT.isOneOf(w.toLowerCase(),";xyz;vxyz;vibration;temperature;occupancy;partialcharge;")?
JS.T.getTokFromName(w):0,0!=G&&(v.put("atomDataOnly",Boolean.TRUE),v.put("modelNumber",Integer.$valueOf(1)),4166==G&&(G=1145047055),H=this.vwr.fm.getFileInfo(),b=!0)}switch(D){case 1228935687:q++;y.append(" "+w);this.optParameterAsString(q).equals("+")&&(d=!0,q++,y.append(" +"));this.optParameterAsString(q).equals("-")&&(d=!0,q++,y.append(" -"));7==this.tokAt(q)&&(t=this.stringParameterSet(q),q=this.iToken,q+1!=this.slen&&this.invArg(),null!=t&&(x=t.length));break;case 134217764:this.slen<q+4&&this.invArg(),
q-=2,k="0",v.put("isEmptyLoad",Boolean.TRUE);case 1073741984:c=!0;q++;y.append(" inline");break;case 134218757:e=!0;q++;break;case 1073741849:h=!0;v.put("async",Boolean.TRUE);q++;break;case 536870926:case 1094717454:q++;y.append(" "+w);536870926==D&&v.put("isTrajectory",Boolean.TRUE);if(this.isPoint3f(q)){var I=this.getPoint3f(q,!1,!0),q=this.iToken+1;v.put("firstLastStep",K(-1,[F(I.x),F(I.y),F(I.z)]));y.append(" "+JU.Escape.eP(I))}else switch(this.tokAt(q)){case 10:p=this.getToken(q++).value;v.put("bsModels",
p);y.append(" "+JU.Escape.eBS(p));break;default:v.put("firstLastStep",K(-1,[0,-1,1]))}break;case 1073741824:break;case 134221834:n=this.stringParameter(++q).toLowerCase();w=this.optParameterAsString(q+1);if((b=n.startsWith("append"))&&n.startsWith("append modelindex="))p=JU.PT.parseInt(n.substring(18)),0<=p&&(r=!1,v.put("appendToModelIndex",Integer.$valueOf(p)));f=0<=n.indexOf("orientation");q=this.addLoadData(y,n,v,q);n=!0;break;default:w="fileset"}null==k&&(null==t&&4!=this.getToken(q).tok)&&this.error(16)}var z=
q,I=q+1;p=null;1073741848==this.tokAt(I)&&(p=this.stringParameter(q=I+1),""!==this.vwr.fm.getPathForAllFiles()&&(p=null,z=q));var L=I=null;e&&1073741940==this.tokAt(q+1)&&(++q,C=this.stringParameter(++q));if(this.slen==q+1){if(null==k&&(0==q||null==t&&0==(k=this.paramAsStr(z)).length))k=this.getFullPathName(!0);if(null==k&&null==t){this.cmdZap(!1);return}if(null==t&&!c)if(e)k="$"+k;else{if(k.equals("String[]"))return;0==k.indexOf("[")&&(t=JU.Escape.unescapeStringArray(k),null!=t&&(1==q&&y.append(" files"),
x=t.length))}if(null!=t)for(e=0;e<x;e++)y.append(" /*file*/").append(JU.PT.esc(t[e]))}else if(this.isLoadOption(this.getToken(q+1).tok)){if(null==k&&0==(k=this.paramAsStr(z)).length&&null==(k=this.getFullPathName(!0))){this.cmdZap(!1);return}(z==q||null!=p)&&q++;if(k.equals("String[]"))return;if(1073742010==(D=this.tokAt(q)))e=this.stringParameter(++q),v.put("manifest",e),A.append(" MANIFEST "+JU.PT.esc(e)),D=this.tokAt(++q);switch(D){case 2:case 7:case 268437504:case 1073742195:q=this.getLoadModelIndex(q,
A,v)}q=this.getCmdExt().getLoadSymmetryParams(q,A,v);1073741839==this.tokAt(q)&&(134221834==this.tokAt(++q)?(q+=2,I=this.getToken(q++).value,L=this.stringParameter(++q),++q):(L=this.stringParameter(q++),I=this.stringParameter(q++)),v.put(L,I));1073741940==this.tokAt(q)&&(C=this.stringParameter(++q))}else x=new JU.Lst,1==q&&(268440577==this.tokAt(q+1)||268440576==this.tokAt(q+1)?w="files":q++,y.append(" "+w)),268440576==this.tokAt(q+1)&&(d=!0),C=this.getLoadFilesList(q,y,A,v,x),t=x.toArray(Array(x=
x.size())),!d&&0<=y.indexOf("/*concat*/")&&(d=!0);if(a){null!=t&&(k="fileSet");null!=I&&A.append(' APPEND data "'+L+'"\n'+I+(I.endsWith("\n")?"":"\n")+'end "'+L+'"');null==C&&(C=this.vwr.g.defaultLoadFilter);0<C.length&&(0<=C.toUpperCase().indexOf("DOCACHE")&&!this.$isStateScript&&!b&&this.vwr.cacheClear(),v.put("filter",C),C.equalsIgnoreCase("2d")&&(C="2D-noMin"),A.append(" FILTER "+JU.PT.esc(C)));a=!1;if(null==t)if(0<=this.vwr.am.cmi&&("::"+k).endsWith("::string")&&(k=this.getCurrentModelFileAsString("null"),
y=(new JU.SB).append("load inline "),c=!0),c)v.put("fileData",k);else if(k.startsWith("@")&&1<k.length){h=this.getVarParameter(k.substring(1),!1);if(u(h,"java.util.Map")){this.checkLength(q+1);this.loadPNGJVar(k,h,v);return}a=!0;h=""+h;y=(new JU.SB).append("{\n    var ").append(k.substring(1)).append(" = ").append(JU.PT.esc(h)).append(";\n    ").appendSB(y);v.put("fileData",h)}else if(!n&&!((k.startsWith("=")||k.startsWith("*"))&&0<k.indexOf("/")))q="",I=k.indexOf("::"),0<I&&20>I&&(q=k.substring(0,
I+2),k=k.substring(I+2)),k.startsWith("cache://")?p=null:g||(k=this.checkFileExists("LOAD"+(b?"_APPEND_":"_"),h,k,z,!b&&this.pc!=this.pcResume),null==k&&this.error(57),k=q+k);q=h=null;null!=p&&(p.equals(".")&&(p=this.vwr.fm.getFilePath(k,!1,!0)),(0==p.length||this.vwr.fm.getFilePath(p,!1,!1).equalsIgnoreCase(this.vwr.fm.getFilePath(k,!1,!1)))&&this.invArg(),z=P(-1,[p]),h=this.vwr.getOutputChannel(p,z),null==h?JU.Logger.error("Could not create output stream for "+z[0]):v.put("outputChannel",h));if(null==
t&&0==G){y.append(" ");a||c?y.append(0<=k.indexOf("\n")||a?JU.PT.esc(k):k):n||(null!=p&&(p=this.vwr.fm.getFilePath(p,!1,!1)),k.equals("String[]")||y.append("/*file*/").append(null!=p?JU.PT.esc(p):"$FILENAME$"));if(!d&&(k.startsWith("=")||k.startsWith("*"))&&0<k.indexOf("/")){var d=!0,I=k.indexOf("/"),W;1==I&&null!=(W=this.vwr.getPdbID())?(k=k.substring(0,1)+W+k.substring(1),I=k.indexOf("/")):W=k.substring(1,I);c=k.substring(I+1);k=k.substring(0,I);if(0<=(I=k.indexOf(".")))k=k.substring(0,I);0<=";dssr;rna3d;dom;val;".indexOf(";"+
c+";")||c.startsWith("dssr--")?(k.startsWith("=")&&(k+=".cif"),t=c.equals("all")?P(-1,[k,"*dom/"+W,"*val/"+W]):P(-1,[k,"*"+c+"/"+W]),k="fileSet",y=null,a=!1,q="-"):k+="/"+c}null!=y&&(0<A.length()&&y.append(" /*options*/ ").append(A.toString()),a&&y.append("\n  }"),v.put("loadScript",y))}if(m)null!=k&&v.put("audioFile",k),this.addFilterAttribute(v,C,"id"),this.addFilterAttribute(v,C,"pause"),this.addFilterAttribute(v,C,"play"),this.addFilterAttribute(v,C,"ended"),this.addFilterAttribute(v,C,"action"),
this.vwr.sm.playAudio(v);else if(this.setCursorWait(!0),(m=this.vwr.getBoolean(603979934))&&JU.Logger.startTimer("load"),!this.$isStateScript&&(!b&&!this.vwr.getBoolean(603979831))&&this.vwr.setBooleanProperty("legacyJavaFloat",!1),g&&v.put("isMutate",Boolean.TRUE),v.put("eval",this),A=this.vwr.loadModelFromFile(null,k,t,null,b,v,y,A,G,null!=q?q:d?"+":" "),m&&this.showString(JU.Logger.getTimerMsg("load",0)),null!=h&&(this.vwr.fm.setFileInfo(P(-1,[p])),JU.Logger.info(J.i18n.GT.o(J.i18n.GT.$("file {0} created"),
p)),this.showString(this.vwr.fm.getFilePath(p,!1,!1)+" created"),h.closeChannel()),0<G)this.vwr.fm.setFileInfo(H),null!=A&&!this.isCmdLine_c_or_C_Option&&this.evalError(A,null);else{if(null!=A&&!this.isCmdLine_c_or_C_Option){if(0==A.indexOf("NOTE: file recognized as a script file: ")){k=A.substring(40).trim();if(0<=k.indexOf("png|")&&k.endsWith("pdb|state.spt")){k=k.substring(0,k.lastIndexOf("|"));k+=k.substring(k.lastIndexOf("|"));this.runScript('load "'+k+'"');return}this.cmdScript(0,k,null,null);
return}if(this.vwr.async&&A.startsWith(JV.JC.READER_NOT_FOUND))throw new JS.ScriptInterruption(this,"async",1);this.evalError(A,null)}this.debugHigh&&this.report("Successfully loaded:"+(null==t?v.get("fullPathName"):w),!1);this.finalizeLoad(b,r,d,f,x,E,s,n)}}});f(d,"checkFileExists",function(a,b,c,e,g){if(this.chk||c.startsWith("cache://"))return c;if((this.vwr.testAsync||JV.Viewer.isJS)&&(b||c.startsWith("?"))||this.vwr.apiPlatform.forceAsyncLoad(c))c=this.loadFileAsync(a,c,e,g);a=this.vwr.getFullPathNameOrError(c);
if(null==c)return null;c=a[0];null!=a[1]&&this.errorStr(17,c+":"+a[1]);return c},"~S,~B,~S,~N,~B");f(d,"addFilterAttribute",function(a,b,c){b=JU.PT.getQuotedOrUnquotedAttribute(b,c);null!=b&&0<b.length&&a.put(c,b)},"java.util.Map,~S,~S");f(d,"addLoadData",function(a,b,c,e){a.append(" /*data*/ data");var g=b.indexOf("@");0<=g&&(b=b.$replace("@","_"));a.append(" ").append(JU.PT.esc(b));var n=0<=g?""+this.getParameter(b.substring(g+1),4,!0):this.paramAsStr(++e),n=JV.Viewer.fixInlineString(n,this.vwr.getInlineChar());
c.put("fileData",n);c.put("isData",Boolean.TRUE);a.appendC("\n").append(n).append(" end ").append(JU.PT.esc(b));0>g&&(e+=2);return e},"JU.SB,~S,java.util.Map,~N");f(d,"loadPNGJVar",function(a,b,c){b=P(-1,[JS.SV.newV(6,b)]);this.getCmdExt().dispatch(1073741866,!1,b);c.put("imageData",b[0].value);b=this.vwr.getOutputChannel(null,null);c.put("outputChannel",b);this.vwr.createZip("","BINARY",c);a="cache://VAR_"+a;this.vwr.cacheFileByName("cache://VAR_*",!1);this.vwr.cachePut(a,b.toByteArray());this.cmdScript(0,
a,null,null)},"~S,~O,java.util.Map");f(d,"getLoadFilesList",function(a,b,c,e,g){for(var n=null,d=null,f=null,l=null;a<this.slen;){switch(this.tokAt(a)){case 268440577:b.append("/*concat*/ +");++a;continue;case 268440576:b.append(" -");++a;continue;case 2:case 7:case 268437504:case 1073742195:a=this.getLoadModelIndex(a,c,e);continue;case 1073741940:d=this.stringParameter(++a);++a;continue;case 1073742329:e.remove("isTrajectory");null==n&&(n=new JU.Lst,f=JU.P3.new3(0,-1,1));this.isPoint3f(++a)?(f=this.getPoint3f(a,
!1,!0),a=this.iToken+1):10==this.tokAt(a)&&(l=this.getToken(a).value,f=null,a=this.iToken+1);break;case 1073741824:this.invArg()}g.addLast(this.paramAsStr(a++));null!=f?(n.addLast(K(-1,[F(f.x),F(f.y),F(f.z)])),b.append(" COORD "+JU.Escape.eP(f))):null!=l&&(n.addLast(l),b.append(" COORD "+JU.Escape.eBS(l)));b.append(" /*file*/$FILENAME"+g.size()+"$")}null!=n&&e.put("firstLastSteps",n);return d},"~N,JU.SB,JU.SB,java.util.Map,JU.Lst");f(d,"isLoadOption",function(a){switch(a){case 1073742010:case 2:case 7:case 268437504:case 1073742195:case 1073742332:case 8:case 1073742080:case 1094713350:case 1073742163:case 1073741938:case 1073742114:case 134217764:case 1814695966:case 1073742066:case 134221834:case 1073741839:return!0;
case 1073741940:case 1073741824:return 1073742329!=this.tokAt(this.iToken+2)}return!1},"~N");f(d,"getLoadModelIndex",function(a,b,c){switch(this.tokAt(a)){case 2:c.remove("firstLastStep");c.remove("bsModel");c.put("useFileModelNumbers",Boolean.TRUE);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 268437504:case 1073742195:c.remove("firstLastStep");for(var e=this.floatParameterSet(a,1,2147483647),
g=new JU.BS,n=K(e.length,0),d=0;d<e.length;d++)a=F(e[d]),1<=e[d]&&e[d]==a?g.set(a-1):this.invArg(),n[d]=a;b.append(" "+JU.Escape.eAI(n));c.put("bsModels",g);c.put("useFileModelNumbers",Boolean.TRUE)}return this.iToken+1},"~N,JU.SB,java.util.Map");f(d,"finalizeLoad",function(a,b,c,e,g,n,d,f){if(a&&(b||1<g))this.vwr.setAnimationRange(-1,-1),this.vwr.setCurrentModelIndex(d);var l;0==this.scriptLevel&&(!a&&(c||2>g)&&null!=(l=this.vwr.ms.getInfoM("modelLoadNote")))&&this.showString(l);l=this.vwr.ms.getInfoM("centroidMinMax");
JU.AU.isAI(l)&&0<this.vwr.ms.ac&&(a=JU.BSUtil.newBitSet2(a?n:0,this.vwr.ms.ac),this.vwr.ms.setCentroid(a,l));a=this.vwr.g.defaultLoadScript;l="";0<a.length&&(l+="\nUsing defaultLoadScript: "+a);var r;n=this.vwr.ms.msInfo;null!=n&&this.vwr.allowEmbeddedScripts()&&null!=(r=n.remove("jmolscript"))&&0<r.length?(l+="\nAdding embedded #jmolscript: "+r,a+=";"+r,this.setStringProperty("_loadScript",a),a="allowEmbeddedScripts = false;try{"+a+"} allowEmbeddedScripts = true;",this.isEmbedded=!this.isCmdLine_c_or_C_Option):
this.setStringProperty("_loadScript","");this.logLoadInfo(l,f);f=null==n?null:n.remove("sitescript");null!=f&&(a=f+";"+a);e&&(a+=";restore orientation preload");0<a.length&&!this.isCmdLine_c_or_C_Option&&this.runScript(a);this.isEmbedded=!1},"~B,~B,~B,~B,~N,~N,~N,~B");f(d,"cmdLog",function(){1==this.slen&&this.bad();if(!this.chk){var a=this.parameterExpressionString(1,0);1073742334==this.tokAt(1)?this.setStringProperty("logFile",""):this.vwr.log(a)}});f(d,"cmdLoop",function(){this.vwr.headless||(this.chk||
(this.pc=-1),this.cmdDelay())});f(d,"cmdMessage",function(){var a=this.paramAsStr(this.checkLast(1));this.chk||(a=this.vwr.formatText(a),null==this.outputBuffer&&!this.vwr.isPrintOnly&&JU.Logger.warn(a),a.startsWith("_")||this.report(a,!1))});f(d,"cmdModel",function(a){var b=4115==this.theTok||1<this.vwr.ms.mc,c=K(-1,[-1,-1]),e=0,g=!0,n=-1;if(1==this.slen&&1==a){var n=this.vwr.am.cmi,d;if(!this.chk&&0<=n&&0<=(d=this.vwr.ms.getJmolDataSourceFrame(n)))this.vwr.setCurrentModelIndex(d==n?-2147483648:
d)}else{switch(this.tokAt(1)){case 1073877010:if(!this.chk&&b&&2==this.slen){for(;++n<this.vwr.ms.mc;)if(this.vwr.ms.am[n].auxiliaryInfo.containsKey("moData")){this.vwr.am.setFrame(n);this.showString("Frame set to "+(n+1));return}this.showString("No molecular orbitals")}return;case 2:if(b&&2==this.slen){this.chk||this.vwr.am.setFrame(this.intParameter(1)-1);return}break;case 1073742325:case 10:n=this.atomExpressionAt(1).nextSetBit(0);if(this.chk||0>n||n>=this.vwr.ms.ac)return;n=this.vwr.ms.at[n].mi;
if(this.iToken+1==this.slen){this.vwr.setCurrentModelIndex(n);return}c[e++]=n;a=this.iToken+1;g=!1;break;case 1073741904:this.iToken=1;n=2==this.tokAt(2)?this.intParameter(++this.iToken):1;this.checkLength(this.iToken+1);!this.chk&&0<n&&this.vwr.ms.createModels(n);return;case 1073741974:this.checkLength(3);n=this.stringParameter(2);this.chk||this.vwr.setCurrentModelID(n);return;case 528397:n=0;this.checkLength(3);switch(this.getToken(2).tok){case 2:case 3:n=ba(1E3*this.floatParameter(2));break;default:this.error(20)}this.chk||
this.vwr.setFrameDelayMs(n);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 1073742077:if(3==this.tokAt(2)&&12==this.tokAt(3)){n=this.vwr.ms.getModelNumberIndex(this.getToken(2).intValue,!1,!1);c=this.getToken(3).value;0<=n&&(this.vwr.ms.am[n].mat4=c);return}break;case 1073741832:c=1073742333==this.tokAt(2);n=2==this.slen||c?null:this.atomExpressionAt(2);
c&&(this.iToken=2);c=12293==this.tokAt(this.iToken+1);this.checkLength(this.iToken+(c?2:1));this.chk||this.vwr.setFrameOffsets(n,c);return}if(268440576==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{d=b=!1;var f=null,l=null,r=!1,f=!1,m=0,k=null,p=this.vwr.haveFileSet();if(this.isArrayParameter(1))this.setFrameSet(1),r=!0;else for(var q=a;q<this.slen;q++)switch(this.getToken(q).tok){case 1073741832:2!=
q&&this.invArg();k=this.centerParameter(3,null);this.checkLength(q=this.iToken+1);break;case 1073742327:case 268441089:this.checkLength(a+(d?2:1));r=!0;break;case 268440576:1!=e&&this.invArg();f=!0;break;case 1073742333:this.checkLength(a+1);break;case 3:if(g=!1,0>(m=this.floatParameter(q))){this.checkLength(q+1);this.chk||this.vwr.am.morph(-m);return}case 2:case 4:2==e&&this.invArg();var C=4==this.theTok?JU.Edge.getFloatEncodedInt(this.theToken.value):this.theToken.intValue;0>C&&1==e&&(f=!0,C=-C,
p&&1E6>C&&(C*=1E6));3==this.theTok&&(p&&m==F(m))&&(C=1E6*F(m));if(2147483647==C){g=!1;c[e++]=this.chk||1!=q?0:this.vwr.getModelIndexFromId(this.theToken.value.toString());break}if(-1==C){this.checkLength(a+1);this.chk||this.vwr.setAnimation(1073742108);return}1E3<=C&&(1E6>C&&p)&&(C=1E6*T(C/1E3)+C%1E3);!g&&(0==C&&0==e)&&(r=!0);1E6<=C&&(g=!1);c[e++]=C;break;case 1073742096:b=!0;break;case 1073742114:d=!0;break;case 1715472409:if(0>n&&0>(n=this.vwr.am.cmi))return;f=this.paramAsStr(++q);c=this.setVariable(++q,
-1,"",!1);if(null!=c&&!this.chk){if(f.equalsIgnoreCase("DSSR")){this.loadDssr(n,c.value);return}l=JS.SV.oValue(c)}this.chk||this.vwr.ms.setInfo(n,f,l);return;default:this.frameControl(a);return}if(!this.chk)if(d&&0==e&&(r=!0),r)this.vwr.setAnimationOn(!1),this.vwr.setAnimationRange(-1,-1),d||this.vwr.setCurrentModelIndex(-1);else{2==e&&!d&&(f=!0);if(p)g=!1;else if(g)for(q=0;q<e;q++)0<=c[q]&&(c[q]%=1E6);n=this.vwr.ms.getModelNumberIndex(c[0],g,!1);if(null!=k)0<=n&&(this.vwr.ms.translateModel(n,null),
this.vwr.ms.translateModel(n,k));else{a=-1;if(p&&0>n&&0!=c[0])if(1E6>c[0]&&(c[0]*=1E6),2==e&&1E6>c[1]&&(c[1]*=1E6),0==c[0]%1E6)c[0]++,n=this.vwr.ms.getModelNumberIndex(c[0],!1,!1),0<=n&&(a=this.vwr.ms.getModelNumberIndex(1==e?c[0]+1E6:0==c[1]?-1:0==c[1]%1E6?c[1]+1000001:c[1]+1,!1,!1),0>a&&(a=this.vwr.ms.mc),a--,d?e=2:!f&&a!=n&&(f=!0),d=d||n==a);else return;(!b&&!d||0<=n)&&this.vwr.setCurrentModelIndexClear(n,!1);if(b&&2==e||d||f)0>a&&(a=this.vwr.ms.getModelNumberIndex(c[1],g,!1)),this.vwr.setAnimationOn(!1),
this.vwr.am.setAnimationDirection(1),this.vwr.setAnimationRange(n,a),this.vwr.setCurrentModelIndexClear(f&&!d?-1:0<=n?n:0,!1);b&&this.vwr.setAnimation(4143)}}}}},"~N");f(d,"loadDssr",function(a,b){0>a&&0>(a=this.vwr.am.cmi)&&this.errorStr(30,"load <dssr file>");b.startsWith("{")||(b=this.vwr.getFileAsString3(b,!0,"script"));this.clearDefinedVariableAtomSets();var c=this.vwr.parseJSONMap(b);this.showString(this.vwr.getAnnotationParser(!0).fixDSSRJSONMap(c));this.vwr.ms.setInfo(a,"dssr",c)},"~N,~S");
f(d,"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)),e=this.floatParameter(8),g=this.floatParameter(9),n=11==this.slen?this.intParameter(10):30;if(!this.chk&&(this.refresh(!1),this.useThreads()||(g=0),this.vwr.move(this,a,b,c,e,g,n),0<g&&this.isJS))throw new JS.ScriptInterruption(this,"move",1);});f(d,"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,e=1;a=this.isFloatParameter(e)?this.floatParameter(e++):2;var g=90,n=null,
d=!0,d=!1,f=0,l=0,r=NaN,m=NaN,k=this.vwr.tm.getZoomSetting(),p=null,q=NaN,C=NaN,s=NaN,E=NaN,y=NaN,x=NaN,v=null,w=null,t=this.getToken(e).tok;switch(t){case 1073742110:v=this.floatParameterSet(++e,18,21);e=this.iToken+1;if(this.chk&&0<this.checkLength(e))return;break;case 134221850:1073742028==this.tokAt(++e)&&(d=!0,e++);this.isAtomExpression(e)?(d=!0,w=Array(1),c=this.centerParameter(e,w),u(w[0],"JU.BS")||this.invArg(),n=w[0],w=this.chk?new JU.Quat:this.vwr.ms.getQuaternion(n.nextSetBit(0),this.vwr.getQuaternionFrame())):
w=this.getQuaternionParameter(e,null,!1);e=this.iToken+1;null==w&&this.invArg();break;case 9:case 8:case 1073742332:this.isPoint3f(e)?(b.setT(this.getPoint3f(e,!0,!0)),e=this.iToken+1,g=this.floatParameter(e++)):(g=this.getPoint4f(e),e=this.iToken+1,b.set(g.x,g.y,g.z),g=0==g.x&&0==g.y&&0==g.z?NaN:g.w);break;case 1073741954:b.set(1,0,0);g=0;this.checkLength(++e);break;case 1073741858:b.set(0,1,0);g=180;this.checkLength(++e);break;case 1073741996:b.set(0,1,0);this.checkLength(++e);break;case 1073742126:b.set(0,
-1,0);this.checkLength(++e);break;case 1073742172:b.set(1,0,0);this.checkLength(++e);break;case 1073741871:b.set(-1,0,0);this.checkLength(++e);break;case 1073741854:w=this.paramAsStr(++e);w.equals("-")&&(w+=this.paramAsStr(++e));this.checkLength(++e);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 H;H=this.vwr.getCurrentUnitCell();null==H&&(H=this.vwr.getSymTemp().setUnitCellFromParams(null,
!1,NaN));w=H.getQuaternionRotation(w);null==w&&this.invArg()}break;default:b=JU.V3.new3(this.floatParameter(e++),this.floatParameter(e++),this.floatParameter(e++)),g=this.floatParameter(e++)}null!=w&&(g=w.toAxisAngle4f(),b.set(g.x,g.y,g.z),g=(d?-1:1)*(180*g.angle/3.141592653589793));Float.isNaN(b.x)||Float.isNaN(b.y)||Float.isNaN(b.z)?b.set(0,0,0):0==b.length()&&0==g&&(g=NaN);d=134221850==t||!this.vwr.tm.isInPosition(b,g);this.isFloatParameter(e)&&(r=this.floatParameter(e++));this.isFloatParameter(e)&&
!this.isCenterParameter(e)&&(f=this.floatParameter(e++),l=this.floatParameter(e++),!d&&1<=Math.abs(f-this.vwr.tm.getTranslationXPercent())&&(d=!0),!d&&1<=Math.abs(l-this.vwr.tm.getTranslationYPercent())&&(d=!0));null==n&&e!=this.slen&&(w=Array(1),c=this.centerParameter(e,w),u(w[0],"JU.BS")&&(n=w[0]),e=this.iToken+1);if(null!=c){!d&&0.1<=c.distance(this.vwr.tm.fixedRotationCenter)&&(d=!0);this.isFloatParameter(e)&&(m=this.floatParameter(e++));this.isCenterParameter(e)||((0==m||Float.isNaN(m))&&(0==
r||Float.isNaN(r))?(n=Math.abs(this.getZoom(0,e,n,0==r?0:k)),e=this.iToken+1,r=n):!d&&0.1<=Math.abs(m-this.vwr.getFloat(570425388))&&(d=!0));if(0==r||Float.isNaN(r))r=100;Float.isNaN(m)&&(m=0);!d&&1<=Math.abs(r-k)&&(d=!0);e!=this.slen&&(p=this.centerParameter(e,null),e=this.iToken+1,e!=this.slen&&(q=this.floatParameter(e++),C=this.floatParameter(e++)),e!=this.slen&&(s=this.floatParameter(e++)),e!=this.slen&&(E=this.floatParameter(e++),!d&&0.01<=Math.abs(E-this.vwr.tm.getCameraDepth())&&(d=!0)),e+
1<this.slen&&(y=this.floatParameter(e++),x=this.floatParameter(e++),!d&&0.01<=Math.abs(y-this.vwr.tm.camera.x)&&(d=!0),!d&&0.01<=Math.abs(x-this.vwr.tm.camera.y)&&(d=!0)))}this.checkLength(e);if(!this.chk&&(d||(a=0),0<a&&this.refresh(!1),this.useThreads()||(a=0),0==E&&(E=y=x=NaN),null!=v?this.vwr.tm.moveToPyMOL(this,a,v):this.vwr.moveTo(this,a,c,b,g,null,r,f,l,m,p,q,C,s,E,y,x),this.isJS&&0<a&&this.vwr.g.waitForMoveTo))throw new JS.ScriptInterruption(this,"moveTo",1);}}});f(d,"isAtomExpression",function(a){switch(this.tokAt(a)){case 12290:case 10:case 1073742325:return!0;
default:return!1}},"~N");f(d,"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.":": "+this.vwr.formatText(a);this.pauseExecution(!0);this.vwr.scriptStatusMsg("script execution paused"+
a,"script paused for RESUME");return!0});f(d,"cmdPrint",function(){1==this.slen?this.chk||this.showStringPrint("\x00",!0):this.showStringPrint(this.parameterExpressionString(1,0),!0)});f(d,"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,null,null,!0)});f(d,"cmdReset",function(){if(3==this.slen&&134320141==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 134221829:this.vwr.cacheClear();return;case 1073741936:this.resetError();return;case 1073741995:this.vwr.stm.resetLighting();return;case 1086324748:this.vwr.resetShapes(!0);return;case 134320141:this.vwr.clearFunctions();return;case 1812599299:this.vwr.ms.setBoundBox(null,
null,!0,0);return;case 1639976963:var a=new JU.BS;this.runScript(this.vwr.ms.getDefaultStructure(this.vwr.bsA(),a));this.vwr.shm.resetBioshapes(a);return;case 1648363544:this.vwr.setData("element_vdw",P(-1,[null,""]),0,0,0,0,0);return;case 1075838996: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)}});f(d,"resetError",function(){this.vwr.g.removeParam("_errormessage")});f(d,"cmdRestrict",function(){var a=
1677721602==this.tokAt(1);this.cmdSelect(a?2:1);this.restrictSelected(a,!0)});f(d,"cmdReturn",function(a){if(!this.chk){var b=this.getContextVariableAsVariable("_retval",!1);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");f(d,"cmdRotate",function(a,b){if(2==this.slen)switch(this.getToken(1).tok){case 1073742335:this.chk||this.vwr.tm.setSpinOn();return;case 1073742334:this.chk||
this.vwr.tm.setSpinOff();return}for(var c=null,e=null,g=1.4E-45,n=0,d=3.4028235E38,f=!1,l=!1,r=null,m=null,k=Array(2),p=JU.V3.new3(0,1,0),q=null,C=null,m=null,s=!1,u=1,y,m=null,x=!1,v=!1,w=!1,t=null,H=null,A=null,G=null,D=this.vwr.getBoolean(603979806),I=!1,z=1;z<this.slen;++z){switch(y=this.getToken(z).tok){case 528432:case 4145:I=null!=this.vwr.getOperativeSymmetry();continue;case 12290:case 10:case 1073742325:if(e=this.atomExpressionAt(z),null!=q||null!=m||2==n){c=e;t=null;b=!0;break}case 1073742332:case 8:case 1073742330:l=
!0;2==n&&(n=0);var F=this.centerParameterForModel(z,this.vwr.am.cmi,null);!this.chk&&(1073742330==y&&268437504!=this.tokAt(z+2))&&(f=!0,p=P(-1,[this.objectNameParameter(++z),Integer.$valueOf(this.vwr.am.cmi),null]),p=this.getShapePropertyData(22,"getSpinAxis",p)?p[2]:null);k[n++]=F;break;case 1611141175:a=!0;continue;case 1073741988:case 1073742028:f=!0;continue;case 1113589787:b=!0;break;case 268436992:continue;case 2:case 3:a?1.4E-45==g?g=this.floatParameter(z):3.4028235E38==d?(d=g,g=this.floatParameter(z)):
this.invArg():3.4028235E38==d?d=this.floatParameter(z):1.4E-45==g?(g=this.floatParameter(z),a=!0):this.invArg();if(z==this.slen-2&&(1073741824==this.tokAt(z+1)||4==this.tokAt(z+1)))z=this.paramAsStr(++z).toLowerCase(),z.equals("dps")?v=!0:z.equals("sec")&&(w=!0);break;case 268440576:u=-1;continue;case 1111492629:l=!0;p.set(u,0,0);continue;case 1111492630:l=!0;p.set(0,u,0);continue;case 1111492631:l=!0;p.set(0,0,D&&!f?-u:u);continue;case 9:case 134221850:case 1073741864:134221850==y&&z++;l=!0;if(null!=
(m=this.getQuaternionParameter(z,e,1073741864==y)))0==m.q0&&(m.q0=1E-10),p.setT(m.getNormal()),d=m.getTheta();break;case 134217750:if(this.paramAsStr(z+1).equalsIgnoreCase("picked")){y=this.vwr.getPOrNull("pickedList");z=y.size();if(3>z)return;d=Array(3);for(m=0;3>m;m++)d[m]=this.vwr.ms.getAtomSetCenter(JS.SV.getBitSet(y.get(z-3+m),!1))}else if(this.isArrayParameter(z+1))d=this.getPointArray(++z,-1,!1);else{d=Array(3);for(m=0;3>m;m++)d[m]=this.centerParameter(++z,null),z=this.iToken}z=d.length;if(3>
z)return;m=JU.Quat.getQuaternionFrame(d[z-3],d[z-2],d[z-1]);m=JU.Quat.new4(1,0,0,0).mulQ(m.inv().div(this.vwr.tm.getRotationQ()));p.setT(m.getNormal());d=m.getTheta();break;case 134217731:l=!0;if(this.isPoint3f(++z)){p.setT(this.centerParameter(z,null));break}d=this.getPoint4f(z);p.set(d.x,d.y,d.z);d=d.w;m=JU.Quat.newVA(p,d);break;case 1073742328:l=f=b=!0;if(this.isArrayParameter(++z))r=this.floatParameterSet(z,6,2147483647);else{n=this.atomExpressionAt(z).nextSetBit(0);z=this.atomExpressionAt(++this.iToken).nextSetBit(0);
if(0>n||0>z)return;c=this.vwr.getBranchBitSet(z,n,!0);k[0]=this.vwr.ms.at[n];k[1]=this.vwr.ms.at[z];n=2}break;case 4160:q=JU.V3.newV(this.centerParameter(++z,null));f=b=!0;break;case 136314895:x=!0;continue;case 1296041985:y=this.intParameter(++z);if(this.chk)continue;q=this.vwr.getSymTemp().getSpaceGroupInfo(this.vwr.ms,null,-1,!1,null);f=null==q?null:q.get("operations");(0==y||null==f||f.length<Math.abs(y))&&this.invArg();f=f[Math.abs(y)-1];q=f[5];A=f[6];k[0]=f[7];null!=f[8]&&(p=f[8]);d=f[9].intValue();
0>y&&(d=-d,null!=q&&q.scale(-1));0==d&&null!=k[0]&&(p.normalize(),JU.Measure.getPlaneThroughPoint(k[0],p,G=new JU.P4));m=JU.Quat.newVA(p,d);n=null==k[0]?0:1;b=l=f=!0;continue;case 134221831:H=this.atomExpressionAt(++z);m=this.vwr.ms.getAtomPointVector(H);null==m&&(this.iToken=z,this.invArg());z=this.iToken;t=this.getPointVector(this.getToken(++z),z);if(null==t||m.size()!=t.size())this.iToken=z,this.invArg();C=new JU.M4;k[0]=new JU.P3;n=1;J.api.Interface.getInterface("JU.Eigen",this.vwr,"script");
if(0.001<(this.chk?0:JU.Measure.getTransformMatrix4(m,t,C,k[0])))t=null;case 12:case 11:l=!0;m=new JU.M3;12==y&&(s=!0,C=this.theToken.value);null!=C?(k[0]=null,c=e,t=null,n=0,q=new JU.V3,C.getTranslation(q),C.getRotationScale(m)):m=this.theToken.value;m=this.chk?new JU.Quat:JU.Quat.newM(m);p.setT(m.getNormal());d=m.getTheta();f=!0;break;default:this.invArg()}z=this.iToken}if(!this.chk){null!=r&&3.4028235E38!=d&&(a=!0,g=d);b&&null==c&&(c=this.vwr.bsA());null!=H&&(b=!0,null==c&&(c=H));null!=m&&(!w&&
!v)&&(v=0<g,w=!v);e=1.4E-45==g?10:3.4028235E38==d?g:v?g:w?(0>d?-1:1)*Math.abs(d/g):0>g==(null==m?0<d:!0)?-d/g:g;null==m&&(0>d&&0<e)&&(e=-e);if(null!=r){if(!a){this.vwr.setDihedrals(r,null,1);return}q=null}null!=m&&(0==n&&(null!=q&&!s)&&(k[0]=this.vwr.ms.getAtomSetCenter(null!=c?c:b?this.vwr.bsA():this.vwr.getAllAtoms())),x&&null!=q&&(k[1]=JU.P3.newP(k[0]),k[1].add(q),C=JU.Measure.computeHelicalAxis(k[0],k[1],m),k[0]=C[0],x=C[3].x,0!=x&&(q=C[1],p=JU.V3.newV(q),0>x&&p.scale(-1)),C=null),a&&null==C&&
(C=JS.ScriptMathProcessor.getMatrix4f(m.getMatrix(),q)),null!=k[0]&&(n=1));if(null!=A||null!=G)if(this.vwr.invertAtomCoord(A,null,c,-1,!1),null==p)return;G=a&&(!this.vwr.headless||3.4028235E38==d);a&&!G&&(a=!1);if(!I&&2>n&&null==r){if(!f){if(G&&(null==c&&!this.useThreads())&&(a=!1,3.4028235E38==d))return;if(this.vwr.rotateAxisAngleAtCenter(this,k[0],p,e,d,a,c)&&this.isJS&&a&&null==c&&this.vwr.g.waitForMoveTo&&3.4028235E38!=d)throw new JS.ScriptInterruption(this,"rotate",1);return}0==n&&(k[0]=new JU.P3);
k[1]=JU.P3.newP(k[0]);k[1].add(p);n=2}0==n&&(k[0]=new JU.P3);if(2>n||0==k[0].distance(k[1]))k[1]=JU.P3.newP(k[0]),k[1].y+=1;3.4028235E38==d&&(d=0);if(I)0!=d&&((null==c||2!=n||a||null!=q||null!=r||null!=t||s)&&this.invArg(),c=this.vwr.getModelkit(!1).cmdRotateAtoms(c,k,d),this.doReport()&&this.report(J.i18n.GT.i(J.i18n.GT.$("{0} atoms rotated"),c),!1));else{0!=d&&(null!=q&&!l)&&q.scale(d/q.length());if(a&&null!=q&&(0==d||0==g))d=0.01,e=1.4E-45==g?0.01:0>g?-d/g:0.01*g/q.length();null!=c&&(a&&null==
t&&null!=C)&&(m=this.vwr.ms.getAtomPointVector(c),t=JU.Measure.transformPoints(m,C,k[0]));if(null!=c&&!a&&null!=t)this.vwr.setAtomCoords(c,1145047050,t);else if(!G||this.useThreads())if(this.vwr.rotateAboutPointsInternal(this,k[0],k[1],e,d,a,c,q,t,r,s?C:null)&&this.isJS&&a)throw new JS.ScriptInterruption(this,"rotate",1);}}},"~B,~B");f(d,"cmdRestore",function(){if(1<this.slen){var a=this.optParameterAsString(2),b=this.tokAt(1);switch(b){case 1814695966:this.chk||this.vwr.setModelCagePts(-1,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 e="";switch(b){case 1073742077:e="Orientation";this.vwr.stm.restoreOrientation(a,c,!0);break;case 1073742132:e="Rotation";this.vwr.stm.restoreOrientation(a,c,!1);break;case 1073742139:e="Scene",this.vwr.stm.restoreScene(a,c)}if(this.isJS&&0<c&&this.vwr.g.waitForMoveTo)throw new JS.ScriptInterruption(this,"restore"+e,1);return}this.checkLength23();switch(b){case 1677721602: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 1073742329: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;b=
this.vwr.stm.getSavedState(a);if(null==b){if(a.equalsIgnoreCase("UNDO"))return;this.invArg()}this.runScript(b);return;case 1639976963:if(this.chk)return;a=this.vwr.stm.getSavedStructure(a);null==a&&this.invArg();this.runScript(a);return;case 1814695966:this.chk||this.vwr.stm.restoreUnitCell(a);return}}this.errorStr2(53,"RESTORE","bonds? context? coordinates? orientation? rotation? selection? state? structure?")});f(d,"cmdSave",function(){if(1<this.slen){var a=this.optParameterAsString(2);switch(this.tokAt(1)){case 1677721602:this.chk||
this.vwr.stm.saveBonds(a);return;case 14:this.chk||this.saveContext(a);return;case 1073742329: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.getBoolean(603979898)&&(this.vwr.stm.saveState(a),0==a.length&&this.showString(this.vwr.stm.getUndoInfo()));
return;case 1639976963:this.chk||this.vwr.stm.saveStructure(a);return;case 1814695966:this.chk||this.vwr.stm.saveUnitCell(a);return}}this.errorStr2(53,"SAVE","bonds? context? coordinates? orientation? rotation? selection? state? structure?")});f(d,"cmdScript",function(a,b,c,e){if(134238732==a)this.checkLength(2),this.chk||this.vwr.jsEval(this.paramAsStr(1));else{var g=!0,d=!1,h=!1,f=this.vwr.async,l=0,r=0,m=0,k=0,p=1,q=null,C=null,s=null;4124==a&&(p=-2);if(null==b&&null==c)if(a=this.tokAt(p),4!=a&&
this.error(16),b=this.paramAsStr(p),b.equalsIgnoreCase("async")&&(f=!0,b=this.paramAsStr(++p)),b.equalsIgnoreCase("applet")){b=null;a=this.paramAsStr(++p);c=this.parameterExpressionString(++p,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);h=266298==a;if(b.equalsIgnoreCase("inline"))b=null,c=this.parameterExpressionString(++p,h?this.slen-1:0),p=this.iToken;
else{for(;b.equalsIgnoreCase("localPath")||b.equalsIgnoreCase("remotePath")||b.equalsIgnoreCase("scriptPath");)b.equalsIgnoreCase("localPath")?q=this.paramAsStr(++p):b.equalsIgnoreCase("scriptPath")?s=this.paramAsStr(++p):C=this.paramAsStr(++p),b=this.paramAsStr(++p);b.startsWith("spt::")&&(b=b.substring(5));b=this.checkFileExists("SCRIPT_",f,b,p,!0)}if(1073741877==(a=this.tokAt(++p)))d=!0,a=this.tokAt(++p);1073742050==a&&(g=!1,a=this.tokAt(++p));if(1073741998==a||1140850692==a)p++,m=l=Math.max(this.intParameter(p++),
0),this.checkToken(p)&&(m=268440576==this.getToken(p).tok?this.checkToken(++p)?this.intParameter(p++):0:-this.intParameter(p++),0>=m&&this.invArg());else if(1073741890==a||1073741892==a)p++,r=Math.max(this.intParameter(p++)-1,0),k=r+1,this.checkToken(p)&&(k=268440576==this.getToken(p).tok?this.checkToken(++p)?this.intParameter(p++):0:-this.intParameter(p++),0>=k&&this.invArg());p=-p}else null!=b&&f&&(b=this.checkFileExists("SCRIPT_",f,b,p,!0));if(0>p){if(268435968==this.tokAt(p=-p))e=this.parameterExpressionList(p,
-1,!1),p=this.iToken+1;this.checkLength(h?p+1:p)}if(!this.chk||this.isCmdLine_c_or_C_Option)if(this.isCmdLine_c_or_C_Option&&(d=!0),null==c&&(c=this.getScriptFileInternal(b,q,C,s),null==c&&this.invArg()),this.isMenu(c))this.vwr.setMenu(c,!1);else{p=this.chk;q=this.isCmdLine_c_or_C_Option;d&&(this.chk=this.isCmdLine_c_or_C_Option=!0);this.pushContext(null,"SCRIPT");this.contextPath+=" >> "+b;if(this.compileScript(b,c,null!=b&&this.debugScript)){this.pcEnd=k;for(this.lineEnd=m;r<this.lineNumbers.length&&
this.lineNumbers[r]<l;)r++;this.pc=r;b=this.isCmdLine_C_Option;this.isCmdLine_C_Option=(new Boolean(this.isCmdLine_C_Option&g)).valueOf();this.executionStepping=(new Boolean(this.executionStepping|h)).valueOf();this.setScriptArguments(e,!1);d&&(this.listCommands=!0);(e=this.vwr.getBoolean(603979934))&&JU.Logger.startTimer("script");this.privateFuncs=null;this.dispatchCommands(!1,!1,!1);this.$isStateScript&&JS.ScriptManager.setStateScriptVersion(this.vwr,null);e&&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),q?this.setErrorMessage(null):this.evalError(null,null);this.chk=p;this.isCmdLine_c_or_C_Option=q}}},"~N,~S,~S,JU.Lst");f(d,"isMenu",function(a){var b=null==a?-1:a.indexOf("Menu Structure");return 0<b&&a.startsWith("#")&&b<a.indexOf("\n")},"~S");f(d,"cmdSelect",function(a){if(1==this.slen)this.vwr.selectStatus(null,!1,0,!this.doReport(),!1);else if(!(2==
this.slen&&1073742072==this.tokAt(1))){var b=this.tokAt(2),c=null;switch(b){case 10:if(u(this.getToken(2).value,"JM.BondSet")||1677721602==b&&10==this.getToken(3).tok){this.slen!=this.iToken+2&&this.invArg();this.chk||this.vwr.selectBonds(this.theToken.value);return}break;case 1745489939:case 1677721602:if(5==this.slen&&10==this.tokAt(3))c=this.getToken(3).value,this.iToken++;else if(this.isArrayParameter(4))for(var c=new JU.BS,e=this.expandFloatArray(this.floatParameterSet(4,0,2147483647),0,!1),
g=e.length;0<=--g;)0<=e[g]&&c.set(e[g]);this.checkLast(this.iToken);if(this.chk)return;null==c&&this.invArg();1745489939==b?this.setShapeProperty(6,"select",c):this.vwr.selectBonds(c);return}e=0;b=!1;(g=268436992==this.tokAt(a))&&a++;if(0==this.getToken(1).intValue&&1073742334!=this.theTok)c=this.parameterExpressionToken(0).value,u(c,"JU.BS")||this.invArg(),this.checkLast(this.iToken);else{b=this.tokAt(a);switch(b){case 1073742335:case 1073742334:if(this.chk||this.vwr.setSelectionHalosEnabled(1073742335==
b),b=this.tokAt(++a),0==b)return}switch(b){case 1275069441:case 1073742119:e=b,b=this.tokAt(++a)}(b=1086324742==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.selectStatus(c,b,e,!this.doReport(),g),this.vwr.slm.noneSelected=Boolean.$valueOf(4==this.slen&&1073742333==this.tokAt(2))))}},"~N");f(d,"cmdSelectionHalos",function(a){var b=!1;switch(a==this.slen?1073742335:this.getToken(a).tok){case 1073742335:case 1113589787:b=
!0;case 1073742334:case 1073742333:case 1073742056:this.setBooleanProperty("selectionHalos",b);break;default:this.invArg()}},"~N");f(d,"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,e=0,g,d=2147483647,f=!this.chk&&this.doReport()&&!this.st[0].value.equals("var");
switch(c){case 553648144:case 603979866:case 603979903:case 603979924:case 603979960:case 603979962:case 603979964:case 603979965:case 603979970:if(this.$isStateScript)return;break;case 1611272194:this.cmdAxes(2);return;case 1610616835:this.cmdBackground(2);return;case 1812599299:this.cmdBoundbox(2);return;case 1611272202:this.cmdFrank(2);return;case 1610616855:this.cmdHistory(2);return;case 1825200146:this.cmdLabel(2,null);return;case 1814695966:this.cmdUnitcell(2);return;case 536870920:this.sm.loadShape(8);
this.setShapeProperty(8,"highlight",1073742334==this.tokAt(2)?null:this.atomExpressionAt(2));return;case 1610625028:case 1611141172:this.cmdSelectionHalos(2);return;case 536875070:this.cmdTimeout(2);return;case 536870932:c=this.isArrayParameter(2)?this.floatParameterSet(2,2,2):2==this.tokAt(2)?S(-1,[this.intParameter(2),this.intParameter(3)]):this.stringParameter(2);this.checkLast(this.iToken);if(this.chk)return;if("string"==typeof c){if(this.vwr.fm.loadImage(c,"\x00windowImage",!this.useThreads()))throw new JS.ScriptInterruption(this,
"windowImage",1);}else this.vwr.setWindowDimensions(c);return;case 1639976963:c=J.c.STR.getProteinStructureType(this.paramAsStr(2));c===J.c.STR.NOT&&this.invArg();f=this.floatParameterSet(3,0,2147483647);0!=f.length%4&&this.invArg();this.vwr.setStructureList(f,c);this.checkLast(this.iToken);return;case 545259526:d=this.getArgbParam(2);this.chk||this.setObjectArgb("axes",d);return;case 1610612737:c=!1;switch(this.getToken(this.checkLast(2)).tok){case 268438528:break;case 268438016:c=!0;break;default:this.invArg()}this.setBooleanProperty("bondModeOr",
c);return;case 536870916:case 536870917:if(this.chk)return;c=1073742334==this.tokAt(2)||2==this.tokAt(2)&&0==this.intParameter(2)?4:536870917==c?6:5;JU.Logger.setLogLevel(c);this.setIntProperty("logLevel",c);4==c&&(this.vwr.setDebugScript(!1),f&&this.vwr.showParameter("debugScript",!0,80));this.setDebugging();f&&this.vwr.showParameter("logLevel",!0,80);return;case 537022465:this.cmdSetEcho(0);return;case 536875059:this.cmdScale(2);return;case 1610612738:this.cmdFont(5,2==this.checkLength23()?0:this.floatParameter(2));
return;case 1613238294:c=!1;switch(this.tokAt(this.checkLast(2))){case 1114249217:c=!0;case 2097178:this.setBooleanProperty("hbondsBackbone",c);break;case 1073742150:c=!0;case 1073741926:this.setBooleanProperty("hbondsSolid",c);break;default:this.invArg()}return;case 1745489939:case 537006096:switch(c=this.tokAt(this.checkLast(2))){case 1073742335:case 1073742334:this.setBooleanProperty("measurementlabels",1073742335==c);return;case 1073741926:case 2:case 3:this.vwr.shm.loadShape(6);f=this.getSetAxesTypeMad10(2);
2147483647!=f&&this.setShapeSizeBs(6,3==c?T(f/10):f,null);return}this.setUnits(this.paramAsStr(2),545259568);return;case 1611141176:c=!1;switch(this.tokAt(this.checkLast(2))){case 1114249217:c=!0;break;case 2097178:break;default:this.invArg()}this.setBooleanProperty("ssbondsBackbone",c);return;case 1610612741:this.cmdSetLabel("toggle");return;case 536870930:c=new JU.Lst;for(a=2;a<this.slen;a++)f=this.getArgbParam(a),c.addLast(Integer.$valueOf(f)),a=this.iToken;if(this.chk)return;a=c.size();for(f=
K(a,0);0<=--a;)f[a]=c.get(a).intValue();this.vwr.cm.ce.setUserScale(f);return;case 553648188:this.isFloatParameter(2)?(this.checkLength(3),this.setIntProperty("zSlab",F(this.floatParameter(2))),g=null):(this.isCenterParameter(2)||this.invArg(),g=this.centerParameter(2,null),this.checkLength(this.iToken+1));this.chk||(this.vwr.tm.zSlabPoint=null==g?null:JU.P3.newP(g));return}var j=!0;switch(c){case 536870914:if(2<this.slen){f=this.getSettingStr(2,!1);c=!1;0>f.indexOf(".")?(f=JU.PT.parseInt(f),c=!0):
f=JU.Edge.getFloatEncodedInt(f);if(this.chk)return;c=this.vwr.ms.getModelNumberIndex(f,c,!0);this.vwr.setBackgroundModelIndex(c);return}break;case 1648363544:if(this.chk)return;this.vwr.setAtomProperty(this.vwr.getAllAtoms(),1648363544,-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}e=545259555;case 545259555:2<this.slen&&(g=this.paramAsStr(2),3==this.slen&&(null==J.c.VDW.getVdwType(g)&&null==J.c.VDW.getVdwType(g=this.getSettingStr(2,!1)))&&this.invArg(),this.setStringProperty(b,g));break;case 536870918:if(2<this.slen){var l=this.parameterExpressionToken(2);8==l.tok?g=l.value:(g=new JU.P3,l=l.asInt(),100<=l&&JU.SimpleUnitCell.ijkToPoint3f(l,g,-1,0));this.chk||this.vwr.setDefaultLattice(g)}break;case 545259552:case 545259545:2<this.slen&&(g=1073741991==(this.theTok=this.tokAt(2))||
1073742116==this.theTok?this.paramAsStr(this.checkLast(2)):this.getSettingStr(2,!1),this.setStringProperty(b,g));break;case 1631586315:d=this.getSettingInt(2);-2147483648==d&&this.invArg();this.chk||this.vwr.ms.setFormalCharges(this.vwr.bsA(),d);return;case 545259563:2<this.slen&&this.setStringProperty(b,this.getSettingStr(2,a));break;case 545259568:case 545259558:2<this.slen&&this.setUnits(this.getSettingStr(2,a),c);break;case 545259573:this.chk||this.vwr.setPicked(-1,!1);if(2<this.slen){this.cmdSetPicking();
return}break;case 545259574:if(2<this.slen){this.cmdSetPickingStyle();return}break;case 1715472409:break;case 536870924:d=this.getSettingInt(2);if(-2147483648==d||0==d||1==d){j=!1;break}c=553648174;b="specularPercent";this.setIntProperty(b,d);break;case 1649022989:c=553648178;b="strandCount";this.setIntProperty(b,this.getSettingInt(2));break;default:j=!1}if(!j||f){l=!j&&!a&&null!=this.getContextVariableAsVariable(b,!1);if(!j&&!l)switch(c){case 1677721602:e=603979928;break;case 1612709894:e=603979908;
break;case 1612709900:e=603979910;break;case 1610612739:e=603979878;break;case 1665140738:e=570425394;this.setFloatProperty("solventProbeRadius",this.getSettingFloat(2));j=!0;break;case 1610612740:e=570425390;break;case 1612709912:e=603979948;break;case 1765808134:e=545259545;break;case 1611141175:g=this.paramAsStr(2).toLowerCase();switch("x;y;z;fps;".indexOf(g+";")){case 0:e=570425398;break;case 2:e=570425400;break;case 4:e=570425402;break;case 6:e=570425396;break;default:this.errorStr2(50,"set SPIN ",
g)}this.chk||this.vwr.setSpin(g,F(this.floatParameter(this.checkLast(3))));j=!0}if(0!=e)b=JS.T.nameOf(c=e);else if(!j&&!l){(0==b.length||"_"==b.charAt(0)&&268437504!=this.tokAt(2))&&this.error(56);e=b.toLowerCase();if(0==e.indexOf("label")&&JU.PT.isOneOf(e.substring(5),";front;group;atom;offset;offsetexact;offsetabsolute;pointer;alignment;toggle;scalereference;for;")&&this.cmdSetLabel(e.substring(5)))return;if(a&&0==e.indexOf("shift_")){c=this.floatParameter(2);this.checkLength(3);this.chk||this.vwr.getNMRCalculation().setChemicalShiftReference(e.substring(6),
c);return}e.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(!j&&a)switch(this.slen){case 2:this.setBooleanProperty(b,!0);j=!0;break;case 3:2147483647!=d&&(this.setIntProperty(b,d),j=!0)}!j&&(!a&&1073742333==this.tokAt(2))&&(this.chk||this.vwr.removeUserVariable(b.toLowerCase()),j=!0);if(!j&&(this.setVariable(1,0,b,!0),!a))return;f&&this.vwr.showParameter(b,!0,80)}}}});f(d,"cmdScale",function(a){if(!this.chk){var b=
"%SCALE";switch(this.tokAt(a)){case 1073742334:this.setShapeProperty(31,"%SCALE",null);this.checkLast(a);return;case 1073742335:a++;break;default:var c=JM.Measurement.fixUnits(this.optParameterAsString(a));0!=JM.Measurement.fromUnits(1,c)?(b+=" "+c,a++):b=null}this.setShapeProperty(31,"thisID","%SCALE");0==this.tokAt(a)?(this.vwr.ms.setEchoStateActive(!0),this.vwr.shm.loadShape(31),this.setShapeProperty(31,"target","bottom")):(this.setShapeProperty(31,"target","%SCALE"),this.cmdSetEcho(a));null!=
b&&this.setShapeProperty(31,"text",b);this.setShapeProperty(31,"thisID",null);this.refresh(!1)}},"~N");f(d,"cmdSetEcho",function(a){var b=null,c=null,e=null,g=!0,d=0<a;a=0==a?2:a;switch(d?0:this.getToken(a).tok){case 1073742334:e=b="allOff";this.checkLength(++a);break;case 1073742333:g=!1;case 1073742327:e=this.paramAsStr(2),this.checkLength(++a)}switch(d?this.tokAt(2):this.getToken(2).tok){case 1073741974:a++;case 1073741996:case 12289:case 1073742126:case 1073742172:case 1073742019:case 1073741871:case 1073741824:case 4:e=
this.paramAsStr(a++)}this.chk||(this.vwr.ms.setEchoStateActive(g),this.sm.loadShape(31),null!=e&&(null==b&&!d&&this.setShapeProperty(31,"thisID",null),this.setShapeProperty(31,null==b?"target":b,e)));if(a<this.slen){if(d)switch(this.tokAt(a)){case 536875059:case 4120:case 4:this.invArg()}switch(this.getToken(a++).tok){case 1073741832:b="align";switch(this.getToken(a).tok){case 1073741996:case 1073742126:case 12289:c=this.paramAsStr(a++);break;default:this.invArg()}break;case 12289:case 1073741996:case 1073742126:b=
"align";c=this.paramAsStr(a-1);break;case 554176526:b="%zpos";c=Integer.$valueOf(F(this.floatParameter(a++)));break;case 1610625028:case 2097192:case 1073742335:b="hidden";c=Boolean.FALSE;break;case 12294:case 2097194:b="hidden";c=Boolean.TRUE;break;case 1094717454:c=this.chk?0:this.modelNumberParameter(a++);c>=this.vwr.ms.mc&&this.invArg();b="model";c=Integer.$valueOf(c);break;case 268437504:case 1073742195:b="xypos";c=this.xypParameter(--a);null==c&&this.invArg();a=this.iToken+1;break;case 2:e=
this.intParameter(a-1);g="xpos";268441090==this.tokAt(a)&&(g="%xpos",a++);b="ypos";c=Integer.$valueOf(this.intParameter(a++));268441090==this.tokAt(a)&&(b="%ypos",a++);this.checkLength(a);this.setShapeProperty(31,g,Integer.$valueOf(e));break;case 1073742066:b="offset";this.isPoint3f(a)?(a=this.getPoint3f(a,!1,!0),c=S(-1,[-1,a.x,a.y,a.z,0,0,0]),a=this.iToken+1):this.isArrayParameter(a)?(c=this.floatParameterSet(a,7,7),a=this.iToken+1):1073742333==this.tokAt(a)&&a++;break;case 1073742334:b="off";break;
case 536875059:b="scale";c=Float.$valueOf(this.floatParameter(a++));break;case 134222850:b="script";c=this.paramAsStr(a++);break;case 4120:a++;case 4:b=4!=this.theTok;this.checkLength(a--);if(b){null==e&&(b=Array(1),this.getShapePropertyData(31,"currentTarget",b),e=b[0]);if(!this.chk&&this.vwr.ms.getEchoStateActive()&&this.vwr.fm.loadImage(this.getToken(a).value,e,!this.useThreads()))throw new JS.ScriptInterruption(this,"setEchoImage",1);return}this.cmdEcho(a);return;case 134217751:b="point";c=this.isCenterParameter(a)?
this.centerParameter(a,null):null;a=this.iToken+1;break;default:if(this.isCenterParameter(a-1)){b="xyz";c=this.centerParameter(a-1,null);a=this.iToken+1;break}this.invArg()}}this.checkLength(a);!this.chk&&null!=b&&this.setShapeProperty(31,b,c)},"~N");f(d,"cmdSetLabel",function(a){this.sm.loadShape(5);var b=null;for(this.setShapeProperty(5,"setDefaults",this.vwr.slm.noneSelected);;){if(a.equals("for")){var c=this.atomExpressionAt(2);this.cmdLabel(this.iToken+1,c);return!0}if(a.equals("scalereference")){c=
this.floatParameter(2);5<=c&&(c=this.vwr.tm.getZoomSetting()/c/this.vwr.getScalePixelsPerAngstrom(!1));b=Float.$valueOf(c);break}c=!1;if(a.equals("offset")||(c=a.equals("offsetabsolute")||a.equals("offsetexact"))){a="offset";if(this.isPoint3f(2))c=this.getPoint3f(2,!1,!0),b=S(-1,[-1,c.x,c.y,c.z,0,0,0]);else if(this.isArrayParameter(2))b=this.floatParameterSet(2,7,7);else{var b=this.intParameterRange(2,-500,500),e=this.intParameterRange(3,-500,500);if(2147483647==b||2147483647==e)return!0;b=Integer.$valueOf(JV.JC.getOffset(b,
e,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")){c=0;switch(this.getToken(2).tok){case 1073742334:case 1073742333:break;case 1610616835:c|=2;case 1073742335:c|=1;break;default:this.invArg()}b=Integer.$valueOf(c);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;c=2==this.slen||1073742335==this.getToken(2).tok;if(a.equals("front")||a.equals("group")){!c&&1073742334!=this.tokAt(2)&&this.invArg();c||(a="front");b=c?Boolean.TRUE:Boolean.FALSE;break}if(a.equals("atom")){!c&&1073742334!=this.tokAt(2)&&this.invArg();a="front";b=c?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");f(d,"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 1275082241:case 1745489939: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 1073742335:case 1073742056:c="identify";break;case 1073742334:case 1073742333:c="off";break;case 1275082241:c="atom";break;case 1825200146:c="label";break;case 1677721602:c="bond";break;case 12291:this.checkLength(4),1677721602!=this.tokAt(3)&&this.invArg(),c="deleteBond"}var e=0<=(e=c.indexOf("_"))?e:c.length,e=JV.ActionManager.getPickingMode(c.substring(0,e));
0>e&&this.errorStr2(50,"SET PICKING "+b,c);this.setStringProperty("picking",c)}});f(d,"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 1745489939:b=!0,c="MEASURE";case 1275082241:4==this.checkLength34()&&(a=3);break;default:this.checkLength(3)}var e=this.paramAsStr(a);switch(this.getToken(a).tok){case 1073742333:case 1073742334:e=b?"measureoff":"toggle";break;
case 1073742335:b&&(e="measure")}0>JV.ActionManager.getPickingStyleIndex(e)&&this.errorStr2(50,"SET PICKINGSTYLE "+c,e);this.setStringProperty("pickingStyle",e)}});f(d,"cmdSlab",function(a){var b=!1,c=null;if(this.isCenterParameter(1)||9==this.tokAt(1))c=this.planeParameter(1,!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 1073742335:b=!0;case 1073742334: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 36867:this.checkLength(2);this.chk||this.vwr.tm.setSlabDepthInternal(a);return;case 268440576:b=this.paramAsStr(2);b.equalsIgnoreCase("hkl")?c=this.hklParameter(3,null,!0):b.equalsIgnoreCase("plane")&&(c=this.planeParameter(2,!1));null==c&&this.invArg();c.scale4(-1);break;case 134217750:switch(this.getToken(2).tok){case 1073742333:break;default:c=this.planeParameter(1,
!1)}break;case 134219777:c=1073742333==this.getToken(2).tok?null:this.hklParameter(2,null,!0);break;case 1073742118:return;default:this.invArg()}this.chk||this.vwr.tm.slabInternal(c,a)},"~B");f(d,"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)))});f(d,"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 12290:case 10:case 1073742325:b=this.atomExpressionAt(2);this.checkLast(this.iToken);break;default:this.checkLength(2)}this.chk||(this.clearDefinedVariableAtomSets(),this.vwr.setProteinType(a,b))});f(d,"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)});f(d,"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)});f(d,"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),!1),new JS.ScriptInterruption(this,
b,-2147483648);this.evalError(b,null)}});f(d,"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");f(d,"cmdTimeout",function(a){var b=null,c=null,e=0;if(this.slen==a)this.showString(this.vwr.showTimeout(null));else{for(;a<this.slen;a++)switch(this.getToken(a).tok){case 1073741974:b=this.paramAsStr(++a);if(3==this.slen){this.chk||this.vwr.triggerTimeout(b);return}break;case 1073742334:break;case 2:e=
this.intParameter(a);break;case 3:e=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,e,c)}},"~N");f(d,"cmdTranslate",function(a){var b=null,c=1,b=0;1113589787==this.tokAt(1)&&(a=!0,b=1,c=2);if(this.isPoint3f(c))a=this.getPoint3f(c,!0,!0),b=this.iToken+1<this.slen?this.atomExpressionAt(++this.iToken):null,this.checkLast(this.iToken),this.chk||this.vwr.setAtomCoordsRelative(a,b);else{var e=(this.paramAsStr(c).toLowerCase()+
" ").charAt(0);0>"xyz".indexOf(e)&&this.error(0);var g=this.floatParameter(++c);switch(this.tokAt(++c)){case 0:case 12290:case 10:case 1073742325:c="\x00";break;default:c=(this.optParameterAsString(c).toLowerCase()+"\x00").charAt(0)}0==g&&"\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(e,g,c,b),this.refresh(!1)))}},"~B");f(d,"cmdUnbind",function(){1!=this.slen&&
this.checkLength23();var a=this.optParameterAsString(1),b=this.optParameterAsString(2);if(0==a.length||1073742327==this.tokAt(1))a=null;if(0==b.length||1073742327==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)});f(d,"cmdUndoRedo",function(a){var b=1,c=2;switch(a){case 603984065:case 4139:a=this.vwr.stm.getUndoRedoState(a);null!=a&&this.runScript(a);return}switch(this.tokAt(1)){case 0:c=1;break;case 1073742327:b=
0;break;case 2:b=this.intParameter(1);break;default:this.invArg()}this.checkLength(c);this.chk||this.vwr.undoMoveAction(a,b)},"~N");f(d,"cmdUnitcell",function(a){this.getCmdExt().dispatch(1814695966,2==a,null)},"~N");f(d,"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 1073742335:break;case 1073742334: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 1112152078:this.setIntProperty("vectorTrace",this.intParameterRange(2,0,20));return;case 536875059: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))});f(d,"cmdVibration",function(){this.checkLength(-3);var a=0;switch(this.getToken(1).tok){case 1073742335:this.checkLength(2);a=this.vwr.getFloat(570425412);break;case 1073742334:this.checkLength(2);a=0;break;case 2:case 3:this.checkLength(2);a=this.floatParameter(1);break;case 536875059: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))});f(d,"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))});f(d,"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&&1073742359==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),!1);this.vwr.selectStatus(null,!1,0,b,!1)}},"~B");f(d,"cmdZoom",function(a){if(!a){var b=1<this.slen?
this.getToken(1).tok:1073742335;switch(b){case 1073742335:case 1073742334:2<this.slen&&this.bad();this.chk||this.setBooleanProperty("zoomEnabled",1073742335==b);return}}var c=null,e=1,b=a?this.isFloatParameter(e)?this.floatParameter(e++):1:0;0>b&&(e--,b=0);var g=0,d=null;if(1814695966==this.tokAt(e)||this.isCenterParameter(e)){var g=e,f=Array(1),c=this.centerParameter(e,f);u(f[0],"JU.BS")&&(d=f[0]);e=this.iToken+1}else 2==this.tokAt(e)&&0==this.getToken(e).intValue&&(d=this.vwr.getAtomBitSet("visible"),
c=this.vwr.ms.getAtomSetCenter(d));var f=this.vwr.tm.getZoomSetting(),d=this.getZoom(g,e,d,f),e=this.iToken+1,j=f=NaN;e!=this.slen&&(f=this.floatParameter(e++),j=this.floatParameter(e++));e!=this.slen&&this.invArg();0>d&&(d=-d,a&&(1==this.slen?d*=2:null==c&&(d/=2)));(5>d||2E5<d)&&this.numberOutOfRange(5,2E5);this.vwr.tm.isWindowCentered()||(null!=c&&(a=this.atomExpressionAt(g),this.chk||this.vwr.setCenterBitSet(a,!1)),c=this.vwr.tm.fixedRotationCenter,Float.isNaN(f)&&(f=this.vwr.tm.getTranslationXPercent()),
Float.isNaN(j)&&(j=this.vwr.tm.getTranslationYPercent()));if(!this.chk&&(Float.isNaN(f)&&(f=0),Float.isNaN(j)&&(j=0),this.useThreads()||(b=0),this.vwr.moveTo(this,b,c,JV.JC.center,NaN,null,d,f,j,NaN,null,NaN,NaN,NaN,NaN,NaN,NaN),this.isJS&&0<b&&this.vwr.g.waitForMoveTo))throw new JS.ScriptInterruption(this,"zoomTo",1);},"~B");f(d,"colorShape",function(a,b,c){var e=536875059==Math.abs(a);e?a=31:0>a&&(a=this.getShapeType(-a));var g=null,d=null,f=null,j=null,l=2==b&&1073741859==this.tokAt(1)?"ball":
"",r=24==a||25==a,m=!1,k=3.4028235E38;0>b&&(j=this.atomExpressionAt(-b),b=this.iToken+1,this.isBondSet&&(m=!0,a=1));var p=this.getToken(b).tok;c?this.getToken(b):!0==(c=1610616835==p)&&this.getToken(++b);if(c)l="bg";else if(r)switch(this.theTok){case 1073742018:this.getToken(++b);l="mesh";break;case 1073742094:b=this.getArgbParamOrNone(++b,!1);f=0==b?null:Integer.$valueOf(b);this.getToken(b=this.iToken+1);break;case 12290:case 10:case 1073742325:u(this.theToken.value,"JM.BondSet")?(j=this.theToken.value,
l="vertex"):(j=this.atomExpressionAt(b),l="atom"),this.getToken(b=this.iToken+1)}if(this.chk||!((27==a||28==a)&&null!=this.getIsoExt().dispatch(a,!0,this.st))){var q=603979967==this.theTok;if(q||1073742074==this.theTok)1.4E-45==k&&this.invArg(),g=this.paramAsStr(b++),q&&this.isFloatParameter(b)&&(k=this.getTranslucentLevel(b++));p=0;if(c=b<this.slen&&1073742335!=this.tokAt(b)&&1073742334!=this.tokAt(b))if(p=this.getToken(b).tok,(!r||1073742170!=this.tokAt(b+1))&&this.isColorParam(b)){b=this.getArgbParamOrNone(b,
!1);d=0==b?null:Integer.$valueOf(b);if(0!=this.tokAt(b=this.iToken+1)&&null==g)if(this.getToken(b),(q=603979967==this.theTok)||1073742074==this.theTok)g=this.paramAsStr(b++),q&&this.isFloatParameter(b)&&(k=this.getTranslucentLevel(b++));this.isColorParam(b)&&(b=this.getArgbParamOrNone(b,!1),f=0==b?null:Integer.$valueOf(b),b=this.iToken+1);this.checkLength(b)}else if(26==a)this.iToken--;else{var s=this.paramAsStr(b).toLowerCase(),B=0==s.indexOf("byelement"),E=B||0==s.indexOf("byresidue"),d=E||r?J.c.PAL.PROPERTY:
1112152075==p?J.c.PAL.CPK:J.c.PAL.getPalette(s);(d===J.c.PAL.UNKNOWN||(d===J.c.PAL.TYPE||d===J.c.PAL.ENERGY)&&2!=a)&&this.invArg();var y=null,x=d!==J.c.PAL.PROPERTY&&d!==J.c.PAL.VARIABLE||!this.vwr.g.rangeSelected?null:this.vwr.bsA();d===J.c.PAL.PROPERTY?E?this.chk||(y=this.getCmdExt().getBitsetPropertyFloat(x,(B?1094715402:1094713356)|256,null,NaN,NaN)):(B=s.equals("property"))&&JS.T.tokAttr(p=this.getToken(++b).tok,1077936128)&&(1086324754==p||!JS.T.tokAttr(p,1086324736))?(p=this.getToken(b).tok,
B=1111490587==p?this.getToken(++b).value.toString():1086324754==p?"color":null,this.chk||(y=this.getCmdExt().getBitsetPropertyFloat(x,p|256,B,NaN,NaN)),b++):!B&&!r&&b++:d===J.c.PAL.VARIABLE&&(b++,s=this.paramAsStr(b++),y=S(this.vwr.ms.ac,0),JU.Parser.parseStringInfestedFloatArray(""+this.getParameter(s,4,!0),null,y),d=J.c.PAL.PROPERTY);if(d===J.c.PAL.PROPERTY){B=null;4==this.tokAt(b)?(B=this.paramAsStr(b++),0>B.indexOf("/")&&(B=B.toLowerCase()),this.isArrayParameter(b)&&(B+="="+JS.SV.sValue(JS.SV.getVariableAS(this.stringParameterSet(b))).$replace("\n",
" "),b=this.iToken+1)):r&&this.isColorParam(b)&&(B=this.getColorRange(b),b=this.iToken+1);null!=B&&!r&&(this.setStringProperty("propertyColorScheme",(q&&3.4028235E38==k?"translucent ":"")+B),E=0==B.indexOf("byelement")||0==B.indexOf("byresidue"));var v=0,w=3.4028235E38;if(!E&&(1073741826==this.tokAt(b)||1073742114==this.tokAt(b)))v=this.floatParameter(b+1),w=this.floatParameter(b+2),b+=3,v==w&&r?(E=this.getShapeProperty(a,"dataRange"),null!=E&&(v=E[0],w=E[1])):v==w&&(w=3.4028235E38);r||(null==y?this.chk||
this.vwr.setCurrentColorRange(s):this.chk||this.vwr.cm.setPropertyColorRangeData(y,x));if(r){this.checkLength(b);if(this.chk)return;c=!1;s=null==B?this.getShapeProperty(a,"colorEncoder"):null;if(null==s&&null==(s=this.vwr.cm.getColorEncoder(B)))return;s.isTranslucent=q&&3.4028235E38==k;s.setRange(v,w,v>w);3.4028235E38==w&&(s.hi=w);this.setShapeProperty(a,"remapColor",s);this.showString(this.getShapeProperty(a,"dataRangeStr").$replace("\n"," "));if(3.4028235E38==k)return}else 3.4028235E38!=w&&this.vwr.cm.setPropertyColorRange(v,
w)}else b++;this.checkLength(b)}if(!(this.chk||0>a)){e&&this.setShapeProperty(31,"target","%SCALE");switch(a){case 4:b=32768;break;case 2:b=30720;break;case 3:b=256;break;case 1:b=1023;break;default:b=0}0==b?(this.sm.loadShape(a),5==a&&this.setShapeProperty(5,"setDefaults",this.vwr.slm.noneSelected)):(null!=j&&(this.vwr.selectBonds(j),j=null),a=1,this.setShapeProperty(a,"type",Integer.$valueOf(b)));if(c){switch(p){case 1111492619:this.getPartialCharges(j);break;case 1111490575:case 1111490574:this.vwr.autoCalculate(p,
null);break;case 1111492620:this.vwr.g.rangeSelected&&this.vwr.ms.clearBfactorRange();break;case 1086324742:this.vwr.ms.calcSelectedGroupsCount();break;case 1094713362:case 1094713361:this.vwr.ms.calcSelectedMonomersCount();break;case 1094713360:this.vwr.ms.calcSelectedMoleculesCount()}null!=f&&(r||11==a||14==a||21==a)?this.setShapeProperty(a,"colorPhase",P(-1,[f,d])):null==j?this.setShapeProperty(a,l+"color",d):this.setShapePropertyBs(a,l+"color",d,j)}null!=g&&this.setShapeTranslucency(a,l,g,k,j);
e&&this.setShapeProperty(31,"thisID",null);0!=b&&this.setShapeProperty(1,"type",Integer.$valueOf(1023));m&&this.vwr.selectBonds(null);0==a&&this.vwr.shm.checkInheritedShapes()}}},"~N,~N,~B");f(d,"getPartialCharges",function(a){try{this.vwr.getOrCalcPartialCharges(a,null)}catch(b){if(D(b,Exception))throw new JS.ScriptInterruption(this,"partialcharge",1);throw b;}},"JU.BS");f(d,"encodeRadiusParameter",function(a,b,c){var e=NaN,g=J.atomdata.RadiusData.EnumType.ABSOLUTE,d=null,f=-1==a?1648363544:this.getToken(a).tok;
switch(f){case 1111490561:case 1111490562:case 1111492618:case 1113589786:case 1111492620:case 1648363544:e=1,g=J.atomdata.RadiusData.EnumType.FACTOR,d=1648363544==f?null:J.c.VDW.getVdwType2(JS.T.nameOf(f)),f=this.tokAt(++a)}switch(f){case 4141:return this.vwr.rd;case 1073741852:case 1073742116:case 1073741856:case 1073741857:case 1073741991:e=1;g=J.atomdata.RadiusData.EnumType.FACTOR;this.iToken=a-1;break;case 268440577:case 2:case 3:if(268440577==f)a++;else if(268441090==this.tokAt(a+1)){e=Math.round(this.floatParameter(a));
this.iToken=++a;g=J.atomdata.RadiusData.EnumType.FACTOR;if(200<Math.abs(e))return this.integerOutOfRange(0,200),null;b&&(e=-e);e/=100;break}else if(2==f){e=this.intParameter(a);if(749<e||-200>e)return this.integerOutOfRange(-200,749),null;0<e?(e/=250,g=J.atomdata.RadiusData.EnumType.ABSOLUTE):(e/=-100,g=J.atomdata.RadiusData.EnumType.FACTOR);break}268440577==f||!c?(g=J.atomdata.RadiusData.EnumType.OFFSET,e=16):(g=J.atomdata.RadiusData.EnumType.ABSOLUTE,d=J.c.VDW.NADA,e=100);e=this.floatParameterRange(a,
b||!c?-e:0,e);if(Float.isNaN(e))return null;b&&(e=-e);16<e&&(e=16.1);break;default:1==e&&a--}null==d&&(d=J.c.VDW.getVdwType(this.optParameterAsString(++this.iToken)),null==d&&(this.iToken=a,d=J.c.VDW.AUTO));return new J.atomdata.RadiusData(null,e,g,d)},"~N,~B,~B");f(d,"expandFloatArray",function(a,b,c){var e=a.length,g=!1,d=c?new JU.BS:null;try{for(var f=0;f<a.length;f++)0>a[f]&&(e+=Math.abs(a[f-1]+a[f])-1,g=!0);if(g){for(var j=c?null:S(e,0),f=g=0;f<a.length;f++)if(e=F(a[f]),0<=e)e<b&&this.invArg(),
c?d.set(e-1):j[g++]=e;else for(var l=F(a[f-1]),r=l<=-e?1:-1,m=-e;l!=m;l+=r,g++)c?d.set(l):j[g]=l+r;a=j;c||(e=a.length)}if(c){for(f=e;0<=--f;)d.set(F(a[f])-1);return d}for(var k=K(e,0),f=e;0<=--f;)k[f]=F(a[f]);return k}catch(p){if(D(p,Exception))return this.invArg(),null;throw p;}},"~A,~N,~B");f(d,"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");f(d,"getColorRange",function(a){a=this.getArgbParam(a);1073742170!=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");f(d,"getFullPathName",function(a){var b=!this.chk||this.isCmdLine_C_Option?this.vwr.fm.getFullPathName(!0):"test.xyz";null==b&&this.invArg();
a&&(!"string".equals(b)&&!"zapped".equals(b))&&(a=this.vwr.fm.getFileType(),null!=a&&0<a.length&&(b=a+"::"+b));return b},"~B");f(d,"getObjectBoundingBox",function(a){a=P(-1,[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");f(d,"getObjectCenter",function(a,b,c){a=
P(-1,[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");f(d,"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");f(d,"getQuaternionArray",function(a,b){var c;switch(b){case 134221850:c=a;break;case 9:c=Array(a.length);for(var e=0;e<a.length;e++)c[e]=JU.Quat.newP4(a[e]);break;case 1073742001:c=Array(a.size());for(e=0;e<a.size();e++){var g=JS.SV.pt4Value(a.get(e));
if(null==g)return null;c[e]=JU.Quat.newP4(g)}break;default:return null}return c},"~O,~N");f(d,"getSetAxesTypeMad10",function(a){if(a==this.slen)return 1;switch(this.getToken(this.checkLast(a)).tok){case 1073742335:return 1;case 1073742334: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:T(Math.floor(2E4*a))}this.chk||this.errorStr(7,'"DOTTED"');return 0},"~N");f(d,"getSettingFloat",function(a){return a>=
this.slen?NaN:JS.SV.fValue(this.parameterExpressionToken(a))},"~N");f(d,"getSettingInt",function(a){return a>=this.slen?-2147483648:this.parameterExpressionToken(a).asInt()},"~N");f(d,"getSettingStr",function(a,b){return b&&this.slen==a+1?this.paramAsStr(a):this.parameterExpressionToken(a).asString()},"~N,~B");f(d,"getShapeProperty",function(a,b){return this.sm.getShapePropertyIndex(a,b,-2147483648)},"~N,~S");f(d,"getShapePropertyData",function(a,b,c){return this.sm.getShapePropertyData(a,b,c)},"~N,~S,~A");
f(d,"getShapeType",function(a){a=JV.JC.shapeTokenIndex(a);0>a&&this.error(49);return a},"~N");f(d,"getTranslucentLevel",function(a){a=this.floatParameter(a);return 2==this.theTok&&0<a&&9>a?a+1:a},"~N");f(d,"getZoom",function(a,b,c,e){var g=this.isFloatParameter(b)?this.floatParameter(b++):NaN;if(0==g||0==e){e=NaN;if(null==c)switch(this.tokAt(a)){case 1814695966:g=this.vwr.getCurrentUnitCell();null==g&&this.invArg();e=g.getUnitCellVerticesNoOffset();g=g.getCartesianOffset();a=new JU.P3;for(var d=new JU.BoxInfo,
f=0;8>f;f++)a.add2(g,e[f]),d.addBoundBoxPoint(a);d.setBbcage(1);e=d.bbCorner0.distance(d.bbCorner1)/2;0==e&&this.invArg();break;case 1073742330:g=this.getObjectBoundingBox(this.objectNameParameter(a+1)),(null==g||0==(e=g[0].distance(g[1])/2))&&this.invArg()}else e=this.vwr.ms.calcRotationRadiusBs(c);Float.isNaN(e)&&this.invArg();e=100*(this.vwr.getFloat(570425388)/e);g=NaN}if(0>g)g+=e;else if(Float.isNaN(g))switch(a=this.tokAt(b),a){case 1073742079:case 1275068432:g=e*(1073742079==a?0.5:2);b++;break;
case 268441088:case 268441089:case 268440577:c=this.floatParameter(++b);b++;switch(a){case 268441088:g=e/c;break;case 268441089:g=e*c;break;case 268440577:g=e+c}break;default:g=null==c?-e:e}this.iToken=b-1;return g},"~N,~N,JU.BS,~N");f(d,"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");f(d,"setMeshDisplayProperty",function(a,b,c){var e=null,g=null,d=25==a,f=0==b;f||(c=this.getToken(b).tok);switch(c){case 1765808134:if(d)this.iToken++;else break;case 1073742074:case 603979967:return f||this.colorShape(a,this.iToken,!1),!0;case 0:case 12291:case 1073742335:case 1073742334:case 12294:case 2097194:case 1610625028:case 2097192:1==this.iToken&&(0<=a&&0==this.tokAt(2))&&this.setShapeProperty(a,"thisID",null);if(0==c)return 1==this.iToken;if(f)return!0;switch(c){case 12291:return this.setShapeProperty(a,
"delete",null),!0;case 2097194:case 12294:c=1073742334;break;case 2097192:c=1073742335;break;case 1610625028:b+1==this.slen&&(c=1073742335);break}case 1073741958:case 1073741861:case 1073741964:case 1073741898:case 1073742039:case 1112150019:case 1073742042:case 1073742018:case 1073742052:case 1073741938:case 1073742046:case 1073741862:case 1073742057:case 1073742182:case 1073742060:case 1073741960:case 1073742058:e="token",g=Integer.$valueOf(c)}if(null==e)return!1;if(f)return!0;this.setShapeProperty(a,
e,g);0!=this.tokAt(this.iToken+1)&&(this.setMeshDisplayProperty(a,++this.iToken,0)||--this.iToken);return!0},"~N,~N,~N");f(d,"setObjectArgb",function(a,b){this.chk||this.vwr.setObjectArgb(a,b)},"~S,~N");f(d,"setObjectMad10",function(a,b,c){this.chk||this.vwr.setObjectMad10(a,b,c)},"~N,~S,~N");f(d,"setObjectProp",function(a,b,c){for(var e=P(-1,[a,null]),g="",d=JU.PT.isWild(a),f=17;;){if(this.getShapePropertyData(f,"checkID",e)){this.setShapeProperty(f,"thisID",a);switch(b){case 12291:this.setShapeProperty(f,
"delete",null);break;case 12294:case 1610625028:this.setShapeProperty(f,"hidden",1610625028==b?Boolean.FALSE:Boolean.TRUE);break;case 134222350:g+=this.getShapeProperty(f,"command")+"\n";break;case 1765808134:0<=c&&this.colorShape(f,c+1,!1)}if(!d)break}switch(f){case 17:f=20;continue;case 20:f=32}switch(--f){case 27:f--;break;case 28:f-=2}if(21>f)break}return g},"~S,~N,~N");f(d,"setObjectProperty",function(){var a=this.setShapeNameParameter(2);return this.chk?"":this.setObjectProp(a,this.tokAt(0),
this.iToken)});f(d,"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 1073742335:case 1073742334:case 2097192:case 2097194:case 1765808134:case 12291:break;default:if(this.setMeshDisplayProperty(-1,0,this.tokAt(a+1)))break;b+=this.optParameterAsString(++a)}268441089==this.tokAt(a+1)&&(b+=this.paramAsStr(++a));this.iToken=a;return b},"~N");f(d,"setShapeProperty",function(a,b,c){this.chk||this.sm.setShapePropertyBs(a,
b,c,null)},"~N,~S,~O");f(d,"setShapePropertyBs",function(a,b,c,e){this.chk||this.sm.setShapePropertyBs(a,b,c,e)},"~N,~S,~O,JU.BS");f(d,"setShapeSize",function(a,b){this.chk||this.sm.setShapeSizeBs(a,0,b,null)},"~N,J.atomdata.RadiusData");f(d,"setShapeSizeBs",function(a,b,c){this.chk||this.sm.setShapeSizeBs(a,b,null,c)},"~N,~N,JU.BS");f(d,"setShapeTranslucency",function(a,b,c,e,g){3.4028235E38==e&&(e=this.vwr.getFloat(570425353));this.setShapeProperty(a,"translucentLevel",Float.$valueOf(e));null!=
b&&(null==g?this.setShapeProperty(a,b+"translucency",c):this.chk||this.setShapePropertyBs(a,b+"translucency",c,g))},"~N,~S,~S,~N,JU.BS");f(d,"setSize",function(a,b){var c=null,e=this.tokAt(1),g=!1;switch(e){case 1073742072:this.restrictSelected(!1,!1);case 1073742335:break;case 1073742334:b=0;break;case 3:case 2:g=0>this.floatParameter(1)&&(3==e||268441090==this.tokAt(2));default:c=this.encodeRadiusParameter(1,g,!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));g&&this.restrictSelected(!1,!1);this.setShapeSize(a,c)},"~N,~N");f(d,"setSizeBio",function(a){var b=0;switch(this.getToken(1).tok){case 1073742072:this.restrictSelected(!1,!1);case 1073742335:b=-1;break;case 1073742334:break;case 1639976963:b=-2;break;case 1111492620: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");f(d,"setUnits",function(a,b){545259568==b&&(a.toLowerCase().endsWith("hz")||JU.PT.isOneOf(a.toLowerCase(),";default;angstroms;au;bohr;nanometers;nm;picometers;pm;vanderwaals;vdw;"))?this.chk||this.vwr.setUnits(a,!0):545259558==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");f(d,"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],e=0;e<c.length;++e)a.appendO(c[e]),a.appendC("\n");a.appendC("\n")}a.append("END\n");return a.toString()});f(d,"getCurrentModelFileAsString",function(a){null==a&&(a=this.vwr.getParameter("_modelFile"));
return(""+a).equals("null")?this.vwr.ms.getInlineData(this.vwr.am.cmi):this.vwr.getFileAsString(a)},"~S");d.iProcess=0;d.commandHistoryLevelMax=0;d.contextDepthMax=100;d.scriptReportingLevel=0});L("JS");M(["JS.ScriptParam"],"JS.ScriptExpr","java.util.Hashtable JU.BS $.CU $.Lst $.Measure $.P3 $.PT $.SB J.api.Interface JM.AtomCollection $.BondSet $.Group $.ModelSet JS.SV $.ScriptMathProcessor $.T JU.BSUtil $.Edge $.Elements $.Escape".split(" "),function(){var d=Q(function(){this.debugHigh=!1;this.ptTemp=
this.tempStatement=this.smilesExt=this.mathExt=this.isoExt=this.cmdExt=this.privateFuncs=null;O(this,arguments)},JS,"ScriptExpr",JS.ScriptParam);f(d,"getCmdExt",function(){return null==this.cmdExt?this.cmdExt=this.getExt("Cmd").init(this):this.cmdExt});f(d,"getIsoExt",function(){return null==this.isoExt?this.isoExt=this.getExt("Iso").init(this):this.isoExt});f(d,"getMathExt",function(){return null==this.mathExt?(this.mathExt=this.getExt("Math")).init(this):this.mathExt});f(d,"getSmilesExt",function(){return null==
this.smilesExt?(this.smilesExt=this.getExt("Smiles")).init(this):this.smilesExt});f(d,"getExt",function(a){return J.api.Interface.getInterface("JS."+a+"Ext",this.vwr,"script")},"~S");f(d,"parameterExpressionList",function(a,b,c){return this.parameterExpression(a,-1,null,!0,!0,b,c,null,null,!1)},"~N,~N,~B");f(d,"parameterExpressionString",function(a,b){return this.parameterExpression(a,b,"",!0,!1,-1,!1,null,null,!1)},"~N,~N");f(d,"parameterExpressionBoolean",function(a,b){return this.parameterExpression(a,
b,null,!0,!1,-1,!1,null,null,!1).booleanValue()},"~N,~N");f(d,"parameterExpressionToken",function(a){a=this.parameterExpressionList(a,-1,!1);return 0<a.size()?a.get(0):JS.SV.newS("")},"~N");f(d,"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");f(d,"parameterExpression",function(a,b,c,e,g,d,f,j,l,r){var m=null!=l,k=null==l&&null!=j,p=0>a,q=!g&&null==c,s=!g&&null!=
c&&0==c.length;p&&(a=-a);var B=null==j||-2147483648!=b;b<a&&(b=this.slen);var E=r?0:1,y=-1;c=new JS.ScriptMathProcessor(this,r,f,g,!1,!1,c);var x,v;f=g=0;var w=!0,t=a;a:for(;t<b;t++){x=null;var H=this.getToken(t).tok;if(m&&1073742336!=this.tokAt(t+1)){var A=null!=j&&j.containsKey(this.theToken.value)?null:this.getBitsetPropertySelector(t,10);if(null!=A){c.addX(j.get(l));c.addOpAllowMath(A,268435968==this.tokAt(t+1),0)||this.invArg();if((134320141==A.intValue||102436==A.intValue)&&268435968!=this.tokAt(this.iToken+
1))c.addOp(JS.T.tokenLeftParen),c.addOp(JS.T.tokenRightParen);t=this.iToken;continue}}switch(H){case 268437505:case 1073742338:if(!e&&w)break a;1073742338==H&&this.invArg();r&&(1==g&&268440324==this.tokAt(t+1))&&(r=c.endAssignment())}switch(H){case 12290:if(1073742325==(H=this.tokAt(++t)))x=this.parameterExpressionToken(++t),t=this.iToken;else if(2==H){x=this.vwr.ms.getAtoms(1094715393,Integer.$valueOf(this.st[t].intValue));break}else if(12290==H&&2==this.tokAt(t+1)){x=this.vwr.ms.getAtomsFromAtomNumberInFrame(this.st[++t].intValue);
break}else x=this.getParameter(JS.SV.sValue(this.st[t]),1073742190,!0);x=this.getParameter(x.asString(),1073742190,!0);break;case 134320649:268435968!=this.getToken(++t).tok&&this.invArg();null==j&&(j=new java.util.Hashtable);v=this.parameterExpression(++t,-1,null,e,!1,-1,!1,j,l,!1);A=v.booleanValue();H=this.iToken;1073742339!=this.getToken(H++).tok&&this.invArg();this.parameterExpressionBoolean(H,-1);var G=this.iToken;1073742339!=this.tokAt(G++)&&this.invArg();this.parameterExpression(-G,-1,null,
e,!1,1,!1,j,l,!1);t=this.iToken;268435969!=this.tokAt(t)&&this.invArg();x=this.parameterExpression(A?H:G,A?G:t,"XXX",e,!1,1,!1,j,l,!1);t=this.iToken=t;break;case 134320648:case 1275082241:H=(A=0<a)&&134320648==H;A?((268435968!=this.getToken(++t).tok||!JS.T.tokAttr(this.getToken(++t).tok,1073741824))&&this.invArg(),G=this.paramAsStr(t),1073742339!=this.getToken(++t).tok&&this.invArg()):G="_x";x=this.parameterExpressionToken(-++t).value;u(x,"JU.BS")||this.invArg();t=this.iToken;A&&1073742339!=this.getToken(t++).tok&&
this.invArg();var F=new JU.BS,I=new JU.BS,z=H?Array(x.cardinality()):null;null==j&&(j=new java.util.Hashtable);I.set(0);var L=JS.SV.newV(10,I);L.index=0;j.put(G,L.setName(G));var P=-1;if(A){P=t-1;v=0;for(var K;0<=v&&++P<b;)268435969==(K=this.tokAt(P))?v--:268435968==K&&v++}var M=0,O=0,N=x.nextSetBit(0);if(0>N||this.chk)this.iToken=P-1;else for(;0<=N;N=x.nextSetBit(N+1))0<=O&&I.clear(O),O=N,I.set(N),L.index=N,v=this.parameterExpression(t,P,H?"XXX":null,e,H,N,!1,j,A?null:G,!1),H?((null==v||0==v.size())&&
this.invArg(),z[M++]=v.get(0).asString()):v.booleanValue()&&F.set(N);if(H)x=z;else if(A)x=F;else return this.listBS(F);t=this.iToken+1;break;case 1073742339:break a;case 2:if(1073742336==this.tokAt(this.iToken+1)&&(805307393==(H=this.tokAt(this.iToken+2))||268441089==H))this.theToken.value=Float.$valueOf(this.theToken.intValue),this.theToken.tok=3,this.theToken.intValue=2147483647,t++;case 3:case 1073742362:c.addXNum(this.theToken);break;case 134217750:if(268435968==this.tokAt(this.iToken+1)){c.addOpAllowMath(this.theToken,
!0,0)||this.invArg();break}case 1073742335:case 1073742334: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 1073742330:if(1073742336==this.tokAt(t+2)&&1275072526==this.tokAt(t+3))c.addXStr("$"+this.paramAsStr(++t));else{this.ignoreError=!0;var Q;try{Q=this.centerParameter(t,null),c.addX(JS.SV.newV(8,Q))}catch(S){if(D(S,Exception))c.addXStr("");else throw S;}this.ignoreError=!1;t=this.iToken}break;case 1073742332:if(4==this.tokAt(t+1)){if(1073742338==
this.tokAt(t+2)){x=this.chk?new JU.BS:this.getAtomBitSet(this.stringParameter(t+1));t+=2;break}x=this.getAssocArray(t)}else x=this.getPointOrPlane(t,55);t=this.iToken;break;case 1073742325:if(1073742326==this.tokAt(t+1)){x=new java.util.Hashtable;t++;break}else 1073742327==this.tokAt(t+1)&&1073742326==this.tokAt(t+2)&&(H=1073742327,this.iToken+=2);case 1073742327:x=1073742327==H?this.vwr.getAllAtoms():this.atomExpression(this.st,t,0,!0,!0,null,!0);t=this.iToken;if(0==f&&p)return this.iToken++,this.listBS(x);
break;case 1073742195:c.addOp(this.theToken);continue;case 1073742326:break a;case 268436992:if(!e&&w)break a;c.addOp(this.theToken)||this.invArg();break;case 1073742337:case 1073742336:r&&(w&&268440324==this.tokAt(t+2))&&(r=c.endAssignment());if(0==E&&w)switch(this.tokAt(t+1)){case 0:break;case 1275335685:case 1275334681:case 1140850694:case 1140850706:case 1140850696:case 1275068418:if(1073742336==H)break;default:c.addOp(JS.T.tokenArrayOpen);c.addXStr(this.optParameterAsString(++t));c.addOp(JS.T.tokenArrayClose);
continue}A=this.getBitsetPropertySelector(t+1,c.getXTok());t=134320141==A.intValue;G=!0;K=this.tokAt(this.iToken+2);if(1073742336==this.tokAt(this.iToken+1))switch(K){case 1073742327:K=480,1073742336==this.tokAt(this.iToken+3)&&1275068420==this.tokAt(this.iToken+4)&&(K=224);case 1275068725:case 32:case 64:case 192:case 128:case 160:case 96:G=t||1275069443==A.intValue||480==K||224==K||1275068725==K,A.intValue|=K&480,this.getToken(this.iToken+2)}H=this.tokAt(this.iToken+1);G=(new Boolean(G&(268435968==
H||t))).valueOf();c.addOpAllowMath(A,G,t?H:0)||this.invArg();t=this.iToken;134320141==A.intValue&&268435968!=H&&(c.addOp(JS.T.tokenLeftParen),c.addOp(JS.T.tokenRightParen));break;case 1153433601:case 1086326786:case 1086326785:case 1073742328:case 1812599299:case 1086326788:case 1073742329:case 1111490587:case 1086326789:case 1086324742:case 1094717454:case 1094713360:case 1073742128:case 134218756:case 1086324744:case 1094713366:case 134218757:case 1237320707:case 1639976963:if(!k&&t==y&&268436992==
this.tokAt(t+1)){c.addX(JS.SV.newT(this.theToken));break}default:if(268437504==this.theTok&&268436482==this.tokAt(t+2)){x=this.getAssocArray(t);t=this.iToken;break}if(JS.T.tokAttr(this.theTok,268435456)||JS.T.tokAttr(this.theTok,134217728)&&268435968==this.tokAt(this.iToken+1)){if(!c.addOp(this.theToken)){if(0<=d)break a;this.invArg()}switch(this.theTok){case 134217759:y=t+2;break;case 268440324:w&&(E=t);break;case 268435968:f++;w=!1;break;case 268435969:if(0>=--f&&0==g){if(p){this.iToken++;break a}w=
!0}break;case 268437504:g++;w=!1;break;case 268437505:if(0==--g&&0==f){if(p){this.iToken++;break a}w=!0}}}else{A=this.paramAsStr(t).toLowerCase();H=268435968==this.tokAt(t+1);if(!H)if(this.chk)x=A;else if(null==j||null==(x=JU.PT.getMapValueNoCase(j,A))&&B)A.startsWith("_")&&(x=A.equals("_")?this.vwr.getModelSetAuxiliaryInfo():A.equals("_m")?this.vwr.getCurrentModelAuxInfo():null),null==x?x=this.getContextVariableAsVariable(A,!1):0==E&&this.invArg();if(null==x)if(JS.T.tokAttr(this.theTok,1073741824)&&
this.isFunction(A))c.addOp(JS.SV.newV(134320141,this.theToken.value))||this.invArg(),H||(c.addOp(JS.T.tokenLeftParen),c.addOp(JS.T.tokenRightParen));else{A=this.vwr.g.getAndSetNewVariable(A,!1);switch(A.tok){case 2:case 3:if(this.noCopy(t,-1)||this.noCopy(t,1))break;c.addXCopy(A);continue}c.addX(A)}}}null!=x&&(u(x,"JU.BS")?c.addXBs(x):c.addXObj(x))}a=c.getResult();null==a&&(this.chk||c.dumpStacks("null result"),this.error(13));if(135198==a.tok)return r&&0==E?(r=new JU.Lst,r.addLast(new JS.SV),r):
a.value;if(this.chk){if(q)return Boolean.TRUE;if(s)return""}else{if(q)return Boolean.$valueOf(a.asBoolean());if(s)return 4==a.tok&&(a.intValue=2147483647),a.asString()}switch(a.tok){case 1073742335:case 1073742334: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");f(d,"atomExpressionAt",function(a){this.checkToken(a)||(this.iToken=a,this.bad());return this.atomExpression(this.st,a,0,!0,!1,null,!0)},
"~N");f(d,"atomExpression",function(a,b,c,e,g,d){this.isBondSet=!1;a!==this.st&&(this.tempStatement=this.st,this.st=a);var f=new JS.ScriptMathProcessor(this,!1,!1,!1,null==d,g,null),j,l=!1;this.iToken=1E3;var r=0>b,m=!1,k,p=0,q=this.vwr.ms.ac,s=-10;r&&(b=-b);r=(new Boolean(r|this.chk)).valueOf();0==c&&a.length>b&&(c=b+1);a:for(;b<c;++b){this.iToken=b;j=a[b];if(null==j)break;k=j.value;switch(j.tok){case 1073742325:c=a.length;p++;break;case 1073742326:p--;if(0<p)continue;break a;case 1073742332:if(this.isPoint3f(b)&&
(k=this.getPoint3f(b,!0,!0),null!=k)){f.addXPt(k);b=this.iToken;break}break;case 1073742338:0<b&&1073742332==a[b-1].tok&&f.addXBs(new JU.BS);break;case 268437504:m=!0;f.addOp(j);break;case 268437505:m=!1;f.addOp(j);break;case 12290:f.addXBs(this.getAtomBitSet(k));break;case 7:if(k=JS.SV.getBitSet(j,!1),null!=k){f.addXBs(k);break}case 6:f.addXBs(this.vwr.ms.getAtoms(1086324744,j.asString()));break;case 134219777:f.addX(JS.SV.newT(j));f.addX(JS.SV.newV(9,this.hklParameter(b+2,null,!0)));b=this.iToken;
break;case 134217750:f.addX(JS.SV.newT(j));f.addX(JS.SV.newV(9,this.planeParameter(b+2,!1)));b=this.iToken;break;case 1073742329:f.addX(JS.SV.newT(j));f.addXPt(this.getPoint3f(b+2,!0,!0));b=this.iToken;break;case 4:var B=k;if(0==B.indexOf("({")){if(k=JU.BS.unescape(B),null!=k){f.addXBs(k);break}}else if(0<=B.indexOf("|")&&s!=b-4){f.addXBs(this.vwr.ms.getAtoms(1086324744,B));break}f.addX(JS.SV.newT(j));B.equals("hkl")&&(f.addX(JS.SV.newV(9,this.hklParameter(b+2,null,!0))),b=this.iToken);break;case 134217759:s=
b;case 134218757:case 134218756:case 1237320707:case 134353926:case 134217736:case 268436992:case 1275203608:f.addOp(j);break;case 1073742327:f.addXBs(this.vwr.getAllAtoms());break;case 1073742333:f.addXBs(new JU.BS);break;case 1073742335:case 1073742334:f.addX(JS.SV.newT(j));break;case 1113589787:f.addXBs(JU.BSUtil.copy(this.vwr.bsA()));break;case 2097194:f.addXBs(JU.BSUtil.copy(this.vwr.slm.getHiddenSet()));break;case 12293:f.addXBs(this.vwr.getMotionFixedAtoms(null,null));break;case 2097192:f.addXBs(JU.BSUtil.copyInvert(this.vwr.slm.getHiddenSet(),
q));break;case 2097200:f.addXBs(this.vwr.getBaseModelBitSet());break;case 2097198:f.addXBs(this.chk?new JU.BS:JU.BSUtil.copy(this.vwr.ms.getVisibleSet(!l)));l=!0;break;case 2097190:!this.chk&&e&&this.refresh(!1);f.addXBs(this.chk?new JU.BS:this.vwr.ms.getClickableSet(!e));e=!1;break;case 1073742356:1!=this.vwr.ms.mc||this.vwr.ms.haveBioModels?(B=j.intValue,0<B?(k=this.compareInt(1094713346,268440324,B),2==B&&k.or(this.compareInt(1086326789,268440324,20)),f.addXBs(k)):f.addXBs(this.getAtomBits(j.tok,
k))):f.addXBs(this.lookupIdentifierValue("_"+k));break;case 2097155:case 2097188:case 2097156:case 1612709894:case 1073742331:case 2097166:case 2097165:case 2097168:case 2097170:case 2097172:case 2097174:case 1073742360:case 1073742355:case 2097196:case 1088421903:case 1814695966:f.addXBs(this.getAtomBits(j.tok,k));break;case 1073742358:case 1073742359:j=j.intValue;if(2147483647==j&&u(k,Integer)){j=k.intValue();if(!this.vwr.haveFileSet()){f.addXBs(this.getAtomBits(1073742358,Integer.$valueOf(j)));
break}2147>=j&&(j*=1E6)}f.addXBs(this.bitSetForModelFileNumber(j));break;case 1073742361:case 1073742357:f.addXBs(this.getAtomBits(j.tok,Integer.$valueOf(j.intValue)));break;case 1073742362:m?f.addXNum(j):f.addXBs(this.getAtomBits(1073742362,Integer.$valueOf(JS.ScriptExpr.getSeqCode(j))));break;case 1073742363:if(m){f.addXNum(j);f.addOp(JS.T.tokenMinus);f.addXNum(a[++b]);break}k=b+3<a.length&&268439552==a[b+2].tok&&1073742357==a[b+3].tok?a[b+3].intValue:-1;f.addXBs(this.getAtomBits(1073742363,K(-1,
[JS.ScriptExpr.getSeqCode(j),JS.ScriptExpr.getSeqCode(a[++b]),k])));-1!=k&&(b+=2);break;case 1094713350:case 1094713349:f.addXBs(this.getAtomBits(j.tok,k));break;case 2097182:f.addXBs(0>this.vwr.am.cmi?this.vwr.getFrameAtoms():this.vwr.getModelUndeletedAtomsBitSet(this.vwr.am.cmi));break;case 1612709900:case 2097154:case 1114249217:case 1612709912:case 136314895:case 2097159:case 2097160:case 2097162:case 2097178:case 2097180:f.addXBs(this.lookupIdentifierValue(k));break;case 268440323:case 268440322:case 268440321:case 268440320:case 268440324:case 268440325:case 268440326:B=
j.tok;j=j.intValue;1094717448==j&&268440324!=B&&this.invArg();var E=null;1715472409==j&&(b+2==a.length&&this.invArg(),this.chk||(E=this.vwr.getDataObj(a[++b].value,null,1)));++b==a.length&&this.invArg();f.addXBs(this.chk?new JU.BS:this.getComparison(a[b],j,B,k,E));break;case 3:case 2:f.addXNum(j);break;case 10:k=u(k,"JM.BondSet")?k:JU.BSUtil.copy(k);f.addXBs(k);break;case 8:f.addXPt(k);break;default:if(JS.T.tokAttr(j.tok,268435456)){f.addOp(j)||this.invArg();break}if("string"!=typeof k){f.addXObj(k);
break}j=this.getParameter(k,0,!0);if(m){f.addXObj(j);break}if("string"==typeof j||u(j,"JU.Lst"))j=this.getStringObjectAsVariable(j);"string"==typeof j&&(j=this.lookupIdentifierValue(k));f.addXObj(j)}}a=f.getResult();if(null==a){if(g)return null;this.chk||f.dumpStacks("after getResult");this.error(13)}g=a.value;if("string"==typeof g&&(null==d||g.startsWith("({")))g=this.chk?new JU.BS:this.getAtomBitSet(g);if(null!=d&&!u(g,"JU.BS"))return d[0]=g,null;k=u(g,"JU.BS")?g:new JU.BS;this.isBondSet=u(g,"JM.BondSet");
!this.isBondSet&&(k=this.vwr.slm.excludeAtoms(k,r)).length()>this.vwr.ms.ac&&k.clearAll();null!=this.tempStatement&&(this.st=this.tempStatement,this.tempStatement=null);return k},"~A,~N,~N,~B,~B,~A,~B");f(d,"getComparison",function(a,b,c,e,g){var d=a.tok;if(7==d){d=new JU.BS;268440324!=c&&d.setBits(0,this.vwr.ms.ac);a=a.getList();for(var f=a.size();0<=--f;){var j=this.getComparison(a.get(f),b,c,e,g);268440324==c?d.or(j):d.and(j)}return d}var l=a.intValue,f=NaN,j=1094717454==b,r=JS.T.tokAttr(b,1094713344),
m=JS.T.tokAttr(b,1111490560)||1077936128==(b&1136656384),k=r&&m,p=!r&&JS.T.tokAttr(b,1086324736);1086326789==b&&(r=!(p=!1));var q=a.value;if(JS.T.tokAttr(d,1073741824))if("_modelNumber".equalsIgnoreCase(q))l=this.vwr.am.cmi,q=Integer.$valueOf(l=0>l?0:this.vwr.getModelFileNumber(l));else{var s=this.getParameter(q,1073742190,!1);if(null!=s){if(7==s.tok)return this.getComparison(s,b,c,e,g);l=s.intValue;q=p||1094717448==b&&2!=s.tok?JS.SV.sValue(s):JS.SV.nValue(s);a=s}}u(q,"JU.P3")?1765808134==b&&(l=JU.CU.colorPtToFFRGB(q),
d=2,r=!0):"string"==typeof q&&(1765808134==b?(l=JU.CU.getArgbFromString(q),0==l&&JS.T.tokAttr(d,1073741824)&&(q=this.getVarParameter(q,!0),q.startsWith("{")?(q=JU.Escape.uP(q),l=u(q,"JU.P3")?JU.CU.colorPtToFFRGB(q):0):l=JU.CU.getArgbFromString(q)),d=2,r=!0):p||(1094717448==b?q=Integer.$valueOf(2==a.tok?a.intValue:-1E3-(q+" ").codePointAt(0)):1639976963==b||1237320707==b||1086326789==b?p=!(r=2147483647!=l):q=JS.SV.nValue(a),u(q,Integer)?f=l=q.intValue():u(q,Float)&&j&&(l=JM.ModelSet.modelFileNumberFromFloat(q.floatValue()))));
p&&"string"!=typeof q&&(q=""+q);u(q,Integer)||2==d?j?1E6<=l&&(b=-1094717454):k||m&&(f=l):u(q,Float)?j?b=-1094717454:(f=q.floatValue(),k?r=!1:r&&(l=F(f))):p||(this.iToken++,this.invArg());j&&(1E6<=l&&0==l%1E6)&&(l/=1E6,b=1228935687);if(-1094717454==b&&268440324==c)return this.bitSetForModelFileNumber(l);null!=e&&0<=e.indexOf("-")&&(r?l=-l:Float.isNaN(f)||(f=-f));return r?this.compareInt(b,c,l):p?this.compareString(b,c,q):this.compareFloatData(b,g,c,f)},"JS.T,~N,~N,~S,~A");f(d,"noCopy",function(a,b){switch(this.tokAt(a+
b)){case 268441602:case 268441601:return-1==this.st[a+b].intValue==(-1==b);default:return!1}},"~N,~N");f(d,"getAssocArray",function(a){var b=new java.util.Hashtable,c=1073742332==this.tokAt(a)?1073742338:268437505;for(a+=1;a<this.slen&&this.tokAt(a)!=c;a++){var e=null;u(this.st[a],"JS.SV")&&(e=this.st[a].myName);null==e&&(e=JS.SV.sValue(this.st[a]));a++;268436482!=this.tokAt(a++)&&this.invArg();a=this.parameterExpression(a,0,null,!1,!0,-1,!1,null,null,!1);0==a.size()&&this.invArg();b.put(e,a.get(0));
a=this.iToken;if(268436992!=this.tokAt(a))break}this.iToken=a;this.tokAt(a)!=c&&this.invArg();return b},"~N");f(d,"listBS",function(a){var b=new JU.Lst;b.addLast(JS.SV.newV(10,a));return b},"JU.BS");f(d,"compareFloatData",function(a,b,c,e){var g=new JU.BS,d=this.vwr.ms.ac,f=this.vwr.ms.at,j=0;this.vwr.autoCalculate(a,null);var l=1715472409==a;!l&&null==this.ptTemp&&(this.ptTemp=new JU.P3);for(;0<=--d;)if(j=!1,j=f[d],!JM.AtomCollection.isDeleted(j)){if(l){if(null==b||b.length<=d)continue;j=b[d]}else j=
j.atomPropertyFloat(this.vwr,a,this.ptTemp);(j=this.compareFloat(c,j,e))&&g.set(d)}return g},"~N,~A,~N,~N");f(d,"compareFloat",function(a,b,c){if(b==b!=(c==c))return 268440325==a;switch(a){case 268440323:return b<c;case 268440322:return b<=c||b!=b;case 268440321:return b>=c||b!=b;case 268440320:return b>c;case 268440324:return b==c||b!=b;case 268440325:return b!=c&&b==b}return!1},"~N,~N,~N");f(d,"compareString",function(a,b,c){var e=new JU.BS,g=this.vwr.ms.at,d=this.vwr.ms.ac,f=268440326==b||1086326788==
a&&this.vwr.getBoolean(603979822);for(f||(c=c.toLowerCase());0<=--d;)if(null!=g[d]){var j=g[d].atomPropertyString(this.vwr,a);f||(j=j.toLowerCase());this.compareStringValues(b,j,c)&&e.set(d)}return e},"~N,~N,~S");f(d,"compareStringValues",function(a,b,c){switch(a){case 268440324:case 268440325:return JU.PT.isMatch(b,c,!0,!0)==(268440324==a);case 268440326:return JU.PT.isLike(b,c);default:this.invArg()}return!1},"~N,~S,~S");f(d,"compareInt",function(a,b,c){var e=2147483647,g=null,d=b,f=c,j=this.vwr.ms,
l=j.at,r=j.ac,m=-1,k=0,p=-1,q=null,s=0,u;switch(a){case 1296041985:switch(d){case 268440321:case 268440320:m=2147483647}break;case 1094713347:try{switch(b){case 268440323:return JU.BSUtil.newBitSet2(0,c);case 268440322:return JU.BSUtil.newBitSet2(0,c+1);case 268440321:return JU.BSUtil.newBitSet2(c,r);case 268440320:return JU.BSUtil.newBitSet2(c+1,r);case 268440324:return c<r?JU.BSUtil.newBitSet2(c,c+1):new JU.BS;default:return u=JU.BSUtil.setAll(r),0<=c&&u.clear(c),u}}catch(E){if(D(E,Exception))return new JU.BS;
throw E;}}u=JU.BS.newN(r);for(var y=0;y<r;++y){var x=!1,v=l[y];if(!JM.AtomCollection.isDeleted(v)){switch(a){default:e=v.atomPropertyInt(a);break;case 1094713368:case 1094717448:return JU.BSUtil.copy(this.vwr.ms.getConformation(-1,c,!1,null));case 1296041985:g=v.atomSymmetry;if(null==g)continue;v.mi!=p&&(p=v.mi,q=j.getModelCellRange(p),s=j.getModelSymmetryCount(p));if(200<=f){if(null==q)continue;c=f%1E3;var w=T(f/1E3)-1;if(0>w)x=!0;else if(0==s||0<=w&&!(x=g.get(w)))continue;d=1073742333;e=0>w?v.getCellTranslation(c,
q,s):v.getSymmetryTranslation(w,q,s)}else if(0<s){if(c>s&&268440323!=d&&268440322!=d)continue;if(268440325==d){0<c&&(c<=s&&!g.get(c))&&u.set(y);continue}g=JU.BSUtil.copy(g);g.clearBits(s,g.length())}switch(d){case 268440323:m=c-1;break;case 268440322:m=c;break;case 268440321:k=c-1;break;case 268440320:k=c;break;case 268440324:m=c;k=c-1;break;case 268440325:x=!g.get(c)}0>k&&(k=0);k<m&&(g=g.nextSetBit(k),0<=g&&g<m&&(x=!0));if(!x||2147483647==e)b=1073742333}switch(b){case 268440323:x=e<c;break;case 268440322:x=
e<=c;break;case 268440321:x=e>=c;break;case 268440320:x=e>c;break;case 268440324:x=e==c;break;case 268440325:x=e!=c}x&&u.set(y)}}return u},"~N,~N,~N");f(d,"getBitsetPropertySelector",function(a,b){var c=this.getToken(a).tok;switch(c){case 1275068725:case 32:case 64:case 96:case 192:case 128:case 160:case 1715472409:break;default:if(JS.T.tokAttrOr(c,1077936128,1140850688)||6==b)break;if(805307393!=c&&!JS.T.tokAttr(c,1073741824))break;var e=this.paramAsStr(a);this.isFunction(e.toLowerCase())&&(c=134320141)}return JS.SV.newSV(268442113,
c,this.paramAsStr(a))},"~N,~N");f(d,"getBitsetProperty",function(a,b,c,e,g,d,f,j,l,r){var m=2147483647!=l,k=m||!u(d,"JM.BondSet")&&!u(a,"JM.BondSet"),p=c&480,q=224==p,s=288==p;s&&(p=480);var B=this.vwr.ms.ac,E=256==p?S(B,0):null,y=480==p||q;c&=-481;var x=null;0==c&&(c=k?1153433601:1677721602);var v=!1,w=!1,t=!1,D=!1;switch(c){case 1275068446:return this.vwr.getModelSetAuxiliaryInfoForAtoms(a).get("models");case 1145047050:case 1145047055:case 1145047051:case 1145047053:case 1145045008:case 1145045006:case 1765808134:case 1145047052:v=
!0;break;case 1275203608:w=!0;x=P(-1,[null,null]);break;case 134320141:case 1275069443:break;case 1086324754:t="color"===d;D=!t;break;default:t=JS.T.tokAttr(c,1094713344)&&!JS.T.tokAttr(c,1111490560),D=!t&&JS.T.tokAttr(c,1086324736)}var A=v||!k?new JU.P3:null;if(y||D&&!m&&256!=p&&32!=p)p=1073742327;var G=1073742327==p?new JU.Lst:null,F=null,I=F=null,z=null,L=null,K=null,O=null,Q=null;switch(c){case 1153433601:if(k)break;case 1677721602:if(this.chk)return a;F=1153433601==c?this.vwr.ms.getAtoms(1677721602,
a):k?JM.BondSet.newBS(this.vwr.getBondsForSelectedAtoms(a)):a;switch(p){case 32:l=F.nextSetBit(0);break;case 64:l=F.length()-1;break;case 192:case 128:case 160:return Float.$valueOf(NaN);default:return F}F.clearAll();0<=l&&F.set(l);return F;case 1086324745:switch(p){case 0:case 32:case 1073742327:return this.getCmdExt().getBitsetIdent(a,null,d,j,l,y)}return"";case 134320141:F=f[0];I=f[1];z=JU.BS.newN(B);L=JS.SV.newV(10,z);break;case 1111490587:for(f=E.length;0<=--f;)E[f]=NaN;case 1111490574:case 1111490575:this.vwr.autoCalculate(c,
d);break;case 1275069443:if(null==e&&null==g)return new JU.P3;break;case 1765808134:K=new JU.P3;break;case 1715472409:O=this.vwr.getDataObj(f,null,1),null==O&&(Q=this.vwr.getDataObj(f,null,2)),null!=Q&&(p=1073742327,G=new JU.Lst)}var M=j=f=0,N=0,R=0;switch(p){case 32:j=2147483647;M=3.4028235E38;break;case 64:j=-2147483648,M=-3.4028235E38}var V=this.vwr.ms;d=null!=Q?5:w?4:v?3:D?2:t?1:0;if(k){K=null!=a;null!=b?(k=0,B=b.size()):m?(k=l,B=l+1):K?(k=a.nextSetBit(0),B=Math.min(B,a.length())):k=0;this.chk&&
(B=0);for(l=k;0<=l&&l<B;l=K?a.nextSetBit(l+1):l+1){f++;var U;if(null==b){if(U=V.at[l],JM.AtomCollection.isDeleted(U))continue}else U=null;switch(d){case 0:k=3.4028235E38;switch(c){case 134320141:z.set(l);k=JS.SV.fValue(this.getUserFunctionResult(F,I,L));z.clear(l);break;case 1715472409:k=null==O||l>=O.length?0:O[l];break;case 1275069443:k=null!=g?JU.Measure.distanceToPlane(g,U):null!=b?JS.SV.ptValue(b.get(l)).distance(e):U!==e||32!=p?U.distance(e):NaN;break;default:k=U.atomPropertyFloat(this.vwr,
c,this.ptTemp)}if(3.4028235E38==k||Float.isNaN(k)&&1073742327!=p){f--;continue}switch(p){case 32:k<M&&(M=k);break;case 64:k>M&&(M=k);break;case 256:E[l]=k;break;case 1073742327:G.addLast(Float.$valueOf(k));break;case 160:case 192:R+=k*k;default:N+=k}break;case 1:k=0;switch(c){case 1094717448:case 1094713349:this.errorStr(45,JS.T.nameOf(c));break;case 1086324754:k=U.getWyckoffPosition().charAt(0).charCodeAt(0);switch(k){case 63:k=0;break;case 65:k=27;break;default:k&=31}break;default:k=U.atomPropertyInt(c)}switch(p){case 32:k<
j&&(j=k);break;case 64:k>j&&(j=k);break;case 256:E[l]=k;break;case 1073742327:G.addLast(Integer.$valueOf(k));break;case 160:case 192:R+=k*k;default:N+=k}break;case 2:k=U.atomPropertyString(this.vwr,c);switch(p){case 256:E[l]=JU.PT.parseFloat(k);break;default:if(null==G)return k;G.addLast(k)}break;case 3:k=U.atomPropertyTuple(this.vwr,c,this.ptTemp);switch(p){case 256:E[l]=null==A?-1:null==k?0:k.length();break;case 1073742327:G.addLast(null==k?Integer.$valueOf(-1):JU.P3.newP(k));break;default:null==
k?f--:A.add(k)}break;case 4:switch(c){case 1275203608:if(x[0]=Integer.$valueOf(l),x[1]="",this.vwr.shm.getShapePropertyData(21,"info",x),null!=x[1]){if(null==G)return x[1];G.addLast(x[1])}}break;case 5:G.addLast(Q[l])}if(m)break}}else{k=(b=null==a)?0:a.nextSetBit(0);B=this.vwr.ms.bondCount;for(l=k;0<=l&&l<B;l=b?l+1:a.nextSetBit(l+1))switch(f++,e=V.bo[l],c){case 1140850691:k=e.atom1.distance(e.atom2);switch(p){case 32:k<M&&(M=k);break;case 64:k>M&&(M=k);break;case 1073742327:G.addLast(Float.$valueOf(k));
break;case 160:case 192:R+=k*k;default:N+=k}break;case 1145047050:switch(p){case 1073742327:A.ave(e.atom1,e.atom2);G.addLast(JU.P3.newP(A));break;default:A.add(e.atom1),A.add(e.atom2),f++}break;case 1765808134:JU.CU.colorPtFromInt(this.vwr.gdata.getColorArgbOrGray(e.colix),K);switch(p){case 1073742327:G.addLast(JU.P3.newP(K));break;default:A.add(K)}break;default:this.errorStr(46,JS.T.nameOf(c))}}if(256==p)return E;if(1073742327==p){if(r)return s?this.getMathExt().getMinMax(G,1275068725,!1):G;a=G.size();
if((D||w)&&!y&&1==a)return G.get(0);if(q){E=S(a,0);for(l=a;0<=--l;)switch(c=G.get(l),d){case 0:E[l]=c.floatValue();break;case 1:E[l]=c.floatValue();break;case 2:E[l]=JU.PT.parseFloat(c);break;case 3:E[l]=null==c?-1:c.length()}return E}if(1086324744==c){E=new JU.SB;for(l=0;l<a;l++)E.append(G.get(l));return E.toString()}E=Array(a);for(l=a;0<=--l;)c=G.get(l),E[l]=u(c,"JU.P3")?JU.Escape.eP(c):""+G.get(l);return E}if(v)return 0==f?Integer.$valueOf(-1):JU.P3.new3(A.x/f,A.y/f,A.z/f);if(w)return new java.util.Hashtable;
if(0==f||1==f&&192==p)return Float.$valueOf(NaN);if(t)switch(p){case 32:case 64:return Integer.$valueOf(j);case 160:case 192:break;case 128:return Integer.$valueOf(T(N));default:return N/f==T(N/f)?Integer.$valueOf(T(N/f)):Float.$valueOf(N/f)}switch(p){case 32:case 64:N=M;break;case 128:break;case 160:N=R;break;case 192:N=Math.sqrt((R-N*N/f)/(f-1));break;default:N/=f}return Float.$valueOf(N)},"JU.BS,JU.Lst,~N,JU.P3,JU.P4,~O,~O,~B,~N,~B");f(d,"bitSetForModelFileNumber",function(a){var b=JU.BS.newN(this.vwr.ms.ac);
if(this.chk)return b;var c=this.vwr.ms.mc,e=this.vwr.haveFileSet();1E6>a&&e&&(a*=1E6);if(0==a%1E6){e=this.vwr.ms.getModelNumberIndex(a+1,!1,!1);if(0>e)return b;a=0==a?c:this.vwr.ms.getModelNumberIndex(a+1000001,!1,!1);0>e&&(e=0);0>a&&(a=c);this.vwr.ms.isTrajectory(e)&&(a=e+1);for(c=e;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");f(d,"getStringObjectAsVariable",function(a){if(null==
a)return a;if("string"==typeof a)return 0==a.length?a:JS.SV.unescapePointOrBitsetAsVariable(a);if(0==a.size())return"";var b=a.get(0);if(null!=JS.SV.ptValue(b))return a;if(a.get(0).asString().contains("|"))return this.vwr.ms.getAtoms(1086324744,JS.SV.newV(7,a).asString());a=JS.SV.unEscapeBitSetArray(a,!0);return null==a?"":a},"~O");f(d,"getAtomBits",function(a,b){return this.chk?new JU.BS:this.vwr.ms.getAtoms(a,b)},"~N,~O");d.getSeqCode=f(d,"getSeqCode",function(a){return 2147483647==a.intValue?a.value.intValue():
JM.Group.getSeqcodeFor(a.intValue," ")},"JS.T");f(d,"setVariable",function(a,b,c,e){var g=null,d="",g=c.startsWith("property_"),f=c.equals("thrown_value"),d=1073742325==this.tokAt(1)||268435968==this.tokAt(1),j=g?null:0==c.length?new JS.SV:this.getContextVariableAsVariable(c,!1);if(e&&!d)switch(this.tokAt(2)){default:a=2;break;case 268440324:a=3;break;case 1073742195:case 268437504:if(61==this.st[0].intValue){a=2;break}case 1073742336:case 1073742337:c=null}d=0;e=this.parameterExpression(a,b,c,!0,
!0,-1,!1,null,null,e&&1==a);d=e.size();0==d&&this.invArg();if(this.chk||0==e.get(0).tok)return null;b=JS.SV.selectItemVar(JS.SV.newS("").setv(e.get(d-1)));if(1<d){c=2<d?e.get(1):null;j=e.get(0);e=!1;switch(j.tok){case 6:case 14:3<d&&this.invArg();j.mapPut(c.asString(),b);break;case 7:d>2+(null==c?0:1)&&this.invArg();null==c?c=j:j=JS.SV.selectItemVar(j);e=!0;break;case 4:if(2!=c.tok){j.value=JU.PT.rep(j.asString(),c.asString(),b.asString());j.intValue=2147483647;break}case 11:case 12:2147483647==j.intValue?
e=!0:j.setSelectedValue(j.intValue,c.asInt(),b);break;case 8:a=j.value=JU.P3.newP(j.value);g=b.asFloat();switch(JS.T.getTokFromName(c.asString())){case 1111492629:a.x=g;break;case 1111492630:a.y=g;break;case 1111492631:a.z=g}break;case 10:var g=JS.SV.getBitSet(j,!0),f=this.vwr.ms.ac,l=g.cardinality(),d=c.asString(),r=JS.T.getTokFromName(d);switch(r){case 0:if(d.startsWith("property_")){7==b.tok?(a=b.getList().size()==l?l:f,a=1<JS.SV.getArrayDepth(b)?JS.SV.fflistValue(b,a):JS.SV.flistValue(b,a)):a=
b.asString();this.vwr.setData(d,P(-1,[d,a,JU.BSUtil.copy(g),Integer.$valueOf(-1)]),f,0,0,7==b.tok?2147483647:-2147483648,0);break}this.iToken=a;this.error(56);break;case 1825200146:case 1287653388:this.vwr.shm.loadShape(5);default:this.setBitsetProperty(g,r,b.asInt(),b.asFloat(),b)}}e&&j.setSelectedValue(c.intValue,2147483647,b);return null}if(!g&&(null==j&&(f||!("string"==typeof b.value||2==b.tok||u(b.value,Integer)||u(b.value,Float)||u(b.value,Boolean))))&&null!=c)(c.startsWith("_")||null==(j=this.vwr.g.getAndSetNewVariable(c,
!0)))&&this.errorStr(22,c);if(null!=j)return j.setv(b);j=JS.SV.oValue(b);if(g)return 7==b.tok&&(j=b.asString()),this.vwr.setData(c,P(-1,[c,""+j,JU.BSUtil.copy(this.vwr.bsA()),Integer.$valueOf(0)]),this.vwr.ms.ac,0,0,-2147483648,0),null;u(j,Boolean)?this.setBooleanProperty(c,j.booleanValue()):u(j,Integer)?this.setIntProperty(c,j.intValue()):u(j,Float)?this.setFloatProperty(c,j.floatValue()):"string"==typeof j&&this.setStringProperty(c,j);return b},"~N,~N,~S,~B");f(d,"setBitsetProperty",function(a,
b,c,e,g){if(!this.chk&&!a.isEmpty()){var d=null,f=null,j=null,l,r=null;l=0;var m=JS.T.tokAttr(b,1086324736);if(7==g.tok&&(r=g.getList(),0==(l=r.size())))return;switch(b){case 1145047050:case 1145047051:case 1145047053:case 1145047055:switch(g.tok){case 8:this.vwr.setAtomCoords(a,b,g.value);break;case 7:this.theToken=g,this.vwr.setAtomCoords(a,b,this.getPointArray(-1,l,!0))}return;case 1765808134:var k=null;b="color";switch(g.tok){case 7:g=K(l,0);for(k=l;0<=--k;)b=r.get(k),l=JS.SV.ptValue(b),null!=
l?g[k]=JU.CU.colorPtToFFRGB(l):2==b.tok?g[k]=b.intValue:(g[k]=JU.CU.getArgbFromString(b.asString()),0==g[k]&&(g[k]=b.asInt())),0==g[k]&&this.errorStr2(50,"ARRAY",b.asString());k=g;b="colorValues";break;case 8:k=Integer.$valueOf(JU.CU.colorPtToFFRGB(g.value));break;case 4:k=g.value;break;default:k=Integer.$valueOf(JS.SV.iValue(g))}this.setAtomProp(b,k,a);return;case 1825200146:case 1287653388:7!=g.tok&&(f=JS.SV.sValue(g));break;case 1086326789:case 1094715402:this.clearDefinedVariableAtomSets(),m=
!1}switch(g.tok){case 7:m?d=JS.SV.strListValue(g):j=JS.SV.flistValue(g,l);break;case 4:null==f&&(d=JU.PT.getTokens(JS.SV.sValue(g)))}if(null!=d){l=d.length;if(!m){j=S(l,0);for(k=l;0<=--k;)j[k]=1086326789==b?JU.Elements.elementNumberFromSymbol(d[k],!1):JU.PT.parseFloat(d[k])}7!=g.tok&&1==l&&(m?f=d[0]:e=j[0],c=F(e),j=d=null)}JS.T.tokAttr(b,2048)||this.error(56);this.vwr.setAtomProperty(a,b,c,e,f,j,d)}},"JU.BS,~N,~N,~N,JS.T");f(d,"setStatement",function(a,b){this.st=a;this.slen=this.st.length;if(0==
this.slen)return!0;var c,e,d;for(e=b;e<this.slen;e++){if(null==this.st[e])return this.slen=e,!0;if(12290==this.st[e].tok)break}if(e==this.slen||this.chk)return e==this.slen;switch(this.st[0].tok){case 102436:case 134320141:case 1073741824:if(268435968==this.tokAt(1))return!0}c=Array(this.slen);c[0]=this.st[0];var f=!1,h=b;for(e=b;e<this.slen;e++)if(null!=this.st[e]){switch(d=this.getToken(e).tok){default:c[h]=this.st[e];break;case 1073742325:case 1073742326:f=1073742325==d;c[h]=this.st[e];break;case 12290:++e==
this.slen&&this.invArg();var j,l=4==this.theToken.intValue,r=this.paramAsStr(e),m=1073742325==this.tokAt(e),k=1==b&&1==h&&this.st[0]===JS.T.tokenSetCmd;if(m){e=this.parameterExpressionToken(++e);if(this.chk)j=null;else if(7!=e.tok)j=JS.SV.oValue(e);else if(f)if(d=JS.SV.getBitSet(e,!0),null==d){var p=JS.SV.sValue(e);j=0>p.indexOf("|")?this.getAtomBitSet(p):p}else j=d;else j=e;e=this.iToken}else this.chk?j=new JU.BS:(j=2==this.tokAt(e)?this.vwr.ms.getAtoms(1094715393,Integer.$valueOf(this.st[e].intValue)):
12290==this.tokAt(e)&&2==this.tokAt(e+1)?this.vwr.ms.getAtomsFromAtomNumberInFrame(this.st[++e].intValue):this.getParameter(r,0,!0),!f&&!k&&(m=!0));d=this.tokAt(0);l=(new Boolean(l|(JS.T.tokAttr(d,20480)||134222850==d))).valueOf();if(null==j)c[h]=JS.T.tokenAll;else if(u(j,"JS.SV"))c[h]=j;else if(u(j,Boolean))c[h]=j.booleanValue()?JS.T.tokenOn:JS.T.tokenOff;else if(u(j,Integer))c[h]=JS.T.tv(2,j.intValue(),j);else if(u(j,Float))c[h]=JS.T.tv(3,JU.Edge.getFloatEncodedInt(""+j),j);else if("string"==typeof j){if(!l&&
!f){if((36867!=d||1<h&&537022465!=this.st[1].tok&&!"labelfor".equalsIgnoreCase(this.st[1].value.toString()))&&JS.T.tokAttr(d,36864))j=this.getParameter(j,1073742190,!0);"string"==typeof j&&(j=this.getStringObjectAsVariable(j))}u(j,"JS.SV")?c[h]=j:(d=j,f&&!l?c[h]=0<=d.indexOf("|")||JS.T.tokAttr(c[h-1].tok,268435712)?JS.T.o(4,d):JS.T.o(10,this.getAtomBitSet(d)):(d=k?JS.T.getTokFromName(d):m||l||0==d.length||0<=d.indexOf(".")||0<=d.indexOf(" ")||0<=d.indexOf("=")||0<=d.indexOf(";")||0<=d.indexOf("[")||
0<=d.indexOf("{")?4:1073741824,c[h]=JS.T.o(d,j)))}else if(u(j,"JU.BArray"))c[h]=JS.SV.newV(15,j);else if(u(j,"JU.BS"))c[h]=JS.SV.newV(10,j);else if(u(j,"JU.P3"))c[h]=JS.SV.newV(8,j);else if(u(j,"JU.P4"))c[h]=JS.SV.newV(9,j);else if(u(j,"JU.M34"))c[h]=JS.SV.newV(u(j,"JU.M4")?12:11,j);else if(u(j,"java.util.Map")||u(j,"JS.ScriptContext")&&null!=(j=j.getFullMap()))c[h]=JS.SV.newV(6,f?j:JS.SV.deepCopy(j,!0,!0));else if(u(j,"JU.Lst")){if(!f){c[h]=JS.SV.newV(7,JS.SV.deepCopy(j,!1,!0));break}p=j;d=null;
for(l=0;l<p.size();l++){m=p.get(l);if(10!=m.tok){d=null;break}null==d&&(d=new JU.BS);d.or(m.value)}c[h]=null==d?JS.SV.getVariable(j):JS.T.o(10,d)}else j=this.getObjectCenter(r,-2147483648,-2147483648),null==j&&this.invArg(),c[h]=JS.T.o(8,j);k&&!JS.T.tokAttr(c[h].tok,536870912)&&this.invArg()}h++}this.st=c;for(e=h;e<this.st.length;e++)this.st[e]=null;this.slen=h;return!0},"~A,~N");f(d,"isFunction",function(a){return null!=this.getFunction(a)},"~S");f(d,"addFunction",function(a){null==a||a.isPrivate?
(null==this.privateFuncs&&(this.privateFuncs=new java.util.Hashtable),null!=a&&this.privateFuncs.put(a.name,a)):this.vwr.addFunction(a)},"JS.ScriptFunction");f(d,"getFunction",function(a){var b=null==this.privateFuncs?null:this.privateFuncs.get(a);return null==b?this.vwr.getFunction(a):b},"~S")});L("JS");M(null,"JS.ScriptFlowContext",["JS.ScriptCompiler"],function(){var d=Q(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;this.line0=this.ichCommand=this.tok0=this.addLine=0;O(this,arguments)},JS,"ScriptFlowContext",null);R(d,function(a,b,c,e,d,f){this.compiler=a;this.token=b;this.tok0=b.tok;this.ident=b.value;this.pt0=c;this.line0=f;this.parent=e;this.ichCommand=d;this.lineStart=this.ptLine=this.compiler.lineCurrent;this.commandStart=this.ptCommand=this.compiler.iCommand},"JS.ScriptCompiler,JS.ContextToken,~N,JS.ScriptFlowContext,~N,~N");
f(d,"getBreakableContext",function(a){for(var b=this;null!=b&&(!JS.ScriptCompiler.isBreakableContext(b.token.tok)||0<a--);)b=b.parent;return b},"~N");f(d,"checkForceEndIf",function(a){this.ptCommand==this.compiler.iCommand&&0<this.addLine&&this.addLine++;if(a=this.forceEndIf&&this.ptCommand<this.compiler.iCommand&&this.ptLine+(0==this.addLine?0:this.addLine+a)==this.compiler.lineCurrent)this.forceEndIf=!1;return a},"~N");f(d,"setPt0",function(a,b){this.pt0=a;b&&(this.ptDefault=a);this.setLine();return a},
"~N,~B");f(d,"setLine",function(){this.ptLine=this.compiler.lineCurrent;this.ptCommand=this.compiler.iCommand+1});s(d,"toString",function(){return"ident "+this.ident+" line "+this.lineStart+" command "+this.commandStart});f(d,"path",function(){for(var a="",b=this;null!=b;)a=b.ident+"-"+a,b=b.parent;return"["+a+"]"});f(d,"setFunction",function(a){this.$function=a},"JS.ScriptFunction")});L("JS");M(["J.api.JmolScriptFunction","java.util.Hashtable","JU.Lst"],"JS.ScriptFunction",["JU.AU","$.SB","JS.SV",
"$.T"],function(){var d=Q(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;this.isPrivate=!1;O(this,arguments)},JS,"ScriptFunction",null,J.api.JmolScriptFunction);X(d,function(){this.names=new JU.Lst;this.variables=new java.util.Hashtable});R(d,function(){});R(d,function(a,b){this.set(a,b);this.typeName=JS.T.nameOf(b)},"~S,~N");f(d,
"isVariable",function(a){return this.variables.containsKey(a)},"~S");f(d,"set",function(a,b){this.name=a;this.tok=b},"~S,~N");f(d,"setVariables",function(a,b){for(var c=null==b?0:b.size(),e=this.names.size();0<=--e;){var d=this.names.get(e).toLowerCase(),f=e<this.nParameters&&e<c?b.get(e):null;null!=f&&7!=f.tok&&(f=JS.SV.newT(f));a.put(d,null==f?JS.SV.newS("").setName(d):f)}364558!=this.tok&&(a.put("_argcount",JS.SV.newI(null==b?0:b.size())),a.put("_arguments",null==b?JS.SV.getVariableAI(K(-1,[])):
JS.SV.getVariableList(b)));a.put("_retval",JS.SV.newI(364558==this.tok?2147483647:0))},"java.util.Map,JU.Lst");f(d,"unsetVariables",function(a,b){var c=null==b?0:b.size(),e=this.names.size();if(!(0==c||0==e))for(var d=0;d<e&&d<c;d++){var f=b.get(d);if(7==f.tok){var h=a.get(this.names.get(d).toLowerCase());7==h.tok&&(f.value=h.value)}}},"java.util.Map,JU.Lst");f(d,"addVariable",function(a,b){this.variables.put(a,a);this.names.addLast(a);b&&this.nParameters++},"~S,~B");d.setFunction=f(d,"setFunction",
function(a,b,c,e,d,f,h){var j=a.cmdpt0,l=a.chpt0,r=e-j;a.setScript(b.substring(l,c));b=a.aatoken=Array(r);a.lineIndices=JU.AU.newInt2(r);a.lineNumbers=aa(r,0);c=d[j]-1;for(var m=0;m<r;m++)if(a.lineNumbers[m]=d[j+m]-c,a.lineIndices[m]=K(-1,[f[j+m][0]-l,f[j+m][1]-l]),b[m]=h.get(j+m),0<b[m].length){var k=b[m][0];JS.T.tokAttr(k.tok,102400)&&(k.intValue-=0>k.intValue?-j:j)}for(m=e;--m>=j;)h.removeItemAt(m),f[m][0]=f[m][1]=0},"JS.ScriptFunction,~S,~N,~N,~A,~A,JU.Lst");f(d,"setScript",function(a){this.script=
a;null!=this.script&&(""!==this.script&&!this.script.endsWith("\n"))&&(this.script+="\n")},"~S");s(d,"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()});s(d,"getSignature",function(){if(null==this.typeName)return JS.T.nameOf(this.tok);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()});s(d,"geTokens",function(){return this.aatoken});s(d,"getName",function(){return this.name});s(d,"getTok",function(){return this.tok})});L("JS");M(["JS.ScriptException"],"JS.ScriptInterruption",null,function(){var d=$(JS,"ScriptInterruption",JS.ScriptException);R(d,function(a,b,c){V(this,JS.ScriptInterruption,[a,b,"!",-2147483648==c||a.vwr.autoExit]);b.equals("delay")&&a.delayScript(c)},"JS.ScriptEval,~S,~N")});L("JS");
M(["J.api.JmolScriptManager","JU.Lst"],"JS.ScriptManager","java.util.Hashtable JU.AU $.PT $.Rdr $.SB J.api.Interface J.i18n.GT JS.ScriptQueueThread JU.Elements $.Logger JV.FileManager".split(" "),function(){var d=Q(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;O(this,arguments)},JS,"ScriptManager",null,J.api.JmolScriptManager);X(d,function(){this.queueThreads=
Array(2);this.scriptQueueRunning=ca(2,!1);this.scriptQueue=new JU.Lst});R(d,function(){});s(d,"getScriptQueue",function(){return this.scriptQueue});s(d,"isScriptQueued",function(){return this.$isScriptQueued});s(d,"setViewer",function(a){this.vwr=a;this.eval=this.newScriptEvaluator();this.eval.setCompiler();return this.eval},"JV.Viewer");f(d,"newScriptEvaluator",function(){return J.api.Interface.getInterface("JS.ScriptEval",this.vwr,"setOptions").setViewer(this.vwr)});s(d,"clear",function(a){a?(this.startCommandWatcher(!1),
this.interruptQueueThreads()):this.evalTemp=null},"~B");f(d,"addScript",function(a,b,c){return this.addScr("String",a,b,"",c)},"~S,~A,~B");f(d,"addScr",function(a,b,c,e,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 f=0;f<b.length;f++)this.addScr(a,
b[f],c,e,d);return"split into "+b.length+" sections for processing"}var f=null!=this.commandWatcherThread&&(0>b.indexOf("javascript")||0<=b.indexOf("#javascript ")),h=new JU.Lst;h.addLast(b);h.addLast(e);h.addLast(a);h.addLast(d?Boolean.TRUE:Boolean.FALSE);h.addLast(Integer.$valueOf(f?-1:1));h.addLast(c);this.scriptQueue.addLast(h);this.startScriptQueue(!1);return"pending"},"~S,~S,~A,~S,~B");s(d,"clearQueue",function(){this.scriptQueue.clear()});s(d,"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(!D(b,"InterruptedException"))throw b;}});s(d,"isQueueProcessing",function(){return null!=this.queueThreads[0]||null!=this.queueThreads[1]});f(d,"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.removeItemAt(b),
JU.Logger.debugging&&JU.Logger.debug(this.scriptQueue.size()+" scripts; removed: "+c))}},"~S");f(d,"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");s(d,"getScriptItem",function(a,b){if(this.vwr.isSingleThreaded&&this.vwr.queueOnHold)return null;var c=this.scriptQueue.get(0),e=c.get(4).intValue();return(a?0>e:b?0==e:1==e)?c:null},"~B,~B");s(d,"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");f(d,"interruptQueueThreads",
function(){for(var a=0;a<this.queueThreads.length;a++)null!=this.queueThreads[a]&&this.queueThreads[a].interrupt()});f(d,"clearCommandWatcherThread",function(){null!=this.commandWatcherThread&&(this.commandWatcherThread.interrupt(),this.commandWatcherThread=null)});s(d,"queueThreadFinished",function(a){0>a?(this.queueThreadFinished(0),this.queueThreadFinished(1)):null!=this.queueThreads[a]&&(this.queueThreads[a].interrupt(),this.scriptQueueRunning[a]=!1,this.queueThreads[a]=null,this.vwr.setSyncDriver(4),
this.vwr.queueOnHold=!1)},"~N");f(d,"runScriptNow",function(){if(0<this.scriptQueue.size()){var a=this.getScriptItem(!0,!0);null!=a&&(a.set(4,Integer.$valueOf(0)),this.startScriptQueue(!0))}});s(d,"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.evalFileArgs(a,null)},"~S");s(d,"evalFileArgs",function(a,b){return this.addScript("script "+JU.PT.esc(a)+(null==b?"":"("+b+")"),null,!1)},"~S,~S");
s(d,"evalStringWaitStatusQueued",function(a,b,c,e,d){return this.evalStringWaitParamsStatusQueued(a,b,null,c,e,d)},"~S,~S,~S,~B,~B");f(d,"evalStringWaitParamsStatusQueued",function(a,b,c,e,d,f){if(null==b)return null;var h=this.checkScriptExecution(b,!1);if(null!=h)return h;if(this.vwr.checkConsoleScript(b))return null;var j=null==e||e.equals("output")?new JU.SB:null,h=this.vwr.sm.statusList;this.vwr.getStatusChanged(e);this.vwr.isSyntaxCheck&&JU.Logger.info("--checking script:\n"+this.eval.getScript()+
"\n----\n");var l=0==b.indexOf(")");l&&(b=b.substring(1));l=l||!f;this.vwr.setErrorMessage(null,null);var r=f&&null==c?this.eval:this.newScriptEvaluator(),m=r.compileScriptString(b,d),k=r.getErrorMessage(),p=r.getErrorMessageUntranslated();this.vwr.setErrorMessage(k,p);this.vwr.refresh(7,"script complete");m?(this.$isScriptQueued=f,d||this.vwr.setScriptStatus(null,b,-2-++this.scriptIndex,null),r.evaluateCompiledScript(c,this.vwr.isSyntaxCheck,this.vwr.isSyntaxAndFileCheck,l,this.vwr.listCommands,
j,f)):(this.vwr.scriptStatus(k),this.vwr.setScriptStatus("Jmol script terminated",k,1,p),r.isStateScript()&&JS.ScriptManager.setStateScriptVersion(this.vwr,null));null!=k&&this.vwr.autoExit&&this.vwr.exitJmol();this.vwr.isSyntaxCheck&&(null==k?JU.Logger.info("--script check ok"):JU.Logger.error("--script check error\n"+p),JU.Logger.info("(use 'exit' to stop checking)"));this.$isScriptQueued=!0;if(a.equalsIgnoreCase("String"))return p;if(null!=j)return null==p?j.toString():p;a=this.vwr.getProperty(a,
"jmolStatus",e);this.vwr.getStatusChanged(h);return a},"~S,~S,~A,~S,~B,~B");f(d,"checkScriptExecution",function(a,b){var c=a,e=c.indexOf("; ## GUI ##");if(0<=e)c=c.substring(0,e);else if(0<=(e=c.indexOf("\u0001##")))c=c.substring(0,e);if(this.checkResume(c))return"script processing resumed";if(this.checkStepping(c))return"script processing stepped";if(this.checkHalt(c,b))return"script execution halted";this.vwr.wasmInchiHack(a);return null},"~S,~B");f(d,"checkResume",function(a){return a.equalsIgnoreCase("resume")?
(this.vwr.scriptStatusMsg("","execution resumed"),this.eval.resumePausedExecution(),!0):!1},"~S");f(d,"checkStepping",function(a){return a.equalsIgnoreCase("step")?(this.eval.stepPausedExecution(),!0):a.equalsIgnoreCase("?")?(this.vwr.scriptStatus(this.eval.getNextStatement()),!0):!1},"~S");s(d,"evalStringQuietSync",function(a,b,c){return this.evalStringParamsQuietSync(a,null,b,c)},"~S,~B,~B");f(d,"evalStringParamsQuietSync",function(a,b,c,e){e&&(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 "));(e=null==b&&0<a.length&&"!"==a.charAt(0))&&(a=a.substring(1));var d=this.checkScriptExecution(a,e);if(null!=d)return d;if(this.vwr.isScriptExecuting()&&(e||this.eval.isPaused()))return this.vwr.setInsertedCommand(a),0==a.indexOf("moveto ")&&this.flushQueue("moveto "),"!"+a;this.vwr.setInsertedCommand("");c&&null==b&&(a+="\u0001## EDITOR_IGNORE ##");return this.addScript(a,b,c&&!this.vwr.getBoolean(603979879))},
"~S,~A,~B,~B");s(d,"checkHalt",function(a,b){if(a.equalsIgnoreCase("pause")||a.equalsIgnoreCase("pause\u0001##"))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,e=null;a.startsWith("exit")?(this.vwr.haltScriptExecution(),this.vwr.clearScriptQueue(),this.vwr.clearTimeouts(),c=a.equals(e=
"exit")):a.startsWith("quit")&&(this.vwr.haltScriptExecution(),c=a.equals(e="quit"));if(null==e)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?e+" -- stops script checking":(b?"!":"")+e+" received");this.vwr.isSyntaxCheck=!1;return c},"~S,~B");s(d,"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");s(d,"scriptCheckRet",function(a,b){if(0==a.indexOf(")")||0==a.indexOf("!"))a=a.substring(1);a=this.vwr.wasmInchiHack(a);var c=this.newScriptEvaluator().checkScriptSilent(a);return b||null==c.errorMessage?c:c.errorMessage},"~S,~B");s(d,"openFileAsync",function(a,b,c){var e=0!=(b&32);!e&&(0!=(b&64)&&JV.FileManager.isEmbeddable(a))&&this.checkResize(a);var d=0!=(b&2),f=0!=(b&8),h=null;a=a.trim().$replace("\\","/");var j=a.startsWith("cache://");this.vwr.isApplet&&
0>a.indexOf("://")&&(a="file://"+(a.startsWith("/")?"":"/")+a);try{if(e)h="script "+JU.PT.esc(a);else if(a.endsWith(".pse"))h=(j?"":"zap;")+"load SYNC "+JU.PT.esc(a)+(this.vwr.isApplet?"":" filter 'DORESIZE'");else{if(a.endsWith("jvxl"))h="isosurface ";else if(!a.toLowerCase().endsWith(".spt")){null==c?c=this.getDragDropFileTypeName(a):c.endsWith("::")||(c+="::");if(null==c){try{var l=this.vwr.getBufferedInputStream(a);c=JV.FileManager.determineSurfaceFileType(JU.Rdr.getBufferedReader(l,"ISO-8859-1"));
if(null==c){h="script "+JU.PT.esc(a);return}}catch(r){if(D(r,"java.io.IOException"))return;throw r;}h="MENU"===c?"load MENU "+JU.PT.esc(a):"if (_filetype == 'Pdb') { isosurface sigma 1.0 within 2.0 {*} "+JU.PT.esc(a)+" mesh nofill }; else; { isosurface "+JU.PT.esc(a)+"}";return}if(c.equals("spt::")){h="script "+JU.PT.esc(a.startsWith("spt::")?a.substring(5):a);return}if(c.equals("dssr"))h="model {visible} property dssr ";else if(c.equals("Jmol"))h="script ";else if(c.equals("Cube"))h="isosurface sign red blue ";
else if(!c.equals("spt")){if(16==b)switch(b=1,0==this.vwr.ms.ac?0:this.vwr.confirm(J.i18n.GT.$("Would you like to replace the current model with the selected model?"),J.i18n.GT.$("Would you like to append?"))){case 2:return;case 0:break;default:b|=4}e=0!=(b&4);b=0!=(b&1)&&!e;if(c.endsWith("::")){var m=c.indexOf("|");0<=m&&(a+=c.substring(m,c.length-2),c="");a=c+a}h=this.vwr.g.defaultDropScript;h=JU.PT.rep(h,"%FILE",a);h=JU.PT.rep(h,"%ALLOWCARTOONS",""+b);if(h.toLowerCase().startsWith("zap")&&(j||
e))h=h.substring(3);e&&(h=JU.PT.rep(h,"load SYNC","load append"));System.out.println("###\n"+h+"\n###");return}}null==h&&!d&&this.vwr.scriptEditorVisible?this.vwr.showEditor(P(-1,[a,this.vwr.getFileAsString3(a,!0,null)])):h=(null==h?"script ":h)+JU.PT.esc(a)}}finally{null!=h&&this.vwr.evalString(h+(f?"#!NOAUTOPLAY":""))}},"~S,~N,~S");f(d,"checkResize",function(a){try{var b=this.vwr.fm.getEmbeddedFileState(a,!1,"state.spt");0<=b.indexOf("preferredWidthHeight")&&this.vwr.sm.resizeInnerPanelString(b)}catch(c){}},
"~S");f(d,"getDragDropFileTypeName",function(a){var b=a.indexOf("::");if(0<=b)return a.substring(0,b+2);if(a.startsWith("="))return"pdb";if(a.endsWith(".dssr"))return"dssr";var b=this.vwr.fm.getUnzippedReaderOrStreamFromName(a,null,!0,!1,!0,!0,null),c=null;if(this.vwr.fm.isZipStream(b)){a=this.vwr.getZipDirectoryAsString(a);if(0<=a.indexOf("JmolManifest"))return"Jmol";c=this.vwr.getModelAdapter().getFileTypeName(JU.Rdr.getBR(a))}else if(u(b,"java.io.BufferedReader")||u(b,"java.io.BufferedInputStream"))c=
this.vwr.getModelAdapter().getFileTypeName(b);return null!=c?c+"::":JU.AU.isAS(b)?b[0]:null},"~S");d.setStateScriptVersion=f(d,"setStateScriptVersion",function(a,b){if(null!=b){JS.ScriptManager.prevCovalentVersion=JU.Elements.bondingVersion;var c=JU.PT.getTokens(b.$replace("."," ").$replace("_"," "));try{var e=JU.PT.parseInt(c[0]),d=JU.PT.parseInt(c[1]),f=JU.PT.parseInt(c[2]);-2147483648==f&&(f=0);if(-2147483648!=e&&-2147483648!=d){var h=a.stateScriptVersionInt=1E4*e+100*d+f;a.setBooleanProperty("legacyautobonding",
110924>h);a.setBooleanProperty("legacyHAddition",130117>h);a.getBoolean(603979831)||a.setBooleanProperty("legacyjavafloat",140206>h||140300<=h&&140306>h);a.setIntProperty("bondingVersion",140111>h?0:1);return}}catch(j){if(!D(j,Exception))throw j;}}a.setIntProperty("bondingVersion",JS.ScriptManager.prevCovalentVersion);a.setBooleanProperty("legacyautobonding",!1);a.setBooleanProperty("legacyHAddition",!1);a.stateScriptVersionInt=2147483647},"JV.Viewer,~S");s(d,"addHydrogensInline",function(a,b,c,e){a=
a.nextSetBit(0);null==e&&(e=new java.util.Hashtable);a=0>a?this.vwr.am.cmi:this.vwr.ms.at[a].mi;0>a&&(a=this.vwr.ms.mc-1);e.put("appendToModelIndex",Integer.$valueOf(a));var d=e.containsKey("fixedSite"),f=this.vwr.getModelUndeletedAtomsBitSet(a),h=this.vwr.g.appendNew;this.vwr.g.appendNew=!1;for(var j=0,l=f.nextSetBit(0);0<=l;l=f.nextSetBit(l+1)){var r=this.vwr.ms.at[l].getAtomNumber();r>j&&(j=r)}for(var r=new JU.SB,l=0,m=this.vwr.ms.ac;l<b.size();l++,m++){var k=b.get(l);null!=k&&r.append(";  connect 0 100 ").append("({"+
m+"}) ").append("({"+k.i+"}) group;")}b=new JU.SB;b.appendI(c.length).append("\n").append("Viewer.AddHydrogens").append("#noautobond").append("\n");for(l=0;l<c.length;l++)b.append("H ").appendF(c[l].x).append(" ").appendF(c[l].y).append(" ").appendF(c[l].z).append(" - - - - ").appendI(++j).appendC("\n");this.vwr.openStringInlineParamsAppend(b.toString(),e,!0);0<r.length()&&this.vwr.runScript(r.toString());c=this.vwr.getModelUndeletedAtomsBitSet(a);c.andNot(f);this.vwr.g.appendNew=h;d||(f=this.vwr.ms.am[a].bsAsymmetricUnit,
null!=f&&f.or(c));return c},"JU.BS,JU.Lst,~A,java.util.Map");s(d,"evalCallback",function(a,b,c){c?this.evalStringWaitParamsStatusQueued("String",a,b,"",!0,!0):this.evalStringParamsQuietSync(a,b,!0,!0)},"~S,~A,~B");f(d,"runScriptFromThread",function(a){var b=a.get(0),c=a.get(1),e=a.get(2),d=a.get(3).booleanValue();a=a.get(5);this.evalStringWaitParamsStatusQueued(e,b,a,c,d,!0)},"JU.Lst");d.prevCovalentVersion=0});L("JS");M(null,"JS.ScriptMathProcessor","java.util.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(){var d=Q(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;O(this,arguments)},JS,"ScriptMathProcessor",null);X(d,function(){this.oStack=Array(8);this.xStack=Array(8);this.ifStack=da(8,"\x00")});R(d,function(a,b,c,e,d,f,h){this.eval=a;this.isAssignment=(this.isSpecialAssignment=this.assignLeft=b)||null!=h;this.vwr=a.vwr;this.debugHigh=a.debugHigh;this.chk=this.wasSyntaxCheck=a.chk;this.isArrayItem=c;this.asVector=e||c;this.asBitSet=d;this.allowUnderflow=f;this.wasX=c;this.debugHigh&&JU.Logger.debug("initialize RPN")},"JS.ScriptExpr,~B,~B,~B,~B,~B,~S");
f(d,"endAssignment",function(){return this.doSelections=this.assignLeft=!1});f(d,"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.removeItemAt(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});f(d,"putX",function(a){if(!this.skipping){if(this.wasX)try{this.addOp(JS.T.tokenComma)}catch(b){if(!D(b,
"JS.ScriptException"))throw b;}++this.xPt==this.xStack.length&&(this.xStack=JU.AU.doubleLength(this.xStack));0>this.xPt&&System.out.println("testing scriptemaafe");this.xStack[this.xPt]=a;this.ptx=++this.ptid;this.debugHigh&&JU.Logger.debug("\nputx= "+a+" ptx="+this.ptid)}},"JS.SV");f(d,"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");
f(d,"putIf",function(a){++this.ifPt>=this.ifStack.length&&(this.ifStack=JU.AU.doubleLength(this.ifStack));this.ifStack[this.ifPt]=a},"~S");f(d,"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");f(d,"addX",function(a){this.putX(a);return this.wasX=!0},"JS.SV");f(d,"addXObj",function(a){a=JS.SV.getVariable(a);if(null==a)return!1;this.putX(a);return this.wasX=!0},"~O");f(d,"addXStr",function(a){this.putX(JS.SV.newS(a));
return this.wasX=!0},"~S");f(d,"addXBool",function(a){this.putX(JS.SV.getBoolean(a));return this.wasX=!0},"~B");f(d,"addXInt",function(a){this.putX(JS.SV.newI(a));return this.wasX=!0},"~N");f(d,"addXList",function(a){this.putX(JS.SV.getVariableList(a));return this.wasX=!0},"JU.Lst");f(d,"addXMap",function(a){this.putX(JS.SV.getVariableMap(a));return this.wasX=!0},"java.util.Map");f(d,"addXM3",function(a){this.putX(JS.SV.newV(11,a));return this.wasX=!0},"JU.M3");f(d,"addXM4",function(a){this.putX(JS.SV.newV(12,
a));return this.wasX=!0},"JU.M4");f(d,"addXFloat",function(a){this.putX(JS.SV.newF(a));return this.wasX=!0},"~N");f(d,"addXBs",function(a){this.putX(JS.SV.newV(10,a));return this.wasX=!0},"JU.BS");f(d,"addXPt",function(a){this.putX(JS.SV.newV(8,a));return this.wasX=!0},"JU.P3");f(d,"addXPt4",function(a){this.putX(JS.SV.newV(9,a));return this.wasX=!0},"JU.P4");f(d,"addXNum",function(a){if(!u(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.newF(-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");f(d,"addXAV",function(a){this.putX(JS.SV.getVariableAV(a));return this.wasX=!0},"~A");f(d,"addXAD",function(a){this.putX(JS.SV.getVariableAD(a));return this.wasX=!0},"~A");f(d,"addXAS",function(a){this.putX(JS.SV.getVariableAS(a));return this.wasX=!0},"~A");f(d,"addXAI",function(a){this.putX(JS.SV.getVariableAI(a));
return this.wasX=!0},"~A");f(d,"addXAII",function(a){this.putX(JS.SV.getVariableAII(a));return this.wasX=!0},"~A");f(d,"addXAF",function(a){this.putX(JS.SV.getVariableAF(a));return this.wasX=!0},"~A");f(d,"addXAFF",function(a){this.putX(JS.SV.getVariableAFF(a));return this.wasX=!0},"~A");d.isOpFunc=f(d,"isOpFunc",function(a){return null!=a&&(JS.T.tokAttr(a.tok,134217728)&&a!==JS.T.tokenArraySquare||268442113==a.tok&&JS.T.tokAttr(a.intValue,134217728))},"JS.T");f(d,"addOp",function(a){return this.addOpAllowMath(a,
!0,0)},"JS.T");f(d,"addOpAllowMath",function(a,b,c){this.debugHigh&&this.dumpStacks("adding "+a+" wasx="+this.wasX);var e=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,e);var d=268442113==a.tok;if(d&&!this.wasX)return!1;var f=b&&JS.ScriptMathProcessor.isOpFunc(a);1<=this.oPt&&(268435968!=a.tok&&134217750==e)&&(e=this.oStack[--this.oPt].tok);var h=null,j=!1;switch(a.tok){case 1073742195:return this.haveSpaceBeforeSquare=
!0;case 268436992:if(!this.wasX)return!1;break;case 268441601:case 268441602:if(this.wasX&&-1==a.intValue&&this.addOp(JS.T.tokenComma))return this.addOp(a);break;case 268437505:break;case 268435969:if(!this.wasX&&1<=this.oPt&&268435968==e&&!JS.ScriptMathProcessor.isOpFunc(this.oStack[this.oPt-1]))return!1;break;case 268440576:this.wasX||(a=JS.SV.newV(268441600,"-"));break;case 1275068725:case 32:case 64:case 96:case 128:case 160:case 192:case 480:e=0>this.oPt?0:e;if(!this.wasX||!(268442113==e||1677721602==
e||1153433601==e))return!1;this.oStack[this.oPt].intValue|=a.tok;return!0;case 268437504:j=!0;if(!this.wasX||this.haveSpaceBeforeSquare)this.squareCount++,a=h=JS.T.tokenArraySquare,this.haveSpaceBeforeSquare=!1;break;case 268439040:case 268435968:j=!0;default:if(f){f=1<=this.oPt&&268435968==e;if(d){if(268435968==c&&6==this.xStack[this.xPt].tok)return!1}else if(this.wasX&&!f)return!1;h=a;j=!0;break}if(this.wasX==j&&268442113!=e){if(!this.wasX||!b)return!1;if(this.addOp(JS.T.tokenComma))return this.addOp(a)}}for(;0<=
this.oPt&&268436482!=e&&(268441601!=a.tok&&268441602!=a.tok||this.wasX)&&(!j||268442113==e&&(268442113==a.tok||268437504==a.tok))&&JS.T.getPrecedence(e)>=JS.T.getPrecedence(a.tok)&&(268441600!=e||268441600!=a.tok);){if(268435969==a.tok&&268435968==e){0<=this.xPt&&(this.xStack[this.xPt]=JS.SV.selectItemVar(this.xStack[this.xPt]));this.wasX=!0;break}if(268437505==a.tok&&1275068418==e)break;if(268437505==a.tok&&268437504==e){if(this.isArrayItem&&1==this.squareCount&&0==this.equalCount){this.wasX=!1;
this.addX(JS.SV.newT(JS.T.tokenArrayOpen));break}if(!this.doSelection())return!1;this.wasX=!0;break}if(!this.operate())return!1;e=0<=this.oPt&&null!=this.oStack[this.oPt]?this.oStack[this.oPt].tok:0}null!=h&&(this.wasX=!1,this.addX(JS.SV.newV(268440324,h)));switch(a.tok){case 268435968:this.parenCount++;this.wasX=!1;break;case 805307393:return a=this.getX().asBoolean(),268436482==e?this.ifPt--:this.putOp(JS.T.tokenColon),this.putIf(a?"T":"F"),this.skipping=!a,this.wasX=!1,!0;case 268436482:if(268436482!=
e||0>this.ifPt)return!1;this.ifStack[this.ifPt]="X";this.wasX=!1;return this.skipping=!0;case 268435969:this.wasX=!0;if(0>=this.parenCount--)return!1;268436482==e&&(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 268436992:return this.wasX=!1,!0;case 268437504:this.squareCount++;this.wasX=!1;break;case 268437505:this.wasX=
!0;if(0>=this.squareCount--||0>this.oPt||!this.doSelections)return!this.doSelections;if(1275068418==this.oStack[this.oPt].tok)return this.evaluateFunction(268437504);this.oPt--;return!0;case 268442113:this.wasX=!b||!JS.T.tokAttr(a.intValue,134217728);break;case 1073742332:this.braceCount++;this.wasX=!1;break;case 1073742338:if(0>=this.braceCount--)return!1;this.wasX=!1;break;case 268438528:case 268438016:if(!this.wasSyntaxCheck&&0>this.xPt)return!1;!this.wasSyntaxCheck&&(10!=this.xStack[this.xPt].tok&&
7!=this.xStack[this.xPt].tok)&&(e=this.getX().asBoolean(),this.addX(JS.SV.getBoolean(e)),e==(268438016==a.tok)&&(this.chk=!0,a=268438016==a.tok?JS.T.tokenOrTRUE:JS.T.tokenAndFALSE));this.wasX=!1;break;case 268441602:case 268441601:break;case 268440324: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 268442113:return 134320141==(a.intValue&-481)&&134320141!=a.intValue?this.evaluateFunction(0):!0;
case 268441602:case 268441601:return this.wasX?this.operate():!0}return!0},"JS.T,~B,~N");f(d,"checkSkip",function(a,b){switch(a.tok){case 268435968:this.putOp(a);break;case 268436482:if(268436482!=b||"X"==this.ifStack[this.ifPt])break;this.ifStack[this.ifPt]="T";this.skipping=this.wasX=!1;break;case 268435969:if(268435968==b){this.oPt--;break}if(268436482!=b){this.putOp(a);break}this.wasX=!0;this.ifPt--;this.oPt-=2;this.skipping=!1}return!0},"JS.T,~N");f(d,"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});f(d,"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");f(d,"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});f(d,"getXTok",function(){return 0>this.xPt?0:this.xStack[this.xPt].tok});f(d,"evaluateFunction",function(a){var b=this.oStack[this.oPt--];0==a&&
(a=268442113==b.tok?b.intValue&-481:b.tok);for(var c=JS.T.getMaxMathParams(a),e=0,d=this.xPt;0<=d&&this.xStack[d--].value!==b;)e++;if(0<c&&e>c)return!1;for(c=Array(e);0<=--e;)c[e]=this.getX();this.xPt--;if(!this.chk)return this.eval.getMathExt().evaluate(this,b,c,a);268442113==b.tok&&this.xPt--;0>this.xPt&&(this.xPt=0);switch(a){case 134217736:case 1275203608:case 134218756:case 134218757:case 134217759:case 134353926:return this.addXBs(new JU.BS)}return this.addXBool(!0)},"~N");f(d,"operate",function(){var a=
this.oStack[this.oPt--],b;this.debugHigh&&this.dumpStacks("operate: "+a);if(268440324==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;switch(a.tok){case 268441601:case 268441602:if(0<=this.xPt&&this.xStack[this.xPt].canIncrement()){c=this.xStack[this.xPt--];this.wasX=!1;break}default:c=this.getX()}if(c===JS.T.tokenArrayOpen)return!1;switch(a.tok){case 268441601:case 268441602:b=c;if(!this.chk){this.ptx<this.pto&&
(b=JS.SV.newS("").setv(c));if(!c.increment(268441602==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 268441600: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(c.value,
u(c.value,"JM.BondSet")?this.vwr.ms.bondCount:this.vwr.ms.ac))}return this.addXFloat(-c.asFloat());case 268439040: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 a=u(c.value,"JM.BondSet"),c=JU.BSUtil.copyInvert(c.value,a?this.vwr.ms.bondCount:this.vwr.ms.ac),this.addXBs(a?JM.BondSet.newBS(c):
c);default:return this.addXBool(!c.asBoolean())}case 268442113:b=805307393==a.intValue?805307393: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 1275068418:case 1140850706:case 1140850694:case 1140850696:break;default:return a=c.mapValue(a.value),this.addXObj(null==a?JS.SV.newS(""):a)}}switch(b){case 1275068418:return this.addX(c.toArray());case 805307393:case 1073741824:return 10==c.tok&&(this.chk?this.addXStr(""):
this.getAllProperties(c,a.value));case 1140850696:return this.addXStr(JS.ScriptMathProcessor.typeOf(c));case 1140850706:return a=c.getKeys(480==(a.intValue&480)),null==a?this.addXStr(""):this.addXAS(a);case 1140850691:if(8==c.tok)return this.addXFloat(c.value.distance(JS.SV.pt0));case 1275068425:case 1140850694:if(1140850691==b&&u(c.value,"JM.BondSet"))break;return this.addXInt(JS.SV.sizeOf(c));case 1140850692: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 1765808134: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 1812599299: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)),!u(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)});f(d,"binaryOp",function(a,b,c){var e,d;switch(a.tok){case 268439552:case 268438528:switch(b.tok){case 10:var f=b.value;switch(c.tok){case 2:return a=c.asInt(),this.addXBool(0>a?!1:f.get(a));
case 10:return f=JU.BSUtil.copy(f),f.and(c.value),this.addXBs(u(b.value,"JM.BondSet")?JM.BondSet.newBS(f):f)}}return this.addXBool(b.asBoolean()&&c.asBoolean());case 268438016:switch(b.tok){case 10:f=null;switch(c.tok){case 10:f=JU.BSUtil.copy(b.value);f.or(c.value);break;case 2:f=JU.BSUtil.copy(b.value);a=c.asInt();0<=a&&f.set(a);break;case 7:f=JU.BSUtil.copy(b.value);d=c.value;for(a=d.size();0<=--a;)e=d.get(a).asInt(),0<=e&&f.set(e)}if(null==f)break;return this.addXBs(u(b.value,"JM.BondSet")?JM.BondSet.newBS(f):
f);case 7:return this.addX(JS.SV.concatList(b,c,!1))}return this.addXBool(b.asBoolean()||c.asBoolean());case 268438017:if(10==b.tok&&10==c.tok)return f=JU.BSUtil.copy(b.value),f.xor(c.value),this.addXBs(u(b.value,"JM.BondSet")?JM.BondSet.newBS(f):f);b=b.asBoolean();e=c.asBoolean();return this.addXBool(b&&!e||e&&!b);case 268438018:return 10!=b.tok||10!=c.tok?!1:this.addXBs(JU.BSUtil.toggleInPlace(JU.BSUtil.copy(b.value),c.value));case 268440322:return this.addXBool(2==b.tok&&2==c.tok?b.intValue<=c.intValue:
b.isNaN()&&c.isNaN()||b.asFloat()<=c.asFloat());case 268440321:return this.addXBool(2==b.tok&&2==c.tok?b.intValue>=c.intValue:b.isNaN()&&c.isNaN()||b.asFloat()>=c.asFloat());case 268440320:return this.addXBool(2==b.tok&&2==c.tok?b.intValue>c.intValue:b.asFloat()>c.asFloat());case 268440323:return this.addXBool(2==b.tok&&2==c.tok?b.intValue<c.intValue:b.asFloat()<c.asFloat());case 268440324:return this.addXBool(JS.SV.areEqual(b,c));case 268440325:return this.addXBool(!JS.SV.areEqual(b,c));case 268440326:return this.addXBool(JS.SV.isLike(b,
c));case 268440577:switch(b.tok){case 6:return b=new java.util.Hashtable(b.value),c=c.getMap(),null!=c&&b.putAll(c),this.addX(JS.SV.getVariableMap(b));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 e=c.value,a.add(JU.P3.new3(e.x,e.y,e.z)),this.addXPt(a);default:return e=c.asFloat(),this.addXPt(JU.P3.new3(a.x+
e,a.y+e,a.z+e))}case 11:switch(c.tok){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))}break;case 12:switch(c.tok){case 8:return a=JU.M4.newM4(b.value),a.add(c.value),this.addXM4(a)}break;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 268440576: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 e=c.value,a.sub(JU.P3.new3(e.x,e.y,e.z)),this.addXPt(a)}e=c.asFloat();return this.addXPt(JU.P3.new3(a.x-e,a.y-e,a.z-e));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 1275068930: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 268441089: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||12==b.tok?this.ptValue(c,null):11==c.tok?this.ptValue(b,null):null;e=12==b.tok?this.eval.planeValue(c):12==c.tok?this.eval.planeValue(b):null;switch(c.tok){case 11:if(null!=
a)return c=JU.M3.newM3(c.value),c.transpose(),e=JU.P3.newP(a),c.rotate(e),7==b.tok?this.addX(JS.SV.getVariableAF(S(-1,[e.x,e.y,e.z]))):this.addXPt(e);if(null!=e)return this.addXPt4(JU.Quat.newP4(e).mulQ(JU.Quat.newM(c.value)).toPoint4f());break;case 12:if(null!=e)return a=JU.M4.newM4(c.value),a.transpose(),c=JU.P4.newPt(e),a.transform(c),7==b.tok?this.addX(JS.SV.getVariableAF(S(-1,[c.x,c.y,c.z,c.w]))):this.addXPt4(c)}switch(b.tok){case 11:f=b.value;if(null!=a)return e=JU.P3.newP(a),f.rotate(e),7==
c.tok?this.addX(JS.SV.getVariableAF(S(-1,[e.x,e.y,e.z]))):this.addXPt(e);switch(c.tok){case 11:return b=JU.M3.newM3(c.value),b.mul2(f,b),this.addXM3(b);case 9:return this.addXM3(JU.Quat.newM(f).mulQ(JU.Quat.newP4(c.value)).getMatrix());case 7:c=c.getList();d=new JU.Lst;for(a=c.size();0<=--a;){e=JS.SV.ptValue(c.get(a));if(null==e)return!1;e=JU.P3.newP(e);f.rotate(e);d.addLast(e)}return this.addXList(d)}e=c.asFloat();c=new JU.A4;c.setM(f);c.angle*=e;return this.addXM3((new JU.M3).setAA(c));case 12:b=
b.value;if(null!=a)return e=JU.P3.newP(a),b.rotTrans(e),7==c.tok?this.addX(JS.SV.getVariableAF(S(-1,[e.x,e.y,e.z]))):this.addXPt(e);if(null!=e)return b.transform(e),7==c.tok?this.addX(JS.SV.getVariableAF(S(-1,[e.x,e.y,e.z,e.w]))):this.addXPt4(e);switch(c.tok){case 12:return a=JU.M4.newM4(c.value),a.mul2(b,a),this.addXM4(a);case 7:c=c.getList();d=new JU.Lst;for(a=c.size();0<=--a;)e=JU.P3.newP(JS.SV.ptValue(c.get(a))),b.rotTrans(e),d.addLast(e);return this.addXList(d)}return this.addXFloat(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)}e=c.asFloat();return this.addXPt(JU.P3.new3(a.x*e,a.y*e,a.z*e));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 268441088:switch(b.tok){case 2:if(2==c.tok&&0!=c.intValue)return this.addXInt(T(b.intValue/c.intValue));f=this.isDecimal(c)?
0:c.asInt();if(0!=f)return this.addXInt(T(b.intValue/f));break;case 4:if(!this.isDecimal(b)&&!this.isDecimal(c)&&0!=(e=c.asInt()))return this.addXInt(T(b.asInt()/e));break;case 8:return a=JU.P3.newP(b.value),this.addXPt(0==(f=c.asFloat())?JU.P3.new3(NaN,NaN,NaN):JU.P3.new3(a.x/f,a.y/f,a.z/f));case 9:return this.addXPt4(9==c.tok?JU.Quat.newP4(b.value).div(JU.Quat.newP4(c.value)).toPoint4f():0==(f=c.asFloat())?JU.P4.new4(NaN,NaN,NaN,NaN):JU.Quat.newP4(b.value).mul(1/f).toPoint4f())}return this.addXFloat(b.asFloat()/
c.asFloat());case 268441091:return e=c.asFloat(),9==b.tok?0==e?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/e).toPoint4f()):this.addXInt(0==e?0:T(Math.floor(b.asFloat()/c.asFloat())));case 268441603:return e=Math.pow(b.asFloat(),c.asFloat()),2==b.tok&&2==c.tok?this.addXInt(F(e)):this.addXFloat(e);case 268441090:d=null;f=c.asInt();switch(b.tok){case 3:e=b.asFloat();if(0==
f)return this.addXInt(Math.round(e));d=JU.DF.formatDecimal(e,f);return this.addXStr(d);case 4:return d=b.value,this.addXStr(0==f?JU.PT.trim(d,"\n\t "):9999==f?d.toUpperCase():-9999==f?d.toLowerCase():0<f?JU.PT.formatS(d,f,f,!1,!1):JU.PT.formatS(d,f,f-1,!0,!1));case 7:c=JS.SV.strListValue(b);for(a=0;a<c.length;a++)c[a]=0==f?c[a].trim():0<f?JU.PT.formatS(c[a],f,f,!0,!1):JU.PT.formatS(d,-f,f,!1,!1);return this.addXAS(c);case 8:return a=JU.P3.newP(b.value),this.vwr.toUnitCell(a,JU.P3.new3(f,f,f)),this.addXPt(a);
case 9:e=b.value;if(8==c.tok)return this.addXPt(JU.Quat.newP4(e).transform2(c.value,new JU.P3));if(9==c.tok)return c=JU.P4.newPt(c.value),JU.Quat.newP4(e).getThetaDirected(c),this.addXPt4(c);0==f&&4==c.tok&&(d=" "+c.value.toString().trim().toLowerCase()+":",a=" 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(d),f=0<=a?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(a+
d.length)):-99);switch(f){case 0:return this.addXFloat(e.w);case 1:return this.addXFloat(e.x);case 2:return this.addXFloat(e.y);case 3:return this.addXFloat(e.z)}c=JU.Quat.newP4(e);switch(f){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 11:switch(c=b.value,f){case 1:return this.addXFloat(c.m00+c.m11+c.m22);case 2:return this.addXFloat(c.determinant3());default:return!1}case 12:switch(b=b.value,f){case 1:return f=new JU.M3,b.getRotationScale(f),this.addXM3(f);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,f))}return this.addXInt(0==f?b.asInt():b.asInt()%f)}return!0},"JS.T,JS.SV,JS.SV");f(d,"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");f(d,"ptValue",function(a,b){var c;switch(a.tok){case 8:return a.value;case 10:c=a.value;if(c.isEmpty()||u(c,"JM.BondSet"))break;null!=b&&(c=JU.BSUtil.copy(c),c.and(b));return c.isEmpty()?
null:this.eval.getBitsetProperty(c,null,1145047050,null,null,a.value,null,!1,2147483647,!1);case 4:c=JU.Escape.uP(JS.SV.sValue(a));if(u(c,"JU.P3"))return c;break;case 7:if(c=JU.Escape.uP("{"+JS.SV.sValue(a).$replace("]"," ").$replace("["," ")+"}"),u(c,"JU.P3"))return c}return null},"JS.SV,JU.BS");d.typeOf=f(d,"typeOf",function(a){var b=null==a?0:a.tok;switch(b){case 1073742335:case 1073742334:return"boolean";case 10:return u(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");f(d,"getAllProperties",function(a,b){var c=a.value,e,d=c.cardinality();if(0==d||!b.endsWith("?")||null==(e=JS.T.getAtomPropertiesLike(b.substring(0,b.length-1))))return this.addXStr("");for(var f=new java.util.Hashtable,d=1==d?c.nextSetBit(0):2147483647,h=e.size();0<=--h;){var j=e.get(h),l=j.tok;switch(l){case 1094717448:case 1094713349:continue;default:2147483647==d&&(l|=480),f.put(j.value,JS.SV.getVariable(this.eval.getBitsetProperty(c,null,l,null,null,null,null,!1,d,!0)))}}return this.addXMap(f)},
"JS.SV,~S");d.getMatrix4f=f(d,"getMatrix4f",function(a,b){return JU.M4.newMV(a,null==b?new JU.V3:JU.V3.newV(b))},"JU.M3,JU.T3");f(d,"getBoundBox",function(a){if(10!=a.tok||u(a.value,"JM.BondSet"))return!1;a=this.vwr.ms.getBoxInfo(a.value,1).getBoundBoxPoints(!0);for(var b=new JU.Lst,c=0;4>c;c++)b.addLast(a[c]);return this.addXList(b)},"JS.SV");f(d,"getPointOrBitsetOperation",function(a,b){switch(b.tok){case 7:switch(a.intValue){case 32:case 64:case 96:case 192:case 128:case 160:case 1275068725:return this.addXObj(this.eval.getMathExt().getMinMax(b.getList(),
a.intValue,!0));case 1275334681:return this.addX(b.pushPop(null,null));case 1275068444:case 1140850693:return this.addX(b.sortOrReverse(1140850693==a.intValue?-2147483648:1))}for(var c=Array(b.getList().size()),e=0;e<c.length;e++){var d=JS.SV.unescapePointOrBitsetAsVariable(b.getList().get(e));if(!u(d,"JS.SV")||!this.getPointOrBitsetOperation(a,d))return!1;c[e]=this.xStack[this.xPt--]}return this.addXAV(c);case 8:switch(a.intValue){case 1111492609:case 1111492629:return this.addXFloat(b.value.x);
case 1111492610:case 1111492630:return this.addXFloat(b.value.y);case 1111492611:case 1111492631:return this.addXFloat(b.value.z);case 1145047050:return c=JU.P3.newP(b.value),this.vwr.toCartesian(c,!1),this.addXPt(c);case 1111492612:case 1111492613:case 1111492614:case 1145047051:return c=JU.P3.newP(b.value),this.vwr.toFractional(c,!1),1145047051==a.intValue?this.addXPt(c):this.addXFloat(1111492612==a.intValue?c.x:1111492613==a.intValue?c.y:c.z);case 1111492615:case 1111492616:case 1111492617:case 1145047053:return c=
JU.P3.newP(b.value),this.vwr.toFractional(c,!0),1145047053==a.intValue?this.addXPt(c):this.addXFloat(1111492615==a.intValue?c.x:1111492616==a.intValue?c.y:c.z);case 1111490577:case 1111490578:case 1111490579:case 1145045006:return c=JU.P3.newP(b.value),this.vwr.toUnitCell(c,null),this.vwr.toFractional(c,!1),1145045006==a.intValue?this.addXPt(c):this.addXFloat(1111490577==a.intValue?c.x:1111490578==a.intValue?c.y:c.z)}break;case 9:switch(a.intValue){case 1111492609:case 1111492629:return this.addXFloat(b.value.x);
case 1111492610:case 1111492630:return this.addXFloat(b.value.y);case 1111492611:case 1111492631:return this.addXFloat(b.value.z);case 1140850705:return this.addXFloat(b.value.w)}break;case 10:c=1677721602!=a.intValue;if(!c&&u(b.value,"JM.BondSet"))return this.addX(b);e=b.value;c&&(1==e.cardinality()&&0==(a.intValue&480))&&(a.intValue|=32);e=this.eval.getBitsetProperty(e,null,a.intValue,null,null,null,a.value,!1,b.index,!0);return c?this.addXObj(e):this.addXBs(JM.BondSet.newBS(e))}return!1},"JS.T,JS.SV")});
L("JS");M(["JS.ScriptError"],"JS.ScriptParam","java.util.Hashtable JU.BS $.CU $.Lst $.Measure $.P3 $.P4 $.PT $.Quat $.SB $.V3 JM.TickInfo JS.SV $.T JU.BSUtil $.Edge $.Escape $.Logger".split(" "),function(){var d=Q(function(){this.thisContext=this.contextFunctions=this.contextVariables=null;this.theTok=this.iToken=0;this.st=this.theToken=null;this.slen=0;this.fractionalPoint=null;this.isBondSet=this.coordinatesAreFractional=!1;O(this,arguments)},JS,"ScriptParam",JS.ScriptError);f(d,"getToken",function(a){this.checkToken(a)||
this.error(13);this.theToken=this.st[a];this.theTok=this.theToken.tok;return this.theToken},"~N");f(d,"tokAt",function(a){return a<this.slen&&null!=this.st[a]?this.st[a].tok:0},"~N");f(d,"checkToken",function(a){return(this.iToken=a)<this.slen},"~N");f(d,"getParameter",function(a,b,c){var e=this.getContextVariableAsVariable(a,!1);if(null==e)if(c)e=this.vwr.getP(a);else if(null==(e=this.vwr.getPOrNull(a)))return null;switch(b){case 1073742190:return JS.SV.getVariable(e);case 4:if(!u(e,"JU.Lst"))break;
a=e;b=new JU.SB;for(c=0;c<a.size();c++)b.append(a.get(c).asString()).appendC("\n");return b.toString()}return JS.SV.oValue(e)},"~S,~N,~B");f(d,"getVarParameter",function(a,b){var c=this.getContextVariableAsVariable(a,!1);if(null!=c)return b?c.asString():JS.SV.oValue(c);c=this.vwr.getP(a);return b&&0==(""+c).length?a:c},"~S,~B");f(d,"getContextVariableAsVariable",function(a,b){if(0==a.length||a.equals("expressionBegin"))return null;if("_"==a.charAt(0)){var c=a.equalsIgnoreCase("_callers");if(c||a.equalsIgnoreCase("_caller")){for(var e=
this.thisContext,d=new java.util.Hashtable,f=null,h;null!=e&&(!e.isFunction||!(null==f?f=d:(h=new java.util.Hashtable,f.put("_caller",JS.SV.newV(6,h)),f=h),f.putAll(e.vars),f.put("_name",JS.SV.newS(e.functionName)),!c));)e=e.parentContext;return JS.SV.newV(6,d)}if(a.equalsIgnoreCase("_name")){for(e=this.thisContext;null!=e;){if(e.isFunction)return JS.SV.newS(JS.SV.sValue(e.statement[0]));e=e.parentContext}return JS.SV.newS("")}}a=a.toLowerCase();c=null==this.contextVariables?null:this.contextVariables.get(a);
null==c&&(!b&&null!=this.thisContext)&&(c=this.thisContext.getVariable(a));return null!=c&&1275068418==c.tok?c.arrayToList(c):c},"~S,~B");f(d,"paramAsStr",function(a){this.getToken(a);null==this.theToken&&this.error(13);return JS.SV.sValue(this.theToken)},"~N");f(d,"stringParameter",function(a){(!this.checkToken(a)||4!=this.getToken(a).tok)&&this.error(41);return this.theToken.value},"~N");f(d,"stringParameterSet",function(a){switch(this.tokAt(a)){case 4:var b=this.stringParameter(a);return b.startsWith('["')&&
(a=this.vwr.evaluateExpression(b),"string"==typeof a)?JU.PT.split(a,"\n"):P(-1,[b]);case 1073742195:a+=2;break;case 268437504:++a;break;case 7:return JS.SV.strListValue(this.getToken(a));default:this.invArg()}for(var c,b=new JU.Lst;268437505!=(c=this.tokAt(a));){switch(c){case 268436992: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 e=0;e<a;e++)c[e]=b.get(e);return c},"~N");f(d,"objectNameParameter",function(a){this.checkToken(a)||
this.error(37);return this.paramAsStr(a)},"~N");f(d,"atomCenterOrCoordinateParameter",function(a,b){switch(this.getToken(a).tok){case 10:case 1073742325:var c=this.atomExpression(this.st,a,0,!0,!1,b,!0);if(null==c)return(null==b||!u(b[0],"JU.P3"))&&this.invArg(),b[0];null!=b&&(2==b.length&&u(b[1],"JU.BS")&&(c=JU.BSUtil.copy(c),c.and(b[1])),b[0]=c);return 1==c.cardinality()?this.vwr.ms.at[c.nextSetBit(0)]:this.vwr.ms.getAtomSetCenter(c);case 1073742332:case 8:return this.getPoint3f(a,!0,!0)}this.invArg();
return null},"~N,~A");f(d,"isCenterParameter",function(a){a=this.tokAt(a);return 1073742330==a||1073742332==a||1073742325==a||8==a||10==a},"~N");f(d,"centerParameter",function(a,b){return this.centerParameterForModel(a,-2147483648,b)},"~N,~A");f(d,"centerParameterForModel",function(a,b,c){var e=null;if(this.checkToken(a))switch(this.getToken(a).tok){case 1814695966:e=new JU.P3;b=this.vwr.getCurrentUnitCell();if(null!=b){a=b.getUnitCellVerticesNoOffset();b=b.getCartesianOffset();for(c=0;8>c;c++)e.add(a[c]),
e.add(b)}e.scale(0.125);break;case 1073742330:c=this.objectNameParameter(++a);e=-2147483648;268437504==this.tokAt(a+1)&&(e=this.parameterExpressionList(-a-1,-1,!0).get(0).asInt(),268437505!=this.getToken(--this.iToken).tok&&this.invArg());if(this.chk)return new JU.P3;if(1073742336==this.tokAt(a+1)&&(1140850691==this.tokAt(a+2)||1140850694==this.tokAt(a+2)))e=2147483647,this.iToken=a+2;null==(e=this.getObjectCenter(c,e,b))&&this.errorStr(12,c);break;case 10:case 1073742325:case 1073742332:case 8:null==
c&&(c=Array(1)),e=this.atomCenterOrCoordinateParameter(a,c)}null==e&&this.error(11);return e},"~N,~N,~A");f(d,"planeParameter",function(a,b){var c=new JU.V3,e=new JU.V3,d=null,f=null,h=null,j=null,l=!1;134217750==this.tokAt(a)&&a++;var r=null,m=268440576==this.tokAt(a);m&&a++;try{if(a<this.slen){switch(this.getToken(a).tok){case 1073742330:var k=this.objectNameParameter(++a);if(this.chk)return new JU.P4;d=this.getPlaneForObject(k,c);break;case 1111492629:(!this.checkToken(++a)||268440324!=this.getToken(a++).tok)&&
this.evalError("x=?",null);d=JU.P4.new4(1,0,0,-this.floatParameter(a));break;case 1111492630:(!this.checkToken(++a)||268440324!=this.getToken(a++).tok)&&this.evalError("y=?",null);d=JU.P4.new4(0,1,0,-this.floatParameter(a));break;case 1111492631:(!this.checkToken(++a)||268440324!=this.getToken(a++).tok)&&this.evalError("z=?",null);d=JU.P4.new4(0,0,1,-this.floatParameter(a));break;case 1073741824:case 4:case 9:d=this.planeValue(this.theToken);break;case 1073742332:case 8:if(!this.isPoint3f(a)){d=this.getPoint4f(a);
break}case 10:case 1073742325:if(b)for(var p=this.getAtomsStartingAt(a),r=Array(p.cardinality()),e=0,q=p.nextSetBit(0);0<=q;q=p.nextSetBit(q+1))r[e++]=this.vwr.ms.at[q];else if(f=this.atomCenterOrCoordinateParameter(a,null),268436992==this.getToken(++this.iToken).tok&&++this.iToken,h=this.atomCenterOrCoordinateParameter(this.iToken,null),268436992==this.getToken(++this.iToken).tok&&++this.iToken,this.isFloatParameter(this.iToken)){var s=this.floatParameter(this.iToken),d=new JU.P4;c.sub2(h,f);c.scale(2*
s);JU.Measure.getBisectingPlane(f,c,e,c,d)}else j=this.atomCenterOrCoordinateParameter(this.iToken,null),l=!0;break;default:if(this.isArrayParameter(a))if(b)r=this.getPointArray(a,-1,!1);else{var u=this.getPointOrCenterVector(this.getToken(a));3!=u.size()&&this.invArg();f=u.get(0);h=u.get(1);j=u.get(2);l=!0}}if(b)d=new JU.P4,JU.Measure.calcBestPlaneThroughPoints(r,-1,d);else if(l){var d=new JU.P4,E=new JU.P3,y=JU.Measure.getNormalThroughPoints(f,h,j,E,c);d.set4(E.x,E.y,E.z,y)}!this.chk&&JU.Logger.debugging&&
JU.Logger.debug(" defined plane: "+d)}}catch(x){if(D(x,Exception))d=null;else throw x;}null==d&&this.errorMore(38,"{a b c d}",'"xy" "xz" "yz" "x=..." "y=..." "z=..." "ab" "bc" "ac" "ab1" "bc1" "ac1"',"$xxxxx");m&&d.scale4(-1);return d},"~N,~B");f(d,"getAtomsStartingAt",function(a){var b=new JU.BS;for(a--;10==this.tokAt(++a)||1073742325==this.tokAt(a);)b.or(this.atomExpressionAt(a)),a=this.iToken;return b},"~N");f(d,"getPointOrCenterVector",function(a){var b=new JU.Lst,c,e;a=a.getList();null==a&&this.invArg();
for(var d=0;d<a.size();d++)null!=(c=JS.SV.ptValue(a.get(d)))?b.addLast(c):null!=(e=JS.SV.getBitSet(a.get(d),!0))?b.addLast(1==e.cardinality()?JU.P3.newP(this.vwr.ms.at[e.nextSetBit(0)]):this.vwr.ms.getAtomSetCenter(e)):this.invArg();return b},"JS.T");f(d,"hklParameter",function(a,b,c){!this.chk&&null==this.vwr.getCurrentUnitCell()&&this.error(33);a=this.getPointOrPlane(a,71);var e=NaN;c&&(e=u(a,"JU.P4")?a.w:NaN,1073742066==this.tokAt(this.iToken+1)&&(this.iToken++,e=this.floatParameter(++this.iToken)));
b=this.getHklPlane(a,e,b);null==b&&this.error(3);!this.chk&&JU.Logger.debugging&&JU.Logger.debug("defined plane: "+b);return b},"~N,JU.Lst,~B");f(d,"getHklPlane",function(a,b,c){var e=JU.P3.new3(0==a.x?1:1/a.x,0,0),d=JU.P3.new3(0,0==a.y?1:1/a.y,0),f=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?(e.set(1,0,f.z),d.set(0,1,f.z)):0==a.y&&0==a.z?(d.set(e.x,0,1),f.set(e.x,1,0)):0==a.z&&0==a.x?(f.set(0,d.y,1),e.set(1,d.y,0)):0==a.x?e.set(1,d.y,0):0==a.y?d.set(0,1,f.z):
0==a.z&&f.set(e.x,0,1);this.vwr.toCartesian(e,!1);this.vwr.toCartesian(d,!1);this.vwr.toCartesian(f,!1);a=new JU.V3;var h=JU.Measure.getPlaneThroughPoints(e,d,f,new JU.V3,a,new JU.P4);Float.isNaN(b)||(h.w=-b,null!=c&&(JU.Measure.getPlaneProjection(e,h,e,a),JU.Measure.getPlaneProjection(d,h,d,a),JU.Measure.getPlaneProjection(f,h,f,a)));null!=c&&(c.addLast(e),c.addLast(d),c.addLast(f));return h},"JU.T3,~N,JU.Lst");f(d,"getPointOrPlane",function(a,b){var c=S(6,0),e=K(6,0),d=!1,f=0,h=4==(b&7)?4:3,j=3==
(b&7)?3:4,l=0!=(b&64),r=0!=(b&8),m=!0;try{this.coordinatesAreFractional=l;if(8==this.tokAt(a)){if(3>=h&&3<=j)return this.getToken(a).value;m=!1;return null}if(9==this.tokAt(a)){if(4>=h&&4<=j)return this.getToken(a).value;m=!1;return null}var k=1,p=a;a:for(;p<this.slen;p++)switch(this.getToken(p).tok){case 1073742332:case 268436992:case 268438528:case 268439552:break;case 1073742338:break a;case 268440576:k=-1;break;case 1073742363:if(6==f)return m=!1,null;c[f++]=this.theToken.intValue;k=-1;break;
case 2:case 1073742362:(6==f||2147483647==this.theToken.intValue)&&this.invArg();l&&999999999<this.theToken.intValue&&(d=!0);e[f]=this.theToken.intValue;c[f++]=this.theToken.intValue*k;k=1;break;case 268441088:case 1073742358:if(!l&&0==(b&16))return m=!1,null;268441088==this.theTok&&this.getToken(++p);f--;if(0>f||r)return m=!1,null;u(this.theToken.value,Integer)||2==this.theTok?c[f++]/=2147483647==this.theToken.intValue?this.theToken.value.intValue():this.theToken.intValue:u(this.theToken.value,Float)&&
(c[f++]/=this.theToken.value.floatValue());this.coordinatesAreFractional=!0;break;case 1073742357:case 1073741824:c[f++]=NaN;break;case 3:case 1073742359:if(r||6==f)return m=!1,null;c[f++]=this.theToken.value.floatValue();break;default:this.iToken--;break a}if(f<h||f>j)return m=!1,null;if(3==f){if(d)return JU.P4.new4(c[0],c[1],c[2],1E3*(e[0]%1E3)+e[1]%1E3+1E6);var q=JU.P3.new3(c[0],c[1],c[2]);this.coordinatesAreFractional&&0!=(b&32)&&(this.fractionalPoint=JU.P3.newP(q),this.chk||this.vwr.toCartesian(q,
!1));return q}if(4==f&&(l||!this.coordinatesAreFractional))return JU.P4.new4(c[0],c[1],c[2],c[3]);m=!1;return null}finally{!m&&0==(b&128)&&this.invArg()}},"~N,~N");f(d,"isPoint3f",function(a){var b=this.tokAt(a);if(0==b)return!1;var c;if((c=8==b)||9==b||this.isFloatParameter(a+1)&&this.isFloatParameter(a+2)&&this.isFloatParameter(a+3)&&this.isFloatParameter(a+4))return c;this.ignoreError=!0;b=this.iToken;c=!0;try{null==this.getPoint3f(a,!0,!1)&&(c=!1)}catch(e){if(D(e,Exception))c=!1;else throw e;
}this.ignoreError=!1;this.iToken=b;return c},"~N");f(d,"getPoint3f",function(a,b,c){return this.getPointOrPlane(a,35|(b?16:0)|(c?0:128))},"~N,~B,~B");f(d,"getFractionalPoint",function(a){return this.getPointOrPlane(a,71)},"~N");f(d,"getPoint4f",function(a){return this.getPointOrPlane(a,4)},"~N");f(d,"xypParameter",function(a){var b=this.tokAt(a);1073742195==b&&(b=this.tokAt(++a));if(268437504!=b||!this.isFloatParameter(++a))return null;b=new JU.P3;b.x=this.floatParameter(a);268436992==this.tokAt(++a)&&
a++;if(!this.isFloatParameter(a))return null;b.y=this.floatParameter(a);var c=268441090==this.tokAt(++a);c&&++a;if(268437505!=this.tokAt(a))return null;this.iToken=a;b.z=3.4028235E38*(c?-1:1);return b},"~N");f(d,"xyzpParameter",function(a){var b=this.tokAt(a);1073742195==b&&(b=this.tokAt(++a));if(268437504!=b||!this.isFloatParameter(++a))return null;b=new JU.P4;b.x=this.floatParameter(a);268436992==this.tokAt(++a)&&a++;if(!this.isFloatParameter(a))return null;b.y=this.floatParameter(a);268436992==
this.tokAt(++a)&&a++;if(!this.isFloatParameter(a))return null;b.z=this.floatParameter(a);var c=268441090==this.tokAt(++a);c&&++a;if(268437505!=this.tokAt(a))return null;this.iToken=a;b.w=3.4028235E38*(c?-1:1);return b},"~N");f(d,"optParameterAsString",function(a){return a>=this.slen?"":this.paramAsStr(a)},"~N");f(d,"intParameter",function(a){if(this.checkToken(a)&&2==this.getToken(a).tok)return this.theToken.intValue;this.error(20);return 0},"~N");f(d,"isFloatParameter",function(a){switch(this.tokAt(a)){case 2:case 3:return!0}return!1},
"~N");f(d,"floatParameter",function(a){if(this.checkToken(a))switch(this.getToken(a),this.theTok){case 1073742363:return-this.theToken.intValue;case 1073742362:case 2:return this.theToken.intValue;case 1073742359:case 3:return this.theToken.value.floatValue()}this.error(34);return 0},"~N");f(d,"getPointArray",function(a,b,c){2147483647==b&&(b=-1);var e=0>b?null:Array(b),d=0>b?new JU.Lst:null,f=0>a?7:this.getToken(a++).tok;switch(f){case 7:d=this.theToken.getList();0<=b&&d.size()!=b&&this.invArg();
b=d.size();null==e&&(e=Array(b));for(f=0;f<b;f++)null==(e[f]=JS.SV.ptValue(d.get(f)))&&!c&&this.invArg();return e;case 1073742195:f=this.tokAt(a++)}268437504!=f&&this.invArg();for(c=0;268437505!=f&&0!=f;)switch(f=this.getToken(a).tok,f){case 0:case 268437505:break;case 268436992:a++;break;default:if(0<=b&&c==b){f=0;break}a=this.centerParameter(a,null);null==e?d.addLast(a):e[c]=a;c++;a=this.iToken+1}268437505!=f&&this.invArg();null==e&&(e=d.toArray(Array(d.size())));0<b&&null==e[b-1]&&this.invArg();
return e},"~N,~N,~B");f(d,"listParameter",function(a,b,c){return this.listParameter4(a,b,c,!1)},"~N,~N,~N");f(d,"listParameter4",function(a,b,c,e){var d=new JU.Lst,f=this.tokAt(a);1073742195==f&&(f=this.tokAt(++a));var h=1073742332==f,j=268437504==f;(h||j)&&a++;for(var l=0;l<c;){f=this.tokAt(a);if(h&&1073742338==f||j&&268437505==f)break;switch(f){case 268436992:case 268440576:case 1073742332:case 1073742338:break;case 4:e&&d.addLast(this.stringParameter(a));break;case 9:f=this.getPoint4f(a);d.addLast(Float.$valueOf(f.x));
d.addLast(Float.$valueOf(f.y));d.addLast(Float.$valueOf(f.z));d.addLast(Float.$valueOf(f.w));l+=4;break;default:if(this.isCenterParameter(a)){f=this.centerParameter(a,null);a=this.iToken;d.addLast(Float.$valueOf(f.x));d.addLast(Float.$valueOf(f.y));d.addLast(Float.$valueOf(f.z));l+=3;break}d.addLast(Float.$valueOf(this.floatParameter(a)));l++}a+=l==c&&j&&1073742338==this.tokAt(a+1)?2:1}(h&&1073742338!=this.tokAt(a++)||j&&268437505!=this.tokAt(a++)||l<b||l>c)&&this.invArg();this.iToken=a-1;return d},
"~N,~N,~N,~B");f(d,"floatParameterSet",function(a,b,c){var e=null,d=null,f=0,f=null;this.iToken=a;switch(this.tokAt(a)){case 4:f=JS.SV.sValue(this.st[a]);f=JU.PT.replaceWithCharacter(f,"{},[]\"'"," ");d=JU.PT.parseFloatArray(f);f=d.length;break;case 7:d=JS.SV.flistValue(this.st[a],0);f=d.length;break;default:e=this.listParameter(a,b,c),f=e.size()}(f<b||f>c)&&this.invArg();if(null==d){d=S(f,0);for(a=0;a<f;a++)d[a]=e.get(a).floatValue()}return d},"~N,~N,~N");f(d,"isArrayParameter",function(a){switch(this.tokAt(a)){case 7:case 11:case 12:case 1073742195:case 268437504:return!0}return!1},
"~N");f(d,"getQuaternionParameter",function(a,b,c){switch(this.tokAt(a)){case 7:return a=this.getToken(a).getList(),b=null,(0==a.size()||null==(b=JS.SV.pt4Value(a.get(0))))&&this.invArg(),JU.Quat.newP4(b);case 1073741864:return this.chk?null:this.vwr.getOrientation(1073741864,c?"best":"",b,null);default:return JU.Quat.newP4(this.getPoint4f(a))}},"~N,JU.BS,~B");f(d,"checkLast",function(a){return this.checkLength(a+1)-1},"~N");f(d,"checkLength",function(a){if(0<=a)return this.checkLengthErrorPt(a,0);
this.slen>-a&&(this.iToken=-a,this.bad());return this.slen},"~N");f(d,"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");f(d,"checkLength23",function(){this.iToken=this.slen;2!=this.slen&&3!=this.slen&&this.bad();return this.slen});f(d,"checkLength34",function(){this.iToken=this.slen;3!=this.slen&&4!=this.slen&&this.bad();return this.slen});f(d,"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=JU.Edge.getFloatEncodedInt(this.stringParameter(a));break;default:this.invArg()}return this.vwr.ms.getModelNumberIndex(b,c,!0)},"~N");f(d,"getMadParameter",function(){var a=1;switch(this.getToken(1).tok){case 1073742072:this.restrictSelected(!1,!1);case 1073742335:break;case 1073742334: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:T(Math.floor(2E3*a));0>a&&(this.restrictSelected(!1,
!1),a=-a);break;default:this.error(6)}return a});f(d,"intParameterRange",function(a,b,c){a=this.intParameter(a);return a<b||a>c?(this.integerOutOfRange(b,c),2147483647):a},"~N,~N,~N");f(d,"floatParameterRange",function(a,b,c){a=this.floatParameter(a);return a<b||a>c?(this.numberOutOfRange(b,c),NaN):a},"~N,~N,~N");f(d,"getPointVector",function(a,b){switch(a.tok){case 10:return this.vwr.ms.getAtomPointVector(a.value);case 7:for(var c=new JU.Lst,e,d=a.getList(),f=0;f<d.size();f++){e=d.get(f);if(null==
(e=10==e.tok?this.vwr.ms.getAtomSetCenter(JS.SV.getBitSet(e,!1)):JS.SV.ptValue(e)))return null;c.addLast(e)}return c}return 0<b?this.vwr.ms.getAtomPointVector(this.atomExpressionAt(b)):null},"JS.T,~N");f(d,"isColorParam",function(a){var b=this.tokAt(a);return 0!=b&&(570425378==b||1073742195==b||268437504==b||7==b||8==b||this.isPoint3f(a)||(4==b||JS.T.tokAttr(b,1073741824))&&0!=JU.CU.getArgbFromString(this.st[a].value))},"~N");f(d,"getArgbParam",function(a){return this.getArgbParamOrNone(a,!1)},"~N");
f(d,"getArgbParamLast",function(a,b){var c=this.getArgbParamOrNone(a,b);this.checkLast(this.iToken);return c},"~N,~B");f(d,"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 268437504:return this.getColorTriad(++a);case 7:var e=JS.SV.flistValue(this.theToken,3);null!=e&&3!=e.length&&
(c=JU.P3.new3(e[0],e[1],e[2]));break;case 8:c=this.theToken.value;break;case 1073742332:c=this.getPoint3f(a,!1,!0);break;case 1073742333:if(b)return 0}null==c&&this.error(8);return JU.CU.colorPtToFFRGB(c)},"~N,~B");f(d,"getColorTriad",function(a){var b=S(3,0),c=0,e="";this.getToken(a);var d=null,f=0;a:switch(this.theTok){case 2:case 1073742362:case 3:for(;a<this.slen;a++){switch(this.getToken(a).tok){case 268436992:continue;case 1073741824:(1!=c||0!=b[0])&&this.error(4);e="0"+this.paramAsStr(a);break a;
case 3:2<c&&this.error(4);f=this.floatParameter(a);break;case 2:2<c&&this.error(4);f=this.theToken.intValue;break;case 1073742362:2<c&&this.error(4);f=this.theToken.value.intValue()%256;break;case 268437505:3!=c&&this.error(4);--a;d=JU.P3.new3(b[0],b[1],b[2]);break a;default:this.error(4)}b[c++]=f}this.error(4);break;case 8:d=this.theToken.value;break;case 1073741824:e=this.paramAsStr(a);break;default:this.error(4)}268437505!=this.getToken(++a).tok&&this.error(4);if(null!=d)return JU.CU.colorPtToFFRGB(d);
0==(c=JU.CU.getArgbFromString("["+e+"]"))&&this.error(4);return c},"~N");f(d,"tickParamAsStr",function(a,b,c,e){this.iToken=a-1;if(1073742164!=this.tokAt(a))return null;var d=" ";switch(this.tokAt(a+1)){case 1111492629:case 1111492630:case 1111492631:d=this.paramAsStr(++a).toLowerCase();break;case 1073741824:this.invArg()}if(1073742333==this.tokAt(++a))return b=new JM.TickInfo(null),b.type=d,this.iToken=a,b;b=new JM.TickInfo(this.getPointOrPlane(a,19));if(this.coordinatesAreFractional||1814695966==
this.tokAt(this.iToken+1))b.scale=JU.P3.new3(NaN,NaN,NaN),c=!1;1814695966==this.tokAt(this.iToken+1)&&this.iToken++;b.type=d;1287653388==this.tokAt(this.iToken+1)&&(b.tickLabelFormats=this.stringParameterSet(this.iToken+2));if(!c)return b;536875059==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,!0));e&&1073741942==this.tokAt(this.iToken+1)&&(b.first=this.floatParameter(this.iToken+
2));return b},"~N,~B,~B,~B");f(d,"setBooleanProperty",function(a,b){this.chk||this.vwr.setBooleanProperty(a,b)},"~S,~B");f(d,"setIntProperty",function(a,b){this.chk||this.vwr.setIntProperty(a,b);return!0},"~S,~N");f(d,"setFloatProperty",function(a,b){this.chk||this.vwr.setFloatProperty(a,b);return!0},"~S,~N");f(d,"setStringProperty",function(a,b){this.chk||this.vwr.setStringProperty(a,b)},"~S,~S");f(d,"checkHKL",function(a){(1>Math.abs(a.x)||1>Math.abs(a.y)||1>Math.abs(a.z)||a.x!=F(a.x)||a.y!=F(a.y)||
a.z!=F(a.z))&&this.invArg();return a},"JU.T3");f(d,"planeValue",function(a){var b=null,c=NaN,e=null;switch(a.tok){case 9:return a.value;case 7:break;case 4:case 1073741824:var d=a.value,f=d.startsWith("-"),h=f?-1:1;f&&(d=d.substring(1));var j=null,l=d.length,r=2>l?-1:"xy yz xz x= y= z= ab bc ac a= b= c=".indexOf(d.substring(0,2).toLowerCase());if(18<=r&&null==(b=this.vwr.getCurrentUnitCell()))r-=18;var m=0>d.indexOf("=");2<l&&(m?Float.isNaN(c)&&(18<=r&&"1"==d.charAt(2))&&(c=-1):c=-h*JU.PT.parseFloat(d.substring(2)));
switch(r){case 0:return JU.P4.new4(1,1,0,h);case 3:return JU.P4.new4(0,1,1,h);case 6:return JU.P4.new4(1,0,1,h);case 9:j=JU.P4.new4(1,0,0,-h*JU.PT.parseFloat(d.substring(2)));break;case 12:j=JU.P4.new4(0,1,0,-h*JU.PT.parseFloat(d.substring(2)));break;case 15:j=JU.P4.new4(0,0,1,-h*JU.PT.parseFloat(d.substring(2)));break;case 18:Float.isNaN(c)&&(c=0);case 33:j=this.getHklPlane(e=JU.P3.new3(0,0,1),0,null);j.scale4(-h);break;case 21:Float.isNaN(c)&&(c=0);case 27:j=this.getHklPlane(e=JU.P3.new3(1,0,0),
0,null);j.scale4(- -h);break;case 24:Float.isNaN(c)&&(c=0);case 30:j=this.getHklPlane(e=JU.P3.new3(0,1,0),0,null),j.scale4(-h)}if(null==j||Float.isNaN(j.w))break;if(null!=b&&!Float.isNaN(c)){b.toCartesian(e,!0);if(m||!f)c=-c;j.w=e.dot(j)*c;(!m||0!=c)&&j.scale(-1)}return j;default:return null}a=JU.Escape.uP(JS.SV.sValue(a));return u(a,"JU.P4")?a:null},"JS.T");f(d,"setScriptArguments",function(a,b){null==this.contextVariables&&(this.contextVariables=new java.util.Hashtable);this.contextVariables.put("_arguments",
null==a?JS.SV.getVariableAI(K(-1,[])):b?JS.SV.newV(1275068418,a):JS.SV.getVariableList(a));this.contextVariables.put("_argcount",JS.SV.newI(null==a?0:b?a.length:a.size()))},"~O,~B");f(d,"getCallbackParameter",function(a){var b=null==this.contextVariables?null:this.contextVariables.get("_arguments");if(null==b&&(null==this.thisContext||null==(b=this.thisContext.getVariable("_arguments"))))return null;if(1275068418==b.tok){if(-2147483648==a)return b.arrayToList(b);b=b.value;return 0>--a||a>=b.length?
null:b[a]=JS.SV.getVariable(b[a])}var c=b.getList();return-2147483648==a?b:0>--a||a>=c.size()?JS.SV.newV(7,new JU.Lst):c.get(a)},"~N")});L("JS");Z=Q(function(){this.context=this.processName=null;O(this,arguments)},JS,"ScriptProcess",null);R(Z,function(d,a){this.processName=d;this.context=a},"~S,JS.ScriptContext");L("JS");M(null,"JS.ScriptProcessRunnable",["JU.Logger"],function(){var d=Q(function(){this.shapeManager=this.processLock=this.process=this.parallelProcessor=null;O(this,arguments)},JS,"ScriptProcessRunnable",
null,Runnable);R(d,function(a,b,c,e){this.parallelProcessor=a;this.process=b;this.processLock=c;this.shapeManager=e},"JS.ScriptParallelProcessor,JS.ScriptProcess,~O,JV.ShapeManager");s(d,"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(D(a,Exception))a.printStackTrace();else if(D(a,Error))this.parallelProcessor.clearShapeManager(a);else throw a;}finally{--this.parallelProcessor.counter,this.processLock.notifyAll()}})});L("JS");M(["J.thread.JmolThread"],"JS.ScriptQueueThread",["JU.Logger"],function(){var d=Q(function(){this.scriptManager=null;this.startedByCommandThread=!1;this.pt=0;O(this,arguments)},JS,"ScriptQueueThread",J.thread.JmolThread);R(d,function(a,b,c,e){this.setViewer(b,
"QueueThread"+e);this.scriptManager=a;this.vwr=b;this.startedByCommandThread=c;this.pt=e},"JS.ScriptManager,JV.Viewer,~B,~N");s(d,"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");f(d,"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;JU.Logger.debugging&&JU.Logger.debug("Queue["+this.pt+"]["+a.size()+"] scripts; running: "+b.get(0));a.removeItemAt(0);this.scriptManager.runScriptFromThread(b);return 0==a.size()?!1:!0})});L("JS");M(null,"JS.ScriptTokenParser","JU.Lst $.P3 $.PT J.i18n.GT JS.T JU.Edge $.Logger $.SimpleUnitCell".split(" "),function(){var d=Q(function(){this.script=this.htUserFunctions=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.haveMacro=this.isNewSet=!1;this.logMessages=!0;this.atokenInfix=null;this.itokenInfix=0;this.isSetOrDefine=this.isMathExpressionCommand=this.isSetBrace=!1;this.ltokenPostfix=null;this.isCommaAsOrAllowed=this.isEmbeddedExpression=!1;this.theValue=null;this.residueSpecCodeGenerated=
this.haveString=!1;this.errorType=this.errorLine=this.errorMessageUntranslated=this.errorMessage=null;O(this,arguments)},JS,"ScriptTokenParser",null);f(d,"compileExpressions",function(){var a=(134222850==this.tokCommand||4124==this.tokCommand)&&268435968==this.tokAt(2);this.isEmbeddedExpression=a||0!=this.tokCommand&&(134320141!=this.tokCommand&&102436!=this.tokCommand&&364558!=this.tokCommand&&102412!=this.tokCommand||2147483647!=this.tokenCommand.intValue)&&102409!=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);1073742330==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++)12290==this.tokAt(c)&&b++;a-=b;this.isNewSet&&1==a&&(this.atokenInfix[0]=JS.T.tv(134320141,0,this.atokenInfix[0].value),
this.isNewSet=!1);if((this.isNewSet||this.isSetBrace)&&2147483647!=this.ptNewSetModifier&&a<this.ptNewSetModifier+2){if(!this.isNewSet||!this.haveMacro)return this.commandExpected();this.htUserFunctions.put(this.atokenInfix[0].value,Boolean.TRUE)}return 1==a||!JS.T.tokAttr(this.tokCommand,262144)?!0:this.error(0)});f(d,"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 12290:c=
12290==this.tokAt(1)?2:1;if(2==this.tokAt(c)&&1073742336==this.tokAt(c+1)&&268440324==this.tokAt(c+3)){this.tokCommand=36867;this.isSetBrace=!0;this.ptNewSetModifier=c+3;this.isEmbeddedExpression=this.isMathExpressionCommand=!0;this.addTokenToPostfixToken(JS.T.tokenSetProperty);this.addTokenToPostfixToken(JS.T.tokenExpressionBegin);for(a=0;a++<=c;)this.addNextToken();this.addTokenToPostfixToken(JS.T.tokenExpressionEnd);a=0}break;case 12295:1677721602==c&&(a=2);break;case 1275082241:switch(c){case 1073742335:case 1073742334:case 268436992:c=
this.tokAt(++a);break}case 12294:case 1610625028:switch(c){case 1275069441:case 1073742119:c=this.tokAt(++a)}1086324742==c&&!JS.T.tokAttr(this.tokAt(a+1),268435456)&&a++}for(c=0;c<a&&this.addNextToken();c++);for(;this.moreTokens();){if(this.isEmbeddedExpression){for(;!this.isExpressionNext();){if(this.tokPeekIs(1073741824)&&!(134223363==this.tokCommand&&1==this.itokenInfix)&&(a=this.atokenInfix[this.itokenInfix].value,c=JS.T.getTokenFromName(a),null!=c&&(!this.isMathExpressionCommand&&12290!=this.lastToken.tok||
(1073742336==this.lastToken.tok||268435968==this.tokAt(this.itokenInfix+1))&&!this.isUserFunction(a))))this.atokenInfix[this.itokenInfix]=c;if(!this.addNextToken())break}if(!this.moreTokens())break}if(12290==this.lastToken.tok){if(!this.clauseDefine(!0,!1))return!1}else{this.isMathExpressionCommand||this.addTokenToPostfixToken(b=JS.T.o(1073742325,"implicitExpressionBegin"));if(!this.clauseOr(this.isCommaAsOrAllowed||!this.isMathExpressionCommand&&this.tokPeekIs(268435968)))return!1;!this.isMathExpressionCommand&&
!(this.isEmbeddedExpression&&this.lastToken===JS.T.tokenCoordinateEnd)&&this.addTokenToPostfixToken(JS.T.tokenExpressionEnd);if(this.moreTokens()){if(1275082241!=this.tokCommand&&12291!=this.tokCommand&&!this.isEmbeddedExpression)return this.error(5);1275082241==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});f(d,"isUserFunction",
function(a){a=a.toLowerCase();return!this.isStateScript&&(this.vwr.isFunction(a)||this.htUserFunctions.containsKey(a))},"~S");f(d,"isExpressionNext",function(){return this.tokPeekIs(1073742332)&&!(4==this.tokAt(this.itokenInfix+1)&&268436482==this.tokAt(this.itokenInfix+2))||!this.isMathExpressionCommand&&this.tokPeekIs(268435968)});d.tokenAttr=f(d,"tokenAttr",function(a,b){return null!=a&&JS.T.tokAttr(a.tok,b)},"JS.T,~N");f(d,"moreTokens",function(){return this.itokenInfix<this.atokenInfix.length});
f(d,"tokAt",function(a){return a<this.atokenInfix.length?this.atokenInfix[a].tok:0},"~N");f(d,"tokPeek",function(){return this.itokenInfix>=this.atokenInfix.length?0:this.atokenInfix[this.itokenInfix].tok});f(d,"tokPeekIs",function(a){return this.tokAt(this.itokenInfix)==a},"~N");f(d,"intPeek",function(){return this.itokenInfix>=this.atokenInfix.length?2147483647:this.atokenInfix[this.itokenInfix].intValue});f(d,"valuePeek",function(){return this.moreTokens()?this.atokenInfix[this.itokenInfix].value:
""});f(d,"tokenNext",function(){return this.itokenInfix>=this.atokenInfix.length?null:this.atokenInfix[this.itokenInfix++]});f(d,"tokenNextTok",function(a){var b=this.tokenNext();return null!=b&&b.tok==a},"~N");f(d,"returnToken",function(){this.itokenInfix--;return!1});f(d,"getToken",function(){this.theValue=null==(this.theToken=this.tokenNext())?null:this.theToken.value;return this.theToken});f(d,"getNumericalToken",function(){return null!=this.getToken()&&(2==this.theToken.tok||3==this.theToken.tok)});
f(d,"floatValue",function(){switch(this.theToken.tok){case 2:return this.theToken.intValue;case 3:return this.theValue.floatValue()}return 0});f(d,"addTokenToPostfix",function(a,b){return this.addTokenToPostfixToken(JS.T.o(a,b))},"~N,~O");f(d,"addTokenToPostfixInt",function(a,b,c){return this.addTokenToPostfixToken(JS.T.tv(a,b,c))},"~N,~N,~O");f(d,"addTokenToPostfixToken",function(a){if(null==a)return!1;this.logMessages&&JU.Logger.debug("addTokenToPostfix"+a);if(268437504==a.tok&&(1073742336==this.lastToken.tok||
1073742337==this.lastToken.tok)){var b=this.ltokenPostfix.size()-1;this.ltokenPostfix.removeItemAt(b);this.ltokenPostfix.addLast(JS.T.tokenRightParen);for(var c=0,e,d=this.ltokenPostfix.size();0<=--d&&0<=c;)switch(e=this.ltokenPostfix.get(d).tok){case 268435969:case 268437505:c++;break;case 268435968:case 268437504:c--;var f;if(1==c&&268435969!=(f=this.ltokenPostfix.get(d-1).tok)&&268437505!=f)b=268437504==e?d-1:d,c=-10;break;default:f=0==d?0:this.ltokenPostfix.get(d-1).tok;if(1073742336==f||1073742337==
f){b=d-1;break}d==b-1&&(b=d,c=-10)}-10==c&&this.ltokenPostfix.add(b,JS.T.tokenLeftParen)}this.ltokenPostfix.addLast(a);this.lastToken=a;return!0},"JS.T");f(d,"addNextToken",function(){return this.addTokenToPostfixToken(this.tokenNext())});f(d,"addNextTokenIf",function(a){return this.tokPeekIs(a)&&this.addNextToken()},"~N");f(d,"addSubstituteTokenIf",function(a,b){if(!this.tokPeekIs(a))return!1;this.itokenInfix++;return this.addTokenToPostfixToken(b)},"~N,JS.T");f(d,"clauseOr",function(a){this.haveString=
!1;if(!this.clauseAnd())return!1;if(this.isEmbeddedExpression&&1073742326==this.lastToken.tok)return!0;for(var b;268438016==(b=this.tokPeek())||268438017==b||268438018==b||a&&268436992==b;){268436992==b&&!this.haveString?this.addSubstituteTokenIf(268436992,JS.T.tokenOr):this.addNextToken();if(!this.clauseAnd())return!1;if(a&&(1073742338==this.lastToken.tok||10==this.lastToken.tok))this.haveString=!0}return!0},"~B");f(d,"clauseAnd",function(){if(!this.clauseNot())return!1;if(this.isEmbeddedExpression&&
1073742326==this.lastToken.tok)return!0;for(;this.tokPeekIs(268438528);)if(this.addNextToken(),!this.clauseNot())return!1;return!0});f(d,"clauseNot",function(){return this.tokPeekIs(268439040)?(this.addNextToken(),this.clauseNot()):this.clausePrimitive()});f(d,"clausePrimitive",function(){var a=this.tokPeek();switch(a){case 1073742195:return this.itokenInfix++,this.clausePrimitive();case 0:return this.error(4);case 1073742327:case 10:case 268441088:case 136314895:case 2097160:case 2097159:case 2097162:case 1073742331:case 1073742333:case 2097184:return this.addNextToken();
case 4:return this.haveString=!0,this.addNextToken();case 3:return this.addTokenToPostfixInt(1073742359,this.fixModelSpec(this.getToken()),this.theValue);case 1094713349:case 1094713350:return this.clauseCell(a);case 134217736:case 1275203608:return this.clauseConnected(1275203608==a);case 134218756:case 134218757:return this.clauseSubstructure();case 134217759:case 134353926:return this.clauseWithin(134217759==a);case 12290:return this.clauseDefine(!1,!1);case 1677721602:case 1745489939:this.addNextToken();
if(this.tokPeekIs(10))this.addNextToken();else if(this.tokPeekIs(12290))return this.clauseDefine(!1,!1);return!0;case 268435968:return this.addNextToken(),!this.clauseOr(!0)?!1:!this.addNextTokenIf(268435969)?this.errorStr(15,")"):this.checkForItemSelector(!0);case 1073742332:return this.checkForCoordinate(this.isMathExpressionCommand);default:if(this.clauseResidueSpec())return!0;if(this.isError())return!1;if(JS.T.tokAttr(a,1077936128)){var b=this.itokenInfix,c=this.clauseComparator(!0);if(c||this.itokenInfix!=
b)return c;if(1237320707==a)return this.clauseSubstructure()}return this.addNextToken()}});f(d,"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 e=this.tokPeekIs(4);if(e){a=!1;this.returnToken();this.ltokenPostfix.removeItemAt(this.ltokenPostfix.size()-1);this.addNextToken();for(var d=1;0!=d;){if(this.tokPeekIs(1073742332))if(this.isExpressionNext()){this.addTokenToPostfixToken(JS.T.o(1073742325,
"implicitExpressionBegin"));if(!this.clauseOr(!1))return!1;this.lastToken!==JS.T.tokenCoordinateEnd&&this.addTokenToPostfixToken(JS.T.tokenExpressionEnd)}else d++;this.tokPeekIs(1073742338)&&d--;this.addNextToken()}}else{if(!this.tokPeekIs(1073742338)&&!this.clauseOr(!1))return!1;for(b=1;!this.tokPeekIs(1073742338);){d=this.addNextTokenIf(268436992);if(!this.clauseOr(!1))return d||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?e||this.tokenNext():this.addNextToken();return this.checkForItemSelector(!e)},"~B");f(d,"checkForItemSelector",function(a){var b;if(268437504==(b=this.tokAt(this.itokenInfix+1))||a&&1073742332==b)return!0;for(;this.addNextTokenIf(268437504);){if(!this.clauseItemSelector())return!1;if(!this.addNextTokenIf(268437505))return this.errorStr(15,
"]")}return!0},"~B");f(d,"clauseWithin",function(a){this.addNextToken();if(!this.addNextTokenIf(268435968)||null==this.getToken())return!1;var b=3.4028235E38,c=null,e=a,d,f=this.theToken.tok;if(!a){d=-1;for(var h=this.itokenInfix;0!=d;h++)switch(d=this.tokAt(h)){case 268436992:d=0;break;case 1073742332:case 268435968:case 268435969:b=100,this.returnToken(),f=d=0}}switch(f){case 268440576: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 12290:this.addTokenToPostfixToken(this.theToken);if(!this.clauseDefine(!0,!1))return!1;c="";e=!1}if(a&&3.4028235E38==b)switch(f){case 12290:break;case 1094713350:case 1094713349:this.addTokenToPostfix(4,this.theValue);this.clauseCell(8);c="";break;case 1111490587:case 1073742128:case 134218756:case 134218757:case 1237320707:case 1073741925:case 1073742189:this.addTokenToPostfix(4,this.theValue);if(!this.addNextTokenIf(268436992))return!1;e=!1;d=this.tokPeek();
switch(d){case 0:return!1;case 4:this.addNextToken();c="";break;case 12290:if(!this.clauseDefine(!1,!0))return!1;c="";break;default:return!1}break;case 1073742328:e=!1;case 1086326785:case 1086326786:case 1073741863:case 1812599299:case 1086326788:case 1073742329:case 1086326789:case 1086324742:case 1814695966:case 136314895:case 1094717454:case 1094713360:case 134217750:case 134219777:case 1094713362:case 1086324744:case 2097184:case 1094713366:case 1639976963:case 4:case 1648363544:c=this.theValue;
break;default:c=this.theValue.toLowerCase()}null==c?this.addTokenToPostfix(3,Float.$valueOf(b)):0<c.length&&this.addTokenToPostfix(4,c);for(h=!1;!h&&(0==f||this.addNextTokenIf(268436992));){0==f&&(f=134353926);var j=!1;d=this.tokPeek();if(a){switch(f){case 2:case 3:if(1073742335==d||1073742334==d){this.addTokenToPostfixToken(this.getToken());if(!this.addNextTokenIf(268436992))break;d=this.tokPeek()}}if(null==c){switch(d){case 134219777:case 1073742329:case 134217750:j=!0;this.addNextToken();break;
case 1073742330:this.getToken();this.getToken();this.addTokenToPostfix(4,"$"+this.theValue);h=!0;break;case 1086324742:case 1648363544:case 1814695966:this.getToken();this.addTokenToPostfix(4,JS.T.nameOf(d));break;case 1073742332:this.returnToken(),j=!0,this.addTokenToPostfixToken(JS.T.getTokenFromName(3.4028235E38==b?"plane":"coord"))}h||this.addNextTokenIf(268436992)}}this.tokPeek();if(h)break;if(j)for(;!this.tokPeekIs(268435969);)switch(this.tokPeek()){case 0:return this.error(4);case 268435968:this.addTokenToPostfixToken(JS.T.tokenExpressionBegin);
this.addNextToken();if(!this.clauseOr(!1))return this.errorIntStr2(18,"WITHIN",": ?");if(!this.addNextTokenIf(268435969))return this.errorStr(15,", / )");this.addTokenToPostfixToken(JS.T.tokenExpressionEnd);break;case 12290:if(!this.clauseDefine(!1,!1))return!1;break;default:this.addTokenToPostfixToken(this.getToken())}else this.clauseOr(e)}return!this.addNextTokenIf(268435969)?this.errorStr(15,")"):!0},"~B");f(d,"clauseConnected",function(a){this.addNextToken();if(!this.addNextTokenIf(268435968))return this.addTokenToPostfixToken(JS.T.tokenLeftParen),
this.addTokenToPostfixToken(JS.T.tokenRightParen),!0;for(;;){if(this.addNextTokenIf(2)){if(!this.addNextTokenIf(268436992))break;if(a){this.returnToken();break}}else if(a&&(this.addNextTokenIf(4)||this.addNextTokenIf(1073741824)))break;if(this.addNextTokenIf(2)&&!this.addNextTokenIf(268436992))break;if(this.addNextTokenIf(3)&&!this.addNextTokenIf(268436992))break;if(this.addNextTokenIf(3)&&!this.addNextTokenIf(268436992))break;a=this.getToken().value;a="string"==typeof a?a:" ";if(131071==JU.Edge.getBondOrderFromString(a))this.returnToken();
else if(this.addTokenToPostfix(4,a),!this.addNextTokenIf(268436992))break;if(this.addNextTokenIf(268435969))return!0;if(!this.clauseOr(this.tokPeekIs(268435968)))return!1;if(this.addNextTokenIf(268435969))return!0;if(!this.addNextTokenIf(268436992)||!this.clauseOr(this.tokPeekIs(268435968)))return!1;break}return!this.addNextTokenIf(268435969)?this.errorStr(15,")"):!0},"~B");f(d,"clauseSubstructure",function(){this.addNextToken();if(!this.addNextTokenIf(268435968))return!1;if(this.tokPeekIs(12290)){if(!this.clauseDefine(!1,
!0))return!1}else if(!this.addNextTokenIf(4))return this.errorStr(15,'"..."');return this.addNextTokenIf(268436992)&&!this.clauseOr(this.tokPeekIs(268435968))?!1:!this.addNextTokenIf(268435969)?this.errorStr(15,")"):!0});f(d,"clauseItemSelector",function(){for(var a,b=0;0!=(a=this.tokPeek())&&268437505!=a;)this.addNextToken(),268437504==a&&b++,268437505==this.tokPeek()&&0<b--&&this.addNextToken();return!0});f(d,"clauseComparator",function(a){var b=this.tokenNext(),c=this.tokenNext();if(!JS.ScriptTokenParser.tokenAttr(c,
268435712)){if(!a)return this.errorStr(15,"== != < > <= >=");null!=c&&this.returnToken();this.returnToken();return!1}if(JS.ScriptTokenParser.tokenAttr(b,1086324736)&&268440324!=c.tok&&268440326!=c.tok&&268440325!=c.tok)return this.errorStr(15,"== !=");if(268437504==this.tokPeek()){this.getToken();for(this.addTokenToPostfixToken(JS.T.tokenLeftParen);;){if(!this.addCompare(b,c))return!1;if(268436992==this.tokPeek())this.getToken();else if(268437505==this.tokPeek())break;this.addTokenToPostfixToken(268440325==
c.tok?JS.T.tokenAnd:JS.T.tokenOr)}this.getToken();this.addTokenToPostfixToken(JS.T.tokenRightParen);return!0}return this.addCompare(b,c)},"~B");f(d,"addCompare",function(a,b){if(null==this.getToken())return this.errorStr(17,""+this.valuePeek());var c=268440576==this.theToken.tok;if(c&&null==this.getToken())return this.error(12);switch(this.theToken.tok){case 2:case 3:case 1073741824:case 4:case 1073742332:case 12290:break;default:if(!JS.T.tokAttr(this.theToken.tok,1073741824))return this.error(13)}this.addTokenToPostfixInt(b.tok,
a.tok,b.value+(c?" -":""));1715472409==a.tok&&this.addTokenToPostfixToken(a);if(1073742332==this.theToken.tok)return this.returnToken(),this.clausePrimitive();this.addTokenToPostfixToken(this.theToken);return 12290==this.theToken.tok?this.clauseDefine(!0,!1):!0},"JS.T,JS.T");f(d,"clauseCell",function(a){var b=new JU.P3;this.tokenNext();if(8!=a&&!this.tokenNextTok(268440324))return this.errorStr(15,"=");if(null==this.getToken())return this.error(3);if(2==this.theToken.tok)JU.SimpleUnitCell.ijkToPoint3f(this.theToken.intValue,
b,1,0);else{if(1073742332!=this.theToken.tok||!this.getNumericalToken())return this.error(3);b.x=this.floatValue();this.tokPeekIs(268436992)&&this.tokenNext();if(!this.getNumericalToken())return this.error(3);b.y=this.floatValue();this.tokPeekIs(268436992)&&this.tokenNext();if(!this.getNumericalToken()||!this.tokenNextTok(1073742338))return this.error(3);b.z=this.floatValue()}return this.addTokenToPostfix(a,b)},"~N");f(d,"clauseDefine",function(a,b){if(!a){var c=this.tokenNext();b&&(c=JS.T.tokenDefineString);
this.addTokenToPostfixToken(c)}if(this.tokPeekIs(0))return this.error(4);if(!this.addSubstituteTokenIf(1073742332,JS.T.tokenExpressionBegin))return 12290==this.tokPeek()&&this.addNextToken(),this.addNextToken()&&this.checkForItemSelector(!0);for(;this.moreTokens()&&!this.tokPeekIs(1073742338);)if(this.tokPeekIs(1073742332)){if(!this.checkForCoordinate(!0))return!1}else this.addNextToken();return this.addSubstituteTokenIf(1073742338,JS.T.tokenExpressionEnd)&&this.checkForItemSelector(!0)},"~B,~B");
f(d,"generateResidueSpecCode",function(a){this.residueSpecCodeGenerated&&this.addTokenToPostfixToken(JS.T.tokenAndSpec);this.addTokenToPostfixToken(a);return this.residueSpecCodeGenerated=!0},"JS.T");f(d,"clauseResidueSpec",function(){var a=this.tokPeek(),b=this.residueSpecCodeGenerated=!1;switch(a){case 0:case 2097156:case 2097174:return!1;case 2:case 268436482:case 268441090:case 5:break;case 268441089:case 268437504:case 1073741824:b=!0;break;default:if(JS.T.tokAttr(a,268435712))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||268441089==a||5==a){if(!this.clauseSequenceSpec())return!1;c=!0;a=this.tokPeek()}if(268436482==a){if(!this.clauseChainSpec(a))return!1;c=!0;a=this.tokPeek()}if(1073742336==a){if(!this.clauseAtomSpec())return!1;c=!0;a=this.tokPeek()}if(268441090==a){if(!this.clauseAlternateSpec())return!1;c=!0;a=this.tokPeek()}if(268441088==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});f(d,"clauseResNameSpec",function(){this.getToken();var a=this.tokPeek();switch(this.theToken.tok){case 268441089:return!0;case 268437504:for(a="";null!=this.getToken()&&268437505!=this.theToken.tok;)a+=this.theValue;if(null==this.theToken)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(1073742360,
a.toUpperCase()));default:if(JS.T.tokAttr(a,268435712))return this.returnToken(),!1;b=this.theValue;268441089==a&&(b=this.theValue+"*",this.getToken());return this.generateResidueSpecCode(JS.T.o(1073741824,b))}});f(d,"clauseSequenceSpec",function(){if(268441089==this.tokPeek())return null!=this.getToken();var a=this.getSequenceCode(!1);if(null==a)return!1;var b=this.tokPeek();return 268440576==b||2==b&&0>this.intPeek()?(268440576==b?this.tokenNext():(b=-this.intPeek(),this.tokenNext().intValue=b,
this.returnToken()),a.tok=1073742363,this.generateResidueSpecCode(a),this.addTokenToPostfixToken(this.getSequenceCode(!0))):this.generateResidueSpecCode(a)});f(d,"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(1073742362,c,Integer.$valueOf(b))},"~B");f(d,"clauseChainSpec",function(a){this.tokenNext();a=this.tokPeek();if(this.isTerminator(a))a=
" ";else{switch(a){case 268441089: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(1073742357,a,"spec_chain"))},"~N");f(d,"clauseAlternateSpec",function(){this.tokenNext();if(this.isTerminator(this.tokPeek()))return this.generateResidueSpecCode(JS.T.o(1073742355,
null));switch(this.getToken().tok){case 268441089:case 4:case 2:case 1073741824:case 805307393:case 1111492629:case 1111492630:case 1111492631:case 1140850705:break;default:return this.error(10)}return this.generateResidueSpecCode(JS.T.o(1073742355,this.theToken.value))});f(d,"isTerminator",function(a){switch(a){case 0:case 268441088:case 268438528:case 268438016:case 268439040:case 268436992:case 268435969:case 1073742338:return!0;default:return!1}},"~N");f(d,"clauseModelSpec",function(){this.getToken();
switch(this.tokPeek()){case 268441089:return this.getToken(),!0;case 2:return this.generateResidueSpecCode(JS.T.o(1073742358,Integer.$valueOf(this.getToken().intValue)));case 3:return this.generateResidueSpecCode(JS.T.tv(1073742358,this.fixModelSpec(this.getToken()),this.theValue));case 268436992:case 1073742338:case 0:return this.generateResidueSpecCode(JS.T.o(1073742358,Integer.$valueOf(1)))}return this.error(10)});f(d,"fixModelSpec",function(a){a=a.intValue;if(2147483647==a){var b=this.theValue.floatValue();
b==F(b)&&(a=1E6*F(b));0>a&&(a=2147483647)}return a},"JS.T");f(d,"clauseAtomSpec",function(){if(!this.tokenNextTok(1073742336))return this.error(7);if(null==this.getToken())return!0;var a="";if(2==this.theToken.tok&&(a+=""+this.theToken.intValue,null==this.getToken()))return this.error(7);if(268441089==this.theToken.tok)return!0;a+=""+this.theToken.value;this.tokPeekIs(268441089)&&(this.tokenNext(),a+="'");return this.generateResidueSpecCode(JS.T.tv(1073742356,this.vwr.getJBR().lookupSpecialAtomID(a.toUpperCase()),
a))});d.errorString=f(d,"errorString",function(a,b,c,e){var d=!1;!e&&!0==(d=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));e||J.i18n.GT.setDoTranslate(d);return a},"~N,~S,~S,~B");f(d,"commandExpected",function(){this.ichToken=
this.ichCurrentCommand;return this.error(2)});f(d,"error",function(a){return this.errorIntStr2(a,null,null)},"~N");f(d,"errorStr",function(a,b){return this.errorIntStr2(a,b,null)},"~N,~S");f(d,"errorIntStr2",function(a,b,c){var e=JS.ScriptTokenParser.errorString(a,b,c,!0);a=J.i18n.GT.getDoTranslate()?JS.ScriptTokenParser.errorString(a,b,c,!1):null;return this.errorStr2(e,a)},"~N,~S,~S");f(d,"isError",function(){return null!=this.errorMessage});f(d,"errorStr2",function(a,b){this.errorMessage=a;this.errorMessageUntranslated=
b;return!1},"~S,~S")});L("JV");M(["JV.JmolStateCreator","java.util.Hashtable"],"JV.StateCreator","java.util.Arrays $.Date JU.BS $.Lst $.P3 $.PT $.SB J.c.PAL $.STR $.VDW JM.AtomCollection $.Bond $.BondSet JS.T J.shape.Shape JU.BSUtil $.C $.ColorEncoder $.Edge $.Escape $.Font $.Logger JV.GlobalSettings $.JC $.StateManager $.Viewer".split(" "),function(){var d=Q(function(){this.undoWorking=!1;this.temp3=this.temp2=this.temp=this.vwr=this.actionStatesRedo=this.actionStates=null;O(this,arguments)},JV,
"StateCreator",JV.JmolStateCreator);X(d,function(){this.temp=new java.util.Hashtable;this.temp2=new java.util.Hashtable;this.temp3=new java.util.Hashtable});R(d,function(){V(this,JV.StateCreator,[]);this.actionStates=new JU.Lst;this.actionStatesRedo=new JU.Lst});s(d,"setViewer",function(a){this.vwr=a},"JV.Viewer");s(d,"getStateScript",function(a,b,c){var e=null==a||a.equalsIgnoreCase("all"),d=new JU.SB,f=e?(new JU.SB).append("function _setState() {\n"):null;e&&(d.append("# Jmol state version "+JV.Viewer.getJmolVersion()+
";\n"),this.vwr.isApplet&&(this.app(d,"# fullName = "+JU.PT.esc(this.vwr.fullName)),this.app(d,"# documentBase = "+JU.PT.esc(JV.Viewer.appletDocumentBase)),this.app(d,"# codeBase = "+JU.PT.esc(JV.Viewer.appletCodeBase)),d.append("\n")));var h=this.vwr.g;(e||a.equalsIgnoreCase("windowState"))&&d.append(this.getWindowState(f,b,c));(e||a.equalsIgnoreCase("fileState"))&&d.append(this.getFileState(f));(e||a.equalsIgnoreCase("definedState"))&&d.append(this.getDefinedState(f,!0));(e||a.equalsIgnoreCase("variableState"))&&
d.append(this.getParameterState(h,f));(e||a.equalsIgnoreCase("dataState"))&&d.append(this.getDataState(f));(e||a.equalsIgnoreCase("modelState"))&&d.append(this.getModelState(f,!0,this.vwr.getBooleanProperty("saveProteinStructureState")));(e||a.equalsIgnoreCase("colorState"))&&d.append(this.getColorState(this.vwr.cm,f));(e||a.equalsIgnoreCase("frameState"))&&d.append(this.getAnimState(this.vwr.am,f));(e||a.equalsIgnoreCase("perspectiveState"))&&d.append(this.getViewState(this.vwr.tm,f));(e||a.equalsIgnoreCase("selectionState"))&&
d.append(this.getSelectionState(this.vwr.slm,f));null!=f&&(this.app(f,"set refreshing true"),this.app(f,"set antialiasDisplay "+h.antialiasDisplay),this.app(f,"set antialiasTranslucent "+h.antialiasTranslucent),this.app(f,"set antialiasImages "+h.antialiasImages),this.vwr.tm.spinOn&&this.app(f,"spin on"),f.append("}\n\n_setState;\n"));e&&d.appendSB(f);return d.toString()},"~S,~N,~N");f(d,"getDataState",function(a){var b=new JU.SB,c=!1,e=this.getAtomicPropertyState(-1,null);0<e.length&&(c=!0,b.append(e));
null!=this.vwr.userVdws&&(e=this.vwr.getDefaultVdwNameOrData(0,J.c.VDW.USER,this.vwr.bsUserVdws),0<e.length&&(c=!0,b.append(e)));null!=this.vwr.nmrCalculation&&(c=(new Boolean(c|this.vwr.nmrCalculation.getState(b))).valueOf());null!=this.vwr.dm&&(c=(new Boolean(c|this.vwr.dm.getDataState(this,b))).valueOf());if(!c)return"";c="";null!=a&&(a.append("  _setDataState;\n"),c="function _setDataState() {\n",b.append("}\n\n"));return c+b.toString()},"JU.SB");f(d,"getDefinedState",function(a,b){var c=this.vwr.ms,
e=c.stateScripts.size();if(0==e)return"";for(var d=!1,f=new JU.SB,h,j=0;j<e;j++){var l=c.stateScripts.get(j);if(l.inDefinedStateBlock&&0<(h=l.toString()).length)this.app(f,h),d=!0}if(!d)return"";h="";b&&null!=a&&(a.append("  _setDefinedState;\n"),h="function _setDefinedState() {\n\n");null!=a&&f.append("\n}\n\n");return h+f.toString()},"JU.SB,~B");s(d,"getModelState",function(a,b,c){var e=new JU.SB;b&&null!=a&&(a.append("  _setModelState;\n"),e.append("function _setModelState() {\n"));var d,f=this.vwr.ms,
h=f.bo,j=f.am,l=f.mc;if(b){for(var r=f.stateScripts.size(),m=0;m<r;m++){var k=f.stateScripts.get(m);!k.inDefinedStateBlock&&0<(d=k.toString()).length&&this.app(e,d)}d=new JU.SB;r=!1;if(null!=f.unitCells){k=!1;for(m=0;m<l;m++){var p=f.getUnitCell(m);null!=p&&(d.setLength(0),p.getState(f,m,d)&&(r=!0,e.append("  frame ").append(f.getModelNumberDotted(m)).appendSB(d).append(";\n")),k=(new Boolean(k|0<=this.vwr.ms.getLastVibrationVector(m,1275072532))).valueOf())}r&&this.vwr.shm.loadShape(33);this.getShapeStatePriv(e,
b,33);if(k){r=new java.util.Hashtable;for(m=l;0<=--m;)if(0<=(k=this.vwr.ms.getLastVibrationVector(m,1275072532)))for(p=j[m].firstAtomIndex;p<=k;p++){var q=f.getModulation(p);null!=q&&JU.BSUtil.setMapBitSet(r,p,p,q.getState())}e.append(this.getCommands(r,null,"select"))}}d.setLength(0);for(m=0;m<f.bondCount;m++)if(!j[h[m].atom1.mi].isModelKit&&(h[m].isHydrogen()||0!=(h[m].order&131072)))r=h[m],k=r.atom1.i,r.atom1.group.isAdded(k)&&(k=-1-k),d.appendI(k).appendC("\t").appendI(r.atom2.i).appendC("\t").appendI(r.order&
131071).appendC("\t").appendF(r.mad/1E3).appendC("\t").appendF(r.getEnergy()).appendC("\t").append(JU.Edge.getBondOrderNameFromOrder(r.order)).append(";\n");0<d.length()&&e.append('data "connect_atoms"\n').appendSB(d).append('end "connect_atoms";\n');e.append("\n")}if(f.haveHiddenBonds){d=new JM.BondSet;for(m=f.bondCount;0<=--m;)0!=h[m].mad&&0==(h[m].shapeVisibilityFlags&JM.Bond.myVisibilityFlag)&&d.set(m);d.isEmpty()?f.haveHiddenBonds=!1:e.append("  hide ").append(JU.Escape.eBond(d)).append(";\n")}this.vwr.setModelVisibility();
c&&e.append(f.getProteinStructureState(null,b?1073742327:1073742158));for(m=0;m<l;m++)null!=j[m].mat4&&e.append("  frame orientation "+f.getModelNumberDotted(m)+JU.Escape.matrixToScript(j[m].mat4)+";\n");this.getShapeStatePriv(e,b,2147483647);if(b){c=!1;for(m=0;m<l;m++)if(j[m].isJmolDataFrame){c=!0;break}d=new JU.SB;for(m=0;m<l;m++)h=j[m],d.setLength(0),r=f.getInfo(m,"modelID"),null!=r&&!r.equals(f.getInfo(m,"modelID0"))&&d.append("  frame ID ").append(JU.PT.esc(r)).append(";\n"),r=f.frameTitles[m],
null!=r&&0<r.length&&d.append("  frame title ").append(JU.PT.esc(r)).append(";\n"),c&&(null!=h.orientation&&!f.isTrajectorySubFrame(m))&&d.append("  ").append(h.orientation.getMoveToText(!1)).append(";\n"),0!=h.frameDelay&&!f.isTrajectorySubFrame(m)&&d.append("  frame delay ").appendF(h.frameDelay/1E3).append(";\n"),null!=h.simpleCage&&(d.append("  unitcell ").append(JU.Escape.eAP(h.simpleCage.getUnitCellVectors())).append(";\n"),this.getShapeStatePriv(d,b,33)),0<d.length()&&e.append("  frame "+f.getModelNumberDotted(m)+
";\n").appendSB(d);e.append("  set fontScaling "+this.vwr.getBoolean(603979845)+";\n")}null!=a&&e.append("\n}\n\n");return e.toString()},"JU.SB,~B,~B");f(d,"getWindowState",function(a,b,c){var e=this.vwr.g,d=new JU.SB;null!=a&&(a.append("  initialize;\n  set refreshing false;\n  _setWindowState;\n"),d.append("\nfunction _setWindowState() {\n"));0!=b&&d.append("# preferredWidthHeight ").appendI(b).append(" ").appendI(c).append(";\n");d.append("# width ").appendI(0==b?this.vwr.getScreenWidth():b).append(";\n# height ").appendI(0==
c?this.vwr.getScreenHeight():c).append(";\n");this.app(d,"stateVersion = "+JV.JC.versionInt);this.app(d,"background "+JU.Escape.escapeColor(e.objColors[0]));for(b=1;7>b;b++)0!=e.objColors[b]&&this.app(d,JV.StateManager.getObjectNameFromId(b)+'Color = "'+JU.Escape.escapeColor(e.objColors[b])+'"');null!=e.backgroundImageFileName&&this.app(d,"background IMAGE "+(e.backgroundImageFileName.startsWith(";base64,")?"":"/*file*/")+JU.PT.esc(e.backgroundImageFileName));d.append(this.getLightingState(!1));null!=
a&&d.append("}\n\n");return d.toString()},"JU.SB,~N,~N");s(d,"getLightingState",function(a){var b=new JU.SB,c=this.vwr.gdata;this.app(b,"set ambientPercent "+c.getAmbientPercent());this.app(b,"set diffusePercent "+c.getDiffusePercent());this.app(b,"set specular "+c.getSpecular());this.app(b,"set specularPercent "+c.getSpecularPercent());this.app(b,"set specularPower "+c.getSpecularPower());var e=c.getSpecularExponent(),d=c.getPhongExponent();this.app(b,Math.pow(2,e)==d?"set specularExponent "+e:"set phongExponent "+
d);this.app(b,"set celShading "+c.getCel());this.app(b,"set celShadingPower "+c.getCelPower());this.app(b,"set zShadePower "+this.vwr.g.zShadePower);a&&this.getZshadeState(b,this.vwr.tm,!0);return b.toString()},"~B");f(d,"getFileState",function(a){var b=new JU.SB;null!=a&&(a.append("  _setFileState;\n"),b.append("function _setFileState() {\n\n"));0>b.indexOf("append")&&this.vwr.getModelSetFileName().equals("zapped")&&b.append("  zap;\n");this.appendLoadStates(b);null!=a&&b.append("\n}\n\n");return b.toString()},
"JU.SB");f(d,"appendLoadStates",function(a){var b=this.vwr.ligandModelSet;if(null!=b)for(var c,b=b.keySet().iterator();b.hasNext()&&((c=b.next())||1);){var e=this.vwr.ligandModels.get(c+"_data");null!=e&&a.append("  ").append(JU.Escape.encapsulateData("ligand_"+c,e.trim()+"\n",0));e=this.vwr.ligandModels.get(c+"_file");null!=e&&a.append("  ").append(JU.Escape.encapsulateData("file_"+c,e.trim()+"\n",0))}var b=new JU.SB,e=this.vwr.ms,d=e.am,f=e.mc;for(c=0;c<f;c++)if(!e.isJmolDataFrameForModel(c)&&!e.isTrajectorySubFrame(c)){var h=
d[c],j=b.indexOf(h.loadState);(0>j||j!=b.lastIndexOf(h.loadState))&&b.append(d[c].loadState);if(d[c].isModelKit)j=e.getModelAtomBitSetIncludingDeleted(c,!1),null!=e.tainted&&(null!=e.tainted[2]&&e.tainted[2].andNot(j),null!=e.tainted[3]&&e.tainted[3].andNot(j)),h.loadScript=new JU.SB,this.getInlineData(b,this.vwr.getModelExtract(j,!1,!0,"MOL"),0<c,null,null);else if(b.appendSB(h.loadScript),j=h.auxiliaryInfo.get("auxFiles"),null!=j)for(h=0;h<j.size();h++)b.append(";#FILE1="+JU.PT.esc(j.get(h))+";")}b=
b.toString();if(0>b.indexOf('data "append ')){c=b.indexOf("load /*data*/");h=b.indexOf("load /*file*/");0<=h&&h<c&&(c=h);if(0<=(h=b.indexOf('load "@'))&&h<c)c=h;0<=c&&(b=b.substring(0,c)+"zap;"+b.substring(c))}a.append(b)},"JU.SB");s(d,"getInlineData",function(a,b,c,e,d){c=(c?"append"+(null!=e&&e.intValue()!=this.vwr.ms.mc-1?" modelindex="+e:""):"model")+" inline";a.append('load /*data*/ data "').append(c).append('"\n').append(b).append('end "').append(c).append(null==d||0==d.length?"":" filter"+
JU.PT.esc(d)).append('";')},"JU.SB,~S,~B,Integer,~S");f(d,"getColorState",function(a,b){var c=new JU.SB,e=this.getCEState(a.ce,c);0<e&&null!=b&&b.append("\n  _setColorState\n");return 0<e&&null!=b?"function _setColorState() {\n"+c.append("}\n\n").toString():c.toString()},"JV.ColorManager,JU.SB");f(d,"getCEState",function(a,b){for(var c=0,e,d=a.schemes.entrySet().iterator();d.hasNext()&&((e=d.next())||1);){var f=e.getKey();0<f.length&&(!f.startsWith("=")&&0<=c++)&&b.append('color "'+f+"="+JU.ColorEncoder.getColorSchemeList(e.getValue())+
'";\n')}return c},"JU.ColorEncoder,JU.SB");f(d,"getAnimState",function(a,b){var c=this.vwr.ms.mc;if(2>c)return"";var e=new JU.SB;null!=b&&(b.append("  _setFrameState;\n"),e.append("function _setFrameState() {\n"));e.append("# frame state;\n");e.append("# modelCount ").appendI(c).append(";\n# first ").append(this.vwr.getModelNumberDotted(0)).append(";\n# last ").append(this.vwr.getModelNumberDotted(c-1)).append(";\n");0<=a.backgroundModelIndex&&this.app(e,"set backgroundModel "+this.vwr.getModelNumberDotted(a.backgroundModelIndex));
if(null!=this.vwr.tm.bsFrameOffsets)this.app(e,"frame align "+JU.Escape.eBS(this.vwr.tm.bsFrameOffsets));else if(null!=this.vwr.ms.translations)for(;0<=--c;){var d=this.vwr.ms.getTranslation(c);null!=d&&this.app(e,"frame "+this.vwr.ms.getModelNumberDotted(c)+" align "+d)}this.app(e,"frame RANGE "+a.getModelSpecial(-1)+" "+a.getModelSpecial(1));this.app(e,"animation DIRECTION "+(1==a.animationDirection?"+1":"-1"));this.app(e,"animation FPS "+a.animationFps);this.app(e,"animation MODE "+JS.T.nameOf(a.animationReplayMode)+
" "+a.firstFrameDelay+" "+a.lastFrameDelay);0<a.morphCount&&this.app(e,"animation MORPH "+a.morphCount);c=!0;null!=a.animationFrames&&(this.app(e,"anim frames "+JU.Escape.eAI(a.animationFrames)),c=a.caf,this.app(e,"frame "+(c+1)),c=a.cmi!=a.modelIndexForFrame(c));c&&(c=a.getModelSpecial(0),this.app(e,c.equals("0")?"frame *":"model "+c));this.app(e,"animation "+(!a.animationOn?"OFF":1==a.currentDirection?"PLAY":"PLAYREV"));a.animationOn&&a.animationPaused&&this.app(e,"animation PAUSE");null!=b&&e.append("}\n\n");
return e.toString()},"JV.AnimationManager,JU.SB");f(d,"getParameterState",function(a,b){var c=Array(a.htBooleanParameterFlags.size()+a.htNonbooleanParameterValues.size()),e=new JU.SB;null!=b&&(b.append("  _setParameterState;\n"),e.append("function _setParameterState() {\n\n"));for(var d=0,f,h=a.htBooleanParameterFlags.keySet().iterator();h.hasNext()&&((f=h.next())||1);)JV.GlobalSettings.doReportProperty(f)&&(c[d++]="set "+f+" "+a.htBooleanParameterFlags.get(f));for(h=a.htNonbooleanParameterValues.keySet().iterator();h.hasNext()&&
((f=h.next())||1);)if(JV.GlobalSettings.doReportProperty(f)){var j=a.htNonbooleanParameterValues.get(f);"="==f.charAt(0)?f=f.substring(1):(f=(0==f.indexOf("default")?" ":"")+"set "+f,j=JU.Escape.e(j));c[d++]=f+" "+j}switch(a.axesMode){case 603979808:c[d++]="set axes unitcell";break;case 603979804:c[d++]="set axes molecular";break;default:c[d++]="set axes window"}java.util.Arrays.sort(c,0,d);for(f=0;f<d;f++)null!=c[f]&&this.app(e,c[f]);c=JV.StateManager.getVariableList(a.htUserVariables,0,!1,!0);0<
c.length&&(e.append("\n#user-defined atom sets; \n"),e.append(c));null!=this.vwr.shm.getShape(5)&&e.append(this.getDefaultLabelState(this.vwr.shm.shapes[5]));a.haveSetStructureList&&(c=a.structureList,e.append("struture HELIX set "+JU.Escape.eAF(c.get(J.c.STR.HELIX))),e.append("struture SHEET set "+JU.Escape.eAF(c.get(J.c.STR.SHEET))),e.append("struture TURN set "+JU.Escape.eAF(c.get(J.c.STR.TURN))));null!=b&&e.append("\n}\n\n");return e.toString()},"JV.GlobalSettings,JU.SB");f(d,"getDefaultLabelState",
function(a){var b=(new JU.SB).append("\n# label defaults;\n");this.app(b,"select none");this.app(b,J.shape.Shape.getColorCommand("label",a.defaultPaletteID,a.defaultColix,a.translucentAllowed));this.app(b,"background label "+J.shape.Shape.encodeColor(a.defaultBgcolix));this.app(b,"set labelOffset "+JV.JC.getXOffset(a.defaultOffset)+" "+JV.JC.getYOffset(a.defaultOffset));var c=JV.JC.getHorizAlignmentName(a.defaultAlignment);this.app(b,"set labelAlignment "+(5>c.length?"left":c));c=JV.JC.getPointerName(a.defaultPointer);
this.app(b,"set labelPointer "+(0==c.length?"off":c));0!=(a.defaultZPos&32)?this.app(b,"set labelFront"):0!=(a.defaultZPos&16)&&this.app(b,"set labelGroup");this.app(b,J.shape.Shape.getFontCommand("label",JU.Font.getFont3D(a.defaultFontId)));return b.toString()},"J.shape.Labels");f(d,"getSelectionState",function(a,b){var c=new JU.SB;null!=b&&(b.append("  _setSelectionState;\n"),c.append("function _setSelectionState() {\n"));null!=this.vwr.ms.trajectory&&this.app(c,this.vwr.ms.trajectory.getState());
var e=new java.util.Hashtable,d=null;this.addBs(c,"hide ",a.bsHidden);this.addBs(c,"subset ",a.bsSubset);this.addBs(c,"delete ",a.bsDeleted);this.addBs(c,"fix ",a.bsFixed);e.put("-",this.vwr.slm.getSelectedAtomsNoSubset());d=this.getCommands(e,null,"select");null==d?this.app(c,"select none"):c.append(d);this.app(c,"set hideNotSelected "+a.hideNotSelected);c.append(this.vwr.getShapeProperty(1,"selectionState"));this.vwr.getSelectionHalosEnabled()&&this.app(c,"SelectionHalos ON");null!=b&&c.append("}\n\n");
return c.toString()},"JV.SelectionManager,JU.SB");f(d,"getViewState",function(a,b){var c=new JU.SB,e=a.getMoveToText(0,!1);null!=b&&(b.append("  _setPerspectiveState;\n"),c.append("function _setPerspectiveState() {\n"));this.app(c,"set perspectiveModel "+a.perspectiveModel);this.app(c,"set scaleAngstromsPerInch "+a.scale3DAngstromsPerInch);this.app(c,"set perspectiveDepth "+a.perspectiveDepth);this.app(c,"set visualRange "+a.visualRangeAngstroms);a.isWindowCentered()||this.app(c,"set windowCentered false");
this.app(c,"set cameraDepth "+a.cameraDepth);var d=1==a.mode;d&&this.app(c,"set navigationMode true");this.app(c,this.vwr.ms.getBoundBoxCommand(!1));this.app(c,"center "+JU.Escape.eP(a.fixedRotationCenter));c.append(this.vwr.getOrientation(1073742034,null,null,null).toString());this.app(c,e);!d&&!a.zoomEnabled&&this.app(c,"zoom off");c.append("  slab ").appendI(a.slabPercentSetting).append(";depth ").appendI(a.depthPercentSetting).append(a.slabEnabled&&!d?";slab on":"").append(";\n");c.append("  set slabRange ").appendF(a.slabRange).append(";\n");
null!=a.slabPlane&&c.append("  slab plane ").append(JU.Escape.eP4(a.slabPlane)).append(";\n");null!=a.depthPlane&&c.append("  depth plane ").append(JU.Escape.eP4(a.depthPlane)).append(";\n");this.getZshadeState(c,a,!1);c.append(this.getSpinState(!0)).append("\n");this.vwr.ms.modelSetHasVibrationVectors()&&a.vibrationOn&&this.app(c,"set vibrationPeriod "+a.vibrationPeriod+";vibration on");e=null!=a.depthPlane||null!=a.slabPlane;d&&c.append(a.getNavigationState());!a.slabEnabled&&e&&c.append("  slab off;\n");
null!=b&&c.append("}\n\n");return c.toString()},"JV.TransformManager,JU.SB");f(d,"getZshadeState",function(a,b,c){c&&(this.app(a,"set zDepth "+b.zDepthPercentSetting),this.app(a,"set zSlab "+b.zSlabPercentSetting),b.zShadeEnabled||this.app(a,"set zShade false"));b.zShadeEnabled&&this.app(a,"set zShade true");try{null!=b.zSlabPoint&&this.app(a,"set zSlab "+JU.Escape.eP(b.zSlabPoint))}catch(e){if(!D(e,Exception))throw e;}},"JU.SB,JV.TransformManager,~B");s(d,"getSpinState",function(){var a=this.vwr.tm,
b="  set spinX "+F(a.spinX)+"; set spinY "+F(a.spinY)+"; set spinZ "+F(a.spinZ)+"; set spinFps "+F(a.spinFps)+";";Float.isNaN(a.navFps)||(b+="  set navX "+F(a.navX)+"; set navY "+F(a.navY)+"; set navZ "+F(a.navZ)+"; set navFps "+F(a.navFps)+";");a.navOn&&(b+=" navigation on;");if(!a.spinOn)return b;var c=a.isSpinSelected?"\n  select "+JU.Escape.eBS(this.vwr.bsA())+";\n  rotateSelected":"\n ";if(a.isSpinInternal){var e=JU.P3.newP(a.internalRotationCenter);e.sub(a.rotationAxis);b+=c+" spin "+a.rotationRate+
" "+JU.Escape.eP(a.internalRotationCenter)+" "+JU.Escape.eP(e)}else b=a.isSpinFixed?b+(c+" spin axisangle "+JU.Escape.eP(a.rotationAxis)+" "+a.rotationRate):b+" spin on";return b+";"},"~B");s(d,"getCommands",function(a,b,c){var e=new JU.SB;a=this.getCommands2(a,e,null,c);null!=b&&this.getCommands2(b,e,a,"select");return e.toString()},"java.util.Map,java.util.Map,~S");f(d,"getCommands2",function(a,b,c,e){if(null==a)return"";var d;for(a=a.entrySet().iterator();a.hasNext()&&((d=a.next())||1);){var f=
d.getKey(),h=JU.Escape.eBS(d.getValue());5>h.length||(h=e+" "+h,h.equals(c)||this.app(b,h),c=h,0!=f.indexOf("-")&&this.app(b,f))}return c},"java.util.Map,JU.SB,~S,~S");f(d,"app",function(a,b){0!=b.length&&a.append("  ").append(b).append(";\n")},"JU.SB,~S");f(d,"addBs",function(a,b,c){null==c||0==c.length()||this.app(a,b+JU.Escape.eBS(c))},"JU.SB,~S,JU.BS");f(d,"getFontState",function(a,b){var c=JV.StateManager.getObjectIdFromName(a.equalsIgnoreCase("axes")?"axis":a);if(0>c)return"";var e=this.vwr.getObjectMad10(c),
c=(new JU.SB).append("\n");this.app(c,a+(0==e?" off":1==e?" on":-1==e?" dotted":20>e?" "+e:" "+e/2E4));if(3>c.length())return"";e=J.shape.Shape.getFontCommand(a,b);0<e.length&&(e="  "+e+";\n");return c+e},"~S,JU.Font");f(d,"appendTickInfo",function(a,b,c){b.append("  ");b.append(a);JV.StateCreator.addTickInfo(b,c,!1);b.append(";\n")},"~S,JU.SB,JM.TickInfo");d.addTickInfo=f(d,"addTickInfo",function(a,b,c){a.append(" ticks ").append(b.type).append(" ").append(JU.Escape.eP(b.ticks));var e=null!=b.scale&&
Float.isNaN(b.scale.x);e&&a.append(" UNITCELL");null!=b.tickLabelFormats&&a.append(" format ").append(JU.Escape.eAS(b.tickLabelFormats,!1));!e&&null!=b.scale&&a.append(" scale ").append(JU.Escape.eP(b.scale));c&&(!Float.isNaN(b.first)&&0!=b.first)&&a.append(" first ").appendF(b.first);null!=b.reference&&a.append(" point ").append(JU.Escape.eP(b.reference))},"JU.SB,JM.TickInfo,~B");f(d,"getMeasurementState",function(a){var b=a.measurements,c=a.measurementCount,e=a.font3d,d=a.defaultTickInfo,f=new JU.SB;
this.app(f,"measures delete");for(var h=0;h<c;h++){var j=b.get(h),l=null!=j.property;if(!l||!Float.isNaN(j.value)){var r=j.count,m=(new JU.SB).append("measure");null!=j.thisID&&m.append(" ID ").append(JU.PT.esc(j.thisID));0!=j.mad&&m.append(" radius ").appendF(null==j.thisID||0<j.mad?j.mad/2E3:0);0!=j.colix&&m.append(" color ").append(JU.Escape.escapeColor(JU.C.getArgb(j.colix)));null!=j.text&&(null!=j.text.font&&m.append(" font ").append(j.text.font.getInfo()),0!=j.text.align&&m.append(" align ").append(JV.JC.getHorizAlignmentName(j.text.align)),
null!=j.text.pymolOffset&&m.append(" offset ").append(JU.Escape.eAF(j.text.pymolOffset)));var k=j.tickInfo;null!=k&&JV.StateCreator.addTickInfo(m,k,!0);for(k=1;k<=r;k++)m.append(" ").append(j.getLabel(k,!0,!0));l?m.append(" "+j.property+" value "+(Double.isNaN(j.value)?0:j.value)).append(" "+JU.PT.esc(j.getString())):2==r&&(j=j.getDistanceFormatForState(),null!=j&&m.append(" ").append(JU.PT.esc(j)));l||m.append("; # "+a.getInfoAsString(h));this.app(f,m.toString())}}this.app(f,J.shape.Shape.getFontCommand("measures",
e));e=0;l=new java.util.Hashtable;m=JU.BS.newN(c);for(h=0;h<c;h++)j=b.get(h),j.isHidden&&(e++,m.set(h)),null!=a.bsColixSet&&a.bsColixSet.get(h)&&JU.BSUtil.setMapBitSet(l,h,h,J.shape.Shape.getColorCommandUnk("measure",j.colix,a.translucentAllowed));if(0<e)if(e==c)this.app(f,"measures off; # lines and numbers off");else for(h=0;h<c;h++)m.get(h)&&JU.BSUtil.setMapBitSet(l,h,h,"measure off");null!=d&&(f.append(" measure "),JV.StateCreator.addTickInfo(f,d,!0),f.append(";\n"));0<=a.mad&&f.append(" set measurements ").appendF(a.mad/
2E3).append(";\n");j=this.getCommands(l,null,"select measures");null!=j&&0!=j.length&&(f.append(j),this.app(f,"select measures ({null})"));return f.toString()},"J.shape.Measures");f(d,"getShapeStatePriv",function(a,b,c){var e=this.vwr.shm.shapes;if(null!=e){var d;2147483647==c?(c=0,d=37):d=c+1;for(;c<d;++c){var f=e[c];if(null!=f&&(b||9<=c&&16>c))f=this.getShapeState(f),null!=f&&1<f.length&&a.append(f)}a.append("  select *;\n")}},"JU.SB,~B,~N");f(d,"getBondState",function(a){var b=a.bsOrderSet,c=a.reportAll;
this.clearTemp();var e=this.vwr.ms,d=e.bo,f=e.bondCount,h;if(c||null!=a.bsSizeSet)for(e=c?f-1:a.bsSizeSet.nextSetBit(0);0<=e;e=c?e-1:a.bsSizeSet.nextSetBit(e+1))JU.BSUtil.setMapBitSet(this.temp,e,e,"wireframe "+(1==(h=d[e].mad)?"on":""+JU.PT.escF(h/2E3)));if(c||null!=b)for(e=c?f-1:b.nextSetBit(0);0<=e;e=c?e-1:b.nextSetBit(e+1))h=d[e],(c||0==(h.order&131072))&&JU.BSUtil.setMapBitSet(this.temp,e,e,"bondOrder "+JU.Edge.getBondOrderNameFromOrder(h.order));if(null!=a.bsColixSet)for(e=a.bsColixSet.nextSetBit(0);0<=
e;e=a.bsColixSet.nextSetBit(e+1))b=d[e].colix,2==(b&-30721)?JU.BSUtil.setMapBitSet(this.temp,e,e,J.shape.Shape.getColorCommand("bonds",J.c.PAL.CPK.id,b,a.translucentAllowed)):JU.BSUtil.setMapBitSet(this.temp,e,e,J.shape.Shape.getColorCommandUnk("bonds",b,a.translucentAllowed));a=this.getCommands(this.temp,null,"select BONDS")+"\n";this.clearTemp();return a},"J.shape.Sticks");f(d,"clearTemp",function(){this.temp.clear();this.temp2.clear()});f(d,"getShapeState",function(a){var b;switch(a.shapeID){case 34:b=
this.getAxesState(a);break;case 33:if(!this.vwr.ms.haveUnitCells)return"";a=b=this.getFontLineShapeState(a);var c=this.vwr.am.getUnitCellAtomIndex();0<=c&&(b+="  unitcell ({"+c+"});\n");c=this.vwr.getCurrentUnitCell();null!=c&&(b+=c.getUnitCellState(),b+=a);break;case 32:b=this.getFontLineShapeState(a);break;case 36:b=this.getFontState(a.myType,a.baseFont3d);break;case 6:b=this.getMeasurementState(a);break;case 7:case 18:b=this.getAtomShapeState(a);break;case 1:b=this.getBondState(a);break;case 31:b=
new JU.SB;b.append('\n  set echo off;set echo "%SCALE" off;\n');this.getEchoState(b,a.scaleObject);for(a=a.objects.values().iterator();a.hasNext()&&((c=a.next())||1);)this.getEchoState(b,c);b=b.toString();break;case 8:b=this.getAtomShapeState(a)+(2==a.colixSelection?"":0==a.colixSelection?"  color SelectionHalos NONE;\n":J.shape.Shape.getColorCommandUnk("selectionHalos",a.colixSelection,a.translucentAllowed)+";\n");null!=a.bsHighlight&&(b+="  set highlight "+JU.Escape.eBS(a.bsHighlight)+"; "+J.shape.Shape.getColorCommandUnk("highlight",
a.colixHighlight,a.translucentAllowed)+";\n");break;case 35:this.clearTemp();if(null!=a.atomFormats){c=this.vwr.ms.at;for(b=this.vwr.ms.ac;0<=--b;)null==c[b]&&(a.atomFormats[b]=null),null!=a.atomFormats[b]&&JU.BSUtil.setMapBitSet(this.temp,b,b,"set hoverLabel "+JU.PT.esc(a.atomFormats[b]))}b="\n  hover "+JU.PT.esc(null==a.labelFormat?"":a.labelFormat)+";\n"+this.getCommands(this.temp,null,"select");this.clearTemp();break;case 5:if(!a.isActive||null==a.bsSizeSet)return"";this.clearTemp();for(b=a.bsSizeSet.nextSetBit(0);0<=
b;b=a.bsSizeSet.nextSetBit(b+1)){var c=a.getLabel(b),e="label ";null==c?e+=JU.PT.esc(a.formats[b]):(e+=JU.PT.esc(c.textUnformatted),null!=c.pymolOffset&&(e+=";set labelOffset "+JU.Escape.eAF(c.pymolOffset)));JU.BSUtil.setMapBitSet(this.temp,b,b,e);null!=a.bsColixSet&&a.bsColixSet.get(b)&&JU.BSUtil.setMapBitSet(this.temp2,b,b,J.shape.Shape.getColorCommand("label",a.paletteIDs[b],a.colixes[b],a.translucentAllowed));null!=a.bsBgColixSet&&a.bsBgColixSet.get(b)&&JU.BSUtil.setMapBitSet(this.temp2,b,b,"background label "+
J.shape.Shape.encodeColor(a.bgcolixes[b]));c=a.getLabel(b);c=null!=c?c.scalePixelsPerMicron:0;0<c&&JU.BSUtil.setMapBitSet(this.temp2,b,b,"set labelScaleReference "+1E4/c);if(null!=a.offsets&&a.offsets.length>b){c=a.offsets[b];JU.BSUtil.setMapBitSet(this.temp2,b,b,"set "+(JV.JC.isOffsetAbsolute(c)?"labelOffsetAbsolute ":"labelOffset ")+JV.JC.getXOffset(c)+" "+JV.JC.getYOffset(c));var e=JV.JC.getHorizAlignmentName(c>>2),d=JV.JC.getPointerName(c);0<d.length&&JU.BSUtil.setMapBitSet(this.temp2,b,b,"set labelPointer "+
d);0!=(c&32)?JU.BSUtil.setMapBitSet(this.temp2,b,b,"set labelFront"):0!=(c&16)&&JU.BSUtil.setMapBitSet(this.temp2,b,b,"set labelGroup");0<e.length&&JU.BSUtil.setMapBitSet(this.temp3,b,b,"set labelAlignment "+e)}null!=a.mads&&0>a.mads[b]&&JU.BSUtil.setMapBitSet(this.temp2,b,b,"set toggleLabel");null!=a.bsFontSet&&a.bsFontSet.get(b)&&JU.BSUtil.setMapBitSet(this.temp2,b,b,J.shape.Shape.getFontCommand("label",JU.Font.getFont3D(a.fids[b])))}b=this.getCommands(this.temp,this.temp2,"select")+this.getCommands(null,
this.temp3,"select");this.temp3.clear();this.clearTemp();break;case 0:this.clearTemp();var c=this.vwr.ms.ac,e=this.vwr.ms.at,d=a.colixes,f=a.paletteIDs,h=0;for(b=0;b<c;b++)if(null!=e[b]&&(null!=a.bsSizeSet&&a.bsSizeSet.get(b)&&(0>(h=e[b].madAtom)?JU.BSUtil.setMapBitSet(this.temp,b,b,"Spacefill on"):JU.BSUtil.setMapBitSet(this.temp,b,b,"Spacefill "+JU.PT.escF(h/2E3))),null!=a.bsColixSet&&a.bsColixSet.get(b))){var j=e[b].paletteID;(j!=J.c.PAL.CPK.id||JU.C.isColixTranslucent(e[b].colixAtom))&&JU.BSUtil.setMapBitSet(this.temp,
b,b,J.shape.Shape.getColorCommand("atoms",j,e[b].colixAtom,a.translucentAllowed));null!=d&&b<d.length&&JU.BSUtil.setMapBitSet(this.temp2,b,b,J.shape.Shape.getColorCommand("balls",f[b],d[b],a.translucentAllowed))}b=this.getCommands(this.temp,this.temp2,"select");this.clearTemp();break;default:b=a.getShapeState()}return b},"J.shape.Shape");f(d,"getFontLineShapeState",function(a){var b=this.getFontState(a.myType,a.font3d);if(null==a.tickInfos)return b;var c=0<=b.indexOf(" off"),e=new JU.SB;e.append(b);
for(b=0;4>b;b++)null!=a.tickInfos[b]&&this.appendTickInfo(a.myType,e,a.tickInfos[b]);c&&e.append("  "+a.myType+" off;\n");return e.toString()},"J.shape.FontLineShape");f(d,"getAxesState",function(a){var b=new JU.SB;b.append(this.getFontLineShapeState(a));return a.getAxesState(b)},"J.shape.Axes");s(d,"getAtomShapeState",function(a){if(!a.isActive)return"";this.clearTemp();var b=JV.JC.shapeClassBases[a.shapeID],c=18==a.shapeID,e;if(null!=a.bsSizeSet)for(var d=a.bsSizeSet.nextSetBit(0);0<=d;d=a.bsSizeSet.nextSetBit(d+
1))JU.BSUtil.setMapBitSet(this.temp,d,d,b+" "+(0>(e=a.mads[d])?c&&-1>e?""+-e:"on":JU.PT.escF(e/2E3)));if(null!=a.bsColixSet)for(d=a.bsColixSet.nextSetBit(0);0<=d;d=a.bsColixSet.nextSetBit(d+1))JU.BSUtil.setMapBitSet(this.temp2,d,d,J.shape.Shape.getColorCommand(b,a.paletteIDs[d],a.colixes[d],a.translucentAllowed));a=this.getCommands(this.temp,this.temp2,"select");this.clearTemp();return a},"J.shape.AtomShape");f(d,"getEchoState",function(a,b){var c=null!=b&&0<b.barPixels,e=null==b?null:c?b.textUnformatted:
b.getStateText();if(!(null==e||!b.isEcho||b.target.equals("error"))){var d=null!=b.image,f=null,h="set echo ID "+JU.PT.esc(b.target);switch(b.valign){case 3:f=2147483647==b.movableXPercent||2147483647==b.movableYPercent?(2147483647==b.movableXPercent?b.movableX+" ":b.movableXPercent+"% ")+(2147483647==b.movableYPercent?b.movableY+"":b.movableYPercent+"%"):"["+b.movableXPercent+" "+b.movableYPercent+"%]";case 4:null==f&&(f=JU.Escape.eP(b.xyz));a.append("  ").append(h).append(" ").append(f);4!=b.align&&
a.append(";  ").append(h).append(" ").append(JV.JC.getHorizAlignmentName(b.align));break;default:a.append("  set echo ").append(JV.JC.getEchoName(b.valign)).append(" ").append(JV.JC.getHorizAlignmentName(b.align))}2147483647!=b.movableZPercent&&a.append(";  ").append(h).append(" depth ").appendI(b.movableZPercent);d?a.append("; ").append(h).append(" IMAGE /*file*/"):a.append("; echo ");a.append(JU.PT.esc(e));a.append(";\n");d&&1!=b.imageScale&&a.append("  ").append(h).append(" scale ").appendF(b.imageScale).append(";\n");
null!=b.script&&a.append("  ").append(h).append(" script ").append(JU.PT.esc(b.script)).append(";\n");0<=b.modelIndex&&a.append("  ").append(h).append(" model ").append(this.vwr.getModelNumberDotted(b.modelIndex)).append(";\n");null!=b.pointerPt&&a.append("  ").append(h).append(" point ").append(u(b.pointerPt,"JM.Atom")?"({"+b.pointerPt.i+"})":JU.Escape.eP(b.pointerPt)).append(";\n");null!=b.pymolOffset&&a.append("  ").append(h).append(" offset ").append(JU.Escape.escapeFloatA(b.pymolOffset,!0)).append(";\n");
b.appendFontCmd(a);a.append("; color echo");JU.C.isColixTranslucent(b.colix)&&a.append(" ").append(JU.C.getColixTranslucencyLabel(b.colix));a.append(" ").append(JU.C.getHexCode(b.colix));0!=b.bgcolix&&(a.append("; color echo background "),JU.C.isColixTranslucent(b.bgcolix)&&a.append(JU.C.getColixTranslucencyLabel(b.bgcolix)).append(" "),a.append(JU.C.getHexCode(b.bgcolix)));a.append(";\n");b.hidden&&(c?a.append('  set echo "%SCALE" hidden;\n'):a.append("  set echo ID ").append(JU.PT.esc(b.target)).append(" hidden;\n"))}},
"JU.SB,JM.Text");s(d,"getAllSettings",function(a){for(var b=this.vwr.g,c=new JU.SB,e=Array(b.htBooleanParameterFlags.size()+b.htNonbooleanParameterValues.size()+b.htUserVariables.size()),d=0,f="_"+a,h,j=b.htBooleanParameterFlags.keySet().iterator();j.hasNext()&&((h=j.next())||1);)if(null==a||0==h.indexOf(a)||0==h.indexOf(f))e[d++]=(0==h.indexOf("_")?h+" = ":"set "+h+" ")+b.htBooleanParameterFlags.get(h);for(j=b.htNonbooleanParameterValues.keySet().iterator();j.hasNext()&&((h=j.next())||1);)if("@"!=
h.charAt(0)&&(null==a||0==h.indexOf(a)||0==h.indexOf(f))){var l=b.htNonbooleanParameterValues.get(h);"string"==typeof l&&(l=JV.StateCreator.chop(JU.PT.esc(l)));e[d++]=(0==h.indexOf("_")?h+" = ":"set "+h+" ")+l}for(j=b.htUserVariables.keySet().iterator();j.hasNext()&&((h=j.next())||1);)if(null==a||0==h.indexOf(a))l=b.htUserVariables.get(h),f=l.escape(),e[d++]=h+" "+(h.startsWith("@")?"":"= ")+(4==l.tok?JV.StateCreator.chop(JU.PT.esc(f)):f);java.util.Arrays.sort(e,0,d);for(a=0;a<d;a++)null!=e[a]&&this.app(c,
e[a]);c.append("\n");return c.toString()},"~S");d.chop=f(d,"chop",function(a){var b=a.length;if(512>b)return a;for(var c=new JU.SB,d=0,f=72;f<b;d=f,f+=72){for(;"\\"==a.charAt(f-1);)f++;c.append(0==d?"":'"\\\n    + "').append(a.substring(d,f))}c.append('"\\\n    + "').append(a.substring(d,b));return c.toString()},"~S");s(d,"getFunctionCalls",function(a){null==a&&(a="");var b=new JU.SB,c=a.indexOf("*"),d=0<=c,f=JV.Viewer.isStaticFunction(a),n=a.equalsIgnoreCase("names")||a.equalsIgnoreCase("static_names");
n&&(a="");d&&(a=a.substring(0,c));a=a.toLowerCase();(f||0==a.length)&&this.addFunctions(b,JV.Viewer.staticFunctions,a,d,n);(!f||0==a.length)&&this.addFunctions(b,this.vwr.localFunctions,a,d,n);return b.toString()},"~S");f(d,"addFunctions",function(a,b,c,d,f){for(var n=Array(b.size()),h=0,j,l=b.keySet().iterator();l.hasNext()&&((j=l.next())||1);)if(0==c.length&&!j.startsWith("_")||j.equalsIgnoreCase(c)||d&&0==j.toLowerCase().indexOf(c))n[h++]=j;java.util.Arrays.sort(n,0,h);for(c=0;c<h;c++)d=b.get(n[c]),
a.append(f?d.getSignature():d.toString()),a.appendC("\n")},"JU.SB,java.util.Map,~S,~B,~B");d.isTainted=f(d,"isTainted",function(a,b,c){return null!=a&&null!=a[c]&&a[c].get(b)},"~A,~N,~N");s(d,"getAtomicPropertyState",function(a,b){for(var c,d=new JU.SB,f=0;18>f;f++)if(0>a||f==a)null!=(c=null!=b?b:this.vwr.ms.getTaintedAtoms(f))&&this.getAtomicPropertyStateBuffer(d,f,c,null,null);return d.toString()},"~N,JU.BS");s(d,"getAtomicPropertyStateBuffer",function(a,b,c,d,f){if(this.vwr.g.preserveState){var n=
new JU.SB;d=(null==d?JM.AtomCollection.userSettableValues[b]:d)+" set";var h=0,j=2==b,l=this.vwr.ms.at,r=this.vwr.ms.tainted;if(null!=c)for(var m=c.nextSetBit(0);0<=m;m=c.nextSetBit(m+1))if(!JM.AtomCollection.isDeleted(l[m])){n.appendI(m+1).append(" ").append(l[m].getElementSymbol()).append(" ").append(l[m].getInfo().$replace(" ","_")).append(" ");switch(b){case 18:m<f.length&&n.appendF(f[m]);break;case 13:n.appendI(l[m].getAtomNumber());break;case 16:n.append(l[m].getChainIDStr());break;case 15:n.appendI(l[m].group.getResno());
break;case 14:n.appendI(l[m].getSeqID());break;case 0:n.append(l[m].getAtomName());break;case 1:n.append(l[m].getAtomType());break;case 2:JV.StateCreator.isTainted(r,m,2)&&(j=!1);n.appendF(l[m].x).append(" ").appendF(l[m].y).append(" ").appendF(l[m].z);break;case 12:var k=l[m].getVibrationVector();null==k?n.append("0 0 0"):Float.isNaN(k.modScale)?n.appendF(k.x).append(" ").appendF(k.y).append(" ").appendF(k.z):n.appendF(1.4E-45).append(" ").appendF(1.4E-45).append(" ").appendF(k.modScale);break;case 17:n.appendI(l[m].getAtomSite());
break;case 3:n.appendI(l[m].getAtomicAndIsotopeNumber());break;case 4:n.appendI(l[m].getFormalCharge());break;case 6:n.appendF(l[m].getBondingRadius());break;case 7:n.appendI(l[m].getOccupancy100());break;case 8:n.appendF(l[m].getPartialCharge());break;case 9:n.appendF(l[m].getBfactor100()/100);break;case 10:n.appendI(l[m].getValence());break;case 11:n.appendF(l[m].getVanderwaalsRadiusFloat(this.vwr,J.c.VDW.AUTO))}n.append(" ;\n");++h}0!=h&&(j&&(d+="(default)"),a.append('\n  DATA "'+d+'"\n').appendI(h).append(" ;\nJmol Property Data Format 1 -- Jmol ").append(JV.Viewer.getJmolVersion()).append(";\n"),
a.appendSB(n),a.append('  end "'+d+'";\n'))}},"JU.SB,~N,JU.BS,~S,~A");s(d,"undoMoveAction",function(a,b){switch(a){case 4165:case 4140:switch(b){case 1275068425:return(4165==a?this.actionStates:this.actionStatesRedo).size();case -2:this.actionStates.clear();this.actionStatesRedo.clear();break;case -1:(4165==a?this.actionStates:this.actionStatesRedo).clear();break;case 0:b=2147483647;default:100<b&&(b=(4165==a?this.actionStates:this.actionStatesRedo).size());for(var c=0;c<b;c++)this.undoMoveActionClear(0,
a,!0)}}return 0},"~N,~N");s(d,"undoMoveActionClear",function(a,b,c){if(this.vwr.g.preserveState){var d=0<=a?this.vwr.ms.at[a].mi:this.vwr.ms.mc-1;switch(b){case 4140:case 4165:this.vwr.stopMinimization();var f="";switch(b){default:case 4165:f=this.actionStates;a=this.actionStatesRedo;break;case 4140:if(f=this.actionStatesRedo,a=this.actionStates,1==this.actionStatesRedo.size())return}if(0==f.size()||this.undoWorking)return;this.undoWorking=!0;a.add(0,f.removeItemAt(0));f=this.actionStatesRedo.get(0);
4165==b&&1==a.size()&&(a=K(-1,[1]),b=JU.PT.parseIntNext(f,a),a=JU.PT.parseIntNext(f,a),this.undoMoveActionClear(a,b,!1));this.vwr.ms.am[d].isModelKit||0>f.indexOf("zap ")?(JU.Logger.debugging&&this.vwr.log(f),this.vwr.evalStringQuiet(f)):this.actionStates.clear();break;default:if(this.undoWorking&&c)return;this.undoWorking=!0;f=new JU.SB;f.append("#"+b+" "+a+" "+new java.util.Date+"\n");0<=a?(d=this.vwr.getModelUndeletedAtomsBitSet(d),this.vwr.ms.taintAtoms(d,b),f.append(this.getAtomicPropertyState(-1,
null))):(d=this.vwr.getModelUndeletedAtomsBitSet(d),f.append("zap "),f.append(JU.Escape.eBS(d)).append(";"),this.getInlineData(f,this.vwr.getModelExtract(d,!1,!0,"MOL"),!0,null,null),f.append("set refreshing false;").append(this.vwr.acm.getPickingState()).append(this.vwr.tm.getMoveToText(0,!1)).append("set refreshing true;"));c?(this.actionStates.add(0,f.toString()),this.actionStatesRedo.clear()):this.actionStatesRedo.add(1,f.toString());100==this.actionStates.size()&&this.actionStates.removeItemAt(99)}this.undoWorking=
!c}},"~N,~N,~B")});L("JV");$(JV,"JmolStateCreator",null)})(Clazz,Clazz.getClassName,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.newFloatArray,Clazz.declareType,Clazz.prepareFields,Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,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.isAB,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);
