var r=!0,t=null,z=!1,WEBPATH="https://cdn.originpc.com/v3images",wordToReplace=window.location.origin,pattern,configuratorApp,configuratorDesignApp,configuratorBuildApp,configuratorServicesApp,configuratorAccessoriesApp,formulasApp,configuratorMatchCApp,configuratorToolsApp,cartApp;console.log(wordToReplace);console.log(window.location.href.toLowerCase());wordToReplace=window.location.href.toLowerCase().indexOf("load")>=0?wordToReplace+"/configurator/load":window.location.href.toLowerCase().indexOf("edit")>=0?wordToReplace+"/configurator/edit":window.location.href.toLowerCase().indexOf("dynamic")>=0?wordToReplace+"/configurator/dynamic":window.location.href.toLowerCase().indexOf("configurator")>=0?wordToReplace+"/configurator":wordToReplace;pattern=new RegExp(wordToReplace,"gi");window.keyshotVR=function(n,i,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g,nt,tt,it,rt,ut,ft,et){function pi(n,i,r){n.removeEventListener?n.removeEventListener(i,r,z):n.detachEvent&&(n.detachEvent("on"+i,n["e"+i+r]),n["e"+i+r]=t)}function yt(n,t,i){n.addEventListener?n.addEventListener(t,i,z):n.attachEvent&&(n["e"+t+i]=i,n.attachEvent("on"+t,function(){n["e"+t+i]()}))}function gi(){var n=z;return-1!==navigator.platform.toString().indexOf("Win")&&-1!==navigator.appVersion.indexOf("MSIE")&&(n=r),n}function vr(){var t=document.getElementById(n),i=t.requestFullScreen||t.webkitRequestFullScreen||t.mozRequestFullScreen||t.msRequestFullScreen;"undefined"!=typeof i&&i&&i.call(t)}function yr(n){ot.ma=z;n.pointerId in ot.F&&delete ot.F[n.pointerId];or(n)}function pr(n){ot.ma&&(ot.F[n.pointerId]=[n.pageX,n.pageY],fr(n))}function wr(n){ot.ma=r;ot.F[n.pointerId]=[n.pageX,n.pageY];ur(n)}function nr(){ot.l?(setTimeout(function(){ot.u(z)},20),setTimeout(function(){ot.u(r)},120)):(setTimeout(function(){ot.u(r)},20),setTimeout(function(){ot.u(z)},120))}function ei(){var t={x:0,y:0},n=kt;if(n.offsetParent)do t.x+=n.offsetLeft,t.y+=n.offsetTop;while(n===n.offsetParent);return t}function tr(){var n=ct.g;ct.g=1;n!==ct.g&&ot.T(ot.v()*n/ct.g);bt.setAttribute("width",ii.width);ot.l?(bt.removeAttribute("height"),bt.style.width="100%",bt.style[yi]="scale("+ct.n+")",bt.style.height="auto",kt.style["background-color"]=ot.backgroundColor,document.body.style["background-color"]=ot.backgroundColor):(bt.setAttribute("height",ii.height),bt.style[yi]="translate("+-ii.width/2+"px,"+-ii.height/2+"px) scale("+ct.g+") translate("+.5*ri.width/ct.g+"px,"+.5*ri.height/ct.g+"px) translate("+ct.j+"px,"+ct.k+"px) scale("+ct.n+")",bt.style["max-width"]="",bt.style.width="",bt.style.height="",kt.style["background-color"]=ot.backgroundColor)}function hi(){ot.Sa(ot.h.offsetWidth,ot.h.offsetHeight)}function ir(n,t){wt.start.x=n;wt.start.y=t;wt.a.x=n;wt.a.y=t;vt.a.x=n;vt.a.y=t}function rr(n,t){wt.b.x=n-wt.a.x;wt.b.y=t-wt.a.y;wt.n.x=n;wt.n.y=t;wt.a.x=n;wt.a.y=t}function fi(n){n||(n=window.event);var t=0;n.keyCode?t=n.keyCode:n.which&&(t=n.which);1===t?lt.d|=1:1<t&&(lt.d|=2);ot.va(n);n.preventDefault?n.preventDefault():n.returnValue=z}function oi(n){n||(n=window.event);var t=ei();ot.cursor.x=n.pageX-t.x+at.left;ot.cursor.y=n.pageY-t.y+at.top;n.preventDefault?n.preventDefault():n.returnValue=z;0<lt.d&&(1===lt.d?rr(n.pageX,n.pageY):2===lt.d?(n=ot.cursor.y-ui.start.y,t=ot.v(),ot.T(ct.t*Math.exp(n/200)),n=ot.v(),ct.j+=parseFloat(ot.e*t-ot.e*n),ct.k+=parseFloat(ot.f*t-ot.f*n)):3===lt.d&&(t=ot.cursor.x-ui.start.x,n=ot.cursor.y-ui.start.y,ct.j+=parseFloat((t-ct.m.x)/ct.g),ct.k+=parseFloat((n-ct.m.y)/ct.g),ct.m.x=t,ct.m.y=n))}function ci(n){n||(n=window.event);var t=0;n.keyCode?t=n.keyCode:n.which&&(t=n.which);1===t?lt.d&=-2:1<t&&(lt.d&=-3);ot.va(n);n.preventDefault?n.preventDefault():n.returnValue=z}function wi(n){ot.Za&&(n=n?n:window.event,ot.Ga(0<(n.detail?-1*n.detail:n.wheelDelta/40)?1:-1),hr(n))}function ur(n){var t,i,r;if(n||(n=window.event),t=er(),i=ei(),ot.cursor.x=t[0].pageX-i.x+at.left,ot.cursor.y=t[0].pageY-i.y+at.top,1===t.length&&t[0])if(lt.start.x=t[0].pageX,lt.start.y=t[0].pageY,lt.a.x=t[0].pageX,lt.a.y=t[0].pageY,ot.pa=t[0].target,ot.pa===ot.r)lt.d=1,ir(t[0].pageX,t[0].pageY);else for(r=ot.pa;r&&r!==ot.r;)r.onclick&&r.onclick(),r=r.parentNode;if(2===t.length&&t[0]&&t[1]){lt.d=3;lt.ba.x=t[0].pageX-i.x+at.left;lt.ba.y=t[0].pageY-i.y+at.top;lt.ca.x=t[1].pageX-i.x+at.left;lt.ca.y=t[1].pageY-i.y+at.top;var r=t[0].pageX-t[1].pageX,u=t[0].pageY-t[1].pageY,f=(t[0].pageX-i.x+at.left+(t[1].pageX-i.x+at.left))/2,t=(t[0].pageY-i.y+at.top+(t[1].pageY-i.y+at.top))/2;ct.oa=z;ct.Ta=Math.sqrt(r*r+u*u);ct.t=ot.v();ot.e=parseFloat(f-.5*ri.width);ot.f=parseFloat(t-.5*ri.height);ot.e*=parseFloat(ot.R);ot.f*=parseFloat(ot.R);ot.e-=parseFloat(ct.j);ot.f-=parseFloat(ct.k);ot.e/=parseFloat(ct.t);ot.f/=parseFloat(ct.t)}n.preventDefault()}function fr(n){var t,u;if(n||(n=window.event),t=er(),u=ei(),ot.cursor.x=t[0].pageX-u.x+at.left,ot.cursor.y=t[0].pageY-u.y+at.top,1===t.length&&t[0]&&(lt.a.x=t[0].pageX,lt.a.y=t[0].pageY,0<=lt.d&&rr(lt.a.x,lt.a.y)),2===t.length&&t[0]&&t[1]){var i=ot.v(),f=t[0].pageX-t[1].pageX,e=t[0].pageY-t[1].pageY;ot.T(ct.t/ct.Ta*Math.sqrt(f*f+e*e));f=ot.v();e=ot.f*i-ot.f*f;ct.j+=ot.e*i-ot.e*f;ct.k+=e;i=(ot.cursor.x+t[1].pageX-u.x+at.left)/2-(lt.ba.x+lt.ca.x)/2;t=(ot.cursor.y+t[1].pageY-u.y+at.top)/2-(lt.ba.y+lt.ca.y)/2;ct.oa===z&&(ct.m.x=i,ct.m.y=t,ct.oa=r);ct.j+=(i-ct.m.x)/ct.g;ct.k+=(t-ct.m.y)/ct.g;ct.m.x=i;ct.m.y=t}n.preventDefault()}function er(){var t,i,n;if(!gi())return window.event.touches;t=[];for(id in ot.F)i=ot.F[id],n={},n.pageX=i[0],n.pageY=i[1],n.target=ot.r,n.preventDefault=function(){},t.push(n);return t}function or(n){n.preventDefault();ot.pa=t;lt.d=0;var i=(new Date).getTime(),r=i-(vi||i+1);clearTimeout(ki);500>r&&0<r||(vi=i,ki=setTimeout(function(){clearTimeout(ki)},500,[n]));vi=i}function br(n){n.preventDefault();lt.d=0}function bi(){var i,n,t,u,f;if(lr(bi),ot.W===ot.Z&&(1===lt.d?.01<vt.L?(vt.b.x=.4*(wt.a.x-vt.a.x),vt.b.y=.4*(wt.a.y-vt.a.y),vt.a.x+=vt.b.x,vt.a.y+=vt.b.y,ot.la(vt.b.x,vt.b.y)):(ot.la(wt.b.x,wt.b.y),wt.b.x=0,wt.b.y=0):.01<vt.L&&(vt.b.x*=vt.L,vt.b.y*=vt.L,.055>vt.b.x*vt.b.x+vt.b.y*vt.b.y&&(vt.b.x=0,vt.b.y=0,wt.b.x=0,wt.b.y=0,wt.a.x=vt.a.x,wt.a.y=vt.a.y),(0!==vt.b.x||0!==vt.b.y)&&ot.la(vt.b.x,vt.b.y))),ot.Ba(),i=0,-1===ot.ga){for(n=1,n=0;n<ot.G.length;n++){if(t=ot.B[n],0===ot.w[t]&&ot.G[n].complete){if(ot.D[t]=ot.w[t],ot.w[t]=-1,ot.W===ot.Z&&(u=ot.G.length+ot.za,u>ht.q&&(u=ht.q),u-=i))for(f=0;f<u;f++)ot.fa();ht.J=r;0===n&&ot.Ba()}-1!==ot.D[t]&&i++}n=parseFloat(i/ht.q);ot.Ra(n);i===ht.q&&(ot.ga=0,ot.Qa())}}function sr(n){keycode=(n?n:window.event).keyCode;switch(keycode){case 13:nr();hr(n)}}function hr(n){n=n?n:window.event;n.preventDefault()?n.preventDefault():n.returnValue=z}var li="/",si=window.location.href.slice(0,window.location.href.lastIndexOf("/")),cr=si.lastIndexOf("/"),ai,ki,vi,lr,at,ht,ii,gt,ni,st,di;if(0<=cr&&(li=si.substr(0,cr+1)),ai=si=z,this.Za=p!==w,this.ma=z,this.F=[],this.Ba=function(){var n,t;ht.J&&(ht.J=z,n=parseInt(ht.K*ht.c+ht.I),-1!==ot.D[n]&&(ar.setAttribute("src",ot.C[n].replace(pattern,WEBPATH)),void 0!==et)&&((n=ot.ha[n],n||void 0!==et[n])?(document.getElementById("vr_hotspot")&&(t=document.getElementById("vr_hotspot"),document.body.removeChild(t)),t=document.createElement("div"),t.innerHTML=et[n].text,t.id="vr_hotspot",t.style.position="absolute",t.style.left=et[n].position.x+"px",t.style.top=et[n].position.y+"px",t.style.color="#000000",void 0!==et[n].fb&&(et[n].options.fontSize&&(t.style.fontSize=et[n].options.fontSize),et[n].options.Ha&&(t.style.color=et[n].options.Ha),et[n].options.bgColor&&(t.style.backgroundColor=et[n].options.bgColor),et[n].options.link&&(t.href=et[n].options.link),et[n].options.height&&(t.style.height=et[n].options.height),et[n].options.width&&(t.style.width=et[n].options.width),et[n].options.textAlign&&(t.style.textAlign=et[n].options.textAlign)),document.body.appendChild(t)):document.getElementById("vr_hotspot")&&(t=document.getElementById("vr_hotspot"),document.body.removeChild(t))));(ct.n!==ct.a||ct.j!==ct.wa||ct.k!==ct.xa)&&(ct.a=ct.n,ct.wa=ct.j,ct.xa=ct.k,tr())},this.bb=function(n){for(var f,r,e=-1e3,o=n,t=parseFloat(parseInt(n%ht.c)),i=parseFloat(parseInt(n/ht.c)),t=t/ht.c,t=t*2*Math.PI,i=i/ht.i,i=i*Math.PI,n=Math.sin(t),t=Math.cos(t),i=Math.cos(i),u=Math.sqrt(n*n+t*t+i*i),n=n/u,t=t/u,i=i/u,u=0;u<ot.G.length;u++)f=ot.B[u],-1!==ot.D[f]&&(r=ot.Da[f].Xa,r=n*r.x+t*r.y+i*r.Ya,e<r&&(e=r,o=f));return o},this.fa=function(){var t,i;if(ot.na<ht.q){t=new Image;i=ot.B[ot.na];ot.w[i]=0;t.src=ot.C[i].replace(pattern,WEBPATH);ot.G.push(t);var n=parseInt(i%ht.c),r=parseInt(i/ht.c),n=n/ht.c,n=n*2*Math.PI,r=r/ht.i,r=r*Math.PI,t=Math.sin(n),n=Math.cos(n),r=Math.cos(r),u=Math.sqrt(t*t+n*n+r*r);ot.Da[i]={Xa:{x:t/u,y:n/u,Ya:r/u}};ot.na++}},this.Fa=function(){for(var t=ht.qa,r=ht.ra,n=2,e=parseFloat(ht.c/n),h=parseFloat(ht.i/n),l=ht.q,u=0,f=0,a=0,c=0,i=0;ot.P<l;){var o=parseInt(t%ht.c),s=parseInt(r%ht.i),i=parseInt(s*ht.c+o);if(ot.C[i]||(ot.B[ot.P]=i,ot.P++,ot.C[i]=ot.ua(o,s),void 0!==et&&et[s+"_"+o]&&(ot.ha[i]=s+"_"+o)),0===u&&(t+=e,f++),1===u&&(r+=h,a++),c++,c>=n)if(c=0,0===u)u=1,f=0;else if(1===u&&(t+=e,f++,f>=n/2)){if(n*=2,t=ht.qa,r=ht.ra,e=parseFloat(ht.c/n),h=parseFloat(ht.i/n),1>e&&1>h){for(t=0;t<l;t++)r=parseInt(t%ht.c),n=parseInt(t/ht.c),i=parseInt(n*ht.c+r),ot.C[i]||(ot.B[ot.P]=i,ot.P++,ot.C[i]=ot.ua(r,n),void 0!==et&&et[n+"_"+r]&&(ot.ha[i]=n+"_"+r));break}u=a=f=0}}},this.ua=function(n,t){return li+ot.s+"/"+parseInt(t)+"_"+parseInt(n)+"."+nt},this.la=function(n,t){var n=n*(1<ht.c?ot.Va:0),t=t*(1<ht.i?ot.Wa:0),f=Math.sqrt(n*n+t*t),u,i;if(.0001<f&&(ht.da+=n,ht.ea+=t,ht.z+=f,1<ht.z)){if(f=parseInt(ht.z),u=Math.atan2(ht.da,ht.ea),ht.z-=f,ht.da=0,ht.ea=0,0>u&&(u+=2*Math.PI),u+=Math.PI/8,u=parseInt(u/(Math.PI/4)),0>u&&(u+=8),u%=8,0!==gt[u]){if(ut?(i=ht.I,i=i-f*gt[u]):(i=ht.I,i+=f*gt[u]),ht.Ca){for(;0>i;)i+=ht.c;for(;i>=ht.c;)i-=ht.c}else i>=ht.c&&(i=ht.c-1),0>i&&(i=0);ht.I!==i&&(ht.I=i,ht.J=r)}if(0!==ni[u]){if(ft?(i=ht.K,i-=f*ni[u]):(i=ht.K,i+=f*ni[u]),ht.Ea){for(;0>i;)i+=ht.i;for(;i>=ht.i;)i-=ht.i}else i>=ht.i&&(i=ht.i-1),0>i&&(i=0);ht.K!==i&&(ht.K=i,ht.J=r)}}},this.Ua=function(){ot.u(!ot.l);ot.l?ot.H.setAttribute("src","https://cdn.originpc.com/img/configurator/GoFullScreenIcon.png"):ot.H.setAttribute("src","https://cdn.originpc.com/img/configurator/GoFixedSizeIcon.png")},this.u=function(n){ot.l=n;ot.l?(dt.style.position="relative",dt.style.left="0px",dt.style.top="0px",document.body.style.overflow=""):(dt.style.position="absolute",n=ei(),dt.style.left=window.pageXOffset-n.x+at.left+"px",dt.style.top=window.pageYOffset-n.y+at.top+"px",document.body.style.overflow="hidden");document.body.style.margin="0";document.body.style.padding="0";hi()},this.Ja=function(){var n=new Image;n.src=ot.O.src.replace(pattern,WEBPATH);ot.G[ot.Y]=n;n=ot.B[ot.Y];ot.D[n]=ot.w[n];ot.w[n]=-1;ot.Y++;ht.J=r;ot.Y===ht.q&&(ot.ga=0,ot.Ka())},vi=t,this.va=function(n){var t=ei();ot.cursor.x=n.pageX-t.x+at.left;ot.cursor.y=n.pageY-t.y+at.top;1===lt.d?ir(n.pageX,n.pageY):2===lt.d?(ui.start.x=ot.cursor.x,ui.start.y=ot.cursor.y,ct.t=ot.v(),ot.e=ot.cursor.x-.5*ri.width,ot.f=ot.cursor.y-.5*ri.height,ot.e*=ot.R,ot.f*=ot.R,ot.e-=ct.j,ot.f-=ct.k,ot.e/=ct.t,ot.f/=ct.t):3===lt.d&&(ui.start.x=ot.cursor.x,ui.start.y=ot.cursor.y,ct.m.x=0,ct.m.y=0)},this.Ga=function(n){ot.T(ct.n*Math.exp(-n/50))},this.v=function(){return ct.n},this.T=function(n){n>ct.ja/ct.g&&(n=ct.ja/ct.g);n<ct.ka/ct.g&&(n=ct.ka/ct.g);ct.n=n},this.ab=function(n,t,i,r){at.left=n;at.top=t;at.right=i;at.bottom=r;hi()},this.Sa=function(n,t){ot.l||(n=window.innerWidth,t=window.innerHeight);var r=n-at.left-at.right,i=t-at.top-at.bottom;ri.width=r;ri.height=i;kt.style.width=r+"px";ot.l&&window.innerHeight<ii.height&&(i=window.innerHeight);kt.style.height=i+"px";kt.style.left=at.left+"px";kt.style.top=at.top+"px";tr();pt.style.width=n+"px";ot.l&&window.innerHeight<ii.height&&(t=window.innerHeight);pt.style.height=t+"px";ot.h.style.height=t+"px";pt.Aa&&pt.Aa(n,t)},this.U=function(n){yt(n,"mousedown",fi);yt(n,"mousemove",oi);yt(n,"mouseup",ci)},this.aa=function(n){pi(n,"mousedown",fi);pi(n,"mousemove",oi);pi(n,"mouseup",ci)},this.Qa=function(){ot.p&&(ot.p.style.visibility="hidden",ot.aa(ot.p),ot.aa(ot.Q),ot.aa(ot.o))},this.Ka=function(){ot.A.style.visibility="hidden";ot.aa(ot.A)},lr=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(n){window.setTimeout(n,10)},this.ta=function(){ot.p=document.createElement("div");ot.U(ot.p);ot.p.V=function(){this.parentNode&&(this.style.left="16px",this.style.top="16px")};st="position:absolute;";st+="left: 0px;";st+="top:  0px;";st+="width: 80px;";st+="height: 80px;";st+=ti+"transform-origin: 50% 50%;";st+="visibility: inherit;";ot.p.setAttribute("style",st);ot.Q=document.createElement("div");ot.U(ot.Q);st="position:absolute;";st+="left: 0px;";st+="top:  29px;";st+="width: 80px;";st+="height: 80px;";st+=ti+"transform-origin: 50% 50%;";st+="opacity: 1.0;";st+="visibility: inherit;";st+="border: 0px solid #000000;";st+="color: #ffffff;";st+="text-align: left;";st+="white-space: nowrap;";st+="padding: 0px 0px 0px 0px;";st+="overflow: hidden;";st+="display: flex;";ot.Q.setAttribute("style",st);ot.o=document.createElement("div");ot.U(ot.o);ot.o.$={Ma:0,Na:0,ia:0,Oa:1,Pa:1,eb:1};st="left: 0px;";st+="top:  0px;";st+="width: 80px;";st+="height: 80px;";st+=ti+"transform-origin: 50% 50%;";st+="opacity: 1.0;";st+="visibility: inherit;";st+="border: 0px solid #000000;";st+="color: #ffffff;";st+="text-align: left;";st+="white-space: nowrap;";st+="padding: 0px 0px 0px 0px;";st+="overflow: hidden;";var n=it;""===n&&(n="ks_logo.png");ot.o.setAttribute("style",st);ot.o.innerHTML='<img src="http://cdn.originpc.com/img/configurator/spinner.svg"><\/img>';ot.p.appendChild(ot.o);ot.p.appendChild(ot.Q);pt.appendChild(ot.p);ot.u(ot.l);setTimeout(function(){ot.u(ot.l)},10)},this.Ra=function(n){if(ot.p){if(ot.Q.innerHTML="<center style='display: flex; width: 100%; align-items: center; justify-content: center;'>"+parseInt(100*n)+"<\/center>",ot.o.$.ia+=2.1,n="",ot.o.$)var t=ot.o.$,n=n+("translate("+t.Ma+"px,"+t.Na+"px) rotate("+t.ia+"deg) scale("+t.Oa+","+t.Pa+") ");ot.o.style[yi]=n+"scale(1.0,1.0)"}},this.sa=function(){ai=r;bi()},this.ya=function(){if(yt(window,"resize",hi),rt&&yt(pt,"dblclick",vr),gi())if(yt(window,"mousewheel",wi),yt(window,"keydown",sr),/Tablet PC/i.test(navigator.userAgent)&&window.$a){var n=new MSGesture;n.target=ot.h;ot.h.Ia=n;ot.h.Ia.pointerType=t;ot.h.gb=[];yt(ot.h,"MSPointerDown",wr);yt(ot.h,"MSPointerMove",pr);yt(ot.h,"MSPointerUp",yr)}else yt(pt,"mousedown",fi),yt(bt,"mousedown",fi),yt(pt,"mousemove",oi),yt(bt,"mousemove",oi),yt(document,"mouseup",ci);else pt.addEventListener&&(yt(document,"mouseup",ci),yt(pt,"mousewheel",wi),yt(document,"keydown",sr),yt(pt,"mousedown",fi),yt(bt,"mousedown",fi),yt(pt,"mousemove",oi),yt(pt,"touchstart",ur),yt(pt,"touchmove",fr),yt(pt,"touchcancel",br),yt(pt,"touchend",or),yt(pt,"DOMMouseScroll",wi),yt(window,"orientationchange",nr))},document.createElement("canvas").getContext){var ot=this,dt=ot.h=t,kt=t,ar=t,pt=t,bt=t;ot.l=k;ot.s=i;ot.cb=z;ot.Z=z;ot.W=g;ot.hb=0;ot.P=0;ot.Va=parseFloat(l);ot.Wa=parseFloat(a);ot.za=1;ot.Y=0;ot.ga=-1;at={left:0,top:0,right:0,bottom:0};ht={I:0,K:0,c:1,i:1,qa:0,ra:0,z:0,da:0,ea:0,J:z,q:0,Ca:r,Ea:z};v||(v=0);y||(y=0);ht.qa=v;ht.ra=y;ht.I=v;ht.K=y;ht.c=o;ht.i=s;ht.Ca=h;ht.Ea=c;ht.q=ht.c*ht.i;ii={width:0,height:0};ii.width=u;ii.height=f;var ti="",yi="transform",ri={x:640,y:480},ct={n:1,t:1,a:-1,j:0,k:0,wa:-1,xa:-1,g:1,ka:1,ja:1,m:{x:0,y:0},oa:z};ct.ka=parseFloat(p);ct.ja=parseFloat(w);var wt={start:{x:0,y:0},a:{x:0,y:0},La:{x:0,y:0},n:{x:0,y:0},b:{x:0,y:0}},ui={start:{x:0,y:0}},lt={d:0,start:{x:0,y:0},a:{x:0,y:0},La:{x:0,y:0},n:{x:0,y:0},b:{x:0,y:0},ba:{x:0,y:0},ca:{x:0,y:0}},vt={a:{x:0,y:0},b:{x:0,y:0},L:.96};for(vt.L=b,ot.cursor={x:0,y:0},gt=[],ni=[],gt[0]=0,ni[0]=1,gt[1]=1,ni[1]=1,gt[2]=1,ni[2]=0,gt[3]=1,ni[3]=-1,gt[4]=0,ni[4]=-1,gt[5]=-1,ni[5]=-1,gt[6]=-1,ni[6]=0,gt[7]=-1,ni[7]=1,ot.e=0,ot.f=0,ot.na=0,ot.G=[],ot.B=[],ot.w=[],ot.D=[],ot.Da=[],i=0;i<ht.q;i++)ot.w[i]=-1,ot.D[i]=-1;for(ot.C=[],ot.ha=[],i=["Webkit","Moz","0","ms","Ms"],o=0;o<i.length;o++)"undefined"!=typeof document.documentElement.style[i[o]+"Transform"]&&(ti="-"+i[o].toLowerCase()+"-",yi=i[o]+"Transform");st="";ot.h=document.getElementById(n);st="width: "+u+"px;";st+="height: "+f+"px;";st+="max-width: 100%;";ot.h.setAttribute("style",st);dt=document.createElement("div");dt.setAttribute("id","viewwindow");st="top:  0px;";st+="left: 0px;";st+="position: relative;";dt.setAttribute("style",st);ot.h.appendChild(dt);kt=document.createElement("div");kt.setAttribute("id","turntable");st="top:  0px;";st+="left: 0px;";st+="overflow: hidden;";st+="position:absolute;";st+=ti+"user-select: none;";kt.setAttribute("style",st);dt.appendChild(kt);bt=document.createElement("img");bt.setAttribute("id","backbuffer");st="top:  0px;";st+="left: 0px;";st+="position:absolute;";st+=ti+"user-select: none;";bt.setAttribute("style",st);kt.appendChild(bt);ar=bt;pt=document.createElement("div");ot.r=pt;st="top:  0px;";st+="left: 0px;";st+="width:  100px;";st+="height: 100px;";st+="overflow: hidden;";st+="position:absolute;";st+="z-index: 522;";st+=ti+"user-select: none;";pt.setAttribute("style",st);dt.appendChild(pt);pt.Aa=function(n,t){var r=[],i,u;for(r.push(this);0<r.length;)if(i=r.pop(),i.V&&i.V(n,t),i.hasChildNodes())for(u=0;u<i.childNodes.length;u++)r.push(i.childNodes[u])};this.A=document.createElement("div");st="position:absolute;";st+="left: 0px;";st+="top:  0px;";st+="width: 256px;";st+="height: 256px;";st+="opacity: 0.0;";st+=ti+"transform-origin: 50% 50%;";st+="visibility: inherit;";st+="display: none";this.A.setAttribute("style",st);this.O=document.createElement("img");this.O.setAttribute("width",256);this.O.setAttribute("height",256);this.O.onload=function(){ot.Ja()};ot.U(this.A);this.A.appendChild(this.O);pt.appendChild(this.A);this.backgroundColor=kt.style.backgroundColor=e;d&&(ot.S=document.createElement("div"),st="position:absolute;",st+="width: 38px;",st+="height: 32px;",st+=ti+"transform-origin: 50% 50%;",st+="visibility: inherit;",st+="cursor: pointer;",ot.S.setAttribute("style",st),ot.H=document.createElement("img"),ot.l?ot.H.setAttribute("src",li.replace(pattern,WEBPATH)+ot.s.replace(pattern,WEBPATH)+"/files/GoFullScreenIcon.png"):ot.H.setAttribute("src",li+ot.s+"/files/GoFixedSizeIcon.png"),ot.H.setAttribute("style","position: absolute;top: 0px;left: 0px;width: 38px;height: 32px;"),ot.S.appendChild(ot.H),ot.S.V=function(n,t){this.style.left=n-38+"px";this.style.top=t-32+"px"},ot.S.onclick=function(){ot.Ua()},ot.r.appendChild(ot.S));ot.W?(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(si=r),ot.M=document.createElement("div"),st="position:absolute;",st+="width: 92px;",st+="height: 92px;",st+=ti+"transform-origin: 50% 50%;",st+="visibility: inherit;",st+="cursor: pointer;",ot.M.setAttribute("style",st),ot.X=document.createElement("img"),si?ot.X.setAttribute("src","https://cdn.originpc.com/img/configurator/xr_hand.gif"):ot.X.setAttribute("src","https://cdn.originpc.com/img/configurator/xr_cursor.gif"),ot.X.setAttribute("style","position: absolute;top: 0px;left: 0px;width: 92px;height: 92px;"),ot.M.appendChild(ot.X),ot.M.V=function(n,t){this.style.left=.5*n-46+"px";this.style.top=.5*t-46+"px"},ot.N=document.createElement("div"),st="position:absolute;",st+=ti+"transform-origin: 50% 50%;",st+=" width: inherit;",st+=" height: inherit;",st+=" background-position: center center;",st+=" background-size: cover;",ot.N.setAttribute("style",st),ot.r.appendChild(ot.N),di=function(){ot.M.style.visibility="hidden";ot.N.style.visibility="hidden";tt&&ot.ta();ot.Z=r;for(var n=0;n<ot.za;n++)ot.fa();ot.sa()},ot.r.onmousedown=function(n){ai||di();n.preventDefault()},ot.r.ontouchstart=function(n){ai||di();n.preventDefault()},ot.r.appendChild(ot.M),ot.ya()):(ot.W=r,ot.Z=r,tt&&ot.ta(),ot.ya(),ot.sa());ot.u(k);ot.R=1/ct.g;ot.T(ot.R);this.Fa();ot.fa();setTimeout(function(){bi()},10);setTimeout(function(){hi()},15)}else alert("Your browser must support HTML5 to show KeyShotVR")};var r=!0,t=null,z=!1,WEBPATH="https://cdn.originpc.com/v3images",wordToReplace=window.location.origin;wordToReplace=window.location.href.toLowerCase().indexOf("load")>=0?wordToReplace+"/configurator/load":window.location.href.toLowerCase().indexOf("edit")>=0?wordToReplace+"/configurator/edit":window.location.href.toLowerCase().indexOf("dynamic")>=0?wordToReplace+"/configurator/dynamic":window.location.href.toLowerCase().indexOf("configurator")>=0?wordToReplace+"/configurator":wordToReplace;pattern=new RegExp(wordToReplace,"gi");window.keyshotVRBigO=function(n,i,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g,nt,tt,it,rt,ut,ft,et){function pi(n,i,r){n.removeEventListener?n.removeEventListener(i,r,z):n.detachEvent&&(n.detachEvent("on"+i,n["e"+i+r]),n["e"+i+r]=t)}function yt(n,t,i){n.addEventListener?n.addEventListener(t,i,z):n.attachEvent&&(n["e"+t+i]=i,n.attachEvent("on"+t,function(){n["e"+t+i]()}))}function gi(){var n=z;return-1!==navigator.platform.toString().indexOf("Win")&&-1!==navigator.appVersion.indexOf("MSIE")&&(n=r),n}function vr(){var t=document.getElementById(n),i=t.requestFullScreen||t.webkitRequestFullScreen||t.mozRequestFullScreen||t.msRequestFullScreen;"undefined"!=typeof i&&i&&i.call(t)}function yr(n){ot.ma=z;n.pointerId in ot.F&&delete ot.F[n.pointerId];or(n)}function pr(n){ot.ma&&(ot.F[n.pointerId]=[n.pageX,n.pageY],fr(n))}function wr(n){ot.ma=r;ot.F[n.pointerId]=[n.pageX,n.pageY];ur(n)}function nr(){ot.l?(setTimeout(function(){ot.u(z)},20),setTimeout(function(){ot.u(r)},120)):(setTimeout(function(){ot.u(r)},20),setTimeout(function(){ot.u(z)},120))}function ei(){var t={x:0,y:0},n=kt;if(n.offsetParent)do t.x+=n.offsetLeft,t.y+=n.offsetTop;while(n=n.offsetParent);return t}function tr(){var n=ct.g;ct.g=1;n!==ct.g&&ot.T(ot.v()*n/ct.g);bt.setAttribute("width",ii.width);ot.l?(bt.removeAttribute("height"),bt.style.width="100%",bt.style[yi]="scale("+ct.n+")",bt.style.height="auto",kt.style["background-color"]=ot.backgroundColor,document.body.style["background-color"]=ot.backgroundColor):(bt.setAttribute("height",ii.height),bt.style[yi]="translate("+-ii.width/2+"px,"+-ii.height/2+"px) scale("+ct.g+") translate("+.5*ri.width/ct.g+"px,"+.5*ri.height/ct.g+"px) translate("+ct.j+"px,"+ct.k+"px) scale("+ct.n+")",bt.style["max-width"]="",bt.style.width="",bt.style.height="",kt.style["background-color"]=ot.backgroundColor)}function hi(){ot.Sa(ot.h.offsetWidth,ot.h.offsetHeight)}function ir(n,t){wt.start.x=n;wt.start.y=t;wt.a.x=n;wt.a.y=t;vt.a.x=n;vt.a.y=t}function rr(n,t){wt.b.x=n-wt.a.x;wt.b.y=t-wt.a.y;wt.n.x=n;wt.n.y=t;wt.a.x=n;wt.a.y=t}function fi(n){n||(n=window.event);var t=0;n.keyCode?t=n.keyCode:n.which&&(t=n.which);1===t?lt.d|=1:1<t&&(lt.d|=2);ot.va(n);n.preventDefault?n.preventDefault():n.returnValue=z}function oi(n){n||(n=window.event);var t=ei();ot.cursor.x=n.pageX-t.x+at.left;ot.cursor.y=n.pageY-t.y+at.top;n.preventDefault?n.preventDefault():n.returnValue=z;0<lt.d&&(1===lt.d?rr(n.pageX,n.pageY):2===lt.d?(n=ot.cursor.y-ui.start.y,t=ot.v(),ot.T(ct.t*Math.exp(n/200)),n=ot.v(),ct.j+=parseFloat(ot.e*t-ot.e*n),ct.k+=parseFloat(ot.f*t-ot.f*n)):3===lt.d&&(t=ot.cursor.x-ui.start.x,n=ot.cursor.y-ui.start.y,ct.j+=parseFloat((t-ct.m.x)/ct.g),ct.k+=parseFloat((n-ct.m.y)/ct.g),ct.m.x=t,ct.m.y=n))}function ci(n){n||(n=window.event);var t=0;n.keyCode?t=n.keyCode:n.which&&(t=n.which);1===t?lt.d&=-2:1<t&&(lt.d&=-3);ot.va(n);n.preventDefault?n.preventDefault():n.returnValue=z}function wi(n){ot.Za&&(n=n?n:window.event,ot.Ga(0<(n.detail?-1*n.detail:n.wheelDelta/40)?1:-1),hr(n))}function ur(n){var t,i,r;if(n||(n=window.event),t=er(n),i=ei(),ot.cursor.x=t[0].pageX-i.x+at.left,ot.cursor.y=t[0].pageY-i.y+at.top,1===t.length&&t[0])if(lt.start.x=t[0].pageX,lt.start.y=t[0].pageY,lt.a.x=t[0].pageX,lt.a.y=t[0].pageY,ot.pa=t[0].target,ot.pa===ot.r)lt.d=1,ir(t[0].pageX,t[0].pageY);else for(r=ot.pa;r&&r!==ot.r;)r.onclick&&r.onclick(),r=r.parentNode;if(2===t.length&&t[0]&&t[1]){lt.d=3;lt.ba.x=t[0].pageX-i.x+at.left;lt.ba.y=t[0].pageY-i.y+at.top;lt.ca.x=t[1].pageX-i.x+at.left;lt.ca.y=t[1].pageY-i.y+at.top;var r=t[0].pageX-t[1].pageX,u=t[0].pageY-t[1].pageY,f=(t[0].pageX-i.x+at.left+(t[1].pageX-i.x+at.left))/2,t=(t[0].pageY-i.y+at.top+(t[1].pageY-i.y+at.top))/2;ct.oa=z;ct.Ta=Math.sqrt(r*r+u*u);ct.t=ot.v();ot.e=parseFloat(f-.5*ri.width);ot.f=parseFloat(t-.5*ri.height);ot.e*=parseFloat(ot.R);ot.f*=parseFloat(ot.R);ot.e-=parseFloat(ct.j);ot.f-=parseFloat(ct.k);ot.e/=parseFloat(ct.t);ot.f/=parseFloat(ct.t)}n.preventDefault()}function fr(n){var t,u;if(n||(n=window.event),t=er(n),u=ei(),ot.cursor.x=t[0].pageX-u.x+at.left,ot.cursor.y=t[0].pageY-u.y+at.top,1===t.length&&t[0]&&(lt.a.x=t[0].pageX,lt.a.y=t[0].pageY,0<=lt.d&&rr(lt.a.x,lt.a.y)),2===t.length&&t[0]&&t[1]){var i=ot.v(),f=t[0].pageX-t[1].pageX,e=t[0].pageY-t[1].pageY;ot.T(ct.t/ct.Ta*Math.sqrt(f*f+e*e));f=ot.v();e=ot.f*i-ot.f*f;ct.j+=ot.e*i-ot.e*f;ct.k+=e;i=(ot.cursor.x+t[1].pageX-u.x+at.left)/2-(lt.ba.x+lt.ca.x)/2;t=(ot.cursor.y+t[1].pageY-u.y+at.top)/2-(lt.ba.y+lt.ca.y)/2;ct.oa===z&&(ct.m.x=i,ct.m.y=t,ct.oa=r);ct.j+=(i-ct.m.x)/ct.g;ct.k+=(t-ct.m.y)/ct.g;ct.m.x=i;ct.m.y=t}n.preventDefault()}function er(n){if(!gi())return n.touches;n=[];for(id in ot.F){var i=ot.F[id],t={};t.pageX=i[0];t.pageY=i[1];t.target=ot.r;t.preventDefault=function(){};n.push(t)}return n}function or(n){n.preventDefault();ot.pa=t;lt.d=0;var i=(new Date).getTime(),r=i-(vi||i+1);clearTimeout(ki);500>r&&0<r||(vi=i,ki=setTimeout(function(){clearTimeout(ki)},500,[n]));vi=i}function br(n){n.preventDefault();lt.d=0}function bi(){var i,n,t,u,f;if(lr(bi),ot.W===ot.Z&&(1===lt.d?.01<vt.L?(vt.b.x=.4*(wt.a.x-vt.a.x),vt.b.y=.4*(wt.a.y-vt.a.y),vt.a.x+=vt.b.x,vt.a.y+=vt.b.y,ot.la(vt.b.x,vt.b.y)):(ot.la(wt.b.x,wt.b.y),wt.b.x=0,wt.b.y=0):.01<vt.L&&(vt.b.x*=vt.L,vt.b.y*=vt.L,.055>vt.b.x*vt.b.x+vt.b.y*vt.b.y&&(vt.b.x=0,vt.b.y=0,wt.b.x=0,wt.b.y=0,wt.a.x=vt.a.x,wt.a.y=vt.a.y),(0!==vt.b.x||0!==vt.b.y)&&ot.la(vt.b.x,vt.b.y))),ot.Ba(),i=0,-1===ot.ga){for(n=1,n=0;n<ot.G.length;n++){if(t=ot.B[n],0===ot.w[t]&&ot.G[n].complete){if(ot.D[t]=ot.w[t],ot.w[t]=-1,ot.W===ot.Z&&(u=ot.G.length+ot.za,u>ht.q&&(u=ht.q),u-=i))for(f=0;f<u;f++)ot.fa();ht.J=r;0===n&&ot.Ba()}-1!==ot.D[t]&&i++}n=parseFloat(i/ht.q);ot.Ra(n);i===ht.q&&(ot.ga=0,ot.Qa())}}function sr(n){keycode=(n?n:window.event).keyCode;switch(keycode){case 13:nr();hr(n)}}function hr(n){n=n?n:window.event;n.preventDefault()?n.preventDefault():n.returnValue=z}var li="/",si=window.location.href.slice(0,window.location.href.lastIndexOf("/")),cr=si.lastIndexOf("/"),ai,ki,vi,lr,at,ht,ii,gt,ni,st,di;if(0<=cr&&(li=si.substr(0,cr+1)),ai=si=z,this.Za=p!==w,this.ma=z,this.F=[],this.Ba=function(){var n,t;ht.J&&(ht.J=z,n=parseInt(ht.K*ht.c+ht.I),-1!==ot.D[n]&&(ar.setAttribute("src",ot.C[n].replace(pattern,WEBPATH)),void 0!==et)&&((n=ot.ha[n],n||void 0!==et[n])?(document.getElementById("vr_hotspot")&&(t=document.getElementById("vr_hotspot"),document.body.removeChild(t)),t=document.createElement("div"),t.innerHTML=et[n].text,t.id="vr_hotspot",t.style.position="absolute",t.style.left=et[n].position.x+"px",t.style.top=et[n].position.y+"px",t.style.color="#000000",void 0!==et[n].fb&&(et[n].options.fontSize&&(t.style.fontSize=et[n].options.fontSize),et[n].options.Ha&&(t.style.color=et[n].options.Ha),et[n].options.bgColor&&(t.style.backgroundColor=et[n].options.bgColor),et[n].options.link&&(t.href=et[n].options.link),et[n].options.height&&(t.style.height=et[n].options.height),et[n].options.width&&(t.style.width=et[n].options.width),et[n].options.textAlign&&(t.style.textAlign=et[n].options.textAlign)),document.body.appendChild(t)):document.getElementById("vr_hotspot")&&(t=document.getElementById("vr_hotspot"),document.body.removeChild(t))));(ct.n!==ct.a||ct.j!==ct.wa||ct.k!==ct.xa)&&(ct.a=ct.n,ct.wa=ct.j,ct.xa=ct.k,tr())},this.bb=function(n){for(var f,r,e=-1e3,o=n,t=parseFloat(parseInt(n%ht.c)),i=parseFloat(parseInt(n/ht.c)),t=t/ht.c,t=t*2*Math.PI,i=i/ht.i,i=i*Math.PI,n=Math.sin(t),t=Math.cos(t),i=Math.cos(i),u=Math.sqrt(n*n+t*t+i*i),n=n/u,t=t/u,i=i/u,u=0;u<ot.G.length;u++)f=ot.B[u],-1!==ot.D[f]&&(r=ot.Da[f].Xa,r=n*r.x+t*r.y+i*r.Ya,e<r&&(e=r,o=f));return o},this.fa=function(){var t,i;if(ot.na<ht.q){t=new Image;i=ot.B[ot.na];ot.w[i]=0;t.src=ot.C[i];ot.G.push(t);var n=parseInt(i%ht.c),r=parseInt(i/ht.c),n=n/ht.c,n=n*2*Math.PI,r=r/ht.i,r=r*Math.PI,t=Math.sin(n),n=Math.cos(n),r=Math.cos(r),u=Math.sqrt(t*t+n*n+r*r);ot.Da[i]={Xa:{x:t/u,y:n/u,Ya:r/u}};ot.na++}},this.Fa=function(){for(var t=ht.qa,r=ht.ra,n=2,e=parseFloat(ht.c/n),h=parseFloat(ht.i/n),l=ht.q,u=0,f=0,a=0,c=0,i=0;ot.P<l;){var o=parseInt(t%ht.c),s=parseInt(r%ht.i),i=parseInt(s*ht.c+o);if(ot.C[i]||(ot.B[ot.P]=i,ot.P++,ot.C[i]=ot.ua(o,s),void 0!==et&&et[s+"_"+o]&&(ot.ha[i]=s+"_"+o)),0===u&&(t+=e,f++),1===u&&(r+=h,a++),c++,c>=n)if(c=0,0===u)u=1,f=0;else if(1===u&&(t+=e,f++,f>=n/2)){if(n*=2,t=ht.qa,r=ht.ra,e=parseFloat(ht.c/n),h=parseFloat(ht.i/n),1>e&&1>h){for(t=0;t<l;t++)r=parseInt(t%ht.c),n=parseInt(t/ht.c),i=parseInt(n*ht.c+r),ot.C[i]||(ot.B[ot.P]=i,ot.P++,ot.C[i]=ot.ua(r,n),void 0!==et&&et[n+"_"+r]&&(ot.ha[i]=n+"_"+r));break}u=a=f=0}}},this.ua=function(n,t){return li+ot.s+"/"+parseInt(t)+"_"+parseInt(n)+"."+nt},this.la=function(n,t){var n=n*(1<ht.c?ot.Va:0),t=t*(1<ht.i?ot.Wa:0),f=Math.sqrt(n*n+t*t),u,i;if(.0001<f&&(ht.da+=n,ht.ea+=t,ht.z+=f,1<ht.z)){if(f=parseInt(ht.z),u=Math.atan2(ht.da,ht.ea),ht.z-=f,ht.da=0,ht.ea=0,0>u&&(u+=2*Math.PI),u+=Math.PI/8,u=parseInt(u/(Math.PI/4)),0>u&&(u+=8),u%=8,0!==gt[u]){if(ut?(i=ht.I,i=i-f*gt[u]):(i=ht.I,i+=f*gt[u]),ht.Ca){for(;0>i;)i+=ht.c;for(;i>=ht.c;)i-=ht.c}else i>=ht.c&&(i=ht.c-1),0>i&&(i=0);ht.I!==i&&(ht.I=i,ht.J=r)}if(0!==ni[u]){if(ft?(i=ht.K,i-=f*ni[u]):(i=ht.K,i+=f*ni[u]),ht.Ea){for(;0>i;)i+=ht.i;for(;i>=ht.i;)i-=ht.i}else i>=ht.i&&(i=ht.i-1),0>i&&(i=0);ht.K!=i&&(ht.K=i,ht.J=r)}}},this.Ua=function(){ot.u(!ot.l);ot.l?ot.H.setAttribute("src","https://cdn.originpc.com/img/configurator/GoFullScreenIcon.png"):ot.H.setAttribute("src","https://cdn.originpc.com/img/configurator/GoFixedSizeIcon.png")},this.u=function(n){ot.l=n;ot.l?(dt.style.position="relative",dt.style.left="0px",dt.style.top="0px",document.body.style.overflow=""):(dt.style.position="absolute",n=ei(),dt.style.left=window.pageXOffset-n.x+at.left+"px",dt.style.top=window.pageYOffset-n.y+at.top+"px",document.body.style.overflow="hidden");document.body.style.margin="0";document.body.style.padding="0";hi()},this.Ja=function(){var n=new Image;n.src=ot.O.src;ot.G[ot.Y]=n;n=ot.B[ot.Y];ot.D[n]=ot.w[n];ot.w[n]=-1;ot.Y++;ht.J=r;ot.Y===ht.q&&(ot.ga=0,ot.Ka())},vi=t,this.va=function(n){var t=ei();ot.cursor.x=n.pageX-t.x+at.left;ot.cursor.y=n.pageY-t.y+at.top;1===lt.d?ir(n.pageX,n.pageY):2===lt.d?(ui.start.x=ot.cursor.x,ui.start.y=ot.cursor.y,ct.t=ot.v(),ot.e=ot.cursor.x-.5*ri.width,ot.f=ot.cursor.y-.5*ri.height,ot.e*=ot.R,ot.f*=ot.R,ot.e-=ct.j,ot.f-=ct.k,ot.e/=ct.t,ot.f/=ct.t):3===lt.d&&(ui.start.x=ot.cursor.x,ui.start.y=ot.cursor.y,ct.m.x=0,ct.m.y=0)},this.Ga=function(n){ot.T(ct.n*Math.exp(-n/50))},this.v=function(){return ct.n},this.T=function(n){n>ct.ja/ct.g&&(n=ct.ja/ct.g);n<ct.ka/ct.g&&(n=ct.ka/ct.g);ct.n=n},this.ab=function(n,t,i,r){at.left=n;at.top=t;at.right=i;at.bottom=r;hi()},this.Sa=function(n,t){ot.l||(n=window.innerWidth,t=window.innerHeight);var r=n-at.left-at.right,i=t-at.top-at.bottom;ri.width=r;ri.height=i;kt.style.width=r+"px";ot.l&&window.innerHeight<ii.height&&(i=window.innerHeight);kt.style.height=i+"px";kt.style.left=at.left+"px";kt.style.top=at.top+"px";tr();pt.style.width=n+"px";ot.l&&window.innerHeight<ii.height&&(t=window.innerHeight);pt.style.height=t+"px";ot.h.style.height=t+"px";pt.Aa&&pt.Aa(n,t);g&&(ot.N.style.height=window.innerHeight+"px",ot.N.style.width=window.innerWidth+"px")},this.U=function(n){yt(n,"mousedown",fi);yt(n,"mousemove",oi);yt(n,"mouseup",ci)},this.aa=function(n){pi(n,"mousedown",fi);pi(n,"mousemove",oi);pi(n,"mouseup",ci)},this.Qa=function(){ot.p&&(ot.p.style.visibility="hidden",ot.aa(ot.p),ot.aa(ot.Q),ot.aa(ot.o))},this.Ka=function(){ot.A.style.visibility="hidden";ot.aa(ot.A)},lr=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(n){window.setTimeout(n,10)},this.ta=function(){ot.p=document.createElement("div");ot.U(ot.p);ot.p.V=function(){this.parentNode&&(this.style.left="16px",this.style.top="16px")};st="position:absolute;";st+="left: 0px;";st+="top:  0px;";st+="width: 80px;";st+="height: 80px;";st+=ti+"transform-origin: 50% 50%;";st+="visibility: inherit;";ot.p.setAttribute("style",st);ot.Q=document.createElement("div");ot.U(ot.Q);st="position:absolute;";st+="left: 0px;";st+="top:  29px;";st+="width: 80px;";st+="height: 80px;";st+=ti+"transform-origin: 50% 50%;";st+="opacity: 1.0;";st+="visibility: inherit;";st+="border: 0px solid #000000;";st+="color: #ffffff;";st+="text-align: left;";st+="white-space: nowrap;";st+="padding: 0px 0px 0px 0px;";st+="overflow: hidden;";st+="display: flex;";ot.Q.setAttribute("style",st);ot.o=document.createElement("div");ot.U(ot.o);ot.o.$={Ma:0,Na:0,ia:0,Oa:1,Pa:1,eb:1};st="left: 0px;";st+="top:  0px;";st+="width: 80px;";st+="height: 80px;";st+=ti+"transform-origin: 50% 50%;";st+="opacity: 1.0;";st+="visibility: inherit;";st+="border: 0px solid #000000;";st+="color: #ffffff;";st+="text-align: left;";st+="white-space: nowrap;";st+="padding: 0px 0px 0px 0px;";st+="overflow: hidden;";var n=it;""===n&&(n="ks_logo.png");ot.o.setAttribute("style",st);ot.o.innerHTML='<img src="http://cdn.originpc.com/img/configurator/spinner.svg"><\/img>';ot.p.appendChild(ot.o);ot.p.appendChild(ot.Q);pt.appendChild(ot.p);ot.u(ot.l);setTimeout(function(){ot.u(ot.l)},10)},this.Ra=function(n){if(ot.p){if(ot.Q.innerHTML="<center style='display: flex; width: 100%; align-items: center; justify-content: center;'>"+parseInt(100*n)+"<\/center>",ot.o.$.ia+=2.1,n="",ot.o.$)var t=ot.o.$,n=n+("translate("+t.Ma+"px,"+t.Na+"px) rotate("+t.ia+"deg) scale("+t.Oa+","+t.Pa+") ");ot.o.style[yi]=n+"scale(1.0,1.0)"}},this.sa=function(){ai=r;bi()},this.ya=function(){if(yt(window,"resize",hi),rt&&yt(pt,"dblclick",vr),gi())if(yt(window,"mousewheel",wi),yt(window,"keydown",sr),/Tablet PC/i.test(navigator.userAgent)&&window.$a){var n=new MSGesture;n.target=ot.h;ot.h.Ia=n;ot.h.Ia.pointerType=t;ot.h.gb=[];yt(ot.h,"MSPointerDown",wr);yt(ot.h,"MSPointerMove",pr);yt(ot.h,"MSPointerUp",yr)}else yt(pt,"mousedown",fi),yt(bt,"mousedown",fi),yt(pt,"mousemove",oi),yt(bt,"mousemove",oi),yt(document,"mouseup",ci);else pt.addEventListener&&(yt(document,"mouseup",ci),yt(pt,"mousewheel",wi),yt(document,"keydown",sr),yt(pt,"mousedown",fi),yt(bt,"mousedown",fi),yt(pt,"mousemove",oi),yt(pt,"touchstart",ur),yt(pt,"touchmove",fr),yt(pt,"touchcancel",br),yt(pt,"touchend",or),yt(pt,"DOMMouseScroll",wi),yt(window,"orientationchange",nr))},document.createElement("canvas").getContext){var ot=this,dt=ot.h=t,kt=t,ar=t,pt=t,bt=t;ot.l=k;ot.s=i;ot.cb=z;ot.Z=z;ot.W=g;ot.hb=0;ot.P=0;ot.Va=parseFloat(l);ot.Wa=parseFloat(a);ot.za=1;ot.Y=0;ot.ga=-1;at={left:0,top:0,right:0,bottom:0};ht={I:0,K:0,c:1,i:1,qa:0,ra:0,z:0,da:0,ea:0,J:z,q:0,Ca:r,Ea:z};v||(v=0);y||(y=0);ht.qa=v;ht.ra=y;ht.I=v;ht.K=y;ht.c=o;ht.i=s;ht.Ca=h;ht.Ea=c;ht.q=ht.c*ht.i;ii={width:0,height:0};ii.width=u;ii.height=f;var ti="",yi="transform",ri={x:640,y:480},ct={n:1,t:1,a:-1,j:0,k:0,wa:-1,xa:-1,g:1,ka:1,ja:1,m:{x:0,y:0},oa:z};ct.ka=parseFloat(p);ct.ja=parseFloat(w);var wt={start:{x:0,y:0},a:{x:0,y:0},La:{x:0,y:0},n:{x:0,y:0},b:{x:0,y:0}},ui={start:{x:0,y:0}},lt={d:0,start:{x:0,y:0},a:{x:0,y:0},La:{x:0,y:0},n:{x:0,y:0},b:{x:0,y:0},ba:{x:0,y:0},ca:{x:0,y:0}},vt={a:{x:0,y:0},b:{x:0,y:0},L:.96};for(vt.L=b,ot.cursor={x:0,y:0},gt=[],ni=[],gt[0]=0,ni[0]=1,gt[1]=1,ni[1]=1,gt[2]=1,ni[2]=0,gt[3]=1,ni[3]=-1,gt[4]=0,ni[4]=-1,gt[5]=-1,ni[5]=-1,gt[6]=-1,ni[6]=0,gt[7]=-1,ni[7]=1,ot.e=0,ot.f=0,ot.na=0,ot.G=[],ot.B=[],ot.w=[],ot.D=[],ot.Da=[],i=0;i<ht.q;i++)ot.w[i]=-1,ot.D[i]=-1;for(ot.C=[],ot.ha=[],i=["Webkit","Moz","0","ms","Ms"],o=0;o<i.length;o++)"undefined"!=typeof document.documentElement.style[i[o]+"Transform"]&&(ti="-"+i[o].toLowerCase()+"-",yi=i[o]+"Transform");st="";ot.h=document.getElementById(n);st="width: "+u+"px;";st+="height: "+f+"px;";st+="max-width: 100%;";ot.h.setAttribute("style",st);dt=document.createElement("div");dt.setAttribute("id","viewwindow");st="top:  0px;";st+="left: 0px;";st+="position: relative;";dt.setAttribute("style",st);ot.h.appendChild(dt);kt=document.createElement("div");kt.setAttribute("id","turntable");st="top:  0px;";st+="left: 0px;";st+="overflow: hidden;";st+="position:absolute;";st+=ti+"user-select: none;";kt.setAttribute("style",st);dt.appendChild(kt);bt=document.createElement("img");bt.setAttribute("id","backbuffer");st="top:  0px;";st+="left: 0px;";st+="position:absolute;";st+=ti+"user-select: none;";bt.setAttribute("style",st);kt.appendChild(bt);ar=bt;pt=document.createElement("div");ot.r=pt;st="top:  0px;";st+="left: 0px;";st+="width:  100px;";st+="height: 100px;";st+="overflow: hidden;";st+="position:absolute;";st+="z-index: 522;";st+=ti+"user-select: none;";pt.setAttribute("style",st);dt.appendChild(pt);pt.Aa=function(n,t){var r=[],i,u;for(r.push(this);0<r.length;)if(i=r.pop(),i.V&&i.V(n,t),i.hasChildNodes())for(u=0;u<i.childNodes.length;u++)r.push(i.childNodes[u])};this.A=document.createElement("div");st="position:absolute;";st+="left: 0px;";st+="top:  0px;";st+="width: 256px;";st+="height: 256px;";st+="opacity: 0.0;";st+=ti+"transform-origin: 50% 50%;";st+="visibility: inherit;";st+="display: none";this.A.setAttribute("style",st);this.O=document.createElement("img");this.O.setAttribute("width",256);this.O.setAttribute("height",256);this.O.onload=function(){ot.Ja()};ot.U(this.A);this.A.appendChild(this.O);pt.appendChild(this.A);this.backgroundColor=kt.style.backgroundColor=e;d&&(ot.S=document.createElement("div"),st="position:absolute;",st+="width: 38px;",st+="height: 32px;",st+=ti+"transform-origin: 50% 50%;",st+="visibility: inherit;",st+="cursor: pointer;",ot.S.setAttribute("style",st),ot.H=document.createElement("img"),ot.l?ot.H.setAttribute("src",li.replace(pattern,WEBPATH)+ot.s.replace(pattern,WEBPATH)+"/files/GoFullScreenIcon.png"):ot.H.setAttribute("src",li+ot.s+"/files/GoFixedSizeIcon.png"),ot.H.setAttribute("style","position: absolute;top: 0px;left: 0px;width: 38px;height: 32px;"),ot.S.appendChild(ot.H),ot.S.V=function(n,t){this.style.left=n-38+"px";this.style.top=t-32+"px"},ot.S.onclick=function(){ot.Ua()},ot.r.appendChild(ot.S));ot.W?(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(si=r),ot.M=document.createElement("div"),st="position:absolute;",st+="width: 92px;",st+="height: 92px;",st+=ti+"transform-origin: 50% 50%;",st+="visibility: inherit;",st+="cursor: pointer;",ot.M.setAttribute("style",st),ot.X=document.createElement("img"),si?ot.X.setAttribute("src","https://cdn.originpc.com/img/configurator/xr_hand.gif"):ot.X.setAttribute("src","https://cdn.originpc.com/img/configurator/xr_cursor.gif"),ot.X.setAttribute("style","position: absolute;top: 0px;left: 0px;width: 92px;height: 92px;"),ot.M.appendChild(ot.X),ot.M.V=function(n,t){this.style.left=.5*n-46+"px";this.style.top=.5*t-46+"px"},ot.N=document.createElement("div"),st="position:absolute;",st+=ti+"transform-origin: 50% 50%;",st+=" width: inherit;",st+=" height: inherit;",st+=" background-position: center center;",st+=" background-size: cover;",ot.N.setAttribute("style",st),ot.r.appendChild(ot.N),di=function(){ot.M.style.visibility="hidden";ot.N.style.visibility="hidden";tt&&ot.ta();ot.Z=r;for(var n=0;n<ot.za;n++)ot.fa();ot.sa()},ot.r.onmousedown=function(n){ai||di();n.preventDefault()},ot.r.ontouchstart=function(n){ai||di();n.preventDefault()},ot.r.appendChild(ot.M),ot.ya()):(ot.W=r,ot.Z=r,tt&&ot.ta(),ot.ya(),ot.sa());ot.u(k);ot.R=1/ct.g;ot.T(ot.R);this.Fa();ot.fa();setTimeout(function(){bi()},10);setTimeout(function(){hi()},15)}else alert("Your browser must support HTML5 to show KeyShotVR")};configuratorApp=function(n){return n.Init=function(){$("#build-accordion .collapse, #services-accordion .collapse, #accessory-accordion .collapse").on("shown.bs.collapse",function(){var n=$(this).closest(".card");window.matchMedia("(min-width: 992px)").matches?$("html,body").animate({scrollTop:n.offset().top-134},500):window.matchMedia("(max-width: 992px)").matches&&$("html,body").animate({scrollTop:n.offset().top-79},500)});configuratorDesignApp.LoadDesign();n.CaseConstrainTrigger();n.BuildConstrainTrigger();n.CalculateTotals();n.MaxLeadDays();setTimeout(function(){var n=new Date;n.getHours()>=9&&n.getHours()<=17?$("#notificationLiveModal").modal("show"):$("#notificationModal").modal("show")},25e4)},n.LoadCase=function(t){var i=$(t);isPrdDefaultChange&&i.attr("data-case")!==lastSelectedCase.attr("data-case")?swal({title:"WARNING",text:"Are you sure you want to reset your configuration? Any previous choices will be lost.",type:"warning",showCancelButton:!0,confirmButtonClass:"btn-success",confirmButtonText:"Yes, Proceed!",cancelButtonClass:"btn-outline-light",cancelButtonText:"Cancel",closeOnConfirm:!0,closeOnCancel:!0},function(t){if(t)n.ResetConfiguration(i);else return i.prop("checked",!1),lastSelectedCase.prop("checked",!0),!1}):i.attr("data-case")!==lastSelectedCase.attr("data-case")&&n.ResetConfiguration(i)},n.ResetConfiguration=function(t){var i=$(t),r;n.DisableAddToCart();lastSelectedCase=i;isPrdDefaultChange=!1;$("#imgSystemIcon").attr("src",i.attr("data-img"));$("#imgSystemIcon12").attr("src",i.attr("data-img"));var u=$("div.card.js-product-selector"),f=$("div.card-header"),e=$("div.collapse");$.each(f,function(n,t){$(t).removeClass("d-none")});$.each(e,function(n,t){$(t).removeClass("d-none")});$.each(u,function(n,t){if($(t).attr("data-constrainedcategory")!==""||$(t).attr("data-constrainedby")!==""){var u=_.split($(t).attr("id"),"-",$(t).attr("id").length),i=parseInt(u[1]),r=parseInt(u[2]);$("#prd-"+i+"-"+r).removeClass("d-none");$("#cp-"+i+"-"+r).removeClass("constraintoverlay disabled");$("#cp-"+i+"-"+r).attr("data-constrainedby","");$("#cp-"+i+"-"+r).attr("data-constrainedcategory","")}});r=$("div.card.js-services-product-selector");$.each(r,function(n,t){var r=_.split($(t).attr("id"),"_",$(t).attr("id").length),i=parseInt(r[1]);$("#prd_"+i).removeClass("d-none");$("#cp_"+i).attr("data-constrainedby","")});configuratorToolsApp.ResetToDefaults(!0);n.CaseConstrainTrigger();n.BuildConstrainTrigger();configuratorDesignApp.RefreshDesignOption(i.data("id"))},n.DisableAddToCart=function(){$("#btnAddToCart").prop("disabled",!0);$("#btnAddToCart12").prop("disabled",!0);$("#btnAddToCartMobile").prop("disabled",!0);$("#btnAddToCartMobile2").prop("disabled",!0)},n.EnableAddToCart=function(){$("#btnAddToCart").prop("disabled",!1);$("#btnAddToCart12").prop("disabled",!1);$("#btnAddToCartMobile").prop("disabled",!1);$("#btnAddToCartMobile2").prop("disabled",!1)},n.LearnMore=function(n){$("#learnMoreModal").modal("show");$.get("/configurator/learnmore/"+n,function(n){$("#learnMoreContent").html(n)})},n.LearnMoreCleaning=function(){$("#learnMoreModal").modal("hide");$("#learnMoreContent").html("")},n.Summary=function(){var n,i,u,t,f,r,e,o,s;$("#summaryModal").modal("show");n='<h5 class="system">'+$("#lblSystemName").html()+"<\/h5>";n+='<div class="row"><div class="col"><img src="'+$("#imgSystemIcon").attr("src")+'" class="img-fluid mx-auto d-block"><\/div>';i=$(".js-case-selector input[name=Case]:checked");u=i.attr("data-case");n+='<div class="col"><span> Case : '+u+"<\/span> <br />";t=$(".js-group-selector");f=$(".js-design-selector-color li.selected");i.data("primecaseid")!==0&&(r=$(".js-design-selector-sidepanel input[name=PanelId]:checked"),n+="<span>"+r.attr("data-group")+" : "+r.attr("data-name")+"<\/span> <br />");$.each(f,function(i,r){var u=$(r);switch(parseInt(u.attr("data-token"))){case 1:case 2:case 4:case 7:u.attr("data-name")!=="None"&&(n+="<span>"+u.attr("data-group")+" : "+u.attr("data-name")+"<\/span> <br />");break;case 3:$.each(t,function(t,i){if($(i).data("token")===3)return $(i).hasClass("d-none")===!1&&u.attr("data-name")!=="None"&&(n+="<span>"+u.attr("data-group")+" : "+u.attr("data-name")+"<\/span> <br />"),!1});break;case 5:$.each(t,function(t,i){if($(i).data("token")===5)return $(i).hasClass("d-none")===!1&&u.attr("data-name")!=="None"&&(n+="<span>"+u.attr("data-group")+" : "+u.attr("data-name")+"<\/span> <br />"),!1});break;case 6:$.each(t,function(t,i){if($(i).data("token")===6)return $(i).hasClass("d-none")===!1&&u.attr("data-name")!=="None"&&(n+="<span>"+u.attr("data-group")+" : "+u.attr("data-name")+"<\/span> <br />"),!1})}});e=$("div.card.js-product-selector.selected");$.each(e,function(t,i){var f,r,u;n+="<span>"+$(i).attr("data-categoryname")+" : "+$(i).attr("data-name")+"<\/span> <br />";f=systemGraph.find(function(n){return n.p===parseInt($(i).attr("data-product"))&&n.c===parseInt($(i).attr("data-category"))});r=$(i).find("select");r.length>0&&r.each(function(){var t=$("option:selected",$(this));if(t!==null&&t.length>0){var i=_.split($(this).attr("id"),"|",$(this).attr("id").length),r=_.find(f.og,{og:parseInt(i[2])}),u=t.data("qty")>1&&t.attr("data-desc")!==t.attr("data-qty")?"Quantity: "+t.attr("data-qty"):"";n+='<small class="ml-3">'+r.h+" : "+t.attr("data-desc")+" "+u+"<\/small> <br />"}});u=$(i).find("input:checkbox");u.length>0&&u.each(function(){$(this).is(":checked")&&(n+='<small class="ml-3">'+$(this).attr("data-desc")+" <\/small> <br />")})});o=$("div.card.js-services-product-selector.selected");$.each(o,function(t,i){var f,r,u;n+="<span>"+$(i).attr("data-categoryname")+" : "+$(i).attr("data-name")+"<\/span> <br />";f=systemGraph.find(function(n){return n.p===parseInt($(i).attr("data-product"))&&n.c===parseInt($(i).attr("data-category"))});r=$(i).find("select");r.length>0&&r.each(function(){var t=$("option:selected",$(this));if(t!==null&&t.length>0){var i=_.split($(this).attr("id"),"|",$(this).attr("id").length),r=_.find(f.og,{og:parseInt(i[2])}),u=t.data("qty")>1&&t.attr("data-desc")!==t.attr("data-qty")?"Quantity: "+t.attr("data-qty"):"";n+='<small class="ml-3">'+r.h+" : "+t.attr("data-desc")+" "+u+"<\/small> <br />"}});u=$(i).find("input:checkbox");u.length>0&&u.each(function(){$(this).is(":checked")&&(n+='<small class="ml-3">'+$(this).attr("data-desc")+" <\/small> <br />")})});s=$("div.card.js-accessories-product-selector.selected");$.each(s,function(t,i){var f,r,u;n+="<span>"+$(i).attr("data-categoryname")+" : "+$(i).attr("data-name")+"<\/span> <br />";f=systemGraph.find(function(n){return n.p===parseInt($(i).attr("data-product"))&&n.c===parseInt($(i).attr("data-category"))});r=$(i).find("select");r.length>0&&r.each(function(){var t=$("option:selected",$(this));if(t!==null&&t.length>0){var i=_.split($(this).attr("id"),"|",$(this).attr("id").length),r=_.find(f.og,{og:parseInt(i[2])}),u=t.data("qty")>1&&t.attr("data-desc")!==t.attr("data-qty")?"Quantity: "+t.attr("data-qty"):"";n+='<small class="ml-3">'+r.h+" : "+t.attr("data-desc")+" "+u+"<\/small> <br />"}});u=$(i).find("input:checkbox");u.length>0&&u.each(function(){$(this).is(":checked")&&(n+='<small class="ml-3">'+$(this).attr("data-desc")+" <\/small> <br />")})});n+="<\/div><\/div>";$("#pnlSummary").empty();$("#pnlSummary").html(n)},n.SendEmailModal=function(){$("#pnlConfirmation").addClass("d-none").html("");$("#sendHotEmailModal").modal("show");$("#sendHotEmailModal").on("shown.bs.modal",function(){$("#Recipient").focus()})},n.SendEmail=function(){$("#RecipientEmail").val()!==""&&/^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/.test($("#RecipientEmail").val())?function(){var n='<h5 class="system">Configuration Summary<\/h5>',r=$(".js-case-selector input[name=Case]:checked"),s=r.attr("data-case"),t,u,i,f,e,o;n+='<div class="col"><span> Case : '+s+"<\/span> <br />";t=$(".js-group-selector");u=$(".js-design-selector-color li.selected");r.data("primecaseid")!==0&&(i=$(".js-design-selector-sidepanel input[name=PanelId]:checked"),n+="<span>"+i.attr("data-group")+" : "+i.attr("data-name")+"<\/span> <br />");$.each(u,function(i,r){var u=$(r);switch(parseInt(u.attr("data-token"))){case 1:case 2:case 4:case 7:u.attr("data-name")!=="None"&&(n+="<span>"+u.attr("data-group")+" : "+u.attr("data-name")+"<\/span> <br />");break;case 3:$.each(t,function(t,i){if($(i).data("token")===3)return $(i).hasClass("d-none")===!1&&u.attr("data-name")!=="None"&&(n+="<span>"+u.attr("data-group")+" : "+u.attr("data-name")+"<\/span> <br />"),!1});break;case 5:$.each(t,function(t,i){if($(i).data("token")===5)return $(i).hasClass("d-none")===!1&&u.attr("data-name")!=="None"&&(n+="<span>"+u.attr("data-group")+" : "+u.attr("data-name")+"<\/span> <br />"),!1});break;case 6:$.each(t,function(t,i){if($(i).data("token")===6)return $(i).hasClass("d-none")===!1&&u.attr("data-name")!=="None"&&(n+="<span>"+u.attr("data-group")+" : "+u.attr("data-name")+"<\/span> <br />"),!1})}});f=$("div.card.js-product-selector.selected");$.each(f,function(t,i){var f,r,u;n+="<span>"+$(i).attr("data-categoryname")+" : "+$(i).attr("data-name")+"<\/span> <br />";f=systemGraph.find(function(n){return n.p===parseInt($(i).attr("data-product"))&&n.c===parseInt($(i).attr("data-category"))});r=$(i).find("select");r.length>0&&r.each(function(){var t=$("option:selected",$(this));if(t!==null&&t.length>0){var i=_.split($(this).attr("id"),"|",$(this).attr("id").length),r=_.find(f.og,{og:parseInt(i[2])}),u=t.data("qty")>1&&t.attr("data-desc")!==t.attr("data-qty")?"Quantity: "+t.attr("data-qty"):"";n+='<small class="ml-3">'+r.h+" : "+t.attr("data-desc")+" "+u+"<\/small> <br />"}});u=$(i).find("input:checkbox");u.length>0&&u.each(function(){$(this).is(":checked")&&(n+='<small class="ml-3">'+$(this).attr("data-desc")+" <\/small> <br />")})});e=$("div.card.js-services-product-selector.selected");$.each(e,function(t,i){var f,r,u;n+="<span>"+$(i).attr("data-categoryname")+" : "+$(i).attr("data-name")+"<\/span> <br />";f=systemGraph.find(function(n){return n.p===parseInt($(i).attr("data-product"))&&n.c===parseInt($(i).attr("data-category"))});r=$(i).find("select");r.length>0&&r.each(function(){var t=$("option:selected",$(this));if(t!==null&&t.length>0){var i=_.split($(this).attr("id"),"|",$(this).attr("id").length),r=_.find(f.og,{og:parseInt(i[2])}),u=t.data("qty")>1&&t.attr("data-desc")!==t.attr("data-qty")?"Quantity: "+t.attr("data-qty"):"";n+='<small class="ml-3">'+r.h+" : "+t.attr("data-desc")+" "+u+"<\/small> <br />"}});u=$(i).find("input:checkbox");u.length>0&&u.each(function(){$(this).is(":checked")&&(n+='<small class="ml-3">'+$(this).attr("data-desc")+" <\/small> <br />")})});o=$("div.card.js-accessories-product-selector.selected");$.each(o,function(t,i){var f,r,u;n+="<span>"+$(i).attr("data-categoryname")+" : "+$(i).attr("data-name")+"<\/span> <br />";f=systemGraph.find(function(n){return n.p===parseInt($(i).attr("data-product"))&&n.c===parseInt($(i).attr("data-category"))});r=$(i).find("select");r.length>0&&r.each(function(){var t=$("option:selected",$(this));if(t!==null&&t.length>0){var i=_.split($(this).attr("id"),"|",$(this).attr("id").length),r=_.find(f.og,{og:parseInt(i[2])}),u=t.data("qty")>1&&t.attr("data-desc")!==t.attr("data-qty")?"Quantity: "+t.attr("data-qty"):"";n+='<small class="ml-3">'+r.h+" : "+t.attr("data-desc")+" "+u+"<\/small> <br />"}});u=$(i).find("input:checkbox");u.length>0&&u.each(function(){$(this).is(":checked")&&(n+='<small class="ml-3">'+$(this).attr("data-desc")+" <\/small> <br />")})});n+="<\/div><\/div>";var h=$("#lblSystemPrice").html(),c=$("#imgSystemIcon").attr("src"),l=$("#lblSystemName").html(),a={photo:c,sku:l,total:h,summary:n,recipient:$("#Recipient").val(),recipientEmail:$("#RecipientEmail").val(),senderEmail:$("#SenderEmail").val(),message:$("#Message").val(),grecaptchaResponse:$("#g-recaptcha-response").val()};$.ajax({url:"/configurator/sendconfiguration/",type:"POST",dataType:"json",data:JSON.stringify(a),contentType:"application/json; charset=utf-8",success:function(n){n==="recaptchaerror"?$("#pnlConfirmation").removeClass("d-none").html('<p class="font-weight-medium mb-0">reCaptcha validation is required.<\/p>'):n==="sent"?($("#Recipient").val(""),$("#RecipientEmail").val(""),$("#SenderEmail").val(""),$("#Message").val(""),$("#pnlConfirmation").removeClass("d-none").html('<p class="font-weight-medium mb-0">Configuration sent!<\/p>')):$("#pnlConfirmation").removeClass("d-none").html('<p class="font-weight-medium mb-0">An error occurred while sending this configuration. We are looking into the issue.<\/p>')}})}():$("#pnlConfirmation").removeClass("d-none").html('<p class="font-weight-medium mb-0">Some fields in your form are required. Please complete and then submit.<\/p>')},n.CaseConstrainTrigger=function(){var i=$(".js-case-selector input[name=Case]:checked"),u=parseInt(i.attr("data-caseid"))>0?parseInt(i.attr("data-caseid")):0,e=parseInt(i.attr("data-primecaseid"))>0?parseInt(i.attr("data-primecaseid")):0,f=$("#caseConstrains"),n=$("#buildConstrains"),t=[],r=$();u>0?(r=f.find('[data-caseid="'+u+'"]'),_.forEach(r,function(i){$(i).attr("data-istrigger")==="True"&&$(i).attr("data-trigger")==="Match"&&function(){var r=_.split($(i).attr("data-value"),",",$(i).attr("data-value").length),u=n.find('[data-specificationlabelid="'+$(i).attr("data-specificationlabelid")+'"]');_.forEach(u,function(n){var i=_.split($(n).attr("data-slvalue"),",",$(n).attr("data-slvalue").length),u=_.difference(r,i);i.length>0&&u.length===r.length&&t.push($(n).attr("data-productid")+"-"+$(n).attr("data-categoryid"))})}()}),_.forEach(t,function(i){var u=_.split(i,"-",i.length),v=systemGraph.find(function(n){return n.p===parseInt(u[0])&&n.c===parseInt(u[1])}),r,f,e,o,c,y,s,l,a,h;typeof v!="undefined"?v.cd===!0?$("#cp-"+u[0]+"-"+u[1]).addClass("constraintoverlay disabled"):$("#prd-"+u[0]+"-"+u[1]).addClass("d-none"):$("#prd-"+u[0]+"-"+u[1]).addClass("d-none");$("#cp-"+u[0]+"-"+u[1]).attr("data-constrainedby","case");r=$("#cp-"+u[0]+"-"+u[1]);r.hasClass("selected")&&function(){var i=0,o=0,s=0,h=0,c=0,l=$("#provider_mbCategoryId").data("value"),p=$("#provider_cpuCategoryId").data("value"),w=$("#provider_psCategoryId").data("value"),b=$('div.card.js-product-selector.selected[data-category="'+p+'"]'),k=$("#provider_cpuLanesSL").data("value"),d=$("#provider_mbMaxGPUsSL").data("value"),g=$("#provider_mbMaxNvmeSL").data("value"),nt=$("#provider_mbSBNvmeSL").data("value"),a=$("#provider_powerDrawSL").data("value"),tt=$("#provider_mbPCHLanesSL").data("value"),u,f;i=parseInt($("#provider_gPCI").attr("data-value"));o=parseInt($("#provider_ggPCI").attr("data-value"));s=parseInt($("#provider_gnPCI").attr("data-value"));h=parseInt($("#provider_gaPCI").attr("data-value"));c=parseInt($("#provider_grPCI").attr("data-value"));var it=parseInt($("#provider_ggpu").attr("data-value")),rt=parseInt($("#provider_gnvme").attr("data-value")),ut=parseInt($("#provider_psTw").attr("data-value"))||0,v=parseInt($("#provider_cpuTw").attr("data-value"))||0,y=parseInt($("#provider_gpuTw").attr("data-value"))||0,e=$("#category_"+r.attr("data-category")).children("div.row").children("div.config-option");e.length===0&&(e=$("#category_"+r.attr("data-category")).children("div.tab-pane").children("div.row").children("div.config-option"));u=e.children("div.card.js-product-selector");r.removeClass("selected");f=systemGraph.find(function(n){return n.p===r.data("product")&&n.c===r.data("category")});f.m===!0||f.o===!0||function(){var e=$(r),f=$(),p=!1;_.forEach(u,function(u){var ft,et,ot,ht,st;if($(u).attr("data-category")===r.attr("data-category")&&$.inArray($(u).attr("data-product")+"-"+$(u).attr("data-category"),t)===-1&&($(u).attr("data-constrainedcategory")===null||$(u).attr("data-constrainedcategory").length===0)&&($(u).attr("data-constrainedby")===null||$(u).attr("data-constrainedby")===undefined||$(u).attr("data-constrainedby")!==undefined&&$(u).attr("data-constrainedby").length===0)&&p===!1)if($(u).data("category")===l||$(u).data("container")===l){if(ot=function(){var lt=n.find('[data-productid="'+$(b).attr("data-product")+'"][data-specificationlabelid="'+k+'"]').data("slvalue")||0,p=n.find('[data-productid="'+$(u).attr("data-product")+'"][data-specificationlabelid="'+d+'"]').data("slvalue")||0,ot=n.find('[data-productid="'+$(u).attr("data-product")+'"][data-specificationlabelid="'+g+'"]').data("slvalue")||0,st=n.find('[data-productid="'+$(u).attr("data-product")+'"][data-specificationlabelid="'+nt+'"]').data("slvalue")||0,t=n.find('[data-productid="'+$(u).attr("data-product")+'"][data-specificationlabelid="'+a+'"]').data("slvalue")||0,at=n.find('[data-productid="'+$(u).attr("data-product")+'"][data-specificationlabelid="'+tt+'"]').data("slvalue")||0,ht,r,ct,l;if(i=at+lt,ht=$("#provider_physicalSlotSL").data("value"),i>=o+s+h+c&&p>=it&&ot+st>rt){for(ft=[],$("#pciSlots").find('[data-productid="'+$(e).attr("data-product")+'"][data-gpci="0"]').each(function(){var i=this,t;($(this).attr("data-gpci")!==$(this).attr("data-configuration")||$(this).attr("data-configuration")==="0"&&$(this).attr("data-product")!=="")&&function(){var u=n.find('[data-productid="'+$(i).attr("data-product")+'"][data-specificationlabelid="'+ht+'"]').data("slvalue")||0,r=ft.findIndex(function(n){return n.productid===$(i).attr("data-product")&&n.width<u});r!==-1?ft[r].width=ft[r].width+1:(t={},t.productid=$(i).attr("data-product"),t.lenght=$(i).data("configuration"),t.width=1,t.found=!1,ft.push(t))}()}),r=!0,et=0;et<ft.length;et++)$("#pciSlots").find('[data-productid="'+$(u).attr("data-product")+'"]').each(function(){var i,n,t;if(parseInt($(this).attr("data-gpci"))===ft[et].lenght){if(i=$(this).data("slot")+1,ft[et].width===1)return $(this).attr("data-gpci",0),$(this).attr("data-product",ft[et].productid),ft[et].found=!0,!1;if(ft[et].width===2){if(n=$("#pciSlots").find('[data-productid="'+$(u).attr("data-product")+'"][data-slot="'+i+'"]'),$(n).length!==0){if($(n).data("gpci")>0||$(n).data("gpci")===$(n).data("configuration"))return $(this).attr("data-gpci",0),$(this).attr("data-product",ft[et].productid),$(n).attr("data-gpci",0),$(n).attr("data-product",ft[et].productid),ft[et].found=!0,!1}else if(i<=casePCISlot)return $(this).attr("data-gpci",0),$(this).attr("data-product",productId),ft[et].found=!0,!1}else if(ft[et].width===3)if(n=$("#pciSlots").find('[data-productid="'+$(u).attr("data-product")+'"][data-slot="'+i+'"]'),t=$("#pciSlots").find('[data-productid="'+$(u).attr("data-product")+'"][data-slot="'+(i+1)+'"]'),$(t).length!==0){if(($(n).data("gpci")>0||$(n).data("gpci")===$(n).data("configuration"))&&($(t).data("gpci")>0||$(t).data("gpci")===$(t).data("configuration")))return $(this).attr("data-gpci",0),$(this).attr("data-product",ft[et].productid),$(n).attr("data-gpci",0),$(n).attr("data-product",ft[et].productid),$(t).attr("data-gpci",0),$(t).attr("data-product",ft[et].productid),ft[et].found=!0,!1}else if(i+1<=casePCISlot)return $(this).attr("data-gpci",0),$(this).attr("data-product",productId),$(n).length!==0&&($(n).attr("data-gpci",0),$(n).attr("data-product",productId)),ft[et].found=!0,!1}});for(et=0;et<ft.length;et++)if(ft[et].found===!1){r=!1;break}if(r)return ut<t+v+y&&$('div.card.js-product-selector[data-category="'+w+'"]').each(function(){if($(this).hasClass("selected"))$(this).removeClass("selected"),oldPrd=$(this);else if(($(this).attr("data-constrainedcategory")===null||$(this).attr("data-constrainedcategory").length===0)&&($(this).attr("data-constrainedby")===null||$(this).attr("data-constrainedby")===undefined||$(this).attr("data-constrainedby")!==undefined&&$(this).attr("data-constrainedby").length===0)){var r=$("#provider_psPowerDrawPcSL").data("value"),u=n.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+a+'"]').data("slvalue")||0,f=n.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+r+'"]').data("slvalue")||0,i=u*f/100;if(i>=t+v+y)return $("#provider_psTw").attr("data-value",i),$(this).addClass("selected"),$("#sp_"+$(this).data("sp")).html($(this).data("name")),$(this).find("p.cost").html(""),!1}}),$("#pciSlots").find('[data-productid="'+$(e).attr("data-product")+'"]').each(function(){$(this).attr("data-gpci",$(this).attr("data-configuration"));$(this).attr("data-product","")}),$("#provider_mbMaxGpu").attr("data-value",p),$("#provider_mbMaxNvme").attr("data-value",ot),$("#provider_mbSBNvme").attr("data-value",st),$("#provider_mbTw").attr("data-value",t),$("#provider_gPCI").attr("data-value",i),$(u).addClass("selected"),$("#sp_"+$(u).data("sp")).html($(u).data("name")),$(u).find("p.cost").html(""),configuratorToolsApp.UpdateHardDriveSupported(),f=$(u),ct=$("#subcategories-"+$(u).attr("data-category")).children("li.nav-item").children("a.nav-link"),ct.removeClass("active"),$("#subcat-"+$(u).attr("data-category")+"-"+$(u).attr("data-subcategory")+"-tab").addClass("active"),$("#subcat-"+$(u).attr("data-category")+"-"+$(u).attr("data-subcategory")+"-tab").removeClass("disabled"),l=$("#category_"+$(u).attr("data-category")).children("div.tab-pane"),l.removeClass("show"),l.removeClass("active"),$("#subcat-"+$(u).attr("data-category")+"-"+$(u).attr("data-subcategory")).addClass("show"),$("#subcat-"+$(u).attr("data-category")+"-"+$(u).attr("data-subcategory")).addClass("active"),{v:!1}}}(),typeof ot=="object")return ot.v}else return $(u).addClass("selected"),$("#sp_"+$(u).data("sp")).html($(u).data("name")),$(u).find("p.cost").html(""),f=$(u),ht=$("#subcategories-"+$(u).attr("data-category")).children("li.nav-item").children("a.nav-link"),ht.removeClass("active"),$("#subcat-"+$(u).attr("data-category")+"-"+$(u).attr("data-subcategory")+"-tab").addClass("active"),$("#subcat-"+$(u).attr("data-category")+"-"+$(u).attr("data-subcategory")+"-tab").removeClass("disabled"),st=$("#category_"+$(u).attr("data-category")).children("div.tab-pane"),st.removeClass("show"),st.removeClass("active"),$("#subcat-"+$(u).attr("data-category")+"-"+$(u).attr("data-subcategory")).addClass("show"),$("#subcat-"+$(u).attr("data-category")+"-"+$(u).attr("data-subcategory")).addClass("active"),!1});f.length>0&&(_.forEach(u,function(n){if($(n).attr("data-category")===f.attr("data-category")&&$(n).attr("data-product")!==$(f).attr("data-product")){var i=systemGraph.find(function(t){return t.p===parseInt($(n).data("product"))&&t.c===parseInt($(n).data("category"))}),r=systemGraph.find(function(n){return n.p===parseInt($(f).data("product"))&&n.c===parseInt($(f).data("category"))}),t=parseFloat(i.fp)-parseFloat(r.fp);$(n).find("p.cost").html(t>0?"$+"+parseInt(t):"$"+parseInt(t))}}),configuratorMatchCApp.BuildProductConstrainTrigger(f))}()}();f=$('div.card.js-product-selector[data-sp="'+r.data("sp")+'"]');e=$("#category_"+r.data("category")).children("div.row");e.length===0&&(e=$("#category_"+r.data("category")).children("div.tab-pane").children("div.row"));o=e.children("div.config-option.col-12.col-md-6.col-lg-4.col-xxl-3.d-none");f.length===o.length&&$("#heading-"+r.data("sp")).addClass("d-none");c=$("#myTabContent_"+r.data("sp")).children("div.tab-content").children("div.tab-pane").children("div.row");c.length!==0&&(y=c.children("div.config-option.col-12.col-md-6.col-lg-4.col-xxl-3.d-none"),f.length===y.length&&($("#heading-"+r.data("sp")).addClass("d-none"),$("#collapse-"+r.data("sp")).addClass("d-none")));$("#prd_"+u[0]).addClass("d-none");$("#cp_"+u[0]).attr("data-constrainedby","case");r=$("#cp_"+u[0]);r.hasClass("selected")&&(s=$("#category_"+r.attr("data-category")).children("div.row").children("div.config-option"),s.length===0&&(s=$("#category_"+r.attr("data-category")).children("div.tab-pane").children("div.row").children("div.config-option")),l=s.children("div.card.js-services-product-selector"),r.removeClass("selected"),a=systemGraph.find(function(n){return n.p===r.data("product")&&n.c===r.data("category")}),a.m===!0||a.o===!0?(f=$('div.card.js-services-product-selector.selected[data-sp="'+r.data("sp")+'"]'),f.length>0?(h=f.first(),f.length>1?$("#sp_"+r.data("sp")).html(h.data("name")+" <span class= 'text-warning'> (+ "+(f.length-1)+" more selected) <\/span>"):$("#sp_"+r.data("sp")).html(""+h.data("name")),$("#img_selected_"+r.data("sp")).attr("src",$(h).data("p"))):($("#sp_"+r.data("sp")).html("None Selected"),$("#img_selected_"+r.data("sp")).attr("src",DEFAULT_IMAGE_URL))):function(){var u=$(r),n=$(),i=!1;_.forEach(l,function(u){if($(u).attr("data-category")===r.attr("data-category")&&$.inArray($(u).attr("data-product")+"-"+$(u).attr("data-category"),t)===-1&&($(u).attr("data-constrainedby")===null||$(u).attr("data-constrainedby")===undefined||$(u).attr("data-constrainedby").length===0)&&i===!1)return $(u).addClass("selected"),$("#sp_"+$(u).data("sp")).html($(u).data("name")),$("#img_selected_"+$(u).data("sp")).attr("src",$(u).data("p")),$(u).find("p.cost").html(""),n=$(u),!1});n.length>0&&(_.forEach(l,function(t){if($(t).attr("data-category")===n.attr("data-category")&&$(t).attr("data-product")!==$(n).attr("data-product")){var r=systemGraph.find(function(n){return n.p===parseInt($(t).data("product"))&&n.c===parseInt($(t).data("category"))}),u=systemGraph.find(function(t){return t.p===parseInt($(n).data("product"))&&t.c===parseInt($(n).data("category"))}),i=parseFloat(r.fp)-parseFloat(u.fp);$(t).find("p.cost").html(i>0?"$+"+parseInt(i):"$"+parseInt(i))}}),configuratorMatchCApp.BuildProductConstrainTrigger(n))}());f=$('div.card.js-product-selector[data-sp="'+r.data("sp")+'"]');e=$("#category_"+r.data("category")).children("div.row");e.length===0&&(e=$("#category_"+r.data("category")).children("div.tab-pane").children("div.row"));o=e.children("div.config-option.col-12.col-md-6.col-lg-4.col-xxl-3.d-none");f.length===o.length&&$("#heading-"+r.data("sp")).addClass("d-none")})):(r=f.find('[data-primecaseid="'+e+'"]'),_.forEach(r,function(i){$(i).attr("data-istrigger")==="True"&&$(i).attr("data-trigger")==="Match"&&function(){var r=_.split($(i).attr("data-value"),",",$(i).attr("data-value").length),u=n.find('[data-specificationlabelid="'+$(i).attr("data-specificationlabelid")+'"]');_.forEach(u,function(n){var i=_.split($(n).attr("data-slvalue"),",",$(n).attr("data-slvalue").length),u=_.difference(r,i);i.length>0&&u.length===r.length&&t.push($(n).attr("data-productid")+"-"+$(n).attr("data-categoryid"))})}()}),_.forEach(t,function(i){var u=_.split(i,"-",i.length),a=systemGraph.find(function(n){return n.p===parseInt(u[0])&&n.c===parseInt(u[1])}),r,f,e,o,s,c,l,h;typeof a!="undefined"?a.cd===!0?$("#cp-"+u[0]+"-"+u[1]).addClass("constraintoverlay disabled"):$("#prd-"+u[0]+"-"+u[1]).addClass("d-none"):$("#prd-"+u[0]+"-"+u[1]).addClass("d-none");$("#cp-"+u[0]+"-"+u[1]).attr("data-constrainedby","case");r=$("#cp-"+u[0]+"-"+u[1]);r.hasClass("selected")&&function(){var i=0,o=0,s=0,h=0,c=0,y=$("#provider_mbCategoryId").data("value"),p=$("#provider_cpuCategoryId").data("value"),w=$('div.card.js-product-selector.selected[data-category="'+p+'"]'),b=$("#provider_cpuLanesSL").data("value"),k=$("#provider_mbMaxGPUsSL").data("value"),d=$("#provider_mbMaxNvmeSL").data("value"),g=$("#provider_mbSBNvmeSL").data("value"),l=$("#provider_powerDrawSL").data("value"),nt=$("#provider_mbPCHLanesSL").data("value"),u,f;i=parseInt($("#provider_gPCI").attr("data-value"));o=parseInt($("#provider_ggPCI").attr("data-value"));s=parseInt($("#provider_gnPCI").attr("data-value"));h=parseInt($("#provider_gaPCI").attr("data-value"));c=parseInt($("#provider_grPCI").attr("data-value"));var tt=parseInt($("#provider_ggpu").attr("data-value")),it=parseInt($("#provider_gnvme").attr("data-value")),rt=parseInt($("#provider_psTw").attr("data-value"))||0,a=parseInt($("#provider_cpuTw").attr("data-value"))||0,v=parseInt($("#provider_gpuTw").attr("data-value"))||0,e=$("#category_"+r.attr("data-category")).children("div.row").children("div.config-option");e.length===0&&(e=$("#category_"+r.attr("data-category")).children("div.tab-pane").children("div.row").children("div.config-option"));u=e.children("div.card.js-product-selector");r.removeClass("selected");f=systemGraph.find(function(n){return n.p===r.data("product")&&n.c===r.data("category")});f.m===!0||f.o===!0||function(){var e=$(r),f=$(),p=!1;_.forEach(u,function(u){if($(u).attr("data-category")===r.attr("data-category")&&$.inArray($(u).attr("data-productid")+"-"+$(u).attr("data-categoryid"),t)===-1&&p===!1){if($(u).data("category")!==y)return $(u).addClass("selected"),$("#sp_"+$(u).data("sp")).html($(u).data("name")),$(u).find("p.cost").html(""),f=$(u),!1;var ut,ft,et=function(){var ot=n.find('[data-productid="'+$(w).attr("data-product")+'"][data-specificationlabelid="'+b+'"]').data("slvalue")||0,y=n.find('[data-productid="'+$(u).attr("data-product")+'"][data-specificationlabelid="'+k+'"]').data("slvalue")||0,p=n.find('[data-productid="'+$(u).attr("data-product")+'"][data-specificationlabelid="'+d+'"]').data("slvalue")||0,et=n.find('[data-productid="'+$(u).attr("data-product")+'"][data-specificationlabelid="'+g+'"]').data("slvalue")||0,t=n.find('[data-productid="'+$(u).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0,st=n.find('[data-productid="'+$(u).attr("data-product")+'"][data-specificationlabelid="'+nt+'"]').data("slvalue")||0,r;if(i=st+ot,i>=o+s+h+c&&y>=tt&&p+et>it){for(ut=[],$("#pciSlots").find('[data-productid="'+$(e).attr("data-product")+'"][data-gpci="0"]').each(function(){var i=this,t;($(this).attr("data-gpci")!==$(this).attr("data-configuration")||$(this).attr("data-configuration")==="0"&&$(this).attr("data-product")!=="")&&function(){var u=n.find('[data-productid="'+$(i).attr("data-product")+'"][data-specificationlabelid="'+physicalSlotSL+'"]').data("slvalue")||0,r=ut.findIndex(function(n){return n.productid===$(i).attr("data-product")&&n.width<u});r!==-1?ut[r].width=ut[r].width+1:(t={},t.productid=$(i).attr("data-product"),t.lenght=$(i).data("configuration"),t.width=1,t.found=!1,ut.push(t))}()}),r=!0,ft=0;ft<ut.length;ft++)$("#pciSlots").find('[data-productid="'+$(u).attr("data-product")+'"]').each(function(){var i,n,t;if(parseInt($(this).attr("data-gpci"))===ut[ft].lenght){if(i=$(this).data("slot")+1,ut[ft].width===1)return $(this).attr("data-gpci",0),$(this).attr("data-product",ut[ft].productid),ut[ft].found=!0,!1;if(ut[ft].width===2){if(n=$("#pciSlots").find('[data-productid="'+$(u).attr("data-product")+'"][data-slot="'+i+'"]'),$(n).length!==0){if($(n).data("gpci")>0||$(n).data("gpci")===$(n).data("configuration"))return $(this).attr("data-gpci",0),$(this).attr("data-product",ut[ft].productid),$(n).attr("data-gpci",0),$(n).attr("data-product",ut[ft].productid),ut[ft].found=!0,!1}else if(i<=casePCISlot)return $(this).attr("data-gpci",0),$(this).attr("data-product",productId),ut[ft].found=!0,!1}else if(ut[ft].width===3)if(n=$("#pciSlots").find('[data-productid="'+$(u).attr("data-product")+'"][data-slot="'+i+'"]'),t=$("#pciSlots").find('[data-productid="'+$(u).attr("data-product")+'"][data-slot="'+(i+1)+'"]'),$(t).length!==0){if(($(n).data("gpci")>0||$(n).data("gpci")===$(n).data("configuration"))&&($(t).data("gpci")>0||$(t).data("gpci")===$(t).data("configuration")))return $(this).attr("data-gpci",0),$(this).attr("data-product",ut[ft].productid),$(n).attr("data-gpci",0),$(n).attr("data-product",ut[ft].productid),$(t).attr("data-gpci",0),$(t).attr("data-product",ut[ft].productid),ut[ft].found=!0,!1}else if(i+1<=casePCISlot)return $(this).attr("data-gpci",0),$(this).attr("data-product",productId),$(n).length!==0&&($(n).attr("data-gpci",0),$(n).attr("data-product",productId)),ut[ft].found=!0,!1}});for(ft=0;ft<ut.length;ft++)if(ut[ft].found===!1){r=!1;break}if(r)return rt<t+a+v&&$('div.card.js-product-selector[data-category="'+psCategoryId+'"]').each(function(){if($(this).hasClass("selected"))$(this).removeClass("selected"),oldPrd=$(this);else if(($(this).attr("data-constrainedcategory")===null||$(this).attr("data-constrainedcategory").length===0)&&($(this).attr("data-constrainedby")===null||$(this).attr("data-constrainedby")===undefined||$(this).attr("data-constrainedby")!==undefined&&$(this).attr("data-constrainedby").length===0)){var r=$("#provider_psPowerDrawPcSL").data("value"),u=n.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0,f=n.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+r+'"]').data("slvalue")||0,i=u*f/100;if(i>=t+a+v)return $("#provider_psTw").attr("data-value",i),$(this).addClass("selected"),$("#sp_"+$(this).data("sp")).html($(this).data("name")),$(this).find("p.cost").html(""),!1}}),$("#pciSlots").find('[data-productid="'+$(e).attr("data-product")+'"]').each(function(){$(this).attr("data-gpci",$(this).attr("data-configuration"));$(this).attr("data-product","")}),$("#provider_mbMaxGpu").attr("data-value",y),$("#provider_mbMaxNvme").attr("data-value",p),$("#provider_mbSBNvme").attr("data-value",et),$("#provider_mbTw").attr("data-value",t),$("#provider_gPCI").attr("data-value",i),$(u).addClass("selected"),$("#sp_"+$(u).data("sp")).html($(u).data("name")),$(u).find("p.cost").html(""),configuratorToolsApp.UpdateHardDriveSupported(),f=$(u),{v:!1}}}();if(typeof et=="object")return et.v}});f.length>0&&(_.forEach(u,function(n){if($(n).attr("data-category")===f.attr("data-category")&&$(n).attr("data-product")!==$(f).attr("data-product")){var i=systemGraph.find(function(t){return t.p===parseInt($(n).data("product"))&&t.c===parseInt($(n).data("category"))}),r=systemGraph.find(function(n){return n.p===parseInt($(f).data("product"))&&n.c===parseInt($(f).data("category"))}),t=parseFloat(i.fp)-parseFloat(r.fp);$(n).find("p.cost").html(t>0?"$+"+parseInt(t):"$"+parseInt(t))}}),configuratorMatchCApp.BuildProductConstrainTrigger(f))}()}();f=$('div.card.js-product-selector[data-sp="'+r.data("sp")+'"]');e=$("#category_"+r.data("category")).children("div.row");e.length===0&&(e=$("#category_"+r.data("category")).children("div.tab-pane").children("div.row"));o=e.children("div.config-option.col-12.col-md-6.col-lg-4.col-xxl-3.d-none");f.length===o.length&&$("#heading-"+r.data("sp")).addClass("d-none");$("#prd_"+u[0]).addClass("d-none");$("#cp_"+u[0]).attr("data-constrainedby","case");r=$("#cp_"+u[0]);r.hasClass("selected")&&(s=$("#category_"+r.attr("data-category")).children("div.row").children("div.config-option"),s.length===0&&(s=$("#category_"+r.attr("data-category")).children("div.tab-pane").children("div.row").children("div.config-option")),c=s.children("div.card.js-services-product-selector"),r.removeClass("selected"),l=systemGraph.find(function(n){return n.p===r.data("product")&&n.c===r.data("category")}),l.m===!0||l.o===!0?(f=$('div.card.js-services-product-selector.selected[data-sp="'+r.data("sp")+'"]'),f.length>0?(h=f.first(),f.length>1?$("#sp_"+r.data("sp")).html(h.data("name")+" <span class= 'text-warning'> (+ "+(f.length-1)+" more selected) <\/span>"):$("#sp_"+r.data("sp")).html(""+h.data("name")),$("#img_selected_"+r.data("sp")).attr("src",$(h).data("p"))):($("#sp_"+r.data("sp")).html("None Selected"),$("#img_selected_"+r.data("sp")).attr("src",DEFAULT_IMAGE_URL))):function(){var u=$(r),n=$(),i=!1;_.forEach(c,function(u){if($(u).attr("data-category")===r.attr("data-category")&&$.inArray($(u).attr("data-product")+"-"+$(u).attr("data-category"),t)===-1&&($(u).attr("data-constrainedby")===null||$(u).attr("data-constrainedby")===undefined||$(u).attr("data-constrainedby").length===0)&&i===!1)return $(u).addClass("selected"),$("#sp_"+$(u).data("sp")).html($(u).data("name")),$(u).find("p.cost").html(""),n=$(u),!1});n.length>0&&(_.forEach(c,function(t){if($(t).attr("data-category")===n.attr("data-category")&&$(t).attr("data-product")!==$(n).attr("data-product")){var r=systemGraph.find(function(n){return n.p===parseInt($(t).data("product"))&&n.c===parseInt($(t).data("category"))}),u=systemGraph.find(function(t){return t.p===parseInt($(n).data("product"))&&t.c===parseInt($(n).data("category"))}),i=parseFloat(r.fp)-parseFloat(u.fp);$(t).find("p.cost").html(i>0?"$+"+parseInt(i):"$"+parseInt(i))}}),configuratorMatchCApp.BuildProductConstrainTrigger(n))}());f=$('div.card.js-product-selector[data-sp="'+r.data("sp")+'"]');e=$("#category_"+r.data("category")).children("div.row");e.length===0&&(e=$("#category_"+r.data("category")).children("div.tab-pane").children("div.row"));o=e.children("div.config-option.col-12.col-md-6.col-lg-4.col-xxl-3.d-none");f.length===o.length&&$("#heading-"+r.data("sp")).addClass("d-none")}))},n.BuildConstrainTrigger=function(){formulasApp.DefaultConstraints();var r=$("div.card.js-product-selector.selected"),u=$("div.card.js-product-selector"),f=$("div.card.js-services-product-selector"),t=$("#buildConstrains"),i=$();_.forEach(r,function(n){var e=[],o=[],s,r,h,c;i=t.find('[data-productid="'+$(n).attr("data-product")+'"]');_.forEach(i,function(i){$(i).attr("data-istrigger")==="True"&&$(i).attr("data-trigger")==="Match"&&function(){var r=_.split($(i).attr("data-slvalue"),",",$(i).attr("data-slvalue").length);_.forEach(u,function(u){var o=$(n).data("container")===0?$(n).data("category"):$(n).data("container"),s=$(u).data("container")===0?$(u).data("category"):$(u).data("container"),f;o!==s&&(f=t.find('[data-specificationlabelid="'+$(i).attr("data-specificationlabelid")+'"][data-productid="'+$(u).attr("data-product")+'"]'),_.forEach(f,function(n){var t=_.split($(n).attr("data-slvalue"),",",$(n).attr("data-slvalue").length),i;t.length>0&&(i=_.difference(r,t),r.length>0&&i.length===r.length&&e.push($(n).attr("data-productid")+"-"+$(n).attr("data-categoryid")))}))});_.forEach(f,function(u){var e=$(n).data("container")===0?$(n).data("category"):$(n).data("container"),s=$(u).data("container")===0?$(u).data("category"):$(u).data("container"),f;e!==s&&(f=t.find('[data-specificationlabelid="'+$(i).attr("data-specificationlabelid")+'"][data-productid="'+$(u).attr("data-product")+'"]'),_.forEach(f,function(n){var t=_.split($(n).attr("data-slvalue"),",",$(n).attr("data-slvalue").length),i;t.length>0&&(i=_.difference(r,t),t.length>0&&i.length===r.length&&o.push(""+$(n).attr("data-productid")))}))});_.forEach(e,function(r){var u=_.split(r,"-",r.length),f=systemGraph.find(function(n){return n.p===parseInt(u[0])&&n.c===parseInt(u[1])}),o=$("#cp-"+u[0]+"-"+u[1]),a,v,y,h,p,w,s,c,l;if(typeof f!="undefined"&&(a=t.find('[data-specificationlabelid="'+$(i).attr("data-specificationlabelid")+'"][data-productid="'+u[0]+'"]'),a.length>0))if($(i).data("applyto")===0){f.cd===!0?u[0]==="1438"?(v=$("div.card.js-product-selector.selected[data-product='485']"),v.length===0&&$("#cp-"+u[0]+"-"+u[1]).addClass("constraintoverlay disabled")):$("#cp-"+u[0]+"-"+u[1]).addClass("constraintoverlay disabled"):($("#prd-"+u[0]+"-"+u[1]).addClass("d-none"),$("#prd_"+u[0]).addClass("d-none"));$("#cp-"+u[0]+"-"+u[1]).attr("data-constrainedby")!=="case"&&($("#cp-"+u[0]+"-"+u[1]).attr("data-constrainedcategory")===null||$("#cp-"+u[0]+"-"+u[1]).attr("data-constrainedcategory").length===0?($("#cp-"+u[0]+"-"+u[1]).attr("data-constrainedcategory",$(n).attr("data-category")),$("#cp-"+u[0]+"-"+u[1]).attr("data-constrainedby",$(n).attr("data-product"))):(y=$("#cp-"+u[0]+"-"+u[1]).attr("data-constrainedcategory").search($(n).attr("data-category")),y===-1&&($("#cp-"+u[0]+"-"+u[1]).attr("data-constrainedcategory",$("#cp-"+u[0]+"-"+u[1]).attr("data-constrainedcategory")+","+$(n).attr("data-category")),$("#cp-"+u[0]+"-"+u[1]).attr("data-constrainedby",$("#cp-"+u[0]+"-"+u[1]).attr("data-constrainedby")+","+$(n).attr("data-product")))));var b=$("#category_"+f.c),d=b.children("div.row").children("div.config-option.col-12.col-md-6.col-lg-4.col-xxl-3"),g=b.children("div.row").children("div.config-option.col-12.col-md-6.col-lg-4.col-xxl-3.d-none");g.length===d.length&&$("#category_"+f.c+"-tab").addClass("d-none");var k=$("#subcat-"+f.c+"-"+f.s),nt=k.children("div.row").children("div.config-option.col-12.col-md-6.col-lg-4.col-xxl-3"),tt=k.children("div.row").children("div.config-option.col-12.col-md-6.col-lg-4.col-xxl-3.d-none");tt.length===nt.length?($("#subcat-"+f.c+"-"+f.s+"-tab").addClass("disabled"),$("#subcat-"+f.c+"-"+f.s+"-tab").removeClass("active")):$("#subcat-"+f.c+"-"+f.s+"-tab").removeClass("disabled");o.hasClass("selected")&&(h=$("#category_"+o.attr("data-category")).children("div.row").children("div.config-option"),h.length===0&&(h=$("#category_"+o.attr("data-category")).children("div.tab-pane").children("div.row").children("div.config-option")),p=h.children("div.card.js-product-selector"),u[0]==="1438"?(w=$("div.card.js-product-selector.selected[data-product='485']"),w.length===0&&o.removeClass("selected")):o.removeClass("selected"),_.forEach(p,function(n){if($(n).attr("data-category")===o.attr("data-category")&&$.inArray($(n).attr("data-product")+"-"+$(n).attr("data-category"),e)===-1&&($(n).attr("data-constrainedcategory")===null||$(n).attr("data-constrainedcategory").length===0)&&($(n).attr("data-constrainedby")===null||$(n).attr("data-constrainedby")===undefined||$(n).attr("data-constrainedby")!==undefined&&$(n).attr("data-constrainedby")===""))return $(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p")),$(n).find("p.cost").html(""),newProduct=$(n),!1}))}else s=$("#cp-"+u[0]+"-"+u[1]).closest("div").find("select"),s.length>0&&(idArray=_.split(s.attr("id"),"|",s.attr("id").length),c=_.find(f.og,{og:parseInt(idArray[2])}),typeof c!="undefined"&&c.s===$(i).data("specificationlabelid")&&s.addClass("d-none")),l=$("#cp-"+u[0]+"-"+u[1]).find("input:checkbox"),l.length>0&&l.each(function(){idArray=_.split($(this).attr("id"),"|",$(this).attr("id").length);var n=_.find(f.og,{og:parseInt(idArray[1])});typeof n!="undefined"&&n.s===$(i).data("specificationlabelid")&&$(this).parent().addClass("d-none")})});_.forEach(o,function(t){var r=t,f=systemGraph.find(function(n){return n.p===parseInt(r)}),s,u,e,o;typeof f!="undefined"&&($(i).data("applyto")===0?(f.cd===!0?$("#cp_"+r).addClass("constraintoverlay disabled"):$("#prd_"+r).addClass("d-none"),$("#cp_"+r).attr("data-constrainedby")!=="case"&&($("#cp_"+r).attr("data-constrainedcategory")===null||$("#cp_"+r).attr("data-constrainedcategory")===""?($("#cp_"+r).attr("data-constrainedcategory",$(n).attr("data-category")),$("#cp_"+r).attr("data-constrainedby",$(n).attr("data-product"))):$("#cp_"+r).attr("data-constrainedcategory")!==undefined&&(s=$("#cp_"+r).attr("data-constrainedcategory").search($(n).attr("data-category")),s===-1&&($("#cp_"+r).attr("data-constrainedcategory",$("#cp_"+r).attr("data-constrainedcategory")+","+$(n).attr("data-category")),$("#cp_"+r).attr("data-constrainedby",$("#cp_"+r).attr("data-constrainedby")+","+$(n).attr("data-product")))))):(u=$("#cp_"+r).closest("div").find("select"),u.length>0&&(idArray=_.split(u.attr("id"),"|",u.attr("id").length),e=_.find(f.og,{og:parseInt(idArray[2])}),typeof e!="undefined"&&e.s===$(i).data("specificationlabelid")&&u.addClass("d-none")),o=$("#cp_"+r).find("input:checkbox"),o.length>0&&o.each(function(){idArray=_.split($(this).attr("id"),"|",$(this).attr("id").length);var n=_.find(f.og,{og:parseInt(idArray[1])});typeof n!="undefined"&&n.s===$(i).data("specificationlabelid")&&$(this).addClass("d-none")})))})}()});s=$("#subcategories-"+$(n).attr("data-category")).children("li.nav-item").children("a.nav-link.active");r=systemGraph.find(function(t){return t.p===$(n).data("product")&&t.c===$(n).data("category")});typeof r!="undefined"&&(r.m===!1&&r.o===!1?(h=$("#subcategories-"+$(n).attr("data-category")).children("li.nav-item").children("a.nav-link"),h.removeClass("active"),c=$("#category_"+$(n).attr("data-category")).children("div.tab-pane"),c.removeClass("active show"),$("#subcat-"+$(n).attr("data-category")+"-"+$(n).attr("data-subcategory")+"-tab").addClass("active"),$("#subcat-"+$(n).attr("data-category")+"-"+$(n).attr("data-subcategory")).addClass("active show")):s.length===0&&($("#subcat-"+$(n).attr("data-category")+"-"+$(n).attr("data-subcategory")+"-tab").addClass("active"),$("#subcat-"+$(n).attr("data-category")+"-"+$(n).attr("data-subcategory")).addClass("active show")))});_.forEach(u,function(r){i=t.find('[data-productid="'+$(r).attr("data-product")+'"]');_.forEach(i,function(t){var i,u,r;$(t).attr("data-istrigger")==="True"&&$(t).attr("data-trigger")==="Amount"&&(i=$(t).attr("data-slvalue"),parseInt(i)>0&&(u=n.CalculateTotals(),u<parseInt(i)&&(r=systemGraph.find(function(n){return n.p===parseInt($(t).attr("data-productid"))&&n.c===parseInt($(t).attr("data-categoryid"))}),typeof r!="undefined"&&$(t).data("applyto")===0&&(r.cd===!0?$("#cp-"+$(t).attr("data-productid")+"-"+$(t).attr("data-categoryid")).addClass("constraintoverlay disabled"):($("#prd-"+$(t).attr("data-productid")+"-"+$(t).attr("data-categoryid")).addClass("d-none"),$("#prd_"+$(t).attr("data-productid")).addClass("d-none"))))))})});window.location.href.toLowerCase().indexOf("load")>=0&&(isLoadDefault=!0,_.forEach($("div.card.js-product-selector.selected"),function(n){var t=!1;_.forEach(r,function(i){$(i).attr("data-product")===$(n).attr("data-product")&&$(i).attr("data-category")===$(n).attr("data-category")&&(t=!0)});t||configuratorBuildApp.SelectProduct($("#clickable-"+$(n).attr("data-product")+"-"+$(n).attr("data-category")))}),isLoadDefault=!1)},n.CalculateTotals=function(){var e=$(".js-case-selector input[name=Case]:checked"),o=parseFloat(e.attr("data-price")),u=parseFloat($("#SystemDiscount").val()),n,t,i,f,r;console.log(u);n=o;t=0;n+=configuratorDesignApp.CalculateDesignTotals();n+=configuratorBuildApp.CalculateBuildTotals();t+=configuratorBuildApp.CalculateBuildDiscounts();n+=configuratorServicesApp.CalculateServicesTotals();t+=configuratorServicesApp.CalculateServicesDiscounts();n+=configuratorAccessoriesApp.CalculateAccessoriesTotals();t+=configuratorAccessoriesApp.CalculateAccessoriesDiscounts();i=Math.round(n).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,");u!=0&&(t+=n*u/100);t==0?($("#lblSystemPrice").html(i),$("#lblSystemPriceMobile").html(i),$("#lblSystemPriceMobile2").html(i),$("#lblSystemPrice12").html(i)):(f=Math.round(n-t).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,"),r="<del>"+i+"<\/del> "+f,$("#lblSystemPrice").html(r),$("#lblSystemPriceMobile").html(r),$("#lblSystemPriceMobile2").html(r),$("#lblSystemPrice12").html(r));try{jQuery(document).gfSimulator("update")}catch(s){}return n},n.MaxLeadDays=function(){var i=$(".js-case-selector input[name=Case]:checked"),r=parseInt(i.attr("data-leadtime")),t=Math.max(r,configuratorDesignApp.DesignMaxLeadDays(),configuratorBuildApp.BuildMaxLeadDays(),configuratorServicesApp.ServicesMaxLeadDays(),configuratorAccessoriesApp.AccessoriesMaxLeadDays()),n=t-1+" - "+(t+1);return $("#lblSystemLeadTime").html(n),$("#lblSystemLeadTimeMobile").html(n),$("#lblSystemLeadTimeMobile2").html(n),$("#lblSystemLeadTime12").html(n),t},n.RecommendedBuilds=function(){window.open("/easybuilder/","_blank")},n.ReadyToShip=function(){window.open("/landing/2019/rts-systems/","_blank")},n.CaseGallery=function(n){$("#caseDesktopGalleryModal").modal("show");var t=$("#caseColorId").val();$.get("/configurator/casegallerybycasecolor/"+n+"?colorId="+t,function(n){$("#caseDesktopGalleryContent").html(n)})},n.CaseGalleryCleaning=function(){$("#caseDesktopGalleryModal").modal("hide");$("#caseGalleryContent").html("")},n}({});configuratorDesignApp=function(n){return n.LoadDesign=function(){var t=$(".js-design-selector-selectedcolor"),r=$(".js-design-selector-color li.selected"),u=$(".js-case-selector input[name=Case]:checked"),i="false";_.forEach(r,function(n){if($(n).data("token")===1&&($("#imgSystemIcon").attr("src",$(n).attr("data-img")),$("#imgSystemIcon12").attr("src",$(n).attr("data-img")),$("#imgDesign").attr("src",$(n).attr("data-imgm")),$(n).attr("data-imgm")===""&&$("#imgDesign").attr("src",$(n).attr("data-img")),$(n).attr("data-360view")==="true"&&(i="true"),$(n).attr("data-accentcolor")==="0")){var r=$(".js-group-selector");_.forEach(r,function(n){$(n).data("token")===3&&$(n).addClass("d-none")})}_.forEach(t,function(t){if($(t).data("token")===$(n).data("token"))return $(t).html("&ndash; "+$(n).attr("data-name")),!1})});u.attr("data-primecaseid")!==0&&function(){var i=$(".js-design-selector-sidepanel input[name=PanelId]:checked"),r,n;_.forEach(t,function(n){if($(n).data("token")===8)return $(n).html("&ndash; "+i.attr("data-name")),!1});r=$(".js-design-selector-color li");n=$(".js-group-selector");switch(i.attr("data-name")){case"Tempered Glass-Aluminum":$.each(n,function(n,t){$(t).data("token")===5&&$(t).addClass("d-none")});break;case"Aluminum-Aluminum":$.each(n,function(n,t){$(t).data("token")===5&&$(t).addClass("d-none");$(t).data("token")===6&&$(t).addClass("d-none")})}}();i==="true"?(n.InitDesignOption(),$("#imgDesign").removeClass("d-block"),$("#imgDesign").addClass("d-none")):$("#KeyShotVR").addClass("d-none")},n.RefreshDesignOption=function(t){var i="";i=$("#phConfiguration").attr("data-configuration")==="null"?"/Configurator/Design/"+t:$("#phConfigurationAction").attr("data-configurationaction")==="Load"?"/Configurator/LoadDesign/"+t+"?c="+$("#phConfiguration").attr("data-configuration"):"/Configurator/EditDesign/"+t+"?c="+$("#phConfiguration").attr("data-configuration");$.ajax({url:"/Configurator/CaseSpecs/"+t,context:document.body}).done(function(n){$("#pnlSpecs").html(n)});$.ajax({url:i,context:document.body}).done(function(t){$("#pnlDesign").html(t);var r=$(".js-case-selector input[name=Case]:checked"),i=$(".js-group-selector"),u="False",e=$(".js-design-selector-color li.selected"),f=$(".js-design-selector-selectedcolor");$.each(e,function(n,t){$(t).data("token")===1&&($("#imgSystemIcon").attr("src",$(t).attr("data-img")),$("#imgSystemIcon12").attr("src",$(t).attr("data-img")),$("#imgDesign").attr("src",$(t).attr("data-imgm")),u=$(t).data("paint"));$.each(f,function(n,i){if($(i).data("token")===$(t).data("token"))return $(i).html("&ndash; "+$(t).attr("data-name")),!1})});r.attr("data-primecaseid")!==0&&function(){var n=$(".js-design-selector-sidepanel input[name=PanelId]:checked"),t=$(".js-design-selector-color li");$.each(f,function(t,i){if($(i).data("token")===8)return $(i).html("&ndash; "+n.attr("data-name")),!1});switch(n.attr("data-name")){case"Tempered Glass-Aluminum":$.each(t,function(n,t){$(t).data("token")===6&&($(t).removeClass("selected"),$(t).attr("data-selected",!1),$(t).data("default")===!0&&($(t).addClass("selected"),$(t).attr("data-selected",!0)));$(t).data("token")===5&&($(t).removeClass("selected"),$(t).attr("data-selected",!1),$(t).data("default")===!0&&($(t).addClass("selected"),$(t).attr("data-selected",!0)))});$.each(i,function(n,t){$(t).data("token")===5&&$(t).addClass("d-none");$(t).data("token")===6&&$(t).addClass("d-none")});break;case"Aluminum-Aluminum":$.each(t,function(n,t){$(t).data("token")===5&&($(t).removeClass("selected"),$(t).attr("data-selected",!1),$(t).data("default")===!0&&($(t).addClass("selected"),$(t).attr("data-selected",!0)));$(t).data("token")===6&&($(t).removeClass("selected"),$(t).attr("data-selected",!1),$(t).data("default")===!0&&($(t).addClass("selected"),$(t).attr("data-selected",!0)))});$.each(i,function(n,t){$(t).data("token")===5&&$(t).addClass("d-none");$(t).data("token")===6&&$(t).addClass("d-none")});break;case"Tempered Glass-Tempered Glass":u==="False"&&$.each(i,function(n,t){$(t).data("token")===5&&$(t).removeClass("d-none");$(t).data("token")===6&&$(t).removeClass("d-none")})}}();r.attr("data-v360")==="True"?(n.InitDesignOption(),$("#imgDesign").addClass("d-block"),$("#imgDesign").addClass("d-none")):$("#KeyShotVR").addClass("d-none");configuratorApp.CalculateTotals();configuratorApp.MaxLeadDays();setTimeout(function(){configuratorApp.EnableAddToCart()},2e3)})},n.InitDesignOption=function(){var g=$("#lblSystemName").html(),u=$(".js-case-selector input[name=Case]:checked"),v=u.data("case"),w=$(".js-design-selector-sidepanel input[name=PanelId]:checked"),h=$(".js-group-selector"),b=$(".js-design-selector-color li.selected"),y="",c="",o="",l="",s="",f="",k="",a="",e=!0,i="keyShotVR_",r,t,d,p;$.each(b,function(n,t){var r=$(t);switch(r.data("token")){case 1:y=r.data("name");i+=r.data("id");r.data("360view")===!1&&(e=!1);break;case 2:c=r.data("name");break;case 3:$.each(h,function(n,t){if($(t).data("token")===3){$(t).hasClass("d-none")===!1&&(o=r.data("name"),r.data("360view")===!1&&(e=!1));return}});break;case 4:k=r.data("name");break;case 5:$.each(h,function(n,t){if($(t).data("token")===5){$(t).hasClass("d-none")===!1&&(s=r.data("name"),r.data("360view")===!1&&(e=!1));return}});break;case 6:$.each(h,function(n,t){if($(t).data("token")===6){$(t).hasClass("d-none")===!1&&(f=r.data("name"),r.data("360view")===!1&&(e=!1));return}});break;case 7:l=r.data("name")}});r="";u.data("primecaseid")>0&&(r=u.data("formfactor"),r=r==="Full Tower"?"Mid-Tower":"Expansion");t=(r===""?v:r)+"-"+y;u.data("primecaseid")>0&&(a=w.data("name"));a!==""&&(t+="-"+a);c!==""&&(t=t+"-"+c);o!==""&&o!=="None"&&(t=t+"-"+o);s!==""&&s!=="None"&&(t=t+"-"+s);f!==""&&f!=="None"&&(t=u.data("primecaseid")>0?t+"-text-"+f:t+"-"+f);d="";l!==""&&l!=="None";e===!0?($("#KeyShotVR").removeClass("d-none"),$("#imgDesign").removeClass("d-block"),$("#imgDesign").addClass("d-none"),$("#KeyShotVR").children().hide(),$("#"+i).show(),$("#"+i).is(":empty")||$("#"+i).empty(),v.toLowerCase()!=="corsair 280x"?n.InitKeyShotVR(i,t.toLowerCase()):n.InitKeyShotVRBigO(i,t.toLowerCase())):(p="https://cdn.originpc.com/v3images/",$("#KeyShotVR").addClass("d-none"),$("#imgDesign").removeClass("d-none"),$("#imgDesign").attr("src",p+t.toLowerCase()+".png"))},configuratorApp.LoadOrientationImg=function(n){var t=$(n);$("#imgSystem").attr("src",t.attr("data-img"))},n.InitKeyShotVR=function(n,t){var i=$(".js-case-selector input[name=Case]:checked"),r=i.data("case").toLowerCase();new keyshotVR(n,t,600,600,"",18,1,!0,!1,-.1,1,2,0,1,1,.96,!0,!1,!0,"png",!0,"spinner.svg",!1,!0,!1,{})},n.InitKeyShotVRBigO=function(n,t){new keyshotVRBigO(n,t,600,600,"",18,3,!0,!1,-.1,-.1,1,0,1,1,.96,!0,!1,!0,"png",!0,"spinner.svg",!1,!0,!0,{})},n.StandardDesignOnChange=function(t,i,r){var l=$(".js-design-selector-color li"),e,f,o,s,h,c;idArray=_.split(t,"_",t.length);$.each(l,function(n,u){$(u).data("token")===i&&($(u).removeClass("selected"),$(u).attr("data-selected","false"));var f=document.getElementById("p_"+$(u).data("pcounter"));i===1&&r!=0&&($(u).data("colorid")===r?($(u).addClass("selected"),$(u).attr("data-selected",!0),$(u).removeClass("d-none"),f!=null&&($("#p_"+$(u).data("pcounter")).removeClass("d-none"),$("#js-design-selector-selectedcolor-price-"+$(u).data("token")+"-"+$(u).data("pcounter")).removeClass("d-none").addClass("d-inline"),$("#js-design-selector-selectedcolor-price-"+$(u).data("token")+"-"+$(u).data("pcounter")).text(" $"+$("#Color_"+t).data("price")+".00")),$(".js-design-selector-selectedcolor[data-token='5']").html("&ndash; "+$(u).data("name"))):($(u).removeClass("selected"),$(u).attr("data-selected","false"),$(u).data("accentcolor")!=idArray[0]&&$(u).data("token")===5?($(u).addClass("d-none"),f!=null&&($("#p_"+$(u).data("pcounter")).addClass("d-none"),$("#js-design-selector-selectedcolor-price-"+$(u).data("token")+"-"+$(u).data("pcounter")).addClass("d-none").removeClass("d-inline"))):($(u).removeClass("d-none"),f!=null&&$(u).data("token")===5&&($("#p_"+$(u).data("pcounter")).removeClass("d-none"),$("#js-design-selector-selectedcolor-price-"+$(u).data("token")+"-"+$(u).data("pcounter")).removeClass("d-none").addClass("d-inline")))))});$("#Color_"+t).addClass("selected");$("#Color_"+t).attr("data-selected","true");e=$(".js-design-selector-color li");f=$(".js-design-selector-selectedcolor");$.each(e,function(n,t){$(t).data("token")===6&&($(t).removeClass("selected"),$(t).attr("data-selected",!1),$(t).data("name")==="None"&&($(t).addClass("selected"),$(t).attr("data-selected",!0)));$(t).data("token")===3&&($(t).removeClass("selected"),$(t).attr("data-selected",!1),$(t).data("colorid")===r&&($(t).addClass("selected"),$(t).attr("data-selected",!0),$.each(f,function(n,i){if($(i).data("token")===$(t).data("token")){$(i).html("&ndash; "+$("#Color_"+$(t).data("id")).data("name"));return}})))});$.each(f,function(n,i){if($(i).data("token")===$("#Color_"+t).data("token")){$(i).html("&ndash; "+$("#Color_"+t).data("name"));return}});o=$(".js-design-selector-sidepanel input[name=PanelId]:checked");s=$(".js-group-selector");$.each(s,function(n,t){$(t).data("token")===3&&$(t).removeClass("d-none");$(t).data("token")===5&&(o.attr("data-name")!=="Aluminum-Aluminum"?$(t).removeClass("d-none"):($(t).removeClass("selected"),$(t).attr("data-selected",!1),$(t).data("name")==="None"&&($(t).addClass("selected"),$(t).attr("data-selected",!0))));$(t).data("token")===6&&$(t).addClass("d-none")});$("#imgSystemIcon").attr("src",$("#Color_"+t).data("img"));$("#imgSystemIcon12").attr("src",$("#Color_"+t).data("img"));h=$(".js-case-selector input[name=Case]:checked");h.attr("data-v360")==="True"?n.InitDesignOption():($("#KeyShotVR").addClass("d-none"),$("#imgDesign").removeClass("d-none"),$("#imgDesign").attr("src",$("#Color_"+t).attr("data-imgm")));var u=$("#Color_"+t).data("token"),a=document.getElementById("js-design-selector-selectedcolor-price-black-"+u),v=document.getElementById("js-design-selector-selectedcolor-price-white-"+u);a&&$("#js-design-selector-selectedcolor-price-black-"+u).text("");v&&$("#js-design-selector-selectedcolor-price-white-"+u).text("");c=$("#Color_"+t).data("hasgallery");c===!0?$("#colorGallery").removeClass("d-none"):$("#colorGallery").addClass("d-none");$("#caseColorId").val($("#Color_"+t).data("colorid"));configuratorApp.CalculateTotals();configuratorApp.MaxLeadDays()},n.AccentColorDesignOnChange=function(t,i){var f=$(".js-design-selector-color li"),r,u;$.each(f,function(n,t){$(t).data("token")===i&&($(t).removeClass("selected"),$(t).attr("data-selected","false"))});$("#Color_"+t).addClass("selected");$("#Color_"+t).attr("data-selected","true");r=$(".js-design-selector-selectedcolor");$.each(r,function(n,i){if($(i).data("token")===$("#Color_"+t).data("token")){$(i).html("&ndash; "+$("#Color_"+t).data("name"));return}});u=$(".js-case-selector input[name=Case]:checked");u.attr("data-v360")==="True"?n.InitDesignOption():($("#KeyShotVR").addClass("d-none"),$("#imgDesign").removeClass("d-none"),$("#imgDesign").attr("src",$("#Color_"+t).attr("data-imgm")));configuratorApp.CalculateTotals();configuratorApp.MaxLeadDays()},n.CustomDesignOnChange=function(t,i){var l=$(".js-design-selector-color li"),u="",f,e,o,s;_.forEach(l,function(n){$(n).data("token")===i&&($(n).removeClass("selected"),$(n).attr("data-selected","false"));($(n).data("token")===5||$(n).data("token")===6)&&($(n).removeClass("selected"),$(n).attr("data-selected",!1),$(n).data("name")==="None"&&($(n).addClass("selected"),$(n).attr("data-selected",!0)));$(n).data("token")===1&&$(n).attr("data-selected")==="true"&&(u=$(n).data("id"))});$("#Color_"+t).addClass("selected").attr("data-selected","true");f=$(".js-group-selector");_.forEach(f,function(n){$(n).data("token")===3&&$(n).addClass("d-none");($(n).data("token")===5||$(n).data("token")===6)&&$(n).addClass("d-none")});e=$(".js-design-selector-selectedcolor");_.forEach(e,function(n){if($(n).data("token")===$("#Color_"+t).data("token")){$(n).html("&ndash; "+$("#Color_"+t).data("name"));return}});i===9||i===10?$("#imgSystemIcon").attr("src",$("#Color_"+u).data("img")):($("#imgSystemIcon").attr("src",$("#Color_"+t).data("img")),$("#imgSystemIcon12").attr("src",$("#Color_"+t).data("img")));o=$(".js-case-selector input[name=Case]:checked");o.attr("data-v360")==="True"?n.InitDesignOption():($("#KeyShotVR").addClass("d-none"),$("#imgDesign").removeClass("d-none"),$("#Color_"+t).attr("data-imgm")!==""?$("#imgDesign").attr("src",$("#Color_"+t).attr("data-imgm")):(i===9||i===10)&&$("#imgDesign").attr("src",$("#Color_"+u).attr("data-imgm")));var h=$("#Color_"+t).data("category"),r=$("#Color_"+t).data("token"),c=document.getElementById("js-design-selector-selectedcolor-price-black-"+r);c&&h===$("#js-design-selector-selectedcolor-price-black-"+r).data("category")?$("#js-design-selector-selectedcolor-price-black-"+r).text(" - $"+$("#Color_"+t).data("price")+".00"):$("#js-design-selector-selectedcolor-price-black-"+r).text("");c&&h===$("#js-design-selector-selectedcolor-price-white-"+r).data("category")?$("#js-design-selector-selectedcolor-price-white-"+r).text(" - $"+$("#Color_"+t).data("price")+".00"):$("#js-design-selector-selectedcolor-price-white-"+r).text("");$("#Color_"+t).data("name").includes("Custom")&&$("#notificationCustomDesignModal").modal("show");s=$("#Color_"+t).data("hasgallery");s===!0?$("#colorGallery").removeClass("d-none"):$("#colorGallery").addClass("d-none");$("#caseColorId").val($("#Color_"+t).data("colorid"));configuratorApp.CalculateTotals();configuratorApp.MaxLeadDays()},n.GlassPrintDesignOnChange=function(t,i){var c=$(".js-design-selector-color li"),u="",r,f,e,o,s,h;$.each(c,function(n,t){$(t).data("token")===i&&($(t).removeClass("selected"),$(t).attr("data-selected","false"));$(t).data("token")===1&&$(t).attr("data-selected")==="true"&&(u=$(t).data("id"))});$("#Color_"+t).addClass("selected");$("#Color_"+t).attr("data-selected",!0);r=$("#Color_"+t).data("token");f=$("#Color_"+t).data("pcounter");$("#js-design-selector-selectedcolor-price-"+r).text("$"+$("#Color_"+t).data("price")+".00");$("#js-design-selector-selectedcolor-price-"+r+"-"+f).text("$"+$("#Color_"+t).data("price")+".00");e=$(".js-design-selector-selectedcolor");$.each(e,function(n,i){if($(i).data("token")===$("#Color_"+t).data("token")){$(i).html("&ndash; "+$("#Color_"+t).data("name"));return}});$("#Color_"+t).data("name")!=="None"&&(o=$(".js-design-selector-color li"),$.each(o,function(n,t){if($(t).data("token")===6||$(t).data("token")===7){$(t).removeClass("selected");$(t).attr("data-selected",!1);$(t).data("name")==="None"&&($(t).addClass("selected"),$(t).attr("data-selected",!0));var i=$('p.js-design-selector-selectedcolor[data-token="'+$(t).data("token")+'"]');i.html("&ndash; None")}}),$("#Color_"+t).data("name").includes("Custom")&&$("#notificationCustomDesignModal").modal("show"));s=$(".js-case-selector input[name=Case]:checked");s.attr("data-v360")==="True"?n.InitDesignOption():($("#KeyShotVR").addClass("d-none"),$("#imgDesign").removeClass("d-none"),$("#Color_"+t).attr("data-imgm")!==""?$("#imgDesign").attr("src",$("#Color_"+t).attr("data-imgm")):$("#imgDesign").attr("src",$("#Color_"+u).attr("data-imgm")));h=$("#Color_"+t).data("hasgallery");h===!0?$("#colorGallery").removeClass("d-none"):$("#colorGallery").addClass("d-none");$("#caseColorId").val($("#Color_"+t).data("colorid"));configuratorApp.CalculateTotals();configuratorApp.MaxLeadDays()},n.TexturedPrintDesignOnChange=function(t,i){var o=$(".js-design-selector-color li"),r,u,f,e;$.each(o,function(n,t){$(t).data("token")===i&&($(t).removeClass("selected"),$(t).attr("data-selected",!1))});$("#Color_"+t).addClass("selected");$("#Color_"+t).attr("data-selected",!0);r=$(".js-design-selector-selectedcolor");$.each(r,function(n,i){if($(i).data("token")===$("#Color_"+t).data("token")){$(i).html("&ndash; "+$("#Color_"+t).data("name"));return}});$("#Color_"+t).data("name")!=="None"&&(u=$(".js-design-selector-color li"),$.each(u,function(n,t){if($(t).data("token")===5||$(t).data("token")===7){$(t).removeClass("selected");$(t).attr("data-selected",!1);$(t).data("name")==="None"&&($(t).addClass("selected"),$(t).attr("data-selected",!0));var i=$('p.js-design-selector-selectedcolor[data-token="'+$(t).data("token")+'"]');i.html("&ndash; None")}}),$("#Color_"+t).data("name").includes("Custom")&&$("#notificationCustomDesignModal").modal("show"));f=$(".js-case-selector input[name=Case]:checked");f.attr("data-v360")==="True"?n.InitDesignOption():($("#KeyShotVR").addClass("d-none"),$("#imgDesign").removeClass("d-none"),$("#imgDesign").attr("src",$("#Color_"+t).attr("data-imgm")));e=$("#Color_"+t).data("hasgallery");e===!0?$("#colorGallery").removeClass("d-none"):$("#colorGallery").addClass("d-none");$("#caseColorId").val($("#Color_"+t).data("colorid"));configuratorApp.CalculateTotals();configuratorApp.MaxLeadDays()},n.LaserEtchOnChange=function(t,i){var o=$(".js-design-selector-color li"),u,f,r,e;$.each(o,function(n,t){$(t).data("token")===i&&($(t).removeClass("selected"),$(t).attr("data-selected","false"))});$("#Color_"+t).addClass("selected");$("#Color_"+t).attr("data-selected","true");u=$(".js-design-selector-selectedcolor");$.each(u,function(n,i){if($(i).data("token")===$("#Color_"+t).data("token")){$(i).html("&ndash; "+$("#Color_"+t).attr("data-name"));return}});$("#Color_"+t).data("name")!=="None"&&(f=$(".js-design-selector-color li"),$.each(f,function(n,t){if($(t).data("token")===5||$(t).data("token")===6){$(t).removeClass("selected");$(t).attr("data-selected",!1);$(t).data("name")==="None"&&($(t).addClass("selected"),$(t).attr("data-selected",!0));var i=$('p.js-design-selector-selectedcolor[data-token="'+$(t).data("token")+'"]');i.html("&ndash; None")}}),$("#notificationCustomDesignModal").modal("show"));r=$(".js-case-selector input[name=Case]:checked");r.attr("data-v360")==="True"?n.InitDesignOption():($("#Color_"+t).attr("data-imgm")!==""&&$("#imgDesign").attr("src",$("#Color_"+t).attr("data-imgm")),$("#Color_"+t).attr("data-img")!==""&&($("#imgSystemIcon").attr("src",$("#Color_"+t).data("img")),$("#imgSystemIcon12").attr("src",$("#Color_"+t).data("img"))));r.attr("data-v360")==="True"?n.InitDesignOption():($("#KeyShotVR").addClass("d-none"),$("#imgDesign").removeClass("d-none"),$("#Color_"+t).attr("data-imgm")!==""&&$("#imgDesign").attr("src",$("#Color_"+t).attr("data-imgm")),$("#Color_"+t).attr("data-img")!==""&&($("#imgSystemIcon").attr("src",$("#Color_"+t).data("img")),$("#imgSystemIcon12").attr("src",$("#Color_"+t).data("img"))));e=$("#Color_"+t).data("hasgallery");e===!0?$("#colorGallery").removeClass("d-none"):$("#colorGallery").addClass("d-none");$("#caseColorId").val($("#Color_"+t).data("colorid"));configuratorApp.CalculateTotals();configuratorApp.MaxLeadDays()},n.InternalColorDesignOnChange=function(t,i){var f=$(".js-design-selector-color li"),r,u;$.each(f,function(n,t){$(t).data("token")===i&&($(t).removeClass("selected"),$(t).attr("data-selected","false"))});$("#Color_"+t).addClass("selected");$("#Color_"+t).attr("data-selected","true");r=$(".js-design-selector-selectedcolor");$.each(r,function(n,i){if($(i).attr("data-token")===$("#Color_"+t).attr("data-token")){$(i).html("&ndash; "+$("#Color_"+t).attr("data-name"));return}});u=$(".js-case-selector input[name=Case]:checked");u.attr("data-v360")==="True"?n.InitDesignOption():($("#KeyShotVR").addClass("d-none"),$("#imgDesign").removeClass("d-none"),$("#imgDesign").attr("src",$("#Color_"+t).attr("data-imgm")));configuratorApp.CalculateTotals();configuratorApp.MaxLeadDays()},n.InteriorLightingDesignOnChange=function(n,t){var r=$(".js-design-selector-color li"),i;$.each(r,function(n,i){$(i).data("token")===t&&($(i).removeClass("selected"),$(i).attr("data-selected","false"))});$("#Color_"+n).addClass("selected");$("#Color_"+n).attr("data-selected","true");i=$(".js-design-selector-selectedcolor");$.each(i,function(t,i){if($(i).attr("data-token")===$("#Color_"+n).attr("data-token")){$(i).html("&ndash; "+$("#Color_"+n).attr("data-name"));return}});$("#Color_"+n).attr("data-360view")==="false"&&$("#Color_"+n).attr("data-imgm")!==""&&($("#KeyShotVR").addClass("d-none"),$("#imgDesign").removeClass("d-none"),$("#imgDesign").attr("src",$("#Color_"+n).attr("data-imgm")));$("#Color_"+n).data("name").includes("Triangles")&&$("#notificationLightDesignModal").modal("show");configuratorApp.CalculateTotals();configuratorApp.MaxLeadDays()},n.PanelToggle=function(t){var f=$(t),e=$(".js-design-selector-color li"),r=$(".js-group-selector"),i=$(".js-design-selector-color li.selected"),u="False",o;$.each(i,function(n,t){if($(t).data("token")===1)return u=$(t).attr("data-paint"),!1});o=$(".js-design-selector-selectedcolor");$.each(o,function(n,t){if($(t).data("token")===8)return $(t).html("&ndash; "+f.attr("data-name")),!1});switch(f.attr("data-name")){case"Tempered Glass-Aluminum":$.each(e,function(n,t){$(t).data("token")===6&&($(t).removeClass("selected"),$(t).attr("data-selected",!1),$(t).data("name")==="None"&&($(t).addClass("selected"),$(t).attr("data-selected",!0)));$(t).data("token")===5&&($(t).removeClass("selected"),$(t).attr("data-selected",!1),$(t).data("name")==="None"&&($(t).addClass("selected"),$(t).attr("data-selected",!0)))});$.each(r,function(n,t){$(t).data("token")===5&&$(t).addClass("d-none");$(t).data("token")===6&&u==="False"&&$(t).removeClass("d-none");$(t).data("token")===7&&$(t).removeClass("d-none")});i=$(".js-design-selector-selectedcolor");_.forEach(i,function(n){$(n).data("token")===5&&$(n).html("&ndash; None")});break;case"Aluminum-Aluminum":$.each(e,function(n,t){$(t).data("token")===5&&($(t).removeClass("selected"),$(t).attr("data-selected",!1),$(t).data("name")==="None"&&($(t).addClass("selected"),$(t).attr("data-selected",!0)));$(t).data("token")===6&&($(t).removeClass("selected"),$(t).attr("data-selected",!1),$(t).data("name")==="None"&&($(t).addClass("selected"),$(t).attr("data-selected",!0)));$(t).data("token")===7&&($(t).removeClass("selected"),$(t).attr("data-selected",!1),$(t).data("name")==="None"&&($(t).addClass("selected"),$(t).attr("data-selected",!0)))});$.each(r,function(n,t){$(t).data("token")===5&&$(t).addClass("d-none");$(t).data("token")===6&&$(t).addClass("d-none");$(t).data("token")===7&&$(t).addClass("d-none")});i=$(".js-design-selector-selectedcolor");_.forEach(i,function(n){$(n).data("token")===5&&$(n).html("&ndash; None");$(n).data("token")===6&&$(n).html("&ndash; None");$(n).data("token")===7&&$(n).html("&ndash; None")});break;case"Tempered Glass-Tempered Glass":u==="False"&&$.each(r,function(n,t){$(t).data("token")===5&&$(t).removeClass("d-none");$(t).data("token")===6&&$(t).removeClass("d-none");$(t).data("token")===7&&$(t).removeClass("d-none")})}n.InitDesignOption();configuratorApp.CalculateTotals();configuratorApp.MaxLeadDays()},n.CalculateDesignTotals=function(){var t=$(".js-group-selector"),a=$(".js-design-selector-color li.selected"),r=0,u=0,f=0,e=0,o=0,s=0,h=0,i=0,n=0,c=0,l="",v=$(".js-case-selector input[name=Case]:checked"),y=$(".js-design-selector-sidepanel input[name=PanelId]:checked");return v.data("primecaseid")>0&&(l=y.data("name")),_.forEach(a,function(a){var v=$(a);switch(v.data("token")){case 1:r=parseFloat(v.attr("data-price"));switch(l){case"Tempered Glass-Aluminum":n=parseFloat(v.attr("data-panelprice"));break;case"Aluminum-Aluminum":n=parseFloat(v.attr("data-panelprice"))*2;break;case"Tempered Glass-Tempered Glass":n=0}break;case 2:u=parseFloat(v.attr("data-price"));break;case 3:_.forEach(t,function(n){if($(n).data("token")===3){$(n).hasClass("d-none")===!1&&(f=parseFloat(v.attr("data-price")));return}});break;case 4:h=parseFloat(v.attr("data-price"));break;case 5:_.forEach(t,function(n){if($(n).data("token")===5){$(n).hasClass("d-none")===!1&&(o=parseFloat(v.attr("data-price")),i=parseFloat(v.attr("data-panelprice")));return}});break;case 6:_.forEach(t,function(n){if($(n).data("token")===6){$(n).hasClass("d-none")===!1&&(s=parseFloat(v.attr("data-price")),i=parseFloat(v.attr("data-panelprice")));return}});break;case 7:e=parseFloat(v.attr("data-price"));i=parseFloat(v.attr("data-panelprice"));break;case 9:case 10:c+=parseFloat(v.attr("data-price"))}}),r+u+f+e+o+s+h+n+c},n.DesignMaxLeadDays=function(){var n=$(".js-group-selector"),h=$(".js-design-selector-color li.selected"),i=0,r=0,u=0,f=0,e=0,o=0,s=0,t=0;return _.forEach(h,function(h){var c=$(h);switch(c.data("token")){case 1:i=c.data("leadtime");break;case 2:r=c.data("leadtime");break;case 3:$.each(n,function(n,t){if($(t).data("token")===3){$(t).hasClass("d-none")===!1&&(u=c.data("leadtime"));return}});break;case 4:s=c.data("leadtime");break;case 5:_.forEach(n,function(n){if($(n).data("token")===5){$(n).hasClass("d-none")===!1&&(e=c.data("leadtime"));return}});break;case 6:_.forEach(n,function(n){if($(n).data("token")===6){$(n).hasClass("d-none")===!1&&(o=c.data("leadtime"));return}});break;case 7:f=c.data("leadtime");break;case 9:case 10:t=Math.max(t,c.data("leadtime"))}}),Math.max(i,r,u,f,e,o,s,t,2)},n}({});configuratorBuildApp=function(n){return n.SelectProduct=function(t){var i=$(t).parent("div.js-product-selector"),o=$("#buildConstrains"),p=$("#provider_cpuCategoryId").data("value"),s=$("#provider_mbCategoryId").data("value"),w=$("#provider_csCategoryId").data("value"),b=$("#provider_cpuLanesSL").data("value"),u=$('div.card.js-product-selector.selected[data-category="'+s+'"]'),r,f,h,c;u.length===0&&(u=$('div.card.js-product-selector.selected[data-container="'+s+'"]'));var k=$("#provider_mbPCHLanesSL").data("value"),d=o.find('[data-productid="'+$(u).attr("data-product")+'"][data-specificationlabelid="'+k+'"]').data("slvalue")||0,e=0,l=0,a=0,v=0,y=0;(e=parseInt($("#provider_gPCI").attr("data-value")),l=parseInt($("#provider_ggPCI").attr("data-value")),a=parseInt($("#provider_gnPCI").attr("data-value")),v=parseInt($("#provider_gaPCI").attr("data-value")),y=parseInt($("#provider_grPCI").attr("data-value")),r=systemGraph.find(function(n){return n.p===i.data("product")&&n.c===i.data("category")}),!i.hasClass("selected")||isLoadDefault||r.m!==!1||r.m2!==!1||r.m3!==!1||r.o!==!1)&&(f=i.data("container")===0?i.data("category"):i.data("container"),$(".prdpromo li").addClass("d-none"),f===p?(h=o.find('[data-productid="'+i.attr("data-product")+'"][data-specificationlabelid="'+b+'"]').data("slvalue")||0,e=d+h,e>=l+a+v+y?(c=configuratorMatchCApp.CPUMbConstrainTrigger(i),c?n.SelectProductNext(t):swal({title:"Selection Conflict",text:"This will update your Motherboard selection and it does not support your current configuration.  Are you sure you want to continue? Your current configuration will be reset.",type:"warning",showCancelButton:!0,confirmButtonClass:"btn-success",confirmButtonText:"Yes, Proceed!",cancelButtonClass:"btn-outline-light",cancelButtonText:"Cancel",closeOnConfirm:!0,closeOnCancel:!0},function(i){i&&(configuratorToolsApp.ResetToDefaults(),n.SelectProductNext(t))})):n.SelectProductNext(t)):(f===w&&($(".currentspecial li").addClass("d-none"),i.hasClass("selected")||$("#special-"+i.data("product")).removeClass("d-none")),n.SelectProductNext(t)))},n.SelectProductNext=function(t){var h,ni,fi,g;isPrdDefaultChange||(isPrdDefaultChange=!0);h=$(t).parent("div.js-product-selector");ni=$("#category_"+h.attr("data-category")).children("div.row").children("div.config-option");ni.length===0&&(ni=$("#category_"+h.attr("data-category")).children("div.tab-pane").children("div.row").children("div.config-option"));var ai=ni.children("div.card.js-product-selector"),ir=ni.children("div.card.js-product-selector.selected"),i=$('div.card.js-product-selector.selected[data-sp="'+h.data("sp")+'"]'),lr=$('div.card.js-product-selector[data-sp="'+h.data("sp")+'"]').first(),r=$(),ct=$(".js-case-selector input[name=Case]:checked"),ri=parseInt(ct.attr("data-caseid"))>0?parseInt(ct.attr("data-caseid")):0,ei=parseInt(ct.attr("data-primecaseid"))>0?parseInt(ct.attr("data-primecaseid")):0,bt=ct.attr("data-case"),nt=2;(bt==="ORIGIN Chronos with Mesh"||bt==="ORIGIN Chronos with Glass")&&(nt=1);var u=$("#buildConstrains"),vi=$("#provider_caseOverclocked").data("value"),ti=$("#provider_cpuCategoryId").data("value"),yi=$("#provider_scCategoryId").data("value"),ui=$("#provider_hdCategoryId").data("value"),k=$("#provider_hdM2SataSubcategoryId").data("value"),w=$("#provider_hdIntelOptaneSubcategoryId").data("value"),ot=$("#provider_hdNvmeSubcategoryId").data("value"),kt=$("#provider_hdMechanicalSubcategoryId").data("value"),lt=$("#provider_hdSSDSubcategoryId").data("value"),oi=$("#provider_hdPCIeSubcategoryId").data("value"),rr=$("#provider_osdCategoryId").data("value"),at=$("#provider_gcCategoryId").data("value"),ur=$("#provider_rcCategoryId").data("value"),ii=$("#provider_nwCategoryId").data("value"),vt=$("#provider_auCategoryId").data("value"),dt=$("#provider_ccCategoryId").data("value"),yt=$("#provider_psCategoryId").data("value"),si=$("#provider_hdcCategoryId").data("value"),st=$("#provider_odCategoryId").data("value"),pt=$("#provider_mcrCategoryId").data("value"),wt=$("#provider_vrCategoryId").data("value"),pi=$("#provider_bfCategoryId").data("value"),hi=$('div.card.js-product-selector.selected[data-category="'+si+'"]');hi.length===0&&(hi=$('div.card.js-product-selector.selected[data-container="'+si+'"]'));var fr=$("#provider_hdcTotalAddedSL").data("value"),ft=u.find('[data-productid="'+$(hi).attr("data-product")+'"][data-specificationlabelid="'+fr+'"]').data("slvalue")||0,ci=$("#provider_mbCategoryId").data("value"),f=$('div.card.js-product-selector.selected[data-category="'+ci+'"]');f.length===0&&(f=$('div.card.js-product-selector.selected[data-container="'+ci+'"]'));var er=$("#provider_mbSataPortsSL").data("value"),p=u.find('[data-productid="'+$(f).attr("data-product")+'"][data-specificationlabelid="'+er+'"]').data("slvalue")||0,wi=$("#provider_mbPCHLanesSL").data("value"),bi=u.find('[data-productid="'+$(f).attr("data-product")+'"][data-specificationlabelid="'+wi+'"]').data("slvalue")||0,li=$('div.card.js-product-selector.selected[data-category="'+ti+'"]');li.length===0&&(li=$('div.card.js-product-selector.selected[data-container="'+ti+'"]'));var ki=$("#provider_cpuLanesSL").data("value"),di=u.find('[data-productid="'+$(li).attr("data-product")+'"][data-specificationlabelid="'+ki+'"]').data("slvalue")||0,tt=parseInt($("#provider_hdMechanical").attr("data-value")),or=parseInt($("#provider_scCryoMechanical").attr("data-value")),sr=parseInt($("#provider_psMechanical").attr("data-value")),gi=parseInt($("#provider_hdSSD").attr("data-value")),it=parseInt($("#provider_bd525").attr("data-value")),b=parseInt($("#provider_hdGlobal").attr("data-value"));ft=ft-or-sr;fi=$("#buildConstraintDetails");g=$('div.card.js-product-selector.selected[data-category="'+yt+'"]');g.length===0&&(g=$('div.card.js-product-selector.selected[data-container="'+yt+'"]'));var o=0,c=0,s=0,e=0,v=0;o=parseInt($("#provider_gPCI").attr("data-value"));c=parseInt($("#provider_ggPCI").attr("data-value"));s=parseInt($("#provider_gnPCI").attr("data-value"));e=parseInt($("#provider_gaPCI").attr("data-value"));v=parseInt($("#provider_grPCI").attr("data-value"));var gt=parseInt($("#provider_mbMaxGpu").attr("data-value")),rt=parseInt($("#provider_mbMaxNvme").attr("data-value")),ut=parseInt($("#provider_mbSBNvme").attr("data-value")),ht=$("#provider_physicalSlotSL").data("value"),l=$("#provider_pciLengthSL").data("value"),nr=$("#caseConstrains"),tr=$("#provider_casePCISlotSL").data("value"),d=ri>0?nr.find('[data-caseid= "'+ri+'"][data-specificationlabelid="'+tr+'"]').data("value")||0:nr.find('[data-primecaseid= "'+ei+'"][data-specificationlabelid="'+tr+'"]').data("value")||0,a=!1,y=systemGraph.find(function(n){return n.p===h.data("product")&&n.c===h.data("category")}),hr=["287","1320","1211"],cr=["2001","2013","2014"],et=$('div.card.js-product-selector.selected[data-category="'+at+'"]');(et.length===0&&(et=$('div.card.js-product-selector.selected[data-container="'+at+'"]')),!h.hasClass("selected")||isLoadDefault||y.m!==!1||y.m2!==!1||y.m3!==!1||y.o!==!1)&&(_.forEach(ai,function(n){var t=systemGraph.find(function(t){return t.p===$(n).data("product")&&t.c===$(n).data("category")});typeof t!="undefined"&&(t.m===!1&&t.m2===!1&&t.m3===!1||h.data("subcategory")===w&&$(n).data("subcategory")===w)&&(t.o===!0?t.p!==h.data("product")&&$(n).hasClass("selected")&&(r=$(n),$(n).removeClass("selected"),$(n).find("p.cost").html("$"+Math.round(t.fp))):$(n).hasClass("selected")&&function(){r=$(n);$(n).removeClass("selected");$(n).find(".js-selector-option-select").find("option:eq(0)").prop("selected",!0);var i=$(n).find("input:checkbox");i.length>0&&i.each(function(){i.each(function(){var i,n;$(this).is(":checked")&&($(this).prop("checked",!1),idArray=_.split($(this).attr("id"),"|",$(this).attr("id").length),i=_.find(t.og,{og:parseInt(idArray[1])}),typeof i!="undefined"&&(n=_.find(i.o,{o:parseInt(idArray[2])}),typeof n!="undefined"&&n.sl!==null&&configuratorMatchCApp.OptionProductValueConstrainTrigger(n.sl,n.slv,!1)))})})}())}),_.forEach(ai,function(n){var ni=systemGraph.find(function(t){return t.p===$(n).data("product")&&t.c===$(n).data("category")}),hr,or,ru,uu,fu,nu,sr,eu,yr,tr,dr,ou,cr,su,hu,tu,cu,iu,t,hi,ai,lr,lu,ar;if(typeof ni!="undefined")if(ni.p===h.data("product"))if(fi.find('[data-parententity="Category"][data-parentproductid="'+ni.p+'"]').each(function(){var t=$.find('div.card.js-product-selector.selected[data-product="'+$(this).attr("data-productid")+'"]');if(t.length>0)return $(this).data("message")!==""?helperApp.Modal("Selection Conflict",$(this).data("message")):helperApp.Modal("Selection Conflict","Your "+$(n).attr("data-name")+" is incompatible with "+$(t).data("name")),a=!0,!1}),fi.find('[data-productid="'+ni.p+'"]').each(function(){switch($(this).attr("data-parententity")){case"Case":if($(this).data("parententity")==="Case"&&ri>0&&ri===$(this).data("parentproductid"))return helperApp.Modal("Selection Conflict","Your "+$(ct).attr("data-case")+" is incompatible with "+$(n).attr("data-name")),a=!0,!1;break;case"PrimeCase":if(ei>0&&ei===$(this).data("parentproductid"))return helperApp.Modal("Selection Conflict","Your "+$(ct).attr("data-case")+" is incompatible with "+$(n).attr("data-name")),a=!0,!1;break;case"Category":var t=$.find('div.card.js-product-selector.selected[data-product="'+$(this).attr("data-parentproductid")+'"]');if(t.length>0)return $(this).data("message")!==""?helperApp.Modal("Selection Conflict",$(this).data("message")):helperApp.Modal("Selection Conflict","Your "+$(n).attr("data-name")+" is incompatible with "+$(t).data("name")),a=!0,!1}}),a)$(r).addClass("selected"),$("#sp_"+$(r).data("sp")).html($(r).data("name")),$("#img_selected_"+$(r).data("sp")).attr("src",$(r).data("p")),$(r).find("p.cost").html("");else if(hr=$(n).data("container")===0?$(n).data("category"):$(n).data("container"),ni.m===!0||ni.m2===!0||ni.m3===!0)if($(n).hasClass("selected"))(ir.length>1||ni.o===!0)&&function(){var t,o,l;switch(hr){case at:var a=parseInt($("#provider_ggpu").attr("data-value")),r=$(n).closest("div").find("select"),e=1;r.length>0&&(t=$("option:selected",r),t!==null&&t.data("qty")>0&&(e+=t.data("qty")));a=a-1*e;c=a*8;$("#provider_ggpu").attr("data-value",a);$("#provider_ggPCI").attr("data-value",c);$("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-product="'+$(n).attr("data-product")+'"]').each(function(){$(this).attr("data-gpci",$(this).attr("data-configuration"));$(this).attr("data-product","")});var p=$("#provider_powerDrawSL").data("value"),b=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+p+'"]').data("slvalue")||0,y=parseInt($("#provider_gpuTw").attr("data-value"))||0;y=y-b;$("#provider_gpuTw").attr("data-value",y);break;case ui:if($(n).data("subcategory")===k||$(n).data("subcategory")===ot||$(n).data("subcategory")===w){var d=$("#provider_m2PortOccupiedSL").attr("data-value"),g=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+d+'"]').data("slvalue")||0,v=parseInt($("#provider_gnvme").attr("data-value"));r=$(n).closest("div").find("select");e=1;r.length>0&&(t=$("option:selected",r),t!==null&&t.data("qty")>0&&(e+=t.data("qty")));v=v-1*e;s=v*4;$("#provider_gnvme").attr("data-value",v);$("#provider_gnPCI").attr("data-value",s)}}$(n).removeClass("selected");$(n).find(".js-selector-option-select").find("option:eq(0)").prop("selected",!0);o=$(n).find("input:checkbox");o.length>0&&o.each(function(){o.each(function(){$(this).is(":checked")&&$(this).prop("checked",!1)})});i=$('div.card.js-product-selector.selected[data-sp="'+h.data("sp")+'"]');i.length>0?(l=i.first(),i.length>1?$("#sp_"+$(n).data("sp")).html(l.data("name")+" <span class= 'text-warning'> (+ "+(i.length-1)+" more selected) <\/span>"):$("#sp_"+$(n).data("sp")).html(""+l.data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(l).data("p"))):($("#sp_"+$(n).data("sp")).html("None Selected"),$("#img_selected_"+$(n).data("sp")).attr("src",DEFAULT_IMAGE_URL))}();else{var fr=0,pi=0,nr=0,er=0,pr=0,li=0,y=0,vr=nt*tt+gi;switch(hr){case ui:if($('div.card.js-product-selector.selected[data-category="'+st+'"]').each(function(){var n=$(this).find("select");n.length>0?n.each(function(){var t=$("option:selected",$(this));t!==null&&(t.data("qty")>0?li+=t.data("qty"):n.length===1&&(li+=1))}):li+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+k+'"]').each(function(){var n=$(this).find("select");n.length>0?n.each(function(){var t=$("option:selected",$(this));t!==null&&(t.data("qty")>0?er+=t.data("qty"):n.length===1&&(er+=1))}):er+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+lt+'"]').each(function(){var n=$(this).find("select");n.length>0?n.each(function(){var t=$("option:selected",$(this));t!==null&&(t.data("qty")>0?pi+=t.data("qty"):n.length===1&&(pi+=1))}):pi+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+kt+'"]').each(function(){var n=$(this).find("select");n.length>0?n.each(function(){var t=$("option:selected",$(this));t!==null&&(t.data("qty")>0?fr+=t.data("qty"):n.length===1&&(fr+=1))}):fr+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+w+'"]').each(function(){var n=$(this).find("select");n.length>0?n.each(function(){var t=$("option:selected",$(this));t!==null&&(t.data("qty")>0?nr+=t.data("qty"):n.length===1&&(nr+=1))}):nr+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+ot+'"]').each(function(){var n=$(this).find("select");n.length>0?n.each(function(){var t=$("option:selected",$(this));t!==null&&(t.data("qty")>0?pr+=t.data("qty"):n.length===1&&(pr+=1))}):pr+=1}),or=fr+nr,ft>0&&(or=or<=ft?0:or-ft),$(n).data("subcategory")===w)fr+nr+1>tt+ft?helperApp.Modal("Selection Conflict","The "+bt+" case only has space for "+(tt+ft)+" mechanical drives. "):or+pi+1>b?helperApp.Modal("Selection Conflict","Maximum available drives is "+b+", please reduce the number of drives selected"):pi+nt*(or+1)>vr?helperApp.Modal("Selection Conflict","Maximum available drives on this case is "+vr+", please reduce the number of drives selected"):fr+pi+nr+er+li+1>p?helperApp.Modal("Selection Conflict","Maximum available SATA ports is "+p+", please reduce the number of drives selected"):(tr=pr+nr+er+1,s=tr*4,rt+ut>=tr?o>=c+s+e+v?($("#provider_gnvme").attr("data-value",tr),$("#provider_gnPCI").attr("data-value",s),$(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html()===""||$("#sp_"+$(n).data("sp")).html()==="None Selected"?$("#sp_"+$(n).data("sp")).html($(n).data("name")):i.length>0&&(t=i.first(),i.length===1&&t.data("subcategory")===w?$("#sp_"+$(n).data("sp")).html($(n).data("name")):function(){var r=0;i.each(function(){$(this).data("subcategory")===w&&r++});r>0?$("#sp_"+$(n).data("sp")).html(t.data("name")+" <span class= 'text-warning'> (+ "+(i.length-1)+" more selected) <\/span>"):$("#sp_"+$(n).data("sp")).html(t.data("name")+" <span class= 'text-warning'> (+ "+i.length+" more selected) <\/span>")}()),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):helperApp.Modal("Selection Conflict","Maximum CPU PCIe Lanes available on the selected processor is "+o+", please reduce the number of PCIe Lanes selected"):helperApp.Modal("Selection Conflict","Maximum Number of PCIe M.2 Allowed on the selected motherboard is "+(rt+ut)+", please reduce the number of PCIe M.2 selected"));else if($(n).data("subcategory")===kt)fr+nr+1>tt+ft?helperApp.Modal("Selection Conflict","The "+bt+" case only has space for "+(tt+ft)+" mechanical drives. "):or+pi+1>b?helperApp.Modal("Selection Conflict","Maximum available  drives is "+b+", please reduce the number of drives selected"):pi+nt*(or+or>0?1:0)>vr?helperApp.Modal("Selection Conflict","Maximum available drives on this case is "+vr+", please reduce the number of drives selected"):fr+pi+nr+er+li+1>p?helperApp.Modal("Selection Conflict","Maximum available SATA ports is "+p+", please reduce the number of drives selected"):($(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html()===""||$("#sp_"+$(n).data("sp")).html()==="None Selected"?$("#sp_"+$(n).data("sp")).html($(n).data("name")):i.length>0&&(t=i.first(),$("#sp_"+$(n).data("sp")).html(t.data("name")+" <span class= 'text-warning'> (+ "+i.length+" more selected) <\/span>")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p")));else if($(n).data("subcategory")===lt)or+pi+1>b?helperApp.Modal("Selection Conflict","Maximum available drives is "+b+", please reduce the number of drives selected"):pi+nt*or+1>vr?helperApp.Modal("Selection Conflict","Maximum available drives on this case is "+vr+", please reduce the number of drives selected"):fr+pi+nr+er+li+1>p?helperApp.Modal("Selection Conflict","Maximum available SATA ports is "+p+", please reduce the number of drives selected"):($(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html()===""||$("#sp_"+$(n).data("sp")).html()==="None Selected"?$("#sp_"+$(n).data("sp")).html($(n).data("name")):i.length>0&&(t=i.first(),$("#sp_"+$(n).data("sp")).html(t.data("name")+" <span class= 'text-warning'> (+ "+i.length+" more selected) <\/span>")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p")));else if($(n).data("subcategory")===ot||$(n).data("subcategory")===k){var tr=parseInt($("#provider_gnvme").attr("data-value")),vu=$("#provider_m2PortOccupiedSL").attr("data-value"),bu=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+vu+'"]').data("slvalue")||0;tr=pr+nr+er+1;s=tr*4;rt+ut>=tr?o>=c+s+e+v?$(n).data("subcategory")===k&&fr+pi+nr+er+li+1>p?helperApp.Modal("Selection Conflict","Maximum available SATA ports is "+p+", please reduce the number of drives selected"):($("#provider_gnvme").attr("data-value",tr),$("#provider_gnPCI").attr("data-value",s),$(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html()===""||$("#sp_"+$(n).data("sp")).html()==="None Selected"?$("#sp_"+$(n).data("sp")).html($(n).data("name")):i.length>0&&(t=i.first(),$("#sp_"+$(n).data("sp")).html(t.data("name")+" <span class= 'text-warning'> (+ "+i.length+" more selected) <\/span>")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):helperApp.Modal("Selection Conflict","Maximum CPU PCIe Lanes available on the selected processor is "+o+", please reduce the number of PCIe Lanes selected"):helperApp.Modal("Selection Conflict","Maximum Number of PCIe M.2 Allowed on the selected motherboard is "+(rt+ut)+", please reduce the number of PCIe M.2 selected")}else $(n).data("subcategory")===oi&&(ru=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0,uu=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+ht+'"]').data("slvalue")||0,found=configuratorToolsApp.AvailablePhysicalPCIeSlots(f,ru,uu,d,productId),found?($(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html()===""||$("#sp_"+$(n).data("sp")).html()==="None Selected"?$("#sp_"+$(n).data("sp")).html($(n).data("name")):i.length>0&&(t=i.first(),$("#sp_"+$(n).data("sp")).html(t.data("name")+" <span class= 'text-warning'> (+ "+i.length+" more selected) <\/span>")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):helperApp.Modal("Selection Conflict","You have exceeded the Motherboard Physical PCIe Slots, please reduce the number of PCIe Slots selected"));break;case st:$('div.card.js-product-selector.selected[data-category="'+st+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(li+=n.data("qty")>0?n.data("qty"):1)):li+=1});y=li;$('div.card.js-product-selector.selected[data-category="'+pt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(y+=n.data("qty")>0?n.data("qty"):1)):y+=1});$('div.card.js-product-selector.selected[data-category="'+wt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(y+=n.data("qty")>0?n.data("qty"):1)):y+=1});$('div.card.js-product-selector.selected[data-subcategory="'+k+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(er+=n.data("qty")>0?n.data("qty"):1)):er+=1});$('div.card.js-product-selector.selected[data-subcategory="'+lt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(pi+=n.data("qty")>0?n.data("qty"):1)):pi+=1});$('div.card.js-product-selector.selected[data-subcategory="'+kt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(fr+=n.data("qty")>0?n.data("qty"):1)):fr+=1});$('div.card.js-product-selector.selected[data-subcategory="'+w+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(nr+=n.data("qty")>0?n.data("qty"):1)):nr+=1});fr+pi+nr+er+li+1>p?helperApp.Modal("Selection Conflict","Maximum available SATA ports is "+p+", please reduce the number of drives selected"):y+1>it?helperApp.Modal("Selection Conflict","Maximum available 5.25 Physical Spots is "+it+", please reduce the number of bay devices selected"):($(n).addClass("selected"),i.length>0?(t=i.first(),$("#sp_"+$(n).data("sp")).html(t.data("name")+" <span class= 'text-warning'> (+ "+i.length+" more selected) <\/span>"),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):($("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))));break;case pt:$('div.card.js-product-selector.selected[data-category="'+st+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(li+=n.data("qty")>0?n.data("qty"):1)):li+=1});y=li;$('div.card.js-product-selector.selected[data-category="'+pt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(y+=n.data("qty")>0?n.data("qty"):1)):y+=1});$('div.card.js-product-selector.selected[data-category="'+wt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(y+=n.data("qty")>0?n.data("qty"):1)):y+=1});y+1>it?helperApp.Modal("Selection Conflict","Maximum available 5.25 Physical Spots is "+it+", please reduce the number of bay devices selected"):($(n).addClass("selected"),i.length>0?(t=i.first(),$("#sp_"+$(n).data("sp")).html(t.data("name")+" <span class= 'text-warning'> (+ "+i.length+" more selected) <\/span>"),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):($("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))));break;case wt:$('div.card.js-product-selector.selected[data-category="'+st+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(li+=n.data("qty")>0?n.data("qty"):1)):li+=1});y=li;$('div.card.js-product-selector.selected[data-category="'+pt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(y+=n.data("qty")>0?n.data("qty"):1)):y+=1});$('div.card.js-product-selector.selected[data-category="'+wt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(y+=n.data("qty")>0?n.data("qty"):1)):y+=1});y+1>it?helperApp.Modal("Selection Conflict","Maximum available 5.25 Physical Spots is "+it+", please reduce the number of bay devices selected"):($(n).addClass("selected"),i.length>0?(t=i.first(),$("#sp_"+$(n).data("sp")).html(t.data("name")+" <span class= 'text-warning'> (+ "+i.length+" more selected) <\/span>"),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):($("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))));break;case at:var gr=parseInt($("#provider_ggpu").attr("data-value")),au=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0,yu=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+ht+'"]').data("slvalue")||0;au>0&&(gr+=1);c=gr*8;o>=c+s+e+v?gt>=gr?(fu=ni.p,nu=!1,nu=configuratorToolsApp.AvailablePhysicalPCIeSlots(f,au,yu,d,fu),nu?function(){var h=parseInt($("#provider_psTw").attr("data-value"))||0,r=parseInt($("#provider_mbTw").attr("data-value"))||0,f=parseInt($("#provider_cpuTw").attr("data-value"))||0,e=parseInt($("#provider_gpuTw").attr("data-value"))||0,o=$("#provider_powerDrawSL").data("value"),t=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+o+'"]').data("slvalue")||0,s;h<r+f+t+e&&($(g).removeClass("selected"),$('div.card.js-product-selector[data-category="'+yt+'"]').each(function(){var e;if(($(this).attr("data-constrainedcategory")===null||$(this).attr("data-constrainedcategory").length===0)&&($(this).attr("data-constrainedby")===null||$(this).attr("data-constrainedby")===undefined||$(this).attr("data-constrainedby")===undefined||$(this).attr("data-constrainedby")!==undefined&&$(this).attr("data-constrainedby").length===0)){var h=$("#provider_psPowerDrawPcSL").data("value"),c=u.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+o+'"]').data("slvalue")||0,l=u.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+h+'"]').data("slvalue")||0,s=c*l/100;if(s>=r+f+t)return $("#provider_psTw").attr("data-value",s),$(this).addClass("selected"),i=$('div.card.js-product-selector.selected[data-sp="'+$(this).attr("data-product")+'"]'),i.length>0?(e=i.first(),$("#sp_"+$(this).data("sp")).html(e.data("name")+" <span class= 'text-warning'> (+ "+(i.length-1)+" more selected) <\/span>"),$("#img_selected_"+$(n).data("sp")).attr("src",$(this).data("p"))):($("#sp_"+$(this).data("sp")).html("None Selected"),$("#img_selected_"+$(n).data("sp")).attr("src",DEFAULT_IMAGE_URL)),$(this).find("p.cost").html(""),$(g).data("product")!==$(this).data("product")&&helperApp.Modal("Configurator Change",$(this).data("categoryname")+" Updated <br> "+$(this).data("categoryname")+" has been updated to "+$(this).data("name")),et=$(this),!1}}));$("#provider_ggpu").attr("data-value",gr);$("#provider_ggPCI").attr("data-value",c);$(n).addClass("selected");i.length>0&&(s=i.first(),$("#sp_"+$(n).data("sp")).html(s.data("name")+" <span class= 'text-warning'> (+ "+i.length+" more selected) <\/span>"));$("#provider_gpuTw").attr("data-value",e+t);$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))}():helperApp.Modal("Selection Conflict","You have exceeded the Motherboard Physical PCIe Slots, please reduce the number of PCIe Slots selected")):helperApp.Modal("Selection Conflict","Maximum GPUs available on the selected motherboard is "+gt+", please reduce the number of GPUs selected"):helperApp.Modal("Selection Conflict","Maximum CPU PCIe Lanes available on the selected processor is "+o+" vs "+(c+s+e+v)+", please reduce the number of PCIe Lanes selected");break;default:ni.m===!0?($(n).addClass("selected"),i.length>0?(t=i.first(),$("#sp_"+$(n).data("sp")).html(t.data("name")+" <span class= 'text-warning'> (+ "+i.length+" more selected) <\/span>"),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):($("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p")))):i.length>1?ni.m2===!0&&i.length===2?swal({title:"Promo Selection Conflict",text:"You can only select two bonuses If you wish to change bonuses, please deselect your current bonuses.",type:"warning",confirmButtonClass:"btn-success",closeOnConfirm:!0,closeOnCancel:!0}):i.length>2&&ni.m3===!0?swal({title:"Promo Selection Conflict",text:"You can only select three bonuses. If you wish to change bonuses, please deselect your current bonuses.",type:"warning",confirmButtonClass:"btn-success",closeOnConfirm:!0,closeOnCancel:!0}):($(n).addClass("selected"),i.length>0?(t=i.first(),$("#sp_"+$(n).data("sp")).html(t.data("name")+" <span class= 'text-warning'> (+ "+i.length+" more selected) <\/span>"),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):($("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p")))):($(n).addClass("selected"),i.length>0?(t=i.first(),$("#sp_"+$(n).data("sp")).html(t.data("name")+" <span class= 'text-warning'> (+ "+i.length+" more selected) <\/span>"),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):($("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))))}}else if(ni.o===!0)if($(n).hasClass("selected")){sr=0;switch(hr){case yi:$('div.card.js-product-selector.selected[data-category="'+ti+'"]').length>0&&(eu=$('div.card.js-product-selector.selected[data-category="'+ti+'"]').find("input[type=checkbox]"),eu.is(":checked")||($(n).removeClass("selected"),$(n).find("p.cost").html("$"+Math.round(ni.fp))));$(n).removeClass("selected");$(n).find("p.cost").html("$"+Math.round(ni.fp));configuratorToolsApp.UpdateHardDriveSupported();break;case dt:cr=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0;sr=parseInt($("#provider_gaic").attr("data-value"));cr>0&&(sr=sr-1);e=sr*4;$("#provider_gaic").attr("data-value",sr);$("#provider_gaPCI").attr("data-value",e);$("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-product="'+$(n).attr("data-product")+'"]').each(function(){$(this).attr("data-gpci",$(this).attr("data-configuration"));$(this).attr("data-product","")});$(n).removeClass("selected");$(n).find("p.cost").html("$"+Math.round(ni.fp));break;case vt:yr=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0;sr=parseInt($("#provider_gaic").attr("data-value"));yr>0&&(sr=sr-1);e=sr*4;$("#provider_gaic").attr("data-value",sr);$("#provider_gaPCI").attr("data-value",e);$("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-product="'+$(n).attr("data-product")+'"]').each(function(){$(this).attr("data-gpci",$(this).attr("data-configuration"));$(this).attr("data-product","")});$(n).removeClass("selected");$(n).find("p.cost").html("$"+Math.round(ni.fp));break;case ui:($(n).data("subcategory")===w||$(n).data("subcategory")===k||$(n).data("subcategory")===ot)&&(tr=parseInt($("#provider_gnvme").attr("data-value")),ddselect=$(this).closest("div").find("select"),qty=1,ddselect.length>0&&(dr=$("option:selected",ddselect),dr!==null&&dr.data("qty")>0&&(qty+=dr.data("qty"))),tr=tr-1*qty,s=tr*4,$("#provider_gnvme").attr("data-value",tr),$("#provider_gnPCI").attr("data-value",s),$(n).removeClass("selected"),$(n).find("p.cost").html("$"+Math.round(ni.fp)));break;default:$(n).removeClass("selected");$(n).find("p.cost").html("$"+Math.round(ni.fp))}i=$('div.card.js-product-selector.selected[data-sp="'+$(n).data("sp")+'"]');i.length>0?(t=i.first(),i.length>1?$("#sp_"+$(n).data("sp")).html(t.data("name")+" <span class= 'text-warning'> (+ "+(i.length-1)+" more selected) <\/span>"):$("#sp_"+$(n).data("sp")).html(""+t.data("name"))):($("#sp_"+$(n).data("sp")).html("None Selected"),$("#img_selected_"+$(n).data("sp")).attr("src",DEFAULT_IMAGE_URL));ou=$("div.card.js-product-selector");$.each(ou,function(t,i){if($(i).attr("data-constrainedby")===$(n).attr("data-product")){var f=_.split($(i).attr("id"),"-",$(i).attr("id").length),r=parseInt(f[1]),u=parseInt(f[2]);$("#prd-"+r+"-"+u).removeClass("d-none");$("#cp-"+r+"-"+u).removeClass("constraintoverlay disabled");$("#cp-"+r+"-"+u).attr("data-constrainedby","");$("#cp-"+r+"-"+u).attr("data-constrainedcategory","")}})}else{var li=0,y=0,wr=0,br=0,kr=0;switch(hr){case dt:$('div.card.js-product-selector.selected[data-category="'+vt+'"]').each(function(){var n=u.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0;n>0&&(wr+=1)});$('div.card.js-product-selector.selected[data-category="'+ii+'"]').each(function(){var n=u.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0;n>0&&(br+=1)});$('div.card.js-product-selector.selected[data-category="'+dt+'"]').each(function(){var n=u.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0;n>0&&(kr+=1)});cr=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0;su=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+ht+'"]').data("slvalue")||0;gaic=parseInt($("#provider_gaic").attr("data-value"));gaic=cr>0?wr+br+kr+1:wr+br+kr;e=gaic*4;o>=c+s+e+v?($("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-product="'+$(r).attr("data-product")+'"]').each(function(){$(this).attr("data-gpci",$(this).attr("data-configuration"))}),cr>0?(hu=$(n).attr("data-product"),tu=!1,tu=configuratorToolsApp.AvailablePhysicalPCIeSlots(f,cr,su,d,hu),tu?($("#provider_gaic").attr("data-value",gaic),$("#provider_gaPCI").attr("data-value",e),$(n).addClass("selected"),$(n).find("p.cost").html("")):helperApp.Modal("Selection Conflict","You have exceeded the Motherboard Physical PCIe Slots, please reduce the number of PCIe Slots selected")):($("#provider_gaic").attr("data-value",gaic),$("#provider_gaPCI").attr("data-value",e),$(n).addClass("selected"),$(n).find("p.cost").html(""))):helperApp.Modal("Selection Conflict","Maximum CPU PCIe Lanes available on the selected processor is "+o+", please reduce the number of PCIe Lanes selected");break;case vt:$('div.card.js-product-selector.selected[data-category="'+vt+'"]').each(function(){var n=u.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0;n>0&&(wr+=1)});$('div.card.js-product-selector.selected[data-category="'+ii+'"]').each(function(){var n=u.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0;n>0&&(br+=1)});$('div.card.js-product-selector.selected[data-category="'+dt+'"]').each(function(){var n=u.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0;n>0&&(kr+=1)});gaic=parseInt($("#provider_gaic").attr("data-value"));var yr=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0,pu=u.find('[data-productid="'+$(r).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0,wu=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+ht+'"]').data("slvalue")||0;yr>0&&pu===0&&(gaic=wr+br+kr+1,e=gaic*4);o>=c+s+e+v?(cu=$(n).attr("data-product"),iu=!1,$("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-product="'+$(r).attr("data-product")+'"]').each(function(){$(this).attr("data-gpci",$(this).attr("data-configuration"))}),yr>0?(iu=configuratorToolsApp.AvailablePhysicalPCIeSlots(f,yr,wu,d,cu),iu?($("#provider_gaic").attr("data-value",gaic),$("#provider_gaPCI").attr("data-value",e),$("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-product="'+$(r).attr("data-product")+'"]').each(function(){$(this).attr("data-product","")}),$(n).addClass("selected"),$(n).find("p.cost").html("")):($("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-product="'+$(r).attr("data-product")+'"]').each(function(){$(this).attr("data-gpci",0)}),$(r).addClass("selected"),$(r).find("p.cost").html(""),helperApp.Modal("Selection Conflict","You have exceeded the Motherboard Physical PCIe Slots, please reduce the number of PCIe Slots selected"),a=!0)):($("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-product="'+$(r).attr("data-product")+'"]').each(function(){$(this).attr("data-product","")}),$(n).addClass("selected"),i.length>0?(t=i.first(),$("#sp_"+$(n).data("sp")).html(t.data("name")+" <span class= 'text-warning'> (+ "+i.length+" more selected) <\/span>")):$("#sp_"+$(n).data("sp")).html($(n).data("name")),$(n).find("p.cost").html(""),$("#img_selected_"+$(n).data("sp")).attr("src",$(this).data("p")))):($(r).addClass("selected"),$(r).find("p.cost").html(""),helperApp.Modal("Selection Conflict","Maximum CPU PCIe Lanes available on the selected processor is "+o+", please reduce the number of PCIe Lanes selected"),a=!0);break;case pt:$('div.card.js-product-selector.selected[data-category="'+st+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(li+=n.data("qty")>0?n.data("qty"):1)):li+=1});y=li;$('div.card.js-product-selector.selected[data-category="'+pt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(y+=n.data("qty")>0?n.data("qty"):1)):y+=1});$('div.card.js-product-selector.selected[data-category="'+wt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(y+=n.data("qty")>0?n.data("qty"):1)):y+=1});y+1>it?helperApp.Modal("Selection Conflict","Maximum available 5.25 Physical Spots is "+it+", please reduce the number of bay devices selected"):($(n).addClass("selected"),i.length>0?(t=i.first(),$("#sp_"+$(n).data("sp")).html(t.data("name")+" <span class= 'text-warning'> (+ "+i.length+" more selected) <\/span>"),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):($("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))));break;case wt:$('div.card.js-product-selector.selected[data-category="'+st+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(li+=n.data("qty")>0?n.data("qty"):1)):li+=1});y=li;$('div.card.js-product-selector.selected[data-category="'+pt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(y+=n.data("qty")>0?n.data("qty"):1)):y+=1});$('div.card.js-product-selector.selected[data-category="'+wt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(y+=n.data("qty")>0?n.data("qty"):1)):y+=1});y+1>it?helperApp.Modal("Selection Conflict","Maximum available 5.25 Physical Spots is "+it+", please reduce the number of bay devices selected"):($(n).addClass("selected"),i.length>0?(t=i.first(),$("#sp_"+$(n).data("sp")).html(t.data("name")+" <span class= 'text-warning'> (+ "+i.length+" more selected) <\/span>"),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):($("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))));break;default:$(n).addClass("selected");$(n).find("p.cost").html("")}i=$('div.card.js-product-selector.selected[data-sp="'+$(n).data("sp")+'"]');i.length>1?(t=i.first(),$("#sp_"+$(n).data("sp")).html(t.data("name")+" <span class= 'text-warning'> (+ "+(i.length-1)+" more selected) <\/span>")):$("#sp_"+$(n).data("sp")).html($(n).data("name"));$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))}else(function(){var tr=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+ht+'"]').data("slvalue")||0,ft=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0,wt=ni.p,ei=0,li=$("#provider_powerDrawSL").data("value"),su=$("#provider_psPowerDrawPcSL").data("value"),gr=parseInt($("#provider_psTw").attr("data-value"))||0,ir=parseInt($("#provider_mbTw").attr("data-value"))||0,fr=parseInt($("#provider_cpuTw").attr("data-value"))||0,pi=parseInt($("#provider_gpuTw").attr("data-value"))||0,vr,yr,pr,wr,br,kr,nu,dr,er,or,sr,it;switch(hr){case ui:var h=0,y=0,t=0,ct=0,pt=0,fi=0,ri=nt*tt+gi;if($('div.card.js-product-selector.selected[data-category="'+st+'"]').each(function(){var n=$(this).find("select");n.length>0?n.each(function(){var t=$("option:selected",$(this));t!==null&&(t.data("qty")>0?fi+=t.data("qty"):n.length===1&&(fi+=1))}):fi+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+k+'"]').each(function(){var n=$(this).find("select");n.length>0?n.each(function(){var t=$("option:selected",$(this));t!==null&&(t.data("qty")>0?ct+=t.data("qty"):n.length===1&&(ct+=1))}):ct+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+lt+'"]').each(function(){var n=$(this).find("select");n.length>0?n.each(function(){var t=$("option:selected",$(this));t!==null&&(t.data("qty")>0?y+=t.data("qty"):n.length===1&&(y+=1))}):y+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+kt+'"]').each(function(){var n=$(this).find("select");n.length>0?n.each(function(){var t=$("option:selected",$(this));t!==null&&(t.data("qty")>0?h+=t.data("qty"):n.length===1&&(h+=1))}):h+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+w+'"]').each(function(){var n=$(this).find("select");n.length>0?n.each(function(){var i=$("option:selected",$(this));i!==null&&(i.data("qty")>0?t+=i.data("qty"):n.length===1&&(t+=1))}):t+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+ot+'"]').each(function(){var n=$(this).find("select");n.length>0?n.each(function(){var t=$("option:selected",$(this));t!==null&&(t.data("qty")>0?pt+=t.data("qty"):n.length===1&&(pt+=1))}):pt+=1}),thereIsaConstraint=!1,$(n).data("subcategory")===lt)h+t+y+1>b?(helperApp.Modal("Selection Conflict","Maximum available drives is "+b+", please reduce the number of drives selected"),thereIsaConstraint=!0):y+nt*(h+t)+1>ri?(helperApp.Modal("Selection Conflict","Maximum available drives on this case is "+ri+", please reduce the number of drives selected"),thereIsaConstraint=!0):h+y+t+ct+fi+1>p?(helperApp.Modal("Selection Conflict","Maximum available SATA ports is "+p+", please reduce the number of drives selected"),thereIsaConstraint=!0):($(n).addClass("selected"),$(n).find("p.cost").html(""),$("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p")));else if($(n).data("subcategory")===ot||$(n).data("subcategory")===k){var cr=parseInt($("#provider_gnvme").attr("data-value")),tu=$("#provider_m2PortOccupiedSL").attr("data-value"),pu=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+tu+'"]').data("slvalue")||0;cr=pt+t+ct+1;s=cr*4;rt+ut>=cr?o>=c+s+e+v?$(n).data("subcategory")===k&&h+y+t+ct+fi+1>p?(helperApp.Modal("Selection Conflict","Maximum available SATA ports is "+p+", please reduce the number of drives selected"),thereIsaConstraint=!0):($("#provider_gnvme").attr("data-value",cr),$("#provider_gnPCI").attr("data-value",s),$(n).addClass("selected"),$(n).find("p.cost").html(""),$("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):(helperApp.Modal("Selection Conflict","Maximum CPU PCIe Lanes available on the selected processor is "+o+", please reduce the number of PCIe Lanes selected"),thereIsaConstraint=!0):(helperApp.Modal("Selection Conflict","Maximum Number of PCIe M.2 Allowed on the selected motherboard is "+(rt+ut)+", please reduce the number of PCIe M.2 selected"),thereIsaConstraint=!0)}else $(n).data("subcategory")===oi&&(or=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0,sr=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+ht+'"]').data("slvalue")||0,found=configuratorToolsApp.AvailablePhysicalPCIeSlots(f,or,sr,d,wt),found?($(n).addClass("selected"),$(n).find("p.cost").html(""),$("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):(helperApp.Modal("Selection Conflict","You have exceeded the Motherboard Physical PCIe Slots, please reduce the number of PCIe Slots selected"),thereIsaConstraint=!0));thereIsaConstraint&&(a=!0,$(r).addClass("selected"),$("#sp_"+$(r).data("sp")).html($(r).data("name")),$("#img_selected_"+$(r).data("sp")).attr("src",$(r).data("p")),$(r).find("p.cost").html(""));break;case ti:vr=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+ki+'"]').data("slvalue")||0;yr=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+li+'"]').data("slvalue")||0;o=bi+vr;o>=c+s+e+v?(gr<ir+yr+pi&&($(g).removeClass("selected"),$('div.card.js-product-selector[data-category="'+yt+'"]').each(function(){if(($(this).attr("data-constrainedcategory")===null||$(this).attr("data-constrainedcategory").length===0)&&($(this).attr("data-constrainedby")===null||$(this).attr("data-constrainedby")===undefined||$(this).attr("data-constrainedby")!==undefined&&$(this).attr("data-constrainedby").length===0)){var i=$("#provider_psPowerDrawPcSL").data("value"),r=u.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+li+'"]').data("slvalue")||0,f=u.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+i+'"]').data("slvalue")||0,t=r*f/100;if(t>=ir+fr+pi)return $("#provider_psTw").attr("data-value",t),$(this).addClass("selected"),$("#sp_"+$(this).data("sp")).html($(this).data("name")),$(this).find("p.cost").html(""),$("#img_selected_"+$(n).data("sp")).attr("src",$(this).data("p")),$(g).data("product")!==$(this).data("product")&&helperApp.Modal("Configurator Change",$(this).data("categoryname")+" Updated <br> "+$(this).data("categoryname")+" has been updated to "+$(this).data("name")),!1}})),$("#provider_gPCI").attr("data-value",o),di=vr,$(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html($(n).data("name")),$(n).find("p.cost").html(""),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p")),vi===1&&($(n).find(".js-selector-option-check").removeClass("d-none"),$(n).find(".js-selector-option-select").removeClass("d-none")),$("#provider_cpuTw").attr("data-value",yr)):($(r).addClass("selected"),$("#sp_"+$(r).data("sp")).html($(r).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(r).data("p")),$(r).find("p.cost").html(""),vi===1&&($(n).find(".js-selector-option-check").removeClass("d-none"),$(n).find(".js-selector-option-select").removeClass("d-none")),helperApp.Modal("Selection Conflict","PCIe Lanes already selected is "+(c+s+e+v)+" more than PCIe available "+o),a=!0);break;case ci:var hu=$("#provider_mbMaxGPUsSL").data("value"),cu=$("#provider_mbMaxNvmeSL").data("value"),lu=$("#provider_mbSBNvmeSL").data("value"),au=parseInt($("#provider_gnvme").attr("data-value")),nr=parseInt($("#provider_ggpu").attr("data-value")),iu=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+hu+'"]').data("slvalue")||0,ru=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+cu+'"]').data("slvalue")||0,uu=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+lu+'"]').data("slvalue")||0,fu=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+li+'"]').data("slvalue")||0,eu=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+wi+'"]').data("slvalue")||0;if(o=eu+di,o>=c+s+e+v)if(iu>=nr)if(ru+uu>=au){for(hi=[],$("#pciSlots").find('[data-productid="'+$(r).attr("data-product")+'"][data-gpci="0"]').each(function(){var t=this,n;($(this).attr("data-gpci")!==$(this).attr("data-configuration")||$(this).attr("data-configuration")==="0"&&$(this).attr("data-product")!=="")&&function(){var r=u.find('[data-productid="'+$(t).attr("data-product")+'"][data-specificationlabelid="'+ht+'"]').data("slvalue")||0,i=hi.findIndex(function(n){return n.productid===$(t).attr("data-product")&&n.width<r});i!==-1?hi[i].width=hi[i].width+1:(n={},n.productid=$(t).attr("data-product"),n.lenght=$(t).data("configuration"),n.width=1,n.found=!1,hi.push(n))}()}),pr=!0,ai=0;ai<hi.length;ai++)$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"]').each(function(){var r,t,i;if(parseInt($(this).attr("data-gpci"))>=hi[ai].lenght){if(r=$(this).data("slot")+1,hi[ai].width===1)return $(this).attr("data-gpci",0),$(this).attr("data-product",hi[ai].productid),hi[ai].found=!0,!1;if(hi[ai].width===2){if(t=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+r+'"]'),$(t).length!==0){if($(t).data("gpci")>0||$(t).data("gpci")===$(t).data("configuration"))return $(this).attr("data-gpci",0),$(this).attr("data-product",hi[ai].productid),$(t).attr("data-gpci",0),$(t).attr("data-product",hi[ai].productid),hi[ai].found=!0,!1}else if(r<=d)return $(this).attr("data-gpci",0),$(this).attr("data-product",wt),hi[ai].found=!0,!1}else if(hi[ai].width===3)if(t=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+r+'"]'),i=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+(r+1)+'"]'),$(i).length!==0){if(($(t).data("gpci")>0||$(t).data("gpci")===$(t).data("configuration"))&&($(i).data("gpci")>0||$(i).data("gpci")===$(i).data("configuration")))return $(this).attr("data-gpci",0),$(this).attr("data-product",hi[ai].productid),$(t).attr("data-gpci",0),$(t).attr("data-product",hi[ai].productid),$(i).attr("data-gpci",0),$(i).attr("data-product",hi[ai].productid),hi[ai].found=!0,!1}else if(r+1<=d)return $(this).attr("data-gpci",0),$(this).attr("data-product",wt),$(t).length!==0&&($(t).attr("data-gpci",0),$(t).attr("data-product",wt)),hi[ai].found=!0,!1}});for(ai=0;ai<hi.length;ai++)if(hi[ai].found===!1){pr=!1;break}pr?(gr<fu+fr+pi&&($(g).removeClass("selected"),$('div.card.js-product-selector[data-category="'+yt+'"]').each(function(){if(($(this).attr("data-constrainedcategory")===null||$(this).attr("data-constrainedcategory").length===0)&&($(this).attr("data-constrainedby")===null||$(this).attr("data-constrainedby")===undefined||$(this).attr("data-constrainedby")!==undefined&&$(this).attr("data-constrainedby").length===0)){var i=$("#provider_psPowerDrawPcSL").data("value"),r=u.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+li+'"]').data("slvalue")||0,f=u.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+i+'"]').data("slvalue")||0,t=r*f/100;if(t>=ir+fr+pi)return $("#provider_psTw").attr("data-value",t),$(this).addClass("selected"),$("#sp_"+$(this).data("sp")).html($(this).data("name")),$(this).find("p.cost").html(""),$("#img_selected_"+$(n).data("sp")).attr("src",$(this).data("p")),$(g).data("product")!==$(this).data("product")&&helperApp.Modal("Configurator Change",$(this).data("categoryname")+" Updated <br> "+$(this).data("categoryname")+" has been updated to "+$(this).data("name")),!1}})),$("#pciSlots").find('[data-productid="'+$(r).attr("data-product")+'"]').each(function(){$(this).attr("data-gpci",$(this).attr("data-configuration"));$(this).attr("data-product","")}),$("#provider_mbMaxGpu").attr("data-value",iu),$("#provider_mbMaxNvme").attr("data-value",ru),$("#provider_mbSBNvme").attr("data-value",uu),$("#provider_mbTw").attr("data-value",fu),$("#provider_gPCI").attr("data-value",o),bi=eu,$(n).addClass("selected"),$(n).find("p.cost").html(""),configuratorToolsApp.UpdateHardDriveSupported()):($(r).addClass("selected"),$(r).find("p.cost").html(""),helperApp.Modal("Selection Conflict","There is not available Physical PCIe Slots in this Motherboard , PCie slots doesnt work"),a=!0)}else $(r).addClass("selected"),$("#sp_"+$(r).data("sp")).html($(r).data("name")),$(r).find("p.cost").html(""),$("#img_selected_"+$(n).data("sp")).attr("src",$(r).data("p")),helperApp.Modal("Selection Conflict","Maximum GPUs available on the selected motherboard is "+gt+", please reduce the number of GPUs selected"),a=!0;else $(r).addClass("selected"),$(r).find("p.cost").html(""),helperApp.Modal("Selection Conflict","Maximum GPUs available on the selected motherboard is "+gt+", please reduce the number of GPUs selected"),a=!0;else $(r).addClass("selected"),$(r).find("p.cost").html(""),helperApp.Modal("Selection Conflict","PCIe Lanes already selected is "+(c+s+e+v)+" more than PCIe available "+o),a=!0;break;case ur:ei=u.find('[data-productid="'+$(r).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0;v=ft>0&&ei===0?4:v;o>=c+s+e+v?(wr=!1,$("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-product="'+$(r).attr("data-product")+'"]').each(function(){$(this).attr("data-gpci",$(this).attr("data-configuration"))}),wr=configuratorToolsApp.AvailablePhysicalPCIeSlots(f,ft,tr,d,wt),wr?($("#provider_grPCI").attr("data-value",v),$("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-product="'+$(r).attr("data-product")+'"]').each(function(){$(this).attr("data-product","")}),$(n).addClass("selected"),$(n).find("p.cost").html(""),configuratorToolsApp.UpdateHardDriveSupported()):($("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-product="'+$(r).attr("data-product")+'"]').each(function(){$(this).attr("data-gpci",0)}),$(r).addClass("selected"),$(r).find("p.cost").html(""),helperApp.Modal("Selection Conflict","You have exceeded the Motherboard Physical PCIe Slots, please reduce the number of PCIe Slots selected"),a=!0)):($(r).addClass("selected"),$(r).find("p.cost").html(""),helperApp.Modal("Selection Conflict","Maximum CPU PCIe Lanes available on the selected processor is "+o+", please reduce the number of PCIe Lanes selected"),a=!0);break;case ii:totalAudio=0;totalNw=0;totalCc=0;$('div.card.js-product-selector.selected[data-category="'+vt+'"]').each(function(){var n=u.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0;n>0&&(totalAudio+=1)});$('div.card.js-product-selector.selected[data-category="'+ii+'"]').each(function(){var n=u.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0;n>0&&(totalNw+=1)});$('div.card.js-product-selector.selected[data-category="'+dt+'"]').each(function(){var n=u.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0;n>0&&(totalCc+=1)});gaic=parseInt($("#provider_gaic").attr("data-value"));ei=u.find('[data-productid="'+$(r).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0;gaic=ft>0&&ei===0?totalAudio+totalNw+totalCc+1:totalCc+totalNw+totalAudio;e=gaic*4;o>=c+s+e+v?(br=!1,$("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-product="'+$(r).attr("data-product")+'"]').each(function(){$(this).attr("data-gpci",$(this).attr("data-configuration"))}),ft>0?(br=configuratorToolsApp.AvailablePhysicalPCIeSlots(f,ft,tr,d,wt),br?($("#provider_gaic").attr("data-value",gaic),$("#provider_gaPCI").attr("data-value",e),$("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-product="'+$(r).attr("data-product")+'"]').each(function(){$(this).attr("data-product","")}),$(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html($(n).data("name")),$(n).find("p.cost").html(""),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):($("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-product="'+$(r).attr("data-product")+'"]').each(function(){$(this).attr("data-gpci",0)}),$(r).addClass("selected"),$("#sp_"+$(r).data("sp")).html($(r).data("name")),$(r).find("p.cost").html(""),$("#img_selected_"+$(n).data("sp")).attr("src",$(r).data("p")),helperApp.Modal("Selection Conflict","You have exceeded the Motherboard Physical PCIe Slots, please reduce the number of PCIe Slots selected"),a=!0)):($("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-product="'+$(r).attr("data-product")+'"]').each(function(){$(this).attr("data-product","")}),$("#provider_gaic").attr("data-value",gaic),$("#provider_gaPCI").attr("data-value",e),$(n).addClass("selected"),$(n).find("p.cost").html(""))):($(r).addClass("selected"),$(r).find("p.cost").html(""),helperApp.Modal("Selection Conflict","Maximum CPU PCIe Lanes available on the selected processor is "+o+", please reduce the number of PCIe Lanes selected"),a=!0);break;case vt:gaic=parseInt($("#provider_gaic").attr("data-value"));ei=u.find('[data-productid="'+$(r).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0;totalAudio=0;totalNw=0;totalCc=0;$('div.card.js-product-selector.selected[data-category="'+vt+'"]').each(function(){var n=u.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0;n>0&&(totalAudio+=1)});$('div.card.js-product-selector.selected[data-category="'+ii+'"]').each(function(){var n=u.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0;n>0&&(totalNw+=1)});$('div.card.js-product-selector.selected[data-category="'+dt+'"]').each(function(){var n=u.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0;n>0&&(totalCc+=1)});gaic=ft>0?totalCc+totalNw+totalAudio+1:totalCc+totalNw+totalAudio;e=gaic*4;o>=c+s+e+v?(kr=!1,$("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-product="'+$(r).attr("data-product")+'"]').each(function(){$(this).attr("data-gpci",$(this).attr("data-configuration"))}),ft>0?(kr=configuratorToolsApp.AvailablePhysicalPCIeSlots(f,ft,tr,d,wt),kr?($("#provider_gaic").attr("data-value",gaic),$("#provider_gaPCI").attr("data-value",e),$("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-product="'+$(r).attr("data-product")+'"]').each(function(){$(this).attr("data-product","")}),$(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p")),$(n).find("p.cost").html("")):($("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-product="'+$(r).attr("data-product")+'"]').each(function(){$(this).attr("data-gpci",0)}),$(r).addClass("selected"),$("#sp_"+$(r).data("sp")).html($(r).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(r).data("p")),$(r).find("p.cost").html(""),helperApp.Modal("Selection Conflict","You have exceeded the Motherboard Physical PCIe Slots, please reduce the number of PCIe Slots selected"),a=!0)):($("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-product="'+$(r).attr("data-product")+'"]').each(function(){$(this).attr("data-product","")}),$("#provider_gaic").attr("data-value",gaic),$("#provider_gaPCI").attr("data-value",e),$(n).addClass("selected"),$(n).find("p.cost").html(""))):($(r).addClass("selected"),$(r).find("p.cost").html(""),helperApp.Modal("Selection Conflict","Maximum CPU PCIe Lanes available on the selected processor is "+o+", please reduce the number of PCIe Lanes selected"),a=!0);break;case at:nr=1;c=nr*8;o>=c+s+e+v?gt>=nr?(nu=$(n).attr("data-product"),dr=!1,$("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-product="'+$(r).attr("data-product")+'"]').each(function(){$(this).attr("data-gpci",$(this).attr("data-configuration"))}),dr=configuratorToolsApp.AvailablePhysicalPCIeSlots(f,ft,tr,d,nu),dr?function(){var s=parseInt($("#provider_psTw").attr("data-value"))||0,i=parseInt($("#provider_mbTw").attr("data-value"))||0,e=parseInt($("#provider_cpuTw").attr("data-value"))||0,o=$("#provider_powerDrawSL").data("value"),t=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+o+'"]').data("slvalue")||0;s<i+e+t&&($(g).removeClass("selected"),$('div.card.js-product-selector[data-category="'+yt+'"]').each(function(){if(($(this).attr("data-constrainedcategory")===null||$(this).attr("data-constrainedcategory").length===0)&&($(this).attr("data-constrainedby")===null||$(this).attr("data-constrainedby")===undefined||$(this).attr("data-constrainedby")!==undefined&&$(this).attr("data-constrainedby").length===0)){var f=$("#provider_psPowerDrawPcSL").data("value"),s=u.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+o+'"]').data("slvalue")||0,h=u.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+f+'"]').data("slvalue")||0,r=s*h/100;if(r>=i+e+t)return $("#provider_psTw").attr("data-value",r),$(this).addClass("selected"),$("#sp_"+$(this).data("sp")).html($(this).data("name")),$(this).find("p.cost").html(""),$("#img_selected_"+$(n).data("sp")).attr("src",$(this).data("p")),$(g).data("product")!==$(this).data("product")&&helperApp.Modal("Configurator Change",$(this).data("categoryname")+" Updated <br> "+$(this).data("categoryname")+" has been updated to "+$(this).data("name")),et=$(this),!1}}));$("#provider_ggpu").attr("data-value",nr);$("#provider_ggPCI").attr("data-value",c);$("#provider_gpuTw").attr("data-value",t);$("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-product="'+$(r).attr("data-product")+'"]').each(function(){$(this).attr("data-product","")});$(n).addClass("selected");$(n).find("p.cost").html("")}():($("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-product="'+$(r).attr("data-product")+'"]').each(function(){$(this).attr("data-gpci",0)}),$(r).addClass("selected"),$(r).find("p.cost").html(""),helperApp.Modal("Selection Conflict","You have exceeded the Motherboard Physical PCIe Slots, please reduce the number of PCIe Slots selected"),a=!0)):helperApp.Modal("Selection Conflict","Maximum GPUs available on the selected motherboard is "+gt+", please reduce the number of GPUs selected"):helperApp.Modal("Selection Conflict","Maximum CPU PCIe Lanes available on the selected processor is "+o+" vs "+(c+s+e+v)+", please reduce the number of PCIe Lanes selected");break;case yt:var vu=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+li+'"]').data("slvalue")||0,yu=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+su+'"]').data("slvalue")||0,ou=vu*yu/100;ou>=ir+fr+pi?(lr=configuratorToolsApp.CheckPsHardDrivesSupported($(n)),lr==="OK"?($("#provider_psTw").attr("data-value",ou),$(n).addClass("selected"),$(n).find("p.cost").html(""),configuratorToolsApp.UpdateHardDriveSupported()):($(r).addClass("selected"),$(r).find("p.cost").html(""),helperApp.Modal("Selection Conflict",lr),a=!0)):($(r).addClass("selected"),$(r).find("p.cost").html(""),helperApp.Modal("Selection Conflict","Your Power Supply choice requires more power"),a=!0);break;case si:$(n).addClass("selected");$(n).find("p.cost").html("");configuratorToolsApp.UpdateHardDriveSupported();break;case yi:lr=configuratorToolsApp.CheckScHardDrivesSupported($(n));lr==="OK"?($(n).addClass("selected"),$(n).find("p.cost").html(""),configuratorToolsApp.UpdateHardDriveSupported()):($(r).addClass("selected"),$(r).find("p.cost").html(""),helperApp.Modal("Selection Conflict",lr),a=!0);break;case rr:if(h=0,y=0,totalM2Psie=0,t=0,pt=0,$('div.card.js-product-selector.selected[data-subcategory="'+kt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(h+=n.data("qty")>0?n.data("qty"):1)):h+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+lt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(y+=n.data("qty")>0?n.data("qty"):1)):y+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+k+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(totalM2Psie+=n.data("qty")>0?n.data("qty"):1)):totalM2Psie+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+w+'"]').each(function(){var i=$(this).closest("div").find("select"),n;i.length>0?(n=$("option:selected",i),n!==null&&(t+=n.data("qty")>0?n.data("qty"):1)):t+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+ot+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(pt+=n.data("qty")>0?n.data("qty"):1)):pt+=1}),$(n).data("subcategory")===w)h+t+1>tt?helperApp.Modal("Selection Conflict","The "+bt+" case only has space for "+tt+" mechanical drives. "):h+t+1+y>b?helperApp.Modal("Selection Conflict","Maximum available drives is "+b+", please reduce the number of drives selected"):y+nt*(t+h+1)>ri?helperApp.Modal("Selection Conflict","Maximum available drives on this case is "+ri+", please reduce the number of drives selected"):(er=pt+t+ct+1,s=er*4,rt+ut>=er?o>=c+s+e+v?($("#provider_gnvme").attr("data-value",er),$("#provider_gnPCI").attr("data-value",s),$(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html()===""||$("#sp_"+$(n).data("sp")).html()==="None Selected"?$("#sp_"+$(n).data("sp")).html($(n).data("name")):i.length>0&&(it=i.first(),i.length===1&&it.data("subcategory")===w?$("#sp_"+$(n).data("sp")).html($(n).data("name")):function(){var t=0;i.each(function(){$(this).data("subcategory")===w&&t++});t>0?$("#sp_"+$(n).data("sp")).html(it.data("name")+" <span class= 'text-warning'> (+ "+(i.length-1)+" more selected) <\/span>"):$("#sp_"+$(n).data("sp")).html(it.data("name")+" <span class= 'text-warning'> (+ "+i.length+" more selected) <\/span>")}()),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):helperApp.Modal("Selection Conflict","Maximum CPU PCIe Lanes available on the selected processor is "+o+", please reduce the number of PCIe Lanes selected"):helperApp.Modal("Selection Conflict","Maximum Number of PCIe M.2 Allowed on the selected motherboard is "+(rt+ut)+", please reduce the number of PCIe M.2 selected"));else if($(n).data("subcategory")===kt)h+t+1>tt?helperApp.Modal("Selection Conflict","The "+bt+" case only has space for "+tt+" mechanical drives. "):h+t+1+y>b?helperApp.Modal("Selection Conflict","Maximum available  drives is "+b+", please reduce the number of drives selected"):y+nt*(h+t+1)>ri?helperApp.Modal("Selection Conflict","Maximum available drives on this case is "+ri+", please reduce the number of drives selected"):($(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html()===""||$("#sp_"+$(n).data("sp")).html()==="None Selected"?$("#sp_"+$(n).data("sp")).html($(n).data("name")):i.length>0&&(it=i.first(),$("#sp_"+$(n).data("sp")).html(it.data("name")+" <span class= 'text-warning'> (+ "+i.length+" more selected) <\/span>")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p")));else if($(n).data("subcategory")===lt)h+t+y+1>b?helperApp.Modal("Selection Conflict","Maximum available drives is "+b+", please reduce the number of drives selected"):y+nt*(h+t)+1>ri?helperApp.Modal("Selection Conflict","Maximum available drives on this case is "+ri+", please reduce the number of drives selected"):($(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html()===""||$("#sp_"+$(n).data("sp")).html()==="None Selected"?$("#sp_"+$(n).data("sp")).html($(n).data("name")):i.length>0&&(it=i.first(),$("#sp_"+$(n).data("sp")).html(it.data("name")+" <span class= 'text-warning'> (+ "+i.length+" more selected) <\/span>")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p")));else if($(n).data("subcategory")===ot||$(n).data("subcategory")===k){var ar=parseInt($("#provider_gnvme").attr("data-value")),tu=$("#provider_m2PortOccupiedSL").attr("data-value"),pu=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+tu+'"]').data("slvalue")||0;ar=pt+t+ct+1;s=ar*4;rt+ut>=ar?o>=c+s+e+v?$(n).data("subcategory")===k&&h+y+t+ct+fi+1>p?helperApp.Modal("Selection Conflict","Maximum available SATA ports is "+p+", please reduce the number of drives selected"):($("#provider_gnvme").attr("data-value",ar),$("#provider_gnPCI").attr("data-value",s),$(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html()===""||$("#sp_"+$(n).data("sp")).html()==="None Selected"?$("#sp_"+$(n).data("sp")).html($(n).data("name")):i.length>0&&(it=i.first(),$("#sp_"+$(n).data("sp")).html(it.data("name")+" <span class= 'text-warning'> (+ "+i.length+" more selected) <\/span>")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):helperApp.Modal("Selection Conflict","Maximum CPU PCIe Lanes available on the selected processor is "+o+", please reduce the number of PCIe Lanes selected"):helperApp.Modal("Selection Conflict","Maximum Number of PCIe M.2 Allowed on the selected motherboard is "+(rt+ut)+", please reduce the number of PCIe M.2 selected")}else $(n).data("subcategory")===oi&&(or=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+l+'"]').data("slvalue")||0,sr=u.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+ht+'"]').data("slvalue")||0,found=configuratorToolsApp.AvailablePhysicalPCIeSlots(f,or,sr,d,wt),found?($(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html()===""||$("#sp_"+$(n).data("sp")).html()==="None Selected"?$("#sp_"+$(n).data("sp")).html($(n).data("name")):i.length>0&&(it=i.first(),$("#sp_"+$(n).data("sp")).html(it.data("name")+" <span class= 'text-warning'> (+ "+i.length+" more selected) <\/span>")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):helperApp.Modal("Selection Conflict","You have exceeded the Motherboard Physical PCIe Slots, please reduce the number of PCIe Slots selected"));break;default:$(n).addClass("selected");$(n).find("p.cost").html("")}a||(i=$('div.card.js-product-selector.selected[data-sp="'+$(n).data("sp")+'"]'),i.length>1?(it=i.first(),$("#sp_"+$(n).data("sp")).html(it.data("name")+" <span class= 'text-warning'> (+ "+(i.length-1)+" more selected) <\/span>")):$("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p")))})();else ni.m===!1&&ni.m2===!1&&ni.m3===!1&&ni.o===!1&&(lu=systemGraph.find(function(n){return n.p===h.data("product")&&n.c===h.data("category")}),ar=parseFloat(ni.fp)-parseFloat(lu.fp),ar>0?$(n).find("p.cost").html("+$"+parseInt(ar)):$(n).find("p.cost").html(ar<0?"-$"+parseInt(ar)*-1:"$"+parseInt(ar)))}),a||(!1&&h.data("category")!==pi?function(){var t=$('div.card.js-product-selector.selected[data-category="'+pi+'"]');et=$('div.card.js-product-selector.selected[data-category="'+at+'"]');et.length===0&&(et=$('div.card.js-product-selector.selected[data-container="'+at+'"]'));var e=hr.findIndex(function(n){return n===$(et).attr("data-product")}),o=cr.findIndex(function(n){return n===$(et).attr("data-product")}),f=e>0?!0:!1,u=o>=0?!0:!1;t.length===3?u?h.hasClass("selected")?configuratorMatchCApp.BuildProductConstrainTrigger(h):configuratorApp.BuildConstrainTrigger():swal({title:"Promo Selection Conflict",text:"You have not selected a qualifying graphics card for the Black Friday promotion. Are you sure you want to continue? Your current Black Friday bonuses will be reset.",type:"warning",showCancelButton:!0,confirmButtonClass:"btn-success",confirmButtonText:"Yes, Proceed!",cancelButtonClass:"btn-outline-light",cancelButtonText:"Cancel",closeOnConfirm:!0,closeOnCancel:!0},function(u){u?function(){_.forEach(t,function(n){var t,r;$(".promo-"+$(n).data("product")).addClass("d-none");$(n).removeClass("selected");t=$(n);i=$('div.card.js-product-selector.selected[data-sp="'+t.data("sp")+'"]');i.length>0?(r=i.first(),i.length>1?$("#sp_"+t.data("sp")).html(r.data("name")+" <span class= 'text-warning'> (+ "+(i.length-1)+" more selected) <\/span>"):$("#sp_"+t.data("sp")).html(t.data("name")),$("#img_selected_"+t.data("sp")).attr("src",t.data("p"))):($("#sp_"+t.data("sp")).html("None Selected"),$("#img_selected_"+t.data("sp")).attr("src",DEFAULT_IMAGE_URL))});h.hasClass("selected")?configuratorMatchCApp.BuildProductConstrainTrigger(h):configuratorApp.BuildConstrainTrigger();var n="";_.forEach(categoriesThatChanged,function(t){var i,r;n=n+($(t).data("categoryname")+" has been updated to "+$(t).data("name")+" <br>");i=$("#subcategories-"+t.attr("data-category")).children("li.nav-item").children("a.nav-link");i.removeClass("active");$("#subcat-"+$(t).attr("data-category")+"-"+$(t).attr("data-subcategory")+"-tab").addClass("active");r=$("#category_"+t.attr("data-category")).children("div.tab-pane");r.removeClass("active show");$("#subcat-"+$(t).attr("data-category")+"-"+$(t).attr("data-subcategory")).addClass("active show")});n!==""&&(helperApp.Modal("Configurator Change",n),categoriesThatChanged.length=0);configuratorApp.CalculateTotals();configuratorApp.MaxLeadDays()}():y.m===!1&&y.m2===!1&&y.m3===!1?n.SelectProduct($("#clickable-"+$(r).data("product")+"-"+$(r).data("category"))):n.SelectProduct($("#clickable-"+y.p+"-"+y.c))}):t.length===2?f||u?h.hasClass("selected")?configuratorMatchCApp.BuildProductConstrainTrigger(h):configuratorApp.BuildConstrainTrigger():swal({title:"Promo Selection Conflict",text:"You have not selected a qualifying graphics card for the Black Friday promotion.Are you sure you want to continue? Your current Black Friday bonuses will be reset.",type:"warning",showCancelButton:!0,confirmButtonClass:"btn-success",confirmButtonText:"Yes, Proceed!",cancelButtonClass:"btn-outline-light",cancelButtonText:"Cancel",closeOnConfirm:!0,closeOnCancel:!0},function(u){u?function(){_.forEach(t,function(n){var t,r;$(".promo-"+$(n).data("product")).addClass("d-none");$(n).removeClass("selected");t=$(n);i=$('div.card.js-product-selector.selected[data-sp="'+t.data("sp")+'"]');i.length>0?(r=i.first(),i.length>1?$("#sp_"+t.data("sp")).html(r.data("name")+" <span class= 'text-warning'> (+ "+(i.length-1)+" more selected) <\/span>"):$("#sp_"+t.data("sp")).html(t.data("name")),$("#img_selected_"+t.data("sp")).attr("src",t.data("p"))):($("#sp_"+t.data("sp")).html("None Selected"),$("#img_selected_"+t.data("sp")).attr("src",DEFAULT_IMAGE_URL))});h.hasClass("selected")?configuratorMatchCApp.BuildProductConstrainTrigger(h):configuratorApp.BuildConstrainTrigger();var n="";_.forEach(categoriesThatChanged,function(t){var i,r;n=n+($(t).data("categoryname")+" has been updated to "+$(t).data("name")+" <br>");i=$("#subcategories-"+t.attr("data-category")).children("li.nav-item").children("a.nav-link");i.removeClass("active");$("#subcat-"+$(t).attr("data-category")+"-"+$(t).attr("data-subcategory")+"-tab").addClass("active");r=$("#category_"+t.attr("data-category")).children("div.tab-pane");r.removeClass("active show");$("#subcat-"+$(t).attr("data-category")+"-"+$(t).attr("data-subcategory")).addClass("active show")});n!==""&&(helperApp.Modal("Configurator Change",n),categoriesThatChanged.length=0);configuratorApp.CalculateTotals();configuratorApp.MaxLeadDays()}():y.m===!1&&y.m2===!1&&y.m3===!1?n.SelectProduct($("#clickable-"+$(r).data("product")+"-"+$(r).data("category"))):n.SelectProduct($("#clickable-"+y.p+"-"+y.c))}):t.length>0&&!f&&!u?swal({title:"Promo Selection Conflict",text:"Your GPU is not qualify for extra bonus. Are you sure you want to continue? Your current Black Friday promotions will be reset.",type:"warning",showCancelButton:!0,confirmButtonClass:"btn-success",confirmButtonText:"Yes, Proceed!",cancelButtonClass:"btn-outline-light",cancelButtonText:"Cancel",closeOnConfirm:!0,closeOnCancel:!0},function(u){u?function(){_.forEach(t,function(n){var t,r;$(".promo-"+$(n).data("product")).addClass("d-none");$(n).removeClass("selected");t=$(n);i=$('div.card.js-product-selector.selected[data-sp="'+t.data("sp")+'"]');i.length>0?(r=i.first(),i.length>1?$("#sp_"+t.data("sp")).html(r.data("name")+" <span class= 'text-warning'> (+ "+(i.length-1)+" more selected) <\/span>"):$("#sp_"+t.data("sp")).html(t.data("name")),$("#img_selected_"+t.data("sp")).attr("src",t.data("p"))):($("#sp_"+t.data("sp")).html("None Selected"),$("#img_selected_"+t.data("sp")).attr("src",DEFAULT_IMAGE_URL))});h.hasClass("selected")?configuratorMatchCApp.BuildProductConstrainTrigger(h):configuratorApp.BuildConstrainTrigger();var n="";_.forEach(categoriesThatChanged,function(t){var i,r;n=n+($(t).data("categoryname")+" has been updated to "+$(t).data("name")+" <br>");i=$("#subcategories-"+t.attr("data-category")).children("li.nav-item").children("a.nav-link");i.removeClass("active");$("#subcat-"+$(t).attr("data-category")+"-"+$(t).attr("data-subcategory")+"-tab").addClass("active");r=$("#category_"+t.attr("data-category")).children("div.tab-pane");r.removeClass("active show");$("#subcat-"+$(t).attr("data-category")+"-"+$(t).attr("data-subcategory")).addClass("active show")});n!==""&&(helperApp.Modal("Configurator Change",n),categoriesThatChanged.length=0);configuratorApp.CalculateTotals();configuratorApp.MaxLeadDays()}():y.m===!1&&y.m2===!1&&y.m3===!1?($(h).removeClass("selected"),$(r).addClass("selected"),$("#sp_"+$(r).data("sp")).html($(r).data("name")),$("#img_selected_"+$(r).data("sp")).attr("src",$(r).data("p")),$(r).find("p.cost").html(""),configuratorApp.CalculateTotals(),configuratorApp.MaxLeadDays()):n.SelectProduct($("#clickable-"+y.p+"-"+y.c))}):function(){h.hasClass("selected")?configuratorMatchCApp.BuildProductConstrainTrigger(h):configuratorApp.BuildConstrainTrigger();var n="";_.forEach(categoriesThatChanged,function(t){var i,r;n=n+($(t).data("categoryname")+" has been updated to "+$(t).data("name")+" <br>");i=$("#subcategories-"+t.attr("data-category")).children("li.nav-item").children("a.nav-link");i.removeClass("active");$("#subcat-"+$(t).attr("data-category")+"-"+$(t).attr("data-subcategory")+"-tab").addClass("active");r=$("#category_"+t.attr("data-category")).children("div.tab-pane");r.removeClass("active show");$("#subcat-"+$(t).attr("data-category")+"-"+$(t).attr("data-subcategory")).addClass("active show")});n!==""&&(helperApp.Modal("Configurator Change",n),categoriesThatChanged.length=0);configuratorApp.CalculateTotals();configuratorApp.MaxLeadDays()}()}():function(){h.hasClass("selected")&&configuratorMatchCApp.BuildProductConstrainTrigger(h);var n="";_.forEach(categoriesThatChanged,function(t){var i,r;n=n+($(t).data("categoryname")+" has been updated to "+$(t).data("name")+" <br>");i=$("#subcategories-"+t.attr("data-category")).children("li.nav-item").children("a.nav-link");i.removeClass("active");$("#subcat-"+$(t).attr("data-category")+"-"+$(t).attr("data-subcategory")+"-tab").addClass("active");r=$("#category_"+t.attr("data-category")).children("div.tab-pane");r.removeClass("active show");$("#subcat-"+$(t).attr("data-category")+"-"+$(t).attr("data-subcategory")).addClass("active show")});n!==""&&(helperApp.Modal("Configurator Change",n),categoriesThatChanged.length=0);configuratorApp.CalculateTotals();configuratorApp.MaxLeadDays()}()))},n.ProductOptionOnChange=function(t){var r=$(t),u=$("#provider_scCategoryId").attr("data-value"),f=r.data("product"),e=r.data("category"),s,h,o,i;r.is(":checked")&&(s=r.attr("data-desc"),s.toLowerCase().indexOf("cpu overclocking")>=0&&$('div.card.js-product-selector.selected[data-category="'+u+'"]').length===0&&($('div.card.js-product-selector[data-category="'+u+'"]').first().addClass("selected"),$('div.card.js-product-selector[data-category="'+u+'"]').first().find("p.cost").html("")));$("#cp-"+f+"-"+e).hasClass("selected")?!1&&function(){var i=$("#provider_bfCategoryId").data("value"),n=$('div.card.js-product-selector.selected[data-category="'+i+'"]'),t;n.length===3&&(t=configuratorApp.CalculateTotals(),t<3199&&swal({title:"Promo Selection Conflict",text:"This will down your selections under $3,199. Are you sure you want to continue? Your current Black Friday promotions will be reset.",type:"warning",showCancelButton:!0,confirmButtonClass:"btn-success",confirmButtonText:"Yes, Proceed!",cancelButtonClass:"btn-outline-light",cancelButtonText:"Cancel",closeOnConfirm:!0,closeOnCancel:!0},function(t){t?_.forEach(n,function(n){var t,i;$(".promo-"+$(n).data("product")).addClass("d-none");$(n).removeClass("selected");t=$(n);selectedMenuContainer=$('div.card.js-product-selector.selected[data-sp="'+t.data("sp")+'"]');selectedMenuContainer.length>0?(i=selectedMenuContainer.first(),selectedMenuContainer.length>1?$("#sp_"+t.data("sp")).html(i.data("name")+" <span class= 'text-warning'> (+ "+(selectedMenuContainer.length-1)+" more selected) <\/span>"):$("#sp_"+t.data("sp")).html(t.data("name")),$("#img_selected_"+t.data("sp")).attr("src",t.data("p"))):($("#sp_"+t.data("sp")).html("None Selected"),$("#img_selected_"+t.data("sp")).attr("src",DEFAULT_IMAGE_URL))}):r.prop("checked",!0)}))}():n.SelectProduct($("#clickable-"+f+"-"+e));h=systemGraph.find(function(n){return n.p===f&&n.c===e});idArray=_.split(r.attr("id"),"|",r.attr("id").length);o=_.find(h.og,{og:parseInt(idArray[1])});typeof o!="undefined"&&(i=_.find(o.o,{o:parseInt(idArray[2])}),typeof i!="undefined"&&(i.rp!==0&&(r.is(":checked")?configuratorMatchCApp.OptionProductConstrainTrigger(i.rp,!0):configuratorMatchCApp.OptionProductConstrainTrigger(i.rp,!1)),i.sl!==null&&(r.is(":checked")?configuratorMatchCApp.OptionProductValueConstrainTrigger(i.sl,i.slv,!0):configuratorMatchCApp.OptionProductValueConstrainTrigger(i.sl,i.slv,!1))));configuratorApp.CalculateTotals()},n.ProductSelectOptionOnClick=function(n){$(n)[0].hasAttribute("lastSelected")||$(n).data("lastSelected",$(n).find("option:selected"))},n.ProductSelectOptionOnChange=function(t){var u=!1,f=$("#provider_bfCategoryId").data("value"),k=$("#provider_hdCategoryId").data("value"),d=$("#provider_gcCategoryId").data("value"),g=$("#provider_psCategoryId").data("value"),nt=$("#provider_mbCategoryId").data("value"),tt=$("#provider_hdcCategoryId").data("value"),rt=$("#provider_odCategoryId").data("value"),h=0,e=0,s=0,y=0,p=0,r,c,l,it,o,a;h=parseInt($("#provider_gPCI").attr("data-value"));e=parseInt($("#provider_ggPCI").attr("data-value"));s=parseInt($("#provider_gnPCI").attr("data-value"));y=parseInt($("#provider_gaPCI").attr("data-value"));p=parseInt($("#provider_grPCI").attr("data-value"));r=$("#buildConstrains");c=$('div.card.js-product-selector.selected[data-category="'+g+'"]');c.length===0&&(c=$('div.card.js-product-selector.selected[data-container="'+g+'"]'));var v=_.split($(t).attr("id"),"|",$(t).attr("id").length),i=systemGraph.find(function(n){return n.p===parseInt(v[1])&&n.c===parseInt(v[3])}),ut=$(".js-case-selector input[name=Case]:checked"),b=ut.attr("data-case"),w=2;(b==="ORIGIN Chronos with Mesh"||b==="ORIGIN Chronos with Glass")&&(w=1);l=$('div.card.js-product-selector.selected[data-category="'+nt+'"]');l.length===0&&(l=$('div.card.js-product-selector.selected[data-container="'+nt+'"]'));it=$("#provider_mbSataPortsSL").data("value");o=r.find('[data-productid="'+$(l).attr("data-product")+'"][data-specificationlabelid="'+it+'"]').data("slvalue")||0;typeof i!="undefined"&&function(){var g=$("#cp-"+i.p+"-"+i.c),kt,ut,ct,ft,dt,gt,yt,st;if(g.hasClass("selected")||(n.SelectProduct($("#clickable-"+i.p+"-"+i.c)),g.hasClass("selected")||$(t).data("lastSelected").prop("selected",!0)),a=g.data("container")===0?g.data("category"):g.data("container"),a===k){var ni=$("#provider_hdMechanicalSubcategoryId").data("value"),ti=$("#provider_hdSSDSubcategoryId").data("value"),ii=$("#provider_hdNvmeSubcategoryId").data("value"),pt=$("#provider_hdM2SataSubcategoryId").data("value"),fi=$("#provider_hdPCIeSubcategoryId").data("value"),ei=$("#provider_hdIntelOptaneSubcategoryId").data("value"),wt=parseInt($("#provider_hdMechanical").attr("data-value")),oi=parseInt($("#provider_hdSSD").attr("data-value")),lt=parseInt($("#provider_hdGlobal").attr("data-value")),si=parseInt($("#provider_scCryoMechanical").attr("data-value")),hi=parseInt($("#provider_psMechanical").attr("data-value")),ri=parseInt($("#provider_mbMaxNvme").attr("data-value")),ui=parseInt($("#provider_mbSBNvme").attr("data-value")),bt=$('div.card.js-product-selector.selected[data-category="'+tt+'"]');bt.length===0&&(bt=$('div.card.js-product-selector.selected[data-container="'+tt+'"]'));kt=$("#provider_hdcTotalAddedSL").data("value");ut=r.find('[data-productid="'+$(bt).attr("data-product")+'"][data-specificationlabelid="'+kt+'"]').data("slvalue")||0;ut=ut-si-hi;var et=0,nt=0,it=0,ht=0,ot=0,at=0;if($('div.card.js-product-selector.selected[data-subcategory="'+ni+'"]').each(function(){var n=$(this).find("select");n.length>0?n.each(function(){var t=$("option:selected",$(this));t!==null&&(t.data("qty")>0?et+=t.data("qty"):n.length===1&&(et+=1))}):et+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+ti+'"]').each(function(){var n=$(this).find("select");n.length>0?n.each(function(){var t=$("option:selected",$(this));t!==null&&(t.data("qty")>0?nt+=t.data("qty"):n.length===1&&(nt+=1))}):nt+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+pt+'"]').each(function(){var n=$(this).find("select");n.length>0?n.each(function(){var t=$("option:selected",$(this));t!==null&&(t.data("qty")>0?ot+=t.data("qty"):n.length===1&&(ot+=1))}):ot+=1}),$('div.card.js-product-selector.selected[data-category="'+rt+'"]').each(function(){var n=$(this).find("select");n.length>0?n.each(function(){var t=$("option:selected",$(this));t!==null&&(t.data("qty")>0?ht+=t.data("qty"):n.length===1&&(ht+=1))}):ht+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+ei+'"]').each(function(){var n=$(this).find("select");n.length>0?n.each(function(){var t=$("option:selected",$(this));t!==null&&(t.data("qty")>0?it+=t.data("qty"):n.length===1&&(it+=1))}):it+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+ii+'"]').each(function(){var n=$(this).find("select");n.length>0?n.each(function(){var t=$("option:selected",$(this));t!==null&&(t.data("qty")>0?at+=t.data("qty"):n.length===1&&(at+=1))}):at+=1}),ct=w*wt+oi,ft=et+it,ut>0&&(ft=ft<=ut?0:ft-ut),g.data("subcategory")===ni)et+it>wt+ut?(helperApp.Modal("Selection Conflict","The "+b+" case only has space for "+(wt+ut)+" mechanical drives. "),$(t).data("lastSelected").prop("selected",!0)):ft+nt>lt?(helperApp.Modal("Selection Conflict","Maximum available  drives is "+lt+", please reduce the number of drives selected"),$(t).data("lastSelected").prop("selected",!0)):nt+w*ft>ct?(helperApp.Modal("Selection Conflict","Maximum available drives on this case is "+ct+", please reduce the number of drives selected"),$(t).data("lastSelected").prop("selected",!0)):et+nt+it+ot+ht>o?(helperApp.Modal("Selection Conflict","Maximum available SATA ports is "+o+", please reduce the number of drives selected"),$(t).data("lastSelected").prop("selected",!0)):u?function(){var n=$('div.card.js-product-selector.selected[data-category="'+f+'"]'),r=$(t).data("lastSelected"),i;n.length===3?(i=configuratorApp.CalculateTotals(),i<3199?swal({title:"Promo Selection Conflict",text:"This will down your selections under $3,199. Are you sure you want to continue? Your current Black Friday promotions will be reset.",type:"warning",showCancelButton:!0,confirmButtonClass:"btn-success",confirmButtonText:"Yes, Proceed!",cancelButtonClass:"btn-outline-light",cancelButtonText:"Cancel",closeOnConfirm:!0,closeOnCancel:!0},function(i){i?(_.forEach(n,function(n){var t,i;$(".promo-"+$(n).data("product")).addClass("d-none");$(n).removeClass("selected");t=$(n);selectedMenuContainer=$('div.card.js-product-selector.selected[data-sp="'+t.data("sp")+'"]');selectedMenuContainer.length>0?(i=selectedMenuContainer.first(),selectedMenuContainer.length>1?$("#sp_"+t.data("sp")).html(i.data("name")+" <span class= 'text-warning'> (+ "+(selectedMenuContainer.length-1)+" more selected) <\/span>"):$("#sp_"+t.data("sp")).html(t.data("name")),$("#img_selected_"+t.data("sp")).attr("src",t.data("p"))):($("#sp_"+t.data("sp")).html("None Selected"),$("#img_selected_"+t.data("sp")).attr("src",DEFAULT_IMAGE_URL))}),$(t).data("lastSelected",$(t).find("option:selected")),configuratorMatchCApp.BuildProductConstrainTrigger(g)):($(r).prop("selected",!0),configuratorMatchCApp.BuildProductConstrainTrigger(g))}):($(t).data("lastSelected",$(t).find("option:selected")),configuratorMatchCApp.BuildProductConstrainTrigger(g))):($(t).data("lastSelected",$(t).find("option:selected")),configuratorMatchCApp.BuildProductConstrainTrigger(g))}():$(t).data("lastSelected",$(t).find("option:selected"));else if(g.data("subcategory")===ti)ft+nt>lt?(helperApp.Modal("Selection Conflict","Maximum available drives is "+lt+", please reduce the number of drives selected"),$(t).data("lastSelected").prop("selected",!0)):nt+w*ft>ct?(helperApp.Modal("Selection Conflict","Maximum available drives on this case is "+ct+", please reduce the number of drives selected"),$(t).data("lastSelected").prop("selected",!0)):et+nt+it+ot+ht>o?(helperApp.Modal("Selection Conflict","Maximum available SATA ports is "+o+", please reduce the number of drives selected"),$(t).data("lastSelected").prop("selected",!0)):u?function(){var n=$('div.card.js-product-selector.selected[data-category="'+f+'"]'),r=$(t).data("lastSelected"),i;n.length===3?(i=configuratorApp.CalculateTotals(),i<3199?swal({title:"Promo Selection Conflict",text:"This will down your selections under $3,199. Are you sure you want to continue? Your current Black Friday promotions will be reset.",type:"warning",showCancelButton:!0,confirmButtonClass:"btn-success",confirmButtonText:"Yes, Proceed!",cancelButtonClass:"btn-outline-light",cancelButtonText:"Cancel",closeOnConfirm:!0,closeOnCancel:!0},function(i){i?(_.forEach(n,function(n){var t,i;$(".promo-"+$(n).data("product")).addClass("d-none");$(n).removeClass("selected");t=$(n);selectedMenuContainer=$('div.card.js-product-selector.selected[data-sp="'+t.data("sp")+'"]');selectedMenuContainer.length>0?(i=selectedMenuContainer.first(),selectedMenuContainer.length>1?$("#sp_"+t.data("sp")).html(i.data("name")+" <span class= 'text-warning'> (+ "+(selectedMenuContainer.length-1)+" more selected) <\/span>"):$("#sp_"+t.data("sp")).html(t.data("name")),$("#img_selected_"+t.data("sp")).attr("src",t.data("p"))):($("#sp_"+t.data("sp")).html("None Selected"),$("#img_selected_"+t.data("sp")).attr("src",DEFAULT_IMAGE_URL))}),$(t).data("lastSelected",$(t).find("option:selected")),configuratorMatchCApp.BuildProductConstrainTrigger(g)):($(r).prop("selected",!0),configuratorMatchCApp.BuildProductConstrainTrigger(g))}):($(t).data("lastSelected",$(t).find("option:selected")),configuratorMatchCApp.BuildProductConstrainTrigger(g))):($(t).data("lastSelected",$(t).find("option:selected")),configuratorMatchCApp.BuildProductConstrainTrigger(g))}():$(t).data("lastSelected",$(t).find("option:selected"));else if(g.data("subcategory")===ii||g.data("subcategory")===pt){var vt=parseInt($("#provider_gnvme").attr("data-value")),ci=$("#provider_m2PortOccupiedSL").attr("data-value"),li=r.find('[data-productid="'+g.attr("data-product")+'"][data-specificationlabelid="'+ci+'"]').data("slvalue")||0;vt=at+it+ot;s=vt*4;ri+ui>=vt?h>=e+s+y+p?g.data("subcategory")===pt&&et+nt+it+ot+ht>o?(helperApp.Modal("Selection Conflict","Maximum available SATA ports is "+o+", please reduce the number of drives selected"),$(t).data("lastSelected").prop("selected",!0)):($("#provider_gnvme").attr("data-value",vt),$("#provider_gnPCI").attr("data-value",s),u?function(){var n=$('div.card.js-product-selector.selected[data-category="'+f+'"]'),r=$(t).data("lastSelected"),i;n.length===3?(i=configuratorApp.CalculateTotals(),i<3199?swal({title:"Promo Selection Conflict",text:"This will down your selections under $3,199. Are you sure you want to continue? Your current Black Friday promotions will be reset.",type:"warning",showCancelButton:!0,confirmButtonClass:"btn-success",confirmButtonText:"Yes, Proceed!",cancelButtonClass:"btn-outline-light",cancelButtonText:"Cancel",closeOnConfirm:!0,closeOnCancel:!0},function(i){i?(_.forEach(n,function(n){var t,i;$(".promo-"+$(n).data("product")).addClass("d-none");$(n).removeClass("selected");t=$(n);selectedMenuContainer=$('div.card.js-product-selector.selected[data-sp="'+t.data("sp")+'"]');selectedMenuContainer.length>0?(i=selectedMenuContainer.first(),selectedMenuContainer.length>1?$("#sp_"+t.data("sp")).html(i.data("name")+" <span class= 'text-warning'> (+ "+(selectedMenuContainer.length-1)+" more selected) <\/span>"):$("#sp_"+t.data("sp")).html(t.data("name")),$("#img_selected_"+t.data("sp")).attr("src",t.data("p"))):($("#sp_"+t.data("sp")).html("None Selected"),$("#img_selected_"+t.data("sp")).attr("src",DEFAULT_IMAGE_URL))}),$(t).data("lastSelected",$(t).find("option:selected")),configuratorMatchCApp.BuildProductConstrainTrigger(g)):($(r).prop("selected",!0),configuratorMatchCApp.BuildProductConstrainTrigger(g))}):($(t).data("lastSelected",$(t).find("option:selected")),configuratorMatchCApp.BuildProductConstrainTrigger(g))):($(t).data("lastSelected",$(t).find("option:selected")),configuratorMatchCApp.BuildProductConstrainTrigger(g))}():$(t).data("lastSelected",$(t).find("option:selected"))):(helperApp.Modal("Selection Conflict","Maximum CPU PCIe Lanes available on the selected processor is "+h+", please reduce the number of PCIe Lanes selected"),$(t).data("lastSelected").prop("selected",!0)):(helperApp.Modal("Selection Conflict","Maximum Number of PCIe M.2 Allowed on the selected motherboard is "+(ri+ui)+", please reduce the number of PCIe M.2 selected"),$(t).data("lastSelected").prop("selected",!0))}else g.data("subcategory")===fi&&(dt=r.find('[data-productid="'+g.attr("data-product")+'"][data-specificationlabelid="'+pciLengthSL+'"]').data("slvalue")||0,gt=r.find('[data-productid="'+g.attr("data-product")+'"][data-specificationlabelid="'+physicalSlotSL+'"]').data("slvalue")||0,found=configuratorToolsApp.AvailablePhysicalPCIeSlots(l,dt,gt,casePCISlot,productId),found?u?function(){var n=$('div.card.js-product-selector.selected[data-category="'+f+'"]'),r=$(t).data("lastSelected"),i;n.length===3?(i=configuratorApp.CalculateTotals(),i<3199?swal({title:"Promo Selection Conflict",text:"This will down your selections under $3,199. Are you sure you want to continue? Your current Black Friday promotions will be reset.",type:"warning",showCancelButton:!0,confirmButtonClass:"btn-success",confirmButtonText:"Yes, Proceed!",cancelButtonClass:"btn-outline-light",cancelButtonText:"Cancel",closeOnConfirm:!0,closeOnCancel:!0},function(i){i?(_.forEach(n,function(n){var t,i;$(".promo-"+$(n).data("product")).addClass("d-none");$(n).removeClass("selected");t=$(n);selectedMenuContainer=$('div.card.js-product-selector.selected[data-sp="'+t.data("sp")+'"]');selectedMenuContainer.length>0?(i=selectedMenuContainer.first(),selectedMenuContainer.length>1?$("#sp_"+t.data("sp")).html(i.data("name")+" <span class= 'text-warning'> (+ "+(selectedMenuContainer.length-1)+" more selected) <\/span>"):$("#sp_"+t.data("sp")).html(t.data("name")),$("#img_selected_"+t.data("sp")).attr("src",t.data("p"))):($("#sp_"+t.data("sp")).html("None Selected"),$("#img_selected_"+t.data("sp")).attr("src",DEFAULT_IMAGE_URL))}),$(t).data("lastSelected",$(t).find("option:selected")),configuratorMatchCApp.BuildProductConstrainTrigger(g)):($(r).prop("selected",!0),configuratorMatchCApp.BuildProductConstrainTrigger(g))}):($(t).data("lastSelected",$(t).find("option:selected")),configuratorMatchCApp.BuildProductConstrainTrigger(g))):($(t).data("lastSelected",$(t).find("option:selected")),configuratorMatchCApp.BuildProductConstrainTrigger(g))}():$(t).data("lastSelected",$(t).find("option:selected")):(helperApp.Modal("Selection Conflict","You have exceeded the Motherboard Physical PCIe Slots, please reduce the number of PCIe Slots selected"),$(t).data("lastSelected").prop("selected",!0)))}a===d&&function(){var d=$("#provider_mbCategoryId").data("value"),ft=$("#provider_psCategoryId").data("value"),o=$('div.card.js-product-selector.selected[data-category="'+d+'"]');o.length===0&&(o=$('div.card.js-product-selector.selected[data-container="'+d+'"]'));var et=$("#provider_physicalSlotSL").data("value"),ot=$("#provider_pciLengthSL").data("value"),nt=parseInt($("#provider_mbMaxGpu").attr("data-value")),l=parseInt($("#provider_ggpu").attr("data-value")),b=r.find('[data-productid="'+i.p+'"][data-specificationlabelid="'+ot+'"]').data("slvalue")||0,v=r.find('[data-productid="'+i.p+'"][data-specificationlabelid="'+et+'"]').data("slvalue")||0,w=$(".js-case-selector input[name=Case]:checked"),tt=parseInt(w.attr("data-caseid"))>0?parseInt(w.attr("data-caseid")):0,st=parseInt(w.attr("data-primecaseid"))>0?parseInt(w.attr("data-primecaseid")):0,it=$("#caseConstrains"),rt=$("#provider_casePCISlotSL").data("value"),ut=tt>0?it.find('[data-caseid= "'+tt+'"][data-specificationlabelid="'+rt+'"]').data("value")||0:it.find('[data-primecaseid= "'+st+'"][data-specificationlabelid="'+rt+'"]').data("value")||0,k=$("option:selected",$(t)),a=$(t).data("lastSelected").data("qty"),n=0;k!==null&&k.data("qty")>0&&(n=k.data("qty"));n>a?b>0&&(l=l+(n-a)):b>0&&(l=l-(a-n));e=l*8;h>=e+s+y+p?nt>=l?function(){var s=i.p,y=-1,h,p;if(n>a){h=!1;p=a;do h=!1,y++,$("#pciSlots").find('[data-productid="'+$(o).attr("data-product")+'"]').each(function(){var i,n,t;if(parseInt($(this).attr("data-gpci"))>=b){if(i=$(this).data("slot")+1,v===1)return $(this).attr("data-gpci",0),$(this).attr("data-product",s),h=!0,!1;if(v===2){if(n=$("#pciSlots").find('[data-productid="'+$(o).attr("data-product")+'"][data-slot="'+i+'"]'),$(n).length!==0){if($(n).data("gpci")>0||$(n).data("gpci")===$(n).data("configuration"))return $(this).attr("data-gpci",0),$(this).attr("data-product",s),$(n).attr("data-gpci",0),$(n).attr("data-product",s),h=!0,!1}else if(i<=ut)return $(this).attr("data-gpci",0),$(this).attr("data-product",s),h=!0,!1}else if(v===3)if(n=$("#pciSlots").find('[data-productid="'+$(o).attr("data-product")+'"][data-slot="'+i+'"]'),t=$("#pciSlots").find('[data-productid="'+$(o).attr("data-product")+'"][data-slot="'+(i+1)+'"]'),$(t).length!==0){if(($(n).data("gpci")>0||$(n).data("gpci")===$(n).data("configuration"))&&($(t).data("gpci")>0||$(t).data("gpci")===$(t).data("configuration")))return $(this).attr("data-gpci",0),$(this).attr("data-product",s),$(n).attr("data-gpci",0),$(n).attr("data-product",s),$(t).attr("data-gpci",0),$(t).attr("data-product",s),h=!0,!1}else if(i+1<=ut)return $(this).attr("data-gpci",0),$(this).attr("data-product",s),$(n).length!==0&&($(n).attr("data-gpci",0),$(n).attr("data-product",s)),h=!0,!1}}),p++;while(n>p&&h);h?function(){var v=parseInt($("#provider_psTw").attr("data-value"))||0,s=parseInt($("#provider_mbTw").attr("data-value"))||0,h=parseInt($("#provider_cpuTw").attr("data-value"))||0,a=$("#provider_powerDrawSL").data("value"),o=r.find('[data-productid="'+i.p+'"][data-specificationlabelid="'+a+'"]').data("slvalue")||0;o=o*n;v<s+h+o&&($(c).removeClass("selected"),$('div.card.js-product-selector[data-category="'+ft+'"]').each(function(){if(($(this).attr("data-constrainedcategory")===null||$(this).attr("data-constrainedcategory").length===0)&&($(this).attr("data-constrainedby")===null||$(this).attr("data-constrainedby")===undefined||$(this).attr("data-constrainedby")!==undefined&&$(this).attr("data-constrainedby").length===0)){var t=$("#provider_psPowerDrawPcSL").data("value"),i=r.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+a+'"]').data("slvalue")||0,u=r.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+t+'"]').data("slvalue")||0,n=i*u/100;if(n>=s+h+o)return $("#provider_psTw").attr("data-value",n),$(this).addClass("selected"),$(this).find("p.cost").html(""),$("#sp_"+$(this).data("sp")).html($(this).data("name")),$("#img_selected_"+$(this).data("sp")).attr("src",$(this).data("p")),$(c).data("product")!==$(this).data("product")&&helperApp.Modal("Configurator Change",$(this).data("categoryname")+" Updated <br> "+$(this).data("categoryname")+" has been updated to "+$(this).data("name")),!1}}));$("#provider_ggpu").attr("data-value",l);$("#provider_ggPCI").attr("data-value",e);$("#provider_gpuTw").attr("data-value",o);u?function(){var n=$('div.card.js-product-selector.selected[data-category="'+f+'"]'),r=$(t).data("lastSelected"),i;n.length===3?(i=configuratorApp.CalculateTotals(),i<3199?swal({title:"Promo Selection Conflict",text:"This will down your selections under $3,199. Are you sure you want to continue? Your current Black Friday promotions will be reset.",type:"warning",showCancelButton:!0,confirmButtonClass:"btn-success",confirmButtonText:"Yes, Proceed!",cancelButtonClass:"btn-outline-light",cancelButtonText:"Cancel",closeOnConfirm:!0,closeOnCancel:!0},function(i){i?(_.forEach(n,function(n){var t,i;$(".promo-"+$(n).data("product")).addClass("d-none");$(n).removeClass("selected");t=$(n);selectedMenuContainer=$('div.card.js-product-selector.selected[data-sp="'+t.data("sp")+'"]');selectedMenuContainer.length>0?(i=selectedMenuContainer.first(),selectedMenuContainer.length>1?$("#sp_"+t.data("sp")).html(i.data("name")+" <span class= 'text-warning'> (+ "+(selectedMenuContainer.length-1)+" more selected) <\/span>"):$("#sp_"+t.data("sp")).html(t.data("name")),$("#img_selected_"+t.data("sp")).attr("src",t.data("p"))):($("#sp_"+t.data("sp")).html("None Selected"),$("#img_selected_"+t.data("sp")).attr("src",DEFAULT_IMAGE_URL))}),$(t).data("lastSelected",$(t).find("option:selected")),configuratorMatchCApp.BuildProductConstrainTrigger(g)):($(r).prop("selected",!0),configuratorMatchCApp.BuildProductConstrainTrigger(g))}):($(t).data("lastSelected",$(t).find("option:selected")),configuratorMatchCApp.BuildProductConstrainTrigger(g))):($(t).data("lastSelected",$(t).find("option:selected")),configuratorMatchCApp.BuildProductConstrainTrigger(g))}():$(t).data("lastSelected",$(t).find("option:selected"))}():(helperApp.Modal("Selection Conflict","You have exceeded the Motherboard Physical PCIe Slots, please reduce the number of PCIe Slots selected"),y>0&&function(){y=y*v;var n=0;$("#pciSlots").find('[data-productid="'+$(o).attr("data-product")+'"][data-product="'+i.p+'"]').each(function(){return n++,$(this).attr("data-gpci",$(this).attr("data-configuration")),$(this).attr("data-product",""),n===y?!1:void 0})}(),$(t).data("lastSelected").prop("selected",!0))}else(function(){var c=(a-n)*v,h,s;y=0;$("#pciSlots").find('[data-productid="'+$(o).attr("data-product")+'"][data-product="'+i.p+'"]').each(function(){return y++,$(this).attr("data-gpci",$(this).attr("data-configuration")),$(this).attr("data-product",""),y===c?!1:void 0});$("#provider_ggpu").attr("data-value",l);$("#provider_ggPCI").attr("data-value",e);h=$("#provider_powerDrawSL").data("value");s=r.find('[data-productid="'+i.p+'"][data-specificationlabelid="'+h+'"]').data("slvalue")||0;s=s*n;$("#provider_gpuTw").attr("data-value",s);u?function(){var n=$('div.card.js-product-selector.selected[data-category="'+f+'"]'),r=$(t).data("lastSelected"),i;n.length===3?(i=configuratorApp.CalculateTotals(),i<3199?swal({title:"Promo Selection Conflict",text:"This will down your selections under $3,199. Are you sure you want to continue? Your current Black Friday promotions will be reset.",type:"warning",showCancelButton:!0,confirmButtonClass:"btn-success",confirmButtonText:"Yes, Proceed!",cancelButtonClass:"btn-outline-light",cancelButtonText:"Cancel",closeOnConfirm:!0,closeOnCancel:!0},function(i){i?(_.forEach(n,function(n){var t,i;$(".promo-"+$(n).data("product")).addClass("d-none");$(n).removeClass("selected");t=$(n);selectedMenuContainer=$('div.card.js-product-selector.selected[data-sp="'+t.data("sp")+'"]');selectedMenuContainer.length>0?(i=selectedMenuContainer.first(),selectedMenuContainer.length>1?$("#sp_"+t.data("sp")).html(i.data("name")+" <span class= 'text-warning'> (+ "+(selectedMenuContainer.length-1)+" more selected) <\/span>"):$("#sp_"+t.data("sp")).html(t.data("name")),$("#img_selected_"+t.data("sp")).attr("src",t.data("p"))):($("#sp_"+t.data("sp")).html("None Selected"),$("#img_selected_"+t.data("sp")).attr("src",DEFAULT_IMAGE_URL))}),$(t).data("lastSelected",$(t).find("option:selected")),configuratorMatchCApp.BuildProductConstrainTrigger(g)):($(r).prop("selected",!0),configuratorMatchCApp.BuildProductConstrainTrigger(g))}):($(t).data("lastSelected",$(t).find("option:selected")),configuratorMatchCApp.BuildProductConstrainTrigger(g))):($(t).data("lastSelected",$(t).find("option:selected")),configuratorMatchCApp.BuildProductConstrainTrigger(g))}():$(t).data("lastSelected",$(t).find("option:selected"))})()}():(helperApp.Modal("Selection Conflict","Maximum GPUs available on the selected motherboard is "+nt+", please reduce the number of GPUs selected"),$(t).data("lastSelected").prop("selected",!0)):(helperApp.Modal("Selection Conflict","Maximum CPU PCIe Lanes available on the selected processor is "+h+" vs "+(e+s+y+p)+", please reduce the number of PCIe Lanes selected"),$(t).data("lastSelected").prop("selected",!0))}();a!==k&&a!==d&&(u?function(){var n=$('div.card.js-product-selector.selected[data-category="'+f+'"]'),r=$(t).data("lastSelected"),i;n.length===3?(i=configuratorApp.CalculateTotals(),i<3199?swal({title:"Promo Selection Conflict",text:"This will down your selections under $3,199. Are you sure you want to continue? Your current Black Friday promotions will be reset.",type:"warning",showCancelButton:!0,confirmButtonClass:"btn-success",confirmButtonText:"Yes, Proceed!",cancelButtonClass:"btn-outline-light",cancelButtonText:"Cancel",closeOnConfirm:!0,closeOnCancel:!0},function(i){i?(_.forEach(n,function(n){var t,i;$(".promo-"+$(n).data("product")).addClass("d-none");$(n).removeClass("selected");t=$(n);selectedMenuContainer=$('div.card.js-product-selector.selected[data-sp="'+t.data("sp")+'"]');selectedMenuContainer.length>0?(i=selectedMenuContainer.first(),selectedMenuContainer.length>1?$("#sp_"+t.data("sp")).html(i.data("name")+" <span class= 'text-warning'> (+ "+(selectedMenuContainer.length-1)+" more selected) <\/span>"):$("#sp_"+t.data("sp")).html(t.data("name")),$("#img_selected_"+t.data("sp")).attr("src",t.data("p"))):($("#sp_"+t.data("sp")).html("None Selected"),$("#img_selected_"+t.data("sp")).attr("src",DEFAULT_IMAGE_URL))}),configuratorMatchCApp.BuildProductConstrainTrigger(g),$(t).data("lastSelected",$(t).find("option:selected"))):($(r).prop("selected",!0),configuratorMatchCApp.BuildProductConstrainTrigger(g))}):($(t).data("lastSelected",$(t).find("option:selected")),configuratorMatchCApp.BuildProductConstrainTrigger(g))):($(t).data("lastSelected",$(t).find("option:selected")),configuratorMatchCApp.BuildProductConstrainTrigger(g))}():$(t).data("lastSelected",$(t).find("option:selected")));v=_.split(g.attr("id"),"|",g.attr("id").length);yt=_.find(i.og,{og:parseInt(v[2])});typeof yt!="undefined"&&(st=_.find(yt.o,{o:parseInt(v[3])}),typeof st!="undefined"&&typeof st!="undefined"&&st.rp!==0&&(g.is(":checked")?configuratorMatchCApp.OptionProductConstrainTrigger(st.rp,!0):configuratorMatchCApp.OptionProductConstrainTrigger(st.rp,!1)));configuratorApp.CalculateTotals()}()},n.CalculateBuildTotals=function(){var t=$("div.card.js-product-selector.selected"),n=0;return $.each(t,function(t,i){var r=_.split($(i).attr("id"),"-",$(i).attr("id").length),u=systemGraph.find(function(n){return n.p===parseInt(r[1])&&n.c===parseInt(r[2])}),f,e;typeof u!="undefined"&&(n+=parseFloat(u.fp),f=$(i).find("select"),f.length>0&&f.each(function(){var i=$("option:selected",$(this)),f,t;i!==null&&i.length>0&&(r=_.split($(this).attr("id"),"|",$(this).attr("id").length),f=_.find(u.og,{og:parseInt(r[2])}),typeof f!="undefined"&&(r=_.split(i.attr("id"),"_",i.attr("id").length),t=_.find(f.o,{o:parseInt(r[1])}),typeof t!="undefined"&&(t.q>0?(n+=parseFloat(u.fp*(t.q-1)),n+=parseFloat(t.a)):n+=parseFloat(t.a))))}),e=$(i).find("input:checkbox"),e.length>0&&e.each(function(){var t,i;$(this).is(":checked")&&(r=_.split($(this).attr("id"),"|",$(this).attr("id").length),t=_.find(u.og,{og:parseInt(r[1])}),typeof t!="undefined"&&(i=_.find(t.o,{o:parseInt(r[2])}),typeof i!="undefined"&&(n+=parseFloat(i.a))))}),$(".promo-"+$(i).data("product")).removeClass("d-none"))}),n},n.BuildMaxLeadDays=function(){var n=2,t=$("div.card.js-product-selector.selected");return $.each(t,function(t,i){var r=_.split($(i).attr("id"),"-",$(i).attr("id").length),u=systemGraph.find(function(n){return n.p===parseInt(r[1])&&n.c===parseInt(r[2])});typeof u!="undefined"&&(n=Math.max(n,parseInt(u.lt)))}),n},n.CalculateBuildDiscounts=function(){var t=$("div.card.js-product-selector.selected"),n=0;return $.each(t,function(t,i){var r=_.split($(i).attr("id"),"-",$(i).attr("id").length),u=systemGraph.find(function(n){return n.p===parseInt(r[1])&&n.c===parseInt(r[2])});typeof u!="undefined"&&(n+=parseFloat(u.pd))}),n},n}({});configuratorServicesApp=function(n){return n.SelectProductInServices=function(n){var i=$(n).parent("div.js-services-product-selector"),r=$("#category_"+i.attr("data-category")).children("div.row").children("div.config-option");r.length===0&&(r=$("#category_"+i.attr("data-category")).children("div.tab-pane").children("div.row").children("div.config-option"));var u=r.children("div.card.js-services-product-selector"),f=r.children("div.card.js-services-product-selector.selected"),t=$('div.card.js-services-product-selector.selected[data-sp="'+i.data("sp")+'"]'),e=$('div.card.js-services-product-selector[data-sp="'+i.data("sp")+'"]').first();_.forEach(u,function(n){var t=systemGraph.find(function(t){return t.p===parseInt($(n).attr("data-product"))});typeof t!="undefined"&&t.m===!1&&t.m2===!1&&(t.o===!0?t.p!==i.data("product")&&$(n).hasClass("selected")&&(currentProduct=$(n),$(n).removeClass("selected"),$(n).find("p.cost").html("$"+Math.round(t.fp))):$(n).hasClass("selected")&&function(){currentProduct=$(n);$(n).removeClass("selected");$(n).find(".js-selector-option-select").find("option:eq(0)").prop("selected",!0);var t=$(n).find("input:checkbox");t.length>0&&t.each(function(){t.each(function(){$(this).is(":checked")&&$(this).prop("checked",!1)})})}())});_.forEach(u,function(n){var u=systemGraph.find(function(t){return t.p===parseInt($(n).attr("data-product"))}),o,r,s,e;typeof u!="undefined"&&(u.p===i.data("product")?u.m===!0||u.m2===!0?$(n).hasClass("selected")===!0?(f.length>1||u.o===!0)&&($(n).removeClass("selected"),o=$(n).find("input:checkbox"),o.length>0&&o.each(function(){$(this).prop("checked",!1)}),t=$('div.card.js-services-product-selector.selected[data-sp="'+i.data("sp")+'"]'),t.length>1?(r=t.first(),$("#sp_"+$(n).data("sp")).html(r.data("name")+" <span class= 'text-warning'> (+ "+(t.length-1)+" more selected) <\/spen>"),$("#img_selected_"+$(n).data("sp")).attr("src",$(r).data("p"))):($("#sp_"+$(n).data("sp")).html("None Selected"),$("#img_selected_"+$(n).data("sp")).attr("src",DEFAULT_IMAGE_URL))):u.m===!0?($(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html()===""||$("#sp_"+$(n).data("sp")).html()==="None Selected"?$("#sp_"+$(n).data("sp")).html($(n).data("name")):t.length>0&&(r=t.first(),$("#sp_"+$(n).data("sp")).html(r.data("name")+" <span class= 'text-warning'> (+ "+t.length+" more selected) <\/spen>")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):t.length>1?helperApp.Modal("Alert","Please pick two items only."):($(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html()===""||$("#sp_"+$(n).data("sp")).html()==="None Selected"?$("#sp_"+$(n).data("sp")).html($(n).data("name")):t.length>0&&(r=t.first(),$("#sp_"+$(n).data("sp")).html(r.data("name")+" <span class= 'text-warning'> (+ "+t.length+" more selected) <\/spen>")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):u.o===!0?$(n).hasClass("selected")===!0?($(n).removeClass("selected"),$(n).find("p.cost").html("$"+Math.round(u.fp)),t=$('div.card.js-services-product-selector.selected[data-sp="'+$(n).data("sp")+'"]'),t.length>0?(r=t.first(),t.length>1?$("#sp_"+$(n).data("sp")).html(r.data("name")+" <span class= 'text-warning'> (+ "+(t.length-1)+" more selected) <\/spen>"):$("#sp_"+$(n).data("sp")).html(""+r.data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):($("#sp_"+$(n).data("sp")).html("None Selected"),$("#img_selected_"+$(n).data("sp")).attr("src",DEFAULT_IMAGE_URL))):($(n).addClass("selected"),$(n).find("p.cost").html(""),t=$('div.card.js-services-product-selector.selected[data-sp="'+$(n).data("sp")+'"]'),t.length>1?(r=t.first(),$("#sp_"+$(n).data("sp")).html(r.data("name")+" <span class= 'text-warning'> (+ "+(t.length-1)+" more selected) <\/spen>")):$("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):($(n).addClass("selected"),$(n).find("p.cost").html(""),t=$('div.card.js-services-product-selector.selected[data-sp="'+$(n).data("sp")+'"]'),t.length>1?(r=t.first(),$("#sp_"+$(n).data("sp")).html(r.data("name")+" <span class= 'text-warning'> (+ "+(t.length-1)+" more selected) <\/spen>")):$("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):u.m===!1&&u.m2===!1&&u.o===!1&&(s=systemGraph.find(function(n){return n.p===parseInt(i.data("product"))}),e=parseFloat(u.fp)-parseFloat(s.fp),e>0?$(n).find("p.cost").html("+$"+parseInt(e)):$(n).find("p.cost").html(e<0?"-$"+parseInt(e)*-1:"$"+parseInt(e))))});configuratorApp.CalculateTotals();configuratorApp.MaxLeadDays()},n.ProductOptionOnChange=function(t){var r=$(t),i=r.data("product");$("#cp_"+i).hasClass("selected")?configuratorApp.CalculateTotals():n.SelectProductInServices($("#clickable_"+i))},n.ProductSelectOptionOnClick=function(n){$(n)[0].hasAttribute("lastSelected")||$(n).data("lastSelected",$(n).find("option:selected"))},n.ProductSelectOptionOnChange=function(t){var r=_.split($(t).attr("id"),"|",$(t).attr("id").length),i=systemGraph.find(function(n){return n.p===parseInt(r[1])});typeof i!="undefined"&&($("#cp_"+i.p).hasClass("selected")?configuratorApp.CalculateTotals():n.SelectProductInServices($("#clickable_"+i.p)))},n.CalculateServicesTotals=function(){var t=$("div.card.js-services-product-selector.selected"),n=0;return $.each(t,function(t,i){var r=_.split($(i).attr("id"),"_",$(i).attr("id").length),u=systemGraph.find(function(n){return n.p===parseInt(r[1])});typeof u!="undefined"&&function(){var f,t;n+=parseFloat(u.fp);f=$(i).find("select");f.length>0&&f.each(function(){var i=$("option:selected",$(this)),f,t;i!==null&&i.length>0&&(r=_.split($(this).attr("id"),"|",$(this).attr("id").length),f=_.find(u.og,{og:parseInt(r[2])}),typeof f!="undefined"&&(r=_.split(i.attr("id"),"_",i.attr("id").length),t=_.find(f.o,{o:parseInt(r[1])}),typeof t!="undefined"&&(n+=t.q>0?parseFloat(u.fp*(t.q-1)):parseFloat(t.a))))});t=$(i).find("input:checkbox");t.length>0&&t.each(function(){$(this).is(":checked")&&t.each(function(){var t,i;$(this).is(":checked")&&(r=_.split($(this).attr("id"),"|",$(this).attr("id").length),t=_.find(u.og,{og:parseInt(r[1])}),typeof t!="undefined"&&(i=_.find(t.o,{o:parseInt(r[2])}),typeof i!="undefined"&&(n+=parseFloat(i.a))))})})}()}),n},n.ServicesMaxLeadDays=function(){var n=2,t=$("div.card.js-services-product-selector.selected");return $.each(t,function(t,i){var u=_.split($(i).attr("id"),"_",$(i).attr("id").length),r=systemGraph.find(function(n){return n.p===parseInt(u[1])});typeof r!="undefined"&&(n=Math.max(n,parseInt(r.lt)))}),n},n.CalculateServicesDiscounts=function(){var t=$("div.card.js-services-product-selector.selected"),n=0;return $.each(t,function(t,i){var r=_.split($(i).attr("id"),"-",$(i).attr("id").length),u=systemGraph.find(function(n){return n.p===parseInt(r[1])&&n.c===parseInt(r[2])});typeof u!="undefined"&&(n+=parseFloat(u.pd))}),n},n}({});configuratorAccessoriesApp=function(n){return n.SelectProductInAccessories=function(n){var i=$(n).parent("div.js-accessories-product-selector"),r=$("#category_"+i.attr("data-category")).children("div.row").children("div.config-option");r.length===0&&(r=$("#category_"+i.attr("data-category")).children("div.tab-pane").children("div.row").children("div.config-option"));var u=r.children("div.card.js-accessories-product-selector"),f=r.children("div.card.js-accessories-product-selector.selected"),t=$('div.card.js-accessories-product-selector.selected[data-sp="'+i.data("sp")+'"]'),s=$('div.card.js-accessories-product-selector[data-sp="'+i.data("sp")+'"]').first(),e=$("#provider_csCategoryId").data("value"),o=i.data("category");_.forEach(u,function(n){var t=systemGraph.find(function(t){return t.p===parseInt($(n).attr("data-product"))}),r;typeof t!="undefined"&&t.m===!1&&t.m2===!1&&t.mro===!1&&(t.o===!0?t.p!==i.data("product")&&$(n).hasClass("selected")&&($(n).removeClass("selected"),$(n).find("p.cost").html("$"+Math.round(t.fp))):t.mro===!1&&$(n).hasClass("selected")&&($(n).removeClass("selected"),$(n).find(".js-selector-option-select").find("option:eq(0)").prop("selected",!0),r=$(n).find("input:checkbox"),r.length>0&&r.each(function(){$(this).prop("checked",!1)})))});_.forEach(u,function(n){var r=systemGraph.find(function(t){return t.p===parseInt($(n).attr("data-product"))}),u,o,e;typeof r!="undefined"&&(r.p===i.data("product")?r.m===!0||r.m2===!0||r.mro===!0?r.mro===!1&&($(n).hasClass("selected")===!0?((f.length>1||r.o===!0)&&function(){$(n).removeClass("selected");$(n).find(".js-selector-option-select").find("option:eq(0)").prop("selected",!0);var t=$(n).find("input:checkbox");t.length>0&&t.each(function(){t.each(function(){$(this).is(":checked")&&$(this).prop("checked",!1)})})}(),t=$('div.card.js-accessories-product-selector.selected[data-sp="'+i.data("sp")+'"]'),t.length>0?(u=t.first(),t.length>1?$("#sp_"+$(n).data("sp")).html(u.data("name")+" <span class= 'text-warning'> (+ "+(t.length-1)+" more selected) <\/spen>"):$("#sp_"+$(n).data("sp")).html(""+u.data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(u).data("p"))):($("#sp_"+$(n).data("sp")).html("None Selected"),$("#img_selected_"+$(n).data("sp")).attr("src",DEFAULT_IMAGE_URL))):r.m===!0?($(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html()===""||$("#sp_"+$(n).data("sp")).html()==="None Selected"?$("#sp_"+$(n).data("sp")).html($(n).data("name")):t.length>0&&(u=t.first(),$("#sp_"+$(n).data("sp")).html(u.data("name")+" <span class= 'text-warning'> (+ "+t.length+" more selected) <\/spen>")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):t.length>1?helperApp.Modal("Alert","Please pick two items only."):r.mro===!1&&($(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html()===""||$("#sp_"+$(n).data("sp")).html()==="None Selected"?$("#sp_"+$(n).data("sp")).html($(n).data("name")):t.length>0&&(u=t.first(),$("#sp_"+$(n).data("sp")).html(u.data("name")+" <span class= 'text-warning'> (+ "+t.length+" more selected) <\/spen>")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p")))):r.o===!0?$(n).hasClass("selected")===!0?($(n).removeClass("selected"),$(n).find("p.cost").html("$"+Math.round(r.fp)),t=$('div.card.js-accessories-product-selector.selected[data-sp="'+$(n).data("sp")+'"]'),t.length>0?(u=t.first(),t.length>1?$("#sp_"+$(n).data("sp")).html(u.data("name")+" <span class= 'text-warning'> (+ "+(t.length-1)+" more selected) <\/spen>"):$("#sp_"+$(n).data("sp")).html(""+u.data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):($("#sp_"+$(n).data("sp")).html("None Selected"),$("#img_selected_"+$(n).data("sp")).attr("src",DEFAULT_IMAGE_URL))):r.mro===!1&&($(n).addClass("selected"),$(n).find("p.cost").html(""),t=$('div.card.js-accessories-product-selector.selected[data-sp="'+$(n).data("sp")+'"]'),t.length>1?(u=t.first(),$("#sp_"+$(n).data("sp")).html(u.data("name")+" <span class= 'text-warning'> (+ "+(t.length-1)+" more selected) <\/spen>")):$("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):($(n).addClass("selected"),$(n).find("p.cost").html(""),t=$('div.card.js-accessories-product-selector.selected[data-sp="'+$(n).data("sp")+'"]'),t.length>1?(u=t.first(),$("#sp_"+$(n).data("sp")).html(u.data("name")+" <span class= 'text-warning'> (+ "+(t.length-1)+" more selected) <\/spen>")):$("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p"))):r.m===!1&&r.m2===!1&&r.o===!1&&r.mro===!1&&(o=systemGraph.find(function(n){return n.p===parseInt(i.data("product"))}),e=parseFloat(r.fp)-parseFloat(o.fp),e>0?$(n).find("p.cost").html("+$"+parseInt(e)):$(n).find("p.cost").html(e<0?"-$"+parseInt(e)*-1:"$"+parseInt(e))))});o===e&&($(".currentspecial li").addClass("d-none"),i.hasClass("selected")&&$("#special-"+i.data("product")).removeClass("d-none"));configuratorApp.CalculateTotals();configuratorApp.MaxLeadDays()},n.ProductOptionOnChange=function(t){var r=$(t),i=r.data("product");$("#cp_"+i).hasClass("selected")?configuratorApp.CalculateTotals():n.SelectProductInAccessories($("#clickable_"+i))},n.ProductSelectOptionOnClick=function(n){$(n)[0].hasAttribute("lastSelected")||$(n).data("lastSelected",$(n).find("option:selected"))},n.ProductSelectOptionOnChange=function(t){var r=_.split($(t).attr("id"),"|",$(t).attr("id").length),i=systemGraph.find(function(n){return n.p===parseInt(r[1])});typeof i!="undefined"&&($("#cp_"+i.p).hasClass("selected")?configuratorApp.CalculateTotals():n.SelectProductInAccessories($("#clickable_"+i.p)))},n.CalculateAccessoriesTotals=function(){var t=$("div.card.js-accessories-product-selector.selected"),n=0;return $.each(t,function(t,i){var r=_.split($(i).attr("id"),"_",$(i).attr("id").length),u=systemGraph.find(function(n){return n.p===parseInt(r[1])}),f,e;typeof u!="undefined"&&(n+=parseFloat(u.fp),f=$(i).find("select"),f.length>0&&f.each(function(){var i=$("option:selected",$(this)),f,t;i!==null&&i.length>0&&(r=_.split($(this).attr("id"),"|",$(this).attr("id").length),f=_.find(u.og,{og:parseInt(r[2])}),typeof f!="undefined"&&(r=_.split(i.attr("id"),"_",i.attr("id").length),t=_.find(f.o,{o:parseInt(r[1])}),typeof t!="undefined"&&(n+=t.q>0?parseFloat(u.fp*(t.q-1)):parseFloat(t.a))))}),e=$(i).find("input:checkbox"),e.length>0&&e.each(function(){var t,i;$(this).is(":checked")&&(r=_.split($(this).attr("id"),"|",$(this).attr("id").length),t=_.find(u.og,{og:parseInt(r[1])}),typeof t!="undefined"&&(i=_.find(t.o,{o:parseInt(r[2])}),typeof i!="undefined"&&(n+=parseFloat(i.a))))}))}),n},n.AccessoriesMaxLeadDays=function(){var n=2,t=$("div.card.js-accessories-product-selector.selected");return $.each(t,function(t,i){var u=_.split($(i).attr("id"),"_",$(i).attr("id").length),r=systemGraph.find(function(n){return n.p===parseInt(u[1])});typeof r!="undefined"&&(n=Math.max(n,parseInt(r.lt)))}),n},n.CalculateAccessoriesDiscounts=function(){var t=$("div.card.js-accessories-product-selector.selected"),n=0;return $.each(t,function(t,i){var u=_.split($(i).attr("id"),"_",$(i).attr("id").length),r=systemGraph.find(function(n){return n.p===parseInt(u[1])});typeof r!="undefined"&&(n+=parseFloat(r.pd))}),n},n}({});formulasApp=function(n){return n.DefaultConstraints=function(){var c=$(".js-case-selector input[name=Case]:checked"),i=c.data("caseid")>0?c.data("caseid"):0,k=c.data("primecaseid")>0?c.data("primecaseid"):0,r=$("#caseConstrains"),t=$("#buildConstrains"),ir=$("#provider_hdcCategoryId").data("value"),rr=$('div.card.js-product-selector.selected[data-category="'+ir+'"]'),ur=$("#provider_hdcTotalAddedSL").attr("data-value"),fr=t.find('[data-productid="'+$(rr).attr("data-product")+'"][data-specificationlabelid="'+ur+'"]').data("slvalue")||0,at=$("#provider_caseMechanicalSL").attr("data-value"),l=0,vt=$("#provider_caseSSDSL").attr("data-value"),yt=$("#provider_caseSSD525SL").attr("data-value"),a=0,d=0,pt=$("#provider_caseOverclockedSL").attr("data-value"),g=0,er=$("#provider_scCategoryId").data("value"),or=$('div.card.js-product-selector.selected[data-category="'+er+'"]'),sr=$("#provider_scCryoMechanicalSL").data("value"),wt=t.find('[data-productid="'+$(or).attr("data-product")+'"][data-specificationlabelid="'+sr+'"]').data("slvalue")||0,bt=$("#provider_psCategoryId").data("value"),o=$('div.card.js-product-selector.selected[data-category="'+bt+'"]'),hr=$("#provider_psMechanicalSL").data("value"),nt=t.find('[data-productid="'+$(o).attr("data-product")+'"][data-specificationlabelid="'+hr+'"]').data("slvalue")||0,tt,it,rt,kt,dt,gt,ni,ti,ii,ri,ui,fi,ei;i>0?(l=r.find('[data-caseid="'+i+'"][data-specificationlabelid="'+at+'"]').data("value")||0,a=r.find('[data-caseid="'+i+'"][data-specificationlabelid="'+vt+'"]').data("value")||0,d=r.find('[data-caseid="'+i+'"][data-specificationlabelid="'+yt+'"]').data("value")||0,g=r.find('[data-caseid="'+i+'"][data-specificationlabelid="'+pt+'"]').data("value")||0):(l=r.find('[data-primecaseid="'+k+'"][data-specificationlabelid="'+at+'"]').data("value")||0,a=r.find('[data-primecaseid= "'+k+'"][data-specificationlabelid="'+vt+'"]').data("value")||0,d=r.find('[data-caseid="'+i+'"][data-specificationlabelid="'+yt+'"]').data("value")||0,g=r.find('[data-primecaseid= "'+k+'"][data-specificationlabelid="'+pt+'"]').data("value")||0);tt=2;(i===51||i===52)&&(tt=1);it=tt*l+a;i!==27&&i!==37&&(nt=0);var cr=it+fr-wt-nt,oi=$("#provider_mbCategoryId").data("value"),n=$('div.card.js-product-selector.selected[data-category="'+oi+'"]');n.length===0&&(n=$('div.card.js-product-selector.selected[data-container="'+oi+'"]'));var lr=$("#provider_mbSataPortsSL").data("value"),ar=t.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+lr+'"]').data("slvalue")||0,vr=$("#provider_mbPCHLanesSL").data("value"),yr=t.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+vr+'"]').data("slvalue")||0,ut=$("#provider_rcCategoryId").data("value"),pr=$("#provider_raidControllersSataSL").data("value"),si=0,u=$('div.card.js-product-selector.selected[data-category="'+ut+'"]');u.length===0&&(u=$('div.card.js-product-selector.selected[data-container="'+ut+'"]'));u!==null&&(si=t.find('[data-productid="'+$(u).attr("data-product")+'"][data-specificationlabelid="'+pr+'"]').data("slvalue")||0);rt=ar+si;kt=Math.min(cr,rt);$("#provider_mbHdTotal").attr("data-value",rt);$("#provider_caseHdTotal").attr("data-value",it);$("#provider_hdGlobal").attr("data-value",kt);$("#provider_hdMechanical").attr("data-value",l);$("#provider_scCryoMechanical").attr("data-value",wt);$("#provider_psMechanical").attr("data-value",nt);$("#provider_hdSSD").attr("data-value",a);$("#provider_bd525").attr("data-value",d);$("#provider_caseOverclocked").attr("data-value",g);var f=$("#provider_physicalSlotSL").data("value"),e=$("#provider_pciLengthSL").data("value"),s=$("#provider_powerDrawSL").data("value"),wr=$("#provider_psPowerDrawPcSL").data("value"),hi=$("#provider_cpuCategoryId").data("value"),v=$('div.card.js-product-selector.selected[data-category="'+hi+'"]');v.length===0&&(v=$('div.card.js-product-selector.selected[data-container="'+hi+'"]'));var br=$("#provider_cpuLanesSL").data("value"),kr=t.find('[data-productid="'+$(v).attr("data-product")+'"][data-specificationlabelid="'+br+'"]').data("slvalue")||0,dr=$("#provider_mbMaxGPUsSL").data("value"),ci=t.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+dr+'"]').data("slvalue")||0;$("#provider_mbMaxGpu").attr("data-value",ci);dt=$("#provider_mbMaxNvmeSL").data("value");gt=t.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+dt+'"]').data("slvalue")||0;$("#provider_mbMaxNvme").attr("data-value",gt);var gr=$("#provider_mbSBNvmeSL").data("value"),nu=t.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+gr+'"]').data("slvalue")||0,tu=$("#provider_m2GlobalSL").data("value"),iu=t.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+tu+'"]').data("slvalue")||0;$("#provider_m2Global").attr("data-value",iu);var li=$("#provider_gcCategoryId").data("value"),ft=$("#provider_nwCategoryId").data("value"),y=$('div.card.js-product-selector.selected[data-category="'+ft+'"]');y.length===0&&(y=$('div.card.js-product-selector.selected[data-container="'+ft+'"]'));var et=t.find('[data-productid="'+$(y).attr("data-product")+'"][data-specificationlabelid="'+f+'"]').data("slvalue")||0,ai=t.find('[data-productid="'+$(y).attr("data-product")+'"][data-specificationlabelid="'+e+'"]').data("slvalue")||0,ot=$("#provider_ccCategoryId").data("value"),p=$('div.card.js-product-selector.selected[data-category="'+ot+'"]');p.length===0&&(p=$('div.card.js-product-selector.selected[data-container="'+ot+'"]'));var st=t.find('[data-productid="'+$(p).attr("data-product")+'"][data-specificationlabelid="'+f+'"]').data("slvalue")||0,vi=t.find('[data-productid="'+$(p).attr("data-product")+'"][data-specificationlabelid="'+e+'"]').data("slvalue")||0,yi=$("#provider_auCategoryId").data("value"),pi=$('div.card.js-product-selector.selected[data-category="'+yi+'"]'),ht=t.find('[data-productid="'+$(pi).attr("data-product")+'"][data-specificationlabelid="'+f+'"]').data("slvalue")||0,wi=t.find('[data-productid="'+$(pi).attr("data-product")+'"][data-specificationlabelid="'+e+'"]').data("slvalue")||0,ct=t.find('[data-productid="'+$(u).attr("data-product")+'"][data-specificationlabelid="'+f+'"]').data("slvalue")||0,bi=t.find('[data-productid="'+$(u).attr("data-product")+'"][data-specificationlabelid="'+e+'"]').data("slvalue")||0;o.length===0&&(o=$('div.card.js-product-selector.selected[data-container="'+bt+'"]'));var ki=t.find('[data-productid="'+$(o).attr("data-product")+'"][data-specificationlabelid="'+s+'"]').data("slvalue")||0,di=t.find('[data-productid="'+$(o).attr("data-product")+'"][data-specificationlabelid="'+wr+'"]').data("slvalue")||0,gi=0;isNaN(ki*di)||(gi=ki*di/100);$("#provider_psTw").attr("data-value",gi);ni=t.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+s+'"]').data("slvalue")||0;$("#provider_mbTw").attr("data-value",ni);ti=t.find('[data-productid="'+$(v).attr("data-product")+'"][data-specificationlabelid="'+s+'"]').data("slvalue")||0;$("#provider_cpuTw").attr("data-value",ti);ii=kr+yr;$("#provider_gPCI").attr("data-value",ii);$("#provider_mbMaxGpu").attr("data-value",ci);$("#provider_mbSBNvme").attr("data-value",nu);var w=0,b=0,h=0,nr=0,lt=0;$('div.card.js-product-selector.selected[data-category="'+li+'"]').each(function(){var r;w+=1;var o=t.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+e+'"]').data("slvalue")||0,u=t.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+f+'"]').data("slvalue")||0,i=$(this).attr("data-product");$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"]').each(function(){var r,t,f;if($(this).data("gpci")===o){if(r=$(this).data("slot")+1,u===1)return $(this).attr("data-gpci",0),$(this).attr("data-product",i),!1;if(u===2){if(t=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+r+'"]'),$(t).data("gpci")>0)return $(this).attr("data-gpci",0),$(this).attr("data-product",i),$(t).attr("data-gpci",0),$(t).attr("data-product",i),!1}else if(u===3&&(t=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+r+'"]'),f=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+(r+1)+'"]'),$(t).data("gpci")>0&&$(f).data("gpci")>0))return $(this).attr("data-gpci",0),$(this).attr("data-product",i),$(t).attr("data-gpci",0),$(t).attr("data-product",i),$(f).attr("data-gpci",0),$(f).attr("data-product",i),!1}});r=t.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+s+'"]').data("slvalue")||0;isNaN(r)||(lt+=r)});$('div.card.js-product-selector.selected[data-container="'+li+'"]').each(function(){var r;w+=1;var o=t.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+e+'"]').data("slvalue")||0,u=t.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+f+'"]').data("slvalue")||0,i=$(this).attr("data-product");$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"]').each(function(){var r,t,f;if($(this).data("gpci")===o){if(r=$(this).data("slot")+1,u===1)return $(this).attr("data-gpci",0),$(this).attr("data-product",i),!1;if(u===2){if(t=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+r+'"]'),$(t).data("gpci")>0)return $(this).attr("data-gpci",0),$(this).attr("data-product",i),$(t).attr("data-gpci",0),$(t).attr("data-product",i),!1}else if(u===3&&(t=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+r+'"]'),f=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+(r+1)+'"]'),$(t).data("gpci")>0&&$(f).data("gpci")>0))return $(this).attr("data-gpci",0),$(this).attr("data-product",i),$(t).attr("data-gpci",0),$(t).attr("data-product",i),$(f).attr("data-gpci",0),$(f).attr("data-product",i),!1}});r=t.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+s+'"]').data("slvalue")||0;isNaN(r)||(lt+=r)});$("#provider_gpuTw").attr("data-value",lt);ri=w*8;$("#provider_ggPCI").attr("data-value",ri);$("#provider_ggpu").attr("data-value",w);var ru=$("#provider_hdM2SubcategoryId").attr("data-value"),uu=$("#provider_hdNvmeSubcategoryId").attr("data-value"),tr=$("#provider_m2PortOccupied").attr("data-value");$('div.card.js-product-selector.selected[data-subcategory="'+ru+'"]').each(function(){var n=t.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+tr+'"]').data("slvalue")||0;n>0&&(b+=1)});$('div.card.js-product-selector.selected[data-subcategory="'+uu+'"]').each(function(){var n=t.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+tr+'"]').data("slvalue")||0;n>0&&(b+=1)});ui=b*4;$("#provider_gnPCI").attr("data-value",ui);$("#provider_gnvme").attr("data-value",b);$('div.card.js-product-selector.selected[data-category="'+ft+'"]').each(function(){var t=this;ai>0&&function(){h+=1;var i=$(t).attr("data-product");$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"]').each(function(){var r,t,u;if($(this).data("gpci")===ai){if(r=$(this).data("slot")+1,et===1)return $(this).attr("data-gpci",0),$(this).attr("data-product",i),!1;if(et===2){if(t=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+r+'"]'),$(t).data("gpci")>0)return $(this).attr("data-gpci",0),$(this).attr("data-product",i),$(t).attr("data-gpci",0),$(t).attr("data-product",i),!1}else if(et===3&&(t=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+r+'"]'),u=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+(r+1)+'"]'),$(t).data("gpci")>0&&$(u).data("gpci")>0))return $(this).attr("data-gpci",0),$(this).attr("data-product",i),$(t).attr("data-gpci",0),$(t).attr("data-product",i),$(u).attr("data-gpci",0),$(u).attr("data-product",i),!1}})}()});$('div.card.js-product-selector.selected[data-category="'+ot+'"]').each(function(){var t=this;vi>0&&function(){h+=1;var i=$(t).attr("data-product");$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"]').each(function(){var r,t,u;if($(this).data("gpci")===vi){if(r=$(this).data("slot")+1,st===1)return $(this).attr("data-gpci",0),$(this).attr("data-product",i),!1;if(st===2){if(t=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+r+'"]'),$(t).data("gpci")>0)return $(this).attr("data-gpci",0),$(this).attr("data-product",i),$(t).attr("data-gpci",0),$(t).attr("data-product",i),!1}else if(st===3&&(t=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+r+'"]'),u=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+(r+1)+'"]'),$(t).data("gpci")>0&&$(u).data("gpci")>0))return $(this).attr("data-gpci",0),$(this).attr("data-product",i),$(t).attr("data-gpci",0),$(t).attr("data-product",i),$(u).attr("data-gpci",0),$(u).attr("data-product",i),!1}})}()});$('div.card.js-product-selector.selected[data-category="'+yi+'"]').each(function(){var t=this;wi>0&&function(){h+=1;var i=$(t).attr("data-product");$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"]').each(function(){var r,t,u;if($(this).data("gpci")===wi){if(r=$(this).data("slot")+1,ht===1)return $(this).attr("data-gpci",0),$(this).attr("data-product",i),!1;if(ht===2){if(t=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+r+'"]'),$(t).data("gpci")>0)return $(this).attr("data-gpci",0),$(this).attr("data-product",i),$(t).attr("data-gpci",0),$(t).attr("data-product",i),!1}else if(ht===3&&(t=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+r+'"]'),u=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+(r+1)+'"]'),$(t).data("gpci")>0&&$(u).data("gpci")>0))return $(this).attr("data-gpci",0),$(this).attr("data-product",i),$(t).attr("data-gpci",0),$(t).attr("data-product",i),$(u).attr("data-gpci",0),$(u).attr("data-product",i),!1}})}()});fi=h*4;$("#provider_gaic").attr("data-value",h);$("#provider_gaPCI").attr("data-value",fi);$('div.card.js-product-selector.selected[data-category="'+ut+'"]').each(function(){var t=this;nr+=1;bi>0&&function(){var i=$(t).attr("data-product");$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"]').each(function(){var r,t,u;if($(this).data("gpci")===bi){if(r=$(this).data("slot")+1,ct===1)return $(this).attr("data-gpci",0),$(this).attr("data-product",i),!1;if(ct===2){if(t=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+r+'"]'),$(t).data("gpci")>0)return $(this).attr("data-gpci",0),$(this).attr("data-product",i),$(t).attr("data-gpci",0),$(t).attr("data-product",i),!1}else if(ct===3&&(t=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+r+'"]'),u=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+(r+1)+'"]'),$(t).data("gpci")>0&&$(u).data("gpci")>0))return $(this).attr("data-gpci",0),$(this).attr("data-product",i),$(t).attr("data-gpci",0),$(t).attr("data-product",i),$(u).attr("data-gpci",0),$(u).attr("data-product",i),!1}})}()});ei=nr*4;$("#provider_grPCI").attr("data-value",ei)},n.Constraints=function(){},n}({});configuratorMatchCApp=function(n){return n.BuildProductConstrainTrigger=function(t){var d=$("div.card.js-product-selector"),i=$("#buildConstrains"),e=$("#provider_mbCategoryId").data("value"),o=$("#provider_cpuCategoryId").data("value"),y=$("#provider_psCategoryId").data("value"),g=$("#caseConstrains"),nt=$("#provider_casePCISlotSL").data("value"),p=0,s=$(".js-case-selector input[name=Case]:checked"),tt=parseInt(s.attr("data-caseid"))>0?parseInt(s.attr("data-caseid")):0,ht=parseInt(s.attr("data-primecaseid"))>0?parseInt(s.attr("data-primecaseid")):0,r,u;p=tt>0?g.find('[data-caseid= "'+tt+'"][data-specificationlabelid="'+nt+'"]').data("value")||0:g.find('[data-primecaseid= "'+ht+'"][data-specificationlabelid="'+nt+'"]').data("value")||0;var h=0,it=0,rt=0,ut=0,ft=0;h=parseInt($("#provider_gPCI").attr("data-value"));it=parseInt($("#provider_ggPCI").attr("data-value"));rt=parseInt($("#provider_gnPCI").attr("data-value"));ut=parseInt($("#provider_gaPCI").attr("data-value"));ft=parseInt($("#provider_grPCI").attr("data-value"));var ct=parseInt($("#provider_psTw").attr("data-value"))||0,lt=parseInt($("#provider_mbTw").attr("data-value"))||0,et=parseInt($("#provider_cpuTw").attr("data-value"))||0,ot=parseInt($("#provider_gpuTw").attr("data-value"))||0,st=$("#provider_powerDrawSL").data("value"),at=$("#provider_mbPCHLanesSL").data("value"),vt=$("#provider_mbMaxGPUsSL").data("value"),yt=$("#provider_mbMaxNvmeSL").data("value"),pt=$("#provider_mbSBNvmeSL").data("value"),wt=$("#provider_cpuLanesSL").data("value"),bt=parseInt($("#provider_ggpu").attr("data-value")),kt=parseInt($("#provider_gnvme").attr("data-value")),c=$('div.card.js-product-selector.selected[data-category="'+o+'"]');c.length===0&&(c=$('div.card.js-product-selector.selected[data-container="'+o+'"]'));$(t).data("category")!==o&&$(t).data("container")!==o&&(c=$(t));r=$('div.card.js-product-selector.selected[data-category="'+y+'"]');r.length===0&&(r=$('div.card.js-product-selector.selected[data-container="'+y+'"]'));u=$('div.card.js-product-selector.selected[data-category="'+e+'"]');u.length===0&&(u=$('div.card.js-product-selector.selected[data-container="'+e+'"]'));var w=i.find('[data-productid="'+$(t).attr("data-product")+'"]'),dt=$("#provider_physicalSlotSL").data("value"),gt=$("div.card.js-services-product-selector"),b=[],k=[],f=[],l=[],a=[],v=$("#buildConstraintDetails");v.find('[data-parententity="Category"][data-parentproductid="'+$(t).attr("data-product")+'"]').each(function(){var n=$.find('div.card.js-product-selector.selected[data-product="'+$(this).attr("data-productid")+'"]');n.length>0&&_.forEach(n,function(n){a.push($(n).attr("data-product")+"-"+$(n).attr("data-category"))})});v.find('[data-productid="'+$(t).attr("data-product")+'"]').each(function(){var n=$.find('div.card.js-product-selector.selected[data-product="'+$(this).attr("data-parentproductid")+'"]');$(this).attr("data-parententity")==="Category"&&n.length>0&&_.forEach(n,function(n){a.push($(n).attr("data-product")+"-"+$(n).attr("data-category"))})});_.forEach(w,function(o){var s=_.split($(o).attr("data-slvalue"),",",$(o).attr("data-slvalue").length);$(o).attr("data-istrigger")==="True"&&$(o).attr("data-trigger")==="Match"&&(_.forEach(d,function(n){var u=$(t).data("container")===0?$(t).data("category"):$(t).data("container"),e=$(n).data("container")===0?$(n).data("category"):$(n).data("container"),r;u!==e&&(r=i.find('[data-specificationlabelid="'+$(o).attr("data-specificationlabelid")+'"][data-productid="'+$(n).attr("data-product")+'"]'),_.forEach(r,function(n){var t=_.split($(n).attr("data-slvalue"),",",$(n).attr("data-slvalue").length),r=_.difference(s,t),i;t.length>0&&s.length>0&&r.length===s.length?f.push($(n).attr("data-productid")+"-"+$(n).attr("data-categoryid")):(i=b.indexOf($(n).attr("data-productid")+"-"+$(n).attr("data-categoryid")),i===-1&&b.push($(n).attr("data-productid")+"-"+$(n).attr("data-categoryid")))}))}),_.forEach(gt,function(n){var u=$(t).data("container")===0?$(t).data("category"):$(t).data("container"),f=$(n).data("container")===0?$(n).data("category"):$(n).data("container"),r;u!==f&&(r=i.find('[data-specificationlabelid="'+$(o).attr("data-specificationlabelid")+'"][data-productid="'+$(n).attr("data-product")+'"]'),_.forEach(r,function(n){var t=_.split($(n).attr("data-slvalue"),",",$(n).attr("data-slvalue").length),r=_.difference(s,t),i;t.length>0&&r.length===s.length?l.push(""+$(n).attr("data-productid")):(i=k.indexOf(""+$(n).attr("data-productid")),i===-1&&k.push(""+$(n).attr("data-productid")))}))}),_.forEach(b,function(n){var e=_.split(n,"-",n.length),r=$("#cp-"+e[0]+"-"+e[1]),u=systemGraph.find(function(n){return n.p===parseInt(e[0])&&n.c===parseInt(e[1])}),l,f,s,h,c;if(typeof u!="undefined"&&r.attr("data-constrainedby")!=="case")if(l=i.find('[data-specificationlabelid="'+$(o).attr("data-specificationlabelid")+'"][data-productid="'+e[0]+'"]'),$(o).data("applyto")===0){if(l.length>0){f="";typeof r.attr("data-constrainedcategory")!="undefined"&&r.attr("data-constrainedcategory")!==null&&(f=_.split(r.attr("data-constrainedcategory"),",",r.attr("data-constrainedcategory").length));(f.lenght===0||f.indexOf($(t).attr("data-category"))!==-1||f.indexOf("102")>=0&&$(t).attr("data-category")==="108"&&$(t).attr("data-product")==="485"||f.indexOf("108")>=0&&$(t).attr("data-category")==="102"&&$(t).attr("data-product")==="485")&&(f.length===0||f.length===1?(u.cd===!0?r.removeClass("constraintoverlay disabled"):($("#prd-"+e[0]+"-"+e[1]).removeClass("d-none"),u.mro===!0&&u.addClass("selected")),r.attr("data-constrainedcategory",""),r.attr("data-constrainedby","")):(r.attr("data-constrainedcategory",""),r.attr("data-constrainedby",""),_.forEach(f,function(n){n!==$(t).attr("data-category")&&(r.attr("data-constrainedcategory").length===0?(r.attr("data-constrainedcategory",n),r.attr("data-constrainedby","")):(r.attr("data-constrainedcategory",r.attr("data-constrainedcategory")+","+n),r.attr("data-constrainedby","")))})));var a=$("#category_"+u.c),y=a.children("div.row").children("div.config-option.col-12.col-md-6.col-lg-4.col-xxl-3"),p=a.children("div.row").children("div.config-option.col-12.col-md-6.col-lg-4.col-xxl-3.d-none");p.length!==y.length&&$("#category_"+u.c+"-tab").removeClass("d-none");var v=$("#subcat-"+u.c+"-"+u.s),w=v.children("div.row").children("div.config-option.col-12.col-md-6.col-lg-4.col-xxl-3"),b=v.children("div.row").children("div.config-option.col-12.col-md-6.col-lg-4.col-xxl-3.d-none");b.length!==w.length&&$("#subcat-"+u.c+"-"+u.s+"-tab").removeClass("disabled")}}else s=r.closest("div").find("select"),s.length>0&&(idArray=_.split(s.attr("id"),"|",s.attr("id").length),h=_.find(u.og,{og:parseInt(idArray[2])}),typeof h!="undefined"&&h.s===$(o).data("specificationlabelid")&&s.removeClass("d-none")),c=r.find("input:checkbox"),c.length>0&&c.each(function(){idArray=_.split($(this).attr("id"),"|",$(this).attr("id").length);var n=_.find(u.og,{og:parseInt(idArray[1])});typeof n!="undefined"&&n.s===$(o).data("specificationlabelid")&&$(this).parent().removeClass("d-none")})}),_.forEach(k,function(n){var e=n,i=$("#cp_"+e),u=systemGraph.find(function(n){return n.p===parseInt(e)}),r,f,s,h;typeof u!="undefined"&&i.attr("data-constrainedby")!=="case"&&($(o).data("applyto")===0?typeof i.attr("data-constrainedcategory")!="undefined"?(r=_.split(i.attr("data-constrainedcategory"),",",i.attr("data-constrainedcategory").length),(r.lenght===0||r.indexOf($(t).attr("data-category"))!==-1)&&(r.length===0||r.length===1?(u.cd===!0?i.removeClass("constraintoverlay disabled"):$("#prd_"+e).removeClass("d-none"),i.attr("data-constrainedcategory",""),i.attr("data-constrainedby","")):(i.attr("data-constrainedcategory",""),i.attr("data-constrainedby",""),_.forEach(r,function(n){n!==$(t).attr("data-category")&&(i.attr("data-constrainedcategory").length===0?(i.attr("data-constrainedcategory",n),i.attr("data-constrainedby","")):(i.attr("data-constrainedcategory",i.attr("data-constrainedcategory")+","+n),i.attr("data-constrainedby","")))})))):(u.cd===!0?i.removeClass("constraintoverlay disabled"):$("#prd_"+e).removeClass("d-none"),i.attr("data-constrainedcategory",""),i.attr("data-constrainedby","")):(f=i.closest("div").find("select"),f.length>0&&(idArray=_.split(f.attr("id"),"|",f.attr("id").length),s=_.find(u.og,{og:parseInt(idArray[2])}),typeof s!="undefined"&&s.s===$(o).data("specificationlabelid")&&f.removeClass("d-none")),h=i.find("input:checkbox"),h.length>0&&h.each(function(){idArray=_.split($(this).attr("id"),"|",$(this).attr("id").length);var n=_.find(u.og,{og:parseInt(idArray[1])});typeof n!="undefined"&&n.s===$(o).data("specificationlabelid")&&$(this).removeClass("d-none")})))}),_.forEach(f,function(s){var w=_.split(s,"-",s.length),a=systemGraph.find(function(n){return n.p===parseInt(w[0])&&n.c===parseInt(w[1])}),l=$("#cp-"+w[0]+"-"+w[1]),g,nt,b,k,d;typeof a!="undefined"&&(g=i.find('[data-specificationlabelid="'+$(o).attr("data-specificationlabelid")+'"][data-productid="'+w[0]+'"]'),$(o).data("applyto")===0?g.length>0&&function(){var tt,ht,b,s,k,d,o,gt;a.cd===!0?w[0]==="1438"?(o=$("div.card.js-product-selector.selected[data-product='485']"),o.length===0&&l.addClass("constraintoverlay disabled")):l.addClass("constraintoverlay disabled"):$("#prd-"+w[0]+"-"+w[1]).addClass("d-none");l.attr("data-constrainedby")!=="case"&&(l.attr("data-constrainedcategory")===null||l.attr("data-constrainedcategory").length===0?(l.attr("data-constrainedcategory",$(t).attr("data-category")),l.attr("data-constrainedby",$(t).attr("data-product"))):(nt=l.attr("data-constrainedcategory").search($(t).attr("data-category")),nt===-1&&(l.attr("data-constrainedcategory",l.attr("data-constrainedcategory")+","+$(t).attr("data-category")),l.attr("data-constrainedby",l.attr("data-constrainedby")+","+$(t).attr("data-product")))));var ni=$("#category_"+a.c),ti=ni.children("div.row").children("div.config-option.col-12.col-md-6.col-lg-4.col-xxl-3"),g=ni.children("div.row").children("div.config-option.col-12.col-md-6.col-lg-4.col-xxl-3.d-none");g.length===ti.length&&$("#category_"+a.c+"-tab").addClass("disabled");var ri=ti.length-g.length,ii=$("#subcat-"+a.c+"-"+a.s),ui=ii.children("div.row").children("div.config-option.col-12.col-md-6.col-lg-4.col-xxl-3"),fi=ii.children("div.row").children("div.config-option.col-12.col-md-6.col-lg-4.col-xxl-3.d-none");fi.length===ui.length&&($("#subcat-"+a.c+"-"+a.s+"-tab").addClass("disabled"),tt=$("#subcategories-"+a.c).children("li.nav-item").children("a.nav-link"),ht=tt.not(".d-none").last(),ht.css("border-right","1px solid #cc181e"));l.hasClass("selected")&&(b=$("#category_"+l.attr("data-category")).children("div.row").children("div.config-option"),b.length===0&&(b=$("#category_"+l.attr("data-category")).children("div.tab-pane").children("div.row").children("div.config-option")),s=b.children("div.card.js-product-selector"),w[0]==="1438"?(o=$("div.card.js-product-selector.selected[data-product='485']"),o.length===0&&l.removeClass("selected")):function(){l.removeClass("selected");l.find(".js-selector-option-select").find("option:eq(0)").prop("selected",!0);var n=l.find("input:checkbox");n.length>0&&n.each(function(){n.each(function(){$(this).is(":checked")&&$(this).prop("checked",!1)})})}(),k=systemGraph.find(function(n){return n.p===parseInt(l.attr("data-product"))&&n.c===parseInt(l.attr("data-category"))}),k.m===!0||k.o===!0||k.m2===!0?(d=!1,_.forEach(s,function(n){var t,i;if($(n).attr("data-category")===l.attr("data-category")&&$.inArray($(n).attr("data-product")+"-"+$(n).attr("data-category"),f)===-1&&($(n).attr("data-constrainedcategory")===null||$(n).attr("data-constrainedcategory").length===0)&&($(n).attr("data-constrainedby")===null||$(n).attr("data-constrainedby")===undefined||$(n).attr("data-constrainedby")!==undefined&&$(n).attr("data-constrainedby")==="")&&(t=systemGraph.find(function(t){return t.p===parseInt($(n).attr("data-product"))&&t.c===parseInt($(n).attr("data-category"))}),t.d===!0))return $(n).addClass("selected"),selectedMenuContainer=$('div.card.js-product-selector.selected[data-sp="'+$(n).data("sp")+'"]'),selectedMenuContainer.length>0&&(i=selectedMenuContainer.first(),selectedMenuContainer.length>1?$("#sp_"+$(n).data("sp")).html(i.data("name")+" <span class= 'text-warning'> (+ "+(selectedMenuContainer.length-1)+" more selected) <\/span>"):$("#sp_"+$(n).data("sp")).html($(n).data("name"))),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p")),$(n).find("p.cost").html(""),categoriesThatChanged.push($(n)),d=!0,!1}),d===!1&&(w[0]==="1438"?(o=$("div.card.js-product-selector.selected[data-product='485']"),o.length===0&&helperApp.Modal("Configurator Change",l.data("name")+" has been removed from "+l.data("categoryname")+" <br>")):helperApp.Modal("Configurator Change",l.data("name")+" has been removed from "+l.data("categoryname")+" <br>"),selectedMenuContainer=$('div.card.js-product-selector.selected[data-sp="'+l.data("sp")+'"]'),selectedMenuContainer.length>0?(gt=selectedMenuContainer.first(),selectedMenuContainer.length>1?$("#sp_"+l.data("sp")).html(gt.data("name")+" <span class= 'text-warning'> (+ "+(selectedMenuContainer.length-1)+" more selected) <\/span>"):$("#sp_"+l.data("sp")).html(l.data("name")),$("#img_selected_"+l.data("sp")).attr("src",l.data("p")),l.find("p.cost").html("")):($("#sp_"+l.data("sp")).html("None Selected"),$("#img_selected_"+l.data("sp")).attr("src",DEFAULT_IMAGE_URL)))):function(){var w=$(l),t=$(),o=!1;g.length===s.length&&$("#category_"+a.c+"-tab").addClass("d-none");_.forEach(s,function(n){var b,s,k,w;if($(n).attr("data-category")===l.attr("data-category")&&$.inArray($(n).attr("data-product")+"-"+$(n).attr("data-category"),f)===-1&&($(n).attr("data-constrainedcategory")===null||$(n).attr("data-constrainedcategory").length===0)&&($(n).attr("data-constrainedby")===null||$(n).attr("data-constrainedby")===undefined||$(n).attr("data-constrainedby")!==undefined&&$(n).attr("data-constrainedby")==="")&&o===!1)if(b=!1,ri>1&&(v.find('[data-parententity="Category"][data-parentproductid="'+$(n).attr("data-product")+'"]').each(function(){var n=$.find('div.card.js-product-selector.selected[data-product="'+$(this).attr("data-productid")+'"]');if(n.length>0)return b=!0,!1}),v.find('[data-productid="'+$(n).attr("data-product")+'"]').each(function(){var n=$.find('div.card.js-product-selector.selected[data-product="'+$(this).attr("data-parentproductid")+'"]');switch($(this).attr("data-parententity")){case"Category":if(n.length>0)return b=!0,!1}})),b||$(n).data("category")===e||$(n).data("container")===e){var ht=i.find('[data-productid="'+$(c).attr("data-product")+'"][data-specificationlabelid="'+wt+'"]').data("slvalue")||0,d=i.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+vt+'"]').data("slvalue")||0,g=i.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+yt+'"]').data("slvalue")||0,nt=i.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+pt+'"]').data("slvalue")||0,tt=i.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+st+'"]').data("slvalue")||0,gt=i.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+at+'"]').data("slvalue")||0;if(h=gt+ht,!b&&h>=it+rt+ut+ft&&d>=bt&&g+nt>=kt){for(s=[],$("#pciSlots").find('[data-productid="'+$(u).attr("data-product")+'"][data-gpci="0"]').each(function(){var t=this,n;($(this).attr("data-gpci")!==$(this).attr("data-configuration")||$(this).attr("data-configuration")==="0"&&$(this).attr("data-product")!=="")&&function(){var u=i.find('[data-productid="'+$(t).attr("data-product")+'"][data-specificationlabelid="'+dt+'"]').data("slvalue")||0,r=s.findIndex(function(n){return n.productid===$(t).attr("data-product")&&n.width<u});r!==-1?s[r].width=s[r].width+1:(n={},n.productid=$(t).attr("data-product"),n.lenght=$(t).data("configuration"),n.width=1,n.found=!1,s.push(n))}()}),k=!0,w=0;w<s.length;w++)$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"]').each(function(){var r,t,i;if(parseInt($(this).attr("data-gpci"))>=s[w].lenght){if(r=$(this).data("slot")+1,s[w].width===1)return $(this).attr("data-gpci",0),$(this).attr("data-product",s[w].productid),s[w].found=!0,!1;if(s[w].width===2){if(t=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+r+'"]'),$(t).length!==0){if($(t).data("gpci")>0||$(t).data("gpci")===$(t).data("configuration"))return $(this).attr("data-gpci",0),$(this).attr("data-product",s[w].productid),$(t).attr("data-gpci",0),$(t).attr("data-product",s[w].productid),s[w].found=!0,!1}else if(r<=p)return $(this).attr("data-gpci",0),$(this).attr("data-product",productId),s[w].found=!0,!1}else if(s[w].width===3)if(t=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+r+'"]'),i=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+(r+1)+'"]'),$(i).length!==0){if(($(t).data("gpci")>0||$(t).data("gpci")===$(t).data("configuration"))&&($(i).data("gpci")>0||$(i).data("gpci")===$(i).data("configuration")))return $(this).attr("data-gpci",0),$(this).attr("data-product",s[w].productid),$(t).attr("data-gpci",0),$(t).attr("data-product",s[w].productid),$(i).attr("data-gpci",0),$(i).attr("data-product",s[w].productid),s[w].found=!0,!1}else if(r+1<=p)return $(this).attr("data-gpci",0),$(this).attr("data-product",productId),$(t).length!==0&&($(t).attr("data-gpci",0),$(t).attr("data-product",productId)),s[w].found=!0,!1}});for(w=0;w<s.length;w++)if(s[w].found===!1){k=!1;break}if(k)return ct<tt+et+ot&&($(r).removeClass("selected"),$('div.card.js-product-selector[data-category="'+y+'"]').each(function(){if(($(this).attr("data-constrainedcategory")===null||$(this).attr("data-constrainedcategory").length===0||$(this).attr("data-constrainedcategory")===undefined)&&($(this).attr("data-constrainedby")===null||$(this).attr("data-constrainedby")===undefined||$(this).attr("data-constrainedby")==="")){var f=$("#provider_psPowerDrawPcSL").data("value"),e=i.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+st+'"]').data("slvalue")||0,o=i.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+f+'"]').data("slvalue")||0,n=e*o/100;if(n>=lt+et+ot){$("#provider_psTw").attr("data-value",n);$(this).addClass("selected");$("#sp_"+$(this).data("sp")).html($(this).data("name"));$(this).find("p.cost").html("");$("#img_selected_"+$(this).data("sp")).attr("src",$(this).data("p"));$(r).data("product")!==$(this).data("product")&&categoriesThatChanged.push($(this));var t=$("#category_"+a.c),s=t.children("div.row").children("div.config-option.col-12.col-md-6.col-lg-4.col-xxl-3"),h=t.children("div.row").children("div.config-option.col-12.col-md-6.col-lg-4.col-xxl-3.d-none");h.length===s.length&&$("#category_"+a.c+"-tab").addClass("d-none");var u=$("#subcat-"+a.c+"-"+a.s),c=u.children("div.row").children("div.config-option.col-12.col-md-6.col-lg-4.col-xxl-3"),l=u.children("div.row").children("div.config-option.col-12.col-md-6.col-lg-4.col-xxl-3.d-none");return l.length===c.length&&$("#subcat-"+a.c+"-"+a.s+"-tab").addClass("disabled"),!1}}})),$("#pciSlots").find('[data-productid="'+$(u).attr("data-product")+'"]').each(function(){$(this).attr("data-gpci",$(this).attr("data-configuration"));$(this).attr("data-product","")}),$("#provider_mbMaxGpu").attr("data-value",d),$("#provider_mbMaxNvme").attr("data-value",g),$("#provider_mbSBNvme").attr("data-value",nt),$("#provider_mbTw").attr("data-value",tt),$("#provider_gPCI").attr("data-value",h),$(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p")),$(n).find("p.cost").html(""),configuratorToolsApp.UpdateHardDriveSupported(),t=$(n),!1}}else return $(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p")),$(n).find("p.cost").html(""),t=$(n),!1});t.length>0?(_.forEach(s,function(n){if($(n).attr("data-category")===t.attr("data-category")&&$(n).attr("data-product")!==$(t).attr("data-product")){var r=systemGraph.find(function(t){return t.p===parseInt($(n).data("product"))&&t.c===parseInt($(n).data("category"))}),u=systemGraph.find(function(n){return n.p===parseInt($(t).data("product"))&&n.c===parseInt($(t).data("category"))}),i=parseFloat(r.fp)-parseFloat(u.fp);$(n).find("p.cost").html(i>0?"$+"+parseInt(i):"$"+parseInt(i))}}),$(t).data("product")!==l.data("product")&&categoriesThatChanged.push(t),n.BuildProductConstrainTrigger(t)):l.addClass("selected")}())}():(b=l.closest("div").find("select"),b.length>0&&(idArray=_.split(b.attr("id"),"|",b.attr("id").length),k=_.find(a.og,{og:parseInt(idArray[2])}),typeof k!="undefined"&&k.s===$(o).data("specificationlabelid")&&(b.find("option:eq(0)").prop("selected",!0),b.addClass("d-none"))),d=l.find("input:checkbox"),d.length>0&&d.each(function(){idArray=_.split($(this).attr("id"),"|",$(this).attr("id").length);var n=_.find(a.og,{og:parseInt(idArray[1])});typeof n!="undefined"&&n.s===$(o).data("specificationlabelid")&&($(this).is(":checked")&&$(this).prop("checked",!1),$(this).parent().addClass("d-none"))})))}),_.forEach(l,function(i){var r=i,u=$("#cp_"+r),e=systemGraph.find(function(n){return n.p===parseInt(r)}),y,s,h,c,f,a,v;typeof e!="undefined"&&$(o).data("applyto")===0&&(e.cd===!0?$("#cp_"+r).addClass("constraintoverlay disabled"):$("#prd_"+r).addClass("d-none"),$("#cp_"+r).attr("data-constrainedby")!=="case"&&($("#cp_"+r).attr("data-constrainedcategory")===null||$("#cp_"+r).attr("data-constrainedcategory")===""?($("#cp_"+r).attr("data-constrainedcategory",$(t).attr("data-category")),$("#cp_"+r).attr("data-constrainedby",$(t).attr("data-product"))):$("#cp_"+r).attr("data-constrainedcategory")!==undefined&&(y=$("#cp_"+r).attr("data-constrainedcategory").search($(t).attr("data-category")),y===-1&&($("#cp_"+r).attr("data-constrainedcategory",$("#cp_"+r).attr("data-constrainedcategory")+","+$(t).attr("data-category")),$("#cp_"+r).attr("data-constrainedby",$("#cp_"+r).attr("data-constrainedby")+","+$(t).attr("data-product"))))),u.hasClass("selected")?(s=$("#category_"+u.attr("data-category")).children("div.row").children("div.config-option"),s.length===0&&(s=$("#category_"+u.attr("data-category")).children("div.tab-pane").children("div.row").children("div.config-option")),h=s.children("div.card.js-services-product-selector"),u.removeClass("selected"),c=systemGraph.find(function(n){return n.p===parseInt(u.attr("data-product"))&&n.c===parseInt(u.attr("data-category"))}),c.m===!0||c.o===!0?_.forEach(h,function(n){var t,i;if($(n).attr("data-category")===u.attr("data-category")&&$.inArray($(n).attr("data-product")+"-"+$(n).attr("data-category"),l)===-1&&($(n).attr("data-constrainedcategory")===null||$(n).attr("data-constrainedcategory")==="")&&($(n).attr("data-constrainedby")===null||$(n).attr("data-constrainedby")===undefined||$(n).attr("data-constrainedby")!==undefined&&$(n).attr("data-constrainedby")==="")&&(t=systemGraph.find(function(t){return t.p===parseInt($(n).attr("data-product"))&&t.c===parseInt($(n).attr("data-category"))}),t.d===!0))return $(n).addClass("selected"),selectedMenuContainer=$('div.card.js-services-product-selector.selected[data-sp="'+$(n).data("sp")+'"]'),selectedMenuContainer.length>0&&(i=selectedMenuContainer.first(),selectedMenuContainer.length>1?$("#sp_"+$(n).data("sp")).html(i.data("name")+" <span class= 'text-warning'> (+ "+(selectedMenuContainer.length-1)+" more selected) <\/span>"):$("#sp_"+$(n).data("sp")).html($(n).data("name"))),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p")),$(n).find("p.cost").html(""),categoriesThatChanged.push($(n)),!1}):function(){var r=$(u),t=$(),i=!1;_.forEach(h,function(n){if($(n).attr("data-category")===u.attr("data-category")&&$.inArray($(n).attr("data-product")+"-"+$(n).attr("data-category"),l)===-1&&($(n).attr("data-constrainedcategory")===null||$(n).attr("data-constrainedcategory")==="")&&($(n).attr("data-constrainedby")===null||$(n).attr("data-constrainedby")===undefined||$(n).attr("data-constrainedby")!==undefined&&$(n).attr("data-constrainedby")==="")&&i===!1)return $(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p")),$(n).find("p.cost").html(""),t=$(n),!1});t.length>0&&(_.forEach(h,function(n){if($(n).attr("data-category")===t.attr("data-category")&&$(n).attr("data-product")!==$(t).attr("data-product")){var r=systemGraph.find(function(t){return t.p===parseInt($(n).data("product"))&&t.c===parseInt($(n).data("category"))}),u=systemGraph.find(function(n){return n.p===parseInt($(t).data("product"))&&n.c===parseInt($(t).data("category"))}),i=parseFloat(r.fp)-parseFloat(u.fp);$(n).find("p.cost").html(i>0?"$+"+parseInt(i):"$"+parseInt(i))}}),$(t).data("product")!==u.data("product")&&categoriesThatChanged.push(t),n.BuildProductConstrainTrigger(t))}()):(f=$("#cp_"+r).closest("div").find("select"),f.length>0&&(idArray=_.split(f.attr("id"),"|",f.attr("id").length),a=_.find(e.og,{og:parseInt(idArray[2])}),typeof a!="undefined"&&a.s===$(o).data("specificationlabelid")&&f.addClass("d-none")),v=$("#cp_"+r).find("input:checkbox"),v.length>0&&v.each(function(){idArray=_.split($(this).attr("id"),"|",$(this).attr("id").length);var n=_.find(e.og,{og:parseInt(idArray[1])});typeof n!="undefined"&&n.s===$(o).data("specificationlabelid")&&$(this).addClass("d-none")})))}))});_.forEach(a,function(t){var r=_.split(t,"-",t.length),s=systemGraph.find(function(n){return n.p===parseInt(r[0])&&n.c===parseInt(r[1])}),i=$("#cp-"+r[0]+"-"+r[1]),u,o,e;typeof s!="undefined"&&i.hasClass("selected")&&(u=$("#category_"+i.attr("data-category")).children("div.row").children("div.config-option"),u.length===0&&(u=$("#category_"+i.attr("data-category")).children("div.tab-pane").children("div.row").children("div.config-option")),o=u.children("div.card.js-product-selector"),i.removeClass("selected"),e=systemGraph.find(function(n){return n.p===parseInt(i.attr("data-product"))&&n.c===parseInt(i.attr("data-category"))}),e.m===!0||e.o===!0||e.m2===!0||function(){var t=$();_.forEach(o,function(n){if($(n).attr("data-category")===i.attr("data-category")&&$.inArray($(n).attr("data-product")+"-"+$(n).attr("data-category"),f)===-1&&$.inArray($(n).attr("data-product")+"-"+$(n).attr("data-category"),a)===-1&&($(n).attr("data-constrainedcategory")===null||$(n).attr("data-constrainedcategory").length===0)&&($(n).attr("data-constrainedby")===null||$(n).attr("data-constrainedby")===undefined||$(n).attr("data-constrainedby")!==undefined&&$(n).attr("data-constrainedby")===""))return $(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p")),$(n).find("p.cost").html(""),t=$(n),!1});t.length>0&&(_.forEach(o,function(n){if($(n).attr("data-category")===t.attr("data-category")&&$(n).attr("data-product")!==$(t).attr("data-product")){var r=systemGraph.find(function(t){return t.p===parseInt($(n).data("product"))&&t.c===parseInt($(n).data("category"))}),u=systemGraph.find(function(n){return n.p===parseInt($(t).data("product"))&&n.c===parseInt($(t).data("category"))}),i=parseFloat(r.fp)-parseFloat(u.fp);$(n).find("p.cost").html(i>0?"$+"+parseInt(i):"$"+parseInt(i))}}),$(t).data("product")!==i.data("product")&&categoriesThatChanged.push(t),n.BuildProductConstrainTrigger(t))}())});_.forEach(d,function(n){w=i.find('[data-productid="'+$(n).attr("data-product")+'"]');_.forEach(w,function(n){var r,u;if($(n).attr("data-istrigger")==="True"&&$(n).attr("data-trigger")==="Amount"&&(r=$(n).attr("data-slvalue"),parseInt(r)>0)){var f=configuratorApp.CalculateTotals(),i=systemGraph.find(function(t){return t.p===parseInt($(n).attr("data-productid"))&&t.c===parseInt($(n).attr("data-categoryid"))}),t=$("#cp-"+$(n).attr("data-productid")+"-"+$(n).attr("data-categoryid"));f<parseInt(r)?typeof i!="undefined"&&$(n).data("applyto")===0&&(i.cd===!0?t.addClass("constraintoverlay disabled"):($("#prd-"+$(n).attr("data-productid")+"-"+$(n).attr("data-categoryid")).addClass("d-none"),$("#prd_"+$(n).attr("data-categoryid")).addClass("d-none")),t.hasClass("selected")&&(t.removeClass("selected"),helperApp.Modal("Configurator Change",t.data("name")+" has been removed from "+t.data("categoryname")+" <br>"))):typeof i!="undefined"&&$(n).data("applyto")===0&&(i.cd===!0?t.removeClass("constraintoverlay disabled"):$("#prd-"+$(n).attr("data-productid")+"-"+$(n).attr("data-categoryid")).removeClass("d-none"));selectedMenuContainer=$('div.card.js-product-selector.selected[data-sp="'+t.data("sp")+'"]');t.hasClass("selected")&&(selectedMenuContainer.length>0?(u=selectedMenuContainer.first(),selectedMenuContainer.length>1?$("#sp_"+t.data("sp")).html(u.data("name")+" <span class= 'text-warning'> (+ "+(selectedMenuContainer.length-1)+" more selected) <\/span>"):$("#sp_"+t.data("sp")).html(t.data("name")),$("#img_selected_"+t.data("sp")).attr("src",t.data("p"))):($("#sp_"+t.data("sp")).html("None Selected"),$("#img_selected_"+t.data("sp")).attr("src",DEFAULT_IMAGE_URL)))}})})},n.OptionProductConstrainTrigger=function(t,i){var u=$("div.card.js-product-selector"),r;i?function(){var i=$("#buildConstrains"),l=$("#provider_mbCategoryId").data("value"),a=$("#provider_cpuCategoryId").data("value"),o=$("#provider_psCategoryId").data("value"),v=$("#caseConstrains"),y=$("#provider_casePCISlotSL").data("value"),s=0,f=$(".js-case-selector input[name=Case]:checked"),p=parseInt(f.attr("data-caseid"))>0?parseInt(f.attr("data-caseid")):0,it=parseInt(f.attr("data-primecaseid"))>0?parseInt(f.attr("data-primecaseid")):0,r;s=p>0?v.find('[data-caseid= "'+p+'"][data-specificationlabelid="'+y+'"]').data("value")||0:v.find('[data-primecaseid= "'+it+'"][data-specificationlabelid="'+y+'"]').data("value")||0;var e=0,w=0,b=0,k=0,d=0;e=parseInt($("#provider_gPCI").attr("data-value"));w=parseInt($("#provider_ggPCI").attr("data-value"));b=parseInt($("#provider_gnPCI").attr("data-value"));k=parseInt($("#provider_gaPCI").attr("data-value"));d=parseInt($("#provider_grPCI").attr("data-value"));var rt=parseInt($("#provider_psTw").attr("data-value"))||0,ut=parseInt($("#provider_mbTw").attr("data-value"))||0,g=parseInt($("#provider_cpuTw").attr("data-value"))||0,nt=parseInt($("#provider_gpuTw").attr("data-value"))||0,tt=$("#provider_powerDrawSL").data("value"),ft=$("#provider_mbPCHLanesSL").data("value"),et=$("#provider_mbMaxGPUsSL").data("value"),ot=$("#provider_mbMaxNvmeSL").data("value"),st=$("#provider_mbSBNvmeSL").data("value"),ht=$("#provider_cpuLanesSL").data("value"),ct=parseInt($("#provider_ggpu").attr("data-value")),lt=parseInt($("#provider_gnvme").attr("data-value")),h=$('div.card.js-product-selector.selected[data-category="'+a+'"]');h.length===0&&(h=$('div.card.js-product-selector.selected[data-container="'+a+'"]'));r=$('div.card.js-product-selector.selected[data-category="'+o+'"]');r.length===0&&(r=$('div.card.js-product-selector.selected[data-container="'+o+'"]'));var at=i.find('[data-productid="'+t+'"]'),vt=$("#provider_physicalSlotSL").data("value"),c=[];_.forEach(at,function(f){var a=_.split($(f).attr("data-slvalue"),",",$(f).attr("data-slvalue").length);$(f).attr("data-istrigger")==="True"&&$(f).attr("data-trigger")==="Match"&&_.forEach(u,function(n){var t=i.find('[data-specificationlabelid="'+$(f).attr("data-specificationlabelid")+'"][data-productid="'+$(n).attr("data-product")+'"]');_.forEach(t,function(n){var t=_.split($(n).attr("data-slvalue"),",",$(n).attr("data-slvalue").length),i=_.difference(a,t);t.length>0&&i.length===a.length&&c.push($(n).attr("data-productid")+"-"+$(n).attr("data-categoryid"))})});_.forEach(c,function(u){var v=_.split(u,"-",u.length),p=systemGraph.find(function(n){return n.p===parseInt(v[0])&&n.c===parseInt(v[1])}),a=$("#cp-"+v[0]+"-"+v[1]),bt,it,at,yt,y,pt,wt;typeof p!="undefined"&&($(f).data("applyto")===0?(p.cd===!0?a.addClass("constraintoverlay disabled"):$("#prd-"+v[0]+"-"+v[1]).addClass("d-none"),a.attr("data-constrainedby")!=="case"&&(a.attr("data-constrainedcategory")===null||a.attr("data-constrainedcategory").length===0?(a.attr("data-constrainedcategory",$(f).attr("data-category")),a.attr("data-constrainedby",t)):(bt=a.attr("data-constrainedcategory").search($(f).attr("data-category")),bt===-1&&(a.attr("data-constrainedcategory",a.attr("data-constrainedcategory")+","+$(f).attr("data-category")),a.attr("data-constrainedby",a.attr("data-constrainedby")+","+t)))),a.hasClass("selected")&&(it=$("#category_"+a.attr("data-category")).children("div.row").children("div.config-option"),it.length===0&&(it=$("#category_"+a.attr("data-category")).children("div.tab-pane").children("div.row").children("div.config-option")),at=it.children("div.card.js-product-selector"),a.removeClass("selected"),yt=systemGraph.find(function(n){return n.p===parseInt(a.attr("data-product"))&&n.c===parseInt(a.attr("data-category"))}),yt.m===!0||yt.o===!0||function(){var f=$(a),u=$(),v=!1;_.forEach(at,function(n){var y,it,p;if($(n).attr("data-category")===a.attr("data-category")&&$.inArray($(n).attr("data-product")+"-"+$(n).attr("data-category"),c)===-1&&($(n).attr("data-constrainedcategory")===null||$(n).attr("data-constrainedcategory").length===0)&&($(n).attr("data-constrainedby")===null||$(n).attr("data-constrainedby")===undefined||$(n).attr("data-constrainedby")!==undefined&&$(n).attr("data-constrainedby")==="")&&v===!1){if($(n).data("category")!==l&&$(n).data("container")!==l)return $(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p")),$(n).find("p.cost").html(""),u=$(n),!1;var bt=i.find('[data-productid="'+$(h).attr("data-product")+'"][data-specificationlabelid="'+ht+'"]').data("slvalue")||0,at=i.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+et+'"]').data("slvalue")||0,yt=i.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+ot+'"]').data("slvalue")||0,pt=i.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+st+'"]').data("slvalue")||0,wt=i.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+tt+'"]').data("slvalue")||0,kt=i.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+ft+'"]').data("slvalue")||0;if(e=kt+bt,e>=w+b+k+d&&at>=ct&&yt+pt>=lt){for(y=[],$("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"][data-gpci="0"]').each(function(){var t=this,n;($(this).attr("data-gpci")!==$(this).attr("data-configuration")||$(this).attr("data-configuration")==="0"&&$(this).attr("data-product")!=="")&&function(){var u=i.find('[data-productid="'+$(t).attr("data-product")+'"][data-specificationlabelid="'+vt+'"]').data("slvalue")||0,r=y.findIndex(function(n){return n.productid===$(t).attr("data-product")&&n.width<u});r!==-1?y[r].width=y[r].width+1:(n={},n.productid=$(t).attr("data-product"),n.lenght=$(t).data("configuration"),n.width=1,n.found=!1,y.push(n))}()}),it=!0,p=0;p<y.length;p++)$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"]').each(function(){var u,i,r;if(parseInt($(this).attr("data-gpci"))>=y[p].lenght){if(u=$(this).data("slot")+1,y[p].width===1)return $(this).attr("data-gpci",0),$(this).attr("data-product",y[p].productid),y[p].found=!0,!1;if(y[p].width===2){if(i=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+u+'"]'),$(i).length!==0){if($(i).data("gpci")>0||$(i).data("gpci")===$(i).data("configuration"))return $(this).attr("data-gpci",0),$(this).attr("data-product",y[p].productid),$(i).attr("data-gpci",0),$(i).attr("data-product",y[p].productid),y[p].found=!0,!1}else if(u<=s)return $(this).attr("data-gpci",0),$(this).attr("data-product",t),y[p].found=!0,!1}else if(y[p].width===3)if(i=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+u+'"]'),r=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+(u+1)+'"]'),$(r).length!==0){if(($(i).data("gpci")>0||$(i).data("gpci")===$(i).data("configuration"))&&($(r).data("gpci")>0||$(r).data("gpci")===$(r).data("configuration")))return $(this).attr("data-gpci",0),$(this).attr("data-product",y[p].productid),$(i).attr("data-gpci",0),$(i).attr("data-product",y[p].productid),$(r).attr("data-gpci",0),$(r).attr("data-product",y[p].productid),y[p].found=!0,!1}else if(u+1<=s)return $(this).attr("data-gpci",0),$(this).attr("data-product",t),$(i).length!==0&&($(i).attr("data-gpci",0),$(i).attr("data-product",t)),y[p].found=!0,!1}});for(p=0;p<y.length;p++)if(y[p].found===!1){it=!1;break}if(it)return rt<wt+g+nt&&($(r).removeClass("selected"),$('div.card.js-product-selector[data-category="'+o+'"]').each(function(){if(($(this).attr("data-constrainedcategory")===null||$(this).attr("data-constrainedcategory").length===0)&&($(this).attr("data-constrainedby")===null||$(this).attr("data-constrainedby")==="")){var t=$("#provider_psPowerDrawPcSL").data("value"),u=i.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+tt+'"]').data("slvalue")||0,f=i.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+t+'"]').data("slvalue")||0,n=u*f/100;if(n>=ut+g+nt)return $("#provider_psTw").attr("data-value",n),$(this).addClass("selected"),$("#sp_"+$(this).data("sp")).html($(this).data("name")),$("#img_selected_"+$(this).data("sp")).attr("src",$(this).data("p")),$(this).find("p.cost").html(""),$(r).data("product")!==$(this).data("product")&&helperApp.Modal("Configurator Change",$(this).data("categoryname")+" Updated <br> "+$(this).data("categoryname")+" has been updated to "+$(this).data("name")),!1}})),$("#pciSlots").find('[data-productid="'+$(f).attr("data-product")+'"]').each(function(){$(this).attr("data-gpci",$(this).attr("data-configuration"));$(this).attr("data-product","")}),$("#provider_mbMaxGpu").attr("data-value",at),$("#provider_mbMaxNvme").attr("data-value",yt),$("#provider_mbSBNvme").attr("data-value",pt),$("#provider_mbTw").attr("data-value",wt),$("#provider_gPCI").attr("data-value",e),$(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p")),$(n).find("p.cost").html(""),configuratorToolsApp.UpdateHardDriveSupported(),u=$(n),!1}}});u.length>0&&(_.forEach(at,function(n){if($(n).attr("data-category")===u.attr("data-category")&&$(n).attr("data-product")!==$(u).attr("data-product")){var i=systemGraph.find(function(t){return t.p===parseInt($(n).data("product"))&&t.c===parseInt($(n).data("category"))}),r=systemGraph.find(function(n){return n.p===parseInt($(u).data("product"))&&n.c===parseInt($(u).data("category"))}),t=parseFloat(i.fp)-parseFloat(r.fp);$(n).find("p.cost").html(t>0?"$+"+parseInt(t):"$"+parseInt(t))}}),$(u).data("product")!==a.data("product")&&helperApp.Modal("Configurator Change",$(u).data("categoryname")+" Updated <br> "+$(u).data("categoryname")+" has been updated to "+$(u).data("name")),n.BuildProductConstrainTrigger(u))}())):(y=a.closest("div").find("select"),y.length>0&&(idArray=_.split(y.attr("id"),"|",y.attr("id").length),pt=_.find(p.og,{og:parseInt(idArray[2])}),typeof pt!="undefined"&&pt.s===$(f).data("specificationlabelid")&&y.addClass("d-none")),wt=a.find("input:checkbox"),wt.length>0&&wt.each(function(){idArray=_.split($(this).attr("id"),"|",$(this).attr("id").length);var n=_.find(p.og,{og:parseInt(idArray[1])});typeof n!="undefined"&&n.s===$(f).data("specificationlabelid")&&$(this).addClass("d-none")})))})})}():(r=$('div.card.js-product-selector[data-constrainedby="'+t+'"]'),_.forEach(r,function(n){var i=$(n).data("product"),r=$(n).data("category"),t=$("#cp-"+i+"-"+r),u=systemGraph.find(function(n){return n.p===i&&n.c===r});typeof u!="undefined"&&t.attr("data-constrainedby")!=="case"&&(u.cd===!0?t.removeClass("constraintoverlay disabled"):$("#prd-"+i+"-"+r).removeClass("d-none"),t.attr("data-constrainedcategory",""),t.attr("data-constrainedby",""))}))},n.OptionProductValueConstrainTrigger=function(t,i,r){if(r)(function(){var r=$("#buildConstrains"),l=$("#provider_mbCategoryId").data("value"),a=$("#provider_cpuCategoryId").data("value"),o=$("#provider_psCategoryId").data("value"),v=$("#caseConstrains"),y=$("#provider_casePCISlotSL").data("value"),s=0,f=$(".js-case-selector input[name=Case]:checked"),p=parseInt(f.attr("data-caseid"))>0?parseInt(f.attr("data-caseid")):0,it=parseInt(f.attr("data-primecaseid"))>0?parseInt(f.attr("data-primecaseid")):0,u;s=p>0?v.find('[data-caseid= "'+p+'"][data-specificationlabelid="'+y+'"]').data("value")||0:v.find('[data-primecaseid= "'+it+'"][data-specificationlabelid="'+y+'"]').data("value")||0;var e=0,w=0,b=0,k=0,d=0;e=parseInt($("#provider_gPCI").attr("data-value"));w=parseInt($("#provider_ggPCI").attr("data-value"));b=parseInt($("#provider_gnPCI").attr("data-value"));k=parseInt($("#provider_gaPCI").attr("data-value"));d=parseInt($("#provider_grPCI").attr("data-value"));var rt=parseInt($("#provider_psTw").attr("data-value"))||0,ut=parseInt($("#provider_mbTw").attr("data-value"))||0,g=parseInt($("#provider_cpuTw").attr("data-value"))||0,nt=parseInt($("#provider_gpuTw").attr("data-value"))||0,tt=$("#provider_powerDrawSL").data("value"),ft=$("#provider_mbPCHLanesSL").data("value"),et=$("#provider_mbMaxGPUsSL").data("value"),ot=$("#provider_mbMaxNvmeSL").data("value"),st=$("#provider_mbSBNvmeSL").data("value"),ht=$("#provider_cpuLanesSL").data("value"),ct=parseInt($("#provider_ggpu").attr("data-value")),lt=parseInt($("#provider_gnvme").attr("data-value")),h=$('div.card.js-product-selector.selected[data-category="'+a+'"]');h.length===0&&(h=$('div.card.js-product-selector.selected[data-container="'+a+'"]'));u=$('div.card.js-product-selector.selected[data-category="'+o+'"]');u.length===0&&(u=$('div.card.js-product-selector.selected[data-container="'+o+'"]'));var at=r.find('[data-specificationlabelid="'+t+'"]'),vt=$("#provider_physicalSlotSL").data("value"),c=_.split(i,",",i.length);_.forEach(at,function(i){if($(i).attr("data-trigger")==="Match"){var f=_.split($(i).attr("data-slvalue"),",",$(i).attr("data-slvalue").length),a=_.difference(c,f);c.length>0&&f.length>0&&a.length===c.length&&function(){var a=systemGraph.find(function(n){return n.p===parseInt($(i).attr("data-productid"))&&n.c===parseInt($(i).attr("data-categoryid"))}),f=$("#cp-"+$(i).attr("data-productid")+"-"+$(i).attr("data-categoryid")),v,y,p,c,it,at;typeof a!="undefined"&&($(i).data("applyto")===0?(a.cd===!0?f.addClass("constraintoverlay disabled"):$("#prd-"+$(i).attr("data-productid")+"-"+$(i).attr("data-categoryid")).addClass("d-none"),f.attr("data-constrainedby")!=="case"&&(f.attr("data-constrainedcategory")===null||f.attr("data-constrainedcategory").length===0)&&(f.attr("data-constrainedcategory",""),f.attr("data-constrainedby","option "+t)),f.hasClass("selected")&&(v=$("#category_"+f.attr("data-category")).children("div.row").children("div.config-option"),v.length===0&&(v=$("#category_"+f.attr("data-category")).children("div.tab-pane").children("div.row").children("div.config-option")),y=v.children("div.card.js-product-selector"),f.removeClass("selected"),p=systemGraph.find(function(n){return n.p===parseInt(f.attr("data-product"))&&n.c===parseInt(f.attr("data-category"))}),p.m===!0||p.o===!0||function(){var i=$(f),t=$(),c=!1;_.forEach(y,function(n){var a,y,v;if($(n).attr("data-category")===f.attr("data-category")&&($(n).attr("data-constrainedcategory")===null||$(n).attr("data-constrainedcategory").length===0)&&($(n).attr("data-constrainedby")===null||$(n).attr("data-constrainedby")===undefined||$(n).attr("data-constrainedby")!==undefined&&$(n).attr("data-constrainedby")==="")&&c===!1){if($(n).data("category")!==l&&$(n).data("container")!==l)return $(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p")),$(n).find("p.cost").html(""),t=$(n),!1;var pt=r.find('[data-productid="'+$(h).attr("data-product")+'"][data-specificationlabelid="'+ht+'"]').data("slvalue")||0,p=r.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+et+'"]').data("slvalue")||0,it=r.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+ot+'"]').data("slvalue")||0,at=r.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+st+'"]').data("slvalue")||0,yt=r.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+tt+'"]').data("slvalue")||0,wt=r.find('[data-productid="'+$(n).attr("data-product")+'"][data-specificationlabelid="'+ft+'"]').data("slvalue")||0;if(e=wt+pt,e>=w+b+k+d&&p>=ct&&it+at>=lt){for(a=[],$("#pciSlots").find('[data-productid="'+$(i).attr("data-product")+'"][data-gpci="0"]').each(function(){var t=this,n;($(this).attr("data-gpci")!==$(this).attr("data-configuration")||$(this).attr("data-configuration")==="0"&&$(this).attr("data-product")!=="")&&function(){var u=r.find('[data-productid="'+$(t).attr("data-product")+'"][data-specificationlabelid="'+vt+'"]').data("slvalue")||0,i=a.findIndex(function(n){return n.productid===$(t).attr("data-product")&&n.width<u});i!==-1?a[i].width=a[i].width+1:(n={},n.productid=$(t).attr("data-product"),n.lenght=$(t).data("configuration"),n.width=1,n.found=!1,a.push(n))}()}),y=!0,v=0;v<a.length;v++)$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"]').each(function(){var r,t,i;if(parseInt($(this).attr("data-gpci"))>=a[v].lenght){if(r=$(this).data("slot")+1,a[v].width===1)return $(this).attr("data-gpci",0),$(this).attr("data-product",a[v].productid),a[v].found=!0,!1;if(a[v].width===2){if(t=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+r+'"]'),$(t).length!==0){if($(t).data("gpci")>0||$(t).data("gpci")===$(t).data("configuration"))return $(this).attr("data-gpci",0),$(this).attr("data-product",a[v].productid),$(t).attr("data-gpci",0),$(t).attr("data-product",a[v].productid),a[v].found=!0,!1}else if(r<=s)return $(this).attr("data-gpci",0),$(this).attr("data-product",productId),a[v].found=!0,!1}else if(a[v].width===3)if(t=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+r+'"]'),i=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+(r+1)+'"]'),$(i).length!==0){if(($(t).data("gpci")>0||$(t).data("gpci")===$(t).data("configuration"))&&($(i).data("gpci")>0||$(i).data("gpci")===$(i).data("configuration")))return $(this).attr("data-gpci",0),$(this).attr("data-product",a[v].productid),$(t).attr("data-gpci",0),$(t).attr("data-product",a[v].productid),$(i).attr("data-gpci",0),$(i).attr("data-product",a[v].productid),a[v].found=!0,!1}else if(r+1<=s)return $(this).attr("data-gpci",0),$(this).attr("data-product",productId),$(t).length!==0&&($(t).attr("data-gpci",0),$(t).attr("data-product",productId)),a[v].found=!0,!1}});for(v=0;v<a.length;v++)if(a[v].found===!1){y=!1;break}if(y)return rt<yt+g+nt&&($(u).removeClass("selected"),$('div.card.js-product-selector[data-category="'+o+'"]').each(function(){if(($(this).attr("data-constrainedcategory")===null||$(this).attr("data-constrainedcategory").length===0)&&($(this).attr("data-constrainedby")===null||$(this).attr("data-constrainedby")==="")){var t=$("#provider_psPowerDrawPcSL").data("value"),i=r.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+tt+'"]').data("slvalue")||0,f=r.find('[data-productid="'+$(this).attr("data-product")+'"][data-specificationlabelid="'+t+'"]').data("slvalue")||0,n=i*f/100;if(n>=ut+g+nt)return $("#provider_psTw").attr("data-value",n),$(this).addClass("selected"),$("#sp_"+$(this).data("sp")).html($(this).data("name")),$("#img_selected_"+$(this).data("sp")).attr("src",$(this).data("p")),$(this).find("p.cost").html(""),$(u).data("product")!==$(this).data("product")&&helperApp.Modal("Configurator Change",$(this).data("categoryname")+" Updated <br> "+$(this).data("categoryname")+" has been updated to "+$(this).data("name")),!1}})),$("#pciSlots").find('[data-productid="'+$(i).attr("data-product")+'"]').each(function(){$(this).attr("data-gpci",$(this).attr("data-configuration"));$(this).attr("data-product","")}),$("#provider_mbMaxGpu").attr("data-value",p),$("#provider_mbMaxNvme").attr("data-value",it),$("#provider_mbSBNvme").attr("data-value",at),$("#provider_mbTw").attr("data-value",yt),$("#provider_gPCI").attr("data-value",e),$(n).addClass("selected"),$("#sp_"+$(n).data("sp")).html($(n).data("name")),$("#img_selected_"+$(n).data("sp")).attr("src",$(n).data("p")),$(n).find("p.cost").html(""),configuratorToolsApp.UpdateHardDriveSupported(),t=$(n),!1}}});t.length>0&&(_.forEach(y,function(n){if($(n).attr("data-category")===t.attr("data-category")&&$(n).attr("data-product")!==$(t).attr("data-product")){var r=systemGraph.find(function(t){return t.p===parseInt($(n).data("product"))&&t.c===parseInt($(n).data("category"))}),u=systemGraph.find(function(n){return n.p===parseInt($(t).data("product"))&&n.c===parseInt($(t).data("category"))}),i=parseFloat(r.fp)-parseFloat(u.fp);$(n).find("p.cost").html(i>0?"$+"+parseInt(i):"$"+parseInt(i))}}),$(t).data("product")!==f.data("product")&&helperApp.Modal("Configurator Change",$(t).data("categoryname")+" Updated <br> "+$(t).data("categoryname")+" has been updated to "+$(t).data("name")),n.BuildProductConstrainTrigger(t))}())):(c=f.closest("div").find("select"),c.length>0&&(idArray=_.split(c.attr("id"),"|",c.attr("id").length),it=_.find(a.og,{og:parseInt(idArray[2])}),typeof it!="undefined"&&it.s===$(i).data("specificationlabelid")&&c.addClass("d-none")),at=f.find("input:checkbox"),at.length>0&&at.each(function(){idArray=_.split($(this).attr("id"),"|",$(this).attr("id").length);var n=_.find(a.og,{og:parseInt(idArray[1])});typeof n!="undefined"&&n.s===$(i).data("specificationlabelid")&&$(this).addClass("d-none")})))}()}})})();else{var u=$('div.card.js-product-selector[data-constrainedby="option '+t+'"]');_.forEach(u,function(n){var i=$(n).data("product"),r=$(n).data("category"),t=$("#cp-"+i+"-"+r),u=systemGraph.find(function(n){return n.p===i&&n.c===r});typeof u!="undefined"&&t.attr("data-constrainedby")!=="case"&&(u.cd===!0?t.removeClass("constraintoverlay disabled"):$("#prd-"+i+"-"+r).removeClass("d-none"),t.attr("data-constrainedcategory",""),t.attr("data-constrainedby",""))})}},n.CPUMbConstrainTrigger=function(n){var d=$("div.card.js-product-selector"),t=$("#buildConstrains"),o=$("#provider_mbCategoryId").data("value"),lt=$("#provider_cpuCategoryId").data("value"),s=$("#provider_psCategoryId").data("value"),h=$("#caseConstrains"),c=$("#provider_casePCISlotSL").data("value"),u=0,r=$(".js-case-selector input[name=Case]:checked"),l=parseInt(r.attr("data-caseid"))>0?parseInt(r.attr("data-caseid")):0,g=parseInt(r.attr("data-primecaseid"))>0?parseInt(r.attr("data-primecaseid")):0;u=l>0?h.find('[data-caseid= "'+l+'"][data-specificationlabelid="'+c+'"]').data("value")||0:h.find('[data-primecaseid= "'+g+'"][data-specificationlabelid="'+c+'"]').data("value")||0;var f=0,a=0,v=0,y=0,p=0;f=parseInt($("#provider_gPCI").attr("data-value"));a=parseInt($("#provider_ggPCI").attr("data-value"));v=parseInt($("#provider_gnPCI").attr("data-value"));y=parseInt($("#provider_gaPCI").attr("data-value"));p=parseInt($("#provider_grPCI").attr("data-value"));var at=parseInt($("#provider_psTw").attr("data-value"))||0,vt=parseInt($("#provider_mbTw").attr("data-value"))||0,yt=parseInt($("#provider_cpuTw").attr("data-value"))||0,pt=parseInt($("#provider_gpuTw").attr("data-value"))||0,nt=$("#provider_powerDrawSL").data("value"),tt=$("#provider_mbPCHLanesSL").data("value"),it=$("#provider_mbMaxGPUsSL").data("value"),rt=$("#provider_mbMaxNvmeSL").data("value"),ut=$("#provider_mbSBNvmeSL").data("value"),ft=$("#provider_cpuLanesSL").data("value"),et=parseInt($("#provider_ggpu").attr("data-value")),ot=parseInt($("#provider_gnvme").attr("data-value")),st=$(n),w=$('div.card.js-product-selector.selected[data-category="'+s+'"]');w.length===0&&(w=$('div.card.js-product-selector.selected[data-container="'+s+'"]'));var ht=t.find('[data-productid="'+$(n).attr("data-product")+'"]'),ct=$("#provider_physicalSlotSL").data("value"),e=[],i=!0,b=!1,k=$();return _.forEach(ht,function(r){var s=_.split($(r).attr("data-slvalue"),",",$(r).attr("data-slvalue").length);$(r).attr("data-istrigger")==="True"&&$(r).attr("data-trigger")==="Match"&&(_.forEach(d,function(i){if($(i).attr("data-category")!==$(n).attr("data-category")){var u=t.find('[data-specificationlabelid="'+$(r).attr("data-specificationlabelid")+'"][data-productid="'+$(i).attr("data-product")+'"]');_.forEach(u,function(n){var t=_.split($(n).attr("data-slvalue"),",",$(n).attr("data-slvalue").length),i=_.difference(s,t);t.length>0&&i.length===s.length&&e.push($(n).attr("data-productid")+"-"+$(n).attr("data-categoryid"))})}}),_.forEach(e,function(n){var h=_.split(n,"-",n.length),d=systemGraph.find(function(n){return n.p===parseInt(h[0])&&n.c===parseInt(h[1])}),s=$("#cp-"+h[0]+"-"+h[1]),c,w,l;typeof d!="undefined"&&$(r).data("applyto")===0&&s.hasClass("selected")&&(c=$("#category_"+s.attr("data-category")).children("div.row").children("div.config-option"),c.length===0&&(c=$("#category_"+s.attr("data-category")).children("div.tab-pane").children("div.row").children("div.config-option")),w=c.children("div.card.js-product-selector"),l=systemGraph.find(function(n){return n.p===parseInt(s.attr("data-product"))&&n.c===parseInt(s.attr("data-category"))}),l.m===!0||l.o===!0||function(){var n=$(s),r=!1;_.forEach(w,function(h){var c,w,l;if($(h).attr("data-category")===s.attr("data-category")&&$.inArray($(h).attr("data-product")+"-"+$(h).attr("data-category"),e)===-1&&r===!1&&($(h).data("category")===o||$(h).data("container")===o)){var d=t.find('[data-productid="'+$(st).attr("data-product")+'"][data-specificationlabelid="'+ft+'"]').data("slvalue")||0,g=t.find('[data-productid="'+$(h).attr("data-product")+'"][data-specificationlabelid="'+it+'"]').data("slvalue")||0,ht=t.find('[data-productid="'+$(h).attr("data-product")+'"][data-specificationlabelid="'+rt+'"]').data("slvalue")||0,lt=t.find('[data-productid="'+$(h).attr("data-product")+'"][data-specificationlabelid="'+ut+'"]').data("slvalue")||0,vt=t.find('[data-productid="'+$(h).attr("data-product")+'"][data-specificationlabelid="'+nt+'"]').data("slvalue")||0,at=t.find('[data-productid="'+$(h).attr("data-product")+'"][data-specificationlabelid="'+tt+'"]').data("slvalue")||0;if(f=at+d,f>=a+v+y+p)if(g>=et)if(ht+lt>=ot){for(c=[],$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-gpci="0"]').each(function(){var i=this,n;($(this).attr("data-gpci")!==$(this).attr("data-configuration")||$(this).attr("data-configuration")==="0"&&$(this).attr("data-product")!=="")&&function(){var u=t.find('[data-productid="'+$(i).attr("data-product")+'"][data-specificationlabelid="'+ct+'"]').data("slvalue")||0,r=c.findIndex(function(n){return n.productid===$(i).attr("data-product")&&n.width<u});r!==-1?c[r].width=c[r].width+1:(n={},n.productid=$(i).attr("data-product"),n.lenght=$(i).data("configuration"),n.width=1,n.found=!1,c.push(n))}()}),w=!0,l=0;l<c.length;l++)$("#pciSlots").find('[data-productid="'+$(h).attr("data-product")+'"]').each(function(){var t,n,i;if(parseInt($(this).attr("data-gpci"))>=c[l].lenght){if(t=$(this).data("slot")+1,c[l].width===1)return c[l].found=!0,!1;if(c[l].width===2){if(n=$("#pciSlots").find('[data-productid="'+$(h).attr("data-product")+'"][data-slot="'+t+'"]'),$(n).length!==0){if($(n).data("gpci")>0||$(n).data("gpci")===$(n).data("configuration"))return c[l].found=!0,!1}else if(t<=u)return c[l].found=!0,!1}else if(c[l].width===3)if(n=$("#pciSlots").find('[data-productid="'+$(h).attr("data-product")+'"][data-slot="'+t+'"]'),i=$("#pciSlots").find('[data-productid="'+$(h).attr("data-product")+'"][data-slot="'+(t+1)+'"]'),$(i).length!==0){if(($(n).data("gpci")>0||$(n).data("gpci")===$(n).data("configuration"))&&($(i).data("gpci")>0||$(i).data("gpci")===$(i).data("configuration")))return c[l].found=!0,!1}else if(t+1<=u)return c[l].found=!0,!1}});for(l=0;l<c.length;l++)if(c[l].found===!1){w=!1;break}if(w)return k=$(h),b=!0,!1;i=!1}else i=!1;else i=!1;else i=!1}})}())}))}),b?i=configuratorToolsApp.CheckMbHardDrivesSupported(k):i},n}({});configuratorToolsApp=function(n){return n.UpdateHardDriveSupported=function(){var n=$("#buildConstrains"),r=$("#provider_mbCategoryId").data("value"),s=$("#provider_hdcCategoryId").data("value"),h=$("#provider_rcCategoryId").data("value"),c=$("#provider_scCategoryId").data("value"),l=$("#provider_psCategoryId").data("value"),a=$(".js-case-selector input[name=Case]:checked"),u=a.attr("data-case"),t=$('div.card.js-product-selector.selected[data-category="'+r+'"]'),f;t.length===0&&(t=$('div.card.js-product-selector.selected[data-container="'+r+'"]'));var v=$('div.card.js-product-selector.selected[data-category="'+s+'"]'),y=$('div.card.js-product-selector.selected[data-category="'+h+'"]'),p=$('div.card.js-product-selector.selected[data-category="'+c+'"]'),w=$("#provider_caseHdTotal").attr("data-value"),b=$("#provider_hdcTotalAddedSL").attr("data-value"),k=$("#provider_scCryoMechanicalSL").data("value"),d=$("#provider_psMechanicalSL").data("value"),g=$("#provider_mbSataPortsSL").data("value"),nt=$("#provider_raidControllersSataSL").data("value"),tt=$('div.card.js-product-selector.selected[data-category="'+l+'"]'),it=n.find('[data-productid="'+$(v).attr("data-product")+'"][data-specificationlabelid="'+b+'"]').data("slvalue")||0,e=n.find('[data-productid="'+$(p).attr("data-product")+'"][data-specificationlabelid="'+k+'"]').data("slvalue")||0,i=n.find('[data-productid="'+$(tt).attr("data-product")+'"][data-specificationlabelid="'+d+'"]').data("slvalue")||0,rt=n.find('[data-productid="'+$(t).attr("data-product")+'"][data-specificationlabelid="'+g+'"]').data("slvalue")||0,ut=n.find('[data-productid="'+$(y).attr("data-product")+'"][data-specificationlabelid="'+nt+'"]').data("slvalue")||0,o=rt+ut;u!=="Corsair 175R"&&u!=="Corsair 220T"&&(i=0);f=parseInt(w)+parseInt(it)-parseInt(e)-parseInt(i);$("#provider_mbHdTotal").attr("data-value",o);$("#provider_scCryoMechanical").attr("data-value",e);$("#provider_psMechanical").attr("data-value",i);$("#provider_hdGlobal").attr("data-value",Math.min(f,o))},n.AvailablePhysicalPCIeSlots=function(n,t,i,r,u){var f=!1;return $("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"]').each(function(){var s,e,o;if(parseInt($(this).attr("data-gpci"))>=t){if((s=$(this).data("slot")+1,i===0)||i===1)return $(this).attr("data-gpci",0),$(this).attr("data-product",u),f=!0,!1;if(i===2){if(e=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+s+'"]'),$(e).length!==0){if($(e).data("gpci")>0||$(e).data("gpci")===$(e).data("configuration"))return $(this).attr("data-gpci",0),$(this).attr("data-product",u),$(e).attr("data-gpci",0),$(e).attr("data-product",u),f=!0,!1}else if(s<=r)return $(this).attr("data-gpci",0),$(this).attr("data-product",u),f=!0,!1}else if(i===3)if(e=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+s+'"]'),o=$("#pciSlots").find('[data-productid="'+$(n).attr("data-product")+'"][data-slot="'+(s+1)+'"]'),$(o).length!==0){if(($(e).data("gpci")>0||$(e).data("gpci")===$(e).data("configuration"))&&($(o).data("gpci")>0||$(o).data("gpci")===$(o).data("configuration")))return $(this).attr("data-gpci",0),$(this).attr("data-product",u),$(e).attr("data-gpci",0),$(e).attr("data-product",u),$(o).attr("data-gpci",0),$(o).attr("data-product",u),f=!0,!1}else if(s+1<=r)return $(this).attr("data-gpci",0),$(this).attr("data-product",u),$(e).length!==0&&($(e).attr("data-gpci",0),$(e).attr("data-product",u)),f=!0,!1}}),f},n.CheckMbHardDrivesSupported=function(n){var r=$("#buildConstrains"),b=$("#provider_hdcCategoryId").data("value"),k=$("#provider_rcCategoryId").data("value"),d=$("#provider_scCategoryId").data("value"),g=$("#provider_psCategoryId").data("value"),nt=$(n),tt=$('div.card.js-product-selector.selected[data-category="'+b+'"]'),it=$('div.card.js-product-selector.selected[data-category="'+k+'"]'),rt=$('div.card.js-product-selector.selected[data-category="'+d+'"]'),ut=$('div.card.js-product-selector.selected[data-category="'+g+'"]'),ft=$(".js-case-selector input[name=Case]:checked"),a=ft.attr("data-case"),et=$("#provider_hdcTotalAddedSL").attr("data-value"),ot=$("#provider_mbSataPortsSL").data("value"),st=$("#provider_raidControllersSataSL").data("value"),ht=$("#provider_scCryoMechanicalSL").data("value"),ct=$("#provider_psMechanicalSL").data("value"),u=r.find('[data-productid="'+$(tt).attr("data-product")+'"][data-specificationlabelid="'+et+'"]').data("slvalue")||0,h=r.find('[data-productid="'+$(rt).attr("data-product")+'"][data-specificationlabelid="'+ht+'"]').data("slvalue")||0,f=r.find('[data-productid="'+$(ut).attr("data-product")+'"][data-specificationlabelid="'+ct+'"]').data("slvalue")||0,v=r.find('[data-productid="'+$(nt).attr("data-product")+'"][data-specificationlabelid="'+ot+'"]').data("slvalue")||0,lt=r.find('[data-productid="'+$(it).attr("data-product")+'"][data-specificationlabelid="'+st+'"]').data("slvalue")||0,at=$("#provider_hdM2SataSubcategoryId").data("value"),vt=$("#provider_hdIntelOptaneSubcategoryId").data("value"),yt=$("#provider_hdNvmeSubcategoryId").data("value"),pt=$("#provider_hdMechanicalSubcategoryId").data("value"),wt=$("#provider_hdSSDSubcategoryId").data("value"),ti=$("#provider_hdPCIeSubcategoryId").data("value"),bt=$("#provider_odCategoryId").data("value"),y=parseInt($("#provider_hdMechanical").attr("data-value")),kt=parseInt($("#provider_hdSSD").attr("data-value")),e=0,o=0,s=0,c=0,p=0,l=0,w=2*y+kt,t,i;a!=="Corsair 175R"&&a!=="Corsair 220T"&&(f=0);var dt=parseInt(w)+parseInt(u)-parseInt(h)- -parseInt(f),gt=v+lt,ni=Math.min(dt,gt);return $('div.card.js-product-selector.selected[data-category="'+bt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(l+=n.data("qty")>0?n.data("qty"):1)):l+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+at+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(c+=n.data("qty")>0?n.data("qty"):1)):c+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+wt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(o+=n.data("qty")>0?n.data("qty"):1)):o+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+pt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(e+=n.data("qty")>0?n.data("qty"):1)):e+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+vt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(s+=n.data("qty")>0?n.data("qty"):1)):s+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+yt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(p+=n.data("qty")>0?n.data("qty"):1)):p+=1}),t=e+s,u>0&&(t=t<=u-h-f?0:t-(u-h-f)),i=!0,e+s>y+(u-h-f)?i=!1:t+o>ni?i=!1:o+2*t>w?i=!1:e+s+o+c+l>v&&(i=!1),i},n.CheckScHardDrivesSupported=function(n){var f=$("#buildConstrains"),g=$("#provider_hdcCategoryId").data("value"),nt=$("#provider_rcCategoryId").data("value"),w=$("#provider_mbCategoryId").data("value"),tt=$("#provider_psCategoryId").data("value"),it=$(".js-case-selector input[name=Case]:checked"),b=it.attr("data-case"),c=$('div.card.js-product-selector.selected[data-category="'+w+'"]'),t,i;c.length===0&&(c=$('div.card.js-product-selector.selected[data-container="'+w+'"]'));var rt=$('div.card.js-product-selector.selected[data-category="'+g+'"]'),ut=$('div.card.js-product-selector.selected[data-category="'+nt+'"]'),ft=$(n),et=$("#provider_hdcTotalAddedSL").attr("data-value"),ot=$("#provider_mbSataPortsSL").data("value"),st=$("#provider_raidControllersSataSL").data("value"),ht=$("#provider_scCryoMechanicalSL").data("value"),ct=$("#provider_psMechanicalSL").data("value"),lt=$('div.card.js-product-selector.selected[data-category="'+tt+'"]'),r=f.find('[data-productid="'+$(rt).attr("data-product")+'"][data-specificationlabelid="'+et+'"]').data("slvalue")||0,e=f.find('[data-productid="'+$(ft).attr("data-product")+'"][data-specificationlabelid="'+ht+'"]').data("slvalue")||0,u=f.find('[data-productid="'+$(lt).attr("data-product")+'"][data-specificationlabelid="'+ct+'"]').data("slvalue")||0,l=f.find('[data-productid="'+$(c).attr("data-product")+'"][data-specificationlabelid="'+ot+'"]').data("slvalue")||0,at=f.find('[data-productid="'+$(ut).attr("data-product")+'"][data-specificationlabelid="'+st+'"]').data("slvalue")||0,vt=$("#provider_hdM2SataSubcategoryId").data("value"),yt=$("#provider_hdIntelOptaneSubcategoryId").data("value"),pt=$("#provider_hdNvmeSubcategoryId").data("value"),wt=$("#provider_hdMechanicalSubcategoryId").data("value"),bt=$("#provider_hdSSDSubcategoryId").data("value"),ti=$("#provider_hdPCIeSubcategoryId").data("value"),kt=$("#provider_odCategoryId").data("value"),a=parseInt($("#provider_hdMechanical").attr("data-value")),dt=parseInt($("#provider_hdSSD").attr("data-value")),o=0,s=0,h=0,v=0,k=0,y=0,p=2*a+dt;b!=="Corsair 175R"&&b!=="Corsair 220T"&&(u=0);var gt=parseInt(p)+parseInt(r)-parseInt(e)-parseInt(u),ni=l+at,d=Math.min(gt,ni);return $('div.card.js-product-selector.selected[data-category="'+kt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(y+=n.data("qty")>0?n.data("qty"):1)):y+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+vt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(v+=n.data("qty")>0?n.data("qty"):1)):v+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+bt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(s+=n.data("qty")>0?n.data("qty"):1)):s+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+wt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(o+=n.data("qty")>0?n.data("qty"):1)):o+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+yt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(h+=n.data("qty")>0?n.data("qty"):1)):h+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+pt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(k+=n.data("qty")>0?n.data("qty"):1)):k+=1}),t=o+h,r>0&&(t=t<=r-e-u?0:t-(r-e-u)),i="OK",o+h>a+(r-e-u)?i="The case only has space for "+(a+(r-e-u))+" mechanical drives. ":t+s>d?i="Maximum available drives is "+d+", please reduce the number of drives selected":s+2*t>p?i="Maximum available drives on this case is "+p+", please reduce the number of drives selected":o+h+s+v+y>l&&(i="Maximum available SATA ports is "+l+", please reduce the number of drives selected"),i},n.CheckPsHardDrivesSupported=function(n){var r=$("#buildConstrains"),g=$("#provider_hdcCategoryId").data("value"),nt=$("#provider_rcCategoryId").data("value"),tt=$("#provider_scCategoryId").data("value"),p=$("#provider_mbCategoryId").data("value"),it=$(".js-case-selector input[name=Case]:checked"),w=it.attr("data-case"),c=$('div.card.js-product-selector.selected[data-category="'+p+'"]'),t,i;c.length===0&&(c=$('div.card.js-product-selector.selected[data-container="'+p+'"]'));var rt=$('div.card.js-product-selector.selected[data-category="'+g+'"]'),ut=$('div.card.js-product-selector.selected[data-category="'+nt+'"]'),ft=$('div.card.js-product-selector.selected[data-category="'+tt+'"]'),et=$("#provider_hdcTotalAddedSL").attr("data-value"),ot=$("#provider_mbSataPortsSL").data("value"),st=$("#provider_raidControllersSataSL").data("value"),ht=$("#provider_scCryoMechanicalSL").data("value"),ct=$("#provider_psMechanicalSL").data("value"),lt=$(n),u=r.find('[data-productid="'+$(rt).attr("data-product")+'"][data-specificationlabelid="'+et+'"]').data("slvalue")||0,h=r.find('[data-productid="'+$(ft).attr("data-product")+'"][data-specificationlabelid="'+ht+'"]').data("slvalue")||0,f=r.find('[data-productid="'+$(lt).attr("data-product")+'"][data-specificationlabelid="'+ct+'"]').data("slvalue")||0,l=r.find('[data-productid="'+$(c).attr("data-product")+'"][data-specificationlabelid="'+ot+'"]').data("slvalue")||0,at=r.find('[data-productid="'+$(ut).attr("data-product")+'"][data-specificationlabelid="'+st+'"]').data("slvalue")||0,vt=$("#provider_hdM2SataSubcategoryId").data("value"),yt=$("#provider_hdIntelOptaneSubcategoryId").data("value"),pt=$("#provider_hdNvmeSubcategoryId").data("value"),wt=$("#provider_hdMechanicalSubcategoryId").data("value"),bt=$("#provider_hdSSDSubcategoryId").data("value"),ti=$("#provider_hdPCIeSubcategoryId").data("value"),kt=$("#provider_odCategoryId").data("value"),b=parseInt($("#provider_hdMechanical").attr("data-value")),dt=parseInt($("#provider_hdSSD").attr("data-value")),e=0,o=0,s=0,a=0,k=0,v=0,y=2*b+dt;w!=="Corsair 175R"&&w!=="Corsair 220T"&&(f=0);var gt=parseInt(y)+parseInt(u)-parseInt(h)-parseInt(f),ni=l+at,d=Math.min(gt,ni);return $('div.card.js-product-selector.selected[data-category="'+kt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(v+=n.data("qty")>0?n.data("qty"):1)):v+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+vt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(a+=n.data("qty")>0?n.data("qty"):1)):a+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+bt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(o+=n.data("qty")>0?n.data("qty"):1)):o+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+wt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(e+=n.data("qty")>0?n.data("qty"):1)):e+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+yt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(s+=n.data("qty")>0?n.data("qty"):1)):s+=1}),$('div.card.js-product-selector.selected[data-subcategory="'+pt+'"]').each(function(){var t=$(this).closest("div").find("select"),n;t.length>0?(n=$("option:selected",t),n!==null&&(k+=n.data("qty")>0?n.data("qty"):1)):k+=1}),t=e+s,u>0&&(t=t<=u-h-f?0:t-(u-h-f)),i="OK",e+s>b+(u-h-f)?i="To select this product you will need to reduce the number of mechanical drives selected. ":t+o>d?i="Maximum available drives is "+d+", please reduce the number of drives selected":o+2*t>y?i="Maximum available drives on this case is "+y+", please reduce the number of drives selected":e+s+o+a+v>l&&(i="Maximum available SATA ports is "+l+", please reduce the number of drives selected"),i},n.ClearMultiplesOptionals=function(){var n=$("div.card.js-product-selector.selected");$.each(n,function(n,t){var u=_.split($(t).attr("id"),"-",$(t).attr("id").length),r=systemGraph.find(function(n){return n.p===parseInt(u[1])&&n.c===parseInt(u[2])}),f,i;(r.m===!0||r.o===!0)&&($(t).hasClass("selected")&&r.d===!1&&$(t).removeClass("selected"),selectedMenuContainer=$('div.card.js-product-selector.selected[data-sp="'+$(t).data("sp")+'"]'),f=$('div.card.js-product-selector[data-sp="'+$(t).data("sp")+'"]').first(),selectedMenuContainer.length>0?(i=selectedMenuContainer.first(),selectedMenuContainer.length>1?$("#sp_"+$(t).data("sp")).html(i.data("name")+" <span class= 'text-warning'> (+ "+(selectedMenuContainer.length-1)+" more selected) <\/span>"):$("#sp_"+$(t).data("sp")).html(""+i.data("name")),$("#img_selected_"+$(t).data("sp")).attr("src",$(i).data("p"))):($("#sp_"+$(t).data("sp")).html("None Selected"),$("#img_selected_"+$(t).data("sp")).attr("src",$(f).data("p"))))})},n.ResetToDefaults=function(){var r=arguments.length<=0||arguments[0]===undefined?!1:arguments[0],n=$("#provider_cpuCategoryId").data("value"),t,i;r&&(n=-1);$("#pciSlots").find('[data-productid !="0"]').each(function(){$(this).attr("data-gpci",$(this).attr("data-configuration"));$(this).attr("data-product","")});t=$("div.card.js-product-selector");$.each(t,function(t,i){$(i).data("category")!==n&&$(i).data("container")!==n&&function(){var f=_.split($(i).attr("id"),"-",$(i).attr("id").length),t=systemGraph.find(function(n){return n.p===parseInt(f[1])&&n.c===parseInt(f[2])}),e,u,r,n;t.m===!0||t.o===!0?(t.d===!0?$(i).hasClass("selected")===!1&&$(i).addClass("selected"):$(i).hasClass("selected")&&function(){$(i).removeClass("selected");$(i).find(".js-selector-option-select").find("option:eq(0)").prop("selected",!0);var n=$(i).find("input:checkbox");n.length>0&&n.each(function(){n.each(function(){$(this).is(":checked")&&$(this).prop("checked",!1)})})}(),selectedMenuContainer=$('div.card.js-product-selector.selected[data-sp="'+$(i).data("sp")+'"]'),r=$('div.card.js-product-selector[data-sp="'+$(i).data("sp")+'"]').first(),selectedMenuContainer.length>0?(n=selectedMenuContainer.first(),selectedMenuContainer.length>1?$("#sp_"+$(i).data("sp")).html(n.data("name")+" <span class= 'text-warning'> (+ "+(selectedMenuContainer.length-1)+" more selected) <\/span>"):$("#sp_"+$(i).data("sp")).html(""+n.data("name")),$("#img_selected_"+$(i).data("sp")).attr("src",$(n).data("p"))):($("#sp_"+$(i).data("sp")).html("None Selected"),$("#img_selected_"+$(i).data("sp")).attr("src",$(r).data("p")))):(t.d===!0?$(i).hasClass("selected")===!1&&($(i).addClass("selected"),e=$("#subcategories-"+$(i).attr("data-category")).children("li.nav-item").children("a.nav-link"),e.removeClass("active"),$("#subcat-"+$(i).attr("data-category")+"-"+$(i).attr("data-subcategory")+"-tab").addClass("active"),$("#subcat-"+$(i).attr("data-category")+"-"+$(i).attr("data-subcategory")+"-tab").removeClass("disabled"),u=$("#category_"+$(i).attr("data-category")).children("div.tab-pane"),u.removeClass("show"),u.removeClass("active"),$("#subcat-"+$(i).attr("data-category")+"-"+$(i).attr("data-subcategory")).addClass("show"),$("#subcat-"+$(i).attr("data-category")+"-"+$(i).attr("data-subcategory")).addClass("active")):$(i).hasClass("selected")&&function(){$(i).removeClass("selected");$(i).find(".js-selector-option-select").find("option:eq(0)").prop("selected",!0);var n=$(i).find("input:checkbox");n.length>0&&n.each(function(){n.each(function(){$(this).is(":checked")&&$(this).prop("checked",!1)})})}(),selectedMenuContainer=$('div.card.js-product-selector.selected[data-sp="'+$(i).data("sp")+'"]'),r=$('div.card.js-product-selector[data-sp="'+$(i).data("sp")+'"]').first(),selectedMenuContainer.length>0?(n=selectedMenuContainer.first(),selectedMenuContainer.length>1?$("#sp_"+$(i).data("sp")).html(n.data("name")+" <span class= 'text-warning'> (+ "+(selectedMenuContainer.length-1)+" more selected) <\/span>"):$("#sp_"+$(i).data("sp")).html(""+n.data("name")),$("#img_selected_"+$(i).data("sp")).attr("src",$(n).data("p"))):($("#sp_"+$(i).data("sp")).html("None Selected"),$("#img_selected_"+$(i).data("sp")).attr("src",$(r).data("p"))))}()});i=$("div.card.js-product-selector.selected");$.each(i,function(n,t){var i=$(t),r=$("#category_"+i.attr("data-category")).children("div.row").children("div.config-option"),u,f;r.length===0&&(r=$("#category_"+i.attr("data-category")).children("div.tab-pane").children("div.row").children("div.config-option"));u=r.children("div.card.js-product-selector");f=systemGraph.find(function(n){return n.p===i.data("product")&&n.c===i.data("category")});i.find("p.cost").html("");_.forEach(u,function(n){var r=systemGraph.find(function(t){return t.p===$(n).data("product")&&t.c===$(n).data("category")}),t;typeof r!="undefined"&&r.p!==i.data("product")&&r.m===!1&&r.o===!1&&(t=parseFloat(r.fp)-parseFloat(f.fp),t>0?$(n).find("p.cost").html("+$"+parseInt(t)):$(n).find("p.cost").html(t<0?"-$"+parseInt(t)*-1:"$"+parseInt(t)))})})},n}({});cartApp=function(n){return n.Init=function(){$('[data-toggle="tooltip"]').tooltip();var n="/services/statesforshippingestimator/";$("#CountryCode").on("change",function(){$.get(n,{id:$("#CountryCode").val()},function(n){$("#StateCode").empty();$("#StateCode").append('<option value="">--SELECT--<\/option>');_.forEach(n,function(n){$("#StateCode").append('<option value="'+n.value+'">'+n.text+"<\/option>")})});var t=$("#CountryCode option:selected").text();t.toLocaleLowerCase()==="united states"||t.toLocaleLowerCase()==="canada"?($("#pnlStateSelect").show(),$("#pnlStateText").addClass("d-none"),$("#StateCode").attr("data-val",!1)):($("#StateCode").attr("data-val",!0),$("#pnlStateText").removeClass("d-none"),$("#pnlStateSelect").hide())})},n.EmailConfiguration=function(n){$("#sendByEmailModal").modal("show");$.get("/cart/initemailconfiguration/"+n,function(n){$("#pnlSendByEmailHelper").html(n);helperApp.RefreshDOM()})},n.SendEmailConfiguration=function(){$("#sendConfigurationForm").submit(function(n){if(n.preventDefault(),n.stopImmediatePropagation(),$("#GrecaptchaResponse").val($("#g-recaptcha-response").val()),$("#sendConfigurationForm").valid()){var t={success:function(n){n==="recaptchaerror"?$("#pnlConfirmation").removeClass("d-none").html('<p class="font-weight-medium mb-0">reCaptcha validation is required.<\/p>'):n==="sent"?($("#sendConfigurationForm")[0].reset(),$("#pnlConfirmation").removeClass("d-none").html('<p class="font-weight-medium mb-0">Configuration sent!<\/p>')):$("#pnlConfirmation").removeClass("d-none").html('<p class="font-weight-medium mb-0">An error occurred while sending this configuration. We are looking into the issue.<\/p>')},error:function(n){console.log(n)}};$("#sendConfigurationForm").ajaxSubmit(t)}else helperApp.NotyError("<p class='font - weight - medium mb - 0'>Some fields in your form are required. Please complete and then submit.<\/p>")})},n.RequestShippingQuote=function(){$("#shippingEstimatorForm").submit(function(n){if(n.preventDefault(),n.stopImmediatePropagation(),$("#shippingEstimatorForm").valid()){var t={success:function(n){$("#shippingLabel").html("Shipping Quote");$("#pnlShippingHelper").html(n)},error:function(n){console.log(n)}};$("#shippingEstimatorForm").ajaxSubmit(t)}else helperApp.NotyError("Some fields in your form are required, complete and then submit...")})},n.UpdateQuantity=function(n){var i=$(n).val(),t=_.split(i,"|",2);$.post("/cart/updatecartquantity/"+t[0]+"?qty="+t[1],function(n){dataLayer.push(n.cart);dataLayer.push(n.product);helperApp.RefreshUI()})},n.AssignShippingQuote=function(){var i=_.replace($("#phSubtotal").html(),"$","").replace(",",""),r=_.replace($("#phDiscount").html(),"$","").replace(",","").replace("(","").replace(")",""),u=_.replace($("#phTaxes").html(),"$","").replace(",",""),n=parseFloat($('input[name="ServiceTypeQuote"]:checked').val()),t=$('input[name="ServiceTypeQuote"]:checked').data("weight"),f;isNaN(n)&&(n=0);(isNaN(t)||t==="undefined")&&(t=0);f={subTotal:parseFloat(i)-parseFloat(r),shippingAmount:n,address:{city:$("#ShippingEstimation_City").val(),region:$("#ShippingEstimation_StateCode").val(),postalCode:$("#ShippingEstimation_ZipCode").val(),country:$("#ShippingEstimation_CountryCode").val()}};$.ajax({url:"/cart/CalculateTax/",type:"POST",dataType:"html",data:JSON.stringify(f),contentType:"application/json; charset=utf-8"}).done(function(f){f!==0?$("#phTaxes").html("$"+f):$("#phTaxes").html("$0");u=_.replace($("#phTaxes").html(),"$","").replace(",","");var e=parseFloat(i)-parseFloat(r)+n+parseFloat(u);$("#phWeight").html(t+" lbs.");$("#phShipping").html("$"+n.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,"));$("#phTotal").html(""+e.toFixed(2).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,"));$("#shippingModal").modal("hide");$("#pnlWeight").removeClass("d-none")})},n.InitShippingEstimator=function(){$("#shippingModal").modal("show");$.get("/cart/initshippingquote/",function(n){$("#shippingLabel").html("Estimate Shipping");$("#pnlShippingHelper").html(n);helperApp.RefreshDOM();var t="/Services/StatesForShippingEstimator";$("#CountryCode").on("change",function(){$.get(t,{id:$("#CountryCode").val()},function(n){$("#StateCode").empty();$("#StateCode").append('<option value="">--SELECT--<\/option>');_.forEach(n,function(n){$("#StateCode").append('<option value="'+n.value+'">'+n.text+"<\/option>")})});var n=$("#CountryCode option:selected").text();n.toLocaleLowerCase()==="united states"||n.toLocaleLowerCase()==="canada"?($("#pnlStateSelect").show(),$("#pnlStateText").addClass("d-none"),$("#StateCode").attr("data-val",!1)):($("#StateCode").attr("data-val",!0),$("#pnlStateText").removeClass("d-none"),$("#pnlStateSelect").hide())})})},n.ReCalculateShippingQuote=function(){$.get("/cart/initshippingquote/",function(n){$("#shippingLabel").html("Estimate Shipping");$("#pnlShippingHelper").html(n);helperApp.RefreshDOM()})},n.RemoveCartItem=function(n){$.post("/cart/removecartitem/"+n,function(n){dataLayer.push(n.cart);dataLayer.push(n.product);helperApp.RefreshUI()})},n.AddToCart=function(n){var r=$(".js-case-selector input[name=Case]:checked"),g=0,rt=0,ut=0,s=0,h=0,nt=0,tt=0,ft=0,y=$(".js-group-selector"),vt=$(".js-design-selector-color li.selected"),t=$("#system").data("configuration"),yt=$("#system").data("slug"),pt=n==="Desktop"?configuratorApp.CalculateTotals():laptopApp.CalculateTotals(),wt=n==="Desktop"?configuratorApp.MaxLeadDays():laptopApp.MaxLeadDays(),et=[],it=[],c=0,l=0,ot=!1,st=0,ht="",p=0,a,e,i,u,w,b,k,ct,lt,at;r.length!==0?(r.data("primecaseid")>0&&(a=$(".js-design-selector-sidepanel input[name=PanelId]:checked"),g=parseInt(a.val()),e={},e.parentSystemConfigurationId=t,e.panelId=g,e.leadTime=a.data("leadtime"),e.price=a.data("price"),et.push(e),ht=a.data("name")),i={},c=r.data("caseid"),l=r.data("primecaseid"),ot=r.data("primecaseid")>0?!0:!1,st=r.data("orientationid"),i.parentSystemConfigurationId=t,i.primeCaseId=l,i.caseId=c,i.leadTime=r.data("leadtime"),i.price=r.data("price"),it.push(i)):(i={},c=parseInt($("#caseId").val()),i.parentSystemConfigurationId=t,i.primeCaseId=0,i.caseId=c,i.leadTime=$("#caseLeadTime").val(),i.price=$("#casePrice").val(),it.push(i));u=[];_.each(vt,function(n){var i=$(n),f;switch(i.data("token")){case 1:if(i.data("name")!=="None"){s=i.data("colorid");switch(ht){case"Tempered Glass-Aluminum":p=parseFloat(i.attr("data-panelprice"));break;case"Aluminum-Aluminum":p=parseFloat(i.attr("data-panelprice"))*2;break;case"Tempered Glass-Tempered Glass":p=0}f={};f.primeCaseColorId=parseInt(r.attr("data-primecaseid"))>0?s:0;f.caseColorId=parseInt(r.attr("data-primecaseid"))===0?s:0;f.leadTime=i.data("leadtime");f.price=parseFloat(i.data("price"))+p;f.parentSystemConfigurationId=t;u.push(f)}break;case 2:i.data("name")!=="None"&&(ut=i.data("colorid"),f={},f.interiorColorId=parseInt(i.attr("data-colorid")),f.leadTime=i.data("leadtime"),f.price=i.data("price"),f.parentSystemConfigurationId=t,u.push(f));break;case 4:i.data("name")!=="None"&&(ft=i.data("colorid"),f={},f.interiorLightingId=parseInt(i.attr("data-colorid")),f.leadTime=i.data("leadtime"),f.price=i.data("price"),f.parentSystemConfigurationId=t,u.push(f));break;case 7:i.data("name")!=="None"&&(rt=i.data("colorid"),f={},f.laserEtchingId=parseInt(i.attr("data-colorid")),f.leadTime=i.data("leadtime"),f.price=i.data("price"),f.parentSystemConfigurationId=t,u.push(f));break;case 3:_.forEach(y,function(n){if($(n).data("token")===3){if($(n).hasClass("d-none")===!1&&i.attr("data-name")!=="None"){tt=i.data("colorid");var r={};r.accentColorId=tt;r.leadTime=i.data("leadtime");r.price=i.data("price");r.parentSystemConfigurationId=t;u.push(r)}return}});break;case 5:_.forEach(y,function(n){if($(n).data("token")===5){if($(n).hasClass("d-none")===!1&&i.attr("data-name")!=="None"){nt=i.data("colorid");var r={};r.glassPrintId=nt;r.leadTime=i.data("leadtime");r.price=i.data("price");r.parentSystemConfigurationId=t;u.push(r)}return}});break;case 6:_.forEach(y,function(n){if($(n).data("token")===6){if($(n).hasClass("d-none")===!1&&i.data("name")!=="None"){h=i.data("colorid");var r={};r.texturedPrintId=h;r.leadTime=i.data("leadtime");r.price=i.data("price");r.parentSystemConfigurationId=t;u.push(r)}return}});break;case 12:_.forEach(y,function(n){if($(n).data("token")===12){if($(n).hasClass("d-none")===!1&&i.data("name")!=="None"){h=i.data("colorid");var r={};r.texturedPrintId=h;r.leadTime=i.data("leadtime");r.price=i.data("price");r.parentSystemConfigurationId=t;u.push(r)}return}})}});var d=[],f=[],bt=$("div.card.js-product-selector.selected"),o=0,v=[],kt=$("div.card.js-product-selector");if($.each(kt,function(n,t){var i=_.split($(t).attr("id"),"-",$(t).attr("id").length);$(t).data("container")===0?v.indexOf(Number(i[2]))===-1&&v.push(Number(i[2])):v.indexOf($(t).data("container"))===-1&&v.push($(t).data("container"))}),w=[{id:60,name:"CPU",validate:!1,category:"Processors"},{id:39,name:"Motherboard",validate:!1,category:"Motherboard"},{id:37,name:"Memory",validate:!1,category:"Memory"},{id:69,name:"Cooling",validate:!1,category:"System Cooling"},{id:5,name:"Fans",validate:!1,category:"System Fans"},{id:22,name:"Graphic Card",validate:!1,category:"Graphics Cards"},{id:23,name:"Operating System Drive",validate:!1,category:"Operating System Drive"},{id:58,name:"Power Supply",validate:!1,category:"Power Supply"},{id:47,name:"Operating System",validate:!1,category:"Operating System"}].filter(function(n){if(v.indexOf(n.id)!==-1)return n}),_.forEach(bt,function(n){var i={},r,u,e,s;o+=1;r=systemGraph.find(function(t){return t.p===parseInt($(n).attr("data-product"))&&t.c===parseInt($(n).attr("data-category"))});i.productId=$(n).data("product");i.categoryId=$(n).data("category");i.leadTime=r.lt;i.price=r.fp;i.parentSystemConfigurationId=t;i.displayOrder=o;i.section="Build";d.push(i);u=$(n).find("select");u.length>0&&u.each(function(){var u=$("option:selected",$(this)),n,e,o,i;u!==null&&(n={},n.parentSystemConfigurationId=t,n.parentProductId=r.p,n.leadTime=2,n.optionDescription=u.attr("data-desc"),e=_.split($(this).attr("id"),"|",$(this).attr("id").length),o=_.find(r.og,{og:parseInt(e[2])}),typeof o!="undefined"&&(e=_.split(u.attr("id"),"_",u.attr("id").length),i=_.find(o.o,{o:parseInt(e[1])}),typeof i!="undefined"&&(n.price=i.q>0?parseFloat(r.fp*(i.q-1)):parseFloat(i.a),n.quantity=i.q===0?1:i.q,n.productOptionGroupId=i.og,n.productOptionId=i.o)),f.push(n))});e=$(n).find("input:checkbox");e.length>0&&e.each(function(){var n,u,e,i;$(this).is(":checked")&&(n={},n.parentSystemConfigurationId=t,n.parentProductId=$(this).data("product"),n.leadTime=2,n.optionDescription=$(this).attr("data-desc"),n.quantity=1,u=_.split($(this).attr("id"),"|",$(this).attr("id").length),e=_.find(r.og,{og:parseInt(u[1])}),typeof e!="undefined"&&(i=_.find(e.o,{o:parseInt(u[2])}),typeof i!="undefined"&&(n.price=parseFloat(i.a),n.productOptionGroupId=i.og,n.productOptionId=i.o)),f.push(n))});s=w.findIndex(function(t){return t.category===$(n).data("categoryname")&&(t.id===$(n).data("category")||t.id===$(n).data("container"))});s!==-1&&(w[s].validate=!0)}),b="<div>Please confirm the following part is selected before adding to cart<\/div>",k=w.filter(function(n){return n.validate===!1}),k.length>0&&n==="Desktop"){k.length>1&&(b="<div>Please confirm the following parts are selected before adding to cart<\/div>");k.forEach(function(n){b+="<div>"+n.name+"<\/div>"});swal({title:"MISSING PARTS",html:!0,text:b,type:"warning",dangerMode:!0});return}ct=$("div.card.js-services-product-selector.selected");_.forEach(ct,function(n){var i={},r,u,e;o+=1;r=systemGraph.find(function(t){return t.p===parseInt($(n).attr("data-product"))&&t.c===parseInt($(n).attr("data-category"))});i.productId=$(n).data("product");i.categoryId=$(n).data("category");i.leadTime=r.lt;i.price=r.fp;i.parentSystemConfigurationId=t;i.displayOrder=o;i.section="Services";d.push(i);u=$(n).find("select");u.length>0&&u.each(function(){var u=$("option:selected",$(this)),n,e,o,i;u!==null&&(n={},n.parentSystemConfigurationId=t,n.parentProductId=r.p,n.leadTime=2,n.optionDescription=u.attr("data-desc"),e=_.split($(this).attr("id"),"|",$(this).attr("id").length),o=_.find(r.og,{og:parseInt(e[2])}),typeof o!="undefined"&&(e=_.split(u.attr("id"),"_",u.attr("id").length),i=_.find(o.o,{o:parseInt(e[1])}),typeof i!="undefined"&&(n.price=i.q>0?parseFloat(r.fp*(i.q-1)):parseFloat(i.a),n.quantity=i.q===0?1:i.q,n.productOptionGroupId=i.og,n.productOptionId=i.o)),f.push(n))});e=$(n).find("input:checkbox");e.length>0&&e.each(function(){var n,u,e,i;$(this).is(":checked")&&(n={},n.parentSystemConfigurationId=t,n.parentProductId=$(this).data("product"),n.leadTime=2,n.optionDescription=$(this).attr("data-desc"),n.quantity=1,u=_.split($(this).attr("id"),"|",$(this).attr("id").length),e=_.find(r.og,{og:parseInt(u[1])}),typeof e!="undefined"&&(i=_.find(e.o,{o:parseInt(u[2])}),typeof i!="undefined"&&(n.price=parseFloat(i.a),n.productOptionGroupId=i.og,n.productOptionId=i.o)),f.push(n))})});lt=$("div.card.js-accessories-product-selector.selected");_.forEach(lt,function(n){var i={},r,u,e;o+=1;r=systemGraph.find(function(t){return t.p===parseInt($(n).attr("data-product"))&&t.c===parseInt($(n).attr("data-category"))});i.productId=$(n).data("product");i.categoryId=$(n).data("category");i.leadTime=r.lt;i.price=r.fp;i.parentSystemConfigurationId=t;i.displayOrder=o;i.section="Accessories";d.push(i);u=$(n).find("select");u.length>0&&u.each(function(){var u=$("option:selected",$(this)),n,e,o,i;u!==null&&(n={},n.parentSystemConfigurationId=t,n.parentProductId=r.p,n.leadTime=2,n.optionDescription=u.attr("data-desc"),e=_.split($(this).attr("id"),"|",$(this).attr("id").length),o=_.find(r.og,{og:parseInt(e[2])}),typeof o!="undefined"&&(e=_.split(u.attr("id"),"_",u.attr("id").length),i=_.find(o.o,{o:parseInt(e[1])}),typeof i!="undefined"&&(n.price=i.q>0?parseFloat(r.fp*(i.q-1)):parseFloat(i.a),n.quantity=i.q===0?1:i.q,n.productOptionGroupId=i.og,n.productOptionId=i.o)),f.push(n))});e=$(n).find("input:checkbox");e.length>0&&e.each(function(){var n,u,e,i;$(this).is(":checked")&&(n={},n.parentSystemConfigurationId=t,n.parentProductId=$(this).data("product"),n.leadTime=2,n.optionDescription=$(this).attr("data-desc"),n.quantity=1,u=_.split($(this).attr("id"),"|",$(this).attr("id").length),e=_.find(r.og,{og:parseInt(u[1])}),typeof e!="undefined"&&(i=_.find(e.o,{o:parseInt(u[2])}),typeof i!="undefined"&&(n.price=parseFloat(i.a),n.productOptionGroupId=i.og,n.productOptionId=i.o)),f.push(n))})});at={configurationId:$("#phConfiguration").attr("data-configuration"),systemConfigurationId:t,slug:yt,caseId:c,primeCaseId:l,isPrime:ot,primeCaseOrientationId:st,caseColorId:l===0?s:0,primeCaseColorId:l>0?s:0,panelId:g,price:pt,leadTime:wt,laserEtchingId:rt,interiorColorId:ut,texturedPrintSides:0,texturedPrintId:h,glassPrintSides:0,glassPrintId:nt,accentColorId:tt,interiorLightingId:ft,technologyFilter:"",configurationItems:d,designItems:u,caseItems:it,optionItems:f,panelItems:et,orientationItems:[]};$.ajax({url:"/cart/addtocart/",type:"POST",dataType:"json",data:JSON.stringify(at),contentType:"application/json; charset=utf-8",beforeSend:function(){helperApp.ajaxIndicatorStart()},complete:function(){helperApp.ajaxIndicatorStop()},success:function(n){dataLayer.push(n.cart);n.coupon!==undefined&&dataLayer.push(n.coupon);dataLayer.push(n.product);window.location.href="/cart/"}})},n.SaveConfiguration=function(){swal({title:"WARNING",text:"Are you sure you want to leave this page? Any choices you made will be lost.",type:"warning",showCancelButton:!0,confirmButtonClass:"btn-success",confirmButtonText:"Yes, Proceed!",cancelButtonClass:"btn-outline-light",cancelButtonText:"Cancel",closeOnConfirm:!0,closeOnCancel:!0},function(n){n&&function(){var t=$(".js-case-selector input[name=Case]:checked"),p=0,nt=0,tt=0,s=0,w=0,b=0,k=0,it=0,d=$(".js-group-selector"),ct=$(".js-design-selector-color li.selected"),n=$("#system").data("configuration"),h=$("#phLeadTime"),c=$("#phSubTotals"),lt=parseInt(c.attr("data-case"))+parseInt(c.attr("data-design"))+parseInt(c.attr("data-build"))+parseInt(c.attr("data-services"))+parseInt(c.attr("data-accessories")),at=Math.max(parseInt(h.attr("data-accessories")),parseInt(h.attr("data-case")),parseInt(h.attr("data-design")),parseInt(h.attr("data-build")),parseInt(h.attr("data-services"))),rt=[],g=[],ut=[],l=0,a=0,ft=!1,et=0,v,f,e,i,r,ot,st,ht;t.length!==0?(t.data("primecaseid")>0&&(v=$(".js-design-selector-sidepanel input[name=PanelId]:checked"),p=parseInt(v.val()),f={},f.parentSystemConfigurationId=n,f.panelId=p,f.leadTime=v.data("leadtime"),f.price=v.data("price"),rt.push(f)),i={},l=t.data("caseid"),a=t.data("primecaseid"),ft=t.data("primecaseid")>0?!0:!1,et=t.data("orientationid"),i.parentSystemConfigurationId=n,i.primeCaseId=t.data("primecaseid"),i.caseId=t.data("caseid"),i.leadTime=t.data("leadtime"),i.price=t.data("price"),g.push(i),e={},e.parentSystemConfigurationId=n,e.primeCaseOrientationId=t.data("orientationid"),e.leadTime=t.data("leadtime"),e.price=t.data("price"),ut.push(e)):(i={},l=parseInt($("#caseId").val()),i.parentSystemConfigurationId=n,i.primeCaseId=0,i.caseId=l,i.leadTime=$("#caseLeadTime").val(),i.price=$("#casePrice").val(),g.push(i));r=[];_.each(ct,function(i){var u=$(i),f;switch(u.data("token")){case 1:u.data("name")!=="None"&&(s=u.data("colorid"),f={},f.primeCaseColorId=parseInt(t.attr("data-primecaseid"))>0?s:0,f.caseColorId=parseInt(t.attr("data-primecaseid"))===0?s:0,f.leadTime=u.data("leadtime"),f.price=u.data("price"),f.parentSystemConfigurationId=n,r.push(f));break;case 2:u.data("name")!=="None"&&(tt=u.data("colorid"),f={},f.interiorColorId=parseInt(u.attr("data-colorid")),f.leadTime=u.data("leadtime"),f.price=u.data("price"),f.parentSystemConfigurationId=n,r.push(f));break;case 4:u.data("name")!=="None"&&(it=u.data("colorid"),f={},f.interiorLightingId=parseInt(u.attr("data-colorid")),f.leadTime=u.data("leadtime"),f.price=u.data("price"),f.parentSystemConfigurationId=n,r.push(f));break;case 7:u.data("name")!=="None"&&(nt=u.data("colorid"),f={},f.laserEtchingId=parseInt(u.attr("data-colorid")),f.leadTime=u.data("leadtime"),f.price=u.data("price"),f.parentSystemConfigurationId=n,r.push(f));break;case 3:_.forEach(d,function(t){if($(t).data("token")===3){if($(t).hasClass("d-none")===!1&&u.attr("data-name")!=="None"){k=u.data("colorid");var i={};i.accentColorId=k;i.leadTime=u.data("leadtime");i.price=u.data("price");i.parentSystemConfigurationId=n;r.push(i)}return}});break;case 5:_.forEach(d,function(t){if($(t).data("token")===5){if($(t).hasClass("d-none")===!1&&u.attr("data-name")!=="None"){b=u.data("colorid");var i={};i.glassPrintId=b;i.leadTime=u.data("leadtime");i.price=u.data("price");i.parentSystemConfigurationId=n;r.push(i)}return}});break;case 6:_.forEach(d,function(t){if($(t).data("token")===6){if($(t).hasClass("d-none")===!1&&u.data("name")!=="None"){w=$(t).data("colorid");var i={};i.texturedPrintId=w;i.leadTime=u.data("leadtime");i.price=u.data("price");i.parentSystemConfigurationId=n;r.push(i)}return}})}});var y=[],u=[],vt=$("div.card.js-product-selector.selected"),o=0;_.forEach(vt,function(t){var i={},r,f,e;o+=1;r=systemGraph.find(function(n){return n.p===parseInt($(t).attr("data-product"))&&n.c===parseInt($(t).attr("data-category"))});i.productId=$(t).data("product");i.categoryId=$(t).data("category");i.leadTime=r.lt;i.price=r.fp;i.parentSystemConfigurationId=n;i.displayOrder=o;y.push(i);f=$(t).find("select");f.length>0&&f.each(function(){var f=$("option:selected",$(this)),t,e,o,i;f!==null&&(t={},t.parentSystemConfigurationId=n,t.parentProductId=r.p,t.leadTime=2,t.optionDescription=f.attr("data-desc"),e=_.split($(this).attr("id"),"|",$(this).attr("id").length),o=_.find(r.og,{og:parseInt(e[2])}),typeof o!="undefined"&&(e=_.split(f.attr("id"),"_",f.attr("id").length),i=_.find(o.o,{o:parseInt(e[1])}),typeof i!="undefined"&&(t.price=i.q>0?parseFloat(r.fp*(i.q-1)):parseFloat(i.a),t.quantity=i.q===0?1:i.q,t.productOptionGroupId=i.og,t.productOptionId=i.o)),u.push(t))});e=$(t).find("input:checkbox");e.length>0&&e.each(function(){var t,f,e,i;$(this).is(":checked")&&(t={},t.parentSystemConfigurationId=n,t.parentProductId=$(this).data("product"),t.leadTime=2,t.optionDescription=$(this).attr("data-desc"),t.quantity=1,f=_.split($(this).attr("id"),"|",$(this).attr("id").length),e=_.find(r.og,{og:parseInt(f[1])}),typeof e!="undefined"&&(i=_.find(e.o,{o:parseInt(f[2])}),typeof i!="undefined"&&(t.price=parseFloat(i.a),t.productOptionGroupId=i.og,t.productOptionId=i.o)),u.push(t))})});ot=$("div.card.js-services-product-selector.selected");_.forEach(ot,function(t){var i={},r,f,e;o+=1;r=systemGraph.find(function(n){return n.p===parseInt($(t).attr("data-product"))&&n.c===parseInt($(t).attr("data-category"))});i.productId=$(t).data("product");i.categoryId=$(t).data("category");i.leadTime=r.lt;i.price=r.fp;i.parentSystemConfigurationId=n;i.displayOrder=o;y.push(i);f=$(t).find("select");f.length>0&&f.each(function(){var f=$("option:selected",$(this)),t,e,o,i;f!==null&&(t={},t.parentSystemConfigurationId=n,t.parentProductId=r.p,t.leadTime=2,t.optionDescription=f.attr("data-desc"),e=_.split($(this).attr("id"),"|",$(this).attr("id").length),o=_.find(r.og,{og:parseInt(e[2])}),typeof o!="undefined"&&(e=_.split(f.attr("id"),"_",f.attr("id").length),i=_.find(o.o,{o:parseInt(e[1])}),typeof i!="undefined"&&(t.price=i.q>0?parseFloat(r.fp*(i.q-1)):parseFloat(i.a),t.quantity=i.q===0?1:i.q,t.productOptionGroupId=i.og,t.productOptionId=i.o)),u.push(t))});e=$(t).find("input:checkbox");e.length>0&&e.each(function(){var t,f,e,i;$(this).is(":checked")&&(t={},t.parentSystemConfigurationId=n,t.parentProductId=$(this).data("product"),t.leadTime=2,t.optionDescription=$(this).attr("data-desc"),t.quantity=1,f=_.split($(this).attr("id"),"|",$(this).attr("id").length),e=_.find(r.og,{og:parseInt(f[1])}),typeof e!="undefined"&&(i=_.find(e.o,{o:parseInt(f[2])}),typeof i!="undefined"&&(t.price=parseFloat(i.a),t.productOptionGroupId=i.og,t.productOptionId=i.o)),u.push(t))})});st=$("div.card.js-accessories-product-selector.selected");_.forEach(st,function(t){var i={},r,f,e;o+=1;r=systemGraph.find(function(n){return n.p===parseInt($(t).attr("data-product"))&&n.c===parseInt($(t).attr("data-category"))});i.productId=$(t).data("product");i.categoryId=$(t).data("category");i.leadTime=r.lt;i.price=r.fp;i.parentSystemConfigurationId=n;i.displayOrder=o;y.push(i);f=$(t).find("select");f.length>0&&f.each(function(){var f=$("option:selected",$(this)),t,e,o,i;f!==null&&(t={},t.parentSystemConfigurationId=n,t.parentProductId=r.p,t.leadTime=2,t.optionDescription=f.attr("data-desc"),e=_.split($(this).attr("id"),"|",$(this).attr("id").length),o=_.find(r.og,{og:parseInt(e[2])}),typeof o!="undefined"&&(e=_.split(f.attr("id"),"_",f.attr("id").length),i=_.find(o.o,{o:parseInt(e[1])}),typeof i!="undefined"&&(t.price=i.q>0?parseFloat(r.fp*(i.q-1)):parseFloat(i.a),t.quantity=i.q===0?1:i.q,t.productOptionGroupId=i.og,t.productOptionId=i.o)),u.push(t))});e=$(t).find("input:checkbox");e.length>0&&e.each(function(){var t,f,e,i;$(this).is(":checked")&&(t={},t.parentSystemConfigurationId=n,t.parentProductId=$(this).data("product"),t.leadTime=2,t.optionDescription=$(this).attr("data-desc"),t.quantity=1,f=_.split($(this).attr("id"),"|",$(this).attr("id").length),e=_.find(r.og,{og:parseInt(f[1])}),typeof e!="undefined"&&(i=_.find(e.o,{o:parseInt(f[2])}),typeof i!="undefined"&&(t.price=parseFloat(i.a),t.productOptionGroupId=i.og,t.productOptionId=i.o)),u.push(t))})});ht={systemConfigurationId:n,caseId:l,primeCaseId:a,isPrime:ft,primeCaseOrientationId:et,caseColorId:a===0?s:0,primeCaseColorId:a>0?s:0,panelId:p,price:lt,leadTime:at,laserEtchingId:nt,interiorColorId:tt,texturedPrintSides:0,texturedPrintId:w,glassPrintSides:0,glassPrintId:b,accentColorId:k,interiorLightingId:it,configurationItems:y,designItems:r,caseItems:g,optionItems:u,panelItems:rt,orientationItems:ut};$.ajax({url:"/services/saveconfigurations/",type:"POST",dataType:"json",data:JSON.stringify(ht),contentType:"application/json; charset=utf-8",success:function(n){window.location.href=n}})}()})},n.StartOver=function(){swal({title:"WARNING",text:"Are you sure you want to reset your configuration? Any previous choices will be lost.",type:"warning",showCancelButton:!0,confirmButtonClass:"btn-success",confirmButtonText:"Yes, Proceed!",cancelButtonClass:"btn-outline-light",cancelButtonText:"Cancel",closeOnConfirm:!0,closeOnCancel:!0},function(n){n&&helperApp.RefreshUI()})},n.LoadConfiguration=function(){swal({title:"WARNING",text:"Are you sure you want to leave this page? Any choices you made will be lost.",type:"warning",showCancelButton:!0,confirmButtonClass:"btn-success",confirmButtonText:"Yes, Proceed!",cancelButtonClass:"btn-outline-light",cancelButtonText:"Cancel",closeOnConfirm:!0,closeOnCancel:!0},function(n){n&&(window.location.href="/myorigin/configurations/")})},n.ApplyCoupon=function(){$.post("/cart/applycoupon/"+$("#CartId").val()+"?code="+$("#couponcode").val(),function(n){n.url!==""?(dataLayer.push({event:"couponCode",couponCode:$("#couponcode").val()}),window.location.href=n.url):$("#phCounponMsg").removeClass("d-none").html(n.message);$("#couponcode").val("")})},n.PrintToPdf=function(n){$.post("/cart/printconfigurationquote/"+n,function(){})},n}({})