(function(Y,Z,$,aa,ba,ca,O,K,P,Q,R,F,S,T,da,N,G,U,L,V,ea,W,fa,ga,ha,ia,ja,ka,la,ma,A,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za,Aa,Ba,Ca,Da,Ea,Fa,Ga,Ha,Ia,Ja,Ka,La,Ma,Na,l,X){O("JS");c$=R(function(){this.e=this.vwr=null;this.chk=!1;this.st=null;this.slen=0;Q(this,arguments)},JS,"ScriptExt");l(c$,"init",function(a){this.e=a;this.vwr=this.e.vwr;return this},"~O");l(c$,"atomExpressionAt",function(a){return this.e.atomExpressionAt(a)},"~N");l(c$,"checkLength",function(a){this.e.checkLength(a)},"~N");l(c$,
"error",function(a){this.e.error(a)},"~N");l(c$,"invArg",function(){this.e.invArg()});l(c$,"invPO",function(){this.error(23)});l(c$,"getShapeProperty",function(a,b){return this.e.getShapeProperty(a,b)},"~N,~S");l(c$,"paramAsStr",function(a){return this.e.paramAsStr(a)},"~N");l(c$,"centerParameter",function(a){return this.e.centerParameter(a,null)},"~N");l(c$,"floatParameter",function(a){return this.e.floatParameter(a)},"~N");l(c$,"getPoint3f",function(a,b){return this.e.getPoint3f(a,b)},"~N,~B");
l(c$,"intParameter",function(a){return this.e.intParameter(a)},"~N");l(c$,"isFloatParameter",function(a){switch(this.e.tokAt(a)){case 2:case 3:return!0}return!1},"~N");l(c$,"setShapeProperty",function(a,b,c){this.e.setShapeProperty(a,b,c)},"~N,~S,~O");l(c$,"showString",function(a){this.e.showString(a)},"~S");l(c$,"stringParameter",function(a){return this.e.stringParameter(a)},"~N");l(c$,"getToken",function(a){return this.e.getToken(a)},"~N");l(c$,"tokAt",function(a){return this.e.tokAt(a)},"~N");
l(c$,"setShapeId",function(a,b,c){c&&this.invArg();b=this.e.setShapeNameParameter(b).toLowerCase();this.setShapeProperty(a,"thisID",b);return b},"~N,~N,~B");l(c$,"getColorTrans",function(a,b,c,e){c=3.4028235E38;1765808134!=a.theTok&&--b;switch(this.tokAt(b+1)){case 603979967:b++;c=this.isFloatParameter(b+1)?a.getTranslucentLevel(++b):this.vwr.getFloat(570425354);break;case 1073742074:b++,c=0}a.isColorParam(b+1)?e[0]=a.getArgbParam(++b):1073742333==this.tokAt(b+1)?(e[0]=0,a.iToken=b+1):3.4028235E38==
c?this.invArg():e[0]=-2147483648;return c},"JS.ScriptEval,~N,~B,~A");l(c$,"finalizeObject",function(a,b,c,e,f,d,g,h){f&&this.setShapeProperty(a,"set",d);-2147483648!=b&&this.e.setShapePropertyBs(a,"color",Integer.$valueOf(b),h);3.4028235E38!=c&&this.e.setShapeTranslucency(a,"","translucent",c,h);0!=e&&this.setShapeProperty(a,"scale",Integer.$valueOf(e));0<g&&(this.e.setMeshDisplayProperty(a,g,0)||this.invArg())},"~N,~N,~N,~N,~B,~O,~N,JU.BS");O("JS");P(["JS.ScriptExt"],"JS.CmdExt","java.lang.Boolean $.Float $.Long java.util.Hashtable $.Map JU.AU $.BS $.Base64 $.Lst $.M3 $.M4 $.Measure $.P3 $.P4 $.PT $.Quat $.SB $.V3 J.api.Interface J.atomdata.RadiusData J.c.STER $.VDW J.i18n.GT JM.Atom $.AtomCollection $.BondSet $.LabelToken JS.SV $.ScriptCompiler $.ScriptError $.ScriptEval $.ScriptInterruption $.ScriptMathProcessor $.ScriptParam $.T JU.BSUtil $.BoxInfo $.C $.Edge $.Elements $.Escape $.Logger $.Parser $.Point3fi $.SimpleUnitCell JV.FileManager $.JC $.StateManager $.Viewer".split(" "),
function(){c$=V(JS,"CmdExt",JS.ScriptExt);T(c$,function(){W(this,JS.CmdExt,[])});X(c$,"dispatch",function(a,b,c){this.chk=this.e.chk;this.slen=this.e.slen;this.st=c;switch(a){case 1073741866:c[0].value=this.prepareBinaryOutput(c[0]);break;case 4098:this.assign();break;case 134221829:this.cache();break;case 4102:this.calculate();break;case 4103:this.capture();break;case 4105:this.centerAt();break;case 134221831:this.compare();break;case 528395:this.console();break;case 4106:this.connect(1);break;case 1094717448:this.configuration();
break;case 134221834:this.data();break;case 1613238294:this.connect(0);break;case 4120:this.image();break;case 4124:this.macro();break;case 4125:this.mapProperty();break;case 4126:this.minimize();break;case 1275072532:this.modulation();break;case 4130:this.mutate();break;case 4131:this.navigate();break;case 4133:case 134221850:case 4138:this.plot(c);break;case 134222350:this.show();break;case 528443:this.stereo();break;case 1814695966:this.unitcell(b?2:1);break;case 134221856:return this.write(b?
c:null);case 6:this.measure();break;case 21:this.polyhedra();break;case 20:this.ellipsoid();break;case 4:this.struts()}return null},"~N,~B,~A");l(c$,"macro",function(){var a=this.e.optParameterAsString(1);if(0!=a.length&&!this.chk){var b=JV.JC.getMacro(a);null==b?this.showString("macro "+a+" could not be found. Current macros include:\n"+JV.JC.getMacroList()):(this.showString("running "+b),this.e.cmdScript(4124,b,null))}});l(c$,"evalParallel",function(a,b){this.chk=this.e.chk;this.slen=this.e.slen;
var c=(new JS.ScriptEval).setViewer(this.vwr);c.historyDisabled=!0;c.compiler=new JS.ScriptCompiler(this.vwr);c.sm=b;try{c.restoreScriptContext(a,!0,!1,!1),c.allowJSThreads=!1,c.dispatchCommands(!1,!1,!1)}catch(e){if(N(e,Exception))return this.e.vwr.setStringProperty("_errormessage",""+e),null==c.thisContext&&(JU.Logger.error("Error evaluating context "+e),this.vwr.isJS||e.printStackTrace()),!1;throw e;}return!0},"JS.ScriptContext,JV.ShapeManager");l(c$,"getBitsetIdent",function(a,b,c,e,f,d){var g=
!K(c,JM.BondSet);g&&(null==b?b=this.vwr.getStandardLabelFormat(0):0==b.length&&(b="%[label]"));var h=null==b?-1:b.indexOf("%"),j=2147483647!=f;if(null==a||this.chk||g&&0>h)return null==b&&(b=""),d?A(-1,[b]):b;var h=this.vwr.ms,t=0,p=h.getLabeler();c=g||!e?null:c.associatedAtoms;null==c&&(null!=b&&0<b.indexOf("%D"))&&(c=this.vwr.ms.getAtomIndices(a));e=null==b||0==b.length;var k=g||e?null:JM.LabelToken.getBondLabelValues();b=e?null:g?p.compile(this.vwr,b,"\x00",null):p.compile(this.vwr,b,"\u0001",
k);var l=j?1:a.cardinality(),q=Array(l),z=new JU.P3;for(f=j?f:a.nextSetBit(0);0<=f;f=a.nextSetBit(f+1)){var s;g?s=e?h.at[f].getInfo():p.formatLabelAtomArray(this.vwr,h.at[f],b,"\x00",c,z):(s=h.bo[f],s=e?s.getIdentity():p.formatLabelBond(this.vwr,s,b,k,c,z));s=JU.PT.formatStringI(s,"#",t+1);q[t++]=s;if(j)break}return 1==l&&!d?q[0]:q},"JU.BS,~S,~O,~B,~N,~B");l(c$,"getLoadSymmetryParams",function(a,b,c){var e=this.e;this.chk=e.chk;this.slen=e.slen;var f=null,d=this.tokAt(a);if(1073742332==d||8==d)f=
this.getPoint3f(a,!1),a=e.iToken+1,d=this.tokAt(a);switch(d){case 1073741938:case 1073742080:case 1094713350:case 1073742163:case 1073742114:case 1073742152:case 1814695966:null==f&&(f=JU.P3.new3(555,555,-1)),e.iToken=a-1}d=null;if(null!=f){c.put("lattice",f);a=e.iToken+1;b.append(" {"+F(f.x)+" "+F(f.y)+" "+F(f.z)+"}");a=this.checkPacked(a,c,b);1094713350==this.tokAt(a)&&(c.put("centroid",Boolean.TRUE),b.append(" CENTROID"),a=this.checkPacked(++a,c,b));if(1073742163==this.tokAt(a)){var g;b.append(" SUPERCELL ");
if(e.isPoint3f(++a)){g=this.getPoint3f(a,!1);if(g.x!=F(g.x)||g.y!=F(g.y)||g.z!=F(g.z)||1>g.x||1>g.y||1>g.z)e.iToken=a,this.invArg();a=e.iToken}else g=this.stringParameter(a);b.append(JU.Escape.e(g));c.put("supercell",g);a=this.checkPacked(++a,c,b)}g=0;1073742114==this.tokAt(a)&&(a++,g=this.floatParameter(a++),b.append(" range "+g));c.put("symmetryRange",Float.$valueOf(g));g=null;var h;g=-2147483648;1073742152==this.tokAt(a)&&(++a,g=JU.PT.rep(this.paramAsStr(a++),"''",'"'),b.append(" spacegroup "+
JU.PT.esc(g)),g.equalsIgnoreCase("ignoreOperators")?g=-999:(0==g.length?(h=this.vwr.getCurrentUnitCell(),null!=h&&(g=h.getSpaceGroupName())):0<=g.indexOf(",")&&9>f.x&&(9>f.y&&0==f.z)&&(g+="#doNormalize=0"),c.put("spaceGroupName",g),g=-2));f=null;if(1814695966==this.tokAt(a)){++a;h=e.optParameterAsString(a);0==h.length?(h=this.vwr.getCurrentUnitCell(),null!=h&&(f=h.getUnitCellAsArray(!0),d=h.getCartesianOffset())):4==this.tokAt(a)?(f=L(6,0),JU.SimpleUnitCell.setOabc(h,f,null)):f=e.floatParameterSet(a,
6,9);(null==f||6!=f.length&&9!=f.length)&&this.invArg();b.append(" unitcell [");for(a=0;a<f.length;a++)b.append((0==a?"":" ")+f[a]);b.append("]");c.put("unitcell",f);-2147483648==g&&(g=-1);a=e.iToken+1}-2147483648!=g&&c.put("spaceGroupIndex",Integer.$valueOf(g))}null!=d?e.coordinatesAreFractional=!1:1073742066==this.tokAt(a)&&(d=this.getPoint3f(++a,!0));null!=d&&(e.coordinatesAreFractional?(d.setT(e.fractionalPoint),c.put("unitCellOffsetFractional",e.coordinatesAreFractional?Boolean.TRUE:Boolean.FALSE),
b.append(" offset {"+d.x+" "+d.y+" "+d.z+"/1}")):b.append(" offset "+JU.Escape.eP(d)),c.put("unitCellOffset",d),a=e.iToken+1);return a},"~N,JU.SB,java.util.Map");l(c$,"checkPacked",function(a,b,c){switch(this.tokAt(a)){case 1073741938:b.put("packed",Boolean.TRUE);var e=null,f=this.tokAt(++a);switch(f){case 1814695966:case 1678381065:break;default:this.e.isArrayParameter(a)?(e=this.e.getPointArray(a,-1,!1),a=this.e.iToken):this.isFloatParameter(a)?(e=this.floatParameter(a),e=A(-1,[new JU.P3,JU.P3.new3(e,
e,e)])):(e=[],--a)}a++;if(this.e.chk)break;switch(f){case 1814695966:if(e=this.vwr.getCurrentUnitCell(),null!=e){e=JU.BoxInfo.getUnitCellPoints(e.getUnitCellVerticesNoOffset(),e.getCartesianOffset());break}case 1678381065:e=JU.BoxInfo.getUnitCellPoints(this.vwr.ms.getBBoxVertices(),null)}switch(e.length){case 2:f=e[1];e=A(-1,[e[0],JU.P3.newP(e[0]),new JU.P3,new JU.P3]);e[1].x=f.x;e[2].y=f.y;e[3].z=f.z;break;case 3:e=A(-1,[new JU.P3,e[0],e[1],e[2]]);break;case 4:break;default:e=A(-1,[new JU.P3,JU.P3.new3(10,
0,0),JU.P3.new3(0,10,0),JU.P3.new3(0,0,10)])}b.put("fillRange",e);c.append(" FILL ["+e[0]+e[1]+e[2]+e[3]+"]");break;case 1073742080:e=NaN,this.isFloatParameter(++a)&&(e=this.floatParameter(a++)),this.e.chk||(b.put("packed",Boolean.TRUE),c.append(" PACKED"),Float.isNaN(e)||(b.put("packingError",Float.$valueOf(e)),c.append(" "+e)))}return a},"~N,java.util.Map,JU.SB");l(c$,"cache",function(){var a=this.tokAt(1),b=null,c=2;switch(a){case 1275069441:case 1073742119:b=this.e.optParameterAsString(c++);case 1073741882:this.checkLength(c);
this.chk||("all".equals(b)&&(b=null),b=this.vwr.cacheFileByName(b,1275069441==a),this.showString(0>b?"cache cleared":b+" bytes "+(1275069441==a?" cached":" removed")));break;default:this.invArg()}});l(c$,"calculate",function(){var a=!1,b=!1,c=null,e=null,f=this.e,d=-2147483648,d=2;if(2<=(f.iToken=f.slen))switch(f.clearDefinedVariableAtomSets(),this.getToken(1).tok){case 1073741824:this.checkLength(2);break;case 1631586315:this.checkLength(2);if(this.chk)return;d=this.vwr.calculateFormalCharges(null);
this.showString(J.i18n.GT.i(J.i18n.GT._("{0} charges modified"),d));return;case 1075838996:this.checkLength(2);this.chk||this.vwr.ms.assignAromaticBondsBs(!0,null);return;case 1613238294:2!=f.slen&&(c=(b=1639976963==this.tokAt(++f.iToken))?this.vwr.bsA():this.atomExpressionAt(f.iToken),!b&&1639976963!=this.tokAt(++f.iToken)&&(e=this.atomExpressionAt(f.iToken)));if(this.chk)return;d=this.vwr.autoHbond(c,e,!1);-2147483648!=d&&f.report(J.i18n.GT.i(J.i18n.GT._("{0} hydrogen bonds"),Math.abs(d)),!1);return;
case 1612709900:(a=1073742335==this.tokAt(2))&&f.iToken++;c=this.slen==(a?3:2)?null:this.atomExpressionAt(a?3:2);f.checkLast(f.iToken);this.chk||(this.vwr.addHydrogens(c,!1,!1),a&&(null==c&&(c=this.vwr.bsA()),this.vwr.makeConnections(0.1,1E8,515,1073742025,c,c,null,!1,!1,0),this.vwr.ms.assignAromaticBondsBs(!0,null)));return;case 1111492619:f.iToken=1;c=2==this.slen?null:this.atomExpressionAt(2);f.checkLast(f.iToken);if(!this.chk)try{this.vwr.calculatePartialCharges(c)}catch(g){if(N(g,JV.JmolAsyncException))f.loadFileResourceAsync(g.getFileName());
else throw g;}return;case 1088421903:case 134217762:this.chk||(1275203608==this.tokAt(2)?(a=4==this.tokAt(3)?this.stringParameter(3):null,c=null!=a||3==this.slen?null:this.atomExpressionAt(3),c=A(-1,[a,null,c]),this.showString(f.getShapePropertyData(21,"symmetry",c)?c[1]:"")):this.showString(this.vwr.ms.calculatePointGroup(this.vwr.bsA())));return;case 1111490574:this.checkLength(2);this.chk||(this.vwr.calculateStraightness(),this.vwr.addStateScript("set quaternionFrame '"+this.vwr.getQuaternionFrame()+
"'; calculate straightness",!1,!0));return;case 1639976963:c=4>this.slen||this.isFloatParameter(3)?null:this.atomExpressionAt(2);switch(this.tokAt(++f.iToken)){case 4138:break;case 1073741916:if(this.chk)return;f.showString(this.vwr.getAnnotationParser(!0).calculateDSSRStructure(this.vwr,c));return;case 1073741915:b=!0;d=this.slen==f.iToken+1?2:F(this.floatParameter(++f.iToken));break;case 0:b=this.vwr.getBoolean(603979826);break;default:this.invArg()}this.chk||this.showString(this.vwr.calculateStructures(c,
b,!0,d));return;case 659482:c=f.iToken+1<this.slen?this.atomExpressionAt(++f.iToken):null;e=f.iToken+1<this.slen?this.atomExpressionAt(++f.iToken):null;this.checkLength(++f.iToken);this.chk||(d=this.vwr.calculateStruts(c,e),0<d&&(this.setShapeProperty(1,"type",Integer.$valueOf(32768)),f.setShapePropertyBs(1,"color",Integer.$valueOf(16777215),null),f.setShapeTranslucency(1,"","translucent",0.5,null),this.setShapeProperty(1,"type",Integer.$valueOf(1023))),this.showString(J.i18n.GT.i(J.i18n.GT._("{0} struts added"),
d)));return;case 2097180:a=!0;case 1111490575:b=!1;switch(this.tokAt(2)){case 134217759:f.iToken++;break;case 0:b=!a;break;case 1073741952:b=!0;f.iToken++;break;default:b=!0}c=f.iToken+1<this.slen?this.atomExpressionAt(++f.iToken):this.vwr.bsA();this.checkLength(++f.iToken);this.chk||this.vwr.calculateSurface(c,b?3.4028235E38:-1);return}f.errorStr2(53,"CALCULATE","aromatic? hbonds? hydrogen? formalCharge? partialCharge? pointgroup? straightness? structure? struts? surfaceDistance FROM? surfaceDistance WITHIN?")});
l(c$,"capture",function(){if(!this.chk&&!this.vwr.allowCapture())this.showString("Cannot capture on this platform");else{var a=this.vwr.captureParams,b=null==a?"GIF":a.get("type"),c=0,e=0,f=this.e.slen,d="",g=1073742070!=this.vwr.am.animationReplayMode,h=1,j=this.tokAt(h),t=603979967==j;t&&(j=this.tokAt(++h));switch(0==j?j=102409:j){case 4:d=this.e.optParameterAsString(h++);if(0==d.length){e=102409;break}b=d.toLowerCase();b.endsWith(".gift")||b.endsWith(".pngt")?(t=!0,d=d.substring(0,d.length-1),
b=d.toLowerCase()):!b.endsWith(".gif")&&!b.contains(".png")&&(d+=".gif");b.endsWith(".png")?(b.endsWith("0.png")||(d=d.substring(0,d.length-4)+"0000.png"),b="PNG"):b="GIF";t&&(b+="T");a=d.indexOf("0000.");j=0>a||a!=d.lastIndexOf(".")-4;a=!1;528411==this.tokAt(h)&&(g=!0,this.tokAt(++h));switch(this.tokAt(h)){case 1073742129:a=!0;case 1611141175:c=null;g="y";h++;a?(h<f&&2!=this.tokAt(h)&&(g=this.e.optParameterAsString(h++).toLowerCase()),c="rotate Y 10 10;rotate Y -10 -10;rotate Y -10 -10;rotate Y 10 10",
f=h<f?this.intParameter(h++):5,c=0>f?JU.PT.rep(c,"10;",""+-f+";"):JU.PT.rep(c,"10",""+f)):(h<f&&(g=this.e.optParameterAsString(h++).toLowerCase()),c="rotate Y 360 30;");if(this.chk)return;this.vwr.setNavigationMode(!1);if(""===g||0>"xyz".indexOf(g))g="y";f=this.vwr.g.waitForMoveTo;c="set waitformoveto true;"+JU.PT.rep(c,"Y",g)+";set waitformoveto "+f;c="capture "+(t?"transparent ":"")+JU.PT.esc(d)+" LOOP;"+c+";capture end;";this.e.cmdScript(0,null,c);return;case 3:case 2:c=this.floatParameter(h++)}if(this.chk)return;
e=1073742032;a=new java.util.Hashtable;t=this.vwr.getInt(553648132);j&&(a.put("streaming",Boolean.TRUE),g||this.showString(J.i18n.GT.o(J.i18n.GT._("Note: Enable looping using {0}"),A(-1,["ANIMATION MODE LOOP"]))),this.showString(J.i18n.GT.o(J.i18n.GT._("Animation delay based on: {0}"),A(-1,["ANIMATION FPS "+t]))));a.put("captureFps",Integer.$valueOf(t));break;case 102409:case 1073741874:null!=a&&a.put("captureSilent",Boolean.TRUE);case 1073742335:case 1073742334:this.checkLength(-2);e=j;break;default:this.invArg()}this.chk||
null==a||(a.put("type",b),t=Integer.$valueOf(this.vwr.getBackgroundArgb()),a.put("backgroundColor",t),a.put("fileName",d),a.put("quality",Integer.$valueOf(-1)),a.put("endTime",Long.$valueOf(0>=c?-1:System.currentTimeMillis()+S(1E3*c))),a.put("captureMode",JS.T.nameOf(e).toLowerCase()),a.put("captureLooping",g?Boolean.TRUE:Boolean.FALSE),d=this.vwr.processWriteOrCapture(a),null==d&&(d="canceled"),JU.Logger.info(d))}});l(c$,"centerAt",function(){var a=this.getToken(1).tok;switch(a){case 1073741826:case 96:case 1678381065:break;
default:this.invArg()}var b=JU.P3.new3(0,0,0);5==this.slen?(b.x=this.floatParameter(2),b.y=this.floatParameter(3),b.z=this.floatParameter(4)):this.e.isCenterParameter(2)?(b=this.centerParameter(2),this.e.checkLast(this.e.iToken)):this.checkLength(2);!this.chk&&!this.vwr.isJmolDataFrame()&&this.vwr.tm.setCenterAt(a,b)});l(c$,"compare",function(){var a=this.e,b=!1,c=!1,e=!1,f=!1,d=!1,g=null,h=null,j=null,t=null,p=null,k=null;a.iToken=0;var l=this.isFloatParameter(1)?this.floatParameter(++a.iToken):
NaN,q=this.atomExpressionAt(++a.iToken),z=null,s=null;a.isArrayParameter(++a.iToken)?z=a.getPointArray(a.iToken,-1,!1):1140850689!=this.tokAt(a.iToken)&&(s=this.atomExpressionAt(a.iToken));var m=null,r=!1,v=null,y=JU.BSUtil.copy(q);null!=s&&y.or(s);for(var y=f=null==z&&null!=s&&y.equals(q),u=a.iToken+1;u<this.slen;++u)switch(this.getToken(u).tok){case 4115:y=!0;break;case 134218757:if(r=!0,4!=this.tokAt(u+1)){v="*";break}case 134218756:v=this.stringParameter(++u);break;case 1677721602:c=d=!0;v=this.paramAsStr(++u);
v.equalsIgnoreCase("SMILES")&&(r=!0,v="*");break;case 3:case 2:l=Math.abs(this.floatParameter(u));break;case 268435504:break;case 2109448:m=this.atomExpressionAt(++u);u=a.iToken;break;case 10:case 1073742325:null!=k&&this.invArg();var j=this.atomExpressionAt(a.iToken),C=f?0:this.tokAt(a.iToken+1),t=null==z&&a.isArrayParameter(a.iToken+1)?null:10==C||1073742325==C?this.atomExpressionAt(++a.iToken):JU.BSUtil.copy(j);null!=m&&(j.and(m),null!=t&&t.and(m));null==t?z=a.getPointArray(++a.iToken,-1,!1):t.and(s);
null==p&&(p=new JU.Lst);p.addLast(A(-1,[j,t]));u=a.iToken;break;case 7:null!=p&&this.invArg();b=!0;g=a.getQuaternionArray(a.theToken.getList(),1073742001);this.getToken(++u);h=a.getQuaternionArray(a.theToken.getList(),1073742001);null==k&&(k=new JU.Lst);k.addLast(A(-1,[g,h]));break;case 1073742077:b=!0;break;case 134217751:case 1140850689:b=!1;break;case 528432:c=!0;break;case 4160:e=!0;break;default:this.invArg()}if(!this.chk){y&&(l=0);Float.isNaN(l)||0>l?l=1:!c&&!e&&(c=e=!0);f=0!=l;(C=!b&&null==
v||null!=z)&&J.api.Interface.getInterface("JU.Eigen",this.vwr,"script");null==p&&null==k&&(null==m?(j=C?this.vwr.getAtomBitSet("spine"):new JU.BS,0>j.nextSetBit(0)?(j=q,t=s):(t=JU.BSUtil.copy(j),j.and(q),t.and(s))):(j=JU.BSUtil.copy(q),t=JU.BSUtil.copy(s),j.and(m),t.and(m),j.and(q),t.and(s)),p=new JU.Lst,p.addLast(A(-1,[j,t])));if(y){q=this.vwr.ms.getModelBS(q,!1);m=Array(q.cardinality());u=0;for(t=q.nextSetBit(0);0<=t;t=q.nextSetBit(t+1),u++)m[u]=this.vwr.getModelUndeletedAtomsBitSet(t)}else m=A(-1,
[q]);for(t=0;t<m.length;t++){for(var q=m[t],w=L(2,0),n=null,x=new JU.Lst,B=null,H=y?new JU.Lst:p,u=0;u<p.size();++u){var I=p.get(u);y&&H.addLast(I=A(-1,[JU.BSUtil.copy(I[0]),I[1]]));I[0].and(q)}var M=null,E=null;if(C){null!=z&&(H.clear(),H.addLast(A(-1,[j,z])));try{B=this.vwr.getCenterAndPoints(H,!0)}catch(G){if(N(G,Exception))this.invArg();else throw G;}n=B[0].length-1;for(u=1;u<=n;u++){x=B[0][u];I=B[1][u];if(!K(x,JM.Atom)||!K(I,JM.Atom))break;JU.Logger.info(" atom 1 "+x.getInfo()+"\tatom 2 "+I.getInfo())}n=
JU.Measure.calculateQuaternionRotation(B,w);u=Float.isNaN(w[1])?NaN:Math.round(100*w[0])/100;w=Float.isNaN(w[1])?NaN:Math.round(100*w[1])/100;this.showString("RMSD "+u+" --\x3e "+w+" Angstroms")}else if(b){if(null==k)for(u=0;u<H.size();u++){I=H.get(u);g=this.vwr.getAtomGroupQuaternions(I[0],2147483647);h=this.vwr.getAtomGroupQuaternions(I[1],2147483647);for(n=0;n<g.length&&n<h.length;n++)x.addLast(h[n].div(g[n]))}else for(n=0;n<g.length&&n<h.length;n++)x.addLast(h[n].div(g[n]));w[0]=0;g=x.toArray(Array(x.size()));
n=JU.Quat.sphereMean(g,w,1E-4);this.showString("RMSD = "+w[0]+" degrees")}else{u=new JU.M4;M=new JU.P3;if(("*".equals(v)||"".equals(v))&&null!=q)try{v=this.vwr.getSmiles(q)}catch(F){if(N(F,Exception))a.evalError(F.getMessage(),null);else throw F;}if(d){var O;if(null==q||null==s||null==(O=a.getSmilesExt().getFlexFitList(q,s,v,!r)))break;this.vwr.setDihedrals(O,null,1)}w=a.getSmilesExt().getSmilesCorrelation(q,s,v,null,null,u,null,!1,null,M,!1,32|(r?1:2));if(Float.isNaN(w)){this.showString("structures do not match");
break}e&&(E=new JU.V3,u.getTranslation(E));c&&(n=new JU.M3,u.getRotationScale(n),n=JU.Quat.newM(n));this.showString("RMSD = "+w+" Angstroms")}null!=B&&(M=B[0][0]);null==M&&(B=this.vwr.getCenterAndPoints(H,!0),M=B[0][0]);H=new JU.P3;w=NaN;e&&(null==E&&(E=JU.V3.newVsub(B[1][0],M)),w=1E10);c&&(null==n&&a.evalError("option not implemented",null),H.add2(M,n.getNormal()),w=n.getTheta(),0==w&&e&&(0.01<E.length()?w=1E10:c=e=f=!1));if(!Float.isNaN(w)&&!Float.isNaN(H.x)&&(B=null,c&&(e&&0!=l)&&(B=this.vwr.ms.getAtomPointVector(q),
u=JS.ScriptMathProcessor.getMatrix4f(n.getMatrix(),E),B=JU.Measure.transformPoints(B,u,M)),a.useThreads()||(f=!1),this.vwr.rotateAboutPointsInternal(a,M,H,w/l,w,f,q,E,B,null,null)&&f&&a.isJS))throw new JS.ScriptInterruption(a,"compare",1);}}});l(c$,"configuration",function(){var a=null,b=this.vwr.bsA();if(1==this.slen){if(this.chk)return;a=this.vwr.ms.setConformation(b);this.vwr.ms.addStateScript("select",null,b,null,"configuration",!0,!1)}else if(this.isFloatParameter(1)){b=this.intParameter(this.e.checkLast(1));
if(this.chk)return;a=this.vwr.ms.getConformation(this.vwr.am.cmi,b-1,!0,null);this.vwr.addStateScript("configuration "+b+";",!0,!1)}else{a=this.atomExpressionAt(1);if(this.chk)return;b=this.intParameter(this.e.checkLast(this.e.iToken+1));this.vwr.addStateScript("configuration "+JU.Escape.eBS(a)+" "+b+";",!0,!1);a=this.vwr.ms.getConformation(this.vwr.am.cmi,b-1,!0,a)}this.setShapeProperty(1,"type",Integer.$valueOf(30720));this.e.setShapeSizeBs(1,0,a);this.vwr.autoHbond(a,a,!0);this.vwr.select(a,!1,
0,this.e.tQuiet)});l(c$,"measure",function(){var a=this.e,b=null,c=0,e=null;if(2==this.slen)switch(this.tokAt(1)){case 1073742334:this.setShapeProperty(6,"hideAll",Boolean.TRUE);return;case 12291:this.chk||this.vwr.clearAllMeasurements();return}this.vwr.shm.loadShape(6);switch(this.tokAt(1)){case 134218756:var f=this.stringParameter(3==this.slen?2:4);if(this.chk)return;var d=this.vwr.ms.at,b=this.vwr.ms.ac,c=null;try{c=this.vwr.getSmilesMatcher().getCorrelationMaps(f,d,b,this.vwr.bsA(),2)}catch(g){if(N(g,
Exception))a.evalError(g.getMessage(),null);else throw g;}if(null==c)return;this.setShapeProperty(6,"maps",c);return}switch(this.slen){case 2:switch(this.getToken(1).tok){case 0:case 1073742335:this.vwr.shm.loadShape(6);this.setShapeProperty(6,"hideAll",Boolean.FALSE);return;case 1073742001:this.chk||a.showStringPrint(this.vwr.getMeasurementInfoAsString(),!1);return;case 4:this.setShapeProperty(6,"setFormats",this.stringParameter(1));return}a.errorStr(24,"ON, OFF, DELETE");break;case 3:switch(this.getToken(1).tok){case 12291:if(1073742327==
this.getToken(2).tok)this.chk||this.vwr.clearAllMeasurements();else{var h=this.intParameter(2)-1;this.chk||this.vwr.deleteMeasurement(h)}return}}for(var j=0,t=0,p=-1,k=-1,l=-1,q=G(5,0),z=L(-1,[3.4028235E38,3.4028235E38]),s=!1,m=!1,r=!1,v=!0,y=null,u=null,f=268435538,A=d=null,w=new JU.Lst,n=new JU.BS,x=null,B=null,H=0,I=0,M=null,h=1;h<this.slen;++h)switch(this.getToken(h).tok){case 1073741974:1!=h&&this.invArg();b=a.optParameterAsString(++h);continue;case 1073741824:a.errorStr(24,"ALL, ALLCONNECTED, DELETE");
break;default:this.error(15);break;case 268435568:134217736!=this.tokAt(h+1)&&this.invArg();h++;r=!0;break;case 1073741832:M=this.paramAsStr(++h).toLowerCase();break;case 134217736:case 1073741834:case 1073742327:m=1073741834==a.theTok;k=-1;s=!0;m&&r&&this.invArg();break;case 1765808134:c=JU.C.getColix(a.getArgbParam(++h));h=a.iToken;break;case 1073742066:a.isPoint3f(++h)?(e=this.getPoint3f(h,!1),e=L(-1,[1,e.x,e.y,e.z,0,0,0])):e=a.floatParameterSet(h,7,7);h=a.iToken;break;case 1665140738:case 1073741917:I=
F((1665140738==a.theTok?2E3:1E3)*this.floatParameter(++h));null!=b&&0>=I&&(I=-1);break;case 3:null!=y&&this.invArg();v=s=!0;l=(l+1)%2;z[l]=this.floatParameter(h);break;case 12291:268435538!=f&&this.invArg();f=12291;break;case 4114:var E=this.floatParameter(++h),O=this.paramAsStr(++h),P=this.paramAsStr(++h);this.chk||(A=this.vwr.getFont3D(O,P,E));break;case 2:E=this.intParameter(h);if(s)v=!0,l=(l+1)%2,z[l]=E;else{k=this.vwr.ms.getFirstAtomIndexFromAtomNumber(E,this.vwr.getVisibleFramesBitSet());if(!this.chk&&
0>k)return;null!=x&&this.invArg();4<(q[0]=++j)&&a.bad();q[j]=k}break;case 1094713359:p=this.intParameter(++h);break;case 1073742334:268435538!=f&&this.invArg();f=1073742334;break;case 1073742335:268435538!=f&&this.invArg();f=1073742335;break;case 1073742114:v=s=!0;k=-1;break;case 1073741989:case 1073741990:u=Boolean.$valueOf(1073741989==a.theTok);s=!0;r=1073741990==a.theTok;break;case 1648363544:0<=l&&this.invArg();y=a.encodeRadiusParameter(h,!1,!0);if(null==y)return;y.values=z;h=a.iToken;s=r=!0;
u=Boolean.$valueOf(!1);1==H&&(H++,j++,E=JU.BSUtil.copy(n),JU.BSUtil.invertInPlace(E,this.vwr.ms.ac),E.and(this.vwr.ms.getAtomsWithinRadius(5,n,!1,null)),w.addLast(E));break;case 10:case 1073742325:case 1073742332:case 8:case 1073742330:(10==a.theTok||1073742325==a.theTok)&&H++;0<=k&&this.invArg();j=Array(1);x=a.centerParameter(h,j);if(K(j[0],JU.BS)&&(x=n=j[0],!this.chk&&0==n.length()))return;K(x,JU.P3)&&(h=new JU.Point3fi,h.setT(x),h.mi=p,x=h);4<(j=++t)&&a.bad();h=a.iToken;w.addLast(x);break;case 4:d=
this.stringParameter(h);break;case 1073742164:B=a.tickParamAsStr(h,!1,!0,!0),h=a.iToken,f=12290}(null!=y&&(0<=l||2!=j)||2>j&&null==b&&(null==B||1==j))&&a.bad();null!=d&&0!=d.indexOf(j+":")&&(d=j+":"+d);v&&z[1]<z[0]&&(z[1]=z[0],z[0]=3.4028235E38==z[1]?3.4028235E38:-200);if(!this.chk)if(null!=x||null!=B){null==y&&(y=new J.atomdata.RadiusData(z,0,null,null));null==x&&(B.id="default");null!=x&&(null!=d&&268435538==f)&&(f=12290);a=null;if(null!=A||null!=M||null!=d&&0<=d.indexOf("\n"))a=J.api.Interface.getInterface("JM.Text",
this.vwr,"script").newLabel(this.vwr,A,"",c,0,0,0);null!=a&&(a.pymolOffset=e,a.setAlignmentLCR(M));this.setShapeProperty(6,"measure",this.vwr.newMeasurementData(b,w).set(f,null,y,d,null,B,m,r,u,s,I,c,a))}else switch(a=null==b?q:b,f){case 12291:this.setShapeProperty(6,"delete",a);break;case 1073742335:this.setShapeProperty(6,"show",a);break;case 1073742334:this.setShapeProperty(6,"hide",a);break;default:this.setShapeProperty(6,null==d?"toggle":"toggleOn",a),null!=d&&this.setShapeProperty(6,"setFormats",
d)}});l(c$,"connect",function(a){var b=this.e,c=L(2,0),e=Array(2);e[0]=e[1]=this.vwr.bsA();var f=NaN,d=G(-1,[-2147483648]),g=0,h=131071,j=1073742026,t=!1,p=!1,k=!1,l=3.4028235E38,q=!1,z=0,s=0,m=new JU.BS,r=!1,v=0,y=0,u=0,C=!1;if(1==this.slen)this.chk||this.vwr.rebondState(b.$isStateScript);else{for(;a<this.slen;++a){switch(this.getToken(a).tok){case 1073742335:case 1073742334:this.checkLength(2);this.chk||this.vwr.rebondState(b.$isStateScript);return;case 2:case 3:if(0<z){(p||q)&&b.error(23);h=JU.Edge.getBondOrderFromFloat(this.floatParameter(a));
131071==h&&this.invArg();p=!0;break}2<++s&&b.bad();var w=this.floatParameter(a);268435634==this.tokAt(a+1)&&(w=-w/100,a++);c[g++]=w;break;case 10:case 1073742325:(2<z||r&&0<z)&&b.bad();(p||q)&&this.invArg();e[z++]=this.atomExpressionAt(a);r=b.isBondSet;if(2==z){for(var w=b.iToken,n=a;n<w;n++)if(1073741824==this.tokAt(n)&&this.paramAsStr(n).equals("_1")){v=a;break}b.iToken=w}a=b.iToken;break;case 1086324742:C=!0;break;case 1765808134:case 603979967:case 1073742074:q=!0;l=this.getColorTrans(b,a,!1,
d);a=b.iToken;break;case 1073742086:d=1073741852==this.tokAt(2);this.checkLength(d?3:2);if(this.chk)return;this.vwr.clearModelDependentObjects();this.vwr.ms.deleteAllBonds();f=new JU.BS;this.vwr.ms.setPdbConectBonding(0,0,f);if(d){b=b.$isStateScript&&this.vwr.getBoolean(603979873);this.vwr.ms.autoBondBs4(null,null,f,null,this.vwr.getMadBond(),b);this.vwr.addStateScript(b?"set legacyAutoBonding TRUE;connect PDB AUTO;set legacyAutoBonding FALSE;":"connect PDB auto;",!1,!0);return}this.vwr.addStateScript("connect PDB;",
!1,!0);return;case 1073741830:case 1073741852:case 1073741904:case 1073742025:case 1073742026:k=!0;++a!=this.slen&&this.invArg();j=b.theTok;1073741852==j&&!(131071==h||2048==h||515==h)&&this.invArg();break;case 659482:q||(d[0]=16777215,l=0.5,f=this.vwr.getFloat(570425406),q=!0),k||(j=1073742026,k=!0);case 1073741824:if(b.isColorParam(a)){y=-a;break}case 1075838996:case 1613238294:h=this.paramAsStr(a);131071==(h=JS.ScriptParam.getBondOrderFromString(h))&&this.invArg();p&&b.error(18);p=!0;switch(h){case 33:switch(this.tokAt(a+
1)){case 3:h=JS.ScriptParam.getPartialBondOrderFromFloatEncodedInt(this.st[++a].intValue);break;case 2:h=this.intParameter(++a)}break;case 2048:2==this.tokAt(a+1)&&(h=this.intParameter(++a)<<11,u=this.floatParameter(++a));break;case 65537:k||(j=1073742025,k=!0)}break;case 1665140738:f=this.floatParameter(++a);q=!0;break;case 1073742333:case 12291:++a!=this.slen&&this.invArg();j=12291;t=!0;q=!1;break;default:y=a}0<a&&(y==-a||y==a&&b.isColorParam(a)?(q=!0,d[0]=b.getArgbParam(a),a=b.iToken):y==a&&this.invArg())}if(!this.chk){2>
g&&(0==g&&(c[0]=1E8),c[1]=c[0],c[0]=0.1);q&&(p||(h=65535),k||(j=1073742025));p=g=0;if(0<v){u=new JU.BS;this.vwr.definedAtomSets.put("_1",u);C=e[0];for(k=C.nextSetBit(0);0<=k;k=C.nextSetBit(k+1))u.set(k),e=this.vwr.makeConnections(c[0],c[1],h,j,u,this.atomExpressionAt(v),m,r,!1,0),g+=Math.abs(e[0]),p+=e[1],u.clear(k)}else e=this.vwr.makeConnections(c[0],c[1],h,j,e[0],e[1],m,r,C,u),g+=Math.abs(e[0]),p+=e[1];c=b.doReport();t?c&&b.report(J.i18n.GT.i(J.i18n.GT._("{0} connections deleted"),p),!1):(q&&(this.vwr.selectBonds(m),
Float.isNaN(f)||b.setShapeSizeBs(1,Math.round(2E3*f),null),this.finalizeObject(1,d[0],l,0,!1,null,0,m),this.vwr.selectBonds(null)),c&&b.report(J.i18n.GT.o(J.i18n.GT._("{0} new bonds; {1} modified"),A(-1,[Integer.$valueOf(g),Integer.$valueOf(p)])),!1))}}},"~N");l(c$,"console",function(){switch(this.getToken(1).tok){case 1073742334:this.chk||this.vwr.showConsole(!1);break;case 1073742335:this.chk||this.vwr.showConsole(!0);break;case 1073741882:this.chk||this.vwr.sm.clearConsole();break;case 134221856:this.showString(this.stringParameter(2));
break;default:this.invArg()}});l(c$,"data",function(){var a=this.e,b=null,c=null,e=!1,f;switch(a.iToken=this.slen){case 5:b=this.paramAsStr(2);case 4:case 2:c=this.paramAsStr(1);if(c.equalsIgnoreCase("clear")){this.chk||this.vwr.setData(null,null,0,0,0,0,0);return}if(0<=(f=c.indexOf("@")))b=""+a.getParameter(c.substring(f+1),4,!0),c=c.substring(0,f).trim();else if(null==b&&0<=(f=c.indexOf(" ")))b=c.substring(f+1).trim(),c=c.substring(0,f).trim(),e=!0;break;default:a.bad()}f=c.substring(0,(c+" ").indexOf(" ")).toLowerCase();
if(f.equals("model")||f.equals("append"))a.cmdLoad();else if(!this.chk){var d=0<=c.toLowerCase().indexOf("(default)");if(f.equals("connect_atoms"))this.vwr.ms.connect(this.parseDataArray(b,!1));else if(0==f.indexOf("ligand_"))this.vwr.setLigandModel(c.substring(7).toUpperCase()+"_data",b.trim());else if(0==f.indexOf("file_"))this.vwr.setLigandModel(c.substring(5)+"_file",b.trim());else if(a=Array(4),f.equals("element_vdw")){a[0]=f;a[1]=b.$replace(";","\n");b=JU.Elements.elementNumberMax;f=G(b+1,0);
for(d=1;d<=b;d++)f[d]=d;a[2]=f;a[3]=Integer.$valueOf(0);this.vwr.setData("element_vdw",a,b,0,0,0,0)}else if(0==f.indexOf("data2d_"))a[0]=c,a[1]=this.parseDataArray(b,!1),a[3]=Integer.$valueOf(2),this.vwr.setData(c,a,0,0,0,0,0);else if(0==f.indexOf("data3d_"))a[0]=c,a[1]=this.parseDataArray(b,!0),a[3]=Integer.$valueOf(3),this.vwr.setData(c,a,0,0,0,0,0);else{var g=JU.PT.getTokens(c);if(0==f.indexOf("property_")&&!(2==g.length&&g[1].equals("set"))){d=this.vwr.bsA();a[0]=f;var h=e?0:this.vwr.getP("propertyAtomNumberField").intValue(),
j=e?0:this.vwr.getP("propertyAtomNumberColumnCount").intValue(),t=e?-2147483648:this.vwr.getP("propertyDataField").intValue(),p=e?0:this.vwr.getP("propertyDataColumnCount").intValue();!e&&0<=c.indexOf(" ")&&(3==g.length&&(h=JU.PT.parseInt(g[1]),t=JU.PT.parseInt(g[2])),5==g.length&&(h=JU.PT.parseInt(g[1]),j=JU.PT.parseInt(g[2]),t=JU.PT.parseInt(g[3]),p=JU.PT.parseInt(g[4])));0>h&&(h=0);0>t&&(t=0);c=this.vwr.ms.ac;e=null;g=JU.BS.newN(c);if(0<h){for(var e=G(c+2,0),k=0;k<=c;k++)e[k]=-1;for(k=d.nextSetBit(0);0<=
k;k=d.nextSetBit(k+1)){var l=this.vwr.ms.at[k].getAtomNumber();l>c+1||(0>l||g.get(l))||(g.set(l),e[l]=k)}a[2]=e}else a[2]=JU.BSUtil.copy(d);a[1]=b;a[3]=Integer.$valueOf(0);this.vwr.setData(f,a,c,h,j,t,p)}else"occupany".equals(f)&&(f="occupancy"),h=JM.AtomCollection.getUserSettableType(f),-1<h?this.vwr.setAtomData(h,f,b,d):(a[0]=c,a[1]=b,a[3]=Integer.$valueOf(0),this.vwr.setData(f,a,0,0,0,0,0))}}});l(c$,"ellipsoid",function(){var a=this.e,b=0,c=1,e=3.4028235E38,f=!1,d=!1;this.setShapeProperty(20,"thisID",
null);switch(this.getToken(1).tok){case 1073742335:b=2147483647;break;case 1073742334:break;case 2:b=this.intParameter(1);break;case 36867:this.e.sm.loadShape(20);this.setShapeProperty(20,"select",this.paramAsStr(2));c=a.iToken;d=f=!0;break;case 1073741974:case 268435633:case 1073741824:this.e.sm.loadShape(20);1073741974==a.theTok&&c++;this.setShapeId(20,c,!1);c=a.iToken;f=!0;break;default:this.invArg()}if(f){for(b=G(-1,[-2147483648]);++c<this.slen;){var f=this.paramAsStr(c),g=null;this.getToken(c);
if(!d)switch(a.theTok){case 1073742330:f="points";g=Array(3);g[0]=a.objectNameParameter(++c);if(this.chk)continue;a.getShapePropertyData(24,"getVertices",g);break;case 1611272194:for(var g=Array(3),h=0;3>h;h++)g[h]=new JU.V3,g[h].setT(this.centerParameter(++c)),c=a.iToken;break;case 12289:g=this.centerParameter(++c);c=a.iToken;break;case 1094713359:g=Integer.$valueOf(this.intParameter(++c));break;case 12291:g=Boolean.TRUE,this.checkLength(c+1)}if(null==g)switch(a.theTok){case 1073742335:f="on";g=
Boolean.TRUE;break;case 1073742334:f="on";g=Boolean.FALSE;break;case 1073742138:g=Float.$valueOf(this.floatParameter(++c));break;case 10:case 1073742325:f="atoms";g=this.atomExpressionAt(c);c=a.iToken;break;case 1765808134:case 603979967:case 1073742074:e=this.getColorTrans(a,c,!0,b);c=a.iToken;continue;case 1073742075:g=this.paramAsStr(++c)}null==g&&this.invArg();this.setShapeProperty(20,f.toLowerCase(),g)}this.finalizeObject(20,b[0],e,0,!1,null,0,null);this.setShapeProperty(20,"thisID",null)}else a.setShapeSizeBs(20,
b,null)});l(c$,"image",function(){this.chk||this.vwr.getConsole();var a=1,b=null;1073741974==this.tokAt(1)&&(b=this.e.optParameterAsString(++a),a++);var c=this.e.optParameterAsString(a),e=this.e.optParameterAsString(this.slen-1).equalsIgnoreCase("close");if(!e&&(this.slen==a||this.slen==a+2))c=this.slen==a+2?this.intParameter(a++):-1,a=0>c?-1:this.intParameter(a),e=new java.util.Hashtable,e.put("fileName","\u0001\u0001"+b),e.put("backgroundColor",Integer.$valueOf(this.vwr.getBackgroundArgb())),e.put("type",
"png"),e.put("quality",Integer.$valueOf(-1)),e.put("width",Integer.$valueOf(c)),e.put("height",Integer.$valueOf(a)),this.chk||this.vwr.processWriteOrCapture(e);else{if(e)switch(this.slen){case 2:c="closeall";break;case 3:case 4:break;default:this.checkLength(0)}this.chk||this.vwr.fm.loadImage(e?"\u0001close":c,"\u0001"+c+"\u0001"+("".equals(b)||null==b?null:b),!1)}});l(c$,"mapProperty",function(){for(var a,b,c,e,f,d=0,g=0,h=0,j=this.e;;){if(1113589787==this.tokAt(1))a=this.vwr.bsA(),b=this.atomExpressionAt(2),
c=e="selected";else{a=this.atomExpressionAt(1);if(1073742336!=this.tokAt(++j.iToken)||!JS.T.tokAttr(d=this.tokAt(++j.iToken),1077936128))break;c=this.paramAsStr(j.iToken);b=this.atomExpressionAt(++j.iToken);if(1073742336!=this.tokAt(++j.iToken)||!JS.T.tokAttr(g=this.tokAt(++j.iToken),2048))break;e=this.paramAsStr(j.iToken)}f=JS.T.tokAttr(h=this.tokAt(j.iToken+1),1077936128)?this.paramAsStr(++j.iToken):JS.T.nameOf(h=1094715393);j.checkLast(j.iToken);if(this.chk)return;var t=null;this.showString("mapping "+
c.toUpperCase()+" for "+a.cardinality()+" atoms to "+e.toUpperCase()+" for "+b.cardinality()+" atoms using "+f.toUpperCase());if(JS.T.tokAttrOr(d,1094713344,1111490560)&&JS.T.tokAttrOr(g,1094713344,1111490560)&&JS.T.tokAttrOr(h,1094713344,1111490560)){var l=this.getBitsetPropertyFloat(a,d|224,null,NaN,NaN),k=this.getBitsetPropertyFloat(a,h|224,null,NaN,NaN),d=this.getBitsetPropertyFloat(b,h|224,null,NaN,NaN),D=1715472409==g,q=L(D?this.vwr.ms.ac:d.length,0),t=new JU.BS;if(l.length==k.length){for(var z=
new java.util.Hashtable,h=0;h<l.length;h++)z.put(Float.$valueOf(k[h]),Float.$valueOf(l[h]));l=-1;for(h=k=0;h<d.length;h++){var l=b.nextSetBit(l+1),s=z.get(Float.$valueOf(d[h]));null!=s&&(t.set(l),q[D?l:k]=s.floatValue(),k++)}D?this.vwr.setData(e,A(-1,[e,q,t,Integer.$valueOf(1),Boolean.TRUE]),this.vwr.ms.ac,0,0,2147483647,0):JS.T.tokAttr(g,2048)?this.vwr.setAtomProperty(t,g,0,0,null,q,null):this.error(56)}}if(null==t){c=this.getBitsetIdent(a,"{"+f+"=%["+f+"]}."+e+" = %["+c+"]",null,!1,2147483647,!1);
a=new JU.SB;for(h=0;h<c.length;h++)0>c[h].indexOf("null")&&a.append(c[h]).appendC("\n");JU.Logger.debugging&&JU.Logger.debug(a.toString());c=JU.BSUtil.copy(this.vwr.slm.bsSubset);this.vwr.slm.setSelectionSubset(b);try{j.runScript(a.toString())}catch(m){if(N(m,Exception))b=m,this.vwr.slm.setSelectionSubset(c),j.errorStr(-1,"Error: "+b.getMessage());else if(N(m,Error))b=m,this.vwr.slm.setSelectionSubset(c),j.errorStr(-1,"Error: "+b.toString());else throw m;}this.vwr.slm.setSelectionSubset(c)}this.showString("DONE");
return}this.invArg()});l(c$,"minimize",function(){for(var a=null,b=2147483647,c=0,e=!1,f=!1,d=null,g=!1,h=this.vwr.getMinimizer(!1),j=1;j<this.slen;j++)switch(this.getToken(j).tok){case 1073741828:e=!0;continue;case 1073741874:case 1073742162:this.checkLength(2);if(this.chk||null==h)return;h.setProperty(this.paramAsStr(j),null);return;case 1073741882:this.checkLength(2);if(this.chk||null==h)return;h.setProperty("clear",null);return;case 1073741894:1!=j&&this.invArg();b=a=0;c=G(5,0);if(1073741882==
this.tokAt(++j))this.checkLength(3);else{for(;4>a&&!this.isFloatParameter(j);)c[++a]=this.atomExpressionAt(j).nextSetBit(0),j=this.e.iToken+1;c[0]=a;1==a&&this.invArg();b=this.floatParameter(this.e.checkLast(j))}this.chk||this.vwr.getMinimizer(!0).setProperty("constraint",A(-1,[c,G(a,0),Float.$valueOf(b)]));return;case 1073741905:c=this.floatParameter(++j);continue;case 1073741934:b=0;continue;case 12293:1!=j&&this.invArg();d=this.atomExpressionAt(++j);0>d.nextSetBit(0)&&(d=null);j=this.e.iToken;
this.chk||this.vwr.getMinimizer(!0).setProperty("fixed",d);if(j+1==this.slen)return;continue;case 10:case 1073742325:g=!0;case 1275082245:1275082245==this.e.theTok&&j++;a=this.atomExpressionAt(j);j=this.e.iToken;1073742072==this.tokAt(j+1)&&(j++,g=!0);continue;case 1073742148:f=!0;break;case 266298:b=this.intParameter(++j);continue;default:this.invArg()}if(!this.chk)try{this.vwr.minimize(this.e,b,c,a,d,0,e,g,f,!1)}catch(t){if(N(t,Exception))throw new JS.ScriptInterruption(this.e,"minimize",1);throw t;
}});l(c$,"modulation",function(){var a=null,b=this.e,c=!0,e=!1,f=null,d=1;switch(this.getToken(d).tok){case 1073742334:c=!1;case 0:case 1073742335:break;case 10:case 1073742325:f=this.atomExpressionAt(1);switch(this.tokAt(b.iToken+1)){case 1073742334:c=!1;case 1073742335:b.iToken++}b.checkLast(b.iToken);break;case 1073742332:case 8:a=b.getPoint3f(1,!1);e=1073742335==this.tokAt(b.iToken+1);break;default:var g=b.theToken.value.toString();d++;g.equalsIgnoreCase("t")?b.theTok=3:g.equalsIgnoreCase("m")||
g.equalsIgnoreCase("q")?b.theTok=2:this.invArg();case 3:case 2:switch(b.theTok){case 3:this.isFloatParameter(d)?(a=this.floatParameter(d),a=JU.P3.new3(a,a,a)):a=b.getPoint3f(d,!1);break;case 2:2==this.tokAt(d)?(e=this.intParameter(d),a=JU.P3.new3(e,e,e)):a=b.getPoint3f(d,!1),e=!0}break;case 1073742138:c=this.floatParameter(2);this.chk||this.vwr.setFloatProperty("modulationScale",c);return}this.chk||(this.vwr.tm.setVibrationPeriod(0),this.vwr.setModulation(f,c,a,e))});l(c$,"mutate",function(){var a,
b;switch(this.tokAt(1)){case 2:this.st[1]=JS.T.o(4,""+this.st[1].value);default:a=this.atomExpressionAt(1);b=++this.e.iToken;break;case 268435633:a=this.vwr.getAllAtoms(),b=2}a.and(this.vwr.getModelUndeletedAtomsBitSet(this.vwr.ms.mc-1));var c=a.length()-1,e=0;if(!(0>c||(e=this.vwr.ms.at[c].mi)!=this.vwr.ms.mc-1||this.vwr.ms.isTrajectory(e)))if(c=this.e.optParameterAsString(b),this.e.checkLast(b),!this.chk&&this.vwr.ms.am[e].isBioModel){e=null;if(4==this.tokAt(b)&&!c.startsWith("~"))e=A(-1,[c]),c=
null;else{c=JU.PT.replaceAllCharacters(c,",; \t\n"," ").trim().toUpperCase();if((b=c.startsWith("~"))||3!=c.length||!this.vwr.getJBR().isKnownPDBGroup(c,20))c=this.vwr.getJBR().toStdAmino3(b?c.substring(1):c);e=JU.PT.getTokens(c)}0<e.length&&this.vwr.ms.bioModelset.mutate(a,c,e)}});l(c$,"navigate",function(){var a=this.e;if(1==this.slen)a.setBooleanProperty("navigationMode",!0);else{var b=JU.V3.new3(0,1,0),c=new JU.Lst,e;if(2==this.slen)switch(this.getToken(1).tok){case 1073742335:case 1073742334:if(this.chk)return;
a.setObjectMad10(34,"axes",10);this.setShapeProperty(34,"position",JU.P3.new3(50,50,3.4028235E38));a.setBooleanProperty("navigationMode",!0);this.vwr.tm.setNavOn(1073742335==a.theTok);return;case 1073742162:this.chk||this.vwr.tm.setNavXYZ(0,0,0);return;case 8:case 1112152078:break;default:this.invArg()}!this.chk&&!this.vwr.getBoolean(603979889)&&a.setBooleanProperty("navigationMode",!0);for(var f=1;f<this.slen;f++){var d=this.isFloatParameter(f)?this.floatParameter(f++):2;0>d&&this.invArg();!this.chk&&
0<d&&a.refresh(!1);switch(this.getToken(f).tok){case 8:case 1073742332:e=this.getPoint3f(f,!0);a.iToken++;a.iToken!=this.slen&&this.invArg();this.chk||this.vwr.tm.setNavXYZ(e.x,e.y,e.z);return;case 554176526:e=this.floatParameter(++f);this.chk||c.addLast(A(-1,[Integer.$valueOf(554176526),Float.$valueOf(d),Float.$valueOf(e)]));continue;case 12289:e=this.centerParameter(++f);f=a.iToken;this.chk||c.addLast(A(-1,[Integer.$valueOf(134217751),Float.$valueOf(d),e]));continue;case 528432:switch(this.getToken(++f).tok){case 1111492629:b.set(1,
0,0);f++;break;case 1111492630:b.set(0,1,0);f++;break;case 1111492631:b.set(0,0,1);f++;break;case 8:case 1073742332:b.setT(this.getPoint3f(f,!0));f=a.iToken+1;break;case 1073741824:this.invArg()}e=this.floatParameter(f);this.chk||c.addLast(A(-1,[Integer.$valueOf(528432),Float.$valueOf(d),b,Float.$valueOf(e)]));continue;case 4160:var g=e=NaN;if(this.isFloatParameter(++f))e=this.floatParameter(f),g=this.floatParameter(++f);else switch(this.tokAt(f)){case 1111492629:e=this.floatParameter(++f);break;
case 1111492630:g=this.floatParameter(++f);break;default:e=this.centerParameter(f);f=a.iToken;this.chk||c.addLast(A(-1,[Integer.$valueOf(4160),Float.$valueOf(d),e]));continue}this.chk||c.addLast(A(-1,[Integer.$valueOf(268435634),Float.$valueOf(d),Float.$valueOf(e),Float.$valueOf(g)]));continue;case 268435632:continue;case 1112152078:e=new JU.Lst;10==this.tokAt(f+1)||1073742325==this.tokAt(f+1)?(g=this.atomExpressionAt(++f),f=a.iToken):g=this.vwr.bsA();if(this.chk)return;this.vwr.getPolymerPointsAndVectors(g,
e);var h;if(0<(h=e.size())){for(var g=Array(h),j=0;j<h;j++)g[j]=e.get(j);c.addLast(A(-1,[Integer.$valueOf(1112152078),Float.$valueOf(d),g]));continue}break;case 1073742084:if(1073742330==this.getToken(f+1).tok){f++;e=a.objectNameParameter(++f);if(this.chk)return;this.setShapeProperty(22,"thisID",e);e=this.getShapeProperty(22,"vertices");a.refresh(!1);null==e&&this.invArg();g=F(this.isFloatParameter(f+1)?this.floatParameter(++f):0);h=F(this.isFloatParameter(f+1)?this.floatParameter(++f):2147483647);
c.addLast(A(-1,[Integer.$valueOf(1073742084),Float.$valueOf(d),e,null,G(-1,[g,h])]));continue}for(e=new JU.Lst;a.isCenterParameter(f+1);)e.addLast(this.centerParameter(++f)),f=a.iToken;if(0<e.size()){e=e.toArray(Array(e.size()));this.chk||c.addLast(A(-1,[Integer.$valueOf(1073742084),Float.$valueOf(d),e,null,G(-1,[0,2147483647])]));continue}default:this.invArg()}}!this.chk&&!this.vwr.isJmolDataFrame()&&this.vwr.tm.navigateList(a,c)}});l(c$,"plot",function(a){var b=this.e,c=this.vwr.am.cmi;0>c&&b.errorStr(30,
"plot");var c=this.vwr.ms.getJmolDataSourceFrame(c),e=a.length-1,f=a!==this.st,d=!0,g=this.st;f&&(b.st=this.st=a);var h=f?134222350:a[0].tok,j=f||134221850==h||4138==h?0:1,t=null,l=!0,k=!1;switch(h){case 135176:l=!1;k=!0;break;case 134222350:d=l=!1;break;case 134221856:l=!1,4==JS.CmdExt.tokAtArray(e,a)?t=this.stringParameter(e--):1073742336==JS.CmdExt.tokAtArray(e-1,a)?(t=this.paramAsStr(e-2)+"."+this.paramAsStr(e),e-=3):(b.st=this.st=g,b.iToken=this.st.length,this.error(13)),b.slen=this.slen=e+1}var f=
"",D=null,q="",z=!1,s=!1,m=!1,r=!1,v=Array(3),y=G(3,0),u=JU.BSUtil.copy(this.vwr.bsA()),C="; select "+JU.Escape.eBS(u)+";\n ",r=b.optParameterAsString(e).toLowerCase(),w=null,n=null,x=null,B=JS.CmdExt.tokAtArray(j,a);4==B&&(B=JS.T.getTokFromName(a[j].value));switch(B){default:b.iToken=1;this.invArg();break;case 134221834:b.iToken=1;r="data";C="";break;case 1715472409:b.iToken=j+1;for(a=0;3>a;a++){switch(this.tokAt(b.iToken)){case 4:y[a]=JS.T.getTokFromName(b.getToken(b.iToken).value);break;default:y[a]=
this.tokAt(b.iToken);break;case 0:0==a&&this.invArg();case 1287653388:case 32:case 64:a=2;continue}1715472409!=y[a]&&!JS.T.tokAttr(y[a],1077936128)&&this.invArg();v[a]=this.getToken(b.iToken).value.toString();b.iToken++}1287653388==this.tokAt(b.iToken)&&(x=this.stringParameter(++b.iToken),d=!1,b.iToken++);32==this.tokAt(b.iToken)&&(w=this.getPoint3f(++b.iToken,!1),b.iToken++);64==this.tokAt(b.iToken)&&(n=this.getPoint3f(++b.iToken,!1),b.iToken++);r="property "+v[0]+(null==v[1]?"":" "+v[1])+(null==
v[2]?"":" "+v[2]);0>u.nextSetBit(0)&&(u=this.vwr.getModelUndeletedAtomsBitSet(c));q="select "+JU.Escape.eBS(u)+";\n ";break;case 4138:r.equalsIgnoreCase("draw")&&(r=b.optParameterAsString(--e).toLowerCase());r=e>j&&r.startsWith("r");r="ramachandran"+(r?" r":"")+(135176==h?" draw":"");break;case 134221850:case 136314895:f=' "'+this.vwr.getQuaternionFrame()+'"';q="set quaternionFrame"+f+";\n  ";z=!0;r.equalsIgnoreCase("draw")&&(k=!0,r=b.optParameterAsString(--e).toLowerCase());m=(s=r.startsWith("deriv")||
r.startsWith("diff"))&&0<r.indexOf("2");s&&e--;if(r.equalsIgnoreCase("helix")||r.equalsIgnoreCase("axis"))s=k=!0,e=-1;r=((e<=j?"":b.optParameterAsString(e))+"w").substring(0,1);if(r.equals("a")||r.equals("r"))s=!0;JU.PT.isOneOf(r,";w;x;y;z;r;a;")||b.evalError("QUATERNION [w,x,y,z,a,r] [difference][2]",null);r="quaternion "+r+(s?" difference":"")+(m?"2":"")+(k?" draw":"")}this.st=g;if(this.chk)return"";if(l&&(q+="plot "+r,g=this.vwr.ms.getJmolDataFrameIndex(c,q),0<g&&134221856!=h&&134222350!=h))return this.vwr.setCurrentModelIndexClear(g,
!0),"";l=e=g=null;j=Array(3);if(1715472409==B){g=this.getBitsetPropertyFloat(u,y[0]|224,1715472409==y[0]?v[0]:null,null==w?NaN:w.x,null==n?NaN:n.x);j[0]=v[0]+" "+JU.Escape.eAF(g);null!=v[1]&&(e=this.getBitsetPropertyFloat(u,y[1]|224,1715472409==y[1]?v[1]:null,null==w?NaN:w.y,null==n?NaN:n.y),j[1]=v[1]+" "+JU.Escape.eAF(e));null!=v[2]&&(l=this.getBitsetPropertyFloat(u,y[2]|224,1715472409==y[2]?v[2]:null,null==w?NaN:w.z,null==n?NaN:n.z),j[2]=v[2]+" "+JU.Escape.eAF(l));null==w&&(w=JU.P3.new3(this.getPlotMinMax(g,
!1,y[0]),this.getPlotMinMax(e,!1,y[1]),this.getPlotMinMax(l,!1,y[2])));null==n&&(n=JU.P3.new3(this.getPlotMinMax(g,!0,y[0]),this.getPlotMinMax(e,!0,y[1]),this.getPlotMinMax(l,!0,y[2])));JU.Logger.info("plot min/max: "+w+" "+n);k=D=null;if(d){k=JU.P3.new3(1,1,1);D=new JU.P3;D.ave(n,w);k.sub2(n,w);k.set(k.x/200,k.y/200,k.z/200);JS.T.tokAttr(y[0],1094713344)?(k.x=1,D.x=0):0.1<k.x&&10>=k.x&&(k.x=1);JS.T.tokAttr(y[1],1094713344)?(k.y=1,D.y=0):0.1<k.y&&10>=k.y&&(k.y=1);JS.T.tokAttr(y[2],1094713344)?(k.z=
1,D.z=0):0.1<k.z&&10>=k.z&&(k.z=1);if(null==v[2]||null==v[1])D.z=w.z=n.z=k.z=0;for(a=0;a<g.length;a++)g[a]=(g[a]-D.x)/k.x;if(null!=v[1])for(a=0;a<e.length;a++)e[a]=(e[a]-D.y)/k.y;if(null!=v[2])for(a=0;a<l.length;a++)l[a]=(l[a]-D.z)/k.z}D=A(-1,[u,g,e,l,w,n,k,D,x,j])}if(134221856==h)return this.vwr.writeFileData(t,"PLOT_"+r,c,D);d=r.equals("data")?"1 0 H 0 0 0 # Jmol PDB-encoded data":this.vwr.getPdbData(c,r,null,D,null,!0);if(134222350==h)return d;JU.Logger.debugging&&JU.Logger.debug(d);if(135176==
h)return b.runScript(d),"";h=this.vwr.fm.getFileInfo();t=this.vwr.getBoolean(603979792);this.vwr.g.appendNew=!0;d=null!=d&&null==this.vwr.openStringInlineParamsAppend(d,null,!0);this.vwr.g.appendNew=t;this.vwr.fm.setFileInfo(h);if(!d)return"";h=this.vwr.ms.mc;this.vwr.ms.setJmolDataFrame(q,c,h-1);1715472409!=B&&(q+=";\n"+C);q=this.vwr.addStateScript(q,!0,!1);d=150;switch(B){default:c="frame 0.0; frame last; reset;select visible;wireframe only;";d=10;break;case 1715472409:this.vwr.setFrameTitle(h-
1,r+" plot for model "+this.vwr.getModelNumberDotted(c));c="frame 0.0; frame last; reset;select visible; spacefill 3.0; wireframe 0;draw plotAxisX"+h+' {100 -100 -100} {-100 -100 -100} "'+v[0]+'";draw plotAxisY'+h+' {-100 100 -100} {-100 -100 -100} "'+v[1]+'";';null!=v[2]&&(c+="draw plotAxisZ"+h+' {-100 -100 100} {-100 -100 -100} "'+v[2]+'";');break;case 4138:this.vwr.setFrameTitle(h-1,"ramachandran plot for model "+this.vwr.getModelNumberDotted(c));c="frame 0.0; frame last; reset;select visible; color structure; spacefill 3.0; wireframe 0;draw ramaAxisX"+
h+' {100 0 0} {-100 0 0} "phi";draw ramaAxisY'+h+' {0 100 0} {0 -100 0} "psi";';break;case 134221850:case 136314895:this.vwr.setFrameTitle(h-1,r.$replace("w"," ")+f+" for model "+this.vwr.getModelNumberDotted(c)),c=JU.C.getHexCode(this.vwr.cm.colixBackgroundContrast),c="frame 0.0; frame last; reset;select visible; wireframe 0; spacefill 3.0; isosurface quatSphere"+h+" color "+c+" sphere 100.0 mesh nofill frontonly translucent 0.8;draw quatAxis"+h+'X {100 0 0} {-100 0 0} color red "x";draw quatAxis'+
h+'Y {0 100 0} {0 -100 0} color green "y";draw quatAxis'+h+'Z {0 0 100} {0 0 -100} color blue "z";color structure;draw quatCenter'+h+"{0 0 0} scale 0.02;"}b.runScript(c+C);q.setModelIndex(this.vwr.am.cmi);this.vwr.setRotationRadius(d,!0);b.sm.loadShape(31);this.showString("frame "+this.vwr.getModelNumberDotted(h-1)+(0<r.length?" created: "+r+(z?f:""):""));return""},"~A");l(c$,"polyhedra",function(){var a=this.e,b=1==this.slen,c=!1,e=b,f=!1,d=!1,g=!1,h=NaN,j=0;a.sm.loadShape(21);this.setShapeProperty(21,
"init",Boolean.TRUE);for(var l=3.4028235E38,p=-1,k=G(-1,[-2147483648]),A=-1,q=null,z=null,s=!1,m=1;m<this.slen;++m){var r=null,v=null;switch(this.getToken(m).tok){case 6:r="info";v=this.e.theToken.value;e=!0;break;case 134217751:r="points";v=Float.$valueOf(1073742334==this.tokAt(++m)?0:this.e.floatParameter(m));s=!0;break;case 1073742138:h=this.floatParameter(++m);s=!0;continue;case 1814695966:null!=z&&this.invArg();r="unitCell";v=Boolean.TRUE;e=!0;break;case 1073742072:this.e.restrictSelected(!1,
!1),a.theTok=1073742335;case 1073742335:case 12291:case 1073742334:(m+1!=this.slen||e||1<j)&&this.error(18);r=1073742334==a.theTok?"off":1073742335==a.theTok?"on":"delete";f=!0;break;case 1073741961:r="full";break;case 2:null!=z&&this.invArg();r="nVertices";v=Integer.$valueOf(this.intParameter(m));e=!0;268435504==this.tokAt(m+1)&&m++;break;case 1677721602:null!=z&&this.invArg();0<j&&this.invPO();e=!0;r="bonds";b=!0;break;case 1073741852:-1!=p&&this.invArg(),p=0,m--;case 1665140738:m++;case 3:null!=
z&&this.invArg();0<j&&this.invPO();r=0>=p?"radius":"radius1";v=Float.$valueOf(p=0==p?0:this.floatParameter(m));e=!0;break;case 1073742066:if(!this.isFloatParameter(m+1)){q=this.getPoint3f(++m,!0);m=a.iToken;s=!0;continue}case 1073741937:this.setShapeProperty(21,"collapsed",null);case 1073742099:case 1073741924:r=JS.T.nameOf(a.theTok);switch(this.tokAt(m+1)){case 268435860:case 268435504:m++}v=Float.$valueOf(this.floatParameter(++m));break;case 1094717454:null==z&&this.invArg();r="model";v=Integer.$valueOf(this.intParameter(++m));
break;case 1073742170:(1<j||null!=z&&!c||A==m)&&this.invPO();j=3;10==this.tokAt(++m)||1073742325==this.tokAt(m)?(r=e?"to":"toBitSet",v=this.atomExpressionAt(m)):a.isArrayParameter(m)?(r="toVertices",v=a.getPointArray(m,-1,!1)):this.error(19);m=a.iToken;e=!0;break;case 10:case 1073742325:d&&this.invPO();switch(++j){case 1:null!=z&&this.invArg();r="centers";break;case 2:r="to";e=!0;break;default:a.bad()}v=this.atomExpressionAt(m);m=a.iToken;e=(new Boolean(e|m+1==this.slen)).valueOf();break;case 1765808134:case 603979967:case 1073742074:l=
this.getColorTrans(a,m,!0,k);m=a.iToken;continue;case 1073741886:d&&this.error(18);d=!0;this.isFloatParameter(m+1)&&this.setShapeProperty(21,"faceCenterOffset",Float.$valueOf(this.floatParameter(++m)));r="collapsed";break;case 1073742044:case 1073741933:case 1073741956:g&&this.error(18);s=g=!0;r=JS.T.nameOf(a.theTok);break;case 1073742182:case 1073742060:case 1073741861:case 1073741958:case 1073741964:continue;case 1073741974:case 268435633:case 1073741824:case 4:if(!a.isColorParam(m)){1!=m&&this.invPO();
z=1073741974==a.theTok?this.stringParameter(++m):a.optParameterAsString(m);this.setShapeProperty(21,"thisID",z);this.setShapeProperty(21,"model",Integer.$valueOf(this.vwr.am.cmi));if(!a.isCenterParameter(m+1))continue;r="center";v=this.centerParameter(++m);m=a.iToken;c=!0;break}default:if(a.isColorParam(m)){k[0]=a.getArgbParam(m);a.isCenterParameter(m)&&(A=a.iToken+1);m=a.iToken;continue}this.invArg()}null!=r&&this.setShapeProperty(21,r,v);if(f)return}e?(!d&&b&&this.setShapeProperty(21,"bonds",null),
this.setShapeProperty(21,"generate",null)):s||this.error(19);null!=q&&this.setShapeProperty(21,"offset",q);Float.isNaN(h)||this.setShapeProperty(21,"scale",Float.$valueOf(h));-2147483648!=k[0]&&this.setShapeProperty(21,"colorThis",Integer.$valueOf(k[0]));3.4028235E38!=l&&a.setShapeTranslucency(21,"","translucentThis",l,null);this.setShapeProperty(21,"init",Boolean.FALSE)});l(c$,"write",function(a){var b=this.e,c=1,e=1,f=null,d=null,g=null,h=null,j="SPT",d=!0,l=!1;null==a?(a=this.st,l=this.vwr.isApplet&&
!this.vwr.isSignedApplet||!this.vwr.haveAccess(JV.Viewer.ACCESS.ALL)||0<this.vwr.fm.getPathForAllFiles().length):(c=e=0,d=!1,l=!d);var p=JS.CmdExt.tokAtArray(c,a);if(4==p&&!d){var k=JS.T.getTokenFromName(JS.SV.sValue(a[0]).toLowerCase());null!=k&&(p=k.tok)}switch(p){case 0:break;case 134221850:case 4138:case 1715472409:return d=this.plot(a),l?d:this.writeMsg(d);case 134222850:b.isArrayParameter(c+1)&&(f=b.stringParameterSet(++c),h=g=".",e=c=b.iToken+1,p=this.tokAt(c));break;default:j=JS.SV.sValue(this.tokenAt(c,
a)).toUpperCase()}var A=this.vwr.getExportDriverList(),k=null,q=d?this.slen:a.length,z="",s=null,m=null,r=0,v="PNGJ",y=!1,u=null,C=-1,w=-1,n=!1,x=null;0!=p&&(d&&1<this.slen&&1073741848==this.tokAt(this.slen-2))&&(j=this.paramAsStr(this.slen-1).toUpperCase(),e=q,q-=2,p=0);switch(p){case 15:case 6:j="VAR";m=this.tokenAt(c++,a);break;case 1073741983:j="INLINE";k=JS.SV.sValue(this.tokenAt(++c,a));c++;break;case 134217762:j="PGRP";c++;z=JS.SV.sValue(this.tokenAt(c,a)).toLowerCase();z.equals("draw")&&c++;
break;case 1073742329:c++;y=!0;break;case 1073742158:case 134222850:for(s=JS.SV.sValue(this.tokenAt(++c,a)).toLowerCase();s.equals("localpath")||s.equals("remotepath");)s.equals("localpath")?g=JS.SV.sValue(this.tokenAt(++c,a)):h=JS.SV.sValue(this.tokenAt(++c,a)),s=JS.SV.sValue(this.tokenAt(++c,a)).toLowerCase();j="SPT";break;case 1228935687:case 134320141:case 1610616855:case 135180:case 1073742015:case 1073742018:case 1073877011:case 1073877010:case 135188:c++;break;case 1073741991:j="ZIPALL";c++;
break;case 36868:j="VAR";c+=2;break;case 4115:case 4120:case 1073742139:case 4166:case 1073741824:case 4:switch(p){case 4115:var B;c+1<q&&1073742325==a[++c].tok||10==a[c].tok?(B=b.atomExpression(a,c,0,!0,!1,null,!0),c=b.iToken+1):B=this.vwr.getAllAtoms();this.chk||(u=this.vwr.ms.getModelBS(B,!0));break;case 4120:j="IMAGE";c++;break;case 1073742139:s=JS.SV.sValue(this.tokenAt(++c,a)).toUpperCase();JU.PT.isOneOf(s,";PNG;PNGJ;")&&(v=s,c++);break;case 4166:r=b.intParameterRange(++c,1,10);if(2147483647==
r)return"";this.chk||(this.vwr.tm.setVibrationPeriod(0),b.isJS||b.delayScript(100));c++;break;default:p=4120}if(4120==p&&c<a.length)if(p=JS.T.getTokenFromName(JS.SV.sValue(a[c]).toLowerCase()),null!=p&&(j=JS.SV.sValue(p).toUpperCase()),JU.PT.isOneOf(j,A.toUpperCase())){c++;j=j.substring(0,1).toUpperCase()+j.substring(1).toLowerCase();n=!0;d&&(x="Jmol."+j.toLowerCase());break}else if(JU.PT.isOneOf(j,";ZIP;ZIPALL;SPT;STATE;")){c++;break}else j="IMAGE";2==JS.CmdExt.tokAtArray(c,a)&&(C=JS.SV.iValue(this.tokenAt(c++,
a)),0>=C&&this.invArg(),w=JS.SV.iValue(this.tokenAt(c++,a)),0>=w&&this.invArg())}p=-2147483648;if(e<q){s=JS.SV.sValue(this.tokenAt(c,a));if(s.equalsIgnoreCase("clipboard")){if(this.chk)return""}else JU.PT.isOneOf(s.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;gift;pdf;ppm;png;pngj;pngt;")?(2==JS.CmdExt.tokAtArray(c+1,a)&&2==JS.CmdExt.tokAtArray(c+2,a)&&(C=JS.SV.iValue(this.tokenAt(++c,a)),0>=C&&this.invArg(),w=JS.SV.iValue(this.tokenAt(++c,a)),0>=w&&this.invArg()),2==JS.CmdExt.tokAtArray(c+1,a)&&(p=
JS.SV.iValue(this.tokenAt(++c,a)))):JU.PT.isOneOf(s.toLowerCase(),";xyz;xyzrn;xyzvib;mol;mol67;sdf;v2000;v3000;json;pdb;pqr;cml;cif;")&&(j=s.toUpperCase(),c+1==q&&c++);j.equals("IMAGE")&&JU.PT.isOneOf(s.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;gift;pdf;ppm;png;pngj;pngt;scene;")&&(j=s.toUpperCase(),c++)}c+2==q&&(e=JS.SV.sValue(this.tokenAt(++c,a)),0<e.length&&"."!=e.charAt(0)&&(j=s.toUpperCase()));switch(JS.CmdExt.tokAtArray(c,a)){case 0:l=!0;break;case 1073741884:break;case 805306401:x=j.equals("IMAGE")?
"?jmol.png":"?jmol."+j.toLowerCase();break;case 1073741824:case 4:x=JS.SV.sValue(this.tokenAt(c,a));if(x.equalsIgnoreCase("clipboard")||!this.vwr.haveAccess(JV.Viewer.ACCESS.ALL))x=null;break;default:this.invArg()}if(j.equals("IMAGE")||j.equals("FRAME")||j.equals("VIBRATION"))j=null!=x&&0<=x.indexOf(".")?x.substring(x.lastIndexOf(".")+1).toUpperCase():"JPG";s=JU.PT.isOneOf(j.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;gift;pdf;ppm;png;pngj;pngt;scene;");if(!s&&(j.equals("MNU")?j="MENU":j.equals("WRL")||
j.equals("VRML")?(j="Vrml",n=!0):j.equals("X3D")?(j="X3d",n=!0):j.equals("IDTF")?(j="Idtf",n=!0):j.equals("MA")?(j="Maya",n=!0):j.equals("JS")?(j="Js",n=!0):j.equals("OBJ")?(j="Obj",n=!0):j.equals("JVXL")?j="ISOSURFACE":j.equals("XJVXL")?j="ISOSURFACE":j.equals("JMOL")?j="ZIPALL":j.equals("HIS")&&(j="HISTORY"),j.equals("COORD")||j.equals("COORDS")))j=null!=x&&0<=x.indexOf(".")?x.substring(x.lastIndexOf(".")+1).toUpperCase():"XYZ";null!=f&&(j.equals("PNG")&&(j="PNGJ"),!j.equals("PNGJ")&&(!j.equals("ZIPALL")&&
!j.equals("ZIP"))&&this.invArg());!s&&(!n&&!JU.PT.isOneOf(j,";SCENE;JMOL;ZIP;ZIPALL;SPT;HISTORY;MO;NBO;ISOSURFACE;MESH;PMESH;VAR;FILE;FUNCTION;CIF;CML;JSON;XYZ;XYZRN;XYZVIB;MENU;MOL;MOL67;PDB;PGRP;PQR;QUAT;RAMA;SDF;V2000;V3000;INLINE;"))&&b.errorStr2(54,"COORDS|FILE|FUNCTIONS|HISTORY|IMAGE|INLINE|ISOSURFACE|JMOL|MENU|MO|NBO|POINTGROUP|QUATERNION [w,x,y,z] [derivative]|RAMACHANDRAN|SPT|STATE|VAR x|ZIP|ZIPALL  CLIPBOARD","CIf|CML|GIF|GIFT|JPG|JPG64|JMOL|JVXL|MESH|MOL|PDB|PMESH|PNG|PNGJ|PNGT|PPM|PQR|SDF|CD|JSON|V2000|V3000|SPT|XJVXL|XYZ|XYZRN|XYZVIB|ZIP"+
A.toUpperCase().$replace(";","|"));if(this.chk)return"";c=Array(1);e=this.vwr.getBoolean(603979934);if(n){e&&JU.Logger.startTimer("export");k=new java.util.Hashtable;k.put("type",j);null!=x&&k.put("fileName",x);(d||null!=x)&&k.put("fullPath",c);k.put("width",Integer.$valueOf(C));k.put("height",Integer.$valueOf(w));k=this.vwr.generateOutputForExport(k);if(null==k||0==k.length)return"";if(l)return k;if(!j.equals("Povray")&&!j.equals("Idtf")||null==c[0])return this.writeMsg(k);l=j.equals("Idtf")?".tex":
".ini";x=c[0]+l;a=new java.util.Hashtable;a.put("fileName",x);a.put("type",l);a.put("text",k);a.put("fullPath",c);d=this.vwr.processWriteOrCapture(a);j.equals("Idtf")&&(k=k.substring(0,k.indexOf("\\begin{comment}")));k="Created "+c[0]+":\n\n"+k;e&&this.showString(JU.Logger.getTimerMsg("export",0));null!=d&&((j=!d.startsWith("OK"))&&b.evalError(d,null),b.report(k,j));return""}n=null;A=!1;if(null==k){q=0;k=j.intern();if("MENU"===k)k=this.vwr.getMenu("");else if("PGRP"===k)k=this.vwr.ms.getPointGroupAsString(this.vwr.bsA(),
null,0,1,null,null,z.equals("draw")?"":null);else if("PDB"===k||"PQR"===k)l?k=this.vwr.getPdbAtomData(null,null,"PQR"===k,y):(A=!0,j="PDB_"+k+"-coord "+y);else if("FILE"===k)"?".equals(x)&&(x="?Jmol."+this.vwr.getP("_fileType")),l?k=this.vwr.getCurrentFileAsString("script"):A=!0;else if("CIF"===k||"SDF"===k||"MOL"===k||"MOL67"===k||"V2000"===k||"V3000"===k||"CD"===k||"JSON"===k||"XYZ"===k||"XYZRN"===k||"XYZVIB"===k||"CML"===k)k=this.vwr.getModelExtract("selected",y,!1,k),k.startsWith("ERROR:")&&(n=
k);else if("FUNCTION"===k)k=this.vwr.getFunctionCalls(null),j="TXT";else if("VAR"===k)null==m&&(m=b.getParameter(JS.SV.sValue(this.tokenAt(d?2:1,a)),1073742190,!0)),g=null,15==m.tok?(g=new JU.Lst,g.addLast(m.value.data)):6==m.tok&&(g=null==x?new JU.Lst:this.prepareBinaryOutput(m)),null==g?(k=m.asString(),j="TXT"):null!=x&&(a=new java.util.Hashtable,a.put("data",g),null==(n=k=this.vwr.createZip(x,1==g.size()||x.endsWith(".png")||x.endsWith(".pngj")?"BINARY":"ZIPDATA",a))&&b.evalError("#CANCELED#",
null));else if("SPT"===k)if(y)a=this.vwr.ms.getTaintedAtoms(2),this.vwr.setAtomCoordsRelative(JU.P3.new3(0,0,0),null),k=this.vwr.getStateInfo(),this.vwr.ms.setTaintedAtoms(a,2);else{if(k=this.vwr.getStateInfo(),null!=g||null!=h)k=JV.FileManager.setScriptFileReferences(k,g,h,null)}else"ZIP"===k||"ZIPALL"===k?null!=x&&(a=new java.util.Hashtable,null!=f&&a.put("data",f),null==(n=k=this.vwr.createZip(x,j,a))&&b.evalError("#CANCELED#",null)):"HISTORY"===k?(k=this.vwr.getSetHistory(2147483647),j="SPT"):
"MO"===k||"NBO"===k?(k=this.getMoJvxl(2147483647,"NBO"===k),j="XJVXL"):"PMESH"===k?(null==(k=this.getIsosurfaceJvxl(!0,29))&&this.error(31),j="XJVXL"):"ISOSURFACE"===k||"MESH"===k?(null==(k=this.getIsosurfaceJvxl("MESH"===k,24))&&this.error(31),j=0<=k.indexOf("<?xml")?"XJVXL":"JVXL",l||this.showString(this.getShapeProperty(24,"jvxlFileInfo"))):(d&&(l&&null==x)&&(l=!1,x="\u0001"),q=-1,0>p&&(p=-1));null==k&&(k="");0==q&&(null==n||K(n,String))}if(!d)return k;if(l)return b.showStringPrint(k,!0),"";if(null!=
n&&K(n,String))return this.writeMsg(n);if(A)return this.writeMsg(this.vwr.writeFileData(x,j,0,null));if(j.equals("SCENE"))n=v;else if(null==n&&(!s||null!=x))n=k;e&&JU.Logger.startTimer("write");s&&(b.refresh(!1),0>C&&(C=this.vwr.getScreenWidth()),0>w&&(w=this.vwr.getScreenHeight()));a=new java.util.Hashtable;null!=x&&a.put("fileName",x);a.put("backgroundColor",Integer.$valueOf(this.vwr.getBackgroundArgb()));a.put("type",j);K(n,String)&&-2147483648==p?a.put("text",n):K(n,Array)&&a.put("bytes",n);null!=
f&&a.put("scripts",f);null!=u&&a.put("bsFrames",u);a.put("fullPath",c);a.put("quality",Integer.$valueOf(p));a.put("width",Integer.$valueOf(C));a.put("height",Integer.$valueOf(w));a.put("nVibes",Integer.$valueOf(r));d=this.vwr.processWriteOrCapture(a);null==d&&(d="canceled");s&&d.startsWith("OK")&&(d+="; width="+C+"; height="+w);e&&this.showString(JU.Logger.getTimerMsg("write",0));return this.writeMsg(d)},"~A");l(c$,"prepareBinaryOutput",function(a){var b=a.getMap();if(null==b||!b.containsKey("$_BINARY_$"))return null;
a=new JU.Lst;for(var c,b=b.entrySet().iterator();b.hasNext()&&((c=b.next())||1);){var e=c.getKey();if(!e.equals("$_BINARY_$")){var f=c.getValue(),d=15==f.tok?f.value.data:null;null==d&&(f=f.asString(),d=f.startsWith(";base64,")?JU.Base64.decodeBase64(f):f.getBytes());if(e.equals("_DATA_")){a=new JU.Lst;a.addLast(d);break}else e.equals("_IMAGE_")?(a.add(0,e),a.add(1,null),a.add(2,d)):(a.addLast(e),a.addLast(null),a.addLast(d))}}return a},"JS.SV");l(c$,"writeMsg",function(a){if(this.chk||null==a)return"";
var b=!a.startsWith("OK");b&&(this.e.evalError(a,null),alert(a));this.e.report(a,b);return a},"~S");l(c$,"show",function(){var a=this.e,b=null,c=this.paramAsStr(1),e=null,f=0;2<this.slen&&268435632==this.tokAt(this.slen-2)?(e="/"+this.paramAsStr(this.slen-1),this.slen-=2,f=2):0==(e=this.paramAsStr(this.slen-1)).lastIndexOf("/")?(this.slen--,f=1):e=null;var d=null,g=null,h=2,j=this.getToken(1),g=K(j,JS.SV)&&1073741824!=j.tok?0:j.tok;4==g&&(j=JS.T.getTokenFromName(c.toLowerCase()),null!=j&&(g=j.tok));
1296041986!=g&&(1073742158!=g&&1715472409!=g&&1228935687!=g)&&this.checkLength(-3);2==this.slen&&0<=c.indexOf("?")&&(d=this.vwr.getAllSettings(c.substring(0,c.indexOf("?"))),g=-1);switch(g){case 0:this.chk||(d=a.theToken.escape());break;case 1073741925:a.checkLength23();h=this.st.length;this.chk||(d=this.vwr.ms.getInfo(this.vwr.am.cmi,"domains"),d=K(d,JS.SV)?this.vwr.getAnnotationInfo(d,a.optParameterAsString(2),1073741925):"domain information has not been loaded");break;case 1715472409:d=this.plot(this.st);
h=this.st.length;break;case 1073742189:a.checkLength23();h=this.st.length;this.chk||(d=this.vwr.ms.getInfo(this.vwr.am.cmi,"validation"),d=K(d,JS.SV)?this.vwr.getAnnotationInfo(d,a.optParameterAsString(2),1073742189):"validation information has not been loaded");break;case 134221829:this.chk||(d=JU.Escape.e(this.vwr.fm.cacheList()));break;case 1073741916:a.checkLength23();h=this.st.length;this.chk||(d=this.vwr.ms.getInfo(this.vwr.am.cmi,"dssr"),d=null==d?"no DSSR information has been read":2<h?JS.SV.getVariable(this.vwr.extractProperty(d,
this.stringParameter(2),-1)).asString():""+JS.SV.getVariable(d).asString());break;case 1073741915:g=2;3==this.slen?g=F(this.floatParameter((h=3)-1)):this.checkLength(2+f);this.chk||(d=this.vwr.calculateStructures(null,!0,!1,g));break;case 545259572:this.checkLength(2+f);this.chk||(d=this.vwr.fm.getPathForAllFiles());break;case 1275203608:if(!this.chk){var l=Array(2);this.vwr.shm.getShapePropertyData(21,"allInfo",l);d=JS.SV.getVariable(l[1]).asString()}break;case 1073742038:this.chk||this.vwr.getNMRPredict(a.optParameterAsString(2));
return;case 1073741929:case 1073741879:case 134218757:this.checkLength((1073741879==g||134218757==g&&1073742335==this.tokAt(2)?h=3:2)+f);if(this.chk)return;l=a.optParameterAsString(2);1073741879==g&&"formula".equals(l)&&(d=this.vwr.ms.getInfo(this.vwr.am.cmi,"formula"),null!=d&&(d=JU.PT.rep(d," ","")));if(null==d){try{134218757!=g?(d=this.vwr.ms.getModelDataBaseName(this.vwr.bsA()),d=null!=d&&(d.startsWith("$")||d.startsWith(":"))?d.substring(1):null):l.equalsIgnoreCase("true")?(d=this.vwr.getBioSmiles(null),
e=null):null!=e&&(d=this.vwr.getSmilesOpt(null,-1,-1,1,e+"///"),e=null),null==d&&(d=134218757==g?this.vwr.getSmiles(null):this.vwr.getOpenSmiles(null))}catch(p){if(N(p,Exception))d=p.getMessage();else throw p;}switch(g){case 1073741929:if(0<d.length){this.vwr.fm.loadImage(this.vwr.setLoadFormat("_"+d,"2",!1),"\u0001"+d,!1);return}d="Could not show drawing -- Either insufficient atoms are selected or the model is a PDB file.";break;case 1073741879:h=3,0<d.length?(d=this.vwr.getChemicalInfo(d,l),0<=
d.indexOf("FileNotFound")&&(d="?")):d="Could not show name -- Either insufficient atoms are selected or the model is a PDB file."}}break;case 1073742152:case 1296041986:d="";l=null;if(2==(h=this.slen)){if(this.chk)break;l=this.vwr.getSymTemp().getSpaceGroupInfo(this.vwr.ms,null,-1)}else if(1073742152==g){l=this.paramAsStr(2);h=3;if(this.chk)break;l=this.vwr.getSymTemp().getSpaceGroupInfo(this.vwr.ms,JU.PT.rep(l,"''",'"'),-1)}if(null!=l){d=(1073742152==g?""+l.get("spaceGroupInfo")+l.get("spaceGroupNote"):
"")+l.get("symmetryInfo");break}var g=2==this.tokAt(2)?this.intParameter(2):0,l=4==this.tokAt(2)?this.paramAsStr(2):null,k=j=null,D=-1;if(3<this.slen&&4!=this.tokAt(3)){h=A(-1,[null,this.vwr.getFrameAtoms()]);j=a.centerParameter(2+(0==g?0:1),h);if(null!=h[0]&&0==h[0].cardinality()){h=this.slen;break}h[0]=null;if(0==g&&(k=a.centerParameter(++a.iToken,h),null!=h[0]&&0==h[0].cardinality())){h=this.slen;break}2==this.tokAt(a.iToken+1)&&(D=a.getToken(++a.iToken).intValue)}var q=1<a.iToken&&4==this.tokAt(a.iToken+
1)?this.stringParameter(++a.iToken):null;this.checkLength((h=++a.iToken)+f);this.chk||(d=this.vwr.getSymTemp().getSymmetryInfoAtom(this.vwr.ms,this.vwr.getAllAtoms().nextSetBit(0),l,g,j,k,q,0,0,D),d=K(d,java.util.Map)?JS.SV.getVariable(d).asString():d.toString());break;case 1648363544:g=null;2<this.slen&&(h=this.slen,g=J.c.VDW.getVdwType(this.paramAsStr(2)),null==g&&this.invArg());this.chk||(d=this.vwr.getDefaultVdwNameOrData(0,g,null));break;case 134320141:a.checkLength23();h=this.slen;g=a.optParameterAsString(2);
if(null==e&&0<=(l=g.indexOf("/")))e=g.substring(l+1),g=g.substring(0,l);this.chk||(d=this.vwr.getFunctionCalls(g));break;case 36867:this.checkLength(2+f);this.chk||(d=this.vwr.getAllSettings(null));break;case 1073742184:2==this.slen?this.chk||this.vwr.showUrl(a.getFullPathName()):(g=this.paramAsStr(2),this.chk||this.vwr.showUrl(g));return;case 1765808134:c="defaultColorScheme";break;case 1610612740:c="scaleAngstromsPerInch";break;case 134221850:case 4138:if(this.chk)return;0>this.vwr.am.cmi&&a.errorStr(30,
"show "+a.theToken.value);d=this.plot(this.st);h=this.slen;break;case 14:case 1112152078:this.chk||(d=this.getContext(!1));break;case 1073741888:g=a.optParameterAsString(2);0<g.length&&(h=3);this.chk||(b=this.vwr.cm.getColorSchemeList(g));break;case 1073742192:this.chk||(d=this.vwr.getAtomDefs(this.vwr.definedAtomSets)+this.vwr.g.getVariableList()+this.getContext(!0));break;case 536870926:this.chk||(d=this.vwr.getTrajectoryState());break;case 553648148:b=""+JS.ScriptEval.commandHistoryLevelMax;break;
case 553648150:b=""+JU.Logger.getLogLevel();break;case 603979825:b=""+this.vwr.getBoolean(603979825);break;case 553648178:d="set strandCountForStrands "+this.vwr.getStrandCount(12)+"; set strandCountForMeshRibbon "+this.vwr.getStrandCount(13);break;case 536875070:d=this.vwr.showTimeout(2==(h=this.slen)?null:this.paramAsStr(2));break;case 536870918:b=JU.Escape.eP(this.vwr.getDefaultLattice());break;case 4126:this.chk||(d=this.vwr.getMinimizationInfo());break;case 1611272194:switch(this.vwr.g.axesMode){case 603979808:d=
"set axesUnitcell";break;case 603979804:d="set axesMolecular";break;default:d="set axesWindow"}break;case 1610612737:d="set bondMode "+(this.vwr.getBoolean(603979812)?"OR":"AND");break;case 1649022989:this.chk||(d="set strandCountForStrands "+this.vwr.getStrandCount(12)+"; set strandCountForMeshRibbon "+this.vwr.getStrandCount(13));break;case 1613238294:d="set hbondsBackbone "+this.vwr.getBoolean(603979852)+";set hbondsSolid "+this.vwr.getBoolean(603979854);break;case 1611141175:this.chk||(d=this.vwr.getSpinState());
break;case 1611141176:d="set ssbondsBackbone "+this.vwr.getBoolean(603979952);break;case 1610625028:case 1611141171:d="selectionHalos "+(this.vwr.getSelectionHalosEnabled()?"ON":"OFF");break;case 1612709894:d="set selectHetero "+this.vwr.getBoolean(1612709894);break;case 1073741828:d=JU.Escape.eAP(this.vwr.getAdditionalHydrogens(null,!0,!0,null));break;case 1612709900:d="set selectHydrogens "+this.vwr.getBoolean(1612709900);break;case 553648130:case 553648142:case 536870924:case 553648176:case 553648172:case 1073741995:this.chk||
(d=this.vwr.getLightingState());break;case 1073742136:case 4146:this.chk||(d=this.vwr.stm.listSavedStates());break;case 1814695966:this.chk||(d=this.vwr.getUnitCellInfoText());break;case 1073742329:if(2==(h=this.slen)){this.chk||(d=this.vwr.getCoordinateState(this.vwr.bsA()));break}g=this.paramAsStr(2);this.chk||(d=this.vwr.stm.getSavedCoordinates(g));break;case 1073742158:!this.chk&&null==a.outputBuffer&&this.vwr.sm.clearConsole();if(2==(h=this.slen)){this.chk||(d=this.vwr.getStateInfo());break}if(null!=
e&&3==this.slen){this.chk||(d=this.vwr.getStateInfo());break}else if(1228935687==this.tokAt(2)&&4==(h=this.slen)){this.chk||(d=this.vwr.fm.getEmbeddedFileState(this.paramAsStr(3),!0));break}h=3;g=this.paramAsStr(2);this.chk||(d=this.vwr.stm.getSavedState(g));break;case 1639976963:if(2==(h=this.slen)){this.chk||(d=this.vwr.ms.getProteinStructureState(this.vwr.bsA(),134222350));break}g=this.paramAsStr(2);this.chk||(d=this.vwr.stm.getSavedStructure(g));break;case 134221834:g=3==(h=this.slen)?this.paramAsStr(2):
null;this.chk||(d=this.vwr.getDataObj(g,null,-2),d=null==d?"no data":JU.Escape.encapsulateData(d[0],d[1],d[3].intValue()));break;case 1073742330:h=3;d=a.setObjectProperty();break;case 1678381065:this.chk||(d=this.vwr.ms.getBoundBoxCommand(!0));break;case 12289:this.chk||(d="center "+JU.Escape.eP(this.vwr.tm.fixedRotationCenter));break;case 135176:this.chk||(d=this.getShapeProperty(22,"command"));break;case 1228935687:if(2==this.slen){this.chk||(null==e&&this.vwr.sm.clearConsole(),d=this.vwr.getCurrentFileAsString("script"));
null==d&&(d="<unavailable>");break}h=3;b=this.paramAsStr(2);this.chk||(null==e&&this.vwr.sm.clearConsole(),d=this.vwr.getFileAsString3(b,!0,null));break;case 4115:d=1073742327==this.tokAt(2)&&0<(h=3)?this.vwr.getModelFileInfoAll():this.vwr.getModelFileInfo();break;case 1610616855:g=2==(h=this.slen)?2147483647:this.intParameter(2);1>g&&this.invArg();this.chk||(this.vwr.sm.clearConsole(),0==a.scriptLevel&&this.vwr.removeCommand(),d=this.vwr.getSetHistory(g));break;case 135180:this.chk||(d=this.getShapeProperty(24,
"jvxlDataXml"));break;case 1073877011:case 1073877010:a.optParameterAsString(2).equalsIgnoreCase("list")?(this.e.sm.loadShape(27),d=this.chk?"":this.getShapeProperty(27,"list -1"),h=3):(l=2==(h=this.slen)?-2147483648:this.intParameter(2),this.chk||(d=this.getMoJvxl(l,1073877011==g)));break;case 1094717454:this.chk||(d=this.vwr.ms.getModelInfoAsString());break;case 537006096:this.chk||(d=this.vwr.getMeasurementInfoAsString());break;case 1073741863:h=3;!this.chk&&this.slen==h&&(d=this.vwr.getOrientationText(this.tokAt(2),
null));break;case 1073742132:g=this.tokAt(2),0==g?g=1073742132:h=3;case 1073742178:case 4129:this.chk||(d=this.vwr.getOrientationText(g,null));break;case 1073742077:h=2;if(3<this.slen)break;switch(g=this.tokAt(2)){case 1073742178:case 1073742132:case 4129:case 0:this.chk||(d=this.vwr.getOrientationText(g,null));break;default:g=a.optParameterAsString(2),d=this.vwr.getOrientationText(1073742035,g)}h=this.slen;break;case 1073742088:this.chk||(d=this.vwr.ms.getPDBHeader(this.vwr.am.cmi));break;case 134217762:g=
a.optParameterAsString(2);0==g.length&&(g=null);h=this.slen;this.chk||(d=this.vwr.ms.getPointGroupAsString(this.vwr.bsA(),"show:"+g,0,0,null,null,null));break;case 1088421903:this.chk||(d=this.vwr.ms.getSymmetryInfoAsString());break;case 1073742176:this.chk||(d="transform:\n"+this.vwr.tm.matrixRotate.toString());break;case 4168:d="zoom "+(this.vwr.tm.zoomEnabled?""+this.vwr.tm.getZoomSetting():"off");break;case 1611272202:d=this.vwr.getShowFrank()?"frank ON":"frank OFF";break;case 1665140738:c="solventProbeRadius";
break;case 1086324744:if(3==(h=this.slen)&&1073742334==this.tokAt(2))g=1086324743;case 1073741864:case 1086326788:case 1073742120:case 1113589787:case 1086324742:case 1140850689:case 1073741982:this.chk||(d=this.vwr.getChimeInfo(g));break;case 537022465:case 1610612738:case 20482:case 1612709912:b="?";break;case 1073742031:g=2==(h=this.slen)?null:this.paramAsStr(2);this.chk||(d=this.vwr.getBindingInfo(g));break;case 1073742015:this.chk||(b=this.vwr.getMenu(""));break;case 1073741824:c.equalsIgnoreCase("fileHeader")&&
(this.chk||(d=this.vwr.ms.getPDBHeader(this.vwr.am.cmi)));break;case 1073741992:case 36868:c=this.paramAsStr(h++),l=a.getParameter(c,1073742190,!0),this.chk||(d=1073741992==g?l.toJSON():l.escape())}this.checkLength(h+f);this.chk||(null!=d?this.showString(this.filterShow(d,e)):null!=b?this.showString(c+" = "+b):null!=c&&(0<=c.indexOf(" ")?this.showString(c):this.showString(c+" = "+a.getParameter(c,1073742190,!0).escape())))});l(c$,"filterShow",function(a,b){if(null==b)return a;b=b.substring(1).toLowerCase();
for(var c=JU.PT.split(a,"\n"),e=new JU.SB,f=0;f<c.length;f++)0<=c[f].toLowerCase().indexOf(b)&&e.append(c[f]).appendC("\n");return e.toString()},"~S,~S");l(c$,"stereo",function(){for(var a=J.c.STER.DOUBLE,b=-5,c=!1,e=null,f=0,d=1;d<this.slen;++d)if(this.e.isColorParam(d))1<f&&this.e.bad(),0==f&&(e=G(2,0)),c||(b=3),e[f]=this.e.getArgbParam(d),0==f++&&(e[1]=~e[0]),d=this.e.iToken;else switch(this.getToken(d).tok){case 1073742335:this.e.checkLast(this.e.iToken=1);this.e.iToken=1;break;case 1073742334:this.e.checkLast(this.e.iToken=
1);a=J.c.STER.NONE;break;case 2:case 3:b=this.floatParameter(d);c=!0;break;case 1073741824:if(c||(b=3),a=J.c.STER.getStereoMode(this.paramAsStr(d)),null!=a)break;default:this.invArg()}this.chk||this.vwr.setStereoMode(e,a,b)});l(c$,"struts",function(){var a=this.e,b=1073742072==this.tokAt(1)||1073742335==this.tokAt(1)||1==this.slen,c=a.getMadParameter();if(2147483647==c)return!1;b&&(c=Math.round(2E3*this.vwr.getFloat(570425406)));this.setShapeProperty(1,"type",Integer.$valueOf(32768));a.setShapeSizeBs(1,
c,null);this.setShapeProperty(1,"type",Integer.$valueOf(1023));return!0});l(c$,"unitcell",function(a){var b=this.e,c=2147483647,e=2147483647,f=null,d=b.tickParamAsStr(a,!0,!1,!1);a=b.iToken;var g=null,h=null,j=null,l=null,p=e=!1;switch(this.tokAt(++a)){case 4142:case 4141:p=!0;f=JU.P4.new4(0,0,0,-1);b.iToken++;break;case 4:case 1073741824:var k=this.paramAsStr(a).toLowerCase(),l=k;if(0>k.indexOf(",")&&!this.chk){b.setCurrentCagePts(null,null);JU.PT.isOneOf(l,";parent;standard;primitive;")&&(j=this.vwr.ms.getInfo(this.vwr.am.cmi,
"unitcell_conventional"),null!=j&&b.setCurrentCagePts(this.vwr.getV0abc(j),""+j));k=this.vwr.ms.getInfo(this.vwr.am.cmi,"unitcell_"+l);if(null==k&&((e=l.equals("primitive"))||l.equals("reciprocal"))){var k=this.vwr.getCurrentUnitCell(),l=(null==k?"":k.getSpaceGroupName()+" ")+l,h=null==k?A(-1,[JU.P3.new3(0,0,0),JU.P3.new3(1,0,0),JU.P3.new3(0,1,0),JU.P3.new3(0,0,1)]):k.getUnitCellVectors(),D=this.vwr.getSymTemp().getSymmetryInfoAtom(this.vwr.ms,this.vwr.getFrameAtoms().nextSetBit(0),null,0,null,null,
null,1073741994,0,-1);null==k&&(k=this.vwr.getSymTemp());k.toFromPrimitive(!0,0==D.length?"P":D.charAt(0),h);e||(e=this.slen==a+1?1:2==this.tokAt(a+1)?3.141592653589793*this.intParameter(++a):this.floatParameter(++a),JU.SimpleUnitCell.getReciprocal(h,h,e));break}this.showString(k)}j=k;break;case 135180:case 1073742330:g=b.objectNameParameter(++a);break;case 1678381065:h=JU.P3.newP(this.vwr.getBoundBoxCenter());f=this.vwr.getBoundBoxCornerVector();h.sub(f);h=A(-1,[h,JU.P3.new3(2*f.x,0,0),JU.P3.new3(0,
2*f.y,0),JU.P3.new3(0,0,2*f.z)]);f=null;b.iToken=a;break;case 1073742176:12!=this.tokAt(++a)&&this.invArg();j=A(-1,[this.getToken(a).value]);break;case 11:case 12:j=this.getToken(a).value;break;case 12289:switch(this.tokAt(++a)){case 10:case 1073742325:f=this.vwr.ms.getAtomSetCenter(this.atomExpressionAt(a));this.vwr.toFractional(f,!0);a=b.iToken;break;default:if(b.isCenterParameter(a)){f=this.centerParameter(a);a=b.iToken;break}this.invArg()}f.x-=0.5;f.y-=0.5;f.z-=0.5;break;case 10:case 1073742325:a=
this.atomExpressionAt(a).nextSetBit(0);this.chk||(this.vwr.am.cai=a);if(0>a)return;a=b.iToken;break;case 1073742066:e=!0;case 1073742114:f=b.getPointOrPlane(++a,!1,!0,!1,!0,3,3);f=JU.P4.new4(f.x,f.y,f.z,e?1:0);a=b.iToken;break;case 3:case 2:if(111>this.floatParameter(a)){a--;break}c=this.intParameter(a);break;default:b.isArrayParameter(a)?(h=b.getPointArray(a,4,!1),a=b.iToken):this.slen>a+1?(f=b.getPointOrPlane(a,!1,!0,!1,!0,3,3),a=b.iToken):a--}e=b.getSetAxesTypeMad10(++a);b.checkLast(b.iToken);
this.chk||2147483647==e||(2147483647==e&&(this.vwr.am.cai=-1),null==h&&null!=j&&(h=this.vwr.getV0abc(j)),2147483647!=c?this.vwr.ms.setUnitCellOffset(this.vwr.getCurrentUnitCell(),null,c):null!=g?this.vwr.setCurrentCage(g):(p||null!=h)&&b.setCurrentCagePts(h,l),b.setObjectMad10(33,"unitCell",e),null!=f&&this.vwr.ms.setUnitCellOffset(this.vwr.getCurrentUnitCell(),f,0),null!=d&&this.setShapeProperty(33,"tickInfo",d))},"~N");l(c$,"assign",function(){var a=this.tokAt(1),b=this.atomExpressionAt(2).nextSetBit(0),
c=-1,e=null;if(!(0>b)){4106==a?c=this.atomExpressionAt(++this.e.iToken).nextSetBit(0):e=this.paramAsStr(++this.e.iToken);var f=++this.e.iToken<this.slen?this.centerParameter(this.e.iToken):null;if(!this.chk)switch(a){case 1140850689:this.e.clearDefinedVariableAtomSets();this.assignAtom(b,f,e);break;case 1677721602:this.assignBond(b,(e+"p").charAt(0));break;case 4106:this.assignConnect(b,c)}}});l(c$,"assignAtom",function(a,b,c){c.equals("X")&&this.vwr.setRotateBondIndex(-1);if(this.vwr.ms.at[a].mi==
this.vwr.ms.mc-1){this.vwr.clearModelDependentObjects();var e=this.vwr.ms.ac;if(null==b)this.vwr.sm.modifySend(a,this.vwr.ms.at[a].mi,1,this.e.fullCommand),this.vwr.ms.assignAtom(a,c,!0),JU.PT.isOneOf(c,";Mi;Pl;X;")||this.vwr.ms.setAtomNamesAndNumbers(a,-e,null),this.vwr.sm.modifySend(a,this.vwr.ms.at[a].mi,-1,"OK"),this.vwr.refresh(3,"assignAtom");else{var f=this.vwr.ms.at[a],d=JU.BSUtil.newAndSetBit(a);b=A(-1,[b]);var g=new JU.Lst;g.addLast(f);f=f.mi;this.vwr.sm.modifySend(a,f,3,this.e.fullCommand);
try{d=this.vwr.addHydrogensInline(d,g,b),a=d.nextSetBit(0),this.vwr.ms.assignAtom(a,c,!1)}catch(h){if(!N(h,Exception))throw h;}this.vwr.ms.setAtomNamesAndNumbers(a,-e,null);this.vwr.sm.modifySend(a,f,-3,"OK")}}},"~N,JU.P3,~S");l(c$,"assignBond",function(a,b){var c=-1;try{c=this.vwr.ms.bo[a].atom1.mi;this.vwr.sm.modifySend(a,c,2,this.e.fullCommand);var e=this.vwr.ms.assignBond(a,b);null==e||"0"==b?this.vwr.refresh(3,"setBondOrder"):this.vwr.addHydrogens(e,!1,!0);this.vwr.sm.modifySend(a,c,-2,""+b)}catch(f){if(N(f,
Exception))JU.Logger.error("assignBond failed"),this.vwr.sm.modifySend(a,c,-2,"ERROR "+f);else throw f;}},"~N,~S");l(c$,"assignConnect",function(a,b){this.vwr.clearModelDependentObjects();var c=JU.AU.newFloat2(1);c[0]=L(-1,[a,b]);var e=this.vwr.ms.at[a].mi;this.vwr.sm.modifySend(a,e,2,this.e.fullCommand);this.vwr.ms.connect(c);this.vwr.ms.assignAtom(a,".",!0);this.vwr.ms.assignAtom(b,".",!0);this.vwr.sm.modifySend(a,e,-2,"OK");this.vwr.refresh(3,"assignConnect")},"~N,~N");l(c$,"getContext",function(a){for(var b=
new JU.SB,c=this.e.thisContext;null!=c;)a?null!=c.vars&&(b.append(this.getScriptID(c)),b.append(JV.StateManager.getVariableList(c.vars,80,!0,!1))):b.append(JS.ScriptError.getErrorLineMessage(c.functionName,c.scriptFileName,this.e.getLinenumber(c),c.pc,JS.ScriptEval.statementAsString(this.vwr,c.statement,-9999,this.e.debugHigh))),c=c.parentContext;a?null!=this.e.contextVariables&&(b.append(this.getScriptID(null)),b.append(JV.StateManager.getVariableList(this.e.contextVariables,80,!0,!1))):b.append(this.e.getErrorLineMessage2());
return b.toString()},"~B");l(c$,"getIsosurfaceJvxl",function(a,b){return this.chk?"":this.getShapeProperty(b,a?"jvxlMeshX":"jvxlDataXml")},"~B,~N");l(c$,"getMoJvxl",function(a,b){var c=b?28:27;this.e.sm.loadShape(c);var e=this.vwr.am.cmi;0>e&&this.e.errorStr(30,"show/write MO/NBO");var f=this.vwr.ms.getInfo(e,"moData");null==f&&this.error(27);var d=this.getShapeProperty(c,"moNumber");(null==d||0==d.intValue())&&this.setShapeProperty(c,"init",Integer.$valueOf(e));this.setShapeProperty(c,"moData",f);
return this.getShapePropertyIndex(c,"showMO",a)},"~N,~B");l(c$,"getScriptID",function(a){return"\n# "+(null==a?this.e.functionName:"function "+a.functionName)+" (file "+(null==a?this.e.scriptFileName:a.scriptFileName)+(null==a?"":" context "+a.id)+")\n"},"JS.ScriptContext");l(c$,"getShapePropertyIndex",function(a,b,c){return this.e.sm.getShapePropertyIndex(a,b,c)},"~N,~S,~N");l(c$,"tokenAt",function(a,b){return a<b.length?b[a]:null},"~N,~A");c$.tokAtArray=l(c$,"tokAtArray",function(a,b){return a<
b.length&&null!=b[a]?b[a].tok:0},"~N,~A");l(c$,"getPlotMinMax",function(a,b,c){if(null==a)return 0;switch(c){case 1111490568:case 1111490569:case 1111490570:return b?180:-180;case 1111490565:case 1111490576:return b?360:0;case 1111490574:return b?1:-1}c=b?-1E10:1E10;for(var e=a.length;0<=--e;){var f=a[e];Float.isNaN(f)||b==f>c&&(c=f)}return c},"~A,~B,~N");l(c$,"parseDataArray",function(a,b){a=JU.Parser.fixDataString(a);var c=JU.Parser.markLines(a,"\n"),e=c.length;if(!b){for(var f=JU.AU.newFloat2(e),
d=0,g=0;d<e;g=c[d++])g=JU.PT.getTokens(a.substring(g,c[d])),JU.PT.parseFloatArrayData(g,f[d]=L(g.length,0));return f}g=JU.PT.getTokens(a.substring(0,c[0]));if(3!=g.length)return L(0,0,0,0);var h=JU.PT.parseInt(g[0]),j=JU.PT.parseInt(g[1]),l=JU.PT.parseInt(g[2]);if(1>h||1>j||1>l)return L(1,1,1,0);for(var f=JU.AU.newFloat3(h,j),p=0,k=0,d=1,g=c[0];d<e&&p<h;g=c[d++])g=JU.PT.getTokens(a.substring(g,c[d])),g.length<l||(JU.PT.parseFloatArrayData(g,f[p][k]=L(g.length,0)),++k==j&&(p++,k=0));return p!=h?(System.out.println("Error reading 3D data -- nX = "+
h+", but only "+p+" blocks read"),L(1,1,1,0)):f},"~S,~B");l(c$,"getBitsetPropertyFloat",function(a,b,c,e,f){b=null==c?this.e.getBitsetProperty(a,b,null,null,null,null,!1,2147483647,!1):this.vwr.getDataObj(c,a,1);if(null==b||!JU.AU.isAF(b))return L(a.cardinality(),0);if(!Float.isNaN(e))for(a=0;a<b.length;a++)b[a]<e&&(b[a]=NaN);if(!Float.isNaN(f))for(a=0;a<b.length;a++)b[a]>f&&(b[a]=NaN);return b},"JU.BS,~N,~S,~N,~N");U(c$,"ERROR_invalidArgument",22)})})(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.defineStatics,Clazz.newFloatArray,Clazz.declareType,Clazz.prepareFields,Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,Clazz.p0p,Clazz.pu$h,Clazz.newShortArray,Clazz.innerTypeInstance,Clazz.isClassDefined,Clazz.prepareCallback,
Clazz.newArray,Clazz.castNullAs,Clazz.floatToShort,Clazz.superCall,Clazz.decorateAsType,Clazz.newBooleanArray,Clazz.newCharArray,Clazz.implementOf,Clazz.newDoubleArray,Clazz.overrideConstructor,Clazz.clone,Clazz.doubleToShort,Clazz.getInheritedLevel,Clazz.getParamsType,Clazz.isAF,Clazz.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);
