diff --git a/client/bundle.js b/client/bundle.js index 94e82b5d0f459c365a1f680f3c16697f57724422..6104ad495b0050cda0e5bc129c58bccf2940b4a4 100644 --- a/client/bundle.js +++ b/client/bundle.js @@ -1 +1 @@ -!function(e){var t={};function s(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=e,s.c=t,s.d=function(e,t,i){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)s.d(i,n,function(t){return e[t]}.bind(null,n));return i},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=16)}([function(e,t,s){"use strict";const i=window.nomadEnv.apiRoot;function n(e){let t="";for(let s=0;s<e.length;s++)e.charCodeAt(s)>=47&&e.charCodeAt(s)<58?t+="<sub>"+e[s]+"</sub>":t+=e[s];return t}function a(e){let t=e.substring(1,e.length-1).split(","),s=[];for(var i=0;i<t.length;i++)s.push(parseFloat(t[i]));return s}function l(e){return(e*(180/Math.PI)).toFixed(0)+"°"}e.exports={searchResults:!1,materialId:null,MAT_VIEW:{structure:"structure",electronicstruct:"electronicstruct",methodology:"methodology",thermalprops:"thermalprops",elasticconst:"elasticconst"},IMAGE_DIR:"img/",ELEMENTS:["H","He","Li","Be","B","C","N","O","F","Ne","Na","Mg","Al","Si","P","S","Cl","Ar","K","Ca","Sc","Ti","V","Cr","Mn","Fe","Co","Ni","Cu","Zn","Ga","Ge","As","Se","Br","Kr","Rb","Sr","Y","Zr","Nb","Mo","Tc","Ru","Rh","Pd","Ag","Cd","In","Sn","Sb","Te","I","Xe","Cs","Ba","La","Ce","Pr","Nd","Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm","Yb","Lu","Hf","Ta","W","Re","Os","Ir","Pt","Au","Hg","Tl","Pb","Bi","Po","At","Rn","Fr","Ra","Ac","Th","Pa","U","Np","Pu","Am","Cm","Bk","Cf","Es","Fm","Md","No","Lr","Rf","Ha","Sg","Ns","Hs","Mt","Ds","Rg","Cn","Nh","Fl","Mc","Lv","Ts","Og"],getUserData:function(){return null},getServerLocation:function(){return document.location.hostname},authServerReq:function(e,t){var s=new XMLHttpRequest;return s.addEventListener("load",t),console.log("util.authServerReq: ",i+e),s.open("GET",i+e),s.send(),s},serverReq:function(e,t){var s=new XMLHttpRequest;s.addEventListener("load",t),s.open("GET",e);var i=window.keycloak;return i.authenticated&&s.setRequestHeader("Authorization","Bearer "+i.token),s.send(),s},convert2d:function(e,t){let s=[];for(var i=0;i<e.length;i++){let a=e[i],l=[];for(var n=0;n<a.length;n++)l.push(a[n]*t);s.push(l)}return s},serverReqPOST:function(e,t,s){var i=new XMLHttpRequest;i.addEventListener("load",s),i.open("POST",e),i.setRequestHeader("Content-Type","application/json");var n=window.keycloak;return n.authenticated&&i.setRequestHeader("Authorization","Bearer "+n.token),i.send(t),i},getShortCode:function(e){if((e.startsWith("eos/")||e.startsWith("par/"))&&32==e.length)return e.substring(0,12);if(28==e.length)return e.substring(0,8);throw"The given identifier could not be shortened as it does not have the right initial length."},getSearchURL:function(){return i+"materials"},getSuggestionURL:function(e){return i+"suggestions?property="+e},getMaterialURL:function(e){return i+"materials/"+e},getMaterialCalcURL:function(e,t,s=""){return i+"materials/"+e+"/calculations/"+t+(""===s?"":"?property="+s)},getMaterialGroupURL:function(e,t,s){return i+"materials/"+e+"/groups/"+t+"/"+s},getMaterialStatsURL:function(e){return i+"materials/"+e+"/statistics"},getMaterialXsURL:function(e,t){return i+"materials/"+t+"/"+e},getCalcEnergiesURL:function(e,t){return i+"materials/"+e+"/calculations/"+t+"/energies"},getReportURL:function(e){return i+"materials/"+e+"/reports"},setBrowserHashPath:function(e,t){document.location=void 0===t?"#/"+e:"#/"+e+"/"+t},loadLib:function(e){let t=document.createElement("script");t.setAttribute("type","text/javascript"),t.setAttribute("src",e),document.getElementsByTagName("head")[0].appendChild(t)},getNumberArray:a,J2eV:function(e,t){let s=e/1602176565e-28;return void 0===t?s<.01?s.toFixed(6):s.toFixed(3):s.toFixed(t)},eV2J:function(e){return 1602176565e-28*e},m2Angstrom:function(e){return(e/1e-10).toFixed(3)+" Å"},getLatticeAnglesValues:function(e,t,s){let i=[0,0,0];return e.forEach(e=>{if(void 0!==e.lattice_parameters&&null!==e.lattice_parameters){let t=a(e.lattice_parameters);i[0]+=t[3],i[1]+=t[4],i[2]+=t[5]}}),s?`<div>α = ${l(i[0]/e.size)}</div>\n <div>β = ${l(i[1]/e.size)}</div>\n <div>γ = ${l(i[2]/e.size)}</div>`:t?`<div>α = ${l(i[0]/e.size)}</div>`:""},rad2degree:l,m3ToAngstrom3:function(e){return(e/1e-30).toFixed(3)+" Å<sup>3</sup>"},toAngstromMinus3:function(e){return(1e-30*e).toFixed(3)+" Å<sup>-3</sup>"},getMaterialTitle:function(e,t){let s;return s=n(e.formula_reduced),void 0!==t&&!1===t&&(s=e.formula_reduced),null!==e.space_group_number&&void 0!==e.space_group_number&&(s+=" - space group "+e.space_group_number),s},getMinMaxHTML:function(e,t){let s=[];return e.forEach(e=>{s.push(e[t])}),"("+Math.min.apply(null,s)+" ... "+Math.max.apply(null,s)+")"},getSubscriptedFormula:n,getAverage:function(e){let t=0;for(var s=0;s<e.length;s++)t+=e[s];return t/e.length},generateDiagramSteps:function(e,t=4){let s=-Math.floor(Math.log(e/t)*Math.LOG10E),i=Math.pow(10,s),n=Math.ceil(e*i/t),a=[];for(var l=0;l<=t;l++)a[l]=n*l/i;return s=s<0?0:s,[a,s]},getCalcMapByFunctional:function(e){let t=new Map;return e.forEach(e=>{if(t.has(e.functional_type))t.get(e.functional_type).add(e.calc_id);else{let s=new Set;s.add(e.calc_id),t.set(e.functional_type,s)}}),t},getDefault:function(e,t="unavailable"){return null==e?t:e}}},function(e,t,s){"use strict";const i="http://www.w3.org/2000/svg";e.exports={addPoint:function(e,t,s,n,a){let l=document.createElementNS(i,"circle");return l.setAttribute("r",n),l.setAttribute("cx",t),l.setAttribute("cy",s),void 0!==a&&l.setAttribute("class",a),e.appendChild(l),l},addCircle:function(e,t,s,n,a,l,r){let o=document.createElementNS(i,"circle");return o.setAttribute("r",n),o.setAttribute("cx",t),o.setAttribute("cy",s),o.setAttribute("fill",a),o.setAttribute("stroke",l),o.setAttribute("stroke-width",r),e.appendChild(o),o},addLine:function(e,t,s,n,a,l){let r=document.createElementNS(i,"line");return r.setAttribute("x1",t),r.setAttribute("y1",s),r.setAttribute("x2",n),r.setAttribute("y2",a),void 0!==l&&r.setAttribute("class",l),e.appendChild(r),r},addRect:function(e,t,s,n,a,l){let r=document.createElementNS(i,"rect");return r.setAttribute("x",t),r.setAttribute("y",s),r.setAttribute("width",n),r.setAttribute("height",a),void 0!==l&&r.setAttribute("class",l),e.appendChild(r),r},addText:function(e,t,s,n,a="start",l){let r=document.createElementNS(i,"text");return r.setAttribute("x",t),r.setAttribute("y",s),r.textContent=n,r.setAttribute("text-anchor",a),void 0!==l&&r.setAttribute("class",l),e.appendChild(r),r},addPolyline:function(e,t,s){let n=document.createElementNS(i,"polyline");n.setAttribute("points",t),void 0!==s&&n.setAttribute("class",s),e.appendChild(n)},removeElement:function(e){e.parentElement.removeChild(e)}}},function(e,t,s){let i,n,a,l,r,o,d,h,c=s(0),p=new Map;function u(e){return e.substring(0,3)}function m(e){return"eos/"===e.substring(0,4)||"par/"===e.substring(0,4)}function y(e){return e.substring(4)}e.exports={getRepresentatives:function(){return r},setMaterialData:function(e){i=e},getMaterialData:function(){return i},getCalculations:function(){return l},setCalculations:function(e){l=e.results,l.forEach((function(e,t){let s=c.getDefault(e.functional_type),i=c.getDefault(e.core_electron_treatment);this[t].functional_type=s,this[t].core_electron_treatment=i}),l),r=e.representatives;for(let e=0;e<l.length;e++)p.set(l[e].calc_id,l[e]);let t=r.electronic_band_structure,s=r.electronic_dos,i=r.thermodynamical_properties;h=void 0!==t||void 0!==s,d=void 0!==i},getCalc:function(e){return p.get(e)},getGroups:function(){return n},setGroups:function(e){let t=new Map(Object.entries(e.groups_eos)),s=new Map(Object.entries(e.groups_par));n=new Map,n.set("eos",t),n.set("par",s),a=new Set,t.forEach((e,t)=>{e.forEach(a.add,a)})},getGroupId:y,isGroup:m,getGroupType:u,getReprCalc:function(e){if(m(e)){let t=u(e),s=y(e);return n.get(t).get(s)[0]}return e},isInAnyGroup:function(e){return a.has(e)},isInAnyNotDisabledGroup:function(e){return a.has(e)},getGroupLeafId:function(e){let t=null;return n.forEach((s,i)=>{s.calculation_set.has(e)&&(t=i)}),t},isReady:function(e){return void 0!==i&&void 0!==o&&void 0!==l&&void 0!==n&&e===i.material_id},clear:function(){i=void 0,l=void 0,n=void 0,o=void 0},setIdealizedStructure:function(e){o=e},getIdealizedStructure:function(){return o},hasThermalData:function(e){return d},hasElecStructureData:function(e){return h}}},function(e,t,s){"use strict";let i=s(0),n=s(21);let a=document.querySelector("#info-tooltip"),l=document.querySelector("#tooltip-content"),r=[],o=null,d=!1,h=null;function c(){null!==o&&window.clearTimeout(o),o=window.setTimeout(e=>a.style.display="none",1e3)}let p=new n(i.IMAGE_DIR+"switch");function u(e){e.addEventListener("mouseover",m),e.addEventListener("mouseout",t=>{c(),e.style.cursor="inherit"}),e.className="info-sys-label"}function m(e){let t=e.target.getBoundingClientRect(),s=e.target.getAttribute("info-sys-data"),i=s.indexOf(".value");if(i>0){let e=h[s.split("-").join(" ").substring(0,i)];if(void 0===e.value_template){let t=e.values[s.split(":")[1]];l.innerHTML=v(t)}else{let t=e.value_template;t.text=y(t.text,s.split(":")[1]),t.link=y(t.link,s.split(":")[1]),l.innerHTML=v(t)}}else l.innerHTML=v(h[s.split("-").join(" ")]);a.style.visibility="hidden",a.style.display="block";let n=a.getBoundingClientRect(),r=n.width-t.width,d=t.left-r/2;d+n.width>window.innerWidth&&(d=window.innerWidth-n.width);let c=-window.pageYOffset;a.style.left=(d<0?5:d)+"px",a.style.top=t.top+t.height-c+"px",a.style.visibility="visible",window.clearTimeout(o),e.target.style.cursor="help"}function y(e,t){let s=e.indexOf("${"),i=e.indexOf("}");return s>=0&&i>=0&&i>s?e.substring(0,s)+t+e.substring(i+1):e}function v(e){let t="";return void 0===e.text||(t+=e.text),void 0!==e.link&&(void 0!==e.text&&(t+="<br>"),t+='<a href="'+e.link+'" target="_blank">More information</a>'),t}document.querySelector("#info-sys-switch-box").appendChild(p.element),p.setListener(e=>{d=!e,e?r.forEach(e=>{e.removeEventListener("mouseover",m),e.className=""}):(null===h&&i.serverReq("infosys.json",e=>h=JSON.parse(e.target.response)),r.forEach(u)),a.addEventListener("mouseover",e=>{window.clearTimeout(o)}),a.addEventListener("mouseout",e=>{c()})}),e.exports={addToInfoSystem:function(e){let t=e.querySelectorAll("span[info-sys-data]");for(let e=0;e<t.length;++e)r.push(t[e]);if(d)for(let e=0;e<t.length;++e)u(t[e])},addElementToInfoSystem:function(e,t){r.push(e),e.setAttribute("info-sys-data",t),d&&u(e)}}},function(e,t,s){"use strict";s(0);let i=document.querySelector("#loading-popup"),n=new Set;e.exports={show:function(e){if(!window.allowNewLoadPopup)return;n.add(e,!0);let t=i.getBoundingClientRect(),s=(window.innerWidth-t.width)/2,a=(window.innerHeight-t.height)/2;i.style.left=s+"px",i.style.top=a-100+"px",i.style.visibility="visible"},hide:function(e){n.delete(e),0===n.size&&(i.style.visibility="hidden")},reset:function(){n=new Set,i.style.visibility="hidden"}}},function(e,t,s){"use strict";let i=s(1);const n="http://www.w3.org/2000/svg";e.exports=class{constructor(e={left:20,right:0,top:10,bottom:20}){this.svg=document.createElementNS(n,"svg"),this.plotArea=document.createElementNS(n,"g"),this.svg.appendChild(this.plotArea),this.margins=e,this.parentElement=null,this.yLabelText=null,this.noDataGroup=null}attach(e,t,s){this.parentElement=e,this.parentElement.appendChild(this.svg),this.width=void 0!==t?t:this.parentElement.clientWidth,this.height=void 0!==s?s:this.svg.width,this.svg.setAttribute("width",this.width),this.svg.setAttribute("height",this.height),this.plotRangeX=this.width-this.margins.left-this.margins.right,this.plotRangeY=this.height-this.margins.top-this.margins.bottom}isAttached(){return null!==this.parentElement}setRangeAndLabels(e,t,s,i,n,a){this.xLabel=e,this.xMin=t,this.xMax=s,this.yLabel=i,this.yMin=n,this.yMax=a,this.xRel=this.plotRangeX/(this.xMax-this.xMin),this.yRel=this.plotRangeY/(this.yMax-this.yMin)}drawAxis(e=0,t=0,s=2){if(this.plotArea.setAttribute("transform","matrix(1 0 0 1 "+this.margins.left+" "+(this.height-this.margins.bottom)+")"),this.yLabelText=i.addText(this.svg,0,0,this.yLabel,"middle","axis-steps-big"),this.yLabelText.setAttribute("transform","translate(13,"+(this.plotRangeY/2+this.margins.top)+") rotate(-90)"),i.addText(this.plotArea,this.plotRangeX/2,this.margins.bottom-1,this.xLabel,"middle","axis-steps-big"),null!==e){let t=this.plotRangeX/e;for(let n=0;n<=e;n++)i.addLine(this.plotArea,t*n,0,t*n,4,1),i.addText(this.plotArea,t*n,14,+(t*n/this.xRel+this.xMin).toFixed(s),"middle","statisticsviewersteps")}if(null===t&&this.yMax>0&&this.yMin<0){let e=1;for(;this.yMax*e>this.yMin;){i.addLine(this.plotArea,0,this.transformY(this.yMax*e),-3,this.transformY(this.yMax*e),1);let t=this.yMax*e,n=Math.abs(t)>=1e4?t.toExponential():t.toFixed(s);i.addText(this.plotArea,-5,this.transformY(this.yMax*e)+3,n,"end","statisticsviewersteps"),e--}}if(null!==t){let e=this.plotRangeY/t;for(let n=0;n<=t;n++){i.addLine(this.plotArea,0,-e*n,-3,-e*n,1);let t=e*n/this.yRel+this.yMin;Math.abs(t)<.01&&(t=0),i.addText(this.plotArea,-5,-(e*n-3),t.toFixed(s),"end","statisticsviewersteps")}}i.addLine(this.plotArea,0,0,this.plotRangeX+1,0,"main-axis"),i.addLine(this.plotArea,0,0,0,-(this.plotRangeY+1),"main-axis"),i.addLine(this.plotArea,this.plotRangeX,0,this.plotRangeX,-this.plotRangeY,"main-axis"),i.addLine(this.plotArea,0,-this.plotRangeY,this.plotRangeX,-this.plotRangeY,"main-axis")}clear(){this.svg.removeChild(this.plotArea),this.plotArea=document.createElementNS(n,"g"),this.svg.appendChild(this.plotArea),this.plotArea.setAttribute("transform","matrix(1 0 0 1 "+this.margins.left+" "+(this.height-this.margins.bottom)+")"),null!==this.yLabelText&&(this.svg.removeChild(this.yLabelText),this.yLabelText=null),null!==this.noDataGroup&&(this.svg.removeChild(this.noDataGroup),this.noDataGroup=null)}setNoData(){this.clear(),null===this.noDataGroup&&(this.noDataGroup=document.createElementNS(n,"g"),this.svg.appendChild(this.noDataGroup),i.addRect(this.noDataGroup,0,0,this.width,this.height),this.noDataGroup.setAttribute("fill","#EEE"),i.addText(this.noDataGroup,this.width/2,this.height/2+10,"NO DATA","middle","nodata"))}transformY(e){return-this.yRel*(e-this.yMin)}}},function(e,t,s){"use strict";let i=s(0),n=s(2);e.exports=class{constructor(e){this.element=document.createElement("div"),this.element.setAttribute("id",e),this.loadedMatId=null,this.gotoResultsListener=null,this.gotoOverviewListener=null,this.element.innerHTML='<div class="material-title"></div>',this.element.style.display="none"}attachAndSetEvents(e){e.appendChild(this.element),this.materialTitle=this.element.querySelector(".material-title")}attachNavTree(e){e.attach(this.navTreeWrapper)}setVisible(){this.element.style.display="block"}load(){let e=n.getMaterialData().material_id;this.loadedMatId!==e&&(this.loadedMatId=e,this.setMaterialData())}setMaterialData(){this.materialTitle.innerHTML=i.getMaterialTitle(n.getMaterialData())}updateCalcs(e){}updateMarkedCalc(e){}}},function(e,t,s){"use strict";let i=s(0),n=s(2);function a(e,t){if(e.className.indexOf("material-l")>=0)return;let s=e.parentElement;for(let t=0;t<s.children.length;t++){let i=s.children[t++];if(i!==e&&i.className.indexOf("selected")<0)return}let i=s.previousElementSibling;if(t)i.className+=" node-selected";else{let e=i.className.indexOf(" node-selected");i.className=i.className.substring(0,e)}a(i,t)}e.exports=class{constructor(){this.selectedCalcs=new Set,this.element=document.createElement("div"),this.element.setAttribute("id","navigation-tree"),this.parentElement=null,this.markedNode=null,this._events()}attach(e){null!==this.parentElement&&this.parentElement.removeChild(this.element),this.parentElement=e,this.parentElement.appendChild(this.element)}build(e,t){function s(e,t,s,i=0){let n="node-"+(s?"unfolded":"folded"),a=document.createElement("div");a.className=e;let l=document.createElement("span");l.className=n,a.appendChild(l);let r=document.createElement("span");r.className="node-checkbox",a.appendChild(r);let o=document.createElement("span");if(o.className="node-label",o.textContent=t,a.appendChild(o),0!==i){let e=document.createElement("span");e.className="node-counter",e.textContent="("+i+")",a.appendChild(e)}return a}function a(e,t,s,n,a){let l=document.createElement("div");l.className="calc-l",l.setAttribute("data-calc-id",e);let r=document.createElement("span");l.appendChild(r);let d=document.createElement("span");d.className="node-checkbox",l.appendChild(d);let h=document.createElement("span");h.className="node-label",n&&h.appendChild(o),h.textContent=t+s+" ",h.appendChild(a),l.appendChild(h);let c=document.createElement("div");c.id="icon-container",c.style.float="right",c.style.padding="1px 10px 0 0",c.style.display="none";let p=document.createElement("img");return p.setAttribute("src",i.IMAGE_DIR+"next.png"),c.appendChild(p),l.appendChild(c),l}function l(e){let t=document.createElement("div");t.className="calc-graph-aval";let s=document.createElement("span");if(e.has_band_structure){let e=document.createElement("span");e.className="tooltip",e.textContent="B";let t=document.createElement("span");t.className="tooltiptext",t.textContent="Band structure",e.appendChild(t),s.appendChild(e)}if(e.has_dos){let e=document.createElement("span");e.className="tooltip",e.textContent="D";let t=document.createElement("span");t.className="tooltiptext",t.textContent="Density of states",e.appendChild(t),s.appendChild(e)}if(e.has_fermi_surface){let e=document.createElement("span");e.className="tooltip",e.textContent="F";let t=document.createElement("span");t.className="tooltiptext",t.textContent="Fermi surface",e.appendChild(t),s.appendChild(e)}if(e.has_thermal_properties){let e=document.createElement("span");e.className="tooltip",e.textContent="T";let t=document.createElement("span");t.className="tooltiptext",t.textContent="Phonons",e.appendChild(t),s.appendChild(e)}return t.appendChild(s),t}this.selectedCalcs.clear(),this.markedNode=null,this.element.innerHTML="",this.calcsInGroups=n.getGroups();let r=n.getCalculations(),o=document.createElement("img");o.className="folder-icon",o.src=i.IMAGE_DIR+"folder.png";let d=function(e,t,s){let i=new Map;function a(e,t){e.forEach((e,s)=>{let a=n.getCalc(e[0]),l=a.code_name.trim(),r=a.functional_type;if("exciting"===l)if(i.has(r)){let e=i.get(r);e.has(l)?e.get(l).push(t+s):e.set(l,[t+s])}else if("unavailable"!==r){let e=new Map;e.set(l,[t+s]),i.set(r,e)}})}function l(e,t){let s=e.code_name.trim(),n=e.functional_type;if(i.has(n)){let e=i.get(n);e.has(s)?e.get(s).push(t):e.set(s,[t])}else{let e=new Map;e.set(s,[t]),i.set(n,e)}}return"structure"===s&&(a(t.get("eos"),"eos/"),a(t.get("par"),"par/")),e.forEach(e=>{n.isInAnyNotDisabledGroup(e.calc_id)||("electronic"===s?(e.has_dos||e.has_band_structure)&&l(e,e.calc_id):"thermal"===s?e.has_thermal_properties&&l(e,e.calc_id):l(e,e.calc_id))}),i}(r,this.calcsInGroups,t),h=document.createElement("div");h.appendChild(s("material-l",e,!0));let c=document.createElement("div");h.appendChild(c),d.forEach((e,t)=>{c.appendChild(s("functional-l",t,!0));let r=document.createElement("div");c.appendChild(r),e.forEach((e,t)=>{r.appendChild(s("code-l",t,!1,e.length));let o=document.createElement("div");r.appendChild(o),o.style.display="none";for(var d=0;d<e.length;d++){let t=e[d],s="",r=i.getShortCode(t),h=n.isGroup(t);if(h){let e,i=n.getGroupType(t),a=t.substring(4);e=this.calcsInGroups.get(i).get(a),s="("+e.length+")"}let c=n.getReprCalc(t),p=a(t,r,s,h,l(n.getCalc(c)));o.appendChild(p),o.appendChild(document.createElement("div"))}})}),this.element.appendChild(h),this.showCalcsGraphDataAvailability("structure"!==t)}selectAll(e){let t=this.element.children[0].children[0];this._recursiveNodeSelection(t,!0),a(t,!0)}getMarkedLeaf(){return null===this.markedNode?null:this.markedNode.getAttribute("data-calc-id")}setMarkedLeafIfNoneMarked(e){if(null===this.getMarkedLeaf())if(null===e)this._markFirstSelectedNode();else{let t=this.element.querySelector('div[data-calc-id="'+e+'"]');this._setMarkedCalc(t)}}_events(){this.element.addEventListener("click",e=>{let t=e.target.className;if(t.indexOf("folded")>=0)this._foldTreeNode(e.target);else if(t.indexOf("node-checkbox")>=0){let t=e.target.parentElement.className.indexOf("selected")<0;this._recursiveNodeSelection(e.target.parentElement,t),a(e.target.parentElement,t),this.treeSelectionListener(this.selectedCalcs),this._keepCalcMarked(t)}else t.indexOf("node-label")>=0&&"calc-l node-selected"===e.target.parentElement.className&&this._setMarkedCalc(e.target.parentElement)})}_foldTreeNode(e){let t=e.parentElement.nextElementSibling;e.className.indexOf("-folded")>=0?(e.className=e.className.replace("folded","unfolded"),t.style.display="block"):(e.className=e.className.replace("unfolded","folded"),t.style.display="none")}_recursiveNodeSelection(e,t){e.children[1];if(t)e.className+=" node-selected";else{let t=e.className.indexOf(" node-selected");e.className=e.className.substring(0,t)}if(e.className.indexOf("calc-l")>=0){let s=e.getAttribute("data-calc-id");t?this.selectedCalcs.add(s):this.selectedCalcs.delete(s)}else{let s=e.nextElementSibling;for(let e=0;e<s.children.length;e++)this._recursiveNodeSelection(s.children[e++],t)}}setTreeSelectionListener(e){this.treeSelectionListener=e}setLeafMarkedListener(e){this.leafMarkedListener=e}getTreeSelectedCalcs(){return this.selectedCalcs}_keepCalcMarked(e){if(e&&null===this.markedNode)this._markFirstSelectedNode();else if(!e){let e=parseInt(this.markedNode.getAttribute("data-calc-id"));0===this.selectedCalcs.size?(this.markedNode.className=this.markedNode.className.replace("-marked",""),this.markedNode=null,this.leafMarkedListener(null)):this.selectedCalcs.has(e)||this._markFirstSelectedNode()}}_markFirstSelectedNode(){let e=this.element.getElementsByClassName("calc-l");for(var t=0;t<e.length;t++)if(e[t].className.indexOf("node-selected")>=0)return void this._setMarkedCalc(e[t])}_setMarkedCalc(e){if(null!==this.markedNode){this.markedNode.className=this.markedNode.className.replace("-marked",""),this.markedNode.querySelector("#icon-container").style.display="none";let e=this.markedNode.querySelector(".folder-icon");null!==e&&(e.src=i.IMAGE_DIR+"folder.png")}e.className+="-marked";let t=e.querySelector(".folder-icon");null!==t&&(t.src=i.IMAGE_DIR+"folder-sel.png"),e.querySelector("#icon-container").style.display="block",this.markedNode=e;let s=e.parentElement.previousElementSibling.firstElementChild;"node-folded"===s.className&&(s.className="node-unfolded",s.parentElement.nextElementSibling.style.display="block"),void 0!==this.leafMarkedListener&&this.leafMarkedListener(e.getAttribute("data-calc-id"))}showCalcsGraphDataAvailability(e){let t=this.element.getElementsByClassName("calc-graph-aval");for(var s=0;s<t.length;s++)t[s].style.display=e?"inline":"none"}setHeight(e){this.element.style.height=e+"px"}}},function(e,t,s){"use strict";let i=s(9),n=s(1);s(0);function a(e){return"Gamma"===e||"G"===e?"Γ":e}e.exports=class extends i{constructor(){super({left:55,right:5,top:0,bottom:30}),this.phononMode=!1,this.factor=1602176565e-28}setPhononMode(){this.phononMode=!0,this.factor=1986445681679957e-38,this.outOfRangeColorActivated=!1}attach(e,t,s){super.attach(e,t,s)}getTopAndLowestPoints(e){let t=e[0].band_energies[0][0][0],s=e[0].band_energies[0][0][0];for(let i=0;i<e.length;i++){for(let n=0;n<e[i].band_energies[0].length;n++){let a=Math.max.apply(null,e[i].band_energies[0][n]);a>t&&(t=a),a=Math.min.apply(null,e[i].band_energies[0][n]),a<s&&(s=a)}if(2===e[i].band_energies.length)for(let n=0;n<e[i].band_energies[1].length;n++){let a=Math.max.apply(null,e[i].band_energies[1][n]);a>t&&(t=a),a=Math.min.apply(null,e[i].band_energies[1][n]),a<s&&(s=a)}}return[(s-this.energyOffset)/this.factor,(t-this.energyOffset)/this.factor]}drawKPointLabel(e,t){n.addText(this.axisGroup,e*this.xRel,16,t,"middle","steps")}setBandStructureData(e){let t=e.section_k_band_segment;if(this.bandGapData=void 0,this.energyOffset=0,void 0!==e.section_band_gap){let t=1/0,s=0;for(let i=0;i<e.section_band_gap.length;++i){let n=e.section_band_gap[i].value;n<t&&(t=n,s=i)}0!=t&&(this.bandGapData=e.section_band_gap[s],this.bandGapData.cbmDistances=[],this.bandGapData.vbmDistances=[],this.energyOffset=this.bandGapData.valence_band_max_energy)}this.bandsDataSpin1=[],this.bandsDataSpin2=[],this.segmentLimitsX=[],this._reset();let s=this.getTopAndLowestPoints(t),i=s[0],n=s[1];this.phononMode?this.setAxisRangeAndLabels("",0,1,"Frequency (cm⁻¹)",-50,320,i,n,100):this.setAxisRangeAndLabels("",0,1,"Energy (eV)",-6,11,i,n,5);let l=0,r=null,o=!1,d=t[t.length-1].k_path_distances,h=d[d.length-1];for(let e=0;e<t.length;e++){let s=t[e],i=s.band_segm_labels,n=s.band_energies[0],d=s.band_energies[1],c=s.k_path_distances;this.bandsDataSpin1.push([]),this.bandsDataSpin2.push([]);let p=c[c.length-1];this.segmentLimitsX.push(l/h),null!==i&&(null!==r&&r!==i[0]?this.drawKPointLabel(l/h,a(r)+"|"+a(i[0])):this.drawKPointLabel(l/h,a(i[0])),e===t.length-1&&this.drawKPointLabel(1,a(i[1])),r=i[1]);for(let t=0;t<c.length;t++){let s=c[t]/h;for(let i=0;i<n[t].length;i++){0===t&&(this.bandsDataSpin1[e][i]=[]);let a=(n[t][i]-this.energyOffset)/this.factor;this.bandsDataSpin1[e][i].push({x:s,y:a}),!o&&a>1e4&&(o=!0)}if(void 0!==d)for(let i=0;i<d[t].length;i++){0===t&&(this.bandsDataSpin2[e][i]=[]);let n=(d[t][i]-this.energyOffset)/this.factor;this.bandsDataSpin2[e][i].push({x:s,y:n}),!o&&n>1e4&&(o=!0)}}l+=p}if(o)throw"Plotter Data Overflow: Probably the energy data is not in correct units";this.repaint()}repaintData(e,t){let s;this.segmentLimitsX.forEach(s=>{let i=this.transformY(e),a=this.transformY(t);this.phononMode&&(i+=200,a-=200),n.addLine(this.plotContent,s*this.xRel,i,s*this.xRel,a,"segment")});for(var i=0;i<this.bandsDataSpin1.length;i++)for(var a=0;a<this.bandsDataSpin1[i].length;a++){s="";for(var l=0;l<this.bandsDataSpin1[i][a].length;l++)s+=" "+this.xRel*this.bandsDataSpin1[i][a][l].x+" "+this.transformY(this.bandsDataSpin1[i][a][l].y);n.addPolyline(this.plotContent,s,"plotSpin1")}if(this.bandsDataSpin2.length>0)for(i=0;i<this.bandsDataSpin2.length;i++)for(a=0;a<this.bandsDataSpin2[i].length;a++){s="";for(l=0;l<this.bandsDataSpin2[i][a].length;l++)s+=" "+this.xRel*this.bandsDataSpin2[i][a][l].x+" "+this.transformY(this.bandsDataSpin2[i][a][l].y);n.addPolyline(this.plotContent,s,"plotSpin2")}void 0!==this.bandGapData&&(this.bandGapData.cbmDistances.forEach(e=>{let t=this.xRel*e,s=this.transformY((this.bandGapData.conduction_band_min_energy-this.energyOffset)/this.factor);n.addPoint(this.plotContent,t,s,3,"cbm-vbm-points"),n.addText(this.plotContent,t+4,s-6,"CBM")}),this.bandGapData.vbmDistances.forEach(e=>{let t=this.xRel*e,s=this.transformY((this.bandGapData.valence_band_max_energy-this.energyOffset)/this.factor);n.addPoint(this.plotContent,t,s,3,"cbm-vbm-points"),n.addText(this.plotContent,t+4,s+14,"VBM")}))}}},function(e,t,s){"use strict";let i=s(1);const n="http://www.w3.org/2000/svg";e.exports=class{constructor(e={left:20,right:0,top:0,bottom:20}){this.margins=e,this.svg=document.createElementNS(n,"svg"),this.parentElement=null,this.plotContent=null,this.axisGroup=null,this.yAxisLabelsGroup=null,this.yLabelText=null,this.noDataGroup=null,this.yZoom=1,this.yOffset=0,this.repaintListener=null,this.nodataLabel=null,this.outOfRangeColorActivated=!0}attach(e,t,s){this.parentElement=e,this.parentElement.appendChild(this.svg),this.width=void 0!==t?t:this.parentElement.clientWidth,this.height=void 0!==s?s:this.svg.width,this.svg.setAttribute("width",this.width),this.svg.setAttribute("height",this.height),this.plotRangeX=this.width-this.margins.left-this.margins.right,this.plotRangeY=this.height-this.margins.top-this.margins.bottom,this.yAxisArea=document.createElementNS(n,"svg"),this.svg.appendChild(this.yAxisArea);let a=this.margins.left;this.plotAreaHeight=this.height-this.margins.bottom-this.margins.top,this.yAxisArea.setAttribute("width",a),this.yAxisArea.setAttribute("height",this.plotAreaHeight),this.yAxisArea.setAttribute("x",0),this.yAxisArea.setAttribute("y",0),this.plotArea=document.createElementNS(n,"svg"),this.svg.appendChild(this.plotArea),this.plotAreaWidth=this.width-this.margins.left-this.margins.right,this.plotArea.setAttribute("width",this.plotAreaWidth),this.plotArea.setAttribute("height",this.plotAreaHeight),this.plotArea.setAttribute("x",this.margins.left),this.plotArea.setAttribute("y",this.margins.top),this.plotAreaBg=i.addRect(this.plotArea,0,0,this.plotAreaWidth,this.plotAreaHeight),this.plotAreaBg.setAttribute("class","moveable-plot"),this.plotAreaBg.setAttribute("opacity",0),this._events()}isAttached(){return null!==this.parentElement}setAxisRangeAndLabels(e,t,s,n,a,l,r,o,d,h=2){this.xLabel=e,this.xMin=t,this.xMax=s,this.yMinInit=a,this.yMaxInit=l,this.yMin=r,this.yMax=o,this.yLabelGapInit=d,this.xRel=this.plotRangeX/(this.xMax-this.xMin),this.yRel=this.plotRangeY/(this.yMaxInit-this.yMinInit),this._resetAxisGroup(),i.addLine(this.axisGroup,0,0,this.plotRangeX,0,"main-axis"),i.addLine(this.axisGroup,0,0,0,-this.plotRangeY,"main-axis"),i.addLine(this.axisGroup,this.plotRangeX,0,this.plotRangeX,-this.plotRangeY,"main-axis"),i.addLine(this.axisGroup,0,-this.plotRangeY,this.plotRangeX,-this.plotRangeY,"main-axis"),null!==n&&(this.yLabelText=i.addText(this.svg,0,0,n,"middle","axis-steps-big"),this.yLabelText.setAttribute("transform","translate(15,"+(this.plotRangeY/2+this.margins.top)+") rotate(-90)")),null!==e&&i.addText(this.axisGroup,this.plotRangeX/2,this.margins.bottom-12,this.xLabel,"middle","axis-steps-big"),this._resetYAxisLabelGroup(),this.precalculation_1=this.plotAreaHeight+this.yMinInit*this.yRel,this.precalculation_2=this.precalculation_1}_events(){let e;this.plotArea.addEventListener("wheel",e=>{e.preventDefault(),e.deltaY>0&&this.yZoom>.5?this.yZoom-=.2:e.deltaY<0&&this.yZoom<2&&(this.yZoom+=.2),this.repaint(),null!==this.repaintListener&&this.repaintListener(this.yZoom,this.yOffset)}),this.plotArea.addEventListener("mousedown",t=>{t.preventDefault(),e=t.clientY+this.yOffset,this.plotArea.addEventListener("mousemove",s),this.plotArea.addEventListener("mouseup",e=>{this.plotArea.removeEventListener("mousemove",s)}),this.plotArea.addEventListener("mouseout",e=>{this.plotArea.removeEventListener("mousemove",s)})});let t=this;function s(s){t.yOffset=e-s.clientY,t.precalculation_2=t.precalculation_1-t.yOffset,t.repaint(),null!==t.repaintListener&&t.repaintListener(t.yZoom,t.yOffset)}}setYZoomAndOffset(e,t){this.yZoom=e,this.yOffset=t,this.precalculation_2=this.precalculation_1-this.yOffset}setExternalYAxisMax(e){this.externalYAxisMax=e}getYAxisMax(){return this.yAxisMax}repaint(){let e;this._resetYAxisLabelGroup(),e=this.yZoom>1?this.yLabelGapInit/5:this.yLabelGapInit;let t=Math.floor(this.yMin/e)*e,s=Math.ceil(this.yMax/e)*e;if(this.yAxisMax=s,void 0!==this.externalYAxisMax&&(s=this.externalYAxisMax),null!==this.yLabelText)for(let n=t;n<s+1;n+=e)i.addLine(this.yAxisLabelsGroup,this.margins.left,this.transformY(n),this.margins.left-3,this.transformY(n)),i.addText(this.yAxisLabelsGroup,this.margins.left-5,this.transformY(n)+5,n,"end","axis-steps");if(this._resetPlotContent(),this.outOfRangeColorActivated){i.addRect(this.plotContent,0,this.transformY(this.yMax)-2*this.plotAreaHeight,this.plotAreaWidth,2*this.plotAreaHeight).setAttribute("class","out-of-range"),i.addRect(this.plotContent,0,this.transformY(this.yMin),this.plotAreaWidth,2*this.plotAreaHeight).setAttribute("class","out-of-range")}i.addLine(this.plotContent,0,this.transformY(0),this.plotRangeX,this.transformY(0),"zeroline"),this.repaintData(t,s),this.plotArea.removeChild(this.plotAreaBg),this.plotArea.appendChild(this.plotAreaBg)}setRepaintListener(e){this.repaintListener=e}transformY(e){return-e*this.yZoom*this.yRel+this.precalculation_2}_resetPlotContent(){null!==this.plotContent&&this.plotArea.removeChild(this.plotContent),this.plotContent=document.createElementNS(n,"g"),this.plotArea.appendChild(this.plotContent)}_resetAxisGroup(){null!==this.axisGroup&&this.svg.removeChild(this.axisGroup),this.axisGroup=document.createElementNS(n,"g"),this.svg.appendChild(this.axisGroup),this.axisGroup.setAttribute("transform","matrix(1 0 0 1 "+this.margins.left+" "+(this.height-this.margins.bottom)+")")}_resetYAxisLabelGroup(){null!==this.yLabelText&&(null!==this.yAxisLabelsGroup&&this.yAxisArea.removeChild(this.yAxisLabelsGroup),this.yAxisLabelsGroup=document.createElementNS(n,"g"),this.yAxisArea.appendChild(this.yAxisLabelsGroup))}_reset(){this.yZoom=1,this.yOffset=0,this._resetPlotContent(),null!==this.yLabelText&&(this.svg.removeChild(this.yLabelText),this.yLabelText=null),null!==this.noDataGroup&&(this.svg.removeChild(this.noDataGroup),this.noDataGroup=null)}setNoData(){this._resetYAxisLabelGroup(),this._resetPlotContent(),this._resetAxisGroup(),null===this.noDataGroup&&(this.noDataGroup=document.createElementNS(n,"g"),this.svg.appendChild(this.noDataGroup),i.addRect(this.noDataGroup,0,0,this.width,this.height),this.noDataGroup.setAttribute("fill","#EEE"),i.addText(this.noDataGroup,this.width/2,this.height/2+10,"NO DATA","middle","nodata"))}}},function(e,t,s){let i=s(1),n=s(0),a=(s(7),s(20)),l=s(23),r=s(25),o=s(27),d=s(29),h=s(32),c=s(2),p=s(4),u={eStruct:null,thermalProps:null};class m{constructor(e){this.hostElement=e;this.viewer=new matviewer.StructureViewer(e,{view:{autoResize:!1,autoFit:!0,fitMargin:.5},structure:{createLegend:!1,showLegend:!1,radiusScale:.7,bondScale:1.5,showCopies:!0,viewCenter:"COP"}}),this.legendElement=document.createElement("div"),this.legendElement.setAttribute("class","element-labels"),this.legendElement.setAttribute("style","position: absolute; bottom: 50px; right: 0"),this.hostElement.appendChild(this.legendElement),this.footerElement=document.createElement("div"),this.footerElement.setAttribute("class","structure-viewer-legend"),this.hostElement.appendChild(this.footerElement),this.footerElement.innerHTML=`\n\n <div style="float: left; padding-right: 12px" >\n <input type="checkbox" class="show-axis" checked> Show axis\n </div>\n\n <div style="float: left; padding-right: 18px" >\n <input type="checkbox" class="show-bonds" checked> Show bonds\n </div>\n\n <div style="float: left; position:relative;" >\n <img class="view-reset" style="cursor: pointer;" height="18px"\n src="${n.IMAGE_DIR}reset.svg" />\n <div class="view-reset-tooltip" > Reset view </div>\n </div>\n\n <div class="vr-download" style="float: right"> </div>\n\n <div style="clear: both;"></div>\n `,this.axisCheckbox=this.footerElement.querySelector(".show-axis"),this.axisCheckbox.addEventListener("click",e=>{this.viewer.toggleLatticeParameters(this.axisCheckbox.checked)}),this.bondsCheckbox=this.footerElement.querySelector(".show-bonds"),this.bondsCheckbox.addEventListener("click",e=>{this.viewer.toggleBonds(this.bondsCheckbox.checked)}),this.labelsContainer=this.hostElement.querySelector(".element-labels"),this.vrLinksContainer=this.footerElement.querySelector(".vr-download"),this.vrDropDown=new y,this.vrLinksContainer.appendChild(this.vrDropDown.element);let t=this.hostElement.querySelector(".view-reset");t.addEventListener("click",e=>this.viewer.controls.reset()),t.addEventListener("mouseover",e=>{this.hostElement.querySelector(".view-reset-tooltip").style.display="block"}),t.addEventListener("mouseout",e=>{this.hostElement.querySelector(".view-reset-tooltip").style.display="none"})}load(e){e=this.getCellDataForViewer(e),this.viewer.load(e),this.createElementLegend()}resizeCanvasToHostElement(){this.viewer.resizeCanvasToHostElement()}setMaterialId(e){this.vrDropDown.setMaterialId(e)}changeHostElement(e){this.hostElement!==e&&(this.hostElement.removeChild(this.legendElement),this.hostElement.removeChild(this.footerElement),this.hostElement=e,this.viewer.changeHostElement(e),this.hostElement.appendChild(this.legendElement),this.hostElement.appendChild(this.footerElement)),this.viewer.resizeCanvasToHostElement(),this.viewer.fitToCanvas(),this.viewer.render()}getCellDataForViewer(e){let t={};return t.pbc=e.periodicity,t.chemicalSymbols=e.atom_labels,t.cell=n.convert2d(e.lattice_vectors,1e10),t.scaledPositions=e.atom_positions,t}createElementLegend(){this.labelsContainer.innerHTML="";let e=this.viewer.elements,t=[];for(let s in e)e.hasOwnProperty(s)&&t.push([s,e[s][0],e[s][1]]);t.sort((function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0}));let s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("width",50),s.setAttribute("height",25*t.length),this.labelsContainer.appendChild(s);for(let e=0;e<t.length;++e){let n=t[e][0],a=t[e][1].toString(16),l=6-a.length;a="#"+Array(l+1).join("0")+a,i.addCircle(s,10,25*e+12,8,a,"#777",1),i.addText(s,24,25*e+18,n,"start","structure-viewer-legend-labels")}}}class y{constructor(e){this.folded=!0,this.element=document.createElement("div"),this.element.innerHTML+=`\n <div >\n <span style=" vertical-align: 30%; ">Virtual Reality files</span>\n <img style="cursor: pointer" src="${n.IMAGE_DIR}folded.png" />\n </div>\n\n <div class="vr-download-panel" style="position: relative; display: none">\n\n </div>\n `,this.element.tabIndex="0",this.element.style.outline="none",this.foldingPanel=this.element.querySelector(".vr-download-panel"),this.foldBtn=this.element.querySelector("img"),this.foldBtn.addEventListener("click",e=>{this.folded=!this.folded,this.foldBtn.src=this.folded?n.IMAGE_DIR+"folded.png":n.IMAGE_DIR+"unfolded.png",this.foldingPanel.style.display=this.folded?"none":"block"}),this.element.addEventListener("blur",e=>{setTimeout(()=>{this.folded=!0,this.foldBtn.src=n.IMAGE_DIR+"folded.png",this.foldingPanel.style.display="none"},300)})}setMaterialId(e){this.foldingPanel.innerHTML=`\n <div class="vr-download-panel-unfolded" style="width: 210px;">\n <div style="padding: 5px; ">\n <a href="http://nomad.srv.lrz.de/cgi-bin/NOMAD/material?${e}">Get VR file</a>\n </div>\n <br>\n <div style="padding-bottom: 5px; ">Visualization tools for specific devices:</div>\n\n <div style="padding: 5px; ">\n <a href="http://nomad.srv.lrz.de/NOMAD/NOMADViveT-Setup.exe">HTC Vive</a>\n </div>\n \x3c!--\n <div style="padding: 5px; ">\n <a href="http://nomad.srv.lrz.de/NOMAD/NOMADGearvrT.apk">Samsung GearVR</a>\n </div>\n --\x3e\n <div style="padding: 5px; ">\n <a target="_blank" href="https://play.google.com/store/apps/details?id=com.lrz.nomadvr">Google Cardboard</a>\n </div>\n\n </div>\n `}}e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","material-module"),this.overview=new a,this.overview.attachAndSetEvents(this.element),this.structureViewer=new m(this.overview.vizBox),this.structureDetails=new l,this.structureDetails.attachAndSetEvents(this.element),this.electronicStructDetails=new r,this.electronicStructDetails.attachAndSetEvents(this.element),this.methodologyDetails=new o,this.methodologyDetails.attachAndSetEvents(this.element),this.thermalDetails=new d,this.thermalDetails.attachAndSetEvents(this.element),this.elasticDetails=new h,this.elasticDetails.attachAndSetEvents(this.element),this.currentDetailView=null}setMaterialView(e){this._loadMaterial(e.material_id,e.view)}getCurrentPageStatus(){let e=null;return null===this.currentDetailView&&(e=this.overview.getEStructChosenCalcs()),{pageId:this.currentDetailViewId,eStructCalcs:e}}_setView(e){null===this.currentDetailView?this.overview.element.style.display="none":this.currentDetailView.element.style.display="none",void 0===e?(this.currentDetailView=null,this.currentDetailViewId=null,this.overview.setVisible()):(this.currentDetailViewId=e,this._setDetailView(n.MAT_VIEW[e]))}_setCellViewer(e){this.structureViewer.changeHostElement(e)}_setDetailView(e){e===n.MAT_VIEW.structure?this.currentDetailView=this.structureDetails:e===n.MAT_VIEW.electronicstruct?this.currentDetailView=this.electronicStructDetails:e===n.MAT_VIEW.methodology?this.currentDetailView=this.methodologyDetails:e===n.MAT_VIEW.thermalprops&&(this.currentDetailView=this.thermalDetails),this.currentDetailView.setVisible()}_loadMaterial(e,t){this._setView(t);let s=()=>{let e=c.getMaterialData();c.getIdealizedStructure();if(null!==this.currentDetailView)this.currentDetailView.load(),t===n.MAT_VIEW.structure&&this._setCellViewer(this.structureDetails.vizBox),t===n.MAT_VIEW.methodology&&this.methodologyDetails.updateSelection();else{document.querySelector("title").innerHTML="NOMAD Encyclopedia - "+n.getMaterialTitle(e,!1),this.overview.setMaterialData();null===e.material_name?e.formula:e.material_name;this.overview.setCalcsData(u),this._setCellViewer(this.overview.vizBox)}},i=()=>{let t=c.isReady(e);return t&&s(),t};i()||(c.clear(),p.reset(),this.structureViewer.axisCheckbox.checked=!0,this.structureViewer.bondsCheckbox.checked=!0,document.getElementById("methodology-ov").style.visibility="hidden",document.getElementById("structure-ov").style.visibility="hidden",document.getElementById("e-structure-ov").style.display="none",document.getElementById("e-structure-ov").style.visibility="hidden",document.getElementById("thermal-props-ov").style.visibility="hidden",p.show("load_basic"),n.serverReq(n.getMaterialURL(e),e=>{let t=JSON.parse(e.target.response);c.setMaterialData(t),n.materialId=t.material_id,i(),p.hide("load_basic")}),p.show("load_calculations"),n.serverReq(n.getMaterialXsURL("calculations",e),t=>{let s=JSON.parse(t.target.response),a=s.representatives.idealized_structure;c.setCalculations(s);let l=JSON.stringify({properties:["idealized_structure"]});p.show("load_idealized"),n.serverReqPOST(n.getMaterialCalcURL(e,a),l,e=>{let t=JSON.parse(e.target.response).idealized_structure;c.setIdealizedStructure(t),this.structureViewer.load(t),document.getElementById("structure-ov").style.visibility="visible",document.getElementById("methodology-ov").style.visibility="visible",i(),p.hide("load_idealized")}),p.hide("load_calculations")}),p.show("load_groups"),n.serverReq(n.getMaterialXsURL("groups",e),e=>{let t=JSON.parse(e.target.response);c.setGroups(t),i(),p.hide("load_groups")}))}}},function(e,t,s){"use strict";let i=s(9),n=s(1),a=s(0);e.exports=class extends i{constructor(e){super(e)}attach(e,t,s){super.attach(e,t,s)}setPoints(e,t){this.pointsSpin1=[],this.pointsSpin2=[],this._reset();let s=e.dos_values[0],i=null;2===e.dos_values.length&&(i=e.dos_values[1]);let l=e.dos_energies,r=[],o=[];for(var d=0;d<l.length;d++){let e=l[d]/1602176565e-28,t=1602176565e-28*s[d];if(r.push(t),o.push(e),this.pointsSpin1.push({x:t,y:e}),null!==i){let t=1602176565e-28*i[d];this.pointsSpin2.push({x:t,y:e}),r.push(t)}}let h=Math.max.apply(null,r),c=Math.max.apply(null,o),p=Math.min.apply(null,o),u=a.generateDiagramSteps(h,3),m=u[0];u[1];this.setAxisRangeAndLabels(null,0,m[m.length-1],"Energy (eV)",-6,11,p,c,5),n.addText(this.axisGroup,this.plotRangeX/2,this.margins.bottom,"DOS (states/eV/cell)","middle","axis-steps-big");for(let e=0;e<m.length;e++){let t=this.plotRangeX*m[e]/m[m.length-1];n.addLine(this.axisGroup,t,0,t,3,1);let s=m[e];s=Math.abs(s)>=1e4||Math.abs(s)<=1e-4?s.toExponential(1):parseFloat(s.toFixed(3)),n.addText(this.axisGroup,t,13,0===e?"0":s,"middle","axis-steps-smaller")}this.repaint()}repaintData(){let e="";for(var t=0;t<this.pointsSpin1.length;t++)e+=" "+this.xRel*this.pointsSpin1[t].x+" "+this.transformY(this.pointsSpin1[t].y);n.addPolyline(this.plotContent,e,"plotSpin1"),e="";for(t=0;t<this.pointsSpin2.length;t++)e+=" "+this.xRel*this.pointsSpin2[t].x+" "+this.transformY(this.pointsSpin2[t].y);n.addPolyline(this.plotContent,e,"plotSpin2")}setYAxisLabelsVisibility(e){null!==this.yAxisLabelsGroup&&(this.yAxisLabelsGroup.style.visibility=e?"visible":"hidden")}}},function(e,t,s){"use strict";let i=s(1),n=s(5);e.exports=class extends n{constructor(){super({left:50,right:16,top:10,bottom:32}),this.tooltip}setData(e,t){this.clear();let s=e.indexOf(600)+1,n=[],a=[];for(let s=0;s<e.length;++s){let i=e[s],l=t[s];null!==i&null!==l&&(n.push(i),a.push(l))}let l=n.slice(0,s),r=a.slice(0,s),o=Math.max.apply(null,r);this.setRangeAndLabels("T (K)",0,600,"Cv (J/K/kg)",0,200*Math.ceil(o/200)),this.drawAxis(4,4,0);let d="";l.forEach((e,t)=>{let s=r[t];d+=" "+this.xRel*e+" -"+this.yRel*(s-this.yMin)}),i.addPolyline(this.plotArea,d,"plotSpin1")}}},function(e,t){e.exports=class{constructor(e,t){this.first=!0,this.last=!1,this.element=document.createElement("div"),this.element.className=e,void 0!==t&&(this.element.style.width=t),this.element.innerHTML='\n <div class="prev-sel-btn" style="float: left; width: 20%;">\n <div style="padding-left: 10%;">\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10.069 11.872" width="20px">\n <path transform="scale(0.7) translate(-346.291 -664.481)"\n d="M356.36,666.024l-1.544-1.544-8.525,8.513,8.493,8.447,1.544-1.544-6.8-6.9Z" />\n </svg>\n </div>\n </div>\n <div class="calc-sel-text" style="float: left; width: 60%;">\n NOT Calculation\n </div>\n <div class="next-sel-btn" style="float: right; width: 20%;">\n <div style="padding-right: 10%;">\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="-10.069 -11.872 10.069 11.872" width="20px">\n <g transform="rotate(180) scale(0.7)">\n <path d="M10.069,1.544,8.525,0,0,8.513,8.493,16.96l1.544-1.544-6.8-6.9Z"/>\n </g>\n </svg>\n </div>\n </div>\n <div style="clear: both;"></div>\n ',this.prevBtn=this.element.querySelector(".prev-sel-btn"),this.prevIcon=this.element.querySelector(".prev-sel-btn path"),this.calcSelectorTxt=this.element.querySelector(".calc-sel-text"),this.nextBtn=this.element.querySelector(".next-sel-btn"),this.nextIcon=this.element.querySelector(".next-sel-btn path"),this._styleButtons(),this._events()}_events(){this.prevBtn.addEventListener("click",e=>{e.preventDefault(),this.first||(this.first=this.prevListener(),this.last=!1,this._styleButtons())}),this.nextBtn.addEventListener("click",e=>{e.preventDefault(),this.last||(this.first=!1,this.last=this.nextListener(),this._styleButtons())})}_styleButtons(){this.prevIcon.setAttribute("class","calc-selector-icon"+(this.first?"-disabled":"")),this.nextIcon.setAttribute("class","calc-selector-icon"+(this.last?"-disabled":""))}setPrevListener(e){this.prevListener=e}setNextListener(e){this.nextListener=e}setState(e,t,s){this.calcSelectorTxt.innerHTML=e,this.first=t,this.last=s,this._styleButtons()}}},function(e,t,s){"use strict";let i=s(1),n=s(5);class a extends n{constructor(){super({left:54,right:20,top:20,bottom:30})}drawBars(e,t,s,n,a,l){for(let r=0;r<e.length;++r){let o,d=(t[r]-s)*this.xRel,h=e[r]*this.yRel;o=0==a?(n-s)/l*this.xRel:a*this.xRel,i.addRect(this.plotArea,d,-h,o,h,"bar")}}}e.exports=class{constructor(){this.freqGraph=new a}attach(e,t,s){this.freqGraph.attach(e,t,s)}drawPoints(e,t,s){let i,n,a,l=e.occurrences,r=e.values,o=Math.max(...l);if(1==r.length){let e=r[0];0!==e?(i=.9*e,n=1.1*e+.2*e/s):(i=0,n=e+1),a=0}else i=r[0],a=r[1]-r[0],n=r[r.length-1]+a;this.freqGraph.setRangeAndLabels(t,i,n,"Occurrence",0,o),this.freqGraph.drawAxis(n===i?null:5,2,i>1e3?0:2),this.freqGraph.drawBars(l,r,i,n,a,s)}clear(){this.freqGraph.clear()}}},function(e,t,s){"use strict";let i,n,a,l,r,o=document.querySelector("body"),d=[],h=[],c=[],p=!1;function u(e,t){let s=document.createElement("div");return s.setAttribute("class","user-guidance"),s.innerHTML='<img src="img/tip'+e+'.png" width="'+t+'px" />',s.style.position="absolute",s.style.display="none",o.appendChild(s),s}function m(e){if(8===e&&!p)return;if(4===e&&!p)return;let t=h[e].domTarget.getBoundingClientRect();d[e].style.top=t.top+h[e].top+window.pageYOffset+"px",d[e].style.left=t.left+h[e].left+"px",d[e].style.display="block"}function y(e){d[e].style.display="none",localStorage.setItem("tip"+e,"off"),c[e]="off"}function v(e){switch(e.preventDefault(),e.target.style.display="none",i){case 2:i=5;break;case 6:i=8;break;default:i++}g(i),m(i)}function f(e,t){null===c[e]&&(t?m(e):d[e].style.display="none")}function g(e){i=e,localStorage.setItem("currentTip",e)}e.exports={init:function(e,t,s,i){n=e,a=t,l=s,r=i,c[3]=localStorage.getItem("tip3"),c[4]=localStorage.getItem("tip4"),c[7]=localStorage.getItem("tip7"),0===d.length&&(d[1]=u(1,220),h[1]={domTarget:n,top:-70,left:-240},d[2]=u(2,280),h[2]={domTarget:n,top:-110,left:80},d[3]=u(3,180),h[3]={domTarget:a,top:180,left:720},d[4]=u(4,240),h[4]={domTarget:l,top:45,left:-250},d[5]=u(5,210),h[5]={domTarget:n,top:-130,left:70},d[6]=u(6,240),h[6]={domTarget:n,top:-100,left:370},d[7]=u(7,220),h[7]={domTarget:r,top:160,left:-40},d[8]=u(8,240),h[8]={domTarget:l,top:30,left:760},d[1].addEventListener("click",v),d[2].addEventListener("click",v),d[3].addEventListener("click",e=>{y(3)}),d[4].addEventListener("click",e=>{y(4)}),d[5].addEventListener("click",v),d[6].addEventListener("click",v),d[7].addEventListener("click",e=>{y(7)}),d[8].addEventListener("click",e=>{e.target.style.display="none",g(10)}));let o=localStorage.getItem("currentTip");null===o?g(1):(o=parseInt(o),o<10&&g(o))},setFinal:function(){p=!0,i<10&&(d[i].style.display="none",g(8),m(i)),f(4,!0)},show:function(e,t,s){i<10&&(e?m(i):d[i].style.display="none"),f(3,e&&t),f(4,e),f(7,e&&s)},showIndependentTip:f}},function(e,t,s){"use strict";let i=s(0),n=(s(4),s(17)),a=s(18),l=s(19),r=s(10),o=s(33),d=s(15),h=s(2),c=document.getElementById("content"),p=document.querySelector("title");window.allowNewLoadPopup=!0,a.subscribe("authenticated",e=>{let t=document.location.hash.substring(2);if(t.lastIndexOf("/")===t.length-1&&(t=t.substring(0,t.length-1)),t.indexOf("/")>0){"material"===t.split("/")[0]&&(f.style.visibility="visible")}});var u=new Keycloak({url:window.nomadEnv.keycloakBase,realm:window.nomadEnv.keycloakRealm,clientId:window.nomadEnv.keycloakClientId});window.keycloak=u;let m=document.querySelector("#login-button"),y=document.querySelector("#logout-button"),v=document.querySelector("#user-name");u.init({onLoad:"check-sso",silentCheckSsoRedirectUri:window.nomadEnv.guiRoot+"silent-check-sso.html",promiseType:"native"}).then(e=>{e?u.loadUserProfile().then((function(e){v.textContent=`${e.firstName} ${e.lastName}`,m.style.display="none",y.style.display="inline",a.publish("authenticated")})).catch((function(){console.log("Failed to load user profile.")})):(m.style.display="inline",y.style.display="none",v.textContent="Guest")}),m.onclick=()=>{u.login({redirectUri:window.nomadEnv.guiRoot+"#/search"}).catch(()=>{console.log("Authentication error.")})},y.onclick=()=>{u.logout()};let f=document.getElementById("calc-flagging-tab");f.style.top=window.innerHeight/2+"px",f.addEventListener("click",e=>{n.show(b.getCurrentPageStatus())});let g,b,x,w,S=new class{constructor(){this.element=document.querySelector("#breadcrumb-placeholder"),this.element.innerHTML='\n <span class="goto-page Search">Search</span>\n <span class="goto-page Results"> > <span>Results</span></span>\n <span class="goto-page Overview"> > <span>Overview</span></span>\n <span class="Details">\n > \n <select class="details-dropdown" >\n <option value="structure">Structure</option>\n <option value="electronicstruct">Electronic structure</option>\n <option value="methodology">Methodology</option>\n <option value="thermalprops">Thermal Properties</option>\n \x3c!-- elasticconst--\x3e\n </select>\n </span>\n ',this.resultsSel=this.element.querySelector(".Results"),this.overviewSel=this.element.querySelector(".Overview"),this.detailsSel=this.element.querySelector(".Details"),this.detailsDropDown=this.element.querySelector(".details-dropdown"),this.element.querySelector(".Search").addEventListener("click",e=>{i.setBrowserHashPath("search")}),this.resultsSel.addEventListener("click",e=>{i.setBrowserHashPath("search/results")}),this.overviewSel.addEventListener("click",()=>{i.setBrowserHashPath("material",i.materialId)}),this.detailsDropDown.addEventListener("change",e=>{i.setBrowserHashPath("material",h.getMaterialData().material_id+"/"+e.target.value)});let e=this;this.detailsDropDown.addEventListener("focus",(function t(){let s=e.detailsDropDown.querySelector('option[value="electronicstruct"]');h.hasElecStructureData()||e.detailsDropDown.removeChild(s);let i=e.detailsDropDown.querySelector('option[value="thermalprops"]');h.hasThermalData()||e.detailsDropDown.removeChild(i),e.detailsDropDown.removeEventListener("focus",t)}))}setState(e,t){this.resultsSel.querySelector("span").style.fontWeight="normal";let s=this.overviewSel.querySelector("span");s.style.fontWeight="normal","search"===e?(this.overviewSel.style.display="none",this.detailsSel.style.display="none","results"===t?(this.resultsSel.style.display="inline",this.resultsSel.querySelector("span").style.fontWeight="bold",this.element.style.visibility="visible"):this.element.style.visibility="hidden"):"material"===e&&(this.element.style.visibility="visible",this.resultsSel.style.display=i.searchResults?"inline":"none",this.overviewSel.style.display="inline",void 0===t?(this.detailsSel.style.display="none",s.style.fontWeight="bold"):(this.detailsSel.style.display="inline",this.detailsDropDown.value=t))}};function _(e){w&&c.removeChild(w),w=e,c.appendChild(w)}a.subscribe("show-material",e=>{console.log("Handling event show-material: "+e.material_id+" view: "+e.view),S.setState("material",e.view),void 0===x&&(b=new r,x=b.element),_(x),b.setMaterialView(e),d.show(!1),u.authenticated&&(f.style.visibility="visible")}),a.subscribe("show-search",e=>{console.log("Handling event show-search: "+e),f.style.visibility="hidden",p.innerHTML="NOMAD Encyclopedia - Search",S.setState("search",e),void 0===e?g.showSearchPage():"results"===e&&g.showResultsPage(),_(g.element)}),l.add("search",e=>a.publish("show-search",e)),l.add("material",(e,t)=>a.publish("show-material",{material_id:e,view:t})),g=new o,""===document.location.hash&&(document.location+="#/search"),l.route();document.querySelector("#user-name");let E=function(e){let t=("; "+document.cookie).split("; "+e+"=");if(2===t.length)return t.pop().split(";").shift()}("user_info");if(void 0!==E){let e=JSON.parse((T=E).substring(1,T.length-1).replace(/\\054/g,",").replace(/\\/g,""));setAppAuthenticated(e)}var T},function(e,t,s){"use strict";let i=s(0),n=s(2),a=document.querySelector("#flagging-form-popup-bg"),l=document.querySelector("#flagging-form-popup");l.innerHTML='\n\n<div> <img src="img/cross.svg" height="12px"\n style="float: right; cursor: pointer" />\n</div>\n\n<div class="form-wrapper">\n <div class="popup-title"> Error reporting</div>\n <br>\n <div> Material: <span id="error-material-id"></span></div>\n <select id="flagging-category" name="category">\n <option value="">Select a category *</option>\n <option value="structure">Structure</option>\n <option value="electronicstruct">Electronic structure</option>\n <option value="methodology">Methodology</option>\n <option value="thermalprops">Thermal properties</option>\n </select>\n\n <select id="flagging-subcategory" name="subcategory">\n\n </select>\n\n <textarea id="subject" name="subject" style="height:200px"\n placeholder="Write a short explanation about the error" ></textarea>\n\n <div id="form-validation-msg"> </div>\n\n <div style="display: flex; justify-content: space-evenly;">\n <button style="display: block">Send</button>\n </div>\n\n\n</div>\n';let r=l.querySelector("#flagging-category"),o=r.querySelector('option[value="electronicstruct"]'),d=r.querySelector('option[value="thermalprops"]'),h=l.querySelector("#flagging-subcategory"),c=l.querySelector("img"),p=l.querySelector("#form-validation-msg"),u=l.querySelector("button"),m=l.querySelector("#error-material-id"),y=null;function v(){a.style.visibility="hidden",l.style.visibility="hidden",r.selectedIndex=0,h.selectedIndex=0,l.querySelector("textarea").value="",p.innerHTML=""}function f(e,t){let s=document.createElement("option");return s.value=void 0===t?e:t,s.innerHTML=e,s}c.addEventListener("click",e=>{v()}),u.addEventListener("click",e=>{let t=r.options[r.selectedIndex];var s=window.keycloak;if(!s.authenticated)return void(p.innerHTML="Your authentication has expired. Please login again.");if(!r.disabled&&""===t.value)return void(p.innerHTML="The category fields must be set");if(r.disabled&&""===h.value&&t.value!==i.MAT_VIEW.methodology)return void(p.innerHTML="The subcategory fields must be set");p.innerHTML="Sending report...";let a=l.querySelector("textarea").value,o=n.getMaterialData().material_id;s.loadUserProfile().then((function(e){let s={};s.server=i.getServerLocation(),s.username=e.username,s.email=e.email,s.first_name=e.firstName,s.last_name=e.lastName,s.message=a,s.category=t.text,r.disabled?s.subcategory=h.options[h.selectedIndex].text:s.representatives=n.getRepresentatives(),i.serverReqPOST(i.getReportURL(o),JSON.stringify(s),e=>{204===e.target.status?v():p.innerHTML="Could not connect to the service. Please check your connection and try again later."})})).catch(e=>{console.log(e),p.innerHTML="Could not connect to the service. Please check your connection and try again later."})}),e.exports={show:function(e){y=e.eStructCalcs,o.style.display=n.hasElecStructureData()?"block":"none",d.style.display=n.hasThermalData()?"block":"none",function(e){h.innerHTML="";let t=n.getMaterialData().material_id;if(m.textContent=t,null===e)r.disabled=!1,h.style.display="none";else switch(r.disabled=!0,h.style.display="block",h.appendChild(f("Choose the subcategory *","")),e){case i.MAT_VIEW.structure:r.selectedIndex=1,h.appendChild(f("Structure representation")),h.appendChild(f("Calculation tree")),h.appendChild(f("Summary")),h.appendChild(f("Specific calculation"));break;case i.MAT_VIEW.electronicstruct:r.selectedIndex=2,h.appendChild(f("Calculation tree")),h.appendChild(f("Summary")),h.appendChild(f("Band structure")),h.appendChild(f("DOS")),h.appendChild(f("Brillouin zone"));break;case i.MAT_VIEW.methodology:r.selectedIndex=3,h.style.display="none";break;case i.MAT_VIEW.thermalprops:r.selectedIndex=4,h.appendChild(f("Calculation tree")),h.appendChild(f("Phonon dispersion")),h.appendChild(f("Phonon DOS")),h.appendChild(f("Specific heat")),h.appendChild(f("Helmholtz free energy"))}}(e.pageId);let t=l.getBoundingClientRect(),s=(window.innerWidth-t.width)/2,c=(window.innerHeight-t.height)/2;l.style.left=s+"px",l.style.top=c-20+"px",l.style.visibility="visible",a.style.visibility="visible"},hide:v}},function(e,t,s){"use strict";var i=new Map,n=-1;e.exports={subscribe:function(e,t){if("function"!=typeof t)return!1;i.has(e)||i.set(e,new Map);var s="uid_"+String(++n);return i.get(e).set(s,t),s},publish:function(e,t){return!!(i.has(e)&&i.get(e).size>0)&&(setTimeout((function(){i.get(e).forEach((function(e,s){e(t)}))}),0),!0)}}},function(e,t,s){"use strict";let i=s(4),n=new Map;window.addEventListener("hashchange",r);var a=[window.location.hash],l=window.history.length;function r(){var e=window.location.hash,t=window.history.length;a.length&&l==t?a[a.length-2]==e?(a=a.slice(0,-1),i.reset(),window.allowNewLoadPopup=!1):(window.allowNewLoadPopup=!0,a.push(e)):(window.allowNewLoadPopup=!0,a.push(e),l=t);let s,r,o,d=document.location.hash.substring(2);d.lastIndexOf("/")===d.length-1&&(d=d.substring(0,d.length-1));let h=d.indexOf("&state");if(-1!=h&&(d=d.substring(0,h)),d.indexOf("/")>0){let e=d.split("/");s=e[0],r=e[1],o=e[2]}else s=d;n.has(s)&&n.get(s)(r,o)}e.exports={add:function(e,t){n.set(e,t)},route:r}},function(e,t,s){"use strict";let i=s(0),n=s(3),a=s(4),l=s(8),r=s(11),o=s(12),d=(s(10),s(2)),h=s(22).SimilarityFinder;e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","overview"),this.materialId;this.calcMaterialId=null,this.element.innerHTML='\n\n <div class="material-title">\n </div>\n\n <div style="float: left; width: 40%;">\n\n <div id="structure-ov" class="view-box">\n <div class="title">Structure\n <img style="float: right" class="to-detail" src="img/more.svg" />\n <div style="clear: both;"></div>\n </div>\n\n <div class="viz-box-container" style="height: 260px; position: relative">\n <div class="viz-box" style="height: 90%"></div>\n </div>\n\n <div class="footer">\n <div ><b><span>System type</span></b>:\n <span class="system-type-field" ></span>\n </div>\n <div class="space-group-field" style="display: none">\n <b><span info-sys-data="space-group">Space group</span></b>:\n <span class="space-group-value" ></span>\n </div>\n <div class="structure-type-field" style="display: none">\n <b><span info-sys-data="structure-type">Structure type</span></b>:\n <span class="structure-type-value" ></span>\n </div>\n </div>\n </div>\n\n\n\x3c!-- ***** Elastic Constants Box\n\n <div id="elastic-ov" class="view-box">\n <div class="title">Elastic constants\n <img style="float: right" class="to-detail" src="img/more.svg" />\n <div style="clear: both;"></div>\n </div>\n\n <div class="info-fields">\n Not analyzed yet\n </div>\n\n </div>\n--\x3e\n\n\n <div id="methodology-ov" class="view-box">\n <div class="title">Methodology\n <img style="float: right" class="to-detail" src="img/more.svg" />\n <div style="clear: both;"></div>\n </div>\n\n <div class="info-fields">\n\n <div class="info-fields-label" > Available calculations </div>\n\n <div style="float: left; width: 45%" >\n <b><span info-sys-data="functional-type">Functional</span></b>\n <div class="functional-field" > </div>\n </div>\n <div style="float: right; width: 45%" >\n <b><span info-sys-data="code-name">Code</span></b>\n <div class="code-field"> </div>\n </div>\n <div style="clear: both;"></div>\n </div>\n\n </div>\n\n </div>\n\n <div style="float: right; width: 60%;">\n\n <div id="e-structure-ov" class="view-box" style="display: block">\n <div class="title">Electronic structure\n <img style="float: right" class="to-detail" src="img/more.svg" />\n <div style="clear: both;"></div>\n </div>\n\n <div > \x3c!-- style="margin: 12% 0; " --\x3e\n\n <div style="float: left; width: 60%; ">\n <div style="padding: 20px 0 20px 30px">\n <div class="info-fields-label">\n <span info-sys-data="band-structure">Band structure</span>\n </div>\n <div>\n <div id="band-plotter" > </div>\n </div>\n\n <div class="footer-bs-calc"></div>\n </div>\n </div>\n\n <div style="float: left; width: 40%; ">\n <div style="padding: 20px 30px 20px 40px">\n <div class="info-fields-label">\n <span info-sys-data="DOS">DOS</span>\n </div>\n\n <div>\n <div id="dos-plotter" > </div>\n </div>\n <div class="footer-dos-calc"></div>\n </div>\n </div>\n\n\n\n <div style="clear: both;"></div>\n <table style="width: 100%">\n <tr>\n <td class="spin-legend" style="font-size: 0.9em; padding: 6px 30px 10px; display: none;">\n <svg width="15px" height="10px"> <polyline points="0,5 15,5" class="plotSpin1"/></svg>\n Spin <span style=\'font-size: 1.1em\'>⇧</span> \n\n <svg width="15px" height="10px"> <polyline points="0,5 15,5" class="plotSpin2"/></svg>\n Spin <span style=\'font-size: 1.1em\'>⇩</span>\n </td>\n <td class = "similarity-data-field">\n <div style="float: right; padding: 0px 50px 10px 0px; margin-top: 1px;" class="similarity-finder">\n </div>\n </td>\n </tr>\n </table>\n </div>\n <div style="clear: both;"></div>\n \x3c!--\n <div class="footer">\n\n <b>Band gap</b>: <span class="e-struct-field" ></span>\n </div>\n --\x3e\n </div>\n\n <div id="thermal-props-ov" class="view-box" style="visibility: hidden">\n <div class="title">Vibrational and thermal properties\n <img style="float: right" class="to-detail thermal-props" src="img/more.svg" />\n <div style="clear: both;"></div>\n </div>\n\n <div style="padding: 36px; ">\n <div class="info-fields-label">\n <span info-sys-data="heat-capacity-cv">Specific heat</span>\n </div>\n\n\n <div>\n <div id="heat-plotter" > </div>\n </div>\n <div class="footer-heat-calc" style="text-align: center"></div>\n </div>\n\n </div>\n\n </div>\n\n <div style="clear: both;"></div>\n ',this.materialTitle=this.element.getElementsByClassName("material-title")[0],this.systemType=this.element.querySelector(".system-type-field"),this.spaceGroupField=this.element.querySelector(".space-group-field"),this.spaceGroupValue=this.element.querySelector(".space-group-value"),this.structTypeField=this.element.querySelector(".structure-type-field"),this.structTypeValue=this.element.querySelector(".structure-type-value"),this.functional=this.element.querySelector(".functional-field"),this.code=this.element.querySelector(".code-field");let e=this.element.getElementsByClassName("to-detail");this.structureDetailBtn=e[0],this.electronicStructDetailBtn=e[2],this.methodologyDetailBtn=e[1],this.thermalDetailBtn=e[3],this.vizBox=this.element.getElementsByClassName("viz-box")[0],this.bandPlotter=null,this.bsCalcIdBox=this.element.getElementsByClassName("footer-bs-calc")[0],this.dosPlotter=null,this.dosCalcIdBox=this.element.getElementsByClassName("footer-dos-calc")[0],this.heatPlotter=null,this.heatCalcIdBox=this.element.querySelector(".footer-heat-calc"),this.spinLegend=this.element.querySelector(".spin-legend"),n.addToInfoSystem(this.element),this.eStructCalcs={bs:null,dos:null}}attachAndSetEvents(e){e.appendChild(this.element),this._events()}_events(){this.structureDetailBtn.addEventListener("click",e=>{i.setBrowserHashPath("material",this.materialId+"/"+i.MAT_VIEW.structure)}),this.electronicStructDetailBtn.addEventListener("click",e=>{i.setBrowserHashPath("material",this.materialId+"/"+i.MAT_VIEW.electronicstruct)}),this.methodologyDetailBtn.addEventListener("click",e=>{i.setBrowserHashPath("material",this.materialId+"/"+i.MAT_VIEW.methodology)}),this.thermalDetailBtn.addEventListener("click",e=>{i.setBrowserHashPath("material",this.materialId+"/"+i.MAT_VIEW.thermalprops)})}getEStructChosenCalcs(){return this.eStructCalcs}setDetailViewsListener(e){this.detailViewsListener=e}setVisible(){this.element.style.display="block"}setMaterialData(){let e=d.getMaterialData();this.materialTitle.innerHTML=i.getMaterialTitle(e),this.materialId=e.material_id;let t="bulk"===e.system_type;if(this.systemType.textContent=e.system_type,this.structTypeField.style.display=t&&null!==e.structure_type?"block":"none",this.spaceGroupField.style.display=t?"block":"none",t&&(this.structTypeValue.textContent=e.structure_type,this.spaceGroupValue.textContent=e.space_group_number+" ("+e.space_group_international_short_symbol+")",n.addElementToInfoSystem(this.spaceGroupValue,"space-group.value:"+e.space_group_number)),this.similarityFinder&&this.similarityFinder.element.remove(),e.similarity){this.similarityFinder=new h({left:40,right:16,top:0,bottom:30});const t=this.element.querySelector(".similarity-finder");this.similarityFinder.setSimilarityData(e.similarity),t.appendChild(this.similarityFinder.element),this.similartyDataField=this.element.querySelector(".similarity-data-field"),n.addToInfoSystem(this.similartyDataField)}}isLoaded(e,t,s){let i=d.getMaterialData().material_id;return this.calcMaterialId===i&&(!(e&&!this.bsLoaded)&&(!(t&&!this.dosLoaded)&&!(s&&!this.phononLoaded)))}setCalcsData(e){let t=d.getMaterialData(),s=d.getCalculations(),h=new Map,c=new Map,p=d.getCalc(d.getRepresentatives().electronic_band_structure),u=d.getCalc(d.getRepresentatives().electronic_dos),m=d.getCalc(d.getRepresentatives().thermodynamical_properties);if(this.isLoaded(void 0!==p,void 0!==u,void 0!==m))return;this.calcMaterialId=t.material_id,this.bsLoaded=!1,this.dosLoaded=!1,this.phononLoaded=!1;for(let e=0;e<s.length;e++){if(h.has(s[e].functional_type)){let t=h.get(s[e].functional_type);h.set(s[e].functional_type,++t)}else h.set(s[e].functional_type,1);let t=s[e].code_name.trim();if(c.has(t)){let e=c.get(t);c.set(t,++e)}else c.set(t,1)}void 0!==p&&(this.eStructCalcs.bs=p.calc_id),void 0!==u&&(this.eStructCalcs.dos=u.calc_id);let y=null;void 0!==p?y=p.calc_id:void 0!==u&&(y=u.calc_id),e.eStruct=null===y?null:+y,e.thermalProps=void 0===m?null:+m.calc_id,this.functional.textContent="";let v=document.createElement("div");h.forEach((e,t)=>{let s=document.createElement("span");s.setAttribute("info-sys-data","functional-type.value:"+i.getDefault(t)),s.textContent=e+" "+i.getDefault(t),v.appendChild(s);let n=document.createElement("br");v.appendChild(n)}),this.functional.append(v),n.addToInfoSystem(this.functional),this.code.textContent="";let f=document.createElement("div");if(c.forEach((e,t)=>{let s=document.createElement("span");s.setAttribute("info-sys-data","code-name.value:"+t),s.textContent=e+" "+t,f.appendChild(s);let i=document.createElement("br");f.appendChild(i)}),this.code.append(f),n.addToInfoSystem(this.code),d.hasElecStructureData()){document.getElementById("e-structure-ov").style.display="block";let e=()=>{this.dosLoaded&&this.bsLoaded&&(document.getElementById("e-structure-ov").style.visibility="visible")};if(null===this.bandPlotter&&(this.bandPlotter=new l,this.bandPlotter.attach(document.getElementById("band-plotter"),void 0,316)),null===this.dosPlotter&&(this.dosPlotter=new r({left:40,right:20,top:0,bottom:30}),this.dosPlotter.attach(document.getElementById("dos-plotter"),void 0,317)),void 0===p)this.bandPlotter.setNoData(),this.bsCalcIdBox.innerHTML="",this.bsLoaded=!0;else{let t=i.getMaterialCalcURL(this.materialId,p.calc_id);a.show("overview_electronic_band_structure");let s=JSON.stringify({properties:["electronic_band_structure"]});i.serverReqPOST(t,s,t=>{if(200===t.target.status){let s=JSON.parse(t.target.response).electronic_band_structure;this.bandPlotter.setBandStructureData(s),this.bsCalcIdBox.innerHTML="From calculation <b>"+i.getShortCode(p.calc_id)+'</b><br><span style="font-size: 0.8em">('+p.functional_type+" - "+p.code_name+")</span>",2===s.section_k_band_segment[0].band_energies.length&&(this.spinLegend.style.display="block"),this.bsLoaded=!0,e()}a.hide("overview_electronic_band_structure")})}if(void 0===u)this.dosPlotter.setNoData(),this.dosCalcIdBox.innerHTML="",this.dosLoaded=!0;else{let t=i.getMaterialCalcURL(this.materialId,u.calc_id);a.show("overview_electronic_dos");let s=JSON.stringify({properties:["electronic_dos"]});i.serverReqPOST(t,s,t=>{if(200===t.target.status){let s=JSON.parse(t.target.response).electronic_dos;this.dosPlotter.setPoints(s,u),this.dosCalcIdBox.innerHTML="From calculation <b>"+i.getShortCode(u.calc_id)+'</b><br><span style="font-size: 0.8em">('+u.functional_type+" - "+u.code_name+")</span>",2===s.dos_values.length&&(this.spinLegend.style.display="block"),this.dosLoaded=!0,e()}a.hide("overview_electronic_dos")})}}if(d.hasThermalData())if(document.getElementById("thermal-props-ov").style.display="block",null===this.heatPlotter&&(this.heatPlotter=new o,this.heatPlotter.attach(document.getElementById("heat-plotter"),void 0,317)),void 0===m)this.heatPlotter.setNoData(),this.heatCalcIdBox.innerHTML="";else{let e=i.getMaterialCalcURL(this.materialId,m.calc_id);a.show();let t=JSON.stringify({properties:["thermodynamical_properties"]});i.serverReqPOST(e,t,e=>{if(200===e.target.status){let t=JSON.parse(e.target.response).thermodynamical_properties,s=t.thermodynamical_property_temperature;this.heatPlotter.setData(s,t.specific_heat_capacity),this.heatCalcIdBox.innerHTML="From calculation <b>"+i.getShortCode(m.calc_id)+'</b></b> <span style="font-size: 0.8em">('+m.functional_type+" - "+m.code_name+")</span>",this.phononLoaded=!0,document.getElementById("thermal-props-ov").style.visibility="visible"}a.hide()})}else document.getElementById("thermal-props-ov").style.display="none"}}},function(e,t,s){s(0);e.exports=class{constructor(e){this.off=!0,this.element=document.createElement("span"),this.element.innerHTML+=`\n <img src="${e}_off.png" width="24px"\n style="margin-bottom: -1px; cursor: pointer"/>\n `,this.image=this.element.querySelector("img"),this.element.addEventListener("click",t=>{this.off=!this.off;let s=this.off?e+"_off":e;this.image.setAttribute("src",s+".png"),this.listener(this.off)})}setListener(e){this.listener=e}}},function(e,t,s){let i=s(0);e.exports={SimilarityFinder:class{constructor(){this.folded=!0,this.element=document.createElement("span"),this.element.style="float : right; border: 2px solid #DDD; padding: 2px 2px 0px 3px;",this.element.innerHTML+=`\n <span info-sys-data="similar-materials" style="vertical-align: 30%;">Similar materials</span>\n <img style="cursor: pointer" src="${i.IMAGE_DIR}folded.png" />\n\n <div class="vr-download-panel" style="position: relative; display: none;">\n\n </div>\n `,this.element.tabIndex="0",this.element.style.outline="none",this.foldingPanel=this.element.querySelector(".vr-download-panel"),this.foldBtn=this.element.querySelector("img"),this.foldBtn.addEventListener("click",e=>{this.folded=!this.folded,this.foldBtn.src=this.folded?i.IMAGE_DIR+"folded.png":i.IMAGE_DIR+"unfolded.png",this.foldingPanel.style.display=this.folded?"none":"block"}),this.element.addEventListener("blur",e=>{setTimeout(()=>{this.folded=!0,this.foldBtn.src=i.IMAGE_DIR+"folded.png",this.foldingPanel.style.display="none"},300)})}setSimilarityData(e){e.sort((function(e,t){return e.value<t.value?1:e.value>t.value?-1:0}));const t=e.slice(0,5),s=document.createElement("table");s.setAttribute("class","similar-materials-panel-unfolded"),s.style="width: 230px; padding-left: 5px;",this.foldingPanel.appendChild(s);const n=document.createElement("tr");n.style="padding: 5px; ",n.innerHTML='<th style = "text-align: left;">Formula (space group)</th><th>:</th><th style = "text-align: left;">Tc</th>',s.appendChild(n),t.forEach((function(e){const t=document.createElement("tr");t.style="padding: 5px; font-family: 'Arimo', sans-serif; font-size: 10pt; ";const n=`${window.location.toString().replace(/#.*$/,"")}#/material/${e.material_id}`;t.innerHTML=`<td><a href="${n}" target="_${e.material_id}" style="color:#777; font-family: 'Arimo', sans-serif; font-size: 10pt;">${i.getSubscriptedFormula(e.formula)} (${e.space_group_number})</a></td><td>:</td> <td>${e.value.toPrecision(3)}</td>`,s.appendChild(t)}))}}}},function(e,t,s){"use strict";let i=s(6),n=s(0),a=s(3),l=s(7),r=s(13),o=s(14),d=s(24),h=s(2);class c{constructor(e){this.groupCalcs=null,this.element=document.createElement("div"),this.element.innerHTML='\n <div>\n\n <div class="group-components" style="display: none">\n <div style="padding: 10px 0 30px 10px; " class="eos-host">\n </div>\n\n <div style="padding-top: 10px; " class="calc-selector-host">\n </div>\n </div>\n\n <div class="info-fields">\n <div><b>Lattice constants</b></div>\n <div class="latt-constants"></div>\n <div class="volume-field"><b><span info-sys-data="cell-volume">Volume</span></b>:\n <span class="volume-value" ></span>\n </div>\n \x3c!-- <div><b>Pressure</b>: <span class="" ></span> </div>--\x3e\n <div class="density-field"><b>Density</b>:\n <div class="stats-fields" >\n <span info-sys-data="mass-density">Mass density</span> =\n <span class="mass-density-value" ></span>\n </div>\n <div class="stats-fields" >\n <span info-sys-data="atomic-density">Atomic density</span> =\n <span class="atomic-density-value" ></span>\n </div>\n </div>\n\n <div class="energy-field"><b><span info-sys-data="energies">Energies</span></b> (code-specific)</div>\n <div class="energy-descomp"> </div>\n\n <div class="wyckoff-pos-calc-field" >\n <b><span info-sys-data="free-wyckoff-parameters">Wyckoff sites</span></b>\n (fractional coordinates)\n <div class="wyckoff-pos-calc-table"> </div>\n </div>\n\n </div>\n\n </div>\n ',this.groupComponents=this.element.querySelector(".group-components"),this.calcSelector=new r("calc-selector-bar","60%"),this.element.querySelector(".calc-selector-host").appendChild(this.calcSelector.element),this.lattConstantsField=this.element.querySelector(".latt-constants"),this.volumeField=this.element.querySelector(".volume-field"),this.volumeValue=this.element.querySelector(".volume-value"),this.densityField=this.element.querySelector(".density-field"),this.massDensityValue=this.element.querySelector(".mass-density-value"),this.atomicDensityValue=this.element.querySelector(".atomic-density-value"),this.energyField=this.element.querySelector(".energy-field"),this.energyDescompValue=this.element.querySelector(".energy-descomp"),this.wyckoffPosField=this.element.querySelector(".wyckoff-pos-calc-field"),this.wyckoffPosTable=this.element.querySelector(".wyckoff-pos-calc-table"),this.eosViewer=new d,this.eosViewer.attach(this.element.querySelector(".eos-host"),320,280),this.eosViewer.setClickPointListener(e=>{this.groupCalcUpdate(e+"")}),a.addToInfoSystem(this.element),this._events()}_events(){this.calcSelector.setPrevListener(e=>{if(this.groupIndex>0)return this.groupCalcUpdate(this.groupCalcs[--this.groupIndex]+""),0===this.groupIndex}),this.calcSelector.setNextListener(e=>{if(this.groupIndex<this.groupCalcs.length-1)return this.groupCalcUpdate(this.groupCalcs[++this.groupIndex]+""),this.groupIndex===this.groupCalcs.length-1})}update(e,t){if(this.representative=e,this.isGroup=t,t){let t=h.getGroupType(e),s=h.getGroupId(e),i=h.getMaterialData().material_id,a=n.serverReq(n.getMaterialGroupURL(i,t,s),()=>{if(200===a.status){let e=JSON.parse(a.response),t=e.volumes.map(e=>e/1e-30),s=e.energies.map(e=>e/1602176565e-28),i=e.calculations,n=s[0];this.groupCalcs=i,this.groupIndex=0,this.groupComponents.style.display="block",this.eosViewer.clear(),this.eosViewer.draw(t,s,this.groupCalcs,n),this.groupCalcUpdate(i[0])}})}else this.groupComponents.style.display="none",this.groupCalcUpdate(e)}groupCalcUpdate(e){if(null!==e){if(null!==this.groupCalcs&&(this.groupIndex=this.groupCalcs.indexOf(e),this.groupIndex>=0)){let t=n.getShortCode(e)+" ("+(this.groupIndex+1)+"/"+this.groupCalcs.length+")";this.calcSelector.setState(t,0===this.groupIndex,this.groupIndex===this.groupCalcs.length-1),this.eosViewer.selectCalc(e)}let t=h.getMaterialData(),s=t.material_id,i="2D"===t.system_type,a="bulk"===t.system_type,l=(h.getCalc(e),h.getMaterialData().has_free_wyckoff_parameters),r=["energies","lattice_parameters","mass_density","atomic_density","cell_volume"];l&&r.push("wyckoff_sets");let o=JSON.stringify({properties:r}),d=n.serverReqPOST(n.getMaterialCalcURL(s,e),o,()=>{if(200===d.status){let e=JSON.parse(d.response),t=e.lattice_parameters,s=i||a?`<div>b = ${n.m2Angstrom(t.b)}</div>`:"";s+=a?`<div>c = ${n.m2Angstrom(t.c)}</div>`:"";let r=a?`<div>α = ${n.rad2degree(t.alpha)}</div>\n <div>β = ${n.rad2degree(t.beta)}</div>`:"";r+=i||a?`<div>γ = ${n.rad2degree(t.gamma)}</div>`:"",this.lattConstantsField.innerHTML=`\n <div style="float: left; ">\n <div>a = ${n.m2Angstrom(t.a)}</div>\n ${s}\n </div>\n <div style="float: left; padding-left: 40px;">\n ${r}\n </div>\n <div style="clear: both;padding: 0"></div>\n `,this.densityField.style.display=a?"block":"none",this.volumeField.style.display=a?"block":"none",a&&(this.volumeValue.innerHTML=n.m3ToAngstrom3(e.cell_volume),this.atomicDensityValue.innerHTML=n.toAngstromMinus3(e.atomic_density),this.massDensityValue.innerHTML=e.mass_density.toFixed(1)+" kg/m<sup>3</sup>");let o=!1,h=e.energies;if(void 0!==h){let e=h.energy_total;void 0!==e&&(o=!0,this.energyDescompValue.innerHTML="<div>Total E = "+n.J2eV(e)+" eV</div>")}if(this.energyField.style.display=o?"block":"none",this.energyDescompValue.style.display=o?"block":"none",this.wyckoffPosField.style.display=l?"block":"none",l){let t=new Map;e.wyckoff_sets.forEach(e=>{let s="",i=!1,n=e.variables;if(void 0!==n&&(i=!0,["x","y","z"].forEach(e=>{if(e in n){let t=n[e];s+=e+" = "+t.toFixed(2)+"<br>"}})),i){let i=[];i.push(e.wyckoff_letter),i.push(s),t.has(e.element)?t.get(e.element).push(i):t.set(e.element,[i])}});let s="";t.forEach((e,t)=>{e.sort((e,t)=>e[0]>t[0]?1:-1);let i=!0;s+='<tr > <td style="width: 30%;">'+t+" </td>",e.forEach(e=>{i?(i=!1,s+='<td style="width: 30%; ">'+e[0]+'</td><td style="width: 40%;">'+e[1]+"</td></tr>"):s+="<tr><td> </td><td>"+e[0]+"</td><td>"+e[1]+"</td></tr>"})}),this.wyckoffPosTable.innerHTML='<table id="calc-wyckoff">'+s+"</table>"}}})}}}class p{constructor(e){this.calcMapByFunctional=null,this.quantitiesMap=null,this.hostElement=e,this.graphTrigger=null,this.viewType="text",this.functional=null,this.nBins=15,this.hostElement.innerHTML+='\n <div style="float: left" >\n <svg xmlns="http://www.w3.org/2000/svg" class="chart-tab"\n viewBox="0 0 15 15" width="15" height="15" style="fill: #c7c7c7;">\n <rect x="0" y="0" width="2" height="15" />\n <rect x="3" y="5" width="1.8" height="7" />\n <rect x="6" y="3" width="1.8" height="9" />\n <rect x="9" y="6" width="1.8" height="6" />\n <rect x="12" y="2" width="1.8" height="10" />\n <rect x="2" y="13" width="13" height="2" />\n </svg>\n <svg xmlns="http://www.w3.org/2000/svg" class="text-tab"\n viewBox="0 0 15 15" width="15" height="15" style="fill: #777;">\n <rect x="0" y="1" width="15" height="2.5" />\n <rect x="0" y="6" width="15" height="2.5" />\n <rect x="0" y="11" width="15" height="2.5" />\n </svg>\n </div>\n\n <div class="functional-tabs" style="float: right">\n </div>\n\n <div style="clear: both;"></div>\n\n <div class="content-placeholder" >\n\n <div style="display: block" class="text-panel" >\n <div><b>Lattice constants</b>:\n <div class="stats-fields latt-constants-field" >\n </div>\n </div>\n <div class="volume-field"><b><span info-sys-data="cell-volume">Volume</span></b> (Å<sup>3</sup>):\n <div class="stats-fields volume-value" > </div>\n </div>\n <div class="density-field"><b>Density</b> :\n <div >\n <div class="stats-fields" >\n <span info-sys-data="mass-density">Mass density</span> (kg/m<sup>3</sup>) =\n <span class="mass-density-value" ></span>\n </div>\n <div class="stats-fields" >\n <span info-sys-data="atomic-density">Atomic density</span> (Å<sup>-3</sup>) =\n <span class="atomic-density-value" ></span>\n </div>\n </div>\n </div>\n </div>\n\n <div style="display:none" class="chart-panel" >\n <div class="charts-placeholder" > </div>\n <div class="charts-selector" >\n\n </div>\n </div>\n\n </div>\n ',this.chartTab=this.hostElement.querySelector(".chart-tab"),this.textTab=this.hostElement.querySelector(".text-tab"),this.functionalTabs=this.hostElement.querySelector(".functional-tabs"),this.chartPanel=this.hostElement.querySelector(".chart-panel"),this.textPanel=this.hostElement.querySelector(".text-panel"),this.lattConstantsField=this.hostElement.querySelector(".latt-constants-field"),this.volumeField=this.hostElement.querySelector(".volume-field"),this.volumeFieldValue=this.hostElement.querySelector(".volume-value"),this.densityField=this.hostElement.querySelector(".density-field"),this.massDensityValue=this.hostElement.querySelector(".mass-density-value"),this.atomicDensityValue=this.hostElement.querySelector(".atomic-density-value"),this.statsViewer=new o;let t=this.hostElement.querySelector(".charts-placeholder");this.statsViewer.attach(t,350,200),this.chartsSelector=this.hostElement.querySelector(".charts-selector"),this.chartTab.addEventListener("click",e=>{this.chartTab.style.fill="#777",this.viewType="chart",this.textTab.style.fill="#c7c7c7",this.chartPanel.style.display="block",this.textPanel.style.display="none"}),this.textTab.addEventListener("click",e=>{this.textTab.style.fill="#777",this.viewType="text",this.chartTab.style.fill="#c7c7c7",this.textPanel.style.display="block",this.chartPanel.style.display="none"}),this.functionalTabs.addEventListener("click",e=>{"tab"===e.target.className&&(this.statsViewer.clear(),this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]').className="tab",this.functional=e.target.getAttribute("data-tab"),this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]').className="tab-selected",this._setData())}),this.chartsSelector.addEventListener("click",e=>{if(0===e.target.className.indexOf("quantity")){this.statsViewer.clear();let t=e.target.getAttribute("data-quantity"),s=this.quantitiesMap.get(t),i=s.label,n=s.stats;this.statsViewer.drawPoints(n.histogram,i,this.nBins),this.chartsSelector.querySelector(".quantity-selected").className="quantity",e.target.className="quantity-selected"}})}_setData(){let e="2D"===h.getMaterialData().system_type,t="bulk"===h.getMaterialData().system_type,s=(this.functional,Array.from(this.calcMapByFunctional.get(this.functional))),i=h.getMaterialData().material_id,a=new Map;a.set("lattice_a",{label:"a (Å)"}),e|t&&(a.set("lattice_b",{label:"b (Å)"}),a.set("gamma",{label:"&gamma"})),t&&(a.set("cell_volume",{label:"Volume (ų)"}),a.set("atomic_density",{label:"Atomic density (Å⁻³)"}),a.set("mass_density",{label:"Mass density (kg/m³)"}),a.set("lattice_c",{label:"c ()"}),a.set("alpha",{label:"&alpha"}),a.set("beta",{label:"&beta"}));let l=JSON.stringify({calculations:s,properties:Array.from(a.keys()),n_histogram_bins:this.nBins});n.serverReqPOST(n.getMaterialStatsURL(i),l,s=>{let i=JSON.parse(s.target.response);for(let e of a.keys()){let t=i[e];"cell_volume"==e?(t.min*=1e30,t.avg*=1e30,t.max*=1e30,t.histogram.values=t.histogram.values.map(e=>1e30*e)):"atomic_density"==e?(t.min*=1e-30,t.avg*=1e-30,t.max*=1e-30,t.histogram.values=t.histogram.values.map(e=>1e-30*e)):e.startsWith("lattice_")&&(t.min*=1e10,t.avg*=1e10,t.max*=1e10,t.histogram.values=t.histogram.values.map(e=>1e10*e));let s=a.get(e).label;t.equal=t.min===t.max;let l=s.split(":");t.label=l[0],2===l.length?t.units=l[1]:t.units="";let r,o=3;"mass_density"===e&&(o=1),r="alpha"==e||"beta"==e||"gamma"==e?n.rad2degree(t.avg.toFixed(o)):t.avg.toFixed(o)+' <span style="font-size: 0.9em">['+t.min.toFixed(o)+" , "+t.max.toFixed(o)+"]</span>",a.get(e).html=r,a.get(e).stats=t}let l=e||t?`<div>b (Å) = ${a.get("lattice_b").html}</div>`:"";l+=t?`<div>c (Å) = ${a.get("lattice_c").html}</div>`:"";let r=t?`<div>α = ${a.get("alpha").html}</div>\n <div>β = ${a.get("beta").html}</div>`:"";r+=e||t?`<div>γ = ${a.get("gamma").html}</div>`:"",this.lattConstantsField.innerHTML=`\n <div style="float: left; ">\n <div>a (Å) = ${a.get("lattice_a").html}</div>\n ${l}\n </div>\n <div style="float: left; padding-left: 40px;">\n ${r}\n </div>\n <div style="clear: both;padding: 0"></div>\n `;let o='\n <span class="quantity-selected" data-quantity="lattice_a">a</span>\n ';(e||t)&&(o+='<span class="quantity" data-quantity="lattice_b">b</span>'),this.densityField.style.display=t?"block":"none",this.volumeField.style.display=t?"block":"none",t&&(this.volumeFieldValue.innerHTML=a.get("cell_volume").html,this.massDensityValue.innerHTML=a.get("mass_density").html,this.atomicDensityValue.innerHTML=a.get("atomic_density").html,o+='\n <span class="quantity" data-quantity="lattice_c">c</span>\n <span class="quantity" data-quantity="cell_volume">volume</span>\n <span class="quantity" data-quantity="mass_density">mass density</span>\n <span class="quantity" data-quantity="atomic_density">atomic density</span>\n '),this.chartsSelector.innerHTML=o,this.quantitiesMap=a;let d=i.lattice_a.histogram;this.statsViewer.drawPoints(d,a.get("lattice_a").label,this.nBins)})}build(e){this.calcMapByFunctional=e,this.graphTrigger=null,this.statsViewer.clear(),this.unfoldedElement=null,this.functionalQuantityMap=new Map,this.functionalTabs.innerHTML="",this.calcMapByFunctional.forEach((e,t)=>{this.functionalTabs.innerHTML+='<span class="tab" data-tab="'+t+'">'+t+"</span>"});let t=Array.from(this.calcMapByFunctional.keys());(null===this.functional||t.indexOf(this.functional)<0)&&(this.functional=t[0]),this._setData(),this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]').className="tab-selected",a.addToInfoSystem(this.hostElement)}}e.exports=class extends i{constructor(){super("Structure"),this.navTree=new l,this.groupsData,this.element.innerHTML+='\n\n <div style="float: left; width: 36%;">\n <div class="view-box">\n <div class="title">Structure </div>\n <div class="viz-box-container" style="height: 400px; position: relative">\n <div class="viz-box" style="height: 90%"></div>\n </div>\n\n <div class="footer-flex-wrapper">\n\n <div class="fields-container">\n <div><b><span>System type</span></b>:\n <span class="struct-field" ></span>\n </div>\n <div class="structure-type-field" style="display: none">\n <b><span info-sys-data="structure-type">Structure type</span></b>:\n <span class="structure-type-value" ></span>\n </div>\n <div class="structure-prototype-field" style="display: none">\n <b><span info-sys-data="structure-prototype">Structure prototype</span></b>:\n <span class="structure-prototype-value" ></span>\n </div>\n <div class="strukturbericht-field" style="display: none">\n <b><span info-sys-data="strukturbericht">Strukturbericht designation</span></b>:\n <span class="strukturbericht-value" ></span>\n </div>\n </div>\n\n <div class="footer-flex" style="display: none">\n\n <div class="fields-container"\n style="flex-basis: 70%; border-right: 1px solid #E4E4E4; ">\n\n <div>\n <b><span info-sys-data="crystal-system">Lattice</span></b>:\n <span class="lattice-value" ></span>\n </div>\n <div>\n <b><span info-sys-data="space-group">Space group</span></b>:\n <span class="space-group-value" ></span>\n </div>\n <div>\n <b><span info-sys-data="point-group">Point group</span></b>:\n <span class="point-group-value" ></span>\n </div>\n </div>\n\n <div style="flex-basis: 30%; margin-left: 30px;">\n <div class="fields-container">\n <div><b><span info-sys-data="wyckoff-position-population">Wyckoff sites</span></b></div>\n <div class="wyckoff-sites-value"> </div>\n </div>\n </div>\n\n </div>\n\n </div>\n\n </div>\n </div>\n\n <div style="float: left; width: 36%;">\n <div class="view-box">\n <div class="title">Calculations</div>\n <div class="navTreeWrapper"></div>\n\n <div class="summary-title">Summary </div>\n <div style="font-size: 0.85em; text-align: center; padding: 4px;">Based on the calculations selected above</div>\n\n <div class="info-fields summary-box">\n \x3c!-- Lattice constants Cell volume, Density panel dynamically generated\n --\x3e\n </div>\n </div>\n </div>\n\n <div style="float: right; width: 28%;">\n <div class="calc-specifics-box">\n <div style="padding-top: 10px; " >\n <div class="tree-leaf-title"></div>\n </div>\n <div class="tree-leaf-viewer-host"></div>\n </div>\n </div>\n </div>\n </div>\n ',this.navTreeWrapper=this.element.getElementsByClassName("navTreeWrapper")[0];let e=this.element.getElementsByClassName("struct-field");this.systemTypeField=e[0],this.structTypeField=this.element.querySelector(".structure-type-field"),this.structTypeValue=this.element.querySelector(".structure-type-value"),this.structPrototypeField=this.element.querySelector(".structure-prototype-field"),this.structPrototypeValue=this.element.querySelector(".structure-prototype-value"),this.strukturberichtField=this.element.querySelector(".strukturbericht-field"),this.strukturberichtValue=this.element.querySelector(".strukturbericht-value"),this.lowerBox=this.element.querySelector(".footer-flex"),this.latticeValue=this.element.querySelector(".lattice-value"),this.spaceGroupValue=this.element.querySelector(".space-group-value"),this.pointGroupValue=this.element.querySelector(".point-group-value"),this.wyckoffValue=this.element.querySelector(".wyckoff-sites-value"),this.summaryByFunctionals=null,this.leafTitle=this.element.querySelector(".tree-leaf-title"),this.summaryBox=this.element.querySelector(".summary-box"),this.summaryByFunctionals=new p(this.summaryBox),this.calcSpecificsBox=this.element.querySelector(".calc-specifics-box"),this.treeLeafViewer=new c,this.element.querySelector(".tree-leaf-viewer-host").appendChild(this.treeLeafViewer.element),this.vizBox=this.element.querySelector(".viz-box"),a.addToInfoSystem(this.element)}setMaterialData(){let e=h.getMaterialData(),t=h.getIdealizedStructure();super.setMaterialData(e);let s=null===e.material_name?e.formula:e.material_name;if(this.navTree.build(s,"structure"),this.navTree.selectAll(),this.navTree.setHeight(250),this.navTree.setMarkedLeafIfNoneMarked(null),this.attachNavTree(this.navTree),this.updateSelection(this.navTree.getTreeSelectedCalcs()),this.updateMarkedLeaf(this.navTree.getMarkedLeaf()),this.navTree.setTreeSelectionListener(e=>{this.updateSelection(e)}),this.navTree.setLeafMarkedListener(e=>{this.updateMarkedLeaf(e)}),this.isBulk="bulk"===e.system_type,this.systemTypeField.textContent=e.system_type,this.structTypeField.style.display=this.isBulk&&null!==e.structure_type?"block":"none",this.structPrototypeField.style.display=this.isBulk&&null!==e.structure_prototype?"block":"none",this.strukturberichtField.style.display=this.isBulk&&null!==e.strukturbericht_designation?"block":"none",this.lowerBox.style.display=this.isBulk?"flex":"none",this.isBulk){this.structTypeValue.textContent=e.structure_type,this.structPrototypeValue.textContent=e.structure_prototype,this.strukturberichtValue.textContent=e.strukturbericht_designation,this.spaceGroupValue.textContent=e.space_group_number+" ("+e.space_group_international_short_symbol+")",this.pointGroupValue.textContent=e.point_group,this.latticeValue.textContent=e.crystal_system;let s=new Map;new Set;for(var i=0;i<t.wyckoff_sets.length;i++){let e=t.wyckoff_sets[i],n=e.element;if(s.has(n))s.get(n).add(e.wyckoff_letter);else{let t=new Set;t.add(e.wyckoff_letter),s.set(n,t)}}let n="";s.forEach((e,t)=>{let s=!0;n+="<tr> <td>"+t+": </td>",e.forEach(e=>{s?(s=!1,n+="<td>"+e+"</td></tr>"):n+="<tr><td> </td><td>"+e+"</td></tr>"})}),this.wyckoffValue.innerHTML="<table>"+n+"</table>"}a.addElementToInfoSystem(this.spaceGroupValue,"space-group.value:"+e.space_group_number),a.addElementToInfoSystem(this.latticeValue,"crystal-system.value:"+e.crystal_system),a.addElementToInfoSystem(this.pointGroupValue,"point-group.value:"+e.point_group)}updateSelection(e){if(e.size>0){let t=[];e.forEach(e=>{if(h.isGroup(e)){let s=h.getGroupType(e),i=h.getGroupId(e),n=h.getGroups().get(s).get(i);t.push(h.getCalc(n[0]))}else t.push(h.getCalc(e))}),this.summaryBox.style.visibility="visible";let s=n.getCalcMapByFunctional(t);this.summaryByFunctionals.build(s)}else this.summaryBox.style.visibility="hidden"}updateMarkedLeaf(e){let t=!1;if(null!==e)if(this.calcSpecificsBox.style.visibility="visible",t=h.isGroup(e),t){let t,s=h.getGroupType(e),i=h.getGroupId(e);t=h.getGroups().get(s).get(i),this.leafTitle.innerHTML=n.getShortCode(e)+" ("+t.length+")"}else this.leafTitle.innerHTML=n.getShortCode(e);else this.calcSpecificsBox.style.visibility="hidden";this.treeLeafViewer.update(e,t)}}},function(e,t,s){"use strict";let i=s(0),n=s(1),a=s(5);e.exports=class extends a{constructor(){super({left:60,right:20,top:30,bottom:40}),this.tooltip,this.calcPointMap=new Map,this.pointSelected=null}draw(e,t,s,a){for(let e=0;e<t.length;e++)555!==t[e]&&(t[e]-=a);let l=function(e){let t=[];return e.forEach(e=>{555!==e&&t.push(e)}),t}(t),r=Math.min.apply(null,e),o=Math.max.apply(null,e),d=0,h=Math.max.apply(null,l);if(r===o)r-=1,o+=1;else{let e=o-r;r-=.1*e,o+=.1*e}if(d===h)d-=1,h+=1;else{let e=h-d;d-=.15*e,h+=.1*e}this.setRangeAndLabels("Volume (ų)",r,o,"E - Eₘᵢₙ (eV)",d,h),this.drawAxis(2,2),n.addLine(this.plotArea,0,this.y(0),this.plotRangeX,this.y(0),"zeroline"),n.addText(this.plotArea,this.x(o),this.y(0)+12,"Eₘᵢₙ: "+a.toFixed(3)+" eV","end","axis-steps");for(let a=0;a<e.length;a++){let l=0===a?"eos-viewer-sel":"eos-viewer",r=0===a?6:3,o=555===t[a]?20:this.y(t[a]),d=n.addPoint(this.plotArea,this.x(e[a]),o,r,l);0===a&&(this.pointSelected=d),d.addEventListener("mouseover",e=>{this.tooltip=n.addText(this.plotArea,e.target.getBBox().x+10,e.target.getBBox().y-10,"Calc "+i.getShortCode(s[a]),"middle","tooltip")}),d.addEventListener("mouseout",e=>{n.removeElement(this.tooltip)}),d.addEventListener("click",e=>{this.clickPointListener(s[a])}),this.calcPointMap.set(s[a],d)}}selectCalc(e){this.pointSelected.setAttribute("class","eos-viewer"),this.pointSelected.setAttribute("r",3),this.pointSelected=this.calcPointMap.get(e),this.pointSelected.setAttribute("class","eos-viewer-sel"),this.pointSelected.setAttribute("r",6)}setClickPointListener(e){this.clickPointListener=e}x(e){return this.xRel*(e-this.xMin)}y(e){return-this.yRel*(e-this.yMin)}}},function(e,t,s){"use strict";let i=s(6),n=s(0),a=s(7),l=s(3),r=(s(13),s(14)),o=s(26),d=(new(s(5)),s(2)),h=s(4);class c{constructor(e){this.calcMapByFunctional=null,this.hostElement=e,this.viewType="text",this.functional=null,this.nBins=15,this.hostElement.innerHTML+='\n <div style="float: left" >\n <svg xmlns="http://www.w3.org/2000/svg" class="chart-tab"\n viewBox="0 0 15 15" width="15" height="15" style="fill: #c7c7c7;">\n <rect x="0" y="0" width="2" height="15" />\n <rect x="3" y="5" width="1.8" height="7" />\n <rect x="6" y="3" width="1.8" height="9" />\n <rect x="9" y="6" width="1.8" height="6" />\n <rect x="12" y="2" width="1.8" height="10" />\n <rect x="2" y="13" width="13" height="2" />\n </svg>\n <svg xmlns="http://www.w3.org/2000/svg" class="text-tab"\n viewBox="0 0 15 15" width="15" height="15" style="fill: #777;">\n <rect x="0" y="1" width="15" height="2.5" />\n <rect x="0" y="6" width="15" height="2.5" />\n <rect x="0" y="11" width="15" height="2.5" />\n </svg>\n </div>\n\n <div class="functional-tabs" style="float: right">\n </div>\n\n <div style="clear: both;"></div>\n\n <div class="content-placeholder" >\n\n <div style="display: block" class="text-panel" >\n\n <div><b><span info-sys-data="band gap">Band gap</span></b> (eV):\n <div class="stats-fields summary-bandgap-field" > </div>\n </div>\n </div>\n\n <div style="display:none" class="chart-panel" >\n <div class="charts-placeholder" > </div>\n </div>\n\n </div>\n ',this.chartTab=this.hostElement.querySelector(".chart-tab"),this.textTab=this.hostElement.querySelector(".text-tab"),this.functionalTabs=this.hostElement.querySelector(".functional-tabs"),this.chartPanel=this.hostElement.querySelector(".chart-panel"),this.textPanel=this.hostElement.querySelector(".text-panel"),this.bandgapField=this.hostElement.querySelector(".summary-bandgap-field"),this.statsViewer=new r,this.chartsPlaceholder=this.hostElement.querySelector(".charts-placeholder"),this.chartTab.addEventListener("click",e=>{this.chartTab.style.fill="#777",this.viewType="chart",this.textTab.style.fill="#c7c7c7",this.chartPanel.style.display="block",this.textPanel.style.display="none"}),this.textTab.addEventListener("click",e=>{this.textTab.style.fill="#777",this.viewType="text",this.chartTab.style.fill="#c7c7c7",this.textPanel.style.display="block",this.chartPanel.style.display="none"}),this.functionalTabs.addEventListener("click",e=>{"tab"===e.target.className&&(this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]').className="tab",this.functional=e.target.getAttribute("data-tab"),this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]').className="tab-selected",this._setData())})}_setData(){this.functional;let e=Array.from(this.calcMapByFunctional.get(this.functional)),t=d.getMaterialData().material_id,s=JSON.stringify({calculations:e,properties:["band_gap"],n_histogram_bins:this.nBins});n.serverReqPOST(n.getMaterialStatsURL(t),s,e=>{let t=JSON.parse(e.target.response).band_gap;if(void 0===t)return this.bandgapField.innerHTML="No band gap data available",this.statsViewer.clear(),void(this.chartsPlaceholder.textContent="No band gap data available");this.chartsPlaceholder.textContent="",this.statsViewer.attach(this.chartsPlaceholder,250,150),t.min*=6241509e12,t.avg*=6241509e12,t.max*=6241509e12,t.histogram.values=t.histogram.values.map(e=>6241509e12*e);let s=t.avg.toFixed(3)+' <span style="font-size: 0.9em">['+t.min.toFixed(3)+" , "+t.max.toFixed(3)+"]</span>";this.bandgapField.innerHTML=s,this.statsViewer.clear(),this.statsViewer.drawPoints(t.histogram,"Band gap (eV)",this.nBins)})}build(e){this.calcMapByFunctional=e,this.graphTrigger=null,this.statsViewer.clear(),this.unfoldedElement=null,this.functionalQuantityMap=new Map,this.functionalTabs.innerHTML="",this.calcMapByFunctional.forEach((e,t)=>{this.functionalTabs.innerHTML+='<span class="tab" data-tab="'+t+'">'+t+"</span>"});let t=Array.from(this.calcMapByFunctional.keys());(null===this.functional||t.indexOf(this.functional)<0)&&(this.functional=t[0]),this._setData(),this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]').className="tab-selected",l.addToInfoSystem(this.hostElement)}}class p{constructor(e){this.hostElement=e,this.loaded=!1;this.bzViewer=new matviewer.BrillouinZoneViewer(this.hostElement,{view:{autoResize:!1,autoFit:!0,fitMargin:.018}})}setCalcData(e){this.bzViewer.load(this._getBZDataForViewer(e)),this.hostElement.style.visibility="visible",this.loaded=!0,this.resize()}setNoData(){this.hostElement.style.visibility="hidden"}resize(){this.bzViewer.resizeCanvasToHostElement(),this.loaded&&(this.bzViewer.fitToCanvas(),this.bzViewer.render())}_getBZDataForViewer(e){let t=e.brillouin_zone,s=[],i=[];return e.section_k_band_segment.forEach(e=>{s.push(e.band_segm_labels),i.push(e.band_segm_start_end)}),{vertices:t.vertices,faces:t.faces,basis:e.reciprocal_cell,labels:s,segments:i}}}e.exports=class extends i{constructor(){super("Electronic Structure"),this.navTree=new a,this.element.innerHTML+='\n <div style="float: left; width: 30%;">\n <div class="view-box">\n <div class="title">Calculations </div>\n <div class="navTreeWrapper"></div>\n\n <div class="summary-title">Summary</div>\n <div class="footer summary-box" style="border-top: 0"></div>\n </div>\n </div>\n\n <div style="float: right; width: 70%;">\n <div class="view-box e-structure-box">\n\n <div class="title">Electronic structure</div>\n\n <div style="padding-top: 10px; " >\n <div class="tree-leaf-title"></div>\n </div>\n\n <div>\n\n <div style="padding: 30px 100px 20px 100px; ">\n <div class="info-fields-label" style="float: left; width: 54%; ">\n <span info-sys-data="band-structure">Band structure</span>\n </div>\n <div class="info-fields-label" style="float: left;">\n <span info-sys-data="DOS">DOS</span>\n </div>\n <div style="clear: both;"></div>\n\n <div class="calc-bs-dos-plotter" >\n </div>\n\n <div>\n <div class="band-gap-field" style="float: left; width: 56%; text-align: right">\n <b><span info-sys-data="band-gap">Band gap</span></b>:\n <span class="band-gap-value" ></span>\n </div>\n <div style="clear: both;"></div>\n\n </div>\n </div>\n\n <div class="spin-legend" style="font-size: 0.9em; padding: 0 30px 10px; display: none">\n <svg width="15px" height="10px"> <polyline points="0,5 15,5" class="plotSpin1"/></svg>\n Spin <span style=\'font-size: 1.1em\'>⇧</span> \n <svg width="15px" height="10px"> <polyline points="0,5 15,5" class="plotSpin2"/></svg>\n Spin <span style=\'font-size: 1.1em\'>⇩</span>\n </div>\n\n </div>\n\n <div class="footer lower-section">\n\n <div style="float: left">\n <div style="padding: 16px; ">\n <div class="info-fields-label" >\n <span info-sys-data="brillouin-zone-viewer">Brillouin zone</span>\n </div>\n <div class="bz-viewer-wrapper" style="width: 400px; height: 400px">\n </div>\n </div>\n </div>\n\n <div class="band" style="float: right; width: 40%;">\n <div style="padding: 16px; ">\n <div class="info-fields-label" >\n \x3c!-- <span info-sys-data="fermi-surface">Fermi surface </span> --\x3e\n </div>\n <div class="fermi-box" > </div>\n </div>\n </div>\n\n <div style="clear: both;"></div>\n\n </div> \x3c!-- footer --\x3e\n\n </div>\n\n </div> \x3c!-- view-box --\x3e\n ',this.navTreeWrapper=this.element.getElementsByClassName("navTreeWrapper")[0],this.leafTitle=this.element.querySelector(".tree-leaf-title"),this.rightBox=this.element.querySelector(".e-structure-box"),this.summaryByFunctionals=null,this.summaryBox=this.element.querySelector(".summary-box"),this.summaryByFunctionals=new c(this.summaryBox),this.bsDosPlotter=new o,this.bandGapField=this.element.querySelector(".band-gap-field"),this.bandGapValue=this.element.querySelector(".band-gap-value"),this.spinLegend=this.element.querySelector(".spin-legend"),this.lowerSection=this.element.querySelector(".lower-section"),this.fermiBox=this.element.getElementsByClassName("fermi-box")[0],this.bzViewerWrapper=new p(this.element.querySelector(".bz-viewer-wrapper")),l.addToInfoSystem(this.element)}setVisible(){this.element.style.display="block",this.bzViewerWrapper.resize()}setMaterialData(){let e=d.getMaterialData();super.setMaterialData(e);let t=null===e.material_name?e.formula:e.material_name;this.navTree.build(t,"electronic"),this.navTree.selectAll(),this.navTree.setHeight(400),this.navTree.setMarkedLeafIfNoneMarked(null),this.attachNavTree(this.navTree),this.updateSelection(this.navTree.getTreeSelectedCalcs()),this.updateMarkedLeaf(this.navTree.getMarkedLeaf()),this.navTree.setTreeSelectionListener(e=>{this.updateSelection(e)}),this.navTree.setLeafMarkedListener(e=>{this.updateMarkedLeaf(e)})}updateSelection(e){if(e.size>0){let t=[];e.forEach(e=>{t.push(d.getCalc(e))});let s=n.getCalcMapByFunctional(t);this.summaryByFunctionals.build(s)}else this.summaryBox.style.visibility="hidden"}updateMarkedLeaf(e){null===e?this.leafTitle.innerHTML="NO SELECTION":(this.leafTitle.innerHTML=n.getShortCode(e),this._loadGraphData(e))}_updateSelectorState(e){this.leafTitle.innerHTML=n.getShortCode(e)}_loadGraphData(e){let t=d.getCalc(e);if(this.bsDosPlotter.isAttached()||this.bsDosPlotter.attach(this.element.querySelector(".calc-bs-dos-plotter"),void 0,360),null===t||!t.has_band_structure&&!t.has_dos)this.bsDosPlotter.setNoData(),this.bzViewerWrapper.setNoData(),this.bandGapField.style.display="none",this.lowerSection.style.display="none";else{h.show("electronic_structure");let e=d.getMaterialData().material_id,s=n.getMaterialCalcURL(e,t.calc_id),i=JSON.stringify({properties:["electronic_band_structure","electronic_dos","band_gap"]});n.serverReqPOST(s,i,e=>{let s=JSON.parse(e.target.response),i=s.electronic_dos,a=s.electronic_band_structure,l=s.band_gap;(function(e,t){if(void 0!==e&&2===e.section_k_band_segment[0].band_energies.length)return!0;if(void 0!==t&&2===t.dos_values.length)return!0;return!1})(a,i)&&(this.spinLegend.style.display="block"),this.bsDosPlotter.setUpAndData(a,i,t),void 0!==l?(this.bandGapValue.textContent=n.J2eV(l,2)+" eV ",this.bandGapField.style.display="block"):(this.bandGapValue.textContent="",this.bandGapField.style.display="none"),void 0!==a&&void 0!==a.brillouin_zone?(this.lowerSection.style.display="block",this.bzViewerWrapper.setCalcData(a)):(this.lowerSection.style.display="none",this.bzViewerWrapper.setNoData()),h.hide("electronic_structure")})}}setPrevCalcListener(e){this.prevCalcListener=e}setNextCalcListener(e){this.nextCalcListener=e}}},function(e,t,s){let i=s(8),n=s(11);s(1);e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("style","margin: 0 auto"),this.parentElement=null,this.bsPlotter=new i,this.dosPlotter=new n({left:4,right:20,top:0,bottom:30}),this.dosYAxisLabeled=!1}attach(e,t,s){e.appendChild(this.element),this.bsPlotter.attach(this.element,s,s),this.height=s,this.dosPlotter.attach(this.element,this.height/2+20,s),this.parentElement=e}isAttached(){return null!==this.parentElement}setUpAndData(e,t,s){let i;if(this.hasDispData=null!=e,this.hasDosData=null!=t,i=!(!this.hasDosData||this.hasDispData),this.dosYAxisLabeled!==i){this.element.removeChild(this.dosPlotter.svg);let e=i?40:4;this.dosPlotter=new n({left:e,right:20,top:0,bottom:30});let t=this.height/2+e;this.dosPlotter.attach(this.element,t,this.height)}this.dosYAxisLabeled=i,this.hasDispData?(this.bsPlotter.setBandStructureData(e),this.hasDosData&&this.bsPlotter.setRepaintListener((e,t)=>{this.dosPlotter.setYZoomAndOffset(e,t),this.dosPlotter.repaint()})):this.bsPlotter.setNoData(),this.hasDosData?(this.dosPlotter.setPoints(t,s),this.hasDispData&&(this.bsPlotter.setExternalYAxisMax(this.dosPlotter.getYAxisMax()),this.dosPlotter.setRepaintListener((e,t)=>{this.bsPlotter.setYZoomAndOffset(e,t),this.bsPlotter.repaint()}),this.dosPlotter.svg.removeChild(this.dosPlotter.yLabelText),this.dosPlotter.yLabelText=null)):this.dosPlotter.setNoData(),this.dosPlotter.setYAxisLabelsVisibility(i)}setNoData(){this.bsPlotter.setNoData(),this.dosPlotter.setNoData()}}},function(e,t,s){"use strict";let i=s(6),n=s(0),a=s(3),l=s(2),r=s(28),o=window.nomadEnv.guiRoot,d=o.slice(0,o.lastIndexOf("/",o.lastIndexOf("/")-1))+"/gui/entry/id";const h=new Map([["single point","Single point"],["GW calculation","GW"],["geometry optimization","Geometry optimization"],["molecular dynamics","Molecular dynamics"],["phonon calculation","Phonon"],["equation of state","Equation of state"],["parameter variation","Parameter variation"],["QHA calculation","QHA"]]);class c{constructor(e){this.element=document.createElement("div"),this.element.className=e,this.filtersOn=[],this.folded=!0,this.element.innerHTML+=`\n <div style="padding: 0rem 2.5rem">\n <div style="display: flex; justify-content: flex-end;">\n <div class="filter-groups-c-folded" >\n <span style="vertical-align: top;">Filtering </span>\n </div>\n <div class="filter-c-btn" >\n <img src="${n.IMAGE_DIR}folded.png" />\n \x3c!--<button class="on">filter</button> --\x3e\n </div>\n </div>\n <div class="filter-groups-c-unfolded" style="display: none; padding-bottom: 1rem">\n <table style="width: 100%;">\n <thead>\n <tr>\n <th style="width: 20%;">\n <span>Type</span>\n </th>\n <th style="width: 20%;">\n <span info-sys-data="functional-type">Density functional</span>\n </th>\n <th style="width: 20%;">\n <span info-sys-data="code-name">Code</span>\n </th>\n <th style="width: 20%;">\n <span info-sys-data="pseudopotential-type">Potential</span>\n </th>\n <th style="width: 20%;">\n <span info-sys-data="basis-set-type">Basis set</span>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr id="filter-items-row"></tr>\n </tbody>\n </table>\n </div>\n </div>\n `,this.unfoldedPanel=this.element.querySelector(".filter-groups-c-unfolded"),this.filterItemsRow=this.element.querySelector("#filter-items-row"),this.foldBtn=this.element.querySelector("img"),this.foldBtn.addEventListener("click",e=>{this.folded=!this.folded,this.foldBtn.src=this.folded?n.IMAGE_DIR+"folded.png":n.IMAGE_DIR+"unfolded.png",this.unfoldedPanel.style.display=this.folded?"none":"block"}),this.element.addEventListener("click",e=>{if("INPUT"===e.target.tagName){let t=this.filtersOn.indexOf(e.target.value);t>=0?this.filtersOn.splice(t,1):this.filtersOn.push(e.target.value),this.itemListener(this.filtersOn)}})}addGroupsItems(e){let t=new Map,s=new Map,i=new Map,n=new Map,a=new Map;e.forEach(e=>{t.has(e.type)||t.set(e.type,h.get(e.type)),s.has(e.functional_type)||s.set(e.functional_type,e.functional_type),i.has(e.code)||i.set(e.code,e.code),n.has(e.core_electron_treatment)||n.set(e.core_electron_treatment,e.core_electron_treatment),a.has(e.basis_set_type)||a.set(e.basis_set_type,e.basis_set_type)}),this.filterItemsRow.innerHTML="",this.filtersOn=[],this.addGroupItems(t),this.addGroupItems(s),this.addGroupItems(i),this.addGroupItems(n),this.addGroupItems(a)}addGroupItems(e){let t="<td> ";e.forEach((e,s)=>{this.filtersOn.push(s),t+='<input type="checkbox" value="'+s+'" checked><span style="vertical-align: 20%">'+e+"</span> <br> "}),this.filterItemsRow.innerHTML+=t+"</td>"}setItemListener(e){this.itemListener=e}}function p(e){return null==e?"":"("+e+")"}e.exports=class extends i{constructor(){super("Methodology"),this.sortedCalcs=[],this.markedCalc=null,this.element.innerHTML+='\n\n <div>\n <div class="view-box">\n <div class="title">Methodology</div>\n\n <div class="filter-placeholder"></div>\n\n <div class="dataTableWrapper"></div>\n </div>\n </div>\n ',this.dataTableWrapper=this.element.querySelector(".dataTableWrapper"),this.dataTableWrapper.innerHTML+='\n <table id="methodology-data">\n <thead>\n <tr>\n <th style="width: 12%;">\n <span>Calculation ID</span>\n <span class="sorting-button"></span>\n </th>\n <th style="width: 16%;">\n <span>Type</span>\n <span class="sorting-button"></span>\n </th>\n <th style="width: 18%;">\n <span info-sys-data="functional-type">Density functional</span>\n <span class="sorting-button"></span>\n </th>\n <th style="width: 12%;">\n <span info-sys-data="code-name">Code</span>\n <span class="sorting-button"></span>\n </th>\n <th style="width: 16%;">\n <span info-sys-data="pseudopotential-type">Potential</span>\n <span class="sorting-button"></span>\n </th>\n <th style="width: 11%;">\n <span info-sys-data="basis-set-type">Basis set</span>\n <span class="sorting-button"></span>\n </th>\n <th style="width: 4%;">\n <span info-sys-data="basis-set-type">Link</span>\n </th>\n </tr>\n </thead>\n <tbody>\n </tbody>\n </table>\n ',this.tbody=this.dataTableWrapper.querySelector("tbody"),this.moreInfoRow=document.createElement("tr"),this.moreInfoRow.className="moreinfo",this.moreInfoCalcId=null,this.filterComponent=new c("meth-filter-component"),this.element.querySelector(".filter-placeholder").appendChild(this.filterComponent.element),this.filterComponent.setItemListener(e=>{this.sortedCalcs.forEach(t=>{let s=t.dataCalcProps.split(","),i=!0;s.forEach(t=>{e.indexOf(t)<0&&(i=!1)}),t.visible=!!i}),this._render()}),this.sortingButtonWrappers=this.dataTableWrapper.querySelectorAll(".sorting-button"),this.sortingButtons=[];let e=new Map([["calc_id",void 0],["type",void 0],["functional_type",void 0],["code",void 0],["core_electron_treatment",void 0],["basis_set_type",void 0]]).keys();this.sortingButtonWrappers.forEach(t=>{let s=e.next().value,i=new r(s);t.appendChild(i.element),this.sortingButtons.push(i),i.setListener((e,t)=>{this.sortingButtons.forEach(e=>{e!==i&&e.init()}),this._sortRowsCalcDataBy(e,t),this._render()})}),a.addToInfoSystem(this.element)}updateSelection(e){this.sortedCalcs=[],l.getCalculations().forEach(e=>{let t=e.run_type;l.getGroups().has(e.calc_id)&&(t=l.getGroupType(e.calc_id)),this.sortedCalcs.push({calc_id:e.calc_id,type:t,functional_type:e.functional_type,code:e.code_name,core_electron_treatment:e.core_electron_treatment,basis_set_type:e.basis_set_type,dataCalcProps:t+","+e.functional_type+","+e.code_name+","+e.core_electron_treatment+","+e.basis_set_type,visible:!0})}),this.filterComponent.addGroupsItems(this.sortedCalcs),this._sortRowsCalcDataBy(!0,"calc_id"),this._render()}_sortRowsCalcDataBy(e,t){this.sortedCalcs.sort((s,i)=>{let n=e?-1:1;return s[t]<i[t]?n:-n})}updateMarkedLeaf(e){}_render(){let e="";this.sortedCalcs.forEach(t=>{t.visible&&(e+=function(e){let t=l.getCalc(e.calc_id),s=e.type,i=`<a href="${d}/${t.upload_id}/${t.calc_id}" target="blank"><img src="img/download.svg" height="20px" /> </a>`,a=l.getMaterialData().material_id,r=t.calc_id,o=`<a href="https://labdev-nomad.esc.rzg.mpg.de/remotevis/cM/start/${a}+${r}" target="blank"><img src="img/monitor_icon.png" height="20px" /> </a>`;return`\n <tr data-calc-id="${t.calc_id}" class="data-row">\n <td>${n.getShortCode(t.calc_id)}</td>\n <td>\n <span info-sys-data="calculation-type.value:${s}">\n ${s}</span>\n </td>\n <td>\n <span info-sys-data="functional-type.value:${e.functional_type}">\n ${e.functional_type}</span>\n ${p(t.functional_long_name)}\n </td>\n <td>\n <span info-sys-data="code-name.value:${t.code_name}">\n ${t.code_name}</span>\n ${p(t.code_version)}\n </td>\n\n <td>\n <span info-sys-data="core-electron-treatment.value:${e.core_electron_treatment}">\n ${e.core_electron_treatment}</span>\n </td>\n <td>\n <span info-sys-data="basis-set-type.value:${t.basis_set_type}">\n ${t.basis_set_type}</span>\n ${p(t.basis_set_quality_quantifier)}\n </td>\n\n <td style="padding-top: 8px;padding-bottom: 4px;">${i}\n </td>\n\n \x3c!--\n <td style="padding-top: 8px;padding-bottom: 4px;">${o}\n </td>--\x3e\n\n </tr>`}(t))}),this.tbody.innerHTML=e,a.addToInfoSystem(this.tbody)}}},function(e,t,s){s(0);e.exports=class{constructor(e){this.id=e,this.ascending=!0,this.element=document.createElement("span"),this.element.innerHTML+='\n <img src="img/sorting_init.png" width="12px"\n style="margin-bottom: -1px; cursor: pointer"/>\n ',this.image=this.element.querySelector("img"),"id"===e&&this.image.setAttribute("src","img/sorting_ascending.png"),this.element.addEventListener("click",e=>{this.ascending=!this.ascending,this.image.setAttribute("src","img/sorting_"+(this.ascending?"ascending":"descending")+".png"),this.listener(this.ascending,this.id)})}init(){this.image.setAttribute("src","img/sorting_init.png")}setListener(e){this.listener=e}}},function(e,t,s){"use strict";let i=s(6),n=s(0),a=s(7),l=s(3),r=s(2),o=s(4),d=s(12),h=s(30),c=s(31);e.exports=class extends i{constructor(){super("Thermal Properties"),this.firstId,this.lastId,this.navTree=new a,this.element.innerHTML+='\n <div style="float: left; width: 30%;">\n <div class="view-box">\n <div class="title">Calculations </div>\n <div class="navTreeWrapper"></div>\n </div>\n </div>\n\n <div style="float: right; width: 70%;">\n <div class="view-box thermal-properties-box">\n\n <div class="title">Vibrational and thermal properties</div>\n\n <div style="padding-top: 10px;">\n <div class="tree-leaf-title"></div>\n </div>\n\n <div class="calc-disp-dos-plotter" style="padding: 30px 100px; ">\n <div class="info-fields-label" style="float: left; width: 52%; ">\n <span info-sys-data="phonon-dispersion">Phonon dispersion </span>\n </div>\n <div class="info-fields-label" style="float: left;">\n <span info-sys-data="phonon-DOS">Phonon DOS </span>\n </div>\n <div style="clear: both;"></div>\n </div>\n\n\n <div class="band" >\n <div style="padding: 30px 50px; display: flex; justify-content: space-around; ">\n\n <div >\n <div class="info-fields-label" >\n <span info-sys-data="specific-heat-cv">Specific heat</span>\n </div>\n <div class="heat-plotter" > </div>\n </div>\n\n <div>\n <div class="info-fields-label" >\n <span info-sys-data="helmholtz-free-energy">Helmholtz free energy</span>\n </div>\n <div class="helmholtz-plotter" > </div>\n </div>\n\n </div>\n </div>\n\n </div>\n </div>\n ',this.navTreeWrapper=this.element.getElementsByClassName("navTreeWrapper")[0],this.rightBox=this.element.querySelector(".thermal-properties-box"),this.leafTitle=this.element.querySelector(".tree-leaf-title"),this.dispDosPlotter=new c,this.heatPlotter=new d,this.helmholtzPlotter=new h,l.addToInfoSystem(this.element)}_events(){super._events()}setMaterialData(){let e=r.getMaterialData();super.setMaterialData(e);let t=null===e.material_name?e.formula:e.material_name;this.navTree.build(t,"thermal"),this.navTree.selectAll(),this.navTree.setHeight(600),this.navTree.setMarkedLeafIfNoneMarked(null),this.attachNavTree(this.navTree),this.updateSelection(this.navTree.getTreeSelectedCalcs()),this.updateMarkedLeaf(this.navTree.getMarkedLeaf()),this.navTree.setTreeSelectionListener(e=>{this.updateSelection(e)}),this.navTree.setLeafMarkedListener(e=>{this.updateMarkedLeaf(e)})}updateSelection(e){}updateMarkedLeaf(e){if(null===e)return this.leafTitle.innerHTML="NO SELECTION",this.dispDosPlotter.setNoData(),this.heatPlotter.setNoData(),void this.helmholtzPlotter.setNoData();this.leafTitle.innerHTML=n.getShortCode(e);let t=r.getCalc(e);this.dispDosPlotter.isAttached()||(this.dispDosPlotter.attach(this.element.querySelector(".calc-disp-dos-plotter"),void 0,360),this.heatPlotter.attach(this.element.querySelector(".heat-plotter"),317,317),this.helmholtzPlotter.attach(this.element.querySelector(".helmholtz-plotter"),317,317)),o.show("thermal_properties");let s=r.getMaterialData().material_id,i=n.getMaterialCalcURL(s,t.calc_id),a=JSON.stringify({properties:["phonon_band_structure","phonon_dos","thermodynamical_properties"]});n.serverReqPOST(i,a,e=>{let t=JSON.parse(e.target.response),s=t.phonon_dos,i=t.phonon_band_structure,n=t.thermodynamical_properties;if(void 0!==s?this.dispDosPlotter.setUpAndData(i,s):this.dispDosPlotter.setNoData(),void 0!==n){let e=n.thermodynamical_property_temperature;this.heatPlotter.setData(e,n.specific_heat_capacity),this.helmholtzPlotter.setData(e,n.specific_vibrational_free_energy_at_constant_volume)}else this.heatPlotter.setNoData(),this.helmholtzPlotter.setNoData();document.getElementById("thermal-props-ov").style.visibility="visible",o.hide("thermal_properties")})}setPrevCalcListener(e){this.prevCalcListener=e}setNextCalcListener(e){this.nextCalcListener=e}}},function(e,t,s){"use strict";let i=s(1),n=s(5);e.exports=class extends n{constructor(){super({left:60,right:16,top:10,bottom:32}),this.tooltip}setData(e,t){this.clear();let s=e.indexOf(600)+1,n=[],a=[];for(let s=0;s<e.length;++s){let i=e[s],l=t[s];null!==i&null!==l&&(n.push(i),a.push(l))}let l=n.slice(0,s),r=a.slice(0,s),o=Math.max.apply(null,r),d=Math.min.apply(null,r),h=1e3*Math.ceil(o/1e3),c=1e3*Math.floor(d/1e3);this.setRangeAndLabels("T (K)",0,600,"F (J/kg)",c,h),this.drawAxis(4,null,0);let p="";l.forEach((e,t)=>{let s=r[t];p+=" "+this.xRel*e+" -"+this.yRel*(s-this.yMin)}),i.addPolyline(this.plotArea,p,"plotSpin1")}}},function(e,t,s){let i=s(8),n=s(9),a=s(1),l=s(0);class r extends n{constructor(){super({left:4,right:16,top:0,bottom:30}),this.outOfRangeColorActivated=!1}attach(e,t,s){super.attach(e,s/2+this.margins.left,s)}setPoints(e){this.pointsSpin1=[],this.pointsSpin2=[],this._reset();let t=e.dos_values[0],s=null;2===e.dos_values.length&&(s=e.dos_values[1]);let i=e.dos_energies,n=[],r=[];for(var o=0;o<i.length;o++){let e,a=5034117012222e10*i[o],l=.029979*t[o];null!==s&&(e=.029979246*s[o]),n.push(l),null!==s&&n.push(e),r.push(a),this.pointsSpin1.push({x:l,y:a}),null!==s&&this.pointsSpin2.push({x:e,y:a})}let d=Math.max.apply(null,n),h=Math.max.apply(null,r),c=Math.min.apply(null,r),p=l.generateDiagramSteps(d),u=p[0],m=p[1];this.setAxisRangeAndLabels(null,0,u[u.length-1],null,-50,320,c,h,100),a.addText(this.axisGroup,this.plotRangeX/2,this.margins.bottom,"DOS (states/cm⁻¹)","middle","axis-steps-big");for(let e=0;e<u.length;e++){let t=this.plotRangeX*u[e]/u[u.length-1];a.addLine(this.axisGroup,t,0,t,3,1),a.addText(this.axisGroup,t,13,0===e?"0":u[e].toFixed(m),"middle","axis-steps-smaller")}this.repaint()}repaintData(){let e="";for(var t=0;t<this.pointsSpin1.length;t++)e+=" "+this.xRel*this.pointsSpin1[t].x+" "+this.transformY(this.pointsSpin1[t].y);a.addPolyline(this.plotContent,e,"plotSpin1"),e="";for(t=0;t<this.pointsSpin2.length;t++)e+=" "+this.xRel*this.pointsSpin2[t].x+" "+this.transformY(this.pointsSpin2[t].y);a.addPolyline(this.plotContent,e,"plotSpin2")}}e.exports=class{constructor(){this.element=document.createElement("div"),this.parentElement=null,this.dispPlotter=new i,this.dispPlotter.setPhononMode(),this.dosPlotter=new r}attach(e,t,s){e.appendChild(this.element),this.dispPlotter.attach(this.element,s,s),this.dosPlotter.attach(this.element,void 0,s),this.parentElement=e}isAttached(){return null!==this.parentElement}setUpAndData(e,t){this.hasDispData=null!=e,this.hasDosData=null!=t,this.hasDispData?(this.dispPlotter.setBandStructureData(e),this.hasDosData&&this.dispPlotter.setRepaintListener((e,t)=>{this.dosPlotter.setYZoomAndOffset(e,t),this.dosPlotter.repaint()})):this.dispPlotter.setNoData(),this.hasDosData?(this.dosPlotter.setPoints(t),this.hasDispData&&this.dosPlotter.setRepaintListener((e,t)=>{this.dispPlotter.setYZoomAndOffset(e,t),this.dispPlotter.repaint()})):this.dosPlotter.setNoData()}setNoData(){this.dispPlotter.setNoData(),this.dosPlotter.setNoData()}}},function(e,t,s){"use strict";let i=s(6),n=(s(0),s(3));e.exports=class extends i{constructor(){super("Elastic constants"),this.sortedLeafs=[],this.markedCalc=null,this.element.innerHTML+='\n\n <div style="float: left; width: 27%;">\n <div class="view-box">\n <div class="title">Calculation </div>\n <div class="navTreeWrapper"></div>\n </div>\n </div>\n\n <div style="float: right; width: 73%;">\n <div class="view-box">\n <div class="title">Elastic constants</div>\n\n <div>Parameters</div>\n <div ></div>\n\n\n </div>\n </div>\n\n <div style="clear: both;"></div>\n ',this.navTreeWrapper=this.element.querySelector(".navTreeWrapper"),n.addToInfoSystem(this.element),this._events()}_events(){}updateSelection(e){console.log("ElasticDetails updateSelection ",e)}updateMarkedLeaf(e){}}},function(e,t,s){"use strict";let i=s(0),n=s(15),a=s(34),l=s(35),r=s(36);function o(e){return e.split("-").join("_")}class d{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","formula-box"),this.element.innerHTML='\n <div style="padding-bottom: 40px;">\n <input type="text" class="formula-text-field"\n placeholder="Add formula to the search query above" >\n <button class="adding-formula-btn" disabled>Add to query</button>\n </div>\n <div>\n <input type="text" class="material-name-text-field"\n placeholder="Add material name to the search query above" >\n <button class="adding-material-name-btn" disabled>Add to query</button>\n </div>\n ',this.formulaTextField=this.element.querySelector(".formula-text-field"),this.formulaButton=this.element.querySelector(".adding-formula-btn"),this.materialTextField=this.element.querySelector(".material-name-text-field"),this.materialButton=this.element.querySelector(".adding-material-name-btn"),this.formulaButton.addEventListener("click",e=>{this.addFormulaListener(this.formulaTextField.value),this.formulaTextField.value=""}),this.materialButton.addEventListener("click",e=>{this.addMaterialListener(this.materialTextField.value),this.materialTextField.value=""}),this.formulaTextField.addEventListener("input",e=>{this.formulaButton.disabled=""===this.formulaTextField.value}),this.materialTextField.addEventListener("input",e=>{this.materialButton.disabled=""===this.materialTextField.value})}setAddFormulaListener(e){this.addFormulaListener=e}setAddMaterialListener(e){this.addMaterialListener=e}disable(e){this.formulaTextField.disabled=e,this.formulaButton.disabled=!0,this.materialTextField.disabled=e,this.materialButton.disabled=!0}}e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","search-module"),this.element.innerHTML='\n <div class="search-page">\n\n <div class="searchline" style="visibility: hidden">\n <div class="search-query-wrapper" style="float: left;">\n <div class="search-query-box" style="float: left;">\n </div>\n <button class="clean-btn" style="float: right;">Clear all</button>\n </div>\n\n <button style="float: right" class="search-btn" >Search</button>\n <div style="clear: both;"></div>\n <div class="exclusive-search-line">\n Exclusive search <input class="exclusive-search" type="checkbox" >\n </div>\n </div>\n\n\n <div class="add-buttons" >\n <div class="tab-buttons" style="width: 70%; display: inline-block">\n <button class="element-add-btn" id="add-tab-selected">Element</button>\n <button class="formula-add-btn" style="padding: 10px 20px;" >Formula/Material</button>\n <button class="props-add-btn" >Properties</button>\n </div>\n <div class="bool-buttons" style="width: 28%; display: inline-block" >\n <button disabled >AND</button>\n <button disabled >OR</button>\n <button disabled >NOT</button>\n <button disabled >(</button> <button disabled >)</button>\n \x3c!--<input type="checkbox" name="and-or" class="not-symbol-btn" />NOT--\x3e\n </div>\n </div>\n\n\n <div>\n <div class="triangle element-tri" style="margin: -10px 64px; visibility: visible"></div>\n <div class="triangle formula-tri" style="margin: -10px 30px; visibility: hidden"></div>\n <div class="triangle props-tri" style="margin: -10px 70px; visibility: hidden"></div>\n </div>\n\n\n <div class="add-panel">\n </div>\n\n </div> \x3c!-- search-page --\x3e\n\n\n <div class="results-page" style="display: none">\n </div>\n\n ',this.searchPage=this.element.querySelector(".search-page"),this.searchQueryBox=this.element.getElementsByClassName("search-query-box")[0],this.searchLine=this.element.querySelector(".searchline"),this.mainButton=this.element.querySelector(".search-btn"),this.cleanButton=this.element.querySelector(".clean-btn"),this.addButtonsBox=this.element.querySelector(".add-buttons"),this.addElementButton=this.addButtonsBox.querySelector(".element-add-btn"),this.addFormulaButton=this.addButtonsBox.querySelector(".formula-add-btn"),this.addPanel=this.element.querySelector(".add-panel"),this.elementTable=new a,this.elementTable.setClickListener(e=>{this.addElementsInSearchQuery(e),this.addFormulaButton.disabled=!0}),this.elementTable.setDeselectListener(e=>this.removeElementORFormulaInSearchQuery(e)),this.propertiesBox=new r,this.propertiesBox.setAddPropertiesListener(e=>{this.addPropertiesInSearchQuery(e)}),this.formulaBox=new d,this.formulaBox.setAddFormulaListener(e=>{""!==e.trim()&&(this.addTagInSearchQuery(e,"F"),this.addElementButton.disabled=!0,this.formulaBox.disable(!0))}),this.formulaBox.setAddMaterialListener(e=>{""!==e.trim()&&(this.addTagInSearchQuery(e,"material-name"),this.addElementButton.disabled=!0,this.formulaBox.disable(!0))}),this.materialList=new l,this.resultsPage=this.element.querySelector(".results-page"),this.materialList.attachAndSetEvents(this.resultsPage),this.currentTab="element",this.addPanel.appendChild(this.elementTable.element),this.userGuidance=!0,this.showingSearchBox=!1,this.searchQuery=[],this.queryTypes=[],this._events()}_events(){this.mainButton.addEventListener("click",e=>{if(0===this.searchQuery.lenght)i.showUserMsg("No query");else{let e={},t=[];e.search_by={},this.searchQuery.forEach((s,i)=>{"F"===this.queryTypes[i]?e.search_by.formula=s:"E"===this.queryTypes[i]?t.push(s):"S"!==this.queryTypes[i]&&(0===this.queryTypes[i].indexOf("has")?e[o(this.queryTypes[i])]=!0:e[o(this.queryTypes[i])]=s.split(" | "))}),t.length>0&&(e.search_by.element=t.join(","));let s=this.element.querySelector(".exclusive-search:checked");e.search_by.exclusive=null===s?"0":"1",this.materialList.setSearch(e),i.setBrowserHashPath("search","results")}}),this.cleanButton.addEventListener("click",e=>{this.searchQuery=[],this.queryTypes=[],this.updateSearchQuery(),this.addFormulaButton.disabled=!1,this.addElementButton.disabled=!1,this.formulaBox.disable(!1),this.elementTable.deselectAllElements()}),this.addButtonsBox.addEventListener("click",e=>{if(e.target!==e.currentTarget){let t=e.target.className,s=t.indexOf("add-btn");if(s>0){let i,a=t.substring(0,s-1);"element"===a?i=this.elementTable.element:"props"===a?i=this.propertiesBox.element:"formula"===a&&(i=this.formulaBox.element),this.addPanel.replaceChild(i,this.addPanel.lastChild);let l=this.element.querySelector("."+this.currentTab+"-add-btn");this._setTabSelectedStyles(l,!1),this._setTabSelectedStyles(e.target,!0),this.element.querySelector("."+this.currentTab+"-tri").style.visibility="hidden",this.element.querySelector("."+a+"-tri").style.visibility="visible",this.currentTab=a,this.userGuidance&&("element"===a?(n.showIndependentTip(7,!1),n.showIndependentTip(3,!0)):"props"===a?(n.showIndependentTip(3,!1),n.showIndependentTip(7,!0)):"formula"===a&&(n.showIndependentTip(3,!1),n.showIndependentTip(7,!1)))}}}),this.searchQueryBox.addEventListener("click",e=>{if("remove-label"===e.target.className){let t=e.target.parentElement.getAttribute("data-el");this.removeElementORFormulaInSearchQuery(t)}})}_setTabSelectedStyles(e,t){e.id=t?"add-tab-selected":""}_showSearchBox(){this.showingSearchBox||(this.showingSearchBox=!0,this.searchLine.style.visibility="visible",this.userGuidance&&n.setFinal())}_addItemInSearchQuery(e,t){this.searchQuery.push(e),this.queryTypes.push(t)}addTagInSearchQuery(e,t){"E"===t&&this.searchQuery.indexOf(e)>=0||(this.searchQuery.length>0&&this._addItemInSearchQuery("&","S"),this._addItemInSearchQuery(e,t),this.updateSearchQuery(),this._showSearchBox())}addElementsInSearchQuery(e){let t=e.length;for(;t--;)this.addTagInSearchQuery(e[t],"E");return!0}addPropertiesInSearchQuery(e){e.forEach((e,t)=>{let s=this.queryTypes.indexOf(t);if(s<0)this.addTagInSearchQuery(e.join(" | "),t);else{let t=this.searchQuery[s].split(" | ");e.forEach(e=>{t.indexOf(e)<0&&t.push(e)}),this.searchQuery[s]=t.join(" | "),this.updateSearchQuery(),this._showSearchBox()}})}removeElementORFormulaInSearchQuery(e){let t=this.searchQuery.indexOf(e);if(t>=0){if(this.searchQuery.splice(t,1),this.queryTypes.splice(t,1),t>0){let e=this.searchQuery[t-1];"&"!==e&&"|"!==e||(this.searchQuery.splice(t-1,1),this.queryTypes.splice(t-1,1))}"S"===this.queryTypes[0]&&(this.searchQuery.splice(0,1),this.queryTypes.splice(0,1)),this.updateSearchQuery(),i.ELEMENTS.indexOf(e)>=0?(this.elementTable.deselectElement(e),this.queryTypes.indexOf("E")<0&&(this.addFormulaButton.disabled=!1)):(this.addElementButton.disabled=!1,this.formulaBox.disable(!1))}return!0}updateSearchQuery(){let e="";for(let s=0;s<this.searchQuery.length;s++){let n=this.queryTypes[s];e+="S"===n?`<span class="search-query-symbol" > ${this.searchQuery[s]} </span>`:`<span class="search-label" data-el="${t=this.searchQuery[s]}" >\n <img src="img/tag.svg" height="16px" class="remove-label"\n style="vertical-align: bottom"/>\n ${"F"===n?i.getSubscriptedFormula(t):t}\n <img src="img/cross.svg" height="6px" class="remove-label"\n style="vertical-align: middle; padding: 4px 3px 6px 5px;" />\n </span>`}var t;console.log("this.updateSearchQuery: ",this.searchQuery,this.queryTypes),this.searchQueryBox.innerHTML=e}showResultsPage(){this.searchPage.style.display="none",this.resultsPage.style.display="block",this.userGuidance&&n.show(!1)}showSearchPage(){this.searchPage.style.display="block",this.resultsPage.style.display="none",this.userGuidance&&setTimeout(()=>{n.init(this.addButtonsBox,this.elementTable.element,this.searchLine,this.propertiesBox.tabsElement),n.show(!0,"element"===this.currentTab,"props"===this.currentTab)},400)}}},function(e,t,s){"use strict";let i=s(0);const n=new Map([[1,["H","Li","Na","K","Rb","Cs","Fr"]],[2,["Be","Mg","Ca","Sr","Ba","Ra"]],[3,["Sc","Y"]],[4,["Ti","Zr","Hf","Rf"]],[5,["V","Nb","Ta","Ha"]],[6,["Cr","Mo","W","Sg"]],[7,["Mn","Tc","Re","Ns"]],[8,["Fe","Ru","Os","Hs"]],[9,["Co","Rh","Ir","Mt"]],[10,["Ni","Pd","Pt","Ds"]],[11,["Cu","Ag","Au","Rg"]],[12,["Zn","Cd","Hg","Cn"]],[13,["B","Al","Ga","In","Tl","Nh"]],[14,["C","Si","Ge","Sn","Pb","Fl"]],[15,["N","P","As","Sb","Bi","Mc"]],[16,["O","S","Se","Te","Po","Lv"]],[17,["F","Cl","Br","I","At","Ts"]],[18,["He","Ne","Ar","Kr","Xe","Rn","Og"]],[19,["La","Ce","Pr","Nd","Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm","Yb","Lu"]],[20,["Ac","Th","Pa","U","Np","Pu","Am","Cm","Bk","Cf","Es","Fm","Md","No","Lr"]]]),a=new Map([["metalloids",["B","Si","Ge","As","Sb","Te","Po"]],["other-non-metals",["H","C","N","O","P","S","Se"]],["halogens",["F","Cl","Br","I","At","Ts"]],["noble-gases",["He","Ne","Ar","Kr","Xe","Rn","Og"]],["alkali-metals",["Li","Na","K","Rb","Cs","Fr"]],["alkaline-earth-metals",["Be","Mg","Ca","Sr","Ba","Ra"]],["lanthanoids",["La","Ce","Pr","Nd","Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm","Yb","Lu"]],["actinoids",["Ac","Th","Pa","U","Np","Pu","Am","Cm","Bk","Cf","Es","Fm","Md","No","Lr"]],["transition-metals",["Sc","Y","Ti","Zr","Hf","Rf","V","Nb","Ta","Ha","Cr","Mo","W","Sg","Mn","Tc","Re","Ns","Fe","Ru","Os","Hs","Co","Rh","Ir","Mt","Ni","Pd","Pt","Ds","Cu","Ag","Au","Rg","Zn","Cd","Hg","Cn"]],["post-transition-metals",["Al","Ga","In","Tl","Nh","Sn","Pb","Fl","Bi","Mc","Lv"]]]),l=new Map([["metalloids","#F9E298"],["other-non-metals","#F2B01D"],["halogens","#85ADC1"],["noble-gases","#F7D660"],["alkali-metals","#D04629"],["alkaline-earth-metals","#F7B57D"],["transition-metals","#F58737"],["post-transition-metals","#AE4747"],["lanthanoids","#3B91AE"],["actinoids","#E97147"]]);let r=["Hydrogen","Helium","Lithium","Beryllium","Boron","Carbon","Nitrogen","Oxygen","Fluorine","Neon","Sodium","Magnesium","Aluminum","Silicon","Phosphorus","Sulfur","Chlorine","Argon","Potassium","Calcium","Scandium","Titanium","Vanadium","Chromium","Manganese","Iron","Cobalt","Nickel","Copper","Zinc","Gallium","Germanium","Arsenic","Selenium","Bromine","Krypton","Rubidium","Strontium","Yttrium","Zirconium","Niobium","Molybdenum","Technetium","Ruthenium","Rhodium","Palladium","Silver","Cadmium","Indium","Tin","Antimony","Tellurium","Iodine","Xenon","Cesium","Barium","Lanthanum","Cerium","Praseodymium","Neodymium","Promethium","Samarium","Europium","Gadolinium","Terbium","Dysprosium","Holmium","Erbium","Thulium","Ytterbium","Lutetium","Hafnium","Tantalum","Tungsten","Rhenium","Osmium","Iridium","Platinum","Gold","Mercury","Thallium","Lead","Bismuth","Polonium","Astatine","Radon","Francium","Radium","Actinium","Thorium","Protactinium","Uranium","Neptunium","Plutonium","Americium","Curium","Berkelium","Californium","Einsteinium","Fermium","Mendelevium","Nobelium","Lawrencium","Rutherfordium","Dubnium","Seaborgium","Bohrium","Hassium","Meitnerium","Darmstadtium","Roentgenium","Copernicium","Nihonium","Flerovium","Moscovium","Livermorium","Tennessine","Oganesson"];function o(e){let t;return a.forEach((function(s,i){s.indexOf(e)>=0&&(t=i)})),t}function d(e){let t=i.ELEMENTS[e-1];return'<td class="cell '+o(t)+'" data-el="el-'+t+'"><b>'+t+"</b> <div>"+e+"</div> </td>"}function h(e){let t=null,s=null;if(e.target.className.indexOf("cell ")>=0?(t=e.target,s=e.target.className):e.target.parentElement.className.indexOf("cell ")>=0&&(t=e.target.parentElement,s=e.target.parentElement.className),null===t)return null;{let e=t.innerHTML,s=e.substring(3,e.indexOf("<",3));return" "===s?null:s}}e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","elementable");let e='<div class="element-info"></div>';e+='<div class="ptWrapper">',e+='<table id="pt-main">',e+="<tbody>",e+="<tr>"+d(1),e+='<td class="cellpad" colspan="16"></td>',e+=d(2)+"</tr>";let t=t=>{e+="<tr>"+d(t)+d(t+1),e+='<td class="cellpad" colspan="10"></td>';for(let s=t+2;s<t+8;s++)e+=d(s);e+="</tr>"};t(3),t(11);let s=19;for(let t=0;t<4;t++){e+="<tr>";for(let t=0;t<18;t++)57===s||89===s?(e+=(n=s,'<td class="cellpad '+o(i.ELEMENTS[n-1])+'" data-el="el-X"><b> </b> <div> </div> </td>'),s+=15):(e+=d(s),s++);e+="</tr>"}var n;e+="</tbody></table>",e+='<div id="specialRows"><table id="pt-laac">';for(let t=0;t<2;t++){e+="<tr>",s=0===t?57:89;for(let t=0;t<15;t++)e+=d(s),s++;e+="</tr>"}e+="</table></div>",e+='<div class="legend">\n <div class="alkali-metals">Alkali metals</div>\n <div class="alkaline-earth-metals">Alkaline earth metals</div>\n <div class="transition-metals">Transition metals</div>\n <div class="post-transition-metals">Post-transition metals</div>\n <div class="metalloids">Metalloids</div>\n <div class="other-non-metals">Other nonmetals</div>\n <div class="halogens">Halogens</div>\n <div class="noble-gases">Noble gases</div>\n <div class="lanthanoids">Lanthanoids</div>\n <div class="actinoids">Actinoids</div>\n </div>',e+="</div>",this.element.innerHTML=e,this.elementInfo=this.element.getElementsByClassName("element-info")[0],this.tableZone=this.element.getElementsByClassName("ptWrapper")[0],this._events()}_events(){this.tableZone.addEventListener("click",e=>{if(e.target!==e.currentTarget){let s=e.target.className,i=e.target;if(""===s&&(i=e.target.parentElement,s=e.target.parentElement.className),s.indexOf("cellpad")>=0)return;if(s.indexOf("group-sel")>=0){let e=n.get(parseInt(i.getAttribute("data-group")));this.clickListener(e);for(var t=0;t<e.length;t++)this.selectElement(e[t])}else if(s.indexOf("cell")>=0){let e=i.innerHTML,t=e.substring(3,e.indexOf("<",3));if(" "===t)return;s.indexOf("el-selected")>=0?this.deselectListener(t):(this.clickListener([t]),this.selectElement(t))}}},!0),this.tableZone.addEventListener("mouseover",e=>{let t=h(e);if(null!==t){this.elementInfo.style.display="block";let e=l.get(o(t));this.elementInfo.style.borderColor=e;let s=i.ELEMENTS.indexOf(t)+1;this.elementInfo.innerHTML=`\n <div>\n <div style="float: right; padding: 3px 4px;border-left: 3px solid ${e};\n border-bottom: 3px solid ${e}" > ${s} </div>\n <div style="clear: right;"></div>\n </div>\n <div class="symbol">${t} </div>\n <div class="">${r[s-1]} </div>\n `}}),this.tableZone.addEventListener("mouseout",e=>{null!==h(e)&&(this.elementInfo.style.display="none")})}setClickListener(e){this.clickListener=e}setDeselectListener(e){this.deselectListener=e}selectElement(e){this.element.querySelector('td[data-el="el-'+e+'"]').className="cell el-selected"}deselectElement(e){this.element.querySelector('td[data-el="el-'+e+'"]').className="cell "+o(e)}deselectAllElements(){let e=this.element.querySelectorAll("td.el-selected");for(let t=0;t<e.length;++t){let s=e[t].getAttribute("data-el").substring(3);e[t].className="cell "+o(s)}}}},function(e,t,s){"use strict";let i=s(0),n=s(3),a=s(4);e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","matlist"),this.formula=!1,this.matMap=new Map,this.page=0,this.nPages=0,this.before=null,this.afters=new Map,this.searchJson=null,this.element.innerHTML='\n <div class="title"> Results <span class="n-materials"></span></div>\n <div class="pag-header">\n <span class="prevButton">\n <img src="img/prev.svg" style="display: inline;" width="7px"/> prev\n </span> \n <span class="page"> X </span> \n <span class="nextButton"> next \n <img src="img/next.svg" width="7px" />\n </span>\n </div>\n <div class="data-container"> </div>',this.titleBox=this.element.getElementsByClassName("title")[0],this.nMaterials=this.element.getElementsByClassName("n-materials")[0],this.resultsNrTag=this.element.getElementsByClassName("pag-header")[0],this.prevButton=this.element.getElementsByClassName("prevButton")[0],this.pageElement=this.element.getElementsByClassName("page")[0],this.nextButton=this.element.getElementsByClassName("nextButton")[0],this.resultsContainer=this.element.getElementsByClassName("data-container")[0]}attachAndSetEvents(e){e.appendChild(this.element),this._events()}_events(){this.nextButton.addEventListener("click",e=>{this.page++,this._search()}),this.prevButton.addEventListener("click",e=>{1!==this.page&&(this.page--,this._search())}),this.resultsContainer.addEventListener("click",e=>{if(e.target!==e.currentTarget){let t;"mat-row"===e.target.className?t=e.target:"mat-row"===e.target.parentElement.className?t=e.target.parentElement:"mat-row"===e.target.parentElement.parentElement.className&&(t=e.target.parentElement.parentElement),t&&i.setBrowserHashPath("material",t.getAttribute("data-mat-id")),e.stopPropagation()}})}_printMatMap(){console.log("MATMAP:"),this.matMap.forEach((function(e,t,s){console.log(t+" "+JSON.stringify(e))}))}setSearch(e){this.resultsContainer.style.visibility="hidden",this.searchJson=e,this.page=1,this._search()}_search(){this.searchJson.search_by.page=this.page,this.searchJson.search_by.after=this.afters.get(this.page),this.searchJson.search_by.per_page=10;let e=JSON.stringify(this.searchJson);1===this.page?this.prevButton.style.visibility="hidden":this.prevButton.style.visibility="visible",a.reset(),window.allowNewLoadPopup=!0,a.show(),i.serverReqPOST(i.getSearchURL(),e,e=>{let t=JSON.parse(e.target.response);if(200===e.target.status){this.afters.set(this.page+1,t.pages.after),1===this.page&&(this.nMaterials.innerHTML="(total: "+t.pages.total+")",this.nPages=Math.ceil(t.pages.total/this.searchJson.search_by.per_page)),0===t.results.length||this.page===this.nPages?this.nextButton.style.visibility="hidden":this.nextButton.style.visibility="visible";let e=t.results;0===t.results.length?(this.setData([]),i.searchResults=!1):1===t.results.length?(i.setBrowserHashPath("material",e[0].material_id),i.searchResults=!1):(this.setData(e),i.searchResults=!0)}else this.setData([]),this.nextButton.style.visibility="hidden";this._updateUI(),this.resultsContainer.style.visibility="visible",a.hide()}).addEventListener("error",e=>{console.log("Search ERROR - Not valid query "),this.setData([]),this._updateUI(),this.resultsContainer.style.visibility="visible",a.hide()})}setData(e){this.matMap.clear(),e.forEach(e=>{if(this.matMap.has(e.formula_reduced)){this.matMap.get(e.formula_reduced).push(e)}else{let t=[];t.push(e),this.matMap.set(e.formula_reduced,t)}})}reset(){this.formula=!1,this.matMap.clear(),this.page=0,this.searchJson=null,this._updateUI()}_updateUI(){this.pageElement.innerHTML="page "+this.page+"/"+this.nPages;let e="";0===this.matMap.size?(1===this.page&&(this.resultsNrTag.style.display="none",this.titleBox.style.display="none"),e+='<div class="not-found">No results found</div>'):(this.resultsNrTag.style.display="block",this.titleBox.style.display="block",e+='\n <table>\n <thead> <tr>\n <th style="width: 24%;"></th>\n <th style="width: 20%;">\n <span info-sys-data="system-type">System type</span>\n </th>\n <th style="width: 16%;">\n <span info-sys-data="space-group">Space group</span>\n </th>\n <th style="width: 22%;">\n <span info-sys-data="structure-type">Structure type</span>\n </th>\n <th style="width: 18%;">Nº calculations</th>\n </tr> </thead>\n <tbody>\n ',this.matMap.forEach((t,s)=>{let n=i.getSubscriptedFormula(s);e+='<tr> <td class="formula" colspan="5"><b>'+n+"</b>",t.length>1&&(e+='<span style="font-size: 0.86em;"> ('+t.length+" structures)</span>"),e+="</td></tr>",t.forEach(t=>{let s=void 0!==t.material_name?t.material_name:n;e+=`<tr class="mat-row" data-mat-id="${t.material_id}">\n <td > ${s} </td>\n <td style="text-align:center" >\n \x3c!--<span info-sys-data="system-type">--\x3e${t.system_type} \x3c!--</span>--\x3e\n </td>\n <td style="text-align:center" >\n ${void 0===t.space_group_number?"":t.space_group_number}\n </td>\n <td> ${void 0===t.structure_type?"":t.structure_type} </td>\n <td style="text-align:center" > ${t.n_matches} </td>\n </tr>`})}),e+=" </tbody> </table>"),this.resultsContainer.innerHTML=e,n.addToInfoSystem(this.resultsContainer)}}},function(e,t,s){"use strict";let i=s(0),n=s(3);e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","search-properties-box"),this.element.innerHTML='\n <div class="props-box-tabs-wrapper" style="float: left; width: 25%; ">\n\n <div class="properties-box-tabs" >\n <div data-tab="structure" class="props-tab-selected" >Structure </div>\n <div data-tab="results">Properties </div>\n <div data-tab="method">Method </div>\n \x3c!-- <div class="contributors-tab">Contributors </div> --\x3e\n </div>\n\n </div>\n\n <div class="properties-box-panel" style="float: left;width: 75%;height: 100%">\n\n <div class="props-tab-panel-wrapper" style="height: 86%" >\n\n <div class="structure-panel props-tab-panel" style="display: block">\n\n\n <div style="float: left; width: 47%;">\n\n <div class="field">\n <div class="field-title"><span info-sys-data="space-group">Space group number</span></div>\n <input type="text" class="space-group-number-field">\n </div>\n\n <div class="field">\n <div class="field-title">System type</div>\n <input type="checkbox" class="system-type-field" value="bulk"> Bulk<br>\n <input type="checkbox" class="system-type-field" value="2D"> 2D<br>\n <input type="checkbox" class="system-type-field" value="1D"> 1D<br>\n </div>\n\n \x3c!--\n <div class="field">\n <div class="field-title"><span info-sys-data="mass-density">Mass density</span> <span style="font-weight: normal;">(kg/m<sup>3</sup>)</span></div>\n Min: <input type="text" class="mass-density-min-field"> \n Max: <input type="text" class="mass-density-max-field">\n </div>\n --\x3e\n\n </div>\n\n <div style="float: left; width: 5%;"></div>\n\n <div style="float: right; width: 47%;">\n\n <div class="field">\n <div class="field-title"><span info-sys-data="structure-type">Structure type</span></div>\n <select class="structure-type-field" style="max-width: 174px">\n <option></option>\n </select>\n </div>\n\n <div class="field">\n <div class="field-title"><span info-sys-data="crystal-system">Crystal system</span></div>\n <input type="checkbox" class="crystal-system-field" value="cubic">\n <span info-sys-data="crystal-system.value:cubic">Cubic</span><br>\n <input type="checkbox" class="crystal-system-field" value="hexagonal">\n <span info-sys-data="crystal-system.value:hexagonal">Hexagonal</span><br>\n <input type="checkbox" class="crystal-system-field" value="trigonal">\n <span info-sys-data="crystal-system.value:trigonal">Trigonal</span><br>\n <input type="checkbox" class="crystal-system-field" value="tetragonal">\n <span info-sys-data="crystal-system.value:tetragonal">Tetragonal</span><br>\n <input type="checkbox" class="crystal-system-field" value="orthorhombic">\n <span info-sys-data="crystal-system.value:orthorhombic">Orthorhombic</span><br>\n <input type="checkbox" class="crystal-system-field" value="monoclinic">\n <span info-sys-data="crystal-system.value:monoclinic">Monoclinic</span><br>\n <input type="checkbox" class="crystal-system-field" value="triclinic">\n <span info-sys-data="crystal-system.value:triclinic">Triclinic</span><br>\n </div>\n\n </div>\n <div style="clear: both;"></div>\n </div>\n\n <div class="results-panel props-tab-panel" >\n \x3c!--\n <div style="float: left; width: 47%;">\n <div class="field">\n <div class="field-title"><span info-sys-data="band-gap">Band gap</span> <span style="font-weight: normal;">(eV)</span></div>\n Min: <input type="text" class="band-gap-min-field"> \n Max: <input type="text" class="band-gap-max-field">\n </div>\n </div>\n\n <div style="float: left; width: 5%;"> </div>\n\n <div style="float: right; width: 47%;">\n <div class="field" style="padding-top: 28px;">\n <input type="radio" name="band-gap-type" value="d"> Direct<br>\n <input type="radio" name="band-gap-type" value="i"> Indirect<br>\n <input type="radio" name="band-gap-type" value="d/i" checked> Both<br>\n </div>\n </div>\n --\x3e\n <div style="clear: both;"></div>\n\n <div class="field" style="background-color: #CCC; padding: 10px;">\n <div style="font-weight: bold; padding-bottom: 6px" >Results containing...</div>\n <div style="float: left; width: 47%;">\n <input type="checkbox" class="has-band-structure-field" value="Band structure">\n <span info-sys-data="has-band-structure">Band structure</span><br>\n <input type="checkbox" class="has-dos-field" value="DOS">\n <span info-sys-data="has-dos">DOS</span><br>\n \x3c!--\n <input type="checkbox" class="has-fermi-surface-field" value="Fermi surface">\n <span info-sys-data="has-fermi-surface">Fermi surface</span><br>\n --\x3e\n </div>\n <div style="float: right; width: 47%;">\n <input type="checkbox" class="has-thermal-properties-field" value="Thermal properties">\n <span info-sys-data="has-thermal-properties">Thermal properties</span>\n <br>\n \x3c!-- <input type="checkbox" class="results-containing-field" value="EOS" disabled>Equation of state<br>--\x3e\n </div>\n <div style="clear: both;"></div>\n </div>\n\n </div>\n\n <div class="method-panel props-tab-panel" >\n <div style="float: left; width: 47%;">\n\n <div class="field">\n <div class="field-title"><span info-sys-data="functional-type">Functional type</span></div>\n <input type="checkbox" class="functional-type-field" value="LDA">\n <span info-sys-data="functional-type.value:LDA">LDA</span><br>\n <input type="checkbox" class="functional-type-field" value="GGA">\n <span info-sys-data="functional-type.value:GGA">GGA</span><br>\n <input type="checkbox" class="functional-type-field" value="meta-GGA">\n <span info-sys-data="functional-type.value:meta-GGA">meta-GGA</span><br>\n <input type="checkbox" class="functional-type-field" value="hybrid-GGA">\n <span info-sys-data="functional-type.value:hybrid-GGA">hybrid-GGA</span><br>\n <input type="checkbox" class="functional-type-field" value="hybrid-meta-GGA">\n <span info-sys-data="functional-type.value:hybrid-meta-GGA">hybrid-meta-GGA</span><br>\n <input type="checkbox" class="functional-type-field" value="HF">\n <span info-sys-data="functional-type.value:HF">HF</span><br>\n <input type="checkbox" class="functional-type-field" value="GW">\n <span info-sys-data="functional-type.value:GW">GW</span><br>\n </div>\n\n <div class="field">\n <div class="field-title"><span info-sys-data="code-name">Code name</span></div>\n <select class="code-name-field" >\n <option></option>\n </select>\n \x3c!--\n <input type="checkbox" class="code-name-field" value="VASP">VASP<br>\n <input type="checkbox" class="code-name-field" value="quantum-espresso">Quantum Espresso<br>\n <input type="checkbox" class="code-name-field" value="FHI-aims">FHI-aims<br>\n <input type="checkbox" class="code-name-field" value="exciting">exciting<br>\n --\x3e\n </div>\n\n </div>\n\n <div style="float: left; width: 5%;"> </div>\n\n <div style="float: right; width: 47%;">\n <div class="field">\n <div class="field-title"><span info-sys-data="basis-set-type">Basis set</span></div>\n <input type="checkbox" class="basis-set-type-field" value="(L)APW+lo">\n <span info-sys-data="basis-set-type.value:(L)APW+lo">(L)APW+lo</span><br>\n <input type="checkbox" class="basis-set-type-field" value="FLAPW">\n <span info-sys-data="basis-set-type.value:FLAPW">FLAPW</span><br>\n <input type="checkbox" class="basis-set-type-field" value="gaussians">\n <span info-sys-data="basis-set-type.value:gaussians">gaussians</span><br>\n <input type="checkbox" class="basis-set-type-field" value="numeric AOs">\n <span info-sys-data="basis-set-type.value:numeric AOs">numeric AOs</span><br>\n <input type="checkbox" class="basis-set-type-field" value="plane waves">\n <span info-sys-data="basis-set-type.value:plane waves">plane waves</span><br>\n <input type="checkbox" class="basis-set-type-field" value="psinc functions">\n <span info-sys-data="basis-set-type.value:psinc functions">psinc functions</span><br>\n <input type="checkbox" class="basis-set-type-field" value="real-space grid">\n <span info-sys-data="basis-set-type.value:real-space grid">real-space grid</span><br>\n </div>\n </div>\n\n <div style="clear: both;"></div>\n </div>\n\n </div>\n\n\n <div class="properties-box-enter-button" style="height: 14%">\n <button disabled>Add to query</button>\n </div>\n\n </div>\n\n <div style="clear: both;"></div>\n ',this.tabsElement=this.element.querySelector(".properties-box-tabs"),this.tabSelected=this.element.querySelector('[data-tab="structure"]'),this.tabPanelSelected=this.element.querySelector(".structure-panel"),this.addButton=this.element.querySelector(".properties-box-enter-button button");let e=this.element.querySelector(".code-name-field"),t=i.serverReq(i.getSuggestionURL("code_name"),()=>{JSON.parse(t.response).code_name.forEach(t=>{e.innerHTML+="<option>"+t+"</option>"})}),s=this.element.querySelector(".structure-type-field"),a=i.serverReq(i.getSuggestionURL("structure_type"),()=>{JSON.parse(a.response).structure_type.forEach(e=>{s.innerHTML+="<option>"+e+"</option>"})});n.addToInfoSystem(this.element),this._events()}_events(){this.tabsElement.addEventListener("click",e=>{if(e.target!==e.currentTarget){null!==this.tabSelected&&(this.tabSelected.className=""),this.tabSelected=e.target,this.tabSelected.className="props-tab-selected";let t=e.target.getAttribute("data-tab");null!==this.tabPanelSelected&&(this.tabPanelSelected.style.display="none"),this.tabPanelSelected=this.element.getElementsByClassName(t+"-panel")[0],this.tabPanelSelected.style.display="block",this.checkPropsValues()}}),this.addButton.addEventListener("click",e=>{let t=this.getPropsWithValueFromCurrentTab(!0);this.addPropertiesListener(t),this.addButton.disabled=!0});let e=this.element.querySelector(".properties-box-panel");e.addEventListener("input",e=>{this.checkPropsValues()}),e.addEventListener("change",e=>{this.checkPropsValues()})}checkPropsValues(){let e=this.getPropsWithValueFromCurrentTab(!1);this.addButton.disabled=0===e.size}getPropsWithValueFromCurrentTab(e){let t=this.tabSelected.getAttribute("data-tab"),s=new Map;return"structure"===t?(this.addPropsFromTextFields(s,["space-group-number"],e),this.addPropsFromDropdownList(s,["structure-type"],e),this.addPropsFromCheckboxes(s,["system-type","crystal-system"],e)):"results"===t?this.addPropsFromCheckboxes(s,["has-band-structure","has-dos","has-fermi-surface","has-thermal-properties"],e):"method"===t&&(this.addPropsFromCheckboxes(s,["functional-type","basis-set-type"],e),this.addPropsFromDropdownList(s,["code-name"],e)),s}addPropsFromTextFields(e,t,s){t.forEach(t=>{let i=this.element.querySelector("."+t+"-field");""!==i.value&&(e.set(t,[i.value]),s&&(i.value=""))})}addPropsFromCheckboxes(e,t,s){t.forEach(t=>{let i=this.element.querySelectorAll("."+t+"-field"),n=[];for(var a=0;a<i.length;a++)i[a].checked&&(n.push(i[a].value),s&&(i[a].checked=!1));n.length>0&&e.set(t,n)})}addPropsFromDropdownList(e,t,s){t.forEach(t=>{let i=this.element.querySelector("."+t+"-field"),n=i.options[i.selectedIndex].value;n.length>2&&e.set(t,[n]),s&&(i.selectedIndex=0)})}addBandgapProps(e,t){let s=document.querySelector(".band-gap-min-field"),i=document.querySelector(".band-gap-max-field"),n="band-gap",a="Band Gap";if(""!==s.value&&(a=s.value+" < "+a,n+=":"+s.value,t&&(s.value="")),""!==i.value&&(a+=" < "+i.value,n+=":"+i.value,t&&(i.value="")),"Band Gap"!==a){let t=document.querySelector('input[name="band-gap-type"]:checked').value;"d"===t?n+=":True":"i"===t&&(n+=":False"),e.set(n,[a+" "+t])}}addMassDensityProps(e,t){let s=document.querySelector(".mass-density-min-field"),i=document.querySelector(".mass-density-max-field"),n="mass-density",a="Mass Density";""!==s.value&&(a=s.value+" < "+a,n+=":"+s.value,t&&(s.value="")),""!==i.value&&(a+=" < "+i.value,n+=":"+i.value,t&&(i.value="")),"Mass Density"!==a&&e.set(n,[a])}setAddPropertiesListener(e){this.addPropertiesListener=e}}}]); \ No newline at end of file +!function(e){var t={};function s(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,s),n.l=!0,n.exports}s.m=e,s.c=t,s.d=function(e,t,i){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)s.d(i,n,function(t){return e[t]}.bind(null,n));return i},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=16)}([function(e,t,s){"use strict";const i=window.nomadEnv.apiRoot;function n(e){let t="";for(let s=0;s<e.length;s++)e.charCodeAt(s)>=47&&e.charCodeAt(s)<58?t+="<sub>"+e[s]+"</sub>":t+=e[s];return t}function a(e){let t=e.substring(1,e.length-1).split(","),s=[];for(var i=0;i<t.length;i++)s.push(parseFloat(t[i]));return s}function l(e){return(e*(180/Math.PI)).toFixed(0)+"°"}e.exports={searchResults:!1,materialId:null,MAT_VIEW:{structure:"structure",electronicstruct:"electronicstruct",methodology:"methodology",thermalprops:"thermalprops",elasticconst:"elasticconst"},IMAGE_DIR:"img/",ELEMENTS:["H","He","Li","Be","B","C","N","O","F","Ne","Na","Mg","Al","Si","P","S","Cl","Ar","K","Ca","Sc","Ti","V","Cr","Mn","Fe","Co","Ni","Cu","Zn","Ga","Ge","As","Se","Br","Kr","Rb","Sr","Y","Zr","Nb","Mo","Tc","Ru","Rh","Pd","Ag","Cd","In","Sn","Sb","Te","I","Xe","Cs","Ba","La","Ce","Pr","Nd","Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm","Yb","Lu","Hf","Ta","W","Re","Os","Ir","Pt","Au","Hg","Tl","Pb","Bi","Po","At","Rn","Fr","Ra","Ac","Th","Pa","U","Np","Pu","Am","Cm","Bk","Cf","Es","Fm","Md","No","Lr","Rf","Ha","Sg","Ns","Hs","Mt","Ds","Rg","Cn","Nh","Fl","Mc","Lv","Ts","Og"],getUserData:function(){return null},getServerLocation:function(){return document.location.hostname},authServerReq:function(e,t){var s=new XMLHttpRequest;return s.addEventListener("load",t),console.log("util.authServerReq: ",i+e),s.open("GET",i+e),s.send(),s},serverReq:function(e,t){var s=new XMLHttpRequest;s.addEventListener("load",t),s.open("GET",e);var i=window.keycloak;return i.authenticated&&s.setRequestHeader("Authorization","Bearer "+i.token),s.send(),s},convert2d:function(e,t){let s=[];for(var i=0;i<e.length;i++){let a=e[i],l=[];for(var n=0;n<a.length;n++)l.push(a[n]*t);s.push(l)}return s},serverReqPOST:function(e,t,s){var i=new XMLHttpRequest;i.addEventListener("load",s),i.open("POST",e),i.setRequestHeader("Content-Type","application/json");var n=window.keycloak;return n.authenticated&&i.setRequestHeader("Authorization","Bearer "+n.token),i.send(t),i},getShortCode:function(e){if((e.startsWith("eos/")||e.startsWith("par/"))&&32==e.length)return e.substring(0,12);if(28==e.length)return e.substring(0,8);throw"The given identifier could not be shortened as it does not have the right initial length."},getSearchURL:function(){return i+"materials"},getSuggestionURL:function(e){return i+"suggestions?property="+e},getMaterialURL:function(e){return i+"materials/"+e},getMaterialCalcURL:function(e,t,s=""){return i+"materials/"+e+"/calculations/"+t+(""===s?"":"?property="+s)},getMaterialGroupURL:function(e,t,s){return i+"materials/"+e+"/groups/"+t+"/"+s},getMaterialStatsURL:function(e){return i+"materials/"+e+"/statistics"},getMaterialXsURL:function(e,t){return i+"materials/"+t+"/"+e},getCalcEnergiesURL:function(e,t){return i+"materials/"+e+"/calculations/"+t+"/energies"},getReportURL:function(e){return i+"materials/"+e+"/reports"},setBrowserHashPath:function(e,t){document.location=void 0===t?"#/"+e:"#/"+e+"/"+t},loadLib:function(e){let t=document.createElement("script");t.setAttribute("type","text/javascript"),t.setAttribute("src",e),document.getElementsByTagName("head")[0].appendChild(t)},getNumberArray:a,J2eV:function(e,t){let s=e/1602176565e-28;return void 0===t?s<.01?s.toFixed(6):s.toFixed(3):s.toFixed(t)},eV2J:function(e){return 1602176565e-28*e},m2Angstrom:function(e){return(e/1e-10).toFixed(3)+" Å"},getLatticeAnglesValues:function(e,t,s){let i=[0,0,0];return e.forEach(e=>{if(void 0!==e.lattice_parameters&&null!==e.lattice_parameters){let t=a(e.lattice_parameters);i[0]+=t[3],i[1]+=t[4],i[2]+=t[5]}}),s?`<div>α = ${l(i[0]/e.size)}</div>\n <div>β = ${l(i[1]/e.size)}</div>\n <div>γ = ${l(i[2]/e.size)}</div>`:t?`<div>α = ${l(i[0]/e.size)}</div>`:""},rad2degree:l,m3ToAngstrom3:function(e){return(e/1e-30).toFixed(3)+" Å<sup>3</sup>"},toAngstromMinus3:function(e){return(1e-30*e).toFixed(3)+" Å<sup>-3</sup>"},getMaterialTitle:function(e,t){let s;return s=n(e.formula_reduced),void 0!==t&&!1===t&&(s=e.formula_reduced),null!==e.space_group_number&&void 0!==e.space_group_number&&(s+=" - space group "+e.space_group_number),s},getMinMaxHTML:function(e,t){let s=[];return e.forEach(e=>{s.push(e[t])}),"("+Math.min.apply(null,s)+" ... "+Math.max.apply(null,s)+")"},getSubscriptedFormula:n,getAverage:function(e){let t=0;for(var s=0;s<e.length;s++)t+=e[s];return t/e.length},generateDiagramSteps:function(e,t=4){let s=-Math.floor(Math.log(e/t)*Math.LOG10E),i=Math.pow(10,s),n=Math.ceil(e*i/t),a=[];for(var l=0;l<=t;l++)a[l]=n*l/i;return s=s<0?0:s,[a,s]},getCalcMapByFunctional:function(e){let t=new Map;return e.forEach(e=>{if(t.has(e.functional_type))t.get(e.functional_type).add(e.calc_id);else{let s=new Set;s.add(e.calc_id),t.set(e.functional_type,s)}}),t},getDefault:function(e,t="unavailable"){return null==e?t:e}}},function(e,t,s){"use strict";const i="http://www.w3.org/2000/svg";e.exports={addPoint:function(e,t,s,n,a){let l=document.createElementNS(i,"circle");return l.setAttribute("r",n),l.setAttribute("cx",t),l.setAttribute("cy",s),void 0!==a&&l.setAttribute("class",a),e.appendChild(l),l},addCircle:function(e,t,s,n,a,l,r){let o=document.createElementNS(i,"circle");return o.setAttribute("r",n),o.setAttribute("cx",t),o.setAttribute("cy",s),o.setAttribute("fill",a),o.setAttribute("stroke",l),o.setAttribute("stroke-width",r),e.appendChild(o),o},addLine:function(e,t,s,n,a,l){let r=document.createElementNS(i,"line");return r.setAttribute("x1",t),r.setAttribute("y1",s),r.setAttribute("x2",n),r.setAttribute("y2",a),void 0!==l&&r.setAttribute("class",l),e.appendChild(r),r},addRect:function(e,t,s,n,a,l){let r=document.createElementNS(i,"rect");return r.setAttribute("x",t),r.setAttribute("y",s),r.setAttribute("width",n),r.setAttribute("height",a),void 0!==l&&r.setAttribute("class",l),e.appendChild(r),r},addText:function(e,t,s,n,a="start",l){let r=document.createElementNS(i,"text");return r.setAttribute("x",t),r.setAttribute("y",s),r.textContent=n,r.setAttribute("text-anchor",a),void 0!==l&&r.setAttribute("class",l),e.appendChild(r),r},addPolyline:function(e,t,s){let n=document.createElementNS(i,"polyline");n.setAttribute("points",t),void 0!==s&&n.setAttribute("class",s),e.appendChild(n)},removeElement:function(e){e.parentElement.removeChild(e)}}},function(e,t,s){let i,n,a,l,r,o,d,h,c=s(0),p=new Map;function u(e){return e.substring(0,3)}function m(e){return"eos/"===e.substring(0,4)||"par/"===e.substring(0,4)}function y(e){return e.substring(4)}e.exports={getRepresentatives:function(){return r},setMaterialData:function(e){i=e},getMaterialData:function(){return i},getCalculations:function(){return l},setCalculations:function(e){l=e.results,l.forEach((function(e,t){let s=c.getDefault(e.functional_type),i=c.getDefault(e.core_electron_treatment);this[t].functional_type=s,this[t].core_electron_treatment=i}),l),r=e.representatives;for(let e=0;e<l.length;e++)p.set(l[e].calc_id,l[e]);let t=r.electronic_band_structure,s=r.electronic_dos,i=r.thermodynamical_properties;h=void 0!==t||void 0!==s,d=void 0!==i},getCalc:function(e){return p.get(e)},getGroups:function(){return n},setGroups:function(e){let t=new Map(Object.entries(e.groups_eos)),s=new Map(Object.entries(e.groups_par));n=new Map,n.set("eos",t),n.set("par",s),a=new Set,t.forEach((e,t)=>{e.forEach(a.add,a)})},getGroupId:y,isGroup:m,getGroupType:u,getReprCalc:function(e){if(m(e)){let t=u(e),s=y(e);return n.get(t).get(s)[0]}return e},isInAnyGroup:function(e){return a.has(e)},isInAnyNotDisabledGroup:function(e){return a.has(e)},getGroupLeafId:function(e){let t=null;return n.forEach((s,i)=>{s.calculation_set.has(e)&&(t=i)}),t},isReady:function(e){return void 0!==i&&void 0!==o&&void 0!==l&&void 0!==n&&e===i.material_id},clear:function(){i=void 0,l=void 0,n=void 0,o=void 0},setIdealizedStructure:function(e){o=e},getIdealizedStructure:function(){return o},hasThermalData:function(e){return d},hasElecStructureData:function(e){return h}}},function(e,t,s){"use strict";let i=s(0),n=s(21);let a=document.querySelector("#info-tooltip"),l=document.querySelector("#tooltip-content"),r=[],o=null,d=!1,h=null;function c(){null!==o&&window.clearTimeout(o),o=window.setTimeout(e=>a.style.display="none",1e3)}let p=new n(i.IMAGE_DIR+"switch");function u(e){e.addEventListener("mouseover",m),e.addEventListener("mouseout",t=>{c(),e.style.cursor="inherit"}),e.className="info-sys-label"}function m(e){let t=e.target.getBoundingClientRect(),s=e.target.getAttribute("info-sys-data"),i=s.indexOf(".value");if(i>0){let e=h[s.split("-").join(" ").substring(0,i)];if(void 0===e.value_template){let t=e.values[s.split(":")[1]];l.innerHTML=v(t)}else{let t=e.value_template;t.text=y(t.text,s.split(":")[1]),t.link=y(t.link,s.split(":")[1]),l.innerHTML=v(t)}}else l.innerHTML=v(h[s.split("-").join(" ")]);a.style.visibility="hidden",a.style.display="block";let n=a.getBoundingClientRect(),r=n.width-t.width,d=t.left-r/2;d+n.width>window.innerWidth&&(d=window.innerWidth-n.width);let c=-window.pageYOffset;a.style.left=(d<0?5:d)+"px",a.style.top=t.top+t.height-c+"px",a.style.visibility="visible",window.clearTimeout(o),e.target.style.cursor="help"}function y(e,t){let s=e.indexOf("${"),i=e.indexOf("}");return s>=0&&i>=0&&i>s?e.substring(0,s)+t+e.substring(i+1):e}function v(e){let t="";return void 0===e.text||(t+=e.text),void 0!==e.link&&(void 0!==e.text&&(t+="<br>"),t+='<a href="'+e.link+'" target="_blank">More information</a>'),t}document.querySelector("#info-sys-switch-box").appendChild(p.element),p.setListener(e=>{d=!e,e?r.forEach(e=>{e.removeEventListener("mouseover",m),e.className=""}):(null===h&&i.serverReq("infosys.json",e=>h=JSON.parse(e.target.response)),r.forEach(u)),a.addEventListener("mouseover",e=>{window.clearTimeout(o)}),a.addEventListener("mouseout",e=>{c()})}),e.exports={addToInfoSystem:function(e){let t=e.querySelectorAll("span[info-sys-data]");for(let e=0;e<t.length;++e)r.push(t[e]);if(d)for(let e=0;e<t.length;++e)u(t[e])},addElementToInfoSystem:function(e,t){r.push(e),e.setAttribute("info-sys-data",t),d&&u(e)}}},function(e,t,s){"use strict";s(0);let i=document.querySelector("#loading-popup"),n=new Set;e.exports={show:function(e){if(!window.allowNewLoadPopup)return;n.add(e,!0);let t=i.getBoundingClientRect(),s=(window.innerWidth-t.width)/2,a=(window.innerHeight-t.height)/2;i.style.left=s+"px",i.style.top=a-100+"px",i.style.visibility="visible"},hide:function(e){n.delete(e),0===n.size&&(i.style.visibility="hidden")},reset:function(){n=new Set,i.style.visibility="hidden"}}},function(e,t,s){"use strict";let i=s(1);const n="http://www.w3.org/2000/svg";e.exports=class{constructor(e={left:20,right:0,top:10,bottom:20}){this.svg=document.createElementNS(n,"svg"),this.plotArea=document.createElementNS(n,"g"),this.svg.appendChild(this.plotArea),this.margins=e,this.parentElement=null,this.yLabelText=null,this.noDataGroup=null}attach(e,t,s){this.parentElement=e,this.parentElement.appendChild(this.svg),this.width=void 0!==t?t:this.parentElement.clientWidth,this.height=void 0!==s?s:this.svg.width,this.svg.setAttribute("width",this.width),this.svg.setAttribute("height",this.height),this.plotRangeX=this.width-this.margins.left-this.margins.right,this.plotRangeY=this.height-this.margins.top-this.margins.bottom}isAttached(){return null!==this.parentElement}setRangeAndLabels(e,t,s,i,n,a){this.xLabel=e,this.xMin=t,this.xMax=s,this.yLabel=i,this.yMin=n,this.yMax=a,this.xRel=this.plotRangeX/(this.xMax-this.xMin),this.yRel=this.plotRangeY/(this.yMax-this.yMin)}drawAxis(e=0,t=0,s=2){if(this.plotArea.setAttribute("transform","matrix(1 0 0 1 "+this.margins.left+" "+(this.height-this.margins.bottom)+")"),this.yLabelText=i.addText(this.svg,0,0,this.yLabel,"middle","axis-steps-big"),this.yLabelText.setAttribute("transform","translate(13,"+(this.plotRangeY/2+this.margins.top)+") rotate(-90)"),i.addText(this.plotArea,this.plotRangeX/2,this.margins.bottom-1,this.xLabel,"middle","axis-steps-big"),null!==e){let t=this.plotRangeX/e;for(let n=0;n<=e;n++)i.addLine(this.plotArea,t*n,0,t*n,4,1),i.addText(this.plotArea,t*n,14,+(t*n/this.xRel+this.xMin).toFixed(s),"middle","statisticsviewersteps")}if(null===t&&this.yMax>0&&this.yMin<0){let e=1;for(;this.yMax*e>this.yMin;){i.addLine(this.plotArea,0,this.transformY(this.yMax*e),-3,this.transformY(this.yMax*e),1);let t=this.yMax*e,n=Math.abs(t)>=1e4?t.toExponential():t.toFixed(s);i.addText(this.plotArea,-5,this.transformY(this.yMax*e)+3,n,"end","statisticsviewersteps"),e--}}if(null!==t){let e=this.plotRangeY/t;for(let n=0;n<=t;n++){i.addLine(this.plotArea,0,-e*n,-3,-e*n,1);let t=e*n/this.yRel+this.yMin;Math.abs(t)<.01&&(t=0),i.addText(this.plotArea,-5,-(e*n-3),t.toFixed(s),"end","statisticsviewersteps")}}i.addLine(this.plotArea,0,0,this.plotRangeX+1,0,"main-axis"),i.addLine(this.plotArea,0,0,0,-(this.plotRangeY+1),"main-axis"),i.addLine(this.plotArea,this.plotRangeX,0,this.plotRangeX,-this.plotRangeY,"main-axis"),i.addLine(this.plotArea,0,-this.plotRangeY,this.plotRangeX,-this.plotRangeY,"main-axis")}clear(){this.svg.removeChild(this.plotArea),this.plotArea=document.createElementNS(n,"g"),this.svg.appendChild(this.plotArea),this.plotArea.setAttribute("transform","matrix(1 0 0 1 "+this.margins.left+" "+(this.height-this.margins.bottom)+")"),null!==this.yLabelText&&(this.svg.removeChild(this.yLabelText),this.yLabelText=null),null!==this.noDataGroup&&(this.svg.removeChild(this.noDataGroup),this.noDataGroup=null)}setNoData(){this.clear(),null===this.noDataGroup&&(this.noDataGroup=document.createElementNS(n,"g"),this.svg.appendChild(this.noDataGroup),i.addRect(this.noDataGroup,0,0,this.width,this.height),this.noDataGroup.setAttribute("fill","#EEE"),i.addText(this.noDataGroup,this.width/2,this.height/2+10,"NO DATA","middle","nodata"))}transformY(e){return-this.yRel*(e-this.yMin)}}},function(e,t,s){"use strict";let i=s(0),n=s(2);e.exports=class{constructor(e){this.element=document.createElement("div"),this.element.setAttribute("id",e),this.loadedMatId=null,this.gotoResultsListener=null,this.gotoOverviewListener=null,this.element.innerHTML='<div class="material-title"></div>',this.element.style.display="none"}attachAndSetEvents(e){e.appendChild(this.element),this.materialTitle=this.element.querySelector(".material-title")}attachNavTree(e){e.attach(this.navTreeWrapper)}setVisible(){this.element.style.display="block"}load(){let e=n.getMaterialData().material_id;this.loadedMatId!==e&&(this.loadedMatId=e,this.setMaterialData())}setMaterialData(){this.materialTitle.innerHTML=i.getMaterialTitle(n.getMaterialData())}updateCalcs(e){}updateMarkedCalc(e){}}},function(e,t,s){"use strict";let i=s(0),n=s(2);function a(e,t){if(e.className.indexOf("material-l")>=0)return;let s=e.parentElement;for(let t=0;t<s.children.length;t++){let i=s.children[t++];if(i!==e&&i.className.indexOf("selected")<0)return}let i=s.previousElementSibling;if(t)i.className+=" node-selected";else{let e=i.className.indexOf(" node-selected");i.className=i.className.substring(0,e)}a(i,t)}e.exports=class{constructor(){this.selectedCalcs=new Set,this.element=document.createElement("div"),this.element.setAttribute("id","navigation-tree"),this.parentElement=null,this.markedNode=null,this._events()}attach(e){null!==this.parentElement&&this.parentElement.removeChild(this.element),this.parentElement=e,this.parentElement.appendChild(this.element)}build(e,t){function s(e,t,s,i=0){let n="node-"+(s?"unfolded":"folded"),a=document.createElement("div");a.className=e;let l=document.createElement("span");l.className=n,a.appendChild(l);let r=document.createElement("span");r.className="node-checkbox",a.appendChild(r);let o=document.createElement("span");if(o.className="node-label",o.textContent=t,a.appendChild(o),0!==i){let e=document.createElement("span");e.className="node-counter",e.textContent="("+i+")",a.appendChild(e)}return a}function a(e,t,s,n,a){let l=document.createElement("div");l.className="calc-l",l.setAttribute("data-calc-id",e);let r=document.createElement("span");l.appendChild(r);let d=document.createElement("span");d.className="node-checkbox",l.appendChild(d);let h=document.createElement("span");h.className="node-label",n&&h.appendChild(o),h.textContent=t+s+" ",h.appendChild(a),l.appendChild(h);let c=document.createElement("div");c.id="icon-container",c.style.float="right",c.style.padding="1px 10px 0 0",c.style.display="none";let p=document.createElement("img");return p.setAttribute("src",i.IMAGE_DIR+"next.png"),c.appendChild(p),l.appendChild(c),l}function l(e){let t=document.createElement("div");t.className="calc-graph-aval";let s=document.createElement("span");if(e.has_band_structure){let e=document.createElement("span");e.className="tooltip",e.textContent="B";let t=document.createElement("span");t.className="tooltiptext",t.textContent="Band structure",e.appendChild(t),s.appendChild(e)}if(e.has_dos){let e=document.createElement("span");e.className="tooltip",e.textContent="D";let t=document.createElement("span");t.className="tooltiptext",t.textContent="Density of states",e.appendChild(t),s.appendChild(e)}if(e.has_fermi_surface){let e=document.createElement("span");e.className="tooltip",e.textContent="F";let t=document.createElement("span");t.className="tooltiptext",t.textContent="Fermi surface",e.appendChild(t),s.appendChild(e)}if(e.has_thermal_properties){let e=document.createElement("span");e.className="tooltip",e.textContent="T";let t=document.createElement("span");t.className="tooltiptext",t.textContent="Phonons",e.appendChild(t),s.appendChild(e)}return t.appendChild(s),t}this.selectedCalcs.clear(),this.markedNode=null,this.element.innerHTML="",this.calcsInGroups=n.getGroups();let r=n.getCalculations(),o=document.createElement("img");o.className="folder-icon",o.src=i.IMAGE_DIR+"folder.png";let d=function(e,t,s){let i=new Map;function a(e,t){e.forEach((e,s)=>{let a=n.getCalc(e[0]),l=a.code_name.trim(),r=a.functional_type;if("exciting"===l)if(i.has(r)){let e=i.get(r);e.has(l)?e.get(l).push(t+s):e.set(l,[t+s])}else if("unavailable"!==r){let e=new Map;e.set(l,[t+s]),i.set(r,e)}})}function l(e,t){let s=e.code_name.trim(),n=e.functional_type;if(i.has(n)){let e=i.get(n);e.has(s)?e.get(s).push(t):e.set(s,[t])}else{let e=new Map;e.set(s,[t]),i.set(n,e)}}return"structure"===s&&(a(t.get("eos"),"eos/"),a(t.get("par"),"par/")),e.forEach(e=>{n.isInAnyNotDisabledGroup(e.calc_id)||("electronic"===s?(e.has_dos||e.has_band_structure)&&l(e,e.calc_id):"thermal"===s?e.has_thermal_properties&&l(e,e.calc_id):l(e,e.calc_id))}),i}(r,this.calcsInGroups,t),h=document.createElement("div");h.appendChild(s("material-l",e,!0));let c=document.createElement("div");h.appendChild(c),d.forEach((e,t)=>{c.appendChild(s("functional-l",t,!0));let r=document.createElement("div");c.appendChild(r),e.forEach((e,t)=>{r.appendChild(s("code-l",t,!1,e.length));let o=document.createElement("div");r.appendChild(o),o.style.display="none";for(var d=0;d<e.length;d++){let t=e[d],s="",r=i.getShortCode(t),h=n.isGroup(t);if(h){let e,i=n.getGroupType(t),a=t.substring(4);e=this.calcsInGroups.get(i).get(a),s="("+e.length+")"}let c=n.getReprCalc(t),p=a(t,r,s,h,l(n.getCalc(c)));o.appendChild(p),o.appendChild(document.createElement("div"))}})}),this.element.appendChild(h),this.showCalcsGraphDataAvailability("structure"!==t)}selectAll(e){let t=this.element.children[0].children[0];this._recursiveNodeSelection(t,!0),a(t,!0)}getMarkedLeaf(){return null===this.markedNode?null:this.markedNode.getAttribute("data-calc-id")}setMarkedLeafIfNoneMarked(e){if(null===this.getMarkedLeaf())if(null===e)this._markFirstSelectedNode();else{let t=this.element.querySelector('div[data-calc-id="'+e+'"]');this._setMarkedCalc(t)}}_events(){this.element.addEventListener("click",e=>{let t=e.target.className;if(t.indexOf("folded")>=0)this._foldTreeNode(e.target);else if(t.indexOf("node-checkbox")>=0){let t=e.target.parentElement.className.indexOf("selected")<0;this._recursiveNodeSelection(e.target.parentElement,t),a(e.target.parentElement,t),this.treeSelectionListener(this.selectedCalcs),this._keepCalcMarked(t)}else t.indexOf("node-label")>=0&&"calc-l node-selected"===e.target.parentElement.className&&this._setMarkedCalc(e.target.parentElement)})}_foldTreeNode(e){let t=e.parentElement.nextElementSibling;e.className.indexOf("-folded")>=0?(e.className=e.className.replace("folded","unfolded"),t.style.display="block"):(e.className=e.className.replace("unfolded","folded"),t.style.display="none")}_recursiveNodeSelection(e,t){e.children[1];if(t)e.className+=" node-selected";else{let t=e.className.indexOf(" node-selected");e.className=e.className.substring(0,t)}if(e.className.indexOf("calc-l")>=0){let s=e.getAttribute("data-calc-id");t?this.selectedCalcs.add(s):this.selectedCalcs.delete(s)}else{let s=e.nextElementSibling;for(let e=0;e<s.children.length;e++)this._recursiveNodeSelection(s.children[e++],t)}}setTreeSelectionListener(e){this.treeSelectionListener=e}setLeafMarkedListener(e){this.leafMarkedListener=e}getTreeSelectedCalcs(){return this.selectedCalcs}_keepCalcMarked(e){if(e&&null===this.markedNode)this._markFirstSelectedNode();else if(!e){let e=parseInt(this.markedNode.getAttribute("data-calc-id"));0===this.selectedCalcs.size?(this.markedNode.className=this.markedNode.className.replace("-marked",""),this.markedNode=null,this.leafMarkedListener(null)):this.selectedCalcs.has(e)||this._markFirstSelectedNode()}}_markFirstSelectedNode(){let e=this.element.getElementsByClassName("calc-l");for(var t=0;t<e.length;t++)if(e[t].className.indexOf("node-selected")>=0)return void this._setMarkedCalc(e[t])}_setMarkedCalc(e){if(null!==this.markedNode){this.markedNode.className=this.markedNode.className.replace("-marked",""),this.markedNode.querySelector("#icon-container").style.display="none";let e=this.markedNode.querySelector(".folder-icon");null!==e&&(e.src=i.IMAGE_DIR+"folder.png")}e.className+="-marked";let t=e.querySelector(".folder-icon");null!==t&&(t.src=i.IMAGE_DIR+"folder-sel.png"),e.querySelector("#icon-container").style.display="block",this.markedNode=e;let s=e.parentElement.previousElementSibling.firstElementChild;"node-folded"===s.className&&(s.className="node-unfolded",s.parentElement.nextElementSibling.style.display="block"),void 0!==this.leafMarkedListener&&this.leafMarkedListener(e.getAttribute("data-calc-id"))}showCalcsGraphDataAvailability(e){let t=this.element.getElementsByClassName("calc-graph-aval");for(var s=0;s<t.length;s++)t[s].style.display=e?"inline":"none"}setHeight(e){this.element.style.height=e+"px"}}},function(e,t,s){"use strict";let i=s(9),n=s(1);s(0);function a(e){return"Gamma"===e||"G"===e?"Γ":e}e.exports=class extends i{constructor(){super({left:55,right:5,top:0,bottom:30}),this.phononMode=!1,this.factor=1602176565e-28}setPhononMode(){this.phononMode=!0,this.factor=1986445681679957e-38,this.outOfRangeColorActivated=!1}attach(e,t,s){super.attach(e,t,s)}getTopAndLowestPoints(e){let t=e[0].band_energies[0][0][0],s=e[0].band_energies[0][0][0];for(let i=0;i<e.length;i++){for(let n=0;n<e[i].band_energies[0].length;n++){let a=Math.max.apply(null,e[i].band_energies[0][n]);a>t&&(t=a),a=Math.min.apply(null,e[i].band_energies[0][n]),a<s&&(s=a)}if(2===e[i].band_energies.length)for(let n=0;n<e[i].band_energies[1].length;n++){let a=Math.max.apply(null,e[i].band_energies[1][n]);a>t&&(t=a),a=Math.min.apply(null,e[i].band_energies[1][n]),a<s&&(s=a)}}return[(s-this.energyOffset)/this.factor,(t-this.energyOffset)/this.factor]}drawKPointLabel(e,t){n.addText(this.axisGroup,e*this.xRel,16,t,"middle","steps")}setBandStructureData(e){let t=e.section_k_band_segment;if(this.bandGapData=void 0,this.energyOffset=0,void 0!==e.section_band_gap){let t=1/0,s=0;for(let i=0;i<e.section_band_gap.length;++i){let n=e.section_band_gap[i].value;n<t&&(t=n,s=i)}0!=t&&(this.bandGapData=e.section_band_gap[s],this.bandGapData.cbmDistances=[],this.bandGapData.vbmDistances=[],this.energyOffset=this.bandGapData.valence_band_max_energy)}this.bandsDataSpin1=[],this.bandsDataSpin2=[],this.segmentLimitsX=[],this._reset();let s=this.getTopAndLowestPoints(t),i=s[0],n=s[1];this.phononMode?this.setAxisRangeAndLabels("",0,1,"Frequency (cm⁻¹)",-50,320,i,n,100):this.setAxisRangeAndLabels("",0,1,"Energy (eV)",-6,11,i,n,5);let l=0,r=null,o=!1,d=t[t.length-1].k_path_distances,h=d[d.length-1];for(let e=0;e<t.length;e++){let s=t[e],i=s.band_segm_labels,n=s.band_energies[0],d=s.band_energies[1],c=s.k_path_distances;this.bandsDataSpin1.push([]),this.bandsDataSpin2.push([]);let p=c[c.length-1];this.segmentLimitsX.push(l/h),null!==i&&(null!==r&&r!==i[0]?this.drawKPointLabel(l/h,a(r)+"|"+a(i[0])):this.drawKPointLabel(l/h,a(i[0])),e===t.length-1&&this.drawKPointLabel(1,a(i[1])),r=i[1]);for(let t=0;t<c.length;t++){let s=c[t]/h;for(let i=0;i<n[t].length;i++){0===t&&(this.bandsDataSpin1[e][i]=[]);let a=(n[t][i]-this.energyOffset)/this.factor;this.bandsDataSpin1[e][i].push({x:s,y:a}),!o&&a>1e4&&(o=!0)}if(void 0!==d)for(let i=0;i<d[t].length;i++){0===t&&(this.bandsDataSpin2[e][i]=[]);let n=(d[t][i]-this.energyOffset)/this.factor;this.bandsDataSpin2[e][i].push({x:s,y:n}),!o&&n>1e4&&(o=!0)}}l+=p}if(o)throw"Plotter Data Overflow: Probably the energy data is not in correct units";this.repaint()}repaintData(e,t){let s;this.segmentLimitsX.forEach(s=>{let i=this.transformY(e),a=this.transformY(t);this.phononMode&&(i+=200,a-=200),n.addLine(this.plotContent,s*this.xRel,i,s*this.xRel,a,"segment")});for(var i=0;i<this.bandsDataSpin1.length;i++)for(var a=0;a<this.bandsDataSpin1[i].length;a++){s="";for(var l=0;l<this.bandsDataSpin1[i][a].length;l++)s+=" "+this.xRel*this.bandsDataSpin1[i][a][l].x+" "+this.transformY(this.bandsDataSpin1[i][a][l].y);n.addPolyline(this.plotContent,s,"plotSpin1")}if(this.bandsDataSpin2.length>0)for(i=0;i<this.bandsDataSpin2.length;i++)for(a=0;a<this.bandsDataSpin2[i].length;a++){s="";for(l=0;l<this.bandsDataSpin2[i][a].length;l++)s+=" "+this.xRel*this.bandsDataSpin2[i][a][l].x+" "+this.transformY(this.bandsDataSpin2[i][a][l].y);n.addPolyline(this.plotContent,s,"plotSpin2")}void 0!==this.bandGapData&&(this.bandGapData.cbmDistances.forEach(e=>{let t=this.xRel*e,s=this.transformY((this.bandGapData.conduction_band_min_energy-this.energyOffset)/this.factor);n.addPoint(this.plotContent,t,s,3,"cbm-vbm-points"),n.addText(this.plotContent,t+4,s-6,"CBM")}),this.bandGapData.vbmDistances.forEach(e=>{let t=this.xRel*e,s=this.transformY((this.bandGapData.valence_band_max_energy-this.energyOffset)/this.factor);n.addPoint(this.plotContent,t,s,3,"cbm-vbm-points"),n.addText(this.plotContent,t+4,s+14,"VBM")}))}}},function(e,t,s){"use strict";let i=s(1);const n="http://www.w3.org/2000/svg";e.exports=class{constructor(e={left:20,right:0,top:0,bottom:20}){this.margins=e,this.svg=document.createElementNS(n,"svg"),this.parentElement=null,this.plotContent=null,this.axisGroup=null,this.yAxisLabelsGroup=null,this.yLabelText=null,this.noDataGroup=null,this.yZoom=1,this.yOffset=0,this.repaintListener=null,this.nodataLabel=null,this.outOfRangeColorActivated=!0}attach(e,t,s){this.parentElement=e,this.parentElement.appendChild(this.svg),this.width=void 0!==t?t:this.parentElement.clientWidth,this.height=void 0!==s?s:this.svg.width,this.svg.setAttribute("width",this.width),this.svg.setAttribute("height",this.height),this.plotRangeX=this.width-this.margins.left-this.margins.right,this.plotRangeY=this.height-this.margins.top-this.margins.bottom,this.yAxisArea=document.createElementNS(n,"svg"),this.svg.appendChild(this.yAxisArea);let a=this.margins.left;this.plotAreaHeight=this.height-this.margins.bottom-this.margins.top,this.yAxisArea.setAttribute("width",a),this.yAxisArea.setAttribute("height",this.plotAreaHeight),this.yAxisArea.setAttribute("x",0),this.yAxisArea.setAttribute("y",0),this.plotArea=document.createElementNS(n,"svg"),this.svg.appendChild(this.plotArea),this.plotAreaWidth=this.width-this.margins.left-this.margins.right,this.plotArea.setAttribute("width",this.plotAreaWidth),this.plotArea.setAttribute("height",this.plotAreaHeight),this.plotArea.setAttribute("x",this.margins.left),this.plotArea.setAttribute("y",this.margins.top),this.plotAreaBg=i.addRect(this.plotArea,0,0,this.plotAreaWidth,this.plotAreaHeight),this.plotAreaBg.setAttribute("class","moveable-plot"),this.plotAreaBg.setAttribute("opacity",0),this._events()}isAttached(){return null!==this.parentElement}setAxisRangeAndLabels(e,t,s,n,a,l,r,o,d,h=2){this.xLabel=e,this.xMin=t,this.xMax=s,this.yMinInit=a,this.yMaxInit=l,this.yMin=r,this.yMax=o,this.yLabelGapInit=d,this.xRel=this.plotRangeX/(this.xMax-this.xMin),this.yRel=this.plotRangeY/(this.yMaxInit-this.yMinInit),this._resetAxisGroup(),i.addLine(this.axisGroup,0,0,this.plotRangeX,0,"main-axis"),i.addLine(this.axisGroup,0,0,0,-this.plotRangeY,"main-axis"),i.addLine(this.axisGroup,this.plotRangeX,0,this.plotRangeX,-this.plotRangeY,"main-axis"),i.addLine(this.axisGroup,0,-this.plotRangeY,this.plotRangeX,-this.plotRangeY,"main-axis"),null!==n&&(this.yLabelText=i.addText(this.svg,0,0,n,"middle","axis-steps-big"),this.yLabelText.setAttribute("transform","translate(15,"+(this.plotRangeY/2+this.margins.top)+") rotate(-90)")),null!==e&&i.addText(this.axisGroup,this.plotRangeX/2,this.margins.bottom-12,this.xLabel,"middle","axis-steps-big"),this._resetYAxisLabelGroup(),this.precalculation_1=this.plotAreaHeight+this.yMinInit*this.yRel,this.precalculation_2=this.precalculation_1}_events(){let e;this.plotArea.addEventListener("wheel",e=>{e.preventDefault(),e.deltaY>0&&this.yZoom>.5?this.yZoom-=.2:e.deltaY<0&&this.yZoom<2&&(this.yZoom+=.2),this.repaint(),null!==this.repaintListener&&this.repaintListener(this.yZoom,this.yOffset)}),this.plotArea.addEventListener("mousedown",t=>{t.preventDefault(),e=t.clientY+this.yOffset,this.plotArea.addEventListener("mousemove",s),this.plotArea.addEventListener("mouseup",e=>{this.plotArea.removeEventListener("mousemove",s)}),this.plotArea.addEventListener("mouseout",e=>{this.plotArea.removeEventListener("mousemove",s)})});let t=this;function s(s){t.yOffset=e-s.clientY,t.precalculation_2=t.precalculation_1-t.yOffset,t.repaint(),null!==t.repaintListener&&t.repaintListener(t.yZoom,t.yOffset)}}setYZoomAndOffset(e,t){this.yZoom=e,this.yOffset=t,this.precalculation_2=this.precalculation_1-this.yOffset}setExternalYAxisMax(e){this.externalYAxisMax=e}getYAxisMax(){return this.yAxisMax}repaint(){let e;this._resetYAxisLabelGroup(),e=this.yZoom>1?this.yLabelGapInit/5:this.yLabelGapInit;let t=Math.floor(this.yMin/e)*e,s=Math.ceil(this.yMax/e)*e;if(this.yAxisMax=s,void 0!==this.externalYAxisMax&&(s=this.externalYAxisMax),null!==this.yLabelText)for(let n=t;n<s+1;n+=e)i.addLine(this.yAxisLabelsGroup,this.margins.left,this.transformY(n),this.margins.left-3,this.transformY(n)),i.addText(this.yAxisLabelsGroup,this.margins.left-5,this.transformY(n)+5,n,"end","axis-steps");if(this._resetPlotContent(),this.outOfRangeColorActivated){i.addRect(this.plotContent,0,this.transformY(this.yMax)-2*this.plotAreaHeight,this.plotAreaWidth,2*this.plotAreaHeight).setAttribute("class","out-of-range"),i.addRect(this.plotContent,0,this.transformY(this.yMin),this.plotAreaWidth,2*this.plotAreaHeight).setAttribute("class","out-of-range")}i.addLine(this.plotContent,0,this.transformY(0),this.plotRangeX,this.transformY(0),"zeroline"),this.repaintData(t,s),this.plotArea.removeChild(this.plotAreaBg),this.plotArea.appendChild(this.plotAreaBg)}setRepaintListener(e){this.repaintListener=e}transformY(e){return-e*this.yZoom*this.yRel+this.precalculation_2}_resetPlotContent(){null!==this.plotContent&&this.plotArea.removeChild(this.plotContent),this.plotContent=document.createElementNS(n,"g"),this.plotArea.appendChild(this.plotContent)}_resetAxisGroup(){null!==this.axisGroup&&this.svg.removeChild(this.axisGroup),this.axisGroup=document.createElementNS(n,"g"),this.svg.appendChild(this.axisGroup),this.axisGroup.setAttribute("transform","matrix(1 0 0 1 "+this.margins.left+" "+(this.height-this.margins.bottom)+")")}_resetYAxisLabelGroup(){null!==this.yLabelText&&(null!==this.yAxisLabelsGroup&&this.yAxisArea.removeChild(this.yAxisLabelsGroup),this.yAxisLabelsGroup=document.createElementNS(n,"g"),this.yAxisArea.appendChild(this.yAxisLabelsGroup))}_reset(){this.yZoom=1,this.yOffset=0,this._resetPlotContent(),null!==this.yLabelText&&(this.svg.removeChild(this.yLabelText),this.yLabelText=null),null!==this.noDataGroup&&(this.svg.removeChild(this.noDataGroup),this.noDataGroup=null)}setNoData(){this._resetYAxisLabelGroup(),this._resetPlotContent(),this._resetAxisGroup(),null===this.noDataGroup&&(this.noDataGroup=document.createElementNS(n,"g"),this.svg.appendChild(this.noDataGroup),i.addRect(this.noDataGroup,0,0,this.width,this.height),this.noDataGroup.setAttribute("fill","#EEE"),i.addText(this.noDataGroup,this.width/2,this.height/2+10,"NO DATA","middle","nodata"))}}},function(e,t,s){let i=s(1),n=s(0),a=(s(7),s(20)),l=s(23),r=s(25),o=s(27),d=s(29),h=s(32),c=s(2),p=s(4),u={eStruct:null,thermalProps:null};class m{constructor(e){this.hostElement=e;this.viewer=new matviewer.StructureViewer(e,{view:{autoResize:!1,autoFit:!0,fitMargin:.5},structure:{createLegend:!1,showLegend:!1,radiusScale:.7,bondScale:1.5,showCopies:!0,viewCenter:"COP"}}),this.legendElement=document.createElement("div"),this.legendElement.setAttribute("class","element-labels"),this.legendElement.setAttribute("style","position: absolute; bottom: 50px; right: 0"),this.hostElement.appendChild(this.legendElement),this.footerElement=document.createElement("div"),this.footerElement.setAttribute("class","structure-viewer-legend"),this.hostElement.appendChild(this.footerElement),this.footerElement.innerHTML=`\n\n <div style="float: left; padding-right: 12px" >\n <input type="checkbox" class="show-axis" checked> Show axis\n </div>\n\n <div style="float: left; padding-right: 18px" >\n <input type="checkbox" class="show-bonds" checked> Show bonds\n </div>\n\n <div style="float: left; position:relative;" >\n <img class="view-reset" style="cursor: pointer;" height="18px"\n src="${n.IMAGE_DIR}reset.svg" />\n <div class="view-reset-tooltip" > Reset view </div>\n </div>\n\n <div class="vr-download" style="float: right"> </div>\n\n <div style="clear: both;"></div>\n `,this.axisCheckbox=this.footerElement.querySelector(".show-axis"),this.axisCheckbox.addEventListener("click",e=>{this.viewer.toggleLatticeParameters(this.axisCheckbox.checked)}),this.bondsCheckbox=this.footerElement.querySelector(".show-bonds"),this.bondsCheckbox.addEventListener("click",e=>{this.viewer.toggleBonds(this.bondsCheckbox.checked)}),this.labelsContainer=this.hostElement.querySelector(".element-labels"),this.vrLinksContainer=this.footerElement.querySelector(".vr-download"),this.vrDropDown=new y,this.vrLinksContainer.appendChild(this.vrDropDown.element);let t=this.hostElement.querySelector(".view-reset");t.addEventListener("click",e=>this.viewer.controls.reset()),t.addEventListener("mouseover",e=>{this.hostElement.querySelector(".view-reset-tooltip").style.display="block"}),t.addEventListener("mouseout",e=>{this.hostElement.querySelector(".view-reset-tooltip").style.display="none"})}load(e){e=this.getCellDataForViewer(e),this.viewer.load(e),this.createElementLegend()}resizeCanvasToHostElement(){this.viewer.resizeCanvasToHostElement()}setMaterialId(e){this.vrDropDown.setMaterialId(e)}changeHostElement(e){this.hostElement!==e&&(this.hostElement.removeChild(this.legendElement),this.hostElement.removeChild(this.footerElement),this.hostElement=e,this.viewer.changeHostElement(e),this.hostElement.appendChild(this.legendElement),this.hostElement.appendChild(this.footerElement)),this.viewer.resizeCanvasToHostElement(),this.viewer.fitToCanvas(),this.viewer.render()}getCellDataForViewer(e){let t={};return t.pbc=e.periodicity,t.chemicalSymbols=e.atom_labels,t.cell=n.convert2d(e.lattice_vectors,1e10),t.scaledPositions=e.atom_positions,t}createElementLegend(){this.labelsContainer.innerHTML="";let e=this.viewer.elements,t=[];for(let s in e)e.hasOwnProperty(s)&&t.push([s,e[s][0],e[s][1]]);t.sort((function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0}));let s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("width",50),s.setAttribute("height",25*t.length),this.labelsContainer.appendChild(s);for(let e=0;e<t.length;++e){let n=t[e][0],a=t[e][1].toString(16),l=6-a.length;a="#"+Array(l+1).join("0")+a,i.addCircle(s,10,25*e+12,8,a,"#777",1),i.addText(s,24,25*e+18,n,"start","structure-viewer-legend-labels")}}}class y{constructor(e){this.folded=!0,this.element=document.createElement("div"),this.element.innerHTML+=`\n <div >\n <span style=" vertical-align: 30%; ">Virtual Reality files</span>\n <img style="cursor: pointer" src="${n.IMAGE_DIR}folded.png" />\n </div>\n\n <div class="vr-download-panel" style="position: relative; display: none">\n\n </div>\n `,this.element.tabIndex="0",this.element.style.outline="none",this.foldingPanel=this.element.querySelector(".vr-download-panel"),this.foldBtn=this.element.querySelector("img"),this.foldBtn.addEventListener("click",e=>{this.folded=!this.folded,this.foldBtn.src=this.folded?n.IMAGE_DIR+"folded.png":n.IMAGE_DIR+"unfolded.png",this.foldingPanel.style.display=this.folded?"none":"block"}),this.element.addEventListener("blur",e=>{setTimeout(()=>{this.folded=!0,this.foldBtn.src=n.IMAGE_DIR+"folded.png",this.foldingPanel.style.display="none"},300)})}setMaterialId(e){this.foldingPanel.innerHTML=`\n <div class="vr-download-panel-unfolded" style="width: 210px;">\n <div style="padding: 5px; ">\n <a href="http://nomad.srv.lrz.de/cgi-bin/NOMAD/material?${e}">Get VR file</a>\n </div>\n <br>\n <div style="padding-bottom: 5px; ">Visualization tools for specific devices:</div>\n\n <div style="padding: 5px; ">\n <a href="http://nomad.srv.lrz.de/NOMAD/NOMADViveT-Setup.exe">HTC Vive</a>\n </div>\n \x3c!--\n <div style="padding: 5px; ">\n <a href="http://nomad.srv.lrz.de/NOMAD/NOMADGearvrT.apk">Samsung GearVR</a>\n </div>\n --\x3e\n <div style="padding: 5px; ">\n <a target="_blank" href="https://play.google.com/store/apps/details?id=com.lrz.nomadvr">Google Cardboard</a>\n </div>\n\n </div>\n `}}e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","material-module"),this.overview=new a,this.overview.attachAndSetEvents(this.element),this.structureViewer=new m(this.overview.vizBox),this.structureDetails=new l,this.structureDetails.attachAndSetEvents(this.element),this.electronicStructDetails=new r,this.electronicStructDetails.attachAndSetEvents(this.element),this.methodologyDetails=new o,this.methodologyDetails.attachAndSetEvents(this.element),this.thermalDetails=new d,this.thermalDetails.attachAndSetEvents(this.element),this.elasticDetails=new h,this.elasticDetails.attachAndSetEvents(this.element),this.currentDetailView=null}setMaterialView(e){this._loadMaterial(e.material_id,e.view)}getCurrentPageStatus(){let e=null;return null===this.currentDetailView&&(e=this.overview.getEStructChosenCalcs()),{pageId:this.currentDetailViewId,eStructCalcs:e}}_setView(e){null===this.currentDetailView?this.overview.element.style.display="none":this.currentDetailView.element.style.display="none",void 0===e?(this.currentDetailView=null,this.currentDetailViewId=null,this.overview.setVisible()):(this.currentDetailViewId=e,this._setDetailView(n.MAT_VIEW[e]))}_setCellViewer(e){this.structureViewer.changeHostElement(e)}_setDetailView(e){e===n.MAT_VIEW.structure?this.currentDetailView=this.structureDetails:e===n.MAT_VIEW.electronicstruct?this.currentDetailView=this.electronicStructDetails:e===n.MAT_VIEW.methodology?this.currentDetailView=this.methodologyDetails:e===n.MAT_VIEW.thermalprops&&(this.currentDetailView=this.thermalDetails),this.currentDetailView.setVisible()}_loadMaterial(e,t){this._setView(t);let s=()=>{let e=c.getMaterialData();c.getIdealizedStructure();if(null!==this.currentDetailView)this.currentDetailView.load(),t===n.MAT_VIEW.structure&&this._setCellViewer(this.structureDetails.vizBox),t===n.MAT_VIEW.methodology&&this.methodologyDetails.updateSelection();else{document.querySelector("title").innerHTML="NOMAD Encyclopedia - "+n.getMaterialTitle(e,!1),this.overview.setMaterialData();null===e.material_name?e.formula:e.material_name;this.overview.setCalcsData(u),this._setCellViewer(this.overview.vizBox)}},i=()=>{let t=c.isReady(e);return t&&s(),t};i()||(c.clear(),p.reset(),this.structureViewer.axisCheckbox.checked=!0,this.structureViewer.bondsCheckbox.checked=!0,document.getElementById("methodology-ov").style.visibility="hidden",document.getElementById("structure-ov").style.visibility="hidden",document.getElementById("e-structure-ov").style.display="none",document.getElementById("e-structure-ov").style.visibility="hidden",document.getElementById("thermal-props-ov").style.visibility="hidden",p.show("load_basic"),n.serverReq(n.getMaterialURL(e),e=>{let t=JSON.parse(e.target.response);c.setMaterialData(t),n.materialId=t.material_id,i(),p.hide("load_basic")}),p.show("load_calculations"),n.serverReq(n.getMaterialXsURL("calculations",e),t=>{let s=JSON.parse(t.target.response),a=s.representatives.idealized_structure;c.setCalculations(s);let l=JSON.stringify({properties:["idealized_structure"]});p.show("load_idealized"),n.serverReqPOST(n.getMaterialCalcURL(e,a),l,e=>{let t=JSON.parse(e.target.response).idealized_structure;c.setIdealizedStructure(t),this.structureViewer.load(t),document.getElementById("structure-ov").style.visibility="visible",document.getElementById("methodology-ov").style.visibility="visible",i(),p.hide("load_idealized")}),p.hide("load_calculations")}),p.show("load_groups"),n.serverReq(n.getMaterialXsURL("groups",e),e=>{let t=JSON.parse(e.target.response);c.setGroups(t),i(),p.hide("load_groups")}))}}},function(e,t,s){"use strict";let i=s(9),n=s(1),a=s(0);e.exports=class extends i{constructor(e){super(e)}attach(e,t,s){super.attach(e,t,s)}setPoints(e,t){this.pointsSpin1=[],this.pointsSpin2=[],this._reset();let s=e.dos_values[0],i=null;2===e.dos_values.length&&(i=e.dos_values[1]);let l=e.dos_energies,r=[],o=[];for(var d=0;d<l.length;d++){let e=l[d]/1602176565e-28,t=1602176565e-28*s[d];if(r.push(t),o.push(e),this.pointsSpin1.push({x:t,y:e}),null!==i){let t=1602176565e-28*i[d];this.pointsSpin2.push({x:t,y:e}),r.push(t)}}let h=Math.max.apply(null,r),c=Math.max.apply(null,o),p=Math.min.apply(null,o),u=a.generateDiagramSteps(h,3),m=u[0];u[1];this.setAxisRangeAndLabels(null,0,m[m.length-1],"Energy (eV)",-6,11,p,c,5),n.addText(this.axisGroup,this.plotRangeX/2,this.margins.bottom,"DOS (states/eV/cell)","middle","axis-steps-big");for(let e=0;e<m.length;e++){let t=this.plotRangeX*m[e]/m[m.length-1];n.addLine(this.axisGroup,t,0,t,3,1);let s=m[e];s=Math.abs(s)>=1e4||Math.abs(s)<=1e-4?s.toExponential(1):parseFloat(s.toFixed(3)),n.addText(this.axisGroup,t,13,0===e?"0":s,"middle","axis-steps-smaller")}this.repaint()}repaintData(){let e="";for(var t=0;t<this.pointsSpin1.length;t++)e+=" "+this.xRel*this.pointsSpin1[t].x+" "+this.transformY(this.pointsSpin1[t].y);n.addPolyline(this.plotContent,e,"plotSpin1"),e="";for(t=0;t<this.pointsSpin2.length;t++)e+=" "+this.xRel*this.pointsSpin2[t].x+" "+this.transformY(this.pointsSpin2[t].y);n.addPolyline(this.plotContent,e,"plotSpin2")}setYAxisLabelsVisibility(e){null!==this.yAxisLabelsGroup&&(this.yAxisLabelsGroup.style.visibility=e?"visible":"hidden")}}},function(e,t,s){"use strict";let i=s(1),n=s(5);e.exports=class extends n{constructor(){super({left:50,right:16,top:10,bottom:32}),this.tooltip}setData(e,t){this.clear();let s=e.indexOf(600)+1,n=[],a=[];for(let s=0;s<e.length;++s){let i=e[s],l=t[s];null!==i&null!==l&&(n.push(i),a.push(l))}let l=n.slice(0,s),r=a.slice(0,s),o=Math.max.apply(null,r);this.setRangeAndLabels("T (K)",0,600,"Cv (J/K/kg)",0,200*Math.ceil(o/200)),this.drawAxis(4,4,0);let d="";l.forEach((e,t)=>{let s=r[t];d+=" "+this.xRel*e+" -"+this.yRel*(s-this.yMin)}),i.addPolyline(this.plotArea,d,"plotSpin1")}}},function(e,t){e.exports=class{constructor(e,t){this.first=!0,this.last=!1,this.element=document.createElement("div"),this.element.className=e,void 0!==t&&(this.element.style.width=t),this.element.innerHTML='\n <div class="prev-sel-btn" style="float: left; width: 20%;">\n <div style="padding-left: 10%;">\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10.069 11.872" width="20px">\n <path transform="scale(0.7) translate(-346.291 -664.481)"\n d="M356.36,666.024l-1.544-1.544-8.525,8.513,8.493,8.447,1.544-1.544-6.8-6.9Z" />\n </svg>\n </div>\n </div>\n <div class="calc-sel-text" style="float: left; width: 60%;">\n NOT Calculation\n </div>\n <div class="next-sel-btn" style="float: right; width: 20%;">\n <div style="padding-right: 10%;">\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="-10.069 -11.872 10.069 11.872" width="20px">\n <g transform="rotate(180) scale(0.7)">\n <path d="M10.069,1.544,8.525,0,0,8.513,8.493,16.96l1.544-1.544-6.8-6.9Z"/>\n </g>\n </svg>\n </div>\n </div>\n <div style="clear: both;"></div>\n ',this.prevBtn=this.element.querySelector(".prev-sel-btn"),this.prevIcon=this.element.querySelector(".prev-sel-btn path"),this.calcSelectorTxt=this.element.querySelector(".calc-sel-text"),this.nextBtn=this.element.querySelector(".next-sel-btn"),this.nextIcon=this.element.querySelector(".next-sel-btn path"),this._styleButtons(),this._events()}_events(){this.prevBtn.addEventListener("click",e=>{e.preventDefault(),this.first||(this.first=this.prevListener(),this.last=!1,this._styleButtons())}),this.nextBtn.addEventListener("click",e=>{e.preventDefault(),this.last||(this.first=!1,this.last=this.nextListener(),this._styleButtons())})}_styleButtons(){this.prevIcon.setAttribute("class","calc-selector-icon"+(this.first?"-disabled":"")),this.nextIcon.setAttribute("class","calc-selector-icon"+(this.last?"-disabled":""))}setPrevListener(e){this.prevListener=e}setNextListener(e){this.nextListener=e}setState(e,t,s){this.calcSelectorTxt.innerHTML=e,this.first=t,this.last=s,this._styleButtons()}}},function(e,t,s){"use strict";let i=s(1),n=s(5);class a extends n{constructor(){super({left:54,right:20,top:20,bottom:30})}drawBars(e,t,s,n,a,l){for(let r=0;r<e.length;++r){let o,d=(t[r]-s)*this.xRel,h=e[r]*this.yRel;o=0==a?(n-s)/l*this.xRel:a*this.xRel,i.addRect(this.plotArea,d,-h,o,h,"bar")}}}e.exports=class{constructor(){this.freqGraph=new a}attach(e,t,s){this.freqGraph.attach(e,t,s)}drawPoints(e,t,s){let i,n,a,l=e.occurrences,r=e.values,o=Math.max(...l);if(1==r.length){let e=r[0];0!==e?(i=.9*e,n=1.1*e+.2*e/s):(i=0,n=e+1),a=0}else i=r[0],a=r[1]-r[0],n=r[r.length-1]+a;this.freqGraph.setRangeAndLabels(t,i,n,"Occurrence",0,o),this.freqGraph.drawAxis(n===i?null:5,2,i>1e3?0:2),this.freqGraph.drawBars(l,r,i,n,a,s)}clear(){this.freqGraph.clear()}}},function(e,t,s){"use strict";let i,n,a,l,r,o=document.querySelector("body"),d=[],h=[],c=[],p=!1;function u(e,t){let s=document.createElement("div");return s.setAttribute("class","user-guidance"),s.innerHTML='<img src="img/tip'+e+'.png" width="'+t+'px" />',s.style.position="absolute",s.style.display="none",o.appendChild(s),s}function m(e){if(8===e&&!p)return;if(4===e&&!p)return;let t=h[e].domTarget.getBoundingClientRect();d[e].style.top=t.top+h[e].top+window.pageYOffset+"px",d[e].style.left=t.left+h[e].left+"px",d[e].style.display="block"}function y(e){d[e].style.display="none",localStorage.setItem("tip"+e,"off"),c[e]="off"}function v(e){switch(e.preventDefault(),e.target.style.display="none",i){case 2:i=5;break;case 6:i=8;break;default:i++}g(i),m(i)}function f(e,t){null===c[e]&&(t?m(e):d[e].style.display="none")}function g(e){i=e,localStorage.setItem("currentTip",e)}e.exports={init:function(e,t,s,i){n=e,a=t,l=s,r=i,c[3]=localStorage.getItem("tip3"),c[4]=localStorage.getItem("tip4"),c[7]=localStorage.getItem("tip7"),0===d.length&&(d[1]=u(1,220),h[1]={domTarget:n,top:-70,left:-240},d[2]=u(2,280),h[2]={domTarget:n,top:-110,left:80},d[3]=u(3,180),h[3]={domTarget:a,top:180,left:720},d[4]=u(4,240),h[4]={domTarget:l,top:45,left:-250},d[5]=u(5,210),h[5]={domTarget:n,top:-130,left:70},d[6]=u(6,240),h[6]={domTarget:n,top:-100,left:370},d[7]=u(7,220),h[7]={domTarget:r,top:160,left:-40},d[8]=u(8,240),h[8]={domTarget:l,top:30,left:760},d[1].addEventListener("click",v),d[2].addEventListener("click",v),d[3].addEventListener("click",e=>{y(3)}),d[4].addEventListener("click",e=>{y(4)}),d[5].addEventListener("click",v),d[6].addEventListener("click",v),d[7].addEventListener("click",e=>{y(7)}),d[8].addEventListener("click",e=>{e.target.style.display="none",g(10)}));let o=localStorage.getItem("currentTip");null===o?g(1):(o=parseInt(o),o<10&&g(o))},setFinal:function(){p=!0,i<10&&(d[i].style.display="none",g(8),m(i)),f(4,!0)},show:function(e,t,s){i<10&&(e?m(i):d[i].style.display="none"),f(3,e&&t),f(4,e),f(7,e&&s)},showIndependentTip:f}},function(e,t,s){"use strict";let i=s(0),n=(s(4),s(17)),a=s(18),l=s(19),r=s(10),o=s(33),d=s(15),h=s(2),c=document.getElementById("content"),p=document.querySelector("title");window.allowNewLoadPopup=!0,a.subscribe("authenticated",e=>{let t=document.location.hash.substring(2);if(t.lastIndexOf("/")===t.length-1&&(t=t.substring(0,t.length-1)),t.indexOf("/")>0){"material"===t.split("/")[0]&&(f.style.visibility="visible")}});var u=new Keycloak({url:window.nomadEnv.keycloakBase,realm:window.nomadEnv.keycloakRealm,clientId:window.nomadEnv.keycloakClientId});window.keycloak=u;let m=document.querySelector("#login-button"),y=document.querySelector("#logout-button"),v=document.querySelector("#user-name");u.init({onLoad:"check-sso",silentCheckSsoRedirectUri:window.nomadEnv.guiRoot+"silent-check-sso.html",promiseType:"native"}).then(e=>{e?u.loadUserProfile().then((function(e){v.textContent=`${e.firstName} ${e.lastName}`,m.style.display="none",y.style.display="inline",a.publish("authenticated")})).catch((function(){console.log("Failed to load user profile.")})):(m.style.display="inline",y.style.display="none",v.textContent="Guest")}),m.onclick=()=>{u.login({redirectUri:window.nomadEnv.guiRoot+"#/search"}).catch(()=>{console.log("Authentication error.")})},y.onclick=()=>{u.logout()};let f=document.getElementById("calc-flagging-tab");f.style.top=window.innerHeight/2+"px",f.addEventListener("click",e=>{n.show(b.getCurrentPageStatus())});let g,b,x,w,S=new class{constructor(){this.element=document.querySelector("#breadcrumb-placeholder"),this.element.innerHTML='\n <span class="goto-page Search">Search</span>\n <span class="goto-page Results"> > <span>Results</span></span>\n <span class="goto-page Overview"> > <span>Overview</span></span>\n <span class="Details">\n > \n <select class="details-dropdown" >\n <option value="structure">Structure</option>\n <option value="electronicstruct">Electronic structure</option>\n <option value="methodology">Methodology</option>\n <option value="thermalprops">Thermal Properties</option>\n \x3c!-- elasticconst--\x3e\n </select>\n </span>\n ',this.resultsSel=this.element.querySelector(".Results"),this.overviewSel=this.element.querySelector(".Overview"),this.detailsSel=this.element.querySelector(".Details"),this.detailsDropDown=this.element.querySelector(".details-dropdown"),this.element.querySelector(".Search").addEventListener("click",e=>{i.setBrowserHashPath("search")}),this.resultsSel.addEventListener("click",e=>{i.setBrowserHashPath("search/results")}),this.overviewSel.addEventListener("click",()=>{i.setBrowserHashPath("material",i.materialId)}),this.detailsDropDown.addEventListener("change",e=>{i.setBrowserHashPath("material",h.getMaterialData().material_id+"/"+e.target.value)});let e=this;this.detailsDropDown.addEventListener("focus",(function t(){let s=e.detailsDropDown.querySelector('option[value="electronicstruct"]');h.hasElecStructureData()||e.detailsDropDown.removeChild(s);let i=e.detailsDropDown.querySelector('option[value="thermalprops"]');h.hasThermalData()||e.detailsDropDown.removeChild(i),e.detailsDropDown.removeEventListener("focus",t)}))}setState(e,t){this.resultsSel.querySelector("span").style.fontWeight="normal";let s=this.overviewSel.querySelector("span");s.style.fontWeight="normal","search"===e?(this.overviewSel.style.display="none",this.detailsSel.style.display="none","results"===t?(this.resultsSel.style.display="inline",this.resultsSel.querySelector("span").style.fontWeight="bold",this.element.style.visibility="visible"):this.element.style.visibility="hidden"):"material"===e&&(this.element.style.visibility="visible",this.resultsSel.style.display=i.searchResults?"inline":"none",this.overviewSel.style.display="inline",void 0===t?(this.detailsSel.style.display="none",s.style.fontWeight="bold"):(this.detailsSel.style.display="inline",this.detailsDropDown.value=t))}};function _(e){w&&c.removeChild(w),w=e,c.appendChild(w)}a.subscribe("show-material",e=>{console.log("Handling event show-material: "+e.material_id+" view: "+e.view),S.setState("material",e.view),void 0===x&&(b=new r,x=b.element),_(x),b.setMaterialView(e),d.show(!1),u.authenticated&&(f.style.visibility="visible")}),a.subscribe("show-search",e=>{console.log("Handling event show-search: "+e),f.style.visibility="hidden",p.innerHTML="NOMAD Encyclopedia - Search",S.setState("search",e),void 0===e?g.showSearchPage():"results"===e&&g.showResultsPage(),_(g.element)}),l.add("search",e=>a.publish("show-search",e)),l.add("material",(e,t)=>a.publish("show-material",{material_id:e,view:t})),g=new o,""===document.location.hash&&(document.location+="#/search"),l.route();document.querySelector("#user-name");let E=function(e){let t=("; "+document.cookie).split("; "+e+"=");if(2===t.length)return t.pop().split(";").shift()}("user_info");if(void 0!==E){let e=JSON.parse((T=E).substring(1,T.length-1).replace(/\\054/g,",").replace(/\\/g,""));setAppAuthenticated(e)}var T},function(e,t,s){"use strict";let i=s(0),n=s(2),a=document.querySelector("#flagging-form-popup-bg"),l=document.querySelector("#flagging-form-popup");l.innerHTML='\n\n<div> <img src="img/cross.svg" height="12px"\n style="float: right; cursor: pointer" />\n</div>\n\n<div class="form-wrapper">\n <div class="popup-title"> Error reporting</div>\n <br>\n <div> Material: <span id="error-material-id"></span></div>\n <select id="flagging-category" name="category">\n <option value="">Select a category *</option>\n <option value="structure">Structure</option>\n <option value="electronicstruct">Electronic structure</option>\n <option value="methodology">Methodology</option>\n <option value="thermalprops">Thermal properties</option>\n </select>\n\n <select id="flagging-subcategory" name="subcategory">\n\n </select>\n\n <textarea id="subject" name="subject" style="height:200px"\n placeholder="Write a short explanation about the error" ></textarea>\n\n <div id="form-validation-msg"> </div>\n\n <div style="display: flex; justify-content: space-evenly;">\n <button style="display: block">Send</button>\n </div>\n\n\n</div>\n';let r=l.querySelector("#flagging-category"),o=r.querySelector('option[value="electronicstruct"]'),d=r.querySelector('option[value="thermalprops"]'),h=l.querySelector("#flagging-subcategory"),c=l.querySelector("img"),p=l.querySelector("#form-validation-msg"),u=l.querySelector("button"),m=l.querySelector("#error-material-id"),y=null;function v(){a.style.visibility="hidden",l.style.visibility="hidden",r.selectedIndex=0,h.selectedIndex=0,l.querySelector("textarea").value="",p.innerHTML=""}function f(e,t){let s=document.createElement("option");return s.value=void 0===t?e:t,s.innerHTML=e,s}c.addEventListener("click",e=>{v()}),u.addEventListener("click",e=>{let t=r.options[r.selectedIndex];var s=window.keycloak;if(!s.authenticated)return void(p.innerHTML="Your authentication has expired. Please login again.");if(!r.disabled&&""===t.value)return void(p.innerHTML="The category fields must be set");if(r.disabled&&""===h.value&&t.value!==i.MAT_VIEW.methodology)return void(p.innerHTML="The subcategory fields must be set");p.innerHTML="Sending report...";let a=l.querySelector("textarea").value,o=n.getMaterialData().material_id;s.loadUserProfile().then((function(e){let s={};s.server=i.getServerLocation(),s.username=e.username,s.email=e.email,s.first_name=e.firstName,s.last_name=e.lastName,s.message=a,s.category=t.text,r.disabled?s.subcategory=h.options[h.selectedIndex].text:s.representatives=n.getRepresentatives(),i.serverReqPOST(i.getReportURL(o),JSON.stringify(s),e=>{204===e.target.status?v():p.innerHTML="Could not connect to the service. Please check your connection and try again later."})})).catch(e=>{console.log(e),p.innerHTML="Could not connect to the service. Please check your connection and try again later."})}),e.exports={show:function(e){y=e.eStructCalcs,o.style.display=n.hasElecStructureData()?"block":"none",d.style.display=n.hasThermalData()?"block":"none",function(e){h.innerHTML="";let t=n.getMaterialData().material_id;if(m.textContent=t,null===e)r.disabled=!1,h.style.display="none";else switch(r.disabled=!0,h.style.display="block",h.appendChild(f("Choose the subcategory *","")),e){case i.MAT_VIEW.structure:r.selectedIndex=1,h.appendChild(f("Structure representation")),h.appendChild(f("Calculation tree")),h.appendChild(f("Summary")),h.appendChild(f("Specific calculation"));break;case i.MAT_VIEW.electronicstruct:r.selectedIndex=2,h.appendChild(f("Calculation tree")),h.appendChild(f("Summary")),h.appendChild(f("Band structure")),h.appendChild(f("DOS")),h.appendChild(f("Brillouin zone"));break;case i.MAT_VIEW.methodology:r.selectedIndex=3,h.style.display="none";break;case i.MAT_VIEW.thermalprops:r.selectedIndex=4,h.appendChild(f("Calculation tree")),h.appendChild(f("Phonon dispersion")),h.appendChild(f("Phonon DOS")),h.appendChild(f("Specific heat")),h.appendChild(f("Helmholtz free energy"))}}(e.pageId);let t=l.getBoundingClientRect(),s=(window.innerWidth-t.width)/2,c=(window.innerHeight-t.height)/2;l.style.left=s+"px",l.style.top=c-20+"px",l.style.visibility="visible",a.style.visibility="visible"},hide:v}},function(e,t,s){"use strict";var i=new Map,n=-1;e.exports={subscribe:function(e,t){if("function"!=typeof t)return!1;i.has(e)||i.set(e,new Map);var s="uid_"+String(++n);return i.get(e).set(s,t),s},publish:function(e,t){return!!(i.has(e)&&i.get(e).size>0)&&(setTimeout((function(){i.get(e).forEach((function(e,s){e(t)}))}),0),!0)}}},function(e,t,s){"use strict";let i=s(4),n=new Map;window.addEventListener("hashchange",r);var a=[window.location.hash],l=window.history.length;function r(){var e=window.location.hash,t=window.history.length;a.length&&l==t?a[a.length-2]==e?(a=a.slice(0,-1),i.reset(),window.allowNewLoadPopup=!1):(window.allowNewLoadPopup=!0,a.push(e)):(window.allowNewLoadPopup=!0,a.push(e),l=t);let s,r,o,d=document.location.hash.substring(2);d.lastIndexOf("/")===d.length-1&&(d=d.substring(0,d.length-1));let h=d.indexOf("&state");if(-1!=h&&(d=d.substring(0,h)),d.indexOf("/")>0){let e=d.split("/");s=e[0],r=e[1],o=e[2]}else s=d;n.has(s)&&n.get(s)(r,o)}e.exports={add:function(e,t){n.set(e,t)},route:r}},function(e,t,s){"use strict";let i=s(0),n=s(3),a=s(4),l=s(8),r=s(11),o=s(12),d=(s(10),s(2)),h=s(22).SimilarityFinder;e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","overview"),this.materialId;this.calcMaterialId=null,this.element.innerHTML='\n\n <div class="material-title">\n </div>\n\n <div style="float: left; width: 40%;">\n\n <div id="structure-ov" class="view-box">\n <div class="title">Structure\n <img style="float: right" class="to-detail" src="img/more.svg" />\n <div style="clear: both;"></div>\n </div>\n\n <div class="viz-box-container" style="height: 260px; position: relative">\n <div class="viz-box" style="height: 90%"></div>\n </div>\n\n <div class="footer">\n <div ><b><span>Material type</span></b>:\n <span class="material-type-field" ></span>\n </div>\n <div class="space-group-field" style="display: none">\n <b><span info-sys-data="space-group">Space group</span></b>:\n <span class="space-group-value" ></span>\n </div>\n <div class="structure-type-field" style="display: none">\n <b><span info-sys-data="structure-type">Structure type</span></b>:\n <span class="structure-type-value" ></span>\n </div>\n </div>\n </div>\n\n\n\x3c!-- ***** Elastic Constants Box\n\n <div id="elastic-ov" class="view-box">\n <div class="title">Elastic constants\n <img style="float: right" class="to-detail" src="img/more.svg" />\n <div style="clear: both;"></div>\n </div>\n\n <div class="info-fields">\n Not analyzed yet\n </div>\n\n </div>\n--\x3e\n\n\n <div id="methodology-ov" class="view-box">\n <div class="title">Methodology\n <img style="float: right" class="to-detail" src="img/more.svg" />\n <div style="clear: both;"></div>\n </div>\n\n <div class="info-fields">\n\n <div class="info-fields-label" > Available calculations </div>\n\n <div style="float: left; width: 45%" >\n <b><span info-sys-data="functional-type">Functional</span></b>\n <div class="functional-field" > </div>\n </div>\n <div style="float: right; width: 45%" >\n <b><span info-sys-data="code-name">Code</span></b>\n <div class="code-field"> </div>\n </div>\n <div style="clear: both;"></div>\n </div>\n\n </div>\n\n </div>\n\n <div style="float: right; width: 60%;">\n\n <div id="e-structure-ov" class="view-box" style="display: block">\n <div class="title">Electronic structure\n <img style="float: right" class="to-detail" src="img/more.svg" />\n <div style="clear: both;"></div>\n </div>\n\n <div > \x3c!-- style="margin: 12% 0; " --\x3e\n\n <div style="float: left; width: 60%; ">\n <div style="padding: 20px 0 20px 30px">\n <div class="info-fields-label">\n <span info-sys-data="band-structure">Band structure</span>\n </div>\n <div>\n <div id="band-plotter" > </div>\n </div>\n\n <div class="footer-bs-calc"></div>\n </div>\n </div>\n\n <div style="float: left; width: 40%; ">\n <div style="padding: 20px 30px 20px 40px">\n <div class="info-fields-label">\n <span info-sys-data="DOS">DOS</span>\n </div>\n\n <div>\n <div id="dos-plotter" > </div>\n </div>\n <div class="footer-dos-calc"></div>\n </div>\n </div>\n\n\n\n <div style="clear: both;"></div>\n <table style="width: 100%">\n <tr>\n <td class="spin-legend" style="font-size: 0.9em; padding: 6px 30px 10px; display: none;">\n <svg width="15px" height="10px"> <polyline points="0,5 15,5" class="plotSpin1"/></svg>\n Spin <span style=\'font-size: 1.1em\'>⇧</span> \n\n <svg width="15px" height="10px"> <polyline points="0,5 15,5" class="plotSpin2"/></svg>\n Spin <span style=\'font-size: 1.1em\'>⇩</span>\n </td>\n <td class = "similarity-data-field">\n <div style="float: right; padding: 0px 50px 10px 0px; margin-top: 1px;" class="similarity-finder">\n </div>\n </td>\n </tr>\n </table>\n </div>\n <div style="clear: both;"></div>\n \x3c!--\n <div class="footer">\n\n <b>Band gap</b>: <span class="e-struct-field" ></span>\n </div>\n --\x3e\n </div>\n\n <div id="thermal-props-ov" class="view-box" style="visibility: hidden">\n <div class="title">Vibrational and thermal properties\n <img style="float: right" class="to-detail thermal-props" src="img/more.svg" />\n <div style="clear: both;"></div>\n </div>\n\n <div style="padding: 36px; ">\n <div class="info-fields-label">\n <span info-sys-data="heat-capacity-cv">Specific heat</span>\n </div>\n\n\n <div>\n <div id="heat-plotter" > </div>\n </div>\n <div class="footer-heat-calc" style="text-align: center"></div>\n </div>\n\n </div>\n\n </div>\n\n <div style="clear: both;"></div>\n ',this.materialTitle=this.element.getElementsByClassName("material-title")[0],this.systemType=this.element.querySelector(".material-type-field"),this.spaceGroupField=this.element.querySelector(".space-group-field"),this.spaceGroupValue=this.element.querySelector(".space-group-value"),this.structTypeField=this.element.querySelector(".structure-type-field"),this.structTypeValue=this.element.querySelector(".structure-type-value"),this.functional=this.element.querySelector(".functional-field"),this.code=this.element.querySelector(".code-field");let e=this.element.getElementsByClassName("to-detail");this.structureDetailBtn=e[0],this.electronicStructDetailBtn=e[2],this.methodologyDetailBtn=e[1],this.thermalDetailBtn=e[3],this.vizBox=this.element.getElementsByClassName("viz-box")[0],this.bandPlotter=null,this.bsCalcIdBox=this.element.getElementsByClassName("footer-bs-calc")[0],this.dosPlotter=null,this.dosCalcIdBox=this.element.getElementsByClassName("footer-dos-calc")[0],this.heatPlotter=null,this.heatCalcIdBox=this.element.querySelector(".footer-heat-calc"),this.spinLegend=this.element.querySelector(".spin-legend"),n.addToInfoSystem(this.element),this.eStructCalcs={bs:null,dos:null}}attachAndSetEvents(e){e.appendChild(this.element),this._events()}_events(){this.structureDetailBtn.addEventListener("click",e=>{i.setBrowserHashPath("material",this.materialId+"/"+i.MAT_VIEW.structure)}),this.electronicStructDetailBtn.addEventListener("click",e=>{i.setBrowserHashPath("material",this.materialId+"/"+i.MAT_VIEW.electronicstruct)}),this.methodologyDetailBtn.addEventListener("click",e=>{i.setBrowserHashPath("material",this.materialId+"/"+i.MAT_VIEW.methodology)}),this.thermalDetailBtn.addEventListener("click",e=>{i.setBrowserHashPath("material",this.materialId+"/"+i.MAT_VIEW.thermalprops)})}getEStructChosenCalcs(){return this.eStructCalcs}setDetailViewsListener(e){this.detailViewsListener=e}setVisible(){this.element.style.display="block"}setMaterialData(){let e=d.getMaterialData();this.materialTitle.innerHTML=i.getMaterialTitle(e),this.materialId=e.material_id;let t="bulk"===e.material_type;if(this.systemType.textContent=e.material_type,this.structTypeField.style.display=t&&null!==e.structure_type?"block":"none",this.spaceGroupField.style.display=t?"block":"none",t&&(this.structTypeValue.textContent=e.structure_type,this.spaceGroupValue.textContent=e.space_group_number+" ("+e.space_group_international_short_symbol+")",n.addElementToInfoSystem(this.spaceGroupValue,"space-group.value:"+e.space_group_number)),this.similarityFinder&&this.similarityFinder.element.remove(),e.similarity){this.similarityFinder=new h({left:40,right:16,top:0,bottom:30});const t=this.element.querySelector(".similarity-finder");this.similarityFinder.setSimilarityData(e.similarity),t.appendChild(this.similarityFinder.element),this.similartyDataField=this.element.querySelector(".similarity-data-field"),n.addToInfoSystem(this.similartyDataField)}}isLoaded(e,t,s){let i=d.getMaterialData().material_id;return this.calcMaterialId===i&&(!(e&&!this.bsLoaded)&&(!(t&&!this.dosLoaded)&&!(s&&!this.phononLoaded)))}setCalcsData(e){let t=d.getMaterialData(),s=d.getCalculations(),h=new Map,c=new Map,p=d.getCalc(d.getRepresentatives().electronic_band_structure),u=d.getCalc(d.getRepresentatives().electronic_dos),m=d.getCalc(d.getRepresentatives().thermodynamical_properties);if(this.isLoaded(void 0!==p,void 0!==u,void 0!==m))return;this.calcMaterialId=t.material_id,this.bsLoaded=!1,this.dosLoaded=!1,this.phononLoaded=!1;for(let e=0;e<s.length;e++){if(h.has(s[e].functional_type)){let t=h.get(s[e].functional_type);h.set(s[e].functional_type,++t)}else h.set(s[e].functional_type,1);let t=s[e].code_name.trim();if(c.has(t)){let e=c.get(t);c.set(t,++e)}else c.set(t,1)}void 0!==p&&(this.eStructCalcs.bs=p.calc_id),void 0!==u&&(this.eStructCalcs.dos=u.calc_id);let y=null;void 0!==p?y=p.calc_id:void 0!==u&&(y=u.calc_id),e.eStruct=null===y?null:+y,e.thermalProps=void 0===m?null:+m.calc_id,this.functional.textContent="";let v=document.createElement("div");h.forEach((e,t)=>{let s=document.createElement("span");s.setAttribute("info-sys-data","functional-type.value:"+i.getDefault(t)),s.textContent=e+" "+i.getDefault(t),v.appendChild(s);let n=document.createElement("br");v.appendChild(n)}),this.functional.append(v),n.addToInfoSystem(this.functional),this.code.textContent="";let f=document.createElement("div");if(c.forEach((e,t)=>{let s=document.createElement("span");s.setAttribute("info-sys-data","code-name.value:"+t),s.textContent=e+" "+t,f.appendChild(s);let i=document.createElement("br");f.appendChild(i)}),this.code.append(f),n.addToInfoSystem(this.code),d.hasElecStructureData()){document.getElementById("e-structure-ov").style.display="block";let e=()=>{this.dosLoaded&&this.bsLoaded&&(document.getElementById("e-structure-ov").style.visibility="visible")};if(null===this.bandPlotter&&(this.bandPlotter=new l,this.bandPlotter.attach(document.getElementById("band-plotter"),void 0,316)),null===this.dosPlotter&&(this.dosPlotter=new r({left:40,right:20,top:0,bottom:30}),this.dosPlotter.attach(document.getElementById("dos-plotter"),void 0,317)),void 0===p)this.bandPlotter.setNoData(),this.bsCalcIdBox.innerHTML="",this.bsLoaded=!0;else{let t=i.getMaterialCalcURL(this.materialId,p.calc_id);a.show("overview_electronic_band_structure");let s=JSON.stringify({properties:["electronic_band_structure"]});i.serverReqPOST(t,s,t=>{if(200===t.target.status){let s=JSON.parse(t.target.response).electronic_band_structure;this.bandPlotter.setBandStructureData(s),this.bsCalcIdBox.innerHTML="From calculation <b>"+i.getShortCode(p.calc_id)+'</b><br><span style="font-size: 0.8em">('+p.functional_type+" - "+p.code_name+")</span>",2===s.section_k_band_segment[0].band_energies.length&&(this.spinLegend.style.display="block"),this.bsLoaded=!0,e()}a.hide("overview_electronic_band_structure")})}if(void 0===u)this.dosPlotter.setNoData(),this.dosCalcIdBox.innerHTML="",this.dosLoaded=!0;else{let t=i.getMaterialCalcURL(this.materialId,u.calc_id);a.show("overview_electronic_dos");let s=JSON.stringify({properties:["electronic_dos"]});i.serverReqPOST(t,s,t=>{if(200===t.target.status){let s=JSON.parse(t.target.response).electronic_dos;this.dosPlotter.setPoints(s,u),this.dosCalcIdBox.innerHTML="From calculation <b>"+i.getShortCode(u.calc_id)+'</b><br><span style="font-size: 0.8em">('+u.functional_type+" - "+u.code_name+")</span>",2===s.dos_values.length&&(this.spinLegend.style.display="block"),this.dosLoaded=!0,e()}a.hide("overview_electronic_dos")})}}if(d.hasThermalData())if(document.getElementById("thermal-props-ov").style.display="block",null===this.heatPlotter&&(this.heatPlotter=new o,this.heatPlotter.attach(document.getElementById("heat-plotter"),void 0,317)),void 0===m)this.heatPlotter.setNoData(),this.heatCalcIdBox.innerHTML="";else{let e=i.getMaterialCalcURL(this.materialId,m.calc_id);a.show();let t=JSON.stringify({properties:["thermodynamical_properties"]});i.serverReqPOST(e,t,e=>{if(200===e.target.status){let t=JSON.parse(e.target.response).thermodynamical_properties,s=t.thermodynamical_property_temperature;this.heatPlotter.setData(s,t.specific_heat_capacity),this.heatCalcIdBox.innerHTML="From calculation <b>"+i.getShortCode(m.calc_id)+'</b></b> <span style="font-size: 0.8em">('+m.functional_type+" - "+m.code_name+")</span>",this.phononLoaded=!0,document.getElementById("thermal-props-ov").style.visibility="visible"}a.hide()})}else document.getElementById("thermal-props-ov").style.display="none"}}},function(e,t,s){s(0);e.exports=class{constructor(e){this.off=!0,this.element=document.createElement("span"),this.element.innerHTML+=`\n <img src="${e}_off.png" width="24px"\n style="margin-bottom: -1px; cursor: pointer"/>\n `,this.image=this.element.querySelector("img"),this.element.addEventListener("click",t=>{this.off=!this.off;let s=this.off?e+"_off":e;this.image.setAttribute("src",s+".png"),this.listener(this.off)})}setListener(e){this.listener=e}}},function(e,t,s){let i=s(0);e.exports={SimilarityFinder:class{constructor(){this.folded=!0,this.element=document.createElement("span"),this.element.style="float : right; border: 2px solid #DDD; padding: 2px 2px 0px 3px;",this.element.innerHTML+=`\n <span info-sys-data="similar-materials" style="vertical-align: 30%;">Similar materials</span>\n <img style="cursor: pointer" src="${i.IMAGE_DIR}folded.png" />\n\n <div class="vr-download-panel" style="position: relative; display: none;">\n\n </div>\n `,this.element.tabIndex="0",this.element.style.outline="none",this.foldingPanel=this.element.querySelector(".vr-download-panel"),this.foldBtn=this.element.querySelector("img"),this.foldBtn.addEventListener("click",e=>{this.folded=!this.folded,this.foldBtn.src=this.folded?i.IMAGE_DIR+"folded.png":i.IMAGE_DIR+"unfolded.png",this.foldingPanel.style.display=this.folded?"none":"block"}),this.element.addEventListener("blur",e=>{setTimeout(()=>{this.folded=!0,this.foldBtn.src=i.IMAGE_DIR+"folded.png",this.foldingPanel.style.display="none"},300)})}setSimilarityData(e){e.sort((function(e,t){return e.value<t.value?1:e.value>t.value?-1:0}));const t=e.slice(0,5),s=document.createElement("table");s.setAttribute("class","similar-materials-panel-unfolded"),s.style="width: 230px; padding-left: 5px;",this.foldingPanel.appendChild(s);const n=document.createElement("tr");n.style="padding: 5px; ",n.innerHTML='<th style = "text-align: left;">Formula (space group)</th><th>:</th><th style = "text-align: left;">Tc</th>',s.appendChild(n),t.forEach((function(e){const t=document.createElement("tr");t.style="padding: 5px; font-family: 'Arimo', sans-serif; font-size: 10pt; ";const n=`${window.location.toString().replace(/#.*$/,"")}#/material/${e.material_id}`;t.innerHTML=`<td><a href="${n}" target="_${e.material_id}" style="color:#777; font-family: 'Arimo', sans-serif; font-size: 10pt;">${i.getSubscriptedFormula(e.formula)} (${e.space_group_number})</a></td><td>:</td> <td>${e.value.toPrecision(3)}</td>`,s.appendChild(t)}))}}}},function(e,t,s){"use strict";let i=s(6),n=s(0),a=s(3),l=s(7),r=s(13),o=s(14),d=s(24),h=s(2);class c{constructor(e){this.groupCalcs=null,this.element=document.createElement("div"),this.element.innerHTML='\n <div>\n\n <div class="group-components" style="display: none">\n <div style="padding: 10px 0 30px 10px; " class="eos-host">\n </div>\n\n <div style="padding-top: 10px; " class="calc-selector-host">\n </div>\n </div>\n\n <div class="info-fields">\n <div><b>Lattice constants</b></div>\n <div class="latt-constants"></div>\n <div class="volume-field"><b><span info-sys-data="cell-volume">Volume</span></b>:\n <span class="volume-value" ></span>\n </div>\n \x3c!-- <div><b>Pressure</b>: <span class="" ></span> </div>--\x3e\n <div class="density-field"><b>Density</b>:\n <div class="stats-fields" >\n <span info-sys-data="mass-density">Mass density</span> =\n <span class="mass-density-value" ></span>\n </div>\n <div class="stats-fields" >\n <span info-sys-data="atomic-density">Atomic density</span> =\n <span class="atomic-density-value" ></span>\n </div>\n </div>\n\n <div class="energy-field"><b><span info-sys-data="energies">Energies</span></b> (code-specific)</div>\n <div class="energy-descomp"> </div>\n\n <div class="wyckoff-pos-calc-field" >\n <b><span info-sys-data="free-wyckoff-parameters">Wyckoff sites</span></b>\n (fractional coordinates)\n <div class="wyckoff-pos-calc-table"> </div>\n </div>\n\n </div>\n\n </div>\n ',this.groupComponents=this.element.querySelector(".group-components"),this.calcSelector=new r("calc-selector-bar","60%"),this.element.querySelector(".calc-selector-host").appendChild(this.calcSelector.element),this.lattConstantsField=this.element.querySelector(".latt-constants"),this.volumeField=this.element.querySelector(".volume-field"),this.volumeValue=this.element.querySelector(".volume-value"),this.densityField=this.element.querySelector(".density-field"),this.massDensityValue=this.element.querySelector(".mass-density-value"),this.atomicDensityValue=this.element.querySelector(".atomic-density-value"),this.energyField=this.element.querySelector(".energy-field"),this.energyDescompValue=this.element.querySelector(".energy-descomp"),this.wyckoffPosField=this.element.querySelector(".wyckoff-pos-calc-field"),this.wyckoffPosTable=this.element.querySelector(".wyckoff-pos-calc-table"),this.eosViewer=new d,this.eosViewer.attach(this.element.querySelector(".eos-host"),320,280),this.eosViewer.setClickPointListener(e=>{this.groupCalcUpdate(e+"")}),a.addToInfoSystem(this.element),this._events()}_events(){this.calcSelector.setPrevListener(e=>{if(this.groupIndex>0)return this.groupCalcUpdate(this.groupCalcs[--this.groupIndex]+""),0===this.groupIndex}),this.calcSelector.setNextListener(e=>{if(this.groupIndex<this.groupCalcs.length-1)return this.groupCalcUpdate(this.groupCalcs[++this.groupIndex]+""),this.groupIndex===this.groupCalcs.length-1})}update(e,t){if(this.representative=e,this.isGroup=t,t){let t=h.getGroupType(e),s=h.getGroupId(e),i=h.getMaterialData().material_id,a=n.serverReq(n.getMaterialGroupURL(i,t,s),()=>{if(200===a.status){let e=JSON.parse(a.response),t=e.volumes.map(e=>e/1e-30),s=e.energies.map(e=>e/1602176565e-28),i=e.calculations,n=s[0];this.groupCalcs=i,this.groupIndex=0,this.groupComponents.style.display="block",this.eosViewer.clear(),this.eosViewer.draw(t,s,this.groupCalcs,n),this.groupCalcUpdate(i[0])}})}else this.groupComponents.style.display="none",this.groupCalcUpdate(e)}groupCalcUpdate(e){if(null!==e){if(null!==this.groupCalcs&&(this.groupIndex=this.groupCalcs.indexOf(e),this.groupIndex>=0)){let t=n.getShortCode(e)+" ("+(this.groupIndex+1)+"/"+this.groupCalcs.length+")";this.calcSelector.setState(t,0===this.groupIndex,this.groupIndex===this.groupCalcs.length-1),this.eosViewer.selectCalc(e)}let t=h.getMaterialData(),s=t.material_id,i="2D"===t.material_type,a="bulk"===t.material_type,l=(h.getCalc(e),h.getMaterialData().has_free_wyckoff_parameters),r=["energies","lattice_parameters","mass_density","atomic_density","cell_volume"];l&&r.push("wyckoff_sets");let o=JSON.stringify({properties:r}),d=n.serverReqPOST(n.getMaterialCalcURL(s,e),o,()=>{if(200===d.status){let e=JSON.parse(d.response),t=e.lattice_parameters,s=i||a?`<div>b = ${n.m2Angstrom(t.b)}</div>`:"";s+=a?`<div>c = ${n.m2Angstrom(t.c)}</div>`:"";let r=a?`<div>α = ${n.rad2degree(t.alpha)}</div>\n <div>β = ${n.rad2degree(t.beta)}</div>`:"";r+=i||a?`<div>γ = ${n.rad2degree(t.gamma)}</div>`:"",this.lattConstantsField.innerHTML=`\n <div style="float: left; ">\n <div>a = ${n.m2Angstrom(t.a)}</div>\n ${s}\n </div>\n <div style="float: left; padding-left: 40px;">\n ${r}\n </div>\n <div style="clear: both;padding: 0"></div>\n `,this.densityField.style.display=a?"block":"none",this.volumeField.style.display=a?"block":"none",a&&(this.volumeValue.innerHTML=n.m3ToAngstrom3(e.cell_volume),this.atomicDensityValue.innerHTML=n.toAngstromMinus3(e.atomic_density),this.massDensityValue.innerHTML=e.mass_density.toFixed(1)+" kg/m<sup>3</sup>");let o=!1,h=e.energies;if(void 0!==h){let e=h.energy_total;void 0!==e&&(o=!0,this.energyDescompValue.innerHTML="<div>Total E = "+n.J2eV(e)+" eV</div>")}if(this.energyField.style.display=o?"block":"none",this.energyDescompValue.style.display=o?"block":"none",this.wyckoffPosField.style.display=l?"block":"none",l){let t=new Map;e.wyckoff_sets.forEach(e=>{let s="",i=!1,n=e.variables;if(void 0!==n&&(i=!0,["x","y","z"].forEach(e=>{if(e in n){let t=n[e];s+=e+" = "+t.toFixed(2)+"<br>"}})),i){let i=[];i.push(e.wyckoff_letter),i.push(s),t.has(e.element)?t.get(e.element).push(i):t.set(e.element,[i])}});let s="";t.forEach((e,t)=>{e.sort((e,t)=>e[0]>t[0]?1:-1);let i=!0;s+='<tr > <td style="width: 30%;">'+t+" </td>",e.forEach(e=>{i?(i=!1,s+='<td style="width: 30%; ">'+e[0]+'</td><td style="width: 40%;">'+e[1]+"</td></tr>"):s+="<tr><td> </td><td>"+e[0]+"</td><td>"+e[1]+"</td></tr>"})}),this.wyckoffPosTable.innerHTML='<table id="calc-wyckoff">'+s+"</table>"}}})}}}class p{constructor(e){this.calcMapByFunctional=null,this.quantitiesMap=null,this.hostElement=e,this.graphTrigger=null,this.viewType="text",this.functional=null,this.nBins=15,this.hostElement.innerHTML+='\n <div style="float: left" >\n <svg xmlns="http://www.w3.org/2000/svg" class="chart-tab"\n viewBox="0 0 15 15" width="15" height="15" style="fill: #c7c7c7;">\n <rect x="0" y="0" width="2" height="15" />\n <rect x="3" y="5" width="1.8" height="7" />\n <rect x="6" y="3" width="1.8" height="9" />\n <rect x="9" y="6" width="1.8" height="6" />\n <rect x="12" y="2" width="1.8" height="10" />\n <rect x="2" y="13" width="13" height="2" />\n </svg>\n <svg xmlns="http://www.w3.org/2000/svg" class="text-tab"\n viewBox="0 0 15 15" width="15" height="15" style="fill: #777;">\n <rect x="0" y="1" width="15" height="2.5" />\n <rect x="0" y="6" width="15" height="2.5" />\n <rect x="0" y="11" width="15" height="2.5" />\n </svg>\n </div>\n\n <div class="functional-tabs" style="float: right">\n </div>\n\n <div style="clear: both;"></div>\n\n <div class="content-placeholder" >\n\n <div style="display: block" class="text-panel" >\n <div><b>Lattice constants</b>:\n <div class="stats-fields latt-constants-field" >\n </div>\n </div>\n <div class="volume-field"><b><span info-sys-data="cell-volume">Volume</span></b> (Å<sup>3</sup>):\n <div class="stats-fields volume-value" > </div>\n </div>\n <div class="density-field"><b>Density</b> :\n <div >\n <div class="stats-fields" >\n <span info-sys-data="mass-density">Mass density</span> (kg/m<sup>3</sup>) =\n <span class="mass-density-value" ></span>\n </div>\n <div class="stats-fields" >\n <span info-sys-data="atomic-density">Atomic density</span> (Å<sup>-3</sup>) =\n <span class="atomic-density-value" ></span>\n </div>\n </div>\n </div>\n </div>\n\n <div style="display:none" class="chart-panel" >\n <div class="charts-placeholder" > </div>\n <div class="charts-selector" >\n\n </div>\n </div>\n\n </div>\n ',this.chartTab=this.hostElement.querySelector(".chart-tab"),this.textTab=this.hostElement.querySelector(".text-tab"),this.functionalTabs=this.hostElement.querySelector(".functional-tabs"),this.chartPanel=this.hostElement.querySelector(".chart-panel"),this.textPanel=this.hostElement.querySelector(".text-panel"),this.lattConstantsField=this.hostElement.querySelector(".latt-constants-field"),this.volumeField=this.hostElement.querySelector(".volume-field"),this.volumeFieldValue=this.hostElement.querySelector(".volume-value"),this.densityField=this.hostElement.querySelector(".density-field"),this.massDensityValue=this.hostElement.querySelector(".mass-density-value"),this.atomicDensityValue=this.hostElement.querySelector(".atomic-density-value"),this.statsViewer=new o;let t=this.hostElement.querySelector(".charts-placeholder");this.statsViewer.attach(t,350,200),this.chartsSelector=this.hostElement.querySelector(".charts-selector"),this.chartTab.addEventListener("click",e=>{this.chartTab.style.fill="#777",this.viewType="chart",this.textTab.style.fill="#c7c7c7",this.chartPanel.style.display="block",this.textPanel.style.display="none"}),this.textTab.addEventListener("click",e=>{this.textTab.style.fill="#777",this.viewType="text",this.chartTab.style.fill="#c7c7c7",this.textPanel.style.display="block",this.chartPanel.style.display="none"}),this.functionalTabs.addEventListener("click",e=>{"tab"===e.target.className&&(this.statsViewer.clear(),this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]').className="tab",this.functional=e.target.getAttribute("data-tab"),this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]').className="tab-selected",this._setData())}),this.chartsSelector.addEventListener("click",e=>{if(0===e.target.className.indexOf("quantity")){this.statsViewer.clear();let t=e.target.getAttribute("data-quantity"),s=this.quantitiesMap.get(t),i=s.label,n=s.stats;this.statsViewer.drawPoints(n.histogram,i,this.nBins),this.chartsSelector.querySelector(".quantity-selected").className="quantity",e.target.className="quantity-selected"}})}_setData(){let e="2D"===h.getMaterialData().material_type,t="bulk"===h.getMaterialData().material_type,s=(this.functional,Array.from(this.calcMapByFunctional.get(this.functional))),i=h.getMaterialData().material_id,a=new Map;a.set("lattice_a",{label:"a (Å)"}),e|t&&(a.set("lattice_b",{label:"b (Å)"}),a.set("gamma",{label:"&gamma"})),t&&(a.set("cell_volume",{label:"Volume (ų)"}),a.set("atomic_density",{label:"Atomic density (Å⁻³)"}),a.set("mass_density",{label:"Mass density (kg/m³)"}),a.set("lattice_c",{label:"c ()"}),a.set("alpha",{label:"&alpha"}),a.set("beta",{label:"&beta"}));let l=JSON.stringify({calculations:s,properties:Array.from(a.keys()),n_histogram_bins:this.nBins});n.serverReqPOST(n.getMaterialStatsURL(i),l,s=>{let i=JSON.parse(s.target.response);for(let e of a.keys()){let t=i[e];"cell_volume"==e?(t.min*=1e30,t.avg*=1e30,t.max*=1e30,t.histogram.values=t.histogram.values.map(e=>1e30*e)):"atomic_density"==e?(t.min*=1e-30,t.avg*=1e-30,t.max*=1e-30,t.histogram.values=t.histogram.values.map(e=>1e-30*e)):e.startsWith("lattice_")&&(t.min*=1e10,t.avg*=1e10,t.max*=1e10,t.histogram.values=t.histogram.values.map(e=>1e10*e));let s=a.get(e).label;t.equal=t.min===t.max;let l=s.split(":");t.label=l[0],2===l.length?t.units=l[1]:t.units="";let r,o=3;"mass_density"===e&&(o=1),r="alpha"==e||"beta"==e||"gamma"==e?n.rad2degree(t.avg.toFixed(o)):t.avg.toFixed(o)+' <span style="font-size: 0.9em">['+t.min.toFixed(o)+" , "+t.max.toFixed(o)+"]</span>",a.get(e).html=r,a.get(e).stats=t}let l=e||t?`<div>b (Å) = ${a.get("lattice_b").html}</div>`:"";l+=t?`<div>c (Å) = ${a.get("lattice_c").html}</div>`:"";let r=t?`<div>α = ${a.get("alpha").html}</div>\n <div>β = ${a.get("beta").html}</div>`:"";r+=e||t?`<div>γ = ${a.get("gamma").html}</div>`:"",this.lattConstantsField.innerHTML=`\n <div style="float: left; ">\n <div>a (Å) = ${a.get("lattice_a").html}</div>\n ${l}\n </div>\n <div style="float: left; padding-left: 40px;">\n ${r}\n </div>\n <div style="clear: both;padding: 0"></div>\n `;let o='\n <span class="quantity-selected" data-quantity="lattice_a">a</span>\n ';(e||t)&&(o+='<span class="quantity" data-quantity="lattice_b">b</span>'),this.densityField.style.display=t?"block":"none",this.volumeField.style.display=t?"block":"none",t&&(this.volumeFieldValue.innerHTML=a.get("cell_volume").html,this.massDensityValue.innerHTML=a.get("mass_density").html,this.atomicDensityValue.innerHTML=a.get("atomic_density").html,o+='\n <span class="quantity" data-quantity="lattice_c">c</span>\n <span class="quantity" data-quantity="cell_volume">volume</span>\n <span class="quantity" data-quantity="mass_density">mass density</span>\n <span class="quantity" data-quantity="atomic_density">atomic density</span>\n '),this.chartsSelector.innerHTML=o,this.quantitiesMap=a;let d=i.lattice_a.histogram;this.statsViewer.drawPoints(d,a.get("lattice_a").label,this.nBins)})}build(e){this.calcMapByFunctional=e,this.graphTrigger=null,this.statsViewer.clear(),this.unfoldedElement=null,this.functionalQuantityMap=new Map,this.functionalTabs.innerHTML="",this.calcMapByFunctional.forEach((e,t)=>{this.functionalTabs.innerHTML+='<span class="tab" data-tab="'+t+'">'+t+"</span>"});let t=Array.from(this.calcMapByFunctional.keys());(null===this.functional||t.indexOf(this.functional)<0)&&(this.functional=t[0]),this._setData(),this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]').className="tab-selected",a.addToInfoSystem(this.hostElement)}}e.exports=class extends i{constructor(){super("Structure"),this.navTree=new l,this.groupsData,this.element.innerHTML+='\n\n <div style="float: left; width: 36%;">\n <div class="view-box">\n <div class="title">Structure </div>\n <div class="viz-box-container" style="height: 400px; position: relative">\n <div class="viz-box" style="height: 90%"></div>\n </div>\n\n <div class="footer-flex-wrapper">\n\n <div class="fields-container">\n <div><b><span>System type</span></b>:\n <span class="struct-field" ></span>\n </div>\n <div class="structure-type-field" style="display: none">\n <b><span info-sys-data="structure-type">Structure type</span></b>:\n <span class="structure-type-value" ></span>\n </div>\n <div class="structure-prototype-field" style="display: none">\n <b><span info-sys-data="structure-prototype">Structure prototype</span></b>:\n <span class="structure-prototype-value" ></span>\n </div>\n <div class="strukturbericht-field" style="display: none">\n <b><span info-sys-data="strukturbericht">Strukturbericht designation</span></b>:\n <span class="strukturbericht-value" ></span>\n </div>\n </div>\n\n <div class="footer-flex" style="display: none">\n\n <div class="fields-container"\n style="flex-basis: 70%; border-right: 1px solid #E4E4E4; ">\n\n <div>\n <b><span info-sys-data="crystal-system">Lattice</span></b>:\n <span class="lattice-value" ></span>\n </div>\n <div>\n <b><span info-sys-data="space-group">Space group</span></b>:\n <span class="space-group-value" ></span>\n </div>\n <div>\n <b><span info-sys-data="point-group">Point group</span></b>:\n <span class="point-group-value" ></span>\n </div>\n </div>\n\n <div style="flex-basis: 30%; margin-left: 30px;">\n <div class="fields-container">\n <div><b><span info-sys-data="wyckoff-position-population">Wyckoff sites</span></b></div>\n <div class="wyckoff-sites-value"> </div>\n </div>\n </div>\n\n </div>\n\n </div>\n\n </div>\n </div>\n\n <div style="float: left; width: 36%;">\n <div class="view-box">\n <div class="title">Calculations</div>\n <div class="navTreeWrapper"></div>\n\n <div class="summary-title">Summary </div>\n <div style="font-size: 0.85em; text-align: center; padding: 4px;">Based on the calculations selected above</div>\n\n <div class="info-fields summary-box">\n \x3c!-- Lattice constants Cell volume, Density panel dynamically generated\n --\x3e\n </div>\n </div>\n </div>\n\n <div style="float: right; width: 28%;">\n <div class="calc-specifics-box">\n <div style="padding-top: 10px; " >\n <div class="tree-leaf-title"></div>\n </div>\n <div class="tree-leaf-viewer-host"></div>\n </div>\n </div>\n </div>\n </div>\n ',this.navTreeWrapper=this.element.getElementsByClassName("navTreeWrapper")[0];let e=this.element.getElementsByClassName("struct-field");this.systemTypeField=e[0],this.structTypeField=this.element.querySelector(".structure-type-field"),this.structTypeValue=this.element.querySelector(".structure-type-value"),this.structPrototypeField=this.element.querySelector(".structure-prototype-field"),this.structPrototypeValue=this.element.querySelector(".structure-prototype-value"),this.strukturberichtField=this.element.querySelector(".strukturbericht-field"),this.strukturberichtValue=this.element.querySelector(".strukturbericht-value"),this.lowerBox=this.element.querySelector(".footer-flex"),this.latticeValue=this.element.querySelector(".lattice-value"),this.spaceGroupValue=this.element.querySelector(".space-group-value"),this.pointGroupValue=this.element.querySelector(".point-group-value"),this.wyckoffValue=this.element.querySelector(".wyckoff-sites-value"),this.summaryByFunctionals=null,this.leafTitle=this.element.querySelector(".tree-leaf-title"),this.summaryBox=this.element.querySelector(".summary-box"),this.summaryByFunctionals=new p(this.summaryBox),this.calcSpecificsBox=this.element.querySelector(".calc-specifics-box"),this.treeLeafViewer=new c,this.element.querySelector(".tree-leaf-viewer-host").appendChild(this.treeLeafViewer.element),this.vizBox=this.element.querySelector(".viz-box"),a.addToInfoSystem(this.element)}setMaterialData(){let e=h.getMaterialData(),t=h.getIdealizedStructure();super.setMaterialData(e);let s=null===e.material_name?e.formula:e.material_name;if(this.navTree.build(s,"structure"),this.navTree.selectAll(),this.navTree.setHeight(250),this.navTree.setMarkedLeafIfNoneMarked(null),this.attachNavTree(this.navTree),this.updateSelection(this.navTree.getTreeSelectedCalcs()),this.updateMarkedLeaf(this.navTree.getMarkedLeaf()),this.navTree.setTreeSelectionListener(e=>{this.updateSelection(e)}),this.navTree.setLeafMarkedListener(e=>{this.updateMarkedLeaf(e)}),this.isBulk="bulk"===e.material_type,this.systemTypeField.textContent=e.material_type,this.structTypeField.style.display=this.isBulk&&null!==e.structure_type?"block":"none",this.structPrototypeField.style.display=this.isBulk&&null!==e.structure_prototype?"block":"none",this.strukturberichtField.style.display=this.isBulk&&null!==e.strukturbericht_designation?"block":"none",this.lowerBox.style.display=this.isBulk?"flex":"none",this.isBulk){this.structTypeValue.textContent=e.structure_type,this.structPrototypeValue.textContent=e.structure_prototype,this.strukturberichtValue.textContent=e.strukturbericht_designation,this.spaceGroupValue.textContent=e.space_group_number+" ("+e.space_group_international_short_symbol+")",this.pointGroupValue.textContent=e.point_group,this.latticeValue.textContent=e.crystal_system;let s=new Map;new Set;for(var i=0;i<t.wyckoff_sets.length;i++){let e=t.wyckoff_sets[i],n=e.element;if(s.has(n))s.get(n).add(e.wyckoff_letter);else{let t=new Set;t.add(e.wyckoff_letter),s.set(n,t)}}let n="";s.forEach((e,t)=>{let s=!0;n+="<tr> <td>"+t+": </td>",e.forEach(e=>{s?(s=!1,n+="<td>"+e+"</td></tr>"):n+="<tr><td> </td><td>"+e+"</td></tr>"})}),this.wyckoffValue.innerHTML="<table>"+n+"</table>"}a.addElementToInfoSystem(this.spaceGroupValue,"space-group.value:"+e.space_group_number),a.addElementToInfoSystem(this.latticeValue,"crystal-system.value:"+e.crystal_system),a.addElementToInfoSystem(this.pointGroupValue,"point-group.value:"+e.point_group)}updateSelection(e){if(e.size>0){let t=[];e.forEach(e=>{if(h.isGroup(e)){let s=h.getGroupType(e),i=h.getGroupId(e),n=h.getGroups().get(s).get(i);t.push(h.getCalc(n[0]))}else t.push(h.getCalc(e))}),this.summaryBox.style.visibility="visible";let s=n.getCalcMapByFunctional(t);this.summaryByFunctionals.build(s)}else this.summaryBox.style.visibility="hidden"}updateMarkedLeaf(e){let t=!1;if(null!==e)if(this.calcSpecificsBox.style.visibility="visible",t=h.isGroup(e),t){let t,s=h.getGroupType(e),i=h.getGroupId(e);t=h.getGroups().get(s).get(i),this.leafTitle.innerHTML=n.getShortCode(e)+" ("+t.length+")"}else this.leafTitle.innerHTML=n.getShortCode(e);else this.calcSpecificsBox.style.visibility="hidden";this.treeLeafViewer.update(e,t)}}},function(e,t,s){"use strict";let i=s(0),n=s(1),a=s(5);e.exports=class extends a{constructor(){super({left:60,right:20,top:30,bottom:40}),this.tooltip,this.calcPointMap=new Map,this.pointSelected=null}draw(e,t,s,a){for(let e=0;e<t.length;e++)555!==t[e]&&(t[e]-=a);let l=function(e){let t=[];return e.forEach(e=>{555!==e&&t.push(e)}),t}(t),r=Math.min.apply(null,e),o=Math.max.apply(null,e),d=0,h=Math.max.apply(null,l);if(r===o)r-=1,o+=1;else{let e=o-r;r-=.1*e,o+=.1*e}if(d===h)d-=1,h+=1;else{let e=h-d;d-=.15*e,h+=.1*e}this.setRangeAndLabels("Volume (ų)",r,o,"E - Eₘᵢₙ (eV)",d,h),this.drawAxis(2,2),n.addLine(this.plotArea,0,this.y(0),this.plotRangeX,this.y(0),"zeroline"),n.addText(this.plotArea,this.x(o),this.y(0)+12,"Eₘᵢₙ: "+a.toFixed(3)+" eV","end","axis-steps");for(let a=0;a<e.length;a++){let l=0===a?"eos-viewer-sel":"eos-viewer",r=0===a?6:3,o=555===t[a]?20:this.y(t[a]),d=n.addPoint(this.plotArea,this.x(e[a]),o,r,l);0===a&&(this.pointSelected=d),d.addEventListener("mouseover",e=>{this.tooltip=n.addText(this.plotArea,e.target.getBBox().x+10,e.target.getBBox().y-10,"Calc "+i.getShortCode(s[a]),"middle","tooltip")}),d.addEventListener("mouseout",e=>{n.removeElement(this.tooltip)}),d.addEventListener("click",e=>{this.clickPointListener(s[a])}),this.calcPointMap.set(s[a],d)}}selectCalc(e){this.pointSelected.setAttribute("class","eos-viewer"),this.pointSelected.setAttribute("r",3),this.pointSelected=this.calcPointMap.get(e),this.pointSelected.setAttribute("class","eos-viewer-sel"),this.pointSelected.setAttribute("r",6)}setClickPointListener(e){this.clickPointListener=e}x(e){return this.xRel*(e-this.xMin)}y(e){return-this.yRel*(e-this.yMin)}}},function(e,t,s){"use strict";let i=s(6),n=s(0),a=s(7),l=s(3),r=(s(13),s(14)),o=s(26),d=(new(s(5)),s(2)),h=s(4);class c{constructor(e){this.calcMapByFunctional=null,this.hostElement=e,this.viewType="text",this.functional=null,this.nBins=15,this.hostElement.innerHTML+='\n <div style="float: left" >\n <svg xmlns="http://www.w3.org/2000/svg" class="chart-tab"\n viewBox="0 0 15 15" width="15" height="15" style="fill: #c7c7c7;">\n <rect x="0" y="0" width="2" height="15" />\n <rect x="3" y="5" width="1.8" height="7" />\n <rect x="6" y="3" width="1.8" height="9" />\n <rect x="9" y="6" width="1.8" height="6" />\n <rect x="12" y="2" width="1.8" height="10" />\n <rect x="2" y="13" width="13" height="2" />\n </svg>\n <svg xmlns="http://www.w3.org/2000/svg" class="text-tab"\n viewBox="0 0 15 15" width="15" height="15" style="fill: #777;">\n <rect x="0" y="1" width="15" height="2.5" />\n <rect x="0" y="6" width="15" height="2.5" />\n <rect x="0" y="11" width="15" height="2.5" />\n </svg>\n </div>\n\n <div class="functional-tabs" style="float: right">\n </div>\n\n <div style="clear: both;"></div>\n\n <div class="content-placeholder" >\n\n <div style="display: block" class="text-panel" >\n\n <div><b><span info-sys-data="band gap">Band gap</span></b> (eV):\n <div class="stats-fields summary-bandgap-field" > </div>\n </div>\n </div>\n\n <div style="display:none" class="chart-panel" >\n <div class="charts-placeholder" > </div>\n </div>\n\n </div>\n ',this.chartTab=this.hostElement.querySelector(".chart-tab"),this.textTab=this.hostElement.querySelector(".text-tab"),this.functionalTabs=this.hostElement.querySelector(".functional-tabs"),this.chartPanel=this.hostElement.querySelector(".chart-panel"),this.textPanel=this.hostElement.querySelector(".text-panel"),this.bandgapField=this.hostElement.querySelector(".summary-bandgap-field"),this.statsViewer=new r,this.chartsPlaceholder=this.hostElement.querySelector(".charts-placeholder"),this.chartTab.addEventListener("click",e=>{this.chartTab.style.fill="#777",this.viewType="chart",this.textTab.style.fill="#c7c7c7",this.chartPanel.style.display="block",this.textPanel.style.display="none"}),this.textTab.addEventListener("click",e=>{this.textTab.style.fill="#777",this.viewType="text",this.chartTab.style.fill="#c7c7c7",this.textPanel.style.display="block",this.chartPanel.style.display="none"}),this.functionalTabs.addEventListener("click",e=>{"tab"===e.target.className&&(this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]').className="tab",this.functional=e.target.getAttribute("data-tab"),this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]').className="tab-selected",this._setData())})}_setData(){this.functional;let e=Array.from(this.calcMapByFunctional.get(this.functional)),t=d.getMaterialData().material_id,s=JSON.stringify({calculations:e,properties:["band_gap"],n_histogram_bins:this.nBins});n.serverReqPOST(n.getMaterialStatsURL(t),s,e=>{let t=JSON.parse(e.target.response).band_gap;if(void 0===t)return this.bandgapField.innerHTML="No band gap data available",this.statsViewer.clear(),void(this.chartsPlaceholder.textContent="No band gap data available");this.chartsPlaceholder.textContent="",this.statsViewer.attach(this.chartsPlaceholder,250,150),t.min*=6241509e12,t.avg*=6241509e12,t.max*=6241509e12,t.histogram.values=t.histogram.values.map(e=>6241509e12*e);let s=t.avg.toFixed(3)+' <span style="font-size: 0.9em">['+t.min.toFixed(3)+" , "+t.max.toFixed(3)+"]</span>";this.bandgapField.innerHTML=s,this.statsViewer.clear(),this.statsViewer.drawPoints(t.histogram,"Band gap (eV)",this.nBins)})}build(e){this.calcMapByFunctional=e,this.graphTrigger=null,this.statsViewer.clear(),this.unfoldedElement=null,this.functionalQuantityMap=new Map,this.functionalTabs.innerHTML="",this.calcMapByFunctional.forEach((e,t)=>{this.functionalTabs.innerHTML+='<span class="tab" data-tab="'+t+'">'+t+"</span>"});let t=Array.from(this.calcMapByFunctional.keys());(null===this.functional||t.indexOf(this.functional)<0)&&(this.functional=t[0]),this._setData(),this.functionalTabs.querySelector('[data-tab="'+this.functional+'"]').className="tab-selected",l.addToInfoSystem(this.hostElement)}}class p{constructor(e){this.hostElement=e,this.loaded=!1;this.bzViewer=new matviewer.BrillouinZoneViewer(this.hostElement,{view:{autoResize:!1,autoFit:!0,fitMargin:.018}})}setCalcData(e){this.bzViewer.load(this._getBZDataForViewer(e)),this.hostElement.style.visibility="visible",this.loaded=!0,this.resize()}setNoData(){this.hostElement.style.visibility="hidden"}resize(){this.bzViewer.resizeCanvasToHostElement(),this.loaded&&(this.bzViewer.fitToCanvas(),this.bzViewer.render())}_getBZDataForViewer(e){let t=e.brillouin_zone,s=[],i=[];return e.section_k_band_segment.forEach(e=>{s.push(e.band_segm_labels),i.push(e.band_segm_start_end)}),{vertices:t.vertices,faces:t.faces,basis:e.reciprocal_cell,labels:s,segments:i}}}e.exports=class extends i{constructor(){super("Electronic Structure"),this.navTree=new a,this.element.innerHTML+='\n <div style="float: left; width: 30%;">\n <div class="view-box">\n <div class="title">Calculations </div>\n <div class="navTreeWrapper"></div>\n\n <div class="summary-title">Summary</div>\n <div class="footer summary-box" style="border-top: 0"></div>\n </div>\n </div>\n\n <div style="float: right; width: 70%;">\n <div class="view-box e-structure-box">\n\n <div class="title">Electronic structure</div>\n\n <div style="padding-top: 10px; " >\n <div class="tree-leaf-title"></div>\n </div>\n\n <div>\n\n <div style="padding: 30px 100px 20px 100px; ">\n <div class="info-fields-label" style="float: left; width: 54%; ">\n <span info-sys-data="band-structure">Band structure</span>\n </div>\n <div class="info-fields-label" style="float: left;">\n <span info-sys-data="DOS">DOS</span>\n </div>\n <div style="clear: both;"></div>\n\n <div class="calc-bs-dos-plotter" >\n </div>\n\n <div>\n <div class="band-gap-field" style="float: left; width: 56%; text-align: right">\n <b><span info-sys-data="band-gap">Band gap</span></b>:\n <span class="band-gap-value" ></span>\n </div>\n <div style="clear: both;"></div>\n\n </div>\n </div>\n\n <div class="spin-legend" style="font-size: 0.9em; padding: 0 30px 10px; display: none">\n <svg width="15px" height="10px"> <polyline points="0,5 15,5" class="plotSpin1"/></svg>\n Spin <span style=\'font-size: 1.1em\'>⇧</span> \n <svg width="15px" height="10px"> <polyline points="0,5 15,5" class="plotSpin2"/></svg>\n Spin <span style=\'font-size: 1.1em\'>⇩</span>\n </div>\n\n </div>\n\n <div class="footer lower-section">\n\n <div style="float: left">\n <div style="padding: 16px; ">\n <div class="info-fields-label" >\n <span info-sys-data="brillouin-zone-viewer">Brillouin zone</span>\n </div>\n <div class="bz-viewer-wrapper" style="width: 400px; height: 400px">\n </div>\n </div>\n </div>\n\n <div class="band" style="float: right; width: 40%;">\n <div style="padding: 16px; ">\n <div class="info-fields-label" >\n \x3c!-- <span info-sys-data="fermi-surface">Fermi surface </span> --\x3e\n </div>\n <div class="fermi-box" > </div>\n </div>\n </div>\n\n <div style="clear: both;"></div>\n\n </div> \x3c!-- footer --\x3e\n\n </div>\n\n </div> \x3c!-- view-box --\x3e\n ',this.navTreeWrapper=this.element.getElementsByClassName("navTreeWrapper")[0],this.leafTitle=this.element.querySelector(".tree-leaf-title"),this.rightBox=this.element.querySelector(".e-structure-box"),this.summaryByFunctionals=null,this.summaryBox=this.element.querySelector(".summary-box"),this.summaryByFunctionals=new c(this.summaryBox),this.bsDosPlotter=new o,this.bandGapField=this.element.querySelector(".band-gap-field"),this.bandGapValue=this.element.querySelector(".band-gap-value"),this.spinLegend=this.element.querySelector(".spin-legend"),this.lowerSection=this.element.querySelector(".lower-section"),this.fermiBox=this.element.getElementsByClassName("fermi-box")[0],this.bzViewerWrapper=new p(this.element.querySelector(".bz-viewer-wrapper")),l.addToInfoSystem(this.element)}setVisible(){this.element.style.display="block",this.bzViewerWrapper.resize()}setMaterialData(){let e=d.getMaterialData();super.setMaterialData(e);let t=null===e.material_name?e.formula:e.material_name;this.navTree.build(t,"electronic"),this.navTree.selectAll(),this.navTree.setHeight(400),this.navTree.setMarkedLeafIfNoneMarked(null),this.attachNavTree(this.navTree),this.updateSelection(this.navTree.getTreeSelectedCalcs()),this.updateMarkedLeaf(this.navTree.getMarkedLeaf()),this.navTree.setTreeSelectionListener(e=>{this.updateSelection(e)}),this.navTree.setLeafMarkedListener(e=>{this.updateMarkedLeaf(e)})}updateSelection(e){if(e.size>0){let t=[];e.forEach(e=>{t.push(d.getCalc(e))});let s=n.getCalcMapByFunctional(t);this.summaryByFunctionals.build(s)}else this.summaryBox.style.visibility="hidden"}updateMarkedLeaf(e){null===e?this.leafTitle.innerHTML="NO SELECTION":(this.leafTitle.innerHTML=n.getShortCode(e),this._loadGraphData(e))}_updateSelectorState(e){this.leafTitle.innerHTML=n.getShortCode(e)}_loadGraphData(e){let t=d.getCalc(e);if(this.bsDosPlotter.isAttached()||this.bsDosPlotter.attach(this.element.querySelector(".calc-bs-dos-plotter"),void 0,360),null===t||!t.has_band_structure&&!t.has_dos)this.bsDosPlotter.setNoData(),this.bzViewerWrapper.setNoData(),this.bandGapField.style.display="none",this.lowerSection.style.display="none";else{h.show("electronic_structure");let e=d.getMaterialData().material_id,s=n.getMaterialCalcURL(e,t.calc_id),i=JSON.stringify({properties:["electronic_band_structure","electronic_dos","band_gap"]});n.serverReqPOST(s,i,e=>{let s=JSON.parse(e.target.response),i=s.electronic_dos,a=s.electronic_band_structure,l=s.band_gap;(function(e,t){if(void 0!==e&&2===e.section_k_band_segment[0].band_energies.length)return!0;if(void 0!==t&&2===t.dos_values.length)return!0;return!1})(a,i)&&(this.spinLegend.style.display="block"),this.bsDosPlotter.setUpAndData(a,i,t),void 0!==l?(this.bandGapValue.textContent=n.J2eV(l,2)+" eV ",this.bandGapField.style.display="block"):(this.bandGapValue.textContent="",this.bandGapField.style.display="none"),void 0!==a&&void 0!==a.brillouin_zone?(this.lowerSection.style.display="block",this.bzViewerWrapper.setCalcData(a)):(this.lowerSection.style.display="none",this.bzViewerWrapper.setNoData()),h.hide("electronic_structure")})}}setPrevCalcListener(e){this.prevCalcListener=e}setNextCalcListener(e){this.nextCalcListener=e}}},function(e,t,s){let i=s(8),n=s(11);s(1);e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("style","margin: 0 auto"),this.parentElement=null,this.bsPlotter=new i,this.dosPlotter=new n({left:4,right:20,top:0,bottom:30}),this.dosYAxisLabeled=!1}attach(e,t,s){e.appendChild(this.element),this.bsPlotter.attach(this.element,s,s),this.height=s,this.dosPlotter.attach(this.element,this.height/2+20,s),this.parentElement=e}isAttached(){return null!==this.parentElement}setUpAndData(e,t,s){let i;if(this.hasDispData=null!=e,this.hasDosData=null!=t,i=!(!this.hasDosData||this.hasDispData),this.dosYAxisLabeled!==i){this.element.removeChild(this.dosPlotter.svg);let e=i?40:4;this.dosPlotter=new n({left:e,right:20,top:0,bottom:30});let t=this.height/2+e;this.dosPlotter.attach(this.element,t,this.height)}this.dosYAxisLabeled=i,this.hasDispData?(this.bsPlotter.setBandStructureData(e),this.hasDosData&&this.bsPlotter.setRepaintListener((e,t)=>{this.dosPlotter.setYZoomAndOffset(e,t),this.dosPlotter.repaint()})):this.bsPlotter.setNoData(),this.hasDosData?(this.dosPlotter.setPoints(t,s),this.hasDispData&&(this.bsPlotter.setExternalYAxisMax(this.dosPlotter.getYAxisMax()),this.dosPlotter.setRepaintListener((e,t)=>{this.bsPlotter.setYZoomAndOffset(e,t),this.bsPlotter.repaint()}),this.dosPlotter.svg.removeChild(this.dosPlotter.yLabelText),this.dosPlotter.yLabelText=null)):this.dosPlotter.setNoData(),this.dosPlotter.setYAxisLabelsVisibility(i)}setNoData(){this.bsPlotter.setNoData(),this.dosPlotter.setNoData()}}},function(e,t,s){"use strict";let i=s(6),n=s(0),a=s(3),l=s(2),r=s(28),o=window.nomadEnv.guiRoot,d=o.slice(0,o.lastIndexOf("/",o.lastIndexOf("/")-1))+"/gui/entry/id";const h=new Map([["single point","Single point"],["GW calculation","GW"],["geometry optimization","Geometry optimization"],["molecular dynamics","Molecular dynamics"],["phonon calculation","Phonon"],["equation of state","Equation of state"],["parameter variation","Parameter variation"],["QHA calculation","QHA"]]);class c{constructor(e){this.element=document.createElement("div"),this.element.className=e,this.filtersOn=[],this.folded=!0,this.element.innerHTML+=`\n <div style="padding: 0rem 2.5rem">\n <div style="display: flex; justify-content: flex-end;">\n <div class="filter-groups-c-folded" >\n <span style="vertical-align: top;">Filtering </span>\n </div>\n <div class="filter-c-btn" >\n <img src="${n.IMAGE_DIR}folded.png" />\n \x3c!--<button class="on">filter</button> --\x3e\n </div>\n </div>\n <div class="filter-groups-c-unfolded" style="display: none; padding-bottom: 1rem">\n <table style="width: 100%;">\n <thead>\n <tr>\n <th style="width: 20%;">\n <span>Type</span>\n </th>\n <th style="width: 20%;">\n <span info-sys-data="functional-type">Density functional</span>\n </th>\n <th style="width: 20%;">\n <span info-sys-data="code-name">Code</span>\n </th>\n <th style="width: 20%;">\n <span info-sys-data="pseudopotential-type">Potential</span>\n </th>\n <th style="width: 20%;">\n <span info-sys-data="basis-set-type">Basis set</span>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr id="filter-items-row"></tr>\n </tbody>\n </table>\n </div>\n </div>\n `,this.unfoldedPanel=this.element.querySelector(".filter-groups-c-unfolded"),this.filterItemsRow=this.element.querySelector("#filter-items-row"),this.foldBtn=this.element.querySelector("img"),this.foldBtn.addEventListener("click",e=>{this.folded=!this.folded,this.foldBtn.src=this.folded?n.IMAGE_DIR+"folded.png":n.IMAGE_DIR+"unfolded.png",this.unfoldedPanel.style.display=this.folded?"none":"block"}),this.element.addEventListener("click",e=>{if("INPUT"===e.target.tagName){let t=this.filtersOn.indexOf(e.target.value);t>=0?this.filtersOn.splice(t,1):this.filtersOn.push(e.target.value),this.itemListener(this.filtersOn)}})}addGroupsItems(e){let t=new Map,s=new Map,i=new Map,n=new Map,a=new Map;e.forEach(e=>{t.has(e.type)||t.set(e.type,h.get(e.type)),s.has(e.functional_type)||s.set(e.functional_type,e.functional_type),i.has(e.code)||i.set(e.code,e.code),n.has(e.core_electron_treatment)||n.set(e.core_electron_treatment,e.core_electron_treatment),a.has(e.basis_set_type)||a.set(e.basis_set_type,e.basis_set_type)}),this.filterItemsRow.innerHTML="",this.filtersOn=[],this.addGroupItems(t),this.addGroupItems(s),this.addGroupItems(i),this.addGroupItems(n),this.addGroupItems(a)}addGroupItems(e){let t="<td> ";e.forEach((e,s)=>{this.filtersOn.push(s),t+='<input type="checkbox" value="'+s+'" checked><span style="vertical-align: 20%">'+e+"</span> <br> "}),this.filterItemsRow.innerHTML+=t+"</td>"}setItemListener(e){this.itemListener=e}}function p(e){return null==e?"":"("+e+")"}e.exports=class extends i{constructor(){super("Methodology"),this.sortedCalcs=[],this.markedCalc=null,this.element.innerHTML+='\n\n <div>\n <div class="view-box">\n <div class="title">Methodology</div>\n\n <div class="filter-placeholder"></div>\n\n <div class="dataTableWrapper"></div>\n </div>\n </div>\n ',this.dataTableWrapper=this.element.querySelector(".dataTableWrapper"),this.dataTableWrapper.innerHTML+='\n <table id="methodology-data">\n <thead>\n <tr>\n <th style="width: 12%;">\n <span>Calculation ID</span>\n <span class="sorting-button"></span>\n </th>\n <th style="width: 16%;">\n <span>Type</span>\n <span class="sorting-button"></span>\n </th>\n <th style="width: 18%;">\n <span info-sys-data="functional-type">Density functional</span>\n <span class="sorting-button"></span>\n </th>\n <th style="width: 12%;">\n <span info-sys-data="code-name">Code</span>\n <span class="sorting-button"></span>\n </th>\n <th style="width: 16%;">\n <span info-sys-data="pseudopotential-type">Potential</span>\n <span class="sorting-button"></span>\n </th>\n <th style="width: 11%;">\n <span info-sys-data="basis-set-type">Basis set</span>\n <span class="sorting-button"></span>\n </th>\n <th style="width: 4%;">\n <span info-sys-data="basis-set-type">Link</span>\n </th>\n </tr>\n </thead>\n <tbody>\n </tbody>\n </table>\n ',this.tbody=this.dataTableWrapper.querySelector("tbody"),this.moreInfoRow=document.createElement("tr"),this.moreInfoRow.className="moreinfo",this.moreInfoCalcId=null,this.filterComponent=new c("meth-filter-component"),this.element.querySelector(".filter-placeholder").appendChild(this.filterComponent.element),this.filterComponent.setItemListener(e=>{this.sortedCalcs.forEach(t=>{let s=t.dataCalcProps.split(","),i=!0;s.forEach(t=>{e.indexOf(t)<0&&(i=!1)}),t.visible=!!i}),this._render()}),this.sortingButtonWrappers=this.dataTableWrapper.querySelectorAll(".sorting-button"),this.sortingButtons=[];let e=new Map([["calc_id",void 0],["type",void 0],["functional_type",void 0],["code",void 0],["core_electron_treatment",void 0],["basis_set_type",void 0]]).keys();this.sortingButtonWrappers.forEach(t=>{let s=e.next().value,i=new r(s);t.appendChild(i.element),this.sortingButtons.push(i),i.setListener((e,t)=>{this.sortingButtons.forEach(e=>{e!==i&&e.init()}),this._sortRowsCalcDataBy(e,t),this._render()})}),a.addToInfoSystem(this.element)}updateSelection(e){this.sortedCalcs=[],l.getCalculations().forEach(e=>{let t=e.run_type;l.getGroups().has(e.calc_id)&&(t=l.getGroupType(e.calc_id)),this.sortedCalcs.push({calc_id:e.calc_id,type:t,functional_type:e.functional_type,code:e.code_name,core_electron_treatment:e.core_electron_treatment,basis_set_type:e.basis_set_type,dataCalcProps:t+","+e.functional_type+","+e.code_name+","+e.core_electron_treatment+","+e.basis_set_type,visible:!0})}),this.filterComponent.addGroupsItems(this.sortedCalcs),this._sortRowsCalcDataBy(!0,"calc_id"),this._render()}_sortRowsCalcDataBy(e,t){this.sortedCalcs.sort((s,i)=>{let n=e?-1:1;return s[t]<i[t]?n:-n})}updateMarkedLeaf(e){}_render(){let e="";this.sortedCalcs.forEach(t=>{t.visible&&(e+=function(e){let t=l.getCalc(e.calc_id),s=e.type,i=`<a href="${d}/${t.upload_id}/${t.calc_id}" target="blank"><img src="img/download.svg" height="20px" /> </a>`,a=l.getMaterialData().material_id,r=t.calc_id,o=`<a href="https://labdev-nomad.esc.rzg.mpg.de/remotevis/cM/start/${a}+${r}" target="blank"><img src="img/monitor_icon.png" height="20px" /> </a>`;return`\n <tr data-calc-id="${t.calc_id}" class="data-row">\n <td>${n.getShortCode(t.calc_id)}</td>\n <td>\n <span info-sys-data="calculation-type.value:${s}">\n ${s}</span>\n </td>\n <td>\n <span info-sys-data="functional-type.value:${e.functional_type}">\n ${e.functional_type}</span>\n ${p(t.functional_long_name)}\n </td>\n <td>\n <span info-sys-data="code-name.value:${t.code_name}">\n ${t.code_name}</span>\n ${p(t.code_version)}\n </td>\n\n <td>\n <span info-sys-data="core-electron-treatment.value:${e.core_electron_treatment}">\n ${e.core_electron_treatment}</span>\n </td>\n <td>\n <span info-sys-data="basis-set-type.value:${t.basis_set_type}">\n ${t.basis_set_type}</span>\n ${p(t.basis_set_quality_quantifier)}\n </td>\n\n <td style="padding-top: 8px;padding-bottom: 4px;">${i}\n </td>\n\n \x3c!--\n <td style="padding-top: 8px;padding-bottom: 4px;">${o}\n </td>--\x3e\n\n </tr>`}(t))}),this.tbody.innerHTML=e,a.addToInfoSystem(this.tbody)}}},function(e,t,s){s(0);e.exports=class{constructor(e){this.id=e,this.ascending=!0,this.element=document.createElement("span"),this.element.innerHTML+='\n <img src="img/sorting_init.png" width="12px"\n style="margin-bottom: -1px; cursor: pointer"/>\n ',this.image=this.element.querySelector("img"),"id"===e&&this.image.setAttribute("src","img/sorting_ascending.png"),this.element.addEventListener("click",e=>{this.ascending=!this.ascending,this.image.setAttribute("src","img/sorting_"+(this.ascending?"ascending":"descending")+".png"),this.listener(this.ascending,this.id)})}init(){this.image.setAttribute("src","img/sorting_init.png")}setListener(e){this.listener=e}}},function(e,t,s){"use strict";let i=s(6),n=s(0),a=s(7),l=s(3),r=s(2),o=s(4),d=s(12),h=s(30),c=s(31);e.exports=class extends i{constructor(){super("Thermal Properties"),this.firstId,this.lastId,this.navTree=new a,this.element.innerHTML+='\n <div style="float: left; width: 30%;">\n <div class="view-box">\n <div class="title">Calculations </div>\n <div class="navTreeWrapper"></div>\n </div>\n </div>\n\n <div style="float: right; width: 70%;">\n <div class="view-box thermal-properties-box">\n\n <div class="title">Vibrational and thermal properties</div>\n\n <div style="padding-top: 10px;">\n <div class="tree-leaf-title"></div>\n </div>\n\n <div class="calc-disp-dos-plotter" style="padding: 30px 100px; ">\n <div class="info-fields-label" style="float: left; width: 52%; ">\n <span info-sys-data="phonon-dispersion">Phonon dispersion </span>\n </div>\n <div class="info-fields-label" style="float: left;">\n <span info-sys-data="phonon-DOS">Phonon DOS </span>\n </div>\n <div style="clear: both;"></div>\n </div>\n\n\n <div class="band" >\n <div style="padding: 30px 50px; display: flex; justify-content: space-around; ">\n\n <div >\n <div class="info-fields-label" >\n <span info-sys-data="specific-heat-cv">Specific heat</span>\n </div>\n <div class="heat-plotter" > </div>\n </div>\n\n <div>\n <div class="info-fields-label" >\n <span info-sys-data="helmholtz-free-energy">Helmholtz free energy</span>\n </div>\n <div class="helmholtz-plotter" > </div>\n </div>\n\n </div>\n </div>\n\n </div>\n </div>\n ',this.navTreeWrapper=this.element.getElementsByClassName("navTreeWrapper")[0],this.rightBox=this.element.querySelector(".thermal-properties-box"),this.leafTitle=this.element.querySelector(".tree-leaf-title"),this.dispDosPlotter=new c,this.heatPlotter=new d,this.helmholtzPlotter=new h,l.addToInfoSystem(this.element)}_events(){super._events()}setMaterialData(){let e=r.getMaterialData();super.setMaterialData(e);let t=null===e.material_name?e.formula:e.material_name;this.navTree.build(t,"thermal"),this.navTree.selectAll(),this.navTree.setHeight(600),this.navTree.setMarkedLeafIfNoneMarked(null),this.attachNavTree(this.navTree),this.updateSelection(this.navTree.getTreeSelectedCalcs()),this.updateMarkedLeaf(this.navTree.getMarkedLeaf()),this.navTree.setTreeSelectionListener(e=>{this.updateSelection(e)}),this.navTree.setLeafMarkedListener(e=>{this.updateMarkedLeaf(e)})}updateSelection(e){}updateMarkedLeaf(e){if(null===e)return this.leafTitle.innerHTML="NO SELECTION",this.dispDosPlotter.setNoData(),this.heatPlotter.setNoData(),void this.helmholtzPlotter.setNoData();this.leafTitle.innerHTML=n.getShortCode(e);let t=r.getCalc(e);this.dispDosPlotter.isAttached()||(this.dispDosPlotter.attach(this.element.querySelector(".calc-disp-dos-plotter"),void 0,360),this.heatPlotter.attach(this.element.querySelector(".heat-plotter"),317,317),this.helmholtzPlotter.attach(this.element.querySelector(".helmholtz-plotter"),317,317)),o.show("thermal_properties");let s=r.getMaterialData().material_id,i=n.getMaterialCalcURL(s,t.calc_id),a=JSON.stringify({properties:["phonon_band_structure","phonon_dos","thermodynamical_properties"]});n.serverReqPOST(i,a,e=>{let t=JSON.parse(e.target.response),s=t.phonon_dos,i=t.phonon_band_structure,n=t.thermodynamical_properties;if(void 0!==s?this.dispDosPlotter.setUpAndData(i,s):this.dispDosPlotter.setNoData(),void 0!==n){let e=n.thermodynamical_property_temperature;this.heatPlotter.setData(e,n.specific_heat_capacity),this.helmholtzPlotter.setData(e,n.specific_vibrational_free_energy_at_constant_volume)}else this.heatPlotter.setNoData(),this.helmholtzPlotter.setNoData();document.getElementById("thermal-props-ov").style.visibility="visible",o.hide("thermal_properties")})}setPrevCalcListener(e){this.prevCalcListener=e}setNextCalcListener(e){this.nextCalcListener=e}}},function(e,t,s){"use strict";let i=s(1),n=s(5);e.exports=class extends n{constructor(){super({left:60,right:16,top:10,bottom:32}),this.tooltip}setData(e,t){this.clear();let s=e.indexOf(600)+1,n=[],a=[];for(let s=0;s<e.length;++s){let i=e[s],l=t[s];null!==i&null!==l&&(n.push(i),a.push(l))}let l=n.slice(0,s),r=a.slice(0,s),o=Math.max.apply(null,r),d=Math.min.apply(null,r),h=1e3*Math.ceil(o/1e3),c=1e3*Math.floor(d/1e3);this.setRangeAndLabels("T (K)",0,600,"F (J/kg)",c,h),this.drawAxis(4,null,0);let p="";l.forEach((e,t)=>{let s=r[t];p+=" "+this.xRel*e+" -"+this.yRel*(s-this.yMin)}),i.addPolyline(this.plotArea,p,"plotSpin1")}}},function(e,t,s){let i=s(8),n=s(9),a=s(1),l=s(0);class r extends n{constructor(){super({left:4,right:16,top:0,bottom:30}),this.outOfRangeColorActivated=!1}attach(e,t,s){super.attach(e,s/2+this.margins.left,s)}setPoints(e){this.pointsSpin1=[],this.pointsSpin2=[],this._reset();let t=e.dos_values[0],s=null;2===e.dos_values.length&&(s=e.dos_values[1]);let i=e.dos_energies,n=[],r=[];for(var o=0;o<i.length;o++){let e,a=5034117012222e10*i[o],l=.029979*t[o];null!==s&&(e=.029979246*s[o]),n.push(l),null!==s&&n.push(e),r.push(a),this.pointsSpin1.push({x:l,y:a}),null!==s&&this.pointsSpin2.push({x:e,y:a})}let d=Math.max.apply(null,n),h=Math.max.apply(null,r),c=Math.min.apply(null,r),p=l.generateDiagramSteps(d),u=p[0],m=p[1];this.setAxisRangeAndLabels(null,0,u[u.length-1],null,-50,320,c,h,100),a.addText(this.axisGroup,this.plotRangeX/2,this.margins.bottom,"DOS (states/cm⁻¹)","middle","axis-steps-big");for(let e=0;e<u.length;e++){let t=this.plotRangeX*u[e]/u[u.length-1];a.addLine(this.axisGroup,t,0,t,3,1),a.addText(this.axisGroup,t,13,0===e?"0":u[e].toFixed(m),"middle","axis-steps-smaller")}this.repaint()}repaintData(){let e="";for(var t=0;t<this.pointsSpin1.length;t++)e+=" "+this.xRel*this.pointsSpin1[t].x+" "+this.transformY(this.pointsSpin1[t].y);a.addPolyline(this.plotContent,e,"plotSpin1"),e="";for(t=0;t<this.pointsSpin2.length;t++)e+=" "+this.xRel*this.pointsSpin2[t].x+" "+this.transformY(this.pointsSpin2[t].y);a.addPolyline(this.plotContent,e,"plotSpin2")}}e.exports=class{constructor(){this.element=document.createElement("div"),this.parentElement=null,this.dispPlotter=new i,this.dispPlotter.setPhononMode(),this.dosPlotter=new r}attach(e,t,s){e.appendChild(this.element),this.dispPlotter.attach(this.element,s,s),this.dosPlotter.attach(this.element,void 0,s),this.parentElement=e}isAttached(){return null!==this.parentElement}setUpAndData(e,t){this.hasDispData=null!=e,this.hasDosData=null!=t,this.hasDispData?(this.dispPlotter.setBandStructureData(e),this.hasDosData&&this.dispPlotter.setRepaintListener((e,t)=>{this.dosPlotter.setYZoomAndOffset(e,t),this.dosPlotter.repaint()})):this.dispPlotter.setNoData(),this.hasDosData?(this.dosPlotter.setPoints(t),this.hasDispData&&this.dosPlotter.setRepaintListener((e,t)=>{this.dispPlotter.setYZoomAndOffset(e,t),this.dispPlotter.repaint()})):this.dosPlotter.setNoData()}setNoData(){this.dispPlotter.setNoData(),this.dosPlotter.setNoData()}}},function(e,t,s){"use strict";let i=s(6),n=(s(0),s(3));e.exports=class extends i{constructor(){super("Elastic constants"),this.sortedLeafs=[],this.markedCalc=null,this.element.innerHTML+='\n\n <div style="float: left; width: 27%;">\n <div class="view-box">\n <div class="title">Calculation </div>\n <div class="navTreeWrapper"></div>\n </div>\n </div>\n\n <div style="float: right; width: 73%;">\n <div class="view-box">\n <div class="title">Elastic constants</div>\n\n <div>Parameters</div>\n <div ></div>\n\n\n </div>\n </div>\n\n <div style="clear: both;"></div>\n ',this.navTreeWrapper=this.element.querySelector(".navTreeWrapper"),n.addToInfoSystem(this.element),this._events()}_events(){}updateSelection(e){console.log("ElasticDetails updateSelection ",e)}updateMarkedLeaf(e){}}},function(e,t,s){"use strict";let i=s(0),n=s(15),a=s(34),l=s(35),r=s(36);function o(e){return e.split("-").join("_")}class d{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","formula-box"),this.element.innerHTML='\n <div style="padding-bottom: 40px;">\n <input type="text" class="formula-text-field"\n placeholder="Add formula to the search query above" >\n <button class="adding-formula-btn" disabled>Add to query</button>\n </div>\n <div>\n <input type="text" class="material-name-text-field"\n placeholder="Add material name to the search query above" >\n <button class="adding-material-name-btn" disabled>Add to query</button>\n </div>\n ',this.formulaTextField=this.element.querySelector(".formula-text-field"),this.formulaButton=this.element.querySelector(".adding-formula-btn"),this.materialTextField=this.element.querySelector(".material-name-text-field"),this.materialButton=this.element.querySelector(".adding-material-name-btn"),this.formulaButton.addEventListener("click",e=>{this.addFormulaListener(this.formulaTextField.value),this.formulaTextField.value=""}),this.materialButton.addEventListener("click",e=>{this.addMaterialListener(this.materialTextField.value),this.materialTextField.value=""}),this.formulaTextField.addEventListener("input",e=>{this.formulaButton.disabled=""===this.formulaTextField.value}),this.materialTextField.addEventListener("input",e=>{this.materialButton.disabled=""===this.materialTextField.value})}setAddFormulaListener(e){this.addFormulaListener=e}setAddMaterialListener(e){this.addMaterialListener=e}disable(e){this.formulaTextField.disabled=e,this.formulaButton.disabled=!0,this.materialTextField.disabled=e,this.materialButton.disabled=!0}}e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","search-module"),this.element.innerHTML='\n <div class="search-page">\n\n <div class="searchline" style="visibility: hidden">\n <div class="search-query-wrapper" style="float: left;">\n <div class="search-query-box" style="float: left;">\n </div>\n <button class="clean-btn" style="float: right;">Clear all</button>\n </div>\n\n <button style="float: right" class="search-btn" >Search</button>\n <div style="clear: both;"></div>\n <div class="exclusive-search-line">\n Exclusive search <input class="exclusive-search" type="checkbox" >\n </div>\n </div>\n\n\n <div class="add-buttons" >\n <div class="tab-buttons" style="width: 70%; display: inline-block">\n <button class="element-add-btn" id="add-tab-selected">Element</button>\n <button class="formula-add-btn" style="padding: 10px 20px;" >Formula/Material</button>\n <button class="props-add-btn" >Properties</button>\n </div>\n <div class="bool-buttons" style="width: 28%; display: inline-block" >\n <button disabled >AND</button>\n <button disabled >OR</button>\n <button disabled >NOT</button>\n <button disabled >(</button> <button disabled >)</button>\n \x3c!--<input type="checkbox" name="and-or" class="not-symbol-btn" />NOT--\x3e\n </div>\n </div>\n\n\n <div>\n <div class="triangle element-tri" style="margin: -10px 64px; visibility: visible"></div>\n <div class="triangle formula-tri" style="margin: -10px 30px; visibility: hidden"></div>\n <div class="triangle props-tri" style="margin: -10px 70px; visibility: hidden"></div>\n </div>\n\n\n <div class="add-panel">\n </div>\n\n </div> \x3c!-- search-page --\x3e\n\n\n <div class="results-page" style="display: none">\n </div>\n\n ',this.searchPage=this.element.querySelector(".search-page"),this.searchQueryBox=this.element.getElementsByClassName("search-query-box")[0],this.searchLine=this.element.querySelector(".searchline"),this.mainButton=this.element.querySelector(".search-btn"),this.cleanButton=this.element.querySelector(".clean-btn"),this.addButtonsBox=this.element.querySelector(".add-buttons"),this.addElementButton=this.addButtonsBox.querySelector(".element-add-btn"),this.addFormulaButton=this.addButtonsBox.querySelector(".formula-add-btn"),this.addPanel=this.element.querySelector(".add-panel"),this.elementTable=new a,this.elementTable.setClickListener(e=>{this.addElementsInSearchQuery(e),this.addFormulaButton.disabled=!0}),this.elementTable.setDeselectListener(e=>this.removeElementORFormulaInSearchQuery(e)),this.propertiesBox=new r,this.propertiesBox.setAddPropertiesListener(e=>{this.addPropertiesInSearchQuery(e)}),this.formulaBox=new d,this.formulaBox.setAddFormulaListener(e=>{""!==e.trim()&&(this.addTagInSearchQuery(e,"F"),this.addElementButton.disabled=!0,this.formulaBox.disable(!0))}),this.formulaBox.setAddMaterialListener(e=>{""!==e.trim()&&(this.addTagInSearchQuery(e,"material-name"),this.addElementButton.disabled=!0,this.formulaBox.disable(!0))}),this.materialList=new l,this.resultsPage=this.element.querySelector(".results-page"),this.materialList.attachAndSetEvents(this.resultsPage),this.currentTab="element",this.addPanel.appendChild(this.elementTable.element),this.userGuidance=!0,this.showingSearchBox=!1,this.searchQuery=[],this.queryTypes=[],this._events()}_events(){this.mainButton.addEventListener("click",e=>{if(0===this.searchQuery.lenght)i.showUserMsg("No query");else{let e={},t=[];e.search_by={},this.searchQuery.forEach((s,i)=>{"F"===this.queryTypes[i]?e.search_by.formula=s:"E"===this.queryTypes[i]?t.push(s):"S"!==this.queryTypes[i]&&(0===this.queryTypes[i].indexOf("has")?e[o(this.queryTypes[i])]=!0:e[o(this.queryTypes[i])]=s.split(" | "))}),t.length>0&&(e.search_by.element=t.join(","));let s=this.element.querySelector(".exclusive-search:checked");e.search_by.exclusive=null===s?"0":"1",this.materialList.setSearch(e),i.setBrowserHashPath("search","results")}}),this.cleanButton.addEventListener("click",e=>{this.searchQuery=[],this.queryTypes=[],this.updateSearchQuery(),this.addFormulaButton.disabled=!1,this.addElementButton.disabled=!1,this.formulaBox.disable(!1),this.elementTable.deselectAllElements()}),this.addButtonsBox.addEventListener("click",e=>{if(e.target!==e.currentTarget){let t=e.target.className,s=t.indexOf("add-btn");if(s>0){let i,a=t.substring(0,s-1);"element"===a?i=this.elementTable.element:"props"===a?i=this.propertiesBox.element:"formula"===a&&(i=this.formulaBox.element),this.addPanel.replaceChild(i,this.addPanel.lastChild);let l=this.element.querySelector("."+this.currentTab+"-add-btn");this._setTabSelectedStyles(l,!1),this._setTabSelectedStyles(e.target,!0),this.element.querySelector("."+this.currentTab+"-tri").style.visibility="hidden",this.element.querySelector("."+a+"-tri").style.visibility="visible",this.currentTab=a,this.userGuidance&&("element"===a?(n.showIndependentTip(7,!1),n.showIndependentTip(3,!0)):"props"===a?(n.showIndependentTip(3,!1),n.showIndependentTip(7,!0)):"formula"===a&&(n.showIndependentTip(3,!1),n.showIndependentTip(7,!1)))}}}),this.searchQueryBox.addEventListener("click",e=>{if("remove-label"===e.target.className){let t=e.target.parentElement.getAttribute("data-el");this.removeElementORFormulaInSearchQuery(t)}})}_setTabSelectedStyles(e,t){e.id=t?"add-tab-selected":""}_showSearchBox(){this.showingSearchBox||(this.showingSearchBox=!0,this.searchLine.style.visibility="visible",this.userGuidance&&n.setFinal())}_addItemInSearchQuery(e,t){this.searchQuery.push(e),this.queryTypes.push(t)}addTagInSearchQuery(e,t){"E"===t&&this.searchQuery.indexOf(e)>=0||(this.searchQuery.length>0&&this._addItemInSearchQuery("&","S"),this._addItemInSearchQuery(e,t),this.updateSearchQuery(),this._showSearchBox())}addElementsInSearchQuery(e){let t=e.length;for(;t--;)this.addTagInSearchQuery(e[t],"E");return!0}addPropertiesInSearchQuery(e){e.forEach((e,t)=>{let s=this.queryTypes.indexOf(t);if(s<0)this.addTagInSearchQuery(e.join(" | "),t);else{let t=this.searchQuery[s].split(" | ");e.forEach(e=>{t.indexOf(e)<0&&t.push(e)}),this.searchQuery[s]=t.join(" | "),this.updateSearchQuery(),this._showSearchBox()}})}removeElementORFormulaInSearchQuery(e){let t=this.searchQuery.indexOf(e);if(t>=0){if(this.searchQuery.splice(t,1),this.queryTypes.splice(t,1),t>0){let e=this.searchQuery[t-1];"&"!==e&&"|"!==e||(this.searchQuery.splice(t-1,1),this.queryTypes.splice(t-1,1))}"S"===this.queryTypes[0]&&(this.searchQuery.splice(0,1),this.queryTypes.splice(0,1)),this.updateSearchQuery(),i.ELEMENTS.indexOf(e)>=0?(this.elementTable.deselectElement(e),this.queryTypes.indexOf("E")<0&&(this.addFormulaButton.disabled=!1)):(this.addElementButton.disabled=!1,this.formulaBox.disable(!1))}return!0}updateSearchQuery(){let e="";for(let s=0;s<this.searchQuery.length;s++){let n=this.queryTypes[s];e+="S"===n?`<span class="search-query-symbol" > ${this.searchQuery[s]} </span>`:`<span class="search-label" data-el="${t=this.searchQuery[s]}" >\n <img src="img/tag.svg" height="16px" class="remove-label"\n style="vertical-align: bottom"/>\n ${"F"===n?i.getSubscriptedFormula(t):t}\n <img src="img/cross.svg" height="6px" class="remove-label"\n style="vertical-align: middle; padding: 4px 3px 6px 5px;" />\n </span>`}var t;console.log("this.updateSearchQuery: ",this.searchQuery,this.queryTypes),this.searchQueryBox.innerHTML=e}showResultsPage(){this.searchPage.style.display="none",this.resultsPage.style.display="block",this.userGuidance&&n.show(!1)}showSearchPage(){this.searchPage.style.display="block",this.resultsPage.style.display="none",this.userGuidance&&setTimeout(()=>{n.init(this.addButtonsBox,this.elementTable.element,this.searchLine,this.propertiesBox.tabsElement),n.show(!0,"element"===this.currentTab,"props"===this.currentTab)},400)}}},function(e,t,s){"use strict";let i=s(0);const n=new Map([[1,["H","Li","Na","K","Rb","Cs","Fr"]],[2,["Be","Mg","Ca","Sr","Ba","Ra"]],[3,["Sc","Y"]],[4,["Ti","Zr","Hf","Rf"]],[5,["V","Nb","Ta","Ha"]],[6,["Cr","Mo","W","Sg"]],[7,["Mn","Tc","Re","Ns"]],[8,["Fe","Ru","Os","Hs"]],[9,["Co","Rh","Ir","Mt"]],[10,["Ni","Pd","Pt","Ds"]],[11,["Cu","Ag","Au","Rg"]],[12,["Zn","Cd","Hg","Cn"]],[13,["B","Al","Ga","In","Tl","Nh"]],[14,["C","Si","Ge","Sn","Pb","Fl"]],[15,["N","P","As","Sb","Bi","Mc"]],[16,["O","S","Se","Te","Po","Lv"]],[17,["F","Cl","Br","I","At","Ts"]],[18,["He","Ne","Ar","Kr","Xe","Rn","Og"]],[19,["La","Ce","Pr","Nd","Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm","Yb","Lu"]],[20,["Ac","Th","Pa","U","Np","Pu","Am","Cm","Bk","Cf","Es","Fm","Md","No","Lr"]]]),a=new Map([["metalloids",["B","Si","Ge","As","Sb","Te","Po"]],["other-non-metals",["H","C","N","O","P","S","Se"]],["halogens",["F","Cl","Br","I","At","Ts"]],["noble-gases",["He","Ne","Ar","Kr","Xe","Rn","Og"]],["alkali-metals",["Li","Na","K","Rb","Cs","Fr"]],["alkaline-earth-metals",["Be","Mg","Ca","Sr","Ba","Ra"]],["lanthanoids",["La","Ce","Pr","Nd","Pm","Sm","Eu","Gd","Tb","Dy","Ho","Er","Tm","Yb","Lu"]],["actinoids",["Ac","Th","Pa","U","Np","Pu","Am","Cm","Bk","Cf","Es","Fm","Md","No","Lr"]],["transition-metals",["Sc","Y","Ti","Zr","Hf","Rf","V","Nb","Ta","Ha","Cr","Mo","W","Sg","Mn","Tc","Re","Ns","Fe","Ru","Os","Hs","Co","Rh","Ir","Mt","Ni","Pd","Pt","Ds","Cu","Ag","Au","Rg","Zn","Cd","Hg","Cn"]],["post-transition-metals",["Al","Ga","In","Tl","Nh","Sn","Pb","Fl","Bi","Mc","Lv"]]]),l=new Map([["metalloids","#F9E298"],["other-non-metals","#F2B01D"],["halogens","#85ADC1"],["noble-gases","#F7D660"],["alkali-metals","#D04629"],["alkaline-earth-metals","#F7B57D"],["transition-metals","#F58737"],["post-transition-metals","#AE4747"],["lanthanoids","#3B91AE"],["actinoids","#E97147"]]);let r=["Hydrogen","Helium","Lithium","Beryllium","Boron","Carbon","Nitrogen","Oxygen","Fluorine","Neon","Sodium","Magnesium","Aluminum","Silicon","Phosphorus","Sulfur","Chlorine","Argon","Potassium","Calcium","Scandium","Titanium","Vanadium","Chromium","Manganese","Iron","Cobalt","Nickel","Copper","Zinc","Gallium","Germanium","Arsenic","Selenium","Bromine","Krypton","Rubidium","Strontium","Yttrium","Zirconium","Niobium","Molybdenum","Technetium","Ruthenium","Rhodium","Palladium","Silver","Cadmium","Indium","Tin","Antimony","Tellurium","Iodine","Xenon","Cesium","Barium","Lanthanum","Cerium","Praseodymium","Neodymium","Promethium","Samarium","Europium","Gadolinium","Terbium","Dysprosium","Holmium","Erbium","Thulium","Ytterbium","Lutetium","Hafnium","Tantalum","Tungsten","Rhenium","Osmium","Iridium","Platinum","Gold","Mercury","Thallium","Lead","Bismuth","Polonium","Astatine","Radon","Francium","Radium","Actinium","Thorium","Protactinium","Uranium","Neptunium","Plutonium","Americium","Curium","Berkelium","Californium","Einsteinium","Fermium","Mendelevium","Nobelium","Lawrencium","Rutherfordium","Dubnium","Seaborgium","Bohrium","Hassium","Meitnerium","Darmstadtium","Roentgenium","Copernicium","Nihonium","Flerovium","Moscovium","Livermorium","Tennessine","Oganesson"];function o(e){let t;return a.forEach((function(s,i){s.indexOf(e)>=0&&(t=i)})),t}function d(e){let t=i.ELEMENTS[e-1];return'<td class="cell '+o(t)+'" data-el="el-'+t+'"><b>'+t+"</b> <div>"+e+"</div> </td>"}function h(e){let t=null,s=null;if(e.target.className.indexOf("cell ")>=0?(t=e.target,s=e.target.className):e.target.parentElement.className.indexOf("cell ")>=0&&(t=e.target.parentElement,s=e.target.parentElement.className),null===t)return null;{let e=t.innerHTML,s=e.substring(3,e.indexOf("<",3));return" "===s?null:s}}e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","elementable");let e='<div class="element-info"></div>';e+='<div class="ptWrapper">',e+='<table id="pt-main">',e+="<tbody>",e+="<tr>"+d(1),e+='<td class="cellpad" colspan="16"></td>',e+=d(2)+"</tr>";let t=t=>{e+="<tr>"+d(t)+d(t+1),e+='<td class="cellpad" colspan="10"></td>';for(let s=t+2;s<t+8;s++)e+=d(s);e+="</tr>"};t(3),t(11);let s=19;for(let t=0;t<4;t++){e+="<tr>";for(let t=0;t<18;t++)57===s||89===s?(e+=(n=s,'<td class="cellpad '+o(i.ELEMENTS[n-1])+'" data-el="el-X"><b> </b> <div> </div> </td>'),s+=15):(e+=d(s),s++);e+="</tr>"}var n;e+="</tbody></table>",e+='<div id="specialRows"><table id="pt-laac">';for(let t=0;t<2;t++){e+="<tr>",s=0===t?57:89;for(let t=0;t<15;t++)e+=d(s),s++;e+="</tr>"}e+="</table></div>",e+='<div class="legend">\n <div class="alkali-metals">Alkali metals</div>\n <div class="alkaline-earth-metals">Alkaline earth metals</div>\n <div class="transition-metals">Transition metals</div>\n <div class="post-transition-metals">Post-transition metals</div>\n <div class="metalloids">Metalloids</div>\n <div class="other-non-metals">Other nonmetals</div>\n <div class="halogens">Halogens</div>\n <div class="noble-gases">Noble gases</div>\n <div class="lanthanoids">Lanthanoids</div>\n <div class="actinoids">Actinoids</div>\n </div>',e+="</div>",this.element.innerHTML=e,this.elementInfo=this.element.getElementsByClassName("element-info")[0],this.tableZone=this.element.getElementsByClassName("ptWrapper")[0],this._events()}_events(){this.tableZone.addEventListener("click",e=>{if(e.target!==e.currentTarget){let s=e.target.className,i=e.target;if(""===s&&(i=e.target.parentElement,s=e.target.parentElement.className),s.indexOf("cellpad")>=0)return;if(s.indexOf("group-sel")>=0){let e=n.get(parseInt(i.getAttribute("data-group")));this.clickListener(e);for(var t=0;t<e.length;t++)this.selectElement(e[t])}else if(s.indexOf("cell")>=0){let e=i.innerHTML,t=e.substring(3,e.indexOf("<",3));if(" "===t)return;s.indexOf("el-selected")>=0?this.deselectListener(t):(this.clickListener([t]),this.selectElement(t))}}},!0),this.tableZone.addEventListener("mouseover",e=>{let t=h(e);if(null!==t){this.elementInfo.style.display="block";let e=l.get(o(t));this.elementInfo.style.borderColor=e;let s=i.ELEMENTS.indexOf(t)+1;this.elementInfo.innerHTML=`\n <div>\n <div style="float: right; padding: 3px 4px;border-left: 3px solid ${e};\n border-bottom: 3px solid ${e}" > ${s} </div>\n <div style="clear: right;"></div>\n </div>\n <div class="symbol">${t} </div>\n <div class="">${r[s-1]} </div>\n `}}),this.tableZone.addEventListener("mouseout",e=>{null!==h(e)&&(this.elementInfo.style.display="none")})}setClickListener(e){this.clickListener=e}setDeselectListener(e){this.deselectListener=e}selectElement(e){this.element.querySelector('td[data-el="el-'+e+'"]').className="cell el-selected"}deselectElement(e){this.element.querySelector('td[data-el="el-'+e+'"]').className="cell "+o(e)}deselectAllElements(){let e=this.element.querySelectorAll("td.el-selected");for(let t=0;t<e.length;++t){let s=e[t].getAttribute("data-el").substring(3);e[t].className="cell "+o(s)}}}},function(e,t,s){"use strict";let i=s(0),n=s(3),a=s(4);e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","matlist"),this.formula=!1,this.matMap=new Map,this.page=0,this.nPages=0,this.before=null,this.afters=new Map,this.searchJson=null,this.element.innerHTML='\n <div class="title"> Results <span class="n-materials"></span></div>\n <div class="pag-header">\n <span class="prevButton">\n <img src="img/prev.svg" style="display: inline;" width="7px"/> prev\n </span> \n <span class="page"> X </span> \n <span class="nextButton"> next \n <img src="img/next.svg" width="7px" />\n </span>\n </div>\n <div class="data-container"> </div>',this.titleBox=this.element.getElementsByClassName("title")[0],this.nMaterials=this.element.getElementsByClassName("n-materials")[0],this.resultsNrTag=this.element.getElementsByClassName("pag-header")[0],this.prevButton=this.element.getElementsByClassName("prevButton")[0],this.pageElement=this.element.getElementsByClassName("page")[0],this.nextButton=this.element.getElementsByClassName("nextButton")[0],this.resultsContainer=this.element.getElementsByClassName("data-container")[0]}attachAndSetEvents(e){e.appendChild(this.element),this._events()}_events(){this.nextButton.addEventListener("click",e=>{this.page++,this._search()}),this.prevButton.addEventListener("click",e=>{1!==this.page&&(this.page--,this._search())}),this.resultsContainer.addEventListener("click",e=>{if(e.target!==e.currentTarget){let t;"mat-row"===e.target.className?t=e.target:"mat-row"===e.target.parentElement.className?t=e.target.parentElement:"mat-row"===e.target.parentElement.parentElement.className&&(t=e.target.parentElement.parentElement),t&&i.setBrowserHashPath("material",t.getAttribute("data-mat-id")),e.stopPropagation()}})}_printMatMap(){console.log("MATMAP:"),this.matMap.forEach((function(e,t,s){console.log(t+" "+JSON.stringify(e))}))}setSearch(e){this.resultsContainer.style.visibility="hidden",this.searchJson=e,this.page=1,this._search()}_search(){this.searchJson.search_by.page=this.page,this.searchJson.search_by.after=this.afters.get(this.page),this.searchJson.search_by.per_page=10;let e=JSON.stringify(this.searchJson);1===this.page?this.prevButton.style.visibility="hidden":this.prevButton.style.visibility="visible",a.reset(),window.allowNewLoadPopup=!0,a.show(),i.serverReqPOST(i.getSearchURL(),e,e=>{let t=JSON.parse(e.target.response);if(200===e.target.status){this.afters.set(this.page+1,t.pages.after),1===this.page&&(this.nMaterials.innerHTML="(total: "+t.pages.total+")",this.nPages=Math.ceil(t.pages.total/this.searchJson.search_by.per_page)),0===t.results.length||this.page===this.nPages?this.nextButton.style.visibility="hidden":this.nextButton.style.visibility="visible";let e=t.results;0===t.results.length?(this.setData([]),i.searchResults=!1):1===t.results.length?(i.setBrowserHashPath("material",e[0].material_id),i.searchResults=!1):(this.setData(e),i.searchResults=!0)}else this.setData([]),this.nextButton.style.visibility="hidden";this._updateUI(),this.resultsContainer.style.visibility="visible",a.hide()}).addEventListener("error",e=>{console.log("Search ERROR - Not valid query "),this.setData([]),this._updateUI(),this.resultsContainer.style.visibility="visible",a.hide()})}setData(e){this.matMap.clear(),e.forEach(e=>{if(this.matMap.has(e.formula_reduced)){this.matMap.get(e.formula_reduced).push(e)}else{let t=[];t.push(e),this.matMap.set(e.formula_reduced,t)}})}reset(){this.formula=!1,this.matMap.clear(),this.page=0,this.searchJson=null,this._updateUI()}_updateUI(){this.pageElement.innerHTML="page "+this.page+"/"+this.nPages;let e="";0===this.matMap.size?(1===this.page&&(this.resultsNrTag.style.display="none",this.titleBox.style.display="none"),e+='<div class="not-found">No results found</div>'):(this.resultsNrTag.style.display="block",this.titleBox.style.display="block",e+='\n <table>\n <thead> <tr>\n <th style="width: 24%;"></th>\n <th style="width: 20%;">\n <span info-sys-data="material-type">Material type</span>\n </th>\n <th style="width: 16%;">\n <span info-sys-data="space-group">Space group</span>\n </th>\n <th style="width: 22%;">\n <span info-sys-data="structure-type">Structure type</span>\n </th>\n <th style="width: 18%;">Nº calculations</th>\n </tr> </thead>\n <tbody>\n ',this.matMap.forEach((t,s)=>{let n=i.getSubscriptedFormula(s);e+='<tr> <td class="formula" colspan="5"><b>'+n+"</b>",t.length>1&&(e+='<span style="font-size: 0.86em;"> ('+t.length+" structures)</span>"),e+="</td></tr>",t.forEach(t=>{let s=void 0!==t.material_name?t.material_name:n;e+=`<tr class="mat-row" data-mat-id="${t.material_id}">\n <td > ${s} </td>\n <td style="text-align:center" >\n \x3c!--<span info-sys-data="material-type">--\x3e${t.material_type} \x3c!--</span>--\x3e\n </td>\n <td style="text-align:center" >\n ${void 0===t.space_group_number?"":t.space_group_number}\n </td>\n <td> ${void 0===t.structure_type?"":t.structure_type} </td>\n <td style="text-align:center" > ${t.n_matches} </td>\n </tr>`})}),e+=" </tbody> </table>"),this.resultsContainer.innerHTML=e,n.addToInfoSystem(this.resultsContainer)}}},function(e,t,s){"use strict";let i=s(0),n=s(3);e.exports=class{constructor(){this.element=document.createElement("div"),this.element.setAttribute("id","search-properties-box"),this.element.innerHTML='\n <div class="props-box-tabs-wrapper" style="float: left; width: 25%; ">\n\n <div class="properties-box-tabs" >\n <div data-tab="structure" class="props-tab-selected" >Structure </div>\n <div data-tab="results">Properties </div>\n <div data-tab="method">Method </div>\n \x3c!-- <div class="contributors-tab">Contributors </div> --\x3e\n </div>\n\n </div>\n\n <div class="properties-box-panel" style="float: left;width: 75%;height: 100%">\n\n <div class="props-tab-panel-wrapper" style="height: 86%" >\n\n <div class="structure-panel props-tab-panel" style="display: block">\n\n\n <div style="float: left; width: 47%;">\n\n <div class="field">\n <div class="field-title"><span info-sys-data="space-group">Space group number</span></div>\n <input type="text" class="space-group-number-field">\n </div>\n\n <div class="field">\n <div class="field-title">Material type</div>\n <input type="checkbox" class="material-type-field" value="bulk"> Bulk<br>\n <input type="checkbox" class="material-type-field" value="2D"> 2D<br>\n <input type="checkbox" class="material-type-field" value="1D"> 1D<br>\n </div>\n\n \x3c!--\n <div class="field">\n <div class="field-title"><span info-sys-data="mass-density">Mass density</span> <span style="font-weight: normal;">(kg/m<sup>3</sup>)</span></div>\n Min: <input type="text" class="mass-density-min-field"> \n Max: <input type="text" class="mass-density-max-field">\n </div>\n --\x3e\n\n </div>\n\n <div style="float: left; width: 5%;"></div>\n\n <div style="float: right; width: 47%;">\n\n <div class="field">\n <div class="field-title"><span info-sys-data="structure-type">Structure type</span></div>\n <select class="structure-type-field" style="max-width: 174px">\n <option></option>\n </select>\n </div>\n\n <div class="field">\n <div class="field-title"><span info-sys-data="crystal-system">Crystal system</span></div>\n <input type="checkbox" class="crystal-system-field" value="cubic">\n <span info-sys-data="crystal-system.value:cubic">Cubic</span><br>\n <input type="checkbox" class="crystal-system-field" value="hexagonal">\n <span info-sys-data="crystal-system.value:hexagonal">Hexagonal</span><br>\n <input type="checkbox" class="crystal-system-field" value="trigonal">\n <span info-sys-data="crystal-system.value:trigonal">Trigonal</span><br>\n <input type="checkbox" class="crystal-system-field" value="tetragonal">\n <span info-sys-data="crystal-system.value:tetragonal">Tetragonal</span><br>\n <input type="checkbox" class="crystal-system-field" value="orthorhombic">\n <span info-sys-data="crystal-system.value:orthorhombic">Orthorhombic</span><br>\n <input type="checkbox" class="crystal-system-field" value="monoclinic">\n <span info-sys-data="crystal-system.value:monoclinic">Monoclinic</span><br>\n <input type="checkbox" class="crystal-system-field" value="triclinic">\n <span info-sys-data="crystal-system.value:triclinic">Triclinic</span><br>\n </div>\n\n </div>\n <div style="clear: both;"></div>\n </div>\n\n <div class="results-panel props-tab-panel" >\n \x3c!--\n <div style="float: left; width: 47%;">\n <div class="field">\n <div class="field-title"><span info-sys-data="band-gap">Band gap</span> <span style="font-weight: normal;">(eV)</span></div>\n Min: <input type="text" class="band-gap-min-field"> \n Max: <input type="text" class="band-gap-max-field">\n </div>\n </div>\n\n <div style="float: left; width: 5%;"> </div>\n\n <div style="float: right; width: 47%;">\n <div class="field" style="padding-top: 28px;">\n <input type="radio" name="band-gap-type" value="d"> Direct<br>\n <input type="radio" name="band-gap-type" value="i"> Indirect<br>\n <input type="radio" name="band-gap-type" value="d/i" checked> Both<br>\n </div>\n </div>\n --\x3e\n <div style="clear: both;"></div>\n\n <div class="field" style="background-color: #CCC; padding: 10px;">\n <div style="font-weight: bold; padding-bottom: 6px" >Results containing...</div>\n <div style="float: left; width: 47%;">\n <input type="checkbox" class="has-band-structure-field" value="Band structure">\n <span info-sys-data="has-band-structure">Band structure</span><br>\n <input type="checkbox" class="has-dos-field" value="DOS">\n <span info-sys-data="has-dos">DOS</span><br>\n \x3c!--\n <input type="checkbox" class="has-fermi-surface-field" value="Fermi surface">\n <span info-sys-data="has-fermi-surface">Fermi surface</span><br>\n --\x3e\n </div>\n <div style="float: right; width: 47%;">\n <input type="checkbox" class="has-thermal-properties-field" value="Thermal properties">\n <span info-sys-data="has-thermal-properties">Thermal properties</span>\n <br>\n \x3c!-- <input type="checkbox" class="results-containing-field" value="EOS" disabled>Equation of state<br>--\x3e\n </div>\n <div style="clear: both;"></div>\n </div>\n\n </div>\n\n <div class="method-panel props-tab-panel" >\n <div style="float: left; width: 47%;">\n\n <div class="field">\n <div class="field-title"><span info-sys-data="functional-type">Functional type</span></div>\n <input type="checkbox" class="functional-type-field" value="LDA">\n <span info-sys-data="functional-type.value:LDA">LDA</span><br>\n <input type="checkbox" class="functional-type-field" value="GGA">\n <span info-sys-data="functional-type.value:GGA">GGA</span><br>\n <input type="checkbox" class="functional-type-field" value="meta-GGA">\n <span info-sys-data="functional-type.value:meta-GGA">meta-GGA</span><br>\n <input type="checkbox" class="functional-type-field" value="hybrid-GGA">\n <span info-sys-data="functional-type.value:hybrid-GGA">hybrid-GGA</span><br>\n <input type="checkbox" class="functional-type-field" value="hybrid-meta-GGA">\n <span info-sys-data="functional-type.value:hybrid-meta-GGA">hybrid-meta-GGA</span><br>\n <input type="checkbox" class="functional-type-field" value="HF">\n <span info-sys-data="functional-type.value:HF">HF</span><br>\n <input type="checkbox" class="functional-type-field" value="GW">\n <span info-sys-data="functional-type.value:GW">GW</span><br>\n </div>\n\n <div class="field">\n <div class="field-title"><span info-sys-data="code-name">Code name</span></div>\n <select class="code-name-field" >\n <option></option>\n </select>\n </div>\n\n </div>\n\n <div style="float: left; width: 5%;"> </div>\n\n <div style="float: right; width: 47%;">\n <div class="field">\n <div class="field-title"><span info-sys-data="basis-set">Basis set</span></div>\n <input type="checkbox" class="basis-set-field" value="(L)APW+lo">\n <span info-sys-data="basis-set.value:(L)APW+lo">(L)APW+lo</span><br>\n <input type="checkbox" class="basis-set-field" value="LCAO">\n <span info-sys-data="basis-set.value:LCAO">LCAO</span><br>\n <input type="checkbox" class="basis-set-field" value="gaussians">\n <span info-sys-data="basis-set.value:gaussians">gaussians</span><br>\n <input type="checkbox" class="basis-set-field" value="numeric AOs">\n <span info-sys-data="basis-set.value:numeric AOs">numeric AOs</span><br>\n <input type="checkbox" class="basis-set-field" value="plane waves">\n <span info-sys-data="basis-set.value:plane waves">plane waves</span><br>\n <input type="checkbox" class="basis-set-field" value="psinc functions">\n <span info-sys-data="basis-set.value:psinc functions">psinc functions</span><br>\n <input type="checkbox" class="basis-set-field" value="real-space grid">\n <span info-sys-data="basis-set.value:real-space grid">real-space grid</span><br>\n </div>\n </div>\n\n <div style="clear: both;"></div>\n </div>\n\n </div>\n\n\n <div class="properties-box-enter-button" style="height: 14%">\n <button disabled>Add to query</button>\n </div>\n\n </div>\n\n <div style="clear: both;"></div>\n ',this.tabsElement=this.element.querySelector(".properties-box-tabs"),this.tabSelected=this.element.querySelector('[data-tab="structure"]'),this.tabPanelSelected=this.element.querySelector(".structure-panel"),this.addButton=this.element.querySelector(".properties-box-enter-button button");let e=this.element.querySelector(".code-name-field"),t=i.serverReq(i.getSuggestionURL("code_name"),()=>{JSON.parse(t.response).code_name.forEach(t=>{e.innerHTML+="<option>"+t+"</option>"})}),s=this.element.querySelector(".structure-type-field"),a=i.serverReq(i.getSuggestionURL("structure_type"),()=>{JSON.parse(a.response).structure_type.forEach(e=>{s.innerHTML+="<option>"+e+"</option>"})});n.addToInfoSystem(this.element),this._events()}_events(){this.tabsElement.addEventListener("click",e=>{if(e.target!==e.currentTarget){null!==this.tabSelected&&(this.tabSelected.className=""),this.tabSelected=e.target,this.tabSelected.className="props-tab-selected";let t=e.target.getAttribute("data-tab");null!==this.tabPanelSelected&&(this.tabPanelSelected.style.display="none"),this.tabPanelSelected=this.element.getElementsByClassName(t+"-panel")[0],this.tabPanelSelected.style.display="block",this.checkPropsValues()}}),this.addButton.addEventListener("click",e=>{let t=this.getPropsWithValueFromCurrentTab(!0);this.addPropertiesListener(t),this.addButton.disabled=!0});let e=this.element.querySelector(".properties-box-panel");e.addEventListener("input",e=>{this.checkPropsValues()}),e.addEventListener("change",e=>{this.checkPropsValues()})}checkPropsValues(){let e=this.getPropsWithValueFromCurrentTab(!1);this.addButton.disabled=0===e.size}getPropsWithValueFromCurrentTab(e){let t=this.tabSelected.getAttribute("data-tab"),s=new Map;return"structure"===t?(this.addPropsFromTextFields(s,["space-group-number"],e),this.addPropsFromDropdownList(s,["structure-type"],e),this.addPropsFromCheckboxes(s,["material-type","crystal-system"],e)):"results"===t?this.addPropsFromCheckboxes(s,["has-band-structure","has-dos","has-fermi-surface","has-thermal-properties"],e):"method"===t&&(this.addPropsFromCheckboxes(s,["functional-type","basis-set"],e),this.addPropsFromDropdownList(s,["code-name"],e)),s}addPropsFromTextFields(e,t,s){t.forEach(t=>{let i=this.element.querySelector("."+t+"-field");""!==i.value&&(e.set(t,[i.value]),s&&(i.value=""))})}addPropsFromCheckboxes(e,t,s){t.forEach(t=>{let i=this.element.querySelectorAll("."+t+"-field"),n=[];for(var a=0;a<i.length;a++)i[a].checked&&(n.push(i[a].value),s&&(i[a].checked=!1));n.length>0&&e.set(t,n)})}addPropsFromDropdownList(e,t,s){t.forEach(t=>{let i=this.element.querySelector("."+t+"-field"),n=i.options[i.selectedIndex].value;n.length>2&&e.set(t,[n]),s&&(i.selectedIndex=0)})}addBandgapProps(e,t){let s=document.querySelector(".band-gap-min-field"),i=document.querySelector(".band-gap-max-field"),n="band-gap",a="Band Gap";if(""!==s.value&&(a=s.value+" < "+a,n+=":"+s.value,t&&(s.value="")),""!==i.value&&(a+=" < "+i.value,n+=":"+i.value,t&&(i.value="")),"Band Gap"!==a){let t=document.querySelector('input[name="band-gap-type"]:checked').value;"d"===t?n+=":True":"i"===t&&(n+=":False"),e.set(n,[a+" "+t])}}addMassDensityProps(e,t){let s=document.querySelector(".mass-density-min-field"),i=document.querySelector(".mass-density-max-field"),n="mass-density",a="Mass Density";""!==s.value&&(a=s.value+" < "+a,n+=":"+s.value,t&&(s.value="")),""!==i.value&&(a+=" < "+i.value,n+=":"+i.value,t&&(i.value="")),"Mass Density"!==a&&e.set(n,[a])}setAddPropertiesListener(e){this.addPropertiesListener=e}}}]); \ No newline at end of file diff --git a/client/src/material-mod/Overview.view.js b/client/src/material-mod/Overview.view.js index 6f21efce385fa35f1a2ec119adcdcde72beef529..89d826f82a448251792fa42468b72875275bee4a 100644 --- a/client/src/material-mod/Overview.view.js +++ b/client/src/material-mod/Overview.view.js @@ -67,8 +67,8 @@ class Overview { </div> <div class="footer"> - <div ><b><span>System type</span></b>: - <span class="system-type-field" ></span> + <div ><b><span>Material type</span></b>: + <span class="material-type-field" ></span> </div> <div class="space-group-field" style="display: none"> <b><span info-sys-data="space-group">Space group</span></b>: @@ -214,7 +214,7 @@ class Overview { this.materialTitle= this.element.getElementsByClassName('material-title')[0]; - this.systemType= this.element.querySelector('.system-type-field'); + this.systemType= this.element.querySelector('.material-type-field'); this.spaceGroupField = this.element.querySelector('.space-group-field'); this.spaceGroupValue = this.element.querySelector('.space-group-value'); this.structTypeField= this.element.querySelector('.structure-type-field'); @@ -311,8 +311,8 @@ class Overview { this.materialTitle.innerHTML= util.getMaterialTitle(data); this.materialId = data.material_id; - let isBulk = (data.system_type === 'bulk'); - this.systemType.textContent= data.system_type; + let isBulk = (data.material_type === 'bulk'); + this.systemType.textContent= data.material_type; this.structTypeField.style.display = (isBulk && data.structure_type !== null ? 'block' : 'none'); this.spaceGroupField.style.display = (isBulk ? 'block' : 'none'); diff --git a/client/src/material-mod/StructureDetails.view.js b/client/src/material-mod/StructureDetails.view.js index ac60fe6519f64bec41bd953a8b8a3986a03143cf..180915cd8841acc8c0fbb914988dfac2ceaf5f84 100644 --- a/client/src/material-mod/StructureDetails.view.js +++ b/client/src/material-mod/StructureDetails.view.js @@ -194,9 +194,9 @@ class StructureDetails extends DetailsViewBase { this.updateMarkedLeaf(leafId); }); - this.isBulk = (data.system_type === 'bulk'); + this.isBulk = (data.material_type === 'bulk'); - this.systemTypeField.textContent= data.system_type; + this.systemTypeField.textContent= data.material_type; this.structTypeField.style.display = (this.isBulk && data.structure_type !== null ? 'block' : 'none'); this.structPrototypeField.style.display = @@ -472,8 +472,8 @@ class TreeLeafViewer { // and calculation data. let materialData = DataStore.getMaterialData(); let materialId = materialData.material_id; - let is2Dsystem = (materialData.system_type === '2D'); - let isBulk = (materialData.system_type === 'bulk'); + let is2Dsystem = (materialData.material_type === '2D'); + let isBulk = (materialData.material_type === 'bulk'); let calc = DataStore.getCalc(calcId); let thereIsWyckoffData = DataStore.getMaterialData().has_free_wyckoff_parameters; @@ -725,8 +725,8 @@ class SummaryByFunctionalsComponent { * Called when a functional is selected. */ _setData() { - let is2Dsystem = (DataStore.getMaterialData().system_type === '2D'); - let isBulk = (DataStore.getMaterialData().system_type === 'bulk'); + let is2Dsystem = (DataStore.getMaterialData().material_type === '2D'); + let isBulk = (DataStore.getMaterialData().material_type === 'bulk'); let functional = this.functional; let calcs = Array.from(this.calcMapByFunctional.get(this.functional)); let matId = DataStore.getMaterialData().material_id; diff --git a/client/src/search-mod/MaterialList.view.js b/client/src/search-mod/MaterialList.view.js index 0be41e57d6d1707df6968079390714624d20b118..70f038f05ed7873262600910c1e84a7acf7838ae 100644 --- a/client/src/search-mod/MaterialList.view.js +++ b/client/src/search-mod/MaterialList.view.js @@ -233,7 +233,7 @@ class MaterialList { <thead> <tr> <th style="width: 24%;"></th> <th style="width: 20%;"> - <span info-sys-data="system-type">System type</span> + <span info-sys-data="material-type">Material type</span> </th> <th style="width: 16%;"> <span info-sys-data="space-group">Space group</span> @@ -260,7 +260,7 @@ class MaterialList { `<tr class="mat-row" data-mat-id="${mat.material_id}"> <td > ${label} </td> <td style="text-align:center" > - <!--<span info-sys-data="system-type">-->${mat.system_type} <!--</span>--> + <!--<span info-sys-data="material-type">-->${mat.material_type} <!--</span>--> </td> <td style="text-align:center" > ${mat.space_group_number === undefined ? '' : mat.space_group_number} diff --git a/client/src/search-mod/PropertiesBox.view.js b/client/src/search-mod/PropertiesBox.view.js index d990079e24c40cf30feb51b17ed7112795b4873e..a99ba60d073cc14901e09777690a4fd6c5864672 100644 --- a/client/src/search-mod/PropertiesBox.view.js +++ b/client/src/search-mod/PropertiesBox.view.js @@ -64,10 +64,10 @@ class PropertiesBox { </div> <div class="field"> - <div class="field-title">System type</div> - <input type="checkbox" class="system-type-field" value="bulk"> Bulk<br> - <input type="checkbox" class="system-type-field" value="2D"> 2D<br> - <input type="checkbox" class="system-type-field" value="1D"> 1D<br> + <div class="field-title">Material type</div> + <input type="checkbox" class="material-type-field" value="bulk"> Bulk<br> + <input type="checkbox" class="material-type-field" value="2D"> 2D<br> + <input type="checkbox" class="material-type-field" value="1D"> 1D<br> </div> <!-- @@ -184,12 +184,6 @@ class PropertiesBox { <select class="code-name-field" > <option></option> </select> - <!-- - <input type="checkbox" class="code-name-field" value="VASP">VASP<br> - <input type="checkbox" class="code-name-field" value="quantum-espresso">Quantum Espresso<br> - <input type="checkbox" class="code-name-field" value="FHI-aims">FHI-aims<br> - <input type="checkbox" class="code-name-field" value="exciting">exciting<br> - --> </div> </div> @@ -198,21 +192,21 @@ class PropertiesBox { <div style="float: right; width: 47%;"> <div class="field"> - <div class="field-title"><span info-sys-data="basis-set-type">Basis set</span></div> - <input type="checkbox" class="basis-set-type-field" value="(L)APW+lo"> - <span info-sys-data="basis-set-type.value:(L)APW+lo">(L)APW+lo</span><br> - <input type="checkbox" class="basis-set-type-field" value="FLAPW"> - <span info-sys-data="basis-set-type.value:FLAPW">FLAPW</span><br> - <input type="checkbox" class="basis-set-type-field" value="gaussians"> - <span info-sys-data="basis-set-type.value:gaussians">gaussians</span><br> - <input type="checkbox" class="basis-set-type-field" value="numeric AOs"> - <span info-sys-data="basis-set-type.value:numeric AOs">numeric AOs</span><br> - <input type="checkbox" class="basis-set-type-field" value="plane waves"> - <span info-sys-data="basis-set-type.value:plane waves">plane waves</span><br> - <input type="checkbox" class="basis-set-type-field" value="psinc functions"> - <span info-sys-data="basis-set-type.value:psinc functions">psinc functions</span><br> - <input type="checkbox" class="basis-set-type-field" value="real-space grid"> - <span info-sys-data="basis-set-type.value:real-space grid">real-space grid</span><br> + <div class="field-title"><span info-sys-data="basis-set">Basis set</span></div> + <input type="checkbox" class="basis-set-field" value="(L)APW+lo"> + <span info-sys-data="basis-set.value:(L)APW+lo">(L)APW+lo</span><br> + <input type="checkbox" class="basis-set-field" value="LCAO"> + <span info-sys-data="basis-set.value:LCAO">LCAO</span><br> + <input type="checkbox" class="basis-set-field" value="gaussians"> + <span info-sys-data="basis-set.value:gaussians">gaussians</span><br> + <input type="checkbox" class="basis-set-field" value="numeric AOs"> + <span info-sys-data="basis-set.value:numeric AOs">numeric AOs</span><br> + <input type="checkbox" class="basis-set-field" value="plane waves"> + <span info-sys-data="basis-set.value:plane waves">plane waves</span><br> + <input type="checkbox" class="basis-set-field" value="psinc functions"> + <span info-sys-data="basis-set.value:psinc functions">psinc functions</span><br> + <input type="checkbox" class="basis-set-field" value="real-space grid"> + <span info-sys-data="basis-set.value:real-space grid">real-space grid</span><br> </div> </div> @@ -309,7 +303,7 @@ class PropertiesBox { if (tabString === 'structure'){ this.addPropsFromTextFields(propsMap,['space-group-number'], reset); this.addPropsFromDropdownList(propsMap,['structure-type'], reset); - this.addPropsFromCheckboxes(propsMap,['system-type','crystal-system'], reset); + this.addPropsFromCheckboxes(propsMap,['material-type', 'crystal-system'], reset); // this.addMassDensityProps(propsMap, reset); }else if (tabString === 'results'){ // this.addBandgapProps(propsMap, reset); @@ -317,7 +311,7 @@ class PropertiesBox { 'has-fermi-surface', 'has-thermal-properties'], reset); }else if (tabString === 'method'){ - this.addPropsFromCheckboxes(propsMap,['functional-type','basis-set-type'], reset); + this.addPropsFromCheckboxes(propsMap,['functional-type','basis-set'], reset); this.addPropsFromDropdownList(propsMap,['code-name'], reset); }//else if (this.tabSelected.className === 'contributors-tab'){ //this.addPropsFromTextFields(propsMap,['contributors']);}