(function(a,b,c,d,e,f,g){functionh(a,b,c,d,e){returnq(a,a,c,d,b,a.defaultView.pageXOffset,a.defaultView.pageYOffset).then(function(f){J("Document cloned");varg=Wb+e,h="["+g+"='"+e+"']";a.querySelector(h).removeAttribute(g);varj=f.contentWindow,k=j.document.querySelector(h),l=Promise.resolve("function"==typeofb.onclone?b.onclone(j.document):!0);returnl.then(function(){returni(k,f,b,c,d)})})}functioni(a,c,d,e,f){varg=c.contentWindow,h=newMb(g.document),i=newH(d,h),n=R(a),o="view"===d.type?e:l(g.document),p="view"===d.type?f:m(g.document),q=newd.renderer(o,p,i,d,b),r=newT(a,q,h,i,d);returnr.ready.then(function(){J("Finished rendering");varb;returnb="view"===d.type?k(q.canvas,{width:q.canvas.width,height:q.canvas.height,top:0,left:0,x:0,y:0}):a===g.document.body||a===g.document.documentElement||null!=d.canvas?q.canvas:k(q.canvas,{width:null!=d.width?d.width:n.width,height:null!=d.height?d.height:n.height,top:n.top,left:n.left,x:g.pageXOffset,y:g.pageYOffset}),j(c,d),b})}functionj(a,b){b.removeContainer&&(a.parentNode.removeChild(a),J("Cleaned up container"))}functionk(a,c){vard=b.createElement("canvas"),e=Math.min(a.width-1,Math.max(0,c.left)),f=Math.min(a.width,Math.max(1,c.left+c.width)),g=Math.min(a.height-1,Math.max(0,c.top)),h=Math.min(a.height,Math.max(1,c.top+c.height));returnd.width=c.width,d.height=c.height,J("Cropping canvas at:","left:",c.left,"top:",c.top,"width:",f-e,"height:",h-g),J("Resulting crop with width",c.width,"and height",c.height," with x",e,"and y",g),d.getContext("2d").drawImage(a,e,g,f-e,h-g,c.x,c.y,f-e,h-g),d}functionl(a){returnMath.max(Math.max(a.body.scrollWidth,a.documentElement.scrollWidth),Math.max(a.body.offsetWidth,a.documentElement.offsetWidth),Math.max(a.body.clientWidth,a.documentElement.clientWidth))}functionm(a){returnMath.max(Math.max(a.body.scrollHeight,a.documentElement.scrollHeight),Math.max(a.body.offsetHeight,a.documentElement.offsetHeight),Math.max(a.body.clientHeight,a.documentElement.clientHeight))}functionn(){return"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"}functiono(){returnb.documentMode&&b.documentMode<=9}functionp(a,c){for(vard=3===a.nodeType?b.createTextNode(a.nodeValue):a.cloneNode(!1),e=a.firstChild;e;)(c===!0||1!==e.nodeType||"SCRIPT"!==e.nodeName)&&d.appendChild(p(e,c)),e=e.nextSibling;returnd}functionq(a,b,c,d,e,f,g){v(a);varh=o()?p(a.documentElement,e.javascriptEnabled):a.documentElement.cloneNode(!0),i=b.createElement("iframe");returni.className="html2canvas-container",i.style.visibility="hidden",i.style.position="fixed",i.style.left="-10000px",i.style.top="0px",i.style.border="0",i.width=c,i.height=d,i.scrolling="no",b.body.appendChild(i),newPromise(function(b){varc=i.contentWindow.document;r(a.documentElement,h,"textarea"),r(a.documentElement,h,"select"),i.contentWindow.onload=i.onload=function(){vard=setInterval(function(){c.body.childNodes.length>0&&(w(a,c),clearInterval(d),"view"===e.type&&i.contentWindow.scrollTo(f,g),b(i))},50)},c.open(),c.write("<!DOCTYPE html><html></html>"),s(a,f,g),c.replaceChild(e.javascriptEnabled===!0?c.adoptNode(h):x(c.adoptNode(h)),c.documentElement),c.close()})}functionr(a,b,c){for(vard=a.getElementsByTagName(c),e=b.getElementsByTagName(c),f=d.length,g=0;f>g;g++)e[g].value=d[g].value}functions(a,b,c){!a.defaultView||b===a.defaultView.pageXOffset&&c===a.defaultView.pageYOffset||a.defaultView.scrollTo(b,c)}functiont(b,c,d,e,f,g){returnnewDb(b,c,a.document).then(u(b)).then(function(a){returnq(a,d,e,f,g,0,0)})}functionu(a){returnfunction(c){vard,e=newDOMParser;try{d=e.parseFromString(c,"text/html")}catch(f){J("DOMParser not supported, falling back to createHTMLDocument"),d=b.implementation.createHTMLDocument("");try{d.open(),d.write(c),d.close()}catch(g){J("createHTMLDocument write not supported, falling back to document.body.innerHTML"),d.body.innerHTML=c}}varh=d.querySelector("base");if(!h||!h.href.host){vari=d.createElement("base");i.href=a,d.head.insertBefore(i,d.head.firstChild)}returnd}}functionv(a){[].slice.call(a.querySelectorAll("canvas"