(function(ba,ca,da,ea,fa,ga,R,M,S,U,V,P,W,X,ha,Q,G,Y,O,Z,ia,$,ja,ka,la,ma,na,oa,pa,qa,z,ra,sa,ta,ua,va,wa,xa,ya,za,Aa,Ba,Ca,Da,Ea,Fa,Ga,Ha,Ia,Ja,Ka,La,Ma,Na,Oa,Pa,Qa,Ra,k,aa){R("JS");S(null,"JS.ScriptExt",["JU.AU"],function(){c$=V(function(){this.e=this.vwr=null;this.chk=!1;this.st=null;this.slen=0;U(this,arguments)},JS,"ScriptExt");k(c$,"init",function(a){this.e=a;this.vwr=this.e.vwr;return this},"~O");k(c$,"atomExpressionAt",function(a){return this.e.atomExpressionAt(a)},"~N");k(c$,"checkLength",
function(a){this.e.checkLength(a)},"~N");k(c$,"error",function(a){this.e.error(a)},"~N");k(c$,"invArg",function(){this.e.invArg()});k(c$,"invPO",function(){this.error(23)});k(c$,"getShapeProperty",function(a,b){return this.e.getShapeProperty(a,b)},"~N,~S");k(c$,"paramAsStr",function(a){return this.e.paramAsStr(a)},"~N");k(c$,"centerParameter",function(a){return this.e.centerParameter(a,null)},"~N");k(c$,"floatParameter",function(a){return this.e.floatParameter(a)},"~N");k(c$,"getPoint3f",function(a,
b){return this.e.getPoint3f(a,b,!0)},"~N,~B");k(c$,"intParameter",function(a){return this.e.intParameter(a)},"~N");k(c$,"isFloatParameter",function(a){switch(this.e.tokAt(a)){case 2:case 3:return!0}return!1},"~N");k(c$,"setShapeProperty",function(a,b,c){this.e.setShapeProperty(a,b,c)},"~N,~S,~O");k(c$,"showString",function(a){this.e.showString(a)},"~S");k(c$,"stringParameter",function(a){return this.e.stringParameter(a)},"~N");k(c$,"getToken",function(a){return this.e.getToken(a)},"~N");k(c$,"tokAt",
function(a){return this.e.tokAt(a)},"~N");k(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");k(c$,"getColorTrans",function(a,b,c,d){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(570425353);break;case 1073742074:b++,c=0}a.isColorParam(b+1)?d[0]=a.getArgbParam(++b):1073742333==this.tokAt(b+
1)?(d[0]=0,a.iToken=b+1):3.4028235E38==c?this.invArg():d[0]=-2147483648;return c},"JS.ScriptEval,~N,~B,~A");k(c$,"finalizeObject",function(a,b,c,d,e,f,h,g){e&&this.setShapeProperty(a,"set",f);-2147483648!=b&&this.e.setShapePropertyBs(a,"color",Integer.$valueOf(b),g);3.4028235E38!=c&&this.e.setShapeTranslucency(a,"","translucent",c,g);0!=d&&this.setShapeProperty(a,"scale",Integer.$valueOf(d));0<h&&(this.e.setMeshDisplayProperty(a,h,0)||this.invArg())},"~N,~N,~N,~N,~B,~O,~N,JU.BS");k(c$,"getIntArray2",
function(a){a=this.e.getToken(a).getList();for(var b=JU.AU.newInt2(a.size()),c=b.length;0<=--c;){var d=a.get(c).getList();null==d&&this.invArg();b[c]=G(d.size(),0);for(var e=b[c].length;0<=--e;)b[c][e]=d.get(e).intValue}return b},"~N");k(c$,"getAllPoints",function(a,b){var c=null,d=null;try{switch(this.e.tokAt(a)){case 7:c=this.e.getPointArray(a,-1,!1);break;case 12290:case 10:case 1073742325:d=this.atomExpressionAt(a)}if(null==c){null==d&&(d=this.vwr.getAllAtoms());for(var c=Array(d.cardinality()),
e=d.nextSetBit(0),f=0;0<=e;e=d.nextSetBit(e+1))c[f++]=this.vwr.ms.at[e]}}catch(h){if(!Q(h,Exception))throw h;}(null==c||c.length<b)&&this.invArg();return c},"~N,~N")});R("JS");S(["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 $.Measurement JS.SV $.ScriptCompiler $.ScriptError $.ScriptEval $.ScriptInterruption $.ScriptMathProcessor $.ScriptParam $.T JU.BSUtil $.BoxInfo $.C $.Edge $.Elements $.Escape $.Logger $.Parser $.Point3fi $.SimpleUnitCell JV.FileManager $.StateManager $.Viewer".split(" "),
function(){c$=Z(JS,"CmdExt",JS.ScriptExt);X(c$,function(){$(this,JS.CmdExt,[])});aa(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 4122:this.invertSelected();break;case 4124:this.macro();break;case 4125:this.mapProperty();break;case 4126:this.minimize();break;case 603983903:this.modelkit();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");k(c$,"modelkit",function(){var a=0,b=this.tokAt(1);switch(b){case 1073742334:case 0:case 1073742335:this.chk||this.vwr.setBooleanProperty("modelkitmode",1073742334!=b);if(0==this.tokAt(a+1))return;a=++this.e.iToken;break;case 528432:this.e.cmdRotate(!1,
!1);return;case 4145:this.e.cmdRotate(!1,!0);return;case 4098:++this.e.iToken;case 4106:this.assign();return}for(var c=this.vwr.getModelkit(!1);0!=(b=this.tokAt(++a));){var d=this.paramAsStr(a).toLowerCase(),e=null;switch(b){case 1073742335:case 1073742334:this.chk||this.vwr.setBooleanProperty("modelkitmode",1073742335==b);continue;case 1610625028:case 12294:d="hidden";e=Boolean.$valueOf(1610625028!=b);break;case 36867:d=this.paramAsStr(++a);e=0==this.tokAt(++a)?"true":this.paramAsStr(a);break;case 1073742024:e=
this.paramAsStr(++a).toLowerCase();JU.PT.isOneOf(e,";view;edit;molecular;")||this.invArg();break;case 1814695966:e=this.paramAsStr(++a).toLowerCase();JU.PT.isOneOf(e,";packed;extend;")||this.invArg();break;case 1296041986:switch(this.tokAt(++a)){case 4:case 1073742333:e=this.paramAsStr(a);break;case 12:e=this.getToken(a).value;break;case 2:e=Integer.$valueOf(this.getToken(a).intValue);break;default:this.e.isCenterParameter(a)?(d="center",e=this.e.centerParameter(a,null),a=this.e.iToken):this.invArg()}break;
case 1088421903:e=this.paramAsStr(++a).toLowerCase();JU.PT.isOneOf(e,";none;applylocal;retainlocal;applyfull;")||this.invArg();break;case 1073742066:if(e=this.paramAsStr(a+1),e.equals("none")){++a;break}case 12289:case 134217751:e=this.e.atomCenterOrCoordinateParameter(++a,null);a=this.e.iToken;break;default:if(JU.PT.isOneOf(d,";autobond;hidden;showsymopinfo;clicktosetelement;addhydrogen;addhydrogens;")){e=Boolean.$valueOf(0==(b=this.tokAt(++a))||1073742335==b);break}if(JU.PT.isOneOf(d,";view;edit;molecular;")){e=
d;d="mode";break}if(JU.PT.isOneOf(d,";packed;extend;")){e=d;d="unitcell";break}this.invArg()}!this.chk&&(null!=e&&null!=(e=c.setProperty(d,e))&&"hidden"!==d&&!c.isHidden())&&this.vwr.showString("modelkit "+d+" = "+e.toString(),!1)}});k(c$,"macro",function(){if(!this.chk){var a=this.e.optParameterAsString(1);if(0==a.length)this.showString(this.vwr.getMacro(null));else{var b=this.vwr.getMacro(a);null==b?this.showString("macro "+a+" could not be found. Current macros include:\n"+this.vwr.getMacro(null)):
(this.showString("running "+b),this.e.cmdScript(4124,b,null))}}});k(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.setAllowJSThreads(!1),c.dispatchCommands(!1,!1,!1)}catch(d){if(Q(d,Exception))return this.e.vwr.setStringProperty("_errormessage",""+d),null==c.thisContext&&(JU.Logger.error("Error evaluating context "+
d),d.printStackTrace()),!1;throw d;}return!0},"JS.ScriptContext,JV.ShapeManager");k(c$,"getBitsetIdent",function(a,b,c,d,e,f){return this.getBitsetIdentFull(a,b,c,d,e,f,null)},"JU.BS,~S,~O,~B,~N,~B");k(c$,"getBitsetIdentFull",function(a,b,c,d,e,f,h){var g=!M(c,JM.BondSet);g&&(null==b?b=this.vwr.getStandardLabelFormat(0):0==b.length&&(b="%[label]"));var j=null==b?-1:b.indexOf("%"),D=2147483647!=e;if(null==a||this.chk||g&&0>j)return null==b&&(b=""),f?z(-1,[b]):b;var j=this.vwr.ms,m=0,n=j.getLabeler();
c=g||!d?null:c.associatedAtoms;d=null==b||0==b.length;var t=g||d?null:JM.LabelToken.getBondLabelValues();b=d?null:g?n.compile(this.vwr,b,"\x00",null):n.compile(this.vwr,b,"\u0001",t);var l=D?1:a.cardinality(),k=null!=h;k||(h=Array(l));var x=new JU.P3;for(e=D?e:a.nextSetBit(0);0<=e;e=a.nextSetBit(e+1)){var w;g?w=d?j.at[e].getInfo():n.formatLabelAtomArray(this.vwr,j.at[e],b,"\x00",c,x):(w=j.bo[e],w=d?w.getIdentity():n.formatLabelBond(this.vwr,w,b,t,c,x));w=JU.PT.formatStringI(w,"#",m+1);h[k?e:m]=w;
m++;if(D)break}return 1==l&&!f?h[0]:h},"JU.BS,~S,~O,~B,~N,~B,~A");k(c$,"getLoadSymmetryParams",function(a,b,c){var d=this.e;this.chk=d.chk;this.slen=d.slen;var e=null,f=this.tokAt(a);if(1073742332==f||8==f)e=d.getPointOrPlane(a,!1,!0,!1,!0,3,3,!0),f=this.tokAt(a=d.iToken+1);switch(f){case 1073741938:case 1073742080:case 1094713350:case 1073742163:case 1073742114:case 134217764:case 1814695966:null==e&&(e=JU.P3.new3(555,555,-1)),d.iToken=a-1}f=null;if(null!=e){c.put("lattice",e);a=d.iToken+1;b.append(" "+
JU.SimpleUnitCell.escapeMultiplier(e));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 h;b.append(" SUPERCELL ");if(d.isPoint3f(++a)){h=this.getPoint3f(a,!1);if(h.x!=P(h.x)||h.y!=P(h.y)||h.z!=P(h.z)||1>h.x||1>h.y||1>h.z)d.iToken=a,this.invArg();a=d.iToken}else h=this.stringParameter(a);b.append(JU.Escape.e(h));c.put("supercell",h);a=this.checkPacked(++a,c,b)}h=0;1073742114==this.tokAt(a)&&
(a++,h=this.floatParameter(a++),b.append(" range "+h));c.put("symmetryRange",Float.$valueOf(h));h=null;var g;h=-2147483648;134217764==this.tokAt(a)&&(++a,h=JU.PT.rep(this.paramAsStr(a++),"''",'"'),b.append(" spacegroup "+JU.PT.esc(h)),h.equalsIgnoreCase("ignoreOperators")?h=-999:(0==h.length?(g=this.vwr.getCurrentUnitCell(),null!=g&&(h=g.getSpaceGroupName())):0<=h.indexOf(",")&&9>e.x&&(9>e.y&&0==e.z)&&(h+="#doNormalize=0"),c.put("spaceGroupName",h),h=-2));e=null;if(1814695966==this.tokAt(a)){++a;
g=d.optParameterAsString(a);0==g.length?(g=this.vwr.getCurrentUnitCell(),null!=g&&(e=g.getUnitCellAsArray(!0),f=g.getCartesianOffset())):4==this.tokAt(a)?(e=O(6,0),JU.SimpleUnitCell.setOabc(g,e,null)):e=d.floatParameterSet(a,6,9);(null==e||6!=e.length&&9!=e.length)&&this.invArg();b.append(" unitcell [");for(a=0;a<e.length;a++)b.append((0==a?"":" ")+e[a]);b.append("]");c.put("unitcell",e);-2147483648==h&&(h=-1);a=d.iToken+1}-2147483648!=h&&c.put("spaceGroupIndex",Integer.$valueOf(h))}null!=f?d.coordinatesAreFractional=
!1:1073742066==this.tokAt(a)&&(f=this.getPoint3f(++a,!0));null!=f&&(d.coordinatesAreFractional?(f.setT(d.fractionalPoint),c.put("unitCellOffsetFractional",d.coordinatesAreFractional?Boolean.TRUE:Boolean.FALSE),b.append(" offset {"+f.x+" "+f.y+" "+f.z+"/1}")):b.append(" offset "+JU.Escape.eP(f)),c.put("unitCellOffset",f),a=d.iToken+1);return a},"~N,JU.SB,java.util.Map");k(c$,"checkPacked",function(a,b,c){switch(this.tokAt(a)){case 1073741938:b.put("packed",Boolean.TRUE);var d=null,e=this.tokAt(++a);
switch(e){case 1814695966:case 1678381065:break;default:this.e.isArrayParameter(a)?(d=this.e.getPointArray(a,-1,!1),a=this.e.iToken):this.isFloatParameter(a)?(d=this.floatParameter(a),d=z(-1,[new JU.P3,JU.P3.new3(d,d,d)])):(d=[],--a)}a++;if(this.e.chk)break;switch(e){case 1814695966:d=this.e.optParameterAsString(a++).toLowerCase();if(JU.PT.isOneOf(d,";conventional;primitive;"))return b.put("fillRange",d),c.append(' FILL UNITCELL "'+d+'"'),a;d=this.vwr.getCurrentUnitCell();if(null!=d){d=JU.BoxInfo.toOABC(d.getUnitCellVerticesNoOffset(),
d.getCartesianOffset());break}case 1678381065:d=JU.BoxInfo.toOABC(this.vwr.ms.getBBoxVertices(),null)}switch(d.length){case 2:e=d[1];d=z(-1,[d[0],JU.P3.newP(d[0]),new JU.P3,new JU.P3]);d[1].x=e.x;d[2].y=e.y;d[3].z=e.z;break;case 3:d=z(-1,[new JU.P3,d[0],d[1],d[2]]);break;case 4:break;default:d=z(-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",d);c.append(" FILL ["+d[0]+d[1]+d[2]+d[3]+"]");break;case 1073742080:d=NaN,this.isFloatParameter(++a)&&(d=this.floatParameter(a++)),
this.e.chk||(b.put("packed",Boolean.TRUE),c.append(" PACKED"),Float.isNaN(d)||(b.put("packingError",Float.$valueOf(d)),c.append(" "+d)))}return a},"~N,java.util.Map,JU.SB");k(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()}});k(c$,"calculate",function(){var a=!1,b=!1,c=null,d=null,e=this.e,f=-2147483648,f=2;if(2<=(e.iToken=e.slen))switch(e.clearDefinedVariableAtomSets(),this.getToken(1).tok){case 2:if(3!=this.intParameter(1)||!this.paramAsStr(2).equalsIgnoreCase("D"))break;0>this.vwr.am.cmi&&e.errorStr(30,"calculate 3D");c="load append $ filter '2D';select visible;center selected";e.optParameterAsString(3).equalsIgnoreCase("ZAP")&&(c+=";zap modelIndex="+Math.max(this.vwr.am.cmi,0));this.chk||
e.runScript(c);return;case 1073741824:this.checkLength(2);break;case 1086324752:e.iToken=1;c=2==this.slen?null:this.atomExpressionAt(2);e.checkLast(e.iToken);this.chk||e.showString(this.vwr.calculateChirality(c));return;case 1631586315:this.checkLength(2);if(this.chk)return;f=this.vwr.calculateFormalCharges(null);this.showString(J.i18n.GT.i(J.i18n.GT.$("{0} charges modified"),f));return;case 1075838996:this.checkLength(2);this.chk||this.vwr.ms.assignAromaticBondsBs(!0,null);return;case 1613238294:2!=
e.slen&&(c=(b=1639976963==this.tokAt(++e.iToken))?this.vwr.bsA():this.atomExpressionAt(e.iToken),!b&&1639976963!=this.tokAt(++e.iToken)&&(d=this.atomExpressionAt(e.iToken)));if(this.chk)return;f=this.vwr.autoHbond(c,d,!1);-2147483648!=f&&e.report(J.i18n.GT.i(J.i18n.GT.$("{0} hydrogen bonds"),Math.abs(f)),!1);return;case 1612709900:a=this.tokAt(2);(b=1073742335==a)?e.iToken++:528443==a&&e.iToken++;c=this.slen==e.iToken+1?null:this.atomExpressionAt(e.iToken+1);null==c&&528443==a&&(c=this.vwr.getAtomBitSet("_C & connected(3) & !connected(double)"));
e.checkLast(e.iToken);this.chk||(this.vwr.addHydrogens(c,0),b&&(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:e.iToken=1;c=2==this.slen?null:this.atomExpressionAt(2);e.checkLast(e.iToken);this.chk||e.getPartialCharges(c);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=z(-1,[a,null,c]),this.showString(e.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(++e.iToken)){case 4138:break;case 1111490587:if(this.chk)return;
e.showString(this.vwr.getAnnotationParser(!0).calculateDSSRStructure(this.vwr,c));return;case 1073741915:b=!0;f=this.slen==e.iToken+1?2:P(this.floatParameter(++e.iToken));break;case 0:b=this.vwr.getBoolean(603979826);break;default:this.invArg()}this.chk||this.showString(this.vwr.calculateStructures(c,b,!0,f));return;case 659482:c=e.iToken+1<this.slen?this.atomExpressionAt(++e.iToken):null;d=e.iToken+1<this.slen?this.atomExpressionAt(++e.iToken):null;this.checkLength(++e.iToken);this.chk||(f=this.vwr.calculateStruts(c,
d),0<f&&(this.setShapeProperty(1,"type",Integer.$valueOf(32768)),e.setShapePropertyBs(1,"color",Integer.$valueOf(16777215),null),e.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"),f)));return;case 2097180:a=!0;case 1111490575:b=!1;switch(this.tokAt(2)){case 134217759:e.iToken++;break;case 0:b=!a;break;case 1073741952:b=!0;e.iToken++;break;default:b=!0}c=e.iToken+1<this.slen?this.atomExpressionAt(++e.iToken):
this.vwr.bsA();this.checkLength(++e.iToken);this.chk||this.vwr.calculateSurface(c,b?3.4028235E38:-1);return}e.errorStr2(53,"CALCULATE","3D? aromatic? hbonds? hydrogen? formalCharge? partialCharge? pointgroup? straightness? structure? struts? surfaceDistance FROM? surfaceDistance WITHIN?")});k(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,d=0,e=this.e.slen,f="",h=
1073742070!=this.vwr.am.animationReplayMode,g=1,j=this.tokAt(g),D=603979967==j;D&&(j=this.tokAt(++g));var m=null;switch(0==j?j=102409:j){case 4:f=this.e.optParameterAsString(g++);if(0==f.length){d=102409;break}b=f.toLowerCase();b.endsWith(".gift")||b.endsWith(".pngt")?(D=!0,f=f.substring(0,f.length-1),b=f.toLowerCase()):!b.endsWith(".gif")&&!b.contains(".png")&&(f+=".gif");b.endsWith(".png")?(b.endsWith("0.png")||(f=f.substring(0,f.length-4)+"0000.png"),b="PNG"):b="GIF";D&&(b+="T");j=f.indexOf("0000.");
j=0>j||j!=f.lastIndexOf(".")-4;d=!1;528411==this.tokAt(g)&&(h=!0,this.tokAt(++g));switch(this.tokAt(g)){case 134222850:m=this.stringParameter(++g);break;case 1073742129:d=!0;case 1611141175:a="y";h=!0;g++;d?(g<e&&2!=this.tokAt(g)&&(a=this.e.optParameterAsString(g++).toLowerCase()),m="rotate Y 10 10;rotate Y -10 -10;rotate Y -10 -10;rotate Y 10 10",e=g<e?this.intParameter(g++):5,m=0>e?JU.PT.rep(m,"10;",""+-e+";"):JU.PT.rep(m,"10",""+e)):(g<e&&(a=this.e.optParameterAsString(g++).toLowerCase()),m="rotate Y 360 30;");
if(this.chk)return;this.vwr.setNavigationMode(!1);if(""===a||0>"xyz".indexOf(a))a="y";m=JU.PT.rep(m,"Y",a);break;case 3:case 2:c=this.floatParameter(g++)}if(this.chk)return;if(null!=m){m="set waitformoveto true;"+m+";set waitformoveto "+this.vwr.g.waitForMoveTo;m="capture "+(D?"transparent ":"")+JU.PT.esc(f)+(h?" LOOP;":";")+m+";capture end;";this.e.cmdScript(0,null,m);return}d=1073742031;a=new java.util.Hashtable;D=this.vwr.getInt(553648132);j&&(a.put("streaming",Boolean.TRUE),h||this.showString(J.i18n.GT.o(J.i18n.GT.$("Note: Enable looping using the LOOP keyword just after the file name or {0}"),
z(-1,["ANIMATION MODE LOOP"]))),this.showString(J.i18n.GT.o(J.i18n.GT.$("Animation delay based on: {0}"),z(-1,["ANIMATION FPS "+D]))));a.put("captureFps",Integer.$valueOf(D));break;case 102409:case 1073741874:null!=a&&a.put("captureSilent",Boolean.TRUE);case 1073742335:case 1073742334:this.checkLength(-2);d=j;break;default:this.invArg()}this.chk||null==a||(a.put("type",b),b=Integer.$valueOf(this.vwr.getBackgroundArgb()),a.put("backgroundColor",b),a.put("fileName",f),a.put("quality",Integer.$valueOf(-1)),
a.put("endTime",Long.$valueOf(0>=c?-1:System.currentTimeMillis()+W(1E3*c))),a.put("captureMode",JS.T.nameOf(d).toLowerCase()),a.put("captureLooping",h?Boolean.TRUE:Boolean.FALSE),c=this.vwr.processWriteOrCapture(a),null==c&&(c="canceled"),JU.Logger.info(c))}});k(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)});k(c$,"compare",function(){var a=this.e,b=!1,c=!1,d=!1,e=!1,f=!1,h=null,g=null,j=null,D=null,m=null,n=null;a.iToken=0;var t=this.isFloatParameter(1)?this.floatParameter(++a.iToken):NaN,l=null,k=null,x=null,e=0;if(4115==this.tokAt(1))k=this.vwr.bsA();else if(k=this.atomExpressionAt(1),a.isArrayParameter(++a.iToken))l=a.getPointArray(a.iToken,
-1,!1);else if(1140850689!=(e=this.tokAt(a.iToken))&&4115!=e)x=this.atomExpressionAt(a.iToken);var w=null,s=!1,p=!1,q=null,C=JU.BSUtil.copy(k);null!=x&&C.or(x);for(var N=null==l&&null!=x&&C.equals(k),C=N,r=a.iToken+1;r<this.slen;++r)switch(this.getToken(r).tok){case 4115:C=!0;null==x&&(x=JU.BSUtil.copy(k));break;case 134218757:if(s=!0,e=this.tokAt(r+1),4!=e&&1275203608!=e){q="*";break}case 134218756:q=(p=1275203608==this.tokAt(++r))?"polyhedra":this.stringParameter(r);if(q.equalsIgnoreCase("polyhedra")||
q.equalsIgnoreCase("polyhedron"))p=!0;break;case 1677721602:c=f=!0;q=this.paramAsStr(++r);q.equalsIgnoreCase("SMILES")&&(s=!0,1612709900==this.e.tokAt(r+1)?(q="H",r++):q="*");break;case 3:case 2:t=Math.abs(this.floatParameter(r));break;case 268435504:break;case 2109448:w=this.atomExpressionAt(++r);r=a.iToken;break;case 10:case 1073742325:null!=n&&this.invArg();j=this.atomExpressionAt(a.iToken);e=N?0:this.tokAt(a.iToken+1);D=null==l&&a.isArrayParameter(a.iToken+1)?null:10==e||1073742325==e?this.atomExpressionAt(++a.iToken):
JU.BSUtil.copy(j);null!=w&&(j.and(w),null!=D&&D.and(w));null==D?l=a.getPointArray(++a.iToken,-1,!1):null!=x&&D.and(x);null==m&&(m=new JU.Lst);m.addLast(z(-1,[j,D]));r=a.iToken;break;case 1275203608:s=p=!0;break;case 4125:break;case 7:null!=m&&this.invArg();b=!0;h=a.getQuaternionArray(a.theToken.getList(),1073742001);this.getToken(++r);g=a.getQuaternionArray(a.theToken.getList(),1073742001);null==n&&(n=new JU.Lst);n.addLast(z(-1,[h,g]));break;case 1073742077:b=!0;break;case 134217751:case 1140850689:b=
!1;break;case 528432:c=!0;break;case 4160:d=!0;break;default:this.invArg()}if(!this.chk){C&&(t=0);Float.isNaN(t)||0>t?t=1:!c&&!d&&(c=d=!0);e=0!=t;(N=!b&&null==q&&!p||null!=l)&&J.api.Interface.getInterface("JU.Eigen",this.vwr,"script");null==m&&null==n&&(p&&null==w&&(w=this.vwr.getAtomBitSet("polyhedra")),null==w?(j=N?this.vwr.getAtomBitSet("spine"):new JU.BS,0>j.nextSetBit(0)?(j=k,D=x):(D=JU.BSUtil.copy(j),j.and(k),D.and(x))):(j=JU.BSUtil.copy(k),D=JU.BSUtil.copy(x),j.and(w),j.and(k),null!=D&&(D.and(w),
D.and(x))),m=new JU.Lst,m.addLast(z(-1,[j,D])));var B=null;if(C)for(var B=this.vwr.ms.getModelBS(k,!1),w=Array(B.cardinality()),r=0,E=B.nextSetBit(0);0<=E;E=B.nextSetBit(E+1),r++)w[r]=this.vwr.getModelUndeletedAtomsBitSet(E);else B=JU.BSUtil.newAndSetBit(0),w=z(-1,[k]);for(var F=0,E=B.nextSetBit(0);F<w.length;F++,E=B.nextSetBit(E+1)){var k=w[F],v=O(2,0);if(C&&p&&0==F)x=k;else{for(var u=null,I=new JU.Lst,y=null,L=C?new JU.Lst:m,r=0;r<m.size();++r){var K=m.get(r);C&&L.addLast(K=z(-1,[JU.BSUtil.copy(K[0]),
K[1]]));K[0].and(k)}var H=null,G=null;if(N){null!=l&&(L.clear(),L.addLast(z(-1,[j,l])));try{y=this.vwr.getCenterAndPoints(L,!0)}catch(P){if(Q(P,Exception))this.invArg();else throw P;}u=y[0].length-1;for(r=1;r<=u;r++){I=y[0][r];K=y[1][r];if(!M(I,JM.Atom)||!M(K,JM.Atom))break;C||JU.Logger.info(" atom 1 "+I.getInfo()+"\tatom 2 "+K.getInfo())}u=JU.Measure.calculateQuaternionRotation(y,v);r=Float.isNaN(v[1])?NaN:Math.round(100*v[0])/100;v=Float.isNaN(v[1])?NaN:Math.round(100*v[1])/100;this.showString("RMSD "+
r+" --\x3e "+v+" Angstroms")}else if(b){if(null==n)for(r=0;r<L.size();r++){K=L.get(r);h=this.vwr.getAtomGroupQuaternions(K[0],2147483647);g=this.vwr.getAtomGroupQuaternions(K[1],2147483647);for(u=0;u<h.length&&u<g.length;u++)I.addLast(g[u].div(h[u]))}else for(u=0;u<h.length&&u<g.length;u++)I.addLast(g[u].div(h[u]));v[0]=0;h=I.toArray(Array(I.size()));u=JU.Quat.sphereMean(h,v,1E-4);this.showString("RMSD = "+v[0]+" degrees")}else{r=new JU.M4;H=new JU.P3;if(null!=k&&null!=q&&("H".equals(q)||"*".equals(q)||
"".equals(q)))try{q=this.vwr.getSmilesOpt(k,-1,-1,"H".equals(q)?4096:0,null)}catch(T){if(Q(T,Exception))a.evalError(T.getMessage(),null);else throw T;}if(f){var R;if(null==k||null==x||null==(R=a.getSmilesExt().getFlexFitList(k,x,q,!s)))break;this.vwr.setDihedrals(R,null,1)}p?(v=JU.BS.copy(j),v.and(k),I=JU.BS.copy(D),I.and(x),v=a.getSmilesExt().mapPolyhedra(v.nextSetBit(0),I.nextSetBit(0),s,r)):v=a.getSmilesExt().getSmilesCorrelation(k,x,q,null,null,r,null,!1,null,H,!1,32|(s?1:2));if(Float.isNaN(v)){this.showString("structures do not match from "+
k+" to "+x);break}d&&(G=new JU.V3,r.getTranslation(G));c&&(u=new JU.M3,r.getRotationScale(u),u=JU.Quat.newM(u));this.showString("RMSD = "+v+" Angstroms");C&&(r=this.vwr.getV0abc(E,z(-1,[r])),null!=r&&a.setModelCagePts(E,r,null))}null!=y&&(H=y[0][0]);null==H&&(y=this.vwr.getCenterAndPoints(L,!0),H=y[0][0]);L=new JU.P3;v=NaN;d&&(null==G&&(G=JU.V3.newVsub(y[1][0],H)),v=1E10);if(c&&(null==u&&a.evalError("option not implemented",null),L.add2(H,u.getNormal()),v=u.getTheta(),0==v&&d))if(0.01<G.length())v=
1E10;else if(C)continue;else c=d=e=!1;if(!Float.isNaN(v)&&!Float.isNaN(L.x)&&(y=null,c&&(d&&0!=t)&&(y=this.vwr.ms.getAtomPointVector(k),r=JS.ScriptMathProcessor.getMatrix4f(u.getMatrix(),G),y=JU.Measure.transformPoints(y,r,H)),a.useThreads()||(e=!1),this.vwr.rotateAboutPointsInternal(a,H,L,v/t,v,e,k,G,y,null,null)&&e&&a.isJS))throw new JS.ScriptInterruption(a,"compare",1);}}}});k(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)});k(c$,"measure",function(){var a=this.e,b=null,c=0,d=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 e=this.stringParameter(3==this.slen?2:4);if(this.chk)return;
var f=this.vwr.ms.at,b=this.vwr.ms.ac,c=null;try{c=this.vwr.getSmilesMatcher().getCorrelationMaps(e,f,b,this.vwr.bsA(),2)}catch(h){if(Q(h,Exception))a.evalError(h.getMessage(),null);else throw h;}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 g=this.intParameter(2)-1;this.chk||this.vwr.deleteMeasurement(g)}return}}for(var j=0,D=0,m=-1,n=-1,k=-1,l=G(5,0),A=O(-1,[3.4028235E38,3.4028235E38]),x=!1,w=!1,s=!1,p=!0,q=null,C=null,e=268435538,z=f=null,r=null,B=null,E=new JU.Lst,F=new JU.BS,v=null,u=
null,I=0,y=0,L=NaN,K=null,g=1;g<this.slen;++g)switch(this.getToken(g).tok){case 1073741974:1!=g&&this.invArg();b=a.optParameterAsString(++g);continue;case 1073741824:a.errorStr(24,"ALL, ALLCONNECTED, DELETE");break;default:this.error(15);break;case 268435568:134217736!=this.tokAt(g+1)&&this.invArg();g++;s=!0;break;case 1073741832:K=this.paramAsStr(++g).toLowerCase();break;case 134217736:case 1073741834:case 1073742327:w=1073741834==a.theTok;n=-1;x=!0;w&&s&&this.invArg();break;case 1765808134:c=JU.C.getColix(a.getArgbParam(++g));
g=a.iToken;break;case 1073742066:a.isPoint3f(++g)?(d=this.getPoint3f(g,!1),d=O(-1,[1,d.x,d.y,d.z,0,0,0])):d=a.floatParameterSet(g,7,7);g=a.iToken;break;case 1665140738:case 1073741917:y=P((1665140738==a.theTok?2E3:1E3)*this.floatParameter(++g));null!=b&&0>=y&&(y=-1);break;case 3:null!=q&&this.invArg();p=x=!0;k=(k+1)%2;A[k]=this.floatParameter(g);break;case 12291:268435538!=e&&this.invArg();e=12291;break;case 4114:var H=this.floatParameter(++g),R=this.paramAsStr(++g),S=this.paramAsStr(++g);this.chk||
(B=this.vwr.getFont3D(R,S,H));break;case 2:H=this.intParameter(g);if(x)p=!0,k=(k+1)%2,A[k]=H;else{n=this.vwr.ms.getFirstAtomIndexFromAtomNumber(H,this.vwr.getVisibleFramesBitSet());if(!this.chk&&0>n)return;null!=v&&this.invArg();4<(l[0]=++j)&&a.bad();l[j]=n}break;case 1094713359:m=this.intParameter(++g);break;case 1073742334:268435538!=e&&this.invArg();e=1073742334;break;case 1073742335:268435538!=e&&this.invArg();e=1073742335;break;case 1073742114:p=x=!0;n=-1;break;case 1073741989:case 1073741990:C=
Boolean.$valueOf(1073741989==a.theTok);x=!0;s=1073741990==a.theTok;break;case 1648363544:0<=k&&this.invArg();q=a.encodeRadiusParameter(g,!1,!0);if(null==q)return;q.values=A;g=a.iToken;x=s=!0;C=Boolean.$valueOf(!1);1==I&&(I++,j++,H=JU.BSUtil.copy(F),JU.BSUtil.invertInPlace(H,this.vwr.ms.ac),H.and(this.vwr.ms.getAtomsWithinRadius(5,F,!1,null)),E.addLast(H));break;case 12290:case 10:case 1073742325:I++;case 1073742332:case 8:case 1073742330:0<=n&&this.invArg();j=Array(1);v=a.centerParameter(g,j);if(M(j[0],
JU.BS)&&(v=F=j[0],!this.chk&&0==F.length()))return;M(v,JU.P3)&&(g=new JU.Point3fi,g.setT(v),g.mi=m,v=g);4<(j=++D)&&a.bad();g=a.iToken;E.addLast(v);break;case 1715472409:z=this.paramAsStr(g);break;case 1073742188:L=this.floatParameter(++g);break;case 4:H=this.stringParameter(g);JM.Measurement.isUnits(H)?r=H:f=H;break;case 1073742164:u=a.tickParamAsStr(g,!1,!0,!0),g=a.iToken,e=12290}(null!=q&&(0<=k||2!=j)||2>j&&null==b&&(null==u||1==j))&&a.bad();null!=f&&0!=f.indexOf(j+":")&&(f=j+":"+f);p&&A[1]<A[0]&&
(A[1]=A[0],A[0]=3.4028235E38==A[1]?3.4028235E38:-200);if(!this.chk)if(a=null!=b&&null==v&&268435538==e,null!=v||null!=u||a){null==q&&(q=new J.atomdata.RadiusData(A,0,null,null));null!=u&&(u.id="default");if(a)e=266284;else if(null!=v&&(null!=z||null!=f)&&268435538==e)e=12290;l=null;if(null!=B||null!=K||0!=c||null!=f&&(a||0<=f.indexOf("\n")))l=J.api.Interface.getInterface("JM.Text",this.vwr,"script").newMeasure(this.vwr,B,c);null!=l&&(l.pymolOffset=d,l.setAlignmentLCR(K));this.setShapeProperty(6,"measure",
this.vwr.newMeasurementData(b,E).set(e,null,q,z,f,r,u,w,s,C,x,y,c,l,L))}else switch(a=null==b?l:b,e){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==f?"toggle":"toggleOn",a),null!=f&&this.setShapeProperty(6,"setFormats",f)}});k(c$,"connect",function(a){var b=this.e,c=O(2,0),d=Array(2);d[0]=d[1]=this.vwr.bsA();var e=NaN,f=G(-1,[-2147483648]),h=0,
g=131071,j=1073742026,k=!1,m=!1,n=!1,t=3.4028235E38,l=!1,A=0,x=0,w=new JU.BS,s=!1,p=0,q=0,C=0,N=!1;if(1==this.slen)this.chk||this.vwr.rebondState(b.$isStateScript);else if(1073877011==this.tokAt(1))this.chk||this.vwr.connectNBO(this.e.optParameterAsString(2));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<A){(m||l)&&b.error(23);g=JU.Edge.getBondOrderFromFloat(this.floatParameter(a));
131071==g&&this.invArg();m=!0;break}2<++x&&b.bad();var r=this.floatParameter(a);268435634==this.tokAt(a+1)&&(r=-r/100,a++);c[h++]=r;break;case 12290:case 10:case 1073742325:(2<A||s&&0<A)&&b.bad();(m||l)&&this.invArg();d[A++]=this.atomExpressionAt(a);s=b.isBondSet;if(2==A){for(var r=b.iToken,B=a;B<r;B++)if(1073741824==this.tokAt(B)&&this.paramAsStr(B).equals("_1")){p=a;break}b.iToken=r}a=b.iToken;break;case 1086324742:N=!0;break;case 1765808134:case 603979967:case 1073742074:l=!0;t=this.getColorTrans(b,
a,!1,f);a=b.iToken;break;case 1073742086:f=1073741852==this.tokAt(2);this.checkLength(f?3:2);if(this.chk)return;this.vwr.clearModelDependentObjects();this.vwr.ms.deleteAllBonds();e=new JU.BS;this.vwr.ms.setPdbConectBonding(0,0,e);if(f){b=b.$isStateScript&&this.vwr.getBoolean(603979872);this.vwr.ms.autoBondBs4(null,null,e,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:n=!0;++a!=this.slen&&this.invArg();j=b.theTok;1073741852==j&&!(131071==g||2048==g||515==g)&&this.invArg();break;case 659482:l||(f[0]=16777215,t=0.5,e=this.vwr.getFloat(570425406),l=!0),n||(j=1073742026,n=!0);case 1073741824:if(b.isColorParam(a)){q=-a;break}case 1075838996:case 1613238294:g=this.paramAsStr(a);131071==(g=JS.ScriptParam.getBondOrderFromString(g))&&this.invArg();m&&b.error(18);m=!0;switch(g){case 33:switch(this.tokAt(a+
1)){case 3:g=JS.ScriptParam.getPartialBondOrderFromFloatEncodedInt(this.st[++a].intValue);break;case 2:g=this.intParameter(++a)}break;case 2048:2==this.tokAt(a+1)&&(g=this.intParameter(++a)<<11,C=this.floatParameter(++a));break;case 65537:n||(j=1073742025,n=!0)}break;case 1665140738:e=this.floatParameter(++a);l=!0;break;case 1073742333:case 12291:++a!=this.slen&&this.invArg();j=12291;k=!0;l=!1;break;default:q=a}0<a&&(q==-a||q==a&&b.isColorParam(a)?(l=!0,f[0]=b.getArgbParam(a),a=b.iToken):q==a&&this.invArg())}if(!this.chk){2>
h&&(0==h&&(c[0]=1E8),c[1]=c[0],c[0]=0.1);l&&(m||(g=65535),n||(j=1073742025));m=h=0;if(0<p){C=new JU.BS;this.vwr.definedAtomSets.put("_1",C);N=d[0];for(n=N.nextSetBit(0);0<=n;n=N.nextSetBit(n+1))C.set(n),d=this.vwr.makeConnections(c[0],c[1],g,j,C,this.atomExpressionAt(p),w,s,!1,0),h+=Math.abs(d[0]),m+=d[1],C.clear(n)}else d=this.vwr.makeConnections(c[0],c[1],g,j,d[0],d[1],w,s,N,C),h+=Math.abs(d[0]),m+=d[1];c=b.doReport();k?c&&b.report(J.i18n.GT.i(J.i18n.GT.$("{0} connections deleted"),m),!1):(l&&(this.vwr.selectBonds(w),
Float.isNaN(e)||b.setShapeSizeBs(1,Math.round(2E3*e),null),this.finalizeObject(1,f[0],t,0,!1,null,0,w),this.vwr.selectBonds(null)),c&&b.report(J.i18n.GT.o(J.i18n.GT.$("{0} new bonds; {1} modified"),z(-1,[Integer.$valueOf(h),Integer.$valueOf(m)])),!1))}}},"~N");k(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()}});k(c$,"data",function(){var a=this.e,b=null,c=null,d=!1,e;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<=(e=c.indexOf("@")))b=""+a.getParameter(c.substring(e+1),4,!0),c=c.substring(0,e).trim();else if(null==b&&0<=(e=c.indexOf(" ")))b=c.substring(e+1).trim(),c=c.substring(0,e).trim(),d=!0;break;default:a.bad()}e=c.substring(0,(c+" ").indexOf(" ")).toLowerCase();
if(e.equals("model")||e.equals("append"))a.cmdLoad();else if(!this.chk){var f=0<=c.toLowerCase().indexOf("(default)");if(e.equals("connect_atoms"))this.vwr.ms.connect(this.parseDataArray(b,!1));else if(0==e.indexOf("ligand_"))this.vwr.setLigandModel(c.substring(7).toUpperCase()+"_data",b.trim());else if(0==e.indexOf("file_"))this.vwr.setLigandModel(c.substring(5)+"_file",b.trim());else if(a=Array(4),e.equals("element_vdw")){a[0]=e;a[1]=b.$replace(";","\n");b=JU.Elements.elementNumberMax;e=G(b+1,0);
for(f=1;f<=b;f++)e[f]=f;a[2]=e;a[3]=Integer.$valueOf(0);this.vwr.setData("element_vdw",a,b,0,0,0,0)}else if(0==e.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==e.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 h=JU.PT.getTokens(c);if(0==e.indexOf("property_")&&!(2==h.length&&h[1].equals("set"))){f=this.vwr.bsA();a[0]=e;var g=d?0:this.vwr.getP("propertyAtomNumberField").intValue(),
j=d?0:this.vwr.getP("propertyAtomNumberColumnCount").intValue(),k=d?-2147483648:this.vwr.getP("propertyDataField").intValue(),m=d?0:this.vwr.getP("propertyDataColumnCount").intValue();!d&&0<=c.indexOf(" ")&&(3==h.length&&(g=JU.PT.parseInt(h[1]),k=JU.PT.parseInt(h[2])),5==h.length&&(g=JU.PT.parseInt(h[1]),j=JU.PT.parseInt(h[2]),k=JU.PT.parseInt(h[3]),m=JU.PT.parseInt(h[4])));0>g&&(g=0);0>k&&(k=0);c=this.vwr.ms.ac;d=null;h=JU.BS.newN(c);if(0<g){for(var d=G(c+2,0),n=0;n<=c;n++)d[n]=-1;for(n=f.nextSetBit(0);0<=
n;n=f.nextSetBit(n+1)){var t=this.vwr.ms.at[n].getAtomNumber();t>c+1||(0>t||h.get(t))||(h.set(t),d[t]=n)}a[2]=d}else a[2]=JU.BSUtil.copy(f);a[1]=b;a[3]=Integer.$valueOf(0);this.vwr.setData(e,a,c,g,j,k,m)}else"occupany".equals(e)&&(e="occupancy"),g=JM.AtomCollection.getUserSettableType(e),-1<g?this.vwr.setAtomData(g,e,b,f):(a[0]=c,a[1]=b,a[3]=Integer.$valueOf(0),this.vwr.setData(e,a,0,0,0,0,0))}}});k(c$,"ellipsoid",function(){var a=this.e,b=0,c=1,d=3.4028235E38,e=!1,f=!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;f=e=!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;e=!0;break;default:this.invArg()}if(e){for(b=G(-1,[-2147483648]);++c<this.slen;){var e=this.paramAsStr(c),h=null;this.getToken(c);
if(!f)switch(a.theTok){case 1073742330:e="points";h=Array(3);h[0]=a.objectNameParameter(++c);if(this.chk)continue;a.getShapePropertyData(24,"getVertices",h);break;case 1825200146:h=this.e.optParameterAsString(++c);if(0==h.length)continue;break;case 1611272194:var h=Array(3),g=null;switch(this.getToken(c+1).tok){case 11:for(var c=a.theToken.value,j=3;0<=--j;)c.getColumnV(j,h[j]=new JU.V3);break;case 1073742195:c+=2;case 268435520:g=new JU.Lst;for(j=3;0<=--j;){switch(this.tokAt(++c)){case 268435520:break;
default:a.isCenterParameter(c)?g.addLast(JS.SV.newV(8,this.centerParameter(c))):268435520!=this.tokAt(c)&&g.addLast(this.getToken(c))}c=a.iToken}268435521!=this.getToken(++c).tok&&this.invArg();break;case 7:g=a.theToken.getList();switch(g.size()){case 1:g=new JU.Lst;for(j=3;0<=--j;)g.addLast(this.getToken(++c));break;case 3:break;default:this.invArg()}break;default:for(j=0;3>j;j++)h[j]=new JU.V3,h[j].setT(this.centerParameter(++c)),c=a.iToken}if(null!=g)for(c=3;0<=--c;)switch(j=g.get(c),j.tok){case 7:h[c]=
JU.V3.new3(JS.SV.fValue(j.getList().get(0)),JS.SV.fValue(j.getList().get(1)),JS.SV.fValue(j.getList().get(2)));break;case 8:h[c]=JU.V3.newV(j.value)}c=a.iToken;break;case 12289:h=this.centerParameter(++c);c=a.iToken;break;case 1094713359:h=Integer.$valueOf(this.intParameter(++c));break;case 12291:h=Boolean.TRUE,this.checkLength(c+1)}if(null==h)switch(a.theTok){case 1073742335:e="on";h=Boolean.TRUE;break;case 1073742334:e="on";h=Boolean.FALSE;break;case 1073742138:this.isFloatParameter(c+1)?h=Float.$valueOf(this.floatParameter(++c)):
a.isCenterParameter(c)?(c=this.centerParameter(c),h=O(-1,[c.x,c.y,c.z])):h=a.floatParameterSet(++c,3,3);c=a.iToken;break;case 12290:case 10:case 1073742325:e="atoms";h=this.atomExpressionAt(c);c=a.iToken;break;case 1765808134:case 603979967:case 1073742074:d=this.getColorTrans(a,c,!0,b);c=a.iToken;continue;case 1073742075:h=this.paramAsStr(++c)}null==h&&this.invArg();this.setShapeProperty(20,e.toLowerCase(),h)}this.finalizeObject(20,b[0],d,0,!1,null,0,null);this.setShapeProperty(20,"thisID",null)}else a.setShapeSizeBs(20,
b,null)});k(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),d=this.e.optParameterAsString(this.slen-1).equalsIgnoreCase("close");if(!d&&(this.slen==a||this.slen==a+2))c=this.slen==a+2?this.intParameter(a++):-1,a=0>c?-1:this.intParameter(a),d=new java.util.Hashtable,d.put("fileName","\u0001\u0001"+b),d.put("backgroundColor",Integer.$valueOf(this.vwr.getBackgroundArgb())),d.put("type",
"png"),d.put("quality",Integer.$valueOf(-1)),d.put("width",Integer.$valueOf(c)),d.put("height",Integer.$valueOf(a)),this.chk||this.vwr.processWriteOrCapture(d);else{if(d)switch(this.slen){case 2:c="closeall";break;case 3:case 4:break;default:this.checkLength(0)}this.chk||this.vwr.fm.loadImage(d?"\u0001close":c,"\u0001"+c+"\u0001"+("".equals(b)||null==b?null:b),!1)}});k(c$,"invertSelected",function(){var a=this.e,b=null,c=null,d=null,e=-2147483648,f=1;switch(this.tokAt(1)){case 0:if(this.chk)return;
d=this.vwr.bsA();b=this.vwr.ms.getAtomSetCenter(d);this.vwr.invertAtomCoordPt(b,d);return;case 528443:case 1140850689:f++;case 10:case 1073742325:case 12290:d=this.atomExpressionAt(f);if(!a.isAtomExpression(a.iToken+1)){a.checkLengthErrorPt(a.iToken+1,a.iToken+1);if(!this.chk)for(a=d.nextSetBit(0);0<=a;a=d.nextSetBit(a+1))this.vwr.invertRingAt(a,!1);return}e=d.nextSetBit(0);d=this.atomExpressionAt(a.iToken+1);break;case 134217751:b=a.centerParameter(2,null);break;case 134217750:c=a.planeParameter(1);
break;case 134219265:c=a.hklParameter(2,!1)}a.checkLengthErrorPt(a.iToken+1,1);null==c&&(null==b&&-2147483648==e)&&this.invArg();this.chk||-1!=e&&this.vwr.invertSelected(b,c,e,d)});k(c$,"mapProperty",function(){for(var a,b,c,d,e,f=0,h=0,g=0,j=this.e;;){if(1113589787==this.tokAt(1))a=this.vwr.bsA(),b=this.atomExpressionAt(2),c=d="selected";else{a=this.atomExpressionAt(1);if(1073742336!=this.tokAt(++j.iToken)||!JS.T.tokAttr(f=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(h=this.tokAt(++j.iToken),2048))break;d=this.paramAsStr(j.iToken)}e=JS.T.tokAttr(g=this.tokAt(j.iToken+1),1077936128)?this.paramAsStr(++j.iToken):JS.T.nameOf(g=1094715393);j.checkLast(j.iToken);if(this.chk)return;var k=null;this.showString("mapping "+c.toUpperCase()+" for "+a.cardinality()+" atoms to "+d.toUpperCase()+" for "+b.cardinality()+" atoms using "+e.toUpperCase());if(JS.T.tokAttrOr(f,1094713344,1111490560)&&JS.T.tokAttrOr(h,1094713344,
1111490560)&&JS.T.tokAttrOr(g,1094713344,1111490560)){var m=this.getBitsetPropertyFloat(a,f|224,null,NaN,NaN),n=this.getBitsetPropertyFloat(a,g|224,null,NaN,NaN),f=this.getBitsetPropertyFloat(b,g|224,null,NaN,NaN),t=1715472409==h,l=O(t?this.vwr.ms.ac:f.length,0),k=new JU.BS;if(m.length==n.length){for(var A=new java.util.Hashtable,g=0;g<m.length;g++)A.put(Float.$valueOf(n[g]),Float.$valueOf(m[g]));m=-1;for(g=n=0;g<f.length;g++){var m=b.nextSetBit(m+1),x=A.get(Float.$valueOf(f[g]));null!=x&&(k.set(m),
l[t?m:n]=x.floatValue(),n++)}t?this.vwr.setData(d,z(-1,[d,l,k,Integer.$valueOf(1),Boolean.TRUE]),this.vwr.ms.ac,0,0,2147483647,0):JS.T.tokAttr(h,2048)?this.vwr.setAtomProperty(k,h,0,0,null,l,null):this.error(56)}}if(null==k){c=this.getBitsetIdent(a,"{"+e+"=%["+e+"]}."+d+" = %["+c+"]",null,!1,2147483647,!1);a=new JU.SB;for(g=0;g<c.length;g++)0>c[g].indexOf("null")&&a.append(c[g]).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(w){if(Q(w,Exception))b=w,this.vwr.slm.setSelectionSubset(c),j.errorStr(-1,"Error: "+b.getMessage());else if(Q(w,Error))b=w,this.vwr.slm.setSelectionSubset(c),j.errorStr(-1,"Error: "+b.toString());else throw w;}this.vwr.slm.setSelectionSubset(c)}this.showString("DONE");return}this.invArg()});k(c$,"minimize",function(){for(var a=null,b=2147483647,c=0,d=!1,e=!1,f=null,h=!1,g=this.vwr.getMinimizer(!1),j=1;j<this.slen;j++)switch(this.getToken(j).tok){case 1073741828:d=
!0;continue;case 1073741874:case 1073742162:this.checkLength(2);if(this.chk||null==g)return;g.setProperty(this.paramAsStr(j),null);return;case 1073741882:this.checkLength(2);if(this.chk||null==g)return;g.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",z(-1,[c,Float.$valueOf(b)]));return;case 1073741905:c=this.floatParameter(++j);continue;case 1073741935:b=0;continue;case 12293:1!=j&&this.invArg();f=this.atomExpressionAt(++j);0>f.nextSetBit(0)&&(f=null);j=this.e.iToken;this.chk||this.vwr.getMinimizer(!0).setProperty("fixed",f);if(j+1==this.slen)return;continue;case 10:case 1073742325:h=!0;case 1275082245:1275082245==this.e.theTok&&j++;a=this.atomExpressionAt(j);j=this.e.iToken;1073742072==this.tokAt(j+
1)&&(j++,h=!0);continue;case 1073742148:e=!0;break;case 266298:b=this.intParameter(++j);continue;default:this.invArg()}if(!this.chk)try{this.vwr.minimize(this.e,b,c,a,f,0,(d?8:0)|(h?16:0)|(e?1:0))}catch(k){if(Q(k,Exception))throw new JS.ScriptInterruption(this.e,"minimize",1);throw k;}});k(c$,"modulation",function(){var a=null,b=this.e,c=!0,d=!1,e=null,f=1;switch(this.getToken(f).tok){case 1073742334:c=!1;case 0:case 1073742335:break;case 12290:case 10:case 1073742325:e=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,!0);d=1073742335==this.tokAt(b.iToken+1);break;default:var h=b.theToken.value.toString();f++;h.equalsIgnoreCase("t")?b.theTok=3:h.equalsIgnoreCase("m")||h.equalsIgnoreCase("q")?b.theTok=2:this.invArg();case 3:case 2:switch(b.theTok){case 3:this.isFloatParameter(f)?(a=this.floatParameter(f),a=JU.P3.new3(a,a,a)):a=b.getPoint3f(f,!1,!0);break;case 2:2==this.tokAt(f)?(d=this.intParameter(f),
a=JU.P3.new3(d,d,d)):a=b.getPoint3f(f,!1,!0),d=!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(e,c,a,d))});k(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,d=0;if(!(0>c||(d=this.vwr.ms.at[c].mi)!=this.vwr.ms.mc-1||this.vwr.ms.isTrajectory(d)))if(c=this.e.optParameterAsString(b),this.e.checkLast(b),!this.chk&&this.vwr.ms.am[d].isBioModel){d=null;if(4==this.tokAt(b)&&!c.startsWith("~"))d=z(-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);d=JU.PT.getTokens(c)}0<d.length&&
this.vwr.ms.bioModelset.mutate(a,c,d)}});k(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,d;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 e=1;e<this.slen;e++){var f=this.isFloatParameter(e)?this.floatParameter(e++):2;0>f&&this.invArg();!this.chk&&0<f&&a.refresh(!1);switch(this.getToken(e).tok){case 8:case 1073742332:d=this.getPoint3f(e,!0);a.iToken++;a.iToken!=this.slen&&this.invArg();this.chk||this.vwr.tm.setNavXYZ(d.x,d.y,d.z);return;case 554176526:d=this.floatParameter(++e);
this.chk||c.addLast(z(-1,[Integer.$valueOf(554176526),Float.$valueOf(f),Float.$valueOf(d)]));continue;case 12289:d=this.centerParameter(++e);e=a.iToken;this.chk||c.addLast(z(-1,[Integer.$valueOf(134217751),Float.$valueOf(f),d]));continue;case 528432:switch(this.getToken(++e).tok){case 1111492629:b.set(1,0,0);e++;break;case 1111492630:b.set(0,1,0);e++;break;case 1111492631:b.set(0,0,1);e++;break;case 8:case 1073742332:b.setT(this.getPoint3f(e,!0));e=a.iToken+1;break;case 1073741824:this.invArg()}d=
this.floatParameter(e);this.chk||c.addLast(z(-1,[Integer.$valueOf(528432),Float.$valueOf(f),b,Float.$valueOf(d)]));continue;case 4160:var h=d=NaN;if(this.isFloatParameter(++e))d=this.floatParameter(e),h=this.floatParameter(++e);else switch(this.tokAt(e)){case 1111492629:d=this.floatParameter(++e);break;case 1111492630:h=this.floatParameter(++e);break;default:d=this.centerParameter(e);e=a.iToken;this.chk||c.addLast(z(-1,[Integer.$valueOf(4160),Float.$valueOf(f),d]));continue}this.chk||c.addLast(z(-1,
[Integer.$valueOf(268435634),Float.$valueOf(f),Float.$valueOf(d),Float.$valueOf(h)]));continue;case 268435632:continue;case 1112152078:d=new JU.Lst;a.isAtomExpression(e+1)?(h=this.atomExpressionAt(++e),e=a.iToken):h=this.vwr.bsA();if(this.chk)return;this.vwr.getPolymerPointsAndVectors(h,d);var g;if(0<(g=d.size())){for(var h=Array(g),j=0;j<g;j++)h[j]=d.get(j);c.addLast(z(-1,[Integer.$valueOf(1112152078),Float.$valueOf(f),h]));continue}break;case 1073742084:if(1073742330==this.getToken(e+1).tok){e++;
d=a.objectNameParameter(++e);if(this.chk)return;this.setShapeProperty(22,"thisID",d);d=this.getShapeProperty(22,"vertices");a.refresh(!1);null==d&&this.invArg();h=P(this.isFloatParameter(e+1)?this.floatParameter(++e):0);g=P(this.isFloatParameter(e+1)?this.floatParameter(++e):2147483647);c.addLast(z(-1,[Integer.$valueOf(1073742084),Float.$valueOf(f),d,null,G(-1,[h,g])]));continue}for(d=new JU.Lst;a.isCenterParameter(e+1);)d.addLast(this.centerParameter(++e)),e=a.iToken;if(0<d.size()){d=d.toArray(Array(d.size()));
this.chk||c.addLast(z(-1,[Integer.$valueOf(1073742084),Float.$valueOf(f),d,null,G(-1,[0,2147483647])]));continue}default:this.invArg()}}!this.chk&&!this.vwr.isJmolDataFrame()&&this.vwr.tm.navigateList(a,c)}});k(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),d=a.length-1,e=a!==this.st,f=!0,h=this.st;e&&(b.st=this.st=a);var g=e?134222350:a[0].tok,j=e||134221850==g||4138==g?0:1,k=null,m=!0,n=!1;switch(g){case 135176:m=!1;n=
!0;break;case 134222350:f=m=!1;break;case 134221856:m=!1,4==JS.CmdExt.tokAtArray(d,a)?k=this.stringParameter(d--):1073742336==JS.CmdExt.tokAtArray(d-1,a)?(k=this.paramAsStr(d-2)+"."+this.paramAsStr(d),d-=3):(b.st=this.st=h,b.iToken=this.st.length,this.error(13)),b.slen=this.slen=d+1}var e="",t=null,l="",A=!1,x=!1,w=!1,s=!1,p=Array(3),q=G(3,0),C=JU.BSUtil.copy(this.vwr.bsA()),N="; select "+JU.Escape.eBS(C)+";\n ",s=b.optParameterAsString(d).toLowerCase(),r=null,B=null,E=null,F=JS.CmdExt.tokAtArray(j,
a);4==F&&(F=JS.T.getTokFromName(a[j].value));switch(F){default:b.iToken=1;this.invArg();break;case 134221834:b.iToken=1;s="data";N="";break;case 1715472409:b.iToken=j+1;for(a=0;3>a;a++){switch(this.tokAt(b.iToken)){case 4:q[a]=JS.T.getTokFromName(b.getToken(b.iToken).value);break;default:q[a]=this.tokAt(b.iToken);break;case 0:0==a&&this.invArg();case 1287653388:case 32:case 64:a=2;continue}1715472409!=q[a]&&!JS.T.tokAttr(q[a],1077936128)&&this.invArg();p[a]=this.getToken(b.iToken).value.toString();
b.iToken++}1287653388==this.tokAt(b.iToken)&&(E=this.stringParameter(++b.iToken),f=!1,b.iToken++);32==this.tokAt(b.iToken)&&(r=this.getPoint3f(++b.iToken,!1),b.iToken++);64==this.tokAt(b.iToken)&&(B=this.getPoint3f(++b.iToken,!1),b.iToken++);s="property "+p[0]+(null==p[1]?"":" "+p[1])+(null==p[2]?"":" "+p[2]);0>C.nextSetBit(0)&&(C=this.vwr.getModelUndeletedAtomsBitSet(c));l="select "+JU.Escape.eBS(C)+";\n ";break;case 4138:s.equalsIgnoreCase("draw")&&(s=b.optParameterAsString(--d).toLowerCase());
s=d>j&&s.startsWith("r");s="ramachandran"+(s?" r":"")+(135176==g?" draw":"");break;case 134221850:case 136314895:e=' "'+this.vwr.getQuaternionFrame()+'"';l="set quaternionFrame"+e+";\n  ";A=!0;s.equalsIgnoreCase("draw")&&(n=!0,s=b.optParameterAsString(--d).toLowerCase());w=(x=s.startsWith("deriv")||s.startsWith("diff"))&&0<s.indexOf("2");x&&d--;if(s.equalsIgnoreCase("helix")||s.equalsIgnoreCase("axis"))x=n=!0,d=-1;s=((d<=j?"":b.optParameterAsString(d))+"w").substring(0,1);if(s.equals("a")||s.equals("r"))x=
!0;JU.PT.isOneOf(s,";w;x;y;z;r;a;")||b.evalError("QUATERNION [w,x,y,z,a,r] [difference][2]",null);s="quaternion "+s+(x?" difference":"")+(w?"2":"")+(n?" draw":"")}this.st=h;if(this.chk)return"";if(m&&(l+="plot "+s,h=this.vwr.ms.getJmolDataFrameIndex(c,l),0<h&&134221856!=g&&134222350!=g))return this.vwr.setCurrentModelIndexClear(h,!0),"";m=d=h=null;j=Array(3);if(1715472409==F){h=this.getBitsetPropertyFloat(C,q[0]|224,1715472409==q[0]?p[0]:null,null==r?NaN:r.x,null==B?NaN:B.x);j[0]=p[0]+" "+JU.Escape.eAF(h);
null!=p[1]&&(d=this.getBitsetPropertyFloat(C,q[1]|224,1715472409==q[1]?p[1]:null,null==r?NaN:r.y,null==B?NaN:B.y),j[1]=p[1]+" "+JU.Escape.eAF(d));null!=p[2]&&(m=this.getBitsetPropertyFloat(C,q[2]|224,1715472409==q[2]?p[2]:null,null==r?NaN:r.z,null==B?NaN:B.z),j[2]=p[2]+" "+JU.Escape.eAF(m));null==r&&(r=JU.P3.new3(this.getPlotMinMax(h,!1,q[0]),this.getPlotMinMax(d,!1,q[1]),this.getPlotMinMax(m,!1,q[2])));null==B&&(B=JU.P3.new3(this.getPlotMinMax(h,!0,q[0]),this.getPlotMinMax(d,!0,q[1]),this.getPlotMinMax(m,
!0,q[2])));JU.Logger.info("plot min/max: "+r+" "+B);n=t=null;if(f){n=JU.P3.new3(1,1,1);t=new JU.P3;t.ave(B,r);n.sub2(B,r);n.set(n.x/200,n.y/200,n.z/200);JS.T.tokAttr(q[0],1094713344)?(n.x=1,t.x=0):0.1<n.x&&10>=n.x&&(n.x=1);JS.T.tokAttr(q[1],1094713344)?(n.y=1,t.y=0):0.1<n.y&&10>=n.y&&(n.y=1);JS.T.tokAttr(q[2],1094713344)?(n.z=1,t.z=0):0.1<n.z&&10>=n.z&&(n.z=1);if(null==p[2]||null==p[1])t.z=r.z=B.z=n.z=0;for(a=0;a<h.length;a++)h[a]=(h[a]-t.x)/n.x;if(null!=p[1])for(a=0;a<d.length;a++)d[a]=(d[a]-t.y)/
n.y;if(null!=p[2])for(a=0;a<m.length;a++)m[a]=(m[a]-t.z)/n.z}t=z(-1,[C,h,d,m,r,B,n,t,E,j])}if(134221856==g)return this.vwr.writeFileData(k,"PLOT_"+s,c,t);f=s.equals("data")?"1 0 H 0 0 0 # Jmol PDB-encoded data":this.vwr.getPdbData(c,s,null,t,null,!0);if(134222350==g)return f;JU.Logger.debugging&&JU.Logger.debug(f);if(135176==g)return b.runScript(f),"";g=this.vwr.fm.getFileInfo();k=this.vwr.getBoolean(603979792);this.vwr.g.appendNew=!0;f=null!=f&&null==this.vwr.openStringInlineParamsAppend(f,null,
!0);this.vwr.g.appendNew=k;this.vwr.fm.setFileInfo(g);if(!f)return"";g=this.vwr.ms.mc;this.vwr.ms.setJmolDataFrame(l,c,g-1);1715472409!=F&&(l+=";\n"+N);l=this.vwr.addStateScript(l,!0,!1);f=150;switch(F){default:c="frame 0.0; frame last; reset;select visible;wireframe only;";f=10;break;case 1715472409:this.vwr.setFrameTitle(g-1,s+" plot for model "+this.vwr.getModelNumberDotted(c));c="frame 0.0; frame last; reset;select visible; spacefill 3.0; wireframe 0;draw plotAxisX"+g+' {100 -100 -100} {-100 -100 -100} "'+
p[0]+'";draw plotAxisY'+g+' {-100 100 -100} {-100 -100 -100} "'+p[1]+'";';null!=p[2]&&(c+="draw plotAxisZ"+g+' {-100 -100 100} {-100 -100 -100} "'+p[2]+'";');break;case 4138:this.vwr.setFrameTitle(g-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"+g+' {100 0 0} {-100 0 0} "phi";draw ramaAxisY'+g+' {0 100 0} {0 -100 0} "psi";';break;case 134221850:case 136314895:this.vwr.setFrameTitle(g-
1,s.$replace("w"," ")+e+" 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"+g+" color "+c+" sphere 100.0 mesh nofill frontonly translucent 0.8;draw quatAxis"+g+'X {100 0 0} {-100 0 0} color red "x";draw quatAxis'+g+'Y {0 100 0} {0 -100 0} color green "y";draw quatAxis'+g+'Z {0 0 100} {0 0 -100} color blue "z";color structure;draw quatCenter'+g+"{0 0 0} scale 0.02;"}b.runScript(c+
N);l.setModelIndex(this.vwr.am.cmi);this.vwr.setRotationRadius(f,!0);b.sm.loadShape(31);this.showString("frame "+this.vwr.getModelNumberDotted(g-1)+(0<s.length?" created: "+s+(A?e:""):""));return""},"~A");k(c$,"polyhedra",function(){var a=this.e,b=1==this.slen,c=!1,d=b,e=!1,f=!1,h=!1,g=NaN,j=0;a.sm.loadShape(21);this.setShapeProperty(21,"init",Boolean.TRUE);for(var k=3.4028235E38,m=-1,n=G(-1,[-2147483648]),t=-1,l=null,A=null,x=!1,w=null,s=null,p=1;p<this.slen;++p){var q=null,w=null;switch(this.getToken(p).tok){case 1073742197:g=
NaN;case 1073741872:a=1073742197==this.e.theTok?-1:2==this.tokAt(p+1)?this.intParameter(++p):1;this.chk||J.api.Interface.getInterface("JU.BZone",this.vwr,"script").setViewer(this.vwr).createBZ(a,null,!1,A,g);this.setShapeProperty(21,"init",Boolean.FALSE);return;case 6:q="info";w=this.e.theToken.value;d=!0;break;case 134217751:q="points";w=Float.$valueOf(1073742334==this.tokAt(++p)?0:this.e.floatParameter(p));x=!0;break;case 1073742138:g=this.floatParameter(++p);x=!0;continue;case 1814695966:null!=
A&&this.invArg();q="unitCell";w=Boolean.TRUE;d=!0;break;case 1073742072:this.e.restrictSelected(!1,!1),a.theTok=1073742335;case 1073742335:case 12291:case 1073742334:(p+1!=this.slen||d||1<j)&&this.error(18);q=1073742334==a.theTok?"off":1073742335==a.theTok?"on":"delete";e=!0;break;case 7:(null==A||d)&&this.invArg();d=!0;w=this.getIntArray2(p);s=this.getAllPoints(a.iToken+1,3);p=a.iToken;M(s[0],JM.Atom)&&this.setShapeProperty(21,"model",Integer.$valueOf(s[0].getModelIndex()));q="definedFaces";w=z(-1,
[w,s]);break;case 1073741961:q="full";break;case 2:null!=A&&this.invArg();q="nVertices";w=Integer.$valueOf(this.intParameter(p));d=!0;268435504==this.tokAt(p+1)&&p++;break;case 1677721602:null!=A&&this.invArg();0<j&&this.invPO();d=!0;q="bonds";b=!0;break;case 1073741852:-1!=m&&this.invArg(),m=0,p--;case 1665140738:p++;case 3:null!=A&&this.invArg();0<j&&this.invPO();q=0>=m?"radius":"radius1";w=Float.$valueOf(m=0==m?0:this.floatParameter(p));d=!0;break;case 1073742066:if(!this.isFloatParameter(p+1)){l=
this.e.centerParameter(++p,null);p=a.iToken;x=!0;continue}case 1073741937:this.setShapeProperty(21,"collapsed",null);case 1073742099:case 1073741924:q=JS.T.nameOf(a.theTok);switch(this.tokAt(p+1)){case 268435860:case 268435504:p++}w=Float.$valueOf(this.floatParameter(++p));break;case 1094717454:null==A&&this.invArg();q="model";w=Integer.$valueOf(this.intParameter(++p));break;case 1073742170:(1<j||null!=A&&!c||t==p)&&this.invPO();j=3;a.isAtomExpression(++p)?(q=d||c?"to":"toBitSet",w=this.atomExpressionAt(p)):
a.isArrayParameter(p)?(q="toVertices",w=a.getPointArray(p,-1,!1)):this.error(19);p=a.iToken;d=!0;break;case 12290:case 10:case 1073742325:f&&this.invPO();switch(++j){case 1:null!=A&&this.invArg();q="centers";break;case 2:q="to";d=!0;break;default:a.bad()}w=this.atomExpressionAt(p);p=a.iToken;d=(new Boolean(d|p+1==this.slen)).valueOf();break;case 1765808134:case 603979967:case 1073742074:k=this.getColorTrans(a,p,!0,n);p=a.iToken;continue;case 1073741948:case 1073741886:f&&this.error(18);f=!0;this.isFloatParameter(p+
1)&&this.setShapeProperty(21,"faceCenterOffset",Float.$valueOf(this.floatParameter(++p)));q=1073741886==this.e.theTok?"collapsed":null;break;case 1073742044:case 1073741933:case 1073741956:case 1073741934:h&&this.error(18);x=h=!0;q=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(p)){1!=p&&this.invPO();A=1073741974==a.theTok?this.stringParameter(++p):a.optParameterAsString(p);
this.setShapeProperty(21,"thisID",A);this.setShapeProperty(21,"model",Integer.$valueOf(this.vwr.am.cmi));if(!a.isCenterParameter(p+1))continue;q="center";w=this.centerParameter(++p);p=a.iToken;c=!0;break}default:if(a.isColorParam(p)){n[0]=a.getArgbParam(p);a.isCenterParameter(p)&&(t=a.iToken+1);p=a.iToken;continue}this.invArg()}null!=q&&this.setShapeProperty(21,q,w);if(e)return}d?(!f&&b&&this.setShapeProperty(21,"bonds",null),this.setShapeProperty(21,"generate",null)):x||this.error(19);null!=l&&this.setShapeProperty(21,
"offset",l);Float.isNaN(g)||this.setShapeProperty(21,"scale",Float.$valueOf(g));-2147483648!=n[0]&&this.setShapeProperty(21,"colorThis",Integer.$valueOf(n[0]));3.4028235E38!=k&&a.setShapeTranslucency(21,"","translucentThis",k,null);this.setShapeProperty(21,"init",Boolean.FALSE)});k(c$,"write",function(a){var b=this.e,c=1,d=1,e=null,f=null,h=null,g=null,j="SPT",k=!0,m=!1,n=!1;null==a?(a=this.st,m=this.vwr.isApplet&&!this.vwr.isSignedApplet||!this.vwr.haveAccess(JV.Viewer.ACCESS.ALL)||0<this.vwr.fm.getPathForAllFiles().length):
(c=d=0,k=!1,m=!k);var t=JS.CmdExt.tokAtArray(c,a);if(4==t&&!k){var l=JS.T.getTokenFromName(JS.SV.sValue(a[0]).toLowerCase());null!=l&&(t=l.tok)}switch(t){case 0:break;case 134221850:case 4138:case 1715472409:return f=this.plot(a),m?f:this.writeMsg(f);case 134222850:b.isArrayParameter(c+1)&&(e=b.stringParameterSet(++c),g=h=".",d=c=b.iToken+1,t=this.tokAt(c));break;default:j=JS.SV.sValue(this.tokenAt(c,a)).toUpperCase()}var A=this.vwr.getExportDriverList(),l=null,x=k?this.slen:a.length,w="",s=null,
p=!1,q=null,z=0,G=null,r=!1,B=null,E=-1,F=-1,v=!1,u=null,I=-2147483648;0!=t&&(k&&1<this.slen&&1073741848==this.tokAt(this.slen-2))&&(j=this.paramAsStr(this.slen-1).toUpperCase(),d=x,x-=2,t=0);switch(t){case 15:case 6:j="VAR";q=this.tokenAt(c++,a);break;case 1073741984:j="INLINE";l=JS.SV.sValue(this.tokenAt(++c,a));c++;break;case 134217762:j="PGRP";c++;w=JS.SV.sValue(this.tokenAt(c,a)).toLowerCase();w.equals("draw")&&c++;break;case 1073742329:c++;r=!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")?h=JS.SV.sValue(this.tokenAt(++c,a)):g=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 1073741929:case 4115:case 4120:case 1073742139:case 4166:case 1073741824:case 4:switch(t){case 4115:c+
1<x&&1073742325==a[++c].tok||10==a[c].tok?(s=b.atomExpression(a,c,0,!0,!1,null,!0),c=b.iToken+1):s=this.vwr.getAllAtoms();this.chk||(B=this.vwr.ms.getModelBS(s,!0));break;case 1073741929:t=4120,p=!0;case 4120:j="IMAGE";c++;break;case 1073742139:s=JS.SV.sValue(this.tokenAt(++c,a)).toUpperCase();JU.PT.isOneOf(s,";PNG;PNGJ;")?(G=s,c++):G="PNG";break;case 4166:z=b.intParameterRange(++c,1,10);if(2147483647==z)return"";this.chk||(this.vwr.tm.setVibrationPeriod(0),b.isJS||b.delayScript(100));c++;break;default:t=
4120}if(4120==t&&c<a.length)if(t=JS.T.getTokenFromName(JS.SV.sValue(a[c]).toLowerCase()),null!=t&&(j=JS.SV.sValue(t).toUpperCase()),JU.PT.isOneOf(j,A.toUpperCase())){c++;j=j.substring(0,1).toUpperCase()+j.substring(1).toLowerCase();v=!0;k&&(u="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)&&(E=JS.SV.iValue(this.tokenAt(c++,a)),0>=E&&this.invArg(),F=JS.SV.iValue(this.tokenAt(c++,a)),0>=F&&this.invArg())}if(d<x){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)&&(E=JS.SV.iValue(this.tokenAt(++c,a)),0>=E&&this.invArg(),F=JS.SV.iValue(this.tokenAt(++c,a)),0>=F&&this.invArg()),2==JS.CmdExt.tokAtArray(c+1,a)&&(I=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;qcjson;")&&
(j=s.toUpperCase(),c+1==x&&c++);j.equals("IMAGE")&&JU.PT.isOneOf(s.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;gift;pdf;ppm;png;pngj;pngt;scene;")&&(j=s.toUpperCase(),I=-2147483648,c++)}c+2==x&&JS.SV.sValue(this.tokenAt(++c,a));switch(JS.CmdExt.tokAtArray(c,a)){case 0:m=!0;break;case 1073741884:break;case 805306401:u=j.equals("IMAGE")?"?jmol.png":"?jmol."+j.toLowerCase();break;case 1073741824:case 4:u=JS.SV.sValue(this.tokenAt(c,a));if(u.equalsIgnoreCase("clipboard")||!this.vwr.haveAccess(JV.Viewer.ACCESS.ALL))u=
null;break;default:this.invArg()}if(j.equals("IMAGE")||j.equals("FRAME")||j.equals("VIBRATION"))j=null!=u&&0<=u.indexOf(".")?u.substring(u.lastIndexOf(".")+1).toUpperCase():"JPG";if(j.equals("ISOSURFACE")||j.equals("CONTACT"))n=j.equals("CONTACT"),j=null!=u&&0<=u.indexOf(".")?u.substring(u.lastIndexOf(".")+1).toUpperCase():"JVXL",j.equals("PMESH")?j="ISOMESH":j.equals("PMB")&&(j="ISOMESHBIN");t=JU.PT.isOneOf(j.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;gift;pdf;ppm;png;pngj;pngt;scene;");if(!t&&(j.equals("MNU")?
j="MENU":j.equals("WRL")||j.equals("VRML")?(j="Vrml",v=!0):j.equals("X3D")?(j="X3d",v=!0):j.equals("STL")?(j="Stl",v=!0):j.equals("IDTF")?(j="Idtf",v=!0):j.equals("MA")?(j="Maya",v=!0):j.equals("JS")?(j="Js",v=!0):j.equals("OBJ")?(j="Obj",v=!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!=u&&0<=u.indexOf(".")?u.substring(u.lastIndexOf(".")+1).toUpperCase():"XYZ";null!=e&&(JV.FileManager.isJmolType(j)||
this.invArg(),j.equals("PNG")&&(j="PNGJ"));!t&&(!v&&!JU.PT.isOneOf(j,";SCENE;JMOL;ZIP;ZIPALL;SPT;HISTORY;MO;NBO;ISOSURFACE;MESH;PMESH;PMB;ISOMESHBIN;ISOMESH;VAR;FILE;FUNCTION;CFI;CIF;CML;JSON;XYZ;XYZRN;XYZVIB;MENU;MOL;MOL67;PDB;PGRP;PQR;QUAT;RAMA;SDF;V2000;V3000;QCJSON;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|CFI|GIF|GIFT|JPG|JPG64|JMOL|JVXL|MESH|MOL|PDB|PMESH|PNG|PNGJ|PNGT|PPM|PQR|SDF|CD|JSON|QCJSON|V2000|V3000|SPT|XJVXL|XYZ|XYZRN|XYZVIB|ZIP"+
A.toUpperCase().$replace(";","|"));if(this.chk)return"";var c=Array(1),y,d=this.vwr.getBoolean(603979934);if(v){d&&JU.Logger.startTimer("export");f=new java.util.Hashtable;f.put("type",j);null!=u&&f.put("fileName",u);(k||null!=u)&&f.put("fullPath",c);f.put("width",Integer.$valueOf(E));f.put("height",Integer.$valueOf(F));l=this.vwr.generateOutputForExport(f);if(null==l||0==l.length)return"";if(m)return l;if(!j.equals("Povray")&&!j.equals("Idtf")||null==c[0])return this.writeMsg(l);f=j.equals("Idtf")?
".tex":".ini";u=c[0]+f;y=new java.util.Hashtable;y.put("fileName",u);y.put("type",f);y.put("text",l);y.put("fullPath",c);f=this.vwr.processWriteOrCapture(y);j.equals("Idtf")&&(l=l.substring(0,l.indexOf("\\begin{comment}")));l="Created "+c[0]+":\n\n"+l;d&&this.showString(JU.Logger.getTimerMsg("export",0));null!=f&&((j=!f.startsWith("OK"))&&b.evalError(f,null),b.report(l,j));return""}v=null;A=!1;if(null==l){x=0;l=j.intern();if("MENU"===l)l=this.vwr.getMenu("");else if("PGRP"===l)l=this.vwr.ms.getPointGroupAsString(this.vwr.bsA(),
null,0,1,null,null,w.equals("draw")?"":null);else if("PDB"===l||"PQR"===l)m?l=this.vwr.getPdbAtomData(null,null,"PQR"===l,r):(A=!0,j="PDB_"+l+"-coord "+r);else if("FILE"===l)"?".equals(u)&&(u="?Jmol."+this.vwr.getP("_fileType")),m?l=this.vwr.getCurrentFileAsString("script"):A=!0;else if("CIF"===l||"SDF"===l||"MOL"===l||"MOL67"===l||"V2000"===l||"V3000"===l||"CD"===l||"JSON"===l||"XYZ"===l||"XYZRN"===l||"XYZVIB"===l||"CML"===l||"QCJSON"===l){a=this.vwr.bsA();f=" ("+a.cardinality()+" atoms)";if(0<=
this.vwr.am.cmi&&!a.equals(y=this.vwr.getModelUndeletedAtomsBitSet(this.vwr.am.cmi)))f+="\nNote! Selected atom set "+a+" is not the same as the current model "+y;l=this.vwr.getModelExtract(a,r,!1,l);l.startsWith("ERROR:")&&(v=l)}else if("CFI"===l)l=this.vwr.getModelFileData("selected","cfi",!1);else if("FUNCTION"===l)l=this.vwr.getFunctionCalls(null),j="TXT";else if("VAR"===l)null==q&&(q=b.getParameter(JS.SV.sValue(this.tokenAt(k?2:1,a)),1073742190,!0)),a=null,15==q.tok?(a=new JU.Lst,a.addLast(q.value.data)):
6==q.tok&&(a=null==u?new JU.Lst:this.prepareBinaryOutput(q)),null==a?(l=q.asString(),j="TXT"):null!=u&&(y=new java.util.Hashtable,y.put("data",a),null==(v=l=this.vwr.createZip(u,1==a.size()||u.endsWith(".png")||u.endsWith(".pngj")?"BINARY":"ZIPDATA",y))&&b.evalError("#CANCELED#",null));else if("SPT"===l)if(r)y=this.vwr.ms.getTaintedAtoms(2),this.vwr.setAtomCoordsRelative(JU.P3.new3(0,0,0),null),l=this.vwr.getStateInfo(),this.vwr.ms.setTaintedAtoms(y,2);else{if(l=this.vwr.getStateInfo(),null!=h||null!=
g)l=JV.FileManager.setScriptFileReferences(l,h,g,null)}else"ZIP"===l||"ZIPALL"===l?null!=u&&(y=new java.util.Hashtable,null!=e&&y.put("data",e),null==(v=l=this.vwr.createZip(u,j,y))&&b.evalError("#CANCELED#",null)):"HISTORY"===l?(l=this.vwr.getSetHistory(2147483647),j="SPT"):"MO"===l||"NBO"===l?(l=this.getMoJvxl(2147483647,"NBO"===l),j="XJVXL"):"PMESH"===l||"PMB"===l?(null==(l=this.getIsosurfaceJvxl(29,l))&&this.error(31),j="XJVXL"):"ISOMESH"===l?(null==(l=this.getIsosurfaceJvxl(24,l))&&this.error(31),
j="PMESH"):"ISOMESHBIN"===l?(null==(v=this.getIsosurfaceJvxl(24,"ISOMESHBIN"))&&this.error(31),j="PMB"):"ISOSURFACE"===l||"MESH"===l?(null==(l=this.getIsosurfaceJvxl(n?25:24,l))&&this.error(31),j=0<=l.indexOf("<?xml")?"XJVXL":"JVXL",m||this.showString(this.getShapeProperty(n?25:24,"jvxlFileInfo"))):(k&&(m&&null==u)&&(m=!1,u="\u0001"),x=-1,null==G&&0>I&&(I=-1));null==l&&(l="");0==x&&(null==v||M(v,String))}if(!k)return l;if(m)return b.showStringPrint(l,!0),"";if(null!=v&&M(v,String))return this.writeMsg(v);
if(A)return this.writeMsg(this.vwr.writeFileData(u,j,0,null));if(j.equals("SCENE"))v=G;else if(null==v&&(!t||null!=u))v=l;d&&JU.Logger.startTimer("write");t&&(b.refresh(!1),0>E&&(E=p?250:this.vwr.getScreenWidth()),0>F&&(F=p?250:this.vwr.getScreenHeight()));y=new java.util.Hashtable;null!=u&&y.put("fileName",u);y.put("backgroundColor",Integer.$valueOf(this.vwr.getBackgroundArgb()));y.put("type",j);if(p){y.put("is2D",Boolean.TRUE);var L,b="smiles could not be generated";try{if(L=this.vwr.getOpenSmiles(null),
0<L.length){var K=this.vwr.setLoadFormat("_"+L,"2",!1),K=K+("?width="+E+"&height="+F+"&format="+j.toLowerCase());this.showString(K);b=this.vwr.fm.getFileAsBytes(K,null)}}catch(H){if(!Q(H,Exception))throw H;}if(M(b,String))return this.showString(b),null;v=b}M(v,String)&&-2147483648==I?y.put("text",v):M(v,Array)&&y.put("bytes",v);null!=e&&y.put("scripts",e);null!=B&&y.put("bsFrames",B);y.put("fullPath",c);y.put("quality",Integer.$valueOf(I));y.put("width",Integer.$valueOf(E));y.put("height",Integer.$valueOf(F));
y.put("nVibes",Integer.$valueOf(z));b=this.vwr.processWriteOrCapture(y);null==b&&(b="canceled");t&&b.startsWith("OK")&&(b+="; width="+E+"; height="+F);d&&this.showString(JU.Logger.getTimerMsg("write",0));return this.writeMsg(b+(null==f?"":f))},"~A");k(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 d=c.getKey();if(!d.equals("$_BINARY_$")){var e=c.getValue(),
f=15==e.tok?e.value.data:null;null==f&&(e=e.asString(),f=e.startsWith(";base64,")?JU.Base64.decodeBase64(e):e.getBytes());if(d.equals("_DATA_")){a=new JU.Lst;a.addLast(f);break}else d.equals("_IMAGE_")?(a.add(0,d),a.add(1,null),a.add(2,f)):(a.addLast(d),a.addLast(null),a.addLast(f))}}return a},"JS.SV");k(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");k(c$,"show",function(){var a=this.e,b=null,
c=this.paramAsStr(1),d=null,e=0;3<this.slen&&268435632==this.tokAt(this.slen-3)&&268435568==this.tokAt(this.slen-2)?(d="!/"+this.paramAsStr(this.slen-1),this.slen-=3,e=3):2<this.slen&&268435632==this.tokAt(this.slen-2)?(d="/"+this.paramAsStr(this.slen-1),this.slen-=2,e=2):0==(d=this.paramAsStr(this.slen-1)).lastIndexOf("/")?(this.slen--,e=1):d=null;var f=null,h=null,g=2,j=this.getToken(1),h=M(j,JS.SV)&&1073741824!=j.tok?0:j.tok;4==h&&(j=JS.T.getTokenFromName(c.toLowerCase()),null!=j&&(h=j.tok));1296041986!=
h&&(1073742158!=h&&1715472409!=h&&1228935687!=h)&&this.checkLength(-3);2==this.slen&&0<=c.indexOf("?")&&(f=this.vwr.getAllSettings(c.substring(0,c.indexOf("?"))),h=-1);switch(h){case 0:this.chk||(f=a.theToken.escape());break;case 1073741925:a.checkLength23();g=this.st.length;this.chk||(f=this.vwr.getModelInfo("domains"),f=M(f,JS.SV)?this.vwr.getAnnotationInfo(f,a.optParameterAsString(2),1073741925):"domain information has not been loaded");break;case 1715472409:f=this.plot(this.st);g=this.st.length;
break;case 1073742189:a.checkLength23();g=this.st.length;this.chk||(f=this.vwr.getModelInfo("validation"),f=M(f,JS.SV)?this.vwr.getAnnotationInfo(f,a.optParameterAsString(2),1073742189):"validation information has not been loaded");break;case 134221829:this.chk||(f=JU.Escape.e(this.vwr.fm.cacheList()));break;case 1111490587:a.checkLength23();g=this.st.length;this.chk||(f=this.vwr.getModelInfo("dssr"),f=null==f?"no DSSR information has been read":2<g?JS.SV.getVariable(this.vwr.extractProperty(f,this.stringParameter(2),
-1)).asString():""+JS.SV.getVariable(f).asString());break;case 1073741915:h=2;3==this.slen?h=P(this.floatParameter((g=3)-1)):this.checkLength(2+e);this.chk||(f=this.vwr.calculateStructures(null,!0,!1,h));break;case 545259572:this.checkLength(2+e);this.chk||(f=this.vwr.fm.getPathForAllFiles());break;case 1275203608:if(!this.chk){var k=Array(2);this.vwr.shm.getShapePropertyData(21,"allInfo",k);f=JS.SV.getVariable(k[1]).asString()}break;case 1073742038:this.chk||this.vwr.getNMRPredict(a.optParameterAsString(2));
return;case 603983903:!this.chk&&3==this.slen&&(f=""+this.vwr.getModelkitProperty(a.stringParameter(2)),g=3);break;case 1275068433:case 1073741978:case 1073741929:case 1073741879:case 134218757:this.checkLength((1073741879==h||134218757==h&&1073742335==this.tokAt(2)?g=3:2)+e);if(this.chk)return;var m=a.optParameterAsString(2);1073741879==h&&("mf".equals(m)&&(m="formula"),"formula".equals(m)&&(f=this.vwr.getModelInfo("formula"),null!=f&&(f=JU.PT.rep(f," ",""))));if(null==f){try{switch(h){case 1275068433:f=
this.vwr.getInchi(this.vwr.bsA(),null,null);break;case 1073741978:f=this.vwr.getInchi(this.vwr.bsA(),null,"key");break;case 134218757:m.equalsIgnoreCase("true")?(f=this.vwr.getBioSmiles(null),d=null):null!=d&&(f=this.vwr.getSmilesOpt(null,-1,-1,1,d+"///"),d=null);break;default:f=this.vwr.ms.getModelDataBaseName(this.vwr.bsA()),f=null!=f&&(f.startsWith("$")||f.startsWith(":"))?f.substring(1):null}null==f&&(k=JU.Logger.getLogLevel(),JU.Logger.setLogLevel(4),f=134218757==h?this.vwr.getSmiles(null):this.vwr.getOpenSmiles(null),
JU.Logger.setLogLevel(k))}catch(n){if(Q(n,Exception))f=n.getMessage(),null==f&&(f=""),n.printStackTrace();else throw n;}switch(h){case 1073741929:if(0<f.length){this.vwr.fm.loadImage(this.vwr.setLoadFormat("_"+f,"2",!1),"\u0001"+f,!1);return}f="Could not show drawing -- Either insufficient atoms are selected or the model is a PDB file.";break;case 1073741879:g=3,0<f.length?(f=this.vwr.getChemicalInfo(f,m,this.vwr.bsA()),0<=f.indexOf("FileNotFound")&&(f="?")):f="Could not show name -- Either insufficient atoms are selected or the model is a PDB file."}}break;
case 134217764:case 1296041986:f="";k=null;if(2==(g=this.slen)){if(this.chk)break;k=this.vwr.getSymTemp().getSpaceGroupInfo(this.vwr.ms,null,-1,!1,null)}else if(134217764==h){k=this.paramAsStr(2);g=3;if(this.chk)break;k=this.vwr.getSymTemp().getSpaceGroupInfo(this.vwr.ms,JU.PT.rep(k,"''",'"'),-1,!1,null)}if(null!=k){f=(134217764==h?""+k.get("spaceGroupInfo")+k.get("spaceGroupNote"):"")+k.get("symmetryInfo");break}var h=2==this.tokAt(2)?this.intParameter(2):0,k=4==this.tokAt(2)||12==this.tokAt(2)?
this.paramAsStr(2):null,j=m=null,t=-1;if(3<this.slen&&4!=this.tokAt(3)){g=z(-1,[null,this.vwr.getFrameAtoms()]);m=a.centerParameter(2+(0==h?0:1),g);if(null!=g[0]&&0==g[0].cardinality()){g=this.slen;break}g[0]=null;j=a.centerParameter(++a.iToken,g);if(null!=g[0]&&0==g[0].cardinality()){g=this.slen;break}0==h&&2==this.tokAt(a.iToken+1)&&(t=a.getToken(++a.iToken).intValue)}var l=1<a.iToken&&4==this.tokAt(a.iToken+1)?this.stringParameter(++a.iToken):null;this.checkLength((g=++a.iToken)+e);this.chk||(f=
this.vwr.getSymmetryInfo(this.vwr.getAllAtoms().nextSetBit(0),k,h,null,m,j,0,l,0,t,0),f=M(f,java.util.Map)?JS.SV.getVariable(f).asString():f.toString());break;case 1648363544:h=null;2<this.slen&&(g=this.slen,h=J.c.VDW.getVdwType(this.paramAsStr(2)),null==h&&this.invArg());this.chk||(f=this.vwr.getDefaultVdwNameOrData(0,h,null));break;case 134320141:a.checkLength23();g=this.slen;h=a.optParameterAsString(2);if(null==d&&0<=(m=h.indexOf("/")))d=h.substring(m+1),h=h.substring(0,m);this.chk||(f=this.vwr.getFunctionCalls(h));
break;case 36867:this.checkLength(2+e);this.chk||(f=this.vwr.getAllSettings(null));break;case 1073742166:f=this.vwr.getFrameTitle();break;case 1073742184:2==this.slen?this.chk||this.vwr.showUrl(a.getFullPathName()):(h=this.paramAsStr(2),this.chk||this.vwr.showUrl(h));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);f=this.plot(this.st);g=this.slen;
break;case 14:case 1112152078:this.chk||(f=this.getContext(!1));break;case 1073741888:h=a.optParameterAsString(2);0<h.length&&(g=3);this.chk||(b=this.vwr.cm.getColorSchemeList(h));break;case 1073742192:this.chk||(f=this.vwr.getAtomDefs(this.vwr.definedAtomSets)+this.vwr.g.getVariableList()+this.getContext(!0));break;case 536870926:this.chk||(f=this.vwr.getTrajectoryState());break;case 553648146:b=""+JS.ScriptEval.commandHistoryLevelMax;break;case 553648149:b=""+JU.Logger.getLogLevel();break;case 603979825:b=
""+this.vwr.getBoolean(603979825);break;case 553648178:f="set strandCountForStrands "+this.vwr.getStrandCount(12)+"; set strandCountForMeshRibbon "+this.vwr.getStrandCount(13);break;case 536875070:f=this.vwr.showTimeout(2==(g=this.slen)?null:this.paramAsStr(2));break;case 536870918:b=JU.Escape.eP(this.vwr.getDefaultLattice());break;case 4126:this.chk||(f=this.vwr.getMinimizationInfo());break;case 1611272194:switch(this.vwr.g.axesMode){case 603979808:f="set axesUnitcell";break;case 603979804:f="set axesMolecular";
break;default:f="set axesWindow"}break;case 1610612737:f="set bondMode "+(this.vwr.getBoolean(603979812)?"OR":"AND");break;case 1649022989:this.chk||(f="set strandCountForStrands "+this.vwr.getStrandCount(12)+"; set strandCountForMeshRibbon "+this.vwr.getStrandCount(13));break;case 1613238294:f="set hbondsBackbone "+this.vwr.getBoolean(603979852)+";set hbondsSolid "+this.vwr.getBoolean(603979854);break;case 1611141175:this.chk||(f=this.vwr.getSpinState());break;case 1611141176:f="set ssbondsBackbone "+
this.vwr.getBoolean(603979952);break;case 1610625028:case 1611141171:f="selectionHalos "+(this.vwr.getSelectionHalosEnabled()?"ON":"OFF");break;case 1612709894:f="set selectHetero "+this.vwr.getBoolean(1612709894);break;case 1073741828:f=JU.Escape.eAP(this.vwr.getAdditionalHydrogens(null,null,768));break;case 1612709900:f="set selectHydrogens "+this.vwr.getBoolean(1612709900);break;case 553648130:case 553648140:case 536870924:case 553648176:case 553648172:case 1073741995:this.chk||(f=this.vwr.getLightingState());
break;case 1073742136:case 4146:this.chk||(f=this.vwr.stm.listSavedStates());break;case 1814695966:this.chk||(f=this.vwr.getUnitCellInfoText());break;case 1073742329:if(2==(g=this.slen)){this.chk||(f=this.vwr.getCoordinateState(this.vwr.bsA()));break}h=this.paramAsStr(2);this.chk||(f=this.vwr.stm.getSavedCoordinates(h));break;case 1073742158:!this.chk&&(null==a.outputBuffer&&null==d)&&this.vwr.sm.clearConsole();if(2==(g=this.slen)){this.chk||(f=this.vwr.getStateInfo());break}if(null!=d&&3==this.slen){this.chk||
(f=this.vwr.getStateInfo());break}else if(1228935687==this.tokAt(2)&&4==(g=this.slen)){this.chk||(f=this.vwr.fm.getEmbeddedFileState(this.paramAsStr(3),!0,"state.spt"));break}g=3;h=this.paramAsStr(2);this.chk||(f=this.vwr.stm.getSavedState(h));break;case 1639976963:if(2==(g=this.slen)){this.chk||(f=this.vwr.ms.getProteinStructureState(this.vwr.bsA(),134222350));break}h=this.paramAsStr(2);this.chk||(f=this.vwr.stm.getSavedStructure(h));break;case 134221834:h=3==(g=this.slen)?this.paramAsStr(2):null;
this.chk||(f=this.vwr.getDataObj(h,null,-2),f=null==f?"no data":JU.Escape.encapsulateData(f[0],f[1],f[3].intValue()));break;case 1073742330:g=3;f=a.setObjectProperty();break;case 1678381065:this.chk||(f=this.vwr.ms.getBoundBoxCommand(!0));break;case 12289:this.chk||(f="center "+JU.Escape.eP(this.vwr.tm.fixedRotationCenter));break;case 135176:this.chk||(f=this.getShapeProperty(22,"command"));break;case 1228935687:if(2==this.slen){this.chk||(null==d&&this.vwr.sm.clearConsole(),f=this.vwr.getCurrentFileAsString("script"));
null==f&&(f="<unavailable>");break}g=3;b=this.paramAsStr(2);this.chk||(null==d&&this.vwr.sm.clearConsole(),f=this.vwr.getFileAsString3(b,!0,null));break;case 4115:f=1073742327==this.tokAt(2)&&0<(g=3)?this.vwr.getModelFileInfoAll():this.vwr.getModelFileInfo();break;case 1610616855:h=2==(g=this.slen)?2147483647:this.intParameter(2);1>h&&this.invArg();this.chk||(this.vwr.sm.clearConsole(),0==a.scriptLevel&&this.vwr.removeCommand(),f=this.vwr.getSetHistory(h));break;case 135180:this.chk||(f=this.getShapeProperty(24,
"jvxlDataXml"));break;case 1073877011:case 1073877010:a.optParameterAsString(2).equalsIgnoreCase("list")?(this.e.sm.loadShape(27),f=this.chk?"":this.getShapeProperty(27,"list -1"),g=3):(k=2==(g=this.slen)?-2147483648:this.intParameter(2),this.chk||(f=this.getMoJvxl(k,1073877011==h)));break;case 1094717454:this.chk||(f=this.vwr.ms.getModelInfoAsString());break;case 537006096:this.chk||(f=this.vwr.getMeasurementInfoAsString());break;case 1073741864:g=3;!this.chk&&this.slen==g&&(f=this.paramAsStr(2),
f=this.vwr.getOrientationText(JS.T.getTokFromName(f.equals("box")?"volume":f.equals("rotation")?"best":f),"best",null).toString());break;case 1073742132:h=this.tokAt(2),0==h?h=1073742132:g=3;case 1073742178:case 4129:this.chk||(f=this.vwr.getOrientationText(h,null,null).toString());break;case 1073742077:g=2;if(3<this.slen)break;switch(h=this.tokAt(2)){case 1073742178:case 1073742132:case 4129:case 0:this.chk||(f=this.vwr.getOrientationText(h,null,null).toString());break;default:h=a.optParameterAsString(2),
f=this.vwr.getOrientationText(1073742034,h,null).toString()}g=this.slen;break;case 1073742088:this.chk||(f=this.vwr.ms.getPDBHeader(this.vwr.am.cmi));break;case 134217762:h=a.optParameterAsString(2);0==h.length&&(h=null);g=this.slen;this.chk||(f=this.vwr.ms.getPointGroupAsString(this.vwr.bsA(),"show:"+h,0,0,null,null,null));break;case 1088421903:this.chk||(f=this.vwr.ms.getSymmetryInfoAsString());break;case 1073742176:this.chk||(f="transform:\n"+this.vwr.tm.matrixRotate.toString());break;case 4168:f=
"zoom "+(this.vwr.tm.zoomEnabled?""+this.vwr.tm.getZoomSetting():"off");break;case 1611272202:f=this.vwr.getShowFrank()?"frank ON":"frank OFF";break;case 1665140738:c="solventProbeRadius";break;case 1086324744:if(3==(g=this.slen)&&1073742334==this.tokAt(2))h=1086324743;case 1073741863:case 1086326788:case 1073742120:case 1113589787:case 1086324742:case 1140850689:case 1073741982:this.chk||(f=this.vwr.getChimeInfo(h));break;case 537022465:case 1610612738:case 20482:case 1612709912:b="?";break;case 1073742030:h=
2==(g=this.slen)?null:this.paramAsStr(2);this.chk||(f=this.vwr.getBindingInfo(h));break;case 1073742015:this.chk||(b=this.vwr.getMenu(""));break;case 1073741824:c.equalsIgnoreCase("fileHeader")&&(this.chk||(f=this.vwr.ms.getPDBHeader(this.vwr.am.cmi)));break;case 1073741992:case 36868:c=this.paramAsStr(g++),k=a.getParameter(c,1073742190,!0),this.chk||(f=1073741992==h?k.toJSON():k.escape())}this.checkLength(g+e);this.chk||(null!=f?this.showString(this.filterShow(f,d)):null!=b?this.showString(c+" = "+
b):null!=c&&(0<=c.indexOf(" ")?this.showString(c):this.showString(c+" = "+a.getParameter(c,1073742190,!0).escape())))});k(c$,"filterShow",function(a,b){if(null==b)return a;var c=b.startsWith("!/");b=b.substring(c?2:1).toLowerCase();for(var d=JU.PT.split(a,"\n"),e=new JU.SB,f=0;f<d.length;f++)0>d[f].toLowerCase().indexOf(b)==c&&e.append(d[f]).appendC("\n");return e.toString()},"~S,~S");k(c$,"stereo",function(){for(var a=J.c.STER.DOUBLE,b=-5,c=!1,d=null,e=0,f=1;f<this.slen;++f)if(this.e.isColorParam(f))1<
e&&this.e.bad(),0==e&&(d=G(2,0)),c||(b=3),d[e]=this.e.getArgbParam(f),0==e++&&(d[1]=~d[0]),f=this.e.iToken;else switch(this.getToken(f).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(f);c=!0;break;case 1073741824:if(c||(b=3),a=J.c.STER.getStereoMode(this.paramAsStr(f)),null!=a)break;default:this.invArg()}this.chk||this.vwr.setStereoMode(d,a,b)});k(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});k(c$,"unitcell",function(a){var b=this.e,c=2147483647,d=2147483647,e=null,f=b.tickParamAsStr(a,!0,!1,!1);a=b.iToken;var h=null,g=null,j=null,k=null,m=d=!1;switch(this.tokAt(++a)){case 4142:case 4141:m=
!0;e=JU.P4.new4(0,0,0,-1);b.iToken++;break;case 4:case 1073741824:var n=this.paramAsStr(a).toLowerCase(),k=n;if(0<=n.indexOf(",")||this.chk){j=n;break}d=null;b.setModelCagePts(-1,null,null);j=this.vwr.getModelInfo("unitcell_conventional");if(JU.PT.isOneOf(k,";parent;standard;primitive;")){if(null==j&&null!=this.vwr.getModelInfo("isprimitive")){this.showString("Cannot convert unit cell when file data is primitive and have no lattice information");return}k.equals("primitive")&&4==this.tokAt(a+1)&&(d=
this.paramAsStr(++a).toUpperCase())}M(j,Array)&&(g=j);null==d&&(d=this.vwr.getModelInfo("latticeType"));null!=j&&b.setModelCagePts(-1,this.vwr.getV0abc(-1,j),""+j);if(!k.equals("conventional")){n=this.vwr.getModelInfo("unitcell_"+k);if(null==n){if((n=k.equals("primitive"))||k.equals("reciprocal")){var t=this.slen==a+1?1:2==this.tokAt(a+1)?3.141592653589793*this.intParameter(++a):this.floatParameter(++a),l=this.vwr.getCurrentUnitCell(),k=(null==l?"":l.getSpaceGroupName()+" ")+k,g=null==l?z(-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)]):l.getUnitCellVectors();null==d&&(d=this.vwr.getSymmetryInfo(this.vwr.getFrameAtoms().nextSetBit(0),null,0,null,null,null,1073741994,null,0,-1,0));null==l&&(l=this.vwr.getSymTemp());l.toFromPrimitive(!0,0==d.length?"P":d.charAt(0),g,this.vwr.getCurrentModelAuxInfo().get("primitiveToCrystal"));n||JU.SimpleUnitCell.getReciprocal(g,g,t);break}}else k=n,0<=n.indexOf(",")&&(j=n);this.showString(k)}break;case 135180:case 1073742330:h=b.objectNameParameter(++a);
break;case 1678381065:g=JU.P3.newP(this.vwr.getBoundBoxCenter());e=this.vwr.getBoundBoxCornerVector();g.sub(e);g=z(-1,[g,JU.P3.new3(2*e.x,0,0),JU.P3.new3(0,2*e.y,0),JU.P3.new3(0,0,2*e.z)]);e=null;b.iToken=a;break;case 1073742176:12!=this.tokAt(++a)&&this.invArg();j=z(-1,[this.getToken(a).value]);break;case 11:case 12:j=this.getToken(a).value;break;case 12289:switch(this.tokAt(++a)){case 12290:case 10:case 1073742325:e=this.vwr.ms.getAtomSetCenter(this.atomExpressionAt(a));this.vwr.toFractional(e,
!0);a=b.iToken;break;default:if(b.isCenterParameter(a)){e=this.centerParameter(a);a=b.iToken;break}this.invArg()}e.x-=0.5;e.y-=0.5;e.z-=0.5;break;case 12290:case 10:case 1073742325:a=this.atomExpressionAt(a).nextSetBit(0);this.chk||this.vwr.am.setUnitCellAtomIndex(a);if(0>a)return;a=b.iToken;break;case 1073742066:d=!0;case 1073742114:e=b.getPointOrPlane(++a,!1,!0,!1,!0,3,3,!0);e=JU.P4.new4(e.x,e.y,e.z,d?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)?(g=b.getPointArray(a,4,!1),a=b.iToken):this.slen>a+1?(e=b.getPointOrPlane(a,!1,!0,!1,!0,3,3,!0),a=b.iToken):a--}d=b.getSetAxesTypeMad10(++a);b.checkLast(b.iToken);this.chk||2147483647==d||(2147483647==d&&this.vwr.am.setUnitCellAtomIndex(-1),null==g&&null!=j&&(g=this.vwr.getV0abc(-1,j)),2147483647!=c?this.vwr.ms.setUnitCellOffset(this.vwr.getCurrentUnitCell(),null,c):null!=h?this.vwr.setCurrentCage(h):(m||null!=g)&&b.setModelCagePts(-1,g,k),b.setObjectMad10(33,"unitCell",
d),null!=e&&this.vwr.ms.setUnitCellOffset(this.vwr.getCurrentUnitCell(),e,0),null!=f&&this.setShapeProperty(33,"tickInfo",f))},"~N");k(c$,"assign",function(){var a=1073742335==this.tokAt(this.slen-1),b=++this.e.iToken,c=this.tokAt(b),d=-1,e=-1,f=1677721602==c,h=4106==c;1140850689==c||f||h?b++:c=1140850689;var g=this.vwr.getModelUndeletedAtomsBitSet(this.vwr.am.cmi);if(f){if(M(this.getToken(b).value,JM.BondSet))d=this.getToken(b).value.nextSetBit(0);else switch(b=this.expFor(b,g),d=b.nextSetBit(0),
b.cardinality()){case 1:b=this.expFor(++this.e.iToken,g),e=b.nextSetBit(0),0>e&&this.invArg(),b.set(d);case 2:b=this.vwr.ms.getBondsForSelectedAtoms(b,!1);0<b.cardinality()?d=b.nextSetBit(0):(h=!0,c=4106);break;default:this.invArg()}b=++this.e.iToken}else if(!(1140850689==c&&4==this.tokAt(b))){b=this.expFor(b,g);d=b.nextSetBit(0);if(0>d)return;b=++this.e.iToken}f=null;h?0>e&&(b=this.expFor(b,g),e=b.nextSetBit(0)):f=this.e.optParameterAsString(b);h=++this.e.iToken<(a?this.slen-1:this.slen)?this.centerParameter(this.e.iToken):
null;if(!this.chk)switch(this.vwr.pushState(),c){case 1140850689:this.e.clearDefinedVariableAtomSets();this.vwr.getModelkit(!1).cmdAssignAtom(d,h,f,this.e.fullCommand,a);break;case 1677721602:this.vwr.getModelkit(!1).cmdAssignBond(d,(f+"p").charAt(0),this.e.fullCommand);break;case 4106:this.vwr.getModelkit(!1).cmdAssignConnect(d,e,this.e.fullCommand)}});k(c$,"expFor",function(a,b){var c=JU.BS.copy(this.atomExpressionAt(a));c.and(b);return c},"~N,JU.BS");k(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");k(c$,"getIsosurfaceJvxl",function(a,b){return this.chk?"":this.getShapeProperty(a,"PMESH"===b||"MESH"===b?"jvxlMeshX":"ISOMESH"===b?"pmesh":"ISOMESHBIN"===b||"PMB"===b?"pmeshbin":"jvxlDataXml")},"~N,~S");k(c$,"getMoJvxl",function(a,b){var c=b?28:27;this.e.sm.loadShape(c);var d=this.vwr.am.cmi;0>d&&this.e.errorStr(30,"show/write MO/NBO");var e=this.vwr.ms.getInfo(d,"moData");null==e&&this.error(27);var f=this.getShapeProperty(c,"moNumber");(null==f||0==f.intValue())&&this.setShapeProperty(c,
"init",Integer.$valueOf(d));this.setShapeProperty(c,"moData",e);return this.e.sm.getShapePropertyIndex(c,"showMO",a)},"~N,~B");k(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");k(c$,"tokenAt",function(a,b){return a<b.length?b[a]:null},"~N,~A");c$.tokAtArray=k(c$,"tokAtArray",function(a,b){return a<b.length&&null!=b[a]?b[a].tok:0},"~N,~A");
k(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 d=a.length;0<=--d;){var e=a[d];Float.isNaN(e)||b==e>c&&(c=e)}return c},"~A,~B,~N");k(c$,"parseDataArray",function(a,b){a=JU.Parser.fixDataString(a);var c=JU.Parser.markLines(a,"\n"),d=c.length;if(!b){for(var e=JU.AU.newFloat2(d),f=0,h=0;f<d;h=c[f++])h=JU.PT.getTokens(a.substring(h,
c[f])),JU.PT.parseFloatArrayData(h,e[f]=O(h.length,0));return e}h=JU.PT.getTokens(a.substring(0,c[0]));if(3!=h.length)return O(0,0,0,0);var g=JU.PT.parseInt(h[0]),j=JU.PT.parseInt(h[1]),k=JU.PT.parseInt(h[2]);if(1>g||1>j||1>k)return O(1,1,1,0);for(var e=JU.AU.newFloat3(g,j),m=0,n=0,f=1,h=c[0];f<d&&m<g;h=c[f++])h=JU.PT.getTokens(a.substring(h,c[f])),h.length<k||(JU.PT.parseFloatArrayData(h,e[m][n]=O(h.length,0)),++n==j&&(m++,n=0));return m!=g?(System.out.println("Error reading 3D data -- nX = "+g+
", but only "+m+" blocks read"),O(1,1,1,0)):e},"~S,~B");k(c$,"getBitsetPropertyFloat",function(a,b,c,d,e){b=null==c||1111490843==b?this.e.getBitsetProperty(a,null,b,null,null,c,null,!1,2147483647,!1):this.vwr.getDataObj(c,a,1);if(null==b||!JU.AU.isAF(b))return null==a?null:O(a.cardinality(),0);if(!Float.isNaN(d))for(a=0;a<b.length;a++)b[a]<d&&(b[a]=NaN);if(!Float.isNaN(e))for(a=0;a<b.length;a++)b[a]>e&&(b[a]=NaN);return b},"JU.BS,~N,~S,~N,~N");Y(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);
