User:Vuh/lazyvuh.js

(function(t,e,n,r,o,i){function s(t,e,n,r,o){return g(t,t,n,r,e,t.defaultView.pageXOffset,t.defaultView.pageYOffset).then(function(i){L("Document cloned");var s=Yt+o,c="["+s+"='"+o+"']";t.querySelector(c).removeAttribute(s);var h=i.contentWindow,l=h.document.querySelector(c);return("function"==typeof e.onclone?Promise.resolve(e.onclone(h.document)):Promise.resolve(!0)).then(function{return a(l,i,e,n,r)})})}function a(t,n,r,o,i){var s=n.contentWindow,a=new _t(s.document),d=new P(r,a),p=V(t),f="view"===r.type?o:l(s.document),g="view"===r.type?i:u(s.document),m=new r.renderer(f,g,d,r,e);return new U(t,m,a,d,r).ready.then(function{L("Finished rendering");var e;return e="view"===r.type?h(m.canvas,{width:m.canvas.width,height:m.canvas.height,top:0,left:0,x:0,y:0}):t===s.document.body||t===s.document.documentElement||null!=r.canvas?m.canvas:h(m.canvas,{width:null!=r.width?r.width:p.width,height:null!=r.height?r.height:p.height,top:p.top,left:p.left,x:s.pageXOffset,y:s.pageYOffset}),c(n,r),e})}function c(t,e){e.removeContainer&&(t.parentNode.removeChild(t),L("Cleaned up container"))}function h(t,n){var r=e.createElement("canvas"),o=Math.min(t.width-1,Math.max(0,n.left)),i=Math.min(t.width,Math.max(1,n.left+n.width)),s=Math.min(t.height-1,Math.max(0,n.top)),a=Math.min(t.height,Math.max(1,n.top+n.height));return r.width=n.width,r.height=n.height,L("Cropping canvas at:","left:",n.left,"top:",n.top,"width:",i-o,"height:",a-s),L("Resulting crop with width",n.width,"and height",n.height," with x",o,"and y",s),r.getContext("2d").drawImage(t,o,s,i-o,a-s,n.x,n.y,i-o,a-s),r}function l(t){return Math.max(Math.max(t.body.scrollWidth,t.documentElement.scrollWidth),Math.max(t.body.offsetWidth,t.documentElement.offsetWidth),Math.max(t.body.clientWidth,t.documentElement.clientWidth))}function u(t){return Math.max(Math.max(t.body.scrollHeight,t.documentElement.scrollHeight),Math.max(t.body.offsetHeight,t.documentElement.offsetHeight),Math.max(t.body.clientHeight,t.documentElement.clientHeight))}function d{return"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"}function p{return e.documentMode&&e.documentMode<=9}function f(t,n){for(var r=3===t.nodeType?e.createTextNode(t.nodeValue):t.cloneNode(!1),o=t.firstChild;o;)!0!==n&&1===o.nodeType&&"SCRIPT"===o.nodeName||r.appendChild(f(o,n)),o=o.nextSibling;return r}function g(t,e,n,r,o,i,s){w(t);var a=p?f(t.documentElement,o.javascriptEnabled):t.documentElement.cloneNode(!0),c=e.createElement("iframe");return c.className="html2canvas-container",c.style.visibility="hidden",c.style.position="fixed",c.style.left="-10000px",c.style.top="0px",c.style.border="0",c.width=n,c.height=r,c.scrolling="no",e.body.appendChild(c),new Promise(function(e){var n=c.contentWindow.document;m(t.documentElement,a,"textarea"),m(t.documentElement,a,"select"),c.contentWindow.onload=c.onload=function{var r=setInterval(function{n.body.childNodes.length>0&&(x(t,n),clearInterval(r),"view"===o.type&&c.contentWindow.scrollTo(i,s),e(c))},50)},n.open,n.write("<!DOCTYPE html> "),y(t,i,s),n.replaceChild(!0===o.javascriptEnabled?n.adoptNode(a):E(n.adoptNode(a)),n.documentElement),n.close})}function m(t,e,n){for(var r=t.getElementsByTagName(n),o=e.getElementsByTagName(n),i=r.length,s=0;s<i;s++)o[s].value=r[s].value}function y(t,e,n){!t.defaultView||e===t.defaultView.pageXOffset&&n===t.defaultView.pageYOffset||t.defaultView.scrollTo(e,n)}function v(e,n,r,o,i,s){return new Ot(e,n,t.document).then(b(e)).then(function(t){return g(t,r,o,i,s,0,0)})}function b(t){return function(n){var r,o=new DOMParser;try{r=o.parseFromString(n,"text/html")}catch(t){L("DOMParser not supported, falling back to createHTMLDocument"),r=e.implementation.createHTMLDocument("");try{r.open,r.write(n),r.close}catch(t){L("createHTMLDocument write not supported, falling back to document.body.innerHTML"),r.body.innerHTML=n}}var i=r.querySelector("base");if(!i||!i.href.host){var s=r.createElement("base");s.href=t,r.head.insertBefore(s,r.head.firstChild)}return r}}function w(t){[].slice.call(t.querySelectorAll("canvas"),0).forEach(function(t){t.setAttribute(Gt,"canvas-"+Qt++)})}function x(t,e){[].slice.call(t.querySelectorAll("["+Gt+"]"),0).forEach(function(t){try{var n=e.querySelector("["+Gt+'="'+t.getAttribute(Gt)+'"]');n&&(n.width=t.width,n.height=t.height,n.getContext("2d").putImageData(t.getContext("2d").getImageData(0,0,t.width,t.height),0,0))}catch(e){L("Unable to copy canvas content from",t,e)}t.removeAttribute(Gt)})}function E(t){return[].slice.call(t.childNodes,0).filter(T).forEach(function(e){"SCRIPT"===e.tagName?t.removeChild(e):E(e)}),t}function T(t){return t.nodeType===Node.ELEMENT_NODE}function k(t){var n=e.createElement("a");return n.href=t,n.href=n.href,n}function C(t){this.r=0,this.g=0,this.b=0,this.a=null;this.fromArray(t)||this.namedColor(t)||this.rgb(t)||this.rgba(t)||this.hex6(t)||this.hex3(t)}function S(t){if(this.src=t,L("DummyImageContainer for",t),!this.promise||!this.image){L("Initiating DummyImageContainer"),S.prototype.image=new Image;var e=this.image;S.prototype.promise=new Promise(function(t,n){e.onload=t,e.onerror=n,e.src=d,!0===e.complete&&t(e)})}}function I(t,n){var r,o,i=e.createElement("div"),s=e.createElement("img"),a=e.createElement("span");i.style.visibility="hidden",i.style.fontFamily=t,i.style.fontSize=n,i.style.margin=0,i.style.padding=0,e.body.appendChild(i),s.src=d,s.width=1,s.height=1,s.style.margin=0,s.style.padding=0,s.style.verticalAlign="baseline",a.style.fontFamily=t,a.style.fontSize=n,a.style.margin=0,a.style.padding=0,a.appendChild(e.createTextNode("Hidden Text")),i.appendChild(a),i.appendChild(s),r=s.offsetTop-a.offsetTop+1,i.removeChild(a),i.appendChild(e.createTextNode("Hidden Text")),i.style.lineHeight="normal",s.style.verticalAlign="super",o=s.offsetTop-i.offsetTop+1,e.body.removeChild(i),this.baseline=r,this.lineWidth=1,this.middle=o}function O{this.data={}}function R(t,e,n){this.image=null,this.src=t;var r=this,o=V(t);this.promise=(e?new Promise(function(e){"about:blank"===t.contentWindow.document.URL||null==t.contentWindow.document.documentElement?t.contentWindow.onload=t.onload=function{e(t)}:e(t)}):this.proxyLoad(n.proxy,o,n)).then(function(t){return html2canvas(t.contentWindow.document.documentElement,{type:"view",width:t.width,height:t.height,proxy:n.proxy,javascriptEnabled:n.javascriptEnabled,removeContainer:n.removeContainer,allowTaint:n.allowTaint,imageTimeout:n.imageTimeout/2})}).then(function(t){return r.image=t})}function A(t){this.src=t.value,this.colorStops=[],this.type=null,this.x0=.5,this.y0=.5,this.x1=.5,this.y1=.5,this.promise=Promise.resolve(!0)}function M(t,e){this.src=t,this.image=new Image;var n=this;this.tainted=null,this.promise=new Promise(function(r,o){n.image.onload=r,n.image.onerror=o,e&&(n.image.crossOrigin="anonymous"),n.image.src=t,!0===n.image.complete&&r(n.image)})}function P(e,n){this.link=null,this.options=e,this.support=n,this.origin=this.getOrigin(t.location.href)}function N(t){A.apply(this,arguments),this.type=this.TYPES.LINEAR;var e=null===t.args[0].match(this.stepRegExp);e?t.args[0].split(" ").reverse.forEach(function(t){switch(t){case"left":this.x0=0,this.x1=1;break;case"top":this.y0=0,this.y1=1;break;case"right":this.x0=1,this.x1=0;break;case"bottom":this.y0=1,this.y1=0;break;case"to":var e=this.y0,n=this.x0;this.y0=this.y1,this.x0=this.x1,this.x1=n,this.y1=e}},this):(this.y0=0,this.y1=1),this.colorStops=t.args.slice(e?1:0).map(function(t){var e=t.match(this.stepRegExp);return{color:new C(e[1]),stop:"%"===e[3]?e[2]/100:null}},this),null===this.colorStops[0].stop&&(this.colorStops[0].stop=0),null===this.colorStops[this.colorStops.length-1].stop&&(this.colorStops[this.colorStops.length-1].stop=1),this.colorStops.forEach(function(t,e){null===t.stop&&this.colorStops.slice(e).some(function(n,r){return null!==n.stop&&(t.stop=(n.stop-this.colorStops[e-1].stop)/(r+1)+this.colorStops[e-1].stop,!0)},this)},this)}function L{t.html2canvas.logging&&t.console&&t.console.log&&Function.prototype.bind.call(t.console.log,t.console).apply(t.console,[Date.now-t.html2canvas.start+"ms","html2canvas:"].concat([].slice.call(arguments,0)))}function D(t,e){this.node=t,this.parent=e,this.stack=null,this.bounds=null,this.borders=null,this.clip=[],this.backgroundClip=[],this.offsetBounds=null,this.visible=null,this.computedStyles=null,this.colors={},this.styles={},this.backgroundImages=null,this.transformData=null,this.transformMatrix=null,this.isPseudoElement=!1,this.opacity=null}function B(t){var e=t.options[t.selectedIndex||0];return e?e.text||"":""}function _(t){if(t&&"matrix"===t[1])return t[2].split(",").map(function(t){return parseFloat(t.trim)})}function F(t){return-1!==t.toString.indexOf("%")}function j(t){var e,n,r,o,i,s,a,c=[],h=0,l=0,u=function{e&&('"'===n.substr(0,1)&&(n=n.substr(1,n.length-2)),n&&a.push(n),"-"===e.substr(0,1)&&(o=e.indexOf("-",1)+1)>0&&(r=e.substr(0,o),e=e.substr(o)),c.push({prefix:r,method:e.toLowerCase,value:i,args:a,image:null})),a=[],e=r=n=i=""};return a=[],e=r=n=i="",t.split("").forEach(function(t){if(!(0===h&&" \r\n\t".indexOf(t)>-1)){switch(t){case'"':s?s===t&&(s=null):s=t;break;case"(":if(s)break;if(0===h)return h=1,void(i+=t);l++;break;case")":if(s)break;if(1===h){if(0===l)return h=0,i+=t,void u;l--}break;case",":if(s)break;if(0===h)return void u;if(1===h&&0===l&&!e.match(/^url$/i))return a.push(n),n="",void(i+=t)}i+=t,0===h?e+=t:n+=t}}),u,c}function H(t){return t.replace("px","")}function W(t){return parseFloat(t)}function V(t){if(t.getBoundingClientRect){var e=t.getBoundingClientRect,n=null==t.offsetWidth?e.width:t.offsetWidth;return{top:e.top,bottom:e.bottom||e.top+e.height,right:e.left+n,left:e.left,width:n,height:null==t.offsetHeight?e.height:t.offsetHeight}}return{}}function z(t){var e=t.offsetParent?z(t.offsetParent):{top:0,left:0};return{top:t.offsetTop+e.top,bottom:t.offsetTop+t.offsetHeight+e.top,right:t.offsetLeft+e.left+t.offsetWidth,left:t.offsetLeft+e.left,width:t.offsetWidth,height:t.offsetHeight}}function U(t,e,n,r,o){L("Starting NodeParser"),this.renderer=e,this.options=o,this.range=null,this.support=n,this.renderQueue=[],this.stack=new Bt(!0,1,t.ownerDocument,null);var i=new D(t,null);if(o.background&&e.rectangle(0,0,e.width,e.height,new C(o.background)),t===t.ownerDocument.documentElement){var s=new D(i.color("backgroundColor").isTransparent?t.ownerDocument.body:t.ownerDocument.documentElement,null);e.rectangle(0,0,e.width,e.height,s.color("backgroundColor"))}i.visibile=i.isElementVisible,this.createPseudoHideStyles(t.ownerDocument),this.disableAnimations(t.ownerDocument),this.nodes=Tt([i].concat(this.getChildren(i)).filter(function(t){return t.visible=t.isElementVisible}).map(this.getPseudoElements,this)),this.fontMetrics=new O,L("Fetched nodes, total:",this.nodes.length),L("Calculate overflow clips"),this.calculateOverflowClips,L("Start fetching images"),this.images=r.fetch(this.nodes.filter(ft)),this.ready=this.images.ready.then(bt(function{return L("Images loaded, starting parsing"),L("Creating stacking contexts"),this.createStackingContexts,L("Sorting stacking contexts"),this.sortStackingContexts(this.stack),this.parse(this.stack),L("Render queue created with "+this.renderQueue.length+" items"),new Promise(bt(function(t){o.async?"function"==typeof o.async?o.async.call(this,this.renderQueue,t):this.renderQueue.length>0?(this.renderIndex=0,this.asyncRenderer(this.renderQueue,t)):t:(this.renderQueue.forEach(this.paint,this),t)},this))},this))}function q(t){return t.parent&&t.parent.clip.length}function X(t){return t.replace(/(\-[a-z])/g,function(t){return t.toUpperCase.replace("-","")})}function Y{}function G(t,e,n,r){return t.map(function(o,i){if(o.width>0){var s=e.left,a=e.top,c=e.width,h=e.height-t[2].width;switch(i){case 0:h=t[0].width,o.args=K({c1:[s,a],c2:[s+c,a],c3:[s+c-t[1].width,a+h],c4:[s+t[3].width,a+h]},r[0],r[1],n.topLeftOuter,n.topLeftInner,n.topRightOuter,n.topRightInner);break;case 1:s=e.left+e.width-t[1].width,c=t[1].width,o.args=K({c1:[s+c,a],c2:[s+c,a+h+t[2].width],c3:[s,a+h],c4:[s,a+t[0].width]},r[1],r[2],n.topRightOuter,n.topRightInner,n.bottomRightOuter,n.bottomRightInner);break;case 2:a=a+e.height-t[2].width,h=t[2].width,o.args=K({c1:[s+c,a+h],c2:[s,a+h],c3:[s+t[3].width,a],c4:[s+c-t[3].width,a]},r[2],r[3],n.bottomRightOuter,n.bottomRightInner,n.bottomLeftOuter,n.bottomLeftInner);break;case 3:c=t[3].width,o.args=K({c1:[s,a+h+t[2].width],c2:[s,a],c3:[s+c,a+t[0].width],c4:[s+c,a+h]},r[3],r[0],n.bottomLeftOuter,n.bottomLeftInner,n.topLeftOuter,n.topLeftInner)}}return o})}function Q(t,e,n,r){var o=(Math.sqrt(2)-1)/3*4,i=n*o,s=r*o,a=t+n,c=e+r;return{topLeft:J({x:t,y:c},{x:t,y:c-s},{x:a-i,y:e},{x:a,y:e}),topRight:J({x:t,y:e},{x:t+i,y:e},{x:a,y:c-s},{x:a,y:c}),bottomRight:J({x:a,y:e},{x:a,y:e+s},{x:t+i,y:c},{x:t,y:c}),bottomLeft:J({x:a,y:c},{x:a-i,y:c},{x:t,y:e+s},{x:t,y:e})}}function $(t,e,n){var r=t.left,o=t.top,i=t.width,s=t.height,a=e[0][0],c=e[0][1],h=e[1][0],l=e[1][1],u=e[2][0],d=e[2][1],p=e[3][0],f=e[3][1],g=i-h,m=s-d,y=i-u,v=s-f;return{topLeftOuter:Q(r,o,a,c).topLeft.subdivide(.5),topLeftInner:Q(r+n[3].width,o+n[0].width,Math.max(0,a-n[3].width),Math.max(0,c-n[0].width)).topLeft.subdivide(.5),topRightOuter:Q(r+g,o,h,l).topRight.subdivide(.5),topRightInner:Q(r+Math.min(g,i+n[3].width),o+n[0].width,g>i+n[3].width?0:h-n[3].width,l-n[0].width).topRight.subdivide(.5),bottomRightOuter:Q(r+y,o+m,u,d).bottomRight.subdivide(.5),bottomRightInner:Q(r+Math.min(y,i-n[3].width),o+Math.min(m,s+n[0].width),Math.max(0,u-n[1].width),d-n[2].width).bottomRight.subdivide(.5),bottomLeftOuter:Q(r,o+v,p,f).bottomLeft.subdivide(.5),bottomLeftInner:Q(r+n[3].width,o+v,Math.max(0,p-n[3].width),f-n[2].width).bottomLeft.subdivide(.5)}}function J(t,e,n,r){var o=function(t,e,n){return{x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n}};return{start:t,startControl:e,endControl:n,end:r,subdivide:function(i){var s=o(t,e,i),a=o(e,n,i),c=o(n,r,i),h=o(s,a,i),l=o(a,c,i),u=o(h,l,i);return[J(t,s,h,u),J(u,l,c,r)]},curveTo:function(t){t.push(["bezierCurve",e.x,e.y,n.x,n.y,r.x,r.y])},curveToReversed:function(r){r.push(["bezierCurve",n.x,n.y,e.x,e.y,t.x,t.y])}}}function K(t,e,n,r,o,i,s){var a=[];return e[0]>0||e[1]>0?(a.push(["line",r[1].start.x,r[1].start.y]),r[1].curveTo(a)):a.push(["line",t.c1[0],t.c1[1]]),n[0]>0||n[1]>0?(a.push(["line",i[0].start.x,i[0].start.y]),i[0].curveTo(a),a.push(["line",s[0].end.x,s[0].end.y]),s[0].curveToReversed(a)):(a.push(["line",t.c2[0],t.c2[1]]),a.push(["line",t.c3[0],t.c3[1]])),e[0]>0||e[1]>0?(a.push(["line",o[1].end.x,o[1].end.y]),o[1].curveToReversed(a)):a.push(["line",t.c4[0],t.c4[1]]),a}function Z(t,e,n,r,o,i,s){e[0]>0||e[1]>0?(t.push(["line",r[0].start.x,r[0].start.y]),r[0].curveTo(t),r[1].curveTo(t)):t.push(["line",i,s]),(n[0]>0||n[1]>0)&&t.push(["line",o[0].start.x,o[0].start.y])}function tt(t){return t.cssInt("zIndex")<0}function et(t){return t.cssInt("zIndex")>0}function nt(t){return 0===t.cssInt("zIndex")}function rt(t){return-1!==["inline","inline-block","inline-table"].indexOf(t.css("display"))}function ot(t){return t instanceof Bt}function it(t){return t.node.data.trim.length>0}function st(t){return/^(normal|none|0px)$/.test(t.parent.css("letterSpacing"))}function at(t){return["TopLeft","TopRight","BottomRight","BottomLeft"].map(function(e){var n=t.css("border"+e+"Radius").split(" ");return n.length<=1&&(n[1]=n[0]),n.map(wt)})}function ct(t){return t.nodeType===Node.TEXT_NODE||t.nodeType===Node.ELEMENT_NODE}function ht(t){var e=t.css("position");return"auto"!==(-1!==["absolute","relative","fixed"].indexOf(e)?t.css("zIndex"):"auto")}function lt(t){return"static"!==t.css("position")}function ut(t){return"none"!==t.css("float")}function dt(t){return-1!==["inline-block","inline-table"].indexOf(t.css("display"))}function pt(t){var e=this;return function{return!t.apply(e,arguments)}}function ft(t){return t.node.nodeType===Node.ELEMENT_NODE}function gt(t){return!0===t.isPseudoElement}function mt(t){return t.node.nodeType===Node.TEXT_NODE}function yt(t){return function(e,n){return e.cssInt("zIndex")+t.indexOf(e)/t.length-(n.cssInt("zIndex")+t.indexOf(n)/t.length)}}function vt(t){return t.getOpacity<1}function bt(t,e){return function{return t.apply(e,arguments)}}function wt(t){return parseInt(t,10)}function xt(t){return t.width}function Et(t){return t.node.nodeType!==Node.ELEMENT_NODE||-1===["SCRIPT","HEAD","TITLE","OBJECT","BR","OPTION"].indexOf(t.node.nodeName)}function Tt(t){return[].concat.apply([],t)}function kt(t){var e=t.substr(0,1);return e===t.substr(t.length-1)&&e.match(/'|"/)?t.substr(1,t.length-2):t}function Ct(e){for(var n,r=[],o=0,i=!1;e.length;)St(e[o])===i?((n=e.splice(0,o)).length&&r.push(t.html2canvas.punycode.ucs2.encode(n)),i=!i,o=0):o++,o>=e.length&&(n=e.splice(0,o)).length&&r.push(t.html2canvas.punycode.ucs2.encode(n));return r}function St(t){return-1!==[32,13,10,9,45].indexOf(t)}function It(t){return/[^\u0000-\u00ff]/.test(t)}function Ot(t,e,n){if(!e)return Promise.reject("No proxy configured");var r=Mt(oe),o=Pt(e,t,r);return oe?Ut(o):At(n,o,r).then(function(t){return jt(t.content)})}function Rt(t,e,n){var r=Mt(ie),o=Pt(e,t,r);return ie?Promise.resolve(o):At(n,o,r).then(function(t){return"data:"+t.type+";base64,"+t.content})}function At(e,n,r){return new Promise(function(o,i){var s=e.createElement("script"),a=function{delete t.html2canvas.proxy[r],e.body.removeChild(s)};t.html2canvas.proxy[r]=function(t){a,o(t)},s.src=n,s.onerror=function(t){a,i(t)},e.body.appendChild(s)})}function Mt(t){return t?"":"html2canvas_"+Date.now+"_"+ ++re+"_"+Math.round(1e5*Math.random)}function Pt(t,e,n){return t+"?url="+encodeURIComponent(e)+(n.length?"&callback=html2canvas.proxy."+n:"")}function Nt(t,n){e.createElement("script");var r=e.createElement("a");r.href=t,t=r.href,this.src=t,this.image=new Image;var o=this;this.promise=new Promise(function(r,i){o.image.crossOrigin="Anonymous",o.image.onload=r,o.image.onerror=i,new Rt(t,n,e).then(function(t){o.image.src=t}).catch(i)})}function Lt(t,e,n){D.call(this,t,e),this.isPseudoElement=!0,this.before=":before"===n}function Dt(t,e,n,r,o){this.width=t,this.height=e,this.images=n,this.options=r,this.document=o}function Bt(t,e,n,r){D.call(this,n,r),this.ownStacking=t,this.contexts=[],this.children=[],this.opacity=(this.parent?this.parent.stack.opacity:1)*e}function _t(t){this.rangeBounds=this.testRangeBounds(t),this.cors=this.testCORS,this.svg=this.testSVG}function Ft(t){this.src=t,this.image=null;var e=this;this.promise=this.hasFabric.then(function{return e.isInline(t)?Promise.resolve(e.inlineFormatting(t)):Ut(t)}).then(function(t){return new Promise(function(n){html2canvas.fabric.loadSVGFromString(t,e.createCanvas.call(e,n))})})}function jt(t){var e,n,r,o,i,s,a,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=t.length,l="";for(e=0;e>4,s=(15&n)<<4|(r=c.indexOf(t[e+2]))>>2,a=(3&r)<<6|(o=c.indexOf(t[e+3])),l+=64===r?String.fromCharCode(i):64===o||-1===o?String.fromCharCode(i,s):String.fromCharCode(i,s,a);return l}function Ht(t,e){this.src=t,this.image=null;var n=this;this.promise=e?new Promise(function(e,r){n.image=new Image,n.image.onload=e,n.image.onerror=r,n.image.src="data:image/svg+xml,"+(new XMLSerializer).serializeToString(t),!0===n.image.complete&&e(n.image)}):this.hasFabric.then(function{return new Promise(function(e){html2canvas.fabric.parseSVGDocument(t,n.createCanvas.call(n,e))})})}function Wt(t,e){D.call(this,t,e)}function Vt(t,e,n){if(t.length>0)return e+n.toUpperCase}function zt(t){A.apply(this,arguments),this.type="linear"===t.args[0]?this.TYPES.LINEAR:this.TYPES.RADIAL}function Ut(t){return new Promise(function(e,n){var r=new XMLHttpRequest;r.open("GET",t),r.onload=function{200===r.status?e(r.responseText):n(new Error(r.statusText))},r.onerror=function{n(new Error("Network Error"))},r.send})}function qt(t,e){Dt.apply(this,arguments),this.canvas=this.options.canvas||this.document.createElement("canvas"),this.options.canvas||(this.canvas.width=t,this.canvas.height=e),this.ctx=this.canvas.getContext("2d"),this.taintCtx=this.document.createElement("canvas").getContext("2d"),this.ctx.textBaseline="bottom",this.variables={},L("Initialized CanvasRenderer with size",t,"x",e)}function Xt(t){return t.length>0}if(function{function n(t,e){I[k]=t,I[k+1]=e,2===(k+=2)&&E}function i(t){return"function"==typeof t}function s{for(var t=0;t<k;t+=2)(0,I[t])(I[t+1]),I[t]=void 0,I[t+1]=void 0;k=0}function a{}function c(t,e,n,r){try{t.call(e,n,r)}catch(t){return t}}function h(t,e,r){n(function(t){var n=!1,o=c(r,e,function(r){n||(n=!0,e!==r?u(t,r):p(t,r))},function(e){n||(n=!0,f(t,e))});!n&&o&&(n=!0,f(t,o))},t)}function l(t,e){1===e.a?p(t,e.b):2===t.a?f(t,e.b):g(e,void 0,function(e){u(t,e)},function(e){f(t,e)})}function u(t,e){if(t===e)f(t,new TypeError("You cannot resolve a promise with itself"));else if("function"==typeof e||"object"==typeof e&&null!==e)if(e.constructor===t.constructor)l(t,e);else{var n;try{n=e.then}catch(t){O.error=t,n=O}n===O?f(t,O.error):void 0===n?p(t,e):i(n)?h(t,e,n):p(t,e)}else p(t,e)}function d(t){t.f&&t.f(t.b),m(t)}function p(t,e){void 0===t.a&&(t.b=e,t.a=1,0!==t.e.length&&n(m,t))}function f(t,e){void 0===t.a&&(t.a=2,t.b=e,n(d,t))}function g(t,e,r,o){var i=t.e,s=i.length;t.f=null,i[s]=e,i[s+1]=r,i[s+2]=o,0===s&&t.a&&n(m,t)}function m(t){var e=t.e,n=t.a;if(0!==e.length){for(var r,o,i=t.b,s=0;s<e.length;s+=3)r=e[s],o=e[s+n],r?v(n,r,o,i):o(i);t.e.length=0}}function y{this.error=null}function v(t,e,n,r){var o,s,a,c,h=i(n);if(h){try{o=n(r)}catch(t){R.error=t,o=R}if(o===R?(c=!0,s=o.error,o=null):a=!0,e===o)return void f(e,new TypeError("A promises callback cannot return that same promise."))}else o=r,a=!0;void 0===e.a&&(h&&a?u(e,o):c?f(e,s):1===t?p(e,o):2===t&&f(e,o))}function b(t,e){try{e(function(e){u(t,e)},function(e){f(t,e)})}catch(e){f(t,e)}}function w(t,e,n,r){this.n=t,this.c=new t(a,r),this.i=n,this.o(e)?(this.m=e,this.d=this.length=e.length,this.l,0===this.length?p(this.c,this.b):(this.length=this.length||0,this.k,0===this.d&&p(this.c,this.b))):f(this.c,this.p)}function x(t){if(A++,this.b=this.a=void 0,this.e=[],a!==t){if(!i(t))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof x))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");b(this,t)}}var E,T=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},k=0,C=(S=void 0!==t?t:{}).MutationObserver||S.WebKitMutationObserver,S="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,I=Array(1e3);E="undefined"!=typeof process&&"[object process]"==={}.toString.call(process)?function{process.nextTick(s)}:C?function{var t=0,n=new C(s),r=e.createTextNode("");return n.observe(r,{characterData:!0}),function{r.data=t=++t%2}}:S?function{var t=new MessageChannel;return t.port1.onmessage=s,function{t.port2.postMessage(0)}}:function{setTimeout(s,1)};var O=new y,R=new y;w.prototype.o=function(t){return T(t)},w.prototype.p=function{return Error("Array Methods must be provided an Array")},w.prototype.l=function{this.b=Array(this.length)},w.prototype.k=function{for(var t=this.length,e=this.c,n=this.m,r=0;void 0===e.a&&r<t;r++)this.j(n[r],r)},w.prototype.j=function(t,e){var n=this.n;"object"==typeof t&&null!==t?t.constructor===n&&void 0!==t.a?(t.f=null,this.g(t.a,e,t.b)):this.q(n.resolve(t),e):(this.d--,this.b[e]=this.h(t))},w.prototype.g=function(t,e,n){var r=this.c;void 0===r.a&&(this.d--,this.i&&2===t?f(r,n):this.b[e]=this.h(n)),0===this.d&&p(r,this.b)},w.prototype.h=function(t){return t},w.prototype.q=function(t,e){var n=this;g(t,void 0,function(t){n.g(1,e,t)},function(t){n.g(2,e,t)})};var A=0;x.all=function(t,e){return new w(this,t,!0,e).c},x.race=function(t,e){var n=new this(a,e);if(!T(t))return f(n,new TypeError("You must pass an array to race.")),n;for(var r=t.length,o=0;void 0===n.a&&o<r;o++)g(this.resolve(t[o]),void 0,function(t){u(n,t)},function(t){f(n,t)});return n},x.resolve=function(t,e){if(t&&"object"==typeof t&&t.constructor===this)return t;var n=new this(a,e);return u(n,t),n},x.reject=function(t,e){var n=new this(a,e);return f(n,t),n},x.prototype={constructor:x,then:function(t,e){var r=this.a;if(1===r&&!t||2===r&&!e)return this;var o=new this.constructor(a),i=this.b;if(r){var s=arguments[r-1];n(function{v(r,o,s,i)})}else g(this,o,t,e);return o},catch:function(t){return this.then(null,t)}};var M={Promise:x,polyfill:function{var e;"Promise"in(e=void 0!==r?r:void 0!==t&&t.document?t:self)&&"resolve"in e.Promise&&"reject"in e.Promise&&"all"in e.Promise&&"race"in e.Promise&&function{var t;return new e.Promise(function(e){t=e}),i(t)}||(e.Promise=x)}};"function"==typeof o&&o.amd?o(function{return M}):"undefined"!=typeof module&&module.exports?module.exports=M:void 0!==this&&(this.ES6Promise=M)}.call(t),t&&t.ES6Promise.polyfill,void 0!==e&&"function"==typeof Object.create&&"function"==typeof e.createElement("canvas").getContext){!function(t){function e(t){throw RangeError(M[t])}function i(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function s(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),r+i(t.split(A),e).join(".")}function a(t){for(var e,n,r=[],o=0,i=t.length;o=55296&&e<=56319&&o65535&&(e+=L((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=L(t)}).join("")}function h(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:w}function l(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function u(t,e,n){var r=0;for(t=n?N(t/k):t>>1,t+=N(t/e);t>P*E>>1;r+=w)t=N(t/P);return N(r+(P+1)*t/(t+T))}function d(t){var n,r,o,i,s,a,l,d,p,f,g=[],m=t.length,y=0,v=S,T=C;for((r=t.lastIndexOf(I))<0&&(r=0),o=0;o=128&&e("not-basic"),g.push(t.charCodeAt(o));for(i=r>0?r+1:0;i=m&&e("invalid-input"),((d=h(t.charCodeAt(i++)))>=w||d>N((b-y)/a))&&e("overflow"),y+=d*a,p=l<=T?x:l>=T+E?E:l-T,!(dN(b/(f=w-p))&&e("overflow"),a*=f;T=u(y-s,n=g.length+1,0==s),N(y/n)>b-v&&e("overflow"),v+=N(y/n),y%=n,g.splice(y++,0,v)}return c(g)}function p(t){var n,r,o,i,s,c,h,d,p,f,g,m,y,v,T,k=[];for(m=(t=a(t)).length,n=S,r=0,s=C,c=0;c=n&&gN((b-r)/(y=o+1))&&e("overflow"),r+=(h-n)*y,n=h,c=0;cb&&e("overflow"),g==n){for(d=r,p=w;f=p<=s?x:p>=s+E?E:p-s,!(d= 0x80 (not a basic code point)","invalid-input":"Invalid input"},P=w-x,N=Math.floor,L=String.fromCharCode;if(y={version:"1.3.1",ucs2:{decode:a,encode:c},decode:d,encode:p,toASCII:function(t){return s(t,function(t){return R.test(t)?"xn--"+p(t):t})},toUnicode:function(t){return s(t,function(t){return O.test(t)?d(t.slice(4).toLowerCase):t})}},"function"==typeof o&&"object"==typeof o.amd&&o.amd)o("punycode",function{return y});else if(f&&g)if(module.exports==f)g.exports=y;else for(v in y)y.hasOwnProperty(v)&&(f[v]=y[v]);else t.punycode=y}(this);var Yt="data-html2canvas-node",Gt="data-html2canvas-canvas-clone",Qt=0,$t=0;t.html2canvas=function(n,r){var o=$t++;if((r=r||{}).logging&&(t.html2canvas.logging=!0,t.html2canvas.start=Date.now),r.async=void 0===r.async||r.async,r.allowTaint=void 0!==r.allowTaint&&r.allowTaint,r.removeContainer=void 0===r.removeContainer||r.removeContainer,r.javascriptEnabled=void 0!==r.javascriptEnabled&&r.javascriptEnabled,r.imageTimeout=void 0===r.imageTimeout?1e4:r.imageTimeout,r.renderer="function"==typeof r.renderer?r.renderer:qt,r.strict=!!r.strict,"string"==typeof n){if("string"!=typeof r.proxy)return Promise.reject("Proxy must be used when rendering url");var c=null!=r.width?r.width:t.innerWidth,h=null!=r.height?r.height:t.innerHeight;return v(k(n),r.proxy,e,c,h,r).then(function(t){return a(t.contentWindow.document.documentElement,t,r,c,h)})}var l=(n===i?[e.documentElement]:n.length?n:[n])[0];return l.setAttribute(Yt+o,o),s(l.ownerDocument,r,l.ownerDocument.defaultView.innerWidth,l.ownerDocument.defaultView.innerHeight,o).then(function(t){return"function"==typeof r.onrendered&&(L("options.onrendered is deprecated, html2canvas returns a Promise containing the canvas"),r.onrendered(t)),t})},t.html2canvas.punycode=this.punycode,t.html2canvas.proxy={},C.prototype.darken=function(t){var e=1-t;return new C([Math.round(this.r*e),Math.round(this.g*e),Math.round(this.b*e),this.a])},C.prototype.isTransparent=function{return 0===this.a},C.prototype.isBlack=function{return 0===this.r&&0===this.g&&0===this.b},C.prototype.fromArray=function(t){return Array.isArray(t)&&(this.r=Math.min(t[0],255),this.g=Math.min(t[1],255),this.b=Math.min(t[2],255),t.length>3&&(this.a=t[3])),Array.isArray(t)};var Jt=/^#([a-f0-9]{3})$/i;C.prototype.hex3=function(t){var e=null;return null!==(e=t.match(Jt))&&(this.r=parseInt(e[1][0]+e[1][0],16),this.g=parseInt(e[1][1]+e[1][1],16),this.b=parseInt(e[1][2]+e[1][2],16)),null!==e};var Kt=/^#([a-f0-9]{6})$/i;C.prototype.hex6=function(t){var e=null;return null!==(e=t.match(Kt))&&(this.r=parseInt(e[1].substring(0,2),16),this.g=parseInt(e[1].substring(2,4),16),this.b=parseInt(e[1].substring(4,6),16)),null!==e};var Zt=/^rgb\((\d{1,3}) *, *(\d{1,3}) *, *(\d{1,3})\)$/;C.prototype.rgb=function(t){var e=null;return null!==(e=t.match(Zt))&&(this.r=Number(e[1]),this.g=Number(e[2]),this.b=Number(e[3])),null!==e};var te=/^rgba\((\d{1,3}) *, *(\d{1,3}) *, *(\d{1,3}) *, *(\d+\.?\d*)\)$/;C.prototype.rgba=function(t){var e=null;return null!==(e=t.match(te))&&(this.r=Number(e[1]),this.g=Number(e[2]),this.b=Number(e[3]),this.a=Number(e[4])),null!==e},C.prototype.toString=function{return null!==this.a&&1!==this.a?"rgba("+[this.r,this.g,this.b,this.a].join(",")+")":"rgb("+[this.r,this.g,this.b].join(",")+")"},C.prototype.namedColor=function(t){var e=ee[t.toLowerCase];if(e)this.r=e[0],this.g=e[1],this.b=e[2];else if("transparent"===t.toLowerCase)return this.r=this.g=this.b=this.a=0,!0;return!!e},C.prototype.isColor=!0;var ee={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};O.prototype.getMetrics=function(t,e){return this.data[t+"-"+e]===i&&(this.data[t+"-"+e]=new I(t,e)),this.data[t+"-"+e]},R.prototype.proxyLoad=function(t,e,n){var r=this.src;return v(r.src,t,r.ownerDocument,e.width,e.height,n)},A.prototype.TYPES={LINEAR:1,RADIAL:2},P.prototype.findImages=function(t){var e=[];return t.reduce(function(t,e){switch(e.node.nodeName){case"IMG":return t.concat([{args:[e.node.src],method:"url"}]);case"svg":case"IFRAME":return t.concat([{args:[e.node],method:e.node.nodeName}])}return t},[]).forEach(this.addImage(e,this.loadImage),this),e},P.prototype.findBackgroundImage=function(t,e){return e.parseBackgroundImages.filter(this.hasImageBackground).forEach(this.addImage(t,this.loadImage),this),t},P.prototype.addImage=function(t,e){return function(n){n.args.forEach(function(r){this.imageExists(t,r)||(t.splice(0,0,e.call(this,n)),L("Added image #"+t.length,"string"==typeof r?r.substring(0,100):r))},this)}},P.prototype.hasImageBackground=function(t){return"none"!==t.method},P.prototype.loadImage=function(t){if("url"===t.method){var e=t.args[0];return!this.isSVG(e)||this.support.svg||this.options.allowTaint?e.match(/data:image\/.*;base64,/i)?new M(e.replace(/url\(['"]{0,}|['"]{0,}\)$/gi,""),!1):this.isSameOrigin(e)||!0===this.options.allowTaint||this.isSVG(e)?new M(e,!1):this.support.cors&&!this.options.allowTaint&&this.options.useCORS?new M(e,!0):this.options.proxy?new Nt(e,this.options.proxy):new S(e):new Ft(e)}return"linear-gradient"===t.method?new N(t):"gradient"===t.method?new zt(t):"svg"===t.method?new Ht(t.args[0],this.support.svg):"IFRAME"===t.method?new R(t.args[0],this.isSameOrigin(t.args[0].src),this.options):new S(t)},P.prototype.isSVG=function(t){return"svg"===t.substring(t.length-3).toLowerCase||Ft.prototype.isInline(t)},P.prototype.imageExists=function(t,e){return t.some(function(t){return t.src===e})},P.prototype.isSameOrigin=function(t){return this.getOrigin(t)===this.origin},P.prototype.getOrigin=function(t){var n=this.link||(this.link=e.createElement("a"));return n.href=t,n.href=n.href,n.protocol+n.hostname+n.port},P.prototype.getPromise=function(t){return this.timeout(t,this.options.imageTimeout).catch(function{return new S(t.src).promise.then(function(e){t.image=e})})},P.prototype.get=function(t){var e=null;return this.images.some(function(n){return(e=n).src===t})?e:null},P.prototype.fetch=function(t){return this.images=t.reduce(bt(this.findBackgroundImage,this),this.findImages(t)),this.images.forEach(function(t,e){t.promise.then(function{L("Succesfully loaded image #"+(e+1),t)},function(n){L("Failed loading image #"+(e+1),t,n)})}),this.ready=Promise.all(this.images.map(this.getPromise,this)),L("Finished searching images"),this},P.prototype.timeout=function(t,e){var n,r=Promise.race([t.promise,new Promise(function(r,o){n=setTimeout(function{L("Timed out loading image",t),o(t)},e)})]).then(function(t){return clearTimeout(n),t});return r.catch(function{clearTimeout(n)}),r},(N.prototype=Object.create(A.prototype)).stepRegExp=/((?:rgb|rgba)\(\d{1,3},\s\d{1,3},\s\d{1,3}(?:,\s[0-9\.]+)?\))\s*(\d{1,3})?(%|px)?/,D.prototype.cloneTo=function(t){t.visible=this.visible,t.borders=this.borders,t.bounds=this.bounds,t.clip=this.clip,t.backgroundClip=this.backgroundClip,t.computedStyles=this.computedStyles,t.styles=this.styles,t.backgroundImages=this.backgroundImages,t.opacity=this.opacity},D.prototype.getOpacity=function{return null===this.opacity?this.opacity=this.cssFloat("opacity"):this.opacity},D.prototype.assignStack=function(t){this.stack=t,t.children.push(this)},D.prototype.isElementVisible=function{return this.node.nodeType===Node.TEXT_NODE?this.parent.visible:"none"!==this.css("display")&&"hidden"!==this.css("visibility")&&!this.node.hasAttribute("data-html2canvas-ignore")&&("INPUT"!==this.node.nodeName||"hidden"!==this.node.getAttribute("type"))},D.prototype.css=function(t){return this.computedStyles||(this.computedStyles=this.isPseudoElement?this.parent.computedStyle(this.before?":before":":after"):this.computedStyle(null)),this.styles[t]||(this.styles[t]=this.computedStyles[t])},D.prototype.prefixedCss=function(t){var e=["webkit","moz","ms","o"],n=this.css(t);return n===i&&e.some(function(e){return(n=this.css(e+t.substr(0,1).toUpperCase+t.substr(1)))!==i},this),n===i?null:n},D.prototype.computedStyle=function(t){return this.node.ownerDocument.defaultView.getComputedStyle(this.node,t)},D.prototype.cssInt=function(t){var e=parseInt(this.css(t),10);return isNaN(e)?0:e},D.prototype.color=function(t){return this.colors[t]||(this.colors[t]=new C(this.css(t)))},D.prototype.cssFloat=function(t){var e=parseFloat(this.css(t));return isNaN(e)?0:e},D.prototype.fontWeight=function{var t=this.css("fontWeight");switch(parseInt(t,10)){case 401:t="bold";break;case 400:t="normal"}return t},D.prototype.parseClip=function{var t=this.css("clip").match(this.CLIP);return t?{top:parseInt(t[1],10),right:parseInt(t[2],10),bottom:parseInt(t[3],10),left:parseInt(t[4],10)}:null},D.prototype.parseBackgroundImages=function{return this.backgroundImages||(this.backgroundImages=j(this.css("backgroundImage")))},D.prototype.cssList=function(t,e){var n=(this.css(t)||"").split(",");return n=n[e||0]||n[0]||"auto",1===(n=n.trim.split(" ")).length&&(n=[n[0],n[0]]),n},D.prototype.parseBackgroundSize=function(t,e,n){var r,o,i=this.cssList("backgroundSize",n);if(F(i[0]))r=t.width*parseFloat(i[0])/100;else{if(/contain|cover/.test(i[0])){var s=t.width/t.height,a=e.width/e.height;return s<a^"contain"===i[0]?{width:t.height*a,height:t.height}:{width:t.width,height:t.width/a}}r=parseInt(i[0],10)}return o="auto"===i[0]&&"auto"===i[1]?e.height:"auto"===i[1]?r/e.width*e.height:F(i[1])?t.height*parseFloat(i[1])/100:parseInt(i[1],10),"auto"===i[0]&&(r=o/e.height*e.width),{width:r,height:o}},D.prototype.parseBackgroundPosition=function(t,e,n,r){var o,i,s=this.cssList("backgroundPosition",n);return o=F(s[0])?(t.width-(r||e).width)*(parseFloat(s[0])/100):parseInt(s[0],10),i="auto"===s[1]?o/e.width*e.height:F(s[1])?(t.height-(r||e).height)*parseFloat(s[1])/100:parseInt(s[1],10),"auto"===s[0]&&(o=i/e.height*e.width),{left:o,top:i}},D.prototype.parseBackgroundRepeat=function(t){return this.cssList("backgroundRepeat",t)[0]},D.prototype.parseTextShadows=function{var t=this.css("textShadow"),e=[];if(t&&"none"!==t)for(var n=t.match(this.TEXT_SHADOW_PROPERTY),r=0;n&&r<n.length;r++){var o=n[r].match(this.TEXT_SHADOW_VALUES);e.push({color:new C(o[0]),offsetX:o[1]?parseFloat(o[1].replace("px","")):0,offsetY:o[2]?parseFloat(o[2].replace("px","")):0,blur:o[3]?o[3].replace("px",""):0})}return e},D.prototype.parseTransform=function{if(!this.transformData)if(this.hasTransform){var t=this.parseBounds,e=this.prefixedCss("transformOrigin").split(" ").map(H).map(W);e[0]+=t.left,e[1]+=t.top,this.transformData={origin:e,matrix:this.parseTransformMatrix}}else this.transformData={origin:[0,0],matrix:[1,0,0,1,0,0]};return this.transformData},D.prototype.parseTransformMatrix=function{if(!this.transformMatrix){var t=this.prefixedCss("transform"),e=t?_(t.match(this.MATRIX_PROPERTY)):null;this.transformMatrix=e||[1,0,0,1,0,0]}return this.transformMatrix},D.prototype.parseBounds=function{return this.bounds||(this.bounds=this.hasTransform?z(this.node):V(this.node))},D.prototype.hasTransform=function{return"1,0,0,1,0,0"!==this.parseTransformMatrix.join(",")||this.parent&&this.parent.hasTransform},D.prototype.getValue=function{var t=this.node.value||"";return"SELECT"===this.node.tagName?t=B(this.node):"password"===this.node.type&&(t=Array(t.length+1).join("•")),0===t.length?this.node.placeholder||"":t},D.prototype.MATRIX_PROPERTY=/(matrix)\((.+)\)/,D.prototype.TEXT_SHADOW_PROPERTY=/((rgba|rgb)\([^\)]+\)(\s-?\d+px){0,})/g,D.prototype.TEXT_SHADOW_VALUES=/(-?\d+px)|(#.+)|(rgb\(.+\))|(rgba\(.+\))/g,D.prototype.CLIP=/^rect\((\d+)px,? (\d+)px,? (\d+)px,? (\d+)px\)$/,U.prototype.calculateOverflowClips=function{this.nodes.forEach(function(t){if(ft(t)){gt(t)&&t.appendToDOM,t.borders=this.parseBorders(t);var e="hidden"===t.css("overflow")?[t.borders.clip]:[],n=t.parseClip;n&&-1!==["absolute","fixed"].indexOf(t.css("position"))&&e.push("rect",t.bounds.left+n.left,t.bounds.top+n.top,n.right-n.left,n.bottom-n.top),t.clip=q(t)?t.parent.clip.concat(e):e,t.backgroundClip="hidden"!==t.css("overflow")?t.clip.concat([t.borders.clip]):t.clip,gt(t)&&t.cleanDOM}else mt(t)&&(t.clip=q(t)?t.parent.clip:[]);gt(t)||(t.bounds=null)},this)},U.prototype.asyncRenderer=function(t,e,n){n=n||Date.now,this.paint(t[this.renderIndex++]),t.length===this.renderIndex?e:n+20>Date.now?this.asyncRenderer(t,e,n):setTimeout(bt(function{this.asyncRenderer(t,e)},this),0)},U.prototype.createPseudoHideStyles=function(t){this.createStyles(t,"."+Lt.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+':before { content: "" !important; display: none !important; }.'+Lt.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER+':after { content: "" !important; display: none !important; }')},U.prototype.disableAnimations=function(t){this.createStyles(t,"* { -webkit-animation: none !important; -moz-animation: none !important; -o-animation: none !important; animation: none !important; -webkit-transition: none !important; -moz-transition: none !important; -o-transition: none !important; transition: none !important;}")},U.prototype.createStyles=function(t,e){var n=t.createElement("style");n.innerHTML=e,t.body.appendChild(n)},U.prototype.getPseudoElements=function(t){var e=t;if(t.node.nodeType===Node.ELEMENT_NODE){var n=this.getPseudoElement(t,":before"),r=this.getPseudoElement(t,":after");n&&e.push(n),r&&e.push(r)}return Tt(e)},U.prototype.getPseudoElement=function(t,n){var r=t.computedStyle(n);if(!r||!r.content||"none"===r.content||"-moz-alt-content"===r.content||"none"===r.display)return null;for(var o=kt(r.content),i="url"===o.substr(0,3),s=e.createElement(i?"img":"html2canvaspseudoelement"),a=new Lt(s,t,n),c=r.length-1;c>=0;c--){var h=X(r.item(c));s.style[h]=r[h]}if(s.className=Lt.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE+" "+Lt.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER,i)return s.src=j(o)[0].args[0],[a];var l=e.createTextNode(o);return s.appendChild(l),[a,new Wt(l,a)]},U.prototype.getChildren=function(t){return Tt([].filter.call(t.node.childNodes,ct).map(function(e){var n=[e.nodeType===Node.TEXT_NODE?new Wt(e,t):new D(e,t)].filter(Et);return e.nodeType===Node.ELEMENT_NODE&&n.length&&"TEXTAREA"!==e.tagName?n[0].isElementVisible?n.concat(this.getChildren(n[0])):[]:n},this))},U.prototype.newStackingContext=function(t,e){var n=new Bt(e,t.getOpacity,t.node,t.parent);t.cloneTo(n),(e?n.getParentStack(this):n.parent.stack).contexts.push(n),t.stack=n},U.prototype.createStackingContexts=function{this.nodes.forEach(function(t){ft(t)&&(this.isRootElement(t)||vt(t)||ht(t)||this.isBodyWithTransparentRoot(t)||t.hasTransform)?this.newStackingContext(t,!0):ft(t)&&(lt(t)&&nt(t)||dt(t)||ut(t))?this.newStackingContext(t,!1):t.assignStack(t.parent.stack)},this)},U.prototype.isBodyWithTransparentRoot=function(t){return"BODY"===t.node.nodeName&&t.parent.color("backgroundColor").isTransparent},U.prototype.isRootElement=function(t){return null===t.parent},U.prototype.sortStackingContexts=function(t){t.contexts.sort(yt(t.contexts.slice(0))),t.contexts.forEach(this.sortStackingContexts,this)},U.prototype.parseTextBounds=function(t){return function(e,n,r){if("none"!==t.parent.css("textDecoration").substr(0,4)||0!==e.trim.length){if(this.support.rangeBounds&&!t.parent.hasTransform){var o=r.slice(0,n).join("").length;return this.getRangeBounds(t.node,o,e.length)}if(t.node&&"string"==typeof t.node.data){var i=t.node.splitText(e.length),s=this.getWrapperBounds(t.node,t.parent.hasTransform);return t.node=i,s}}else this.support.rangeBounds&&!t.parent.hasTransform||(t.node=t.node.splitText(e.length));return{}}},U.prototype.getWrapperBounds=function(t,e){var n=t.ownerDocument.createElement("html2canvaswrapper"),r=t.parentNode,o=t.cloneNode(!0);n.appendChild(t.cloneNode(!0)),r.replaceChild(n,t);var i=e?z(n):V(n);return r.replaceChild(o,n),i},U.prototype.getRangeBounds=function(t,e,n){var r=this.range||(this.range=t.ownerDocument.createRange);return r.setStart(t,e),r.setEnd(t,e+n),r.getBoundingClientRect},U.prototype.parse=function(t){var e=t.contexts.filter(tt),n=t.children.filter(ft),r=n.filter(pt(ut)),o=r.filter(pt(lt)).filter(pt(rt)),i=n.filter(pt(lt)).filter(ut),s=r.filter(pt(lt)).filter(rt),a=t.contexts.concat(r.filter(lt)).filter(nt),c=t.children.filter(mt).filter(it),h=t.contexts.filter(et);e.concat(o).concat(i).concat(s).concat(a).concat(c).concat(h).forEach(function(t){this.renderQueue.push(t),ot(t)&&(this.parse(t),this.renderQueue.push(new Y))},this)},U.prototype.paint=function(t){try{t instanceof Y?this.renderer.ctx.restore:mt(t)?(gt(t.parent)&&t.parent.appendToDOM,this.paintText(t),gt(t.parent)&&t.parent.cleanDOM):this.paintNode(t)}catch(t){if(L(t),this.options.strict)throw t}},U.prototype.paintNode=function(t){ot(t)&&(this.renderer.setOpacity(t.opacity),this.renderer.ctx.save,t.hasTransform&&this.renderer.setTransform(t.parseTransform)),"INPUT"===t.node.nodeName&&"checkbox"===t.node.type?this.paintCheckbox(t):"INPUT"===t.node.nodeName&&"radio"===t.node.type?this.paintRadio(t):this.paintElement(t)},U.prototype.paintElement=function(t){var e=t.parseBounds;this.renderer.clip(t.backgroundClip,function{this.renderer.renderBackground(t,e,t.borders.borders.map(xt))},this),this.renderer.clip(t.clip,function{this.renderer.renderBorders(t.borders.borders)},this),this.renderer.clip(t.backgroundClip,function{switch(t.node.nodeName){case"svg":case"IFRAME":var n=this.images.get(t.node);n?this.renderer.renderImage(t,e,t.borders,n):L("Error loading <"+t.node.nodeName+">",t.node);break;case"IMG":var r=this.images.get(t.node.src);r?this.renderer.renderImage(t,e,t.borders,r):L("Error loading ",t.node.src);break;case"CANVAS":this.renderer.renderImage(t,e,t.borders,{image:t.node});break;case"SELECT":case"INPUT":case"TEXTAREA":this.paintFormValue(t)}},this)},U.prototype.paintCheckbox=function(t){var e=t.parseBounds,n=Math.min(e.width,e.height),r={width:n-1,height:n-1,top:e.top,left:e.left},o=[3,3],i=[o,o,o,o],s=[1,1,1,1].map(function(t){return{color:new C("#A5A5A5"),width:t}}),a=$(r,i,s);this.renderer.clip(t.backgroundClip,function{this.renderer.rectangle(r.left+1,r.top+1,r.width-2,r.height-2,new C("#DEDEDE")),this.renderer.renderBorders(G(s,r,a,i)),t.node.checked&&(this.renderer.font(new C("#424242"),"normal","normal","bold",n-3+"px","arial"),this.renderer.text("✔",r.left+n/6,r.top+n-1))},this)},U.prototype.paintRadio=function(t){var e=t.parseBounds,n=Math.min(e.width,e.height)-2;this.renderer.clip(t.backgroundClip,function{this.renderer.circleStroke(e.left+1,e.top+1,n,new C("#DEDEDE"),1,new C("#A5A5A5")),t.node.checked&&this.renderer.circle(Math.ceil(e.left+n/4)+1,Math.ceil(e.top+n/4)+1,Math.floor(n/2),new C("#424242"))},this)},U.prototype.paintFormValue=function(t){var e=t.getValue;if(e.length>0){var n=t.node.ownerDocument,r=n.createElement("html2canvaswrapper");["lineHeight","textAlign","fontFamily","fontWeight","fontSize","color","paddingLeft","paddingTop","paddingRight","paddingBottom","width","height","borderLeftStyle","borderTopStyle","borderLeftWidth","borderTopWidth","boxSizing","whiteSpace","wordWrap"].forEach(function(e){try{r.style[e]=t.css(e)}catch(t){L("html2canvas: Parse: Exception caught in renderFormValue: "+t.message)}});var o=t.parseBounds;r.style.position="fixed",r.style.left=o.left+"px",r.style.top=o.top+"px",r.textContent=e,n.body.appendChild(r),this.paintText(new Wt(r.firstChild,t)),n.body.removeChild(r)}},U.prototype.paintText=function(e){e.applyTextTransform;var n=t.html2canvas.punycode.ucs2.decode(e.node.data),r=this.options.letterRendering&&!st(e)||It(e.node.data)?n.map(function(e){return t.html2canvas.punycode.ucs2.encode([e])}):Ct(n),o=e.parent.fontWeight,i=e.parent.css("fontSize"),s=e.parent.css("fontFamily"),a=e.parent.parseTextShadows;this.renderer.font(e.parent.color("color"),e.parent.css("fontStyle"),e.parent.css("fontVariant"),o,i,s),a.length?this.renderer.fontShadow(a[0].color,a[0].offsetX,a[0].offsetY,a[0].blur):this.renderer.clearShadow,this.renderer.clip(e.parent.clip,function{r.map(this.parseTextBounds(e),this).forEach(function(t,n){t&&(this.renderer.text(r[n],t.left,t.bottom),this.renderTextDecoration(e.parent,t,this.fontMetrics.getMetrics(s,i)))},this)},this)},U.prototype.renderTextDecoration=function(t,e,n){switch(t.css("textDecoration").split(" ")[0]){case"underline":this.renderer.rectangle(e.left,Math.round(e.top+n.baseline+n.lineWidth),e.width,1,t.color("color"));break;case"overline":this.renderer.rectangle(e.left,Math.round(e.top),e.width,1,t.color("color"));break;case"line-through":this.renderer.rectangle(e.left,Math.ceil(e.top+n.middle+n.lineWidth),e.width,1,t.color("color"))}};var ne={inset:"darken",.6],["darken",.1],["darken",.1],["darken",.6};U.prototype.parseBorders=function(t){var e=t.parseBounds,n=at(t),r=["Top","Right","Bottom","Left"].map(function(e,n){var r=t.css("border"+e+"Style"),o=t.color("border"+e+"Color");"inset"===r&&o.isBlack&&(o=new C([255,255,255,o.a]));var i=ne[r]?ne[r][n]:null;return{width:t.cssInt("border"+e+"Width"),color:i?o[i[0]](i[1]):o,args:null}}),o=$(e,n,r);return{clip:this.parseBackgroundClip(t,o,r,n,e),borders:G(r,e,o,n)}},U.prototype.parseBackgroundClip=function(t,e,n,r,o){var i=[];switch(t.css("backgroundClip")){case"content-box":case"padding-box":Z(i,r[0],r[1],e.topLeftInner,e.topRightInner,o.left+n[3].width,o.top+n[0].width),Z(i,r[1],r[2],e.topRightInner,e.bottomRightInner,o.left+o.width-n[1].width,o.top+n[0].width),Z(i,r[2],r[3],e.bottomRightInner,e.bottomLeftInner,o.left+o.width-n[1].width,o.top+o.height-n[2].width),Z(i,r[3],r[0],e.bottomLeftInner,e.topLeftInner,o.left+n[3].width,o.top+o.height-n[2].width);break;default:Z(i,r[0],r[1],e.topLeftOuter,e.topRightOuter,o.left,o.top),Z(i,r[1],r[2],e.topRightOuter,e.bottomRightOuter,o.left+o.width,o.top),Z(i,r[2],r[3],e.bottomRightOuter,e.bottomLeftOuter,o.left+o.width,o.top+o.height),Z(i,r[3],r[0],e.bottomLeftOuter,e.topLeftOuter,o.left,o.top+o.height)}return i};var re=0,oe="withCredentials"in new XMLHttpRequest,ie="crossOrigin"in new Image;Lt.prototype.cloneTo=function(t){Lt.prototype.cloneTo.call(this,t),t.isPseudoElement=!0,t.before=this.before},(Lt.prototype=Object.create(D.prototype)).appendToDOM=function{this.before?this.parent.node.insertBefore(this.node,this.parent.node.firstChild):this.parent.node.appendChild(this.node),this.parent.node.className+=" "+this.getHideClass},Lt.prototype.cleanDOM=function{this.node.parentNode.removeChild(this.node),this.parent.node.className=this.parent.node.className.replace(this.getHideClass,"")},Lt.prototype.getHideClass=function{return this["PSEUDO_HIDE_ELEMENT_CLASS_"+(this.before?"BEFORE":"AFTER")]},Lt.prototype.PSEUDO_HIDE_ELEMENT_CLASS_BEFORE="___html2canvas___pseudoelement_before",Lt.prototype.PSEUDO_HIDE_ELEMENT_CLASS_AFTER="___html2canvas___pseudoelement_after",Dt.prototype.renderImage=function(t,e,n,r){var o=t.cssInt("paddingLeft"),i=t.cssInt("paddingTop"),s=t.cssInt("paddingRight"),a=t.cssInt("paddingBottom"),c=n.borders,h=e.width-(c[1].width+c[3].width+o+s),l=e.height-(c[0].width+c[2].width+i+a);this.drawImage(r,0,0,r.image.width||h,r.image.height||l,e.left+o+c[3].width,e.top+i+c[0].width,h,l)},Dt.prototype.renderBackground=function(t,e,n){e.height>0&&e.width>0&&(this.renderBackgroundColor(t,e),this.renderBackgroundImage(t,e,n))},Dt.prototype.renderBackgroundColor=function(t,e){var n=t.color("backgroundColor");n.isTransparent||this.rectangle(e.left,e.top,e.width,e.height,n)},Dt.prototype.renderBorders=function(t){t.forEach(this.renderBorder,this)},Dt.prototype.renderBorder=function(t){t.color.isTransparent||null===t.args||this.drawShape(t.args,t.color)},Dt.prototype.renderBackgroundImage=function(t,e,n){t.parseBackgroundImages.reverse.forEach(function(r,o,i){switch(r.method){case"url":var s=this.images.get(r.args[0]);s?this.renderBackgroundRepeating(t,e,s,i.length-(o+1),n):L("Error loading background-image",r.args[0]);break;case"linear-gradient":case"gradient":var a=this.images.get(r.value);a?this.renderBackgroundGradient(a,e,n):L("Error loading background-image",r.args[0]);break;case"none":break;default:L("Unknown background-image type",r.args[0])}},this)},Dt.prototype.renderBackgroundRepeating=function(t,e,n,r,o){var i=t.parseBackgroundSize(e,n.image,r),s=t.parseBackgroundPosition(e,n.image,r,i);switch(t.parseBackgroundRepeat(r)){case"repeat-x":case"repeat no-repeat":this.backgroundRepeatShape(n,s,i,e,e.left+o[3],e.top+s.top+o[0],99999,i.height,o);break;case"repeat-y":case"no-repeat repeat":this.backgroundRepeatShape(n,s,i,e,e.left+s.left+o[3],e.top+o[0],i.width,99999,o);break;case"no-repeat":this.backgroundRepeatShape(n,s,i,e,e.left+s.left+o[3],e.top+s.top+o[0],i.width,i.height,o);break;default:this.renderBackgroundRepeat(n,s,i,{top:e.top,left:e.left},o[3],o[0])}},(Bt.prototype=Object.create(D.prototype)).getParentStack=function(t){var e=this.parent?this.parent.stack:null;return e?e.ownStacking?e:e.getParentStack(t):t.stack},_t.prototype.testRangeBounds=function(t){var e,n,r=!1;return t.createRange&&(e=t.createRange).getBoundingClientRect&&((n=t.createElement("boundtest")).style.height="123px",n.style.display="block",t.body.appendChild(n),e.selectNode(n),123===e.getBoundingClientRect.height&&(r=!0),t.body.removeChild(n)),r},_t.prototype.testCORS=function{return void 0!==(new Image).crossOrigin},_t.prototype.testSVG=function{var t=new Image,n=e.createElement("canvas"),r=n.getContext("2d");t.src="data:image/svg+xml, ";try{r.drawImage(t,0,0),n.toDataURL}catch(t){return!1}return!0},Ft.prototype.hasFabric=function{return html2canvas.fabric?Promise.resolve:Promise.reject(new Error("html2canvas.svg.js is not loaded, cannot render svg"))},Ft.prototype.inlineFormatting=function(t){return/^data:image\/svg\+xml;base64,/.test(t)?this.decode64(this.removeContentType(t)):this.removeContentType(t)},Ft.prototype.removeContentType=function(t){return t.replace(/^data:image\/svg\+xml(base64)?,/,"")},Ft.prototype.isInline=function(t){return/^data:image\/svg\+xml/i.test(t)},Ft.prototype.createCanvas=function(t){var e=this;return function(n,r){var o=new html2canvas.fabric.StaticCanvas("c");e.image=o.lowerCanvasEl,o.setWidth(r.width).setHeight(r.height).add(html2canvas.fabric.util.groupSVGElements(n,r)).renderAll,t(o.lowerCanvasEl)}},Ft.prototype.decode64=function(e){return"function"==typeof t.atob?t.atob(e):jt(e)},Ht.prototype=Object.create(Ft.prototype),(Wt.prototype=Object.create(D.prototype)).applyTextTransform=function{this.node.data=this.transform(this.parent.css("textTransform"))},Wt.prototype.transform=function(t){var e=this.node.data;switch(t){case"lowercase":return e.toLowerCase;case"capitalize":return e.replace(/(^|\s|:|-|\(|\))([a-z])/g,Vt);case"uppercase":return e.toUpperCase;default:return e}},zt.prototype=Object.create(A.prototype),(qt.prototype=Object.create(Dt.prototype)).setFillStyle=function(t){return this.ctx.fillStyle="object"==typeof t&&t.isColor?t.toString:t,this.ctx},qt.prototype.rectangle=function(t,e,n,r,o){this.setFillStyle(o).fillRect(t,e,n,r)},qt.prototype.circle=function(t,e,n,r){this.setFillStyle(r),this.ctx.beginPath,this.ctx.arc(t+n/2,e+n/2,n/2,0,2*Math.PI,!0),this.ctx.closePath,this.ctx.fill},qt.prototype.circleStroke=function(t,e,n,r,o,i){this.circle(t,e,n,r),this.ctx.strokeStyle=i.toString,this.ctx.stroke},qt.prototype.drawShape=function(t,e){this.shape(t),this.setFillStyle(e).fill},qt.prototype.taints=function(t){if(null===t.tainted){this.taintCtx.drawImage(t.image,0,0);try{this.taintCtx.getImageData(0,0,1,1),t.tainted=!1}catch(n){this.taintCtx=e.createElement("canvas").getContext("2d"),t.tainted=!0}}return t.tainted},qt.prototype.drawImage=function(t,e,n,r,o,i,s,a,c){this.taints(t)&&!this.options.allowTaint||this.ctx.drawImage(t.image,e,n,r,o,i,s,a,c)},qt.prototype.clip=function(t,e,n){this.ctx.save,t.filter(Xt).forEach(function(t){this.shape(t).clip},this),e.call(n),this.ctx.restore},qt.prototype.shape=function(t){return this.ctx.beginPath,t.forEach(function(t,e){"rect"===t[0]?this.ctx.rect.apply(this.ctx,t.slice(1)):this.ctx[0===e?"moveTo":t[0]+"To"].apply(this.ctx,t.slice(1))},this),this.ctx.closePath,this.ctx},qt.prototype.font=function(t,e,n,r,o,i){this.setFillStyle(t).font=[e,n,r,o,i].join(" ").split(",")[0]},qt.prototype.fontShadow=function(t,e,n,r){this.setVariable("shadowColor",t.toString).setVariable("shadowOffsetY",e).setVariable("shadowOffsetX",n).setVariable("shadowBlur",r)},qt.prototype.clearShadow=function{this.setVariable("shadowColor","rgba(0,0,0,0)")},qt.prototype.setOpacity=function(t){this.ctx.globalAlpha=t},qt.prototype.setTransform=function(t){this.ctx.translate(t.origin[0],t.origin[1]),this.ctx.transform.apply(this.ctx,t.matrix),this.ctx.translate(-t.origin[0],-t.origin[1])},qt.prototype.setVariable=function(t,e){return this.variables[t]!==e&&(this.variables[t]=this.ctx[t]=e),this},qt.prototype.text=function(t,e,n){this.ctx.fillText(t,e,n)},qt.prototype.backgroundRepeatShape=function(t,e,n,r,o,i,s,a,c){var h="line",Math.round(o),Math.round(i)],["line",Math.round(o+s),Math.round(i)],["line",Math.round(o+s),Math.round(a+i)],["line",Math.round(o),Math.round(a+i);this.clip([h],function{this.renderBackgroundRepeat(t,e,n,r,c[3],c[0])},this)},qt.prototype.renderBackgroundRepeat=function(t,e,n,r,o,i){var s=Math.round(r.left+e.left+o),a=Math.round(r.top+e.top+i);this.setFillStyle(this.ctx.createPattern(this.resizeImage(t,n),"repeat")),this.ctx.translate(s,a),this.ctx.fill,this.ctx.translate(-s,-a)},qt.prototype.renderBackgroundGradient=function(t,e){if(t instanceof N){var n=this.ctx.createLinearGradient(e.left+e.width*t.x0,e.top+e.height*t.y0,e.left+e.width*t.x1,e.top+e.height*t.y1);t.colorStops.forEach(function(t){n.addColorStop(t.stop,t.color.toString)}),this.rectangle(e.left,e.top,e.width,e.height,n)}},qt.prototype.resizeImage=function(t,n){var r=t.image;if(r.width===n.width&&r.height===n.height)return r;var o=e.createElement("canvas");return o.width=n.width,o.height=n.height,o.getContext("2d").drawImage(r,0,0,r.width,r.height,0,0,n.width,n.height),o}}else(t||module.exports).html2canvas=function{return Promise.reject("No canvas support")}}).call({},"undefined"!=typeof window?window:void 0,"undefined"!=typeof document?document:void 0);$(".thumb>div").click(function(t){html2canvas($(t.target).closest(".thumb>div"),{useCORS:!0,height:123,width:255,allowTaint:!0,letterRendering:!0,logging:!0,onrendered:function(e){$(t.target).closest(".thumb").append(e)}})});