text: Clazz.declarePackage("J.api");Clazz.declareInterface(J.api,"JmolPropertyManager");Clazz.declarePackage("J.viewer");
  Clazz.load(["J.api.JmolPropertyManager","java.util.Hashtable"],"J.viewer.PropertyManager","java.lang.Boolean $.Double $.Float java.util.Arrays J.io.Base64 J.modelset.Atom $.LabelToken J.script.SV $.T J.util.BS $.BSUtil $.C $.Elements $.Escape $.JmolEdge $.JmolList $.JmolMolecule $.Logger $.P3 $.Parser $.SB $.TextFormat $.V3 J.viewer.Viewer".split(" "),function(){c$=Clazz.decorateAsClass(function(){this.map=this.viewer=null;Clazz.instantialize(this,arguments)},J.viewer,"PropertyManager",null,J.api.JmolPropertyManager);
  Clazz.prepareFields(c$,function(){this.map=new java.util.Hashtable});Clazz.makeConstructor(c$,function(){});Clazz.overrideMethod(c$,"setViewer",function(a){this.viewer=a;for(var c=a=0;a<J.viewer.PropertyManager.propertyTypes.length;a+=3)this.map.put(J.viewer.PropertyManager.propertyTypes[a].toLowerCase(),Integer.$valueOf(c++))},"J.viewer.Viewer");Clazz.overrideMethod(c$,"getPropertyNumber",function(a){a=this.map.get(null==a?"":a.toLowerCase());return null==a?-1:a.intValue()},"~S");Clazz.overrideMethod(c$,
  "getDefaultPropertyParam",function(a){return 0>a?"":J.viewer.PropertyManager.propertyTypes[3*a+2]},"~N");Clazz.overrideMethod(c$,"checkPropertyParameter",function(a){a=this.getPropertyNumber(a);a=J.viewer.PropertyManager.getParamType(a);return 0<a.length&&"<atom selection>"!==a},"~S");Clazz.overrideMethod(c$,"getProperty",function(a,c,d){123!=J.viewer.PropertyManager.propertyTypes.length&&J.util.Logger.warn("propertyTypes is not the right length: "+J.viewer.PropertyManager.propertyTypes.length+" != 123");
  d=0<=c.indexOf(".")||0<=c.indexOf("[")?this.getModelProperty(c,d):this.getPropertyAsObject(c,d,a);if(null==a)return d;var b=a.equalsIgnoreCase("readable");b&&(a=J.viewer.PropertyManager.isReadableAsString(c)?"String":"JSON");return a.equalsIgnoreCase("String")?null==d?"":d.toString():b?J.util.Escape.toReadable(c,d):a.equalsIgnoreCase("JSON")?"{"+J.util.Escape.toJSON(c,d)+"}":d},"~S,~S,~O");$_M(c$,"getModelProperty",($fz=function(a,c){a=a.$replace("]"," ").$replace("["," ").$replace("."," ");a=J.util.TextFormat.simpleReplace(a,
  "  "," ");var d=J.util.TextFormat.splitChars(J.util.TextFormat.trim(a," ")," "),b=Array(d.length);a=d[0];for(var e,f=1;f<d.length;f++)b[f]=-2147483648!=(e=J.util.Parser.parseInt(d[f]))?J.script.SV.newScriptVariableInt(e):J.script.SV.newVariable(4,d[f]);return this.extractProperty(this.getProperty(null,a,c),b,1)},$fz.isPrivate=!0,$fz),"~S,~O");Clazz.overrideMethod(c$,"extractProperty",function(a,c,d){if(d>=c.length)return a;var b,e=c[d++];switch(e.tok){case 2:b=e.asInt()-1;if(Clazz.instanceOf(a,J.util.JmolList))return 0>
  b&&(b+=a.size()),0<=b&&b<a.size()?this.extractProperty(a.get(b),c,d):"";if(Clazz.instanceOf(a,J.util.Matrix3f))return a=[[a.m00,a.m01,a.m02],[a.m10,a.m11,a.m12],[a.m20,a.m21,a.m22]],0>b&&(b+=3),0<=b&&3>b?this.extractProperty(a,c,--d):"";if(J.util.Escape.isAI(a))return 0>b&&(b+=a.length),0<=b&&b<a.length?Integer.$valueOf(a[b]):"";if(J.util.Escape.isAD(a))return 0>b&&(b+=a.length),0<=b&&b<a.length?Double.$valueOf(a[b]):"";if(J.util.Escape.isAF(a))return 0>b&&(b+=a.length),0<=b&&b<a.length?Float.$valueOf(a[b]):
  "";if(J.util.Escape.isAII(a)||J.util.Escape.isAFF(a))return 0>b&&(b+=a.length),0<=b&&b<a.length?this.extractProperty(a[b],c,d):"";if(J.util.Escape.isAS(a)||Clazz.instanceOf(a,Array))return 0>b&&(b+=a.length),0<=b&&b<a.length?a[b]:"";break;case 4:var f=e.asString();if(Clazz.instanceOf(a,java.util.Map)){if(f.equalsIgnoreCase("keys")){f=new J.util.JmolList;for(e=a.keySet().iterator();e.hasNext()&&((b=e.next())||1);)f.addLast(b);return this.extractProperty(f,c,d)}if(!a.containsKey(f))for(e=a.keySet().iterator();e.hasNext()&&
  ((b=e.next())||1);)if(b.equalsIgnoreCase(f)){f=b;break}return a.containsKey(f)?this.extractProperty(a.get(f),c,d):""}if(Clazz.instanceOf(a,J.util.JmolList)){e=new J.util.JmolList;d--;for(b=0;b<a.size();b++)f=a.get(b),Clazz.instanceOf(f,java.util.Map)&&e.addLast(this.extractProperty(f,c,d));return e}}return a},"~O,~A,~N");c$.getPropertyName=$_M(c$,"getPropertyName",($fz=function(a){return 0>a?"":J.viewer.PropertyManager.propertyTypes[3*a]},$fz.isPrivate=!0,$fz),"~N");c$.getParamType=$_M(c$,"getParamType",
  ($fz=function(a){return 0>a?"":J.viewer.PropertyManager.propertyTypes[3*a+1]},$fz.isPrivate=!0,$fz),"~N");c$.isReadableAsString=$_M(c$,"isReadableAsString",($fz=function(a){for(var c=J.viewer.PropertyManager.readableTypes.length;0<=--c;)if(a.equalsIgnoreCase(J.viewer.PropertyManager.readableTypes[c]))return!0;return!1},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"getPropertyAsObject",($fz=function(a,c,d){if(a.equals("tokenList"))return J.script.T.getTokensLike(c);var b=this.getPropertyNumber(a),e=null!=c&&
  0<c.toString().length;c=e?c:this.getDefaultPropertyParam(b);switch(b){case 0:return this.viewer.getAppletInfo();case 5:return this.viewer.getAnimationInfo();case 13:return this.viewer.getAtomBitSetVector(c);case 14:return this.getAllAtomInfo(this.viewer.getAtomBitSet(c));case 24:return this.viewer.getAuxiliaryInfo(c);case 15:return this.getAllBondInfo(c);case 25:return this.viewer.getBoundBoxInfo();case 10:return this.viewer.getRotationCenter();case 16:return this.getAllChainInfo(this.viewer.getAtomBitSet(c));
  case 37:return this.viewer.getProperty("DATA_API","consoleText",null);case 26:return this.viewer.getData(c.toString());case 33:return this.viewer.getErrorMessageUn();case 28:return this.viewer.evaluateExpression(c.toString());case 20:return this.viewer.getModelExtract(c,!0,!1,"MOL");case 32:return J.viewer.PropertyManager.getFileInfo(this.viewer.getFileData(),c.toString());case 1:return this.viewer.getFullPathName();case 2:return this.viewer.getFileHeader();case 4:case 3:return e?this.viewer.getFileAsString(c.toString()):
  this.viewer.getCurrentFileAsString();case 27:a=c.toString().toLowerCase();e=b=-1;if(0<=(c=a.indexOf("height=")))b=J.util.Parser.parseInt(a.substring(c+7));if(0<=(c=a.indexOf("width=")))e=J.util.Parser.parseInt(a.substring(c+6));0>e&&0>b?b=e=-1:0>e?e=b:b=e;if(0<=a.indexOf("g64")||0<=a.indexOf("base64"))d="string";c=new java.util.Hashtable;var f="JPG";0<=a.indexOf("type=")&&(f=J.util.Parser.getTokens(J.util.TextFormat.replaceAllCharacter(a.substring(a.indexOf("type=")+5),";,"," "))[0]);c.put("type",
  f.toUpperCase());c.put("width",Integer.$valueOf(e));c.put("height",Integer.$valueOf(b));c.put("quality",Integer.$valueOf(-1));a=this.viewer.getImageAsBytes(c);return null==d||Clazz.instanceOf(a,String)?a:J.io.Base64.getBase64(a).toString();case 35:return this.viewer.getShapeProperty(24,"getInfo");case 36:return this.viewer.getShapeProperty(24,"getData");case 40:return this.viewer.getNMRCalculation().getInfo(c.toString());case 21:return this.viewer.getStatusChanged(c.toString());case 22:return this.viewer;
  case 38:return this.viewer.getJspecViewProperties(c);case 7:return this.getLigandInfo(this.viewer.getAtomBitSet(c));case 9:return this.viewer.getMeasurementInfo();case 29:return this.viewer.getMenu(c.toString());case 23:return this.viewer.getMessageQueue();case 30:return this.viewer.getMinimizationInfo();case 6:return this.getModelInfo(this.viewer.getAtomBitSet(c));case 18:return this.getMoleculeInfo(this.viewer.getAtomBitSet(c));case 34:return this.viewer.getMouseInfo();case 11:return this.viewer.getOrientationInfo();
  case 31:return this.viewer.getPointGroupInfo(c);case 17:return this.getAllPolymerInfo(this.viewer.getAtomBitSet(c));case 39:return this.viewer.getScriptQueueInfo();case 8:return this.viewer.getShapeInfo();case 19:return this.viewer.getStateInfo3(c.toString(),0,0);case 12:return this.viewer.getMatrixRotate()}d=Array(41);for(b=0;41>b;b++)e=J.viewer.PropertyManager.getParamType(b),c=this.getDefaultPropertyParam(b),f=J.viewer.PropertyManager.getPropertyName(b),d[b]="X"==f.charAt(0)?"":f+(""!==e?" "+J.viewer.PropertyManager.getParamType(b)+
  (""!==c?" #default: "+this.getDefaultPropertyParam(b):""):"");java.util.Arrays.sort(d);e=new J.util.SB;e.append("getProperty ERROR\n").append(a).append("?\nOptions include:\n");for(b=0;41>b;b++)0<d[b].length&&e.append("\n getProperty ").append(d[b]);return e.toString()},$fz.isPrivate=!0,$fz),"~S,~O,~S");c$.getFileInfo=$_M(c$,"getFileInfo",function(a,c){var d=new java.util.Hashtable;if(null==a)return d;var b=null!=c&&0<c.length;if(Clazz.instanceOf(a,java.util.Map))return b?a.get(c):a;var e=J.util.TextFormat.split(a,
  "\n");if(0==e.length||6>e[0].length||" "!=e[0].charAt(6)||!e[0].substring(0,6).equals(e[0].substring(0,6).toUpperCase()))return d.put("fileHeader",a),d;var f="",g=new J.util.SB;b&&(c=c.toUpperCase());for(var h="",k=0;k<e.length;k++){var j=e[k];if(!(12>j.length)){var h=j.substring(0,6).trim(),l=j.substring(7,10).trim();h.equals("REMARK")&&(h+=l);if(!h.equals(f)){if(b&&f.equals(c))return g.toString();b||(d.put(f,g.toString()),g=new J.util.SB);f=h}(!b||h.equals(c))&&g.append(j).appendC("\n")}}b||d.put(f,
  g.toString());return b?h.equals(c)?g.toString():"":d},"~O,~S");$_M(c$,"getMoleculeInfo",function(a){a=this.viewer.getAtomBitSet(a);for(var c=this.viewer.modelSet.getMolecules(),d=new J.util.JmolList,b=new J.util.BS,e=0;e<c.length;e++){var b=J.util.BSUtil.copy(a),f=c[e];b.and(f.atomList);0<b.length()&&(b=new java.util.Hashtable,b.put("mf",f.getMolecularFormula(!1)),b.put("number",Integer.$valueOf(f.moleculeIndex+1)),b.put("modelNumber",this.viewer.modelSet.getModelNumberDotted(f.modelIndex)),b.put("numberInModel",
  Integer.$valueOf(f.indexInModel+1)),b.put("nAtoms",Integer.$valueOf(f.atomCount)),b.put("nElements",Integer.$valueOf(f.nElements)),d.addLast(b))}return d},"~O");Clazz.overrideMethod(c$,"getModelInfo",function(a){a=this.viewer.getModelBitSet(this.viewer.getAtomBitSet(a),!1);var c=this.viewer.getModelSet(),d=new java.util.Hashtable;d.put("modelSetName",c.modelSetName);d.put("modelCount",Integer.$valueOf(c.modelCount));d.put("isTainted",Boolean.$valueOf(null!=c.tainted));d.put("canSkipLoad",Boolean.$valueOf(c.canSkipLoad));
  d.put("modelSetHasVibrationVectors",Boolean.$valueOf(c.modelSetHasVibrationVectors()));null!=c.modelSetProperties&&d.put("modelSetProperties",c.modelSetProperties);d.put("modelCountSelected",Integer.$valueOf(J.util.BSUtil.cardinalityOf(a)));d.put("modelsSelected",a);var b=new J.util.JmolList;c.getMolecules();for(var e=a.nextSetBit(0);0<=e;e=a.nextSetBit(e+1)){var f=new java.util.Hashtable;f.put("_ipt",Integer.$valueOf(e));f.put("num",Integer.$valueOf(c.getModelNumber(e)));f.put("file_model",c.getModelNumberDotted(e));
  f.put("name",c.getModelName(e));var g=c.getModelTitle(e);null!=g&&f.put("title",g);g=c.getModelFileName(e);null!=g&&f.put("file",g);g=c.getModelAuxiliaryInfoValue(e,"modelID");null!=g&&f.put("id",g);f.put("vibrationVectors",Boolean.$valueOf(this.viewer.modelHasVibrationVectors(e)));g=c.models[e];f.put("atomCount",Integer.$valueOf(g.atomCount));f.put("bondCount",Integer.$valueOf(g.getBondCount()));f.put("groupCount",Integer.$valueOf(g.getGroupCount()));f.put("moleculeCount",Integer.$valueOf(g.moleculeCount));
  f.put("polymerCount",Integer.$valueOf(g.getBioPolymerCount()));f.put("chainCount",Integer.$valueOf(c.getChainCountInModel(e,!0)));null!=g.properties&&f.put("modelProperties",g.properties);var h=c.getModelAuxiliaryInfoValue(e,"Energy");null!=h&&f.put("energy",h);f.put("atomCount",Integer.$valueOf(g.atomCount));b.addLast(f)}d.put("models",b);return d},"~O");Clazz.overrideMethod(c$,"getLigandInfo",function(a){var c=this.viewer.getAtomBitSet(a),d=this.viewer.getAtomBitSet("solvent");a=new java.util.Hashtable;
  var b=new J.util.JmolList;a.put("ligands",b);var e=this.viewer.modelSet,f=J.util.BSUtil.copyInvert(c,e.atomCount);f.or(d);for(var d=e.atoms,g=c.nextSetBit(0);0<=g;g=c.nextSetBit(g+1))(d[g].isProtein()||d[g].isNucleic())&&f.set(g);c=Array(e.modelCount);for(g=e.modelCount;0<=--g;)c[g]=this.viewer.getModelUndeletedAtomsBitSet(g),c[g].andNot(f);f=J.util.JmolMolecule.getMolecules(d,c,null,f);for(g=0;g<f.length;g++){var c=f[g].atomList,h=new java.util.Hashtable;b.addLast(h);h.put("atoms",J.util.Escape.eBS(c));
  for(var k="",j="",l=null,m=0,n=null,p="",q="",s=2147483647,v=2147483647,t=c.nextSetBit(0);0<=t;t=c.nextSetBit(t+1)){var r=d[t];if(l!==r.group){var l=r.group,u=r.getResno(),w=r.getChainID();s!=u-1&&(0!=p.length&&s!=v&&(p+="-"+s),w=-1,v=u);q="/"+e.getModelNumberDotted(r.modelIndex);0!=m&&w!=m&&(p+=":"+n+q);-1==w&&(p+=" "+u);s=u;m=r.getChainID();n=r.getChainIDStr();k+=j+r.getGroup3(!1);j="-"}}p+=(v==s?"":"-"+s)+(0==m?"":":"+n)+q;h.put("groupNames",k);h.put("residueList",p.substring(1))}return a},"~O");
  Clazz.overrideMethod(c$,"getSymmetryInfo",function(a,c,d,b,e,f,g){var h=-1;if(null==a){h=this.viewer.getCurrentModelIndex();if(0>h)return"";a=this.viewer.getModelUndeletedAtomsBitSet(h)}a=a.nextSetBit(0);if(0>a)return"";var h=this.viewer.modelSet.atoms[a].modelIndex,k=this.viewer.modelSet.getUnitCell(h);return null==k?"":k.getSymmetryInfo(this.viewer.modelSet,h,a,k,c,d,b,e,f,g)},"J.util.BS,~S,~N,J.util.P3,J.util.P3,~S,~N");Clazz.overrideMethod(c$,"getModelExtract",function(a,c,d,b){var e=b.equalsIgnoreCase("V3000"),
  f=b.equalsIgnoreCase("SDF"),g=b.equalsIgnoreCase("XYZVIB"),h=b.equalsIgnoreCase("CD");b=new J.util.SB;var k=this.viewer.modelSet;if(!g&&!h){b.append(d?"Jmol Model Kit":this.viewer.getFullPathName().$replace("\\","/"));d=J.viewer.Viewer.getJmolVersion();b.append("\n__Jmol-").append(d.substring(0,2));var j,l,m,n;n=new Date;d=n.getMonth();j=n.getDate();l=n.getFullYear();m=n.getHours();n=n.getMinutes();J.util.TextFormat.rFill(b,"_00",""+(1+d));J.util.TextFormat.rFill(b,"00",""+j);b.append((""+l).substring(2,
  4));J.util.TextFormat.rFill(b,"00",""+m);J.util.TextFormat.rFill(b,"00",""+n);b.append("3D 1   1.00000     0.00000     0");b.append("\nJmol version ").append(J.viewer.Viewer.getJmolVersion()).append(" EXTRACT: ").append(J.util.Escape.eBS(a)).append("\n")}d=J.util.BSUtil.copy(a);l=k.atoms;for(j=a.nextSetBit(0);0<=j;j=a.nextSetBit(j+1))c&&l[j].isDeleted()&&d.clear(j);m=J.viewer.PropertyManager.getCovalentBondsForAtoms(k.bonds,k.bondCount,d);if(!g&&0==d.cardinality())return"";a=!0;c=c?this.viewer.getRotationQuaternion():
  null;if(f){l=b.toString();b=new J.util.SB;e=this.viewer.getModelBitSet(d,!0);for(j=e.nextSetBit(0);0<=j;j=e.nextSetBit(j+1)){b.append(l);f=J.util.BSUtil.copy(d);f.and(k.getModelAtomBitSetIncludingDeleted(j,!1));m=J.viewer.PropertyManager.getCovalentBondsForAtoms(k.bonds,k.bondCount,f);if(!(a=this.addMolFile(b,f,m,!1,!1,c)))break;b.append("$$$$\n")}}else if(g){g=J.modelset.LabelToken.compile(this.viewer,"%-2e %10.5x %10.5y %10.5z %10.5vx %10.5vy %10.5vz\n","\x00",null);c=J.modelset.LabelToken.compile(this.viewer,
  "%-2e %10.5x %10.5y %10.5z\n","\x00",null);e=this.viewer.getModelBitSet(d,!0);for(j=e.nextSetBit(0);0<=j;j=e.nextSetBit(j+1))if(f=J.util.BSUtil.copy(d),f.and(k.getModelAtomBitSetIncludingDeleted(j,!1)),0!=f.cardinality()){b.appendI(f.cardinality()).appendC("\n");h=k.models[j].properties;b.append("Model["+(j+1)+"]: ");if(null!=k.frameTitles[j]&&0<k.frameTitles[j].length)b.append(k.frameTitles[j].$replace("\n"," "));else if(null==h)b.append("Jmol "+J.viewer.Viewer.getJmolVersion());else{m=new J.util.SB;
  n=h.propertyNames();for(var p=null;n.hasMoreElements();){var q=n.nextElement();q.equals(".PATH")?p=h.getProperty(q):m.append(";").append(q).append("=").append(h.getProperty(q))}null!=p&&m.append(";PATH=").append(p);p=m.substring(0<m.length()?1:0);b.append(p.$replace("\n"," "))}b.appendC("\n");for(h=f.nextSetBit(0);0<=h;h=f.nextSetBit(h+1))b.append(J.modelset.LabelToken.formatLabelAtomArray(this.viewer,l[h],null==k.getVibration(h,!1)?c:g,"\x00",null))}}else a=this.addMolFile(b,d,m,e,h,c);return a?
  b.toString():"ERROR: Too many atoms or bonds -- use V3000 format."},"J.util.BS,~B,~B,~S");$_M(c$,"addMolFile",($fz=function(a,c,d,b,e,f){var g=c.cardinality(),h=d.cardinality();if(!b&&!e&&(999<g||999<h))return!1;var k=this.viewer.modelSet,j=Clazz.newIntArray(k.atomCount,0),l=new J.util.P3;b?a.append("  0  0  0  0  0  0            999 V3000"):e?a.append('{"mol":{"scaling":[20,-20,20],"a":['):(J.util.TextFormat.rFill(a,"   ",""+g),J.util.TextFormat.rFill(a,"   ",""+h),a.append("  0  0  0  0              1 V2000"));
  e||a.append("\n");b&&a.append("M  V30 BEGIN CTAB\nM  V30 COUNTS ").appendI(g).append(" ").appendI(h).append(" 0 0 0\n").append("M  V30 BEGIN ATOM\n");for(var m=new J.util.P3,h=c.nextSetBit(0),n=0;0<=h;h=c.nextSetBit(h+1))this.getAtomRecordMOL(k,a,j[h]=++n,k.atoms[h],f,l,m,b,e);b?a.append("M  V30 END ATOM\nM  V30 BEGIN BOND\n"):e&&a.append('],"b":[');h=d.nextSetBit(0);for(n=0;0<=h;h=d.nextSetBit(h+1))this.getBondRecordMOL(a,++n,k.bonds[h],j,b,e);b&&a.append("M  V30 END BOND\nM  V30 END CTAB\n");e?
  a.append("]}}"):a.append("M  END\n");if(!e&&!b&&(d=k.getPartialCharges(),null!=d)){a.append("> <JMOL_PARTIAL_CHARGES>\n").appendI(g).appendC("\n");h=c.nextSetBit(0);for(n=0;0<=h;h=c.nextSetBit(h+1))a.appendI(++n).append(" ").appendF(d[h]).appendC("\n")}return!0},$fz.isPrivate=!0,$fz),"J.util.SB,J.util.BS,J.util.BS,~B,~B,J.util.Quaternion");c$.getCovalentBondsForAtoms=$_M(c$,"getCovalentBondsForAtoms",($fz=function(a,c,d){for(var b=new J.util.BS,e=0;e<c;e++){var f=a[e];d.get(f.atom1.index)&&(d.get(f.atom2.index)&&
  f.isCovalent())&&b.set(e)}return b},$fz.isPrivate=!0,$fz),"~A,~N,J.util.BS");$_M(c$,"getAtomRecordMOL",($fz=function(a,c,d,b,e,f,g,h,k){a.models[b.modelIndex].isTrajectory?b.setFractionalCoordPt(g,a.trajectorySteps.get(b.modelIndex)[b.index-a.models[b.modelIndex].firstAtomIndex],!0):f.setT(b);null!=e&&e.transformP2(f,f);a=b.getElementNumber();e=b.isDeleted()?"Xx":J.util.Elements.elementSymbolFromNumber(a);g=b.getIsotopeNumber();var j=b.getFormalCharge();h?(c.append("M  V30 ").appendI(d).append(" ").append(e).append(" ").appendF(f.x).append(" ").appendF(f.y).append(" ").appendF(f.z).append(" 0"),
  0!=j&&c.append(" CHG=").appendI(j),0!=g&&c.append(" MASS=").appendI(g),c.append("\n")):k?(1!=d&&c.append(","),c.append("{"),6!=b.getElementNumber()&&c.append('"l":"').append(b.getElementSymbol()).append('",'),0!=j&&c.append('"c":').appendI(j).append(","),0!=g&&g!=J.util.Elements.getNaturalIsotope(a)&&c.append('"m":').appendI(g).append(","),c.append('"x":').appendF(20*b.x).append(',"y":').appendF(20*-b.y).append(',"z":').appendF(20*b.z).append("}")):(c.append(J.util.TextFormat.sprintf("%10.5p%10.5p%10.5p",
  "p",[f])),c.append(" ").append(e),1==e.length&&c.append(" "),0<g&&(g-=J.util.Elements.getNaturalIsotope(b.getElementNumber())),c.append(" "),J.util.TextFormat.rFill(c,"  ",""+g),J.util.TextFormat.rFill(c,"   ",""+(0==j?0:4-j)),c.append("  0  0  0  0\n"))},$fz.isPrivate=!0,$fz),"J.modelset.ModelSet,J.util.SB,~N,J.modelset.Atom,J.util.Quaternion,J.util.P3,J.util.P3,~B,~B");$_M(c$,"getBondRecordMOL",($fz=function(a,c,d,b,e,f){var g=b[d.atom1.index];b=b[d.atom2.index];var h=d.getValence();3<h&&(h=1);
  switch(d.order&-131073){case 515:h=f?2:4;break;case 66:h=f?1:5;break;case 513:h=f?1:6;break;case 514:h=f?2:7;break;case 33:h=f?1:8}e?a.append("M  V30 ").appendI(c).append(" ").appendI(h).append(" ").appendI(g).append(" ").appendI(b).appendC("\n"):f?(1!=c&&a.append(","),a.append('{"b":').appendI(g-1).append(',"e":').appendI(b-1),1!=h&&a.append(',"o":').appendI(h),a.append("}")):(J.util.TextFormat.rFill(a,"   ",""+g),J.util.TextFormat.rFill(a,"   ",""+b),a.append("  ").appendI(h).append("  0  0  0\n"))},
  $fz.isPrivate=!0,$fz),"J.util.SB,~N,J.modelset.Bond,~A,~B,~B");Clazz.overrideMethod(c$,"getChimeInfo",function(a,c){switch(a){case 1073741982:break;case 1073741864:return this.getBasePairInfo(c);default:return this.getChimeInfoA(this.viewer.modelSet.atoms,a,c)}var d=new J.util.SB;this.viewer.modelSet.models[0].getChimeInfo(d,0);return d.appendC("\n").toString().substring(1)},"~N,J.util.BS");$_M(c$,"getChimeInfoA",($fz=function(a,c,d){var b=new J.util.SB;b.append("\n");var e="",f=null,g=null,h=-1,
  k=0;if(null!=d)for(var j=d.nextSetBit(0);0<=j;j=d.nextSetBit(j+1)){var l=a[j];switch(c){default:return"";case 1114638363:e=l.getInfo();break;case 1141899265:e=""+l.getAtomNumber();break;case 1087373318:e=l.getGroup3(!1);break;case 1087373316:case 1073742120:case 1087373320:var m=l.getChainID(),e=0==m?" ":l.getChainIDStr();255<m&&(e=J.util.Escape.eS(e));switch(c){case 1073742120:e="["+l.getGroup3(!1)+"]"+l.getSeqcodeString()+":"+e;break;case 1087373320:l.getModelIndex()!=h&&(b.appendC("\n"),k=0,h=
  l.getModelIndex(),b.append("Model "+l.getModelNumber()),f=g=null);l.getChain()!==f&&(b.appendC("\n"),k=0,f=l.getChain(),b.append("Chain "+e+":\n"),g=null);e=l.getGroup();e!==g&&(0==k++%5&&1<k&&b.appendC("\n"),J.util.TextFormat.lFill(b,"          ","["+l.getGroup3(!1)+"]"+l.getResno()+" "),g=e);continue}}0>b.indexOf("\n"+e+"\n")&&b.append(e).appendC("\n")}1087373320==c&&b.appendC("\n");return b.toString().substring(1)},$fz.isPrivate=!0,$fz),"~A,~N,J.util.BS");Clazz.overrideMethod(c$,"getModelFileInfo",
  function(a){for(var c=this.viewer.modelSet,d=new J.util.SB,b=0;b<c.modelCount;++b)if(null==a||a.get(b)){var e='["'+c.getModelNumberDotted(b)+'"] = ';d.append("\n\nfile").append(e).append(J.util.Escape.eS(c.getModelFileName(b)));var f=c.getModelAuxiliaryInfoValue(b,"modelID");null!=f&&d.append("\nid").append(e).append(J.util.Escape.eS(f));d.append("\ntitle").append(e).append(J.util.Escape.eS(c.getModelTitle(b)));d.append("\nname").append(e).append(J.util.Escape.eS(c.getModelName(b)));d.append("\ntype").append(e).append(J.util.Escape.eS(c.getModelFileType(b)))}return d.toString()},
  "J.util.BS");$_M(c$,"getAllAtomInfo",function(a){for(var c=new J.util.JmolList,d=a.nextSetBit(0);0<=d;d=a.nextSetBit(d+1))c.addLast(this.getAtomInfoLong(d));return c},"J.util.BS");$_M(c$,"getAtomInfoLong",($fz=function(a){var c=this.viewer.modelSet,d=c.atoms[a],b=new java.util.Hashtable;this.viewer.getAtomIdentityInfo(a,b);b.put("element",c.getElementName(a));b.put("elemno",Integer.$valueOf(c.getElementNumber(a)));b.put("x",Float.$valueOf(d.x));b.put("y",Float.$valueOf(d.y));b.put("z",Float.$valueOf(d.z));
  b.put("coord",J.util.P3.newP(d));null!=c.vibrations&&null!=c.vibrations[a]&&b.put("vibVector",J.util.V3.newV(c.vibrations[a]));b.put("bondCount",Integer.$valueOf(d.getCovalentBondCount()));b.put("radius",Float.$valueOf(d.getRasMolRadius()/120));b.put("model",d.getModelNumberForLabel());b.put("shape",J.modelset.Atom.atomPropertyString(this.viewer,d,1087373323));b.put("visible",Boolean.$valueOf(d.isVisible(0)));b.put("clickabilityFlags",Integer.$valueOf(d.clickabilityFlags));b.put("visibilityFlags",
  Integer.$valueOf(d.shapeVisibilityFlags));b.put("spacefill",Float.$valueOf(d.getRadius()));var e=J.util.Escape.escapeColor(this.viewer.getColorArgbOrGray(d.colixAtom));null!=e&&b.put("color",e);b.put("colix",Integer.$valueOf(d.colixAtom));(e=d.isTranslucent())&&b.put("translucent",Boolean.$valueOf(e));b.put("formalCharge",Integer.$valueOf(d.getFormalCharge()));b.put("partialCharge",Float.$valueOf(d.getPartialCharge()));e=d.getSurfaceDistance100()/100;0<=e&&b.put("surfaceDistance",Float.$valueOf(e));
  if(c.models[d.modelIndex].isBioModel){b.put("resname",d.getGroup3(!1));var e=d.getInsertionCode(),f=d.getResno();0<f&&b.put("resno",Integer.$valueOf(f));0!=e.charCodeAt(0)&&b.put("insertionCode",""+e);b.put("name",c.getAtomName(a));b.put("chain",d.getChainIDStr());b.put("atomID",Integer.$valueOf(d.atomID));b.put("groupID",Integer.$valueOf(d.getGroupID()));"\x00"!=d.altloc&&b.put("altLocation",""+d.altloc);b.put("structure",Integer.$valueOf(d.getProteinStructureType().getId()));b.put("polymerLength",
  Integer.$valueOf(d.getPolymerLength()));b.put("occupancy",Integer.$valueOf(d.getOccupancy100()));a=d.getBfactor100();b.put("temp",Integer.$valueOf(Clazz.doubleToInt(a/100)))}return b},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"getAllBondInfo",function(a){var c=new J.util.JmolList,d=this.viewer.modelSet,b=d.bondCount,d=d.bonds,e;Clazz.instanceOf(a,String)&&(a=this.viewer.getAtomBitSet(a));if(Clazz.instanceOf(a,Array)){e=a[0];var f=a[1];for(a=0;a<b;a++){var g=d[a].atom1.index,h=d[a].atom2.index;(e.get(g)&&
  f.get(h)||f.get(g)&&e.get(h))&&c.addLast(this.getBondInfo(a))}}else if(Clazz.instanceOf(a,J.modelset.Bond.BondSet)){e=a;for(a=e.nextSetBit(0);0<=a&&a<b;a=e.nextSetBit(a+1))c.addLast(this.getBondInfo(a))}else if(Clazz.instanceOf(a,J.util.BS)){e=a;f=1==e.cardinality()?e.nextSetBit(0):-1;for(a=0;a<b;a++)(0<=f?d[a].atom1.index==f||d[a].atom2.index==f:e.get(d[a].atom1.index)&&e.get(d[a].atom2.index))&&c.addLast(this.getBondInfo(a))}return c},"~O");$_M(c$,"getBondInfo",($fz=function(a){var c=this.viewer.modelSet.bonds[a],
  d=c.atom1,b=c.atom2,e=new java.util.Hashtable;e.put("_bpt",Integer.$valueOf(a));a=new java.util.Hashtable;this.viewer.getAtomIdentityInfo(d.index,a);var f=new java.util.Hashtable;this.viewer.getAtomIdentityInfo(b.index,f);e.put("atom1",a);e.put("atom2",f);e.put("order",Float.$valueOf(J.util.Parser.fVal(J.util.JmolEdge.getBondOrderNumberFromOrder(c.order))));e.put("type",J.util.JmolEdge.getBondOrderNameFromOrder(c.order));e.put("radius",Float.$valueOf(c.mad/2E3));e.put("length_Ang",Float.$valueOf(d.distance(b)));
  e.put("visible",Boolean.$valueOf(0!=c.shapeVisibilityFlags));d=J.util.Escape.escapeColor(this.viewer.getColorArgbOrGray(c.colix));null!=d&&e.put("color",d);e.put("colix",Integer.$valueOf(c.colix));J.util.C.isColixTranslucent(c.colix)&&e.put("translucent",Boolean.TRUE);return e},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"getAllChainInfo",function(a){for(var c=new java.util.Hashtable,d=new J.util.JmolList,b=this.viewer.modelSet.modelCount,e=0;e<b;++e){var f=new java.util.Hashtable,g=this.getChainInfo(e,a);
  0<g.size()&&(f.put("modelIndex",Integer.$valueOf(e)),f.put("chains",g),d.addLast(f))}c.put("models",d);return c},"J.util.BS");$_M(c$,"getChainInfo",($fz=function(a,c){for(var d=this.viewer.modelSet.models[a],b=d.getChainCount(!0),e=new J.util.JmolList,f=0;f<b;f++){for(var g=d.getChainAt(f),h=new J.util.JmolList,k=g.getGroupCount(),j=new java.util.Hashtable,l=0;l<k;l++){var m=g.getGroup(l);c.get(m.firstAtomIndex)&&h.addLast(m.getGroupInfo(l))}h.isEmpty()||(j.put("residues",h),e.addLast(j))}return e},
  $fz.isPrivate=!0,$fz),"~N,J.util.BS");$_M(c$,"getAllPolymerInfo",function(a){for(var c=new java.util.Hashtable,d=new J.util.JmolList,b=this.viewer.modelSet.modelCount,e=this.viewer.modelSet.models,f=0;f<b;++f)e[f].isBioModel&&e[f].getAllPolymerInfo(a,c,d);c.put("models",d);return c},"J.util.BS");$_M(c$,"getBasePairInfo",($fz=function(a){var c=new J.util.SB,d=new J.util.JmolList;this.viewer.modelSet.calcRasmolHydrogenBonds(a,a,d,!0,1,!1,null);for(a=d.size();0<=--a;){var b=d.get(a);J.viewer.PropertyManager.getAtomResidueInfo(c,
  b.atom1);c.append(" - ");J.viewer.PropertyManager.getAtomResidueInfo(c,b.atom2);c.append("\n")}return c.toString()},$fz.isPrivate=!0,$fz),"J.util.BS");c$.getAtomResidueInfo=$_M(c$,"getAtomResidueInfo",($fz=function(a,c){a.append("[").append(c.getGroup3(!1)).append("]").append(c.getSeqcodeString()).append(":");var d=c.getChainID();a.append(0==d?" ":c.getChainIDStr())},$fz.isPrivate=!0,$fz),"J.util.SB,J.modelset.Atom");Clazz.defineStatics(c$,"atomExpression","<atom selection>");c$.propertyTypes=c$.prototype.propertyTypes=
  "appletInfo;;;fileName;;;fileHeader;;;fileContents;<pathname>;;fileContents;;;animationInfo;;;modelInfo;<atom selection>;{*};ligandInfo;<atom selection>;{*};shapeInfo;;;measurementInfo;;;centerInfo;;;orientationInfo;;;transformInfo;;;atomList;<atom selection>;(visible);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".split(";");
  Clazz.defineStatics(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_LIST",13,"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_COUNT",41,"readableTypes"," stateinfo extractmodel filecontents fileheader image menu minimizationInfo".split(" "))});
  