(function(){window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozAnimationFrame||window.oAnimationFrame||window.msAnimationFrame||function(o){window.setTimeout(o,20)}}();function eo(){if(/MSIE (\d+\.\d+);/.test(navigator.userAgent)){var o=new Number(RegExp.$1);if(o>=9)return!1;if(o>=8)return!0;if(o>=7)return!0;if(o>=6)return!0;if(o>=5)return!0}else return!1}function Y(o,e,t){o.addEventListener?o.addEventListener(e,t,!1):o.attachEvent&&o.attachEvent("on"+e,t)}function no(o,e,t){o.removeEventListener?o.removeEventListener(e,t,!1):o.detachEvent&&o.detachEvent("on"+e,t)}function Mt(o,e){var t;document.createEvent?(t=document.createEvent("HTMLEvents"),t.initEvent(e,!0,!0)):(t=document.createEventObject(),t.eventType=e),t.eventName=e,o.dispatchEvent?o.dispatchEvent(t):o.fireEvent&&o.fireEvent("on"+t.eventType,t)}function n(o,e){for(var t in e)o.style[t]=e[t]}function F(o){return o.offsetWidth}function E(o){return o.offsetHeight}function B(o,e){o.style.width=typeof e=="number"?e+"px":e}function it(o,e){o.style.height=typeof e=="number"?e+"px":e}function et(o){var e=o.getBoundingClientRect();return{top:e.top+window.pageYOffset,left:e.left+window.pageXOffset}}function At(o){return{top:o.offsetTop,left:o.offsetLeft}}function z(o,e){o.appendChild(e)}function pt(o){o&&o.parentNode&&o.parentNode.removeChild(o)}function O(o,e){o.classList.add(e)}function so(o,e){o.classList.remove(e)}var Lt=new WeakMap;function Qt(o,e,t){Lt.has(o)||Lt.set(o,{}),Lt.get(o)[e]=t}function It(o,e){var t=Lt.get(o);return t?t[e]:void 0}function A(o,e){return o.getAttribute(e)}function Nt(o,e,t){o.setAttribute(e,t)}function ao(o,e){o.removeAttribute(e)}function po(o,e){o.innerHTML=e}function lt(o,e,t){var r=1,y=setInterval(function(){r<=.05?(clearInterval(y),n(o,{display:"none",opacity:1}),t&&t()):(r-=r*.1,n(o,{opacity:r}))},1e3/60)}function rt(o,e,t,r){var y=parseFloat(o.style.opacity)||0,f=t-y,c=null;function g(L){c||(c=L);var H=(L-c)/e,d=y+f*H;n(o,{opacity:d}),H<1?requestAnimationFrame(g):n(o,{opacity:t})}requestAnimationFrame(g)}function K(o){return document.createElement(o)}function Ut(o,e){return e=e||document,e.querySelector(o)}function lo(o,e){return e=e||document,Array.prototype.slice.call(e.querySelectorAll(o))}function Tt(o,e){this.xzoom=!0;var t=this,r,y=null,f,c,g,L,H,d,m,C,h,Xt,Yt,G,P,x,R,a,Q,ft,qt,ct=[],ut=0,Ct=0,nt,w,v,$,S,k,I,N,U,V,j,tt,Z,D,Rt,T=0,_,J,st,dt=0,ht=0,Wt=0,bt=0,Ht=0,zt=0,Zt=0,Dt=0,_t=0,Bt=0,St=eo(),ro=/MSIE (\d+\.\d+);/.test(navigator.userAgent),Vt,Ot,vt,ot="",Et,q,Gt,jt,M,X,gt,mt,kt,Pt;this.adaptive=function(){(M===0||X===0)&&(n(o,{width:"",height:""}),M=F(o),X=E(o)),xt(),Gt=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,jt=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,gt=F(o),mt=E(o);var i=!1;(M>Gt||X>jt)&&(i=!0),gt>M&&(gt=M),mt>X&&(mt=X),i?B(o,"100%"):M!==0&&B(o,M),kt!="fullscreen"&&(fo()?t.options.position=kt:t.options.position=t.options.mposition),t.options.lensReverse||(Pt=t.options.adaptiveReverse&&t.options.position==t.options.mposition)};function to(){var i=document.documentElement,s=(window.pageXOffset||i.scrollLeft)-(i.clientLeft||0),p=(window.pageYOffset||i.scrollTop)-(i.clientTop||0);return{left:s,top:p}}function fo(){var i=et(o);if(t.options.zoomWidth=="auto"?g=gt:g=t.options.zoomWidth,t.options.zoomHeight=="auto"?L=mt:L=t.options.zoomHeight,t.options.position.substr(0,1)=="#"?y=Ut(t.options.position):y=null,y)return!0;switch(kt){case"lens":case"inside":return!0;case"top":d=i.top,m=i.left,C=d-L,h=m;break;case"left":d=i.top,m=i.left,C=d,h=m-g;break;case"bottom":d=i.top,m=i.left,C=d+mt,h=m;break;case"right":default:d=i.top,m=i.left,C=d,h=m+gt}return!(h+g>Gt||h<0)}this.xscroll=function(i){if(i.preventDefault(),G=i.pageX||i.originalEvent.pageX,P=i.pageY||i.originalEvent.pageY,i.xscale)T=i.xscale,Kt(G,P);else{var s=-i.detail||i.wheelDelta||i.xdelta,p=G,l=P;St&&(p=Vt,l=Ot),s>0?s=-.05:s=.05,T+=s,Kt(p,l)}};function $t(){if(t.options.lensShape==="circle"&&t.options.position==="lens"){t.options.initialLensWidth!=="auto"&&t.options.initialLensHeight!=="auto"&&!isNaN(t.options.initialLensWidth)&&isNaN(t.options.initialLensHeight),S=k=Math.max(S,k);var i=(S+Math.max(V,U)*2)/2;n(v,{"-moz-border-radius":i+"px","-webkit-border-radius":i+"px","border-radius":i+"px"})}}function Jt(i,s,p,l){if(t.options.position==="lens"){var u=-(i-m)*j+S/2,W=-(s-d)*tt+k/2,wt=S-p,b=k-l;u=Math.max(wt,Math.min(0,u)),W=Math.max(b,Math.min(0,W)),n(w,{top:W+"px",left:u+"px"}),t.options.bg&&(n(v,{"background-image":"url("+A(w,"src")+")","background-repeat":"no-repeat","background-position":-(i-m)*j+S/2+"px "+(-(s-d)*tt+k/2)+"px"}),p&&l&&n(v,{"background-size":p+"px "+l+"px"}))}else{var u=-I*j,W=-N*tt,wt=g-p,b=L-l;u=Math.max(wt,Math.min(0,u)),W=Math.max(b,Math.min(0,W)),n(w,{top:W+"px",left:u+"px"})}}function Kt(i,s){T<-1&&(T=-1),T>1&&(T=1);var p,l,u;Z<D?(p=Z-(Z-1)*T,l=g*p,u=l/Rt):(p=D-(D-1)*T,u=L*p,l=u*Rt),st?(dt=i,ht=s,Wt=l,bt=u):(st||(Ht=Wt=l,zt=bt=u),j=l/f,tt=u/c,S=t.options.initialLensWidth!=="auto"&&!isNaN(t.options.initialLensWidth)?parseFloat(t.options.initialLensWidth)/p:g/j,k=t.options.initialLensHeight!=="auto"&&!isNaN(t.options.initialLensHeight)?parseFloat(t.options.initialLensHeight)/p:L/tt,$t(),Ft(i,s),B(w,l),it(w,u),B(v,S),it(v,k),n(v,{top:N-V+"px",left:I-U+"px"}),n($,{top:-N+"px",left:-I+"px"}),Jt(i,s,l,u))}function oo(){var i=Zt,s=Dt,p=_t,l=Bt,u=Ht,W=zt;i+=(dt-i)/t.options.smoothLensMove,s+=(ht-s)/t.options.smoothLensMove,p+=(dt-p)/t.options.smoothZoomMove,l+=(ht-l)/t.options.smoothZoomMove,u+=(Wt-u)/t.options.smoothScale,W+=(bt-W)/t.options.smoothScale,j=u/f,tt=W/c,S=t.options.initialLensWidth!=="auto"&&!isNaN(t.options.initialLensWidth)?parseFloat(t.options.initialLensWidth)/(Z<D?Z-(Z-1)*T:D-(D-1)*T):g/j,k=t.options.initialLensHeight!=="auto"&&!isNaN(t.options.initialLensHeight)?parseFloat(t.options.initialLensHeight)/(Z<D?Z-(Z-1)*T:D-(D-1)*T):L/tt,$t(),Ft(i,s),B(w,u),it(w,W),B(v,S),it(v,k),n(v,{top:N-V+"px",left:I-U+"px"}),n($,{top:-N+"px",left:-I+"px"}),Ft(p,l),Jt(i,s,u,W),Zt=i,Dt=s,_t=p,Bt=l,Ht=u,zt=W,st&&requestAnimFrame(oo)}function Ft(i,s){i-=m,s-=d,I=i-S/2,N=s-k/2,t.options.position!="lens"&&t.options.lensCollision&&(I<0&&(I=0),f>=S&&I>f-S&&(I=f-S),f<S&&(I=f/2-S/2),N<0&&(N=0),c>=k&&N>c-k&&(N=c-k),c<k&&(N=c/2-k/2))}function xt(){x&&pt(x),a&&pt(a),q&&pt(q)}function co(i,s){switch(t.options.position=="fullscreen"?(f=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,c=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight):(f=F(o),c=E(o)),n(Q,{top:c/2-E(Q)/2+"px",left:f/2-F(Q)/2+"px"}),t.options.rootOutput||t.options.position=="fullscreen"?H=et(o):H=At(o),H.top=Math.round(H.top),H.left=Math.round(H.left),t.options.position){case"fullscreen":d=to().top,m=to().left,C=0,h=0;break;case"inside":d=H.top,m=H.left,C=0,h=0;break;case"top":d=H.top,m=H.left,C=d-L,h=m;break;case"left":d=H.top,m=H.left,C=d,h=m-g;break;case"bottom":d=H.top,m=H.left,C=d+c,h=m;break;case"right":default:d=H.top,m=H.left,C=d,h=m+f}d-=(x.offsetHeight-x.clientHeight)/2,m-=(x.offsetWidth-x.clientWidth)/2,t.options.position.substr(0,1)=="#"?y=Ut(t.options.position):y=null,!y&&t.options.position!="inside"&&t.options.position!="fullscreen"?((!t.options.adaptive||!M||!X)&&(M=f,X=c),t.options.zoomWidth=="auto"?g=f:g=t.options.zoomWidth,t.options.zoomHeight=="auto"?L=c:L=t.options.zoomHeight,C+=t.options.Yoffset,h+=t.options.Xoffset,n(a,{width:g+"px",height:L+"px",top:C+"px",left:h+"px"}),t.options.position!="lens"&&z(r,a)):t.options.position=="inside"||t.options.position=="fullscreen"?(g=f,L=c,n(a,{width:g+"px",height:L+"px"}),z(x,a)):(g=F(y),L=E(y),t.options.rootOutput?(C=et(y).top,h=et(y).left,z(r,a)):(C=At(y).top,h=At(y).left,z(y.parentNode,a)),C+=(y.offsetHeight-L-a.offsetHeight)/2,h+=(y.offsetWidth-g-a.offsetWidth)/2,n(a,{width:g+"px",height:L+"px",top:C+"px",left:h+"px"})),t.options.title&&ot!=""&&(t.options.position=="inside"||t.options.position=="lens"||t.options.position=="fullscreen"?(Xt=C,Yt=h,z(x,q)):(Xt=C+(a.offsetHeight-L)/2,Yt=h+(a.offsetWidth-g)/2,z(r,q)),n(q,{width:g+"px",height:L+"px",top:Xt+"px",left:Yt+"px"})),n(x,{width:f+"px",height:c+"px",top:d+"px",left:m+"px"}),n(R,{width:f+"px",height:c+"px"}),t.options.tint&&t.options.position!="inside"&&t.options.position!="fullscreen"?n(R,{"background-color":t.options.tint}):St&&n(R,{"background-image":"url("+A(o,"src")+")","background-color":"#fff"}),nt=new Image;var p=ro?"?r="+new Date().getTime():"";switch(nt.src=A(o,"src")+p,w=nt,n(w,{position:"absolute"}),nt=new Image,nt.src=A(o,"src"),$=nt,n($,{position:"absolute"}),B($,f),t.options.position){case"fullscreen":case"inside":z(a,w);break;case"lens":z(v,w),t.options.bg&&n(w,{display:"none"});break;default:z(a,w),z(v,$)}}this.openzoom=function(i){if(G=i.pageX,P=i.pageY,t.options.adaptive&&t.adaptive(),T=t.options.defaultScale,st=!1,x=K("div"),t.options.sourceClass!=""&&O(x,t.options.sourceClass),n(x,{position:"absolute","z-index":99999}),Q=K("div"),t.options.loadingClass!=""&&O(Q,t.options.loadingClass),n(Q,{position:"absolute"}),R=K("div"),n(R,{position:"absolute",top:0,left:0}),z(x,Q),a=K("div"),t.options.zoomClass!=""&&t.options.position!="fullscreen"&&O(a,t.options.zoomClass),n(a,{position:"absolute",overflow:"hidden",opacity:1,"z-index":99999}),t.options.title&&ot!=""&&(q=K("div"),Et=K("div"),n(q,{position:"absolute",opacity:1}),t.options.titleClass&&O(Et,t.options.titleClass),po(Et,"<span>"+ot+"</span>"),z(q,Et),t.options.fadeIn&&n(q,{opacity:0})),v=K("div"),t.options.lensClass!=""&&O(v,t.options.lensClass),n(v,{position:"absolute",overflow:"hidden"}),t.options.lens){var s=K("div");n(s,{position:"absolute",background:t.options.lens,opacity:t.options.lensOpacity,width:"100%",height:"100%",top:0,left:0,"z-index":9999}),z(v,s)}co(),t.options.position!="inside"&&t.options.position!="fullscreen"?((t.options.tint||St)&&z(x,R),t.options.fadeIn?(n(R,{opacity:0}),n(v,{opacity:0}),n(a,{opacity:0})):(n(R,{opacity:t.options.tintOpacity}),n(v,{opacity:1}),n(a,{opacity:1})),z(r,x)):(t.options.fadeIn&&n(a,{opacity:0}),z(r,x)),t.eventmove(x),t.eventleave(x);var p=E(a)+parseFloat(getComputedStyle(a).marginTop)+parseFloat(getComputedStyle(a).marginBottom)+parseFloat(getComputedStyle(a).borderTopWidth)+parseFloat(getComputedStyle(a).borderBottomWidth)+parseFloat(getComputedStyle(a).paddingTop)+parseFloat(getComputedStyle(a).paddingBottom),l=F(a)+parseFloat(getComputedStyle(a).marginLeft)+parseFloat(getComputedStyle(a).marginRight)+parseFloat(getComputedStyle(a).borderLeftWidth)+parseFloat(getComputedStyle(a).borderRightWidth)+parseFloat(getComputedStyle(a).paddingLeft)+parseFloat(getComputedStyle(a).paddingRight);switch(t.options.position){case"inside":C-=(p-E(a))/2,h-=(l-F(a))/2;break;case"top":C-=p-E(a),h-=(l-F(a))/2;break;case"left":C-=(p-E(a))/2,h-=l-F(a);break;case"bottom":h-=(l-F(a))/2;break;case"right":C-=(p-E(a))/2}n(a,{top:C+"px",left:h+"px"}),Y(w,"load",function(u){if(pt(Q),!t.options.openOnSmall&&(F(w)<g||E(w)<L))return t.closezoom(),u.preventDefault(),!1;t.options.scroll&&t.eventscroll(x),t.options.position!="inside"&&t.options.position!="fullscreen"?(z(x,v),t.options.fadeIn?(rt(R,300,t.options.tintOpacity),rt(v,300,1),rt(a,300,1)):(n(R,{opacity:t.options.tintOpacity}),n(v,{opacity:1}),n(a,{opacity:1}))):t.options.fadeIn?rt(a,300,1):n(a,{opacity:1}),t.options.title&&ot!=""&&(t.options.fadeIn?rt(q,300,1):n(q,{opacity:1}));var W=1e3;if(_=F(w),J=E(w),_<W){var wt=E(w)/_;_=W,J=W*wt,n(w,{width:"400px",height:J+"px"})}t.options.adaptive&&(f<M||c<X)&&(B($,f),it($,c),_=f/M*_,J=c/X*J,B(w,_),it(w,J)),Ht=Wt=_,zt=bt=J,Rt=_/J,Z=_/g,D=J/L;var b,yt=["padding-","border-"];V=U=0;for(var at=0;at<yt.length;at++)b=parseFloat(getComputedStyle(v)[yt[at]+"top-width"]),V+=b!==b?0:b,b=parseFloat(getComputedStyle(v)[yt[at]+"bottom-width"]),V+=b!==b?0:b,b=parseFloat(getComputedStyle(v)[yt[at]+"left-width"]),U+=b!==b?0:b,b=parseFloat(getComputedStyle(v)[yt[at]+"right-width"]),U+=b!==b?0:b;V/=2,U/=2,_t=Zt=dt=G,Bt=Dt=ht=P,Kt(G,P),t.options.smooth&&(st=!0,requestAnimFrame(oo)),t.eventclick(x)})},this.movezoom=function(i){G=i.pageX,P=i.pageY,St&&(Vt=G,Ot=P);var s=G-m,p=P-d;Pt&&(i.pageX-=(s-f/2)*2,i.pageY-=(p-c/2)*2),(s<0||s>f||p<0||p>c)&&Mt(x,"mouseleave"),t.options.smooth?(dt=i.pageX,ht=i.pageY):($t(),Ft(i.pageX,i.pageY),n(v,{top:N-V+"px",left:I-U+"px"}),n($,{top:-N+"px",left:-I+"px"}),Jt(i.pageX,i.pageY,F(w),E(w)))},this.eventdefault=function(){t.eventopen=function(i){Y(i,"mouseenter",t.openzoom)},t.eventleave=function(i){Y(i,"mouseleave",t.closezoom)},t.eventmove=function(i){Y(i,"mousemove",t.movezoom)},t.eventscroll=function(i){Y(i,"mousewheel",t.xscroll),Y(i,"DOMMouseScroll",t.xscroll),Y(i,"wheel",t.xscroll)},t.eventclick=function(i){Y(i,"click",function(s){Mt(o,"click")})}},this.eventunbind=function(){no(o,"mouseenter",t.openzoom),t.eventopen=function(){},t.eventleave=function(){},t.eventmove=function(){},t.eventscroll=function(){},t.eventclick=function(){}},this.init=function(i){t.options=Object.assign({},Tt.defaults,i),t.options.rootOutput?r=document.body:r=o.parentNode,kt=t.options.position,Pt=t.options.lensReverse&&t.options.position=="inside",t.options.smoothZoomMove<1&&(t.options.smoothZoomMove=1),t.options.smoothLensMove<1&&(t.options.smoothLensMove=1),t.options.smoothScale<1&&(t.options.smoothScale=1),t.options.initialLensWidth!=="auto"&&(!isFinite(t.options.initialLensWidth)||t.options.initialLensWidth<=0)&&(console.warn("xZoom: Invalid initialLensWidth, falling back to auto"),t.options.initialLensWidth="auto"),t.options.initialLensHeight!=="auto"&&(!isFinite(t.options.initialLensHeight)||t.options.initialLensHeight<=0)&&(console.warn("xZoom: Invalid initialLensHeight, falling back to auto"),t.options.initialLensHeight="auto"),t.options.adaptive&&Y(window,"load",function(){M=F(o),X=E(o),t.options.initialLensWidth!=="auto"&&t.options.initialLensWidth>M&&(console.warn("xZoom: initialLensWidth exceeds source image width, capping to source width"),t.options.initialLensWidth=M),t.options.initialLensHeight!=="auto"&&t.options.initialLensHeight>X&&(console.warn("xZoom: initialLensHeight exceeds source image height, capping to source height"),t.options.initialLensHeight=X),t.adaptive(),Y(window,"resize",t.adaptive)}),t.eventdefault(),t.eventopen(o)},this.destroy=function(){t.eventunbind()},this.closezoom=function(){st=!1,t.options.fadeOut?(t.options.title&&ot!=""&&lt(q),t.options.position!="inside"||t.options.position!="fullscreen"?(lt(a),lt(x,300,function(){xt()})):lt(x,300,function(){xt()})):xt()},this.gallery=function(){var i=[],s,p=0;for(s=Ct;s<ct.length;s++)i[p]=ct[s],p++;for(s=0;s<Ct;s++)i[p]=ct[s],p++;return{index:Ct,ogallery:ct,cgallery:i}};function io(i){var s=A(i,"title"),p=A(i,"xtitle");return p||s||""}this.xappend=function(i){var s=i.parentNode;ct[ut]=A(s,"href"),Qt(s,"xindex",ut),ut==0&&t.options.activeClass&&(vt=i,O(vt,t.options.activeClass)),ut==0&&t.options.title&&(ot=io(i)),ut++;function p(l){xt(),l.preventDefault(),t.options.activeClass&&(so(vt,t.options.activeClass),vt=i,O(vt,t.options.activeClass)),Ct=It(s,"xindex"),t.options.fadeTrans&&(qt=new Image,qt.src=A(o,"src"),ft=qt,n(ft,{position:"absolute",top:et(o).top+"px",left:et(o).left+"px",width:F(o)+"px",height:E(o)+"px"}),z(document.body,ft),lt(ft,200,function(){pt(ft)}));var u=A(s,"href"),W=A(i,"xpreview")||A(i,"src");ot=io(i),A(i,"title")&&Nt(o,"title",A(i,"title")),Nt(o,"xoriginal",u),ao(o,"style"),Nt(o,"src",W),t.options.adaptive&&(M=F(o),X=E(o))}t.options.hover&&Y(s,"mouseenter",p),Y(s,"click",p)},this.init(e)}Tt.defaults={position:"right",mposition:"inside",rootOutput:!0,Xoffset:0,Yoffset:0,fadeIn:!0,fadeTrans:!0,fadeOut:!1,smooth:!0,smoothZoomMove:3,smoothLensMove:1,smoothScale:6,defaultScale:0,scroll:!0,tint:!1,tintOpacity:.5,lens:!1,lensOpacity:.5,lensShape:"box",lensCollision:!0,lensReverse:!1,openOnSmall:!0,zoomWidth:"auto",zoomHeight:"auto",sourceClass:"xzoom-source",loadingClass:"xzoom-loading",lensClass:"xzoom-lens",zoomClass:"xzoom-preview",activeClass:"xactive",hover:!1,adaptive:!0,adaptiveReverse:!1,title:!1,titleClass:"xzoom-caption",bg:!1,initialLensWidth:"auto",initialLensHeight:"auto"},window.xZoom=function(o,e){var t;typeof o=="object"?t=[o]:t=lo(o);var r,y;return t.length===0||(t.forEach(function(f,c){if(c===0){if(r=f,It(r,"xzoom"))return It(r,"xzoom");r.xob=new Tt(r,e)}else r&&r.xob&&(y=f,r.xob.xappend(y))}),typeof r>"u")?!1:(Qt(r,"xzoom",r.x),Mt(r,"xzoom_ready"),r.xob)}})();