(function(la,ma,na,oa,U,pa,V,A,W,Z,$,aa,qa,ka,ra,L,M,C,ja,sa,ta,ua,va,wa,xa,ya,za,H,Aa,Ba,Ca,Da,Ea,Fa,Ga,Ha,Ia,Ja,Ka,La,Ma,Na,Oa,Pa,Qa,Ra,Sa,Ta,Ua,Va,Wa,Xa,Ya,Za,$a,t){V("JS");W(null,"JS.MathExt","java.util.Date $.Hashtable $.Random JU.AU $.BArray $.BS $.CU $.Lst $.M3 $.M4 $.Measure $.OC $.P3 $.P4 $.PT $.Quat $.Rdr $.SB $.V3 J.api.Interface J.atomdata.RadiusData J.bspt.PointIterator J.c.VDW J.i18n.GT JM.BondSet $.Measurement JS.SV $.T JU.BSUtil $.BoxInfo $.Edge $.Escape $.JmolMolecule $.Logger $.Parser $.Point3fi $.SimpleUnitCell JV.FileManager $.JC $.Viewer".split(" "),
function(){var p=$(function(){this.pm=this.rand=this.e=this.vwr=null;Z(this,arguments)},JS,"MathExt",null);t(p,"init",function(e){this.e=e;this.vwr=this.e.vwr;return this},"~O");t(p,"evaluate",function(e,a,b,d){switch(d){case 134218760:return 1<=b.length&&4==b[0].tok?e.addXStr((1==b.length?(new java.util.Date).toString():this.vwr.apiPlatform.getDateFormat(JS.SV.sValue(b[1])))+"\t"+JS.SV.sValue(b[0]).trim()):e.addXInt(System.currentTimeMillis()-JS.MathExt.t0-(0==b.length?0:b[0].asInt()));case 134218250:return 1==
b.length&&2==b[0].tok?e.addXInt(b[0].intValue):e.addXFloat(Math.abs(b[0].asFloat()));case 134218241:case 134218245:case 134218244:case 134218246:return 1==b.length&&this.evaluateMath(e,b,d);case 1275069441:case 1275068928:case 1275068929:case 1275068930:case 1275068931:case 1275335685:case 1275334681:return this.evaluateList(e,a.intValue,b);case 268437504:0==b.length&&(e.wasX=!1);case 1275068418:return this.evaluateArray(e,b,1275068418==d&&268442113==a.tok);case 134217765:return this.evaluateCallbackParam(e,
b);case 134217731:case 134221850:return this.evaluateQuaternion(e,b,d);case 1275068420:return this.evaluateBin(e,b);case 134221829:return this.evaluateCache(e,b);case 1275068934:case 1275068935:return this.evaluateRowCol(e,b,d);case 1765808134:return this.evaluateColor(e,b);case 134221831:return this.evaluateCompare(e,b);case 1228931586:case 134217736:case 1275203608:return this.evaluateConnected(e,b,d,a.intValue);case 1812599299:case 1814695966:return this.evaluateUnitCell(e,b,268442113==a.tok,268442113==
a.tok?a.intValue:a.tok);case 134353926:return this.evaluateContact(e,b);case 134221834:return this.evaluateData(e,b);case 1275069444:case 1275069442:return this.evaluateDotDist(e,b,d,a.intValue);case 1275069443:if(268442113==a.tok)return this.evaluateDotDist(e,b,d,a.intValue);case 134217729:case 1745489939:return this.evaluateMeasure(e,b,a.tok);case 1228935687:case 134223363:return this.evaluateLoad(e,b,1228935687==d);case 1275068427:return this.evaluateFind(e,b);case 1275068433:return this.evaluateInChI(e,
b);case 1287653388:case 1825200146:return this.evaluateFormat(e,a.intValue,b,1825200146==d);case 134320141:return this.evaluateUserFunction(e,a.value,b,a.intValue,268442113==a.tok);case 1275068437:d=1275068725;case 1275068446:case 1275068725:case 1275082241:case 1275072526:return this.evaluateGetProperty(e,b,d,268442113==a.tok);case 136314895:return this.evaluateHelix(e,b);case 134219777:case 134217750:case 134217763:return this.evaluatePlane(e,b,d);case 134218759:case 134238732:case 134222850:case 134222350:return this.evaluateScript(e,
b,d);case 1275069446:case 1275069447:case 1275068932:return this.evaluateString(e,a.intValue,b);case 134217751:return this.evaluatePoint(e,b);case 1275068447:return this.evaluatePointGroup(e,b,268442113==a.tok);case 134256129:return this.evaluatePrompt(e,b);case 134219266:return this.evaluateRandom(e,b);case 1275068432:return this.evaluateIn(e,b);case 1275072532:return this.evaluateModulation(e,b);case 1275068443:return this.evaluateReplace(e,b);case 134218753:case 134218756:case 134218757:case 1237320707:return this.evaluateSubstructure(e,
b,d,268442113==a.tok);case 1275068444:case 1275068425:return this.evaluateSort(e,b,d);case 134217764:return this.evaluateSpacegroup(e,b);case 1296041985:return this.evaluateSymop(e,b,268442113==a.tok);case 1275068445:return this.evaluateTensor(e,b);case 134217759:return this.evaluateWithin(e,b,268442113==a.tok);case 134221856:return this.evaluateWrite(e,b)}return!1},"JS.ScriptMathProcessor,JS.T,~A,~N");t(p,"evaluateCallbackParam",function(e,a){return e.addX(this.e.getCallbackParameter(0==a.length?
-2147483648:a[0].asInt()))},"JS.ScriptMathProcessor,~A");t(p,"evaluateSpacegroup",function(e,a){var b=null;switch(a.length){case 0:return e.addXObj(this.vwr.getSymTemp().getSpaceGroupInfo(this.vwr.ms,null,this.vwr.am.cmi,!0,null));case 2:if(b=JS.SV.flistValue(a[1],0),6!=b.length)return!1;case 1:var d=null,c=null;if(4==a[0].tok){c=a[0].asString();if(c.toUpperCase().startsWith("ITA/"))return e.addXObj(this.vwr.getSymTemp().getSpaceGroupJSON(this.vwr,"ITA",c.substring(4),0));if(c.toUpperCase().startsWith("AFLOW/"))return e.addXObj(this.vwr.getSymTemp().getSpaceGroupJSON(this.vwr,
"AFLOW",c.substring(6),0));if(0>c.indexOf("x")&&null==b)return e.addXObj(this.vwr.getSymTemp().getSpaceGroupInfoObj(c,null,!0,!1))}else if(null==(d=JS.SV.getBitSet(a[0],!0)))return e.addXObj(this.vwr.getSymTemp().getSpaceGroupInfoObj(""+a[0].asString(),b,!0,!1));return e.addXObj(this.vwr.findSpaceGroup(d,c,b,null==c,!1));default:return!1}},"JS.ScriptMathProcessor,~A");t(p,"evaluatePointGroup",function(e,a,b){var d=null,c=null,f=-1,j=-1,g=null,h=!1;switch(a.length){case 4:j=a[3].asFloat();case 3:f=
a[2].asFloat();case 2:switch(a[1].tok){case 8:c=JS.SV.ptValue(a[1]);break;case 10:g=JS.SV.getBitSet(a[1],!1),a[0].asString().equalsIgnoreCase("spaceGroup")&&(h=!0,2==a.length&&(f=0))}if(h)break;case 1:switch(a[0].tok){case 7:b=a[0].getList();d=Array(b.size());for(a=d.length;0<=--a;)d[a]=JS.SV.ptValue(b.get(a));break;case 10:g=JS.SV.getBitSet(a[0],!1);d=this.vwr.ms.at;break;case 4:if(b){g=JS.SV.getBitSet(e.getX(),!0);if(null==g||g.isEmpty())return!1;h=a[0].asString();if("spacegroup".equals(h)){h=!0;
break}}default:return!1}break;case 0:if(!b)return e.addXObj(this.vwr.ms.getPointGroupInfo(null));g=JS.SV.getBitSet(e.getX(),!1);break;default:return!1}if(null!=g){a=g.nextSetBit(0);if(0>a||a>=this.vwr.ms.ac||h&&1!=g.cardinality())return!1;if(h){c=this.vwr.ms.generateCrystalClass(a,JU.P3.new3(NaN,NaN,NaN));d=Array(c.size());for(a=d.length;0<=--a;)d[a]=c.get(a);c=new JU.P3}}d=this.vwr.getSymTemp().setPointGroup(null,c,null==d?this.vwr.ms.at:d,g,!1,0>f?this.vwr.getFloat(570425382):f,0>j?this.vwr.getFloat(570425384):
j,null==g?d.length:g.cardinality(),!0);return e.addXMap(d.getPointGroupInfo(-1,null,!0,null,0,1))},"JS.ScriptMathProcessor,~A,~B");t(p,"evaluateUnitCell",function(e,a,b,d){var c=b?JS.SV.getBitSet(e.getX(),!0):1812599299==d?this.vwr.getAllAtoms():null,f=(null==c?this.vwr.getAllAtoms():c).nextSetBit(0),j=a.length-1;b=1;switch(0>j?0:a[j].tok){case 2:case 3:b=a[j].asFloat(),j--}var g=0>j?0:a[0].tok,h=null,k=null,l=null;switch(g){case 7:k=a[0].getList();break;case 4:if(l=a[0].asString(),1814695966==d)if(0==
l.indexOf("a=")){for(var h=Array(4),s=0;4>s;s++)h[s]=new JU.P3;JU.SimpleUnitCell.setOabc(l,null,h)}else if(0<=l.indexOf(","))return e.addXObj(this.vwr.getV0abc(-1,l))}if(1812599299==d)return b=this.vwr.ms.getBoxInfo(c,1),e.addXObj(b.getInfo(l));d=null;s=null!=k;if(null==h&&s&&4>k.size())return!1;l=s?1:0;null==h&&(!s&&8!=g)&&(d=0>f?this.vwr.getCurrentUnitCell():this.vwr.ms.getUnitCell(this.vwr.ms.at[f].mi),h=null==d?H(-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)]):d.getUnitCellVectors());
if(null==h)if(h=Array(4),s)switch(k.size()){case 3:h[0]=new JU.P3;for(s=0;3>s;s++)h[s+1]=JU.P3.newP(JS.SV.ptValue(k.get(s)));break;case 4:for(s=0;4>s;s++)h[s]=JU.P3.newP(JS.SV.ptValue(k.get(s)));break;case 6:g=C(6,0);for(s=0;6>s;s++)g[s]=k.get(s).asFloat();JU.SimpleUnitCell.setOabc(null,g,h);break;default:return!1}else switch(h[0]=JS.SV.ptValue(a[0]),j){case 3:for(s=1;4>s;s++)(h[s]=JU.P3.newP(JS.SV.ptValue(a[s]))).sub(h[0]);break;case 1:if(k=a[1].getList(),null!=k&&3==k.size()){for(s=0;3>s;s++)h[s+
1]=JS.SV.ptValue(k.get(s));break}default:return!1}s=l<=j?a[l].asString():null;if((k="primitive".equalsIgnoreCase(s))||"conventional".equalsIgnoreCase(s)){a=++l>j?"":a[l].asString().toUpperCase();a.equals("BCC")?a="I":0==a.length&&(a=this.vwr.getSymmetryInfo(f,null,0,null,null,null,1073741994,null,0,-1,0,null));if(null==a||0==a.length)return!1;null==d&&(d=this.vwr.getSymTemp());f=this.vwr.getModelForAtomIndex(f).auxiliaryInfo.get("primitiveToCrystal");if(!d.toFromPrimitive(k,a.charAt(0),h,f))return!1}else if("reciprocal".equalsIgnoreCase(s))h=
JU.SimpleUnitCell.getReciprocal(h,null,b),b=1;else if("vertices".equalsIgnoreCase(s))return e.addXObj(JU.BoxInfo.getVerticesFromOABC(h));if(1!=b)for(s=1;4>s;s++)h[s].scale(b);return e.addXObj(h)},"JS.ScriptMathProcessor,~A,~B,~N");t(p,"evaluateArray",function(e,a,b){if(b){b=e.getX();switch(1==a.length?b.tok:0){case 6:var d=new JU.Lst,c=a[0].asString(),f=b.getMap(),j=b.getKeys(!1);b=0;for(a=j.length;b<a;b++)if(null==f.get(j[b]).getMap())return!1;b=0;for(a=j.length;b<a;b++){var g=f.get(j[b]),g=g.getMap(),
g=JS.SV.deepCopy(g,!0,!1);g.put(c,JS.SV.newS(j[b]));d.addLast(JS.SV.newV(6,g))}return e.addXList(d);case 7:d=new java.util.Hashtable;c=b.getList();f=a[0].asString();b=0;for(a=c.size();b<a;b++)if(g=c.get(b).getMap(),null==g||null==g.get(f))return!1;b=0;for(a=c.size();b<a;b++)g=c.get(b),g=JS.SV.deepCopy(g.getMap(),!0,!1),j=g.remove(f),d.put(j.asString(),JS.SV.newV(6,g));return e.addXObj(d)}return!1}d=Array(a.length);for(b=d.length;0<=--b;)d[b]=JS.SV.newT(a[b]);return e.addXAV(d)},"JS.ScriptMathProcessor,~A,~B");
t(p,"evaluateBin",function(e,a){var b=a.length;if(3>b||5<b)return!1;var d=e.getX(),c=13==d.tok;if(!c&&7!=d.tok)return e.addX(d);var f=JS.SV.fValue(a[0]),j=JS.SV.fValue(a[1]),g=JS.SV.fValue(a[2]),h=4<=b&&1073742335==a[b-1].tok,b=(5==b||4==b&&!h)&&1073742334!=a[3].tok?JS.SV.sValue(a[3]):null,k=null;if(c)d=d.value;else{c=d.getList();d=C(c.size(),0);null!=b&&(k=JU.AU.createArrayOfHashtable(c.size()));try{for(var l=c.size();0<=--l;)d[l]=JS.SV.fValue(null==b?c.get(l):(k[l]=c.get(l).getMap()).get(b))}catch(s){if(L(s,
Exception))return!1;throw s;}}for(var j=Math.max(U(Math.floor((j-f)/g+0.01)),1),c=M(j,0),m=d.length,l=0;l<m;l++){var r=U(Math.floor((d[l]-f)/g));if(!(0>r||r>=j))if(c[r]++,null!=b){var n=k[l];if(null!=n){n.put("_bin",JS.SV.newI(r));var q=f+g*r,p=q+g;n.put("_binMin",JS.SV.newF(0==r?-3.4028235E38:q));n.put("_binMax",JS.SV.newF(r==j-1?3.4028235E38:p))}}}if(h){h=new JU.Lst;for(l=0;l<j;l++)h.addLast(C(-1,[f+g*l,c[l]]));return e.addXList(h)}return e.addXAI(c)},"JS.ScriptMathProcessor,~A");t(p,"evaluateCache",
function(e,a){return 0<a.length?!1:e.addXMap(this.vwr.fm.cacheList())},"JS.ScriptMathProcessor,~A");t(p,"evaluateColor",function(e,a){var b=0<a.length?JS.SV.sValue(a[0]):"",d=b.startsWith("$");if(2==a.length&&b.equalsIgnoreCase("TOHSL"))return e.addXPt(JU.CU.rgbToHSL(JU.P3.newP(8==a[1].tok?JS.SV.ptValue(a[1]):JU.CU.colorPtFromString(a[1].asString())),!0));if(2==a.length&&b.equalsIgnoreCase("TORGB")){var c=JU.P3.newP(8==a[1].tok?JS.SV.ptValue(a[1]):JU.CU.colorPtFromString(a[1].asString()));return e.addXPt(8==
a[1].tok?JU.CU.hslToRGB(c):c)}if(4==a.length&&(1073742335==a[3].tok||1073742334==a[3].tok)){var c=JU.P3.newP(8==a[0].tok?JS.SV.ptValue(a[0]):JU.CU.colorPtFromString(a[0].asString())),f=JU.P3.newP(8==a[1].tok?JS.SV.ptValue(a[1]):JU.CU.colorPtFromString(a[1].asString())),j=1073742335==a[3].tok;j&&(c=JU.CU.rgbToHSL(c,!1),f=JU.CU.rgbToHSL(f,!1));var g=new JU.SB,f=JU.V3.newVsub(f,c),h=a[2].asInt();2>h&&(h=20);f.scale(1/(h-1));for(b=0;b<h;b++)g.append(JU.Escape.escapeColor(JU.CU.colorPtToFFRGB(j?JU.CU.hslToRGB(c):
c))),c.add(f);return e.addXStr(g.toString())}h=d?null:this.vwr.cm.getColorEncoder(b);if(!d&&null==h)return e.addXStr("");c=1<a.length?JS.SV.fValue(a[1]):3.4028235E38;f=2<a.length?JS.SV.fValue(a[2]):3.4028235E38;j=3<a.length?JS.SV.fValue(a[3]):3.4028235E38;g=3.4028235E38!=j||3.4028235E38!=c&&3.4028235E38==f;3.4028235E38==f&&0==b.length&&(j=c,f=this.vwr.getCurrentColorRange(),c=f[0],f=f[1]);if(d){h=b.substring(1);h=H(-1,[h,null]);if(!this.vwr.shm.getShapePropertyData(24,"colorEncoder",h))return e.addXStr("");
h=h[1]}else h.setRange(c,f,c>f);b=h.getColorKey();return g?e.addXPt(JU.CU.colorPtFromInt(h.getArgb(3.4028235E38==f?c:j),null)):e.addX(JS.SV.getVariableMap(b))},"JS.ScriptMathProcessor,~A");t(p,"evaluateCompare",function(e,a){var b=a.length;if(2>b||5<b)return!1;var d,c=1073742335==a[b-1].tok;(c||1073742334==a[b-1].tok)&&b--;var f=JS.SV.sValue(a[b-1]),j=f.equalsIgnoreCase("stddev"),g=f.equalsIgnoreCase("ISOMER"),h=g&&c,k=f.equalsIgnoreCase("BONDS"),c=7==a[0].tok&&7==a[1].tok,l=3<=b?a[2].getList():null,
s=null==l&&!c&&!g&&b>(j?3:2),c=10==a[0].tok?a[0].value:null,m=10==a[1].tok?a[1].value:null,r=null==c?JS.SV.sValue(a[0]):"",n=null==m?JS.SV.sValue(a[1]):"";d=NaN;try{if(k){if(4!=b)return!1;r=JS.SV.sValue(a[2]);s=r.equalsIgnoreCase("SMILES");try{s&&(r=this.vwr.getSmiles(c))}catch(q){if(L(q,Exception))this.e.evalError(q.getMessage(),null);else throw q;}var p=this.e.getSmilesExt().getFlexFitList(c,m,r,!s);return null==p?e.addXStr(""):e.addXAF(p)}if(g){if(3!=b)return!1;if(null==c&&null==m){var u=this.vwr.getSmilesMatcher().getRelationship(r,
n).toUpperCase();return e.addXStr(u)}var t=null==c?this.vwr.getSmilesMatcher().getMolecularFormula(r,!1,!1):JU.JmolMolecule.getMolecularFormulaAtoms(this.vwr.ms.at,c,null,!1),A=null==m?this.vwr.getSmilesMatcher().getMolecularFormula(n,!1,!1):JU.JmolMolecule.getMolecularFormulaAtoms(this.vwr.ms.at,m,null,!1);if(!t.equals(A))return e.addXStr("NONE");null!=c&&(r=this.e.getSmilesExt().getSmilesMatches("/strict///",null,c,null,1,!0,!1));var z;null==m?z=0<this.vwr.getSmilesMatcher().areEqual(n,r):(n=this.e.getSmilesExt().getSmilesMatches("/strict///",
null,m,null,1,!0,!1),z=0<=this.e.getSmilesExt().getSmilesMatches("/strict///"+r,null,m,null,1,!0,!1).nextSetBit(0));if(!z){var B=r+n;if(0<=B.indexOf("/")||0<=B.indexOf("\\")||0<=B.indexOf("@")){if(0<=r.indexOf("@")&&(null!=m||0<=n.indexOf("@"))&&0>r.indexOf("@SP")){var D=r.toLowerCase().indexOf("invertstereo"),r=0<=D?"/strict/"+r.substring(0,D)+r.substring(D+12):"/invertstereo strict/"+r;if(z=null==m?0<this.vwr.getSmilesMatcher().areEqual(r,n):0<=this.e.getSmilesExt().getSmilesMatches(r,null,m,null,
1,!0,!1).nextSetBit(0))return e.addXStr("ENANTIOMERS")}null==m?z=0<this.vwr.getSmilesMatcher().areEqual("/nostereo/"+n,r):(u=this.e.getSmilesExt().getSmilesMatches("/nostereo/"+r,null,m,null,1,!0,!1),z=0<=u.nextSetBit(0));if(z)return e.addXStr("DIASTEREOMERS")}u="CONSTITUTIONAL ISOMERS";if(h){var w=this.vwr.getInchi(c,null,null);null!=w&&w.equals(this.vwr.getInchi(m,null,null))&&(u="TAUTOMERS")}return e.addXStr(u)}if(null==c||null==m)return e.addXStr("IDENTICAL");d=this.e.getSmilesExt().getSmilesCorrelation(c,
m,r,null,null,null,null,!1,null,null,!1,1);return e.addXStr(0.2>d?"IDENTICAL":"IDENTICAL or CONFORMATIONAL ISOMERS (RMSD="+d+")")}var P=new JU.M4,w=z=null;if(s){if(null==c||null==m)return!1;var f=JS.SV.sValue(a[2]),C=f.equalsIgnoreCase("MAP"),s=f.equalsIgnoreCase("SMILES"),v=C||f.equalsIgnoreCase("SMARTS");if(s||v)f=b>(j?4:3)?JS.SV.sValue(a[3]):null;var y="H".equalsIgnoreCase(f)||"allH".equalsIgnoreCase(f)||"bestH".equalsIgnoreCase(f),H=!y&&("polyhedra".equalsIgnoreCase(f)||"polyhedron".equalsIgnoreCase(f));
if(H)d=this.e.getSmilesExt().mapPolyhedra(c.nextSetBit(0),m.nextSetBit(0),s,P);else{z=new JU.Lst;var w=new JU.Lst,B="all".equalsIgnoreCase(f)||"allH".equalsIgnoreCase(f),E="best".equalsIgnoreCase(f)||"bestH".equalsIgnoreCase(f);"stddev".equals(f)&&(f=null);var F=f;if(null==f||y||B||E){if(!C&&!s||y&&H)return!1;F="/noaromatic"+(B||E?"/":" nostereo/")+this.e.getSmilesExt().getSmilesMatches(y?"H":"",null,c,null,32769,!0,!1)}else B=!0;d=this.e.getSmilesExt().getSmilesCorrelation(c,m,F,z,w,P,null,C,null,
null,E,(s?1:2)|(!B&&!E?8:0));if(C){var G=z.size();if(0==G)return e.addXStr("");for(var da=U(w.size()/G),u=new JU.Lst,D=F=0;F<da;F++){var x=JU.AU.newInt2(G);u.addLast(x);for(f=0;f<G;f++,D++)x[f]=M(-1,[z.get(f).i,w.get(D).i])}return B?e.addXList(u):0<u.size()?e.addXAII(u.get(0)):e.addXStr("")}}}else{z=this.e.getPointVector(a[0],0);w=this.e.getPointVector(a[1],0);if(null==z||null==w)return!1;if(null!=l){b--;var Q=l.size();if(Q>z.size()||Q!=w.size())return!1;for(var X=new JU.Lst,F=0;F<Q;F++)X.addLast(z.get(l.get(F).intValue-
1));z=X}switch(b){case 2:break;case 3:if(j)break;default:return!1}z.size()==w.size()&&(J.api.Interface.getInterface("JU.Eigen",this.vwr,"script"),d=JU.Measure.getTransformMatrix4(z,w,P,null))}return j||Float.isNaN(d)?e.addXFloat(d):e.addXM4(P.round(1E-7))}catch(N){if(L(N,Exception))return this.e.evalError(null==N.getMessage()?N.toString():N.getMessage(),null),!1;throw N;}},"JS.ScriptMathProcessor,~A");t(p,"evaluateConnected",function(e,a,b,d){if(5<a.length)return!1;var c=-2147483648,f=2147483647,
j=0,g=3.4028235E38,h=65535,k=null,l=null,s=!1,m=!1;switch(b){case 1275203608:l=-2147483648;j=null;if(0<a.length)switch(a[0].tok){case 2:l=a[0].intValue;break;case 4:j=JS.SV.sValue(a[0])}1275203608==d&&(k=JS.SV.getBitSet(e.getX(),!0));k=H(-1,[Integer.$valueOf(l),j,k]);this.vwr.shm.getShapePropertyData(21,"getCenters",k)||(k[1]=null);return e.addXBs(null==k[1]?new JU.BS:k[1]);case 1228931586:k=e.getX();if(10!=k.tok||1!=a.length||10!=a[0].tok)return!1;k=k.value;l=a[0].value;a=new JU.Lst;j=this.vwr.ms.at;
for(d=k.nextSetBit(0);0<=d;d=k.nextSetBit(d+1)){b=0;g=j[d].bonds;for(m=g.length;0<=--m;)l.get(g[m].getOtherAtom(j[d]).i)&&b++;a.addLast(Integer.$valueOf(b))}return e.addXList(a)}for(d=0;d<a.length;d++){var r=a[d];switch(r.tok){case 10:if((m=A(r.value,"JM.BondSet"))&&null!=k)return!1;if(null==k)k=r.value;else if(null==l)l=r.value;else return!1;break;case 4:b=JS.SV.sValue(r);h=b.equalsIgnoreCase("hbond")?30720:JU.Edge.getBondOrderFromString(b);if(131071==h)return!1;break;case 3:s=!0;default:b=r.asInt();
r=r.asFloat();if(2147483647!=f)return!1;-2147483648==c?(c=Math.max(b,0),j=r):(f=b,g=r)}}-2147483648==c?(c=1,f=100,j=0.1,g=1E8):2147483647==f&&(f=c,g=j,j=0.1);null==k&&(k=this.vwr.getAllAtoms());s&&null==l&&(l=k);return null!=l?(a=new JU.BS,this.vwr.makeConnections(j,g,h,1086324745,k,l,a,m,!1,0),e.addX(JS.SV.newV(10,JM.BondSet.newBS(a)))):e.addXBs(this.vwr.ms.getAtomsConnected(c,f,h,k))},"JS.ScriptMathProcessor,~A,~N,~N");t(p,"evaluateContact",function(e,a){if(1>a.length||3<a.length)return!1;var b=
0,d=100;switch(a[0].tok){case 3:case 2:d=JS.SV.fValue(a[b++]);break;case 10:break;default:return!1}if(b==a.length||!A(a[b].value,"JU.BS"))return!1;var c=JU.BSUtil.copy(a[b++].value),b=b<a.length?JU.BSUtil.copy(a[b].value):null,d=new J.atomdata.RadiusData(null,10<d?d/100:d,10<d?J.atomdata.RadiusData.EnumType.FACTOR:J.atomdata.RadiusData.EnumType.OFFSET,J.c.VDW.AUTO),b=this.setContactBitSets(c,b,!0,NaN,d,!1);b.or(c);return e.addXBs(b)},"JS.ScriptMathProcessor,~A");t(p,"evaluateData",function(e,a){var b=
0==a.length?"":JS.SV.sValue(a[0]);switch(a.length){case 0:case 1:break;case 2:case 3:if(10==a[0].tok)return e.addXStr(this.vwr.getModelFileData(b,JS.SV.sValue(a[1]),3==a.length&&JS.SV.bValue(a[2])));break;case 4:var b=a[1].asInt(),d=a[2].asInt(),c=a[3].asInt(),b=JU.Parser.parseFloatArrayFromMatchAndField(JS.SV.sValue(a[0]),null,0,0,null,b,d,null,c);return e.addXStr(JU.Escape.escapeFloatA(b,!1));default:return!1}if(0==b.indexOf("data2d_"))return b=this.vwr.getDataObj(b,null,2),null==b?e.addXStr(""):
2==a.length&&2==a[1].tok?(d=a[1].intValue,0>d&&(d+=b.length),0<=d&&d<b.length?e.addXStr(JU.Escape.escapeFloatA(b[d],!1)):e.addXStr("")):e.addXStr(JU.Escape.escapeFloatAA(b,!1));if(b.endsWith("*"))return e.addXList(this.vwr.getDataObj(b,null,0));if(0==b.indexOf("property_"))return b=this.vwr.getDataObj(b,null,1),null==b?e.addXStr(""):e.addXStr(JU.Escape.escapeFloatA(b,!1));b=this.vwr.getDataObj(b,null,-1);return e.addXStr(null==b||2>b.length?"":""+b[1])},"JS.ScriptMathProcessor,~A");t(p,"evaluateDotDist",
function(e,a,b,d){var c=1275069443==b,f,j,g=null;switch(a.length){case 2:if(2147483647==d){f=a[0];j=a[1];break}g=a[1];case 1:f=e.getX();j=a[0];break;case 0:if(c){f=e.getX();j=JS.SV.getVariable(new JU.P3);break}default:return!1}a=NaN;try{if(1275069442==b){var h=JU.P3.newP(e.ptValue(f,null));h.cross(h,e.ptValue(j,null));return e.addXPt(h)}var k=7==j.tok?null:e.ptValue(j,null),l=this.e.planeValue(j);if(c){b=-2147483648==d?0:d&480;var h=32==b||64==b,s=480==b;switch(f.tok){case 7:case 10:var m=10==f.tok,
r=10==j.tok,n=8==j.tok,q=m?f.value:null,p=r?j.value:null,u=m?null:f.getList(),t=r?null:j.getList(),A=h&&null!=g&&g.asBoolean();switch(j.tok){case 10:case 7:case 8:var z=this.vwr.ms.at;if(A){var B=NaN,D=2147483647;if(m){for(var w=q.nextSetBit(0);0<=w;w=q.nextSetBit(w+1)){var P=n?z[w].distanceSquared(k):this.e.getBitsetProperty(p,t,d,z[w],l,f.value,null,!1,f.index,!1).floatValue();if(!(32==b?P>=B:P<=B))B=P,D=w}return e.addXBs(2147483647==D?new JU.BS:JU.BSUtil.newAndSetBit(D))}for(w=u.size();0<=--w;){var H=
JS.SV.ptValue(u.get(w)),P=n?H.distanceSquared(k):this.e.getBitsetProperty(p,t,d,H,l,f.value,null,!1,2147483647,!1).floatValue();if(!(32==b?P>=B:P<=B))B=P,D=w}return e.addXInt(D)}if(s){if(null==p){for(var v=C(q.cardinality(),0),B=0,w=q.nextSetBit(0);0<=w;w=q.nextSetBit(w+1),B++)v[B]=z[w].distance(k);return e.addXAF(v)}D=C(q.cardinality(),p.cardinality(),0);B=0;for(w=q.nextSetBit(0);0<=w;w=q.nextSetBit(w+1),B++){d=0;for(var y=p.nextSetBit(0);0<=y;y=p.nextSetBit(y+1),d++)D[B][d]=z[w].distance(z[y])}return e.addXAFF(D)}if(h){v=
C(m?q.cardinality():u.size(),0);if(m){w=q.nextSetBit(0);for(B=0;0<=w;w=q.nextSetBit(w+1))v[B++]=this.e.getBitsetProperty(p,t,d,z[w],l,f.value,null,!1,f.index,!1).floatValue();return e.addXAF(v)}for(w=v.length;0<=--w;)v[w]=this.e.getBitsetProperty(p,t,d,JS.SV.ptValue(u.get(w)),l,null,null,!1,2147483647,!1).floatValue();return e.addXAF(v)}return e.addXObj(this.e.getBitsetProperty(q,u,d,k,l,f.value,null,!1,f.index,!1))}}}var M=e.ptValue(f,null),E=this.e.planeValue(f);c?a=null!=l&&null!=g?JU.Measure.directedDistanceToPlane(M,
l,JS.SV.ptValue(g)):null==E?null==l?k.distance(M):JU.Measure.distanceToPlane(l,M):JU.Measure.distanceToPlane(E,k):null!=E&&null!=l?a=E.x*l.x+E.y*l.y+E.z*l.z+E.w*l.w:(null!=E?M=JU.P3.new3(E.x,E.y,E.z):null!=l&&(k=JU.P3.new3(l.x,l.y,l.z)),a=M.dot(k))}catch(F){if(!L(F,Exception))throw F;}return e.addXFloat(a)},"JS.ScriptMathProcessor,~A,~N,~N");t(p,"evaluateHelix",function(e,a){if(1>a.length||5<a.length)return!1;var b=2<a.length?3:1,d=b>=a.length?"array":JS.SV.sValue(a[b]),b=JS.T.getTokFromName(d);if(2<
a.length){var c=e.ptValue(a[0],null),f=e.ptValue(a[1],null);if(0==b||9!=a[2].tok||null==c||null==f)return!1;var j=JU.Quat.newP4(a[2].value),j=JU.Measure.computeHelicalAxis(c,f,j);return null==j?!1:e.addXObj(JU.Escape.escapeHelical(d,b,c,f,j))}d=A(a[0].value,"JU.BS")?a[0].value:this.vwr.ms.getAtoms(1094715412,Integer.$valueOf(a[0].asInt()));switch(b){case 134217751:case 1073741854:case 1665140738:return e.addXObj(this.getHelixData(d,b));case 134217729:return e.addXFloat(this.getHelixData(d,134217729).floatValue());
case 135176:case 1745489939:return e.addXObj(this.getHelixData(d,b));case 1275068418:j=this.getHelixData(d,1073742001);if(null==j)break;return e.addXAS(j)}return!1},"JS.ScriptMathProcessor,~A");t(p,"getHelixData",function(e,a){var b=e.nextSetBit(0);return 0>b?"null":this.vwr.ms.at[b].group.getHelixData(a,this.vwr.getQuaternionFrame(),this.vwr.getInt(553648142))},"JU.BS,~N");t(p,"evaluateInChI",function(e,a){var b=e.getX(),d=0<a.length?JS.SV.sValue(a[0]):"fixedh?";d.toLowerCase().equals("standard")&&
(d="");var c=JS.SV.getBitSet(b,!0),b=null==c?JS.SV.sValue(b):null;return e.addXStr(this.vwr.getInchi(c,b,d))},"JS.ScriptMathProcessor,~A");t(p,"evaluateFind",function(e,a){var b=e.getX(),d=7==b.tok,c=10==b.tok,f=0==a.length,j=0==a.length?0:a[0].tok,g=f||4!=j?"":JS.SV.sValue(a[0]),h=1<a.length&&1073742334==a[1].tok,k=0==j?0:a[a.length-1].tok,l=0==k?JS.SV.vF:a[a.length-1],s=!d&&1073742335==k,m=1<a.length&&1073742335!=a[1].tok&&1073742334!=a[1].tok&&10!=a[1].tok?JS.SV.sValue(a[1]):"",k=!d&&!h&&g.equalsIgnoreCase("SEQUENCE"),
r=!d&&!h&&g.equalsIgnoreCase("SEQ");if(g.toUpperCase().startsWith("SMILES/")){g.endsWith("/")||(g+="/");var n=g.substring(6)+"//";JV.JC.isSmilesCanonical(n)?(m="SMILES",g="CHEMICAL"):(g="SMILES",m=n+m)}else g.toUpperCase().startsWith("SMARTS/")&&(g.endsWith("/")||(g+="/"),m=g.substring(6)+(0==m.length?"//":m),g="SMARTS");var q=null,n=!1;if(4==b.tok)switch(a.length){case 1:if(b.value.startsWith("InChI=")&&g.equalsIgnoreCase("SMILES"))return e.addXStr(this.vwr.getInchi(null,b.value,"SMILES"+m));n=!0;
break;case 2:h||s?n=!0:b.value.startsWith("InChI=")?g.equals("SMARTS")?q=this.vwr.getInchi(null,b.value,"SMILES"):n=!0:3>=m.length&&0==m.$replace("m"," ").$replace("i"," ").$replace("v"," ").trim().length&&(n=!0)}var p=!n&&g.equalsIgnoreCase("SMILES"),u=!n&&g.equalsIgnoreCase("SMARTS"),t=!d&&!n&&g.equalsIgnoreCase("CHEMICAL"),C=!d&&!n&&g.equalsIgnoreCase("MF"),z=!d&&!n&&g.equalsIgnoreCase("CELLFORMULA"),B=c&&!d&&g.equalsIgnoreCase("INCHI"),D=c&&!d&&g.equalsIgnoreCase("INCHIKEY"),w=!p&&!u&&10==j&&
0<=m.toLowerCase().indexOf("map"),n=!p&&!u&&(10==b.tok||8==b.tok||7==b.tok)&&g.toLowerCase().startsWith("equivalent");try{if(n)switch(b.tok){case 10:return e.addXBs(this.vwr.ms.getSymmetryEquivAtoms(b.value,null,null));case 8:return e.addXList(this.vwr.getSymmetryEquivPoints(b.value,g+m));case 7:for(var A=new JU.Lst,U=b.getList(),v=0,y=U.size();v<y;v++){var V=JS.SV.ptValue(U.get(v));if(null==V)return!1;A.addLast(V)}return e.addXList(this.vwr.getSymmetryEquivPointList(A,g+m))}else if(B||D)return D&&
(m+=" key"),e.addXStr(this.vwr.getInchi(JS.SV.getBitSet(b,!0),null,m));if(t){var E=c?b.value:null,F=null==E?JS.SV.sValue(b):this.vwr.getOpenSmiles(E),F=(0==F.length?"":this.vwr.getChemicalInfo(F,m.toLowerCase(),E)).trim();F.startsWith("InChI")&&(F=JU.PT.rep(JU.PT.rep(F,"InChI=",""),"InChIKey=",""));return e.addXStr(F)}if(p||u||c){var c=w?0:p||u?2:1,G=c<a.length&&10==a[c].tok?a[c++].value:null,da="bonds".equalsIgnoreCase(JS.SV.sValue(l)),A=da||s,c=null;switch(b.tok){case 7:case 4:null==q&&!d&&(q=JS.SV.sValue(b));
if((p||u)&&1==a.length||null!=G)return!1;if(m.equalsIgnoreCase("mf"))c=this.vwr.getSmilesMatcher().getMolecularFormula(q,u,s);else{var G=m,x=!0,v=!1;switch(a.length){case 4:x=JS.SV.bValue(a[3]);case 3:v=JS.SV.bValue(a[2])}var Q=G.equals("chirality"),y=!v&&(!x||!u&&!Q);try{if(c=this.e.getSmilesExt().getSmilesMatches(G,d?JS.SV.strListValue(b):q,null,null,u?2:1,!v,!x),d)return e.addXObj(c)}catch(X){if(L(X,Exception))return System.out.println(X.getMessage()),e.addXInt(-1);throw X;}var N=Q?1:(JU.AU.isAI(c),
c.length);0==N&&("MF_FAILED"!==this.vwr.getSmilesMatcher().getLastException()&&0>q.toLowerCase().indexOf("noaromatic")&&0>q.toLowerCase().indexOf("strict"))&&(c=this.e.getSmilesExt().getSmilesMatches(G,q,null,null,16|(u?2:1),!v,!x));if(y)return e.addXInt(!x&&0<N?1:N)}break;case 10:x=b.value;if(g.equalsIgnoreCase("spacegroup"))return e.addXObj(this.vwr.findSpaceGroup(x,null,null,!1,!1));if(g.equalsIgnoreCase("crystalClass"))return y=x.nextSetBit(0),x=null,2!=a.length&&(x=new JU.BS,x.set(y)),e.addXList(this.vwr.ms.generateCrystalClass(y,
null!=x?this.vwr.ms.getAtomSetCenter(x):10==l.tok?this.vwr.ms.getAtomSetCenter(l.value):JS.SV.ptValue(l)));if(C&&0!=m.length)return e.addXBs(JU.JmolMolecule.getBitSetForMF(this.vwr.ms.at,x,m));if(C||z)return e.addXStr(this.vwr.getFormulaForAtoms(x,C?"MF":"CELLFORMULA",s));if(k||r){var W=l.asString().equalsIgnoreCase("H"),A=(new Boolean(A|W)).valueOf();return e.addXStr(this.vwr.getSmilesOpt(x,-1,-1,(A?7340032|(W?9437184:0):0)|(r?34603008:1048576),null))}if(w){var I=null,N=Q=y=null,O=3==a.length?JS.SV.sValue(l):
null,R=null==O||O.equals("%i")||O.equals("number")?"i":O.equals("%a")||O.equals("name")?"a":O.equals("%D")||O.equals("index")?"D":"?";null==O&&(O="number");l=null;m=m.$replace("map","").trim();g=this.vwr.getSmilesOpt(x,0,0,0,m);if(x.cardinality()!=G.cardinality())l="atom sets are not the same size";else try{0<m.length&&(g="/"+m+"/"+g);var y=this.vwr.getSmilesMatcher().getCorrelationMaps(g,this.vwr.ms.at,this.vwr.ms.ac,x,137)[0],Y=this.vwr.getSmilesMatcher().getCorrelationMaps(g,this.vwr.ms.at,this.vwr.ms.ac,
G,137);if(0<Y.length){I=M(x.length(),0);for(v=I.length;0<=--v;)I[v]=-1;Q=Y[0];for(v=y.length;0<=--v;)I[y[v]]=Q[v];var N=H(y.length,2,null),ea=JU.BS.copy(x);ea.or(G);var S="?"==R?Array(ea.length()):null;null!=S&&(S=this.e.getCmdExt().getBitsetIdentFull(ea,O,!1,2147483647,!1,S));for(var K=this.vwr.ms.at,Y=0,v=x.nextSetBit(0);0<=v;v=x.nextSetBit(v+1)){var ba=I[v];if(-1!=ba){var ca;switch(R.charCodeAt(0)){case 97:ca=H(-1,[K[v].getAtomName(),K[ba].getAtomName()]);break;case 105:ca=H(-1,[Integer.$valueOf(K[v].getAtomNumber()),
Integer.$valueOf(K[ba].getAtomNumber())]);break;case 68:ca=H(-1,[Integer.$valueOf(v),Integer.$valueOf(ba)]);break;default:ca=H(-1,[S[v],S[ba]])}N[Y++]=ca}}}}catch(fa){if(L(fa,Exception))l=fa.getMessage();else throw fa;}var T=new java.util.Hashtable;T.put("BS1",x);T.put("BS2",G);T.put("SMILES",g);null==l?(T.put("SMILEStoBS1",y),T.put("SMILEStoBS2",Q),T.put("BS1toBS2",I),T.put("MAP1to2",N),T.put("key",O)):T.put("error",l);return e.addXMap(T)}if(p||u)g=1<a.length&&10==a[1].tok?this.vwr.getSmilesOpt(a[1].value,
0,0,0,m):m;m=m.toUpperCase();if(0<=m.indexOf("INCHI"))return e.addXStr(this.vwr.getInchi(x,null,"SMILES/"+m));if(m.equals("MF"))q=this.e.getSmilesExt().getSmilesMatches("",null,x,G,1,!0,!1),c=this.vwr.getSmilesMatcher().getMolecularFormula(q,!1,s);else if(da)I=this.vwr.getSmilesMatcher().getCorrelationMaps(g,this.vwr.ms.at,this.vwr.ms.ac,x,(p?1:2)|8),c=0<I.length?this.vwr.ms.getDihedralMap(I[0]):M(0,0);else if(m.equals("MAP"))c=I=this.vwr.getSmilesMatcher().getCorrelationMaps(g,this.vwr.ms.at,this.vwr.ms.ac,
x,(p?1:2)|144);else{var Z=(p?0<=m.indexOf("OPEN")?5:1:2)|(s&&0==g.length?22020096:0);if(0<=m.indexOf("/MOLECULE/")){for(var ga=this.vwr.ms.getMolecules(),$=new JU.Lst,v=0;v<ga.length;v++)if(ga[v].atomList.intersects(x)){var aa=this.e.getSmilesExt().getSmilesMatches(g,null,ga[v].atomList,G,Z,!s,!1);aa.isEmpty()||$.addLast(aa)}c=$}else c=this.e.getSmilesExt().getSmilesMatches(g,null,x,G,Z,!s,!1)}}null==c&&this.e.invArg();return e.addXObj(c)}}catch(ha){if(L(ha,Exception))this.e.evalError(ha.getMessage(),
null);else throw ha;}x=new JU.BS;I=d?b.getList():null;if(d&&4!=j&&0!=j){b=a[0];v=0;for(y=I.size();v<y;v++)JS.SV.areEqual(I.get(v),b)&&x.set(v);c=M(x.cardinality(),0);Y=0;for(v=x.nextSetBit(0);0<=v;v=x.nextSetBit(v+1))c[Y++]=v+1;return e.addXAI(c)}j=0<=m.indexOf("v");v=0<=m.indexOf("i")||h;h=0<=m.indexOf("m");m=0==g.length;n=!m&&!n&&2==a.length;if(d||n){k=n?this.getPatternMatcher():null;G=null;if(n)try{G=k.compile(g,v)}catch(ia){if(L(ia,Exception))this.e.evalError(ia.toString(),null);else throw ia;
}k=m?null:JS.SV.strListValue(b);O=m?I.size():k.length;JU.Logger.debugging&&JU.Logger.debug("finding "+g);y=0;R=null;b=h?new JU.Lst:null;S="";for(v=0;v<O;v++){if(m)switch(K=I.get(v),K.tok){case 6:K=K.getMap().isEmpty()!=f;break;case 7:K=0==K.getList().size()!=f;break;case 4:K=0==K.asString().length!=f;break;default:K=!0}else n?(S=k[v],R=G.matcher(S),K=R.find()):K=0<=JS.SV.sValue(I.get(v)).indexOf(g);if(h&&K||!h&&K==!j)y++,x.set(v),h&&b.addLast(j?S.substring(0,R.start())+S.substring(R.end()):R.group())}if(!d)return h?
e.addXStr(1==b.size()?b.get(0):""):j?e.addXBool(1==y):h?e.addXStr(0==y?"":R.group()):e.addXInt(0==y?0:R.start()+1);if(h){d=Array(y);if(0<y)for(v=k.length;0<=--v;)x.get(v)&&(--y,d[y]=h?b.get(y):k[v]);return e.addXAS(d)}d=new JU.Lst;for(v=x.nextSetBit(0);0<=v;v=x.nextSetBit(v+1))d.addLast(I.get(v));return e.addXList(d)}return k?e.addXStr(this.vwr.getJBR().toStdAmino3(JS.SV.sValue(b))):e.addXInt(JS.SV.sValue(b).indexOf(g)+1)},"JS.ScriptMathProcessor,~A");t(p,"evaluateGetProperty",function(e,a,b,d){var c=
a.length,f=d&&1275082241==b,j=d&&1275068725==b,g=1275068446==b,h=0,k=0==c?0:a[0].tok;if(2==c&&(7==k||6==k||14==k))return e.addXObj(this.vwr.extractProperty(a[0].value,a[1].value.toString(),-1));var l=d&&1==c&&10==a[0].tok?a[0].value:null,s=null==l&&0<c?JS.SV.sValue(a[h++]):"",k=s,m=k.toLowerCase();!f&&0>m.indexOf("[select ")&&(k=m);var r=!1;k.equals("json")&&c>h&&(r=!0,k=JS.SV.sValue(a[h++]));var n=null;if(d){n=e.getX();switch(n.tok){case 10:break;case 4:var q=n.value,c=Array(3);q.startsWith("$")?
(q=q.substring(1),a=this.vwr.shm.getShapeIdFromObjectName(q),0<=a&&(c[0]=q,this.vwr.shm.getShapePropertyData(a,"index",c),null!=c[1]&&!s.equals("index")&&(q=c[1].intValue(),c[1]=this.vwr.shm.getShapePropertyIndex(a,s.intern(),q)))):(a=JV.JC.shapeTokenIndex(JS.T.getTokFromName(q)),0<=a&&(c[0]=s,c[1]=Integer.$valueOf(-1),this.vwr.shm.getShapePropertyData(a,s.intern(),c)));return null==c[1]?e.addXStr(""):e.addXObj(c[1]);case 7:if(j){g=n.getList();if(0==c)return e.addXObj(this.getMinMax(g,1275068725,
!0));d=new java.util.Hashtable;k=1<c?JS.SV.sValue(a[c-1]):null;null!=k&&c--;m=Array(c);for(q=0;q<c;q++)m[q]=JS.SV.sValue(a[q]);q=0;for(r=g.size();q<r;q++)if(h=g.get(q),6==h.tok){s=h.getMap();a="";for(n=0;n<c;n++)l=s.get(m[n]),a+=(0==n?"":k)+JS.SV.sValue(l);s=d.get(a);null==s&&d.put(a,s=JS.SV.newV(7,new JU.Lst));s.getList().addLast(h)}return e.addXMap(d)}if(null!=l){c=n.getList();a=new JU.Lst;for(q=l.nextSetBit(0);0<=q;q=l.nextSetBit(q+1))a.addLast(c.get(q));return e.addXList(a)}default:if(1275068725==
b&&6==n.tok){d=new java.util.Hashtable;for(c=n.getMap().entrySet().iterator();c.hasNext()&&((q=c.next())||1);)a=q.getKey(),h=q.getValue().asString(),g=d.get(h),null==g&&d.put(h,g=new JU.Lst),g.addLast(a);if("count".equals(m))for(c=d.entrySet().iterator();c.hasNext()&&((q=c.next())||1);)q.setValue(Integer.$valueOf(q.getValue().size()));return e.addXMap(d)}f&&(k="[SELECT "+k+"]");return e.addXObj(this.vwr.extractProperty(n,k,-1))}!m.startsWith("bondinfo")&&(!m.startsWith("atominfo")&&!m.startsWith("modelkitinfo"))&&
(k="atomInfo."+k)}q="";if(k.equalsIgnoreCase("fileContents")&&2<=c){h=JS.SV.sValue(a[1]);for(q=2;q<c;q++)h+="|"+JS.SV.sValue(a[q]);q=h;h=c}else if(c>h)switch(a[h].tok){case 10:q=a[h++].value;k.equalsIgnoreCase("bondInfo")&&(c>h&&10==a[h].tok)&&(q=H(-1,[q,a[h].value]));break;case 6:case 4:this.vwr.checkPropertyParameter(k)&&(q=a[h++].value)}if(d&&(q=n.value,0>q.nextSetBit(0)))return e.addXStr("");g&&!d&&(k="auxiliaryInfo.models."+k);k=JU.PT.rep(k,".[","[");q=this.vwr.getProperty(null,k,q);h<c&&(q=
this.vwr.extractProperty(q,a,h));return e.addXObj(r?JS.SV.safeJSON("value",q):JS.SV.isVariableType(q)?q:JU.Escape.toReadable(k,q))},"JS.ScriptMathProcessor,~A,~N,~B");t(p,"evaluateFormat",function(e,a,b,d){var c=2>b.length||1287653388==a?e.getX():null,f=0==b.length?"%U":7==b[0].tok?null:JS.SV.sValue(b[0]);if(!d&&0<b.length&&null!=c&&10!=c.tok&&null!=f){if(2==b.length){var c=c.getList(),j=b[1].getList();if(null==c||null==j)return!1;c=JS.SV.getVariableList(this.getSublist(c,j))}b=H(-1,[b[0],c]);c=null}if(null==
c){if(null==f)return!1;a=d?-1:JS.SV.getFormatType(f);if(0<=a&&2!=b.length)return!1;if(0<=a||2>b.length||7!=b[1].tok)return b=JS.SV.format(b,a),f.equalsIgnoreCase("json")?e.addXStr(b):e.addXObj(b);f=b[1].getList();b=H(-1,[b[0],null]);d=Array(f.size());for(c=d.length;0<=--c;)b[1]=f.get(c),d[c]=JS.SV.format(b,a).toString();return e.addXAS(d)}if(7==c.tok&&null==f)return c=c.getList(),j=b[0].getList(),f=this.getSublist(c,j),e.addXList(f);b=10==c.tok?c.value:null;a=JS.T.tokAttr(a,480);return e.addXObj(null==
f?"":null==b?JS.SV.sprintf(JU.PT.formatCheck(f),c):this.e.getCmdExt().getBitsetIdent(b,f,c.value,!0,c.index,a))},"JS.ScriptMathProcessor,~N,~A,~B");t(p,"getSublist",function(e,a){for(var b=new JU.Lst,d,c,f,j=0,g=e.size();j<g;j++)switch(c=e.get(j),c.tok){case 6:d=c.getMap();f=new JU.Lst;for(var h=0,k=a.size();h<k;h++)c=d.get(JS.SV.sValue(a.get(h))),f.addLast(null==c?JS.SV.newS(""):c);b.addLast(JS.SV.getVariableList(f));break;case 7:d=new java.util.Hashtable;f=c.getList();h=0;for(k=Math.min(f.size(),
a.size());h<k;h++)d.put(JS.SV.sValue(a.get(h)),f.get(h));b.addLast(JS.SV.getVariable(d))}return b},"JU.Lst,JU.Lst");t(p,"evaluateList",function(e,a,b){var d=b.length,c=e.getX(),f=7==c.tok,j;switch(a){case 1275335685:return 2==d&&e.addX(c.pushPop(b[0],b[1]))||1==d&&e.addX(c.pushPop(null,b[0]));case 1275334681:return 1==d&&e.addX(c.pushPop(b[0],null))||0==d&&e.addX(c.pushPop(null,null));case 1275069441:if(1!=d&&2!=d)return!1;break;case 1275069447:case 1275069446:break;default:if(1!=d)return!1}var g=
null,h=null,k=null;if(2==d){var l=JS.SV.sValue(b[0]);j=b[1];if(1275069441==a){g=f?JS.SV.strListValue(c):JU.PT.split(JS.SV.sValue(c),"\n");h=7==j.tok?JS.SV.strListValue(j):JU.PT.split(JS.SV.sValue(j),"\n");k=Array(d=Math.max(g.length,h.length));for(c=0;c<d;c++)k[c]=(c>=g.length?"":g[c])+l+(c>=h.length?"":h[c]);return e.addXAS(k)}if(1073742335!=j.tok)return!1;k=c.getList();(d=0==l.length)&&(l=",");if(1275069446==a){h=Array(k.size());for(c=k.size();0<=--c;)if(b=k.get(c).getList(),null==b)h[c]=k.get(c);
else{a=new JU.SB;f=0;for(g=b.size();f<g;f++)0<f&&a.append(l),j=b.get(f),a.append(d&&4==j.tok?'"'+JU.PT.rep(j.value,'"','""')+'"':""+j.asString());h[c]=JS.SV.newS(a.toString())}return e.addXAV(h)}a=new JU.Lst;d&&(l="\x00");h=M(2,0);c=0;for(j=k.size();c<j;c++){f=k.get(c).asString();if(d){h[1]=0;for(g=h[0]=0;;){b=JU.PT.getCSVString(f,h);if(null==b){if(-1==h[1]){f+=++c<j?"\n"+k.get(c).asString():'"';h[1]=g;continue}f=f.substring(0,g)+f.substring(g).$replace(",","\x00");break}f=f.substring(0,g)+f.substring(g,
h[0]).$replace(",","\x00")+b+f.substring(h[1]);h[1]=g=h[0]+b.length}}for(var s=f.$plit(l),m=new JU.Lst,f=0,g=s.length;f<g;f++){b=s[f];if(0>b.indexOf("."))try{m.addLast(JS.SV.newI(Integer.parseInt(b)));continue}catch(r){if(!L(r,Exception))throw r;}else try{m.addLast(JS.SV.getVariable(Float.$valueOf(Float.parseFloat(b))));continue}catch(n){if(!L(n,Exception))throw n;}m.addLast(JS.SV.newS(b))}a.addLast(JS.SV.getVariableList(m))}return e.addXObj(JS.SV.getVariableList(a))}j=0==d?JS.SV.newV(1073742327,
"all"):b[0];k=1073742327==j.tok;if(!f&&4!=c.tok)return e.binaryOp(this.opTokenFor(a),c,j);var s=JS.SV.isScalar(c),q=JS.SV.isScalar(j),p=m=null,l=c.getList(),u=j.getList();f?d=l.size():s?d=2147483647:(g=JU.PT.split(JS.SV.sValue(c),"\n"),m=C(d=g.length,0),JU.PT.parseFloatArrayData(g,m));if(k&&1275069446!=a){k=0;if(f)for(c=d;0<=--c;)k+=JS.SV.fValue(l.get(c));else if(!s)for(c=d;0<=--c;)k+=m[c];return e.addXFloat(k)}if(1275069446==a&&4==j.tok){a=new JU.SB;if(s)a.append(JS.SV.sValue(c));else{b=k?"":j.value.toString();
for(c=0;c<d;c++)a.append(0<c?b:"").append(JS.SV.sValue(l.get(c)))}return e.addXStr(a.toString())}var t=null;q?t=j:7==j.tok?d=Math.min(d,u.size()):(h=JU.PT.split(JS.SV.sValue(j),"\n"),p=C(h.length,0),JU.PT.parseFloatArrayData(h,p),d=Math.min(d,p.length));var A=this.opTokenFor(a);if(f&&k)return k=new JU.Lst,e.addXList(this.addAllLists(c.getList(),k));b=s?c:null;var z,B=2147483647==d;B&&(d=1);for(var D=Array(d),c=0;c<d;c++){z=q?t:7==j.tok?u.get(c):Float.isNaN(p[c])?JS.SV.getVariable(JS.SV.unescapePointOrBitsetAsVariable(h[c])):
JS.SV.newF(p[c]);s||(b=f?l.get(c):Float.isNaN(m[c])?JS.SV.getVariable(JS.SV.unescapePointOrBitsetAsVariable(g[c])):JS.SV.newF(m[c]));1275069446==a&&7!=b.tok&&(k=new JU.Lst,k.addLast(b),b=JS.SV.getVariableList(k));if(!e.binaryOp(A,b,z))return!1;D[c]=e.getX()}return B?e.addXObj(D[0]):e.addXAV(D)},"JS.ScriptMathProcessor,~N,~A");t(p,"addAllLists",function(e,a){for(var b=e.size(),d=0;d<b;d++){var c=e.get(d);7==c.tok?this.addAllLists(c.getList(),a):a.addLast(c)}return a},"JU.Lst,JU.Lst");t(p,"evaluateLoad",
function(e,a,b){if(1>a.length||3<a.length)return!1;var d=JV.FileManager.fixDOSName(JS.SV.sValue(a[0])),c=1<a.length&&1073742335==a[1].tok,f=this.vwr.async||2<a.length&&1073742335==a[a.length-1].tok,j=1<a.length&&2==a[1].tok?a[1].asInt():-1;a=1<a.length&&a[1].asString().equalsIgnoreCase("JSON");if(c)return e.addXMap(this.vwr.fm.getFileAsMap(d,null,!1));c=d.startsWith("?");if(JV.Viewer.isJS&&(c||f)){if(b&&c)return e.addXStr("");d=this.e.loadFileAsync("load()_",d,e.oPt,!0)}b=b?this.vwr.fm.getFilePath(d,
!1,!1):this.vwr.getFileAsString4(d,j,!1,!1,!0,"script");try{return a?e.addXObj(this.vwr.parseJSON(b)):e.addXStr(b)}catch(g){if(L(g,Exception))return!1;throw g;}},"JS.ScriptMathProcessor,~A,~B");t(p,"evaluateMath",function(e,a,b){a=JS.SV.fValue(a[0]);switch(b){case 134218246:a=Math.sqrt(a);break;case 134218244:a=Math.sin(3.141592653589793*a/180);break;case 134218245:a=Math.cos(3.141592653589793*a/180);break;case 134218241:a=180*Math.acos(a)/3.141592653589793}return e.addXFloat(a)},"JS.ScriptMathProcessor,~A,~N");
t(p,"evaluateMeasure",function(e,a,b){var d=0;switch(b){case 1745489939:b=null;for(var c=new JU.Lst,f=C(-1,[3.4028235E38,3.4028235E38]),j=null,g=null,h=!1,k=!1,l=0,s=!1,m=null,r=0,n=3.4028235E38,q=!1,p=!1,m=0;m<a.length;m++)switch(a[m].tok){case 10:var u=a[m].value;0==u.length()&&(s=!0);c.addLast(u);d++;r++;break;case 8:u=new JU.Point3fi;u.setT(a[m].value);c.addLast(u);d++;break;case 2:case 3:f[l++%2]=JS.SV.fValue(a[m]);break;case 4:u=JS.SV.sValue(a[m]);if(u.startsWith("property_")){b=u;break}u.equalsIgnoreCase("vdw")||
u.equalsIgnoreCase("vanderwaals")?n=(m+1<a.length&&2==a[m+1].tok?a[++m].asInt():100)/100:u.equalsIgnoreCase("notConnected")?k=!0:u.equalsIgnoreCase("connected")?h=!0:u.equalsIgnoreCase("minArray")?q=1<=r:u.equalsIgnoreCase("asArray")||0==u.length?p=1<=r:JM.Measurement.isUnits(u)?g=u.toLowerCase():j=d+":"+u;break;default:return!1}if(2>d||4<d||2<l||k&&h)return!1;if(s||3.4028235E38!=n&&(2!=r||2!=d))return e.addXStr("");m=3.4028235E38==n?new J.atomdata.RadiusData(f,0,null,null):new J.atomdata.RadiusData(null,
n,J.atomdata.RadiusData.EnumType.FACTOR,J.c.VDW.AUTO);a=this.vwr.newMeasurementData(null,c).set(0,null,m,b,j,g,null,h,k,null,!0,0,0,null,NaN,null).getMeasurements(p,q);return e.addXObj(a);case 134217729:if(3!=(d=a.length)&&4!=d)return!1;break;default:if(2!=(d=a.length))return!1}b=Array(d);for(m=0;m<d;m++)if(null==(b[m]=e.ptValue(a[m],null)))return!1;switch(d){case 2:return e.addXFloat(b[0].distance(b[1]));case 3:return e.addXFloat(JU.Measure.computeAngleABC(b[0],b[1],b[2],!0));case 4:return e.addXFloat(JU.Measure.computeTorsion(b[0],
b[1],b[2],b[3],!0))}return!1},"JS.ScriptMathProcessor,~A,~N");t(p,"evaluateModulation",function(e,a){var b="",d=NaN,c=null;switch(a.length){case 0:break;case 1:switch(a[0].tok){case 8:c=a[0].value;break;case 4:b=a[0].asString();break;default:d=JS.SV.fValue(a[0])}break;case 2:b=JS.SV.sValue(a[0]);d=JS.SV.fValue(a[1]);break;default:return!1}null==c&&1E6>d&&(c=JU.P3.new3(d,d,d));d=e.getX();d=10==d.tok?d.value:new JU.BS;return e.addXList(this.vwr.ms.getModulationList(d,(b+"D").toUpperCase().charAt(0),
c))},"JS.ScriptMathProcessor,~A");t(p,"evaluatePlane",function(e,a,b){if(134219777==b&&3!=a.length&&4!=a.length||134217763==b&&2!=a.length&&3!=a.length&&4!=a.length||0==a.length||4<a.length)return!1;var d,c,f=this.e.planeValue(a[0]),j,g;switch(a.length){case 1:return 10==a[0].tok&&(a=a[0].value,3==a.cardinality())?(a=this.vwr.ms.getAtomPointVector(a),e.addXPt4(JU.Measure.getPlaneThroughPoints(a.get(0),a.get(1),a.get(2),new JU.V3,new JU.V3,new JU.P4))):null!=f&&e.addXPt4(f);case 2:if(134217763==b){d=
this.e.planeValue(a[1]);if(null==d)return!1;b=new JU.P3;j=new JU.V3;g=new JU.V3;if(null!=f)return a=JU.Measure.getIntersectionPP(f,d),null==a?e.addXStr(""):e.addXList(a);c=e.ptValue(a[0],null);return null==c?e.addXStr(""):e.addXPt(JU.Measure.getIntersection(c,null,d,b,j,g))}case 3:case 4:switch(b){case 134219777:return b=4==a.length?JS.SV.fValue(a[3]):NaN,f=this.e.getHklPlane(JU.P3.new3(JS.SV.fValue(a[0]),JS.SV.fValue(a[1]),JS.SV.fValue(a[2])),b,null),null!=f&&e.addXPt4(f);case 134217763:d=e.ptValue(a[0],
null);c=e.ptValue(a[1],null);if(null==d||null==c)return e.addXStr("");c=JU.V3.newV(c);c.normalize();f=this.e.planeValue(a[2]);if(null!=f)return b=new JU.P3,j=new JU.V3,g=new JU.V3,d=JU.Measure.getIntersection(d,c,f,b,j,g),null==d?e.addXStr(""):e.addXPt(d);b=e.ptValue(a[2],null);if(null==b)return e.addXStr("");j=new JU.V3;b=JU.P3.newP(b);if(3==a.length)return JU.Measure.projectOntoAxis(b,d,c,j),e.addXPt(b);f=JS.SV.fValue(a[3]);a=JU.P3.newP(b);JU.Measure.projectOntoAxis(b,d,c,j);a=a.distance(b);d=new JU.Lst;
a==f?d.addLast(b):a<f&&(a=Math.sqrt(f*f-a*a),j.scaleAdd2(a,c,b),d.addLast(JU.P3.newP(j)),j.scaleAdd2(-a,c,b),d.addLast(JU.P3.newP(j)));return e.addXList(d)}switch(a[0].tok){case 2:case 3:if(3==a.length)return f=JS.SV.fValue(a[0]),b=JS.SV.fValue(a[1]),a=JS.SV.fValue(a[2]),j=JU.V3.new3(0,0,1),c=JU.P3.new3(0,1,0),a=JU.Quat.newVA(c,a),a.getMatrix().rotate(j),c.set(0,0,1),a=JU.Quat.newVA(c,b),a.getMatrix().rotate(j),c.setT(j),c.scale(f),f=new JU.P4,JU.Measure.getPlaneThroughPoint(c,j,f),e.addXPt4(f);break;
case 10:case 8:d=e.ptValue(a[0],null);c=e.ptValue(a[1],null);if(null==c)return!1;b=2<a.length&&(10==a[2].tok||8==a[2].tok)?e.ptValue(a[2],null):null;j=JU.V3.newV(c);if(null==b)return f=new JU.P4,2==a.length||2!=a[2].tok&&3!=a[2].tok&&!a[2].asBoolean()?(b=JU.P3.newP(d),b.add(c),b.scale(0.5),j.sub(d),j.normalize()):1073742335==a[2].tok?b=d:(j.sub(d),b=new JU.P3,b.scaleAdd2(a[2].asFloat(),j,d)),JU.Measure.getPlaneThroughPoint(b,j,f),e.addXPt4(f);f=new JU.V3;a=4==a.length?e.ptValue(a[3],null):null;a=
JU.Measure.getDirectedNormalThroughPoints(d,c,b,a,j,f);return e.addXPt4(JU.P4.new4(j.x,j.y,j.z,a))}}if(4!=a.length)return!1;b=JS.SV.fValue(a[0]);j=JS.SV.fValue(a[1]);d=JS.SV.fValue(a[2]);a=JS.SV.fValue(a[3]);return e.addXPt4(JU.P4.new4(b,j,d,a))},"JS.ScriptMathProcessor,~A,~N");t(p,"evaluatePoint",function(e,a){switch(a.length){default:return!1;case 1:if(3==a[0].tok||2==a[0].tok)return e.addXInt(a[0].asInt());var b=null;if(7==a[0].tok){var d=a[0].getList(),c=d.size();if(0==c)return!1;switch(d.get(0).tok){case 4:b=
d.get(0).value;if(!b.startsWith("{")||"string"==typeof JU.Escape.uP(b))break;for(var b=new JU.Lst,f=0;f<c;f++)b.addLast(JS.SV.getVariable(JU.Escape.uP(JS.SV.sValue(d.get(f)))));return e.addXList(b)}b="{"+JS.SV.sValue(a[0])+"}"}null==b&&(b=JS.SV.sValue(a[0]));d=JU.Escape.uP(b);return A(d,"JU.P3")?e.addXPt(d):e.addXStr(""+d);case 2:switch(a[1].tok){case 1073742334:case 1073742335:switch(a[0].tok){case 8:d=JU.P3.newP(a[0].value);break;case 10:d=this.vwr.ms.getAtomSetCenter(a[0].value);break;default:return!1}1073742335==
a[1].tok?(this.vwr.tm.transformPt3f(d,d),d.y=this.vwr.tm.height-d.y,this.vwr.antialiased&&d.scale(0.5)):(this.vwr.antialiased&&d.scale(2),d.y=this.vwr.tm.height-d.y,this.vwr.tm.unTransformPoint(d,d));break;case 8:c=a[0].getList();if(null==c||4!=c.size())return!1;b=JS.SV.ptValue(a[1]);d=JU.P3.newP(JS.SV.ptValue(c.get(0)));d.scaleAdd2(b.x,JS.SV.ptValue(c.get(1)),d);d.scaleAdd2(b.y,JS.SV.ptValue(c.get(2)),d);d.scaleAdd2(b.z,JS.SV.ptValue(c.get(3)),d);break;default:return!1}return e.addXPt(d);case 3:return e.addXPt(JU.P3.new3(a[0].asFloat(),
a[1].asFloat(),a[2].asFloat()));case 4:return e.addXPt4(JU.P4.new4(a[0].asFloat(),a[1].asFloat(),a[2].asFloat(),a[3].asFloat()))}},"JS.ScriptMathProcessor,~A");t(p,"evaluatePrompt",function(e,a){if(1!=a.length&&2!=a.length&&3!=a.length)return!1;var b=JS.SV.sValue(a[0]),d=1<a.length&&7==a[1].tok?JS.SV.strListValue(a[1]):null,c=null!=d||1==a.length||3==a.length&&a[2].asBoolean(),f=null!=d?null:2<=a.length?JS.SV.sValue(a[1]):"OK",b=""+this.vwr.prompt(b,f,d,c);return c&&null!=d?e.addXInt(Integer.parseInt(b)+
1):e.addXStr(b)},"JS.ScriptMathProcessor,~A");t(p,"evaluateQuaternion",function(e,a,b){var d=null,c=a.length,f=2147483647,j=!1;134221850==b&&(1<c&&(4==a[c-1].tok&&a[c-1].value.equalsIgnoreCase("relative"))&&(c--,j=!0),1<c&&(2==a[c-1].tok&&10==a[0].tok)&&(f=a[c-1].asInt(),0>=f&&(f=2147483646),c--));switch(c){case 0:case 1:case 4:break;case 2:if(134221850==b){if(7==a[0].tok&&(7==a[1].tok||1073742335==a[1].tok))break;if(10==a[0].tok&&(2==a[1].tok||10==a[1].tok))break}if(null==(d=e.ptValue(a[0],null))||
134221850!=b&&8==a[1].tok)return!1;break;case 3:if(134221850!=b)return!1;if(9==a[0].tok){if(8!=a[2].tok&&10!=a[2].tok)return!1;break}for(var g=0;3>g;g++)if(8!=a[g].tok&&10!=a[g].tok)return!1;break;default:return!1}var h=g=null,k=null;switch(c){case 0:return e.addXPt4(this.vwr.tm.getRotationQ().toPoint4f());default:if(134221850==b&&7==a[0].tok){b=this.e.getQuaternionArray(a[0].getList(),1073742001);a=JU.Quat.sphereMean(b,null,1E-4);g=A(a,"JU.Quat")?a:null;break}else if(134221850==b&&10==a[0].tok)h=
this.vwr.getAtomGroupQuaternions(a[0].value,f);else if(11==a[0].tok)g=JU.Quat.newM(a[0].value);else if(9==a[0].tok)k=a[0].value;else if(k=JS.SV.sValue(a[0]),k=JU.Escape.uP(k.equalsIgnoreCase("best")?this.vwr.getOrientation(1073741864,"best",null,null).toString():k),!A(k,"JU.P4"))return!1;134217731==b&&(g=JU.Quat.newVA(JU.P3.new3(k.x,k.y,k.z),k.w));break;case 2:if(134221850==b){if(7==a[0].tok&&7==a[1].tok){b=this.e.getQuaternionArray(a[0].getList(),1073742001);h=this.e.getQuaternionArray(a[1].getList(),
1073742001);h=JU.Quat.arrayDiv(h,b,f,j);break}if(7==a[0].tok&&1073742335==a[1].tok)return b=this.e.getQuaternionArray(a[0].getList(),1073742001),f=C(1,0),JU.Quat.sphereMean(b,f,1E-4),e.addXFloat(f[0]);if(10==a[0].tok&&10==a[1].tok){b=this.vwr.getAtomGroupQuaternions(a[0].value,2147483647);h=this.vwr.getAtomGroupQuaternions(a[1].value,2147483647);h=JU.Quat.arrayDiv(h,b,f,j);break}}g=e.ptValue(a[1],null);k=this.e.planeValue(a[0]);g=null!=g?JU.Quat.getQuaternionFrame(JU.P3.new3(0,0,0),d,g):JU.Quat.newVA(d,
JS.SV.fValue(a[1]));break;case 3:if(9==a[0].tok)return f=8==a[2].tok?a[2].value:this.vwr.ms.getAtomSetCenter(a[2].value),e.addXStr(JU.Escape.drawQuat(JU.Quat.newP4(a[0].value),"q",JS.SV.sValue(a[1]),f,1));b=Array(3);for(g=0;3>g;g++)b[g]=8==a[g].tok?a[g].value:this.vwr.ms.getAtomSetCenter(a[g].value);g=JU.Quat.getQuaternionFrame(b[0],b[1],b[2]);break;case 4:134221850==b?k=JU.P4.new4(JS.SV.fValue(a[1]),JS.SV.fValue(a[2]),JS.SV.fValue(a[3]),JS.SV.fValue(a[0])):g=JU.Quat.newVA(JU.P3.new3(JS.SV.fValue(a[0]),
JS.SV.fValue(a[1]),JS.SV.fValue(a[2])),JS.SV.fValue(a[3]))}if(null!=h){if(2147483647!=f){f=new JU.Lst;for(g=0;g<h.length;g++)f.addLast(h[g].toPoint4f());return e.addXList(f)}g=0<h.length?h[0]:null}return e.addXPt4((null==g?JU.Quat.newP4(k):g).toPoint4f())},"JS.ScriptMathProcessor,~A,~N");t(p,"evaluateRandom",function(e,a){if(3<a.length)return!1;null==this.rand&&(this.rand=new java.util.Random);var b=0,d=1;switch(a.length){case 3:this.rand.setSeed(aa(JS.SV.fValue(a[2])));case 2:d=JS.SV.fValue(a[1]);
case 1:b=JS.SV.fValue(a[0]);case 0:break;default:return!1}return e.addXFloat(this.rand.nextFloat()*(d-b)+b)},"JS.ScriptMathProcessor,~A");t(p,"evaluateRowCol",function(e,a,b){if(1!=a.length)return!1;a=a[0].asInt()-1;var d=e.getX();switch(d.tok){case 11:if(0>a||2<a)break;d=d.value;switch(b){case 1275068935:return b=C(3,0),d.getRow(a,b),e.addXAF(b);default:return b=C(3,0),d.getColumn(a,b),e.addXAF(b)}case 12:if(0>a||2<a)break;d=d.value;switch(b){case 1275068935:return b=C(4,0),d.getRow(a,b),e.addXAF(b);
default:return b=C(4,0),d.getColumn(a,b),e.addXAF(b)}case 7:b=d.getList();for(var d=new JU.Lst,c=0,f=b.size();c<f;c++){var j=b.get(c).getList();if(null==j)return e.addXStr("");d.addLast(a<j.size()?j.get(a):JS.SV.newS(""))}return e.addXList(d)}return!1},"JS.ScriptMathProcessor,~A,~N");t(p,"evaluateIn",function(e,a){var b=e.getX();switch(a.length){case 1:var d=a[0].getList();if(null!=d)for(var c=0,f=d.size();c<f;c++)if(JS.SV.areEqual(b,d.get(c)))return e.addXInt(c+1);break;default:for(c=0;c<a.length;c++)if(JS.SV.areEqual(b,
a[c]))return e.addXInt(c+1)}return e.addXInt(0)},"JS.ScriptMathProcessor,~A");t(p,"evaluateReplace",function(e,a){var b=!1,d,c;switch(a.length){case 0:b=!0;d=c=null;break;case 3:b=JS.SV.bValue(a[2]);case 2:d=JS.SV.sValue(a[0]);c=JS.SV.sValue(a[1]);break;default:return!1}var f=e.getX();if(7==f.tok){for(var f=JS.SV.strListValue(f),j=Array(f.length),g=f.length;0<=--g;)j[g]=null==d?JU.PT.clean(f[g]):b?JU.PT.replaceAllCharacters(f[g],d,c):JU.PT.rep(f[g],d,c);return e.addXAS(j)}f=JS.SV.sValue(f);return e.addXStr(null==
d?JU.PT.clean(f):b?JU.PT.replaceAllCharacters(f,d,c):JU.PT.rep(f,d,c))},"JS.ScriptMathProcessor,~A");t(p,"evaluateScript",function(e,a,b){if((134222350==b||134238732==b)&&1!=a.length||0==a.length)return!1;var d=JS.SV.sValue(a[0]),c=new JU.SB;switch(b){case 134218759:return 2==a.length?d.equalsIgnoreCase("JSON")&&e.addXObj(this.vwr.parseJSON(JS.SV.sValue(a[1]))):e.addXObj(this.vwr.evaluateExpressionAsVariable(d));case 134222850:a=2==a.length?JS.SV.sValue(a[1]):".";a.equals(".")||c.append(this.vwr.jsEval(a+
"\u0001"+d));(a.equals(".")||a.equals("*"))&&this.e.runScriptBuffer(d,c,!0);break;case 134222350:this.e.runScriptBuffer("show "+d,c,!0);break;case 134238732:return e.addX(this.vwr.jsEvalSV(d))}var d=c.toString(),f;return Float.isNaN(f=JU.PT.parseFloatStrict(d))?e.addXStr(d):0<=d.indexOf(".")?e.addXFloat(f):e.addXInt(JU.PT.parseInt(d))},"JS.ScriptMathProcessor,~A,~N");t(p,"evaluateSort",function(e,a,b){if(1<a.length)return!1;if(1275068444==b){if(1==a.length&&4==a[0].tok)return e.addX(e.getX().sortMapArray(a[0].asString()));
var d=0==a.length?0:a[0].asInt();return e.addX(e.getX().sortOrReverse(d))}b=e.getX();a=0==a.length?null:a[0];if(4==b.tok){var d=0,c=JS.SV.sValue(b);if(null==a)return e.addXInt(0);a=JS.SV.sValue(a);for(b=0;b<c.length;b++){b=c.indexOf(a,b);if(0>b)break;d++}return e.addXInt(d)}var d=new JU.Lst,f=c=null,j=JS.SV.getVariable(b.value).sortOrReverse(0).getList();if(null==j)return null==a?e.addXStr(""):e.addXInt(0);b=0;for(var g=j.size();b<=g;b++){var h=b==g?null:j.get(b);if(!(null!=a&&null!=h&&!JS.SV.areEqual(h,
a)))if(JS.SV.areEqual(h,c))f.intValue++;else{if(null!=c){var k=new JU.Lst;k.addLast(c);k.addLast(f);d.addLast(JS.SV.getVariableList(k))}f=JS.SV.newI(1);c=h}}return null==a?e.addX(JS.SV.getVariableList(d)):d.isEmpty()?e.addXInt(0):e.addX(d.get(0).getList().get(1))},"JS.ScriptMathProcessor,~A,~N");t(p,"evaluateString",function(e,a,b){var d=e.getX(),c=0<b.length?JS.SV.sValue(b[0]):1275068932==a?"":"\n";switch(b.length){case 0:break;case 1:if(1073742335==b[0].tok)return e.addX(JS.SV.getVariable(JU.PT.getTokens(d.asString())));
break;case 2:if(7==d.tok)break;if(1275069447==a){d=JS.SV.getVariable(JU.PT.split(JU.PT.rep(d.value,"\n\r","\n").$replace("\r","\n"),"\n"));break}default:return!1}if(7==d.tok&&1275068932!=a&&(1275069447!=a||2==b.length))return e.addX(d),this.evaluateList(e,a,b);b=1275069447==a&&10==d.tok||1275068932==a&&7==d.tok?null:JS.SV.sValue(d);switch(a){case 1275069447:if(10==d.tok){c=d.value;d=this.vwr.ms.mc;b=new JU.Lst;for(a=0;a<d;a++){var f=this.vwr.getModelUndeletedAtomsBitSet(a);f.and(c);b.addLast(JS.SV.getVariable(f))}return e.addXList(b)}return e.addXAS(JU.PT.split(b,
c));case 1275069446:return 0<b.length&&"\n"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1)),e.addXStr(JU.PT.rep(b,"\n",c));case 1275068932:if(null!=b)return e.addXStr(JU.PT.trim(b,c));d=JS.SV.strListValue(d);for(a=d.length;0<=--a;)d[a]=JU.PT.trim(d[a],c);return e.addXAS(d)}return e.addXStr("")},"JS.ScriptMathProcessor,~N,~A");t(p,"evaluateSubstructure",function(e,a,b,d){if(0==a.length||d&&(134218753==b||1<a.length))return!1;var c=134218756==b&&!d&&134218756==a[0].tok?a[0].value:null;if(null!=
c&&2>a.length)return!1;var f=134218756==b&&!d&&10==a[0].tok,j=134218753==a[0].tok?a[0].value:null!=c&&134218753==a[1].tok?a[1].value:null;if(null!=c&&null==j)return!1;var g=f?null:JS.SV.sValue(a[0]),h=new JU.BS;if(f||0<g.length)try{if(f)return e.addX(JS.SV.newV(134218756,this.vwr.getSmilesMatcher().compileSearchTarget(this.vwr.ms.at,this.vwr.ms.ac,JS.SV.getBitSet(a[0],!1))));if(null!=c)return e.addXBs(this.vwr.getSmilesMatcher().getSubstructureSet(j,c,0,null,2));if(134218753==b)return e.addX(JS.SV.newV(134218753,
this.vwr.getSmilesMatcher().compileSmartsPattern(g)));var k=d?e.getX().value:2==a.length&&10==a[1].tok?a[1].value:this.vwr.getModelUndeletedAtomsBitSet(-1),h=this.vwr.getSmilesMatcher().getSubstructureSet(null==j?g:j,this.vwr.ms.at,this.vwr.ms.ac,k,134218757==b?1:2)}catch(l){if(L(l,Exception))this.e.evalError(l.getMessage(),null);else throw l;}return 134218753!=b&&e.addXBs(h)},"JS.ScriptMathProcessor,~A,~N,~B");t(p,"evaluateSymop",function(e,a,b){var d=a.length,c=null;if(2==a.length&&4==a[0].tok&&
4==a[1].tok&&a[1].value.equalsIgnoreCase("matrix"))return c=this.vwr.getSymTemp().convertOperation(a[0].value,null),null!=c&&e.addXObj(c);if(2==a.length&&12==a[0].tok&&4==a[1].tok&&a[1].value.equalsIgnoreCase("xyz"))return c=this.vwr.getSymTemp().convertOperation("",a[0].value),null!=c&&e.addXObj(c);var f=b?e.getX():null,j=!1;if(null!=f&&10!=f.tok&&!(j=8==f.tok))return!1;c=null==f||j?null:f.value;f=j?JS.SV.ptValue(f):null;!j&&null==c&&(c=this.vwr.getThisModelAtoms());if(0==d){for(var f=JU.PT.split(JU.PT.trim(this.vwr.getSymTemp().getSpaceGroupInfo(this.vwr.ms,
null,null==c||c.isEmpty()?Math.max(0,this.vwr.am.cmi):this.vwr.ms.at[c.nextSetBit(0)].mi,!1,null).get("symmetryInfo"),"\n"),"\n"),g=new JU.Lst,h=0,k=f.length;h<k;h++)g.addLast(JU.PT.split(f[h],"\t"));return e.addXList(g)}var l=null,s=!1,m=!1,k=-2147483648,r=0,n=null,q=null;switch(a[0].tok){case 4:l=JS.SV.sValue(a[0]);null!=l&&(s=l.equalsIgnoreCase("invariant"),m=l.equalsIgnoreCase("wyckoff"));r++;break;case 12:l=a[0].escape();r++;break;case 2:k=a[0].asInt();r++;break;case 10:j||(q=1==a.length||10!=
a[1].tok?c:null,c=this.vwr.getModelUndeletedAtomsBitSet(this.vwr.getModelIndexForAtom(c.nextSetBit(0))))}null==c&&(r<d&&10==a[r].tok&&(c=new JU.BS).or(a[r].value),r+1<d&&10==a[r+1].tok&&(null==c?c=new JU.BS:c).or(a[r+1].value));j=null;if(d>r&&7==a[r].tok){n=a[r++].getList();if(3!=n.size())return!1;j=JU.P3.new3(JS.SV.fValue(n.get(0)),JS.SV.fValue(n.get(1)),JS.SV.fValue(n.get(2)))}else d>r&&2==a[r].tok&&JU.SimpleUnitCell.ijkToPoint3f(JS.SV.iValue(a[r++]),j=new JU.P3,0,0);null==f&&null!=(f=d>r?e.ptValue(a[r],
c):null)&&r++;null!=(n=d>r?e.ptValue(a[r],c):null)&&r++;null!=f&&(null==n&&null!=q&&!q.isEmpty())&&(n=f,f=JU.P3.newP(this.vwr.ms.at[q.nextSetBit(0)]));q=null!=n&&a.length>r&&-2147483648==k&&2==a[r].tok?a[r].intValue:-1;0<=q&&r++;-2147483648==k&&!s&&(k=0);var p=null;!m&&(!s&&null!=l&&0>l.indexOf(","))&&(r==d?p=this.vwr.ms.getPointGroupInfo(null):6==a[r].tok&&(p=a[r].getMap()));if(null!=p){c=l.indexOf(".");a=l.indexOf("^");0<a?q=JU.PT.parseInt(l.substring(a+1)):(a=l.length,q=1);0<c&&a>c+1?(k=JU.PT.parseInt(l.substring(c+
1,a)),1>k&&(k=1),a=c):k=1;l=l.substring(0,a);c=p.get(l+"_m");if(null==c)return c=p.get(l),null==c?e.addXStr(""):e.addXObj(c);var u;try{if(A(c,"JS.SV"))if(u=p.get("center").value,11==c.tok)g=c.value;else if(7==c.tok)g=c.getList().get(k-1).value;else return!1;else u=p.get("center"),g=A(c,"JU.M3")?c:c.get(k-1);k=g;g=JU.M3.newM3(g);if(1<q)for(h=1;h<q;h++)g.mul(k);if(null==f)return e.addXObj(g);f=JU.P3.newP(f);f.sub(u);g.rotate(f);f.add(u);return e.addXPt(f)}catch(t){if(!L(t,Exception))throw t;}return!1}u=
d==r?m?"":s?"id":null!=n?"all":null!=f?"point":"matrix":JS.SV.sValue(a[r++]);d=(h=(!m||b)&&null!=c&&!c.isEmpty())?c.nextSetBit(0):-1;if(m){c=h?this.vwr.ms.getAtom(d):f;if(null==c)switch(u){case "":case "*":u="*";break;default:if(1==u.length)u+="*";else return!1}if(0==u.length||u.equalsIgnoreCase("label"))u=null;f=null==u?null:u.endsWith("*")||u.equalsIgnoreCase("coord")||u.equalsIgnoreCase("coords")?u:u.substring(0,1);h=this.vwr.getOperativeSymmetry();return e.addXObj(null==h?null:h.getWyckoffPosition(this.vwr,
c,f))}u=u.toLowerCase();if(s||u.equals("invariant")&&b)h&&null==f&&(f=this.vwr.ms.at[d]),0>d&&(d=this.vwr.getThisModelAtoms().nextSetBit(0));if(s&&-2147483648==k){l=null;h=this.vwr.getCurrentUnitCell();null!=f?l=null==h?M(0,0):h.getInvariantSymops(f,null):null!=c&&!c.isEmpty()&&(h=c.nextSetBit(0),f=this.vwr.ms.at[h],l=this.vwr.ms.getSymmetryInvariant(h));if(null!=l&&0<l.length){g=Array(l.length);for(h=0;h<g.length;h++)k=l[h],g[h]=this.vwr.getSymmetryInfo(d,null,k,null,f,f,1275068418,u,0,-1,0,null);
return e.addXObj(g)}return null!=l&&e.addXAI(l)}return r==a.length&&e.addXObj(this.vwr.getSymmetryInfo(d,l,k,j,f,n,1275068418,u,0,q,0,null))},"JS.ScriptMathProcessor,~A,~B");t(p,"evaluateTensor",function(e,a){var b=2==a.length&&1275068445==a[1].tok,d=b?null:e.getX();if(2<a.length||!b&&10!=d.tok)return!1;var d=d.value,c=b||0==a.length?null:JS.SV.sValue(a[0]).toLowerCase(),f=this.vwr.getNMRCalculation();if("unique".equals(c))return e.addXBs(f.getUniqueTensorSet(d));var j=2>a.length?null:JS.SV.sValue(a[1]).toLowerCase();
return b?e.addXObj(a[0].value.getInfo(j)):e.addXList(f.getTensorInfo(c,j,d))},"JS.ScriptMathProcessor,~A");t(p,"evaluateUserFunction",function(e,a,b,d,c){var f=null;if(c)switch(f=e.getX(),f.tok){case 10:break;case 6:if(0<b.length)return!1;f=f.getMap().get(a);return null==f?e.addXStr(""):e.addX(f);default:return!1}a=a.toLowerCase();e.wasX=!1;for(var j=new JU.Lst,g=0;g<b.length;g++)j.addLast(b[g]);if(c)return e.addXObj(this.e.getBitsetProperty(f.value,null,d,null,null,f.value,H(-1,[a,j]),!1,f.index,
!1));a=this.e.getUserFunctionResult(a,j,null);return null==a?!1:e.addX(a)},"JS.ScriptMathProcessor,~S,~A,~N,~B");t(p,"evaluateWithin",function(e,a,b){var d=a.length;if(1>d||5<d)return!1;if(1==d&&10==a[0].tok)return e.addX(a[0]);var c=b?JS.SV.getBitSet(e.getX(),!1):null,f=0,j=a[0].value,g=""+j,h=this.vwr.ms,k=!1,l=!1,p=!1,m=!1,r=null,n=a[0].tok;switch(4==n?n=JS.T.getTokFromName(g):n){case 1648363544:k=!0,j=null;case 3:case 2:m=!0;if(2>d||3==d&&7==a[1].tok&&7!=a[2].tok)return!1;f=k?100:JS.SV.fValue(a[0]);
switch(n=a[1].tok){case 1073742335:case 1073742334:l=a[1].asBoolean();if(2<d&&JS.SV.sValue(a[2]).equalsIgnoreCase("unitcell"))n=1814695966;else if(2<d&&10!=a[2].tok)return!1;d=0;break;case 4:n=JS.SV.sValue(a[1]);if(n.startsWith("$"))return e.addXBs(this.getAtomsNearSurface(f,n.substring(1)));if(n.equalsIgnoreCase("group"))p=!0,n=1086324742;else if(n.equalsIgnoreCase("vanderwaals")||n.equalsIgnoreCase("vdw"))j=null,k=!0,n=1648363544;else if(n=JS.T.getTokFromName(n),0==n)return!1}break;case 7:1==d&&
(j=a[0].asString(),n=0);break;case 1073742328:return 3==d&&A(a[1].value,"JU.BS")&&A(a[2].value,"JU.BS")&&e.addXBs(this.vwr.getBranchBitSet(a[2].value.nextSetBit(0),a[1].value.nextSetBit(0),!0));case 134218757:case 1237320707:case 134218756:f=null;b=!0;switch(d){case 2:f=c;break;case 3:if(b=10==a[2].tok)f=a[2].value;break;default:b=!1}return b&&e.addXObj(this.e.getSmilesExt().getSmilesMatches(JS.SV.sValue(a[1]),null,f,null,134218756==n?2:1,e.asBitSet,!1))}if("string"==typeof j){if(0==n){n=1073742362;
if(2<d)return!1;d=2}}else if(!m)return!1;switch(d){case 1:switch(n){case 136314895:case 2097184:case 1812599299:case 1814695966:return e.addXBs(h.getAtoms(n,null));case 1073741863:return e.addXBs(h.getAtoms(n,""));case 1073742362:return e.addXBs(h.getAtoms(1086324744,g))}return!1;case 2:switch(n){case 1073742362:n=1086324744;break;case 1073741824:case 1086326786:case 1086326785:case 1073741863:case 1086324744:case 1111490587:case 1073742128:case 1073741925:case 1073742189:return e.addXBs(this.vwr.ms.getAtoms(n,
JS.SV.sValue(a[1])));case 1094713349:case 1094713350:return e.addXBs(this.vwr.ms.getAtoms(n,JS.SV.ptValue(a[1])));case 1814695966:c=a[1].getList();if(null==c)return!1;f=f=null;if(4!=c.size())return!1;f=Array(4);for(a=0;4>a;a++)if(null==(f[a]=JS.SV.ptValue(c.get(a))))return!1;f=this.vwr.getSymTemp().getUnitCell(f,!1,null);return e.addXBs(this.vwr.ms.getAtoms(n,f))}break;case 3:switch(n){case 1073742335:case 1073742334:case 1086324742:case 1648363544:case 1814695966:case 134217750:case 134219777:case 1073742329:case 8:case 7:break;
case 1086324744:g=JS.SV.sValue(a[2]);break;default:return!1}}var q=null,j=d=null,t=a.length-1;switch(a[t].tok){case 9:q=a[t].value;break;case 8:d=a[t].value;JS.SV.sValue(a[1]).equalsIgnoreCase("hkl")&&(q=this.e.getHklPlane(d,NaN,null));break;case 7:j=2==t&&7==a[1].tok?a[1].getList():null,d=2==t?JS.SV.ptValue(a[1]):1==t?JU.P3.new3(NaN,0,0):null}if(null!=q)return e.addXBs(h.getAtomsNearPlane(f,q));h=10==a[t].tok?a[t].value:null;null==c&&(c=h);if(0<t&&null==d&&null==j&&null==c)return!1;if(1814695966==
n)return(null!=c||null!=d)&&e.addXObj(this.vwr.ms.getUnitCellPointsWithin(f,c,d,l));if(null!=d||null!=j){if(7==a[t].tok){b=a[t].getList();n=Array(b.size());for(a=n.length;0<=--a;)n[a]=JS.SV.ptValue(b.get(a));b=null;if(null!=j){b=Array(j.size());for(a=b.length;0<=--a;)b[a]=JS.SV.ptValue(j.get(a))}a=Array(1);null!=c&&(c.and(this.vwr.getAllAtoms()),b=this.vwr.ms.at);switch(J.bspt.PointIterator.withinDistPoints(f,d,n,b,c,a)){case 10:return e.addXBs(a[0]);case 134217751:return e.addXPt(a[0]);case 1073742001:return e.addXList(a[0]);
case 1275068418:return e.addXAI(a[0]);case 4:return e.addXStr(a[0]);default:return!1}}return e.addXBs(this.vwr.getAtomsNearPt(f,d,null))}if(1086324744==n)return e.addXBs(this.vwr.ms.getSequenceBits(g,c,new JU.BS));null==c&&(c=new JU.BS);if(!m)try{return e.addXBs(this.vwr.ms.getAtoms(n,c))}catch(u){if(L(u,Exception))return!1;throw u;}if(p)return e.addXBs(this.vwr.getGroupsWithin(aa(f),c));k&&(r=new J.atomdata.RadiusData(null,10<f?f/100:f,10<f?J.atomdata.RadiusData.EnumType.FACTOR:J.atomdata.RadiusData.EnumType.OFFSET,
J.c.VDW.AUTO),0>f&&(f=0));c=this.vwr.ms.getAtomsWithinRadius(f,b?h:c,l,r,b?c:null);b&&c.andNot(h);return e.addXBs(c)},"JS.ScriptMathProcessor,~A,~B");t(p,"evaluateWrite",function(e,a){var b=a.length,d=!1;2==b&&1073742335==a[1].tok&&(b=1,d=!0);switch(b){case 0:return!1;case 1:var c=a[0].asString().toUpperCase();if(c.equals("PNGJ"))return b=this.vwr.fm.getFileAsMap(null,"PNGJ",d),d?e.addX(JS.SV.newV(15,new JU.BArray(b))):e.addXMap(b);if(JU.PT.isOneOf(c,";ZIP;ZIPALL;JMOL;")){var b=new java.util.Hashtable,
f=new JU.OC;b.put("outputChannel",f);this.vwr.createZip(null,c,b);c=f.toByteArray();if(d)return e.addX(JS.SV.newV(15,new JU.BArray(c)));b=new java.util.Hashtable;this.vwr.readFileAsMap(JU.Rdr.getBIS(c),b,null);return e.addXMap(b)}}return e.addXStr(this.e.getCmdExt().dispatch(134221856,!0,a))},"JS.ScriptMathProcessor,~A");t(p,"getAtomsNearSurface",function(e,a){var b=H(-1,[a,null,null]);if(this.e.getShapePropertyData(24,"getVertices",b))return this.getAtomsNearPts(e,b[1],b[2]);b[1]=Integer.$valueOf(0);
b[2]=Integer.$valueOf(-1);if(this.e.getShapePropertyData(22,"getCenter",b))return this.vwr.getAtomsNearPt(e,b[2],null);b[1]=Float.$valueOf(e);return this.e.getShapePropertyData(21,"getAtomsWithin",b)?b[2]:new JU.BS},"~N,~S");t(p,"getAtomsNearPts",function(e,a,b){var d=new JU.BS;if(0==a.length||null!=b&&b.isEmpty())return d;null==b&&(b=JU.BSUtil.setAll(a.length));for(var c=this.vwr.ms.at,f=this.vwr.ms.ac;0<=--f;){var j=c[f];if(null!=j)for(var g=b.nextSetBit(0);0<=g;g=b.nextSetBit(g+1))if(j.distance(a[g])<
e){d.set(f);break}}return d},"~N,~A,JU.BS");t(p,"getMinMax",function(e,a,b){for(var d=null,c=null,f=0,j=null;;){if(JU.AU.isAF(e)){if(1275068725==a)return Float.$valueOf(NaN);d=e;f=d.length;if(0==f)break}else if(A(e,"JU.Lst"))if(c=e,f=c.size(),0==f){if(1275068725!=a)break}else{if(1275068725!=a){e=c.get(0);if(8==e.tok)return this.getMinMaxPoint(c,a);if(4==e.tok&&e.value.startsWith("{")){b=JS.SV.ptValue(e);if(A(b,"JU.P3"))return this.getMinMaxPoint(c,a);if(A(b,"JU.P4"))return this.getMinMaxQuaternion(c,
a);break}}}else break;var g,h=!1;switch(a){case 1275068725:j=new java.util.Hashtable;e=g=0;break;case 32:h=!0;e=3.4028235E38;g=2147483647;break;case 64:e=-3.4028235E38;g=-2147483647;break;default:e=g=0}for(var k=0,l=0,p=!0,m=1275068725==a;0<=--f;){var r=null==c?null:c.get(f),n=!b?null:null==r?JS.SV.vF:r,q=m?1:null==d?JS.SV.fValue(n):d[f];if(!Float.isNaN(q))switch(l++,a){case 160:case 192:k+=q*q;case 128:case 96:e+=q;break;case 1275068725:r=null==n?r.toString():n.asString();n=j.get(r);j.put(r,null==
n?Integer.$valueOf(1):Integer.$valueOf(n.intValue()+1));break;case 32:case 64:p=(new Boolean(p&2==n.tok)).valueOf(),h==q<e&&(e=q,p&&(g=n.intValue))}}if(1275068725==a)return j;if(0==l)break;switch(a){case 96:e/=l;break;case 192:if(1==l)break;e=Math.sqrt((k-e*e/l)/(l-1));break;case 32:case 64:if(p)return Integer.$valueOf(g);break;case 160:e=k}return Float.$valueOf(e)}return JS.MathExt.nan},"~O,~N,~B");t(p,"getMinMaxPoint",function(e,a){var b=null,d=null,c=0;A(e,Array)?(b=e,c=b.length):A(e,"JU.Lst")&&
(d=e,c=d.size());if(null==d&&null==b)return JS.MathExt.nan;for(var f=new JU.P3,j=C(c,0),g=0;3>g;g++){for(var h=0;h<c;h++){var k=null==b?JS.SV.ptValue(d.get(h)):b[h];if(null==k)return JS.MathExt.nan;switch(g){case 0:j[h]=k.x;break;case 1:j[h]=k.y;break;case 2:j[h]=k.z}}h=this.getMinMax(j,a,!0);if(!A(h,Number))return JS.MathExt.nan;h=h.floatValue();switch(g){case 0:f.x=h;break;case 1:f.y=h;break;case 2:f.z=h}}return f},"~O,~N");t(p,"getMinMaxQuaternion",function(e,a){var b;switch(a){case 32:case 64:case 128:case 160:return JS.MathExt.nan}for(;;){b=
this.e.getQuaternionArray(e,1073742001);if(null==b)break;var d=C(1,0);b=JU.Quat.sphereMean(b,d,1E-4);switch(a){case 96:return b;case 192:return Float.$valueOf(d[0])}break}return JS.MathExt.nan},"JU.Lst,~N");t(p,"getPatternMatcher",function(){return null==this.pm?this.pm=J.api.Interface.getUtil("PatternMatcher",this.e.vwr,"script"):this.pm});t(p,"opTokenFor",function(e){switch(e){case 1275069441:case 1275069446:return JS.T.tokenPlus;case 1275068931:return JS.T.tokenMinus;case 1275068929:return JS.T.tokenTimes;
case 1275068930:return JS.T.tokenMul3;case 1275068928:return JS.T.tokenDivide}return null},"~N");t(p,"setContactBitSets",function(e,a,b,d,c,f){var j,g;null==a?(a=JU.BSUtil.setAll(this.vwr.ms.ac),JU.BSUtil.andNot(a,this.vwr.slm.bsDeleted),a.andNot(e),j=!1):(g=JU.BSUtil.copy(e),g.or(a),g=this.vwr.ms.getModelBS(g,!1).cardinality(),j=1<g,f&&(1<g&&!this.e.tQuiet)&&this.e.showString(J.i18n.GT.$("Note: More than one model is involved in this contact!")));if(!e.equals(a)){if(f=!b||e.cardinality()<a.cardinality())g=
this.vwr.ms.getAtomsWithinRadius(d,e,j,Float.isNaN(d)?c:null,null),a.and(g);b&&(g=this.vwr.ms.getAtomsWithinRadius(d,a,j,Float.isNaN(d)?c:null,null),e.and(g),f||(g=this.vwr.ms.getAtomsWithinRadius(d,e,j,Float.isNaN(d)?c:null,null),a.and(g)),g=JU.BSUtil.copy(a),g.and(e),g.equals(e)?a.andNot(e):g.equals(a)&&e.andNot(a))}return a},"JU.BS,JU.BS,~B,~N,J.atomdata.RadiusData,~B");p.nan=Float.$valueOf(NaN);p.t0=System.currentTimeMillis()});V("J.bspt");W(null,"J.bspt.PointIterator","JU.BS $.Lst $.P3 J.bspt.Bspt JU.BSUtil $.Point3fi".split(" "),
function(){var p=ja(J.bspt,"PointIterator",null);p.withinDistPoints=t(p,"withinDistPoints",function(e,a,b,d,c,f){var j=new JU.Lst,g=new J.bspt.Bspt(3,0),h;if(null!=a&&Float.isNaN(a.x)){for(var k=Array(b.length),l=k.length;0<=--l;){h=b[l];if(null==h)return 0;null==c?(a=new JU.Point3fi,a.setT(h),a.i=l,k[l]=a,g.addTuple(a)):g.addTuple(h)}h=g.allocateCubeIterator();if(null!=c){b=JU.BS.newN(d.length);for(l=c.nextSetBit(0);0<=l;l=c.nextSetBit(l+1)){h.initialize(d[l],e,!1);for(g=e*e;h.hasMoreElements();)if(h.nextElement().distanceSquared(d[l])<=
g){b.set(l);break}}f[0]=b;return 10}b=JU.BSUtil.newBitSet2(0,b.length);for(l=k.length;0<=--l;){h.initialize(a=k[l],e,!1);g=e*e;for(c=0;h.hasMoreElements();)d=h.nextElement(),b.get(d.i)&&(d.distanceSquared(a)<=g&&1<++c)&&b.clear(d.i)}for(l=b.nextSetBit(0);0<=l;l=b.nextSetBit(l+1))j.addLast(JU.P3.newP(k[l]));f[0]=j;return 1073742001}if(0==e){if(null==d){g=3.4028235E38;k=null;for(l=b.length;0<=--l;)j=b[l],e=j.distanceSquared(a),e<g&&(k=j,g=e);f[0]=null==k?"":k;return null==k?4:134217751}k=M(d.length,
0);for(l=k.length;0<=--l;){g=3.4028235E38;c=-1;a=d[l];for(h=b.length;0<=--h;)j=b[h],e=j.distanceSquared(a),e<g&&(c=h,g=e);k[l]=c}f[0]=k;return 1275068418}for(l=b.length;0<=--l;)g.addTuple(b[l]);h=g.allocateCubeIterator();h.initialize(a,e,!1);for(g=e*e;h.hasMoreElements();)d=h.nextElement(),d.distanceSquared(a)<=g&&j.addLast(d);h.release();f[0]=j;return 1073742001},"~N,JU.P3,~A,~A,JU.BS,~A")});V("JU");W(null,"JU.PatternMatcher",["JV.Viewer"],function(){var p=ja(JU,"PatternMatcher",null);t(p,"compile",
function(e,a){if(JV.Viewer.isJS&&!JV.Viewer.isSwingJS)return new JU.PatternMatcher.JSPattern(e,a)},"~S,~B");p=$(function(){this.strString=this.regexp=null;this.rightBound=this.leftBound=-1;this.results=null;Z(this,arguments)},JU.PatternMatcher,"JSPattern",null);ka(p,function(e,a){this.regexp=RegExp(e,a?"gi":"g")},"~S,~B");t(p,"find",function(){var e=this.rightBound==this.strString.length?this.strString:this.strString.substring(0,this.rightBound);this.regexp.lastIndex=this.leftBound;this.results=this.regexp.exec(e);
this.leftBound=this.regexp.lastIndex;return null!=this.results});t(p,"start",function(){return this.regexp.lastIndex-this.results[0].length});t(p,"end",function(){return this.regexp.lastIndex});t(p,"group",function(){return null==this.results||0==this.results.length?null:this.results[0]});t(p,"matcher",function(e){this.strString=e;this.leftBound=0;this.rightBound=e.length;return this},"~S")})})(Clazz,Clazz.getClassName,Clazz.newLongArray,Clazz.doubleToByte,Clazz.doubleToInt,Clazz.doubleToLong,Clazz.declarePackage,
Clazz.instanceOf,Clazz.load,Clazz.instantialize,Clazz.decorateAsClass,Clazz.floatToInt,Clazz.floatToLong,Clazz.makeConstructor,Clazz.defineEnumConstant,Clazz.exceptionOf,Clazz.newIntArray,Clazz.newFloatArray,Clazz.declareType,Clazz.prepareFields,Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,Clazz.newShortArray,Clazz.innerTypeInstance,Clazz.isClassDefined,Clazz.prepareCallback,Clazz.newArray,Clazz.castNullAs,Clazz.floatToShort,Clazz.superCall,Clazz.decorateAsType,Clazz.newBooleanArray,
Clazz.newCharArray,Clazz.implementOf,Clazz.newDoubleArray,Clazz.overrideConstructor,Clazz.clone,Clazz.doubleToShort,Clazz.getInheritedLevel,Clazz.getParamsType,Clazz.isAF,Clazz.isAB,Clazz.isAI,Clazz.isAS,Clazz.isASS,Clazz.isAP,Clazz.isAFloat,Clazz.isAII,Clazz.isAFF,Clazz.isAFFF,Clazz.tryToSearchAndExecute,Clazz.getStackTrace,Clazz.inheritArgs,Clazz.alert,Clazz.defineMethod,Clazz.overrideMethod,Clazz.declareAnonymous,Clazz.cloneFinals);
