(function(Q,R,S,T,I,U,F,t,K,L,M,V,W,N,X,Y,G,H,A,Z,O,$,aa,P,ba,ca,da,ea,fa,ga,y,ha,ia,ja,ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za,Aa,Ba,Ca,Da,Ea,Fa,Ga,Ha,j,x){F("J.api");P(J.api,"JmolPropertyManager");F("JV");K(["J.api.JmolPropertyManager","java.util.Hashtable"],"JV.PropertyManager","java.lang.Boolean $.Double $.Float java.util.Arrays $.Date $.Map JU.AU $.BArray $.BS $.Base64 $.Lst $.M3 $.M4 $.P3 $.PT $.SB $.V3 J.api.Interface JM.BondSet $.LabelToken JS.SV $.T JU.BSUtil $.C $.Edge $.Escape $.JmolMolecule $.Logger JV.ActionManager $.FileManager $.JC $.Viewer JV.binding.Binding".split(" "),
function(){c$=M(function(){this.map=this.vwr=null;L(this,arguments)},JV,"PropertyManager",null,J.api.JmolPropertyManager);O(c$,function(){this.map=new java.util.Hashtable});N(c$,function(){});x(c$,"setViewer",function(b){this.vwr=b;for(var c=b=0;b<JV.PropertyManager.propertyTypes.length;b+=3,c++)0<JV.PropertyManager.propertyTypes[b].length&&this.map.put(JV.PropertyManager.propertyTypes[b].toLowerCase(),Integer.$valueOf(c))},"JV.Viewer");x(c$,"getPropertyNumber",function(b){b=this.map.get(null==b?
"":b.toLowerCase());return null==b?-1:b.intValue()},"~S");x(c$,"getDefaultPropertyParam",function(b){return 0>b?"":JV.PropertyManager.propertyTypes[3*b+2]},"~N");x(c$,"checkPropertyParameter",function(b){b=this.getPropertyNumber(b);b=JV.PropertyManager.getParamType(b);return 0<b.length&&"<atom selection>"!==b},"~S");x(c$,"getProperty",function(b,c,e){141!=JV.PropertyManager.propertyTypes.length&&JU.Logger.warn("propertyTypes is not the right length: "+JV.PropertyManager.propertyTypes.length+" != 141");
var a;0<=c.indexOf(".")||0<=c.indexOf("[")?(a=this.getArguments(c),e=this.getPropertyAsObject(a[0].asString(),e,null),a=this.extractProperty(e,a,1,null,!1)):a=this.getPropertyAsObject(c,e,b);if(null==b)return a;(e=b.equalsIgnoreCase("readable"))&&(b=JV.PropertyManager.isReadableAsString(c)?"String":"JSON");return b.equalsIgnoreCase("String")?null==a?"":a.toString():e?JU.Escape.toReadable(c,a):b.equalsIgnoreCase("JSON")?JS.SV.safeJSON(c,a):a},"~S,~S,~O");j(c$,"getArguments",function(b){var c=b.toLowerCase(),
e=-1;if(0<=b.indexOf('"')||0<=b.indexOf("'"))b=this.fixSelectQuotes(b);for(;0<=(e=c.indexOf("[select ",++e));){var a=c.indexOf(" where ",e),d=c.indexOf(" wherein ",e);0<d&&d<a&&(a=d);var f=c.indexOf("][select ",e);0>f&&(f=c.lastIndexOf("]"));d=c.indexOf("[",e);0<=d&&d<f&&(a=d);0>a||a>f||(b=b.substring(0,e+1)+b.substring(e+1,f).$replace(".","\u0001").$replace("[","\u0002").$replace("]","\u0003")+b.substring(f))}b=JU.PT.rep(JU.PT.rep(b.$replace("]","\x00").$replace("[","\x00"),"..","\u0004").$replace(".",
"\x00").$replace("\u0001",".").$replace("\u0002","[").$replace("\u0003","]"),"\u0004","..");b=JU.PT.rep(b,"\x00\x00","\x00");b=JU.PT.split(JU.PT.trim(b,"\x00"),"\x00");for(var c=Array(b.length),e=0,g;e<b.length;e++)c[e]=b[e].startsWith("'")||b[e].startsWith('"')?JS.SV.newS(JU.PT.trim(b[e],"'\"")):-2147483648==(g=JU.PT.parseInt(b[e]))?JS.SV.newS(b[e]):JS.SV.newI(g);return c},"~S");j(c$,"fixSelectQuotes",function(b){b=b.toCharArray();for(var c=!1,e=!1,a=!1,d=b.length;0<=--d;)switch(b[d]){case "'":a||
(c=e=!c);break;case '"':e||(c=a=!c);break;case ".":c&&(b[d]="\u0001");break;case "[":c&&(b[d]="\u0002");break;case "]":c&&(b[d]="\u0003")}return b=String.instantialize(b)},"~S");x(c$,"extractProperty",function(b,c,e,a,d){0>e&&(c=this.getArguments(c),e=0);if(e>=c.length)return b;if(!d){d=c=this.compileSelect(c);var f=e;for(c=d.length;f<c;f++)if(1275082245==d[f].tok){a=Array(f+1);for(var g=0;g<=f;g++)a[g]=d[g];for(b=this.extractProperty(b,a,e,null,!0);++f<c;)a[a.length-1]=d[f],b=this.extractProperty(b,
a,a.length-1,null,!0);return b}c=d}d=c[e++];g=JS.SV.oValue(b);switch(d.tok){case 2:f=d.intValue-1;if(t(g,JU.Lst))return 0>f&&(f+=g.size()),0<=f&&f<g.size()?this.extractProperty(g.get(f),c,e,null,!0):"";if(t(g,JU.M3))return a=g,a=y(-1,[A(-1,[a.m00,a.m01,a.m02]),A(-1,[a.m10,a.m11,a.m12]),A(-1,[a.m20,a.m21,a.m22])]),0>f&&(f+=3),0<=f&&3>f?this.extractProperty(a,c,--e,null,!0):"";if(t(g,JU.M4))return a=g,a=y(-1,[A(-1,[a.m00,a.m01,a.m02,a.m03]),A(-1,[a.m10,a.m11,a.m12,a.m13]),A(-1,[a.m20,a.m21,a.m22,a.m23]),
A(-1,[a.m30,a.m31,a.m32,a.m33])]),0>f&&(f+=4),0<=f&&4>f?this.extractProperty(a,c,--e,null,!0):"";if(JU.AU.isAI(g))return 0>f&&(f+=g.length),0<=f&&f<g.length?Integer.$valueOf(g[f]):"";if(JU.AU.isAD(g))return 0>f&&(f+=g.length),0<=f&&f<g.length?Double.$valueOf(g[f]):"";if(JU.AU.isAF(g))return 0>f&&(f+=g.length),0<=f&&f<g.length?Float.$valueOf(g[f]):"";if(JU.AU.isAII(g)||JU.AU.isAFF(g))return 0>f&&(f+=g.length),0<=f&&f<g.length?this.extractProperty(g[f],c,e,null,!0):"";if(JU.AU.isAS(g)||t(g,Array))return 0>
f&&(f+=g.length),0<=f&&f<g.length?g[f]:"";break;case 1275082245:case 4:if(t(g,java.util.Map)){var h=!1,z=b=!1,l=1275082245==d.tok?d.value[0]:null,k=null;if(1275082245==d.tok)if(z=!0,k=d.value[1],f=d.myName,b=0<=f.indexOf(";"),f.contains("**")){for(var m=0==l.size(),s="",n,j=g.entrySet().iterator();j.hasNext()&&((n=j.next())||1);)for(var r=n.getKey(),f=m?1:l.size();0<=--f;)if(m||JU.PT.isLike(r,l.get(f))){var h=n.getValue(),p=!1;switch(t(h,JS.SV)?h.tok:0){case 7:p=!0;h=h.getList();break;case 6:case 14:h=
h.getMap();break;default:if(!t(h,java.util.Map)&&!(p=t(h,JU.Lst)))h=null}if(null!=h){if(p){null==a&&(a=new JU.Lst);e=h;c=e.size();for(d=0;d<c;d++)if(h=e.get(d),t(h,JS.SV)&&null!=(h=h.getMap()))(null==k||this.vwr.checkSelect(h,k))&&a.addLast(h);return a}if(null==k||this.vwr.checkSelect(h,k))s+=","+r}}if(0==s.length)return new JU.Lst;f=s.substring(1);h=!b;l=null}else{if(null!=k&&!this.vwr.checkSelect(g,k))return""}else if(f=d.asString(),f.equalsIgnoreCase("keys")){a=new JU.Lst;for(d=g.keySet().iterator();d.hasNext()&&
((r=d.next())||1);)a.addLast(r);return this.extractProperty(a,c,e,null,!0)}n=b||0<=f.indexOf(",")||0<=f.indexOf(";");z&&!n&&(n=!0,f+=",");k=b||f.startsWith("*")||f.endsWith("*")||n;r=null!=a;if(k&&(r||(a=new JU.Lst),!b&&(null==l?1==f.length:0==l.size()))){if(e==c.length){if(!r)return g;a.addLast(g);return a}return this.extractProperty(g,c,e,a,!0)}f.contains("**")&&(f=JU.PT.rep(f,"**","*"));k&&!n&&(f+=",");if(h||b||f.contains(",")){n=new java.util.Hashtable;null!=l&&0==l.size()&&(l=null,f="*");b=(new Boolean(b|
1==d.index)).valueOf();if(null==l){d=JU.PT.split(f,",");for(f=d.length;0<=--f;)JV.PropertyManager.getMapSubset(g,d[f],n,b?a:null)}else for(f=0;f<l.size();f++)JV.PropertyManager.getMapSubset(g,l.get(f),n,b?a:null);if(h&&!r)return n;if(e==c.length){if(!b){if(!r)return n;a.addLast(n)}return a}return this.extractProperty(n,c,e,r?a:null,!0)}f=this.checkMap(g,f,k,a,c,e,z);return null!=f&&!k?this.extractProperty(g.get(f),c,e,null,!0):!k?"":a}if(t(g,JU.Lst)){null==a&&(a=new JU.Lst);e--;p=!1;for(f=0;f<g.size();f++)if(h=
g.get(f),t(h,java.util.Map)||(p=t(h,JU.Lst))||t(h,JS.SV)&&(null!=h.getMap()||(p=null!=h.getList())))p||1==d.index?(r=this.extractProperty(h,c,e,null,!0),""!==r&&a.addLast(r)):this.extractProperty(h,c,e,a,!0);return a}}return b},"~O,~O,~N,JU.Lst,~B");c$.getMapSubset=j(c$,"getMapSubset",function(b,c,e,a){if(c.startsWith('"')||c.startsWith("'"))c=JU.PT.trim(c,"\"'");var d=b.get(c);if(null!=d)null==a?e.put(c,d):a.addLast(d);else{var f;for(b=b.entrySet().iterator();b.hasNext()&&((f=b.next())||1);)d=f.getKey(),
JU.PT.isLike(d,c)&&(null==a?e.put(d,f.getValue()):a.addLast(f.getValue()))}},"java.util.Map,~S,java.util.Map,JU.Lst");j(c$,"compileSelect",function(b){for(var c=null,e=b.length;0<=--e;)if(4==b[e].tok){var a=b[e].value,d=a.toUpperCase();d.startsWith("WHERE")&&(d=(a="SELECT * "+a).toUpperCase());if(d.startsWith("SELECT ")){null==c&&(c=JU.AU.arrayCopyObject(b,b.length));d=(a=a.substring(6).trim()).toUpperCase();if(d.startsWith("WHERE ")||d.startsWith("WHEREIN "))d=(a="* "+a).toUpperCase();var f=d.indexOf(" WHEREIN "),
g=0>f?"":0<=a.indexOf(";")?";**":",**";0>f&&(f=d.indexOf(" WHERE "));var d=a.substring(0,0>f?a.length:f).trim(),h=0;d.startsWith("(")&&d.endsWith(")")?d=d.substring(1,d.length-1)+";":d.startsWith("[")&&d.endsWith("]")&&(d=d.substring(1,d.length-1),h=1);0>f?(c[e]=JS.SV.newV(1275082245,y(-1,[this.getKeys(d),null])),c[e].myName=d,c[e].index=h):(d+=g,c[e]=JS.SV.newV(1275082245,y(-1,[this.getKeys(d),this.vwr.compileExpr(a.substring(f+6+g.length).trim())])),c[e].index=h,c[e].myName=d)}}return null==c?b:
c},"~A");j(c$,"getKeys",function(b){var c=new JU.Lst;b=JU.PT.rep(JU.PT.rep(b,"**","*"),";",",")+",";for(var e=0,a=-1;0<=(a=b.indexOf(",",a+1));)if(a>e){var d=b.substring(e,a);if(d.equals("*")){if(0==c.size())break}else c.addLast(d),e=a+1}return c},"~S");j(c$,"checkMap",function(b,c,e,a,d,f,g){var h=null==a&&b.containsKey(c);if(!h)for(var z=c.contains(";"),l=z?JU.PT.split(c,";"):null,k=e&&!g?c.toLowerCase():null,m,j=b.keySet().iterator();j.hasNext()&&((m=j.next())||1);){if(z){for(var n=l.length;0<=
--n;c=null)if(c=l[n],0!=c.length){if(g){if(!JU.PT.isLike(m,c))continue;break}k=0<=c.indexOf("*")?c.toLowerCase():null;if(this.checkKey(m,c,k))break}if(null==c)continue}else if(g?!JU.PT.isLike(m,c):!this.checkKey(m,c,k))continue;if(null==a)return m;a.addLast(this.extractProperty(b.get(m),d,f,null,!0));if(!e&&!z)return null}return h?c:null},"java.util.Map,~S,~B,JU.Lst,~O,~N,~B");j(c$,"checkKey",function(b,c,e){return b.equalsIgnoreCase(c)||null!=e&&JU.PT.isLike(b.toLowerCase(),e)},"~S,~S,~S");c$.getPropertyName=
j(c$,"getPropertyName",function(b){return 0>b?"":JV.PropertyManager.propertyTypes[3*b]},"~N");c$.getParamType=j(c$,"getParamType",function(b){return 0>b?"":JV.PropertyManager.propertyTypes[3*b+1]},"~N");c$.isReadableAsString=j(c$,"isReadableAsString",function(b){for(var c=JV.PropertyManager.readableTypes.length;0<=--c;)if(b.equalsIgnoreCase(JV.PropertyManager.readableTypes[c]))return!0;return!1},"~S");j(c$,"getPropertyAsObject",function(b,c,e){if(b.equals("tokenList"))return JS.T.getTokensLike(c);
var a=null,d=b.indexOf("#");0<d&&(a=y(-1,[b.substring(d+1),c]),b=b.substring(0,d));var d=this.getPropertyNumber(b),f=null!=a||null!=c&&""!==c;null==a&&(a=f?c:this.getDefaultPropertyParam(d));switch(d){case 46:return this.vwr.getModelkitProperty(a);case 0:return this.getAppletInfo();case 5:return this.getAnimationInfo();case 14:return this.getAllAtomInfo(this.vwr.getAtomBitSet(a));case 24:return this.vwr.getAuxiliaryInfoForAtoms(a);case 15:return this.getAllBondInfo(a);case 25:return this.getBoundBoxInfo();
case 10:return this.vwr.tm.fixedRotationCenter;case 16:return this.getAllChainInfo(this.vwr.getAtomBitSet(a));case 37:return this.vwr.getProperty("DATA_API","consoleText",null);case 26:return this.vwr.getDataObj(a.toString(),null,-1);case 33:return this.vwr.getErrorMessageUn();case 28:return this.vwr.evaluateExpression(a.toString());case 20:return this.vwr.getModelExtract(a,!0,!1,"MOL");case 32:return JV.PropertyManager.getFileInfo(this.vwr.getFileData(),a.toString());case 45:return this.vwr.readCifData(a.toString(),
null);case 1:return this.vwr.fm.getFullPathName(!1);case 2:return this.vwr.getFileHeader();case 4:case 3:return f?this.vwr.getFileAsString3(a.toString(),!0,null):this.vwr.getCurrentFileAsString("prop");case 27:return b=a.toString().toLowerCase(),this.getImage(b,0>b.indexOf("g64")&&0>b.indexOf("base64")&&(null==e||e.equalsIgnoreCase("java")));case 35:return this.vwr.getShapeProperty(24,"info");case 36:return this.vwr.getShapeProperty(24,"data");case 40:return this.vwr.getNMRCalculation().getInfo(a.toString());
case 41:return this.getVariables(a.toString());case 21:return this.vwr.getStatusChanged(a.toString());case 22:return this.vwr;case 38:return this.vwr.getJspecViewProperties(a);case 7:return this.getLigandInfo(this.vwr.getAtomBitSet(a));case 9:return this.getMeasurementInfo();case 29:return this.vwr.getMenu(a.toString());case 23:return this.vwr.sm.messageQueue;case 30:return this.vwr.getMinimizationInfo();case 6:return this.getModelInfo(this.vwr.getAtomBitSet(a));case 18:return this.getMoleculeInfo(this.vwr.getAtomBitSet(a));
case 34:return this.getMouseInfo();case 11:return this.vwr.tm.getOrientationInfo();case 31:return this.vwr.ms.getPointGroupInfo(this.vwr.getAtomBitSet(a));case 17:return this.getAllPolymerInfo(this.vwr.getAtomBitSet(a));case 39:return this.vwr.getScriptQueueInfo();case 8:return this.getShapeInfo();case 19:return this.vwr.getStateInfo3(a.toString(),0,0);case 12:return JU.M3.newM3(this.vwr.tm.matrixRotate);case 42:return this.getAnnotationInfo(a,1073741925);case 43:return this.getAnnotationInfo(a,1073742189);
case 44:return a=JS.SV.oValue(a),a=t(a,java.util.Map)?a:null,null==a?null:this.vwr.sm.processService(a)}e=Array(47);for(c=0;47>c;c++)a=JV.PropertyManager.getParamType(c),d=this.getDefaultPropertyParam(c),f=JV.PropertyManager.getPropertyName(c),e[c]=0==f.length||"X"==f.charAt(0)?"":f+(""!==a?" "+JV.PropertyManager.getParamType(c)+(""!==d?" #default: "+this.getDefaultPropertyParam(c):""):"");java.util.Arrays.sort(e);a=new JU.SB;a.append("getProperty ERROR\n").append(b).append("?\nOptions include:\n");
for(c=0;47>c;c++)0<e[c].length&&a.append("\n getProperty ").append(e[c]);return a.toString()},"~S,~O,~S");j(c$,"getImage",function(b,c){var e=-1,a=-1,d;if(0<=(d=b.indexOf("height=")))e=JU.PT.parseInt(b.substring(d+7));if(0<=(d=b.indexOf("width=")))a=JU.PT.parseInt(b.substring(d+6));0>a&&0>e?e=a=-1:0>a?a=e:e=a;var f="JPG";0<=b.indexOf("type=")&&(f=JU.PT.getTokens(JU.PT.replaceWithCharacter(b.substring(b.indexOf("type=")+5),";,"," "))[0]);d=Array(1);e=this.vwr.getImageAsBytes(f.toUpperCase(),a,e,-1,
d);return null!=d[0]?d[0]:c?new JU.BArray(e):JU.Base64.getBase64(e).toString()},"~S,~B");j(c$,"getVariables",function(b){return b.toLowerCase().equals("all")?this.vwr.g.getAllVariables():this.vwr.evaluateExpressionAsVariable(b)},"~S");c$.getFileInfo=j(c$,"getFileInfo",function(b,c){var e=new java.util.Hashtable;if(null==b)return e;var a=null!=c&&0<c.length;if(t(b,java.util.Map))return a?b.get(c):b;var d=JU.PT.split(b,"\n");if(0==d.length||7>d[0].length||" "!=d[0].charAt(6)||!d[0].substring(0,6).equals(d[0].substring(0,
6).toUpperCase()))return e.put("fileHeader",b),e;var f="",g=new JU.SB;a&&(c=c.toUpperCase());for(var h="",z=0;z<d.length;z++){var l=d[z];if(!(12>l.length)){var h=l.substring(0,6).trim(),k=l.substring(7,10).trim();h.equals("REMARK")&&(h+=k);if(!h.equals(f)){if(a&&f.equals(c))return g.toString();a||(e.put(f,g.toString()),g=new JU.SB);f=h}(!a||h.equals(c))&&g.append(l).appendC("\n")}}a||e.put(f,g.toString());return a?h.equals(c)?g.toString():"":e},"~O,~S");j(c$,"getMoleculeInfo",function(b){b=this.vwr.getAtomBitSet(b);
for(var c=this.vwr.ms.getMolecules(),e=new JU.Lst,a=new JU.BS,d=0;d<c.length;d++){var a=JU.BSUtil.copy(b),f=c[d];a.and(f.atomList);0<a.length()&&(a=new java.util.Hashtable,a.put("mf",f.getMolecularFormula(!0,null,!1)),a.put("number",Integer.$valueOf(f.moleculeIndex+1)),a.put("modelNumber",this.vwr.ms.getModelNumberDotted(f.modelIndex)),a.put("numberInModel",Integer.$valueOf(f.indexInModel+1)),a.put("nAtoms",Integer.$valueOf(f.ac)),a.put("nElements",Integer.$valueOf(f.nElements)),e.addLast(a))}return e},
"~O");x(c$,"getModelInfo",function(b){b=this.vwr.ms.getModelBS(this.vwr.getAtomBitSet(b),!1);var c=this.vwr.ms,e=new java.util.Hashtable;e.put("modelSetName",c.modelSetName);e.put("modelIndex",Integer.$valueOf(this.vwr.am.cmi));e.put("modelCount",Integer.$valueOf(c.mc));e.put("isTainted",Boolean.$valueOf(null!=c.tainted));e.put("canSkipLoad",Boolean.$valueOf(c.canSkipLoad));e.put("modelSetHasVibrationVectors",Boolean.$valueOf(c.modelSetHasVibrationVectors()));null!=c.modelSetProperties&&e.put("modelSetProperties",
c.modelSetProperties);e.put("modelCountSelected",Integer.$valueOf(b.cardinality()));e.put("modelsSelected",b);var a=new JU.Lst;c.getMolecules();for(var d=b.nextSetBit(0);0<=d;d=b.nextSetBit(d+1)){var f=new java.util.Hashtable;f.put("_ipt",Integer.$valueOf(d));f.put("num",Integer.$valueOf(c.getModelNumber(d)));f.put("file_model",c.getModelNumberDotted(d));f.put("name",c.getModelName(d));var g=c.getModelTitle(d);null!=g&&f.put("title",g);g=c.getModelFileName(d);null!=g&&f.put("file",g);g=c.getInfo(d,
"modelID");null!=g&&f.put("id",g);f.put("vibrationVectors",Boolean.$valueOf(this.vwr.modelHasVibrationVectors(d)));g=c.am[d];f.put("atomCount",Integer.$valueOf(g.act));f.put("bondCount",Integer.$valueOf(g.getBondCount()));f.put("groupCount",Integer.$valueOf(g.getGroupCount()));f.put("moleculeCount",Integer.$valueOf(g.moleculeCount));g.isBioModel&&f.put("polymerCount",Integer.$valueOf(g.getBioPolymerCount()));f.put("chainCount",Integer.$valueOf(c.getChainCountInModelWater(d,!0)));null!=g.properties&&
f.put("modelProperties",g.properties);var h=c.getInfo(d,"Energy");null!=h&&f.put("energy",h);f.put("atomCount",Integer.$valueOf(g.act));a.addLast(f)}e.put("models",a);return e},"~O");x(c$,"getLigandInfo",function(b){var c=this.vwr.getAtomBitSet(b),e=this.vwr.getAtomBitSet("solvent");b=new java.util.Hashtable;var a=new JU.Lst;b.put("ligands",a);var d=this.vwr.ms,f=JU.BSUtil.copyInvert(c,d.ac);f.or(e);for(var e=d.at,g=c.nextSetBit(0);0<=g;g=c.nextSetBit(g+1))(e[g].group.isProtein()||e[g].group.isDna()||
e[g].group.isRna())&&e[g].group.setAtomBitsAndClear(f,c);c=Array(d.mc);for(g=d.mc;0<=--g;)c[g]=this.vwr.getModelUndeletedAtomsBitSet(g),c[g].andNot(f);f=JU.JmolMolecule.getMolecules(e,c,null,f);for(g=0;g<f.length;g++){var c=f[g].atomList,h=new java.util.Hashtable;a.addLast(h);h.put("atoms",JU.Escape.eBS(c));for(var z="",l="",k=null,m=0,j=null,n="",v="",r=2147483647,p=2147483647,w=c.nextSetBit(0);0<=w;w=c.nextSetBit(w+1)){var q=e[w];if(k!==q.group){var k=q.group,u=q.getResno(),t=q.getChainID();r!=
u-1&&(0!=n.length&&r!=p&&(n+="-"+r),t=-1,p=u);v="/"+d.getModelNumberDotted(q.mi);0!=m&&t!=m&&(n+=":"+j+v);-1==t&&(n+=" "+u);r=u;m=q.getChainID();j=q.getChainIDStr();z+=l+q.getGroup3(!1);l="-"}}n+=(p==r?"":"-"+r)+(0==m?"":":"+j)+v;h.put("groupNames",z);h.put("residueList",n.substring(1))}return b},"~O");x(c$,"getAtomData",function(b,c,e){b.startsWith("{")||(b="{"+b+"}");var a=c.toLowerCase().startsWith("user:"),d=c.toLowerCase().startsWith("property_");e&&(!a&&!d)&&(c=c.toUpperCase());a=d?"%{"+c+"}":
a?c.substring(5):c.equals("xyzrn")?"%-2e %8.3x %8.3y %8.3z %4.2[vdw] 1 [%n]%r.%a#%i":c.equals("xyzvib")?"%-2e %10.5x %10.5y %10.5z %10.5vx %10.5vy %10.5vz":c.equals("pdb")?'{selected and not hetero}.label("ATOM  %5i %-4a%1A%3.3n %1c%4R%1E   %8.3x%8.3y%8.3z%6.2Q%6.2b          %2e  ").lines+{selected and hetero}.label("HETATM%5i %-4a%1A%3.3n %1c%4R%1E   %8.3x%8.3y%8.3z%6.2Q%6.2b          %2e  ").lines':c.equals("xyz")?"%-2e %10.5x %10.5y %10.5z":c.equals("cfi")?"print '$CFI from Jmol"+JV.Viewer.getJmolVersion()+
"\n'+{selected}.count + ' ' + {selected}.bonds.count + '\n'   + {selected}.format('%10.0[atomno] %10.0[elemno] %10.4[xyz]')  + {selected}.bonds.format('%i1 %i2') + '\n' + {selected}.bonds.format('%ORDER')":null;if(null==a)return this.getModelExtract(this.vwr.getAtomBitSet(b),!1,!1,c.toUpperCase(),e);if(a.startsWith("print"))return b.equals("selected")||(a=JU.PT.rep(a,"selected",b.substring(1,b.length-1))),this.vwr.runScriptCautiously(a);0>a.indexOf("label")?a=b+'.label("'+a+'").lines':b.equals("selected")||
(a=JU.PT.rep(a,"selected",b.substring(1,b.length-1)));return this.vwr.evaluateExpression(a)},"~S,~S,~B");x(c$,"getModelExtract",function(b,c,e,a,d){if(a.equalsIgnoreCase("CIF"))return this.getModelCif(b);if(a.equalsIgnoreCase("QCJSON"))return this.getQCJSON(b);if(a.equalsIgnoreCase("CML"))return this.getModelCml(b,2147483647,!0,c,d);if(a.equals("PDB")||a.equals("PQR"))return this.getPdbAtomData(b,null,a.equals("PQR"),c,d);var f=a.equalsIgnoreCase("V3000"),g=a.equalsIgnoreCase("SDF"),h=a.equalsIgnoreCase("MOL"),
j=!c&&a.equalsIgnoreCase("XYZVIB"),l=a.equalsIgnoreCase("XYZRN"),k=a.toUpperCase().startsWith("XYZ"),m=a.equalsIgnoreCase("JSON")||a.equalsIgnoreCase("CD");a=new JU.SB;var s=this.vwr.ms,n=JU.BSUtil.copy(b),v=this.vwr.ms.getModelBS(n,!0);if(!k&&!m){var r=this.vwr.ms.getFrameTitle(v.nextSetBit(0)),r=null!=r?r.$replace("\n"," "):e?"Jmol Model Kit":JV.FileManager.fixDOSName(this.vwr.fm.getFullPathName(!1));80<r.length&&(r=r.substring(0,77)+"...");a.append(r);e=JV.Viewer.getJmolVersion();a.append("\n__Jmol-").append(e.substring(0,
2));var p,w,q;q=new Date;e=q.getMonth();r=q.getDate();p=q.getFullYear();w=q.getHours();q=q.getMinutes();JU.PT.rightJustify(a,"_00",""+(1+e));JU.PT.rightJustify(a,"00",""+r);a.append((""+p).substring(2,4));JU.PT.rightJustify(a,"00",""+w);JU.PT.rightJustify(a,"00",""+q);a.append("3D 1   1.00000     0.00000     0");a.append("\nJmol version ").append(JV.Viewer.getJmolVersion()).append(" EXTRACT: ").append(JU.Escape.eBS(b)).append("\n")}r=s.at;for(e=b.nextSetBit(0);0<=e;e=b.nextSetBit(e+1))c&&r[e].isDeleted()&&
n.clear(e);p=JV.PropertyManager.getCovalentBondsForAtoms(s.bo,s.bondCount,n);if(!j&&n.isEmpty())return"";b=!0;null!=s.trajectory&&!d&&s.trajectory.selectDisplayed(v);c=c?this.vwr.tm.getRotationQ():null;if(k){h=JM.LabelToken.compile(this.vwr,l?"%-2e _XYZ_ %4.2[vdw] 1 [%n]%r.%a#%i\n":"%-2e _XYZ_\n","\x00",null);g=j?JM.LabelToken.compile(this.vwr,"%-2e _XYZ_ %12.5vx %12.5vy %12.5vz\n","\x00",null):null;l=new JU.P3;for(e=v.nextSetBit(0);0<=e;e=v.nextSetBit(e+1))if(f=JU.BSUtil.copy(n),f.and(s.getModelAtomBitSetIncludingDeleted(e,
!1)),!f.isEmpty()){a.appendI(f.cardinality()).appendC("\n");k=s.am[e].properties;a.append("Model["+(e+1)+"]: ");if(null!=s.frameTitles[e]&&0<s.frameTitles[e].length)a.append(s.frameTitles[e].$replace("\n"," "));else if(null==k)a.append("Jmol "+JV.Viewer.getJmolVersion());else{m=new JU.SB;d=k.propertyNames();for(p=null;d.hasMoreElements();)w=d.nextElement(),w.equals(".PATH")?p=k.getProperty(w):m.append(";").append(w).append("=").append(k.getProperty(w));null!=p&&m.append(";PATH=").append(p);p=m.substring(0<
m.length()?1:0);a.append(p.$replace("\n"," "))}a.appendC("\n");k=y(-1,[l]);for(m=f.nextSetBit(0);0<=m;m=f.nextSetBit(m+1))d=JM.LabelToken.formatLabelAtomArray(this.vwr,r[m],j&&null!=s.getVibration(m,!1)?g:h,"\x00",null,l),JV.PropertyManager.getPointTransf(e,s,r[m],c,l),d=JU.PT.rep(d,"_XYZ_",JU.PT.sprintf("%12.5p %12.5p %12.5p","p",k)),a.append(d)}}else if(j=J.api.Interface.getInterface("JU.MolWriter",this.vwr,"write").setViewer(this.vwr),g){r=a.toString();a=new JU.SB;for(e=v.nextSetBit(0);0<=e&&!(a.append(r),
f=JU.BSUtil.copy(n),f.and(s.getModelAtomBitSetIncludingDeleted(e,!1)),p=JV.PropertyManager.getCovalentBondsForAtoms(s.bo,s.bondCount,f),!(b=j.addMolFile(e,a,f,p,!1,!1,h,c)));e=v.nextSetBit(e+1));}else b=j.addMolFile(-1,a,n,p,f,m,h,c);return b?a.toString():"ERROR: Too many atoms or bonds -- use V3000 format."},"JU.BS,~B,~B,~S,~B");j(c$,"getQCJSON",function(){var b=J.api.Interface.getInterface("J.adapter.writers.QCJSONWriter",this.vwr,"script");b.set(this.vwr,null);b.writeJSON();return b.toString()},
"JU.BS");j(c$,"getModelCif",function(b){var c=new JU.SB;c.append("# primitive CIF file created by Jmol "+JV.Viewer.getJmolVersion()+"\ndata_primitive");var e=this.vwr.ms.getUnitCellForAtom(b.nextSetBit(0)),a=null==e?A(-1,[1,1,1,90,90,90]):e.getUnitCellAsArray(!1);c.append("\n_cell_length_a ").appendF(a[0]);c.append("\n_cell_length_b ").appendF(a[1]);c.append("\n_cell_length_c ").appendF(a[2]);c.append("\n_cell_angle_alpha ").appendF(a[3]);c.append("\n_cell_angle_beta ").appendF(a[4]);c.append("\n_cell_angle_gamma ").appendF(a[5]);
c.append("\n\n_symmetry_space_group_name_H-M 'P 1'\nloop_\n_space_group_symop_operation_xyz\n'x,y,z'");c.append("\n\nloop_\n_atom_site_label\n_atom_site_fract_x\n_atom_site_fract_y\n_atom_site_fract_z\n");for(var a=this.vwr.ms.at,d=new JU.P3,f=b.nextSetBit(0);0<=f;f=b.nextSetBit(f+1)){var g=a[f];d.setT(g);null!=e&&e.toFractional(d,!1);c.append(g.getElementSymbol()).append("\t").append(JU.PT.formatF(d.x,10,5,!0,!1)).append("\t").append(JU.PT.formatF(d.y,10,5,!0,!1)).append("\t").append(JU.PT.formatF(d.z,
10,5,!0,!1)).append("\n")}return c.toString()},"JU.BS");c$.getCovalentBondsForAtoms=j(c$,"getCovalentBondsForAtoms",function(b,c,e){for(var a=new JU.BS,d=0;d<c;d++){var f=b[d];e.get(f.atom1.i)&&(e.get(f.atom2.i)&&f.isCovalent())&&a.set(d)}return a},"~A,~N,JU.BS");c$.getPointTransf=j(c$,"getPointTransf",function(b,c,e,a,d){c.isTrajectory(0<=b?b:e.mi)?c.trajectory.getFractional(e,d):d.setT(e);null!=a&&a.transform2(d,d)},"~N,JM.ModelSet,JM.Atom,JU.Quat,JU.P3");x(c$,"getChimeInfo",function(b,c){switch(b){case 1073741982:break;
case 1073741863:return this.getBasePairInfo(c);default:return this.getChimeInfoA(this.vwr.ms.at,b,c)}var e=new JU.SB;this.vwr.getChimeMessenger().getAllChimeInfo(e);return e.appendC("\n").toString().substring(1)},"~N,JU.BS");j(c$,"getChimeInfoA",function(b,c,e){var a=new JU.SB;a.append("\n");var d="",f=null,g=null,h=-1,j=0;if(null!=e)for(var l=e.nextSetBit(0);0<=l;l=e.nextSetBit(l+1)){var k=b[l];switch(c){default:return"";case 1113589787:d=k.getInfo();break;case 1140850689:d=""+k.getAtomNumber();
break;case 1086324742:d=k.getGroup3(!1);break;case 1086326788:case 1073742120:case 1086324744:case 1086324743:var m=k.getChainID(),d=0==m?" ":k.getChainIDStr();300<=m&&(d=JU.PT.esc(d));switch(c){case 1073742120:d="["+k.getGroup3(!1)+"]"+k.group.getSeqcodeString()+":"+d;break;case 1086324744:case 1086324743:k.mi!=h&&(a.appendC("\n"),j=0,h=k.mi,a.append("Model "+k.getModelNumber()),f=g=null);k.group.chain!==f&&(a.appendC("\n"),j=0,f=k.group.chain,a.append("Chain "+d+":\n"),g=null);d=k.group;d!==g&&
(g=d,1086324743==c?a.append(k.getGroup1("?")):(0==j++%5&&1<j&&a.appendC("\n"),JU.PT.leftJustify(a,"          ","["+k.getGroup3(!1)+"]"+k.getResno()+" ")));continue}}0>a.indexOf("\n"+d+"\n")&&a.append(d).appendC("\n")}1086324744==c&&a.appendC("\n");return a.toString().substring(1)},"~A,~N,JU.BS");x(c$,"getModelFileInfo",function(b){for(var c=this.vwr.ms,e=new JU.SB,a=0;a<c.mc;++a)if(null==b||b.get(a)){var d='["'+c.getModelNumberDotted(a)+'"] = ';e.append("\n\nfile").append(d).append(JU.PT.esc(c.getModelFileName(a)));
var f=c.getInfo(a,"modelID");null!=f&&e.append("\nid").append(d).append(JU.PT.esc(f));e.append("\ntitle").append(d).append(JU.PT.esc(c.getModelTitle(a)));e.append("\nname").append(d).append(JU.PT.esc(c.getModelName(a)));e.append("\ntype").append(d).append(JU.PT.esc(c.getModelFileType(a)))}return e.toString()},"JU.BS");j(c$,"getAllAtomInfo",function(b){for(var c=new JU.Lst,e=new JU.P3,a=b.nextSetBit(0);0<=a;a=b.nextSetBit(a+1))c.addLast(this.getAtomInfoLong(a,e));return c},"JU.BS");j(c$,"getAtomInfoLong",
function(b,c){var e=this.vwr.ms,a=e.at[b],d=new java.util.Hashtable;e.getAtomIdentityInfo(b,d,c);d.put("element",e.getElementName(b));d.put("elemno",Integer.$valueOf(e.at[b].getElementNumber()));d.put("x",Float.$valueOf(a.x));d.put("y",Float.$valueOf(a.y));d.put("z",Float.$valueOf(a.z));d.put("coord",JU.P3.newP(a));null!=e.vibrations&&null!=e.vibrations[b]&&e.vibrations[b].getInfo(d);d.put("bondCount",Integer.$valueOf(a.getCovalentBondCount()));d.put("radius",Float.$valueOf(a.getRasMolRadius()/120));
d.put("model",a.getModelNumberForLabel());var f=a.atomPropertyString(this.vwr,1086324748);null!=f&&d.put("shape",f);d.put("visible",Boolean.$valueOf(a.checkVisible()));d.put("clickabilityFlags",Integer.$valueOf(a.clickabilityFlags));d.put("visibilityFlags",Integer.$valueOf(a.shapeVisibilityFlags));d.put("spacefill",Float.$valueOf(a.getRadius()));f=JU.Escape.escapeColor(this.vwr.gdata.getColorArgbOrGray(a.colixAtom));null!=f&&d.put("color",f);d.put("colix",Integer.$valueOf(a.colixAtom));(f=JU.C.isColixTranslucent(a.colixAtom))&&
d.put("translucent",Boolean.$valueOf(f));d.put("formalCharge",Integer.$valueOf(a.getFormalCharge()));d.put("partialCharge",Float.$valueOf(a.getPartialCharge()));f=a.getSurfaceDistance100()/100;0<=f&&d.put("surfaceDistance",Float.$valueOf(f));if(e.am[a.mi].isBioModel){d.put("resname",a.getGroup3(!1));var f=a.group.getInsertionCode(),g=a.getResno();0<g&&d.put("resno",Integer.$valueOf(g));0!=f.charCodeAt(0)&&d.put("insertionCode",""+f);d.put("name",e.at[b].getAtomName());d.put("chain",a.getChainIDStr());
d.put("atomID",Integer.$valueOf(a.atomID));d.put("groupID",Integer.$valueOf(a.group.groupID));"\x00"!=a.altloc&&d.put("altLocation",""+a.altloc);d.put("structure",Integer.$valueOf(a.group.getProteinStructureType().getId()));d.put("polymerLength",Integer.$valueOf(a.group.getBioPolymerLength()));d.put("occupancy",Integer.$valueOf(a.getOccupancy100()));e=a.getBfactor100();d.put("temp",Integer.$valueOf(I(e/100)))}return d},"~N,JU.P3");j(c$,"getAllBondInfo",function(b){var c=new JU.Lst,e=this.vwr.ms,a=
e.bondCount,e=e.bo,d;t(b,String)&&(b=this.vwr.getAtomBitSet(b));var f=new JU.P3;if(t(b,Array)){d=b[0];var g=b[1];for(b=0;b<a;b++){var h=e[b].atom1.i,j=e[b].atom2.i;(d.get(h)&&g.get(j)||g.get(h)&&d.get(j))&&c.addLast(this.getBondInfo(b,f))}}else if(t(b,JM.BondSet)){d=b;for(b=d.nextSetBit(0);0<=b&&b<a;b=d.nextSetBit(b+1))c.addLast(this.getBondInfo(b,f))}else if(t(b,JU.BS)){d=b;g=1==d.cardinality()?d.nextSetBit(0):-1;for(b=0;b<a;b++)(0<=g?e[b].atom1.i==g||e[b].atom2.i==g:d.get(e[b].atom1.i)&&d.get(e[b].atom2.i))&&
c.addLast(this.getBondInfo(b,f))}return c},"~O");j(c$,"getBondInfo",function(b,c){var e=this.vwr.ms.bo[b],a=e.atom1,d=e.atom2,f=new java.util.Hashtable;f.put("_bpt",Integer.$valueOf(b));var g=new java.util.Hashtable;this.vwr.ms.getAtomIdentityInfo(a.i,g,c);var h=new java.util.Hashtable;this.vwr.ms.getAtomIdentityInfo(d.i,h,c);f.put("atom1",g);f.put("atom2",h);f.put("jmol_order","0x"+Integer.toHexString(e.order));f.put("order",Float.$valueOf(JU.Edge.getBondOrderNumberFromOrder(e.order)));f.put("type",
JU.Edge.getBondOrderNameFromOrder(e.order));f.put("radius",Float.$valueOf(e.mad/2E3));f.put("length_Ang",Float.$valueOf(a.distance(d)));f.put("visible",Boolean.$valueOf(0!=e.shapeVisibilityFlags));a=JU.Escape.escapeColor(this.vwr.gdata.getColorArgbOrGray(e.colix));null!=a&&f.put("color",a);f.put("colix",Integer.$valueOf(e.colix));JU.C.isColixTranslucent(e.colix)&&f.put("translucent",Boolean.TRUE);return f},"~N,JU.P3");j(c$,"getAllChainInfo",function(b){for(var c=new java.util.Hashtable,e=new JU.Lst,
a=this.vwr.ms.mc,d=0;d<a;++d){var f=new java.util.Hashtable,g=this.getChainInfo(d,b);0<g.size()&&(f.put("modelIndex",Integer.$valueOf(d)),f.put("chains",g),e.addLast(f))}c.put("models",e);return c},"JU.BS");j(c$,"getChainInfo",function(b,c){for(var e=this.vwr.ms.am[b],a=e.getChainCount(!0),d=new JU.Lst,f=new JU.P3,g=0;g<a;g++){for(var h=e.getChainAt(g),j=new JU.Lst,l=h.groupCount,k=new java.util.Hashtable,m=0;m<l;m++){var s=h.groups[m];c.get(s.firstAtomIndex)&&j.addLast(s.getGroupInfo(m,f))}j.isEmpty()||
(k.put("residues",j),d.addLast(k))}return d},"~N,JU.BS");j(c$,"getAllPolymerInfo",function(b){var c=new java.util.Hashtable;null!=this.vwr.ms.bioModelset&&this.vwr.ms.bioModelset.getAllPolymerInfo(b,c);return c},"JU.BS");j(c$,"getBasePairInfo",function(b){var c=new JU.SB,e=new JU.Lst;this.vwr.ms.calcRasmolHydrogenBonds(b,b,e,!0,1,!1,null);for(b=e.size();0<=--b;){var a=e.get(b);JV.PropertyManager.getAtomResidueInfo(c,a.atom1);c.append(" - ");JV.PropertyManager.getAtomResidueInfo(c,a.atom2);c.append("\n")}return c.toString()},
"JU.BS");c$.getAtomResidueInfo=j(c$,"getAtomResidueInfo",function(b,c){b.append("[").append(c.getGroup3(!1)).append("]").append(c.group.getSeqcodeString()).append(":");var e=c.getChainID();b.append(0==e?" ":c.getChainIDStr())},"JU.SB,JM.Atom");j(c$,"getAppletInfo",function(){var b=new java.util.Hashtable;b.put("htmlName",this.vwr.htmlName);b.put("syncId",this.vwr.syncId);b.put("fullName",this.vwr.fullName);b.put("codeBase",""+JV.Viewer.appletCodeBase);this.vwr.isApplet&&(b.put("documentBase",JV.Viewer.appletDocumentBase),
b.put("registry",this.vwr.sm.getRegistryInfo()));b.put("version",JV.JC.version);b.put("date",JV.JC.date);b.put("javaVendor",JV.Viewer.strJavaVendor);b.put("javaVersion",JV.Viewer.strJavaVersion+(!JV.Viewer.isJS?"":JV.Viewer.isWebGL?"(WebGL)":"(HTML5)"));b.put("operatingZystem",JV.Viewer.strOSName);return b});j(c$,"getAnimationInfo",function(){var b=this.vwr.am,c=new java.util.Hashtable;c.put("firstModelIndex",Integer.$valueOf(b.firstFrameIndex));c.put("lastModelIndex",Integer.$valueOf(b.lastFrameIndex));
c.put("animationDirection",Integer.$valueOf(b.animationDirection));c.put("currentDirection",Integer.$valueOf(b.currentDirection));c.put("displayModelIndex",Integer.$valueOf(b.cmi));null!=b.animationFrames&&(c.put("isMovie",Boolean.TRUE),c.put("frames",JU.Escape.eAI(b.animationFrames)),c.put("currentAnimationFrame",Integer.$valueOf(b.caf)));c.put("displayModelNumber",this.vwr.getModelNumberDotted(b.cmi));c.put("displayModelName",0<=b.cmi?this.vwr.getModelName(b.cmi):"");c.put("animationFps",Integer.$valueOf(b.animationFps));
c.put("animationReplayMode",JS.T.nameOf(b.animationReplayMode));c.put("firstFrameDelay",Float.$valueOf(b.firstFrameDelay));c.put("lastFrameDelay",Float.$valueOf(b.lastFrameDelay));c.put("animationOn",Boolean.$valueOf(b.animationOn));c.put("animationPaused",Boolean.$valueOf(b.animationPaused));return c});j(c$,"getBoundBoxInfo",function(){var b=this.vwr.ms.getBoxInfo(null,1).getBoundBoxPoints(!0),c=new java.util.Hashtable;c.put("center",JU.P3.newP(b[0]));c.put("vector",JU.V3.newV(b[1]));c.put("corner0",
JU.P3.newP(b[2]));c.put("corner1",JU.P3.newP(b[3]));return c});j(c$,"getShapeInfo",function(){var b=new java.util.Hashtable,c=new JU.SB,e=this.vwr.shm.shapes;if(null!=e)for(var a=0;37>a;++a){var d=e[a];if(null!=d){var f=JV.JC.shapeClassBases[a],d=d.getShapeDetail();null!=d&&b.put(f,d)}}0<c.length()&&b.put("shapeCommands",c.toString());return b});j(c$,"getAnnotationInfo",function(b,c){var e=this.vwr.getAtomBitSet(b),e=this.vwr.ms.getModelBS(e,!1).nextSetBit(0);if(0>e)return null;var a=this.vwr.ms.getModelAuxiliaryInfo(e).get(1073741925==
c?"domains":"validation");if(null==a||6!=a.tok)return null;this.vwr.getAnnotationParser(!1).initializeAnnotation(a,c,e);return a.mapGet("_list")},"~O,~N");j(c$,"getMeasurementInfo",function(){return this.vwr.getShapeProperty(6,"info")});j(c$,"getMouseInfo",function(){if(!this.vwr.haveDisplay)return null;for(var b=new java.util.Hashtable,c=new JU.Lst,e=this.vwr.acm,a,d=e.b.getBindings().values().iterator();d.hasNext()&&((a=d.next())||1);)t(a,Boolean)||(JU.AU.isAI(a)&&(a=y(-1,[JV.binding.Binding.getMouseActionName(a[0],
!1),JV.ActionManager.getActionName(a[1])])),c.addLast(a));b.put("bindings",c);b.put("bindingName",e.b.name);b.put("actionNames",JV.ActionManager.actionNames);b.put("actionInfo",JV.ActionManager.actionInfo);b.put("bindingInfo",JU.PT.split(e.getBindingInfo(null),"\n"));return b});x(c$,"getPdbAtomData",function(b,c,e,a){if(0==this.vwr.ms.ac||0>b.nextSetBit(0))return"";null==c?c=this.vwr.getOutputChannel(null,null):(e=(new Boolean(e|0<=c.getType().indexOf("PQR"))).valueOf(),a=(new Boolean(a|0<=c.getType().indexOf("-coord true"))).valueOf());
var d=this.vwr.ms.at,f=this.vwr.ms.am,g="%6.2Q%6.2b          ";if(e){g="%8.4P%7.4V       ";e=0;for(var h=b.nextSetBit(0);0<=h;h=b.nextSetBit(h+1))e+=d[h].getPartialCharge();c.append("REMARK   1 PQR file generated by Jmol "+JV.Viewer.getJmolVersion()).append("\nREMARK   1 created "+new java.util.Date).append("\nREMARK   1 Forcefield Used: unknown\nREMARK   1").append("\nREMARK   5").append("\nREMARK   6 Total charge on this protein: "+e+" e\nREMARK   6\n")}h=d[b.nextSetBit(0)].mi;e=-1;var j=b.length()-
1,j=h!=d[j].mi,l=this.vwr.ms.getModelBS(b,!0),k=l.cardinality(),m=new JU.Lst,s=f[h].isPdbWithMultipleBonds,n=!1;if(1<k)for(var v=null,r=0,h=l.nextSetBit(0);0<=h;h=l.nextSetBit(h+1)){var p=this.vwr.ms.getModelAuxiliaryInfo(h).get("PDB_CONECT_bonds");if(p!==v||!this.vwr.ms.am[h].isBioModel)if(v=p,0<r++){n=!0;break}}var v=new JU.P3,r=y(-1,[v]),w=a?this.vwr.tm.getRotationQ():null;a=new java.util.Hashtable;for(var l=!1,q=n?G(k,0):null,k=0,h=b.nextSetBit(0);0<=h;h=b.nextSetBit(h+1)){p=d[h];l=f[p.mi].isBioModel;
j&&p.mi!=e&&(-1!=e&&(k=this.fixPDBFormat(m,a,c,q,k),c.append("ENDMDL\n")),m=new JU.Lst,e=p.mi,c.append("MODEL     "+(e+1)+"\n"));var n=p.getAtomName(),u=2==p.getElementSymbol().length||4<=n.length||JU.PT.isDigit(n.charAt(0)),n=p.isHetero(),n=l?n?u?JM.LabelToken.compile(this.vwr,"HETATM%5.-5i %-4.4a%1A%3.3n %1c%4.-4R%1E   _XYZ_"+g,"\x00",null):JM.LabelToken.compile(this.vwr,"HETATM%5.-5i  %-3.3a%1A%3.3n %1c%4.-4R%1E   _XYZ_"+g,"\x00",null):u?JM.LabelToken.compile(this.vwr,"ATOM  %5.-5i %-4.4a%1A%3.3n %1c%4.-4R%1E   _XYZ_"+
g,"\x00",null):JM.LabelToken.compile(this.vwr,"ATOM  %5.-5i  %-3.3a%1A%3.3n %1c%4.-4R%1E   _XYZ_"+g,"\x00",null):u?JM.LabelToken.compile(this.vwr,"HETATM%5.-5i %-4.4a%1AUNK %1c   1%1E   _XYZ_"+g,"\x00",null):JM.LabelToken.compile(this.vwr,"HETATM%5.-5i  %-3.3a%1AUNK %1c   1%1E   _XYZ_"+g,"\x00",null),l=p.getElementSymbolIso(!1).toUpperCase(),l=this.pdbKey(p.group.getBioPolymerIndexInModel())+this.pdbKey(p.group.groupIndex)+JM.LabelToken.formatLabelAtomArray(this.vwr,p,n,"\x00",null,v)+(1==l.length?
" "+l:l.substring(0,2))+"  ";JV.PropertyManager.getPointTransf(-1,this.vwr.ms,p,w,v);p=JU.PT.sprintf("%8.3p%8.3p%8.3p","p",r);24<p.length&&(p=JU.PT.sprintf("%8.2p%8.2p%8.2p","p",r));l=JU.PT.rep(l,"_XYZ_",p);m.addLast(l)}this.fixPDBFormat(m,a,c,q,k);j&&c.append("ENDMDL\n");e=k=-1;g=""+(j?k:0);l=!1;for(h=b.nextSetBit(0);0<=h;h=b.nextSetBit(h+1))if(p=d[h],j&&p.mi!=e&&(e=p.mi,l=f[e].isBioModel,k++),n=!l||p.isHetero(),m=!n&&16==p.getElementNumber(),n||s||m)if(v=p.bonds,null!=v)for(r=0;r<v.length;r++)if(q=
p.getAtomNumber(),u=v[r].getOtherAtom(p),b.get(u.i)&&(w=v[r].getCovalentOrder(),!(1==w&&(s&&!n&&!m||m&&16!=u.getElementNumber()))))switch(u=u.getAtomNumber(),w){case 2:case 3:if(u<q)continue;case 1:q=a.get(g+"."+Integer.$valueOf(q));u=a.get(g+"."+Integer.$valueOf(u));if(null==q||null==u)break;c.append("CONECT").append(JU.PT.formatStringS("%5s","s",""+q));q=JU.PT.formatStringS("%5s","s",""+u);for(u=0;u<w;u++)c.append(q);c.append("\n")}return c.toString()},"JU.BS,JU.OC,~B,~B,~B");j(c$,"pdbKey",function(b){b=
0>b?"~999":"   "+b;return b.substring(b.length-4)},"~N");j(c$,"fixPDBFormat",function(b,c,e,a,d){b.addLast("~999~999XXXXXX99999999999999999999~99~");var f=Array(b.size());b.toArray(f);java.util.Arrays.sort(f);b.clear();for(var g=0,h=f.length;g<h;g++)b.addLast(f[g]);for(var j=f=null,h=b.size(),l=0,k=null==a?0:a[d],g=0;g<h;g++){var m=b.get(g),s=m.substring(0,4),m=m.substring(8),n=!1,v=0<=m.indexOf("~99~");if(!s.equals(f)||v)null!=f&&!f.equals("~999")&&(n=!0,m="TER   "+j.substring(6,11)+"      "+j.substring(17,
27),b.add(g,s+"~~~~"+m),h++),f=s;if(v&&!n)break;j=m;l=g+1+k;null!=c&&!n&&c.put(""+d+"."+Integer.$valueOf(JU.PT.parseInt(m.substring(6,11))),Integer.$valueOf(l));s="     "+l;e.append(m.substring(0,6)).append(s.substring(s.length-5)).append(m.substring(11)).append("\n")}null!=a&&++d<a.length&&(a[d]=l);return d},"JU.Lst,java.util.Map,JU.OC,~A,~N");x(c$,"getPdbData",function(b,c,e,a,d,f){this.vwr.ms.isJmolDataFrameForModel(b)&&(b=this.vwr.ms.getJmolDataSourceFrame(b));if(0>b)return"";var g=this.vwr.ms.am[b],
h=g.isBioModel;if(null==a&&!h)return null;null==d&&(d=this.vwr.getOutputChannel(null,null));var j=new JU.SB,l=0<=c.indexOf("draw"),k=null,m=new JU.BS,s="\x00",n=this.vwr.ms.getLabeler().compile(this.vwr,"ATOM  %-6i%4a%1A%3.-3n %1c%4R%1E   ","\x00",null);if(null==a)s=11<c.length&&0<=c.indexOf("quaternion ")?c.charAt(11):"R",g.getPdbData(c,s,l,e,d,n,j,m),k=this.vwr.getModelUndeletedAtomsBitSet(b);else{k=a[0];b=a[1];var g=a[2],v=a[3],r=null!=g,p=null!=v,w=a[4],q=a[5],u=a[6],t=a[7],x=a[8],C=a[9];a=null!=
u&&null==x;var D=this.vwr.ms.at;if(a){d.append("REMARK   6 Jmol PDB-encoded data: ").append(c).append("; ").append(JV.Viewer.getJmolVersion()).append("; ").append(this.vwr.apiPlatform.getDateFormat(null)).append("\n");d.append("REMARK   6 Jmol data").append(" min = ").append(JU.Escape.eP(w)).append(" max = ").append(JU.Escape.eP(q)).append(" unScaledXyz = xyz * ").append(JU.Escape.eP(u)).append(" + ").append(JU.Escape.eP(t)).append(";\n");q=null;for(c=k.nextSetBit(0);0<=c;c=k.nextSetBit(c+1))if(w=
""+D[c].getAtomName(),null!=q||4<w.length)null==q?(q="",c=-1):q+=" "+w;null!=q&&d.append("REMARK   6 Jmol atom names").append(q).append("\n");q=null;for(c=k.nextSetBit(0);0<=c;c=k.nextSetBit(c+1))if(w=""+D[c].getGroup3(!0),null!=q||3<w.length)null==q?(q="",c=-1):q+=" "+w;null!=q&&d.append("REMARK   6 Jmol residue names").append(q).append("\n");for(c=0;c<C.length;c++)null!=C[c]&&d.append("REMARK   6 Jmol property ").append(C[c]).append(";\n")}C=null;w=new JU.P3;a||(null==x&&(x="%-5i %-10s %-13.5f "+
(p?"%-13.5f %-13.5f":r?"%-13.5f":"")),x+="\n");c=k.nextSetBit(0);for(q=0;0<=c;c=k.nextSetBit(c+1),q++){var u=b[q],t=r?g[q]:0,E=p?v[q]:0;if(!Float.isNaN(u)&&!Float.isNaN(t)&&!Float.isNaN(E)){var B=D[c];a?(d.append(JM.LabelToken.formatLabelAtomArray(this.vwr,B,n,"\x00",null,w)),h&&m.set(c),d.append(JU.PT.sprintf("%-8.2f%-8.2f%-10.2f    %6.3f          %2s    %s\n","ssF",y(-1,[B.getElementSymbolIso(!1).toUpperCase(),"",A(-1,[u,t,E,0])]))),null!=C&&C.group.getBioPolymerIndexInModel()==B.group.getBioPolymerIndexInModel()&&
j.append("CONECT").append(JU.PT.formatStringI("%5i","i",C.getAtomNumber())).append(JU.PT.formatStringI("%5i","i",B.getAtomNumber())).appendC("\n")):p?d.append(JU.PT.sprintf(x,"isF",y(-1,[Integer.$valueOf(B.getAtomNumber()),B.getAtomName(),A(-1,[u,t,E])]))):r?d.append(JU.PT.sprintf(x,"isF",y(-1,[Integer.$valueOf(B.getAtomNumber()),B.getAtomName(),A(-1,[u,t])]))):d.append(JU.PT.sprintf(x,"isF",y(-1,[Integer.$valueOf(B.getAtomNumber()),B.getAtomName(),A(-1,[u])])));C=B}}}d.append(j.toString());if(l)return d.toString();
e.and(k);h&&f&&d.append("\n\n"+this.vwr.ms.getProteinStructureState(m,"R"==s?4138:1073742086));return d.toString()},"~N,~S,JU.BS,~A,JU.OC,~B");x(c$,"getModelCml",function(b,c,e){var a=new JU.SB;if(0==b.cardinality())return"";JV.Viewer.isJS&&J.api.Interface.getInterface("JU.XmlUtil",this.vwr,"file");JV.PropertyManager.openTag(a,"molecule");JV.PropertyManager.openTag(a,"atomArray");for(var d=new JU.BS,f=this.vwr.ms.at,g=b.nextSetBit(0);0<=g&&!(0>--c);g=b.nextSetBit(g+1)){var h=f[g],j=h.getAtomName();
JU.PT.rep(j,'"',"''");d.set(h.i);JV.PropertyManager.appendTag(a,"atom/",y(-1,["id","a"+(h.i+1),"title",h.getAtomName(),"elementType",h.getElementSymbol(),"x3",""+h.x,"y3",""+h.y,"z3",""+h.z]))}JV.PropertyManager.closeTag(a,"atomArray");if(e){JV.PropertyManager.openTag(a,"bondArray");b=this.vwr.ms.bondCount;c=this.vwr.ms.bo;for(g=0;g<b;g++)e=c[g],f=e.atom2,d.get(e.atom1.i)&&d.get(f.i)&&(f=JU.Edge.getCmlBondOrder(e.order),null!=f&&JV.PropertyManager.appendTag(a,"bond/",y(-1,["atomRefs2","a"+(e.atom1.i+
1)+" a"+(e.atom2.i+1),"order",f])));JV.PropertyManager.closeTag(a,"bondArray")}JV.PropertyManager.closeTag(a,"molecule");return a.toString()},"JU.BS,~N,~B,~B,~B");c$.openTag=j(c$,"openTag",function(b,c){b.append("<").append(c).append(">\n")},"JU.SB,~S");c$.appendTag=j(c$,"appendTag",function(b,c,e){b.append("<").append(c);for(c=0;c<e.length;c++)b.append(" ").append(e[c]).append('="').append(e[++c]).append('"');b.append("/>\n")},"JU.SB,~S,~A");c$.closeTag=j(c$,"closeTag",function(b,c){b.append("</").append(c).append(">\n")},
"JU.SB,~S");x(c$,"fixJMEFormalCharges",function(b,c){var e=!1;if(null==b)return c;for(var a=b.nextSetBit(0);0<=a;a=b.nextSetBit(a+1)){var d=this.vwr.ms.at[a];if(0!=d.getFormalCharge()){e=!0;break}}if(!e)return c;e=this.vwr.getSmilesMatcher().getMapForJME(c,this.vwr.ms.at,b);if(null==e)return c;for(var d=e[0],f=e[1],e=JU.PT.getTokens(c),g=JU.PT.parseInt(e[0]),g=G(g,0),a=d.length;0<=--a;)g[d[a]]=f[a]+1;a=0;for(f=2;f<e.length;f+=3){var h=e[f];if(-2147483648!=JU.PT.parseInt(h))break;h=JU.PT.replaceAllCharacters(h,
"+-","");d=this.vwr.ms.at[g[a++]-1];if(!d.getElementSymbol().equals(h))return c;d=d.getFormalCharge();0!=d&&(e[f]=h+(0<d?"+":"-")+(1<Math.abs(d)?""+Math.abs(d):""))}return JU.PT.join(e," ",0)},"JU.BS,~S");H(c$,"atomExpression","<atom selection>");c$.propertyTypes=c$.prototype.propertyTypes=y(-1,"appletInfo;;;fileName;;;fileHeader;;;fileContents;<pathname>;;fileContents;;;animationInfo;;;modelInfo;<atom selection>;{*};ligandInfo;<atom selection>;{*};shapeInfo;;;measurementInfo;;;centerInfo;;;orientationInfo;;;transformInfo;;;;;;atomInfo;<atom selection>;(visible);bondInfo;<atom selection>;(visible);chainInfo;<atom selection>;(visible);polymerInfo;<atom selection>;(visible);moleculeInfo;<atom selection>;(visible);stateInfo;<state type>;all;extractModel;<atom selection>;(visible);jmolStatus;statusNameList;;jmolViewer;;;messageQueue;;;auxiliaryInfo;<atom selection>;{*};boundBoxInfo;;;dataInfo;<data type>;types;image;<width=www,height=hhh>;;evaluate;<expression>;;menu;<type>;current;minimizationInfo;;;pointGroupInfo;<atom selection>;(visible);fileInfo;<type>;;errorMessage;;;mouseInfo;;;isosurfaceInfo;;;isosurfaceData;;;consoleText;;;JSpecView;<key>;;scriptQueueInfo;;;nmrInfo;<elementSymbol> or 'all' or 'shifts';all;variableInfo;<name>;all;domainInfo;<atom selection>;{visible};validationInfo;<atom selection>;{visible};service;<hashTable>;;CIFInfo;<filename>;;modelkitInfo;<key>;data".split(";"));
H(c$,"PROP_APPLET_INFO",0,"PROP_FILENAME",1,"PROP_FILEHEADER",2,"PROP_FILECONTENTS_PATH",3,"PROP_FILECONTENTS",4,"PROP_ANIMATION_INFO",5,"PROP_MODEL_INFO",6,"PROP_LIGAND_INFO",7,"PROP_SHAPE_INFO",8,"PROP_MEASUREMENT_INFO",9,"PROP_CENTER_INFO",10,"PROP_ORIENTATION_INFO",11,"PROP_TRANSFORM_INFO",12,"PROP_ATOM_INFO",14,"PROP_BOND_INFO",15,"PROP_CHAIN_INFO",16,"PROP_POLYMER_INFO",17,"PROP_MOLECULE_INFO",18,"PROP_STATE_INFO",19,"PROP_EXTRACT_MODEL",20,"PROP_JMOL_STATUS",21,"PROP_JMOL_VIEWER",22,"PROP_MESSAGE_QUEUE",
23,"PROP_AUXILIARY_INFO",24,"PROP_BOUNDBOX_INFO",25,"PROP_DATA_INFO",26,"PROP_IMAGE",27,"PROP_EVALUATE",28,"PROP_MENU",29,"PROP_MINIMIZATION_INFO",30,"PROP_POINTGROUP_INFO",31,"PROP_FILE_INFO",32,"PROP_ERROR_MESSAGE",33,"PROP_MOUSE_INFO",34,"PROP_ISOSURFACE_INFO",35,"PROP_ISOSURFACE_DATA",36,"PROP_CONSOLE_TEXT",37,"PROP_JSPECVIEW",38,"PROP_SCRIPT_QUEUE_INFO",39,"PROP_NMR_INFO",40,"PROP_VAR_INFO",41,"PROP_DOM_INFO",42,"PROP_VAL_INFO",43,"PROP_SERVICE",44,"PROP_CIF_INFO",45,"PROP_MODELKIT_INFO",46,
"PROP_COUNT",47,"readableTypes",y(-1," stateinfo extractmodel filecontents fileheader image menu minimizationInfo".split(" ")))})})(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);
