(function(a,b,c,d,e,f,g){functionh(a,b,c,d,e){returno(a,a,c,d,b).then(function(f){G("Document cloned");varg=Tb+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=newJb(g.document),i=newE(d,h),n=O(a),o="view"===d.type?e:l(g.document),p="view"===d.type?f:m(g.document),q=newRb(o,p,i,d,b),r=newQ(a,q,h,i,d);returnr.ready.then(function(){G("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),G("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,G("Cropping canvas at:","left:",c.left,"top:",c.top,"width:",f-e,"height:",h-g),G("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(a,b,c,d,e){s(a);varf=a.documentElement.cloneNode(!0),g=b.createElement("iframe");returng.className="html2canvas-container",g.style.visibility="hidden",g.style.position="fixed",g.style.left="-10000px",g.style.top="0px",g.style.border="0",g.width=c,g.height=d,g.scrolling="no",b.body.appendChild(g),newPromise(function(b){varc=g.contentWindow.document;g.contentWindow.onload=g.onload=function(){varf=setInterval(function(){c.body.childNodes.length>0&&(t(a,c),clearInterval(f),"view"===e.type&&g.contentWindow.scrollTo(d,h),b(g))},50)};vard=a.defaultView.pageXOffset,h=a.defaultView.pageYOffset;c.open(),c.write("<!DOCTYPE html><html></html>"),p(a,d,h),c.replaceChild(e.javascriptEnabled===!0?c.adoptNode(f):u(c.adoptNode(f)),c.documentElement),c.close()})}functionp(a,b,c){(b!==a.defaultView.pageXOffset||c!==a.defaultView.pageYOffset)&&a.defaultView.scrollTo(b,c)}functionq(b,c,d,e,f,g){returnnewAb(b,c,a.document).then(r(b)).then(function(a){returno(a,d,e,f,g)})}functionr(a){returnfunction(c){vard,e=newDOMParser;try{d=e.parseFromString(c,"text/html")}catch(f){G("DOMParser not supported, falling back to createHTMLDocument"),d=b.implementation.createHTMLDocument("");try{d.open(),d.write(c),d.close()}catch(g){G("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}}functions(a){[].slice.call(a.querySelectorAll("canvas"),0).forEach(function(a){a.setAttribute(Ub,"canvas-"+Vb++)})}functiont(a,b){[].slice.call(a.querySelectorAll("["+Ub+"]"),0).forEach(function(a){try{varc=b.querySelector("["+Ub+'="'+a.getAttribute(Ub)+'"]');c&&(c.width=a.width,c.height=a.height,c.getContext("2d").putImageData(a.getContext("2d").getImageData(0,0,a.width,a.height),0,0))}catch(d){G("Unable to copy canvas content from",a,d)}a.removeAttribute(Ub)})}functionu(a){return[].slice.call(a.childNodes,0).filter(v).forEach(function(b){"SCRIPT"===b.tagName