33 lines
46 KiB
JavaScript
33 lines
46 KiB
JavaScript
/**
|
|
* Modules in this bundle
|
|
* @license
|
|
*
|
|
* svg2pdf.js:
|
|
* license: MIT (http://opensource.org/licenses/MIT)
|
|
* author: yFiles for HTML Support Team <yfileshtml@yworks.com>
|
|
* homepage: https://github.com/yWorks/svg2pdf.js#readme
|
|
* version: 1.3.0
|
|
*
|
|
* font-family:
|
|
* license: MIT (http://opensource.org/licenses/MIT)
|
|
* author: Taro Hanamura <m@hanamurataro.com>
|
|
* homepage: https://github.com/hanamura/font-family
|
|
* version: 0.2.0
|
|
*
|
|
* svgpath:
|
|
* license: MIT (http://opensource.org/licenses/MIT)
|
|
* homepage: https://github.com/fontello/svgpath#readme
|
|
* version: 2.2.1
|
|
*
|
|
* This header is generated by licensify (https://github.com/twada/licensify)
|
|
*/
|
|
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).svg2pdf=t()}}(function(){return function n(s,o,h){function c(e,t){if(!o[e]){if(!s[e]){var r="function"==typeof require&&require;if(!t&&r)return r(e,!0);if(u)return u(e,!0);var a=new Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}var i=o[e]={exports:{}};s[e][0].call(i.exports,function(t){return c(s[e][1][t]||t)},i,i.exports,n,s,o,h)}return o[e].exports}for(var u="function"==typeof require&&require,t=0;t<h.length;t++)c(h[t]);return c}({1:[function(t,e,r){"use strict";e.exports=t("./lib/svgpath")},{"./lib/svgpath":6}],2:[function(t,e,r){"use strict";var C=2*Math.PI;function I(t,e,r,a){var i=t*a-e*r<0?-1:1,n=(t*r+e*a)/(Math.sqrt(t*t+e*e)*Math.sqrt(t*t+e*e));return 1<n&&(n=1),n<-1&&(n=-1),i*Math.acos(n)}e.exports=function(t,e,r,a,i,n,s,o,h){var c=Math.sin(h*C/360),u=Math.cos(h*C/360),f=u*(t-r)/2+c*(e-a)/2,l=-c*(t-r)/2+u*(e-a)/2;if(0===f&&0===l)return[];if(0===s||0===o)return[];s=Math.abs(s),o=Math.abs(o);var d=f*f/(s*s)+l*l/(o*o);1<d&&(s*=Math.sqrt(d),o*=Math.sqrt(d));var p,g,x,b,m,v,y,k=function(t,e,r,a,i,n,s,o,h,c){var u=c*(t-r)/2+h*(e-a)/2,f=-h*(t-r)/2+c*(e-a)/2,l=s*s,d=o*o,p=u*u,g=f*f,x=l*d-l*g-d*p;x<0&&(x=0),x/=l*g+d*p;var b=(x=Math.sqrt(x)*(i===n?-1:1))*s/o*f,m=x*-o/s*u,v=c*b-h*m+(t+r)/2,y=h*b+c*m+(e+a)/2,k=(u-b)/s,w=(f-m)/o,M=(-u-b)/s,A=(-f-m)/o,S=I(1,0,k,w),F=I(k,w,M,A);return 0===n&&0<F&&(F-=C),1===n&&F<0&&(F+=C),[v,y,S,F]}(t,e,r,a,i,n,s,o,c,u),w=[],M=k[2],A=k[3],S=Math.max(Math.ceil(Math.abs(A)/(C/4)),1);A/=S;for(var F=0;F<S;F++)w.push((p=M,g=A,void 0,x=4/3*Math.tan(g/4),b=Math.cos(p),m=Math.sin(p),v=Math.cos(p+g),y=Math.sin(p+g),[b,m,b-m*x,m+b*x,v+y*x,y-v*x,v,y])),M+=A;return w.map(function(t){for(var e=0;e<t.length;e+=2){var r=t[e+0],a=t[e+1],i=u*(r*=s)-c*(a*=o),n=c*r+u*a;t[e+0]=i+k[0],t[e+1]=n+k[1]}return t})}},{}],3:[function(t,e,r){"use strict";var f=1e-10,l=Math.PI/180;function a(t,e,r){if(!(this instanceof a))return new a(t,e,r);this.rx=t,this.ry=e,this.ax=r}a.prototype.transform=function(t){var e=Math.cos(this.ax*l),r=Math.sin(this.ax*l),a=[this.rx*(t[0]*e+t[2]*r),this.rx*(t[1]*e+t[3]*r),this.ry*(-t[0]*r+t[2]*e),this.ry*(-t[1]*r+t[3]*e)],i=a[0]*a[0]+a[2]*a[2],n=a[1]*a[1]+a[3]*a[3],s=((a[0]-a[3])*(a[0]-a[3])+(a[2]+a[1])*(a[2]+a[1]))*((a[0]+a[3])*(a[0]+a[3])+(a[2]-a[1])*(a[2]-a[1])),o=(i+n)/2;if(s<f*o)return this.rx=this.ry=Math.sqrt(o),this.ax=0,this;var h=a[0]*a[1]+a[2]*a[3],c=o+(s=Math.sqrt(s))/2,u=o-s/2;return this.ax=Math.abs(h)<f&&Math.abs(c-n)<f?90:180*Math.atan(Math.abs(h)>Math.abs(c-n)?(c-i)/h:h/(c-n))/Math.PI,0<=this.ax?(this.rx=Math.sqrt(c),this.ry=Math.sqrt(u)):(this.ax+=90,this.rx=Math.sqrt(u),this.ry=Math.sqrt(c)),this},a.prototype.isDegenerate=function(){return this.rx<f*this.ry||this.ry<f*this.rx},e.exports=a},{}],4:[function(t,e,r){"use strict";function a(){if(!(this instanceof a))return new a;this.queue=[],this.cache=null}a.prototype.matrix=function(t){return 1===t[0]&&0===t[1]&&0===t[2]&&1===t[3]&&0===t[4]&&0===t[5]||(this.cache=null,this.queue.push(t)),this},a.prototype.translate=function(t,e){return 0===t&&0===e||(this.cache=null,this.queue.push([1,0,0,1,t,e])),this},a.prototype.scale=function(t,e){return 1===t&&1===e||(this.cache=null,this.queue.push([t,0,0,e,0,0])),this},a.prototype.rotate=function(t,e,r){var a,i,n;return 0!==t&&(this.translate(e,r),a=t*Math.PI/180,i=Math.cos(a),n=Math.sin(a),this.queue.push([i,n,-n,i,0,0]),this.cache=null,this.translate(-e,-r)),this},a.prototype.skewX=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,0,Math.tan(t*Math.PI/180),1,0,0])),this},a.prototype.skewY=function(t){return 0!==t&&(this.cache=null,this.queue.push([1,Math.tan(t*Math.PI/180),0,1,0,0])),this},a.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],1===this.queue.length)return this.cache;for(var t=1;t<this.queue.length;t++)this.cache=(e=this.cache,r=this.queue[t],[e[0]*r[0]+e[2]*r[1],e[1]*r[0]+e[3]*r[1],e[0]*r[2]+e[2]*r[3],e[1]*r[2]+e[3]*r[3],e[0]*r[4]+e[2]*r[5]+e[4],e[1]*r[4]+e[3]*r[5]+e[5]]);var e,r;return this.cache},a.prototype.calc=function(t,e,r){var a;return this.queue.length?(this.cache||(this.cache=this.toArray()),[t*(a=this.cache)[0]+e*a[2]+(r?0:a[4]),t*a[1]+e*a[3]+(r?0:a[5])]):[t,e]},e.exports=a},{}],5:[function(t,e,r){"use strict";var s={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},a=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function c(t){return 48<=t&&t<=57}function i(t){this.index=0,this.path=t,this.max=t.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function o(t){for(;t.index<t.max&&(10===(e=t.path.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||5760<=e&&0<=a.indexOf(e));)t.index++;var e}function h(t){var e,r=t.index,a=r,i=t.max,n=!1,s=!1,o=!1,h=!1;if(i<=a)t.err="SvgPath: missed param (at pos "+a+")";else if(43!==(e=t.path.charCodeAt(a))&&45!==e||(e=++a<i?t.path.charCodeAt(a):0),c(e)||46===e){if(46!==e){if(n=48===e,e=++a<i?t.path.charCodeAt(a):0,n&&a<i&&e&&c(e))return void(t.err="SvgPath: numbers started with `0` such as `09` are ilegal (at pos "+r+")");for(;a<i&&c(t.path.charCodeAt(a));)a++,s=!0;e=a<i?t.path.charCodeAt(a):0}if(46===e){for(h=!0,a++;c(t.path.charCodeAt(a));)a++,o=!0;e=a<i?t.path.charCodeAt(a):0}if(101===e||69===e){if(h&&!s&&!o)return void(t.err="SvgPath: invalid float exponent (at pos "+a+")");if(43!==(e=++a<i?t.path.charCodeAt(a):0)&&45!==e||a++,!(a<i&&c(t.path.charCodeAt(a))))return void(t.err="SvgPath: invalid float exponent (at pos "+a+")");for(;a<i&&c(t.path.charCodeAt(a));)a++}t.index=a,t.param=parseFloat(t.path.slice(r,a))+0}else t.err="SvgPath: param should start with 0..9 or `.` (at pos "+a+")"}function u(t){var e,r;r=(e=t.path[t.segmentStart]).toLowerCase();var a=t.data;if("m"===r&&2<a.length&&(t.result.push([e,a[0],a[1]]),a=a.slice(2),r="l",e="m"===e?"l":"L"),"r"===r)t.result.push([e].concat(a));else for(;a.length>=s[r]&&(t.result.push([e].concat(a.splice(0,s[r]))),s[r]););}function n(t){var e,r,a,i=t.max;if(t.segmentStart=t.index,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:case 114:return!0}return!1}(t.path.charCodeAt(t.index)))if(r=s[t.path[t.index].toLowerCase()],t.index++,o(t),t.data=[],r){for(e=!1;;){for(a=r;0<a;a--){if(h(t),t.err.length)return;t.data.push(t.param),o(t),e=!1,t.index<i&&44===t.path.charCodeAt(t.index)&&(t.index++,o(t),e=!0)}if(!e){if(t.index>=t.max)break;if(!(48<=(n=t.path.charCodeAt(t.index))&&n<=57||43===n||45===n||46===n))break}}var n;u(t)}else u(t);else t.err="SvgPath: bad command "+t.path[t.index]+" (at pos "+t.index+")"}e.exports=function(t){var e=new i(t),r=e.max;for(o(e);e.index<r&&!e.err.length;)n(e);return e.err.length?e.result=[]:e.result.length&&("mM".indexOf(e.result[0][0])<0?(e.err="SvgPath: string should start with `M` or `m`",e.result=[]):e.result[0][0]="M"),{err:e.err,segments:e.result}}},{}],6:[function(t,e,r){"use strict";var a=t("./path_parse"),i=t("./transform_parse"),n=t("./matrix"),c=t("./a2c"),d=t("./ellipse");function s(t){if(!(this instanceof s))return new s(t);var e=a(t);this.segments=e.segments,this.err=e.err,this.__stack=[]}s.prototype.__matrix=function(u){var f,l=this;u.queue.length&&this.iterate(function(t,e,r,a){var i,n,s,o;switch(t[0]){case"v":n=0===(i=u.calc(0,t[1],!0))[0]?["v",i[1]]:["l",i[0],i[1]];break;case"V":n=(i=u.calc(r,t[1],!1))[0]===u.calc(r,a,!1)[0]?["V",i[1]]:["L",i[0],i[1]];break;case"h":n=0===(i=u.calc(t[1],0,!0))[1]?["h",i[0]]:["l",i[0],i[1]];break;case"H":n=(i=u.calc(t[1],a,!1))[1]===u.calc(r,a,!1)[1]?["H",i[0]]:["L",i[0],i[1]];break;case"a":case"A":var h=u.toArray(),c=d(t[1],t[2],t[3]).transform(h);if(h[0]*h[3]-h[1]*h[2]<0&&(t[5]=t[5]?"0":"1"),i=u.calc(t[6],t[7],"a"===t[0]),"A"===t[0]&&t[6]===r&&t[7]===a||"a"===t[0]&&0===t[6]&&0===t[7]){n=["a"===t[0]?"l":"L",i[0],i[1]];break}n=c.isDegenerate()?["a"===t[0]?"l":"L",i[0],i[1]]:[t[0],c.rx,c.ry,c.ax,t[4],t[5],i[0],i[1]];break;case"m":o=0<e,n=["m",(i=u.calc(t[1],t[2],o))[0],i[1]];break;default:for(n=[s=t[0]],o=s.toLowerCase()===s,f=1;f<t.length;f+=2)i=u.calc(t[f],t[f+1],o),n.push(i[0],i[1])}l.segments[e]=n},!0)},s.prototype.__evaluateStack=function(){var t,e;if(this.__stack.length){if(1===this.__stack.length)return this.__matrix(this.__stack[0]),void(this.__stack=[]);for(t=n(),e=this.__stack.length;0<=--e;)t.matrix(this.__stack[e].toArray());this.__matrix(t),this.__stack=[]}},s.prototype.toString=function(){var t,e,r=[];this.__evaluateStack();for(var a=0;a<this.segments.length;a++)e=this.segments[a][0],t=0<a&&"m"!==e&&"M"!==e&&e===this.segments[a-1][0],r=r.concat(t?this.segments[a].slice(1):this.segments[a]);return r.join(" ").replace(/ ?([achlmqrstvz]) ?/gi,"$1").replace(/ \-/g,"-").replace(/zm/g,"z m")},s.prototype.translate=function(t,e){return this.__stack.push(n().translate(t,e||0)),this},s.prototype.scale=function(t,e){return this.__stack.push(n().scale(t,e||0===e?e:t)),this},s.prototype.rotate=function(t,e,r){return this.__stack.push(n().rotate(t,e||0,r||0)),this},s.prototype.skewX=function(t){return this.__stack.push(n().skewX(t)),this},s.prototype.skewY=function(t){return this.__stack.push(n().skewY(t)),this},s.prototype.matrix=function(t){return this.__stack.push(n().matrix(t)),this},s.prototype.transform=function(t){return t.trim()&&this.__stack.push(i(t)),this},s.prototype.round=function(a){var e,i=0,n=0,s=0,o=0;return a=a||0,this.__evaluateStack(),this.segments.forEach(function(r){var t=r[0].toLowerCase()===r[0];switch(r[0]){case"H":case"h":return t&&(r[1]+=s),s=r[1]-r[1].toFixed(a),void(r[1]=+r[1].toFixed(a));case"V":case"v":return t&&(r[1]+=o),o=r[1]-r[1].toFixed(a),void(r[1]=+r[1].toFixed(a));case"Z":case"z":return s=i,void(o=n);case"M":case"m":return t&&(r[1]+=s,r[2]+=o),s=r[1]-r[1].toFixed(a),o=r[2]-r[2].toFixed(a),i=s,n=o,r[1]=+r[1].toFixed(a),void(r[2]=+r[2].toFixed(a));case"A":case"a":return t&&(r[6]+=s,r[7]+=o),s=r[6]-r[6].toFixed(a),o=r[7]-r[7].toFixed(a),r[1]=+r[1].toFixed(a),r[2]=+r[2].toFixed(a),r[3]=+r[3].toFixed(a+2),r[6]=+r[6].toFixed(a),void(r[7]=+r[7].toFixed(a));default:return e=r.length,t&&(r[e-2]+=s,r[e-1]+=o),s=r[e-2]-r[e-2].toFixed(a),o=r[e-1]-r[e-1].toFixed(a),void r.forEach(function(t,e){e&&(r[e]=+r[e].toFixed(a))})}}),this},s.prototype.iterate=function(i,t){var e,r,a,n=this.segments,s={},o=!1,h=0,c=0,u=0,f=0;if(t||this.__evaluateStack(),n.forEach(function(t,e){var r=i(t,e,h,c);Array.isArray(r)&&(s[e]=r,o=!0);var a=t[0]===t[0].toLowerCase();switch(t[0]){case"m":case"M":return h=t[1]+(a?h:0),c=t[2]+(a?c:0),u=h,void(f=c);case"h":case"H":return void(h=t[1]+(a?h:0));case"v":case"V":return void(c=t[1]+(a?c:0));case"z":case"Z":return h=u,void(c=f);default:h=t[t.length-2]+(a?h:0),c=t[t.length-1]+(a?c:0)}}),!o)return this;for(a=[],e=0;e<n.length;e++)if(void 0!==s[e])for(r=0;r<s[e].length;r++)a.push(s[e][r]);else a.push(n[e]);return this.segments=a,this},s.prototype.abs=function(){return this.iterate(function(t,e,r,a){var i,n=t[0],s=n.toUpperCase();if(n!==s)switch(t[0]=s,n){case"v":return void(t[1]+=a);case"a":return t[6]+=r,void(t[7]+=a);default:for(i=1;i<t.length;i++)t[i]+=i%2?r:a}},!0),this},s.prototype.rel=function(){return this.iterate(function(t,e,r,a){var i,n=t[0],s=n.toLowerCase();if(n!==s&&(0!==e||"M"!==n))switch(t[0]=s,n){case"V":return void(t[1]-=a);case"A":return t[6]-=r,void(t[7]-=a);default:for(i=1;i<t.length;i++)t[i]-=i%2?r:a}},!0),this},s.prototype.unarc=function(){return this.iterate(function(t,e,r,a){var i,n,s,o=[],h=t[0];return"A"!==h&&"a"!==h?null:("a"===h?(n=r+t[6],s=a+t[7]):(n=t[6],s=t[7]),0===(i=c(r,a,n,s,t[4],t[5],t[1],t[2],t[3])).length?[["a"===t[0]?"l":"L",t[6],t[7]]]:(i.forEach(function(t){o.push(["C",t[2],t[3],t[4],t[5],t[6],t[7]])}),o))}),this},s.prototype.unshort=function(){var o,h,c,u,f,l=this.segments;return this.iterate(function(t,e,r,a){var i,n=t[0],s=n.toUpperCase();e&&("T"===s?(i="t"===n,"Q"===(c=l[e-1])[0]?(o=c[1]-r,h=c[2]-a):"q"===c[0]?(o=c[1]-c[3],h=c[2]-c[4]):h=o=0,u=-o,f=-h,i||(u+=r,f+=a),l[e]=[i?"q":"Q",u,f,t[1],t[2]]):"S"===s&&(i="s"===n,"C"===(c=l[e-1])[0]?(o=c[3]-r,h=c[4]-a):"c"===c[0]?(o=c[3]-c[5],h=c[4]-c[6]):h=o=0,u=-o,f=-h,i||(u+=r,f+=a),l[e]=[i?"c":"C",u,f,t[1],t[2],t[3],t[4]]))}),this},e.exports=s},{"./a2c":2,"./ellipse":3,"./matrix":4,"./path_parse":5,"./transform_parse":7}],7:[function(t,e,r){"use strict";var i=t("./matrix"),n={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},s=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,o=/[\s,]+/;e.exports=function(t){var e,r,a=new i;return t.split(s).forEach(function(t){if(t.length)if(void 0===n[t])switch(r=t.split(o).map(function(t){return+t||0}),e){case"matrix":return void(6===r.length&&a.matrix(r));case"scale":return void(1===r.length?a.scale(r[0],r[0]):2===r.length&&a.scale(r[0],r[1]));case"rotate":return void(1===r.length?a.rotate(r[0],0,0):3===r.length&&a.rotate(r[0],r[1],r[2]));case"translate":return void(1===r.length?a.translate(r[0],0):2===r.length&&a.translate(r[0],r[1]));case"skewX":return void(1===r.length&&a.skewX(r[0]));case"skewY":return void(1===r.length&&a.skewY(r[0]))}else e=t}),a}},{"./matrix":4}],8:[function(t,e,r){var h=/[a-z0-9_-]/i,c=/[\s\t]/,o=/[^a-z0-9_-]/i;e.exports={parse:function(t){for(var e,r,a=!0,i=0,n="",s=0,o=[];;){if(r=t[s],0===i){if(!r&&a)break;if(!r&&!a)throw new Error("Parse error");if('"'===r||"'"===r)e=r,a=!(i=1);else if(c.test(r));else{if(!h.test(r))throw new Error("Parse error");a=!(i=3),s--}}else if(1===i){if(!r)throw new Error("Parse Error");"\\"===r?i=2:r===e?(o.push(n),n="",i=4):n+=r}else if(2===i){if(r!==e&&"\\"!==r)throw new Error("Parse error");n+=r,i=1}else if(3===i){if(!r){o.push(n);break}if(h.test(r))n+=r;else if(","===r)o.push(n),n="",i=0;else{if(!c.test(r))throw new Error("Parse error");o.push(n),n="",i=4}}else if(4===i){if(!r)break;if(","===r)i=0;else if(!c.test(r))throw new Error("Parse error")}s++}return o},stringify:function(t,e){var r=e&&e.quote||'"';if('"'!==r&&"'"!==r)throw new Error("Quote must be `'` or `\"`");for(var a=new RegExp(r,"g"),i=[],n=0;n<t.length;++n){var s=t[n];o.test(s)&&(s=r+(s=s.replace(/\\/g,"\\\\").replace(a,"\\"+r))+r),i.push(s)}return i.join(", ")}}},{}],9:[function(t,e,r){
|
|
/**
|
|
* A class to parse color values
|
|
* @author Stoyan Stefanov <sstoo@gmail.com>
|
|
* @link http://www.phpied.com/rgb-color-parser-in-javascript/
|
|
* @license Use it if you like it
|
|
*/
|
|
!function(t){function l(t){this.ok=!1,"#"==t.charAt(0)&&(t=t.substr(1,6)),t=(t=t.replace(/ /g,"")).toLowerCase();var u={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};for(var e in u)t==e&&(t=u[e]);for(var f=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(t){return[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}}],r=0;r<f.length;r++){var a=f[r].re,i=f[r].process,n=a.exec(t);if(n){var s=i(n);this.r=s[0],this.g=s[1],this.b=s[2],this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:255<this.r?255:this.r,this.g=this.g<0||isNaN(this.g)?0:255<this.g?255:this.g,this.b=this.b<0||isNaN(this.b)?0:255<this.b?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var t=this.r.toString(16),e=this.g.toString(16),r=this.b.toString(16);return 1==t.length&&(t="0"+t),1==e.length&&(e="0"+e),1==r.length&&(r="0"+r),"#"+t+e+r},this.getHelpXML=function(){for(var t=new Array,e=0;e<f.length;e++)for(var r=f[e].example,a=0;a<r.length;a++)t[t.length]=r[a];for(var i in u)t[t.length]=i;var n=document.createElement("ul");n.setAttribute("id","rgbcolor-examples");for(e=0;e<t.length;e++)try{var s=document.createElement("li"),o=new l(t[e]),h=document.createElement("div");h.style.cssText="margin: 3px; border: 1px solid black; background:"+o.toHex()+"; color:"+o.toHex(),h.appendChild(document.createTextNode("test"));var c=document.createTextNode(" "+t[e]+" -> "+o.toRGB()+" -> "+o.toHex());s.appendChild(h),s.appendChild(c),n.appendChild(s)}catch(t){}return n}}void 0!==e&&e.exports?e.exports=l:t.RGBColor=l}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this)},{}],10:[function(r,i,t){!function(t){var ut,u,c,ft,lt=/url\(["']?#([^"']+)["']?\)/,dt=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*\s*)$/i,h="http://www.w3.org/2000/svg",pt=function(t){var e=t.getAttribute("d");u&&(e=u(e).unshort().unarc().abs().toString(),t.setAttribute("d",e));var r=t.pathSegList;if(r)return r;r=[];for(var a,i=/([a-df-zA-DF-Z])([^a-df-zA-DF-Z]*)/g;a=i.exec(e);){var n=_t(a[2]),s=a[1],o=0<="zZ".indexOf(s)?0:0<="hHvV".indexOf(s)?1:0<="mMlLtT".indexOf(s)?2:0<="sSqQ".indexOf(s)?4:0<="aA".indexOf(s)?7:0<="cC".indexOf(s)?6:-1,h=0;do{var c={pathSegTypeAsLetter:s};switch(s){case"h":case"H":c.x=n[h];break;case"v":case"V":c.y=n[h];break;case"c":case"C":c.x1=n[h+o-6],c.y1=n[h+o-5];case"s":case"S":c.x2=n[h+o-4],c.y2=n[h+o-3];case"t":case"T":case"l":case"L":case"m":case"M":c.x=n[h+o-2],c.y=n[h+o-1];break;case"q":case"Q":c.x1=n[h],c.y1=n[h+1],c.x=n[h+2],c.y=n[h+3];break;case"a":case"A":throw new Error("Cannot convert Arcs without SvgPath package")}r.push(c),"m"===s?s="l":"M"===s&&(s="L"),h+=o}while(h<n.length)}return r.getItem=function(t){return this[t]},r.numberOfItems=r.length,r},gt=function(t,e,r){return r=r||e,t.getAttribute(e)||t.style&&t.style[r]},xt=function(t,e){return 0<=e.split(",").indexOf(t.tagName.toLowerCase())},L=function(t,e){for(var r=[],a=0;a<t.childNodes.length;a++){var i=t.childNodes[a];"#"!==i.nodeName.charAt(0)&&r.push(i)}for(a=0;a<r.length;a++)e(a,r[a])},bt=function(t,e){return Math.atan2(e[1]-t[1],e[0]-t[0])};function mt(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}function vt(t,e){return mt([e[0]-t[0],e[1]-t[1]])}function yt(t,e){return[t[0]+e[0],t[1]+e[1]]}var s=function(t,e){var r=e[0]-t[0],a=e[1]-t[1];return[t[0]+2*r,t[1]+2*a]},kt=function(t,e){return[2/3*(e[0]-t[0])+t[0],2/3*(e[1]-t[1])+t[1]]},wt=function(t,e,r,a,i){var n=r.getItem(t-1);return 0<t&&("C"===n.pathSegTypeAsLetter||"S"===n.pathSegTypeAsLetter)?s([n.x2,n.y2],e):0<t&&("c"===n.pathSegTypeAsLetter||"s"===n.pathSegTypeAsLetter)?s([n.x2+a,n.y2+i],e):[e[0],e[1]]},o=function(t){this.prefix=t,this.id=0,this.nextChild=function(){return new o("_"+this.id+++"_"+this.get())},this.get=function(){return this.prefix}},Mt=function(){this.color=null,this.fill=null,this.fillOpacity=1,this.fontFamily=null,this.fontSize=16,this.fontStyle=null,this.fontWeight=null,this.opacity=1,this.stroke=null,this.strokeDasharray=null,this.strokeDashoffset=null,this.strokeLinecap=null,this.strokeLinejoin=null,this.strokeMiterlimit=4,this.strokeOpacity=1,this.strokeWidth=1,this.textAnchor=null,this.visibility=null};function At(){this.markers=[]}function St(t,e,r){this.id=t,this.anchor=e,this.angle=r}Mt.default=function(){var t=new Mt;return t.fill=new ut("rgb(0, 0, 0)"),t.fillOpacity=1,t.fontFamily="times",t.fontSize=16,t.fontStyle="normal",t.fontWeight="normal",t.opacity=1,t.stroke=null,t.strokeDasharray=null,t.strokeDashoffset=null,t.strokeLinecap="butt",t.strokeLinejoin="miter",t.strokeMiterlimit=4,t.strokeOpacity=1,t.strokeWidth=1,t.textAnchor="start",t.visibility="visible",t},Mt.prototype.clone=function(){var t=new Mt;return t.fill=this.fill,t.fillOpacity=this.fillOpacity,t.fontFamily=this.fontFamily,t.fontSize=this.fontSize,t.fontStyle=this.fontStyle,t.fontWeight=this.fontWeight,t.opacity=this.opacity,t.stroke=this.stroke,t.strokeDasharray=this.strokeDasharray,t.strokeDashoffset=this.strokeDashoffset,t.strokeLinecap=this.strokeLinecap,t.strokeLinejoin=this.strokeLinejoin,t.strokeMiterlimit=this.strokeMiterlimit,t.strokeOpacity=this.strokeOpacity,t.strokeWidth=this.strokeWidth,t.textAnchor=this.textAnchor,t.visibility=this.visibility,t},At.prototype.addMarker=function(t){this.markers.push(t)},At.prototype.draw=function(t,e){for(var r=0;r<this.markers.length;r++){var a,i=this.markers[r],n=i.angle,s=i.anchor,o=Math.cos(n),h=Math.sin(n);a=new ft.Matrix(o,h,-h,o,s[0],s[1]),a=ft.matrixMult(new ft.Matrix(e.strokeWidth,0,0,e.strokeWidth,0,0),a),a=ft.matrixMult(a,t),ft.saveGraphicsState(),ft.setLineWidth(1),ft.doFormObject(i.id,a),ft.restoreGraphicsState()}};var Ft=function(t,e){for(var r=/_\d+_/;!e[t]&&r.exec(t);)t=t.replace(r,"");return e[t]},p=function(t){return t.replace(/[\n\s\r]+/g," ").trim()};function f(t,e,r,a,i,n){var s,o,h=e[0],c=e[1],u=e[2],f=e[3],l=i/u,d=n/f,p=t.getAttribute("preserveAspectRatio");if(p){var g=p.split(" ");"defer"===g[0]&&(g=g.slice(1)),s=g[0],o=g[1]||"meet"}else s="xMidYMid",o="meet";"none"!==s&&("meet"===o?l=d=Math.min(l,d):"slice"===o&&(l=d=Math.max(l,d)));var x=r-h*l,b=a-c*d;0<=s.indexOf("xMid")?x+=(i-u*l)/2:0<=s.indexOf("xMax")&&(x+=i-u*l),0<=s.indexOf("yMid")?b+=(n-f*d)/2:0<=s.indexOf("yMax")&&(b+=n-f*d);var m=new ft.Matrix(1,0,0,1,x,b),v=new ft.Matrix(l,0,0,d,0,0);return ft.matrixMult(v,m)}var Ct=function(t){var e,r,a,i=ft.unitMatrix;if(xt(t,"svg,g"))if(r=parseFloat(t.getAttribute("x"))||0,a=parseFloat(t.getAttribute("y"))||0,e=t.getAttribute("viewBox")){var n=_t(e);i=f(t,n,r,a,parseFloat(t.getAttribute("width"))||n[2],parseFloat(t.getAttribute("height"))||n[3])}else i=new ft.Matrix(1,0,0,1,r,a);else if(xt(t,"marker"))if(r=parseFloat(t.getAttribute("refX"))||0,a=parseFloat(t.getAttribute("refY"))||0,e=t.getAttribute("viewBox")){var s=_t(e);s[0]=s[1]=0,i=f(t,s,0,0,parseFloat(t.getAttribute("markerWidth"))||3,parseFloat(t.getAttribute("markerHeight"))||3),i=ft.matrixMult(new ft.Matrix(1,0,0,1,-r,-a),i)}else i=new ft.Matrix(1,0,0,1,-r,-a);var o=t.getAttribute("transform");return o?ft.matrixMult(i,Lt(o)):i},It=function(t){for(var e=_t(t),r=[],a=0;a<e.length-1;a+=2){var i=e[a],n=e[a+1];r.push([i,n])}return r},Lt=function(t){if(!t)return ft.unitMatrix;for(var e,r=/^\s*matrix\(([^\)]+)\)\s*/,a=/^\s*translate\(([^\)]+)\)\s*/,i=/^\s*rotate\(([^\)]+)\)\s*/,n=/^\s*scale\(([^\)]+)\)\s*/,s=/^\s*skewX\(([^\)]+)\)\s*/,o=/^\s*skewY\(([^\)]+)\)\s*/,h=ft.unitMatrix;0<t.length;){var c=r.exec(t);if(c&&(e=_t(c[1]),h=ft.matrixMult(new ft.Matrix(e[0],e[1],e[2],e[3],e[4],e[5]),h),t=t.substr(c[0].length)),c=i.exec(t)){e=_t(c[1]);var u=Math.PI*e[0]/180;if(h=ft.matrixMult(new ft.Matrix(Math.cos(u),Math.sin(u),-Math.sin(u),Math.cos(u),0,0),h),e[1]&&e[2]){var f=new ft.Matrix(1,0,0,1,e[1],e[2]),l=new ft.Matrix(1,0,0,1,-e[1],-e[2]);h=ft.matrixMult(l,ft.matrixMult(h,f))}t=t.substr(c[0].length)}(c=a.exec(t))&&(e=_t(c[1]),h=ft.matrixMult(new ft.Matrix(1,0,0,1,e[0],e[1]||0),h),t=t.substr(c[0].length)),(c=n.exec(t))&&((e=_t(c[1]))[1]||(e[1]=e[0]),h=ft.matrixMult(new ft.Matrix(e[0],0,0,e[1],0,0),h),t=t.substr(c[0].length)),(c=s.exec(t))&&(e=parseFloat(c[1]),h=ft.matrixMult(new ft.Matrix(1,0,Math.tan(e),1,0,0),h),t=t.substr(c[0].length)),(c=o.exec(t))&&(e=parseFloat(c[1]),h=ft.matrixMult(new ft.Matrix(1,Math.tan(e),0,1,0,0),h),t=t.substr(c[0].length))}return h},_t=function(t){for(var e,r=[],a=/[+-]?(?:(?:\d+\.?\d*)|(?:\d*\.?\d+))(?:[eE][+-]?\d+)?/g;e=a.exec(t);)r.push(parseFloat(e[0]));return r},Ot=function(t,e){var r=t[0],a=t[1];return[e.a*r+e.c*a+e.e,e.b*r+e.d*a+e.f]},Tt=function(t){if("none"===gt(t,"display"))return[0,0,0,0];var e,r,a,i,n,s,o,h,c=parseFloat;if(xt(t,"polygon,polyline")){var u=It(t.getAttribute("points"));for(r=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,n=Number.NEGATIVE_INFINITY,e=0;e<u.length;e++){var f=u[e];r=Math.min(r,f[0]),i=Math.max(i,f[0]),a=Math.min(a,f[1]),n=Math.max(n,f[1])}h=[r,a,i-r,n-a]}else if(xt(t,"path")){var l=pt(t);r=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,n=Number.NEGATIVE_INFINITY;var d,p,g,x,b,m,v,y=0,k=0;for(e=0;e<l.numberOfItems;e++){var w=l.getItem(e),M=w.pathSegTypeAsLetter;switch(M){case"H":g=w.x,x=k;break;case"h":g=w.x+y,x=k;break;case"V":g=y,x=w.y;break;case"v":g=y,x=w.y+k;break;case"C":b=[w.x1,w.y1],m=[w.x2,w.y2],v=[w.x,w.y];break;case"c":b=[w.x1+y,w.y1+k],m=[w.x2+y,w.y2+k],v=[w.x+y,w.y+k];break;case"S":b=wt(e,[y,k],l,d,p),m=[w.x2,w.y2],v=[w.x,w.y];break;case"s":b=wt(e,[y,k],l,d,p),m=[w.x2+y,w.y2+k],v=[w.x+y,w.y+k];break;case"Q":c=[w.x1,w.y1],b=kt([y,k],c),m=kt([w.x,w.y],c),v=[w.x,w.y];break;case"q":c=[w.x1+y,w.y1+k],b=kt([y,k],c),m=kt([y+w.x,k+w.y],c),v=[w.x+y,w.y+k];break;case"T":b=wt(e,[y,k],l,d,p),b=kt([y,k],c),m=kt([w.x,w.y],c),v=[w.x,w.y];break;case"t":c=wt(e,[y,k],l,d,p),b=kt([y,k],c),m=kt([y+w.x,k+w.y],c),v=[w.x+y,w.y+k]}0<="sScCqQtT".indexOf(M)&&(d=y,p=k),0<="MLCSQT".indexOf(M)?(y=w.x,k=w.y):0<="mlcsqt".indexOf(M)?(y=w.x+y,k=w.y+k):"zZ".indexOf(M)<0&&(y=g,k=x),0<="CSQTcsqt".indexOf(M)?(r=Math.min(r,y,b[0],m[0],v[0]),i=Math.max(i,y,b[0],m[0],v[0]),a=Math.min(a,k,b[1],m[1],v[1]),n=Math.max(n,k,b[1],m[1],v[1])):(r=Math.min(r,y),i=Math.max(i,y),a=Math.min(a,k),n=Math.max(n,k))}h=[r,a,i-r,n-a]}else{if(xt(t,"svg"))return(s=t.getAttribute("viewBox"))&&(o=_t(s)),[c(t.getAttribute("x"))||o&&o[0]||0,c(t.getAttribute("y"))||o&&o[1]||0,c(t.getAttribute("width"))||o&&o[2]||0,c(t.getAttribute("height"))||o&&o[3]||0];if(xt(t,"g,clippath"))h=[0,0,0,0],L(t,function(t,e){var r=Tt(e);h=[Math.min(h[0],r[0]),Math.min(h[1],r[1]),Math.max(h[0]+h[2],r[0]+r[2])-Math.min(h[0],r[0]),Math.max(h[1]+h[3],r[1]+r[3])-Math.min(h[1],r[1])]});else{if(xt(t,"marker"))return(s=t.getAttribute("viewBox"))&&(o=_t(s)),[o&&o[0]||0,o&&o[1]||0,o&&o[2]||c(t.getAttribute("marker-width"))||0,o&&o[3]||c(t.getAttribute("marker-height"))||0];if(xt(t,"pattern"))return[c(t.getAttribute("x"))||0,c(t.getAttribute("y"))||0,c(t.getAttribute("width"))||0,c(t.getAttribute("height"))||0];var A=c(t.getAttribute("x1"))||c(t.getAttribute("x"))||c(t.getAttribute("cx")-c(t.getAttribute("r")))||0,S=c(t.getAttribute("x2"))||A+c(t.getAttribute("width"))||c(t.getAttribute("cx"))+c(t.getAttribute("r"))||0,F=c(t.getAttribute("y1"))||c(t.getAttribute("y"))||c(t.getAttribute("cy"))-c(t.getAttribute("r"))||0,C=c(t.getAttribute("y2"))||F+c(t.getAttribute("height"))||c(t.getAttribute("cy"))+c(t.getAttribute("r"))||0;h=[Math.min(A,S),Math.min(F,C),Math.max(A,S)-Math.min(A,S),Math.max(F,C)-Math.min(F,C)]}}if(!xt(t,"marker,svg,g")){var I=gt(t,"stroke-width")||1;return gt(t,"stroke-miterlimit")&&(I*=.5/Math.sin(Math.PI/12)),[h[0]-I,h[1]-I,h[2]+2*I,h[3]+2*I]}return h},g=function(t,e){switch(gt(t,"text-transform")){case"uppercase":return e.toUpperCase();case"lowercase":return e.toLowerCase();default:return e}},a=function(){function i(t,e,r,a,i){var n=document.createElement("canvas").getContext("2d");return n.font=[a,i,r,e].join(" "),n.measureText(t).width}function n(t,e,r,a,i){var n=document.createElementNS(h,"text");n.setAttribute("font-family",e),n.setAttribute("font-size",r),n.setAttribute("font-style",a),n.setAttribute("font-weight",i),n.appendChild(document.createTextNode(t));var s=document.createElementNS(h,"svg");s.appendChild(n),s.setAttribute("visibility","hidden"),document.body.appendChild(s);var o=n.getBBox().width;return document.body.removeChild(s),o}var s="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789!\"$%&/()=?'\\+*-_.:,;^}][{#~|<>",o={};return function(t){var e=o[t];if(!e){var r=i(s,t,"16px","normal","normal"),a=n(s,t,"16px","normal","normal");e=Math.abs(r-a)<.1?i:n,o[t]=e}return e}}();function m(t,e){if(0===t.length)return 0;var r=e.fontFamily;return a(r)(t,e.fontFamily,e.fontSize+"px",e.fontStyle,e.fontWeight)}function x(t,e,r){this.texts=[],this.tSpans=[],this.textAnchor=t,this.originX=e,this.originY=r}function v(t,e){var r;return(r=t&&t.toString().match(/^([\-0-9.]+)em$/))?parseFloat(r[1])*e:(r=t&&t.toString().match(/^([\-0-9.]+)(px|)$/))?parseFloat(r[1]):0}x.prototype.add=function(t,e){this.texts.push(e),this.tSpans.push(t)},x.prototype.put=function(t,e){var r,a,i,n=[],s=[],o=[],h=this.originX,c=this.originY,u=h,f=h;for(r=0;r<this.tSpans.length;r++){a=this.tSpans[r];var l=o[r]=e.clone(),d=gt(a,"fill");zt(a,d&&new ut(d),l);var p=h,g=c,x=a.getAttribute("dx");null!==x&&(p+=v(x,l.fontSize));var b=a.getAttribute("dy");null!==b&&(g+=v(b,l.fontSize)),n[r]=p,s[r]=g,h=p+m(this.texts[r],l),r<this.tSpans.length-1&&(h+=m(".",l)),c=g,u=Math.min(u,p),f=Math.max(f,h)}switch(this.textAnchor){case"start":i=0;break;case"middle":i=(f-u)/2;break;case"end":i=f-u}for(r=0;r<this.tSpans.length;r++){a=this.tSpans[r],"hidden"!==(gt(a,"visibility")||e.visibility)&&(ft.saveGraphicsState(),jt(o[r],e),ft.text(n[r]-i,s[r],this.texts[r],void 0,t),ft.restoreGraphicsState())}return[h,c]};var qt=function(o,h,t,e,c){ft.saveGraphicsState();var r,a,i=0,u=ft.getFontSize(),n=v(o.getAttribute("x"),u),s=v(o.getAttribute("y"),u);r=v(o.getAttribute("dx"),u),a=v(o.getAttribute("dy"),u);var f=c.visibility;if(0===o.childElementCount){var l=g(o,p(o.textContent));i=function(t,e){var r=e.textAnchor;if("start"===r)return 0;var a=m(t,e),i=0;switch(r){case"end":i=a;break;case"middle":i=a/2}return i}(l,c),"visible"===f&&ft.text(n+r-i,s+a,l,void 0,h)}else{var d=new x(c.textAnchor,n+r,s+a);L(o,function(t,e){if(e.textContent&&!xt(e,"title,desc,metadata")){var r,a=e.getAttribute("x");if(null!==a){var i=v(a,u);r=d.put(h,c),d=new x(e.getAttribute("text-anchor")||c.textAnchor,i,r[1])}var n=e.getAttribute("y");if(null!==n){var s=v(n,u);r=d.put(h,c),d=new x(e.getAttribute("text-anchor")||c.textAnchor,r[0],s)}l=g(o,p(e.textContent)),d.add(e,l)}}),d.put(h,c)}ft.restoreGraphicsState()},Nt=function(t,r,a,i,n,s){L(t,function(t,e){"defs"===e.tagName.toLowerCase()&&(Gt(e,r,a,i,n,!1,s),e.parentNode.removeChild(e))})},Pt=function(t,r,a,i,n,s,o){L(t,function(t,e){Gt(e,r,a,i,n,s,o)})},Et=function(t,e,r,a,i){var n,s=[],o=0,h=!1;L(t,function(t,e){if("stop"===e.tagName.toLowerCase()){var r=new ut(gt(e,"stop-color"));s.push({offset:parseFloat(e.getAttribute("offset")),color:[r.r,r.g,r.b]});var a=gt(e,"stop-opacity");a&&1!=a&&(o+=parseFloat(a),h=!0)}}),h&&(n=new ft.GState({opacity:o/s.length}));var c=new ft.ShadingPattern(e,r,s,n),u=i.get()+t.getAttribute("id");ft.addShadingPattern(u,c),a[u]=t};var l={"sans-serif":"helvetica",verdana:"helvetica",arial:"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",serif:"times",cursive:"times",fantasy:"times"};function zt(t,e,r){e&&e.ok&&(r.fill=e);var a=gt(t,"font-weight");a&&(r.fontWeight=a);var i=gt(t,"font-style");i&&(r.fontStyle=i);var n=gt(t,"font-family");if(n){var s=c.parse(n);r.fontFamily=function(t,e){var r="";"bold"===t.fontWeight&&(r="bold"),"italic"===t.fontStyle&&(r+="italic"),""===r&&(r="normal");var a=ft.getFontList(),i="";return e.some(function(t){var e=a[t];return e&&0<=e.indexOf(r)?(i=t,!0):(t=t.toLowerCase(),!!l.hasOwnProperty(t)&&(i=t,!0))})||(i="times"),i}(r,s)}var o=gt(t,"font-size");o&&(r.fontSize=parseFloat(o));var h=gt(t,"text-anchor");h&&(r.textAnchor=h)}function jt(t,e){if(t.fontFamily!==e.fontFamily&&(l.hasOwnProperty(t.fontFamily)?ft.setFont(l[t.fontFamily]):ft.setFont(t.fontFamily)),t.fill!==e.fill&&t.fill.ok){var r=t.fill;ft.setTextColor(r.r,r.g,r.b)}if(t.fontWeight!==e.fontWeight||t.fontStyle!==e.fontStyle){var a="";"bold"===t.fontWeight&&(a="bold"),"italic"===t.fontStyle&&(a+="italic"),""===a&&(a="normal"),ft.setFontType(a)}t.fontSize!==e.fontSize&&ft.setFontSize(t.fontSize)}var Gt=function(t,e,r,a,i,n,s){var o=s;if((s=s.clone(),"none"!==gt(t,"display"))&&("hidden"!==(s.visibility=gt(t,"visibility")||s.visibility)||xt(t,"svg,g,marker,a,pattern,defs,text"))){var h,c,u=!1,f=null,l="inherit",d="inherit",p=void 0,g=i&&!xt(t,"lineargradient,radialgradient,pattern,clippath");g?(h=Ct(t),c=Tt(t),ft.beginFormObject(c[0],c[1],c[2],c[3],h),h=ft.unitMatrix,i=!1):(h=ft.matrixMult(Ct(t),e),n||ft.saveGraphicsState());var x,b,m,v,y,k,w,M,A,S,F,C,I=t.hasAttribute("clip-path")&&"none"!==t.getAttribute("clip-path");if(I){var L=lt.exec(t.getAttribute("clip-path")),_=Ft(a.get()+L[1],r),O=h;_.hasAttribute("clipPathUnits")&&"objectboundingbox"===_.getAttribute("clipPathUnits").toLowerCase()&&(c=Tt(t),O=ft.matrixMult(new ft.Matrix(c[2],0,0,c[3],c[0],c[1]),O)),O=ft.matrixMult(Ct(_),O),ft.saveGraphicsState(),ft.setCurrentTransformationMatrix(O),Pt(_,ft.unitMatrix,r,a,!1,!0,s),ft.clip().discardPath(),ft.setCurrentTransformationMatrix(O.inversed())}if(xt(t,"g,path,rect,text,ellipse,line,circle,polygon,polyline")){var T=gt(t,"fill");if(T){var q=lt.exec(T);if(q){var N=a.get()+q[1],P=Ft(N,r);if(P&&xt(P,"lineargradient,radialgradient")){var E;P.hasAttribute("gradientUnits")&&"objectboundingbox"!==P.getAttribute("gradientUnits").toLowerCase()?E=ft.unitMatrix:(c||(c=Tt(t)),E=new ft.Matrix(c[2],0,0,c[3],c[0],c[1]));var z=Lt(P.getAttribute("gradientTransform"));p={key:N,matrix:ft.matrixMult(z,E)},l=!0}else if(P&&xt(P,"pattern")){var j,G,W,Y,D;p={key:N};var V=ft.unitMatrix;P.hasAttribute("patternUnits")&&"objectboundingbox"!==P.getAttribute("patternUnits").toLowerCase()||(c||(c=Tt(t)),V=new ft.Matrix(1,0,0,1,c[0],c[1]),D=(j=Tt(P))[0]*c[0],G=j[1]*c[1],W=j[2]*c[2],Y=j[3]*c[3],p.boundingBox=[D,G,D+W,G+Y],p.xStep=W,p.yStep=Y);var H=ft.unitMatrix;P.hasAttribute("patternContentUnits")&&"objectboundingbox"===P.getAttribute("patternContentUnits").toLowerCase()&&(c||(c=Tt(t)),H=new ft.Matrix(c[2],0,0,c[3],0,0),D=(j=p.boundingBox||Tt(P))[0]/c[0],G=j[1]/c[1],W=j[2]/c[2],Y=j[3]/c[3],p.boundingBox=[D,G,D+W,G+Y],p.xStep=W,p.yStep=Y);var U=ft.unitMatrix;P.hasAttribute("patternTransform")&&(U=Lt(P.getAttribute("patternTransform")));var B=H;B=ft.matrixMult(B,V),B=ft.matrixMult(B,U),B=ft.matrixMult(B,h),p.matrix=B,l=!0}else f=new ut("rgb(0, 0, 0)"),l=u=!0}else f=function(t){var e=/\s*rgba\(((?:[^,\)]*,){3}[^,\)]*)\)\s*/.exec(t);if(e){var r=_t(e[1]),a=new ut("rgb("+r.slice(0,3).join(",")+")");return a.a=r[3],a}return new ut(t)}(T),l=!!f.ok&&(u=!0)}var Q=1,X=1,R=gt(t,"fill-opacity");R&&(Q*=parseFloat(R)),f&&"number"==typeof f.a&&(Q*=f.a);var Z=gt(t,"stroke-opacity");Z&&(X*=parseFloat(Z)),it&&"number"==typeof it.a&&(X*=it.a);var $=gt(t,"opacity");if($){var J=parseFloat($);X*=J,Q*=J}var K=Q<1,tt=X<1;if(K||tt){var et={};K&&(et.opacity=Q),tt&&(et["stroke-opacity"]=X),ft.setGState(new ft.GState(et))}}if(xt(t,"g,path,rect,ellipse,line,circle,polygon,polyline")){u&&(s.fill=f,ft.setFillColor(f.r,f.g,f.b));var rt=gt(t,"stroke");if(rt){var at=gt(t,"stroke-width");void 0!==at&&""!==at?(at=Math.abs(parseFloat(at)),s.strokeWidth=at,ft.setLineWidth(at)):at=s.strokeWidth;var it=new ut(rt);it.ok&&(s.stroke=it,ft.setDrawColor(it.r,it.g,it.b),d=0!==at);var nt=gt(t,"stroke-linecap");nt&&ft.setLineCap(s.strokeLinecap=nt);var st=gt(t,"stroke-linejoin");st&&ft.setLineJoin(s.strokeLinejoin=st);var ot=gt(t,"stroke-dasharray");if(ot){ot=_t(ot);var ht=parseInt(gt(t,"stroke-dashoffset"))||0;s.strokeDasharray=ot,s.strokeDashoffset=ht,ft.setLineDashPattern(ot,ht)}var ct=gt(t,"stroke-miterlimit");void 0!==ct&&""!==ct&&ft.setLineMiterLimit(s.strokeMiterlimit=parseFloat(ct))}}switch("inherit"===l&&(l=null!==s.fill),"inherit"===d&&(d=null!==s.stroke),zt(t,f,s),jt(s,o),t.tagName.toLowerCase()){case"svg":k=t,w=h,M=r,A=i,S=s,F=a.nextChild(),C=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}(M),Nt(k,w,C,F,A,S),Pt(k,w,C,F,A,!1,S);break;case"g":Nt(t,h,r,a,i,s);case"a":case"marker":Pt(t,h,r,a,i,!1,s);break;case"defs":Pt(t,h,r,a,!0,!1,s);break;case"use":!function(t,e,r){var a=t.getAttribute("href")||t.getAttribute("xlink:href");if(a){var i=ft.getFormObject(r.get()+a.substring(1)),n=t.getAttribute("x")||0,s=t.getAttribute("y")||0,o=t.getAttribute("width")||i.width,h=t.getAttribute("height")||i.height,c=new ft.Matrix(o/i.width||0,0,0,h/i.height||0,n,s);c=ft.matrixMult(c,e),ft.doFormObject(r.get()+a.substring(1),c)}}(t,h,a);break;case"line":n||(ft.setCurrentTransformationMatrix(h),function(t,e,r){var a=[parseFloat(t.getAttribute("x1")||0),parseFloat(t.getAttribute("y1")||0)],i=[parseFloat(t.getAttribute("x2")||0),parseFloat(t.getAttribute("y2")||0)];null!==r.stroke&&ft.line(a[0],a[1],i[0],i[1]);var n=t.getAttribute("marker-start"),s=t.getAttribute("marker-end");if(n||s){var o=new At,h=bt(a,i);n&&o.addMarker(new St(e.get()+lt.exec(n)[1],a,h)),s&&o.addMarker(new St(e.get()+lt.exec(s)[1],i,h)),o.draw(ft.unitMatrix,r)}}(t,a,s));break;case"rect":n||ft.setCurrentTransformationMatrix(h),y=t,ft.roundedRect(parseFloat(y.getAttribute("x"))||0,parseFloat(y.getAttribute("y"))||0,parseFloat(y.getAttribute("width")),parseFloat(y.getAttribute("height")),parseFloat(y.getAttribute("rx"))||0,parseFloat(y.getAttribute("ry"))||0);break;case"ellipse":n||ft.setCurrentTransformationMatrix(h),v=t,ft.ellipse(parseFloat(v.getAttribute("cx"))||0,parseFloat(v.getAttribute("cy"))||0,parseFloat(v.getAttribute("rx")),parseFloat(v.getAttribute("ry")));break;case"circle":n||ft.setCurrentTransformationMatrix(h),b=t,m=parseFloat(b.getAttribute("r"))||0,ft.ellipse(parseFloat(b.getAttribute("cx"))||0,parseFloat(b.getAttribute("cy"))||0,m,m);break;case"text":qt(t,h,0,0,s);break;case"path":n||ft.setCurrentTransformationMatrix(h),function(t,A,e,S,r){var F=pt(t),C=t.getAttribute("marker-end"),I=t.getAttribute("marker-start"),L=t.getAttribute("marker-mid");C&&(C=e.get()+lt.exec(C)[1]),I&&(I=e.get()+lt.exec(I)[1]),L&&(L=e.get()+lt.exec(L)[1]);var a=function(){for(var t,e,r,a,i,n,s,o,h,c,u=0,f=0,l=u,d=f,p=[],g=new At,x=[0,0],b=0;b<F.numberOfItems;b++){var m=F.getItem(b),v=m.pathSegTypeAsLetter;switch(v){case"M":l=u,d=f,i=[m.x,m.y],h="m";break;case"m":l=u,d=f,i=[m.x+u,m.y+f],h="m";break;case"L":i=[m.x,m.y],h="l";break;case"l":i=[m.x+u,m.y+f],h="l";break;case"H":i=[m.x,f],h="l",r=m.x,a=f;break;case"h":i=[m.x+u,f],h="l",r=m.x+u,a=f;break;case"V":i=[u,m.y],h="l",r=u,a=m.y;break;case"v":i=[u,m.y+f],h="l",r=u,a=m.y+f;break;case"C":s=[m.x1,m.y1],o=[m.x2,m.y2],i=[m.x,m.y];break;case"c":s=[m.x1+u,m.y1+f],o=[m.x2+u,m.y2+f],i=[m.x+u,m.y+f];break;case"S":s=wt(b,[u,f],F,t,e),o=[m.x2,m.y2],i=[m.x,m.y];break;case"s":s=wt(b,[u,f],F,t,e),o=[m.x2+u,m.y2+f],i=[m.x+u,m.y+f];break;case"Q":n=[m.x1,m.y1],s=kt([u,f],n),o=kt([m.x,m.y],n),i=[m.x,m.y];break;case"q":n=[m.x1+u,m.y1+f],s=kt([u,f],n),o=kt([u+m.x,f+m.y],n),i=[m.x+u,m.y+f];break;case"T":n=wt(b,[u,f],F,t,e),s=kt([u,f],n),o=kt([m.x,m.y],n),i=[m.x,m.y];break;case"t":n=wt(b,[u,f],F,t,e),s=kt([u,f],n),o=kt([u+m.x,f+m.y],n),i=[m.x+u,m.y+f];break;case"Z":case"z":u=l,f=d,p.push({op:"h"})}var y=I&&(1===b||"mM".indexOf(v)<0&&0<="mM".indexOf(F.getItem(b-1).pathSegTypeAsLetter)),k=C&&(b===F.numberOfItems-1||"mM".indexOf(v)<0&&0<="mM".indexOf(F.getItem(b+1).pathSegTypeAsLetter)),w=L&&0<b&&!(1===b&&0<="mM".indexOf(F.getItem(b-1).pathSegTypeAsLetter));if(0<="sScCqQtT".indexOf(v))y&&g.addMarker(new St(I,[u,f],bt([u,f],s))),k&&g.addMarker(new St(C,i,bt(o,i))),w&&(c=vt([u,f],s),c=0<="mM".indexOf(F.getItem(b-1).pathSegTypeAsLetter)?c:mt(yt(x,c)),g.addMarker(new St(L,[u,f],Math.atan2(c[1],c[0])))),x=vt(o,i),t=u,e=f,S&&(s=Ot(s,A),o=Ot(o,A),i=Ot(i,A)),p.push({op:"c",c:[s[0],s[1],o[0],o[1],i[0],i[1]]});else if(0<="lLhHvVmM".indexOf(v)){if(c=vt([u,f],i),y&&g.addMarker(new St(I,[u,f],Math.atan2(c[1],c[0]))),k&&g.addMarker(new St(C,i,Math.atan2(c[1],c[0]))),w){var M=0<="mM".indexOf(v)?x:0<="mM".indexOf(F.getItem(b-1).pathSegTypeAsLetter)?c:mt(yt(x,c));g.addMarker(new St(L,[u,f],Math.atan2(M[1],M[0])))}x=c,S&&(i=Ot(i,A)),p.push({op:h,c:i})}0<="MLCSQT".indexOf(v)?(u=m.x,f=m.y):0<="mlcsqt".indexOf(v)?(u=m.x+u,f=m.y+f):"zZ".indexOf(v)<0&&(u=r,f=a)}return{lines:p,markers:g}}();0<a.lines.length&&ft.path(a.lines),(C||I||L)&&a.markers.draw(ft.unitMatrix,r)}(t,h,a,n,s);break;case"polygon":case"polyline":n||ft.setCurrentTransformationMatrix(h),function(t,e,r,a){if(t.hasAttribute("points")&&""!==t.getAttribute("points")){var i,n,s=It(t.getAttribute("points")),o=[{op:"m",c:s[0]}];for(i=1;i<s.length;i++)o.push({op:"l",c:s[i]});a&&o.push({op:"h"}),ft.path(o);var h=t.getAttribute("marker-end"),c=t.getAttribute("marker-start"),u=t.getAttribute("marker-mid");if(c||u||h){var f=o.length,l=new At;if(c&&(c=e.get()+lt.exec(c)[1],n=yt(vt(o[0].c,o[1].c),vt(o[f-2].c,o[0].c)),l.addMarker(new St(c,o[0].c,Math.atan2(n[1],n[0])))),u){u=e.get()+lt.exec(u)[1];var d,p=vt(o[0].c,o[1].c);for(i=1;i<o.length-2;i++)n=yt(p,d=vt(o[i].c,o[i+1].c)),l.addMarker(new St(u,o[i].c,Math.atan2(n[1],n[0]))),p=d;n=yt(p,d=vt(o[f-2].c,o[0].c)),l.addMarker(new St(u,o[f-2].c,Math.atan2(n[1],n[0])))}h&&(h=e.get()+lt.exec(h)[1],n=yt(vt(o[0].c,o[1].c),vt(o[f-2].c,o[0].c)),l.addMarker(new St(h,o[0].c,Math.atan2(n[1],n[0])))),l.draw(ft.unitMatrix,r)}}}(t,a,s,"polygon"===t.tagName.toLowerCase());break;case"image":ft.setCurrentTransformationMatrix(h),function(t,e){var r=parseFloat(t.getAttribute("width")),a=parseFloat(t.getAttribute("height")),i=parseFloat(t.getAttribute("x")||0),n=parseFloat(t.getAttribute("y")||0),s=t.getAttribute("xlink:href")||t.getAttribute("href"),o=s.match(dt);if(o&&"image/svg+xml"===o[2]){var h=o[5];h="base64"===o[4]?atob(h):decodeURIComponent(h);var c=(new DOMParser).parseFromString(h,"image/svg+xml").firstElementChild,u=t.getAttribute("preserveAspectRatio");return(!u||u.indexOf("defer")<0||!c.getAttribute("preserveAspectRatio"))&&c.setAttribute("preserveAspectRatio",u),c.setAttribute("x",String(i)),c.setAttribute("y",String(n)),c.setAttribute("width",String(r)),c.setAttribute("height",String(a)),Gt(c,ft.unitMatrix,{},e,!1,!1,Mt.default())}try{ft.addImage(s,"",i,n,r,a)}catch(t){"object"==typeof console&&console.warn&&console.warn('svg2pdfjs: Images with external resource link are not supported! ("'+s+'")')}}(t,a);break;case"lineargradient":Et(t,"axial",[t.getAttribute("x1")||0,t.getAttribute("y1")||0,t.getAttribute("x2")||1,t.getAttribute("y2")||0],r,a);break;case"radialgradient":Et(t,"radial",[t.getAttribute("fx")||t.getAttribute("cx")||.5,t.getAttribute("fy")||t.getAttribute("cy")||.5,0,t.getAttribute("cx")||.5,t.getAttribute("cy")||.5,t.getAttribute("r")||.5],r,a);break;case"pattern":!function(t,e,r,a){var i=r.get()+t.getAttribute("id");e[i]=t;var n=Tt(t),s=new ft.TilingPattern([n[0],n[1],n[0]+n[2],n[1]+n[3]],n[2],n[3],null,ft.unitMatrix);ft.beginTilingPattern(s),Pt(t,ft.unitMatrix,e,r,!1,!1,a),ft.endTilingPattern(i,s)}(t,r,a,s);break;case"clippath":x=t,r[a.get()+x.getAttribute("id")]=x}xt(t,"path,rect,ellipse,circle,polygon,polyline")&&!n&&(l&&d?ft.fillStroke(p):l?ft.fill(p):d&&ft.stroke()),g?ft.endFormObject(a.get()+t.getAttribute("id")):n||ft.restoreGraphicsState(),I&&ft.restoreGraphicsState()}},e=function(r,t,e){ft=t;var a=e.scale||1,i=e.xOffset||0,n=e.yOffset||0;return ft.advancedAPI(function(){ft.saveGraphicsState(),ft.setCurrentTransformationMatrix(new ft.Matrix(a,0,0,a,i,n));var t=Mt.default();ft.setLineWidth(t.strokeWidth);var e=t.fill;ft.setFillColor(e.r,e.g,e.b),ft.setFont(t.fontFamily),ft.setFontSize(t.fontSize),Gt(r.cloneNode(!0),ft.unitMatrix,{},new o(""),!1,!1,t),ft.restoreGraphicsState()}),ft};void 0!==i&&i.exports?(ut=r("./rgbcolor.js"),u=r("SvgPath"),c=r("font-family"),i.exports=e):(u=t.SvgPath,ut=t.RGBColor,c=t.FontFamily,t.svg2pdf=e,t.svgElementToPdf=e)}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this)},{"./rgbcolor.js":9,SvgPath:1,"font-family":8}]},{},[10])(10)});
|
|
//# sourceMappingURL=svg2pdf.min.js.map
|